Built motion from commit a41f143f.|2.5.32
authorAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 9 Aug 2021 12:21:56 +0000 (14:21 +0200)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Mon, 9 Aug 2021 12:21:56 +0000 (14:21 +0200)
1145 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/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/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/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 b8ae0d0..8f96375 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-08-09T11:44:53.486Z",
+    "time": "2021-08-09T12:11:44.164Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 878c476..ad7f139 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-08-09T11:44:53.486Z",
+    "time": "2021-08-09T12:11:44.164Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 88dc457..1c14d25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d23=['VIRTUAL','action','STRING','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','TEXT','sequelize','exports'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0x5d23,0x150));var _0x35d2=function(_0x6e89ff,_0x38dc02){_0x6e89ff=_0x6e89ff-0x0;var _0x1d0306=_0x5d23[_0x6e89ff];return _0x1d0306;};'use strict';var Sequelize=require(_0x35d2('0x0'));module[_0x35d2('0x1')]={'name':{'type':Sequelize[_0x35d2('0x2')],'get':function(_0x1c0ab6){return this['getDataValue'](_0x35d2('0x3'));}},'action':{'type':Sequelize[_0x35d2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x35d2('0x5'),_0x35d2('0x6'),_0x35d2('0x7'),_0x35d2('0x8'),'browser',_0x35d2('0x9'),'script']],'msg':_0x35d2('0xa')}},'comment':_0x35d2('0xa')},'data1':{'type':Sequelize[_0x35d2('0x4')](0x1000),'comment':_0x35d2('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x35d2('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x35d2('0x4')](0x1000)},'data6':{'type':Sequelize[_0x35d2('0x4')]},'data7':{'type':Sequelize[_0x35d2('0xc')]}};
\ No newline at end of file
+var _0x3117=['jscripty','browser','script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','STRING','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','action','contactManager','motionbar'];(function(_0x5dd408,_0x310804){var _0x5b51bf=function(_0x3168fe){while(--_0x3168fe){_0x5dd408['push'](_0x5dd408['shift']());}};_0x5b51bf(++_0x310804);}(_0x3117,0x125));var _0x7311=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x3117[_0x22ffbf];return _0x360c17;};'use strict';var Sequelize=require('sequelize');module[_0x7311('0x0')]={'name':{'type':Sequelize[_0x7311('0x1')],'get':function(_0x5ab827){return this[_0x7311('0x2')](_0x7311('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7311('0x4'),'integration',_0x7311('0x5'),_0x7311('0x6'),'urlForward',_0x7311('0x7'),'bot',_0x7311('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7311('0x9')},'data3':{'type':Sequelize[_0x7311('0xa')](0x1000),'comment':_0x7311('0xb')},'data4':{'type':Sequelize[_0x7311('0xa')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x7311('0xc')]}};
\ No newline at end of file
index 1e191b3..c2dc87e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa99c=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5337fe,_0x48faf7){var _0x2fb390=function(_0x9bc72){while(--_0x9bc72){_0x5337fe['push'](_0x5337fe['shift']());}};_0x2fb390(++_0x48faf7);}(_0xa99c,0x1e2));var _0xca99=function(_0xc9dd20,_0x1c016c){_0xc9dd20=_0xc9dd20-0x0;var _0x249ec4=_0xa99c[_0xc9dd20];return _0x249ec4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca99('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca99('0x1'));var rp=require(_0xca99('0x2'));var moment=require(_0xca99('0x3'));var BPromise=require(_0xca99('0x4'));var Mustache=require(_0xca99('0x5'));var util=require(_0xca99('0x6'));var path=require(_0xca99('0x7'));var sox=require(_0xca99('0x8'));var csv=require(_0xca99('0x9'));var ejs=require(_0xca99('0xa'));var fs=require('fs');var fs_extra=require(_0xca99('0xb'));var _=require(_0xca99('0xc'));var squel=require(_0xca99('0xd'));var crypto=require(_0xca99('0xe'));var jsforce=require(_0xca99('0xf'));var deskjs=require(_0xca99('0x10'));var toCsv=require('to-csv');var querystring=require(_0xca99('0x11'));var Papa=require('papaparse');var Redis=require(_0xca99('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xca99('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca99('0x14'));var logger=require(_0xca99('0x15'))(_0xca99('0x16'));var utils=require(_0xca99('0x17'));var config=require(_0xca99('0x18'));var licenseUtil=require(_0xca99('0x19'));var db=require(_0xca99('0x1a'))['db'];function respondWithStatusCode(_0x4a5e60,_0xa86903){_0xa86903=_0xa86903||0xcc;return function(_0x19596d){if(_0x19596d){return _0x4a5e60[_0xca99('0x1b')](_0xa86903);}return _0x4a5e60['status'](_0xa86903)[_0xca99('0x1c')]();};}function respondWithResult(_0x50bdab,_0x241b75){_0x241b75=_0x241b75||0xc8;return function(_0x1abbcb){if(_0x1abbcb){return _0x50bdab['status'](_0x241b75)[_0xca99('0x1d')](_0x1abbcb);}};}function respondWithFilteredResult(_0x22af7b,_0x63158e){return function(_0x5941b8){if(_0x5941b8){var _0x1e08d3=typeof _0x63158e[_0xca99('0x1e')]===_0xca99('0x1f')&&typeof _0x63158e['limit']===_0xca99('0x1f');var _0x2291b3=_0x5941b8[_0xca99('0x20')];var _0x550972=_0x1e08d3?0x0:_0x63158e['offset'];var _0xf8632c=_0x1e08d3?_0x5941b8[_0xca99('0x20')]:_0x63158e[_0xca99('0x1e')]+_0x63158e[_0xca99('0x21')];var _0x1f915e;if(_0xf8632c>=_0x2291b3){_0xf8632c=_0x2291b3;_0x1f915e=0xc8;}else{_0x1f915e=0xce;}_0x22af7b[_0xca99('0x22')](_0x1f915e);return _0x22af7b['set'](_0xca99('0x23'),_0x550972+'-'+_0xf8632c+'/'+_0x2291b3)[_0xca99('0x1d')](_0x5941b8);}return null;};}function patchUpdates(_0xdfe51b){return function(_0x18c8d8){try{jsonpatch[_0xca99('0x24')](_0x18c8d8,_0xdfe51b,!![]);}catch(_0x5afc51){return BPromise[_0xca99('0x25')](_0x5afc51);}return _0x18c8d8['save']();};}function saveUpdates(_0x403fa9,_0x5b872c){return function(_0x3fec09){if(_0x3fec09){return _0x3fec09[_0xca99('0x26')](_0x403fa9)[_0xca99('0x27')](function(_0x5a671a){return _0x5a671a;});}return null;};}function removeEntity(_0x190562,_0x2348d9){return function(_0x34a06e){if(_0x34a06e){return _0x34a06e[_0xca99('0x28')]()[_0xca99('0x27')](function(){_0x190562[_0xca99('0x22')](0xcc)[_0xca99('0x1c')]();});}};}function handleEntityNotFound(_0x5c4780,_0x29bc20){return function(_0x22b002){if(!_0x22b002){_0x5c4780[_0xca99('0x1b')](0x194);}return _0x22b002;};}function handleError(_0x4b1774,_0x318aa0){_0x318aa0=_0x318aa0||0x1f4;return function(_0x19b809){logger[_0xca99('0x29')](_0x19b809[_0xca99('0x2a')]);if(_0x19b809['name']){delete _0x19b809[_0xca99('0x2b')];}_0x4b1774['status'](_0x318aa0)[_0xca99('0x2c')](_0x19b809);};}exports['update']=function(_0x181f29,_0x120189){if(_0x181f29[_0xca99('0x2d')]['id']){delete _0x181f29['body']['id'];}return db[_0xca99('0x2e')][_0xca99('0x2f')]({'where':{'id':_0x181f29[_0xca99('0x30')]['id']}})['then'](handleEntityNotFound(_0x120189,null))[_0xca99('0x27')](saveUpdates(_0x181f29[_0xca99('0x2d')],null))['then'](respondWithResult(_0x120189,null))[_0xca99('0x31')](handleError(_0x120189,null));};exports[_0xca99('0x28')]=function(_0x46a4d6,_0x1df512){return db[_0xca99('0x2e')][_0xca99('0x2f')]({'where':{'id':_0x46a4d6[_0xca99('0x30')]['id']}})[_0xca99('0x27')](handleEntityNotFound(_0x1df512,null))[_0xca99('0x27')](removeEntity(_0x1df512,null))['catch'](handleError(_0x1df512,null));};
\ No newline at end of file
+var _0x7c80=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x430b24,_0x1f085e){var _0x5cee14=function(_0x15fcf4){while(--_0x15fcf4){_0x430b24['push'](_0x430b24['shift']());}};_0x5cee14(++_0x1f085e);}(_0x7c80,0x1c5));var _0x07c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c80[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x07c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07c8('0x1'));var jsonpatch=require(_0x07c8('0x2'));var rp=require(_0x07c8('0x3'));var moment=require(_0x07c8('0x4'));var BPromise=require(_0x07c8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x07c8('0x6'));var sox=require(_0x07c8('0x7'));var csv=require(_0x07c8('0x8'));var ejs=require(_0x07c8('0x9'));var fs=require('fs');var fs_extra=require(_0x07c8('0xa'));var _=require('lodash');var squel=require(_0x07c8('0xb'));var crypto=require(_0x07c8('0xc'));var jsforce=require(_0x07c8('0xd'));var deskjs=require(_0x07c8('0xe'));var toCsv=require(_0x07c8('0x8'));var querystring=require(_0x07c8('0xf'));var Papa=require('papaparse');var Redis=require(_0x07c8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x07c8('0x11'));var as=require(_0x07c8('0x12'));var hardwareService=require(_0x07c8('0x13'));var logger=require('../../config/logger')(_0x07c8('0x14'));var utils=require(_0x07c8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x07c8('0x16'));var db=require(_0x07c8('0x17'))['db'];function respondWithStatusCode(_0x78cb76,_0x1dad00){_0x1dad00=_0x1dad00||0xcc;return function(_0x31add3){if(_0x31add3){return _0x78cb76[_0x07c8('0x18')](_0x1dad00);}return _0x78cb76[_0x07c8('0x19')](_0x1dad00)['end']();};}function respondWithResult(_0x27a3a8,_0x3eb0c9){_0x3eb0c9=_0x3eb0c9||0xc8;return function(_0x23e71b){if(_0x23e71b){return _0x27a3a8[_0x07c8('0x19')](_0x3eb0c9)[_0x07c8('0x1a')](_0x23e71b);}};}function respondWithFilteredResult(_0x11fac8,_0x344eaf){return function(_0x4f3dd6){if(_0x4f3dd6){var _0x1f2be9=typeof _0x344eaf[_0x07c8('0x1b')]===_0x07c8('0x1c')&&typeof _0x344eaf[_0x07c8('0x1d')]===_0x07c8('0x1c');var _0x4737a4=_0x4f3dd6[_0x07c8('0x1e')];var _0x4a429b=_0x1f2be9?0x0:_0x344eaf['offset'];var _0x44aa0b=_0x1f2be9?_0x4f3dd6[_0x07c8('0x1e')]:_0x344eaf[_0x07c8('0x1b')]+_0x344eaf[_0x07c8('0x1d')];var _0x409c88;if(_0x44aa0b>=_0x4737a4){_0x44aa0b=_0x4737a4;_0x409c88=0xc8;}else{_0x409c88=0xce;}_0x11fac8[_0x07c8('0x19')](_0x409c88);return _0x11fac8[_0x07c8('0x1f')](_0x07c8('0x20'),_0x4a429b+'-'+_0x44aa0b+'/'+_0x4737a4)[_0x07c8('0x1a')](_0x4f3dd6);}return null;};}function patchUpdates(_0x58fcb0){return function(_0x4f8a3b){try{jsonpatch[_0x07c8('0x21')](_0x4f8a3b,_0x58fcb0,!![]);}catch(_0x385edf){return BPromise[_0x07c8('0x22')](_0x385edf);}return _0x4f8a3b[_0x07c8('0x23')]();};}function saveUpdates(_0x21cefa,_0x2e4715){return function(_0x3fa137){if(_0x3fa137){return _0x3fa137[_0x07c8('0x24')](_0x21cefa)['then'](function(_0x4b289a){return _0x4b289a;});}return null;};}function removeEntity(_0x10a847,_0x14c5db){return function(_0x39578b){if(_0x39578b){return _0x39578b[_0x07c8('0x25')]()[_0x07c8('0x26')](function(){_0x10a847['status'](0xcc)[_0x07c8('0x27')]();});}};}function handleEntityNotFound(_0x25e456,_0x2889cf){return function(_0x1437f9){if(!_0x1437f9){_0x25e456[_0x07c8('0x18')](0x194);}return _0x1437f9;};}function handleError(_0xe7589d,_0x27ff93){_0x27ff93=_0x27ff93||0x1f4;return function(_0xd38f7){logger[_0x07c8('0x28')](_0xd38f7['stack']);if(_0xd38f7[_0x07c8('0x29')]){delete _0xd38f7[_0x07c8('0x29')];}_0xe7589d[_0x07c8('0x19')](_0x27ff93)['send'](_0xd38f7);};}exports[_0x07c8('0x24')]=function(_0x4c9580,_0x2b9292){if(_0x4c9580[_0x07c8('0x2a')]['id']){delete _0x4c9580[_0x07c8('0x2a')]['id'];}return db[_0x07c8('0x2b')][_0x07c8('0x2c')]({'where':{'id':_0x4c9580[_0x07c8('0x2d')]['id']}})[_0x07c8('0x26')](handleEntityNotFound(_0x2b9292,null))['then'](saveUpdates(_0x4c9580[_0x07c8('0x2a')],null))[_0x07c8('0x26')](respondWithResult(_0x2b9292,null))[_0x07c8('0x2e')](handleError(_0x2b9292,null));};exports[_0x07c8('0x25')]=function(_0x45e011,_0x412151){return db[_0x07c8('0x2b')][_0x07c8('0x2c')]({'where':{'id':_0x45e011[_0x07c8('0x2d')]['id']}})[_0x07c8('0x26')](handleEntityNotFound(_0x412151,null))[_0x07c8('0x26')](removeEntity(_0x412151,null))[_0x07c8('0x2e')](handleError(_0x412151,null));};
\ No newline at end of file
index f37e88b..cba7a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb889=['../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','api','bluebird'];(function(_0x179572,_0x376b11){var _0x48fbb9=function(_0x253e5c){while(--_0x253e5c){_0x179572['push'](_0x179572['shift']());}};_0x48fbb9(++_0x376b11);}(_0xb889,0x10a));var _0x9b88=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xb889[_0x556bb1];return _0x45455f;};'use strict';var _=require(_0x9b88('0x0'));var util=require(_0x9b88('0x1'));var logger=require('../../config/logger')(_0x9b88('0x2'));var moment=require('moment');var BPromise=require(_0x9b88('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9b88('0x4'));var attributes=require(_0x9b88('0x5'));module['exports']=function(_0x5dba28,_0x36bffa){return _0x5dba28[_0x9b88('0x6')](_0x9b88('0x7'),attributes,{'tableName':_0x9b88('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4cb=['moment','bluebird','rimraf','../../config/environment','Action','lodash','util','../../config/logger','api'];(function(_0x21b037,_0x1f310a){var _0x20556c=function(_0x1855a9){while(--_0x1855a9){_0x21b037['push'](_0x21b037['shift']());}};_0x20556c(++_0x1f310a);}(_0xd4cb,0x9e));var _0xbd4c=function(_0x16fc7a,_0x3ee6d2){_0x16fc7a=_0x16fc7a-0x0;var _0x5b5f74=_0xd4cb[_0x16fc7a];return _0x5b5f74;};'use strict';var _=require(_0xbd4c('0x0'));var util=require(_0xbd4c('0x1'));var logger=require(_0xbd4c('0x2'))(_0xbd4c('0x3'));var moment=require(_0xbd4c('0x4'));var BPromise=require(_0xbd4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd4c('0x6'));var config=require(_0xbd4c('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x14bb59,_0x167de5){return _0x14bb59['define'](_0xbd4c('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f80ee3..081da78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x366c92,_0x195b7e){var _0xcb23bb=function(_0x55bdb8){while(--_0x55bdb8){_0x366c92['push'](_0x366c92['shift']());}};_0xcb23bb(++_0x195b7e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'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')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4a1628,_0x184d58){var _0x1e8b5e=function(_0x45b138){while(--_0x45b138){_0x4a1628['push'](_0x4a1628['shift']());}};_0x1e8b5e(++_0x184d58);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc4aa[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
index befe4d8..4c48013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa078=['multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x3a7fe5,_0x371426){var _0x18ed66=function(_0x4f6a16){while(--_0x4f6a16){_0x3a7fe5['push'](_0x3a7fe5['shift']());}};_0x18ed66(++_0x371426);}(_0xa078,0x1ee));var _0x8a07=function(_0x4d2430,_0x2710cf){_0x4d2430=_0x4d2430-0x0;var _0x4ac8ca=_0xa078[_0x4d2430];return _0x4ac8ca;};'use strict';var multer=require(_0x8a07('0x0'));var util=require('util');var path=require(_0x8a07('0x1'));var timeout=require(_0x8a07('0x2'));var express=require(_0x8a07('0x3'));var router=express[_0x8a07('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8a07('0x5'));var config=require(_0x8a07('0x6'));var controller=require(_0x8a07('0x7'));router[_0x8a07('0x8')](_0x8a07('0x9'),auth[_0x8a07('0xa')](),controller[_0x8a07('0xb')]);router[_0x8a07('0xc')](_0x8a07('0x9'),auth[_0x8a07('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x360d=['delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x10751e,_0x1e937d){var _0x2d04fc=function(_0x3673a0){while(--_0x3673a0){_0x10751e['push'](_0x10751e['shift']());}};_0x2d04fc(++_0x1e937d);}(_0x360d,0x188));var _0xd360=function(_0x5a0d6c,_0x180ba4){_0x5a0d6c=_0x5a0d6c-0x0;var _0x1b9fc1=_0x360d[_0x5a0d6c];return _0x1b9fc1;};'use strict';var multer=require(_0xd360('0x0'));var util=require(_0xd360('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd360('0x2'));var router=express[_0xd360('0x3')]();var fs_extra=require(_0xd360('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd360('0x5'));var config=require(_0xd360('0x6'));var controller=require(_0xd360('0x7'));router[_0xd360('0x8')](_0xd360('0x9'),auth[_0xd360('0xa')](),controller['update']);router[_0xd360('0xb')](_0xd360('0x9'),auth[_0xd360('0xa')](),controller['destroy']);module[_0xd360('0xc')]=router;
\ No newline at end of file
index 355b2ca..8457153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x3a6cde,_0x43e732){var _0x76fc0e=function(_0x24d881){while(--_0x24d881){_0x3a6cde['push'](_0x3a6cde['shift']());}};_0x76fc0e(++_0x43e732);}(_0xeda8,0x104));var _0x8eda=function(_0x270de6,_0x24d9e5){_0x270de6=_0x270de6-0x0;var _0x28eeb3=_0xeda8[_0x270de6];return _0x28eeb3;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0x8958=['TEXT','exports'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x8958,0x93));var _0x8895=function(_0x13e875,_0x5c7330){_0x13e875=_0x13e875-0x0;var _0x5c4ab2=_0x8958[_0x13e875];return _0x5c4ab2;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index d21e87b..6b2c6fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41f5=['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','dbH','status','json','offset','undefined','limit','set','apply','save','update','then','get','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','SELECT','right_join','SUM(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','orderBy','output','web','%s-%s.%s','generate','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','sequelize','QueryTypes','run','runReport','groupBy','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce'];(function(_0x4b36db,_0x24171c){var _0x1d79e3=function(_0x42621b){while(--_0x42621b){_0x4b36db['push'](_0x4b36db['shift']());}};_0x1d79e3(++_0x24171c);}(_0x41f5,0x96));var _0x541f=function(_0x5b4f98,_0x4e2213){_0x5b4f98=_0x5b4f98-0x0;var _0x1f5022=_0x41f5[_0x5b4f98];return _0x1f5022;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x541f('0x0'));var zipdir=require(_0x541f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x541f('0x2'));var moment=require('moment');var BPromise=require(_0x541f('0x3'));var Mustache=require(_0x541f('0x4'));var util=require('util');var path=require(_0x541f('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x541f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x541f('0x7'));var squel=require(_0x541f('0x8'));var crypto=require(_0x541f('0x9'));var jsforce=require(_0x541f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x541f('0xb'));var querystring=require(_0x541f('0xc'));var Papa=require(_0x541f('0xd'));var Redis=require(_0x541f('0xe'));var authService=require(_0x541f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x541f('0x10'));var hardwareService=require(_0x541f('0x11'));var logger=require(_0x541f('0x12'))(_0x541f('0x13'));var utils=require(_0x541f('0x14'));var config=require(_0x541f('0x15'));var licenseUtil=require(_0x541f('0x16'));var db=require(_0x541f('0x17'))['db'];var dbH=require(_0x541f('0x17'))[_0x541f('0x18')];function respondWithStatusCode(_0xf41918,_0xa6cacd){_0xa6cacd=_0xa6cacd||0xcc;return function(_0x48cd78){if(_0x48cd78){return _0xf41918['sendStatus'](_0xa6cacd);}return _0xf41918[_0x541f('0x19')](_0xa6cacd)['end']();};}function respondWithResult(_0x524abd,_0x79a4f0){_0x79a4f0=_0x79a4f0||0xc8;return function(_0x278dbf){if(_0x278dbf){return _0x524abd[_0x541f('0x19')](_0x79a4f0)[_0x541f('0x1a')](_0x278dbf);}};}function respondWithFilteredResult(_0x31c025,_0x21bc8b){return function(_0x551a86){if(_0x551a86){var _0x28af4d=typeof _0x21bc8b[_0x541f('0x1b')]===_0x541f('0x1c')&&typeof _0x21bc8b[_0x541f('0x1d')]==='undefined';var _0x17877d=_0x551a86['count'];var _0x3e9bf9=_0x28af4d?0x0:_0x21bc8b[_0x541f('0x1b')];var _0xe37e88=_0x28af4d?_0x551a86['count']:_0x21bc8b[_0x541f('0x1b')]+_0x21bc8b[_0x541f('0x1d')];var _0x394129;if(_0xe37e88>=_0x17877d){_0xe37e88=_0x17877d;_0x394129=0xc8;}else{_0x394129=0xce;}_0x31c025[_0x541f('0x19')](_0x394129);return _0x31c025[_0x541f('0x1e')]('Content-Range',_0x3e9bf9+'-'+_0xe37e88+'/'+_0x17877d)[_0x541f('0x1a')](_0x551a86);}return null;};}function patchUpdates(_0x432373){return function(_0x2a0258){try{jsonpatch[_0x541f('0x1f')](_0x2a0258,_0x432373,!![]);}catch(_0x463d9c){return BPromise['reject'](_0x463d9c);}return _0x2a0258[_0x541f('0x20')]();};}function saveUpdates(_0x53aac5,_0xdbd11f){return function(_0x2796f4){if(_0x2796f4){return _0x2796f4[_0x541f('0x21')](_0x53aac5)[_0x541f('0x22')](function(_0x3462b1){return _0x3462b1;});}return null;};}function removeEntity(_0x4ae1e5,_0x58df7b){return function(_0x68fa68){if(_0x68fa68){return _0x68fa68['destroy']()[_0x541f('0x22')](function(){var _0x263ce2=_0x68fa68[_0x541f('0x23')]({'plain':!![]});var _0x5a47ee='CustomReports';return db[_0x541f('0x24')][_0x541f('0x25')]({'where':{'type':_0x5a47ee,'resourceId':_0x263ce2['id']}})['then'](function(){return _0x68fa68;});})[_0x541f('0x22')](function(){_0x4ae1e5[_0x541f('0x19')](0xcc)[_0x541f('0x26')]();});}};}function handleEntityNotFound(_0x132f94,_0x4e19fc){return function(_0x2ec321){if(!_0x2ec321){_0x132f94[_0x541f('0x27')](0x194);}return _0x2ec321;};}function handleError(_0x2c6d29,_0x12ae8a){_0x12ae8a=_0x12ae8a||0x1f4;return function(_0x47ae03){logger['error'](_0x47ae03[_0x541f('0x28')]);if(_0x47ae03[_0x541f('0x29')]){delete _0x47ae03[_0x541f('0x29')];}_0x2c6d29[_0x541f('0x19')](_0x12ae8a)[_0x541f('0x2a')](_0x47ae03);};}exports[_0x541f('0x2b')]=function(_0x275b37,_0x2cb54f){var _0x269fd0={},_0x3331e8={},_0x117f5f={'count':0x0,'rows':[]};var _0x82538c=_[_0x541f('0x2c')](db[_0x541f('0x2d')][_0x541f('0x2e')],function(_0x377187){return{'name':_0x377187[_0x541f('0x2f')],'type':_0x377187[_0x541f('0x30')][_0x541f('0x31')]};});_0x3331e8[_0x541f('0x32')]=_['map'](_0x82538c,'name');_0x3331e8[_0x541f('0x33')]=_[_0x541f('0x34')](_0x275b37[_0x541f('0x33')]);_0x3331e8[_0x541f('0x35')]=_['intersection'](_0x3331e8['model'],_0x3331e8[_0x541f('0x33')]);_0x269fd0[_0x541f('0x36')]=_[_0x541f('0x37')](_0x3331e8[_0x541f('0x32')],qs['fields'](_0x275b37['query'][_0x541f('0x38')]));_0x269fd0[_0x541f('0x36')]=_0x269fd0[_0x541f('0x36')][_0x541f('0x39')]?_0x269fd0[_0x541f('0x36')]:_0x3331e8[_0x541f('0x32')];if(!_0x275b37['query'][_0x541f('0x3a')]('nolimit')){_0x269fd0[_0x541f('0x1d')]=qs[_0x541f('0x1d')](_0x275b37[_0x541f('0x33')][_0x541f('0x1d')]);_0x269fd0[_0x541f('0x1b')]=qs[_0x541f('0x1b')](_0x275b37[_0x541f('0x33')][_0x541f('0x1b')]);}_0x269fd0[_0x541f('0x3b')]=qs[_0x541f('0x3c')](_0x275b37[_0x541f('0x33')][_0x541f('0x3c')]);_0x269fd0[_0x541f('0x3d')]=qs[_0x541f('0x35')](_['pick'](_0x275b37[_0x541f('0x33')],_0x3331e8[_0x541f('0x35')]),_0x82538c);if(_0x275b37[_0x541f('0x33')]['filter']){_0x269fd0[_0x541f('0x3d')]=_[_0x541f('0x3e')](_0x269fd0[_0x541f('0x3d')],{'$or':_[_0x541f('0x2c')](_0x82538c,function(_0x5d1317){if(_0x5d1317[_0x541f('0x30')]!==_0x541f('0x3f')){var _0x4993ac={};_0x4993ac[_0x5d1317['name']]={'$like':'%'+_0x275b37[_0x541f('0x33')][_0x541f('0x40')]+'%'};return _0x4993ac;}})});}_0x269fd0=_[_0x541f('0x3e')]({},_0x269fd0,_0x275b37[_0x541f('0x41')]);var _0x34ec53={'where':_0x269fd0[_0x541f('0x3d')]};return db[_0x541f('0x2d')][_0x541f('0x42')](_0x34ec53)[_0x541f('0x22')](function(_0xc29bf0){_0x117f5f[_0x541f('0x42')]=_0xc29bf0;if(_0x275b37[_0x541f('0x33')][_0x541f('0x43')]){_0x269fd0[_0x541f('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x269fd0);})[_0x541f('0x22')](function(_0x8b8bb1){_0x117f5f[_0x541f('0x45')]=_0x8b8bb1;return _0x117f5f;})[_0x541f('0x22')](respondWithFilteredResult(_0x2cb54f,_0x269fd0))['catch'](handleError(_0x2cb54f,null));};exports[_0x541f('0x46')]=function(_0x1ab2a5,_0x3b3d66){var _0x178a5c={'raw':![],'where':{'id':_0x1ab2a5[_0x541f('0x47')]['id']}},_0x32c5e3={};_0x32c5e3[_0x541f('0x32')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x32c5e3[_0x541f('0x33')]=_[_0x541f('0x34')](_0x1ab2a5[_0x541f('0x33')]);_0x32c5e3[_0x541f('0x35')]=_[_0x541f('0x37')](_0x32c5e3[_0x541f('0x32')],_0x32c5e3['query']);_0x178a5c[_0x541f('0x36')]=_[_0x541f('0x37')](_0x32c5e3[_0x541f('0x32')],qs[_0x541f('0x38')](_0x1ab2a5[_0x541f('0x33')][_0x541f('0x38')]));_0x178a5c[_0x541f('0x36')]=_0x178a5c['attributes'][_0x541f('0x39')]?_0x178a5c[_0x541f('0x36')]:_0x32c5e3['model'];if(_0x1ab2a5['query']['includeAll']){_0x178a5c['include']=[{'all':!![]}];}_0x178a5c=_['merge']({},_0x178a5c,_0x1ab2a5['options']);return db[_0x541f('0x2d')][_0x541f('0x48')](_0x178a5c)[_0x541f('0x22')](handleEntityNotFound(_0x3b3d66,null))[_0x541f('0x22')](respondWithResult(_0x3b3d66,null))[_0x541f('0x49')](handleError(_0x3b3d66,null));};exports[_0x541f('0x4a')]=function(_0xf5185d,_0x1ef0c0){return db[_0x541f('0x2d')][_0x541f('0x4a')](_0xf5185d['body'],{})['then'](function(_0xdd3a3a){var _0x27fb73=_0xf5185d[_0x541f('0x4b')]['get']({'plain':!![]});if(!_0x27fb73)throw new Error(_0x541f('0x4c'));if(_0x27fb73['role']==='user'){var _0x2ca26c=_0xdd3a3a[_0x541f('0x23')]({'plain':!![]});var _0xfd20d1='Reports';return db['UserProfileSection']['find']({'where':{'name':_0xfd20d1,'userProfileId':_0x27fb73[_0x541f('0x4d')]},'raw':!![]})[_0x541f('0x22')](function(_0x3245db){if(_0x3245db&&_0x3245db['autoAssociation']===0x0){return db['UserProfileResource'][_0x541f('0x4a')]({'name':_0x2ca26c[_0x541f('0x29')],'resourceId':_0x2ca26c['id'],'type':'CustomReports','sectionId':_0x3245db['id']},{})[_0x541f('0x22')](function(){return _0xdd3a3a;});}else{return _0xdd3a3a;}})[_0x541f('0x49')](function(_0x2f8a86){logger['error'](_0x541f('0x4e'),_0x2f8a86);throw _0x2f8a86;});}return _0xdd3a3a;})[_0x541f('0x22')](respondWithResult(_0x1ef0c0,0xc9))[_0x541f('0x49')](handleError(_0x1ef0c0,null));};exports[_0x541f('0x21')]=function(_0x55d8dc,_0x458f5d){if(_0x55d8dc[_0x541f('0x4f')]['id']){delete _0x55d8dc[_0x541f('0x4f')]['id'];}return db['AnalyticCustomReport'][_0x541f('0x48')]({'where':{'id':_0x55d8dc[_0x541f('0x47')]['id']}})[_0x541f('0x22')](handleEntityNotFound(_0x458f5d,null))[_0x541f('0x22')](saveUpdates(_0x55d8dc[_0x541f('0x4f')],null))[_0x541f('0x22')](respondWithResult(_0x458f5d,null))['catch'](handleError(_0x458f5d,null));};exports['destroy']=function(_0x542e14,_0x22a7cc){return db['AnalyticCustomReport']['find']({'where':{'id':_0x542e14[_0x541f('0x47')]['id']}})[_0x541f('0x22')](handleEntityNotFound(_0x22a7cc,null))[_0x541f('0x22')](removeEntity(_0x22a7cc,null))[_0x541f('0x49')](handleError(_0x22a7cc,null));};exports[_0x541f('0x50')]=function(_0x159cae,_0x377524){var _0x11d326=0xa;var _0x470291=[_0x541f('0x51'),_0x541f('0x52'),'right_join',_0x541f('0x53')];var _0x411174={'SUM':'SUM(%s)','COUNT':_0x541f('0x54'),'COUNT DISTINCT':_0x541f('0x55'),'MAX':_0x541f('0x56'),'MIN':_0x541f('0x57'),'AVG':_0x541f('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x541f('0x59'),'GROUP_CONCAT DESC':_0x541f('0x5a')};var _0x2d010c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x541f('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x541f('0x5c'),'UNIX_TIMESTAMP':_0x541f('0x5d')};var _0x2ae932=function(_0x18dcaf){return!_[_0x541f('0x5e')]([_0x541f('0x5f'),_0x541f('0x60'),_0x541f('0x61'),_0x541f('0x62')],_0x18dcaf);};var _0x421332=function(_0x3f72b2){if(!_0x3f72b2||!_0x3f72b2['rules'][_0x541f('0x39')]){return'';}for(var _0x31aafe='(',_0x5ebcfa=0x0;_0x5ebcfa<_0x3f72b2['rules'][_0x541f('0x39')];_0x5ebcfa+=0x1){_0x5ebcfa>0x0&&(_0x31aafe+='\x20'+_0x3f72b2[_0x541f('0x63')]+'\x20');_0x31aafe+=_0x3f72b2[_0x541f('0x64')][_0x5ebcfa][_0x541f('0x65')]?_0x421332(_0x3f72b2[_0x541f('0x64')][_0x5ebcfa][_0x541f('0x65')]):_0x3f72b2['rules'][_0x5ebcfa][_0x541f('0x66')]+'\x20'+_0x3f72b2[_0x541f('0x64')][_0x5ebcfa]['condition']+(_0x2ae932(_0x3f72b2[_0x541f('0x64')][_0x5ebcfa][_0x541f('0x67')])?'\x20'+_0x3f72b2[_0x541f('0x64')][_0x5ebcfa][_0x541f('0x68')]:'');}return _0x31aafe+')';};var _0x3151bd={'where':{'id':_0x159cae[_0x541f('0x47')]['id']}},_0x25ce85,_0x2984a3,_0x41f40b,_0x4b9666,_0x105f68;_0x3151bd=_[_0x541f('0x3e')]({},_0x3151bd,_0x159cae[_0x541f('0x41')]);return db[_0x541f('0x2d')]['find'](_0x3151bd)[_0x541f('0x22')](function(_0x3b36e6){if(_0x3b36e6){_0x25ce85=_0x3b36e6;return _0x3b36e6['getFields']();}return null;})[_0x541f('0x22')](function(_0xf24f9f){if(_0xf24f9f){if(!_0xf24f9f['length']){throw new db[(_0x541f('0x69'))][(_0x541f('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2984a3=_0xf24f9f;return db[_0x541f('0x6b')][_0x541f('0x6c')]({'raw':!![]});}return null;})[_0x541f('0x22')](function(_0x3cae24){if(_0x3cae24){_0x41f40b=_[_0x541f('0x6d')](_0x3cae24,'id');var _0x18c189;var _0x3cf075=squel[_0x541f('0x6e')]();_0x3cf075[_0x541f('0x6f')](_0x25ce85[_0x541f('0x70')]);for(var _0x229c4f=0x0;_0x229c4f<_0x2984a3['length'];_0x229c4f+=0x1){_0x18c189=_0x2984a3[_0x229c4f][_0x541f('0x71')]?_0x41f40b[_0x2984a3[_0x229c4f][_0x541f('0x71')]][_0x541f('0x72')]:_0x2984a3[_0x229c4f][_0x541f('0x66')];_0x18c189=_0x2984a3[_0x229c4f][_0x541f('0x73')]?_['replace'](_0x411174[_0x2984a3[_0x229c4f]['function']],'%s',_0x18c189):_0x18c189;_0x18c189=_0x2984a3[_0x229c4f][_0x541f('0x74')]?_[_0x541f('0x75')](_0x2d010c[_0x2984a3[_0x229c4f][_0x541f('0x74')]],'%s',_0x18c189):_0x18c189;if(_0x2984a3[_0x229c4f]['groupBy']){_0x3cf075[_0x541f('0x65')](_0x18c189);}_0x2984a3[_0x229c4f]['orderBy']&&_0x3cf075[_0x541f('0x3b')](_0x18c189,_0x2984a3[_0x229c4f]['orderBy']===_0x541f('0x76')?![]:!![]);_0x3cf075['field'](_0x18c189,_0x2984a3[_0x229c4f][_0x541f('0x77')]||_0x18c189);}if(_0x25ce85[_0x541f('0x78')]){_0x25ce85[_0x541f('0x78')]=JSON[_0x541f('0x79')](_0x25ce85[_0x541f('0x78')]);for(var _0x199750=0x0;_0x199750<_0x25ce85[_0x541f('0x78')][_0x541f('0x39')];_0x199750+=0x1){if(_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x30')]&&_['includes'](_0x470291,_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x30')])&&_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x7a')]&&_0x25ce85[_0x541f('0x78')][_0x199750]['foreignTable']&&_0x25ce85['joins'][_0x199750]['foreignKey']){_0x3cf075[_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x30')]](_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x7b')],null,util[_0x541f('0x74')](_0x541f('0x7c'),_0x25ce85[_0x541f('0x70')],_0x25ce85['joins'][_0x199750][_0x541f('0x7a')],_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x7b')],_0x25ce85[_0x541f('0x78')][_0x199750][_0x541f('0x7d')]));}}}if(_0x25ce85[_0x541f('0x7e')]){_0x25ce85['conditions']=JSON['parse'](_0x25ce85[_0x541f('0x7e')]);_0x3cf075[_0x541f('0x3d')](_0x421332(_0x25ce85[_0x541f('0x7e')][_0x541f('0x65')]));}_0x105f68=_0x3cf075[_0x541f('0x7f')]();_0x3cf075['limit'](_0x11d326);_0x3cf075[_0x541f('0x1b')](0x0);logger[_0x541f('0x80')](_0x541f('0x81'),_0x3cf075['toString']());return dbH['sequelize']['query'](_0x3cf075[_0x541f('0x82')](),{'type':dbH['sequelize']['QueryTypes'][_0x541f('0x83')]});}})[_0x541f('0x22')](respondWithResult(_0x377524,null))['catch'](handleError(_0x377524,null));};function runReport(_0x4fbf6a,_0x5d7acf,_0x4902a4){var _0x1ab7ee=_0x5d7acf[_0x541f('0x29')];var _0x1d7fe8=0xa;var _0x381417=[_0x541f('0x51'),_0x541f('0x52'),_0x541f('0x84'),_0x541f('0x53')];var _0x2180b1={'SUM':_0x541f('0x85'),'COUNT':_0x541f('0x54'),'COUNT DISTINCT':_0x541f('0x55'),'MAX':_0x541f('0x56'),'MIN':_0x541f('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x541f('0x86'),'GROUP_CONCAT ASC':_0x541f('0x59'),'GROUP_CONCAT DESC':_0x541f('0x5a')};var _0x380d9c={'SEC_TO_TIME':_0x541f('0x87'),'DATE':_0x541f('0x5b'),'HOUR':_0x541f('0x88'),'ROUND':_0x541f('0x5c'),'UNIX_TIMESTAMP':_0x541f('0x5d')};var _0x30151a=function(_0x28c2f6){return!_[_0x541f('0x5e')]([_0x541f('0x5f'),_0x541f('0x60'),_0x541f('0x61'),_0x541f('0x62')],_0x28c2f6);};var _0x38d3fc=function(_0x10ef58){if(!_0x10ef58||!_0x10ef58[_0x541f('0x64')][_0x541f('0x39')]){return'';}for(var _0x542df='(',_0x167acb=0x0;_0x167acb<_0x10ef58[_0x541f('0x64')][_0x541f('0x39')];_0x167acb+=0x1){_0x167acb>0x0&&(_0x542df+='\x20'+_0x10ef58[_0x541f('0x63')]+'\x20');_0x542df+=_0x10ef58[_0x541f('0x64')][_0x167acb][_0x541f('0x65')]?_0x38d3fc(_0x10ef58[_0x541f('0x64')][_0x167acb]['group']):_0x10ef58[_0x541f('0x64')][_0x167acb]['field']+'\x20'+_0x10ef58[_0x541f('0x64')][_0x167acb][_0x541f('0x67')]+(_0x30151a(_0x10ef58[_0x541f('0x64')][_0x167acb]['condition'])?'\x20'+_0x10ef58['rules'][_0x167acb][_0x541f('0x68')]:'');}return _0x542df+')';};var _0x2e6d54={'where':{'id':_0x4fbf6a['id']}},_0x401cc6,_0x50b6c7,_0x9e4049,_0x3cbf3a,_0x55358f;_0x2e6d54=_[_0x541f('0x3e')]({},_0x2e6d54,_0x4902a4);return db[_0x541f('0x2d')][_0x541f('0x48')](_0x2e6d54)['then'](function(_0x4777f0){if(_0x4777f0){_0x401cc6=_0x4777f0;return _0x4777f0[_0x541f('0x89')]();}return null;})['then'](function(_0x46c9a5){if(_0x46c9a5){if(!_0x46c9a5['length']){throw new db[(_0x541f('0x69'))][(_0x541f('0x6a'))](_0x541f('0x8a'),0x193);}_0x50b6c7=_0x46c9a5;return db['AnalyticMetric'][_0x541f('0x6c')]({'raw':!![]});}return null;})[_0x541f('0x22')](function(_0x397f05){if(_0x397f05){_0x9e4049=_[_0x541f('0x6d')](_0x397f05,'id');var _0x261e09;var _0x4c6f5a=squel[_0x541f('0x6e')]();_0x4c6f5a[_0x541f('0x6f')](_0x401cc6['table']);for(var _0x25f663=0x0;_0x25f663<_0x50b6c7[_0x541f('0x39')];_0x25f663+=0x1){_0x261e09=_0x50b6c7[_0x25f663][_0x541f('0x71')]?_0x9e4049[_0x50b6c7[_0x25f663][_0x541f('0x71')]][_0x541f('0x72')]:_0x50b6c7[_0x25f663][_0x541f('0x66')];_0x261e09=_0x50b6c7[_0x25f663][_0x541f('0x73')]?_[_0x541f('0x75')](_0x2180b1[_0x50b6c7[_0x25f663][_0x541f('0x73')]],'%s',_0x261e09):_0x261e09;_0x261e09=_0x50b6c7[_0x25f663][_0x541f('0x74')]?_['replace'](_0x380d9c[_0x50b6c7[_0x25f663][_0x541f('0x74')]],'%s',_0x261e09):_0x261e09;if(_0x50b6c7[_0x25f663]['groupBy']){_0x4c6f5a['group'](_0x261e09);}_0x50b6c7[_0x25f663][_0x541f('0x8b')]&&_0x4c6f5a['order'](_0x261e09,_0x50b6c7[_0x25f663][_0x541f('0x8b')]===_0x541f('0x76')?![]:!![]);_0x4c6f5a[_0x541f('0x66')](_0x261e09,_0x50b6c7[_0x25f663][_0x541f('0x77')]||_0x261e09);}if(_0x401cc6[_0x541f('0x78')]){_0x401cc6['joins']=JSON[_0x541f('0x79')](_0x401cc6['joins']);for(var _0x7f5baf=0x0;_0x7f5baf<_0x401cc6[_0x541f('0x78')][_0x541f('0x39')];_0x7f5baf+=0x1){if(_0x401cc6['joins'][_0x7f5baf][_0x541f('0x30')]&&_[_0x541f('0x5e')](_0x381417,_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x30')])&&_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x7a')]&&_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x7b')]&&_0x401cc6['joins'][_0x7f5baf][_0x541f('0x7d')]){_0x4c6f5a[_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x30')]](_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x7b')],null,util[_0x541f('0x74')](_0x541f('0x7c'),_0x401cc6[_0x541f('0x70')],_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x7a')],_0x401cc6['joins'][_0x7f5baf]['foreignTable'],_0x401cc6[_0x541f('0x78')][_0x7f5baf][_0x541f('0x7d')]));}}}if(_0x401cc6[_0x541f('0x7e')]){_0x401cc6['conditions']=JSON['parse'](_0x401cc6[_0x541f('0x7e')]);_0x4c6f5a[_0x541f('0x3d')](_0x38d3fc(_0x401cc6['conditions']['group']));}_0x55358f=_0x4c6f5a[_0x541f('0x7f')]();_0x4c6f5a[_0x541f('0x1d')](_0x1d7fe8);_0x4c6f5a[_0x541f('0x1b')](0x0);return;}})[_0x541f('0x22')](function(){if(_0x5d7acf[_0x541f('0x8c')]===_0x541f('0x8d')){return null;}var _0x53afa6=_['merge'](_0x5d7acf,{'name':_0x5d7acf['fullPath']||_0x5d7acf[_0x541f('0x29')]||_0x401cc6[_0x541f('0x29')],'basename':_0x1ab7ee,'savename':util[_0x541f('0x74')](_0x541f('0x8e'),_0x5d7acf[_0x541f('0x29')]||_0x401cc6['name'],require('randomstring')[_0x541f('0x8f')](0x4),_0x5d7acf['output']||_0x541f('0x90')),'reportId':_0x401cc6['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x541f('0x4a')](_0x53afa6,{'raw':!![]});})[_0x541f('0x22')](function(_0x459bec){if(_0x401cc6[_0x541f('0x70')]==='cdr'){_0x55358f[_0x541f('0x3d')](_0x401cc6[_0x541f('0x70')]+_0x541f('0x91'),_0x5d7acf[_0x541f('0x92')],_0x5d7acf[_0x541f('0x93')]);}else{_0x55358f['where'](_0x401cc6[_0x541f('0x70')]+_0x541f('0x94'),_0x5d7acf[_0x541f('0x92')],_0x5d7acf['endDate']);}if(_0x459bec){logger['info'](_0x541f('0x95'),_0x55358f[_0x541f('0x82')]());require(_0x541f('0x96'))[_0x541f('0x97')](path[_0x541f('0x51')](__dirname,_0x541f('0x98'),_0x459bec[_0x541f('0x8c')]),[_0x459bec['id'],_0x55358f[_0x541f('0x82')](),path['join'](__dirname,_0x541f('0x99'),_0x459bec[_0x541f('0x9a')]),_0x1ab7ee]);return _0x459bec;}else{var _0x3e6528=squel[_0x541f('0x6e')]();_0x3e6528['from']('('+_0x55358f[_0x541f('0x82')]()+')','countTable');_0x3e6528[_0x541f('0x66')](_0x541f('0x9b'),_0x541f('0x42'));_0x55358f['limit'](_0x5d7acf[_0x541f('0x1d')]||_0x1d7fe8);_0x55358f[_0x541f('0x1b')](_0x5d7acf['offset']||0x0);return dbH[_0x541f('0x9c')]['query'](_0x3e6528[_0x541f('0x82')](),{'type':dbH[_0x541f('0x9c')]['QueryTypes'][_0x541f('0x83')]})[_0x541f('0x22')](function(_0x5a87e9){if(!_0x5a87e9['length']){_0x3cbf3a=0x0;}else{_0x3cbf3a=_0x5a87e9[0x0][_0x541f('0x42')]||0x0;}return dbH[_0x541f('0x9c')][_0x541f('0x33')](_0x55358f[_0x541f('0x82')](),{'type':dbH['sequelize'][_0x541f('0x9d')]['SELECT']});})[_0x541f('0x22')](function(_0x59a1c2){return{'rows':_0x59a1c2||[],'count':_0x3cbf3a};});}});}exports[_0x541f('0x9e')]=function(_0x2d82e2,_0x3b228c){return runReport(_0x2d82e2[_0x541f('0x47')],_0x2d82e2[_0x541f('0x33')],_0x2d82e2['options'])[_0x541f('0x22')](respondWithResult(_0x3b228c,null))[_0x541f('0x49')](handleError(_0x3b228c,null));};exports[_0x541f('0x9f')]=runReport;exports[_0x541f('0x33')]=function(_0x567895,_0x2c861b){var _0x991e08=0xa;var _0x184e5c=['join',_0x541f('0x52'),_0x541f('0x84'),_0x541f('0x53')];var _0x8cd550={'SUM':_0x541f('0x85'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x541f('0x56'),'MIN':_0x541f('0x57'),'AVG':_0x541f('0x58'),'GROUP_CONCAT':_0x541f('0x86'),'GROUP_CONCAT ASC':_0x541f('0x59'),'GROUP_CONCAT DESC':_0x541f('0x5a')};var _0xa3fbbe={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x541f('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x541f('0x5c'),'UNIX_TIMESTAMP':_0x541f('0x5d')};var _0x41a79f=function(_0x29f950){return!_['includes']([_0x541f('0x5f'),_0x541f('0x60'),_0x541f('0x61'),_0x541f('0x62')],_0x29f950);};var _0x3a63ca=function(_0x127236){if(!_0x127236||!_0x127236[_0x541f('0x64')][_0x541f('0x39')]){return'';}for(var _0x5e7b85='(',_0x43e856=0x0;_0x43e856<_0x127236[_0x541f('0x64')][_0x541f('0x39')];_0x43e856+=0x1){_0x43e856>0x0&&(_0x5e7b85+='\x20'+_0x127236['operator']+'\x20');_0x5e7b85+=_0x127236['rules'][_0x43e856][_0x541f('0x65')]?_0x3a63ca(_0x127236['rules'][_0x43e856][_0x541f('0x65')]):_0x127236[_0x541f('0x64')][_0x43e856][_0x541f('0x66')]+'\x20'+_0x127236[_0x541f('0x64')][_0x43e856]['condition']+(_0x41a79f(_0x127236[_0x541f('0x64')][_0x43e856][_0x541f('0x67')])?'\x20'+_0x127236[_0x541f('0x64')][_0x43e856][_0x541f('0x68')]:'');}return _0x5e7b85+')';};var _0x58b6e2={'where':{'id':_0x567895[_0x541f('0x47')]['id']}},_0x6f17b4,_0x36e764,_0x7c2529,_0x433f29,_0x2694e9;_0x58b6e2=_[_0x541f('0x3e')]({},_0x58b6e2,_0x567895[_0x541f('0x41')]);return db[_0x541f('0x2d')][_0x541f('0x48')](_0x58b6e2)['then'](function(_0x3df0ba){if(_0x3df0ba){_0x6f17b4=_0x3df0ba;return _0x3df0ba['getFields']();}return null;})[_0x541f('0x22')](function(_0x1c630e){if(_0x1c630e){if(!_0x1c630e[_0x541f('0x39')]){throw new db[(_0x541f('0x69'))][(_0x541f('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x36e764=_0x1c630e;return db[_0x541f('0x6b')][_0x541f('0x6c')]({'raw':!![]});}return null;})[_0x541f('0x22')](function(_0x37c6db){if(_0x37c6db){_0x7c2529=_[_0x541f('0x6d')](_0x37c6db,'id');var _0x5055c7;var _0x44c122=squel[_0x541f('0x6e')]();_0x44c122[_0x541f('0x6f')](_0x6f17b4['table']);for(var _0x5f5951=0x0;_0x5f5951<_0x36e764[_0x541f('0x39')];_0x5f5951+=0x1){_0x5055c7=_0x36e764[_0x5f5951][_0x541f('0x71')]?_0x7c2529[_0x36e764[_0x5f5951][_0x541f('0x71')]][_0x541f('0x72')]:_0x36e764[_0x5f5951]['field'];_0x5055c7=_0x36e764[_0x5f5951][_0x541f('0x73')]?_[_0x541f('0x75')](_0x8cd550[_0x36e764[_0x5f5951][_0x541f('0x73')]],'%s',_0x5055c7):_0x5055c7;_0x5055c7=_0x36e764[_0x5f5951][_0x541f('0x74')]?_[_0x541f('0x75')](_0xa3fbbe[_0x36e764[_0x5f5951][_0x541f('0x74')]],'%s',_0x5055c7):_0x5055c7;if(_0x36e764[_0x5f5951][_0x541f('0xa0')]){_0x44c122[_0x541f('0x65')](_0x5055c7);}_0x36e764[_0x5f5951][_0x541f('0x8b')]&&_0x44c122['order'](_0x5055c7,_0x36e764[_0x5f5951][_0x541f('0x8b')]==='DESC'?![]:!![]);_0x44c122[_0x541f('0x66')](_0x5055c7,_0x36e764[_0x5f5951]['alias']||_0x5055c7);}if(_0x6f17b4[_0x541f('0x78')]){_0x6f17b4[_0x541f('0x78')]=JSON[_0x541f('0x79')](_0x6f17b4['joins']);for(var _0x329d6d=0x0;_0x329d6d<_0x6f17b4[_0x541f('0x78')]['length'];_0x329d6d+=0x1){if(_0x6f17b4[_0x541f('0x78')][_0x329d6d][_0x541f('0x30')]&&_[_0x541f('0x5e')](_0x184e5c,_0x6f17b4['joins'][_0x329d6d]['type'])&&_0x6f17b4['joins'][_0x329d6d][_0x541f('0x7a')]&&_0x6f17b4[_0x541f('0x78')][_0x329d6d]['foreignTable']&&_0x6f17b4['joins'][_0x329d6d][_0x541f('0x7d')]){_0x44c122[_0x6f17b4[_0x541f('0x78')][_0x329d6d]['type']](_0x6f17b4['joins'][_0x329d6d]['foreignTable'],null,util['format'](_0x541f('0x7c'),_0x6f17b4[_0x541f('0x70')],_0x6f17b4[_0x541f('0x78')][_0x329d6d][_0x541f('0x7a')],_0x6f17b4[_0x541f('0x78')][_0x329d6d][_0x541f('0x7b')],_0x6f17b4[_0x541f('0x78')][_0x329d6d][_0x541f('0x7d')]));}}}if(_0x6f17b4[_0x541f('0x7e')]){_0x6f17b4[_0x541f('0x7e')]=JSON[_0x541f('0x79')](_0x6f17b4[_0x541f('0x7e')]);_0x44c122[_0x541f('0x3d')](_0x3a63ca(_0x6f17b4[_0x541f('0x7e')][_0x541f('0x65')]));}_0x2694e9=_0x44c122['clone']();_0x44c122['limit'](_0x991e08);_0x44c122[_0x541f('0x1b')](0x0);logger[_0x541f('0x80')](_0x541f('0x81'),_0x44c122['toString']());return dbH[_0x541f('0x9c')]['query'](_0x44c122[_0x541f('0x82')](),{'type':dbH[_0x541f('0x9c')][_0x541f('0x9d')]['SELECT']});}})[_0x541f('0x22')](function(){return{'sql':_0x2694e9['toString']()};})[_0x541f('0x22')](respondWithResult(_0x2c861b,null))[_0x541f('0x49')](handleError(_0x2c861b,null));};
\ No newline at end of file
+var _0xe03b=['runReport','SUM(%s)','IS\x20NOT\x20NULL','condition','parentKey','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','map','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','AnalyticCustomReport','includeAll','include','findAll','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','operator','rules','group','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','field','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignKey','foreignTable','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','IS\x20EMPTY','Sequelize','DESC','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0xd04cb3,_0x3b51d5){var _0x3281d3=function(_0x466664){while(--_0x466664){_0xd04cb3['push'](_0xd04cb3['shift']());}};_0x3281d3(++_0x3b51d5);}(_0xe03b,0x155));var _0xbe03=function(_0x9b1959,_0x47d5dd){_0x9b1959=_0x9b1959-0x0;var _0x2d3ce4=_0xe03b[_0x9b1959];return _0x2d3ce4;};'use strict';var emlformat=require(_0xbe03('0x0'));var rimraf=require(_0xbe03('0x1'));var zipdir=require(_0xbe03('0x2'));var jsonpatch=require(_0xbe03('0x3'));var rp=require('request-promise');var moment=require(_0xbe03('0x4'));var BPromise=require(_0xbe03('0x5'));var Mustache=require('mustache');var util=require(_0xbe03('0x6'));var path=require(_0xbe03('0x7'));var sox=require(_0xbe03('0x8'));var csv=require(_0xbe03('0x9'));var ejs=require(_0xbe03('0xa'));var fs=require('fs');var fs_extra=require(_0xbe03('0xb'));var _=require(_0xbe03('0xc'));var squel=require(_0xbe03('0xd'));var crypto=require(_0xbe03('0xe'));var jsforce=require(_0xbe03('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbe03('0x9'));var querystring=require('querystring');var Papa=require(_0xbe03('0x10'));var Redis=require(_0xbe03('0x11'));var authService=require(_0xbe03('0x12'));var qs=require(_0xbe03('0x13'));var as=require(_0xbe03('0x14'));var hardwareService=require(_0xbe03('0x15'));var logger=require(_0xbe03('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xbe03('0x17'));var licenseUtil=require(_0xbe03('0x18'));var db=require(_0xbe03('0x19'))['db'];var dbH=require(_0xbe03('0x19'))['dbH'];function respondWithStatusCode(_0x4e700d,_0x17bd00){_0x17bd00=_0x17bd00||0xcc;return function(_0x3ed64f){if(_0x3ed64f){return _0x4e700d[_0xbe03('0x1a')](_0x17bd00);}return _0x4e700d['status'](_0x17bd00)[_0xbe03('0x1b')]();};}function respondWithResult(_0x1d3f69,_0x24a238){_0x24a238=_0x24a238||0xc8;return function(_0x26a094){if(_0x26a094){return _0x1d3f69[_0xbe03('0x1c')](_0x24a238)[_0xbe03('0x1d')](_0x26a094);}};}function respondWithFilteredResult(_0xdfc434,_0x53935a){return function(_0xe11982){if(_0xe11982){var _0x26137=typeof _0x53935a[_0xbe03('0x1e')]===_0xbe03('0x1f')&&typeof _0x53935a[_0xbe03('0x20')]===_0xbe03('0x1f');var _0x41f5ff=_0xe11982[_0xbe03('0x21')];var _0x1c4781=_0x26137?0x0:_0x53935a[_0xbe03('0x1e')];var _0x28999d=_0x26137?_0xe11982[_0xbe03('0x21')]:_0x53935a['offset']+_0x53935a['limit'];var _0x2d97f5;if(_0x28999d>=_0x41f5ff){_0x28999d=_0x41f5ff;_0x2d97f5=0xc8;}else{_0x2d97f5=0xce;}_0xdfc434[_0xbe03('0x1c')](_0x2d97f5);return _0xdfc434[_0xbe03('0x22')](_0xbe03('0x23'),_0x1c4781+'-'+_0x28999d+'/'+_0x41f5ff)[_0xbe03('0x1d')](_0xe11982);}return null;};}function patchUpdates(_0x984e02){return function(_0x6d9b38){try{jsonpatch[_0xbe03('0x24')](_0x6d9b38,_0x984e02,!![]);}catch(_0x372e45){return BPromise[_0xbe03('0x25')](_0x372e45);}return _0x6d9b38[_0xbe03('0x26')]();};}function saveUpdates(_0x415d8c,_0x4733e4){return function(_0x1ef582){if(_0x1ef582){return _0x1ef582[_0xbe03('0x27')](_0x415d8c)[_0xbe03('0x28')](function(_0x5ee058){return _0x5ee058;});}return null;};}function removeEntity(_0x41a7e3,_0x9d1745){return function(_0x3e7b0b){if(_0x3e7b0b){return _0x3e7b0b['destroy']()[_0xbe03('0x28')](function(){var _0x31199e=_0x3e7b0b[_0xbe03('0x29')]({'plain':!![]});var _0x17a986='CustomReports';return db[_0xbe03('0x2a')][_0xbe03('0x2b')]({'where':{'type':_0x17a986,'resourceId':_0x31199e['id']}})[_0xbe03('0x28')](function(){return _0x3e7b0b;});})[_0xbe03('0x28')](function(){_0x41a7e3[_0xbe03('0x1c')](0xcc)[_0xbe03('0x1b')]();});}};}function handleEntityNotFound(_0x5e8ac2,_0x150705){return function(_0x37b876){if(!_0x37b876){_0x5e8ac2['sendStatus'](0x194);}return _0x37b876;};}function handleError(_0x2032b5,_0xdf97f2){_0xdf97f2=_0xdf97f2||0x1f4;return function(_0x542fb1){logger[_0xbe03('0x2c')](_0x542fb1[_0xbe03('0x2d')]);if(_0x542fb1[_0xbe03('0x2e')]){delete _0x542fb1[_0xbe03('0x2e')];}_0x2032b5[_0xbe03('0x1c')](_0xdf97f2)['send'](_0x542fb1);};}exports['index']=function(_0xa15b16,_0x819c2d){var _0x4ae740={},_0x435365={},_0xa8c5da={'count':0x0,'rows':[]};var _0x43ed2b=_[_0xbe03('0x2f')](db['AnalyticCustomReport'][_0xbe03('0x30')],function(_0x487867){return{'name':_0x487867['fieldName'],'type':_0x487867[_0xbe03('0x31')]['key']};});_0x435365['model']=_[_0xbe03('0x2f')](_0x43ed2b,_0xbe03('0x2e'));_0x435365['query']=_[_0xbe03('0x32')](_0xa15b16[_0xbe03('0x33')]);_0x435365[_0xbe03('0x34')]=_[_0xbe03('0x35')](_0x435365[_0xbe03('0x36')],_0x435365['query']);_0x4ae740[_0xbe03('0x37')]=_[_0xbe03('0x35')](_0x435365[_0xbe03('0x36')],qs[_0xbe03('0x38')](_0xa15b16[_0xbe03('0x33')][_0xbe03('0x38')]));_0x4ae740['attributes']=_0x4ae740[_0xbe03('0x37')]['length']?_0x4ae740[_0xbe03('0x37')]:_0x435365['model'];if(!_0xa15b16[_0xbe03('0x33')][_0xbe03('0x39')](_0xbe03('0x3a'))){_0x4ae740[_0xbe03('0x20')]=qs[_0xbe03('0x20')](_0xa15b16[_0xbe03('0x33')][_0xbe03('0x20')]);_0x4ae740[_0xbe03('0x1e')]=qs[_0xbe03('0x1e')](_0xa15b16[_0xbe03('0x33')]['offset']);}_0x4ae740[_0xbe03('0x3b')]=qs[_0xbe03('0x3c')](_0xa15b16[_0xbe03('0x33')][_0xbe03('0x3c')]);_0x4ae740['where']=qs[_0xbe03('0x34')](_['pick'](_0xa15b16[_0xbe03('0x33')],_0x435365[_0xbe03('0x34')]),_0x43ed2b);if(_0xa15b16[_0xbe03('0x33')][_0xbe03('0x3d')]){_0x4ae740[_0xbe03('0x3e')]=_[_0xbe03('0x3f')](_0x4ae740['where'],{'$or':_[_0xbe03('0x2f')](_0x43ed2b,function(_0x4e7895){if(_0x4e7895['type']!=='VIRTUAL'){var _0x45c0d2={};_0x45c0d2[_0x4e7895['name']]={'$like':'%'+_0xa15b16[_0xbe03('0x33')][_0xbe03('0x3d')]+'%'};return _0x45c0d2;}})});}_0x4ae740=_[_0xbe03('0x3f')]({},_0x4ae740,_0xa15b16[_0xbe03('0x40')]);var _0x5f592e={'where':_0x4ae740[_0xbe03('0x3e')]};return db[_0xbe03('0x41')][_0xbe03('0x21')](_0x5f592e)[_0xbe03('0x28')](function(_0x136d12){_0xa8c5da[_0xbe03('0x21')]=_0x136d12;if(_0xa15b16['query'][_0xbe03('0x42')]){_0x4ae740[_0xbe03('0x43')]=[{'all':!![]}];}return db[_0xbe03('0x41')][_0xbe03('0x44')](_0x4ae740);})[_0xbe03('0x28')](function(_0x2bdb9e){_0xa8c5da[_0xbe03('0x45')]=_0x2bdb9e;return _0xa8c5da;})['then'](respondWithFilteredResult(_0x819c2d,_0x4ae740))[_0xbe03('0x46')](handleError(_0x819c2d,null));};exports['show']=function(_0x569f7a,_0x252e51){var _0x31a366={'raw':![],'where':{'id':_0x569f7a[_0xbe03('0x47')]['id']}},_0x145f8a={};_0x145f8a['model']=_[_0xbe03('0x32')](db['AnalyticCustomReport'][_0xbe03('0x30')]);_0x145f8a['query']=_[_0xbe03('0x32')](_0x569f7a[_0xbe03('0x33')]);_0x145f8a[_0xbe03('0x34')]=_[_0xbe03('0x35')](_0x145f8a[_0xbe03('0x36')],_0x145f8a[_0xbe03('0x33')]);_0x31a366[_0xbe03('0x37')]=_[_0xbe03('0x35')](_0x145f8a[_0xbe03('0x36')],qs[_0xbe03('0x38')](_0x569f7a[_0xbe03('0x33')]['fields']));_0x31a366[_0xbe03('0x37')]=_0x31a366[_0xbe03('0x37')][_0xbe03('0x48')]?_0x31a366['attributes']:_0x145f8a['model'];if(_0x569f7a[_0xbe03('0x33')][_0xbe03('0x42')]){_0x31a366[_0xbe03('0x43')]=[{'all':!![]}];}_0x31a366=_[_0xbe03('0x3f')]({},_0x31a366,_0x569f7a[_0xbe03('0x40')]);return db[_0xbe03('0x41')][_0xbe03('0x49')](_0x31a366)[_0xbe03('0x28')](handleEntityNotFound(_0x252e51,null))[_0xbe03('0x28')](respondWithResult(_0x252e51,null))['catch'](handleError(_0x252e51,null));};exports['create']=function(_0x44a9aa,_0x411a3f){return db[_0xbe03('0x41')][_0xbe03('0x4a')](_0x44a9aa[_0xbe03('0x4b')],{})[_0xbe03('0x28')](function(_0x2fda68){var _0x5407dc=_0x44a9aa[_0xbe03('0x4c')][_0xbe03('0x29')]({'plain':!![]});if(!_0x5407dc)throw new Error(_0xbe03('0x4d'));if(_0x5407dc[_0xbe03('0x4e')]===_0xbe03('0x4c')){var _0x1f46a8=_0x2fda68[_0xbe03('0x29')]({'plain':!![]});var _0xde40bb=_0xbe03('0x4f');return db[_0xbe03('0x50')][_0xbe03('0x49')]({'where':{'name':_0xde40bb,'userProfileId':_0x5407dc[_0xbe03('0x51')]},'raw':!![]})['then'](function(_0x313c5b){if(_0x313c5b&&_0x313c5b['autoAssociation']===0x0){return db[_0xbe03('0x2a')]['create']({'name':_0x1f46a8['name'],'resourceId':_0x1f46a8['id'],'type':_0xbe03('0x52'),'sectionId':_0x313c5b['id']},{})['then'](function(){return _0x2fda68;});}else{return _0x2fda68;}})[_0xbe03('0x46')](function(_0x335cd3){logger['error'](_0xbe03('0x53'),_0x335cd3);throw _0x335cd3;});}return _0x2fda68;})['then'](respondWithResult(_0x411a3f,0xc9))[_0xbe03('0x46')](handleError(_0x411a3f,null));};exports['update']=function(_0x1e8b99,_0x5ee13e){if(_0x1e8b99[_0xbe03('0x4b')]['id']){delete _0x1e8b99['body']['id'];}return db['AnalyticCustomReport'][_0xbe03('0x49')]({'where':{'id':_0x1e8b99['params']['id']}})['then'](handleEntityNotFound(_0x5ee13e,null))[_0xbe03('0x28')](saveUpdates(_0x1e8b99['body'],null))[_0xbe03('0x28')](respondWithResult(_0x5ee13e,null))['catch'](handleError(_0x5ee13e,null));};exports[_0xbe03('0x2b')]=function(_0x533e1f,_0xc64073){return db[_0xbe03('0x41')]['find']({'where':{'id':_0x533e1f['params']['id']}})[_0xbe03('0x28')](handleEntityNotFound(_0xc64073,null))[_0xbe03('0x28')](removeEntity(_0xc64073,null))[_0xbe03('0x46')](handleError(_0xc64073,null));};exports[_0xbe03('0x54')]=function(_0x2f4e52,_0x4d57b5){var _0x52487b=0xa;var _0x53c9bf=[_0xbe03('0x55'),_0xbe03('0x56'),_0xbe03('0x57'),'cross_join'];var _0x4a2c3b={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xbe03('0x58'),'MAX':'MAX(%s)','MIN':_0xbe03('0x59'),'AVG':_0xbe03('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbe03('0x5b'),'GROUP_CONCAT DESC':_0xbe03('0x5c')};var _0x5c9312={'SEC_TO_TIME':_0xbe03('0x5d'),'DATE':_0xbe03('0x5e'),'HOUR':_0xbe03('0x5f'),'ROUND':_0xbe03('0x60'),'UNIX_TIMESTAMP':_0xbe03('0x61')};var _0xc80405=function(_0x257385){return!_[_0xbe03('0x62')]([_0xbe03('0x63'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xbe03('0x64')],_0x257385);};var _0x4392a5=function(_0x1feb71){if(!_0x1feb71||!_0x1feb71['rules'][_0xbe03('0x48')]){return'';}for(var _0x434f4c='(',_0x15d262=0x0;_0x15d262<_0x1feb71['rules'][_0xbe03('0x48')];_0x15d262+=0x1){_0x15d262>0x0&&(_0x434f4c+='\x20'+_0x1feb71[_0xbe03('0x65')]+'\x20');_0x434f4c+=_0x1feb71[_0xbe03('0x66')][_0x15d262][_0xbe03('0x67')]?_0x4392a5(_0x1feb71[_0xbe03('0x66')][_0x15d262][_0xbe03('0x67')]):_0x1feb71[_0xbe03('0x66')][_0x15d262]['field']+'\x20'+_0x1feb71[_0xbe03('0x66')][_0x15d262]['condition']+(_0xc80405(_0x1feb71[_0xbe03('0x66')][_0x15d262]['condition'])?'\x20'+_0x1feb71[_0xbe03('0x66')][_0x15d262][_0xbe03('0x68')]:'');}return _0x434f4c+')';};var _0x2eb574={'where':{'id':_0x2f4e52[_0xbe03('0x47')]['id']}},_0x3ae25d,_0x46e627,_0x23ccc5,_0x51c321,_0x2ca239;_0x2eb574=_[_0xbe03('0x3f')]({},_0x2eb574,_0x2f4e52['options']);return db['AnalyticCustomReport']['find'](_0x2eb574)['then'](function(_0x3bead7){if(_0x3bead7){_0x3ae25d=_0x3bead7;return _0x3bead7[_0xbe03('0x69')]();}return null;})['then'](function(_0x12672e){if(_0x12672e){if(!_0x12672e[_0xbe03('0x48')]){throw new db['Sequelize'][(_0xbe03('0x6a'))](_0xbe03('0x6b'),0x193);}_0x46e627=_0x12672e;return db[_0xbe03('0x6c')][_0xbe03('0x44')]({'raw':!![]});}return null;})[_0xbe03('0x28')](function(_0x5282a3){if(_0x5282a3){_0x23ccc5=_[_0xbe03('0x6d')](_0x5282a3,'id');var _0x1c5b2a;var _0x1eeb66=squel[_0xbe03('0x6e')]();_0x1eeb66[_0xbe03('0x6f')](_0x3ae25d['table']);for(var _0x86fd9f=0x0;_0x86fd9f<_0x46e627[_0xbe03('0x48')];_0x86fd9f+=0x1){_0x1c5b2a=_0x46e627[_0x86fd9f][_0xbe03('0x70')]?_0x23ccc5[_0x46e627[_0x86fd9f][_0xbe03('0x70')]][_0xbe03('0x71')]:_0x46e627[_0x86fd9f][_0xbe03('0x72')];_0x1c5b2a=_0x46e627[_0x86fd9f][_0xbe03('0x73')]?_[_0xbe03('0x74')](_0x4a2c3b[_0x46e627[_0x86fd9f][_0xbe03('0x73')]],'%s',_0x1c5b2a):_0x1c5b2a;_0x1c5b2a=_0x46e627[_0x86fd9f]['format']?_[_0xbe03('0x74')](_0x5c9312[_0x46e627[_0x86fd9f][_0xbe03('0x75')]],'%s',_0x1c5b2a):_0x1c5b2a;if(_0x46e627[_0x86fd9f][_0xbe03('0x76')]){_0x1eeb66[_0xbe03('0x67')](_0x1c5b2a);}_0x46e627[_0x86fd9f][_0xbe03('0x77')]&&_0x1eeb66['order'](_0x1c5b2a,_0x46e627[_0x86fd9f][_0xbe03('0x77')]==='DESC'?![]:!![]);_0x1eeb66[_0xbe03('0x72')](_0x1c5b2a,_0x46e627[_0x86fd9f][_0xbe03('0x78')]||_0x1c5b2a);}if(_0x3ae25d['joins']){_0x3ae25d[_0xbe03('0x79')]=JSON[_0xbe03('0x7a')](_0x3ae25d[_0xbe03('0x79')]);for(var _0x21f2d1=0x0;_0x21f2d1<_0x3ae25d['joins'][_0xbe03('0x48')];_0x21f2d1+=0x1){if(_0x3ae25d['joins'][_0x21f2d1][_0xbe03('0x31')]&&_[_0xbe03('0x62')](_0x53c9bf,_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['type'])&&_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['parentKey']&&_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['foreignTable']&&_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x7b')]){_0x1eeb66[_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x31')]](_0x3ae25d['joins'][_0x21f2d1][_0xbe03('0x7c')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3ae25d[_0xbe03('0x7d')],_0x3ae25d[_0xbe03('0x79')][_0x21f2d1]['parentKey'],_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x7c')],_0x3ae25d[_0xbe03('0x79')][_0x21f2d1][_0xbe03('0x7b')]));}}}if(_0x3ae25d[_0xbe03('0x7e')]){_0x3ae25d[_0xbe03('0x7e')]=JSON['parse'](_0x3ae25d[_0xbe03('0x7e')]);_0x1eeb66['where'](_0x4392a5(_0x3ae25d[_0xbe03('0x7e')][_0xbe03('0x67')]));}_0x2ca239=_0x1eeb66[_0xbe03('0x7f')]();_0x1eeb66[_0xbe03('0x20')](_0x52487b);_0x1eeb66[_0xbe03('0x1e')](0x0);logger[_0xbe03('0x80')](_0xbe03('0x81'),_0x1eeb66[_0xbe03('0x82')]());return dbH[_0xbe03('0x83')]['query'](_0x1eeb66[_0xbe03('0x82')](),{'type':dbH[_0xbe03('0x83')][_0xbe03('0x84')][_0xbe03('0x85')]});}})[_0xbe03('0x28')](respondWithResult(_0x4d57b5,null))[_0xbe03('0x46')](handleError(_0x4d57b5,null));};function runReport(_0x4e6d0a,_0x479807,_0x4a361b){var _0x28392a=_0x479807[_0xbe03('0x2e')];var _0x2677a2=0xa;var _0x3f55ad=[_0xbe03('0x55'),_0xbe03('0x56'),_0xbe03('0x57'),_0xbe03('0x86')];var _0x26f44d={'SUM':'SUM(%s)','COUNT':_0xbe03('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xbe03('0x88'),'MIN':_0xbe03('0x59'),'AVG':_0xbe03('0x5a'),'GROUP_CONCAT':_0xbe03('0x89'),'GROUP_CONCAT ASC':_0xbe03('0x5b'),'GROUP_CONCAT DESC':_0xbe03('0x5c')};var _0x1cc44a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbe03('0x5e'),'HOUR':_0xbe03('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbe03('0x61')};var _0x2c5ac4=function(_0x643854){return!_[_0xbe03('0x62')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xbe03('0x8a'),_0xbe03('0x64')],_0x643854);};var _0x11aa6d=function(_0x4c430f){if(!_0x4c430f||!_0x4c430f[_0xbe03('0x66')][_0xbe03('0x48')]){return'';}for(var _0x27f8be='(',_0x19eb17=0x0;_0x19eb17<_0x4c430f[_0xbe03('0x66')][_0xbe03('0x48')];_0x19eb17+=0x1){_0x19eb17>0x0&&(_0x27f8be+='\x20'+_0x4c430f['operator']+'\x20');_0x27f8be+=_0x4c430f[_0xbe03('0x66')][_0x19eb17]['group']?_0x11aa6d(_0x4c430f[_0xbe03('0x66')][_0x19eb17]['group']):_0x4c430f[_0xbe03('0x66')][_0x19eb17]['field']+'\x20'+_0x4c430f['rules'][_0x19eb17]['condition']+(_0x2c5ac4(_0x4c430f[_0xbe03('0x66')][_0x19eb17]['condition'])?'\x20'+_0x4c430f[_0xbe03('0x66')][_0x19eb17][_0xbe03('0x68')]:'');}return _0x27f8be+')';};var _0x5857b9={'where':{'id':_0x4e6d0a['id']}},_0x43cfc0,_0x448d96,_0x426121,_0x2607aa,_0x1eb5a7;_0x5857b9=_[_0xbe03('0x3f')]({},_0x5857b9,_0x4a361b);return db[_0xbe03('0x41')]['find'](_0x5857b9)[_0xbe03('0x28')](function(_0x2c0626){if(_0x2c0626){_0x43cfc0=_0x2c0626;return _0x2c0626[_0xbe03('0x69')]();}return null;})[_0xbe03('0x28')](function(_0xcd940b){if(_0xcd940b){if(!_0xcd940b[_0xbe03('0x48')]){throw new db[(_0xbe03('0x8b'))][(_0xbe03('0x6a'))](_0xbe03('0x6b'),0x193);}_0x448d96=_0xcd940b;return db[_0xbe03('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xbe03('0x28')](function(_0x4ad8cf){if(_0x4ad8cf){_0x426121=_[_0xbe03('0x6d')](_0x4ad8cf,'id');var _0x4c692c;var _0xbf297=squel[_0xbe03('0x6e')]();_0xbf297[_0xbe03('0x6f')](_0x43cfc0['table']);for(var _0x4ad204=0x0;_0x4ad204<_0x448d96[_0xbe03('0x48')];_0x4ad204+=0x1){_0x4c692c=_0x448d96[_0x4ad204][_0xbe03('0x70')]?_0x426121[_0x448d96[_0x4ad204][_0xbe03('0x70')]][_0xbe03('0x71')]:_0x448d96[_0x4ad204]['field'];_0x4c692c=_0x448d96[_0x4ad204][_0xbe03('0x73')]?_[_0xbe03('0x74')](_0x26f44d[_0x448d96[_0x4ad204]['function']],'%s',_0x4c692c):_0x4c692c;_0x4c692c=_0x448d96[_0x4ad204][_0xbe03('0x75')]?_[_0xbe03('0x74')](_0x1cc44a[_0x448d96[_0x4ad204][_0xbe03('0x75')]],'%s',_0x4c692c):_0x4c692c;if(_0x448d96[_0x4ad204]['groupBy']){_0xbf297['group'](_0x4c692c);}_0x448d96[_0x4ad204][_0xbe03('0x77')]&&_0xbf297[_0xbe03('0x3b')](_0x4c692c,_0x448d96[_0x4ad204]['orderBy']===_0xbe03('0x8c')?![]:!![]);_0xbf297[_0xbe03('0x72')](_0x4c692c,_0x448d96[_0x4ad204][_0xbe03('0x78')]||_0x4c692c);}if(_0x43cfc0[_0xbe03('0x79')]){_0x43cfc0[_0xbe03('0x79')]=JSON[_0xbe03('0x7a')](_0x43cfc0[_0xbe03('0x79')]);for(var _0xa0b3c2=0x0;_0xa0b3c2<_0x43cfc0['joins'][_0xbe03('0x48')];_0xa0b3c2+=0x1){if(_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x31')]&&_[_0xbe03('0x62')](_0x3f55ad,_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x31')])&&_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['parentKey']&&_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['foreignTable']&&_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['foreignKey']){_0xbf297[_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x31')]](_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x7c')],null,util['format'](_0xbe03('0x8d'),_0x43cfc0[_0xbe03('0x7d')],_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2]['parentKey'],_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x7c')],_0x43cfc0[_0xbe03('0x79')][_0xa0b3c2][_0xbe03('0x7b')]));}}}if(_0x43cfc0[_0xbe03('0x7e')]){_0x43cfc0['conditions']=JSON[_0xbe03('0x7a')](_0x43cfc0[_0xbe03('0x7e')]);_0xbf297[_0xbe03('0x3e')](_0x11aa6d(_0x43cfc0['conditions'][_0xbe03('0x67')]));}_0x1eb5a7=_0xbf297[_0xbe03('0x7f')]();_0xbf297['limit'](_0x2677a2);_0xbf297[_0xbe03('0x1e')](0x0);return;}})[_0xbe03('0x28')](function(){if(_0x479807[_0xbe03('0x8e')]==='web'){return null;}var _0x546abc=_[_0xbe03('0x3f')](_0x479807,{'name':_0x479807[_0xbe03('0x8f')]||_0x479807['name']||_0x43cfc0[_0xbe03('0x2e')],'basename':_0x28392a,'savename':util['format'](_0xbe03('0x90'),_0x479807['name']||_0x43cfc0['name'],require(_0xbe03('0x91'))[_0xbe03('0x92')](0x4),_0x479807[_0xbe03('0x8e')]||_0xbe03('0x93')),'reportId':_0x43cfc0['id'],'reportType':_0xbe03('0x94')});return db[_0xbe03('0x95')]['create'](_0x546abc,{'raw':!![]});})['then'](function(_0x6daedd){if(_0x43cfc0['table']===_0xbe03('0x96')){_0x1eb5a7[_0xbe03('0x3e')](_0x43cfc0[_0xbe03('0x7d')]+_0xbe03('0x97'),_0x479807[_0xbe03('0x98')],_0x479807['endDate']);}else{_0x1eb5a7[_0xbe03('0x3e')](_0x43cfc0[_0xbe03('0x7d')]+_0xbe03('0x99'),_0x479807[_0xbe03('0x98')],_0x479807[_0xbe03('0x9a')]);}if(_0x6daedd){logger[_0xbe03('0x9b')](_0xbe03('0x9c'),_0x1eb5a7[_0xbe03('0x82')]());require('child_process')[_0xbe03('0x9d')](path[_0xbe03('0x55')](__dirname,_0xbe03('0x9e'),_0x6daedd['output']),[_0x6daedd['id'],_0x1eb5a7['toString'](),path[_0xbe03('0x55')](__dirname,_0xbe03('0x9f'),_0x6daedd[_0xbe03('0xa0')]),_0x28392a]);return _0x6daedd;}else{var _0x4e64ea=squel[_0xbe03('0x6e')]();_0x4e64ea[_0xbe03('0x6f')]('('+_0x1eb5a7[_0xbe03('0x82')]()+')',_0xbe03('0xa1'));_0x4e64ea[_0xbe03('0x72')](_0xbe03('0xa2'),'count');_0x1eb5a7[_0xbe03('0x20')](_0x479807[_0xbe03('0x20')]||_0x2677a2);_0x1eb5a7[_0xbe03('0x1e')](_0x479807['offset']||0x0);return dbH[_0xbe03('0x83')][_0xbe03('0x33')](_0x4e64ea['toString'](),{'type':dbH[_0xbe03('0x83')]['QueryTypes'][_0xbe03('0x85')]})[_0xbe03('0x28')](function(_0x79ccd0){if(!_0x79ccd0[_0xbe03('0x48')]){_0x2607aa=0x0;}else{_0x2607aa=_0x79ccd0[0x0]['count']||0x0;}return dbH[_0xbe03('0x83')][_0xbe03('0x33')](_0x1eb5a7[_0xbe03('0x82')](),{'type':dbH['sequelize'][_0xbe03('0x84')][_0xbe03('0x85')]});})[_0xbe03('0x28')](function(_0x365341){return{'rows':_0x365341||[],'count':_0x2607aa};});}});}exports['run']=function(_0x47ac82,_0x455a0b){return runReport(_0x47ac82[_0xbe03('0x47')],_0x47ac82['query'],_0x47ac82[_0xbe03('0x40')])['then'](respondWithResult(_0x455a0b,null))[_0xbe03('0x46')](handleError(_0x455a0b,null));};exports[_0xbe03('0xa3')]=runReport;exports['query']=function(_0xe8509f,_0xc28b25){var _0x3081e6=0xa;var _0x3ea6a2=[_0xbe03('0x55'),_0xbe03('0x56'),'right_join','cross_join'];var _0xd417cf={'SUM':_0xbe03('0xa4'),'COUNT':_0xbe03('0x87'),'COUNT DISTINCT':_0xbe03('0x58'),'MAX':'MAX(%s)','MIN':_0xbe03('0x59'),'AVG':_0xbe03('0x5a'),'GROUP_CONCAT':_0xbe03('0x89'),'GROUP_CONCAT ASC':_0xbe03('0x5b'),'GROUP_CONCAT DESC':_0xbe03('0x5c')};var _0x2cafd7={'SEC_TO_TIME':_0xbe03('0x5d'),'DATE':_0xbe03('0x5e'),'HOUR':_0xbe03('0x5f'),'ROUND':_0xbe03('0x60'),'UNIX_TIMESTAMP':_0xbe03('0x61')};var _0x27389d=function(_0xc317c8){return!_['includes']([_0xbe03('0x63'),_0xbe03('0xa5'),_0xbe03('0x8a'),'IS\x20NOT\x20EMPTY'],_0xc317c8);};var _0x2979cf=function(_0x4d2249){if(!_0x4d2249||!_0x4d2249[_0xbe03('0x66')][_0xbe03('0x48')]){return'';}for(var _0xd2c0bd='(',_0x4cb285=0x0;_0x4cb285<_0x4d2249[_0xbe03('0x66')][_0xbe03('0x48')];_0x4cb285+=0x1){_0x4cb285>0x0&&(_0xd2c0bd+='\x20'+_0x4d2249[_0xbe03('0x65')]+'\x20');_0xd2c0bd+=_0x4d2249['rules'][_0x4cb285][_0xbe03('0x67')]?_0x2979cf(_0x4d2249['rules'][_0x4cb285]['group']):_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0x72')]+'\x20'+_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0xa6')]+(_0x27389d(_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0xa6')])?'\x20'+_0x4d2249[_0xbe03('0x66')][_0x4cb285][_0xbe03('0x68')]:'');}return _0xd2c0bd+')';};var _0x2ae91e={'where':{'id':_0xe8509f[_0xbe03('0x47')]['id']}},_0x4ca6db,_0x394770,_0x4befc7,_0x504069,_0x594b59;_0x2ae91e=_[_0xbe03('0x3f')]({},_0x2ae91e,_0xe8509f[_0xbe03('0x40')]);return db[_0xbe03('0x41')][_0xbe03('0x49')](_0x2ae91e)[_0xbe03('0x28')](function(_0x481fc0){if(_0x481fc0){_0x4ca6db=_0x481fc0;return _0x481fc0[_0xbe03('0x69')]();}return null;})[_0xbe03('0x28')](function(_0x557e22){if(_0x557e22){if(!_0x557e22[_0xbe03('0x48')]){throw new db[(_0xbe03('0x8b'))][(_0xbe03('0x6a'))](_0xbe03('0x6b'),0x193);}_0x394770=_0x557e22;return db[_0xbe03('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x25e9b4){if(_0x25e9b4){_0x4befc7=_[_0xbe03('0x6d')](_0x25e9b4,'id');var _0x4220ca;var _0x154020=squel[_0xbe03('0x6e')]();_0x154020['from'](_0x4ca6db[_0xbe03('0x7d')]);for(var _0x128108=0x0;_0x128108<_0x394770['length'];_0x128108+=0x1){_0x4220ca=_0x394770[_0x128108][_0xbe03('0x70')]?_0x4befc7[_0x394770[_0x128108][_0xbe03('0x70')]][_0xbe03('0x71')]:_0x394770[_0x128108][_0xbe03('0x72')];_0x4220ca=_0x394770[_0x128108][_0xbe03('0x73')]?_[_0xbe03('0x74')](_0xd417cf[_0x394770[_0x128108][_0xbe03('0x73')]],'%s',_0x4220ca):_0x4220ca;_0x4220ca=_0x394770[_0x128108]['format']?_[_0xbe03('0x74')](_0x2cafd7[_0x394770[_0x128108][_0xbe03('0x75')]],'%s',_0x4220ca):_0x4220ca;if(_0x394770[_0x128108][_0xbe03('0x76')]){_0x154020[_0xbe03('0x67')](_0x4220ca);}_0x394770[_0x128108][_0xbe03('0x77')]&&_0x154020['order'](_0x4220ca,_0x394770[_0x128108][_0xbe03('0x77')]===_0xbe03('0x8c')?![]:!![]);_0x154020[_0xbe03('0x72')](_0x4220ca,_0x394770[_0x128108][_0xbe03('0x78')]||_0x4220ca);}if(_0x4ca6db[_0xbe03('0x79')]){_0x4ca6db[_0xbe03('0x79')]=JSON[_0xbe03('0x7a')](_0x4ca6db[_0xbe03('0x79')]);for(var _0x55521e=0x0;_0x55521e<_0x4ca6db[_0xbe03('0x79')][_0xbe03('0x48')];_0x55521e+=0x1){if(_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x31')]&&_[_0xbe03('0x62')](_0x3ea6a2,_0x4ca6db['joins'][_0x55521e][_0xbe03('0x31')])&&_0x4ca6db[_0xbe03('0x79')][_0x55521e]['parentKey']&&_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7c')]&&_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7b')]){_0x154020[_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x31')]](_0x4ca6db['joins'][_0x55521e][_0xbe03('0x7c')],null,util[_0xbe03('0x75')](_0xbe03('0x8d'),_0x4ca6db[_0xbe03('0x7d')],_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0xa7')],_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7c')],_0x4ca6db[_0xbe03('0x79')][_0x55521e][_0xbe03('0x7b')]));}}}if(_0x4ca6db['conditions']){_0x4ca6db[_0xbe03('0x7e')]=JSON[_0xbe03('0x7a')](_0x4ca6db[_0xbe03('0x7e')]);_0x154020[_0xbe03('0x3e')](_0x2979cf(_0x4ca6db[_0xbe03('0x7e')]['group']));}_0x594b59=_0x154020[_0xbe03('0x7f')]();_0x154020[_0xbe03('0x20')](_0x3081e6);_0x154020['offset'](0x0);logger[_0xbe03('0x80')](_0xbe03('0x81'),_0x154020[_0xbe03('0x82')]());return dbH[_0xbe03('0x83')][_0xbe03('0x33')](_0x154020[_0xbe03('0x82')](),{'type':dbH[_0xbe03('0x83')]['QueryTypes'][_0xbe03('0x85')]});}})[_0xbe03('0x28')](function(){return{'sql':_0x594b59[_0xbe03('0x82')]()};})[_0xbe03('0x28')](respondWithResult(_0xc28b25,null))[_0xbe03('0x46')](handleError(_0xc28b25,null));};
\ No newline at end of file
index 39c9548..390c7dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0775=['moment','path','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api'];(function(_0x39bd6f,_0x440849){var _0x199845=function(_0x128d4f){while(--_0x128d4f){_0x39bd6f['push'](_0x39bd6f['shift']());}};_0x199845(++_0x440849);}(_0x0775,0xcf));var _0x5077=function(_0xd13915,_0x196160){_0xd13915=_0xd13915-0x0;var _0x5bf869=_0x0775[_0xd13915];return _0x5bf869;};'use strict';var _=require(_0x5077('0x0'));var util=require('util');var logger=require(_0x5077('0x1'))(_0x5077('0x2'));var moment=require(_0x5077('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5077('0x4'));var rimraf=require('rimraf');var config=require(_0x5077('0x5'));var attributes=require(_0x5077('0x6'));module[_0x5077('0x7')]=function(_0x17a254,_0x5f048f){return _0x17a254['define'](_0x5077('0x8'),attributes,{'tableName':_0x5077('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1324=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1324,0xd0));var _0x4132=function(_0x4b1434,_0x1fa900){_0x4b1434=_0x4b1434-0x0;var _0x9870da=_0x1324[_0x4b1434];return _0x9870da;};'use strict';var _=require(_0x4132('0x0'));var util=require(_0x4132('0x1'));var logger=require(_0x4132('0x2'))(_0x4132('0x3'));var moment=require(_0x4132('0x4'));var BPromise=require(_0x4132('0x5'));var rp=require(_0x4132('0x6'));var fs=require('fs');var path=require(_0x4132('0x7'));var rimraf=require(_0x4132('0x8'));var config=require(_0x4132('0x9'));var attributes=require(_0x4132('0xa'));module[_0x4132('0xb')]=function(_0x2a5ac4,_0x59c91c){return _0x2a5ac4['define']('AnalyticCustomReport',attributes,{'tableName':_0x4132('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f9aa063..4b09184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf001=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x3e5199,_0x22aea6){var _0x1a7073=function(_0x3323c7){while(--_0x3323c7){_0x3e5199['push'](_0x3e5199['shift']());}};_0x1a7073(++_0x22aea6);}(_0xf001,0xb5));var _0x1f00=function(_0x5a6744,_0x144876){_0x5a6744=_0x5a6744-0x0;var _0xff7177=_0xf001[_0x5a6744];return _0xff7177;};'use strict';var _=require(_0x1f00('0x0'));var util=require(_0x1f00('0x1'));var moment=require('moment');var BPromise=require(_0x1f00('0x2'));var rs=require(_0x1f00('0x3'));var fs=require('fs');var Redis=require(_0x1f00('0x4'));var db=require(_0x1f00('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f00('0x6'))(_0x1f00('0x7'));var config=require(_0x1f00('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f00('0x9')][_0x1f00('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53595e,_0x23d1ab,_0x386416){return new BPromise(function(_0x15f45e,_0x5c531e){return client[_0x1f00('0xb')](_0x53595e,_0x386416)[_0x1f00('0xc')](function(_0x2bcc67){logger[_0x1f00('0xd')](_0x1f00('0xe'),_0x23d1ab,_0x1f00('0xf'));logger[_0x1f00('0x10')](_0x1f00('0x11'),_0x23d1ab,_0x1f00('0xf'),JSON['stringify'](_0x2bcc67));if(_0x2bcc67['error']){if(_0x2bcc67[_0x1f00('0x12')][_0x1f00('0x13')]===0x1f4){logger[_0x1f00('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x23d1ab,_0x2bcc67[_0x1f00('0x12')][_0x1f00('0x14')]);return _0x5c531e(_0x2bcc67[_0x1f00('0x12')][_0x1f00('0x14')]);}logger[_0x1f00('0x12')](_0x1f00('0xe'),_0x23d1ab,_0x2bcc67['error']['message']);return _0x15f45e(_0x2bcc67['error'][_0x1f00('0x14')]);}else{logger[_0x1f00('0xd')](_0x1f00('0xe'),_0x23d1ab,_0x1f00('0xf'));_0x15f45e(_0x2bcc67[_0x1f00('0x15')][_0x1f00('0x14')]);}})[_0x1f00('0x16')](function(_0x3e713){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x23d1ab,_0x3e713);_0x5c531e(_0x3e713);});});}
\ No newline at end of file
+var _0x9c79=['jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xaf84ae,_0x2f4ce1){var _0x355a10=function(_0x1dceb6){while(--_0x1dceb6){_0xaf84ae['push'](_0xaf84ae['shift']());}};_0x355a10(++_0x2f4ce1);}(_0x9c79,0x1d6));var _0x99c7=function(_0x240eee,_0x249118){_0x240eee=_0x240eee-0x0;var _0x411632=_0x9c79[_0x240eee];return _0x411632;};'use strict';var _=require(_0x99c7('0x0'));var util=require(_0x99c7('0x1'));var moment=require(_0x99c7('0x2'));var BPromise=require(_0x99c7('0x3'));var rs=require(_0x99c7('0x4'));var fs=require('fs');var Redis=require(_0x99c7('0x5'));var db=require(_0x99c7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x99c7('0x7'))(_0x99c7('0x8'));var config=require(_0x99c7('0x9'));var jayson=require(_0x99c7('0xa'));var client=jayson[_0x99c7('0xb')][_0x99c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc4c07f,_0xd30d88,_0x154e4b){return new BPromise(function(_0x53d756,_0x4b939a){return client[_0x99c7('0xd')](_0xc4c07f,_0x154e4b)['then'](function(_0x5993cd){logger[_0x99c7('0xe')](_0x99c7('0xf'),_0xd30d88,_0x99c7('0x10'));logger[_0x99c7('0x11')](_0x99c7('0x12'),_0xd30d88,'request\x20sent',JSON[_0x99c7('0x13')](_0x5993cd));if(_0x5993cd[_0x99c7('0x14')]){if(_0x5993cd[_0x99c7('0x14')]['code']===0x1f4){logger['error'](_0x99c7('0xf'),_0xd30d88,_0x5993cd[_0x99c7('0x14')]['message']);return _0x4b939a(_0x5993cd[_0x99c7('0x14')]['message']);}logger[_0x99c7('0x14')]('AnalyticCustomReport,\x20%s,\x20%s',_0xd30d88,_0x5993cd[_0x99c7('0x14')]['message']);return _0x53d756(_0x5993cd[_0x99c7('0x14')][_0x99c7('0x15')]);}else{logger[_0x99c7('0xe')](_0x99c7('0xf'),_0xd30d88,_0x99c7('0x10'));_0x53d756(_0x5993cd[_0x99c7('0x16')]['message']);}})[_0x99c7('0x17')](function(_0x40b6fc){logger[_0x99c7('0x14')](_0x99c7('0xf'),_0xd30d88,_0x40b6fc);_0x4b939a(_0x40b6fc);});});}
\ No newline at end of file
index ca7136d..983fac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28da=['path','../../components/auth/service','get','isAuthenticated','index','/:id','show','preview','/:id/run','/:id/query','query','post','create','update','delete','destroy','multer','util'];(function(_0x1b4b4f,_0x40bf1e){var _0x5cbca6=function(_0x384d8b){while(--_0x384d8b){_0x1b4b4f['push'](_0x1b4b4f['shift']());}};_0x5cbca6(++_0x40bf1e);}(_0x28da,0x130));var _0xa28d=function(_0x32cb9c,_0x21a862){_0x32cb9c=_0x32cb9c-0x0;var _0x442eda=_0x28da[_0x32cb9c];return _0x442eda;};'use strict';var multer=require(_0xa28d('0x0'));var util=require(_0xa28d('0x1'));var path=require(_0xa28d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa28d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xa28d('0x4')]('/',auth[_0xa28d('0x5')](),controller[_0xa28d('0x6')]);router[_0xa28d('0x4')](_0xa28d('0x7'),auth[_0xa28d('0x5')](),controller[_0xa28d('0x8')]);router[_0xa28d('0x4')]('/:id/preview',auth[_0xa28d('0x5')](),controller[_0xa28d('0x9')]);router[_0xa28d('0x4')](_0xa28d('0xa'),auth[_0xa28d('0x5')](),controller['run']);router[_0xa28d('0x4')](_0xa28d('0xb'),auth['isAuthenticated'](),controller[_0xa28d('0xc')]);router[_0xa28d('0xd')]('/',auth['isAuthenticated'](),controller[_0xa28d('0xe')]);router['put'](_0xa28d('0x7'),auth[_0xa28d('0x5')](),controller[_0xa28d('0xf')]);router[_0xa28d('0x10')](_0xa28d('0x7'),auth['isAuthenticated'](),controller[_0xa28d('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x01bf=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id/preview','/:id/run','query','create','put','/:id','update','delete','exports','util'];(function(_0x1aebd9,_0x1a1fac){var _0x487704=function(_0x1492ad){while(--_0x1492ad){_0x1aebd9['push'](_0x1aebd9['shift']());}};_0x487704(++_0x1a1fac);}(_0x01bf,0x97));var _0xf01b=function(_0xe07094,_0x1cd13b){_0xe07094=_0xe07094-0x0;var _0x2d447b=_0x01bf[_0xe07094];return _0x2d447b;};'use strict';var multer=require('multer');var util=require(_0xf01b('0x0'));var path=require(_0xf01b('0x1'));var timeout=require(_0xf01b('0x2'));var express=require('express');var router=express[_0xf01b('0x3')]();var fs_extra=require(_0xf01b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf01b('0x5'));var config=require(_0xf01b('0x6'));var controller=require(_0xf01b('0x7'));router[_0xf01b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf01b('0x8')]('/:id',auth[_0xf01b('0x9')](),controller['show']);router[_0xf01b('0x8')](_0xf01b('0xa'),auth[_0xf01b('0x9')](),controller['preview']);router[_0xf01b('0x8')](_0xf01b('0xb'),auth['isAuthenticated'](),controller['run']);router[_0xf01b('0x8')]('/:id/query',auth[_0xf01b('0x9')](),controller[_0xf01b('0xc')]);router['post']('/',auth[_0xf01b('0x9')](),controller[_0xf01b('0xd')]);router[_0xf01b('0xe')](_0xf01b('0xf'),auth['isAuthenticated'](),controller[_0xf01b('0x10')]);router[_0xf01b('0x11')]('/:id',auth[_0xf01b('0x9')](),controller['destroy']);module[_0xf01b('0x12')]=router;
\ No newline at end of file
index e396b2b..ee9364c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x5075,0x73));var _0x5507=function(_0x2888a4,_0x1fc157){_0x2888a4=_0x2888a4-0x0;var _0x7f650c=_0x5075[_0x2888a4];return _0x7f650c;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2952d5,_0x1dc7ec){_0x2952d5=_0x2952d5-0x0;var _0xf00f04=_0x8ef6[_0x2952d5];return _0xf00f04;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 05b6f7a..090e25b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x22dcba,_0x315637){var _0x330c1c=function(_0x4aba19){while(--_0x4aba19){_0x22dcba['push'](_0x22dcba['shift']());}};_0x330c1c(++_0x315637);}(_0x2675,0x75));var _0x5267=function(_0x4a9ea4,_0xcf79a4){_0x4a9ea4=_0x4a9ea4-0x0;var _0x5ddbf1=_0x2675[_0x4a9ea4];return _0x5ddbf1;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
+var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x41062b,_0x308726){var _0x148fb4=function(_0xfe6107){while(--_0xfe6107){_0x41062b['push'](_0x41062b['shift']());}};_0x148fb4(++_0x308726);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
index fd0caa7..2044894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dfd=['api','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x3823dc,_0x2af7d7){var _0x3b48a2=function(_0x705eb3){while(--_0x705eb3){_0x3823dc['push'](_0x3823dc['shift']());}};_0x3b48a2(++_0x2af7d7);}(_0x6dfd,0x1b9));var _0xd6df=function(_0x2d98f1,_0x254499){_0x2d98f1=_0x2d98f1-0x0;var _0x5cbe38=_0x6dfd[_0x2d98f1];return _0x5cbe38;};'use strict';var _=require(_0xd6df('0x0'));var util=require(_0xd6df('0x1'));var logger=require(_0xd6df('0x2'))(_0xd6df('0x3'));var moment=require('moment');var BPromise=require(_0xd6df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6df('0x5'));var rimraf=require(_0xd6df('0x6'));var config=require(_0xd6df('0x7'));var attributes=require(_0xd6df('0x8'));module['exports']=function(_0x5d7e77,_0xf58a4){return _0x5d7e77[_0xd6df('0x9')](_0xd6df('0xa'),attributes,{'tableName':_0xd6df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd74=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport'];(function(_0x3e0584,_0x469dd5){var _0x41a70f=function(_0x40e32a){while(--_0x40e32a){_0x3e0584['push'](_0x3e0584['shift']());}};_0x41a70f(++_0x469dd5);}(_0xfd74,0x118));var _0x4fd7=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0xfd74[_0x4afac5];return _0x2404b3;};'use strict';var _=require(_0x4fd7('0x0'));var util=require('util');var logger=require(_0x4fd7('0x1'))('api');var moment=require(_0x4fd7('0x2'));var BPromise=require(_0x4fd7('0x3'));var rp=require(_0x4fd7('0x4'));var fs=require('fs');var path=require(_0x4fd7('0x5'));var rimraf=require(_0x4fd7('0x6'));var config=require(_0x4fd7('0x7'));var attributes=require(_0x4fd7('0x8'));module['exports']=function(_0x4dd242,_0x32ef68){return _0x4dd242['define'](_0x4fd7('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c25c7b2..7c1e622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2917=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x2917,0x86));var _0x7291=function(_0x39a2d6,_0x477459){_0x39a2d6=_0x39a2d6-0x0;var _0x23af66=_0x2917[_0x39a2d6];return _0x23af66;};'use strict';var _=require(_0x7291('0x0'));var util=require(_0x7291('0x1'));var moment=require(_0x7291('0x2'));var BPromise=require(_0x7291('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7291('0x4'));var db=require(_0x7291('0x5'))['db'];var utils=require(_0x7291('0x6'));var logger=require('../../config/logger')(_0x7291('0x7'));var config=require(_0x7291('0x8'));var jayson=require(_0x7291('0x9'));var client=jayson[_0x7291('0xa')][_0x7291('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d0f98,_0x47ce50,_0x580324){return new BPromise(function(_0xdf3678,_0x144e87){return client[_0x7291('0xc')](_0x2d0f98,_0x580324)[_0x7291('0xd')](function(_0x3be544){logger[_0x7291('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x47ce50,_0x7291('0xf'));logger['debug'](_0x7291('0x10'),_0x47ce50,_0x7291('0xf'),JSON[_0x7291('0x11')](_0x3be544));if(_0x3be544[_0x7291('0x12')]){if(_0x3be544[_0x7291('0x12')]['code']===0x1f4){logger[_0x7291('0x12')](_0x7291('0x13'),_0x47ce50,_0x3be544[_0x7291('0x12')][_0x7291('0x14')]);return _0x144e87(_0x3be544[_0x7291('0x12')][_0x7291('0x14')]);}logger[_0x7291('0x12')](_0x7291('0x13'),_0x47ce50,_0x3be544[_0x7291('0x12')][_0x7291('0x14')]);return _0xdf3678(_0x3be544[_0x7291('0x12')][_0x7291('0x14')]);}else{logger[_0x7291('0xe')](_0x7291('0x13'),_0x47ce50,_0x7291('0xf'));_0xdf3678(_0x3be544[_0x7291('0x15')][_0x7291('0x14')]);}})['catch'](function(_0x3a3947){logger[_0x7291('0x12')](_0x7291('0x13'),_0x47ce50,_0x3a3947);_0x144e87(_0x3a3947);});});}
\ No newline at end of file
+var _0x3b70=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','AnalyticDefaultReport,\x20%s,\x20%s','message','info'];(function(_0x51c2ad,_0x3c87e2){var _0x157264=function(_0x32d3a4){while(--_0x32d3a4){_0x51c2ad['push'](_0x51c2ad['shift']());}};_0x157264(++_0x3c87e2);}(_0x3b70,0x1b9));var _0x03b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3b70[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x03b7('0x0'));var util=require(_0x03b7('0x1'));var moment=require(_0x03b7('0x2'));var BPromise=require(_0x03b7('0x3'));var rs=require(_0x03b7('0x4'));var fs=require('fs');var Redis=require(_0x03b7('0x5'));var db=require(_0x03b7('0x6'))['db'];var utils=require(_0x03b7('0x7'));var logger=require(_0x03b7('0x8'))(_0x03b7('0x9'));var config=require('../../config/environment');var jayson=require(_0x03b7('0xa'));var client=jayson['client'][_0x03b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3024b2,_0x41ea9a,_0x2e65d5){return new BPromise(function(_0x4255e1,_0xb4d674){return client[_0x03b7('0xc')](_0x3024b2,_0x2e65d5)['then'](function(_0x5a4b21){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x41ea9a,_0x03b7('0xd'));logger[_0x03b7('0xe')](_0x03b7('0xf'),_0x41ea9a,'request\x20sent',JSON['stringify'](_0x5a4b21));if(_0x5a4b21['error']){if(_0x5a4b21['error'][_0x03b7('0x10')]===0x1f4){logger[_0x03b7('0x11')](_0x03b7('0x12'),_0x41ea9a,_0x5a4b21[_0x03b7('0x11')][_0x03b7('0x13')]);return _0xb4d674(_0x5a4b21['error'][_0x03b7('0x13')]);}logger['error'](_0x03b7('0x12'),_0x41ea9a,_0x5a4b21['error']['message']);return _0x4255e1(_0x5a4b21[_0x03b7('0x11')]['message']);}else{logger[_0x03b7('0x14')](_0x03b7('0x12'),_0x41ea9a,_0x03b7('0xd'));_0x4255e1(_0x5a4b21['result'][_0x03b7('0x13')]);}})[_0x03b7('0x15')](function(_0x521c60){logger['error'](_0x03b7('0x12'),_0x41ea9a,_0x521c60);_0xb4d674(_0x521c60);});});}
\ No newline at end of file
index ee6f46e..fde6c95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbf6=['isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id'];(function(_0x3e9e81,_0x2c8623){var _0x4aea96=function(_0x2da501){while(--_0x2da501){_0x3e9e81['push'](_0x3e9e81['shift']());}};_0x4aea96(++_0x2c8623);}(_0xcbf6,0x18d));var _0x6cbf=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0xcbf6[_0x14eb9e];return _0x4c59c4;};'use strict';var multer=require('multer');var util=require(_0x6cbf('0x0'));var path=require(_0x6cbf('0x1'));var timeout=require('connect-timeout');var express=require(_0x6cbf('0x2'));var router=express[_0x6cbf('0x3')]();var fs_extra=require(_0x6cbf('0x4'));var auth=require(_0x6cbf('0x5'));var interaction=require(_0x6cbf('0x6'));var config=require(_0x6cbf('0x7'));var controller=require(_0x6cbf('0x8'));router[_0x6cbf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cbf('0x9')](_0x6cbf('0xa'),auth[_0x6cbf('0xb')](),controller[_0x6cbf('0xc')]);router['get'](_0x6cbf('0xd'),auth[_0x6cbf('0xb')](),controller['preview']);router[_0x6cbf('0x9')](_0x6cbf('0xe'),auth[_0x6cbf('0xb')](),controller[_0x6cbf('0xf')]);router[_0x6cbf('0x9')](_0x6cbf('0x10'),auth['isAuthenticated'](),controller[_0x6cbf('0x11')]);router[_0x6cbf('0x12')]('/',auth['isAuthenticated'](),controller[_0x6cbf('0x13')]);router[_0x6cbf('0x14')](_0x6cbf('0xa'),auth[_0x6cbf('0xb')](),controller[_0x6cbf('0x15')]);router[_0x6cbf('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x6cbf('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xf34e=['../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf34e,0x145));var _0xef34=function(_0x19ba56,_0x415ff8){_0x19ba56=_0x19ba56-0x0;var _0x32046e=_0xf34e[_0x19ba56];return _0x32046e;};'use strict';var multer=require(_0xef34('0x0'));var util=require(_0xef34('0x1'));var path=require('path');var timeout=require(_0xef34('0x2'));var express=require(_0xef34('0x3'));var router=express['Router']();var fs_extra=require(_0xef34('0x4'));var auth=require(_0xef34('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef34('0x6'));var controller=require(_0xef34('0x7'));router[_0xef34('0x8')]('/',auth[_0xef34('0x9')](),controller[_0xef34('0xa')]);router[_0xef34('0x8')](_0xef34('0xb'),auth[_0xef34('0x9')](),controller['show']);router[_0xef34('0x8')](_0xef34('0xc'),auth[_0xef34('0x9')](),controller['preview']);router[_0xef34('0x8')]('/:id/run',auth[_0xef34('0x9')](),controller[_0xef34('0xd')]);router[_0xef34('0x8')](_0xef34('0xe'),auth[_0xef34('0x9')](),controller[_0xef34('0xf')]);router[_0xef34('0x10')]('/',auth[_0xef34('0x9')](),controller[_0xef34('0x11')]);router['put'](_0xef34('0xb'),auth[_0xef34('0x9')](),controller[_0xef34('0x12')]);router[_0xef34('0x13')](_0xef34('0xb'),auth[_0xef34('0x9')](),controller[_0xef34('0x14')]);module[_0xef34('0x15')]=router;
\ No newline at end of file
index ace0e12..f2e3d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe280=['moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER','sequelize'];(function(_0x279095,_0x15f37e){var _0x5a5cdb=function(_0x2909bd){while(--_0x2909bd){_0x279095['push'](_0x279095['shift']());}};_0x5a5cdb(++_0x15f37e);}(_0xe280,0x107));var _0x0e28=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xe280[_0x2555d0];return _0x3bb486;};'use strict';var Sequelize=require(_0x0e28('0x0'));var moment=require(_0x0e28('0x1'));module[_0x0e28('0x2')]={'name':{'type':Sequelize[_0x0e28('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x0e28('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0e28('0x4')](_0x0e28('0x5'),_0x0e28('0x6'),'xlsx'),'allowNull':![],'defaultValue':_0x0e28('0x5')},'savename':{'type':Sequelize[_0x0e28('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x0e28('0x7')]},'status':{'type':Sequelize[_0x0e28('0x3')],'defaultValue':_0x0e28('0x8')},'type':{'type':Sequelize['ENUM'](_0x0e28('0x9'),_0x0e28('0xa')),'allowNull':![],'defaultValue':_0x0e28('0x9')},'reportId':{'type':Sequelize[_0x0e28('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1bde=['DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','xlsx','csv'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1bde,0x157));var _0xe1bd=function(_0x3ce221,_0x22d678){_0x3ce221=_0x3ce221-0x0;var _0x3995b8=_0x1bde[_0x3ce221];return _0x3995b8;};'use strict';var Sequelize=require(_0xe1bd('0x0'));var moment=require('moment');module[_0xe1bd('0x1')]={'name':{'type':Sequelize[_0xe1bd('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe1bd('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv','pdf',_0xe1bd('0x3')),'allowNull':![],'defaultValue':_0xe1bd('0x4')},'savename':{'type':Sequelize[_0xe1bd('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe1bd('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xe1bd('0x6')},'type':{'type':Sequelize[_0xe1bd('0x7')](_0xe1bd('0x8'),_0xe1bd('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xe1bd('0xa')](0xb)[_0xe1bd('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fecbd59..11ab81b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e1c=['body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','savename','existsSync','join','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','format','basename','toLowerCase','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','AnalyticExtractedReport','show','params','includeAll','catch','create'];(function(_0x2979a3,_0x12faf8){var _0x2d779e=function(_0x4d2f06){while(--_0x4d2f06){_0x2979a3['push'](_0x2979a3['shift']());}};_0x2d779e(++_0x12faf8);}(_0x5e1c,0x72));var _0xc5e1=function(_0x322ee9,_0x5deb85){_0x322ee9=_0x322ee9-0x0;var _0x43bfe0=_0x5e1c[_0x322ee9];return _0x43bfe0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc5e1('0x0'));var jsonpatch=require(_0xc5e1('0x1'));var rp=require('request-promise');var moment=require(_0xc5e1('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc5e1('0x3'));var util=require(_0xc5e1('0x4'));var path=require(_0xc5e1('0x5'));var sox=require(_0xc5e1('0x6'));var csv=require(_0xc5e1('0x7'));var ejs=require(_0xc5e1('0x8'));var fs=require('fs');var fs_extra=require(_0xc5e1('0x9'));var _=require(_0xc5e1('0xa'));var squel=require(_0xc5e1('0xb'));var crypto=require(_0xc5e1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc5e1('0xd'));var toCsv=require(_0xc5e1('0x7'));var querystring=require(_0xc5e1('0xe'));var Papa=require('papaparse');var Redis=require(_0xc5e1('0xf'));var authService=require(_0xc5e1('0x10'));var qs=require(_0xc5e1('0x11'));var as=require(_0xc5e1('0x12'));var hardwareService=require(_0xc5e1('0x13'));var logger=require(_0xc5e1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc5e1('0x15'));var licenseUtil=require(_0xc5e1('0x16'));var db=require(_0xc5e1('0x17'))['db'];function respondWithStatusCode(_0x41f4e7,_0x23c75b){_0x23c75b=_0x23c75b||0xcc;return function(_0x4abeae){if(_0x4abeae){return _0x41f4e7[_0xc5e1('0x18')](_0x23c75b);}return _0x41f4e7[_0xc5e1('0x19')](_0x23c75b)['end']();};}function respondWithResult(_0x2a2a47,_0x2b03da){_0x2b03da=_0x2b03da||0xc8;return function(_0x3d99e8){if(_0x3d99e8){return _0x2a2a47[_0xc5e1('0x19')](_0x2b03da)[_0xc5e1('0x1a')](_0x3d99e8);}};}function respondWithFilteredResult(_0x11dd9c,_0xfbdf43){return function(_0x47971e){if(_0x47971e){var _0x38808d=typeof _0xfbdf43[_0xc5e1('0x1b')]==='undefined'&&typeof _0xfbdf43[_0xc5e1('0x1c')]===_0xc5e1('0x1d');var _0x5815c1=_0x47971e[_0xc5e1('0x1e')];var _0x262959=_0x38808d?0x0:_0xfbdf43[_0xc5e1('0x1b')];var _0x4ee88d=_0x38808d?_0x47971e[_0xc5e1('0x1e')]:_0xfbdf43[_0xc5e1('0x1b')]+_0xfbdf43[_0xc5e1('0x1c')];var _0x1fc1e5;if(_0x4ee88d>=_0x5815c1){_0x4ee88d=_0x5815c1;_0x1fc1e5=0xc8;}else{_0x1fc1e5=0xce;}_0x11dd9c[_0xc5e1('0x19')](_0x1fc1e5);return _0x11dd9c[_0xc5e1('0x1f')](_0xc5e1('0x20'),_0x262959+'-'+_0x4ee88d+'/'+_0x5815c1)['json'](_0x47971e);}return null;};}function patchUpdates(_0x3f9582){return function(_0x142651){try{jsonpatch[_0xc5e1('0x21')](_0x142651,_0x3f9582,!![]);}catch(_0x52ecd7){return BPromise[_0xc5e1('0x22')](_0x52ecd7);}return _0x142651[_0xc5e1('0x23')]();};}function saveUpdates(_0x58c34b,_0x15d873){return function(_0x586b53){if(_0x586b53){return _0x586b53[_0xc5e1('0x24')](_0x58c34b)[_0xc5e1('0x25')](function(_0x52f700){return _0x52f700;});}return null;};}function removeEntity(_0x2521c5,_0x29ea7f){return function(_0x389261){if(_0x389261){return _0x389261[_0xc5e1('0x26')]()['then'](function(){var _0x1da262=_0x389261['get']({'plain':!![]});var _0x23095c=_0xc5e1('0x27');return db[_0xc5e1('0x28')][_0xc5e1('0x26')]({'where':{'type':_0x23095c,'resourceId':_0x1da262['id']}})[_0xc5e1('0x25')](function(){return _0x389261;});})['then'](function(){_0x2521c5[_0xc5e1('0x19')](0xcc)[_0xc5e1('0x29')]();});}};}function handleEntityNotFound(_0x3df491,_0x445aa4){return function(_0xe740d2){if(!_0xe740d2){_0x3df491[_0xc5e1('0x18')](0x194);}return _0xe740d2;};}function handleError(_0x5d52e9,_0x11f84e){_0x11f84e=_0x11f84e||0x1f4;return function(_0x8273ea){logger[_0xc5e1('0x2a')](_0x8273ea[_0xc5e1('0x2b')]);if(_0x8273ea[_0xc5e1('0x2c')]){delete _0x8273ea['name'];}_0x5d52e9['status'](_0x11f84e)[_0xc5e1('0x2d')](_0x8273ea);};}exports[_0xc5e1('0x2e')]=function(_0x32ce1a,_0x43b9b5){var _0x570d4b={},_0x3cdc3f={},_0x23b257={'count':0x0,'rows':[]};var _0x194fac=_[_0xc5e1('0x2f')](db['AnalyticExtractedReport'][_0xc5e1('0x30')],function(_0x2d9aae){return{'name':_0x2d9aae['fieldName'],'type':_0x2d9aae[_0xc5e1('0x31')][_0xc5e1('0x32')]};});_0x3cdc3f[_0xc5e1('0x33')]=_['map'](_0x194fac,'name');_0x3cdc3f[_0xc5e1('0x34')]=_[_0xc5e1('0x35')](_0x32ce1a['query']);_0x3cdc3f[_0xc5e1('0x36')]=_[_0xc5e1('0x37')](_0x3cdc3f[_0xc5e1('0x33')],_0x3cdc3f[_0xc5e1('0x34')]);_0x570d4b[_0xc5e1('0x38')]=_[_0xc5e1('0x37')](_0x3cdc3f[_0xc5e1('0x33')],qs[_0xc5e1('0x39')](_0x32ce1a[_0xc5e1('0x34')][_0xc5e1('0x39')]));_0x570d4b[_0xc5e1('0x38')]=_0x570d4b[_0xc5e1('0x38')][_0xc5e1('0x3a')]?_0x570d4b[_0xc5e1('0x38')]:_0x3cdc3f[_0xc5e1('0x33')];if(!_0x32ce1a['query']['hasOwnProperty']('nolimit')){_0x570d4b['limit']=qs[_0xc5e1('0x1c')](_0x32ce1a[_0xc5e1('0x34')][_0xc5e1('0x1c')]);_0x570d4b[_0xc5e1('0x1b')]=qs['offset'](_0x32ce1a['query'][_0xc5e1('0x1b')]);}_0x570d4b[_0xc5e1('0x3b')]=qs[_0xc5e1('0x3c')](_0x32ce1a[_0xc5e1('0x34')][_0xc5e1('0x3c')]);_0x570d4b[_0xc5e1('0x3d')]=qs[_0xc5e1('0x36')](_[_0xc5e1('0x3e')](_0x32ce1a[_0xc5e1('0x34')],_0x3cdc3f[_0xc5e1('0x36')]),_0x194fac);if(_0x32ce1a['query'][_0xc5e1('0x3f')]){_0x570d4b[_0xc5e1('0x3d')]=_[_0xc5e1('0x40')](_0x570d4b['where'],{'$or':_['map'](_0x194fac,function(_0x3ca81d){if(_0x3ca81d[_0xc5e1('0x31')]!==_0xc5e1('0x41')){var _0x4cb2b6={};_0x4cb2b6[_0x3ca81d[_0xc5e1('0x2c')]]={'$like':'%'+_0x32ce1a[_0xc5e1('0x34')][_0xc5e1('0x3f')]+'%'};return _0x4cb2b6;}})});}_0x570d4b=_['merge']({},_0x570d4b,_0x32ce1a[_0xc5e1('0x42')]);var _0x33e0b2={'where':_0x570d4b[_0xc5e1('0x3d')]};return db['AnalyticExtractedReport'][_0xc5e1('0x1e')](_0x33e0b2)['then'](function(_0x5d7a8d){_0x23b257[_0xc5e1('0x1e')]=_0x5d7a8d;if(_0x32ce1a['query']['includeAll']){_0x570d4b[_0xc5e1('0x43')]=[{'all':!![]}];}return db[_0xc5e1('0x44')]['findAll'](_0x570d4b);})['then'](function(_0x360b30){_0x23b257['rows']=_0x360b30;return _0x23b257;})['then'](respondWithFilteredResult(_0x43b9b5,_0x570d4b))['catch'](handleError(_0x43b9b5,null));};exports[_0xc5e1('0x45')]=function(_0x2033a0,_0x29a26f){var _0x55b96b={'raw':!![],'where':{'id':_0x2033a0[_0xc5e1('0x46')]['id']}},_0x5a581f={};_0x5a581f[_0xc5e1('0x33')]=_['keys'](db['AnalyticExtractedReport'][_0xc5e1('0x30')]);_0x5a581f[_0xc5e1('0x34')]=_['keys'](_0x2033a0[_0xc5e1('0x34')]);_0x5a581f[_0xc5e1('0x36')]=_[_0xc5e1('0x37')](_0x5a581f[_0xc5e1('0x33')],_0x5a581f['query']);_0x55b96b[_0xc5e1('0x38')]=_['intersection'](_0x5a581f[_0xc5e1('0x33')],qs[_0xc5e1('0x39')](_0x2033a0[_0xc5e1('0x34')][_0xc5e1('0x39')]));_0x55b96b['attributes']=_0x55b96b['attributes']['length']?_0x55b96b['attributes']:_0x5a581f[_0xc5e1('0x33')];if(_0x2033a0[_0xc5e1('0x34')][_0xc5e1('0x47')]){_0x55b96b[_0xc5e1('0x43')]=[{'all':!![]}];}_0x55b96b=_[_0xc5e1('0x40')]({},_0x55b96b,_0x2033a0[_0xc5e1('0x42')]);return db[_0xc5e1('0x44')]['find'](_0x55b96b)[_0xc5e1('0x25')](handleEntityNotFound(_0x29a26f,null))[_0xc5e1('0x25')](respondWithResult(_0x29a26f,null))[_0xc5e1('0x48')](handleError(_0x29a26f,null));};exports[_0xc5e1('0x49')]=function(_0x4187f6,_0x1ed8cb){return db[_0xc5e1('0x44')][_0xc5e1('0x49')](_0x4187f6[_0xc5e1('0x4a')],{})[_0xc5e1('0x25')](function(_0x4a6875){var _0x5495a0=_0x4187f6[_0xc5e1('0x4b')][_0xc5e1('0x4c')]({'plain':!![]});if(!_0x5495a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5495a0[_0xc5e1('0x4d')]===_0xc5e1('0x4b')){var _0x4c4fa7=_0x4a6875['get']({'plain':!![]});var _0x179b7a='ExtractedReports';return db[_0xc5e1('0x4e')]['find']({'where':{'name':_0x179b7a,'userProfileId':_0x5495a0['userProfileId']},'raw':!![]})[_0xc5e1('0x25')](function(_0x5a6663){if(_0x5a6663&&_0x5a6663[_0xc5e1('0x4f')]===0x0){return db['UserProfileResource'][_0xc5e1('0x49')]({'name':_0x4c4fa7['name'],'resourceId':_0x4c4fa7['id'],'type':_0x5a6663['name'],'sectionId':_0x5a6663['id']},{})['then'](function(){return _0x4a6875;});}else{return _0x4a6875;}})[_0xc5e1('0x48')](function(_0x3fa6e0){logger[_0xc5e1('0x2a')](_0xc5e1('0x50'),_0x3fa6e0);throw _0x3fa6e0;});}return _0x4a6875;})[_0xc5e1('0x25')](respondWithResult(_0x1ed8cb,0xc9))[_0xc5e1('0x48')](handleError(_0x1ed8cb,null));};exports[_0xc5e1('0x24')]=function(_0x135274,_0x3e6530){if(_0x135274[_0xc5e1('0x4a')]['id']){delete _0x135274[_0xc5e1('0x4a')]['id'];}return db[_0xc5e1('0x44')][_0xc5e1('0x51')]({'where':{'id':_0x135274['params']['id']}})[_0xc5e1('0x25')](handleEntityNotFound(_0x3e6530,null))[_0xc5e1('0x25')](saveUpdates(_0x135274['body'],null))[_0xc5e1('0x25')](respondWithResult(_0x3e6530,null))['catch'](handleError(_0x3e6530,null));};exports[_0xc5e1('0x26')]=function(_0x12a272,_0x59d69d){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x12a272[_0xc5e1('0x46')]['id']}})[_0xc5e1('0x25')](handleEntityNotFound(_0x59d69d,null))[_0xc5e1('0x25')](removeEntity(_0x59d69d,null))['catch'](handleError(_0x59d69d,null));};exports[_0xc5e1('0x52')]=function(_0x20d8f6,_0x45c1c0,_0x5595a2){return db['AnalyticExtractedReport'][_0xc5e1('0x51')]({'where':{'id':_0x20d8f6[_0xc5e1('0x46')]['id']},'attributes':['name','basename',_0xc5e1('0x53'),'output'],'raw':!![]})[_0xc5e1('0x25')](handleEntityNotFound(_0x45c1c0,null))[_0xc5e1('0x25')](function(_0x5c4a56){if(_0x5c4a56){if(!fs[_0xc5e1('0x54')](path[_0xc5e1('0x55')](config['root'],_0xc5e1('0x56'),_0x5c4a56['savename']))){throw new db[(_0xc5e1('0x57'))]['ValidationError'](_0xc5e1('0x58'));}if(_0x20d8f6[_0xc5e1('0x34')][_0xc5e1('0x59')]){return _0x45c1c0[_0xc5e1('0x18')](0xc8);}return _0x45c1c0[_0xc5e1('0x52')](path[_0xc5e1('0x55')](config[_0xc5e1('0x5a')],'server/files/reports',_0x5c4a56[_0xc5e1('0x53')]),util[_0xc5e1('0x5b')]('%s.%s',_0x5c4a56[_0xc5e1('0x5c')]||_0x5c4a56[_0xc5e1('0x2c')],_0x5c4a56['output'][_0xc5e1('0x5d')]()));}})[_0xc5e1('0x48')](handleError(_0x45c1c0,null));};
\ No newline at end of file
+var _0xdc44=['status','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','findAll','rows','catch','show','params','length','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','download','basename','output','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','UserProfileResource','sendStatus','error','stack','name'];(function(_0x29982b,_0x594e0){var _0xb1f0a9=function(_0x3d824c){while(--_0x3d824c){_0x29982b['push'](_0x29982b['shift']());}};_0xb1f0a9(++_0x594e0);}(_0xdc44,0x1ac));var _0x4dc4=function(_0x19fa95,_0x1cca0a){_0x19fa95=_0x19fa95-0x0;var _0x58a835=_0xdc44[_0x19fa95];return _0x58a835;};'use strict';var emlformat=require(_0x4dc4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4dc4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4dc4('0x2'));var Mustache=require(_0x4dc4('0x3'));var util=require('util');var path=require(_0x4dc4('0x4'));var sox=require(_0x4dc4('0x5'));var csv=require(_0x4dc4('0x6'));var ejs=require(_0x4dc4('0x7'));var fs=require('fs');var fs_extra=require(_0x4dc4('0x8'));var _=require(_0x4dc4('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4dc4('0xa'));var deskjs=require(_0x4dc4('0xb'));var toCsv=require(_0x4dc4('0x6'));var querystring=require(_0x4dc4('0xc'));var Papa=require(_0x4dc4('0xd'));var Redis=require('ioredis');var authService=require(_0x4dc4('0xe'));var qs=require(_0x4dc4('0xf'));var as=require(_0x4dc4('0x10'));var hardwareService=require(_0x4dc4('0x11'));var logger=require(_0x4dc4('0x12'))(_0x4dc4('0x13'));var utils=require(_0x4dc4('0x14'));var config=require(_0x4dc4('0x15'));var licenseUtil=require(_0x4dc4('0x16'));var db=require(_0x4dc4('0x17'))['db'];function respondWithStatusCode(_0x50516f,_0x201bbd){_0x201bbd=_0x201bbd||0xcc;return function(_0x4cfd42){if(_0x4cfd42){return _0x50516f['sendStatus'](_0x201bbd);}return _0x50516f['status'](_0x201bbd)[_0x4dc4('0x18')]();};}function respondWithResult(_0x4ec29f,_0x19af05){_0x19af05=_0x19af05||0xc8;return function(_0x258592){if(_0x258592){return _0x4ec29f['status'](_0x19af05)[_0x4dc4('0x19')](_0x258592);}};}function respondWithFilteredResult(_0x2701de,_0xab5f4c){return function(_0x13a234){if(_0x13a234){var _0x32c062=typeof _0xab5f4c[_0x4dc4('0x1a')]==='undefined'&&typeof _0xab5f4c[_0x4dc4('0x1b')]===_0x4dc4('0x1c');var _0x194f7f=_0x13a234['count'];var _0x53bb9d=_0x32c062?0x0:_0xab5f4c[_0x4dc4('0x1a')];var _0x32d224=_0x32c062?_0x13a234[_0x4dc4('0x1d')]:_0xab5f4c[_0x4dc4('0x1a')]+_0xab5f4c[_0x4dc4('0x1b')];var _0xa9238b;if(_0x32d224>=_0x194f7f){_0x32d224=_0x194f7f;_0xa9238b=0xc8;}else{_0xa9238b=0xce;}_0x2701de['status'](_0xa9238b);return _0x2701de[_0x4dc4('0x1e')](_0x4dc4('0x1f'),_0x53bb9d+'-'+_0x32d224+'/'+_0x194f7f)[_0x4dc4('0x19')](_0x13a234);}return null;};}function patchUpdates(_0x5385f4){return function(_0x5e56a3){try{jsonpatch[_0x4dc4('0x20')](_0x5e56a3,_0x5385f4,!![]);}catch(_0xc0369e){return BPromise['reject'](_0xc0369e);}return _0x5e56a3[_0x4dc4('0x21')]();};}function saveUpdates(_0x2bd00f,_0x169b1c){return function(_0x1b5698){if(_0x1b5698){return _0x1b5698[_0x4dc4('0x22')](_0x2bd00f)[_0x4dc4('0x23')](function(_0x57c29b){return _0x57c29b;});}return null;};}function removeEntity(_0x3da1fc,_0x13d450){return function(_0x2e29f5){if(_0x2e29f5){return _0x2e29f5['destroy']()[_0x4dc4('0x23')](function(){var _0x567de6=_0x2e29f5[_0x4dc4('0x24')]({'plain':!![]});var _0x4844='ExtractedReports';return db[_0x4dc4('0x25')]['destroy']({'where':{'type':_0x4844,'resourceId':_0x567de6['id']}})[_0x4dc4('0x23')](function(){return _0x2e29f5;});})[_0x4dc4('0x23')](function(){_0x3da1fc['status'](0xcc)[_0x4dc4('0x18')]();});}};}function handleEntityNotFound(_0x377127,_0x115ab4){return function(_0x2c5c58){if(!_0x2c5c58){_0x377127[_0x4dc4('0x26')](0x194);}return _0x2c5c58;};}function handleError(_0x39a9f4,_0x1b7f6a){_0x1b7f6a=_0x1b7f6a||0x1f4;return function(_0x347ad1){logger[_0x4dc4('0x27')](_0x347ad1[_0x4dc4('0x28')]);if(_0x347ad1[_0x4dc4('0x29')]){delete _0x347ad1['name'];}_0x39a9f4[_0x4dc4('0x2a')](_0x1b7f6a)[_0x4dc4('0x2b')](_0x347ad1);};}exports[_0x4dc4('0x2c')]=function(_0x75a948,_0x27b6fc){var _0x1218e9={},_0x1c1f8f={},_0x571fef={'count':0x0,'rows':[]};var _0x484d52=_[_0x4dc4('0x2d')](db[_0x4dc4('0x2e')][_0x4dc4('0x2f')],function(_0x12c665){return{'name':_0x12c665[_0x4dc4('0x30')],'type':_0x12c665[_0x4dc4('0x31')]['key']};});_0x1c1f8f[_0x4dc4('0x32')]=_[_0x4dc4('0x2d')](_0x484d52,_0x4dc4('0x29'));_0x1c1f8f[_0x4dc4('0x33')]=_[_0x4dc4('0x34')](_0x75a948['query']);_0x1c1f8f[_0x4dc4('0x35')]=_[_0x4dc4('0x36')](_0x1c1f8f[_0x4dc4('0x32')],_0x1c1f8f[_0x4dc4('0x33')]);_0x1218e9[_0x4dc4('0x37')]=_[_0x4dc4('0x36')](_0x1c1f8f[_0x4dc4('0x32')],qs[_0x4dc4('0x38')](_0x75a948[_0x4dc4('0x33')][_0x4dc4('0x38')]));_0x1218e9[_0x4dc4('0x37')]=_0x1218e9[_0x4dc4('0x37')]['length']?_0x1218e9[_0x4dc4('0x37')]:_0x1c1f8f[_0x4dc4('0x32')];if(!_0x75a948['query'][_0x4dc4('0x39')]('nolimit')){_0x1218e9[_0x4dc4('0x1b')]=qs['limit'](_0x75a948[_0x4dc4('0x33')]['limit']);_0x1218e9[_0x4dc4('0x1a')]=qs[_0x4dc4('0x1a')](_0x75a948['query'][_0x4dc4('0x1a')]);}_0x1218e9[_0x4dc4('0x3a')]=qs['sort'](_0x75a948[_0x4dc4('0x33')][_0x4dc4('0x3b')]);_0x1218e9[_0x4dc4('0x3c')]=qs[_0x4dc4('0x35')](_[_0x4dc4('0x3d')](_0x75a948[_0x4dc4('0x33')],_0x1c1f8f['filters']),_0x484d52);if(_0x75a948['query']['filter']){_0x1218e9[_0x4dc4('0x3c')]=_[_0x4dc4('0x3e')](_0x1218e9[_0x4dc4('0x3c')],{'$or':_['map'](_0x484d52,function(_0x411575){if(_0x411575['type']!=='VIRTUAL'){var _0x179409={};_0x179409[_0x411575[_0x4dc4('0x29')]]={'$like':'%'+_0x75a948[_0x4dc4('0x33')][_0x4dc4('0x3f')]+'%'};return _0x179409;}})});}_0x1218e9=_[_0x4dc4('0x3e')]({},_0x1218e9,_0x75a948[_0x4dc4('0x40')]);var _0x155b39={'where':_0x1218e9[_0x4dc4('0x3c')]};return db['AnalyticExtractedReport'][_0x4dc4('0x1d')](_0x155b39)[_0x4dc4('0x23')](function(_0x499bdc){_0x571fef[_0x4dc4('0x1d')]=_0x499bdc;if(_0x75a948[_0x4dc4('0x33')]['includeAll']){_0x1218e9['include']=[{'all':!![]}];}return db[_0x4dc4('0x2e')][_0x4dc4('0x41')](_0x1218e9);})[_0x4dc4('0x23')](function(_0x9dc5ba){_0x571fef[_0x4dc4('0x42')]=_0x9dc5ba;return _0x571fef;})[_0x4dc4('0x23')](respondWithFilteredResult(_0x27b6fc,_0x1218e9))[_0x4dc4('0x43')](handleError(_0x27b6fc,null));};exports[_0x4dc4('0x44')]=function(_0xde0693,_0x50d284){var _0xa55e84={'raw':!![],'where':{'id':_0xde0693[_0x4dc4('0x45')]['id']}},_0x3a3a1f={};_0x3a3a1f[_0x4dc4('0x32')]=_[_0x4dc4('0x34')](db['AnalyticExtractedReport']['rawAttributes']);_0x3a3a1f[_0x4dc4('0x33')]=_[_0x4dc4('0x34')](_0xde0693[_0x4dc4('0x33')]);_0x3a3a1f[_0x4dc4('0x35')]=_[_0x4dc4('0x36')](_0x3a3a1f[_0x4dc4('0x32')],_0x3a3a1f['query']);_0xa55e84[_0x4dc4('0x37')]=_[_0x4dc4('0x36')](_0x3a3a1f[_0x4dc4('0x32')],qs[_0x4dc4('0x38')](_0xde0693['query'][_0x4dc4('0x38')]));_0xa55e84[_0x4dc4('0x37')]=_0xa55e84[_0x4dc4('0x37')][_0x4dc4('0x46')]?_0xa55e84[_0x4dc4('0x37')]:_0x3a3a1f[_0x4dc4('0x32')];if(_0xde0693[_0x4dc4('0x33')]['includeAll']){_0xa55e84[_0x4dc4('0x47')]=[{'all':!![]}];}_0xa55e84=_[_0x4dc4('0x3e')]({},_0xa55e84,_0xde0693[_0x4dc4('0x40')]);return db[_0x4dc4('0x2e')]['find'](_0xa55e84)['then'](handleEntityNotFound(_0x50d284,null))[_0x4dc4('0x23')](respondWithResult(_0x50d284,null))[_0x4dc4('0x43')](handleError(_0x50d284,null));};exports[_0x4dc4('0x48')]=function(_0x6ec897,_0x333359){return db[_0x4dc4('0x2e')]['create'](_0x6ec897['body'],{})[_0x4dc4('0x23')](function(_0x325ffd){var _0x3b3092=_0x6ec897[_0x4dc4('0x49')][_0x4dc4('0x24')]({'plain':!![]});if(!_0x3b3092)throw new Error(_0x4dc4('0x4a'));if(_0x3b3092['role']===_0x4dc4('0x49')){var _0x2948b9=_0x325ffd[_0x4dc4('0x24')]({'plain':!![]});var _0x171914=_0x4dc4('0x4b');return db[_0x4dc4('0x4c')][_0x4dc4('0x4d')]({'where':{'name':_0x171914,'userProfileId':_0x3b3092[_0x4dc4('0x4e')]},'raw':!![]})['then'](function(_0x45bdd5){if(_0x45bdd5&&_0x45bdd5['autoAssociation']===0x0){return db[_0x4dc4('0x25')][_0x4dc4('0x48')]({'name':_0x2948b9[_0x4dc4('0x29')],'resourceId':_0x2948b9['id'],'type':_0x45bdd5[_0x4dc4('0x29')],'sectionId':_0x45bdd5['id']},{})[_0x4dc4('0x23')](function(){return _0x325ffd;});}else{return _0x325ffd;}})[_0x4dc4('0x43')](function(_0x60eeb0){logger[_0x4dc4('0x27')](_0x4dc4('0x4f'),_0x60eeb0);throw _0x60eeb0;});}return _0x325ffd;})[_0x4dc4('0x23')](respondWithResult(_0x333359,0xc9))['catch'](handleError(_0x333359,null));};exports[_0x4dc4('0x22')]=function(_0x1dbd9a,_0x57a357){if(_0x1dbd9a[_0x4dc4('0x50')]['id']){delete _0x1dbd9a['body']['id'];}return db[_0x4dc4('0x2e')][_0x4dc4('0x4d')]({'where':{'id':_0x1dbd9a['params']['id']}})[_0x4dc4('0x23')](handleEntityNotFound(_0x57a357,null))[_0x4dc4('0x23')](saveUpdates(_0x1dbd9a[_0x4dc4('0x50')],null))['then'](respondWithResult(_0x57a357,null))[_0x4dc4('0x43')](handleError(_0x57a357,null));};exports[_0x4dc4('0x51')]=function(_0x3523a6,_0x27429e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3523a6[_0x4dc4('0x45')]['id']}})[_0x4dc4('0x23')](handleEntityNotFound(_0x27429e,null))[_0x4dc4('0x23')](removeEntity(_0x27429e,null))[_0x4dc4('0x43')](handleError(_0x27429e,null));};exports[_0x4dc4('0x52')]=function(_0x32bc11,_0x116ca0,_0x5ab3b4){return db[_0x4dc4('0x2e')]['find']({'where':{'id':_0x32bc11[_0x4dc4('0x45')]['id']},'attributes':[_0x4dc4('0x29'),_0x4dc4('0x53'),'savename',_0x4dc4('0x54')],'raw':!![]})[_0x4dc4('0x23')](handleEntityNotFound(_0x116ca0,null))[_0x4dc4('0x23')](function(_0x483b86){if(_0x483b86){if(!fs['existsSync'](path[_0x4dc4('0x55')](config[_0x4dc4('0x56')],_0x4dc4('0x57'),_0x483b86['savename']))){throw new db[(_0x4dc4('0x58'))]['ValidationError'](_0x4dc4('0x59'));}if(_0x32bc11[_0x4dc4('0x33')][_0x4dc4('0x5a')]){return _0x116ca0[_0x4dc4('0x26')](0xc8);}return _0x116ca0[_0x4dc4('0x52')](path[_0x4dc4('0x55')](config['root'],_0x4dc4('0x57'),_0x483b86['savename']),util[_0x4dc4('0x5b')](_0x4dc4('0x5c'),_0x483b86['basename']||_0x483b86['name'],_0x483b86[_0x4dc4('0x54')][_0x4dc4('0x5d')]()));}})[_0x4dc4('0x43')](handleError(_0x116ca0,null));};
\ No newline at end of file
index d0f25ab..913dbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeed=['api','request-promise','path','rimraf','../../config/environment','exports','AnalyticExtractedReport','lodash','util'];(function(_0x56e790,_0x5bec09){var _0x4fa9fa=function(_0x513862){while(--_0x513862){_0x56e790['push'](_0x56e790['shift']());}};_0x4fa9fa(++_0x5bec09);}(_0xbeed,0x127));var _0xdbee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbeed[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdbee('0x0'));var util=require(_0xdbee('0x1'));var logger=require('../../config/logger')(_0xdbee('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdbee('0x3'));var fs=require('fs');var path=require(_0xdbee('0x4'));var rimraf=require(_0xdbee('0x5'));var config=require(_0xdbee('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0xdbee('0x7')]=function(_0x1de36f,_0x48f14d){return _0x1de36f['define'](_0xdbee('0x8'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf844=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xf844,0x14e));var _0x4f84=function(_0x537563,_0x1eab9e){_0x537563=_0x537563-0x0;var _0x3d3f2=_0xf844[_0x537563];return _0x3d3f2;};'use strict';var _=require(_0x4f84('0x0'));var util=require(_0x4f84('0x1'));var logger=require(_0x4f84('0x2'))(_0x4f84('0x3'));var moment=require(_0x4f84('0x4'));var BPromise=require(_0x4f84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f84('0x6'));var rimraf=require(_0x4f84('0x7'));var config=require(_0x4f84('0x8'));var attributes=require(_0x4f84('0x9'));module[_0x4f84('0xa')]=function(_0x20f3c8,_0x3b1f5c){return _0x20f3c8[_0x4f84('0xb')](_0x4f84('0xc'),attributes,{'tableName':_0x4f84('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 22c9290..5426fb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8807=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x71a6e0,_0x19ff83){var _0x264938=function(_0x598f5a){while(--_0x598f5a){_0x71a6e0['push'](_0x71a6e0['shift']());}};_0x264938(++_0x19ff83);}(_0x8807,0xac));var _0x7880=function(_0x4e1280,_0x3b8e04){_0x4e1280=_0x4e1280-0x0;var _0x59c5f=_0x8807[_0x4e1280];return _0x59c5f;};'use strict';var _=require('lodash');var util=require(_0x7880('0x0'));var moment=require(_0x7880('0x1'));var BPromise=require(_0x7880('0x2'));var rs=require(_0x7880('0x3'));var fs=require('fs');var Redis=require(_0x7880('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7880('0x5'));var logger=require('../../config/logger')(_0x7880('0x6'));var config=require(_0x7880('0x7'));var jayson=require(_0x7880('0x8'));var client=jayson[_0x7880('0x9')][_0x7880('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20a358,_0x1c5da6,_0x5dd3d4){return new BPromise(function(_0x483193,_0x3b7fd6){return client['request'](_0x20a358,_0x5dd3d4)['then'](function(_0x40f3ed){logger['info'](_0x7880('0xb'),_0x1c5da6,_0x7880('0xc'));logger[_0x7880('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1c5da6,_0x7880('0xc'),JSON[_0x7880('0xe')](_0x40f3ed));if(_0x40f3ed[_0x7880('0xf')]){if(_0x40f3ed[_0x7880('0xf')]['code']===0x1f4){logger[_0x7880('0xf')](_0x7880('0xb'),_0x1c5da6,_0x40f3ed[_0x7880('0xf')]['message']);return _0x3b7fd6(_0x40f3ed[_0x7880('0xf')][_0x7880('0x10')]);}logger[_0x7880('0xf')](_0x7880('0xb'),_0x1c5da6,_0x40f3ed['error'][_0x7880('0x10')]);return _0x483193(_0x40f3ed[_0x7880('0xf')]['message']);}else{logger[_0x7880('0x11')](_0x7880('0xb'),_0x1c5da6,_0x7880('0xc'));_0x483193(_0x40f3ed['result'][_0x7880('0x10')]);}})[_0x7880('0x12')](function(_0x35b044){logger[_0x7880('0xf')](_0x7880('0xb'),_0x1c5da6,_0x35b044);_0x3b7fd6(_0x35b044);});});}
\ No newline at end of file
+var _0x35d2=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent'];(function(_0x1abde4,_0x445e9f){var _0xbbef4c=function(_0x485e1b){while(--_0x485e1b){_0x1abde4['push'](_0x1abde4['shift']());}};_0xbbef4c(++_0x445e9f);}(_0x35d2,0xd4));var _0x235d=function(_0x3ad99c,_0x207389){_0x3ad99c=_0x3ad99c-0x0;var _0x420368=_0x35d2[_0x3ad99c];return _0x420368;};'use strict';var _=require(_0x235d('0x0'));var util=require('util');var moment=require(_0x235d('0x1'));var BPromise=require(_0x235d('0x2'));var rs=require(_0x235d('0x3'));var fs=require('fs');var Redis=require(_0x235d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x235d('0x5'));var logger=require(_0x235d('0x6'))(_0x235d('0x7'));var config=require(_0x235d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x235d('0x9')][_0x235d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5340cb,_0x1b1381,_0x535437){return new BPromise(function(_0x41a9ae,_0x518aa2){return client[_0x235d('0xb')](_0x5340cb,_0x535437)['then'](function(_0x252087){logger[_0x235d('0xc')](_0x235d('0xd'),_0x1b1381,'request\x20sent');logger[_0x235d('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1b1381,'request\x20sent',JSON['stringify'](_0x252087));if(_0x252087['error']){if(_0x252087[_0x235d('0xf')][_0x235d('0x10')]===0x1f4){logger[_0x235d('0xf')](_0x235d('0xd'),_0x1b1381,_0x252087[_0x235d('0xf')][_0x235d('0x11')]);return _0x518aa2(_0x252087[_0x235d('0xf')][_0x235d('0x11')]);}logger['error'](_0x235d('0xd'),_0x1b1381,_0x252087[_0x235d('0xf')][_0x235d('0x11')]);return _0x41a9ae(_0x252087[_0x235d('0xf')][_0x235d('0x11')]);}else{logger[_0x235d('0xc')](_0x235d('0xd'),_0x1b1381,_0x235d('0x12'));_0x41a9ae(_0x252087[_0x235d('0x13')][_0x235d('0x11')]);}})[_0x235d('0x14')](function(_0x2bbcef){logger['error'](_0x235d('0xd'),_0x1b1381,_0x2bbcef);_0x518aa2(_0x2bbcef);});});}
\ No newline at end of file
index bc15647..e004aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb8=['post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','index','isAuthenticated','show','/:id/download'];(function(_0x15629e,_0x331ae1){var _0x2e7c72=function(_0x138b50){while(--_0x138b50){_0x15629e['push'](_0x15629e['shift']());}};_0x2e7c72(++_0x331ae1);}(_0xabb8,0x93));var _0x8abb=function(_0xd1d55c,_0x9fc06a){_0xd1d55c=_0xd1d55c-0x0;var _0x3a5b7b=_0xabb8[_0xd1d55c];return _0x3a5b7b;};'use strict';var multer=require(_0x8abb('0x0'));var util=require(_0x8abb('0x1'));var path=require(_0x8abb('0x2'));var timeout=require(_0x8abb('0x3'));var express=require(_0x8abb('0x4'));var router=express['Router']();var fs_extra=require(_0x8abb('0x5'));var auth=require(_0x8abb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8abb('0x7'));router[_0x8abb('0x8')]('/',auth['isAuthenticated'](),controller[_0x8abb('0x9')]);router['get']('/:id',auth[_0x8abb('0xa')](),controller[_0x8abb('0xb')]);router['get'](_0x8abb('0xc'),auth[_0x8abb('0xa')](),controller['download']);router[_0x8abb('0xd')]('/',auth[_0x8abb('0xa')](),controller[_0x8abb('0xe')]);router[_0x8abb('0xf')]('/:id',auth[_0x8abb('0xa')](),controller[_0x8abb('0x10')]);router['delete'](_0x8abb('0x11'),auth[_0x8abb('0xa')](),controller[_0x8abb('0x12')]);module[_0x8abb('0x13')]=router;
\ No newline at end of file
+var _0x9f9e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','download','post','create','/:id','update','delete','destroy','exports','multer','path'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0x9f9e,0x76));var _0xe9f9=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x9f9e[_0x378b4];return _0x11d07b;};'use strict';var multer=require(_0xe9f9('0x0'));var util=require('util');var path=require(_0xe9f9('0x1'));var timeout=require(_0xe9f9('0x2'));var express=require(_0xe9f9('0x3'));var router=express[_0xe9f9('0x4')]();var fs_extra=require(_0xe9f9('0x5'));var auth=require(_0xe9f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe9f9('0x7'));var controller=require(_0xe9f9('0x8'));router[_0xe9f9('0x9')]('/',auth[_0xe9f9('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9f9('0xb')]);router[_0xe9f9('0x9')]('/:id/download',auth[_0xe9f9('0xa')](),controller[_0xe9f9('0xc')]);router[_0xe9f9('0xd')]('/',auth[_0xe9f9('0xa')](),controller[_0xe9f9('0xe')]);router['put'](_0xe9f9('0xf'),auth['isAuthenticated'](),controller[_0xe9f9('0x10')]);router[_0xe9f9('0x11')]('/:id',auth[_0xe9f9('0xa')](),controller[_0xe9f9('0x12')]);module[_0xe9f9('0x13')]=router;
\ No newline at end of file
index 07325ec..baa5393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91da=['BOOLEAN','sequelize','exports','STRING'];(function(_0x28087c,_0x895c0f){var _0x329122=function(_0x25c2e9){while(--_0x25c2e9){_0x28087c['push'](_0x28087c['shift']());}};_0x329122(++_0x895c0f);}(_0x91da,0xe5));var _0xa91d=function(_0x1c5a4f,_0x5bb283){_0x1c5a4f=_0x1c5a4f-0x0;var _0x4d52af=_0x91da[_0x1c5a4f];return _0x4d52af;};'use strict';var Sequelize=require(_0xa91d('0x0'));module[_0xa91d('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa91d('0x2')]},'function':{'type':Sequelize[_0xa91d('0x2')]},'format':{'type':Sequelize[_0xa91d('0x2')]},'groupBy':{'type':Sequelize[_0xa91d('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa91d('0x2')]},'custom':{'type':Sequelize[_0xa91d('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x916a=['exports','STRING','BOOLEAN'];(function(_0x377ed8,_0x244c12){var _0x4a1f59=function(_0x4d342a){while(--_0x4d342a){_0x377ed8['push'](_0x377ed8['shift']());}};_0x4a1f59(++_0x244c12);}(_0x916a,0x195));var _0xa916=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0x916a[_0xd299c3];return _0x376574;};'use strict';var Sequelize=require('sequelize');module[_0xa916('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa916('0x1')]},'function':{'type':Sequelize[_0xa916('0x1')]},'format':{'type':Sequelize[_0xa916('0x1')]},'groupBy':{'type':Sequelize[_0xa916('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa916('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index f9c823f..f975a3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc64=['limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3349f0,_0x23b911){var _0x2f1dcc=function(_0x2d6b7d){while(--_0x2d6b7d){_0x3349f0['push'](_0x3349f0['shift']());}};_0x2f1dcc(++_0x23b911);}(_0xdc64,0x88));var _0x4dc6=function(_0x5e7fc3,_0x21560c){_0x5e7fc3=_0x5e7fc3-0x0;var _0xf44182=_0xdc64[_0x5e7fc3];return _0xf44182;};'use strict';var emlformat=require(_0x4dc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dc6('0x1'));var jsonpatch=require(_0x4dc6('0x2'));var rp=require(_0x4dc6('0x3'));var moment=require(_0x4dc6('0x4'));var BPromise=require(_0x4dc6('0x5'));var Mustache=require(_0x4dc6('0x6'));var util=require(_0x4dc6('0x7'));var path=require(_0x4dc6('0x8'));var sox=require(_0x4dc6('0x9'));var csv=require(_0x4dc6('0xa'));var ejs=require(_0x4dc6('0xb'));var fs=require('fs');var fs_extra=require(_0x4dc6('0xc'));var _=require('lodash');var squel=require(_0x4dc6('0xd'));var crypto=require(_0x4dc6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4dc6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4dc6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4dc6('0x11'));var as=require(_0x4dc6('0x12'));var hardwareService=require(_0x4dc6('0x13'));var logger=require(_0x4dc6('0x14'))('api');var utils=require(_0x4dc6('0x15'));var config=require(_0x4dc6('0x16'));var licenseUtil=require(_0x4dc6('0x17'));var db=require(_0x4dc6('0x18'))['db'];function respondWithStatusCode(_0x55bbba,_0x4c7584){_0x4c7584=_0x4c7584||0xcc;return function(_0x1f0b37){if(_0x1f0b37){return _0x55bbba[_0x4dc6('0x19')](_0x4c7584);}return _0x55bbba[_0x4dc6('0x1a')](_0x4c7584)[_0x4dc6('0x1b')]();};}function respondWithResult(_0x56cd0b,_0x4a6e23){_0x4a6e23=_0x4a6e23||0xc8;return function(_0x515539){if(_0x515539){return _0x56cd0b[_0x4dc6('0x1a')](_0x4a6e23)[_0x4dc6('0x1c')](_0x515539);}};}function respondWithFilteredResult(_0x5d915b,_0x5cf38f){return function(_0x26f66e){if(_0x26f66e){var _0x53cade=typeof _0x5cf38f[_0x4dc6('0x1d')]==='undefined'&&typeof _0x5cf38f[_0x4dc6('0x1e')]==='undefined';var _0x329930=_0x26f66e[_0x4dc6('0x1f')];var _0x1ec457=_0x53cade?0x0:_0x5cf38f[_0x4dc6('0x1d')];var _0x6dfde4=_0x53cade?_0x26f66e[_0x4dc6('0x1f')]:_0x5cf38f[_0x4dc6('0x1d')]+_0x5cf38f[_0x4dc6('0x1e')];var _0x4f4e5a;if(_0x6dfde4>=_0x329930){_0x6dfde4=_0x329930;_0x4f4e5a=0xc8;}else{_0x4f4e5a=0xce;}_0x5d915b[_0x4dc6('0x1a')](_0x4f4e5a);return _0x5d915b[_0x4dc6('0x20')](_0x4dc6('0x21'),_0x1ec457+'-'+_0x6dfde4+'/'+_0x329930)['json'](_0x26f66e);}return null;};}function patchUpdates(_0xaaba78){return function(_0x21241c){try{jsonpatch[_0x4dc6('0x22')](_0x21241c,_0xaaba78,!![]);}catch(_0x265702){return BPromise['reject'](_0x265702);}return _0x21241c[_0x4dc6('0x23')]();};}function saveUpdates(_0x42aaa9,_0x594847){return function(_0x1d64b2){if(_0x1d64b2){return _0x1d64b2[_0x4dc6('0x24')](_0x42aaa9)[_0x4dc6('0x25')](function(_0x3837a8){return _0x3837a8;});}return null;};}function removeEntity(_0x29e845,_0x45a533){return function(_0x3200c2){if(_0x3200c2){return _0x3200c2[_0x4dc6('0x26')]()[_0x4dc6('0x25')](function(){_0x29e845[_0x4dc6('0x1a')](0xcc)[_0x4dc6('0x1b')]();});}};}function handleEntityNotFound(_0x470277,_0x17ccf8){return function(_0x5c8e26){if(!_0x5c8e26){_0x470277[_0x4dc6('0x19')](0x194);}return _0x5c8e26;};}function handleError(_0x1463f2,_0x2b09dc){_0x2b09dc=_0x2b09dc||0x1f4;return function(_0x3c7ef7){logger[_0x4dc6('0x27')](_0x3c7ef7[_0x4dc6('0x28')]);if(_0x3c7ef7[_0x4dc6('0x29')]){delete _0x3c7ef7[_0x4dc6('0x29')];}_0x1463f2['status'](_0x2b09dc)[_0x4dc6('0x2a')](_0x3c7ef7);};}exports[_0x4dc6('0x2b')]=function(_0x25afe2,_0xd55848){var _0x597161={},_0x37d3a8={},_0x9abbdc={'count':0x0,'rows':[]};var _0x56986d=_[_0x4dc6('0x2c')](db['AnalyticFieldReport'][_0x4dc6('0x2d')],function(_0x395d43){return{'name':_0x395d43[_0x4dc6('0x2e')],'type':_0x395d43[_0x4dc6('0x2f')][_0x4dc6('0x30')]};});_0x37d3a8[_0x4dc6('0x31')]=_[_0x4dc6('0x2c')](_0x56986d,_0x4dc6('0x29'));_0x37d3a8[_0x4dc6('0x32')]=_[_0x4dc6('0x33')](_0x25afe2[_0x4dc6('0x32')]);_0x37d3a8[_0x4dc6('0x34')]=_[_0x4dc6('0x35')](_0x37d3a8[_0x4dc6('0x31')],_0x37d3a8[_0x4dc6('0x32')]);_0x597161[_0x4dc6('0x36')]=_[_0x4dc6('0x35')](_0x37d3a8[_0x4dc6('0x31')],qs[_0x4dc6('0x37')](_0x25afe2[_0x4dc6('0x32')]['fields']));_0x597161[_0x4dc6('0x36')]=_0x597161[_0x4dc6('0x36')][_0x4dc6('0x38')]?_0x597161['attributes']:_0x37d3a8[_0x4dc6('0x31')];if(!_0x25afe2[_0x4dc6('0x32')][_0x4dc6('0x39')](_0x4dc6('0x3a'))){_0x597161['limit']=qs[_0x4dc6('0x1e')](_0x25afe2['query'][_0x4dc6('0x1e')]);_0x597161[_0x4dc6('0x1d')]=qs['offset'](_0x25afe2[_0x4dc6('0x32')]['offset']);}_0x597161['order']=qs[_0x4dc6('0x3b')](_0x25afe2[_0x4dc6('0x32')][_0x4dc6('0x3b')]);_0x597161[_0x4dc6('0x3c')]=qs[_0x4dc6('0x34')](_[_0x4dc6('0x3d')](_0x25afe2[_0x4dc6('0x32')],_0x37d3a8[_0x4dc6('0x34')]),_0x56986d);if(_0x25afe2[_0x4dc6('0x32')][_0x4dc6('0x3e')]){_0x597161[_0x4dc6('0x3c')]=_[_0x4dc6('0x3f')](_0x597161[_0x4dc6('0x3c')],{'$or':_[_0x4dc6('0x2c')](_0x56986d,function(_0x52a10d){if(_0x52a10d[_0x4dc6('0x2f')]!=='VIRTUAL'){var _0x8c7c45={};_0x8c7c45[_0x52a10d[_0x4dc6('0x29')]]={'$like':'%'+_0x25afe2[_0x4dc6('0x32')][_0x4dc6('0x3e')]+'%'};return _0x8c7c45;}})});}_0x597161=_['merge']({},_0x597161,_0x25afe2[_0x4dc6('0x40')]);var _0x3df850={'where':_0x597161[_0x4dc6('0x3c')]};return db[_0x4dc6('0x41')][_0x4dc6('0x1f')](_0x3df850)[_0x4dc6('0x25')](function(_0x1d1e59){_0x9abbdc['count']=_0x1d1e59;if(_0x25afe2['query'][_0x4dc6('0x42')]){_0x597161[_0x4dc6('0x43')]=[{'all':!![]}];}return db[_0x4dc6('0x41')][_0x4dc6('0x44')](_0x597161);})[_0x4dc6('0x25')](function(_0x5d8009){_0x9abbdc[_0x4dc6('0x45')]=_0x5d8009;return _0x9abbdc;})[_0x4dc6('0x25')](respondWithFilteredResult(_0xd55848,_0x597161))[_0x4dc6('0x46')](handleError(_0xd55848,null));};exports[_0x4dc6('0x47')]=function(_0x3a7160,_0x4319a1){var _0x3da774={'raw':![],'where':{'id':_0x3a7160[_0x4dc6('0x48')]['id']}},_0x2aa030={};_0x2aa030[_0x4dc6('0x31')]=_[_0x4dc6('0x33')](db[_0x4dc6('0x41')][_0x4dc6('0x2d')]);_0x2aa030[_0x4dc6('0x32')]=_['keys'](_0x3a7160[_0x4dc6('0x32')]);_0x2aa030['filters']=_[_0x4dc6('0x35')](_0x2aa030[_0x4dc6('0x31')],_0x2aa030['query']);_0x3da774[_0x4dc6('0x36')]=_[_0x4dc6('0x35')](_0x2aa030['model'],qs[_0x4dc6('0x37')](_0x3a7160['query']['fields']));_0x3da774[_0x4dc6('0x36')]=_0x3da774[_0x4dc6('0x36')]['length']?_0x3da774[_0x4dc6('0x36')]:_0x2aa030[_0x4dc6('0x31')];if(_0x3a7160[_0x4dc6('0x32')]['includeAll']){_0x3da774[_0x4dc6('0x43')]=[{'all':!![]}];}_0x3da774=_[_0x4dc6('0x3f')]({},_0x3da774,_0x3a7160['options']);return db[_0x4dc6('0x41')][_0x4dc6('0x49')](_0x3da774)['then'](handleEntityNotFound(_0x4319a1,null))[_0x4dc6('0x25')](respondWithResult(_0x4319a1,null))['catch'](handleError(_0x4319a1,null));};exports[_0x4dc6('0x4a')]=function(_0x39055e,_0x584f25){return db[_0x4dc6('0x41')][_0x4dc6('0x4a')](_0x39055e['body'],{})[_0x4dc6('0x25')](respondWithResult(_0x584f25,0xc9))[_0x4dc6('0x46')](handleError(_0x584f25,null));};exports['bulkCreate']=function(_0x64b773,_0x201e55){return db[_0x4dc6('0x41')]['bulkCreate'](_0x64b773[_0x4dc6('0x4b')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x201e55,0xc9))[_0x4dc6('0x46')](handleError(_0x201e55,null));};exports[_0x4dc6('0x24')]=function(_0x378243,_0x3769c6){if(_0x378243[_0x4dc6('0x4b')]['id']){delete _0x378243['body']['id'];}return db[_0x4dc6('0x41')][_0x4dc6('0x49')]({'where':{'id':_0x378243['params']['id']}})['then'](handleEntityNotFound(_0x3769c6,null))['then'](saveUpdates(_0x378243[_0x4dc6('0x4b')],null))[_0x4dc6('0x25')](respondWithResult(_0x3769c6,null))[_0x4dc6('0x46')](handleError(_0x3769c6,null));};exports[_0x4dc6('0x26')]=function(_0x5c698a,_0x461bc8){return db[_0x4dc6('0x41')][_0x4dc6('0x49')]({'where':{'id':_0x5c698a[_0x4dc6('0x48')]['id']}})[_0x4dc6('0x25')](handleEntityNotFound(_0x461bc8,null))[_0x4dc6('0x25')](removeEntity(_0x461bc8,null))[_0x4dc6('0x46')](handleError(_0x461bc8,null));};exports[_0x4dc6('0x4c')]=function(_0x185728,_0x4c574b){return db[_0x4dc6('0x41')][_0x4dc6('0x26')]({'where':{'id':_0x185728[_0x4dc6('0x32')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x4dc6('0x25')](respondWithResult(_0x4c574b,0xcc))[_0x4dc6('0x46')](handleError(_0x4c574b,null));};exports[_0x4dc6('0x4d')]=function(_0x162f7f,_0x327317,_0x2a0254){return db[_0x4dc6('0x4e')][_0x4dc6('0x4f')]({'where':{'id':_0x162f7f['params']['id']}})[_0x4dc6('0x25')](handleEntityNotFound(_0x327317,null))[_0x4dc6('0x25')](function(_0x4307c5){if(_0x4307c5){return db[_0x4dc6('0x50')][_0x4dc6('0x51')](function(_0x32d038){return db[_0x4dc6('0x41')][_0x4dc6('0x26')]({'where':{'CustomReportId':_0x162f7f[_0x4dc6('0x48')]['id']},'transaction':_0x32d038})[_0x4dc6('0x25')](function(_0x3119d9){var _0x10b3e4=_[_0x4dc6('0x2c')](_0x162f7f['body'],function(_0xfb255a){delete _0xfb255a['id'];_0xfb255a['CustomReportId']=_0x162f7f[_0x4dc6('0x48')]['id'];return _0xfb255a;});return db['AnalyticFieldReport'][_0x4dc6('0x52')](_0x10b3e4,{'transaction':_0x32d038});});})[_0x4dc6('0x25')](function(){return db[_0x4dc6('0x41')][_0x4dc6('0x44')]({'where':{'CustomReportId':_0x162f7f[_0x4dc6('0x48')]['id']}});});}})[_0x4dc6('0x25')](respondWithResult(_0x327317,null))[_0x4dc6('0x46')](handleError(_0x327317,null));};
\ No newline at end of file
+var _0x1ad5=['name','send','AnalyticFieldReport','key','model','map','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','update','then','destroy','error','stack'];(function(_0x25260d,_0x5bc43b){var _0x3622cb=function(_0x286533){while(--_0x286533){_0x25260d['push'](_0x25260d['shift']());}};_0x3622cb(++_0x5bc43b);}(_0x1ad5,0xca));var _0x51ad=function(_0x79cd47,_0x16102d){_0x79cd47=_0x79cd47-0x0;var _0x3b9484=_0x1ad5[_0x79cd47];return _0x3b9484;};'use strict';var emlformat=require(_0x51ad('0x0'));var rimraf=require(_0x51ad('0x1'));var zipdir=require(_0x51ad('0x2'));var jsonpatch=require(_0x51ad('0x3'));var rp=require(_0x51ad('0x4'));var moment=require(_0x51ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x51ad('0x6'));var util=require(_0x51ad('0x7'));var path=require(_0x51ad('0x8'));var sox=require(_0x51ad('0x9'));var csv=require(_0x51ad('0xa'));var ejs=require(_0x51ad('0xb'));var fs=require('fs');var fs_extra=require(_0x51ad('0xc'));var _=require(_0x51ad('0xd'));var squel=require(_0x51ad('0xe'));var crypto=require('crypto');var jsforce=require(_0x51ad('0xf'));var deskjs=require(_0x51ad('0x10'));var toCsv=require(_0x51ad('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x51ad('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x51ad('0x12'));var as=require(_0x51ad('0x13'));var hardwareService=require(_0x51ad('0x14'));var logger=require(_0x51ad('0x15'))(_0x51ad('0x16'));var utils=require(_0x51ad('0x17'));var config=require(_0x51ad('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c651c,_0x1e1e71){_0x1e1e71=_0x1e1e71||0xcc;return function(_0x2fd885){if(_0x2fd885){return _0x1c651c[_0x51ad('0x19')](_0x1e1e71);}return _0x1c651c[_0x51ad('0x1a')](_0x1e1e71)[_0x51ad('0x1b')]();};}function respondWithResult(_0x483e03,_0x4b946d){_0x4b946d=_0x4b946d||0xc8;return function(_0x23de38){if(_0x23de38){return _0x483e03[_0x51ad('0x1a')](_0x4b946d)[_0x51ad('0x1c')](_0x23de38);}};}function respondWithFilteredResult(_0x229897,_0x2f9d20){return function(_0x526db0){if(_0x526db0){var _0x576e2e=typeof _0x2f9d20['offset']===_0x51ad('0x1d')&&typeof _0x2f9d20['limit']===_0x51ad('0x1d');var _0x4ab44b=_0x526db0[_0x51ad('0x1e')];var _0x127c10=_0x576e2e?0x0:_0x2f9d20[_0x51ad('0x1f')];var _0x2a0de2=_0x576e2e?_0x526db0[_0x51ad('0x1e')]:_0x2f9d20['offset']+_0x2f9d20[_0x51ad('0x20')];var _0x435c38;if(_0x2a0de2>=_0x4ab44b){_0x2a0de2=_0x4ab44b;_0x435c38=0xc8;}else{_0x435c38=0xce;}_0x229897[_0x51ad('0x1a')](_0x435c38);return _0x229897[_0x51ad('0x21')]('Content-Range',_0x127c10+'-'+_0x2a0de2+'/'+_0x4ab44b)[_0x51ad('0x1c')](_0x526db0);}return null;};}function patchUpdates(_0x282e15){return function(_0xfad642){try{jsonpatch[_0x51ad('0x22')](_0xfad642,_0x282e15,!![]);}catch(_0x360665){return BPromise['reject'](_0x360665);}return _0xfad642[_0x51ad('0x23')]();};}function saveUpdates(_0x5751a9,_0x1a773a){return function(_0x24fc8e){if(_0x24fc8e){return _0x24fc8e[_0x51ad('0x24')](_0x5751a9)[_0x51ad('0x25')](function(_0x3ee828){return _0x3ee828;});}return null;};}function removeEntity(_0x3bebb6,_0x56e79f){return function(_0x21d438){if(_0x21d438){return _0x21d438[_0x51ad('0x26')]()[_0x51ad('0x25')](function(){_0x3bebb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3aec0e,_0x3104a9){return function(_0x3af368){if(!_0x3af368){_0x3aec0e[_0x51ad('0x19')](0x194);}return _0x3af368;};}function handleError(_0x1d2116,_0x571c9e){_0x571c9e=_0x571c9e||0x1f4;return function(_0x3d5f65){logger[_0x51ad('0x27')](_0x3d5f65[_0x51ad('0x28')]);if(_0x3d5f65[_0x51ad('0x29')]){delete _0x3d5f65[_0x51ad('0x29')];}_0x1d2116['status'](_0x571c9e)[_0x51ad('0x2a')](_0x3d5f65);};}exports['index']=function(_0x241cbb,_0x5a78ca){var _0x14f186={},_0x54f3f9={},_0x4823ad={'count':0x0,'rows':[]};var _0x585c6a=_['map'](db[_0x51ad('0x2b')]['rawAttributes'],function(_0x392d4d){return{'name':_0x392d4d['fieldName'],'type':_0x392d4d['type'][_0x51ad('0x2c')]};});_0x54f3f9[_0x51ad('0x2d')]=_[_0x51ad('0x2e')](_0x585c6a,_0x51ad('0x29'));_0x54f3f9[_0x51ad('0x2f')]=_['keys'](_0x241cbb['query']);_0x54f3f9['filters']=_[_0x51ad('0x30')](_0x54f3f9[_0x51ad('0x2d')],_0x54f3f9[_0x51ad('0x2f')]);_0x14f186[_0x51ad('0x31')]=_[_0x51ad('0x30')](_0x54f3f9[_0x51ad('0x2d')],qs[_0x51ad('0x32')](_0x241cbb[_0x51ad('0x2f')]['fields']));_0x14f186[_0x51ad('0x31')]=_0x14f186[_0x51ad('0x31')][_0x51ad('0x33')]?_0x14f186[_0x51ad('0x31')]:_0x54f3f9[_0x51ad('0x2d')];if(!_0x241cbb['query']['hasOwnProperty']('nolimit')){_0x14f186[_0x51ad('0x20')]=qs[_0x51ad('0x20')](_0x241cbb[_0x51ad('0x2f')][_0x51ad('0x20')]);_0x14f186[_0x51ad('0x1f')]=qs[_0x51ad('0x1f')](_0x241cbb[_0x51ad('0x2f')]['offset']);}_0x14f186[_0x51ad('0x34')]=qs['sort'](_0x241cbb[_0x51ad('0x2f')][_0x51ad('0x35')]);_0x14f186[_0x51ad('0x36')]=qs[_0x51ad('0x37')](_[_0x51ad('0x38')](_0x241cbb[_0x51ad('0x2f')],_0x54f3f9['filters']),_0x585c6a);if(_0x241cbb['query'][_0x51ad('0x39')]){_0x14f186[_0x51ad('0x36')]=_['merge'](_0x14f186[_0x51ad('0x36')],{'$or':_[_0x51ad('0x2e')](_0x585c6a,function(_0x18dc0c){if(_0x18dc0c[_0x51ad('0x3a')]!=='VIRTUAL'){var _0x2771a7={};_0x2771a7[_0x18dc0c[_0x51ad('0x29')]]={'$like':'%'+_0x241cbb[_0x51ad('0x2f')]['filter']+'%'};return _0x2771a7;}})});}_0x14f186=_[_0x51ad('0x3b')]({},_0x14f186,_0x241cbb[_0x51ad('0x3c')]);var _0x109751={'where':_0x14f186['where']};return db['AnalyticFieldReport'][_0x51ad('0x1e')](_0x109751)[_0x51ad('0x25')](function(_0x54900e){_0x4823ad['count']=_0x54900e;if(_0x241cbb[_0x51ad('0x2f')][_0x51ad('0x3d')]){_0x14f186[_0x51ad('0x3e')]=[{'all':!![]}];}return db[_0x51ad('0x2b')][_0x51ad('0x3f')](_0x14f186);})[_0x51ad('0x25')](function(_0x3a9ab6){_0x4823ad[_0x51ad('0x40')]=_0x3a9ab6;return _0x4823ad;})[_0x51ad('0x25')](respondWithFilteredResult(_0x5a78ca,_0x14f186))[_0x51ad('0x41')](handleError(_0x5a78ca,null));};exports[_0x51ad('0x42')]=function(_0x4ba941,_0x45a02d){var _0xc2919f={'raw':![],'where':{'id':_0x4ba941[_0x51ad('0x43')]['id']}},_0x2a1390={};_0x2a1390[_0x51ad('0x2d')]=_[_0x51ad('0x44')](db['AnalyticFieldReport'][_0x51ad('0x45')]);_0x2a1390['query']=_['keys'](_0x4ba941[_0x51ad('0x2f')]);_0x2a1390[_0x51ad('0x37')]=_[_0x51ad('0x30')](_0x2a1390[_0x51ad('0x2d')],_0x2a1390[_0x51ad('0x2f')]);_0xc2919f[_0x51ad('0x31')]=_[_0x51ad('0x30')](_0x2a1390[_0x51ad('0x2d')],qs['fields'](_0x4ba941[_0x51ad('0x2f')][_0x51ad('0x32')]));_0xc2919f[_0x51ad('0x31')]=_0xc2919f[_0x51ad('0x31')][_0x51ad('0x33')]?_0xc2919f[_0x51ad('0x31')]:_0x2a1390[_0x51ad('0x2d')];if(_0x4ba941[_0x51ad('0x2f')][_0x51ad('0x3d')]){_0xc2919f[_0x51ad('0x3e')]=[{'all':!![]}];}_0xc2919f=_[_0x51ad('0x3b')]({},_0xc2919f,_0x4ba941[_0x51ad('0x3c')]);return db[_0x51ad('0x2b')][_0x51ad('0x46')](_0xc2919f)[_0x51ad('0x25')](handleEntityNotFound(_0x45a02d,null))[_0x51ad('0x25')](respondWithResult(_0x45a02d,null))[_0x51ad('0x41')](handleError(_0x45a02d,null));};exports[_0x51ad('0x47')]=function(_0x5ead3f,_0x1cbb2d){return db['AnalyticFieldReport'][_0x51ad('0x47')](_0x5ead3f[_0x51ad('0x48')],{})['then'](respondWithResult(_0x1cbb2d,0xc9))[_0x51ad('0x41')](handleError(_0x1cbb2d,null));};exports[_0x51ad('0x49')]=function(_0x2de5ce,_0x23cc09){return db[_0x51ad('0x2b')]['bulkCreate'](_0x2de5ce[_0x51ad('0x48')],{'raw':![],'individualHooks':!![]})[_0x51ad('0x25')](respondWithResult(_0x23cc09,0xc9))['catch'](handleError(_0x23cc09,null));};exports['update']=function(_0x317261,_0x217f4b){if(_0x317261[_0x51ad('0x48')]['id']){delete _0x317261[_0x51ad('0x48')]['id'];}return db[_0x51ad('0x2b')][_0x51ad('0x46')]({'where':{'id':_0x317261[_0x51ad('0x43')]['id']}})[_0x51ad('0x25')](handleEntityNotFound(_0x217f4b,null))['then'](saveUpdates(_0x317261['body'],null))[_0x51ad('0x25')](respondWithResult(_0x217f4b,null))[_0x51ad('0x41')](handleError(_0x217f4b,null));};exports[_0x51ad('0x26')]=function(_0x5718f7,_0x5d7d06){return db['AnalyticFieldReport'][_0x51ad('0x46')]({'where':{'id':_0x5718f7[_0x51ad('0x43')]['id']}})[_0x51ad('0x25')](handleEntityNotFound(_0x5d7d06,null))['then'](removeEntity(_0x5d7d06,null))[_0x51ad('0x41')](handleError(_0x5d7d06,null));};exports[_0x51ad('0x4a')]=function(_0x4965c1,_0xd6695d){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4965c1[_0x51ad('0x2f')][_0x51ad('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xd6695d,0xcc))[_0x51ad('0x41')](handleError(_0xd6695d,null));};exports['addFields']=function(_0x216419,_0x417946,_0xa5cf29){return db[_0x51ad('0x4c')][_0x51ad('0x4d')]({'where':{'id':_0x216419[_0x51ad('0x43')]['id']}})[_0x51ad('0x25')](handleEntityNotFound(_0x417946,null))['then'](function(_0x21ab32){if(_0x21ab32){return db[_0x51ad('0x4e')][_0x51ad('0x4f')](function(_0x44e1db){return db[_0x51ad('0x2b')]['destroy']({'where':{'CustomReportId':_0x216419[_0x51ad('0x43')]['id']},'transaction':_0x44e1db})['then'](function(_0x21e23e){var _0x24b83f=_[_0x51ad('0x2e')](_0x216419[_0x51ad('0x48')],function(_0x36b7a3){delete _0x36b7a3['id'];_0x36b7a3[_0x51ad('0x50')]=_0x216419[_0x51ad('0x43')]['id'];return _0x36b7a3;});return db[_0x51ad('0x2b')][_0x51ad('0x49')](_0x24b83f,{'transaction':_0x44e1db});});})[_0x51ad('0x25')](function(){return db[_0x51ad('0x2b')][_0x51ad('0x3f')]({'where':{'CustomReportId':_0x216419[_0x51ad('0x43')]['id']}});});}})['then'](respondWithResult(_0x417946,null))[_0x51ad('0x41')](handleError(_0x417946,null));};
\ No newline at end of file
index 413f7ea..8d7486e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4119=['AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x4a0d06,_0x22d096){var _0x123baf=function(_0x5c214f){while(--_0x5c214f){_0x4a0d06['push'](_0x4a0d06['shift']());}};_0x123baf(++_0x22d096);}(_0x4119,0x14c));var _0x9411=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x4119[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x9411('0x0'));var util=require('util');var logger=require(_0x9411('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9411('0x2'));var rp=require(_0x9411('0x3'));var fs=require('fs');var path=require(_0x9411('0x4'));var rimraf=require(_0x9411('0x5'));var config=require(_0x9411('0x6'));var attributes=require(_0x9411('0x7'));module[_0x9411('0x8')]=function(_0x167dd9,_0x4af6ca){return _0x167dd9['define'](_0x9411('0x9'),attributes,{'tableName':_0x9411('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed54=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xed54,0x76));var _0x4ed5=function(_0x1fcd68,_0x43019c){_0x1fcd68=_0x1fcd68-0x0;var _0x4e424d=_0xed54[_0x1fcd68];return _0x4e424d;};'use strict';var _=require(_0x4ed5('0x0'));var util=require(_0x4ed5('0x1'));var logger=require(_0x4ed5('0x2'))(_0x4ed5('0x3'));var moment=require(_0x4ed5('0x4'));var BPromise=require('bluebird');var rp=require(_0x4ed5('0x5'));var fs=require('fs');var path=require(_0x4ed5('0x6'));var rimraf=require(_0x4ed5('0x7'));var config=require(_0x4ed5('0x8'));var attributes=require(_0x4ed5('0x9'));module[_0x4ed5('0xa')]=function(_0x34f44a,_0x2561c7){return _0x34f44a[_0x4ed5('0xb')](_0x4ed5('0xc'),attributes,{'tableName':_0x4ed5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b9e395..d2c0174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05f3=['message','AnalyticFieldReport,\x20%s,\x20%s','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29cce4,_0x379f7c){var _0x1a6616=function(_0x21aadf){while(--_0x21aadf){_0x29cce4['push'](_0x29cce4['shift']());}};_0x1a6616(++_0x379f7c);}(_0x05f3,0xf0));var _0x305f=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x05f3[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require(_0x305f('0x0'));var moment=require(_0x305f('0x1'));var BPromise=require(_0x305f('0x2'));var rs=require(_0x305f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x305f('0x4'))(_0x305f('0x5'));var config=require(_0x305f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x305f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x342eff,_0x169959,_0x444830){return new BPromise(function(_0xb1ed32,_0x2ba60b){return client['request'](_0x342eff,_0x444830)['then'](function(_0x5b3f48){logger[_0x305f('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169959,_0x305f('0x9'));logger[_0x305f('0xa')](_0x305f('0xb'),_0x169959,_0x305f('0x9'),JSON[_0x305f('0xc')](_0x5b3f48));if(_0x5b3f48[_0x305f('0xd')]){if(_0x5b3f48[_0x305f('0xd')][_0x305f('0xe')]===0x1f4){logger[_0x305f('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169959,_0x5b3f48[_0x305f('0xd')]['message']);return _0x2ba60b(_0x5b3f48[_0x305f('0xd')][_0x305f('0xf')]);}logger[_0x305f('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169959,_0x5b3f48[_0x305f('0xd')]['message']);return _0xb1ed32(_0x5b3f48[_0x305f('0xd')][_0x305f('0xf')]);}else{logger[_0x305f('0x8')]('AnalyticFieldReport,\x20%s,\x20%s',_0x169959,_0x305f('0x9'));_0xb1ed32(_0x5b3f48['result'][_0x305f('0xf')]);}})['catch'](function(_0x1ae1f1){logger[_0x305f('0xd')](_0x305f('0x10'),_0x169959,_0x1ae1f1);_0x2ba60b(_0x1ae1f1);});});}
\ No newline at end of file
+var _0x0cbf=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0cbf,0x1a4));var _0xf0cb=function(_0x5da9a4,_0x3ebf42){_0x5da9a4=_0x5da9a4-0x0;var _0x3f458e=_0x0cbf[_0x5da9a4];return _0x3f458e;};'use strict';var _=require(_0xf0cb('0x0'));var util=require(_0xf0cb('0x1'));var moment=require('moment');var BPromise=require(_0xf0cb('0x2'));var rs=require(_0xf0cb('0x3'));var fs=require('fs');var Redis=require(_0xf0cb('0x4'));var db=require(_0xf0cb('0x5'))['db'];var utils=require(_0xf0cb('0x6'));var logger=require('../../config/logger')(_0xf0cb('0x7'));var config=require(_0xf0cb('0x8'));var jayson=require(_0xf0cb('0x9'));var client=jayson[_0xf0cb('0xa')][_0xf0cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf1cc9a,_0x44d1f3,_0x544ca6){return new BPromise(function(_0x3ac9cb,_0x29bb09){return client['request'](_0xf1cc9a,_0x544ca6)[_0xf0cb('0xc')](function(_0x4fc1ad){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x44d1f3,_0xf0cb('0xd'));logger[_0xf0cb('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x44d1f3,_0xf0cb('0xd'),JSON['stringify'](_0x4fc1ad));if(_0x4fc1ad[_0xf0cb('0xf')]){if(_0x4fc1ad[_0xf0cb('0xf')][_0xf0cb('0x10')]===0x1f4){logger[_0xf0cb('0xf')](_0xf0cb('0x11'),_0x44d1f3,_0x4fc1ad[_0xf0cb('0xf')]['message']);return _0x29bb09(_0x4fc1ad[_0xf0cb('0xf')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x44d1f3,_0x4fc1ad[_0xf0cb('0xf')][_0xf0cb('0x12')]);return _0x3ac9cb(_0x4fc1ad['error'][_0xf0cb('0x12')]);}else{logger[_0xf0cb('0x13')](_0xf0cb('0x11'),_0x44d1f3,_0xf0cb('0xd'));_0x3ac9cb(_0x4fc1ad[_0xf0cb('0x14')][_0xf0cb('0x12')]);}})[_0xf0cb('0x15')](function(_0x3acddb){logger['error'](_0xf0cb('0x11'),_0x44d1f3,_0x3acddb);_0x29bb09(_0x3acddb);});});}
\ No newline at end of file
index 182e4bf..1d6ee49 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(_0x2d81ce,_0x423286){var _0x14f9bb=function(_0x16651d){while(--_0x16651d){_0x2d81ce['push'](_0x2d81ce['shift']());}};_0x14f9bb(++_0x423286);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x1c45a1,_0x18f0ca){var _0xde7b99=function(_0x76dc2a){while(--_0x76dc2a){_0x1c45a1['push'](_0x1c45a1['shift']());}};_0xde7b99(++_0x18f0ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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 e31a7b7..3263861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x803f=['sequelize','STRING','name','TEXT'];(function(_0x5ed0b3,_0x3d355b){var _0xb109f1=function(_0x39185a){while(--_0x39185a){_0x5ed0b3['push'](_0x5ed0b3['shift']());}};_0xb109f1(++_0x3d355b);}(_0x803f,0x64));var _0xf803=function(_0x546192,_0x5422bb){_0x546192=_0x546192-0x0;var _0x2f29c8=_0x803f[_0x546192];return _0x2f29c8;};'use strict';var Sequelize=require(_0xf803('0x0'));module['exports']={'name':{'type':Sequelize[_0xf803('0x1')],'allowNull':![],'unique':_0xf803('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf803('0x3')]},'description':{'type':Sequelize[_0xf803('0x1')]}};
\ No newline at end of file
+var _0x9e0d=['name','TEXT','sequelize','exports','STRING'];(function(_0x5dcf18,_0xa8cca8){var _0x5df3fa=function(_0x15c136){while(--_0x15c136){_0x5dcf18['push'](_0x5dcf18['shift']());}};_0x5df3fa(++_0xa8cca8);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x1cb96f,_0x1f21ec){_0x1cb96f=_0x1cb96f-0x0;var _0x418399=_0x9e0d[_0x1cb96f];return _0x418399;};'use strict';var Sequelize=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]={'name':{'type':Sequelize[_0xd9e0('0x2')],'allowNull':![],'unique':_0xd9e0('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xd9e0('0x4')]},'description':{'type':Sequelize[_0xd9e0('0x2')]}};
\ No newline at end of file
index 8b0729f..f61c267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x1e6cf4,_0x31f4eb){var _0xdcf3a7=function(_0x2e2080){while(--_0x2e2080){_0x1e6cf4['push'](_0x1e6cf4['shift']());}};_0xdcf3a7(++_0x31f4eb);}(_0xe14b,0x93));var _0xbe14=function(_0x58e49f,_0x24edb5){_0x58e49f=_0x58e49f-0x0;var _0x32fc79=_0xe14b[_0x58e49f];return _0x32fc79;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x119b88,_0x335cf6){var _0x36b5f6=function(_0x20d443){while(--_0x20d443){_0x119b88['push'](_0x119b88['shift']());}};_0x36b5f6(++_0x335cf6);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3588ba,_0x5c49f3){_0x3588ba=_0x3588ba-0x0;var _0x3695a2=_0x7fbe[_0x3588ba];return _0x3695a2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
index e66fa7e..674b144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e0=['util','api','moment','request-promise','path','rimraf','./analyticMetric.attributes','exports','AnalyticMetric','lodash'];(function(_0x42a577,_0x5dcbc1){var _0x30fb7e=function(_0x15395c){while(--_0x15395c){_0x42a577['push'](_0x42a577['shift']());}};_0x30fb7e(++_0x5dcbc1);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xf2e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var logger=require('../../config/logger')(_0x0f2e('0x2'));var moment=require(_0x0f2e('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f2e('0x4'));var fs=require('fs');var path=require(_0x0f2e('0x5'));var rimraf=require(_0x0f2e('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f2e('0x7'));module[_0x0f2e('0x8')]=function(_0x256aba,_0x47c448){return _0x256aba['define'](_0x0f2e('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x908e=['request-promise','path','../../config/environment','define','AnalyticMetric','analytics_metrics','lodash','util','moment','bluebird'];(function(_0x3b234f,_0x4e2ad8){var _0x10a484=function(_0x582144){while(--_0x582144){_0x3b234f['push'](_0x3b234f['shift']());}};_0x10a484(++_0x4e2ad8);}(_0x908e,0x182));var _0xe908=function(_0x35e524,_0x418c45){_0x35e524=_0x35e524-0x0;var _0x1e3020=_0x908e[_0x35e524];return _0x1e3020;};'use strict';var _=require(_0xe908('0x0'));var util=require(_0xe908('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe908('0x2'));var BPromise=require(_0xe908('0x3'));var rp=require(_0xe908('0x4'));var fs=require('fs');var path=require(_0xe908('0x5'));var rimraf=require('rimraf');var config=require(_0xe908('0x6'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x448267,_0x27b216){return _0x448267[_0xe908('0x7')](_0xe908('0x8'),attributes,{'tableName':_0xe908('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f45119..be4b28d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd138=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x402983,_0x5b1129){var _0x2dfa7e=function(_0x5d5757){while(--_0x5d5757){_0x402983['push'](_0x402983['shift']());}};_0x2dfa7e(++_0x5b1129);}(_0xd138,0x74));var _0x8d13=function(_0x508564,_0x23c709){_0x508564=_0x508564-0x0;var _0x35e8c9=_0xd138[_0x508564];return _0x35e8c9;};'use strict';var _=require('lodash');var util=require(_0x8d13('0x0'));var moment=require(_0x8d13('0x1'));var BPromise=require('bluebird');var rs=require(_0x8d13('0x2'));var fs=require('fs');var Redis=require(_0x8d13('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d13('0x4'));var logger=require(_0x8d13('0x5'))('rpc');var config=require(_0x8d13('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8d13('0x7')][_0x8d13('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5be2eb,_0x5b125b,_0x2866d0){return new BPromise(function(_0x1677e1,_0x57d257){return client[_0x8d13('0x9')](_0x5be2eb,_0x2866d0)[_0x8d13('0xa')](function(_0x394449){logger[_0x8d13('0xb')](_0x8d13('0xc'),_0x5b125b,_0x8d13('0xd'));logger['debug'](_0x8d13('0xe'),_0x5b125b,_0x8d13('0xd'),JSON[_0x8d13('0xf')](_0x394449));if(_0x394449[_0x8d13('0x10')]){if(_0x394449[_0x8d13('0x10')][_0x8d13('0x11')]===0x1f4){logger[_0x8d13('0x10')](_0x8d13('0xc'),_0x5b125b,_0x394449[_0x8d13('0x10')]['message']);return _0x57d257(_0x394449[_0x8d13('0x10')][_0x8d13('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x5b125b,_0x394449[_0x8d13('0x10')][_0x8d13('0x12')]);return _0x1677e1(_0x394449[_0x8d13('0x10')][_0x8d13('0x12')]);}else{logger[_0x8d13('0xb')](_0x8d13('0xc'),_0x5b125b,'request\x20sent');_0x1677e1(_0x394449[_0x8d13('0x13')][_0x8d13('0x12')]);}})[_0x8d13('0x14')](function(_0x1524c9){logger['error'](_0x8d13('0xc'),_0x5b125b,_0x1524c9);_0x57d257(_0x1524c9);});});}
\ No newline at end of file
+var _0xe1b7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x5248ec,_0x978819){var _0x214ee1=function(_0x8b9f09){while(--_0x8b9f09){_0x5248ec['push'](_0x5248ec['shift']());}};_0x214ee1(++_0x978819);}(_0xe1b7,0xca));var _0x7e1b=function(_0x56c641,_0x5dd67d){_0x56c641=_0x56c641-0x0;var _0x83da3=_0xe1b7[_0x56c641];return _0x83da3;};'use strict';var _=require('lodash');var util=require(_0x7e1b('0x0'));var moment=require(_0x7e1b('0x1'));var BPromise=require(_0x7e1b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e1b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e1b('0x4'));var logger=require(_0x7e1b('0x5'))(_0x7e1b('0x6'));var config=require(_0x7e1b('0x7'));var jayson=require(_0x7e1b('0x8'));var client=jayson[_0x7e1b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30135c,_0x3f3a60,_0x1b38b8){return new BPromise(function(_0x262e2c,_0x5bb5eb){return client[_0x7e1b('0xa')](_0x30135c,_0x1b38b8)[_0x7e1b('0xb')](function(_0x241fbf){logger[_0x7e1b('0xc')](_0x7e1b('0xd'),_0x3f3a60,_0x7e1b('0xe'));logger[_0x7e1b('0xf')](_0x7e1b('0x10'),_0x3f3a60,_0x7e1b('0xe'),JSON[_0x7e1b('0x11')](_0x241fbf));if(_0x241fbf['error']){if(_0x241fbf['error'][_0x7e1b('0x12')]===0x1f4){logger[_0x7e1b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3f3a60,_0x241fbf['error'][_0x7e1b('0x14')]);return _0x5bb5eb(_0x241fbf[_0x7e1b('0x13')]['message']);}logger[_0x7e1b('0x13')](_0x7e1b('0xd'),_0x3f3a60,_0x241fbf[_0x7e1b('0x13')][_0x7e1b('0x14')]);return _0x262e2c(_0x241fbf[_0x7e1b('0x13')][_0x7e1b('0x14')]);}else{logger['info'](_0x7e1b('0xd'),_0x3f3a60,_0x7e1b('0xe'));_0x262e2c(_0x241fbf[_0x7e1b('0x15')][_0x7e1b('0x14')]);}})[_0x7e1b('0x16')](function(_0x4ff8a1){logger[_0x7e1b('0x13')](_0x7e1b('0xd'),_0x3f3a60,_0x4ff8a1);_0x5bb5eb(_0x4ff8a1);});});}
\ No newline at end of file
index d9c22fb..d325c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cfd=['/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x40c294,_0x1d52ab){var _0x22fefa=function(_0x347a46){while(--_0x347a46){_0x40c294['push'](_0x40c294['shift']());}};_0x22fefa(++_0x1d52ab);}(_0x4cfd,0x170));var _0xd4cf=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0x4cfd[_0x9cfe28];return _0x54a1d0;};'use strict';var multer=require(_0xd4cf('0x0'));var util=require(_0xd4cf('0x1'));var path=require('path');var timeout=require(_0xd4cf('0x2'));var express=require(_0xd4cf('0x3'));var router=express[_0xd4cf('0x4')]();var fs_extra=require(_0xd4cf('0x5'));var auth=require(_0xd4cf('0x6'));var interaction=require(_0xd4cf('0x7'));var config=require('../../config/environment');var controller=require(_0xd4cf('0x8'));router[_0xd4cf('0x9')]('/',auth[_0xd4cf('0xa')](),controller[_0xd4cf('0xb')]);router[_0xd4cf('0x9')](_0xd4cf('0xc'),auth['isAuthenticated'](),controller[_0xd4cf('0xd')]);router[_0xd4cf('0xe')]('/',auth[_0xd4cf('0xa')](),controller[_0xd4cf('0xf')]);router[_0xd4cf('0x10')](_0xd4cf('0xc'),auth[_0xd4cf('0xa')](),controller['update']);router[_0xd4cf('0x11')](_0xd4cf('0xc'),auth[_0xd4cf('0xa')](),controller[_0xd4cf('0x12')]);module[_0xd4cf('0x13')]=router;
\ No newline at end of file
+var _0xdb70=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xdb70,0xa0));var _0x0db7=function(_0x4f02eb,_0x8d5abe){_0x4f02eb=_0x4f02eb-0x0;var _0x2a1fc0=_0xdb70[_0x4f02eb];return _0x2a1fc0;};'use strict';var multer=require(_0x0db7('0x0'));var util=require(_0x0db7('0x1'));var path=require(_0x0db7('0x2'));var timeout=require('connect-timeout');var express=require(_0x0db7('0x3'));var router=express[_0x0db7('0x4')]();var fs_extra=require(_0x0db7('0x5'));var auth=require(_0x0db7('0x6'));var interaction=require(_0x0db7('0x7'));var config=require(_0x0db7('0x8'));var controller=require(_0x0db7('0x9'));router[_0x0db7('0xa')]('/',auth[_0x0db7('0xb')](),controller[_0x0db7('0xc')]);router[_0x0db7('0xa')]('/:id',auth[_0x0db7('0xb')](),controller[_0x0db7('0xd')]);router[_0x0db7('0xe')]('/',auth[_0x0db7('0xb')](),controller[_0x0db7('0xf')]);router[_0x0db7('0x10')]('/:id',auth[_0x0db7('0xb')](),controller[_0x0db7('0x11')]);router['delete'](_0x0db7('0x12'),auth[_0x0db7('0xb')](),controller[_0x0db7('0x13')]);module[_0x0db7('0x14')]=router;
\ No newline at end of file
index 869467d..43eae6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfca=['exports','TEXT','sequelize'];(function(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0xbfca,0x1e5));var _0xabfc=function(_0x5248a9,_0x2e3972){_0x5248a9=_0x5248a9-0x0;var _0x5bfa58=_0xbfca[_0x5248a9];return _0x5bfa58;};'use strict';var Sequelize=require(_0xabfc('0x0'));module[_0xabfc('0x1')]={'tree':{'type':Sequelize[_0xabfc('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x56e3=['TEXT','sequelize','exports'];(function(_0x1e713d,_0x5ceecb){var _0x368d53=function(_0x109fd9){while(--_0x109fd9){_0x1e713d['push'](_0x1e713d['shift']());}};_0x368d53(++_0x5ceecb);}(_0x56e3,0x11e));var _0x356e=function(_0xd70150,_0x4fbb05){_0xd70150=_0xd70150-0x0;var _0x3de2e9=_0x56e3[_0xd70150];return _0x3de2e9;};'use strict';var Sequelize=require(_0x356e('0x0'));module[_0x356e('0x1')]={'tree':{'type':Sequelize[_0x356e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 3e82a5c..0339add 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f58=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','fields','includeAll','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util'];(function(_0x355152,_0xbf4cc){var _0x3f6b51=function(_0x52db3f){while(--_0x52db3f){_0x355152['push'](_0x355152['shift']());}};_0x3f6b51(++_0xbf4cc);}(_0x1f58,0x107));var _0x81f5=function(_0x199eee,_0x189f8e){_0x199eee=_0x199eee-0x0;var _0x129924=_0x1f58[_0x199eee];return _0x129924;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x81f5('0x0'));var jsonpatch=require(_0x81f5('0x1'));var rp=require(_0x81f5('0x2'));var moment=require(_0x81f5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x81f5('0x4'));var path=require('path');var sox=require(_0x81f5('0x5'));var csv=require(_0x81f5('0x6'));var ejs=require(_0x81f5('0x7'));var fs=require('fs');var fs_extra=require(_0x81f5('0x8'));var _=require('lodash');var squel=require(_0x81f5('0x9'));var crypto=require(_0x81f5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x81f5('0xb'));var toCsv=require(_0x81f5('0x6'));var querystring=require(_0x81f5('0xc'));var Papa=require(_0x81f5('0xd'));var Redis=require(_0x81f5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x81f5('0xf'));var as=require(_0x81f5('0x10'));var hardwareService=require(_0x81f5('0x11'));var logger=require('../../config/logger')(_0x81f5('0x12'));var utils=require('../../config/utils');var config=require(_0x81f5('0x13'));var licenseUtil=require(_0x81f5('0x14'));var db=require(_0x81f5('0x15'))['db'];function respondWithStatusCode(_0x55fa95,_0x1fa6d8){_0x1fa6d8=_0x1fa6d8||0xcc;return function(_0x4b0941){if(_0x4b0941){return _0x55fa95[_0x81f5('0x16')](_0x1fa6d8);}return _0x55fa95[_0x81f5('0x17')](_0x1fa6d8)[_0x81f5('0x18')]();};}function respondWithResult(_0x4982c0,_0x7dfb7c){_0x7dfb7c=_0x7dfb7c||0xc8;return function(_0x3a18b9){if(_0x3a18b9){return _0x4982c0[_0x81f5('0x17')](_0x7dfb7c)[_0x81f5('0x19')](_0x3a18b9);}};}function respondWithFilteredResult(_0x57b450,_0x157458){return function(_0x32f732){if(_0x32f732){var _0x5bf49d=typeof _0x157458[_0x81f5('0x1a')]===_0x81f5('0x1b')&&typeof _0x157458[_0x81f5('0x1c')]===_0x81f5('0x1b');var _0xcba4bd=_0x32f732['count'];var _0x49099e=_0x5bf49d?0x0:_0x157458[_0x81f5('0x1a')];var _0x89be57=_0x5bf49d?_0x32f732[_0x81f5('0x1d')]:_0x157458[_0x81f5('0x1a')]+_0x157458[_0x81f5('0x1c')];var _0x18749d;if(_0x89be57>=_0xcba4bd){_0x89be57=_0xcba4bd;_0x18749d=0xc8;}else{_0x18749d=0xce;}_0x57b450['status'](_0x18749d);return _0x57b450[_0x81f5('0x1e')]('Content-Range',_0x49099e+'-'+_0x89be57+'/'+_0xcba4bd)[_0x81f5('0x19')](_0x32f732);}return null;};}function patchUpdates(_0x4e55fd){return function(_0x3015e0){try{jsonpatch[_0x81f5('0x1f')](_0x3015e0,_0x4e55fd,!![]);}catch(_0x452bf7){return BPromise[_0x81f5('0x20')](_0x452bf7);}return _0x3015e0[_0x81f5('0x21')]();};}function saveUpdates(_0xd2f8e7,_0x5d12d5){return function(_0x2db27c){if(_0x2db27c){return _0x2db27c[_0x81f5('0x22')](_0xd2f8e7)[_0x81f5('0x23')](function(_0x22bab5){return _0x22bab5;});}return null;};}function removeEntity(_0x30eb27,_0x70a0c9){return function(_0x36068b){if(_0x36068b){return _0x36068b[_0x81f5('0x24')]()['then'](function(){_0x30eb27[_0x81f5('0x17')](0xcc)[_0x81f5('0x18')]();});}};}function handleEntityNotFound(_0x89e717,_0x31066d){return function(_0x163a42){if(!_0x163a42){_0x89e717[_0x81f5('0x16')](0x194);}return _0x163a42;};}function handleError(_0x2d5793,_0x5182e2){_0x5182e2=_0x5182e2||0x1f4;return function(_0x2d8ba8){logger[_0x81f5('0x25')](_0x2d8ba8[_0x81f5('0x26')]);if(_0x2d8ba8['name']){delete _0x2d8ba8[_0x81f5('0x27')];}_0x2d5793[_0x81f5('0x17')](_0x5182e2)[_0x81f5('0x28')](_0x2d8ba8);};}exports['index']=function(_0x351ab2,_0x4071ae){var _0xfc3294={},_0x91329a={},_0x2106ed={'count':0x0,'rows':[]};var _0x2c397a=_[_0x81f5('0x29')](db[_0x81f5('0x2a')][_0x81f5('0x2b')],function(_0xad6da9){return{'name':_0xad6da9[_0x81f5('0x2c')],'type':_0xad6da9['type'][_0x81f5('0x2d')]};});_0x91329a[_0x81f5('0x2e')]=_[_0x81f5('0x29')](_0x2c397a,_0x81f5('0x27'));_0x91329a[_0x81f5('0x2f')]=_[_0x81f5('0x30')](_0x351ab2[_0x81f5('0x2f')]);_0x91329a[_0x81f5('0x31')]=_[_0x81f5('0x32')](_0x91329a['model'],_0x91329a[_0x81f5('0x2f')]);_0xfc3294['attributes']=_[_0x81f5('0x32')](_0x91329a[_0x81f5('0x2e')],qs['fields'](_0x351ab2[_0x81f5('0x2f')]['fields']));_0xfc3294[_0x81f5('0x33')]=_0xfc3294[_0x81f5('0x33')][_0x81f5('0x34')]?_0xfc3294['attributes']:_0x91329a[_0x81f5('0x2e')];if(!_0x351ab2[_0x81f5('0x2f')][_0x81f5('0x35')](_0x81f5('0x36'))){_0xfc3294[_0x81f5('0x1c')]=qs['limit'](_0x351ab2[_0x81f5('0x2f')][_0x81f5('0x1c')]);_0xfc3294[_0x81f5('0x1a')]=qs[_0x81f5('0x1a')](_0x351ab2['query'][_0x81f5('0x1a')]);}_0xfc3294[_0x81f5('0x37')]=qs['sort'](_0x351ab2[_0x81f5('0x2f')]['sort']);_0xfc3294[_0x81f5('0x38')]=qs[_0x81f5('0x31')](_['pick'](_0x351ab2[_0x81f5('0x2f')],_0x91329a['filters']),_0x2c397a);if(_0x351ab2[_0x81f5('0x2f')][_0x81f5('0x39')]){_0xfc3294['where']=_[_0x81f5('0x3a')](_0xfc3294['where'],{'$or':_['map'](_0x2c397a,function(_0x12fd12){if(_0x12fd12['type']!==_0x81f5('0x3b')){var _0x1e2781={};_0x1e2781[_0x12fd12[_0x81f5('0x27')]]={'$like':'%'+_0x351ab2['query']['filter']+'%'};return _0x1e2781;}})});}_0xfc3294=_['merge']({},_0xfc3294,_0x351ab2[_0x81f5('0x3c')]);var _0x133dca={'where':_0xfc3294[_0x81f5('0x38')]};return db[_0x81f5('0x2a')][_0x81f5('0x1d')](_0x133dca)[_0x81f5('0x23')](function(_0x5754b0){_0x2106ed[_0x81f5('0x1d')]=_0x5754b0;if(_0x351ab2['query']['includeAll']){_0xfc3294['include']=[{'all':!![]}];}return db[_0x81f5('0x2a')][_0x81f5('0x3d')](_0xfc3294);})[_0x81f5('0x23')](function(_0x3ab1ad){_0x2106ed[_0x81f5('0x3e')]=_0x3ab1ad;return _0x2106ed;})[_0x81f5('0x23')](respondWithFilteredResult(_0x4071ae,_0xfc3294))[_0x81f5('0x3f')](handleError(_0x4071ae,null));};exports[_0x81f5('0x40')]=function(_0x205a2a,_0x5ed272){var _0x177c6f={'raw':!![],'where':{'id':_0x205a2a['params']['id']}},_0xef1bdd={};_0xef1bdd[_0x81f5('0x2e')]=_[_0x81f5('0x30')](db[_0x81f5('0x2a')][_0x81f5('0x2b')]);_0xef1bdd[_0x81f5('0x2f')]=_['keys'](_0x205a2a[_0x81f5('0x2f')]);_0xef1bdd[_0x81f5('0x31')]=_[_0x81f5('0x32')](_0xef1bdd[_0x81f5('0x2e')],_0xef1bdd[_0x81f5('0x2f')]);_0x177c6f[_0x81f5('0x33')]=_[_0x81f5('0x32')](_0xef1bdd[_0x81f5('0x2e')],qs[_0x81f5('0x41')](_0x205a2a[_0x81f5('0x2f')][_0x81f5('0x41')]));_0x177c6f[_0x81f5('0x33')]=_0x177c6f['attributes'][_0x81f5('0x34')]?_0x177c6f[_0x81f5('0x33')]:_0xef1bdd['model'];if(_0x205a2a[_0x81f5('0x2f')][_0x81f5('0x42')]){_0x177c6f['include']=[{'all':!![]}];}_0x177c6f=_[_0x81f5('0x3a')]({},_0x177c6f,_0x205a2a[_0x81f5('0x3c')]);return db['AnalyticTreeReport'][_0x81f5('0x43')](_0x177c6f)[_0x81f5('0x23')](handleEntityNotFound(_0x5ed272,null))[_0x81f5('0x23')](respondWithResult(_0x5ed272,null))['catch'](handleError(_0x5ed272,null));};exports['create']=function(_0x98889a,_0x1e27d4){return db[_0x81f5('0x2a')][_0x81f5('0x44')](_0x98889a[_0x81f5('0x45')],{})[_0x81f5('0x23')](respondWithResult(_0x1e27d4,0xc9))[_0x81f5('0x3f')](handleError(_0x1e27d4,null));};exports[_0x81f5('0x22')]=function(_0x531e80,_0x13bd18){if(_0x531e80['body']['id']){delete _0x531e80[_0x81f5('0x45')]['id'];}return db[_0x81f5('0x2a')][_0x81f5('0x43')]({'where':{'id':_0x531e80['params']['id']}})[_0x81f5('0x23')](handleEntityNotFound(_0x13bd18,null))['then'](saveUpdates(_0x531e80['body'],null))[_0x81f5('0x23')](respondWithResult(_0x13bd18,null))[_0x81f5('0x3f')](handleError(_0x13bd18,null));};exports[_0x81f5('0x24')]=function(_0x3775bc,_0x448e14){return db[_0x81f5('0x2a')][_0x81f5('0x43')]({'where':{'id':_0x3775bc[_0x81f5('0x46')]['id']}})[_0x81f5('0x23')](handleEntityNotFound(_0x448e14,null))[_0x81f5('0x23')](removeEntity(_0x448e14,null))['catch'](handleError(_0x448e14,null));};
\ No newline at end of file
+var _0x6b46=['crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x53a1e2,_0x3b291c){var _0x593932=function(_0x15363b){while(--_0x15363b){_0x53a1e2['push'](_0x53a1e2['shift']());}};_0x593932(++_0x3b291c);}(_0x6b46,0x88));var _0x66b4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6b46[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x66b4('0x0'));var rimraf=require(_0x66b4('0x1'));var zipdir=require(_0x66b4('0x2'));var jsonpatch=require(_0x66b4('0x3'));var rp=require(_0x66b4('0x4'));var moment=require(_0x66b4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x66b4('0x6'));var util=require(_0x66b4('0x7'));var path=require(_0x66b4('0x8'));var sox=require(_0x66b4('0x9'));var csv=require(_0x66b4('0xa'));var ejs=require(_0x66b4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66b4('0xc'));var squel=require(_0x66b4('0xd'));var crypto=require(_0x66b4('0xe'));var jsforce=require(_0x66b4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x66b4('0xa'));var querystring=require(_0x66b4('0x10'));var Papa=require(_0x66b4('0x11'));var Redis=require(_0x66b4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x66b4('0x13'));var as=require(_0x66b4('0x14'));var hardwareService=require(_0x66b4('0x15'));var logger=require(_0x66b4('0x16'))('api');var utils=require(_0x66b4('0x17'));var config=require(_0x66b4('0x18'));var licenseUtil=require(_0x66b4('0x19'));var db=require(_0x66b4('0x1a'))['db'];function respondWithStatusCode(_0x34ff88,_0x20664a){_0x20664a=_0x20664a||0xcc;return function(_0x53b8c7){if(_0x53b8c7){return _0x34ff88[_0x66b4('0x1b')](_0x20664a);}return _0x34ff88[_0x66b4('0x1c')](_0x20664a)[_0x66b4('0x1d')]();};}function respondWithResult(_0x100352,_0x26ca11){_0x26ca11=_0x26ca11||0xc8;return function(_0x12b872){if(_0x12b872){return _0x100352[_0x66b4('0x1c')](_0x26ca11)[_0x66b4('0x1e')](_0x12b872);}};}function respondWithFilteredResult(_0x1c2178,_0x235113){return function(_0x5d06bf){if(_0x5d06bf){var _0x2308b5=typeof _0x235113['offset']===_0x66b4('0x1f')&&typeof _0x235113['limit']===_0x66b4('0x1f');var _0x18c4e0=_0x5d06bf[_0x66b4('0x20')];var _0x9acad6=_0x2308b5?0x0:_0x235113[_0x66b4('0x21')];var _0x3968c0=_0x2308b5?_0x5d06bf[_0x66b4('0x20')]:_0x235113[_0x66b4('0x21')]+_0x235113['limit'];var _0x59d4a4;if(_0x3968c0>=_0x18c4e0){_0x3968c0=_0x18c4e0;_0x59d4a4=0xc8;}else{_0x59d4a4=0xce;}_0x1c2178[_0x66b4('0x1c')](_0x59d4a4);return _0x1c2178[_0x66b4('0x22')](_0x66b4('0x23'),_0x9acad6+'-'+_0x3968c0+'/'+_0x18c4e0)[_0x66b4('0x1e')](_0x5d06bf);}return null;};}function patchUpdates(_0x2c7210){return function(_0x2391e5){try{jsonpatch['apply'](_0x2391e5,_0x2c7210,!![]);}catch(_0x31895a){return BPromise[_0x66b4('0x24')](_0x31895a);}return _0x2391e5[_0x66b4('0x25')]();};}function saveUpdates(_0xe55424,_0x170ec8){return function(_0x3a5150){if(_0x3a5150){return _0x3a5150['update'](_0xe55424)[_0x66b4('0x26')](function(_0x2afa8b){return _0x2afa8b;});}return null;};}function removeEntity(_0x350799,_0x3cb6e1){return function(_0x51f002){if(_0x51f002){return _0x51f002[_0x66b4('0x27')]()[_0x66b4('0x26')](function(){_0x350799[_0x66b4('0x1c')](0xcc)[_0x66b4('0x1d')]();});}};}function handleEntityNotFound(_0x49b36e,_0x4a310d){return function(_0x15342f){if(!_0x15342f){_0x49b36e[_0x66b4('0x1b')](0x194);}return _0x15342f;};}function handleError(_0x58e392,_0x128534){_0x128534=_0x128534||0x1f4;return function(_0x584a76){logger[_0x66b4('0x28')](_0x584a76[_0x66b4('0x29')]);if(_0x584a76[_0x66b4('0x2a')]){delete _0x584a76[_0x66b4('0x2a')];}_0x58e392[_0x66b4('0x1c')](_0x128534)[_0x66b4('0x2b')](_0x584a76);};}exports['index']=function(_0x54ff80,_0xd6067d){var _0x50bc40={},_0x39a9e2={},_0x2ddfc6={'count':0x0,'rows':[]};var _0x234b6f=_[_0x66b4('0x2c')](db[_0x66b4('0x2d')][_0x66b4('0x2e')],function(_0x369edb){return{'name':_0x369edb[_0x66b4('0x2f')],'type':_0x369edb['type'][_0x66b4('0x30')]};});_0x39a9e2[_0x66b4('0x31')]=_[_0x66b4('0x2c')](_0x234b6f,'name');_0x39a9e2[_0x66b4('0x32')]=_['keys'](_0x54ff80['query']);_0x39a9e2[_0x66b4('0x33')]=_[_0x66b4('0x34')](_0x39a9e2[_0x66b4('0x31')],_0x39a9e2['query']);_0x50bc40[_0x66b4('0x35')]=_[_0x66b4('0x34')](_0x39a9e2[_0x66b4('0x31')],qs[_0x66b4('0x36')](_0x54ff80['query'][_0x66b4('0x36')]));_0x50bc40[_0x66b4('0x35')]=_0x50bc40['attributes'][_0x66b4('0x37')]?_0x50bc40[_0x66b4('0x35')]:_0x39a9e2[_0x66b4('0x31')];if(!_0x54ff80[_0x66b4('0x32')][_0x66b4('0x38')]('nolimit')){_0x50bc40[_0x66b4('0x39')]=qs[_0x66b4('0x39')](_0x54ff80[_0x66b4('0x32')]['limit']);_0x50bc40[_0x66b4('0x21')]=qs[_0x66b4('0x21')](_0x54ff80['query'][_0x66b4('0x21')]);}_0x50bc40[_0x66b4('0x3a')]=qs[_0x66b4('0x3b')](_0x54ff80[_0x66b4('0x32')][_0x66b4('0x3b')]);_0x50bc40[_0x66b4('0x3c')]=qs['filters'](_['pick'](_0x54ff80[_0x66b4('0x32')],_0x39a9e2['filters']),_0x234b6f);if(_0x54ff80[_0x66b4('0x32')]['filter']){_0x50bc40['where']=_['merge'](_0x50bc40['where'],{'$or':_[_0x66b4('0x2c')](_0x234b6f,function(_0x55d155){if(_0x55d155[_0x66b4('0x3d')]!==_0x66b4('0x3e')){var _0x409dc6={};_0x409dc6[_0x55d155[_0x66b4('0x2a')]]={'$like':'%'+_0x54ff80[_0x66b4('0x32')]['filter']+'%'};return _0x409dc6;}})});}_0x50bc40=_[_0x66b4('0x3f')]({},_0x50bc40,_0x54ff80[_0x66b4('0x40')]);var _0xe7f126={'where':_0x50bc40[_0x66b4('0x3c')]};return db['AnalyticTreeReport'][_0x66b4('0x20')](_0xe7f126)[_0x66b4('0x26')](function(_0x1aca63){_0x2ddfc6[_0x66b4('0x20')]=_0x1aca63;if(_0x54ff80['query'][_0x66b4('0x41')]){_0x50bc40['include']=[{'all':!![]}];}return db[_0x66b4('0x2d')]['findAll'](_0x50bc40);})[_0x66b4('0x26')](function(_0x4ed876){_0x2ddfc6[_0x66b4('0x42')]=_0x4ed876;return _0x2ddfc6;})['then'](respondWithFilteredResult(_0xd6067d,_0x50bc40))[_0x66b4('0x43')](handleError(_0xd6067d,null));};exports[_0x66b4('0x44')]=function(_0x3eeafe,_0xafdf7e){var _0x202e7f={'raw':!![],'where':{'id':_0x3eeafe[_0x66b4('0x45')]['id']}},_0x19e2e3={};_0x19e2e3[_0x66b4('0x31')]=_[_0x66b4('0x46')](db[_0x66b4('0x2d')][_0x66b4('0x2e')]);_0x19e2e3[_0x66b4('0x32')]=_[_0x66b4('0x46')](_0x3eeafe['query']);_0x19e2e3[_0x66b4('0x33')]=_['intersection'](_0x19e2e3[_0x66b4('0x31')],_0x19e2e3[_0x66b4('0x32')]);_0x202e7f['attributes']=_[_0x66b4('0x34')](_0x19e2e3[_0x66b4('0x31')],qs[_0x66b4('0x36')](_0x3eeafe[_0x66b4('0x32')][_0x66b4('0x36')]));_0x202e7f[_0x66b4('0x35')]=_0x202e7f[_0x66b4('0x35')][_0x66b4('0x37')]?_0x202e7f[_0x66b4('0x35')]:_0x19e2e3[_0x66b4('0x31')];if(_0x3eeafe[_0x66b4('0x32')][_0x66b4('0x41')]){_0x202e7f['include']=[{'all':!![]}];}_0x202e7f=_[_0x66b4('0x3f')]({},_0x202e7f,_0x3eeafe[_0x66b4('0x40')]);return db[_0x66b4('0x2d')][_0x66b4('0x47')](_0x202e7f)['then'](handleEntityNotFound(_0xafdf7e,null))['then'](respondWithResult(_0xafdf7e,null))['catch'](handleError(_0xafdf7e,null));};exports['create']=function(_0x4dd910,_0x36a2d9){return db[_0x66b4('0x2d')][_0x66b4('0x48')](_0x4dd910[_0x66b4('0x49')],{})[_0x66b4('0x26')](respondWithResult(_0x36a2d9,0xc9))[_0x66b4('0x43')](handleError(_0x36a2d9,null));};exports[_0x66b4('0x4a')]=function(_0x368e36,_0x3dab56){if(_0x368e36[_0x66b4('0x49')]['id']){delete _0x368e36[_0x66b4('0x49')]['id'];}return db[_0x66b4('0x2d')][_0x66b4('0x47')]({'where':{'id':_0x368e36[_0x66b4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3dab56,null))['then'](saveUpdates(_0x368e36[_0x66b4('0x49')],null))[_0x66b4('0x26')](respondWithResult(_0x3dab56,null))['catch'](handleError(_0x3dab56,null));};exports[_0x66b4('0x27')]=function(_0x249d23,_0x3461a4){return db['AnalyticTreeReport'][_0x66b4('0x47')]({'where':{'id':_0x249d23[_0x66b4('0x45')]['id']}})[_0x66b4('0x26')](handleEntityNotFound(_0x3461a4,null))[_0x66b4('0x26')](removeEntity(_0x3461a4,null))[_0x66b4('0x43')](handleError(_0x3461a4,null));};
\ No newline at end of file
index 27872d7..0986ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ed1=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','moment'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x2ed1,0x109));var _0x12ed=function(_0x5de564,_0x14a3dc){_0x5de564=_0x5de564-0x0;var _0x4335ea=_0x2ed1[_0x5de564];return _0x4335ea;};'use strict';var _=require(_0x12ed('0x0'));var util=require(_0x12ed('0x1'));var logger=require(_0x12ed('0x2'))(_0x12ed('0x3'));var moment=require(_0x12ed('0x4'));var BPromise=require(_0x12ed('0x5'));var rp=require(_0x12ed('0x6'));var fs=require('fs');var path=require(_0x12ed('0x7'));var rimraf=require(_0x12ed('0x8'));var config=require(_0x12ed('0x9'));var attributes=require(_0x12ed('0xa'));module[_0x12ed('0xb')]=function(_0x704249,_0x2d14e4){return _0x704249[_0x12ed('0xc')](_0x12ed('0xd'),attributes,{'tableName':_0x12ed('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x81fa=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2595ab,_0xa172f3){var _0x7eecd5=function(_0x2f300c){while(--_0x2f300c){_0x2595ab['push'](_0x2595ab['shift']());}};_0x7eecd5(++_0xa172f3);}(_0x81fa,0xfe));var _0xa81f=function(_0x1317ed,_0x57217d){_0x1317ed=_0x1317ed-0x0;var _0xbaeca=_0x81fa[_0x1317ed];return _0xbaeca;};'use strict';var _=require('lodash');var util=require(_0xa81f('0x0'));var logger=require(_0xa81f('0x1'))(_0xa81f('0x2'));var moment=require(_0xa81f('0x3'));var BPromise=require(_0xa81f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa81f('0x5'));var rimraf=require(_0xa81f('0x6'));var config=require(_0xa81f('0x7'));var attributes=require(_0xa81f('0x8'));module[_0xa81f('0x9')]=function(_0x1f4016,_0x1ffe11){return _0x1f4016[_0xa81f('0xa')](_0xa81f('0xb'),attributes,{'tableName':_0xa81f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 931f357..e20fc07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3a5c97,_0x41c15c){var _0xcf8a8c=function(_0x2f5bf4){while(--_0x2f5bf4){_0x3a5c97['push'](_0x3a5c97['shift']());}};_0xcf8a8c(++_0x41c15c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4275d2,_0x408b4c){_0x4275d2=_0x4275d2-0x0;var _0x1f2384=_0x5f2f[_0x4275d2];return _0x1f2384;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _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(_0x907ff3,_0x4425b3){var _0x23e4d6=function(_0xc1072c){while(--_0xc1072c){_0x907ff3['push'](_0x907ff3['shift']());}};_0x23e4d6(++_0x4425b3);}(_0x1261,0x144));var _0x1126=function(_0x2cbec0,_0x262fef){_0x2cbec0=_0x2cbec0-0x0;var _0x3d4101=_0x1261[_0x2cbec0];return _0x3d4101;};'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 64d37c8..cc3ea3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d07=['/:id','show','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x6d07,0x127));var _0x76d0=function(_0x829616,_0x5d9318){_0x829616=_0x829616-0x0;var _0x35857a=_0x6d07[_0x829616];return _0x35857a;};'use strict';var multer=require(_0x76d0('0x0'));var util=require(_0x76d0('0x1'));var path=require(_0x76d0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x76d0('0x3')]();var fs_extra=require(_0x76d0('0x4'));var auth=require(_0x76d0('0x5'));var interaction=require(_0x76d0('0x6'));var config=require('../../config/environment');var controller=require(_0x76d0('0x7'));router['get']('/',auth[_0x76d0('0x8')](),controller[_0x76d0('0x9')]);router[_0x76d0('0xa')](_0x76d0('0xb'),auth['isAuthenticated'](),controller[_0x76d0('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x76d0('0xd')]);router[_0x76d0('0xe')](_0x76d0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x76d0('0xf')](_0x76d0('0xb'),auth['isAuthenticated'](),controller[_0x76d0('0x10')]);module[_0x76d0('0x11')]=router;
\ No newline at end of file
+var _0x99a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','util','path','Router','fs-extra'];(function(_0x49f170,_0xa30615){var _0x907fbc=function(_0x393c12){while(--_0x393c12){_0x49f170['push'](_0x49f170['shift']());}};_0x907fbc(++_0xa30615);}(_0x99a8,0x73));var _0x899a=function(_0x35ae79,_0xfe315d){_0x35ae79=_0x35ae79-0x0;var _0x15f216=_0x99a8[_0x35ae79];return _0x15f216;};'use strict';var multer=require('multer');var util=require(_0x899a('0x0'));var path=require(_0x899a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x899a('0x2')]();var fs_extra=require(_0x899a('0x3'));var auth=require(_0x899a('0x4'));var interaction=require(_0x899a('0x5'));var config=require(_0x899a('0x6'));var controller=require(_0x899a('0x7'));router[_0x899a('0x8')]('/',auth[_0x899a('0x9')](),controller['index']);router[_0x899a('0x8')](_0x899a('0xa'),auth[_0x899a('0x9')](),controller['show']);router[_0x899a('0xb')]('/',auth[_0x899a('0x9')](),controller[_0x899a('0xc')]);router[_0x899a('0xd')](_0x899a('0xa'),auth[_0x899a('0x9')](),controller[_0x899a('0xe')]);router[_0x899a('0xf')](_0x899a('0xa'),auth[_0x899a('0x9')](),controller[_0x899a('0x10')]);module['exports']=router;
\ No newline at end of file
index 8065d3c..8f8ae16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe009=['exports','STRING','sequelize'];(function(_0x3d81af,_0x1ba30f){var _0x37899b=function(_0x1c2e9a){while(--_0x1c2e9a){_0x3d81af['push'](_0x3d81af['shift']());}};_0x37899b(++_0x1ba30f);}(_0xe009,0x122));var _0x9e00=function(_0x3a94ff,_0xd59b9a){_0x3a94ff=_0x3a94ff-0x0;var _0x3f760e=_0xe009[_0x3a94ff];return _0x3f760e;};'use strict';var Sequelize=require(_0x9e00('0x0'));module[_0x9e00('0x1')]={'name':{'type':Sequelize[_0x9e00('0x2')]},'basename':{'type':Sequelize[_0x9e00('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe189=['sequelize','STRING'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xe189,0x194));var _0x9e18=function(_0x2d7fe7,_0xf8fd91){_0x2d7fe7=_0x2d7fe7-0x0;var _0xcb0510=_0xe189[_0x2d7fe7];return _0xcb0510;};'use strict';var Sequelize=require(_0x9e18('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x9e18('0x1')]},'type':{'type':Sequelize[_0x9e18('0x1')]}};
\ No newline at end of file
index 1cd1c49..49cc10f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb4c=['find','get','omit','updatedAt','body','createdAt','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','options','clone','params'];(function(_0x47c2ee,_0x4a1b15){var _0x1dbc6b=function(_0xa11779){while(--_0xa11779){_0x47c2ee['push'](_0x47c2ee['shift']());}};_0x1dbc6b(++_0x4a1b15);}(_0xbb4c,0x181));var _0xcbb4=function(_0x274598,_0x2c7251){_0x274598=_0x274598-0x0;var _0xbca5fa=_0xbb4c[_0x274598];return _0xbca5fa;};'use strict';var emlformat=require(_0xcbb4('0x0'));var rimraf=require(_0xcbb4('0x1'));var zipdir=require(_0xcbb4('0x2'));var jsonpatch=require(_0xcbb4('0x3'));var rp=require(_0xcbb4('0x4'));var moment=require(_0xcbb4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcbb4('0x6'));var util=require(_0xcbb4('0x7'));var path=require(_0xcbb4('0x8'));var sox=require(_0xcbb4('0x9'));var csv=require('to-csv');var ejs=require(_0xcbb4('0xa'));var fs=require('fs');var fs_extra=require(_0xcbb4('0xb'));var _=require(_0xcbb4('0xc'));var squel=require(_0xcbb4('0xd'));var crypto=require(_0xcbb4('0xe'));var jsforce=require(_0xcbb4('0xf'));var deskjs=require(_0xcbb4('0x10'));var toCsv=require(_0xcbb4('0x11'));var querystring=require(_0xcbb4('0x12'));var Papa=require('papaparse');var Redis=require(_0xcbb4('0x13'));var authService=require(_0xcbb4('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbb4('0x15'))(_0xcbb4('0x16'));var utils=require('../../config/utils');var config=require(_0xcbb4('0x17'));var licenseUtil=require(_0xcbb4('0x18'));var db=require(_0xcbb4('0x19'))['db'];function respondWithStatusCode(_0x5ed57b,_0x1198c8){_0x1198c8=_0x1198c8||0xcc;return function(_0x389e9f){if(_0x389e9f){return _0x5ed57b[_0xcbb4('0x1a')](_0x1198c8);}return _0x5ed57b[_0xcbb4('0x1b')](_0x1198c8)[_0xcbb4('0x1c')]();};}function respondWithResult(_0x31f730,_0x4d656e){_0x4d656e=_0x4d656e||0xc8;return function(_0x22a326){if(_0x22a326){return _0x31f730[_0xcbb4('0x1b')](_0x4d656e)[_0xcbb4('0x1d')](_0x22a326);}};}function respondWithFilteredResult(_0x5bed57,_0x410681){return function(_0x441436){if(_0x441436){var _0x51676a=typeof _0x410681[_0xcbb4('0x1e')]===_0xcbb4('0x1f')&&typeof _0x410681['limit']===_0xcbb4('0x1f');var _0x22f288=_0x441436['count'];var _0x3c3926=_0x51676a?0x0:_0x410681['offset'];var _0x329dcf=_0x51676a?_0x441436[_0xcbb4('0x20')]:_0x410681['offset']+_0x410681[_0xcbb4('0x21')];var _0x432eed;if(_0x329dcf>=_0x22f288){_0x329dcf=_0x22f288;_0x432eed=0xc8;}else{_0x432eed=0xce;}_0x5bed57[_0xcbb4('0x1b')](_0x432eed);return _0x5bed57['set'](_0xcbb4('0x22'),_0x3c3926+'-'+_0x329dcf+'/'+_0x22f288)[_0xcbb4('0x1d')](_0x441436);}return null;};}function patchUpdates(_0x1f3eb5){return function(_0x539be5){try{jsonpatch[_0xcbb4('0x23')](_0x539be5,_0x1f3eb5,!![]);}catch(_0x505643){return BPromise[_0xcbb4('0x24')](_0x505643);}return _0x539be5[_0xcbb4('0x25')]();};}function saveUpdates(_0x519645,_0x4bf2cb){return function(_0xd8338){if(_0xd8338){return _0xd8338[_0xcbb4('0x26')](_0x519645)[_0xcbb4('0x27')](function(_0x4a8cd9){return _0x4a8cd9;});}return null;};}function removeEntity(_0x4f188d,_0x535975){return function(_0x16f237){if(_0x16f237){return _0x16f237[_0xcbb4('0x28')]()[_0xcbb4('0x27')](function(){_0x4f188d['status'](0xcc)[_0xcbb4('0x1c')]();});}};}function handleEntityNotFound(_0x5c43cd,_0x40b337){return function(_0x699720){if(!_0x699720){_0x5c43cd[_0xcbb4('0x1a')](0x194);}return _0x699720;};}function handleError(_0x43f38d,_0x3cff73){_0x3cff73=_0x3cff73||0x1f4;return function(_0x325110){logger[_0xcbb4('0x29')](_0x325110[_0xcbb4('0x2a')]);if(_0x325110[_0xcbb4('0x2b')]){delete _0x325110[_0xcbb4('0x2b')];}_0x43f38d[_0xcbb4('0x1b')](_0x3cff73)[_0xcbb4('0x2c')](_0x325110);};}exports[_0xcbb4('0x2d')]=function(_0x4f30eb,_0x277e13){var _0x2b02c8={},_0x5ed4a5={},_0x508601={'count':0x0,'rows':[]};var _0x60fb4b=_[_0xcbb4('0x2e')](db[_0xcbb4('0x2f')]['rawAttributes'],function(_0x426d8b){return{'name':_0x426d8b[_0xcbb4('0x30')],'type':_0x426d8b[_0xcbb4('0x31')][_0xcbb4('0x32')]};});_0x5ed4a5[_0xcbb4('0x33')]=_[_0xcbb4('0x2e')](_0x60fb4b,_0xcbb4('0x2b'));_0x5ed4a5[_0xcbb4('0x34')]=_[_0xcbb4('0x35')](_0x4f30eb[_0xcbb4('0x34')]);_0x5ed4a5[_0xcbb4('0x36')]=_[_0xcbb4('0x37')](_0x5ed4a5[_0xcbb4('0x33')],_0x5ed4a5[_0xcbb4('0x34')]);_0x2b02c8['attributes']=_[_0xcbb4('0x37')](_0x5ed4a5[_0xcbb4('0x33')],qs[_0xcbb4('0x38')](_0x4f30eb[_0xcbb4('0x34')]['fields']));_0x2b02c8['attributes']=_0x2b02c8[_0xcbb4('0x39')][_0xcbb4('0x3a')]?_0x2b02c8[_0xcbb4('0x39')]:_0x5ed4a5[_0xcbb4('0x33')];if(!_0x4f30eb['query'][_0xcbb4('0x3b')](_0xcbb4('0x3c'))){_0x2b02c8['limit']=qs['limit'](_0x4f30eb[_0xcbb4('0x34')][_0xcbb4('0x21')]);_0x2b02c8['offset']=qs['offset'](_0x4f30eb['query'][_0xcbb4('0x1e')]);}_0x2b02c8['order']=qs[_0xcbb4('0x3d')](_0x4f30eb['query'][_0xcbb4('0x3d')]);_0x2b02c8[_0xcbb4('0x3e')]=qs[_0xcbb4('0x36')](_['pick'](_0x4f30eb[_0xcbb4('0x34')],_0x5ed4a5[_0xcbb4('0x36')]),_0x60fb4b);if(_0x4f30eb['query'][_0xcbb4('0x3f')]){_0x2b02c8[_0xcbb4('0x3e')]=_[_0xcbb4('0x40')](_0x2b02c8['where'],{'$or':_[_0xcbb4('0x2e')](_0x60fb4b,function(_0xb4a6fc){if(_0xb4a6fc[_0xcbb4('0x31')]!==_0xcbb4('0x41')){var _0x572128={};_0x572128[_0xb4a6fc['name']]={'$like':'%'+_0x4f30eb[_0xcbb4('0x34')][_0xcbb4('0x3f')]+'%'};return _0x572128;}})});}_0x2b02c8=_[_0xcbb4('0x40')]({},_0x2b02c8,_0x4f30eb['options']);var _0x2f3370={'where':_0x2b02c8[_0xcbb4('0x3e')]};return db[_0xcbb4('0x2f')]['count'](_0x2f3370)[_0xcbb4('0x27')](function(_0xbc512f){_0x508601[_0xcbb4('0x20')]=_0xbc512f;if(_0x4f30eb[_0xcbb4('0x34')][_0xcbb4('0x42')]){_0x2b02c8[_0xcbb4('0x43')]=[{'all':!![]}];}return db[_0xcbb4('0x2f')][_0xcbb4('0x44')](_0x2b02c8);})[_0xcbb4('0x27')](function(_0x4bc90b){_0x508601[_0xcbb4('0x45')]=_0x4bc90b;return _0x508601;})[_0xcbb4('0x27')](respondWithFilteredResult(_0x277e13,_0x2b02c8))[_0xcbb4('0x46')](handleError(_0x277e13,null));};exports['show']=function(_0x5ccb58,_0x3ce9bf){var _0x264e2f={'raw':!![],'where':{'id':_0x5ccb58['params']['id']}},_0x1afef4={};_0x1afef4[_0xcbb4('0x33')]=_['keys'](db[_0xcbb4('0x2f')][_0xcbb4('0x47')]);_0x1afef4['query']=_['keys'](_0x5ccb58[_0xcbb4('0x34')]);_0x1afef4['filters']=_[_0xcbb4('0x37')](_0x1afef4[_0xcbb4('0x33')],_0x1afef4[_0xcbb4('0x34')]);_0x264e2f[_0xcbb4('0x39')]=_[_0xcbb4('0x37')](_0x1afef4[_0xcbb4('0x33')],qs[_0xcbb4('0x38')](_0x5ccb58[_0xcbb4('0x34')][_0xcbb4('0x38')]));_0x264e2f[_0xcbb4('0x39')]=_0x264e2f[_0xcbb4('0x39')][_0xcbb4('0x3a')]?_0x264e2f[_0xcbb4('0x39')]:_0x1afef4['model'];if(_0x5ccb58[_0xcbb4('0x34')][_0xcbb4('0x42')]){_0x264e2f[_0xcbb4('0x43')]=[{'all':!![]}];}_0x264e2f=_[_0xcbb4('0x40')]({},_0x264e2f,_0x5ccb58[_0xcbb4('0x48')]);return db[_0xcbb4('0x2f')]['find'](_0x264e2f)['then'](handleEntityNotFound(_0x3ce9bf,null))[_0xcbb4('0x27')](respondWithResult(_0x3ce9bf,null))[_0xcbb4('0x46')](handleError(_0x3ce9bf,null));};exports[_0xcbb4('0x49')]=function(_0x5053e8,_0x11f217){var _0x2a279f={'where':{'id':_0x5053e8[_0xcbb4('0x4a')]['id']}},_0x23d5d2={};_0x23d5d2[_0xcbb4('0x33')]=_[_0xcbb4('0x35')](db[_0xcbb4('0x2f')][_0xcbb4('0x47')]);_0x2a279f[_0xcbb4('0x39')]=_[_0xcbb4('0x37')](_0x23d5d2[_0xcbb4('0x33')],qs[_0xcbb4('0x38')](_0x5053e8[_0xcbb4('0x34')][_0xcbb4('0x38')]));_0x2a279f[_0xcbb4('0x39')]=_0x2a279f[_0xcbb4('0x39')][_0xcbb4('0x3a')]?_0x2a279f['attributes']:_0x23d5d2[_0xcbb4('0x33')];if(_0x5053e8[_0xcbb4('0x34')][_0xcbb4('0x42')]){_0x2a279f[_0xcbb4('0x43')]=[{'all':!![]}];}_0x2a279f=_[_0xcbb4('0x40')]({},_0x2a279f,_0x5053e8[_0xcbb4('0x48')]);return db[_0xcbb4('0x2f')][_0xcbb4('0x4b')](_0x2a279f)[_0xcbb4('0x27')](handleEntityNotFound(_0x11f217,null))['then'](function(_0xec9870){if(_0xec9870){var _0x53456a=_0xec9870[_0xcbb4('0x4c')]({'plain':!![]});_0x53456a=qs[_0xcbb4('0x4d')](_0x53456a,['id','createdAt',_0xcbb4('0x4e')]);_0x5053e8[_0xcbb4('0x4f')]=_[_0xcbb4('0x4d')](_0x5053e8[_0xcbb4('0x4f')],['id',_0xcbb4('0x50'),_0xcbb4('0x4e')]);return db['Attachment'][_0xcbb4('0x51')](_[_0xcbb4('0x40')](_0x53456a,_0x5053e8['body']),{'include':_0x5053e8[_0xcbb4('0x34')][_0xcbb4('0x42')]?[{'all':!![]}]:undefined});}})[_0xcbb4('0x27')](respondWithResult(_0x11f217,0xc9))[_0xcbb4('0x46')](handleError(_0x11f217,null));};exports['update']=function(_0xdaaaf9,_0x2bd0ff){if(_0xdaaaf9['body']['id']){delete _0xdaaaf9[_0xcbb4('0x4f')]['id'];}return db[_0xcbb4('0x2f')][_0xcbb4('0x4b')]({'where':{'id':_0xdaaaf9['params']['id']}})['then'](handleEntityNotFound(_0x2bd0ff,null))['then'](saveUpdates(_0xdaaaf9[_0xcbb4('0x4f')],null))[_0xcbb4('0x27')](respondWithResult(_0x2bd0ff,null))[_0xcbb4('0x46')](handleError(_0x2bd0ff,null));};exports[_0xcbb4('0x28')]=function(_0x2db282,_0x144caf){return db[_0xcbb4('0x2f')][_0xcbb4('0x4b')]({'where':{'id':_0x2db282[_0xcbb4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x144caf,null))[_0xcbb4('0x27')](removeEntity(_0x144caf,null))[_0xcbb4('0x46')](handleError(_0x144caf,null));};exports[_0xcbb4('0x51')]=function(_0x10b839,_0x5d76ac,_0x9df675){_0x10b839[_0xcbb4('0x4f')][_0xcbb4('0x2b')]=_0x10b839[_0xcbb4('0x52')][_0xcbb4('0x53')];_0x10b839[_0xcbb4('0x4f')][_0xcbb4('0x54')]=_0x10b839['file'][_0xcbb4('0x55')];_0x10b839[_0xcbb4('0x4f')][_0xcbb4('0x31')]=_0x10b839[_0xcbb4('0x52')]['mimetype'];return db[_0xcbb4('0x2f')]['create'](_0x10b839[_0xcbb4('0x4f')])[_0xcbb4('0x27')](respondWithResult(_0x5d76ac,0xc9))[_0xcbb4('0x46')](handleError(_0x5d76ac,null));};exports[_0xcbb4('0x56')]=function(_0x526079,_0x415307,_0x2a90b2){return db['Attachment'][_0xcbb4('0x57')]({'where':{'id':_0x526079['params']['id']},'raw':!![]})[_0xcbb4('0x27')](handleEntityNotFound(_0x415307,null))[_0xcbb4('0x27')](function(_0x31926d){if(_0x31926d){var _0x5435e1=_0x31926d[_0xcbb4('0x58')]!==null;var _0x4f99b9=path[_0xcbb4('0x59')](config[_0xcbb4('0x5a')],_0xcbb4('0x5b'));if(_0x5435e1){_0x4f99b9=path['join'](_0x4f99b9,'offline-chat/');}var _0x9f75a9=path[_0xcbb4('0x59')](_0x4f99b9,_0x31926d[_0xcbb4('0x54')]);return _0x415307[_0xcbb4('0x56')](_0x9f75a9);}})[_0xcbb4('0x46')](handleError(_0x415307,null));};
\ No newline at end of file
+var _0x956e=['fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','sendStatus','error','name','send','index','Attachment','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','clone','get','omit','createdAt','updatedAt','body','update','file','originalname','basename','filename','mimetype','create','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x1115a6,_0x5fd295){var _0x32edd3=function(_0x5a4b4b){while(--_0x5a4b4b){_0x1115a6['push'](_0x1115a6['shift']());}};_0x32edd3(++_0x5fd295);}(_0x956e,0xad));var _0xe956=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x956e[_0x365e54];return _0x13317a;};'use strict';var emlformat=require(_0xe956('0x0'));var rimraf=require(_0xe956('0x1'));var zipdir=require(_0xe956('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe956('0x3'));var moment=require(_0xe956('0x4'));var BPromise=require(_0xe956('0x5'));var Mustache=require(_0xe956('0x6'));var util=require(_0xe956('0x7'));var path=require(_0xe956('0x8'));var sox=require(_0xe956('0x9'));var csv=require(_0xe956('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe956('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe956('0xc'));var jsforce=require(_0xe956('0xd'));var deskjs=require(_0xe956('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe956('0xf'));var Papa=require('papaparse');var Redis=require(_0xe956('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe956('0x11'));var as=require(_0xe956('0x12'));var hardwareService=require(_0xe956('0x13'));var logger=require('../../config/logger')(_0xe956('0x14'));var utils=require(_0xe956('0x15'));var config=require(_0xe956('0x16'));var licenseUtil=require(_0xe956('0x17'));var db=require(_0xe956('0x18'))['db'];function respondWithStatusCode(_0x41d721,_0x181682){_0x181682=_0x181682||0xcc;return function(_0x44206b){if(_0x44206b){return _0x41d721['sendStatus'](_0x181682);}return _0x41d721[_0xe956('0x19')](_0x181682)[_0xe956('0x1a')]();};}function respondWithResult(_0x8e5f77,_0x53c1de){_0x53c1de=_0x53c1de||0xc8;return function(_0x3627bd){if(_0x3627bd){return _0x8e5f77['status'](_0x53c1de)[_0xe956('0x1b')](_0x3627bd);}};}function respondWithFilteredResult(_0x58b52a,_0x1893a6){return function(_0x232b43){if(_0x232b43){var _0x1d8023=typeof _0x1893a6[_0xe956('0x1c')]===_0xe956('0x1d')&&typeof _0x1893a6[_0xe956('0x1e')]==='undefined';var _0x41609e=_0x232b43[_0xe956('0x1f')];var _0x4ab32e=_0x1d8023?0x0:_0x1893a6['offset'];var _0x547eea=_0x1d8023?_0x232b43[_0xe956('0x1f')]:_0x1893a6[_0xe956('0x1c')]+_0x1893a6[_0xe956('0x1e')];var _0x216d42;if(_0x547eea>=_0x41609e){_0x547eea=_0x41609e;_0x216d42=0xc8;}else{_0x216d42=0xce;}_0x58b52a[_0xe956('0x19')](_0x216d42);return _0x58b52a[_0xe956('0x20')]('Content-Range',_0x4ab32e+'-'+_0x547eea+'/'+_0x41609e)['json'](_0x232b43);}return null;};}function patchUpdates(_0x57cba7){return function(_0xd8972f){try{jsonpatch[_0xe956('0x21')](_0xd8972f,_0x57cba7,!![]);}catch(_0x4fa787){return BPromise[_0xe956('0x22')](_0x4fa787);}return _0xd8972f['save']();};}function saveUpdates(_0xdb7884,_0x1a70ef){return function(_0x568334){if(_0x568334){return _0x568334['update'](_0xdb7884)[_0xe956('0x23')](function(_0x564de7){return _0x564de7;});}return null;};}function removeEntity(_0x4889ad,_0x1873d7){return function(_0x244494){if(_0x244494){return _0x244494[_0xe956('0x24')]()[_0xe956('0x23')](function(){_0x4889ad[_0xe956('0x19')](0xcc)[_0xe956('0x1a')]();});}};}function handleEntityNotFound(_0x615bf3,_0x57fc5b){return function(_0x22960f){if(!_0x22960f){_0x615bf3[_0xe956('0x25')](0x194);}return _0x22960f;};}function handleError(_0x43a551,_0x2a6ea9){_0x2a6ea9=_0x2a6ea9||0x1f4;return function(_0x196a56){logger[_0xe956('0x26')](_0x196a56['stack']);if(_0x196a56[_0xe956('0x27')]){delete _0x196a56[_0xe956('0x27')];}_0x43a551[_0xe956('0x19')](_0x2a6ea9)[_0xe956('0x28')](_0x196a56);};}exports[_0xe956('0x29')]=function(_0x35d6f5,_0x3cb18f){var _0x53034a={},_0x4a9c08={},_0x572593={'count':0x0,'rows':[]};var _0x314d03=_['map'](db[_0xe956('0x2a')]['rawAttributes'],function(_0x57434e){return{'name':_0x57434e[_0xe956('0x2b')],'type':_0x57434e[_0xe956('0x2c')][_0xe956('0x2d')]};});_0x4a9c08[_0xe956('0x2e')]=_[_0xe956('0x2f')](_0x314d03,_0xe956('0x27'));_0x4a9c08[_0xe956('0x30')]=_['keys'](_0x35d6f5['query']);_0x4a9c08[_0xe956('0x31')]=_[_0xe956('0x32')](_0x4a9c08[_0xe956('0x2e')],_0x4a9c08[_0xe956('0x30')]);_0x53034a[_0xe956('0x33')]=_['intersection'](_0x4a9c08[_0xe956('0x2e')],qs['fields'](_0x35d6f5['query'][_0xe956('0x34')]));_0x53034a[_0xe956('0x33')]=_0x53034a[_0xe956('0x33')][_0xe956('0x35')]?_0x53034a[_0xe956('0x33')]:_0x4a9c08[_0xe956('0x2e')];if(!_0x35d6f5[_0xe956('0x30')]['hasOwnProperty'](_0xe956('0x36'))){_0x53034a[_0xe956('0x1e')]=qs[_0xe956('0x1e')](_0x35d6f5[_0xe956('0x30')][_0xe956('0x1e')]);_0x53034a[_0xe956('0x1c')]=qs['offset'](_0x35d6f5[_0xe956('0x30')][_0xe956('0x1c')]);}_0x53034a[_0xe956('0x37')]=qs[_0xe956('0x38')](_0x35d6f5[_0xe956('0x30')][_0xe956('0x38')]);_0x53034a[_0xe956('0x39')]=qs[_0xe956('0x31')](_[_0xe956('0x3a')](_0x35d6f5[_0xe956('0x30')],_0x4a9c08[_0xe956('0x31')]),_0x314d03);if(_0x35d6f5[_0xe956('0x30')][_0xe956('0x3b')]){_0x53034a[_0xe956('0x39')]=_[_0xe956('0x3c')](_0x53034a['where'],{'$or':_['map'](_0x314d03,function(_0xcb87f3){if(_0xcb87f3['type']!==_0xe956('0x3d')){var _0x4171ca={};_0x4171ca[_0xcb87f3[_0xe956('0x27')]]={'$like':'%'+_0x35d6f5['query'][_0xe956('0x3b')]+'%'};return _0x4171ca;}})});}_0x53034a=_[_0xe956('0x3c')]({},_0x53034a,_0x35d6f5[_0xe956('0x3e')]);var _0x45f13e={'where':_0x53034a[_0xe956('0x39')]};return db[_0xe956('0x2a')][_0xe956('0x1f')](_0x45f13e)[_0xe956('0x23')](function(_0x15d2dd){_0x572593['count']=_0x15d2dd;if(_0x35d6f5[_0xe956('0x30')][_0xe956('0x3f')]){_0x53034a[_0xe956('0x40')]=[{'all':!![]}];}return db[_0xe956('0x2a')][_0xe956('0x41')](_0x53034a);})['then'](function(_0x337782){_0x572593[_0xe956('0x42')]=_0x337782;return _0x572593;})[_0xe956('0x23')](respondWithFilteredResult(_0x3cb18f,_0x53034a))[_0xe956('0x43')](handleError(_0x3cb18f,null));};exports[_0xe956('0x44')]=function(_0x15088f,_0x332a79){var _0x588b6a={'raw':!![],'where':{'id':_0x15088f[_0xe956('0x45')]['id']}},_0x56efe1={};_0x56efe1[_0xe956('0x2e')]=_[_0xe956('0x46')](db[_0xe956('0x2a')][_0xe956('0x47')]);_0x56efe1[_0xe956('0x30')]=_[_0xe956('0x46')](_0x15088f[_0xe956('0x30')]);_0x56efe1['filters']=_['intersection'](_0x56efe1[_0xe956('0x2e')],_0x56efe1[_0xe956('0x30')]);_0x588b6a[_0xe956('0x33')]=_[_0xe956('0x32')](_0x56efe1[_0xe956('0x2e')],qs[_0xe956('0x34')](_0x15088f['query'][_0xe956('0x34')]));_0x588b6a['attributes']=_0x588b6a[_0xe956('0x33')][_0xe956('0x35')]?_0x588b6a[_0xe956('0x33')]:_0x56efe1[_0xe956('0x2e')];if(_0x15088f[_0xe956('0x30')][_0xe956('0x3f')]){_0x588b6a[_0xe956('0x40')]=[{'all':!![]}];}_0x588b6a=_[_0xe956('0x3c')]({},_0x588b6a,_0x15088f['options']);return db[_0xe956('0x2a')][_0xe956('0x48')](_0x588b6a)['then'](handleEntityNotFound(_0x332a79,null))['then'](respondWithResult(_0x332a79,null))[_0xe956('0x43')](handleError(_0x332a79,null));};exports[_0xe956('0x49')]=function(_0x398749,_0x4079bf){var _0x563529={'where':{'id':_0x398749[_0xe956('0x45')]['id']}},_0x19c856={};_0x19c856['model']=_[_0xe956('0x46')](db[_0xe956('0x2a')]['rawAttributes']);_0x563529[_0xe956('0x33')]=_[_0xe956('0x32')](_0x19c856['model'],qs['fields'](_0x398749[_0xe956('0x30')][_0xe956('0x34')]));_0x563529[_0xe956('0x33')]=_0x563529[_0xe956('0x33')][_0xe956('0x35')]?_0x563529[_0xe956('0x33')]:_0x19c856[_0xe956('0x2e')];if(_0x398749[_0xe956('0x30')][_0xe956('0x3f')]){_0x563529[_0xe956('0x40')]=[{'all':!![]}];}_0x563529=_[_0xe956('0x3c')]({},_0x563529,_0x398749[_0xe956('0x3e')]);return db[_0xe956('0x2a')]['find'](_0x563529)[_0xe956('0x23')](handleEntityNotFound(_0x4079bf,null))['then'](function(_0x48fee8){if(_0x48fee8){var _0x2e18cf=_0x48fee8[_0xe956('0x4a')]({'plain':!![]});_0x2e18cf=qs[_0xe956('0x4b')](_0x2e18cf,['id','createdAt','updatedAt']);_0x398749['body']=_[_0xe956('0x4b')](_0x398749['body'],['id',_0xe956('0x4c'),_0xe956('0x4d')]);return db[_0xe956('0x2a')]['create'](_[_0xe956('0x3c')](_0x2e18cf,_0x398749[_0xe956('0x4e')]),{'include':_0x398749[_0xe956('0x30')][_0xe956('0x3f')]?[{'all':!![]}]:undefined});}})[_0xe956('0x23')](respondWithResult(_0x4079bf,0xc9))[_0xe956('0x43')](handleError(_0x4079bf,null));};exports[_0xe956('0x4f')]=function(_0x355ed5,_0x4b4c4d){if(_0x355ed5[_0xe956('0x4e')]['id']){delete _0x355ed5[_0xe956('0x4e')]['id'];}return db[_0xe956('0x2a')]['find']({'where':{'id':_0x355ed5['params']['id']}})[_0xe956('0x23')](handleEntityNotFound(_0x4b4c4d,null))[_0xe956('0x23')](saveUpdates(_0x355ed5['body'],null))[_0xe956('0x23')](respondWithResult(_0x4b4c4d,null))[_0xe956('0x43')](handleError(_0x4b4c4d,null));};exports[_0xe956('0x24')]=function(_0x519c27,_0x4673ae){return db[_0xe956('0x2a')][_0xe956('0x48')]({'where':{'id':_0x519c27[_0xe956('0x45')]['id']}})['then'](handleEntityNotFound(_0x4673ae,null))[_0xe956('0x23')](removeEntity(_0x4673ae,null))[_0xe956('0x43')](handleError(_0x4673ae,null));};exports['create']=function(_0x18bb76,_0x572495,_0x3b4249){_0x18bb76['body']['name']=_0x18bb76[_0xe956('0x50')][_0xe956('0x51')];_0x18bb76['body'][_0xe956('0x52')]=_0x18bb76[_0xe956('0x50')][_0xe956('0x53')];_0x18bb76[_0xe956('0x4e')][_0xe956('0x2c')]=_0x18bb76['file'][_0xe956('0x54')];return db['Attachment'][_0xe956('0x55')](_0x18bb76[_0xe956('0x4e')])[_0xe956('0x23')](respondWithResult(_0x572495,0xc9))[_0xe956('0x43')](handleError(_0x572495,null));};exports[_0xe956('0x56')]=function(_0x23200b,_0x3ff471,_0x90cc13){return db[_0xe956('0x2a')][_0xe956('0x57')]({'where':{'id':_0x23200b[_0xe956('0x45')]['id']},'raw':!![]})[_0xe956('0x23')](handleEntityNotFound(_0x3ff471,null))[_0xe956('0x23')](function(_0x8a1481){if(_0x8a1481){var _0x63024b=_0x8a1481[_0xe956('0x58')]!==null;var _0x2ef9c5=path['join'](config[_0xe956('0x59')],_0xe956('0x5a'));if(_0x63024b){_0x2ef9c5=path[_0xe956('0x5b')](_0x2ef9c5,'offline-chat/');}var _0x31ab7f=path['join'](_0x2ef9c5,_0x8a1481[_0xe956('0x52')]);return _0x3ff471[_0xe956('0x56')](_0x31ab7f);}})['catch'](handleError(_0x3ff471,null));};
\ No newline at end of file
index 215778e..84765ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74ba=['rimraf','./attachment.attributes','exports','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0x74ba,0x19c));var _0xa74b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x74ba[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa74b('0x0'));var util=require(_0xa74b('0x1'));var logger=require(_0xa74b('0x2'))('api');var moment=require(_0xa74b('0x3'));var BPromise=require(_0xa74b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa74b('0x5'));var rimraf=require(_0xa74b('0x6'));var config=require('../../config/environment');var attributes=require(_0xa74b('0x7'));module[_0xa74b('0x8')]=function(_0x51a1b8,_0x5d6aa){return _0x51a1b8['define'](_0xa74b('0x9'),attributes,{'tableName':_0xa74b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa626=['../../config/environment','exports','define','Attachment','attachments','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x29e327,_0x2b6ea9){var _0x3dac9e=function(_0x5c0e02){while(--_0x5c0e02){_0x29e327['push'](_0x29e327['shift']());}};_0x3dac9e(++_0x2b6ea9);}(_0xa626,0x170));var _0x6a62=function(_0x52d008,_0x33b6c9){_0x52d008=_0x52d008-0x0;var _0x2bb6a9=_0xa626[_0x52d008];return _0x2bb6a9;};'use strict';var _=require('lodash');var util=require(_0x6a62('0x0'));var logger=require(_0x6a62('0x1'))('api');var moment=require(_0x6a62('0x2'));var BPromise=require(_0x6a62('0x3'));var rp=require(_0x6a62('0x4'));var fs=require('fs');var path=require(_0x6a62('0x5'));var rimraf=require('rimraf');var config=require(_0x6a62('0x6'));var attributes=require('./attachment.attributes');module[_0x6a62('0x7')]=function(_0x428b4e,_0x4c214b){return _0x428b4e[_0x6a62('0x8')](_0x6a62('0x9'),attributes,{'tableName':_0x6a62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 74b6ce4..20b4061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1948=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Attachment','create','body','options','then','CreateAttachment','lodash','util','moment','bluebird','randomstring'];(function(_0x25b8b1,_0xe0b951){var _0x2d04f7=function(_0x1a45b8){while(--_0x1a45b8){_0x25b8b1['push'](_0x25b8b1['shift']());}};_0x2d04f7(++_0xe0b951);}(_0x1948,0x145));var _0x8194=function(_0x384729,_0x349db0){_0x384729=_0x384729-0x0;var _0xfa0168=_0x1948[_0x384729];return _0xfa0168;};'use strict';var _=require(_0x8194('0x0'));var util=require(_0x8194('0x1'));var moment=require(_0x8194('0x2'));var BPromise=require(_0x8194('0x3'));var rs=require(_0x8194('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8194('0x5'))['db'];var utils=require(_0x8194('0x6'));var logger=require(_0x8194('0x7'))(_0x8194('0x8'));var config=require(_0x8194('0x9'));var jayson=require(_0x8194('0xa'));var client=jayson[_0x8194('0xb')][_0x8194('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x521ed0,_0x1e4b32,_0x104856){return new BPromise(function(_0x4f32ce,_0xeeaa84){return client[_0x8194('0xd')](_0x521ed0,_0x104856)['then'](function(_0x4ffc45){logger[_0x8194('0xe')](_0x8194('0xf'),_0x1e4b32,_0x8194('0x10'));logger[_0x8194('0x11')](_0x8194('0x12'),_0x1e4b32,'request\x20sent',JSON[_0x8194('0x13')](_0x4ffc45));if(_0x4ffc45[_0x8194('0x14')]){if(_0x4ffc45[_0x8194('0x14')]['code']===0x1f4){logger[_0x8194('0x14')](_0x8194('0xf'),_0x1e4b32,_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);return _0xeeaa84(_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);}logger['error'](_0x8194('0xf'),_0x1e4b32,_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);return _0x4f32ce(_0x4ffc45[_0x8194('0x14')][_0x8194('0x15')]);}else{logger[_0x8194('0xe')](_0x8194('0xf'),_0x1e4b32,_0x8194('0x10'));_0x4f32ce(_0x4ffc45[_0x8194('0x16')]['message']);}})[_0x8194('0x17')](function(_0x31adc2){logger['error'](_0x8194('0xf'),_0x1e4b32,_0x31adc2);_0xeeaa84(_0x31adc2);});});}exports['CreateAttachment']=function(_0x55e4c2){var _0x5f2172=this;return new Promise(function(_0x37b048,_0x43a192){return db[_0x8194('0x18')][_0x8194('0x19')](_0x55e4c2[_0x8194('0x1a')],{'raw':_0x55e4c2[_0x8194('0x1b')]?_0x55e4c2['options']['raw']===undefined?!![]:![]:!![]})[_0x8194('0x1c')](function(_0x588cac){logger[_0x8194('0xe')](_0x8194('0x1d'),_0x55e4c2);logger[_0x8194('0x11')]('CreateAttachment',_0x55e4c2,JSON[_0x8194('0x13')](_0x588cac));_0x37b048(_0x588cac);})[_0x8194('0x17')](function(_0x41641d){logger[_0x8194('0x14')](_0x8194('0x1d'),_0x41641d[_0x8194('0x15')],_0x55e4c2);_0x43a192(_0x5f2172[_0x8194('0x14')](0x1f4,_0x41641d[_0x8194('0x15')]));});});};
\ No newline at end of file
+var _0xeddd=['../../config/environment','jayson/promise','client','http','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateAttachment','Attachment','create','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x46401e,_0x2a345b){var _0x447cba=function(_0x54ea97){while(--_0x54ea97){_0x46401e['push'](_0x46401e['shift']());}};_0x447cba(++_0x2a345b);}(_0xeddd,0x69));var _0xdedd=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xeddd[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var moment=require(_0xdedd('0x2'));var BPromise=require(_0xdedd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdedd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdedd('0x5'));var logger=require(_0xdedd('0x6'))('rpc');var config=require(_0xdedd('0x7'));var jayson=require(_0xdedd('0x8'));var client=jayson[_0xdedd('0x9')][_0xdedd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x102b00,_0x41d72f,_0x2aa946){return new BPromise(function(_0x260839,_0x3cc017){return client[_0xdedd('0xb')](_0x102b00,_0x2aa946)[_0xdedd('0xc')](function(_0x429585){logger['info'](_0xdedd('0xd'),_0x41d72f,_0xdedd('0xe'));logger[_0xdedd('0xf')](_0xdedd('0x10'),_0x41d72f,'request\x20sent',JSON[_0xdedd('0x11')](_0x429585));if(_0x429585[_0xdedd('0x12')]){if(_0x429585[_0xdedd('0x12')][_0xdedd('0x13')]===0x1f4){logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);return _0x3cc017(_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);}logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);return _0x260839(_0x429585[_0xdedd('0x12')][_0xdedd('0x14')]);}else{logger[_0xdedd('0x15')](_0xdedd('0xd'),_0x41d72f,_0xdedd('0xe'));_0x260839(_0x429585['result'][_0xdedd('0x14')]);}})[_0xdedd('0x16')](function(_0x588ce7){logger[_0xdedd('0x12')](_0xdedd('0xd'),_0x41d72f,_0x588ce7);_0x3cc017(_0x588ce7);});});}exports[_0xdedd('0x17')]=function(_0x4b16bb){var _0x43611b=this;return new Promise(function(_0x24e331,_0x4054b0){return db[_0xdedd('0x18')][_0xdedd('0x19')](_0x4b16bb['body'],{'raw':_0x4b16bb[_0xdedd('0x1a')]?_0x4b16bb[_0xdedd('0x1a')][_0xdedd('0x1b')]===undefined?!![]:![]:!![]})[_0xdedd('0xc')](function(_0x1213d6){logger[_0xdedd('0x15')](_0xdedd('0x17'),_0x4b16bb);logger[_0xdedd('0xf')](_0xdedd('0x17'),_0x4b16bb,JSON['stringify'](_0x1213d6));_0x24e331(_0x1213d6);})['catch'](function(_0x538dc1){logger['error'](_0xdedd('0x17'),_0x538dc1[_0xdedd('0x14')],_0x4b16bb);_0x4054b0(_0x43611b[_0xdedd('0x12')](0x1f4,_0x538dc1[_0xdedd('0x14')]));});});};
\ No newline at end of file
index 12ac6f1..aced63d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x26eecf,_0x360096){var _0x1cf849=function(_0x44f8be){while(--_0x44f8be){_0x26eecf['push'](_0x26eecf['shift']());}};_0x1cf849(++_0x360096);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5ab263,_0x4d1958){_0x5ab263=_0x5ab263-0x0;var _0x21ac3e=_0x5f2f[_0x5ab263];return _0x21ac3e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
index ec64657..f8ac267 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873f=['callbackURL','findOne','blockDuration','then','User','find','map','value','admin','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','getLicense','catch','lodash','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','email','callback','clientID','clientSecret'];(function(_0x2c4a82,_0x12ece1){var _0x6434da=function(_0x530467){while(--_0x530467){_0x2c4a82['push'](_0x2c4a82['shift']());}};_0x6434da(++_0x12ece1);}(_0x873f,0xdb));var _0xf873=function(_0x3bad66,_0x1f3f74){_0x3bad66=_0x3bad66-0x0;var _0x31d4c2=_0x873f[_0x3bad66];return _0x31d4c2;};'use strict';var _=require(_0xf873('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0xf873('0x1'));var db=require(_0xf873('0x2'))['db'];var config=require(_0xf873('0x3'));var signToken=require('../../components/auth/service')[_0xf873('0x4')];var utils=require(_0xf873('0x5'));exports['login']=passport[_0xf873('0x6')](_0xf873('0x7'),{'failureRedirect':_0xf873('0x8'),'scope':['profile',_0xf873('0x9')],'session':![]});exports[_0xf873('0xa')]=passport[_0xf873('0x6')]('google',{'failureRedirect':_0xf873('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config['google'][_0xf873('0xb')]:'id','clientSecret':config[_0xf873('0x7')]?config[_0xf873('0x7')][_0xf873('0xc')]:'secret','callbackURL':config[_0xf873('0x7')]?config[_0xf873('0x7')][_0xf873('0xd')]:''},function(_0x3cf77e,_0x1275fc,_0x2fc2a5,_0x5a7c66){var _0x1b85ab,_0x1f9eaf;return db['Setting'][_0xf873('0xe')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf873('0xf')],'raw':!![]})[_0xf873('0x10')](function(_0xa8e88c){_0x1b85ab=_0xa8e88c;return db[_0xf873('0x11')][_0xf873('0x12')]({'where':{'email':_[_0xf873('0x13')](_0x2fc2a5['emails'],_0xf873('0x14')),'role':{'$or':[_0xf873('0x15'),_0xf873('0x16'),'agent']}}});})[_0xf873('0x10')](function(_0x18c319){_0x1f9eaf=_0x18c319;if(_0x1f9eaf){if(_0x1f9eaf[_0xf873('0x17')]){return _0x5a7c66(_0xf873('0x18'));}else if(_0x1b85ab[_0xf873('0xf')]>0x0){if(_0x1f9eaf[_0xf873('0x19')]){if(moment(_0x1f9eaf['blockedAt'])['add'](_0x1b85ab[_0xf873('0xf')],_0xf873('0x1a'))>moment()){return _0x5a7c66('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x1f9eaf,0x0,![],null)['then'](function(){return utils[_0xf873('0x1b')](_0x1f9eaf);})[_0xf873('0x10')](function(){return _0x5a7c66(null,_0x1f9eaf);});}}else{return utils[_0xf873('0x1b')](_0x1f9eaf)[_0xf873('0x10')](function(){return _0x5a7c66(null,_0x1f9eaf);});}}else{return utils[_0xf873('0x1b')](_0x1f9eaf)[_0xf873('0x10')](function(){return _0x5a7c66(null,_0x1f9eaf);});}}return _0x5a7c66(_0xf873('0x18'));})[_0xf873('0x1c')](function(_0xdc31d7){_0x5a7c66(_0xdc31d7);});}));
\ No newline at end of file
+var _0x5870=['use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','google','/login','profile','email','callback','authenticate'];(function(_0x1389e3,_0x2ed4bd){var _0x3f6873=function(_0x494b3a){while(--_0x494b3a){_0x1389e3['push'](_0x1389e3['shift']());}};_0x3f6873(++_0x2ed4bd);}(_0x5870,0x180));var _0x0587=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5870[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x0587('0x0'));var passport=require(_0x0587('0x1'));var GoogleStrategy=require(_0x0587('0x2'))[_0x0587('0x3')];var moment=require(_0x0587('0x4'));var db=require(_0x0587('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0x0587('0x6'))[_0x0587('0x7')];var utils=require(_0x0587('0x8'));exports[_0x0587('0x9')]=passport['authenticate'](_0x0587('0xa'),{'failureRedirect':_0x0587('0xb'),'scope':[_0x0587('0xc'),_0x0587('0xd')],'session':![]});exports[_0x0587('0xe')]=passport[_0x0587('0xf')](_0x0587('0xa'),{'failureRedirect':_0x0587('0xb'),'session':![]});passport[_0x0587('0x10')](new GoogleStrategy({'clientID':config[_0x0587('0xa')]?config['google'][_0x0587('0x11')]:'id','clientSecret':config[_0x0587('0xa')]?config['google'][_0x0587('0x12')]:_0x0587('0x13'),'callbackURL':config[_0x0587('0xa')]?config[_0x0587('0xa')][_0x0587('0x14')]:''},function(_0x29c6ef,_0x30269d,_0x323153,_0x3c6af5){var _0x2f093d,_0x301e41;return db[_0x0587('0x15')][_0x0587('0x16')]({'where':{'id':0x1},'attributes':[_0x0587('0x17'),_0x0587('0x18')],'raw':!![]})[_0x0587('0x19')](function(_0x43307a){_0x2f093d=_0x43307a;return db[_0x0587('0x1a')]['find']({'where':{'email':_[_0x0587('0x1b')](_0x323153[_0x0587('0x1c')],_0x0587('0x1d')),'role':{'$or':[_0x0587('0x1e'),'user',_0x0587('0x1f')]}}});})['then'](function(_0x2c6f82){_0x301e41=_0x2c6f82;if(_0x301e41){if(_0x301e41[_0x0587('0x20')]){return _0x3c6af5(_0x0587('0x21'));}else if(_0x2f093d['blockDuration']>0x0){if(_0x301e41[_0x0587('0x22')]){if(moment(_0x301e41['blockedAt'])[_0x0587('0x23')](_0x2f093d[_0x0587('0x18')],_0x0587('0x24'))>moment()){return _0x3c6af5('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x0587('0x25')](_0x301e41,0x0,![],null)[_0x0587('0x19')](function(){return utils[_0x0587('0x26')](_0x301e41);})['then'](function(){return _0x3c6af5(null,_0x301e41);});}}else{return utils[_0x0587('0x26')](_0x301e41)[_0x0587('0x19')](function(){return _0x3c6af5(null,_0x301e41);});}}else{return utils[_0x0587('0x26')](_0x301e41)[_0x0587('0x19')](function(){return _0x3c6af5(null,_0x301e41);});}}return _0x3c6af5(_0x0587('0x21'));})[_0x0587('0x27')](function(_0x3fac){_0x3c6af5(_0x3fac);});}));
\ No newline at end of file
index 2cf155c..cb1fc26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64b0=['passport','Router','../../components/auth/service','get','/callback','isMiddleware','login','exports','express'];(function(_0x752005,_0x14dc74){var _0x40629c=function(_0x189e3d){while(--_0x189e3d){_0x752005['push'](_0x752005['shift']());}};_0x40629c(++_0x14dc74);}(_0x64b0,0x74));var _0x064b=function(_0x35300e,_0x37b3ab){_0x35300e=_0x35300e-0x0;var _0x22501a=_0x64b0[_0x35300e];return _0x22501a;};'use strict';var express=require(_0x064b('0x0'));var passport=require(_0x064b('0x1'));var router=express[_0x064b('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x064b('0x3'));router[_0x064b('0x4')]('/',controller['login']);router[_0x064b('0x4')](_0x064b('0x5'),controller['callback'],authService[_0x064b('0x6')],userController[_0x064b('0x7')],authService['setTokenCookie']);module[_0x064b('0x8')]=router;
\ No newline at end of file
+var _0x56f4=['exports','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','setTokenCookie'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0x56f4,0xe2));var _0x456f=function(_0x4c70ec,_0x3823ee){_0x4c70ec=_0x4c70ec-0x0;var _0x5bc825=_0x56f4[_0x4c70ec];return _0x5bc825;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x456f('0x0')]();var controller=require(_0x456f('0x1'));var userController=require(_0x456f('0x2'));var authService=require(_0x456f('0x3'));router[_0x456f('0x4')]('/',controller[_0x456f('0x5')]);router[_0x456f('0x4')]('/callback',controller[_0x456f('0x6')],authService['isMiddleware'],userController[_0x456f('0x5')],authService[_0x456f('0x7')]);module[_0x456f('0x8')]=router;
\ No newline at end of file
index 56cd215..e412647 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x928a=['blockedAt','loginAttempts','admin','user','authenticate','blocked','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','auth','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','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','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','use','passport','passport-local','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x928a,0x19b));var _0xa928=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x928a[_0x1969a7];return _0x3d665f;};'use strict';var util=require('util');var passport=require(_0xa928('0x0'));var LocalStrategy=require(_0xa928('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xa928('0x2'));var rs=require(_0xa928('0x3'));var moment=require(_0xa928('0x4'));var db=require(_0xa928('0x5'))['db'];var authService=require(_0xa928('0x6'));var utils=require(_0xa928('0x7'));var client=jayson['client'][_0xa928('0x8')]({'port':0x232b});function localAuthenticate(_0x15a0ce,_0x49a47d,_0x1b9614,_0x1f5192){var _0x419d6e,_0x288dec;return db[_0xa928('0x9')][_0xa928('0xa')]({'where':{'id':0x1},'attributes':[_0xa928('0xb'),_0xa928('0xc')],'raw':!![]})[_0xa928('0xd')](function(_0x3021d3){_0x419d6e=_0x3021d3;return _0x15a0ce[_0xa928('0xa')]({'attributes':['id',_0xa928('0xe'),_0xa928('0xf'),_0xa928('0x10'),_0xa928('0x11'),_0xa928('0x12'),'blocked',_0xa928('0x13'),_0xa928('0x14')],'where':{'name':_0x49a47d,'role':{'$or':[_0xa928('0x15'),_0xa928('0x16'),'agent']}}});})[_0xa928('0xd')](function(_0x42fbfa){if(!_0x42fbfa||_0x42fbfa&&_0x42fbfa['name']!==_0x49a47d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x288dec=_0x42fbfa;return _0x288dec;}})[_0xa928('0xd')](function(){_0x288dec[_0xa928('0x17')](_0x1b9614,function(_0x2835c0,_0x550485){var _0x4bec4c=_0x288dec[_0xa928('0x14')]+0x1;if(_0x2835c0){return _0x1f5192(_0x2835c0);}else if(!_0x550485){if(_0x288dec[_0xa928('0x12')]){return _0x1f5192(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x419d6e[_0xa928('0xb')]>0x0){if(_0x288dec[_0xa928('0x18')]){if(_0x419d6e[_0xa928('0xc')]>0x0){if(moment(_0x288dec[_0xa928('0x13')])[_0xa928('0x19')](_0x419d6e['blockDuration'],_0xa928('0x1a'))>moment()){return _0x1f5192(null,![],{'message':_0xa928('0x1b')});}else{return utils[_0xa928('0x1c')](_0x288dec,_0x4bec4c,![],null)['then'](function(){return _0x1f5192(null,![],{'message':_0xa928('0x1b')});});}}else{return _0x1f5192(null,![],{'message':_0xa928('0x1b')});}}else{if(_0x4bec4c>=_0x419d6e['allowedLoginAttempts']){return utils[_0xa928('0x1c')](_0x288dec,0x0,!![],moment())[_0xa928('0xd')](function(){return _0x1f5192(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa928('0x1c')](_0x288dec,_0x4bec4c,![],null)[_0xa928('0xd')](function(){return _0x1f5192(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x1f5192(null,![],{'message':_0xa928('0x1b')});}}else{if(_0x288dec['disabled']){return _0x1f5192(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x419d6e[_0xa928('0xb')]>0x0){if(_0x288dec['blocked']){if(_0x419d6e[_0xa928('0xc')]>0x0){if(moment(_0x288dec[_0xa928('0x13')])[_0xa928('0x19')](_0x419d6e[_0xa928('0xc')],_0xa928('0x1a'))>moment()){return _0x1f5192(null,![],{'message':_0xa928('0x1b')});}else{return utils[_0xa928('0x1c')](_0x288dec,0x0,![],null)[_0xa928('0xd')](function(){return utils['getLicense'](_0x288dec);})[_0xa928('0xd')](function(){return _0x1f5192(null,_0x288dec);});}}else{return _0x1f5192(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xa928('0x1c')](_0x288dec,0x0,![],null)[_0xa928('0xd')](function(){return utils[_0xa928('0x1d')](_0x288dec);})[_0xa928('0xd')](function(){return _0x1f5192(null,_0x288dec);})['catch'](function(_0x2a65e6){return _0x1f5192(null,![],_0x2a65e6);});}}else{if(_0x288dec['blocked']){return _0x1f5192(null,![],{'message':_0xa928('0x1b')});}else{return utils['getLicense'](_0x288dec)[_0xa928('0xd')](function(){return _0x1f5192(null,_0x288dec);});}}}});})[_0xa928('0x1e')](function(_0x496eea){return _0x1f5192(null,![],_0x496eea);});}function sendServiceMail(_0x1b55fb){return db['MailAccount'][_0xa928('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xa928('0xe'),'email'],'include':[{'model':db[_0xa928('0x20')],'as':_0xa928('0x21')}]})[_0xa928('0xd')](function(_0x520597){if(!_0x520597){throw new Error(_0xa928('0x22'));}var _0xa75625={'tls':{'rejectUnauthorized':![]}};if(_0x520597[_0xa928('0x21')][_0xa928('0x23')]){_0xa75625[_0xa928('0x23')]=_0x520597[_0xa928('0x21')]['service'];}else{_0xa75625[_0xa928('0x24')]=_0x520597['Smtp'][_0xa928('0x24')];_0xa75625[_0xa928('0x25')]=_0x520597[_0xa928('0x21')]['port'];_0xa75625['secure']=_0x520597[_0xa928('0x21')]['secure'];}if(_0x520597[_0xa928('0x21')]['authentication']){_0xa75625[_0xa928('0x26')]={'user':_0x520597[_0xa928('0x21')]['user'],'pass':_0x520597['Smtp'][_0xa928('0x27')]};}var _0xf5512e={'account':_0xa75625,'message':_[_0xa928('0x28')]({'from':util[_0xa928('0x29')](_0xa928('0x2a'),_0x520597[_0xa928('0xe')],_0x520597[_0xa928('0x2b')]||_0x520597[_0xa928('0x21')]['user'])},_0x1b55fb)};return client[_0xa928('0x2c')](_0xa928('0x2d'),_0xf5512e);})[_0xa928('0xd')](function(_0x4a6581){if(_0x4a6581[_0xa928('0x2e')]){throw new Error(util[_0xa928('0x29')](_0xa928('0x2f'),_0x4a6581[_0xa928('0x2e')]['message']||JSON[_0xa928('0x30')](_0x4a6581[_0xa928('0x2e')])));}return!![];});}function handleError(_0x51b998,_0x5d1135,_0x570689){return _0x51b998[_0xa928('0x31')](_0x5d1135||0x1f4)[_0xa928('0x32')]({'message':_0x570689?_0x570689[_0xa928('0x33')]||_0x570689:''});}exports[_0xa928('0x34')]=function(_0x470dd5,_0x528104,_0x184a96){passport['authenticate']('local',function(_0x23b80b,_0x6423d5,_0x2a4df9){var _0x153b0d=_0x23b80b||_0x2a4df9;if(_0x153b0d){return handleError(_0x528104,0x191,_0x153b0d);}if(!_0x6423d5){return handleError(_0x528104,0x194,{'message':_0xa928('0x35')});}else{var _0x2c4e6d={'payload':{'id':_0x6423d5['id'],'role':_0x6423d5[_0xa928('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xa928('0x36')](_0x2c4e6d)[_0xa928('0xd')](function(_0x197673){_0x528104[_0xa928('0x37')]({'id':_0x6423d5['id'],'token':_0x197673,'statusCall':'','isAlreadyLogged':_0x6423d5[_0xa928('0x38')]});});}})(_0x470dd5,_0x528104,_0x184a96);};exports[_0xa928('0x39')]=function(_0x3ac44c,_0x48ea46,_0x5a0ae3){if(!_0x3ac44c[_0xa928('0x3a')][_0xa928('0x2b')]){return handleError(_0x48ea46,0x1f4,{'message':_0xa928('0x3b')});}var _0x163a49=rs[_0xa928('0x3c')]();_0x3ac44c[_0xa928('0x3a')][_0xa928('0x2b')]=_0x3ac44c[_0xa928('0x3a')]['email']['trim']()['toLowerCase']();var _0x269773;return db[_0xa928('0x9')][_0xa928('0xa')]({'where':{'id':0x1},'attributes':[_0xa928('0xb'),'blockDuration'],'raw':!![]})[_0xa928('0xd')](function(_0x5af440){_0x269773=_0x5af440;return db[_0xa928('0x3d')][_0xa928('0x1f')]({'where':{'email':_0x3ac44c['body'][_0xa928('0x2b')]}});})[_0xa928('0xd')](function(_0x202ad5){if(!_0x202ad5){throw new Error(_0xa928('0x3e'));}if(_0x202ad5[_0xa928('0x12')]){throw new Error(_0xa928('0x3f'));}if(_0x202ad5['blocked']){if(moment(_0x202ad5[_0xa928('0x13')])[_0xa928('0x19')](_0x269773[_0xa928('0xc')],_0xa928('0x1a'))>moment()){throw new Error(_0xa928('0x40'));}else{_0x202ad5[_0xa928('0x18')]=![];_0x202ad5[_0xa928('0x13')]=null;}}_0x202ad5[_0xa928('0x41')]=_0x163a49;_0x202ad5['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x202ad5[_0xa928('0x42')]();})[_0xa928('0xd')](function(){return sendServiceMail({'to':_0x3ac44c[_0xa928('0x3a')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa928('0x43')+_0xa928('0x44')+_0xa928('0x45')+_0x3ac44c[_0xa928('0x46')][_0xa928('0x24')]+_0xa928('0x47')+_0x163a49+'\x0a\x0a'+_0xa928('0x48')});})[_0xa928('0xd')](function(){_0x48ea46[_0xa928('0x31')](0xc8)[_0xa928('0x32')]({'message':'Reset\x20Email\x20sent!'});})[_0xa928('0x1e')](function(_0x171fcf){return handleError(_0x48ea46,0x1f4,_0x171fcf);});};exports[_0xa928('0x49')]=function(_0x42688c,_0x76f3de,_0x3d0594){return db[_0xa928('0x3d')][_0xa928('0x1f')]({'where':{'resetPasswordToken':_0x42688c[_0xa928('0x4a')][_0xa928('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xa928('0x4c')]()}}})[_0xa928('0xd')](function(_0x44ff40){if(!_0x44ff40){throw new Error(_0xa928('0x4d'));}return db[_0xa928('0x9')][_0xa928('0xa')]({'attributes':['id',_0xa928('0x4e'),_0xa928('0x4f'),_0xa928('0x50')]})['then'](function(_0x134e48){if(_0x134e48[_0xa928('0x4e')])authService[_0xa928('0x51')](_0x42688c['body'][_0xa928('0xf')]);if(!_0x134e48[_0xa928('0x4f')]||!_0x44ff40[_0xa928('0x52')])return _0x44ff40;authService[_0xa928('0x53')](_0x42688c['body'][_0xa928('0xf')],_0x44ff40[_0xa928('0x52')],_0x134e48['passwordHistoryLimit']);return _0x44ff40;})['then'](function(){_0x44ff40[_0xa928('0xf')]=_0x42688c[_0xa928('0x3a')][_0xa928('0xf')];_0x44ff40[_0xa928('0x41')]=null;_0x44ff40[_0xa928('0x54')]=null;return _0x44ff40['save']();});})[_0xa928('0xd')](function(){_0x76f3de[_0xa928('0x31')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xa928('0x1e')](function(_0x587885){return handleError(_0x76f3de,0x1f4,_0x587885);});};passport[_0xa928('0x55')](new LocalStrategy({'usernameField':_0xa928('0xe'),'passwordField':_0xa928('0xf')},function(_0x175862,_0x44b081,_0x975db1){return localAuthenticate(db[_0xa928('0x3d')],_0x175862,_0x44b081,_0x975db1);}));
\ No newline at end of file
+var _0x9435=['host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','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','Reset\x20Email\x20sent!','catch','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','name','password','salt','role','blocked','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','blockDuration','blockedAt','add','minutes','clearBlockUser','getLicense','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9435,0x93));var _0x5943=function(_0x570ad6,_0x36a5a4){_0x570ad6=_0x570ad6-0x0;var _0x4977c9=_0x9435[_0x570ad6];return _0x4977c9;};'use strict';var util=require(_0x5943('0x0'));var passport=require(_0x5943('0x1'));var LocalStrategy=require(_0x5943('0x2'))[_0x5943('0x3')];var jayson=require('jayson/promise');var _=require(_0x5943('0x4'));var rs=require('randomstring');var moment=require(_0x5943('0x5'));var db=require(_0x5943('0x6'))['db'];var authService=require(_0x5943('0x7'));var utils=require(_0x5943('0x8'));var client=jayson[_0x5943('0x9')][_0x5943('0xa')]({'port':0x232b});function localAuthenticate(_0x114c6c,_0x21cc3a,_0x1388ca,_0x139c03){var _0x3e13cd,_0x21dde7;return db[_0x5943('0xb')][_0x5943('0xc')]({'where':{'id':0x1},'attributes':[_0x5943('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x5a42db){_0x3e13cd=_0x5a42db;return _0x114c6c[_0x5943('0xc')]({'attributes':['id',_0x5943('0xe'),_0x5943('0xf'),_0x5943('0x10'),_0x5943('0x11'),'disabled',_0x5943('0x12'),'blockedAt',_0x5943('0x13')],'where':{'name':_0x21cc3a,'role':{'$or':[_0x5943('0x14'),_0x5943('0x15'),_0x5943('0x16')]}}});})[_0x5943('0x17')](function(_0x4035e6){if(!_0x4035e6||_0x4035e6&&_0x4035e6[_0x5943('0xe')]!==_0x21cc3a){throw new Error(_0x5943('0x18'));}else{_0x21dde7=_0x4035e6;return _0x21dde7;}})['then'](function(){_0x21dde7[_0x5943('0x19')](_0x1388ca,function(_0x4ae9bc,_0x239039){var _0x43987f=_0x21dde7[_0x5943('0x13')]+0x1;if(_0x4ae9bc){return _0x139c03(_0x4ae9bc);}else if(!_0x239039){if(_0x21dde7[_0x5943('0x1a')]){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else if(_0x3e13cd[_0x5943('0xd')]>0x0){if(_0x21dde7['blocked']){if(_0x3e13cd[_0x5943('0x1b')]>0x0){if(moment(_0x21dde7[_0x5943('0x1c')])[_0x5943('0x1d')](_0x3e13cd[_0x5943('0x1b')],_0x5943('0x1e'))>moment()){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else{return utils['clearBlockUser'](_0x21dde7,_0x43987f,![],null)['then'](function(){return _0x139c03(null,![],{'message':_0x5943('0x18')});});}}else{return _0x139c03(null,![],{'message':_0x5943('0x18')});}}else{if(_0x43987f>=_0x3e13cd[_0x5943('0xd')]){return utils[_0x5943('0x1f')](_0x21dde7,0x0,!![],moment())[_0x5943('0x17')](function(){return _0x139c03(null,![],{'message':_0x5943('0x18')});});}else{return utils['clearBlockUser'](_0x21dde7,_0x43987f,![],null)['then'](function(){return _0x139c03(null,![],{'message':_0x5943('0x18')});});}}}else{return _0x139c03(null,![],{'message':_0x5943('0x18')});}}else{if(_0x21dde7[_0x5943('0x1a')]){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else if(_0x3e13cd['allowedLoginAttempts']>0x0){if(_0x21dde7[_0x5943('0x12')]){if(_0x3e13cd[_0x5943('0x1b')]>0x0){if(moment(_0x21dde7['blockedAt'])[_0x5943('0x1d')](_0x3e13cd[_0x5943('0x1b')],_0x5943('0x1e'))>moment()){return _0x139c03(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5943('0x1f')](_0x21dde7,0x0,![],null)['then'](function(){return utils[_0x5943('0x20')](_0x21dde7);})['then'](function(){return _0x139c03(null,_0x21dde7);});}}else{return _0x139c03(null,![],{'message':_0x5943('0x18')});}}else{return utils[_0x5943('0x1f')](_0x21dde7,0x0,![],null)[_0x5943('0x17')](function(){return utils[_0x5943('0x20')](_0x21dde7);})[_0x5943('0x17')](function(){return _0x139c03(null,_0x21dde7);})['catch'](function(_0x727bde){return _0x139c03(null,![],_0x727bde);});}}else{if(_0x21dde7[_0x5943('0x12')]){return _0x139c03(null,![],{'message':_0x5943('0x18')});}else{return utils[_0x5943('0x20')](_0x21dde7)['then'](function(){return _0x139c03(null,_0x21dde7);});}}}});})['catch'](function(_0x39f9c6){return _0x139c03(null,![],_0x39f9c6);});}function sendServiceMail(_0x5434be){return db['MailAccount'][_0x5943('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x5943('0x22')],'include':[{'model':db[_0x5943('0x23')],'as':_0x5943('0x24')}]})['then'](function(_0x3f726a){if(!_0x3f726a){throw new Error(_0x5943('0x25'));}var _0x3aea7f={'tls':{'rejectUnauthorized':![]}};if(_0x3f726a[_0x5943('0x24')][_0x5943('0x26')]){_0x3aea7f[_0x5943('0x26')]=_0x3f726a[_0x5943('0x24')][_0x5943('0x26')];}else{_0x3aea7f[_0x5943('0x27')]=_0x3f726a['Smtp']['host'];_0x3aea7f[_0x5943('0x28')]=_0x3f726a[_0x5943('0x24')][_0x5943('0x28')];_0x3aea7f['secure']=_0x3f726a[_0x5943('0x24')][_0x5943('0x29')];}if(_0x3f726a[_0x5943('0x24')]['authentication']){_0x3aea7f[_0x5943('0x2a')]={'user':_0x3f726a['Smtp'][_0x5943('0x15')],'pass':_0x3f726a[_0x5943('0x24')][_0x5943('0x2b')]};}var _0x34e792={'account':_0x3aea7f,'message':_[_0x5943('0x2c')]({'from':util[_0x5943('0x2d')](_0x5943('0x2e'),_0x3f726a[_0x5943('0xe')],_0x3f726a[_0x5943('0x22')]||_0x3f726a[_0x5943('0x24')][_0x5943('0x15')])},_0x5434be)};return client[_0x5943('0x2f')](_0x5943('0x30'),_0x34e792);})['then'](function(_0x49119f){if(_0x49119f['error']){throw new Error(util[_0x5943('0x2d')](_0x5943('0x31'),_0x49119f[_0x5943('0x32')][_0x5943('0x33')]||JSON[_0x5943('0x34')](_0x49119f[_0x5943('0x32')])));}return!![];});}function handleError(_0x49631d,_0x11021c,_0x578ff7){return _0x49631d[_0x5943('0x35')](_0x11021c||0x1f4)[_0x5943('0x36')]({'message':_0x578ff7?_0x578ff7['message']||_0x578ff7:''});}exports[_0x5943('0x37')]=function(_0x84a4de,_0x27c1c5,_0x2cb100){passport[_0x5943('0x19')](_0x5943('0x38'),function(_0x29d0fe,_0x222fc0,_0x275477){var _0x4608ee=_0x29d0fe||_0x275477;if(_0x4608ee){return handleError(_0x27c1c5,0x191,_0x4608ee);}if(!_0x222fc0){return handleError(_0x27c1c5,0x194,{'message':_0x5943('0x39')});}else{var _0x38376d={'payload':{'id':_0x222fc0['id'],'role':_0x222fc0[_0x5943('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x5943('0x3a')](_0x38376d)[_0x5943('0x17')](function(_0x4debb0){_0x27c1c5[_0x5943('0x3b')]({'id':_0x222fc0['id'],'token':_0x4debb0,'statusCall':'','isAlreadyLogged':_0x222fc0[_0x5943('0x3c')]});});}})(_0x84a4de,_0x27c1c5,_0x2cb100);};exports[_0x5943('0x3d')]=function(_0x25faa2,_0x1d7b65,_0x10dba6){if(!_0x25faa2[_0x5943('0x3e')][_0x5943('0x22')]){return handleError(_0x1d7b65,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x4f772c=rs[_0x5943('0x3f')]();_0x25faa2['body']['email']=_0x25faa2[_0x5943('0x3e')]['email'][_0x5943('0x40')]()[_0x5943('0x41')]();var _0x16d93a;return db[_0x5943('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x5943('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x3297a5){_0x16d93a=_0x3297a5;return db[_0x5943('0x42')][_0x5943('0x21')]({'where':{'email':_0x25faa2[_0x5943('0x3e')][_0x5943('0x22')]}});})['then'](function(_0x31d082){if(!_0x31d082){throw new Error(_0x5943('0x43'));}if(_0x31d082[_0x5943('0x1a')]){throw new Error(_0x5943('0x44'));}if(_0x31d082[_0x5943('0x12')]){if(moment(_0x31d082[_0x5943('0x1c')])[_0x5943('0x1d')](_0x16d93a[_0x5943('0x1b')],_0x5943('0x1e'))>moment()){throw new Error(_0x5943('0x45'));}else{_0x31d082[_0x5943('0x12')]=![];_0x31d082['blockedAt']=null;}}_0x31d082[_0x5943('0x46')]=_0x4f772c;_0x31d082[_0x5943('0x47')]=Date[_0x5943('0x48')]()+0x36ee80;return _0x31d082[_0x5943('0x49')]();})[_0x5943('0x17')](function(){return sendServiceMail({'to':_0x25faa2[_0x5943('0x3e')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x5943('0x4a')+_0x5943('0x4b')+_0x5943('0x4c')+_0x25faa2[_0x5943('0x4d')][_0x5943('0x27')]+_0x5943('0x4e')+_0x4f772c+'\x0a\x0a'+_0x5943('0x4f')});})[_0x5943('0x17')](function(){_0x1d7b65[_0x5943('0x35')](0xc8)[_0x5943('0x36')]({'message':_0x5943('0x50')});})[_0x5943('0x51')](function(_0x1cb287){return handleError(_0x1d7b65,0x1f4,_0x1cb287);});};exports[_0x5943('0x52')]=function(_0x44bf89,_0x52b94d,_0x4f42cd){return db[_0x5943('0x42')][_0x5943('0x21')]({'where':{'resetPasswordToken':_0x44bf89[_0x5943('0x53')]['token'],'resetPasswordExpires':{'$gt':Date[_0x5943('0x48')]()}}})[_0x5943('0x17')](function(_0x58714c){if(!_0x58714c){throw new Error(_0x5943('0x54'));}return db[_0x5943('0xb')]['findOne']({'attributes':['id',_0x5943('0x55'),_0x5943('0x56'),'passwordHistoryLimit']})[_0x5943('0x17')](function(_0x4306f6){if(_0x4306f6[_0x5943('0x55')])authService[_0x5943('0x57')](_0x44bf89[_0x5943('0x3e')]['password']);if(!_0x4306f6['enforcePasswordHistory']||!_0x58714c[_0x5943('0x58')])return _0x58714c;authService[_0x5943('0x59')](_0x44bf89[_0x5943('0x3e')][_0x5943('0xf')],_0x58714c[_0x5943('0x58')],_0x4306f6[_0x5943('0x5a')]);return _0x58714c;})[_0x5943('0x17')](function(){_0x58714c[_0x5943('0xf')]=_0x44bf89[_0x5943('0x3e')][_0x5943('0xf')];_0x58714c['resetPasswordToken']=null;_0x58714c[_0x5943('0x47')]=null;return _0x58714c[_0x5943('0x49')]();});})[_0x5943('0x17')](function(){_0x52b94d['status'](0xc8)['send']({'message':_0x5943('0x5b')});})[_0x5943('0x51')](function(_0x521e88){return handleError(_0x52b94d,0x1f4,_0x521e88);});};passport[_0x5943('0x5c')](new LocalStrategy({'usernameField':_0x5943('0xe'),'passwordField':_0x5943('0xf')},function(_0x116f54,_0x367d6c,_0x57fe32){return localAuthenticate(db[_0x5943('0x42')],_0x116f54,_0x367d6c,_0x57fe32);}));
\ No newline at end of file
index ddeba09..0d712a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ef=['forgot','/reset/:token','reset','express','Router','./authLocal.controller','login'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0xd4ef,0x161));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfd4e('0x0'));var router=express[_0xfd4e('0x1')]();var controller=require(_0xfd4e('0x2'));router['post']('/',controller[_0xfd4e('0x3')]);router['post']('/forgot',controller[_0xfd4e('0x4')]);router['post'](_0xfd4e('0x5'),controller[_0xfd4e('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0xee51=['express','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x33a308,_0x374616){var _0x457de0=function(_0x1d3f3a){while(--_0x1d3f3a){_0x33a308['push'](_0x33a308['shift']());}};_0x457de0(++_0x374616);}(_0xee51,0x10e));var _0x1ee5=function(_0x2c024f,_0x573917){_0x2c024f=_0x2c024f-0x0;var _0x3d9e3e=_0xee51[_0x2c024f];return _0x3d9e3e;};'use strict';var express=require(_0x1ee5('0x0'));var router=express['Router']();var controller=require(_0x1ee5('0x1'));router[_0x1ee5('0x2')]('/',controller[_0x1ee5('0x3')]);router[_0x1ee5('0x2')](_0x1ee5('0x4'),controller[_0x1ee5('0x5')]);router[_0x1ee5('0x2')](_0x1ee5('0x6'),controller[_0x1ee5('0x7')]);module[_0x1ee5('0x8')]=router;
\ No newline at end of file
index f408de3..f230680 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32d9=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3bd234,_0x53f508){var _0x18b1ef=function(_0x51722a){while(--_0x51722a){_0x3bd234['push'](_0x3bd234['shift']());}};_0x18b1ef(++_0x53f508);}(_0x32d9,0x1ef));var _0x932d=function(_0x37d4b6,_0x5d4673){_0x37d4b6=_0x37d4b6-0x0;var _0x15a31d=_0x32d9[_0x37d4b6];return _0x15a31d;};'use strict';var Sequelize=require(_0x932d('0x0'));module['exports']={'name':{'type':Sequelize[_0x932d('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x932d('0x1')]},'description':{'type':Sequelize[_0x932d('0x1')]},'status':{'type':Sequelize[_0x932d('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x932d('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x911b=['sequelize','exports','STRING','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x911b,0xc4));var _0xb911=function(_0xcd888b,_0x55a146){_0xcd888b=_0xcd888b-0x0;var _0x3c2aba=_0x911b[_0xcd888b];return _0x3c2aba;};'use strict';var Sequelize=require(_0xb911('0x0'));module[_0xb911('0x1')]={'name':{'type':Sequelize[_0xb911('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb911('0x2')]},'description':{'type':Sequelize[_0xb911('0x2')]},'status':{'type':Sequelize[_0xb911('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
index c3f287a..80498d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c9b=['../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','Automation','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','addConditions','ids','omit','findOne','Condition','rawAttributes','pick','getConditions','getActions','Action','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xfccf3c,_0x9da04e){var _0xd8b1c=function(_0x242155){while(--_0x242155){_0xfccf3c['push'](_0xfccf3c['shift']());}};_0xd8b1c(++_0x9da04e);}(_0x0c9b,0x18b));var _0xb0c9=function(_0x31860c,_0x28e8e7){_0x31860c=_0x31860c-0x0;var _0xe89726=_0x0c9b[_0x31860c];return _0xe89726;};'use strict';var emlformat=require(_0xb0c9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb0c9('0x1'));var rp=require(_0xb0c9('0x2'));var moment=require(_0xb0c9('0x3'));var BPromise=require(_0xb0c9('0x4'));var Mustache=require(_0xb0c9('0x5'));var util=require(_0xb0c9('0x6'));var path=require(_0xb0c9('0x7'));var sox=require(_0xb0c9('0x8'));var csv=require(_0xb0c9('0x9'));var ejs=require(_0xb0c9('0xa'));var fs=require('fs');var fs_extra=require(_0xb0c9('0xb'));var _=require(_0xb0c9('0xc'));var squel=require('squel');var crypto=require(_0xb0c9('0xd'));var jsforce=require(_0xb0c9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb0c9('0x9'));var querystring=require(_0xb0c9('0xf'));var Papa=require(_0xb0c9('0x10'));var Redis=require(_0xb0c9('0x11'));var authService=require(_0xb0c9('0x12'));var qs=require(_0xb0c9('0x13'));var as=require(_0xb0c9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0c9('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb0c9('0x16'));var db=require(_0xb0c9('0x17'))['db'];function respondWithStatusCode(_0x34d5df,_0x418ff6){_0x418ff6=_0x418ff6||0xcc;return function(_0x155f0d){if(_0x155f0d){return _0x34d5df[_0xb0c9('0x18')](_0x418ff6);}return _0x34d5df[_0xb0c9('0x19')](_0x418ff6)[_0xb0c9('0x1a')]();};}function respondWithResult(_0x16fdde,_0x18e324){_0x18e324=_0x18e324||0xc8;return function(_0x2b8672){if(_0x2b8672){return _0x16fdde[_0xb0c9('0x19')](_0x18e324)[_0xb0c9('0x1b')](_0x2b8672);}};}function respondWithFilteredResult(_0x37e961,_0x54c979){return function(_0x163504){if(_0x163504){var _0x47238b=typeof _0x54c979[_0xb0c9('0x1c')]==='undefined'&&typeof _0x54c979[_0xb0c9('0x1d')]==='undefined';var _0x28cfcf=_0x163504[_0xb0c9('0x1e')];var _0x4d1b6a=_0x47238b?0x0:_0x54c979[_0xb0c9('0x1c')];var _0x409bea=_0x47238b?_0x163504[_0xb0c9('0x1e')]:_0x54c979['offset']+_0x54c979[_0xb0c9('0x1d')];var _0x5b7967;if(_0x409bea>=_0x28cfcf){_0x409bea=_0x28cfcf;_0x5b7967=0xc8;}else{_0x5b7967=0xce;}_0x37e961[_0xb0c9('0x19')](_0x5b7967);return _0x37e961['set'](_0xb0c9('0x1f'),_0x4d1b6a+'-'+_0x409bea+'/'+_0x28cfcf)[_0xb0c9('0x1b')](_0x163504);}return null;};}function patchUpdates(_0x440f70){return function(_0x277d40){try{jsonpatch[_0xb0c9('0x20')](_0x277d40,_0x440f70,!![]);}catch(_0x376977){return BPromise[_0xb0c9('0x21')](_0x376977);}return _0x277d40[_0xb0c9('0x22')]();};}function saveUpdates(_0x3b5f1a,_0x5eebda){return function(_0x13fa97){if(_0x13fa97){return _0x13fa97[_0xb0c9('0x23')](_0x3b5f1a)[_0xb0c9('0x24')](function(_0x1c5392){return _0x1c5392;});}return null;};}function removeEntity(_0x30a920,_0x331ace){return function(_0x5ce764){if(_0x5ce764){return _0x5ce764[_0xb0c9('0x25')]()[_0xb0c9('0x24')](function(){_0x30a920['status'](0xcc)[_0xb0c9('0x1a')]();});}};}function handleEntityNotFound(_0x56401f,_0x226fc2){return function(_0x3d3400){if(!_0x3d3400){_0x56401f[_0xb0c9('0x18')](0x194);}return _0x3d3400;};}function handleError(_0x257912,_0x3ba6fb){_0x3ba6fb=_0x3ba6fb||0x1f4;return function(_0x4da995){logger['error'](_0x4da995[_0xb0c9('0x26')]);if(_0x4da995[_0xb0c9('0x27')]){delete _0x4da995[_0xb0c9('0x27')];}_0x257912[_0xb0c9('0x19')](_0x3ba6fb)['send'](_0x4da995);};}exports[_0xb0c9('0x28')]=function(_0x4b3f71,_0x457219){var _0x26a0a5={},_0x380092={},_0x332504={'count':0x0,'rows':[]};var _0x5eba8f=_['map'](db[_0xb0c9('0x29')]['rawAttributes'],function(_0x3ba4a8){return{'name':_0x3ba4a8[_0xb0c9('0x2a')],'type':_0x3ba4a8[_0xb0c9('0x2b')][_0xb0c9('0x2c')]};});_0x380092[_0xb0c9('0x2d')]=_[_0xb0c9('0x2e')](_0x5eba8f,_0xb0c9('0x27'));_0x380092[_0xb0c9('0x2f')]=_['keys'](_0x4b3f71[_0xb0c9('0x2f')]);_0x380092[_0xb0c9('0x30')]=_[_0xb0c9('0x31')](_0x380092[_0xb0c9('0x2d')],_0x380092[_0xb0c9('0x2f')]);_0x26a0a5[_0xb0c9('0x32')]=_[_0xb0c9('0x31')](_0x380092[_0xb0c9('0x2d')],qs[_0xb0c9('0x33')](_0x4b3f71['query'][_0xb0c9('0x33')]));_0x26a0a5[_0xb0c9('0x32')]=_0x26a0a5[_0xb0c9('0x32')][_0xb0c9('0x34')]?_0x26a0a5[_0xb0c9('0x32')]:_0x380092[_0xb0c9('0x2d')];if(!_0x4b3f71[_0xb0c9('0x2f')][_0xb0c9('0x35')](_0xb0c9('0x36'))){_0x26a0a5[_0xb0c9('0x1d')]=qs['limit'](_0x4b3f71['query']['limit']);_0x26a0a5[_0xb0c9('0x1c')]=qs[_0xb0c9('0x1c')](_0x4b3f71[_0xb0c9('0x2f')]['offset']);}_0x26a0a5[_0xb0c9('0x37')]=qs[_0xb0c9('0x38')](_0x4b3f71[_0xb0c9('0x2f')][_0xb0c9('0x38')]);_0x26a0a5[_0xb0c9('0x39')]=qs[_0xb0c9('0x30')](_['pick'](_0x4b3f71[_0xb0c9('0x2f')],_0x380092[_0xb0c9('0x30')]),_0x5eba8f);if(_0x4b3f71[_0xb0c9('0x2f')]['filter']){_0x26a0a5[_0xb0c9('0x39')]=_[_0xb0c9('0x3a')](_0x26a0a5[_0xb0c9('0x39')],{'$or':_['map'](_0x5eba8f,function(_0x2cc7d4){if(_0x2cc7d4[_0xb0c9('0x2b')]!==_0xb0c9('0x3b')){var _0x38b11e={};_0x38b11e[_0x2cc7d4[_0xb0c9('0x27')]]={'$like':'%'+_0x4b3f71[_0xb0c9('0x2f')][_0xb0c9('0x3c')]+'%'};return _0x38b11e;}})});}_0x26a0a5=_[_0xb0c9('0x3a')]({},_0x26a0a5,_0x4b3f71['options']);var _0x16b2bd={'where':_0x26a0a5[_0xb0c9('0x39')]};return db[_0xb0c9('0x29')]['count'](_0x16b2bd)[_0xb0c9('0x24')](function(_0x53db1f){_0x332504[_0xb0c9('0x1e')]=_0x53db1f;if(_0x4b3f71[_0xb0c9('0x2f')][_0xb0c9('0x3d')]){_0x26a0a5[_0xb0c9('0x3e')]=[{'all':!![]}];}return db[_0xb0c9('0x29')][_0xb0c9('0x3f')](_0x26a0a5);})['then'](function(_0x275f46){_0x332504[_0xb0c9('0x40')]=_0x275f46;return _0x332504;})['then'](respondWithFilteredResult(_0x457219,_0x26a0a5))[_0xb0c9('0x41')](handleError(_0x457219,null));};exports[_0xb0c9('0x42')]=function(_0x41009a,_0x36b0ef){var _0x459f91={'raw':![],'where':{'id':_0x41009a[_0xb0c9('0x43')]['id']}},_0x5bed0a={};_0x5bed0a[_0xb0c9('0x2d')]=_[_0xb0c9('0x44')](db['Automation']['rawAttributes']);_0x5bed0a[_0xb0c9('0x2f')]=_[_0xb0c9('0x44')](_0x41009a['query']);_0x5bed0a[_0xb0c9('0x30')]=_[_0xb0c9('0x31')](_0x5bed0a[_0xb0c9('0x2d')],_0x5bed0a['query']);_0x459f91[_0xb0c9('0x32')]=_['intersection'](_0x5bed0a[_0xb0c9('0x2d')],qs[_0xb0c9('0x33')](_0x41009a['query']['fields']));_0x459f91[_0xb0c9('0x32')]=_0x459f91[_0xb0c9('0x32')]['length']?_0x459f91['attributes']:_0x5bed0a[_0xb0c9('0x2d')];if(_0x41009a[_0xb0c9('0x2f')]['includeAll']){_0x459f91['include']=[{'all':!![]}];}_0x459f91=_[_0xb0c9('0x3a')]({},_0x459f91,_0x41009a[_0xb0c9('0x45')]);return db[_0xb0c9('0x29')][_0xb0c9('0x46')](_0x459f91)[_0xb0c9('0x24')](handleEntityNotFound(_0x36b0ef,null))[_0xb0c9('0x24')](respondWithResult(_0x36b0ef,null))[_0xb0c9('0x41')](handleError(_0x36b0ef,null));};exports['create']=function(_0x9267e8,_0x4cd984){return db[_0xb0c9('0x29')][_0xb0c9('0x47')](_0x9267e8[_0xb0c9('0x48')],{})[_0xb0c9('0x24')](respondWithResult(_0x4cd984,0xc9))['catch'](handleError(_0x4cd984,null));};exports[_0xb0c9('0x23')]=function(_0x1a3ca4,_0x1a4799){if(_0x1a3ca4['body']['id']){delete _0x1a3ca4[_0xb0c9('0x48')]['id'];}return db['Automation'][_0xb0c9('0x46')]({'where':{'id':_0x1a3ca4[_0xb0c9('0x43')]['id']}})[_0xb0c9('0x24')](handleEntityNotFound(_0x1a4799,null))[_0xb0c9('0x24')](saveUpdates(_0x1a3ca4[_0xb0c9('0x48')],null))[_0xb0c9('0x24')](respondWithResult(_0x1a4799,null))[_0xb0c9('0x41')](handleError(_0x1a4799,null));};exports['destroy']=function(_0x1a30fb,_0xb7c299){return db[_0xb0c9('0x29')][_0xb0c9('0x46')]({'where':{'id':_0x1a30fb[_0xb0c9('0x43')]['id']}})[_0xb0c9('0x24')](handleEntityNotFound(_0xb7c299,null))['then'](removeEntity(_0xb7c299,null))['catch'](handleError(_0xb7c299,null));};exports[_0xb0c9('0x49')]=function(_0x4d0b6c,_0x332bc6,_0xaad9fc){return db['Condition'][_0xb0c9('0x46')]({'where':{'id':_0x4d0b6c['params']['id']}})[_0xb0c9('0x24')](handleEntityNotFound(_0x332bc6,null))['then'](function(_0xdfe807){if(_0xdfe807){return _0xdfe807[_0xb0c9('0x49')](_0x4d0b6c[_0xb0c9('0x48')][_0xb0c9('0x4a')],_[_0xb0c9('0x4b')](_0x4d0b6c[_0xb0c9('0x48')],['ids','id'])||{});}})[_0xb0c9('0x24')](respondWithResult(_0x332bc6,null))[_0xb0c9('0x41')](handleError(_0x332bc6,null));};exports['getConditions']=function(_0x4e096e,_0x464d38,_0x32e1ea){var _0x18a204={};var _0x14a797={};var _0x4e3687;var _0x4adeba;return db['Automation'][_0xb0c9('0x4c')]({'where':{'id':_0x4e096e[_0xb0c9('0x43')]['id']}})[_0xb0c9('0x24')](handleEntityNotFound(_0x464d38,null))[_0xb0c9('0x24')](function(_0x419bb9){if(_0x419bb9){_0x4e3687=_0x419bb9;_0x14a797[_0xb0c9('0x2d')]=_[_0xb0c9('0x44')](db[_0xb0c9('0x4d')][_0xb0c9('0x4e')]);_0x14a797[_0xb0c9('0x2f')]=_[_0xb0c9('0x44')](_0x4e096e['query']);_0x14a797[_0xb0c9('0x30')]=_[_0xb0c9('0x31')](_0x14a797[_0xb0c9('0x2d')],_0x14a797['query']);_0x18a204['attributes']=_[_0xb0c9('0x31')](_0x14a797[_0xb0c9('0x2d')],qs[_0xb0c9('0x33')](_0x4e096e[_0xb0c9('0x2f')][_0xb0c9('0x33')]));_0x18a204[_0xb0c9('0x32')]=_0x18a204['attributes']['length']?_0x18a204[_0xb0c9('0x32')]:_0x14a797[_0xb0c9('0x2d')];_0x18a204[_0xb0c9('0x37')]=qs['sort'](_0x4e096e[_0xb0c9('0x2f')][_0xb0c9('0x38')]);_0x18a204[_0xb0c9('0x39')]=qs[_0xb0c9('0x30')](_[_0xb0c9('0x4f')](_0x4e096e[_0xb0c9('0x2f')],_0x14a797[_0xb0c9('0x30')]));if(_0x4e096e[_0xb0c9('0x2f')]['filter']){_0x18a204[_0xb0c9('0x39')]=_[_0xb0c9('0x3a')](_0x18a204[_0xb0c9('0x39')],{'$or':_['map'](_0x18a204[_0xb0c9('0x32')],function(_0x140d81){var _0xbf119c={};_0xbf119c[_0x140d81]={'$like':'%'+_0x4e096e[_0xb0c9('0x2f')][_0xb0c9('0x3c')]+'%'};return _0xbf119c;})});}_0x18a204=_['merge']({},_0x18a204,_0x4e096e['options']);return _0x4e3687[_0xb0c9('0x50')](_0x18a204);}})[_0xb0c9('0x24')](function(_0x244cbb){if(_0x244cbb){_0x4adeba=_0x244cbb[_0xb0c9('0x34')];if(!_0x4e096e['query']['hasOwnProperty'](_0xb0c9('0x36'))){_0x18a204[_0xb0c9('0x1d')]=qs['limit'](_0x4e096e['query'][_0xb0c9('0x1d')]);_0x18a204[_0xb0c9('0x1c')]=qs['offset'](_0x4e096e['query'][_0xb0c9('0x1c')]);}return _0x4e3687[_0xb0c9('0x50')](_0x18a204);}})[_0xb0c9('0x24')](function(_0x2a91a7){if(_0x2a91a7){return _0x2a91a7?{'count':_0x4adeba,'rows':_0x2a91a7}:null;}})[_0xb0c9('0x24')](respondWithResult(_0x464d38,null))['catch'](handleError(_0x464d38,null));};exports['addActions']=function(_0x4101d5,_0x231d46,_0x15a793){return db['Action'][_0xb0c9('0x46')]({'where':{'id':_0x4101d5['params']['id']}})[_0xb0c9('0x24')](handleEntityNotFound(_0x231d46,null))[_0xb0c9('0x24')](function(_0x2fadd9){if(_0x2fadd9){return _0x2fadd9['addActions'](_0x4101d5['body'][_0xb0c9('0x4a')],_[_0xb0c9('0x4b')](_0x4101d5[_0xb0c9('0x48')],['ids','id'])||{});}})[_0xb0c9('0x24')](respondWithResult(_0x231d46,null))['catch'](handleError(_0x231d46,null));};exports[_0xb0c9('0x51')]=function(_0x5dd47c,_0xcde40e,_0x361c9b){var _0x938b05={};var _0x25b488={};var _0x1cc9ee;var _0x1740cd;return db['Automation'][_0xb0c9('0x4c')]({'where':{'id':_0x5dd47c[_0xb0c9('0x43')]['id']}})[_0xb0c9('0x24')](handleEntityNotFound(_0xcde40e,null))[_0xb0c9('0x24')](function(_0x3dde22){if(_0x3dde22){_0x1cc9ee=_0x3dde22;_0x25b488['model']=_[_0xb0c9('0x44')](db[_0xb0c9('0x52')][_0xb0c9('0x4e')]);_0x25b488['query']=_[_0xb0c9('0x44')](_0x5dd47c[_0xb0c9('0x2f')]);_0x25b488[_0xb0c9('0x30')]=_[_0xb0c9('0x31')](_0x25b488[_0xb0c9('0x2d')],_0x25b488[_0xb0c9('0x2f')]);_0x938b05[_0xb0c9('0x32')]=_[_0xb0c9('0x31')](_0x25b488['model'],qs['fields'](_0x5dd47c[_0xb0c9('0x2f')][_0xb0c9('0x33')]));_0x938b05['attributes']=_0x938b05[_0xb0c9('0x32')]['length']?_0x938b05[_0xb0c9('0x32')]:_0x25b488['model'];_0x938b05['order']=qs[_0xb0c9('0x38')](_0x5dd47c['query']['sort']);_0x938b05[_0xb0c9('0x39')]=qs['filters'](_[_0xb0c9('0x4f')](_0x5dd47c[_0xb0c9('0x2f')],_0x25b488[_0xb0c9('0x30')]));if(_0x5dd47c[_0xb0c9('0x2f')][_0xb0c9('0x3c')]){_0x938b05['where']=_[_0xb0c9('0x3a')](_0x938b05[_0xb0c9('0x39')],{'$or':_['map'](_0x938b05[_0xb0c9('0x32')],function(_0x31fd1f){var _0x5678b9={};_0x5678b9[_0x31fd1f]={'$like':'%'+_0x5dd47c[_0xb0c9('0x2f')][_0xb0c9('0x3c')]+'%'};return _0x5678b9;})});}_0x938b05=_['merge']({},_0x938b05,_0x5dd47c['options']);return _0x1cc9ee[_0xb0c9('0x51')](_0x938b05);}})[_0xb0c9('0x24')](function(_0x1c6a7a){if(_0x1c6a7a){_0x1740cd=_0x1c6a7a[_0xb0c9('0x34')];if(!_0x5dd47c[_0xb0c9('0x2f')][_0xb0c9('0x35')](_0xb0c9('0x36'))){_0x938b05[_0xb0c9('0x1d')]=qs[_0xb0c9('0x1d')](_0x5dd47c[_0xb0c9('0x2f')][_0xb0c9('0x1d')]);_0x938b05[_0xb0c9('0x1c')]=qs[_0xb0c9('0x1c')](_0x5dd47c[_0xb0c9('0x2f')]['offset']);}return _0x1cc9ee['getActions'](_0x938b05);}})[_0xb0c9('0x24')](function(_0x2cff81){if(_0x2cff81){return _0x2cff81?{'count':_0x1740cd,'rows':_0x2cff81}:null;}})['then'](respondWithResult(_0xcde40e,null))[_0xb0c9('0x41')](handleError(_0xcde40e,null));};
\ No newline at end of file
+var _0x67fd=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','catch','create','body','params','addConditions','Condition','find','ids','omit','getConditions','addActions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','squel'];(function(_0x4a752,_0x3c1398){var _0x3ff76a=function(_0x230f83){while(--_0x230f83){_0x4a752['push'](_0x4a752['shift']());}};_0x3ff76a(++_0x3c1398);}(_0x67fd,0x1d6));var _0xd67f=function(_0x42e255,_0x4dc264){_0x42e255=_0x42e255-0x0;var _0x3b817e=_0x67fd[_0x42e255];return _0x3b817e;};'use strict';var emlformat=require(_0xd67f('0x0'));var rimraf=require(_0xd67f('0x1'));var zipdir=require(_0xd67f('0x2'));var jsonpatch=require(_0xd67f('0x3'));var rp=require(_0xd67f('0x4'));var moment=require('moment');var BPromise=require(_0xd67f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd67f('0x6'));var sox=require(_0xd67f('0x7'));var csv=require(_0xd67f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd67f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd67f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd67f('0xb'));var Papa=require(_0xd67f('0xc'));var Redis=require(_0xd67f('0xd'));var authService=require(_0xd67f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd67f('0xf'));var hardwareService=require(_0xd67f('0x10'));var logger=require('../../config/logger')(_0xd67f('0x11'));var utils=require(_0xd67f('0x12'));var config=require(_0xd67f('0x13'));var licenseUtil=require(_0xd67f('0x14'));var db=require(_0xd67f('0x15'))['db'];function respondWithStatusCode(_0x308140,_0x3f4571){_0x3f4571=_0x3f4571||0xcc;return function(_0x13d4a5){if(_0x13d4a5){return _0x308140[_0xd67f('0x16')](_0x3f4571);}return _0x308140[_0xd67f('0x17')](_0x3f4571)['end']();};}function respondWithResult(_0x5f3de5,_0x41d5e5){_0x41d5e5=_0x41d5e5||0xc8;return function(_0xeff800){if(_0xeff800){return _0x5f3de5[_0xd67f('0x17')](_0x41d5e5)[_0xd67f('0x18')](_0xeff800);}};}function respondWithFilteredResult(_0x359750,_0x206cec){return function(_0x4d4cef){if(_0x4d4cef){var _0xa3489f=typeof _0x206cec[_0xd67f('0x19')]===_0xd67f('0x1a')&&typeof _0x206cec[_0xd67f('0x1b')]==='undefined';var _0x58c8c7=_0x4d4cef[_0xd67f('0x1c')];var _0x10d4a3=_0xa3489f?0x0:_0x206cec[_0xd67f('0x19')];var _0x3c7c2b=_0xa3489f?_0x4d4cef['count']:_0x206cec[_0xd67f('0x19')]+_0x206cec[_0xd67f('0x1b')];var _0x2c1b1a;if(_0x3c7c2b>=_0x58c8c7){_0x3c7c2b=_0x58c8c7;_0x2c1b1a=0xc8;}else{_0x2c1b1a=0xce;}_0x359750[_0xd67f('0x17')](_0x2c1b1a);return _0x359750[_0xd67f('0x1d')](_0xd67f('0x1e'),_0x10d4a3+'-'+_0x3c7c2b+'/'+_0x58c8c7)[_0xd67f('0x18')](_0x4d4cef);}return null;};}function patchUpdates(_0x4c6cac){return function(_0x119eb6){try{jsonpatch['apply'](_0x119eb6,_0x4c6cac,!![]);}catch(_0xd85e34){return BPromise['reject'](_0xd85e34);}return _0x119eb6['save']();};}function saveUpdates(_0x91f204,_0x567306){return function(_0x428872){if(_0x428872){return _0x428872[_0xd67f('0x1f')](_0x91f204)[_0xd67f('0x20')](function(_0x59e17b){return _0x59e17b;});}return null;};}function removeEntity(_0x141aa0,_0x300e70){return function(_0x2c87f0){if(_0x2c87f0){return _0x2c87f0[_0xd67f('0x21')]()[_0xd67f('0x20')](function(){_0x141aa0[_0xd67f('0x17')](0xcc)[_0xd67f('0x22')]();});}};}function handleEntityNotFound(_0x80e600,_0x141910){return function(_0x5280e3){if(!_0x5280e3){_0x80e600[_0xd67f('0x16')](0x194);}return _0x5280e3;};}function handleError(_0x5dabfa,_0x482490){_0x482490=_0x482490||0x1f4;return function(_0x4b080b){logger['error'](_0x4b080b[_0xd67f('0x23')]);if(_0x4b080b[_0xd67f('0x24')]){delete _0x4b080b['name'];}_0x5dabfa[_0xd67f('0x17')](_0x482490)['send'](_0x4b080b);};}exports[_0xd67f('0x25')]=function(_0x50c9d4,_0x1ce9f2){var _0x15c338={},_0x5ed241={},_0x3b9af7={'count':0x0,'rows':[]};var _0x523067=_[_0xd67f('0x26')](db[_0xd67f('0x27')][_0xd67f('0x28')],function(_0x3214ad){return{'name':_0x3214ad[_0xd67f('0x29')],'type':_0x3214ad[_0xd67f('0x2a')][_0xd67f('0x2b')]};});_0x5ed241[_0xd67f('0x2c')]=_[_0xd67f('0x26')](_0x523067,_0xd67f('0x24'));_0x5ed241[_0xd67f('0x2d')]=_[_0xd67f('0x2e')](_0x50c9d4[_0xd67f('0x2d')]);_0x5ed241[_0xd67f('0x2f')]=_['intersection'](_0x5ed241[_0xd67f('0x2c')],_0x5ed241[_0xd67f('0x2d')]);_0x15c338[_0xd67f('0x30')]=_['intersection'](_0x5ed241[_0xd67f('0x2c')],qs[_0xd67f('0x31')](_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x31')]));_0x15c338[_0xd67f('0x30')]=_0x15c338[_0xd67f('0x30')][_0xd67f('0x32')]?_0x15c338['attributes']:_0x5ed241[_0xd67f('0x2c')];if(!_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x33')](_0xd67f('0x34'))){_0x15c338[_0xd67f('0x1b')]=qs[_0xd67f('0x1b')](_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x1b')]);_0x15c338[_0xd67f('0x19')]=qs[_0xd67f('0x19')](_0x50c9d4['query'][_0xd67f('0x19')]);}_0x15c338[_0xd67f('0x35')]=qs[_0xd67f('0x36')](_0x50c9d4['query'][_0xd67f('0x36')]);_0x15c338['where']=qs[_0xd67f('0x2f')](_[_0xd67f('0x37')](_0x50c9d4[_0xd67f('0x2d')],_0x5ed241[_0xd67f('0x2f')]),_0x523067);if(_0x50c9d4['query'][_0xd67f('0x38')]){_0x15c338[_0xd67f('0x39')]=_[_0xd67f('0x3a')](_0x15c338['where'],{'$or':_['map'](_0x523067,function(_0x1d49b9){if(_0x1d49b9['type']!==_0xd67f('0x3b')){var _0x3a605b={};_0x3a605b[_0x1d49b9['name']]={'$like':'%'+_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x38')]+'%'};return _0x3a605b;}})});}_0x15c338=_['merge']({},_0x15c338,_0x50c9d4[_0xd67f('0x3c')]);var _0x591ea1={'where':_0x15c338[_0xd67f('0x39')]};return db[_0xd67f('0x27')][_0xd67f('0x1c')](_0x591ea1)[_0xd67f('0x20')](function(_0x47e9a7){_0x3b9af7['count']=_0x47e9a7;if(_0x50c9d4[_0xd67f('0x2d')][_0xd67f('0x3d')]){_0x15c338[_0xd67f('0x3e')]=[{'all':!![]}];}return db[_0xd67f('0x27')][_0xd67f('0x3f')](_0x15c338);})[_0xd67f('0x20')](function(_0x52b75d){_0x3b9af7[_0xd67f('0x40')]=_0x52b75d;return _0x3b9af7;})[_0xd67f('0x20')](respondWithFilteredResult(_0x1ce9f2,_0x15c338))['catch'](handleError(_0x1ce9f2,null));};exports['show']=function(_0x124689,_0x183888){var _0x4db422={'raw':![],'where':{'id':_0x124689['params']['id']}},_0x388632={};_0x388632[_0xd67f('0x2c')]=_['keys'](db[_0xd67f('0x27')][_0xd67f('0x28')]);_0x388632[_0xd67f('0x2d')]=_[_0xd67f('0x2e')](_0x124689[_0xd67f('0x2d')]);_0x388632['filters']=_[_0xd67f('0x41')](_0x388632[_0xd67f('0x2c')],_0x388632[_0xd67f('0x2d')]);_0x4db422['attributes']=_[_0xd67f('0x41')](_0x388632[_0xd67f('0x2c')],qs[_0xd67f('0x31')](_0x124689['query'][_0xd67f('0x31')]));_0x4db422[_0xd67f('0x30')]=_0x4db422['attributes']['length']?_0x4db422[_0xd67f('0x30')]:_0x388632[_0xd67f('0x2c')];if(_0x124689[_0xd67f('0x2d')][_0xd67f('0x3d')]){_0x4db422['include']=[{'all':!![]}];}_0x4db422=_['merge']({},_0x4db422,_0x124689[_0xd67f('0x3c')]);return db[_0xd67f('0x27')]['find'](_0x4db422)[_0xd67f('0x20')](handleEntityNotFound(_0x183888,null))[_0xd67f('0x20')](respondWithResult(_0x183888,null))[_0xd67f('0x42')](handleError(_0x183888,null));};exports[_0xd67f('0x43')]=function(_0x468065,_0x132bb0){return db[_0xd67f('0x27')]['create'](_0x468065[_0xd67f('0x44')],{})['then'](respondWithResult(_0x132bb0,0xc9))[_0xd67f('0x42')](handleError(_0x132bb0,null));};exports[_0xd67f('0x1f')]=function(_0x50b59e,_0x39abff){if(_0x50b59e['body']['id']){delete _0x50b59e[_0xd67f('0x44')]['id'];}return db[_0xd67f('0x27')]['find']({'where':{'id':_0x50b59e[_0xd67f('0x45')]['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x39abff,null))['then'](saveUpdates(_0x50b59e[_0xd67f('0x44')],null))['then'](respondWithResult(_0x39abff,null))[_0xd67f('0x42')](handleError(_0x39abff,null));};exports['destroy']=function(_0x4de7aa,_0x306ac4){return db['Automation']['find']({'where':{'id':_0x4de7aa[_0xd67f('0x45')]['id']}})['then'](handleEntityNotFound(_0x306ac4,null))[_0xd67f('0x20')](removeEntity(_0x306ac4,null))[_0xd67f('0x42')](handleError(_0x306ac4,null));};exports[_0xd67f('0x46')]=function(_0x58679c,_0xef7479,_0x15535f){return db[_0xd67f('0x47')][_0xd67f('0x48')]({'where':{'id':_0x58679c['params']['id']}})['then'](handleEntityNotFound(_0xef7479,null))[_0xd67f('0x20')](function(_0x2927bc){if(_0x2927bc){return _0x2927bc['addConditions'](_0x58679c[_0xd67f('0x44')][_0xd67f('0x49')],_[_0xd67f('0x4a')](_0x58679c[_0xd67f('0x44')],['ids','id'])||{});}})[_0xd67f('0x20')](respondWithResult(_0xef7479,null))['catch'](handleError(_0xef7479,null));};exports['getConditions']=function(_0x6f1b63,_0x202ea0,_0xd36305){var _0x4a6569={};var _0x360d7d={};var _0x4b2cc2;var _0xf657dc;return db[_0xd67f('0x27')]['findOne']({'where':{'id':_0x6f1b63['params']['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x202ea0,null))['then'](function(_0x1422e8){if(_0x1422e8){_0x4b2cc2=_0x1422e8;_0x360d7d['model']=_[_0xd67f('0x2e')](db[_0xd67f('0x47')]['rawAttributes']);_0x360d7d[_0xd67f('0x2d')]=_[_0xd67f('0x2e')](_0x6f1b63['query']);_0x360d7d['filters']=_[_0xd67f('0x41')](_0x360d7d[_0xd67f('0x2c')],_0x360d7d[_0xd67f('0x2d')]);_0x4a6569['attributes']=_[_0xd67f('0x41')](_0x360d7d['model'],qs[_0xd67f('0x31')](_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x31')]));_0x4a6569['attributes']=_0x4a6569['attributes']['length']?_0x4a6569[_0xd67f('0x30')]:_0x360d7d['model'];_0x4a6569[_0xd67f('0x35')]=qs['sort'](_0x6f1b63['query']['sort']);_0x4a6569[_0xd67f('0x39')]=qs[_0xd67f('0x2f')](_[_0xd67f('0x37')](_0x6f1b63['query'],_0x360d7d['filters']));if(_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x38')]){_0x4a6569[_0xd67f('0x39')]=_[_0xd67f('0x3a')](_0x4a6569[_0xd67f('0x39')],{'$or':_['map'](_0x4a6569['attributes'],function(_0x5d61b3){var _0x25ed71={};_0x25ed71[_0x5d61b3]={'$like':'%'+_0x6f1b63[_0xd67f('0x2d')]['filter']+'%'};return _0x25ed71;})});}_0x4a6569=_[_0xd67f('0x3a')]({},_0x4a6569,_0x6f1b63['options']);return _0x4b2cc2[_0xd67f('0x4b')](_0x4a6569);}})[_0xd67f('0x20')](function(_0x2f8977){if(_0x2f8977){_0xf657dc=_0x2f8977[_0xd67f('0x32')];if(!_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x33')](_0xd67f('0x34'))){_0x4a6569[_0xd67f('0x1b')]=qs[_0xd67f('0x1b')](_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x1b')]);_0x4a6569[_0xd67f('0x19')]=qs[_0xd67f('0x19')](_0x6f1b63[_0xd67f('0x2d')][_0xd67f('0x19')]);}return _0x4b2cc2[_0xd67f('0x4b')](_0x4a6569);}})[_0xd67f('0x20')](function(_0x397703){if(_0x397703){return _0x397703?{'count':_0xf657dc,'rows':_0x397703}:null;}})[_0xd67f('0x20')](respondWithResult(_0x202ea0,null))[_0xd67f('0x42')](handleError(_0x202ea0,null));};exports['addActions']=function(_0x4efa29,_0x527026,_0x40c7ea){return db['Action']['find']({'where':{'id':_0x4efa29[_0xd67f('0x45')]['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x527026,null))[_0xd67f('0x20')](function(_0x260108){if(_0x260108){return _0x260108[_0xd67f('0x4c')](_0x4efa29[_0xd67f('0x44')]['ids'],_['omit'](_0x4efa29[_0xd67f('0x44')],['ids','id'])||{});}})[_0xd67f('0x20')](respondWithResult(_0x527026,null))[_0xd67f('0x42')](handleError(_0x527026,null));};exports['getActions']=function(_0x54f798,_0x16653f,_0x31c582){var _0x1a17fe={};var _0xbf3df4={};var _0x5a06fa;var _0x457cb8;return db[_0xd67f('0x27')][_0xd67f('0x4d')]({'where':{'id':_0x54f798[_0xd67f('0x45')]['id']}})[_0xd67f('0x20')](handleEntityNotFound(_0x16653f,null))[_0xd67f('0x20')](function(_0x4dce4c){if(_0x4dce4c){_0x5a06fa=_0x4dce4c;_0xbf3df4[_0xd67f('0x2c')]=_[_0xd67f('0x2e')](db[_0xd67f('0x4e')][_0xd67f('0x28')]);_0xbf3df4[_0xd67f('0x2d')]=_['keys'](_0x54f798[_0xd67f('0x2d')]);_0xbf3df4[_0xd67f('0x2f')]=_[_0xd67f('0x41')](_0xbf3df4[_0xd67f('0x2c')],_0xbf3df4[_0xd67f('0x2d')]);_0x1a17fe[_0xd67f('0x30')]=_['intersection'](_0xbf3df4[_0xd67f('0x2c')],qs[_0xd67f('0x31')](_0x54f798[_0xd67f('0x2d')][_0xd67f('0x31')]));_0x1a17fe[_0xd67f('0x30')]=_0x1a17fe[_0xd67f('0x30')][_0xd67f('0x32')]?_0x1a17fe[_0xd67f('0x30')]:_0xbf3df4[_0xd67f('0x2c')];_0x1a17fe['order']=qs[_0xd67f('0x36')](_0x54f798[_0xd67f('0x2d')][_0xd67f('0x36')]);_0x1a17fe[_0xd67f('0x39')]=qs[_0xd67f('0x2f')](_['pick'](_0x54f798['query'],_0xbf3df4[_0xd67f('0x2f')]));if(_0x54f798['query'][_0xd67f('0x38')]){_0x1a17fe[_0xd67f('0x39')]=_[_0xd67f('0x3a')](_0x1a17fe[_0xd67f('0x39')],{'$or':_['map'](_0x1a17fe[_0xd67f('0x30')],function(_0x663a2f){var _0x4ebe3b={};_0x4ebe3b[_0x663a2f]={'$like':'%'+_0x54f798[_0xd67f('0x2d')][_0xd67f('0x38')]+'%'};return _0x4ebe3b;})});}_0x1a17fe=_[_0xd67f('0x3a')]({},_0x1a17fe,_0x54f798[_0xd67f('0x3c')]);return _0x5a06fa[_0xd67f('0x4f')](_0x1a17fe);}})[_0xd67f('0x20')](function(_0x3f0e20){if(_0x3f0e20){_0x457cb8=_0x3f0e20['length'];if(!_0x54f798['query'][_0xd67f('0x33')](_0xd67f('0x34'))){_0x1a17fe[_0xd67f('0x1b')]=qs[_0xd67f('0x1b')](_0x54f798['query']['limit']);_0x1a17fe[_0xd67f('0x19')]=qs['offset'](_0x54f798[_0xd67f('0x2d')]['offset']);}return _0x5a06fa['getActions'](_0x1a17fe);}})[_0xd67f('0x20')](function(_0x17b0dc){if(_0x17b0dc){return _0x17b0dc?{'count':_0x457cb8,'rows':_0x17b0dc}:null;}})[_0xd67f('0x20')](respondWithResult(_0x16653f,null))[_0xd67f('0x42')](handleError(_0x16653f,null));};
\ No newline at end of file
index 7ff2cb3..40129c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ae=['define','Automation','tools_automations','lodash','util','api','request-promise','rimraf','../../config/environment','./automation.attributes'];(function(_0x3e5e4a,_0x222633){var _0x2ed66a=function(_0x47aa9b){while(--_0x47aa9b){_0x3e5e4a['push'](_0x3e5e4a['shift']());}};_0x2ed66a(++_0x222633);}(_0xc7ae,0xad));var _0xec7a=function(_0x3b4e0a,_0x4ff236){_0x3b4e0a=_0x3b4e0a-0x0;var _0x57c16e=_0xc7ae[_0x3b4e0a];return _0x57c16e;};'use strict';var _=require(_0xec7a('0x0'));var util=require(_0xec7a('0x1'));var logger=require('../../config/logger')(_0xec7a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xec7a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec7a('0x4'));var config=require(_0xec7a('0x5'));var attributes=require(_0xec7a('0x6'));module['exports']=function(_0x22a348,_0x29df78){return _0x22a348[_0xec7a('0x7')](_0xec7a('0x8'),attributes,{'tableName':_0xec7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4af5=['request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x174d74,_0x410a71){var _0x480e6c=function(_0x32398e){while(--_0x32398e){_0x174d74['push'](_0x174d74['shift']());}};_0x480e6c(++_0x410a71);}(_0x4af5,0x13c));var _0x54af=function(_0x3206e2,_0x3e0c6b){_0x3206e2=_0x3206e2-0x0;var _0x4b7512=_0x4af5[_0x3206e2];return _0x4b7512;};'use strict';var _=require(_0x54af('0x0'));var util=require(_0x54af('0x1'));var logger=require(_0x54af('0x2'))(_0x54af('0x3'));var moment=require(_0x54af('0x4'));var BPromise=require(_0x54af('0x5'));var rp=require(_0x54af('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54af('0x7'));var config=require(_0x54af('0x8'));var attributes=require(_0x54af('0x9'));module[_0x54af('0xa')]=function(_0x5421ab,_0x6d8c1a){return _0x5421ab[_0x54af('0xb')](_0x54af('0xc'),attributes,{'tableName':_0x54af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc91fb6..adfab2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72d7=['../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x340d9d,_0x3e31c){var _0x595f40=function(_0x1052f9){while(--_0x1052f9){_0x340d9d['push'](_0x340d9d['shift']());}};_0x595f40(++_0x3e31c);}(_0x72d7,0x19b));var _0x772d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x72d7[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x772d('0x0'));var util=require(_0x772d('0x1'));var moment=require(_0x772d('0x2'));var BPromise=require(_0x772d('0x3'));var rs=require(_0x772d('0x4'));var fs=require('fs');var Redis=require(_0x772d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x772d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x772d('0x7'));var jayson=require(_0x772d('0x8'));var client=jayson[_0x772d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5bc4,_0x141516,_0x1daa77){return new BPromise(function(_0x36d077,_0xf6a873){return client[_0x772d('0xa')](_0x1b5bc4,_0x1daa77)[_0x772d('0xb')](function(_0x5e8a53){logger[_0x772d('0xc')]('Automation,\x20%s,\x20%s',_0x141516,'request\x20sent');logger['debug'](_0x772d('0xd'),_0x141516,_0x772d('0xe'),JSON[_0x772d('0xf')](_0x5e8a53));if(_0x5e8a53[_0x772d('0x10')]){if(_0x5e8a53[_0x772d('0x10')][_0x772d('0x11')]===0x1f4){logger[_0x772d('0x10')](_0x772d('0x12'),_0x141516,_0x5e8a53['error'][_0x772d('0x13')]);return _0xf6a873(_0x5e8a53[_0x772d('0x10')][_0x772d('0x13')]);}logger[_0x772d('0x10')](_0x772d('0x12'),_0x141516,_0x5e8a53['error'][_0x772d('0x13')]);return _0x36d077(_0x5e8a53['error']['message']);}else{logger[_0x772d('0xc')](_0x772d('0x12'),_0x141516,'request\x20sent');_0x36d077(_0x5e8a53[_0x772d('0x14')][_0x772d('0x13')]);}})[_0x772d('0x15')](function(_0x53a421){logger[_0x772d('0x10')](_0x772d('0x12'),_0x141516,_0x53a421);_0xf6a873(_0x53a421);});});}
\ No newline at end of file
+var _0x1122=['Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3a956d,_0x5dd981){var _0x19d08f=function(_0x5298d0){while(--_0x5298d0){_0x3a956d['push'](_0x3a956d['shift']());}};_0x19d08f(++_0x5dd981);}(_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});function respondWithRpcPromise(_0xcca285,_0x2ad731,_0x3f0a81){return new BPromise(function(_0x272bdb,_0x4190c7){return client[_0x2112('0x9')](_0xcca285,_0x3f0a81)[_0x2112('0xa')](function(_0x2f7142){logger[_0x2112('0xb')]('Automation,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));logger[_0x2112('0xd')](_0x2112('0xe'),_0x2ad731,_0x2112('0xc'),JSON['stringify'](_0x2f7142));if(_0x2f7142[_0x2112('0xf')]){if(_0x2f7142[_0x2112('0xf')][_0x2112('0x10')]===0x1f4){logger[_0x2112('0xf')](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')][_0x2112('0x12')]);return _0x4190c7(_0x2f7142['error'][_0x2112('0x12')]);}logger['error'](_0x2112('0x11'),_0x2ad731,_0x2f7142[_0x2112('0xf')]['message']);return _0x272bdb(_0x2f7142[_0x2112('0xf')]['message']);}else{logger[_0x2112('0xb')]('Automation,\x20%s,\x20%s',_0x2ad731,_0x2112('0xc'));_0x272bdb(_0x2f7142[_0x2112('0x13')]['message']);}})[_0x2112('0x14')](function(_0x4db5c3){logger[_0x2112('0xf')]('Automation,\x20%s,\x20%s',_0x2ad731,_0x4db5c3);_0x4190c7(_0x4db5c3);});});}
\ No newline at end of file
index 6f28cb5..0009538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13a=['/:id/actions','post','create','addConditions','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe13a,0x178));var _0xae13=function(_0x25382b,_0x1ba4ea){_0x25382b=_0x25382b-0x0;var _0xde3bef=_0xe13a[_0x25382b];return _0xde3bef;};'use strict';var multer=require('multer');var util=require(_0xae13('0x0'));var path=require(_0xae13('0x1'));var timeout=require(_0xae13('0x2'));var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require(_0xae13('0x4'));var auth=require(_0xae13('0x5'));var interaction=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var controller=require(_0xae13('0x8'));router[_0xae13('0x9')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0xb')]);router[_0xae13('0x9')]('/:id',auth[_0xae13('0xa')](),controller[_0xae13('0xc')]);router[_0xae13('0x9')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0xe')]);router[_0xae13('0x9')](_0xae13('0xf'),auth[_0xae13('0xa')](),controller['getActions']);router[_0xae13('0x10')]('/',auth[_0xae13('0xa')](),controller[_0xae13('0x11')]);router[_0xae13('0x10')](_0xae13('0xd'),auth[_0xae13('0xa')](),controller[_0xae13('0x12')]);router['post'](_0xae13('0xf'),auth[_0xae13('0xa')](),controller['addActions']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xae13('0x13')](_0xae13('0x14'),auth[_0xae13('0xa')](),controller[_0xae13('0x15')]);module[_0xae13('0x16')]=router;
\ No newline at end of file
+var _0x3297=['isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x5f12b1,_0x3b19f3){var _0x15573a=function(_0x5efc76){while(--_0x5efc76){_0x5f12b1['push'](_0x5f12b1['shift']());}};_0x15573a(++_0x3b19f3);}(_0x3297,0x19f));var _0x7329=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3297[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var path=require(_0x7329('0x2'));var timeout=require('connect-timeout');var express=require(_0x7329('0x3'));var router=express[_0x7329('0x4')]();var fs_extra=require(_0x7329('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7329('0x6'));var config=require(_0x7329('0x7'));var controller=require(_0x7329('0x8'));router[_0x7329('0x9')]('/',auth[_0x7329('0xa')](),controller[_0x7329('0xb')]);router[_0x7329('0x9')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0xd')]);router[_0x7329('0x9')](_0x7329('0xe'),auth['isAuthenticated'](),controller[_0x7329('0xf')]);router['get'](_0x7329('0x10'),auth['isAuthenticated'](),controller['getActions']);router[_0x7329('0x11')]('/',auth['isAuthenticated'](),controller[_0x7329('0x12')]);router[_0x7329('0x11')](_0x7329('0xe'),auth[_0x7329('0xa')](),controller[_0x7329('0x13')]);router[_0x7329('0x11')]('/:id/actions',auth[_0x7329('0xa')](),controller[_0x7329('0x14')]);router[_0x7329('0x15')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0x16')]);router[_0x7329('0x17')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0x18')]);module['exports']=router;
\ No newline at end of file
index 92f4b6f..2efc049 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf630=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','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)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x3baae5,_0x2cbbaa){var _0xbe608b=function(_0x13325a){while(--_0x13325a){_0x3baae5['push'](_0x3baae5['shift']());}};_0xbe608b(++_0x2cbbaa);}(_0xf630,0xc8));var _0x0f63=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0xf630[_0x5c7525];return _0x2e2ec8;};'use strict';var Sequelize=require(_0x0f63('0x0'));module[_0x0f63('0x1')]={'name':{'type':Sequelize[_0x0f63('0x2')],'unique':_0x0f63('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0f63('0x4')](_0x0f63('0x5')),'allowNull':![],'defaultValue':_0x0f63('0x5')},'description':{'type':Sequelize[_0x0f63('0x2')]},'active':{'type':Sequelize[_0x0f63('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x0f63('0x7')](0x4)[_0x0f63('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0f63('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0f63('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0f63('0x7')](0x3)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0f63('0x7')](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0f63('0x7')](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f63('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0f63('0x7')](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0f63('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0f63('0x2')],'defaultValue':_0x0f63('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x0f63('0x4')](_0x0f63('0xf'),'never',_0x0f63('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0f63('0x6')],'defaultValue':0x0,'comment':_0x0f63('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x0f63('0x7')](0x9)[_0x0f63('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0f63('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x0f63('0x7')](0x9)[_0x0f63('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0f63('0x7')](0x9)[_0x0f63('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0f63('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0f63('0x7')](0x9)[_0x0f63('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f63('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0f63('0x7')](0x9)[_0x0f63('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0f63('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0f63('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0f63('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0f63('0x7')](0x9)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0f63('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x0f63('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0f63('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0f63('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0f63('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0f63('0x1a'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0f63('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x0f63('0x7')](0x3)[_0x0f63('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0f63('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f63('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f63('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f63('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x0f63('0x7')](0x3)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0f63('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0f63('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0f63('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0f63('0x7')](0x5)[_0x0f63('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xdc6b=['sequelize','STRING','name','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','onlyIfOpen','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\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)'];(function(_0x232f9c,_0x3ae9df){var _0x24bb71=function(_0x4fb958){while(--_0x4fb958){_0x232f9c['push'](_0x232f9c['shift']());}};_0x24bb71(++_0x3ae9df);}(_0xdc6b,0xde));var _0xbdc6=function(_0x1305e3,_0x43a724){_0x1305e3=_0x1305e3-0x0;var _0x1068e9=_0xdc6b[_0x1305e3];return _0x1068e9;};'use strict';var Sequelize=require(_0xbdc6('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdc6('0x1')],'unique':_0xbdc6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xbdc6('0x3')),'allowNull':![],'defaultValue':_0xbdc6('0x3')},'description':{'type':Sequelize[_0xbdc6('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xbdc6('0x4')},'limitCalls':{'type':Sequelize[_0xbdc6('0x5')](0x4)[_0xbdc6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xbdc6('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xbdc6('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbdc6('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbdc6('0xe')},'dialTimezone':{'type':Sequelize[_0xbdc6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbdc6('0x1')],'defaultValue':_0xbdc6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xbdc6('0x10')]('always','never',_0xbdc6('0x11')),'defaultValue':_0xbdc6('0x12')},'dialAMDActive':{'type':Sequelize[_0xbdc6('0x13')],'defaultValue':0x0,'comment':_0xbdc6('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xbdc6('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbdc6('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xbdc6('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbdc6('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbdc6('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbdc6('0x5')](0x9)[_0xbdc6('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbdc6('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbdc6('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xbdc6('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbdc6('0x5')](0x9)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbdc6('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xbdc6('0x5')](0x9)[_0xbdc6('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbdc6('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xbdc6('0x1b'),_0xbdc6('0x1c')),'defaultValue':_0xbdc6('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbdc6('0x1d')},'dialCutDigit':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbdc6('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xbdc6('0x5')](0x3)[_0xbdc6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)[_0xbdc6('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbdc6('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbdc6('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbdc6('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
index 26f4cd2..9dd1e35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c3f=['apply','reject','update','then','destroy','get','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','Campaign','findAll','catch','params','intersection','include','find','create','body','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','hasOwnProperty','nolimit','rows','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','ids','omit','spread','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','insert','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','set','Content-Range','json'];(function(_0x201266,_0x506565){var _0x3a1230=function(_0x36dd84){while(--_0x36dd84){_0x201266['push'](_0x201266['shift']());}};_0x3a1230(++_0x506565);}(_0x4c3f,0x65));var _0xf4c3=function(_0x196e40,_0xeb91d){_0x196e40=_0x196e40-0x0;var _0x4b81c5=_0x4c3f[_0x196e40];return _0x4b81c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4c3('0x0'));var zipdir=require(_0xf4c3('0x1'));var jsonpatch=require(_0xf4c3('0x2'));var rp=require(_0xf4c3('0x3'));var moment=require(_0xf4c3('0x4'));var BPromise=require(_0xf4c3('0x5'));var Mustache=require(_0xf4c3('0x6'));var util=require(_0xf4c3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf4c3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4c3('0x9'));var _=require(_0xf4c3('0xa'));var squel=require(_0xf4c3('0xb'));var crypto=require(_0xf4c3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf4c3('0xd'));var toCsv=require(_0xf4c3('0x8'));var querystring=require('querystring');var Papa=require(_0xf4c3('0xe'));var Redis=require(_0xf4c3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf4c3('0x10'));var as=require(_0xf4c3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4c3('0x12'))(_0xf4c3('0x13'));var utils=require(_0xf4c3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf4c3('0x15'));var db=require(_0xf4c3('0x16'))['db'];function respondWithStatusCode(_0x2c9d7e,_0x3e17c7){_0x3e17c7=_0x3e17c7||0xcc;return function(_0x459c75){if(_0x459c75){return _0x2c9d7e[_0xf4c3('0x17')](_0x3e17c7);}return _0x2c9d7e['status'](_0x3e17c7)[_0xf4c3('0x18')]();};}function respondWithResult(_0x466c19,_0x537cd2){_0x537cd2=_0x537cd2||0xc8;return function(_0x53b16a){if(_0x53b16a){return _0x466c19[_0xf4c3('0x19')](_0x537cd2)['json'](_0x53b16a);}};}function respondWithFilteredResult(_0xb19c54,_0x2db08e){return function(_0x5ab95e){if(_0x5ab95e){var _0x524d7e=typeof _0x2db08e[_0xf4c3('0x1a')]==='undefined'&&typeof _0x2db08e[_0xf4c3('0x1b')]==='undefined';var _0x1f04f5=_0x5ab95e[_0xf4c3('0x1c')];var _0x14b5f6=_0x524d7e?0x0:_0x2db08e['offset'];var _0x2fe69=_0x524d7e?_0x5ab95e['count']:_0x2db08e[_0xf4c3('0x1a')]+_0x2db08e[_0xf4c3('0x1b')];var _0x56bb8d;if(_0x2fe69>=_0x1f04f5){_0x2fe69=_0x1f04f5;_0x56bb8d=0xc8;}else{_0x56bb8d=0xce;}_0xb19c54[_0xf4c3('0x19')](_0x56bb8d);return _0xb19c54[_0xf4c3('0x1d')](_0xf4c3('0x1e'),_0x14b5f6+'-'+_0x2fe69+'/'+_0x1f04f5)[_0xf4c3('0x1f')](_0x5ab95e);}return null;};}function patchUpdates(_0x78f4c4){return function(_0x6cd751){try{jsonpatch[_0xf4c3('0x20')](_0x6cd751,_0x78f4c4,!![]);}catch(_0x2558a9){return BPromise[_0xf4c3('0x21')](_0x2558a9);}return _0x6cd751['save']();};}function saveUpdates(_0x18b520,_0x3c667a){return function(_0xae5d0a){if(_0xae5d0a){return _0xae5d0a[_0xf4c3('0x22')](_0x18b520)[_0xf4c3('0x23')](function(_0x4d2fb4){return _0x4d2fb4;});}return null;};}function removeEntity(_0x1ee9ed,_0x53702c){return function(_0x37c15c){if(_0x37c15c){return _0x37c15c[_0xf4c3('0x24')]()[_0xf4c3('0x23')](function(){var _0x1dcfcb=_0x37c15c[_0xf4c3('0x25')]({'plain':!![]});var _0x53fd0b='IvrCampaigns';return db[_0xf4c3('0x26')][_0xf4c3('0x24')]({'where':{'type':_0x53fd0b,'resourceId':_0x1dcfcb['id']}})['then'](function(){return _0x37c15c;});})[_0xf4c3('0x23')](function(){_0x1ee9ed['status'](0xcc)[_0xf4c3('0x18')]();});}};}function handleEntityNotFound(_0x473a31,_0x3dbadf){return function(_0x53ca74){if(!_0x53ca74){_0x473a31[_0xf4c3('0x17')](0x194);}return _0x53ca74;};}function handleError(_0x32f184,_0x1284a7){_0x1284a7=_0x1284a7||0x1f4;return function(_0x250ca4){logger[_0xf4c3('0x27')](_0x250ca4['stack']);if(_0x250ca4[_0xf4c3('0x28')]){delete _0x250ca4[_0xf4c3('0x28')];}_0x32f184[_0xf4c3('0x19')](_0x1284a7)[_0xf4c3('0x29')](_0x250ca4);};}exports[_0xf4c3('0x2a')]=function(_0xe2f023,_0x36eebc){var _0x2c51af={},_0x49277d={},_0xe8cccb={'count':0x0,'rows':[]};var _0x1904da=_['map'](db['Campaign'][_0xf4c3('0x2b')],function(_0x56fa73){return{'name':_0x56fa73[_0xf4c3('0x2c')],'type':_0x56fa73[_0xf4c3('0x2d')][_0xf4c3('0x2e')]};});_0x49277d[_0xf4c3('0x2f')]=_[_0xf4c3('0x30')](_0x1904da,_0xf4c3('0x28'));_0x49277d[_0xf4c3('0x31')]=_[_0xf4c3('0x32')](_0xe2f023[_0xf4c3('0x31')]);_0x49277d[_0xf4c3('0x33')]=_['intersection'](_0x49277d['model'],_0x49277d[_0xf4c3('0x31')]);_0x2c51af[_0xf4c3('0x34')]=_['intersection'](_0x49277d[_0xf4c3('0x2f')],qs[_0xf4c3('0x35')](_0xe2f023['query'][_0xf4c3('0x35')]));_0x2c51af[_0xf4c3('0x34')]=_0x2c51af[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0x2c51af[_0xf4c3('0x34')]:_0x49277d[_0xf4c3('0x2f')];if(!_0xe2f023[_0xf4c3('0x31')]['hasOwnProperty']('nolimit')){_0x2c51af['limit']=qs[_0xf4c3('0x1b')](_0xe2f023['query']['limit']);_0x2c51af['offset']=qs['offset'](_0xe2f023[_0xf4c3('0x31')][_0xf4c3('0x1a')]);}_0x2c51af[_0xf4c3('0x37')]=qs[_0xf4c3('0x38')](_0xe2f023[_0xf4c3('0x31')][_0xf4c3('0x38')]);_0x2c51af[_0xf4c3('0x39')]=qs[_0xf4c3('0x33')](_[_0xf4c3('0x3a')](_0xe2f023[_0xf4c3('0x31')],_0x49277d[_0xf4c3('0x33')]),_0x1904da);if(_0xe2f023['query'][_0xf4c3('0x3b')]){_0x2c51af[_0xf4c3('0x39')]=_['merge'](_0x2c51af[_0xf4c3('0x39')],{'$or':_[_0xf4c3('0x30')](_0x1904da,function(_0xafd827){if(_0xafd827['type']!==_0xf4c3('0x3c')){var _0x4bf612={};_0x4bf612[_0xafd827[_0xf4c3('0x28')]]={'$like':'%'+_0xe2f023[_0xf4c3('0x31')]['filter']+'%'};return _0x4bf612;}})});}_0x2c51af=_[_0xf4c3('0x3d')]({},_0x2c51af,_0xe2f023[_0xf4c3('0x3e')]);var _0x9d8dea={'where':_0x2c51af[_0xf4c3('0x39')]};return db['Campaign'][_0xf4c3('0x1c')](_0x9d8dea)[_0xf4c3('0x23')](function(_0x182797){_0xe8cccb[_0xf4c3('0x1c')]=_0x182797;if(_0xe2f023[_0xf4c3('0x31')][_0xf4c3('0x3f')]){_0x2c51af['include']=[{'all':!![]}];}return db[_0xf4c3('0x40')][_0xf4c3('0x41')](_0x2c51af);})[_0xf4c3('0x23')](function(_0x289980){_0xe8cccb['rows']=_0x289980;return _0xe8cccb;})['then'](respondWithFilteredResult(_0x36eebc,_0x2c51af))[_0xf4c3('0x42')](handleError(_0x36eebc,null));};exports['show']=function(_0x270a7f,_0x53fef4){var _0x320114={'raw':![],'where':{'id':_0x270a7f[_0xf4c3('0x43')]['id']}},_0x510c1b={};_0x510c1b[_0xf4c3('0x2f')]=_[_0xf4c3('0x32')](db[_0xf4c3('0x40')][_0xf4c3('0x2b')]);_0x510c1b['query']=_['keys'](_0x270a7f[_0xf4c3('0x31')]);_0x510c1b[_0xf4c3('0x33')]=_[_0xf4c3('0x44')](_0x510c1b['model'],_0x510c1b[_0xf4c3('0x31')]);_0x320114[_0xf4c3('0x34')]=_[_0xf4c3('0x44')](_0x510c1b['model'],qs[_0xf4c3('0x35')](_0x270a7f['query'][_0xf4c3('0x35')]));_0x320114[_0xf4c3('0x34')]=_0x320114[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0x320114[_0xf4c3('0x34')]:_0x510c1b[_0xf4c3('0x2f')];if(_0x270a7f['query'][_0xf4c3('0x3f')]){_0x320114[_0xf4c3('0x45')]=[{'all':!![]}];}_0x320114=_[_0xf4c3('0x3d')]({},_0x320114,_0x270a7f[_0xf4c3('0x3e')]);return db[_0xf4c3('0x40')][_0xf4c3('0x46')](_0x320114)['then'](handleEntityNotFound(_0x53fef4,null))['then'](respondWithResult(_0x53fef4,null))['catch'](handleError(_0x53fef4,null));};exports[_0xf4c3('0x47')]=function(_0x171390,_0x1e45c9){return db['Campaign'][_0xf4c3('0x47')](_0x171390[_0xf4c3('0x48')],{})[_0xf4c3('0x23')](function(_0x59fb23){var _0xe09373=_0x171390['user'][_0xf4c3('0x25')]({'plain':!![]});if(!_0xe09373)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe09373[_0xf4c3('0x49')]==='user'){var _0x411be0=_0x59fb23[_0xf4c3('0x25')]({'plain':!![]});var _0x49d0ee=_0xf4c3('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x49d0ee,'userProfileId':_0xe09373[_0xf4c3('0x4b')]},'raw':!![]})['then'](function(_0x490756){if(_0x490756&&_0x490756[_0xf4c3('0x4c')]===0x0){return db[_0xf4c3('0x26')][_0xf4c3('0x47')]({'name':_0x411be0[_0xf4c3('0x28')],'resourceId':_0x411be0['id'],'type':_0x490756[_0xf4c3('0x28')],'sectionId':_0x490756['id']},{})[_0xf4c3('0x23')](function(){return _0x59fb23;});}else{return _0x59fb23;}})[_0xf4c3('0x42')](function(_0x5a1ed2){logger[_0xf4c3('0x27')](_0xf4c3('0x4d'),_0x5a1ed2);throw _0x5a1ed2;});}return _0x59fb23;})['then'](respondWithResult(_0x1e45c9,0xc9))[_0xf4c3('0x42')](handleError(_0x1e45c9,null));};exports[_0xf4c3('0x4e')]=function(_0x12a05c,_0x3fc65c){var _0x391a13={'where':{'id':_0x12a05c[_0xf4c3('0x43')]['id']}},_0x436c6f={};_0x436c6f[_0xf4c3('0x2f')]=_[_0xf4c3('0x32')](db[_0xf4c3('0x40')][_0xf4c3('0x2b')]);_0x391a13[_0xf4c3('0x34')]=_['intersection'](_0x436c6f[_0xf4c3('0x2f')],qs['fields'](_0x12a05c[_0xf4c3('0x31')]['fields']));_0x391a13[_0xf4c3('0x34')]=_0x391a13[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0x391a13[_0xf4c3('0x34')]:_0x436c6f[_0xf4c3('0x2f')];if(_0x12a05c[_0xf4c3('0x31')][_0xf4c3('0x3f')]){_0x391a13[_0xf4c3('0x45')]=[{'all':!![]}];}_0x391a13=_['merge']({},_0x391a13,_0x12a05c[_0xf4c3('0x3e')]);return db[_0xf4c3('0x40')][_0xf4c3('0x46')](_0x391a13)[_0xf4c3('0x23')](handleEntityNotFound(_0x3fc65c,null))['then'](function(_0x2b78fe){if(_0x2b78fe){var _0x2b06b5=_0x2b78fe[_0xf4c3('0x25')]({'plain':!![]});_0x2b06b5=qs['omit'](_0x2b06b5,['id','createdAt',_0xf4c3('0x4f')]);_0x12a05c[_0xf4c3('0x48')]=_['omit'](_0x12a05c[_0xf4c3('0x48')],['id',_0xf4c3('0x50'),'updatedAt']);return db[_0xf4c3('0x40')][_0xf4c3('0x47')](_[_0xf4c3('0x3d')](_0x2b06b5,_0x12a05c[_0xf4c3('0x48')]),{'include':_0x12a05c[_0xf4c3('0x31')][_0xf4c3('0x3f')]?[{'all':!![]}]:undefined})[_0xf4c3('0x23')](function(_0x5c0407){var _0x537dee=_0x12a05c[_0xf4c3('0x51')][_0xf4c3('0x25')]({'plain':!![]});if(!_0x537dee)throw new Error(_0xf4c3('0x52'));if(_0x537dee[_0xf4c3('0x49')]===_0xf4c3('0x51')){var _0x49ebe6=_0x5c0407[_0xf4c3('0x25')]({'plain':!![]});var _0x5f5c9f=_0xf4c3('0x4a');return db['UserProfileSection'][_0xf4c3('0x46')]({'where':{'name':_0x5f5c9f,'userProfileId':_0x537dee[_0xf4c3('0x4b')]},'raw':!![]})[_0xf4c3('0x23')](function(_0x9fc380){if(_0x9fc380&&_0x9fc380[_0xf4c3('0x4c')]===0x0){return db[_0xf4c3('0x26')][_0xf4c3('0x47')]({'name':_0x49ebe6[_0xf4c3('0x28')],'resourceId':_0x49ebe6['id'],'type':_0x9fc380['name'],'sectionId':_0x9fc380['id']},{})[_0xf4c3('0x23')](function(){return _0x5c0407;});}else{return _0x5c0407;}})[_0xf4c3('0x42')](function(_0x9cbaf2){logger[_0xf4c3('0x27')](_0xf4c3('0x4d'),_0x9cbaf2);throw _0x9cbaf2;});}return _0x5c0407;});}})[_0xf4c3('0x23')](respondWithResult(_0x3fc65c,0xc9))[_0xf4c3('0x42')](handleError(_0x3fc65c,null));};exports[_0xf4c3('0x22')]=function(_0x409a18,_0x590858){if(_0x409a18[_0xf4c3('0x48')]['id']){delete _0x409a18[_0xf4c3('0x48')]['id'];}return db['Campaign'][_0xf4c3('0x46')]({'where':{'id':_0x409a18['params']['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x590858,null))[_0xf4c3('0x23')](saveUpdates(_0x409a18[_0xf4c3('0x48')],null))[_0xf4c3('0x23')](respondWithResult(_0x590858,null))[_0xf4c3('0x42')](handleError(_0x590858,null));};exports[_0xf4c3('0x24')]=function(_0x1d215a,_0x532bd3){return db[_0xf4c3('0x40')][_0xf4c3('0x46')]({'where':{'id':_0x1d215a[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x532bd3,null))[_0xf4c3('0x23')](removeEntity(_0x532bd3,null))[_0xf4c3('0x42')](handleError(_0x532bd3,null));};exports[_0xf4c3('0x53')]=function(_0x5c3175,_0x573bd3,_0xea63f0){var _0x3dd777={'raw':!![],'where':{}};var _0xa5c585={};var _0x3e1f72={'count':0x0,'rows':[]};return db[_0xf4c3('0x40')]['findOne']({'where':{'id':_0x5c3175[_0xf4c3('0x43')]['id']}})['then'](handleEntityNotFound(_0x573bd3,null))[_0xf4c3('0x23')](function(_0x561cbe){if(_0x561cbe){_0xa5c585[_0xf4c3('0x2f')]=_[_0xf4c3('0x32')](db[_0xf4c3('0x54')][_0xf4c3('0x2b')]);_0xa5c585[_0xf4c3('0x31')]=_['keys'](_0x5c3175[_0xf4c3('0x31')]);_0xa5c585['filters']=_[_0xf4c3('0x44')](_0xa5c585['model'],_0xa5c585[_0xf4c3('0x31')]);_0x3dd777[_0xf4c3('0x34')]=_[_0xf4c3('0x44')](_0xa5c585[_0xf4c3('0x2f')],qs[_0xf4c3('0x35')](_0x5c3175[_0xf4c3('0x31')][_0xf4c3('0x35')]));_0x3dd777['attributes']=_0x3dd777['attributes']['length']?_0x3dd777[_0xf4c3('0x34')]:_0xa5c585[_0xf4c3('0x2f')];if(!_0x5c3175[_0xf4c3('0x31')][_0xf4c3('0x55')](_0xf4c3('0x56'))){_0x3dd777['limit']=qs[_0xf4c3('0x1b')](_0x5c3175['query']['limit']);_0x3dd777['offset']=qs[_0xf4c3('0x1a')](_0x5c3175['query']['offset']);}_0x3dd777['order']=qs['sort'](_0x5c3175[_0xf4c3('0x31')][_0xf4c3('0x38')]);_0x3dd777['where']=qs[_0xf4c3('0x33')](_[_0xf4c3('0x3a')](_0x5c3175[_0xf4c3('0x31')],_0xa5c585['filters']));_0x3dd777[_0xf4c3('0x39')]['CampaignId']=_0x561cbe['id'];if(_0x5c3175[_0xf4c3('0x31')][_0xf4c3('0x3b')]){_0x3dd777[_0xf4c3('0x39')]=_['merge'](_0x3dd777['where'],{'$or':_[_0xf4c3('0x30')](_0x3dd777[_0xf4c3('0x34')],function(_0x5d3b7c){var _0x861aff={};_0x861aff[_0x5d3b7c]={'$like':'%'+_0x5c3175['query'][_0xf4c3('0x3b')]+'%'};return _0x861aff;})});}_0x3dd777=_[_0xf4c3('0x3d')]({},_0x3dd777,_0x5c3175['options']);return db['CmHopper'][_0xf4c3('0x1c')]({'where':_0x3dd777['where']})[_0xf4c3('0x23')](function(_0x33c40e){_0x3e1f72[_0xf4c3('0x1c')]=_0x33c40e;if(_0x5c3175[_0xf4c3('0x31')][_0xf4c3('0x3f')]){_0x3dd777[_0xf4c3('0x45')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3dd777);})[_0xf4c3('0x23')](function(_0x3c4db0){_0x3e1f72[_0xf4c3('0x57')]=_0x3c4db0;return _0x3e1f72;});}})[_0xf4c3('0x23')](respondWithFilteredResult(_0x573bd3,_0x3dd777))['catch'](handleError(_0x573bd3,null));};exports[_0xf4c3('0x58')]=function(_0x3756c5,_0x4cfa00,_0x422376){var _0xd2bc05={'raw':!![],'where':{}};var _0xbdb314={};var _0x1b49d4={'count':0x0,'rows':[]};return db[_0xf4c3('0x40')][_0xf4c3('0x59')]({'where':{'id':_0x3756c5[_0xf4c3('0x43')]['id']}})['then'](handleEntityNotFound(_0x4cfa00,null))[_0xf4c3('0x23')](function(_0x2cb423){if(_0x2cb423){_0xbdb314[_0xf4c3('0x2f')]=_[_0xf4c3('0x32')](db[_0xf4c3('0x5a')][_0xf4c3('0x2b')]);_0xbdb314[_0xf4c3('0x31')]=_[_0xf4c3('0x32')](_0x3756c5[_0xf4c3('0x31')]);_0xbdb314[_0xf4c3('0x33')]=_[_0xf4c3('0x44')](_0xbdb314[_0xf4c3('0x2f')],_0xbdb314[_0xf4c3('0x31')]);_0xd2bc05['attributes']=_[_0xf4c3('0x44')](_0xbdb314[_0xf4c3('0x2f')],qs[_0xf4c3('0x35')](_0x3756c5[_0xf4c3('0x31')]['fields']));_0xd2bc05['attributes']=_0xd2bc05[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0xd2bc05[_0xf4c3('0x34')]:_0xbdb314['model'];if(!_0x3756c5[_0xf4c3('0x31')][_0xf4c3('0x55')](_0xf4c3('0x56'))){_0xd2bc05['limit']=qs['limit'](_0x3756c5[_0xf4c3('0x31')][_0xf4c3('0x1b')]);_0xd2bc05[_0xf4c3('0x1a')]=qs[_0xf4c3('0x1a')](_0x3756c5[_0xf4c3('0x31')]['offset']);}_0xd2bc05[_0xf4c3('0x37')]=qs['sort'](_0x3756c5[_0xf4c3('0x31')][_0xf4c3('0x38')]);_0xd2bc05[_0xf4c3('0x39')]=qs[_0xf4c3('0x33')](_['pick'](_0x3756c5[_0xf4c3('0x31')],_0xbdb314[_0xf4c3('0x33')]));_0xd2bc05[_0xf4c3('0x39')][_0xf4c3('0x5b')]=_0x2cb423['id'];if(_0x3756c5[_0xf4c3('0x31')]['filter']){_0xd2bc05[_0xf4c3('0x39')]=_['merge'](_0xd2bc05['where'],{'$or':_[_0xf4c3('0x30')](_0xd2bc05[_0xf4c3('0x34')],function(_0x451538){var _0x414b96={};_0x414b96[_0x451538]={'$like':'%'+_0x3756c5[_0xf4c3('0x31')][_0xf4c3('0x3b')]+'%'};return _0x414b96;})});}_0xd2bc05=_[_0xf4c3('0x3d')]({},_0xd2bc05,_0x3756c5[_0xf4c3('0x3e')]);return db[_0xf4c3('0x5a')][_0xf4c3('0x1c')]({'where':_0xd2bc05[_0xf4c3('0x39')]})[_0xf4c3('0x23')](function(_0x2e9a7f){_0x1b49d4[_0xf4c3('0x1c')]=_0x2e9a7f;if(_0x3756c5[_0xf4c3('0x31')]['includeAll']){_0xd2bc05[_0xf4c3('0x45')]=[{'all':!![]}];}return db[_0xf4c3('0x5a')][_0xf4c3('0x41')](_0xd2bc05);})['then'](function(_0x95d8ae){_0x1b49d4[_0xf4c3('0x57')]=_0x95d8ae;return _0x1b49d4;});}})[_0xf4c3('0x23')](respondWithFilteredResult(_0x4cfa00,_0xd2bc05))['catch'](handleError(_0x4cfa00,null));};exports[_0xf4c3('0x5c')]=function(_0x76a842,_0x1c5a85,_0x479ee2){var _0x43fa5a={'raw':!![],'where':{}};var _0x581442={};var _0x57a498={'count':0x0,'rows':[]};return db[_0xf4c3('0x40')][_0xf4c3('0x59')]({'where':{'id':_0x76a842[_0xf4c3('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c5a85,null))['then'](function(_0x1db407){if(_0x1db407){_0x581442[_0xf4c3('0x2f')]=_[_0xf4c3('0x32')](db[_0xf4c3('0x5d')][_0xf4c3('0x2b')]);_0x581442['query']=_[_0xf4c3('0x32')](_0x76a842[_0xf4c3('0x31')]);_0x581442[_0xf4c3('0x33')]=_[_0xf4c3('0x44')](_0x581442[_0xf4c3('0x2f')],_0x581442[_0xf4c3('0x31')]);_0x43fa5a['attributes']=_[_0xf4c3('0x44')](_0x581442[_0xf4c3('0x2f')],qs[_0xf4c3('0x35')](_0x76a842[_0xf4c3('0x31')][_0xf4c3('0x35')]));_0x43fa5a['attributes']=_0x43fa5a['attributes'][_0xf4c3('0x36')]?_0x43fa5a[_0xf4c3('0x34')]:_0x581442[_0xf4c3('0x2f')];if(!_0x76a842[_0xf4c3('0x31')][_0xf4c3('0x55')](_0xf4c3('0x56'))){_0x43fa5a['limit']=qs[_0xf4c3('0x1b')](_0x76a842[_0xf4c3('0x31')][_0xf4c3('0x1b')]);_0x43fa5a[_0xf4c3('0x1a')]=qs['offset'](_0x76a842['query'][_0xf4c3('0x1a')]);}_0x43fa5a['order']=qs[_0xf4c3('0x38')](_0x76a842[_0xf4c3('0x31')]['sort']);_0x43fa5a[_0xf4c3('0x39')]=qs['filters'](_[_0xf4c3('0x3a')](_0x76a842[_0xf4c3('0x31')],_0x581442['filters']));_0x43fa5a[_0xf4c3('0x39')][_0xf4c3('0x5b')]=_0x1db407['id'];if(_0x76a842[_0xf4c3('0x31')][_0xf4c3('0x3b')]){_0x43fa5a[_0xf4c3('0x39')]=_[_0xf4c3('0x3d')](_0x43fa5a['where'],{'$or':_[_0xf4c3('0x30')](_0x43fa5a[_0xf4c3('0x34')],function(_0x51e692){var _0x365cec={};_0x365cec[_0x51e692]={'$like':'%'+_0x76a842[_0xf4c3('0x31')][_0xf4c3('0x3b')]+'%'};return _0x365cec;})});}_0x43fa5a=_[_0xf4c3('0x3d')]({},_0x43fa5a,_0x76a842[_0xf4c3('0x3e')]);return db[_0xf4c3('0x5d')][_0xf4c3('0x1c')]({'where':_0x43fa5a[_0xf4c3('0x39')]})[_0xf4c3('0x23')](function(_0x227c6f){_0x57a498[_0xf4c3('0x1c')]=_0x227c6f;if(_0x76a842[_0xf4c3('0x31')][_0xf4c3('0x3f')]){_0x43fa5a[_0xf4c3('0x45')]=[{'all':!![]}];}return db[_0xf4c3('0x5d')][_0xf4c3('0x41')](_0x43fa5a);})['then'](function(_0xe7ebde){_0x57a498[_0xf4c3('0x57')]=_0xe7ebde;return _0x57a498;});}})[_0xf4c3('0x23')](respondWithFilteredResult(_0x1c5a85,_0x43fa5a))[_0xf4c3('0x42')](handleError(_0x1c5a85,null));};exports['getHopperBlacks']=function(_0x33e883,_0x518280,_0x1b47f4){var _0x4d511f={'raw':!![],'where':{}};var _0x1f31f9={};var _0xa1b50f={'count':0x0,'rows':[]};return db[_0xf4c3('0x40')][_0xf4c3('0x59')]({'where':{'id':_0x33e883[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x518280,null))['then'](function(_0x2629b0){if(_0x2629b0){_0x1f31f9[_0xf4c3('0x2f')]=_[_0xf4c3('0x32')](db[_0xf4c3('0x5e')][_0xf4c3('0x2b')]);_0x1f31f9[_0xf4c3('0x31')]=_['keys'](_0x33e883['query']);_0x1f31f9['filters']=_[_0xf4c3('0x44')](_0x1f31f9[_0xf4c3('0x2f')],_0x1f31f9['query']);_0x4d511f[_0xf4c3('0x34')]=_[_0xf4c3('0x44')](_0x1f31f9[_0xf4c3('0x2f')],qs[_0xf4c3('0x35')](_0x33e883['query'][_0xf4c3('0x35')]));_0x4d511f[_0xf4c3('0x34')]=_0x4d511f[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0x4d511f[_0xf4c3('0x34')]:_0x1f31f9[_0xf4c3('0x2f')];if(!_0x33e883[_0xf4c3('0x31')]['hasOwnProperty'](_0xf4c3('0x56'))){_0x4d511f['limit']=qs['limit'](_0x33e883[_0xf4c3('0x31')][_0xf4c3('0x1b')]);_0x4d511f[_0xf4c3('0x1a')]=qs['offset'](_0x33e883[_0xf4c3('0x31')][_0xf4c3('0x1a')]);}_0x4d511f[_0xf4c3('0x37')]=qs['sort'](_0x33e883[_0xf4c3('0x31')]['sort']);_0x4d511f['where']=qs['filters'](_['pick'](_0x33e883[_0xf4c3('0x31')],_0x1f31f9[_0xf4c3('0x33')]));_0x4d511f[_0xf4c3('0x39')][_0xf4c3('0x5b')]=_0x2629b0['id'];if(_0x33e883[_0xf4c3('0x31')][_0xf4c3('0x3b')]){_0x4d511f[_0xf4c3('0x39')]=_[_0xf4c3('0x3d')](_0x4d511f[_0xf4c3('0x39')],{'$or':_[_0xf4c3('0x30')](_0x4d511f[_0xf4c3('0x34')],function(_0x1a0ba2){var _0x3674a6={};_0x3674a6[_0x1a0ba2]={'$like':'%'+_0x33e883[_0xf4c3('0x31')][_0xf4c3('0x3b')]+'%'};return _0x3674a6;})});}_0x4d511f=_['merge']({},_0x4d511f,_0x33e883[_0xf4c3('0x3e')]);return db[_0xf4c3('0x5e')][_0xf4c3('0x1c')]({'where':_0x4d511f[_0xf4c3('0x39')]})[_0xf4c3('0x23')](function(_0x353e6c){_0xa1b50f[_0xf4c3('0x1c')]=_0x353e6c;if(_0x33e883[_0xf4c3('0x31')]['includeAll']){_0x4d511f[_0xf4c3('0x45')]=[{'all':!![]}];}return db[_0xf4c3('0x5e')][_0xf4c3('0x41')](_0x4d511f);})[_0xf4c3('0x23')](function(_0x16bef5){_0xa1b50f['rows']=_0x16bef5;return _0xa1b50f;});}})[_0xf4c3('0x23')](respondWithFilteredResult(_0x518280,_0x4d511f))[_0xf4c3('0x42')](handleError(_0x518280,null));};exports[_0xf4c3('0x5f')]=function(_0x4fa870,_0x3abe63,_0x19730d){var _0x160dc0={};var _0x23d5c5={};var _0x159f3e;var _0x247979;return db[_0xf4c3('0x40')][_0xf4c3('0x59')]({'where':{'id':_0x4fa870[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x3abe63,null))[_0xf4c3('0x23')](function(_0x4f17d6){if(_0x4f17d6){_0x159f3e=_0x4f17d6;_0x23d5c5[_0xf4c3('0x2f')]=_['keys'](db['CmList'][_0xf4c3('0x2b')]);_0x23d5c5[_0xf4c3('0x31')]=_['keys'](_0x4fa870[_0xf4c3('0x31')]);_0x23d5c5[_0xf4c3('0x33')]=_[_0xf4c3('0x44')](_0x23d5c5[_0xf4c3('0x2f')],_0x23d5c5[_0xf4c3('0x31')]);_0x160dc0[_0xf4c3('0x34')]=_[_0xf4c3('0x44')](_0x23d5c5['model'],qs[_0xf4c3('0x35')](_0x4fa870[_0xf4c3('0x31')]['fields']));_0x160dc0[_0xf4c3('0x34')]=_0x160dc0[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0x160dc0[_0xf4c3('0x34')]:_0x23d5c5['model'];_0x160dc0[_0xf4c3('0x37')]=qs['sort'](_0x4fa870[_0xf4c3('0x31')][_0xf4c3('0x38')]);_0x160dc0[_0xf4c3('0x39')]=qs[_0xf4c3('0x33')](_[_0xf4c3('0x3a')](_0x4fa870[_0xf4c3('0x31')],_0x23d5c5[_0xf4c3('0x33')]));if(_0x4fa870[_0xf4c3('0x31')][_0xf4c3('0x3b')]){_0x160dc0[_0xf4c3('0x39')]=_[_0xf4c3('0x3d')](_0x160dc0[_0xf4c3('0x39')],{'$or':_[_0xf4c3('0x30')](_0x160dc0[_0xf4c3('0x34')],function(_0x23bb9a){var _0x53cef7={};_0x53cef7[_0x23bb9a]={'$like':'%'+_0x4fa870[_0xf4c3('0x31')]['filter']+'%'};return _0x53cef7;})});}_0x160dc0=_[_0xf4c3('0x3d')]({},_0x160dc0,_0x4fa870[_0xf4c3('0x3e')]);return _0x159f3e[_0xf4c3('0x5f')](_0x160dc0);}})[_0xf4c3('0x23')](function(_0x66c675){if(_0x66c675){_0x247979=_0x66c675[_0xf4c3('0x36')];if(!_0x4fa870['query'][_0xf4c3('0x55')](_0xf4c3('0x56'))){_0x160dc0[_0xf4c3('0x1b')]=qs[_0xf4c3('0x1b')](_0x4fa870['query']['limit']);_0x160dc0[_0xf4c3('0x1a')]=qs[_0xf4c3('0x1a')](_0x4fa870[_0xf4c3('0x31')][_0xf4c3('0x1a')]);}return _0x159f3e[_0xf4c3('0x5f')](_0x160dc0);}})[_0xf4c3('0x23')](function(_0x2aa304){if(_0x2aa304){return _0x2aa304?{'count':_0x247979,'rows':_0x2aa304}:null;}})[_0xf4c3('0x23')](respondWithResult(_0x3abe63,null))[_0xf4c3('0x42')](handleError(_0x3abe63,null));};exports[_0xf4c3('0x60')]=function(_0x39b191,_0x5c3a08,_0x54e7ae){var _0x256d9b,_0x3de10f;return db[_0xf4c3('0x40')][_0xf4c3('0x46')]({'where':{'id':_0x39b191['params']['id']}})['then'](handleEntityNotFound(_0x5c3a08,null))[_0xf4c3('0x23')](function(_0x1a4b62){if(_0x1a4b62){_0x3de10f=_0x1a4b62;return _0x1a4b62[_0xf4c3('0x60')](_0x39b191[_0xf4c3('0x48')][_0xf4c3('0x61')],_[_0xf4c3('0x62')](_0x39b191[_0xf4c3('0x48')],['ids','id'])||{});}return null;})[_0xf4c3('0x63')](function(_0x20d8eb){var _0x3a1688;_0x256d9b=_0x20d8eb||[];var _0x4c8ffd=[];if(_0x20d8eb){for(var _0x524a04=0x0;_0x524a04<_0x20d8eb[_0xf4c3('0x36')];_0x524a04+=0x1){var _0x1e9bdd=_0x20d8eb[_0x524a04][_0xf4c3('0x25')]({'plain':!![]});_0x3de10f[_0xf4c3('0x64')]=_0x39b191[_0xf4c3('0x48')][_0xf4c3('0x64')]?_0x39b191[_0xf4c3('0x48')][_0xf4c3('0x64')]:_0x3de10f['dialCheckDuplicateType'];switch(_0x3de10f['dialCheckDuplicateType']){case _0xf4c3('0x65'):_0x3a1688=squel['insert']()[_0xf4c3('0x66')]('cm_hopper')[_0xf4c3('0x67')]([_0xf4c3('0x68'),_0xf4c3('0x69'),_0xf4c3('0x6a'),_0xf4c3('0x6b'),_0xf4c3('0x5b'),_0xf4c3('0x50'),_0xf4c3('0x4f')],squel[_0xf4c3('0x6c')]()[_0xf4c3('0x6d')](_0xf4c3('0x68'),'phone')[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x69'))['field']('id',_0xf4c3('0x6a'))[_0xf4c3('0x6d')](_0x1e9bdd['CmListId'][_0xf4c3('0x6f')](),_0xf4c3('0x6b'))[_0xf4c3('0x6d')](_0x39b191[_0xf4c3('0x43')]['id'][_0xf4c3('0x6f')](),'CampaignId')[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x50'))[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x4f'))['from'](_0xf4c3('0x70'))[_0xf4c3('0x39')](_0xf4c3('0x71'))[_0xf4c3('0x39')](_0xf4c3('0x72'),_0x1e9bdd[_0xf4c3('0x73')]['toString']())[_0xf4c3('0x39')](_0xf4c3('0x74'))[_0xf4c3('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4c3('0x6c')]()[_0xf4c3('0x6d')](_0xf4c3('0x75'))[_0xf4c3('0x76')]('cm_hopper_final')[_0xf4c3('0x39')]('CampaignId\x20=\x20?',_0x39b191[_0xf4c3('0x43')]['id'][_0xf4c3('0x6f')]()))[_0xf4c3('0x39')](_0xf4c3('0x77'),squel[_0xf4c3('0x6c')]()['field'](_0xf4c3('0x78'))[_0xf4c3('0x76')](_0xf4c3('0x79'))[_0xf4c3('0x39')](_0xf4c3('0x7a'),_0x39b191[_0xf4c3('0x43')]['id'][_0xf4c3('0x6f')]())))[_0xf4c3('0x6f')]();break;case _0xf4c3('0x7b'):_0x3a1688=squel['insert']()[_0xf4c3('0x66')](_0xf4c3('0x79'))[_0xf4c3('0x67')]([_0xf4c3('0x68'),_0xf4c3('0x69'),_0xf4c3('0x6a'),'ListId',_0xf4c3('0x5b'),_0xf4c3('0x50'),_0xf4c3('0x4f')],squel[_0xf4c3('0x6c')]()[_0xf4c3('0x6d')]('phone',_0xf4c3('0x68'))['field'](_0xf4c3('0x6e'),'scheduledAt')[_0xf4c3('0x6d')]('id',_0xf4c3('0x6a'))[_0xf4c3('0x6d')](_0x1e9bdd['CmListId'][_0xf4c3('0x6f')](),'ListId')[_0xf4c3('0x6d')](_0x39b191[_0xf4c3('0x43')]['id'][_0xf4c3('0x6f')](),_0xf4c3('0x5b'))[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x50'))[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x4f'))[_0xf4c3('0x76')](_0xf4c3('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0xf4c3('0x39')](_0xf4c3('0x72'),_0x1e9bdd[_0xf4c3('0x73')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0xf4c3('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4c3('0x6c')]()['field']('COALESCE(phone,\x27\x27)')[_0xf4c3('0x76')](_0xf4c3('0x79'))[_0xf4c3('0x39')](_0xf4c3('0x7a'),_0x39b191['params']['id'][_0xf4c3('0x6f')]())))[_0xf4c3('0x6f')]();break;default:_0x3a1688=squel[_0xf4c3('0x7c')]()['into'](_0xf4c3('0x79'))[_0xf4c3('0x67')](['phone',_0xf4c3('0x69'),_0xf4c3('0x6a'),'ListId','CampaignId',_0xf4c3('0x50'),_0xf4c3('0x4f')],squel[_0xf4c3('0x6c')]()['field'](_0xf4c3('0x68'),_0xf4c3('0x68'))[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x69'))[_0xf4c3('0x6d')]('id',_0xf4c3('0x6a'))['field'](_0x1e9bdd[_0xf4c3('0x73')][_0xf4c3('0x6f')](),_0xf4c3('0x6b'))['field'](_0x39b191['params']['id']['toString'](),'CampaignId')[_0xf4c3('0x6d')](_0xf4c3('0x6e'),_0xf4c3('0x50'))['field']('NOW()',_0xf4c3('0x4f'))[_0xf4c3('0x76')](_0xf4c3('0x70'))['where'](_0xf4c3('0x71'))['where'](_0xf4c3('0x72'),_0x1e9bdd[_0xf4c3('0x73')][_0xf4c3('0x6f')]())[_0xf4c3('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xf4c3('0x6f')]();}_0x4c8ffd[_0xf4c3('0x7d')](db['sequelize'][_0xf4c3('0x31')](_0x3a1688));}return BPromise[_0xf4c3('0x7e')](_0x4c8ffd);}})[_0xf4c3('0x23')](function(){return _0x256d9b;})['then'](respondWithResult(_0x5c3a08,null))[_0xf4c3('0x42')](handleError(_0x5c3a08,null));};exports['removeLists']=function(_0x4ed5a3,_0x320418,_0x1a07db){return db[_0xf4c3('0x40')]['find']({'where':{'id':_0x4ed5a3[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x320418,null))['then'](function(_0x25d258){if(_0x25d258){return _0x25d258[_0xf4c3('0x7f')](_0x4ed5a3[_0xf4c3('0x31')][_0xf4c3('0x61')]);}})[_0xf4c3('0x23')](function(_0x3ff838){if(_0x3ff838){return db['CmHopper'][_0xf4c3('0x24')]({'where':{'ListId':_0x4ed5a3['query'][_0xf4c3('0x61')],'CampaignId':_0x4ed5a3['params']['id']}})[_0xf4c3('0x23')](function(){return _0x3ff838;});}})[_0xf4c3('0x23')](respondWithStatusCode(_0x320418,null))[_0xf4c3('0x42')](handleError(_0x320418,null));};exports[_0xf4c3('0x80')]=function(_0x3aba36,_0x101ef3,_0x4664f5){var _0x28cd13={};var _0x121cad={};var _0x2a3859;var _0x4564f7;return db['Campaign'][_0xf4c3('0x59')]({'where':{'id':_0x3aba36[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x101ef3,null))[_0xf4c3('0x23')](function(_0x6725d0){if(_0x6725d0){_0x2a3859=_0x6725d0;_0x121cad[_0xf4c3('0x2f')]=_['keys'](db['CmList'][_0xf4c3('0x2b')]);_0x121cad['query']=_[_0xf4c3('0x32')](_0x3aba36[_0xf4c3('0x31')]);_0x121cad['filters']=_[_0xf4c3('0x44')](_0x121cad[_0xf4c3('0x2f')],_0x121cad[_0xf4c3('0x31')]);_0x28cd13[_0xf4c3('0x34')]=_['intersection'](_0x121cad[_0xf4c3('0x2f')],qs[_0xf4c3('0x35')](_0x3aba36[_0xf4c3('0x31')][_0xf4c3('0x35')]));_0x28cd13['attributes']=_0x28cd13[_0xf4c3('0x34')][_0xf4c3('0x36')]?_0x28cd13[_0xf4c3('0x34')]:_0x121cad[_0xf4c3('0x2f')];_0x28cd13[_0xf4c3('0x37')]=qs[_0xf4c3('0x38')](_0x3aba36[_0xf4c3('0x31')][_0xf4c3('0x38')]);_0x28cd13[_0xf4c3('0x39')]=qs[_0xf4c3('0x33')](_[_0xf4c3('0x3a')](_0x3aba36['query'],_0x121cad['filters']));if(_0x3aba36['query']['filter']){_0x28cd13[_0xf4c3('0x39')]=_[_0xf4c3('0x3d')](_0x28cd13[_0xf4c3('0x39')],{'$or':_['map'](_0x28cd13[_0xf4c3('0x34')],function(_0x4ef1f3){var _0x1bccbc={};_0x1bccbc[_0x4ef1f3]={'$like':'%'+_0x3aba36[_0xf4c3('0x31')][_0xf4c3('0x3b')]+'%'};return _0x1bccbc;})});}_0x28cd13=_[_0xf4c3('0x3d')]({},_0x28cd13,_0x3aba36['options']);return _0x2a3859[_0xf4c3('0x80')](_0x28cd13);}})[_0xf4c3('0x23')](function(_0x2aeb45){if(_0x2aeb45){_0x4564f7=_0x2aeb45[_0xf4c3('0x36')];if(!_0x3aba36[_0xf4c3('0x31')]['hasOwnProperty']('nolimit')){_0x28cd13[_0xf4c3('0x1b')]=qs[_0xf4c3('0x1b')](_0x3aba36[_0xf4c3('0x31')][_0xf4c3('0x1b')]);_0x28cd13[_0xf4c3('0x1a')]=qs['offset'](_0x3aba36[_0xf4c3('0x31')][_0xf4c3('0x1a')]);}return _0x2a3859[_0xf4c3('0x80')](_0x28cd13);}})[_0xf4c3('0x23')](function(_0xd67c8c){if(_0xd67c8c){return _0xd67c8c?{'count':_0x4564f7,'rows':_0xd67c8c}:null;}})[_0xf4c3('0x23')](respondWithResult(_0x101ef3,null))[_0xf4c3('0x42')](handleError(_0x101ef3,null));};exports[_0xf4c3('0x81')]=function(_0xbec861,_0x46945f,_0xb2e4c3){var _0x3808ed,_0x36c51c;return db[_0xf4c3('0x40')]['find']({'where':{'id':_0xbec861[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x46945f,null))[_0xf4c3('0x23')](function(_0x31ad07){if(_0x31ad07){_0x36c51c=_0x31ad07;return _0x31ad07[_0xf4c3('0x81')](_0xbec861[_0xf4c3('0x48')][_0xf4c3('0x61')],_[_0xf4c3('0x62')](_0xbec861['body'],['ids','id'])||{});}return null;})[_0xf4c3('0x63')](function(_0x895eda){var _0x1b3c43;_0x3808ed=_0x895eda||[];var _0x2d16f9=[];if(_0x895eda){for(var _0x1fb234=0x0;_0x1fb234<_0x895eda['length'];_0x1fb234+=0x1){var _0x545ae1=_0x895eda[_0x1fb234][_0xf4c3('0x25')]({'plain':!![]});_0x1b3c43=squel[_0xf4c3('0x7c')]()[_0xf4c3('0x66')](_0xf4c3('0x82'))['fromQuery']([_0xf4c3('0x68'),_0xf4c3('0x6a'),_0xf4c3('0x6b'),_0xf4c3('0x5b'),'createdAt',_0xf4c3('0x4f')],squel['select']()[_0xf4c3('0x6d')](_0xf4c3('0x68'),_0xf4c3('0x68'))[_0xf4c3('0x6d')]('id','ContactId')['field'](_0x545ae1[_0xf4c3('0x73')][_0xf4c3('0x6f')](),_0xf4c3('0x6b'))['field'](_0xbec861[_0xf4c3('0x43')]['id']['toString'](),_0xf4c3('0x5b'))[_0xf4c3('0x6d')]('NOW()',_0xf4c3('0x50'))[_0xf4c3('0x6d')](_0xf4c3('0x6e'),'updatedAt')[_0xf4c3('0x76')](_0xf4c3('0x70'))[_0xf4c3('0x39')](_0xf4c3('0x71'))[_0xf4c3('0x39')](_0xf4c3('0x72'),_0x545ae1['CmListId'][_0xf4c3('0x6f')]())[_0xf4c3('0x39')](_0xf4c3('0x74')))[_0xf4c3('0x6f')]();_0x2d16f9[_0xf4c3('0x7d')](db[_0xf4c3('0x83')][_0xf4c3('0x31')](_0x1b3c43));}return BPromise[_0xf4c3('0x7e')](_0x2d16f9);}})[_0xf4c3('0x23')](function(){return _0x3808ed;})['then'](respondWithResult(_0x46945f,null))['catch'](handleError(_0x46945f,null));};exports[_0xf4c3('0x84')]=function(_0xe2a8ff,_0x2900a7,_0x39f377){return db[_0xf4c3('0x40')][_0xf4c3('0x46')]({'where':{'id':_0xe2a8ff[_0xf4c3('0x43')]['id']}})[_0xf4c3('0x23')](handleEntityNotFound(_0x2900a7,null))[_0xf4c3('0x23')](function(_0x22cd55){if(_0x22cd55){return _0x22cd55[_0xf4c3('0x84')](_0xe2a8ff[_0xf4c3('0x31')][_0xf4c3('0x61')]);}})['then'](function(_0x58b3d3){if(_0x58b3d3){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0xe2a8ff[_0xf4c3('0x31')][_0xf4c3('0x61')],'CampaignId':_0xe2a8ff[_0xf4c3('0x43')]['id']}})['then'](function(){return _0x58b3d3;});}})['then'](respondWithStatusCode(_0x2900a7,null))[_0xf4c3('0x42')](handleError(_0x2900a7,null));};
\ No newline at end of file
+var _0x9be7=['CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','onlyIfOpen','fromQuery','scheduledAt','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','into','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','find','create','catch','params','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','phone','ContactId','select','field','NOW()','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x37468e,_0x14c7a4){var _0x203d9f=function(_0x4b6741){while(--_0x4b6741){_0x37468e['push'](_0x37468e['shift']());}};_0x203d9f(++_0x14c7a4);}(_0x9be7,0x9b));var _0x79be=function(_0x2d126e,_0x1e8257){_0x2d126e=_0x2d126e-0x0;var _0xcb04d3=_0x9be7[_0x2d126e];return _0xcb04d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x79be('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x79be('0x1'));var BPromise=require(_0x79be('0x2'));var Mustache=require(_0x79be('0x3'));var util=require('util');var path=require(_0x79be('0x4'));var sox=require(_0x79be('0x5'));var csv=require(_0x79be('0x6'));var ejs=require(_0x79be('0x7'));var fs=require('fs');var fs_extra=require(_0x79be('0x8'));var _=require('lodash');var squel=require(_0x79be('0x9'));var crypto=require('crypto');var jsforce=require(_0x79be('0xa'));var deskjs=require(_0x79be('0xb'));var toCsv=require(_0x79be('0x6'));var querystring=require(_0x79be('0xc'));var Papa=require(_0x79be('0xd'));var Redis=require(_0x79be('0xe'));var authService=require(_0x79be('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x79be('0x10'));var hardwareService=require(_0x79be('0x11'));var logger=require(_0x79be('0x12'))(_0x79be('0x13'));var utils=require(_0x79be('0x14'));var config=require(_0x79be('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x79be('0x16'))['db'];function respondWithStatusCode(_0x35478d,_0x470e7d){_0x470e7d=_0x470e7d||0xcc;return function(_0x3305d4){if(_0x3305d4){return _0x35478d['sendStatus'](_0x470e7d);}return _0x35478d[_0x79be('0x17')](_0x470e7d)[_0x79be('0x18')]();};}function respondWithResult(_0x23c5d2,_0x509649){_0x509649=_0x509649||0xc8;return function(_0x42dc46){if(_0x42dc46){return _0x23c5d2[_0x79be('0x17')](_0x509649)[_0x79be('0x19')](_0x42dc46);}};}function respondWithFilteredResult(_0x4e66c1,_0x74539f){return function(_0x20f402){if(_0x20f402){var _0x1228f6=typeof _0x74539f[_0x79be('0x1a')]==='undefined'&&typeof _0x74539f['limit']===_0x79be('0x1b');var _0x57a5e5=_0x20f402['count'];var _0x2f6ffb=_0x1228f6?0x0:_0x74539f['offset'];var _0x2e3c17=_0x1228f6?_0x20f402[_0x79be('0x1c')]:_0x74539f[_0x79be('0x1a')]+_0x74539f[_0x79be('0x1d')];var _0x9db36d;if(_0x2e3c17>=_0x57a5e5){_0x2e3c17=_0x57a5e5;_0x9db36d=0xc8;}else{_0x9db36d=0xce;}_0x4e66c1[_0x79be('0x17')](_0x9db36d);return _0x4e66c1[_0x79be('0x1e')](_0x79be('0x1f'),_0x2f6ffb+'-'+_0x2e3c17+'/'+_0x57a5e5)[_0x79be('0x19')](_0x20f402);}return null;};}function patchUpdates(_0x13b785){return function(_0x527b45){try{jsonpatch['apply'](_0x527b45,_0x13b785,!![]);}catch(_0x535743){return BPromise[_0x79be('0x20')](_0x535743);}return _0x527b45[_0x79be('0x21')]();};}function saveUpdates(_0x11a6ca,_0x1c6c8f){return function(_0x10964f){if(_0x10964f){return _0x10964f[_0x79be('0x22')](_0x11a6ca)[_0x79be('0x23')](function(_0xb70405){return _0xb70405;});}return null;};}function removeEntity(_0x211a46,_0x22304a){return function(_0x16d810){if(_0x16d810){return _0x16d810[_0x79be('0x24')]()['then'](function(){var _0x3af6d7=_0x16d810[_0x79be('0x25')]({'plain':!![]});var _0x232414=_0x79be('0x26');return db[_0x79be('0x27')][_0x79be('0x24')]({'where':{'type':_0x232414,'resourceId':_0x3af6d7['id']}})[_0x79be('0x23')](function(){return _0x16d810;});})[_0x79be('0x23')](function(){_0x211a46['status'](0xcc)[_0x79be('0x18')]();});}};}function handleEntityNotFound(_0x5d8164,_0x47665e){return function(_0x2e4278){if(!_0x2e4278){_0x5d8164['sendStatus'](0x194);}return _0x2e4278;};}function handleError(_0x3e0f39,_0x75738d){_0x75738d=_0x75738d||0x1f4;return function(_0x36e417){logger[_0x79be('0x28')](_0x36e417[_0x79be('0x29')]);if(_0x36e417[_0x79be('0x2a')]){delete _0x36e417[_0x79be('0x2a')];}_0x3e0f39[_0x79be('0x17')](_0x75738d)[_0x79be('0x2b')](_0x36e417);};}exports[_0x79be('0x2c')]=function(_0x3d822a,_0x2ad264){var _0x125d28={},_0x1b19c7={},_0xce795b={'count':0x0,'rows':[]};var _0x51132a=_[_0x79be('0x2d')](db[_0x79be('0x2e')][_0x79be('0x2f')],function(_0x1525ad){return{'name':_0x1525ad['fieldName'],'type':_0x1525ad[_0x79be('0x30')][_0x79be('0x31')]};});_0x1b19c7['model']=_[_0x79be('0x2d')](_0x51132a,_0x79be('0x2a'));_0x1b19c7[_0x79be('0x32')]=_[_0x79be('0x33')](_0x3d822a[_0x79be('0x32')]);_0x1b19c7[_0x79be('0x34')]=_['intersection'](_0x1b19c7[_0x79be('0x35')],_0x1b19c7['query']);_0x125d28['attributes']=_[_0x79be('0x36')](_0x1b19c7[_0x79be('0x35')],qs[_0x79be('0x37')](_0x3d822a[_0x79be('0x32')]['fields']));_0x125d28[_0x79be('0x38')]=_0x125d28['attributes'][_0x79be('0x39')]?_0x125d28[_0x79be('0x38')]:_0x1b19c7['model'];if(!_0x3d822a[_0x79be('0x32')]['hasOwnProperty'](_0x79be('0x3a'))){_0x125d28['limit']=qs[_0x79be('0x1d')](_0x3d822a[_0x79be('0x32')]['limit']);_0x125d28[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x3d822a[_0x79be('0x32')][_0x79be('0x1a')]);}_0x125d28[_0x79be('0x3b')]=qs[_0x79be('0x3c')](_0x3d822a[_0x79be('0x32')][_0x79be('0x3c')]);_0x125d28[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x3d822a[_0x79be('0x32')],_0x1b19c7[_0x79be('0x34')]),_0x51132a);if(_0x3d822a[_0x79be('0x32')][_0x79be('0x3f')]){_0x125d28['where']=_['merge'](_0x125d28['where'],{'$or':_[_0x79be('0x2d')](_0x51132a,function(_0x179a77){if(_0x179a77[_0x79be('0x30')]!=='VIRTUAL'){var _0x1ad8f4={};_0x1ad8f4[_0x179a77[_0x79be('0x2a')]]={'$like':'%'+_0x3d822a[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x1ad8f4;}})});}_0x125d28=_[_0x79be('0x40')]({},_0x125d28,_0x3d822a[_0x79be('0x41')]);var _0x1bb3d1={'where':_0x125d28[_0x79be('0x3d')]};return db[_0x79be('0x2e')]['count'](_0x1bb3d1)[_0x79be('0x23')](function(_0x43af36){_0xce795b[_0x79be('0x1c')]=_0x43af36;if(_0x3d822a[_0x79be('0x32')][_0x79be('0x42')]){_0x125d28[_0x79be('0x43')]=[{'all':!![]}];}return db[_0x79be('0x2e')][_0x79be('0x44')](_0x125d28);})[_0x79be('0x23')](function(_0x5a0d74){_0xce795b['rows']=_0x5a0d74;return _0xce795b;})[_0x79be('0x23')](respondWithFilteredResult(_0x2ad264,_0x125d28))['catch'](handleError(_0x2ad264,null));};exports[_0x79be('0x45')]=function(_0x55b3bd,_0x3bb84a){var _0x3796d4={'raw':![],'where':{'id':_0x55b3bd['params']['id']}},_0x34da6c={};_0x34da6c['model']=_[_0x79be('0x33')](db['Campaign'][_0x79be('0x2f')]);_0x34da6c[_0x79be('0x32')]=_[_0x79be('0x33')](_0x55b3bd[_0x79be('0x32')]);_0x34da6c[_0x79be('0x34')]=_['intersection'](_0x34da6c[_0x79be('0x35')],_0x34da6c[_0x79be('0x32')]);_0x3796d4[_0x79be('0x38')]=_['intersection'](_0x34da6c[_0x79be('0x35')],qs['fields'](_0x55b3bd[_0x79be('0x32')][_0x79be('0x37')]));_0x3796d4[_0x79be('0x38')]=_0x3796d4[_0x79be('0x38')][_0x79be('0x39')]?_0x3796d4['attributes']:_0x34da6c[_0x79be('0x35')];if(_0x55b3bd['query'][_0x79be('0x42')]){_0x3796d4[_0x79be('0x43')]=[{'all':!![]}];}_0x3796d4=_[_0x79be('0x40')]({},_0x3796d4,_0x55b3bd[_0x79be('0x41')]);return db[_0x79be('0x2e')][_0x79be('0x46')](_0x3796d4)[_0x79be('0x23')](handleEntityNotFound(_0x3bb84a,null))['then'](respondWithResult(_0x3bb84a,null))['catch'](handleError(_0x3bb84a,null));};exports[_0x79be('0x47')]=function(_0x14fc50,_0x15d4b1){return db[_0x79be('0x2e')][_0x79be('0x47')](_0x14fc50['body'],{})['then'](function(_0x506258){var _0x561f6b=_0x14fc50['user']['get']({'plain':!![]});if(!_0x561f6b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x561f6b['role']==='user'){var _0x344832=_0x506258[_0x79be('0x25')]({'plain':!![]});var _0x7c4e76=_0x79be('0x26');return db['UserProfileSection'][_0x79be('0x46')]({'where':{'name':_0x7c4e76,'userProfileId':_0x561f6b['userProfileId']},'raw':!![]})['then'](function(_0xfc284a){if(_0xfc284a&&_0xfc284a['autoAssociation']===0x0){return db[_0x79be('0x27')][_0x79be('0x47')]({'name':_0x344832[_0x79be('0x2a')],'resourceId':_0x344832['id'],'type':_0xfc284a['name'],'sectionId':_0xfc284a['id']},{})[_0x79be('0x23')](function(){return _0x506258;});}else{return _0x506258;}})[_0x79be('0x48')](function(_0x1214cb){logger[_0x79be('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1214cb);throw _0x1214cb;});}return _0x506258;})['then'](respondWithResult(_0x15d4b1,0xc9))['catch'](handleError(_0x15d4b1,null));};exports['clone']=function(_0x28b9b6,_0x5cb7ae){var _0x1ff2cd={'where':{'id':_0x28b9b6[_0x79be('0x49')]['id']}},_0x2956a1={};_0x2956a1['model']=_[_0x79be('0x33')](db[_0x79be('0x2e')][_0x79be('0x2f')]);_0x1ff2cd['attributes']=_[_0x79be('0x36')](_0x2956a1[_0x79be('0x35')],qs[_0x79be('0x37')](_0x28b9b6[_0x79be('0x32')]['fields']));_0x1ff2cd[_0x79be('0x38')]=_0x1ff2cd[_0x79be('0x38')]['length']?_0x1ff2cd[_0x79be('0x38')]:_0x2956a1[_0x79be('0x35')];if(_0x28b9b6['query'][_0x79be('0x42')]){_0x1ff2cd[_0x79be('0x43')]=[{'all':!![]}];}_0x1ff2cd=_['merge']({},_0x1ff2cd,_0x28b9b6[_0x79be('0x41')]);return db[_0x79be('0x2e')][_0x79be('0x46')](_0x1ff2cd)[_0x79be('0x23')](handleEntityNotFound(_0x5cb7ae,null))[_0x79be('0x23')](function(_0x2272d8){if(_0x2272d8){var _0x20a26f=_0x2272d8[_0x79be('0x25')]({'plain':!![]});_0x20a26f=qs[_0x79be('0x4a')](_0x20a26f,['id','createdAt',_0x79be('0x4b')]);_0x28b9b6[_0x79be('0x4c')]=_[_0x79be('0x4a')](_0x28b9b6[_0x79be('0x4c')],['id',_0x79be('0x4d'),_0x79be('0x4b')]);return db[_0x79be('0x2e')][_0x79be('0x47')](_[_0x79be('0x40')](_0x20a26f,_0x28b9b6[_0x79be('0x4c')]),{'include':_0x28b9b6[_0x79be('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x79be('0x23')](function(_0x1abb75){var _0x393642=_0x28b9b6[_0x79be('0x4e')][_0x79be('0x25')]({'plain':!![]});if(!_0x393642)throw new Error(_0x79be('0x4f'));if(_0x393642[_0x79be('0x50')]===_0x79be('0x4e')){var _0x39152b=_0x1abb75['get']({'plain':!![]});var _0xeb2957='IvrCampaigns';return db[_0x79be('0x51')]['find']({'where':{'name':_0xeb2957,'userProfileId':_0x393642['userProfileId']},'raw':!![]})[_0x79be('0x23')](function(_0x41abc7){if(_0x41abc7&&_0x41abc7[_0x79be('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x39152b['name'],'resourceId':_0x39152b['id'],'type':_0x41abc7[_0x79be('0x2a')],'sectionId':_0x41abc7['id']},{})[_0x79be('0x23')](function(){return _0x1abb75;});}else{return _0x1abb75;}})[_0x79be('0x48')](function(_0x4858ac){logger[_0x79be('0x28')](_0x79be('0x53'),_0x4858ac);throw _0x4858ac;});}return _0x1abb75;});}})[_0x79be('0x23')](respondWithResult(_0x5cb7ae,0xc9))[_0x79be('0x48')](handleError(_0x5cb7ae,null));};exports['update']=function(_0x29f8a9,_0x45c91a){if(_0x29f8a9[_0x79be('0x4c')]['id']){delete _0x29f8a9[_0x79be('0x4c')]['id'];}return db[_0x79be('0x2e')][_0x79be('0x46')]({'where':{'id':_0x29f8a9['params']['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x45c91a,null))['then'](saveUpdates(_0x29f8a9['body'],null))['then'](respondWithResult(_0x45c91a,null))['catch'](handleError(_0x45c91a,null));};exports[_0x79be('0x24')]=function(_0x551ef5,_0xb08686){return db['Campaign']['find']({'where':{'id':_0x551ef5[_0x79be('0x49')]['id']}})['then'](handleEntityNotFound(_0xb08686,null))['then'](removeEntity(_0xb08686,null))[_0x79be('0x48')](handleError(_0xb08686,null));};exports[_0x79be('0x54')]=function(_0x11e443,_0x263e1f,_0x211201){var _0x3e1b3a={'raw':!![],'where':{}};var _0x549bde={};var _0x5a59bf={'count':0x0,'rows':[]};return db['Campaign'][_0x79be('0x55')]({'where':{'id':_0x11e443[_0x79be('0x49')]['id']}})['then'](handleEntityNotFound(_0x263e1f,null))['then'](function(_0x1ab263){if(_0x1ab263){_0x549bde[_0x79be('0x35')]=_['keys'](db[_0x79be('0x56')][_0x79be('0x2f')]);_0x549bde[_0x79be('0x32')]=_[_0x79be('0x33')](_0x11e443[_0x79be('0x32')]);_0x549bde['filters']=_[_0x79be('0x36')](_0x549bde[_0x79be('0x35')],_0x549bde[_0x79be('0x32')]);_0x3e1b3a['attributes']=_[_0x79be('0x36')](_0x549bde[_0x79be('0x35')],qs[_0x79be('0x37')](_0x11e443[_0x79be('0x32')][_0x79be('0x37')]));_0x3e1b3a[_0x79be('0x38')]=_0x3e1b3a[_0x79be('0x38')]['length']?_0x3e1b3a['attributes']:_0x549bde[_0x79be('0x35')];if(!_0x11e443['query'][_0x79be('0x57')](_0x79be('0x3a'))){_0x3e1b3a[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x11e443['query']['limit']);_0x3e1b3a[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x11e443[_0x79be('0x32')][_0x79be('0x1a')]);}_0x3e1b3a['order']=qs['sort'](_0x11e443[_0x79be('0x32')]['sort']);_0x3e1b3a[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x11e443[_0x79be('0x32')],_0x549bde['filters']));_0x3e1b3a[_0x79be('0x3d')][_0x79be('0x58')]=_0x1ab263['id'];if(_0x11e443[_0x79be('0x32')][_0x79be('0x3f')]){_0x3e1b3a[_0x79be('0x3d')]=_['merge'](_0x3e1b3a[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x3e1b3a[_0x79be('0x38')],function(_0x5906dd){var _0x1984b5={};_0x1984b5[_0x5906dd]={'$like':'%'+_0x11e443[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x1984b5;})});}_0x3e1b3a=_['merge']({},_0x3e1b3a,_0x11e443['options']);return db[_0x79be('0x56')][_0x79be('0x1c')]({'where':_0x3e1b3a[_0x79be('0x3d')]})[_0x79be('0x23')](function(_0x3907ff){_0x5a59bf[_0x79be('0x1c')]=_0x3907ff;if(_0x11e443[_0x79be('0x32')]['includeAll']){_0x3e1b3a[_0x79be('0x43')]=[{'all':!![]}];}return db[_0x79be('0x56')][_0x79be('0x44')](_0x3e1b3a);})[_0x79be('0x23')](function(_0x29f9ea){_0x5a59bf[_0x79be('0x59')]=_0x29f9ea;return _0x5a59bf;});}})['then'](respondWithFilteredResult(_0x263e1f,_0x3e1b3a))['catch'](handleError(_0x263e1f,null));};exports[_0x79be('0x5a')]=function(_0x38e271,_0x281ea1,_0x5bceaa){var _0x1e5706={'raw':!![],'where':{}};var _0x5c6b56={};var _0x1a5bf8={'count':0x0,'rows':[]};return db[_0x79be('0x2e')]['findOne']({'where':{'id':_0x38e271[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x281ea1,null))['then'](function(_0x3332cb){if(_0x3332cb){_0x5c6b56['model']=_[_0x79be('0x33')](db[_0x79be('0x5b')]['rawAttributes']);_0x5c6b56[_0x79be('0x32')]=_[_0x79be('0x33')](_0x38e271[_0x79be('0x32')]);_0x5c6b56[_0x79be('0x34')]=_[_0x79be('0x36')](_0x5c6b56[_0x79be('0x35')],_0x5c6b56['query']);_0x1e5706[_0x79be('0x38')]=_['intersection'](_0x5c6b56[_0x79be('0x35')],qs['fields'](_0x38e271[_0x79be('0x32')][_0x79be('0x37')]));_0x1e5706[_0x79be('0x38')]=_0x1e5706[_0x79be('0x38')]['length']?_0x1e5706[_0x79be('0x38')]:_0x5c6b56[_0x79be('0x35')];if(!_0x38e271['query']['hasOwnProperty'](_0x79be('0x3a'))){_0x1e5706[_0x79be('0x1d')]=qs['limit'](_0x38e271[_0x79be('0x32')]['limit']);_0x1e5706[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x38e271[_0x79be('0x32')][_0x79be('0x1a')]);}_0x1e5706['order']=qs[_0x79be('0x3c')](_0x38e271['query'][_0x79be('0x3c')]);_0x1e5706[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x38e271['query'],_0x5c6b56[_0x79be('0x34')]));_0x1e5706[_0x79be('0x3d')][_0x79be('0x58')]=_0x3332cb['id'];if(_0x38e271[_0x79be('0x32')]['filter']){_0x1e5706[_0x79be('0x3d')]=_[_0x79be('0x40')](_0x1e5706[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x1e5706[_0x79be('0x38')],function(_0x48037c){var _0x55364f={};_0x55364f[_0x48037c]={'$like':'%'+_0x38e271[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x55364f;})});}_0x1e5706=_[_0x79be('0x40')]({},_0x1e5706,_0x38e271[_0x79be('0x41')]);return db[_0x79be('0x5b')][_0x79be('0x1c')]({'where':_0x1e5706[_0x79be('0x3d')]})[_0x79be('0x23')](function(_0x2925c9){_0x1a5bf8[_0x79be('0x1c')]=_0x2925c9;if(_0x38e271['query'][_0x79be('0x42')]){_0x1e5706[_0x79be('0x43')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x79be('0x44')](_0x1e5706);})['then'](function(_0xc783f4){_0x1a5bf8[_0x79be('0x59')]=_0xc783f4;return _0x1a5bf8;});}})[_0x79be('0x23')](respondWithFilteredResult(_0x281ea1,_0x1e5706))[_0x79be('0x48')](handleError(_0x281ea1,null));};exports['getHopperFinals']=function(_0x4e6e55,_0x8fa945,_0x2acc9c){var _0x9edee6={'raw':!![],'where':{}};var _0x56a2d8={};var _0x3eb555={'count':0x0,'rows':[]};return db[_0x79be('0x2e')][_0x79be('0x55')]({'where':{'id':_0x4e6e55[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x8fa945,null))[_0x79be('0x23')](function(_0x28917d){if(_0x28917d){_0x56a2d8['model']=_[_0x79be('0x33')](db[_0x79be('0x5c')][_0x79be('0x2f')]);_0x56a2d8[_0x79be('0x32')]=_['keys'](_0x4e6e55[_0x79be('0x32')]);_0x56a2d8['filters']=_[_0x79be('0x36')](_0x56a2d8[_0x79be('0x35')],_0x56a2d8[_0x79be('0x32')]);_0x9edee6[_0x79be('0x38')]=_[_0x79be('0x36')](_0x56a2d8[_0x79be('0x35')],qs[_0x79be('0x37')](_0x4e6e55[_0x79be('0x32')]['fields']));_0x9edee6[_0x79be('0x38')]=_0x9edee6[_0x79be('0x38')][_0x79be('0x39')]?_0x9edee6[_0x79be('0x38')]:_0x56a2d8['model'];if(!_0x4e6e55['query'][_0x79be('0x57')](_0x79be('0x3a'))){_0x9edee6[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x4e6e55[_0x79be('0x32')][_0x79be('0x1d')]);_0x9edee6[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x4e6e55[_0x79be('0x32')][_0x79be('0x1a')]);}_0x9edee6['order']=qs[_0x79be('0x3c')](_0x4e6e55[_0x79be('0x32')][_0x79be('0x3c')]);_0x9edee6[_0x79be('0x3d')]=qs['filters'](_[_0x79be('0x3e')](_0x4e6e55[_0x79be('0x32')],_0x56a2d8['filters']));_0x9edee6[_0x79be('0x3d')]['CampaignId']=_0x28917d['id'];if(_0x4e6e55['query'][_0x79be('0x3f')]){_0x9edee6['where']=_[_0x79be('0x40')](_0x9edee6[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x9edee6['attributes'],function(_0x257f49){var _0x20da74={};_0x20da74[_0x257f49]={'$like':'%'+_0x4e6e55[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x20da74;})});}_0x9edee6=_[_0x79be('0x40')]({},_0x9edee6,_0x4e6e55[_0x79be('0x41')]);return db[_0x79be('0x5c')][_0x79be('0x1c')]({'where':_0x9edee6['where']})[_0x79be('0x23')](function(_0x2db78c){_0x3eb555['count']=_0x2db78c;if(_0x4e6e55[_0x79be('0x32')][_0x79be('0x42')]){_0x9edee6[_0x79be('0x43')]=[{'all':!![]}];}return db[_0x79be('0x5c')][_0x79be('0x44')](_0x9edee6);})[_0x79be('0x23')](function(_0x4956e1){_0x3eb555[_0x79be('0x59')]=_0x4956e1;return _0x3eb555;});}})['then'](respondWithFilteredResult(_0x8fa945,_0x9edee6))[_0x79be('0x48')](handleError(_0x8fa945,null));};exports[_0x79be('0x5d')]=function(_0x3923d8,_0x53bba2,_0x2de9c1){var _0xf72a6d={'raw':!![],'where':{}};var _0xb10d9c={};var _0xcc4b7c={'count':0x0,'rows':[]};return db[_0x79be('0x2e')][_0x79be('0x55')]({'where':{'id':_0x3923d8[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x53bba2,null))[_0x79be('0x23')](function(_0x50f47e){if(_0x50f47e){_0xb10d9c[_0x79be('0x35')]=_[_0x79be('0x33')](db[_0x79be('0x5e')][_0x79be('0x2f')]);_0xb10d9c['query']=_['keys'](_0x3923d8['query']);_0xb10d9c[_0x79be('0x34')]=_[_0x79be('0x36')](_0xb10d9c[_0x79be('0x35')],_0xb10d9c['query']);_0xf72a6d[_0x79be('0x38')]=_['intersection'](_0xb10d9c['model'],qs[_0x79be('0x37')](_0x3923d8[_0x79be('0x32')][_0x79be('0x37')]));_0xf72a6d[_0x79be('0x38')]=_0xf72a6d[_0x79be('0x38')][_0x79be('0x39')]?_0xf72a6d[_0x79be('0x38')]:_0xb10d9c['model'];if(!_0x3923d8[_0x79be('0x32')][_0x79be('0x57')](_0x79be('0x3a'))){_0xf72a6d[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x3923d8[_0x79be('0x32')][_0x79be('0x1d')]);_0xf72a6d[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x3923d8[_0x79be('0x32')][_0x79be('0x1a')]);}_0xf72a6d['order']=qs[_0x79be('0x3c')](_0x3923d8['query'][_0x79be('0x3c')]);_0xf72a6d['where']=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x3923d8[_0x79be('0x32')],_0xb10d9c[_0x79be('0x34')]));_0xf72a6d[_0x79be('0x3d')][_0x79be('0x58')]=_0x50f47e['id'];if(_0x3923d8[_0x79be('0x32')]['filter']){_0xf72a6d['where']=_[_0x79be('0x40')](_0xf72a6d[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0xf72a6d[_0x79be('0x38')],function(_0x3cca93){var _0x429de4={};_0x429de4[_0x3cca93]={'$like':'%'+_0x3923d8['query'][_0x79be('0x3f')]+'%'};return _0x429de4;})});}_0xf72a6d=_['merge']({},_0xf72a6d,_0x3923d8[_0x79be('0x41')]);return db[_0x79be('0x5e')][_0x79be('0x1c')]({'where':_0xf72a6d[_0x79be('0x3d')]})['then'](function(_0xda0823){_0xcc4b7c['count']=_0xda0823;if(_0x3923d8[_0x79be('0x32')][_0x79be('0x42')]){_0xf72a6d['include']=[{'all':!![]}];}return db[_0x79be('0x5e')][_0x79be('0x44')](_0xf72a6d);})['then'](function(_0x379be2){_0xcc4b7c[_0x79be('0x59')]=_0x379be2;return _0xcc4b7c;});}})[_0x79be('0x23')](respondWithFilteredResult(_0x53bba2,_0xf72a6d))['catch'](handleError(_0x53bba2,null));};exports[_0x79be('0x5f')]=function(_0x2ea3e3,_0x3ddd99,_0x499842){var _0x558b46={};var _0x28fc51={};var _0x2b8422;var _0x2796bd;return db[_0x79be('0x2e')]['findOne']({'where':{'id':_0x2ea3e3[_0x79be('0x49')]['id']}})['then'](handleEntityNotFound(_0x3ddd99,null))[_0x79be('0x23')](function(_0x396b7c){if(_0x396b7c){_0x2b8422=_0x396b7c;_0x28fc51['model']=_[_0x79be('0x33')](db['CmList'][_0x79be('0x2f')]);_0x28fc51[_0x79be('0x32')]=_[_0x79be('0x33')](_0x2ea3e3[_0x79be('0x32')]);_0x28fc51[_0x79be('0x34')]=_[_0x79be('0x36')](_0x28fc51['model'],_0x28fc51[_0x79be('0x32')]);_0x558b46[_0x79be('0x38')]=_['intersection'](_0x28fc51[_0x79be('0x35')],qs[_0x79be('0x37')](_0x2ea3e3['query'][_0x79be('0x37')]));_0x558b46[_0x79be('0x38')]=_0x558b46[_0x79be('0x38')][_0x79be('0x39')]?_0x558b46[_0x79be('0x38')]:_0x28fc51[_0x79be('0x35')];_0x558b46[_0x79be('0x3b')]=qs[_0x79be('0x3c')](_0x2ea3e3['query'][_0x79be('0x3c')]);_0x558b46[_0x79be('0x3d')]=qs[_0x79be('0x34')](_[_0x79be('0x3e')](_0x2ea3e3['query'],_0x28fc51['filters']));if(_0x2ea3e3[_0x79be('0x32')][_0x79be('0x3f')]){_0x558b46['where']=_[_0x79be('0x40')](_0x558b46[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x558b46[_0x79be('0x38')],function(_0x296def){var _0x24e220={};_0x24e220[_0x296def]={'$like':'%'+_0x2ea3e3[_0x79be('0x32')][_0x79be('0x3f')]+'%'};return _0x24e220;})});}_0x558b46=_['merge']({},_0x558b46,_0x2ea3e3[_0x79be('0x41')]);return _0x2b8422[_0x79be('0x5f')](_0x558b46);}})[_0x79be('0x23')](function(_0x3e648c){if(_0x3e648c){_0x2796bd=_0x3e648c['length'];if(!_0x2ea3e3[_0x79be('0x32')]['hasOwnProperty'](_0x79be('0x3a'))){_0x558b46[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x2ea3e3['query']['limit']);_0x558b46[_0x79be('0x1a')]=qs[_0x79be('0x1a')](_0x2ea3e3[_0x79be('0x32')][_0x79be('0x1a')]);}return _0x2b8422[_0x79be('0x5f')](_0x558b46);}})[_0x79be('0x23')](function(_0x278dd0){if(_0x278dd0){return _0x278dd0?{'count':_0x2796bd,'rows':_0x278dd0}:null;}})[_0x79be('0x23')](respondWithResult(_0x3ddd99,null))[_0x79be('0x48')](handleError(_0x3ddd99,null));};exports[_0x79be('0x60')]=function(_0x1a8057,_0x462d7f,_0x54b309){var _0x5054b7,_0x3ae531;return db['Campaign'][_0x79be('0x46')]({'where':{'id':_0x1a8057['params']['id']}})['then'](handleEntityNotFound(_0x462d7f,null))[_0x79be('0x23')](function(_0xe5482c){if(_0xe5482c){_0x3ae531=_0xe5482c;return _0xe5482c[_0x79be('0x60')](_0x1a8057['body'][_0x79be('0x61')],_['omit'](_0x1a8057[_0x79be('0x4c')],['ids','id'])||{});}return null;})[_0x79be('0x62')](function(_0x4a75ca){var _0x15133d;_0x5054b7=_0x4a75ca||[];var _0x444eb7=[];if(_0x4a75ca){for(var _0x30d6ff=0x0;_0x30d6ff<_0x4a75ca['length'];_0x30d6ff+=0x1){var _0x25236c=_0x4a75ca[_0x30d6ff][_0x79be('0x25')]({'plain':!![]});_0x3ae531[_0x79be('0x63')]=_0x1a8057[_0x79be('0x4c')][_0x79be('0x63')]?_0x1a8057[_0x79be('0x4c')][_0x79be('0x63')]:_0x3ae531['dialCheckDuplicateType'];switch(_0x3ae531['dialCheckDuplicateType']){case'always':_0x15133d=squel[_0x79be('0x64')]()['into']('cm_hopper')['fromQuery']([_0x79be('0x65'),'scheduledAt',_0x79be('0x66'),'ListId',_0x79be('0x58'),'createdAt',_0x79be('0x4b')],squel[_0x79be('0x67')]()[_0x79be('0x68')](_0x79be('0x65'),_0x79be('0x65'))[_0x79be('0x68')](_0x79be('0x69'),'scheduledAt')['field']('id',_0x79be('0x66'))[_0x79be('0x68')](_0x25236c['CmListId'][_0x79be('0x6a')](),_0x79be('0x6b'))[_0x79be('0x68')](_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')](),_0x79be('0x58'))[_0x79be('0x68')]('NOW()',_0x79be('0x4d'))[_0x79be('0x68')](_0x79be('0x69'),'updatedAt')[_0x79be('0x6c')](_0x79be('0x6d'))[_0x79be('0x3d')](_0x79be('0x6e'))['where']('ListId\x20=\x20?',_0x25236c[_0x79be('0x6f')]['toString']())['where'](_0x79be('0x70'))[_0x79be('0x3d')](_0x79be('0x71'),squel[_0x79be('0x67')]()[_0x79be('0x68')](_0x79be('0x72'))[_0x79be('0x6c')](_0x79be('0x73'))[_0x79be('0x3d')](_0x79be('0x74'),_0x1a8057['params']['id'][_0x79be('0x6a')]()))[_0x79be('0x3d')](_0x79be('0x71'),squel['select']()[_0x79be('0x68')]('COALESCE(phone,\x27\x27)')[_0x79be('0x6c')](_0x79be('0x75'))[_0x79be('0x3d')](_0x79be('0x74'),_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')]())))[_0x79be('0x6a')]();break;case _0x79be('0x76'):_0x15133d=squel[_0x79be('0x64')]()['into'](_0x79be('0x75'))[_0x79be('0x77')](['phone','scheduledAt',_0x79be('0x66'),'ListId','CampaignId','createdAt',_0x79be('0x4b')],squel[_0x79be('0x67')]()[_0x79be('0x68')]('phone',_0x79be('0x65'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x78'))['field']('id',_0x79be('0x66'))[_0x79be('0x68')](_0x25236c[_0x79be('0x6f')][_0x79be('0x6a')](),_0x79be('0x6b'))['field'](_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')](),'CampaignId')[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4d'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4b'))[_0x79be('0x6c')](_0x79be('0x6d'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x79be('0x79'),_0x25236c['CmListId'][_0x79be('0x6a')]())[_0x79be('0x3d')](_0x79be('0x70'))[_0x79be('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x79be('0x67')]()[_0x79be('0x68')](_0x79be('0x7a'))[_0x79be('0x6c')](_0x79be('0x75'))[_0x79be('0x3d')](_0x79be('0x74'),_0x1a8057['params']['id']['toString']())))[_0x79be('0x6a')]();break;default:_0x15133d=squel['insert']()[_0x79be('0x7b')]('cm_hopper')[_0x79be('0x77')](['phone','scheduledAt',_0x79be('0x66'),_0x79be('0x6b'),'CampaignId',_0x79be('0x4d'),_0x79be('0x4b')],squel[_0x79be('0x67')]()[_0x79be('0x68')]('phone',_0x79be('0x65'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x78'))[_0x79be('0x68')]('id',_0x79be('0x66'))[_0x79be('0x68')](_0x25236c[_0x79be('0x6f')][_0x79be('0x6a')](),_0x79be('0x6b'))[_0x79be('0x68')](_0x1a8057[_0x79be('0x49')]['id'][_0x79be('0x6a')](),_0x79be('0x58'))[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4d'))[_0x79be('0x68')](_0x79be('0x69'),'updatedAt')['from'](_0x79be('0x6d'))[_0x79be('0x3d')](_0x79be('0x6e'))['where'](_0x79be('0x79'),_0x25236c[_0x79be('0x6f')][_0x79be('0x6a')]())['where'](_0x79be('0x70')))[_0x79be('0x6a')]();}_0x444eb7[_0x79be('0x7c')](db[_0x79be('0x7d')]['query'](_0x15133d));}return BPromise[_0x79be('0x7e')](_0x444eb7);}})[_0x79be('0x23')](function(){return _0x5054b7;})[_0x79be('0x23')](respondWithResult(_0x462d7f,null))[_0x79be('0x48')](handleError(_0x462d7f,null));};exports['removeLists']=function(_0x3b64d0,_0x3885a6,_0x40221c){return db['Campaign'][_0x79be('0x46')]({'where':{'id':_0x3b64d0['params']['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x3885a6,null))['then'](function(_0x2d0feb){if(_0x2d0feb){return _0x2d0feb[_0x79be('0x7f')](_0x3b64d0['query'][_0x79be('0x61')]);}})[_0x79be('0x23')](function(_0x533b88){if(_0x533b88){return db[_0x79be('0x56')][_0x79be('0x24')]({'where':{'ListId':_0x3b64d0[_0x79be('0x32')][_0x79be('0x61')],'CampaignId':_0x3b64d0[_0x79be('0x49')]['id']}})[_0x79be('0x23')](function(){return _0x533b88;});}})[_0x79be('0x23')](respondWithStatusCode(_0x3885a6,null))[_0x79be('0x48')](handleError(_0x3885a6,null));};exports[_0x79be('0x80')]=function(_0x46eb4e,_0x4d899f,_0x30c573){var _0x2a0c46={};var _0x62fca1={};var _0x272d73;var _0x1e7d95;return db[_0x79be('0x2e')][_0x79be('0x55')]({'where':{'id':_0x46eb4e[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x4d899f,null))[_0x79be('0x23')](function(_0x50fac9){if(_0x50fac9){_0x272d73=_0x50fac9;_0x62fca1[_0x79be('0x35')]=_['keys'](db[_0x79be('0x81')][_0x79be('0x2f')]);_0x62fca1['query']=_[_0x79be('0x33')](_0x46eb4e[_0x79be('0x32')]);_0x62fca1[_0x79be('0x34')]=_['intersection'](_0x62fca1['model'],_0x62fca1[_0x79be('0x32')]);_0x2a0c46['attributes']=_[_0x79be('0x36')](_0x62fca1['model'],qs[_0x79be('0x37')](_0x46eb4e[_0x79be('0x32')][_0x79be('0x37')]));_0x2a0c46[_0x79be('0x38')]=_0x2a0c46[_0x79be('0x38')][_0x79be('0x39')]?_0x2a0c46[_0x79be('0x38')]:_0x62fca1[_0x79be('0x35')];_0x2a0c46[_0x79be('0x3b')]=qs[_0x79be('0x3c')](_0x46eb4e['query'][_0x79be('0x3c')]);_0x2a0c46[_0x79be('0x3d')]=qs['filters'](_[_0x79be('0x3e')](_0x46eb4e[_0x79be('0x32')],_0x62fca1[_0x79be('0x34')]));if(_0x46eb4e[_0x79be('0x32')][_0x79be('0x3f')]){_0x2a0c46[_0x79be('0x3d')]=_[_0x79be('0x40')](_0x2a0c46[_0x79be('0x3d')],{'$or':_[_0x79be('0x2d')](_0x2a0c46['attributes'],function(_0x3f6cc7){var _0x1a6e88={};_0x1a6e88[_0x3f6cc7]={'$like':'%'+_0x46eb4e['query'][_0x79be('0x3f')]+'%'};return _0x1a6e88;})});}_0x2a0c46=_[_0x79be('0x40')]({},_0x2a0c46,_0x46eb4e[_0x79be('0x41')]);return _0x272d73[_0x79be('0x80')](_0x2a0c46);}})[_0x79be('0x23')](function(_0x27784a){if(_0x27784a){_0x1e7d95=_0x27784a[_0x79be('0x39')];if(!_0x46eb4e['query'][_0x79be('0x57')](_0x79be('0x3a'))){_0x2a0c46[_0x79be('0x1d')]=qs[_0x79be('0x1d')](_0x46eb4e[_0x79be('0x32')]['limit']);_0x2a0c46[_0x79be('0x1a')]=qs['offset'](_0x46eb4e[_0x79be('0x32')][_0x79be('0x1a')]);}return _0x272d73['getBlackLists'](_0x2a0c46);}})[_0x79be('0x23')](function(_0x20dcf2){if(_0x20dcf2){return _0x20dcf2?{'count':_0x1e7d95,'rows':_0x20dcf2}:null;}})['then'](respondWithResult(_0x4d899f,null))[_0x79be('0x48')](handleError(_0x4d899f,null));};exports['addBlackLists']=function(_0x2e5bcd,_0x3bb17a,_0x237a66){var _0x5f481d,_0x53d0fc;return db[_0x79be('0x2e')][_0x79be('0x46')]({'where':{'id':_0x2e5bcd[_0x79be('0x49')]['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x3bb17a,null))[_0x79be('0x23')](function(_0x2f6054){if(_0x2f6054){_0x53d0fc=_0x2f6054;return _0x2f6054[_0x79be('0x82')](_0x2e5bcd[_0x79be('0x4c')][_0x79be('0x61')],_['omit'](_0x2e5bcd[_0x79be('0x4c')],[_0x79be('0x61'),'id'])||{});}return null;})[_0x79be('0x62')](function(_0x31895b){var _0x2f097a;_0x5f481d=_0x31895b||[];var _0x407859=[];if(_0x31895b){for(var _0x593906=0x0;_0x593906<_0x31895b['length'];_0x593906+=0x1){var _0xcf2085=_0x31895b[_0x593906]['get']({'plain':!![]});_0x2f097a=squel[_0x79be('0x64')]()[_0x79be('0x7b')](_0x79be('0x83'))[_0x79be('0x77')]([_0x79be('0x65'),_0x79be('0x66'),'ListId',_0x79be('0x58'),_0x79be('0x4d'),_0x79be('0x4b')],squel['select']()[_0x79be('0x68')](_0x79be('0x65'),_0x79be('0x65'))[_0x79be('0x68')]('id',_0x79be('0x66'))[_0x79be('0x68')](_0xcf2085[_0x79be('0x6f')][_0x79be('0x6a')](),_0x79be('0x6b'))[_0x79be('0x68')](_0x2e5bcd['params']['id'][_0x79be('0x6a')](),'CampaignId')[_0x79be('0x68')](_0x79be('0x69'),_0x79be('0x4d'))[_0x79be('0x68')]('NOW()',_0x79be('0x4b'))[_0x79be('0x6c')](_0x79be('0x6d'))[_0x79be('0x3d')](_0x79be('0x6e'))['where'](_0x79be('0x79'),_0xcf2085[_0x79be('0x6f')][_0x79be('0x6a')]())[_0x79be('0x3d')](_0x79be('0x70')))[_0x79be('0x6a')]();_0x407859['push'](db[_0x79be('0x7d')][_0x79be('0x32')](_0x2f097a));}return BPromise[_0x79be('0x7e')](_0x407859);}})[_0x79be('0x23')](function(){return _0x5f481d;})[_0x79be('0x23')](respondWithResult(_0x3bb17a,null))['catch'](handleError(_0x3bb17a,null));};exports[_0x79be('0x84')]=function(_0x35ed56,_0x2d5520,_0x3c11b4){return db['Campaign']['find']({'where':{'id':_0x35ed56['params']['id']}})[_0x79be('0x23')](handleEntityNotFound(_0x2d5520,null))[_0x79be('0x23')](function(_0x7d34db){if(_0x7d34db){return _0x7d34db[_0x79be('0x84')](_0x35ed56['query'][_0x79be('0x61')]);}})[_0x79be('0x23')](function(_0x4a4c96){if(_0x4a4c96){return db[_0x79be('0x5e')][_0x79be('0x24')]({'where':{'ListId':_0x35ed56['query'][_0x79be('0x61')],'CampaignId':_0x35ed56[_0x79be('0x49')]['id']}})[_0x79be('0x23')](function(){return _0x4a4c96;});}})[_0x79be('0x23')](respondWithStatusCode(_0x2d5520,null))[_0x79be('0x48')](handleError(_0x2d5520,null));};
\ No newline at end of file
index e9003c2..534ee06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5d59e8,_0x141b4f){var _0x1f13b6=function(_0x5e8bac){while(--_0x5e8bac){_0x5d59e8['push'](_0x5d59e8['shift']());}};_0x1f13b6(++_0x141b4f);}(_0x7a54,0x106));var _0x47a5=function(_0x497775,_0x4da078){_0x497775=_0x497775-0x0;var _0x4e4fc6=_0x7a54[_0x497775];return _0x4e4fc6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dfee4c6..9fbfd30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb201=['Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','raw','map','include','model','attributes','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x29c3c9,_0x4baef5){var _0x3ca6d5=function(_0x19574d){while(--_0x19574d){_0x29c3c9['push'](_0x29c3c9['shift']());}};_0x3ca6d5(++_0x4baef5);}(_0xb201,0x1b1));var _0x1b20=function(_0x11a9d6,_0x134bba){_0x11a9d6=_0x11a9d6-0x0;var _0x29604f=_0xb201[_0x11a9d6];return _0x29604f;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Campaign,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')]({'raw':_0xff7c72[_0x1b20('0x17')]?_0xff7c72[_0x1b20('0x17')][_0x1b20('0x18')]===undefined?!![]:![]:!![],'where':_0xff7c72[_0x1b20('0x17')]?_0xff7c72[_0x1b20('0x17')]['where']||null:null,'attributes':_0xff7c72[_0x1b20('0x17')]?_0xff7c72['options']['attributes']||null:null,'limit':_0xff7c72['options']?_0xff7c72[_0x1b20('0x17')]['limit']||null:null,'include':_0xff7c72['options']?_0xff7c72[_0x1b20('0x17')]['include']?_[_0x1b20('0x19')](_0xff7c72['options'][_0x1b20('0x1a')],function(_0x33e6ae){return{'model':db[_0x33e6ae[_0x1b20('0x1b')]],'as':_0x33e6ae['as'],'attributes':_0x33e6ae[_0x1b20('0x1c')],'include':_0x33e6ae[_0x1b20('0x1a')]?_[_0x1b20('0x19')](_0x33e6ae['include'],function(_0x590b44){return{'model':db[_0x590b44[_0x1b20('0x1b')]],'as':_0x590b44['as'],'attributes':_0x590b44[_0x1b20('0x1c')],'include':_0x590b44[_0x1b20('0x1a')]?_[_0x1b20('0x19')](_0x590b44[_0x1b20('0x1a')],function(_0x3a5cda){return{'model':db[_0x3a5cda[_0x1b20('0x1b')]],'as':_0x3a5cda['as'],'attributes':_0x3a5cda[_0x1b20('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1b20('0xb')](function(_0xefa7f3){logger['info']('GetCampaign',_0xff7c72);logger[_0x1b20('0x1d')]('GetCampaign',_0xff7c72,JSON['stringify'](_0xefa7f3));_0x34517f(_0xefa7f3);})['catch'](function(_0x342a84){logger[_0x1b20('0xf')](_0x1b20('0x14'),_0x342a84[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e[_0x1b20('0xf')](0x1f4,_0x342a84[_0x1b20('0x12')]));});});};
\ No newline at end of file
+var _0x1306=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','where','include','model','attributes','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1553be,_0x4b167f){var _0x418597=function(_0x56772f){while(--_0x56772f){_0x1553be['push'](_0x1553be['shift']());}};_0x418597(++_0x4b167f);}(_0x1306,0x17a));var _0x6130=function(_0x31f385,_0x265386){_0x31f385=_0x31f385-0x0;var _0xefdf7e=_0x1306[_0x31f385];return _0xefdf7e;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('Campaign,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});}exports[_0x6130('0x1a')]=function(_0x49803e){var _0x1cd785=this;return new Promise(function(_0xb6575d,_0x42d630){return db[_0x6130('0x1b')][_0x6130('0x1c')]({'raw':_0x49803e['options']?_0x49803e[_0x6130('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x49803e[_0x6130('0x1d')]?_0x49803e[_0x6130('0x1d')][_0x6130('0x1e')]||null:null,'attributes':_0x49803e[_0x6130('0x1d')]?_0x49803e[_0x6130('0x1d')]['attributes']||null:null,'limit':_0x49803e['options']?_0x49803e[_0x6130('0x1d')]['limit']||null:null,'include':_0x49803e[_0x6130('0x1d')]?_0x49803e[_0x6130('0x1d')]['include']?_['map'](_0x49803e['options'][_0x6130('0x1f')],function(_0x5369e3){return{'model':db[_0x5369e3[_0x6130('0x20')]],'as':_0x5369e3['as'],'attributes':_0x5369e3['attributes'],'include':_0x5369e3['include']?_['map'](_0x5369e3['include'],function(_0x5069bf){return{'model':db[_0x5069bf[_0x6130('0x20')]],'as':_0x5069bf['as'],'attributes':_0x5069bf[_0x6130('0x21')],'include':_0x5069bf['include']?_[_0x6130('0x22')](_0x5069bf['include'],function(_0x306935){return{'model':db[_0x306935['model']],'as':_0x306935['as'],'attributes':_0x306935['attributes']};}):[]};}):[]};}):[]:[]})[_0x6130('0xf')](function(_0x456231){logger[_0x6130('0x10')](_0x6130('0x1a'),_0x49803e);logger[_0x6130('0x13')](_0x6130('0x1a'),_0x49803e,JSON[_0x6130('0x15')](_0x456231));_0xb6575d(_0x456231);})[_0x6130('0x19')](function(_0x14dff0){logger['error']('GetCampaign',_0x14dff0[_0x6130('0x17')],_0x49803e);_0x42d630(_0x1cd785[_0x6130('0x16')](0x1f4,_0x14dff0[_0x6130('0x17')]));});});};
\ No newline at end of file
index 1d4df79..df5f761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecbe=['isAuthenticated','index','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','post','clone','addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xecbe,0x9b));var _0xeecb=function(_0x6b888e,_0x420fed){_0x6b888e=_0x6b888e-0x0;var _0x17d0f6=_0xecbe[_0x6b888e];return _0x17d0f6;};'use strict';var multer=require(_0xeecb('0x0'));var util=require(_0xeecb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeecb('0x2'));var router=express[_0xeecb('0x3')]();var fs_extra=require(_0xeecb('0x4'));var auth=require(_0xeecb('0x5'));var interaction=require(_0xeecb('0x6'));var config=require(_0xeecb('0x7'));var controller=require(_0xeecb('0x8'));router[_0xeecb('0x9')]('/',auth[_0xeecb('0xa')](),controller[_0xeecb('0xb')]);router[_0xeecb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xeecb('0xc')]);router[_0xeecb('0x9')](_0xeecb('0xd'),auth[_0xeecb('0xa')](),controller['getHoppers']);router[_0xeecb('0x9')](_0xeecb('0xe'),auth[_0xeecb('0xa')](),controller[_0xeecb('0xf')]);router[_0xeecb('0x9')](_0xeecb('0x10'),auth[_0xeecb('0xa')](),controller[_0xeecb('0x11')]);router['get'](_0xeecb('0x12'),auth[_0xeecb('0xa')](),controller['getHopperBlacks']);router[_0xeecb('0x9')](_0xeecb('0x13'),auth[_0xeecb('0xa')](),controller['getLists']);router[_0xeecb('0x9')](_0xeecb('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xeecb('0x15')]('/',auth[_0xeecb('0xa')](),controller['create']);router[_0xeecb('0x15')]('/:id/clone',auth[_0xeecb('0xa')](),controller[_0xeecb('0x16')]);router[_0xeecb('0x15')]('/:id/lists',auth[_0xeecb('0xa')](),controller[_0xeecb('0x17')]);router['post'](_0xeecb('0x14'),auth['isAuthenticated'](),controller[_0xeecb('0x18')]);router[_0xeecb('0x19')](_0xeecb('0x1a'),auth[_0xeecb('0xa')](),controller[_0xeecb('0x1b')]);router[_0xeecb('0x1c')](_0xeecb('0x1a'),auth['isAuthenticated'](),controller[_0xeecb('0x1d')]);router[_0xeecb('0x1c')](_0xeecb('0x13'),auth[_0xeecb('0xa')](),controller[_0xeecb('0x1e')]);router[_0xeecb('0x1c')](_0xeecb('0x14'),auth[_0xeecb('0xa')](),controller[_0xeecb('0x1f')]);module[_0xeecb('0x20')]=router;
\ No newline at end of file
+var _0x0642=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','post','create','/:id/clone','clone','addLists','/:id/blacklists','update','delete','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x0642,0x1dc));var _0x2064=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0x0642[_0x365be9];return _0x185c12;};'use strict';var multer=require(_0x2064('0x0'));var util=require('util');var path=require(_0x2064('0x1'));var timeout=require(_0x2064('0x2'));var express=require(_0x2064('0x3'));var router=express[_0x2064('0x4')]();var fs_extra=require(_0x2064('0x5'));var auth=require(_0x2064('0x6'));var interaction=require(_0x2064('0x7'));var config=require(_0x2064('0x8'));var controller=require('./campaign.controller');router[_0x2064('0x9')]('/',auth[_0x2064('0xa')](),controller[_0x2064('0xb')]);router[_0x2064('0x9')](_0x2064('0xc'),auth[_0x2064('0xa')](),controller['show']);router[_0x2064('0x9')](_0x2064('0xd'),auth[_0x2064('0xa')](),controller[_0x2064('0xe')]);router[_0x2064('0x9')](_0x2064('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x2064('0x9')]('/:id/hopper_finals',auth[_0x2064('0xa')](),controller[_0x2064('0x10')]);router[_0x2064('0x9')](_0x2064('0x11'),auth[_0x2064('0xa')](),controller['getHopperBlacks']);router['get'](_0x2064('0x12'),auth[_0x2064('0xa')](),controller['getLists']);router[_0x2064('0x9')]('/:id/blacklists',auth[_0x2064('0xa')](),controller['getBlackLists']);router[_0x2064('0x13')]('/',auth['isAuthenticated'](),controller[_0x2064('0x14')]);router[_0x2064('0x13')](_0x2064('0x15'),auth[_0x2064('0xa')](),controller[_0x2064('0x16')]);router[_0x2064('0x13')](_0x2064('0x12'),auth['isAuthenticated'](),controller[_0x2064('0x17')]);router[_0x2064('0x13')](_0x2064('0x18'),auth[_0x2064('0xa')](),controller['addBlackLists']);router['put'](_0x2064('0xc'),auth[_0x2064('0xa')](),controller[_0x2064('0x19')]);router[_0x2064('0x1a')](_0x2064('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2064('0x1a')](_0x2064('0x12'),auth['isAuthenticated'](),controller[_0x2064('0x1b')]);router[_0x2064('0x1a')]('/:id/blacklists',auth[_0x2064('0xa')](),controller[_0x2064('0x1c')]);module[_0x2064('0x1d')]=router;
\ No newline at end of file
index 0c066f5..f8fa8e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1348=['STRING','TEXT','getDataValue','key','sequelize','exports'];(function(_0x58d217,_0x5acb1a){var _0x2774ac=function(_0x128afa){while(--_0x128afa){_0x58d217['push'](_0x58d217['shift']());}};_0x2774ac(++_0x5acb1a);}(_0x1348,0x1cc));var _0x8134=function(_0x2d8abe,_0x17ac67){_0x2d8abe=_0x2d8abe-0x0;var _0x724047=_0x1348[_0x2d8abe];return _0x724047;};'use strict';var Sequelize=require(_0x8134('0x0'));module[_0x8134('0x1')]={'key':{'type':Sequelize[_0x8134('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8134('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x8134('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8134('0x4')](_0x8134('0x5'));}}};
\ No newline at end of file
+var _0x2599=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2599,0xf5));var _0x9259=function(_0x559897,_0x2eda50){_0x559897=_0x559897-0x0;var _0x56320e=_0x2599[_0x559897];return _0x56320e;};'use strict';var Sequelize=require(_0x9259('0x0'));module[_0x9259('0x1')]={'key':{'type':Sequelize[_0x9259('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9259('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9259('0x2')]},'name':{'type':Sequelize[_0x9259('0x4')],'get':function(){return this[_0x9259('0x5')](_0x9259('0x6'));}}};
\ No newline at end of file
index cc0be75..8842b61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf16e=['end','error','stack','send','index','map','CannedAnswer','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','length','find','update','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','role','UserProfileSection','userProfileId','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','get','CannedAnswers','UserProfileResource'];(function(_0x18412f,_0x441675){var _0x130b9d=function(_0x4a3aff){while(--_0x4a3aff){_0x18412f['push'](_0x18412f['shift']());}};_0x130b9d(++_0x441675);}(_0xf16e,0x1cf));var _0xef16=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xf16e[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef16('0x0'));var zipdir=require(_0xef16('0x1'));var jsonpatch=require(_0xef16('0x2'));var rp=require(_0xef16('0x3'));var moment=require(_0xef16('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xef16('0x5'));var util=require(_0xef16('0x6'));var path=require(_0xef16('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef16('0x8'));var _=require(_0xef16('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xef16('0xa'));var toCsv=require(_0xef16('0xb'));var querystring=require(_0xef16('0xc'));var Papa=require(_0xef16('0xd'));var Redis=require('ioredis');var authService=require(_0xef16('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef16('0xf'))(_0xef16('0x10'));var utils=require(_0xef16('0x11'));var config=require(_0xef16('0x12'));var licenseUtil=require(_0xef16('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464f19,_0x75704){_0x75704=_0x75704||0xcc;return function(_0x5e441e){if(_0x5e441e){return _0x464f19[_0xef16('0x14')](_0x75704);}return _0x464f19[_0xef16('0x15')](_0x75704)['end']();};}function respondWithResult(_0x29afed,_0x29ee27){_0x29ee27=_0x29ee27||0xc8;return function(_0x5eca7e){if(_0x5eca7e){return _0x29afed[_0xef16('0x15')](_0x29ee27)[_0xef16('0x16')](_0x5eca7e);}};}function respondWithFilteredResult(_0x1372d9,_0x429027){return function(_0x5d3a30){if(_0x5d3a30){var _0x57c87d=typeof _0x429027[_0xef16('0x17')]===_0xef16('0x18')&&typeof _0x429027[_0xef16('0x19')]===_0xef16('0x18');var _0x166188=_0x5d3a30[_0xef16('0x1a')];var _0x4fca58=_0x57c87d?0x0:_0x429027['offset'];var _0xc81066=_0x57c87d?_0x5d3a30[_0xef16('0x1a')]:_0x429027['offset']+_0x429027[_0xef16('0x19')];var _0x2714b8;if(_0xc81066>=_0x166188){_0xc81066=_0x166188;_0x2714b8=0xc8;}else{_0x2714b8=0xce;}_0x1372d9[_0xef16('0x15')](_0x2714b8);return _0x1372d9[_0xef16('0x1b')](_0xef16('0x1c'),_0x4fca58+'-'+_0xc81066+'/'+_0x166188)[_0xef16('0x16')](_0x5d3a30);}return null;};}function patchUpdates(_0xac2a04){return function(_0x232ede){try{jsonpatch[_0xef16('0x1d')](_0x232ede,_0xac2a04,!![]);}catch(_0x3599c0){return BPromise['reject'](_0x3599c0);}return _0x232ede[_0xef16('0x1e')]();};}function saveUpdates(_0x3744b5,_0x5bd8fe){return function(_0x14a5c2){if(_0x14a5c2){return _0x14a5c2['update'](_0x3744b5)[_0xef16('0x1f')](function(_0x26a864){return _0x26a864;});}return null;};}function removeEntity(_0x32ad9,_0x2c350f){return function(_0x3bee3b){if(_0x3bee3b){return _0x3bee3b['destroy']()['then'](function(){var _0x511b77=_0x3bee3b[_0xef16('0x20')]({'plain':!![]});var _0x55f803=_0xef16('0x21');return db[_0xef16('0x22')]['destroy']({'where':{'type':_0x55f803,'resourceId':_0x511b77['id']}})['then'](function(){return _0x3bee3b;});})[_0xef16('0x1f')](function(){_0x32ad9['status'](0xcc)[_0xef16('0x23')]();});}};}function handleEntityNotFound(_0x4dbcf4,_0x3fde17){return function(_0x183e15){if(!_0x183e15){_0x4dbcf4[_0xef16('0x14')](0x194);}return _0x183e15;};}function handleError(_0x592799,_0x4df4d2){_0x4df4d2=_0x4df4d2||0x1f4;return function(_0x2f1649){logger[_0xef16('0x24')](_0x2f1649[_0xef16('0x25')]);if(_0x2f1649['name']){delete _0x2f1649['name'];}_0x592799[_0xef16('0x15')](_0x4df4d2)[_0xef16('0x26')](_0x2f1649);};}exports[_0xef16('0x27')]=function(_0x3750d9,_0xaca27f){var _0x10de27={},_0xd031bf={},_0x5c9bf2={'count':0x0,'rows':[]};var _0x5c2f2e=_[_0xef16('0x28')](db[_0xef16('0x29')][_0xef16('0x2a')],function(_0x467a6d){return{'name':_0x467a6d['fieldName'],'type':_0x467a6d[_0xef16('0x2b')][_0xef16('0x2c')]};});_0xd031bf[_0xef16('0x2d')]=_[_0xef16('0x28')](_0x5c2f2e,_0xef16('0x2e'));_0xd031bf['query']=_[_0xef16('0x2f')](_0x3750d9[_0xef16('0x30')]);_0xd031bf[_0xef16('0x31')]=_[_0xef16('0x32')](_0xd031bf[_0xef16('0x2d')],_0xd031bf[_0xef16('0x30')]);_0x10de27[_0xef16('0x33')]=_[_0xef16('0x32')](_0xd031bf[_0xef16('0x2d')],qs['fields'](_0x3750d9[_0xef16('0x30')][_0xef16('0x34')]));_0x10de27[_0xef16('0x33')]=_0x10de27[_0xef16('0x33')]['length']?_0x10de27['attributes']:_0xd031bf[_0xef16('0x2d')];if(!_0x3750d9[_0xef16('0x30')][_0xef16('0x35')](_0xef16('0x36'))){_0x10de27[_0xef16('0x19')]=qs[_0xef16('0x19')](_0x3750d9[_0xef16('0x30')][_0xef16('0x19')]);_0x10de27[_0xef16('0x17')]=qs['offset'](_0x3750d9[_0xef16('0x30')][_0xef16('0x17')]);}_0x10de27[_0xef16('0x37')]=qs[_0xef16('0x38')](_0x3750d9[_0xef16('0x30')][_0xef16('0x38')]);_0x10de27[_0xef16('0x39')]=qs['filters'](_['pick'](_0x3750d9[_0xef16('0x30')],_0xd031bf[_0xef16('0x31')]),_0x5c2f2e);if(_0x3750d9['query'][_0xef16('0x3a')]){_0x10de27[_0xef16('0x39')]=_[_0xef16('0x3b')](_0x10de27['where'],{'$or':[{'key':{'$like':'%'+_0x3750d9['query']['filter']+'%'}},{'value':{'$like':'%'+_0x3750d9['query'][_0xef16('0x3a')]+'%'}}]});}_0x10de27=_[_0xef16('0x3b')]({},_0x10de27,_0x3750d9[_0xef16('0x3c')]);var _0x284e69={'where':_0x10de27['where']};return db[_0xef16('0x29')][_0xef16('0x1a')](_0x284e69)[_0xef16('0x1f')](function(_0x6089e3){_0x5c9bf2[_0xef16('0x1a')]=_0x6089e3;if(_0x3750d9[_0xef16('0x30')][_0xef16('0x3d')]){_0x10de27[_0xef16('0x3e')]=[{'all':!![]}];}return db[_0xef16('0x29')][_0xef16('0x3f')](_0x10de27);})[_0xef16('0x1f')](function(_0x32caac){_0x5c9bf2['rows']=_0x32caac;return _0x5c9bf2;})[_0xef16('0x1f')](respondWithFilteredResult(_0xaca27f,_0x10de27))[_0xef16('0x40')](handleError(_0xaca27f,null));};exports[_0xef16('0x41')]=function(_0x325c11,_0x46c36e){var _0x2d31cc={'raw':!![],'where':{'id':_0x325c11[_0xef16('0x42')]['id']}},_0x23ab61={};_0x23ab61[_0xef16('0x2d')]=_[_0xef16('0x2f')](db[_0xef16('0x29')][_0xef16('0x2a')]);_0x23ab61['query']=_[_0xef16('0x2f')](_0x325c11[_0xef16('0x30')]);_0x23ab61[_0xef16('0x31')]=_['intersection'](_0x23ab61[_0xef16('0x2d')],_0x23ab61[_0xef16('0x30')]);_0x2d31cc[_0xef16('0x33')]=_['intersection'](_0x23ab61['model'],qs[_0xef16('0x34')](_0x325c11['query'][_0xef16('0x34')]));_0x2d31cc[_0xef16('0x33')]=_0x2d31cc[_0xef16('0x33')][_0xef16('0x43')]?_0x2d31cc[_0xef16('0x33')]:_0x23ab61['model'];if(_0x325c11[_0xef16('0x30')][_0xef16('0x3d')]){_0x2d31cc['include']=[{'all':!![]}];}_0x2d31cc=_[_0xef16('0x3b')]({},_0x2d31cc,_0x325c11[_0xef16('0x3c')]);return db[_0xef16('0x29')][_0xef16('0x44')](_0x2d31cc)[_0xef16('0x1f')](handleEntityNotFound(_0x46c36e,null))['then'](respondWithResult(_0x46c36e,null))[_0xef16('0x40')](handleError(_0x46c36e,null));};exports[_0xef16('0x45')]=function(_0x19fb2f,_0xa2bd41){if(_0x19fb2f[_0xef16('0x46')]['id']){delete _0x19fb2f['body']['id'];}return db[_0xef16('0x29')][_0xef16('0x44')]({'where':{'id':_0x19fb2f[_0xef16('0x42')]['id']}})[_0xef16('0x1f')](handleEntityNotFound(_0xa2bd41,null))[_0xef16('0x1f')](saveUpdates(_0x19fb2f[_0xef16('0x46')],null))['then'](respondWithResult(_0xa2bd41,null))['catch'](handleError(_0xa2bd41,null));};exports[_0xef16('0x47')]=function(_0x228572,_0x22fb81){return db[_0xef16('0x29')][_0xef16('0x44')]({'where':{'id':_0x228572[_0xef16('0x42')]['id']}})[_0xef16('0x1f')](handleEntityNotFound(_0x22fb81,null))['then'](removeEntity(_0x22fb81,null))[_0xef16('0x40')](handleError(_0x22fb81,null));};exports[_0xef16('0x48')]=function(_0x5a95a8,_0x3589c8){var _0x271c86={'key':_0x5a95a8[_0xef16('0x46')][_0xef16('0x2c')]};if(_0x5a95a8[_0xef16('0x46')][_0xef16('0x49')]){_0x271c86[_0xef16('0x49')]=_0x5a95a8[_0xef16('0x46')][_0xef16('0x49')];}else if(_0x5a95a8[_0xef16('0x46')]['SmsAccountId']){_0x271c86[_0xef16('0x4a')]=_0x5a95a8[_0xef16('0x46')]['SmsAccountId'];}else if(_0x5a95a8[_0xef16('0x46')][_0xef16('0x4b')]){_0x271c86[_0xef16('0x4b')]=_0x5a95a8[_0xef16('0x46')][_0xef16('0x4b')];}else if(_0x5a95a8[_0xef16('0x46')][_0xef16('0x4c')]){_0x271c86[_0xef16('0x4c')]=_0x5a95a8[_0xef16('0x46')][_0xef16('0x4c')];}return db[_0xef16('0x29')]['find']({'where':_0x271c86})[_0xef16('0x1f')](function(_0x299436){if(_0x299436){throw new db[(_0xef16('0x4d'))][(_0xef16('0x4e'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer']['create'](_0x5a95a8[_0xef16('0x46')]);})[_0xef16('0x1f')](function(_0xd5077){var _0x268313=_0x5a95a8[_0xef16('0x4f')][_0xef16('0x20')]({'plain':!![]});if(!_0x268313)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x268313[_0xef16('0x50')]===_0xef16('0x4f')){var _0x491be5=_0xd5077[_0xef16('0x20')]({'plain':!![]});return db[_0xef16('0x51')][_0xef16('0x44')]({'where':{'name':_0xef16('0x21'),'userProfileId':_0x268313[_0xef16('0x52')]},'raw':!![]})[_0xef16('0x1f')](function(_0x453138){if(_0x453138&&_0x453138['autoAssociation']===0x0){return db[_0xef16('0x22')][_0xef16('0x48')]({'name':_0x491be5[_0xef16('0x2e')],'resourceId':_0x491be5['id'],'type':_0x453138[_0xef16('0x2e')],'sectionId':_0x453138['id']},{})[_0xef16('0x1f')](function(){return _0xd5077;});}else{return _0xd5077;}})[_0xef16('0x40')](function(_0x22f081){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22f081);throw _0x22f081;});}return _0xd5077;})[_0xef16('0x1f')](respondWithResult(_0x3589c8,0xc9))[_0xef16('0x40')](handleError(_0x3589c8,null));};
\ No newline at end of file
+var _0xa82a=['params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','rows','catch','attributes','include','body','find'];(function(_0x41efcf,_0x1dac15){var _0xb06961=function(_0x293f97){while(--_0x293f97){_0x41efcf['push'](_0x41efcf['shift']());}};_0xb06961(++_0x1dac15);}(_0xa82a,0x1c6));var _0xaa82=function(_0x44b5ec,_0x290eff){_0x44b5ec=_0x44b5ec-0x0;var _0x17e60a=_0xa82a[_0x44b5ec];return _0x17e60a;};'use strict';var emlformat=require(_0xaa82('0x0'));var rimraf=require(_0xaa82('0x1'));var zipdir=require(_0xaa82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa82('0x3'));var BPromise=require(_0xaa82('0x4'));var Mustache=require(_0xaa82('0x5'));var util=require(_0xaa82('0x6'));var path=require(_0xaa82('0x7'));var sox=require(_0xaa82('0x8'));var csv=require(_0xaa82('0x9'));var ejs=require(_0xaa82('0xa'));var fs=require('fs');var fs_extra=require(_0xaa82('0xb'));var _=require(_0xaa82('0xc'));var squel=require(_0xaa82('0xd'));var crypto=require(_0xaa82('0xe'));var jsforce=require(_0xaa82('0xf'));var deskjs=require(_0xaa82('0x10'));var toCsv=require('to-csv');var querystring=require(_0xaa82('0x11'));var Papa=require('papaparse');var Redis=require(_0xaa82('0x12'));var authService=require(_0xaa82('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaa82('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa82('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xaa82('0x16'));var licenseUtil=require(_0xaa82('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x258c78,_0x13674f){_0x13674f=_0x13674f||0xcc;return function(_0x4646f6){if(_0x4646f6){return _0x258c78[_0xaa82('0x18')](_0x13674f);}return _0x258c78[_0xaa82('0x19')](_0x13674f)[_0xaa82('0x1a')]();};}function respondWithResult(_0x4f9146,_0x4ba03c){_0x4ba03c=_0x4ba03c||0xc8;return function(_0x209fb0){if(_0x209fb0){return _0x4f9146['status'](_0x4ba03c)[_0xaa82('0x1b')](_0x209fb0);}};}function respondWithFilteredResult(_0x44ec26,_0x568457){return function(_0x414bc2){if(_0x414bc2){var _0x405381=typeof _0x568457['offset']===_0xaa82('0x1c')&&typeof _0x568457['limit']==='undefined';var _0x13a12b=_0x414bc2['count'];var _0x410fc5=_0x405381?0x0:_0x568457[_0xaa82('0x1d')];var _0x388e0a=_0x405381?_0x414bc2[_0xaa82('0x1e')]:_0x568457[_0xaa82('0x1d')]+_0x568457['limit'];var _0x404c8d;if(_0x388e0a>=_0x13a12b){_0x388e0a=_0x13a12b;_0x404c8d=0xc8;}else{_0x404c8d=0xce;}_0x44ec26[_0xaa82('0x19')](_0x404c8d);return _0x44ec26[_0xaa82('0x1f')](_0xaa82('0x20'),_0x410fc5+'-'+_0x388e0a+'/'+_0x13a12b)[_0xaa82('0x1b')](_0x414bc2);}return null;};}function patchUpdates(_0x376a82){return function(_0x4f794d){try{jsonpatch[_0xaa82('0x21')](_0x4f794d,_0x376a82,!![]);}catch(_0x5c8b55){return BPromise[_0xaa82('0x22')](_0x5c8b55);}return _0x4f794d['save']();};}function saveUpdates(_0x2f3802,_0x1a7a62){return function(_0x1a2964){if(_0x1a2964){return _0x1a2964[_0xaa82('0x23')](_0x2f3802)[_0xaa82('0x24')](function(_0xde7f72){return _0xde7f72;});}return null;};}function removeEntity(_0x153aff,_0x2dcf7a){return function(_0x4f821e){if(_0x4f821e){return _0x4f821e[_0xaa82('0x25')]()[_0xaa82('0x24')](function(){var _0x1072a8=_0x4f821e[_0xaa82('0x26')]({'plain':!![]});var _0x15ae5e=_0xaa82('0x27');return db['UserProfileResource'][_0xaa82('0x25')]({'where':{'type':_0x15ae5e,'resourceId':_0x1072a8['id']}})[_0xaa82('0x24')](function(){return _0x4f821e;});})[_0xaa82('0x24')](function(){_0x153aff[_0xaa82('0x19')](0xcc)[_0xaa82('0x1a')]();});}};}function handleEntityNotFound(_0x2c02bd,_0x1ccaa6){return function(_0x2b18b6){if(!_0x2b18b6){_0x2c02bd[_0xaa82('0x18')](0x194);}return _0x2b18b6;};}function handleError(_0x5cc2e2,_0x4cad5e){_0x4cad5e=_0x4cad5e||0x1f4;return function(_0xfd97c5){logger[_0xaa82('0x28')](_0xfd97c5['stack']);if(_0xfd97c5[_0xaa82('0x29')]){delete _0xfd97c5['name'];}_0x5cc2e2[_0xaa82('0x19')](_0x4cad5e)[_0xaa82('0x2a')](_0xfd97c5);};}exports[_0xaa82('0x2b')]=function(_0x494f4e,_0xadb1c5){var _0x1a2227={},_0x5af62b={},_0x5eeda5={'count':0x0,'rows':[]};var _0x3bbfcc=_[_0xaa82('0x2c')](db[_0xaa82('0x2d')][_0xaa82('0x2e')],function(_0x4a3f6f){return{'name':_0x4a3f6f[_0xaa82('0x2f')],'type':_0x4a3f6f[_0xaa82('0x30')][_0xaa82('0x31')]};});_0x5af62b[_0xaa82('0x32')]=_[_0xaa82('0x2c')](_0x3bbfcc,_0xaa82('0x29'));_0x5af62b[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x494f4e['query']);_0x5af62b['filters']=_[_0xaa82('0x35')](_0x5af62b[_0xaa82('0x32')],_0x5af62b[_0xaa82('0x33')]);_0x1a2227['attributes']=_[_0xaa82('0x35')](_0x5af62b[_0xaa82('0x32')],qs[_0xaa82('0x36')](_0x494f4e[_0xaa82('0x33')][_0xaa82('0x36')]));_0x1a2227['attributes']=_0x1a2227['attributes'][_0xaa82('0x37')]?_0x1a2227['attributes']:_0x5af62b[_0xaa82('0x32')];if(!_0x494f4e[_0xaa82('0x33')][_0xaa82('0x38')](_0xaa82('0x39'))){_0x1a2227[_0xaa82('0x3a')]=qs[_0xaa82('0x3a')](_0x494f4e[_0xaa82('0x33')][_0xaa82('0x3a')]);_0x1a2227[_0xaa82('0x1d')]=qs[_0xaa82('0x1d')](_0x494f4e['query'][_0xaa82('0x1d')]);}_0x1a2227[_0xaa82('0x3b')]=qs[_0xaa82('0x3c')](_0x494f4e[_0xaa82('0x33')][_0xaa82('0x3c')]);_0x1a2227[_0xaa82('0x3d')]=qs[_0xaa82('0x3e')](_[_0xaa82('0x3f')](_0x494f4e[_0xaa82('0x33')],_0x5af62b[_0xaa82('0x3e')]),_0x3bbfcc);if(_0x494f4e['query'][_0xaa82('0x40')]){_0x1a2227['where']=_['merge'](_0x1a2227[_0xaa82('0x3d')],{'$or':[{'key':{'$like':'%'+_0x494f4e[_0xaa82('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0x494f4e['query'][_0xaa82('0x40')]+'%'}}]});}_0x1a2227=_[_0xaa82('0x41')]({},_0x1a2227,_0x494f4e[_0xaa82('0x42')]);var _0x5accb8={'where':_0x1a2227[_0xaa82('0x3d')]};return db[_0xaa82('0x2d')][_0xaa82('0x1e')](_0x5accb8)[_0xaa82('0x24')](function(_0x503eb7){_0x5eeda5[_0xaa82('0x1e')]=_0x503eb7;if(_0x494f4e['query'][_0xaa82('0x43')]){_0x1a2227['include']=[{'all':!![]}];}return db[_0xaa82('0x2d')]['findAll'](_0x1a2227);})['then'](function(_0x264079){_0x5eeda5[_0xaa82('0x44')]=_0x264079;return _0x5eeda5;})[_0xaa82('0x24')](respondWithFilteredResult(_0xadb1c5,_0x1a2227))[_0xaa82('0x45')](handleError(_0xadb1c5,null));};exports['show']=function(_0x111131,_0x1fd468){var _0x3ad60b={'raw':!![],'where':{'id':_0x111131['params']['id']}},_0x246f43={};_0x246f43[_0xaa82('0x32')]=_[_0xaa82('0x34')](db[_0xaa82('0x2d')][_0xaa82('0x2e')]);_0x246f43[_0xaa82('0x33')]=_[_0xaa82('0x34')](_0x111131[_0xaa82('0x33')]);_0x246f43['filters']=_[_0xaa82('0x35')](_0x246f43[_0xaa82('0x32')],_0x246f43[_0xaa82('0x33')]);_0x3ad60b[_0xaa82('0x46')]=_[_0xaa82('0x35')](_0x246f43[_0xaa82('0x32')],qs[_0xaa82('0x36')](_0x111131[_0xaa82('0x33')][_0xaa82('0x36')]));_0x3ad60b[_0xaa82('0x46')]=_0x3ad60b[_0xaa82('0x46')]['length']?_0x3ad60b[_0xaa82('0x46')]:_0x246f43['model'];if(_0x111131[_0xaa82('0x33')][_0xaa82('0x43')]){_0x3ad60b[_0xaa82('0x47')]=[{'all':!![]}];}_0x3ad60b=_['merge']({},_0x3ad60b,_0x111131['options']);return db[_0xaa82('0x2d')]['find'](_0x3ad60b)[_0xaa82('0x24')](handleEntityNotFound(_0x1fd468,null))[_0xaa82('0x24')](respondWithResult(_0x1fd468,null))[_0xaa82('0x45')](handleError(_0x1fd468,null));};exports[_0xaa82('0x23')]=function(_0xea8077,_0x3db082){if(_0xea8077['body']['id']){delete _0xea8077[_0xaa82('0x48')]['id'];}return db['CannedAnswer'][_0xaa82('0x49')]({'where':{'id':_0xea8077[_0xaa82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3db082,null))[_0xaa82('0x24')](saveUpdates(_0xea8077[_0xaa82('0x48')],null))[_0xaa82('0x24')](respondWithResult(_0x3db082,null))[_0xaa82('0x45')](handleError(_0x3db082,null));};exports['destroy']=function(_0x3a1632,_0x1ec1da){return db[_0xaa82('0x2d')][_0xaa82('0x49')]({'where':{'id':_0x3a1632['params']['id']}})[_0xaa82('0x24')](handleEntityNotFound(_0x1ec1da,null))['then'](removeEntity(_0x1ec1da,null))[_0xaa82('0x45')](handleError(_0x1ec1da,null));};exports[_0xaa82('0x4b')]=function(_0x334933,_0x5221ce){var _0x4342ca={'key':_0x334933[_0xaa82('0x48')][_0xaa82('0x31')]};if(_0x334933['body'][_0xaa82('0x4c')]){_0x4342ca[_0xaa82('0x4c')]=_0x334933[_0xaa82('0x48')][_0xaa82('0x4c')];}else if(_0x334933[_0xaa82('0x48')][_0xaa82('0x4d')]){_0x4342ca['SmsAccountId']=_0x334933['body'][_0xaa82('0x4d')];}else if(_0x334933[_0xaa82('0x48')]['OpenchannelAccountId']){_0x4342ca['OpenchannelAccountId']=_0x334933[_0xaa82('0x48')][_0xaa82('0x4e')];}else if(_0x334933[_0xaa82('0x48')][_0xaa82('0x4f')]){_0x4342ca[_0xaa82('0x4f')]=_0x334933[_0xaa82('0x48')][_0xaa82('0x4f')];}return db[_0xaa82('0x2d')]['find']({'where':_0x4342ca})[_0xaa82('0x24')](function(_0x3d8310){if(_0x3d8310){throw new db[(_0xaa82('0x50'))][(_0xaa82('0x51'))](_0xaa82('0x52'));}return db[_0xaa82('0x2d')][_0xaa82('0x4b')](_0x334933[_0xaa82('0x48')]);})[_0xaa82('0x24')](function(_0x42048f){var _0x1684f6=_0x334933[_0xaa82('0x53')][_0xaa82('0x26')]({'plain':!![]});if(!_0x1684f6)throw new Error(_0xaa82('0x54'));if(_0x1684f6['role']===_0xaa82('0x53')){var _0x4d30a5=_0x42048f[_0xaa82('0x26')]({'plain':!![]});return db[_0xaa82('0x55')]['find']({'where':{'name':_0xaa82('0x27'),'userProfileId':_0x1684f6[_0xaa82('0x56')]},'raw':!![]})[_0xaa82('0x24')](function(_0x58a32f){if(_0x58a32f&&_0x58a32f['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa82('0x4b')]({'name':_0x4d30a5[_0xaa82('0x29')],'resourceId':_0x4d30a5['id'],'type':_0x58a32f[_0xaa82('0x29')],'sectionId':_0x58a32f['id']},{})[_0xaa82('0x24')](function(){return _0x42048f;});}else{return _0x42048f;}})['catch'](function(_0x5bf896){logger[_0xaa82('0x28')](_0xaa82('0x57'),_0x5bf896);throw _0x5bf896;});}return _0x42048f;})[_0xaa82('0x24')](respondWithResult(_0x5221ce,0xc9))[_0xaa82('0x45')](handleError(_0x5221ce,null));};
\ No newline at end of file
index f2d6de5..798a070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa269=['path','rimraf','../../config/environment','./cannedAnswer.attributes','tools_canned_answers','lodash','util','moment','bluebird','request-promise'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa269,0x1ef));var _0x9a26=function(_0x1a8cf4,_0x445497){_0x1a8cf4=_0x1a8cf4-0x0;var _0x3f8da7=_0xa269[_0x1a8cf4];return _0x3f8da7;};'use strict';var _=require(_0x9a26('0x0'));var util=require(_0x9a26('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9a26('0x2'));var BPromise=require(_0x9a26('0x3'));var rp=require(_0x9a26('0x4'));var fs=require('fs');var path=require(_0x9a26('0x5'));var rimraf=require(_0x9a26('0x6'));var config=require(_0x9a26('0x7'));var attributes=require(_0x9a26('0x8'));module['exports']=function(_0x3e434c,_0x2ca33d){return _0x3e434c['define']('CannedAnswer',attributes,{'tableName':_0x9a26('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x61bf=['rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x3a6415,_0x4f862e){var _0xca3cee=function(_0xc3f9a2){while(--_0xc3f9a2){_0x3a6415['push'](_0x3a6415['shift']());}};_0xca3cee(++_0x4f862e);}(_0x61bf,0x96));var _0xf61b=function(_0x380f23,_0x23966f){_0x380f23=_0x380f23-0x0;var _0x3d3739=_0x61bf[_0x380f23];return _0x3d3739;};'use strict';var _=require(_0xf61b('0x0'));var util=require(_0xf61b('0x1'));var logger=require(_0xf61b('0x2'))(_0xf61b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf61b('0x4'));var fs=require('fs');var path=require(_0xf61b('0x5'));var rimraf=require(_0xf61b('0x6'));var config=require(_0xf61b('0x7'));var attributes=require(_0xf61b('0x8'));module['exports']=function(_0x27890a,_0x2ea32b){return _0x27890a[_0xf61b('0x9')](_0xf61b('0xa'),attributes,{'tableName':_0xf61b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf61b('0xc')});};
\ No newline at end of file
index 5fe4847..36ec9bc 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(_0x10defe,_0x1a04f9){var _0x2164be=function(_0x3692d0){while(--_0x3692d0){_0x10defe['push'](_0x10defe['shift']());}};_0x2164be(++_0x1a04f9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+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(_0x28abed,_0xa821f8){var _0x5c553d=function(_0x336b38){while(--_0x336b38){_0x28abed['push'](_0x28abed['shift']());}};_0x5c553d(++_0xa821f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 2ab4698..21d5c94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd79c=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x31144c,_0xad8c5d){var _0x18beab=function(_0x1b1a01){while(--_0x1b1a01){_0x31144c['push'](_0x31144c['shift']());}};_0x18beab(++_0xad8c5d);}(_0xd79c,0x145));var _0xcd79=function(_0xcbeae8,_0x1c7d9f){_0xcbeae8=_0xcbeae8-0x0;var _0x17db07=_0xd79c[_0xcbeae8];return _0x17db07;};'use strict';var multer=require(_0xcd79('0x0'));var util=require(_0xcd79('0x1'));var path=require('path');var timeout=require(_0xcd79('0x2'));var express=require(_0xcd79('0x3'));var router=express[_0xcd79('0x4')]();var fs_extra=require(_0xcd79('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd79('0x6'));var config=require(_0xcd79('0x7'));var controller=require('./cannedAnswer.controller');router[_0xcd79('0x8')]('/',auth['isAuthenticated'](),controller[_0xcd79('0x9')]);router[_0xcd79('0x8')](_0xcd79('0xa'),auth[_0xcd79('0xb')](),controller[_0xcd79('0xc')]);router[_0xcd79('0xd')]('/',auth[_0xcd79('0xb')](),controller[_0xcd79('0xe')]);router[_0xcd79('0xf')](_0xcd79('0xa'),auth[_0xcd79('0xb')](),controller[_0xcd79('0x10')]);router[_0xcd79('0x11')](_0xcd79('0xa'),auth['isAuthenticated'](),controller[_0xcd79('0x12')]);module[_0xcd79('0x13')]=router;
\ No newline at end of file
+var _0xaabe=['isAuthenticated','index','get','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x1d3700,_0x1733b4){var _0xff118b=function(_0x21f403){while(--_0x21f403){_0x1d3700['push'](_0x1d3700['shift']());}};_0xff118b(++_0x1733b4);}(_0xaabe,0x14d));var _0xeaab=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaabe[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeaab('0x0'));var util=require(_0xeaab('0x1'));var path=require(_0xeaab('0x2'));var timeout=require(_0xeaab('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xeaab('0x4'));var auth=require(_0xeaab('0x5'));var interaction=require(_0xeaab('0x6'));var config=require(_0xeaab('0x7'));var controller=require(_0xeaab('0x8'));router['get']('/',auth[_0xeaab('0x9')](),controller[_0xeaab('0xa')]);router[_0xeaab('0xb')](_0xeaab('0xc'),auth[_0xeaab('0x9')](),controller[_0xeaab('0xd')]);router[_0xeaab('0xe')]('/',auth[_0xeaab('0x9')](),controller['create']);router['put']('/:id',auth[_0xeaab('0x9')](),controller['update']);router[_0xeaab('0xf')](_0xeaab('0xc'),auth[_0xeaab('0x9')](),controller[_0xeaab('0x10')]);module[_0xeaab('0x11')]=router;
\ No newline at end of file
index 50ea497..b82c61d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a3=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x45efb2,_0x2d6f70){var _0x4e0b3e=function(_0x29c72a){while(--_0x29c72a){_0x45efb2['push'](_0x45efb2['shift']());}};_0x4e0b3e(++_0x2d6f70);}(_0x21a3,0x66));var _0x321a=function(_0x2c78df,_0x20abba){_0x2c78df=_0x2c78df-0x0;var _0x50912=_0x21a3[_0x2c78df];return _0x50912;};'use strict';var Sequelize=require(_0x321a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x321a('0x1')],'allowNull':![],'defaultValue':_0x321a('0x2')},'clid':{'type':Sequelize[_0x321a('0x3')]},'src':{'type':Sequelize[_0x321a('0x3')]},'dst':{'type':Sequelize[_0x321a('0x3')]},'dcontext':{'type':Sequelize[_0x321a('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x321a('0x3')]},'lastdata':{'type':Sequelize[_0x321a('0x3')]},'duration':{'type':Sequelize[_0x321a('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x321a('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x321a('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x321a('0x3')]},'userfield':{'type':Sequelize[_0x321a('0x3')]},'uniqueid':{'type':Sequelize[_0x321a('0x3')]},'linkedid':{'type':Sequelize[_0x321a('0x3')]},'sequence':{'type':Sequelize[_0x321a('0x3')]},'peeraccount':{'type':Sequelize[_0x321a('0x3')]},'type':{'type':Sequelize[_0x321a('0x3')]},'tag':{'type':Sequelize[_0x321a('0x3')]}};
\ No newline at end of file
+var _0x8523=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x9ccc2,_0x113514){var _0x2fdbc9=function(_0x40d45b){while(--_0x40d45b){_0x9ccc2['push'](_0x9ccc2['shift']());}};_0x2fdbc9(++_0x113514);}(_0x8523,0x65));var _0x3852=function(_0x1d49da,_0x4b8203){_0x1d49da=_0x1d49da-0x0;var _0x206b1d=_0x8523[_0x1d49da];return _0x206b1d;};'use strict';var Sequelize=require(_0x3852('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x3852('0x1')],'allowNull':![],'defaultValue':_0x3852('0x2')},'clid':{'type':Sequelize[_0x3852('0x3')]},'src':{'type':Sequelize[_0x3852('0x3')]},'dst':{'type':Sequelize[_0x3852('0x3')]},'dcontext':{'type':Sequelize[_0x3852('0x3')]},'channel':{'type':Sequelize[_0x3852('0x3')]},'dstchannel':{'type':Sequelize[_0x3852('0x3')]},'lastapp':{'type':Sequelize[_0x3852('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3852('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3852('0x3')]},'amaflags':{'type':Sequelize[_0x3852('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3852('0x3')]},'uniqueid':{'type':Sequelize[_0x3852('0x3')]},'linkedid':{'type':Sequelize[_0x3852('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x3852('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x3852('0x3')]}};
\ No newline at end of file
index 07babc1..8d8de64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5a=['options','where','Cdr','includeAll','include','rows','show','keys','catch','create','body','update','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','error','stack','send','index','map','rawAttributes','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','type'];(function(_0x3e91a9,_0x53c466){var _0x25c9ad=function(_0x69ee2d){while(--_0x69ee2d){_0x3e91a9['push'](_0x3e91a9['shift']());}};_0x25c9ad(++_0x53c466);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x1f00f7,_0x469d49){_0x1f00f7=_0x1f00f7-0x0;var _0x24d9f3=_0x5a5a[_0x1f00f7];return _0x24d9f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5a5('0x0'));var zipdir=require(_0xa5a5('0x1'));var jsonpatch=require(_0xa5a5('0x2'));var rp=require(_0xa5a5('0x3'));var moment=require(_0xa5a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5a5('0x5'));var util=require(_0xa5a5('0x6'));var path=require(_0xa5a5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa5a5('0x8'));var fs=require('fs');var fs_extra=require(_0xa5a5('0x9'));var _=require('lodash');var squel=require(_0xa5a5('0xa'));var crypto=require(_0xa5a5('0xb'));var jsforce=require(_0xa5a5('0xc'));var deskjs=require(_0xa5a5('0xd'));var toCsv=require(_0xa5a5('0xe'));var querystring=require('querystring');var Papa=require(_0xa5a5('0xf'));var Redis=require(_0xa5a5('0x10'));var authService=require(_0xa5a5('0x11'));var qs=require(_0xa5a5('0x12'));var as=require(_0xa5a5('0x13'));var hardwareService=require(_0xa5a5('0x14'));var logger=require(_0xa5a5('0x15'))(_0xa5a5('0x16'));var utils=require(_0xa5a5('0x17'));var config=require(_0xa5a5('0x18'));var licenseUtil=require(_0xa5a5('0x19'));var db=require(_0xa5a5('0x1a'))['db'];function respondWithStatusCode(_0x567d9b,_0x245a65){_0x245a65=_0x245a65||0xcc;return function(_0x420b1d){if(_0x420b1d){return _0x567d9b[_0xa5a5('0x1b')](_0x245a65);}return _0x567d9b[_0xa5a5('0x1c')](_0x245a65)[_0xa5a5('0x1d')]();};}function respondWithResult(_0xa81eeb,_0x5d71e4){_0x5d71e4=_0x5d71e4||0xc8;return function(_0x3382c6){if(_0x3382c6){return _0xa81eeb[_0xa5a5('0x1c')](_0x5d71e4)[_0xa5a5('0x1e')](_0x3382c6);}};}function respondWithFilteredResult(_0x15370d,_0x2daae6){return function(_0x38305a){if(_0x38305a){var _0x1464d9=typeof _0x2daae6[_0xa5a5('0x1f')]==='undefined'&&typeof _0x2daae6[_0xa5a5('0x20')]===_0xa5a5('0x21');var _0x4571f5=_0x38305a[_0xa5a5('0x22')];var _0x3c4cae=_0x1464d9?0x0:_0x2daae6[_0xa5a5('0x1f')];var _0x28c89f=_0x1464d9?_0x38305a['count']:_0x2daae6[_0xa5a5('0x1f')]+_0x2daae6[_0xa5a5('0x20')];var _0x21488a;if(_0x28c89f>=_0x4571f5){_0x28c89f=_0x4571f5;_0x21488a=0xc8;}else{_0x21488a=0xce;}_0x15370d[_0xa5a5('0x1c')](_0x21488a);return _0x15370d['set'](_0xa5a5('0x23'),_0x3c4cae+'-'+_0x28c89f+'/'+_0x4571f5)['json'](_0x38305a);}return null;};}function patchUpdates(_0x2554c0){return function(_0x22774d){try{jsonpatch[_0xa5a5('0x24')](_0x22774d,_0x2554c0,!![]);}catch(_0x379f0d){return BPromise['reject'](_0x379f0d);}return _0x22774d['save']();};}function saveUpdates(_0x2001ed,_0x1a258f){return function(_0x417df3){if(_0x417df3){return _0x417df3['update'](_0x2001ed)[_0xa5a5('0x25')](function(_0x4b4613){return _0x4b4613;});}return null;};}function removeEntity(_0x337e52,_0x4996b3){return function(_0x4c0ff2){if(_0x4c0ff2){return _0x4c0ff2[_0xa5a5('0x26')]()[_0xa5a5('0x25')](function(){_0x337e52[_0xa5a5('0x1c')](0xcc)[_0xa5a5('0x1d')]();});}};}function handleEntityNotFound(_0x55ed28,_0x3583b1){return function(_0x54dfdc){if(!_0x54dfdc){_0x55ed28[_0xa5a5('0x1b')](0x194);}return _0x54dfdc;};}function handleError(_0xd37524,_0x516ccf){_0x516ccf=_0x516ccf||0x1f4;return function(_0x5ccc1e){logger[_0xa5a5('0x27')](_0x5ccc1e[_0xa5a5('0x28')]);if(_0x5ccc1e['name']){delete _0x5ccc1e['name'];}_0xd37524[_0xa5a5('0x1c')](_0x516ccf)[_0xa5a5('0x29')](_0x5ccc1e);};}exports[_0xa5a5('0x2a')]=function(_0x4d1201,_0x16fdd4){var _0x3bdd0a={},_0x58dc9e={},_0x122e3f={'count':0x0,'rows':[]};var _0x4d1eef=_[_0xa5a5('0x2b')](db['Cdr'][_0xa5a5('0x2c')],function(_0x190a33){return{'name':_0x190a33['fieldName'],'type':_0x190a33['type']['key']};});_0x58dc9e[_0xa5a5('0x2d')]=_['map'](_0x4d1eef,_0xa5a5('0x2e'));_0x58dc9e[_0xa5a5('0x2f')]=_['keys'](_0x4d1201[_0xa5a5('0x2f')]);_0x58dc9e[_0xa5a5('0x30')]=_['intersection'](_0x58dc9e[_0xa5a5('0x2d')],_0x58dc9e[_0xa5a5('0x2f')]);_0x3bdd0a[_0xa5a5('0x31')]=_[_0xa5a5('0x32')](_0x58dc9e[_0xa5a5('0x2d')],qs[_0xa5a5('0x33')](_0x4d1201[_0xa5a5('0x2f')]['fields']));_0x3bdd0a[_0xa5a5('0x31')]=_0x3bdd0a[_0xa5a5('0x31')][_0xa5a5('0x34')]?_0x3bdd0a[_0xa5a5('0x31')]:_0x58dc9e[_0xa5a5('0x2d')];if(!_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x35')](_0xa5a5('0x36'))){_0x3bdd0a[_0xa5a5('0x20')]=qs[_0xa5a5('0x20')](_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x20')]);_0x3bdd0a[_0xa5a5('0x1f')]=qs[_0xa5a5('0x1f')](_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x1f')]);}_0x3bdd0a[_0xa5a5('0x37')]=qs['sort'](_0x4d1201[_0xa5a5('0x2f')]['sort']);_0x3bdd0a['where']=qs['filters'](_[_0xa5a5('0x38')](_0x4d1201['query'],_0x58dc9e[_0xa5a5('0x30')]),_0x4d1eef);if(_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x39')]){_0x3bdd0a['where']=_[_0xa5a5('0x3a')](_0x3bdd0a['where'],{'$or':_['map'](_0x4d1eef,function(_0x43c2ff){if(_0x43c2ff[_0xa5a5('0x3b')]!=='VIRTUAL'){var _0x421255={};_0x421255[_0x43c2ff['name']]={'$like':'%'+_0x4d1201['query'][_0xa5a5('0x39')]+'%'};return _0x421255;}})});}_0x3bdd0a=_['merge']({},_0x3bdd0a,_0x4d1201[_0xa5a5('0x3c')]);var _0x53fe36={'where':_0x3bdd0a[_0xa5a5('0x3d')]};return db[_0xa5a5('0x3e')][_0xa5a5('0x22')](_0x53fe36)[_0xa5a5('0x25')](function(_0x71fb38){_0x122e3f[_0xa5a5('0x22')]=_0x71fb38;if(_0x4d1201[_0xa5a5('0x2f')][_0xa5a5('0x3f')]){_0x3bdd0a[_0xa5a5('0x40')]=[{'all':!![]}];}return db[_0xa5a5('0x3e')]['findAll'](_0x3bdd0a);})[_0xa5a5('0x25')](function(_0x491532){_0x122e3f[_0xa5a5('0x41')]=_0x491532;return _0x122e3f;})[_0xa5a5('0x25')](respondWithFilteredResult(_0x16fdd4,_0x3bdd0a))['catch'](handleError(_0x16fdd4,null));};exports[_0xa5a5('0x42')]=function(_0x2717b3,_0x2373f4){var _0x3a2e7e={'raw':!![],'where':{'id':_0x2717b3['params']['id']}},_0x4780b9={};_0x4780b9[_0xa5a5('0x2d')]=_[_0xa5a5('0x43')](db['Cdr'][_0xa5a5('0x2c')]);_0x4780b9[_0xa5a5('0x2f')]=_[_0xa5a5('0x43')](_0x2717b3[_0xa5a5('0x2f')]);_0x4780b9[_0xa5a5('0x30')]=_[_0xa5a5('0x32')](_0x4780b9[_0xa5a5('0x2d')],_0x4780b9['query']);_0x3a2e7e[_0xa5a5('0x31')]=_['intersection'](_0x4780b9[_0xa5a5('0x2d')],qs['fields'](_0x2717b3['query'][_0xa5a5('0x33')]));_0x3a2e7e[_0xa5a5('0x31')]=_0x3a2e7e[_0xa5a5('0x31')]['length']?_0x3a2e7e[_0xa5a5('0x31')]:_0x4780b9['model'];if(_0x2717b3['query'][_0xa5a5('0x3f')]){_0x3a2e7e[_0xa5a5('0x40')]=[{'all':!![]}];}_0x3a2e7e=_[_0xa5a5('0x3a')]({},_0x3a2e7e,_0x2717b3['options']);return db[_0xa5a5('0x3e')]['find'](_0x3a2e7e)['then'](handleEntityNotFound(_0x2373f4,null))[_0xa5a5('0x25')](respondWithResult(_0x2373f4,null))[_0xa5a5('0x44')](handleError(_0x2373f4,null));};exports[_0xa5a5('0x45')]=function(_0x25091f,_0x268cfb){return db[_0xa5a5('0x3e')][_0xa5a5('0x45')](_0x25091f[_0xa5a5('0x46')],{})['then'](respondWithResult(_0x268cfb,0xc9))[_0xa5a5('0x44')](handleError(_0x268cfb,null));};exports[_0xa5a5('0x47')]=function(_0x2db032,_0x232bc5){if(_0x2db032[_0xa5a5('0x46')]['id']){delete _0x2db032[_0xa5a5('0x46')]['id'];}return db['Cdr'][_0xa5a5('0x48')]({'where':{'id':_0x2db032[_0xa5a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x232bc5,null))[_0xa5a5('0x25')](saveUpdates(_0x2db032[_0xa5a5('0x46')],null))[_0xa5a5('0x25')](respondWithResult(_0x232bc5,null))['catch'](handleError(_0x232bc5,null));};exports[_0xa5a5('0x26')]=function(_0x337949,_0x6ad8c9){return db[_0xa5a5('0x3e')]['find']({'where':{'id':_0x337949['params']['id']}})[_0xa5a5('0x25')](handleEntityNotFound(_0x6ad8c9,null))[_0xa5a5('0x25')](removeEntity(_0x6ad8c9,null))[_0xa5a5('0x44')](handleError(_0x6ad8c9,null));};exports['describe']=function(_0xe2dd58,_0x12d908){return db[_0xa5a5('0x3e')][_0xa5a5('0x4a')]()[_0xa5a5('0x25')](respondWithResult(_0x12d908,null))[_0xa5a5('0x44')](handleError(_0x12d908,null));};
\ No newline at end of file
+var _0xc7a3=['Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x3951b1,_0x1fa8f6){var _0x29b8d7=function(_0x514b22){while(--_0x514b22){_0x3951b1['push'](_0x3951b1['shift']());}};_0x29b8d7(++_0x1fa8f6);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x456907,_0x84e54b){_0x456907=_0x456907-0x0;var _0x54a030=_0xc7a3[_0x456907];return _0x54a030;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3c7a('0x0'));var zipdir=require(_0x3c7a('0x1'));var jsonpatch=require(_0x3c7a('0x2'));var rp=require(_0x3c7a('0x3'));var moment=require(_0x3c7a('0x4'));var BPromise=require(_0x3c7a('0x5'));var Mustache=require('mustache');var util=require(_0x3c7a('0x6'));var path=require(_0x3c7a('0x7'));var sox=require('sox');var csv=require(_0x3c7a('0x8'));var ejs=require(_0x3c7a('0x9'));var fs=require('fs');var fs_extra=require(_0x3c7a('0xa'));var _=require('lodash');var squel=require(_0x3c7a('0xb'));var crypto=require('crypto');var jsforce=require(_0x3c7a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3c7a('0x8'));var querystring=require(_0x3c7a('0xd'));var Papa=require(_0x3c7a('0xe'));var Redis=require('ioredis');var authService=require(_0x3c7a('0xf'));var qs=require(_0x3c7a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7a('0x11'));var logger=require('../../config/logger')(_0x3c7a('0x12'));var utils=require('../../config/utils');var config=require(_0x3c7a('0x13'));var licenseUtil=require(_0x3c7a('0x14'));var db=require(_0x3c7a('0x15'))['db'];function respondWithStatusCode(_0x16ea63,_0x3d47c3){_0x3d47c3=_0x3d47c3||0xcc;return function(_0x53e5d7){if(_0x53e5d7){return _0x16ea63[_0x3c7a('0x16')](_0x3d47c3);}return _0x16ea63[_0x3c7a('0x17')](_0x3d47c3)[_0x3c7a('0x18')]();};}function respondWithResult(_0x36185c,_0x24d188){_0x24d188=_0x24d188||0xc8;return function(_0x4e6ca5){if(_0x4e6ca5){return _0x36185c[_0x3c7a('0x17')](_0x24d188)[_0x3c7a('0x19')](_0x4e6ca5);}};}function respondWithFilteredResult(_0x5af0a6,_0x539270){return function(_0x3044e6){if(_0x3044e6){var _0xb9201c=typeof _0x539270[_0x3c7a('0x1a')]==='undefined'&&typeof _0x539270[_0x3c7a('0x1b')]==='undefined';var _0x74fd1e=_0x3044e6[_0x3c7a('0x1c')];var _0x36e8c2=_0xb9201c?0x0:_0x539270[_0x3c7a('0x1a')];var _0x3cb5bf=_0xb9201c?_0x3044e6[_0x3c7a('0x1c')]:_0x539270['offset']+_0x539270[_0x3c7a('0x1b')];var _0x2db9df;if(_0x3cb5bf>=_0x74fd1e){_0x3cb5bf=_0x74fd1e;_0x2db9df=0xc8;}else{_0x2db9df=0xce;}_0x5af0a6[_0x3c7a('0x17')](_0x2db9df);return _0x5af0a6[_0x3c7a('0x1d')](_0x3c7a('0x1e'),_0x36e8c2+'-'+_0x3cb5bf+'/'+_0x74fd1e)[_0x3c7a('0x19')](_0x3044e6);}return null;};}function patchUpdates(_0x11a06b){return function(_0x34f4a6){try{jsonpatch[_0x3c7a('0x1f')](_0x34f4a6,_0x11a06b,!![]);}catch(_0x544742){return BPromise[_0x3c7a('0x20')](_0x544742);}return _0x34f4a6['save']();};}function saveUpdates(_0x3c75ff,_0x557518){return function(_0x40d24e){if(_0x40d24e){return _0x40d24e[_0x3c7a('0x21')](_0x3c75ff)[_0x3c7a('0x22')](function(_0x7dbe38){return _0x7dbe38;});}return null;};}function removeEntity(_0x283568,_0x245dde){return function(_0x8251d4){if(_0x8251d4){return _0x8251d4[_0x3c7a('0x23')]()[_0x3c7a('0x22')](function(){_0x283568[_0x3c7a('0x17')](0xcc)[_0x3c7a('0x18')]();});}};}function handleEntityNotFound(_0x317fbd,_0x56539f){return function(_0x3984a1){if(!_0x3984a1){_0x317fbd[_0x3c7a('0x16')](0x194);}return _0x3984a1;};}function handleError(_0x37cc40,_0x3829de){_0x3829de=_0x3829de||0x1f4;return function(_0x9b910c){logger[_0x3c7a('0x24')](_0x9b910c[_0x3c7a('0x25')]);if(_0x9b910c[_0x3c7a('0x26')]){delete _0x9b910c['name'];}_0x37cc40[_0x3c7a('0x17')](_0x3829de)[_0x3c7a('0x27')](_0x9b910c);};}exports[_0x3c7a('0x28')]=function(_0x197012,_0x33065b){var _0x1a96a0={},_0xccf304={},_0x1ff595={'count':0x0,'rows':[]};var _0x508d2e=_[_0x3c7a('0x29')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')],function(_0x18a346){return{'name':_0x18a346[_0x3c7a('0x2c')],'type':_0x18a346[_0x3c7a('0x2d')][_0x3c7a('0x2e')]};});_0xccf304[_0x3c7a('0x2f')]=_[_0x3c7a('0x29')](_0x508d2e,_0x3c7a('0x26'));_0xccf304[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x197012[_0x3c7a('0x30')]);_0xccf304['filters']=_['intersection'](_0xccf304['model'],_0xccf304['query']);_0x1a96a0[_0x3c7a('0x32')]=_[_0x3c7a('0x33')](_0xccf304[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x1a96a0[_0x3c7a('0x32')]=_0x1a96a0[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x1a96a0[_0x3c7a('0x32')]:_0xccf304[_0x3c7a('0x2f')];if(!_0x197012[_0x3c7a('0x30')][_0x3c7a('0x36')](_0x3c7a('0x37'))){_0x1a96a0['limit']=qs[_0x3c7a('0x1b')](_0x197012[_0x3c7a('0x30')]['limit']);_0x1a96a0[_0x3c7a('0x1a')]=qs['offset'](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x1a')]);}_0x1a96a0['order']=qs[_0x3c7a('0x38')](_0x197012[_0x3c7a('0x30')][_0x3c7a('0x38')]);_0x1a96a0[_0x3c7a('0x39')]=qs[_0x3c7a('0x3a')](_[_0x3c7a('0x3b')](_0x197012[_0x3c7a('0x30')],_0xccf304[_0x3c7a('0x3a')]),_0x508d2e);if(_0x197012[_0x3c7a('0x30')][_0x3c7a('0x3c')]){_0x1a96a0['where']=_[_0x3c7a('0x3d')](_0x1a96a0[_0x3c7a('0x39')],{'$or':_[_0x3c7a('0x29')](_0x508d2e,function(_0x43c236){if(_0x43c236[_0x3c7a('0x2d')]!==_0x3c7a('0x3e')){var _0x101e5d={};_0x101e5d[_0x43c236[_0x3c7a('0x26')]]={'$like':'%'+_0x197012['query'][_0x3c7a('0x3c')]+'%'};return _0x101e5d;}})});}_0x1a96a0=_[_0x3c7a('0x3d')]({},_0x1a96a0,_0x197012['options']);var _0x442087={'where':_0x1a96a0['where']};return db['Cdr']['count'](_0x442087)['then'](function(_0x44e935){_0x1ff595[_0x3c7a('0x1c')]=_0x44e935;if(_0x197012[_0x3c7a('0x30')]['includeAll']){_0x1a96a0[_0x3c7a('0x3f')]=[{'all':!![]}];}return db[_0x3c7a('0x2a')]['findAll'](_0x1a96a0);})['then'](function(_0x491335){_0x1ff595[_0x3c7a('0x40')]=_0x491335;return _0x1ff595;})[_0x3c7a('0x22')](respondWithFilteredResult(_0x33065b,_0x1a96a0))[_0x3c7a('0x41')](handleError(_0x33065b,null));};exports[_0x3c7a('0x42')]=function(_0x8d805a,_0x3e6a70){var _0x3f6060={'raw':!![],'where':{'id':_0x8d805a[_0x3c7a('0x43')]['id']}},_0x302556={};_0x302556[_0x3c7a('0x2f')]=_[_0x3c7a('0x31')](db[_0x3c7a('0x2a')][_0x3c7a('0x2b')]);_0x302556[_0x3c7a('0x30')]=_[_0x3c7a('0x31')](_0x8d805a['query']);_0x302556[_0x3c7a('0x3a')]=_[_0x3c7a('0x33')](_0x302556['model'],_0x302556['query']);_0x3f6060['attributes']=_[_0x3c7a('0x33')](_0x302556[_0x3c7a('0x2f')],qs[_0x3c7a('0x34')](_0x8d805a[_0x3c7a('0x30')][_0x3c7a('0x34')]));_0x3f6060[_0x3c7a('0x32')]=_0x3f6060[_0x3c7a('0x32')][_0x3c7a('0x35')]?_0x3f6060[_0x3c7a('0x32')]:_0x302556[_0x3c7a('0x2f')];if(_0x8d805a[_0x3c7a('0x30')]['includeAll']){_0x3f6060['include']=[{'all':!![]}];}_0x3f6060=_['merge']({},_0x3f6060,_0x8d805a[_0x3c7a('0x44')]);return db[_0x3c7a('0x2a')][_0x3c7a('0x45')](_0x3f6060)[_0x3c7a('0x22')](handleEntityNotFound(_0x3e6a70,null))[_0x3c7a('0x22')](respondWithResult(_0x3e6a70,null))['catch'](handleError(_0x3e6a70,null));};exports[_0x3c7a('0x46')]=function(_0x12b69a,_0x2eb9e2){return db[_0x3c7a('0x2a')][_0x3c7a('0x46')](_0x12b69a[_0x3c7a('0x47')],{})[_0x3c7a('0x22')](respondWithResult(_0x2eb9e2,0xc9))['catch'](handleError(_0x2eb9e2,null));};exports['update']=function(_0x420fa7,_0x350ea7){if(_0x420fa7[_0x3c7a('0x47')]['id']){delete _0x420fa7[_0x3c7a('0x47')]['id'];}return db[_0x3c7a('0x2a')][_0x3c7a('0x45')]({'where':{'id':_0x420fa7['params']['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x350ea7,null))['then'](saveUpdates(_0x420fa7['body'],null))[_0x3c7a('0x22')](respondWithResult(_0x350ea7,null))[_0x3c7a('0x41')](handleError(_0x350ea7,null));};exports[_0x3c7a('0x23')]=function(_0x50b5e4,_0x5759a0){return db['Cdr']['find']({'where':{'id':_0x50b5e4[_0x3c7a('0x43')]['id']}})[_0x3c7a('0x22')](handleEntityNotFound(_0x5759a0,null))[_0x3c7a('0x22')](removeEntity(_0x5759a0,null))[_0x3c7a('0x41')](handleError(_0x5759a0,null));};exports[_0x3c7a('0x48')]=function(_0x11f7ee,_0x124411){return db[_0x3c7a('0x2a')][_0x3c7a('0x48')]()[_0x3c7a('0x22')](respondWithResult(_0x124411,null))[_0x3c7a('0x41')](handleError(_0x124411,null));};
\ No newline at end of file
index e71ee19..34ffc28 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(_0x163dcd,_0x261962){var _0x5f3d96=function(_0x58d5ae){while(--_0x58d5ae){_0x163dcd['push'](_0x163dcd['shift']());}};_0x5f3d96(++_0x261962);}(_0x7a54,0x106));var _0x47a5=function(_0x3eb653,_0x27a80c){_0x3eb653=_0x3eb653-0x0;var _0x485d7f=_0x7a54[_0x3eb653];return _0x485d7f;};'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(_0x2c9dc4,_0x56ce90){var _0x251c32=function(_0xff054a){while(--_0xff054a){_0x2c9dc4['push'](_0x2c9dc4['shift']());}};_0x251c32(++_0x56ce90);}(_0x7a54,0x106));var _0x47a5=function(_0x332ac5,_0x2a2d4e){_0x332ac5=_0x332ac5-0x0;var _0xacf530=_0x7a54[_0x332ac5];return _0xacf530;};'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 251f21f..71733ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd677=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x15e4dd,_0x227d5c){var _0x2b7caf=function(_0x562e33){while(--_0x562e33){_0x15e4dd['push'](_0x15e4dd['shift']());}};_0x2b7caf(++_0x227d5c);}(_0xd677,0x78));var _0x7d67=function(_0x1c206c,_0x30bdcf){_0x1c206c=_0x1c206c-0x0;var _0x188aaa=_0xd677[_0x1c206c];return _0x188aaa;};'use strict';var _=require(_0x7d67('0x0'));var util=require('util');var moment=require(_0x7d67('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d67('0x2'));var fs=require('fs');var Redis=require(_0x7d67('0x3'));var db=require(_0x7d67('0x4'))['db'];var utils=require(_0x7d67('0x5'));var logger=require(_0x7d67('0x6'))(_0x7d67('0x7'));var config=require(_0x7d67('0x8'));var jayson=require(_0x7d67('0x9'));var client=jayson[_0x7d67('0xa')][_0x7d67('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x766d77,_0x5498d3,_0x579a0b){return new BPromise(function(_0x79a399,_0x264a5a){return client[_0x7d67('0xc')](_0x766d77,_0x579a0b)[_0x7d67('0xd')](function(_0x5e0a5b){logger[_0x7d67('0xe')]('Cdr,\x20%s,\x20%s',_0x5498d3,_0x7d67('0xf'));logger[_0x7d67('0x10')](_0x7d67('0x11'),_0x5498d3,_0x7d67('0xf'),JSON[_0x7d67('0x12')](_0x5e0a5b));if(_0x5e0a5b['error']){if(_0x5e0a5b[_0x7d67('0x13')][_0x7d67('0x14')]===0x1f4){logger[_0x7d67('0x13')](_0x7d67('0x15'),_0x5498d3,_0x5e0a5b[_0x7d67('0x13')]['message']);return _0x264a5a(_0x5e0a5b[_0x7d67('0x13')][_0x7d67('0x16')]);}logger[_0x7d67('0x13')]('Cdr,\x20%s,\x20%s',_0x5498d3,_0x5e0a5b[_0x7d67('0x13')][_0x7d67('0x16')]);return _0x79a399(_0x5e0a5b[_0x7d67('0x13')][_0x7d67('0x16')]);}else{logger['info'](_0x7d67('0x15'),_0x5498d3,'request\x20sent');_0x79a399(_0x5e0a5b[_0x7d67('0x17')]['message']);}})[_0x7d67('0x18')](function(_0x251a92){logger[_0x7d67('0x13')](_0x7d67('0x15'),_0x5498d3,_0x251a92);_0x264a5a(_0x251a92);});});}
\ No newline at end of file
+var _0xa744=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4fe9d6,_0x1b1ec2){var _0xc8bcff=function(_0x561091){while(--_0x561091){_0x4fe9d6['push'](_0x4fe9d6['shift']());}};_0xc8bcff(++_0x1b1ec2);}(_0xa744,0x6b));var _0x4a74=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa744[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4a74('0x0'));var util=require(_0x4a74('0x1'));var moment=require(_0x4a74('0x2'));var BPromise=require(_0x4a74('0x3'));var rs=require(_0x4a74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a74('0x5'))['db'];var utils=require(_0x4a74('0x6'));var logger=require(_0x4a74('0x7'))(_0x4a74('0x8'));var config=require(_0x4a74('0x9'));var jayson=require(_0x4a74('0xa'));var client=jayson[_0x4a74('0xb')][_0x4a74('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fc0a2,_0x992869,_0x44eb0e){return new BPromise(function(_0x206569,_0x399295){return client['request'](_0x2fc0a2,_0x44eb0e)[_0x4a74('0xd')](function(_0x21f27e){logger[_0x4a74('0xe')]('Cdr,\x20%s,\x20%s',_0x992869,_0x4a74('0xf'));logger[_0x4a74('0x10')](_0x4a74('0x11'),_0x992869,_0x4a74('0xf'),JSON[_0x4a74('0x12')](_0x21f27e));if(_0x21f27e['error']){if(_0x21f27e[_0x4a74('0x13')]['code']===0x1f4){logger[_0x4a74('0x13')](_0x4a74('0x14'),_0x992869,_0x21f27e[_0x4a74('0x13')][_0x4a74('0x15')]);return _0x399295(_0x21f27e[_0x4a74('0x13')]['message']);}logger[_0x4a74('0x13')](_0x4a74('0x14'),_0x992869,_0x21f27e[_0x4a74('0x13')][_0x4a74('0x15')]);return _0x206569(_0x21f27e[_0x4a74('0x13')][_0x4a74('0x15')]);}else{logger['info'](_0x4a74('0x14'),_0x992869,'request\x20sent');_0x206569(_0x21f27e['result'][_0x4a74('0x15')]);}})[_0x4a74('0x16')](function(_0x594d12){logger['error'](_0x4a74('0x14'),_0x992869,_0x594d12);_0x399295(_0x594d12);});});}
\ No newline at end of file
index 0baac13..c6bc8a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0x4ceb13,_0x5e70f7){var _0x11f6e7=function(_0x1ffe46){while(--_0x1ffe46){_0x4ceb13['push'](_0x4ceb13['shift']());}};_0x11f6e7(++_0x5e70f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index 1ee079a..9844000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c73=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x38622b,_0x3cfdf7){var _0x2c1a7a=function(_0x5de9cc){while(--_0x5de9cc){_0x38622b['push'](_0x38622b['shift']());}};_0x2c1a7a(++_0x3cfdf7);}(_0x5c73,0x105));var _0x35c7=function(_0x2e387c,_0x54b144){_0x2e387c=_0x2e387c-0x0;var _0x25347e=_0x5c73[_0x2e387c];return _0x25347e;};'use strict';var Sequelize=require(_0x35c7('0x0'));module[_0x35c7('0x1')]={'priority':{'type':Sequelize[_0x35c7('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35c7('0x3')},'appdata':{'type':Sequelize[_0x35c7('0x4')]()},'description':{'type':Sequelize[_0x35c7('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x6f44=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0xbafb3d,_0x2aa7aa){var _0xa5595f=function(_0x26a0a3){while(--_0x26a0a3){_0xbafb3d['push'](_0xbafb3d['shift']());}};_0xa5595f(++_0x2aa7aa);}(_0x6f44,0xe0));var _0x46f4=function(_0x38ef92,_0x5e95df){_0x38ef92=_0x38ef92-0x0;var _0x250adc=_0x6f44[_0x38ef92];return _0x250adc;};'use strict';var Sequelize=require('sequelize');module[_0x46f4('0x0')]={'priority':{'type':Sequelize[_0x46f4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x46f4('0x2')],'allowNull':![],'defaultValue':_0x46f4('0x3')},'appdata':{'type':Sequelize[_0x46f4('0x4')]()},'description':{'type':Sequelize[_0x46f4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x46f4('0x5')}};
\ No newline at end of file
index 95bcc4f..0f76398 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f72=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','show','model','keys','ChatApplication','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','update','body','params','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'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x2f72,0x166));var _0x22f7=function(_0x2d8e62,_0x2e6c32){_0x2d8e62=_0x2d8e62-0x0;var _0x29b106=_0x2f72[_0x2d8e62];return _0x29b106;};'use strict';var emlformat=require(_0x22f7('0x0'));var rimraf=require(_0x22f7('0x1'));var zipdir=require(_0x22f7('0x2'));var jsonpatch=require(_0x22f7('0x3'));var rp=require(_0x22f7('0x4'));var moment=require(_0x22f7('0x5'));var BPromise=require(_0x22f7('0x6'));var Mustache=require(_0x22f7('0x7'));var util=require('util');var path=require(_0x22f7('0x8'));var sox=require(_0x22f7('0x9'));var csv=require(_0x22f7('0xa'));var ejs=require(_0x22f7('0xb'));var fs=require('fs');var fs_extra=require(_0x22f7('0xc'));var _=require(_0x22f7('0xd'));var squel=require(_0x22f7('0xe'));var crypto=require(_0x22f7('0xf'));var jsforce=require(_0x22f7('0x10'));var deskjs=require(_0x22f7('0x11'));var toCsv=require(_0x22f7('0xa'));var querystring=require(_0x22f7('0x12'));var Papa=require(_0x22f7('0x13'));var Redis=require(_0x22f7('0x14'));var authService=require(_0x22f7('0x15'));var qs=require(_0x22f7('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x22f7('0x17'));var logger=require(_0x22f7('0x18'))('api');var utils=require(_0x22f7('0x19'));var config=require(_0x22f7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x22f7('0x1b'))['db'];function respondWithStatusCode(_0x5a4220,_0x1d69c4){_0x1d69c4=_0x1d69c4||0xcc;return function(_0x2d87bc){if(_0x2d87bc){return _0x5a4220['sendStatus'](_0x1d69c4);}return _0x5a4220[_0x22f7('0x1c')](_0x1d69c4)[_0x22f7('0x1d')]();};}function respondWithResult(_0xa4cc90,_0x379b18){_0x379b18=_0x379b18||0xc8;return function(_0x3ddaed){if(_0x3ddaed){return _0xa4cc90[_0x22f7('0x1c')](_0x379b18)[_0x22f7('0x1e')](_0x3ddaed);}};}function respondWithFilteredResult(_0x2e91d3,_0x159f04){return function(_0x2f0a74){if(_0x2f0a74){var _0x36c213=typeof _0x159f04[_0x22f7('0x1f')]===_0x22f7('0x20')&&typeof _0x159f04[_0x22f7('0x21')]===_0x22f7('0x20');var _0x56a1d3=_0x2f0a74[_0x22f7('0x22')];var _0x3894f4=_0x36c213?0x0:_0x159f04[_0x22f7('0x1f')];var _0x3f15b8=_0x36c213?_0x2f0a74[_0x22f7('0x22')]:_0x159f04[_0x22f7('0x1f')]+_0x159f04[_0x22f7('0x21')];var _0x4528f7;if(_0x3f15b8>=_0x56a1d3){_0x3f15b8=_0x56a1d3;_0x4528f7=0xc8;}else{_0x4528f7=0xce;}_0x2e91d3[_0x22f7('0x1c')](_0x4528f7);return _0x2e91d3['set'](_0x22f7('0x23'),_0x3894f4+'-'+_0x3f15b8+'/'+_0x56a1d3)[_0x22f7('0x1e')](_0x2f0a74);}return null;};}function patchUpdates(_0x1f363d){return function(_0x435eb6){try{jsonpatch['apply'](_0x435eb6,_0x1f363d,!![]);}catch(_0x707f2c){return BPromise[_0x22f7('0x24')](_0x707f2c);}return _0x435eb6[_0x22f7('0x25')]();};}function saveUpdates(_0x26214c,_0x352663){return function(_0x5d79cc){if(_0x5d79cc){return _0x5d79cc['update'](_0x26214c)[_0x22f7('0x26')](function(_0x56f180){return _0x56f180;});}return null;};}function removeEntity(_0x320dc1,_0x1545f5){return function(_0xc53928){if(_0xc53928){return _0xc53928[_0x22f7('0x27')]()[_0x22f7('0x26')](function(){_0x320dc1[_0x22f7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39edc8,_0x48c489){return function(_0x580245){if(!_0x580245){_0x39edc8[_0x22f7('0x28')](0x194);}return _0x580245;};}function handleError(_0x3cee67,_0x3ad77d){_0x3ad77d=_0x3ad77d||0x1f4;return function(_0x52995c){logger[_0x22f7('0x29')](_0x52995c[_0x22f7('0x2a')]);if(_0x52995c['name']){delete _0x52995c[_0x22f7('0x2b')];}_0x3cee67[_0x22f7('0x1c')](_0x3ad77d)['send'](_0x52995c);};}exports[_0x22f7('0x2c')]=function(_0x5c4282,_0xa3346f){var _0xbf4c5c={'raw':!![],'where':{'id':_0x5c4282['params']['id']}},_0x14c71e={};_0x14c71e[_0x22f7('0x2d')]=_[_0x22f7('0x2e')](db[_0x22f7('0x2f')]['rawAttributes']);_0x14c71e['query']=_[_0x22f7('0x2e')](_0x5c4282[_0x22f7('0x30')]);_0x14c71e[_0x22f7('0x31')]=_['intersection'](_0x14c71e[_0x22f7('0x2d')],_0x14c71e[_0x22f7('0x30')]);_0xbf4c5c[_0x22f7('0x32')]=_[_0x22f7('0x33')](_0x14c71e['model'],qs[_0x22f7('0x34')](_0x5c4282[_0x22f7('0x30')][_0x22f7('0x34')]));_0xbf4c5c['attributes']=_0xbf4c5c[_0x22f7('0x32')][_0x22f7('0x35')]?_0xbf4c5c[_0x22f7('0x32')]:_0x14c71e[_0x22f7('0x2d')];if(_0x5c4282[_0x22f7('0x30')][_0x22f7('0x36')]){_0xbf4c5c[_0x22f7('0x37')]=[{'all':!![]}];}_0xbf4c5c=_[_0x22f7('0x38')]({},_0xbf4c5c,_0x5c4282[_0x22f7('0x39')]);return db[_0x22f7('0x2f')][_0x22f7('0x3a')](_0xbf4c5c)[_0x22f7('0x26')](handleEntityNotFound(_0xa3346f,null))[_0x22f7('0x26')](respondWithResult(_0xa3346f,null))[_0x22f7('0x3b')](handleError(_0xa3346f,null));};exports[_0x22f7('0x3c')]=function(_0x276b06,_0x3014c0){if(_0x276b06[_0x22f7('0x3d')]['id']){delete _0x276b06[_0x22f7('0x3d')]['id'];}return db[_0x22f7('0x2f')][_0x22f7('0x3a')]({'where':{'id':_0x276b06[_0x22f7('0x3e')]['id']}})[_0x22f7('0x26')](handleEntityNotFound(_0x3014c0,null))[_0x22f7('0x26')](saveUpdates(_0x276b06[_0x22f7('0x3d')],null))['then'](respondWithResult(_0x3014c0,null))[_0x22f7('0x3b')](handleError(_0x3014c0,null));};exports['destroy']=function(_0xae7703,_0x1fc93f){return db[_0x22f7('0x2f')][_0x22f7('0x3a')]({'where':{'id':_0xae7703['params']['id']}})[_0x22f7('0x26')](handleEntityNotFound(_0x1fc93f,null))[_0x22f7('0x26')](removeEntity(_0x1fc93f,null))['catch'](handleError(_0x1fc93f,null));};
\ No newline at end of file
+var _0x00b3=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','include','merge','options','find','catch','body','ChatApplication'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x00b3,0x17a));var _0x300b=function(_0x4f2558,_0x5af2fe){_0x4f2558=_0x4f2558-0x0;var _0x42ee50=_0x00b3[_0x4f2558];return _0x42ee50;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){_0x28bc0a[_0x300b('0x16')](0xcc)[_0x300b('0x17')]();});}};}function handleEntityNotFound(_0x544658,_0x3d62b1){return function(_0x152048){if(!_0x152048){_0x544658[_0x300b('0x15')](0x194);}return _0x152048;};}function handleError(_0x43c480,_0x4cce77){_0x4cce77=_0x4cce77||0x1f4;return function(_0x4f50b0){logger['error'](_0x4f50b0[_0x300b('0x22')]);if(_0x4f50b0['name']){delete _0x4f50b0[_0x300b('0x23')];}_0x43c480[_0x300b('0x16')](_0x4cce77)[_0x300b('0x24')](_0x4f50b0);};}exports[_0x300b('0x25')]=function(_0x2d2ea7,_0x10ed6b){var _0x165f56={'raw':!![],'where':{'id':_0x2d2ea7[_0x300b('0x26')]['id']}},_0x159b63={};_0x159b63[_0x300b('0x27')]=_['keys'](db['ChatApplication'][_0x300b('0x28')]);_0x159b63[_0x300b('0x29')]=_[_0x300b('0x2a')](_0x2d2ea7[_0x300b('0x29')]);_0x159b63['filters']=_[_0x300b('0x2b')](_0x159b63['model'],_0x159b63['query']);_0x165f56['attributes']=_[_0x300b('0x2b')](_0x159b63[_0x300b('0x27')],qs['fields'](_0x2d2ea7[_0x300b('0x29')][_0x300b('0x2c')]));_0x165f56['attributes']=_0x165f56[_0x300b('0x2d')]['length']?_0x165f56[_0x300b('0x2d')]:_0x159b63[_0x300b('0x27')];if(_0x2d2ea7[_0x300b('0x29')][_0x300b('0x2e')]){_0x165f56[_0x300b('0x2f')]=[{'all':!![]}];}_0x165f56=_[_0x300b('0x30')]({},_0x165f56,_0x2d2ea7[_0x300b('0x31')]);return db['ChatApplication'][_0x300b('0x32')](_0x165f56)['then'](handleEntityNotFound(_0x10ed6b,null))[_0x300b('0x20')](respondWithResult(_0x10ed6b,null))[_0x300b('0x33')](handleError(_0x10ed6b,null));};exports['update']=function(_0x3250dc,_0x355088){if(_0x3250dc['body']['id']){delete _0x3250dc[_0x300b('0x34')]['id'];}return db[_0x300b('0x35')][_0x300b('0x32')]({'where':{'id':_0x3250dc['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x355088,null))[_0x300b('0x20')](saveUpdates(_0x3250dc[_0x300b('0x34')],null))[_0x300b('0x20')](respondWithResult(_0x355088,null))[_0x300b('0x33')](handleError(_0x355088,null));};exports[_0x300b('0x21')]=function(_0x2004ae,_0x56ee6b){return db[_0x300b('0x35')][_0x300b('0x32')]({'where':{'id':_0x2004ae['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x56ee6b,null))['then'](removeEntity(_0x56ee6b,null))['catch'](handleError(_0x56ee6b,null));};
\ No newline at end of file
index 516676f..826af7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc03d=['path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x299ecf,_0x5e642b){var _0x4813c9=function(_0x4726e7){while(--_0x4726e7){_0x299ecf['push'](_0x299ecf['shift']());}};_0x4813c9(++_0x5e642b);}(_0xc03d,0x127));var _0xdc03=function(_0x11dfcb,_0x8342ed){_0x11dfcb=_0x11dfcb-0x0;var _0x2fd6c5=_0xc03d[_0x11dfcb];return _0x2fd6c5;};'use strict';var _=require(_0xdc03('0x0'));var util=require(_0xdc03('0x1'));var logger=require(_0xdc03('0x2'))('api');var moment=require(_0xdc03('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc03('0x4'));var rimraf=require(_0xdc03('0x5'));var config=require(_0xdc03('0x6'));var attributes=require(_0xdc03('0x7'));module['exports']=function(_0x2fc71d,_0x36ec86){return _0x2fc71d[_0xdc03('0x8')](_0xdc03('0x9'),attributes,{'tableName':_0xdc03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc03('0xb'),'collate':_0xdc03('0xc')});};
\ No newline at end of file
+var _0xeb4d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x403230,_0x100c91){var _0x246eb3=function(_0x2aa681){while(--_0x2aa681){_0x403230['push'](_0x403230['shift']());}};_0x246eb3(++_0x100c91);}(_0xeb4d,0x14e));var _0xdeb4=function(_0x451aab,_0x12c2d8){_0x451aab=_0x451aab-0x0;var _0x5aa85c=_0xeb4d[_0x451aab];return _0x5aa85c;};'use strict';var _=require(_0xdeb4('0x0'));var util=require(_0xdeb4('0x1'));var logger=require(_0xdeb4('0x2'))(_0xdeb4('0x3'));var moment=require(_0xdeb4('0x4'));var BPromise=require(_0xdeb4('0x5'));var rp=require(_0xdeb4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb4('0x7'));var config=require('../../config/environment');var attributes=require(_0xdeb4('0x8'));module[_0xdeb4('0x9')]=function(_0x23ed89,_0x7ee8c2){return _0x23ed89[_0xdeb4('0xa')]('ChatApplication',attributes,{'tableName':_0xdeb4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb4('0xc'),'collate':_0xdeb4('0xd')});};
\ No newline at end of file
index 03cc522..a09a5c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61da=['ioredis','../../config/utils','rpc','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x588d64,_0x3a036f){var _0x45e966=function(_0x5c362f){while(--_0x5c362f){_0x588d64['push'](_0x588d64['shift']());}};_0x45e966(++_0x3a036f);}(_0x61da,0x165));var _0xa61d=function(_0x8c7da8,_0x32da71){_0x8c7da8=_0x8c7da8-0x0;var _0xe02195=_0x61da[_0x8c7da8];return _0xe02195;};'use strict';var _=require('lodash');var util=require(_0xa61d('0x0'));var moment=require(_0xa61d('0x1'));var BPromise=require(_0xa61d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa61d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa61d('0x4'));var logger=require('../../config/logger')(_0xa61d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa61d('0x6')][_0xa61d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c171b,_0x49708d,_0x3c2508){return new BPromise(function(_0x1d56c6,_0x145a59){return client[_0xa61d('0x8')](_0x4c171b,_0x3c2508)['then'](function(_0x49efce){logger[_0xa61d('0x9')](_0xa61d('0xa'),_0x49708d,_0xa61d('0xb'));logger[_0xa61d('0xc')](_0xa61d('0xd'),_0x49708d,_0xa61d('0xb'),JSON[_0xa61d('0xe')](_0x49efce));if(_0x49efce[_0xa61d('0xf')]){if(_0x49efce[_0xa61d('0xf')][_0xa61d('0x10')]===0x1f4){logger[_0xa61d('0xf')](_0xa61d('0xa'),_0x49708d,_0x49efce[_0xa61d('0xf')][_0xa61d('0x11')]);return _0x145a59(_0x49efce['error'][_0xa61d('0x11')]);}logger['error'](_0xa61d('0xa'),_0x49708d,_0x49efce[_0xa61d('0xf')]['message']);return _0x1d56c6(_0x49efce[_0xa61d('0xf')][_0xa61d('0x11')]);}else{logger['info'](_0xa61d('0xa'),_0x49708d,'request\x20sent');_0x1d56c6(_0x49efce[_0xa61d('0x12')][_0xa61d('0x11')]);}})[_0xa61d('0x13')](function(_0x162d84){logger[_0xa61d('0xf')](_0xa61d('0xa'),_0x49708d,_0x162d84);_0x145a59(_0x162d84);});});}
\ No newline at end of file
+var _0x109e=['../../config/utils','../../config/logger','../../config/environment','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x173c84,_0x1b2613){var _0x1ebc7b=function(_0x13e801){while(--_0x13e801){_0x173c84['push'](_0x173c84['shift']());}};_0x1ebc7b(++_0x1b2613);}(_0x109e,0xc3));var _0xe109=function(_0x215f67,_0x5656e2){_0x215f67=_0x215f67-0x0;var _0x24f8ef=_0x109e[_0x215f67];return _0x24f8ef;};'use strict';var _=require(_0xe109('0x0'));var util=require(_0xe109('0x1'));var moment=require(_0xe109('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe109('0x3'));var db=require(_0xe109('0x4'))['db'];var utils=require(_0xe109('0x5'));var logger=require(_0xe109('0x6'))('rpc');var config=require(_0xe109('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe109('0x8')][_0xe109('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12afec,_0x188ef0,_0x57ead4){return new BPromise(function(_0x38cb9b,_0x2573d3){return client['request'](_0x12afec,_0x57ead4)['then'](function(_0x3cdc7b){logger[_0xe109('0xa')](_0xe109('0xb'),_0x188ef0,_0xe109('0xc'));logger[_0xe109('0xd')](_0xe109('0xe'),_0x188ef0,_0xe109('0xc'),JSON[_0xe109('0xf')](_0x3cdc7b));if(_0x3cdc7b[_0xe109('0x10')]){if(_0x3cdc7b[_0xe109('0x10')][_0xe109('0x11')]===0x1f4){logger[_0xe109('0x10')](_0xe109('0xb'),_0x188ef0,_0x3cdc7b[_0xe109('0x10')]['message']);return _0x2573d3(_0x3cdc7b[_0xe109('0x10')]['message']);}logger['error'](_0xe109('0xb'),_0x188ef0,_0x3cdc7b[_0xe109('0x10')][_0xe109('0x12')]);return _0x38cb9b(_0x3cdc7b[_0xe109('0x10')][_0xe109('0x12')]);}else{logger[_0xe109('0xa')](_0xe109('0xb'),_0x188ef0,_0xe109('0xc'));_0x38cb9b(_0x3cdc7b[_0xe109('0x13')][_0xe109('0x12')]);}})['catch'](function(_0x23e167){logger['error']('ChatApplication,\x20%s,\x20%s',_0x188ef0,_0x23e167);_0x2573d3(_0x23e167);});});}
\ No newline at end of file
index 00ab5da..62d95d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa05b=['get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xa05b,0x1be));var _0xba05=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0xa05b[_0x515283];return _0x38f836;};'use strict';var multer=require(_0xba05('0x0'));var util=require(_0xba05('0x1'));var path=require(_0xba05('0x2'));var timeout=require(_0xba05('0x3'));var express=require('express');var router=express[_0xba05('0x4')]();var fs_extra=require(_0xba05('0x5'));var auth=require(_0xba05('0x6'));var interaction=require(_0xba05('0x7'));var config=require(_0xba05('0x8'));var controller=require(_0xba05('0x9'));router[_0xba05('0xa')](_0xba05('0xb'),auth[_0xba05('0xc')](),controller[_0xba05('0xd')]);router[_0xba05('0xe')](_0xba05('0xb'),auth[_0xba05('0xc')](),controller[_0xba05('0xf')]);router[_0xba05('0x10')](_0xba05('0xb'),auth[_0xba05('0xc')](),controller[_0xba05('0x11')]);module[_0xba05('0x12')]=router;
\ No newline at end of file
+var _0x27e3=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','show','put','destroy'];(function(_0x138b2c,_0x142181){var _0xa8b921=function(_0xc1799e){while(--_0xc1799e){_0x138b2c['push'](_0x138b2c['shift']());}};_0xa8b921(++_0x142181);}(_0x27e3,0x9b));var _0x327e=function(_0xc1718d,_0x5835ae){_0xc1718d=_0xc1718d-0x0;var _0x26a6d8=_0x27e3[_0xc1718d];return _0x26a6d8;};'use strict';var multer=require(_0x327e('0x0'));var util=require('util');var path=require(_0x327e('0x1'));var timeout=require(_0x327e('0x2'));var express=require(_0x327e('0x3'));var router=express['Router']();var fs_extra=require(_0x327e('0x4'));var auth=require(_0x327e('0x5'));var interaction=require(_0x327e('0x6'));var config=require(_0x327e('0x7'));var controller=require(_0x327e('0x8'));router['get'](_0x327e('0x9'),auth['isAuthenticated'](),controller[_0x327e('0xa')]);router[_0x327e('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x327e('0x9'),auth['isAuthenticated'](),controller[_0x327e('0xc')]);module[_0x327e('0xd')]=router;
\ No newline at end of file
index 2c73ab4..95e95fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['exports','STRING','BOOLEAN','sequelize'];(function(_0x20f41d,_0x2af8ab){var _0x50bfcd=function(_0x20e8c8){while(--_0x20e8c8){_0x20f41d['push'](_0x20f41d['shift']());}};_0x50bfcd(++_0x2af8ab);}(_0x8caf,0x16f));var _0xf8ca=function(_0x16af15,_0x55bc76){_0x16af15=_0x16af15-0x0;var _0xfeda8a=_0x8caf[_0x16af15];return _0xfeda8a;};'use strict';var Sequelize=require(_0xf8ca('0x0'));module[_0xf8ca('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf8ca('0x2')]},'write':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x45bb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x26c20b,_0x466612){var _0x2714b1=function(_0x54965e){while(--_0x54965e){_0x26c20b['push'](_0x26c20b['shift']());}};_0x2714b1(++_0x466612);}(_0x45bb,0x79));var _0xb45b=function(_0x677f25,_0x4eb4b5){_0x677f25=_0x677f25-0x0;var _0x22123d=_0x45bb[_0x677f25];return _0x22123d;};'use strict';var Sequelize=require(_0xb45b('0x0'));module[_0xb45b('0x1')]={'name':{'type':Sequelize[_0xb45b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb45b('0x2')]},'write':{'type':Sequelize[_0xb45b('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index c2e0147..73e9749 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise','client','http','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','stack','name','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','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'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return new BPromise(function(_0x519dfd,_0x16033c){var _0x12066b=_0x1985b6||client;return _0x12066b['request'](_0x52a03d,_0x5d0880)[_0x0a9e('0x1d')](function(_0x5a0a06){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x22dccb,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x22dccb,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x5a0a06));if(_0x5a0a06[_0x0a9e('0x24')]){if(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x16033c(_0x5a0a06[_0x0a9e('0x24')]['message']);}logger[_0x0a9e('0x24')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x519dfd(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger[_0x0a9e('0x1e')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x0a9e('0x20'));_0x519dfd(_0x5a0a06[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x370d86){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x370d86);_0x16033c(_0x370d86);});});}function respondWithStatusCode(_0x5ea472,_0x59181e){_0x59181e=_0x59181e||0xcc;return function(_0x197ec0){if(_0x197ec0){return _0x5ea472[_0x0a9e('0x29')](_0x59181e);}return _0x5ea472[_0x0a9e('0x2a')](_0x59181e)[_0x0a9e('0x2b')]();};}function respondWithResult(_0x526cf3,_0x384319){_0x384319=_0x384319||0xc8;return function(_0x479bc4){if(_0x479bc4){return _0x526cf3[_0x0a9e('0x2a')](_0x384319)['json'](_0x479bc4);}};}function respondWithFilteredResult(_0x1dc186,_0x34dc65){return function(_0x25fba9){if(_0x25fba9){var _0x14433c=typeof _0x34dc65[_0x0a9e('0x2c')]===_0x0a9e('0x2d')&&typeof _0x34dc65[_0x0a9e('0x2e')]===_0x0a9e('0x2d');var _0x5a101a=_0x25fba9[_0x0a9e('0x2f')];var _0x468813=_0x14433c?0x0:_0x34dc65[_0x0a9e('0x2c')];var _0x2ec755=_0x14433c?_0x25fba9['count']:_0x34dc65[_0x0a9e('0x2c')]+_0x34dc65[_0x0a9e('0x2e')];var _0x1843b2;if(_0x2ec755>=_0x5a101a){_0x2ec755=_0x5a101a;_0x1843b2=0xc8;}else{_0x1843b2=0xce;}_0x1dc186[_0x0a9e('0x2a')](_0x1843b2);return _0x1dc186[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x468813+'-'+_0x2ec755+'/'+_0x5a101a)[_0x0a9e('0x32')](_0x25fba9);}return null;};}function patchUpdates(_0x2e8759){return function(_0x1dbde2){try{jsonpatch['apply'](_0x1dbde2,_0x2e8759,!![]);}catch(_0x426950){return BPromise['reject'](_0x426950);}return _0x1dbde2[_0x0a9e('0x33')]();};}function saveUpdates(_0x3ae878,_0x1122db){return function(_0x33bdb7){if(_0x33bdb7){return _0x33bdb7[_0x0a9e('0x34')](_0x3ae878)['then'](function(_0x66c1d2){return _0x66c1d2;});}return null;};}function removeEntity(_0x46f0a5,_0x40cb85){return function(_0x2da5c0){if(_0x2da5c0){return _0x2da5c0[_0x0a9e('0x35')]()[_0x0a9e('0x1d')](function(){_0x46f0a5[_0x0a9e('0x2a')](0xcc)[_0x0a9e('0x2b')]();});}};}function handleEntityNotFound(_0x5583a4,_0x44295a){return function(_0x5e7238){if(!_0x5e7238){_0x5583a4[_0x0a9e('0x29')](0x194);}return _0x5e7238;};}function handleError(_0x14b13f,_0x2b7e7f){_0x2b7e7f=_0x2b7e7f||0x1f4;return function(_0x3f3d41){logger['error'](_0x3f3d41[_0x0a9e('0x36')]);if(_0x3f3d41[_0x0a9e('0x37')]){delete _0x3f3d41[_0x0a9e('0x37')];}_0x14b13f[_0x0a9e('0x2a')](_0x2b7e7f)['send'](_0x3f3d41);};}exports['index']=function(_0x1e8694,_0x5640eb){var _0x24936a={},_0x3d9717={},_0x381c37={'count':0x0,'rows':[]};var _0x1ef87a=_['map'](db[_0x0a9e('0x38')][_0x0a9e('0x39')],function(_0x3cae){return{'name':_0x3cae['fieldName'],'type':_0x3cae[_0x0a9e('0x3a')][_0x0a9e('0x3b')]};});_0x3d9717[_0x0a9e('0x3c')]=_['map'](_0x1ef87a,'name');_0x3d9717[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x1e8694['query']);_0x3d9717[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x3d9717[_0x0a9e('0x3c')],_0x3d9717[_0x0a9e('0x3d')]);_0x24936a['attributes']=_['intersection'](_0x3d9717[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1e8694['query'][_0x0a9e('0x41')]));_0x24936a[_0x0a9e('0x42')]=_0x24936a[_0x0a9e('0x42')]['length']?_0x24936a[_0x0a9e('0x42')]:_0x3d9717[_0x0a9e('0x3c')];if(!_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x24936a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2e')]);_0x24936a[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}_0x24936a[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x1e8694['query']['sort']);_0x24936a[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x1e8694[_0x0a9e('0x3d')],_0x3d9717[_0x0a9e('0x3f')]),_0x1ef87a);if(_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x24936a[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x1ef87a,function(_0x35ed4a){if(_0x35ed4a['type']!==_0x0a9e('0x4c')){var _0x138b8b={};_0x138b8b[_0x35ed4a[_0x0a9e('0x37')]]={'$like':'%'+_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x138b8b;}})});}_0x24936a=_[_0x0a9e('0x4a')]({},_0x24936a,_0x1e8694[_0x0a9e('0x4d')]);var _0x44dd99={'where':_0x24936a['where']};return db[_0x0a9e('0x38')]['count'](_0x44dd99)[_0x0a9e('0x1d')](function(_0x476688){_0x381c37[_0x0a9e('0x2f')]=_0x476688;if(_0x1e8694['query'][_0x0a9e('0x4e')]){_0x24936a[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x38')][_0x0a9e('0x50')](_0x24936a);})[_0x0a9e('0x1d')](function(_0x37be73){_0x381c37[_0x0a9e('0x51')]=_0x37be73;return _0x381c37;})['then'](respondWithFilteredResult(_0x5640eb,_0x24936a))[_0x0a9e('0x28')](handleError(_0x5640eb,null));};exports[_0x0a9e('0x52')]=function(_0x1b5e80,_0x16f976){var _0x409789={'raw':!![],'where':{'id':_0x1b5e80[_0x0a9e('0x53')]['id']}},_0x992c77={};_0x992c77[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['ChatGroup'][_0x0a9e('0x39')]);_0x992c77[_0x0a9e('0x3d')]=_['keys'](_0x1b5e80['query']);_0x992c77['filters']=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],_0x992c77[_0x0a9e('0x3d')]);_0x409789[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1b5e80[_0x0a9e('0x3d')]['fields']));_0x409789['attributes']=_0x409789['attributes'][_0x0a9e('0x54')]?_0x409789[_0x0a9e('0x42')]:_0x992c77[_0x0a9e('0x3c')];if(_0x1b5e80['query'][_0x0a9e('0x4e')]){_0x409789[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x409789=_['merge']({},_0x409789,_0x1b5e80['options']);return db[_0x0a9e('0x38')]['find'](_0x409789)[_0x0a9e('0x1d')](handleEntityNotFound(_0x16f976,null))['then'](respondWithResult(_0x16f976,null))[_0x0a9e('0x28')](handleError(_0x16f976,null));};exports[_0x0a9e('0x55')]=function(_0x439340,_0x53613a){return db[_0x0a9e('0x38')][_0x0a9e('0x55')](_0x439340['body'],{})['then'](respondWithResult(_0x53613a,0xc9))[_0x0a9e('0x28')](handleError(_0x53613a,null));};exports[_0x0a9e('0x34')]=function(_0x49c095,_0x145931){if(_0x49c095['body']['id']){delete _0x49c095[_0x0a9e('0x56')]['id'];}return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x49c095['params']['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](saveUpdates(_0x49c095[_0x0a9e('0x56')],null))['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x28')](handleError(_0x145931,null));};exports[_0x0a9e('0x35')]=function(_0x3cfd00,_0x19b4df){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x3cfd00[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x19b4df,null))['then'](removeEntity(_0x19b4df,null))[_0x0a9e('0x28')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x58')]=function(_0x2642bb,_0x30c491){return db[_0x0a9e('0x38')][_0x0a9e('0x58')]()['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0x28')](handleError(_0x30c491,null));};exports[_0x0a9e('0x59')]=function(_0x5239ef,_0x3649cc,_0x5cc8fb){return db[_0x0a9e('0x5a')]['count']({'where':{'ChatGroupId':_0x5239ef['params']['id'],'ToId':_0x5239ef['user']['id'],'read':![]}})[_0x0a9e('0x1d')](function(_0x49d231){return{'id':_[_0x0a9e('0x5b')](_0x5239ef[_0x0a9e('0x53')]['id']),'count':_0x49d231};})[_0x0a9e('0x1d')](respondWithResult(_0x3649cc,null))[_0x0a9e('0x28')](handleError(_0x3649cc,null));};exports[_0x0a9e('0x5c')]=function(_0x26d7db,_0x49eed0,_0x1627a7){return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x26d7db[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))['then'](function(_0x453360){if(_0x453360){return _0x453360[_0x0a9e('0x5c')](_0x26d7db[_0x0a9e('0x56')][_0x0a9e('0x5d')],_['omit'](_0x26d7db[_0x0a9e('0x56')],[_0x0a9e('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x49eed0,null))[_0x0a9e('0x28')](handleError(_0x49eed0,null));};exports[_0x0a9e('0x5e')]=function(_0x88dcbf,_0x409b29,_0x401837){var _0x4d4a35={};var _0x176840={};var _0x2937e0;var _0x281c7d;return db['ChatGroup'][_0x0a9e('0x5f')]({'where':{'id':_0x88dcbf['params']['id']}})['then'](handleEntityNotFound(_0x409b29,null))[_0x0a9e('0x1d')](function(_0x4556c5){if(_0x4556c5){_0x2937e0=_0x4556c5;_0x176840[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x60')][_0x0a9e('0x39')]);_0x176840[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x88dcbf[_0x0a9e('0x3d')]);_0x176840[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],_0x176840[_0x0a9e('0x3d')]);_0x4d4a35[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x88dcbf[_0x0a9e('0x3d')]['fields']));_0x4d4a35[_0x0a9e('0x42')]=_0x4d4a35[_0x0a9e('0x42')][_0x0a9e('0x54')]?_0x4d4a35['attributes']:_0x176840[_0x0a9e('0x3c')];_0x4d4a35[_0x0a9e('0x45')]=qs['sort'](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x4d4a35[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x88dcbf['query'],_0x176840['filters']));if(_0x88dcbf['query'][_0x0a9e('0x49')]){_0x4d4a35[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x4d4a35[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x4d4a35[_0x0a9e('0x42')],function(_0xeef20){var _0x1a0677={};_0x1a0677[_0xeef20]={'$like':'%'+_0x88dcbf['query'][_0x0a9e('0x49')]+'%'};return _0x1a0677;})});}_0x4d4a35=_[_0x0a9e('0x4a')]({},_0x4d4a35,_0x88dcbf[_0x0a9e('0x4d')]);return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x583b2e){if(_0x583b2e){_0x281c7d=_0x583b2e[_0x0a9e('0x54')];if(!_0x88dcbf[_0x0a9e('0x3d')]['hasOwnProperty'](_0x0a9e('0x44'))){_0x4d4a35[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x88dcbf[_0x0a9e('0x3d')]['limit']);_0x4d4a35[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x3d91db){if(_0x3d91db){return _0x3d91db?{'count':_0x281c7d,'rows':_0x3d91db}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x409b29,null))[_0x0a9e('0x28')](handleError(_0x409b29,null));};exports['removeMembers']=function(_0x290d43,_0x3511c9,_0x30a4c7){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x290d43[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3511c9,null))[_0x0a9e('0x1d')](function(_0x1a7b03){if(_0x1a7b03){return _0x1a7b03[_0x0a9e('0x61')](_0x290d43[_0x0a9e('0x3d')][_0x0a9e('0x5d')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x3511c9,null))[_0x0a9e('0x28')](handleError(_0x3511c9,null));};exports['addMessage']=function(_0xf4120f,_0x11da9c,_0xc599b3){if(_0xf4120f['body']['id']){delete _0xf4120f[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0xf4120f[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x11da9c,null))['then'](function(_0x7ebea8){if(_0x7ebea8){_0xf4120f[_0x0a9e('0x56')]['ChatGroupId']=_0x7ebea8['id'];return db[_0x0a9e('0x5a')]['create'](_0xf4120f[_0x0a9e('0x56')]);}})[_0x0a9e('0x1d')](respondWithResult(_0x11da9c,null))['catch'](handleError(_0x11da9c,null));};exports[_0x0a9e('0x62')]=function(_0x41cf12,_0x2d2286,_0x42b959){var _0x3755fe={};var _0x1f42a0={};var _0x444f1f;var _0x482ca2;return db[_0x0a9e('0x38')][_0x0a9e('0x5f')]({'where':{'id':_0x41cf12[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2d2286,null))['then'](function(_0xf51744){if(_0xf51744){_0x444f1f=_0xf51744;_0x1f42a0[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x5a')]['rawAttributes']);_0x1f42a0[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x41cf12[_0x0a9e('0x3d')]);_0x1f42a0[_0x0a9e('0x3f')]=_['intersection'](_0x1f42a0['model'],_0x1f42a0[_0x0a9e('0x3d')]);_0x3755fe[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x1f42a0['model'],qs[_0x0a9e('0x41')](_0x41cf12[_0x0a9e('0x3d')]['fields']));_0x3755fe['attributes']=_0x3755fe[_0x0a9e('0x42')]['length']?_0x3755fe['attributes']:_0x1f42a0['model'];_0x3755fe[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x3755fe[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_['pick'](_0x41cf12[_0x0a9e('0x3d')],_0x1f42a0['filters']));if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x3755fe[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x3755fe['where'],{'$or':_[_0x0a9e('0x4b')](_0x3755fe[_0x0a9e('0x42')],function(_0x1d4877){var _0x5b74c3={};_0x5b74c3[_0x1d4877]={'$like':'%'+_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x5b74c3;})});}if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')]){var _0x255e49=_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')][_0x0a9e('0x64')](',');var _0x509efe={};_0x509efe[_0x255e49[0x0]]={'$gte':moment(_0x255e49[0x1])[_0x0a9e('0x65')](_0x0a9e('0x66'))};_0x3755fe['where']=_[_0x0a9e('0x4a')](_0x3755fe[_0x0a9e('0x47')],_0x509efe);}_0x3755fe=_[_0x0a9e('0x4a')]({},_0x3755fe,_0x41cf12['options']);return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){_0x482ca2=_0x8c8fbe[_0x0a9e('0x54')];if(!_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x3755fe[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x41cf12[_0x0a9e('0x3d')]['limit']);_0x3755fe[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})[_0x0a9e('0x1d')](function(_0x6803d6){if(_0x6803d6){return _0x6803d6?{'count':_0x482ca2,'rows':_0x6803d6}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x2d2286,null))[_0x0a9e('0x28')](handleError(_0x2d2286,null));};
\ No newline at end of file
+var _0xa9e0=['../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','jayson/promise','client','http','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','stack','name','ChatGroup','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','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'];(function(_0x31b31b,_0x5f044e){var _0x2c8fc2=function(_0x5438aa){while(--_0x5438aa){_0x31b31b['push'](_0x31b31b['shift']());}};_0x2c8fc2(++_0x5f044e);}(_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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return new BPromise(function(_0x519dfd,_0x16033c){var _0x12066b=_0x1985b6||client;return _0x12066b['request'](_0x52a03d,_0x5d0880)[_0x0a9e('0x1d')](function(_0x5a0a06){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x22dccb,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x22dccb,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x5a0a06));if(_0x5a0a06[_0x0a9e('0x24')]){if(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x16033c(_0x5a0a06[_0x0a9e('0x24')]['message']);}logger[_0x0a9e('0x24')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x5a0a06['error'][_0x0a9e('0x26')]);return _0x519dfd(_0x5a0a06[_0x0a9e('0x24')][_0x0a9e('0x26')]);}else{logger[_0x0a9e('0x1e')]('ChatGroup,\x20%s,\x20%s',_0x22dccb,_0x0a9e('0x20'));_0x519dfd(_0x5a0a06[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x370d86){logger[_0x0a9e('0x24')](_0x0a9e('0x1f'),_0x22dccb,_0x370d86);_0x16033c(_0x370d86);});});}function respondWithStatusCode(_0x5ea472,_0x59181e){_0x59181e=_0x59181e||0xcc;return function(_0x197ec0){if(_0x197ec0){return _0x5ea472[_0x0a9e('0x29')](_0x59181e);}return _0x5ea472[_0x0a9e('0x2a')](_0x59181e)[_0x0a9e('0x2b')]();};}function respondWithResult(_0x526cf3,_0x384319){_0x384319=_0x384319||0xc8;return function(_0x479bc4){if(_0x479bc4){return _0x526cf3[_0x0a9e('0x2a')](_0x384319)['json'](_0x479bc4);}};}function respondWithFilteredResult(_0x1dc186,_0x34dc65){return function(_0x25fba9){if(_0x25fba9){var _0x14433c=typeof _0x34dc65[_0x0a9e('0x2c')]===_0x0a9e('0x2d')&&typeof _0x34dc65[_0x0a9e('0x2e')]===_0x0a9e('0x2d');var _0x5a101a=_0x25fba9[_0x0a9e('0x2f')];var _0x468813=_0x14433c?0x0:_0x34dc65[_0x0a9e('0x2c')];var _0x2ec755=_0x14433c?_0x25fba9['count']:_0x34dc65[_0x0a9e('0x2c')]+_0x34dc65[_0x0a9e('0x2e')];var _0x1843b2;if(_0x2ec755>=_0x5a101a){_0x2ec755=_0x5a101a;_0x1843b2=0xc8;}else{_0x1843b2=0xce;}_0x1dc186[_0x0a9e('0x2a')](_0x1843b2);return _0x1dc186[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x468813+'-'+_0x2ec755+'/'+_0x5a101a)[_0x0a9e('0x32')](_0x25fba9);}return null;};}function patchUpdates(_0x2e8759){return function(_0x1dbde2){try{jsonpatch['apply'](_0x1dbde2,_0x2e8759,!![]);}catch(_0x426950){return BPromise['reject'](_0x426950);}return _0x1dbde2[_0x0a9e('0x33')]();};}function saveUpdates(_0x3ae878,_0x1122db){return function(_0x33bdb7){if(_0x33bdb7){return _0x33bdb7[_0x0a9e('0x34')](_0x3ae878)['then'](function(_0x66c1d2){return _0x66c1d2;});}return null;};}function removeEntity(_0x46f0a5,_0x40cb85){return function(_0x2da5c0){if(_0x2da5c0){return _0x2da5c0[_0x0a9e('0x35')]()[_0x0a9e('0x1d')](function(){_0x46f0a5[_0x0a9e('0x2a')](0xcc)[_0x0a9e('0x2b')]();});}};}function handleEntityNotFound(_0x5583a4,_0x44295a){return function(_0x5e7238){if(!_0x5e7238){_0x5583a4[_0x0a9e('0x29')](0x194);}return _0x5e7238;};}function handleError(_0x14b13f,_0x2b7e7f){_0x2b7e7f=_0x2b7e7f||0x1f4;return function(_0x3f3d41){logger['error'](_0x3f3d41[_0x0a9e('0x36')]);if(_0x3f3d41[_0x0a9e('0x37')]){delete _0x3f3d41[_0x0a9e('0x37')];}_0x14b13f[_0x0a9e('0x2a')](_0x2b7e7f)['send'](_0x3f3d41);};}exports['index']=function(_0x1e8694,_0x5640eb){var _0x24936a={},_0x3d9717={},_0x381c37={'count':0x0,'rows':[]};var _0x1ef87a=_['map'](db[_0x0a9e('0x38')][_0x0a9e('0x39')],function(_0x3cae){return{'name':_0x3cae['fieldName'],'type':_0x3cae[_0x0a9e('0x3a')][_0x0a9e('0x3b')]};});_0x3d9717[_0x0a9e('0x3c')]=_['map'](_0x1ef87a,'name');_0x3d9717[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x1e8694['query']);_0x3d9717[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x3d9717[_0x0a9e('0x3c')],_0x3d9717[_0x0a9e('0x3d')]);_0x24936a['attributes']=_['intersection'](_0x3d9717[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1e8694['query'][_0x0a9e('0x41')]));_0x24936a[_0x0a9e('0x42')]=_0x24936a[_0x0a9e('0x42')]['length']?_0x24936a[_0x0a9e('0x42')]:_0x3d9717[_0x0a9e('0x3c')];if(!_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x24936a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2e')]);_0x24936a[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}_0x24936a[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x1e8694['query']['sort']);_0x24936a[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x1e8694[_0x0a9e('0x3d')],_0x3d9717[_0x0a9e('0x3f')]),_0x1ef87a);if(_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x24936a[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x1ef87a,function(_0x35ed4a){if(_0x35ed4a['type']!==_0x0a9e('0x4c')){var _0x138b8b={};_0x138b8b[_0x35ed4a[_0x0a9e('0x37')]]={'$like':'%'+_0x1e8694[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x138b8b;}})});}_0x24936a=_[_0x0a9e('0x4a')]({},_0x24936a,_0x1e8694[_0x0a9e('0x4d')]);var _0x44dd99={'where':_0x24936a['where']};return db[_0x0a9e('0x38')]['count'](_0x44dd99)[_0x0a9e('0x1d')](function(_0x476688){_0x381c37[_0x0a9e('0x2f')]=_0x476688;if(_0x1e8694['query'][_0x0a9e('0x4e')]){_0x24936a[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x38')][_0x0a9e('0x50')](_0x24936a);})[_0x0a9e('0x1d')](function(_0x37be73){_0x381c37[_0x0a9e('0x51')]=_0x37be73;return _0x381c37;})['then'](respondWithFilteredResult(_0x5640eb,_0x24936a))[_0x0a9e('0x28')](handleError(_0x5640eb,null));};exports[_0x0a9e('0x52')]=function(_0x1b5e80,_0x16f976){var _0x409789={'raw':!![],'where':{'id':_0x1b5e80[_0x0a9e('0x53')]['id']}},_0x992c77={};_0x992c77[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['ChatGroup'][_0x0a9e('0x39')]);_0x992c77[_0x0a9e('0x3d')]=_['keys'](_0x1b5e80['query']);_0x992c77['filters']=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],_0x992c77[_0x0a9e('0x3d')]);_0x409789[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x992c77[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x1b5e80[_0x0a9e('0x3d')]['fields']));_0x409789['attributes']=_0x409789['attributes'][_0x0a9e('0x54')]?_0x409789[_0x0a9e('0x42')]:_0x992c77[_0x0a9e('0x3c')];if(_0x1b5e80['query'][_0x0a9e('0x4e')]){_0x409789[_0x0a9e('0x4f')]=[{'all':!![]}];}_0x409789=_['merge']({},_0x409789,_0x1b5e80['options']);return db[_0x0a9e('0x38')]['find'](_0x409789)[_0x0a9e('0x1d')](handleEntityNotFound(_0x16f976,null))['then'](respondWithResult(_0x16f976,null))[_0x0a9e('0x28')](handleError(_0x16f976,null));};exports[_0x0a9e('0x55')]=function(_0x439340,_0x53613a){return db[_0x0a9e('0x38')][_0x0a9e('0x55')](_0x439340['body'],{})['then'](respondWithResult(_0x53613a,0xc9))[_0x0a9e('0x28')](handleError(_0x53613a,null));};exports[_0x0a9e('0x34')]=function(_0x49c095,_0x145931){if(_0x49c095['body']['id']){delete _0x49c095[_0x0a9e('0x56')]['id'];}return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x49c095['params']['id']}})['then'](handleEntityNotFound(_0x145931,null))['then'](saveUpdates(_0x49c095[_0x0a9e('0x56')],null))['then'](respondWithResult(_0x145931,null))[_0x0a9e('0x28')](handleError(_0x145931,null));};exports[_0x0a9e('0x35')]=function(_0x3cfd00,_0x19b4df){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x3cfd00[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x19b4df,null))['then'](removeEntity(_0x19b4df,null))[_0x0a9e('0x28')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x58')]=function(_0x2642bb,_0x30c491){return db[_0x0a9e('0x38')][_0x0a9e('0x58')]()['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0x28')](handleError(_0x30c491,null));};exports[_0x0a9e('0x59')]=function(_0x5239ef,_0x3649cc,_0x5cc8fb){return db[_0x0a9e('0x5a')]['count']({'where':{'ChatGroupId':_0x5239ef['params']['id'],'ToId':_0x5239ef['user']['id'],'read':![]}})[_0x0a9e('0x1d')](function(_0x49d231){return{'id':_[_0x0a9e('0x5b')](_0x5239ef[_0x0a9e('0x53')]['id']),'count':_0x49d231};})[_0x0a9e('0x1d')](respondWithResult(_0x3649cc,null))[_0x0a9e('0x28')](handleError(_0x3649cc,null));};exports[_0x0a9e('0x5c')]=function(_0x26d7db,_0x49eed0,_0x1627a7){return db['ChatGroup'][_0x0a9e('0x57')]({'where':{'id':_0x26d7db[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x49eed0,null))['then'](function(_0x453360){if(_0x453360){return _0x453360[_0x0a9e('0x5c')](_0x26d7db[_0x0a9e('0x56')][_0x0a9e('0x5d')],_['omit'](_0x26d7db[_0x0a9e('0x56')],[_0x0a9e('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x49eed0,null))[_0x0a9e('0x28')](handleError(_0x49eed0,null));};exports[_0x0a9e('0x5e')]=function(_0x88dcbf,_0x409b29,_0x401837){var _0x4d4a35={};var _0x176840={};var _0x2937e0;var _0x281c7d;return db['ChatGroup'][_0x0a9e('0x5f')]({'where':{'id':_0x88dcbf['params']['id']}})['then'](handleEntityNotFound(_0x409b29,null))[_0x0a9e('0x1d')](function(_0x4556c5){if(_0x4556c5){_0x2937e0=_0x4556c5;_0x176840[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db[_0x0a9e('0x60')][_0x0a9e('0x39')]);_0x176840[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x88dcbf[_0x0a9e('0x3d')]);_0x176840[_0x0a9e('0x3f')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],_0x176840[_0x0a9e('0x3d')]);_0x4d4a35[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x176840[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x88dcbf[_0x0a9e('0x3d')]['fields']));_0x4d4a35[_0x0a9e('0x42')]=_0x4d4a35[_0x0a9e('0x42')][_0x0a9e('0x54')]?_0x4d4a35['attributes']:_0x176840[_0x0a9e('0x3c')];_0x4d4a35[_0x0a9e('0x45')]=qs['sort'](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x4d4a35[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x48')](_0x88dcbf['query'],_0x176840['filters']));if(_0x88dcbf['query'][_0x0a9e('0x49')]){_0x4d4a35[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x4d4a35[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x4b')](_0x4d4a35[_0x0a9e('0x42')],function(_0xeef20){var _0x1a0677={};_0x1a0677[_0xeef20]={'$like':'%'+_0x88dcbf['query'][_0x0a9e('0x49')]+'%'};return _0x1a0677;})});}_0x4d4a35=_[_0x0a9e('0x4a')]({},_0x4d4a35,_0x88dcbf[_0x0a9e('0x4d')]);return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x583b2e){if(_0x583b2e){_0x281c7d=_0x583b2e[_0x0a9e('0x54')];if(!_0x88dcbf[_0x0a9e('0x3d')]['hasOwnProperty'](_0x0a9e('0x44'))){_0x4d4a35[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x88dcbf[_0x0a9e('0x3d')]['limit']);_0x4d4a35[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x88dcbf[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x2937e0['getMembers'](_0x4d4a35);}})[_0x0a9e('0x1d')](function(_0x3d91db){if(_0x3d91db){return _0x3d91db?{'count':_0x281c7d,'rows':_0x3d91db}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x409b29,null))[_0x0a9e('0x28')](handleError(_0x409b29,null));};exports['removeMembers']=function(_0x290d43,_0x3511c9,_0x30a4c7){return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0x290d43[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3511c9,null))[_0x0a9e('0x1d')](function(_0x1a7b03){if(_0x1a7b03){return _0x1a7b03[_0x0a9e('0x61')](_0x290d43[_0x0a9e('0x3d')][_0x0a9e('0x5d')]);}})[_0x0a9e('0x1d')](respondWithStatusCode(_0x3511c9,null))[_0x0a9e('0x28')](handleError(_0x3511c9,null));};exports['addMessage']=function(_0xf4120f,_0x11da9c,_0xc599b3){if(_0xf4120f['body']['id']){delete _0xf4120f[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x38')][_0x0a9e('0x57')]({'where':{'id':_0xf4120f[_0x0a9e('0x53')]['id']}})['then'](handleEntityNotFound(_0x11da9c,null))['then'](function(_0x7ebea8){if(_0x7ebea8){_0xf4120f[_0x0a9e('0x56')]['ChatGroupId']=_0x7ebea8['id'];return db[_0x0a9e('0x5a')]['create'](_0xf4120f[_0x0a9e('0x56')]);}})[_0x0a9e('0x1d')](respondWithResult(_0x11da9c,null))['catch'](handleError(_0x11da9c,null));};exports[_0x0a9e('0x62')]=function(_0x41cf12,_0x2d2286,_0x42b959){var _0x3755fe={};var _0x1f42a0={};var _0x444f1f;var _0x482ca2;return db[_0x0a9e('0x38')][_0x0a9e('0x5f')]({'where':{'id':_0x41cf12[_0x0a9e('0x53')]['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x2d2286,null))['then'](function(_0xf51744){if(_0xf51744){_0x444f1f=_0xf51744;_0x1f42a0[_0x0a9e('0x3c')]=_['keys'](db[_0x0a9e('0x5a')]['rawAttributes']);_0x1f42a0[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x41cf12[_0x0a9e('0x3d')]);_0x1f42a0[_0x0a9e('0x3f')]=_['intersection'](_0x1f42a0['model'],_0x1f42a0[_0x0a9e('0x3d')]);_0x3755fe[_0x0a9e('0x42')]=_[_0x0a9e('0x40')](_0x1f42a0['model'],qs[_0x0a9e('0x41')](_0x41cf12[_0x0a9e('0x3d')]['fields']));_0x3755fe['attributes']=_0x3755fe[_0x0a9e('0x42')]['length']?_0x3755fe['attributes']:_0x1f42a0['model'];_0x3755fe[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x46')]);_0x3755fe[_0x0a9e('0x47')]=qs[_0x0a9e('0x3f')](_['pick'](_0x41cf12[_0x0a9e('0x3d')],_0x1f42a0['filters']));if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]){_0x3755fe[_0x0a9e('0x47')]=_[_0x0a9e('0x4a')](_0x3755fe['where'],{'$or':_[_0x0a9e('0x4b')](_0x3755fe[_0x0a9e('0x42')],function(_0x1d4877){var _0x5b74c3={};_0x5b74c3[_0x1d4877]={'$like':'%'+_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x49')]+'%'};return _0x5b74c3;})});}if(_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')]){var _0x255e49=_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x63')][_0x0a9e('0x64')](',');var _0x509efe={};_0x509efe[_0x255e49[0x0]]={'$gte':moment(_0x255e49[0x1])[_0x0a9e('0x65')](_0x0a9e('0x66'))};_0x3755fe['where']=_[_0x0a9e('0x4a')](_0x3755fe[_0x0a9e('0x47')],_0x509efe);}_0x3755fe=_[_0x0a9e('0x4a')]({},_0x3755fe,_0x41cf12['options']);return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})['then'](function(_0x8c8fbe){if(_0x8c8fbe){_0x482ca2=_0x8c8fbe[_0x0a9e('0x54')];if(!_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x3755fe[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x41cf12[_0x0a9e('0x3d')]['limit']);_0x3755fe[_0x0a9e('0x2c')]=qs[_0x0a9e('0x2c')](_0x41cf12[_0x0a9e('0x3d')][_0x0a9e('0x2c')]);}return _0x444f1f[_0x0a9e('0x62')](_0x3755fe);}})[_0x0a9e('0x1d')](function(_0x6803d6){if(_0x6803d6){return _0x6803d6?{'count':_0x482ca2,'rows':_0x6803d6}:null;}})[_0x0a9e('0x1d')](respondWithResult(_0x2d2286,null))[_0x0a9e('0x28')](handleError(_0x2d2286,null));};
\ No newline at end of file
index f3eec55..d06ce59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2c=['ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2cc291,_0x292ad4){var _0x2b977e=function(_0x3fefbf){while(--_0x3fefbf){_0x2cc291['push'](_0x2cc291['shift']());}};_0x2b977e(++_0x292ad4);}(_0xfa2c,0x1e4));var _0xcfa2=function(_0x4f9d2b,_0x2e5742){_0x4f9d2b=_0x4f9d2b-0x0;var _0x15f1e1=_0xfa2c[_0x4f9d2b];return _0x15f1e1;};'use strict';var EventEmitter=require(_0xcfa2('0x0'));var ChatGroup=require(_0xcfa2('0x1'))['db'][_0xcfa2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcfa2('0x3')](0x0);var events={'afterCreate':_0xcfa2('0x4'),'afterUpdate':_0xcfa2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x587ef1){return function(_0x6ad29f,_0x36229e,_0x55aaab){ChatGroupEvents[_0xcfa2('0x6')](_0x587ef1+':'+_0x6ad29f['id'],_0x6ad29f);ChatGroupEvents['emit'](_0x587ef1,_0x6ad29f);_0x55aaab(null);};}for(var e in events){if(events[_0xcfa2('0x7')](e)){var event=events[e];ChatGroup[_0xcfa2('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x077b=['hasOwnProperty','hook','exports','events','ChatGroup','save','update','remove','emit'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x077b,0xc0));var _0xb077=function(_0x52f5e1,_0x2b485b){_0x52f5e1=_0x52f5e1-0x0;var _0xf2b5ea=_0x077b[_0x52f5e1];return _0xf2b5ea;};'use strict';var EventEmitter=require(_0xb077('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xb077('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb077('0x2'),'afterUpdate':_0xb077('0x3'),'afterDestroy':_0xb077('0x4')};function emitEvent(_0x441305){return function(_0x1db4ea,_0x44df10,_0x113256){ChatGroupEvents['emit'](_0x441305+':'+_0x1db4ea['id'],_0x1db4ea);ChatGroupEvents[_0xb077('0x5')](_0x441305,_0x1db4ea);_0x113256(null);};}for(var e in events){if(events[_0xb077('0x6')](e)){var event=events[e];ChatGroup[_0xb077('0x7')](e,emitEvent(event));}}module[_0xb077('0x8')]=ChatGroupEvents;
\ No newline at end of file
index 121be86..8810bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5325=['rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5325,0x101));var _0x5532=function(_0x4d802a,_0x1b9f5e){_0x4d802a=_0x4d802a-0x0;var _0x305f95=_0x5325[_0x4d802a];return _0x305f95;};'use strict';var _=require(_0x5532('0x0'));var util=require(_0x5532('0x1'));var logger=require(_0x5532('0x2'))(_0x5532('0x3'));var moment=require(_0x5532('0x4'));var BPromise=require('bluebird');var rp=require(_0x5532('0x5'));var fs=require('fs');var path=require(_0x5532('0x6'));var rimraf=require(_0x5532('0x7'));var config=require(_0x5532('0x8'));var attributes=require(_0x5532('0x9'));module['exports']=function(_0x493863,_0x41afdc){return _0x493863[_0x5532('0xa')]('ChatGroup',attributes,{'tableName':_0x5532('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a41=['./chatGroup.attributes','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0x9a41,0xf9));var _0x19a4=function(_0x48a7e6,_0x1f8e11){_0x48a7e6=_0x48a7e6-0x0;var _0x2885f3=_0x9a41[_0x48a7e6];return _0x2885f3;};'use strict';var _=require(_0x19a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x19a4('0x1'));var moment=require(_0x19a4('0x2'));var BPromise=require(_0x19a4('0x3'));var rp=require(_0x19a4('0x4'));var fs=require('fs');var path=require(_0x19a4('0x5'));var rimraf=require('rimraf');var config=require(_0x19a4('0x6'));var attributes=require(_0x19a4('0x7'));module['exports']=function(_0x6b4985,_0x1b9798){return _0x6b4985['define']('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6cc4e6d..a579e26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b3e=['./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x55d143,_0x4836e2){var _0x29c2f7=function(_0xa65606){while(--_0xa65606){_0x55d143['push'](_0x55d143['shift']());}};_0x29c2f7(++_0x4836e2);}(_0x2b3e,0x83));var _0xe2b3=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2b3e[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0xe2b3('0x0'));var moment=require('moment');var BPromise=require(_0xe2b3('0x1'));var rs=require(_0xe2b3('0x2'));var fs=require('fs');var Redis=require(_0xe2b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2b3('0x4'));var logger=require('../../config/logger')(_0xe2b3('0x5'));var config=require(_0xe2b3('0x6'));var jayson=require(_0xe2b3('0x7'));var client=jayson[_0xe2b3('0x8')][_0xe2b3('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe2b3('0xa')],{'host':_0xe2b3('0xb'),'port':0x18eb});var socket=require(_0xe2b3('0xc'))(new Redis(config[_0xe2b3('0xa')]));require(_0xe2b3('0xd'))[_0xe2b3('0xe')](socket);function respondWithRpcPromise(_0x52818e,_0x537d76,_0x1be510){return new BPromise(function(_0x25791e,_0x3dad4a){return client[_0xe2b3('0xf')](_0x52818e,_0x1be510)['then'](function(_0x360c02){logger[_0xe2b3('0x10')](_0xe2b3('0x11'),_0x537d76,_0xe2b3('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x537d76,_0xe2b3('0x12'),JSON['stringify'](_0x360c02));if(_0x360c02[_0xe2b3('0x13')]){if(_0x360c02[_0xe2b3('0x13')][_0xe2b3('0x14')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x537d76,_0x360c02['error']['message']);return _0x3dad4a(_0x360c02[_0xe2b3('0x13')][_0xe2b3('0x15')]);}logger['error'](_0xe2b3('0x11'),_0x537d76,_0x360c02['error'][_0xe2b3('0x15')]);return _0x25791e(_0x360c02[_0xe2b3('0x13')][_0xe2b3('0x15')]);}else{logger[_0xe2b3('0x10')](_0xe2b3('0x11'),_0x537d76,_0xe2b3('0x12'));_0x25791e(_0x360c02[_0xe2b3('0x16')][_0xe2b3('0x15')]);}})[_0xe2b3('0x17')](function(_0x58dfe1){logger[_0xe2b3('0x13')](_0xe2b3('0x11'),_0x537d76,_0x58dfe1);_0x3dad4a(_0x58dfe1);});});}
\ No newline at end of file
+var _0xa234=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa234,0x142));var _0x4a23=function(_0x1b32a9,_0x238cce){_0x1b32a9=_0x1b32a9-0x0;var _0x3d0d9c=_0xa234[_0x1b32a9];return _0x3d0d9c;};'use strict';var _=require(_0x4a23('0x0'));var util=require(_0x4a23('0x1'));var moment=require(_0x4a23('0x2'));var BPromise=require(_0x4a23('0x3'));var rs=require(_0x4a23('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a23('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a23('0x6'))('rpc');var config=require(_0x4a23('0x7'));var jayson=require(_0x4a23('0x8'));var client=jayson[_0x4a23('0x9')][_0x4a23('0xa')]({'port':0x232a});config[_0x4a23('0xb')]=_[_0x4a23('0xc')](config['redis'],{'host':_0x4a23('0xd'),'port':0x18eb});var socket=require(_0x4a23('0xe'))(new Redis(config[_0x4a23('0xb')]));require(_0x4a23('0xf'))[_0x4a23('0x10')](socket);function respondWithRpcPromise(_0x1889cf,_0x139675,_0x24f91c){return new BPromise(function(_0x2b835b,_0x3f4c83){return client[_0x4a23('0x11')](_0x1889cf,_0x24f91c)['then'](function(_0x4364cc){logger[_0x4a23('0x12')](_0x4a23('0x13'),_0x139675,'request\x20sent');logger[_0x4a23('0x14')](_0x4a23('0x15'),_0x139675,_0x4a23('0x16'),JSON[_0x4a23('0x17')](_0x4364cc));if(_0x4364cc['error']){if(_0x4364cc[_0x4a23('0x18')][_0x4a23('0x19')]===0x1f4){logger[_0x4a23('0x18')](_0x4a23('0x13'),_0x139675,_0x4364cc['error']['message']);return _0x3f4c83(_0x4364cc['error']['message']);}logger['error'](_0x4a23('0x13'),_0x139675,_0x4364cc[_0x4a23('0x18')][_0x4a23('0x1a')]);return _0x2b835b(_0x4364cc[_0x4a23('0x18')]['message']);}else{logger[_0x4a23('0x12')]('ChatGroup,\x20%s,\x20%s',_0x139675,_0x4a23('0x16'));_0x2b835b(_0x4364cc[_0x4a23('0x1b')][_0x4a23('0x1a')]);}})[_0x4a23('0x1c')](function(_0x2abe80){logger[_0x4a23('0x18')]('ChatGroup,\x20%s,\x20%s',_0x139675,_0x2abe80);_0x3f4c83(_0x2abe80);});});}
\ No newline at end of file
index 362c31c..0159b1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9eda=['./chatGroup.events','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9eda,0xac));var _0xa9ed=function(_0x22cfa1,_0x36bc80){_0x22cfa1=_0x22cfa1-0x0;var _0x92a9ca=_0x9eda[_0x22cfa1];return _0x92a9ca;};'use strict';var ChatGroupEvents=require(_0xa9ed('0x0'));var events=['save','remove','update'];function createListener(_0x5d78c7,_0x38937a){return function(_0x1d97cf){_0x38937a[_0xa9ed('0x1')](_0x5d78c7,_0x1d97cf);};}function removeListener(_0x1a5c10,_0x20a14a){return function(){ChatGroupEvents['removeListener'](_0x1a5c10,_0x20a14a);};}exports['register']=function(_0x5ee280){for(var _0x332b16=0x0,_0x2ffd82=events['length'];_0x332b16<_0x2ffd82;_0x332b16++){var _0x4882da=events[_0x332b16];var _0x5382ee=createListener('chatGroup:'+_0x4882da,_0x5ee280);ChatGroupEvents['on'](_0x4882da,_0x5382ee);}};
\ No newline at end of file
+var _0xc13b=['emit','register','chatGroup:','save','remove','update'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0xc13b,0xbd));var _0xbc13=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xc13b[_0x4fc9e6];return _0x551d28;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xbc13('0x0'),_0xbc13('0x1'),_0xbc13('0x2')];function createListener(_0x2a472f,_0x7ac4aa){return function(_0x21b930){_0x7ac4aa[_0xbc13('0x3')](_0x2a472f,_0x21b930);};}function removeListener(_0x348b72,_0x3a434d){return function(){ChatGroupEvents['removeListener'](_0x348b72,_0x3a434d);};}exports[_0xbc13('0x4')]=function(_0x57672d){for(var _0x3b4484=0x0,_0x354a49=events['length'];_0x3b4484<_0x354a49;_0x3b4484++){var _0x2ecb3e=events[_0x3b4484];var _0x2bcd91=createListener(_0xbc13('0x5')+_0x2ecb3e,_0x57672d);ChatGroupEvents['on'](_0x2ecb3e,_0x2bcd91);}};
\ No newline at end of file
index f7ed52b..28bf669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb2=['post','create','addMembers','addMessage','update','delete','destroy','removeMembers','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages'];(function(_0x58de16,_0x2cc1f5){var _0x48ff5c=function(_0x42af95){while(--_0x42af95){_0x58de16['push'](_0x58de16['shift']());}};_0x48ff5c(++_0x2cc1f5);}(_0xadb2,0x1c2));var _0x2adb=function(_0x25369e,_0x15964f){_0x25369e=_0x25369e-0x0;var _0x2a8d16=_0xadb2[_0x25369e];return _0x2a8d16;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2adb('0x0'));var timeout=require(_0x2adb('0x1'));var express=require(_0x2adb('0x2'));var router=express[_0x2adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2adb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2adb('0x5'));var controller=require(_0x2adb('0x6'));router[_0x2adb('0x7')]('/',auth[_0x2adb('0x8')](),controller[_0x2adb('0x9')]);router[_0x2adb('0x7')](_0x2adb('0xa'),auth[_0x2adb('0x8')](),controller[_0x2adb('0xb')]);router['get'](_0x2adb('0xc'),auth[_0x2adb('0x8')](),controller[_0x2adb('0xd')]);router[_0x2adb('0x7')](_0x2adb('0xe'),auth[_0x2adb('0x8')](),controller['getUnread']);router[_0x2adb('0x7')](_0x2adb('0xf'),auth['isAuthenticated'](),controller[_0x2adb('0x10')]);router[_0x2adb('0x7')](_0x2adb('0x11'),auth[_0x2adb('0x8')](),controller['getMessages']);router[_0x2adb('0x12')]('/',auth[_0x2adb('0x8')](),controller[_0x2adb('0x13')]);router[_0x2adb('0x12')](_0x2adb('0xf'),auth[_0x2adb('0x8')](),controller[_0x2adb('0x14')]);router[_0x2adb('0x12')](_0x2adb('0x11'),auth[_0x2adb('0x8')](),controller[_0x2adb('0x15')]);router['put'](_0x2adb('0xc'),auth['isAuthenticated'](),controller[_0x2adb('0x16')]);router[_0x2adb('0x17')](_0x2adb('0xc'),auth[_0x2adb('0x8')](),controller[_0x2adb('0x18')]);router[_0x2adb('0x17')](_0x2adb('0xf'),auth[_0x2adb('0x8')](),controller[_0x2adb('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xfce9=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','getUnread','/:id/members','/:id/messages','create','post','addMembers','addMessage','put','delete','destroy','exports','multer'];(function(_0x55ec9a,_0x3808b7){var _0x4d14b9=function(_0x282892){while(--_0x282892){_0x55ec9a['push'](_0x55ec9a['shift']());}};_0x4d14b9(++_0x3808b7);}(_0xfce9,0x15d));var _0x9fce=function(_0x37a3e0,_0x216b86){_0x37a3e0=_0x37a3e0-0x0;var _0x30ce1d=_0xfce9[_0x37a3e0];return _0x30ce1d;};'use strict';var multer=require(_0x9fce('0x0'));var util=require(_0x9fce('0x1'));var path=require(_0x9fce('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fce('0x3'));var router=express['Router']();var fs_extra=require(_0x9fce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9fce('0x5'));var config=require(_0x9fce('0x6'));var controller=require(_0x9fce('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9fce('0x8')]);router[_0x9fce('0x9')](_0x9fce('0xa'),auth[_0x9fce('0xb')](),controller[_0x9fce('0xc')]);router[_0x9fce('0x9')](_0x9fce('0xd'),auth[_0x9fce('0xb')](),controller['show']);router['get']('/:id/unread',auth[_0x9fce('0xb')](),controller[_0x9fce('0xe')]);router[_0x9fce('0x9')](_0x9fce('0xf'),auth[_0x9fce('0xb')](),controller['getMembers']);router[_0x9fce('0x9')](_0x9fce('0x10'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x9fce('0x11')]);router[_0x9fce('0x12')](_0x9fce('0xf'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x13')]);router[_0x9fce('0x12')](_0x9fce('0x10'),auth[_0x9fce('0xb')](),controller[_0x9fce('0x14')]);router[_0x9fce('0x15')](_0x9fce('0xd'),auth[_0x9fce('0xb')](),controller['update']);router[_0x9fce('0x16')]('/:id',auth[_0x9fce('0xb')](),controller[_0x9fce('0x17')]);router[_0x9fce('0x16')](_0x9fce('0xf'),auth[_0x9fce('0xb')](),controller['removeMembers']);module[_0x9fce('0x18')]=router;
\ No newline at end of file
index 5fe5275..863be79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6075=['DATE','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','STRING','TEXT','long'];(function(_0x5dad79,_0x1432bd){var _0x5551d6=function(_0x37df52){while(--_0x37df52){_0x5dad79['push'](_0x5dad79['shift']());}};_0x5551d6(++_0x1432bd);}(_0x6075,0x142));var _0x5607=function(_0x4e5358,_0x5a5f70){_0x4e5358=_0x4e5358-0x0;var _0x5481d0=_0x6075[_0x4e5358];return _0x5481d0;};'use strict';var Sequelize=require(_0x5607('0x0'));module[_0x5607('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x5607('0x2')]},'ratingType':{'type':Sequelize[_0x5607('0x3')]('star','thumb'),'defaultValue':_0x5607('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x5607('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5607('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5607('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x5607('0x5')]},'browserVersion':{'type':Sequelize[_0x5607('0x5')]},'osName':{'type':Sequelize[_0x5607('0x5')]},'osVersion':{'type':Sequelize[_0x5607('0x5')]},'deviceModel':{'type':Sequelize[_0x5607('0x5')]},'deviceVendor':{'type':Sequelize[_0x5607('0x5')]},'deviceType':{'type':Sequelize[_0x5607('0x5')]},'referer':{'type':Sequelize[_0x5607('0x6')]},'customerIp':{'type':Sequelize[_0x5607('0x5')]},'formData':{'type':Sequelize[_0x5607('0x6')](_0x5607('0x7'))},'read1stAt':{'type':Sequelize[_0x5607('0x8')]},'lastMsgAt':{'type':Sequelize[_0x5607('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5607('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x5607('0x5')]},'customerPort':{'type':Sequelize[_0x5607('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x5607('0xa')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc902=['ENUM','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER'];(function(_0x4c63ca,_0x2df42e){var _0x1105f6=function(_0x4bb857){while(--_0x4bb857){_0x4c63ca['push'](_0x4c63ca['shift']());}};_0x1105f6(++_0x2df42e);}(_0xc902,0x15c));var _0x2c90=function(_0x51641f,_0x3da09f){_0x51641f=_0x51641f-0x0;var _0x26e87a=_0xc902[_0x51641f];return _0x26e87a;};'use strict';var Sequelize=require(_0x2c90('0x0'));module[_0x2c90('0x1')]={'closed':{'type':Sequelize[_0x2c90('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2c90('0x3')]},'ratingType':{'type':Sequelize[_0x2c90('0x4')](_0x2c90('0x5'),'thumb'),'defaultValue':_0x2c90('0x5')},'ratingMessage':{'type':Sequelize[_0x2c90('0x6')]},'pathTranscript':{'type':Sequelize[_0x2c90('0x6')]},'mailTranscript':{'type':Sequelize[_0x2c90('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2c90('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x2c90('0x7')]},'note':{'type':Sequelize[_0x2c90('0x7')]},'browserName':{'type':Sequelize[_0x2c90('0x7')]},'browserVersion':{'type':Sequelize[_0x2c90('0x7')]},'osName':{'type':Sequelize[_0x2c90('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x2c90('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x2c90('0x6')]},'customerIp':{'type':Sequelize[_0x2c90('0x7')]},'formData':{'type':Sequelize[_0x2c90('0x6')](_0x2c90('0x9'))},'read1stAt':{'type':Sequelize[_0x2c90('0x8')]},'lastMsgAt':{'type':Sequelize[_0x2c90('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x2c90('0x4')]('in',_0x2c90('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2c90('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x2c90('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index c454938..7c1698f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','attachments','Account','Owner','get','Chat','N.A.','closedAt','referer','customerPort','tail','createReadStream','pipe','createWriteStream','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','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','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','render','merge','body','agent','interaction','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','index','map','ChatInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','select','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','text','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','includeAll','include','options','create','describe','ChatWebsite','findOne','vidaooApiKey','vidaooMetadata','vidaooEscalation','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','vidaooNote','isNull','metadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','format'];(function(_0xbfc560,_0x311fba){var _0x47b022=function(_0x2cd37f){while(--_0x2cd37f){_0xbfc560['push'](_0xbfc560['shift']());}};_0x47b022(++_0x311fba);}(_0x5c00,0x17e));var _0x05c0=function(_0x461467,_0x81d0dd){_0x461467=_0x461467-0x0;var _0x5c47da=_0x5c00[_0x461467];return _0x5c47da;};'use strict';var emlformat=require(_0x05c0('0x0'));var rimraf=require(_0x05c0('0x1'));var zipdir=require(_0x05c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c0('0x3'));var moment=require('moment');var BPromise=require(_0x05c0('0x4'));var Mustache=require(_0x05c0('0x5'));var util=require(_0x05c0('0x6'));var path=require(_0x05c0('0x7'));var sox=require('sox');var csv=require(_0x05c0('0x8'));var ejs=require(_0x05c0('0x9'));var fs=require('fs');var fs_extra=require(_0x05c0('0xa'));var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x05c0('0x15'))('api');var utils=require(_0x05c0('0x16'));var config=require(_0x05c0('0x17'));var licenseUtil=require(_0x05c0('0x18'));var db=require('../../mysqldb')['db'];config[_0x05c0('0x19')]=_['defaults'](config[_0x05c0('0x19')],{'host':_0x05c0('0x1a'),'port':0x18eb});var socket=require(_0x05c0('0x1b'))(new Redis(config[_0x05c0('0x19')]));require(_0x05c0('0x1c'))[_0x05c0('0x1d')](socket);var jayson=require(_0x05c0('0x1e'));var client=jayson[_0x05c0('0x1f')]['http']({'port':0x232b});var client9004=jayson[_0x05c0('0x1f')][_0x05c0('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x4bb164,_0x29e6b0,_0x27c7bd,_0x40153e){return new BPromise(function(_0x43b803,_0xd07ad1){var _0x38f994=_0x40153e||client;return _0x38f994['request'](_0x4bb164,_0x27c7bd)[_0x05c0('0x21')](function(_0x1230e5){logger[_0x05c0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x29e6b0,_0x05c0('0x23'));logger[_0x05c0('0x24')](_0x05c0('0x25'),_0x29e6b0,_0x05c0('0x23'),JSON[_0x05c0('0x26')](_0x1230e5));if(_0x1230e5['error']){if(_0x1230e5[_0x05c0('0x27')][_0x05c0('0x28')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x29e6b0,_0x1230e5['error'][_0x05c0('0x29')]);return _0xd07ad1(_0x1230e5[_0x05c0('0x27')][_0x05c0('0x29')]);}logger[_0x05c0('0x27')](_0x05c0('0x2a'),_0x29e6b0,_0x1230e5[_0x05c0('0x27')][_0x05c0('0x29')]);return _0x43b803(_0x1230e5['error'][_0x05c0('0x29')]);}else{logger[_0x05c0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x29e6b0,'request\x20sent');_0x43b803(_0x1230e5['result']['message']);}})['catch'](function(_0x3df135){logger[_0x05c0('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x29e6b0,_0x3df135);_0xd07ad1(_0x3df135);});});}function respondWithStatusCode(_0x41a6a2,_0x336e1b){_0x336e1b=_0x336e1b||0xcc;return function(_0x3617dc){if(_0x3617dc){return _0x41a6a2[_0x05c0('0x2b')](_0x336e1b);}return _0x41a6a2['status'](_0x336e1b)[_0x05c0('0x2c')]();};}function respondWithResult(_0x1c14b1,_0x2ceaed){_0x2ceaed=_0x2ceaed||0xc8;return function(_0x200e80){if(_0x200e80){return _0x1c14b1[_0x05c0('0x2d')](_0x2ceaed)[_0x05c0('0x2e')](_0x200e80);}};}function respondWithFilteredResult(_0x57886b,_0x56ba64){return function(_0x2df109){if(_0x2df109){var _0xbe7d9e=typeof _0x56ba64[_0x05c0('0x2f')]===_0x05c0('0x30')&&typeof _0x56ba64[_0x05c0('0x31')]===_0x05c0('0x30');var _0x1c4c8f=_0x2df109[_0x05c0('0x32')];var _0x33eff3=_0xbe7d9e?0x0:_0x56ba64[_0x05c0('0x2f')];var _0x3e38f0=_0xbe7d9e?_0x2df109[_0x05c0('0x32')]:_0x56ba64['offset']+_0x56ba64['limit'];var _0x2bfe05;if(_0x3e38f0>=_0x1c4c8f){_0x3e38f0=_0x1c4c8f;_0x2bfe05=0xc8;}else{_0x2bfe05=0xce;}_0x57886b[_0x05c0('0x2d')](_0x2bfe05);return _0x57886b[_0x05c0('0x33')]('Content-Range',_0x33eff3+'-'+_0x3e38f0+'/'+_0x1c4c8f)[_0x05c0('0x2e')](_0x2df109);}return null;};}function patchUpdates(_0x30caf0){return function(_0x4b0ea1){try{jsonpatch[_0x05c0('0x34')](_0x4b0ea1,_0x30caf0,!![]);}catch(_0x4e923d){return BPromise[_0x05c0('0x35')](_0x4e923d);}return _0x4b0ea1[_0x05c0('0x36')]();};}function saveUpdates(_0x400cbe,_0x1d4d33){return function(_0x3d842e){if(_0x3d842e){return _0x3d842e[_0x05c0('0x37')](_0x400cbe)[_0x05c0('0x21')](function(_0x9da3fa){return _0x9da3fa;});}return null;};}function removeEntity(_0x3d8d76,_0x3a72c2){return function(_0x39d783){if(_0x39d783){return _0x39d783[_0x05c0('0x38')]()[_0x05c0('0x21')](function(){_0x3d8d76[_0x05c0('0x2d')](0xcc)[_0x05c0('0x2c')]();});}};}function handleEntityNotFound(_0x3382f6,_0x19a19c){return function(_0x21c22){if(!_0x21c22){_0x3382f6[_0x05c0('0x2b')](0x194);}return _0x21c22;};}function handleError(_0x1faa63,_0x3d1bae){_0x3d1bae=_0x3d1bae||0x1f4;return function(_0x337847){logger[_0x05c0('0x27')](_0x337847[_0x05c0('0x39')]);if(_0x337847[_0x05c0('0x3a')]){delete _0x337847[_0x05c0('0x3a')];}_0x1faa63[_0x05c0('0x2d')](_0x3d1bae)[_0x05c0('0x3b')](_0x337847);};}function getMustacheRender(_0x40d4db,_0xf2df25){return Mustache[_0x05c0('0x3c')](_0x40d4db,_[_0x05c0('0x3d')](_0xf2df25[_0x05c0('0x3e')],{'contact':_0xf2df25['contact'],'message':_0xf2df25[_0x05c0('0x29')],'agent':_0xf2df25[_0x05c0('0x3f')],'interaction':_0xf2df25[_0x05c0('0x40')],'account':_0xf2df25[_0x05c0('0x41')]}))||'';}function getInteractionUsers(_0x49f829,_0x551534){return new BPromise(function(_0x324a51,_0x2540db){try{if(_0x551534[_0x49f829['id']]){_0x49f829[_0x05c0('0x42')]=_['map'](_0x551534[_0x49f829['id']],function(_0x29dc87){return{'id':_0x29dc87['id'],'fullname':_0x29dc87[_0x05c0('0x43')]};});}}catch(_0x704394){_0x2540db(_0x704394);}_0x324a51(_0x49f829);});}function getInteractionTags(_0xb20d7e,_0x47b349){return new BPromise(function(_0x152c6a,_0x32f25c){try{if(_0xb20d7e['TagIds']){_0xb20d7e[_0x05c0('0x44')]=[];_0xb20d7e[_0x05c0('0x45')][_0x05c0('0x46')](',')[_0x05c0('0x47')](function(_0x164e3a){_0xb20d7e[_0x05c0('0x44')][_0x05c0('0x48')](_0x47b349[_0x164e3a]);});}delete _0xb20d7e['TagIds'];}catch(_0x595b0a){_0x32f25c(_0x595b0a);}_0x152c6a(_0xb20d7e);});}function updateChatInteraction(_0x29d62a,_0x1d1d94,_0xaa5d53){return new BPromise(function(_0x11f079,_0x14aba3){return getInteractionUsers(_0x29d62a,_0xaa5d53)['then'](function(_0x208805){return getInteractionTags(_0x208805,_0x1d1d94);})[_0x05c0('0x21')](function(_0x2fdfe8){_0x11f079(_0x2fdfe8);})[_0x05c0('0x49')](function(_0x24ecbb){_0x14aba3(_0x24ecbb);});});}exports[_0x05c0('0x4a')]=function(_0x39cbfd,_0x5525bc){var _0x31cc1b={},_0xf0e4c0={},_0x15d119={'count':0x0,'rows':[]};var _0x23a10f=_[_0x05c0('0x4b')](db[_0x05c0('0x4c')][_0x05c0('0x4d')],function(_0x42835d){return{'name':_0x42835d[_0x05c0('0x4e')],'type':_0x42835d[_0x05c0('0x4f')][_0x05c0('0x50')]};});_0xf0e4c0['model']=_['map'](_0x23a10f,_0x05c0('0x3a'));_0xf0e4c0[_0x05c0('0x51')]=_[_0x05c0('0x52')](_0x39cbfd[_0x05c0('0x51')]);_0xf0e4c0[_0x05c0('0x53')]=_[_0x05c0('0x54')](_0xf0e4c0['model'],_0xf0e4c0[_0x05c0('0x51')]);_0x31cc1b[_0x05c0('0x55')]=_[_0x05c0('0x54')](_0xf0e4c0[_0x05c0('0x56')],qs['fields'](_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x57')]));_0x31cc1b[_0x05c0('0x55')]=_0x31cc1b[_0x05c0('0x55')]['length']?_0x31cc1b[_0x05c0('0x55')]:_0xf0e4c0[_0x05c0('0x56')];if(!_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x58')]('nolimit')){_0x31cc1b[_0x05c0('0x31')]=qs[_0x05c0('0x31')](_0x39cbfd['query'][_0x05c0('0x31')]);_0x31cc1b['offset']=qs['offset'](_0x39cbfd[_0x05c0('0x51')]['offset']);}_0x31cc1b[_0x05c0('0x59')]=qs[_0x05c0('0x5a')](_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x5a')]);_0x31cc1b[_0x05c0('0x5b')]=qs[_0x05c0('0x53')](_['pick'](_0x39cbfd[_0x05c0('0x51')],_0xf0e4c0['filters']),_0x23a10f);var _0x12f941=[];var _0x389fc7=squel[_0x05c0('0x5c')]()[_0x05c0('0x5d')]('id')[_0x05c0('0x5d')](_0x05c0('0x3a'))[_0x05c0('0x5d')]('color')['from']('tools_tags');var _0x395497=squel[_0x05c0('0x5c')]()['field']('u.id')[_0x05c0('0x5d')](_0x05c0('0x5e'))[_0x05c0('0x5d')](_0x05c0('0x5f'))[_0x05c0('0x60')](_0x05c0('0x61'),'ui')[_0x05c0('0x62')]('users','u',_0x05c0('0x63'));var _0x46105a=squel[_0x05c0('0x5c')]()[_0x05c0('0x60')]('chat_interactions','i')[_0x05c0('0x62')]('cm_contacts','c',_0x05c0('0x64'))[_0x05c0('0x62')]('users','o',_0x05c0('0x65'))['left_join'](_0x05c0('0x66'),'a',_0x05c0('0x67'))[_0x05c0('0x62')](_0x05c0('0x68'),'me',_0x05c0('0x69'))[_0x05c0('0x62')]('chat_interaction_has_tags','it',_0x05c0('0x6a'))[_0x05c0('0x62')](_0x05c0('0x6b'),'t',_0x05c0('0x6c'));var _0x49cfc5=squel[_0x05c0('0x6d')]();var _0x58c7bc=[];var _0x284650=squel[_0x05c0('0x6d')]();var _0x1dd246;if(_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x6e')]){_0x1dd246=as[_0x05c0('0x6f')](_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x6e')]);var _0x44187f=_0x1dd246[_0x05c0('0x70')];for(var _0x23cc3e=0x0;_0x23cc3e<_0x1dd246[_0x05c0('0x71')]['length'];_0x23cc3e++){var _0x59bab5=_0x1dd246['conditions'][_0x23cc3e];var _0x39b393='i';var _0x2735e1=_[_0x05c0('0x72')](_0x23a10f,['name',_0x59bab5[_0x05c0('0x5d')]]);if(!_0x2735e1){switch(_0x59bab5[_0x05c0('0x5d')]){case _0x05c0('0x73'):if(_0x59bab5[_0x05c0('0x74')]==0x1){_0x46105a[_0x05c0('0x75')]('`'+_0x59bab5[_0x05c0('0x5d')]+_0x05c0('0x76'));}else{_0x46105a['having']('`'+_0x59bab5[_0x05c0('0x5d')]+_0x05c0('0x77'));}break;case _0x05c0('0x78'):if(_0x59bab5[_0x05c0('0x79')]==='$substring'){if(_0x59bab5['value']['split']('\x20')[_0x05c0('0x7a')]>0x1){_0x49cfc5[_0x44187f](_0x05c0('0x7b'),qs[_0x05c0('0x7c')](_0x59bab5[_0x05c0('0x74')]),null);}else{var _0x132ba5='%'+_0x59bab5[_0x05c0('0x74')]+'%';_0x49cfc5[_0x44187f](_0x05c0('0x7d'),_0x132ba5,_0x132ba5,_0x132ba5);}}else{_0x2735e1=_['find'](_0x23a10f,[_0x05c0('0x3a'),_0x05c0('0x7e')]);_0x59bab5[_0x05c0('0x5d')]=_0x05c0('0x7e');_0xae8cf2=as[_0x05c0('0x7f')](_0x39b393,_0x2735e1['type'],_0x59bab5);_0x49cfc5[_0x44187f](_0xae8cf2['text'],_0xae8cf2[_0x05c0('0x74')][_0x05c0('0x80')],_0xae8cf2['value'][_0x05c0('0x2c')]);}break;case'Tag':var _0x4b3454=_0x59bab5[_0x05c0('0x74')][_0x05c0('0x46')](',')[_0x05c0('0x4b')](function(_0x50725c){return Number(_0x50725c);});_0x4b3454['forEach'](function(_0x2b6ddc){_0x284650['or'](_0x05c0('0x81'),'%,'+_0x2b6ddc+',%');});_0x58c7bc=_[_0x05c0('0x82')](_0x58c7bc,_0x4b3454);break;case'User':if(_0x59bab5['operator']==='$substring'){_0x49cfc5[_0x44187f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x59bab5['value']+'%',null);}else{_0x2735e1=_[_0x05c0('0x72')](_0x23a10f,['name','UserId']);_0x59bab5['field']=_0x05c0('0x83');_0xae8cf2=as[_0x05c0('0x7f')](_0x39b393,_0x2735e1[_0x05c0('0x4f')],_0x59bab5);_0x49cfc5[_0x44187f](_0xae8cf2['text'],_0xae8cf2[_0x05c0('0x74')][_0x05c0('0x80')],_0xae8cf2['value'][_0x05c0('0x2c')]);}break;case _0x05c0('0x3e'):_0xae8cf2=as[_0x05c0('0x7f')]('me',null,_0x59bab5);_0x49cfc5[_0x44187f](_0xae8cf2[_0x05c0('0x84')],_0xae8cf2['value'][_0x05c0('0x80')],_0xae8cf2[_0x05c0('0x74')][_0x05c0('0x2c')]);break;}}else{var _0xae8cf2=as[_0x05c0('0x7f')](_0x39b393,_0x2735e1['type'],_0x59bab5);_0x49cfc5[_0x44187f](_0xae8cf2['text'],_0xae8cf2[_0x05c0('0x74')]['start'],_0xae8cf2[_0x05c0('0x74')][_0x05c0('0x2c')]);}}}else{var _0x5f001c=_(_0x39cbfd[_0x05c0('0x51')])['keys']()['map'](function(_0x4fad9a){return _['some'](_0x23a10f,[_0x05c0('0x3a'),_0x4fad9a])?_0x4fad9a:undefined;})[_0x05c0('0x85')]()[_0x05c0('0x74')]();if(!_[_0x05c0('0x86')](_0x5f001c)){_0x5f001c['forEach'](function(_0x2eedc0){if(_0x2eedc0===_0x05c0('0x87')){_0x46105a[_0x05c0('0x5b')](_0x05c0('0x88'),[][_0x05c0('0x89')](_0x39cbfd['query'][_0x2eedc0]));}else if(_0x2eedc0===_0x05c0('0x8a')){var _0x4f41bd=JSON['parse'](_0x39cbfd[_0x05c0('0x51')][_0x2eedc0])[_0x05c0('0x8b')];var _0x46490a=JSON[_0x05c0('0x8c')](_0x39cbfd[_0x05c0('0x51')][_0x2eedc0])[_0x05c0('0x8d')];_0x46105a['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f41bd,_0x46490a);}else{if(_0x39cbfd[_0x05c0('0x51')][_0x2eedc0]===_0x05c0('0x8e')){_0x46105a[_0x05c0('0x5b')]('i.'+_0x2eedc0+'\x20IS\x20NULL');}else{_0x46105a[_0x05c0('0x5b')]('i.'+_0x2eedc0+_0x05c0('0x8f'),_0x39cbfd[_0x05c0('0x51')][_0x2eedc0]);}}});}if(_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x90')]){if(_0x39cbfd[_0x05c0('0x51')]['read']==0x1){_0x46105a[_0x05c0('0x75')](_0x05c0('0x91'));}else{_0x46105a['having'](_0x05c0('0x92'));}}if(_0x39cbfd[_0x05c0('0x51')]['tag']){_0x58c7bc=_[_0x05c0('0x93')](_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x94')])?_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x94')]:new Array(_0x39cbfd[_0x05c0('0x51')]['tag']);_0x58c7bc[_0x05c0('0x47')](function(_0x4de79c){_0x284650['or'](_0x05c0('0x81'),'%,'+_0x4de79c+',%');});}if(_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x95')]){var _0x247fbb=_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x95')][_0x05c0('0x96')]('\x5c','\x5c\x5c')[_0x05c0('0x96')](/'/g,'\x27\x27');if(qs[_0x05c0('0x97')](_0x247fbb)){_0x49cfc5['or'](_0x05c0('0x98'),_0x247fbb+'%');}else{_0x49cfc5['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x05c0('0x7c')](_0x247fbb))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x247fbb+'%');}}}_0x46105a[_0x05c0('0x5b')](_0x49cfc5);_0x46105a['group'](_0x05c0('0x99'));var _0x36f82a={'type':db[_0x05c0('0x9a')][_0x05c0('0x9b')][_0x05c0('0x9c')],'raw':!![]};var _0xb11234=_0x46105a[_0x05c0('0x9d')]();_0xb11234[_0x05c0('0x5d')](_0x05c0('0x99'));_0xb11234['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x05c0('0x73'));if(_0x31cc1b[_0x05c0('0x59')]){_0x31cc1b[_0x05c0('0x59')][_0x05c0('0x47')](function(_0x15ef15){var _0x362996=_0x15ef15[0x0]===_0x05c0('0x9e')?_0x15ef15[0x0]:'i.'+_0x15ef15[0x0];_0x46105a['order'](_0x362996,_0x15ef15[0x1]===_0x05c0('0x9f')?![]:!![]);});}if(!_['isEmpty'](_0x58c7bc)){_0x46105a[_0x05c0('0x75')](_0x284650);_0xb11234['where'](_0x05c0('0xa0'),_0x58c7bc);}BPromise['resolve']()[_0x05c0('0x21')](function(){if(!_0x1dd246){if(_0x39cbfd[_0x05c0('0x51')]['ChatWebsiteId'])return;_0xb11234[_0x05c0('0x5b')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x46105a['where'](_0x05c0('0xa1'));return;}if(_0x39cbfd[_0x05c0('0xa2')][_0x05c0('0xa3')]!==_0x05c0('0x3f'))return;return _0x39cbfd[_0x05c0('0xa2')][_0x05c0('0xa4')]({'attributes':['id'],'raw':!![]})[_0x05c0('0x21')](function(_0x4bd567){if(_['isEmpty'](_0x4bd567)){_0xb11234['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x46105a['where'](_0x05c0('0xa5'));}else{_0xb11234[_0x05c0('0x5b')](_0x05c0('0x88'),_[_0x05c0('0x4b')](_0x4bd567,'id'));_0x46105a['where'](_0x05c0('0x88'),_[_0x05c0('0x4b')](_0x4bd567,'id'));}});})[_0x05c0('0x21')](function(){if(_0x39cbfd[_0x05c0('0xa2')][_0x05c0('0xa3')]===_0x05c0('0x3f')&&!_0x1dd246&&!_0x39cbfd[_0x05c0('0x51')][_0x05c0('0x87')])return[];return db[_0x05c0('0xa6')]['query'](_0xb11234[_0x05c0('0xa7')](),_0x36f82a);})['then'](function(_0x1321bb){_0x15d119['count']=_0x1321bb[_0x05c0('0x7a')];if(_0x15d119[_0x05c0('0x32')]===0x0)return[];return db['sequelize'][_0x05c0('0x51')](_0x389fc7[_0x05c0('0xa7')](),_0x36f82a)['then'](function(_0x3752ba){_0x12f941=_['keyBy'](_0x3752ba,'id');_0x36f82a=_[_0x05c0('0x3d')](_0x36f82a,{'model':db[_0x05c0('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39cbfd[_0x05c0('0x51')]['fields']){_0x31cc1b['attributes'][_0x05c0('0x47')](function(_0x1f8c93){_0x46105a[_0x05c0('0x5d')]('i.'+_0x1f8c93);});}else{_0x46105a[_0x05c0('0x5d')](_0x05c0('0xa8'),_0x05c0('0x73'));_0x46105a[_0x05c0('0x5d')](_0x05c0('0xa9'),_0x05c0('0xaa'));_0x46105a[_0x05c0('0x5d')](_0x05c0('0xab'),_0x05c0('0xac'));_0x46105a[_0x05c0('0x5d')](_0x05c0('0xad'),'contactName');_0x46105a[_0x05c0('0x5d')]('i.*');_0x46105a[_0x05c0('0x5d')](_0x05c0('0xae'),'Contact.firstName');_0x46105a[_0x05c0('0x5d')](_0x05c0('0xaf'),_0x05c0('0xb0'));_0x46105a[_0x05c0('0x5d')](_0x05c0('0xb1'),_0x05c0('0xb2'));_0x46105a[_0x05c0('0x5d')](_0x05c0('0xb3'),'Contact.phone');_0x46105a[_0x05c0('0x5d')](_0x05c0('0xb4'),_0x05c0('0xb5'));_0x46105a[_0x05c0('0x5d')](_0x05c0('0xb6'),_0x05c0('0xb7'));_0x46105a['field'](_0x05c0('0xb8'),_0x05c0('0xb9'));_0x46105a['field'](_0x05c0('0xba'),'Owner.internal');_0x46105a[_0x05c0('0x5d')](_0x05c0('0xbb'),_0x05c0('0x45'));}if(_0x31cc1b['limit'])_0x46105a[_0x05c0('0x31')](_0x31cc1b['limit']);if(_0x31cc1b[_0x05c0('0x2f')])_0x46105a[_0x05c0('0x2f')](_0x31cc1b[_0x05c0('0x2f')]);return db[_0x05c0('0xa6')][_0x05c0('0x51')](_0x46105a[_0x05c0('0xa7')](),_0x36f82a);})[_0x05c0('0x21')](function(_0x3c1b7f){if(_0x3c1b7f['length']>0x0)_0x395497[_0x05c0('0x5b')](_0x05c0('0xbc'),_['map'](_0x3c1b7f,'id'));return db[_0x05c0('0xa6')][_0x05c0('0x51')](_0x395497[_0x05c0('0xa7')](),_0x36f82a)[_0x05c0('0x21')](function(_0x4827d8){var _0x3a0cd2=_[_0x05c0('0xbd')](_0x4827d8,_0x05c0('0xbe'));var _0x166f42=[];_0x3c1b7f['forEach'](function(_0x255e3e){_0x166f42[_0x05c0('0x48')](updateChatInteraction(_0x255e3e,_0x12f941,_0x3a0cd2));});return BPromise['all'](_0x166f42);});});})[_0x05c0('0x21')](function(_0x390b6b){_0x15d119[_0x05c0('0xbf')]=_0x390b6b;return _0x15d119;})[_0x05c0('0x21')](respondWithFilteredResult(_0x5525bc,_0x31cc1b))[_0x05c0('0x49')](handleError(_0x5525bc,null));};exports[_0x05c0('0xc0')]=function(_0x55650c,_0xdbbf4d){var _0x51aee6={'raw':![],'where':{'id':_0x55650c[_0x05c0('0xc1')]['id']}},_0x4535f9={};_0x4535f9[_0x05c0('0x56')]=_[_0x05c0('0x52')](db['ChatInteraction'][_0x05c0('0x4d')]);_0x4535f9[_0x05c0('0x51')]=_['keys'](_0x55650c[_0x05c0('0x51')]);_0x4535f9[_0x05c0('0x53')]=_[_0x05c0('0x54')](_0x4535f9['model'],_0x4535f9[_0x05c0('0x51')]);_0x51aee6[_0x05c0('0x55')]=_[_0x05c0('0x54')](_0x4535f9[_0x05c0('0x56')],qs[_0x05c0('0x57')](_0x55650c[_0x05c0('0x51')][_0x05c0('0x57')]));_0x51aee6[_0x05c0('0x55')]=_0x51aee6['attributes'][_0x05c0('0x7a')]?_0x51aee6[_0x05c0('0x55')]:_0x4535f9[_0x05c0('0x56')];if(_0x55650c[_0x05c0('0x51')][_0x05c0('0xc2')]){_0x51aee6[_0x05c0('0xc3')]=[{'all':!![]}];}_0x51aee6=_[_0x05c0('0x3d')]({},_0x51aee6,_0x55650c[_0x05c0('0xc4')]);return db[_0x05c0('0x4c')][_0x05c0('0x72')](_0x51aee6)['then'](handleEntityNotFound(_0xdbbf4d,null))[_0x05c0('0x21')](respondWithResult(_0xdbbf4d,null))[_0x05c0('0x49')](handleError(_0xdbbf4d,null));};exports[_0x05c0('0xc5')]=function(_0x44e9e5,_0x5b9cd1){return db[_0x05c0('0x4c')][_0x05c0('0xc5')](_0x44e9e5[_0x05c0('0x3e')],{})[_0x05c0('0x21')](respondWithResult(_0x5b9cd1,0xc9))[_0x05c0('0x49')](handleError(_0x5b9cd1,null));};exports[_0x05c0('0x37')]=function(_0x5f1f6f,_0x5a9d9b){if(_0x5f1f6f[_0x05c0('0x3e')]['id']){delete _0x5f1f6f[_0x05c0('0x3e')]['id'];}return db[_0x05c0('0x4c')][_0x05c0('0x72')]({'where':{'id':_0x5f1f6f[_0x05c0('0xc1')]['id']}})[_0x05c0('0x21')](handleEntityNotFound(_0x5a9d9b,null))['then'](saveUpdates(_0x5f1f6f['body'],null))[_0x05c0('0x21')](respondWithResult(_0x5a9d9b,null))[_0x05c0('0x49')](handleError(_0x5a9d9b,null));};exports[_0x05c0('0x38')]=function(_0x4c0bd2,_0x290eba){return db[_0x05c0('0x4c')][_0x05c0('0x72')]({'where':{'id':_0x4c0bd2['params']['id']}})[_0x05c0('0x21')](handleEntityNotFound(_0x290eba,null))[_0x05c0('0x21')](removeEntity(_0x290eba,null))[_0x05c0('0x49')](handleError(_0x290eba,null));};exports[_0x05c0('0xc6')]=function(_0x31345d,_0xe5e62d){return db[_0x05c0('0x4c')][_0x05c0('0xc6')]()[_0x05c0('0x21')](respondWithResult(_0xe5e62d,null))[_0x05c0('0x49')](handleError(_0xe5e62d,null));};exports['createVidaooSession']=function(_0x39708c,_0x524fec){var _0x392748=_0x39708c['params']['id'];var _0x26c08f;var _0x370920;var _0x5928e2;return db[_0x05c0('0x4c')]['findOne']({'where':{'id':_0x392748}})[_0x05c0('0x21')](function(_0x1f1b63){_0x26c08f=_0x1f1b63;return db[_0x05c0('0xc7')][_0x05c0('0xc8')]({'where':{'id':_0x1f1b63[_0x05c0('0x87')]},'attributes':['id',_0x05c0('0xc9'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x05c0('0xca')],'raw':!![]});})[_0x05c0('0x21')](function(_0x10b80d){if(_0x10b80d&&_0x10b80d[_0x05c0('0xc9')]&&_0x10b80d[_0x05c0('0xcb')]){_0x370920=_0x10b80d;var _0x3b47d3={'interaction':{'id':_0x392748},'agent':{'id':_0x39708c[_0x05c0('0xa2')]['id'],'name':_0x39708c[_0x05c0('0xa2')][_0x05c0('0x3a')],'fullname':_0x39708c[_0x05c0('0xa2')][_0x05c0('0x43')],'email':_0x39708c[_0x05c0('0xa2')]['email']},'contact':_0x39708c[_0x05c0('0x3e')][_0x05c0('0xcc')],'account':_0x39708c[_0x05c0('0x3e')]['account']};var _0xc8d14e={'rejectUnauthorized':![],'method':_0x05c0('0xcd'),'url':_0x05c0('0xce'),'headers':{'X-APIKEY':_0x10b80d['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39708c['user'][_0x05c0('0xcf')]],'buttons':null,'topic':_0x370920[_0x05c0('0xd0')],'note':_['isNull'](_0x370920[_0x05c0('0xd1')])?null:getMustacheRender(_0x370920[_0x05c0('0xd1')],_0x3b47d3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x05c0('0xd2')](_0x370920['vidaooMetadata'])){var _0xc1223d=getMustacheRender(_0x370920[_0x05c0('0xca')],_0x3b47d3);var _0x24ce4d=JSON[_0x05c0('0x8c')](_0xc1223d);_0xc8d14e['body'][_0x05c0('0xd3')]=_0x24ce4d;}}catch(_0x329c16){throw new db[(_0x05c0('0x9a'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xc8d14e);}else{throw new db[(_0x05c0('0x9a'))]['ValidationError'](_0x05c0('0xd4'));}})['then'](function(_0x33b171){_0x5928e2=_0x33b171;if(_0x5928e2['id']){var _0x3765f7={'body':_0x5928e2[_0x05c0('0xd5')],'ChatWebsiteId':_0x370920['id'],'ChatInteractionId':_0x26c08f['id'],'direction':_0x05c0('0xd6'),'UserId':_0x39708c[_0x05c0('0xa2')]['id']};return db[_0x05c0('0xd7')]['create'](_0x3765f7,{});}else{throw new db['Sequelize'][(_0x05c0('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x05c0('0x21')](function(){return _0x26c08f[_0x05c0('0xd9')]({'vidaooSessionId':_0x5928e2['id']});})[_0x05c0('0x21')](respondWithResult(_0x524fec,null))[_0x05c0('0x49')](handleError(_0x524fec,null));};exports[_0x05c0('0xda')]=function(_0x104f23,_0x54a1e8){if(_0x104f23[_0x05c0('0x3e')]['id']){delete _0x104f23[_0x05c0('0x3e')]['id'];}return db[_0x05c0('0x4c')][_0x05c0('0x72')]({'where':{'id':_0x104f23['params']['id']},'include':[{'model':db[_0x05c0('0xdb')],'as':_0x05c0('0x78')}]})[_0x05c0('0x21')](handleEntityNotFound(_0x54a1e8,null))['then'](saveUpdates(_0x104f23['body'],null))['then'](respondWithResult(_0x54a1e8,null))[_0x05c0('0x49')](handleError(_0x54a1e8,null));};exports[_0x05c0('0xdc')]=function(_0x14355b,_0x2d3364,_0x310af2){if(_0x14355b[_0x05c0('0x3e')]['id']){delete _0x14355b['body']['id'];}return db[_0x05c0('0x4c')][_0x05c0('0x72')]({'where':{'id':_0x14355b[_0x05c0('0xc1')]['id']}})[_0x05c0('0x21')](function(_0x44b3ae){if(!_0x44b3ae){logger[_0x05c0('0x27')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0x05c0('0xdd'));_0x2d3364['sendStatus'](0x194);}else{if(_0x44b3ae['UserId']){throw new db[(_0x05c0('0x9a'))][(_0x05c0('0xd8'))](_0x05c0('0xde'));}}return _0x44b3ae;})[_0x05c0('0x21')](function(_0xf50a95){if(_0xf50a95){return _0xf50a95[_0x05c0('0x37')]({'closed':_0x14355b[_0x05c0('0x3e')][_0x05c0('0xdf')],'disposition':_0x14355b['body'][_0x05c0('0xe0')]})[_0x05c0('0x21')](function(_0x33e11a){return _0x33e11a;});}})[_0x05c0('0x21')](function(_0x2e3152){return respondWithRpcPromise('AbandonInteraction','abandon',_0x14355b[_0x05c0('0x3e')],client9004);})[_0x05c0('0x21')](respondWithResult(_0x2d3364,null))[_0x05c0('0x49')](handleError(_0x2d3364,null));};exports[_0x05c0('0xe1')]=function(_0x4f5868,_0x59d5fb,_0x8598b9){_0x4f5868[_0x05c0('0x3e')][_0x05c0('0x3a')]=_0x4f5868[_0x05c0('0xe2')][_0x05c0('0xe3')];_0x4f5868[_0x05c0('0x3e')]['basename']=_0x4f5868['file'][_0x05c0('0xe4')];_0x4f5868['body'][_0x05c0('0x4f')]=_0x4f5868['file']['mimetype'];return db[_0x05c0('0xe5')][_0x05c0('0xc5')](_0x4f5868[_0x05c0('0x3e')])[_0x05c0('0x21')](respondWithResult(_0x59d5fb,0xc9))[_0x05c0('0x49')](handleError(_0x59d5fb,null));};exports[_0x05c0('0xe6')]=function(_0x4c5679,_0x5d0326,_0x5ba2a7){return db[_0x05c0('0x4c')][_0x05c0('0xc8')]({'where':{'id':_0x4c5679[_0x05c0('0xc1')]['id']},'raw':!![]})[_0x05c0('0x21')](handleEntityNotFound(_0x5d0326,null))['then'](function(_0xfdc96c){if(_0xfdc96c){if(_0xfdc96c['closed']){return _0x5d0326[_0x05c0('0x2d')](0x193)[_0x05c0('0x2e')]({'status':0x193,'message':_0x05c0('0xe7')});}return db['Attachment'][_0x05c0('0xc8')]({'where':{'id':_0x4c5679['query'][_0x05c0('0xe8')]},'raw':!![]})[_0x05c0('0x21')](handleEntityNotFound(_0x5d0326,null));}})[_0x05c0('0x21')](function(_0x33d39f){if(_0x33d39f){var _0x50718e=_0x33d39f[_0x05c0('0xe9')]!==null;var _0x2a0653=path[_0x05c0('0xea')](config[_0x05c0('0xeb')],'server/files/attachments/');if(_0x50718e){_0x2a0653=path['join'](_0x2a0653,_0x05c0('0xec'));}var _0x4fd8f7=path[_0x05c0('0xea')](_0x2a0653,_0x33d39f[_0x05c0('0xed')]);return _0x5d0326[_0x05c0('0xee')](_0x4fd8f7);}})[_0x05c0('0x49')](handleError(_0x5d0326,null));};exports[_0x05c0('0xef')]=function(_0x4d3c41,_0x261e4e){var _0x326719=null;var _0x519852=null;var _0xe583ac=null;var _0x1aebc1=null;if(_0x4d3c41[_0x05c0('0x3e')]['id']){delete _0x4d3c41[_0x05c0('0x3e')]['id'];}if(_0x4d3c41[_0x05c0('0x3e')][_0x05c0('0xf0')]){_0x1aebc1=path[_0x05c0('0xea')](config[_0x05c0('0xeb')],'server/files/chat/upload/',util[_0x05c0('0xf1')]('transcript-%s.txt',Date[_0x05c0('0xf2')]()));_0x4d3c41['body'][_0x05c0('0xf3')]=_0x1aebc1;}return db[_0x05c0('0x4c')][_0x05c0('0x72')]({'where':{'id':_0x4d3c41[_0x05c0('0xc1')]['id']},'include':[{'model':db[_0x05c0('0xd7')],'as':_0x05c0('0xf4'),'include':[{'model':db['User'],'as':_0x05c0('0xf5')}]}]})[_0x05c0('0x21')](handleEntityNotFound(_0x261e4e,null))[_0x05c0('0x21')](saveUpdates(_0x4d3c41[_0x05c0('0x3e')],null))[_0x05c0('0x21')](function(_0x2780bd){if(_0x2780bd){_0x326719=_0x2780bd;return db[_0x05c0('0xc7')][_0x05c0('0x72')]({'where':{'id':_0x326719[_0x05c0('0x87')]}});}})[_0x05c0('0x21')](function(_0xe6c87){if(_0xe6c87){_0xe583ac=_0xe6c87;return db[_0x05c0('0xdb')][_0x05c0('0x72')]({'where':{'id':_0x326719[_0x05c0('0x7e')]}});}})['then'](function(_0x1071da){if(_0x1071da){_0x519852=_0x1071da;if(_0x1aebc1){var _0x3efb9c=null;for(var _0xb861a3=0x1;_0xb861a3<_0x326719[_0x05c0('0xf4')][_0x05c0('0x7a')];++_0xb861a3){_0x3efb9c=_0x326719[_0x05c0('0xf4')][_0xb861a3];var _0x32a8e1=_0x3efb9c[_0x05c0('0x83')]?util[_0x05c0('0xf1')](_0x05c0('0xf6'),_0xe583ac[_0x05c0('0xf7')],_0x3efb9c['UserId']):_0x05c0('0xf8');var _0x522f4=_0x4d3c41['body'][_0x05c0('0xf9')]||util['format']('%s%d',_0x05c0('0xfa'),_0x3efb9c['ContactId']);switch(_0xe583ac[_0x05c0('0xfb')]){case _0x05c0('0xfc'):_0x32a8e1=_0x3efb9c[_0x05c0('0x83')]?util[_0x05c0('0xf1')](_0x05c0('0xf6'),_0xe583ac[_0x05c0('0xf7')],_0x3efb9c[_0x05c0('0x83')]):_0x05c0('0xf8');break;case'agent_alias':_0x32a8e1=_0x3efb9c[_0x05c0('0x83')]?_0x3efb9c['User']['alias']||_0x3efb9c['User'][_0x05c0('0x43')]:_0x05c0('0xf8');break;case _0x05c0('0xfd'):_0x32a8e1=_0x3efb9c[_0x05c0('0x83')]?_0x3efb9c[_0x05c0('0xf5')][_0x05c0('0x43')]:'System';break;default:_0x32a8e1=_0x3efb9c[_0x05c0('0x83')]?util[_0x05c0('0xf1')](_0x05c0('0xf6'),_0xe583ac[_0x05c0('0xf7')],_0x3efb9c[_0x05c0('0x83')]):_0x05c0('0xf8');}var _0x5d87bc=util[_0x05c0('0xf1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3efb9c[_0x05c0('0x8a')])[_0x05c0('0xf1')](_0x05c0('0xfe')),_0x3efb9c[_0x05c0('0xff')]==='in'?_0x522f4:_0x32a8e1,_0x3efb9c[_0x05c0('0x3e')]);if(!_0x3efb9c[_0x05c0('0x100')]){fs[_0x05c0('0x101')](_0x1aebc1,_0x5d87bc);}}return db[_0x05c0('0x102')][_0x05c0('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x05c0('0x103')],'as':_0x05c0('0x104'),'raw':!![]}]});}}})[_0x05c0('0x21')](function(_0x1a81a5){if(_0x1a81a5&&_0x1a81a5[_0x05c0('0x104')]&&_0x4d3c41[_0x05c0('0x3e')]){var _0x502797={'tls':{'rejectUnauthorized':![]}};if(_0x1a81a5[_0x05c0('0x104')]['service']){_0x502797[_0x05c0('0x105')]=_0x1a81a5[_0x05c0('0x104')][_0x05c0('0x105')];}else{_0x502797['host']=_0x1a81a5[_0x05c0('0x104')][_0x05c0('0x106')];_0x502797[_0x05c0('0x107')]=_0x1a81a5[_0x05c0('0x104')][_0x05c0('0x107')];_0x502797[_0x05c0('0x108')]=_0x1a81a5['Smtp']['secure'];}if(_0x1a81a5['Smtp'][_0x05c0('0x109')]){_0x502797[_0x05c0('0x10a')]={'user':_0x1a81a5['Smtp'][_0x05c0('0xa2')],'pass':_0x1a81a5[_0x05c0('0x104')]['pass']};}return respondWithRpcPromise(_0x05c0('0x10b'),_0x05c0('0x10c'),{'account':_0x502797,'message':{'from':util[_0x05c0('0xf1')](_0x05c0('0x10d'),_0x1a81a5[_0x05c0('0x3a')],_0x1a81a5[_0x05c0('0xcf')]||_0x1a81a5[_0x05c0('0x104')][_0x05c0('0xa2')]),'to':_0x4d3c41[_0x05c0('0x3e')][_0x05c0('0xf0')],'subject':_0x05c0('0x10e'),'text':util[_0x05c0('0xf1')](_0x05c0('0x10f'),_0x4d3c41[_0x05c0('0x3e')][_0x05c0('0xf0')]),'attachments':[{'path':_0x1aebc1}]}})[_0x05c0('0x21')](function(){return _0x326719;})['catch'](function(_0x5dcbc5){console[_0x05c0('0x27')](_0x5dcbc5);});}else{return _0x326719;}})[_0x05c0('0x21')](respondWithStatusCode(_0x261e4e,0xc8))['catch'](handleError(_0x261e4e,null));};exports[_0x05c0('0x110')]=function(_0x2c64d5,_0xf7ce8f,_0x553e53){return db['ChatMessage']['find']({'where':{'id':_0x2c64d5[_0x05c0('0xc1')]['id']}})[_0x05c0('0x21')](handleEntityNotFound(_0xf7ce8f,null))[_0x05c0('0x21')](function(_0x2115b2){if(_0x2115b2){return _0x2115b2[_0x05c0('0x110')](_0x2c64d5[_0x05c0('0x3e')][_0x05c0('0x111')],_['omit'](_0x2c64d5['body'],[_0x05c0('0x111'),'id'])||{});}})['then'](respondWithResult(_0xf7ce8f,null))[_0x05c0('0x49')](handleError(_0xf7ce8f,null));};exports[_0x05c0('0x112')]=function(_0x27fec0,_0x10f3f6,_0x4ae4fe){var _0x580628={'raw':![],'where':{}};var _0x4d02e4={};var _0xa3fb60={'count':0x0,'rows':[]};return db[_0x05c0('0x4c')]['findOne']({'where':{'id':_0x27fec0[_0x05c0('0xc1')]['id']}})[_0x05c0('0x21')](handleEntityNotFound(_0x10f3f6,null))['then'](function(_0x505898){if(_0x505898){_0x4d02e4[_0x05c0('0x56')]=_[_0x05c0('0x52')](db['ChatMessage'][_0x05c0('0x4d')]);_0x4d02e4[_0x05c0('0x51')]=_[_0x05c0('0x52')](_0x27fec0[_0x05c0('0x51')]);_0x4d02e4[_0x05c0('0x53')]=_[_0x05c0('0x54')](_0x4d02e4[_0x05c0('0x56')],_0x4d02e4[_0x05c0('0x51')]);_0x580628['attributes']=_[_0x05c0('0x54')](_0x4d02e4[_0x05c0('0x56')],qs[_0x05c0('0x57')](_0x27fec0[_0x05c0('0x51')][_0x05c0('0x57')]));_0x580628[_0x05c0('0x55')]=_0x580628['attributes'][_0x05c0('0x7a')]?_0x580628['attributes']:_0x4d02e4[_0x05c0('0x56')];if(!_0x27fec0[_0x05c0('0x51')]['hasOwnProperty']('nolimit')){_0x580628[_0x05c0('0x31')]=qs['limit'](_0x27fec0[_0x05c0('0x51')][_0x05c0('0x31')]);_0x580628[_0x05c0('0x2f')]=qs['offset'](_0x27fec0[_0x05c0('0x51')][_0x05c0('0x2f')]);}_0x580628[_0x05c0('0x59')]=qs[_0x05c0('0x5a')](_0x27fec0['query'][_0x05c0('0x5a')]);_0x580628[_0x05c0('0x5b')]=qs[_0x05c0('0x53')](_[_0x05c0('0x113')](_0x27fec0[_0x05c0('0x51')],_0x4d02e4['filters']));_0x580628[_0x05c0('0x5b')][_0x05c0('0xbe')]=_0x505898['id'];if(_0x27fec0[_0x05c0('0x51')]['filter']){_0x580628[_0x05c0('0x5b')]=_[_0x05c0('0x3d')](_0x580628[_0x05c0('0x5b')],{'$or':_[_0x05c0('0x4b')](_0x580628[_0x05c0('0x55')],function(_0x4338f7){var _0x255760={};_0x255760[_0x4338f7]={'$like':'%'+_0x27fec0[_0x05c0('0x51')][_0x05c0('0x95')]+'%'};return _0x255760;})});}if(_0x27fec0['query'][_0x05c0('0x8b')]){var _0xa491b1=_0x27fec0[_0x05c0('0x51')][_0x05c0('0x8b')][_0x05c0('0x46')](',');var _0x3c8014={};_0x3c8014[_0xa491b1[0x0]]={'$gte':moment(_0xa491b1[0x1])['format'](_0x05c0('0x114'))};_0x580628[_0x05c0('0x5b')]=_[_0x05c0('0x3d')](_0x580628[_0x05c0('0x5b')],_0x3c8014);}_0x580628=_[_0x05c0('0x3d')]({},_0x580628,_0x27fec0['options']);return db[_0x05c0('0xd7')][_0x05c0('0x32')]({'where':_0x580628[_0x05c0('0x5b')]})[_0x05c0('0x21')](function(_0x571296){_0xa3fb60[_0x05c0('0x32')]=_0x571296;if(_0x27fec0['query'][_0x05c0('0xc2')]){_0x580628['include']=[{'all':!![]}];}return db[_0x05c0('0xd7')][_0x05c0('0x115')](_0x580628);})['then'](function(_0x560142){_0xa3fb60[_0x05c0('0xbf')]=_0x560142;return _0xa3fb60;});}})[_0x05c0('0x21')](respondWithFilteredResult(_0x10f3f6,_0x580628))['catch'](handleError(_0x10f3f6,null));};exports['getMyMessages']=function(_0x1c1d1b,_0x8dfe83,_0x5d6983){var _0x2793e6={'where':{}},_0x2d5007={},_0x4bc104={'count':0x0,'rows':[]};return db[_0x05c0('0x4c')]['findOne']({'where':{'id':_0x1c1d1b[_0x05c0('0xc1')]['id']}})['then'](handleEntityNotFound(_0x8dfe83,null))[_0x05c0('0x21')](function(_0x1e94fd){if(_0x1e94fd){_0x2d5007[_0x05c0('0x56')]=_[_0x05c0('0x52')](db[_0x05c0('0xd7')]['rawAttributes']);_0x2d5007[_0x05c0('0x51')]=_[_0x05c0('0x52')](_0x1c1d1b[_0x05c0('0x51')]);_0x2d5007[_0x05c0('0x53')]=_[_0x05c0('0x54')](_0x2d5007[_0x05c0('0x56')],_0x2d5007['query']);_0x2793e6[_0x05c0('0x55')]=_[_0x05c0('0x54')](_0x2d5007[_0x05c0('0x56')],qs[_0x05c0('0x57')](_0x1c1d1b['query']['fields']));_0x2793e6[_0x05c0('0x55')]=_0x2793e6[_0x05c0('0x55')][_0x05c0('0x7a')]?_0x2793e6['attributes']:_0x2d5007[_0x05c0('0x56')];if(!_0x1c1d1b[_0x05c0('0x51')][_0x05c0('0x58')]('nolimit')){_0x2793e6[_0x05c0('0x31')]=qs[_0x05c0('0x31')](_0x1c1d1b[_0x05c0('0x51')][_0x05c0('0x31')]);_0x2793e6[_0x05c0('0x2f')]=qs[_0x05c0('0x2f')](_0x1c1d1b['query'][_0x05c0('0x2f')]);}_0x2793e6[_0x05c0('0x59')]=qs['sort'](_0x1c1d1b[_0x05c0('0x51')][_0x05c0('0x5a')]);_0x2793e6[_0x05c0('0x5b')]=qs[_0x05c0('0x53')](_[_0x05c0('0x113')](_0x1c1d1b[_0x05c0('0x51')],_0x2d5007[_0x05c0('0x53')]));_0x2793e6[_0x05c0('0x5b')][_0x05c0('0xbe')]=_0x1e94fd['id'];if(_0x1c1d1b[_0x05c0('0x51')][_0x05c0('0x95')]){_0x2793e6[_0x05c0('0x5b')]=_['merge'](_0x2793e6[_0x05c0('0x5b')],{'$or':_['map'](_0x2793e6['attributes'],function(_0x27c0d5){var _0x2bd090={};_0x2bd090[_0x27c0d5]={'$like':'%'+_0x1c1d1b[_0x05c0('0x51')][_0x05c0('0x95')]+'%'};return _0x2bd090;})});}_0x2793e6[_0x05c0('0x5b')][_0x05c0('0x100')]=![];if(_0x1c1d1b['query']['id']){_0x2793e6[_0x05c0('0x5b')]['id']={'$gt':_0x1c1d1b[_0x05c0('0x51')]['id']};}_0x2793e6=_['merge']({},_0x2793e6,_0x1c1d1b[_0x05c0('0xc4')]);return db['ChatMessage'][_0x05c0('0x32')]({'where':_0x2793e6[_0x05c0('0x5b')]})[_0x05c0('0x21')](function(_0x2b1f68){_0x4bc104['count']=_0x2b1f68;_0x2793e6[_0x05c0('0xc3')]=[];if(_0x1c1d1b[_0x05c0('0x51')]['includeAgent']){_0x2793e6[_0x05c0('0xc3')]['push']({'model':db['User'],'as':_0x05c0('0xf5'),'attributes':['id',_0x05c0('0x43'),'alias']});}if(_0x1c1d1b['query'][_0x05c0('0xc2')]){_0x2793e6[_0x05c0('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0x05c0('0x115')](_0x2793e6);})[_0x05c0('0x21')](function(_0x37a782){_0x4bc104[_0x05c0('0xbf')]=_0x37a782;return _0x4bc104;});}})[_0x05c0('0x21')](respondWithFilteredResult(_0x8dfe83,_0x2793e6))[_0x05c0('0x49')](handleError(_0x8dfe83,null));};exports[_0x05c0('0x116')]=function(_0x40c95b,_0x501ac9,_0x3c5ea7){return db[_0x05c0('0x4c')][_0x05c0('0x72')]({'where':{'id':_0x40c95b[_0x05c0('0xc1')]['id']}})[_0x05c0('0x21')](handleEntityNotFound(_0x501ac9,null))[_0x05c0('0x21')](function(_0x4af40a){if(_0x4af40a){return _0x4af40a['setTags'](_0x40c95b['body'][_0x05c0('0x111')],_[_0x05c0('0x117')](_0x40c95b['body'],[_0x05c0('0x111'),'id'])||{})[_0x05c0('0x118')](function(){return db[_0x05c0('0x119')][_0x05c0('0x115')]({'attributes':['id','name',_0x05c0('0x11a')],'where':{'id':_0x40c95b['body'][_0x05c0('0x111')]}});})[_0x05c0('0x21')](function(_0xa042dd){socket[_0x05c0('0x11b')](_0x05c0('0x11c'),{'id':Number(_0x40c95b['params']['id']),'tags':_0xa042dd||[]});return{'id':Number(_0x40c95b[_0x05c0('0xc1')]['id']),'tags':_0xa042dd||[]};});}})[_0x05c0('0x21')](respondWithResult(_0x501ac9,null))['catch'](handleError(_0x501ac9,null));};exports[_0x05c0('0x11d')]=function(_0x3fecdb,_0x1221b7,_0x2160d9){return db['ChatInteraction'][_0x05c0('0x72')]({'where':{'id':_0x3fecdb[_0x05c0('0xc1')]['id']}})[_0x05c0('0x21')](handleEntityNotFound(_0x1221b7,null))[_0x05c0('0x21')](function(_0x17251f){if(_0x17251f){return _0x17251f[_0x05c0('0x11d')](_0x3fecdb[_0x05c0('0x51')][_0x05c0('0x111')]);}})[_0x05c0('0x21')](respondWithStatusCode(_0x1221b7,null))['catch'](handleError(_0x1221b7,null));};exports['download']=function(_0x4b5f9b,_0xb0ce65){var _0x4b719f=moment()[_0x05c0('0x11e')]()[_0x05c0('0xa7')]();var _0x19866a=path[_0x05c0('0xea')](config[_0x05c0('0xeb')],_0x05c0('0x11f'),_0x05c0('0x120'),'tmp');var _0x17d76f=path[_0x05c0('0xea')](config[_0x05c0('0xeb')],_0x05c0('0x11f'),'files','attachments');var _0x4d49c3=path[_0x05c0('0xea')](_0x19866a,_0x4b719f);var _0x2a96c9=util[_0x05c0('0xf1')](_0x05c0('0x121'),_0x4b5f9b[_0x05c0('0xc1')]['id'],_0x4b719f);var _0x3e44e0=path[_0x05c0('0xea')](_0x19866a,_0x2a96c9);var _0xd00903=[];_0xd00903[_0x05c0('0x48')]({'model':db[_0x05c0('0xf5')],'as':_0x05c0('0xf5'),'attributes':['id',_0x05c0('0x43')],'raw':!![]});_0xd00903[_0x05c0('0x48')]({'model':db['CmContact'],'as':_0x05c0('0x78'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4b5f9b[_0x05c0('0x51')][_0x05c0('0x122')]){_0xd00903[_0x05c0('0x48')]({'model':db[_0x05c0('0xe5')],'as':'Attachment','raw':!![]});}var _0x4f1c2d=[{'model':db[_0x05c0('0xd7')],'as':_0x05c0('0xf4'),'attributes':['id','body','createdAt',_0x05c0('0xff'),_0x05c0('0x100'),_0x05c0('0x90')],'include':_0xd00903}];_0x4f1c2d['push']({'model':db[_0x05c0('0xc7')],'as':_0x05c0('0x123'),'attributes':['id',_0x05c0('0x3a')]});_0x4f1c2d[_0x05c0('0x48')]({'model':db[_0x05c0('0xf5')],'as':_0x05c0('0x124'),'attributes':['id',_0x05c0('0x43')]});return db['ChatInteraction'][_0x05c0('0x72')]({'where':{'id':_0x4b5f9b[_0x05c0('0xc1')]['id']},'include':_0x4f1c2d})[_0x05c0('0x21')](handleEntityNotFound(_0xb0ce65,null))[_0x05c0('0x21')](function(_0x493a4f){if(_0x493a4f){var _0x8e91ee=_0x493a4f[_0x05c0('0x125')]({'plain':!![]});fs['mkdirSync'](_0x4d49c3);var _0x542ea6={'channel':_0x05c0('0x126'),'account':_0x8e91ee[_0x05c0('0x123')][_0x05c0('0x3a')],'agent':_0x8e91ee['Owner']?_0x8e91ee[_0x05c0('0x124')][_0x05c0('0x43')]:_0x05c0('0x127'),'createdAt':moment(_0x8e91ee['createdAt'])[_0x05c0('0xf1')](_0x05c0('0x114'))[_0x05c0('0xa7')](),'closedAt':_0x8e91ee[_0x05c0('0xdf')]?moment(_0x8e91ee[_0x05c0('0x128')])[_0x05c0('0xf1')](_0x05c0('0x114'))['toString']():'','disposition':_0x8e91ee[_0x05c0('0xe0')],'chatInfo':{'browser':_0x8e91ee['browserName'],'os':_0x8e91ee['osName'],'referer':_0x8e91ee[_0x05c0('0x129')],'customerIp':_0x8e91ee['customerIp'],'customerPort':_0x8e91ee[_0x05c0('0x12a')]?_0x8e91ee[_0x05c0('0x12a')]:_0x05c0('0x127')},'messages':_(_0x8e91ee['Messages'])[_0x05c0('0x12b')]()[_0x05c0('0x95')]({'secret':![]})[_0x05c0('0x4b')](function(_0x3f2285){if(_0x3f2285[_0x05c0('0xe5')]){var _0x22f3f6=path[_0x05c0('0xea')](_0x17d76f,_0x3f2285[_0x05c0('0xe5')][_0x05c0('0xed')]);if(fs['existsSync'](_0x22f3f6)){fs[_0x05c0('0x12c')](_0x22f3f6)[_0x05c0('0x12d')](fs[_0x05c0('0x12e')](path[_0x05c0('0xea')](_0x4d49c3,_0x3f2285[_0x05c0('0xe5')][_0x05c0('0xed')])));}}return{'date':moment(_0x3f2285[_0x05c0('0x8a')])[_0x05c0('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x05c0('0xa7')](),'sender':_0x3f2285[_0x05c0('0xff')]===_0x05c0('0xd6')?_0x3f2285[_0x05c0('0xf5')]?_0x3f2285[_0x05c0('0xf5')][_0x05c0('0x43')]:'System':_0x3f2285['Contact']['firstName']+(_0x3f2285[_0x05c0('0x78')][_0x05c0('0x12f')]?'\x20'+_0x3f2285['Contact'][_0x05c0('0x12f')]:''),'body':_0x3f2285[_0x05c0('0xe5')]?_0x3f2285['Attachment'][_0x05c0('0xed')]:_0x3f2285['body'],'direction':_0x3f2285[_0x05c0('0xff')]==='out'?'A':'C','secret':_0x3f2285[_0x05c0('0x100')],'read':_0x3f2285['read'],'attachment':_0x3f2285[_0x05c0('0xe5')]};})[_0x05c0('0x74')]()};return ejs['renderFile'](path[_0x05c0('0xea')](config[_0x05c0('0xeb')],'server',_0x05c0('0x130'),_0x05c0('0x131')),{'interaction':_0x542ea6})[_0x05c0('0x21')](function(_0xa765d9){var _0x13f88e=path[_0x05c0('0xea')](_0x4d49c3,_0x05c0('0x132')+_0x8e91ee['id']+'-'+_0x4b719f+_0x05c0('0x133'));var _0x146758={'path':_0x13f88e,'channel':'Chat','interactionId':_0x8e91ee['id']};return pdf[_0x05c0('0x134')](_0xa765d9,_0x146758);})['then'](function(){return new BPromise(function(_0x3db8e1,_0x52abcf){zipdir(_0x4d49c3,{'saveTo':_0x3e44e0},function(_0x445dc3,_0x897616){if(_0x445dc3)return _0x52abcf(_0x445dc3);return _0x3db8e1(_0x897616);});})[_0x05c0('0x21')](function(){return new BPromise(function(_0x866394,_0x22f9cb){rimraf(_0x4d49c3,function(_0x4658fd){if(_0x4658fd)_0x22f9cb(_0x4658fd);return _0x866394();});});})['then'](function(){return _0xb0ce65[_0x05c0('0xee')](_0x3e44e0,_0x2a96c9,function(_0x584ef2){if(_0x584ef2){console[_0x05c0('0x135')](_0x05c0('0x136'),_0x584ef2);}else{fs[_0x05c0('0x137')](_0x3e44e0);}});});});}else{return _0xb0ce65[_0x05c0('0x2b')](0xc8);}})['catch'](handleError(_0xb0ce65,null));};
\ No newline at end of file
+var _0x5eb8=['i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','rows','show','params','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','CmContact','%s%d','agentAlias','agentIdentifier','website_alias','System','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','transcript-%d-%s.zip','firstName','lastName','attachments','Account','Owner','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','renderFile','.pdf','log','err','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','render','body','interaction','map','TagIds','Tags','forEach','catch','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','User','UserId','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte'];(function(_0x4399a6,_0x4f3ef7){var _0x20ba25=function(_0x5c9e3c){while(--_0x5c9e3c){_0x4399a6['push'](_0x4399a6['shift']());}};_0x20ba25(++_0x4f3ef7);}(_0x5eb8,0xb0));var _0x85eb=function(_0x27650e,_0x278f7a){_0x27650e=_0x27650e-0x0;var _0x28fe08=_0x5eb8[_0x27650e];return _0x28fe08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var pdf=require(_0x85eb('0x14'));var hardwareService=require(_0x85eb('0x15'));var logger=require('../../config/logger')(_0x85eb('0x16'));var utils=require(_0x85eb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x85eb('0x18'));var db=require(_0x85eb('0x19'))['db'];config[_0x85eb('0x1a')]=_[_0x85eb('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x85eb('0x1c'))(new Redis(config['redis']));require(_0x85eb('0x1d'))[_0x85eb('0x1e')](socket);var jayson=require(_0x85eb('0x1f'));var client=jayson[_0x85eb('0x20')][_0x85eb('0x21')]({'port':0x232b});var client9004=jayson['client'][_0x85eb('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x59237b,_0x17140b,_0x10c2c9,_0x3e23e8){return new BPromise(function(_0x5deab1,_0x5dbeda){var _0x5c5cbb=_0x3e23e8||client;return _0x5c5cbb['request'](_0x59237b,_0x10c2c9)[_0x85eb('0x22')](function(_0x39ca96){logger[_0x85eb('0x23')](_0x85eb('0x24'),_0x17140b,_0x85eb('0x25'));logger[_0x85eb('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x17140b,_0x85eb('0x25'),JSON[_0x85eb('0x27')](_0x39ca96));if(_0x39ca96[_0x85eb('0x28')]){if(_0x39ca96['error']['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x17140b,_0x39ca96[_0x85eb('0x28')][_0x85eb('0x29')]);return _0x5dbeda(_0x39ca96[_0x85eb('0x28')][_0x85eb('0x29')]);}logger[_0x85eb('0x28')](_0x85eb('0x24'),_0x17140b,_0x39ca96['error']['message']);return _0x5deab1(_0x39ca96['error'][_0x85eb('0x29')]);}else{logger[_0x85eb('0x23')](_0x85eb('0x24'),_0x17140b,_0x85eb('0x25'));_0x5deab1(_0x39ca96[_0x85eb('0x2a')][_0x85eb('0x29')]);}})['catch'](function(_0x39d3fe){logger[_0x85eb('0x28')](_0x85eb('0x24'),_0x17140b,_0x39d3fe);_0x5dbeda(_0x39d3fe);});});}function respondWithStatusCode(_0x30e766,_0x3e2326){_0x3e2326=_0x3e2326||0xcc;return function(_0x57a03c){if(_0x57a03c){return _0x30e766[_0x85eb('0x2b')](_0x3e2326);}return _0x30e766[_0x85eb('0x2c')](_0x3e2326)[_0x85eb('0x2d')]();};}function respondWithResult(_0x3e7eb9,_0x40f13e){_0x40f13e=_0x40f13e||0xc8;return function(_0x29d262){if(_0x29d262){return _0x3e7eb9['status'](_0x40f13e)['json'](_0x29d262);}};}function respondWithFilteredResult(_0x37515c,_0x585f2a){return function(_0xa9b14f){if(_0xa9b14f){var _0x5255eb=typeof _0x585f2a[_0x85eb('0x2e')]===_0x85eb('0x2f')&&typeof _0x585f2a[_0x85eb('0x30')]===_0x85eb('0x2f');var _0xa67e1c=_0xa9b14f[_0x85eb('0x31')];var _0x41ed76=_0x5255eb?0x0:_0x585f2a['offset'];var _0x237f19=_0x5255eb?_0xa9b14f[_0x85eb('0x31')]:_0x585f2a['offset']+_0x585f2a[_0x85eb('0x30')];var _0x5af2de;if(_0x237f19>=_0xa67e1c){_0x237f19=_0xa67e1c;_0x5af2de=0xc8;}else{_0x5af2de=0xce;}_0x37515c['status'](_0x5af2de);return _0x37515c[_0x85eb('0x32')](_0x85eb('0x33'),_0x41ed76+'-'+_0x237f19+'/'+_0xa67e1c)[_0x85eb('0x34')](_0xa9b14f);}return null;};}function patchUpdates(_0x246dda){return function(_0x33c05f){try{jsonpatch[_0x85eb('0x35')](_0x33c05f,_0x246dda,!![]);}catch(_0x39b574){return BPromise[_0x85eb('0x36')](_0x39b574);}return _0x33c05f[_0x85eb('0x37')]();};}function saveUpdates(_0x1008bf,_0x4cbee0){return function(_0x14fe58){if(_0x14fe58){return _0x14fe58[_0x85eb('0x38')](_0x1008bf)['then'](function(_0x505321){return _0x505321;});}return null;};}function removeEntity(_0x340745,_0x13f245){return function(_0x38b96e){if(_0x38b96e){return _0x38b96e[_0x85eb('0x39')]()[_0x85eb('0x22')](function(){_0x340745[_0x85eb('0x2c')](0xcc)[_0x85eb('0x2d')]();});}};}function handleEntityNotFound(_0x35f092,_0x272a99){return function(_0x373e5f){if(!_0x373e5f){_0x35f092[_0x85eb('0x2b')](0x194);}return _0x373e5f;};}function handleError(_0x317d19,_0x317d86){_0x317d86=_0x317d86||0x1f4;return function(_0x33605a){logger['error'](_0x33605a[_0x85eb('0x3a')]);if(_0x33605a[_0x85eb('0x3b')]){delete _0x33605a['name'];}_0x317d19['status'](_0x317d86)[_0x85eb('0x3c')](_0x33605a);};}function getMustacheRender(_0xe22d16,_0x5389d8){return Mustache[_0x85eb('0x3d')](_0xe22d16,_['merge'](_0x5389d8[_0x85eb('0x3e')],{'contact':_0x5389d8['contact'],'message':_0x5389d8[_0x85eb('0x29')],'agent':_0x5389d8['agent'],'interaction':_0x5389d8[_0x85eb('0x3f')],'account':_0x5389d8['account']}))||'';}function getInteractionUsers(_0x38ab0f,_0x16202e){return new BPromise(function(_0x4de24e,_0x313989){try{if(_0x16202e[_0x38ab0f['id']]){_0x38ab0f['Users']=_[_0x85eb('0x40')](_0x16202e[_0x38ab0f['id']],function(_0x331260){return{'id':_0x331260['id'],'fullname':_0x331260['fullname']};});}}catch(_0x241488){_0x313989(_0x241488);}_0x4de24e(_0x38ab0f);});}function getInteractionTags(_0x4c25ed,_0x5495cf){return new BPromise(function(_0x1b8a71,_0x4edb2d){try{if(_0x4c25ed[_0x85eb('0x41')]){_0x4c25ed[_0x85eb('0x42')]=[];_0x4c25ed['TagIds']['split'](',')[_0x85eb('0x43')](function(_0x422ec3){_0x4c25ed['Tags']['push'](_0x5495cf[_0x422ec3]);});}delete _0x4c25ed[_0x85eb('0x41')];}catch(_0x2d1b32){_0x4edb2d(_0x2d1b32);}_0x1b8a71(_0x4c25ed);});}function updateChatInteraction(_0x2211f9,_0x202681,_0x3be961){return new BPromise(function(_0x5b7411,_0x5ccf8a){return getInteractionUsers(_0x2211f9,_0x3be961)[_0x85eb('0x22')](function(_0x208c27){return getInteractionTags(_0x208c27,_0x202681);})[_0x85eb('0x22')](function(_0x2ed39d){_0x5b7411(_0x2ed39d);})[_0x85eb('0x44')](function(_0x40e2a2){_0x5ccf8a(_0x40e2a2);});});}exports[_0x85eb('0x45')]=function(_0x469639,_0x540c7a){var _0x3a06af={},_0x1cabcb={},_0x5d90cc={'count':0x0,'rows':[]};var _0x1b77b3=_[_0x85eb('0x40')](db[_0x85eb('0x46')][_0x85eb('0x47')],function(_0x1b1559){return{'name':_0x1b1559[_0x85eb('0x48')],'type':_0x1b1559['type'][_0x85eb('0x49')]};});_0x1cabcb[_0x85eb('0x4a')]=_[_0x85eb('0x40')](_0x1b77b3,_0x85eb('0x3b'));_0x1cabcb[_0x85eb('0x4b')]=_[_0x85eb('0x4c')](_0x469639[_0x85eb('0x4b')]);_0x1cabcb[_0x85eb('0x4d')]=_['intersection'](_0x1cabcb[_0x85eb('0x4a')],_0x1cabcb[_0x85eb('0x4b')]);_0x3a06af[_0x85eb('0x4e')]=_[_0x85eb('0x4f')](_0x1cabcb[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x50')]));_0x3a06af[_0x85eb('0x4e')]=_0x3a06af[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x3a06af[_0x85eb('0x4e')]:_0x1cabcb['model'];if(!_0x469639[_0x85eb('0x4b')][_0x85eb('0x52')](_0x85eb('0x53'))){_0x3a06af['limit']=qs[_0x85eb('0x30')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x30')]);_0x3a06af[_0x85eb('0x2e')]=qs[_0x85eb('0x2e')](_0x469639['query'][_0x85eb('0x2e')]);}_0x3a06af[_0x85eb('0x54')]=qs[_0x85eb('0x55')](_0x469639['query'][_0x85eb('0x55')]);_0x3a06af[_0x85eb('0x56')]=qs[_0x85eb('0x4d')](_['pick'](_0x469639['query'],_0x1cabcb[_0x85eb('0x4d')]),_0x1b77b3);var _0x52996f=[];var _0x5ed98a=squel[_0x85eb('0x57')]()['field']('id')[_0x85eb('0x58')](_0x85eb('0x3b'))['field']('color')[_0x85eb('0x59')](_0x85eb('0x5a'));var _0x178d76=squel[_0x85eb('0x57')]()[_0x85eb('0x58')]('u.id')[_0x85eb('0x58')](_0x85eb('0x5b'))[_0x85eb('0x58')](_0x85eb('0x5c'))[_0x85eb('0x59')]('user_has_chat_interactions','ui')[_0x85eb('0x5d')]('users','u',_0x85eb('0x5e'));var _0x40d846=squel['select']()[_0x85eb('0x59')](_0x85eb('0x5f'),'i')[_0x85eb('0x5d')](_0x85eb('0x60'),'c',_0x85eb('0x61'))[_0x85eb('0x5d')]('users','o',_0x85eb('0x62'))['left_join'](_0x85eb('0x63'),'a',_0x85eb('0x64'))['left_join'](_0x85eb('0x65'),'me',_0x85eb('0x66'))['left_join'](_0x85eb('0x67'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x85eb('0x5d')](_0x85eb('0x5a'),'t',_0x85eb('0x68'));var _0x13c0b3=squel[_0x85eb('0x69')]();var _0x15d4a7=[];var _0x5a729e=squel[_0x85eb('0x69')]();var _0x76a9c6;if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x6a')]){_0x76a9c6=as[_0x85eb('0x6b')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x6a')]);var _0x1cb659=_0x76a9c6[_0x85eb('0x6c')];for(var _0x13cc2a=0x0;_0x13cc2a<_0x76a9c6[_0x85eb('0x6d')]['length'];_0x13cc2a++){var _0x271842=_0x76a9c6[_0x85eb('0x6d')][_0x13cc2a];var _0x46e5d3='i';var _0xdaf2fe=_[_0x85eb('0x6e')](_0x1b77b3,[_0x85eb('0x3b'),_0x271842['field']]);if(!_0xdaf2fe){switch(_0x271842[_0x85eb('0x58')]){case'unreadMessages':if(_0x271842[_0x85eb('0x6f')]==0x1){_0x40d846[_0x85eb('0x70')]('`'+_0x271842[_0x85eb('0x58')]+_0x85eb('0x71'));}else{_0x40d846[_0x85eb('0x70')]('`'+_0x271842['field']+_0x85eb('0x72'));}break;case _0x85eb('0x73'):if(_0x271842[_0x85eb('0x74')]===_0x85eb('0x75')){if(_0x271842[_0x85eb('0x6f')][_0x85eb('0x76')]('\x20')[_0x85eb('0x51')]>0x1){_0x13c0b3[_0x1cb659](_0x85eb('0x77'),qs['getFullTextValue'](_0x271842[_0x85eb('0x6f')]),null);}else{var _0x4d27bd='%'+_0x271842[_0x85eb('0x6f')]+'%';_0x13c0b3[_0x1cb659](_0x85eb('0x78'),_0x4d27bd,_0x4d27bd,_0x4d27bd);}}else{_0xdaf2fe=_[_0x85eb('0x6e')](_0x1b77b3,[_0x85eb('0x3b'),_0x85eb('0x79')]);_0x271842['field']=_0x85eb('0x79');_0x3ba160=as[_0x85eb('0x7a')](_0x46e5d3,_0xdaf2fe[_0x85eb('0x7b')],_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x7d')],_0x3ba160['value']['end']);}break;case _0x85eb('0x7e'):var _0x572560=_0x271842[_0x85eb('0x6f')][_0x85eb('0x76')](',')[_0x85eb('0x40')](function(_0x23f24a){return Number(_0x23f24a);});_0x572560[_0x85eb('0x43')](function(_0x2b7258){_0x5a729e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b7258+',%');});_0x15d4a7=_[_0x85eb('0x7f')](_0x15d4a7,_0x572560);break;case _0x85eb('0x80'):if(_0x271842[_0x85eb('0x74')]===_0x85eb('0x75')){_0x13c0b3[_0x1cb659]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x271842[_0x85eb('0x6f')]+'%',null);}else{_0xdaf2fe=_[_0x85eb('0x6e')](_0x1b77b3,[_0x85eb('0x3b'),_0x85eb('0x81')]);_0x271842['field']=_0x85eb('0x81');_0x3ba160=as[_0x85eb('0x7a')](_0x46e5d3,_0xdaf2fe[_0x85eb('0x7b')],_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x7d')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x2d')]);}break;case _0x85eb('0x3e'):_0x3ba160=as[_0x85eb('0x7a')]('me',null,_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x7d')],_0x3ba160[_0x85eb('0x6f')][_0x85eb('0x2d')]);break;}}else{var _0x3ba160=as[_0x85eb('0x7a')](_0x46e5d3,_0xdaf2fe[_0x85eb('0x7b')],_0x271842);_0x13c0b3[_0x1cb659](_0x3ba160[_0x85eb('0x7c')],_0x3ba160['value'][_0x85eb('0x7d')],_0x3ba160['value'][_0x85eb('0x2d')]);}}}else{var _0x2346b1=_(_0x469639[_0x85eb('0x4b')])[_0x85eb('0x4c')]()[_0x85eb('0x40')](function(_0x3de724){return _[_0x85eb('0x82')](_0x1b77b3,[_0x85eb('0x3b'),_0x3de724])?_0x3de724:undefined;})[_0x85eb('0x83')]()['value']();if(!_[_0x85eb('0x84')](_0x2346b1)){_0x2346b1[_0x85eb('0x43')](function(_0x2d795b){if(_0x2d795b===_0x85eb('0x85')){_0x40d846[_0x85eb('0x56')]('i.ChatWebsiteId\x20IN\x20?',[][_0x85eb('0x86')](_0x469639['query'][_0x2d795b]));}else if(_0x2d795b===_0x85eb('0x87')){var _0x330c2b=JSON[_0x85eb('0x88')](_0x469639['query'][_0x2d795b])[_0x85eb('0x89')];var _0x2e358d=JSON[_0x85eb('0x88')](_0x469639['query'][_0x2d795b])['$lte'];_0x40d846[_0x85eb('0x56')](_0x85eb('0x8a'),_0x330c2b,_0x2e358d);}else{if(_0x469639[_0x85eb('0x4b')][_0x2d795b]===_0x85eb('0x8b')){_0x40d846['where']('i.'+_0x2d795b+_0x85eb('0x8c'));}else{_0x40d846['where']('i.'+_0x2d795b+_0x85eb('0x8d'),_0x469639[_0x85eb('0x4b')][_0x2d795b]);}}});}if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x8e')]){if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x8e')]==0x1){_0x40d846['having'](_0x85eb('0x8f'));}else{_0x40d846['having'](_0x85eb('0x90'));}}if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x91')]){_0x15d4a7=_[_0x85eb('0x92')](_0x469639[_0x85eb('0x4b')][_0x85eb('0x91')])?_0x469639[_0x85eb('0x4b')][_0x85eb('0x91')]:new Array(_0x469639[_0x85eb('0x4b')]['tag']);_0x15d4a7[_0x85eb('0x43')](function(_0xd0c1d4){_0x5a729e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xd0c1d4+',%');});}if(_0x469639['query'][_0x85eb('0x93')]){var _0x4a5e00=_0x469639[_0x85eb('0x4b')]['filter'][_0x85eb('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x85eb('0x95')](_0x4a5e00)){_0x13c0b3['or'](_0x85eb('0x96'),_0x4a5e00+'%');}else{_0x13c0b3['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x85eb('0x97')](_0x4a5e00))['or'](_0x85eb('0x98'),_0x4a5e00+'%');}}}_0x40d846['where'](_0x13c0b3);_0x40d846[_0x85eb('0x99')](_0x85eb('0x9a'));var _0xf076af={'type':db[_0x85eb('0x9b')]['QueryTypes'][_0x85eb('0x9c')],'raw':!![]};var _0x53ccc5=_0x40d846[_0x85eb('0x9d')]();_0x53ccc5[_0x85eb('0x58')](_0x85eb('0x9a'));_0x53ccc5['field'](_0x85eb('0x9e'),_0x85eb('0x9f'));if(_0x3a06af[_0x85eb('0x54')]){_0x3a06af['order'][_0x85eb('0x43')](function(_0x5eb629){var _0x26cc46=_0x5eb629[0x0]===_0x85eb('0xa0')?_0x5eb629[0x0]:'i.'+_0x5eb629[0x0];_0x40d846[_0x85eb('0x54')](_0x26cc46,_0x5eb629[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x15d4a7)){_0x40d846['having'](_0x5a729e);_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa1'),_0x15d4a7);}BPromise[_0x85eb('0xa2')]()['then'](function(){if(!_0x76a9c6){if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x85')])return;_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa3'));_0x40d846[_0x85eb('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x469639['user'][_0x85eb('0xa4')]!==_0x85eb('0xa5'))return;return _0x469639['user'][_0x85eb('0xa6')]({'attributes':['id'],'raw':!![]})[_0x85eb('0x22')](function(_0x3bc357){if(_[_0x85eb('0x84')](_0x3bc357)){_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa7'));_0x40d846[_0x85eb('0x56')](_0x85eb('0xa7'));}else{_0x53ccc5[_0x85eb('0x56')](_0x85eb('0xa8'),_[_0x85eb('0x40')](_0x3bc357,'id'));_0x40d846[_0x85eb('0x56')](_0x85eb('0xa8'),_[_0x85eb('0x40')](_0x3bc357,'id'));}});})[_0x85eb('0x22')](function(){if(_0x469639['user'][_0x85eb('0xa4')]===_0x85eb('0xa5')&&!_0x76a9c6&&!_0x469639[_0x85eb('0x4b')][_0x85eb('0x85')])return[];return db[_0x85eb('0xa9')][_0x85eb('0x4b')](_0x53ccc5[_0x85eb('0xaa')](),_0xf076af);})[_0x85eb('0x22')](function(_0x2c0ab5){_0x5d90cc[_0x85eb('0x31')]=_0x2c0ab5['length'];if(_0x5d90cc[_0x85eb('0x31')]===0x0)return[];return db[_0x85eb('0xa9')][_0x85eb('0x4b')](_0x5ed98a[_0x85eb('0xaa')](),_0xf076af)['then'](function(_0x2caf89){_0x52996f=_[_0x85eb('0xab')](_0x2caf89,'id');_0xf076af=_[_0x85eb('0xac')](_0xf076af,{'model':db[_0x85eb('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x469639[_0x85eb('0x4b')][_0x85eb('0x50')]){_0x3a06af['attributes'][_0x85eb('0x43')](function(_0x36dbb1){_0x40d846[_0x85eb('0x58')]('i.'+_0x36dbb1);});}else{_0x40d846['field'](_0x85eb('0x9e'),_0x85eb('0x9f'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xad'),_0x85eb('0xae'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xaf'),_0x85eb('0xb0'));_0x40d846['field'](_0x85eb('0xb1'),_0x85eb('0xa0'));_0x40d846['field']('i.*');_0x40d846[_0x85eb('0x58')]('c.firstName',_0x85eb('0xb2'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xb3'),_0x85eb('0xb4'));_0x40d846['field']('c.email',_0x85eb('0xb5'));_0x40d846['field'](_0x85eb('0xb6'),_0x85eb('0xb7'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xb8'),'Contact.mobile');_0x40d846['field'](_0x85eb('0xb9'),_0x85eb('0xba'));_0x40d846[_0x85eb('0x58')]('o.fullname','Owner.fullname');_0x40d846[_0x85eb('0x58')](_0x85eb('0xbb'),_0x85eb('0xbc'));_0x40d846[_0x85eb('0x58')](_0x85eb('0xbd'),_0x85eb('0x41'));}if(_0x3a06af[_0x85eb('0x30')])_0x40d846[_0x85eb('0x30')](_0x3a06af[_0x85eb('0x30')]);if(_0x3a06af[_0x85eb('0x2e')])_0x40d846[_0x85eb('0x2e')](_0x3a06af['offset']);return db[_0x85eb('0xa9')][_0x85eb('0x4b')](_0x40d846['toString'](),_0xf076af);})[_0x85eb('0x22')](function(_0x3c8e3e){if(_0x3c8e3e[_0x85eb('0x51')]>0x0)_0x178d76[_0x85eb('0x56')](_0x85eb('0xbe'),_[_0x85eb('0x40')](_0x3c8e3e,'id'));return db['sequelize']['query'](_0x178d76[_0x85eb('0xaa')](),_0xf076af)['then'](function(_0x2f1ff1){var _0x5596c1=_[_0x85eb('0xbf')](_0x2f1ff1,_0x85eb('0xc0'));var _0x5e8478=[];_0x3c8e3e['forEach'](function(_0x119f69){_0x5e8478[_0x85eb('0xc1')](updateChatInteraction(_0x119f69,_0x52996f,_0x5596c1));});return BPromise['all'](_0x5e8478);});});})[_0x85eb('0x22')](function(_0x2e44b5){_0x5d90cc[_0x85eb('0xc2')]=_0x2e44b5;return _0x5d90cc;})['then'](respondWithFilteredResult(_0x540c7a,_0x3a06af))['catch'](handleError(_0x540c7a,null));};exports[_0x85eb('0xc3')]=function(_0x3a8d0d,_0x189733){var _0x422d33={'raw':![],'where':{'id':_0x3a8d0d[_0x85eb('0xc4')]['id']}},_0x1d695c={};_0x1d695c[_0x85eb('0x4a')]=_[_0x85eb('0x4c')](db[_0x85eb('0x46')][_0x85eb('0x47')]);_0x1d695c['query']=_[_0x85eb('0x4c')](_0x3a8d0d['query']);_0x1d695c[_0x85eb('0x4d')]=_[_0x85eb('0x4f')](_0x1d695c[_0x85eb('0x4a')],_0x1d695c[_0x85eb('0x4b')]);_0x422d33[_0x85eb('0x4e')]=_['intersection'](_0x1d695c[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x3a8d0d[_0x85eb('0x4b')]['fields']));_0x422d33[_0x85eb('0x4e')]=_0x422d33[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x422d33[_0x85eb('0x4e')]:_0x1d695c[_0x85eb('0x4a')];if(_0x3a8d0d[_0x85eb('0x4b')][_0x85eb('0xc5')]){_0x422d33[_0x85eb('0xc6')]=[{'all':!![]}];}_0x422d33=_[_0x85eb('0xac')]({},_0x422d33,_0x3a8d0d[_0x85eb('0xc7')]);return db[_0x85eb('0x46')][_0x85eb('0x6e')](_0x422d33)[_0x85eb('0x22')](handleEntityNotFound(_0x189733,null))[_0x85eb('0x22')](respondWithResult(_0x189733,null))[_0x85eb('0x44')](handleError(_0x189733,null));};exports[_0x85eb('0xc8')]=function(_0x576bc0,_0x364f29){return db[_0x85eb('0x46')][_0x85eb('0xc8')](_0x576bc0[_0x85eb('0x3e')],{})[_0x85eb('0x22')](respondWithResult(_0x364f29,0xc9))[_0x85eb('0x44')](handleError(_0x364f29,null));};exports[_0x85eb('0x38')]=function(_0x55255d,_0x419f52){if(_0x55255d[_0x85eb('0x3e')]['id']){delete _0x55255d['body']['id'];}return db[_0x85eb('0x46')]['find']({'where':{'id':_0x55255d[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x419f52,null))[_0x85eb('0x22')](saveUpdates(_0x55255d[_0x85eb('0x3e')],null))[_0x85eb('0x22')](respondWithResult(_0x419f52,null))[_0x85eb('0x44')](handleError(_0x419f52,null));};exports[_0x85eb('0x39')]=function(_0x1233be,_0x5906d2){return db['ChatInteraction'][_0x85eb('0x6e')]({'where':{'id':_0x1233be[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x5906d2,null))[_0x85eb('0x22')](removeEntity(_0x5906d2,null))['catch'](handleError(_0x5906d2,null));};exports[_0x85eb('0xc9')]=function(_0x2e2af5,_0x3d2e7d){return db['ChatInteraction'][_0x85eb('0xc9')]()[_0x85eb('0x22')](respondWithResult(_0x3d2e7d,null))[_0x85eb('0x44')](handleError(_0x3d2e7d,null));};exports['createVidaooSession']=function(_0x1fa8f6,_0x38f314){var _0x2a355b=_0x1fa8f6['params']['id'];var _0x18404c;var _0x466d54;var _0x404fef;return db[_0x85eb('0x46')][_0x85eb('0xca')]({'where':{'id':_0x2a355b}})[_0x85eb('0x22')](function(_0x3bb3e5){_0x18404c=_0x3bb3e5;return db[_0x85eb('0xcb')][_0x85eb('0xca')]({'where':{'id':_0x3bb3e5['ChatWebsiteId']},'attributes':['id',_0x85eb('0xcc'),_0x85eb('0xcd'),_0x85eb('0xce'),_0x85eb('0xcf'),_0x85eb('0xd0')],'raw':!![]});})[_0x85eb('0x22')](function(_0x5c80b1){if(_0x5c80b1&&_0x5c80b1['vidaooApiKey']&&_0x5c80b1[_0x85eb('0xcd')]){_0x466d54=_0x5c80b1;var _0x3b0878={'interaction':{'id':_0x2a355b},'agent':{'id':_0x1fa8f6[_0x85eb('0xd1')]['id'],'name':_0x1fa8f6[_0x85eb('0xd1')][_0x85eb('0x3b')],'fullname':_0x1fa8f6[_0x85eb('0xd1')][_0x85eb('0xd2')],'email':_0x1fa8f6['user'][_0x85eb('0xd3')]},'contact':_0x1fa8f6[_0x85eb('0x3e')]['contact'],'account':_0x1fa8f6[_0x85eb('0x3e')][_0x85eb('0xd4')]};var _0x1a5c26={'rejectUnauthorized':![],'method':_0x85eb('0xd5'),'url':_0x85eb('0xd6'),'headers':{'X-APIKEY':_0x5c80b1[_0x85eb('0xcc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1fa8f6[_0x85eb('0xd1')][_0x85eb('0xd3')]],'buttons':null,'topic':_0x466d54[_0x85eb('0xce')],'note':_['isNull'](_0x466d54['vidaooNote'])?null:getMustacheRender(_0x466d54['vidaooNote'],_0x3b0878),'metadata':null},'redirect':_0x85eb('0xd7'),'json':!![]};try{if(!_[_0x85eb('0xd8')](_0x466d54[_0x85eb('0xd0')])){var _0x413509=getMustacheRender(_0x466d54[_0x85eb('0xd0')],_0x3b0878);var _0x368f63=JSON[_0x85eb('0x88')](_0x413509);_0x1a5c26[_0x85eb('0x3e')][_0x85eb('0xd9')]=_0x368f63;}}catch(_0x2305a9){throw new db['Sequelize'][(_0x85eb('0xda'))](_0x85eb('0xdb'));}return rp(_0x1a5c26);}else{throw new db[(_0x85eb('0x9b'))][(_0x85eb('0xda'))](_0x85eb('0xdc'));}})[_0x85eb('0x22')](function(_0x495b8f){_0x404fef=_0x495b8f;if(_0x404fef['id']){var _0x1bbe41={'body':_0x404fef['join_url'],'ChatWebsiteId':_0x466d54['id'],'ChatInteractionId':_0x18404c['id'],'direction':_0x85eb('0xdd'),'UserId':_0x1fa8f6['user']['id']};return db[_0x85eb('0xde')][_0x85eb('0xc8')](_0x1bbe41,{});}else{throw new db[(_0x85eb('0x9b'))][(_0x85eb('0xda'))](_0x85eb('0xdf'));}})[_0x85eb('0x22')](function(){return _0x18404c[_0x85eb('0xe0')]({'vidaooSessionId':_0x404fef['id']});})[_0x85eb('0x22')](respondWithResult(_0x38f314,null))['catch'](handleError(_0x38f314,null));};exports['customUpdate']=function(_0x1c0550,_0x19261b){if(_0x1c0550[_0x85eb('0x3e')]['id']){delete _0x1c0550[_0x85eb('0x3e')]['id'];}return db[_0x85eb('0x46')]['find']({'where':{'id':_0x1c0550[_0x85eb('0xc4')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x85eb('0x22')](handleEntityNotFound(_0x19261b,null))[_0x85eb('0x22')](saveUpdates(_0x1c0550['body'],null))[_0x85eb('0x22')](respondWithResult(_0x19261b,null))[_0x85eb('0x44')](handleError(_0x19261b,null));};exports[_0x85eb('0xe1')]=function(_0x643bd3,_0x22cdc1,_0x490d17){if(_0x643bd3[_0x85eb('0x3e')]['id']){delete _0x643bd3[_0x85eb('0x3e')]['id'];}return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x643bd3[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](function(_0x452460){if(!_0x452460){logger[_0x85eb('0x28')](_0x85eb('0xe2'),_0x85eb('0xe1'),0x194,'entity\x20not\x20found');_0x22cdc1['sendStatus'](0x194);}else{if(_0x452460['UserId']){throw new db[(_0x85eb('0x9b'))][(_0x85eb('0xda'))](_0x85eb('0xe3'));}}return _0x452460;})['then'](function(_0x2d3772){if(_0x2d3772){return _0x2d3772[_0x85eb('0x38')]({'closed':_0x643bd3['body'][_0x85eb('0xe4')],'disposition':_0x643bd3[_0x85eb('0x3e')][_0x85eb('0xe5')]})[_0x85eb('0x22')](function(_0x521580){return _0x521580;});}})[_0x85eb('0x22')](function(_0x38fd1b){return respondWithRpcPromise(_0x85eb('0xe6'),_0x85eb('0xe1'),_0x643bd3[_0x85eb('0x3e')],client9004);})[_0x85eb('0x22')](respondWithResult(_0x22cdc1,null))[_0x85eb('0x44')](handleError(_0x22cdc1,null));};exports[_0x85eb('0xe7')]=function(_0x518eda,_0x299d7b,_0x120553){_0x518eda['body'][_0x85eb('0x3b')]=_0x518eda['file'][_0x85eb('0xe8')];_0x518eda[_0x85eb('0x3e')][_0x85eb('0xe9')]=_0x518eda[_0x85eb('0xea')][_0x85eb('0xeb')];_0x518eda['body'][_0x85eb('0x7b')]=_0x518eda['file']['mimetype'];return db[_0x85eb('0xec')][_0x85eb('0xc8')](_0x518eda['body'])[_0x85eb('0x22')](respondWithResult(_0x299d7b,0xc9))['catch'](handleError(_0x299d7b,null));};exports[_0x85eb('0xed')]=function(_0x36a522,_0x437908,_0xd0d358){return db[_0x85eb('0x46')][_0x85eb('0xca')]({'where':{'id':_0x36a522[_0x85eb('0xc4')]['id']},'raw':!![]})[_0x85eb('0x22')](handleEntityNotFound(_0x437908,null))['then'](function(_0x5122fc){if(_0x5122fc){if(_0x5122fc[_0x85eb('0xe4')]){return _0x437908[_0x85eb('0x2c')](0x193)[_0x85eb('0x34')]({'status':0x193,'message':_0x85eb('0xee')});}return db[_0x85eb('0xec')][_0x85eb('0xca')]({'where':{'id':_0x36a522[_0x85eb('0x4b')][_0x85eb('0xef')]},'raw':!![]})[_0x85eb('0x22')](handleEntityNotFound(_0x437908,null));}})[_0x85eb('0x22')](function(_0x2785e5){if(_0x2785e5){var _0x31422d=_0x2785e5[_0x85eb('0xf0')]!==null;var _0x4fd2c5=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],'server/files/attachments/');if(_0x31422d){_0x4fd2c5=path['join'](_0x4fd2c5,'offline-chat/');}var _0x1f8971=path[_0x85eb('0xf1')](_0x4fd2c5,_0x2785e5[_0x85eb('0xe9')]);return _0x437908[_0x85eb('0xf3')](_0x1f8971);}})['catch'](handleError(_0x437908,null));};exports[_0x85eb('0xf4')]=function(_0x8e8898,_0x2fb509){var _0x39bd74=null;var _0x3818db=null;var _0x529048=null;var _0x242488=null;if(_0x8e8898[_0x85eb('0x3e')]['id']){delete _0x8e8898['body']['id'];}if(_0x8e8898[_0x85eb('0x3e')][_0x85eb('0xf5')]){_0x242488=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0xf6'),util[_0x85eb('0xf7')](_0x85eb('0xf8'),Date[_0x85eb('0xf9')]()));_0x8e8898['body']['pathTranscript']=_0x242488;}return db['ChatInteraction'][_0x85eb('0x6e')]({'where':{'id':_0x8e8898['params']['id']},'include':[{'model':db[_0x85eb('0xde')],'as':_0x85eb('0xfa'),'include':[{'model':db[_0x85eb('0x80')],'as':_0x85eb('0x80')}]}]})[_0x85eb('0x22')](handleEntityNotFound(_0x2fb509,null))[_0x85eb('0x22')](saveUpdates(_0x8e8898['body'],null))[_0x85eb('0x22')](function(_0x3a276c){if(_0x3a276c){_0x39bd74=_0x3a276c;return db[_0x85eb('0xcb')][_0x85eb('0x6e')]({'where':{'id':_0x39bd74[_0x85eb('0x85')]}});}})[_0x85eb('0x22')](function(_0x6c7095){if(_0x6c7095){_0x529048=_0x6c7095;return db[_0x85eb('0xfb')][_0x85eb('0x6e')]({'where':{'id':_0x39bd74['ContactId']}});}})[_0x85eb('0x22')](function(_0x3aec49){if(_0x3aec49){_0x3818db=_0x3aec49;if(_0x242488){var _0x4c8ad6=null;for(var _0x20cbea=0x1;_0x20cbea<_0x39bd74[_0x85eb('0xfa')][_0x85eb('0x51')];++_0x20cbea){_0x4c8ad6=_0x39bd74[_0x85eb('0xfa')][_0x20cbea];var _0x401936=_0x4c8ad6[_0x85eb('0x81')]?util['format'](_0x85eb('0xfc'),_0x529048[_0x85eb('0xfd')],_0x4c8ad6['UserId']):'System';var _0x4660b6=_0x8e8898[_0x85eb('0x3e')]['customer']||util[_0x85eb('0xf7')](_0x85eb('0xfc'),'Visitor',_0x4c8ad6[_0x85eb('0x79')]);switch(_0x529048[_0x85eb('0xfe')]){case _0x85eb('0xff'):_0x401936=_0x4c8ad6[_0x85eb('0x81')]?util[_0x85eb('0xf7')]('%s%d',_0x529048['agentAlias'],_0x4c8ad6[_0x85eb('0x81')]):_0x85eb('0x100');break;case _0x85eb('0x101'):_0x401936=_0x4c8ad6[_0x85eb('0x81')]?_0x4c8ad6[_0x85eb('0x80')][_0x85eb('0x102')]||_0x4c8ad6[_0x85eb('0x80')]['fullname']:_0x85eb('0x100');break;case _0x85eb('0x103'):_0x401936=_0x4c8ad6[_0x85eb('0x81')]?_0x4c8ad6[_0x85eb('0x80')][_0x85eb('0xd2')]:_0x85eb('0x100');break;default:_0x401936=_0x4c8ad6[_0x85eb('0x81')]?util[_0x85eb('0xf7')](_0x85eb('0xfc'),_0x529048[_0x85eb('0xfd')],_0x4c8ad6['UserId']):_0x85eb('0x100');}var _0x2e7563=util[_0x85eb('0xf7')](_0x85eb('0x104'),moment(_0x4c8ad6[_0x85eb('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x4c8ad6[_0x85eb('0x105')]==='in'?_0x4660b6:_0x401936,_0x4c8ad6[_0x85eb('0x3e')]);if(!_0x4c8ad6[_0x85eb('0x106')]){fs[_0x85eb('0x107')](_0x242488,_0x2e7563);}}return db[_0x85eb('0x108')][_0x85eb('0xca')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x85eb('0x109'),'raw':!![]}]});}}})[_0x85eb('0x22')](function(_0x113c06){if(_0x113c06&&_0x113c06['Smtp']&&_0x8e8898[_0x85eb('0x3e')]){var _0x54e411={'tls':{'rejectUnauthorized':![]}};if(_0x113c06[_0x85eb('0x109')]['service']){_0x54e411[_0x85eb('0x10a')]=_0x113c06[_0x85eb('0x109')][_0x85eb('0x10a')];}else{_0x54e411['host']=_0x113c06[_0x85eb('0x109')][_0x85eb('0x10b')];_0x54e411[_0x85eb('0x10c')]=_0x113c06[_0x85eb('0x109')]['port'];_0x54e411[_0x85eb('0x10d')]=_0x113c06[_0x85eb('0x109')]['secure'];}if(_0x113c06[_0x85eb('0x109')][_0x85eb('0x10e')]){_0x54e411[_0x85eb('0x10f')]={'user':_0x113c06['Smtp']['user'],'pass':_0x113c06[_0x85eb('0x109')][_0x85eb('0x110')]};}return respondWithRpcPromise(_0x85eb('0x111'),_0x85eb('0x112'),{'account':_0x54e411,'message':{'from':util[_0x85eb('0xf7')]('\x22%s\x22\x20<%s>',_0x113c06[_0x85eb('0x3b')],_0x113c06[_0x85eb('0xd3')]||_0x113c06['Smtp'][_0x85eb('0xd1')]),'to':_0x8e8898[_0x85eb('0x3e')][_0x85eb('0xf5')],'subject':_0x85eb('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x8e8898[_0x85eb('0x3e')][_0x85eb('0xf5')]),'attachments':[{'path':_0x242488}]}})['then'](function(){return _0x39bd74;})['catch'](function(_0x3c794c){console[_0x85eb('0x28')](_0x3c794c);});}else{return _0x39bd74;}})[_0x85eb('0x22')](respondWithStatusCode(_0x2fb509,0xc8))['catch'](handleError(_0x2fb509,null));};exports[_0x85eb('0x114')]=function(_0x1bdbc5,_0x4edc7d,_0x32222c){return db[_0x85eb('0xde')][_0x85eb('0x6e')]({'where':{'id':_0x1bdbc5[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x4edc7d,null))[_0x85eb('0x22')](function(_0x52c186){if(_0x52c186){return _0x52c186[_0x85eb('0x114')](_0x1bdbc5[_0x85eb('0x3e')][_0x85eb('0x115')],_['omit'](_0x1bdbc5['body'],['ids','id'])||{});}})[_0x85eb('0x22')](respondWithResult(_0x4edc7d,null))['catch'](handleError(_0x4edc7d,null));};exports[_0x85eb('0x116')]=function(_0x46a2c4,_0x1b5db9,_0x386c1a){var _0x3ed32c={'raw':![],'where':{}};var _0x3d04e7={};var _0x1e2b79={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x85eb('0xca')]({'where':{'id':_0x46a2c4[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x1b5db9,null))[_0x85eb('0x22')](function(_0x4307f4){if(_0x4307f4){_0x3d04e7[_0x85eb('0x4a')]=_[_0x85eb('0x4c')](db[_0x85eb('0xde')][_0x85eb('0x47')]);_0x3d04e7[_0x85eb('0x4b')]=_[_0x85eb('0x4c')](_0x46a2c4[_0x85eb('0x4b')]);_0x3d04e7[_0x85eb('0x4d')]=_[_0x85eb('0x4f')](_0x3d04e7[_0x85eb('0x4a')],_0x3d04e7['query']);_0x3ed32c[_0x85eb('0x4e')]=_[_0x85eb('0x4f')](_0x3d04e7[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x46a2c4['query'][_0x85eb('0x50')]));_0x3ed32c[_0x85eb('0x4e')]=_0x3ed32c[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x3ed32c[_0x85eb('0x4e')]:_0x3d04e7[_0x85eb('0x4a')];if(!_0x46a2c4['query']['hasOwnProperty']('nolimit')){_0x3ed32c[_0x85eb('0x30')]=qs[_0x85eb('0x30')](_0x46a2c4[_0x85eb('0x4b')]['limit']);_0x3ed32c[_0x85eb('0x2e')]=qs[_0x85eb('0x2e')](_0x46a2c4['query'][_0x85eb('0x2e')]);}_0x3ed32c[_0x85eb('0x54')]=qs[_0x85eb('0x55')](_0x46a2c4[_0x85eb('0x4b')][_0x85eb('0x55')]);_0x3ed32c[_0x85eb('0x56')]=qs[_0x85eb('0x4d')](_[_0x85eb('0x117')](_0x46a2c4[_0x85eb('0x4b')],_0x3d04e7[_0x85eb('0x4d')]));_0x3ed32c[_0x85eb('0x56')][_0x85eb('0xc0')]=_0x4307f4['id'];if(_0x46a2c4['query'][_0x85eb('0x93')]){_0x3ed32c[_0x85eb('0x56')]=_['merge'](_0x3ed32c[_0x85eb('0x56')],{'$or':_['map'](_0x3ed32c[_0x85eb('0x4e')],function(_0x2037ef){var _0x200c28={};_0x200c28[_0x2037ef]={'$like':'%'+_0x46a2c4[_0x85eb('0x4b')][_0x85eb('0x93')]+'%'};return _0x200c28;})});}if(_0x46a2c4[_0x85eb('0x4b')][_0x85eb('0x89')]){var _0xe74bd5=_0x46a2c4['query']['$gte'][_0x85eb('0x76')](',');var _0x6b9b57={};_0x6b9b57[_0xe74bd5[0x0]]={'$gte':moment(_0xe74bd5[0x1])['format'](_0x85eb('0x118'))};_0x3ed32c[_0x85eb('0x56')]=_['merge'](_0x3ed32c[_0x85eb('0x56')],_0x6b9b57);}_0x3ed32c=_[_0x85eb('0xac')]({},_0x3ed32c,_0x46a2c4[_0x85eb('0xc7')]);return db['ChatMessage'][_0x85eb('0x31')]({'where':_0x3ed32c['where']})[_0x85eb('0x22')](function(_0x5badd){_0x1e2b79[_0x85eb('0x31')]=_0x5badd;if(_0x46a2c4[_0x85eb('0x4b')]['includeAll']){_0x3ed32c[_0x85eb('0xc6')]=[{'all':!![]}];}return db[_0x85eb('0xde')][_0x85eb('0x119')](_0x3ed32c);})[_0x85eb('0x22')](function(_0x4d7d3b){_0x1e2b79[_0x85eb('0xc2')]=_0x4d7d3b;return _0x1e2b79;});}})[_0x85eb('0x22')](respondWithFilteredResult(_0x1b5db9,_0x3ed32c))[_0x85eb('0x44')](handleError(_0x1b5db9,null));};exports[_0x85eb('0x11a')]=function(_0x1bdeea,_0x37ef17,_0x54e0a2){var _0x3b205e={'where':{}},_0x37bcff={},_0x5d4a73={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x85eb('0xca')]({'where':{'id':_0x1bdeea[_0x85eb('0xc4')]['id']}})[_0x85eb('0x22')](handleEntityNotFound(_0x37ef17,null))[_0x85eb('0x22')](function(_0x17d94e){if(_0x17d94e){_0x37bcff[_0x85eb('0x4a')]=_[_0x85eb('0x4c')](db[_0x85eb('0xde')][_0x85eb('0x47')]);_0x37bcff['query']=_[_0x85eb('0x4c')](_0x1bdeea[_0x85eb('0x4b')]);_0x37bcff[_0x85eb('0x4d')]=_[_0x85eb('0x4f')](_0x37bcff[_0x85eb('0x4a')],_0x37bcff[_0x85eb('0x4b')]);_0x3b205e[_0x85eb('0x4e')]=_['intersection'](_0x37bcff[_0x85eb('0x4a')],qs[_0x85eb('0x50')](_0x1bdeea['query']['fields']));_0x3b205e[_0x85eb('0x4e')]=_0x3b205e[_0x85eb('0x4e')][_0x85eb('0x51')]?_0x3b205e[_0x85eb('0x4e')]:_0x37bcff['model'];if(!_0x1bdeea['query'][_0x85eb('0x52')]('nolimit')){_0x3b205e[_0x85eb('0x30')]=qs[_0x85eb('0x30')](_0x1bdeea[_0x85eb('0x4b')]['limit']);_0x3b205e['offset']=qs[_0x85eb('0x2e')](_0x1bdeea[_0x85eb('0x4b')][_0x85eb('0x2e')]);}_0x3b205e[_0x85eb('0x54')]=qs['sort'](_0x1bdeea[_0x85eb('0x4b')][_0x85eb('0x55')]);_0x3b205e[_0x85eb('0x56')]=qs['filters'](_[_0x85eb('0x117')](_0x1bdeea['query'],_0x37bcff['filters']));_0x3b205e[_0x85eb('0x56')][_0x85eb('0xc0')]=_0x17d94e['id'];if(_0x1bdeea[_0x85eb('0x4b')][_0x85eb('0x93')]){_0x3b205e['where']=_[_0x85eb('0xac')](_0x3b205e[_0x85eb('0x56')],{'$or':_[_0x85eb('0x40')](_0x3b205e[_0x85eb('0x4e')],function(_0x32cf84){var _0x3f7ede={};_0x3f7ede[_0x32cf84]={'$like':'%'+_0x1bdeea[_0x85eb('0x4b')]['filter']+'%'};return _0x3f7ede;})});}_0x3b205e[_0x85eb('0x56')][_0x85eb('0x106')]=![];if(_0x1bdeea[_0x85eb('0x4b')]['id']){_0x3b205e[_0x85eb('0x56')]['id']={'$gt':_0x1bdeea[_0x85eb('0x4b')]['id']};}_0x3b205e=_['merge']({},_0x3b205e,_0x1bdeea[_0x85eb('0xc7')]);return db[_0x85eb('0xde')][_0x85eb('0x31')]({'where':_0x3b205e[_0x85eb('0x56')]})['then'](function(_0x761ba8){_0x5d4a73[_0x85eb('0x31')]=_0x761ba8;_0x3b205e[_0x85eb('0xc6')]=[];if(_0x1bdeea['query'][_0x85eb('0x11b')]){_0x3b205e[_0x85eb('0xc6')][_0x85eb('0xc1')]({'model':db[_0x85eb('0x80')],'as':_0x85eb('0x80'),'attributes':['id','fullname',_0x85eb('0x102')]});}if(_0x1bdeea['query'][_0x85eb('0xc5')]){_0x3b205e['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x3b205e);})['then'](function(_0x30eeb7){_0x5d4a73[_0x85eb('0xc2')]=_0x30eeb7;return _0x5d4a73;});}})['then'](respondWithFilteredResult(_0x37ef17,_0x3b205e))['catch'](handleError(_0x37ef17,null));};exports[_0x85eb('0x11c')]=function(_0x532769,_0x590d0d,_0x59fd91){return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x532769['params']['id']}})['then'](handleEntityNotFound(_0x590d0d,null))[_0x85eb('0x22')](function(_0x3971f5){if(_0x3971f5){return _0x3971f5['setTags'](_0x532769[_0x85eb('0x3e')][_0x85eb('0x115')],_[_0x85eb('0x11d')](_0x532769[_0x85eb('0x3e')],[_0x85eb('0x115'),'id'])||{})[_0x85eb('0x11e')](function(){return db[_0x85eb('0x7e')][_0x85eb('0x119')]({'attributes':['id',_0x85eb('0x3b'),_0x85eb('0x11f')],'where':{'id':_0x532769[_0x85eb('0x3e')][_0x85eb('0x115')]}});})['then'](function(_0x36ea41){socket[_0x85eb('0x120')](_0x85eb('0x121'),{'id':Number(_0x532769[_0x85eb('0xc4')]['id']),'tags':_0x36ea41||[]});return{'id':Number(_0x532769[_0x85eb('0xc4')]['id']),'tags':_0x36ea41||[]};});}})[_0x85eb('0x22')](respondWithResult(_0x590d0d,null))[_0x85eb('0x44')](handleError(_0x590d0d,null));};exports[_0x85eb('0x122')]=function(_0x1be39a,_0x2461f9,_0x356d32){return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x1be39a['params']['id']}})['then'](handleEntityNotFound(_0x2461f9,null))[_0x85eb('0x22')](function(_0x8c6dc0){if(_0x8c6dc0){return _0x8c6dc0[_0x85eb('0x122')](_0x1be39a[_0x85eb('0x4b')]['ids']);}})[_0x85eb('0x22')](respondWithStatusCode(_0x2461f9,null))[_0x85eb('0x44')](handleError(_0x2461f9,null));};exports['download']=function(_0x1f4e87,_0x1c3ed4){var _0x411f08=moment()[_0x85eb('0x123')]()['toString']();var _0x24b1f3=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0x124'),_0x85eb('0x125'),'tmp');var _0x163a17=path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0x124'),_0x85eb('0x125'),'attachments');var _0x27ea02=path[_0x85eb('0xf1')](_0x24b1f3,_0x411f08);var _0x5a3a94=util[_0x85eb('0xf7')](_0x85eb('0x126'),_0x1f4e87[_0x85eb('0xc4')]['id'],_0x411f08);var _0x4675d1=path[_0x85eb('0xf1')](_0x24b1f3,_0x5a3a94);var _0x5f72cd=[];_0x5f72cd['push']({'model':db[_0x85eb('0x80')],'as':_0x85eb('0x80'),'attributes':['id',_0x85eb('0xd2')],'raw':!![]});_0x5f72cd[_0x85eb('0xc1')]({'model':db[_0x85eb('0xfb')],'as':_0x85eb('0x73'),'attributes':['id',_0x85eb('0x127'),_0x85eb('0x128')],'raw':!![]});if(_0x1f4e87['query'][_0x85eb('0x129')]){_0x5f72cd['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4d8940=[{'model':db[_0x85eb('0xde')],'as':_0x85eb('0xfa'),'attributes':['id',_0x85eb('0x3e'),_0x85eb('0x87'),'direction',_0x85eb('0x106'),_0x85eb('0x8e')],'include':_0x5f72cd}];_0x4d8940[_0x85eb('0xc1')]({'model':db[_0x85eb('0xcb')],'as':_0x85eb('0x12a'),'attributes':['id',_0x85eb('0x3b')]});_0x4d8940[_0x85eb('0xc1')]({'model':db[_0x85eb('0x80')],'as':_0x85eb('0x12b'),'attributes':['id',_0x85eb('0xd2')]});return db[_0x85eb('0x46')][_0x85eb('0x6e')]({'where':{'id':_0x1f4e87['params']['id']},'include':_0x4d8940})[_0x85eb('0x22')](handleEntityNotFound(_0x1c3ed4,null))[_0x85eb('0x22')](function(_0x38217f){if(_0x38217f){var _0x49146a=_0x38217f['get']({'plain':!![]});fs[_0x85eb('0x12c')](_0x27ea02);var _0xa82740={'channel':_0x85eb('0x12d'),'account':_0x49146a[_0x85eb('0x12a')]['name'],'agent':_0x49146a['Owner']?_0x49146a[_0x85eb('0x12b')][_0x85eb('0xd2')]:_0x85eb('0x12e'),'createdAt':moment(_0x49146a[_0x85eb('0x87')])[_0x85eb('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x49146a[_0x85eb('0xe4')]?moment(_0x49146a[_0x85eb('0x12f')])[_0x85eb('0xf7')](_0x85eb('0x118'))[_0x85eb('0xaa')]():'','disposition':_0x49146a[_0x85eb('0xe5')],'chatInfo':{'browser':_0x49146a['browserName'],'os':_0x49146a['osName'],'referer':_0x49146a[_0x85eb('0x130')],'customerIp':_0x49146a[_0x85eb('0x131')],'customerPort':_0x49146a[_0x85eb('0x132')]?_0x49146a[_0x85eb('0x132')]:'N.A.'},'messages':_(_0x49146a['Messages'])[_0x85eb('0x133')]()['filter']({'secret':![]})[_0x85eb('0x40')](function(_0x2d1a82){if(_0x2d1a82[_0x85eb('0xec')]){var _0x188ace=path[_0x85eb('0xf1')](_0x163a17,_0x2d1a82[_0x85eb('0xec')][_0x85eb('0xe9')]);if(fs[_0x85eb('0x134')](_0x188ace)){fs['createReadStream'](_0x188ace)['pipe'](fs['createWriteStream'](path['join'](_0x27ea02,_0x2d1a82[_0x85eb('0xec')][_0x85eb('0xe9')])));}}return{'date':moment(_0x2d1a82[_0x85eb('0x87')])[_0x85eb('0xf7')](_0x85eb('0x118'))[_0x85eb('0xaa')](),'sender':_0x2d1a82[_0x85eb('0x105')]===_0x85eb('0xdd')?_0x2d1a82[_0x85eb('0x80')]?_0x2d1a82['User'][_0x85eb('0xd2')]:_0x85eb('0x100'):_0x2d1a82[_0x85eb('0x73')]['firstName']+(_0x2d1a82['Contact'][_0x85eb('0x128')]?'\x20'+_0x2d1a82['Contact']['lastName']:''),'body':_0x2d1a82[_0x85eb('0xec')]?_0x2d1a82[_0x85eb('0xec')]['basename']:_0x2d1a82['body'],'direction':_0x2d1a82[_0x85eb('0x105')]===_0x85eb('0xdd')?'A':'C','secret':_0x2d1a82[_0x85eb('0x106')],'read':_0x2d1a82['read'],'attachment':_0x2d1a82[_0x85eb('0xec')]};})[_0x85eb('0x6f')]()};return ejs[_0x85eb('0x135')](path[_0x85eb('0xf1')](config[_0x85eb('0xf2')],_0x85eb('0x124'),'views','downloadInteraction.ejs'),{'interaction':_0xa82740})[_0x85eb('0x22')](function(_0x226fbf){var _0x5f38af=path['join'](_0x27ea02,'transcript-'+_0x49146a['id']+'-'+_0x411f08+_0x85eb('0x136'));var _0x16b750={'path':_0x5f38af,'channel':_0x85eb('0x12d'),'interactionId':_0x49146a['id']};return pdf['createPdfFromHTML'](_0x226fbf,_0x16b750);})[_0x85eb('0x22')](function(){return new BPromise(function(_0x28229e,_0x46330e){zipdir(_0x27ea02,{'saveTo':_0x4675d1},function(_0x5ab7ab,_0x9be3b4){if(_0x5ab7ab)return _0x46330e(_0x5ab7ab);return _0x28229e(_0x9be3b4);});})[_0x85eb('0x22')](function(){return new BPromise(function(_0x4ee6d3,_0x42c865){rimraf(_0x27ea02,function(_0x329ba3){if(_0x329ba3)_0x42c865(_0x329ba3);return _0x4ee6d3();});});})[_0x85eb('0x22')](function(){return _0x1c3ed4['download'](_0x4675d1,_0x5a3a94,function(_0x3dc0d5){if(_0x3dc0d5){console[_0x85eb('0x137')](_0x85eb('0x138'),_0x3dc0d5);}else{fs[_0x85eb('0x139')](_0x4675d1);}});});});}else{return _0x1c3ed4[_0x85eb('0x2b')](0xc8);}})[_0x85eb('0x44')](handleError(_0x1c3ed4,null));};
\ No newline at end of file
index 0f42497..9be2dbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10ca=['map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','remove','then','setDataValue'];(function(_0x54ecff,_0x37ce75){var _0x150c26=function(_0x2bc3ea){while(--_0x2bc3ea){_0x54ecff['push'](_0x54ecff['shift']());}};_0x150c26(++_0x37ce75);}(_0x10ca,0x94));var _0xa10c=function(_0x136ff2,_0x4d1028){_0x136ff2=_0x136ff2-0x0;var _0x576e2d=_0x10ca[_0x136ff2];return _0x576e2d;};'use strict';var EventEmitter=require(_0xa10c('0x0'));var ChatInteraction=require(_0xa10c('0x1'))['db'][_0xa10c('0x2')];var ChatMessage=require(_0xa10c('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa10c('0x3')};function emitEvent(_0x4a6fce){return function(_0x16d3f6,_0x49d53b,_0x1578e4){_0x16d3f6['getUsers']({'attributes':['id'],'raw':!![]})[_0xa10c('0x4')](function(_0x50d4e7){_0x16d3f6[_0xa10c('0x5')]('Users',_0x50d4e7[_0xa10c('0x6')](function(_0x23c890){return{'id':_0x23c890['id']};}));return ChatMessage[_0xa10c('0x7')]({'where':{'ChatInteractionId':_0x16d3f6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa10c('0x4')](function(_0x1de660){_0x16d3f6[_0xa10c('0x5')](_0xa10c('0x8'),_0x1de660[_0xa10c('0x9')]);ChatInteractionEvents[_0xa10c('0xa')](_0x4a6fce+':'+_0x16d3f6['id'],_0x16d3f6);ChatInteractionEvents[_0xa10c('0xa')](_0x4a6fce,_0x16d3f6);_0x1578e4(null);})[_0xa10c('0xb')](_0x1578e4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xa10c('0xc')](e,emitEvent(event));}}module[_0xa10c('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xaa9c=['../../mysqldb','ChatInteraction','setMaxListeners','update','remove','getUsers','then','setDataValue','map','unreadMessages','emit','catch','hasOwnProperty','exports'];(function(_0x547085,_0x36664b){var _0x5f7705=function(_0x2b21e4){while(--_0x2b21e4){_0x547085['push'](_0x547085['shift']());}};_0x5f7705(++_0x36664b);}(_0xaa9c,0xee));var _0xcaa9=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xaa9c[_0x599f41];return _0x2e4d58;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xcaa9('0x0'))['db'][_0xcaa9('0x1')];var ChatMessage=require(_0xcaa9('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xcaa9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcaa9('0x3'),'afterDestroy':_0xcaa9('0x4')};function emitEvent(_0x484f39){return function(_0x765567,_0x1345d8,_0x1dd05e){_0x765567[_0xcaa9('0x5')]({'attributes':['id'],'raw':!![]})[_0xcaa9('0x6')](function(_0x2e5e23){_0x765567[_0xcaa9('0x7')]('Users',_0x2e5e23[_0xcaa9('0x8')](function(_0x2a0a68){return{'id':_0x2a0a68['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x765567['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcaa9('0x6')](function(_0x309b9f){_0x765567[_0xcaa9('0x7')](_0xcaa9('0x9'),_0x309b9f['length']);ChatInteractionEvents[_0xcaa9('0xa')](_0x484f39+':'+_0x765567['id'],_0x765567);ChatInteractionEvents[_0xcaa9('0xa')](_0x484f39,_0x765567);_0x1dd05e(null);})[_0xcaa9('0xb')](_0x1dd05e(null));};}for(var e in events){if(events[_0xcaa9('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xcaa9('0xd')]=ChatInteractionEvents;
\ No newline at end of file
index ced0ba0..ec06056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','changed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x1f6f84,_0x2bab55){var _0x177f40=function(_0x384ab4){while(--_0x384ab4){_0x1f6f84['push'](_0x1f6f84['shift']());}};_0x177f40(++_0x2bab55);}(_0x535b,0x9b));var _0xb535=function(_0x15ed2c,_0x3bd32b){_0x15ed2c=_0x15ed2c-0x0;var _0x5d79bd=_0x535b[_0x15ed2c];return _0x5d79bd;};'use strict';var _=require(_0xb535('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb535('0x1'));var BPromise=require(_0xb535('0x2'));var rp=require(_0xb535('0x3'));var fs=require('fs');var path=require(_0xb535('0x4'));var rimraf=require(_0xb535('0x5'));var config=require(_0xb535('0x6'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x231861,_0x5176d1){return _0x231861[_0xb535('0x7')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x260278,_0x1d33ae,_0x29ecc7){if(_0x260278[_0xb535('0x8')]('closed')){_0x260278[_0xb535('0x9')]=moment()[_0xb535('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x29ecc7(null,_0x260278);}},'charset':_0xb535('0xb'),'collate':_0xb535('0xc')});};
\ No newline at end of file
+var _0x1aff=['closed','closedAt','utf8mb4_unicode_ci','lodash','util','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x1aff,0x162));var _0xf1af=function(_0x25494c,_0x3ad717){_0x25494c=_0x25494c-0x0;var _0x4627d1=_0x1aff[_0x25494c];return _0x4627d1;};'use strict';var _=require(_0xf1af('0x0'));var util=require(_0xf1af('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf1af('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1af('0x3'));var config=require(_0xf1af('0x4'));var attributes=require(_0xf1af('0x5'));module[_0xf1af('0x6')]=function(_0x3eff7e,_0x2b7886){return _0x3eff7e[_0xf1af('0x7')](_0xf1af('0x8'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x340b85,_0x97add1,_0x45760e){if(_0x340b85[_0xf1af('0x9')](_0xf1af('0xa'))){_0x340b85[_0xf1af('0xb')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x45760e(null,_0x340b85);}},'charset':'utf8mb4','collate':_0xf1af('0xc')});};
\ No newline at end of file
index e994081..1118f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9034=['where','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','update','options'];(function(_0x26b804,_0x228644){var _0x2c035f=function(_0x59586f){while(--_0x59586f){_0x26b804['push'](_0x26b804['shift']());}};_0x2c035f(++_0x228644);}(_0x9034,0xfc));var _0x4903=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9034[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x4903('0x0'));var util=require('util');var moment=require(_0x4903('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4903('0x2'));var db=require(_0x4903('0x3'))['db'];var utils=require(_0x4903('0x4'));var logger=require(_0x4903('0x5'))(_0x4903('0x6'));var config=require('../../config/environment');var jayson=require(_0x4903('0x7'));var client=jayson['client'][_0x4903('0x8')]({'port':0x232a});config[_0x4903('0x9')]=_['defaults'](config[_0x4903('0x9')],{'host':_0x4903('0xa'),'port':0x18eb});var socket=require(_0x4903('0xb'))(new Redis(config['redis']));require(_0x4903('0xc'))[_0x4903('0xd')](socket);function respondWithRpcPromise(_0x458e4b,_0x12f649,_0x324ee7){return new BPromise(function(_0x34eff7,_0x3ad80c){return client[_0x4903('0xe')](_0x458e4b,_0x324ee7)[_0x4903('0xf')](function(_0x1cc8ba){logger[_0x4903('0x10')](_0x4903('0x11'),_0x12f649,_0x4903('0x12'));logger['debug'](_0x4903('0x13'),_0x12f649,_0x4903('0x12'),JSON[_0x4903('0x14')](_0x1cc8ba));if(_0x1cc8ba[_0x4903('0x15')]){if(_0x1cc8ba[_0x4903('0x15')]['code']===0x1f4){logger[_0x4903('0x15')](_0x4903('0x11'),_0x12f649,_0x1cc8ba['error']['message']);return _0x3ad80c(_0x1cc8ba[_0x4903('0x15')][_0x4903('0x16')]);}logger[_0x4903('0x15')](_0x4903('0x11'),_0x12f649,_0x1cc8ba[_0x4903('0x15')]['message']);return _0x34eff7(_0x1cc8ba['error'][_0x4903('0x16')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x12f649,_0x4903('0x12'));_0x34eff7(_0x1cc8ba['result'][_0x4903('0x16')]);}})[_0x4903('0x17')](function(_0x147695){logger[_0x4903('0x15')](_0x4903('0x11'),_0x12f649,_0x147695);_0x3ad80c(_0x147695);});});}exports[_0x4903('0x18')]=function(_0x4f681e){var _0xdf607a=this;return new Promise(function(_0x3fc1e4,_0x31cf90){return db[_0x4903('0x19')][_0x4903('0x1a')](_0x4f681e['body'],{'raw':_0x4f681e[_0x4903('0x1b')]?_0x4f681e[_0x4903('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f681e[_0x4903('0x1b')]?_0x4f681e[_0x4903('0x1b')][_0x4903('0x1c')]||null:null,'attributes':_0x4f681e['options']?_0x4f681e['options'][_0x4903('0x1d')]||null:null,'limit':_0x4f681e[_0x4903('0x1b')]?_0x4f681e[_0x4903('0x1b')][_0x4903('0x1e')]||null:null})['then'](function(_0x3237ed){logger[_0x4903('0x10')]('UpdateChatInteraction',_0x4f681e);logger[_0x4903('0x1f')](_0x4903('0x18'),_0x4f681e,JSON[_0x4903('0x14')](_0x3237ed));_0x3fc1e4(_0x3237ed);})[_0x4903('0x17')](function(_0x49389d){logger['error'](_0x4903('0x18'),_0x49389d[_0x4903('0x16')],_0x4f681e);_0x31cf90(_0xdf607a[_0x4903('0x15')](0x1f4,_0x49389d[_0x4903('0x16')]));});});};exports[_0x4903('0x20')]=function(_0xa1a79){return new Promise(function(_0x35e72e,_0x544be1){return db['ChatInteraction'][_0x4903('0x21')]({'where':_0xa1a79[_0x4903('0x1b')]?_0xa1a79['options'][_0x4903('0x1c')]||null:null})[_0x4903('0xf')](function(_0x4bdfb4){if(_0x4bdfb4){return _0x4bdfb4[_0x4903('0x22')](_0xa1a79['body'][_0x4903('0x23')],_[_0x4903('0x24')](_0xa1a79[_0x4903('0x25')],[_0x4903('0x23'),'id'])||{});}})[_0x4903('0x26')](function(_0x4afe81){logger[_0x4903('0x10')](_0x4903('0x27'),_0xa1a79);logger['debug'](_0x4903('0x27'),_0xa1a79,JSON[_0x4903('0x14')](_0x4afe81));_0x35e72e(_0x4afe81);})[_0x4903('0x17')](function(_0x590e6d){logger[_0x4903('0x15')]('AddTags',_0x590e6d[_0x4903('0x16')],_0xa1a79);_0x544be1(_this[_0x4903('0x15')](0x1f4,_0x590e6d[_0x4903('0x16')]));});});};
\ No newline at end of file
+var _0xa5d2=['raw','attributes','limit','then','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','where','addTags','ids','AddTags','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./chatInteraction.socket','register','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','ChatInteraction','update','body','options'];(function(_0x16728a,_0x380e7f){var _0x57e9fd=function(_0x5520d5){while(--_0x5520d5){_0x16728a['push'](_0x16728a['shift']());}};_0x57e9fd(++_0x380e7f);}(_0xa5d2,0x11d));var _0x2a5d=function(_0x438101,_0xb0f6a6){_0x438101=_0x438101-0x0;var _0x43aba3=_0xa5d2[_0x438101];return _0x43aba3;};'use strict';var _=require(_0x2a5d('0x0'));var util=require('util');var moment=require(_0x2a5d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a5d('0x2'));var db=require(_0x2a5d('0x3'))['db'];var utils=require(_0x2a5d('0x4'));var logger=require(_0x2a5d('0x5'))(_0x2a5d('0x6'));var config=require(_0x2a5d('0x7'));var jayson=require(_0x2a5d('0x8'));var client=jayson[_0x2a5d('0x9')]['http']({'port':0x232a});config[_0x2a5d('0xa')]=_['defaults'](config[_0x2a5d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a5d('0xa')]));require(_0x2a5d('0xb'))[_0x2a5d('0xc')](socket);function respondWithRpcPromise(_0x373ac8,_0x31dc3a,_0x407909){return new BPromise(function(_0x70c7b2,_0x47ba2e){return client[_0x2a5d('0xd')](_0x373ac8,_0x407909)['then'](function(_0x5f2cc){logger[_0x2a5d('0xe')]('ChatInteraction,\x20%s,\x20%s',_0x31dc3a,_0x2a5d('0xf'));logger[_0x2a5d('0x10')](_0x2a5d('0x11'),_0x31dc3a,_0x2a5d('0xf'),JSON['stringify'](_0x5f2cc));if(_0x5f2cc[_0x2a5d('0x12')]){if(_0x5f2cc['error'][_0x2a5d('0x13')]===0x1f4){logger['error'](_0x2a5d('0x14'),_0x31dc3a,_0x5f2cc[_0x2a5d('0x12')]['message']);return _0x47ba2e(_0x5f2cc[_0x2a5d('0x12')][_0x2a5d('0x15')]);}logger[_0x2a5d('0x12')](_0x2a5d('0x14'),_0x31dc3a,_0x5f2cc[_0x2a5d('0x12')]['message']);return _0x70c7b2(_0x5f2cc[_0x2a5d('0x12')]['message']);}else{logger[_0x2a5d('0xe')](_0x2a5d('0x14'),_0x31dc3a,_0x2a5d('0xf'));_0x70c7b2(_0x5f2cc['result'][_0x2a5d('0x15')]);}})[_0x2a5d('0x16')](function(_0x2d643f){logger[_0x2a5d('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x31dc3a,_0x2d643f);_0x47ba2e(_0x2d643f);});});}exports['UpdateChatInteraction']=function(_0x57ef93){var _0x18fe17=this;return new Promise(function(_0xe20f01,_0x617a44){return db[_0x2a5d('0x17')][_0x2a5d('0x18')](_0x57ef93[_0x2a5d('0x19')],{'raw':_0x57ef93['options']?_0x57ef93[_0x2a5d('0x1a')][_0x2a5d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57ef93['options']?_0x57ef93['options']['where']||null:null,'attributes':_0x57ef93['options']?_0x57ef93[_0x2a5d('0x1a')][_0x2a5d('0x1c')]||null:null,'limit':_0x57ef93['options']?_0x57ef93[_0x2a5d('0x1a')][_0x2a5d('0x1d')]||null:null})[_0x2a5d('0x1e')](function(_0x3340c4){logger['info'](_0x2a5d('0x1f'),_0x57ef93);logger[_0x2a5d('0x10')](_0x2a5d('0x1f'),_0x57ef93,JSON[_0x2a5d('0x20')](_0x3340c4));_0xe20f01(_0x3340c4);})[_0x2a5d('0x16')](function(_0x251d7f){logger[_0x2a5d('0x12')](_0x2a5d('0x1f'),_0x251d7f[_0x2a5d('0x15')],_0x57ef93);_0x617a44(_0x18fe17[_0x2a5d('0x12')](0x1f4,_0x251d7f[_0x2a5d('0x15')]));});});};exports[_0x2a5d('0x21')]=function(_0x1b39d9){return new Promise(function(_0x5dc5ea,_0x434bf8){return db[_0x2a5d('0x17')][_0x2a5d('0x22')]({'where':_0x1b39d9[_0x2a5d('0x1a')]?_0x1b39d9['options'][_0x2a5d('0x23')]||null:null})[_0x2a5d('0x1e')](function(_0x69bfe0){if(_0x69bfe0){return _0x69bfe0[_0x2a5d('0x24')](_0x1b39d9[_0x2a5d('0x19')]['ids'],_['omit'](_0x1b39d9['body'],[_0x2a5d('0x25'),'id'])||{});}})['spread'](function(_0x2482f7){logger[_0x2a5d('0xe')](_0x2a5d('0x26'),_0x1b39d9);logger[_0x2a5d('0x10')](_0x2a5d('0x26'),_0x1b39d9,JSON['stringify'](_0x2482f7));_0x5dc5ea(_0x2482f7);})[_0x2a5d('0x16')](function(_0x4ff3e1){logger['error']('AddTags',_0x4ff3e1[_0x2a5d('0x15')],_0x1b39d9);_0x434bf8(_this['error'](0x1f4,_0x4ff3e1[_0x2a5d('0x15')]));});});};
\ No newline at end of file
index 22942a5..bc6babe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x788f=['./chatInteraction.events','remove','removeListener','register','length','chatInteraction:'];(function(_0x90215c,_0x331637){var _0x1cc90f=function(_0x486b13){while(--_0x486b13){_0x90215c['push'](_0x90215c['shift']());}};_0x1cc90f(++_0x331637);}(_0x788f,0x15c));var _0xf788=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x788f[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0xf788('0x0'));var events=['save',_0xf788('0x1'),'update'];function createListener(_0x137902,_0x423abc){return function(_0x3f2c0e){_0x423abc['emit'](_0x137902,_0x3f2c0e);};}function removeListener(_0x28d578,_0x1a621a){return function(){ChatInteractionEvents[_0xf788('0x2')](_0x28d578,_0x1a621a);};}exports[_0xf788('0x3')]=function(_0xc4a6f2){for(var _0x2731d3=0x0,_0x5b6d1e=events[_0xf788('0x4')];_0x2731d3<_0x5b6d1e;_0x2731d3++){var _0x374cb1=events[_0x2731d3];var _0x2a6794=createListener(_0xf788('0x5')+_0x374cb1,_0xc4a6f2);ChatInteractionEvents['on'](_0x374cb1,_0x2a6794);}};
\ No newline at end of file
+var _0x5569=['./chatInteraction.events','remove','update','emit','removeListener','register','chatInteraction:'];(function(_0x554f39,_0x29f5a0){var _0x534d56=function(_0x443cd9){while(--_0x443cd9){_0x554f39['push'](_0x554f39['shift']());}};_0x534d56(++_0x29f5a0);}(_0x5569,0x1a4));var _0x9556=function(_0x5ea51f,_0x1e3a5b){_0x5ea51f=_0x5ea51f-0x0;var _0x28f6ab=_0x5569[_0x5ea51f];return _0x28f6ab;};'use strict';var ChatInteractionEvents=require(_0x9556('0x0'));var events=['save',_0x9556('0x1'),_0x9556('0x2')];function createListener(_0x272159,_0x355d45){return function(_0xbf198e){_0x355d45[_0x9556('0x3')](_0x272159,_0xbf198e);};}function removeListener(_0x27e8ed,_0x49de31){return function(){ChatInteractionEvents[_0x9556('0x4')](_0x27e8ed,_0x49de31);};}exports[_0x9556('0x5')]=function(_0x132600){for(var _0x3516d2=0x0,_0x24ecbc=events['length'];_0x3516d2<_0x24ecbc;_0x3516d2++){var _0x4a4760=events[_0x3516d2];var _0x349a08=createListener(_0x9556('0x6')+_0x4a4760,_0x132600);ChatInteractionEvents['on'](_0x4a4760,_0x349a08);}};
\ No newline at end of file
index 7c2663b..ef3818c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x197e=['post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','originalname','single','file','attachmentUpload','/:id/messages','/:id/tags','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download'];(function(_0xd5ba4e,_0x5ebd34){var _0x52d47f=function(_0x360119){while(--_0x360119){_0xd5ba4e['push'](_0xd5ba4e['shift']());}};_0x52d47f(++_0x5ebd34);}(_0x197e,0x1f3));var _0xe197=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x197e[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require(_0xe197('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe197('0x1')]();var fs_extra=require(_0xe197('0x2'));var auth=require(_0xe197('0x3'));var interaction=require(_0xe197('0x4'));var config=require(_0xe197('0x5'));var controller=require('./chatInteraction.controller');router[_0xe197('0x6')]('/',auth[_0xe197('0x7')](),controller[_0xe197('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe197('0x6')](_0xe197('0x9'),auth[_0xe197('0xa')](),controller['show']);router[_0xe197('0x6')](_0xe197('0xb'),auth[_0xe197('0xa')](),controller[_0xe197('0xc')]);router[_0xe197('0x6')]('/:id/messages',auth[_0xe197('0x7')](),controller[_0xe197('0xd')]);router['get'](_0xe197('0xe'),auth[_0xe197('0xa')](),controller[_0xe197('0xf')]);router[_0xe197('0x6')]('/:id/download',auth[_0xe197('0x7')](),controller[_0xe197('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe197('0x11')](_0xe197('0x12'),auth[_0xe197('0x7')](),controller[_0xe197('0x13')]);var upload=multer({'storage':multer[_0xe197('0x14')]({'destination':function(_0x15d247,_0x34efac,_0x3932c9){_0x3932c9(null,path[_0xe197('0x15')](config[_0xe197('0x16')],_0xe197('0x17')));},'filename':function(_0x2ec57a,_0x1ac835,_0x492360){_0x492360(null,util['format']('%s-%s',Date['now'](),_0x1ac835[_0xe197('0x18')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe197('0x11')]('/:id/attachment_upload',upload[_0xe197('0x19')](_0xe197('0x1a')),controller[_0xe197('0x1b')]);router[_0xe197('0x11')](_0xe197('0x1c'),auth[_0xe197('0xa')](),controller['addMessage']);router['post'](_0xe197('0x1d'),auth[_0xe197('0x7')](),interaction[_0xe197('0x1e')]('chat',_0xe197('0x1f')),controller['addTags']);router[_0xe197('0x20')](_0xe197('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xe197('0x21'),_0xe197('0x22')),controller['update']);router[_0xe197('0x20')]('/:id/custom_update',controller[_0xe197('0x23')]);router[_0xe197('0x20')](_0xe197('0x24'),auth[_0xe197('0xa')](),controller[_0xe197('0x25')]);router[_0xe197('0x20')](_0xe197('0x26'),controller[_0xe197('0x27')]);router['delete'](_0xe197('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0xe197('0x21'),_0xe197('0x28')),controller[_0xe197('0x29')]);router['delete'](_0xe197('0x1d'),auth[_0xe197('0x7')](),controller[_0xe197('0x2a')]);module['exports']=router;
\ No newline at end of file
+var _0xeb2a=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','diskStorage','join','root','format','%s-%s','now','originalname','replace','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','removeTags','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xeb2a,0x64));var _0xaeb2=function(_0x56d4b4,_0x4ea4bf){_0x56d4b4=_0x56d4b4-0x0;var _0x1b92fd=_0xeb2a[_0x56d4b4];return _0x1b92fd;};'use strict';var multer=require('multer');var util=require(_0xaeb2('0x0'));var path=require(_0xaeb2('0x1'));var timeout=require(_0xaeb2('0x2'));var express=require('express');var router=express[_0xaeb2('0x3')]();var fs_extra=require(_0xaeb2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xaeb2('0x5'));var config=require(_0xaeb2('0x6'));var controller=require(_0xaeb2('0x7'));router[_0xaeb2('0x8')]('/',auth[_0xaeb2('0x9')](),controller[_0xaeb2('0xa')]);router[_0xaeb2('0x8')](_0xaeb2('0xb'),auth[_0xaeb2('0x9')](),controller[_0xaeb2('0xc')]);router[_0xaeb2('0x8')](_0xaeb2('0xd'),auth[_0xaeb2('0xe')](),controller['show']);router[_0xaeb2('0x8')](_0xaeb2('0xf'),auth[_0xaeb2('0xe')](),controller[_0xaeb2('0x10')]);router[_0xaeb2('0x8')](_0xaeb2('0x11'),auth[_0xaeb2('0x9')](),controller[_0xaeb2('0x12')]);router[_0xaeb2('0x8')]('/:id/my_messages',auth[_0xaeb2('0xe')](),controller[_0xaeb2('0x13')]);router['get'](_0xaeb2('0x14'),auth[_0xaeb2('0x9')](),controller[_0xaeb2('0x15')]);router[_0xaeb2('0x16')]('/',auth[_0xaeb2('0x9')](),controller[_0xaeb2('0x17')]);router[_0xaeb2('0x16')]('/:id/vidaoo',auth[_0xaeb2('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xaeb2('0x18')]({'destination':function(_0x73d2c3,_0x3cd606,_0x4ad1d9){_0x4ad1d9(null,path[_0xaeb2('0x19')](config[_0xaeb2('0x1a')],'server/files/attachments/'));},'filename':function(_0xba6792,_0x251124,_0x452170){_0x452170(null,util[_0xaeb2('0x1b')](_0xaeb2('0x1c'),Date[_0xaeb2('0x1d')](),_0x251124[_0xaeb2('0x1e')][_0xaeb2('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaeb2('0x16')]('/:id/attachment_upload',upload['single'](_0xaeb2('0x20')),controller[_0xaeb2('0x21')]);router[_0xaeb2('0x16')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xaeb2('0x16')](_0xaeb2('0x22'),auth[_0xaeb2('0x9')](),interaction[_0xaeb2('0x23')](_0xaeb2('0x24'),_0xaeb2('0x25')),controller[_0xaeb2('0x26')]);router[_0xaeb2('0x27')]('/:id',auth[_0xaeb2('0x9')](),interaction[_0xaeb2('0x23')](_0xaeb2('0x24'),_0xaeb2('0x28')),controller[_0xaeb2('0x29')]);router['put'](_0xaeb2('0x2a'),controller[_0xaeb2('0x2b')]);router[_0xaeb2('0x27')](_0xaeb2('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0xaeb2('0x2d')]);router[_0xaeb2('0x27')]('/:id/close',controller[_0xaeb2('0x2e')]);router[_0xaeb2('0x2f')](_0xaeb2('0xd'),auth[_0xaeb2('0x9')](),interaction['tracked']('chat','chatinteraction:destroy'),controller['destroy']);router[_0xaeb2('0x2f')](_0xaeb2('0x22'),auth['isAuthenticated'](),controller[_0xaeb2('0x30')]);module[_0xaeb2('0x31')]=router;
\ No newline at end of file
index 0d05d6d..45fa590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f79=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x1f79,0xc4));var _0x91f7=function(_0x92e310,_0x442f58){_0x92e310=_0x92e310-0x0;var _0x3ad650=_0x1f79[_0x92e310];return _0x3ad650;};'use strict';var Sequelize=require(_0x91f7('0x0'));module[_0x91f7('0x1')]={'body':{'type':Sequelize[_0x91f7('0x2')](_0x91f7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x91f7('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x91f7('0x5')]}};
\ No newline at end of file
+var _0x3ba9=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x50c816,_0x10798d){var _0x1ff102=function(_0x10aed6){while(--_0x10aed6){_0x50c816['push'](_0x50c816['shift']());}};_0x1ff102(++_0x10798d);}(_0x3ba9,0x1ef));var _0x93ba=function(_0x1c2e22,_0x4c784d){_0x1c2e22=_0x1c2e22-0x0;var _0x55d667=_0x3ba9[_0x1c2e22];return _0x55d667;};'use strict';var Sequelize=require('sequelize');module[_0x93ba('0x0')]={'body':{'type':Sequelize[_0x93ba('0x1')](_0x93ba('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x93ba('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x93ba('0x4')]}};
\ No newline at end of file
index eb019aa..b121546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f0d=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','type','options','includeAll','rows','catch','show','params','include','merge','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','role','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','userProfileId','autoAssociation','push','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status'];(function(_0x28c9e2,_0x480db0){var _0x509a82=function(_0x12ece1){while(--_0x12ece1){_0x28c9e2['push'](_0x28c9e2['shift']());}};_0x509a82(++_0x480db0);}(_0x7f0d,0xba));var _0xd7f0=function(_0x12e347,_0xea36ce){_0x12e347=_0x12e347-0x0;var _0x46e9f0=_0x7f0d[_0x12e347];return _0x46e9f0;};'use strict';var emlformat=require(_0xd7f0('0x0'));var rimraf=require(_0xd7f0('0x1'));var zipdir=require(_0xd7f0('0x2'));var jsonpatch=require(_0xd7f0('0x3'));var rp=require(_0xd7f0('0x4'));var moment=require('moment');var BPromise=require(_0xd7f0('0x5'));var Mustache=require(_0xd7f0('0x6'));var util=require(_0xd7f0('0x7'));var path=require(_0xd7f0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd7f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7f0('0xa'));var squel=require(_0xd7f0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd7f0('0xc'));var toCsv=require(_0xd7f0('0xd'));var querystring=require(_0xd7f0('0xe'));var Papa=require(_0xd7f0('0xf'));var Redis=require('ioredis');var authService=require(_0xd7f0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7f0('0x11'))('api');var utils=require(_0xd7f0('0x12'));var config=require(_0xd7f0('0x13'));var licenseUtil=require(_0xd7f0('0x14'));var db=require(_0xd7f0('0x15'))['db'];config[_0xd7f0('0x16')]=_[_0xd7f0('0x17')](config['redis'],{'host':_0xd7f0('0x18'),'port':0x18eb});var socket=require(_0xd7f0('0x19'))(new Redis(config[_0xd7f0('0x16')]));require('./chatInternalMessage.socket')[_0xd7f0('0x1a')](socket);function respondWithStatusCode(_0x4108bd,_0x27af1f){_0x27af1f=_0x27af1f||0xcc;return function(_0x55e616){if(_0x55e616){return _0x4108bd[_0xd7f0('0x1b')](_0x27af1f);}return _0x4108bd['status'](_0x27af1f)[_0xd7f0('0x1c')]();};}function respondWithResult(_0x44bb5f,_0x4a08e9){_0x4a08e9=_0x4a08e9||0xc8;return function(_0x90a9e){if(_0x90a9e){return _0x44bb5f[_0xd7f0('0x1d')](_0x4a08e9)[_0xd7f0('0x1e')](_0x90a9e);}};}function respondWithFilteredResult(_0x3e2150,_0x30d5cc){return function(_0x350317){if(_0x350317){var _0x15fbac=typeof _0x30d5cc[_0xd7f0('0x1f')]===_0xd7f0('0x20')&&typeof _0x30d5cc[_0xd7f0('0x21')]==='undefined';var _0x4538f3=_0x350317[_0xd7f0('0x22')];var _0x5d89b0=_0x15fbac?0x0:_0x30d5cc['offset'];var _0x5b6b37=_0x15fbac?_0x350317['count']:_0x30d5cc[_0xd7f0('0x1f')]+_0x30d5cc['limit'];var _0x523559;if(_0x5b6b37>=_0x4538f3){_0x5b6b37=_0x4538f3;_0x523559=0xc8;}else{_0x523559=0xce;}_0x3e2150[_0xd7f0('0x1d')](_0x523559);return _0x3e2150[_0xd7f0('0x23')](_0xd7f0('0x24'),_0x5d89b0+'-'+_0x5b6b37+'/'+_0x4538f3)[_0xd7f0('0x1e')](_0x350317);}return null;};}function patchUpdates(_0xb80858){return function(_0x5e622b){try{jsonpatch['apply'](_0x5e622b,_0xb80858,!![]);}catch(_0x2b3236){return BPromise[_0xd7f0('0x25')](_0x2b3236);}return _0x5e622b[_0xd7f0('0x26')]();};}function saveUpdates(_0x1db3f2,_0x311a05){return function(_0x2bc70b){if(_0x2bc70b){return _0x2bc70b[_0xd7f0('0x27')](_0x1db3f2)[_0xd7f0('0x28')](function(_0x3aa535){return _0x3aa535;});}return null;};}function removeEntity(_0xe015f1,_0x3fcbb3){return function(_0x54f49e){if(_0x54f49e){return _0x54f49e[_0xd7f0('0x29')]()['then'](function(){_0xe015f1[_0xd7f0('0x1d')](0xcc)[_0xd7f0('0x1c')]();});}};}function handleEntityNotFound(_0x200a2e,_0x4ffc9e){return function(_0x41648d){if(!_0x41648d){_0x200a2e[_0xd7f0('0x1b')](0x194);}return _0x41648d;};}function handleError(_0x465eb8,_0x582538){_0x582538=_0x582538||0x1f4;return function(_0xae1b6d){logger[_0xd7f0('0x2a')](_0xae1b6d[_0xd7f0('0x2b')]);if(_0xae1b6d[_0xd7f0('0x2c')]){delete _0xae1b6d[_0xd7f0('0x2c')];}_0x465eb8[_0xd7f0('0x1d')](_0x582538)['send'](_0xae1b6d);};}exports[_0xd7f0('0x2d')]=function(_0x309f0c,_0x8868bc){var _0x515cd9={},_0x29fb1d={},_0x892d39={'count':0x0,'rows':[]};var _0x561a84=_['map'](db[_0xd7f0('0x2e')][_0xd7f0('0x2f')],function(_0x1e0397){return{'name':_0x1e0397[_0xd7f0('0x30')],'type':_0x1e0397['type'][_0xd7f0('0x31')]};});_0x29fb1d[_0xd7f0('0x32')]=_[_0xd7f0('0x33')](_0x561a84,'name');_0x29fb1d[_0xd7f0('0x34')]=_[_0xd7f0('0x35')](_0x309f0c[_0xd7f0('0x34')]);_0x29fb1d['filters']=_[_0xd7f0('0x36')](_0x29fb1d['model'],_0x29fb1d['query']);_0x515cd9[_0xd7f0('0x37')]=_[_0xd7f0('0x36')](_0x29fb1d[_0xd7f0('0x32')],qs[_0xd7f0('0x38')](_0x309f0c[_0xd7f0('0x34')][_0xd7f0('0x38')]));_0x515cd9['attributes']=_0x515cd9[_0xd7f0('0x37')][_0xd7f0('0x39')]?_0x515cd9[_0xd7f0('0x37')]:_0x29fb1d['model'];if(!_0x309f0c['query']['hasOwnProperty'](_0xd7f0('0x3a'))){_0x515cd9[_0xd7f0('0x21')]=qs[_0xd7f0('0x21')](_0x309f0c[_0xd7f0('0x34')][_0xd7f0('0x21')]);_0x515cd9[_0xd7f0('0x1f')]=qs['offset'](_0x309f0c['query']['offset']);}_0x515cd9[_0xd7f0('0x3b')]=qs[_0xd7f0('0x3c')](_0x309f0c[_0xd7f0('0x34')][_0xd7f0('0x3c')]);_0x515cd9['where']=qs[_0xd7f0('0x3d')](_[_0xd7f0('0x3e')](_0x309f0c[_0xd7f0('0x34')],_0x29fb1d[_0xd7f0('0x3d')]),_0x561a84);if(_0x309f0c[_0xd7f0('0x34')][_0xd7f0('0x3f')]){_0x515cd9[_0xd7f0('0x40')]=_['merge'](_0x515cd9[_0xd7f0('0x40')],{'$or':_[_0xd7f0('0x33')](_0x561a84,function(_0x10f07d){if(_0x10f07d[_0xd7f0('0x41')]!=='VIRTUAL'){var _0x543bce={};_0x543bce[_0x10f07d[_0xd7f0('0x2c')]]={'$like':'%'+_0x309f0c[_0xd7f0('0x34')][_0xd7f0('0x3f')]+'%'};return _0x543bce;}})});}_0x515cd9=_['merge']({},_0x515cd9,_0x309f0c[_0xd7f0('0x42')]);var _0x5fe582={'where':_0x515cd9[_0xd7f0('0x40')]};return db[_0xd7f0('0x2e')]['count'](_0x5fe582)[_0xd7f0('0x28')](function(_0x676df7){_0x892d39[_0xd7f0('0x22')]=_0x676df7;if(_0x309f0c[_0xd7f0('0x34')][_0xd7f0('0x43')]){_0x515cd9['include']=[{'all':!![]}];}return db[_0xd7f0('0x2e')]['findAll'](_0x515cd9);})[_0xd7f0('0x28')](function(_0x3e6c17){_0x892d39[_0xd7f0('0x44')]=_0x3e6c17;return _0x892d39;})['then'](respondWithFilteredResult(_0x8868bc,_0x515cd9))[_0xd7f0('0x45')](handleError(_0x8868bc,null));};exports[_0xd7f0('0x46')]=function(_0x22088e,_0x34b396){var _0x1ab158={'raw':!![],'where':{'id':_0x22088e[_0xd7f0('0x47')]['id']}},_0x1458a2={};_0x1458a2[_0xd7f0('0x32')]=_[_0xd7f0('0x35')](db['ChatInternalMessage'][_0xd7f0('0x2f')]);_0x1458a2[_0xd7f0('0x34')]=_[_0xd7f0('0x35')](_0x22088e[_0xd7f0('0x34')]);_0x1458a2[_0xd7f0('0x3d')]=_[_0xd7f0('0x36')](_0x1458a2[_0xd7f0('0x32')],_0x1458a2[_0xd7f0('0x34')]);_0x1ab158['attributes']=_[_0xd7f0('0x36')](_0x1458a2[_0xd7f0('0x32')],qs[_0xd7f0('0x38')](_0x22088e[_0xd7f0('0x34')][_0xd7f0('0x38')]));_0x1ab158[_0xd7f0('0x37')]=_0x1ab158[_0xd7f0('0x37')]['length']?_0x1ab158[_0xd7f0('0x37')]:_0x1458a2[_0xd7f0('0x32')];if(_0x22088e[_0xd7f0('0x34')][_0xd7f0('0x43')]){_0x1ab158[_0xd7f0('0x48')]=[{'all':!![]}];}_0x1ab158=_[_0xd7f0('0x49')]({},_0x1ab158,_0x22088e[_0xd7f0('0x42')]);return db['ChatInternalMessage'][_0xd7f0('0x4a')](_0x1ab158)[_0xd7f0('0x28')](handleEntityNotFound(_0x34b396,null))['then'](respondWithResult(_0x34b396,null))[_0xd7f0('0x45')](handleError(_0x34b396,null));};exports['create']=function(_0x428aa5,_0x4f2c1c){return db[_0xd7f0('0x2e')][_0xd7f0('0x4b')](_0x428aa5[_0xd7f0('0x4c')],{})[_0xd7f0('0x28')](respondWithResult(_0x4f2c1c,0xc9))[_0xd7f0('0x45')](handleError(_0x4f2c1c,null));};exports[_0xd7f0('0x27')]=function(_0x49f34b,_0x210aae){if(_0x49f34b['body']['id']){delete _0x49f34b[_0xd7f0('0x4c')]['id'];}return db[_0xd7f0('0x2e')][_0xd7f0('0x4a')]({'where':{'id':_0x49f34b[_0xd7f0('0x47')]['id']}})[_0xd7f0('0x28')](handleEntityNotFound(_0x210aae,null))['then'](saveUpdates(_0x49f34b[_0xd7f0('0x4c')],null))[_0xd7f0('0x28')](respondWithResult(_0x210aae,null))[_0xd7f0('0x45')](handleError(_0x210aae,null));};exports['destroy']=function(_0x19cdd6,_0x57f6a0){return db['ChatInternalMessage'][_0xd7f0('0x4a')]({'where':{'id':_0x19cdd6[_0xd7f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x57f6a0,null))[_0xd7f0('0x28')](removeEntity(_0x57f6a0,null))[_0xd7f0('0x45')](handleError(_0x57f6a0,null));};exports[_0xd7f0('0x4d')]=function(_0x51cb78,_0x13d102){return db[_0xd7f0('0x2e')]['describe']()[_0xd7f0('0x28')](respondWithResult(_0x13d102,null))[_0xd7f0('0x45')](handleError(_0x13d102,null));};function wrapUser(_0x59987d){return function(_0xb2c299){var _0x3ef76a=_0x59987d[_0xd7f0('0x4e')]({'plain':!![]});_0x3ef76a[_0xd7f0('0x4f')]=[];if(_0xb2c299){_0x3ef76a[_0xd7f0('0x50')]=_0xb2c299[_0xd7f0('0x51')];_0x3ef76a[_0xd7f0('0x52')]=_0xb2c299;}else{_0x3ef76a[_0xd7f0('0x50')]=moment(0x0)[_0xd7f0('0x53')](_0xd7f0('0x54'));_0x3ef76a['lastMessage']={};}return _0x3ef76a;};}exports[_0xd7f0('0x55')]=function(_0x3aee39,_0x3cf9ab,_0x3bad30){var _0x27facf=[];return db[_0xd7f0('0x56')][_0xd7f0('0x57')]({'where':{'role':[_0xd7f0('0x58'),_0xd7f0('0x59'),'user']},'attributes':['id',_0xd7f0('0x5a'),'name',_0xd7f0('0x5b'),_0xd7f0('0x5c'),_0xd7f0('0x5d'),_0xd7f0('0x5e'),'lastLoginAt','allowmessenger',_0xd7f0('0x5f')],'order':qs['sort'](_0xd7f0('0x60')),'include':[{'model':db[_0xd7f0('0x61')],'as':_0xd7f0('0x62'),'attributes':['id',_0xd7f0('0x2c'),_0xd7f0('0x41')],'through':{'attributes':[]}}]})[_0xd7f0('0x28')](function(_0x22e475){if(_0x22e475){var _0x5f0eb0=_0x3aee39[_0xd7f0('0x63')][_0xd7f0('0x4e')]({'plain':!![]});if(!_0x5f0eb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f0eb0[_0xd7f0('0x5b')]===_0xd7f0('0x63')){return db[_0xd7f0('0x64')][_0xd7f0('0x4a')]({'where':{'name':'Agents','userProfileId':_0x5f0eb0[_0xd7f0('0x65')]},'raw':!![]})['then'](function(_0x2c0592){if(_0x2c0592){if(_0x2c0592[_0xd7f0('0x66')]===0x0){return db['UserProfileResource'][_0xd7f0('0x57')]({'where':{'sectionId':_0x2c0592['id']},'raw':!![]})[_0xd7f0('0x28')](function(_0x21a400){var _0x27e678=[];if(_['isEmpty'](_0x21a400)){_0x27e678=_[_0xd7f0('0x3f')](_0x22e475,function(_0x2f652e){if(_0x2f652e[_0xd7f0('0x5b')]!==_0xd7f0('0x58')){return _0x2f652e;}});return _0x27e678;}else{for(var _0x22b1ee=0x0;_0x22b1ee<_0x22e475[_0xd7f0('0x39')];_0x22b1ee++){var _0x8bcba8=_0x22e475[_0x22b1ee];if(_0x8bcba8[_0xd7f0('0x5b')]==='agent'){var _0x5c45e1=_['find'](_0x21a400,function(_0x26a8b1){return _0x26a8b1['resourceId']===_0x8bcba8['id'];});if(_0x5c45e1)_0x27e678[_0xd7f0('0x67')](_0x8bcba8);}else{_0x27e678[_0xd7f0('0x67')](_0x8bcba8);}}return _0x27e678;}});}else{return _0x22e475;}}else{var _0x30ee71=_[_0xd7f0('0x3f')](_0x22e475,function(_0x3c5cab){if(_0x3c5cab['role']!==_0xd7f0('0x58')){return _0x3c5cab;}});return _0x30ee71;}});}else{return _0x22e475;}}})[_0xd7f0('0x28')](function(_0x1fcad3){var _0x340bda=[];if(_0x1fcad3){_0x27facf=_0x1fcad3;for(var _0x598a98=0x0;_0x598a98<_0x1fcad3[_0xd7f0('0x39')];_0x598a98+=0x1){_0x27facf[_0x598a98][_0xd7f0('0x4f')]=[];_0x340bda[_0xd7f0('0x67')](db[_0xd7f0('0x2e')][_0xd7f0('0x4a')]({'where':{'FromId':[_0x3aee39[_0xd7f0('0x63')]['id'],_0x1fcad3[_0x598a98]['id']],'ToId':[_0x3aee39[_0xd7f0('0x63')]['id'],_0x1fcad3[_0x598a98]['id']],'ChatGroupId':null},'attributes':['id',_0xd7f0('0x51'),_0xd7f0('0x68'),_0xd7f0('0x69'),_0xd7f0('0x6a'),_0xd7f0('0x4c')],'order':qs['sort'](_0xd7f0('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd7f0('0x28')](wrapUser(_0x1fcad3[_0x598a98])));}return BPromise['all'](_0x340bda);}return[];})[_0xd7f0('0x28')](function(_0x5985af){return{'rows':_0x5985af,'count':_0x5985af['length']};})[_0xd7f0('0x28')](respondWithResult(_0x3cf9ab,null))[_0xd7f0('0x45')](handleError(_0x3cf9ab,null));};
\ No newline at end of file
+var _0xb26f=['rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','include','findAll','catch','show','params','fields','length','includeAll','create','body','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','user','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','role','agent','resourceId','push','FromId','ToId','read','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','update','then','destroy','error','name','send','map','ChatInternalMessage'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0xb26f,0x11a));var _0xfb26=function(_0x2300fa,_0x41c382){_0x2300fa=_0x2300fa-0x0;var _0x11fef0=_0xb26f[_0x2300fa];return _0x11fef0;};'use strict';var emlformat=require(_0xfb26('0x0'));var rimraf=require(_0xfb26('0x1'));var zipdir=require(_0xfb26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb26('0x3'));var moment=require(_0xfb26('0x4'));var BPromise=require(_0xfb26('0x5'));var Mustache=require(_0xfb26('0x6'));var util=require(_0xfb26('0x7'));var path=require(_0xfb26('0x8'));var sox=require(_0xfb26('0x9'));var csv=require(_0xfb26('0xa'));var ejs=require(_0xfb26('0xb'));var fs=require('fs');var fs_extra=require(_0xfb26('0xc'));var _=require(_0xfb26('0xd'));var squel=require(_0xfb26('0xe'));var crypto=require(_0xfb26('0xf'));var jsforce=require(_0xfb26('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfb26('0x11'));var Papa=require('papaparse');var Redis=require(_0xfb26('0x12'));var authService=require(_0xfb26('0x13'));var qs=require(_0xfb26('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb26('0x15'));var logger=require(_0xfb26('0x16'))(_0xfb26('0x17'));var utils=require(_0xfb26('0x18'));var config=require(_0xfb26('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfb26('0x1a')]=_['defaults'](config[_0xfb26('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb26('0x1b'))(new Redis(config['redis']));require(_0xfb26('0x1c'))[_0xfb26('0x1d')](socket);function respondWithStatusCode(_0x24271b,_0x3af77c){_0x3af77c=_0x3af77c||0xcc;return function(_0x4c7a34){if(_0x4c7a34){return _0x24271b[_0xfb26('0x1e')](_0x3af77c);}return _0x24271b[_0xfb26('0x1f')](_0x3af77c)[_0xfb26('0x20')]();};}function respondWithResult(_0x3b196b,_0x3689b6){_0x3689b6=_0x3689b6||0xc8;return function(_0x253e5d){if(_0x253e5d){return _0x3b196b['status'](_0x3689b6)['json'](_0x253e5d);}};}function respondWithFilteredResult(_0x55b2f3,_0xe50550){return function(_0xa94a3e){if(_0xa94a3e){var _0x48ec67=typeof _0xe50550[_0xfb26('0x21')]===_0xfb26('0x22')&&typeof _0xe50550[_0xfb26('0x23')]===_0xfb26('0x22');var _0x521c80=_0xa94a3e['count'];var _0x1d72ea=_0x48ec67?0x0:_0xe50550['offset'];var _0x4791f9=_0x48ec67?_0xa94a3e['count']:_0xe50550[_0xfb26('0x21')]+_0xe50550[_0xfb26('0x23')];var _0x459d50;if(_0x4791f9>=_0x521c80){_0x4791f9=_0x521c80;_0x459d50=0xc8;}else{_0x459d50=0xce;}_0x55b2f3[_0xfb26('0x1f')](_0x459d50);return _0x55b2f3['set'](_0xfb26('0x24'),_0x1d72ea+'-'+_0x4791f9+'/'+_0x521c80)[_0xfb26('0x25')](_0xa94a3e);}return null;};}function patchUpdates(_0x28f216){return function(_0xa69872){try{jsonpatch[_0xfb26('0x26')](_0xa69872,_0x28f216,!![]);}catch(_0xb86d){return BPromise[_0xfb26('0x27')](_0xb86d);}return _0xa69872['save']();};}function saveUpdates(_0x392959,_0x30f7fd){return function(_0x51671f){if(_0x51671f){return _0x51671f[_0xfb26('0x28')](_0x392959)[_0xfb26('0x29')](function(_0x492b8d){return _0x492b8d;});}return null;};}function removeEntity(_0x5319e7,_0x3c59ca){return function(_0x3faf24){if(_0x3faf24){return _0x3faf24[_0xfb26('0x2a')]()[_0xfb26('0x29')](function(){_0x5319e7[_0xfb26('0x1f')](0xcc)[_0xfb26('0x20')]();});}};}function handleEntityNotFound(_0x4ff72e,_0x5f37d1){return function(_0x4e3b24){if(!_0x4e3b24){_0x4ff72e[_0xfb26('0x1e')](0x194);}return _0x4e3b24;};}function handleError(_0x17a2b6,_0x1d01f5){_0x1d01f5=_0x1d01f5||0x1f4;return function(_0x5afe3c){logger[_0xfb26('0x2b')](_0x5afe3c['stack']);if(_0x5afe3c[_0xfb26('0x2c')]){delete _0x5afe3c[_0xfb26('0x2c')];}_0x17a2b6[_0xfb26('0x1f')](_0x1d01f5)[_0xfb26('0x2d')](_0x5afe3c);};}exports['index']=function(_0x371204,_0x41f662){var _0x2f1ced={},_0x167772={},_0x410991={'count':0x0,'rows':[]};var _0xae4a05=_[_0xfb26('0x2e')](db[_0xfb26('0x2f')][_0xfb26('0x30')],function(_0x2d4a0b){return{'name':_0x2d4a0b[_0xfb26('0x31')],'type':_0x2d4a0b[_0xfb26('0x32')][_0xfb26('0x33')]};});_0x167772[_0xfb26('0x34')]=_['map'](_0xae4a05,_0xfb26('0x2c'));_0x167772[_0xfb26('0x35')]=_[_0xfb26('0x36')](_0x371204['query']);_0x167772['filters']=_[_0xfb26('0x37')](_0x167772[_0xfb26('0x34')],_0x167772[_0xfb26('0x35')]);_0x2f1ced['attributes']=_[_0xfb26('0x37')](_0x167772[_0xfb26('0x34')],qs['fields'](_0x371204['query']['fields']));_0x2f1ced[_0xfb26('0x38')]=_0x2f1ced[_0xfb26('0x38')]['length']?_0x2f1ced[_0xfb26('0x38')]:_0x167772[_0xfb26('0x34')];if(!_0x371204[_0xfb26('0x35')][_0xfb26('0x39')](_0xfb26('0x3a'))){_0x2f1ced[_0xfb26('0x23')]=qs[_0xfb26('0x23')](_0x371204['query'][_0xfb26('0x23')]);_0x2f1ced[_0xfb26('0x21')]=qs[_0xfb26('0x21')](_0x371204[_0xfb26('0x35')][_0xfb26('0x21')]);}_0x2f1ced[_0xfb26('0x3b')]=qs[_0xfb26('0x3c')](_0x371204[_0xfb26('0x35')][_0xfb26('0x3c')]);_0x2f1ced[_0xfb26('0x3d')]=qs[_0xfb26('0x3e')](_[_0xfb26('0x3f')](_0x371204[_0xfb26('0x35')],_0x167772[_0xfb26('0x3e')]),_0xae4a05);if(_0x371204[_0xfb26('0x35')][_0xfb26('0x40')]){_0x2f1ced['where']=_['merge'](_0x2f1ced[_0xfb26('0x3d')],{'$or':_['map'](_0xae4a05,function(_0x4d311c){if(_0x4d311c[_0xfb26('0x32')]!==_0xfb26('0x41')){var _0x199179={};_0x199179[_0x4d311c[_0xfb26('0x2c')]]={'$like':'%'+_0x371204[_0xfb26('0x35')][_0xfb26('0x40')]+'%'};return _0x199179;}})});}_0x2f1ced=_[_0xfb26('0x42')]({},_0x2f1ced,_0x371204[_0xfb26('0x43')]);var _0x2a05e7={'where':_0x2f1ced[_0xfb26('0x3d')]};return db[_0xfb26('0x2f')][_0xfb26('0x44')](_0x2a05e7)[_0xfb26('0x29')](function(_0x40b396){_0x410991[_0xfb26('0x44')]=_0x40b396;if(_0x371204[_0xfb26('0x35')]['includeAll']){_0x2f1ced[_0xfb26('0x45')]=[{'all':!![]}];}return db[_0xfb26('0x2f')][_0xfb26('0x46')](_0x2f1ced);})['then'](function(_0x3ab805){_0x410991['rows']=_0x3ab805;return _0x410991;})[_0xfb26('0x29')](respondWithFilteredResult(_0x41f662,_0x2f1ced))[_0xfb26('0x47')](handleError(_0x41f662,null));};exports[_0xfb26('0x48')]=function(_0x341082,_0x440328){var _0x2885ba={'raw':!![],'where':{'id':_0x341082[_0xfb26('0x49')]['id']}},_0x310bff={};_0x310bff[_0xfb26('0x34')]=_[_0xfb26('0x36')](db[_0xfb26('0x2f')]['rawAttributes']);_0x310bff[_0xfb26('0x35')]=_[_0xfb26('0x36')](_0x341082[_0xfb26('0x35')]);_0x310bff[_0xfb26('0x3e')]=_[_0xfb26('0x37')](_0x310bff['model'],_0x310bff[_0xfb26('0x35')]);_0x2885ba[_0xfb26('0x38')]=_[_0xfb26('0x37')](_0x310bff[_0xfb26('0x34')],qs[_0xfb26('0x4a')](_0x341082[_0xfb26('0x35')][_0xfb26('0x4a')]));_0x2885ba[_0xfb26('0x38')]=_0x2885ba[_0xfb26('0x38')][_0xfb26('0x4b')]?_0x2885ba[_0xfb26('0x38')]:_0x310bff[_0xfb26('0x34')];if(_0x341082[_0xfb26('0x35')][_0xfb26('0x4c')]){_0x2885ba['include']=[{'all':!![]}];}_0x2885ba=_[_0xfb26('0x42')]({},_0x2885ba,_0x341082[_0xfb26('0x43')]);return db[_0xfb26('0x2f')]['find'](_0x2885ba)[_0xfb26('0x29')](handleEntityNotFound(_0x440328,null))[_0xfb26('0x29')](respondWithResult(_0x440328,null))[_0xfb26('0x47')](handleError(_0x440328,null));};exports[_0xfb26('0x4d')]=function(_0x4b8a66,_0x314e13){return db[_0xfb26('0x2f')][_0xfb26('0x4d')](_0x4b8a66['body'],{})[_0xfb26('0x29')](respondWithResult(_0x314e13,0xc9))[_0xfb26('0x47')](handleError(_0x314e13,null));};exports['update']=function(_0x8fa3a8,_0x26c04e){if(_0x8fa3a8[_0xfb26('0x4e')]['id']){delete _0x8fa3a8['body']['id'];}return db[_0xfb26('0x2f')]['find']({'where':{'id':_0x8fa3a8[_0xfb26('0x49')]['id']}})[_0xfb26('0x29')](handleEntityNotFound(_0x26c04e,null))[_0xfb26('0x29')](saveUpdates(_0x8fa3a8[_0xfb26('0x4e')],null))[_0xfb26('0x29')](respondWithResult(_0x26c04e,null))[_0xfb26('0x47')](handleError(_0x26c04e,null));};exports[_0xfb26('0x2a')]=function(_0x38a799,_0x126da0){return db[_0xfb26('0x2f')]['find']({'where':{'id':_0x38a799['params']['id']}})[_0xfb26('0x29')](handleEntityNotFound(_0x126da0,null))[_0xfb26('0x29')](removeEntity(_0x126da0,null))[_0xfb26('0x47')](handleError(_0x126da0,null));};exports[_0xfb26('0x4f')]=function(_0x470631,_0xd8358d){return db[_0xfb26('0x2f')][_0xfb26('0x4f')]()[_0xfb26('0x29')](respondWithResult(_0xd8358d,null))[_0xfb26('0x47')](handleError(_0xd8358d,null));};function wrapUser(_0x33e32f){return function(_0x45e611){var _0x2069bd=_0x33e32f['get']({'plain':!![]});_0x2069bd[_0xfb26('0x50')]=[];if(_0x45e611){_0x2069bd[_0xfb26('0x51')]=_0x45e611[_0xfb26('0x52')];_0x2069bd['lastMessage']=_0x45e611;}else{_0x2069bd[_0xfb26('0x51')]=moment(0x0)['format'](_0xfb26('0x53'));_0x2069bd[_0xfb26('0x54')]={};}return _0x2069bd;};}exports['getUsers']=function(_0x554e65,_0x5e888b,_0x2081a8){var _0x493992=[];return db[_0xfb26('0x55')][_0xfb26('0x46')]({'where':{'role':['agent','admin',_0xfb26('0x56')]},'attributes':['id','fullname',_0xfb26('0x2c'),'role',_0xfb26('0x57'),_0xfb26('0x58'),_0xfb26('0x59'),_0xfb26('0x5a'),_0xfb26('0x5b'),_0xfb26('0x5c')],'order':qs['sort'](_0xfb26('0x5d')),'include':[{'model':db[_0xfb26('0x5e')],'as':_0xfb26('0x5f'),'attributes':['id',_0xfb26('0x2c'),'type'],'through':{'attributes':[]}}]})[_0xfb26('0x29')](function(_0x11638c){if(_0x11638c){var _0x59f1a7=_0x554e65[_0xfb26('0x56')][_0xfb26('0x60')]({'plain':!![]});if(!_0x59f1a7)throw new Error(_0xfb26('0x61'));if(_0x59f1a7['role']===_0xfb26('0x56')){return db[_0xfb26('0x62')][_0xfb26('0x63')]({'where':{'name':'Agents','userProfileId':_0x59f1a7[_0xfb26('0x64')]},'raw':!![]})[_0xfb26('0x29')](function(_0x31e42a){if(_0x31e42a){if(_0x31e42a[_0xfb26('0x65')]===0x0){return db[_0xfb26('0x66')][_0xfb26('0x46')]({'where':{'sectionId':_0x31e42a['id']},'raw':!![]})[_0xfb26('0x29')](function(_0x2ad85c){var _0x4973e9=[];if(_['isEmpty'](_0x2ad85c)){_0x4973e9=_[_0xfb26('0x40')](_0x11638c,function(_0x490641){if(_0x490641[_0xfb26('0x67')]!==_0xfb26('0x68')){return _0x490641;}});return _0x4973e9;}else{for(var _0x25b902=0x0;_0x25b902<_0x11638c[_0xfb26('0x4b')];_0x25b902++){var _0x5c8a2f=_0x11638c[_0x25b902];if(_0x5c8a2f[_0xfb26('0x67')]===_0xfb26('0x68')){var _0x3378dd=_[_0xfb26('0x63')](_0x2ad85c,function(_0x6f4a08){return _0x6f4a08[_0xfb26('0x69')]===_0x5c8a2f['id'];});if(_0x3378dd)_0x4973e9[_0xfb26('0x6a')](_0x5c8a2f);}else{_0x4973e9['push'](_0x5c8a2f);}}return _0x4973e9;}});}else{return _0x11638c;}}else{var _0x5391ee=_[_0xfb26('0x40')](_0x11638c,function(_0xca61a6){if(_0xca61a6[_0xfb26('0x67')]!==_0xfb26('0x68')){return _0xca61a6;}});return _0x5391ee;}});}else{return _0x11638c;}}})[_0xfb26('0x29')](function(_0xa32edd){var _0x57ad12=[];if(_0xa32edd){_0x493992=_0xa32edd;for(var _0x2df0e8=0x0;_0x2df0e8<_0xa32edd[_0xfb26('0x4b')];_0x2df0e8+=0x1){_0x493992[_0x2df0e8][_0xfb26('0x50')]=[];_0x57ad12[_0xfb26('0x6a')](db[_0xfb26('0x2f')]['find']({'where':{'FromId':[_0x554e65[_0xfb26('0x56')]['id'],_0xa32edd[_0x2df0e8]['id']],'ToId':[_0x554e65['user']['id'],_0xa32edd[_0x2df0e8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xfb26('0x6b'),_0xfb26('0x6c'),_0xfb26('0x6d'),_0xfb26('0x4e')],'order':qs[_0xfb26('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfb26('0x29')](wrapUser(_0xa32edd[_0x2df0e8])));}return BPromise['all'](_0x57ad12);}return[];})['then'](function(_0x42d475){return{'rows':_0x42d475,'count':_0x42d475[_0xfb26('0x4b')]};})['then'](respondWithResult(_0x5e888b,null))[_0xfb26('0x47')](handleError(_0x5e888b,null));};
\ No newline at end of file
index 954b394..2c7c2d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4173=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3b0da2,_0x306d66){var _0x45a240=function(_0x557598){while(--_0x557598){_0x3b0da2['push'](_0x3b0da2['shift']());}};_0x45a240(++_0x306d66);}(_0x4173,0x18b));var _0x3417=function(_0x4d0f0e,_0x21b7e0){_0x4d0f0e=_0x4d0f0e-0x0;var _0x654fad=_0x4173[_0x4d0f0e];return _0x654fad;};'use strict';var EventEmitter=require(_0x3417('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3417('0x1')](0x0);var events={'afterCreate':_0x3417('0x2'),'afterUpdate':_0x3417('0x3'),'afterDestroy':_0x3417('0x4')};function emitEvent(_0x5ebad2){return function(_0x57ac6b,_0x4aada0,_0x18d979){ChatInternalMessageEvents['emit'](_0x5ebad2+':'+_0x57ac6b['id'],_0x57ac6b);ChatInternalMessageEvents[_0x3417('0x5')](_0x5ebad2,_0x57ac6b);_0x18d979(null);};}for(var e in events){if(events[_0x3417('0x6')](e)){var event=events[e];ChatInternalMessage[_0x3417('0x7')](e,emitEvent(event));}}module[_0x3417('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xcb49=['setMaxListeners','save','update','remove','emit','hook','events','ChatInternalMessage'];(function(_0x17615e,_0x483a49){var _0xa4c97e=function(_0x24ecf7){while(--_0x24ecf7){_0x17615e['push'](_0x17615e['shift']());}};_0xa4c97e(++_0x483a49);}(_0xcb49,0x156));var _0x9cb4=function(_0x4d82e1,_0x5ac72b){_0x4d82e1=_0x4d82e1-0x0;var _0x5f3bd9=_0xcb49[_0x4d82e1];return _0x5f3bd9;};'use strict';var EventEmitter=require(_0x9cb4('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x9cb4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9cb4('0x2')](0x0);var events={'afterCreate':_0x9cb4('0x3'),'afterUpdate':_0x9cb4('0x4'),'afterDestroy':_0x9cb4('0x5')};function emitEvent(_0x3bb409){return function(_0x4a8453,_0x55478d,_0x51717a){ChatInternalMessageEvents[_0x9cb4('0x6')](_0x3bb409+':'+_0x4a8453['id'],_0x4a8453);ChatInternalMessageEvents['emit'](_0x3bb409,_0x4a8453);_0x51717a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9cb4('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index ee44a7a..3154529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa500=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0xb13a2c,_0x235ea0){var _0x22d0e9=function(_0x30f9d4){while(--_0x30f9d4){_0xb13a2c['push'](_0xb13a2c['shift']());}};_0x22d0e9(++_0x235ea0);}(_0xa500,0x165));var _0x0a50=function(_0x242ee7,_0x468f88){_0x242ee7=_0x242ee7-0x0;var _0x17a660=_0xa500[_0x242ee7];return _0x17a660;};'use strict';var _=require(_0x0a50('0x0'));var util=require(_0x0a50('0x1'));var logger=require('../../config/logger')(_0x0a50('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a50('0x3'));var fs=require('fs');var path=require(_0x0a50('0x4'));var rimraf=require(_0x0a50('0x5'));var config=require(_0x0a50('0x6'));var attributes=require(_0x0a50('0x7'));module[_0x0a50('0x8')]=function(_0x4a4c3a,_0x3337db){return _0x4a4c3a[_0x0a50('0x9')](_0x0a50('0xa'),attributes,{'tableName':_0x0a50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a50('0xc'),'collate':_0x0a50('0xd')});};
\ No newline at end of file
+var _0x6c94=['request-promise','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird'];(function(_0x1c2e4a,_0x1c931a){var _0x2a1d52=function(_0x4185de){while(--_0x4185de){_0x1c2e4a['push'](_0x1c2e4a['shift']());}};_0x2a1d52(++_0x1c931a);}(_0x6c94,0xac));var _0x46c9=function(_0x434fc2,_0x1d8a95){_0x434fc2=_0x434fc2-0x0;var _0x2aadc1=_0x6c94[_0x434fc2];return _0x2aadc1;};'use strict';var _=require(_0x46c9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x46c9('0x1'));var moment=require(_0x46c9('0x2'));var BPromise=require(_0x46c9('0x3'));var rp=require(_0x46c9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x46c9('0x5'));module[_0x46c9('0x6')]=function(_0x4a253f,_0x5dfe42){return _0x4a253f[_0x46c9('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x46c9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46c9('0x9'),'collate':_0x46c9('0xa')});};
\ No newline at end of file
index 85290ee..065a5ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9275=['jayson/promise','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x17647e,_0x4a3444){var _0x134994=function(_0x5dc329){while(--_0x5dc329){_0x17647e['push'](_0x17647e['shift']());}};_0x134994(++_0x4a3444);}(_0x9275,0x130));var _0x5927=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x9275[_0x40a825];return _0x273a54;};'use strict';var _=require('lodash');var util=require(_0x5927('0x0'));var moment=require(_0x5927('0x1'));var BPromise=require(_0x5927('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5927('0x3'));var db=require(_0x5927('0x4'))['db'];var utils=require(_0x5927('0x5'));var logger=require(_0x5927('0x6'))(_0x5927('0x7'));var config=require('../../config/environment');var jayson=require(_0x5927('0x8'));var client=jayson['client'][_0x5927('0x9')]({'port':0x232a});config[_0x5927('0xa')]=_[_0x5927('0xb')](config[_0x5927('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5927('0xc'))(new Redis(config[_0x5927('0xa')]));require(_0x5927('0xd'))[_0x5927('0xe')](socket);function respondWithRpcPromise(_0x4b4279,_0x40c4c4,_0x3db5f4){return new BPromise(function(_0x4005c6,_0x59c717){return client['request'](_0x4b4279,_0x3db5f4)[_0x5927('0xf')](function(_0x1e8f76){logger[_0x5927('0x10')](_0x5927('0x11'),_0x40c4c4,'request\x20sent');logger[_0x5927('0x12')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x40c4c4,_0x5927('0x13'),JSON[_0x5927('0x14')](_0x1e8f76));if(_0x1e8f76[_0x5927('0x15')]){if(_0x1e8f76[_0x5927('0x15')][_0x5927('0x16')]===0x1f4){logger[_0x5927('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x40c4c4,_0x1e8f76['error'][_0x5927('0x17')]);return _0x59c717(_0x1e8f76[_0x5927('0x15')][_0x5927('0x17')]);}logger[_0x5927('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x40c4c4,_0x1e8f76[_0x5927('0x15')]['message']);return _0x4005c6(_0x1e8f76[_0x5927('0x15')][_0x5927('0x17')]);}else{logger[_0x5927('0x10')](_0x5927('0x11'),_0x40c4c4,_0x5927('0x13'));_0x4005c6(_0x1e8f76[_0x5927('0x18')][_0x5927('0x17')]);}})[_0x5927('0x19')](function(_0x355aca){logger[_0x5927('0x15')](_0x5927('0x11'),_0x40c4c4,_0x355aca);_0x59c717(_0x355aca);});});}
\ No newline at end of file
+var _0xd3c6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0xd3c6,0x121));var _0x6d3c=function(_0xd43e89,_0x59fa27){_0xd43e89=_0xd43e89-0x0;var _0x581ec6=_0xd3c6[_0xd43e89];return _0x581ec6;};'use strict';var _=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var moment=require(_0x6d3c('0x2'));var BPromise=require(_0x6d3c('0x3'));var rs=require(_0x6d3c('0x4'));var fs=require('fs');var Redis=require(_0x6d3c('0x5'));var db=require(_0x6d3c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d3c('0x7'))(_0x6d3c('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d3c('0x9'));var client=jayson[_0x6d3c('0xa')][_0x6d3c('0xb')]({'port':0x232a});config[_0x6d3c('0xc')]=_[_0x6d3c('0xd')](config[_0x6d3c('0xc')],{'host':_0x6d3c('0xe'),'port':0x18eb});var socket=require(_0x6d3c('0xf'))(new Redis(config[_0x6d3c('0xc')]));require(_0x6d3c('0x10'))[_0x6d3c('0x11')](socket);function respondWithRpcPromise(_0x13fd90,_0x38fdaa,_0x675c3d){return new BPromise(function(_0x41d2e2,_0x4cf27a){return client[_0x6d3c('0x12')](_0x13fd90,_0x675c3d)[_0x6d3c('0x13')](function(_0xc05d7a){logger[_0x6d3c('0x14')](_0x6d3c('0x15'),_0x38fdaa,_0x6d3c('0x16'));logger[_0x6d3c('0x17')](_0x6d3c('0x18'),_0x38fdaa,_0x6d3c('0x16'),JSON[_0x6d3c('0x19')](_0xc05d7a));if(_0xc05d7a[_0x6d3c('0x1a')]){if(_0xc05d7a[_0x6d3c('0x1a')][_0x6d3c('0x1b')]===0x1f4){logger[_0x6d3c('0x1a')](_0x6d3c('0x15'),_0x38fdaa,_0xc05d7a[_0x6d3c('0x1a')][_0x6d3c('0x1c')]);return _0x4cf27a(_0xc05d7a['error'][_0x6d3c('0x1c')]);}logger['error'](_0x6d3c('0x15'),_0x38fdaa,_0xc05d7a[_0x6d3c('0x1a')][_0x6d3c('0x1c')]);return _0x41d2e2(_0xc05d7a[_0x6d3c('0x1a')]['message']);}else{logger[_0x6d3c('0x14')](_0x6d3c('0x15'),_0x38fdaa,_0x6d3c('0x16'));_0x41d2e2(_0xc05d7a['result'][_0x6d3c('0x1c')]);}})['catch'](function(_0x49cdb5){logger[_0x6d3c('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x38fdaa,_0x49cdb5);_0x4cf27a(_0x49cdb5);});});}
\ No newline at end of file
index d86fad8..325bd8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd7a=['length','./chatInternalMessage.events','save','remove','update','emit','register'];(function(_0x30f4e6,_0x410675){var _0x595c31=function(_0x23e2da){while(--_0x23e2da){_0x30f4e6['push'](_0x30f4e6['shift']());}};_0x595c31(++_0x410675);}(_0xfd7a,0x12e));var _0xafd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd7a[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xafd7('0x0'));var events=[_0xafd7('0x1'),_0xafd7('0x2'),_0xafd7('0x3')];function createListener(_0x6d8275,_0x5ccedf){return function(_0x58b4cd){_0x5ccedf[_0xafd7('0x4')](_0x6d8275,_0x58b4cd);};}function removeListener(_0x412e3b,_0x59d0b0){return function(){ChatInternalMessageEvents['removeListener'](_0x412e3b,_0x59d0b0);};}exports[_0xafd7('0x5')]=function(_0x255d22){for(var _0x17d19f=0x0,_0x1c1b9b=events[_0xafd7('0x6')];_0x17d19f<_0x1c1b9b;_0x17d19f++){var _0x1a1a93=events[_0x17d19f];var _0x3b6756=createListener('chatInternalMessage:'+_0x1a1a93,_0x255d22);ChatInternalMessageEvents['on'](_0x1a1a93,_0x3b6756);}};
\ No newline at end of file
+var _0xed3d=['save','remove','update','emit','register','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xed3d,0x14f));var _0xded3=function(_0xce739c,_0x3452fc){_0xce739c=_0xce739c-0x0;var _0x37bfe1=_0xed3d[_0xce739c];return _0x37bfe1;};'use strict';var ChatInternalMessageEvents=require(_0xded3('0x0'));var events=[_0xded3('0x1'),_0xded3('0x2'),_0xded3('0x3')];function createListener(_0xb3ad35,_0x11aae7){return function(_0x446d7f){_0x11aae7[_0xded3('0x4')](_0xb3ad35,_0x446d7f);};}function removeListener(_0x12a6cf,_0x56b605){return function(){ChatInternalMessageEvents['removeListener'](_0x12a6cf,_0x56b605);};}exports[_0xded3('0x5')]=function(_0x426e14){for(var _0x2fbcf1=0x0,_0x17c360=events['length'];_0x2fbcf1<_0x17c360;_0x2fbcf1++){var _0x31e7e3=events[_0x2fbcf1];var _0xcb4440=createListener(_0xded3('0x6')+_0x31e7e3,_0x426e14);ChatInternalMessageEvents['on'](_0x31e7e3,_0xcb4440);}};
\ No newline at end of file
index aeb4b4a..e7ac230 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe87d=['../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe87d,0x198));var _0xde87=function(_0x2fb6bc,_0x21f695){_0x2fb6bc=_0x2fb6bc-0x0;var _0x37ef4c=_0xe87d[_0x2fb6bc];return _0x37ef4c;};'use strict';var multer=require(_0xde87('0x0'));var util=require(_0xde87('0x1'));var path=require(_0xde87('0x2'));var timeout=require(_0xde87('0x3'));var express=require(_0xde87('0x4'));var router=express[_0xde87('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xde87('0x6'));var interaction=require(_0xde87('0x7'));var config=require(_0xde87('0x8'));var controller=require(_0xde87('0x9'));router[_0xde87('0xa')]('/',auth['isAuthenticated'](),controller[_0xde87('0xb')]);router[_0xde87('0xa')](_0xde87('0xc'),auth[_0xde87('0xd')](),controller[_0xde87('0xe')]);router[_0xde87('0xa')](_0xde87('0xf'),auth[_0xde87('0xd')](),controller[_0xde87('0x10')]);router[_0xde87('0xa')](_0xde87('0x11'),auth[_0xde87('0xd')](),controller[_0xde87('0x12')]);router[_0xde87('0x13')]('/',auth['isAuthenticated'](),controller[_0xde87('0x14')]);router[_0xde87('0x15')](_0xde87('0x11'),controller[_0xde87('0x16')]);router[_0xde87('0x17')](_0xde87('0x11'),auth[_0xde87('0xd')](),controller[_0xde87('0x18')]);module[_0xde87('0x19')]=router;
\ No newline at end of file
+var _0x3449=['describe','/users','getUsers','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x842f30,_0x5a3981){var _0x24caa8=function(_0x167d3e){while(--_0x167d3e){_0x842f30['push'](_0x842f30['shift']());}};_0x24caa8(++_0x5a3981);}(_0x3449,0x106));var _0x9344=function(_0x1f326d,_0x19c7d2){_0x1f326d=_0x1f326d-0x0;var _0xca55ba=_0x3449[_0x1f326d];return _0xca55ba;};'use strict';var multer=require(_0x9344('0x0'));var util=require('util');var path=require(_0x9344('0x1'));var timeout=require(_0x9344('0x2'));var express=require(_0x9344('0x3'));var router=express[_0x9344('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9344('0x5'));var config=require(_0x9344('0x6'));var controller=require(_0x9344('0x7'));router[_0x9344('0x8')]('/',auth[_0x9344('0x9')](),controller[_0x9344('0xa')]);router[_0x9344('0x8')]('/describe',auth[_0x9344('0x9')](),controller[_0x9344('0xb')]);router['get'](_0x9344('0xc'),auth[_0x9344('0x9')](),controller[_0x9344('0xd')]);router[_0x9344('0x8')](_0x9344('0xe'),auth[_0x9344('0x9')](),controller['show']);router[_0x9344('0xf')]('/',auth[_0x9344('0x9')](),controller[_0x9344('0x10')]);router[_0x9344('0x11')](_0x9344('0xe'),controller[_0x9344('0x12')]);router['delete']('/:id',auth[_0x9344('0x9')](),controller[_0x9344('0x13')]);module[_0x9344('0x14')]=router;
\ No newline at end of file
index 11ae923..bac54cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae87=['STRING','TEXT','BOOLEAN','out'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xae87,0x1ce));var _0x7ae8=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0xae87[_0xaf29da];return _0x295c51;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7ae8('0x0')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7ae8('0x0')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7ae8('0x1')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x7ae8('0x2')]},'providerResponse':{'type':Sequelize[_0x7ae8('0x3')]}};
\ No newline at end of file
+var _0xa149=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x240502,_0x372cb4){var _0x58a1ab=function(_0x20f74f){while(--_0x20f74f){_0x240502['push'](_0x240502['shift']());}};_0x58a1ab(++_0x372cb4);}(_0xa149,0x18c));var _0x9a14=function(_0x298596,_0x1da7d8){_0x298596=_0x298596-0x0;var _0x13fa20=_0xa149[_0x298596];return _0x13fa20;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'body':{'type':Sequelize[_0x9a14('0x2')](_0x9a14('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9a14('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9a14('0x5')]('in',_0x9a14('0x6')),'defaultValue':_0x9a14('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9a14('0x7')]},'providerResponse':{'type':Sequelize[_0x9a14('0x2')]}};
\ No newline at end of file
index cfaf12b..bf12044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8daf=['offset','undefined','count','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','ChatMessage','includeAll','findAll','rows','show','params','include','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','ChatInteraction','ChatInteractionId','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','interaction','reject','RejectMessage','SELECT','email','event','rejectmessage','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','status','json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8daf,0x15c));var _0xf8da=function(_0x2ceb8e,_0x19ba8e){_0x2ceb8e=_0x2ceb8e-0x0;var _0xe283bb=_0x8daf[_0x2ceb8e];return _0xe283bb;};'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(_0xf8da('0x0'));var moment=require(_0xf8da('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xf8da('0x2'));var util=require(_0xf8da('0x3'));var path=require(_0xf8da('0x4'));var sox=require(_0xf8da('0x5'));var csv=require(_0xf8da('0x6'));var ejs=require(_0xf8da('0x7'));var fs=require('fs');var fs_extra=require(_0xf8da('0x8'));var _=require(_0xf8da('0x9'));var squel=require(_0xf8da('0xa'));var crypto=require('crypto');var jsforce=require(_0xf8da('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf8da('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8da('0xc'));var authService=require(_0xf8da('0xd'));var qs=require(_0xf8da('0xe'));var as=require(_0xf8da('0xf'));var hardwareService=require(_0xf8da('0x10'));var logger=require(_0xf8da('0x11'))(_0xf8da('0x12'));var utils=require(_0xf8da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf8da('0x14'));var db=require(_0xf8da('0x15'))['db'];config[_0xf8da('0x16')]=_[_0xf8da('0x17')](config['redis'],{'host':_0xf8da('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8da('0x16')]));require(_0xf8da('0x19'))[_0xf8da('0x1a')](socket);var jayson=require(_0xf8da('0x1b'));var client=jayson[_0xf8da('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xf8da('0x1c')][_0xf8da('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x36cee8,_0x3fa368,_0x39b5e6,_0x41257e){return new BPromise(function(_0x17eb8d,_0x4b457f){var _0x1c9486=_0x41257e||client;return _0x1c9486['request'](_0x36cee8,_0x39b5e6)['then'](function(_0x365fb7){logger[_0xf8da('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x3fa368,_0xf8da('0x1f'));logger[_0xf8da('0x20')](_0xf8da('0x21'),_0x3fa368,_0xf8da('0x1f'),JSON[_0xf8da('0x22')](_0x365fb7));if(_0x365fb7[_0xf8da('0x23')]){if(_0x365fb7[_0xf8da('0x23')][_0xf8da('0x24')]===0x1f4){logger['error'](_0xf8da('0x25'),_0x3fa368,_0x365fb7[_0xf8da('0x23')]['message']);return _0x4b457f(_0x365fb7[_0xf8da('0x23')][_0xf8da('0x26')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x3fa368,_0x365fb7[_0xf8da('0x23')][_0xf8da('0x26')]);return _0x17eb8d(_0x365fb7[_0xf8da('0x23')][_0xf8da('0x26')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3fa368,'request\x20sent');_0x17eb8d(_0x365fb7['result'][_0xf8da('0x26')]);}})[_0xf8da('0x27')](function(_0x43934c){logger[_0xf8da('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3fa368,_0x43934c);_0x4b457f(_0x43934c);});});}function respondWithStatusCode(_0x1270d2,_0x2ca340){_0x2ca340=_0x2ca340||0xcc;return function(_0x4326b1){if(_0x4326b1){return _0x1270d2['sendStatus'](_0x2ca340);}return _0x1270d2[_0xf8da('0x28')](_0x2ca340)['end']();};}function respondWithResult(_0x2c0866,_0xfe65c0){_0xfe65c0=_0xfe65c0||0xc8;return function(_0x1e6a45){if(_0x1e6a45){return _0x2c0866[_0xf8da('0x28')](_0xfe65c0)[_0xf8da('0x29')](_0x1e6a45);}};}function respondWithFilteredResult(_0x3da568,_0x35544b){return function(_0x424f5d){if(_0x424f5d){var _0x51014c=typeof _0x35544b[_0xf8da('0x2a')]==='undefined'&&typeof _0x35544b['limit']===_0xf8da('0x2b');var _0x1aa03a=_0x424f5d[_0xf8da('0x2c')];var _0x96c804=_0x51014c?0x0:_0x35544b[_0xf8da('0x2a')];var _0x587a04=_0x51014c?_0x424f5d[_0xf8da('0x2c')]:_0x35544b['offset']+_0x35544b['limit'];var _0x5eda69;if(_0x587a04>=_0x1aa03a){_0x587a04=_0x1aa03a;_0x5eda69=0xc8;}else{_0x5eda69=0xce;}_0x3da568['status'](_0x5eda69);return _0x3da568['set'](_0xf8da('0x2d'),_0x96c804+'-'+_0x587a04+'/'+_0x1aa03a)['json'](_0x424f5d);}return null;};}function patchUpdates(_0x3a8917){return function(_0x109741){try{jsonpatch[_0xf8da('0x2e')](_0x109741,_0x3a8917,!![]);}catch(_0x5abd5e){return BPromise['reject'](_0x5abd5e);}return _0x109741[_0xf8da('0x2f')]();};}function saveUpdates(_0x44a22d,_0x3c9aa5){return function(_0x150e83){if(_0x150e83){return _0x150e83[_0xf8da('0x30')](_0x44a22d)[_0xf8da('0x31')](function(_0x4f9992){return _0x4f9992;});}return null;};}function removeEntity(_0x112788,_0x6c2b9a){return function(_0x12d192){if(_0x12d192){return _0x12d192[_0xf8da('0x32')]()[_0xf8da('0x31')](function(){_0x112788[_0xf8da('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb6420,_0x3c7f50){return function(_0x1e5cfd){if(!_0x1e5cfd){_0xcb6420[_0xf8da('0x33')](0x194);}return _0x1e5cfd;};}function handleError(_0x58ac75,_0x1a146c){_0x1a146c=_0x1a146c||0x1f4;return function(_0x4fc59f){logger[_0xf8da('0x23')](_0x4fc59f['stack']);if(_0x4fc59f[_0xf8da('0x34')]){delete _0x4fc59f['name'];}_0x58ac75[_0xf8da('0x28')](_0x1a146c)[_0xf8da('0x35')](_0x4fc59f);};}exports[_0xf8da('0x36')]=function(_0x2197bd,_0x32f675){var _0x152685={},_0x5232c1={},_0x274153={'count':0x0,'rows':[]};var _0xc2c159=_[_0xf8da('0x37')](db['ChatMessage'][_0xf8da('0x38')],function(_0x3eb5b1){return{'name':_0x3eb5b1[_0xf8da('0x39')],'type':_0x3eb5b1['type'][_0xf8da('0x3a')]};});_0x5232c1[_0xf8da('0x3b')]=_['map'](_0xc2c159,_0xf8da('0x34'));_0x5232c1[_0xf8da('0x3c')]=_[_0xf8da('0x3d')](_0x2197bd['query']);_0x5232c1[_0xf8da('0x3e')]=_[_0xf8da('0x3f')](_0x5232c1[_0xf8da('0x3b')],_0x5232c1[_0xf8da('0x3c')]);_0x152685[_0xf8da('0x40')]=_[_0xf8da('0x3f')](_0x5232c1['model'],qs[_0xf8da('0x41')](_0x2197bd[_0xf8da('0x3c')]['fields']));_0x152685['attributes']=_0x152685[_0xf8da('0x40')][_0xf8da('0x42')]?_0x152685[_0xf8da('0x40')]:_0x5232c1[_0xf8da('0x3b')];if(!_0x2197bd['query'][_0xf8da('0x43')](_0xf8da('0x44'))){_0x152685[_0xf8da('0x45')]=qs[_0xf8da('0x45')](_0x2197bd['query']['limit']);_0x152685[_0xf8da('0x2a')]=qs['offset'](_0x2197bd[_0xf8da('0x3c')]['offset']);}_0x152685[_0xf8da('0x46')]=qs[_0xf8da('0x47')](_0x2197bd[_0xf8da('0x3c')][_0xf8da('0x47')]);_0x152685[_0xf8da('0x48')]=qs[_0xf8da('0x3e')](_[_0xf8da('0x49')](_0x2197bd['query'],_0x5232c1[_0xf8da('0x3e')]),_0xc2c159);if(_0x2197bd[_0xf8da('0x3c')]['filter']){_0x152685[_0xf8da('0x48')]=_[_0xf8da('0x4a')](_0x152685['where'],{'$or':_[_0xf8da('0x37')](_0xc2c159,function(_0x5285a6){if(_0x5285a6[_0xf8da('0x4b')]!==_0xf8da('0x4c')){var _0xe58b07={};_0xe58b07[_0x5285a6['name']]={'$like':'%'+_0x2197bd['query'][_0xf8da('0x4d')]+'%'};return _0xe58b07;}})});}_0x152685=_['merge']({},_0x152685,_0x2197bd[_0xf8da('0x4e')]);var _0x4cb7f2={'where':_0x152685[_0xf8da('0x48')]};return db[_0xf8da('0x4f')][_0xf8da('0x2c')](_0x4cb7f2)[_0xf8da('0x31')](function(_0x243381){_0x274153[_0xf8da('0x2c')]=_0x243381;if(_0x2197bd[_0xf8da('0x3c')][_0xf8da('0x50')]){_0x152685['include']=[{'all':!![]}];}return db[_0xf8da('0x4f')][_0xf8da('0x51')](_0x152685);})['then'](function(_0x1ca860){_0x274153[_0xf8da('0x52')]=_0x1ca860;return _0x274153;})[_0xf8da('0x31')](respondWithFilteredResult(_0x32f675,_0x152685))[_0xf8da('0x27')](handleError(_0x32f675,null));};exports[_0xf8da('0x53')]=function(_0x523dae,_0x569a74){var _0x5a9801={'raw':!![],'where':{'id':_0x523dae[_0xf8da('0x54')]['id']}},_0x58e32d={};_0x58e32d[_0xf8da('0x3b')]=_['keys'](db['ChatMessage'][_0xf8da('0x38')]);_0x58e32d[_0xf8da('0x3c')]=_[_0xf8da('0x3d')](_0x523dae[_0xf8da('0x3c')]);_0x58e32d[_0xf8da('0x3e')]=_[_0xf8da('0x3f')](_0x58e32d[_0xf8da('0x3b')],_0x58e32d[_0xf8da('0x3c')]);_0x5a9801[_0xf8da('0x40')]=_['intersection'](_0x58e32d['model'],qs['fields'](_0x523dae['query'][_0xf8da('0x41')]));_0x5a9801[_0xf8da('0x40')]=_0x5a9801[_0xf8da('0x40')][_0xf8da('0x42')]?_0x5a9801[_0xf8da('0x40')]:_0x58e32d['model'];if(_0x523dae['query'][_0xf8da('0x50')]){_0x5a9801[_0xf8da('0x55')]=[{'all':!![]}];}_0x5a9801=_[_0xf8da('0x4a')]({},_0x5a9801,_0x523dae[_0xf8da('0x4e')]);return db[_0xf8da('0x4f')]['find'](_0x5a9801)[_0xf8da('0x31')](handleEntityNotFound(_0x569a74,null))[_0xf8da('0x31')](respondWithResult(_0x569a74,null))[_0xf8da('0x27')](handleError(_0x569a74,null));};exports[_0xf8da('0x56')]=function(_0x464827,_0x10b788){return db[_0xf8da('0x4f')][_0xf8da('0x56')](_0x464827[_0xf8da('0x57')],{})[_0xf8da('0x31')](respondWithResult(_0x10b788,0xc9))['catch'](handleError(_0x10b788,null));};exports[_0xf8da('0x30')]=function(_0xa7b60a,_0x5aa8b3){if(_0xa7b60a['body']['id']){delete _0xa7b60a[_0xf8da('0x57')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xa7b60a[_0xf8da('0x54')]['id']}})[_0xf8da('0x31')](handleEntityNotFound(_0x5aa8b3,null))[_0xf8da('0x31')](saveUpdates(_0xa7b60a[_0xf8da('0x57')],null))[_0xf8da('0x31')](respondWithResult(_0x5aa8b3,null))['catch'](handleError(_0x5aa8b3,null));};exports[_0xf8da('0x32')]=function(_0x470fbc,_0x5071e6){return db['ChatMessage'][_0xf8da('0x58')]({'where':{'id':_0x470fbc[_0xf8da('0x54')]['id']}})[_0xf8da('0x31')](handleEntityNotFound(_0x5071e6,null))[_0xf8da('0x31')](removeEntity(_0x5071e6,null))[_0xf8da('0x27')](handleError(_0x5071e6,null));};exports[_0xf8da('0x59')]=function(_0x4d488b,_0x3c06fb){return db['ChatMessage']['describe']()['then'](respondWithResult(_0x3c06fb,null))[_0xf8da('0x27')](handleError(_0x3c06fb,null));};var interaction_log=require(_0xf8da('0x11'))(_0xf8da('0x5a'));exports[_0xf8da('0x5b')]=function(_0x108474,_0x1a58b3,_0xb569a5){var _0x5a046d={'agent':{},'channel':_0xf8da('0x5c')};if(_0x108474[_0xf8da('0x57')]['id']){delete _0x108474['body']['id'];}_0x108474['body'][_0xf8da('0x5d')]=!![];_0x108474[_0xf8da('0x57')][_0xf8da('0x5e')]=moment()[_0xf8da('0x5f')](_0xf8da('0x60'));_0x108474[_0xf8da('0x57')]['UserId']=_0x108474[_0xf8da('0x57')]['UserId']||_0x108474[_0xf8da('0x61')]['id'];_0x5a046d[_0xf8da('0x62')]['id']=_0x108474[_0xf8da('0x57')][_0xf8da('0x63')];return db[_0xf8da('0x4f')][_0xf8da('0x58')]({'where':{'id':_0x108474[_0xf8da('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1a58b3,null))['then'](saveUpdates(_0x108474[_0xf8da('0x57')],null))[_0xf8da('0x31')](function(_0x44a2fb){if(_0x44a2fb){_0x5a046d[_0xf8da('0x26')]=_0x44a2fb[_0xf8da('0x64')]({'plain':!![]});return db[_0xf8da('0x65')][_0xf8da('0x58')]({'where':{'id':_0x44a2fb[_0xf8da('0x66')]}});}return null;})[_0xf8da('0x31')](handleEntityNotFound(_0x1a58b3,null))[_0xf8da('0x31')](function(_0x32d47f){if(_0x32d47f){return _0x32d47f['update']({'UserId':_0x108474[_0xf8da('0x57')][_0xf8da('0x63')],'read1stAt':_['isNil'](_0x32d47f['read1stAt'])?moment()[_0xf8da('0x5f')](_0xf8da('0x60')):undefined});}return null;})[_0xf8da('0x31')](function(_0x47a56e){if(_0x47a56e){_0x5a046d['interaction']=_0x47a56e[_0xf8da('0x64')]({'plain':!![]});interaction_log[_0xf8da('0x1e')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x108474[_0xf8da('0x61')]['id'],_0x108474['user'][_0xf8da('0x34')],_0x108474['user'][_0xf8da('0x67')],_0x5a046d['interaction']['id'],_0x108474[_0xf8da('0x57')]?JSON[_0xf8da('0x22')](_0x108474[_0xf8da('0x57')]):_0xf8da('0x68'));return respondWithRpcPromise(_0xf8da('0x69'),_0xf8da('0x6a'),_0x5a046d);}return null;})[_0xf8da('0x31')](function(_0x5ed54b){var _0x7ba011=_0xf8da('0x6b')+_0x5ed54b[_0xf8da('0x26')][_0xf8da('0x6c')];return db[_0xf8da('0x6d')][_0xf8da('0x3c')](_0x7ba011,{'type':db[_0xf8da('0x6e')][_0xf8da('0x6f')]['SELECT'],'raw':!![]})['then'](function(_0x503b7b){return _0x503b7b;});})['then'](function(_0x18ecb8){if(_0x18ecb8){_0x5a046d['message'][_0xf8da('0x70')]=_0x18ecb8[0x0];if(!_0x108474['body'][_0xf8da('0x63')])return;return db[_0xf8da('0x71')][_0xf8da('0x58')]({'where':{'id':_0x108474[_0xf8da('0x57')][_0xf8da('0x63')],'role':_0xf8da('0x62')},'attributes':['id',_0xf8da('0x34'),_0xf8da('0x72'),'email',_0xf8da('0x73')],'raw':!![]});}return null;})[_0xf8da('0x31')](function(_0x54c43f){if(!_0x54c43f)return null;_0x5a046d[_0xf8da('0x26')]['agent']=_0x54c43f;return _0x5a046d;})['then'](function(_0x5a83bf){if(_0x5a83bf){if(_0x108474[_0xf8da('0x57')][_0xf8da('0x74')]){_0x5a046d['message'][_0xf8da('0x75')]=util[_0xf8da('0x5f')](_0xf8da('0x76'),_0x108474[_0xf8da('0x61')]['name']);_0x5a046d['message'][_0xf8da('0x77')]=_0x5a046d['channel'];_0x5a046d[_0xf8da('0x26')]['event']='accept';return respondWithRpcPromise(_0xf8da('0x78'),'EventManager',{'event':_0xf8da('0x79'),'message':_[_0xf8da('0x4a')](_0x5a046d[_0xf8da('0x26')],JSON[_0xf8da('0x7a')](_0x5a046d[_0xf8da('0x7b')]['formData']))},client9002)['then'](function(){return _0x5a046d;});}return _0x5a046d;}return null;})['then'](respondWithResult(_0x1a58b3,null))[_0xf8da('0x27')](handleError(_0x1a58b3,null));};var interaction_log=require(_0xf8da('0x11'))(_0xf8da('0x5a'));exports[_0xf8da('0x7c')]=function(_0x129731,_0x322a86,_0x42bcce){var _0x2fef31={'agent':{},'channel':'chat'};if(_0x129731['body']['id']){delete _0x129731[_0xf8da('0x57')]['id'];}_0x129731[_0xf8da('0x57')][_0xf8da('0x63')]=_0x129731[_0xf8da('0x57')]['UserId']||_0x129731['user']['id'];_0x2fef31['agent']['id']=_0x129731[_0xf8da('0x57')]['UserId'];return db[_0xf8da('0x4f')]['find']({'where':{'id':_0x129731[_0xf8da('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x322a86,null))[_0xf8da('0x31')](function(_0x32ec14){if(_0x32ec14){_0x2fef31['message']=_0x32ec14[_0xf8da('0x64')]({'plain':!![]});return db['ChatInteraction'][_0xf8da('0x58')]({'where':{'id':_0x32ec14['ChatInteractionId']}});}return null;})[_0xf8da('0x31')](handleEntityNotFound(_0x322a86,null))[_0xf8da('0x31')](function(_0x572c6a){if(_0x572c6a){_0x2fef31[_0xf8da('0x7b')]=_0x572c6a[_0xf8da('0x64')]({'plain':!![]});interaction_log[_0xf8da('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x129731['user']['id'],_0x129731[_0xf8da('0x61')][_0xf8da('0x34')],_0x129731[_0xf8da('0x61')][_0xf8da('0x67')],_0x2fef31['interaction']['id'],_0x129731['body']?JSON[_0xf8da('0x22')](_0x129731[_0xf8da('0x57')]):_0xf8da('0x68'));return respondWithRpcPromise(_0xf8da('0x7d'),'rejectMessage',_0x2fef31);}return null;})[_0xf8da('0x31')](function(_0x4f54c8){var _0x3c0e52=_0xf8da('0x6b')+_0x4f54c8[_0xf8da('0x26')]['ContactId'];return db[_0xf8da('0x6d')]['query'](_0x3c0e52,{'type':db[_0xf8da('0x6e')][_0xf8da('0x6f')][_0xf8da('0x7e')],'raw':!![]})[_0xf8da('0x31')](function(_0x1b92ef){return _0x1b92ef;});})[_0xf8da('0x31')](function(_0x535a66){if(_0x535a66){_0x2fef31[_0xf8da('0x26')][_0xf8da('0x70')]=_0x535a66[0x0];if(!_0x129731[_0xf8da('0x57')][_0xf8da('0x63')])return;return db[_0xf8da('0x71')][_0xf8da('0x58')]({'where':{'id':_0x129731['body'][_0xf8da('0x63')],'role':_0xf8da('0x62')},'attributes':['id',_0xf8da('0x34'),_0xf8da('0x72'),_0xf8da('0x7f'),'internal'],'raw':!![]});}return null;})[_0xf8da('0x31')](function(_0xb5569d){if(!_0xb5569d)return null;_0x2fef31[_0xf8da('0x26')][_0xf8da('0x62')]=_0xb5569d;return _0x2fef31;})[_0xf8da('0x31')](function(_0x5c1eb0){if(_0x5c1eb0){_0x5c1eb0[_0xf8da('0x26')][_0xf8da('0x75')]=util[_0xf8da('0x5f')](_0xf8da('0x76'),_0x129731[_0xf8da('0x61')][_0xf8da('0x34')]);_0x5c1eb0[_0xf8da('0x26')][_0xf8da('0x77')]=_0x2fef31[_0xf8da('0x77')];_0x5c1eb0['message'][_0xf8da('0x80')]=_0xf8da('0x7c');respondWithRpcPromise(_0xf8da('0x78'),'EventManager',{'event':_0xf8da('0x81'),'message':_[_0xf8da('0x4a')](_0x2fef31['message'],JSON['parse'](_0x2fef31[_0xf8da('0x7b')]['formData']))},client9002);return _0x2fef31;}return null;})[_0xf8da('0x31')](respondWithResult(_0x322a86,null))[_0xf8da('0x27')](handleError(_0x322a86,null));};
\ No newline at end of file
+var _0x7c1a=['debug','stringify','error','code','message','info','result','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','sendStatus','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','rows','catch','show','params','length','include','create','body','find','destroy','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x5ec0a8,_0x46c1c9){var _0x4b536d=function(_0x5e8841){while(--_0x5e8841){_0x5ec0a8['push'](_0x5ec0a8['shift']());}};_0x4b536d(++_0x46c1c9);}(_0x7c1a,0x159));var _0xa7c1=function(_0x4d1bbc,_0x369b91){_0x4d1bbc=_0x4d1bbc-0x0;var _0x4a38a9=_0x7c1a[_0x4d1bbc];return _0x4a38a9;};'use strict';var emlformat=require(_0xa7c1('0x0'));var rimraf=require(_0xa7c1('0x1'));var zipdir=require(_0xa7c1('0x2'));var jsonpatch=require(_0xa7c1('0x3'));var rp=require(_0xa7c1('0x4'));var moment=require(_0xa7c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa7c1('0x6'));var util=require(_0xa7c1('0x7'));var path=require('path');var sox=require(_0xa7c1('0x8'));var csv=require('to-csv');var ejs=require(_0xa7c1('0x9'));var fs=require('fs');var fs_extra=require(_0xa7c1('0xa'));var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0xe'));var querystring=require(_0xa7c1('0xf'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0x10'));var authService=require(_0xa7c1('0x11'));var qs=require(_0xa7c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x13'));var logger=require(_0xa7c1('0x14'))('api');var utils=require(_0xa7c1('0x15'));var config=require(_0xa7c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7c1('0x17'))['db'];config[_0xa7c1('0x18')]=_[_0xa7c1('0x19')](config[_0xa7c1('0x18')],{'host':_0xa7c1('0x1a'),'port':0x18eb});var socket=require(_0xa7c1('0x1b'))(new Redis(config[_0xa7c1('0x18')]));require(_0xa7c1('0x1c'))[_0xa7c1('0x1d')](socket);var jayson=require(_0xa7c1('0x1e'));var client=jayson[_0xa7c1('0x1f')][_0xa7c1('0x20')]({'port':0x232c});var client9002=jayson[_0xa7c1('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xba02b,_0x3a6f47,_0x1790c3,_0x1ca843){return new BPromise(function(_0x84244a,_0x5a92d9){var _0x3b77af=_0x1ca843||client;return _0x3b77af['request'](_0xba02b,_0x1790c3)[_0xa7c1('0x21')](function(_0x337db4){logger['info'](_0xa7c1('0x22'),_0x3a6f47,_0xa7c1('0x23'));logger[_0xa7c1('0x24')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3a6f47,_0xa7c1('0x23'),JSON[_0xa7c1('0x25')](_0x337db4));if(_0x337db4[_0xa7c1('0x26')]){if(_0x337db4[_0xa7c1('0x26')][_0xa7c1('0x27')]===0x1f4){logger[_0xa7c1('0x26')](_0xa7c1('0x22'),_0x3a6f47,_0x337db4[_0xa7c1('0x26')][_0xa7c1('0x28')]);return _0x5a92d9(_0x337db4['error'][_0xa7c1('0x28')]);}logger[_0xa7c1('0x26')](_0xa7c1('0x22'),_0x3a6f47,_0x337db4['error'][_0xa7c1('0x28')]);return _0x84244a(_0x337db4[_0xa7c1('0x26')][_0xa7c1('0x28')]);}else{logger[_0xa7c1('0x29')](_0xa7c1('0x22'),_0x3a6f47,_0xa7c1('0x23'));_0x84244a(_0x337db4[_0xa7c1('0x2a')]['message']);}})['catch'](function(_0x48280a){logger[_0xa7c1('0x26')](_0xa7c1('0x22'),_0x3a6f47,_0x48280a);_0x5a92d9(_0x48280a);});});}function respondWithStatusCode(_0xd17267,_0x153b1a){_0x153b1a=_0x153b1a||0xcc;return function(_0x94884d){if(_0x94884d){return _0xd17267['sendStatus'](_0x153b1a);}return _0xd17267['status'](_0x153b1a)[_0xa7c1('0x2b')]();};}function respondWithResult(_0x2726e9,_0xc60f7c){_0xc60f7c=_0xc60f7c||0xc8;return function(_0x59b3f5){if(_0x59b3f5){return _0x2726e9[_0xa7c1('0x2c')](_0xc60f7c)[_0xa7c1('0x2d')](_0x59b3f5);}};}function respondWithFilteredResult(_0x2fe45b,_0xa8a937){return function(_0x635792){if(_0x635792){var _0x1cc05c=typeof _0xa8a937[_0xa7c1('0x2e')]===_0xa7c1('0x2f')&&typeof _0xa8a937[_0xa7c1('0x30')]===_0xa7c1('0x2f');var _0x599b08=_0x635792[_0xa7c1('0x31')];var _0x924b93=_0x1cc05c?0x0:_0xa8a937[_0xa7c1('0x2e')];var _0x40ad2b=_0x1cc05c?_0x635792[_0xa7c1('0x31')]:_0xa8a937[_0xa7c1('0x2e')]+_0xa8a937[_0xa7c1('0x30')];var _0x6af68e;if(_0x40ad2b>=_0x599b08){_0x40ad2b=_0x599b08;_0x6af68e=0xc8;}else{_0x6af68e=0xce;}_0x2fe45b[_0xa7c1('0x2c')](_0x6af68e);return _0x2fe45b['set'](_0xa7c1('0x32'),_0x924b93+'-'+_0x40ad2b+'/'+_0x599b08)[_0xa7c1('0x2d')](_0x635792);}return null;};}function patchUpdates(_0x6533b2){return function(_0x27feee){try{jsonpatch['apply'](_0x27feee,_0x6533b2,!![]);}catch(_0x5c8956){return BPromise[_0xa7c1('0x33')](_0x5c8956);}return _0x27feee[_0xa7c1('0x34')]();};}function saveUpdates(_0x28371e,_0x57b905){return function(_0x496116){if(_0x496116){return _0x496116[_0xa7c1('0x35')](_0x28371e)[_0xa7c1('0x21')](function(_0x5182ca){return _0x5182ca;});}return null;};}function removeEntity(_0x1dc655,_0x55e4e0){return function(_0x2c1569){if(_0x2c1569){return _0x2c1569['destroy']()[_0xa7c1('0x21')](function(){_0x1dc655[_0xa7c1('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8fd6,_0x1a7261){return function(_0x18e7fc){if(!_0x18e7fc){_0x4d8fd6[_0xa7c1('0x36')](0x194);}return _0x18e7fc;};}function handleError(_0x410682,_0x821e1a){_0x821e1a=_0x821e1a||0x1f4;return function(_0x156f56){logger[_0xa7c1('0x26')](_0x156f56['stack']);if(_0x156f56[_0xa7c1('0x37')]){delete _0x156f56[_0xa7c1('0x37')];}_0x410682[_0xa7c1('0x2c')](_0x821e1a)[_0xa7c1('0x38')](_0x156f56);};}exports[_0xa7c1('0x39')]=function(_0x396748,_0x4b88d4){var _0x3e1a41={},_0x27d462={},_0x2eaf6c={'count':0x0,'rows':[]};var _0x1125f8=_[_0xa7c1('0x3a')](db[_0xa7c1('0x3b')][_0xa7c1('0x3c')],function(_0xff58c3){return{'name':_0xff58c3['fieldName'],'type':_0xff58c3[_0xa7c1('0x3d')][_0xa7c1('0x3e')]};});_0x27d462[_0xa7c1('0x3f')]=_[_0xa7c1('0x3a')](_0x1125f8,_0xa7c1('0x37'));_0x27d462[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x396748[_0xa7c1('0x40')]);_0x27d462[_0xa7c1('0x42')]=_[_0xa7c1('0x43')](_0x27d462[_0xa7c1('0x3f')],_0x27d462[_0xa7c1('0x40')]);_0x3e1a41[_0xa7c1('0x44')]=_[_0xa7c1('0x43')](_0x27d462[_0xa7c1('0x3f')],qs[_0xa7c1('0x45')](_0x396748[_0xa7c1('0x40')]['fields']));_0x3e1a41[_0xa7c1('0x44')]=_0x3e1a41[_0xa7c1('0x44')]['length']?_0x3e1a41[_0xa7c1('0x44')]:_0x27d462[_0xa7c1('0x3f')];if(!_0x396748[_0xa7c1('0x40')][_0xa7c1('0x46')]('nolimit')){_0x3e1a41[_0xa7c1('0x30')]=qs['limit'](_0x396748['query'][_0xa7c1('0x30')]);_0x3e1a41[_0xa7c1('0x2e')]=qs[_0xa7c1('0x2e')](_0x396748[_0xa7c1('0x40')][_0xa7c1('0x2e')]);}_0x3e1a41['order']=qs[_0xa7c1('0x47')](_0x396748[_0xa7c1('0x40')][_0xa7c1('0x47')]);_0x3e1a41['where']=qs['filters'](_[_0xa7c1('0x48')](_0x396748[_0xa7c1('0x40')],_0x27d462['filters']),_0x1125f8);if(_0x396748[_0xa7c1('0x40')][_0xa7c1('0x49')]){_0x3e1a41[_0xa7c1('0x4a')]=_[_0xa7c1('0x4b')](_0x3e1a41[_0xa7c1('0x4a')],{'$or':_['map'](_0x1125f8,function(_0x404362){if(_0x404362[_0xa7c1('0x3d')]!==_0xa7c1('0x4c')){var _0x1bf445={};_0x1bf445[_0x404362[_0xa7c1('0x37')]]={'$like':'%'+_0x396748['query'][_0xa7c1('0x49')]+'%'};return _0x1bf445;}})});}_0x3e1a41=_[_0xa7c1('0x4b')]({},_0x3e1a41,_0x396748[_0xa7c1('0x4d')]);var _0x41d56e={'where':_0x3e1a41[_0xa7c1('0x4a')]};return db[_0xa7c1('0x3b')]['count'](_0x41d56e)[_0xa7c1('0x21')](function(_0xa0159){_0x2eaf6c[_0xa7c1('0x31')]=_0xa0159;if(_0x396748[_0xa7c1('0x40')]['includeAll']){_0x3e1a41['include']=[{'all':!![]}];}return db[_0xa7c1('0x3b')]['findAll'](_0x3e1a41);})[_0xa7c1('0x21')](function(_0x12c578){_0x2eaf6c[_0xa7c1('0x4e')]=_0x12c578;return _0x2eaf6c;})['then'](respondWithFilteredResult(_0x4b88d4,_0x3e1a41))[_0xa7c1('0x4f')](handleError(_0x4b88d4,null));};exports[_0xa7c1('0x50')]=function(_0x5cae17,_0x4ea4b1){var _0x42edd0={'raw':!![],'where':{'id':_0x5cae17[_0xa7c1('0x51')]['id']}},_0x311fa2={};_0x311fa2['model']=_[_0xa7c1('0x41')](db[_0xa7c1('0x3b')][_0xa7c1('0x3c')]);_0x311fa2[_0xa7c1('0x40')]=_[_0xa7c1('0x41')](_0x5cae17['query']);_0x311fa2['filters']=_[_0xa7c1('0x43')](_0x311fa2[_0xa7c1('0x3f')],_0x311fa2['query']);_0x42edd0['attributes']=_[_0xa7c1('0x43')](_0x311fa2[_0xa7c1('0x3f')],qs['fields'](_0x5cae17[_0xa7c1('0x40')]['fields']));_0x42edd0['attributes']=_0x42edd0[_0xa7c1('0x44')][_0xa7c1('0x52')]?_0x42edd0[_0xa7c1('0x44')]:_0x311fa2['model'];if(_0x5cae17[_0xa7c1('0x40')]['includeAll']){_0x42edd0[_0xa7c1('0x53')]=[{'all':!![]}];}_0x42edd0=_[_0xa7c1('0x4b')]({},_0x42edd0,_0x5cae17['options']);return db[_0xa7c1('0x3b')]['find'](_0x42edd0)[_0xa7c1('0x21')](handleEntityNotFound(_0x4ea4b1,null))[_0xa7c1('0x21')](respondWithResult(_0x4ea4b1,null))['catch'](handleError(_0x4ea4b1,null));};exports[_0xa7c1('0x54')]=function(_0x532e5f,_0x7b81b9){return db[_0xa7c1('0x3b')][_0xa7c1('0x54')](_0x532e5f[_0xa7c1('0x55')],{})['then'](respondWithResult(_0x7b81b9,0xc9))[_0xa7c1('0x4f')](handleError(_0x7b81b9,null));};exports[_0xa7c1('0x35')]=function(_0x583063,_0x5c3955){if(_0x583063[_0xa7c1('0x55')]['id']){delete _0x583063[_0xa7c1('0x55')]['id'];}return db[_0xa7c1('0x3b')][_0xa7c1('0x56')]({'where':{'id':_0x583063[_0xa7c1('0x51')]['id']}})[_0xa7c1('0x21')](handleEntityNotFound(_0x5c3955,null))[_0xa7c1('0x21')](saveUpdates(_0x583063[_0xa7c1('0x55')],null))[_0xa7c1('0x21')](respondWithResult(_0x5c3955,null))['catch'](handleError(_0x5c3955,null));};exports[_0xa7c1('0x57')]=function(_0x1b6d5e,_0x409d97){return db[_0xa7c1('0x3b')]['find']({'where':{'id':_0x1b6d5e[_0xa7c1('0x51')]['id']}})['then'](handleEntityNotFound(_0x409d97,null))['then'](removeEntity(_0x409d97,null))[_0xa7c1('0x4f')](handleError(_0x409d97,null));};exports[_0xa7c1('0x58')]=function(_0x17b559,_0x1afe8b){return db[_0xa7c1('0x3b')][_0xa7c1('0x58')]()[_0xa7c1('0x21')](respondWithResult(_0x1afe8b,null))[_0xa7c1('0x4f')](handleError(_0x1afe8b,null));};var interaction_log=require(_0xa7c1('0x14'))(_0xa7c1('0x59'));exports['accept']=function(_0x1cb85d,_0x66fde3,_0x26f891){var _0x531582={'agent':{},'channel':_0xa7c1('0x5a')};if(_0x1cb85d['body']['id']){delete _0x1cb85d['body']['id'];}_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5b')]=!![];_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5c')]=moment()[_0xa7c1('0x5d')](_0xa7c1('0x5e'));_0x1cb85d['body']['UserId']=_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5f')]||_0x1cb85d['user']['id'];_0x531582[_0xa7c1('0x60')]['id']=_0x1cb85d['body'][_0xa7c1('0x5f')];return db[_0xa7c1('0x3b')][_0xa7c1('0x56')]({'where':{'id':_0x1cb85d[_0xa7c1('0x51')]['id'],'UserId':null}})[_0xa7c1('0x21')](handleEntityNotFound(_0x66fde3,null))['then'](saveUpdates(_0x1cb85d['body'],null))[_0xa7c1('0x21')](function(_0x3a24d3){if(_0x3a24d3){_0x531582[_0xa7c1('0x28')]=_0x3a24d3[_0xa7c1('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xa7c1('0x56')]({'where':{'id':_0x3a24d3['ChatInteractionId']}});}return null;})[_0xa7c1('0x21')](handleEntityNotFound(_0x66fde3,null))[_0xa7c1('0x21')](function(_0x3b0f9c){if(_0x3b0f9c){return _0x3b0f9c[_0xa7c1('0x35')]({'UserId':_0x1cb85d[_0xa7c1('0x55')][_0xa7c1('0x5f')],'read1stAt':_['isNil'](_0x3b0f9c['read1stAt'])?moment()['format'](_0xa7c1('0x5e')):undefined});}return null;})[_0xa7c1('0x21')](function(_0x263ef2){if(_0x263ef2){_0x531582[_0xa7c1('0x62')]=_0x263ef2[_0xa7c1('0x61')]({'plain':!![]});interaction_log[_0xa7c1('0x29')](_0xa7c1('0x63'),_0x1cb85d[_0xa7c1('0x64')]['id'],_0x1cb85d[_0xa7c1('0x64')][_0xa7c1('0x37')],_0x1cb85d[_0xa7c1('0x64')][_0xa7c1('0x65')],_0x531582[_0xa7c1('0x62')]['id'],_0x1cb85d[_0xa7c1('0x55')]?JSON[_0xa7c1('0x25')](_0x1cb85d[_0xa7c1('0x55')]):'null');return respondWithRpcPromise(_0xa7c1('0x66'),'acceptMessage',_0x531582);}return null;})[_0xa7c1('0x21')](function(_0x72ce4d){var _0x49e90b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x72ce4d[_0xa7c1('0x28')][_0xa7c1('0x67')];return db[_0xa7c1('0x68')][_0xa7c1('0x40')](_0x49e90b,{'type':db[_0xa7c1('0x69')][_0xa7c1('0x6a')][_0xa7c1('0x6b')],'raw':!![]})['then'](function(_0x48045b){return _0x48045b;});})[_0xa7c1('0x21')](function(_0x4006fe){if(_0x4006fe){_0x531582[_0xa7c1('0x28')][_0xa7c1('0x6c')]=_0x4006fe[0x0];if(!_0x1cb85d[_0xa7c1('0x55')]['UserId'])return;return db[_0xa7c1('0x6d')][_0xa7c1('0x56')]({'where':{'id':_0x1cb85d[_0xa7c1('0x55')]['UserId'],'role':_0xa7c1('0x60')},'attributes':['id','name',_0xa7c1('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0xa7c1('0x21')](function(_0x49d606){if(!_0x49d606)return null;_0x531582[_0xa7c1('0x28')][_0xa7c1('0x60')]=_0x49d606;return _0x531582;})[_0xa7c1('0x21')](function(_0xf3f3e6){if(_0xf3f3e6){if(_0x1cb85d['body'][_0xa7c1('0x6f')]){_0x531582[_0xa7c1('0x28')][_0xa7c1('0x70')]=util[_0xa7c1('0x5d')](_0xa7c1('0x71'),_0x1cb85d[_0xa7c1('0x64')][_0xa7c1('0x37')]);_0x531582[_0xa7c1('0x28')][_0xa7c1('0x72')]=_0x531582[_0xa7c1('0x72')];_0x531582['message']['event']='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0xa7c1('0x73'),'message':_[_0xa7c1('0x4b')](_0x531582[_0xa7c1('0x28')],JSON[_0xa7c1('0x74')](_0x531582['interaction'][_0xa7c1('0x75')]))},client9002)['then'](function(){return _0x531582;});}return _0x531582;}return null;})[_0xa7c1('0x21')](respondWithResult(_0x66fde3,null))[_0xa7c1('0x4f')](handleError(_0x66fde3,null));};var interaction_log=require(_0xa7c1('0x14'))(_0xa7c1('0x59'));exports[_0xa7c1('0x33')]=function(_0x3655b6,_0x2c741f,_0x29ffc2){var _0x2b7e75={'agent':{},'channel':_0xa7c1('0x5a')};if(_0x3655b6[_0xa7c1('0x55')]['id']){delete _0x3655b6[_0xa7c1('0x55')]['id'];}_0x3655b6[_0xa7c1('0x55')][_0xa7c1('0x5f')]=_0x3655b6[_0xa7c1('0x55')][_0xa7c1('0x5f')]||_0x3655b6['user']['id'];_0x2b7e75['agent']['id']=_0x3655b6[_0xa7c1('0x55')][_0xa7c1('0x5f')];return db[_0xa7c1('0x3b')][_0xa7c1('0x56')]({'where':{'id':_0x3655b6[_0xa7c1('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c741f,null))['then'](function(_0x147f73){if(_0x147f73){_0x2b7e75['message']=_0x147f73[_0xa7c1('0x61')]({'plain':!![]});return db[_0xa7c1('0x76')][_0xa7c1('0x56')]({'where':{'id':_0x147f73['ChatInteractionId']}});}return null;})[_0xa7c1('0x21')](handleEntityNotFound(_0x2c741f,null))[_0xa7c1('0x21')](function(_0x5c02d0){if(_0x5c02d0){_0x2b7e75[_0xa7c1('0x62')]=_0x5c02d0[_0xa7c1('0x61')]({'plain':!![]});interaction_log[_0xa7c1('0x29')](_0xa7c1('0x77'),_0x3655b6[_0xa7c1('0x64')]['id'],_0x3655b6[_0xa7c1('0x64')][_0xa7c1('0x37')],_0x3655b6['user']['role'],_0x2b7e75[_0xa7c1('0x62')]['id'],_0x3655b6[_0xa7c1('0x55')]?JSON['stringify'](_0x3655b6[_0xa7c1('0x55')]):_0xa7c1('0x78'));return respondWithRpcPromise(_0xa7c1('0x79'),_0xa7c1('0x7a'),_0x2b7e75);}return null;})[_0xa7c1('0x21')](function(_0x2cb10b){var _0x47b21f=_0xa7c1('0x7b')+_0x2cb10b['message'][_0xa7c1('0x67')];return db[_0xa7c1('0x68')][_0xa7c1('0x40')](_0x47b21f,{'type':db[_0xa7c1('0x69')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x2ee9f6){return _0x2ee9f6;});})[_0xa7c1('0x21')](function(_0x322f97){if(_0x322f97){_0x2b7e75[_0xa7c1('0x28')][_0xa7c1('0x6c')]=_0x322f97[0x0];if(!_0x3655b6[_0xa7c1('0x55')]['UserId'])return;return db[_0xa7c1('0x6d')]['find']({'where':{'id':_0x3655b6['body'][_0xa7c1('0x5f')],'role':_0xa7c1('0x60')},'attributes':['id',_0xa7c1('0x37'),_0xa7c1('0x6e'),'email',_0xa7c1('0x7c')],'raw':!![]});}return null;})[_0xa7c1('0x21')](function(_0x2874df){if(!_0x2874df)return null;_0x2b7e75[_0xa7c1('0x28')]['agent']=_0x2874df;return _0x2b7e75;})[_0xa7c1('0x21')](function(_0x4735a4){if(_0x4735a4){_0x4735a4['message'][_0xa7c1('0x70')]=util[_0xa7c1('0x5d')](_0xa7c1('0x71'),_0x3655b6[_0xa7c1('0x64')][_0xa7c1('0x37')]);_0x4735a4[_0xa7c1('0x28')][_0xa7c1('0x72')]=_0x2b7e75['channel'];_0x4735a4[_0xa7c1('0x28')][_0xa7c1('0x7d')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0xa7c1('0x7e'),'message':_[_0xa7c1('0x4b')](_0x2b7e75[_0xa7c1('0x28')],JSON[_0xa7c1('0x74')](_0x2b7e75[_0xa7c1('0x62')][_0xa7c1('0x75')]))},client9002);return _0x2b7e75;}return null;})[_0xa7c1('0x21')](respondWithResult(_0x2c741f,null))['catch'](handleError(_0x2c741f,null));};
\ No newline at end of file
index 18eabe4..cafb648 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ab=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit'];(function(_0x53d326,_0x169358){var _0x564849=function(_0x339be8){while(--_0x339be8){_0x53d326['push'](_0x53d326['shift']());}};_0x564849(++_0x169358);}(_0xe2ab,0x99));var _0xbe2a=function(_0x48ff3f,_0x5d2739){_0x48ff3f=_0x48ff3f-0x0;var _0x4bad25=_0xe2ab[_0x48ff3f];return _0x4bad25;};'use strict';var EventEmitter=require(_0xbe2a('0x0'));var ChatMessage=require(_0xbe2a('0x1'))['db'][_0xbe2a('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbe2a('0x3')](0x0);var events={'afterCreate':_0xbe2a('0x4'),'afterUpdate':_0xbe2a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3767e9){return function(_0xe55b1,_0x4bff5a,_0x2c0714){ChatMessageEvents[_0xbe2a('0x6')](_0x3767e9+':'+_0xe55b1['id'],_0xe55b1);ChatMessageEvents[_0xbe2a('0x6')](_0x3767e9,_0xe55b1);_0x2c0714(null);};}for(var e in events){if(events[_0xbe2a('0x7')](e)){var event=events[e];ChatMessage[_0xbe2a('0x8')](e,emitEvent(event));}}module[_0xbe2a('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0x4dce=['events','../../mysqldb','ChatMessage','update','remove','emit','hasOwnProperty','hook'];(function(_0x50ee80,_0x4eb140){var _0x27c452=function(_0x224846){while(--_0x224846){_0x50ee80['push'](_0x50ee80['shift']());}};_0x27c452(++_0x4eb140);}(_0x4dce,0x168));var _0xe4dc=function(_0x3ae96c,_0x5f1e7e){_0x3ae96c=_0x3ae96c-0x0;var _0x1b0c90=_0x4dce[_0x3ae96c];return _0x1b0c90;};'use strict';var EventEmitter=require(_0xe4dc('0x0'));var ChatMessage=require(_0xe4dc('0x1'))['db'][_0xe4dc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4dc('0x3'),'afterDestroy':_0xe4dc('0x4')};function emitEvent(_0x49940f){return function(_0xedaf06,_0x39a1ec,_0x2d536e){ChatMessageEvents[_0xe4dc('0x5')](_0x49940f+':'+_0xedaf06['id'],_0xedaf06);ChatMessageEvents['emit'](_0x49940f,_0xedaf06);_0x2d536e(null);};}for(var e in events){if(events[_0xe4dc('0x6')](e)){var event=events[e];ChatMessage[_0xe4dc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 39a572f..1641594 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3a4=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xb3a4,0x1c2));var _0x4b3a=function(_0x4524b4,_0x17fbea){_0x4524b4=_0x4524b4-0x0;var _0x5152dc=_0xb3a4[_0x4524b4];return _0x5152dc;};'use strict';var _=require(_0x4b3a('0x0'));var util=require(_0x4b3a('0x1'));var logger=require('../../config/logger')(_0x4b3a('0x2'));var moment=require(_0x4b3a('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b3a('0x4'));var fs=require('fs');var path=require(_0x4b3a('0x5'));var rimraf=require(_0x4b3a('0x6'));var config=require(_0x4b3a('0x7'));var attributes=require(_0x4b3a('0x8'));module[_0x4b3a('0x9')]=function(_0x582819,_0x4d9c60){return _0x582819[_0x4b3a('0xa')](_0x4b3a('0xb'),attributes,{'tableName':_0x4b3a('0xc'),'paranoid':![],'indexes':[{'name':_0x4b3a('0xd'),'fields':[_0x4b3a('0xe')],'type':_0x4b3a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d2a29,_0x56582e,_0x4cd49d){var _0x4fb4d9=_0x582819['models'];var _0x238f6d=_0x4d2a29[_0x4b3a('0x10')]({'plain':!![]});if(_0x238f6d[_0x4b3a('0x11')][_0x4b3a('0x12')]()==='in'||_0x238f6d['direction'][_0x4b3a('0x12')]()===_0x4b3a('0x13')&&!_0x238f6d[_0x4b3a('0x14')]&&!_[_0x4b3a('0x15')](_0x238f6d['UserId'])){_0x4fb4d9['ChatInteraction'][_0x4b3a('0x16')]({'where':{'id':_0x238f6d[_0x4b3a('0x17')]}})[_0x4b3a('0x18')](function(_0x220f88){if(_0x220f88){_0x220f88[_0x4b3a('0x19')]({'lastMsgAt':_0x238f6d[_0x4b3a('0x1a')],'lastMsgDirection':_0x238f6d[_0x4b3a('0x11')]['toLowerCase']()});}})[_0x4b3a('0x1b')](function(_0x492b6d){console[_0x4b3a('0x1c')](_0x492b6d);});}_0x4cd49d();}},'charset':_0x4b3a('0x1d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0a25=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x53b92f,_0x11def7){var _0x479ae3=function(_0x108fd2){while(--_0x108fd2){_0x53b92f['push'](_0x53b92f['shift']());}};_0x479ae3(++_0x11def7);}(_0x0a25,0x68));var _0x50a2=function(_0x27cfff,_0x468e33){_0x27cfff=_0x27cfff-0x0;var _0x4051cc=_0x0a25[_0x27cfff];return _0x4051cc;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var logger=require('../../config/logger')(_0x50a2('0x2'));var moment=require(_0x50a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x50a2('0x4'));var fs=require('fs');var path=require(_0x50a2('0x5'));var rimraf=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var attributes=require(_0x50a2('0x8'));module[_0x50a2('0x9')]=function(_0x33fef7,_0x8b6ba4){return _0x33fef7[_0x50a2('0xa')](_0x50a2('0xb'),attributes,{'tableName':_0x50a2('0xc'),'paranoid':![],'indexes':[{'name':_0x50a2('0xd'),'fields':[_0x50a2('0xe')],'type':_0x50a2('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x312b6c,_0x1aed2f,_0x40ccae){var _0x201e9d=_0x33fef7['models'];var _0x1862ce=_0x312b6c[_0x50a2('0x10')]({'plain':!![]});if(_0x1862ce[_0x50a2('0x11')][_0x50a2('0x12')]()==='in'||_0x1862ce[_0x50a2('0x11')][_0x50a2('0x12')]()==='out'&&!_0x1862ce[_0x50a2('0x13')]&&!_[_0x50a2('0x14')](_0x1862ce[_0x50a2('0x15')])){_0x201e9d[_0x50a2('0x16')][_0x50a2('0x17')]({'where':{'id':_0x1862ce[_0x50a2('0x18')]}})[_0x50a2('0x19')](function(_0x4062c4){if(_0x4062c4){_0x4062c4['update']({'lastMsgAt':_0x1862ce['createdAt'],'lastMsgDirection':_0x1862ce['direction'][_0x50a2('0x12')]()});}})[_0x50a2('0x1a')](function(_0x209e2f){console['error'](_0x209e2f);});}_0x40ccae();}},'charset':_0x50a2('0x1b'),'collate':_0x50a2('0x1c')});};
\ No newline at end of file
index f453ef1..16ea7f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c21=['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','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x3c21,0x19e));var _0x13c2=function(_0x168cd5,_0x19bc1c){_0x168cd5=_0x168cd5-0x0;var _0x250a57=_0x3c21[_0x168cd5];return _0x250a57;};'use strict';var _=require('lodash');var util=require(_0x13c2('0x0'));var moment=require('moment');var BPromise=require(_0x13c2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c2('0x2'));var db=require(_0x13c2('0x3'))['db'];var utils=require(_0x13c2('0x4'));var logger=require(_0x13c2('0x5'))('rpc');var config=require(_0x13c2('0x6'));var jayson=require(_0x13c2('0x7'));var client=jayson[_0x13c2('0x8')][_0x13c2('0x9')]({'port':0x232a});config[_0x13c2('0xa')]=_[_0x13c2('0xb')](config[_0x13c2('0xa')],{'host':_0x13c2('0xc'),'port':0x18eb});var socket=require(_0x13c2('0xd'))(new Redis(config[_0x13c2('0xa')]));require(_0x13c2('0xe'))[_0x13c2('0xf')](socket);function respondWithRpcPromise(_0x2798fd,_0x56d82b,_0x5de0f9){return new BPromise(function(_0x48969a,_0x520710){return client[_0x13c2('0x10')](_0x2798fd,_0x5de0f9)['then'](function(_0x3b7e96){logger[_0x13c2('0x11')](_0x13c2('0x12'),_0x56d82b,_0x13c2('0x13'));logger[_0x13c2('0x14')](_0x13c2('0x15'),_0x56d82b,_0x13c2('0x13'),JSON[_0x13c2('0x16')](_0x3b7e96));if(_0x3b7e96[_0x13c2('0x17')]){if(_0x3b7e96[_0x13c2('0x17')][_0x13c2('0x18')]===0x1f4){logger['error'](_0x13c2('0x12'),_0x56d82b,_0x3b7e96['error'][_0x13c2('0x19')]);return _0x520710(_0x3b7e96[_0x13c2('0x17')]['message']);}logger[_0x13c2('0x17')](_0x13c2('0x12'),_0x56d82b,_0x3b7e96['error'][_0x13c2('0x19')]);return _0x48969a(_0x3b7e96['error'][_0x13c2('0x19')]);}else{logger[_0x13c2('0x11')](_0x13c2('0x12'),_0x56d82b,_0x13c2('0x13'));_0x48969a(_0x3b7e96[_0x13c2('0x1a')][_0x13c2('0x19')]);}})[_0x13c2('0x1b')](function(_0x26a756){logger[_0x13c2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x56d82b,_0x26a756);_0x520710(_0x26a756);});});}exports[_0x13c2('0x1c')]=function(_0x31ed09){var _0x53baff=this;return new Promise(function(_0x2bef69,_0x5aa153){return db[_0x13c2('0x1d')][_0x13c2('0x1e')](_0x31ed09['body'],{'raw':_0x31ed09[_0x13c2('0x1f')]?_0x31ed09[_0x13c2('0x1f')][_0x13c2('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0xd4b287){logger[_0x13c2('0x11')](_0x13c2('0x1c'),_0x31ed09);logger[_0x13c2('0x14')](_0x13c2('0x1c'),_0x31ed09,JSON['stringify'](_0xd4b287));_0x2bef69(_0xd4b287);})['catch'](function(_0x270f0a){logger['error'](_0x13c2('0x1c'),_0x270f0a[_0x13c2('0x19')],_0x31ed09);_0x5aa153(_0x53baff['error'](0x1f4,_0x270f0a[_0x13c2('0x19')]));});});};
\ No newline at end of file
+var _0xe1f5=['ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','create','options','raw','CreateChatMessage','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x38bd99,_0x1e8c4a){var _0x1a9c8a=function(_0x3d9f57){while(--_0x3d9f57){_0x38bd99['push'](_0x38bd99['shift']());}};_0x1a9c8a(++_0x1e8c4a);}(_0xe1f5,0x1ec));var _0x5e1f=function(_0x2453d2,_0x538ab9){_0x2453d2=_0x2453d2-0x0;var _0x269727=_0xe1f5[_0x2453d2];return _0x269727;};'use strict';var _=require(_0x5e1f('0x0'));var util=require(_0x5e1f('0x1'));var moment=require('moment');var BPromise=require(_0x5e1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e1f('0x3'));var db=require(_0x5e1f('0x4'))['db'];var utils=require(_0x5e1f('0x5'));var logger=require(_0x5e1f('0x6'))('rpc');var config=require(_0x5e1f('0x7'));var jayson=require(_0x5e1f('0x8'));var client=jayson[_0x5e1f('0x9')][_0x5e1f('0xa')]({'port':0x232a});config[_0x5e1f('0xb')]=_[_0x5e1f('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e1f('0xd'))(new Redis(config[_0x5e1f('0xb')]));require(_0x5e1f('0xe'))['register'](socket);function respondWithRpcPromise(_0x1108f3,_0x1213ee,_0x1ab549){return new BPromise(function(_0x7a2ebc,_0x5d0057){return client[_0x5e1f('0xf')](_0x1108f3,_0x1ab549)[_0x5e1f('0x10')](function(_0x17e9bb){logger[_0x5e1f('0x11')](_0x5e1f('0x12'),_0x1213ee,'request\x20sent');logger[_0x5e1f('0x13')](_0x5e1f('0x14'),_0x1213ee,_0x5e1f('0x15'),JSON[_0x5e1f('0x16')](_0x17e9bb));if(_0x17e9bb[_0x5e1f('0x17')]){if(_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x18')]===0x1f4){logger['error'](_0x5e1f('0x12'),_0x1213ee,_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x19')]);return _0x5d0057(_0x17e9bb[_0x5e1f('0x17')]['message']);}logger[_0x5e1f('0x17')](_0x5e1f('0x12'),_0x1213ee,_0x17e9bb['error'][_0x5e1f('0x19')]);return _0x7a2ebc(_0x17e9bb[_0x5e1f('0x17')][_0x5e1f('0x19')]);}else{logger[_0x5e1f('0x11')]('ChatMessage,\x20%s,\x20%s',_0x1213ee,_0x5e1f('0x15'));_0x7a2ebc(_0x17e9bb[_0x5e1f('0x1a')][_0x5e1f('0x19')]);}})[_0x5e1f('0x1b')](function(_0x516b8c){logger[_0x5e1f('0x17')](_0x5e1f('0x12'),_0x1213ee,_0x516b8c);_0x5d0057(_0x516b8c);});});}exports['CreateChatMessage']=function(_0x3a9d50){var _0x496293=this;return new Promise(function(_0x4d7b56,_0x2d2710){return db['ChatMessage'][_0x5e1f('0x1c')](_0x3a9d50['body'],{'raw':_0x3a9d50[_0x5e1f('0x1d')]?_0x3a9d50['options'][_0x5e1f('0x1e')]===undefined?!![]:![]:!![]})[_0x5e1f('0x10')](function(_0x3cc3ec){logger[_0x5e1f('0x11')]('CreateChatMessage',_0x3a9d50);logger['debug'](_0x5e1f('0x1f'),_0x3a9d50,JSON[_0x5e1f('0x16')](_0x3cc3ec));_0x4d7b56(_0x3cc3ec);})['catch'](function(_0x35795d){logger[_0x5e1f('0x17')]('CreateChatMessage',_0x35795d[_0x5e1f('0x19')],_0x3a9d50);_0x2d2710(_0x496293[_0x5e1f('0x17')](0x1f4,_0x35795d['message']));});});};
\ No newline at end of file
index ac2da4f..63cd73d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcba=['length','./chatMessage.events','save','update','emit','register'];(function(_0x844e0b,_0x426374){var _0x1c2c9f=function(_0x266468){while(--_0x266468){_0x844e0b['push'](_0x844e0b['shift']());}};_0x1c2c9f(++_0x426374);}(_0xbcba,0x6d));var _0xabcb=function(_0x53575e,_0x279a15){_0x53575e=_0x53575e-0x0;var _0x221c39=_0xbcba[_0x53575e];return _0x221c39;};'use strict';var ChatMessageEvents=require(_0xabcb('0x0'));var events=[_0xabcb('0x1'),'remove',_0xabcb('0x2')];function createListener(_0x2c9ee7,_0x2034d2){return function(_0xcbe337){_0x2034d2[_0xabcb('0x3')](_0x2c9ee7,_0xcbe337);};}function removeListener(_0x3e3b9b,_0x5e10df){return function(){ChatMessageEvents['removeListener'](_0x3e3b9b,_0x5e10df);};}exports[_0xabcb('0x4')]=function(_0x1290b2){for(var _0x5c706e=0x0,_0x5322e7=events[_0xabcb('0x5')];_0x5c706e<_0x5322e7;_0x5c706e++){var _0x192b36=events[_0x5c706e];var _0x5e693d=createListener('chatMessage:'+_0x192b36,_0x1290b2);ChatMessageEvents['on'](_0x192b36,_0x5e693d);}};
\ No newline at end of file
+var _0x8ca9=['length','chatMessage:','./chatMessage.events','save','remove','update','register'];(function(_0x528ddb,_0x217878){var _0x1c66af=function(_0x50c3af){while(--_0x50c3af){_0x528ddb['push'](_0x528ddb['shift']());}};_0x1c66af(++_0x217878);}(_0x8ca9,0x9c));var _0x98ca=function(_0x49e835,_0x899b00){_0x49e835=_0x49e835-0x0;var _0x5d5249=_0x8ca9[_0x49e835];return _0x5d5249;};'use strict';var ChatMessageEvents=require(_0x98ca('0x0'));var events=[_0x98ca('0x1'),_0x98ca('0x2'),_0x98ca('0x3')];function createListener(_0x3d9153,_0x22047f){return function(_0xe479d6){_0x22047f['emit'](_0x3d9153,_0xe479d6);};}function removeListener(_0x4c230f,_0x142793){return function(){ChatMessageEvents['removeListener'](_0x4c230f,_0x142793);};}exports[_0x98ca('0x4')]=function(_0x48415d){for(var _0x219619=0x0,_0xca4097=events[_0x98ca('0x5')];_0x219619<_0xca4097;_0x219619++){var _0x2852a0=events[_0x219619];var _0x323c95=createListener(_0x98ca('0x6')+_0x2852a0,_0x48415d);ChatMessageEvents['on'](_0x2852a0,_0x323c95);}};
\ No newline at end of file
index 754b541..6e364af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaf7=['chatmessage:create','create','put','update','/:id/accept','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked','chat'];(function(_0x2d0630,_0x1ca7d6){var _0x36a13e=function(_0x45fd78){while(--_0x45fd78){_0x2d0630['push'](_0x2d0630['shift']());}};_0x36a13e(++_0x1ca7d6);}(_0xdaf7,0x174));var _0x7daf=function(_0x39f7b5,_0x1a764d){_0x39f7b5=_0x39f7b5-0x0;var _0x2c3c5e=_0xdaf7[_0x39f7b5];return _0x2c3c5e;};'use strict';var multer=require(_0x7daf('0x0'));var util=require(_0x7daf('0x1'));var path=require(_0x7daf('0x2'));var timeout=require(_0x7daf('0x3'));var express=require(_0x7daf('0x4'));var router=express[_0x7daf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7daf('0x6'));var interaction=require(_0x7daf('0x7'));var config=require(_0x7daf('0x8'));var controller=require(_0x7daf('0x9'));router[_0x7daf('0xa')]('/',auth[_0x7daf('0xb')](),controller[_0x7daf('0xc')]);router['get']('/describe',auth[_0x7daf('0xb')](),controller['describe']);router[_0x7daf('0xa')](_0x7daf('0xd'),auth['isAuthenticated'](),controller[_0x7daf('0xe')]);router[_0x7daf('0xf')]('/',auth[_0x7daf('0xb')](),interaction[_0x7daf('0x10')](_0x7daf('0x11'),_0x7daf('0x12')),controller[_0x7daf('0x13')]);router[_0x7daf('0x14')]('/:id',controller[_0x7daf('0x15')]);router[_0x7daf('0x14')](_0x7daf('0x16'),auth['isAuthenticated'](),controller['accept']);router[_0x7daf('0x14')]('/:id/reject',auth[_0x7daf('0xb')](),controller[_0x7daf('0x17')]);router['delete'](_0x7daf('0xd'),auth[_0x7daf('0xb')](),controller[_0x7daf('0x18')]);module[_0x7daf('0x19')]=router;
\ No newline at end of file
+var _0xa69c=['tracked','chat','chatmessage:create','put','/:id','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','post'];(function(_0x5a306f,_0x82e4db){var _0x2bc4e5=function(_0x339009){while(--_0x339009){_0x5a306f['push'](_0x5a306f['shift']());}};_0x2bc4e5(++_0x82e4db);}(_0xa69c,0x137));var _0xca69=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0xa69c[_0x2e249d];return _0x1faa37;};'use strict';var multer=require(_0xca69('0x0'));var util=require(_0xca69('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xca69('0x2'));var interaction=require(_0xca69('0x3'));var config=require(_0xca69('0x4'));var controller=require(_0xca69('0x5'));router[_0xca69('0x6')]('/',auth['isAuthenticated'](),controller[_0xca69('0x7')]);router['get'](_0xca69('0x8'),auth[_0xca69('0x9')](),controller['describe']);router['get']('/:id',auth[_0xca69('0x9')](),controller['show']);router[_0xca69('0xa')]('/',auth[_0xca69('0x9')](),interaction[_0xca69('0xb')](_0xca69('0xc'),_0xca69('0xd')),controller['create']);router[_0xca69('0xe')](_0xca69('0xf'),controller[_0xca69('0x10')]);router[_0xca69('0xe')](_0xca69('0x11'),auth[_0xca69('0x9')](),controller[_0xca69('0x12')]);router[_0xca69('0xe')]('/:id/reject',auth['isAuthenticated'](),controller[_0xca69('0x13')]);router[_0xca69('0x14')](_0xca69('0xf'),auth[_0xca69('0x9')](),controller[_0xca69('0x15')]);module[_0xca69('0x16')]=router;
\ No newline at end of file
index b86ea24..016e027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c97=['exports','TEXT','medium','sequelize'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x9c97,0x11b));var _0x79c9=function(_0x3aaba5,_0x5e4dcd){_0x3aaba5=_0x3aaba5-0x0;var _0x54f08f=_0x9c97[_0x3aaba5];return _0x54f08f;};'use strict';var Sequelize=require(_0x79c9('0x0'));module[_0x79c9('0x1')]={'body':{'type':Sequelize[_0x79c9('0x2')](_0x79c9('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xb6b6=['exports','TEXT','medium','sequelize'];(function(_0x5924ad,_0x111d9c){var _0x334a3e=function(_0x35d9d1){while(--_0x35d9d1){_0x5924ad['push'](_0x5924ad['shift']());}};_0x334a3e(++_0x111d9c);}(_0xb6b6,0xff));var _0x6b6b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb6b6[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0x6b6b('0x0'));module[_0x6b6b('0x1')]={'body':{'type':Sequelize[_0x6b6b('0x2')](_0x6b6b('0x3')),'allowNull':![]}};
\ No newline at end of file
index 1ff933b..217b33a 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(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x7a54,0x106));var _0x47a5=function(_0x464ef2,_0x12db9d){_0x464ef2=_0x464ef2-0x0;var _0x3ac67d=_0x7a54[_0x464ef2];return _0x3ac67d;};'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(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x7a54,0x106));var _0x47a5=function(_0x47b865,_0x3d923a){_0x47b865=_0x47b865-0x0;var _0x263ecc=_0x7a54[_0x47b865];return _0x263ecc;};'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 78b00a2..44bb649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1ac=['chat_offline_messages','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x35b85f,_0x451e07){var _0x156a3a=function(_0x5bd0c4){while(--_0x5bd0c4){_0x35b85f['push'](_0x35b85f['shift']());}};_0x156a3a(++_0x451e07);}(_0xa1ac,0x195));var _0xca1a=function(_0x5d46d6,_0x26fb62){_0x5d46d6=_0x5d46d6-0x0;var _0x366f74=_0xa1ac[_0x5d46d6];return _0x366f74;};'use strict';var _=require('lodash');var util=require(_0xca1a('0x0'));var logger=require(_0xca1a('0x1'))(_0xca1a('0x2'));var moment=require('moment');var BPromise=require(_0xca1a('0x3'));var rp=require(_0xca1a('0x4'));var fs=require('fs');var path=require(_0xca1a('0x5'));var rimraf=require('rimraf');var config=require(_0xca1a('0x6'));var attributes=require(_0xca1a('0x7'));module[_0xca1a('0x8')]=function(_0x3b98a9,_0xa9f164){return _0x3b98a9[_0xca1a('0x9')](_0xca1a('0xa'),attributes,{'tableName':_0xca1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xca1a('0xc')});};
\ No newline at end of file
+var _0x64ea=['../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x64ea,0x85));var _0xa64e=function(_0x84a189,_0x323ae4){_0x84a189=_0x84a189-0x0;var _0x476af8=_0x64ea[_0x84a189];return _0x476af8;};'use strict';var _=require(_0xa64e('0x0'));var util=require(_0xa64e('0x1'));var logger=require('../../config/logger')(_0xa64e('0x2'));var moment=require(_0xa64e('0x3'));var BPromise=require(_0xa64e('0x4'));var rp=require(_0xa64e('0x5'));var fs=require('fs');var path=require(_0xa64e('0x6'));var rimraf=require('rimraf');var config=require(_0xa64e('0x7'));var attributes=require(_0xa64e('0x8'));module[_0xa64e('0x9')]=function(_0x2de147,_0xdf2e51){return _0x2de147[_0xa64e('0xa')](_0xa64e('0xb'),attributes,{'tableName':_0xa64e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa64e('0xd')});};
\ No newline at end of file
index c71e0a0..f00e0f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f42=['jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5aac41,_0x21d386){var _0x491e33=function(_0x392029){while(--_0x392029){_0x5aac41['push'](_0x5aac41['shift']());}};_0x491e33(++_0x21d386);}(_0x0f42,0xc9));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require(_0x20f4('0x6'))(_0x20f4('0x7'));var config=require(_0x20f4('0x8'));var jayson=require(_0x20f4('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb16012,_0x4befb9,_0x2e27b5){return new BPromise(function(_0x2cf4c5,_0x4241ed){return client[_0x20f4('0xa')](_0xb16012,_0x2e27b5)[_0x20f4('0xb')](function(_0x14b79a){logger[_0x20f4('0xc')](_0x20f4('0xd'),_0x4befb9,_0x20f4('0xe'));logger[_0x20f4('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x4befb9,_0x20f4('0xe'),JSON['stringify'](_0x14b79a));if(_0x14b79a[_0x20f4('0x10')]){if(_0x14b79a['error'][_0x20f4('0x11')]===0x1f4){logger[_0x20f4('0x10')](_0x20f4('0xd'),_0x4befb9,_0x14b79a[_0x20f4('0x10')][_0x20f4('0x12')]);return _0x4241ed(_0x14b79a[_0x20f4('0x10')]['message']);}logger[_0x20f4('0x10')](_0x20f4('0xd'),_0x4befb9,_0x14b79a['error'][_0x20f4('0x12')]);return _0x2cf4c5(_0x14b79a[_0x20f4('0x10')][_0x20f4('0x12')]);}else{logger[_0x20f4('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4befb9,_0x20f4('0xe'));_0x2cf4c5(_0x14b79a[_0x20f4('0x13')]['message']);}})[_0x20f4('0x14')](function(_0x7b83b9){logger[_0x20f4('0x10')](_0x20f4('0xd'),_0x4befb9,_0x7b83b9);_0x4241ed(_0x7b83b9);});});}
\ No newline at end of file
+var _0x5862=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2d819b,_0x321af5){var _0x3799fd=function(_0x50090b){while(--_0x50090b){_0x2d819b['push'](_0x2d819b['shift']());}};_0x3799fd(++_0x321af5);}(_0x5862,0xd8));var _0x2586=function(_0x885280,_0x342370){_0x885280=_0x885280-0x0;var _0xfeef11=_0x5862[_0x885280];return _0xfeef11;};'use strict';var _=require(_0x2586('0x0'));var util=require(_0x2586('0x1'));var moment=require(_0x2586('0x2'));var BPromise=require(_0x2586('0x3'));var rs=require(_0x2586('0x4'));var fs=require('fs');var Redis=require(_0x2586('0x5'));var db=require(_0x2586('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2586('0x7'));var config=require('../../config/environment');var jayson=require(_0x2586('0x8'));var client=jayson['client'][_0x2586('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37cc5d,_0x4c80d4,_0x105893){return new BPromise(function(_0x367972,_0x47e1ff){return client[_0x2586('0xa')](_0x37cc5d,_0x105893)[_0x2586('0xb')](function(_0x58dc10){logger[_0x2586('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4c80d4,_0x2586('0xd'));logger['debug'](_0x2586('0xe'),_0x4c80d4,_0x2586('0xd'),JSON[_0x2586('0xf')](_0x58dc10));if(_0x58dc10['error']){if(_0x58dc10[_0x2586('0x10')][_0x2586('0x11')]===0x1f4){logger[_0x2586('0x10')](_0x2586('0x12'),_0x4c80d4,_0x58dc10[_0x2586('0x10')][_0x2586('0x13')]);return _0x47e1ff(_0x58dc10['error'][_0x2586('0x13')]);}logger[_0x2586('0x10')](_0x2586('0x12'),_0x4c80d4,_0x58dc10[_0x2586('0x10')][_0x2586('0x13')]);return _0x367972(_0x58dc10[_0x2586('0x10')]['message']);}else{logger[_0x2586('0xc')](_0x2586('0x12'),_0x4c80d4,_0x2586('0xd'));_0x367972(_0x58dc10[_0x2586('0x14')][_0x2586('0x13')]);}})['catch'](function(_0x205ec5){logger[_0x2586('0x10')](_0x2586('0x12'),_0x4c80d4,_0x205ec5);_0x47e1ff(_0x205ec5);});});}
\ No newline at end of file
index 666392c..3b82be9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3206=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x18ed39,_0x4f697b){var _0x39eced=function(_0x4b7251){while(--_0x4b7251){_0x18ed39['push'](_0x18ed39['shift']());}};_0x39eced(++_0x4f697b);}(_0x3206,0xfb));var _0x6320=function(_0x514a08,_0x28a8c7){_0x514a08=_0x514a08-0x0;var _0x8da53a=_0x3206[_0x514a08];return _0x8da53a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6320('0x0'));var timeout=require(_0x6320('0x1'));var express=require('express');var router=express[_0x6320('0x2')]();var fs_extra=require(_0x6320('0x3'));var auth=require(_0x6320('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6320('0x5'));var controller=require(_0x6320('0x6'));router[_0x6320('0x7')]('/',auth[_0x6320('0x8')](),controller[_0x6320('0x9')]);router['get'](_0x6320('0xa'),auth[_0x6320('0x8')](),controller[_0x6320('0xb')]);router[_0x6320('0x7')](_0x6320('0xc'),auth[_0x6320('0x8')](),controller[_0x6320('0xd')]);router[_0x6320('0xe')]('/',auth[_0x6320('0x8')](),controller[_0x6320('0xf')]);router[_0x6320('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6320('0x11')]);router[_0x6320('0x12')](_0x6320('0xc'),auth['isAuthenticated'](),controller[_0x6320('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa11e=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xa11e,0x17f));var _0xea11=function(_0x493f9d,_0x1ecb90){_0x493f9d=_0x493f9d-0x0;var _0x1bf985=_0xa11e[_0x493f9d];return _0x1bf985;};'use strict';var multer=require(_0xea11('0x0'));var util=require(_0xea11('0x1'));var path=require(_0xea11('0x2'));var timeout=require(_0xea11('0x3'));var express=require('express');var router=express[_0xea11('0x4')]();var fs_extra=require(_0xea11('0x5'));var auth=require(_0xea11('0x6'));var interaction=require(_0xea11('0x7'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router[_0xea11('0x8')]('/',auth[_0xea11('0x9')](),controller[_0xea11('0xa')]);router[_0xea11('0x8')](_0xea11('0xb'),auth[_0xea11('0x9')](),controller[_0xea11('0xc')]);router[_0xea11('0x8')](_0xea11('0xd'),auth[_0xea11('0x9')](),controller[_0xea11('0xe')]);router[_0xea11('0xf')]('/',auth[_0xea11('0x9')](),controller['create']);router[_0xea11('0x10')](_0xea11('0xd'),auth[_0xea11('0x9')](),controller[_0xea11('0x11')]);router[_0xea11('0x12')](_0xea11('0xd'),auth[_0xea11('0x9')](),controller[_0xea11('0x13')]);module[_0xea11('0x14')]=router;
\ No newline at end of file
index 048d5d1..0ad540a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe845=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x549448,_0x4a0a4b){var _0x2b2cfe=function(_0x50c47a){while(--_0x50c47a){_0x549448['push'](_0x549448['shift']());}};_0x2b2cfe(++_0x4a0a4b);}(_0xe845,0xcb));var _0x5e84=function(_0x466b50,_0x28a05b){_0x466b50=_0x466b50-0x0;var _0xb1c2ed=_0xe845[_0x466b50];return _0xb1c2ed;};'use strict';var Sequelize=require(_0x5e84('0x0'));module[_0x5e84('0x1')]={'name':{'type':Sequelize[_0x5e84('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5e84('0x3'),_0x5e84('0x4')),'defaultValue':_0x5e84('0x3')},'selector':{'type':Sequelize[_0x5e84('0x2')]},'timeout':{'type':Sequelize[_0x5e84('0x5')]}};
\ No newline at end of file
+var _0xbd0e=['mouseOver','exports','STRING'];(function(_0x3e2756,_0x159e1d){var _0x39a4d1=function(_0x5d9380){while(--_0x5d9380){_0x3e2756['push'](_0x3e2756['shift']());}};_0x39a4d1(++_0x159e1d);}(_0xbd0e,0x85));var _0xebd0=function(_0x499001,_0x3f27ae){_0x499001=_0x499001-0x0;var _0x320c65=_0xbd0e[_0x499001];return _0x320c65;};'use strict';var Sequelize=require('sequelize');module[_0xebd0('0x0')]={'name':{'type':Sequelize[_0xebd0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xebd0('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 412d079..08134d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde64=['keys','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','show','model','ChatProactiveAction','rawAttributes','query'];(function(_0x302e46,_0x1a5a45){var _0x4412fc=function(_0x3330f9){while(--_0x3330f9){_0x302e46['push'](_0x302e46['shift']());}};_0x4412fc(++_0x1a5a45);}(_0xde64,0x17c));var _0x4de6=function(_0x6ca423,_0x4c922d){_0x6ca423=_0x6ca423-0x0;var _0xc2c299=_0xde64[_0x6ca423];return _0xc2c299;};'use strict';var emlformat=require(_0x4de6('0x0'));var rimraf=require(_0x4de6('0x1'));var zipdir=require(_0x4de6('0x2'));var jsonpatch=require(_0x4de6('0x3'));var rp=require(_0x4de6('0x4'));var moment=require(_0x4de6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4de6('0x6'));var util=require(_0x4de6('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4de6('0x8'));var ejs=require(_0x4de6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4de6('0xa'));var crypto=require(_0x4de6('0xb'));var jsforce=require(_0x4de6('0xc'));var deskjs=require(_0x4de6('0xd'));var toCsv=require(_0x4de6('0x8'));var querystring=require(_0x4de6('0xe'));var Papa=require('papaparse');var Redis=require(_0x4de6('0xf'));var authService=require(_0x4de6('0x10'));var qs=require(_0x4de6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4de6('0x12'));var logger=require(_0x4de6('0x13'))(_0x4de6('0x14'));var utils=require(_0x4de6('0x15'));var config=require(_0x4de6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4de6('0x17'))['db'];function respondWithStatusCode(_0x3baa31,_0xb8e256){_0xb8e256=_0xb8e256||0xcc;return function(_0x509002){if(_0x509002){return _0x3baa31[_0x4de6('0x18')](_0xb8e256);}return _0x3baa31[_0x4de6('0x19')](_0xb8e256)[_0x4de6('0x1a')]();};}function respondWithResult(_0x2bd121,_0x58b0c1){_0x58b0c1=_0x58b0c1||0xc8;return function(_0x1ccfee){if(_0x1ccfee){return _0x2bd121[_0x4de6('0x19')](_0x58b0c1)[_0x4de6('0x1b')](_0x1ccfee);}};}function respondWithFilteredResult(_0x4dd3b5,_0x33fd67){return function(_0x54e2f2){if(_0x54e2f2){var _0x4cbb5c=typeof _0x33fd67[_0x4de6('0x1c')]===_0x4de6('0x1d')&&typeof _0x33fd67[_0x4de6('0x1e')]===_0x4de6('0x1d');var _0x37975a=_0x54e2f2[_0x4de6('0x1f')];var _0x324202=_0x4cbb5c?0x0:_0x33fd67['offset'];var _0x420f7c=_0x4cbb5c?_0x54e2f2[_0x4de6('0x1f')]:_0x33fd67[_0x4de6('0x1c')]+_0x33fd67[_0x4de6('0x1e')];var _0x167c7c;if(_0x420f7c>=_0x37975a){_0x420f7c=_0x37975a;_0x167c7c=0xc8;}else{_0x167c7c=0xce;}_0x4dd3b5[_0x4de6('0x19')](_0x167c7c);return _0x4dd3b5[_0x4de6('0x20')](_0x4de6('0x21'),_0x324202+'-'+_0x420f7c+'/'+_0x37975a)[_0x4de6('0x1b')](_0x54e2f2);}return null;};}function patchUpdates(_0x15c923){return function(_0x4c4d13){try{jsonpatch[_0x4de6('0x22')](_0x4c4d13,_0x15c923,!![]);}catch(_0x51ad13){return BPromise[_0x4de6('0x23')](_0x51ad13);}return _0x4c4d13[_0x4de6('0x24')]();};}function saveUpdates(_0x43771b,_0x5de99f){return function(_0xe1b69d){if(_0xe1b69d){return _0xe1b69d['update'](_0x43771b)[_0x4de6('0x25')](function(_0x385cae){return _0x385cae;});}return null;};}function removeEntity(_0x1a64e9,_0x5ddbab){return function(_0x478d83){if(_0x478d83){return _0x478d83[_0x4de6('0x26')]()[_0x4de6('0x25')](function(){_0x1a64e9[_0x4de6('0x19')](0xcc)[_0x4de6('0x1a')]();});}};}function handleEntityNotFound(_0x25a76b,_0x13dacf){return function(_0x5cbecd){if(!_0x5cbecd){_0x25a76b[_0x4de6('0x18')](0x194);}return _0x5cbecd;};}function handleError(_0x69e2dd,_0x426a15){_0x426a15=_0x426a15||0x1f4;return function(_0x327215){logger[_0x4de6('0x27')](_0x327215[_0x4de6('0x28')]);if(_0x327215[_0x4de6('0x29')]){delete _0x327215[_0x4de6('0x29')];}_0x69e2dd[_0x4de6('0x19')](_0x426a15)['send'](_0x327215);};}exports[_0x4de6('0x2a')]=function(_0x2a5592,_0x333983){var _0x29618d={'raw':!![],'where':{'id':_0x2a5592['params']['id']}},_0x24a0a7={};_0x24a0a7[_0x4de6('0x2b')]=_['keys'](db[_0x4de6('0x2c')][_0x4de6('0x2d')]);_0x24a0a7[_0x4de6('0x2e')]=_[_0x4de6('0x2f')](_0x2a5592['query']);_0x24a0a7['filters']=_['intersection'](_0x24a0a7['model'],_0x24a0a7['query']);_0x29618d[_0x4de6('0x30')]=_[_0x4de6('0x31')](_0x24a0a7[_0x4de6('0x2b')],qs[_0x4de6('0x32')](_0x2a5592[_0x4de6('0x2e')][_0x4de6('0x32')]));_0x29618d[_0x4de6('0x30')]=_0x29618d[_0x4de6('0x30')][_0x4de6('0x33')]?_0x29618d[_0x4de6('0x30')]:_0x24a0a7[_0x4de6('0x2b')];if(_0x2a5592[_0x4de6('0x2e')][_0x4de6('0x34')]){_0x29618d[_0x4de6('0x35')]=[{'all':!![]}];}_0x29618d=_[_0x4de6('0x36')]({},_0x29618d,_0x2a5592[_0x4de6('0x37')]);return db[_0x4de6('0x2c')][_0x4de6('0x38')](_0x29618d)[_0x4de6('0x25')](handleEntityNotFound(_0x333983,null))[_0x4de6('0x25')](respondWithResult(_0x333983,null))[_0x4de6('0x39')](handleError(_0x333983,null));};exports[_0x4de6('0x3a')]=function(_0x47285b,_0x2631c9){return db[_0x4de6('0x2c')][_0x4de6('0x3a')](_0x47285b[_0x4de6('0x3b')],{})[_0x4de6('0x25')](respondWithResult(_0x2631c9,0xc9))[_0x4de6('0x39')](handleError(_0x2631c9,null));};exports['update']=function(_0x17907c,_0x11a83d){if(_0x17907c[_0x4de6('0x3b')]['id']){delete _0x17907c[_0x4de6('0x3b')]['id'];}return db['ChatProactiveAction'][_0x4de6('0x38')]({'where':{'id':_0x17907c[_0x4de6('0x3c')]['id']}})[_0x4de6('0x25')](handleEntityNotFound(_0x11a83d,null))[_0x4de6('0x25')](saveUpdates(_0x17907c['body'],null))[_0x4de6('0x25')](respondWithResult(_0x11a83d,null))['catch'](handleError(_0x11a83d,null));};exports[_0x4de6('0x26')]=function(_0x4006b3,_0x1d8498){return db[_0x4de6('0x2c')][_0x4de6('0x38')]({'where':{'id':_0x4006b3[_0x4de6('0x3c')]['id']}})[_0x4de6('0x25')](handleEntityNotFound(_0x1d8498,null))[_0x4de6('0x25')](removeEntity(_0x1d8498,null))[_0x4de6('0x39')](handleError(_0x1d8498,null));};
\ No newline at end of file
+var _0xc92f=['ChatProactiveAction','find','catch','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x219a5f,_0x484570){var _0x1d6398=function(_0x377347){while(--_0x377347){_0x219a5f['push'](_0x219a5f['shift']());}};_0x1d6398(++_0x484570);}(_0xc92f,0xf3));var _0xfc92=function(_0x19bb98,_0x310023){_0x19bb98=_0x19bb98-0x0;var _0x32c5a0=_0xc92f[_0x19bb98];return _0x32c5a0;};'use strict';var emlformat=require(_0xfc92('0x0'));var rimraf=require(_0xfc92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc92('0x2'));var rp=require(_0xfc92('0x3'));var moment=require(_0xfc92('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc92('0x5'));var util=require(_0xfc92('0x6'));var path=require(_0xfc92('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc92('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc92('0x9'));var squel=require('squel');var crypto=require(_0xfc92('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfc92('0xb'));var toCsv=require(_0xfc92('0xc'));var querystring=require(_0xfc92('0xd'));var Papa=require('papaparse');var Redis=require(_0xfc92('0xe'));var authService=require(_0xfc92('0xf'));var qs=require(_0xfc92('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc92('0x11'));var logger=require(_0xfc92('0x12'))(_0xfc92('0x13'));var utils=require(_0xfc92('0x14'));var config=require(_0xfc92('0x15'));var licenseUtil=require(_0xfc92('0x16'));var db=require(_0xfc92('0x17'))['db'];function respondWithStatusCode(_0x17b4e6,_0x115a0f){_0x115a0f=_0x115a0f||0xcc;return function(_0x75fb72){if(_0x75fb72){return _0x17b4e6[_0xfc92('0x18')](_0x115a0f);}return _0x17b4e6[_0xfc92('0x19')](_0x115a0f)['end']();};}function respondWithResult(_0x55d532,_0x4bb1ca){_0x4bb1ca=_0x4bb1ca||0xc8;return function(_0x208c9c){if(_0x208c9c){return _0x55d532[_0xfc92('0x19')](_0x4bb1ca)['json'](_0x208c9c);}};}function respondWithFilteredResult(_0x213025,_0x15ee68){return function(_0x3abcf3){if(_0x3abcf3){var _0xbd6dee=typeof _0x15ee68[_0xfc92('0x1a')]===_0xfc92('0x1b')&&typeof _0x15ee68['limit']===_0xfc92('0x1b');var _0x458f20=_0x3abcf3[_0xfc92('0x1c')];var _0xcb8866=_0xbd6dee?0x0:_0x15ee68['offset'];var _0x5d9a30=_0xbd6dee?_0x3abcf3[_0xfc92('0x1c')]:_0x15ee68[_0xfc92('0x1a')]+_0x15ee68['limit'];var _0x21b7ef;if(_0x5d9a30>=_0x458f20){_0x5d9a30=_0x458f20;_0x21b7ef=0xc8;}else{_0x21b7ef=0xce;}_0x213025[_0xfc92('0x19')](_0x21b7ef);return _0x213025['set'](_0xfc92('0x1d'),_0xcb8866+'-'+_0x5d9a30+'/'+_0x458f20)['json'](_0x3abcf3);}return null;};}function patchUpdates(_0x376551){return function(_0x35ad35){try{jsonpatch[_0xfc92('0x1e')](_0x35ad35,_0x376551,!![]);}catch(_0x284669){return BPromise[_0xfc92('0x1f')](_0x284669);}return _0x35ad35[_0xfc92('0x20')]();};}function saveUpdates(_0x4ea927,_0x194587){return function(_0x539e74){if(_0x539e74){return _0x539e74[_0xfc92('0x21')](_0x4ea927)[_0xfc92('0x22')](function(_0x3aa7f6){return _0x3aa7f6;});}return null;};}function removeEntity(_0x55d9da,_0x4bb9ea){return function(_0x58a82e){if(_0x58a82e){return _0x58a82e['destroy']()[_0xfc92('0x22')](function(){_0x55d9da[_0xfc92('0x19')](0xcc)[_0xfc92('0x23')]();});}};}function handleEntityNotFound(_0x181d17,_0x3abd84){return function(_0xa43f14){if(!_0xa43f14){_0x181d17[_0xfc92('0x18')](0x194);}return _0xa43f14;};}function handleError(_0x156370,_0x532e5d){_0x532e5d=_0x532e5d||0x1f4;return function(_0x2da1f9){logger[_0xfc92('0x24')](_0x2da1f9[_0xfc92('0x25')]);if(_0x2da1f9['name']){delete _0x2da1f9[_0xfc92('0x26')];}_0x156370[_0xfc92('0x19')](_0x532e5d)['send'](_0x2da1f9);};}exports['show']=function(_0x25de92,_0x1465d4){var _0x58d37a={'raw':!![],'where':{'id':_0x25de92['params']['id']}},_0x3b52d6={};_0x3b52d6[_0xfc92('0x27')]=_[_0xfc92('0x28')](db['ChatProactiveAction'][_0xfc92('0x29')]);_0x3b52d6[_0xfc92('0x2a')]=_[_0xfc92('0x28')](_0x25de92[_0xfc92('0x2a')]);_0x3b52d6[_0xfc92('0x2b')]=_[_0xfc92('0x2c')](_0x3b52d6[_0xfc92('0x27')],_0x3b52d6[_0xfc92('0x2a')]);_0x58d37a[_0xfc92('0x2d')]=_['intersection'](_0x3b52d6['model'],qs[_0xfc92('0x2e')](_0x25de92['query'][_0xfc92('0x2e')]));_0x58d37a[_0xfc92('0x2d')]=_0x58d37a[_0xfc92('0x2d')][_0xfc92('0x2f')]?_0x58d37a['attributes']:_0x3b52d6['model'];if(_0x25de92[_0xfc92('0x2a')][_0xfc92('0x30')]){_0x58d37a[_0xfc92('0x31')]=[{'all':!![]}];}_0x58d37a=_[_0xfc92('0x32')]({},_0x58d37a,_0x25de92[_0xfc92('0x33')]);return db[_0xfc92('0x34')][_0xfc92('0x35')](_0x58d37a)['then'](handleEntityNotFound(_0x1465d4,null))[_0xfc92('0x22')](respondWithResult(_0x1465d4,null))[_0xfc92('0x36')](handleError(_0x1465d4,null));};exports[_0xfc92('0x37')]=function(_0x33e252,_0x4e8cbb){return db[_0xfc92('0x34')]['create'](_0x33e252['body'],{})[_0xfc92('0x22')](respondWithResult(_0x4e8cbb,0xc9))[_0xfc92('0x36')](handleError(_0x4e8cbb,null));};exports[_0xfc92('0x21')]=function(_0x55ea34,_0x12c9e6){if(_0x55ea34['body']['id']){delete _0x55ea34[_0xfc92('0x38')]['id'];}return db[_0xfc92('0x34')]['find']({'where':{'id':_0x55ea34[_0xfc92('0x39')]['id']}})[_0xfc92('0x22')](handleEntityNotFound(_0x12c9e6,null))['then'](saveUpdates(_0x55ea34[_0xfc92('0x38')],null))[_0xfc92('0x22')](respondWithResult(_0x12c9e6,null))[_0xfc92('0x36')](handleError(_0x12c9e6,null));};exports[_0xfc92('0x3a')]=function(_0x5d3a14,_0x57dfe2){return db[_0xfc92('0x34')][_0xfc92('0x35')]({'where':{'id':_0x5d3a14[_0xfc92('0x39')]['id']}})['then'](handleEntityNotFound(_0x57dfe2,null))['then'](removeEntity(_0x57dfe2,null))[_0xfc92('0x36')](handleError(_0x57dfe2,null));};
\ No newline at end of file
index 46ddfff..2dfbf88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc5=['rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','request-promise'];(function(_0x57e5f2,_0x3124ae){var _0x5321d9=function(_0x359cea){while(--_0x359cea){_0x57e5f2['push'](_0x57e5f2['shift']());}};_0x5321d9(++_0x3124ae);}(_0x0cc5,0xf0));var _0x50cc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0cc5[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x50cc('0x0'));var util=require(_0x50cc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x50cc('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50cc('0x3'));var config=require(_0x50cc('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x50cc('0x5')]=function(_0x290f8c,_0x570350){return _0x290f8c[_0x50cc('0x6')](_0x50cc('0x7'),attributes,{'tableName':_0x50cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f81=['ChatProactiveAction','chat_proactive_actions','lodash','util','api','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x3008d6,_0x558308){var _0x41884d=function(_0xcf1d1f){while(--_0xcf1d1f){_0x3008d6['push'](_0x3008d6['shift']());}};_0x41884d(++_0x558308);}(_0x9f81,0x1ca));var _0x19f8=function(_0x404597,_0x4f4cae){_0x404597=_0x404597-0x0;var _0x1ce904=_0x9f81[_0x404597];return _0x1ce904;};'use strict';var _=require(_0x19f8('0x0'));var util=require(_0x19f8('0x1'));var logger=require('../../config/logger')(_0x19f8('0x2'));var moment=require(_0x19f8('0x3'));var BPromise=require(_0x19f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19f8('0x5'));var rimraf=require(_0x19f8('0x6'));var config=require('../../config/environment');var attributes=require(_0x19f8('0x7'));module[_0x19f8('0x8')]=function(_0x46552d,_0x19fca0){return _0x46552d[_0x19f8('0x9')](_0x19f8('0xa'),attributes,{'tableName':_0x19f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b5ad1e6..a8d8786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0234=['catch','util','moment','ioredis','../../config/logger','../../config/environment','then','info','request\x20sent','debug','error','code','ChatProactiveAction,\x20%s,\x20%s','message'];(function(_0x23096b,_0x35ebc1){var _0x24c0f4=function(_0x3ddd78){while(--_0x3ddd78){_0x23096b['push'](_0x23096b['shift']());}};_0x24c0f4(++_0x35ebc1);}(_0x0234,0xfd));var _0x4023=function(_0x504cf9,_0x308e5c){_0x504cf9=_0x504cf9-0x0;var _0x2e889b=_0x0234[_0x504cf9];return _0x2e889b;};'use strict';var _=require('lodash');var util=require(_0x4023('0x0'));var moment=require(_0x4023('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4023('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4023('0x3'))('rpc');var config=require(_0x4023('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42ec4e,_0x20e21a,_0x3548ef){return new BPromise(function(_0x356b2a,_0xa05f5a){return client['request'](_0x42ec4e,_0x3548ef)[_0x4023('0x5')](function(_0x515c92){logger[_0x4023('0x6')]('ChatProactiveAction,\x20%s,\x20%s',_0x20e21a,_0x4023('0x7'));logger[_0x4023('0x8')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x20e21a,'request\x20sent',JSON['stringify'](_0x515c92));if(_0x515c92[_0x4023('0x9')]){if(_0x515c92[_0x4023('0x9')][_0x4023('0xa')]===0x1f4){logger['error'](_0x4023('0xb'),_0x20e21a,_0x515c92[_0x4023('0x9')]['message']);return _0xa05f5a(_0x515c92['error'][_0x4023('0xc')]);}logger[_0x4023('0x9')](_0x4023('0xb'),_0x20e21a,_0x515c92['error'][_0x4023('0xc')]);return _0x356b2a(_0x515c92['error']['message']);}else{logger[_0x4023('0x6')](_0x4023('0xb'),_0x20e21a,_0x4023('0x7'));_0x356b2a(_0x515c92['result']['message']);}})[_0x4023('0xd')](function(_0x1efa04){logger['error'](_0x4023('0xb'),_0x20e21a,_0x1efa04);_0xa05f5a(_0x1efa04);});});}
\ No newline at end of file
+var _0xb159=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1f62c3,_0x1ff95b){var _0x385c1c=function(_0x1db580){while(--_0x1db580){_0x1f62c3['push'](_0x1f62c3['shift']());}};_0x385c1c(++_0x1ff95b);}(_0xb159,0x91));var _0x9b15=function(_0x465643,_0x44dc4e){_0x465643=_0x465643-0x0;var _0x38ab86=_0xb159[_0x465643];return _0x38ab86;};'use strict';var _=require(_0x9b15('0x0'));var util=require(_0x9b15('0x1'));var moment=require(_0x9b15('0x2'));var BPromise=require(_0x9b15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b15('0x4'));var db=require(_0x9b15('0x5'))['db'];var utils=require(_0x9b15('0x6'));var logger=require('../../config/logger')(_0x9b15('0x7'));var config=require(_0x9b15('0x8'));var jayson=require(_0x9b15('0x9'));var client=jayson[_0x9b15('0xa')][_0x9b15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x640295,_0x4673c3,_0x2b8c20){return new BPromise(function(_0x5bbb26,_0x114e3f){return client['request'](_0x640295,_0x2b8c20)[_0x9b15('0xc')](function(_0x129ed5){logger[_0x9b15('0xd')](_0x9b15('0xe'),_0x4673c3,_0x9b15('0xf'));logger[_0x9b15('0x10')](_0x9b15('0x11'),_0x4673c3,_0x9b15('0xf'),JSON[_0x9b15('0x12')](_0x129ed5));if(_0x129ed5['error']){if(_0x129ed5[_0x9b15('0x13')][_0x9b15('0x14')]===0x1f4){logger[_0x9b15('0x13')](_0x9b15('0xe'),_0x4673c3,_0x129ed5[_0x9b15('0x13')]['message']);return _0x114e3f(_0x129ed5[_0x9b15('0x13')][_0x9b15('0x15')]);}logger[_0x9b15('0x13')](_0x9b15('0xe'),_0x4673c3,_0x129ed5[_0x9b15('0x13')][_0x9b15('0x15')]);return _0x5bbb26(_0x129ed5[_0x9b15('0x13')][_0x9b15('0x15')]);}else{logger[_0x9b15('0xd')](_0x9b15('0xe'),_0x4673c3,_0x9b15('0xf'));_0x5bbb26(_0x129ed5[_0x9b15('0x16')][_0x9b15('0x15')]);}})[_0x9b15('0x17')](function(_0x3b49a8){logger[_0x9b15('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x4673c3,_0x3b49a8);_0x114e3f(_0x3b49a8);});});}
\ No newline at end of file
index 2be4555..421701c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x2949de,_0x47b38d){var _0xc974b6=function(_0x2ef45e){while(--_0x2ef45e){_0x2949de['push'](_0x2949de['shift']());}};_0xc974b6(++_0x47b38d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1e7b49,_0x34fe55){_0x1e7b49=_0x1e7b49-0x0;var _0x204787=_0x1cb9[_0x1e7b49];return _0x204787;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
+var _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x579713,_0x34a023){var _0x24fcc7=function(_0x520e49){while(--_0x520e49){_0x579713['push'](_0x579713['shift']());}};_0x24fcc7(++_0x34a023);}(_0x2d17,0x17e));var _0x72d1=function(_0x51246b,_0x7f1de1){_0x51246b=_0x51246b-0x0;var _0x1049f5=_0x2d17[_0x51246b];return _0x1049f5;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router;
\ No newline at end of file
index c428a25..a8dd8ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1ef=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xd1ef,0x12a));var _0xfd1e=function(_0x38c20f,_0x5a03e4){_0x38c20f=_0x38c20f-0x0;var _0xd6981a=_0xd1ef[_0x38c20f];return _0xd6981a;};'use strict';var Sequelize=require(_0xfd1e('0x0'));module[_0xfd1e('0x1')]={'name':{'type':Sequelize[_0xfd1e('0x2')],'unique':_0xfd1e('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfd1e('0x2')]},'timeout':{'type':Sequelize[_0xfd1e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfd1e('0x5')](_0xfd1e('0x6'),_0xfd1e('0x7'),_0xfd1e('0x8'))}};
\ No newline at end of file
+var _0xdb12=['beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x2db1e3,_0x43d437){var _0x2ea4e9=function(_0x53813f){while(--_0x53813f){_0x2db1e3['push'](_0x2db1e3['shift']());}};_0x2ea4e9(++_0x43d437);}(_0xdb12,0xc2));var _0x2db1=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xdb12[_0x39772f];return _0xc9edbf;};'use strict';var Sequelize=require(_0x2db1('0x0'));module[_0x2db1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2db1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2db1('0x3')]},'timeout':{'type':Sequelize[_0x2db1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2db1('0x5')]('rrmemory',_0x2db1('0x6'),_0x2db1('0x7'))}};
\ No newline at end of file
index a3534a4..46ca54b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01c1=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','destroy','ChatQueues','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','includeAll','include','findAll','rows','show','params','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','update','body','describe','getMembers','findOne','get','UserChatQueue','nolimit','User','findAndCountAll','UserId','chatPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x48feda,_0x5f464f){var _0x2e98b0=function(_0x509332){while(--_0x509332){_0x48feda['push'](_0x48feda['shift']());}};_0x2e98b0(++_0x5f464f);}(_0x01c1,0x1c3));var _0x101c=function(_0x436752,_0x5bc0d9){_0x436752=_0x436752-0x0;var _0x5ee102=_0x01c1[_0x436752];return _0x5ee102;};'use strict';var emlformat=require(_0x101c('0x0'));var rimraf=require(_0x101c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x101c('0x2'));var rp=require(_0x101c('0x3'));var moment=require(_0x101c('0x4'));var BPromise=require(_0x101c('0x5'));var Mustache=require(_0x101c('0x6'));var util=require(_0x101c('0x7'));var path=require(_0x101c('0x8'));var sox=require(_0x101c('0x9'));var csv=require(_0x101c('0xa'));var ejs=require(_0x101c('0xb'));var fs=require('fs');var fs_extra=require(_0x101c('0xc'));var _=require('lodash');var squel=require(_0x101c('0xd'));var crypto=require('crypto');var jsforce=require(_0x101c('0xe'));var deskjs=require(_0x101c('0xf'));var toCsv=require(_0x101c('0xa'));var querystring=require(_0x101c('0x10'));var Papa=require(_0x101c('0x11'));var Redis=require('ioredis');var authService=require(_0x101c('0x12'));var qs=require(_0x101c('0x13'));var as=require(_0x101c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x101c('0x15'))(_0x101c('0x16'));var utils=require(_0x101c('0x17'));var config=require(_0x101c('0x18'));var licenseUtil=require(_0x101c('0x19'));var db=require(_0x101c('0x1a'))['db'];config[_0x101c('0x1b')]=_[_0x101c('0x1c')](config[_0x101c('0x1b')],{'host':_0x101c('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x101c('0x1b')]));require(_0x101c('0x1e'))[_0x101c('0x1f')](socket);var jayson=require(_0x101c('0x20'));var client=jayson[_0x101c('0x21')][_0x101c('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xe5413f,_0x482bf0,_0x3c6d6c,_0x3c11f9){return new BPromise(function(_0x5a88dd,_0x340103){var _0xc2734f=_0x3c11f9||client;return _0xc2734f[_0x101c('0x23')](_0xe5413f,_0x3c6d6c)[_0x101c('0x24')](function(_0x25a2ee){logger[_0x101c('0x25')]('ChatQueue,\x20%s,\x20%s',_0x482bf0,_0x101c('0x26'));logger[_0x101c('0x27')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x482bf0,_0x101c('0x26'),JSON[_0x101c('0x28')](_0x25a2ee));if(_0x25a2ee[_0x101c('0x29')]){if(_0x25a2ee[_0x101c('0x29')][_0x101c('0x2a')]===0x1f4){logger[_0x101c('0x29')](_0x101c('0x2b'),_0x482bf0,_0x25a2ee[_0x101c('0x29')][_0x101c('0x2c')]);return _0x340103(_0x25a2ee[_0x101c('0x29')][_0x101c('0x2c')]);}logger['error'](_0x101c('0x2b'),_0x482bf0,_0x25a2ee['error'][_0x101c('0x2c')]);return _0x5a88dd(_0x25a2ee['error'][_0x101c('0x2c')]);}else{logger[_0x101c('0x25')](_0x101c('0x2b'),_0x482bf0,_0x101c('0x26'));_0x5a88dd(_0x25a2ee['result'][_0x101c('0x2c')]);}})[_0x101c('0x2d')](function(_0x2f14c0){logger[_0x101c('0x29')]('ChatQueue,\x20%s,\x20%s',_0x482bf0,_0x2f14c0);_0x340103(_0x2f14c0);});});}function respondWithStatusCode(_0x36c9bb,_0x1ade49){_0x1ade49=_0x1ade49||0xcc;return function(_0x42ee36){if(_0x42ee36){return _0x36c9bb[_0x101c('0x2e')](_0x1ade49);}return _0x36c9bb[_0x101c('0x2f')](_0x1ade49)['end']();};}function respondWithResult(_0x2e7223,_0x1852fa){_0x1852fa=_0x1852fa||0xc8;return function(_0x4f16f1){if(_0x4f16f1){return _0x2e7223[_0x101c('0x2f')](_0x1852fa)[_0x101c('0x30')](_0x4f16f1);}};}function respondWithFilteredResult(_0x2f2f6b,_0x47ad38){return function(_0x3203d1){if(_0x3203d1){var _0x2fdfe5=typeof _0x47ad38[_0x101c('0x31')]==='undefined'&&typeof _0x47ad38[_0x101c('0x32')]===_0x101c('0x33');var _0x55fc1c=_0x3203d1[_0x101c('0x34')];var _0x4c5f82=_0x2fdfe5?0x0:_0x47ad38['offset'];var _0x4033fb=_0x2fdfe5?_0x3203d1[_0x101c('0x34')]:_0x47ad38[_0x101c('0x31')]+_0x47ad38['limit'];var _0x41da43;if(_0x4033fb>=_0x55fc1c){_0x4033fb=_0x55fc1c;_0x41da43=0xc8;}else{_0x41da43=0xce;}_0x2f2f6b[_0x101c('0x2f')](_0x41da43);return _0x2f2f6b['set'](_0x101c('0x35'),_0x4c5f82+'-'+_0x4033fb+'/'+_0x55fc1c)['json'](_0x3203d1);}return null;};}function patchUpdates(_0x48f528){return function(_0x30ed25){try{jsonpatch[_0x101c('0x36')](_0x30ed25,_0x48f528,!![]);}catch(_0xb1c709){return BPromise['reject'](_0xb1c709);}return _0x30ed25['save']();};}function saveUpdates(_0xd66739,_0x427aa5){return function(_0x1ee4c0){if(_0x1ee4c0){return _0x1ee4c0['update'](_0xd66739)['then'](function(_0x536a4d){return _0x536a4d;});}return null;};}function removeEntity(_0x5a18de,_0x1fb90f){return function(_0x280f21){if(_0x280f21){return _0x280f21[_0x101c('0x37')]()[_0x101c('0x24')](function(){var _0x3f3c1f=_0x280f21['get']({'plain':!![]});var _0x40153e=_0x101c('0x38');return db[_0x101c('0x39')][_0x101c('0x37')]({'where':{'type':_0x40153e,'resourceId':_0x3f3c1f['id']}})[_0x101c('0x24')](function(){return _0x280f21;});})[_0x101c('0x24')](function(){_0x5a18de[_0x101c('0x2f')](0xcc)[_0x101c('0x3a')]();});}};}function handleEntityNotFound(_0x4abf83,_0x4841d5){return function(_0x1d627e){if(!_0x1d627e){_0x4abf83[_0x101c('0x2e')](0x194);}return _0x1d627e;};}function handleError(_0x45a7ed,_0x18cc31){_0x18cc31=_0x18cc31||0x1f4;return function(_0x37d957){logger['error'](_0x37d957[_0x101c('0x3b')]);if(_0x37d957[_0x101c('0x3c')]){delete _0x37d957[_0x101c('0x3c')];}_0x45a7ed[_0x101c('0x2f')](_0x18cc31)[_0x101c('0x3d')](_0x37d957);};}exports[_0x101c('0x3e')]=function(_0x307603,_0x43c64d){var _0x19b0c3={},_0x34e30e={},_0xe391aa={'count':0x0,'rows':[]};var _0x25200c=_[_0x101c('0x3f')](db['ChatQueue'][_0x101c('0x40')],function(_0x491dcc){return{'name':_0x491dcc[_0x101c('0x41')],'type':_0x491dcc[_0x101c('0x42')][_0x101c('0x43')]};});_0x34e30e[_0x101c('0x44')]=_['map'](_0x25200c,_0x101c('0x3c'));_0x34e30e[_0x101c('0x45')]=_[_0x101c('0x46')](_0x307603['query']);_0x34e30e[_0x101c('0x47')]=_['intersection'](_0x34e30e[_0x101c('0x44')],_0x34e30e[_0x101c('0x45')]);_0x19b0c3[_0x101c('0x48')]=_['intersection'](_0x34e30e[_0x101c('0x44')],qs[_0x101c('0x49')](_0x307603['query'][_0x101c('0x49')]));_0x19b0c3['attributes']=_0x19b0c3[_0x101c('0x48')][_0x101c('0x4a')]?_0x19b0c3[_0x101c('0x48')]:_0x34e30e[_0x101c('0x44')];if(!_0x307603[_0x101c('0x45')][_0x101c('0x4b')]('nolimit')){_0x19b0c3[_0x101c('0x32')]=qs[_0x101c('0x32')](_0x307603[_0x101c('0x45')][_0x101c('0x32')]);_0x19b0c3[_0x101c('0x31')]=qs[_0x101c('0x31')](_0x307603[_0x101c('0x45')]['offset']);}_0x19b0c3[_0x101c('0x4c')]=qs[_0x101c('0x4d')](_0x307603['query'][_0x101c('0x4d')]);_0x19b0c3[_0x101c('0x4e')]=qs[_0x101c('0x47')](_[_0x101c('0x4f')](_0x307603[_0x101c('0x45')],_0x34e30e['filters']),_0x25200c);if(_0x307603[_0x101c('0x45')][_0x101c('0x50')]){_0x19b0c3[_0x101c('0x4e')]=_[_0x101c('0x51')](_0x19b0c3[_0x101c('0x4e')],{'$or':_['map'](_0x25200c,function(_0x1f074d){if(_0x1f074d[_0x101c('0x42')]!==_0x101c('0x52')){var _0x289399={};_0x289399[_0x1f074d[_0x101c('0x3c')]]={'$like':'%'+_0x307603['query'][_0x101c('0x50')]+'%'};return _0x289399;}})});}_0x19b0c3=_[_0x101c('0x51')]({},_0x19b0c3,_0x307603[_0x101c('0x53')]);var _0x2c4636={'where':_0x19b0c3[_0x101c('0x4e')]};return db[_0x101c('0x54')]['count'](_0x2c4636)[_0x101c('0x24')](function(_0x4b5092){_0xe391aa[_0x101c('0x34')]=_0x4b5092;if(_0x307603['query'][_0x101c('0x55')]){_0x19b0c3[_0x101c('0x56')]=[{'all':!![]}];}return db[_0x101c('0x54')][_0x101c('0x57')](_0x19b0c3);})[_0x101c('0x24')](function(_0x55e795){_0xe391aa[_0x101c('0x58')]=_0x55e795;return _0xe391aa;})[_0x101c('0x24')](respondWithFilteredResult(_0x43c64d,_0x19b0c3))[_0x101c('0x2d')](handleError(_0x43c64d,null));};exports[_0x101c('0x59')]=function(_0x3c4d18,_0x4152d3){var _0x3b0c02={'raw':!![],'where':{'id':_0x3c4d18[_0x101c('0x5a')]['id']}},_0x2f2f15={};_0x2f2f15[_0x101c('0x44')]=_[_0x101c('0x46')](db[_0x101c('0x54')]['rawAttributes']);_0x2f2f15['query']=_[_0x101c('0x46')](_0x3c4d18['query']);_0x2f2f15[_0x101c('0x47')]=_[_0x101c('0x5b')](_0x2f2f15['model'],_0x2f2f15['query']);_0x3b0c02[_0x101c('0x48')]=_[_0x101c('0x5b')](_0x2f2f15[_0x101c('0x44')],qs[_0x101c('0x49')](_0x3c4d18[_0x101c('0x45')][_0x101c('0x49')]));_0x3b0c02[_0x101c('0x48')]=_0x3b0c02[_0x101c('0x48')][_0x101c('0x4a')]?_0x3b0c02[_0x101c('0x48')]:_0x2f2f15['model'];if(_0x3c4d18['query'][_0x101c('0x55')]){_0x3b0c02[_0x101c('0x56')]=[{'all':!![]}];}_0x3b0c02=_[_0x101c('0x51')]({},_0x3b0c02,_0x3c4d18[_0x101c('0x53')]);return db[_0x101c('0x54')]['find'](_0x3b0c02)['then'](handleEntityNotFound(_0x4152d3,null))[_0x101c('0x24')](respondWithResult(_0x4152d3,null))[_0x101c('0x2d')](handleError(_0x4152d3,null));};exports[_0x101c('0x5c')]=function(_0x28c55d,_0x3e6493){return db[_0x101c('0x54')][_0x101c('0x5c')](_0x28c55d['body'],{})[_0x101c('0x24')](function(_0x7a6f31){var _0x22be9d=_0x28c55d[_0x101c('0x5d')]['get']({'plain':!![]});if(!_0x22be9d)throw new Error(_0x101c('0x5e'));if(_0x22be9d[_0x101c('0x5f')]===_0x101c('0x5d')){var _0x111535=_0x7a6f31['get']({'plain':!![]});var _0x44cecc=_0x101c('0x38');return db['UserProfileSection'][_0x101c('0x60')]({'where':{'name':_0x44cecc,'userProfileId':_0x22be9d['userProfileId']},'raw':!![]})[_0x101c('0x24')](function(_0x3fb67c){if(_0x3fb67c&&_0x3fb67c['autoAssociation']===0x0){return db[_0x101c('0x39')][_0x101c('0x5c')]({'name':_0x111535[_0x101c('0x3c')],'resourceId':_0x111535['id'],'type':_0x3fb67c[_0x101c('0x3c')],'sectionId':_0x3fb67c['id']},{})[_0x101c('0x24')](function(){return _0x7a6f31;});}else{return _0x7a6f31;}})[_0x101c('0x2d')](function(_0x19b3df){logger[_0x101c('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19b3df);throw _0x19b3df;});}return _0x7a6f31;})[_0x101c('0x24')](respondWithResult(_0x3e6493,0xc9))['catch'](handleError(_0x3e6493,null));};exports[_0x101c('0x61')]=function(_0x539345,_0x1d119a){if(_0x539345[_0x101c('0x62')]['id']){delete _0x539345[_0x101c('0x62')]['id'];}return db['ChatQueue'][_0x101c('0x60')]({'where':{'id':_0x539345[_0x101c('0x5a')]['id']}})[_0x101c('0x24')](handleEntityNotFound(_0x1d119a,null))['then'](saveUpdates(_0x539345[_0x101c('0x62')],null))['then'](respondWithResult(_0x1d119a,null))['catch'](handleError(_0x1d119a,null));};exports[_0x101c('0x37')]=function(_0x914abe,_0x4a26a2){return db['ChatQueue'][_0x101c('0x60')]({'where':{'id':_0x914abe[_0x101c('0x5a')]['id']}})[_0x101c('0x24')](handleEntityNotFound(_0x4a26a2,null))[_0x101c('0x24')](removeEntity(_0x4a26a2,null))[_0x101c('0x2d')](handleError(_0x4a26a2,null));};exports[_0x101c('0x63')]=function(_0x2dcc83,_0x1d6f31){return db[_0x101c('0x54')][_0x101c('0x63')]()[_0x101c('0x24')](respondWithResult(_0x1d6f31,null))[_0x101c('0x2d')](handleError(_0x1d6f31,null));};exports[_0x101c('0x64')]=function(_0x17356c,_0x22e5f2,_0xaaa28d){var _0x2fdfef={'raw':!![],'where':{}},_0x4a7e8b={},_0x32f5de;return db[_0x101c('0x54')][_0x101c('0x65')]({'where':{'id':_0x17356c[_0x101c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x22e5f2,null))['then'](function(_0x76e172){if(_0x76e172){_0x32f5de=_0x76e172[_0x101c('0x66')]({'plain':!![]});_0x4a7e8b['model']=_['keys'](db[_0x101c('0x67')]['rawAttributes']);_0x4a7e8b[_0x101c('0x45')]=_[_0x101c('0x46')](_0x17356c[_0x101c('0x45')]);_0x4a7e8b[_0x101c('0x47')]=_[_0x101c('0x5b')](_0x4a7e8b[_0x101c('0x44')],_0x4a7e8b[_0x101c('0x45')]);_0x2fdfef[_0x101c('0x48')]=_['intersection'](_0x4a7e8b['model'],qs[_0x101c('0x49')](_0x17356c[_0x101c('0x45')]['fields']));_0x2fdfef[_0x101c('0x48')]=_0x2fdfef[_0x101c('0x48')][_0x101c('0x4a')]?_0x2fdfef['attributes']:_0x4a7e8b[_0x101c('0x44')];if(!_0x17356c[_0x101c('0x45')][_0x101c('0x4b')](_0x101c('0x68'))){_0x2fdfef[_0x101c('0x32')]=qs[_0x101c('0x32')](_0x17356c[_0x101c('0x45')][_0x101c('0x32')]);_0x2fdfef[_0x101c('0x31')]=qs[_0x101c('0x31')](_0x17356c[_0x101c('0x45')]['offset']);}_0x2fdfef['order']=qs[_0x101c('0x4d')](_0x17356c[_0x101c('0x45')][_0x101c('0x4d')]);_0x2fdfef[_0x101c('0x4e')]=qs['filters'](_[_0x101c('0x4f')](_0x17356c[_0x101c('0x45')],_0x4a7e8b[_0x101c('0x47')]));_0x2fdfef[_0x101c('0x4e')]['ChatQueueId']=_0x76e172['id'];if(_0x17356c[_0x101c('0x45')][_0x101c('0x50')]){_0x2fdfef['where']=_[_0x101c('0x51')](_0x2fdfef[_0x101c('0x4e')],{'$or':_['map'](_0x2fdfef[_0x101c('0x48')],function(_0x11d31c){var _0x4b6dd4={};_0x4b6dd4[_0x11d31c]={'$like':'%'+_0x17356c['query'][_0x101c('0x50')]+'%'};return _0x4b6dd4;})});}_0x2fdfef=_[_0x101c('0x51')]({},_0x2fdfef,_0x17356c[_0x101c('0x53')]);return db['UserChatQueue'][_0x101c('0x57')](_0x2fdfef);}})[_0x101c('0x24')](function(_0x4c6ca2){if(_0x4c6ca2){return db[_0x101c('0x69')][_0x101c('0x6a')]({'where':{'id':_[_0x101c('0x3f')](_0x4c6ca2,_0x101c('0x6b')),'role':'agent'},'attributes':['id',_0x101c('0x3c'),_0x101c('0x6c'),'updatedAt','createdAt']});}})[_0x101c('0x24')](function(_0x23c9c5){if(_0x23c9c5){return{'count':_0x23c9c5[_0x101c('0x34')],'rows':_[_0x101c('0x3f')](_0x23c9c5[_0x101c('0x58')],function(_0x547f71){return{'membername':_0x547f71[_0x101c('0x3c')],'UserId':_0x547f71['id'],'queue_name':_0x32f5de[_0x101c('0x3c')],'ChatQueueId':_0x32f5de['id'],'interface':util[_0x101c('0x6d')](_0x101c('0x6e'),_0x101c('0x6f'),_0x547f71[_0x101c('0x3c')]),'penalty':0x0,'paused':_0x547f71[_0x101c('0x6c')],'createdAt':_0x547f71[_0x101c('0x70')],'updatedAt':_0x547f71[_0x101c('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x101c('0x24')](respondWithFilteredResult(_0x22e5f2,_0x2fdfef))['catch'](handleError(_0x22e5f2,null));};exports[_0x101c('0x72')]=function(_0x54d6b4,_0x556976,_0x4175dd){var _0x3695c0={};var _0x33687e={};var _0x114ea7;var _0x27dcc1;return db[_0x101c('0x54')][_0x101c('0x65')]({'where':{'id':_0x54d6b4[_0x101c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x556976,null))['then'](function(_0x15d11d){if(_0x15d11d){_0x114ea7=_0x15d11d;_0x33687e[_0x101c('0x44')]=_[_0x101c('0x46')](db[_0x101c('0x73')][_0x101c('0x40')]);_0x33687e[_0x101c('0x45')]=_[_0x101c('0x46')](_0x54d6b4['query']);_0x33687e['filters']=_['intersection'](_0x33687e[_0x101c('0x44')],_0x33687e['query']);_0x3695c0[_0x101c('0x48')]=_[_0x101c('0x5b')](_0x33687e[_0x101c('0x44')],qs[_0x101c('0x49')](_0x54d6b4[_0x101c('0x45')][_0x101c('0x49')]));_0x3695c0[_0x101c('0x48')]=_0x3695c0[_0x101c('0x48')][_0x101c('0x4a')]?_0x3695c0[_0x101c('0x48')]:_0x33687e[_0x101c('0x44')];_0x3695c0[_0x101c('0x4c')]=qs[_0x101c('0x4d')](_0x54d6b4[_0x101c('0x45')][_0x101c('0x4d')]);_0x3695c0[_0x101c('0x4e')]=qs['filters'](_[_0x101c('0x4f')](_0x54d6b4[_0x101c('0x45')],_0x33687e[_0x101c('0x47')]));if(_0x54d6b4[_0x101c('0x45')]['filter']){_0x3695c0[_0x101c('0x4e')]=_['merge'](_0x3695c0[_0x101c('0x4e')],{'$or':_[_0x101c('0x3f')](_0x3695c0[_0x101c('0x48')],function(_0x3abd84){var _0x4227f5={};_0x4227f5[_0x3abd84]={'$like':'%'+_0x54d6b4[_0x101c('0x45')][_0x101c('0x50')]+'%'};return _0x4227f5;})});}_0x3695c0=_[_0x101c('0x51')]({},_0x3695c0,_0x54d6b4[_0x101c('0x53')]);return _0x114ea7[_0x101c('0x72')](_0x3695c0);}})[_0x101c('0x24')](function(_0x5ce27a){if(_0x5ce27a){_0x27dcc1=_0x5ce27a[_0x101c('0x4a')];if(!_0x54d6b4[_0x101c('0x45')]['hasOwnProperty'](_0x101c('0x68'))){_0x3695c0[_0x101c('0x32')]=qs[_0x101c('0x32')](_0x54d6b4['query'][_0x101c('0x32')]);_0x3695c0[_0x101c('0x31')]=qs['offset'](_0x54d6b4[_0x101c('0x45')][_0x101c('0x31')]);}return _0x114ea7[_0x101c('0x72')](_0x3695c0);}})['then'](function(_0x39f37a){if(_0x39f37a){return _0x39f37a?{'count':_0x27dcc1,'rows':_0x39f37a}:null;}})[_0x101c('0x24')](respondWithResult(_0x556976,null))['catch'](handleError(_0x556976,null));};exports[_0x101c('0x74')]=function(_0x188612,_0x327c55,_0x3d650b){var _0x487ef8=_0x188612['body'][_0x101c('0x75')];return db[_0x101c('0x73')][_0x101c('0x57')]({'where':{'id':_0x487ef8},'attributes':['id'],'include':[{'model':db[_0x101c('0x69')],'as':_0x101c('0x76'),'attributes':['id',_0x101c('0x3c'),'online',_0x101c('0x77'),_0x101c('0x78')],'raw':!![]}]})[_0x101c('0x24')](function(_0x53fb7b){if(_0x53fb7b){var _0x45a94f=_[_0x101c('0x79')](_0x53fb7b,function(_0x3e6b9d){var _0x2f72c4=_0x3e6b9d['get']({'plain':!![]});return _0x2f72c4[_0x101c('0x76')];});return db[_0x101c('0x54')][_0x101c('0x60')]({'where':{'id':_0x188612[_0x101c('0x5a')]['id']}})[_0x101c('0x24')](function(_0x4fcccf){return db[_0x101c('0x7a')][_0x101c('0x7b')](function(_0x21a7e5){return _0x4fcccf[_0x101c('0x74')](_0x487ef8,{'transaction':_0x21a7e5})['then'](function(){return BPromise[_0x101c('0x7c')](_0x45a94f,function(_0x3dd40c){return db['UserChatQueue'][_0x101c('0x7d')]({'where':{'UserId':_0x3dd40c['id'],'ChatQueueId':_0x188612[_0x101c('0x5a')]['id']},'transaction':_0x21a7e5});});})[_0x101c('0x24')](function(){_0x45a94f[_0x101c('0x7e')](function(_0x20fd6d){socket[_0x101c('0x7f')](_0x101c('0x80'),{'UserId':_0x20fd6d['id'],'ChatQueueId':_0x4fcccf['id']});});});});});}})[_0x101c('0x24')](respondWithStatusCode(_0x327c55,null))[_0x101c('0x2d')](handleError(_0x327c55,null));};exports[_0x101c('0x81')]=function(_0x5823e7,_0x5abb0b,_0x11e8ac){return db[_0x101c('0x73')][_0x101c('0x57')]({'where':{'id':_0x5823e7['query'][_0x101c('0x75')]},'attributes':['id'],'include':[{'model':db[_0x101c('0x69')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x101c('0x24')](handleEntityNotFound(_0x5abb0b,null))[_0x101c('0x24')](function(_0x3baf5b){var _0x1ead73=_['map'](_0x3baf5b,'id');var _0x53de00=[];var _0x2dce69=[];var _0x131c61=squel[_0x101c('0x82')]();_0x131c61[_0x101c('0x83')](_0x101c('0x84'))[_0x101c('0x85')](_0x101c('0x86'),'tq')['join'](_0x101c('0x87'),'ut',_0x101c('0x88'))[_0x101c('0x4e')](_0x101c('0x89'),_0x5823e7[_0x101c('0x5a')]['id']);for(var _0x45bb6d=0x0;_0x45bb6d<_0x3baf5b[_0x101c('0x4a')];_0x45bb6d+=0x1){let _0x1344cf=_0x3baf5b[_0x45bb6d];for(var _0x1658dd=0x0;_0x1658dd<_0x1344cf[_0x101c('0x76')][_0x101c('0x4a')];_0x1658dd+=0x1){let _0x1da976=_0x1344cf[_0x101c('0x76')][_0x1658dd];var _0x2e05b5=_0x131c61[_0x101c('0x8a')]();_0x2e05b5['where'](_0x101c('0x8b'),_0x1da976['id']);_0x2dce69[_0x101c('0x8c')](db[_0x101c('0x7a')]['query'](_0x2e05b5[_0x101c('0x8d')](),{'type':db[_0x101c('0x7a')][_0x101c('0x8e')][_0x101c('0x8f')]})['then'](function(_0x53610b){if(_0x53610b['length']===0x1){return _0x1da976['id'];}else{var _0x53763f=_[_0x101c('0x90')](_[_0x101c('0x3f')](_0x53610b,'TeamId'),function(_0x28d2aa){return _['includes'](_0x1ead73,_0x28d2aa);});if(_0x53763f){return _0x1da976['id'];}}}));}}return BPromise[_0x101c('0x91')](_0x2dce69)[_0x101c('0x24')](function(_0x32a9f3){_0x53de00=_(_0x53de00)[_0x101c('0x92')](_0x32a9f3)[_0x101c('0x93')]()[_0x101c('0x94')]();return db[_0x101c('0x54')]['find']({'where':{'id':_0x5823e7[_0x101c('0x5a')]['id']}})[_0x101c('0x24')](function(_0xafe743){return db[_0x101c('0x7a')]['transaction'](function(_0x5cb08a){return _0xafe743[_0x101c('0x81')](_0x5823e7[_0x101c('0x45')]['ids'],{'transaction':_0x5cb08a})['then'](function(){if(!_[_0x101c('0x95')](_0x53de00)){return _0xafe743[_0x101c('0x96')](_0x53de00,{'transaction':_0x5cb08a});}})[_0x101c('0x24')](function(){_0x53de00['forEach'](function(_0xb07918){socket[_0x101c('0x7f')](_0x101c('0x97'),{'UserId':_0xb07918,'ChatQueueId':_0xafe743['id']});});});});});});})[_0x101c('0x24')](respondWithStatusCode(_0x5abb0b,null))[_0x101c('0x2d')](handleError(_0x5abb0b,null));};exports[_0x101c('0x98')]=function(_0xa5208,_0x2397c1,_0x24933e){return db[_0x101c('0x54')][_0x101c('0x60')]({'where':{'id':_0xa5208['params']['id']}})['then'](handleEntityNotFound(_0x2397c1,null))[_0x101c('0x24')](function(_0x41453d){if(_0x41453d){return _0x41453d[_0x101c('0x98')](_0xa5208[_0x101c('0x62')][_0x101c('0x75')],_[_0x101c('0x99')](_0xa5208[_0x101c('0x62')],[_0x101c('0x75'),'id'])||{})['spread'](function(_0x54a2a6){for(var _0x5ae5f7=0x0;_0x5ae5f7<_0xa5208[_0x101c('0x62')][_0x101c('0x75')]['length'];_0x5ae5f7+=0x1){socket[_0x101c('0x7f')](_0x101c('0x80'),{'UserId':_0xa5208[_0x101c('0x62')][_0x101c('0x75')][_0x5ae5f7],'ChatQueueId':_0xa5208[_0x101c('0x5a')]['id']});}return _0x54a2a6;});}})[_0x101c('0x24')](respondWithResult(_0x2397c1,null))[_0x101c('0x2d')](handleError(_0x2397c1,null));};exports[_0x101c('0x96')]=function(_0xde25d,_0x45a194,_0x2f9e01){return db[_0x101c('0x54')][_0x101c('0x60')]({'where':{'id':_0xde25d[_0x101c('0x5a')]['id']}})[_0x101c('0x24')](handleEntityNotFound(_0x45a194,null))[_0x101c('0x24')](function(_0x347586){if(_0x347586){return _0x347586[_0x101c('0x96')](_0xde25d['query'][_0x101c('0x75')])[_0x101c('0x24')](function(){if(_[_0x101c('0x9a')](_0xde25d[_0x101c('0x45')]['ids'])){for(var _0x1b0fc3=0x0;_0x1b0fc3<_0xde25d[_0x101c('0x45')][_0x101c('0x75')][_0x101c('0x4a')];_0x1b0fc3+=0x1){socket[_0x101c('0x7f')](_0x101c('0x97'),{'UserId':Number(_0xde25d[_0x101c('0x45')][_0x101c('0x75')][_0x1b0fc3]),'ChatQueueId':Number(_0xde25d[_0x101c('0x5a')]['id'])});}}else{socket['emit'](_0x101c('0x97'),{'UserId':Number(_0xde25d[_0x101c('0x45')]['ids']),'ChatQueueId':Number(_0xde25d['params']['id'])});}});}})[_0x101c('0x24')](respondWithStatusCode(_0x45a194,null))[_0x101c('0x2d')](handleError(_0x45a194,null));};exports[_0x101c('0x9b')]=function(_0x49ff96,_0x4e39ec,_0x8a2847){var _0x18c257={};var _0x18880c={};var _0x559a54;var _0x3e65a6;return db[_0x101c('0x54')][_0x101c('0x65')]({'where':{'id':_0x49ff96[_0x101c('0x5a')]['id']}})[_0x101c('0x24')](handleEntityNotFound(_0x4e39ec,null))[_0x101c('0x24')](function(_0x5bf1d5){if(_0x5bf1d5){_0x559a54=_0x5bf1d5;_0x18880c[_0x101c('0x44')]=_[_0x101c('0x46')](db['User'][_0x101c('0x40')]);_0x18880c[_0x101c('0x45')]=_[_0x101c('0x46')](_0x49ff96['query']);_0x18880c[_0x101c('0x47')]=_['intersection'](_0x18880c[_0x101c('0x44')],_0x18880c[_0x101c('0x45')]);_0x18c257[_0x101c('0x48')]=_['intersection'](_0x18880c[_0x101c('0x44')],qs['fields'](_0x49ff96['query']['fields']));_0x18c257['attributes']=_0x18c257[_0x101c('0x48')]['length']?_0x18c257[_0x101c('0x48')]:_0x18880c['model'];_0x18c257[_0x101c('0x4c')]=qs[_0x101c('0x4d')](_0x49ff96[_0x101c('0x45')]['sort']);_0x18c257[_0x101c('0x4e')]=qs[_0x101c('0x47')](_[_0x101c('0x4f')](_0x49ff96['query'],_0x18880c[_0x101c('0x47')]));if(_0x49ff96[_0x101c('0x45')][_0x101c('0x50')]){_0x18c257[_0x101c('0x4e')]=_['merge'](_0x18c257['where'],{'$or':_[_0x101c('0x3f')](_0x18c257[_0x101c('0x48')],function(_0x1db6c5){var _0x58c630={};_0x58c630[_0x1db6c5]={'$like':'%'+_0x49ff96[_0x101c('0x45')][_0x101c('0x50')]+'%'};return _0x58c630;})});}_0x18c257=_[_0x101c('0x51')]({},_0x18c257,_0x49ff96[_0x101c('0x53')]);return _0x559a54[_0x101c('0x9b')](_0x18c257);}})['then'](function(_0x38a884){if(_0x38a884){_0x3e65a6=_0x38a884[_0x101c('0x4a')];if(!_0x49ff96['query']['hasOwnProperty'](_0x101c('0x68'))){_0x18c257['limit']=qs[_0x101c('0x32')](_0x49ff96['query']['limit']);_0x18c257[_0x101c('0x31')]=qs[_0x101c('0x31')](_0x49ff96[_0x101c('0x45')]['offset']);}return _0x559a54[_0x101c('0x9b')](_0x18c257);}})[_0x101c('0x24')](function(_0xb9a7b){if(_0xb9a7b){return _0xb9a7b?{'count':_0x3e65a6,'rows':_0xb9a7b}:null;}})[_0x101c('0x24')](respondWithResult(_0x4e39ec,null))['catch'](handleError(_0x4e39ec,null));};
\ No newline at end of file
+var _0x8d55=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','client','http','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','ChatQueues','UserProfileResource','end','sendStatus','stack','name','index','ChatQueue','rawAttributes','type','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','ChatQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','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','ioredis'];(function(_0x37607a,_0x347eca){var _0x1dd6e2=function(_0xfdd16d){while(--_0xfdd16d){_0x37607a['push'](_0x37607a['shift']());}};_0x1dd6e2(++_0x347eca);}(_0x8d55,0x1bd));var _0x58d5=function(_0xf7a280,_0x2c43ce){_0xf7a280=_0xf7a280-0x0;var _0x5282ab=_0x8d55[_0xf7a280];return _0x5282ab;};'use strict';var emlformat=require(_0x58d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x58d5('0x1'));var jsonpatch=require(_0x58d5('0x2'));var rp=require(_0x58d5('0x3'));var moment=require(_0x58d5('0x4'));var BPromise=require(_0x58d5('0x5'));var Mustache=require(_0x58d5('0x6'));var util=require(_0x58d5('0x7'));var path=require(_0x58d5('0x8'));var sox=require(_0x58d5('0x9'));var csv=require(_0x58d5('0xa'));var ejs=require(_0x58d5('0xb'));var fs=require('fs');var fs_extra=require(_0x58d5('0xc'));var _=require(_0x58d5('0xd'));var squel=require(_0x58d5('0xe'));var crypto=require(_0x58d5('0xf'));var jsforce=require(_0x58d5('0x10'));var deskjs=require(_0x58d5('0x11'));var toCsv=require(_0x58d5('0xa'));var querystring=require(_0x58d5('0x12'));var Papa=require('papaparse');var Redis=require(_0x58d5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x58d5('0x14'));var hardwareService=require(_0x58d5('0x15'));var logger=require(_0x58d5('0x16'))(_0x58d5('0x17'));var utils=require(_0x58d5('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x58d5('0x19'));var db=require(_0x58d5('0x1a'))['db'];config[_0x58d5('0x1b')]=_[_0x58d5('0x1c')](config[_0x58d5('0x1b')],{'host':_0x58d5('0x1d'),'port':0x18eb});var socket=require(_0x58d5('0x1e'))(new Redis(config[_0x58d5('0x1b')]));require(_0x58d5('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x58d5('0x20')][_0x58d5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x366ee5,_0x23923e,_0x16498c,_0x5a4565){return new BPromise(function(_0x4c9b05,_0x14938e){var _0x2181fd=_0x5a4565||client;return _0x2181fd['request'](_0x366ee5,_0x16498c)[_0x58d5('0x22')](function(_0x5333ae){logger[_0x58d5('0x23')](_0x58d5('0x24'),_0x23923e,_0x58d5('0x25'));logger[_0x58d5('0x26')](_0x58d5('0x27'),_0x23923e,_0x58d5('0x25'),JSON[_0x58d5('0x28')](_0x5333ae));if(_0x5333ae[_0x58d5('0x29')]){if(_0x5333ae['error'][_0x58d5('0x2a')]===0x1f4){logger[_0x58d5('0x29')](_0x58d5('0x24'),_0x23923e,_0x5333ae[_0x58d5('0x29')][_0x58d5('0x2b')]);return _0x14938e(_0x5333ae['error'][_0x58d5('0x2b')]);}logger['error'](_0x58d5('0x24'),_0x23923e,_0x5333ae[_0x58d5('0x29')]['message']);return _0x4c9b05(_0x5333ae[_0x58d5('0x29')][_0x58d5('0x2b')]);}else{logger[_0x58d5('0x23')](_0x58d5('0x24'),_0x23923e,_0x58d5('0x25'));_0x4c9b05(_0x5333ae[_0x58d5('0x2c')][_0x58d5('0x2b')]);}})[_0x58d5('0x2d')](function(_0x34b083){logger[_0x58d5('0x29')]('ChatQueue,\x20%s,\x20%s',_0x23923e,_0x34b083);_0x14938e(_0x34b083);});});}function respondWithStatusCode(_0x274780,_0xd5b136){_0xd5b136=_0xd5b136||0xcc;return function(_0x324264){if(_0x324264){return _0x274780['sendStatus'](_0xd5b136);}return _0x274780[_0x58d5('0x2e')](_0xd5b136)['end']();};}function respondWithResult(_0x134f65,_0x244085){_0x244085=_0x244085||0xc8;return function(_0x1dec4d){if(_0x1dec4d){return _0x134f65[_0x58d5('0x2e')](_0x244085)[_0x58d5('0x2f')](_0x1dec4d);}};}function respondWithFilteredResult(_0x54dce0,_0x7ebc8c){return function(_0x392880){if(_0x392880){var _0x517314=typeof _0x7ebc8c[_0x58d5('0x30')]===_0x58d5('0x31')&&typeof _0x7ebc8c[_0x58d5('0x32')]===_0x58d5('0x31');var _0x22456d=_0x392880[_0x58d5('0x33')];var _0x4d5a3b=_0x517314?0x0:_0x7ebc8c[_0x58d5('0x30')];var _0x4f022e=_0x517314?_0x392880[_0x58d5('0x33')]:_0x7ebc8c['offset']+_0x7ebc8c[_0x58d5('0x32')];var _0x33d097;if(_0x4f022e>=_0x22456d){_0x4f022e=_0x22456d;_0x33d097=0xc8;}else{_0x33d097=0xce;}_0x54dce0[_0x58d5('0x2e')](_0x33d097);return _0x54dce0[_0x58d5('0x34')](_0x58d5('0x35'),_0x4d5a3b+'-'+_0x4f022e+'/'+_0x22456d)[_0x58d5('0x2f')](_0x392880);}return null;};}function patchUpdates(_0x5d947c){return function(_0x1e7a60){try{jsonpatch['apply'](_0x1e7a60,_0x5d947c,!![]);}catch(_0x2e6415){return BPromise['reject'](_0x2e6415);}return _0x1e7a60[_0x58d5('0x36')]();};}function saveUpdates(_0x5875d3,_0x4ac003){return function(_0x5dc74a){if(_0x5dc74a){return _0x5dc74a[_0x58d5('0x37')](_0x5875d3)['then'](function(_0x9ecc5a){return _0x9ecc5a;});}return null;};}function removeEntity(_0x1abc48,_0x34fcdd){return function(_0x2b9dab){if(_0x2b9dab){return _0x2b9dab[_0x58d5('0x38')]()['then'](function(){var _0x2f169f=_0x2b9dab[_0x58d5('0x39')]({'plain':!![]});var _0xe7071d=_0x58d5('0x3a');return db[_0x58d5('0x3b')][_0x58d5('0x38')]({'where':{'type':_0xe7071d,'resourceId':_0x2f169f['id']}})[_0x58d5('0x22')](function(){return _0x2b9dab;});})[_0x58d5('0x22')](function(){_0x1abc48[_0x58d5('0x2e')](0xcc)[_0x58d5('0x3c')]();});}};}function handleEntityNotFound(_0x263321,_0x4ba13f){return function(_0x1f8d3a){if(!_0x1f8d3a){_0x263321[_0x58d5('0x3d')](0x194);}return _0x1f8d3a;};}function handleError(_0x5c8516,_0xbcdc8f){_0xbcdc8f=_0xbcdc8f||0x1f4;return function(_0x2625d9){logger[_0x58d5('0x29')](_0x2625d9[_0x58d5('0x3e')]);if(_0x2625d9[_0x58d5('0x3f')]){delete _0x2625d9[_0x58d5('0x3f')];}_0x5c8516['status'](_0xbcdc8f)['send'](_0x2625d9);};}exports[_0x58d5('0x40')]=function(_0x49aa56,_0x2320f4){var _0x1c4cd2={},_0x1aec4c={},_0x3e670f={'count':0x0,'rows':[]};var _0x1de936=_['map'](db[_0x58d5('0x41')][_0x58d5('0x42')],function(_0x23795b){return{'name':_0x23795b['fieldName'],'type':_0x23795b[_0x58d5('0x43')]['key']};});_0x1aec4c[_0x58d5('0x44')]=_['map'](_0x1de936,_0x58d5('0x3f'));_0x1aec4c['query']=_[_0x58d5('0x45')](_0x49aa56['query']);_0x1aec4c[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x1aec4c['model'],_0x1aec4c['query']);_0x1c4cd2[_0x58d5('0x48')]=_[_0x58d5('0x47')](_0x1aec4c[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x49aa56['query'][_0x58d5('0x49')]));_0x1c4cd2[_0x58d5('0x48')]=_0x1c4cd2[_0x58d5('0x48')][_0x58d5('0x4a')]?_0x1c4cd2[_0x58d5('0x48')]:_0x1aec4c[_0x58d5('0x44')];if(!_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x4c')](_0x58d5('0x4d'))){_0x1c4cd2[_0x58d5('0x32')]=qs[_0x58d5('0x32')](_0x49aa56['query'][_0x58d5('0x32')]);_0x1c4cd2[_0x58d5('0x30')]=qs[_0x58d5('0x30')](_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x30')]);}_0x1c4cd2[_0x58d5('0x4e')]=qs[_0x58d5('0x4f')](_0x49aa56['query'][_0x58d5('0x4f')]);_0x1c4cd2[_0x58d5('0x50')]=qs['filters'](_[_0x58d5('0x51')](_0x49aa56[_0x58d5('0x4b')],_0x1aec4c['filters']),_0x1de936);if(_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x52')]){_0x1c4cd2['where']=_[_0x58d5('0x53')](_0x1c4cd2[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x1de936,function(_0x16be5f){if(_0x16be5f[_0x58d5('0x43')]!==_0x58d5('0x55')){var _0x5f5a53={};_0x5f5a53[_0x16be5f[_0x58d5('0x3f')]]={'$like':'%'+_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x52')]+'%'};return _0x5f5a53;}})});}_0x1c4cd2=_[_0x58d5('0x53')]({},_0x1c4cd2,_0x49aa56[_0x58d5('0x56')]);var _0x4aabd9={'where':_0x1c4cd2[_0x58d5('0x50')]};return db[_0x58d5('0x41')][_0x58d5('0x33')](_0x4aabd9)[_0x58d5('0x22')](function(_0x36b901){_0x3e670f['count']=_0x36b901;if(_0x49aa56[_0x58d5('0x4b')][_0x58d5('0x57')]){_0x1c4cd2[_0x58d5('0x58')]=[{'all':!![]}];}return db[_0x58d5('0x41')][_0x58d5('0x59')](_0x1c4cd2);})[_0x58d5('0x22')](function(_0x49dca0){_0x3e670f['rows']=_0x49dca0;return _0x3e670f;})[_0x58d5('0x22')](respondWithFilteredResult(_0x2320f4,_0x1c4cd2))[_0x58d5('0x2d')](handleError(_0x2320f4,null));};exports[_0x58d5('0x5a')]=function(_0x2a8f1c,_0x5f04cb){var _0x39e99d={'raw':!![],'where':{'id':_0x2a8f1c['params']['id']}},_0x21d8e1={};_0x21d8e1['model']=_[_0x58d5('0x45')](db['ChatQueue']['rawAttributes']);_0x21d8e1['query']=_[_0x58d5('0x45')](_0x2a8f1c[_0x58d5('0x4b')]);_0x21d8e1[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x21d8e1[_0x58d5('0x44')],_0x21d8e1[_0x58d5('0x4b')]);_0x39e99d['attributes']=_[_0x58d5('0x47')](_0x21d8e1[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x2a8f1c[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x39e99d[_0x58d5('0x48')]=_0x39e99d['attributes'][_0x58d5('0x4a')]?_0x39e99d['attributes']:_0x21d8e1[_0x58d5('0x44')];if(_0x2a8f1c[_0x58d5('0x4b')][_0x58d5('0x57')]){_0x39e99d[_0x58d5('0x58')]=[{'all':!![]}];}_0x39e99d=_[_0x58d5('0x53')]({},_0x39e99d,_0x2a8f1c[_0x58d5('0x56')]);return db[_0x58d5('0x41')][_0x58d5('0x5b')](_0x39e99d)[_0x58d5('0x22')](handleEntityNotFound(_0x5f04cb,null))[_0x58d5('0x22')](respondWithResult(_0x5f04cb,null))['catch'](handleError(_0x5f04cb,null));};exports[_0x58d5('0x5c')]=function(_0x19a592,_0xf32e4c){return db[_0x58d5('0x41')][_0x58d5('0x5c')](_0x19a592[_0x58d5('0x5d')],{})[_0x58d5('0x22')](function(_0x5c44ce){var _0x41f570=_0x19a592['user'][_0x58d5('0x39')]({'plain':!![]});if(!_0x41f570)throw new Error(_0x58d5('0x5e'));if(_0x41f570[_0x58d5('0x5f')]===_0x58d5('0x60')){var _0x333c41=_0x5c44ce[_0x58d5('0x39')]({'plain':!![]});var _0x4cc0a7=_0x58d5('0x3a');return db['UserProfileSection'][_0x58d5('0x5b')]({'where':{'name':_0x4cc0a7,'userProfileId':_0x41f570['userProfileId']},'raw':!![]})[_0x58d5('0x22')](function(_0x1f39b9){if(_0x1f39b9&&_0x1f39b9['autoAssociation']===0x0){return db[_0x58d5('0x3b')][_0x58d5('0x5c')]({'name':_0x333c41[_0x58d5('0x3f')],'resourceId':_0x333c41['id'],'type':_0x1f39b9[_0x58d5('0x3f')],'sectionId':_0x1f39b9['id']},{})['then'](function(){return _0x5c44ce;});}else{return _0x5c44ce;}})[_0x58d5('0x2d')](function(_0x420c93){logger[_0x58d5('0x29')](_0x58d5('0x61'),_0x420c93);throw _0x420c93;});}return _0x5c44ce;})[_0x58d5('0x22')](respondWithResult(_0xf32e4c,0xc9))[_0x58d5('0x2d')](handleError(_0xf32e4c,null));};exports[_0x58d5('0x37')]=function(_0x362662,_0x323e2b){if(_0x362662[_0x58d5('0x5d')]['id']){delete _0x362662[_0x58d5('0x5d')]['id'];}return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x362662[_0x58d5('0x62')]['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0x323e2b,null))[_0x58d5('0x22')](saveUpdates(_0x362662[_0x58d5('0x5d')],null))['then'](respondWithResult(_0x323e2b,null))[_0x58d5('0x2d')](handleError(_0x323e2b,null));};exports[_0x58d5('0x38')]=function(_0x25b198,_0xf6cf43){return db['ChatQueue'][_0x58d5('0x5b')]({'where':{'id':_0x25b198[_0x58d5('0x62')]['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0xf6cf43,null))[_0x58d5('0x22')](removeEntity(_0xf6cf43,null))[_0x58d5('0x2d')](handleError(_0xf6cf43,null));};exports['describe']=function(_0x2f7012,_0x441755){return db[_0x58d5('0x41')][_0x58d5('0x63')]()[_0x58d5('0x22')](respondWithResult(_0x441755,null))[_0x58d5('0x2d')](handleError(_0x441755,null));};exports[_0x58d5('0x64')]=function(_0x5d9f82,_0x456dfd,_0x44b01b){var _0x57f523={'raw':!![],'where':{}},_0x18ee27={},_0x5e0373;return db[_0x58d5('0x41')][_0x58d5('0x65')]({'where':{'id':_0x5d9f82[_0x58d5('0x62')]['id']}})['then'](handleEntityNotFound(_0x456dfd,null))[_0x58d5('0x22')](function(_0x5c06ad){if(_0x5c06ad){_0x5e0373=_0x5c06ad[_0x58d5('0x39')]({'plain':!![]});_0x18ee27[_0x58d5('0x44')]=_[_0x58d5('0x45')](db['UserChatQueue']['rawAttributes']);_0x18ee27[_0x58d5('0x4b')]=_[_0x58d5('0x45')](_0x5d9f82[_0x58d5('0x4b')]);_0x18ee27[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x18ee27[_0x58d5('0x44')],_0x18ee27['query']);_0x57f523[_0x58d5('0x48')]=_[_0x58d5('0x47')](_0x18ee27[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x57f523['attributes']=_0x57f523['attributes'][_0x58d5('0x4a')]?_0x57f523[_0x58d5('0x48')]:_0x18ee27[_0x58d5('0x44')];if(!_0x5d9f82['query'][_0x58d5('0x4c')]('nolimit')){_0x57f523['limit']=qs['limit'](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x32')]);_0x57f523[_0x58d5('0x30')]=qs['offset'](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x30')]);}_0x57f523[_0x58d5('0x4e')]=qs[_0x58d5('0x4f')](_0x5d9f82[_0x58d5('0x4b')][_0x58d5('0x4f')]);_0x57f523['where']=qs['filters'](_[_0x58d5('0x51')](_0x5d9f82[_0x58d5('0x4b')],_0x18ee27[_0x58d5('0x46')]));_0x57f523[_0x58d5('0x50')][_0x58d5('0x66')]=_0x5c06ad['id'];if(_0x5d9f82['query'][_0x58d5('0x52')]){_0x57f523[_0x58d5('0x50')]=_['merge'](_0x57f523[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x57f523['attributes'],function(_0x3add3e){var _0x1b3fb7={};_0x1b3fb7[_0x3add3e]={'$like':'%'+_0x5d9f82['query']['filter']+'%'};return _0x1b3fb7;})});}_0x57f523=_[_0x58d5('0x53')]({},_0x57f523,_0x5d9f82[_0x58d5('0x56')]);return db['UserChatQueue'][_0x58d5('0x59')](_0x57f523);}})[_0x58d5('0x22')](function(_0x16d8a2){if(_0x16d8a2){return db[_0x58d5('0x67')][_0x58d5('0x68')]({'where':{'id':_[_0x58d5('0x54')](_0x16d8a2,_0x58d5('0x69')),'role':_0x58d5('0x6a')},'attributes':['id',_0x58d5('0x3f'),'chatPause',_0x58d5('0x6b'),_0x58d5('0x6c')]});}})[_0x58d5('0x22')](function(_0x4b25e8){if(_0x4b25e8){return{'count':_0x4b25e8[_0x58d5('0x33')],'rows':_[_0x58d5('0x54')](_0x4b25e8['rows'],function(_0x51d8d9){return{'membername':_0x51d8d9[_0x58d5('0x3f')],'UserId':_0x51d8d9['id'],'queue_name':_0x5e0373[_0x58d5('0x3f')],'ChatQueueId':_0x5e0373['id'],'interface':util[_0x58d5('0x6d')](_0x58d5('0x6e'),'SIP',_0x51d8d9[_0x58d5('0x3f')]),'penalty':0x0,'paused':_0x51d8d9[_0x58d5('0x6f')],'createdAt':_0x51d8d9[_0x58d5('0x6c')],'updatedAt':_0x51d8d9[_0x58d5('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x58d5('0x22')](respondWithFilteredResult(_0x456dfd,_0x57f523))[_0x58d5('0x2d')](handleError(_0x456dfd,null));};exports[_0x58d5('0x70')]=function(_0x56cf60,_0x20e3e5,_0x3afdff){var _0x345907={};var _0x28430b={};var _0x3960ee;var _0x3aa637;return db[_0x58d5('0x41')][_0x58d5('0x65')]({'where':{'id':_0x56cf60[_0x58d5('0x62')]['id']}})['then'](handleEntityNotFound(_0x20e3e5,null))[_0x58d5('0x22')](function(_0x4be29a){if(_0x4be29a){_0x3960ee=_0x4be29a;_0x28430b['model']=_[_0x58d5('0x45')](db[_0x58d5('0x71')][_0x58d5('0x42')]);_0x28430b[_0x58d5('0x4b')]=_[_0x58d5('0x45')](_0x56cf60['query']);_0x28430b[_0x58d5('0x46')]=_['intersection'](_0x28430b[_0x58d5('0x44')],_0x28430b[_0x58d5('0x4b')]);_0x345907['attributes']=_['intersection'](_0x28430b[_0x58d5('0x44')],qs[_0x58d5('0x49')](_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x345907[_0x58d5('0x48')]=_0x345907[_0x58d5('0x48')]['length']?_0x345907[_0x58d5('0x48')]:_0x28430b[_0x58d5('0x44')];_0x345907[_0x58d5('0x4e')]=qs['sort'](_0x56cf60['query'][_0x58d5('0x4f')]);_0x345907[_0x58d5('0x50')]=qs[_0x58d5('0x46')](_[_0x58d5('0x51')](_0x56cf60[_0x58d5('0x4b')],_0x28430b[_0x58d5('0x46')]));if(_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x52')]){_0x345907[_0x58d5('0x50')]=_[_0x58d5('0x53')](_0x345907[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x345907[_0x58d5('0x48')],function(_0x7d1038){var _0x5820c0={};_0x5820c0[_0x7d1038]={'$like':'%'+_0x56cf60['query']['filter']+'%'};return _0x5820c0;})});}_0x345907=_[_0x58d5('0x53')]({},_0x345907,_0x56cf60['options']);return _0x3960ee[_0x58d5('0x70')](_0x345907);}})[_0x58d5('0x22')](function(_0x5927a8){if(_0x5927a8){_0x3aa637=_0x5927a8[_0x58d5('0x4a')];if(!_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x4c')](_0x58d5('0x4d'))){_0x345907[_0x58d5('0x32')]=qs[_0x58d5('0x32')](_0x56cf60[_0x58d5('0x4b')]['limit']);_0x345907[_0x58d5('0x30')]=qs[_0x58d5('0x30')](_0x56cf60[_0x58d5('0x4b')][_0x58d5('0x30')]);}return _0x3960ee[_0x58d5('0x70')](_0x345907);}})[_0x58d5('0x22')](function(_0x3cd1ab){if(_0x3cd1ab){return _0x3cd1ab?{'count':_0x3aa637,'rows':_0x3cd1ab}:null;}})[_0x58d5('0x22')](respondWithResult(_0x20e3e5,null))[_0x58d5('0x2d')](handleError(_0x20e3e5,null));};exports[_0x58d5('0x72')]=function(_0x4b613f,_0x4ec9ec,_0x8aac2e){var _0x371d67=_0x4b613f[_0x58d5('0x5d')][_0x58d5('0x73')];return db[_0x58d5('0x71')][_0x58d5('0x59')]({'where':{'id':_0x371d67},'attributes':['id'],'include':[{'model':db[_0x58d5('0x67')],'as':_0x58d5('0x74'),'attributes':['id',_0x58d5('0x3f'),_0x58d5('0x75'),'voicePause',_0x58d5('0x76')],'raw':!![]}]})[_0x58d5('0x22')](function(_0x4c814b){if(_0x4c814b){var _0x5ef176=_[_0x58d5('0x77')](_0x4c814b,function(_0x3997cf){var _0x1b46f5=_0x3997cf[_0x58d5('0x39')]({'plain':!![]});return _0x1b46f5[_0x58d5('0x74')];});return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x4b613f[_0x58d5('0x62')]['id']}})['then'](function(_0x5844c2){return db['sequelize']['transaction'](function(_0x3f3435){return _0x5844c2[_0x58d5('0x72')](_0x371d67,{'transaction':_0x3f3435})[_0x58d5('0x22')](function(){return BPromise[_0x58d5('0x78')](_0x5ef176,function(_0x19f287){return db[_0x58d5('0x79')][_0x58d5('0x7a')]({'where':{'UserId':_0x19f287['id'],'ChatQueueId':_0x4b613f[_0x58d5('0x62')]['id']},'transaction':_0x3f3435});});})[_0x58d5('0x22')](function(){_0x5ef176[_0x58d5('0x7b')](function(_0x1d1f33){socket[_0x58d5('0x7c')](_0x58d5('0x7d'),{'UserId':_0x1d1f33['id'],'ChatQueueId':_0x5844c2['id']});});});});});}})[_0x58d5('0x22')](respondWithStatusCode(_0x4ec9ec,null))['catch'](handleError(_0x4ec9ec,null));};exports[_0x58d5('0x7e')]=function(_0xe13d18,_0x6a2300,_0x36c6e1){return db[_0x58d5('0x71')][_0x58d5('0x59')]({'where':{'id':_0xe13d18[_0x58d5('0x4b')][_0x58d5('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x58d5('0x22')](handleEntityNotFound(_0x6a2300,null))[_0x58d5('0x22')](function(_0x39acd6){var _0x582ae6=_[_0x58d5('0x54')](_0x39acd6,'id');var _0x4788cb=[];var _0x1995c4=[];var _0x1bb571=squel[_0x58d5('0x7f')]();_0x1bb571[_0x58d5('0x80')](_0x58d5('0x81'))[_0x58d5('0x82')]('team_has_chat_queues','tq')[_0x58d5('0x83')](_0x58d5('0x84'),'ut',_0x58d5('0x85'))['where'](_0x58d5('0x86'),_0xe13d18['params']['id']);for(var _0x22dfef=0x0;_0x22dfef<_0x39acd6[_0x58d5('0x4a')];_0x22dfef+=0x1){let _0xd9c492=_0x39acd6[_0x22dfef];for(var _0x2342e4=0x0;_0x2342e4<_0xd9c492[_0x58d5('0x74')]['length'];_0x2342e4+=0x1){let _0x51aec7=_0xd9c492[_0x58d5('0x74')][_0x2342e4];var _0x11288e=_0x1bb571[_0x58d5('0x87')]();_0x11288e[_0x58d5('0x50')](_0x58d5('0x88'),_0x51aec7['id']);_0x1995c4[_0x58d5('0x89')](db[_0x58d5('0x8a')][_0x58d5('0x4b')](_0x11288e[_0x58d5('0x8b')](),{'type':db[_0x58d5('0x8a')]['QueryTypes'][_0x58d5('0x8c')]})[_0x58d5('0x22')](function(_0x567774){if(_0x567774[_0x58d5('0x4a')]===0x1){return _0x51aec7['id'];}else{var _0x436ea0=_[_0x58d5('0x8d')](_[_0x58d5('0x54')](_0x567774,_0x58d5('0x8e')),function(_0x5af4b6){return _[_0x58d5('0x8f')](_0x582ae6,_0x5af4b6);});if(_0x436ea0){return _0x51aec7['id'];}}}));}}return BPromise[_0x58d5('0x90')](_0x1995c4)['then'](function(_0x1a0167){_0x4788cb=_(_0x4788cb)['union'](_0x1a0167)[_0x58d5('0x91')]()['value']();return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0xe13d18['params']['id']}})[_0x58d5('0x22')](function(_0x2184ae){return db[_0x58d5('0x8a')][_0x58d5('0x92')](function(_0x4f9bf1){return _0x2184ae[_0x58d5('0x7e')](_0xe13d18['query'][_0x58d5('0x73')],{'transaction':_0x4f9bf1})[_0x58d5('0x22')](function(){if(!_[_0x58d5('0x93')](_0x4788cb)){return _0x2184ae[_0x58d5('0x94')](_0x4788cb,{'transaction':_0x4f9bf1});}})['then'](function(){_0x4788cb[_0x58d5('0x7b')](function(_0x32b551){socket['emit'](_0x58d5('0x95'),{'UserId':_0x32b551,'ChatQueueId':_0x2184ae['id']});});});});});});})[_0x58d5('0x22')](respondWithStatusCode(_0x6a2300,null))['catch'](handleError(_0x6a2300,null));};exports[_0x58d5('0x96')]=function(_0x14d29c,_0xe9e277,_0x211c2a){return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x14d29c[_0x58d5('0x62')]['id']}})['then'](handleEntityNotFound(_0xe9e277,null))[_0x58d5('0x22')](function(_0x2e7fa4){if(_0x2e7fa4){return _0x2e7fa4['addAgents'](_0x14d29c[_0x58d5('0x5d')][_0x58d5('0x73')],_[_0x58d5('0x97')](_0x14d29c['body'],[_0x58d5('0x73'),'id'])||{})[_0x58d5('0x98')](function(_0x39a2c1){for(var _0x62b60d=0x0;_0x62b60d<_0x14d29c[_0x58d5('0x5d')]['ids'][_0x58d5('0x4a')];_0x62b60d+=0x1){socket[_0x58d5('0x7c')]('userChatQueue:save',{'UserId':_0x14d29c[_0x58d5('0x5d')][_0x58d5('0x73')][_0x62b60d],'ChatQueueId':_0x14d29c[_0x58d5('0x62')]['id']});}return _0x39a2c1;});}})[_0x58d5('0x22')](respondWithResult(_0xe9e277,null))['catch'](handleError(_0xe9e277,null));};exports[_0x58d5('0x94')]=function(_0x3986b4,_0x1762ac,_0x45d3f4){return db[_0x58d5('0x41')][_0x58d5('0x5b')]({'where':{'id':_0x3986b4['params']['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0x1762ac,null))[_0x58d5('0x22')](function(_0x4c5078){if(_0x4c5078){return _0x4c5078['removeAgents'](_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')])['then'](function(){if(_[_0x58d5('0x99')](_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')])){for(var _0x51e8c4=0x0;_0x51e8c4<_0x3986b4[_0x58d5('0x4b')]['ids'][_0x58d5('0x4a')];_0x51e8c4+=0x1){socket[_0x58d5('0x7c')](_0x58d5('0x95'),{'UserId':Number(_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')][_0x51e8c4]),'ChatQueueId':Number(_0x3986b4[_0x58d5('0x62')]['id'])});}}else{socket[_0x58d5('0x7c')](_0x58d5('0x95'),{'UserId':Number(_0x3986b4[_0x58d5('0x4b')][_0x58d5('0x73')]),'ChatQueueId':Number(_0x3986b4[_0x58d5('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x1762ac,null))[_0x58d5('0x2d')](handleError(_0x1762ac,null));};exports['getAgents']=function(_0x102748,_0x1c2e66,_0x404f55){var _0x11b38f={};var _0x5ef0e1={};var _0x37917f;var _0xaf9efa;return db[_0x58d5('0x41')][_0x58d5('0x65')]({'where':{'id':_0x102748['params']['id']}})[_0x58d5('0x22')](handleEntityNotFound(_0x1c2e66,null))[_0x58d5('0x22')](function(_0x123be3){if(_0x123be3){_0x37917f=_0x123be3;_0x5ef0e1[_0x58d5('0x44')]=_[_0x58d5('0x45')](db['User']['rawAttributes']);_0x5ef0e1['query']=_['keys'](_0x102748[_0x58d5('0x4b')]);_0x5ef0e1[_0x58d5('0x46')]=_[_0x58d5('0x47')](_0x5ef0e1[_0x58d5('0x44')],_0x5ef0e1['query']);_0x11b38f[_0x58d5('0x48')]=_[_0x58d5('0x47')](_0x5ef0e1['model'],qs[_0x58d5('0x49')](_0x102748[_0x58d5('0x4b')][_0x58d5('0x49')]));_0x11b38f['attributes']=_0x11b38f['attributes']['length']?_0x11b38f[_0x58d5('0x48')]:_0x5ef0e1[_0x58d5('0x44')];_0x11b38f[_0x58d5('0x4e')]=qs[_0x58d5('0x4f')](_0x102748[_0x58d5('0x4b')][_0x58d5('0x4f')]);_0x11b38f[_0x58d5('0x50')]=qs['filters'](_[_0x58d5('0x51')](_0x102748[_0x58d5('0x4b')],_0x5ef0e1[_0x58d5('0x46')]));if(_0x102748[_0x58d5('0x4b')]['filter']){_0x11b38f[_0x58d5('0x50')]=_[_0x58d5('0x53')](_0x11b38f[_0x58d5('0x50')],{'$or':_[_0x58d5('0x54')](_0x11b38f['attributes'],function(_0x261c88){var _0x5af832={};_0x5af832[_0x261c88]={'$like':'%'+_0x102748[_0x58d5('0x4b')][_0x58d5('0x52')]+'%'};return _0x5af832;})});}_0x11b38f=_[_0x58d5('0x53')]({},_0x11b38f,_0x102748[_0x58d5('0x56')]);return _0x37917f[_0x58d5('0x9a')](_0x11b38f);}})[_0x58d5('0x22')](function(_0x2f5e9c){if(_0x2f5e9c){_0xaf9efa=_0x2f5e9c[_0x58d5('0x4a')];if(!_0x102748['query'][_0x58d5('0x4c')](_0x58d5('0x4d'))){_0x11b38f['limit']=qs[_0x58d5('0x32')](_0x102748['query'][_0x58d5('0x32')]);_0x11b38f[_0x58d5('0x30')]=qs[_0x58d5('0x30')](_0x102748[_0x58d5('0x4b')][_0x58d5('0x30')]);}return _0x37917f[_0x58d5('0x9a')](_0x11b38f);}})[_0x58d5('0x22')](function(_0x58da8e){if(_0x58da8e){return _0x58da8e?{'count':_0xaf9efa,'rows':_0x58da8e}:null;}})[_0x58d5('0x22')](respondWithResult(_0x1c2e66,null))['catch'](handleError(_0x1c2e66,null));};
\ No newline at end of file
index 27a8cc7..91c9176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6e=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x44cf11,_0x2b3e94){var _0x340b46=function(_0x239e00){while(--_0x239e00){_0x44cf11['push'](_0x44cf11['shift']());}};_0x340b46(++_0x2b3e94);}(_0xdb6e,0x179));var _0xedb6=function(_0x3b3e54,_0x27f854){_0x3b3e54=_0x3b3e54-0x0;var _0x4f86e1=_0xdb6e[_0x3b3e54];return _0x4f86e1;};'use strict';var EventEmitter=require(_0xedb6('0x0'));var ChatQueue=require(_0xedb6('0x1'))['db'][_0xedb6('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xedb6('0x3')](0x0);var events={'afterCreate':_0xedb6('0x4'),'afterUpdate':_0xedb6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x11173a){return function(_0x42207a,_0x2965e8,_0x473708){ChatQueueEvents[_0xedb6('0x6')](_0x11173a+':'+_0x42207a['id'],_0x42207a);ChatQueueEvents[_0xedb6('0x6')](_0x11173a,_0x42207a);_0x473708(null);};}for(var e in events){if(events[_0xedb6('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xedb6('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x9e1f=['emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0xc941ea,_0x408c2e){var _0x3b0f27=function(_0x5a4233){while(--_0x5a4233){_0xc941ea['push'](_0xc941ea['shift']());}};_0x3b0f27(++_0x408c2e);}(_0x9e1f,0x9c));var _0xf9e1=function(_0x38dd3d,_0x102650){_0x38dd3d=_0x38dd3d-0x0;var _0x3d55c0=_0x9e1f[_0x38dd3d];return _0x3d55c0;};'use strict';var EventEmitter=require(_0xf9e1('0x0'));var ChatQueue=require(_0xf9e1('0x1'))['db'][_0xf9e1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf9e1('0x3')](0x0);var events={'afterCreate':_0xf9e1('0x4'),'afterUpdate':_0xf9e1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e030c){return function(_0x46447,_0x6249ac,_0x315da2){ChatQueueEvents[_0xf9e1('0x6')](_0x4e030c+':'+_0x46447['id'],_0x46447);ChatQueueEvents[_0xf9e1('0x6')](_0x4e030c,_0x46447);_0x315da2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xf9e1('0x7')](e,emitEvent(event));}}module[_0xf9e1('0x8')]=ChatQueueEvents;
\ No newline at end of file
index c1f4882..bb502f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea0d=['rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x22bff1,_0x1d964a){var _0x279396=function(_0x2573c7){while(--_0x2573c7){_0x22bff1['push'](_0x22bff1['shift']());}};_0x279396(++_0x1d964a);}(_0xea0d,0x124));var _0xdea0=function(_0x201ed2,_0x1042cc){_0x201ed2=_0x201ed2-0x0;var _0x138582=_0xea0d[_0x201ed2];return _0x138582;};'use strict';var _=require(_0xdea0('0x0'));var util=require(_0xdea0('0x1'));var logger=require(_0xdea0('0x2'))('api');var moment=require(_0xdea0('0x3'));var BPromise=require(_0xdea0('0x4'));var rp=require(_0xdea0('0x5'));var fs=require('fs');var path=require(_0xdea0('0x6'));var rimraf=require(_0xdea0('0x7'));var config=require('../../config/environment');var attributes=require(_0xdea0('0x8'));module[_0xdea0('0x9')]=function(_0x350083,_0x2100a4){return _0x350083[_0xdea0('0xa')](_0xdea0('0xb'),attributes,{'tableName':_0xdea0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83fa=['define','ChatQueue','chat_queues','lodash','util','moment','bluebird','path','rimraf','./chatQueue.attributes'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x83fa,0xb7));var _0xa83f=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x83fa[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0xa83f('0x0'));var util=require(_0xa83f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa83f('0x2'));var BPromise=require(_0xa83f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa83f('0x4'));var rimraf=require(_0xa83f('0x5'));var config=require('../../config/environment');var attributes=require(_0xa83f('0x6'));module['exports']=function(_0x12ae59,_0x401a2e){return _0x12ae59[_0xa83f('0x7')](_0xa83f('0x8'),attributes,{'tableName':_0xa83f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce7569b..7daafff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cda=['attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','ChatQueue,\x20%s,\x20%s','ChatQueue','options','raw','where'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa8cd('0x0'));var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require(_0xa8cd('0x4'));var db=require(_0xa8cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require(_0xa8cd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x9')][_0xa8cd('0xa')]({'port':0x232a});config[_0xa8cd('0xb')]=_[_0xa8cd('0xc')](config[_0xa8cd('0xb')],{'host':_0xa8cd('0xd'),'port':0x18eb});var socket=require(_0xa8cd('0xe'))(new Redis(config[_0xa8cd('0xb')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x58da0a,_0x2a3645,_0x4dfa9f){return new BPromise(function(_0x1cb52f,_0x3e6bed){return client['request'](_0x58da0a,_0x4dfa9f)[_0xa8cd('0xf')](function(_0x2221c1){logger['info']('ChatQueue,\x20%s,\x20%s',_0x2a3645,_0xa8cd('0x10'));logger[_0xa8cd('0x11')](_0xa8cd('0x12'),_0x2a3645,_0xa8cd('0x10'),JSON[_0xa8cd('0x13')](_0x2221c1));if(_0x2221c1['error']){if(_0x2221c1[_0xa8cd('0x14')]['code']===0x1f4){logger[_0xa8cd('0x14')]('ChatQueue,\x20%s,\x20%s',_0x2a3645,_0x2221c1[_0xa8cd('0x14')]['message']);return _0x3e6bed(_0x2221c1[_0xa8cd('0x14')][_0xa8cd('0x15')]);}logger[_0xa8cd('0x14')]('ChatQueue,\x20%s,\x20%s',_0x2a3645,_0x2221c1['error'][_0xa8cd('0x15')]);return _0x1cb52f(_0x2221c1[_0xa8cd('0x14')][_0xa8cd('0x15')]);}else{logger[_0xa8cd('0x16')]('ChatQueue,\x20%s,\x20%s',_0x2a3645,_0xa8cd('0x10'));_0x1cb52f(_0x2221c1['result'][_0xa8cd('0x15')]);}})[_0xa8cd('0x17')](function(_0x572230){logger[_0xa8cd('0x14')](_0xa8cd('0x18'),_0x2a3645,_0x572230);_0x3e6bed(_0x572230);});});}exports['GetChatQueue']=function(_0x2acedd){var _0x385224=this;return new Promise(function(_0x1ecce0,_0x289cb6){return db[_0xa8cd('0x19')]['findAll']({'raw':_0x2acedd[_0xa8cd('0x1a')]?_0x2acedd[_0xa8cd('0x1a')][_0xa8cd('0x1b')]===undefined?!![]:![]:!![],'where':_0x2acedd[_0xa8cd('0x1a')]?_0x2acedd['options'][_0xa8cd('0x1c')]||null:null,'attributes':_0x2acedd['options']?_0x2acedd['options'][_0xa8cd('0x1d')]||null:null,'limit':_0x2acedd[_0xa8cd('0x1a')]?_0x2acedd['options'][_0xa8cd('0x1e')]||null:null,'include':_0x2acedd[_0xa8cd('0x1a')]?_0x2acedd[_0xa8cd('0x1a')][_0xa8cd('0x1f')]?_[_0xa8cd('0x20')](_0x2acedd[_0xa8cd('0x1a')][_0xa8cd('0x1f')],function(_0x4a5221){return{'model':db[_0x4a5221[_0xa8cd('0x21')]],'as':_0x4a5221['as'],'attributes':_0x4a5221[_0xa8cd('0x1d')],'include':_0x4a5221[_0xa8cd('0x1f')]?_[_0xa8cd('0x20')](_0x4a5221[_0xa8cd('0x1f')],function(_0x433a5d){return{'model':db[_0x433a5d['model']],'as':_0x433a5d['as'],'attributes':_0x433a5d[_0xa8cd('0x1d')],'include':_0x433a5d[_0xa8cd('0x1f')]?_[_0xa8cd('0x20')](_0x433a5d[_0xa8cd('0x1f')],function(_0xe973cb){return{'model':db[_0xe973cb[_0xa8cd('0x21')]],'as':_0xe973cb['as'],'attributes':_0xe973cb[_0xa8cd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa8cd('0xf')](function(_0x2a99e6){logger[_0xa8cd('0x16')](_0xa8cd('0x22'),_0x2acedd);logger[_0xa8cd('0x11')](_0xa8cd('0x22'),_0x2acedd,JSON[_0xa8cd('0x13')](_0x2a99e6));_0x1ecce0(_0x2a99e6);})[_0xa8cd('0x17')](function(_0x3c188f){logger['error']('GetChatQueue',_0x3c188f['message'],_0x2acedd);_0x289cb6(_0x385224[_0xa8cd('0x14')](0x1f4,_0x3c188f[_0xa8cd('0x15')]));});});};exports[_0xa8cd('0x23')]=function(_0x3f10a1){var _0x297e79=this;return new Promise(function(_0x3ffa3e,_0x53830e){return db['ChatQueue']['find']({'raw':_0x3f10a1[_0xa8cd('0x1a')]?_0x3f10a1[_0xa8cd('0x1a')][_0xa8cd('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f10a1[_0xa8cd('0x1a')]?_0x3f10a1[_0xa8cd('0x1a')][_0xa8cd('0x1c')]||null:null,'attributes':_0x3f10a1[_0xa8cd('0x1a')]?_0x3f10a1['options'][_0xa8cd('0x1d')]||null:null,'include':_0x3f10a1[_0xa8cd('0x1a')]?_0x3f10a1['options'][_0xa8cd('0x1f')]?_[_0xa8cd('0x20')](_0x3f10a1[_0xa8cd('0x1a')][_0xa8cd('0x1f')],function(_0x49d00e){return{'model':db[_0x49d00e[_0xa8cd('0x21')]],'as':_0x49d00e['as'],'attributes':_0x49d00e[_0xa8cd('0x1d')],'include':_0x49d00e['include']?_[_0xa8cd('0x20')](_0x49d00e[_0xa8cd('0x1f')],function(_0x14c3d0){return{'model':db[_0x14c3d0[_0xa8cd('0x21')]],'as':_0x14c3d0['as'],'attributes':_0x14c3d0['attributes'],'include':_0x14c3d0['include']?_[_0xa8cd('0x20')](_0x14c3d0['include'],function(_0x103a20){return{'model':db[_0x103a20['model']],'as':_0x103a20['as'],'attributes':_0x103a20[_0xa8cd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa8cd('0xf')](function(_0x49af01){logger[_0xa8cd('0x16')](_0xa8cd('0x23'),_0x3f10a1);logger[_0xa8cd('0x11')](_0xa8cd('0x23'),_0x3f10a1,JSON[_0xa8cd('0x13')](_0x49af01));_0x3ffa3e(_0x49af01);})[_0xa8cd('0x17')](function(_0x1b595e){logger['error'](_0xa8cd('0x23'),_0x1b595e[_0xa8cd('0x15')],_0x3f10a1);_0x53830e(_0x297e79['error'](0x1f4,_0x1b595e['message']));});});};
\ No newline at end of file
+var _0x3af5=['redis','localhost','socket.io-emitter','./chatQueue.socket','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowChatQueue','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','defaults'];(function(_0x320f74,_0x552318){var _0xc043ab=function(_0x5c8ef1){while(--_0x5c8ef1){_0x320f74['push'](_0x320f74['shift']());}};_0xc043ab(++_0x552318);}(_0x3af5,0x1d3));var _0x53af=function(_0x4c1b76,_0x2cdc2d){_0x4c1b76=_0x4c1b76-0x0;var _0x3ace6b=_0x3af5[_0x4c1b76];return _0x3ace6b;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var moment=require('moment');var BPromise=require(_0x53af('0x2'));var rs=require(_0x53af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x53af('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x53af('0x5'));var jayson=require(_0x53af('0x6'));var client=jayson['client'][_0x53af('0x7')]({'port':0x232a});config['redis']=_[_0x53af('0x8')](config[_0x53af('0x9')],{'host':_0x53af('0xa'),'port':0x18eb});var socket=require(_0x53af('0xb'))(new Redis(config[_0x53af('0x9')]));require(_0x53af('0xc'))['register'](socket);function respondWithRpcPromise(_0x52b4d1,_0x10ee70,_0x5727e6){return new BPromise(function(_0x370cdc,_0x4673a9){return client['request'](_0x52b4d1,_0x5727e6)[_0x53af('0xd')](function(_0x1a08ca){logger['info'](_0x53af('0xe'),_0x10ee70,_0x53af('0xf'));logger[_0x53af('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x10ee70,_0x53af('0xf'),JSON['stringify'](_0x1a08ca));if(_0x1a08ca[_0x53af('0x11')]){if(_0x1a08ca[_0x53af('0x11')][_0x53af('0x12')]===0x1f4){logger[_0x53af('0x11')](_0x53af('0xe'),_0x10ee70,_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);return _0x4673a9(_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);}logger[_0x53af('0x11')]('ChatQueue,\x20%s,\x20%s',_0x10ee70,_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);return _0x370cdc(_0x1a08ca[_0x53af('0x11')][_0x53af('0x13')]);}else{logger[_0x53af('0x14')](_0x53af('0xe'),_0x10ee70,_0x53af('0xf'));_0x370cdc(_0x1a08ca['result'][_0x53af('0x13')]);}})[_0x53af('0x15')](function(_0xae3142){logger[_0x53af('0x11')]('ChatQueue,\x20%s,\x20%s',_0x10ee70,_0xae3142);_0x4673a9(_0xae3142);});});}exports['GetChatQueue']=function(_0x167dc2){var _0x3f5503=this;return new Promise(function(_0x37ecb3,_0x5a31d6){return db[_0x53af('0x16')][_0x53af('0x17')]({'raw':_0x167dc2[_0x53af('0x18')]?_0x167dc2[_0x53af('0x18')][_0x53af('0x19')]===undefined?!![]:![]:!![],'where':_0x167dc2[_0x53af('0x18')]?_0x167dc2[_0x53af('0x18')][_0x53af('0x1a')]||null:null,'attributes':_0x167dc2['options']?_0x167dc2[_0x53af('0x18')][_0x53af('0x1b')]||null:null,'limit':_0x167dc2[_0x53af('0x18')]?_0x167dc2[_0x53af('0x18')][_0x53af('0x1c')]||null:null,'include':_0x167dc2[_0x53af('0x18')]?_0x167dc2['options'][_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x167dc2[_0x53af('0x18')][_0x53af('0x1d')],function(_0x480665){return{'model':db[_0x480665[_0x53af('0x1f')]],'as':_0x480665['as'],'attributes':_0x480665[_0x53af('0x1b')],'include':_0x480665[_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x480665[_0x53af('0x1d')],function(_0x152dcc){return{'model':db[_0x152dcc[_0x53af('0x1f')]],'as':_0x152dcc['as'],'attributes':_0x152dcc[_0x53af('0x1b')],'include':_0x152dcc['include']?_[_0x53af('0x1e')](_0x152dcc[_0x53af('0x1d')],function(_0xc9b0df){return{'model':db[_0xc9b0df[_0x53af('0x1f')]],'as':_0xc9b0df['as'],'attributes':_0xc9b0df[_0x53af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x53af('0xd')](function(_0x154cc2){logger['info']('GetChatQueue',_0x167dc2);logger[_0x53af('0x10')]('GetChatQueue',_0x167dc2,JSON[_0x53af('0x20')](_0x154cc2));_0x37ecb3(_0x154cc2);})[_0x53af('0x15')](function(_0x38563d){logger[_0x53af('0x11')]('GetChatQueue',_0x38563d[_0x53af('0x13')],_0x167dc2);_0x5a31d6(_0x3f5503[_0x53af('0x11')](0x1f4,_0x38563d['message']));});});};exports['ShowChatQueue']=function(_0xc0dae3){var _0x1fa69c=this;return new Promise(function(_0x1a688c,_0x243ee5){return db['ChatQueue']['find']({'raw':_0xc0dae3[_0x53af('0x18')]?_0xc0dae3[_0x53af('0x18')][_0x53af('0x19')]===undefined?!![]:![]:!![],'where':_0xc0dae3['options']?_0xc0dae3['options'][_0x53af('0x1a')]||null:null,'attributes':_0xc0dae3[_0x53af('0x18')]?_0xc0dae3[_0x53af('0x18')][_0x53af('0x1b')]||null:null,'include':_0xc0dae3[_0x53af('0x18')]?_0xc0dae3[_0x53af('0x18')][_0x53af('0x1d')]?_['map'](_0xc0dae3[_0x53af('0x18')][_0x53af('0x1d')],function(_0x51784e){return{'model':db[_0x51784e[_0x53af('0x1f')]],'as':_0x51784e['as'],'attributes':_0x51784e[_0x53af('0x1b')],'include':_0x51784e[_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x51784e[_0x53af('0x1d')],function(_0x576bfc){return{'model':db[_0x576bfc[_0x53af('0x1f')]],'as':_0x576bfc['as'],'attributes':_0x576bfc['attributes'],'include':_0x576bfc[_0x53af('0x1d')]?_[_0x53af('0x1e')](_0x576bfc[_0x53af('0x1d')],function(_0x1213a6){return{'model':db[_0x1213a6[_0x53af('0x1f')]],'as':_0x1213a6['as'],'attributes':_0x1213a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e3295){logger[_0x53af('0x14')]('ShowChatQueue',_0xc0dae3);logger['debug']('ShowChatQueue',_0xc0dae3,JSON[_0x53af('0x20')](_0x5e3295));_0x1a688c(_0x5e3295);})[_0x53af('0x15')](function(_0x440655){logger[_0x53af('0x11')](_0x53af('0x21'),_0x440655[_0x53af('0x13')],_0xc0dae3);_0x243ee5(_0x1fa69c[_0x53af('0x11')](0x1f4,_0x440655[_0x53af('0x13')]));});});};
\ No newline at end of file
index 688cd5a..2d788ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x460495,_0x1e5e3b){var _0x23c788=function(_0x3451df){while(--_0x3451df){_0x460495['push'](_0x460495['shift']());}};_0x23c788(++_0x1e5e3b);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x3901c4,_0x17a80c){_0x3901c4=_0x3901c4-0x0;var _0x4becd1=_0xd6d6[_0x3901c4];return _0x4becd1;};'use strict';var ChatQueueEvents=require(_0x6d6d('0x0'));var events=[_0x6d6d('0x1'),_0x6d6d('0x2'),_0x6d6d('0x3')];function createListener(_0x536523,_0x2e1aed){return function(_0x3b743d){_0x2e1aed[_0x6d6d('0x4')](_0x536523,_0x3b743d);};}function removeListener(_0x2a838a,_0x5207c9){return function(){ChatQueueEvents[_0x6d6d('0x5')](_0x2a838a,_0x5207c9);};}exports[_0x6d6d('0x6')]=function(_0x5702dc){for(var _0x210ff7=0x0,_0x1bf731=events[_0x6d6d('0x7')];_0x210ff7<_0x1bf731;_0x210ff7++){var _0x18f824=events[_0x210ff7];var _0xd49f57=createListener(_0x6d6d('0x8')+_0x18f824,_0x5702dc);ChatQueueEvents['on'](_0x18f824,_0xd49f57);}};
\ No newline at end of file
+var _0x5089=['length','chatQueue:','./chatQueue.events','save','update','emit','register'];(function(_0x560912,_0x551971){var _0x2767e9=function(_0x138e60){while(--_0x138e60){_0x560912['push'](_0x560912['shift']());}};_0x2767e9(++_0x551971);}(_0x5089,0x1bb));var _0x9508=function(_0x3015f9,_0x6eeb0d){_0x3015f9=_0x3015f9-0x0;var _0x3390b6=_0x5089[_0x3015f9];return _0x3390b6;};'use strict';var ChatQueueEvents=require(_0x9508('0x0'));var events=[_0x9508('0x1'),'remove',_0x9508('0x2')];function createListener(_0x35878a,_0x7dd13d){return function(_0x100d7e){_0x7dd13d[_0x9508('0x3')](_0x35878a,_0x100d7e);};}function removeListener(_0x59d3ee,_0x86540d){return function(){ChatQueueEvents['removeListener'](_0x59d3ee,_0x86540d);};}exports[_0x9508('0x4')]=function(_0x4538dd){for(var _0x257318=0x0,_0x4ab3c6=events[_0x9508('0x5')];_0x257318<_0x4ab3c6;_0x257318++){var _0x42d13a=events[_0x257318];var _0x55a5de=createListener(_0x9508('0x6')+_0x42d13a,_0x4538dd);ChatQueueEvents['on'](_0x42d13a,_0x55a5de);}};
\ No newline at end of file
index f145bd2..e8483bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0x5fc3[_0x344adc];return _0x4014b2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x478cf4,_0x25c2e5){_0x478cf4=_0x478cf4-0x0;var _0x59273e=_0x3e74[_0x478cf4];return _0x59273e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
index 80c0dc9..2475849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb935=['sequelize','exports','DATE','STRING'];(function(_0xae5689,_0x4bb51a){var _0x472cb0=function(_0x1ab254){while(--_0x1ab254){_0xae5689['push'](_0xae5689['shift']());}};_0x472cb0(++_0x4bb51a);}(_0xb935,0xb0));var _0x5b93=function(_0x2c4b5d,_0xead20e){_0x2c4b5d=_0x2c4b5d-0x0;var _0x2b1c54=_0xb935[_0x2c4b5d];return _0x2b1c54;};'use strict';var moment=require('moment');var Sequelize=require(_0x5b93('0x0'));module[_0x5b93('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5b93('0x2')]},'acceptAt':{'type':Sequelize[_0x5b93('0x2')]},'exitAt':{'type':Sequelize[_0x5b93('0x2')]},'reason':{'type':Sequelize[_0x5b93('0x3')]}};
\ No newline at end of file
+var _0x4e2e=['exports','STRING','DATE','moment','sequelize'];(function(_0x266628,_0x3e9ed8){var _0x3103c8=function(_0x54ac81){while(--_0x54ac81){_0x266628['push'](_0x266628['shift']());}};_0x3103c8(++_0x3e9ed8);}(_0x4e2e,0x193));var _0xe4e2=function(_0x29f740,_0x557fa9){_0x29f740=_0x29f740-0x0;var _0x200a0e=_0x4e2e[_0x29f740];return _0x200a0e;};'use strict';var moment=require(_0xe4e2('0x0'));var Sequelize=require(_0xe4e2('0x1'));module[_0xe4e2('0x2')]={'uniqueid':{'type':Sequelize[_0xe4e2('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe4e2('0x4')]},'leaveAt':{'type':Sequelize[_0xe4e2('0x4')]},'acceptAt':{'type':Sequelize[_0xe4e2('0x4')]},'exitAt':{'type':Sequelize[_0xe4e2('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cd126a0..7dcceab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22b4=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','error','send','map','ChatQueueReport','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x111899,_0x2c9f4a){var _0x129226=function(_0x13070c){while(--_0x13070c){_0x111899['push'](_0x111899['shift']());}};_0x129226(++_0x2c9f4a);}(_0x22b4,0x8b));var _0x422b=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x22b4[_0x45783c];return _0x1161da;};'use strict';var emlformat=require(_0x422b('0x0'));var rimraf=require(_0x422b('0x1'));var zipdir=require(_0x422b('0x2'));var jsonpatch=require(_0x422b('0x3'));var rp=require(_0x422b('0x4'));var moment=require(_0x422b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x422b('0x6'));var util=require(_0x422b('0x7'));var path=require('path');var sox=require(_0x422b('0x8'));var csv=require(_0x422b('0x9'));var ejs=require(_0x422b('0xa'));var fs=require('fs');var fs_extra=require(_0x422b('0xb'));var _=require(_0x422b('0xc'));var squel=require(_0x422b('0xd'));var crypto=require('crypto');var jsforce=require(_0x422b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x422b('0x9'));var querystring=require(_0x422b('0xf'));var Papa=require(_0x422b('0x10'));var Redis=require(_0x422b('0x11'));var authService=require(_0x422b('0x12'));var qs=require(_0x422b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x422b('0x14'));var logger=require(_0x422b('0x15'))(_0x422b('0x16'));var utils=require(_0x422b('0x17'));var config=require(_0x422b('0x18'));var licenseUtil=require(_0x422b('0x19'));var db=require(_0x422b('0x1a'))['db'];function respondWithStatusCode(_0x4527c5,_0x4b944c){_0x4b944c=_0x4b944c||0xcc;return function(_0x5f24aa){if(_0x5f24aa){return _0x4527c5[_0x422b('0x1b')](_0x4b944c);}return _0x4527c5[_0x422b('0x1c')](_0x4b944c)[_0x422b('0x1d')]();};}function respondWithResult(_0x803900,_0x2eadaa){_0x2eadaa=_0x2eadaa||0xc8;return function(_0x310622){if(_0x310622){return _0x803900[_0x422b('0x1c')](_0x2eadaa)[_0x422b('0x1e')](_0x310622);}};}function respondWithFilteredResult(_0x52a967,_0x1e40eb){return function(_0x50a914){if(_0x50a914){var _0x3a98d6=typeof _0x1e40eb[_0x422b('0x1f')]===_0x422b('0x20')&&typeof _0x1e40eb[_0x422b('0x21')]===_0x422b('0x20');var _0x433d0b=_0x50a914['count'];var _0x338cf4=_0x3a98d6?0x0:_0x1e40eb[_0x422b('0x1f')];var _0x1fdb00=_0x3a98d6?_0x50a914['count']:_0x1e40eb[_0x422b('0x1f')]+_0x1e40eb[_0x422b('0x21')];var _0x1aa3bf;if(_0x1fdb00>=_0x433d0b){_0x1fdb00=_0x433d0b;_0x1aa3bf=0xc8;}else{_0x1aa3bf=0xce;}_0x52a967[_0x422b('0x1c')](_0x1aa3bf);return _0x52a967[_0x422b('0x22')](_0x422b('0x23'),_0x338cf4+'-'+_0x1fdb00+'/'+_0x433d0b)[_0x422b('0x1e')](_0x50a914);}return null;};}function patchUpdates(_0x51049c){return function(_0x38665f){try{jsonpatch['apply'](_0x38665f,_0x51049c,!![]);}catch(_0x542b3c){return BPromise[_0x422b('0x24')](_0x542b3c);}return _0x38665f['save']();};}function saveUpdates(_0x44f98c,_0x5d1582){return function(_0x3f7619){if(_0x3f7619){return _0x3f7619[_0x422b('0x25')](_0x44f98c)[_0x422b('0x26')](function(_0x5d0f47){return _0x5d0f47;});}return null;};}function removeEntity(_0x394c50,_0x21fb07){return function(_0x3c34db){if(_0x3c34db){return _0x3c34db[_0x422b('0x27')]()[_0x422b('0x26')](function(){_0x394c50[_0x422b('0x1c')](0xcc)[_0x422b('0x1d')]();});}};}function handleEntityNotFound(_0x1f7d44,_0x3baba8){return function(_0x22b089){if(!_0x22b089){_0x1f7d44[_0x422b('0x1b')](0x194);}return _0x22b089;};}function handleError(_0x5dbdad,_0x954459){_0x954459=_0x954459||0x1f4;return function(_0x3d85ec){logger[_0x422b('0x28')](_0x3d85ec['stack']);if(_0x3d85ec['name']){delete _0x3d85ec['name'];}_0x5dbdad[_0x422b('0x1c')](_0x954459)[_0x422b('0x29')](_0x3d85ec);};}exports['index']=function(_0xf19907,_0x124a74){var _0xedfad={},_0x24b86b={},_0xba7f0e={'count':0x0,'rows':[]};var _0x19a4e8=_[_0x422b('0x2a')](db[_0x422b('0x2b')]['rawAttributes'],function(_0x55779d){return{'name':_0x55779d[_0x422b('0x2c')],'type':_0x55779d[_0x422b('0x2d')][_0x422b('0x2e')]};});_0x24b86b['model']=_[_0x422b('0x2a')](_0x19a4e8,_0x422b('0x2f'));_0x24b86b['query']=_[_0x422b('0x30')](_0xf19907[_0x422b('0x31')]);_0x24b86b[_0x422b('0x32')]=_[_0x422b('0x33')](_0x24b86b[_0x422b('0x34')],_0x24b86b[_0x422b('0x31')]);_0xedfad[_0x422b('0x35')]=_[_0x422b('0x33')](_0x24b86b[_0x422b('0x34')],qs[_0x422b('0x36')](_0xf19907[_0x422b('0x31')][_0x422b('0x36')]));_0xedfad['attributes']=_0xedfad[_0x422b('0x35')][_0x422b('0x37')]?_0xedfad['attributes']:_0x24b86b[_0x422b('0x34')];if(!_0xf19907[_0x422b('0x31')][_0x422b('0x38')](_0x422b('0x39'))){_0xedfad[_0x422b('0x21')]=qs[_0x422b('0x21')](_0xf19907[_0x422b('0x31')][_0x422b('0x21')]);_0xedfad[_0x422b('0x1f')]=qs[_0x422b('0x1f')](_0xf19907['query'][_0x422b('0x1f')]);}_0xedfad[_0x422b('0x3a')]=qs[_0x422b('0x3b')](_0xf19907[_0x422b('0x31')][_0x422b('0x3b')]);_0xedfad[_0x422b('0x3c')]=qs[_0x422b('0x32')](_[_0x422b('0x3d')](_0xf19907[_0x422b('0x31')],_0x24b86b[_0x422b('0x32')]),_0x19a4e8);if(_0xf19907['query'][_0x422b('0x3e')]){_0xedfad[_0x422b('0x3c')]=_[_0x422b('0x3f')](_0xedfad[_0x422b('0x3c')],{'$or':_[_0x422b('0x2a')](_0x19a4e8,function(_0x374b1f){if(_0x374b1f[_0x422b('0x2d')]!==_0x422b('0x40')){var _0x48d703={};_0x48d703[_0x374b1f[_0x422b('0x2f')]]={'$like':'%'+_0xf19907[_0x422b('0x31')][_0x422b('0x3e')]+'%'};return _0x48d703;}})});}_0xedfad=_['merge']({},_0xedfad,_0xf19907[_0x422b('0x41')]);var _0x1479fe={'where':_0xedfad[_0x422b('0x3c')]};return db[_0x422b('0x2b')][_0x422b('0x42')](_0x1479fe)[_0x422b('0x26')](function(_0x7b982a){_0xba7f0e[_0x422b('0x42')]=_0x7b982a;if(_0xf19907[_0x422b('0x31')][_0x422b('0x43')]){_0xedfad[_0x422b('0x44')]=[{'all':!![]}];}return db[_0x422b('0x2b')][_0x422b('0x45')](_0xedfad);})[_0x422b('0x26')](function(_0x24fb8b){_0xba7f0e[_0x422b('0x46')]=_0x24fb8b;return _0xba7f0e;})[_0x422b('0x26')](respondWithFilteredResult(_0x124a74,_0xedfad))[_0x422b('0x47')](handleError(_0x124a74,null));};exports[_0x422b('0x48')]=function(_0x49eacf,_0x451e2a){var _0x1f2ed0={'raw':!![],'where':{'id':_0x49eacf[_0x422b('0x49')]['id']}},_0x40d3f8={};_0x40d3f8[_0x422b('0x34')]=_[_0x422b('0x30')](db[_0x422b('0x2b')][_0x422b('0x4a')]);_0x40d3f8['query']=_[_0x422b('0x30')](_0x49eacf[_0x422b('0x31')]);_0x40d3f8[_0x422b('0x32')]=_[_0x422b('0x33')](_0x40d3f8[_0x422b('0x34')],_0x40d3f8[_0x422b('0x31')]);_0x1f2ed0['attributes']=_[_0x422b('0x33')](_0x40d3f8[_0x422b('0x34')],qs[_0x422b('0x36')](_0x49eacf[_0x422b('0x31')][_0x422b('0x36')]));_0x1f2ed0[_0x422b('0x35')]=_0x1f2ed0[_0x422b('0x35')][_0x422b('0x37')]?_0x1f2ed0[_0x422b('0x35')]:_0x40d3f8[_0x422b('0x34')];if(_0x49eacf[_0x422b('0x31')]['includeAll']){_0x1f2ed0[_0x422b('0x44')]=[{'all':!![]}];}_0x1f2ed0=_[_0x422b('0x3f')]({},_0x1f2ed0,_0x49eacf[_0x422b('0x41')]);return db['ChatQueueReport'][_0x422b('0x4b')](_0x1f2ed0)[_0x422b('0x26')](handleEntityNotFound(_0x451e2a,null))[_0x422b('0x26')](respondWithResult(_0x451e2a,null))[_0x422b('0x47')](handleError(_0x451e2a,null));};exports['create']=function(_0x583eee,_0x40439d){return db[_0x422b('0x2b')][_0x422b('0x4c')](_0x583eee['body'],{})[_0x422b('0x26')](respondWithResult(_0x40439d,0xc9))[_0x422b('0x47')](handleError(_0x40439d,null));};exports[_0x422b('0x25')]=function(_0x1910c5,_0x4db99b){if(_0x1910c5[_0x422b('0x4d')]['id']){delete _0x1910c5[_0x422b('0x4d')]['id'];}return db['ChatQueueReport'][_0x422b('0x4b')]({'where':{'id':_0x1910c5[_0x422b('0x49')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x4db99b,null))[_0x422b('0x26')](saveUpdates(_0x1910c5[_0x422b('0x4d')],null))['then'](respondWithResult(_0x4db99b,null))['catch'](handleError(_0x4db99b,null));};exports[_0x422b('0x27')]=function(_0x141c61,_0x256cc6){return db['ChatQueueReport'][_0x422b('0x4b')]({'where':{'id':_0x141c61[_0x422b('0x49')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x256cc6,null))[_0x422b('0x26')](removeEntity(_0x256cc6,null))[_0x422b('0x47')](handleError(_0x256cc6,null));};exports['describe']=function(_0x483244,_0x3087e8){return db[_0x422b('0x2b')][_0x422b('0x4e')]()[_0x422b('0x26')](respondWithResult(_0x3087e8,null))[_0x422b('0x47')](handleError(_0x3087e8,null));};
\ No newline at end of file
+var _0xd101=['then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update'];(function(_0x3077f4,_0x4b72fc){var _0x34db88=function(_0x31784a){while(--_0x31784a){_0x3077f4['push'](_0x3077f4['shift']());}};_0x34db88(++_0x4b72fc);}(_0xd101,0xc1));var _0x1d10=function(_0x1a19cf,_0x388a28){_0x1a19cf=_0x1a19cf-0x0;var _0x4e164a=_0xd101[_0x1a19cf];return _0x4e164a;};'use strict';var emlformat=require(_0x1d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d10('0x1'));var jsonpatch=require(_0x1d10('0x2'));var rp=require(_0x1d10('0x3'));var moment=require(_0x1d10('0x4'));var BPromise=require(_0x1d10('0x5'));var Mustache=require(_0x1d10('0x6'));var util=require(_0x1d10('0x7'));var path=require(_0x1d10('0x8'));var sox=require('sox');var csv=require(_0x1d10('0x9'));var ejs=require(_0x1d10('0xa'));var fs=require('fs');var fs_extra=require(_0x1d10('0xb'));var _=require(_0x1d10('0xc'));var squel=require(_0x1d10('0xd'));var crypto=require(_0x1d10('0xe'));var jsforce=require(_0x1d10('0xf'));var deskjs=require(_0x1d10('0x10'));var toCsv=require(_0x1d10('0x9'));var querystring=require(_0x1d10('0x11'));var Papa=require(_0x1d10('0x12'));var Redis=require(_0x1d10('0x13'));var authService=require(_0x1d10('0x14'));var qs=require(_0x1d10('0x15'));var as=require(_0x1d10('0x16'));var hardwareService=require(_0x1d10('0x17'));var logger=require(_0x1d10('0x18'))('api');var utils=require(_0x1d10('0x19'));var config=require(_0x1d10('0x1a'));var licenseUtil=require(_0x1d10('0x1b'));var db=require(_0x1d10('0x1c'))['db'];function respondWithStatusCode(_0x268506,_0x5b71d8){_0x5b71d8=_0x5b71d8||0xcc;return function(_0x3f6bd8){if(_0x3f6bd8){return _0x268506[_0x1d10('0x1d')](_0x5b71d8);}return _0x268506[_0x1d10('0x1e')](_0x5b71d8)[_0x1d10('0x1f')]();};}function respondWithResult(_0x2224ff,_0x183bc4){_0x183bc4=_0x183bc4||0xc8;return function(_0x56bc3d){if(_0x56bc3d){return _0x2224ff[_0x1d10('0x1e')](_0x183bc4)[_0x1d10('0x20')](_0x56bc3d);}};}function respondWithFilteredResult(_0x306953,_0x2ad3c0){return function(_0x4f014a){if(_0x4f014a){var _0x3aedf7=typeof _0x2ad3c0[_0x1d10('0x21')]===_0x1d10('0x22')&&typeof _0x2ad3c0[_0x1d10('0x23')]===_0x1d10('0x22');var _0x382b37=_0x4f014a[_0x1d10('0x24')];var _0x4f3e2a=_0x3aedf7?0x0:_0x2ad3c0[_0x1d10('0x21')];var _0x1163dd=_0x3aedf7?_0x4f014a[_0x1d10('0x24')]:_0x2ad3c0[_0x1d10('0x21')]+_0x2ad3c0[_0x1d10('0x23')];var _0x5e61f8;if(_0x1163dd>=_0x382b37){_0x1163dd=_0x382b37;_0x5e61f8=0xc8;}else{_0x5e61f8=0xce;}_0x306953['status'](_0x5e61f8);return _0x306953[_0x1d10('0x25')]('Content-Range',_0x4f3e2a+'-'+_0x1163dd+'/'+_0x382b37)['json'](_0x4f014a);}return null;};}function patchUpdates(_0x5774f9){return function(_0x237b92){try{jsonpatch[_0x1d10('0x26')](_0x237b92,_0x5774f9,!![]);}catch(_0x24717c){return BPromise[_0x1d10('0x27')](_0x24717c);}return _0x237b92['save']();};}function saveUpdates(_0x5e5315,_0x140147){return function(_0x5da6cf){if(_0x5da6cf){return _0x5da6cf[_0x1d10('0x28')](_0x5e5315)[_0x1d10('0x29')](function(_0x160802){return _0x160802;});}return null;};}function removeEntity(_0x37f22d,_0x127b37){return function(_0x3601ba){if(_0x3601ba){return _0x3601ba[_0x1d10('0x2a')]()[_0x1d10('0x29')](function(){_0x37f22d[_0x1d10('0x1e')](0xcc)[_0x1d10('0x1f')]();});}};}function handleEntityNotFound(_0xf1e4c8,_0x5abc58){return function(_0x666012){if(!_0x666012){_0xf1e4c8[_0x1d10('0x1d')](0x194);}return _0x666012;};}function handleError(_0x475934,_0x15f2ee){_0x15f2ee=_0x15f2ee||0x1f4;return function(_0x18e7d9){logger[_0x1d10('0x2b')](_0x18e7d9[_0x1d10('0x2c')]);if(_0x18e7d9[_0x1d10('0x2d')]){delete _0x18e7d9['name'];}_0x475934[_0x1d10('0x1e')](_0x15f2ee)[_0x1d10('0x2e')](_0x18e7d9);};}exports['index']=function(_0x13a3dc,_0x52d514){var _0x4db221={},_0x41b5b8={},_0x597aea={'count':0x0,'rows':[]};var _0xa4e6aa=_[_0x1d10('0x2f')](db[_0x1d10('0x30')][_0x1d10('0x31')],function(_0x1a43fd){return{'name':_0x1a43fd[_0x1d10('0x32')],'type':_0x1a43fd['type']['key']};});_0x41b5b8[_0x1d10('0x33')]=_[_0x1d10('0x2f')](_0xa4e6aa,_0x1d10('0x2d'));_0x41b5b8[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x13a3dc[_0x1d10('0x34')]);_0x41b5b8[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x41b5b8[_0x1d10('0x33')],_0x41b5b8[_0x1d10('0x34')]);_0x4db221['attributes']=_[_0x1d10('0x37')](_0x41b5b8['model'],qs[_0x1d10('0x38')](_0x13a3dc[_0x1d10('0x34')]['fields']));_0x4db221[_0x1d10('0x39')]=_0x4db221['attributes'][_0x1d10('0x3a')]?_0x4db221[_0x1d10('0x39')]:_0x41b5b8[_0x1d10('0x33')];if(!_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3b')]('nolimit')){_0x4db221['limit']=qs[_0x1d10('0x23')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x23')]);_0x4db221['offset']=qs['offset'](_0x13a3dc['query'][_0x1d10('0x21')]);}_0x4db221['order']=qs[_0x1d10('0x3c')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3c')]);_0x4db221[_0x1d10('0x3d')]=qs['filters'](_['pick'](_0x13a3dc[_0x1d10('0x34')],_0x41b5b8[_0x1d10('0x36')]),_0xa4e6aa);if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]){_0x4db221['where']=_[_0x1d10('0x3f')](_0x4db221['where'],{'$or':_[_0x1d10('0x2f')](_0xa4e6aa,function(_0xec1f49){if(_0xec1f49[_0x1d10('0x40')]!==_0x1d10('0x41')){var _0x38addd={};_0x38addd[_0xec1f49[_0x1d10('0x2d')]]={'$like':'%'+_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]+'%'};return _0x38addd;}})});}_0x4db221=_[_0x1d10('0x3f')]({},_0x4db221,_0x13a3dc[_0x1d10('0x42')]);var _0x1cae38={'where':_0x4db221[_0x1d10('0x3d')]};return db[_0x1d10('0x30')]['count'](_0x1cae38)['then'](function(_0x35b2e3){_0x597aea[_0x1d10('0x24')]=_0x35b2e3;if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x43')]){_0x4db221[_0x1d10('0x44')]=[{'all':!![]}];}return db[_0x1d10('0x30')][_0x1d10('0x45')](_0x4db221);})['then'](function(_0x1a67e9){_0x597aea[_0x1d10('0x46')]=_0x1a67e9;return _0x597aea;})[_0x1d10('0x29')](respondWithFilteredResult(_0x52d514,_0x4db221))['catch'](handleError(_0x52d514,null));};exports[_0x1d10('0x47')]=function(_0x427cd7,_0x2ee987){var _0x598973={'raw':!![],'where':{'id':_0x427cd7[_0x1d10('0x48')]['id']}},_0x5795f1={};_0x5795f1[_0x1d10('0x33')]=_[_0x1d10('0x35')](db[_0x1d10('0x30')][_0x1d10('0x31')]);_0x5795f1[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x427cd7['query']);_0x5795f1[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x5795f1['model'],_0x5795f1[_0x1d10('0x34')]);_0x598973['attributes']=_[_0x1d10('0x37')](_0x5795f1['model'],qs['fields'](_0x427cd7[_0x1d10('0x34')][_0x1d10('0x38')]));_0x598973[_0x1d10('0x39')]=_0x598973[_0x1d10('0x39')][_0x1d10('0x3a')]?_0x598973[_0x1d10('0x39')]:_0x5795f1[_0x1d10('0x33')];if(_0x427cd7[_0x1d10('0x34')][_0x1d10('0x43')]){_0x598973['include']=[{'all':!![]}];}_0x598973=_['merge']({},_0x598973,_0x427cd7[_0x1d10('0x42')]);return db[_0x1d10('0x30')][_0x1d10('0x49')](_0x598973)[_0x1d10('0x29')](handleEntityNotFound(_0x2ee987,null))[_0x1d10('0x29')](respondWithResult(_0x2ee987,null))[_0x1d10('0x4a')](handleError(_0x2ee987,null));};exports['create']=function(_0x2db27f,_0x1b8513){return db[_0x1d10('0x30')][_0x1d10('0x4b')](_0x2db27f[_0x1d10('0x4c')],{})[_0x1d10('0x29')](respondWithResult(_0x1b8513,0xc9))[_0x1d10('0x4a')](handleError(_0x1b8513,null));};exports[_0x1d10('0x28')]=function(_0x39bf64,_0x32a9a9){if(_0x39bf64[_0x1d10('0x4c')]['id']){delete _0x39bf64[_0x1d10('0x4c')]['id'];}return db[_0x1d10('0x30')][_0x1d10('0x49')]({'where':{'id':_0x39bf64['params']['id']}})['then'](handleEntityNotFound(_0x32a9a9,null))[_0x1d10('0x29')](saveUpdates(_0x39bf64['body'],null))['then'](respondWithResult(_0x32a9a9,null))[_0x1d10('0x4a')](handleError(_0x32a9a9,null));};exports[_0x1d10('0x2a')]=function(_0x375fb1,_0x35d8fb){return db[_0x1d10('0x30')]['find']({'where':{'id':_0x375fb1['params']['id']}})['then'](handleEntityNotFound(_0x35d8fb,null))['then'](removeEntity(_0x35d8fb,null))[_0x1d10('0x4a')](handleError(_0x35d8fb,null));};exports[_0x1d10('0x4d')]=function(_0x4570c4,_0x3a4167){return db['ChatQueueReport'][_0x1d10('0x4d')]()[_0x1d10('0x29')](respondWithResult(_0x3a4167,null))[_0x1d10('0x4a')](handleError(_0x3a4167,null));};
\ No newline at end of file
index 05082af..128ab72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x3e5131,_0x54d2b6){var _0x3e5098=function(_0x143866){while(--_0x143866){_0x3e5131['push'](_0x3e5131['shift']());}};_0x3e5098(++_0x54d2b6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x46eae2,_0x3d1f8d){var _0x3230f1=function(_0x5c3ce8){while(--_0x5c3ce8){_0x46eae2['push'](_0x46eae2['shift']());}};_0x3230f1(++_0x3d1f8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 4a760be..f54f628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f9=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','body','where','attributes','limit','UpdateChatQueueReport','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0xe35b6d,_0x3c3aae){_0xe35b6d=_0xe35b6d-0x0;var _0x33730b=_0xf1f9[_0xe35b6d];return _0x33730b;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});}exports[_0x9f1f('0x17')]=function(_0x5d35a6){var _0x23d9c0=this;return new Promise(function(_0x11d55b,_0x19d3f2){return db[_0x9f1f('0x18')][_0x9f1f('0x19')](_0x5d35a6['body'],{'raw':_0x5d35a6[_0x9f1f('0x1a')]?_0x5d35a6[_0x9f1f('0x1a')][_0x9f1f('0x1b')]===undefined?!![]:![]:!![]})[_0x9f1f('0xc')](function(_0x5db027){logger[_0x9f1f('0xd')]('CreateChatQueueReport',_0x5d35a6);logger[_0x9f1f('0x10')](_0x9f1f('0x17'),_0x5d35a6,JSON['stringify'](_0x5db027));_0x11d55b(_0x5db027);})[_0x9f1f('0x16')](function(_0x317f75){logger[_0x9f1f('0x13')](_0x9f1f('0x17'),_0x317f75[_0x9f1f('0x14')],_0x5d35a6);_0x19d3f2(_0x23d9c0['error'](0x1f4,_0x317f75['message']));});});};exports['UpdateChatQueueReport']=function(_0x57d29f){var _0x47db05=this;return new Promise(function(_0x42a5ac,_0x35dac1){return db[_0x9f1f('0x18')]['update'](_0x57d29f[_0x9f1f('0x1c')],{'raw':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1d')]||null:null,'attributes':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1e')]||null:null,'limit':_0x57d29f[_0x9f1f('0x1a')]?_0x57d29f[_0x9f1f('0x1a')][_0x9f1f('0x1f')]||null:null})[_0x9f1f('0xc')](function(_0x4e4636){logger['info'](_0x9f1f('0x20'),_0x57d29f);logger[_0x9f1f('0x10')]('UpdateChatQueueReport',_0x57d29f,JSON[_0x9f1f('0x12')](_0x4e4636));_0x42a5ac(_0x4e4636);})[_0x9f1f('0x16')](function(_0x3fccb6){logger[_0x9f1f('0x13')](_0x9f1f('0x20'),_0x3fccb6[_0x9f1f('0x14')],_0x57d29f);_0x35dac1(_0x47db05[_0x9f1f('0x13')](0x1f4,_0x3fccb6[_0x9f1f('0x14')]));});});};
\ No newline at end of file
+var _0x8a5c=['attributes','UpdateChatQueueReport','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatQueueReport','create','options','ChatQueueReport','update','body','where'];(function(_0x472439,_0x4c6ba4){var _0x504d78=function(_0x51ee60){while(--_0x51ee60){_0x472439['push'](_0x472439['shift']());}};_0x504d78(++_0x4c6ba4);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5474d5,_0x23a1ca){_0x5474d5=_0x5474d5-0x0;var _0x704993=_0x8a5c[_0x5474d5];return _0x704993;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var moment=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var rs=require(_0xc8a5('0x4'));var fs=require('fs');var Redis=require(_0xc8a5('0x5'));var db=require(_0xc8a5('0x6'))['db'];var utils=require(_0xc8a5('0x7'));var logger=require(_0xc8a5('0x8'))('rpc');var config=require(_0xc8a5('0x9'));var jayson=require(_0xc8a5('0xa'));var client=jayson['client'][_0xc8a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcee97e,_0xd6de78,_0xa9f42c){return new BPromise(function(_0x4d25e4,_0x3ecf08){return client[_0xc8a5('0xc')](_0xcee97e,_0xa9f42c)[_0xc8a5('0xd')](function(_0x2c1fe9){logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,_0xc8a5('0x10'));logger[_0xc8a5('0x11')](_0xc8a5('0x12'),_0xd6de78,'request\x20sent',JSON['stringify'](_0x2c1fe9));if(_0x2c1fe9[_0xc8a5('0x13')]){if(_0x2c1fe9['error'][_0xc8a5('0x14')]===0x1f4){logger[_0xc8a5('0x13')](_0xc8a5('0xf'),_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x3ecf08(_0x2c1fe9['error'][_0xc8a5('0x15')]);}logger[_0xc8a5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x4d25e4(_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);}else{logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,'request\x20sent');_0x4d25e4(_0x2c1fe9[_0xc8a5('0x16')][_0xc8a5('0x15')]);}})['catch'](function(_0x36a78b){logger[_0xc8a5('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0xd6de78,_0x36a78b);_0x3ecf08(_0x36a78b);});});}exports[_0xc8a5('0x17')]=function(_0x3ef8d3){var _0x12a441=this;return new Promise(function(_0x1326e2,_0x1ea105){return db['ChatQueueReport'][_0xc8a5('0x18')](_0x3ef8d3['body'],{'raw':_0x3ef8d3[_0xc8a5('0x19')]?_0x3ef8d3[_0xc8a5('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x866737){logger[_0xc8a5('0xe')](_0xc8a5('0x17'),_0x3ef8d3);logger[_0xc8a5('0x11')](_0xc8a5('0x17'),_0x3ef8d3,JSON['stringify'](_0x866737));_0x1326e2(_0x866737);})['catch'](function(_0x3e2058){logger[_0xc8a5('0x13')](_0xc8a5('0x17'),_0x3e2058[_0xc8a5('0x15')],_0x3ef8d3);_0x1ea105(_0x12a441[_0xc8a5('0x13')](0x1f4,_0x3e2058[_0xc8a5('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x1b3870){var _0x3beb20=this;return new Promise(function(_0x266c59,_0x1e522c){return db[_0xc8a5('0x1a')][_0xc8a5('0x1b')](_0x1b3870[_0xc8a5('0x1c')],{'raw':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870[_0xc8a5('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870[_0xc8a5('0x19')][_0xc8a5('0x1d')]||null:null,'attributes':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870[_0xc8a5('0x19')][_0xc8a5('0x1e')]||null:null,'limit':_0x1b3870[_0xc8a5('0x19')]?_0x1b3870['options']['limit']||null:null})[_0xc8a5('0xd')](function(_0x4e0a4b){logger['info'](_0xc8a5('0x1f'),_0x1b3870);logger[_0xc8a5('0x11')](_0xc8a5('0x1f'),_0x1b3870,JSON[_0xc8a5('0x20')](_0x4e0a4b));_0x266c59(_0x4e0a4b);})[_0xc8a5('0x21')](function(_0x31c416){logger['error'](_0xc8a5('0x1f'),_0x31c416[_0xc8a5('0x15')],_0x1b3870);_0x1e522c(_0x3beb20[_0xc8a5('0x13')](0x1f4,_0x31c416[_0xc8a5('0x15')]));});});};
\ No newline at end of file
index dfbbcea..9063289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x028b=['isAuthenticated','get','/describe','describe','show','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x028b,0xd1));var _0xb028=function(_0x50e34a,_0x2ae8bf){_0x50e34a=_0x50e34a-0x0;var _0x46f987=_0x028b[_0x50e34a];return _0x46f987;};'use strict';var multer=require(_0xb028('0x0'));var util=require(_0xb028('0x1'));var path=require(_0xb028('0x2'));var timeout=require(_0xb028('0x3'));var express=require(_0xb028('0x4'));var router=express[_0xb028('0x5')]();var fs_extra=require(_0xb028('0x6'));var auth=require(_0xb028('0x7'));var interaction=require(_0xb028('0x8'));var config=require(_0xb028('0x9'));var controller=require(_0xb028('0xa'));router['get']('/',auth[_0xb028('0xb')](),controller['index']);router[_0xb028('0xc')](_0xb028('0xd'),auth[_0xb028('0xb')](),controller[_0xb028('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb028('0xf')]);router['post']('/',auth[_0xb028('0xb')](),controller[_0xb028('0x10')]);router[_0xb028('0x11')](_0xb028('0x12'),auth[_0xb028('0xb')](),controller[_0xb028('0x13')]);router[_0xb028('0x14')](_0xb028('0x12'),auth[_0xb028('0xb')](),controller[_0xb028('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x35a9=['index','/describe','isAuthenticated','describe','/:id','create','put','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../config/environment','get'];(function(_0x436d0e,_0x2fe229){var _0x499710=function(_0x4f898){while(--_0x4f898){_0x436d0e['push'](_0x436d0e['shift']());}};_0x499710(++_0x2fe229);}(_0x35a9,0x144));var _0x935a=function(_0x4bc8cb,_0x2c4a59){_0x4bc8cb=_0x4bc8cb-0x0;var _0x454e3b=_0x35a9[_0x4bc8cb];return _0x454e3b;};'use strict';var multer=require(_0x935a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x935a('0x1'));var express=require(_0x935a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x935a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x935a('0x4'));var controller=require('./chatQueueReport.controller');router[_0x935a('0x5')]('/',auth['isAuthenticated'](),controller[_0x935a('0x6')]);router[_0x935a('0x5')](_0x935a('0x7'),auth[_0x935a('0x8')](),controller[_0x935a('0x9')]);router['get'](_0x935a('0xa'),auth[_0x935a('0x8')](),controller['show']);router['post']('/',auth[_0x935a('0x8')](),controller[_0x935a('0xb')]);router[_0x935a('0xc')](_0x935a('0xa'),auth[_0x935a('0x8')](),controller['update']);router['delete'](_0x935a('0xa'),auth[_0x935a('0x8')](),controller[_0x935a('0xd')]);module[_0x935a('0xe')]=router;
\ No newline at end of file
index 03455db..a756b82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x1fc96d,_0x569e46){var _0x564592=function(_0x4dc27b){while(--_0x4dc27b){_0x1fc96d['push'](_0x1fc96d['shift']());}};_0x564592(++_0x569e46);}(_0xedd9,0xfc));var _0x9edd=function(_0x513c61,_0x15d679){_0x513c61=_0x513c61-0x0;var _0x26abab=_0xedd9[_0x513c61];return _0x26abab;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x468e19,_0x5832b6){_0x468e19=_0x468e19-0x0;var _0x184624=_0xb43b[_0x468e19];return _0x184624;};'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 853f069..4b35e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6e1=['status','set','Content-Range','apply','reject','update','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','name','keys','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','params','includeAll','include','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit'];(function(_0x34df56,_0x52a58f){var _0x520f88=function(_0x2f0a82){while(--_0x2f0a82){_0x34df56['push'](_0x34df56['shift']());}};_0x520f88(++_0x52a58f);}(_0xd6e1,0x1a7));var _0x1d6e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd6e1[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x1d6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d6e('0x1'));var jsonpatch=require(_0x1d6e('0x2'));var rp=require('request-promise');var moment=require(_0x1d6e('0x3'));var BPromise=require(_0x1d6e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1d6e('0x5'));var sox=require(_0x1d6e('0x6'));var csv=require(_0x1d6e('0x7'));var ejs=require(_0x1d6e('0x8'));var fs=require('fs');var fs_extra=require(_0x1d6e('0x9'));var _=require(_0x1d6e('0xa'));var squel=require(_0x1d6e('0xb'));var crypto=require('crypto');var jsforce=require(_0x1d6e('0xc'));var deskjs=require(_0x1d6e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1d6e('0xe'));var Papa=require(_0x1d6e('0xf'));var Redis=require(_0x1d6e('0x10'));var authService=require(_0x1d6e('0x11'));var qs=require(_0x1d6e('0x12'));var as=require(_0x1d6e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d6e('0x14'))(_0x1d6e('0x15'));var utils=require(_0x1d6e('0x16'));var config=require(_0x1d6e('0x17'));var licenseUtil=require(_0x1d6e('0x18'));var db=require(_0x1d6e('0x19'))['db'];function respondWithStatusCode(_0x2ea2aa,_0x422ab2){_0x422ab2=_0x422ab2||0xcc;return function(_0x30db71){if(_0x30db71){return _0x2ea2aa[_0x1d6e('0x1a')](_0x422ab2);}return _0x2ea2aa['status'](_0x422ab2)[_0x1d6e('0x1b')]();};}function respondWithResult(_0x38be98,_0x238c70){_0x238c70=_0x238c70||0xc8;return function(_0x1a0b96){if(_0x1a0b96){return _0x38be98['status'](_0x238c70)[_0x1d6e('0x1c')](_0x1a0b96);}};}function respondWithFilteredResult(_0x3da36c,_0x2c50b2){return function(_0xd9d856){if(_0xd9d856){var _0x42fe34=typeof _0x2c50b2['offset']===_0x1d6e('0x1d')&&typeof _0x2c50b2['limit']===_0x1d6e('0x1d');var _0xd2a503=_0xd9d856[_0x1d6e('0x1e')];var _0x2dd531=_0x42fe34?0x0:_0x2c50b2[_0x1d6e('0x1f')];var _0x364c25=_0x42fe34?_0xd9d856[_0x1d6e('0x1e')]:_0x2c50b2[_0x1d6e('0x1f')]+_0x2c50b2[_0x1d6e('0x20')];var _0x289402;if(_0x364c25>=_0xd2a503){_0x364c25=_0xd2a503;_0x289402=0xc8;}else{_0x289402=0xce;}_0x3da36c[_0x1d6e('0x21')](_0x289402);return _0x3da36c[_0x1d6e('0x22')](_0x1d6e('0x23'),_0x2dd531+'-'+_0x364c25+'/'+_0xd2a503)[_0x1d6e('0x1c')](_0xd9d856);}return null;};}function patchUpdates(_0x2a1b94){return function(_0xcc827){try{jsonpatch[_0x1d6e('0x24')](_0xcc827,_0x2a1b94,!![]);}catch(_0x199381){return BPromise[_0x1d6e('0x25')](_0x199381);}return _0xcc827['save']();};}function saveUpdates(_0x4d5d2e,_0x1d834f){return function(_0x50ce67){if(_0x50ce67){return _0x50ce67[_0x1d6e('0x26')](_0x4d5d2e)[_0x1d6e('0x27')](function(_0x280e74){return _0x280e74;});}return null;};}function removeEntity(_0x3a164e,_0x121b68){return function(_0x1c938d){if(_0x1c938d){return _0x1c938d[_0x1d6e('0x28')]()[_0x1d6e('0x27')](function(){_0x3a164e[_0x1d6e('0x21')](0xcc)[_0x1d6e('0x1b')]();});}};}function handleEntityNotFound(_0x479e1f,_0x3c9651){return function(_0x3f5fb6){if(!_0x3f5fb6){_0x479e1f['sendStatus'](0x194);}return _0x3f5fb6;};}function handleError(_0x34cfd9,_0x16584e){_0x16584e=_0x16584e||0x1f4;return function(_0x292ac0){logger[_0x1d6e('0x29')](_0x292ac0['stack']);if(_0x292ac0['name']){delete _0x292ac0['name'];}_0x34cfd9[_0x1d6e('0x21')](_0x16584e)[_0x1d6e('0x2a')](_0x292ac0);};}exports[_0x1d6e('0x2b')]=function(_0x11f993,_0x12ae1a){var _0x5dd780={},_0x1f2b68={},_0x5513cc={'count':0x0,'rows':[]};var _0x5b15ac=_[_0x1d6e('0x2c')](db[_0x1d6e('0x2d')][_0x1d6e('0x2e')],function(_0x1735db){return{'name':_0x1735db[_0x1d6e('0x2f')],'type':_0x1735db[_0x1d6e('0x30')]['key']};});_0x1f2b68['model']=_[_0x1d6e('0x2c')](_0x5b15ac,_0x1d6e('0x31'));_0x1f2b68['query']=_[_0x1d6e('0x32')](_0x11f993[_0x1d6e('0x33')]);_0x1f2b68['filters']=_[_0x1d6e('0x34')](_0x1f2b68['model'],_0x1f2b68['query']);_0x5dd780['attributes']=_['intersection'](_0x1f2b68[_0x1d6e('0x35')],qs[_0x1d6e('0x36')](_0x11f993[_0x1d6e('0x33')][_0x1d6e('0x36')]));_0x5dd780[_0x1d6e('0x37')]=_0x5dd780['attributes']['length']?_0x5dd780['attributes']:_0x1f2b68['model'];if(!_0x11f993[_0x1d6e('0x33')][_0x1d6e('0x38')](_0x1d6e('0x39'))){_0x5dd780[_0x1d6e('0x20')]=qs[_0x1d6e('0x20')](_0x11f993[_0x1d6e('0x33')]['limit']);_0x5dd780[_0x1d6e('0x1f')]=qs[_0x1d6e('0x1f')](_0x11f993[_0x1d6e('0x33')]['offset']);}_0x5dd780[_0x1d6e('0x3a')]=qs[_0x1d6e('0x3b')](_0x11f993[_0x1d6e('0x33')][_0x1d6e('0x3b')]);_0x5dd780['where']=qs[_0x1d6e('0x3c')](_[_0x1d6e('0x3d')](_0x11f993[_0x1d6e('0x33')],_0x1f2b68[_0x1d6e('0x3c')]),_0x5b15ac);if(_0x11f993[_0x1d6e('0x33')][_0x1d6e('0x3e')]){_0x5dd780[_0x1d6e('0x3f')]=_[_0x1d6e('0x40')](_0x5dd780['where'],{'$or':_[_0x1d6e('0x2c')](_0x5b15ac,function(_0x2bcc99){if(_0x2bcc99[_0x1d6e('0x30')]!==_0x1d6e('0x41')){var _0x22adea={};_0x22adea[_0x2bcc99[_0x1d6e('0x31')]]={'$like':'%'+_0x11f993['query'][_0x1d6e('0x3e')]+'%'};return _0x22adea;}})});}_0x5dd780=_['merge']({},_0x5dd780,_0x11f993[_0x1d6e('0x42')]);var _0x3c109e={'where':_0x5dd780[_0x1d6e('0x3f')]};return db[_0x1d6e('0x2d')][_0x1d6e('0x1e')](_0x3c109e)[_0x1d6e('0x27')](function(_0x478585){_0x5513cc[_0x1d6e('0x1e')]=_0x478585;if(_0x11f993[_0x1d6e('0x33')]['includeAll']){_0x5dd780['include']=[{'all':!![]}];}return db[_0x1d6e('0x2d')][_0x1d6e('0x43')](_0x5dd780);})[_0x1d6e('0x27')](function(_0x1e3d2e){_0x5513cc[_0x1d6e('0x44')]=_0x1e3d2e;return _0x5513cc;})[_0x1d6e('0x27')](respondWithFilteredResult(_0x12ae1a,_0x5dd780))[_0x1d6e('0x45')](handleError(_0x12ae1a,null));};exports['show']=function(_0x4c3378,_0xe0445a){var _0x33e664={'raw':!![],'where':{'id':_0x4c3378[_0x1d6e('0x46')]['id']}},_0x3700c3={};_0x3700c3[_0x1d6e('0x35')]=_[_0x1d6e('0x32')](db[_0x1d6e('0x2d')]['rawAttributes']);_0x3700c3[_0x1d6e('0x33')]=_[_0x1d6e('0x32')](_0x4c3378[_0x1d6e('0x33')]);_0x3700c3[_0x1d6e('0x3c')]=_[_0x1d6e('0x34')](_0x3700c3[_0x1d6e('0x35')],_0x3700c3[_0x1d6e('0x33')]);_0x33e664[_0x1d6e('0x37')]=_[_0x1d6e('0x34')](_0x3700c3[_0x1d6e('0x35')],qs[_0x1d6e('0x36')](_0x4c3378[_0x1d6e('0x33')][_0x1d6e('0x36')]));_0x33e664['attributes']=_0x33e664[_0x1d6e('0x37')]['length']?_0x33e664['attributes']:_0x3700c3[_0x1d6e('0x35')];if(_0x4c3378[_0x1d6e('0x33')][_0x1d6e('0x47')]){_0x33e664[_0x1d6e('0x48')]=[{'all':!![]}];}_0x33e664=_['merge']({},_0x33e664,_0x4c3378['options']);return db['ChatTransferReport'][_0x1d6e('0x49')](_0x33e664)[_0x1d6e('0x27')](handleEntityNotFound(_0xe0445a,null))[_0x1d6e('0x27')](respondWithResult(_0xe0445a,null))['catch'](handleError(_0xe0445a,null));};exports['create']=function(_0x115af3,_0x1fc5c0){return db[_0x1d6e('0x2d')]['create'](_0x115af3[_0x1d6e('0x4a')],{})[_0x1d6e('0x27')](respondWithResult(_0x1fc5c0,0xc9))['catch'](handleError(_0x1fc5c0,null));};exports[_0x1d6e('0x26')]=function(_0x5413a5,_0xb812fd){if(_0x5413a5['body']['id']){delete _0x5413a5[_0x1d6e('0x4a')]['id'];}return db[_0x1d6e('0x2d')][_0x1d6e('0x49')]({'where':{'id':_0x5413a5[_0x1d6e('0x46')]['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0xb812fd,null))[_0x1d6e('0x27')](saveUpdates(_0x5413a5[_0x1d6e('0x4a')],null))[_0x1d6e('0x27')](respondWithResult(_0xb812fd,null))['catch'](handleError(_0xb812fd,null));};exports['destroy']=function(_0x298d7c,_0xc5e15b){return db['ChatTransferReport'][_0x1d6e('0x49')]({'where':{'id':_0x298d7c[_0x1d6e('0x46')]['id']}})[_0x1d6e('0x27')](handleEntityNotFound(_0xc5e15b,null))['then'](removeEntity(_0xc5e15b,null))['catch'](handleError(_0xc5e15b,null));};exports[_0x1d6e('0x4b')]=function(_0x382979,_0x2eba13){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x2eba13,null))[_0x1d6e('0x45')](handleError(_0x2eba13,null));};
\ No newline at end of file
+var _0x6aa1=['merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x7ce11e,_0x56bcc9){var _0x501119=function(_0x3adcf3){while(--_0x3adcf3){_0x7ce11e['push'](_0x7ce11e['shift']());}};_0x501119(++_0x56bcc9);}(_0x6aa1,0x1b5));var _0x16aa=function(_0x29c074,_0x322c99){_0x29c074=_0x29c074-0x0;var _0x1222b7=_0x6aa1[_0x29c074];return _0x1222b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x16aa('0x0'));var jsonpatch=require(_0x16aa('0x1'));var rp=require(_0x16aa('0x2'));var moment=require(_0x16aa('0x3'));var BPromise=require(_0x16aa('0x4'));var Mustache=require('mustache');var util=require(_0x16aa('0x5'));var path=require(_0x16aa('0x6'));var sox=require(_0x16aa('0x7'));var csv=require(_0x16aa('0x8'));var ejs=require(_0x16aa('0x9'));var fs=require('fs');var fs_extra=require(_0x16aa('0xa'));var _=require(_0x16aa('0xb'));var squel=require(_0x16aa('0xc'));var crypto=require(_0x16aa('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x16aa('0x8'));var querystring=require('querystring');var Papa=require(_0x16aa('0xe'));var Redis=require(_0x16aa('0xf'));var authService=require(_0x16aa('0x10'));var qs=require(_0x16aa('0x11'));var as=require(_0x16aa('0x12'));var hardwareService=require(_0x16aa('0x13'));var logger=require(_0x16aa('0x14'))('api');var utils=require(_0x16aa('0x15'));var config=require(_0x16aa('0x16'));var licenseUtil=require(_0x16aa('0x17'));var db=require(_0x16aa('0x18'))['db'];function respondWithStatusCode(_0x13d812,_0x2fbae7){_0x2fbae7=_0x2fbae7||0xcc;return function(_0x4e56b1){if(_0x4e56b1){return _0x13d812['sendStatus'](_0x2fbae7);}return _0x13d812[_0x16aa('0x19')](_0x2fbae7)[_0x16aa('0x1a')]();};}function respondWithResult(_0x50f9bd,_0x276fe2){_0x276fe2=_0x276fe2||0xc8;return function(_0xe108fd){if(_0xe108fd){return _0x50f9bd[_0x16aa('0x19')](_0x276fe2)[_0x16aa('0x1b')](_0xe108fd);}};}function respondWithFilteredResult(_0x5afc10,_0x337608){return function(_0x58dd9a){if(_0x58dd9a){var _0x478849=typeof _0x337608[_0x16aa('0x1c')]===_0x16aa('0x1d')&&typeof _0x337608[_0x16aa('0x1e')]===_0x16aa('0x1d');var _0x18b65d=_0x58dd9a[_0x16aa('0x1f')];var _0x358d53=_0x478849?0x0:_0x337608[_0x16aa('0x1c')];var _0x3ec33d=_0x478849?_0x58dd9a[_0x16aa('0x1f')]:_0x337608[_0x16aa('0x1c')]+_0x337608[_0x16aa('0x1e')];var _0x2be220;if(_0x3ec33d>=_0x18b65d){_0x3ec33d=_0x18b65d;_0x2be220=0xc8;}else{_0x2be220=0xce;}_0x5afc10[_0x16aa('0x19')](_0x2be220);return _0x5afc10['set'](_0x16aa('0x20'),_0x358d53+'-'+_0x3ec33d+'/'+_0x18b65d)[_0x16aa('0x1b')](_0x58dd9a);}return null;};}function patchUpdates(_0x90e5a7){return function(_0x20666b){try{jsonpatch[_0x16aa('0x21')](_0x20666b,_0x90e5a7,!![]);}catch(_0x33c2d4){return BPromise['reject'](_0x33c2d4);}return _0x20666b[_0x16aa('0x22')]();};}function saveUpdates(_0x24b71c,_0x4f5eba){return function(_0x3ddeb6){if(_0x3ddeb6){return _0x3ddeb6[_0x16aa('0x23')](_0x24b71c)[_0x16aa('0x24')](function(_0x41dcfc){return _0x41dcfc;});}return null;};}function removeEntity(_0x14bd43,_0x3c12a5){return function(_0x21482c){if(_0x21482c){return _0x21482c[_0x16aa('0x25')]()['then'](function(){_0x14bd43[_0x16aa('0x19')](0xcc)[_0x16aa('0x1a')]();});}};}function handleEntityNotFound(_0x4c2b92,_0x5cb05e){return function(_0x117d52){if(!_0x117d52){_0x4c2b92[_0x16aa('0x26')](0x194);}return _0x117d52;};}function handleError(_0x25cc91,_0xb01076){_0xb01076=_0xb01076||0x1f4;return function(_0x1d121b){logger['error'](_0x1d121b['stack']);if(_0x1d121b[_0x16aa('0x27')]){delete _0x1d121b[_0x16aa('0x27')];}_0x25cc91[_0x16aa('0x19')](_0xb01076)[_0x16aa('0x28')](_0x1d121b);};}exports[_0x16aa('0x29')]=function(_0x26a018,_0x295605){var _0x48c4ba={},_0x50437c={},_0x1c658f={'count':0x0,'rows':[]};var _0x1da0d7=_[_0x16aa('0x2a')](db[_0x16aa('0x2b')][_0x16aa('0x2c')],function(_0x61ecae){return{'name':_0x61ecae[_0x16aa('0x2d')],'type':_0x61ecae[_0x16aa('0x2e')][_0x16aa('0x2f')]};});_0x50437c[_0x16aa('0x30')]=_[_0x16aa('0x2a')](_0x1da0d7,'name');_0x50437c[_0x16aa('0x31')]=_[_0x16aa('0x32')](_0x26a018[_0x16aa('0x31')]);_0x50437c[_0x16aa('0x33')]=_[_0x16aa('0x34')](_0x50437c[_0x16aa('0x30')],_0x50437c[_0x16aa('0x31')]);_0x48c4ba['attributes']=_[_0x16aa('0x34')](_0x50437c[_0x16aa('0x30')],qs[_0x16aa('0x35')](_0x26a018['query'][_0x16aa('0x35')]));_0x48c4ba['attributes']=_0x48c4ba[_0x16aa('0x36')][_0x16aa('0x37')]?_0x48c4ba[_0x16aa('0x36')]:_0x50437c[_0x16aa('0x30')];if(!_0x26a018[_0x16aa('0x31')]['hasOwnProperty'](_0x16aa('0x38'))){_0x48c4ba[_0x16aa('0x1e')]=qs[_0x16aa('0x1e')](_0x26a018[_0x16aa('0x31')]['limit']);_0x48c4ba[_0x16aa('0x1c')]=qs['offset'](_0x26a018[_0x16aa('0x31')][_0x16aa('0x1c')]);}_0x48c4ba[_0x16aa('0x39')]=qs[_0x16aa('0x3a')](_0x26a018[_0x16aa('0x31')]['sort']);_0x48c4ba[_0x16aa('0x3b')]=qs[_0x16aa('0x33')](_['pick'](_0x26a018[_0x16aa('0x31')],_0x50437c[_0x16aa('0x33')]),_0x1da0d7);if(_0x26a018[_0x16aa('0x31')]['filter']){_0x48c4ba['where']=_[_0x16aa('0x3c')](_0x48c4ba[_0x16aa('0x3b')],{'$or':_[_0x16aa('0x2a')](_0x1da0d7,function(_0x518b49){if(_0x518b49[_0x16aa('0x2e')]!==_0x16aa('0x3d')){var _0x2c66b1={};_0x2c66b1[_0x518b49[_0x16aa('0x27')]]={'$like':'%'+_0x26a018[_0x16aa('0x31')]['filter']+'%'};return _0x2c66b1;}})});}_0x48c4ba=_['merge']({},_0x48c4ba,_0x26a018[_0x16aa('0x3e')]);var _0xedbf1a={'where':_0x48c4ba['where']};return db[_0x16aa('0x2b')]['count'](_0xedbf1a)[_0x16aa('0x24')](function(_0x3418fa){_0x1c658f['count']=_0x3418fa;if(_0x26a018[_0x16aa('0x31')][_0x16aa('0x3f')]){_0x48c4ba['include']=[{'all':!![]}];}return db[_0x16aa('0x2b')]['findAll'](_0x48c4ba);})[_0x16aa('0x24')](function(_0x376e0d){_0x1c658f[_0x16aa('0x40')]=_0x376e0d;return _0x1c658f;})[_0x16aa('0x24')](respondWithFilteredResult(_0x295605,_0x48c4ba))[_0x16aa('0x41')](handleError(_0x295605,null));};exports['show']=function(_0x2cc068,_0x3d428f){var _0x3baa51={'raw':!![],'where':{'id':_0x2cc068[_0x16aa('0x42')]['id']}},_0x1b0c05={};_0x1b0c05[_0x16aa('0x30')]=_['keys'](db[_0x16aa('0x2b')][_0x16aa('0x2c')]);_0x1b0c05['query']=_['keys'](_0x2cc068[_0x16aa('0x31')]);_0x1b0c05[_0x16aa('0x33')]=_[_0x16aa('0x34')](_0x1b0c05['model'],_0x1b0c05[_0x16aa('0x31')]);_0x3baa51[_0x16aa('0x36')]=_['intersection'](_0x1b0c05[_0x16aa('0x30')],qs[_0x16aa('0x35')](_0x2cc068[_0x16aa('0x31')]['fields']));_0x3baa51['attributes']=_0x3baa51['attributes'][_0x16aa('0x37')]?_0x3baa51['attributes']:_0x1b0c05['model'];if(_0x2cc068[_0x16aa('0x31')][_0x16aa('0x3f')]){_0x3baa51[_0x16aa('0x43')]=[{'all':!![]}];}_0x3baa51=_['merge']({},_0x3baa51,_0x2cc068[_0x16aa('0x3e')]);return db['ChatTransferReport'][_0x16aa('0x44')](_0x3baa51)[_0x16aa('0x24')](handleEntityNotFound(_0x3d428f,null))[_0x16aa('0x24')](respondWithResult(_0x3d428f,null))[_0x16aa('0x41')](handleError(_0x3d428f,null));};exports['create']=function(_0x3fa01e,_0x2d44ce){return db[_0x16aa('0x2b')]['create'](_0x3fa01e[_0x16aa('0x45')],{})[_0x16aa('0x24')](respondWithResult(_0x2d44ce,0xc9))[_0x16aa('0x41')](handleError(_0x2d44ce,null));};exports['update']=function(_0x3cdcd7,_0x1a82a4){if(_0x3cdcd7[_0x16aa('0x45')]['id']){delete _0x3cdcd7[_0x16aa('0x45')]['id'];}return db[_0x16aa('0x2b')][_0x16aa('0x44')]({'where':{'id':_0x3cdcd7[_0x16aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a82a4,null))['then'](saveUpdates(_0x3cdcd7[_0x16aa('0x45')],null))[_0x16aa('0x24')](respondWithResult(_0x1a82a4,null))[_0x16aa('0x41')](handleError(_0x1a82a4,null));};exports['destroy']=function(_0x2f6cb9,_0x2b117e){return db[_0x16aa('0x2b')][_0x16aa('0x44')]({'where':{'id':_0x2f6cb9[_0x16aa('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b117e,null))[_0x16aa('0x24')](removeEntity(_0x2b117e,null))['catch'](handleError(_0x2b117e,null));};exports[_0x16aa('0x46')]=function(_0x178b4e,_0x13791d){return db[_0x16aa('0x2b')][_0x16aa('0x46')]()[_0x16aa('0x24')](respondWithResult(_0x13791d,null))[_0x16aa('0x41')](handleError(_0x13791d,null));};
\ No newline at end of file
index fcea6eb..2d4f6b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9979=['bluebird','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','util','moment'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x9979,0x13c));var _0x9997=function(_0x307c85,_0x2d6aee){_0x307c85=_0x307c85-0x0;var _0x2d1933=_0x9979[_0x307c85];return _0x2d1933;};'use strict';var _=require(_0x9997('0x0'));var util=require(_0x9997('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9997('0x2'));var BPromise=require(_0x9997('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9997('0x4'));var rimraf=require(_0x9997('0x5'));var config=require('../../config/environment');var attributes=require(_0x9997('0x6'));module[_0x9997('0x7')]=function(_0x4c6e32,_0x76894f){return _0x4c6e32[_0x9997('0x8')](_0x9997('0x9'),attributes,{'tableName':_0x9997('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0f6=['path','rimraf','./chatTransferReport.attributes','exports','uniqueid','lodash','../../config/logger','api','request-promise'];(function(_0x25cc7c,_0x24f457){var _0x5de4b4=function(_0x24667f){while(--_0x24667f){_0x25cc7c['push'](_0x25cc7c['shift']());}};_0x5de4b4(++_0x24f457);}(_0xb0f6,0xf8));var _0x6b0f=function(_0x1dd191,_0x524b5f){_0x1dd191=_0x1dd191-0x0;var _0x46d472=_0xb0f6[_0x1dd191];return _0x46d472;};'use strict';var _=require(_0x6b0f('0x0'));var util=require('util');var logger=require(_0x6b0f('0x1'))(_0x6b0f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6b0f('0x3'));var fs=require('fs');var path=require(_0x6b0f('0x4'));var rimraf=require(_0x6b0f('0x5'));var config=require('../../config/environment');var attributes=require(_0x6b0f('0x6'));module[_0x6b0f('0x7')]=function(_0x179a14,_0x361624){return _0x179a14['define']('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6b0f('0x8'),'fields':[_0x6b0f('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index 917616c..8236aa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf370=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf370,0x10e));var _0x0f37=function(_0x37fa4f,_0x379eb2){_0x37fa4f=_0x37fa4f-0x0;var _0x17133f=_0xf370[_0x37fa4f];return _0x17133f;};'use strict';var _=require(_0x0f37('0x0'));var util=require(_0x0f37('0x1'));var moment=require(_0x0f37('0x2'));var BPromise=require(_0x0f37('0x3'));var rs=require(_0x0f37('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f37('0x5'))['db'];var utils=require(_0x0f37('0x6'));var logger=require(_0x0f37('0x7'))(_0x0f37('0x8'));var config=require(_0x0f37('0x9'));var jayson=require(_0x0f37('0xa'));var client=jayson[_0x0f37('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c4669,_0x50894a,_0x5bf677){return new BPromise(function(_0x58f280,_0x1eef5e){return client[_0x0f37('0xc')](_0x4c4669,_0x5bf677)[_0x0f37('0xd')](function(_0x31edcd){logger[_0x0f37('0xe')](_0x0f37('0xf'),_0x50894a,_0x0f37('0x10'));logger[_0x0f37('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x50894a,_0x0f37('0x10'),JSON[_0x0f37('0x12')](_0x31edcd));if(_0x31edcd[_0x0f37('0x13')]){if(_0x31edcd[_0x0f37('0x13')][_0x0f37('0x14')]===0x1f4){logger[_0x0f37('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x50894a,_0x31edcd[_0x0f37('0x13')][_0x0f37('0x15')]);return _0x1eef5e(_0x31edcd[_0x0f37('0x13')][_0x0f37('0x15')]);}logger[_0x0f37('0x13')](_0x0f37('0xf'),_0x50894a,_0x31edcd['error'][_0x0f37('0x15')]);return _0x58f280(_0x31edcd[_0x0f37('0x13')][_0x0f37('0x15')]);}else{logger[_0x0f37('0xe')](_0x0f37('0xf'),_0x50894a,_0x0f37('0x10'));_0x58f280(_0x31edcd[_0x0f37('0x16')]['message']);}})[_0x0f37('0x17')](function(_0x506c36){logger[_0x0f37('0x13')](_0x0f37('0xf'),_0x50894a,_0x506c36);_0x1eef5e(_0x506c36);});});}
\ No newline at end of file
+var _0xcde7=['rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x441ed7,_0x59de54){var _0x51d612=function(_0x526cd8){while(--_0x526cd8){_0x441ed7['push'](_0x441ed7['shift']());}};_0x51d612(++_0x59de54);}(_0xcde7,0x186));var _0x7cde=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcde7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x7cde('0x0'));var util=require('util');var moment=require(_0x7cde('0x1'));var BPromise=require(_0x7cde('0x2'));var rs=require(_0x7cde('0x3'));var fs=require('fs');var Redis=require(_0x7cde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cde('0x5'));var logger=require('../../config/logger')(_0x7cde('0x6'));var config=require(_0x7cde('0x7'));var jayson=require(_0x7cde('0x8'));var client=jayson[_0x7cde('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46ee92,_0x91a44e,_0x550515){return new BPromise(function(_0x329c32,_0x23d822){return client[_0x7cde('0xa')](_0x46ee92,_0x550515)[_0x7cde('0xb')](function(_0x38c456){logger[_0x7cde('0xc')](_0x7cde('0xd'),_0x91a44e,'request\x20sent');logger[_0x7cde('0xe')](_0x7cde('0xf'),_0x91a44e,'request\x20sent',JSON['stringify'](_0x38c456));if(_0x38c456[_0x7cde('0x10')]){if(_0x38c456[_0x7cde('0x10')][_0x7cde('0x11')]===0x1f4){logger[_0x7cde('0x10')](_0x7cde('0xd'),_0x91a44e,_0x38c456[_0x7cde('0x10')][_0x7cde('0x12')]);return _0x23d822(_0x38c456['error'][_0x7cde('0x12')]);}logger['error'](_0x7cde('0xd'),_0x91a44e,_0x38c456[_0x7cde('0x10')]['message']);return _0x329c32(_0x38c456[_0x7cde('0x10')][_0x7cde('0x12')]);}else{logger['info'](_0x7cde('0xd'),_0x91a44e,_0x7cde('0x13'));_0x329c32(_0x38c456[_0x7cde('0x14')][_0x7cde('0x12')]);}})[_0x7cde('0x15')](function(_0x590a68){logger['error'](_0x7cde('0xd'),_0x91a44e,_0x590a68);_0x23d822(_0x590a68);});});}
\ No newline at end of file
index e8b592d..a332d2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a05=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9a05,0x9e));var _0x59a0=function(_0x7933ed,_0x4a5502){_0x7933ed=_0x7933ed-0x0;var _0x354e7d=_0x9a05[_0x7933ed];return _0x354e7d;};'use strict';var multer=require(_0x59a0('0x0'));var util=require(_0x59a0('0x1'));var path=require(_0x59a0('0x2'));var timeout=require(_0x59a0('0x3'));var express=require(_0x59a0('0x4'));var router=express['Router']();var fs_extra=require(_0x59a0('0x5'));var auth=require(_0x59a0('0x6'));var interaction=require(_0x59a0('0x7'));var config=require(_0x59a0('0x8'));var controller=require(_0x59a0('0x9'));router[_0x59a0('0xa')]('/',auth['isAuthenticated'](),controller[_0x59a0('0xb')]);router[_0x59a0('0xa')](_0x59a0('0xc'),auth[_0x59a0('0xd')](),controller[_0x59a0('0xe')]);router['get'](_0x59a0('0xf'),auth['isAuthenticated'](),controller[_0x59a0('0x10')]);router[_0x59a0('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x59a0('0x12')](_0x59a0('0xf'),auth[_0x59a0('0xd')](),controller[_0x59a0('0x13')]);router[_0x59a0('0x14')]('/:id',auth[_0x59a0('0xd')](),controller[_0x59a0('0x15')]);module[_0x59a0('0x16')]=router;
\ No newline at end of file
+var _0xf11e=['index','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x346ef8,_0x1c9095){var _0x177fd4=function(_0x5c7063){while(--_0x5c7063){_0x346ef8['push'](_0x346ef8['shift']());}};_0x177fd4(++_0x1c9095);}(_0xf11e,0xfc));var _0xef11=function(_0x2dc911,_0x4a7259){_0x2dc911=_0x2dc911-0x0;var _0x4dd04f=_0xf11e[_0x2dc911];return _0x4dd04f;};'use strict';var multer=require(_0xef11('0x0'));var util=require(_0xef11('0x1'));var path=require(_0xef11('0x2'));var timeout=require(_0xef11('0x3'));var express=require('express');var router=express[_0xef11('0x4')]();var fs_extra=require(_0xef11('0x5'));var auth=require(_0xef11('0x6'));var interaction=require(_0xef11('0x7'));var config=require(_0xef11('0x8'));var controller=require(_0xef11('0x9'));router[_0xef11('0xa')]('/',auth[_0xef11('0xb')](),controller[_0xef11('0xc')]);router[_0xef11('0xa')](_0xef11('0xd'),auth['isAuthenticated'](),controller[_0xef11('0xe')]);router[_0xef11('0xa')](_0xef11('0xf'),auth[_0xef11('0xb')](),controller[_0xef11('0x10')]);router[_0xef11('0x11')]('/',auth['isAuthenticated'](),controller[_0xef11('0x12')]);router[_0xef11('0x13')](_0xef11('0xf'),auth[_0xef11('0xb')](),controller[_0xef11('0x14')]);router[_0xef11('0x15')](_0xef11('0xf'),auth[_0xef11('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index e492c32..a53c351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf62f=['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:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','input','name','text','getDataValue','onlineForm','stringify','textarea','Comments','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'];(function(_0x25b3d7,_0x4377ac){var _0x113599=function(_0x37473a){while(--_0x37473a){_0x25b3d7['push'](_0x25b3d7['shift']());}};_0x113599(++_0x4377ac);}(_0xf62f,0x14c));var _0xff62=function(_0x43ee22,_0x2f57b9){_0x43ee22=_0x43ee22-0x0;var _0x1c3a20=_0xf62f[_0x43ee22];return _0x1c3a20;};'use strict';var Sequelize=require(_0xff62('0x0'));var rs=require(_0xff62('0x1'));module['exports']={'name':{'type':Sequelize[_0xff62('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xff62('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xff62('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0x3')},'mapKeyOffline':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x4')},'customerAlias':{'type':Sequelize[_0xff62('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xff62('0x2')],'allowNull':![],'defaultValue':_0xff62('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xff62('0x2')],'allowNull':![],'defaultValue':_0xff62('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xff62('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xff62('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xff62('0x2')]},'animation':{'type':Sequelize[_0xff62('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xff62('0x8')](_0xff62('0x9'),_0xff62('0xa')),'defaultValue':_0xff62('0x9')},'header_online':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0xb')},'start_chat_button':{'type':Sequelize[_0xff62('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0xc')},'header_offline':{'type':Sequelize[_0xff62('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xff62('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xff62('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xff62('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xff62('0xe')]},'closingQuestion':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xff62('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0x10')},'noteTitle':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x11')},'placeholderMessage':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x12')},'closingMessage':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x13')},'closingMessageButton':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0x14')},'conditionAgreement':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xff62('0x15'),_0xff62('0x16')),'defaultValue':_0xff62('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xff62('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xff62('0x17'),'variable':null,'config':{'placeholder':_0xff62('0x18'),'type':_0xff62('0x19'),'required':!![]},'props':{'title':_0xff62('0x18'),'helpText':''}},{'type':'input','props':{'title':_0xff62('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xff62('0x3'),'type':_0xff62('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xff62('0x1a')](_0xff62('0x1b'))?JSON['parse'](this[_0xff62('0x1a')](_0xff62('0x1b'))):{};},'set':function(_0x3a7127){return this['setDataValue']('onlineForm',JSON[_0xff62('0x1c')](_0x3a7127));}},'offlineForm':{'type':Sequelize[_0xff62('0xe')],'defaultValue':function(){return JSON[_0xff62('0x1c')]({'items':[{'type':_0xff62('0x17'),'props':{'title':_0xff62('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xff62('0x3'),'type':_0xff62('0x3')},'variable':null},{'type':_0xff62('0x1d'),'config':{'placeholder':_0xff62('0x1e')},'props':{'title':_0xff62('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xff62('0x1f'))?JSON[_0xff62('0x20')](this[_0xff62('0x1a')](_0xff62('0x1f'))):{};},'set':function(_0x12f3d8){return this[_0xff62('0x21')](_0xff62('0x1f'),JSON[_0xff62('0x1c')](_0x12f3d8));}},'token':{'type':Sequelize[_0xff62('0x2')],'defaultValue':function(){return rs[_0xff62('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xff62('0x2')]},'forwardOffline':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xff62('0x2')]},'waitingTitle':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x23')},'waitingMessage':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x25')},'offlineMessageBody':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xff62('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xff62('0x2')]},'notificationTemplate':{'type':Sequelize[_0xff62('0xe')],'defaultValue':function(){return _0xff62('0x27');}},'notificationSound':{'type':Sequelize[_0xff62('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xff62('0x2')],'defaultValue':_0xff62('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xff62('0x2a')},'defaultTitle':{'type':Sequelize[_0xff62('0x2')]},'customerAvatar':{'type':Sequelize[_0xff62('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xff62('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xff62('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff62('0x6')],'comment':_0xff62('0x2b')},'mandatoryDisposition':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x135d5e){if(!_0x135d5e)this[_0xff62('0x21')]('mandatoryDispositionPauseId',null);this[_0xff62('0x21')](_0xff62('0x2c'),_0x135d5e);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xff62('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xff62('0x2')],'defaultValue':function(){return _0xff62('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0xff62('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xff62('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xff62('0xe')]}};
\ No newline at end of file
+var _0xc6c7=['Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','input','name','text','getDataValue','onlineForm','parse','stringify','textarea','Comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY'];(function(_0xec1042,_0x547c35){var _0x4e2644=function(_0x3937bc){while(--_0x3937bc){_0xec1042['push'](_0xec1042['shift']());}};_0x4e2644(++_0x547c35);}(_0xc6c7,0x159));var _0x7c6c=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0xc6c7[_0x15b399];return _0x199f2d;};'use strict';var Sequelize=require(_0x7c6c('0x0'));var rs=require(_0x7c6c('0x1'));module[_0x7c6c('0x2')]={'name':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7c6c('0x4')},'description':{'type':Sequelize[_0x7c6c('0x3')]},'mapKey':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x5')},'key':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x6')},'customerAlias':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':_0x7c6c('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':_0x7c6c('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7c6c('0x3')]},'animation':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7c6c('0xb')](_0x7c6c('0xc'),_0x7c6c('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0xe')},'start_chat_button':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0xf')},'offline_chat_button':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x10')},'header_offline':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x11')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x14')},'noteTitle':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x16')},'closingMessageButton':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x10')},'skipMessageButton':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x18')},'ratingType':{'type':Sequelize[_0x7c6c('0xb')](_0x7c6c('0x19'),_0x7c6c('0x1a')),'defaultValue':_0x7c6c('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x7c6c('0x1c'),'variable':null,'config':{'placeholder':_0x7c6c('0x1d'),'type':_0x7c6c('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x7c6c('0x1c'),'props':{'title':_0x7c6c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7c6c('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7c6c('0x1f')](_0x7c6c('0x20'))?JSON[_0x7c6c('0x21')](this[_0x7c6c('0x1f')](_0x7c6c('0x20'))):{};},'set':function(_0x3431c5){return this['setDataValue'](_0x7c6c('0x20'),JSON[_0x7c6c('0x22')](_0x3431c5));}},'offlineForm':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':function(){return JSON[_0x7c6c('0x22')]({'items':[{'type':_0x7c6c('0x1c'),'props':{'title':_0x7c6c('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7c6c('0x5'),'type':_0x7c6c('0x5')},'variable':null},{'type':_0x7c6c('0x23'),'config':{'placeholder':_0x7c6c('0x24')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x7c6c('0x25'))?JSON[_0x7c6c('0x21')](this[_0x7c6c('0x1f')](_0x7c6c('0x25'))):{};},'set':function(_0x4550b5){return this['setDataValue'](_0x7c6c('0x25'),JSON[_0x7c6c('0x22')](_0x4550b5));}},'token':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7c6c('0x3')]},'waitingTitle':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x26')},'waitingMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x17')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7c6c('0x1b')]},'showAgentAvatar':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7c6c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':function(){return _0x7c6c('0x29');}},'notificationSound':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':_0x7c6c('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x2b')},'verticalAlignment':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x7c6c('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7c6c('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7c6c('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7c6c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7c6c('0x2d')},'systemAvatar':{'type':Sequelize[_0x7c6c('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7c6c('0x9')],'comment':_0x7c6c('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![],'comment':_0x7c6c('0x2f'),'set':function(_0x101421){if(!_0x101421)this[_0x7c6c('0x30')](_0x7c6c('0x31'),null);this['setDataValue'](_0x7c6c('0x32'),_0x101421);}},'vidaooEscalation':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x7c6c('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x7c6c('0x3')],'defaultValue':function(){return _0x7c6c('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x7c6c('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7c6c('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7c6c('0x1b')]}};
\ No newline at end of file
index 8e3e23b..0319203 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aa2=['addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','custom','isNil','existsSync','server/files/images/logos/','root','getAvatar','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','applications','list','List','orderBy','priority','asc','account','contact','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','mimetype','server','files','offline-chat','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','nolimit','Contact','User','Owner','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','Interval','getProactiveActions','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','transaction','getApplications','addProactiveActions','chatProactiveAction','online','false','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','filename','addAvatar','agentAvatar','file','customerAvatar'];(function(_0x402ce1,_0x5ab4fa){var _0x2553ee=function(_0xb0f3d1){while(--_0xb0f3d1){_0x402ce1['push'](_0x402ce1['shift']());}};_0x2553ee(++_0x5ab4fa);}(_0x7aa2,0x1f3));var _0x27aa=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x7aa2[_0xc67528];return _0x38e26d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27aa('0x0'));var zipdir=require(_0x27aa('0x1'));var jsonpatch=require(_0x27aa('0x2'));var rp=require(_0x27aa('0x3'));var moment=require(_0x27aa('0x4'));var BPromise=require(_0x27aa('0x5'));var Mustache=require(_0x27aa('0x6'));var util=require(_0x27aa('0x7'));var path=require('path');var sox=require(_0x27aa('0x8'));var csv=require(_0x27aa('0x9'));var ejs=require(_0x27aa('0xa'));var fs=require('fs');var fs_extra=require(_0x27aa('0xb'));var _=require(_0x27aa('0xc'));var squel=require('squel');var crypto=require(_0x27aa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x27aa('0xe'));var toCsv=require(_0x27aa('0x9'));var querystring=require(_0x27aa('0xf'));var Papa=require(_0x27aa('0x10'));var Redis=require(_0x27aa('0x11'));var authService=require(_0x27aa('0x12'));var qs=require(_0x27aa('0x13'));var as=require(_0x27aa('0x14'));var hardwareService=require(_0x27aa('0x15'));var logger=require(_0x27aa('0x16'))(_0x27aa('0x17'));var utils=require(_0x27aa('0x18'));var config=require(_0x27aa('0x19'));var licenseUtil=require(_0x27aa('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x27aa('0x1b')](config[_0x27aa('0x1c')],{'host':_0x27aa('0x1d'),'port':0x18eb});var socket=require(_0x27aa('0x1e'))(new Redis(config[_0x27aa('0x1c')]));require('./chatWebsite.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x27aa('0x1f')][_0x27aa('0x20')]({'port':0x232c});var client9002=jayson[_0x27aa('0x1f')][_0x27aa('0x20')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x27aa('0x1f')]['http']({'port':0x2329});function respondWithRpcPromise(_0x578fd3,_0x42e5f9,_0x4cd2f1,_0x4b43b2){return new BPromise(function(_0x3fdf19,_0x5248c4){var _0x44bd94=_0x4b43b2||client;return _0x44bd94['request'](_0x578fd3,_0x4cd2f1)['then'](function(_0x406403){logger[_0x27aa('0x21')](_0x27aa('0x22'),_0x42e5f9,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x42e5f9,_0x27aa('0x23'),JSON[_0x27aa('0x24')](_0x406403));if(_0x406403[_0x27aa('0x25')]){if(_0x406403[_0x27aa('0x25')]['code']===0x1f4){logger[_0x27aa('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x42e5f9,_0x406403[_0x27aa('0x25')]['message']);return _0x5248c4(_0x406403[_0x27aa('0x25')][_0x27aa('0x26')]);}logger[_0x27aa('0x25')](_0x27aa('0x22'),_0x42e5f9,_0x406403[_0x27aa('0x25')][_0x27aa('0x26')]);return _0x3fdf19(_0x406403[_0x27aa('0x25')]['message']);}else{logger[_0x27aa('0x21')](_0x27aa('0x22'),_0x42e5f9,_0x27aa('0x23'));_0x3fdf19(_0x406403[_0x27aa('0x27')]['message']);}})[_0x27aa('0x28')](function(_0x4788ef){logger[_0x27aa('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x42e5f9,_0x4788ef);_0x5248c4(_0x4788ef);});});}function respondWithStatusCode(_0x14c571,_0x4b6682){_0x4b6682=_0x4b6682||0xcc;return function(_0x2fc7aa){if(_0x2fc7aa){return _0x14c571[_0x27aa('0x29')](_0x4b6682);}return _0x14c571['status'](_0x4b6682)[_0x27aa('0x2a')]();};}function respondWithResult(_0x3d3949,_0x2ce8dd){_0x2ce8dd=_0x2ce8dd||0xc8;return function(_0x34e58f){if(_0x34e58f){return _0x3d3949[_0x27aa('0x2b')](_0x2ce8dd)[_0x27aa('0x2c')](_0x34e58f);}};}function respondWithFilteredResult(_0x107cd3,_0x5b77d7){return function(_0x476de3){if(_0x476de3){var _0x56faff=typeof _0x5b77d7[_0x27aa('0x2d')]===_0x27aa('0x2e')&&typeof _0x5b77d7[_0x27aa('0x2f')]===_0x27aa('0x2e');var _0x3c80f0=_0x476de3[_0x27aa('0x30')];var _0x3c843d=_0x56faff?0x0:_0x5b77d7[_0x27aa('0x2d')];var _0x48c452=_0x56faff?_0x476de3[_0x27aa('0x30')]:_0x5b77d7[_0x27aa('0x2d')]+_0x5b77d7['limit'];var _0x5ae25a;if(_0x48c452>=_0x3c80f0){_0x48c452=_0x3c80f0;_0x5ae25a=0xc8;}else{_0x5ae25a=0xce;}_0x107cd3[_0x27aa('0x2b')](_0x5ae25a);return _0x107cd3[_0x27aa('0x31')]('Content-Range',_0x3c843d+'-'+_0x48c452+'/'+_0x3c80f0)[_0x27aa('0x2c')](_0x476de3);}return null;};}function patchUpdates(_0xd45ec2){return function(_0x38de3d){try{jsonpatch[_0x27aa('0x32')](_0x38de3d,_0xd45ec2,!![]);}catch(_0x58e4df){return BPromise[_0x27aa('0x33')](_0x58e4df);}return _0x38de3d[_0x27aa('0x34')]();};}function saveUpdates(_0x555739,_0x35bc32){return function(_0x1b712a){if(_0x1b712a){return _0x1b712a[_0x27aa('0x35')](_0x555739)[_0x27aa('0x36')](function(_0xb0c48c){return _0xb0c48c;});}return null;};}function removeEntity(_0x2eeb4c,_0x59bc57){return function(_0x1c7c53){if(_0x1c7c53){return _0x1c7c53[_0x27aa('0x37')]()[_0x27aa('0x36')](function(){var _0x4ab042=_0x1c7c53[_0x27aa('0x38')]({'plain':!![]});var _0x1e8104=_0x27aa('0x39');return db[_0x27aa('0x3a')][_0x27aa('0x37')]({'where':{'type':_0x1e8104,'resourceId':_0x4ab042['id']}})[_0x27aa('0x36')](function(){return _0x1c7c53;});})['then'](function(){_0x2eeb4c[_0x27aa('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ca0ca,_0x1eed5a){return function(_0x436511){if(!_0x436511){_0x4ca0ca[_0x27aa('0x29')](0x194);}return _0x436511;};}function handleError(_0x331945,_0x2073cf){_0x2073cf=_0x2073cf||0x1f4;return function(_0x4f2a6f){logger['error'](_0x4f2a6f[_0x27aa('0x3b')]);if(_0x4f2a6f['name']){delete _0x4f2a6f[_0x27aa('0x3c')];}_0x331945[_0x27aa('0x2b')](_0x2073cf)[_0x27aa('0x3d')](_0x4f2a6f);};}exports[_0x27aa('0x3e')]=function(_0x25c4d5,_0x1727e2){var _0x650ac={'include':[{'model':db[_0x27aa('0x3f')],'as':_0x27aa('0x40')}]},_0x5eb974={},_0xdf502c={'count':0x0,'rows':[]};var _0x29db44=_[_0x27aa('0x41')](db[_0x27aa('0x42')][_0x27aa('0x43')],function(_0x5c5be5){return{'name':_0x5c5be5[_0x27aa('0x44')],'type':_0x5c5be5[_0x27aa('0x45')][_0x27aa('0x46')]};});_0x5eb974[_0x27aa('0x47')]=_[_0x27aa('0x41')](_0x29db44,_0x27aa('0x3c'));_0x5eb974[_0x27aa('0x48')]=_['keys'](_0x25c4d5[_0x27aa('0x48')]);_0x5eb974['filters']=_['intersection'](_0x5eb974['model'],_0x5eb974[_0x27aa('0x48')]);_0x650ac[_0x27aa('0x49')]=_[_0x27aa('0x4a')](_0x5eb974[_0x27aa('0x47')],qs[_0x27aa('0x4b')](_0x25c4d5[_0x27aa('0x48')][_0x27aa('0x4b')]));_0x650ac[_0x27aa('0x49')]=_0x650ac[_0x27aa('0x49')][_0x27aa('0x4c')]?_0x650ac[_0x27aa('0x49')]:_0x5eb974['model'];if(!_0x25c4d5[_0x27aa('0x48')][_0x27aa('0x4d')]('nolimit')){_0x650ac[_0x27aa('0x2f')]=qs[_0x27aa('0x2f')](_0x25c4d5[_0x27aa('0x48')][_0x27aa('0x2f')]);_0x650ac[_0x27aa('0x2d')]=qs['offset'](_0x25c4d5[_0x27aa('0x48')][_0x27aa('0x2d')]);}_0x650ac[_0x27aa('0x4e')]=qs[_0x27aa('0x4f')](_0x25c4d5['query'][_0x27aa('0x4f')]);_0x650ac['where']=qs[_0x27aa('0x50')](_[_0x27aa('0x51')](_0x25c4d5[_0x27aa('0x48')],_0x5eb974[_0x27aa('0x50')]),_0x29db44);if(_0x25c4d5[_0x27aa('0x48')]['filter']){_0x650ac[_0x27aa('0x52')]=_[_0x27aa('0x53')](_0x650ac[_0x27aa('0x52')],{'$or':_[_0x27aa('0x41')](_0x29db44,function(_0x357373){if(_0x357373[_0x27aa('0x45')]!==_0x27aa('0x54')){var _0x29194f={};_0x29194f[_0x357373[_0x27aa('0x3c')]]={'$like':'%'+_0x25c4d5[_0x27aa('0x48')]['filter']+'%'};return _0x29194f;}})});}_0x650ac=_[_0x27aa('0x53')]({},_0x650ac,_0x25c4d5[_0x27aa('0x55')]);var _0xf9578c={'where':_0x650ac[_0x27aa('0x52')]};return db[_0x27aa('0x42')][_0x27aa('0x30')](_0xf9578c)[_0x27aa('0x36')](function(_0x3c120a){_0xdf502c[_0x27aa('0x30')]=_0x3c120a;if(_0x25c4d5[_0x27aa('0x48')][_0x27aa('0x56')]){_0x650ac[_0x27aa('0x57')]=[{'all':!![]}];}return db[_0x27aa('0x42')][_0x27aa('0x58')](_0x650ac);})[_0x27aa('0x36')](function(_0x1291cb){_0xdf502c[_0x27aa('0x59')]=_0x1291cb;return _0xdf502c;})[_0x27aa('0x36')](respondWithFilteredResult(_0x1727e2,_0x650ac))[_0x27aa('0x28')](handleError(_0x1727e2,null));};exports[_0x27aa('0x5a')]=function(_0x4d50ac,_0x5eee0a){var _0x47f52a={'raw':![],'where':{'id':_0x4d50ac[_0x27aa('0x5b')]['id']},'include':[{'model':db[_0x27aa('0x3f')],'as':'mandatoryDispositionPause'}]},_0x435c9a={};_0x435c9a[_0x27aa('0x47')]=_[_0x27aa('0x5c')](db[_0x27aa('0x42')][_0x27aa('0x43')]);_0x435c9a['query']=_[_0x27aa('0x5c')](_0x4d50ac['query']);_0x435c9a[_0x27aa('0x50')]=_[_0x27aa('0x4a')](_0x435c9a[_0x27aa('0x47')],_0x435c9a[_0x27aa('0x48')]);_0x47f52a['attributes']=_['intersection'](_0x435c9a[_0x27aa('0x47')],qs['fields'](_0x4d50ac['query'][_0x27aa('0x4b')]));_0x47f52a[_0x27aa('0x49')]=_0x47f52a[_0x27aa('0x49')][_0x27aa('0x4c')]?_0x47f52a[_0x27aa('0x49')]:_0x435c9a[_0x27aa('0x47')];if(_0x4d50ac[_0x27aa('0x48')]['includeAll']){_0x47f52a[_0x27aa('0x57')]=[{'all':!![]}];}_0x47f52a=_[_0x27aa('0x53')]({},_0x47f52a,_0x4d50ac[_0x27aa('0x55')]);return db['ChatWebsite'][_0x27aa('0x5d')](_0x47f52a)[_0x27aa('0x36')](handleEntityNotFound(_0x5eee0a,null))['then'](respondWithResult(_0x5eee0a,null))[_0x27aa('0x28')](handleError(_0x5eee0a,null));};exports[_0x27aa('0x5e')]=function(_0x3ab02,_0xfd6338){return db[_0x27aa('0x42')]['create'](_0x3ab02[_0x27aa('0x5f')],{})['then'](function(_0xd43fc7){var _0x559c71=_0x3ab02[_0x27aa('0x60')][_0x27aa('0x38')]({'plain':!![]});if(!_0x559c71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x559c71[_0x27aa('0x61')]===_0x27aa('0x60')){var _0x35c7b6=_0xd43fc7[_0x27aa('0x38')]({'plain':!![]});var _0x4b2552=_0x27aa('0x39');return db[_0x27aa('0x62')]['find']({'where':{'name':_0x4b2552,'userProfileId':_0x559c71[_0x27aa('0x63')]},'raw':!![]})[_0x27aa('0x36')](function(_0x350221){if(_0x350221&&_0x350221['autoAssociation']===0x0){return db[_0x27aa('0x3a')][_0x27aa('0x5e')]({'name':_0x35c7b6[_0x27aa('0x3c')],'resourceId':_0x35c7b6['id'],'type':_0x350221[_0x27aa('0x3c')],'sectionId':_0x350221['id']},{})[_0x27aa('0x36')](function(){return _0xd43fc7;});}else{return _0xd43fc7;}})[_0x27aa('0x28')](function(_0x14c4fc){logger[_0x27aa('0x25')](_0x27aa('0x64'),_0x14c4fc);throw _0x14c4fc;});}return _0xd43fc7;})[_0x27aa('0x36')](respondWithResult(_0xfd6338,0xc9))[_0x27aa('0x28')](handleError(_0xfd6338,null));};exports['update']=function(_0x1845b0,_0x479088){if(_0x1845b0['body']['id']){delete _0x1845b0[_0x27aa('0x5f')]['id'];}return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x1845b0[_0x27aa('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x27aa('0x40')}]})[_0x27aa('0x36')](handleEntityNotFound(_0x479088,null))[_0x27aa('0x36')](saveUpdates(_0x1845b0[_0x27aa('0x5f')],null))[_0x27aa('0x36')](respondWithResult(_0x479088,null))[_0x27aa('0x28')](handleError(_0x479088,null));};exports[_0x27aa('0x37')]=function(_0x1e0378,_0x3f4079){return db['ChatWebsite'][_0x27aa('0x5d')]({'where':{'id':_0x1e0378[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x3f4079,null))['then'](removeEntity(_0x3f4079,null))[_0x27aa('0x28')](handleError(_0x3f4079,null));};exports[_0x27aa('0x65')]=function(_0x2d2fc7,_0x365829){return db[_0x27aa('0x42')]['describe']()['then'](respondWithResult(_0x365829,null))[_0x27aa('0x28')](handleError(_0x365829,null));};exports['addDisposition']=function(_0x345463,_0x3780a7,_0x4e1825){if(_0x345463[_0x27aa('0x5f')]['id']){delete _0x345463[_0x27aa('0x5f')]['id'];}return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x345463['params']['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x3780a7,null))['then'](function(_0x23985a){if(_0x23985a){_0x345463['body'][_0x27aa('0x66')]=_0x23985a['id'];return db[_0x27aa('0x67')][_0x27aa('0x5e')](_0x345463['body']);}})['then'](respondWithResult(_0x3780a7,null))[_0x27aa('0x28')](handleError(_0x3780a7,null));};exports[_0x27aa('0x68')]=function(_0x2c15d7,_0x2b2561,_0x25115e){var _0x564078={'raw':![],'where':{}};var _0x32c51c={};var _0x413e3a={'count':0x0,'rows':[]};return db[_0x27aa('0x42')][_0x27aa('0x69')]({'where':{'id':_0x2c15d7[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x2b2561,null))[_0x27aa('0x36')](function(_0x5a4a63){if(_0x5a4a63){_0x32c51c[_0x27aa('0x47')]=_[_0x27aa('0x5c')](db[_0x27aa('0x67')][_0x27aa('0x43')]);_0x32c51c[_0x27aa('0x48')]=_['keys'](_0x2c15d7[_0x27aa('0x48')]);_0x32c51c[_0x27aa('0x50')]=_[_0x27aa('0x4a')](_0x32c51c[_0x27aa('0x47')],_0x32c51c[_0x27aa('0x48')]);_0x564078[_0x27aa('0x49')]=_[_0x27aa('0x4a')](_0x32c51c[_0x27aa('0x47')],qs[_0x27aa('0x4b')](_0x2c15d7[_0x27aa('0x48')][_0x27aa('0x4b')]));_0x564078[_0x27aa('0x49')]=_0x564078[_0x27aa('0x49')]['length']?_0x564078[_0x27aa('0x49')]:_0x32c51c[_0x27aa('0x47')];if(!_0x2c15d7['query']['hasOwnProperty']('nolimit')){_0x564078[_0x27aa('0x2f')]=qs[_0x27aa('0x2f')](_0x2c15d7['query'][_0x27aa('0x2f')]);_0x564078[_0x27aa('0x2d')]=qs[_0x27aa('0x2d')](_0x2c15d7[_0x27aa('0x48')]['offset']);}_0x564078[_0x27aa('0x4e')]=qs[_0x27aa('0x4f')](_0x2c15d7[_0x27aa('0x48')]['sort']);_0x564078['where']=qs[_0x27aa('0x50')](_[_0x27aa('0x51')](_0x2c15d7['query'],_0x32c51c[_0x27aa('0x50')]));_0x564078[_0x27aa('0x52')][_0x27aa('0x66')]=_0x5a4a63['id'];if(_0x2c15d7['query']['filter']){_0x564078[_0x27aa('0x52')]=_[_0x27aa('0x53')](_0x564078[_0x27aa('0x52')],{'$or':_[_0x27aa('0x41')](_0x564078['attributes'],function(_0xeb6fa8){var _0x59b49c={};_0x59b49c[_0xeb6fa8]={'$like':'%'+_0x2c15d7[_0x27aa('0x48')][_0x27aa('0x6a')]+'%'};return _0x59b49c;})});}_0x564078=_[_0x27aa('0x53')]({},_0x564078,_0x2c15d7['options']);return db[_0x27aa('0x67')][_0x27aa('0x30')]({'where':_0x564078['where']})[_0x27aa('0x36')](function(_0x1aeb03){_0x413e3a[_0x27aa('0x30')]=_0x1aeb03;if(_0x2c15d7[_0x27aa('0x48')][_0x27aa('0x56')]){_0x564078[_0x27aa('0x57')]=[{'all':!![]}];}return db[_0x27aa('0x67')][_0x27aa('0x58')](_0x564078);})['then'](function(_0x50b9e6){_0x413e3a[_0x27aa('0x59')]=_0x50b9e6;return _0x413e3a;});}})[_0x27aa('0x36')](respondWithFilteredResult(_0x2b2561,_0x564078))[_0x27aa('0x28')](handleError(_0x2b2561,null));};exports[_0x27aa('0x6b')]=function(_0x3e1e43,_0x539d41,_0x3a0382){return db['ChatWebsite'][_0x27aa('0x5d')]({'where':{'id':_0x3e1e43['params']['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x539d41,null))[_0x27aa('0x36')](function(_0x3db492){if(_0x3db492){return _0x3db492[_0x27aa('0x6b')](_0x3e1e43['query'][_0x27aa('0x6c')]);}})[_0x27aa('0x36')](respondWithStatusCode(_0x539d41,null))[_0x27aa('0x28')](handleError(_0x539d41,null));};exports[_0x27aa('0x6d')]=function(_0x5288da,_0x2a5e53,_0x169f50){if(_0x5288da[_0x27aa('0x5f')]['id']){delete _0x5288da[_0x27aa('0x5f')]['id'];}return db['ChatWebsite'][_0x27aa('0x5d')]({'where':{'id':_0x5288da[_0x27aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2a5e53,null))[_0x27aa('0x36')](function(_0xf36942){if(_0xf36942){_0x5288da[_0x27aa('0x5f')][_0x27aa('0x66')]=_0xf36942['id'];return db[_0x27aa('0x6e')][_0x27aa('0x5e')](_0x5288da[_0x27aa('0x5f')]);}})[_0x27aa('0x36')](respondWithResult(_0x2a5e53,null))['catch'](handleError(_0x2a5e53,null));};exports[_0x27aa('0x6f')]=function(_0x2e55e0,_0x5a0d08,_0x44965b){var _0x2c1378={'raw':![],'where':{}};var _0x5323dc={};var _0x472623={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x27aa('0x69')]({'where':{'id':_0x2e55e0[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x5a0d08,null))['then'](function(_0x461c57){if(_0x461c57){_0x5323dc[_0x27aa('0x47')]=_['keys'](db[_0x27aa('0x6e')][_0x27aa('0x43')]);_0x5323dc[_0x27aa('0x48')]=_[_0x27aa('0x5c')](_0x2e55e0['query']);_0x5323dc[_0x27aa('0x50')]=_[_0x27aa('0x4a')](_0x5323dc[_0x27aa('0x47')],_0x5323dc[_0x27aa('0x48')]);_0x2c1378[_0x27aa('0x49')]=_['intersection'](_0x5323dc['model'],qs[_0x27aa('0x4b')](_0x2e55e0[_0x27aa('0x48')][_0x27aa('0x4b')]));_0x2c1378[_0x27aa('0x49')]=_0x2c1378[_0x27aa('0x49')][_0x27aa('0x4c')]?_0x2c1378[_0x27aa('0x49')]:_0x5323dc[_0x27aa('0x47')];if(!_0x2e55e0['query'][_0x27aa('0x4d')]('nolimit')){_0x2c1378[_0x27aa('0x2f')]=qs['limit'](_0x2e55e0[_0x27aa('0x48')][_0x27aa('0x2f')]);_0x2c1378[_0x27aa('0x2d')]=qs[_0x27aa('0x2d')](_0x2e55e0['query'][_0x27aa('0x2d')]);}_0x2c1378['order']=qs[_0x27aa('0x4f')](_0x2e55e0[_0x27aa('0x48')][_0x27aa('0x4f')]);_0x2c1378[_0x27aa('0x52')]=qs[_0x27aa('0x50')](_['pick'](_0x2e55e0['query'],_0x5323dc[_0x27aa('0x50')]));_0x2c1378[_0x27aa('0x52')][_0x27aa('0x66')]=_0x461c57['id'];if(_0x2e55e0[_0x27aa('0x48')]['filter']){_0x2c1378[_0x27aa('0x52')]=_[_0x27aa('0x53')](_0x2c1378[_0x27aa('0x52')],{'$or':_[_0x27aa('0x41')](_0x2c1378[_0x27aa('0x49')],function(_0xdf96ee){var _0x525d77={};_0x525d77[_0xdf96ee]={'$like':'%'+_0x2e55e0[_0x27aa('0x48')][_0x27aa('0x6a')]+'%'};return _0x525d77;})});}_0x2c1378=_['merge']({},_0x2c1378,_0x2e55e0['options']);return db[_0x27aa('0x6e')]['count']({'where':_0x2c1378[_0x27aa('0x52')]})[_0x27aa('0x36')](function(_0x22882e){_0x472623['count']=_0x22882e;if(_0x2e55e0[_0x27aa('0x48')][_0x27aa('0x56')]){_0x2c1378[_0x27aa('0x57')]=[{'all':!![]}];}return db[_0x27aa('0x6e')][_0x27aa('0x58')](_0x2c1378);})[_0x27aa('0x36')](function(_0x429a65){_0x472623[_0x27aa('0x59')]=_0x429a65;return _0x472623;});}})['then'](respondWithFilteredResult(_0x5a0d08,_0x2c1378))['catch'](handleError(_0x5a0d08,null));};exports[_0x27aa('0x70')]=function(_0x25dccb,_0x1c7fbf,_0x3c8d89){return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x25dccb[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x1c7fbf,null))[_0x27aa('0x36')](function(_0x5f4ff2){if(_0x5f4ff2){return _0x5f4ff2[_0x27aa('0x70')](_0x25dccb[_0x27aa('0x48')][_0x27aa('0x6c')]);}})[_0x27aa('0x36')](respondWithStatusCode(_0x1c7fbf,null))[_0x27aa('0x28')](handleError(_0x1c7fbf,null));};exports['addLogo']=function(_0x5bbc92,_0x44e61c,_0x152a65){_0x5bbc92[_0x27aa('0x5f')][_0x27aa('0x71')]=_0x5bbc92['file'][_0x27aa('0x72')];return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x5bbc92[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x44e61c,null))[_0x27aa('0x36')](saveUpdates(_0x5bbc92[_0x27aa('0x5f')],null))[_0x27aa('0x36')](respondWithResult(_0x44e61c,null))[_0x27aa('0x28')](handleError(_0x44e61c,null));};exports[_0x27aa('0x73')]=function(_0x3f1b3c,_0x83cf97,_0x1ca59c){_0x3f1b3c[_0x27aa('0x5f')][_0x27aa('0x74')]=_0x3f1b3c[_0x27aa('0x75')][_0x27aa('0x72')];return db[_0x27aa('0x42')]['find']({'where':{'id':_0x3f1b3c['params']['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x83cf97,null))[_0x27aa('0x36')](saveUpdates(_0x3f1b3c[_0x27aa('0x5f')],null))[_0x27aa('0x36')](respondWithResult(_0x83cf97,null))['catch'](handleError(_0x83cf97,null));};exports['addCustomerAvatar']=function(_0x1ff9a1,_0x1bccdd,_0x149508){_0x1ff9a1[_0x27aa('0x5f')][_0x27aa('0x76')]=_0x1ff9a1[_0x27aa('0x75')]['filename'];return db[_0x27aa('0x42')]['find']({'where':{'id':_0x1ff9a1[_0x27aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1bccdd,null))[_0x27aa('0x36')](saveUpdates(_0x1ff9a1[_0x27aa('0x5f')],null))['then'](respondWithResult(_0x1bccdd,null))[_0x27aa('0x28')](handleError(_0x1bccdd,null));};exports[_0x27aa('0x77')]=function(_0x58ca8a,_0x31e579,_0x271974){_0x58ca8a[_0x27aa('0x5f')][_0x27aa('0x78')]=_0x58ca8a[_0x27aa('0x75')][_0x27aa('0x72')];return db['ChatWebsite'][_0x27aa('0x5d')]({'where':{'id':_0x58ca8a[_0x27aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x31e579,null))[_0x27aa('0x36')](saveUpdates(_0x58ca8a['body'],null))['then'](respondWithResult(_0x31e579,null))[_0x27aa('0x28')](handleError(_0x31e579,null));};exports[_0x27aa('0x79')]=function(_0x407220,_0x5e73a3,_0x1cb5d0){var _0x43349e=path[_0x27aa('0x7a')](config['root'],_0x27aa('0x7b'));var _0x40c3db={'where':{'id':_0x407220[_0x27aa('0x5b')]['id']},'attributes':['id',_0x27aa('0x71')],'raw':!![]};var _0x258b6b=![];return require('../../config/license/util')['getLicense']()[_0x27aa('0x36')](function(_0x1f2b20){if(_0x1f2b20){_0x258b6b=_0x1f2b20[_0x27aa('0x7c')];}})['then'](function(){return db[_0x27aa('0x42')]['find'](_0x40c3db);})[_0x27aa('0x36')](handleEntityNotFound(_0x5e73a3,null))['then'](function(_0x5af599){if(_0x5af599){if(!_[_0x27aa('0x7d')](_0x5af599[_0x27aa('0x71')])){if(fs[_0x27aa('0x7e')](path[_0x27aa('0x7a')](config['root'],_0x27aa('0x7f'),_0x5af599[_0x27aa('0x71')]))&&_0x258b6b){_0x43349e=path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x7f'),_0x5af599[_0x27aa('0x71')]);}}return _0x5e73a3['download'](_0x43349e);}})[_0x27aa('0x28')](handleError(_0x5e73a3,null));};exports[_0x27aa('0x81')]=function(_0x59cd30,_0x31bb10,_0x3afc08){var _0xce06e2=path[_0x27aa('0x7a')](config[_0x27aa('0x80')],'server/files/images/avatars/default_avatar.png');var _0x13e4ee={'where':{'id':_0x59cd30['params']['id']},'attributes':['id',_0x27aa('0x74')],'raw':!![]};return db[_0x27aa('0x42')][_0x27aa('0x5d')](_0x13e4ee)[_0x27aa('0x36')](handleEntityNotFound(_0x31bb10,null))[_0x27aa('0x36')](function(_0xfdafb8){if(_0xfdafb8){if(!_[_0x27aa('0x7d')](_0xfdafb8[_0x27aa('0x74')])){if(fs[_0x27aa('0x7e')](path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x82'),_0xfdafb8[_0x27aa('0x74')]))){_0xce06e2=path[_0x27aa('0x7a')](config['root'],_0x27aa('0x82'),_0xfdafb8['agentAvatar']);}}return _0x31bb10[_0x27aa('0x83')](_0xce06e2);}})[_0x27aa('0x28')](handleError(_0x31bb10,null));};exports[_0x27aa('0x84')]=function(_0x59ea1b,_0x2703e0,_0x399c0e){var _0x2cf009=path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x85'));var _0x380c64={'where':{'id':_0x59ea1b[_0x27aa('0x5b')]['id']},'attributes':['id',_0x27aa('0x76'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x27aa('0x5d')](_0x380c64)[_0x27aa('0x36')](handleEntityNotFound(_0x2703e0,null))['then'](function(_0x4c6f58){if(_0x4c6f58){if(!_[_0x27aa('0x7d')](_0x4c6f58[_0x27aa('0x76')])){if(fs[_0x27aa('0x7e')](path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x82'),_0x4c6f58[_0x27aa('0x76')]))&&_0x4c6f58[_0x27aa('0x86')]){_0x2cf009=path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x82'),_0x4c6f58['customerAvatar']);}}return _0x2703e0[_0x27aa('0x83')](_0x2cf009);}})[_0x27aa('0x28')](handleError(_0x2703e0,null));};exports[_0x27aa('0x87')]=function(_0x22dfca,_0x388232,_0x17a8f7){var _0x27c532=path['join'](config[_0x27aa('0x80')],_0x27aa('0x88'));var _0x38c7ba={'where':{'id':_0x22dfca[_0x27aa('0x5b')]['id']},'attributes':['id',_0x27aa('0x78')],'raw':!![]};return db[_0x27aa('0x42')][_0x27aa('0x5d')](_0x38c7ba)['then'](handleEntityNotFound(_0x388232,null))[_0x27aa('0x36')](function(_0x20b0a9){if(_0x20b0a9){if(!_['isNil'](_0x20b0a9[_0x27aa('0x78')])){if(fs['existsSync'](path[_0x27aa('0x7a')](config['root'],_0x27aa('0x82'),_0x20b0a9[_0x27aa('0x78')]))){_0x27c532=path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x82'),_0x20b0a9[_0x27aa('0x78')]);}}return _0x388232[_0x27aa('0x83')](_0x27c532);}})[_0x27aa('0x28')](handleError(_0x388232,null));};exports[_0x27aa('0x89')]=function(_0x147300,_0x5bc55c,_0x698c51){var _0x30df7f=require(_0x27aa('0x8a'));var _0x154f85=new _0x30df7f();var _0x317797=_0x154f85[_0x27aa('0x8b')](_0x147300[_0x27aa('0x8c')][_0x27aa('0x8d')])['getResult']();var _0x1727ae={'body':_0x147300[_0x27aa('0x5f')],'channel':_0x27aa('0x8e')};var _0x14e7d5=[];var _0x1b5683=[];var _0x5c77f3={};var _0x4f98a1=![];return db[_0x27aa('0x8f')][_0x27aa('0x65')]()['then'](function(_0x3be1c8){if(!_0x3be1c8){throw new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0x92'));}_0x14e7d5=_[_0x27aa('0x93')](_[_0x27aa('0x5c')](_0x3be1c8),[_0x27aa('0x94'),_0x27aa('0x95')]);_0x1b5683=_[_0x27aa('0x93')](_[_0x27aa('0x5c')](_0x3be1c8),[_0x27aa('0x94'),'updatedAt',_0x27aa('0x96'),_0x27aa('0x97')]);if(_0x147300[_0x27aa('0x5f')]['id']){delete _0x147300['body']['id'];}if(_['isNil'](_0x147300[_0x27aa('0x5f')][_0x27aa('0x98')])){throw new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0x99'));}if(_[_0x27aa('0x7d')](_0x147300[_0x27aa('0x5f')][_0x27aa('0x5f')])||_0x147300[_0x27aa('0x5f')][_0x27aa('0x5f')]===''){throw new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0x9a'));}if(_[_0x27aa('0x7d')](_0x147300[_0x27aa('0x5f')][_0x27aa('0x9b')])){throw new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0x9c')+_0x1b5683);}if(!_[_0x27aa('0x9d')](_0x1b5683,_0x147300[_0x27aa('0x5f')]['mapKey'])){throw new db[(_0x27aa('0x90'))]['ValidationError'](_0x27aa('0x9e')+_0x1b5683);}_0x5c77f3[_0x147300[_0x27aa('0x5f')][_0x27aa('0x9b')]]=_0x147300[_0x27aa('0x5f')][_0x27aa('0x98')];})[_0x27aa('0x36')](function(){return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x147300[_0x27aa('0x5b')]['id']},'include':[{'model':db[_0x27aa('0x9f')],'as':'List','include':[{'model':db[_0x27aa('0x8f')],'as':_0x27aa('0xa0'),'where':_0x5c77f3,'limit':0x1,'order':[[_0x27aa('0x95'),_0x27aa('0xa1')]]}]},{'model':db[_0x27aa('0xa2')],'as':_0x27aa('0xa3')}]});})['then'](handleEntityNotFound(_0x5bc55c,null))[_0x27aa('0x36')](function(_0x35e9dc){if(_0x35e9dc&&_0x35e9dc['List']){_0x1727ae['account']=_0x35e9dc;_0x1727ae[_0x27aa('0xa4')]=_0x35e9dc['Applications'];_0x1727ae[_0x27aa('0xa5')]=_0x35e9dc[_0x27aa('0xa6')];_0x1727ae[_0x27aa('0xa4')]=_[_0x27aa('0xa7')](_0x1727ae[_0x27aa('0xa4')],[_0x27aa('0xa8')],[_0x27aa('0xa9')]);if(_0x1727ae[_0x27aa('0xaa')]['Applications']){delete _0x1727ae[_0x27aa('0xaa')][_0x27aa('0xa3')];}if(_0x1727ae[_0x27aa('0xaa')]['List']&&_0x1727ae['account']['List'][_0x27aa('0xa0')][_0x27aa('0x4c')]){return _0x1727ae[_0x27aa('0xaa')][_0x27aa('0xa6')]['Contacts'][0x0];}var _0x5369bb=_[_0x27aa('0x1b')](_0x147300[_0x27aa('0x5f')],{'firstName':_0x147300[_0x27aa('0x5f')]['from'],'ListId':_0x35e9dc[_0x27aa('0x97')]});_0x5369bb[_0x147300['body'][_0x27aa('0x9b')]]=_0x147300['body'][_0x27aa('0x98')];return db[_0x27aa('0x8f')][_0x27aa('0x5e')](_0x5369bb,{'fields':_0x14e7d5,'raw':!![]});}})[_0x27aa('0x36')](handleEntityNotFound(_0x5bc55c,null))[_0x27aa('0x36')](function(_0x23968d){_0x1727ae[_0x27aa('0xab')]=_0x23968d;var _0x3f1fed=_0x147300['body']['customerIp'];if(_0x147300['headers']['cf-connecting-ip']){_0x3f1fed=_0x147300[_0x27aa('0x8c')][_0x27aa('0xac')];}else if(_0x147300[_0x27aa('0x8c')]['x-forwarded-for']){_0x3f1fed=_[_0x27aa('0xad')](_0x147300[_0x27aa('0x8c')][_0x27aa('0xae')]['split'](','));}if(_0x23968d){var _0x5926fa={'ContactId':_0x23968d['id'],'ChatWebsiteId':_0x147300[_0x27aa('0x5b')]['id'],'from':(_0x23968d[_0x27aa('0xaf')]||'')+'\x20'+(_0x23968d[_0x27aa('0xb0')]||''),'customerIp':_0x3f1fed,'customerPort':_0x147300[_0x27aa('0x8c')][_0x27aa('0xb1')]?_0x147300[_0x27aa('0x8c')][_0x27aa('0xb1')]:null,'referer':_0x147300[_0x27aa('0x5f')][_0x27aa('0xb2')],'browserName':_0x317797[_0x27aa('0xb3')][_0x27aa('0x3c')]&&_0x317797[_0x27aa('0xb3')][_0x27aa('0xb4')]?util[_0x27aa('0xb5')](_0x27aa('0xb6'),_0x317797[_0x27aa('0xb3')]['name'],_0x317797[_0x27aa('0xb3')][_0x27aa('0xb4')]):_0x27aa('0xb7'),'browserVersion':_0x317797[_0x27aa('0xb3')]['version']||'unknown','osName':util['format']('%s\x20%s',_0x317797['os'][_0x27aa('0x3c')],_0x317797['os']['version']),'osVersion':_0x317797['os']['version'],'deviceModel':_0x317797[_0x27aa('0xb8')][_0x27aa('0x47')]&&_0x317797[_0x27aa('0xb8')][_0x27aa('0xb9')]?util['format'](_0x27aa('0xba'),_0x317797[_0x27aa('0xb8')]['model'],_0x317797[_0x27aa('0xb8')][_0x27aa('0xb9')],_0x317797[_0x27aa('0xb8')][_0x27aa('0x45')]):null,'deviceVendor':_0x317797[_0x27aa('0xb8')][_0x27aa('0xb9')],'deviceType':_0x317797[_0x27aa('0xb8')][_0x27aa('0x45')],'formData':JSON[_0x27aa('0x24')](_0x147300[_0x27aa('0x5f')])};var _0x5e5972={'ChatWebsiteId':_0x147300[_0x27aa('0x5b')]['id'],'closed':![]};if(_0x147300[_0x27aa('0x5f')][_0x27aa('0xbb')]){_0x5e5972[_0x27aa('0xbb')]=_0x147300[_0x27aa('0x5f')][_0x27aa('0xbb')];return db[_0x27aa('0xbc')][_0x27aa('0x5d')]({'where':_0x5e5972})['then'](function(_0x43be0f){if(_0x43be0f){return[_0x43be0f,![]];}_0x5926fa['threadId']=_0x147300[_0x27aa('0x5f')][_0x27aa('0xbb')];_0x5926fa[_0x27aa('0xbd')]=_0x147300['body'][_0x27aa('0xbd')];return db[_0x27aa('0xbc')][_0x27aa('0x5e')](_0x5926fa)[_0x27aa('0x36')](function(_0x6ee442){return[_0x6ee442,!![]];});});}_0x5e5972['ContactId']=_0x23968d['id'];if(_0x147300[_0x27aa('0x5f')][_0x27aa('0xbe')]&&_0x147300[_0x27aa('0x5f')][_0x27aa('0xbe')]['id']){_0x5e5972['id']=_0x147300[_0x27aa('0x5f')][_0x27aa('0xbe')]['id'];return db[_0x27aa('0xbc')]['find']({'where':_0x5e5972})['then'](function(_0x1d1608){if(_0x1d1608){return[_0x1d1608,![]];}return db[_0x27aa('0xbc')][_0x27aa('0x5e')](_0x5926fa)['then'](function(_0x234d7a){return[_0x234d7a,!![]];});});}return db[_0x27aa('0xbc')][_0x27aa('0x5e')](_0x5926fa)[_0x27aa('0x36')](function(_0x5e290a){return[_0x5e290a,!![]];});}})[_0x27aa('0xbf')](function(_0xd37dbf,_0x4fbbf5){if(_0xd37dbf){_0x4f98a1=_0x4fbbf5;if(!_0x4fbbf5){var _0x2b081e={'from':(_0x1727ae['contact'][_0x27aa('0xaf')]||'')+'\x20'+(_0x1727ae[_0x27aa('0xab')][_0x27aa('0xb0')]||'')};if(_0x147300[_0x27aa('0x5f')]['threadId']&&_0x147300['body'][_0x27aa('0xc0')]&&_0x147300[_0x27aa('0x5f')][_0x27aa('0xbb')]!=_0x147300[_0x27aa('0x5f')][_0x27aa('0xc0')]){_0x2b081e['threadId']=_0x147300[_0x27aa('0x5f')][_0x27aa('0xc0')];}return _0xd37dbf['update'](_0x2b081e);}else{return _0xd37dbf;}}})[_0x27aa('0x36')](function(_0x32f7c1){_0x1727ae[_0x27aa('0xbe')]=_0x32f7c1['get']({'plain':!![]});_0x1727ae[_0x27aa('0xbe')][_0x27aa('0xc1')]=_0x4f98a1;if(_0x1727ae[_0x27aa('0xbe')]['created']){if(_0x1727ae['account'][_0x27aa('0xc2')]){_0x1727ae[_0x27aa('0xa4')][_0x27aa('0xc3')]({'id':0x0,'priority':_0x1727ae[_0x27aa('0xa4')][_0x27aa('0x4c')]+0x1,'app':'close','appdata':_0x27aa('0xc4'),'interval':_0x27aa('0xc5')});}}return db[_0x27aa('0xc6')][_0x27aa('0x5e')]({'body':_0x147300[_0x27aa('0x5f')][_0x27aa('0x5f')],'ChatWebsiteId':_0x147300['params']['id'],'ChatInteractionId':_0x32f7c1['id'],'direction':'in','ContactId':_0x1727ae[_0x27aa('0xab')]['id'],'AttachmentId':_0x147300[_0x27aa('0x5f')][_0x27aa('0xc7')]});})['then'](function(_0x138368){_0x1727ae[_0x27aa('0x26')]=_0x138368;if(_0x1727ae['interaction'][_0x27aa('0xc8')]){return db['User'][_0x27aa('0x5d')]({'attributes':['id','name'],'where':{'id':_0x1727ae[_0x27aa('0xbe')]['UserId']}})[_0x27aa('0x36')](function(_0x230730){if(_0x230730){_0x1727ae[_0x27aa('0xa4')][_0x27aa('0xc9')]({'id':0x0,'priority':0x0,'app':_0x27aa('0xca'),'appdata':_0x230730[_0x27aa('0x3c')]+','+(_0x1727ae[_0x27aa('0xaa')][_0x27aa('0xcb')]||0xa),'interval':'*,*,*,*'});_0x1727ae[_0x27aa('0xcc')]=!![];}return respondWithRpcPromise(_0x27aa('0xcd'),_0x27aa('0xce'),_0x1727ae);});}return respondWithRpcPromise(_0x27aa('0xcd'),_0x27aa('0xce'),_0x1727ae);})[_0x27aa('0x36')](function(_0xce1a51){respondWithRpcPromise(_0x27aa('0xcf'),_0x27aa('0xcf'),{'event':_0x27aa('0x89'),'message':_0xce1a51},client9002);return _0xce1a51;})[_0x27aa('0x36')](respondWithResult(_0x5bc55c,null))[_0x27aa('0x28')](handleError(_0x5bc55c,null));};exports[_0x27aa('0xd0')]=function(_0x4b51bf,_0x40d1df,_0x5ca027){var _0xcfd39b,_0x45f506,_0x149c5a;var _0x17381a=[];var _0x3b6844=[];var _0x525035={};var _0x5c9848=_0x4b51bf['files']||[];var _0x5609d5=[];var _0x25fa04;return db[_0x27aa('0x8f')]['describe']()['then'](function(_0xaa9d75){if(!_0xaa9d75){throw new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0x92'));}_0x3b6844=_[_0x27aa('0x93')](_[_0x27aa('0x5c')](_0xaa9d75),['createdAt',_0x27aa('0x95')]);_0x17381a=_[_0x27aa('0x93')](_[_0x27aa('0x5c')](_0xaa9d75),[_0x27aa('0x94'),_0x27aa('0x95'),_0x27aa('0x96'),'ListId']);if(_0x4b51bf[_0x27aa('0x5f')]['id']){delete _0x4b51bf[_0x27aa('0x5f')]['id'];}if(_['isNil'](_0x4b51bf[_0x27aa('0x5f')]['from'])){throw _0x40d1df[_0x27aa('0x2b')](0x1f4)[_0x27aa('0x3d')](new db['Sequelize']['ValidationError'](_0x27aa('0x99')));}if(_[_0x27aa('0x7d')](_0x4b51bf[_0x27aa('0x5f')]['body'])||_0x4b51bf[_0x27aa('0x5f')][_0x27aa('0x5f')]===''){throw _0x40d1df['status'](0x1f4)[_0x27aa('0x3d')](new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0x9a')));}if(_[_0x27aa('0x7d')](_0x4b51bf['body'][_0x27aa('0xd1')])){throw _0x40d1df[_0x27aa('0x2b')](0x1f4)['send'](new db['Sequelize'][(_0x27aa('0x91'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17381a));}if(!_[_0x27aa('0x9d')](_0x17381a,_0x4b51bf['body'][_0x27aa('0xd1')])){throw _0x40d1df[_0x27aa('0x2b')](0x1f4)[_0x27aa('0x3d')](new db[(_0x27aa('0x90'))][(_0x27aa('0x91'))](_0x27aa('0xd2')+_0x17381a));}_0x525035[_0x4b51bf[_0x27aa('0x5f')][_0x27aa('0xd1')]]=_0x4b51bf[_0x27aa('0x5f')][_0x27aa('0x98')];})['then'](function(){return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x4b51bf[_0x27aa('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x27aa('0xa6')},{'model':db[_0x27aa('0xd3')],'as':_0x27aa('0xd3')}]});})[_0x27aa('0x36')](handleEntityNotFound(_0x40d1df,null))['then'](function(_0x44d79d){if(_0x44d79d&&_0x44d79d['List']){_0x45f506=_0x44d79d;var _0x5edb0a=_[_0x27aa('0x1b')](_0x4b51bf[_0x27aa('0x5f')],{'firstName':_0x4b51bf[_0x27aa('0x5f')][_0x27aa('0x98')],'phone':_0x4b51bf['body'][_0x27aa('0x98')],'ListId':_0x44d79d[_0x27aa('0x97')]});_0x5edb0a[_0x4b51bf[_0x27aa('0x5f')][_0x27aa('0xd1')]]=_0x4b51bf[_0x27aa('0x5f')][_0x27aa('0x98')];return db['CmContact'][_0x27aa('0xd4')]({'where':_0x525035,'defaults':_0x5edb0a});}})[_0x27aa('0xbf')](function(_0x545cfe){if(_0x545cfe){_0x149c5a=_0x545cfe;var _0x5af8ae=fs[_0x27aa('0xd5')](path['join'](config[_0x27aa('0x80')],_0x27aa('0xd6')),_0x27aa('0xd7'));var _0x29d037=ejs[_0x27aa('0xd8')](_0x5af8ae,{'body':_[_0x27aa('0xd9')](_0x4b51bf[_0x27aa('0x5f')]['body']),'bodyTitle':_0x45f506[_0x27aa('0xda')]});return db['ChatOfflineMessage']['create']({'body':_0x29d037,'ContactId':_0x545cfe['id'],'ChatWebsiteId':_0x45f506['id']});}})[_0x27aa('0x36')](function(_0x310122){_0x25fa04=_0x310122;if(_0x5c9848[_0x27aa('0x4c')]){var _0x31f3b6=_0x5c9848[_0x27aa('0x41')](function(_0x5e8260){return{'name':_0x5e8260['originalname'],'basename':_0x5e8260[_0x27aa('0x72')],'type':_0x5e8260[_0x27aa('0xdb')],'ChatOfflineMessageId':_0x310122['id']};});_0x5609d5=_0x31f3b6[_0x27aa('0x41')](_0xf5f253=>{var _0x117125={'filename':_0xf5f253[_0x27aa('0x3c')],'path':path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0xdc'),_0x27aa('0xdd'),'attachments',_0x27aa('0xde'),_0xf5f253['basename'])};return _0x117125;});if(!_0x45f506['openNewInteraction']){return db[_0x27aa('0xdf')]['transaction'](function(_0x3378b2){return db[_0x27aa('0xe0')][_0x27aa('0xe1')](_0x31f3b6,{'transaction':_0x3378b2});});}}})[_0x27aa('0x36')](function(){if(_0x25fa04){_0xcfd39b=_0x25fa04;return db[_0x27aa('0xd3')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x27aa('0xe2')],'as':_0x27aa('0xe3'),'raw':!![]}]});}})[_0x27aa('0x36')](function(_0x5a5562){if(_0x5a5562&&_0x5a5562['Smtp']&&_0x45f506[_0x27aa('0xe4')]&&_0x45f506[_0x27aa('0xe5')]){var _0x527808={'tls':{'rejectUnauthorized':![]}};if(_0x5a5562[_0x27aa('0xe3')][_0x27aa('0xe6')]){_0x527808[_0x27aa('0xe6')]=_0x5a5562[_0x27aa('0xe3')]['service'];}else{_0x527808[_0x27aa('0xe7')]=_0x5a5562[_0x27aa('0xe3')]['host'];_0x527808[_0x27aa('0xe8')]=_0x5a5562[_0x27aa('0xe3')][_0x27aa('0xe8')];_0x527808[_0x27aa('0xe9')]=_0x5a5562[_0x27aa('0xe3')][_0x27aa('0xe9')];}if(_0x5a5562[_0x27aa('0xe3')][_0x27aa('0xea')]){_0x527808['auth']={'user':_0x5a5562[_0x27aa('0xe3')][_0x27aa('0x60')],'pass':_0x5a5562[_0x27aa('0xe3')][_0x27aa('0xeb')]};}return respondWithRpcPromise('SendMail',_0x27aa('0xec'),{'account':_0x527808,'message':{'from':util[_0x27aa('0xb5')](_0x27aa('0xed'),_0x5a5562[_0x27aa('0x3c')],_0x5a5562[_0x27aa('0xee')]||_0x5a5562[_0x27aa('0xe3')]['user']),'to':_0x45f506[_0x27aa('0xe5')],'subject':_0x45f506[_0x27aa('0xef')],'html':_0xcfd39b[_0x27aa('0x5f')],'attachments':_0x5609d5}},client9003)['then'](function(){return _0xcfd39b;})[_0x27aa('0x28')](function(_0x27789b){console['error'](_0x27789b);});}})[_0x27aa('0x36')](function(){if(_0x45f506&&_0x45f506['openNewInteraction']&&_0x45f506[_0x27aa('0xf0')]){var _0xaae44=[];if(_0x5c9848[_0x27aa('0x4c')]){_0xaae44=_0x5c9848['map'](function(_0x419aa0){return{'name':_0x419aa0[_0x27aa('0xf1')],'basename':_0x419aa0['filename'],'type':_0x419aa0['mimetype'],'ChatOfflineMessageId':_0x25fa04['id']};});}var _0x56cd92;if(!_['isNil'](_0x45f506[_0x27aa('0xf2')])){var _0x2e4148=_[_0x27aa('0x41')](_0x4b51bf[_0x27aa('0x5f')],function(_0x51ef14){return _0x51ef14;});var _0x30a7ee=_[_0x27aa('0xf3')](_0x2e4148)[0x0];var _0x1d4660=_[_0x27aa('0xf4')](_0x30a7ee,function(_0x1d2e20){return _0x1d2e20;});_0x56cd92=_0x1d4660[0x1][_0x45f506['subjectOffline']];}var _0x5df8eb={'from':_0x149c5a[_0x27aa('0xee')],'firstName':_0x149c5a[_0x27aa('0xaf')],'lastName':_0x149c5a[_0x27aa('0xb0')],'mapKey':_0x27aa('0xee'),'message':{'from':_0x149c5a[_0x27aa('0xee')],'to':_0x45f506[_0x27aa('0xd3')][_0x27aa('0xee')],'cc':'','subject':_[_0x27aa('0x7d')](_0x56cd92)?_0x45f506[_0x27aa('0xef')]:_0x56cd92,'messageId':'','sentAt':new Date(),'attach':_0xaae44[_0x27aa('0x4c')],'attachments':_0xaae44,'originChannel':'Chat','ChatWebsiteId':_0x45f506['id'],'ChatOfflineMessageId':_0xcfd39b['id'],'originTo':_0x45f506[_0x27aa('0xd3')][_0x27aa('0xee')]},'body':_0xcfd39b['body']};var _0x4df5e8={'account':{'id':_0x45f506[_0x27aa('0xf0')]},'body':_0x5df8eb,'log':_0x27aa('0xf5')};return respondWithRpcPromise(_0x27aa('0xf5'),_0x27aa('0xf6'),_0x4df5e8,client9001)[_0x27aa('0x36')](function(){return _0xcfd39b;})[_0x27aa('0x28')](function(_0x2db972){console[_0x27aa('0x25')](_0x2db972);});}return;})['then'](function(){if(_0xcfd39b){return _0xcfd39b;}})[_0x27aa('0x36')](respondWithResult(_0x40d1df,null))[_0x27aa('0x28')](function(_0x3cd310){console[_0x27aa('0x25')](_0x27aa('0x28'),_0x3cd310);for(var _0x10280b of _0x5c9848){var _0x289fa9=path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0xdc'),_0x27aa('0xdd'),_0x27aa('0xf7'),_0x27aa('0xde'),_0x10280b[_0x27aa('0x72')]);fs_extra[_0x27aa('0xf8')](_0x289fa9)[_0x27aa('0x28')](function(_0x356889){console[_0x27aa('0x25')](_0x27aa('0xf9'),_0x289fa9,_0x356889);});}});};exports[_0x27aa('0xfa')]=function(_0x5a4e57,_0x2b29d3,_0x10c8d0){return db[_0x27aa('0xbc')][_0x27aa('0x5d')]({'where':{'id':_0x5a4e57[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x2b29d3,null))[_0x27aa('0x36')](function(_0x40ad7e){if(_0x40ad7e){return _0x40ad7e[_0x27aa('0xfa')](_0x5a4e57['body']['ids'],_['omit'](_0x5a4e57['body'],[_0x27aa('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x2b29d3,null))[_0x27aa('0x28')](handleError(_0x2b29d3,null));};exports[_0x27aa('0xfb')]=function(_0xb7b22e,_0x3e0c63,_0x388075){var _0x54572d={'raw':![],'where':{}};var _0x26831b={};var _0x21cb28={'count':0x0,'rows':[]};return db[_0x27aa('0x42')][_0x27aa('0x69')]({'where':{'id':_0xb7b22e[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x3e0c63,null))['then'](function(_0x2de362){if(_0x2de362){_0x26831b[_0x27aa('0x47')]=_[_0x27aa('0x5c')](db[_0x27aa('0xbc')]['rawAttributes']);_0x26831b['query']=_[_0x27aa('0x5c')](_0xb7b22e['query']);_0x26831b['filters']=_[_0x27aa('0x4a')](_0x26831b[_0x27aa('0x47')],_0x26831b[_0x27aa('0x48')]);_0x54572d['attributes']=_[_0x27aa('0x4a')](_0x26831b['model'],qs[_0x27aa('0x4b')](_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x4b')]));_0x54572d[_0x27aa('0x49')]=_0x54572d[_0x27aa('0x49')][_0x27aa('0x4c')]?_0x54572d[_0x27aa('0x49')]:_0x26831b['model'];if(!_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x4d')](_0x27aa('0xfc'))){_0x54572d[_0x27aa('0x2f')]=qs[_0x27aa('0x2f')](_0xb7b22e[_0x27aa('0x48')]['limit']);_0x54572d[_0x27aa('0x2d')]=qs[_0x27aa('0x2d')](_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x2d')]);}_0x54572d['order']=qs['sort'](_0xb7b22e['query'][_0x27aa('0x4f')]);_0x54572d[_0x27aa('0x52')]=qs[_0x27aa('0x50')](_['pick'](_0xb7b22e[_0x27aa('0x48')],_0x26831b[_0x27aa('0x50')]));_0x54572d['where']['ChatWebsiteId']=_0x2de362['id'];if(_0xb7b22e['query']['filter']){_0x54572d['where']=_['merge'](_0x54572d['where'],{'$or':_[_0x27aa('0x41')](_0x54572d[_0x27aa('0x49')],function(_0x4b0259){var _0x26bc1e={};_0x26bc1e[_0x4b0259]={'$like':'%'+_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x6a')]+'%'};return _0x26bc1e;})});}_0x54572d=_[_0x27aa('0x53')]({},_0x54572d,_0xb7b22e[_0x27aa('0x55')]);return db[_0x27aa('0xbc')][_0x27aa('0x30')]({'where':_0x54572d[_0x27aa('0x52')]})['then'](function(_0x5239a2){_0x21cb28[_0x27aa('0x30')]=_0x5239a2;if(_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x56')]){_0x54572d['include']=[{'model':db[_0x27aa('0x8f')],'as':_0x27aa('0xfd'),'required':![]},{'model':db[_0x27aa('0xfe')],'as':_0x27aa('0xff'),'attributes':[_0x27aa('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x27aa('0x100')],'as':_0x27aa('0x101'),'attributes':['id',_0x27aa('0x3c'),_0x27aa('0x102')],'where':_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x103')]?{'id':_0xb7b22e[_0x27aa('0x48')]['tag']}:undefined,'required':_0xb7b22e[_0x27aa('0x48')][_0x27aa('0x103')]?!![]:![]}];}return db[_0x27aa('0xbc')][_0x27aa('0x58')](_0x54572d);})[_0x27aa('0x36')](function(_0xe2da9a){_0x21cb28[_0x27aa('0x59')]=_0xe2da9a;return _0x21cb28;});}})['then'](respondWithFilteredResult(_0x3e0c63,_0x54572d))[_0x27aa('0x28')](handleError(_0x3e0c63,null));};function iftimePromise(_0x289923,_0x653b42){return respondWithRpcPromise(_0x27aa('0x104'),_0x27aa('0x105'),{'command':_0x653b42[_0x27aa('0x106')]?util[_0x27aa('0xb5')]('iftime\x20%s,%s',_0x289923['interval'],_0x653b42[_0x27aa('0x106')]):util[_0x27aa('0xb5')](_0x27aa('0x107'),_0x289923[_0x27aa('0x108')])},client9002)[_0x27aa('0x36')](function(_0xd06576){var _0x2e311a=_0xd06576&&_0xd06576[_0x27aa('0x109')](_0x27aa('0x10a'))>=0x0?!![]:![];logger[_0x27aa('0x21')](_0x27aa('0x10b'),_0x653b42['id'],_0x289923['id'],_0x289923['interval'],_0x2e311a?_0x27aa('0x10c'):'OFFLINE',_0x653b42[_0x27aa('0x106')]?_0x653b42['timezone']:'No\x20timezone');return _0x2e311a;})[_0x27aa('0x28')](function(_0x18a377){logger[_0x27aa('0x25')](_0x27aa('0x10b'),_0x653b42['id'],_0x289923['id'],_0x289923[_0x27aa('0x108')],util[_0x27aa('0x10d')](_0x18a377,{'showHidden':![],'depth':null}),_0x653b42[_0x27aa('0x106')]?_0x653b42[_0x27aa('0x106')]:_0x27aa('0x10e'));return![];});}exports[_0x27aa('0x105')]=function(_0x5d0520,_0x7cc6e1,_0x1f7435){var _0x2cd954=0x0;var _0x4b9aa8=0x0;var _0x4fcfbb=![];var _0x4eebc0;var _0x339a4d;return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x5d0520[_0x27aa('0x5b')]['id']},'include':[{'model':db[_0x27aa('0x10f')],'as':_0x27aa('0x10f'),'include':[{'model':db[_0x27aa('0x10f')],'as':'Intervals','attributes':['id',_0x27aa('0x108')],'raw':!![]}]}]})[_0x27aa('0x36')](handleEntityNotFound(_0x7cc6e1,null))[_0x27aa('0x36')](function(_0x3b4fe5){if(_0x3b4fe5){_0x4eebc0=_0x3b4fe5;return _0x3b4fe5[_0x27aa('0x110')]({'raw':!![]});}})[_0x27aa('0x36')](function(_0x11504a){if(_0x4eebc0){if(_0x11504a){_0x339a4d=_0x11504a;}}return require(_0x27aa('0x1a'))['getLicense']();})['then'](function(_0x1f4e91){if(_0x1f4e91){_0x4b9aa8=_0x1f4e91['virtual'];_0x4fcfbb=_0x1f4e91[_0x27aa('0x7c')];}})[_0x27aa('0x36')](function(){return db[_0x27aa('0xbc')]['count']({'where':{'closed':![]}});})[_0x27aa('0x36')](function(_0x82d01d){_0x2cd954=_0x82d01d;if(_0x4b9aa8&&_0x82d01d>_0x4b9aa8){return db[_0x27aa('0x111')][_0x27aa('0x69')]({'where':{'id':0x1}})[_0x27aa('0x36')](function(_0x4dbec3){if(_0x4dbec3){_0x4dbec3[_0x27aa('0x112')](_0x27aa('0x113'));}});}})[_0x27aa('0x36')](function(){if(_0x4eebc0['Interval']&&_0x4eebc0[_0x27aa('0x10f')][_0x27aa('0x114')]){var _0x5220dc=[];for(var _0x37de5e=0x0;_0x37de5e<_0x4eebc0[_0x27aa('0x10f')][_0x27aa('0x114')][_0x27aa('0x4c')];_0x37de5e++){var _0x53e384=_0x4eebc0[_0x27aa('0x10f')][_0x27aa('0x114')][_0x37de5e][_0x27aa('0x38')]({'plain':!![]});_0x5220dc['push'](iftimePromise(_0x53e384,_0x4eebc0));}return BPromise[_0x27aa('0x115')](_0x5220dc)['then'](function(_0x4b822f){return _[_0x27aa('0x116')](_0x4b822f);});}else{return!![];}})['then'](function(_0x5c890c){var _0x2c4746=fs[_0x27aa('0xd5')](path[_0x27aa('0x7a')](config[_0x27aa('0x80')],_0x27aa('0x117')),_0x27aa('0xd7'));var _0x23c7d1={'remote':_0x4eebc0[_0x27aa('0x118')],'query':querystring[_0x27aa('0x24')](_['merge'](_0x4eebc0[_0x27aa('0x38')]({'plain':!![]}),{'customerIp':_0x5d0520[_0x27aa('0x8c')][_0x27aa('0xae')]||_0x5d0520['headers'][_0x27aa('0x119')]||_0x5d0520[_0x27aa('0x11a')]['remoteAddress']||_0x5d0520['ip'],'referer':_0x5d0520[_0x27aa('0x8c')][_0x27aa('0xb2')],'openedInteractions':_0x2cd954,'maxInteractions':_0x4b9aa8,'virtual':_0x4fcfbb[_0x27aa('0x11b')],'online':_0x5c890c,'custom':_0x4fcfbb}))[_0x27aa('0x11c')](/'/g,'\x5c\x27')};_0x7cc6e1[_0x27aa('0x3d')](ejs['render'](Mustache[_0x27aa('0xd8')](_0x2c4746,_0x23c7d1),{'proactiveActions':_0x339a4d,'alignment':_0x4eebc0[_0x27aa('0x11d')],'verticalAlignment':_0x4eebc0[_0x27aa('0x11e')],'div_color':_0x4eebc0['color'],'text_color':_0x4eebc0[_0x27aa('0x11f')],'button_color':_0x4eebc0[_0x27aa('0x120')],'background_color':_0x4eebc0[_0x27aa('0x121')]}));})[_0x27aa('0x28')](handleError(_0x7cc6e1,null));};exports['addApplications']=function(_0x43bceb,_0x124bba,_0x1af3ac){return db['ChatWebsite']['findOne']({'where':{'id':_0x43bceb[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x124bba,null))['then'](function(_0x8e5ea9){if(_0x8e5ea9){return db[_0x27aa('0xdf')][_0x27aa('0x122')](function(_0x3d8d56){return db[_0x27aa('0xa2')][_0x27aa('0x37')]({'where':{'ChatWebsiteId':_0x43bceb['params']['id']},'transaction':_0x3d8d56})['then'](function(_0x499df1){var _0x672484=_[_0x27aa('0x41')](_0x43bceb[_0x27aa('0x5f')],function(_0x3d47ce){_0x3d47ce[_0x27aa('0x66')]=_0x43bceb[_0x27aa('0x5b')]['id'];return _0x3d47ce;});return db[_0x27aa('0xa2')]['bulkCreate'](_0x672484,{'transaction':_0x3d8d56});});})[_0x27aa('0x36')](function(){return db[_0x27aa('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x43bceb[_0x27aa('0x5b')]['id']},'order':_0x27aa('0xa8')});});}})[_0x27aa('0x36')](respondWithResult(_0x124bba,null))[_0x27aa('0x28')](handleError(_0x124bba,null));};exports[_0x27aa('0x123')]=function(_0x59d747,_0x3ffabb,_0x2c480d){var _0x1b82c7={};var _0x98b9c7={};var _0x133169;var _0x188a32;return db[_0x27aa('0x42')][_0x27aa('0x69')]({'where':{'id':_0x59d747[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x3ffabb,null))[_0x27aa('0x36')](function(_0x3be650){if(_0x3be650){_0x133169=_0x3be650;_0x98b9c7[_0x27aa('0x47')]=_['keys'](db[_0x27aa('0xa2')]['rawAttributes']);_0x98b9c7[_0x27aa('0x48')]=_[_0x27aa('0x5c')](_0x59d747[_0x27aa('0x48')]);_0x98b9c7[_0x27aa('0x50')]=_[_0x27aa('0x4a')](_0x98b9c7[_0x27aa('0x47')],_0x98b9c7[_0x27aa('0x48')]);_0x1b82c7['attributes']=_[_0x27aa('0x4a')](_0x98b9c7['model'],qs[_0x27aa('0x4b')](_0x59d747[_0x27aa('0x48')]['fields']));_0x1b82c7[_0x27aa('0x49')]=_0x1b82c7['attributes'][_0x27aa('0x4c')]?_0x1b82c7[_0x27aa('0x49')]:_0x98b9c7[_0x27aa('0x47')];_0x1b82c7[_0x27aa('0x4e')]=qs[_0x27aa('0x4f')](_0x59d747[_0x27aa('0x48')][_0x27aa('0x4f')]);_0x1b82c7[_0x27aa('0x52')]=qs[_0x27aa('0x50')](_[_0x27aa('0x51')](_0x59d747[_0x27aa('0x48')],_0x98b9c7[_0x27aa('0x50')]));if(_0x59d747['query'][_0x27aa('0x6a')]){_0x1b82c7[_0x27aa('0x52')]=_[_0x27aa('0x53')](_0x1b82c7[_0x27aa('0x52')],{'$or':_[_0x27aa('0x41')](_0x1b82c7['attributes'],function(_0x91a159){var _0x15cae6={};_0x15cae6[_0x91a159]={'$like':'%'+_0x59d747[_0x27aa('0x48')][_0x27aa('0x6a')]+'%'};return _0x15cae6;})});}_0x1b82c7=_[_0x27aa('0x53')]({},_0x1b82c7,_0x59d747[_0x27aa('0x55')]);return _0x133169[_0x27aa('0x123')](_0x1b82c7);}})[_0x27aa('0x36')](function(_0x4aa905){if(_0x4aa905){_0x188a32=_0x4aa905['length'];if(!_0x59d747[_0x27aa('0x48')][_0x27aa('0x4d')](_0x27aa('0xfc'))){_0x1b82c7[_0x27aa('0x2f')]=qs[_0x27aa('0x2f')](_0x59d747[_0x27aa('0x48')]['limit']);_0x1b82c7[_0x27aa('0x2d')]=qs['offset'](_0x59d747[_0x27aa('0x48')]['offset']);}return _0x133169[_0x27aa('0x123')](_0x1b82c7);}})['then'](function(_0x475764){if(_0x475764){return _0x475764?{'count':_0x188a32,'rows':_0x475764}:null;}})[_0x27aa('0x36')](respondWithResult(_0x3ffabb,null))[_0x27aa('0x28')](handleError(_0x3ffabb,null));};exports[_0x27aa('0x124')]=function(_0x2c73ea,_0x56f1e6,_0x5caa44){return db[_0x27aa('0x125')]['find']({'where':{'id':_0x2c73ea[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x56f1e6,null))['then'](function(_0x634e3f){if(_0x634e3f){return _0x634e3f['addProactiveActions'](_0x2c73ea[_0x27aa('0x5f')]['ids'],_['omit'](_0x2c73ea[_0x27aa('0x5f')],[_0x27aa('0x6c'),'id'])||{});}})[_0x27aa('0x36')](respondWithResult(_0x56f1e6,null))[_0x27aa('0x28')](handleError(_0x56f1e6,null));};exports['getProactiveActions']=function(_0x27f6c2,_0x492428,_0x482381){var _0x4f04bc={};var _0x4c372c={};var _0x251ddc;var _0x144412;return db[_0x27aa('0x42')][_0x27aa('0x69')]({'where':{'id':_0x27f6c2['params']['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x492428,null))[_0x27aa('0x36')](function(_0x50bfe5){if(_0x50bfe5){_0x251ddc=_0x50bfe5;_0x4c372c[_0x27aa('0x47')]=_[_0x27aa('0x5c')](db['ChatProactiveAction'][_0x27aa('0x43')]);_0x4c372c[_0x27aa('0x48')]=_[_0x27aa('0x5c')](_0x27f6c2['query']);_0x4c372c[_0x27aa('0x50')]=_['intersection'](_0x4c372c[_0x27aa('0x47')],_0x4c372c[_0x27aa('0x48')]);_0x4f04bc[_0x27aa('0x49')]=_['intersection'](_0x4c372c[_0x27aa('0x47')],qs[_0x27aa('0x4b')](_0x27f6c2[_0x27aa('0x48')][_0x27aa('0x4b')]));_0x4f04bc[_0x27aa('0x49')]=_0x4f04bc['attributes'][_0x27aa('0x4c')]?_0x4f04bc['attributes']:_0x4c372c[_0x27aa('0x47')];_0x4f04bc[_0x27aa('0x4e')]=qs[_0x27aa('0x4f')](_0x27f6c2[_0x27aa('0x48')][_0x27aa('0x4f')]);_0x4f04bc[_0x27aa('0x52')]=qs[_0x27aa('0x50')](_[_0x27aa('0x51')](_0x27f6c2[_0x27aa('0x48')],_0x4c372c['filters']));if(_0x27f6c2['query']['filter']){_0x4f04bc[_0x27aa('0x52')]=_[_0x27aa('0x53')](_0x4f04bc[_0x27aa('0x52')],{'$or':_[_0x27aa('0x41')](_0x4f04bc[_0x27aa('0x49')],function(_0x1f24e8){var _0x1ce3fb={};_0x1ce3fb[_0x1f24e8]={'$like':'%'+_0x27f6c2[_0x27aa('0x48')][_0x27aa('0x6a')]+'%'};return _0x1ce3fb;})});}_0x4f04bc=_[_0x27aa('0x53')]({},_0x4f04bc,_0x27f6c2['options']);return _0x251ddc[_0x27aa('0x110')](_0x4f04bc);}})['then'](function(_0x4f2204){if(_0x4f2204){_0x144412=_0x4f2204[_0x27aa('0x4c')];if(!_0x27f6c2[_0x27aa('0x48')]['hasOwnProperty'](_0x27aa('0xfc'))){_0x4f04bc[_0x27aa('0x2f')]=qs[_0x27aa('0x2f')](_0x27f6c2[_0x27aa('0x48')][_0x27aa('0x2f')]);_0x4f04bc[_0x27aa('0x2d')]=qs[_0x27aa('0x2d')](_0x27f6c2[_0x27aa('0x48')][_0x27aa('0x2d')]);}return _0x251ddc[_0x27aa('0x110')](_0x4f04bc);}})[_0x27aa('0x36')](function(_0x3fb42e){if(_0x3fb42e){return _0x3fb42e?{'count':_0x144412,'rows':_0x3fb42e}:null;}})[_0x27aa('0x36')](respondWithResult(_0x492428,null))['catch'](handleError(_0x492428,null));};exports['getFields']=function(_0x26667d,_0x5ba8a7,_0x3a9288){var _0x495699=_0x26667d[_0x27aa('0x48')][_0x27aa('0x126')]===_0x27aa('0x127')?_0x27aa('0x128'):'onlineForm';return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'attributes':['id',_0x495699],'where':{'id':_0x26667d[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x5ba8a7,null))[_0x27aa('0x36')](function(_0x506f94){if(_0x506f94){var _0x3a1934=_0x506f94[_0x495699];var _0x448e30=_0x3a1934&&_0x3a1934[_0x27aa('0x129')]?_0x3a1934['items']:[];_0x5ba8a7[_0x27aa('0x3d')]({'fromKey':_[_0x27aa('0x7d')](_0x3a1934[_0x27aa('0x12a')])?undefined:_0x3a1934['fromKey'],'count':_0x448e30[_0x27aa('0x4c')],'rows':_0x448e30});}})[_0x27aa('0x28')](handleError(_0x5ba8a7,null));};exports['getOfflineMessages']=function(_0x4945e9,_0x400fa8,_0x428cb4){var _0x2592e8={'raw':![],'where':{}};var _0x4a2cb6={};var _0x5887d0={'count':0x0,'rows':[]};return db[_0x27aa('0x42')][_0x27aa('0x69')]({'where':{'id':_0x4945e9['params']['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x400fa8,null))[_0x27aa('0x36')](function(_0x51b1a6){if(_0x51b1a6){_0x4a2cb6[_0x27aa('0x47')]=_[_0x27aa('0x5c')](db['ChatOfflineMessage'][_0x27aa('0x43')]);_0x4a2cb6['query']=_[_0x27aa('0x5c')](_0x4945e9['query']);_0x4a2cb6[_0x27aa('0x50')]=_[_0x27aa('0x4a')](_0x4a2cb6[_0x27aa('0x47')],_0x4a2cb6[_0x27aa('0x48')]);_0x2592e8[_0x27aa('0x49')]=_[_0x27aa('0x4a')](_0x4a2cb6['model'],qs[_0x27aa('0x4b')](_0x4945e9[_0x27aa('0x48')][_0x27aa('0x4b')]));_0x2592e8[_0x27aa('0x49')]=_0x2592e8[_0x27aa('0x49')]['length']?_0x2592e8[_0x27aa('0x49')]:_0x4a2cb6[_0x27aa('0x47')];if(!_0x4945e9[_0x27aa('0x48')][_0x27aa('0x4d')](_0x27aa('0xfc'))){_0x2592e8['limit']=qs['limit'](_0x4945e9[_0x27aa('0x48')]['limit']);_0x2592e8['offset']=qs['offset'](_0x4945e9['query'][_0x27aa('0x2d')]);}_0x2592e8[_0x27aa('0x4e')]=qs[_0x27aa('0x4f')](_0x4945e9[_0x27aa('0x48')]['sort']);_0x2592e8[_0x27aa('0x52')]=qs[_0x27aa('0x50')](_[_0x27aa('0x51')](_0x4945e9['query'],_0x4a2cb6[_0x27aa('0x50')]));_0x2592e8['where'][_0x27aa('0x66')]=_0x51b1a6['id'];if(_0x4945e9[_0x27aa('0x48')][_0x27aa('0x6a')]){_0x2592e8[_0x27aa('0x52')]=_['merge'](_0x2592e8[_0x27aa('0x52')],{'$or':_[_0x27aa('0x41')](_0x2592e8[_0x27aa('0x49')],function(_0x414db5){var _0x418712={};_0x418712[_0x414db5]={'$like':'%'+_0x4945e9[_0x27aa('0x48')][_0x27aa('0x6a')]+'%'};return _0x418712;})});}_0x2592e8=_['merge']({},_0x2592e8,_0x4945e9[_0x27aa('0x55')]);return db[_0x27aa('0x12b')][_0x27aa('0x30')]({'where':_0x2592e8[_0x27aa('0x52')]})[_0x27aa('0x36')](function(_0x212dfb){_0x5887d0['count']=_0x212dfb;if(_0x4945e9[_0x27aa('0x48')][_0x27aa('0x56')]){_0x2592e8[_0x27aa('0x57')]=[{'all':!![]}];}else{_0x2592e8[_0x27aa('0x57')]=[{'model':db['CmContact'],'as':_0x27aa('0xfd'),'required':![]},{'model':db[_0x27aa('0xe0')],'as':_0x27aa('0x12c'),'required':![]}];}return db[_0x27aa('0x12b')][_0x27aa('0x58')](_0x2592e8);})[_0x27aa('0x36')](function(_0x35eb61){_0x5887d0[_0x27aa('0x59')]=_0x35eb61;return _0x5887d0;});}})[_0x27aa('0x36')](respondWithFilteredResult(_0x400fa8,_0x2592e8))[_0x27aa('0x28')](handleError(_0x400fa8,null));};exports[_0x27aa('0x12d')]=function(_0x556f50,_0x356162,_0x49cae5){return db['ChatWebsite'][_0x27aa('0x5d')]({'where':{'id':_0x556f50[_0x27aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x356162,null))[_0x27aa('0x36')](function(_0x2fa01f){if(_0x2fa01f){return _0x2fa01f[_0x27aa('0x12d')](_0x556f50[_0x27aa('0x5f')][_0x27aa('0x6c')],_[_0x27aa('0x12e')](_0x556f50[_0x27aa('0x5f')],[_0x27aa('0x6c'),'id'])||{})[_0x27aa('0xbf')](function(_0x3f24cb){for(var _0x195ede=0x0;_0x195ede<_0x556f50[_0x27aa('0x5f')][_0x27aa('0x6c')]['length'];_0x195ede+=0x1){socket[_0x27aa('0x12f')](_0x27aa('0x130'),{'UserId':_0x556f50['body']['ids'][_0x195ede],'ChatWebsiteId':_0x556f50[_0x27aa('0x5b')]['id']});}return _0x3f24cb;});}})[_0x27aa('0x36')](respondWithResult(_0x356162,null))[_0x27aa('0x28')](handleError(_0x356162,null));};exports[_0x27aa('0x131')]=function(_0x4f06bb,_0x534763,_0x4cf9f9){return db[_0x27aa('0x42')][_0x27aa('0x5d')]({'where':{'id':_0x4f06bb[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x534763,null))[_0x27aa('0x36')](function(_0x4ffb57){if(_0x4ffb57){return _0x4ffb57['removeAgents'](_0x4f06bb['query'][_0x27aa('0x6c')])[_0x27aa('0x36')](function(){if(_[_0x27aa('0x132')](_0x4f06bb['query']['ids'])){for(var _0x5beb1e=0x0;_0x5beb1e<_0x4f06bb[_0x27aa('0x48')]['ids'][_0x27aa('0x4c')];_0x5beb1e+=0x1){socket[_0x27aa('0x12f')](_0x27aa('0x133'),{'UserId':Number(_0x4f06bb[_0x27aa('0x48')][_0x27aa('0x6c')][_0x5beb1e]),'ChatWebsiteId':Number(_0x4f06bb[_0x27aa('0x5b')]['id'])});}}else{socket[_0x27aa('0x12f')](_0x27aa('0x133'),{'UserId':Number(_0x4f06bb[_0x27aa('0x48')][_0x27aa('0x6c')]),'ChatWebsiteId':Number(_0x4f06bb[_0x27aa('0x5b')]['id'])});}});}})[_0x27aa('0x36')](respondWithStatusCode(_0x534763,null))[_0x27aa('0x28')](handleError(_0x534763,null));};exports[_0x27aa('0x134')]=function(_0x3d5e53,_0x561f4e,_0x35b707){var _0x2bd416={};var _0x2bec1b={};var _0xea4f34;var _0xc2ebf4;return db[_0x27aa('0x42')][_0x27aa('0x69')]({'where':{'id':_0x3d5e53[_0x27aa('0x5b')]['id']}})[_0x27aa('0x36')](handleEntityNotFound(_0x561f4e,null))[_0x27aa('0x36')](function(_0x7df715){if(_0x7df715){_0xea4f34=_0x7df715;_0x2bec1b['model']=_[_0x27aa('0x5c')](db[_0x27aa('0xfe')]['rawAttributes']);_0x2bec1b[_0x27aa('0x48')]=_[_0x27aa('0x5c')](_0x3d5e53[_0x27aa('0x48')]);_0x2bec1b[_0x27aa('0x50')]=_[_0x27aa('0x4a')](_0x2bec1b['model'],_0x2bec1b['query']);_0x2bd416[_0x27aa('0x49')]=_[_0x27aa('0x4a')](_0x2bec1b[_0x27aa('0x47')],qs[_0x27aa('0x4b')](_0x3d5e53['query'][_0x27aa('0x4b')]));_0x2bd416[_0x27aa('0x49')]=_0x2bd416['attributes'][_0x27aa('0x4c')]?_0x2bd416['attributes']:_0x2bec1b['model'];_0x2bd416['order']=qs['sort'](_0x3d5e53['query'][_0x27aa('0x4f')]);_0x2bd416[_0x27aa('0x52')]=qs[_0x27aa('0x50')](_[_0x27aa('0x51')](_0x3d5e53[_0x27aa('0x48')],_0x2bec1b[_0x27aa('0x50')]));if(_0x3d5e53[_0x27aa('0x48')][_0x27aa('0x6a')]){_0x2bd416['where']=_[_0x27aa('0x53')](_0x2bd416[_0x27aa('0x52')],{'$or':_['map'](_0x2bd416[_0x27aa('0x49')],function(_0x5ed33d){var _0x4cdcac={};_0x4cdcac[_0x5ed33d]={'$like':'%'+_0x3d5e53[_0x27aa('0x48')]['filter']+'%'};return _0x4cdcac;})});}_0x2bd416=_['merge']({},_0x2bd416,_0x3d5e53[_0x27aa('0x55')]);return _0xea4f34[_0x27aa('0x134')](_0x2bd416);}})['then'](function(_0x5a1004){if(_0x5a1004){_0xc2ebf4=_0x5a1004[_0x27aa('0x4c')];if(!_0x3d5e53[_0x27aa('0x48')][_0x27aa('0x4d')](_0x27aa('0xfc'))){_0x2bd416['limit']=qs[_0x27aa('0x2f')](_0x3d5e53[_0x27aa('0x48')][_0x27aa('0x2f')]);_0x2bd416['offset']=qs[_0x27aa('0x2d')](_0x3d5e53[_0x27aa('0x48')][_0x27aa('0x2d')]);}return _0xea4f34[_0x27aa('0x134')](_0x2bd416);}})[_0x27aa('0x36')](function(_0x40a13a){if(_0x40a13a){return _0x40a13a?{'count':_0xc2ebf4,'rows':_0x40a13a}:null;}})[_0x27aa('0x36')](respondWithResult(_0x561f4e,null))[_0x27aa('0x28')](handleError(_0x561f4e,null));};
\ No newline at end of file
+var _0x6f7e=['findAll','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','getLicense','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','ChatApplication','Applications','account','list','applications','orderBy','priority','Contacts','contact','customerIp','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','lastName','messageId','created','autoclose','push','unmanaged','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','offline-chat','basename','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','service','host','port','secure','auth','pass','SendMail','offlineMessageSubject','openNewInteraction','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','server','attachments','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatWebsite,\x20%s,\x20%s','info','result','sendStatus','end','limit','undefined','offset','count','status','set','Content-Range','json','apply','reject','save','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','ChatWebsite','includeAll','include'];(function(_0x44ab54,_0x1c075e){var _0x55d614=function(_0x72563a){while(--_0x72563a){_0x44ab54['push'](_0x44ab54['shift']());}};_0x55d614(++_0x1c075e);}(_0x6f7e,0xd7));var _0xe6f7=function(_0x487ef1,_0x54ef95){_0x487ef1=_0x487ef1-0x0;var _0x8dce76=_0x6f7e[_0x487ef1];return _0x8dce76;};'use strict';var emlformat=require(_0xe6f7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe6f7('0x1'));var rp=require(_0xe6f7('0x2'));var moment=require(_0xe6f7('0x3'));var BPromise=require(_0xe6f7('0x4'));var Mustache=require('mustache');var util=require(_0xe6f7('0x5'));var path=require(_0xe6f7('0x6'));var sox=require(_0xe6f7('0x7'));var csv=require(_0xe6f7('0x8'));var ejs=require(_0xe6f7('0x9'));var fs=require('fs');var fs_extra=require(_0xe6f7('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe6f7('0xb'));var jsforce=require(_0xe6f7('0xc'));var deskjs=require(_0xe6f7('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6f7('0xe'));var Redis=require(_0xe6f7('0xf'));var authService=require(_0xe6f7('0x10'));var qs=require(_0xe6f7('0x11'));var as=require(_0xe6f7('0x12'));var hardwareService=require(_0xe6f7('0x13'));var logger=require(_0xe6f7('0x14'))(_0xe6f7('0x15'));var utils=require(_0xe6f7('0x16'));var config=require(_0xe6f7('0x17'));var licenseUtil=require(_0xe6f7('0x18'));var db=require('../../mysqldb')['db'];config[_0xe6f7('0x19')]=_[_0xe6f7('0x1a')](config[_0xe6f7('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe6f7('0x1b'))(new Redis(config[_0xe6f7('0x19')]));require(_0xe6f7('0x1c'))[_0xe6f7('0x1d')](socket);var jayson=require(_0xe6f7('0x1e'));var client=jayson[_0xe6f7('0x1f')][_0xe6f7('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xe6f7('0x1f')][_0xe6f7('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x190c43,_0x2d9803,_0x14d722,_0x2e283d){return new BPromise(function(_0x47620d,_0x4bf88){var _0x52b065=_0x2e283d||client;return _0x52b065[_0xe6f7('0x21')](_0x190c43,_0x14d722)['then'](function(_0x515e97){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2d9803,'request\x20sent');logger[_0xe6f7('0x22')](_0xe6f7('0x23'),_0x2d9803,_0xe6f7('0x24'),JSON[_0xe6f7('0x25')](_0x515e97));if(_0x515e97[_0xe6f7('0x26')]){if(_0x515e97['error']['code']===0x1f4){logger[_0xe6f7('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x2d9803,_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);return _0x4bf88(_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);}logger[_0xe6f7('0x26')](_0xe6f7('0x28'),_0x2d9803,_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);return _0x47620d(_0x515e97[_0xe6f7('0x26')][_0xe6f7('0x27')]);}else{logger[_0xe6f7('0x29')](_0xe6f7('0x28'),_0x2d9803,_0xe6f7('0x24'));_0x47620d(_0x515e97[_0xe6f7('0x2a')]['message']);}})['catch'](function(_0x34aa45){logger[_0xe6f7('0x26')](_0xe6f7('0x28'),_0x2d9803,_0x34aa45);_0x4bf88(_0x34aa45);});});}function respondWithStatusCode(_0x2115bd,_0x13ee2a){_0x13ee2a=_0x13ee2a||0xcc;return function(_0x5a7cf5){if(_0x5a7cf5){return _0x2115bd[_0xe6f7('0x2b')](_0x13ee2a);}return _0x2115bd['status'](_0x13ee2a)[_0xe6f7('0x2c')]();};}function respondWithResult(_0x4cc94e,_0x443e25){_0x443e25=_0x443e25||0xc8;return function(_0x2d1de6){if(_0x2d1de6){return _0x4cc94e['status'](_0x443e25)['json'](_0x2d1de6);}};}function respondWithFilteredResult(_0x22b933,_0x128715){return function(_0x8b5c2f){if(_0x8b5c2f){var _0x2e3732=typeof _0x128715['offset']==='undefined'&&typeof _0x128715[_0xe6f7('0x2d')]===_0xe6f7('0x2e');var _0x584c4a=_0x8b5c2f['count'];var _0x521c43=_0x2e3732?0x0:_0x128715[_0xe6f7('0x2f')];var _0x4a9d5f=_0x2e3732?_0x8b5c2f[_0xe6f7('0x30')]:_0x128715[_0xe6f7('0x2f')]+_0x128715[_0xe6f7('0x2d')];var _0x5edc1b;if(_0x4a9d5f>=_0x584c4a){_0x4a9d5f=_0x584c4a;_0x5edc1b=0xc8;}else{_0x5edc1b=0xce;}_0x22b933[_0xe6f7('0x31')](_0x5edc1b);return _0x22b933[_0xe6f7('0x32')](_0xe6f7('0x33'),_0x521c43+'-'+_0x4a9d5f+'/'+_0x584c4a)[_0xe6f7('0x34')](_0x8b5c2f);}return null;};}function patchUpdates(_0x2a388e){return function(_0xcaa16c){try{jsonpatch[_0xe6f7('0x35')](_0xcaa16c,_0x2a388e,!![]);}catch(_0x350bde){return BPromise[_0xe6f7('0x36')](_0x350bde);}return _0xcaa16c[_0xe6f7('0x37')]();};}function saveUpdates(_0x51baf2,_0x36c49b){return function(_0xc270ab){if(_0xc270ab){return _0xc270ab['update'](_0x51baf2)[_0xe6f7('0x38')](function(_0xf1e143){return _0xf1e143;});}return null;};}function removeEntity(_0x35fe08,_0x5800ad){return function(_0x304504){if(_0x304504){return _0x304504[_0xe6f7('0x39')]()[_0xe6f7('0x38')](function(){var _0x2679c7=_0x304504[_0xe6f7('0x3a')]({'plain':!![]});var _0x5e5d5c=_0xe6f7('0x3b');return db[_0xe6f7('0x3c')][_0xe6f7('0x39')]({'where':{'type':_0x5e5d5c,'resourceId':_0x2679c7['id']}})['then'](function(){return _0x304504;});})['then'](function(){_0x35fe08[_0xe6f7('0x31')](0xcc)[_0xe6f7('0x2c')]();});}};}function handleEntityNotFound(_0x1537ae,_0x2d91b3){return function(_0x21dabe){if(!_0x21dabe){_0x1537ae[_0xe6f7('0x2b')](0x194);}return _0x21dabe;};}function handleError(_0x494f1a,_0x435ef0){_0x435ef0=_0x435ef0||0x1f4;return function(_0x27ad64){logger[_0xe6f7('0x26')](_0x27ad64[_0xe6f7('0x3d')]);if(_0x27ad64[_0xe6f7('0x3e')]){delete _0x27ad64[_0xe6f7('0x3e')];}_0x494f1a['status'](_0x435ef0)[_0xe6f7('0x3f')](_0x27ad64);};}exports['index']=function(_0x4b0e15,_0x55af19){var _0x5e7726={'include':[{'model':db['Pause'],'as':_0xe6f7('0x40')}]},_0x50e55e={},_0x220a60={'count':0x0,'rows':[]};var _0x394a32=_[_0xe6f7('0x41')](db['ChatWebsite'][_0xe6f7('0x42')],function(_0x3b009a){return{'name':_0x3b009a[_0xe6f7('0x43')],'type':_0x3b009a[_0xe6f7('0x44')]['key']};});_0x50e55e[_0xe6f7('0x45')]=_[_0xe6f7('0x41')](_0x394a32,'name');_0x50e55e[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x4b0e15[_0xe6f7('0x46')]);_0x50e55e['filters']=_[_0xe6f7('0x48')](_0x50e55e[_0xe6f7('0x45')],_0x50e55e['query']);_0x5e7726[_0xe6f7('0x49')]=_['intersection'](_0x50e55e[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x4b0e15['query'][_0xe6f7('0x4a')]));_0x5e7726[_0xe6f7('0x49')]=_0x5e7726['attributes']['length']?_0x5e7726[_0xe6f7('0x49')]:_0x50e55e[_0xe6f7('0x45')];if(!_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x4b')](_0xe6f7('0x4c'))){_0x5e7726['limit']=qs[_0xe6f7('0x2d')](_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x2d')]);_0x5e7726[_0xe6f7('0x2f')]=qs[_0xe6f7('0x2f')](_0x4b0e15['query']['offset']);}_0x5e7726[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x5e7726[_0xe6f7('0x4f')]=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x4b0e15['query'],_0x50e55e[_0xe6f7('0x50')]),_0x394a32);if(_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x5e7726[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x5e7726[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x394a32,function(_0x47843f){if(_0x47843f['type']!=='VIRTUAL'){var _0x39cc5d={};_0x39cc5d[_0x47843f[_0xe6f7('0x3e')]]={'$like':'%'+_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x52')]+'%'};return _0x39cc5d;}})});}_0x5e7726=_[_0xe6f7('0x53')]({},_0x5e7726,_0x4b0e15[_0xe6f7('0x54')]);var _0x54aff5={'where':_0x5e7726[_0xe6f7('0x4f')]};return db[_0xe6f7('0x55')][_0xe6f7('0x30')](_0x54aff5)[_0xe6f7('0x38')](function(_0x2dd75){_0x220a60[_0xe6f7('0x30')]=_0x2dd75;if(_0x4b0e15[_0xe6f7('0x46')][_0xe6f7('0x56')]){_0x5e7726[_0xe6f7('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0xe6f7('0x58')](_0x5e7726);})[_0xe6f7('0x38')](function(_0x5a9999){_0x220a60[_0xe6f7('0x59')]=_0x5a9999;return _0x220a60;})[_0xe6f7('0x38')](respondWithFilteredResult(_0x55af19,_0x5e7726))[_0xe6f7('0x5a')](handleError(_0x55af19,null));};exports[_0xe6f7('0x5b')]=function(_0x35716a,_0x1189fb){var _0x4c7f77={'raw':![],'where':{'id':_0x35716a[_0xe6f7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xe6f7('0x40')}]},_0x50aff3={};_0x50aff3[_0xe6f7('0x45')]=_[_0xe6f7('0x47')](db[_0xe6f7('0x55')][_0xe6f7('0x42')]);_0x50aff3['query']=_['keys'](_0x35716a[_0xe6f7('0x46')]);_0x50aff3[_0xe6f7('0x50')]=_['intersection'](_0x50aff3[_0xe6f7('0x45')],_0x50aff3[_0xe6f7('0x46')]);_0x4c7f77[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x50aff3['model'],qs[_0xe6f7('0x4a')](_0x35716a[_0xe6f7('0x46')][_0xe6f7('0x4a')]));_0x4c7f77[_0xe6f7('0x49')]=_0x4c7f77[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x4c7f77[_0xe6f7('0x49')]:_0x50aff3[_0xe6f7('0x45')];if(_0x35716a[_0xe6f7('0x46')][_0xe6f7('0x56')]){_0x4c7f77[_0xe6f7('0x57')]=[{'all':!![]}];}_0x4c7f77=_['merge']({},_0x4c7f77,_0x35716a[_0xe6f7('0x54')]);return db[_0xe6f7('0x55')]['find'](_0x4c7f77)[_0xe6f7('0x38')](handleEntityNotFound(_0x1189fb,null))['then'](respondWithResult(_0x1189fb,null))[_0xe6f7('0x5a')](handleError(_0x1189fb,null));};exports[_0xe6f7('0x5e')]=function(_0xe794e5,_0x3678ec){return db['ChatWebsite'][_0xe6f7('0x5e')](_0xe794e5[_0xe6f7('0x5f')],{})[_0xe6f7('0x38')](function(_0x5208f2){var _0x26b4cb=_0xe794e5[_0xe6f7('0x60')][_0xe6f7('0x3a')]({'plain':!![]});if(!_0x26b4cb)throw new Error(_0xe6f7('0x61'));if(_0x26b4cb['role']==='user'){var _0x29ffd9=_0x5208f2[_0xe6f7('0x3a')]({'plain':!![]});var _0x5c358d=_0xe6f7('0x3b');return db[_0xe6f7('0x62')]['find']({'where':{'name':_0x5c358d,'userProfileId':_0x26b4cb[_0xe6f7('0x63')]},'raw':!![]})[_0xe6f7('0x38')](function(_0x3146e6){if(_0x3146e6&&_0x3146e6[_0xe6f7('0x64')]===0x0){return db[_0xe6f7('0x3c')][_0xe6f7('0x5e')]({'name':_0x29ffd9['name'],'resourceId':_0x29ffd9['id'],'type':_0x3146e6[_0xe6f7('0x3e')],'sectionId':_0x3146e6['id']},{})[_0xe6f7('0x38')](function(){return _0x5208f2;});}else{return _0x5208f2;}})['catch'](function(_0x305602){logger[_0xe6f7('0x26')](_0xe6f7('0x65'),_0x305602);throw _0x305602;});}return _0x5208f2;})[_0xe6f7('0x38')](respondWithResult(_0x3678ec,0xc9))['catch'](handleError(_0x3678ec,null));};exports[_0xe6f7('0x66')]=function(_0x3c8116,_0x4d29e2){if(_0x3c8116[_0xe6f7('0x5f')]['id']){delete _0x3c8116['body']['id'];}return db['ChatWebsite'][_0xe6f7('0x67')]({'where':{'id':_0x3c8116[_0xe6f7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xe6f7('0x40')}]})[_0xe6f7('0x38')](handleEntityNotFound(_0x4d29e2,null))['then'](saveUpdates(_0x3c8116[_0xe6f7('0x5f')],null))['then'](respondWithResult(_0x4d29e2,null))[_0xe6f7('0x5a')](handleError(_0x4d29e2,null));};exports['destroy']=function(_0x5355cb,_0x198995){return db[_0xe6f7('0x55')]['find']({'where':{'id':_0x5355cb['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x198995,null))[_0xe6f7('0x38')](removeEntity(_0x198995,null))[_0xe6f7('0x5a')](handleError(_0x198995,null));};exports[_0xe6f7('0x68')]=function(_0x2b56f5,_0x250f00){return db[_0xe6f7('0x55')][_0xe6f7('0x68')]()['then'](respondWithResult(_0x250f00,null))[_0xe6f7('0x5a')](handleError(_0x250f00,null));};exports['addDisposition']=function(_0x154b0c,_0x177d4e,_0x23452f){if(_0x154b0c[_0xe6f7('0x5f')]['id']){delete _0x154b0c[_0xe6f7('0x5f')]['id'];}return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x154b0c[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x177d4e,null))['then'](function(_0x37b7a2){if(_0x37b7a2){_0x154b0c[_0xe6f7('0x5f')][_0xe6f7('0x69')]=_0x37b7a2['id'];return db[_0xe6f7('0x6a')]['create'](_0x154b0c[_0xe6f7('0x5f')]);}})['then'](respondWithResult(_0x177d4e,null))[_0xe6f7('0x5a')](handleError(_0x177d4e,null));};exports[_0xe6f7('0x6b')]=function(_0x1c502a,_0x296961,_0x4e1876){var _0x19b374={'raw':![],'where':{}};var _0x43571d={};var _0x31f384={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x1c502a[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x296961,null))[_0xe6f7('0x38')](function(_0x57554e){if(_0x57554e){_0x43571d['model']=_[_0xe6f7('0x47')](db[_0xe6f7('0x6a')]['rawAttributes']);_0x43571d['query']=_[_0xe6f7('0x47')](_0x1c502a[_0xe6f7('0x46')]);_0x43571d['filters']=_['intersection'](_0x43571d[_0xe6f7('0x45')],_0x43571d[_0xe6f7('0x46')]);_0x19b374[_0xe6f7('0x49')]=_['intersection'](_0x43571d['model'],qs['fields'](_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x4a')]));_0x19b374[_0xe6f7('0x49')]=_0x19b374[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x19b374[_0xe6f7('0x49')]:_0x43571d[_0xe6f7('0x45')];if(!_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x19b374[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x2d')]);_0x19b374['offset']=qs[_0xe6f7('0x2f')](_0x1c502a[_0xe6f7('0x46')]['offset']);}_0x19b374[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x1c502a[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x19b374['where']=qs['filters'](_['pick'](_0x1c502a[_0xe6f7('0x46')],_0x43571d['filters']));_0x19b374[_0xe6f7('0x4f')]['ChatWebsiteId']=_0x57554e['id'];if(_0x1c502a['query']['filter']){_0x19b374[_0xe6f7('0x4f')]=_['merge'](_0x19b374[_0xe6f7('0x4f')],{'$or':_['map'](_0x19b374['attributes'],function(_0x30f1bc){var _0x4bd625={};_0x4bd625[_0x30f1bc]={'$like':'%'+_0x1c502a['query'][_0xe6f7('0x52')]+'%'};return _0x4bd625;})});}_0x19b374=_[_0xe6f7('0x53')]({},_0x19b374,_0x1c502a[_0xe6f7('0x54')]);return db[_0xe6f7('0x6a')][_0xe6f7('0x30')]({'where':_0x19b374[_0xe6f7('0x4f')]})[_0xe6f7('0x38')](function(_0x57f26f){_0x31f384[_0xe6f7('0x30')]=_0x57f26f;if(_0x1c502a[_0xe6f7('0x46')]['includeAll']){_0x19b374[_0xe6f7('0x57')]=[{'all':!![]}];}return db[_0xe6f7('0x6a')][_0xe6f7('0x58')](_0x19b374);})[_0xe6f7('0x38')](function(_0xad9f99){_0x31f384[_0xe6f7('0x59')]=_0xad9f99;return _0x31f384;});}})['then'](respondWithFilteredResult(_0x296961,_0x19b374))[_0xe6f7('0x5a')](handleError(_0x296961,null));};exports[_0xe6f7('0x6d')]=function(_0x306f82,_0x2f978e,_0x1331cf){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x306f82[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x2f978e,null))[_0xe6f7('0x38')](function(_0x3ab648){if(_0x3ab648){return _0x3ab648[_0xe6f7('0x6d')](_0x306f82[_0xe6f7('0x46')][_0xe6f7('0x6e')]);}})[_0xe6f7('0x38')](respondWithStatusCode(_0x2f978e,null))[_0xe6f7('0x5a')](handleError(_0x2f978e,null));};exports[_0xe6f7('0x6f')]=function(_0x5296f8,_0x329568,_0x44bedc){if(_0x5296f8[_0xe6f7('0x5f')]['id']){delete _0x5296f8[_0xe6f7('0x5f')]['id'];}return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x5296f8[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x329568,null))[_0xe6f7('0x38')](function(_0xd0720a){if(_0xd0720a){_0x5296f8[_0xe6f7('0x5f')][_0xe6f7('0x69')]=_0xd0720a['id'];return db[_0xe6f7('0x70')][_0xe6f7('0x5e')](_0x5296f8['body']);}})[_0xe6f7('0x38')](respondWithResult(_0x329568,null))[_0xe6f7('0x5a')](handleError(_0x329568,null));};exports[_0xe6f7('0x71')]=function(_0x511229,_0x3ceaaf,_0x3d3129){var _0x3f3853={'raw':![],'where':{}};var _0x43440d={};var _0x4c9e44={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x511229[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x3ceaaf,null))['then'](function(_0x17ef84){if(_0x17ef84){_0x43440d[_0xe6f7('0x45')]=_['keys'](db[_0xe6f7('0x70')][_0xe6f7('0x42')]);_0x43440d['query']=_[_0xe6f7('0x47')](_0x511229[_0xe6f7('0x46')]);_0x43440d[_0xe6f7('0x50')]=_['intersection'](_0x43440d[_0xe6f7('0x45')],_0x43440d[_0xe6f7('0x46')]);_0x3f3853[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x43440d[_0xe6f7('0x45')],qs['fields'](_0x511229['query'][_0xe6f7('0x4a')]));_0x3f3853['attributes']=_0x3f3853[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x3f3853['attributes']:_0x43440d[_0xe6f7('0x45')];if(!_0x511229['query']['hasOwnProperty']('nolimit')){_0x3f3853[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x511229['query'][_0xe6f7('0x2d')]);_0x3f3853[_0xe6f7('0x2f')]=qs['offset'](_0x511229[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}_0x3f3853['order']=qs[_0xe6f7('0x4e')](_0x511229[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x3f3853[_0xe6f7('0x4f')]=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x511229['query'],_0x43440d['filters']));_0x3f3853[_0xe6f7('0x4f')]['ChatWebsiteId']=_0x17ef84['id'];if(_0x511229[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x3f3853['where']=_[_0xe6f7('0x53')](_0x3f3853['where'],{'$or':_[_0xe6f7('0x41')](_0x3f3853['attributes'],function(_0x5d98d3){var _0x465040={};_0x465040[_0x5d98d3]={'$like':'%'+_0x511229[_0xe6f7('0x46')][_0xe6f7('0x52')]+'%'};return _0x465040;})});}_0x3f3853=_[_0xe6f7('0x53')]({},_0x3f3853,_0x511229[_0xe6f7('0x54')]);return db[_0xe6f7('0x70')]['count']({'where':_0x3f3853[_0xe6f7('0x4f')]})[_0xe6f7('0x38')](function(_0x33f9ff){_0x4c9e44[_0xe6f7('0x30')]=_0x33f9ff;if(_0x511229[_0xe6f7('0x46')]['includeAll']){_0x3f3853[_0xe6f7('0x57')]=[{'all':!![]}];}return db[_0xe6f7('0x70')][_0xe6f7('0x58')](_0x3f3853);})[_0xe6f7('0x38')](function(_0x2365a9){_0x4c9e44[_0xe6f7('0x59')]=_0x2365a9;return _0x4c9e44;});}})[_0xe6f7('0x38')](respondWithFilteredResult(_0x3ceaaf,_0x3f3853))[_0xe6f7('0x5a')](handleError(_0x3ceaaf,null));};exports[_0xe6f7('0x72')]=function(_0x2d45fe,_0x316196,_0x3d03f8){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x2d45fe[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x316196,null))[_0xe6f7('0x38')](function(_0x56c6fa){if(_0x56c6fa){return _0x56c6fa[_0xe6f7('0x72')](_0x2d45fe['query'][_0xe6f7('0x6e')]);}})[_0xe6f7('0x38')](respondWithStatusCode(_0x316196,null))[_0xe6f7('0x5a')](handleError(_0x316196,null));};exports[_0xe6f7('0x73')]=function(_0x2b885b,_0x51ecd1,_0x4ba1a5){_0x2b885b[_0xe6f7('0x5f')][_0xe6f7('0x74')]=_0x2b885b['file'][_0xe6f7('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x2b885b[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x51ecd1,null))[_0xe6f7('0x38')](saveUpdates(_0x2b885b[_0xe6f7('0x5f')],null))[_0xe6f7('0x38')](respondWithResult(_0x51ecd1,null))[_0xe6f7('0x5a')](handleError(_0x51ecd1,null));};exports[_0xe6f7('0x76')]=function(_0x1cd3ed,_0x5b7f15,_0x108836){_0x1cd3ed[_0xe6f7('0x5f')][_0xe6f7('0x77')]=_0x1cd3ed[_0xe6f7('0x78')][_0xe6f7('0x75')];return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x1cd3ed['params']['id']}})['then'](handleEntityNotFound(_0x5b7f15,null))[_0xe6f7('0x38')](saveUpdates(_0x1cd3ed['body'],null))['then'](respondWithResult(_0x5b7f15,null))[_0xe6f7('0x5a')](handleError(_0x5b7f15,null));};exports[_0xe6f7('0x79')]=function(_0x47efc4,_0x2f2a3a,_0x4d61b2){_0x47efc4[_0xe6f7('0x5f')][_0xe6f7('0x7a')]=_0x47efc4[_0xe6f7('0x78')]['filename'];return db[_0xe6f7('0x55')]['find']({'where':{'id':_0x47efc4[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x2f2a3a,null))[_0xe6f7('0x38')](saveUpdates(_0x47efc4['body'],null))['then'](respondWithResult(_0x2f2a3a,null))[_0xe6f7('0x5a')](handleError(_0x2f2a3a,null));};exports[_0xe6f7('0x7b')]=function(_0x29d425,_0xa8f629,_0x494743){_0x29d425['body'][_0xe6f7('0x7c')]=_0x29d425['file'][_0xe6f7('0x75')];return db[_0xe6f7('0x55')]['find']({'where':{'id':_0x29d425[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0xa8f629,null))[_0xe6f7('0x38')](saveUpdates(_0x29d425[_0xe6f7('0x5f')],null))[_0xe6f7('0x38')](respondWithResult(_0xa8f629,null))[_0xe6f7('0x5a')](handleError(_0xa8f629,null));};exports[_0xe6f7('0x7d')]=function(_0x1528c9,_0x5c54fc,_0x636c4f){var _0x4c54df=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],'server/files/images/logos/default_logo.svg');var _0x95f1eb={'where':{'id':_0x1528c9[_0xe6f7('0x5c')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4fcc78=![];return require(_0xe6f7('0x18'))[_0xe6f7('0x80')]()['then'](function(_0x10c944){if(_0x10c944){_0x4fcc78=_0x10c944['custom'];}})[_0xe6f7('0x38')](function(){return db[_0xe6f7('0x55')][_0xe6f7('0x67')](_0x95f1eb);})['then'](handleEntityNotFound(_0x5c54fc,null))[_0xe6f7('0x38')](function(_0x3630c5){if(_0x3630c5){if(!_[_0xe6f7('0x81')](_0x3630c5[_0xe6f7('0x74')])){if(fs['existsSync'](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x82'),_0x3630c5['sitepic']))&&_0x4fcc78){_0x4c54df=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x82'),_0x3630c5[_0xe6f7('0x74')]);}}return _0x5c54fc[_0xe6f7('0x83')](_0x4c54df);}})[_0xe6f7('0x5a')](handleError(_0x5c54fc,null));};exports[_0xe6f7('0x84')]=function(_0x627521,_0x4217ba,_0x5d7aac){var _0x3f13bc=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x85'));var _0x58e91b={'where':{'id':_0x627521[_0xe6f7('0x5c')]['id']},'attributes':['id',_0xe6f7('0x77')],'raw':!![]};return db[_0xe6f7('0x55')][_0xe6f7('0x67')](_0x58e91b)[_0xe6f7('0x38')](handleEntityNotFound(_0x4217ba,null))[_0xe6f7('0x38')](function(_0x465187){if(_0x465187){if(!_[_0xe6f7('0x81')](_0x465187[_0xe6f7('0x77')])){if(fs[_0xe6f7('0x86')](path[_0xe6f7('0x7e')](config['root'],_0xe6f7('0x87'),_0x465187[_0xe6f7('0x77')]))){_0x3f13bc=path['join'](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x465187[_0xe6f7('0x77')]);}}return _0x4217ba['download'](_0x3f13bc);}})[_0xe6f7('0x5a')](handleError(_0x4217ba,null));};exports[_0xe6f7('0x88')]=function(_0x24a1aa,_0x3691b0,_0x125660){var _0x5f3789=path['join'](config[_0xe6f7('0x7f')],_0xe6f7('0x89'));var _0x36347a={'where':{'id':_0x24a1aa[_0xe6f7('0x5c')]['id']},'attributes':['id',_0xe6f7('0x7a'),'showCustomerAvatar'],'raw':!![]};return db[_0xe6f7('0x55')][_0xe6f7('0x67')](_0x36347a)['then'](handleEntityNotFound(_0x3691b0,null))[_0xe6f7('0x38')](function(_0x45f24c){if(_0x45f24c){if(!_[_0xe6f7('0x81')](_0x45f24c['customerAvatar'])){if(fs[_0xe6f7('0x86')](path[_0xe6f7('0x7e')](config['root'],_0xe6f7('0x87'),_0x45f24c[_0xe6f7('0x7a')]))&&_0x45f24c[_0xe6f7('0x8a')]){_0x5f3789=path['join'](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x45f24c[_0xe6f7('0x7a')]);}}return _0x3691b0[_0xe6f7('0x83')](_0x5f3789);}})[_0xe6f7('0x5a')](handleError(_0x3691b0,null));};exports['getSystemAvatar']=function(_0x426aca,_0x150496,_0x1d510a){var _0x281bd0=path[_0xe6f7('0x7e')](config['root'],_0xe6f7('0x8b'));var _0x341810={'where':{'id':_0x426aca[_0xe6f7('0x5c')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xe6f7('0x55')]['find'](_0x341810)[_0xe6f7('0x38')](handleEntityNotFound(_0x150496,null))[_0xe6f7('0x38')](function(_0x579f1c){if(_0x579f1c){if(!_['isNil'](_0x579f1c[_0xe6f7('0x7c')])){if(fs['existsSync'](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x579f1c['systemAvatar']))){_0x281bd0=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x87'),_0x579f1c[_0xe6f7('0x7c')]);}}return _0x150496[_0xe6f7('0x83')](_0x281bd0);}})[_0xe6f7('0x5a')](handleError(_0x150496,null));};exports[_0xe6f7('0x8c')]=function(_0x41d1c5,_0x34514b,_0x5eeff5){var _0x318d8e=require(_0xe6f7('0x8d'));var _0xb0e10c=new _0x318d8e();var _0x28bfdb=_0xb0e10c[_0xe6f7('0x8e')](_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0x90')])['getResult']();var _0x3b7058={'body':_0x41d1c5[_0xe6f7('0x5f')],'channel':'chat'};var _0x36f499=[];var _0x44ffe0=[];var _0x3b0aa0={};var _0x1ea00c=![];return db[_0xe6f7('0x91')][_0xe6f7('0x68')]()[_0xe6f7('0x38')](function(_0x340a7c){if(!_0x340a7c){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))]('no\x20available\x20attributes');}_0x36f499=_[_0xe6f7('0x94')](_['keys'](_0x340a7c),[_0xe6f7('0x95'),'updatedAt']);_0x44ffe0=_[_0xe6f7('0x94')](_[_0xe6f7('0x47')](_0x340a7c),['createdAt',_0xe6f7('0x96'),_0xe6f7('0x97'),_0xe6f7('0x98')]);if(_0x41d1c5[_0xe6f7('0x5f')]['id']){delete _0x41d1c5[_0xe6f7('0x5f')]['id'];}if(_[_0xe6f7('0x81')](_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x99')])){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0x9a'));}if(_[_0xe6f7('0x81')](_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x5f')])||_0x41d1c5['body'][_0xe6f7('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0xe6f7('0x9b'));}if(_[_0xe6f7('0x81')](_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x9c')])){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44ffe0);}if(!_[_0xe6f7('0x9d')](_0x44ffe0,_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x9c')])){throw new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0x9e')+_0x44ffe0);}_0x3b0aa0[_0x41d1c5[_0xe6f7('0x5f')]['mapKey']]=_0x41d1c5['body'][_0xe6f7('0x99')];})[_0xe6f7('0x38')](function(){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x41d1c5[_0xe6f7('0x5c')]['id']},'include':[{'model':db[_0xe6f7('0x9f')],'as':_0xe6f7('0xa0'),'include':[{'model':db[_0xe6f7('0x91')],'as':'Contacts','where':_0x3b0aa0,'limit':0x1,'order':[[_0xe6f7('0x96'),'DESC']]}]},{'model':db[_0xe6f7('0xa1')],'as':_0xe6f7('0xa2')}]});})[_0xe6f7('0x38')](handleEntityNotFound(_0x34514b,null))[_0xe6f7('0x38')](function(_0x19e9c6){if(_0x19e9c6&&_0x19e9c6['List']){_0x3b7058[_0xe6f7('0xa3')]=_0x19e9c6;_0x3b7058['applications']=_0x19e9c6[_0xe6f7('0xa2')];_0x3b7058[_0xe6f7('0xa4')]=_0x19e9c6[_0xe6f7('0xa0')];_0x3b7058[_0xe6f7('0xa5')]=_[_0xe6f7('0xa6')](_0x3b7058['applications'],[_0xe6f7('0xa7')],['asc']);if(_0x3b7058['account']['Applications']){delete _0x3b7058[_0xe6f7('0xa3')]['Applications'];}if(_0x3b7058[_0xe6f7('0xa3')]['List']&&_0x3b7058['account']['List'][_0xe6f7('0xa8')][_0xe6f7('0x5d')]){return _0x3b7058['account'][_0xe6f7('0xa0')][_0xe6f7('0xa8')][0x0];}var _0x12f014=_[_0xe6f7('0x1a')](_0x41d1c5['body'],{'firstName':_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x99')],'ListId':_0x19e9c6[_0xe6f7('0x98')]});_0x12f014[_0x41d1c5['body']['mapKey']]=_0x41d1c5['body'][_0xe6f7('0x99')];return db[_0xe6f7('0x91')]['create'](_0x12f014,{'fields':_0x36f499,'raw':!![]});}})['then'](handleEntityNotFound(_0x34514b,null))[_0xe6f7('0x38')](function(_0x1d6f97){_0x3b7058[_0xe6f7('0xa9')]=_0x1d6f97;var _0x32a73f=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xaa')];if(_0x41d1c5['headers']['cf-connecting-ip']){_0x32a73f=_0x41d1c5[_0xe6f7('0x8f')]['cf-connecting-ip'];}else if(_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0xab')]){_0x32a73f=_[_0xe6f7('0xac')](_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0xab')][_0xe6f7('0xad')](','));}if(_0x1d6f97){var _0x1f7d59={'ContactId':_0x1d6f97['id'],'ChatWebsiteId':_0x41d1c5['params']['id'],'from':(_0x1d6f97[_0xe6f7('0xae')]||'')+'\x20'+(_0x1d6f97['lastName']||''),'customerIp':_0x32a73f,'customerPort':_0x41d1c5[_0xe6f7('0x8f')][_0xe6f7('0xaf')]?_0x41d1c5[_0xe6f7('0x8f')]['x-real-port']:null,'referer':_0x41d1c5['body']['referer'],'browserName':_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0x3e')]&&_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0xb1')]?util[_0xe6f7('0xb2')]('%s\x20%s',_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0x3e')],_0x28bfdb['browser']['version']):_0xe6f7('0xb3'),'browserVersion':_0x28bfdb[_0xe6f7('0xb0')][_0xe6f7('0xb1')]||'unknown','osName':util[_0xe6f7('0xb2')](_0xe6f7('0xb4'),_0x28bfdb['os'][_0xe6f7('0x3e')],_0x28bfdb['os'][_0xe6f7('0xb1')]),'osVersion':_0x28bfdb['os'][_0xe6f7('0xb1')],'deviceModel':_0x28bfdb[_0xe6f7('0xb5')]['model']&&_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0xb6')]?util['format'](_0xe6f7('0xb7'),_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0x45')],_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0xb6')],_0x28bfdb['device']['type']):null,'deviceVendor':_0x28bfdb[_0xe6f7('0xb5')][_0xe6f7('0xb6')],'deviceType':_0x28bfdb[_0xe6f7('0xb5')]['type'],'formData':JSON[_0xe6f7('0x25')](_0x41d1c5[_0xe6f7('0x5f')])};var _0x33cf90={'ChatWebsiteId':_0x41d1c5[_0xe6f7('0x5c')]['id'],'closed':![]};if(_0x41d1c5['body'][_0xe6f7('0xb8')]){_0x33cf90[_0xe6f7('0xb8')]=_0x41d1c5[_0xe6f7('0x5f')]['threadId'];return db['ChatInteraction'][_0xe6f7('0x67')]({'where':_0x33cf90})[_0xe6f7('0x38')](function(_0x6c7823){if(_0x6c7823){return[_0x6c7823,![]];}_0x1f7d59[_0xe6f7('0xb8')]=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xb8')];_0x1f7d59[_0xe6f7('0xb9')]=_0x41d1c5[_0xe6f7('0x5f')]['externalUrl'];return db[_0xe6f7('0xba')][_0xe6f7('0x5e')](_0x1f7d59)[_0xe6f7('0x38')](function(_0x406170){return[_0x406170,!![]];});});}_0x33cf90['ContactId']=_0x1d6f97['id'];if(_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbb')]&&_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbb')]['id']){_0x33cf90['id']=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbb')]['id'];return db[_0xe6f7('0xba')][_0xe6f7('0x67')]({'where':_0x33cf90})[_0xe6f7('0x38')](function(_0x281797){if(_0x281797){return[_0x281797,![]];}return db[_0xe6f7('0xba')][_0xe6f7('0x5e')](_0x1f7d59)[_0xe6f7('0x38')](function(_0x44ff8b){return[_0x44ff8b,!![]];});});}return db['ChatInteraction'][_0xe6f7('0x5e')](_0x1f7d59)['then'](function(_0x217980){return[_0x217980,!![]];});}})[_0xe6f7('0xbc')](function(_0xd3f615,_0x5ce72d){if(_0xd3f615){_0x1ea00c=_0x5ce72d;if(!_0x5ce72d){var _0x117c99={'from':(_0x3b7058['contact'][_0xe6f7('0xae')]||'')+'\x20'+(_0x3b7058[_0xe6f7('0xa9')][_0xe6f7('0xbd')]||'')};if(_0x41d1c5['body'][_0xe6f7('0xb8')]&&_0x41d1c5['body'][_0xe6f7('0xbe')]&&_0x41d1c5['body'][_0xe6f7('0xb8')]!=_0x41d1c5[_0xe6f7('0x5f')]['messageId']){_0x117c99[_0xe6f7('0xb8')]=_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xbe')];}return _0xd3f615[_0xe6f7('0x66')](_0x117c99);}else{return _0xd3f615;}}})[_0xe6f7('0x38')](function(_0x29cb02){_0x3b7058[_0xe6f7('0xbb')]=_0x29cb02[_0xe6f7('0x3a')]({'plain':!![]});_0x3b7058['interaction'][_0xe6f7('0xbf')]=_0x1ea00c;if(_0x3b7058[_0xe6f7('0xbb')][_0xe6f7('0xbf')]){if(_0x3b7058[_0xe6f7('0xa3')][_0xe6f7('0xc0')]){_0x3b7058[_0xe6f7('0xa5')][_0xe6f7('0xc1')]({'id':0x0,'priority':_0x3b7058['applications'][_0xe6f7('0x5d')]+0x1,'app':'close','appdata':_0xe6f7('0xc2'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xe6f7('0x5e')]({'body':_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0x5f')],'ChatWebsiteId':_0x41d1c5[_0xe6f7('0x5c')]['id'],'ChatInteractionId':_0x29cb02['id'],'direction':'in','ContactId':_0x3b7058[_0xe6f7('0xa9')]['id'],'AttachmentId':_0x41d1c5[_0xe6f7('0x5f')][_0xe6f7('0xc3')]});})[_0xe6f7('0x38')](function(_0x153c1c){_0x3b7058['message']=_0x153c1c;if(_0x3b7058[_0xe6f7('0xbb')][_0xe6f7('0xc4')]){return db[_0xe6f7('0xc5')][_0xe6f7('0x67')]({'attributes':['id',_0xe6f7('0x3e')],'where':{'id':_0x3b7058['interaction'][_0xe6f7('0xc4')]}})[_0xe6f7('0x38')](function(_0x22e0c2){if(_0x22e0c2){_0x3b7058['applications'][_0xe6f7('0xc6')]({'id':0x0,'priority':0x0,'app':_0xe6f7('0xc7'),'appdata':_0x22e0c2[_0xe6f7('0x3e')]+','+(_0x3b7058[_0xe6f7('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x3b7058['forcedOwnership']=!![];}return respondWithRpcPromise(_0xe6f7('0xc8'),_0xe6f7('0xc9'),_0x3b7058);});}return respondWithRpcPromise('Start',_0xe6f7('0xc9'),_0x3b7058);})[_0xe6f7('0x38')](function(_0x58578b){respondWithRpcPromise(_0xe6f7('0xca'),_0xe6f7('0xca'),{'event':'notify','message':_0x58578b},client9002);return _0x58578b;})[_0xe6f7('0x38')](respondWithResult(_0x34514b,null))[_0xe6f7('0x5a')](handleError(_0x34514b,null));};exports[_0xe6f7('0xcb')]=function(_0x515f2a,_0x5a8f7c,_0x454597){var _0x514523,_0x78703f,_0x42462e;var _0x1ad664=[];var _0x5c7f75=[];var _0x4984db={};var _0x218dc2=_0x515f2a[_0xe6f7('0xcc')]||[];var _0x78b9fa=[];var _0x3653bd;return db['CmContact'][_0xe6f7('0x68')]()[_0xe6f7('0x38')](function(_0x2c7a93){if(!_0x2c7a93){throw new db['Sequelize'][(_0xe6f7('0x93'))](_0xe6f7('0xcd'));}_0x5c7f75=_[_0xe6f7('0x94')](_['keys'](_0x2c7a93),[_0xe6f7('0x95'),_0xe6f7('0x96')]);_0x1ad664=_[_0xe6f7('0x94')](_[_0xe6f7('0x47')](_0x2c7a93),['createdAt',_0xe6f7('0x96'),_0xe6f7('0x97'),_0xe6f7('0x98')]);if(_0x515f2a[_0xe6f7('0x5f')]['id']){delete _0x515f2a['body']['id'];}if(_[_0xe6f7('0x81')](_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')])){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)[_0xe6f7('0x3f')](new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))]('from\x20is\x20mandatory'));}if(_[_0xe6f7('0x81')](_0x515f2a[_0xe6f7('0x5f')]['body'])||_0x515f2a[_0xe6f7('0x5f')]['body']===''){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)['send'](new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0x9b')));}if(_['isNil'](_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0xce')])){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)[_0xe6f7('0x3f')](new db['Sequelize'][(_0xe6f7('0x93'))](_0xe6f7('0xcf')+_0x1ad664));}if(!_[_0xe6f7('0x9d')](_0x1ad664,_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0xce')])){throw _0x5a8f7c[_0xe6f7('0x31')](0x1f4)[_0xe6f7('0x3f')](new db[(_0xe6f7('0x92'))][(_0xe6f7('0x93'))](_0xe6f7('0xd0')+_0x1ad664));}_0x4984db[_0x515f2a[_0xe6f7('0x5f')]['mapKeyOffline']]=_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')];})[_0xe6f7('0x38')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x515f2a[_0xe6f7('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xe6f7('0xa0')},{'model':db[_0xe6f7('0xd1')],'as':_0xe6f7('0xd1')}]});})[_0xe6f7('0x38')](handleEntityNotFound(_0x5a8f7c,null))['then'](function(_0x2c4809){if(_0x2c4809&&_0x2c4809[_0xe6f7('0xa0')]){_0x78703f=_0x2c4809;var _0x3672d3=_[_0xe6f7('0x1a')](_0x515f2a[_0xe6f7('0x5f')],{'firstName':_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')],'phone':_0x515f2a[_0xe6f7('0x5f')]['from'],'ListId':_0x2c4809[_0xe6f7('0x98')]});_0x3672d3[_0x515f2a['body'][_0xe6f7('0xce')]]=_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x99')];return db['CmContact']['findOrCreate']({'where':_0x4984db,'defaults':_0x3672d3});}})[_0xe6f7('0xbc')](function(_0x371d95){if(_0x371d95){_0x42462e=_0x371d95;var _0x99db6c=fs[_0xe6f7('0xd2')](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0xd3')),'utf8');var _0x3e6e79=ejs['render'](_0x99db6c,{'body':_[_0xe6f7('0xd4')](_0x515f2a[_0xe6f7('0x5f')][_0xe6f7('0x5f')]),'bodyTitle':_0x78703f[_0xe6f7('0xd5')]});return db[_0xe6f7('0xd6')][_0xe6f7('0x5e')]({'body':_0x3e6e79,'ContactId':_0x371d95['id'],'ChatWebsiteId':_0x78703f['id']});}})['then'](function(_0x12a455){_0x3653bd=_0x12a455;if(_0x218dc2[_0xe6f7('0x5d')]){var _0x909c7f=_0x218dc2['map'](function(_0x2af65d){return{'name':_0x2af65d['originalname'],'basename':_0x2af65d[_0xe6f7('0x75')],'type':_0x2af65d[_0xe6f7('0xd7')],'ChatOfflineMessageId':_0x12a455['id']};});_0x78b9fa=_0x909c7f['map'](_0x4f5f09=>{var _0x4ff289={'filename':_0x4f5f09[_0xe6f7('0x3e')],'path':path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],'server',_0xe6f7('0xcc'),'attachments',_0xe6f7('0xd8'),_0x4f5f09[_0xe6f7('0xd9')])};return _0x4ff289;});if(!_0x78703f['openNewInteraction']){return db[_0xe6f7('0xda')][_0xe6f7('0xdb')](function(_0x5265c1){return db[_0xe6f7('0xdc')][_0xe6f7('0xdd')](_0x909c7f,{'transaction':_0x5265c1});});}}})[_0xe6f7('0x38')](function(){if(_0x3653bd){_0x514523=_0x3653bd;return db[_0xe6f7('0xd1')][_0xe6f7('0x6c')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe6f7('0xde'),'raw':!![]}]});}})[_0xe6f7('0x38')](function(_0x4f1e26){if(_0x4f1e26&&_0x4f1e26[_0xe6f7('0xde')]&&_0x78703f[_0xe6f7('0xdf')]&&_0x78703f['forwardOfflineAddress']){var _0x5f4114={'tls':{'rejectUnauthorized':![]}};if(_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe0')]){_0x5f4114['service']=_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe0')];}else{_0x5f4114[_0xe6f7('0xe1')]=_0x4f1e26[_0xe6f7('0xde')]['host'];_0x5f4114['port']=_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe2')];_0x5f4114[_0xe6f7('0xe3')]=_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe3')];}if(_0x4f1e26[_0xe6f7('0xde')]['authentication']){_0x5f4114[_0xe6f7('0xe4')]={'user':_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0x60')],'pass':_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0xe5')]};}return respondWithRpcPromise(_0xe6f7('0xe6'),'sendMail',{'account':_0x5f4114,'message':{'from':util[_0xe6f7('0xb2')]('\x22%s\x22\x20<%s>',_0x4f1e26[_0xe6f7('0x3e')],_0x4f1e26['email']||_0x4f1e26[_0xe6f7('0xde')][_0xe6f7('0x60')]),'to':_0x78703f['forwardOfflineAddress'],'subject':_0x78703f[_0xe6f7('0xe7')],'html':_0x514523['body'],'attachments':_0x78b9fa}},client9003)[_0xe6f7('0x38')](function(){return _0x514523;})['catch'](function(_0x2e1c35){console[_0xe6f7('0x26')](_0x2e1c35);});}})[_0xe6f7('0x38')](function(){if(_0x78703f&&_0x78703f[_0xe6f7('0xe8')]&&_0x78703f[_0xe6f7('0xe9')]){var _0xe4646a=[];if(_0x218dc2[_0xe6f7('0x5d')]){_0xe4646a=_0x218dc2['map'](function(_0x5a2c4a){return{'name':_0x5a2c4a[_0xe6f7('0xea')],'basename':_0x5a2c4a['filename'],'type':_0x5a2c4a[_0xe6f7('0xd7')],'ChatOfflineMessageId':_0x3653bd['id']};});}var _0x337836;if(!_[_0xe6f7('0x81')](_0x78703f[_0xe6f7('0xeb')])){var _0x2b7c53=_[_0xe6f7('0x41')](_0x515f2a[_0xe6f7('0x5f')],function(_0x41d14c){return _0x41d14c;});var _0x5db638=_[_0xe6f7('0xec')](_0x2b7c53)[0x0];var _0x6488c3=_[_0xe6f7('0xed')](_0x5db638,function(_0x2585e7){return _0x2585e7;});_0x337836=_0x6488c3[0x1][_0x78703f[_0xe6f7('0xeb')]];}var _0x2532bb={'from':_0x42462e['email'],'firstName':_0x42462e[_0xe6f7('0xae')],'lastName':_0x42462e[_0xe6f7('0xbd')],'mapKey':'email','message':{'from':_0x42462e['email'],'to':_0x78703f[_0xe6f7('0xd1')][_0xe6f7('0xee')],'cc':'','subject':_['isNil'](_0x337836)?_0x78703f['offlineMessageSubject']:_0x337836,'messageId':'','sentAt':new Date(),'attach':_0xe4646a[_0xe6f7('0x5d')],'attachments':_0xe4646a,'originChannel':'Chat','ChatWebsiteId':_0x78703f['id'],'ChatOfflineMessageId':_0x514523['id'],'originTo':_0x78703f[_0xe6f7('0xd1')]['email']},'body':_0x514523[_0xe6f7('0x5f')]};var _0x35e1d2={'account':{'id':_0x78703f[_0xe6f7('0xe9')]},'body':_0x2532bb,'log':_0xe6f7('0xef')};return respondWithRpcPromise(_0xe6f7('0xef'),'notifyMail',_0x35e1d2,client9001)[_0xe6f7('0x38')](function(){return _0x514523;})[_0xe6f7('0x5a')](function(_0x1231a0){console[_0xe6f7('0x26')](_0x1231a0);});}return;})['then'](function(){if(_0x514523){return _0x514523;}})[_0xe6f7('0x38')](respondWithResult(_0x5a8f7c,null))[_0xe6f7('0x5a')](function(_0x137824){console[_0xe6f7('0x26')](_0xe6f7('0x5a'),_0x137824);for(var _0x2f4224 of _0x218dc2){var _0x5ccefa=path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0xf0'),'files',_0xe6f7('0xf1'),'offline-chat',_0x2f4224[_0xe6f7('0x75')]);fs_extra['remove'](_0x5ccefa)[_0xe6f7('0x5a')](function(_0x55c816){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x5ccefa,_0x55c816);});}});};exports[_0xe6f7('0xf2')]=function(_0x18de83,_0x33480b,_0x44722e){return db[_0xe6f7('0xba')][_0xe6f7('0x67')]({'where':{'id':_0x18de83[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x33480b,null))[_0xe6f7('0x38')](function(_0x90f14){if(_0x90f14){return _0x90f14[_0xe6f7('0xf2')](_0x18de83[_0xe6f7('0x5f')][_0xe6f7('0x6e')],_[_0xe6f7('0xf3')](_0x18de83['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x33480b,null))[_0xe6f7('0x5a')](handleError(_0x33480b,null));};exports[_0xe6f7('0xf4')]=function(_0x1c48be,_0x1af6ad,_0x33f81d){var _0x53fea1={'raw':![],'where':{}};var _0x3de6a2={};var _0x3737f6={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')]['findOne']({'where':{'id':_0x1c48be[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x1af6ad,null))['then'](function(_0x4c166b){if(_0x4c166b){_0x3de6a2['model']=_['keys'](db[_0xe6f7('0xba')]['rawAttributes']);_0x3de6a2[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x1c48be[_0xe6f7('0x46')]);_0x3de6a2[_0xe6f7('0x50')]=_['intersection'](_0x3de6a2['model'],_0x3de6a2[_0xe6f7('0x46')]);_0x53fea1[_0xe6f7('0x49')]=_['intersection'](_0x3de6a2[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0x4a')]));_0x53fea1['attributes']=_0x53fea1['attributes']['length']?_0x53fea1[_0xe6f7('0x49')]:_0x3de6a2['model'];if(!_0x1c48be[_0xe6f7('0x46')]['hasOwnProperty'](_0xe6f7('0x4c'))){_0x53fea1[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x1c48be['query'][_0xe6f7('0x2d')]);_0x53fea1['offset']=qs['offset'](_0x1c48be['query']['offset']);}_0x53fea1[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x1c48be['query'][_0xe6f7('0x4e')]);_0x53fea1[_0xe6f7('0x4f')]=qs['filters'](_[_0xe6f7('0x51')](_0x1c48be['query'],_0x3de6a2['filters']));_0x53fea1['where']['ChatWebsiteId']=_0x4c166b['id'];if(_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x53fea1[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x53fea1[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x53fea1[_0xe6f7('0x49')],function(_0x303abb){var _0x1cb4c1={};_0x1cb4c1[_0x303abb]={'$like':'%'+_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0x52')]+'%'};return _0x1cb4c1;})});}_0x53fea1=_[_0xe6f7('0x53')]({},_0x53fea1,_0x1c48be['options']);return db['ChatInteraction']['count']({'where':_0x53fea1['where']})['then'](function(_0x5bb906){_0x3737f6['count']=_0x5bb906;if(_0x1c48be['query'][_0xe6f7('0x56')]){_0x53fea1[_0xe6f7('0x57')]=[{'model':db[_0xe6f7('0x91')],'as':_0xe6f7('0xf5'),'required':![]},{'model':db[_0xe6f7('0xc5')],'as':_0xe6f7('0xf6'),'attributes':[_0xe6f7('0x3e'),_0xe6f7('0xf7'),_0xe6f7('0xf8')],'required':![]},{'model':db[_0xe6f7('0xf9')],'as':_0xe6f7('0xfa'),'attributes':['id','name',_0xe6f7('0xfb')],'where':_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0xfc')]?{'id':_0x1c48be[_0xe6f7('0x46')]['tag']}:undefined,'required':_0x1c48be[_0xe6f7('0x46')][_0xe6f7('0xfc')]?!![]:![]}];}return db[_0xe6f7('0xba')][_0xe6f7('0x58')](_0x53fea1);})[_0xe6f7('0x38')](function(_0x16ea1e){_0x3737f6[_0xe6f7('0x59')]=_0x16ea1e;return _0x3737f6;});}})['then'](respondWithFilteredResult(_0x1af6ad,_0x53fea1))['catch'](handleError(_0x1af6ad,null));};function iftimePromise(_0x1e986f,_0x61a524){return respondWithRpcPromise('Command',_0xe6f7('0xfd'),{'command':_0x61a524['timezone']?util[_0xe6f7('0xb2')](_0xe6f7('0xfe'),_0x1e986f[_0xe6f7('0xff')],_0x61a524['timezone']):util[_0xe6f7('0xb2')](_0xe6f7('0x100'),_0x1e986f['interval'])},client9002)[_0xe6f7('0x38')](function(_0x40c3f2){var _0xc68b3b=_0x40c3f2&&_0x40c3f2[_0xe6f7('0x101')]('true')>=0x0?!![]:![];logger[_0xe6f7('0x29')](_0xe6f7('0x102'),_0x61a524['id'],_0x1e986f['id'],_0x1e986f['interval'],_0xc68b3b?_0xe6f7('0x103'):_0xe6f7('0x104'),_0x61a524[_0xe6f7('0x105')]?_0x61a524[_0xe6f7('0x105')]:_0xe6f7('0x106'));return _0xc68b3b;})['catch'](function(_0x1d495a){logger['error'](_0xe6f7('0x102'),_0x61a524['id'],_0x1e986f['id'],_0x1e986f[_0xe6f7('0xff')],util[_0xe6f7('0x107')](_0x1d495a,{'showHidden':![],'depth':null}),_0x61a524[_0xe6f7('0x105')]?_0x61a524['timezone']:_0xe6f7('0x106'));return![];});}exports[_0xe6f7('0xfd')]=function(_0x420396,_0x932205,_0x3521ba){var _0x1525af=0x0;var _0x1e2bd4=0x0;var _0x1eee2a=![];var _0x38e446;var _0x1655c7;return db['ChatWebsite'][_0xe6f7('0x67')]({'where':{'id':_0x420396[_0xe6f7('0x5c')]['id']},'include':[{'model':db[_0xe6f7('0x108')],'as':_0xe6f7('0x108'),'include':[{'model':db['Interval'],'as':_0xe6f7('0x109'),'attributes':['id',_0xe6f7('0xff')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x932205,null))['then'](function(_0x4a3af6){if(_0x4a3af6){_0x38e446=_0x4a3af6;return _0x4a3af6[_0xe6f7('0x10a')]({'raw':!![]});}})[_0xe6f7('0x38')](function(_0x258e53){if(_0x38e446){if(_0x258e53){_0x1655c7=_0x258e53;}}return require('../../config/license/util')[_0xe6f7('0x80')]();})['then'](function(_0x5cfec8){if(_0x5cfec8){_0x1e2bd4=_0x5cfec8[_0xe6f7('0x10b')];_0x1eee2a=_0x5cfec8[_0xe6f7('0x10c')];}})['then'](function(){return db[_0xe6f7('0xba')][_0xe6f7('0x30')]({'where':{'closed':![]}});})['then'](function(_0x54ea38){_0x1525af=_0x54ea38;if(_0x1e2bd4&&_0x54ea38>_0x1e2bd4){return db[_0xe6f7('0x10d')][_0xe6f7('0x6c')]({'where':{'id':0x1}})[_0xe6f7('0x38')](function(_0x3fa63d){if(_0x3fa63d){_0x3fa63d['increment'](_0xe6f7('0x10e'));}});}})[_0xe6f7('0x38')](function(){if(_0x38e446['Interval']&&_0x38e446[_0xe6f7('0x108')][_0xe6f7('0x109')]){var _0x1c8399=[];for(var _0x1e1504=0x0;_0x1e1504<_0x38e446[_0xe6f7('0x108')]['Intervals']['length'];_0x1e1504++){var _0x180213=_0x38e446['Interval'][_0xe6f7('0x109')][_0x1e1504][_0xe6f7('0x3a')]({'plain':!![]});_0x1c8399[_0xe6f7('0xc1')](iftimePromise(_0x180213,_0x38e446));}return BPromise[_0xe6f7('0x10f')](_0x1c8399)['then'](function(_0x4e709e){return _[_0xe6f7('0x110')](_0x4e709e);});}else{return!![];}})[_0xe6f7('0x38')](function(_0x13fc4d){var _0x299ee2=fs[_0xe6f7('0xd2')](path[_0xe6f7('0x7e')](config[_0xe6f7('0x7f')],_0xe6f7('0x111')),'utf8');var _0x1717fd={'remote':_0x38e446[_0xe6f7('0x112')],'query':querystring['stringify'](_[_0xe6f7('0x53')](_0x38e446['get']({'plain':!![]}),{'customerIp':_0x420396['headers'][_0xe6f7('0xab')]||_0x420396[_0xe6f7('0x8f')][_0xe6f7('0x113')]||_0x420396[_0xe6f7('0x114')]['remoteAddress']||_0x420396['ip'],'referer':_0x420396[_0xe6f7('0x8f')]['referer'],'openedInteractions':_0x1525af,'maxInteractions':_0x1e2bd4,'virtual':_0x1eee2a['virtual'],'online':_0x13fc4d,'custom':_0x1eee2a}))[_0xe6f7('0x115')](/'/g,'\x5c\x27')};_0x932205['send'](ejs[_0xe6f7('0x116')](Mustache[_0xe6f7('0x116')](_0x299ee2,_0x1717fd),{'proactiveActions':_0x1655c7,'alignment':_0x38e446[_0xe6f7('0x117')],'verticalAlignment':_0x38e446[_0xe6f7('0x118')],'div_color':_0x38e446['color'],'text_color':_0x38e446[_0xe6f7('0x119')],'button_color':_0x38e446[_0xe6f7('0x11a')],'background_color':_0x38e446[_0xe6f7('0x11b')]}));})[_0xe6f7('0x5a')](handleError(_0x932205,null));};exports[_0xe6f7('0x11c')]=function(_0x68ac4,_0x3d0ec,_0x59680f){return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x68ac4[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x3d0ec,null))[_0xe6f7('0x38')](function(_0x5db140){if(_0x5db140){return db[_0xe6f7('0xda')][_0xe6f7('0xdb')](function(_0x11d249){return db['ChatApplication'][_0xe6f7('0x39')]({'where':{'ChatWebsiteId':_0x68ac4[_0xe6f7('0x5c')]['id']},'transaction':_0x11d249})[_0xe6f7('0x38')](function(_0x3ceaeb){var _0x309bff=_[_0xe6f7('0x41')](_0x68ac4[_0xe6f7('0x5f')],function(_0x4dbbdb){_0x4dbbdb[_0xe6f7('0x69')]=_0x68ac4[_0xe6f7('0x5c')]['id'];return _0x4dbbdb;});return db[_0xe6f7('0xa1')][_0xe6f7('0xdd')](_0x309bff,{'transaction':_0x11d249});});})[_0xe6f7('0x38')](function(){return db[_0xe6f7('0xa1')][_0xe6f7('0x11d')]({'where':{'ChatWebsiteId':_0x68ac4[_0xe6f7('0x5c')]['id']},'order':_0xe6f7('0xa7')});});}})[_0xe6f7('0x38')](respondWithResult(_0x3d0ec,null))[_0xe6f7('0x5a')](handleError(_0x3d0ec,null));};exports[_0xe6f7('0x11e')]=function(_0x51312f,_0x525830,_0x4f6ea0){var _0x1dbcc8={};var _0x136de0={};var _0x3d8a6e;var _0x2a0507;return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x51312f[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x525830,null))[_0xe6f7('0x38')](function(_0x46b846){if(_0x46b846){_0x3d8a6e=_0x46b846;_0x136de0['model']=_[_0xe6f7('0x47')](db[_0xe6f7('0xa1')]['rawAttributes']);_0x136de0[_0xe6f7('0x46')]=_['keys'](_0x51312f[_0xe6f7('0x46')]);_0x136de0[_0xe6f7('0x50')]=_[_0xe6f7('0x48')](_0x136de0[_0xe6f7('0x45')],_0x136de0[_0xe6f7('0x46')]);_0x1dbcc8[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x136de0[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x51312f['query'][_0xe6f7('0x4a')]));_0x1dbcc8['attributes']=_0x1dbcc8[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x1dbcc8[_0xe6f7('0x49')]:_0x136de0['model'];_0x1dbcc8[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x1dbcc8[_0xe6f7('0x4f')]=qs[_0xe6f7('0x50')](_['pick'](_0x51312f[_0xe6f7('0x46')],_0x136de0[_0xe6f7('0x50')]));if(_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x1dbcc8[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x1dbcc8[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x1dbcc8['attributes'],function(_0x3b100e){var _0x51bf44={};_0x51bf44[_0x3b100e]={'$like':'%'+_0x51312f[_0xe6f7('0x46')]['filter']+'%'};return _0x51bf44;})});}_0x1dbcc8=_[_0xe6f7('0x53')]({},_0x1dbcc8,_0x51312f[_0xe6f7('0x54')]);return _0x3d8a6e[_0xe6f7('0x11e')](_0x1dbcc8);}})['then'](function(_0xdddf27){if(_0xdddf27){_0x2a0507=_0xdddf27[_0xe6f7('0x5d')];if(!_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x1dbcc8[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x51312f[_0xe6f7('0x46')]['limit']);_0x1dbcc8['offset']=qs['offset'](_0x51312f[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}return _0x3d8a6e[_0xe6f7('0x11e')](_0x1dbcc8);}})['then'](function(_0x269af8){if(_0x269af8){return _0x269af8?{'count':_0x2a0507,'rows':_0x269af8}:null;}})[_0xe6f7('0x38')](respondWithResult(_0x525830,null))[_0xe6f7('0x5a')](handleError(_0x525830,null));};exports[_0xe6f7('0x11f')]=function(_0x3e5851,_0x2004ce,_0x13f3eb){return db[_0xe6f7('0x120')][_0xe6f7('0x67')]({'where':{'id':_0x3e5851['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x2004ce,null))[_0xe6f7('0x38')](function(_0x57d09d){if(_0x57d09d){return _0x57d09d[_0xe6f7('0x11f')](_0x3e5851[_0xe6f7('0x5f')]['ids'],_['omit'](_0x3e5851[_0xe6f7('0x5f')],['ids','id'])||{});}})[_0xe6f7('0x38')](respondWithResult(_0x2004ce,null))[_0xe6f7('0x5a')](handleError(_0x2004ce,null));};exports[_0xe6f7('0x10a')]=function(_0x303104,_0x285050,_0x3e4cd8){var _0x1a3291={};var _0x5ed55c={};var _0x5766ef;var _0x31824e;return db[_0xe6f7('0x55')][_0xe6f7('0x6c')]({'where':{'id':_0x303104[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x285050,null))[_0xe6f7('0x38')](function(_0x277a8e){if(_0x277a8e){_0x5766ef=_0x277a8e;_0x5ed55c[_0xe6f7('0x45')]=_[_0xe6f7('0x47')](db[_0xe6f7('0x121')][_0xe6f7('0x42')]);_0x5ed55c[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x303104[_0xe6f7('0x46')]);_0x5ed55c[_0xe6f7('0x50')]=_['intersection'](_0x5ed55c['model'],_0x5ed55c['query']);_0x1a3291[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x5ed55c[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x303104[_0xe6f7('0x46')]['fields']));_0x1a3291[_0xe6f7('0x49')]=_0x1a3291[_0xe6f7('0x49')][_0xe6f7('0x5d')]?_0x1a3291[_0xe6f7('0x49')]:_0x5ed55c[_0xe6f7('0x45')];_0x1a3291[_0xe6f7('0x4d')]=qs['sort'](_0x303104[_0xe6f7('0x46')][_0xe6f7('0x4e')]);_0x1a3291[_0xe6f7('0x4f')]=qs['filters'](_['pick'](_0x303104[_0xe6f7('0x46')],_0x5ed55c[_0xe6f7('0x50')]));if(_0x303104['query'][_0xe6f7('0x52')]){_0x1a3291[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x1a3291[_0xe6f7('0x4f')],{'$or':_['map'](_0x1a3291['attributes'],function(_0x307901){var _0x118e6e={};_0x118e6e[_0x307901]={'$like':'%'+_0x303104['query'][_0xe6f7('0x52')]+'%'};return _0x118e6e;})});}_0x1a3291=_[_0xe6f7('0x53')]({},_0x1a3291,_0x303104[_0xe6f7('0x54')]);return _0x5766ef[_0xe6f7('0x10a')](_0x1a3291);}})['then'](function(_0x3b77e4){if(_0x3b77e4){_0x31824e=_0x3b77e4[_0xe6f7('0x5d')];if(!_0x303104[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x1a3291['limit']=qs['limit'](_0x303104['query'][_0xe6f7('0x2d')]);_0x1a3291[_0xe6f7('0x2f')]=qs[_0xe6f7('0x2f')](_0x303104[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}return _0x5766ef['getProactiveActions'](_0x1a3291);}})[_0xe6f7('0x38')](function(_0x121575){if(_0x121575){return _0x121575?{'count':_0x31824e,'rows':_0x121575}:null;}})[_0xe6f7('0x38')](respondWithResult(_0x285050,null))[_0xe6f7('0x5a')](handleError(_0x285050,null));};exports['getFields']=function(_0x580f34,_0x4e70ab,_0x24f4dd){var _0x19bd7f=_0x580f34[_0xe6f7('0x46')][_0xe6f7('0x122')]===_0xe6f7('0x123')?_0xe6f7('0x124'):'onlineForm';return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'attributes':['id',_0x19bd7f],'where':{'id':_0x580f34[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x4e70ab,null))[_0xe6f7('0x38')](function(_0x31aea8){if(_0x31aea8){var _0xd8cfe1=_0x31aea8[_0x19bd7f];var _0x96fc5e=_0xd8cfe1&&_0xd8cfe1[_0xe6f7('0x125')]?_0xd8cfe1[_0xe6f7('0x125')]:[];_0x4e70ab[_0xe6f7('0x3f')]({'fromKey':_['isNil'](_0xd8cfe1[_0xe6f7('0x126')])?undefined:_0xd8cfe1['fromKey'],'count':_0x96fc5e['length'],'rows':_0x96fc5e});}})[_0xe6f7('0x5a')](handleError(_0x4e70ab,null));};exports[_0xe6f7('0x127')]=function(_0x201184,_0x3516c3,_0x58b4f5){var _0x132a2b={'raw':![],'where':{}};var _0x27c75d={};var _0x3a8792={'count':0x0,'rows':[]};return db[_0xe6f7('0x55')]['findOne']({'where':{'id':_0x201184['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x3516c3,null))[_0xe6f7('0x38')](function(_0x431d4f){if(_0x431d4f){_0x27c75d[_0xe6f7('0x45')]=_['keys'](db[_0xe6f7('0xd6')]['rawAttributes']);_0x27c75d['query']=_[_0xe6f7('0x47')](_0x201184[_0xe6f7('0x46')]);_0x27c75d[_0xe6f7('0x50')]=_[_0xe6f7('0x48')](_0x27c75d[_0xe6f7('0x45')],_0x27c75d[_0xe6f7('0x46')]);_0x132a2b[_0xe6f7('0x49')]=_[_0xe6f7('0x48')](_0x27c75d[_0xe6f7('0x45')],qs['fields'](_0x201184[_0xe6f7('0x46')]['fields']));_0x132a2b[_0xe6f7('0x49')]=_0x132a2b['attributes'][_0xe6f7('0x5d')]?_0x132a2b['attributes']:_0x27c75d[_0xe6f7('0x45')];if(!_0x201184[_0xe6f7('0x46')][_0xe6f7('0x4b')]('nolimit')){_0x132a2b['limit']=qs[_0xe6f7('0x2d')](_0x201184[_0xe6f7('0x46')]['limit']);_0x132a2b['offset']=qs[_0xe6f7('0x2f')](_0x201184[_0xe6f7('0x46')][_0xe6f7('0x2f')]);}_0x132a2b[_0xe6f7('0x4d')]=qs[_0xe6f7('0x4e')](_0x201184['query'][_0xe6f7('0x4e')]);_0x132a2b['where']=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x201184[_0xe6f7('0x46')],_0x27c75d[_0xe6f7('0x50')]));_0x132a2b[_0xe6f7('0x4f')]['ChatWebsiteId']=_0x431d4f['id'];if(_0x201184['query'][_0xe6f7('0x52')]){_0x132a2b[_0xe6f7('0x4f')]=_[_0xe6f7('0x53')](_0x132a2b[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x132a2b[_0xe6f7('0x49')],function(_0x1df4ab){var _0xb17d04={};_0xb17d04[_0x1df4ab]={'$like':'%'+_0x201184['query'][_0xe6f7('0x52')]+'%'};return _0xb17d04;})});}_0x132a2b=_['merge']({},_0x132a2b,_0x201184[_0xe6f7('0x54')]);return db[_0xe6f7('0xd6')]['count']({'where':_0x132a2b[_0xe6f7('0x4f')]})['then'](function(_0x28f3c4){_0x3a8792[_0xe6f7('0x30')]=_0x28f3c4;if(_0x201184[_0xe6f7('0x46')]['includeAll']){_0x132a2b[_0xe6f7('0x57')]=[{'all':!![]}];}else{_0x132a2b[_0xe6f7('0x57')]=[{'model':db[_0xe6f7('0x91')],'as':_0xe6f7('0xf5'),'required':![]},{'model':db[_0xe6f7('0xdc')],'as':_0xe6f7('0x128'),'required':![]}];}return db['ChatOfflineMessage'][_0xe6f7('0x58')](_0x132a2b);})[_0xe6f7('0x38')](function(_0x279ac9){_0x3a8792[_0xe6f7('0x59')]=_0x279ac9;return _0x3a8792;});}})[_0xe6f7('0x38')](respondWithFilteredResult(_0x3516c3,_0x132a2b))[_0xe6f7('0x5a')](handleError(_0x3516c3,null));};exports[_0xe6f7('0x129')]=function(_0x345aef,_0x5070e0,_0x4fa9fa){return db['ChatWebsite']['find']({'where':{'id':_0x345aef[_0xe6f7('0x5c')]['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x5070e0,null))[_0xe6f7('0x38')](function(_0x11d66f){if(_0x11d66f){return _0x11d66f[_0xe6f7('0x129')](_0x345aef[_0xe6f7('0x5f')][_0xe6f7('0x6e')],_['omit'](_0x345aef[_0xe6f7('0x5f')],['ids','id'])||{})[_0xe6f7('0xbc')](function(_0x250fde){for(var _0x1ca91e=0x0;_0x1ca91e<_0x345aef[_0xe6f7('0x5f')][_0xe6f7('0x6e')][_0xe6f7('0x5d')];_0x1ca91e+=0x1){socket[_0xe6f7('0x12a')]('userChatWebsite:save',{'UserId':_0x345aef['body'][_0xe6f7('0x6e')][_0x1ca91e],'ChatWebsiteId':_0x345aef['params']['id']});}return _0x250fde;});}})['then'](respondWithResult(_0x5070e0,null))[_0xe6f7('0x5a')](handleError(_0x5070e0,null));};exports[_0xe6f7('0x12b')]=function(_0x3f0157,_0x3012a6,_0x2a83e9){return db[_0xe6f7('0x55')][_0xe6f7('0x67')]({'where':{'id':_0x3f0157[_0xe6f7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3012a6,null))[_0xe6f7('0x38')](function(_0x71f40d){if(_0x71f40d){return _0x71f40d[_0xe6f7('0x12b')](_0x3f0157[_0xe6f7('0x46')][_0xe6f7('0x6e')])['then'](function(){if(_[_0xe6f7('0x12c')](_0x3f0157[_0xe6f7('0x46')][_0xe6f7('0x6e')])){for(var _0x49420f=0x0;_0x49420f<_0x3f0157[_0xe6f7('0x46')]['ids']['length'];_0x49420f+=0x1){socket[_0xe6f7('0x12a')]('userChatWebsite:remove',{'UserId':Number(_0x3f0157[_0xe6f7('0x46')]['ids'][_0x49420f]),'ChatWebsiteId':Number(_0x3f0157[_0xe6f7('0x5c')]['id'])});}}else{socket[_0xe6f7('0x12a')](_0xe6f7('0x12d'),{'UserId':Number(_0x3f0157[_0xe6f7('0x46')][_0xe6f7('0x6e')]),'ChatWebsiteId':Number(_0x3f0157[_0xe6f7('0x5c')]['id'])});}});}})[_0xe6f7('0x38')](respondWithStatusCode(_0x3012a6,null))[_0xe6f7('0x5a')](handleError(_0x3012a6,null));};exports[_0xe6f7('0x12e')]=function(_0x5b4600,_0x266d1e,_0x1cc798){var _0x3e80a9={};var _0x21dbdd={};var _0x21f030;var _0x37cf01;return db['ChatWebsite'][_0xe6f7('0x6c')]({'where':{'id':_0x5b4600['params']['id']}})[_0xe6f7('0x38')](handleEntityNotFound(_0x266d1e,null))[_0xe6f7('0x38')](function(_0x1dd144){if(_0x1dd144){_0x21f030=_0x1dd144;_0x21dbdd[_0xe6f7('0x45')]=_[_0xe6f7('0x47')](db['User'][_0xe6f7('0x42')]);_0x21dbdd[_0xe6f7('0x46')]=_[_0xe6f7('0x47')](_0x5b4600[_0xe6f7('0x46')]);_0x21dbdd['filters']=_[_0xe6f7('0x48')](_0x21dbdd[_0xe6f7('0x45')],_0x21dbdd[_0xe6f7('0x46')]);_0x3e80a9[_0xe6f7('0x49')]=_['intersection'](_0x21dbdd[_0xe6f7('0x45')],qs[_0xe6f7('0x4a')](_0x5b4600['query'][_0xe6f7('0x4a')]));_0x3e80a9[_0xe6f7('0x49')]=_0x3e80a9[_0xe6f7('0x49')]['length']?_0x3e80a9['attributes']:_0x21dbdd[_0xe6f7('0x45')];_0x3e80a9[_0xe6f7('0x4d')]=qs['sort'](_0x5b4600['query']['sort']);_0x3e80a9['where']=qs[_0xe6f7('0x50')](_[_0xe6f7('0x51')](_0x5b4600[_0xe6f7('0x46')],_0x21dbdd[_0xe6f7('0x50')]));if(_0x5b4600[_0xe6f7('0x46')][_0xe6f7('0x52')]){_0x3e80a9[_0xe6f7('0x4f')]=_['merge'](_0x3e80a9[_0xe6f7('0x4f')],{'$or':_[_0xe6f7('0x41')](_0x3e80a9[_0xe6f7('0x49')],function(_0x527c4f){var _0x8daca3={};_0x8daca3[_0x527c4f]={'$like':'%'+_0x5b4600['query'][_0xe6f7('0x52')]+'%'};return _0x8daca3;})});}_0x3e80a9=_[_0xe6f7('0x53')]({},_0x3e80a9,_0x5b4600[_0xe6f7('0x54')]);return _0x21f030[_0xe6f7('0x12e')](_0x3e80a9);}})[_0xe6f7('0x38')](function(_0x38ca61){if(_0x38ca61){_0x37cf01=_0x38ca61[_0xe6f7('0x5d')];if(!_0x5b4600[_0xe6f7('0x46')][_0xe6f7('0x4b')](_0xe6f7('0x4c'))){_0x3e80a9[_0xe6f7('0x2d')]=qs[_0xe6f7('0x2d')](_0x5b4600[_0xe6f7('0x46')]['limit']);_0x3e80a9[_0xe6f7('0x2f')]=qs[_0xe6f7('0x2f')](_0x5b4600['query'][_0xe6f7('0x2f')]);}return _0x21f030['getAgents'](_0x3e80a9);}})[_0xe6f7('0x38')](function(_0x2ca6ec){if(_0x2ca6ec){return _0x2ca6ec?{'count':_0x37cf01,'rows':_0x2ca6ec}:null;}})['then'](respondWithResult(_0x266d1e,null))[_0xe6f7('0x5a')](handleError(_0x266d1e,null));};
\ No newline at end of file
index 2eef312..9f669de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0911=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x478e11,_0x73c8b5){var _0x2ef868=function(_0x2b581c){while(--_0x2b581c){_0x478e11['push'](_0x478e11['shift']());}};_0x2ef868(++_0x73c8b5);}(_0x0911,0x1a9));var _0x1091=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x0911[_0x412c8f];return _0x27c005;};'use strict';var EventEmitter=require(_0x1091('0x0'));var ChatWebsite=require(_0x1091('0x1'))['db'][_0x1091('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1091('0x3')](0x0);var events={'afterCreate':_0x1091('0x4'),'afterUpdate':'update','afterDestroy':_0x1091('0x5')};function emitEvent(_0x580aa2){return function(_0x3a71a4,_0x58640b,_0x26a1a5){ChatWebsiteEvents[_0x1091('0x6')](_0x580aa2+':'+_0x3a71a4['id'],_0x3a71a4);ChatWebsiteEvents[_0x1091('0x6')](_0x580aa2,_0x3a71a4);_0x26a1a5(null);};}for(var e in events){if(events[_0x1091('0x7')](e)){var event=events[e];ChatWebsite[_0x1091('0x8')](e,emitEvent(event));}}module[_0x1091('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1fdc=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x249aea,_0x49ddc3){var _0x5d282f=function(_0x45e796){while(--_0x45e796){_0x249aea['push'](_0x249aea['shift']());}};_0x5d282f(++_0x49ddc3);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0x1fdc[_0x1fc4e2];return _0x2ba184;};'use strict';var EventEmitter=require(_0xc1fd('0x0'));var ChatWebsite=require(_0xc1fd('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc1fd('0x2')](0x0);var events={'afterCreate':_0xc1fd('0x3'),'afterUpdate':_0xc1fd('0x4'),'afterDestroy':_0xc1fd('0x5')};function emitEvent(_0x2218db){return function(_0x7fe059,_0x259024,_0x57b96f){ChatWebsiteEvents[_0xc1fd('0x6')](_0x2218db+':'+_0x7fe059['id'],_0x7fe059);ChatWebsiteEvents[_0xc1fd('0x6')](_0x2218db,_0x7fe059);_0x57b96f(null);};}for(var e in events){if(events[_0xc1fd('0x7')](e)){var event=events[e];ChatWebsite[_0xc1fd('0x8')](e,emitEvent(event));}}module[_0xc1fd('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
index f518865..9d81cca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1aa=['lodash','util','moment','bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites'];(function(_0x394cc7,_0x1ceb7c){var _0x126d16=function(_0xb5e36){while(--_0xb5e36){_0x394cc7['push'](_0x394cc7['shift']());}};_0x126d16(++_0x1ceb7c);}(_0xa1aa,0xf2));var _0xaa1a=function(_0x3c805d,_0x4e19f3){_0x3c805d=_0x3c805d-0x0;var _0x3b7fb7=_0xa1aa[_0x3c805d];return _0x3b7fb7;};'use strict';var _=require(_0xaa1a('0x0'));var util=require(_0xaa1a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa1a('0x2'));var BPromise=require(_0xaa1a('0x3'));var rp=require(_0xaa1a('0x4'));var fs=require('fs');var path=require(_0xaa1a('0x5'));var rimraf=require(_0xaa1a('0x6'));var config=require('../../config/environment');var attributes=require(_0xaa1a('0x7'));module[_0xaa1a('0x8')]=function(_0x59cdd2,_0x865577){return _0x59cdd2['define'](_0xaa1a('0x9'),attributes,{'tableName':_0xaa1a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9b5=['ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe9b5,0x1ba));var _0x5e9b=function(_0x47698,_0x4b4c01){_0x47698=_0x47698-0x0;var _0x11bc38=_0xe9b5[_0x47698];return _0x11bc38;};'use strict';var _=require('lodash');var util=require(_0x5e9b('0x0'));var logger=require(_0x5e9b('0x1'))(_0x5e9b('0x2'));var moment=require(_0x5e9b('0x3'));var BPromise=require(_0x5e9b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e9b('0x5'));var config=require(_0x5e9b('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x5e9b('0x7')]=function(_0x45257f,_0x28258a){return _0x45257f[_0x5e9b('0x8')](_0x5e9b('0x9'),attributes,{'tableName':_0x5e9b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d04b1a1..5230294 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe109=['info','ChatWebsite,\x20%s,\x20%s','debug','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then'];(function(_0x1a36ca,_0x2efcac){var _0x43f2f8=function(_0x610aab){while(--_0x610aab){_0x1a36ca['push'](_0x1a36ca['shift']());}};_0x43f2f8(++_0x2efcac);}(_0xe109,0x10f));var _0x9e10=function(_0x294e75,_0x58a48e){_0x294e75=_0x294e75-0x0;var _0x3da666=_0xe109[_0x294e75];return _0x3da666;};'use strict';var _=require(_0x9e10('0x0'));var util=require('util');var moment=require(_0x9e10('0x1'));var BPromise=require(_0x9e10('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e10('0x3'));var db=require(_0x9e10('0x4'))['db'];var utils=require(_0x9e10('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9e10('0x6')][_0x9e10('0x7')]({'port':0x232a});config[_0x9e10('0x8')]=_[_0x9e10('0x9')](config['redis'],{'host':_0x9e10('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e10('0x8')]));require(_0x9e10('0xb'))[_0x9e10('0xc')](socket);function respondWithRpcPromise(_0x2ad161,_0x24c297,_0x4788ca){return new BPromise(function(_0x5c942f,_0x52acef){return client[_0x9e10('0xd')](_0x2ad161,_0x4788ca)[_0x9e10('0xe')](function(_0x943c91){logger[_0x9e10('0xf')](_0x9e10('0x10'),_0x24c297,'request\x20sent');logger[_0x9e10('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x24c297,'request\x20sent',JSON['stringify'](_0x943c91));if(_0x943c91[_0x9e10('0x12')]){if(_0x943c91['error'][_0x9e10('0x13')]===0x1f4){logger['error'](_0x9e10('0x10'),_0x24c297,_0x943c91[_0x9e10('0x12')][_0x9e10('0x14')]);return _0x52acef(_0x943c91['error'][_0x9e10('0x14')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x24c297,_0x943c91['error'][_0x9e10('0x14')]);return _0x5c942f(_0x943c91['error'][_0x9e10('0x14')]);}else{logger[_0x9e10('0xf')](_0x9e10('0x10'),_0x24c297,'request\x20sent');_0x5c942f(_0x943c91[_0x9e10('0x15')][_0x9e10('0x14')]);}})['catch'](function(_0x4ad003){logger[_0x9e10('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x24c297,_0x4ad003);_0x52acef(_0x4ad003);});});}
\ No newline at end of file
+var _0xe4d2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x4c4683,_0x241657){var _0x78ee7e=function(_0x4c9489){while(--_0x4c9489){_0x4c4683['push'](_0x4c4683['shift']());}};_0x78ee7e(++_0x241657);}(_0xe4d2,0x13d));var _0x2e4d=function(_0xb47e97,_0x1c9b7b){_0xb47e97=_0xb47e97-0x0;var _0x3dc310=_0xe4d2[_0xb47e97];return _0x3dc310;};'use strict';var _=require(_0x2e4d('0x0'));var util=require(_0x2e4d('0x1'));var moment=require(_0x2e4d('0x2'));var BPromise=require(_0x2e4d('0x3'));var rs=require(_0x2e4d('0x4'));var fs=require('fs');var Redis=require(_0x2e4d('0x5'));var db=require(_0x2e4d('0x6'))['db'];var utils=require(_0x2e4d('0x7'));var logger=require(_0x2e4d('0x8'))(_0x2e4d('0x9'));var config=require(_0x2e4d('0xa'));var jayson=require(_0x2e4d('0xb'));var client=jayson[_0x2e4d('0xc')][_0x2e4d('0xd')]({'port':0x232a});config[_0x2e4d('0xe')]=_[_0x2e4d('0xf')](config[_0x2e4d('0xe')],{'host':_0x2e4d('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e4d('0xe')]));require(_0x2e4d('0x11'))['register'](socket);function respondWithRpcPromise(_0x1c3694,_0x3050cf,_0x45d7c8){return new BPromise(function(_0x300610,_0x45a95b){return client[_0x2e4d('0x12')](_0x1c3694,_0x45d7c8)[_0x2e4d('0x13')](function(_0x1c4750){logger[_0x2e4d('0x14')](_0x2e4d('0x15'),_0x3050cf,_0x2e4d('0x16'));logger['debug'](_0x2e4d('0x17'),_0x3050cf,_0x2e4d('0x16'),JSON[_0x2e4d('0x18')](_0x1c4750));if(_0x1c4750['error']){if(_0x1c4750['error']['code']===0x1f4){logger[_0x2e4d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3050cf,_0x1c4750[_0x2e4d('0x19')]['message']);return _0x45a95b(_0x1c4750[_0x2e4d('0x19')]['message']);}logger[_0x2e4d('0x19')](_0x2e4d('0x15'),_0x3050cf,_0x1c4750[_0x2e4d('0x19')][_0x2e4d('0x1a')]);return _0x300610(_0x1c4750[_0x2e4d('0x19')][_0x2e4d('0x1a')]);}else{logger[_0x2e4d('0x14')](_0x2e4d('0x15'),_0x3050cf,_0x2e4d('0x16'));_0x300610(_0x1c4750[_0x2e4d('0x1b')][_0x2e4d('0x1a')]);}})[_0x2e4d('0x1c')](function(_0x53d6cf){logger[_0x2e4d('0x19')](_0x2e4d('0x15'),_0x3050cf,_0x53d6cf);_0x45a95b(_0x53d6cf);});});}
\ No newline at end of file
index 05fd946..c60b921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8806=['register','chatWebsite:','./chatWebsite.events','save','remove','update','removeListener'];(function(_0x5f3f46,_0x2ed6ae){var _0x3e94d6=function(_0x124988){while(--_0x124988){_0x5f3f46['push'](_0x5f3f46['shift']());}};_0x3e94d6(++_0x2ed6ae);}(_0x8806,0x14b));var _0x6880=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x8806[_0x36ed48];return _0x51c63a;};'use strict';var ChatWebsiteEvents=require(_0x6880('0x0'));var events=[_0x6880('0x1'),_0x6880('0x2'),_0x6880('0x3')];function createListener(_0x3a6778,_0x2685b7){return function(_0x246a7b){_0x2685b7['emit'](_0x3a6778,_0x246a7b);};}function removeListener(_0x5ce6e3,_0x3de5b5){return function(){ChatWebsiteEvents[_0x6880('0x4')](_0x5ce6e3,_0x3de5b5);};}exports[_0x6880('0x5')]=function(_0x410825){for(var _0x330655=0x0,_0x53c047=events['length'];_0x330655<_0x53c047;_0x330655++){var _0x5c4fce=events[_0x330655];var _0x4d243e=createListener(_0x6880('0x6')+_0x5c4fce,_0x410825);ChatWebsiteEvents['on'](_0x5c4fce,_0x4d243e);}};
\ No newline at end of file
+var _0x3e45=['update','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x3ea6b4,_0x4572d1){var _0x2ccfb6=function(_0x1e27fc){while(--_0x1e27fc){_0x3ea6b4['push'](_0x3ea6b4['shift']());}};_0x2ccfb6(++_0x4572d1);}(_0x3e45,0x18a));var _0x53e4=function(_0x157902,_0x5e645b){_0x157902=_0x157902-0x0;var _0x35c56a=_0x3e45[_0x157902];return _0x35c56a;};'use strict';var ChatWebsiteEvents=require(_0x53e4('0x0'));var events=['save',_0x53e4('0x1'),_0x53e4('0x2')];function createListener(_0x22bb8a,_0x290556){return function(_0x1040ae){_0x290556['emit'](_0x22bb8a,_0x1040ae);};}function removeListener(_0x18bd8d,_0x4128a4){return function(){ChatWebsiteEvents['removeListener'](_0x18bd8d,_0x4128a4);};}exports[_0x53e4('0x3')]=function(_0x8243aa){for(var _0x4957c4=0x0,_0x2b04b1=events[_0x53e4('0x4')];_0x4957c4<_0x2b04b1;_0x4957c4++){var _0x6c82a3=events[_0x4957c4];var _0xd57d03=createListener(_0x53e4('0x5')+_0x6c82a3,_0x8243aa);ChatWebsiteEvents['on'](_0x6c82a3,_0xd57d03);}};
\ No newline at end of file
index 8bb13e3..8c07dc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6c0=['originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','replace','/:id/offline','offline','addProactiveActions','update','delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','post','create','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now'];(function(_0x178d92,_0xc6fd47){var _0x1d8463=function(_0x148fdc){while(--_0x148fdc){_0x178d92['push'](_0x178d92['shift']());}};_0x1d8463(++_0xc6fd47);}(_0xa6c0,0xd9));var _0x0a6c=function(_0x6824ad,_0x13768a){_0x6824ad=_0x6824ad-0x0;var _0x2b18a9=_0xa6c0[_0x6824ad];return _0x2b18a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a6c('0x0'));var timeout=require(_0x0a6c('0x1'));var express=require(_0x0a6c('0x2'));var router=express[_0x0a6c('0x3')]();var fs_extra=require(_0x0a6c('0x4'));var auth=require(_0x0a6c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a6c('0x6'));router[_0x0a6c('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a6c('0x8')]);router[_0x0a6c('0x7')](_0x0a6c('0x9'),auth['isAuthenticated'](),controller[_0x0a6c('0xa')]);router['get'](_0x0a6c('0xb'),auth[_0x0a6c('0xc')](),controller['show']);router['get'](_0x0a6c('0xd'),auth[_0x0a6c('0xc')](),controller['getDispositions']);router['get'](_0x0a6c('0xe'),auth[_0x0a6c('0xc')](),controller['getAnswers']);router[_0x0a6c('0x7')](_0x0a6c('0xf'),controller[_0x0a6c('0x10')]);router[_0x0a6c('0x7')](_0x0a6c('0x11'),controller[_0x0a6c('0x12')]);router[_0x0a6c('0x7')](_0x0a6c('0x13'),controller[_0x0a6c('0x14')]);router[_0x0a6c('0x7')](_0x0a6c('0x15'),controller['getSystemAvatar']);router['get'](_0x0a6c('0x16'),auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x17')]);router[_0x0a6c('0x7')](_0x0a6c('0x18'),controller[_0x0a6c('0x19')]);router[_0x0a6c('0x7')](_0x0a6c('0x1a'),auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x1b')]);router[_0x0a6c('0x7')](_0x0a6c('0x1c'),auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x1d')]);router[_0x0a6c('0x7')]('/:id/fields',controller[_0x0a6c('0x1e')]);router[_0x0a6c('0x7')]('/:id/offline_messages',auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x1f')]);router[_0x0a6c('0x7')](_0x0a6c('0x20'),auth[_0x0a6c('0xc')](),controller['getAgents']);router[_0x0a6c('0x21')]('/',auth['isAuthenticated'](),controller[_0x0a6c('0x22')]);router[_0x0a6c('0x21')](_0x0a6c('0xd'),auth[_0x0a6c('0xc')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x23')]);var upload=multer({'storage':multer[_0x0a6c('0x24')]({'destination':function(_0x5918ea,_0x592900,_0x2cb652){_0x2cb652(null,path[_0x0a6c('0x25')](config[_0x0a6c('0x26')],_0x0a6c('0x27')));},'filename':function(_0x1adb97,_0x52b536,_0x13914f){_0x13914f(null,util[_0x0a6c('0x28')](_0x0a6c('0x29'),Date[_0x0a6c('0x2a')](),_0x52b536[_0x0a6c('0x2b')]));}})});router[_0x0a6c('0x21')](_0x0a6c('0xf'),upload[_0x0a6c('0x2c')](_0x0a6c('0x2d')),controller[_0x0a6c('0x2e')]);var upload=multer({'storage':multer[_0x0a6c('0x24')]({'destination':function(_0x4b5553,_0x336de7,_0x5b1319){_0x5b1319(null,path[_0x0a6c('0x25')](config[_0x0a6c('0x26')],_0x0a6c('0x2f')));},'filename':function(_0x210151,_0xf6ccee,_0x5b3f3a){_0x5b3f3a(null,util['format']('%s-%s',Date['now'](),_0xf6ccee['originalname']));}})});router['post'](_0x0a6c('0x11'),upload[_0x0a6c('0x2c')](_0x0a6c('0x2d')),controller[_0x0a6c('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x271849,_0x3cb992,_0x249257){_0x249257(null,path[_0x0a6c('0x25')](config[_0x0a6c('0x26')],_0x0a6c('0x2f')));},'filename':function(_0x324b4b,_0x1cfb46,_0x3bfb71){_0x3bfb71(null,util[_0x0a6c('0x28')](_0x0a6c('0x29'),Date['now'](),_0x1cfb46['originalname']));}})});router[_0x0a6c('0x21')](_0x0a6c('0x13'),upload[_0x0a6c('0x2c')](_0x0a6c('0x2d')),controller[_0x0a6c('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2d40ee,_0x160a73,_0x10cb59){_0x10cb59(null,path[_0x0a6c('0x25')](config[_0x0a6c('0x26')],_0x0a6c('0x2f')));},'filename':function(_0x219200,_0x58c0a7,_0x659d38){_0x659d38(null,util['format'](_0x0a6c('0x29'),Date[_0x0a6c('0x2a')](),_0x58c0a7[_0x0a6c('0x2b')]));}})});router['post'](_0x0a6c('0x15'),upload['single'](_0x0a6c('0x2d')),controller[_0x0a6c('0x32')]);router[_0x0a6c('0x21')](_0x0a6c('0x33'),controller[_0x0a6c('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x0a6c('0x24')]({'destination':function(_0x41e4e6,_0x3d67af,_0x5ec6bd){const _0x4f5628=path['join'](config[_0x0a6c('0x26')],_0x0a6c('0x35'),_0x0a6c('0x36'),'offline-chat');fs_extra['ensureDir'](_0x4f5628,function(){_0x5ec6bd(null,_0x4f5628);});},'filename':function(_0x5be2fe,_0x577f70,_0x2a9d50){const _0x4790d8=_0x577f70[_0x0a6c('0x2b')][_0x0a6c('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x30b9b1=path['extname'](_0x4790d8);const _0x25d432=Date['now']()+'-'+_0x4790d8[_0x0a6c('0x37')](_0x30b9b1,'')+_0x30b9b1;_0x2a9d50(null,_0x25d432);}})});router['post'](_0x0a6c('0x38'),offlineUploadMulter['any'](),controller[_0x0a6c('0x39')]);router[_0x0a6c('0x21')](_0x0a6c('0x16'),auth[_0x0a6c('0xc')](),controller['addInteraction']);router['post'](_0x0a6c('0x1a'),auth[_0x0a6c('0xc')](),controller['addApplications']);router[_0x0a6c('0x21')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x0a6c('0x3a')]);router[_0x0a6c('0x21')](_0x0a6c('0x20'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x0a6c('0xb'),auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x3b')]);router[_0x0a6c('0x3c')]('/:id',auth[_0x0a6c('0xc')](),controller['destroy']);router[_0x0a6c('0x3c')](_0x0a6c('0xd'),auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x3d')]);router[_0x0a6c('0x3c')]('/:id/canned_answers',auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x3e')]);router['delete'](_0x0a6c('0x20'),auth[_0x0a6c('0xc')](),controller[_0x0a6c('0x3f')]);module[_0x0a6c('0x40')]=router;
\ No newline at end of file
+var _0x4e31=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','originalname','/:id/logo','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','now','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports'];(function(_0x281d28,_0x27ae5b){var _0x227e41=function(_0x4b39cb){while(--_0x4b39cb){_0x281d28['push'](_0x281d28['shift']());}};_0x227e41(++_0x27ae5b);}(_0x4e31,0xde));var _0x14e3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4e31[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x14e3('0x0'));var path=require(_0x14e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x14e3('0x2'));var router=express[_0x14e3('0x3')]();var fs_extra=require(_0x14e3('0x4'));var auth=require(_0x14e3('0x5'));var interaction=require(_0x14e3('0x6'));var config=require(_0x14e3('0x7'));var controller=require(_0x14e3('0x8'));router['get']('/',auth[_0x14e3('0x9')](),controller[_0x14e3('0xa')]);router[_0x14e3('0xb')](_0x14e3('0xc'),auth[_0x14e3('0x9')](),controller[_0x14e3('0xd')]);router[_0x14e3('0xb')](_0x14e3('0xe'),auth[_0x14e3('0x9')](),controller[_0x14e3('0xf')]);router[_0x14e3('0xb')](_0x14e3('0x10'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x11')]);router[_0x14e3('0xb')]('/:id/canned_answers',auth[_0x14e3('0x9')](),controller[_0x14e3('0x12')]);router[_0x14e3('0xb')]('/:id/logo',controller['getLogo']);router['get'](_0x14e3('0x13'),controller[_0x14e3('0x14')]);router[_0x14e3('0xb')](_0x14e3('0x15'),controller[_0x14e3('0x16')]);router[_0x14e3('0xb')](_0x14e3('0x17'),controller['getSystemAvatar']);router[_0x14e3('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x14e3('0x18')]);router[_0x14e3('0xb')](_0x14e3('0x19'),controller[_0x14e3('0x1a')]);router[_0x14e3('0xb')](_0x14e3('0x1b'),auth['isAuthenticated'](),controller[_0x14e3('0x1c')]);router[_0x14e3('0xb')](_0x14e3('0x1d'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x1e')]);router[_0x14e3('0xb')]('/:id/fields',controller[_0x14e3('0x1f')]);router[_0x14e3('0xb')]('/:id/offline_messages',auth[_0x14e3('0x9')](),controller[_0x14e3('0x20')]);router['get'](_0x14e3('0x21'),auth['isAuthenticated'](),controller[_0x14e3('0x22')]);router[_0x14e3('0x23')]('/',auth[_0x14e3('0x9')](),controller[_0x14e3('0x24')]);router['post'](_0x14e3('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x14e3('0x23')](_0x14e3('0x25'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x531256,_0x531359,_0x2e1b92){_0x2e1b92(null,path[_0x14e3('0x27')](config[_0x14e3('0x28')],_0x14e3('0x29')));},'filename':function(_0x530c05,_0x358c40,_0xb165ad){_0xb165ad(null,util[_0x14e3('0x2a')]('%s-%s',Date['now'](),_0x358c40[_0x14e3('0x2b')]));}})});router[_0x14e3('0x23')](_0x14e3('0x2c'),upload[_0x14e3('0x2d')](_0x14e3('0x2e')),controller[_0x14e3('0x2f')]);var upload=multer({'storage':multer[_0x14e3('0x30')]({'destination':function(_0x1167aa,_0x146625,_0xd6dad0){_0xd6dad0(null,path[_0x14e3('0x27')](config['root'],_0x14e3('0x31')));},'filename':function(_0x3a7ebe,_0x4bcdfa,_0xe7edcd){_0xe7edcd(null,util[_0x14e3('0x2a')](_0x14e3('0x32'),Date[_0x14e3('0x33')](),_0x4bcdfa[_0x14e3('0x2b')]));}})});router['post'](_0x14e3('0x13'),upload[_0x14e3('0x2d')](_0x14e3('0x2e')),controller[_0x14e3('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48dfd0,_0x5461a9,_0x4309bb){_0x4309bb(null,path['join'](config[_0x14e3('0x28')],_0x14e3('0x31')));},'filename':function(_0x4a14fe,_0x35ff0f,_0x5595a8){_0x5595a8(null,util['format'](_0x14e3('0x32'),Date[_0x14e3('0x33')](),_0x35ff0f['originalname']));}})});router['post']('/:id/customer_avatar',upload['single'](_0x14e3('0x2e')),controller[_0x14e3('0x35')]);var upload=multer({'storage':multer[_0x14e3('0x30')]({'destination':function(_0x544fb9,_0x1d6f6a,_0x3d0eb1){_0x3d0eb1(null,path['join'](config[_0x14e3('0x28')],'server/files/images/avatars/'));},'filename':function(_0x3469d1,_0x4d59a4,_0x41b46e){_0x41b46e(null,util[_0x14e3('0x2a')](_0x14e3('0x32'),Date[_0x14e3('0x33')](),_0x4d59a4[_0x14e3('0x2b')]));}})});router[_0x14e3('0x23')](_0x14e3('0x17'),upload['single'](_0x14e3('0x2e')),controller[_0x14e3('0x36')]);router[_0x14e3('0x23')](_0x14e3('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x14e3('0x30')]({'destination':function(_0x2fba3a,_0x5bf7e8,_0x53bf32){const _0xad759b=path['join'](config[_0x14e3('0x28')],_0x14e3('0x38'),'attachments','offline-chat');fs_extra[_0x14e3('0x39')](_0xad759b,function(){_0x53bf32(null,_0xad759b);});},'filename':function(_0x16a0f2,_0x18aff5,_0x3338a3){const _0x528e51=_0x18aff5['originalname'][_0x14e3('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1455e2=path[_0x14e3('0x3b')](_0x528e51);const _0x580ee1=Date[_0x14e3('0x33')]()+'-'+_0x528e51[_0x14e3('0x3a')](_0x1455e2,'')+_0x1455e2;_0x3338a3(null,_0x580ee1);}})});router[_0x14e3('0x23')](_0x14e3('0x3c'),offlineUploadMulter[_0x14e3('0x3d')](),controller[_0x14e3('0x3e')]);router[_0x14e3('0x23')]('/:id/interactions',auth[_0x14e3('0x9')](),controller[_0x14e3('0x3f')]);router['post']('/:id/applications',auth[_0x14e3('0x9')](),controller[_0x14e3('0x40')]);router[_0x14e3('0x23')]('/:id/proactive_actions',auth[_0x14e3('0x9')](),controller[_0x14e3('0x41')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x14e3('0x42')]);router[_0x14e3('0x43')]('/:id',auth[_0x14e3('0x9')](),controller[_0x14e3('0x44')]);router[_0x14e3('0x45')](_0x14e3('0xe'),auth['isAuthenticated'](),controller[_0x14e3('0x46')]);router['delete']('/:id/dispositions',auth[_0x14e3('0x9')](),controller[_0x14e3('0x47')]);router[_0x14e3('0x45')](_0x14e3('0x25'),auth[_0x14e3('0x9')](),controller[_0x14e3('0x48')]);router[_0x14e3('0x45')]('/:id/users',auth[_0x14e3('0x9')](),controller['removeAgents']);module[_0x14e3('0x49')]=router;
\ No newline at end of file
index bf347ef..48ba2fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f7a=['Google','sequelize','exports','STRING','ENUM'];(function(_0x5c306e,_0x2751c1){var _0x1a26e4=function(_0x2f8201){while(--_0x2f8201){_0x5c306e['push'](_0x5c306e['shift']());}};_0x1a26e4(++_0x2751c1);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x9f7a[_0x50aa2e];return _0x5e07f0;};'use strict';var Sequelize=require(_0xa9f7('0x0'));module[_0xa9f7('0x1')]={'name':{'type':Sequelize[_0xa9f7('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa9f7('0x3')]('AmazonAWS',_0xa9f7('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0adf=['Google','sequelize','exports','STRING','AmazonAWS'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x36d761,_0x4b990d){_0x36d761=_0x36d761-0x0;var _0x557f89=_0x0adf[_0x36d761];return _0x557f89;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xf0ad('0x3'),_0xf0ad('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf0ad('0x2')]},'data2':{'type':Sequelize[_0xf0ad('0x2')]}};
\ No newline at end of file
index 7a9112d..5ff999d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x3be426,_0x2df1b5){var _0x4389e1=function(_0x4f1fe3){while(--_0x4f1fe3){_0x3be426['push'](_0x3be426['shift']());}};_0x4389e1(++_0x2df1b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x0b0e[_0x28014d];return _0x2572cc;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x17b14a,_0x107e50){var _0xad4dcd=function(_0x4b273e){while(--_0x4b273e){_0x17b14a['push'](_0x17b14a['shift']());}};_0xad4dcd(++_0x107e50);}(_0x2ef3,0xba));var _0x32ef=function(_0x4e11bd,_0x2f09f1){_0x4e11bd=_0x4e11bd-0x0;var _0x4ab61=_0x2ef3[_0x4e11bd];return _0x4ab61;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
index b9916c2..7bd11d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc62a=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xc62a,0x1b8));var _0xac62=function(_0xe9a8ad,_0x208d9a){_0xe9a8ad=_0xe9a8ad-0x0;var _0x1c806f=_0xc62a[_0xe9a8ad];return _0x1c806f;};'use strict';var _=require(_0xac62('0x0'));var util=require(_0xac62('0x1'));var logger=require(_0xac62('0x2'))(_0xac62('0x3'));var moment=require('moment');var BPromise=require(_0xac62('0x4'));var rp=require(_0xac62('0x5'));var fs=require('fs');var path=require(_0xac62('0x6'));var rimraf=require(_0xac62('0x7'));var config=require(_0xac62('0x8'));var attributes=require(_0xac62('0x9'));module['exports']=function(_0x45c1b8,_0x5e58ba){return _0x45c1b8['define'](_0xac62('0xa'),attributes,{'tableName':_0xac62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2e54=['rimraf','../../config/environment','exports','define','CloudProvider','util','../../config/logger','bluebird','request-promise','path'];(function(_0x203664,_0x1536a4){var _0x992217=function(_0x13e657){while(--_0x13e657){_0x203664['push'](_0x203664['shift']());}};_0x992217(++_0x1536a4);}(_0x2e54,0x177));var _0x42e5=function(_0x565ad7,_0x103661){_0x565ad7=_0x565ad7-0x0;var _0x3a9ab6=_0x2e54[_0x565ad7];return _0x3a9ab6;};'use strict';var _=require('lodash');var util=require(_0x42e5('0x0'));var logger=require(_0x42e5('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42e5('0x2'));var rp=require(_0x42e5('0x3'));var fs=require('fs');var path=require(_0x42e5('0x4'));var rimraf=require(_0x42e5('0x5'));var config=require(_0x42e5('0x6'));var attributes=require('./cloudProvider.attributes');module[_0x42e5('0x7')]=function(_0x39ce44,_0x48ed00){return _0x39ce44[_0x42e5('0x8')](_0x42e5('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a56a545..ff1b1c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa817=['../../config/environment','jayson/promise','http','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x541636,_0x4ed05c){var _0x5bff7a=function(_0x3f6531){while(--_0x3f6531){_0x541636['push'](_0x541636['shift']());}};_0x5bff7a(++_0x4ed05c);}(_0xa817,0x7b));var _0x7a81=function(_0x31780c,_0x34d3c5){_0x31780c=_0x31780c-0x0;var _0x5918e1=_0xa817[_0x31780c];return _0x5918e1;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35c35a,_0x3ab25c,_0x705d4e){return new BPromise(function(_0x1869fb,_0x18f6f6){return client['request'](_0x35c35a,_0x705d4e)[_0x7a81('0xc')](function(_0x5b3b66){logger['info'](_0x7a81('0xd'),_0x3ab25c,'request\x20sent');logger[_0x7a81('0xe')](_0x7a81('0xf'),_0x3ab25c,_0x7a81('0x10'),JSON[_0x7a81('0x11')](_0x5b3b66));if(_0x5b3b66[_0x7a81('0x12')]){if(_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x13')]===0x1f4){logger['error'](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x18f6f6(_0x5b3b66['error'][_0x7a81('0x14')]);}logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x1869fb(_0x5b3b66[_0x7a81('0x12')]['message']);}else{logger['info'](_0x7a81('0xd'),_0x3ab25c,_0x7a81('0x10'));_0x1869fb(_0x5b3b66['result'][_0x7a81('0x14')]);}})[_0x7a81('0x15')](function(_0x179afd){logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x179afd);_0x18f6f6(_0x179afd);});});}
\ No newline at end of file
+var _0xf5b6=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x4bdd60,_0x4ae128){var _0x2023cf=function(_0x1261f2){while(--_0x1261f2){_0x4bdd60['push'](_0x4bdd60['shift']());}};_0x2023cf(++_0x4ae128);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x467e48,_0x37186c){_0x467e48=_0x467e48-0x0;var _0xd62dbd=_0xf5b6[_0x467e48];return _0xd62dbd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f5b('0x0'));var BPromise=require(_0x6f5b('0x1'));var rs=require(_0x6f5b('0x2'));var fs=require('fs');var Redis=require(_0x6f5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f5b('0x4'));var logger=require(_0x6f5b('0x5'))(_0x6f5b('0x6'));var config=require(_0x6f5b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cf395,_0x58899e,_0x4a8fe8){return new BPromise(function(_0x437f27,_0x5b97a4){return client[_0x6f5b('0x9')](_0x5cf395,_0x4a8fe8)[_0x6f5b('0xa')](function(_0x17692b){logger['info'](_0x6f5b('0xb'),_0x58899e,'request\x20sent');logger[_0x6f5b('0xc')](_0x6f5b('0xd'),_0x58899e,_0x6f5b('0xe'),JSON[_0x6f5b('0xf')](_0x17692b));if(_0x17692b[_0x6f5b('0x10')]){if(_0x17692b['error'][_0x6f5b('0x11')]===0x1f4){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b['error']['message']);return _0x5b97a4(_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);}logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x17692b[_0x6f5b('0x10')][_0x6f5b('0x12')]);return _0x437f27(_0x17692b[_0x6f5b('0x10')]['message']);}else{logger[_0x6f5b('0x13')](_0x6f5b('0xb'),_0x58899e,'request\x20sent');_0x437f27(_0x17692b[_0x6f5b('0x14')][_0x6f5b('0x12')]);}})[_0x6f5b('0x15')](function(_0x344cf6){logger[_0x6f5b('0x10')](_0x6f5b('0xb'),_0x58899e,_0x344cf6);_0x5b97a4(_0x344cf6);});});}
\ No newline at end of file
index 9cfd558..98914ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x627d=['/:id','post','isAuthenticated','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x627d,0xc6));var _0xd627=function(_0xf7e846,_0xd4be11){_0xf7e846=_0xf7e846-0x0;var _0x5d1385=_0x627d[_0xf7e846];return _0x5d1385;};'use strict';var multer=require('multer');var util=require(_0xd627('0x0'));var path=require(_0xd627('0x1'));var timeout=require('connect-timeout');var express=require(_0xd627('0x2'));var router=express[_0xd627('0x3')]();var fs_extra=require(_0xd627('0x4'));var auth=require(_0xd627('0x5'));var interaction=require(_0xd627('0x6'));var config=require(_0xd627('0x7'));var controller=require(_0xd627('0x8'));router[_0xd627('0x9')]('/',auth['isAuthenticated'](),controller[_0xd627('0xa')]);router[_0xd627('0x9')](_0xd627('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd627('0xc')]('/',auth[_0xd627('0xd')](),controller['create']);router[_0xd627('0xe')](_0xd627('0xb'),auth[_0xd627('0xd')](),controller[_0xd627('0xf')]);router[_0xd627('0x10')](_0xd627('0xb'),auth[_0xd627('0xd')](),controller[_0xd627('0x11')]);module[_0xd627('0x12')]=router;
\ No newline at end of file
+var _0x6bf1=['create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','/:id','isAuthenticated','show','post'];(function(_0x55b815,_0x3a444c){var _0x23ffcc=function(_0x2c45f7){while(--_0x2c45f7){_0x55b815['push'](_0x55b815['shift']());}};_0x23ffcc(++_0x3a444c);}(_0x6bf1,0x71));var _0x16bf=function(_0x14d0d2,_0x2ad908){_0x14d0d2=_0x14d0d2-0x0;var _0x57b04e=_0x6bf1[_0x14d0d2];return _0x57b04e;};'use strict';var multer=require(_0x16bf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x16bf('0x1'));var express=require(_0x16bf('0x2'));var router=express[_0x16bf('0x3')]();var fs_extra=require(_0x16bf('0x4'));var auth=require(_0x16bf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x16bf('0x6'));var controller=require(_0x16bf('0x7'));router[_0x16bf('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x16bf('0x8')](_0x16bf('0x9'),auth[_0x16bf('0xa')](),controller[_0x16bf('0xb')]);router[_0x16bf('0xc')]('/',auth[_0x16bf('0xa')](),controller[_0x16bf('0xd')]);router[_0x16bf('0xe')]('/:id',auth[_0x16bf('0xa')](),controller[_0x16bf('0xf')]);router[_0x16bf('0x10')](_0x16bf('0x9'),auth[_0x16bf('0xa')](),controller[_0x16bf('0x11')]);module['exports']=router;
\ No newline at end of file
index 356b90b..69d70b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xace3=['exports','STRING','sequelize'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xace3,0x86));var _0x3ace=function(_0x574da8,_0x5b4cb2){_0x574da8=_0x574da8-0x0;var _0x1eddaf=_0xace3[_0x574da8];return _0x1eddaf;};'use strict';var Sequelize=require(_0x3ace('0x0'));module[_0x3ace('0x1')]={'name':{'type':Sequelize[_0x3ace('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x3ace('0x2')]},'phone':{'type':Sequelize[_0x3ace('0x2')]},'fax':{'type':Sequelize[_0x3ace('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x3ace('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3ace('0x2')]},'country':{'type':Sequelize[_0x3ace('0x2')]},'email':{'type':Sequelize[_0x3ace('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3ace('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x3ace('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x3ace('0x2')]},'description':{'type':Sequelize[_0x3ace('0x2')]}};
\ No newline at end of file
+var _0x6d93=['exports','STRING','name','sequelize'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6d93,0x177));var _0x36d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d93[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x36d9('0x0'));module[_0x36d9('0x1')]={'name':{'type':Sequelize[_0x36d9('0x2')],'unique':_0x36d9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x36d9('0x2')]},'companyId':{'type':Sequelize[_0x36d9('0x2')]},'website':{'type':Sequelize[_0x36d9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x36d9('0x2')]},'type':{'type':Sequelize[_0x36d9('0x2')]},'street':{'type':Sequelize[_0x36d9('0x2')]},'postalCode':{'type':Sequelize[_0x36d9('0x2')]},'city':{'type':Sequelize[_0x36d9('0x2')]},'country':{'type':Sequelize[_0x36d9('0x2')]},'email':{'type':Sequelize[_0x36d9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x36d9('0x2')]},'sCity':{'type':Sequelize[_0x36d9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x36d9('0x2')]}};
\ No newline at end of file
index 1bf94bd..5231e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9735=['length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','end','error','stack','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes'];(function(_0x31be12,_0x5454e0){var _0x4fca25=function(_0x32f3cc){while(--_0x32f3cc){_0x31be12['push'](_0x31be12['shift']());}};_0x4fca25(++_0x5454e0);}(_0x9735,0xc2));var _0x5973=function(_0xe27ea,_0x1ab69e){_0xe27ea=_0xe27ea-0x0;var _0x48bccd=_0x9735[_0xe27ea];return _0x48bccd;};'use strict';var emlformat=require(_0x5973('0x0'));var rimraf=require(_0x5973('0x1'));var zipdir=require(_0x5973('0x2'));var jsonpatch=require(_0x5973('0x3'));var rp=require(_0x5973('0x4'));var moment=require(_0x5973('0x5'));var BPromise=require(_0x5973('0x6'));var Mustache=require(_0x5973('0x7'));var util=require('util');var path=require(_0x5973('0x8'));var sox=require('sox');var csv=require(_0x5973('0x9'));var ejs=require(_0x5973('0xa'));var fs=require('fs');var fs_extra=require(_0x5973('0xb'));var _=require(_0x5973('0xc'));var squel=require('squel');var crypto=require(_0x5973('0xd'));var jsforce=require(_0x5973('0xe'));var deskjs=require(_0x5973('0xf'));var toCsv=require(_0x5973('0x9'));var querystring=require('querystring');var Papa=require(_0x5973('0x10'));var Redis=require('ioredis');var authService=require(_0x5973('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5973('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5973('0x13'))('api');var utils=require(_0x5973('0x14'));var config=require(_0x5973('0x15'));var licenseUtil=require(_0x5973('0x16'));var db=require(_0x5973('0x17'))['db'];function respondWithStatusCode(_0x3b9dc9,_0x4bab30){_0x4bab30=_0x4bab30||0xcc;return function(_0x504535){if(_0x504535){return _0x3b9dc9[_0x5973('0x18')](_0x4bab30);}return _0x3b9dc9[_0x5973('0x19')](_0x4bab30)['end']();};}function respondWithResult(_0x594560,_0x43b17c){_0x43b17c=_0x43b17c||0xc8;return function(_0x69b4b2){if(_0x69b4b2){return _0x594560[_0x5973('0x19')](_0x43b17c)[_0x5973('0x1a')](_0x69b4b2);}};}function respondWithFilteredResult(_0x4083f6,_0x2fb259){return function(_0x4b4394){if(_0x4b4394){var _0x5330e2=typeof _0x2fb259[_0x5973('0x1b')]===_0x5973('0x1c')&&typeof _0x2fb259[_0x5973('0x1d')]===_0x5973('0x1c');var _0x493d80=_0x4b4394['count'];var _0x26a179=_0x5330e2?0x0:_0x2fb259['offset'];var _0x4221e0=_0x5330e2?_0x4b4394[_0x5973('0x1e')]:_0x2fb259[_0x5973('0x1b')]+_0x2fb259[_0x5973('0x1d')];var _0x1af1e0;if(_0x4221e0>=_0x493d80){_0x4221e0=_0x493d80;_0x1af1e0=0xc8;}else{_0x1af1e0=0xce;}_0x4083f6[_0x5973('0x19')](_0x1af1e0);return _0x4083f6[_0x5973('0x1f')](_0x5973('0x20'),_0x26a179+'-'+_0x4221e0+'/'+_0x493d80)[_0x5973('0x1a')](_0x4b4394);}return null;};}function patchUpdates(_0x26accb){return function(_0x4b982d){try{jsonpatch['apply'](_0x4b982d,_0x26accb,!![]);}catch(_0xf3c5e1){return BPromise[_0x5973('0x21')](_0xf3c5e1);}return _0x4b982d['save']();};}function saveUpdates(_0x1adc9d,_0x12a627){return function(_0x4e02be){if(_0x4e02be){return _0x4e02be[_0x5973('0x22')](_0x1adc9d)[_0x5973('0x23')](function(_0x2a0b85){return _0x2a0b85;});}return null;};}function removeEntity(_0x1823b3,_0x31d6f0){return function(_0x487b7f){if(_0x487b7f){return _0x487b7f[_0x5973('0x24')]()[_0x5973('0x23')](function(){var _0x1ccaf3=_0x487b7f[_0x5973('0x25')]({'plain':!![]});var _0x36dfee=_0x5973('0x26');return db[_0x5973('0x27')][_0x5973('0x24')]({'where':{'type':_0x36dfee,'resourceId':_0x1ccaf3['id']}})[_0x5973('0x23')](function(){return _0x487b7f;});})['then'](function(){_0x1823b3[_0x5973('0x19')](0xcc)[_0x5973('0x28')]();});}};}function handleEntityNotFound(_0x15125b,_0x337a6a){return function(_0x2069dc){if(!_0x2069dc){_0x15125b[_0x5973('0x18')](0x194);}return _0x2069dc;};}function handleError(_0x151775,_0x520b0d){_0x520b0d=_0x520b0d||0x1f4;return function(_0x54d283){logger[_0x5973('0x29')](_0x54d283[_0x5973('0x2a')]);if(_0x54d283[_0x5973('0x2b')]){delete _0x54d283[_0x5973('0x2b')];}_0x151775['status'](_0x520b0d)[_0x5973('0x2c')](_0x54d283);};}exports['index']=function(_0x4a84ac,_0x4d315b){var _0x3ccb21={},_0x79be14={},_0x49efe1={'count':0x0,'rows':[]};return db[_0x5973('0x2d')][_0x5973('0x2e')]()['then'](function(_0x151c83){_0x79be14[_0x5973('0x2f')]=_[_0x5973('0x30')](_0x151c83);_0x79be14[_0x5973('0x31')]=_['keys'](_0x4a84ac[_0x5973('0x31')]);_0x79be14['filters']=_[_0x5973('0x32')](_0x79be14[_0x5973('0x2f')],_0x79be14[_0x5973('0x31')]);_0x3ccb21[_0x5973('0x33')]=_[_0x5973('0x32')](_0x79be14['model'],qs[_0x5973('0x34')](_0x4a84ac[_0x5973('0x31')][_0x5973('0x34')]));_0x3ccb21[_0x5973('0x33')]=_0x3ccb21['attributes']['length']?_0x3ccb21[_0x5973('0x33')]:_0x79be14[_0x5973('0x2f')];if(!_0x4a84ac['query'][_0x5973('0x35')](_0x5973('0x36'))){_0x3ccb21[_0x5973('0x1d')]=qs[_0x5973('0x1d')](_0x4a84ac[_0x5973('0x31')][_0x5973('0x1d')]);_0x3ccb21[_0x5973('0x1b')]=qs['offset'](_0x4a84ac['query'][_0x5973('0x1b')]);}_0x3ccb21['order']=qs[_0x5973('0x37')](_0x4a84ac[_0x5973('0x31')][_0x5973('0x37')]);_0x3ccb21[_0x5973('0x38')]=qs['filters'](_[_0x5973('0x39')](_0x4a84ac[_0x5973('0x31')],_0x79be14[_0x5973('0x3a')]),_0x151c83);if(_0x4a84ac[_0x5973('0x31')][_0x5973('0x3b')]){_0x3ccb21['where']=_[_0x5973('0x3c')](_0x3ccb21[_0x5973('0x38')],{'$or':_[_0x5973('0x3d')](_0x3ccb21[_0x5973('0x33')],function(_0xed6511){var _0x46a78f={};_0x46a78f[_0xed6511]={'$like':'%'+_0x4a84ac[_0x5973('0x31')]['filter']+'%'};return _0x46a78f;})});}_0x3ccb21=_[_0x5973('0x3c')]({},_0x3ccb21,_0x4a84ac[_0x5973('0x3e')]);var _0x26c973={'where':_0x3ccb21[_0x5973('0x38')]};return db[_0x5973('0x2d')][_0x5973('0x1e')](_0x26c973)['then'](function(_0xe2188b){_0x49efe1['count']=_0xe2188b;if(_0x4a84ac[_0x5973('0x31')][_0x5973('0x3f')]){_0x3ccb21[_0x5973('0x40')]=[{'all':!![]}];}return db[_0x5973('0x2d')]['findAll'](_0x3ccb21);})[_0x5973('0x23')](function(_0x191de5){_0x49efe1[_0x5973('0x41')]=_0x191de5;return _0x49efe1;})[_0x5973('0x23')](respondWithFilteredResult(_0x4d315b,_0x3ccb21))[_0x5973('0x42')](handleError(_0x4d315b,null));})[_0x5973('0x42')](handleError(_0x4d315b,null));};exports[_0x5973('0x43')]=function(_0x8adf0c,_0x569630){var _0x6e1f5c={'raw':![],'where':{'id':_0x8adf0c[_0x5973('0x44')]['id']}},_0x545abf={};_0x545abf['model']=_[_0x5973('0x30')](db[_0x5973('0x2d')][_0x5973('0x45')]);_0x545abf['query']=_[_0x5973('0x30')](_0x8adf0c[_0x5973('0x31')]);_0x545abf[_0x5973('0x3a')]=_[_0x5973('0x32')](_0x545abf[_0x5973('0x2f')],_0x545abf[_0x5973('0x31')]);_0x6e1f5c[_0x5973('0x33')]=_[_0x5973('0x32')](_0x545abf['model'],qs['fields'](_0x8adf0c[_0x5973('0x31')][_0x5973('0x34')]));_0x6e1f5c['attributes']=_0x6e1f5c[_0x5973('0x33')][_0x5973('0x46')]?_0x6e1f5c['attributes']:_0x545abf[_0x5973('0x2f')];if(_0x8adf0c[_0x5973('0x31')][_0x5973('0x3f')]){_0x6e1f5c[_0x5973('0x40')]=[{'all':!![]}];}_0x6e1f5c=_['merge']({},_0x6e1f5c,_0x8adf0c[_0x5973('0x3e')]);return db[_0x5973('0x2d')][_0x5973('0x47')](_0x6e1f5c)[_0x5973('0x23')](handleEntityNotFound(_0x569630,null))[_0x5973('0x23')](respondWithResult(_0x569630,null))[_0x5973('0x42')](handleError(_0x569630,null));};exports[_0x5973('0x48')]=function(_0x5350c8,_0x31ecd2){return db[_0x5973('0x2d')][_0x5973('0x48')](_0x5350c8[_0x5973('0x49')],{})[_0x5973('0x23')](function(_0x178f16){var _0x282bf4=_0x5350c8['user'][_0x5973('0x25')]({'plain':!![]});if(!_0x282bf4)throw new Error(_0x5973('0x4a'));if(_0x282bf4[_0x5973('0x4b')]===_0x5973('0x4c')){var _0x4d9070=_0x178f16[_0x5973('0x25')]({'plain':!![]});var _0x4bd204=_0x5973('0x26');return db[_0x5973('0x4d')][_0x5973('0x47')]({'where':{'name':_0x4bd204,'userProfileId':_0x282bf4[_0x5973('0x4e')]},'raw':!![]})[_0x5973('0x23')](function(_0x17996e){if(_0x17996e&&_0x17996e[_0x5973('0x4f')]===0x0){return db[_0x5973('0x27')]['create']({'name':_0x4d9070[_0x5973('0x2b')],'resourceId':_0x4d9070['id'],'type':_0x17996e[_0x5973('0x2b')],'sectionId':_0x17996e['id']},{})['then'](function(){return _0x178f16;});}else{return _0x178f16;}})[_0x5973('0x42')](function(_0x16ce66){logger[_0x5973('0x29')](_0x5973('0x50'),_0x16ce66);throw _0x16ce66;});}return _0x178f16;})[_0x5973('0x23')](respondWithResult(_0x31ecd2,0xc9))[_0x5973('0x42')](handleError(_0x31ecd2,null));};exports[_0x5973('0x22')]=function(_0x2731eb,_0x428542){if(_0x2731eb['body']['id']){delete _0x2731eb[_0x5973('0x49')]['id'];}return db[_0x5973('0x2d')]['find']({'where':{'id':_0x2731eb['params']['id']}})[_0x5973('0x23')](handleEntityNotFound(_0x428542,null))[_0x5973('0x23')](saveUpdates(_0x2731eb[_0x5973('0x49')],null))[_0x5973('0x23')](respondWithResult(_0x428542,null))[_0x5973('0x42')](handleError(_0x428542,null));};exports[_0x5973('0x24')]=function(_0x1152b1,_0xc7f69c){return db[_0x5973('0x2d')][_0x5973('0x47')]({'where':{'id':_0x1152b1['params']['id']}})[_0x5973('0x23')](handleEntityNotFound(_0xc7f69c,null))[_0x5973('0x23')](removeEntity(_0xc7f69c,null))['catch'](handleError(_0xc7f69c,null));};exports[_0x5973('0x2e')]=function(_0x155122,_0x3a8b42){return db['CmCompany'][_0x5973('0x2e')]()[_0x5973('0x23')](respondWithResult(_0x3a8b42,null))[_0x5973('0x42')](handleError(_0x3a8b42,null));};exports['addContacts']=function(_0x12bd08,_0x1544f5,_0x2993c0){return db[_0x5973('0x51')]['find']({'where':{'id':_0x12bd08[_0x5973('0x44')]['id']}})['then'](handleEntityNotFound(_0x1544f5,null))[_0x5973('0x23')](function(_0x4c80c4){if(_0x4c80c4){return _0x4c80c4[_0x5973('0x52')](_0x12bd08[_0x5973('0x49')][_0x5973('0x53')],_[_0x5973('0x54')](_0x12bd08[_0x5973('0x49')],[_0x5973('0x53'),'id'])||{});}})[_0x5973('0x23')](respondWithResult(_0x1544f5,null))[_0x5973('0x42')](handleError(_0x1544f5,null));};exports[_0x5973('0x55')]=function(_0x4732e4,_0x2da072,_0x478e20){var _0x13c3df={};var _0x941469={};var _0x5b6030;var _0x477cd8;return db[_0x5973('0x2d')][_0x5973('0x56')]({'where':{'id':_0x4732e4['params']['id']}})['then'](handleEntityNotFound(_0x2da072,null))['then'](function(_0x171a38){if(_0x171a38){_0x5b6030=_0x171a38;_0x941469[_0x5973('0x2f')]=_[_0x5973('0x30')](db[_0x5973('0x51')][_0x5973('0x45')]);_0x941469[_0x5973('0x31')]=_[_0x5973('0x30')](_0x4732e4[_0x5973('0x31')]);_0x941469['filters']=_[_0x5973('0x32')](_0x941469[_0x5973('0x2f')],_0x941469[_0x5973('0x31')]);_0x13c3df[_0x5973('0x33')]=_[_0x5973('0x32')](_0x941469[_0x5973('0x2f')],qs[_0x5973('0x34')](_0x4732e4['query'][_0x5973('0x34')]));_0x13c3df[_0x5973('0x33')]=_0x13c3df['attributes'][_0x5973('0x46')]?_0x13c3df[_0x5973('0x33')]:_0x941469[_0x5973('0x2f')];_0x13c3df[_0x5973('0x57')]=qs[_0x5973('0x37')](_0x4732e4[_0x5973('0x31')][_0x5973('0x37')]);_0x13c3df[_0x5973('0x38')]=qs[_0x5973('0x3a')](_[_0x5973('0x39')](_0x4732e4[_0x5973('0x31')],_0x941469['filters']));if(_0x4732e4[_0x5973('0x31')][_0x5973('0x3b')]){_0x13c3df[_0x5973('0x38')]=_[_0x5973('0x3c')](_0x13c3df[_0x5973('0x38')],{'$or':_['map'](_0x13c3df[_0x5973('0x33')],function(_0x44c6ea){var _0x3c743a={};_0x3c743a[_0x44c6ea]={'$like':'%'+_0x4732e4[_0x5973('0x31')][_0x5973('0x3b')]+'%'};return _0x3c743a;})});}_0x13c3df=_[_0x5973('0x3c')]({},_0x13c3df,_0x4732e4[_0x5973('0x3e')]);return _0x5b6030[_0x5973('0x55')](_0x13c3df);}})['then'](function(_0x557397){if(_0x557397){_0x477cd8=_0x557397[_0x5973('0x46')];if(!_0x4732e4[_0x5973('0x31')][_0x5973('0x35')](_0x5973('0x36'))){_0x13c3df[_0x5973('0x1d')]=qs[_0x5973('0x1d')](_0x4732e4['query'][_0x5973('0x1d')]);_0x13c3df[_0x5973('0x1b')]=qs[_0x5973('0x1b')](_0x4732e4[_0x5973('0x31')][_0x5973('0x1b')]);}return _0x5b6030[_0x5973('0x55')](_0x13c3df);}})['then'](function(_0x30cfbd){if(_0x30cfbd){return _0x30cfbd?{'count':_0x477cd8,'rows':_0x30cfbd}:null;}})[_0x5973('0x23')](respondWithResult(_0x2da072,null))[_0x5973('0x42')](handleError(_0x2da072,null));};
\ No newline at end of file
+var _0x1968=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','stack','send','index','CmCompany','describe','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','map','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','find'];(function(_0x13597a,_0xa42c9e){var _0x26f558=function(_0x5ad90e){while(--_0x5ad90e){_0x13597a['push'](_0x13597a['shift']());}};_0x26f558(++_0xa42c9e);}(_0x1968,0xbe));var _0x8196=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x1968[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x8196('0x0'));var rimraf=require(_0x8196('0x1'));var zipdir=require(_0x8196('0x2'));var jsonpatch=require(_0x8196('0x3'));var rp=require(_0x8196('0x4'));var moment=require(_0x8196('0x5'));var BPromise=require(_0x8196('0x6'));var Mustache=require(_0x8196('0x7'));var util=require('util');var path=require(_0x8196('0x8'));var sox=require(_0x8196('0x9'));var csv=require(_0x8196('0xa'));var ejs=require(_0x8196('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8196('0xc'));var squel=require(_0x8196('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8196('0xe'));var toCsv=require(_0x8196('0xa'));var querystring=require(_0x8196('0xf'));var Papa=require(_0x8196('0x10'));var Redis=require(_0x8196('0x11'));var authService=require(_0x8196('0x12'));var qs=require(_0x8196('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8196('0x14'));var logger=require(_0x8196('0x15'))(_0x8196('0x16'));var utils=require(_0x8196('0x17'));var config=require(_0x8196('0x18'));var licenseUtil=require(_0x8196('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c35c7,_0x29075e){_0x29075e=_0x29075e||0xcc;return function(_0x7952ac){if(_0x7952ac){return _0x1c35c7['sendStatus'](_0x29075e);}return _0x1c35c7[_0x8196('0x1a')](_0x29075e)[_0x8196('0x1b')]();};}function respondWithResult(_0x1fe3ce,_0x553e60){_0x553e60=_0x553e60||0xc8;return function(_0x46393f){if(_0x46393f){return _0x1fe3ce[_0x8196('0x1a')](_0x553e60)['json'](_0x46393f);}};}function respondWithFilteredResult(_0x8c97af,_0x815dcd){return function(_0x549bd5){if(_0x549bd5){var _0x3340bf=typeof _0x815dcd['offset']===_0x8196('0x1c')&&typeof _0x815dcd[_0x8196('0x1d')]===_0x8196('0x1c');var _0x289460=_0x549bd5[_0x8196('0x1e')];var _0x298dee=_0x3340bf?0x0:_0x815dcd[_0x8196('0x1f')];var _0x1e9299=_0x3340bf?_0x549bd5['count']:_0x815dcd[_0x8196('0x1f')]+_0x815dcd[_0x8196('0x1d')];var _0x1f5051;if(_0x1e9299>=_0x289460){_0x1e9299=_0x289460;_0x1f5051=0xc8;}else{_0x1f5051=0xce;}_0x8c97af[_0x8196('0x1a')](_0x1f5051);return _0x8c97af[_0x8196('0x20')](_0x8196('0x21'),_0x298dee+'-'+_0x1e9299+'/'+_0x289460)[_0x8196('0x22')](_0x549bd5);}return null;};}function patchUpdates(_0x5a1624){return function(_0x3951fa){try{jsonpatch['apply'](_0x3951fa,_0x5a1624,!![]);}catch(_0x83ce3c){return BPromise[_0x8196('0x23')](_0x83ce3c);}return _0x3951fa[_0x8196('0x24')]();};}function saveUpdates(_0x544fb0,_0x8e2ad7){return function(_0xcfc96d){if(_0xcfc96d){return _0xcfc96d[_0x8196('0x25')](_0x544fb0)[_0x8196('0x26')](function(_0x2c600a){return _0x2c600a;});}return null;};}function removeEntity(_0x455c76,_0x2b153f){return function(_0x298e7f){if(_0x298e7f){return _0x298e7f[_0x8196('0x27')]()[_0x8196('0x26')](function(){var _0x3dbc2d=_0x298e7f[_0x8196('0x28')]({'plain':!![]});var _0x565956=_0x8196('0x29');return db[_0x8196('0x2a')][_0x8196('0x27')]({'where':{'type':_0x565956,'resourceId':_0x3dbc2d['id']}})[_0x8196('0x26')](function(){return _0x298e7f;});})['then'](function(){_0x455c76[_0x8196('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x802568,_0x30cff2){return function(_0x596ac9){if(!_0x596ac9){_0x802568[_0x8196('0x2b')](0x194);}return _0x596ac9;};}function handleError(_0x10f99e,_0x3198ff){_0x3198ff=_0x3198ff||0x1f4;return function(_0x2ebc61){logger['error'](_0x2ebc61[_0x8196('0x2c')]);if(_0x2ebc61['name']){delete _0x2ebc61['name'];}_0x10f99e[_0x8196('0x1a')](_0x3198ff)[_0x8196('0x2d')](_0x2ebc61);};}exports[_0x8196('0x2e')]=function(_0x5e2f3d,_0x2291da){var _0x51916c={},_0x117993={},_0x2021bb={'count':0x0,'rows':[]};return db[_0x8196('0x2f')][_0x8196('0x30')]()['then'](function(_0x12f716){_0x117993['model']=_['keys'](_0x12f716);_0x117993[_0x8196('0x31')]=_[_0x8196('0x32')](_0x5e2f3d[_0x8196('0x31')]);_0x117993['filters']=_[_0x8196('0x33')](_0x117993[_0x8196('0x34')],_0x117993[_0x8196('0x31')]);_0x51916c[_0x8196('0x35')]=_['intersection'](_0x117993[_0x8196('0x34')],qs[_0x8196('0x36')](_0x5e2f3d['query'][_0x8196('0x36')]));_0x51916c[_0x8196('0x35')]=_0x51916c[_0x8196('0x35')][_0x8196('0x37')]?_0x51916c['attributes']:_0x117993[_0x8196('0x34')];if(!_0x5e2f3d[_0x8196('0x31')][_0x8196('0x38')]('nolimit')){_0x51916c[_0x8196('0x1d')]=qs[_0x8196('0x1d')](_0x5e2f3d[_0x8196('0x31')]['limit']);_0x51916c[_0x8196('0x1f')]=qs[_0x8196('0x1f')](_0x5e2f3d[_0x8196('0x31')][_0x8196('0x1f')]);}_0x51916c[_0x8196('0x39')]=qs[_0x8196('0x3a')](_0x5e2f3d[_0x8196('0x31')]['sort']);_0x51916c['where']=qs[_0x8196('0x3b')](_[_0x8196('0x3c')](_0x5e2f3d[_0x8196('0x31')],_0x117993[_0x8196('0x3b')]),_0x12f716);if(_0x5e2f3d['query']['filter']){_0x51916c[_0x8196('0x3d')]=_[_0x8196('0x3e')](_0x51916c[_0x8196('0x3d')],{'$or':_[_0x8196('0x3f')](_0x51916c[_0x8196('0x35')],function(_0x30479f){var _0xd0ef19={};_0xd0ef19[_0x30479f]={'$like':'%'+_0x5e2f3d[_0x8196('0x31')][_0x8196('0x40')]+'%'};return _0xd0ef19;})});}_0x51916c=_[_0x8196('0x3e')]({},_0x51916c,_0x5e2f3d[_0x8196('0x41')]);var _0x31373e={'where':_0x51916c[_0x8196('0x3d')]};return db['CmCompany'][_0x8196('0x1e')](_0x31373e)[_0x8196('0x26')](function(_0x316e34){_0x2021bb[_0x8196('0x1e')]=_0x316e34;if(_0x5e2f3d[_0x8196('0x31')][_0x8196('0x42')]){_0x51916c[_0x8196('0x43')]=[{'all':!![]}];}return db[_0x8196('0x2f')]['findAll'](_0x51916c);})[_0x8196('0x26')](function(_0x3b1663){_0x2021bb[_0x8196('0x44')]=_0x3b1663;return _0x2021bb;})['then'](respondWithFilteredResult(_0x2291da,_0x51916c))[_0x8196('0x45')](handleError(_0x2291da,null));})[_0x8196('0x45')](handleError(_0x2291da,null));};exports[_0x8196('0x46')]=function(_0x2347db,_0xa9abae){var _0x330956={'raw':![],'where':{'id':_0x2347db[_0x8196('0x47')]['id']}},_0x409000={};_0x409000['model']=_[_0x8196('0x32')](db['CmCompany'][_0x8196('0x48')]);_0x409000[_0x8196('0x31')]=_[_0x8196('0x32')](_0x2347db[_0x8196('0x31')]);_0x409000[_0x8196('0x3b')]=_['intersection'](_0x409000['model'],_0x409000['query']);_0x330956[_0x8196('0x35')]=_['intersection'](_0x409000[_0x8196('0x34')],qs[_0x8196('0x36')](_0x2347db['query'][_0x8196('0x36')]));_0x330956['attributes']=_0x330956[_0x8196('0x35')][_0x8196('0x37')]?_0x330956[_0x8196('0x35')]:_0x409000[_0x8196('0x34')];if(_0x2347db[_0x8196('0x31')][_0x8196('0x42')]){_0x330956[_0x8196('0x43')]=[{'all':!![]}];}_0x330956=_[_0x8196('0x3e')]({},_0x330956,_0x2347db[_0x8196('0x41')]);return db[_0x8196('0x2f')][_0x8196('0x49')](_0x330956)['then'](handleEntityNotFound(_0xa9abae,null))[_0x8196('0x26')](respondWithResult(_0xa9abae,null))['catch'](handleError(_0xa9abae,null));};exports['create']=function(_0x534e12,_0x3c24a6){return db[_0x8196('0x2f')][_0x8196('0x4a')](_0x534e12[_0x8196('0x4b')],{})[_0x8196('0x26')](function(_0x5dc097){var _0x133f82=_0x534e12[_0x8196('0x4c')]['get']({'plain':!![]});if(!_0x133f82)throw new Error(_0x8196('0x4d'));if(_0x133f82[_0x8196('0x4e')]==='user'){var _0xa19cc7=_0x5dc097['get']({'plain':!![]});var _0x2cbe37=_0x8196('0x29');return db[_0x8196('0x4f')]['find']({'where':{'name':_0x2cbe37,'userProfileId':_0x133f82[_0x8196('0x50')]},'raw':!![]})[_0x8196('0x26')](function(_0x2b42e9){if(_0x2b42e9&&_0x2b42e9['autoAssociation']===0x0){return db['UserProfileResource'][_0x8196('0x4a')]({'name':_0xa19cc7[_0x8196('0x51')],'resourceId':_0xa19cc7['id'],'type':_0x2b42e9['name'],'sectionId':_0x2b42e9['id']},{})['then'](function(){return _0x5dc097;});}else{return _0x5dc097;}})[_0x8196('0x45')](function(_0x3ea31d){logger[_0x8196('0x52')](_0x8196('0x53'),_0x3ea31d);throw _0x3ea31d;});}return _0x5dc097;})[_0x8196('0x26')](respondWithResult(_0x3c24a6,0xc9))[_0x8196('0x45')](handleError(_0x3c24a6,null));};exports['update']=function(_0x5c460f,_0x2763bd){if(_0x5c460f[_0x8196('0x4b')]['id']){delete _0x5c460f[_0x8196('0x4b')]['id'];}return db[_0x8196('0x2f')][_0x8196('0x49')]({'where':{'id':_0x5c460f[_0x8196('0x47')]['id']}})[_0x8196('0x26')](handleEntityNotFound(_0x2763bd,null))['then'](saveUpdates(_0x5c460f[_0x8196('0x4b')],null))[_0x8196('0x26')](respondWithResult(_0x2763bd,null))[_0x8196('0x45')](handleError(_0x2763bd,null));};exports[_0x8196('0x27')]=function(_0x339015,_0x3e6874){return db[_0x8196('0x2f')][_0x8196('0x49')]({'where':{'id':_0x339015[_0x8196('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e6874,null))['then'](removeEntity(_0x3e6874,null))['catch'](handleError(_0x3e6874,null));};exports[_0x8196('0x30')]=function(_0x4b643e,_0x133607){return db[_0x8196('0x2f')][_0x8196('0x30')]()[_0x8196('0x26')](respondWithResult(_0x133607,null))[_0x8196('0x45')](handleError(_0x133607,null));};exports['addContacts']=function(_0x16c622,_0x47a3de,_0x8ad250){return db['CmContact'][_0x8196('0x49')]({'where':{'id':_0x16c622[_0x8196('0x47')]['id']}})[_0x8196('0x26')](handleEntityNotFound(_0x47a3de,null))[_0x8196('0x26')](function(_0x186a47){if(_0x186a47){return _0x186a47[_0x8196('0x54')](_0x16c622[_0x8196('0x4b')][_0x8196('0x55')],_['omit'](_0x16c622['body'],[_0x8196('0x55'),'id'])||{});}})['then'](respondWithResult(_0x47a3de,null))[_0x8196('0x45')](handleError(_0x47a3de,null));};exports[_0x8196('0x56')]=function(_0x5c2363,_0x1bccf8,_0x3db629){var _0x394aba={};var _0x4e333c={};var _0x89ed28;var _0x59dfa4;return db[_0x8196('0x2f')]['findOne']({'where':{'id':_0x5c2363['params']['id']}})[_0x8196('0x26')](handleEntityNotFound(_0x1bccf8,null))[_0x8196('0x26')](function(_0x4a3bfe){if(_0x4a3bfe){_0x89ed28=_0x4a3bfe;_0x4e333c[_0x8196('0x34')]=_['keys'](db['CmContact'][_0x8196('0x48')]);_0x4e333c['query']=_[_0x8196('0x32')](_0x5c2363['query']);_0x4e333c[_0x8196('0x3b')]=_[_0x8196('0x33')](_0x4e333c[_0x8196('0x34')],_0x4e333c[_0x8196('0x31')]);_0x394aba['attributes']=_['intersection'](_0x4e333c[_0x8196('0x34')],qs[_0x8196('0x36')](_0x5c2363[_0x8196('0x31')][_0x8196('0x36')]));_0x394aba[_0x8196('0x35')]=_0x394aba['attributes'][_0x8196('0x37')]?_0x394aba['attributes']:_0x4e333c['model'];_0x394aba['order']=qs[_0x8196('0x3a')](_0x5c2363[_0x8196('0x31')]['sort']);_0x394aba['where']=qs['filters'](_[_0x8196('0x3c')](_0x5c2363['query'],_0x4e333c[_0x8196('0x3b')]));if(_0x5c2363['query'][_0x8196('0x40')]){_0x394aba['where']=_[_0x8196('0x3e')](_0x394aba[_0x8196('0x3d')],{'$or':_[_0x8196('0x3f')](_0x394aba[_0x8196('0x35')],function(_0x10f549){var _0x37cc08={};_0x37cc08[_0x10f549]={'$like':'%'+_0x5c2363[_0x8196('0x31')]['filter']+'%'};return _0x37cc08;})});}_0x394aba=_[_0x8196('0x3e')]({},_0x394aba,_0x5c2363[_0x8196('0x41')]);return _0x89ed28[_0x8196('0x56')](_0x394aba);}})['then'](function(_0xe4d10b){if(_0xe4d10b){_0x59dfa4=_0xe4d10b[_0x8196('0x37')];if(!_0x5c2363[_0x8196('0x31')]['hasOwnProperty'](_0x8196('0x57'))){_0x394aba[_0x8196('0x1d')]=qs['limit'](_0x5c2363['query'][_0x8196('0x1d')]);_0x394aba[_0x8196('0x1f')]=qs[_0x8196('0x1f')](_0x5c2363[_0x8196('0x31')][_0x8196('0x1f')]);}return _0x89ed28[_0x8196('0x56')](_0x394aba);}})[_0x8196('0x26')](function(_0x355b3a){if(_0x355b3a){return _0x355b3a?{'count':_0x59dfa4,'rows':_0x355b3a}:null;}})['then'](respondWithResult(_0x1bccf8,null))[_0x8196('0x45')](handleError(_0x1bccf8,null));};
\ No newline at end of file
index 4da7dd3..799be9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac66=['CmCompany','util','../../config/logger','api','request-promise','../../config/environment','./cmCompany.attributes','exports'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xac66,0xa1));var _0x6ac6=function(_0x222d30,_0x3142fc){_0x222d30=_0x222d30-0x0;var _0x2f86b6=_0xac66[_0x222d30];return _0x2f86b6;};'use strict';var _=require('lodash');var util=require(_0x6ac6('0x0'));var logger=require(_0x6ac6('0x1'))(_0x6ac6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ac6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ac6('0x4'));var attributes=require(_0x6ac6('0x5'));module[_0x6ac6('0x6')]=function(_0x414836,_0x3313ed){return _0x414836['define'](_0x6ac6('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c0c=['request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','util','api','bluebird'];(function(_0xac3b20,_0x48e68c){var _0x580caf=function(_0xa07fcd){while(--_0xa07fcd){_0xac3b20['push'](_0xac3b20['shift']());}};_0x580caf(++_0x48e68c);}(_0x8c0c,0x8c));var _0xc8c0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c0c[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xc8c0('0x0'));var logger=require('../../config/logger')(_0xc8c0('0x1'));var moment=require('moment');var BPromise=require(_0xc8c0('0x2'));var rp=require(_0xc8c0('0x3'));var fs=require('fs');var path=require(_0xc8c0('0x4'));var rimraf=require(_0xc8c0('0x5'));var config=require(_0xc8c0('0x6'));var attributes=require(_0xc8c0('0x7'));module[_0xc8c0('0x8')]=function(_0x19ed6a,_0x2d56cd){return _0x19ed6a[_0xc8c0('0x9')](_0xc8c0('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d6d904d..5df8e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb035=['client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf3e868,_0x3733ba){var _0x37706a=function(_0x3e8327){while(--_0x3e8327){_0xf3e868['push'](_0xf3e868['shift']());}};_0x37706a(++_0x3733ba);}(_0xb035,0x1c3));var _0x5b03=function(_0xc65ae2,_0x53119a){_0xc65ae2=_0xc65ae2-0x0;var _0x2432ea=_0xb035[_0xc65ae2];return _0x2432ea;};'use strict';var _=require(_0x5b03('0x0'));var util=require(_0x5b03('0x1'));var moment=require('moment');var BPromise=require(_0x5b03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b03('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5b03('0x4'));var logger=require(_0x5b03('0x5'))(_0x5b03('0x6'));var config=require(_0x5b03('0x7'));var jayson=require(_0x5b03('0x8'));var client=jayson[_0x5b03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3325,_0x34a009,_0x10f76d){return new BPromise(function(_0x854505,_0x581d1d){return client[_0x5b03('0xa')](_0x4a3325,_0x10f76d)[_0x5b03('0xb')](function(_0x14f163){logger[_0x5b03('0xc')](_0x5b03('0xd'),_0x34a009,_0x5b03('0xe'));logger[_0x5b03('0xf')](_0x5b03('0x10'),_0x34a009,_0x5b03('0xe'),JSON[_0x5b03('0x11')](_0x14f163));if(_0x14f163[_0x5b03('0x12')]){if(_0x14f163[_0x5b03('0x12')][_0x5b03('0x13')]===0x1f4){logger[_0x5b03('0x12')](_0x5b03('0xd'),_0x34a009,_0x14f163['error'][_0x5b03('0x14')]);return _0x581d1d(_0x14f163[_0x5b03('0x12')]['message']);}logger[_0x5b03('0x12')](_0x5b03('0xd'),_0x34a009,_0x14f163[_0x5b03('0x12')][_0x5b03('0x14')]);return _0x854505(_0x14f163['error'][_0x5b03('0x14')]);}else{logger[_0x5b03('0xc')](_0x5b03('0xd'),_0x34a009,_0x5b03('0xe'));_0x854505(_0x14f163[_0x5b03('0x15')][_0x5b03('0x14')]);}})[_0x5b03('0x16')](function(_0x39c869){logger['error'](_0x5b03('0xd'),_0x34a009,_0x39c869);_0x581d1d(_0x39c869);});});}
\ No newline at end of file
+var _0xeb15=['code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','error'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0xeb15,0x1d7));var _0x5eb1=function(_0x4af3b7,_0x30c116){_0x4af3b7=_0x4af3b7-0x0;var _0x24727c=_0xeb15[_0x4af3b7];return _0x24727c;};'use strict';var _=require(_0x5eb1('0x0'));var util=require(_0x5eb1('0x1'));var moment=require(_0x5eb1('0x2'));var BPromise=require(_0x5eb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5eb1('0x4'));var db=require(_0x5eb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5eb1('0x6'))('rpc');var config=require(_0x5eb1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5eb1('0x8')][_0x5eb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a7e18,_0x190d89,_0x4a02cd){return new BPromise(function(_0x2f5436,_0x44880d){return client[_0x5eb1('0xa')](_0x3a7e18,_0x4a02cd)[_0x5eb1('0xb')](function(_0x45c9d9){logger[_0x5eb1('0xc')]('CmCompany,\x20%s,\x20%s',_0x190d89,_0x5eb1('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x190d89,_0x5eb1('0xd'),JSON['stringify'](_0x45c9d9));if(_0x45c9d9[_0x5eb1('0xe')]){if(_0x45c9d9[_0x5eb1('0xe')][_0x5eb1('0xf')]===0x1f4){logger['error'](_0x5eb1('0x10'),_0x190d89,_0x45c9d9[_0x5eb1('0xe')]['message']);return _0x44880d(_0x45c9d9[_0x5eb1('0xe')][_0x5eb1('0x11')]);}logger['error'](_0x5eb1('0x10'),_0x190d89,_0x45c9d9[_0x5eb1('0xe')][_0x5eb1('0x11')]);return _0x2f5436(_0x45c9d9['error']['message']);}else{logger['info'](_0x5eb1('0x10'),_0x190d89,'request\x20sent');_0x2f5436(_0x45c9d9['result'][_0x5eb1('0x11')]);}})['catch'](function(_0x212e84){logger[_0x5eb1('0xe')]('CmCompany,\x20%s,\x20%s',_0x190d89,_0x212e84);_0x44880d(_0x212e84);});});}
\ No newline at end of file
index bdc3c8b..65d481c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bfb=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','create','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x10911b,_0x5712db){var _0x5d9943=function(_0x13fd8d){while(--_0x13fd8d){_0x10911b['push'](_0x10911b['shift']());}};_0x5d9943(++_0x5712db);}(_0x6bfb,0x8f));var _0xb6bf=function(_0x5d6754,_0x1acdc1){_0x5d6754=_0x5d6754-0x0;var _0x469103=_0x6bfb[_0x5d6754];return _0x469103;};'use strict';var multer=require('multer');var util=require(_0xb6bf('0x0'));var path=require(_0xb6bf('0x1'));var timeout=require(_0xb6bf('0x2'));var express=require(_0xb6bf('0x3'));var router=express[_0xb6bf('0x4')]();var fs_extra=require(_0xb6bf('0x5'));var auth=require(_0xb6bf('0x6'));var interaction=require(_0xb6bf('0x7'));var config=require(_0xb6bf('0x8'));var controller=require(_0xb6bf('0x9'));router[_0xb6bf('0xa')]('/',auth[_0xb6bf('0xb')](),controller[_0xb6bf('0xc')]);router[_0xb6bf('0xa')](_0xb6bf('0xd'),auth[_0xb6bf('0xb')](),controller[_0xb6bf('0xe')]);router[_0xb6bf('0xa')](_0xb6bf('0xf'),auth[_0xb6bf('0xb')](),controller[_0xb6bf('0x10')]);router[_0xb6bf('0xa')](_0xb6bf('0x11'),auth[_0xb6bf('0xb')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller[_0xb6bf('0x12')]);router[_0xb6bf('0x13')](_0xb6bf('0x11'),auth['isAuthenticated'](),controller['addContacts']);router[_0xb6bf('0x14')](_0xb6bf('0xf'),auth[_0xb6bf('0xb')](),controller[_0xb6bf('0x15')]);router[_0xb6bf('0x16')](_0xb6bf('0xf'),auth['isAuthenticated'](),controller[_0xb6bf('0x17')]);module[_0xb6bf('0x18')]=router;
\ No newline at end of file
+var _0xc4bb=['addContacts','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create'];(function(_0x4bcc45,_0x42eece){var _0x325ca1=function(_0x282385){while(--_0x282385){_0x4bcc45['push'](_0x4bcc45['shift']());}};_0x325ca1(++_0x42eece);}(_0xc4bb,0x1e6));var _0xbc4b=function(_0x18b11c,_0x31b58d){_0x18b11c=_0x18b11c-0x0;var _0xeeb6cf=_0xc4bb[_0x18b11c];return _0xeeb6cf;};'use strict';var multer=require('multer');var util=require(_0xbc4b('0x0'));var path=require('path');var timeout=require(_0xbc4b('0x1'));var express=require(_0xbc4b('0x2'));var router=express[_0xbc4b('0x3')]();var fs_extra=require(_0xbc4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc4b('0x5'));var config=require(_0xbc4b('0x6'));var controller=require(_0xbc4b('0x7'));router[_0xbc4b('0x8')]('/',auth[_0xbc4b('0x9')](),controller[_0xbc4b('0xa')]);router['get'](_0xbc4b('0xb'),auth[_0xbc4b('0x9')](),controller[_0xbc4b('0xc')]);router[_0xbc4b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbc4b('0xd')]);router[_0xbc4b('0x8')](_0xbc4b('0xe'),auth['isAuthenticated'](),controller[_0xbc4b('0xf')]);router[_0xbc4b('0x10')]('/',auth[_0xbc4b('0x9')](),controller[_0xbc4b('0x11')]);router[_0xbc4b('0x10')](_0xbc4b('0xe'),auth[_0xbc4b('0x9')](),controller[_0xbc4b('0x12')]);router[_0xbc4b('0x13')]('/:id',auth[_0xbc4b('0x9')](),controller[_0xbc4b('0x14')]);router[_0xbc4b('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbc4b('0x16')]);module[_0xbc4b('0x17')]=router;
\ No newline at end of file
index 3e687f1..2c26220 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9d7=['STRING','INTEGER','UNSIGNED','NOW','lodash','exports'];(function(_0x2a0a35,_0x5f357d){var _0x45afcc=function(_0xad78c3){while(--_0xad78c3){_0x2a0a35['push'](_0x2a0a35['shift']());}};_0x45afcc(++_0x5f357d);}(_0xb9d7,0x88));var _0x7b9d=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xb9d7[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x7b9d('0x0'));var Sequelize=require('sequelize');module[_0x7b9d('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b9d('0x2')]},'street':{'type':Sequelize[_0x7b9d('0x2')]},'postalCode':{'type':Sequelize[_0x7b9d('0x2')]},'city':{'type':Sequelize[_0x7b9d('0x2')]},'country':{'type':Sequelize[_0x7b9d('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x7b9d('0x2')]},'mobile':{'type':Sequelize[_0x7b9d('0x2')]},'fax':{'type':Sequelize[_0x7b9d('0x2')]},'email':{'type':Sequelize[_0x7b9d('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7b9d('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x7b9d('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x7b9d('0x2')]},'wechat':{'type':Sequelize[_0x7b9d('0x2')]},'telegram':{'type':Sequelize[_0x7b9d('0x2')]},'UserId':{'type':Sequelize[_0x7b9d('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x7b9d('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x7b9d('0x5')]}};
\ No newline at end of file
+var _0x3f2f=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0xc77c92,_0x8a9f1){var _0x51319b=function(_0x45b041){while(--_0x45b041){_0xc77c92['push'](_0xc77c92['shift']());}};_0x51319b(++_0x8a9f1);}(_0x3f2f,0xf7));var _0xf3f2=function(_0x522d05,_0x350cda){_0x522d05=_0x522d05-0x0;var _0xedc4f7=_0x3f2f[_0x522d05];return _0xedc4f7;};'use strict';var _=require(_0xf3f2('0x0'));var Sequelize=require(_0xf3f2('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xf3f2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf3f2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf3f2('0x2')]},'country':{'type':Sequelize[_0xf3f2('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf3f2('0x2')]},'description':{'type':Sequelize[_0xf3f2('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf3f2('0x2')]},'email':{'type':Sequelize[_0xf3f2('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf3f2('0x2')]},'fb_data':{'type':Sequelize[_0xf3f2('0x2')]},'twitter':{'type':Sequelize[_0xf3f2('0x2')]},'skype':{'type':Sequelize[_0xf3f2('0x2')]},'teams':{'type':Sequelize[_0xf3f2('0x2')]},'viber':{'type':Sequelize[_0xf3f2('0x2')]},'line':{'type':Sequelize[_0xf3f2('0x2')]},'wechat':{'type':Sequelize[_0xf3f2('0x2')]},'telegram':{'type':Sequelize[_0xf3f2('0x2')]},'UserId':{'type':Sequelize[_0xf3f2('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf3f2('0x5')],'defaultValue':Sequelize[_0xf3f2('0x6')]}};
\ No newline at end of file
index 2ccb1bb..33665a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1699=['find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','buildExpression','start','filter','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','having','t.id\x20IN\x20?','role','agent','some','user','c.ListId\x20IS\x20NULL','toString','sequelize','keyBy','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','params','catch','tags','startsWith','columnName','displayName','findAll','alias','custom','values','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','duplicates','findOrCreate','spread','error','show','omit','pickBy','format','cf_%d','table','id\x20=\x20?','text','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','getHopperHistories','include','getHopperFinals','rows','getJscriptySessions','No\x20ListId\x20specified','binding_keys','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','sms','openchannel','whatsapp','-createdAt','resolve','channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','createdAt','userDisposition','userThirdDisposition','fullname','DESC','startCase','Account','closed','closedAt','note','secondDisposition','thirdDisposition','UserId','key','Owner','chat','browserName','customerIp','customerPort','deviceModel','ratingType','ratingValue','subject','substatus','externalUrl','Interaction','flatten','sortBy','slice','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','name','send','index','CmContact','describe','keys','length','push','CmCustomField','findOne','cf_','all','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x1699,0xcc));var _0x9169=function(_0x6470a2,_0x3b5f44){_0x6470a2=_0x6470a2-0x0;var _0x24ac61=_0x1699[_0x6470a2];return _0x24ac61;};'use strict';var emlformat=require(_0x9169('0x0'));var rimraf=require(_0x9169('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9169('0x2'));var rp=require('request-promise');var moment=require(_0x9169('0x3'));var BPromise=require(_0x9169('0x4'));var Mustache=require(_0x9169('0x5'));var util=require(_0x9169('0x6'));var path=require(_0x9169('0x7'));var sox=require(_0x9169('0x8'));var csv=require('to-csv');var ejs=require(_0x9169('0x9'));var fs=require('fs');var fs_extra=require(_0x9169('0xa'));var _=require(_0x9169('0xb'));var squel=require(_0x9169('0xc'));var crypto=require(_0x9169('0xd'));var jsforce=require(_0x9169('0xe'));var deskjs=require(_0x9169('0xf'));var toCsv=require(_0x9169('0x10'));var querystring=require(_0x9169('0x11'));var Papa=require('papaparse');var Redis=require(_0x9169('0x12'));var authService=require(_0x9169('0x13'));var qs=require(_0x9169('0x14'));var as=require(_0x9169('0x15'));var hardwareService=require(_0x9169('0x16'));var logger=require('../../config/logger')(_0x9169('0x17'));var utils=require(_0x9169('0x18'));var config=require(_0x9169('0x19'));var licenseUtil=require(_0x9169('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9169('0x1b')](config[_0x9169('0x1c')],{'host':_0x9169('0x1d'),'port':0x18eb});var socket=require(_0x9169('0x1e'))(new Redis(config['redis']));require(_0x9169('0x1f'))['register'](socket);function respondWithStatusCode(_0x6823ac,_0x4b89f4){_0x4b89f4=_0x4b89f4||0xcc;return function(_0x12296f){if(_0x12296f){return _0x6823ac['sendStatus'](_0x4b89f4);}return _0x6823ac['status'](_0x4b89f4)[_0x9169('0x20')]();};}function respondWithResult(_0x1da98a,_0x13eb13){_0x13eb13=_0x13eb13||0xc8;return function(_0x4baa5e){if(_0x4baa5e){return _0x1da98a[_0x9169('0x21')](_0x13eb13)[_0x9169('0x22')](_0x4baa5e);}};}function respondWithFilteredResult(_0x18e944,_0x55d689){return function(_0xc67ab3){if(_0xc67ab3){var _0x5dcda4=typeof _0x55d689[_0x9169('0x23')]===_0x9169('0x24')&&typeof _0x55d689['limit']==='undefined';var _0x384e8b=_0xc67ab3[_0x9169('0x25')];var _0x4af51c=_0x5dcda4?0x0:_0x55d689[_0x9169('0x23')];var _0x646bcd=_0x5dcda4?_0xc67ab3[_0x9169('0x25')]:_0x55d689[_0x9169('0x23')]+_0x55d689[_0x9169('0x26')];var _0x5b71d2;if(_0x646bcd>=_0x384e8b){_0x646bcd=_0x384e8b;_0x5b71d2=0xc8;}else{_0x5b71d2=0xce;}_0x18e944[_0x9169('0x21')](_0x5b71d2);return _0x18e944[_0x9169('0x27')](_0x9169('0x28'),_0x4af51c+'-'+_0x646bcd+'/'+_0x384e8b)['json'](_0xc67ab3);}return null;};}function patchUpdates(_0x45689e){return function(_0xf44930){try{jsonpatch[_0x9169('0x29')](_0xf44930,_0x45689e,!![]);}catch(_0x5be3eb){return BPromise[_0x9169('0x2a')](_0x5be3eb);}return _0xf44930['save']();};}function saveUpdates(_0x29d728,_0x68dbd2){return function(_0x4f89a3){if(_0x4f89a3){return _0x4f89a3[_0x9169('0x2b')](_0x29d728)[_0x9169('0x2c')](function(_0x5301ed){return _0x5301ed;});}return null;};}function removeEntity(_0x1239e1,_0x43f6a1){return function(_0x385885){if(_0x385885){return _0x385885[_0x9169('0x2d')]()[_0x9169('0x2c')](function(){_0x1239e1[_0x9169('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b363f,_0xb9c868){return function(_0x42d571){if(!_0x42d571){_0x3b363f[_0x9169('0x2e')](0x194);}return _0x42d571;};}function handleError(_0x58acc4,_0x38cd78){_0x38cd78=_0x38cd78||0x1f4;return function(_0x113591){logger['error'](_0x113591['stack']);if(_0x113591[_0x9169('0x2f')]){delete _0x113591[_0x9169('0x2f')];}_0x58acc4['status'](_0x38cd78)[_0x9169('0x30')](_0x113591);};}exports[_0x9169('0x31')]=function(_0x3ec59f,_0x2eb635){var _0xa89774={},_0x30a76c={},_0x588657={'count':0x0,'rows':[]};return db[_0x9169('0x32')][_0x9169('0x33')]()[_0x9169('0x2c')](function(_0x2ffbe9){var _0x1da68b=[];for(var _0x19c2be=0x0;_0x19c2be<Object[_0x9169('0x34')](_0x2ffbe9)[_0x9169('0x35')];_0x19c2be++){var _0x2c35d1=Object[_0x9169('0x34')](_0x2ffbe9)[_0x19c2be];if(_['startsWith'](_0x2c35d1,'cf_')){_0x1da68b[_0x9169('0x36')](db[_0x9169('0x37')][_0x9169('0x38')]({'where':{'id':_['trimStart'](_0x2c35d1,_0x9169('0x39'))},'raw':!![]}));}}return BPromise[_0x9169('0x3a')](_0x1da68b)[_0x9169('0x2c')](function(_0x214246){for(var _0x554cb5=0x0;_0x554cb5<_0x214246['length'];_0x554cb5++){if(_0x214246[_0x554cb5]){var _0x547146=_0x9169('0x39')+_0x214246[_0x554cb5]['id'];var _0x1b7dbe=_0x2ffbe9[_0x547146];_0x1b7dbe[_0x9169('0x3b')]=_0x214246[_0x554cb5][_0x9169('0x3c')];}}return _0x2ffbe9;});})[_0x9169('0x2c')](function(_0x266701){_0x30a76c[_0x9169('0x3d')]=_[_0x9169('0x34')](_0x266701);_0x30a76c['query']=_['keys'](_0x3ec59f[_0x9169('0x3e')]);_0x30a76c[_0x9169('0x3f')]=_[_0x9169('0x40')](_0x30a76c['model'],_0x30a76c[_0x9169('0x3e')]);_0xa89774['attributes']=_[_0x9169('0x40')](_0x30a76c[_0x9169('0x3d')],qs['fields'](_0x3ec59f[_0x9169('0x3e')][_0x9169('0x41')]));_0xa89774[_0x9169('0x42')]=_0xa89774[_0x9169('0x42')]['length']?_0xa89774[_0x9169('0x42')]:_0x30a76c[_0x9169('0x3d')];if(!_0x3ec59f[_0x9169('0x3e')][_0x9169('0x43')](_0x9169('0x44'))){_0xa89774['limit']=qs['limit'](_0x3ec59f[_0x9169('0x3e')]['limit']);_0xa89774[_0x9169('0x23')]=qs['offset'](_0x3ec59f[_0x9169('0x3e')][_0x9169('0x23')]);}_0xa89774['order']=qs[_0x9169('0x45')](_0x3ec59f[_0x9169('0x3e')][_0x9169('0x45')]);_0xa89774[_0x9169('0x46')]=qs['filters'](_[_0x9169('0x47')](_0x3ec59f[_0x9169('0x3e')],_0x30a76c[_0x9169('0x3f')]),_0x266701);var _0x4d2057=[];var _0x710a56=squel[_0x9169('0x48')]()[_0x9169('0x49')]('id')[_0x9169('0x49')](_0x9169('0x2f'))['field'](_0x9169('0x4a'))[_0x9169('0x4b')](_0x9169('0x4c'));var _0x37582e=squel[_0x9169('0x48')]()[_0x9169('0x4b')](_0x9169('0x4d'),'c')[_0x9169('0x4e')](_0x9169('0x4f'),'uc','uc.CmContactId\x20=\x20c.id')['left_join']('cm_contact_has_tags','ct',_0x9169('0x50'))[_0x9169('0x4e')](_0x9169('0x4c'),'t',_0x9169('0x51'))[_0x9169('0x46')](_0x9169('0x52'));var _0x5f57e5=squel[_0x9169('0x53')]();var _0x3b3168=[];var _0x199b69=squel['expr']();var _0x43d8b0;if(_0x3ec59f[_0x9169('0x3e')][_0x9169('0x54')]){_0x43d8b0=as[_0x9169('0x55')](_0x3ec59f['query'][_0x9169('0x54')]);var _0x59b58b=_0x43d8b0[_0x9169('0x56')];for(var _0x18fd82=0x0;_0x18fd82<_0x43d8b0['conditions'][_0x9169('0x35')];_0x18fd82++){var _0x13b709=_0x43d8b0[_0x9169('0x57')][_0x18fd82];var _0x5ec75e='c';var _0x22bcbe=_(_0x266701)[_0x9169('0x34')]()[_0x9169('0x58')](function(_0x19f01a){return _0x19f01a===_0x13b709['field'];});if(_0x22bcbe)_0x22bcbe=_0x266701[_0x13b709[_0x9169('0x49')]];if(!_0x22bcbe){if(_0x13b709[_0x9169('0x49')]===_0x9169('0x59')){var _0x5664b8=_0x13b709['value'][_0x9169('0x5a')](',')[_0x9169('0x5b')](function(_0x503111){return Number(_0x503111);});_0x5664b8[_0x9169('0x5c')](function(_0x3bb44e){_0x199b69['or'](_0x9169('0x5d'),'%,'+_0x3bb44e+',%');});_0x3b3168=_[_0x9169('0x5e')](_0x3b3168,_0x5664b8);}else if(_0x13b709['field']===_0x9169('0x5f')){_0x5f57e5[_0x9169('0x60')](_0x9169('0x61'),_0x13b709[_0x9169('0x62')]);}}else{if(_0x13b709[_0x9169('0x49')]==='dateOfBirth'||_0x22bcbe[_0x9169('0x3b')]==='datetime')_0x13b709['castTo']='DATE';var _0x41b189=as[_0x9169('0x63')](_0x5ec75e,_0x22bcbe[_0x9169('0x3c')],_0x13b709);_0x5f57e5[_0x59b58b](_0x41b189['text'],_0x41b189[_0x9169('0x62')][_0x9169('0x64')],_0x41b189['value'][_0x9169('0x20')]);}}}else{var _0x1ac7ba=_(Object['keys'](_0x3ec59f[_0x9169('0x3e')]))['map'](function(_0x407f5a){return _0x266701[_0x9169('0x43')](_0x407f5a)?_0x407f5a:undefined;})[_0x9169('0x65')](function(_0x3cb120){return!_['isNil'](_0x3cb120);})[_0x9169('0x62')]();if(_0x3ec59f['query']['Contact'])_0x1ac7ba[_0x9169('0x36')](_0x9169('0x66'));if(!_[_0x9169('0x67')](_0x1ac7ba)){_0x1ac7ba[_0x9169('0x5c')](function(_0x2da620){if(_0x2da620===_0x9169('0x68')){_0x37582e[_0x9169('0x46')](_0x9169('0x69'),[][_0x9169('0x6a')](_0x3ec59f[_0x9169('0x3e')][_0x2da620]));}else if(_0x2da620===_0x9169('0x66')){var _0x5ec31b='%'+_0x3ec59f[_0x9169('0x3e')][_0x2da620]+'%';_0x37582e[_0x9169('0x46')](_0x9169('0x6b'),_0x5ec31b);}else{_0x37582e['where']('c.'+_0x2da620+'\x20=\x20?',_0x3ec59f['query'][_0x2da620]);}});}if(_0x3ec59f[_0x9169('0x3e')][_0x9169('0x6c')]){_0x3b3168=_[_0x9169('0x6d')](_0x3ec59f[_0x9169('0x3e')][_0x9169('0x6c')])?_0x3ec59f[_0x9169('0x3e')][_0x9169('0x6c')]:new Array(_0x3ec59f['query'][_0x9169('0x6c')]);_0x3b3168[_0x9169('0x5c')](function(_0x5ce848){_0x199b69['or'](_0x9169('0x5d'),'%,'+_0x5ce848+',%');});}if(_0x3ec59f['query'][_0x9169('0x65')]){var _0xe91e15=_0x3ec59f['query'][_0x9169('0x65')][_0x9169('0x6e')]('\x5c','\x5c\x5c')[_0x9169('0x6e')](/'/g,'\x27\x27');if(_0xe91e15['split']('\x20')['length']>0x1){_0x5f57e5['or'](_0x9169('0x6f'),qs[_0x9169('0x70')](_0xe91e15),null);}else{if(qs[_0x9169('0x71')](_0xe91e15)){_0x5f57e5['or'](_0x9169('0x72'),_0xe91e15+'%');_0x5f57e5['or'](_0x9169('0x73'),_0xe91e15+'%');_0x5f57e5['or'](_0x9169('0x74'),_0xe91e15+'%');_0x5f57e5['or'](_0x9169('0x75'),_0xe91e15+'%');}else if(qs[_0x9169('0x76')](_0xe91e15)){_0x5f57e5['or'](_0x9169('0x77'),_0xe91e15+'%');}else{_0x5f57e5['or']('c.firstName\x20LIKE\x20?','%'+_0xe91e15+'%');_0x5f57e5['or'](_0x9169('0x78'),'%'+_0xe91e15+'%');_0x5f57e5['or']('c.email\x20LIKE\x20?','%'+_0xe91e15+'%');}}}}_0x37582e['where'](_0x5f57e5);_0x37582e[_0x9169('0x79')](_0x9169('0x7a'));var _0x477248={'type':db[_0x9169('0x7b')][_0x9169('0x7c')][_0x9169('0x7d')],'raw':!![]};var _0xad1e67=_0x37582e[_0x9169('0x7e')]()[_0x9169('0x49')](_0x9169('0x7a'));if(_0xa89774[_0x9169('0x7f')]){_0xa89774[_0x9169('0x7f')][_0x9169('0x5c')](function(_0x1f13ae){_0x37582e[_0x9169('0x7f')]('c.'+_0x1f13ae[0x0],_0x1f13ae[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9169('0x67')](_0x3b3168)){_0x37582e[_0x9169('0x80')](_0x199b69);_0xad1e67['where'](_0x9169('0x81'),_0x3b3168);}BPromise['resolve']()['then'](function(){if(!_0x43d8b0)return;if(_0x3ec59f['user'][_0x9169('0x82')]!==_0x9169('0x83'))return;if(!_[_0x9169('0x84')](_0x43d8b0[_0x9169('0x57')],[_0x9169('0x49'),_0x9169('0x5f')])){return _0x3ec59f[_0x9169('0x85')]['getLists']({'attributes':['id'],'raw':!![]})[_0x9169('0x2c')](function(_0x5e4369){if(_[_0x9169('0x67')](_0x5e4369)){_0xad1e67[_0x9169('0x46')](_0x9169('0x86'));_0x37582e[_0x9169('0x46')]('c.ListId\x20IS\x20NULL');}else{_0xad1e67['where'](_0x9169('0x69'),_[_0x9169('0x5b')](_0x5e4369,'id'));_0x37582e[_0x9169('0x46')]('c.ListId\x20IN\x20?',_['map'](_0x5e4369,'id'));}});}})['then'](function(){if(_0x3ec59f[_0x9169('0x85')][_0x9169('0x82')]===_0x9169('0x83')&&!_0x43d8b0&&!_0x3ec59f[_0x9169('0x3e')][_0x9169('0x68')])return[];return db['sequelize'][_0x9169('0x3e')](_0xad1e67[_0x9169('0x87')](),_0x477248);})[_0x9169('0x2c')](function(_0x20b2f5){_0x588657['count']=_0x20b2f5[_0x9169('0x35')];if(_0x588657['count']===0x0)return[];return db[_0x9169('0x88')][_0x9169('0x3e')](_0x710a56[_0x9169('0x87')](),_0x477248)[_0x9169('0x2c')](function(_0x2fed16){_0x4d2057=_[_0x9169('0x89')](_0x2fed16,'id');_0x477248=_['merge'](_0x477248,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ec59f[_0x9169('0x3e')][_0x9169('0x41')]){_0xa89774[_0x9169('0x42')][_0x9169('0x5c')](function(_0x3bc14c){_0x37582e[_0x9169('0x49')]('c.'+_0x3bc14c);});}else{_0x37582e[_0x9169('0x49')](_0x9169('0x7a'));_0x37582e[_0x9169('0x49')](_0x9169('0x8a'));_0x37582e[_0x9169('0x49')]('c.lastName');_0x37582e[_0x9169('0x49')](_0x9169('0x8b'));_0x37582e[_0x9169('0x49')](_0x9169('0x8c'));_0x37582e[_0x9169('0x49')](_0x9169('0x8d'));_0x37582e[_0x9169('0x49')](_0x9169('0x8e'));_0x37582e[_0x9169('0x49')](_0x9169('0x8f'));_0x37582e[_0x9169('0x49')](_0x9169('0x90'));_0x37582e['field'](_0x9169('0x91'));_0x37582e['field'](_0x9169('0x92'));_0x37582e[_0x9169('0x49')](_0x9169('0x93'),_0x9169('0x94'));}if(_0xa89774[_0x9169('0x26')])_0x37582e[_0x9169('0x26')](_0xa89774[_0x9169('0x26')]);if(_0xa89774[_0x9169('0x23')])_0x37582e[_0x9169('0x23')](_0xa89774[_0x9169('0x23')]);return db['sequelize'][_0x9169('0x3e')](_0x37582e[_0x9169('0x87')](),_0x477248);});})['then'](function(_0x4a2f64){_0x4a2f64['forEach'](function(_0x16fd54){if(_0x16fd54[_0x9169('0x94')]){_0x16fd54[_0x9169('0x95')]=[];_0x16fd54[_0x9169('0x94')][_0x9169('0x5a')](',')[_0x9169('0x5c')](function(_0x5b7f13){_0x16fd54[_0x9169('0x95')][_0x9169('0x36')](_0x4d2057[_0x5b7f13]);});}delete _0x16fd54[_0x9169('0x94')];});_0x588657['rows']=_0x4a2f64;return _0x588657;})['then'](respondWithFilteredResult(_0x2eb635,_0xa89774));})['catch'](handleError(_0x2eb635,null));};exports[_0x9169('0x2d')]=function(_0x4cb99b,_0x1bda0f){return db[_0x9169('0x32')][_0x9169('0x58')]({'where':{'id':_0x4cb99b[_0x9169('0x96')]['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x1bda0f,null))[_0x9169('0x2c')](removeEntity(_0x1bda0f,null))[_0x9169('0x97')](handleError(_0x1bda0f,null));};exports[_0x9169('0x33')]=function(_0x2820ce,_0x2e1455){return db['CmContact'][_0x9169('0x33')]()[_0x9169('0x2c')](function(_0x33401c){delete _0x33401c[_0x9169('0x98')];for(var _0x46dda1=0x0;_0x46dda1<Object['keys'](_0x33401c)[_0x9169('0x35')];_0x46dda1++){var _0x2c9465=Object['keys'](_0x33401c)[_0x46dda1];if(!_[_0x9169('0x99')](_0x2c9465,_0x9169('0x39'))){_0x33401c[_0x2c9465][_0x9169('0x9a')]=_0x2c9465;_0x33401c[_0x2c9465][_0x9169('0x9b')]=_0x2c9465;}}return _0x33401c;})[_0x9169('0x2c')](function(_0x48c9bd){var _0x2a7491={'where':{'$or':[{'ListId':_0x2820ce[_0x9169('0x3e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x9169('0x37')][_0x9169('0x9c')](_0x2a7491)[_0x9169('0x2c')](function(_0x54637e){for(var _0x357164=0x0;_0x357164<_0x54637e[_0x9169('0x35')];_0x357164++){var _0x2d17c2=_0x9169('0x39')+_0x54637e[_0x357164]['id'];_0x48c9bd[_0x2d17c2][_0x9169('0x9a')]=_0x2d17c2;_0x48c9bd[_0x2d17c2][_0x9169('0x9b')]=_0x54637e[_0x357164][_0x9169('0x9d')];_0x48c9bd[_0x2d17c2][_0x9169('0x9e')]={'type':_0x54637e[_0x357164][_0x9169('0x3c')],'values':_0x54637e[_0x357164][_0x9169('0x9f')]};}Object[_0x9169('0x34')](_0x48c9bd)[_0x9169('0x5c')](function(_0x1f9269){if(!_0x48c9bd[_0x1f9269][_0x9169('0x43')]('columnName')){delete _0x48c9bd[_0x1f9269];}});return _0x48c9bd;});})[_0x9169('0x2c')](respondWithResult(_0x2e1455,null))[_0x9169('0x97')](handleError(_0x2e1455,null));};exports[_0x9169('0xa0')]=function(_0x14f935,_0x1c420c){var _0x47dcfd;var _0x352471;var _0x407a89;if(_0x14f935[_0x9169('0xa1')]['id']){delete _0x14f935[_0x9169('0xa1')]['id'];}return db[_0x9169('0x32')][_0x9169('0x9c')]({'where':{'id':[_0x14f935['body']['to'],_0x14f935['body'][_0x9169('0x4b')]]}})[_0x9169('0x2c')](function(_0x21c133){if(_0x21c133){if(_0x21c133[_0x9169('0x35')]!==0x2){return null;}_0x21c133[0x0]=_0x21c133[0x0][_0x9169('0xa2')]({'plain':!![]});_0x21c133[0x1]=_0x21c133[0x1][_0x9169('0xa2')]({'plain':!![]});delete _0x21c133[0x0]['id'];delete _0x21c133[0x1]['id'];return _[_0x9169('0xa3')](_0x21c133[0x0],_0x21c133[0x1],function(_0x4587fe,_0x27b0df){if(Array[_0x9169('0x6d')](_0x27b0df)&&!_0x27b0df[_0x9169('0x35')]){return _0x4587fe;}else if(!_0x27b0df){return _0x4587fe;}});}})[_0x9169('0x2c')](handleEntityNotFound(_0x1c420c,null))[_0x9169('0x2c')](function(_0x210dd2){if(_0x210dd2){if(_0x210dd2[_0x9169('0x98')]&&_[_0x9169('0x6d')](_0x210dd2['tags'])){_0x210dd2['tags']=_0x210dd2[_0x9169('0x98')][_0x9169('0xa4')]();}logger['info'](_0x9169('0xa5'),_0x14f935[_0x9169('0xa1')]['to'],_0x14f935['body'][_0x9169('0x4b')]);return db[_0x9169('0xa6')][_0x9169('0x2d')]({'where':{'ContactId':[_0x14f935[_0x9169('0xa1')]['to'],_0x14f935[_0x9169('0xa1')][_0x9169('0x4b')]]}})[_0x9169('0x2c')](function(_0x5e9b17){logger[_0x9169('0xa7')](_0x9169('0xa8'),_0x5e9b17);return db['CmHopperBlack'][_0x9169('0x2d')]({'where':{'ContactId':[_0x14f935[_0x9169('0xa1')]['to'],_0x14f935['body'][_0x9169('0x4b')]]}})[_0x9169('0x2c')](function(_0x4fab1d){logger[_0x9169('0xa7')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x4fab1d);return db['CmContact'][_0x9169('0xa9')](_0x210dd2);});});}})[_0x9169('0x2c')](function(_0x4385eb){if(_0x4385eb){_0x47dcfd=_0x4385eb;_0x352471={'ContactId':_0x47dcfd['id']};_0x407a89={'where':{'ContactId':[_0x14f935[_0x9169('0xa1')]['to'],_0x14f935[_0x9169('0xa1')][_0x9169('0x4b')]]}};return db[_0x9169('0xaa')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['ChatMessage'][_0x9169('0x2b')](_0x352471,_0x407a89);}})['then'](function(){if(_0x47dcfd){return db[_0x9169('0xab')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xac')]['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['MailMessage']['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xac')]['update'](_0x352471,_0x407a89);}})['then'](function(){if(_0x47dcfd){return db[_0x9169('0xad')]['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xae')]['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['SmsMessage'][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xaf')]['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['FaxMessage'][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['OpenchannelInteraction']['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb0')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb1')][_0x9169('0x2b')](_0x352471,_0x407a89);}})['then'](function(){if(_0x47dcfd){return db[_0x9169('0xb2')]['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['ReportAgentPreview'][_0x9169('0x2b')](_0x352471,_0x407a89);}})['then'](function(){if(_0x47dcfd){return db[_0x9169('0xb3')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb4')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb5')][_0x9169('0x2b')](_0x352471,_0x407a89);}})['then'](function(){if(_0x47dcfd){return db[_0x9169('0xb6')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['OpenchannelQueueReport'][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb7')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb8')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xb9')][_0x9169('0x2b')](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db[_0x9169('0xba')]['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['WhatsappQueueReport']['update'](_0x352471,_0x407a89);}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return db['CmContact'][_0x9169('0x2d')]({'where':{'id':[_0x14f935[_0x9169('0xa1')]['to'],_0x14f935[_0x9169('0xa1')]['from']]}});}})[_0x9169('0x2c')](function(){if(_0x47dcfd){return _0x47dcfd;}})[_0x9169('0x2c')](respondWithResult(_0x1c420c,null))[_0x9169('0x97')](handleError(_0x1c420c,null));};exports['create']=function(_0x1ea58a,_0x23fe19){return db[_0x9169('0x32')]['describe']()[_0x9169('0x2c')](function(_0x46a676){if(_0x1ea58a[_0x9169('0xa1')][_0x9169('0x98')]&&_[_0x9169('0x6d')](_0x1ea58a[_0x9169('0xa1')][_0x9169('0x98')])){if(_0x1ea58a['body'][_0x9169('0x98')][_0x9169('0x35')]){_0x1ea58a[_0x9169('0xa1')][_0x9169('0x98')]=_0x1ea58a[_0x9169('0xa1')][_0x9169('0x98')][_0x9169('0xa4')](';')+';';}else{_0x1ea58a[_0x9169('0xa1')][_0x9169('0x98')]=null;}}else{_0x1ea58a[_0x9169('0xa1')]['tags']=null;}return db['CmContact'][_0x9169('0xa9')](_0x1ea58a[_0x9169('0xa1')],{'fields':_[_0x9169('0x34')](_0x46a676),'raw':!![]});})[_0x9169('0x2c')](respondWithResult(_0x23fe19,0xc9))[_0x9169('0x97')](handleError(_0x23fe19,null));};exports['bulkCreate']=function(_0x548922,_0x28e925){var _0x59b57f=[];var _0x4494c9=0x0;var _0x576409=0x0;var _0xc75142=0x0;return db['CmContact']['describe']()[_0x9169('0x2c')](function(_0x1fb787){return BPromise['each'](_0x548922[_0x9169('0xa1')],function(_0x2ab578){var _0x12a2c0={'where':{'$or':[]},'defaults':_0x2ab578,'fields':_[_0x9169('0x34')](_0x1fb787),'raw':!![]};if(_0x2ab578[_0x9169('0xbb')]){for(var _0x21d106=0x0;_0x21d106<_0x2ab578[_0x9169('0xbb')][_0x9169('0x35')];_0x21d106++){var _0x58e3d1={};_0x58e3d1[_0x2ab578[_0x9169('0xbb')][_0x21d106]]=_0x2ab578[_0x2ab578['duplicates'][_0x21d106]];_0x12a2c0[_0x9169('0x46')]['$or'][_0x9169('0x36')](_0x58e3d1);}_0x12a2c0[_0x9169('0x46')]['ListId']=_0x2ab578['ListId'];}return db[_0x9169('0x32')][_0x9169('0xbc')](_0x12a2c0)[_0x9169('0xbd')](function(_0xb54705,_0x1fc4f2){if(_0x1fc4f2){_0x4494c9++;}else{_0xc75142++;}})[_0x9169('0x97')](function(_0x31a10c){console[_0x9169('0xbe')](_0x31a10c);_0x576409++;});});})['then'](function(_0x2abe98){if(_0x2abe98){return{'success':_0x4494c9,'failure':_0x576409,'duplicates':_0xc75142};}})[_0x9169('0x2c')](respondWithResult(_0x28e925,0xc9))[_0x9169('0x97')](handleError(_0x28e925,null));};exports[_0x9169('0xbf')]=function(_0x39858b,_0x30da7b,_0x430c78){var _0x27e568;return db[_0x9169('0x32')][_0x9169('0x33')]()['then'](function(_0x44dddb){return db[_0x9169('0x32')][_0x9169('0x58')]({'where':{'id':_0x39858b['params']['id']},'include':[{'model':db[_0x9169('0x59')],'as':_0x9169('0x95'),'attributes':['id',_0x9169('0x2f'),_0x9169('0x4a')],'required':_0x39858b[_0x9169('0x3e')][_0x9169('0x6c')]?!![]:![]}],'attributes':_[_0x9169('0x34')](_0x44dddb)});})[_0x9169('0x2c')](function(_0x3f033e){_0x27e568=_0x3f033e[_0x9169('0xa2')]({'plain':!![]});var _0x51c493={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3f033e&&_0x3f033e[_0x9169('0x68')]){if(_0x3f033e[_0x9169('0x68')]){_0x51c493['where']['$and']['push']({'ListId':{'$ne':_0x3f033e[_0x9169('0x68')]}});}}return db['CmCustomField'][_0x9169('0x9c')](_0x51c493);})[_0x9169('0x2c')](function(_0x57e1c4){return _[_0x9169('0xc0')](_0x27e568,_[_0x9169('0x5b')](_0x57e1c4,function(_0x4d24a1){return util['format']('cf_%d',_0x4d24a1['id']);}));})[_0x9169('0x2c')](handleEntityNotFound(_0x30da7b,null))['then'](respondWithResult(_0x30da7b,null))[_0x9169('0x97')](handleError(_0x30da7b,null));};exports[_0x9169('0x2b')]=function(_0x6616f0,_0x4997b0){var _0x5a9c3d;if(_0x6616f0['body']['id']){delete _0x6616f0['body']['id'];}return db['CmContact'][_0x9169('0x58')]({'where':{'id':_0x6616f0['params']['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x4997b0,null))[_0x9169('0x2c')](saveUpdates(_0x6616f0['body'],null))[_0x9169('0x2c')](function(_0xcc94ec){_0x5a9c3d=_0xcc94ec;var _0x6d50da={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xcc94ec&&_0xcc94ec['ListId']){if(_0xcc94ec[_0x9169('0x68')]){_0x6d50da['where']['$and']['push']({'ListId':{'$ne':_0xcc94ec[_0x9169('0x68')]}});}}return db[_0x9169('0x37')]['findAll'](_0x6d50da);})[_0x9169('0x2c')](function(_0xe9feb){if(_0xe9feb){return _[_0x9169('0xc0')](_[_0x9169('0xc1')](_0x6616f0[_0x9169('0xa1')],function(_0x334a08,_0x3c39ee){return _[_0x9169('0x99')](_0x3c39ee,'cf_');}),_[_0x9169('0x5b')](_0xe9feb,function(_0x24db6a){return util[_0x9169('0xc2')](_0x9169('0xc3'),_0x24db6a['id']);}));}})[_0x9169('0x2c')](function(_0x1f2267){if(_0x1f2267&&!_[_0x9169('0x67')](_0x1f2267)){var _0x29962e=squel[_0x9169('0x2b')]()[_0x9169('0xc4')](_0x9169('0x4d'))['setFields'](_0x1f2267)[_0x9169('0x46')](_0x9169('0xc5'),_0x6616f0[_0x9169('0x96')]['id'])['toParam']();return db['sequelize']['query'](_0x29962e[_0x9169('0xc6')],{'replacements':_0x29962e[_0x9169('0x9f')]});}})[_0x9169('0x2c')](function(){if(_0x6616f0[_0x9169('0xa1')][_0x9169('0xc7')]&&_0x5a9c3d){return db[_0x9169('0xa6')][_0x9169('0x2b')]({'phone':_0x6616f0['body'][_0x9169('0xc7')]},{'where':{'ContactId':_0x5a9c3d['id']}});}})[_0x9169('0x2c')](function(){return _0x5a9c3d;})['then'](respondWithResult(_0x4997b0,null))['catch'](handleError(_0x4997b0,null));};exports[_0x9169('0xc8')]=function(_0x40c914,_0x4ea8d4,_0x38f6a6){var _0x133a98={};var _0x270efc={};var _0x409a75;var _0x1bd52a;return db['CmContact'][_0x9169('0x38')]({'where':{'id':_0x40c914[_0x9169('0x96')]['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x4ea8d4,null))[_0x9169('0x2c')](function(_0x18475f){if(_0x18475f){_0x409a75=_0x18475f;_0x270efc[_0x9169('0x3d')]=_[_0x9169('0x34')](db['Tag'][_0x9169('0xc9')]);_0x270efc[_0x9169('0x3e')]=_[_0x9169('0x34')](_0x40c914[_0x9169('0x3e')]);_0x270efc[_0x9169('0x3f')]=_[_0x9169('0x40')](_0x270efc['model'],_0x270efc[_0x9169('0x3e')]);_0x133a98['attributes']=_[_0x9169('0x40')](_0x270efc['model'],qs[_0x9169('0x41')](_0x40c914[_0x9169('0x3e')][_0x9169('0x41')]));_0x133a98[_0x9169('0x42')]=_0x133a98[_0x9169('0x42')][_0x9169('0x35')]?_0x133a98['attributes']:_0x270efc['model'];_0x133a98[_0x9169('0x7f')]=qs[_0x9169('0x45')](_0x40c914[_0x9169('0x3e')][_0x9169('0x45')]);_0x133a98[_0x9169('0x46')]=qs[_0x9169('0x3f')](_['pick'](_0x40c914['query'],_0x270efc['filters']));if(_0x40c914[_0x9169('0x3e')][_0x9169('0x65')]){_0x133a98[_0x9169('0x46')]=_[_0x9169('0xa0')](_0x133a98[_0x9169('0x46')],{'$or':_[_0x9169('0x5b')](_0x133a98[_0x9169('0x42')],function(_0x3485ab){var _0x2cebd8={};_0x2cebd8[_0x3485ab]={'$like':'%'+_0x40c914[_0x9169('0x3e')][_0x9169('0x65')]+'%'};return _0x2cebd8;})});}_0x133a98=_['merge']({},_0x133a98,_0x40c914[_0x9169('0xca')]);return _0x409a75[_0x9169('0xc8')](_0x133a98);}})[_0x9169('0x2c')](function(_0x4a5507){if(_0x4a5507){_0x1bd52a=_0x4a5507[_0x9169('0x35')];if(!_0x40c914[_0x9169('0x3e')][_0x9169('0x43')](_0x9169('0x44'))){_0x133a98[_0x9169('0x26')]=qs[_0x9169('0x26')](_0x40c914[_0x9169('0x3e')][_0x9169('0x26')]);_0x133a98[_0x9169('0x23')]=qs[_0x9169('0x23')](_0x40c914[_0x9169('0x3e')][_0x9169('0x23')]);}return _0x409a75[_0x9169('0xc8')](_0x133a98);}})[_0x9169('0x2c')](function(_0x55bb7c){if(_0x55bb7c){return _0x55bb7c?{'count':_0x1bd52a,'rows':_0x55bb7c}:null;}})[_0x9169('0x2c')](respondWithResult(_0x4ea8d4,null))[_0x9169('0x97')](handleError(_0x4ea8d4,null));};exports[_0x9169('0xcb')]=function(_0x3cbd3b,_0x46e4c4,_0x270a69){if(_0x3cbd3b[_0x9169('0xa1')]['id']){delete _0x3cbd3b[_0x9169('0xa1')]['id'];}return db[_0x9169('0x32')]['findOne']({'where':{'id':_0x3cbd3b[_0x9169('0x96')]['id']}})['then'](handleEntityNotFound(_0x46e4c4,null))[_0x9169('0x2c')](function(_0x2f6f40){if(_0x2f6f40){return _0x2f6f40[_0x9169('0xcb')](_0x3cbd3b[_0x9169('0xa1')][_0x9169('0xcc')]||[]);}return null;})['then'](respondWithResult(_0x46e4c4,null))[_0x9169('0x97')](handleError(_0x46e4c4,null));};exports[_0x9169('0xcd')]=function(_0x1fcc84,_0x4c4ec9,_0x15391c){var _0x4b4016={'raw':![],'where':{}};var _0x28865c={};var _0x405cfb={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x1fcc84[_0x9169('0x96')]['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x4c4ec9,null))[_0x9169('0x2c')](function(_0x38834f){if(_0x38834f){_0x28865c['model']=_[_0x9169('0x34')](db[_0x9169('0xa6')][_0x9169('0xc9')]);_0x28865c[_0x9169('0x3e')]=_[_0x9169('0x34')](_0x1fcc84['query']);_0x28865c['filters']=_[_0x9169('0x40')](_0x28865c[_0x9169('0x3d')],_0x28865c['query']);_0x4b4016[_0x9169('0x42')]=_['intersection'](_0x28865c['model'],qs[_0x9169('0x41')](_0x1fcc84[_0x9169('0x3e')][_0x9169('0x41')]));_0x4b4016[_0x9169('0x42')]=_0x4b4016[_0x9169('0x42')][_0x9169('0x35')]?_0x4b4016[_0x9169('0x42')]:_0x28865c[_0x9169('0x3d')];if(!_0x1fcc84[_0x9169('0x3e')][_0x9169('0x43')](_0x9169('0x44'))){_0x4b4016['limit']=qs[_0x9169('0x26')](_0x1fcc84[_0x9169('0x3e')][_0x9169('0x26')]);_0x4b4016['offset']=qs[_0x9169('0x23')](_0x1fcc84[_0x9169('0x3e')]['offset']);}_0x4b4016[_0x9169('0x7f')]=qs['sort'](_0x1fcc84[_0x9169('0x3e')]['sort']);_0x4b4016[_0x9169('0x46')]=qs['filters'](_['pick'](_0x1fcc84[_0x9169('0x3e')],_0x28865c[_0x9169('0x3f')]));_0x4b4016['where'][_0x9169('0xce')]=_0x38834f['id'];if(_0x1fcc84['query'][_0x9169('0x65')]){_0x4b4016[_0x9169('0x46')]=_[_0x9169('0xa0')](_0x4b4016[_0x9169('0x46')],{'$or':_[_0x9169('0x5b')](_0x4b4016[_0x9169('0x42')],function(_0x41bad5){var _0x2ce651={};_0x2ce651[_0x41bad5]={'$like':'%'+_0x1fcc84['query'][_0x9169('0x65')]+'%'};return _0x2ce651;})});}_0x4b4016=_[_0x9169('0xa0')]({},_0x4b4016,_0x1fcc84[_0x9169('0xca')]);return db['CmHopper']['count']({'where':_0x4b4016[_0x9169('0x46')]})[_0x9169('0x2c')](function(_0xe91145){_0x405cfb[_0x9169('0x25')]=_0xe91145;if(_0x1fcc84[_0x9169('0x3e')][_0x9169('0xcf')]){_0x4b4016['include']=[{'all':!![]}];}return db[_0x9169('0xa6')][_0x9169('0x9c')](_0x4b4016);})['then'](function(_0x54dc1e){_0x405cfb['rows']=_0x54dc1e;return _0x405cfb;});}})[_0x9169('0x2c')](respondWithFilteredResult(_0x4c4ec9,_0x4b4016))[_0x9169('0x97')](handleError(_0x4c4ec9,null));};exports[_0x9169('0xd0')]=function(_0x12a135,_0x1404c2,_0x573b82){var _0x9eaeb0={'raw':!![],'where':{}};var _0x1edd43={};var _0x509a2b={'count':0x0,'rows':[]};return db[_0x9169('0x32')][_0x9169('0x38')]({'where':{'id':_0x12a135[_0x9169('0x96')]['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x1404c2,null))['then'](function(_0x2bfefa){if(_0x2bfefa){_0x1edd43[_0x9169('0x3d')]=_[_0x9169('0x34')](db[_0x9169('0xb2')][_0x9169('0xc9')]);_0x1edd43[_0x9169('0x3e')]=_[_0x9169('0x34')](_0x12a135['query']);_0x1edd43[_0x9169('0x3f')]=_[_0x9169('0x40')](_0x1edd43[_0x9169('0x3d')],_0x1edd43[_0x9169('0x3e')]);_0x9eaeb0[_0x9169('0x42')]=_[_0x9169('0x40')](_0x1edd43[_0x9169('0x3d')],qs[_0x9169('0x41')](_0x12a135['query'][_0x9169('0x41')]));_0x9eaeb0[_0x9169('0x42')]=_0x9eaeb0[_0x9169('0x42')][_0x9169('0x35')]?_0x9eaeb0[_0x9169('0x42')]:_0x1edd43['model'];if(!_0x12a135[_0x9169('0x3e')]['hasOwnProperty']('nolimit')){_0x9eaeb0[_0x9169('0x26')]=qs[_0x9169('0x26')](_0x12a135[_0x9169('0x3e')][_0x9169('0x26')]);_0x9eaeb0[_0x9169('0x23')]=qs[_0x9169('0x23')](_0x12a135[_0x9169('0x3e')]['offset']);}_0x9eaeb0[_0x9169('0x7f')]=qs['sort'](_0x12a135[_0x9169('0x3e')]['sort']);_0x9eaeb0[_0x9169('0x46')]=qs[_0x9169('0x3f')](_[_0x9169('0x47')](_0x12a135[_0x9169('0x3e')],_0x1edd43[_0x9169('0x3f')]));_0x9eaeb0[_0x9169('0x46')][_0x9169('0xce')]=_0x2bfefa['id'];if(_0x12a135[_0x9169('0x3e')][_0x9169('0x65')]){_0x9eaeb0[_0x9169('0x46')]=_[_0x9169('0xa0')](_0x9eaeb0[_0x9169('0x46')],{'$or':_[_0x9169('0x5b')](_0x9eaeb0['attributes'],function(_0x5db7f4){var _0x42e036={};_0x42e036[_0x5db7f4]={'$like':'%'+_0x12a135['query'][_0x9169('0x65')]+'%'};return _0x42e036;})});}_0x9eaeb0=_[_0x9169('0xa0')]({},_0x9eaeb0,_0x12a135['options']);return db[_0x9169('0xb2')][_0x9169('0x25')]({'where':_0x9eaeb0[_0x9169('0x46')]})[_0x9169('0x2c')](function(_0xa2f42f){_0x509a2b['count']=_0xa2f42f;if(_0x12a135[_0x9169('0x3e')][_0x9169('0xcf')]){_0x9eaeb0[_0x9169('0xd1')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9169('0x9c')](_0x9eaeb0);})[_0x9169('0x2c')](function(_0x4acac6){_0x509a2b['rows']=_0x4acac6;return _0x509a2b;});}})[_0x9169('0x2c')](respondWithFilteredResult(_0x1404c2,_0x9eaeb0))['catch'](handleError(_0x1404c2,null));};exports[_0x9169('0xd2')]=function(_0x23b955,_0x2956b7,_0x18513b){var _0x7bbb9f={'raw':!![],'where':{}};var _0x2271fe={};var _0x2d57bc={'count':0x0,'rows':[]};return db[_0x9169('0x32')]['findOne']({'where':{'id':_0x23b955[_0x9169('0x96')]['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x2956b7,null))[_0x9169('0x2c')](function(_0x383fc9){if(_0x383fc9){_0x2271fe[_0x9169('0x3d')]=_[_0x9169('0x34')](db['CmHopperFinal'][_0x9169('0xc9')]);_0x2271fe[_0x9169('0x3e')]=_['keys'](_0x23b955[_0x9169('0x3e')]);_0x2271fe[_0x9169('0x3f')]=_[_0x9169('0x40')](_0x2271fe[_0x9169('0x3d')],_0x2271fe[_0x9169('0x3e')]);_0x7bbb9f[_0x9169('0x42')]=_[_0x9169('0x40')](_0x2271fe[_0x9169('0x3d')],qs[_0x9169('0x41')](_0x23b955[_0x9169('0x3e')][_0x9169('0x41')]));_0x7bbb9f['attributes']=_0x7bbb9f[_0x9169('0x42')]['length']?_0x7bbb9f[_0x9169('0x42')]:_0x2271fe[_0x9169('0x3d')];if(!_0x23b955[_0x9169('0x3e')][_0x9169('0x43')](_0x9169('0x44'))){_0x7bbb9f['limit']=qs[_0x9169('0x26')](_0x23b955[_0x9169('0x3e')][_0x9169('0x26')]);_0x7bbb9f[_0x9169('0x23')]=qs[_0x9169('0x23')](_0x23b955[_0x9169('0x3e')][_0x9169('0x23')]);}_0x7bbb9f['order']=qs[_0x9169('0x45')](_0x23b955['query'][_0x9169('0x45')]);_0x7bbb9f[_0x9169('0x46')]=qs[_0x9169('0x3f')](_[_0x9169('0x47')](_0x23b955[_0x9169('0x3e')],_0x2271fe['filters']));_0x7bbb9f[_0x9169('0x46')][_0x9169('0xce')]=_0x383fc9['id'];if(_0x23b955[_0x9169('0x3e')][_0x9169('0x65')]){_0x7bbb9f[_0x9169('0x46')]=_[_0x9169('0xa0')](_0x7bbb9f[_0x9169('0x46')],{'$or':_['map'](_0x7bbb9f[_0x9169('0x42')],function(_0x5ed2a4){var _0x172a21={};_0x172a21[_0x5ed2a4]={'$like':'%'+_0x23b955[_0x9169('0x3e')]['filter']+'%'};return _0x172a21;})});}_0x7bbb9f=_[_0x9169('0xa0')]({},_0x7bbb9f,_0x23b955[_0x9169('0xca')]);return db[_0x9169('0xb1')][_0x9169('0x25')]({'where':_0x7bbb9f[_0x9169('0x46')]})[_0x9169('0x2c')](function(_0x537cc7){_0x2d57bc[_0x9169('0x25')]=_0x537cc7;if(_0x23b955[_0x9169('0x3e')][_0x9169('0xcf')]){_0x7bbb9f[_0x9169('0xd1')]=[{'all':!![]}];}return db[_0x9169('0xb1')][_0x9169('0x9c')](_0x7bbb9f);})[_0x9169('0x2c')](function(_0x35fdc0){_0x2d57bc[_0x9169('0xd3')]=_0x35fdc0;return _0x2d57bc;});}})[_0x9169('0x2c')](respondWithFilteredResult(_0x2956b7,_0x7bbb9f))[_0x9169('0x97')](handleError(_0x2956b7,null));};exports[_0x9169('0xd4')]=function(_0x44f8a9,_0x1fdd5d,_0x19c796){var _0x80a174={'raw':!![],'where':{}};var _0x5146f9={};var _0x3c77b8={'count':0x0,'rows':[]};return db[_0x9169('0x32')][_0x9169('0x38')]({'where':{'id':_0x44f8a9[_0x9169('0x96')]['id']}})[_0x9169('0x2c')](handleEntityNotFound(_0x1fdd5d,null))[_0x9169('0x2c')](function(_0x5690ae){if(_0x5690ae){_0x5146f9[_0x9169('0x3d')]=_[_0x9169('0x34')](db[_0x9169('0xb8')][_0x9169('0xc9')]);_0x5146f9[_0x9169('0x3e')]=_[_0x9169('0x34')](_0x44f8a9[_0x9169('0x3e')]);_0x5146f9[_0x9169('0x3f')]=_[_0x9169('0x40')](_0x5146f9['model'],_0x5146f9[_0x9169('0x3e')]);_0x80a174[_0x9169('0x42')]=_['intersection'](_0x5146f9[_0x9169('0x3d')],qs['fields'](_0x44f8a9[_0x9169('0x3e')][_0x9169('0x41')]));_0x80a174[_0x9169('0x42')]=_0x80a174[_0x9169('0x42')][_0x9169('0x35')]?_0x80a174[_0x9169('0x42')]:_0x5146f9[_0x9169('0x3d')];if(!_0x44f8a9[_0x9169('0x3e')][_0x9169('0x43')](_0x9169('0x44'))){_0x80a174[_0x9169('0x26')]=qs['limit'](_0x44f8a9['query'][_0x9169('0x26')]);_0x80a174['offset']=qs[_0x9169('0x23')](_0x44f8a9[_0x9169('0x3e')][_0x9169('0x23')]);}_0x80a174[_0x9169('0x7f')]=qs[_0x9169('0x45')](_0x44f8a9[_0x9169('0x3e')][_0x9169('0x45')]);_0x80a174[_0x9169('0x46')]=qs[_0x9169('0x3f')](_[_0x9169('0x47')](_0x44f8a9[_0x9169('0x3e')],_0x5146f9['filters']));_0x80a174['where']['ContactId']=_0x5690ae['id'];if(_0x44f8a9[_0x9169('0x3e')][_0x9169('0x65')]){_0x80a174['where']=_[_0x9169('0xa0')](_0x80a174[_0x9169('0x46')],{'$or':_[_0x9169('0x5b')](_0x80a174[_0x9169('0x42')],function(_0x27a14c){var _0x4e68d5={};_0x4e68d5[_0x27a14c]={'$like':'%'+_0x44f8a9['query'][_0x9169('0x65')]+'%'};return _0x4e68d5;})});}_0x80a174=_['merge']({},_0x80a174,_0x44f8a9[_0x9169('0xca')]);return db[_0x9169('0xb8')]['count']({'where':_0x80a174[_0x9169('0x46')]})[_0x9169('0x2c')](function(_0x48ef33){_0x3c77b8['count']=_0x48ef33;if(_0x44f8a9['query'][_0x9169('0xcf')]){_0x80a174[_0x9169('0xd1')]=[{'all':!![]}];}return db[_0x9169('0xb8')][_0x9169('0x9c')](_0x80a174);})[_0x9169('0x2c')](function(_0x4dc65c){_0x3c77b8[_0x9169('0xd3')]=_0x4dc65c;return _0x3c77b8;});}})[_0x9169('0x2c')](respondWithFilteredResult(_0x1fdd5d,_0x80a174))[_0x9169('0x97')](handleError(_0x1fdd5d,null));};exports['uploadCsv']=function(_0x2510e9,_0x327254,_0x45942d){try{if(!_0x2510e9[_0x9169('0xa1')]['ListId']){throw new Error(_0x9169('0xd5'));}if(!_0x2510e9[_0x9169('0xa1')][_0x9169('0xd6')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x2510e9[_0x9169('0xa1')]['binding_values']){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x2510e9['body'][_0x9169('0xd7')]){throw new Error(_0x9169('0xd8'));}var _0x4a9f91=_0x2510e9[_0x9169('0xa1')][_0x9169('0xd6')]['split'](',');var _0xce1f50=_0x2510e9[_0x9169('0xa1')][_0x9169('0xd9')][_0x9169('0x5a')](',');if(!_0x4a9f91[_0x9169('0x35')]||!_0xce1f50[_0x9169('0x35')]||_0x4a9f91['length']!==_0xce1f50[_0x9169('0x35')]){throw new Error(_0x9169('0xda'));}_0x2510e9[_0x9169('0xa1')][_0x9169('0x41')]=_['zipObject'](_0x4a9f91,_0xce1f50);if(!_0x2510e9[_0x9169('0xa1')][_0x9169('0x41')][_0x9169('0xc7')]){throw new Error(_0x9169('0xdb'));}if(!_0x2510e9[_0x9169('0xa1')][_0x9169('0x41')][_0x9169('0xdc')]){throw new Error(_0x9169('0xdd'));}var _0x28fd12=path[_0x9169('0xa4')](config[_0x9169('0xde')],_0x9169('0xdf'),_0x2510e9[_0x9169('0xe0')][_0x9169('0xe1')]);fs['chmodSync'](_0x28fd12,parseInt(_0x9169('0xe2'),0x8));var _0xe09b73=require(_0x9169('0xe3'))[_0x9169('0xe4')](path['join'](__dirname,_0x9169('0xe5')),[_0x28fd12,_0x2510e9[_0x9169('0xa1')][_0x9169('0xd6')],_0x2510e9[_0x9169('0xa1')]['binding_values'],_0x2510e9[_0x9169('0xa1')][_0x9169('0x68')],_0x2510e9[_0x9169('0xa1')][_0x9169('0xe6')],_0x2510e9[_0x9169('0xa1')][_0x9169('0xbb')],_0x2510e9['body'][_0x9169('0xd7')]]);return _0x327254[_0x9169('0x21')](0xc8)[_0x9169('0x22')]({'message':_0x9169('0xe7'),'pid':_0xe09b73[_0x9169('0xe8')]});}catch(_0x37ceb9){return _0x327254[_0x9169('0x21')](0x1f4)[_0x9169('0x30')](_0x37ceb9);}};exports[_0x9169('0xe9')]=function(_0x1a6453,_0x458c11,_0x2fab60){var _0x9d403a=fs[_0x9169('0xea')](_0x1a6453[_0x9169('0xe0')][_0x9169('0x7')]);Papa[_0x9169('0xeb')](_0x9d403a,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x180620){return _0x458c11[_0x9169('0x21')](0xc8)['json']({'file':_0x1a6453[_0x9169('0xe0')],'fields':_0x180620[_0x9169('0xec')][_0x9169('0x41')]});}});};exports[_0x9169('0xed')]=function(_0x494243,_0x1b53d6,_0x5ae58b){return db[_0x9169('0x5f')][_0x9169('0x9c')]({'raw':!![],'attributes':['id'],'where':{'role':_0x9169('0x83')}})[_0x9169('0x2c')](function(_0x98efeb){var _0x127095=![];if(!_0x494243['body'][_0x9169('0x68')]){throw new Error('No\x20ListId\x20specified');}if(!_0x494243[_0x9169('0xa1')][_0x9169('0xee')]['phone']){throw new Error(_0x9169('0xdb'));}if(!_0x494243[_0x9169('0xa1')][_0x9169('0xee')][_0x9169('0xdc')]){throw new Error(_0x9169('0xdd'));}if(!_0x494243[_0x9169('0xa1')][_0x9169('0xd7')]){throw new Error(_0x9169('0xd8'));}var _0x253dd5=require('child_process')[_0x9169('0xe4')](path[_0x9169('0xa4')](__dirname,_0x9169('0xef')),[_0x494243['params']['id'],JSON[_0x9169('0xf0')](_0x494243[_0x9169('0xa1')]),JSON[_0x9169('0xf0')](_0x98efeb)]);_0x253dd5['on'](_0x9169('0xf1'),function(_0x36c136){_0x127095=!![];return _0x1b53d6[_0x9169('0x21')](0xc8)['json']({'message':_0x9169('0xf2'),'pid':_0x253dd5[_0x9169('0xe8')]});});_0x253dd5['on']('exit',function(_0x592641){if(_0x592641&&!_0x127095){return _0x1b53d6['status'](0x1f4)['json']({'message':_0x9169('0xf3'),'pid':_0x253dd5[_0x9169('0xe8')]});}});})['catch'](handleError(_0x1b53d6,null));};exports[_0x9169('0xf4')]=function(_0x2cbc23,_0x40af4d){var _0x2964f9=[_0x9169('0xf5'),'chat',_0x9169('0xf6'),_0x9169('0xf7'),'fax',_0x9169('0xf8'),'voice'];var _0x5c1c43={'offset':0x0,'order':qs['sort'](_0x9169('0xf9'))},_0x5239ee={'count':0x0,'rows':[]};Promise[_0x9169('0xfa')]()[_0x9169('0x2c')](function(){if(_0x2cbc23[_0x9169('0x3e')][_0x9169('0xfb')]){if(!_['includes'](_0x2964f9,_0x2cbc23[_0x9169('0x3e')]['channel'][_0x9169('0xfc')]())){throw new Error('Invalid\x20channel');}_0x2964f9=[_0x2cbc23[_0x9169('0x3e')]['channel'][_0x9169('0xfc')]()];}if(_0x2cbc23[_0x9169('0x3e')][_0x9169('0xfd')]){try{var _0x5f4b38=JSON[_0x9169('0xeb')](_0x2cbc23['query'][_0x9169('0xfd')]);if(!moment(_0x5f4b38['from'])['isValid']()){throw new Error(_0x9169('0xfe'));}if(!moment(_0x5f4b38['to'])[_0x9169('0xff')]()){throw new Error(_0x9169('0x100'));}}catch(_0x5ac6fc){throw new Error(_0x9169('0x101'));}}if(!_0x2cbc23[_0x9169('0x3e')]['hasOwnProperty'](_0x9169('0x44'))){_0x5c1c43['limit']=qs['limit'](_0x2cbc23[_0x9169('0x3e')][_0x9169('0x26')]||0xa);_0x5c1c43[_0x9169('0x23')]=qs[_0x9169('0x23')](_0x2cbc23[_0x9169('0x3e')][_0x9169('0x23')]);}var _0x4f6e2a=_0x2964f9[_0x9169('0x5b')](function(_0x3b6523){if(_0x3b6523==='voice'){var _0x46479b={'attributes':['id',_0x9169('0x102'),_0x9169('0x3c'),_0x9169('0x103'),_0x9169('0x104'),'callerid',_0x9169('0x105'),_0x9169('0x106'),'duration','note',_0x9169('0x107'),_0x9169('0x108'),'userSecondDisposition',_0x9169('0x109'),'UserId'],'where':{'ContactId':_0x2cbc23[_0x9169('0x96')]['id']},'include':[{'model':db[_0x9169('0x5f')],'as':_0x9169('0x5f'),'attributes':['id',_0x9169('0x2f'),_0x9169('0x10a'),_0x9169('0x9d')]}],'order':[[_0x9169('0x107'),_0x9169('0x10b')]]};if(_0x2cbc23['query'][_0x9169('0xfd')]){_0x46479b[_0x9169('0x46')]['createdAt']={'$gte':_0x5f4b38[_0x9169('0x4b')],'$lte':_0x5f4b38['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x46479b)[_0x9169('0x2c')](function(_0x3265de){_0x5239ee[_0x9169('0x25')]+=_0x3265de[_0x9169('0x25')];return _['map'](_0x3265de[_0x9169('0xd3')],function(_0x2d0194){var _0x272446=_0x2d0194[_0x9169('0xa2')]({'plain':!![]});_0x272446['channel']=_0x3b6523;if(_0x272446[_0x9169('0x5f')]){_0x272446['User']={'id':_0x272446[_0x9169('0x5f')]['id'],'name':_0x272446[_0x9169('0x5f')]['name'],'fullname':_0x272446[_0x9169('0x5f')]['fullname'],'alias':_0x272446[_0x9169('0x5f')][_0x9169('0x9d')]};}return _0x272446;});});}else{var _0x2f16fb=_[_0x9169('0x10c')](_0x3b6523)+(_0x3b6523==='chat'?'Website':_0x9169('0x10d'));var _0x182f9f={'attributes':['id',_0x9169('0x10e'),_0x9169('0x10f'),'createdAt',_0x9169('0x110'),'disposition',_0x9169('0x111'),_0x9169('0x112'),_0x9169('0x113'),_0x2f16fb+'Id'],'where':{'ContactId':_0x2cbc23[_0x9169('0x96')]['id']},'include':[{'model':db[_0x2f16fb],'as':_0x9169('0x10d'),'attributes':['id',_0x9169('0x2f'),_0x9169('0x114')]},{'model':db[_0x9169('0x5f')],'as':_0x9169('0x115'),'attributes':['id','name',_0x9169('0x10a')]},{'model':db[_0x9169('0x59')],'as':_0x9169('0x95'),'attributes':['id',_0x9169('0x2f'),_0x9169('0x4a')],'through':{'attributes':[]}}],'order':[[_0x9169('0x107'),_0x9169('0x10b')]]};if(_0x2cbc23[_0x9169('0x3e')][_0x9169('0xfd')]){_0x182f9f[_0x9169('0x46')][_0x9169('0x107')]={'$gte':_0x5f4b38[_0x9169('0x4b')],'$lte':_0x5f4b38['to']};}switch(_0x3b6523){case _0x9169('0x116'):_0x182f9f[_0x9169('0x42')][_0x9169('0x36')](_0x9169('0x117'),_0x9169('0x118'),_0x9169('0x119'),_0x9169('0x11a'),'osName','ratingMessage',_0x9169('0x11b'),_0x9169('0x11c'),'referer');break;case _0x9169('0xf5'):_0x182f9f[_0x9169('0x42')][_0x9169('0x36')](_0x9169('0x11d'),_0x9169('0x11e'));break;case _0x9169('0xf7'):_0x182f9f[_0x9169('0x42')][_0x9169('0x36')](_0x9169('0x11f'),'threadId');break;}return db[_[_0x9169('0x10c')](_0x3b6523)+_0x9169('0x120')]['findAndCountAll'](_0x182f9f)[_0x9169('0x2c')](function(_0x59a3c0){_0x5239ee['count']+=_0x59a3c0[_0x9169('0x25')];return _[_0x9169('0x5b')](_0x59a3c0[_0x9169('0xd3')],function(_0x5ae360){var _0x2d5d69=_0x5ae360[_0x9169('0xa2')]({'plain':!![]});_0x2d5d69[_0x9169('0xfb')]=_0x3b6523;if(_0x2d5d69[_0x9169('0x115')]){_0x2d5d69['Owner']={'id':_0x2d5d69[_0x9169('0x115')]['id'],'name':_0x2d5d69['Owner'][_0x9169('0x2f')],'fullname':_0x2d5d69[_0x9169('0x115')][_0x9169('0x10a')]};}return _0x2d5d69;});});}});return Promise['all'](_0x4f6e2a);})[_0x9169('0x2c')](function(_0x176340){return _(_0x176340)[_0x9169('0x121')]()[_0x9169('0x122')](_0x9169('0x107'))['reverse']()[_0x9169('0x62')]();})[_0x9169('0x2c')](function(_0x688ef6){_0x5239ee['rows']=_0x5c1c43[_0x9169('0x26')]?_0x688ef6[_0x9169('0x123')](_0x5c1c43[_0x9169('0x23')],_0x5c1c43[_0x9169('0x23')]+_0x5c1c43[_0x9169('0x26')]):_0x688ef6;return _0x5239ee;})['then'](respondWithFilteredResult(_0x40af4d,_0x5c1c43))[_0x9169('0x97')](handleError(_0x40af4d,null));};
\ No newline at end of file
+var _0x1218=['c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','CmContact','tags','columnName','displayName','custom','values','body','findAll','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','show','params','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','findOne','rawAttributes','options','getTags','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','firstName','root','server/files/tmp','file','filename','chmodSync','fork','CompanyId','socket_timestamp','pid','createReadStream','parse','meta','import','binding','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','child_process','stringify','message','exit','getJourney','sms','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','mail','openchannel','externalUrl','startCase','Interaction','flatten','sortBy','slice','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','name','send','index','describe','keys','startsWith','cf_','CmCustomField','all','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','length','find','Tag','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','dateOfBirth','fieldType','datetime','castTo','DATE','text','start','filter','isNil','push','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','getFullTextValue','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','resolve','user','role','some','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.mobile','c.fax'];(function(_0x2196b7,_0x3c0dc6){var _0x220543=function(_0x575dee){while(--_0x575dee){_0x2196b7['push'](_0x2196b7['shift']());}};_0x220543(++_0x3c0dc6);}(_0x1218,0x1b6));var _0x8121=function(_0x149bec,_0x1907ad){_0x149bec=_0x149bec-0x0;var _0x2b42cf=_0x1218[_0x149bec];return _0x2b42cf;};'use strict';var emlformat=require(_0x8121('0x0'));var rimraf=require(_0x8121('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8121('0x2'));var rp=require(_0x8121('0x3'));var moment=require(_0x8121('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8121('0x5'));var path=require(_0x8121('0x6'));var sox=require(_0x8121('0x7'));var csv=require(_0x8121('0x8'));var ejs=require(_0x8121('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8121('0xa'));var squel=require(_0x8121('0xb'));var crypto=require('crypto');var jsforce=require(_0x8121('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8121('0x8'));var querystring=require('querystring');var Papa=require(_0x8121('0xd'));var Redis=require(_0x8121('0xe'));var authService=require(_0x8121('0xf'));var qs=require(_0x8121('0x10'));var as=require(_0x8121('0x11'));var hardwareService=require(_0x8121('0x12'));var logger=require(_0x8121('0x13'))(_0x8121('0x14'));var utils=require(_0x8121('0x15'));var config=require(_0x8121('0x16'));var licenseUtil=require(_0x8121('0x17'));var db=require('../../mysqldb')['db'];config[_0x8121('0x18')]=_[_0x8121('0x19')](config[_0x8121('0x18')],{'host':_0x8121('0x1a'),'port':0x18eb});var socket=require(_0x8121('0x1b'))(new Redis(config[_0x8121('0x18')]));require('./cmContact.socket')[_0x8121('0x1c')](socket);function respondWithStatusCode(_0x5bec4f,_0x2338f1){_0x2338f1=_0x2338f1||0xcc;return function(_0x20a78d){if(_0x20a78d){return _0x5bec4f[_0x8121('0x1d')](_0x2338f1);}return _0x5bec4f[_0x8121('0x1e')](_0x2338f1)[_0x8121('0x1f')]();};}function respondWithResult(_0x1dc04b,_0x3f8bdf){_0x3f8bdf=_0x3f8bdf||0xc8;return function(_0x2e0f12){if(_0x2e0f12){return _0x1dc04b[_0x8121('0x1e')](_0x3f8bdf)['json'](_0x2e0f12);}};}function respondWithFilteredResult(_0x304851,_0x506949){return function(_0x258812){if(_0x258812){var _0x3fbf0d=typeof _0x506949[_0x8121('0x20')]===_0x8121('0x21')&&typeof _0x506949[_0x8121('0x22')]===_0x8121('0x21');var _0x2f515a=_0x258812[_0x8121('0x23')];var _0x3677de=_0x3fbf0d?0x0:_0x506949[_0x8121('0x20')];var _0x5a90e9=_0x3fbf0d?_0x258812[_0x8121('0x23')]:_0x506949[_0x8121('0x20')]+_0x506949[_0x8121('0x22')];var _0x56628f;if(_0x5a90e9>=_0x2f515a){_0x5a90e9=_0x2f515a;_0x56628f=0xc8;}else{_0x56628f=0xce;}_0x304851[_0x8121('0x1e')](_0x56628f);return _0x304851[_0x8121('0x24')](_0x8121('0x25'),_0x3677de+'-'+_0x5a90e9+'/'+_0x2f515a)[_0x8121('0x26')](_0x258812);}return null;};}function patchUpdates(_0x33f8a6){return function(_0x22b757){try{jsonpatch[_0x8121('0x27')](_0x22b757,_0x33f8a6,!![]);}catch(_0x42c153){return BPromise['reject'](_0x42c153);}return _0x22b757[_0x8121('0x28')]();};}function saveUpdates(_0x22af04,_0x494571){return function(_0x3e1875){if(_0x3e1875){return _0x3e1875['update'](_0x22af04)[_0x8121('0x29')](function(_0x1287ff){return _0x1287ff;});}return null;};}function removeEntity(_0x1e20f7,_0x2d1a6a){return function(_0x48a423){if(_0x48a423){return _0x48a423['destroy']()['then'](function(){_0x1e20f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3b6c,_0xeec124){return function(_0x129869){if(!_0x129869){_0x2d3b6c[_0x8121('0x1d')](0x194);}return _0x129869;};}function handleError(_0x446059,_0x57a07e){_0x57a07e=_0x57a07e||0x1f4;return function(_0x2cff78){logger[_0x8121('0x2a')](_0x2cff78['stack']);if(_0x2cff78['name']){delete _0x2cff78[_0x8121('0x2b')];}_0x446059[_0x8121('0x1e')](_0x57a07e)[_0x8121('0x2c')](_0x2cff78);};}exports[_0x8121('0x2d')]=function(_0x2782cf,_0xc89dc){var _0xd3d67e={},_0x36adc5={},_0x4f6cee={'count':0x0,'rows':[]};return db['CmContact'][_0x8121('0x2e')]()[_0x8121('0x29')](function(_0xc8260f){var _0x5e12a9=[];for(var _0x1924e6=0x0;_0x1924e6<Object[_0x8121('0x2f')](_0xc8260f)['length'];_0x1924e6++){var _0x7ab143=Object[_0x8121('0x2f')](_0xc8260f)[_0x1924e6];if(_[_0x8121('0x30')](_0x7ab143,_0x8121('0x31'))){_0x5e12a9['push'](db[_0x8121('0x32')]['findOne']({'where':{'id':_['trimStart'](_0x7ab143,_0x8121('0x31'))},'raw':!![]}));}}return BPromise[_0x8121('0x33')](_0x5e12a9)[_0x8121('0x29')](function(_0x1d6dc5){for(var _0x3a4976=0x0;_0x3a4976<_0x1d6dc5['length'];_0x3a4976++){if(_0x1d6dc5[_0x3a4976]){var _0x43478c='cf_'+_0x1d6dc5[_0x3a4976]['id'];var _0x1327bb=_0xc8260f[_0x43478c];_0x1327bb['fieldType']=_0x1d6dc5[_0x3a4976][_0x8121('0x34')];}}return _0xc8260f;});})[_0x8121('0x29')](function(_0x517525){_0x36adc5[_0x8121('0x35')]=_[_0x8121('0x2f')](_0x517525);_0x36adc5[_0x8121('0x36')]=_[_0x8121('0x2f')](_0x2782cf[_0x8121('0x36')]);_0x36adc5[_0x8121('0x37')]=_[_0x8121('0x38')](_0x36adc5['model'],_0x36adc5[_0x8121('0x36')]);_0xd3d67e[_0x8121('0x39')]=_[_0x8121('0x38')](_0x36adc5[_0x8121('0x35')],qs[_0x8121('0x3a')](_0x2782cf[_0x8121('0x36')][_0x8121('0x3a')]));_0xd3d67e[_0x8121('0x39')]=_0xd3d67e[_0x8121('0x39')]['length']?_0xd3d67e['attributes']:_0x36adc5[_0x8121('0x35')];if(!_0x2782cf['query'][_0x8121('0x3b')](_0x8121('0x3c'))){_0xd3d67e[_0x8121('0x22')]=qs[_0x8121('0x22')](_0x2782cf[_0x8121('0x36')]['limit']);_0xd3d67e[_0x8121('0x20')]=qs[_0x8121('0x20')](_0x2782cf[_0x8121('0x36')][_0x8121('0x20')]);}_0xd3d67e[_0x8121('0x3d')]=qs['sort'](_0x2782cf[_0x8121('0x36')][_0x8121('0x3e')]);_0xd3d67e[_0x8121('0x3f')]=qs[_0x8121('0x37')](_[_0x8121('0x40')](_0x2782cf[_0x8121('0x36')],_0x36adc5['filters']),_0x517525);var _0x2c0b68=[];var _0x45384b=squel[_0x8121('0x41')]()[_0x8121('0x42')]('id')[_0x8121('0x42')](_0x8121('0x2b'))[_0x8121('0x42')](_0x8121('0x43'))[_0x8121('0x44')]('tools_tags');var _0x273fd7=squel[_0x8121('0x41')]()['from'](_0x8121('0x45'),'c')['left_join'](_0x8121('0x46'),'uc','uc.CmContactId\x20=\x20c.id')[_0x8121('0x47')](_0x8121('0x48'),'ct',_0x8121('0x49'))[_0x8121('0x47')]('tools_tags','t','t.id\x20=\x20ct.TagId')[_0x8121('0x3f')](_0x8121('0x4a'));var _0x55244c=squel['expr']();var _0xfa15c7=[];var _0x21648d=squel[_0x8121('0x4b')]();var _0x15b80e;if(_0x2782cf['query'][_0x8121('0x4c')]){_0x15b80e=as['parseSearch'](_0x2782cf[_0x8121('0x36')][_0x8121('0x4c')]);var _0x439a8c=_0x15b80e[_0x8121('0x4d')];for(var _0x37043f=0x0;_0x37043f<_0x15b80e[_0x8121('0x4e')][_0x8121('0x4f')];_0x37043f++){var _0x2a460c=_0x15b80e['conditions'][_0x37043f];var _0x283cf6='c';var _0x2ed783=_(_0x517525)['keys']()[_0x8121('0x50')](function(_0x18dc45){return _0x18dc45===_0x2a460c[_0x8121('0x42')];});if(_0x2ed783)_0x2ed783=_0x517525[_0x2a460c[_0x8121('0x42')]];if(!_0x2ed783){if(_0x2a460c['field']===_0x8121('0x51')){var _0x3070af=_0x2a460c[_0x8121('0x52')][_0x8121('0x53')](',')[_0x8121('0x54')](function(_0x14255a){return Number(_0x14255a);});_0x3070af['forEach'](function(_0x379de9){_0x21648d['or'](_0x8121('0x55'),'%,'+_0x379de9+',%');});_0xfa15c7=_[_0x8121('0x56')](_0xfa15c7,_0x3070af);}else if(_0x2a460c[_0x8121('0x42')]===_0x8121('0x57')){_0x55244c['and']('uc.UserId\x20=\x20?',_0x2a460c[_0x8121('0x52')]);}}else{if(_0x2a460c['field']===_0x8121('0x58')||_0x2ed783[_0x8121('0x59')]===_0x8121('0x5a'))_0x2a460c[_0x8121('0x5b')]=_0x8121('0x5c');var _0x358e57=as['buildExpression'](_0x283cf6,_0x2ed783[_0x8121('0x34')],_0x2a460c);_0x55244c[_0x439a8c](_0x358e57[_0x8121('0x5d')],_0x358e57['value'][_0x8121('0x5e')],_0x358e57[_0x8121('0x52')][_0x8121('0x1f')]);}}}else{var _0x4a6fd6=_(Object[_0x8121('0x2f')](_0x2782cf[_0x8121('0x36')]))[_0x8121('0x54')](function(_0x164017){return _0x517525[_0x8121('0x3b')](_0x164017)?_0x164017:undefined;})[_0x8121('0x5f')](function(_0x2ada2b){return!_[_0x8121('0x60')](_0x2ada2b);})[_0x8121('0x52')]();if(_0x2782cf[_0x8121('0x36')]['Contact'])_0x4a6fd6[_0x8121('0x61')](_0x8121('0x62'));if(!_[_0x8121('0x63')](_0x4a6fd6)){_0x4a6fd6[_0x8121('0x64')](function(_0x3de9be){if(_0x3de9be===_0x8121('0x65')){_0x273fd7[_0x8121('0x3f')](_0x8121('0x66'),[][_0x8121('0x67')](_0x2782cf[_0x8121('0x36')][_0x3de9be]));}else if(_0x3de9be==='Contact'){var _0x39938e='%'+_0x2782cf[_0x8121('0x36')][_0x3de9be]+'%';_0x273fd7['where'](_0x8121('0x68'),_0x39938e);}else{_0x273fd7[_0x8121('0x3f')]('c.'+_0x3de9be+_0x8121('0x69'),_0x2782cf[_0x8121('0x36')][_0x3de9be]);}});}if(_0x2782cf[_0x8121('0x36')][_0x8121('0x6a')]){_0xfa15c7=_['isArray'](_0x2782cf[_0x8121('0x36')][_0x8121('0x6a')])?_0x2782cf[_0x8121('0x36')]['tag']:new Array(_0x2782cf['query']['tag']);_0xfa15c7[_0x8121('0x64')](function(_0x7441e9){_0x21648d['or'](_0x8121('0x55'),'%,'+_0x7441e9+',%');});}if(_0x2782cf[_0x8121('0x36')][_0x8121('0x5f')]){var _0x46c1e1=_0x2782cf[_0x8121('0x36')][_0x8121('0x5f')]['replace']('\x5c','\x5c\x5c')[_0x8121('0x6b')](/'/g,'\x27\x27');if(_0x46c1e1['split']('\x20')['length']>0x1){_0x55244c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8121('0x6c')](_0x46c1e1),null);}else{if(qs['isNumeric'](_0x46c1e1)){_0x55244c['or'](_0x8121('0x6d'),_0x46c1e1+'%');_0x55244c['or']('c.phone\x20LIKE\x20?',_0x46c1e1+'%');_0x55244c['or'](_0x8121('0x6e'),_0x46c1e1+'%');_0x55244c['or']('c.fax\x20LIKE\x20?',_0x46c1e1+'%');}else if(qs['isEmail'](_0x46c1e1)){_0x55244c['or']('c.email\x20LIKE\x20?',_0x46c1e1+'%');}else{_0x55244c['or'](_0x8121('0x6f'),'%'+_0x46c1e1+'%');_0x55244c['or'](_0x8121('0x70'),'%'+_0x46c1e1+'%');_0x55244c['or'](_0x8121('0x71'),'%'+_0x46c1e1+'%');}}}}_0x273fd7[_0x8121('0x3f')](_0x55244c);_0x273fd7[_0x8121('0x72')](_0x8121('0x73'));var _0x111ae7={'type':db[_0x8121('0x74')][_0x8121('0x75')][_0x8121('0x76')],'raw':!![]};var _0x38346b=_0x273fd7[_0x8121('0x77')]()[_0x8121('0x42')](_0x8121('0x73'));if(_0xd3d67e[_0x8121('0x3d')]){_0xd3d67e[_0x8121('0x3d')][_0x8121('0x64')](function(_0x35ce1c){_0x273fd7[_0x8121('0x3d')]('c.'+_0x35ce1c[0x0],_0x35ce1c[0x1]===_0x8121('0x78')?![]:!![]);});}if(!_[_0x8121('0x63')](_0xfa15c7)){_0x273fd7['having'](_0x21648d);_0x38346b[_0x8121('0x3f')]('t.id\x20IN\x20?',_0xfa15c7);}BPromise[_0x8121('0x79')]()[_0x8121('0x29')](function(){if(!_0x15b80e)return;if(_0x2782cf[_0x8121('0x7a')][_0x8121('0x7b')]!=='agent')return;if(!_[_0x8121('0x7c')](_0x15b80e[_0x8121('0x4e')],[_0x8121('0x42'),_0x8121('0x57')])){return _0x2782cf[_0x8121('0x7a')][_0x8121('0x7d')]({'attributes':['id'],'raw':!![]})[_0x8121('0x29')](function(_0xd98634){if(_['isEmpty'](_0xd98634)){_0x38346b[_0x8121('0x3f')](_0x8121('0x7e'));_0x273fd7[_0x8121('0x3f')](_0x8121('0x7e'));}else{_0x38346b[_0x8121('0x3f')]('c.ListId\x20IN\x20?',_[_0x8121('0x54')](_0xd98634,'id'));_0x273fd7[_0x8121('0x3f')]('c.ListId\x20IN\x20?',_[_0x8121('0x54')](_0xd98634,'id'));}});}})[_0x8121('0x29')](function(){if(_0x2782cf['user']['role']===_0x8121('0x7f')&&!_0x15b80e&&!_0x2782cf['query']['ListId'])return[];return db[_0x8121('0x80')][_0x8121('0x36')](_0x38346b[_0x8121('0x81')](),_0x111ae7);})['then'](function(_0x5a4b4a){_0x4f6cee[_0x8121('0x23')]=_0x5a4b4a[_0x8121('0x4f')];if(_0x4f6cee['count']===0x0)return[];return db[_0x8121('0x80')]['query'](_0x45384b['toString'](),_0x111ae7)[_0x8121('0x29')](function(_0x3e1cfa){_0x2c0b68=_[_0x8121('0x82')](_0x3e1cfa,'id');_0x111ae7=_[_0x8121('0x83')](_0x111ae7,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2782cf[_0x8121('0x36')]['fields']){_0xd3d67e[_0x8121('0x39')][_0x8121('0x64')](function(_0x306620){_0x273fd7[_0x8121('0x42')]('c.'+_0x306620);});}else{_0x273fd7['field'](_0x8121('0x73'));_0x273fd7[_0x8121('0x42')](_0x8121('0x84'));_0x273fd7[_0x8121('0x42')](_0x8121('0x85'));_0x273fd7[_0x8121('0x42')]('c.phone');_0x273fd7[_0x8121('0x42')](_0x8121('0x86'));_0x273fd7['field'](_0x8121('0x87'));_0x273fd7[_0x8121('0x42')](_0x8121('0x88'));_0x273fd7[_0x8121('0x42')](_0x8121('0x89'));_0x273fd7['field']('c.createdAt');_0x273fd7[_0x8121('0x42')](_0x8121('0x8a'));_0x273fd7[_0x8121('0x42')](_0x8121('0x8b'));_0x273fd7[_0x8121('0x42')](_0x8121('0x8c'),_0x8121('0x8d'));}if(_0xd3d67e[_0x8121('0x22')])_0x273fd7[_0x8121('0x22')](_0xd3d67e[_0x8121('0x22')]);if(_0xd3d67e[_0x8121('0x20')])_0x273fd7[_0x8121('0x20')](_0xd3d67e[_0x8121('0x20')]);return db['sequelize'][_0x8121('0x36')](_0x273fd7[_0x8121('0x81')](),_0x111ae7);});})['then'](function(_0x598256){_0x598256[_0x8121('0x64')](function(_0x4ca5ba){if(_0x4ca5ba[_0x8121('0x8d')]){_0x4ca5ba[_0x8121('0x8e')]=[];_0x4ca5ba[_0x8121('0x8d')][_0x8121('0x53')](',')['forEach'](function(_0x5bb6d0){_0x4ca5ba[_0x8121('0x8e')][_0x8121('0x61')](_0x2c0b68[_0x5bb6d0]);});}delete _0x4ca5ba[_0x8121('0x8d')];});_0x4f6cee[_0x8121('0x8f')]=_0x598256;return _0x4f6cee;})['then'](respondWithFilteredResult(_0xc89dc,_0xd3d67e));})[_0x8121('0x90')](handleError(_0xc89dc,null));};exports[_0x8121('0x91')]=function(_0x42f25f,_0x4fedcf){return db[_0x8121('0x92')]['find']({'where':{'id':_0x42f25f['params']['id']}})[_0x8121('0x29')](handleEntityNotFound(_0x4fedcf,null))[_0x8121('0x29')](removeEntity(_0x4fedcf,null))[_0x8121('0x90')](handleError(_0x4fedcf,null));};exports['describe']=function(_0x3f73b7,_0x44ebee){return db['CmContact']['describe']()[_0x8121('0x29')](function(_0x4b1dce){delete _0x4b1dce[_0x8121('0x93')];for(var _0x1c268d=0x0;_0x1c268d<Object[_0x8121('0x2f')](_0x4b1dce)[_0x8121('0x4f')];_0x1c268d++){var _0x5ef21f=Object[_0x8121('0x2f')](_0x4b1dce)[_0x1c268d];if(!_['startsWith'](_0x5ef21f,_0x8121('0x31'))){_0x4b1dce[_0x5ef21f]['columnName']=_0x5ef21f;_0x4b1dce[_0x5ef21f]['displayName']=_0x5ef21f;}}return _0x4b1dce;})[_0x8121('0x29')](function(_0x2dd96f){var _0x205791={'where':{'$or':[{'ListId':_0x3f73b7[_0x8121('0x36')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x8121('0x32')]['findAll'](_0x205791)['then'](function(_0x341f16){for(var _0x88ca3a=0x0;_0x88ca3a<_0x341f16['length'];_0x88ca3a++){var _0x545034=_0x8121('0x31')+_0x341f16[_0x88ca3a]['id'];_0x2dd96f[_0x545034][_0x8121('0x94')]=_0x545034;_0x2dd96f[_0x545034][_0x8121('0x95')]=_0x341f16[_0x88ca3a]['alias'];_0x2dd96f[_0x545034][_0x8121('0x96')]={'type':_0x341f16[_0x88ca3a][_0x8121('0x34')],'values':_0x341f16[_0x88ca3a][_0x8121('0x97')]};}Object[_0x8121('0x2f')](_0x2dd96f)['forEach'](function(_0x2f1089){if(!_0x2dd96f[_0x2f1089][_0x8121('0x3b')](_0x8121('0x94'))){delete _0x2dd96f[_0x2f1089];}});return _0x2dd96f;});})['then'](respondWithResult(_0x44ebee,null))['catch'](handleError(_0x44ebee,null));};exports[_0x8121('0x83')]=function(_0x30befc,_0x3d62b4){var _0x5016e2;var _0x3efb0b;var _0x49e8cb;if(_0x30befc[_0x8121('0x98')]['id']){delete _0x30befc['body']['id'];}return db[_0x8121('0x92')][_0x8121('0x99')]({'where':{'id':[_0x30befc[_0x8121('0x98')]['to'],_0x30befc[_0x8121('0x98')][_0x8121('0x44')]]}})[_0x8121('0x29')](function(_0x1c8dbe){if(_0x1c8dbe){if(_0x1c8dbe[_0x8121('0x4f')]!==0x2){return null;}_0x1c8dbe[0x0]=_0x1c8dbe[0x0]['get']({'plain':!![]});_0x1c8dbe[0x1]=_0x1c8dbe[0x1][_0x8121('0x9a')]({'plain':!![]});delete _0x1c8dbe[0x0]['id'];delete _0x1c8dbe[0x1]['id'];return _[_0x8121('0x9b')](_0x1c8dbe[0x0],_0x1c8dbe[0x1],function(_0x10a1dc,_0x42e29d){if(Array[_0x8121('0x9c')](_0x42e29d)&&!_0x42e29d[_0x8121('0x4f')]){return _0x10a1dc;}else if(!_0x42e29d){return _0x10a1dc;}});}})[_0x8121('0x29')](handleEntityNotFound(_0x3d62b4,null))['then'](function(_0xd7ed39){if(_0xd7ed39){if(_0xd7ed39['tags']&&_['isArray'](_0xd7ed39['tags'])){_0xd7ed39[_0x8121('0x93')]=_0xd7ed39[_0x8121('0x93')][_0x8121('0x9d')]();}logger[_0x8121('0x9e')](_0x8121('0x9f'),_0x30befc['body']['to'],_0x30befc[_0x8121('0x98')]['from']);return db[_0x8121('0xa0')][_0x8121('0x91')]({'where':{'ContactId':[_0x30befc['body']['to'],_0x30befc[_0x8121('0x98')][_0x8121('0x44')]]}})[_0x8121('0x29')](function(_0x4d48fe){logger[_0x8121('0x9e')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x4d48fe);return db[_0x8121('0xa1')][_0x8121('0x91')]({'where':{'ContactId':[_0x30befc[_0x8121('0x98')]['to'],_0x30befc[_0x8121('0x98')]['from']]}})['then'](function(_0x45a3f6){logger[_0x8121('0x9e')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x45a3f6);return db[_0x8121('0x92')][_0x8121('0xa2')](_0xd7ed39);});});}})[_0x8121('0x29')](function(_0xc77616){if(_0xc77616){_0x5016e2=_0xc77616;_0x3efb0b={'ContactId':_0x5016e2['id']};_0x49e8cb={'where':{'ContactId':[_0x30befc[_0x8121('0x98')]['to'],_0x30befc[_0x8121('0x98')][_0x8121('0x44')]]}};return db['ChatInteraction'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xa4')]['update'](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db[_0x8121('0xa5')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xa6')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xa7')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db['MailInteraction'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db['MailMessage'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db['SmsInteraction']['update'](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db['SmsMessage'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db['FaxInteraction']['update'](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db[_0x8121('0xa8')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xa9')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db[_0x8121('0xaa')]['update'](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db[_0x8121('0xab')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xac')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db[_0x8121('0xad')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db[_0x8121('0xae')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db['ChatQueueReport'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db['FaxQueueReport'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xaf')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xb0')]['update'](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db['SmsQueueReport'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xb1')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})['then'](function(){if(_0x5016e2){return db['WhatsappInteraction'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db['WhatsappMessage'][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0xb2')][_0x8121('0xa3')](_0x3efb0b,_0x49e8cb);}})[_0x8121('0x29')](function(){if(_0x5016e2){return db[_0x8121('0x92')][_0x8121('0x91')]({'where':{'id':[_0x30befc[_0x8121('0x98')]['to'],_0x30befc[_0x8121('0x98')][_0x8121('0x44')]]}});}})['then'](function(){if(_0x5016e2){return _0x5016e2;}})[_0x8121('0x29')](respondWithResult(_0x3d62b4,null))[_0x8121('0x90')](handleError(_0x3d62b4,null));};exports[_0x8121('0xa2')]=function(_0x1cc7fc,_0x4ae0d5){return db[_0x8121('0x92')]['describe']()[_0x8121('0x29')](function(_0x1a3f20){if(_0x1cc7fc['body']['tags']&&_[_0x8121('0x9c')](_0x1cc7fc['body'][_0x8121('0x93')])){if(_0x1cc7fc['body'][_0x8121('0x93')][_0x8121('0x4f')]){_0x1cc7fc[_0x8121('0x98')]['tags']=_0x1cc7fc[_0x8121('0x98')][_0x8121('0x93')][_0x8121('0x9d')](';')+';';}else{_0x1cc7fc[_0x8121('0x98')][_0x8121('0x93')]=null;}}else{_0x1cc7fc[_0x8121('0x98')][_0x8121('0x93')]=null;}return db[_0x8121('0x92')][_0x8121('0xa2')](_0x1cc7fc[_0x8121('0x98')],{'fields':_[_0x8121('0x2f')](_0x1a3f20),'raw':!![]});})[_0x8121('0x29')](respondWithResult(_0x4ae0d5,0xc9))[_0x8121('0x90')](handleError(_0x4ae0d5,null));};exports[_0x8121('0xb3')]=function(_0x537588,_0x1223ff){var _0x9a0a19=[];var _0x43ca29=0x0;var _0x3d66c6=0x0;var _0x2c93e5=0x0;return db['CmContact'][_0x8121('0x2e')]()[_0x8121('0x29')](function(_0xa420ba){return BPromise['each'](_0x537588[_0x8121('0x98')],function(_0x39d47f){var _0xaa7b81={'where':{'$or':[]},'defaults':_0x39d47f,'fields':_[_0x8121('0x2f')](_0xa420ba),'raw':!![]};if(_0x39d47f['duplicates']){for(var _0x1bb9df=0x0;_0x1bb9df<_0x39d47f[_0x8121('0xb4')][_0x8121('0x4f')];_0x1bb9df++){var _0x237e2e={};_0x237e2e[_0x39d47f[_0x8121('0xb4')][_0x1bb9df]]=_0x39d47f[_0x39d47f[_0x8121('0xb4')][_0x1bb9df]];_0xaa7b81['where'][_0x8121('0xb5')][_0x8121('0x61')](_0x237e2e);}_0xaa7b81[_0x8121('0x3f')][_0x8121('0x65')]=_0x39d47f['ListId'];}return db[_0x8121('0x92')][_0x8121('0xb6')](_0xaa7b81)[_0x8121('0xb7')](function(_0x2483e0,_0x4ade7c){if(_0x4ade7c){_0x43ca29++;}else{_0x2c93e5++;}})[_0x8121('0x90')](function(_0x4327a8){console[_0x8121('0x2a')](_0x4327a8);_0x3d66c6++;});});})[_0x8121('0x29')](function(_0x709da1){if(_0x709da1){return{'success':_0x43ca29,'failure':_0x3d66c6,'duplicates':_0x2c93e5};}})['then'](respondWithResult(_0x1223ff,0xc9))['catch'](handleError(_0x1223ff,null));};exports[_0x8121('0xb8')]=function(_0x58538c,_0x1b7ec8,_0x1682b1){var _0xa46669;return db['CmContact'][_0x8121('0x2e')]()[_0x8121('0x29')](function(_0x440216){return db['CmContact'][_0x8121('0x50')]({'where':{'id':_0x58538c[_0x8121('0xb9')]['id']},'include':[{'model':db[_0x8121('0x51')],'as':'Tags','attributes':['id',_0x8121('0x2b'),_0x8121('0x43')],'required':_0x58538c[_0x8121('0x36')]['tag']?!![]:![]}],'attributes':_[_0x8121('0x2f')](_0x440216)});})['then'](function(_0x5aa69d){_0xa46669=_0x5aa69d[_0x8121('0x9a')]({'plain':!![]});var _0x2e3469={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5aa69d&&_0x5aa69d[_0x8121('0x65')]){if(_0x5aa69d[_0x8121('0x65')]){_0x2e3469['where'][_0x8121('0xba')][_0x8121('0x61')]({'ListId':{'$ne':_0x5aa69d[_0x8121('0x65')]}});}}return db[_0x8121('0x32')][_0x8121('0x99')](_0x2e3469);})[_0x8121('0x29')](function(_0xbf8bbe){return _[_0x8121('0xbb')](_0xa46669,_[_0x8121('0x54')](_0xbf8bbe,function(_0x1f7f6a){return util[_0x8121('0xbc')](_0x8121('0xbd'),_0x1f7f6a['id']);}));})[_0x8121('0x29')](handleEntityNotFound(_0x1b7ec8,null))[_0x8121('0x29')](respondWithResult(_0x1b7ec8,null))['catch'](handleError(_0x1b7ec8,null));};exports[_0x8121('0xa3')]=function(_0x270284,_0xdc48a8){var _0x546cf9;if(_0x270284[_0x8121('0x98')]['id']){delete _0x270284[_0x8121('0x98')]['id'];}return db['CmContact'][_0x8121('0x50')]({'where':{'id':_0x270284['params']['id']}})['then'](handleEntityNotFound(_0xdc48a8,null))['then'](saveUpdates(_0x270284[_0x8121('0x98')],null))[_0x8121('0x29')](function(_0x48a5b0){_0x546cf9=_0x48a5b0;var _0x4621c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x48a5b0&&_0x48a5b0['ListId']){if(_0x48a5b0[_0x8121('0x65')]){_0x4621c7['where']['$and']['push']({'ListId':{'$ne':_0x48a5b0[_0x8121('0x65')]}});}}return db['CmCustomField'][_0x8121('0x99')](_0x4621c7);})[_0x8121('0x29')](function(_0x34a637){if(_0x34a637){return _[_0x8121('0xbb')](_[_0x8121('0xbe')](_0x270284[_0x8121('0x98')],function(_0x5985cf,_0x4d17d1){return _[_0x8121('0x30')](_0x4d17d1,'cf_');}),_[_0x8121('0x54')](_0x34a637,function(_0x5efd83){return util[_0x8121('0xbc')](_0x8121('0xbd'),_0x5efd83['id']);}));}})[_0x8121('0x29')](function(_0x2f073a){if(_0x2f073a&&!_['isEmpty'](_0x2f073a)){var _0x466d65=squel[_0x8121('0xa3')]()[_0x8121('0xbf')](_0x8121('0x45'))[_0x8121('0xc0')](_0x2f073a)['where'](_0x8121('0xc1'),_0x270284[_0x8121('0xb9')]['id'])[_0x8121('0xc2')]();return db[_0x8121('0x80')][_0x8121('0x36')](_0x466d65[_0x8121('0x5d')],{'replacements':_0x466d65[_0x8121('0x97')]});}})['then'](function(){if(_0x270284[_0x8121('0x98')][_0x8121('0xc3')]&&_0x546cf9){return db[_0x8121('0xa0')][_0x8121('0xa3')]({'phone':_0x270284[_0x8121('0x98')][_0x8121('0xc3')]},{'where':{'ContactId':_0x546cf9['id']}});}})[_0x8121('0x29')](function(){return _0x546cf9;})[_0x8121('0x29')](respondWithResult(_0xdc48a8,null))['catch'](handleError(_0xdc48a8,null));};exports['getTags']=function(_0x59ec1d,_0x357aa9,_0x5098e8){var _0x1c7183={};var _0x5af6b4={};var _0x350bb6;var _0x164369;return db[_0x8121('0x92')][_0x8121('0xc4')]({'where':{'id':_0x59ec1d[_0x8121('0xb9')]['id']}})['then'](handleEntityNotFound(_0x357aa9,null))[_0x8121('0x29')](function(_0x273169){if(_0x273169){_0x350bb6=_0x273169;_0x5af6b4['model']=_['keys'](db[_0x8121('0x51')][_0x8121('0xc5')]);_0x5af6b4[_0x8121('0x36')]=_[_0x8121('0x2f')](_0x59ec1d[_0x8121('0x36')]);_0x5af6b4[_0x8121('0x37')]=_[_0x8121('0x38')](_0x5af6b4[_0x8121('0x35')],_0x5af6b4['query']);_0x1c7183[_0x8121('0x39')]=_[_0x8121('0x38')](_0x5af6b4[_0x8121('0x35')],qs[_0x8121('0x3a')](_0x59ec1d[_0x8121('0x36')][_0x8121('0x3a')]));_0x1c7183['attributes']=_0x1c7183[_0x8121('0x39')][_0x8121('0x4f')]?_0x1c7183['attributes']:_0x5af6b4['model'];_0x1c7183[_0x8121('0x3d')]=qs[_0x8121('0x3e')](_0x59ec1d['query']['sort']);_0x1c7183[_0x8121('0x3f')]=qs['filters'](_[_0x8121('0x40')](_0x59ec1d[_0x8121('0x36')],_0x5af6b4['filters']));if(_0x59ec1d[_0x8121('0x36')][_0x8121('0x5f')]){_0x1c7183[_0x8121('0x3f')]=_[_0x8121('0x83')](_0x1c7183[_0x8121('0x3f')],{'$or':_[_0x8121('0x54')](_0x1c7183[_0x8121('0x39')],function(_0x6b912b){var _0x507e94={};_0x507e94[_0x6b912b]={'$like':'%'+_0x59ec1d[_0x8121('0x36')][_0x8121('0x5f')]+'%'};return _0x507e94;})});}_0x1c7183=_[_0x8121('0x83')]({},_0x1c7183,_0x59ec1d[_0x8121('0xc6')]);return _0x350bb6['getTags'](_0x1c7183);}})[_0x8121('0x29')](function(_0x593391){if(_0x593391){_0x164369=_0x593391[_0x8121('0x4f')];if(!_0x59ec1d['query'][_0x8121('0x3b')](_0x8121('0x3c'))){_0x1c7183[_0x8121('0x22')]=qs['limit'](_0x59ec1d[_0x8121('0x36')][_0x8121('0x22')]);_0x1c7183[_0x8121('0x20')]=qs[_0x8121('0x20')](_0x59ec1d[_0x8121('0x36')][_0x8121('0x20')]);}return _0x350bb6[_0x8121('0xc7')](_0x1c7183);}})[_0x8121('0x29')](function(_0x4608c5){if(_0x4608c5){return _0x4608c5?{'count':_0x164369,'rows':_0x4608c5}:null;}})[_0x8121('0x29')](respondWithResult(_0x357aa9,null))[_0x8121('0x90')](handleError(_0x357aa9,null));};exports[_0x8121('0xc8')]=function(_0x1d2500,_0x9fc191,_0x4f94e4){if(_0x1d2500[_0x8121('0x98')]['id']){delete _0x1d2500[_0x8121('0x98')]['id'];}return db[_0x8121('0x92')][_0x8121('0xc4')]({'where':{'id':_0x1d2500['params']['id']}})[_0x8121('0x29')](handleEntityNotFound(_0x9fc191,null))[_0x8121('0x29')](function(_0x2f1f39){if(_0x2f1f39){return _0x2f1f39[_0x8121('0xc8')](_0x1d2500[_0x8121('0x98')][_0x8121('0xc9')]||[]);}return null;})['then'](respondWithResult(_0x9fc191,null))[_0x8121('0x90')](handleError(_0x9fc191,null));};exports[_0x8121('0xca')]=function(_0x10700d,_0x57601c,_0x47c8e5){var _0x4b4260={'raw':![],'where':{}};var _0x477a64={};var _0x1f0d48={'count':0x0,'rows':[]};return db[_0x8121('0x92')]['findOne']({'where':{'id':_0x10700d['params']['id']}})['then'](handleEntityNotFound(_0x57601c,null))['then'](function(_0x3215c1){if(_0x3215c1){_0x477a64[_0x8121('0x35')]=_['keys'](db[_0x8121('0xa0')][_0x8121('0xc5')]);_0x477a64[_0x8121('0x36')]=_['keys'](_0x10700d['query']);_0x477a64[_0x8121('0x37')]=_[_0x8121('0x38')](_0x477a64[_0x8121('0x35')],_0x477a64[_0x8121('0x36')]);_0x4b4260[_0x8121('0x39')]=_[_0x8121('0x38')](_0x477a64[_0x8121('0x35')],qs[_0x8121('0x3a')](_0x10700d[_0x8121('0x36')][_0x8121('0x3a')]));_0x4b4260[_0x8121('0x39')]=_0x4b4260['attributes'][_0x8121('0x4f')]?_0x4b4260[_0x8121('0x39')]:_0x477a64[_0x8121('0x35')];if(!_0x10700d[_0x8121('0x36')][_0x8121('0x3b')](_0x8121('0x3c'))){_0x4b4260[_0x8121('0x22')]=qs[_0x8121('0x22')](_0x10700d[_0x8121('0x36')][_0x8121('0x22')]);_0x4b4260[_0x8121('0x20')]=qs[_0x8121('0x20')](_0x10700d['query'][_0x8121('0x20')]);}_0x4b4260['order']=qs[_0x8121('0x3e')](_0x10700d[_0x8121('0x36')][_0x8121('0x3e')]);_0x4b4260[_0x8121('0x3f')]=qs['filters'](_['pick'](_0x10700d[_0x8121('0x36')],_0x477a64[_0x8121('0x37')]));_0x4b4260['where'][_0x8121('0xcb')]=_0x3215c1['id'];if(_0x10700d[_0x8121('0x36')][_0x8121('0x5f')]){_0x4b4260[_0x8121('0x3f')]=_[_0x8121('0x83')](_0x4b4260[_0x8121('0x3f')],{'$or':_[_0x8121('0x54')](_0x4b4260[_0x8121('0x39')],function(_0x3004bd){var _0x14160c={};_0x14160c[_0x3004bd]={'$like':'%'+_0x10700d[_0x8121('0x36')][_0x8121('0x5f')]+'%'};return _0x14160c;})});}_0x4b4260=_[_0x8121('0x83')]({},_0x4b4260,_0x10700d['options']);return db['CmHopper'][_0x8121('0x23')]({'where':_0x4b4260[_0x8121('0x3f')]})[_0x8121('0x29')](function(_0x20b390){_0x1f0d48['count']=_0x20b390;if(_0x10700d[_0x8121('0x36')][_0x8121('0xcc')]){_0x4b4260[_0x8121('0xcd')]=[{'all':!![]}];}return db[_0x8121('0xa0')][_0x8121('0x99')](_0x4b4260);})['then'](function(_0x19a1db){_0x1f0d48[_0x8121('0x8f')]=_0x19a1db;return _0x1f0d48;});}})[_0x8121('0x29')](respondWithFilteredResult(_0x57601c,_0x4b4260))[_0x8121('0x90')](handleError(_0x57601c,null));};exports['getHopperHistories']=function(_0x287f45,_0x41c380,_0x54135e){var _0x1c6dfa={'raw':!![],'where':{}};var _0x361eb5={};var _0x5bfff4={'count':0x0,'rows':[]};return db[_0x8121('0x92')]['findOne']({'where':{'id':_0x287f45[_0x8121('0xb9')]['id']}})[_0x8121('0x29')](handleEntityNotFound(_0x41c380,null))['then'](function(_0x11e357){if(_0x11e357){_0x361eb5[_0x8121('0x35')]=_[_0x8121('0x2f')](db[_0x8121('0xac')][_0x8121('0xc5')]);_0x361eb5[_0x8121('0x36')]=_[_0x8121('0x2f')](_0x287f45[_0x8121('0x36')]);_0x361eb5[_0x8121('0x37')]=_[_0x8121('0x38')](_0x361eb5[_0x8121('0x35')],_0x361eb5['query']);_0x1c6dfa[_0x8121('0x39')]=_[_0x8121('0x38')](_0x361eb5[_0x8121('0x35')],qs[_0x8121('0x3a')](_0x287f45['query']['fields']));_0x1c6dfa[_0x8121('0x39')]=_0x1c6dfa['attributes']['length']?_0x1c6dfa['attributes']:_0x361eb5[_0x8121('0x35')];if(!_0x287f45[_0x8121('0x36')][_0x8121('0x3b')]('nolimit')){_0x1c6dfa['limit']=qs['limit'](_0x287f45[_0x8121('0x36')]['limit']);_0x1c6dfa[_0x8121('0x20')]=qs[_0x8121('0x20')](_0x287f45[_0x8121('0x36')][_0x8121('0x20')]);}_0x1c6dfa[_0x8121('0x3d')]=qs[_0x8121('0x3e')](_0x287f45[_0x8121('0x36')][_0x8121('0x3e')]);_0x1c6dfa[_0x8121('0x3f')]=qs[_0x8121('0x37')](_[_0x8121('0x40')](_0x287f45[_0x8121('0x36')],_0x361eb5['filters']));_0x1c6dfa[_0x8121('0x3f')][_0x8121('0xcb')]=_0x11e357['id'];if(_0x287f45[_0x8121('0x36')]['filter']){_0x1c6dfa[_0x8121('0x3f')]=_[_0x8121('0x83')](_0x1c6dfa['where'],{'$or':_[_0x8121('0x54')](_0x1c6dfa['attributes'],function(_0x18dc69){var _0x496cec={};_0x496cec[_0x18dc69]={'$like':'%'+_0x287f45[_0x8121('0x36')][_0x8121('0x5f')]+'%'};return _0x496cec;})});}_0x1c6dfa=_['merge']({},_0x1c6dfa,_0x287f45[_0x8121('0xc6')]);return db[_0x8121('0xac')][_0x8121('0x23')]({'where':_0x1c6dfa[_0x8121('0x3f')]})['then'](function(_0x599107){_0x5bfff4[_0x8121('0x23')]=_0x599107;if(_0x287f45[_0x8121('0x36')][_0x8121('0xcc')]){_0x1c6dfa[_0x8121('0xcd')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x8121('0x99')](_0x1c6dfa);})[_0x8121('0x29')](function(_0x41ebda){_0x5bfff4[_0x8121('0x8f')]=_0x41ebda;return _0x5bfff4;});}})['then'](respondWithFilteredResult(_0x41c380,_0x1c6dfa))['catch'](handleError(_0x41c380,null));};exports[_0x8121('0xce')]=function(_0x3ed51d,_0x4b3b25,_0x12f183){var _0x4f80d1={'raw':!![],'where':{}};var _0x36de2f={};var _0x25f835={'count':0x0,'rows':[]};return db['CmContact'][_0x8121('0xc4')]({'where':{'id':_0x3ed51d[_0x8121('0xb9')]['id']}})[_0x8121('0x29')](handleEntityNotFound(_0x4b3b25,null))[_0x8121('0x29')](function(_0x382a17){if(_0x382a17){_0x36de2f['model']=_[_0x8121('0x2f')](db['CmHopperFinal']['rawAttributes']);_0x36de2f[_0x8121('0x36')]=_['keys'](_0x3ed51d[_0x8121('0x36')]);_0x36de2f[_0x8121('0x37')]=_[_0x8121('0x38')](_0x36de2f['model'],_0x36de2f[_0x8121('0x36')]);_0x4f80d1[_0x8121('0x39')]=_['intersection'](_0x36de2f[_0x8121('0x35')],qs[_0x8121('0x3a')](_0x3ed51d[_0x8121('0x36')][_0x8121('0x3a')]));_0x4f80d1[_0x8121('0x39')]=_0x4f80d1[_0x8121('0x39')][_0x8121('0x4f')]?_0x4f80d1[_0x8121('0x39')]:_0x36de2f[_0x8121('0x35')];if(!_0x3ed51d[_0x8121('0x36')]['hasOwnProperty'](_0x8121('0x3c'))){_0x4f80d1[_0x8121('0x22')]=qs[_0x8121('0x22')](_0x3ed51d[_0x8121('0x36')]['limit']);_0x4f80d1[_0x8121('0x20')]=qs[_0x8121('0x20')](_0x3ed51d['query'][_0x8121('0x20')]);}_0x4f80d1['order']=qs[_0x8121('0x3e')](_0x3ed51d[_0x8121('0x36')][_0x8121('0x3e')]);_0x4f80d1['where']=qs[_0x8121('0x37')](_[_0x8121('0x40')](_0x3ed51d[_0x8121('0x36')],_0x36de2f[_0x8121('0x37')]));_0x4f80d1[_0x8121('0x3f')][_0x8121('0xcb')]=_0x382a17['id'];if(_0x3ed51d[_0x8121('0x36')]['filter']){_0x4f80d1[_0x8121('0x3f')]=_[_0x8121('0x83')](_0x4f80d1[_0x8121('0x3f')],{'$or':_[_0x8121('0x54')](_0x4f80d1[_0x8121('0x39')],function(_0x17f116){var _0x29fdac={};_0x29fdac[_0x17f116]={'$like':'%'+_0x3ed51d['query'][_0x8121('0x5f')]+'%'};return _0x29fdac;})});}_0x4f80d1=_[_0x8121('0x83')]({},_0x4f80d1,_0x3ed51d[_0x8121('0xc6')]);return db[_0x8121('0xab')][_0x8121('0x23')]({'where':_0x4f80d1[_0x8121('0x3f')]})[_0x8121('0x29')](function(_0x33fcd1){_0x25f835[_0x8121('0x23')]=_0x33fcd1;if(_0x3ed51d[_0x8121('0x36')][_0x8121('0xcc')]){_0x4f80d1[_0x8121('0xcd')]=[{'all':!![]}];}return db[_0x8121('0xab')][_0x8121('0x99')](_0x4f80d1);})[_0x8121('0x29')](function(_0x163937){_0x25f835['rows']=_0x163937;return _0x25f835;});}})[_0x8121('0x29')](respondWithFilteredResult(_0x4b3b25,_0x4f80d1))[_0x8121('0x90')](handleError(_0x4b3b25,null));};exports[_0x8121('0xcf')]=function(_0x58e0c5,_0x57d4a1,_0x1b98f4){var _0x4afbea={'raw':!![],'where':{}};var _0x422beb={};var _0x25a6c8={'count':0x0,'rows':[]};return db[_0x8121('0x92')][_0x8121('0xc4')]({'where':{'id':_0x58e0c5[_0x8121('0xb9')]['id']}})[_0x8121('0x29')](handleEntityNotFound(_0x57d4a1,null))['then'](function(_0x457de4){if(_0x457de4){_0x422beb['model']=_['keys'](db[_0x8121('0xb1')][_0x8121('0xc5')]);_0x422beb['query']=_[_0x8121('0x2f')](_0x58e0c5[_0x8121('0x36')]);_0x422beb[_0x8121('0x37')]=_[_0x8121('0x38')](_0x422beb['model'],_0x422beb['query']);_0x4afbea['attributes']=_[_0x8121('0x38')](_0x422beb['model'],qs['fields'](_0x58e0c5[_0x8121('0x36')][_0x8121('0x3a')]));_0x4afbea['attributes']=_0x4afbea[_0x8121('0x39')]['length']?_0x4afbea[_0x8121('0x39')]:_0x422beb[_0x8121('0x35')];if(!_0x58e0c5[_0x8121('0x36')]['hasOwnProperty'](_0x8121('0x3c'))){_0x4afbea[_0x8121('0x22')]=qs[_0x8121('0x22')](_0x58e0c5[_0x8121('0x36')][_0x8121('0x22')]);_0x4afbea[_0x8121('0x20')]=qs['offset'](_0x58e0c5['query'][_0x8121('0x20')]);}_0x4afbea['order']=qs[_0x8121('0x3e')](_0x58e0c5[_0x8121('0x36')]['sort']);_0x4afbea['where']=qs[_0x8121('0x37')](_[_0x8121('0x40')](_0x58e0c5[_0x8121('0x36')],_0x422beb[_0x8121('0x37')]));_0x4afbea[_0x8121('0x3f')][_0x8121('0xcb')]=_0x457de4['id'];if(_0x58e0c5[_0x8121('0x36')][_0x8121('0x5f')]){_0x4afbea[_0x8121('0x3f')]=_['merge'](_0x4afbea[_0x8121('0x3f')],{'$or':_['map'](_0x4afbea[_0x8121('0x39')],function(_0x503dc3){var _0x356a0d={};_0x356a0d[_0x503dc3]={'$like':'%'+_0x58e0c5[_0x8121('0x36')]['filter']+'%'};return _0x356a0d;})});}_0x4afbea=_['merge']({},_0x4afbea,_0x58e0c5[_0x8121('0xc6')]);return db[_0x8121('0xb1')][_0x8121('0x23')]({'where':_0x4afbea['where']})['then'](function(_0x14a11e){_0x25a6c8['count']=_0x14a11e;if(_0x58e0c5['query'][_0x8121('0xcc')]){_0x4afbea[_0x8121('0xcd')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x4afbea);})[_0x8121('0x29')](function(_0x41073e){_0x25a6c8['rows']=_0x41073e;return _0x25a6c8;});}})[_0x8121('0x29')](respondWithFilteredResult(_0x57d4a1,_0x4afbea))[_0x8121('0x90')](handleError(_0x57d4a1,null));};exports[_0x8121('0xd0')]=function(_0x33a421,_0x4b44e5,_0x3f6370){try{if(!_0x33a421[_0x8121('0x98')]['ListId']){throw new Error(_0x8121('0xd1'));}if(!_0x33a421[_0x8121('0x98')][_0x8121('0xd2')]){throw new Error(_0x8121('0xd3'));}if(!_0x33a421[_0x8121('0x98')][_0x8121('0xd4')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x33a421[_0x8121('0x98')]['socket_timestamp']){throw new Error(_0x8121('0xd5'));}var _0xeaae11=_0x33a421[_0x8121('0x98')][_0x8121('0xd2')][_0x8121('0x53')](',');var _0xef6fba=_0x33a421[_0x8121('0x98')]['binding_values'][_0x8121('0x53')](',');if(!_0xeaae11[_0x8121('0x4f')]||!_0xef6fba[_0x8121('0x4f')]||_0xeaae11[_0x8121('0x4f')]!==_0xef6fba['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x33a421[_0x8121('0x98')][_0x8121('0x3a')]=_[_0x8121('0xd6')](_0xeaae11,_0xef6fba);if(!_0x33a421['body'][_0x8121('0x3a')][_0x8121('0xc3')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x33a421['body'][_0x8121('0x3a')][_0x8121('0xd7')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x13316b=path[_0x8121('0x9d')](config[_0x8121('0xd8')],_0x8121('0xd9'),_0x33a421[_0x8121('0xda')][_0x8121('0xdb')]);fs[_0x8121('0xdc')](_0x13316b,parseInt('0777',0x8));var _0x335a6c=require('child_process')[_0x8121('0xdd')](path[_0x8121('0x9d')](__dirname,'../../components/import/cm/csv'),[_0x13316b,_0x33a421[_0x8121('0x98')][_0x8121('0xd2')],_0x33a421[_0x8121('0x98')][_0x8121('0xd4')],_0x33a421[_0x8121('0x98')][_0x8121('0x65')],_0x33a421[_0x8121('0x98')][_0x8121('0xde')],_0x33a421['body'][_0x8121('0xb4')],_0x33a421[_0x8121('0x98')][_0x8121('0xdf')]]);return _0x4b44e5[_0x8121('0x1e')](0xc8)[_0x8121('0x26')]({'message':'File\x20uploaded\x20correctly!','pid':_0x335a6c[_0x8121('0xe0')]});}catch(_0x268adc){return _0x4b44e5[_0x8121('0x1e')](0x1f4)[_0x8121('0x2c')](_0x268adc);}};exports['upload']=function(_0xb820fc,_0x10dc72,_0x49eb26){var _0x3050=fs[_0x8121('0xe1')](_0xb820fc[_0x8121('0xda')][_0x8121('0x6')]);Papa[_0x8121('0xe2')](_0x3050,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x8d41b7){return _0x10dc72[_0x8121('0x1e')](0xc8)[_0x8121('0x26')]({'file':_0xb820fc[_0x8121('0xda')],'fields':_0x8d41b7[_0x8121('0xe3')][_0x8121('0x3a')]});}});};exports[_0x8121('0xe4')]=function(_0x1402cf,_0x4bfd6a,_0x4edc39){return db[_0x8121('0x57')][_0x8121('0x99')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8121('0x7f')}})[_0x8121('0x29')](function(_0x13a84d){var _0x45e1d1=![];if(!_0x1402cf[_0x8121('0x98')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x1402cf[_0x8121('0x98')][_0x8121('0xe5')][_0x8121('0xc3')]){throw new Error(_0x8121('0xe6'));}if(!_0x1402cf[_0x8121('0x98')]['binding'][_0x8121('0xd7')]){throw new Error(_0x8121('0xe7'));}if(!_0x1402cf[_0x8121('0x98')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x64acac=require(_0x8121('0xe8'))[_0x8121('0xdd')](path[_0x8121('0x9d')](__dirname,'../../components/import/cm/csv2'),[_0x1402cf[_0x8121('0xb9')]['id'],JSON[_0x8121('0xe9')](_0x1402cf['body']),JSON['stringify'](_0x13a84d)]);_0x64acac['on'](_0x8121('0xea'),function(_0x447be1){_0x45e1d1=!![];return _0x4bfd6a[_0x8121('0x1e')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x64acac[_0x8121('0xe0')]});});_0x64acac['on'](_0x8121('0xeb'),function(_0x595bb8){if(_0x595bb8&&!_0x45e1d1){return _0x4bfd6a['status'](0x1f4)[_0x8121('0x26')]({'message':'error\x20child\x20process','pid':_0x64acac[_0x8121('0xe0')]});}});})[_0x8121('0x90')](handleError(_0x4bfd6a,null));};exports[_0x8121('0xec')]=function(_0x1c64c0,_0x55142d){var _0x4eb24e=['mail','chat',_0x8121('0xed'),'openchannel','fax',_0x8121('0xee'),_0x8121('0xef')];var _0xbd9c41={'offset':0x0,'order':qs[_0x8121('0x3e')](_0x8121('0xf0'))},_0x5cbb6a={'count':0x0,'rows':[]};Promise[_0x8121('0x79')]()[_0x8121('0x29')](function(){if(_0x1c64c0['query'][_0x8121('0xf1')]){if(!_[_0x8121('0xf2')](_0x4eb24e,_0x1c64c0[_0x8121('0x36')][_0x8121('0xf1')]['toLowerCase']())){throw new Error(_0x8121('0xf3'));}_0x4eb24e=[_0x1c64c0['query']['channel']['toLowerCase']()];}if(_0x1c64c0[_0x8121('0x36')]['range']){try{var _0x50b430=JSON[_0x8121('0xe2')](_0x1c64c0[_0x8121('0x36')][_0x8121('0xf4')]);if(!moment(_0x50b430[_0x8121('0x44')])[_0x8121('0xf5')]()){throw new Error(_0x8121('0xf6'));}if(!moment(_0x50b430['to'])[_0x8121('0xf5')]()){throw new Error(_0x8121('0xf7'));}}catch(_0x145ee1){throw new Error(_0x8121('0xf8'));}}if(!_0x1c64c0[_0x8121('0x36')][_0x8121('0x3b')](_0x8121('0x3c'))){_0xbd9c41['limit']=qs[_0x8121('0x22')](_0x1c64c0[_0x8121('0x36')][_0x8121('0x22')]||0xa);_0xbd9c41[_0x8121('0x20')]=qs[_0x8121('0x20')](_0x1c64c0[_0x8121('0x36')][_0x8121('0x20')]);}var _0x55396a=_0x4eb24e[_0x8121('0x54')](function(_0x31e85d){if(_0x31e85d===_0x8121('0xef')){var _0x23c03b={'attributes':['id',_0x8121('0xf9'),_0x8121('0x34'),_0x8121('0xfa'),_0x8121('0xfb'),'callerid',_0x8121('0xfc'),_0x8121('0xfd'),_0x8121('0xfe'),_0x8121('0xff'),_0x8121('0x100'),_0x8121('0x101'),_0x8121('0x102'),_0x8121('0x103'),_0x8121('0x104')],'where':{'ContactId':_0x1c64c0[_0x8121('0xb9')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0x8121('0x2b'),_0x8121('0x105'),_0x8121('0x106')]}],'order':[['createdAt',_0x8121('0x78')]]};if(_0x1c64c0[_0x8121('0x36')][_0x8121('0xf4')]){_0x23c03b[_0x8121('0x3f')][_0x8121('0x100')]={'$gte':_0x50b430['from'],'$lte':_0x50b430['to']};}return db[_0x8121('0xae')][_0x8121('0x107')](_0x23c03b)[_0x8121('0x29')](function(_0x271a98){_0x5cbb6a['count']+=_0x271a98[_0x8121('0x23')];return _['map'](_0x271a98[_0x8121('0x8f')],function(_0x95e979){var _0x23de0d=_0x95e979[_0x8121('0x9a')]({'plain':!![]});_0x23de0d[_0x8121('0xf1')]=_0x31e85d;if(_0x23de0d[_0x8121('0x57')]){_0x23de0d[_0x8121('0x57')]={'id':_0x23de0d[_0x8121('0x57')]['id'],'name':_0x23de0d[_0x8121('0x57')]['name'],'fullname':_0x23de0d[_0x8121('0x57')][_0x8121('0x105')],'alias':_0x23de0d[_0x8121('0x57')][_0x8121('0x106')]};}return _0x23de0d;});});}else{var _0x4016d0=_['startCase'](_0x31e85d)+(_0x31e85d==='chat'?_0x8121('0x108'):_0x8121('0x109'));var _0x323c20={'attributes':['id',_0x8121('0x10a'),_0x8121('0x10b'),_0x8121('0x100'),_0x8121('0xff'),_0x8121('0x10c'),_0x8121('0x10d'),_0x8121('0x10e'),_0x8121('0x104'),_0x4016d0+'Id'],'where':{'ContactId':_0x1c64c0['params']['id']},'include':[{'model':db[_0x4016d0],'as':_0x8121('0x109'),'attributes':['id',_0x8121('0x2b'),'key']},{'model':db[_0x8121('0x57')],'as':_0x8121('0x10f'),'attributes':['id','name',_0x8121('0x105')]},{'model':db[_0x8121('0x51')],'as':_0x8121('0x8e'),'attributes':['id',_0x8121('0x2b'),'color'],'through':{'attributes':[]}}],'order':[[_0x8121('0x100'),_0x8121('0x78')]]};if(_0x1c64c0[_0x8121('0x36')]['range']){_0x323c20['where'][_0x8121('0x100')]={'$gte':_0x50b430['from'],'$lte':_0x50b430['to']};}switch(_0x31e85d){case'chat':_0x323c20[_0x8121('0x39')][_0x8121('0x61')]('browserName',_0x8121('0x110'),_0x8121('0x111'),_0x8121('0x112'),_0x8121('0x113'),_0x8121('0x114'),'ratingType',_0x8121('0x115'),_0x8121('0x116'));break;case _0x8121('0x117'):_0x323c20['attributes']['push']('subject','substatus');break;case _0x8121('0x118'):_0x323c20[_0x8121('0x39')][_0x8121('0x61')](_0x8121('0x119'),'threadId');break;}return db[_[_0x8121('0x11a')](_0x31e85d)+_0x8121('0x11b')][_0x8121('0x107')](_0x323c20)['then'](function(_0x538520){_0x5cbb6a[_0x8121('0x23')]+=_0x538520[_0x8121('0x23')];return _['map'](_0x538520[_0x8121('0x8f')],function(_0x40c0f5){var _0x346950=_0x40c0f5[_0x8121('0x9a')]({'plain':!![]});_0x346950[_0x8121('0xf1')]=_0x31e85d;if(_0x346950['Owner']){_0x346950['Owner']={'id':_0x346950[_0x8121('0x10f')]['id'],'name':_0x346950[_0x8121('0x10f')]['name'],'fullname':_0x346950[_0x8121('0x10f')][_0x8121('0x105')]};}return _0x346950;});});}});return Promise['all'](_0x55396a);})[_0x8121('0x29')](function(_0x298741){return _(_0x298741)[_0x8121('0x11c')]()[_0x8121('0x11d')]('createdAt')['reverse']()[_0x8121('0x52')]();})[_0x8121('0x29')](function(_0x2f9ee8){_0x5cbb6a[_0x8121('0x8f')]=_0xbd9c41[_0x8121('0x22')]?_0x2f9ee8[_0x8121('0x11e')](_0xbd9c41['offset'],_0xbd9c41[_0x8121('0x20')]+_0xbd9c41[_0x8121('0x22')]):_0x2f9ee8;return _0x5cbb6a;})['then'](respondWithFilteredResult(_0x55142d,_0xbd9c41))['catch'](handleError(_0x55142d,null));};
\ No newline at end of file
index 8c60e6a..f07cc29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe576=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','CmContact'];(function(_0x5d6652,_0x2c8613){var _0x5a699e=function(_0x300154){while(--_0x300154){_0x5d6652['push'](_0x5d6652['shift']());}};_0x5a699e(++_0x2c8613);}(_0xe576,0xde));var _0x6e57=function(_0x30755e,_0x4d06f8){_0x30755e=_0x30755e-0x0;var _0x3ef4b1=_0xe576[_0x30755e];return _0x3ef4b1;};'use strict';var EventEmitter=require(_0x6e57('0x0'));var CmContact=require('../../mysqldb')['db'][_0x6e57('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x6e57('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e57('0x3'),'afterDestroy':_0x6e57('0x4')};function emitEvent(_0xafa535){return function(_0x2e9724,_0x16d22e,_0x38faf4){CmContactEvents[_0x6e57('0x5')](_0xafa535+':'+_0x2e9724['id'],_0x2e9724);CmContactEvents[_0x6e57('0x5')](_0xafa535,_0x2e9724);_0x38faf4(null);};}for(var e in events){if(events[_0x6e57('0x6')](e)){var event=events[e];CmContact[_0x6e57('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0x9c61=['events','CmContact','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0x9c61,0x120));var _0x19c6=function(_0x1da7b,_0x3ce5ec){_0x1da7b=_0x1da7b-0x0;var _0x4bf8e3=_0x9c61[_0x1da7b];return _0x4bf8e3;};'use strict';var EventEmitter=require(_0x19c6('0x0'));var CmContact=require('../../mysqldb')['db'][_0x19c6('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x19c6('0x2')](0x0);var events={'afterCreate':_0x19c6('0x3'),'afterUpdate':_0x19c6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52213a){return function(_0x28484e,_0x5869bf,_0xe1e0b4){CmContactEvents['emit'](_0x52213a+':'+_0x28484e['id'],_0x28484e);CmContactEvents[_0x19c6('0x5')](_0x52213a,_0x28484e);_0xe1e0b4(null);};}for(var e in events){if(events[_0x19c6('0x6')](e)){var event=events[e];CmContact[_0x19c6('0x7')](e,emitEvent(event));}}module[_0x19c6('0x8')]=CmContactEvents;
\ No newline at end of file
index ed44dfe..bd5cb0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa557=['path','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','fax','email','FULLTEXT','models','error','afterCreate','inspect','CmHopper','findOne','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','CmHopperFinal','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','length','get','always','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','CmList','onlyIfOpen','Campaign','message','List\x20not\x20found','destroy','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','util','api','moment','bluebird','request-promise'];(function(_0x56f986,_0x2f70f9){var _0x988957=function(_0x3b3183){while(--_0x3b3183){_0x56f986['push'](_0x56f986['shift']());}};_0x988957(++_0x2f70f9);}(_0xa557,0x12b));var _0x7a55=function(_0x33879c,_0xd33def){_0x33879c=_0x33879c-0x0;var _0x3ef650=_0xa557[_0x33879c];return _0x3ef650;};'use strict';var _=require(_0x7a55('0x0'));var util=require(_0x7a55('0x1'));var logger=require('../../config/logger')(_0x7a55('0x2'));var moment=require(_0x7a55('0x3'));var BPromise=require(_0x7a55('0x4'));var rp=require(_0x7a55('0x5'));var fs=require('fs');var path=require(_0x7a55('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmContact.attributes');module['exports']=function(_0x51472f,_0x43e786){return _0x51472f['define'](_0x7a55('0x7'),attributes,{'tableName':_0x7a55('0x8'),'paranoid':!![],'indexes':[{'name':_0x7a55('0x9'),'fields':[_0x7a55('0x9')]},{'name':_0x7a55('0xa'),'fields':[_0x7a55('0xb'),'lastName',_0x7a55('0x9'),'mobile',_0x7a55('0xc'),_0x7a55('0xd')],'type':_0x7a55('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d5496,_0x1808e3,_0xbb6e16){var _0x50655f=_0x51472f[_0x7a55('0xf')];var _0x6c40fe=_0x4d5496['get']({'plain':!![]});function _0x34d2b3(){return function(_0x40596e){logger[_0x7a55('0x10')]('cmContact',_0x7a55('0x11'),util[_0x7a55('0x12')](_0x40596e,{'showHidden':![],'depth':null}));};}var _0x376f1f=function(_0x45ac14){return new BPromise(function(_0x2fc7d0,_0x1709d5){_0x50655f[_0x7a55('0x13')][_0x7a55('0x14')]({'where':{'phone':_0x6c40fe['phone'],'VoiceQueueId':_0x45ac14['id']}})['then'](function(_0x4b265a){if(!_[_0x7a55('0x15')](_0x4b265a)){throw new Error('cmContact,\x20afterCreate\x20'+_0x6c40fe[_0x7a55('0x9')]+_0x7a55('0x16')+_0x45ac14['id']);}return _0x50655f[_0x7a55('0x13')][_0x7a55('0x17')]({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe[_0x7a55('0x18')],'priority':_0x6c40fe[_0x7a55('0x19')]?_0x6c40fe['priority']:0x2,'scheduledat':_0x6c40fe[_0x7a55('0x1a')]?_0x6c40fe['scheduledat']:moment()[_0x7a55('0x1b')](_0x7a55('0x1c')),'callback':_0x6c40fe['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x6c40fe[_0x7a55('0x1d')]?_0x6c40fe[_0x7a55('0x1d')]:undefined,'callbackat':_0x6c40fe[_0x7a55('0x1d')]?moment()[_0x7a55('0x1b')](_0x7a55('0x1c')):undefined,'VoiceQueueId':_0x45ac14['id']});})[_0x7a55('0x1e')](function(_0x1efe21){_0x1709d5(_0x1efe21);});});};var _0x6fcefc=function(_0x1e64ee){return new BPromise(function(_0x2e46c1,_0xfb2b2b){_0x50655f['CmHopper'][_0x7a55('0x14')]({'where':{'phone':_0x6c40fe['phone'],'VoiceQueueId':_0x1e64ee['id']}})['then'](function(_0x60a2e4){if(!_[_0x7a55('0x15')](_0x60a2e4)){throw new Error(_0x7a55('0x1f')+_0x6c40fe['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x1e64ee['id']);}return _0x50655f[_0x7a55('0x20')][_0x7a55('0x14')]({'where':{'calleridnum':_0x6c40fe['phone'],'VoiceQueueId':_0x1e64ee['id']}});})[_0x7a55('0x21')](function(_0xacdf99){if(!_['isNil'](_0xacdf99)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x6c40fe['phone']+_0x7a55('0x22')+_0x1e64ee['id']);}return _0x50655f[_0x7a55('0x13')][_0x7a55('0x17')]({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe['ListId'],'priority':_0x6c40fe[_0x7a55('0x19')]?_0x6c40fe[_0x7a55('0x19')]:0x2,'scheduledat':_0x6c40fe[_0x7a55('0x1a')]?_0x6c40fe[_0x7a55('0x1a')]:moment()[_0x7a55('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x6c40fe['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x6c40fe['callbackUniqueid']?_0x6c40fe[_0x7a55('0x1d')]:undefined,'callbackat':_0x6c40fe['callbackUniqueid']?moment()[_0x7a55('0x1b')](_0x7a55('0x1c')):undefined,'VoiceQueueId':_0x1e64ee['id']});})['catch'](function(_0x3b0ef1){_0xfb2b2b(_0x3b0ef1);});});};function _0x2c2707(){return function(_0x4ca358){logger[_0x7a55('0x10')](_0x7a55('0x23'),_0x7a55('0x11'),util[_0x7a55('0x12')](_0x4ca358,{'showHidden':![],'depth':null}));};}var _0x2a6c1f=function(_0x437ea6){return new BPromise(function(_0x3adb05,_0x1f8ce6){_0x50655f[_0x7a55('0x13')][_0x7a55('0x14')]({'where':{'phone':_0x6c40fe[_0x7a55('0x9')],'CampaignId':_0x437ea6['id']}})['then'](function(_0xeaca1b){if(!_[_0x7a55('0x15')](_0xeaca1b)){throw new Error(_0x7a55('0x1f')+_0x6c40fe['phone']+_0x7a55('0x24')+_0x437ea6['id']);}return _0x50655f[_0x7a55('0x13')][_0x7a55('0x17')]({'phone':_0x6c40fe['phone'],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe['ListId'],'priority':_0x6c40fe[_0x7a55('0x19')]?_0x6c40fe[_0x7a55('0x19')]:0x2,'scheduledat':_0x6c40fe[_0x7a55('0x1a')]?_0x6c40fe[_0x7a55('0x1a')]:moment()[_0x7a55('0x1b')](_0x7a55('0x1c')),'callback':_0x6c40fe[_0x7a55('0x1d')]?!![]:![],'callbackuniqueid':_0x6c40fe[_0x7a55('0x1d')]?_0x6c40fe['callbackUniqueid']:undefined,'callbackat':_0x6c40fe['callbackUniqueid']?moment()[_0x7a55('0x1b')](_0x7a55('0x1c')):undefined,'CampaignId':_0x437ea6['id']});})[_0x7a55('0x1e')](function(_0x28fd9c){_0x1f8ce6(_0x28fd9c);});});};var _0x1a8d4d=function(_0x3bff22){return new BPromise(function(_0x3c79c0,_0x27dd02){_0x50655f[_0x7a55('0x13')][_0x7a55('0x14')]({'where':{'phone':_0x6c40fe['phone'],'CampaignId':_0x3bff22['id']}})[_0x7a55('0x21')](function(_0x51de40){if(!_[_0x7a55('0x15')](_0x51de40)){throw new Error(_0x7a55('0x1f')+_0x6c40fe[_0x7a55('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3bff22['id']);}return _0x50655f[_0x7a55('0x20')]['findOne']({'where':{'calleridnum':_0x6c40fe[_0x7a55('0x9')],'CampaignId':_0x3bff22['id']}});})[_0x7a55('0x21')](function(_0x4adb28){if(!_[_0x7a55('0x15')](_0x4adb28)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x6c40fe[_0x7a55('0x9')]+_0x7a55('0x25')+_0x3bff22['id']);}return _0x50655f[_0x7a55('0x13')][_0x7a55('0x17')]({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe[_0x7a55('0x18')],'priority':_0x6c40fe['priority']?_0x6c40fe[_0x7a55('0x19')]:0x2,'scheduledat':_0x6c40fe[_0x7a55('0x1a')]?_0x6c40fe['scheduledat']:moment()[_0x7a55('0x1b')](_0x7a55('0x1c')),'callback':_0x6c40fe[_0x7a55('0x1d')]?!![]:![],'callbackuniqueid':_0x6c40fe[_0x7a55('0x1d')]?_0x6c40fe[_0x7a55('0x1d')]:undefined,'callbackat':_0x6c40fe['callbackUniqueid']?moment()['format'](_0x7a55('0x1c')):undefined,'CampaignId':_0x3bff22['id']});})['catch'](function(_0x4683d3){_0x27dd02(_0x4683d3);});});};if(_0x6c40fe['ListId']){_0x50655f[_0x7a55('0x26')][_0x7a55('0x27')]({'where':{'type':_0x7a55('0x28')},'attributes':['id',_0x7a55('0x29')],'include':[{'model':_0x50655f['CmList'],'as':_0x7a55('0x2a'),'where':{'id':_0x6c40fe[_0x7a55('0x18')]}}]})[_0x7a55('0x21')](function(_0x5174ef){if(_0x5174ef){var _0x22150e=[];for(var _0x37c81a=0x0,_0x82307a;_0x37c81a<_0x5174ef[_0x7a55('0x2b')];_0x37c81a+=0x1){_0x82307a=_0x5174ef[_0x37c81a][_0x7a55('0x2c')]({'plain':!![]});switch(_0x82307a['dialCheckDuplicateType']){case _0x7a55('0x2d'):_0x6fcefc(_0x82307a)[_0x7a55('0x1e')](_0x34d2b3());break;case'onlyIfOpen':_0x376f1f(_0x82307a)['catch'](_0x34d2b3());break;default:_0x50655f[_0x7a55('0x13')]['create']({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe[_0x7a55('0x18')],'scheduledat':_0x6c40fe[_0x7a55('0x1a')]?_0x6c40fe['scheduledat']:moment()[_0x7a55('0x1b')](_0x7a55('0x1c')),'priority':_0x6c40fe[_0x7a55('0x19')]?_0x6c40fe[_0x7a55('0x19')]:0x2,'callback':_0x6c40fe[_0x7a55('0x1d')]?!![]:![],'callbackuniqueid':_0x6c40fe[_0x7a55('0x1d')]?_0x6c40fe['callbackUniqueid']:undefined,'callbackat':_0x6c40fe[_0x7a55('0x1d')]?moment()[_0x7a55('0x1b')](_0x7a55('0x1c')):undefined,'VoiceQueueId':_0x82307a['id']})[_0x7a55('0x1e')](_0x34d2b3());}}}})[_0x7a55('0x21')](function(){return _0x50655f[_0x7a55('0x26')][_0x7a55('0x27')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x50655f['CmList'],'as':_0x7a55('0x2e'),'where':{'id':_0x6c40fe[_0x7a55('0x18')]}}]})[_0x7a55('0x21')](function(_0xb98ad4){if(_0xb98ad4){var _0x22a91c=[];for(var _0x3ef574=0x0,_0x3a5208;_0x3ef574<_0xb98ad4[_0x7a55('0x2b')];_0x3ef574+=0x1){_0x3a5208=_0xb98ad4[_0x3ef574][_0x7a55('0x2c')]({'plain':!![]});_0x50655f[_0x7a55('0x2f')][_0x7a55('0x17')]({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe[_0x7a55('0x18')],'VoiceQueueId':_0x3a5208['id']})['catch'](function(_0x31af73){logger[_0x7a55('0x10')](_0x7a55('0x30'),_0x7a55('0x11'),_0x31af73['message']);});}}});})[_0x7a55('0x21')](function(){return _0x50655f['Campaign']['findAll']({'attributes':['id',_0x7a55('0x29')],'include':[{'model':_0x50655f[_0x7a55('0x31')],'as':_0x7a55('0x2a'),'where':{'id':_0x6c40fe[_0x7a55('0x18')]}}]})[_0x7a55('0x21')](function(_0x4c183a){if(_0x4c183a){var _0x3be0f4=[];for(var _0x552e7a=0x0,_0x2b7f0f;_0x552e7a<_0x4c183a[_0x7a55('0x2b')];_0x552e7a+=0x1){_0x2b7f0f=_0x4c183a[_0x552e7a][_0x7a55('0x2c')]({'plain':!![]});switch(_0x2b7f0f[_0x7a55('0x29')]){case _0x7a55('0x2d'):_0x1a8d4d(_0x2b7f0f)['catch'](_0x2c2707());break;case _0x7a55('0x32'):_0x2a6c1f(_0x2b7f0f)[_0x7a55('0x1e')](_0x2c2707());break;default:_0x50655f['CmHopper'][_0x7a55('0x17')]({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe['ListId'],'scheduledat':_0x6c40fe[_0x7a55('0x1a')]?_0x6c40fe[_0x7a55('0x1a')]:moment()[_0x7a55('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x6c40fe[_0x7a55('0x19')]?_0x6c40fe[_0x7a55('0x19')]:0x2,'callback':_0x6c40fe[_0x7a55('0x1d')]?!![]:![],'callbackuniqueid':_0x6c40fe['callbackUniqueid']?_0x6c40fe[_0x7a55('0x1d')]:undefined,'callbackat':_0x6c40fe['callbackUniqueid']?moment()[_0x7a55('0x1b')](_0x7a55('0x1c')):undefined,'CampaignId':_0x2b7f0f['id']})[_0x7a55('0x1e')](_0x2c2707());}}}});})[_0x7a55('0x21')](function(){return _0x50655f[_0x7a55('0x33')][_0x7a55('0x27')]({'attributes':['id'],'include':[{'model':_0x50655f[_0x7a55('0x31')],'as':_0x7a55('0x2e'),'where':{'id':_0x6c40fe[_0x7a55('0x18')]}}]})['then'](function(_0x49f5a8){if(_0x49f5a8){var _0x2e4bef=[];for(var _0x174b42=0x0,_0x19719e;_0x174b42<_0x49f5a8[_0x7a55('0x2b')];_0x174b42+=0x1){_0x19719e=_0x49f5a8[_0x174b42][_0x7a55('0x2c')]({'plain':!![]});_0x50655f['CmHopperBlack'][_0x7a55('0x17')]({'phone':_0x6c40fe[_0x7a55('0x9')],'ContactId':_0x6c40fe['id'],'ListId':_0x6c40fe['ListId'],'CampaignId':_0x19719e['id']})[_0x7a55('0x1e')](function(_0x43c773){logger[_0x7a55('0x10')](_0x7a55('0x30'),_0x7a55('0x11'),_0x43c773[_0x7a55('0x34')]);});}}});})[_0x7a55('0x21')](function(){_0xbb6e16();})[_0x7a55('0x1e')](function(_0x2773d3){logger[_0x7a55('0x10')](_0x7a55('0x30'),'afterCreate',_0x2773d3[_0x7a55('0x34')]);_0xbb6e16(_0x2773d3);});}else{_0xbb6e16(new Error(_0x7a55('0x35')));}},'afterDestroy':function(_0x3245ee,_0x55486a,_0x51c30d){var _0x2c45b1=_0x51472f['models'];var _0x3b8c40=_0x3245ee['get']({'plain':!![]});return _0x2c45b1[_0x7a55('0x13')]['findAll']({'raw':!![],'where':{'ListId':_0x3b8c40[_0x7a55('0x18')],'ContactId':_0x3b8c40['id']}})['then'](function(_0x1916fc){if(!_['isEmpty'](_0x1916fc)){var _0x51c780=[];for(var _0x170b85=0x0;_0x170b85<_0x1916fc[_0x7a55('0x2b')];_0x170b85+=0x1){var _0x3e5a56=_0x2c45b1[_0x7a55('0x13')][_0x7a55('0x36')]({'where':{'ListId':_0x1916fc[_0x170b85][_0x7a55('0x18')],'ContactId':_0x1916fc[_0x170b85]['ContactId'],'VoiceQueueId':_0x1916fc[_0x170b85][_0x7a55('0x37')],'CampaignId':_0x1916fc[_0x170b85][_0x7a55('0x38')]}});_0x51c780[_0x7a55('0x39')](_0x3e5a56);}return BPromise[_0x7a55('0x3a')](_0x51c780);}})[_0x7a55('0x21')](function(_0x175588){logger[_0x7a55('0x3b')]('[CmContact][afterDestroy][Succesfull]',util[_0x7a55('0x12')](_0x175588,{'showHidden':![],'depth':null}));_0x51c30d();})[_0x7a55('0x1e')](function(_0x634c28){logger[_0x7a55('0x10')](_0x7a55('0x3c'),util[_0x7a55('0x12')](_0x634c28,{'showHidden':![],'depth':null}));_0x51c30d(_0x634c28);});}}});};
\ No newline at end of file
+var _0x5665=['CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','catch','\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','dialCheckDuplicateType','CmList','Lists','get','always','onlyIfOpen','outbound','BlackLists','length','Campaign','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','destroy','ContactId','VoiceQueueId','push','lodash','../../config/logger','api','moment','request-promise','path','rimraf','define','CmContact','cm_contacts','fti_cm_contacts','firstName','phone','mobile','fax','email','models','error','afterCreate','inspect','findOne','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','scheduledat','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','format'];(function(_0x5944a5,_0x3d5992){var _0x58f38d=function(_0x21cafc){while(--_0x21cafc){_0x5944a5['push'](_0x5944a5['shift']());}};_0x58f38d(++_0x3d5992);}(_0x5665,0xcc));var _0x5566=function(_0x58d003,_0x23cf66){_0x58d003=_0x58d003-0x0;var _0x588ab8=_0x5665[_0x58d003];return _0x588ab8;};'use strict';var _=require(_0x5566('0x0'));var util=require('util');var logger=require(_0x5566('0x1'))(_0x5566('0x2'));var moment=require(_0x5566('0x3'));var BPromise=require('bluebird');var rp=require(_0x5566('0x4'));var fs=require('fs');var path=require(_0x5566('0x5'));var rimraf=require(_0x5566('0x6'));var config=require('../../config/environment');var attributes=require('./cmContact.attributes');module['exports']=function(_0x3ca2e7,_0xfe17f0){return _0x3ca2e7[_0x5566('0x7')](_0x5566('0x8'),attributes,{'tableName':_0x5566('0x9'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x5566('0xa'),'fields':[_0x5566('0xb'),'lastName',_0x5566('0xc'),_0x5566('0xd'),_0x5566('0xe'),_0x5566('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f8ffb,_0x17d78f,_0x267664){var _0x1e470b=_0x3ca2e7[_0x5566('0x10')];var _0x1a9f6c=_0x3f8ffb['get']({'plain':!![]});function _0x3ff498(){return function(_0x31bd15){logger[_0x5566('0x11')]('cmContact',_0x5566('0x12'),util[_0x5566('0x13')](_0x31bd15,{'showHidden':![],'depth':null}));};}var _0x3ceea1=function(_0x502f22){return new BPromise(function(_0x7854e3,_0x23e5ce){_0x1e470b['CmHopper'][_0x5566('0x14')]({'where':{'phone':_0x1a9f6c[_0x5566('0xc')],'VoiceQueueId':_0x502f22['id']}})[_0x5566('0x15')](function(_0x3ac41f){if(!_[_0x5566('0x16')](_0x3ac41f)){throw new Error(_0x5566('0x17')+_0x1a9f6c[_0x5566('0xc')]+_0x5566('0x18')+_0x502f22['id']);}return _0x1e470b[_0x5566('0x19')][_0x5566('0x1a')]({'phone':_0x1a9f6c['phone'],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c['ListId'],'priority':_0x1a9f6c[_0x5566('0x1b')]?_0x1a9f6c[_0x5566('0x1b')]:0x2,'scheduledat':_0x1a9f6c[_0x5566('0x1c')]?_0x1a9f6c['scheduledat']:moment()['format'](_0x5566('0x1d')),'callback':_0x1a9f6c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1a9f6c[_0x5566('0x1e')]?_0x1a9f6c[_0x5566('0x1e')]:undefined,'callbackat':_0x1a9f6c[_0x5566('0x1e')]?moment()[_0x5566('0x1f')](_0x5566('0x1d')):undefined,'VoiceQueueId':_0x502f22['id']});})['catch'](function(_0x582e4b){_0x23e5ce(_0x582e4b);});});};var _0x3c2501=function(_0x14671d){return new BPromise(function(_0x1440e6,_0x2f7011){_0x1e470b['CmHopper'][_0x5566('0x14')]({'where':{'phone':_0x1a9f6c[_0x5566('0xc')],'VoiceQueueId':_0x14671d['id']}})[_0x5566('0x15')](function(_0x32421f){if(!_[_0x5566('0x16')](_0x32421f)){throw new Error(_0x5566('0x17')+_0x1a9f6c[_0x5566('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x14671d['id']);}return _0x1e470b[_0x5566('0x20')][_0x5566('0x14')]({'where':{'calleridnum':_0x1a9f6c[_0x5566('0xc')],'VoiceQueueId':_0x14671d['id']}});})[_0x5566('0x15')](function(_0x39e698){if(!_[_0x5566('0x16')](_0x39e698)){throw new Error(_0x5566('0x21')+_0x1a9f6c['phone']+_0x5566('0x22')+_0x14671d['id']);}return _0x1e470b[_0x5566('0x19')][_0x5566('0x1a')]({'phone':_0x1a9f6c[_0x5566('0xc')],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c[_0x5566('0x23')],'priority':_0x1a9f6c[_0x5566('0x1b')]?_0x1a9f6c[_0x5566('0x1b')]:0x2,'scheduledat':_0x1a9f6c[_0x5566('0x1c')]?_0x1a9f6c[_0x5566('0x1c')]:moment()[_0x5566('0x1f')](_0x5566('0x1d')),'callback':_0x1a9f6c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1a9f6c[_0x5566('0x1e')]?_0x1a9f6c[_0x5566('0x1e')]:undefined,'callbackat':_0x1a9f6c[_0x5566('0x1e')]?moment()[_0x5566('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x14671d['id']});})[_0x5566('0x24')](function(_0x1cc51d){_0x2f7011(_0x1cc51d);});});};function _0x1faa5e(){return function(_0x42d45e){logger['error']('cmContact',_0x5566('0x12'),util[_0x5566('0x13')](_0x42d45e,{'showHidden':![],'depth':null}));};}var _0xf51790=function(_0x210350){return new BPromise(function(_0x5c16e0,_0x1e8bc5){_0x1e470b[_0x5566('0x19')][_0x5566('0x14')]({'where':{'phone':_0x1a9f6c['phone'],'CampaignId':_0x210350['id']}})['then'](function(_0x501d59){if(!_[_0x5566('0x16')](_0x501d59)){throw new Error(_0x5566('0x17')+_0x1a9f6c['phone']+_0x5566('0x25')+_0x210350['id']);}return _0x1e470b[_0x5566('0x19')][_0x5566('0x1a')]({'phone':_0x1a9f6c[_0x5566('0xc')],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c[_0x5566('0x23')],'priority':_0x1a9f6c['priority']?_0x1a9f6c[_0x5566('0x1b')]:0x2,'scheduledat':_0x1a9f6c[_0x5566('0x1c')]?_0x1a9f6c['scheduledat']:moment()[_0x5566('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x1a9f6c[_0x5566('0x1e')]?!![]:![],'callbackuniqueid':_0x1a9f6c[_0x5566('0x1e')]?_0x1a9f6c['callbackUniqueid']:undefined,'callbackat':_0x1a9f6c['callbackUniqueid']?moment()['format'](_0x5566('0x1d')):undefined,'CampaignId':_0x210350['id']});})[_0x5566('0x24')](function(_0x2a47f7){_0x1e8bc5(_0x2a47f7);});});};var _0xbc6baa=function(_0x3c6429){return new BPromise(function(_0x100315,_0x480383){_0x1e470b[_0x5566('0x19')][_0x5566('0x14')]({'where':{'phone':_0x1a9f6c[_0x5566('0xc')],'CampaignId':_0x3c6429['id']}})[_0x5566('0x15')](function(_0x5194d7){if(!_[_0x5566('0x16')](_0x5194d7)){throw new Error(_0x5566('0x17')+_0x1a9f6c[_0x5566('0xc')]+_0x5566('0x26')+_0x3c6429['id']);}return _0x1e470b[_0x5566('0x20')][_0x5566('0x14')]({'where':{'calleridnum':_0x1a9f6c['phone'],'CampaignId':_0x3c6429['id']}});})[_0x5566('0x15')](function(_0x38d556){if(!_[_0x5566('0x16')](_0x38d556)){throw new Error(_0x5566('0x21')+_0x1a9f6c[_0x5566('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x3c6429['id']);}return _0x1e470b[_0x5566('0x19')][_0x5566('0x1a')]({'phone':_0x1a9f6c[_0x5566('0xc')],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c['ListId'],'priority':_0x1a9f6c[_0x5566('0x1b')]?_0x1a9f6c[_0x5566('0x1b')]:0x2,'scheduledat':_0x1a9f6c['scheduledat']?_0x1a9f6c[_0x5566('0x1c')]:moment()[_0x5566('0x1f')](_0x5566('0x1d')),'callback':_0x1a9f6c[_0x5566('0x1e')]?!![]:![],'callbackuniqueid':_0x1a9f6c[_0x5566('0x1e')]?_0x1a9f6c[_0x5566('0x1e')]:undefined,'callbackat':_0x1a9f6c[_0x5566('0x1e')]?moment()[_0x5566('0x1f')](_0x5566('0x1d')):undefined,'CampaignId':_0x3c6429['id']});})[_0x5566('0x24')](function(_0x35d0a0){_0x480383(_0x35d0a0);});});};if(_0x1a9f6c[_0x5566('0x23')]){_0x1e470b[_0x5566('0x27')][_0x5566('0x28')]({'where':{'type':'outbound'},'attributes':['id',_0x5566('0x29')],'include':[{'model':_0x1e470b[_0x5566('0x2a')],'as':_0x5566('0x2b'),'where':{'id':_0x1a9f6c['ListId']}}]})[_0x5566('0x15')](function(_0x164591){if(_0x164591){var _0x5245e0=[];for(var _0x2b734d=0x0,_0x1a2ace;_0x2b734d<_0x164591['length'];_0x2b734d+=0x1){_0x1a2ace=_0x164591[_0x2b734d][_0x5566('0x2c')]({'plain':!![]});switch(_0x1a2ace[_0x5566('0x29')]){case _0x5566('0x2d'):_0x3c2501(_0x1a2ace)[_0x5566('0x24')](_0x3ff498());break;case _0x5566('0x2e'):_0x3ceea1(_0x1a2ace)[_0x5566('0x24')](_0x3ff498());break;default:_0x1e470b['CmHopper'][_0x5566('0x1a')]({'phone':_0x1a9f6c[_0x5566('0xc')],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c['ListId'],'scheduledat':_0x1a9f6c['scheduledat']?_0x1a9f6c['scheduledat']:moment()['format'](_0x5566('0x1d')),'priority':_0x1a9f6c['priority']?_0x1a9f6c[_0x5566('0x1b')]:0x2,'callback':_0x1a9f6c[_0x5566('0x1e')]?!![]:![],'callbackuniqueid':_0x1a9f6c[_0x5566('0x1e')]?_0x1a9f6c[_0x5566('0x1e')]:undefined,'callbackat':_0x1a9f6c[_0x5566('0x1e')]?moment()[_0x5566('0x1f')](_0x5566('0x1d')):undefined,'VoiceQueueId':_0x1a2ace['id']})[_0x5566('0x24')](_0x3ff498());}}}})[_0x5566('0x15')](function(){return _0x1e470b['VoiceQueue'][_0x5566('0x28')]({'where':{'type':_0x5566('0x2f')},'attributes':['id'],'include':[{'model':_0x1e470b[_0x5566('0x2a')],'as':_0x5566('0x30'),'where':{'id':_0x1a9f6c[_0x5566('0x23')]}}]})['then'](function(_0x4f7b96){if(_0x4f7b96){var _0x103146=[];for(var _0x4e5849=0x0,_0x10c3bc;_0x4e5849<_0x4f7b96[_0x5566('0x31')];_0x4e5849+=0x1){_0x10c3bc=_0x4f7b96[_0x4e5849][_0x5566('0x2c')]({'plain':!![]});_0x1e470b['CmHopperBlack']['create']({'phone':_0x1a9f6c[_0x5566('0xc')],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c[_0x5566('0x23')],'VoiceQueueId':_0x10c3bc['id']})['catch'](function(_0x3e714c){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x3e714c['message']);});}}});})[_0x5566('0x15')](function(){return _0x1e470b[_0x5566('0x32')][_0x5566('0x28')]({'attributes':['id',_0x5566('0x29')],'include':[{'model':_0x1e470b[_0x5566('0x2a')],'as':_0x5566('0x2b'),'where':{'id':_0x1a9f6c[_0x5566('0x23')]}}]})['then'](function(_0x518cca){if(_0x518cca){var _0x50ac22=[];for(var _0x19b38b=0x0,_0x4ac474;_0x19b38b<_0x518cca[_0x5566('0x31')];_0x19b38b+=0x1){_0x4ac474=_0x518cca[_0x19b38b]['get']({'plain':!![]});switch(_0x4ac474[_0x5566('0x29')]){case'always':_0xbc6baa(_0x4ac474)[_0x5566('0x24')](_0x1faa5e());break;case _0x5566('0x2e'):_0xf51790(_0x4ac474)[_0x5566('0x24')](_0x1faa5e());break;default:_0x1e470b[_0x5566('0x19')]['create']({'phone':_0x1a9f6c[_0x5566('0xc')],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c[_0x5566('0x23')],'scheduledat':_0x1a9f6c[_0x5566('0x1c')]?_0x1a9f6c['scheduledat']:moment()['format'](_0x5566('0x1d')),'priority':_0x1a9f6c[_0x5566('0x1b')]?_0x1a9f6c[_0x5566('0x1b')]:0x2,'callback':_0x1a9f6c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1a9f6c[_0x5566('0x1e')]?_0x1a9f6c[_0x5566('0x1e')]:undefined,'callbackat':_0x1a9f6c['callbackUniqueid']?moment()[_0x5566('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4ac474['id']})[_0x5566('0x24')](_0x1faa5e());}}}});})[_0x5566('0x15')](function(){return _0x1e470b[_0x5566('0x32')][_0x5566('0x28')]({'attributes':['id'],'include':[{'model':_0x1e470b[_0x5566('0x2a')],'as':'BlackLists','where':{'id':_0x1a9f6c[_0x5566('0x23')]}}]})[_0x5566('0x15')](function(_0xd5fe39){if(_0xd5fe39){var _0x4b774a=[];for(var _0x11d55c=0x0,_0x13ae67;_0x11d55c<_0xd5fe39[_0x5566('0x31')];_0x11d55c+=0x1){_0x13ae67=_0xd5fe39[_0x11d55c][_0x5566('0x2c')]({'plain':!![]});_0x1e470b[_0x5566('0x33')][_0x5566('0x1a')]({'phone':_0x1a9f6c['phone'],'ContactId':_0x1a9f6c['id'],'ListId':_0x1a9f6c['ListId'],'CampaignId':_0x13ae67['id']})[_0x5566('0x24')](function(_0x3ee829){logger[_0x5566('0x11')]('cmContact,\x20%s,\x20%s',_0x5566('0x12'),_0x3ee829['message']);});}}});})[_0x5566('0x15')](function(){_0x267664();})[_0x5566('0x24')](function(_0x316f94){logger[_0x5566('0x11')](_0x5566('0x34'),_0x5566('0x12'),_0x316f94[_0x5566('0x35')]);_0x267664(_0x316f94);});}else{_0x267664(new Error(_0x5566('0x36')));}},'afterDestroy':function(_0x515fe9,_0x29ec38,_0x58f77b){var _0xbec82f=_0x3ca2e7[_0x5566('0x10')];var _0x54dde1=_0x515fe9[_0x5566('0x2c')]({'plain':!![]});return _0xbec82f['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x54dde1[_0x5566('0x23')],'ContactId':_0x54dde1['id']}})[_0x5566('0x15')](function(_0x4174d5){if(!_['isEmpty'](_0x4174d5)){var _0x55dbcd=[];for(var _0x43d814=0x0;_0x43d814<_0x4174d5[_0x5566('0x31')];_0x43d814+=0x1){var _0x43abba=_0xbec82f[_0x5566('0x19')][_0x5566('0x37')]({'where':{'ListId':_0x4174d5[_0x43d814][_0x5566('0x23')],'ContactId':_0x4174d5[_0x43d814][_0x5566('0x38')],'VoiceQueueId':_0x4174d5[_0x43d814][_0x5566('0x39')],'CampaignId':_0x4174d5[_0x43d814]['CampaignId']}});_0x55dbcd[_0x5566('0x3a')](_0x43abba);}return BPromise['all'](_0x55dbcd);}})['then'](function(_0x1c7678){logger['info']('[CmContact][afterDestroy][Succesfull]',util[_0x5566('0x13')](_0x1c7678,{'showHidden':![],'depth':null}));_0x58f77b();})['catch'](function(_0x4b407e){logger[_0x5566('0x11')]('[CmContact][afterDestroy][Error]',util[_0x5566('0x13')](_0x4b407e,{'showHidden':![],'depth':null}));_0x58f77b(_0x4b407e);});}}});};
\ No newline at end of file
index 2ec80fa..907d5eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5571=['util','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','register','info','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CmContact','findAll','options','where','limit','include','model','attributes','map','then','GetCmContact','create','body','raw','length','keys','startsWith','cf_','table','id\x20=\x20?','toString','sequelize','query','CreateCmContact','lodash'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x5571,0x1df));var _0x1557=function(_0x4a6979,_0x5f3d1a){_0x4a6979=_0x4a6979-0x0;var _0x226f93=_0x5571[_0x4a6979];return _0x226f93;};'use strict';var _=require(_0x1557('0x0'));var util=require(_0x1557('0x1'));var moment=require('moment');var BPromise=require(_0x1557('0x2'));var rs=require(_0x1557('0x3'));var fs=require('fs');var Redis=require(_0x1557('0x4'));var squel=require(_0x1557('0x5'));var db=require(_0x1557('0x6'))['db'];var utils=require(_0x1557('0x7'));var logger=require('../../config/logger')(_0x1557('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1557('0x9')]({'port':0x232a});config[_0x1557('0xa')]=_[_0x1557('0xb')](config[_0x1557('0xa')],{'host':_0x1557('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0x1557('0xd')](socket);function respondWithRpcPromise(_0x569c1b,_0x573ae0,_0x1e9143){return new BPromise(function(_0x562723,_0x19bc07){return client['request'](_0x569c1b,_0x1e9143)['then'](function(_0x40b673){logger[_0x1557('0xe')](_0x1557('0xf'),_0x573ae0,'request\x20sent');logger[_0x1557('0x10')](_0x1557('0x11'),_0x573ae0,'request\x20sent',JSON[_0x1557('0x12')](_0x40b673));if(_0x40b673[_0x1557('0x13')]){if(_0x40b673['error'][_0x1557('0x14')]===0x1f4){logger[_0x1557('0x13')]('CmContact,\x20%s,\x20%s',_0x573ae0,_0x40b673[_0x1557('0x13')][_0x1557('0x15')]);return _0x19bc07(_0x40b673[_0x1557('0x13')][_0x1557('0x15')]);}logger['error']('CmContact,\x20%s,\x20%s',_0x573ae0,_0x40b673[_0x1557('0x13')][_0x1557('0x15')]);return _0x562723(_0x40b673['error'][_0x1557('0x15')]);}else{logger['info'](_0x1557('0xf'),_0x573ae0,_0x1557('0x16'));_0x562723(_0x40b673['result'][_0x1557('0x15')]);}})[_0x1557('0x17')](function(_0x682eab){logger[_0x1557('0x13')]('CmContact,\x20%s,\x20%s',_0x573ae0,_0x682eab);_0x19bc07(_0x682eab);});});}exports['GetCmContact']=function(_0x12c0cd){var _0x171965=this;return new Promise(function(_0x2383c2,_0x2fcc3f){return db[_0x1557('0x18')][_0x1557('0x19')]({'raw':_0x12c0cd['options']?_0x12c0cd['options']['raw']===undefined?!![]:![]:!![],'where':_0x12c0cd[_0x1557('0x1a')]?_0x12c0cd[_0x1557('0x1a')][_0x1557('0x1b')]||null:null,'attributes':_0x12c0cd[_0x1557('0x1a')]?_0x12c0cd['options']['attributes']||null:null,'limit':_0x12c0cd[_0x1557('0x1a')]?_0x12c0cd[_0x1557('0x1a')][_0x1557('0x1c')]||null:null,'include':_0x12c0cd[_0x1557('0x1a')]?_0x12c0cd[_0x1557('0x1a')][_0x1557('0x1d')]?_['map'](_0x12c0cd['options'][_0x1557('0x1d')],function(_0x4780e0){return{'model':db[_0x4780e0['model']],'as':_0x4780e0['as'],'attributes':_0x4780e0['attributes'],'include':_0x4780e0[_0x1557('0x1d')]?_['map'](_0x4780e0[_0x1557('0x1d')],function(_0x393316){return{'model':db[_0x393316[_0x1557('0x1e')]],'as':_0x393316['as'],'attributes':_0x393316[_0x1557('0x1f')],'include':_0x393316['include']?_[_0x1557('0x20')](_0x393316[_0x1557('0x1d')],function(_0x3aafc9){return{'model':db[_0x3aafc9[_0x1557('0x1e')]],'as':_0x3aafc9['as'],'attributes':_0x3aafc9[_0x1557('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1557('0x21')](function(_0x2307e7){logger[_0x1557('0xe')]('GetCmContact',_0x12c0cd);logger[_0x1557('0x10')](_0x1557('0x22'),_0x12c0cd,JSON['stringify'](_0x2307e7));_0x2383c2(_0x2307e7);})[_0x1557('0x17')](function(_0x2652b7){logger[_0x1557('0x13')](_0x1557('0x22'),_0x2652b7[_0x1557('0x15')],_0x12c0cd);_0x2fcc3f(_0x171965[_0x1557('0x13')](0x1f4,_0x2652b7[_0x1557('0x15')]));});});};exports['CreateCmContact']=function(_0x51593e){var _0x4063d1=this;return new Promise(function(_0x2c5031,_0x26a975){return db[_0x1557('0x18')][_0x1557('0x23')](_0x51593e[_0x1557('0x24')],{'raw':_0x51593e[_0x1557('0x1a')]?_0x51593e[_0x1557('0x1a')][_0x1557('0x25')]===undefined?!![]:![]:!![]})[_0x1557('0x21')](function(_0x527ca7){var _0x5b814e;for(var _0x35791a=0x0;_0x35791a<Object['keys'](_0x51593e[_0x1557('0x24')])[_0x1557('0x26')];_0x35791a++){var _0x241d66=Object[_0x1557('0x27')](_0x51593e[_0x1557('0x24')])[_0x35791a];if(_0x241d66[_0x1557('0x28')](_0x1557('0x29'))){_0x5b814e=squel['update']()[_0x1557('0x2a')]('cm_contacts')['set'](_0x241d66,_0x51593e[_0x1557('0x24')][_0x241d66])[_0x1557('0x1b')](_0x1557('0x2b'),_0x527ca7['id'])[_0x1557('0x2c')]();break;}}if(!_0x5b814e)return _0x527ca7;return db[_0x1557('0x2d')][_0x1557('0x2e')](_0x5b814e)[_0x1557('0x21')](function(){return _0x527ca7;});})[_0x1557('0x21')](function(_0x4f2495){logger[_0x1557('0xe')]('CreateCmContact',_0x51593e);logger[_0x1557('0x10')]('CreateCmContact',_0x51593e,JSON[_0x1557('0x12')](_0x4f2495));_0x2c5031(_0x4f2495);})['catch'](function(_0x41ecb6){logger[_0x1557('0x13')](_0x1557('0x2f'),_0x41ecb6[_0x1557('0x15')],_0x51593e);_0x26a975(_0x4063d1[_0x1557('0x13')](0x1f4,_0x41ecb6['message']));});});};
\ No newline at end of file
+var _0x4e51=['limit','include','map','model','GetCmContact','debug','catch','CreateCmContact','create','body','raw','keys','length','cf_','update','table','cm_contacts','set','toString','query','lodash','util','moment','bluebird','randomstring','squel','../../mysqldb','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','request\x20sent','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message','CmContact','findAll','options','where','attributes'];(function(_0x378527,_0x23cc9b){var _0x26beeb=function(_0x3356ad){while(--_0x3356ad){_0x378527['push'](_0x378527['shift']());}};_0x26beeb(++_0x23cc9b);}(_0x4e51,0x1a4));var _0x14e5=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x4e51[_0x5400a1];return _0x4006c7;};'use strict';var _=require(_0x14e5('0x0'));var util=require(_0x14e5('0x1'));var moment=require(_0x14e5('0x2'));var BPromise=require(_0x14e5('0x3'));var rs=require(_0x14e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0x14e5('0x5'));var db=require(_0x14e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x14e5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x14e5('0x8')]['http']({'port':0x232a});config[_0x14e5('0x9')]=_[_0x14e5('0xa')](config['redis'],{'host':_0x14e5('0xb'),'port':0x18eb});var socket=require(_0x14e5('0xc'))(new Redis(config[_0x14e5('0x9')]));require(_0x14e5('0xd'))[_0x14e5('0xe')](socket);function respondWithRpcPromise(_0x450f3,_0x5444c1,_0x272717){return new BPromise(function(_0x11dd28,_0x2d96f0){return client[_0x14e5('0xf')](_0x450f3,_0x272717)[_0x14e5('0x10')](function(_0x48def6){logger[_0x14e5('0x11')]('CmContact,\x20%s,\x20%s',_0x5444c1,_0x14e5('0x12'));logger['debug'](_0x14e5('0x13'),_0x5444c1,_0x14e5('0x12'),JSON[_0x14e5('0x14')](_0x48def6));if(_0x48def6[_0x14e5('0x15')]){if(_0x48def6['error'][_0x14e5('0x16')]===0x1f4){logger['error'](_0x14e5('0x17'),_0x5444c1,_0x48def6[_0x14e5('0x15')]['message']);return _0x2d96f0(_0x48def6['error']['message']);}logger[_0x14e5('0x15')](_0x14e5('0x17'),_0x5444c1,_0x48def6[_0x14e5('0x15')][_0x14e5('0x18')]);return _0x11dd28(_0x48def6[_0x14e5('0x15')][_0x14e5('0x18')]);}else{logger[_0x14e5('0x11')](_0x14e5('0x17'),_0x5444c1,'request\x20sent');_0x11dd28(_0x48def6['result'][_0x14e5('0x18')]);}})['catch'](function(_0x1dcb56){logger[_0x14e5('0x15')](_0x14e5('0x17'),_0x5444c1,_0x1dcb56);_0x2d96f0(_0x1dcb56);});});}exports['GetCmContact']=function(_0x38446d){var _0x1e66e7=this;return new Promise(function(_0x4a049c,_0x27e2c0){return db[_0x14e5('0x19')][_0x14e5('0x1a')]({'raw':_0x38446d[_0x14e5('0x1b')]?_0x38446d[_0x14e5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x38446d[_0x14e5('0x1b')]?_0x38446d[_0x14e5('0x1b')][_0x14e5('0x1c')]||null:null,'attributes':_0x38446d[_0x14e5('0x1b')]?_0x38446d['options'][_0x14e5('0x1d')]||null:null,'limit':_0x38446d[_0x14e5('0x1b')]?_0x38446d['options'][_0x14e5('0x1e')]||null:null,'include':_0x38446d[_0x14e5('0x1b')]?_0x38446d['options'][_0x14e5('0x1f')]?_[_0x14e5('0x20')](_0x38446d[_0x14e5('0x1b')][_0x14e5('0x1f')],function(_0x47ee9a){return{'model':db[_0x47ee9a[_0x14e5('0x21')]],'as':_0x47ee9a['as'],'attributes':_0x47ee9a['attributes'],'include':_0x47ee9a[_0x14e5('0x1f')]?_[_0x14e5('0x20')](_0x47ee9a[_0x14e5('0x1f')],function(_0x579294){return{'model':db[_0x579294[_0x14e5('0x21')]],'as':_0x579294['as'],'attributes':_0x579294[_0x14e5('0x1d')],'include':_0x579294[_0x14e5('0x1f')]?_[_0x14e5('0x20')](_0x579294[_0x14e5('0x1f')],function(_0x769bf4){return{'model':db[_0x769bf4['model']],'as':_0x769bf4['as'],'attributes':_0x769bf4['attributes']};}):[]};}):[]};}):[]:[]})[_0x14e5('0x10')](function(_0x55b4be){logger[_0x14e5('0x11')](_0x14e5('0x22'),_0x38446d);logger[_0x14e5('0x23')](_0x14e5('0x22'),_0x38446d,JSON[_0x14e5('0x14')](_0x55b4be));_0x4a049c(_0x55b4be);})[_0x14e5('0x24')](function(_0x34cefc){logger['error']('GetCmContact',_0x34cefc['message'],_0x38446d);_0x27e2c0(_0x1e66e7[_0x14e5('0x15')](0x1f4,_0x34cefc[_0x14e5('0x18')]));});});};exports[_0x14e5('0x25')]=function(_0x29eef4){var _0x26452a=this;return new Promise(function(_0x1e14d3,_0x3fa0e9){return db['CmContact'][_0x14e5('0x26')](_0x29eef4[_0x14e5('0x27')],{'raw':_0x29eef4[_0x14e5('0x1b')]?_0x29eef4[_0x14e5('0x1b')][_0x14e5('0x28')]===undefined?!![]:![]:!![]})[_0x14e5('0x10')](function(_0x2a44f6){var _0xacca9a;for(var _0x14a6b8=0x0;_0x14a6b8<Object[_0x14e5('0x29')](_0x29eef4['body'])[_0x14e5('0x2a')];_0x14a6b8++){var _0x4a8b3d=Object[_0x14e5('0x29')](_0x29eef4['body'])[_0x14a6b8];if(_0x4a8b3d['startsWith'](_0x14e5('0x2b'))){_0xacca9a=squel[_0x14e5('0x2c')]()[_0x14e5('0x2d')](_0x14e5('0x2e'))[_0x14e5('0x2f')](_0x4a8b3d,_0x29eef4[_0x14e5('0x27')][_0x4a8b3d])['where']('id\x20=\x20?',_0x2a44f6['id'])[_0x14e5('0x30')]();break;}}if(!_0xacca9a)return _0x2a44f6;return db['sequelize'][_0x14e5('0x31')](_0xacca9a)[_0x14e5('0x10')](function(){return _0x2a44f6;});})[_0x14e5('0x10')](function(_0x343cef){logger[_0x14e5('0x11')](_0x14e5('0x25'),_0x29eef4);logger[_0x14e5('0x23')]('CreateCmContact',_0x29eef4,JSON['stringify'](_0x343cef));_0x1e14d3(_0x343cef);})[_0x14e5('0x24')](function(_0x4d349e){logger[_0x14e5('0x15')](_0x14e5('0x25'),_0x4d349e[_0x14e5('0x18')],_0x29eef4);_0x3fa0e9(_0x26452a['error'](0x1f4,_0x4d349e[_0x14e5('0x18')]));});});};
\ No newline at end of file
index f494969..50525ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 5c0c0cb..5573897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa278=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','/describe','/:id','show','get','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post','merge','create','bulkCreate','/:id/tags','setTags','diskStorage','root','server/files/tmp','originalname','%s-%s%s','extname','/csv','single','uploadCsv','join','replace','basename','upload','import','put','delete','destroy','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa278,0xbf));var _0x8a27=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0xa278[_0xe27035];return _0x3745bc;};'use strict';var multer=require('multer');var util=require(_0x8a27('0x0'));var path=require(_0x8a27('0x1'));var timeout=require(_0x8a27('0x2'));var express=require(_0x8a27('0x3'));var router=express[_0x8a27('0x4')]();var fs_extra=require(_0x8a27('0x5'));var auth=require(_0x8a27('0x6'));var interaction=require(_0x8a27('0x7'));var config=require(_0x8a27('0x8'));var controller=require(_0x8a27('0x9'));router['get']('/',auth[_0x8a27('0xa')](),controller['index']);router['get'](_0x8a27('0xb'),auth[_0x8a27('0xa')](),controller['describe']);router['get'](_0x8a27('0xc'),auth['isAuthenticated'](),controller[_0x8a27('0xd')]);router[_0x8a27('0xe')]('/:id/tags',auth[_0x8a27('0xa')](),controller[_0x8a27('0xf')]);router[_0x8a27('0xe')](_0x8a27('0x10'),auth[_0x8a27('0xa')](),controller[_0x8a27('0x11')]);router[_0x8a27('0xe')](_0x8a27('0x12'),auth['isAuthenticated'](),controller[_0x8a27('0x13')]);router[_0x8a27('0xe')](_0x8a27('0x14'),auth[_0x8a27('0xa')](),controller['getHopperFinals']);router[_0x8a27('0xe')](_0x8a27('0x15'),auth[_0x8a27('0xa')](),controller[_0x8a27('0x16')]);router[_0x8a27('0xe')](_0x8a27('0x17'),auth[_0x8a27('0xa')](),controller['getJourney']);router[_0x8a27('0x18')]('/merge',auth[_0x8a27('0xa')](),controller[_0x8a27('0x19')]);router[_0x8a27('0x18')]('/',auth[_0x8a27('0xa')](),controller[_0x8a27('0x1a')]);router[_0x8a27('0x18')]('/create_many',auth['isAuthenticated'](),controller[_0x8a27('0x1b')]);router[_0x8a27('0x18')](_0x8a27('0x1c'),auth['isAuthenticated'](),controller[_0x8a27('0x1d')]);var upload=multer({'storage':multer[_0x8a27('0x1e')]({'destination':function(_0x3fc0a5,_0x1730fc,_0x523bf9){_0x523bf9(null,path['join'](config[_0x8a27('0x1f')],_0x8a27('0x20')));},'filename':function(_0x35f7ef,_0x3a08a0,_0x23366f){_0x3a08a0[_0x8a27('0x21')]=_0x3a08a0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x23366f(null,util['format'](_0x8a27('0x22'),path['basename'](_0x3a08a0[_0x8a27('0x21')],path['extname'](_0x3a08a0['originalname'])),Date['now'](),path[_0x8a27('0x23')](_0x3a08a0[_0x8a27('0x21')])));}})});router[_0x8a27('0x18')](_0x8a27('0x24'),upload[_0x8a27('0x25')]('file'),controller[_0x8a27('0x26')]);var upload=multer({'storage':multer[_0x8a27('0x1e')]({'destination':function(_0x4efaaf,_0x43c7be,_0x366168){_0x366168(null,path[_0x8a27('0x27')](config[_0x8a27('0x1f')],_0x8a27('0x20')));},'filename':function(_0xc9fb77,_0x59092b,_0x53dca2){_0x59092b[_0x8a27('0x21')]=_0x59092b[_0x8a27('0x21')][_0x8a27('0x28')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53dca2(null,util['format'](_0x8a27('0x22'),path[_0x8a27('0x29')](_0x59092b[_0x8a27('0x21')],path['extname'](_0x59092b[_0x8a27('0x21')])),Date['now'](),path[_0x8a27('0x23')](_0x59092b[_0x8a27('0x21')])));}})});router['post']('/upload',upload[_0x8a27('0x25')]('file'),controller[_0x8a27('0x2a')]);router[_0x8a27('0x18')]('/upload/:id',auth[_0x8a27('0xa')](),controller[_0x8a27('0x2b')]);router[_0x8a27('0x2c')](_0x8a27('0xc'),auth[_0x8a27('0xa')](),controller['update']);router[_0x8a27('0x2d')](_0x8a27('0xc'),auth[_0x8a27('0xa')](),controller[_0x8a27('0x2e')]);module[_0x8a27('0x2f')]=router;
\ No newline at end of file
+var _0x2744=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','isAuthenticated','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/journey','getJourney','post','/merge','merge','/create_many','bulkCreate','setTags','root','originalname','replace','basename','now','extname','/csv','uploadCsv','diskStorage','join','format','%s-%s%s','single','file','upload','/upload/:id','import','put','update'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0x2744,0x1ed));var _0x4274=function(_0x2b457b,_0x2117da){_0x2b457b=_0x2b457b-0x0;var _0x1b8566=_0x2744[_0x2b457b];return _0x1b8566;};'use strict';var multer=require(_0x4274('0x0'));var util=require(_0x4274('0x1'));var path=require(_0x4274('0x2'));var timeout=require('connect-timeout');var express=require(_0x4274('0x3'));var router=express[_0x4274('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4274('0x5'));var interaction=require(_0x4274('0x6'));var config=require(_0x4274('0x7'));var controller=require(_0x4274('0x8'));router[_0x4274('0x9')]('/',auth['isAuthenticated'](),controller[_0x4274('0xa')]);router['get']('/describe',auth[_0x4274('0xb')](),controller[_0x4274('0xc')]);router[_0x4274('0x9')](_0x4274('0xd'),auth[_0x4274('0xb')](),controller[_0x4274('0xe')]);router['get'](_0x4274('0xf'),auth[_0x4274('0xb')](),controller['getTags']);router[_0x4274('0x9')](_0x4274('0x10'),auth[_0x4274('0xb')](),controller[_0x4274('0x11')]);router[_0x4274('0x9')](_0x4274('0x12'),auth[_0x4274('0xb')](),controller['getHopperHistories']);router[_0x4274('0x9')]('/:id/hopper_finals',auth[_0x4274('0xb')](),controller['getHopperFinals']);router[_0x4274('0x9')]('/:id/jscripty_sessions',auth[_0x4274('0xb')](),controller['getJscriptySessions']);router['get'](_0x4274('0x13'),auth[_0x4274('0xb')](),controller[_0x4274('0x14')]);router[_0x4274('0x15')](_0x4274('0x16'),auth['isAuthenticated'](),controller[_0x4274('0x17')]);router[_0x4274('0x15')]('/',auth[_0x4274('0xb')](),controller['create']);router[_0x4274('0x15')](_0x4274('0x18'),auth[_0x4274('0xb')](),controller[_0x4274('0x19')]);router[_0x4274('0x15')]('/:id/tags',auth[_0x4274('0xb')](),controller[_0x4274('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x373a72,_0x3bec55,_0x2a3832){_0x2a3832(null,path['join'](config[_0x4274('0x1b')],'server/files/tmp'));},'filename':function(_0x198720,_0x3dedac,_0x5042e7){_0x3dedac[_0x4274('0x1c')]=_0x3dedac[_0x4274('0x1c')][_0x4274('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5042e7(null,util['format']('%s-%s%s',path[_0x4274('0x1e')](_0x3dedac[_0x4274('0x1c')],path['extname'](_0x3dedac[_0x4274('0x1c')])),Date[_0x4274('0x1f')](),path[_0x4274('0x20')](_0x3dedac[_0x4274('0x1c')])));}})});router[_0x4274('0x15')](_0x4274('0x21'),upload['single']('file'),controller[_0x4274('0x22')]);var upload=multer({'storage':multer[_0x4274('0x23')]({'destination':function(_0x499c7b,_0x29906b,_0x44ee97){_0x44ee97(null,path[_0x4274('0x24')](config[_0x4274('0x1b')],'server/files/tmp'));},'filename':function(_0x5194ed,_0x55615d,_0x4a60a9){_0x55615d[_0x4274('0x1c')]=_0x55615d[_0x4274('0x1c')][_0x4274('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a60a9(null,util[_0x4274('0x25')](_0x4274('0x26'),path[_0x4274('0x1e')](_0x55615d[_0x4274('0x1c')],path[_0x4274('0x20')](_0x55615d[_0x4274('0x1c')])),Date[_0x4274('0x1f')](),path[_0x4274('0x20')](_0x55615d['originalname'])));}})});router['post']('/upload',upload[_0x4274('0x27')](_0x4274('0x28')),controller[_0x4274('0x29')]);router['post'](_0x4274('0x2a'),auth[_0x4274('0xb')](),controller[_0x4274('0x2b')]);router[_0x4274('0x2c')](_0x4274('0xd'),auth['isAuthenticated'](),controller[_0x4274('0x2d')]);router[_0x4274('0x2e')](_0x4274('0xd'),auth[_0x4274('0xb')](),controller[_0x4274('0x2f')]);module[_0x4274('0x30')]=router;
\ No newline at end of file
index dbf62a7..03d217f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5e7=['getDataValue','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','STRING','setDataValue'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xc5e7,0x1c6));var _0x7c5e=function(_0x3c57bd,_0x4d4f1d){_0x3c57bd=_0x3c57bd-0x0;var _0x5ed8f9=_0xc5e7[_0x3c57bd];return _0x5ed8f9;};'use strict';var Sequelize=require(_0x7c5e('0x0'));var _=require(_0x7c5e('0x1'));module[_0x7c5e('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2c0f26){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x7c5e('0x3')],'allowNull':![],'set':function(_0x373ae6){this[_0x7c5e('0x4')]('alias',_0x373ae6?_0x373ae6:this[_0x7c5e('0x5')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x7c5e('0x6')](_0x7c5e('0x7')),'get':function(){if(this['getDataValue'](_0x7c5e('0x8'))===_0x7c5e('0x9')){return JSON[_0x7c5e('0xa')](this[_0x7c5e('0x5')](_0x7c5e('0xb')));}else{return this[_0x7c5e('0x5')]('values');}},'set':function(_0x321b2f){if(Array[_0x7c5e('0xc')](_0x321b2f)){this[_0x7c5e('0x4')](_0x7c5e('0xb'),JSON[_0x7c5e('0xd')](_0x321b2f));}else{this[_0x7c5e('0x4')](_0x7c5e('0xb'),_0x321b2f);}}},'required':{'type':Sequelize[_0x7c5e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7c5e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x7c5e('0xf')](_0x7c5e('0x10'))}};
\ No newline at end of file
+var _0x6a5f=['parse','values','stringify','BOOLEAN','ENUM','sequelize','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select'];(function(_0x93c0cc,_0x59536a){var _0x2739e9=function(_0x449250){while(--_0x449250){_0x93c0cc['push'](_0x93c0cc['shift']());}};_0x2739e9(++_0x59536a);}(_0x6a5f,0x85));var _0xf6a5=function(_0x34596a,_0x4f5372){_0x34596a=_0x34596a-0x0;var _0x1695ec=_0x6a5f[_0x34596a];return _0x1695ec;};'use strict';var Sequelize=require(_0xf6a5('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xf6a5('0x1')],'get':function(_0x24e628){return this[_0xf6a5('0x2')](_0xf6a5('0x3'));}},'alias':{'type':Sequelize[_0xf6a5('0x4')],'allowNull':![],'set':function(_0x481d00){this[_0xf6a5('0x5')](_0xf6a5('0x3'),_0x481d00?_0x481d00:this['getDataValue'](_0xf6a5('0x6')));}},'type':{'type':Sequelize[_0xf6a5('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xf6a5('0x7')](_0xf6a5('0x8')),'get':function(){if(this[_0xf6a5('0x2')](_0xf6a5('0x9'))===_0xf6a5('0xa')){return JSON[_0xf6a5('0xb')](this['getDataValue']('values'));}else{return this['getDataValue'](_0xf6a5('0xc'));}},'set':function(_0xabd81d){if(Array['isArray'](_0xabd81d)){this[_0xf6a5('0x5')](_0xf6a5('0xc'),JSON[_0xf6a5('0xd')](_0xabd81d));}else{this[_0xf6a5('0x5')](_0xf6a5('0xc'),_0xabd81d);}}},'required':{'type':Sequelize[_0xf6a5('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf6a5('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf6a5('0xf')]('voice')}};
\ No newline at end of file
index d7068c5..f921595 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf50c=['type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','sequelize','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','CmCustomField','rawAttributes','fieldName'];(function(_0x10eefe,_0x1ea40d){var _0x1f65b3=function(_0x1c432f){while(--_0x1c432f){_0x10eefe['push'](_0x10eefe['shift']());}};_0x1f65b3(++_0x1ea40d);}(_0xf50c,0x1ce));var _0xcf50=function(_0x4491a7,_0x41ac41){_0x4491a7=_0x4491a7-0x0;var _0x9f9f7d=_0xf50c[_0x4491a7];return _0x9f9f7d;};'use strict';var emlformat=require(_0xcf50('0x0'));var rimraf=require(_0xcf50('0x1'));var zipdir=require(_0xcf50('0x2'));var jsonpatch=require(_0xcf50('0x3'));var rp=require(_0xcf50('0x4'));var moment=require(_0xcf50('0x5'));var BPromise=require(_0xcf50('0x6'));var Mustache=require(_0xcf50('0x7'));var util=require(_0xcf50('0x8'));var path=require(_0xcf50('0x9'));var sox=require('sox');var csv=require(_0xcf50('0xa'));var ejs=require(_0xcf50('0xb'));var fs=require('fs');var fs_extra=require(_0xcf50('0xc'));var _=require(_0xcf50('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf50('0xa'));var querystring=require('querystring');var Papa=require(_0xcf50('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcf50('0xf'));var hardwareService=require(_0xcf50('0x10'));var logger=require('../../config/logger')(_0xcf50('0x11'));var utils=require('../../config/utils');var config=require(_0xcf50('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf50('0x13'))['db'];function respondWithStatusCode(_0x1e451f,_0x1e2e62){_0x1e2e62=_0x1e2e62||0xcc;return function(_0x429bc3){if(_0x429bc3){return _0x1e451f['sendStatus'](_0x1e2e62);}return _0x1e451f[_0xcf50('0x14')](_0x1e2e62)[_0xcf50('0x15')]();};}function respondWithResult(_0x3be530,_0x4f3d02){_0x4f3d02=_0x4f3d02||0xc8;return function(_0x1da285){if(_0x1da285){return _0x3be530[_0xcf50('0x14')](_0x4f3d02)[_0xcf50('0x16')](_0x1da285);}};}function respondWithFilteredResult(_0x11d948,_0x384718){return function(_0x3f8bac){if(_0x3f8bac){var _0x2c7851=typeof _0x384718[_0xcf50('0x17')]==='undefined'&&typeof _0x384718[_0xcf50('0x18')]===_0xcf50('0x19');var _0x1cd4b4=_0x3f8bac[_0xcf50('0x1a')];var _0xf3b84a=_0x2c7851?0x0:_0x384718[_0xcf50('0x17')];var _0x5bd7c7=_0x2c7851?_0x3f8bac[_0xcf50('0x1a')]:_0x384718[_0xcf50('0x17')]+_0x384718[_0xcf50('0x18')];var _0x18549f;if(_0x5bd7c7>=_0x1cd4b4){_0x5bd7c7=_0x1cd4b4;_0x18549f=0xc8;}else{_0x18549f=0xce;}_0x11d948[_0xcf50('0x14')](_0x18549f);return _0x11d948[_0xcf50('0x1b')]('Content-Range',_0xf3b84a+'-'+_0x5bd7c7+'/'+_0x1cd4b4)[_0xcf50('0x16')](_0x3f8bac);}return null;};}function patchUpdates(_0x5c9964){return function(_0x1b5349){try{jsonpatch[_0xcf50('0x1c')](_0x1b5349,_0x5c9964,!![]);}catch(_0x5b40d4){return BPromise[_0xcf50('0x1d')](_0x5b40d4);}return _0x1b5349['save']();};}function saveUpdates(_0x1f251b,_0x173b3c){return function(_0x1fef6c){if(_0x1fef6c){return _0x1fef6c[_0xcf50('0x1e')](_0x1f251b)[_0xcf50('0x1f')](function(_0x49b310){return _0x49b310;});}return null;};}function removeEntity(_0x5f3201,_0x44f61e){return function(_0x1b2b1f){if(_0x1b2b1f){return _0x1b2b1f[_0xcf50('0x20')]()[_0xcf50('0x1f')](function(){_0x5f3201[_0xcf50('0x14')](0xcc)[_0xcf50('0x15')]();});}};}function handleEntityNotFound(_0x18c5b5,_0xd9c370){return function(_0xbd0187){if(!_0xbd0187){_0x18c5b5[_0xcf50('0x21')](0x194);}return _0xbd0187;};}function handleError(_0x5545f8,_0x197749){_0x197749=_0x197749||0x1f4;return function(_0x2fe74d){logger[_0xcf50('0x22')](_0x2fe74d['stack']);if(_0x2fe74d[_0xcf50('0x23')]){delete _0x2fe74d[_0xcf50('0x23')];}_0x5545f8[_0xcf50('0x14')](_0x197749)[_0xcf50('0x24')](_0x2fe74d);};}exports[_0xcf50('0x25')]=function(_0x48e21b,_0x18d732){var _0x20f856={},_0x36bab4={},_0x534710={'count':0x0,'rows':[]};var _0x44767e=_[_0xcf50('0x26')](db[_0xcf50('0x27')][_0xcf50('0x28')],function(_0x3c6d7a){return{'name':_0x3c6d7a[_0xcf50('0x29')],'type':_0x3c6d7a[_0xcf50('0x2a')][_0xcf50('0x2b')]};});_0x36bab4[_0xcf50('0x2c')]=_[_0xcf50('0x2d')](_['map'](_0x44767e,_0xcf50('0x23')),[_0xcf50('0x23')]);_0x36bab4[_0xcf50('0x2e')]=_['keys'](_0x48e21b[_0xcf50('0x2e')]);_0x36bab4[_0xcf50('0x2f')]=_[_0xcf50('0x30')](_0x36bab4['model'],_0x36bab4[_0xcf50('0x2e')]);_0x20f856[_0xcf50('0x31')]=_[_0xcf50('0x30')](_0x36bab4['model'],qs[_0xcf50('0x32')](_0x48e21b[_0xcf50('0x2e')][_0xcf50('0x32')]));_0x20f856[_0xcf50('0x31')]=_0x20f856[_0xcf50('0x31')][_0xcf50('0x33')]?_0x20f856[_0xcf50('0x31')]:_0x36bab4[_0xcf50('0x2c')];if(!_0x48e21b['query'][_0xcf50('0x34')](_0xcf50('0x35'))){_0x20f856[_0xcf50('0x18')]=qs[_0xcf50('0x18')](_0x48e21b['query'][_0xcf50('0x18')]);_0x20f856[_0xcf50('0x17')]=qs[_0xcf50('0x17')](_0x48e21b['query'][_0xcf50('0x17')]);}_0x20f856[_0xcf50('0x36')]=qs[_0xcf50('0x37')](_0x48e21b['query'][_0xcf50('0x37')]);_0x20f856['where']=qs[_0xcf50('0x2f')](_[_0xcf50('0x38')](_0x48e21b[_0xcf50('0x2e')],_0x36bab4[_0xcf50('0x2f')]),_0x44767e);if(_0x48e21b[_0xcf50('0x2e')][_0xcf50('0x39')]){_0x20f856[_0xcf50('0x3a')]=_[_0xcf50('0x3b')](_0x20f856[_0xcf50('0x3a')],{'$or':_[_0xcf50('0x26')](_0x44767e,function(_0x34187b){if(_0x34187b[_0xcf50('0x2a')]!==_0xcf50('0x3c')){var _0x277a46={};_0x277a46[_0x34187b[_0xcf50('0x23')]]={'$like':'%'+_0x48e21b[_0xcf50('0x2e')]['filter']+'%'};return _0x277a46;}})});}_0x20f856=_[_0xcf50('0x3b')]({},_0x20f856,_0x48e21b[_0xcf50('0x3d')]);var _0x155bc4={'where':_0x20f856[_0xcf50('0x3a')]};return db[_0xcf50('0x27')][_0xcf50('0x1a')](_0x155bc4)['then'](function(_0x3eac18){_0x534710[_0xcf50('0x1a')]=_0x3eac18;if(_0x48e21b[_0xcf50('0x2e')][_0xcf50('0x3e')]){_0x20f856[_0xcf50('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0xcf50('0x40')](_0x20f856);})[_0xcf50('0x1f')](function(_0x38266c){_0x534710[_0xcf50('0x41')]=_0x38266c;return _0x534710;})[_0xcf50('0x1f')](respondWithFilteredResult(_0x18d732,_0x20f856))[_0xcf50('0x42')](handleError(_0x18d732,null));};exports[_0xcf50('0x43')]=function(_0x5de923,_0x3ec133){var _0x17edf5={'raw':!![],'where':{'id':_0x5de923[_0xcf50('0x44')]['id']}},_0x5d8c7a={};_0x5d8c7a['model']=_[_0xcf50('0x45')](db[_0xcf50('0x27')][_0xcf50('0x28')]);_0x5d8c7a[_0xcf50('0x2e')]=_[_0xcf50('0x45')](_0x5de923[_0xcf50('0x2e')]);_0x5d8c7a[_0xcf50('0x2f')]=_[_0xcf50('0x30')](_0x5d8c7a[_0xcf50('0x2c')],_0x5d8c7a[_0xcf50('0x2e')]);_0x17edf5['attributes']=_['intersection'](_0x5d8c7a[_0xcf50('0x2c')],qs[_0xcf50('0x32')](_0x5de923[_0xcf50('0x2e')]['fields']));_0x17edf5[_0xcf50('0x31')]=_0x17edf5[_0xcf50('0x31')][_0xcf50('0x33')]?_0x17edf5[_0xcf50('0x31')]:_0x5d8c7a['model'];if(_0x5de923[_0xcf50('0x2e')][_0xcf50('0x3e')]){_0x17edf5[_0xcf50('0x3f')]=[{'all':!![]}];}_0x17edf5=_[_0xcf50('0x3b')]({},_0x17edf5,_0x5de923['options']);return db['CmCustomField'][_0xcf50('0x46')](_0x17edf5)[_0xcf50('0x1f')](handleEntityNotFound(_0x3ec133,null))[_0xcf50('0x1f')](respondWithResult(_0x3ec133,null))[_0xcf50('0x42')](handleError(_0x3ec133,null));};exports[_0xcf50('0x1e')]=function(_0x4ac9ed,_0x5446fc){if(_0x4ac9ed[_0xcf50('0x47')]['id']){delete _0x4ac9ed['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x4ac9ed[_0xcf50('0x44')]['id']}})[_0xcf50('0x1f')](handleEntityNotFound(_0x5446fc,null))['then'](saveUpdates(_0x4ac9ed[_0xcf50('0x47')],null))[_0xcf50('0x1f')](respondWithResult(_0x5446fc,null))[_0xcf50('0x42')](handleError(_0x5446fc,null));};exports['destroy']=function(_0x15550d,_0x487c90){return db[_0xcf50('0x27')]['find']({'where':{'id':_0x15550d[_0xcf50('0x44')]['id']}})[_0xcf50('0x1f')](handleEntityNotFound(_0x487c90,null))[_0xcf50('0x1f')](removeEntity(_0x487c90,null))[_0xcf50('0x42')](handleError(_0x487c90,null));};exports[_0xcf50('0x48')]=function(_0x4dadc3,_0x14df56){var _0x49a69f;return db['sequelize'][_0xcf50('0x49')](function(_0x4cefbd){return db[_0xcf50('0x27')][_0xcf50('0x48')](_0x4dadc3[_0xcf50('0x47')],{'transaction':_0x4cefbd})[_0xcf50('0x1f')](function(_0x5eafc1){_0x49a69f=_0x5eafc1;var _0x4313be={'type':db[_0xcf50('0x4a')][_0xcf50('0x4b')],'transaction':_0x4cefbd};switch(_0x4dadc3[_0xcf50('0x47')][_0xcf50('0x2a')]){case _0xcf50('0x4c'):_0x4313be[_0xcf50('0x2a')]=db['Sequelize'][_0xcf50('0x4b')];break;case _0xcf50('0x4d'):_0x4313be[_0xcf50('0x2a')]=db[_0xcf50('0x4a')][_0xcf50('0x4e')];break;case'switch':_0x4313be[_0xcf50('0x2a')]=db[_0xcf50('0x4a')][_0xcf50('0x4f')];_0x4313be[_0xcf50('0x50')]=![];break;default:}return db[_0xcf50('0x51')]['queryInterface']['addColumn']('cm_contacts',util[_0xcf50('0x52')](_0xcf50('0x53'),_0x49a69f['id']),_0x4313be);})[_0xcf50('0x1f')](function(){return _0x49a69f;});})[_0xcf50('0x1f')](respondWithResult(_0x14df56,0xc9))[_0xcf50('0x42')](handleError(_0x14df56,null));};
\ No newline at end of file
+var _0xe3c2=['body','find','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','send','CmCustomField','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xe3c2,0x19a));var _0x2e3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe3c2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2e3c('0x0'));var rimraf=require(_0x2e3c('0x1'));var zipdir=require(_0x2e3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e3c('0x3'));var moment=require(_0x2e3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2e3c('0x5'));var util=require(_0x2e3c('0x6'));var path=require('path');var sox=require(_0x2e3c('0x7'));var csv=require(_0x2e3c('0x8'));var ejs=require(_0x2e3c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e3c('0xa'));var squel=require(_0x2e3c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2e3c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2e3c('0xc'));var authService=require(_0x2e3c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2e3c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2e3c('0xf'));var config=require(_0x2e3c('0x10'));var licenseUtil=require(_0x2e3c('0x11'));var db=require(_0x2e3c('0x12'))['db'];function respondWithStatusCode(_0x5e75dd,_0x5f37b7){_0x5f37b7=_0x5f37b7||0xcc;return function(_0x131a82){if(_0x131a82){return _0x5e75dd[_0x2e3c('0x13')](_0x5f37b7);}return _0x5e75dd[_0x2e3c('0x14')](_0x5f37b7)[_0x2e3c('0x15')]();};}function respondWithResult(_0x2f967f,_0x4fddfd){_0x4fddfd=_0x4fddfd||0xc8;return function(_0x28d473){if(_0x28d473){return _0x2f967f[_0x2e3c('0x14')](_0x4fddfd)[_0x2e3c('0x16')](_0x28d473);}};}function respondWithFilteredResult(_0x267a89,_0x146b04){return function(_0x3751a8){if(_0x3751a8){var _0x351103=typeof _0x146b04[_0x2e3c('0x17')]==='undefined'&&typeof _0x146b04[_0x2e3c('0x18')]===_0x2e3c('0x19');var _0x1b5749=_0x3751a8[_0x2e3c('0x1a')];var _0x2543c7=_0x351103?0x0:_0x146b04[_0x2e3c('0x17')];var _0x267fe9=_0x351103?_0x3751a8[_0x2e3c('0x1a')]:_0x146b04[_0x2e3c('0x17')]+_0x146b04['limit'];var _0x17b5b7;if(_0x267fe9>=_0x1b5749){_0x267fe9=_0x1b5749;_0x17b5b7=0xc8;}else{_0x17b5b7=0xce;}_0x267a89[_0x2e3c('0x14')](_0x17b5b7);return _0x267a89[_0x2e3c('0x1b')](_0x2e3c('0x1c'),_0x2543c7+'-'+_0x267fe9+'/'+_0x1b5749)['json'](_0x3751a8);}return null;};}function patchUpdates(_0x56e7ac){return function(_0x3822dd){try{jsonpatch[_0x2e3c('0x1d')](_0x3822dd,_0x56e7ac,!![]);}catch(_0x21bfcf){return BPromise[_0x2e3c('0x1e')](_0x21bfcf);}return _0x3822dd['save']();};}function saveUpdates(_0x3718a5,_0x4e8177){return function(_0x35eefc){if(_0x35eefc){return _0x35eefc[_0x2e3c('0x1f')](_0x3718a5)['then'](function(_0x12c045){return _0x12c045;});}return null;};}function removeEntity(_0x1ec076,_0x2813ae){return function(_0x31c0fc){if(_0x31c0fc){return _0x31c0fc[_0x2e3c('0x20')]()[_0x2e3c('0x21')](function(){_0x1ec076[_0x2e3c('0x14')](0xcc)[_0x2e3c('0x15')]();});}};}function handleEntityNotFound(_0x1846ae,_0x491cca){return function(_0x337bb8){if(!_0x337bb8){_0x1846ae[_0x2e3c('0x13')](0x194);}return _0x337bb8;};}function handleError(_0x402cce,_0x2cfbbb){_0x2cfbbb=_0x2cfbbb||0x1f4;return function(_0x23f1db){logger[_0x2e3c('0x22')](_0x23f1db[_0x2e3c('0x23')]);if(_0x23f1db['name']){delete _0x23f1db['name'];}_0x402cce[_0x2e3c('0x14')](_0x2cfbbb)[_0x2e3c('0x24')](_0x23f1db);};}exports['index']=function(_0x6f32ed,_0x1f1413){var _0x430d51={},_0x32b830={},_0x11fe1a={'count':0x0,'rows':[]};var _0x404f13=_['map'](db[_0x2e3c('0x25')][_0x2e3c('0x26')],function(_0xa7e16f){return{'name':_0xa7e16f[_0x2e3c('0x27')],'type':_0xa7e16f[_0x2e3c('0x28')]['key']};});_0x32b830['model']=_['differenceBy'](_['map'](_0x404f13,_0x2e3c('0x29')),[_0x2e3c('0x29')]);_0x32b830[_0x2e3c('0x2a')]=_[_0x2e3c('0x2b')](_0x6f32ed[_0x2e3c('0x2a')]);_0x32b830[_0x2e3c('0x2c')]=_[_0x2e3c('0x2d')](_0x32b830[_0x2e3c('0x2e')],_0x32b830[_0x2e3c('0x2a')]);_0x430d51[_0x2e3c('0x2f')]=_[_0x2e3c('0x2d')](_0x32b830[_0x2e3c('0x2e')],qs['fields'](_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x30')]));_0x430d51[_0x2e3c('0x2f')]=_0x430d51[_0x2e3c('0x2f')]['length']?_0x430d51[_0x2e3c('0x2f')]:_0x32b830[_0x2e3c('0x2e')];if(!_0x6f32ed['query']['hasOwnProperty'](_0x2e3c('0x31'))){_0x430d51[_0x2e3c('0x18')]=qs[_0x2e3c('0x18')](_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x18')]);_0x430d51[_0x2e3c('0x17')]=qs['offset'](_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x17')]);}_0x430d51[_0x2e3c('0x32')]=qs[_0x2e3c('0x33')](_0x6f32ed[_0x2e3c('0x2a')]['sort']);_0x430d51['where']=qs['filters'](_[_0x2e3c('0x34')](_0x6f32ed[_0x2e3c('0x2a')],_0x32b830[_0x2e3c('0x2c')]),_0x404f13);if(_0x6f32ed[_0x2e3c('0x2a')]['filter']){_0x430d51[_0x2e3c('0x35')]=_[_0x2e3c('0x36')](_0x430d51['where'],{'$or':_['map'](_0x404f13,function(_0x4d4bf8){if(_0x4d4bf8[_0x2e3c('0x28')]!==_0x2e3c('0x37')){var _0x3cb3f8={};_0x3cb3f8[_0x4d4bf8[_0x2e3c('0x29')]]={'$like':'%'+_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x38')]+'%'};return _0x3cb3f8;}})});}_0x430d51=_[_0x2e3c('0x36')]({},_0x430d51,_0x6f32ed[_0x2e3c('0x39')]);var _0x1e0355={'where':_0x430d51[_0x2e3c('0x35')]};return db[_0x2e3c('0x25')][_0x2e3c('0x1a')](_0x1e0355)['then'](function(_0x2e064c){_0x11fe1a['count']=_0x2e064c;if(_0x6f32ed[_0x2e3c('0x2a')][_0x2e3c('0x3a')]){_0x430d51[_0x2e3c('0x3b')]=[{'all':!![]}];}return db[_0x2e3c('0x25')]['findAll'](_0x430d51);})[_0x2e3c('0x21')](function(_0x573ffb){_0x11fe1a[_0x2e3c('0x3c')]=_0x573ffb;return _0x11fe1a;})['then'](respondWithFilteredResult(_0x1f1413,_0x430d51))[_0x2e3c('0x3d')](handleError(_0x1f1413,null));};exports[_0x2e3c('0x3e')]=function(_0x814471,_0x254dca){var _0x35791a={'raw':!![],'where':{'id':_0x814471[_0x2e3c('0x3f')]['id']}},_0x4b255a={};_0x4b255a[_0x2e3c('0x2e')]=_['keys'](db[_0x2e3c('0x25')][_0x2e3c('0x26')]);_0x4b255a[_0x2e3c('0x2a')]=_[_0x2e3c('0x2b')](_0x814471[_0x2e3c('0x2a')]);_0x4b255a[_0x2e3c('0x2c')]=_[_0x2e3c('0x2d')](_0x4b255a[_0x2e3c('0x2e')],_0x4b255a[_0x2e3c('0x2a')]);_0x35791a['attributes']=_[_0x2e3c('0x2d')](_0x4b255a['model'],qs[_0x2e3c('0x30')](_0x814471['query']['fields']));_0x35791a[_0x2e3c('0x2f')]=_0x35791a[_0x2e3c('0x2f')]['length']?_0x35791a[_0x2e3c('0x2f')]:_0x4b255a[_0x2e3c('0x2e')];if(_0x814471[_0x2e3c('0x2a')][_0x2e3c('0x3a')]){_0x35791a[_0x2e3c('0x3b')]=[{'all':!![]}];}_0x35791a=_[_0x2e3c('0x36')]({},_0x35791a,_0x814471['options']);return db[_0x2e3c('0x25')]['find'](_0x35791a)[_0x2e3c('0x21')](handleEntityNotFound(_0x254dca,null))['then'](respondWithResult(_0x254dca,null))['catch'](handleError(_0x254dca,null));};exports['update']=function(_0x17709f,_0x3c1221){if(_0x17709f[_0x2e3c('0x40')]['id']){delete _0x17709f[_0x2e3c('0x40')]['id'];}return db[_0x2e3c('0x25')]['find']({'where':{'id':_0x17709f[_0x2e3c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c1221,null))[_0x2e3c('0x21')](saveUpdates(_0x17709f[_0x2e3c('0x40')],null))[_0x2e3c('0x21')](respondWithResult(_0x3c1221,null))[_0x2e3c('0x3d')](handleError(_0x3c1221,null));};exports['destroy']=function(_0x3671da,_0x52638e){return db[_0x2e3c('0x25')][_0x2e3c('0x41')]({'where':{'id':_0x3671da[_0x2e3c('0x3f')]['id']}})[_0x2e3c('0x21')](handleEntityNotFound(_0x52638e,null))[_0x2e3c('0x21')](removeEntity(_0x52638e,null))['catch'](handleError(_0x52638e,null));};exports[_0x2e3c('0x42')]=function(_0x5a151f,_0x1d0438){var _0x5f43cc;return db[_0x2e3c('0x43')][_0x2e3c('0x44')](function(_0x17cc0a){return db[_0x2e3c('0x25')]['create'](_0x5a151f['body'],{'transaction':_0x17cc0a})[_0x2e3c('0x21')](function(_0x2b0c87){_0x5f43cc=_0x2b0c87;var _0x26eaf9={'type':db[_0x2e3c('0x45')][_0x2e3c('0x46')],'transaction':_0x17cc0a};switch(_0x5a151f[_0x2e3c('0x40')][_0x2e3c('0x28')]){case _0x2e3c('0x47'):_0x26eaf9[_0x2e3c('0x28')]=db[_0x2e3c('0x45')][_0x2e3c('0x46')];break;case _0x2e3c('0x48'):_0x26eaf9[_0x2e3c('0x28')]=db[_0x2e3c('0x45')][_0x2e3c('0x49')];break;case'switch':_0x26eaf9['type']=db['Sequelize']['BOOLEAN'];_0x26eaf9[_0x2e3c('0x4a')]=![];break;default:}return db['sequelize'][_0x2e3c('0x4b')][_0x2e3c('0x4c')](_0x2e3c('0x4d'),util['format'](_0x2e3c('0x4e'),_0x5f43cc['id']),_0x26eaf9);})['then'](function(){return _0x5f43cc;});})[_0x2e3c('0x21')](respondWithResult(_0x1d0438,0xc9))['catch'](handleError(_0x1d0438,null));};
\ No newline at end of file
index 8d698a3..74fa8eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd82=['path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','api','moment','bluebird','request-promise'];(function(_0x2de394,_0x358585){var _0x3e3ed4=function(_0x225c59){while(--_0x225c59){_0x2de394['push'](_0x2de394['shift']());}};_0x3e3ed4(++_0x358585);}(_0xbd82,0x11b));var _0x2bd8=function(_0x2b552b,_0x273171){_0x2b552b=_0x2b552b-0x0;var _0x27fb18=_0xbd82[_0x2b552b];return _0x27fb18;};'use strict';var _=require(_0x2bd8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2bd8('0x1'));var moment=require(_0x2bd8('0x2'));var BPromise=require(_0x2bd8('0x3'));var rp=require(_0x2bd8('0x4'));var fs=require('fs');var path=require(_0x2bd8('0x5'));var rimraf=require(_0x2bd8('0x6'));var config=require('../../config/environment');var attributes=require(_0x2bd8('0x7'));module[_0x2bd8('0x8')]=function(_0x3abe13,_0x93a6f7){return _0x3abe13[_0x2bd8('0x9')](_0x2bd8('0xa'),attributes,{'tableName':_0x2bd8('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d5a=['define','cm_custom_fields','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0x293ac3,_0x5f01e3){var _0x40398d=function(_0x47b7ba){while(--_0x47b7ba){_0x293ac3['push'](_0x293ac3['shift']());}};_0x40398d(++_0x5f01e3);}(_0x2d5a,0x1e8));var _0xa2d5=function(_0x4d1945,_0xd9a6a9){_0x4d1945=_0x4d1945-0x0;var _0x2279cf=_0x2d5a[_0x4d1945];return _0x2279cf;};'use strict';var _=require(_0xa2d5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa2d5('0x1'));var BPromise=require(_0xa2d5('0x2'));var rp=require(_0xa2d5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa2d5('0x4'));var config=require(_0xa2d5('0x5'));var attributes=require(_0xa2d5('0x6'));module['exports']=function(_0x56058c,_0x4ec14e){return _0x56058c[_0xa2d5('0x7')]('CmCustomField',attributes,{'tableName':_0xa2d5('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4f8995..9554634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2611=['moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x3dec0d,_0x132158){var _0x5d36b2=function(_0x30c735){while(--_0x30c735){_0x3dec0d['push'](_0x3dec0d['shift']());}};_0x5d36b2(++_0x132158);}(_0x2611,0xd7));var _0x1261=function(_0x46364a,_0x49ea76){_0x46364a=_0x46364a-0x0;var _0x495337=_0x2611[_0x46364a];return _0x495337;};'use strict';var _=require('lodash');var util=require(_0x1261('0x0'));var moment=require(_0x1261('0x1'));var BPromise=require('bluebird');var rs=require(_0x1261('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1261('0x3'));var logger=require(_0x1261('0x4'))(_0x1261('0x5'));var config=require('../../config/environment');var jayson=require(_0x1261('0x6'));var client=jayson[_0x1261('0x7')][_0x1261('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25ecd4,_0x394efe,_0x13bfb8){return new BPromise(function(_0x2aa117,_0x20d6f){return client['request'](_0x25ecd4,_0x13bfb8)['then'](function(_0x15ad66){logger[_0x1261('0x9')](_0x1261('0xa'),_0x394efe,_0x1261('0xb'));logger['debug'](_0x1261('0xc'),_0x394efe,'request\x20sent',JSON[_0x1261('0xd')](_0x15ad66));if(_0x15ad66['error']){if(_0x15ad66[_0x1261('0xe')][_0x1261('0xf')]===0x1f4){logger[_0x1261('0xe')](_0x1261('0xa'),_0x394efe,_0x15ad66[_0x1261('0xe')]['message']);return _0x20d6f(_0x15ad66[_0x1261('0xe')][_0x1261('0x10')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x394efe,_0x15ad66[_0x1261('0xe')]['message']);return _0x2aa117(_0x15ad66[_0x1261('0xe')]['message']);}else{logger['info'](_0x1261('0xa'),_0x394efe,_0x1261('0xb'));_0x2aa117(_0x15ad66['result'][_0x1261('0x10')]);}})[_0x1261('0x11')](function(_0x42da0e){logger[_0x1261('0xe')]('CmCustomField,\x20%s,\x20%s',_0x394efe,_0x42da0e);_0x20d6f(_0x42da0e);});});}
\ No newline at end of file
+var _0xed5a=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2b996b,_0x2b3e59){var _0x285751=function(_0x235ef2){while(--_0x235ef2){_0x2b996b['push'](_0x2b996b['shift']());}};_0x285751(++_0x2b3e59);}(_0xed5a,0x180));var _0xaed5=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0xed5a[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0xaed5('0x0'));var util=require(_0xaed5('0x1'));var moment=require(_0xaed5('0x2'));var BPromise=require('bluebird');var rs=require(_0xaed5('0x3'));var fs=require('fs');var Redis=require(_0xaed5('0x4'));var db=require(_0xaed5('0x5'))['db'];var utils=require(_0xaed5('0x6'));var logger=require('../../config/logger')(_0xaed5('0x7'));var config=require(_0xaed5('0x8'));var jayson=require(_0xaed5('0x9'));var client=jayson['client'][_0xaed5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x635040,_0x47d506,_0x2f44da){return new BPromise(function(_0x321c17,_0x151afa){return client[_0xaed5('0xb')](_0x635040,_0x2f44da)[_0xaed5('0xc')](function(_0x5eb61e){logger[_0xaed5('0xd')](_0xaed5('0xe'),_0x47d506,_0xaed5('0xf'));logger[_0xaed5('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x47d506,'request\x20sent',JSON[_0xaed5('0x11')](_0x5eb61e));if(_0x5eb61e[_0xaed5('0x12')]){if(_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x13')]===0x1f4){logger[_0xaed5('0x12')](_0xaed5('0xe'),_0x47d506,_0x5eb61e['error'][_0xaed5('0x14')]);return _0x151afa(_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x14')]);}logger[_0xaed5('0x12')]('CmCustomField,\x20%s,\x20%s',_0x47d506,_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x14')]);return _0x321c17(_0x5eb61e[_0xaed5('0x12')][_0xaed5('0x14')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x47d506,_0xaed5('0xf'));_0x321c17(_0x5eb61e[_0xaed5('0x15')]['message']);}})['catch'](function(_0x21101e){logger[_0xaed5('0x12')]('CmCustomField,\x20%s,\x20%s',_0x47d506,_0x21101e);_0x151afa(_0x21101e);});});}
\ No newline at end of file
index 6ba2380..26f8d87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa701=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put','delete'];(function(_0x444103,_0x10b7f2){var _0x26eaa5=function(_0x5b6e0f){while(--_0x5b6e0f){_0x444103['push'](_0x444103['shift']());}};_0x26eaa5(++_0x10b7f2);}(_0xa701,0x1cd));var _0x1a70=function(_0x36511f,_0x3d378e){_0x36511f=_0x36511f-0x0;var _0x39e579=_0xa701[_0x36511f];return _0x39e579;};'use strict';var multer=require(_0x1a70('0x0'));var util=require(_0x1a70('0x1'));var path=require('path');var timeout=require(_0x1a70('0x2'));var express=require('express');var router=express[_0x1a70('0x3')]();var fs_extra=require(_0x1a70('0x4'));var auth=require(_0x1a70('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a70('0x6'));router[_0x1a70('0x7')]('/',auth[_0x1a70('0x8')](),controller[_0x1a70('0x9')]);router[_0x1a70('0x7')](_0x1a70('0xa'),auth[_0x1a70('0x8')](),controller[_0x1a70('0xb')]);router[_0x1a70('0xc')]('/',auth[_0x1a70('0x8')](),controller['create']);router[_0x1a70('0xd')](_0x1a70('0xa'),auth[_0x1a70('0x8')](),controller['update']);router[_0x1a70('0xe')](_0x1a70('0xa'),auth[_0x1a70('0x8')](),controller[_0x1a70('0xf')]);module[_0x1a70('0x10')]=router;
\ No newline at end of file
+var _0x0734=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x5e8993,_0x27c0f3){var _0x498ba8=function(_0x4319d0){while(--_0x4319d0){_0x5e8993['push'](_0x5e8993['shift']());}};_0x498ba8(++_0x27c0f3);}(_0x0734,0xba));var _0x4073=function(_0x4b7056,_0x2a2759){_0x4b7056=_0x4b7056-0x0;var _0x3194c0=_0x0734[_0x4b7056];return _0x3194c0;};'use strict';var multer=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var path=require(_0x4073('0x2'));var timeout=require(_0x4073('0x3'));var express=require(_0x4073('0x4'));var router=express['Router']();var fs_extra=require(_0x4073('0x5'));var auth=require(_0x4073('0x6'));var interaction=require(_0x4073('0x7'));var config=require(_0x4073('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x4073('0x9')](),controller['index']);router[_0x4073('0xa')](_0x4073('0xb'),auth[_0x4073('0x9')](),controller[_0x4073('0xc')]);router['post']('/',auth[_0x4073('0x9')](),controller['create']);router[_0x4073('0xd')](_0x4073('0xb'),auth[_0x4073('0x9')](),controller[_0x4073('0xe')]);router['delete']('/:id',auth[_0x4073('0x9')](),controller[_0x4073('0xf')]);module['exports']=router;
\ No newline at end of file
index 787dc7c..80f93db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0988=['sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x31a112,_0x5bae81){var _0x186f9f=function(_0x2e0002){while(--_0x2e0002){_0x31a112['push'](_0x31a112['shift']());}};_0x186f9f(++_0x5bae81);}(_0x0988,0x1c2));var _0x8098=function(_0x2c1524,_0x311a60){_0x2c1524=_0x2c1524-0x0;var _0x4ddd51=_0x0988[_0x2c1524];return _0x4ddd51;};'use strict';var moment=require(_0x8098('0x0'));var Sequelize=require(_0x8098('0x1'));module[_0x8098('0x2')]={'phone':{'type':Sequelize[_0x8098('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x8098('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8098('0x5')],'defaultValue':moment()[_0x8098('0x6')](_0x8098('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8098('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8098('0x5')]},'priority':{'type':Sequelize[_0x8098('0x8')](0x2)[_0x8098('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x8098('0x8')],'unique':_0x8098('0xa')},'ListId':{'type':Sequelize[_0x8098('0x8')],'unique':_0x8098('0xa')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x8098('0x8')],'unique':_0x8098('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8098('0x8')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf88e=['moment','sequelize','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','contactListQueue'];(function(_0x405135,_0x575076){var _0x14a395=function(_0x67bfc8){while(--_0x67bfc8){_0x405135['push'](_0x405135['shift']());}};_0x14a395(++_0x575076);}(_0xf88e,0xe1));var _0xef88=function(_0x55e836,_0x50b958){_0x55e836=_0x55e836-0x0;var _0x5d1a4b=_0xf88e[_0x55e836];return _0x5d1a4b;};'use strict';var moment=require(_0xef88('0x0'));var Sequelize=require(_0xef88('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xef88('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xef88('0x3')],'defaultValue':moment()[_0xef88('0x4')](_0xef88('0x5'))},'countbusyretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xef88('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xef88('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xef88('0x3')]},'priority':{'type':Sequelize[_0xef88('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xef88('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xef88('0x6')],'unique':_0xef88('0x8')},'ListId':{'type':Sequelize[_0xef88('0x6')],'unique':_0xef88('0x8')},'UserId':{'type':Sequelize[_0xef88('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xef88('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xef88('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xef88('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index e765df5..e6d1cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30e3=['hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Contact','Company','List','Queue','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','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','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lte','$eq','$between','$notBetween','$in','$like','$iLike','$notILike','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','find','create','body','params','describe','VoiceQueueId','VoiceQueue','Campaign','omit','createdAt','updatedAt','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','sequelize','direction','prev'];(function(_0x398398,_0x1aa1b6){var _0x170f8c=function(_0x7137e0){while(--_0x7137e0){_0x398398['push'](_0x398398['shift']());}};_0x170f8c(++_0x1aa1b6);}(_0x30e3,0xa4));var _0x330e=function(_0x275b29,_0x1757c4){_0x275b29=_0x275b29-0x0;var _0x5c44a3=_0x30e3[_0x275b29];return _0x5c44a3;};'use strict';var emlformat=require(_0x330e('0x0'));var rimraf=require(_0x330e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x330e('0x2'));var rp=require(_0x330e('0x3'));var moment=require(_0x330e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x330e('0x5'));var path=require(_0x330e('0x6'));var sox=require(_0x330e('0x7'));var csv=require(_0x330e('0x8'));var ejs=require(_0x330e('0x9'));var fs=require('fs');var fs_extra=require(_0x330e('0xa'));var _=require(_0x330e('0xb'));var squel=require(_0x330e('0xc'));var crypto=require(_0x330e('0xd'));var jsforce=require(_0x330e('0xe'));var deskjs=require(_0x330e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x330e('0x10'));var Papa=require('papaparse');var Redis=require(_0x330e('0x11'));var authService=require(_0x330e('0x12'));var qs=require(_0x330e('0x13'));var as=require(_0x330e('0x14'));var hardwareService=require(_0x330e('0x15'));var logger=require(_0x330e('0x16'))(_0x330e('0x17'));var utils=require(_0x330e('0x18'));var config=require(_0x330e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x330e('0x1a'))['db'];function respondWithStatusCode(_0x46162d,_0xbfa360){_0xbfa360=_0xbfa360||0xcc;return function(_0x216236){if(_0x216236){return _0x46162d[_0x330e('0x1b')](_0xbfa360);}return _0x46162d[_0x330e('0x1c')](_0xbfa360)[_0x330e('0x1d')]();};}function respondWithResult(_0x41a038,_0x19796c){_0x19796c=_0x19796c||0xc8;return function(_0x5cee1e){if(_0x5cee1e){return _0x41a038[_0x330e('0x1c')](_0x19796c)[_0x330e('0x1e')](_0x5cee1e);}};}function respondWithFilteredResult(_0x2f6f48,_0x50e225){return function(_0x34a23d){if(_0x34a23d){var _0x5d6b5d=typeof _0x50e225['offset']===_0x330e('0x1f')&&typeof _0x50e225[_0x330e('0x20')]===_0x330e('0x1f');var _0x4ae801=_0x34a23d['count'];var _0x512dfb=_0x5d6b5d?0x0:_0x50e225[_0x330e('0x21')];var _0x5beebe=_0x5d6b5d?_0x34a23d[_0x330e('0x22')]:_0x50e225['offset']+_0x50e225['limit'];var _0x50246a;if(_0x5beebe>=_0x4ae801){_0x5beebe=_0x4ae801;_0x50246a=0xc8;}else{_0x50246a=0xce;}_0x2f6f48[_0x330e('0x1c')](_0x50246a);return _0x2f6f48[_0x330e('0x23')](_0x330e('0x24'),_0x512dfb+'-'+_0x5beebe+'/'+_0x4ae801)[_0x330e('0x1e')](_0x34a23d);}return null;};}function patchUpdates(_0x460acd){return function(_0xec8ac5){try{jsonpatch['apply'](_0xec8ac5,_0x460acd,!![]);}catch(_0x1d58f2){return BPromise[_0x330e('0x25')](_0x1d58f2);}return _0xec8ac5[_0x330e('0x26')]();};}function saveUpdates(_0x10c9dd,_0x5334ff){return function(_0x2d813f){if(_0x2d813f){return _0x2d813f[_0x330e('0x27')](_0x10c9dd)[_0x330e('0x28')](function(_0x179e26){return _0x179e26;});}return null;};}function removeEntity(_0x28e0d9,_0x9cf369){return function(_0x512843){if(_0x512843){return _0x512843[_0x330e('0x29')]()['then'](function(){_0x28e0d9[_0x330e('0x1c')](0xcc)[_0x330e('0x1d')]();});}};}function handleEntityNotFound(_0x3b5c4c,_0x30703d){return function(_0x244cee){if(!_0x244cee){_0x3b5c4c['sendStatus'](0x194);}return _0x244cee;};}function handleError(_0x3805a5,_0x242485){_0x242485=_0x242485||0x1f4;return function(_0x98b57e){logger[_0x330e('0x2a')](_0x98b57e[_0x330e('0x2b')]);if(_0x98b57e[_0x330e('0x2c')]){delete _0x98b57e['name'];}_0x3805a5[_0x330e('0x1c')](_0x242485)['send'](_0x98b57e);};}exports['index']=function(_0x4bd904,_0x48fde0){var _0x21775f={},_0xf631c={},_0x1aa845={'count':0x0,'rows':[]};var _0x5e80d6=_[_0x330e('0x2d')](db[_0x330e('0x2e')][_0x330e('0x2f')],function(_0x396b1d){return{'name':_0x396b1d[_0x330e('0x30')],'type':_0x396b1d[_0x330e('0x31')][_0x330e('0x32')]};});_0xf631c[_0x330e('0x33')]=_[_0x330e('0x2d')](_0x5e80d6,_0x330e('0x2c'));_0xf631c[_0x330e('0x34')]=_[_0x330e('0x35')](_0x4bd904[_0x330e('0x34')]);_0xf631c[_0x330e('0x36')]=_[_0x330e('0x37')](_0xf631c[_0x330e('0x33')],_0xf631c[_0x330e('0x34')]);_0xf631c[_0x330e('0x36')]=_[_0x330e('0x38')](_0xf631c[_0x330e('0x36')],[_0x330e('0x39'),'$or',_0x330e('0x3a'),_0x330e('0x3b'),'$lt',_0x330e('0x3c'),'$ne',_0x330e('0x3d'),'$not',_0x330e('0x3e'),_0x330e('0x3f'),_0x330e('0x40'),'$notIn',_0x330e('0x41'),'$notLike',_0x330e('0x42'),_0x330e('0x43'),_0x330e('0x41'),'$overlap',_0x330e('0x44'),_0x330e('0x45'),_0x330e('0x46')]);_0x21775f[_0x330e('0x47')]=_[_0x330e('0x37')](_0xf631c[_0x330e('0x33')],qs[_0x330e('0x48')](_0x4bd904[_0x330e('0x34')]['fields']));_0x21775f[_0x330e('0x47')]=_0x21775f[_0x330e('0x47')][_0x330e('0x49')]?_0x21775f[_0x330e('0x47')]:_0xf631c[_0x330e('0x33')];if(!_0x4bd904[_0x330e('0x34')][_0x330e('0x4a')](_0x330e('0x4b'))){_0x21775f[_0x330e('0x20')]=qs[_0x330e('0x20')](_0x4bd904[_0x330e('0x34')]['limit']);_0x21775f['offset']=qs[_0x330e('0x21')](_0x4bd904['query'][_0x330e('0x21')]);}_0x21775f[_0x330e('0x4c')]=qs[_0x330e('0x4d')](_0x4bd904[_0x330e('0x34')][_0x330e('0x4d')]);_0x21775f[_0x330e('0x4e')]=qs[_0x330e('0x36')](_[_0x330e('0x4f')](_0x4bd904[_0x330e('0x34')],_0xf631c[_0x330e('0x36')]),_0x5e80d6);if(_0x4bd904[_0x330e('0x34')]['filter']){_0x21775f['where']=_[_0x330e('0x50')](_0x21775f[_0x330e('0x4e')],{'$or':_[_0x330e('0x2d')](_0x5e80d6,function(_0xf1bac9){if(_0xf1bac9['type']!==_0x330e('0x51')){var _0x47e768={};_0x47e768[_0xf1bac9[_0x330e('0x2c')]]={'$like':'%'+_0x4bd904[_0x330e('0x34')][_0x330e('0x52')]+'%'};return _0x47e768;}})});}_0x21775f=_[_0x330e('0x50')]({},_0x21775f,_0x4bd904[_0x330e('0x53')]);var _0x3128ce={'where':_0x21775f['where']};return db[_0x330e('0x2e')][_0x330e('0x22')](_0x3128ce)[_0x330e('0x28')](function(_0xfccd0d){_0x1aa845[_0x330e('0x22')]=_0xfccd0d;if(_0x4bd904['query'][_0x330e('0x54')]){_0x21775f[_0x330e('0x55')]=[{'all':!![]}];}return db[_0x330e('0x2e')]['findAll'](_0x21775f);})[_0x330e('0x28')](function(_0x2447df){_0x1aa845[_0x330e('0x56')]=_0x2447df;return _0x1aa845;})[_0x330e('0x28')](respondWithFilteredResult(_0x48fde0,_0x21775f))[_0x330e('0x57')](handleError(_0x48fde0,null));};exports['show']=function(_0x549003,_0x5240b9){var _0x2809e3={'raw':!![],'where':{'id':_0x549003['params']['id']}},_0x267c4f={};_0x267c4f[_0x330e('0x33')]=_[_0x330e('0x35')](db[_0x330e('0x2e')]['rawAttributes']);_0x267c4f['query']=_[_0x330e('0x35')](_0x549003[_0x330e('0x34')]);_0x267c4f[_0x330e('0x36')]=_[_0x330e('0x37')](_0x267c4f['model'],_0x267c4f['query']);_0x2809e3[_0x330e('0x47')]=_['intersection'](_0x267c4f[_0x330e('0x33')],qs[_0x330e('0x48')](_0x549003[_0x330e('0x34')]['fields']));_0x2809e3['attributes']=_0x2809e3['attributes'][_0x330e('0x49')]?_0x2809e3[_0x330e('0x47')]:_0x267c4f[_0x330e('0x33')];if(_0x549003[_0x330e('0x34')][_0x330e('0x54')]){_0x2809e3[_0x330e('0x55')]=[{'all':!![]}];}_0x2809e3=_[_0x330e('0x50')]({},_0x2809e3,_0x549003['options']);return db[_0x330e('0x2e')][_0x330e('0x58')](_0x2809e3)[_0x330e('0x28')](handleEntityNotFound(_0x5240b9,null))[_0x330e('0x28')](respondWithResult(_0x5240b9,null))['catch'](handleError(_0x5240b9,null));};exports[_0x330e('0x59')]=function(_0x82b74b,_0x3b8225){return db['CmHopper'][_0x330e('0x59')](_0x82b74b[_0x330e('0x5a')],{})['then'](respondWithResult(_0x3b8225,0xc9))[_0x330e('0x57')](handleError(_0x3b8225,null));};exports[_0x330e('0x27')]=function(_0x1945f3,_0x528b61){if(_0x1945f3[_0x330e('0x5a')]['id']){delete _0x1945f3[_0x330e('0x5a')]['id'];}return db[_0x330e('0x2e')][_0x330e('0x58')]({'where':{'id':_0x1945f3[_0x330e('0x5b')]['id']}})[_0x330e('0x28')](handleEntityNotFound(_0x528b61,null))[_0x330e('0x28')](saveUpdates(_0x1945f3[_0x330e('0x5a')],null))[_0x330e('0x28')](respondWithResult(_0x528b61,null))['catch'](handleError(_0x528b61,null));};exports[_0x330e('0x5c')]=function(_0x17b4f6,_0x129a4d){return db[_0x330e('0x2e')][_0x330e('0x5c')]()[_0x330e('0x28')](respondWithResult(_0x129a4d,null))['catch'](handleError(_0x129a4d,null));};exports['destroy']=function(_0x4812f8,_0x8e75d7){var _0xe0465f;return db[_0x330e('0x2e')]['find']({'where':{'id':_0x4812f8['params']['id']}})[_0x330e('0x28')](handleEntityNotFound(_0x8e75d7,null))[_0x330e('0x28')](function(_0x28a83e){if(_0x28a83e){return _0x28a83e['destroy']()[_0x330e('0x28')](function(_0x318c5b){return _0x318c5b;});}})['then'](function(_0x18fe6d){_0xe0465f=_0x18fe6d;if(_0x18fe6d){if(_0x18fe6d[_0x330e('0x5d')]||_0x18fe6d['CampaignId']){return db[_0x18fe6d['VoiceQueueId']?_0x330e('0x5e'):_0x330e('0x5f')][_0x330e('0x58')]({'where':{'id':_0x18fe6d[_0x330e('0x5d')]?_0x18fe6d[_0x330e('0x5d')]:_0x18fe6d['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x330e('0x28')](function(_0x5b944a){var _0x2a07f3={};if(_0x5b944a){_['merge'](_0x2a07f3,_[_0x330e('0x60')](_0xe0465f['dataValues'],[_0x330e('0x61'),_0x330e('0x62'),'id']));_0x2a07f3['state']=0x15;_0x2a07f3['statedesc']=_0x330e('0x63');_0x2a07f3[_0x330e('0x64')]=_0x5b944a[_0x330e('0x2c')];_0x2a07f3[_0x330e('0x65')]=_0x4812f8[_0x330e('0x66')]['name'];_0x2a07f3[_0x330e('0x67')]=_0x4812f8[_0x330e('0x66')]['id'];_0x2a07f3[_0x330e('0x63')]=!![];_0x2a07f3[_0x330e('0x68')]=moment()[_0x330e('0x69')](_0x330e('0x6a'));_0x2a07f3['calleridnum']=_0xe0465f[_0x330e('0x6b')];_0x2a07f3[_0x330e('0x6c')]=_0xe0465f[_0x330e('0x5d')]?_0x330e('0x6d'):'ivr';return db[_0x330e('0x6e')][_0x330e('0x58')]({'where':{'id':_0x2a07f3[_0x330e('0x6f')]},'attributes':[_0x330e('0x70'),_0x330e('0x71')]})[_0x330e('0x28')](function(_0x592967){if(!_[_0x330e('0x72')](_0x8e75d7)&&!_[_0x330e('0x72')](_0x592967[_0x330e('0x70')])){_0x2a07f3[_0x330e('0x73')]=_0x592967[_0x330e('0x70')];if(!_[_0x330e('0x72')](_0x592967[_0x330e('0x71')])){_0x2a07f3['calleridname']+='\x20'+_0x592967[_0x330e('0x71')];}}})[_0x330e('0x74')](function(){return db[_0x330e('0x75')][_0x330e('0x59')](_0x2a07f3);});}})[_0x330e('0x28')](function(){return _0x8e75d7['status'](0xcc)[_0x330e('0x1d')]();})[_0x330e('0x57')](handleError(_0x8e75d7,null));};exports[_0x330e('0x76')]=function(_0x2e4f0f,_0x3e80d2,_0x489d7f){var _0x3fbb11=[];return db[_0x330e('0x6e')][_0x330e('0x5c')]()[_0x330e('0x28')](function(_0x15a326){_0x3fbb11=_[_0x330e('0x35')](_0x15a326);return _0x2e4f0f[_0x330e('0x66')][_0x330e('0x77')]({'where':{'type':_0x330e('0x78'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x330e('0x28')](function(_0x5e5eaa){if(_0x5e5eaa&&_0x5e5eaa[_0x330e('0x49')]){return db[_0x330e('0x79')]['transaction'](function(_0x46cd4b){var _0x65382b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x330e('0x69')](_0x330e('0x6a'))},'VoiceQueueId':{'$in':_[_0x330e('0x2d')](_0x5e5eaa,'id')},'$or':[{'UserId':null},{'UserId':_0x2e4f0f[_0x330e('0x66')]['id']}]};var _0x3ae97d=[];if(_0x2e4f0f[_0x330e('0x5a')][_0x330e('0x7a')]&&_0x2e4f0f[_0x330e('0x5a')][_0x330e('0x7a')]===_0x330e('0x7b')){if(!_['isEmpty'](_0x2e4f0f['body'][_0x330e('0x7c')])){_0x65382b['id']={'$in':_0x2e4f0f[_0x330e('0x5a')][_0x330e('0x7c')]};}_0x3ae97d=[[_0x330e('0x7d'),_0x330e('0x7e')],[_0x330e('0x7f'),_0x5e5eaa[0x0]['dialOrderByScheduledAt']===_0x330e('0x7e')?_0x330e('0x80'):'ASC'],db[_0x330e('0x79')][_0x330e('0x81')](_0x330e('0x82')),['id','DESC']];}else{if(!_[_0x330e('0x83')](_0x2e4f0f[_0x330e('0x5a')][_0x330e('0x7c')])){_0x65382b['id']={'$notIn':_0x2e4f0f[_0x330e('0x5a')]['hopperIds']};}_0x3ae97d=[[_0x330e('0x7d'),_0x330e('0x80')],[_0x330e('0x7f'),_0x5e5eaa[0x0]['dialOrderByScheduledAt']],db[_0x330e('0x79')][_0x330e('0x81')](_0x330e('0x84')),['id',_0x330e('0x7e')]];}return db[_0x330e('0x2e')][_0x330e('0x85')]({'attributes':['id',_0x330e('0x86')],'where':_0x65382b,'order':_0x3ae97d,'transaction':_0x46cd4b,'lock':_0x46cd4b['LOCK'][_0x330e('0x87')],'include':[{'model':db[_0x330e('0x6e')],'as':_0x330e('0x88'),'attributes':_0x3fbb11,'include':[{'model':db['CmCompany'],'as':_0x330e('0x89'),'attributes':['id',_0x330e('0x2c')]}]},{'model':db['CmList'],'as':_0x330e('0x8a'),'attributes':['id',_0x330e('0x2c')]},{'model':db[_0x330e('0x5e')],'as':_0x330e('0x8b'),'attributes':['id',_0x330e('0x2c'),'dialActive']}]})[_0x330e('0x28')](function(_0xed134c){if(_0xed134c){return _0xed134c[_0x330e('0x27')]({'UserId':_0x2e4f0f['user']['id']},{'transaction':_0x46cd4b});}});});}})[_0x330e('0x28')](handleEntityNotFound(_0x3e80d2,null))[_0x330e('0x28')](respondWithResult(_0x3e80d2,null))[_0x330e('0x57')](handleError(_0x3e80d2,null));};exports[_0x330e('0x8c')]=function(_0x1e0fdf,_0x107671,_0x4247fb){return _0x1e0fdf[_0x330e('0x66')][_0x330e('0x77')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x330e('0x8d')},'attributes':['id'],'raw':!![]})[_0x330e('0x28')](function(_0x570dc6){if(_0x570dc6&&_0x570dc6['length']){return db[_0x330e('0x2e')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x330e('0x6a'))},'VoiceQueueId':{'$in':_[_0x330e('0x2d')](_0x570dc6,'id')},'$or':[{'UserId':null},{'UserId':_0x1e0fdf[_0x330e('0x66')]['id']}]}});}return 0x0;})[_0x330e('0x28')](function(_0x57064e){if(!_['isNil'](_0x57064e)&&_[_0x330e('0x8e')](_0x57064e)){return _0x107671['status'](0xc8)['json']({'contacts':_0x57064e});}else{logger[_0x330e('0x2a')](_0x330e('0x8f'),_0x330e('0x8c'),0x194,'entity\x20not\x20found');_0x107671['sendStatus'](0x194);}})[_0x330e('0x57')](handleError(_0x107671,null));};
\ No newline at end of file
+var _0xa36a=['queue','CmContact','ContactId','firstName','calleridname','isNil','lastName','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','getOpenContacts','preview','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','status','end','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','nolimit','order','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','createdAt','state','statedesc','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype'];(function(_0x88ea59,_0x49fe20){var _0x5a2942=function(_0x1660f1){while(--_0x1660f1){_0x88ea59['push'](_0x88ea59['shift']());}};_0x5a2942(++_0x49fe20);}(_0xa36a,0x1dd));var _0xaa36=function(_0x50db97,_0x45f822){_0x50db97=_0x50db97-0x0;var _0x1db193=_0xa36a[_0x50db97];return _0x1db193;};'use strict';var emlformat=require(_0xaa36('0x0'));var rimraf=require(_0xaa36('0x1'));var zipdir=require(_0xaa36('0x2'));var jsonpatch=require(_0xaa36('0x3'));var rp=require('request-promise');var moment=require(_0xaa36('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa36('0x5'));var util=require('util');var path=require('path');var sox=require(_0xaa36('0x6'));var csv=require('to-csv');var ejs=require(_0xaa36('0x7'));var fs=require('fs');var fs_extra=require(_0xaa36('0x8'));var _=require(_0xaa36('0x9'));var squel=require(_0xaa36('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa36('0xb'));var deskjs=require(_0xaa36('0xc'));var toCsv=require('to-csv');var querystring=require(_0xaa36('0xd'));var Papa=require(_0xaa36('0xe'));var Redis=require(_0xaa36('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa36('0x10'));var hardwareService=require(_0xaa36('0x11'));var logger=require(_0xaa36('0x12'))(_0xaa36('0x13'));var utils=require(_0xaa36('0x14'));var config=require(_0xaa36('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa36('0x16'))['db'];function respondWithStatusCode(_0x923242,_0xc6ec83){_0xc6ec83=_0xc6ec83||0xcc;return function(_0x17f2e6){if(_0x17f2e6){return _0x923242[_0xaa36('0x17')](_0xc6ec83);}return _0x923242['status'](_0xc6ec83)['end']();};}function respondWithResult(_0x318006,_0x1c276b){_0x1c276b=_0x1c276b||0xc8;return function(_0x24ed9b){if(_0x24ed9b){return _0x318006['status'](_0x1c276b)[_0xaa36('0x18')](_0x24ed9b);}};}function respondWithFilteredResult(_0x35c3d8,_0x2bcb63){return function(_0x53aef2){if(_0x53aef2){var _0x276f10=typeof _0x2bcb63[_0xaa36('0x19')]===_0xaa36('0x1a')&&typeof _0x2bcb63[_0xaa36('0x1b')]===_0xaa36('0x1a');var _0x119f82=_0x53aef2[_0xaa36('0x1c')];var _0x58b03c=_0x276f10?0x0:_0x2bcb63[_0xaa36('0x19')];var _0x56d407=_0x276f10?_0x53aef2[_0xaa36('0x1c')]:_0x2bcb63['offset']+_0x2bcb63['limit'];var _0xf2af61;if(_0x56d407>=_0x119f82){_0x56d407=_0x119f82;_0xf2af61=0xc8;}else{_0xf2af61=0xce;}_0x35c3d8['status'](_0xf2af61);return _0x35c3d8[_0xaa36('0x1d')](_0xaa36('0x1e'),_0x58b03c+'-'+_0x56d407+'/'+_0x119f82)[_0xaa36('0x18')](_0x53aef2);}return null;};}function patchUpdates(_0x5dfc8f){return function(_0x349c9b){try{jsonpatch['apply'](_0x349c9b,_0x5dfc8f,!![]);}catch(_0x30839a){return BPromise[_0xaa36('0x1f')](_0x30839a);}return _0x349c9b[_0xaa36('0x20')]();};}function saveUpdates(_0x383029,_0x5e65ec){return function(_0x594f29){if(_0x594f29){return _0x594f29[_0xaa36('0x21')](_0x383029)[_0xaa36('0x22')](function(_0x48e478){return _0x48e478;});}return null;};}function removeEntity(_0x11e72d,_0x1678a1){return function(_0x4a06b8){if(_0x4a06b8){return _0x4a06b8[_0xaa36('0x23')]()[_0xaa36('0x22')](function(){_0x11e72d[_0xaa36('0x24')](0xcc)[_0xaa36('0x25')]();});}};}function handleEntityNotFound(_0x17cb5b,_0x20e933){return function(_0x377c51){if(!_0x377c51){_0x17cb5b[_0xaa36('0x17')](0x194);}return _0x377c51;};}function handleError(_0x358e8d,_0x1333d2){_0x1333d2=_0x1333d2||0x1f4;return function(_0x23c477){logger['error'](_0x23c477[_0xaa36('0x26')]);if(_0x23c477[_0xaa36('0x27')]){delete _0x23c477[_0xaa36('0x27')];}_0x358e8d['status'](_0x1333d2)[_0xaa36('0x28')](_0x23c477);};}exports[_0xaa36('0x29')]=function(_0x2f761b,_0xde4cdb){var _0x1d24c6={},_0x521f65={},_0x8d4975={'count':0x0,'rows':[]};var _0x2202eb=_['map'](db[_0xaa36('0x2a')][_0xaa36('0x2b')],function(_0x4a9d7a){return{'name':_0x4a9d7a[_0xaa36('0x2c')],'type':_0x4a9d7a[_0xaa36('0x2d')][_0xaa36('0x2e')]};});_0x521f65[_0xaa36('0x2f')]=_[_0xaa36('0x30')](_0x2202eb,_0xaa36('0x27'));_0x521f65['query']=_[_0xaa36('0x31')](_0x2f761b[_0xaa36('0x32')]);_0x521f65[_0xaa36('0x33')]=_[_0xaa36('0x34')](_0x521f65[_0xaa36('0x2f')],_0x521f65['query']);_0x521f65[_0xaa36('0x33')]=_[_0xaa36('0x35')](_0x521f65[_0xaa36('0x33')],[_0xaa36('0x36'),_0xaa36('0x37'),_0xaa36('0x38'),_0xaa36('0x39'),'$lt',_0xaa36('0x3a'),_0xaa36('0x3b'),'$eq','$not',_0xaa36('0x3c'),_0xaa36('0x3d'),_0xaa36('0x3e'),_0xaa36('0x3f'),_0xaa36('0x40'),_0xaa36('0x41'),_0xaa36('0x42'),_0xaa36('0x43'),'$like',_0xaa36('0x44'),'$contains',_0xaa36('0x45'),_0xaa36('0x46')]);_0x1d24c6[_0xaa36('0x47')]=_[_0xaa36('0x34')](_0x521f65[_0xaa36('0x2f')],qs['fields'](_0x2f761b[_0xaa36('0x32')][_0xaa36('0x48')]));_0x1d24c6[_0xaa36('0x47')]=_0x1d24c6[_0xaa36('0x47')]['length']?_0x1d24c6[_0xaa36('0x47')]:_0x521f65[_0xaa36('0x2f')];if(!_0x2f761b['query']['hasOwnProperty'](_0xaa36('0x49'))){_0x1d24c6[_0xaa36('0x1b')]=qs[_0xaa36('0x1b')](_0x2f761b[_0xaa36('0x32')][_0xaa36('0x1b')]);_0x1d24c6['offset']=qs[_0xaa36('0x19')](_0x2f761b[_0xaa36('0x32')][_0xaa36('0x19')]);}_0x1d24c6[_0xaa36('0x4a')]=qs['sort'](_0x2f761b[_0xaa36('0x32')]['sort']);_0x1d24c6['where']=qs[_0xaa36('0x33')](_['pick'](_0x2f761b[_0xaa36('0x32')],_0x521f65['filters']),_0x2202eb);if(_0x2f761b[_0xaa36('0x32')][_0xaa36('0x4b')]){_0x1d24c6[_0xaa36('0x4c')]=_[_0xaa36('0x4d')](_0x1d24c6['where'],{'$or':_[_0xaa36('0x30')](_0x2202eb,function(_0x1cac46){if(_0x1cac46[_0xaa36('0x2d')]!==_0xaa36('0x4e')){var _0x17d1ea={};_0x17d1ea[_0x1cac46[_0xaa36('0x27')]]={'$like':'%'+_0x2f761b[_0xaa36('0x32')]['filter']+'%'};return _0x17d1ea;}})});}_0x1d24c6=_[_0xaa36('0x4d')]({},_0x1d24c6,_0x2f761b['options']);var _0x3e208e={'where':_0x1d24c6[_0xaa36('0x4c')]};return db['CmHopper'][_0xaa36('0x1c')](_0x3e208e)['then'](function(_0x1f8c97){_0x8d4975[_0xaa36('0x1c')]=_0x1f8c97;if(_0x2f761b[_0xaa36('0x32')][_0xaa36('0x4f')]){_0x1d24c6[_0xaa36('0x50')]=[{'all':!![]}];}return db['CmHopper'][_0xaa36('0x51')](_0x1d24c6);})[_0xaa36('0x22')](function(_0xa9b0ad){_0x8d4975[_0xaa36('0x52')]=_0xa9b0ad;return _0x8d4975;})[_0xaa36('0x22')](respondWithFilteredResult(_0xde4cdb,_0x1d24c6))[_0xaa36('0x53')](handleError(_0xde4cdb,null));};exports[_0xaa36('0x54')]=function(_0x332540,_0x28fb3b){var _0x3f5226={'raw':!![],'where':{'id':_0x332540[_0xaa36('0x55')]['id']}},_0x5345e9={};_0x5345e9[_0xaa36('0x2f')]=_['keys'](db[_0xaa36('0x2a')][_0xaa36('0x2b')]);_0x5345e9[_0xaa36('0x32')]=_[_0xaa36('0x31')](_0x332540[_0xaa36('0x32')]);_0x5345e9['filters']=_[_0xaa36('0x34')](_0x5345e9['model'],_0x5345e9[_0xaa36('0x32')]);_0x3f5226['attributes']=_[_0xaa36('0x34')](_0x5345e9['model'],qs[_0xaa36('0x48')](_0x332540[_0xaa36('0x32')][_0xaa36('0x48')]));_0x3f5226[_0xaa36('0x47')]=_0x3f5226[_0xaa36('0x47')][_0xaa36('0x56')]?_0x3f5226['attributes']:_0x5345e9['model'];if(_0x332540[_0xaa36('0x32')][_0xaa36('0x4f')]){_0x3f5226[_0xaa36('0x50')]=[{'all':!![]}];}_0x3f5226=_['merge']({},_0x3f5226,_0x332540['options']);return db[_0xaa36('0x2a')][_0xaa36('0x57')](_0x3f5226)[_0xaa36('0x22')](handleEntityNotFound(_0x28fb3b,null))[_0xaa36('0x22')](respondWithResult(_0x28fb3b,null))['catch'](handleError(_0x28fb3b,null));};exports[_0xaa36('0x58')]=function(_0x6aa700,_0x12534){return db[_0xaa36('0x2a')][_0xaa36('0x58')](_0x6aa700[_0xaa36('0x59')],{})[_0xaa36('0x22')](respondWithResult(_0x12534,0xc9))['catch'](handleError(_0x12534,null));};exports[_0xaa36('0x21')]=function(_0x3678ee,_0x179116){if(_0x3678ee[_0xaa36('0x59')]['id']){delete _0x3678ee[_0xaa36('0x59')]['id'];}return db[_0xaa36('0x2a')][_0xaa36('0x57')]({'where':{'id':_0x3678ee[_0xaa36('0x55')]['id']}})['then'](handleEntityNotFound(_0x179116,null))[_0xaa36('0x22')](saveUpdates(_0x3678ee[_0xaa36('0x59')],null))[_0xaa36('0x22')](respondWithResult(_0x179116,null))[_0xaa36('0x53')](handleError(_0x179116,null));};exports[_0xaa36('0x5a')]=function(_0x296eab,_0x13ccbe){return db[_0xaa36('0x2a')][_0xaa36('0x5a')]()['then'](respondWithResult(_0x13ccbe,null))[_0xaa36('0x53')](handleError(_0x13ccbe,null));};exports[_0xaa36('0x23')]=function(_0x5468a2,_0x5132d5){var _0x2af48d;return db[_0xaa36('0x2a')][_0xaa36('0x57')]({'where':{'id':_0x5468a2[_0xaa36('0x55')]['id']}})[_0xaa36('0x22')](handleEntityNotFound(_0x5132d5,null))[_0xaa36('0x22')](function(_0x28ae59){if(_0x28ae59){return _0x28ae59[_0xaa36('0x23')]()[_0xaa36('0x22')](function(_0x42b23d){return _0x42b23d;});}})[_0xaa36('0x22')](function(_0x527b0e){_0x2af48d=_0x527b0e;if(_0x527b0e){if(_0x527b0e[_0xaa36('0x5b')]||_0x527b0e[_0xaa36('0x5c')]){return db[_0x527b0e[_0xaa36('0x5b')]?_0xaa36('0x5d'):_0xaa36('0x5e')]['find']({'where':{'id':_0x527b0e[_0xaa36('0x5b')]?_0x527b0e[_0xaa36('0x5b')]:_0x527b0e[_0xaa36('0x5c')]},'attributes':['id',_0xaa36('0x27')],'raw':!![]});}}})['then'](function(_0x2dd3d1){var _0x18371c={};if(_0x2dd3d1){_[_0xaa36('0x4d')](_0x18371c,_['omit'](_0x2af48d[_0xaa36('0x5f')],[_0xaa36('0x60'),'updatedAt','id']));_0x18371c[_0xaa36('0x61')]=0x15;_0x18371c[_0xaa36('0x62')]=_0xaa36('0x63');_0x18371c['campaign']=_0x2dd3d1[_0xaa36('0x27')];_0x18371c['membername']=_0x5468a2[_0xaa36('0x64')][_0xaa36('0x27')];_0x18371c[_0xaa36('0x65')]=_0x5468a2[_0xaa36('0x64')]['id'];_0x18371c['deleted']=!![];_0x18371c[_0xaa36('0x66')]=moment()[_0xaa36('0x67')](_0xaa36('0x68'));_0x18371c['calleridnum']=_0x2af48d[_0xaa36('0x69')];_0x18371c[_0xaa36('0x6a')]=_0x2af48d['VoiceQueueId']?_0xaa36('0x6b'):'ivr';return db[_0xaa36('0x6c')][_0xaa36('0x57')]({'where':{'id':_0x18371c[_0xaa36('0x6d')]},'attributes':[_0xaa36('0x6e'),'lastName']})['then'](function(_0x4e1064){if(!_['isNil'](_0x5132d5)&&!_['isNil'](_0x4e1064[_0xaa36('0x6e')])){_0x18371c[_0xaa36('0x6f')]=_0x4e1064[_0xaa36('0x6e')];if(!_[_0xaa36('0x70')](_0x4e1064[_0xaa36('0x71')])){_0x18371c[_0xaa36('0x6f')]+='\x20'+_0x4e1064['lastName'];}}})['finally'](function(){return db[_0xaa36('0x72')][_0xaa36('0x58')](_0x18371c);});}})[_0xaa36('0x22')](function(){return _0x5132d5[_0xaa36('0x24')](0xcc)[_0xaa36('0x25')]();})[_0xaa36('0x53')](handleError(_0x5132d5,null));};exports[_0xaa36('0x73')]=function(_0x309b25,_0x54b012,_0x2cb7b2){var _0x1aed13=[];return db[_0xaa36('0x6c')][_0xaa36('0x5a')]()[_0xaa36('0x22')](function(_0x4323d4){_0x1aed13=_[_0xaa36('0x31')](_0x4323d4);return _0x309b25[_0xaa36('0x64')][_0xaa36('0x74')]({'where':{'type':_0xaa36('0x75'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xaa36('0x76')],'raw':!![]});})[_0xaa36('0x22')](function(_0x5816bb){if(_0x5816bb&&_0x5816bb[_0xaa36('0x56')]){return db[_0xaa36('0x77')]['transaction'](function(_0x1c3d52){var _0xabce04={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaa36('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaa36('0x30')](_0x5816bb,'id')},'$or':[{'UserId':null},{'UserId':_0x309b25[_0xaa36('0x64')]['id']}]};var _0x159c23=[];if(_0x309b25[_0xaa36('0x59')][_0xaa36('0x78')]&&_0x309b25[_0xaa36('0x59')][_0xaa36('0x78')]===_0xaa36('0x79')){if(!_[_0xaa36('0x7a')](_0x309b25['body'][_0xaa36('0x7b')])){_0xabce04['id']={'$in':_0x309b25['body'][_0xaa36('0x7b')]};}_0x159c23=[[_0xaa36('0x7c'),_0xaa36('0x7d')],[_0xaa36('0x7e'),_0x5816bb[0x0][_0xaa36('0x76')]==='ASC'?_0xaa36('0x7f'):_0xaa36('0x7d')],db[_0xaa36('0x77')][_0xaa36('0x80')](_0xaa36('0x81')),['id',_0xaa36('0x7f')]];}else{if(!_[_0xaa36('0x7a')](_0x309b25[_0xaa36('0x59')][_0xaa36('0x7b')])){_0xabce04['id']={'$notIn':_0x309b25['body']['hopperIds']};}_0x159c23=[['priority',_0xaa36('0x7f')],[_0xaa36('0x7e'),_0x5816bb[0x0][_0xaa36('0x76')]],db['sequelize']['literal'](_0xaa36('0x82')),['id',_0xaa36('0x7d')]];}return db[_0xaa36('0x2a')][_0xaa36('0x83')]({'attributes':['id',_0xaa36('0x84')],'where':_0xabce04,'order':_0x159c23,'transaction':_0x1c3d52,'lock':_0x1c3d52[_0xaa36('0x85')][_0xaa36('0x86')],'include':[{'model':db[_0xaa36('0x6c')],'as':_0xaa36('0x87'),'attributes':_0x1aed13,'include':[{'model':db[_0xaa36('0x88')],'as':_0xaa36('0x89'),'attributes':['id',_0xaa36('0x27')]}]},{'model':db[_0xaa36('0x8a')],'as':'List','attributes':['id','name']},{'model':db[_0xaa36('0x5d')],'as':_0xaa36('0x8b'),'attributes':['id',_0xaa36('0x27'),'dialActive']}]})[_0xaa36('0x22')](function(_0x3d63f8){if(_0x3d63f8){return _0x3d63f8[_0xaa36('0x21')]({'UserId':_0x309b25[_0xaa36('0x64')]['id']},{'transaction':_0x1c3d52});}});});}})[_0xaa36('0x22')](handleEntityNotFound(_0x54b012,null))['then'](respondWithResult(_0x54b012,null))[_0xaa36('0x53')](handleError(_0x54b012,null));};exports[_0xaa36('0x8c')]=function(_0x490bc0,_0x576db2,_0x2ef5d9){return _0x490bc0[_0xaa36('0x64')][_0xaa36('0x74')]({'where':{'type':_0xaa36('0x75'),'dialActive':!![],'dialMethod':_0xaa36('0x8d')},'attributes':['id'],'raw':!![]})['then'](function(_0xf96aa4){if(_0xf96aa4&&_0xf96aa4[_0xaa36('0x56')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xaa36('0x67')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xaa36('0x30')](_0xf96aa4,'id')},'$or':[{'UserId':null},{'UserId':_0x490bc0[_0xaa36('0x64')]['id']}]}});}return 0x0;})[_0xaa36('0x22')](function(_0x1623b2){if(!_[_0xaa36('0x70')](_0x1623b2)&&_[_0xaa36('0x8e')](_0x1623b2)){return _0x576db2[_0xaa36('0x24')](0xc8)[_0xaa36('0x18')]({'contacts':_0x1623b2});}else{logger[_0xaa36('0x8f')](_0xaa36('0x90'),_0xaa36('0x8c'),0x194,_0xaa36('0x91'));_0x576db2[_0xaa36('0x17')](0x194);}})['catch'](handleError(_0x576db2,null));};
\ No newline at end of file
index 604ad32..e4d90a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x179af8,_0x4bb0e3){_0x179af8=_0x179af8-0x0;var _0x438323=_0x7a54[_0x179af8];return _0x438323;};'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':'scheduledat','fields':[_0x47a5('0xc')]},{'name':'phone','fields':['phone']},{'name':'priority','fields':[_0x47a5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5496=['request-promise','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1b7d10,_0x59d677){var _0x36ea4f=function(_0x3b9492){while(--_0x3b9492){_0x1b7d10['push'](_0x1b7d10['shift']());}};_0x36ea4f(++_0x59d677);}(_0x5496,0x175));var _0x6549=function(_0x54093f,_0x941d16){_0x54093f=_0x54093f-0x0;var _0x2d1b6f=_0x5496[_0x54093f];return _0x2d1b6f;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('CmHopper',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xb')]},{'name':'phone','fields':[_0x6549('0xc')]},{'name':_0x6549('0xd'),'fields':[_0x6549('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 0c10457..d43184d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb25b=['result','catch','CmHopper','findAll','options','raw','limit','map','model','include','attributes','GetCmHopper','debug','find','ShowCmHopper','CreateCmHopper','update','body','where','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','UserId','push','includes','MoveContactManagedDialer','create','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','length','all','GetCmHopperPreview','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x3eae8a,_0x56c350){var _0x4f3e0b=function(_0x55dfd1){while(--_0x55dfd1){_0x3eae8a['push'](_0x3eae8a['shift']());}};_0x4f3e0b(++_0x56c350);}(_0xb25b,0x109));var _0xbb25=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb25b[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xbb25('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbb25('0x1'));var rs=require(_0xbb25('0x2'));var fs=require('fs');var Redis=require(_0xbb25('0x3'));var db=require(_0xbb25('0x4'))['db'];var utils=require(_0xbb25('0x5'));var logger=require(_0xbb25('0x6'))(_0xbb25('0x7'));var config=require(_0xbb25('0x8'));var jayson=require(_0xbb25('0x9'));var client=jayson[_0xbb25('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x169deb,_0x5646f0,_0x446062){return new BPromise(function(_0x38d27d,_0x4d0422){return client['request'](_0x169deb,_0x446062)[_0xbb25('0xb')](function(_0x59f72f){logger[_0xbb25('0xc')](_0xbb25('0xd'),_0x5646f0,'request\x20sent');logger['debug'](_0xbb25('0xe'),_0x5646f0,_0xbb25('0xf'),JSON[_0xbb25('0x10')](_0x59f72f));if(_0x59f72f[_0xbb25('0x11')]){if(_0x59f72f[_0xbb25('0x11')]['code']===0x1f4){logger[_0xbb25('0x11')]('CmHopper,\x20%s,\x20%s',_0x5646f0,_0x59f72f[_0xbb25('0x11')]['message']);return _0x4d0422(_0x59f72f[_0xbb25('0x11')][_0xbb25('0x12')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x5646f0,_0x59f72f[_0xbb25('0x11')][_0xbb25('0x12')]);return _0x38d27d(_0x59f72f[_0xbb25('0x11')][_0xbb25('0x12')]);}else{logger[_0xbb25('0xc')](_0xbb25('0xd'),_0x5646f0,_0xbb25('0xf'));_0x38d27d(_0x59f72f[_0xbb25('0x13')]['message']);}})[_0xbb25('0x14')](function(_0x4504ca){logger[_0xbb25('0x11')]('CmHopper,\x20%s,\x20%s',_0x5646f0,_0x4504ca);_0x4d0422(_0x4504ca);});});}exports['GetCmHopper']=function(_0x58e499){var _0xcf4458=this;return new Promise(function(_0x2424ee,_0x4ef755){return db[_0xbb25('0x15')][_0xbb25('0x16')]({'raw':_0x58e499['options']?_0x58e499[_0xbb25('0x17')][_0xbb25('0x18')]===undefined?!![]:![]:!![],'where':_0x58e499[_0xbb25('0x17')]?_0x58e499['options']['where']||null:null,'attributes':_0x58e499[_0xbb25('0x17')]?_0x58e499['options']['attributes']||null:null,'limit':_0x58e499[_0xbb25('0x17')]?_0x58e499[_0xbb25('0x17')][_0xbb25('0x19')]||null:null,'include':_0x58e499[_0xbb25('0x17')]?_0x58e499['options']['include']?_[_0xbb25('0x1a')](_0x58e499[_0xbb25('0x17')]['include'],function(_0x20dc88){return{'model':db[_0x20dc88[_0xbb25('0x1b')]],'as':_0x20dc88['as'],'attributes':_0x20dc88['attributes'],'include':_0x20dc88[_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x20dc88[_0xbb25('0x1c')],function(_0x1c9260){return{'model':db[_0x1c9260[_0xbb25('0x1b')]],'as':_0x1c9260['as'],'attributes':_0x1c9260[_0xbb25('0x1d')],'include':_0x1c9260[_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x1c9260['include'],function(_0x49fcbb){return{'model':db[_0x49fcbb[_0xbb25('0x1b')]],'as':_0x49fcbb['as'],'attributes':_0x49fcbb[_0xbb25('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x353d7a){logger[_0xbb25('0xc')](_0xbb25('0x1e'),_0x58e499);logger[_0xbb25('0x1f')](_0xbb25('0x1e'),_0x58e499,JSON['stringify'](_0x353d7a));_0x2424ee(_0x353d7a);})[_0xbb25('0x14')](function(_0x381212){logger[_0xbb25('0x11')](_0xbb25('0x1e'),_0x381212['message'],_0x58e499);_0x4ef755(_0xcf4458[_0xbb25('0x11')](0x1f4,_0x381212[_0xbb25('0x12')]));});});};exports['ShowCmHopper']=function(_0x31d6fe){var _0x1edc0a=this;return new Promise(function(_0x1d68f1,_0x23f83a){return db[_0xbb25('0x15')][_0xbb25('0x20')]({'raw':_0x31d6fe[_0xbb25('0x17')]?_0x31d6fe[_0xbb25('0x17')][_0xbb25('0x18')]===undefined?!![]:![]:!![],'where':_0x31d6fe[_0xbb25('0x17')]?_0x31d6fe[_0xbb25('0x17')]['where']||null:null,'attributes':_0x31d6fe['options']?_0x31d6fe['options'][_0xbb25('0x1d')]||null:null,'include':_0x31d6fe[_0xbb25('0x17')]?_0x31d6fe[_0xbb25('0x17')][_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x31d6fe[_0xbb25('0x17')][_0xbb25('0x1c')],function(_0x37d114){return{'model':db[_0x37d114[_0xbb25('0x1b')]],'as':_0x37d114['as'],'attributes':_0x37d114[_0xbb25('0x1d')],'include':_0x37d114[_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x37d114[_0xbb25('0x1c')],function(_0x3b3ec0){return{'model':db[_0x3b3ec0['model']],'as':_0x3b3ec0['as'],'attributes':_0x3b3ec0[_0xbb25('0x1d')],'include':_0x3b3ec0['include']?_[_0xbb25('0x1a')](_0x3b3ec0['include'],function(_0x39f723){return{'model':db[_0x39f723[_0xbb25('0x1b')]],'as':_0x39f723['as'],'attributes':_0x39f723[_0xbb25('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x271736){logger['info'](_0xbb25('0x21'),_0x31d6fe);logger[_0xbb25('0x1f')](_0xbb25('0x21'),_0x31d6fe,JSON[_0xbb25('0x10')](_0x271736));_0x1d68f1(_0x271736);})[_0xbb25('0x14')](function(_0x4fc0b1){logger[_0xbb25('0x11')](_0xbb25('0x21'),_0x4fc0b1['message'],_0x31d6fe);_0x23f83a(_0x1edc0a['error'](0x1f4,_0x4fc0b1[_0xbb25('0x12')]));});});};exports[_0xbb25('0x22')]=function(_0x2c1f4b){var _0x3babd5=this;return new Promise(function(_0x3abac5,_0x46f551){return db[_0xbb25('0x15')]['create'](_0x2c1f4b['body'],{'raw':_0x2c1f4b[_0xbb25('0x17')]?_0x2c1f4b['options'][_0xbb25('0x18')]===undefined?!![]:![]:!![]})[_0xbb25('0xb')](function(_0x2046cd){logger[_0xbb25('0xc')]('CreateCmHopper',_0x2c1f4b);logger[_0xbb25('0x1f')](_0xbb25('0x22'),_0x2c1f4b,JSON['stringify'](_0x2046cd));_0x3abac5(_0x2046cd);})[_0xbb25('0x14')](function(_0x3a3e40){logger[_0xbb25('0x11')](_0xbb25('0x22'),_0x3a3e40[_0xbb25('0x12')],_0x2c1f4b);_0x46f551(_0x3babd5['error'](0x1f4,_0x3a3e40[_0xbb25('0x12')]));});});};exports['UpdateCmHopper']=function(_0x40b441){var _0x17883f=this;return new Promise(function(_0x618308,_0x15a229){return db[_0xbb25('0x15')][_0xbb25('0x23')](_0x40b441[_0xbb25('0x24')],{'raw':_0x40b441[_0xbb25('0x17')]?_0x40b441[_0xbb25('0x17')][_0xbb25('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40b441[_0xbb25('0x17')]?_0x40b441[_0xbb25('0x17')][_0xbb25('0x25')]||null:null,'attributes':_0x40b441[_0xbb25('0x17')]?_0x40b441['options'][_0xbb25('0x1d')]||null:null,'limit':_0x40b441[_0xbb25('0x17')]?_0x40b441['options'][_0xbb25('0x19')]||null:null})['then'](function(_0x4e517a){logger[_0xbb25('0xc')](_0xbb25('0x26'),_0x40b441);logger[_0xbb25('0x1f')](_0xbb25('0x26'),_0x40b441,JSON[_0xbb25('0x10')](_0x4e517a));_0x618308(_0x4e517a);})[_0xbb25('0x14')](function(_0x33c7f8){logger['error'](_0xbb25('0x26'),_0x33c7f8['message'],_0x40b441);_0x15a229(_0x17883f[_0xbb25('0x11')](0x1f4,_0x33c7f8[_0xbb25('0x12')]));});});};exports[_0xbb25('0x27')]=function(_0x101c9b){var _0x5cffe=this;return new Promise(function(_0x46e15c,_0x1cb6d9){return db[_0xbb25('0x15')][_0xbb25('0x28')]({'where':_0x101c9b[_0xbb25('0x17')]?_0x101c9b[_0xbb25('0x17')][_0xbb25('0x25')]||null:null})['then'](function(_0x24de20){logger['info']('DestroyCmHopper',_0x101c9b);logger[_0xbb25('0x1f')](_0xbb25('0x27'),_0x101c9b,JSON[_0xbb25('0x10')](_0x24de20));_0x46e15c(_0x24de20);})['catch'](function(_0x190ba5){logger[_0xbb25('0x11')](_0xbb25('0x27'),_0x190ba5[_0xbb25('0x12')],_0x101c9b);_0x1cb6d9(_0x5cffe[_0xbb25('0x11')](0x1f4,_0x190ba5[_0xbb25('0x12')]));});});};exports[_0xbb25('0x29')]=function(_0x42aa2a){var _0x1fb61d=this;return new Promise(function(_0xc685e3,_0x36b04c){return db['CmContact'][_0xbb25('0x2a')]()[_0xbb25('0xb')](function(_0x50447f){return db[_0xbb25('0x2b')][_0xbb25('0x2c')](function(_0x34a56a){return db[_0xbb25('0x15')]['findAll']({'where':_0x42aa2a[_0xbb25('0x17')]?_0x42aa2a[_0xbb25('0x17')][_0xbb25('0x25')]||null:null,'attributes':_0x42aa2a[_0xbb25('0x17')]?_0x42aa2a['options'][_0xbb25('0x1d')]||null:null,'limit':_0x42aa2a['options']?_0x42aa2a[_0xbb25('0x17')][_0xbb25('0x19')]||null:null,'order':_0x42aa2a[_0xbb25('0x17')]?_0x42aa2a['options'][_0xbb25('0x2d')]||null:null,'transaction':_0x34a56a,'lock':_0x34a56a[_0xbb25('0x2e')][_0xbb25('0x2f')],'include':[{'model':db[_0xbb25('0x30')],'as':_0xbb25('0x31'),'attributes':_[_0xbb25('0x32')](_0x50447f)},{'model':db[_0xbb25('0x33')],'as':_0xbb25('0x34'),'attributes':['id',_0xbb25('0x35'),_0xbb25('0x36')]}]})[_0xbb25('0xb')](function(_0x2d661e){var _0x163265=[];var _0x5f0452=[];for(var _0x85f8e6=0x0;_0x85f8e6<_0x2d661e['length'];_0x85f8e6+=0x1){var _0x120ad3=_0x2d661e[_0x85f8e6][_0xbb25('0x37')];if(_0x120ad3===null){_0x163265[_0xbb25('0x38')](_0x2d661e[_0x85f8e6][_0xbb25('0x23')](_0x42aa2a[_0xbb25('0x24')],{'transaction':_0x34a56a}));}else if(!_0x5f0452[_0xbb25('0x39')](_0x120ad3)){_0x5f0452[_0xbb25('0x38')](_0x120ad3);_0x163265[_0xbb25('0x38')](_0x2d661e[_0x85f8e6][_0xbb25('0x23')](_0x42aa2a[_0xbb25('0x24')],{'transaction':_0x34a56a}));}}return BPromise['all'](_0x163265);});})['then'](function(_0x3f030f){logger[_0xbb25('0xc')](_0xbb25('0x29'),_0x42aa2a);logger['debug'](_0xbb25('0x29'),_0x42aa2a,JSON['stringify'](_0x3f030f));_0xc685e3(_0x3f030f);})[_0xbb25('0x14')](function(_0x12e69e){logger[_0xbb25('0x11')](_0xbb25('0x29'),_0x12e69e['message'],_0x42aa2a);_0x36b04c(_0x1fb61d[_0xbb25('0x11')](0x1f4,_0x12e69e['message']));});});});};exports[_0xbb25('0x3a')]=function(_0x31840e){var _0x13b372=this;return new Promise(function(_0x1e98f7,_0xb770d4){return db[_0xbb25('0x2b')]['transaction'](function(_0xb57d67){return db['CmHopperFinal'][_0xbb25('0x3b')](_0x31840e[_0xbb25('0x24')],{'raw':_0x31840e['options']?_0x31840e['options']['raw']===undefined?!![]:![]:!![],'transaction':_0xb57d67})[_0xbb25('0xb')](function(){return db[_0xbb25('0x15')][_0xbb25('0x28')]({'where':_0x31840e['options']?_0x31840e[_0xbb25('0x17')][_0xbb25('0x25')]||null:null,'transaction':_0xb57d67});});})[_0xbb25('0xb')](function(_0x383fe1){logger['info']('MoveContactManagedDialer',_0x31840e);logger[_0xbb25('0x1f')](_0xbb25('0x3a'),_0x31840e,JSON[_0xbb25('0x10')](_0x383fe1));_0x1e98f7(_0x383fe1);})[_0xbb25('0x14')](function(_0x1fd55b){logger[_0xbb25('0x11')](_0xbb25('0x3a'),_0x1fd55b[_0xbb25('0x12')],_0x31840e);_0xb770d4(_0x13b372['error'](0x1f4,_0x1fd55b[_0xbb25('0x12')]));});});};exports[_0xbb25('0x3c')]=function(_0x41c655){var _0x1b1f25=this;return new Promise(function(_0x301cd7,_0x3d8a51){return db[_0xbb25('0x15')][_0xbb25('0x16')]({'raw':_0x41c655[_0xbb25('0x17')]?_0x41c655[_0xbb25('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x41c655['options']?_0x41c655[_0xbb25('0x17')][_0xbb25('0x25')]||null:null,'attributes':[[db[_0xbb25('0x2b')]['fn'](_0xbb25('0x3d'),db['sequelize']['fn']('IF',db[_0xbb25('0x2b')][_0xbb25('0x3e')](_0xbb25('0x3f')+util[_0xbb25('0x40')](_0xbb25('0x41'),moment()['format'](_0xbb25('0x42')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xbb25('0xb')](function(_0x4dce81){logger[_0xbb25('0xc')](_0xbb25('0x3c'),_0x41c655);logger[_0xbb25('0x1f')](_0xbb25('0x3c'),_0x41c655,JSON[_0xbb25('0x10')](_0x4dce81));_0x301cd7(_0x4dce81);})['catch'](function(_0x402946){logger[_0xbb25('0x11')](_0xbb25('0x3c'),_0x402946[_0xbb25('0x12')],_0x41c655);_0x3d8a51(_0x1b1f25[_0xbb25('0x11')](0x1f4,_0x402946[_0xbb25('0x12')]));});});};exports[_0xbb25('0x43')]=function(_0x18117c){var _0xd55d26=this;return new Promise(function(_0x951f41,_0x4fffe7){return db[_0xbb25('0x30')][_0xbb25('0x2a')]()[_0xbb25('0xb')](function(_0x3850e7){return db['sequelize'][_0xbb25('0x2c')](function(_0x192a74){return db[_0xbb25('0x15')][_0xbb25('0x16')]({'where':_0x18117c[_0xbb25('0x17')]?_0x18117c[_0xbb25('0x17')][_0xbb25('0x25')]||null:null,'attributes':_0x18117c['options']?_0x18117c[_0xbb25('0x17')][_0xbb25('0x1d')]||null:null,'limit':0x1,'order':_0x18117c['options']?_0x18117c[_0xbb25('0x17')]['order']||null:null,'group':db[_0xbb25('0x15')][_0xbb25('0x37')],'transaction':_0x192a74,'lock':_0x192a74[_0xbb25('0x2e')][_0xbb25('0x2f')],'include':_0x18117c['options']?_0x18117c[_0xbb25('0x17')][_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x18117c[_0xbb25('0x17')][_0xbb25('0x1c')],function(_0x42ecd8){return{'model':db[_0x42ecd8[_0xbb25('0x1b')]],'as':_0x42ecd8['as'],'attributes':_0x42ecd8[_0xbb25('0x1d')],'include':_0x42ecd8[_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x42ecd8['include'],function(_0x46e1e8){return{'model':db[_0x46e1e8[_0xbb25('0x1b')]],'as':_0x46e1e8['as'],'attributes':_0x46e1e8['attributes'],'include':_0x46e1e8[_0xbb25('0x1c')]?_['map'](_0x46e1e8[_0xbb25('0x1c')],function(_0x573d0f){return{'model':db[_0x573d0f['model']],'as':_0x573d0f['as'],'attributes':_0x573d0f['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb25('0xb')](function(_0x174d70){var _0x873db9=[];for(var _0x5b7ed8=0x0;_0x5b7ed8<_0x174d70[_0xbb25('0x44')];_0x5b7ed8+=0x1){_0x873db9['push'](_0x174d70[_0x5b7ed8][_0xbb25('0x23')](_0x18117c[_0xbb25('0x24')],{'transaction':_0x192a74}));}return BPromise[_0xbb25('0x45')](_0x873db9);});})[_0xbb25('0xb')](function(_0x145f25){logger[_0xbb25('0xc')](_0xbb25('0x43'),_0x18117c);logger[_0xbb25('0x1f')](_0xbb25('0x43'),_0x18117c,JSON[_0xbb25('0x10')](_0x145f25));_0x951f41(_0x145f25);})[_0xbb25('0x14')](function(_0x57499f){logger['error'](_0xbb25('0x43'),_0x57499f['message'],_0x18117c);_0x4fffe7(_0xd55d26[_0xbb25('0x11')](0x1f4,_0x57499f[_0xbb25('0x12')]));});});});};exports[_0xbb25('0x46')]=function(_0x518047){var _0x5215bc=this;return new Promise(function(_0x4b126e,_0x444ee8){db[_0xbb25('0x30')]['describe']()[_0xbb25('0xb')](function(_0x31aab9){return db[_0xbb25('0x15')][_0xbb25('0x16')]({'raw':_0x518047[_0xbb25('0x17')]?_0x518047[_0xbb25('0x17')][_0xbb25('0x18')]===undefined?!![]:![]:!![],'where':_0x518047[_0xbb25('0x17')]?_0x518047[_0xbb25('0x17')][_0xbb25('0x25')]||null:null,'attributes':_0x518047[_0xbb25('0x17')]?_0x518047[_0xbb25('0x17')]['attributes']||null:null,'limit':_0x518047['options']?_0x518047['options']['limit']||null:null,'include':_0x518047[_0xbb25('0x17')]?_0x518047[_0xbb25('0x17')][_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x518047['options']['include'],function(_0x23f3a1){return{'model':db[_0x23f3a1[_0xbb25('0x1b')]],'as':_0x23f3a1['as'],'attributes':_0x23f3a1['as']===_0xbb25('0x31')?_[_0xbb25('0x32')](_0x31aab9):_0x23f3a1[_0xbb25('0x1d')],'include':_0x23f3a1[_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0x23f3a1[_0xbb25('0x1c')],function(_0xa0bb53){return{'model':db[_0xa0bb53['model']],'as':_0xa0bb53['as'],'attributes':_0xa0bb53[_0xbb25('0x1d')],'include':_0xa0bb53[_0xbb25('0x1c')]?_[_0xbb25('0x1a')](_0xa0bb53[_0xbb25('0x1c')],function(_0x1156c0){return{'model':db[_0x1156c0['model']],'as':_0x1156c0['as'],'attributes':_0x1156c0[_0xbb25('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbb25('0xb')](function(_0x13f19c){logger[_0xbb25('0xc')](_0xbb25('0x1e'),_0x518047);logger[_0xbb25('0x1f')](_0xbb25('0x1e'),_0x518047,JSON[_0xbb25('0x10')](_0x13f19c));_0x4b126e(_0x13f19c);})[_0xbb25('0x14')](function(_0x568071){logger['error'](_0xbb25('0x1e'),_0x568071['message'],_0x518047);_0x444ee8(_0x5215bc[_0xbb25('0x11')](0x1f4,_0x568071['message']));});});});};
\ No newline at end of file
+var _0xe3bb=['request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','message','error','result','GetCmHopper','CmHopper','findAll','options','attributes','limit','include','map','model','then','ShowCmHopper','find','raw','CreateCmHopper','create','body','catch','update','where','UpdateCmHopper','destroy','DestroyCmHopper','CmContact','describe','transaction','LOCK','Contact','Agent','length','UserId','push','all','GetContactDialer','sequelize','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','keys','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x1d65d8,_0x379eed){var _0x5e7880=function(_0x59d42d){while(--_0x59d42d){_0x1d65d8['push'](_0x1d65d8['shift']());}};_0x5e7880(++_0x379eed);}(_0xe3bb,0x14f));var _0xbe3b=function(_0x99181b,_0x7ec23a){_0x99181b=_0x99181b-0x0;var _0x31eb30=_0xe3bb[_0x99181b];return _0x31eb30;};'use strict';var _=require(_0xbe3b('0x0'));var util=require(_0xbe3b('0x1'));var moment=require(_0xbe3b('0x2'));var BPromise=require(_0xbe3b('0x3'));var rs=require(_0xbe3b('0x4'));var fs=require('fs');var Redis=require(_0xbe3b('0x5'));var db=require(_0xbe3b('0x6'))['db'];var utils=require(_0xbe3b('0x7'));var logger=require(_0xbe3b('0x8'))(_0xbe3b('0x9'));var config=require(_0xbe3b('0xa'));var jayson=require(_0xbe3b('0xb'));var client=jayson[_0xbe3b('0xc')][_0xbe3b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1b2f18,_0x575ce8,_0x39c826){return new BPromise(function(_0x5b2205,_0x1bc92d){return client['request'](_0x1b2f18,_0x39c826)['then'](function(_0x31612a){logger[_0xbe3b('0xe')]('CmHopper,\x20%s,\x20%s',_0x575ce8,_0xbe3b('0xf'));logger[_0xbe3b('0x10')](_0xbe3b('0x11'),_0x575ce8,_0xbe3b('0xf'),JSON[_0xbe3b('0x12')](_0x31612a));if(_0x31612a['error']){if(_0x31612a['error']['code']===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x575ce8,_0x31612a['error'][_0xbe3b('0x13')]);return _0x1bc92d(_0x31612a[_0xbe3b('0x14')]['message']);}logger[_0xbe3b('0x14')]('CmHopper,\x20%s,\x20%s',_0x575ce8,_0x31612a['error'][_0xbe3b('0x13')]);return _0x5b2205(_0x31612a[_0xbe3b('0x14')][_0xbe3b('0x13')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x575ce8,_0xbe3b('0xf'));_0x5b2205(_0x31612a[_0xbe3b('0x15')]['message']);}})['catch'](function(_0x378765){logger[_0xbe3b('0x14')]('CmHopper,\x20%s,\x20%s',_0x575ce8,_0x378765);_0x1bc92d(_0x378765);});});}exports[_0xbe3b('0x16')]=function(_0x38a050){var _0x1f129e=this;return new Promise(function(_0x2e51c1,_0xe7fc17){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'raw':_0x38a050['options']?_0x38a050[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38a050[_0xbe3b('0x19')]?_0x38a050[_0xbe3b('0x19')]['where']||null:null,'attributes':_0x38a050['options']?_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'limit':_0x38a050[_0xbe3b('0x19')]?_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null,'include':_0x38a050['options']?_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x38a050[_0xbe3b('0x19')][_0xbe3b('0x1c')],function(_0x10c36e){return{'model':db[_0x10c36e['model']],'as':_0x10c36e['as'],'attributes':_0x10c36e['attributes'],'include':_0x10c36e[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x10c36e[_0xbe3b('0x1c')],function(_0x1c7c58){return{'model':db[_0x1c7c58[_0xbe3b('0x1e')]],'as':_0x1c7c58['as'],'attributes':_0x1c7c58[_0xbe3b('0x1a')],'include':_0x1c7c58[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x1c7c58[_0xbe3b('0x1c')],function(_0x28e914){return{'model':db[_0x28e914[_0xbe3b('0x1e')]],'as':_0x28e914['as'],'attributes':_0x28e914['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x35c62b){logger['info'](_0xbe3b('0x16'),_0x38a050);logger[_0xbe3b('0x10')](_0xbe3b('0x16'),_0x38a050,JSON[_0xbe3b('0x12')](_0x35c62b));_0x2e51c1(_0x35c62b);})['catch'](function(_0x27fa1f){logger[_0xbe3b('0x14')](_0xbe3b('0x16'),_0x27fa1f[_0xbe3b('0x13')],_0x38a050);_0xe7fc17(_0x1f129e[_0xbe3b('0x14')](0x1f4,_0x27fa1f[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x20')]=function(_0x3b2329){var _0x2c00d3=this;return new Promise(function(_0x508939,_0x4f2d32){return db[_0xbe3b('0x17')][_0xbe3b('0x21')]({'raw':_0x3b2329[_0xbe3b('0x19')]?_0x3b2329['options'][_0xbe3b('0x22')]===undefined?!![]:![]:!![],'where':_0x3b2329['options']?_0x3b2329['options']['where']||null:null,'attributes':_0x3b2329[_0xbe3b('0x19')]?_0x3b2329[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'include':_0x3b2329['options']?_0x3b2329['options']['include']?_[_0xbe3b('0x1d')](_0x3b2329[_0xbe3b('0x19')]['include'],function(_0x2d826b){return{'model':db[_0x2d826b['model']],'as':_0x2d826b['as'],'attributes':_0x2d826b[_0xbe3b('0x1a')],'include':_0x2d826b[_0xbe3b('0x1c')]?_['map'](_0x2d826b[_0xbe3b('0x1c')],function(_0xd3ead7){return{'model':db[_0xd3ead7[_0xbe3b('0x1e')]],'as':_0xd3ead7['as'],'attributes':_0xd3ead7['attributes'],'include':_0xd3ead7[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0xd3ead7[_0xbe3b('0x1c')],function(_0x4fe90e){return{'model':db[_0x4fe90e[_0xbe3b('0x1e')]],'as':_0x4fe90e['as'],'attributes':_0x4fe90e[_0xbe3b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x190c44){logger[_0xbe3b('0xe')](_0xbe3b('0x20'),_0x3b2329);logger['debug'](_0xbe3b('0x20'),_0x3b2329,JSON['stringify'](_0x190c44));_0x508939(_0x190c44);})['catch'](function(_0x312278){logger[_0xbe3b('0x14')](_0xbe3b('0x20'),_0x312278['message'],_0x3b2329);_0x4f2d32(_0x2c00d3[_0xbe3b('0x14')](0x1f4,_0x312278[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x23')]=function(_0x49c65f){var _0x2ac53a=this;return new Promise(function(_0x6714d7,_0x449a50){return db[_0xbe3b('0x17')][_0xbe3b('0x24')](_0x49c65f[_0xbe3b('0x25')],{'raw':_0x49c65f[_0xbe3b('0x19')]?_0x49c65f[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3fae1a){logger[_0xbe3b('0xe')]('CreateCmHopper',_0x49c65f);logger[_0xbe3b('0x10')](_0xbe3b('0x23'),_0x49c65f,JSON[_0xbe3b('0x12')](_0x3fae1a));_0x6714d7(_0x3fae1a);})[_0xbe3b('0x26')](function(_0x224663){logger[_0xbe3b('0x14')](_0xbe3b('0x23'),_0x224663['message'],_0x49c65f);_0x449a50(_0x2ac53a[_0xbe3b('0x14')](0x1f4,_0x224663['message']));});});};exports['UpdateCmHopper']=function(_0x4e39ea){var _0x601d0e=this;return new Promise(function(_0x45bce5,_0x3b74f8){return db[_0xbe3b('0x17')][_0xbe3b('0x27')](_0x4e39ea['body'],{'raw':_0x4e39ea['options']?_0x4e39ea['options'][_0xbe3b('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e39ea[_0xbe3b('0x19')]?_0x4e39ea['options'][_0xbe3b('0x28')]||null:null,'attributes':_0x4e39ea[_0xbe3b('0x19')]?_0x4e39ea[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'limit':_0x4e39ea[_0xbe3b('0x19')]?_0x4e39ea[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null})['then'](function(_0x3db85d){logger[_0xbe3b('0xe')]('UpdateCmHopper',_0x4e39ea);logger['debug'](_0xbe3b('0x29'),_0x4e39ea,JSON[_0xbe3b('0x12')](_0x3db85d));_0x45bce5(_0x3db85d);})[_0xbe3b('0x26')](function(_0xd7f3e){logger[_0xbe3b('0x14')]('UpdateCmHopper',_0xd7f3e['message'],_0x4e39ea);_0x3b74f8(_0x601d0e[_0xbe3b('0x14')](0x1f4,_0xd7f3e['message']));});});};exports['DestroyCmHopper']=function(_0x32ab7d){var _0x1c8253=this;return new Promise(function(_0x311668,_0x5de9bc){return db[_0xbe3b('0x17')][_0xbe3b('0x2a')]({'where':_0x32ab7d['options']?_0x32ab7d[_0xbe3b('0x19')]['where']||null:null})[_0xbe3b('0x1f')](function(_0x671187){logger[_0xbe3b('0xe')](_0xbe3b('0x2b'),_0x32ab7d);logger[_0xbe3b('0x10')](_0xbe3b('0x2b'),_0x32ab7d,JSON['stringify'](_0x671187));_0x311668(_0x671187);})[_0xbe3b('0x26')](function(_0x345cbf){logger[_0xbe3b('0x14')](_0xbe3b('0x2b'),_0x345cbf['message'],_0x32ab7d);_0x5de9bc(_0x1c8253[_0xbe3b('0x14')](0x1f4,_0x345cbf[_0xbe3b('0x13')]));});});};exports['GetContactDialer']=function(_0x3c65d4){var _0x676fdb=this;return new Promise(function(_0x42e39b,_0x56167a){return db[_0xbe3b('0x2c')][_0xbe3b('0x2d')]()[_0xbe3b('0x1f')](function(_0x18bac3){return db['sequelize'][_0xbe3b('0x2e')](function(_0x6606e){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'where':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4[_0xbe3b('0x19')][_0xbe3b('0x28')]||null:null,'attributes':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4['options'][_0xbe3b('0x1a')]||null:null,'limit':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null,'order':_0x3c65d4[_0xbe3b('0x19')]?_0x3c65d4[_0xbe3b('0x19')]['order']||null:null,'transaction':_0x6606e,'lock':_0x6606e[_0xbe3b('0x2f')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xbe3b('0x30'),'attributes':_['keys'](_0x18bac3)},{'model':db['User'],'as':_0xbe3b('0x31'),'attributes':['id','name','voicePause']}]})['then'](function(_0x3527b9){var _0x4a6091=[];var _0x347404=[];for(var _0x5c90cf=0x0;_0x5c90cf<_0x3527b9[_0xbe3b('0x32')];_0x5c90cf+=0x1){var _0x354d13=_0x3527b9[_0x5c90cf][_0xbe3b('0x33')];if(_0x354d13===null){_0x4a6091[_0xbe3b('0x34')](_0x3527b9[_0x5c90cf][_0xbe3b('0x27')](_0x3c65d4[_0xbe3b('0x25')],{'transaction':_0x6606e}));}else if(!_0x347404['includes'](_0x354d13)){_0x347404['push'](_0x354d13);_0x4a6091['push'](_0x3527b9[_0x5c90cf][_0xbe3b('0x27')](_0x3c65d4[_0xbe3b('0x25')],{'transaction':_0x6606e}));}}return BPromise[_0xbe3b('0x35')](_0x4a6091);});})['then'](function(_0x5d62b4){logger[_0xbe3b('0xe')](_0xbe3b('0x36'),_0x3c65d4);logger['debug'](_0xbe3b('0x36'),_0x3c65d4,JSON['stringify'](_0x5d62b4));_0x42e39b(_0x5d62b4);})['catch'](function(_0xa67368){logger[_0xbe3b('0x14')](_0xbe3b('0x36'),_0xa67368[_0xbe3b('0x13')],_0x3c65d4);_0x56167a(_0x676fdb[_0xbe3b('0x14')](0x1f4,_0xa67368[_0xbe3b('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x2eed9f){var _0x21237b=this;return new Promise(function(_0x288713,_0x21f263){return db[_0xbe3b('0x37')][_0xbe3b('0x2e')](function(_0x2440da){return db['CmHopperFinal']['create'](_0x2eed9f['body'],{'raw':_0x2eed9f[_0xbe3b('0x19')]?_0x2eed9f[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![],'transaction':_0x2440da})['then'](function(){return db[_0xbe3b('0x17')][_0xbe3b('0x2a')]({'where':_0x2eed9f[_0xbe3b('0x19')]?_0x2eed9f[_0xbe3b('0x19')][_0xbe3b('0x28')]||null:null,'transaction':_0x2440da});});})[_0xbe3b('0x1f')](function(_0x5e858a){logger[_0xbe3b('0xe')]('MoveContactManagedDialer',_0x2eed9f);logger[_0xbe3b('0x10')](_0xbe3b('0x38'),_0x2eed9f,JSON[_0xbe3b('0x12')](_0x5e858a));_0x288713(_0x5e858a);})[_0xbe3b('0x26')](function(_0x3a2a5f){logger[_0xbe3b('0x14')]('MoveContactManagedDialer',_0x3a2a5f[_0xbe3b('0x13')],_0x2eed9f);_0x21f263(_0x21237b['error'](0x1f4,_0x3a2a5f[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x39')]=function(_0x38ce68){var _0x213bc0=this;return new Promise(function(_0x22b98a,_0x57aa39){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'raw':_0x38ce68[_0xbe3b('0x19')]?_0x38ce68[_0xbe3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38ce68[_0xbe3b('0x19')]?_0x38ce68[_0xbe3b('0x19')][_0xbe3b('0x28')]||null:null,'attributes':[[db[_0xbe3b('0x37')]['fn'](_0xbe3b('0x3a'),db[_0xbe3b('0x37')]['fn']('IF',db[_0xbe3b('0x37')][_0xbe3b('0x3b')](_0xbe3b('0x3c')+util[_0xbe3b('0x3d')](_0xbe3b('0x3e'),moment()['format'](_0xbe3b('0x3f')))+_0xbe3b('0x40')))),_0xbe3b('0x41')]]})[_0xbe3b('0x1f')](function(_0x3c1bc6){logger[_0xbe3b('0xe')](_0xbe3b('0x39'),_0x38ce68);logger[_0xbe3b('0x10')](_0xbe3b('0x39'),_0x38ce68,JSON['stringify'](_0x3c1bc6));_0x22b98a(_0x3c1bc6);})[_0xbe3b('0x26')](function(_0x4dde01){logger[_0xbe3b('0x14')](_0xbe3b('0x39'),_0x4dde01[_0xbe3b('0x13')],_0x38ce68);_0x57aa39(_0x213bc0[_0xbe3b('0x14')](0x1f4,_0x4dde01[_0xbe3b('0x13')]));});});};exports[_0xbe3b('0x42')]=function(_0x135df3){var _0x23e50d=this;return new Promise(function(_0x18b39d,_0x5834b2){return db['CmContact']['describe']()[_0xbe3b('0x1f')](function(_0x5cc1f9){return db[_0xbe3b('0x37')][_0xbe3b('0x2e')](function(_0x1e4b51){return db['CmHopper'][_0xbe3b('0x18')]({'where':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')]['where']||null:null,'attributes':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x1a')]||null:null,'limit':0x1,'order':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x43')]||null:null,'group':db[_0xbe3b('0x17')][_0xbe3b('0x33')],'transaction':_0x1e4b51,'lock':_0x1e4b51[_0xbe3b('0x2f')][_0xbe3b('0x44')],'include':_0x135df3[_0xbe3b('0x19')]?_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x1c')]?_['map'](_0x135df3[_0xbe3b('0x19')][_0xbe3b('0x1c')],function(_0x332582){return{'model':db[_0x332582[_0xbe3b('0x1e')]],'as':_0x332582['as'],'attributes':_0x332582[_0xbe3b('0x1a')],'include':_0x332582[_0xbe3b('0x1c')]?_[_0xbe3b('0x1d')](_0x332582['include'],function(_0x5476ed){return{'model':db[_0x5476ed['model']],'as':_0x5476ed['as'],'attributes':_0x5476ed[_0xbe3b('0x1a')],'include':_0x5476ed['include']?_['map'](_0x5476ed[_0xbe3b('0x1c')],function(_0x1c5c84){return{'model':db[_0x1c5c84['model']],'as':_0x1c5c84['as'],'attributes':_0x1c5c84['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x4c6519){var _0x80a9fe=[];for(var _0x2b6ddb=0x0;_0x2b6ddb<_0x4c6519[_0xbe3b('0x32')];_0x2b6ddb+=0x1){_0x80a9fe[_0xbe3b('0x34')](_0x4c6519[_0x2b6ddb][_0xbe3b('0x27')](_0x135df3[_0xbe3b('0x25')],{'transaction':_0x1e4b51}));}return BPromise[_0xbe3b('0x35')](_0x80a9fe);});})[_0xbe3b('0x1f')](function(_0x16c0da){logger[_0xbe3b('0xe')]('GetContactRecallMe',_0x135df3);logger[_0xbe3b('0x10')]('GetContactRecallMe',_0x135df3,JSON[_0xbe3b('0x12')](_0x16c0da));_0x18b39d(_0x16c0da);})[_0xbe3b('0x26')](function(_0x459f18){logger[_0xbe3b('0x14')](_0xbe3b('0x42'),_0x459f18[_0xbe3b('0x13')],_0x135df3);_0x5834b2(_0x23e50d[_0xbe3b('0x14')](0x1f4,_0x459f18['message']));});});});};exports['GetCmHopperPreview']=function(_0x49bb14){var _0x54a77d=this;return new Promise(function(_0x3df3b0,_0x109ec5){db[_0xbe3b('0x2c')][_0xbe3b('0x2d')]()[_0xbe3b('0x1f')](function(_0x4f1adf){return db[_0xbe3b('0x17')][_0xbe3b('0x18')]({'raw':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14['options'][_0xbe3b('0x22')]===undefined?!![]:![]:!![],'where':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14['options'][_0xbe3b('0x28')]||null:null,'attributes':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14['options']['attributes']||null:null,'limit':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14[_0xbe3b('0x19')][_0xbe3b('0x1b')]||null:null,'include':_0x49bb14[_0xbe3b('0x19')]?_0x49bb14[_0xbe3b('0x19')]['include']?_[_0xbe3b('0x1d')](_0x49bb14[_0xbe3b('0x19')]['include'],function(_0x1fd6eb){return{'model':db[_0x1fd6eb['model']],'as':_0x1fd6eb['as'],'attributes':_0x1fd6eb['as']===_0xbe3b('0x30')?_[_0xbe3b('0x45')](_0x4f1adf):_0x1fd6eb[_0xbe3b('0x1a')],'include':_0x1fd6eb['include']?_[_0xbe3b('0x1d')](_0x1fd6eb[_0xbe3b('0x1c')],function(_0x130475){return{'model':db[_0x130475[_0xbe3b('0x1e')]],'as':_0x130475['as'],'attributes':_0x130475[_0xbe3b('0x1a')],'include':_0x130475['include']?_[_0xbe3b('0x1d')](_0x130475[_0xbe3b('0x1c')],function(_0x2d774b){return{'model':db[_0x2d774b[_0xbe3b('0x1e')]],'as':_0x2d774b['as'],'attributes':_0x2d774b[_0xbe3b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbe3b('0x1f')](function(_0x148a61){logger['info'](_0xbe3b('0x16'),_0x49bb14);logger[_0xbe3b('0x10')](_0xbe3b('0x16'),_0x49bb14,JSON['stringify'](_0x148a61));_0x3df3b0(_0x148a61);})['catch'](function(_0x3ec968){logger[_0xbe3b('0x14')](_0xbe3b('0x16'),_0x3ec968[_0xbe3b('0x13')],_0x49bb14);_0x109ec5(_0x54a77d[_0xbe3b('0x14')](0x1f4,_0x3ec968['message']));});});});};
\ No newline at end of file
index 2dd557c..32c8ab4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fcb=['getPreview','/:id','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getOpenContacts','show','post'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0x6fcb,0xba));var _0xb6fc=function(_0x481ac7,_0x248f30){_0x481ac7=_0x481ac7-0x0;var _0x58a85d=_0x6fcb[_0x481ac7];return _0x58a85d;};'use strict';var multer=require(_0xb6fc('0x0'));var util=require('util');var path=require(_0xb6fc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb6fc('0x2')]();var fs_extra=require(_0xb6fc('0x3'));var auth=require(_0xb6fc('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb6fc('0x5'));router[_0xb6fc('0x6')]('/',auth[_0xb6fc('0x7')](),controller[_0xb6fc('0x8')]);router[_0xb6fc('0x6')](_0xb6fc('0x9'),auth[_0xb6fc('0x7')](),controller[_0xb6fc('0xa')]);router[_0xb6fc('0x6')]('/opencontacts',auth[_0xb6fc('0x7')](),controller[_0xb6fc('0xb')]);router[_0xb6fc('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xb6fc('0xc')]);router[_0xb6fc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb6fc('0xd')]('/preview',auth[_0xb6fc('0x7')](),controller[_0xb6fc('0xe')]);router['put'](_0xb6fc('0xf'),auth[_0xb6fc('0x7')](),controller[_0xb6fc('0x10')]);router[_0xb6fc('0x11')](_0xb6fc('0xf'),auth['isAuthenticated'](),controller[_0xb6fc('0x12')]);module[_0xb6fc('0x13')]=router;
\ No newline at end of file
+var _0x9953=['exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','getPreview','put','update','delete','destroy'];(function(_0xf4afc6,_0x2e4df2){var _0x40c468=function(_0x41205b){while(--_0x41205b){_0xf4afc6['push'](_0xf4afc6['shift']());}};_0x40c468(++_0x2e4df2);}(_0x9953,0x14b));var _0x3995=function(_0x422d6a,_0x20d24f){_0x422d6a=_0x422d6a-0x0;var _0x3bff4b=_0x9953[_0x422d6a];return _0x3bff4b;};'use strict';var multer=require('multer');var util=require(_0x3995('0x0'));var path=require(_0x3995('0x1'));var timeout=require('connect-timeout');var express=require(_0x3995('0x2'));var router=express['Router']();var fs_extra=require(_0x3995('0x3'));var auth=require(_0x3995('0x4'));var interaction=require(_0x3995('0x5'));var config=require(_0x3995('0x6'));var controller=require(_0x3995('0x7'));router[_0x3995('0x8')]('/',auth['isAuthenticated'](),controller[_0x3995('0x9')]);router[_0x3995('0x8')](_0x3995('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x3995('0x8')]('/opencontacts',auth[_0x3995('0xb')](),controller['getOpenContacts']);router[_0x3995('0x8')](_0x3995('0xc'),auth[_0x3995('0xb')](),controller[_0x3995('0xd')]);router[_0x3995('0xe')]('/',auth[_0x3995('0xb')](),controller[_0x3995('0xf')]);router[_0x3995('0xe')]('/preview',auth[_0x3995('0xb')](),controller[_0x3995('0x10')]);router[_0x3995('0x11')](_0x3995('0xc'),auth[_0x3995('0xb')](),controller[_0x3995('0x12')]);router[_0x3995('0x13')](_0x3995('0xc'),auth[_0x3995('0xb')](),controller[_0x3995('0x14')]);module[_0x3995('0x15')]=router;
\ No newline at end of file
index faa77fc..52e7dfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35c8=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x35c8,0xa6));var _0x835c=function(_0x2e425d,_0x465908){_0x2e425d=_0x2e425d-0x0;var _0x44965f=_0x35c8[_0x2e425d];return _0x44965f;};'use strict';var moment=require(_0x835c('0x0'));var Sequelize=require(_0x835c('0x1'));module[_0x835c('0x2')]={'phone':{'type':Sequelize[_0x835c('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x835c('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x835c('0x5')},'VoiceQueueId':{'type':Sequelize[_0x835c('0x4')],'unique':_0x835c('0x5')}};
\ No newline at end of file
+var _0x6c32=['contactListQueue','moment','exports','INTEGER'];(function(_0x182e6f,_0x57b3ab){var _0x57429f=function(_0x50bcc5){while(--_0x50bcc5){_0x182e6f['push'](_0x182e6f['shift']());}};_0x57429f(++_0x57b3ab);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x26c3('0x0'));var Sequelize=require('sequelize');module[_0x26c3('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x26c3('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x26c3('0x2')],'unique':_0x26c3('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}};
\ No newline at end of file
index cf0e281..784cc72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9540=['intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','count','apply','update','destroy','then','error','stack','name','send','map','CmHopperBlack','fieldName','key','model','query','keys','filters'];(function(_0x5f4e16,_0x502be0){var _0x14989e=function(_0x3e7bf3){while(--_0x3e7bf3){_0x5f4e16['push'](_0x5f4e16['shift']());}};_0x14989e(++_0x502be0);}(_0x9540,0xdb));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0954('0x0'));var rimraf=require(_0x0954('0x1'));var zipdir=require(_0x0954('0x2'));var jsonpatch=require(_0x0954('0x3'));var rp=require('request-promise');var moment=require(_0x0954('0x4'));var BPromise=require(_0x0954('0x5'));var Mustache=require('mustache');var util=require(_0x0954('0x6'));var path=require(_0x0954('0x7'));var sox=require('sox');var csv=require(_0x0954('0x8'));var ejs=require(_0x0954('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0954('0xa'));var squel=require(_0x0954('0xb'));var crypto=require(_0x0954('0xc'));var jsforce=require(_0x0954('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0954('0x8'));var querystring=require(_0x0954('0xe'));var Papa=require('papaparse');var Redis=require(_0x0954('0xf'));var authService=require(_0x0954('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0954('0x11'));var hardwareService=require(_0x0954('0x12'));var logger=require(_0x0954('0x13'))('api');var utils=require(_0x0954('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x280797,_0x5f525f){_0x5f525f=_0x5f525f||0xcc;return function(_0x53dc8b){if(_0x53dc8b){return _0x280797[_0x0954('0x15')](_0x5f525f);}return _0x280797[_0x0954('0x16')](_0x5f525f)[_0x0954('0x17')]();};}function respondWithResult(_0x10ad65,_0x499afc){_0x499afc=_0x499afc||0xc8;return function(_0x285822){if(_0x285822){return _0x10ad65['status'](_0x499afc)[_0x0954('0x18')](_0x285822);}};}function respondWithFilteredResult(_0x282544,_0x29e824){return function(_0x5675a5){if(_0x5675a5){var _0x329823=typeof _0x29e824[_0x0954('0x19')]==='undefined'&&typeof _0x29e824[_0x0954('0x1a')]===_0x0954('0x1b');var _0x4cd69e=_0x5675a5[_0x0954('0x1c')];var _0x14c28e=_0x329823?0x0:_0x29e824[_0x0954('0x19')];var _0x36ee29=_0x329823?_0x5675a5[_0x0954('0x1c')]:_0x29e824[_0x0954('0x19')]+_0x29e824[_0x0954('0x1a')];var _0x2253d4;if(_0x36ee29>=_0x4cd69e){_0x36ee29=_0x4cd69e;_0x2253d4=0xc8;}else{_0x2253d4=0xce;}_0x282544[_0x0954('0x16')](_0x2253d4);return _0x282544['set']('Content-Range',_0x14c28e+'-'+_0x36ee29+'/'+_0x4cd69e)[_0x0954('0x18')](_0x5675a5);}return null;};}function patchUpdates(_0x322479){return function(_0x21a364){try{jsonpatch[_0x0954('0x1d')](_0x21a364,_0x322479,!![]);}catch(_0x42bb55){return BPromise['reject'](_0x42bb55);}return _0x21a364['save']();};}function saveUpdates(_0x229421,_0x5727d6){return function(_0x55e2ef){if(_0x55e2ef){return _0x55e2ef[_0x0954('0x1e')](_0x229421)['then'](function(_0x317052){return _0x317052;});}return null;};}function removeEntity(_0x114d42,_0x25f2ec){return function(_0x5962ce){if(_0x5962ce){return _0x5962ce[_0x0954('0x1f')]()[_0x0954('0x20')](function(){_0x114d42[_0x0954('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7f14,_0x434335){return function(_0x56cdb1){if(!_0x56cdb1){_0x3e7f14[_0x0954('0x15')](0x194);}return _0x56cdb1;};}function handleError(_0x4656f8,_0x5810c3){_0x5810c3=_0x5810c3||0x1f4;return function(_0x1bb42d){logger[_0x0954('0x21')](_0x1bb42d[_0x0954('0x22')]);if(_0x1bb42d['name']){delete _0x1bb42d[_0x0954('0x23')];}_0x4656f8[_0x0954('0x16')](_0x5810c3)[_0x0954('0x24')](_0x1bb42d);};}exports['index']=function(_0x38a9b0,_0x1969c9){var _0x4c593a={},_0x2d97be={},_0x2dd327={'count':0x0,'rows':[]};var _0x32ff4e=_[_0x0954('0x25')](db[_0x0954('0x26')]['rawAttributes'],function(_0x1118a2){return{'name':_0x1118a2[_0x0954('0x27')],'type':_0x1118a2['type'][_0x0954('0x28')]};});_0x2d97be[_0x0954('0x29')]=_[_0x0954('0x25')](_0x32ff4e,'name');_0x2d97be[_0x0954('0x2a')]=_[_0x0954('0x2b')](_0x38a9b0['query']);_0x2d97be[_0x0954('0x2c')]=_[_0x0954('0x2d')](_0x2d97be['model'],_0x2d97be[_0x0954('0x2a')]);_0x4c593a[_0x0954('0x2e')]=_[_0x0954('0x2d')](_0x2d97be[_0x0954('0x29')],qs[_0x0954('0x2f')](_0x38a9b0[_0x0954('0x2a')][_0x0954('0x2f')]));_0x4c593a[_0x0954('0x2e')]=_0x4c593a[_0x0954('0x2e')]['length']?_0x4c593a[_0x0954('0x2e')]:_0x2d97be[_0x0954('0x29')];if(!_0x38a9b0['query']['hasOwnProperty'](_0x0954('0x30'))){_0x4c593a[_0x0954('0x1a')]=qs[_0x0954('0x1a')](_0x38a9b0[_0x0954('0x2a')][_0x0954('0x1a')]);_0x4c593a['offset']=qs[_0x0954('0x19')](_0x38a9b0[_0x0954('0x2a')][_0x0954('0x19')]);}_0x4c593a[_0x0954('0x31')]=qs[_0x0954('0x32')](_0x38a9b0[_0x0954('0x2a')][_0x0954('0x32')]);_0x4c593a[_0x0954('0x33')]=qs[_0x0954('0x2c')](_[_0x0954('0x34')](_0x38a9b0[_0x0954('0x2a')],_0x2d97be[_0x0954('0x2c')]),_0x32ff4e);if(_0x38a9b0[_0x0954('0x2a')][_0x0954('0x35')]){_0x4c593a[_0x0954('0x33')]=_[_0x0954('0x36')](_0x4c593a[_0x0954('0x33')],{'$or':_['map'](_0x32ff4e,function(_0x5f322b){if(_0x5f322b['type']!==_0x0954('0x37')){var _0x2191c7={};_0x2191c7[_0x5f322b[_0x0954('0x23')]]={'$like':'%'+_0x38a9b0['query'][_0x0954('0x35')]+'%'};return _0x2191c7;}})});}_0x4c593a=_[_0x0954('0x36')]({},_0x4c593a,_0x38a9b0[_0x0954('0x38')]);var _0x14c87e={'where':_0x4c593a[_0x0954('0x33')]};return db[_0x0954('0x26')][_0x0954('0x1c')](_0x14c87e)[_0x0954('0x20')](function(_0x45988f){_0x2dd327['count']=_0x45988f;if(_0x38a9b0[_0x0954('0x2a')][_0x0954('0x39')]){_0x4c593a[_0x0954('0x3a')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0954('0x3b')](_0x4c593a);})['then'](function(_0x3575e7){_0x2dd327[_0x0954('0x3c')]=_0x3575e7;return _0x2dd327;})[_0x0954('0x20')](respondWithFilteredResult(_0x1969c9,_0x4c593a))[_0x0954('0x3d')](handleError(_0x1969c9,null));};exports['show']=function(_0x3b9994,_0x140f42){var _0x2af519={'raw':!![],'where':{'id':_0x3b9994['params']['id']}},_0x194f9c={};_0x194f9c[_0x0954('0x29')]=_['keys'](db[_0x0954('0x26')]['rawAttributes']);_0x194f9c[_0x0954('0x2a')]=_[_0x0954('0x2b')](_0x3b9994[_0x0954('0x2a')]);_0x194f9c[_0x0954('0x2c')]=_[_0x0954('0x2d')](_0x194f9c[_0x0954('0x29')],_0x194f9c['query']);_0x2af519[_0x0954('0x2e')]=_[_0x0954('0x2d')](_0x194f9c[_0x0954('0x29')],qs[_0x0954('0x2f')](_0x3b9994[_0x0954('0x2a')][_0x0954('0x2f')]));_0x2af519[_0x0954('0x2e')]=_0x2af519['attributes']['length']?_0x2af519[_0x0954('0x2e')]:_0x194f9c[_0x0954('0x29')];if(_0x3b9994[_0x0954('0x2a')][_0x0954('0x39')]){_0x2af519[_0x0954('0x3a')]=[{'all':!![]}];}_0x2af519=_[_0x0954('0x36')]({},_0x2af519,_0x3b9994[_0x0954('0x38')]);return db[_0x0954('0x26')][_0x0954('0x3e')](_0x2af519)[_0x0954('0x20')](handleEntityNotFound(_0x140f42,null))[_0x0954('0x20')](respondWithResult(_0x140f42,null))[_0x0954('0x3d')](handleError(_0x140f42,null));};exports[_0x0954('0x1e')]=function(_0x330440,_0x19090d){if(_0x330440[_0x0954('0x3f')]['id']){delete _0x330440[_0x0954('0x3f')]['id'];}return db[_0x0954('0x26')][_0x0954('0x3e')]({'where':{'id':_0x330440[_0x0954('0x40')]['id']}})[_0x0954('0x20')](handleEntityNotFound(_0x19090d,null))['then'](saveUpdates(_0x330440['body'],null))[_0x0954('0x20')](respondWithResult(_0x19090d,null))[_0x0954('0x3d')](handleError(_0x19090d,null));};exports[_0x0954('0x1f')]=function(_0x4ba07d,_0x4a740c){return db[_0x0954('0x26')][_0x0954('0x3e')]({'where':{'id':_0x4ba07d[_0x0954('0x40')]['id']}})[_0x0954('0x20')](handleEntityNotFound(_0x4a740c,null))[_0x0954('0x20')](removeEntity(_0x4a740c,null))[_0x0954('0x3d')](handleError(_0x4a740c,null));};exports[_0x0954('0x41')]=function(_0x1e2abc,_0x294393){return db[_0x0954('0x26')]['describe']()[_0x0954('0x20')](respondWithResult(_0x294393,null))['catch'](handleError(_0x294393,null));};
\ No newline at end of file
+var _0xe476=['api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','then','error','stack','name','send','index','map','fieldName','type','keys','filters','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','options','includeAll','findAll','rows','catch','show','params','CmHopperBlack','rawAttributes','intersection','merge','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2ef8c1,_0x2f72f4){var _0x288305=function(_0x56244b){while(--_0x56244b){_0x2ef8c1['push'](_0x2ef8c1['shift']());}};_0x288305(++_0x2f72f4);}(_0xe476,0x74));var _0x6e47=function(_0x3625cf,_0x4a7c01){_0x3625cf=_0x3625cf-0x0;var _0x11b6b=_0xe476[_0x3625cf];return _0x11b6b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e47('0x0'));var zipdir=require(_0x6e47('0x1'));var jsonpatch=require(_0x6e47('0x2'));var rp=require(_0x6e47('0x3'));var moment=require('moment');var BPromise=require(_0x6e47('0x4'));var Mustache=require('mustache');var util=require(_0x6e47('0x5'));var path=require(_0x6e47('0x6'));var sox=require(_0x6e47('0x7'));var csv=require(_0x6e47('0x8'));var ejs=require(_0x6e47('0x9'));var fs=require('fs');var fs_extra=require(_0x6e47('0xa'));var _=require(_0x6e47('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6e47('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e47('0x8'));var querystring=require('querystring');var Papa=require(_0x6e47('0xd'));var Redis=require(_0x6e47('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6e47('0xf'));var as=require(_0x6e47('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e47('0x11'))(_0x6e47('0x12'));var utils=require('../../config/utils');var config=require(_0x6e47('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e47('0x14'))['db'];function respondWithStatusCode(_0xa38b82,_0x1eb4ad){_0x1eb4ad=_0x1eb4ad||0xcc;return function(_0x5f2dd2){if(_0x5f2dd2){return _0xa38b82[_0x6e47('0x15')](_0x1eb4ad);}return _0xa38b82[_0x6e47('0x16')](_0x1eb4ad)[_0x6e47('0x17')]();};}function respondWithResult(_0x29583a,_0x516c94){_0x516c94=_0x516c94||0xc8;return function(_0x5ee32c){if(_0x5ee32c){return _0x29583a[_0x6e47('0x16')](_0x516c94)[_0x6e47('0x18')](_0x5ee32c);}};}function respondWithFilteredResult(_0x4f135c,_0x4bcaa8){return function(_0x2f666d){if(_0x2f666d){var _0xe600d6=typeof _0x4bcaa8[_0x6e47('0x19')]===_0x6e47('0x1a')&&typeof _0x4bcaa8[_0x6e47('0x1b')]===_0x6e47('0x1a');var _0x902b8=_0x2f666d[_0x6e47('0x1c')];var _0x1863f0=_0xe600d6?0x0:_0x4bcaa8[_0x6e47('0x19')];var _0x1620ef=_0xe600d6?_0x2f666d[_0x6e47('0x1c')]:_0x4bcaa8[_0x6e47('0x19')]+_0x4bcaa8['limit'];var _0xc144f5;if(_0x1620ef>=_0x902b8){_0x1620ef=_0x902b8;_0xc144f5=0xc8;}else{_0xc144f5=0xce;}_0x4f135c[_0x6e47('0x16')](_0xc144f5);return _0x4f135c[_0x6e47('0x1d')]('Content-Range',_0x1863f0+'-'+_0x1620ef+'/'+_0x902b8)['json'](_0x2f666d);}return null;};}function patchUpdates(_0x37d9a1){return function(_0x5d66f5){try{jsonpatch['apply'](_0x5d66f5,_0x37d9a1,!![]);}catch(_0x5f7774){return BPromise[_0x6e47('0x1e')](_0x5f7774);}return _0x5d66f5[_0x6e47('0x1f')]();};}function saveUpdates(_0x29cdab,_0x24a1c9){return function(_0x57bff2){if(_0x57bff2){return _0x57bff2['update'](_0x29cdab)['then'](function(_0x2c0fbf){return _0x2c0fbf;});}return null;};}function removeEntity(_0x5d7b2a,_0x6c5a47){return function(_0x711f5f){if(_0x711f5f){return _0x711f5f[_0x6e47('0x20')]()[_0x6e47('0x21')](function(){_0x5d7b2a[_0x6e47('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e5f7c,_0x41c74a){return function(_0x29f1db){if(!_0x29f1db){_0x4e5f7c[_0x6e47('0x15')](0x194);}return _0x29f1db;};}function handleError(_0x15a2b5,_0x4f02eb){_0x4f02eb=_0x4f02eb||0x1f4;return function(_0x1daa0){logger[_0x6e47('0x22')](_0x1daa0[_0x6e47('0x23')]);if(_0x1daa0[_0x6e47('0x24')]){delete _0x1daa0[_0x6e47('0x24')];}_0x15a2b5[_0x6e47('0x16')](_0x4f02eb)[_0x6e47('0x25')](_0x1daa0);};}exports[_0x6e47('0x26')]=function(_0x1f541a,_0x2f9d62){var _0x385d30={},_0x1e43dc={},_0x2fdc5d={'count':0x0,'rows':[]};var _0x24ee91=_[_0x6e47('0x27')](db['CmHopperBlack']['rawAttributes'],function(_0x396eb0){return{'name':_0x396eb0[_0x6e47('0x28')],'type':_0x396eb0[_0x6e47('0x29')]['key']};});_0x1e43dc['model']=_[_0x6e47('0x27')](_0x24ee91,_0x6e47('0x24'));_0x1e43dc['query']=_[_0x6e47('0x2a')](_0x1f541a['query']);_0x1e43dc[_0x6e47('0x2b')]=_['intersection'](_0x1e43dc[_0x6e47('0x2c')],_0x1e43dc[_0x6e47('0x2d')]);_0x385d30[_0x6e47('0x2e')]=_['intersection'](_0x1e43dc[_0x6e47('0x2c')],qs[_0x6e47('0x2f')](_0x1f541a['query'][_0x6e47('0x2f')]));_0x385d30[_0x6e47('0x2e')]=_0x385d30[_0x6e47('0x2e')][_0x6e47('0x30')]?_0x385d30[_0x6e47('0x2e')]:_0x1e43dc['model'];if(!_0x1f541a[_0x6e47('0x2d')][_0x6e47('0x31')](_0x6e47('0x32'))){_0x385d30[_0x6e47('0x1b')]=qs[_0x6e47('0x1b')](_0x1f541a[_0x6e47('0x2d')][_0x6e47('0x1b')]);_0x385d30[_0x6e47('0x19')]=qs[_0x6e47('0x19')](_0x1f541a[_0x6e47('0x2d')]['offset']);}_0x385d30['order']=qs[_0x6e47('0x33')](_0x1f541a['query'][_0x6e47('0x33')]);_0x385d30['where']=qs[_0x6e47('0x2b')](_['pick'](_0x1f541a['query'],_0x1e43dc['filters']),_0x24ee91);if(_0x1f541a[_0x6e47('0x2d')]['filter']){_0x385d30[_0x6e47('0x34')]=_['merge'](_0x385d30['where'],{'$or':_['map'](_0x24ee91,function(_0x210cc0){if(_0x210cc0['type']!=='VIRTUAL'){var _0x4a1456={};_0x4a1456[_0x210cc0['name']]={'$like':'%'+_0x1f541a[_0x6e47('0x2d')]['filter']+'%'};return _0x4a1456;}})});}_0x385d30=_['merge']({},_0x385d30,_0x1f541a[_0x6e47('0x35')]);var _0x52dc62={'where':_0x385d30[_0x6e47('0x34')]};return db['CmHopperBlack'][_0x6e47('0x1c')](_0x52dc62)[_0x6e47('0x21')](function(_0x37ca7f){_0x2fdc5d[_0x6e47('0x1c')]=_0x37ca7f;if(_0x1f541a[_0x6e47('0x2d')][_0x6e47('0x36')]){_0x385d30['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6e47('0x37')](_0x385d30);})['then'](function(_0x232d5d){_0x2fdc5d[_0x6e47('0x38')]=_0x232d5d;return _0x2fdc5d;})[_0x6e47('0x21')](respondWithFilteredResult(_0x2f9d62,_0x385d30))[_0x6e47('0x39')](handleError(_0x2f9d62,null));};exports[_0x6e47('0x3a')]=function(_0x4bf974,_0x4537eb){var _0x18a5e7={'raw':!![],'where':{'id':_0x4bf974[_0x6e47('0x3b')]['id']}},_0x59f9c2={};_0x59f9c2[_0x6e47('0x2c')]=_[_0x6e47('0x2a')](db[_0x6e47('0x3c')][_0x6e47('0x3d')]);_0x59f9c2['query']=_[_0x6e47('0x2a')](_0x4bf974[_0x6e47('0x2d')]);_0x59f9c2[_0x6e47('0x2b')]=_['intersection'](_0x59f9c2[_0x6e47('0x2c')],_0x59f9c2[_0x6e47('0x2d')]);_0x18a5e7[_0x6e47('0x2e')]=_[_0x6e47('0x3e')](_0x59f9c2[_0x6e47('0x2c')],qs[_0x6e47('0x2f')](_0x4bf974[_0x6e47('0x2d')][_0x6e47('0x2f')]));_0x18a5e7[_0x6e47('0x2e')]=_0x18a5e7['attributes'][_0x6e47('0x30')]?_0x18a5e7[_0x6e47('0x2e')]:_0x59f9c2[_0x6e47('0x2c')];if(_0x4bf974[_0x6e47('0x2d')][_0x6e47('0x36')]){_0x18a5e7['include']=[{'all':!![]}];}_0x18a5e7=_[_0x6e47('0x3f')]({},_0x18a5e7,_0x4bf974['options']);return db[_0x6e47('0x3c')][_0x6e47('0x40')](_0x18a5e7)[_0x6e47('0x21')](handleEntityNotFound(_0x4537eb,null))['then'](respondWithResult(_0x4537eb,null))[_0x6e47('0x39')](handleError(_0x4537eb,null));};exports['update']=function(_0x464341,_0xe8756e){if(_0x464341[_0x6e47('0x41')]['id']){delete _0x464341[_0x6e47('0x41')]['id'];}return db[_0x6e47('0x3c')][_0x6e47('0x40')]({'where':{'id':_0x464341[_0x6e47('0x3b')]['id']}})[_0x6e47('0x21')](handleEntityNotFound(_0xe8756e,null))['then'](saveUpdates(_0x464341[_0x6e47('0x41')],null))[_0x6e47('0x21')](respondWithResult(_0xe8756e,null))[_0x6e47('0x39')](handleError(_0xe8756e,null));};exports[_0x6e47('0x20')]=function(_0x3df9b5,_0x35d8d9){return db[_0x6e47('0x3c')][_0x6e47('0x40')]({'where':{'id':_0x3df9b5[_0x6e47('0x3b')]['id']}})[_0x6e47('0x21')](handleEntityNotFound(_0x35d8d9,null))['then'](removeEntity(_0x35d8d9,null))[_0x6e47('0x39')](handleError(_0x35d8d9,null));};exports[_0x6e47('0x42')]=function(_0x34ea22,_0x1fa1a4){return db[_0x6e47('0x3c')]['describe']()[_0x6e47('0x21')](respondWithResult(_0x1fa1a4,null))['catch'](handleError(_0x1fa1a4,null));};
\ No newline at end of file
index 62c0874..1419cca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9dd=['../../config/logger','api','bluebird','path','../../config/environment','exports','CmHopperBlack','lodash'];(function(_0x2e55c4,_0x1ed33d){var _0x11104c=function(_0x2b57f1){while(--_0x2b57f1){_0x2e55c4['push'](_0x2e55c4['shift']());}};_0x11104c(++_0x1ed33d);}(_0xd9dd,0x107));var _0xdd9d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9dd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdd9d('0x0'));var util=require('util');var logger=require(_0xdd9d('0x1'))(_0xdd9d('0x2'));var moment=require('moment');var BPromise=require(_0xdd9d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd9d('0x4'));var rimraf=require('rimraf');var config=require(_0xdd9d('0x5'));var attributes=require('./cmHopperBlack.attributes');module[_0xdd9d('0x6')]=function(_0x64b7e9,_0x18dade){return _0x64b7e9['define'](_0xdd9d('0x7'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3559=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','define'];(function(_0x5942e8,_0x152886){var _0x5f43cf=function(_0x47855a){while(--_0x47855a){_0x5942e8['push'](_0x5942e8['shift']());}};_0x5f43cf(++_0x152886);}(_0x3559,0x1be));var _0x9355=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3559[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9355('0x0'));var util=require(_0x9355('0x1'));var logger=require(_0x9355('0x2'))(_0x9355('0x3'));var moment=require(_0x9355('0x4'));var BPromise=require('bluebird');var rp=require(_0x9355('0x5'));var fs=require('fs');var path=require(_0x9355('0x6'));var rimraf=require('rimraf');var config=require(_0x9355('0x7'));var attributes=require(_0x9355('0x8'));module['exports']=function(_0x382ccf,_0xb801d7){return _0x382ccf[_0x9355('0x9')](_0x9355('0xa'),attributes,{'tableName':_0x9355('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 84c7d72..e4b996f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb008=['../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5e5154,_0x15b3f0){var _0x1232f4=function(_0xf3c033){while(--_0xf3c033){_0x5e5154['push'](_0x5e5154['shift']());}};_0x1232f4(++_0x15b3f0);}(_0xb008,0x128));var _0x8b00=function(_0x488104,_0x59071a){_0x488104=_0x488104-0x0;var _0x25c06d=_0xb008[_0x488104];return _0x25c06d;};'use strict';var _=require('lodash');var util=require(_0x8b00('0x0'));var moment=require('moment');var BPromise=require(_0x8b00('0x1'));var rs=require(_0x8b00('0x2'));var fs=require('fs');var Redis=require(_0x8b00('0x3'));var db=require(_0x8b00('0x4'))['db'];var utils=require(_0x8b00('0x5'));var logger=require(_0x8b00('0x6'))(_0x8b00('0x7'));var config=require(_0x8b00('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4edc1d,_0x21c618,_0x4124a7){return new BPromise(function(_0x265fff,_0x5abb04){return client[_0x8b00('0xa')](_0x4edc1d,_0x4124a7)[_0x8b00('0xb')](function(_0x169dc8){logger[_0x8b00('0xc')](_0x8b00('0xd'),_0x21c618,_0x8b00('0xe'));logger[_0x8b00('0xf')](_0x8b00('0x10'),_0x21c618,'request\x20sent',JSON[_0x8b00('0x11')](_0x169dc8));if(_0x169dc8['error']){if(_0x169dc8['error'][_0x8b00('0x12')]===0x1f4){logger[_0x8b00('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x21c618,_0x169dc8[_0x8b00('0x13')][_0x8b00('0x14')]);return _0x5abb04(_0x169dc8[_0x8b00('0x13')][_0x8b00('0x14')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x21c618,_0x169dc8[_0x8b00('0x13')][_0x8b00('0x14')]);return _0x265fff(_0x169dc8[_0x8b00('0x13')]['message']);}else{logger[_0x8b00('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x21c618,_0x8b00('0xe'));_0x265fff(_0x169dc8['result']['message']);}})[_0x8b00('0x15')](function(_0x580bce){logger[_0x8b00('0x13')](_0x8b00('0xd'),_0x21c618,_0x580bce);_0x5abb04(_0x580bce);});});}exports[_0x8b00('0x16')]=function(_0x72104c){var _0x327ce2=this;return new Promise(function(_0x5e92a,_0x1c6195){return db['CmHopperBlack'][_0x8b00('0x17')]({'raw':_0x72104c[_0x8b00('0x18')]?_0x72104c[_0x8b00('0x18')][_0x8b00('0x19')]===undefined?!![]:![]:!![],'where':_0x72104c[_0x8b00('0x18')]?_0x72104c['options'][_0x8b00('0x1a')]||null:null,'attributes':_0x72104c[_0x8b00('0x18')]?_0x72104c[_0x8b00('0x18')][_0x8b00('0x1b')]||null:null,'limit':_0x72104c[_0x8b00('0x18')]?_0x72104c[_0x8b00('0x18')][_0x8b00('0x1c')]||null:null,'include':_0x72104c[_0x8b00('0x18')]?_0x72104c[_0x8b00('0x18')][_0x8b00('0x1d')]?_[_0x8b00('0x1e')](_0x72104c[_0x8b00('0x18')]['include'],function(_0x57db79){return{'model':db[_0x57db79[_0x8b00('0x1f')]],'as':_0x57db79['as'],'attributes':_0x57db79[_0x8b00('0x1b')],'include':_0x57db79[_0x8b00('0x1d')]?_[_0x8b00('0x1e')](_0x57db79[_0x8b00('0x1d')],function(_0x43e948){return{'model':db[_0x43e948['model']],'as':_0x43e948['as'],'attributes':_0x43e948[_0x8b00('0x1b')],'include':_0x43e948[_0x8b00('0x1d')]?_['map'](_0x43e948[_0x8b00('0x1d')],function(_0x17c1ca){return{'model':db[_0x17c1ca[_0x8b00('0x1f')]],'as':_0x17c1ca['as'],'attributes':_0x17c1ca['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b00('0xb')](function(_0x314c20){logger[_0x8b00('0xc')](_0x8b00('0x16'),_0x72104c);logger['debug']('GetCmHopperBlack',_0x72104c,JSON[_0x8b00('0x11')](_0x314c20));_0x5e92a(_0x314c20);})[_0x8b00('0x15')](function(_0x2d17e2){logger['error'](_0x8b00('0x16'),_0x2d17e2['message'],_0x72104c);_0x1c6195(_0x327ce2['error'](0x1f4,_0x2d17e2['message']));});});};exports[_0x8b00('0x20')]=function(_0x35dd7f){var _0x18ac1a=this;return new Promise(function(_0x45168f,_0x5af61c){return db[_0x8b00('0x21')][_0x8b00('0x22')](_0x35dd7f[_0x8b00('0x23')],{'raw':_0x35dd7f[_0x8b00('0x18')]?_0x35dd7f[_0x8b00('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35dd7f[_0x8b00('0x18')]?_0x35dd7f[_0x8b00('0x18')][_0x8b00('0x1a')]||null:null,'attributes':_0x35dd7f['options']?_0x35dd7f[_0x8b00('0x18')][_0x8b00('0x1b')]||null:null,'limit':_0x35dd7f[_0x8b00('0x18')]?_0x35dd7f[_0x8b00('0x18')][_0x8b00('0x1c')]||null:null})[_0x8b00('0xb')](function(_0x53cd56){logger[_0x8b00('0xc')](_0x8b00('0x20'),_0x35dd7f);logger['debug'](_0x8b00('0x20'),_0x35dd7f,JSON['stringify'](_0x53cd56));_0x45168f(_0x53cd56);})[_0x8b00('0x15')](function(_0x31066d){logger[_0x8b00('0x13')](_0x8b00('0x20'),_0x31066d[_0x8b00('0x14')],_0x35dd7f);_0x5af61c(_0x18ac1a['error'](0x1f4,_0x31066d[_0x8b00('0x14')]));});});};exports[_0x8b00('0x24')]=function(_0x482acd){var _0x5afc8a=this;return new Promise(function(_0x11cf4f,_0x415926){return db['CmHopperBlack'][_0x8b00('0x25')]({'where':_0x482acd[_0x8b00('0x18')]?_0x482acd[_0x8b00('0x18')][_0x8b00('0x1a')]||null:null})[_0x8b00('0xb')](function(_0x468d60){logger['info'](_0x8b00('0x24'),_0x482acd);logger[_0x8b00('0xf')](_0x8b00('0x24'),_0x482acd,JSON[_0x8b00('0x11')](_0x468d60));_0x11cf4f(_0x468d60);})[_0x8b00('0x15')](function(_0x38cfb2){logger[_0x8b00('0x13')](_0x8b00('0x24'),_0x38cfb2[_0x8b00('0x14')],_0x482acd);_0x415926(_0x5afc8a[_0x8b00('0x13')](0x1f4,_0x38cfb2[_0x8b00('0x14')]));});});};
\ No newline at end of file
+var _0xc2a2=['findAll','options','raw','where','attributes','include','map','model','then','info','catch','update','body','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCmHopperBlack','CmHopperBlack'];(function(_0x10d100,_0x26d4a5){var _0x1d300d=function(_0x5cf8b2){while(--_0x5cf8b2){_0x10d100['push'](_0x10d100['shift']());}};_0x1d300d(++_0x26d4a5);}(_0xc2a2,0x182));var _0x2c2a=function(_0xce822d,_0x437f44){_0xce822d=_0xce822d-0x0;var _0x2aece5=_0xc2a2[_0xce822d];return _0x2aece5;};'use strict';var _=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var moment=require('moment');var BPromise=require(_0x2c2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c2a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c2a('0x4'));var logger=require(_0x2c2a('0x5'))(_0x2c2a('0x6'));var config=require(_0x2c2a('0x7'));var jayson=require(_0x2c2a('0x8'));var client=jayson[_0x2c2a('0x9')][_0x2c2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32ebfc,_0x9b687,_0x5058d8){return new BPromise(function(_0x19300a,_0x41c599){return client[_0x2c2a('0xb')](_0x32ebfc,_0x5058d8)['then'](function(_0x4cc0ba){logger['info'](_0x2c2a('0xc'),_0x9b687,_0x2c2a('0xd'));logger[_0x2c2a('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x9b687,_0x2c2a('0xd'),JSON[_0x2c2a('0xf')](_0x4cc0ba));if(_0x4cc0ba['error']){if(_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x11')]===0x1f4){logger['error'](_0x2c2a('0xc'),_0x9b687,_0x4cc0ba[_0x2c2a('0x10')]['message']);return _0x41c599(_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x12')]);}logger[_0x2c2a('0x10')](_0x2c2a('0xc'),_0x9b687,_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x12')]);return _0x19300a(_0x4cc0ba[_0x2c2a('0x10')][_0x2c2a('0x12')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x9b687,_0x2c2a('0xd'));_0x19300a(_0x4cc0ba['result'][_0x2c2a('0x12')]);}})['catch'](function(_0x1ff6a2){logger[_0x2c2a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x9b687,_0x1ff6a2);_0x41c599(_0x1ff6a2);});});}exports[_0x2c2a('0x13')]=function(_0xede4f2){var _0x23655e=this;return new Promise(function(_0x404dbe,_0x45ca14){return db[_0x2c2a('0x14')][_0x2c2a('0x15')]({'raw':_0xede4f2[_0x2c2a('0x16')]?_0xede4f2['options'][_0x2c2a('0x17')]===undefined?!![]:![]:!![],'where':_0xede4f2['options']?_0xede4f2[_0x2c2a('0x16')][_0x2c2a('0x18')]||null:null,'attributes':_0xede4f2[_0x2c2a('0x16')]?_0xede4f2[_0x2c2a('0x16')][_0x2c2a('0x19')]||null:null,'limit':_0xede4f2['options']?_0xede4f2[_0x2c2a('0x16')]['limit']||null:null,'include':_0xede4f2['options']?_0xede4f2[_0x2c2a('0x16')][_0x2c2a('0x1a')]?_[_0x2c2a('0x1b')](_0xede4f2[_0x2c2a('0x16')]['include'],function(_0x541ce9){return{'model':db[_0x541ce9[_0x2c2a('0x1c')]],'as':_0x541ce9['as'],'attributes':_0x541ce9['attributes'],'include':_0x541ce9[_0x2c2a('0x1a')]?_['map'](_0x541ce9[_0x2c2a('0x1a')],function(_0x2db253){return{'model':db[_0x2db253['model']],'as':_0x2db253['as'],'attributes':_0x2db253[_0x2c2a('0x19')],'include':_0x2db253[_0x2c2a('0x1a')]?_['map'](_0x2db253['include'],function(_0x2871db){return{'model':db[_0x2871db[_0x2c2a('0x1c')]],'as':_0x2871db['as'],'attributes':_0x2871db[_0x2c2a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2c2a('0x1d')](function(_0x52c1e4){logger[_0x2c2a('0x1e')](_0x2c2a('0x13'),_0xede4f2);logger[_0x2c2a('0xe')]('GetCmHopperBlack',_0xede4f2,JSON[_0x2c2a('0xf')](_0x52c1e4));_0x404dbe(_0x52c1e4);})[_0x2c2a('0x1f')](function(_0x131bb8){logger[_0x2c2a('0x10')]('GetCmHopperBlack',_0x131bb8[_0x2c2a('0x12')],_0xede4f2);_0x45ca14(_0x23655e[_0x2c2a('0x10')](0x1f4,_0x131bb8[_0x2c2a('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x14625f){var _0x225ba9=this;return new Promise(function(_0x58486e,_0xb79511){return db[_0x2c2a('0x14')][_0x2c2a('0x20')](_0x14625f[_0x2c2a('0x21')],{'raw':_0x14625f[_0x2c2a('0x16')]?_0x14625f[_0x2c2a('0x16')][_0x2c2a('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14625f[_0x2c2a('0x16')]?_0x14625f[_0x2c2a('0x16')]['where']||null:null,'attributes':_0x14625f[_0x2c2a('0x16')]?_0x14625f[_0x2c2a('0x16')][_0x2c2a('0x19')]||null:null,'limit':_0x14625f[_0x2c2a('0x16')]?_0x14625f['options'][_0x2c2a('0x22')]||null:null})['then'](function(_0x4c43e0){logger[_0x2c2a('0x1e')](_0x2c2a('0x23'),_0x14625f);logger[_0x2c2a('0xe')](_0x2c2a('0x23'),_0x14625f,JSON[_0x2c2a('0xf')](_0x4c43e0));_0x58486e(_0x4c43e0);})['catch'](function(_0x2bdffa){logger[_0x2c2a('0x10')](_0x2c2a('0x23'),_0x2bdffa[_0x2c2a('0x12')],_0x14625f);_0xb79511(_0x225ba9[_0x2c2a('0x10')](0x1f4,_0x2bdffa['message']));});});};exports['DestroyCmHopperBlack']=function(_0x3eb8d9){var _0x55de24=this;return new Promise(function(_0x4220e2,_0x4894d0){return db['CmHopperBlack']['destroy']({'where':_0x3eb8d9['options']?_0x3eb8d9[_0x2c2a('0x16')]['where']||null:null})[_0x2c2a('0x1d')](function(_0x153de8){logger[_0x2c2a('0x1e')](_0x2c2a('0x24'),_0x3eb8d9);logger[_0x2c2a('0xe')]('DestroyCmHopperBlack',_0x3eb8d9,JSON[_0x2c2a('0xf')](_0x153de8));_0x4220e2(_0x153de8);})[_0x2c2a('0x1f')](function(_0x55c268){logger['error']('DestroyCmHopperBlack',_0x55c268[_0x2c2a('0x12')],_0x3eb8d9);_0x4894d0(_0x55de24[_0x2c2a('0x10')](0x1f4,_0x55c268['message']));});});};
\ No newline at end of file
index 2cb714e..3d166f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['multer','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy'];(function(_0x38ec20,_0x541343){var _0xdc1abf=function(_0x3242c9){while(--_0x3242c9){_0x38ec20['push'](_0x38ec20['shift']());}};_0xdc1abf(++_0x541343);}(_0xafc4,0x69));var _0x4afc=function(_0x56618b,_0x1d81b9){_0x56618b=_0x56618b-0x0;var _0x2d64f5=_0xafc4[_0x56618b];return _0x2d64f5;};'use strict';var multer=require(_0x4afc('0x0'));var util=require('util');var path=require(_0x4afc('0x1'));var timeout=require('connect-timeout');var express=require(_0x4afc('0x2'));var router=express[_0x4afc('0x3')]();var fs_extra=require(_0x4afc('0x4'));var auth=require(_0x4afc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x4afc('0x6')]('/',auth[_0x4afc('0x7')](),controller[_0x4afc('0x8')]);router[_0x4afc('0x6')](_0x4afc('0x9'),auth[_0x4afc('0x7')](),controller['describe']);router[_0x4afc('0x6')](_0x4afc('0xa'),auth[_0x4afc('0x7')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')](_0x4afc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4afc('0xd')]('/:id',auth[_0x4afc('0x7')](),controller[_0x4afc('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xfdbd=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','isAuthenticated','index','describe','get','show','put','/:id','update','delete','destroy'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3ac312,_0x5d3903){_0x3ac312=_0x3ac312-0x0;var _0x36b673=_0xfdbd[_0x3ac312];return _0x36b673;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var fs_extra=require(_0xdfdb('0x6'));var auth=require(_0xdfdb('0x7'));var interaction=require(_0xdfdb('0x8'));var config=require('../../config/environment');var controller=require(_0xdfdb('0x9'));router['get']('/',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0x10'),auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x11')]);router[_0xdfdb('0x12')]('/:id',auth[_0xdfdb('0xa')](),controller[_0xdfdb('0x13')]);module['exports']=router;
\ No newline at end of file
index bd07d10..2cb5d05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09fd=['setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x09fd,0x19d));var _0xd09f=function(_0x3ce8e1,_0x47cbdf){_0x3ce8e1=_0x3ce8e1-0x0;var _0x4b0b60=_0x09fd[_0x3ce8e1];return _0x4b0b60;};'use strict';var Sequelize=require(_0xd09f('0x0'));var moment=require(_0xd09f('0x1'));module['exports']={'state':{'type':Sequelize[_0xd09f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd09f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd09f('0x3')]},'originatecalleridname':{'type':Sequelize[_0xd09f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd09f('0x3')]},'starttime':{'type':Sequelize[_0xd09f('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xd09f('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd09f('0x4')]},'ringtime':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd09f('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd09f('0x3')]},'membername':{'type':Sequelize[_0xd09f('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xd09f('0x3')]},'secondDisposition':{'type':Sequelize[_0xd09f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd09f('0x3')]},'dispositionat':{'type':Sequelize[_0xd09f('0x4')],'set':function(_0x82c9d7){var _0x20a28e=this[_0xd09f('0x5')](_0xd09f('0x6'));if(_0x20a28e&&_0x82c9d7){this[_0xd09f('0x7')](_0xd09f('0x8'),moment(_0x82c9d7)[_0xd09f('0x9')](moment(_0x20a28e),_0xd09f('0xa')));}return this['setDataValue']('dispositionat',_0x82c9d7);}},'amd':{'type':Sequelize[_0xd09f('0xb')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd09f('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd09f('0x4')]},'callback':{'type':Sequelize[_0xd09f('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd09f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd09f('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd09f('0x4')]},'recallme':{'type':Sequelize[_0xd09f('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd09f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6c4b=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6c4b,0x93));var _0xb6c4=function(_0x41425c,_0x493768){_0x41425c=_0x41425c-0x0;var _0x21b2e2=_0x6c4b[_0x41425c];return _0x21b2e2;};'use strict';var Sequelize=require(_0xb6c4('0x0'));var moment=require(_0xb6c4('0x1'));module[_0xb6c4('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb6c4('0x3')]},'scheduledat':{'type':Sequelize[_0xb6c4('0x4')]},'countbusyretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb6c4('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb6c4('0x3')]},'starttime':{'type':Sequelize[_0xb6c4('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb6c4('0x4')]},'droptime':{'type':Sequelize[_0xb6c4('0x4')]},'endtime':{'type':Sequelize[_0xb6c4('0x4')]},'ringtime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xb6c4('0x3')]},'campaigntype':{'type':Sequelize[_0xb6c4('0x3')]},'membername':{'type':Sequelize[_0xb6c4('0x3')]},'reason':{'type':Sequelize[_0xb6c4('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb6c4('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb6c4('0x3')]},'dispositionat':{'type':Sequelize[_0xb6c4('0x4')],'set':function(_0x3c9d32){var _0x465416=this[_0xb6c4('0x6')](_0xb6c4('0x7'));if(_0x465416&&_0x3c9d32){this[_0xb6c4('0x8')]('followuptime',moment(_0x3c9d32)['diff'](moment(_0x465416),_0xb6c4('0x9')));}return this['setDataValue'](_0xb6c4('0xa'),_0x3c9d32);}},'amd':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb6c4('0x4')]},'callback':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb6c4('0x4')]},'deleted':{'type':Sequelize[_0xb6c4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb6c4('0x4')]},'recallme':{'type':Sequelize[_0xb6c4('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb6c4('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb6c4('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 8b62c2e..06e40cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','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','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x248dc8,_0x10c027){var _0x15aaee=function(_0xa53979){while(--_0xa53979){_0x248dc8['push'](_0x248dc8['shift']());}};_0x15aaee(++_0x10c027);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'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'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));};
\ No newline at end of file
+var _0x4c60=['include','findAll','rows','catch','show','includeAll','find','describe','update','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','answeringMachine','VoiceQueue','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','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','fromQuery','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum','CmHopper','findOne','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','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','CmHopperFinal','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x128e41,_0x2808d6){var _0x544908=function(_0x530fa2){while(--_0x530fa2){_0x128e41['push'](_0x128e41['shift']());}};_0x544908(++_0x2808d6);}(_0x4c60,0xc1));var _0x04c6=function(_0x494510,_0x1b999a){_0x494510=_0x494510-0x0;var _0x9773e1=_0x4c60[_0x494510];return _0x9773e1;};'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['CmHopperFinal'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['CmHopperFinal'][_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['CmHopperFinal'][_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['CmHopperFinal'][_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')]()['then'](respondWithResult(_0x4ef366,null))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0x2472ed,_0xee2822){if(_0x2472ed['body'][_0x04c6('0x44')]){delete _0x2472ed[_0x04c6('0x45')][_0x04c6('0x44')];}return db[_0x04c6('0x27')]['find']({'where':{'uniqueid':_0x2472ed[_0x04c6('0x46')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0xee2822,null))[_0x04c6('0x1f')](saveUpdates(_0x2472ed[_0x04c6('0x45')],null))['then'](respondWithResult(_0xee2822,null))[_0x04c6('0x3e')](handleError(_0xee2822,null));};exports[_0x04c6('0x47')]=function(_0x15ec61,_0x489361,_0x3119f0){return db[_0x04c6('0x27')][_0x04c6('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x15ec61[_0x04c6('0x46')]['id']},'attributes':[[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4b')))),_0x04c6('0x4c')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),_0x04c6('0x55')],[db[_0x04c6('0x48')]['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x56')))),'answeringMachine']]})[_0x04c6('0x1f')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x1f')](respondWithResult(_0x489361,null))[_0x04c6('0x3e')](handleError(_0x489361,null));};exports[_0x04c6('0x57')]=function(_0x28299e,_0x5b536f,_0xf073a8){return db[_0x04c6('0x27')]['findAll']({'raw':![],'where':{'CampaignId':_0x28299e[_0x04c6('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize']['literal'](_0x04c6('0x4b')))),'noSuchContacts'],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4d')))),_0x04c6('0x4e')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x4f')))),_0x04c6('0x50')],[db['sequelize']['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x04c6('0x58')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x59')))),_0x04c6('0x51')],[db[_0x04c6('0x48')]['fn'](_0x04c6('0x49'),db[_0x04c6('0x48')]['fn']('IF',db['sequelize'][_0x04c6('0x4a')](_0x04c6('0x52')))),_0x04c6('0x53')],[db['sequelize']['fn']('COUNT',db[_0x04c6('0x48')]['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x54')))),'reCallContacts'],[db[_0x04c6('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04c6('0x48')][_0x04c6('0x4a')](_0x04c6('0x56')))),_0x04c6('0x5a')]]})[_0x04c6('0x1f')](handleEntityNotFound(_0x5b536f,null))[_0x04c6('0x1f')](respondWithResult(_0x5b536f,null))[_0x04c6('0x3e')](handleError(_0x5b536f,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x31cc93,_0x1b6242,_0x1f5b9a){return db[_0x04c6('0x5b')][_0x04c6('0x41')]({'where':{'id':_0x31cc93['params']['id']}})['then'](handleEntityNotFound(_0x1b6242,null))[_0x04c6('0x1f')](function(_0x598941){var _0x2df63b;if(_0x598941){_0x2df63b=squel['insert']()[_0x04c6('0x5c')](_0x04c6('0x5d'))['fromQuery']([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x62'),_0x04c6('0x63'),_0x04c6('0x64')],squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),'scheduledAt')[_0x04c6('0x66')](_0x04c6('0x69'),'ContactId')[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))[_0x04c6('0x66')](_0x04c6('0x6b'),'VoiceQueueId')[_0x04c6('0x66')]('NOW()',_0x04c6('0x63'))['field'](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())[_0x04c6('0x35')]('state\x20=\x20?',_0x31cc93[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x04c6('0x35')](_0x04c6('0x71'),squel['select']()[_0x04c6('0x66')](_0x04c6('0x5e'))['from'](_0x04c6('0x5d'))[_0x04c6('0x35')]('VoiceQueueId\x20=\x20?',_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()['field']('calleridnum')['from'](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x6e'),_0x31cc93[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where'](_0x04c6('0x72')))[_0x04c6('0x73')](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db[_0x04c6('0x48')][_0x04c6('0x2b')](_0x2df63b);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x1b6242,null))['catch'](handleError(_0x1b6242,null));};exports[_0x04c6('0x74')]=function(_0x4f258c,_0x202761,_0x480c74){return db['Campaign'][_0x04c6('0x41')]({'where':{'id':_0x4f258c['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x202761,null))[_0x04c6('0x1f')](function(_0x174de6){var _0x425d01;if(_0x174de6){_0x425d01=squel[_0x04c6('0x75')]()['into']('cm_hopper')[_0x04c6('0x76')]([_0x04c6('0x5e'),_0x04c6('0x5f'),_0x04c6('0x60'),_0x04c6('0x61'),_0x04c6('0x77'),'createdAt',_0x04c6('0x64')],squel['select']()['field'](_0x04c6('0x67'),_0x04c6('0x5e'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x5f'))[_0x04c6('0x66')](_0x04c6('0x69'),_0x04c6('0x60'))[_0x04c6('0x66')](_0x04c6('0x6a'),_0x04c6('0x61'))['field'](_0x04c6('0x78'),'CampaignId')['field'](_0x04c6('0x68'),_0x04c6('0x63'))[_0x04c6('0x66')](_0x04c6('0x68'),_0x04c6('0x64'))[_0x04c6('0x6c')](_0x04c6('0x6d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x20?',_0x4f258c[_0x04c6('0x45')][_0x04c6('0x70')]['toString']())[_0x04c6('0x35')](_0x04c6('0x7a'))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x5e'))[_0x04c6('0x6c')](_0x04c6('0x5d'))[_0x04c6('0x35')](_0x04c6('0x79'),_0x4f258c['params']['id'][_0x04c6('0x6f')]()))['where'](_0x04c6('0x71'),squel[_0x04c6('0x65')]()[_0x04c6('0x66')](_0x04c6('0x7b'))[_0x04c6('0x6c')](_0x04c6('0x6d'))['where'](_0x04c6('0x79'),_0x4f258c[_0x04c6('0x46')]['id'][_0x04c6('0x6f')]())['where']('state\x20=\x204'))['group'](_0x04c6('0x60')))[_0x04c6('0x6f')]();return db['sequelize'][_0x04c6('0x2b')](_0x425d01);}return[];})[_0x04c6('0x1f')](respondWithResult(_0x202761,null))[_0x04c6('0x3e')](handleError(_0x202761,null));};exports['checkContactHopper']=function(_0x343c1f,_0x485457,_0x1c0c74){return db[_0x04c6('0x7c')][_0x04c6('0x7d')]({'where':{'VoiceQueueId':_0x343c1f['body']['VoiceQueueId'],'CampaignId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x77')],'ContactId':_0x343c1f[_0x04c6('0x45')][_0x04c6('0x60')]}})['then'](handleEntityNotFound(_0x485457,null))['then'](function(_0x3e12a4){if(_0x3e12a4){return _0x3e12a4;}return null;})[_0x04c6('0x1f')](respondWithResult(_0x485457,null))[_0x04c6('0x3e')](handleError(_0x485457,null));};
\ No newline at end of file
index cdd1be2..a21b366 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafa2=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','calleridnum','uniqueid'];(function(_0x5a039f,_0x2c6ee6){var _0x304d1d=function(_0x43e9a0){while(--_0x43e9a0){_0x5a039f['push'](_0x5a039f['shift']());}};_0x304d1d(++_0x2c6ee6);}(_0xafa2,0x104));var _0x2afa=function(_0x3fe4ff,_0x166795){_0x3fe4ff=_0x3fe4ff-0x0;var _0x4f66ac=_0xafa2[_0x3fe4ff];return _0x4f66ac;};'use strict';var _=require(_0x2afa('0x0'));var util=require(_0x2afa('0x1'));var logger=require(_0x2afa('0x2'))('api');var moment=require(_0x2afa('0x3'));var BPromise=require(_0x2afa('0x4'));var rp=require(_0x2afa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2afa('0x6'));var config=require(_0x2afa('0x7'));var attributes=require(_0x2afa('0x8'));module[_0x2afa('0x9')]=function(_0x17095b,_0x3bd407){return _0x17095b[_0x2afa('0xa')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x2afa('0xb'),'fields':['calleridnum']},{'name':_0x2afa('0xc'),'fields':[_0x2afa('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcab3=['bluebird','request-promise','rimraf','../../config/environment','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment'];(function(_0x172006,_0x5cca46){var _0x2802dc=function(_0x4a238f){while(--_0x4a238f){_0x172006['push'](_0x172006['shift']());}};_0x2802dc(++_0x5cca46);}(_0xcab3,0xb1));var _0x3cab=function(_0xe4e08f,_0x52b9d7){_0xe4e08f=_0xe4e08f-0x0;var _0x15507f=_0xcab3[_0xe4e08f];return _0x15507f;};'use strict';var _=require(_0x3cab('0x0'));var util=require(_0x3cab('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3cab('0x2'));var BPromise=require(_0x3cab('0x3'));var rp=require(_0x3cab('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3cab('0x5'));var config=require(_0x3cab('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x3cab('0x7')]=function(_0x10922b,_0x21dadf){return _0x10922b['define'](_0x3cab('0x8'),attributes,{'tableName':_0x3cab('0x9'),'paranoid':![],'indexes':[{'name':_0x3cab('0xa'),'fields':[_0x3cab('0xa')]},{'name':_0x3cab('0xb'),'fields':[_0x3cab('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 38b4fdf..d97a143 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(_0x5e54f0,_0x175223){var _0x45b1ca=function(_0x3c390c){while(--_0x3c390c){_0x5e54f0['push'](_0x5e54f0['shift']());}};_0x45b1ca(++_0x175223);}(_0xb10b,0x12a));var _0xbb10=function(_0x259449,_0x32f882){_0x259449=_0x259449-0x0;var _0x321ae4=_0xb10b[_0x259449];return _0x321ae4;};'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(_0x24756b,_0x3aa816){var _0x2c2ac4=function(_0x3b6c1a){while(--_0x3b6c1a){_0x24756b['push'](_0x24756b['shift']());}};_0x2c2ac4(++_0x3aa816);}(_0xb10b,0x12a));var _0xbb10=function(_0x133f81,_0x550e62){_0x133f81=_0x133f81-0x0;var _0x2eef30=_0xb10b[_0x133f81];return _0x2eef30;};'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 816a10b..1b2f568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb89=['../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xdb89,0xda));var _0x9db8=function(_0x3b9e8d,_0x1753ee){_0x3b9e8d=_0x3b9e8d-0x0;var _0x457559=_0xdb89[_0x3b9e8d];return _0x457559;};'use strict';var multer=require(_0x9db8('0x0'));var util=require(_0x9db8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9db8('0x2'));var router=express[_0x9db8('0x3')]();var fs_extra=require(_0x9db8('0x4'));var auth=require(_0x9db8('0x5'));var interaction=require(_0x9db8('0x6'));var config=require(_0x9db8('0x7'));var controller=require(_0x9db8('0x8'));router[_0x9db8('0x9')]('/',auth['isAuthenticated'](),controller[_0x9db8('0xa')]);router[_0x9db8('0x9')](_0x9db8('0xb'),auth[_0x9db8('0xc')](),controller['describe']);router[_0x9db8('0x9')](_0x9db8('0xd'),auth[_0x9db8('0xc')](),controller[_0x9db8('0xe')]);router['get'](_0x9db8('0xf'),auth[_0x9db8('0xc')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0x9db8('0x10'),auth[_0x9db8('0xc')](),controller[_0x9db8('0x11')]);router[_0x9db8('0x12')](_0x9db8('0x13'),auth[_0x9db8('0xc')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x9db8('0x12')](_0x9db8('0x14'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x9db8('0x12')](_0x9db8('0x15'),auth[_0x9db8('0xc')](),controller[_0x9db8('0x16')]);router[_0x9db8('0x17')](_0x9db8('0xd'),auth['isAuthenticated'](),controller['update']);module[_0x9db8('0x18')]=router;
\ No newline at end of file
+var _0xf6ea=['../../config/environment','isAuthenticated','index','get','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','checkContactHopper','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x499c73,_0x2062bf){var _0xb3ba37=function(_0x44f68e){while(--_0x44f68e){_0x499c73['push'](_0x499c73['shift']());}};_0xb3ba37(++_0x2062bf);}(_0xf6ea,0x14c));var _0xaf6e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf6ea[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xaf6e('0x0'));var util=require(_0xaf6e('0x1'));var path=require(_0xaf6e('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf6e('0x3'));var router=express[_0xaf6e('0x4')]();var fs_extra=require(_0xaf6e('0x5'));var auth=require(_0xaf6e('0x6'));var interaction=require(_0xaf6e('0x7'));var config=require(_0xaf6e('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0xaf6e('0x9')](),controller[_0xaf6e('0xa')]);router[_0xaf6e('0xb')](_0xaf6e('0xc'),auth[_0xaf6e('0x9')](),controller['describe']);router[_0xaf6e('0xb')](_0xaf6e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xaf6e('0xb')](_0xaf6e('0xe'),auth[_0xaf6e('0x9')](),controller[_0xaf6e('0xf')]);router[_0xaf6e('0xb')]('/campaign/countAttributes/:id',auth[_0xaf6e('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xaf6e('0x10')](_0xaf6e('0x11'),auth[_0xaf6e('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xaf6e('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xaf6e('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xaf6e('0x10')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xaf6e('0x12')]);router['put']('/:id',auth[_0xaf6e('0x9')](),controller[_0xaf6e('0x13')]);module['exports']=router;
\ No newline at end of file
index df03b58..4e070f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55f7=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x55f7,0x11c));var _0x755f=function(_0x33d3c9,_0x2c95a8){_0x33d3c9=_0x33d3c9-0x0;var _0x1b9229=_0x55f7[_0x33d3c9];return _0x1b9229;};'use strict';var Sequelize=require(_0x755f('0x0'));module[_0x755f('0x1')]={'state':{'type':Sequelize[_0x755f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x755f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x755f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x755f('0x3')]},'originatecalleridname':{'type':Sequelize[_0x755f('0x3')]},'calleridnum':{'type':Sequelize[_0x755f('0x3')]},'calleridname':{'type':Sequelize[_0x755f('0x3')]},'starttime':{'type':Sequelize[_0x755f('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x755f('0x4')]},'droptime':{'type':Sequelize[_0x755f('0x4')]},'endtime':{'type':Sequelize[_0x755f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x755f('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x755f('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x755f('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x755f('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x755f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x755f('0x4')]},'recallme':{'type':Sequelize[_0x755f('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x755f('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x755f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9735=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x432b87,_0x289bd0){var _0x3aa78a=function(_0x1e03ca){while(--_0x1e03ca){_0x432b87['push'](_0x432b87['shift']());}};_0x3aa78a(++_0x289bd0);}(_0x9735,0x17e));var _0x5973=function(_0x2836a4,_0x1d2c36){_0x2836a4=_0x2836a4-0x0;var _0x3ea55b=_0x9735[_0x2836a4];return _0x3ea55b;};'use strict';var Sequelize=require(_0x5973('0x0'));module[_0x5973('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5973('0x2')]},'scheduledat':{'type':Sequelize[_0x5973('0x3')]},'countbusyretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5973('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5973('0x2')]},'originatecalleridname':{'type':Sequelize[_0x5973('0x2')]},'calleridnum':{'type':Sequelize[_0x5973('0x2')]},'calleridname':{'type':Sequelize[_0x5973('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5973('0x3')]},'droptime':{'type':Sequelize[_0x5973('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5973('0x2')]},'campaign':{'type':Sequelize[_0x5973('0x2')]},'campaigntype':{'type':Sequelize[_0x5973('0x2')]},'membername':{'type':Sequelize[_0x5973('0x2')]},'reason':{'type':Sequelize[_0x5973('0x2')]},'amd':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5973('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5973('0x3')]},'recallme':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5973('0x3')]},'edited':{'type':Sequelize[_0x5973('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5973('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 7f9f3d6..9b07533 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x818d=['fields','create','body','describe','uniqueid','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x818d,0x1b6));var _0xd818=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0x818d[_0x4358f5];return _0x4d8104;};'use strict';var emlformat=require(_0xd818('0x0'));var rimraf=require(_0xd818('0x1'));var zipdir=require(_0xd818('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd818('0x3'));var BPromise=require(_0xd818('0x4'));var Mustache=require(_0xd818('0x5'));var util=require(_0xd818('0x6'));var path=require(_0xd818('0x7'));var sox=require('sox');var csv=require(_0xd818('0x8'));var ejs=require(_0xd818('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd818('0xa'));var squel=require('squel');var crypto=require(_0xd818('0xb'));var jsforce=require(_0xd818('0xc'));var deskjs=require(_0xd818('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd818('0xe'));var Papa=require(_0xd818('0xf'));var Redis=require(_0xd818('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd818('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd818('0x12'));var logger=require(_0xd818('0x13'))('api');var utils=require(_0xd818('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd818('0x15'))['db'];function respondWithStatusCode(_0x19ba0a,_0x39deca){_0x39deca=_0x39deca||0xcc;return function(_0x32621f){if(_0x32621f){return _0x19ba0a[_0xd818('0x16')](_0x39deca);}return _0x19ba0a[_0xd818('0x17')](_0x39deca)['end']();};}function respondWithResult(_0x107f26,_0x5c4250){_0x5c4250=_0x5c4250||0xc8;return function(_0x5fa358){if(_0x5fa358){return _0x107f26[_0xd818('0x17')](_0x5c4250)[_0xd818('0x18')](_0x5fa358);}};}function respondWithFilteredResult(_0x248324,_0x9952a2){return function(_0x1a3838){if(_0x1a3838){var _0x514c2c=typeof _0x9952a2[_0xd818('0x19')]===_0xd818('0x1a')&&typeof _0x9952a2[_0xd818('0x1b')]==='undefined';var _0x41ca09=_0x1a3838[_0xd818('0x1c')];var _0x33a938=_0x514c2c?0x0:_0x9952a2[_0xd818('0x19')];var _0x1750c4=_0x514c2c?_0x1a3838['count']:_0x9952a2['offset']+_0x9952a2[_0xd818('0x1b')];var _0x165d13;if(_0x1750c4>=_0x41ca09){_0x1750c4=_0x41ca09;_0x165d13=0xc8;}else{_0x165d13=0xce;}_0x248324[_0xd818('0x17')](_0x165d13);return _0x248324[_0xd818('0x1d')](_0xd818('0x1e'),_0x33a938+'-'+_0x1750c4+'/'+_0x41ca09)[_0xd818('0x18')](_0x1a3838);}return null;};}function patchUpdates(_0x1ebc4b){return function(_0x7ca5ff){try{jsonpatch['apply'](_0x7ca5ff,_0x1ebc4b,!![]);}catch(_0x3db1cf){return BPromise[_0xd818('0x1f')](_0x3db1cf);}return _0x7ca5ff[_0xd818('0x20')]();};}function saveUpdates(_0x2b131c,_0x1bc8a0){return function(_0x11da4e){if(_0x11da4e){return _0x11da4e[_0xd818('0x21')](_0x2b131c)[_0xd818('0x22')](function(_0x3de5bc){return _0x3de5bc;});}return null;};}function removeEntity(_0xdca717,_0xb7e018){return function(_0x237e71){if(_0x237e71){return _0x237e71['destroy']()[_0xd818('0x22')](function(){_0xdca717['status'](0xcc)[_0xd818('0x23')]();});}};}function handleEntityNotFound(_0x457357,_0x2c90df){return function(_0x61cf5){if(!_0x61cf5){_0x457357['sendStatus'](0x194);}return _0x61cf5;};}function handleError(_0xe865e0,_0x16250f){_0x16250f=_0x16250f||0x1f4;return function(_0x3950e7){logger[_0xd818('0x24')](_0x3950e7[_0xd818('0x25')]);if(_0x3950e7[_0xd818('0x26')]){delete _0x3950e7[_0xd818('0x26')];}_0xe865e0['status'](_0x16250f)[_0xd818('0x27')](_0x3950e7);};}exports['index']=function(_0x2126b4,_0xf8b8c0){var _0x458851={},_0x3c5782={},_0x510cef={'count':0x0,'rows':[]};var _0x21451a=_[_0xd818('0x28')](db[_0xd818('0x29')][_0xd818('0x2a')],function(_0x129961){return{'name':_0x129961[_0xd818('0x2b')],'type':_0x129961[_0xd818('0x2c')][_0xd818('0x2d')]};});_0x3c5782[_0xd818('0x2e')]=_['map'](_0x21451a,_0xd818('0x26'));_0x3c5782[_0xd818('0x2f')]=_[_0xd818('0x30')](_0x2126b4[_0xd818('0x2f')]);_0x3c5782[_0xd818('0x31')]=_[_0xd818('0x32')](_0x3c5782[_0xd818('0x2e')],_0x3c5782[_0xd818('0x2f')]);_0x458851[_0xd818('0x33')]=_[_0xd818('0x32')](_0x3c5782['model'],qs['fields'](_0x2126b4[_0xd818('0x2f')]['fields']));_0x458851[_0xd818('0x33')]=_0x458851[_0xd818('0x33')][_0xd818('0x34')]?_0x458851[_0xd818('0x33')]:_0x3c5782[_0xd818('0x2e')];if(!_0x2126b4[_0xd818('0x2f')][_0xd818('0x35')](_0xd818('0x36'))){_0x458851['limit']=qs[_0xd818('0x1b')](_0x2126b4[_0xd818('0x2f')]['limit']);_0x458851[_0xd818('0x19')]=qs[_0xd818('0x19')](_0x2126b4[_0xd818('0x2f')][_0xd818('0x19')]);}_0x458851['order']=qs[_0xd818('0x37')](_0x2126b4[_0xd818('0x2f')][_0xd818('0x37')]);_0x458851['where']=qs['filters'](_['pick'](_0x2126b4['query'],_0x3c5782[_0xd818('0x31')]),_0x21451a);if(_0x2126b4[_0xd818('0x2f')][_0xd818('0x38')]){_0x458851[_0xd818('0x39')]=_['merge'](_0x458851['where'],{'$or':_[_0xd818('0x28')](_0x21451a,function(_0x216e12){if(_0x216e12['type']!==_0xd818('0x3a')){var _0x16f884={};_0x16f884[_0x216e12[_0xd818('0x26')]]={'$like':'%'+_0x2126b4[_0xd818('0x2f')]['filter']+'%'};return _0x16f884;}})});}_0x458851=_['merge']({},_0x458851,_0x2126b4[_0xd818('0x3b')]);var _0x191380={'where':_0x458851[_0xd818('0x39')]};return db[_0xd818('0x29')]['count'](_0x191380)[_0xd818('0x22')](function(_0x7ab7dc){_0x510cef[_0xd818('0x1c')]=_0x7ab7dc;if(_0x2126b4['query'][_0xd818('0x3c')]){_0x458851[_0xd818('0x3d')]=[{'all':!![]}];}return db[_0xd818('0x29')][_0xd818('0x3e')](_0x458851);})[_0xd818('0x22')](function(_0x26c935){_0x510cef[_0xd818('0x3f')]=_0x26c935;return _0x510cef;})[_0xd818('0x22')](respondWithFilteredResult(_0xf8b8c0,_0x458851))[_0xd818('0x40')](handleError(_0xf8b8c0,null));};exports['show']=function(_0x20643d,_0x1d1b0a){var _0x5983e9={'raw':!![],'where':{'id':_0x20643d[_0xd818('0x41')]['id']}},_0x5c16e9={};_0x5c16e9[_0xd818('0x2e')]=_[_0xd818('0x30')](db[_0xd818('0x29')][_0xd818('0x2a')]);_0x5c16e9[_0xd818('0x2f')]=_[_0xd818('0x30')](_0x20643d[_0xd818('0x2f')]);_0x5c16e9['filters']=_['intersection'](_0x5c16e9[_0xd818('0x2e')],_0x5c16e9[_0xd818('0x2f')]);_0x5983e9[_0xd818('0x33')]=_[_0xd818('0x32')](_0x5c16e9['model'],qs['fields'](_0x20643d[_0xd818('0x2f')][_0xd818('0x42')]));_0x5983e9[_0xd818('0x33')]=_0x5983e9[_0xd818('0x33')][_0xd818('0x34')]?_0x5983e9['attributes']:_0x5c16e9[_0xd818('0x2e')];if(_0x20643d[_0xd818('0x2f')][_0xd818('0x3c')]){_0x5983e9[_0xd818('0x3d')]=[{'all':!![]}];}_0x5983e9=_['merge']({},_0x5983e9,_0x20643d[_0xd818('0x3b')]);return db['CmHopperHistory']['find'](_0x5983e9)[_0xd818('0x22')](handleEntityNotFound(_0x1d1b0a,null))[_0xd818('0x22')](respondWithResult(_0x1d1b0a,null))[_0xd818('0x40')](handleError(_0x1d1b0a,null));};exports[_0xd818('0x43')]=function(_0x361b41,_0x4fd91f){return db[_0xd818('0x29')][_0xd818('0x43')](_0x361b41[_0xd818('0x44')],{})[_0xd818('0x22')](respondWithResult(_0x4fd91f,0xc9))[_0xd818('0x40')](handleError(_0x4fd91f,null));};exports[_0xd818('0x45')]=function(_0x42546b,_0x37a05c){return db[_0xd818('0x29')]['describe']()['then'](respondWithResult(_0x37a05c,null))[_0xd818('0x40')](handleError(_0x37a05c,null));};exports[_0xd818('0x21')]=function(_0x5cf845,_0x594ba8){if(_0x5cf845[_0xd818('0x44')][_0xd818('0x46')]){delete _0x5cf845[_0xd818('0x44')][_0xd818('0x46')];}return db['CmHopperHistory'][_0xd818('0x47')]({'where':{'uniqueid':_0x5cf845[_0xd818('0x41')]['id']}})[_0xd818('0x22')](handleEntityNotFound(_0x594ba8,null))[_0xd818('0x22')](saveUpdates(_0x5cf845[_0xd818('0x44')],null))[_0xd818('0x22')](respondWithResult(_0x594ba8,null))[_0xd818('0x40')](handleError(_0x594ba8,null));};
\ No newline at end of file
+var _0xb275=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','length','options','find','create','body','describe','uniqueid','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xb275,0x114));var _0x5b27=function(_0x2ddc8f,_0x48bd60){_0x2ddc8f=_0x2ddc8f-0x0;var _0x32f754=_0xb275[_0x2ddc8f];return _0x32f754;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5b27('0x0'));var rp=require(_0x5b27('0x1'));var moment=require('moment');var BPromise=require(_0x5b27('0x2'));var Mustache=require('mustache');var util=require(_0x5b27('0x3'));var path=require('path');var sox=require(_0x5b27('0x4'));var csv=require(_0x5b27('0x5'));var ejs=require(_0x5b27('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b27('0x7'));var crypto=require(_0x5b27('0x8'));var jsforce=require(_0x5b27('0x9'));var deskjs=require(_0x5b27('0xa'));var toCsv=require(_0x5b27('0x5'));var querystring=require(_0x5b27('0xb'));var Papa=require(_0x5b27('0xc'));var Redis=require(_0x5b27('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5b27('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b27('0xf'));var logger=require(_0x5b27('0x10'))(_0x5b27('0x11'));var utils=require(_0x5b27('0x12'));var config=require(_0x5b27('0x13'));var licenseUtil=require(_0x5b27('0x14'));var db=require(_0x5b27('0x15'))['db'];function respondWithStatusCode(_0x31ae41,_0x3d946f){_0x3d946f=_0x3d946f||0xcc;return function(_0x3c2faf){if(_0x3c2faf){return _0x31ae41['sendStatus'](_0x3d946f);}return _0x31ae41[_0x5b27('0x16')](_0x3d946f)[_0x5b27('0x17')]();};}function respondWithResult(_0x43abc0,_0x347772){_0x347772=_0x347772||0xc8;return function(_0xaa6df3){if(_0xaa6df3){return _0x43abc0[_0x5b27('0x16')](_0x347772)[_0x5b27('0x18')](_0xaa6df3);}};}function respondWithFilteredResult(_0x3f798f,_0x24ba16){return function(_0x1974e7){if(_0x1974e7){var _0x477b83=typeof _0x24ba16[_0x5b27('0x19')]===_0x5b27('0x1a')&&typeof _0x24ba16[_0x5b27('0x1b')]==='undefined';var _0x1294fe=_0x1974e7[_0x5b27('0x1c')];var _0x1d9ad5=_0x477b83?0x0:_0x24ba16[_0x5b27('0x19')];var _0x5b7946=_0x477b83?_0x1974e7['count']:_0x24ba16[_0x5b27('0x19')]+_0x24ba16[_0x5b27('0x1b')];var _0x21b3fb;if(_0x5b7946>=_0x1294fe){_0x5b7946=_0x1294fe;_0x21b3fb=0xc8;}else{_0x21b3fb=0xce;}_0x3f798f[_0x5b27('0x16')](_0x21b3fb);return _0x3f798f['set'](_0x5b27('0x1d'),_0x1d9ad5+'-'+_0x5b7946+'/'+_0x1294fe)[_0x5b27('0x18')](_0x1974e7);}return null;};}function patchUpdates(_0x20bf28){return function(_0x4101b9){try{jsonpatch[_0x5b27('0x1e')](_0x4101b9,_0x20bf28,!![]);}catch(_0x2605a6){return BPromise[_0x5b27('0x1f')](_0x2605a6);}return _0x4101b9[_0x5b27('0x20')]();};}function saveUpdates(_0x50a1e8,_0x2b6786){return function(_0x252982){if(_0x252982){return _0x252982[_0x5b27('0x21')](_0x50a1e8)[_0x5b27('0x22')](function(_0x52d91c){return _0x52d91c;});}return null;};}function removeEntity(_0x4abbd7,_0x26756f){return function(_0x5cdc57){if(_0x5cdc57){return _0x5cdc57[_0x5b27('0x23')]()[_0x5b27('0x22')](function(){_0x4abbd7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7617,_0x3d8ce1){return function(_0x3c81d6){if(!_0x3c81d6){_0x1e7617[_0x5b27('0x24')](0x194);}return _0x3c81d6;};}function handleError(_0x4e4170,_0xa42e6a){_0xa42e6a=_0xa42e6a||0x1f4;return function(_0x12b313){logger['error'](_0x12b313[_0x5b27('0x25')]);if(_0x12b313[_0x5b27('0x26')]){delete _0x12b313['name'];}_0x4e4170[_0x5b27('0x16')](_0xa42e6a)[_0x5b27('0x27')](_0x12b313);};}exports[_0x5b27('0x28')]=function(_0x1e7757,_0x2c0aed){var _0x527f35={},_0x468927={},_0x485cf3={'count':0x0,'rows':[]};var _0xeb9b18=_['map'](db[_0x5b27('0x29')][_0x5b27('0x2a')],function(_0x784d59){return{'name':_0x784d59[_0x5b27('0x2b')],'type':_0x784d59[_0x5b27('0x2c')][_0x5b27('0x2d')]};});_0x468927[_0x5b27('0x2e')]=_[_0x5b27('0x2f')](_0xeb9b18,_0x5b27('0x26'));_0x468927['query']=_[_0x5b27('0x30')](_0x1e7757[_0x5b27('0x31')]);_0x468927[_0x5b27('0x32')]=_[_0x5b27('0x33')](_0x468927[_0x5b27('0x2e')],_0x468927[_0x5b27('0x31')]);_0x527f35[_0x5b27('0x34')]=_[_0x5b27('0x33')](_0x468927[_0x5b27('0x2e')],qs[_0x5b27('0x35')](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x35')]));_0x527f35[_0x5b27('0x34')]=_0x527f35[_0x5b27('0x34')]['length']?_0x527f35[_0x5b27('0x34')]:_0x468927[_0x5b27('0x2e')];if(!_0x1e7757[_0x5b27('0x31')][_0x5b27('0x36')](_0x5b27('0x37'))){_0x527f35['limit']=qs['limit'](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x1b')]);_0x527f35[_0x5b27('0x19')]=qs[_0x5b27('0x19')](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x19')]);}_0x527f35[_0x5b27('0x38')]=qs[_0x5b27('0x39')](_0x1e7757[_0x5b27('0x31')][_0x5b27('0x39')]);_0x527f35[_0x5b27('0x3a')]=qs[_0x5b27('0x32')](_[_0x5b27('0x3b')](_0x1e7757['query'],_0x468927['filters']),_0xeb9b18);if(_0x1e7757[_0x5b27('0x31')][_0x5b27('0x3c')]){_0x527f35['where']=_[_0x5b27('0x3d')](_0x527f35[_0x5b27('0x3a')],{'$or':_[_0x5b27('0x2f')](_0xeb9b18,function(_0x339c67){if(_0x339c67[_0x5b27('0x2c')]!==_0x5b27('0x3e')){var _0x567311={};_0x567311[_0x339c67[_0x5b27('0x26')]]={'$like':'%'+_0x1e7757['query'][_0x5b27('0x3c')]+'%'};return _0x567311;}})});}_0x527f35=_['merge']({},_0x527f35,_0x1e7757['options']);var _0x146bad={'where':_0x527f35[_0x5b27('0x3a')]};return db[_0x5b27('0x29')][_0x5b27('0x1c')](_0x146bad)[_0x5b27('0x22')](function(_0x3d0c75){_0x485cf3[_0x5b27('0x1c')]=_0x3d0c75;if(_0x1e7757[_0x5b27('0x31')]['includeAll']){_0x527f35['include']=[{'all':!![]}];}return db[_0x5b27('0x29')][_0x5b27('0x3f')](_0x527f35);})['then'](function(_0x2971af){_0x485cf3[_0x5b27('0x40')]=_0x2971af;return _0x485cf3;})[_0x5b27('0x22')](respondWithFilteredResult(_0x2c0aed,_0x527f35))[_0x5b27('0x41')](handleError(_0x2c0aed,null));};exports[_0x5b27('0x42')]=function(_0x4a305b,_0x21cedf){var _0x12b698={'raw':!![],'where':{'id':_0x4a305b[_0x5b27('0x43')]['id']}},_0x19d723={};_0x19d723[_0x5b27('0x2e')]=_[_0x5b27('0x30')](db['CmHopperHistory']['rawAttributes']);_0x19d723[_0x5b27('0x31')]=_[_0x5b27('0x30')](_0x4a305b['query']);_0x19d723[_0x5b27('0x32')]=_[_0x5b27('0x33')](_0x19d723['model'],_0x19d723[_0x5b27('0x31')]);_0x12b698[_0x5b27('0x34')]=_[_0x5b27('0x33')](_0x19d723['model'],qs[_0x5b27('0x35')](_0x4a305b[_0x5b27('0x31')][_0x5b27('0x35')]));_0x12b698[_0x5b27('0x34')]=_0x12b698['attributes'][_0x5b27('0x44')]?_0x12b698['attributes']:_0x19d723[_0x5b27('0x2e')];if(_0x4a305b['query']['includeAll']){_0x12b698['include']=[{'all':!![]}];}_0x12b698=_[_0x5b27('0x3d')]({},_0x12b698,_0x4a305b[_0x5b27('0x45')]);return db[_0x5b27('0x29')][_0x5b27('0x46')](_0x12b698)[_0x5b27('0x22')](handleEntityNotFound(_0x21cedf,null))[_0x5b27('0x22')](respondWithResult(_0x21cedf,null))[_0x5b27('0x41')](handleError(_0x21cedf,null));};exports[_0x5b27('0x47')]=function(_0x511667,_0x2098d4){return db['CmHopperHistory'][_0x5b27('0x47')](_0x511667[_0x5b27('0x48')],{})[_0x5b27('0x22')](respondWithResult(_0x2098d4,0xc9))[_0x5b27('0x41')](handleError(_0x2098d4,null));};exports[_0x5b27('0x49')]=function(_0x49c2a1,_0x3264c5){return db[_0x5b27('0x29')][_0x5b27('0x49')]()[_0x5b27('0x22')](respondWithResult(_0x3264c5,null))['catch'](handleError(_0x3264c5,null));};exports['update']=function(_0x566c22,_0x5b0adc){if(_0x566c22['body'][_0x5b27('0x4a')]){delete _0x566c22[_0x5b27('0x48')][_0x5b27('0x4a')];}return db[_0x5b27('0x29')][_0x5b27('0x46')]({'where':{'uniqueid':_0x566c22['params']['id']}})[_0x5b27('0x22')](handleEntityNotFound(_0x5b0adc,null))['then'](saveUpdates(_0x566c22[_0x5b27('0x48')],null))['then'](respondWithResult(_0x5b0adc,null))[_0x5b27('0x41')](handleError(_0x5b0adc,null));};
\ No newline at end of file
index 4499cbe..c5fcee1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18c9=['define','CmHopperHistory','cm_hopper_history','endtime','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperHistory.attributes'];(function(_0x53ab95,_0x17a54e){var _0x45e312=function(_0x4c3b0c){while(--_0x4c3b0c){_0x53ab95['push'](_0x53ab95['shift']());}};_0x45e312(++_0x17a54e);}(_0x18c9,0x13c));var _0x918c=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x18c9[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x918c('0x0'));var util=require(_0x918c('0x1'));var logger=require(_0x918c('0x2'))(_0x918c('0x3'));var moment=require(_0x918c('0x4'));var BPromise=require(_0x918c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x918c('0x6'));var rimraf=require(_0x918c('0x7'));var config=require('../../config/environment');var attributes=require(_0x918c('0x8'));module['exports']=function(_0x20573f,_0x29a649){return _0x20573f[_0x918c('0x9')](_0x918c('0xa'),attributes,{'tableName':_0x918c('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x918c('0xc')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2dd8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid','lodash','util'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2dd8,0x143));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82dd('0x2'));var BPromise=require(_0x82dd('0x3'));var rp=require(_0x82dd('0x4'));var fs=require('fs');var path=require(_0x82dd('0x5'));var rimraf=require(_0x82dd('0x6'));var config=require(_0x82dd('0x7'));var attributes=require(_0x82dd('0x8'));module['exports']=function(_0x4026c3,_0x1cfdce){return _0x4026c3[_0x82dd('0x9')](_0x82dd('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x82dd('0xb'),'fields':[_0x82dd('0xb')]},{'name':_0x82dd('0xc'),'fields':[_0x82dd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index ddb9b23..69b685d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc7=['AvgHandleTime','findAll','raw','where','col','predictiveIntervalTotalCalls','sequelize','COUNT','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','catch','CmHopperHistory','create','body','options','CreateCmHopperHistory','stringify'];(function(_0x369633,_0x263fb9){var _0x1eda8c=function(_0x3b1b46){while(--_0x3b1b46){_0x369633['push'](_0x369633['shift']());}};_0x1eda8c(++_0x263fb9);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0x5fc7[_0x30182f];return _0x5207db;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var moment=require(_0x75fc('0x2'));var BPromise=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var fs=require('fs');var Redis=require(_0x75fc('0x5'));var db=require(_0x75fc('0x6'))['db'];var utils=require(_0x75fc('0x7'));var logger=require(_0x75fc('0x8'))(_0x75fc('0x9'));var config=require(_0x75fc('0xa'));var jayson=require(_0x75fc('0xb'));var client=jayson['client'][_0x75fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc85b45,_0x1430f3,_0x347ce8){return new BPromise(function(_0x17a1d5,_0x15f3bc){return client[_0x75fc('0xd')](_0xc85b45,_0x347ce8)[_0x75fc('0xe')](function(_0x957f42){logger[_0x75fc('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1430f3,_0x75fc('0x10'));logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x1430f3,_0x75fc('0x10'),JSON['stringify'](_0x957f42));if(_0x957f42[_0x75fc('0x13')]){if(_0x957f42[_0x75fc('0x13')][_0x75fc('0x14')]===0x1f4){logger[_0x75fc('0x13')](_0x75fc('0x15'),_0x1430f3,_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);return _0x15f3bc(_0x957f42['error']['message']);}logger['error'](_0x75fc('0x15'),_0x1430f3,_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);return _0x17a1d5(_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);}else{logger[_0x75fc('0xf')](_0x75fc('0x15'),_0x1430f3,_0x75fc('0x10'));_0x17a1d5(_0x957f42['result'][_0x75fc('0x16')]);}})[_0x75fc('0x17')](function(_0x51011d){logger[_0x75fc('0x13')](_0x75fc('0x15'),_0x1430f3,_0x51011d);_0x15f3bc(_0x51011d);});});}exports['CreateCmHopperHistory']=function(_0x5cdf1e){var _0x25b52b=this;return new Promise(function(_0x2608bf,_0x3b1edf){return db[_0x75fc('0x18')][_0x75fc('0x19')](_0x5cdf1e[_0x75fc('0x1a')],{'raw':_0x5cdf1e['options']?_0x5cdf1e[_0x75fc('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x75fc('0xe')](function(_0x2373b0){logger[_0x75fc('0xf')](_0x75fc('0x1c'),_0x5cdf1e);logger['debug'](_0x75fc('0x1c'),_0x5cdf1e,JSON[_0x75fc('0x1d')](_0x2373b0));_0x2608bf(_0x2373b0);})['catch'](function(_0x458cc4){logger[_0x75fc('0x13')]('CreateCmHopperHistory',_0x458cc4[_0x75fc('0x16')],_0x5cdf1e);_0x3b1edf(_0x25b52b['error'](0x1f4,_0x458cc4[_0x75fc('0x16')]));});});};exports[_0x75fc('0x1e')]=function(_0x54b684){var _0xd8b8e1=this;return new Promise(function(_0x151046,_0x5a62ef){return db[_0x75fc('0x18')][_0x75fc('0x1f')]({'raw':_0x54b684['options']?_0x54b684['options'][_0x75fc('0x20')]===undefined?!![]:![]:!![],'where':_0x54b684['options']?_0x54b684[_0x75fc('0x1b')][_0x75fc('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0x75fc('0x22')]('id')),_0x75fc('0x23')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0x75fc('0x27')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')]('`state`\x20=\x2010,\x201,\x20null'))),_0x75fc('0x28')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')]('`state`\x20=\x2011,\x201,\x20null'))),_0x75fc('0x29')],[db[_0x75fc('0x24')]['fn']('AVG',db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x2a')))),_0x75fc('0x2b')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x2c'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x2d')))),'predictiveIntervalAvgTalktime']]})[_0x75fc('0xe')](function(_0x447c13){logger[_0x75fc('0xf')](_0x75fc('0x1e'),_0x54b684);logger[_0x75fc('0x11')](_0x75fc('0x1e'),_0x54b684,JSON[_0x75fc('0x1d')](_0x447c13));_0x151046(_0x447c13);})[_0x75fc('0x17')](function(_0x1ad353){logger[_0x75fc('0x13')](_0x75fc('0x1e'),_0x1ad353[_0x75fc('0x16')],_0x54b684);_0x5a62ef(_0xd8b8e1[_0x75fc('0x13')](0x1f4,_0x1ad353['message']));});});};exports[_0x75fc('0x2e')]=function(_0x1c9e6f){var _0x9636fe=this;return new Promise(function(_0x19e172,_0x51b9fa){return db[_0x75fc('0x18')][_0x75fc('0x1f')]({'raw':_0x1c9e6f[_0x75fc('0x1b')]?_0x1c9e6f[_0x75fc('0x1b')][_0x75fc('0x20')]===undefined?!![]:![]:!![],'where':_0x1c9e6f[_0x75fc('0x1b')]?_0x1c9e6f[_0x75fc('0x1b')][_0x75fc('0x21')]||null:null,'attributes':[['campaign',_0x75fc('0x2f')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x200,\x201,\x20null'))),_0x75fc('0x30')],[db[_0x75fc('0x24')]['fn']('COUNT',db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x31')))),_0x75fc('0x32')],[db['sequelize']['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x33')))),_0x75fc('0x34')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x205,\x201,\x20null'))),_0x75fc('0x35')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x36')))),_0x75fc('0x37')],[db[_0x75fc('0x24')]['fn']('COUNT',db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x38')))),_0x75fc('0x39')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x75fc('0x3a')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')]('`state`\x20=\x2013,\x201,\x20null'))),_0x75fc('0x3b')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')](_0x75fc('0x3c')))),_0x75fc('0x3d')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x3e')))),'outboundRejectCallsDay'],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')]['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x3f')))),_0x75fc('0x40')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db['sequelize']['fn']('IF',db[_0x75fc('0x24')][_0x75fc('0x26')](_0x75fc('0x41')))),_0x75fc('0x42')],[db['sequelize']['fn']('COUNT',db[_0x75fc('0x24')]['fn']('IF',db['sequelize'][_0x75fc('0x26')](_0x75fc('0x43')))),_0x75fc('0x44')]],'group':[_0x75fc('0x45')]})[_0x75fc('0xe')](function(_0xee6e51){logger[_0x75fc('0xf')](_0x75fc('0x2e'),_0x1c9e6f);logger[_0x75fc('0x11')](_0x75fc('0x2e'),_0x1c9e6f,JSON['stringify'](_0xee6e51));_0x19e172(_0xee6e51);})[_0x75fc('0x17')](function(_0x152ac6){logger[_0x75fc('0x13')]('GetVoiceQueueHopperHistory',_0x152ac6['message'],_0x1c9e6f);_0x51b9fa(_0x9636fe[_0x75fc('0x13')](0x1f4,_0x152ac6[_0x75fc('0x16')]));});});};exports[_0x75fc('0x46')]=function(_0x7e65e1){var _0x4f6d63=this;return new Promise(function(_0x18fa7a,_0x47d7d8){return db['CmHopperHistory'][_0x75fc('0x1f')]({'raw':_0x7e65e1['options']?_0x7e65e1[_0x75fc('0x1b')][_0x75fc('0x20')]===undefined?!![]:![]:!![],'where':_0x7e65e1[_0x75fc('0x1b')]?_0x7e65e1['options'][_0x75fc('0x21')]||null:null,'attributes':[[_0x75fc('0x45'),_0x75fc('0x2f')],[db[_0x75fc('0x24')]['fn'](_0x75fc('0x25'),db[_0x75fc('0x24')][_0x75fc('0x22')]('id')),_0x75fc('0x47')],[db[_0x75fc('0x24')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x75fc('0x24')]['literal'](_0x75fc('0x33')))),_0x75fc('0x48')]],'group':['campaign']})[_0x75fc('0xe')](function(_0x3d2687){logger['info'](_0x75fc('0x46'),_0x7e65e1);logger[_0x75fc('0x11')](_0x75fc('0x46'),_0x7e65e1,JSON['stringify'](_0x3d2687));_0x18fa7a(_0x3d2687);})[_0x75fc('0x17')](function(_0xc54460){logger[_0x75fc('0x13')](_0x75fc('0x46'),_0xc54460[_0x75fc('0x16')],_0x7e65e1);_0x47d7d8(_0x4f6d63[_0x75fc('0x13')](0x1f4,_0xc54460[_0x75fc('0x16')]));});});};
\ No newline at end of file
+var _0x688a=['outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','result','catch','create','body','options','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','campaign','name','`state`\x20=\x200,\x201,\x20null'];(function(_0x381ac4,_0x521252){var _0x2b11a5=function(_0x17bc2c){while(--_0x17bc2c){_0x381ac4['push'](_0x381ac4['shift']());}};_0x2b11a5(++_0x521252);}(_0x688a,0x124));var _0xa688=function(_0x26e850,_0xe6592b){_0x26e850=_0x26e850-0x0;var _0x5b1cf9=_0x688a[_0x26e850];return _0x5b1cf9;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require('bluebird');var rs=require(_0xa688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa688('0x4'))['db'];var utils=require(_0xa688('0x5'));var logger=require('../../config/logger')(_0xa688('0x6'));var config=require(_0xa688('0x7'));var jayson=require(_0xa688('0x8'));var client=jayson[_0xa688('0x9')][_0xa688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a362a,_0x49e75d,_0x5aee29){return new BPromise(function(_0x45c969,_0x3f3d81){return client[_0xa688('0xb')](_0x2a362a,_0x5aee29)['then'](function(_0x4d3b92){logger[_0xa688('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x49e75d,'request\x20sent');logger[_0xa688('0xd')](_0xa688('0xe'),_0x49e75d,_0xa688('0xf'),JSON[_0xa688('0x10')](_0x4d3b92));if(_0x4d3b92[_0xa688('0x11')]){if(_0x4d3b92[_0xa688('0x11')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x49e75d,_0x4d3b92[_0xa688('0x11')][_0xa688('0x12')]);return _0x3f3d81(_0x4d3b92['error'][_0xa688('0x12')]);}logger['error'](_0xa688('0x13'),_0x49e75d,_0x4d3b92[_0xa688('0x11')]['message']);return _0x45c969(_0x4d3b92['error'][_0xa688('0x12')]);}else{logger['info'](_0xa688('0x13'),_0x49e75d,'request\x20sent');_0x45c969(_0x4d3b92[_0xa688('0x14')][_0xa688('0x12')]);}})[_0xa688('0x15')](function(_0x25b453){logger[_0xa688('0x11')](_0xa688('0x13'),_0x49e75d,_0x25b453);_0x3f3d81(_0x25b453);});});}exports['CreateCmHopperHistory']=function(_0x59e392){var _0x14ca3c=this;return new Promise(function(_0x1330d5,_0x5dc07f){return db['CmHopperHistory'][_0xa688('0x16')](_0x59e392[_0xa688('0x17')],{'raw':_0x59e392['options']?_0x59e392[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x152cfe){logger[_0xa688('0xc')](_0xa688('0x19'),_0x59e392);logger[_0xa688('0xd')](_0xa688('0x19'),_0x59e392,JSON[_0xa688('0x10')](_0x152cfe));_0x1330d5(_0x152cfe);})[_0xa688('0x15')](function(_0x203214){logger[_0xa688('0x11')](_0xa688('0x19'),_0x203214[_0xa688('0x12')],_0x59e392);_0x5dc07f(_0x14ca3c[_0xa688('0x11')](0x1f4,_0x203214[_0xa688('0x12')]));});});};exports[_0xa688('0x1a')]=function(_0x48cb17){var _0x442672=this;return new Promise(function(_0x32a682,_0x4fa15e){return db[_0xa688('0x1b')][_0xa688('0x1c')]({'raw':_0x48cb17['options']?_0x48cb17[_0xa688('0x18')][_0xa688('0x1d')]===undefined?!![]:![]:!![],'where':_0x48cb17[_0xa688('0x18')]?_0x48cb17[_0xa688('0x18')][_0xa688('0x1e')]||null:null,'attributes':[[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')][_0xa688('0x21')]('id')),_0xa688('0x22')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xa688('0x24')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xa688('0x20'),db['sequelize']['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x25')))),_0xa688('0x26')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x27'),db[_0xa688('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x27'),db[_0xa688('0x1f')]['fn']('IF',db['sequelize'][_0xa688('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x376ad2){logger[_0xa688('0xc')](_0xa688('0x1a'),_0x48cb17);logger['debug']('AvgHandleTime',_0x48cb17,JSON[_0xa688('0x10')](_0x376ad2));_0x32a682(_0x376ad2);})[_0xa688('0x15')](function(_0x2ba000){logger[_0xa688('0x11')](_0xa688('0x1a'),_0x2ba000['message'],_0x48cb17);_0x4fa15e(_0x442672['error'](0x1f4,_0x2ba000[_0xa688('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x11806b){var _0x2f8f0d=this;return new Promise(function(_0x19e13b,_0x288171){return db['CmHopperHistory'][_0xa688('0x1c')]({'raw':_0x11806b['options']?_0x11806b['options'][_0xa688('0x1d')]===undefined?!![]:![]:!![],'where':_0x11806b['options']?_0x11806b[_0xa688('0x18')]['where']||null:null,'attributes':[[_0xa688('0x28'),_0xa688('0x29')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2a')))),_0xa688('0x2b')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2c')))),'outboundNoAnswerCallsDay'],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2d')))),'outboundAnswerCallsDay'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db['sequelize']['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2e')))),_0xa688('0x2f')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xa688('0x30')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x31')))),_0xa688('0x32')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa688('0x33')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x34')))),_0xa688('0x35')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x36')))),_0xa688('0x37')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x38')))),_0xa688('0x39')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3a')))),_0xa688('0x3b')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3c')))),'outboundAnswerAgiCallsDay'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3d')))),'outboundRejectCallsDay'],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xa688('0x3e')))),_0xa688('0x3f')]],'group':[_0xa688('0x28')]})['then'](function(_0x4381a4){logger['info']('GetVoiceQueueHopperHistory',_0x11806b);logger['debug']('GetVoiceQueueHopperHistory',_0x11806b,JSON['stringify'](_0x4381a4));_0x19e13b(_0x4381a4);})[_0xa688('0x15')](function(_0x1b8be2){logger[_0xa688('0x11')]('GetVoiceQueueHopperHistory',_0x1b8be2[_0xa688('0x12')],_0x11806b);_0x288171(_0x2f8f0d['error'](0x1f4,_0x1b8be2[_0xa688('0x12')]));});});};exports[_0xa688('0x40')]=function(_0x3adf43){var _0x38defa=this;return new Promise(function(_0x25c618,_0x409b63){return db[_0xa688('0x1b')][_0xa688('0x1c')]({'raw':_0x3adf43[_0xa688('0x18')]?_0x3adf43[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3adf43['options']?_0x3adf43['options'][_0xa688('0x1e')]||null:null,'attributes':[[_0xa688('0x28'),_0xa688('0x29')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')][_0xa688('0x21')]('id')),_0xa688('0x41')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2d')))),_0xa688('0x42')]],'group':['campaign']})['then'](function(_0x2068cb){logger['info']('GetCampaignHopperHistory',_0x3adf43);logger[_0xa688('0xd')](_0xa688('0x40'),_0x3adf43,JSON['stringify'](_0x2068cb));_0x25c618(_0x2068cb);})[_0xa688('0x15')](function(_0x4ccb2f){logger[_0xa688('0x11')]('GetCampaignHopperHistory',_0x4ccb2f[_0xa688('0x12')],_0x3adf43);_0x409b63(_0x38defa['error'](0x1f4,_0x4ccb2f[_0xa688('0x12')]));});});};
\ No newline at end of file
index 079643b..34d56a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe10a=['get','isAuthenticated','describe','/:id','show','post','create','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x57def7,_0x32df17){var _0x23c88a=function(_0x525918){while(--_0x525918){_0x57def7['push'](_0x57def7['shift']());}};_0x23c88a(++_0x32df17);}(_0xe10a,0x9a));var _0xae10=function(_0x33ca60,_0x2a49fb){_0x33ca60=_0x33ca60-0x0;var _0x2b8807=_0xe10a[_0x33ca60];return _0x2b8807;};'use strict';var multer=require(_0xae10('0x0'));var util=require(_0xae10('0x1'));var path=require(_0xae10('0x2'));var timeout=require('connect-timeout');var express=require(_0xae10('0x3'));var router=express[_0xae10('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xae10('0x6'));var controller=require(_0xae10('0x7'));router[_0xae10('0x8')]('/',auth[_0xae10('0x9')](),controller['index']);router[_0xae10('0x8')]('/describe',auth[_0xae10('0x9')](),controller[_0xae10('0xa')]);router['get'](_0xae10('0xb'),auth['isAuthenticated'](),controller[_0xae10('0xc')]);router[_0xae10('0xd')]('/',auth['isAuthenticated'](),controller[_0xae10('0xe')]);router[_0xae10('0xf')](_0xae10('0xb'),auth[_0xae10('0x9')](),controller[_0xae10('0x10')]);module[_0xae10('0x11')]=router;
\ No newline at end of file
+var _0x117e=['isAuthenticated','describe','/:id','show','create','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','index'];(function(_0x442f11,_0x31e94f){var _0x306c90=function(_0x43a914){while(--_0x43a914){_0x442f11['push'](_0x442f11['shift']());}};_0x306c90(++_0x31e94f);}(_0x117e,0x16c));var _0xe117=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x117e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe117('0x0'));var util=require(_0xe117('0x1'));var path=require(_0xe117('0x2'));var timeout=require('connect-timeout');var express=require(_0xe117('0x3'));var router=express[_0xe117('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe117('0x5'));var interaction=require(_0xe117('0x6'));var config=require('../../config/environment');var controller=require(_0xe117('0x7'));router[_0xe117('0x8')]('/',auth['isAuthenticated'](),controller[_0xe117('0x9')]);router['get']('/describe',auth[_0xe117('0xa')](),controller[_0xe117('0xb')]);router['get'](_0xe117('0xc'),auth[_0xe117('0xa')](),controller[_0xe117('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe117('0xe')]);router[_0xe117('0xf')](_0xe117('0xc'),auth[_0xe117('0xa')](),controller[_0xe117('0x10')]);module['exports']=router;
\ No newline at end of file
index fd723af..eee6ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x269f=['STRING','sequelize','exports'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0x269f,0xee));var _0xf269=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x269f[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xf269('0x0'));module[_0xf269('0x1')]={'name':{'type':Sequelize[_0xf269('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf269('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4677=['STRING','name','sequelize'];(function(_0x3b80dc,_0x3b8de9){var _0x463b73=function(_0x5c2cd5){while(--_0x5c2cd5){_0x3b80dc['push'](_0x3b80dc['shift']());}};_0x463b73(++_0x3b8de9);}(_0x4677,0x155));var _0x7467=function(_0x4deb1e,_0x59999a){_0x4deb1e=_0x4deb1e-0x0;var _0x5c4e3f=_0x4677[_0x4deb1e];return _0x5c4e3f;};'use strict';var Sequelize=require(_0x7467('0x0'));module['exports']={'name':{'type':Sequelize[_0x7467('0x1')],'unique':_0x7467('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7467('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0405d41..9166f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3739=['where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','CmList','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','body','params','destroy','describe','addDisposition','ListId','getDispositions','findOne','Disposition','order','pick','findAll','rows','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','errors','message','getContacts','CmCustomField','CustomFields','concat','format','raw','isEmpty','now','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','/tmp/list_%d_%s.csv','sequelize','transaction','Sequelize','TEXT','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','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','defaults','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','Lists','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x2448c6,_0x5a1e17){var _0x3be8e2=function(_0x3ef391){while(--_0x3ef391){_0x2448c6['push'](_0x2448c6['shift']());}};_0x3be8e2(++_0x5a1e17);}(_0x3739,0x1f1));var _0x9373=function(_0x43e711,_0x338ab3){_0x43e711=_0x43e711-0x0;var _0x20225a=_0x3739[_0x43e711];return _0x20225a;};'use strict';var emlformat=require(_0x9373('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9373('0x1'));var jsonpatch=require(_0x9373('0x2'));var rp=require(_0x9373('0x3'));var moment=require(_0x9373('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9373('0x5'));var path=require(_0x9373('0x6'));var sox=require(_0x9373('0x7'));var csv=require(_0x9373('0x8'));var ejs=require(_0x9373('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9373('0xa'));var squel=require(_0x9373('0xb'));var crypto=require(_0x9373('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9373('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9373('0xe'));var Papa=require('papaparse');var Redis=require(_0x9373('0xf'));var authService=require(_0x9373('0x10'));var qs=require(_0x9373('0x11'));var as=require(_0x9373('0x12'));var hardwareService=require(_0x9373('0x13'));var logger=require('../../config/logger')(_0x9373('0x14'));var utils=require(_0x9373('0x15'));var config=require(_0x9373('0x16'));var licenseUtil=require(_0x9373('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9373('0x18')](config[_0x9373('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9373('0x19')]));require('./cmList.socket')[_0x9373('0x1a')](socket);function respondWithStatusCode(_0x38d8af,_0x38366c){_0x38366c=_0x38366c||0xcc;return function(_0x158f29){if(_0x158f29){return _0x38d8af[_0x9373('0x1b')](_0x38366c);}return _0x38d8af[_0x9373('0x1c')](_0x38366c)[_0x9373('0x1d')]();};}function respondWithResult(_0x291c66,_0xdec0e4){_0xdec0e4=_0xdec0e4||0xc8;return function(_0xd4a2cd){if(_0xd4a2cd){return _0x291c66['status'](_0xdec0e4)[_0x9373('0x1e')](_0xd4a2cd);}};}function respondWithFilteredResult(_0x2a92d5,_0x203219){return function(_0x3b3e89){if(_0x3b3e89){var _0x4e934e=typeof _0x203219[_0x9373('0x1f')]===_0x9373('0x20')&&typeof _0x203219[_0x9373('0x21')]==='undefined';var _0x35dd8f=_0x3b3e89[_0x9373('0x22')];var _0x1f3944=_0x4e934e?0x0:_0x203219[_0x9373('0x1f')];var _0x47249e=_0x4e934e?_0x3b3e89['count']:_0x203219[_0x9373('0x1f')]+_0x203219[_0x9373('0x21')];var _0x283ba6;if(_0x47249e>=_0x35dd8f){_0x47249e=_0x35dd8f;_0x283ba6=0xc8;}else{_0x283ba6=0xce;}_0x2a92d5['status'](_0x283ba6);return _0x2a92d5[_0x9373('0x23')](_0x9373('0x24'),_0x1f3944+'-'+_0x47249e+'/'+_0x35dd8f)['json'](_0x3b3e89);}return null;};}function patchUpdates(_0x371d59){return function(_0x28090a){try{jsonpatch[_0x9373('0x25')](_0x28090a,_0x371d59,!![]);}catch(_0x49713c){return BPromise[_0x9373('0x26')](_0x49713c);}return _0x28090a[_0x9373('0x27')]();};}function saveUpdates(_0x593a3b,_0x2c0b93){return function(_0x5871d7){if(_0x5871d7){return _0x5871d7[_0x9373('0x28')](_0x593a3b)['then'](function(_0xc4f2b7){return _0xc4f2b7;});}return null;};}function removeEntity(_0x367086,_0x17b2c9){return function(_0x14a440){if(_0x14a440){return _0x14a440['destroy']()[_0x9373('0x29')](function(){var _0x4760d4=_0x14a440['get']({'plain':!![]});var _0x14414b=_0x9373('0x2a');return db[_0x9373('0x2b')]['destroy']({'where':{'type':_0x14414b,'resourceId':_0x4760d4['id']}})[_0x9373('0x29')](function(){return _0x14a440;});})[_0x9373('0x29')](function(){_0x367086[_0x9373('0x1c')](0xcc)[_0x9373('0x1d')]();});}};}function handleEntityNotFound(_0x2cb5a5,_0x10be41){return function(_0x19d524){if(!_0x19d524){_0x2cb5a5[_0x9373('0x1b')](0x194);}return _0x19d524;};}function handleError(_0x244c01,_0x279791){_0x279791=_0x279791||0x1f4;return function(_0x5c7549){logger['error'](_0x5c7549[_0x9373('0x2c')]);if(_0x5c7549[_0x9373('0x2d')]){delete _0x5c7549[_0x9373('0x2d')];}_0x244c01[_0x9373('0x1c')](_0x279791)[_0x9373('0x2e')](_0x5c7549);};}exports[_0x9373('0x2f')]=function(_0x146e1c,_0x2d914b){var _0x4535e4={},_0x319494={},_0x40e69c={'count':0x0,'rows':[]};var _0x4e70e6=_[_0x9373('0x30')](db['CmList'][_0x9373('0x31')],function(_0xda0b56){return{'name':_0xda0b56['fieldName'],'type':_0xda0b56[_0x9373('0x32')][_0x9373('0x33')]};});_0x319494[_0x9373('0x34')]=_[_0x9373('0x30')](_0x4e70e6,_0x9373('0x2d'));_0x319494['query']=_[_0x9373('0x35')](_0x146e1c[_0x9373('0x36')]);_0x319494[_0x9373('0x37')]=_[_0x9373('0x38')](_0x319494[_0x9373('0x34')],_0x319494['query']);_0x4535e4[_0x9373('0x39')]=_['intersection'](_0x319494[_0x9373('0x34')],qs[_0x9373('0x3a')](_0x146e1c[_0x9373('0x36')][_0x9373('0x3a')]));_0x4535e4[_0x9373('0x39')]=_0x4535e4['attributes'][_0x9373('0x3b')]?_0x4535e4[_0x9373('0x39')]:_0x319494['model'];if(!_0x146e1c[_0x9373('0x36')][_0x9373('0x3c')](_0x9373('0x3d'))){_0x4535e4[_0x9373('0x21')]=qs[_0x9373('0x21')](_0x146e1c[_0x9373('0x36')]['limit']);_0x4535e4[_0x9373('0x1f')]=qs['offset'](_0x146e1c[_0x9373('0x36')][_0x9373('0x1f')]);}_0x4535e4['order']=qs[_0x9373('0x3e')](_0x146e1c['query'][_0x9373('0x3e')]);_0x4535e4[_0x9373('0x3f')]=qs[_0x9373('0x37')](_['pick'](_0x146e1c[_0x9373('0x36')],_0x319494['filters']),_0x4e70e6);if(_0x146e1c['query'][_0x9373('0x40')]){_0x4535e4[_0x9373('0x3f')]=_[_0x9373('0x41')](_0x4535e4[_0x9373('0x3f')],{'$or':_[_0x9373('0x30')](_0x4e70e6,function(_0x361af3){if(_0x361af3[_0x9373('0x32')]!==_0x9373('0x42')){var _0x3f46c2={};_0x3f46c2[_0x361af3['name']]={'$like':'%'+_0x146e1c[_0x9373('0x36')][_0x9373('0x40')]+'%'};return _0x3f46c2;}})});}_0x4535e4=_[_0x9373('0x41')]({},_0x4535e4,_0x146e1c[_0x9373('0x43')]);var _0x22833d={'where':_0x4535e4[_0x9373('0x3f')]};return db['CmList'][_0x9373('0x22')](_0x22833d)[_0x9373('0x29')](function(_0x50c930){_0x40e69c[_0x9373('0x22')]=_0x50c930;if(_0x146e1c[_0x9373('0x36')][_0x9373('0x44')]){_0x4535e4[_0x9373('0x45')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x4535e4);})[_0x9373('0x29')](function(_0x28537e){_0x40e69c['rows']=_0x28537e;return _0x40e69c;})['then'](respondWithFilteredResult(_0x2d914b,_0x4535e4))[_0x9373('0x46')](handleError(_0x2d914b,null));};exports[_0x9373('0x47')]=function(_0x49c946,_0x31125b){var _0x3d10bc={'raw':![],'where':{'id':_0x49c946['params']['id']}},_0x745bca={};_0x745bca[_0x9373('0x34')]=_['keys'](db['CmList']['rawAttributes']);_0x745bca[_0x9373('0x36')]=_['keys'](_0x49c946[_0x9373('0x36')]);_0x745bca[_0x9373('0x37')]=_[_0x9373('0x38')](_0x745bca[_0x9373('0x34')],_0x745bca['query']);_0x3d10bc[_0x9373('0x39')]=_[_0x9373('0x38')](_0x745bca[_0x9373('0x34')],qs[_0x9373('0x3a')](_0x49c946['query'][_0x9373('0x3a')]));_0x3d10bc[_0x9373('0x39')]=_0x3d10bc['attributes']['length']?_0x3d10bc['attributes']:_0x745bca[_0x9373('0x34')];if(_0x49c946['query'][_0x9373('0x44')]){_0x3d10bc[_0x9373('0x45')]=[{'all':!![]}];}_0x3d10bc=_[_0x9373('0x41')]({},_0x3d10bc,_0x49c946[_0x9373('0x43')]);return db[_0x9373('0x48')]['find'](_0x3d10bc)[_0x9373('0x29')](handleEntityNotFound(_0x31125b,null))[_0x9373('0x29')](respondWithResult(_0x31125b,null))['catch'](handleError(_0x31125b,null));};exports[_0x9373('0x49')]=function(_0x49c8d7,_0x5f0879){return db[_0x9373('0x48')]['create'](_0x49c8d7['body'],{})[_0x9373('0x29')](function(_0x2d55ec){var _0x1d60b0=_0x49c8d7[_0x9373('0x4a')][_0x9373('0x4b')]({'plain':!![]});if(!_0x1d60b0)throw new Error(_0x9373('0x4c'));if(_0x1d60b0[_0x9373('0x4d')]==='user'){var _0x3bda79=_0x2d55ec[_0x9373('0x4b')]({'plain':!![]});var _0x508549=_0x9373('0x2a');return db[_0x9373('0x4e')][_0x9373('0x4f')]({'where':{'name':_0x508549,'userProfileId':_0x1d60b0[_0x9373('0x50')]},'raw':!![]})[_0x9373('0x29')](function(_0xb14544){if(_0xb14544&&_0xb14544[_0x9373('0x51')]===0x0){return db['UserProfileResource'][_0x9373('0x49')]({'name':_0x3bda79[_0x9373('0x2d')],'resourceId':_0x3bda79['id'],'type':_0xb14544['name'],'sectionId':_0xb14544['id']},{})[_0x9373('0x29')](function(){return _0x2d55ec;});}else{return _0x2d55ec;}})[_0x9373('0x46')](function(_0x391a12){logger[_0x9373('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x391a12);throw _0x391a12;});}return _0x2d55ec;})[_0x9373('0x29')](respondWithResult(_0x5f0879,0xc9))[_0x9373('0x46')](handleError(_0x5f0879,null));};exports[_0x9373('0x28')]=function(_0x1d13a9,_0x7f78ea){if(_0x1d13a9[_0x9373('0x53')]['id']){delete _0x1d13a9['body']['id'];}return db[_0x9373('0x48')][_0x9373('0x4f')]({'where':{'id':_0x1d13a9[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x7f78ea,null))[_0x9373('0x29')](saveUpdates(_0x1d13a9[_0x9373('0x53')],null))[_0x9373('0x29')](respondWithResult(_0x7f78ea,null))[_0x9373('0x46')](handleError(_0x7f78ea,null));};exports[_0x9373('0x55')]=function(_0x2d230c,_0x132204){return db['CmList'][_0x9373('0x4f')]({'where':{'id':_0x2d230c[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x132204,null))[_0x9373('0x29')](removeEntity(_0x132204,null))[_0x9373('0x46')](handleError(_0x132204,null));};exports['describe']=function(_0x43afd3,_0x5beca4){return db[_0x9373('0x48')][_0x9373('0x56')]()['then'](respondWithResult(_0x5beca4,null))[_0x9373('0x46')](handleError(_0x5beca4,null));};exports[_0x9373('0x57')]=function(_0x38bb67,_0x4028a5,_0x51991d){if(_0x38bb67[_0x9373('0x53')]['id']){delete _0x38bb67['body']['id'];}return db[_0x9373('0x48')][_0x9373('0x4f')]({'where':{'id':_0x38bb67[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x4028a5,null))[_0x9373('0x29')](function(_0x308d64){if(_0x308d64){_0x38bb67['body'][_0x9373('0x58')]=_0x308d64['id'];return db['Disposition'][_0x9373('0x49')](_0x38bb67[_0x9373('0x53')]);}})[_0x9373('0x29')](respondWithResult(_0x4028a5,null))[_0x9373('0x46')](handleError(_0x4028a5,null));};exports[_0x9373('0x59')]=function(_0x4dbb20,_0x3475fb,_0x38aa8c){var _0x262aa4={'raw':![],'where':{}};var _0x4c81e4={};var _0x3bc3b2={'count':0x0,'rows':[]};return db['CmList'][_0x9373('0x5a')]({'where':{'id':_0x4dbb20[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x3475fb,null))[_0x9373('0x29')](function(_0x8fb2fe){if(_0x8fb2fe){_0x4c81e4[_0x9373('0x34')]=_[_0x9373('0x35')](db[_0x9373('0x5b')][_0x9373('0x31')]);_0x4c81e4[_0x9373('0x36')]=_[_0x9373('0x35')](_0x4dbb20[_0x9373('0x36')]);_0x4c81e4[_0x9373('0x37')]=_[_0x9373('0x38')](_0x4c81e4[_0x9373('0x34')],_0x4c81e4[_0x9373('0x36')]);_0x262aa4['attributes']=_['intersection'](_0x4c81e4[_0x9373('0x34')],qs[_0x9373('0x3a')](_0x4dbb20['query']['fields']));_0x262aa4['attributes']=_0x262aa4[_0x9373('0x39')][_0x9373('0x3b')]?_0x262aa4[_0x9373('0x39')]:_0x4c81e4['model'];if(!_0x4dbb20['query'][_0x9373('0x3c')](_0x9373('0x3d'))){_0x262aa4[_0x9373('0x21')]=qs[_0x9373('0x21')](_0x4dbb20[_0x9373('0x36')][_0x9373('0x21')]);_0x262aa4['offset']=qs['offset'](_0x4dbb20['query'][_0x9373('0x1f')]);}_0x262aa4[_0x9373('0x5c')]=qs['sort'](_0x4dbb20[_0x9373('0x36')]['sort']);_0x262aa4[_0x9373('0x3f')]=qs[_0x9373('0x37')](_[_0x9373('0x5d')](_0x4dbb20[_0x9373('0x36')],_0x4c81e4[_0x9373('0x37')]));_0x262aa4['where'][_0x9373('0x58')]=_0x8fb2fe['id'];if(_0x4dbb20[_0x9373('0x36')][_0x9373('0x40')]){_0x262aa4[_0x9373('0x3f')]=_[_0x9373('0x41')](_0x262aa4['where'],{'$or':_[_0x9373('0x30')](_0x262aa4['attributes'],function(_0x46e9f3){var _0x26e716={};_0x26e716[_0x46e9f3]={'$like':'%'+_0x4dbb20[_0x9373('0x36')][_0x9373('0x40')]+'%'};return _0x26e716;})});}_0x262aa4=_[_0x9373('0x41')]({},_0x262aa4,_0x4dbb20[_0x9373('0x43')]);return db[_0x9373('0x5b')]['count']({'where':_0x262aa4[_0x9373('0x3f')]})[_0x9373('0x29')](function(_0xc959e7){_0x3bc3b2['count']=_0xc959e7;if(_0x4dbb20['query']['includeAll']){_0x262aa4[_0x9373('0x45')]=[{'all':!![]}];}return db[_0x9373('0x5b')][_0x9373('0x5e')](_0x262aa4);})[_0x9373('0x29')](function(_0x5c4bb2){_0x3bc3b2[_0x9373('0x5f')]=_0x5c4bb2;return _0x3bc3b2;});}})['then'](respondWithFilteredResult(_0x3475fb,_0x262aa4))[_0x9373('0x46')](handleError(_0x3475fb,null));};exports['removeDispositions']=function(_0x5016d2,_0x420167,_0x592bd5){return db['CmList'][_0x9373('0x4f')]({'where':{'id':_0x5016d2[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x420167,null))[_0x9373('0x29')](function(_0x5548ef){if(_0x5548ef){return _0x5548ef['removeDispositions'](_0x5016d2[_0x9373('0x36')][_0x9373('0x60')]);}})[_0x9373('0x29')](respondWithStatusCode(_0x420167,null))[_0x9373('0x46')](handleError(_0x420167,null));};exports[_0x9373('0x61')]=function(_0x24aae0,_0x50746d,_0x1b665d){return db[_0x9373('0x48')][_0x9373('0x4f')]({'where':{'id':_0x24aae0[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x50746d,null))[_0x9373('0x29')](function(_0x2b1715){if(_0x2b1715){var _0x2c1187=[];var _0x4e994a={'success':[],'errors':[]};return db[_0x9373('0x62')]['describe']()[_0x9373('0x29')](function(_0x6e86b){if(_0x24aae0[_0x9373('0x53')][_0x9373('0x63')]&&_[_0x9373('0x64')](_0x24aae0['body'][_0x9373('0x63')])){if(_0x24aae0[_0x9373('0x53')][_0x9373('0x63')]['length']){_0x24aae0[_0x9373('0x53')]['tags']=_0x24aae0['body'][_0x9373('0x63')]['join'](';')+';';}else{_0x24aae0[_0x9373('0x53')][_0x9373('0x63')]=null;}}else{_0x24aae0[_0x9373('0x53')]['tags']=null;}if(_0x24aae0['body']&&_[_0x9373('0x64')](_0x24aae0['body'])){for(var _0x2f2dc4=0x0;_0x2f2dc4<_0x24aae0[_0x9373('0x53')]['length'];_0x2f2dc4+=0x1){_0x24aae0[_0x9373('0x53')][_0x2f2dc4][_0x9373('0x58')]=_0x24aae0[_0x9373('0x54')]['id'];_0x2c1187[_0x9373('0x65')](_0x24aae0[_0x9373('0x53')][_0x2f2dc4]);}return BPromise[_0x9373('0x66')](_0x2c1187,function(_0x5083d7){return db['CmContact']['create'](_[_0x9373('0x67')](_0x5083d7,[_0x9373('0x60'),'id'])||{},{'fields':_[_0x9373('0x35')](_0x6e86b),'raw':!![]})[_0x9373('0x29')](function(_0x2ed2bf){_0x4e994a[_0x9373('0x68')][_0x9373('0x65')](_0x2ed2bf['dataValues']);})['catch'](function(_0x42d239){_0x4e994a[_0x9373('0x69')]['push']({'data':_0x5083d7,'error':_0x42d239[_0x9373('0x6a')]});});})[_0x9373('0x29')](function(_0x54b53c){return _0x4e994a;})[_0x9373('0x46')](function(_0x2052ec){return _0x2052ec;});}else{_0x50746d['status'](0x190)[_0x9373('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x9373('0x29')](respondWithResult(_0x50746d,null))['catch'](handleError(_0x50746d,null));};exports[_0x9373('0x6b')]=function(_0x593e36,_0x353b0e,_0x5dbd1c){var _0x5ec17b;return db[_0x9373('0x48')]['find']({'where':{'id':_0x593e36[_0x9373('0x54')]['id']},'include':[{'model':db[_0x9373('0x6c')],'as':_0x9373('0x6d')}]})[_0x9373('0x29')](handleEntityNotFound(_0x353b0e,null))[_0x9373('0x29')](function(_0x5eb7d0){if(_0x5eb7d0){_0x5ec17b=_0x5eb7d0;return db['CmContact'][_0x9373('0x31')];}})[_0x9373('0x29')](function(_0x40fce3){if(_0x40fce3){var _0x16d20a={};var _0x480800={};_0x480800['model']=_[_0x9373('0x6e')](_[_0x9373('0x35')](_0x40fce3),_[_0x9373('0x30')](_0x5ec17b[_0x9373('0x6d')],function(_0x15815d){return util[_0x9373('0x6f')]('cf_%d',_0x15815d['id']);}));_0x480800[_0x9373('0x36')]=_[_0x9373('0x35')](_0x593e36['query']);_0x480800['filters']=_['intersection'](_0x480800[_0x9373('0x34')],_0x480800['query']);_0x16d20a[_0x9373('0x39')]=_[_0x9373('0x38')](_0x480800['model'],qs['fields'](_0x593e36[_0x9373('0x36')][_0x9373('0x3a')]));_0x16d20a[_0x9373('0x39')]=_0x16d20a['attributes'][_0x9373('0x3b')]?_0x16d20a[_0x9373('0x39')]:_0x480800[_0x9373('0x34')];if(!_0x593e36[_0x9373('0x36')]['hasOwnProperty'](_0x9373('0x3d'))){_0x16d20a[_0x9373('0x21')]=qs[_0x9373('0x21')](_0x593e36[_0x9373('0x36')]['limit']);_0x16d20a['offset']=qs[_0x9373('0x1f')](_0x593e36[_0x9373('0x36')][_0x9373('0x1f')]);}_0x16d20a[_0x9373('0x5c')]=qs[_0x9373('0x3e')](_0x593e36[_0x9373('0x36')][_0x9373('0x3e')]);_0x16d20a[_0x9373('0x3f')]=qs[_0x9373('0x37')](_[_0x9373('0x5d')](_0x593e36[_0x9373('0x36')],_0x480800[_0x9373('0x37')]));_0x16d20a['raw']=!![];if(_0x593e36[_0x9373('0x36')]['filter']){_0x16d20a[_0x9373('0x3f')]=_[_0x9373('0x41')](_0x16d20a[_0x9373('0x3f')],{'$or':_[_0x9373('0x30')](_0x16d20a['attributes'],function(_0x2c8f74){var _0xe30994={};_0xe30994[_0x2c8f74]={'$like':'%'+_0x593e36[_0x9373('0x36')][_0x9373('0x40')]+'%'};return _0xe30994;})});}_0x16d20a=_[_0x9373('0x41')]({},_0x16d20a,_0x593e36[_0x9373('0x43')]);return _0x5ec17b['getContacts'](_0x16d20a);}})['then'](respondWithResult(_0x353b0e,null))['catch'](handleError(_0x353b0e,null));};exports['getContactsCsv']=function(_0x147849,_0x1be8ac,_0x670a43){var _0xb255cb;return db[_0x9373('0x48')][_0x9373('0x4f')]({'where':{'id':_0x147849[_0x9373('0x54')]['id']},'include':[{'model':db[_0x9373('0x6c')],'as':_0x9373('0x6d')}]})[_0x9373('0x29')](handleEntityNotFound(_0x1be8ac,null))['then'](function(_0x4b0d58){if(_0x4b0d58){_0xb255cb=_0x4b0d58;return db[_0x9373('0x62')]['rawAttributes'];}})['then'](function(_0x5b7ca1){if(_0x5b7ca1){var _0x332c42={};var _0x2b8fb5={};_0x2b8fb5[_0x9373('0x34')]=_[_0x9373('0x6e')](_['keys'](_0x5b7ca1),_[_0x9373('0x30')](_0xb255cb[_0x9373('0x6d')],function(_0x5f0748){return util[_0x9373('0x6f')]('cf_%d',_0x5f0748['id']);}));_0x2b8fb5[_0x9373('0x36')]=_['keys'](_0x147849[_0x9373('0x36')]);_0x2b8fb5[_0x9373('0x37')]=_[_0x9373('0x38')](_0x2b8fb5[_0x9373('0x34')],_0x2b8fb5['query']);_0x332c42[_0x9373('0x39')]=_[_0x9373('0x38')](_0x2b8fb5[_0x9373('0x34')],qs[_0x9373('0x3a')](_0x147849['query'][_0x9373('0x3a')]));_0x332c42[_0x9373('0x39')]=_0x332c42['attributes'][_0x9373('0x3b')]?_0x332c42[_0x9373('0x39')]:_0x2b8fb5[_0x9373('0x34')];if(!_0x147849['query'][_0x9373('0x3c')](_0x9373('0x3d'))){_0x332c42['limit']=qs['limit'](_0x147849[_0x9373('0x36')][_0x9373('0x21')]);_0x332c42['offset']=qs[_0x9373('0x1f')](_0x147849[_0x9373('0x36')]['offset']);}_0x332c42[_0x9373('0x5c')]=qs[_0x9373('0x3e')](_0x147849[_0x9373('0x36')]['sort']);_0x332c42[_0x9373('0x3f')]=qs[_0x9373('0x37')](_[_0x9373('0x5d')](_0x147849['query'],_0x2b8fb5[_0x9373('0x37')]));_0x332c42[_0x9373('0x70')]=!![];if(_0x147849[_0x9373('0x36')][_0x9373('0x40')]){_0x332c42['where']=_['merge'](_0x332c42[_0x9373('0x3f')],{'$or':_[_0x9373('0x30')](_0x332c42['attributes'],function(_0x4d70c2){var _0x43427e={};_0x43427e[_0x4d70c2]={'$like':'%'+_0x147849[_0x9373('0x36')][_0x9373('0x40')]+'%'};return _0x43427e;})});}_0x332c42=_[_0x9373('0x41')]({},_0x332c42,_0x147849[_0x9373('0x43')]);return _0xb255cb[_0x9373('0x6b')](_0x332c42);}})[_0x9373('0x29')](function(_0x84aadd){if(!_[_0x9373('0x71')](_0x84aadd)){var _0x447f67=toCsv(_0x84aadd);var _0x2b6312=Date[_0x9373('0x72')]();fs['writeFileSync'](util['format']('/tmp/list_%d_%s.csv',_0xb255cb['id'],_0x2b6312),_0x447f67);_0x1be8ac[_0x9373('0x73')]('Content-disposition',_0x9373('0x74')+util[_0x9373('0x6f')](_0x9373('0x75'),_0xb255cb['id'],_0x2b6312));_0x1be8ac[_0x9373('0x73')](_0x9373('0x76'),'text/csv');return _0x1be8ac[_0x9373('0x77')](util[_0x9373('0x6f')](_0x9373('0x78'),_0xb255cb['id'],_0x2b6312));}else{return _0x1be8ac['sendStatus'](0xcc);}})[_0x9373('0x46')](handleError(_0x1be8ac,null));};exports['addCustomField']=function(_0xd2943e,_0x1f146d,_0x47684b){var _0x4af4f7;delete _0xd2943e[_0x9373('0x53')]['id'];return db[_0x9373('0x48')][_0x9373('0x5a')]({'where':{'id':_0xd2943e[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x1f146d,null))['then'](function(_0x1af10e){if(_0x1af10e){return db[_0x9373('0x79')][_0x9373('0x7a')](function(_0x97b362){return db[_0x9373('0x6c')][_0x9373('0x49')](_0xd2943e[_0x9373('0x53')],{'transaction':_0x97b362})[_0x9373('0x29')](function(_0x1198fa){_0x4af4f7=_0x1198fa;return _0x1af10e['addCustomFields'](_0x1198fa,{'transaction':_0x97b362});})[_0x9373('0x29')](function(){var _0x54e1a0={'type':db[_0x9373('0x7b')][_0x9373('0x7c')],'transaction':_0x97b362};switch(_0xd2943e['body']['type']){case'text':_0x54e1a0[_0x9373('0x32')]=db[_0x9373('0x7b')]['TEXT'];break;case'number':_0x54e1a0['type']=db[_0x9373('0x7b')][_0x9373('0x7d')];break;case _0x9373('0x7e'):_0x54e1a0[_0x9373('0x32')]=db[_0x9373('0x7b')][_0x9373('0x7f')];_0x54e1a0['defaultValue']=![];break;default:}return db[_0x9373('0x79')][_0x9373('0x80')][_0x9373('0x81')](_0x9373('0x82'),util[_0x9373('0x6f')](_0x9373('0x83'),_0x4af4f7['id']),_0x54e1a0);})[_0x9373('0x29')](function(){return _0x4af4f7;});});}})[_0x9373('0x29')](respondWithResult(_0x1f146d,null))['catch'](handleError(_0x1f146d,null));};exports[_0x9373('0x84')]=function(_0x50803a,_0x36f9e2,_0x5b4d58){var _0x1a2537={};var _0x553d84={};var _0x24a7ed;var _0xb96cc1;return db[_0x9373('0x48')]['findOne']({'where':{'id':_0x50803a['params']['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x36f9e2,null))[_0x9373('0x29')](function(_0x398350){if(_0x398350){_0x24a7ed=_0x398350;_0x553d84[_0x9373('0x34')]=_[_0x9373('0x35')](db[_0x9373('0x6c')][_0x9373('0x31')]);_0x553d84[_0x9373('0x36')]=_[_0x9373('0x35')](_0x50803a[_0x9373('0x36')]);_0x553d84[_0x9373('0x37')]=_[_0x9373('0x38')](_0x553d84[_0x9373('0x34')],_0x553d84[_0x9373('0x36')]);_0x1a2537[_0x9373('0x39')]=_['intersection'](_0x553d84[_0x9373('0x34')],qs['fields'](_0x50803a[_0x9373('0x36')][_0x9373('0x3a')]));_0x1a2537[_0x9373('0x39')]=_0x1a2537[_0x9373('0x39')]['length']?_0x1a2537[_0x9373('0x39')]:_0x553d84[_0x9373('0x34')];_0x1a2537[_0x9373('0x5c')]=qs[_0x9373('0x3e')](_0x50803a[_0x9373('0x36')][_0x9373('0x3e')]);_0x1a2537['where']=qs[_0x9373('0x37')](_[_0x9373('0x5d')](_0x50803a['query'],_0x553d84[_0x9373('0x37')]));_0x1a2537['where']=_['merge'](_0x1a2537[_0x9373('0x3f')],{'$or':[{'ListId':_0x398350['id']},{'ListId':null}]});if(_0x50803a[_0x9373('0x36')][_0x9373('0x40')]){_0x1a2537[_0x9373('0x3f')]=_[_0x9373('0x41')](_0x1a2537[_0x9373('0x3f')],{'$or':_[_0x9373('0x30')](_0x1a2537['attributes'],function(_0x1925c5){var _0xe16c80={};_0xe16c80[_0x1925c5]={'$like':'%'+_0x50803a[_0x9373('0x36')][_0x9373('0x40')]+'%'};return _0xe16c80;})});}_0x1a2537=_[_0x9373('0x41')]({},_0x1a2537,_0x50803a[_0x9373('0x43')]);return db[_0x9373('0x6c')]['findAndCountAll'](_0x1a2537);}})[_0x9373('0x29')](respondWithResult(_0x36f9e2,null))[_0x9373('0x46')](handleError(_0x36f9e2,null));};exports[_0x9373('0x85')]=function(_0x1375da,_0x3bf47d,_0x307414){return db[_0x9373('0x48')]['find']({'where':{'id':_0x1375da[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x3bf47d,null))[_0x9373('0x29')](function(_0x225bce){if(_0x225bce){return _0x225bce['addAgents'](_0x1375da[_0x9373('0x53')][_0x9373('0x60')],_['omit'](_0x1375da['body'],['ids','id'])||{})[_0x9373('0x86')](function(_0x10d5dd){for(var _0x1e784d=0x0;_0x1e784d<_0x1375da['body']['ids'][_0x9373('0x3b')];_0x1e784d+=0x1){socket[_0x9373('0x87')]('userCmList:save',{'UserId':_0x1375da['body'][_0x9373('0x60')][_0x1e784d],'CmListId':_0x1375da[_0x9373('0x54')]['id']});}return _0x10d5dd;});}})['then'](respondWithResult(_0x3bf47d,null))[_0x9373('0x46')](handleError(_0x3bf47d,null));};exports[_0x9373('0x88')]=function(_0xc854b7,_0x3f43c4,_0x1c9f80){return db[_0x9373('0x48')][_0x9373('0x4f')]({'where':{'id':_0xc854b7[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x3f43c4,null))[_0x9373('0x29')](function(_0x193fa8){if(_0x193fa8){return _0x193fa8[_0x9373('0x88')](_0xc854b7[_0x9373('0x36')]['ids'])[_0x9373('0x29')](function(){if(_[_0x9373('0x64')](_0xc854b7[_0x9373('0x36')]['ids'])){for(var _0x3435c5=0x0;_0x3435c5<_0xc854b7[_0x9373('0x36')][_0x9373('0x60')][_0x9373('0x3b')];_0x3435c5+=0x1){socket[_0x9373('0x87')](_0x9373('0x89'),{'UserId':Number(_0xc854b7[_0x9373('0x36')][_0x9373('0x60')][_0x3435c5]),'CmListId':Number(_0xc854b7[_0x9373('0x54')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0xc854b7[_0x9373('0x36')][_0x9373('0x60')]),'CmListId':Number(_0xc854b7[_0x9373('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3f43c4,null))[_0x9373('0x46')](handleError(_0x3f43c4,null));};exports[_0x9373('0x8a')]=function(_0x20e83e,_0x417456,_0x5b6657){var _0x50bbfc={};var _0x56d815={};var _0x421944;var _0x336385;return db['CmList'][_0x9373('0x5a')]({'where':{'id':_0x20e83e[_0x9373('0x54')]['id']}})[_0x9373('0x29')](handleEntityNotFound(_0x417456,null))[_0x9373('0x29')](function(_0x1d7466){if(_0x1d7466){_0x421944=_0x1d7466;_0x56d815['model']=_[_0x9373('0x35')](db[_0x9373('0x8b')][_0x9373('0x31')]);_0x56d815[_0x9373('0x36')]=_[_0x9373('0x35')](_0x20e83e[_0x9373('0x36')]);_0x56d815[_0x9373('0x37')]=_[_0x9373('0x38')](_0x56d815[_0x9373('0x34')],_0x56d815[_0x9373('0x36')]);_0x50bbfc[_0x9373('0x39')]=_['intersection'](_0x56d815[_0x9373('0x34')],qs[_0x9373('0x3a')](_0x20e83e[_0x9373('0x36')][_0x9373('0x3a')]));_0x50bbfc['attributes']=_0x50bbfc[_0x9373('0x39')][_0x9373('0x3b')]?_0x50bbfc[_0x9373('0x39')]:_0x56d815[_0x9373('0x34')];_0x50bbfc[_0x9373('0x5c')]=qs[_0x9373('0x3e')](_0x20e83e['query']['sort']);_0x50bbfc[_0x9373('0x3f')]=qs[_0x9373('0x37')](_['pick'](_0x20e83e[_0x9373('0x36')],_0x56d815[_0x9373('0x37')]));if(_0x20e83e[_0x9373('0x36')]['filter']){_0x50bbfc[_0x9373('0x3f')]=_[_0x9373('0x41')](_0x50bbfc[_0x9373('0x3f')],{'$or':_[_0x9373('0x30')](_0x50bbfc['attributes'],function(_0x17ca49){var _0xcf63da={};_0xcf63da[_0x17ca49]={'$like':'%'+_0x20e83e[_0x9373('0x36')]['filter']+'%'};return _0xcf63da;})});}_0x50bbfc=_['merge']({},_0x50bbfc,_0x20e83e[_0x9373('0x43')]);return _0x421944[_0x9373('0x8a')](_0x50bbfc);}})[_0x9373('0x29')](function(_0x470b23){if(_0x470b23){_0x336385=_0x470b23[_0x9373('0x3b')];if(!_0x20e83e[_0x9373('0x36')][_0x9373('0x3c')]('nolimit')){_0x50bbfc['limit']=qs['limit'](_0x20e83e[_0x9373('0x36')]['limit']);_0x50bbfc['offset']=qs[_0x9373('0x1f')](_0x20e83e[_0x9373('0x36')]['offset']);}return _0x421944[_0x9373('0x8a')](_0x50bbfc);}})[_0x9373('0x29')](function(_0x1321a5){if(_0x1321a5){return _0x1321a5?{'count':_0x336385,'rows':_0x1321a5}:null;}})[_0x9373('0x29')](respondWithResult(_0x417456,null))[_0x9373('0x46')](handleError(_0x417456,null));};
\ No newline at end of file
+var _0xfd4a=['redis','defaults','localhost','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','end','stack','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','show','params','CmList','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','CmContact','tags','isArray','join','push','omit','success','errors','message','CmCustomField','cf_%d','raw','getContactsCsv','concat','format','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','sendStatus','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5b60b3,_0x39467d){var _0x4b8879=function(_0x54d9db){while(--_0x54d9db){_0x5b60b3['push'](_0x5b60b3['shift']());}};_0x4b8879(++_0x39467d);}(_0xfd4a,0x10a));var _0xafd4=function(_0x424cfb,_0x13b059){_0x424cfb=_0x424cfb-0x0;var _0xc12bba=_0xfd4a[_0x424cfb];return _0xc12bba;};'use strict';var emlformat=require(_0xafd4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafd4('0x1'));var jsonpatch=require(_0xafd4('0x2'));var rp=require(_0xafd4('0x3'));var moment=require('moment');var BPromise=require(_0xafd4('0x4'));var Mustache=require('mustache');var util=require(_0xafd4('0x5'));var path=require(_0xafd4('0x6'));var sox=require(_0xafd4('0x7'));var csv=require('to-csv');var ejs=require(_0xafd4('0x8'));var fs=require('fs');var fs_extra=require(_0xafd4('0x9'));var _=require(_0xafd4('0xa'));var squel=require(_0xafd4('0xb'));var crypto=require(_0xafd4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xafd4('0xd'));var toCsv=require(_0xafd4('0xe'));var querystring=require(_0xafd4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xafd4('0x10'));var as=require(_0xafd4('0x11'));var hardwareService=require(_0xafd4('0x12'));var logger=require('../../config/logger')(_0xafd4('0x13'));var utils=require(_0xafd4('0x14'));var config=require(_0xafd4('0x15'));var licenseUtil=require(_0xafd4('0x16'));var db=require(_0xafd4('0x17'))['db'];config[_0xafd4('0x18')]=_[_0xafd4('0x19')](config[_0xafd4('0x18')],{'host':_0xafd4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafd4('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x5a0c1e,_0x17b1ba){_0x17b1ba=_0x17b1ba||0xcc;return function(_0x4772fe){if(_0x4772fe){return _0x5a0c1e['sendStatus'](_0x17b1ba);}return _0x5a0c1e['status'](_0x17b1ba)['end']();};}function respondWithResult(_0xf08203,_0xbff16c){_0xbff16c=_0xbff16c||0xc8;return function(_0x490067){if(_0x490067){return _0xf08203['status'](_0xbff16c)['json'](_0x490067);}};}function respondWithFilteredResult(_0x32fa53,_0x278db9){return function(_0x120dd2){if(_0x120dd2){var _0x1db03b=typeof _0x278db9[_0xafd4('0x1b')]===_0xafd4('0x1c')&&typeof _0x278db9[_0xafd4('0x1d')]===_0xafd4('0x1c');var _0x350ae6=_0x120dd2['count'];var _0x418669=_0x1db03b?0x0:_0x278db9[_0xafd4('0x1b')];var _0x19e345=_0x1db03b?_0x120dd2[_0xafd4('0x1e')]:_0x278db9[_0xafd4('0x1b')]+_0x278db9['limit'];var _0x410dff;if(_0x19e345>=_0x350ae6){_0x19e345=_0x350ae6;_0x410dff=0xc8;}else{_0x410dff=0xce;}_0x32fa53[_0xafd4('0x1f')](_0x410dff);return _0x32fa53[_0xafd4('0x20')](_0xafd4('0x21'),_0x418669+'-'+_0x19e345+'/'+_0x350ae6)[_0xafd4('0x22')](_0x120dd2);}return null;};}function patchUpdates(_0x3d36d){return function(_0x3fecf9){try{jsonpatch[_0xafd4('0x23')](_0x3fecf9,_0x3d36d,!![]);}catch(_0x241bce){return BPromise['reject'](_0x241bce);}return _0x3fecf9[_0xafd4('0x24')]();};}function saveUpdates(_0x5a2252,_0x442ce0){return function(_0x68bc14){if(_0x68bc14){return _0x68bc14[_0xafd4('0x25')](_0x5a2252)[_0xafd4('0x26')](function(_0x2819ab){return _0x2819ab;});}return null;};}function removeEntity(_0x51cf6b,_0x10280a){return function(_0x336e1f){if(_0x336e1f){return _0x336e1f[_0xafd4('0x27')]()['then'](function(){var _0x65422c=_0x336e1f[_0xafd4('0x28')]({'plain':!![]});var _0x3039f6=_0xafd4('0x29');return db[_0xafd4('0x2a')][_0xafd4('0x27')]({'where':{'type':_0x3039f6,'resourceId':_0x65422c['id']}})[_0xafd4('0x26')](function(){return _0x336e1f;});})['then'](function(){_0x51cf6b['status'](0xcc)[_0xafd4('0x2b')]();});}};}function handleEntityNotFound(_0x4752a5,_0x4de2c8){return function(_0x153e94){if(!_0x153e94){_0x4752a5['sendStatus'](0x194);}return _0x153e94;};}function handleError(_0x4a5b48,_0xdfcded){_0xdfcded=_0xdfcded||0x1f4;return function(_0x2397d3){logger['error'](_0x2397d3[_0xafd4('0x2c')]);if(_0x2397d3['name']){delete _0x2397d3['name'];}_0x4a5b48[_0xafd4('0x1f')](_0xdfcded)['send'](_0x2397d3);};}exports[_0xafd4('0x2d')]=function(_0x567f91,_0x5966de){var _0x2ddbc4={},_0x4a7168={},_0x3de5f2={'count':0x0,'rows':[]};var _0x268309=_['map'](db['CmList']['rawAttributes'],function(_0xc3eee1){return{'name':_0xc3eee1[_0xafd4('0x2e')],'type':_0xc3eee1[_0xafd4('0x2f')][_0xafd4('0x30')]};});_0x4a7168[_0xafd4('0x31')]=_[_0xafd4('0x32')](_0x268309,'name');_0x4a7168[_0xafd4('0x33')]=_[_0xafd4('0x34')](_0x567f91[_0xafd4('0x33')]);_0x4a7168[_0xafd4('0x35')]=_['intersection'](_0x4a7168[_0xafd4('0x31')],_0x4a7168[_0xafd4('0x33')]);_0x2ddbc4[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x4a7168[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x567f91[_0xafd4('0x33')][_0xafd4('0x38')]));_0x2ddbc4[_0xafd4('0x36')]=_0x2ddbc4[_0xafd4('0x36')]['length']?_0x2ddbc4[_0xafd4('0x36')]:_0x4a7168['model'];if(!_0x567f91[_0xafd4('0x33')][_0xafd4('0x39')](_0xafd4('0x3a'))){_0x2ddbc4[_0xafd4('0x1d')]=qs['limit'](_0x567f91[_0xafd4('0x33')]['limit']);_0x2ddbc4['offset']=qs['offset'](_0x567f91[_0xafd4('0x33')][_0xafd4('0x1b')]);}_0x2ddbc4[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x567f91[_0xafd4('0x33')][_0xafd4('0x3c')]);_0x2ddbc4['where']=qs[_0xafd4('0x35')](_['pick'](_0x567f91[_0xafd4('0x33')],_0x4a7168['filters']),_0x268309);if(_0x567f91[_0xafd4('0x33')][_0xafd4('0x3d')]){_0x2ddbc4['where']=_['merge'](_0x2ddbc4[_0xafd4('0x3e')],{'$or':_[_0xafd4('0x32')](_0x268309,function(_0x1b828e){if(_0x1b828e['type']!==_0xafd4('0x3f')){var _0x5dcab5={};_0x5dcab5[_0x1b828e[_0xafd4('0x40')]]={'$like':'%'+_0x567f91[_0xafd4('0x33')][_0xafd4('0x3d')]+'%'};return _0x5dcab5;}})});}_0x2ddbc4=_[_0xafd4('0x41')]({},_0x2ddbc4,_0x567f91[_0xafd4('0x42')]);var _0x17d127={'where':_0x2ddbc4['where']};return db['CmList'][_0xafd4('0x1e')](_0x17d127)[_0xafd4('0x26')](function(_0x6cd381){_0x3de5f2[_0xafd4('0x1e')]=_0x6cd381;if(_0x567f91[_0xafd4('0x33')][_0xafd4('0x43')]){_0x2ddbc4[_0xafd4('0x44')]=[{'all':!![]}];}return db['CmList'][_0xafd4('0x45')](_0x2ddbc4);})[_0xafd4('0x26')](function(_0x1c4565){_0x3de5f2[_0xafd4('0x46')]=_0x1c4565;return _0x3de5f2;})[_0xafd4('0x26')](respondWithFilteredResult(_0x5966de,_0x2ddbc4))[_0xafd4('0x47')](handleError(_0x5966de,null));};exports[_0xafd4('0x48')]=function(_0x429722,_0xcfe58d){var _0x31dc41={'raw':![],'where':{'id':_0x429722[_0xafd4('0x49')]['id']}},_0x2d63fb={};_0x2d63fb[_0xafd4('0x31')]=_[_0xafd4('0x34')](db[_0xafd4('0x4a')][_0xafd4('0x4b')]);_0x2d63fb[_0xafd4('0x33')]=_[_0xafd4('0x34')](_0x429722['query']);_0x2d63fb[_0xafd4('0x35')]=_[_0xafd4('0x37')](_0x2d63fb[_0xafd4('0x31')],_0x2d63fb[_0xafd4('0x33')]);_0x31dc41[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x2d63fb[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x429722[_0xafd4('0x33')][_0xafd4('0x38')]));_0x31dc41[_0xafd4('0x36')]=_0x31dc41[_0xafd4('0x36')][_0xafd4('0x4c')]?_0x31dc41[_0xafd4('0x36')]:_0x2d63fb[_0xafd4('0x31')];if(_0x429722[_0xafd4('0x33')][_0xafd4('0x43')]){_0x31dc41[_0xafd4('0x44')]=[{'all':!![]}];}_0x31dc41=_[_0xafd4('0x41')]({},_0x31dc41,_0x429722[_0xafd4('0x42')]);return db[_0xafd4('0x4a')][_0xafd4('0x4d')](_0x31dc41)[_0xafd4('0x26')](handleEntityNotFound(_0xcfe58d,null))['then'](respondWithResult(_0xcfe58d,null))['catch'](handleError(_0xcfe58d,null));};exports[_0xafd4('0x4e')]=function(_0x3d4ea8,_0x23e0c7){return db[_0xafd4('0x4a')][_0xafd4('0x4e')](_0x3d4ea8[_0xafd4('0x4f')],{})[_0xafd4('0x26')](function(_0x3937dc){var _0x4e8722=_0x3d4ea8[_0xafd4('0x50')][_0xafd4('0x28')]({'plain':!![]});if(!_0x4e8722)throw new Error(_0xafd4('0x51'));if(_0x4e8722[_0xafd4('0x52')]===_0xafd4('0x50')){var _0x22ab5d=_0x3937dc['get']({'plain':!![]});var _0x80d264=_0xafd4('0x29');return db[_0xafd4('0x53')][_0xafd4('0x4d')]({'where':{'name':_0x80d264,'userProfileId':_0x4e8722[_0xafd4('0x54')]},'raw':!![]})[_0xafd4('0x26')](function(_0x30bdad){if(_0x30bdad&&_0x30bdad[_0xafd4('0x55')]===0x0){return db[_0xafd4('0x2a')][_0xafd4('0x4e')]({'name':_0x22ab5d[_0xafd4('0x40')],'resourceId':_0x22ab5d['id'],'type':_0x30bdad[_0xafd4('0x40')],'sectionId':_0x30bdad['id']},{})[_0xafd4('0x26')](function(){return _0x3937dc;});}else{return _0x3937dc;}})[_0xafd4('0x47')](function(_0x1f21e1){logger[_0xafd4('0x56')](_0xafd4('0x57'),_0x1f21e1);throw _0x1f21e1;});}return _0x3937dc;})['then'](respondWithResult(_0x23e0c7,0xc9))[_0xafd4('0x47')](handleError(_0x23e0c7,null));};exports[_0xafd4('0x25')]=function(_0x5b531a,_0x200d99){if(_0x5b531a[_0xafd4('0x4f')]['id']){delete _0x5b531a[_0xafd4('0x4f')]['id'];}return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x5b531a[_0xafd4('0x49')]['id']}})['then'](handleEntityNotFound(_0x200d99,null))[_0xafd4('0x26')](saveUpdates(_0x5b531a['body'],null))[_0xafd4('0x26')](respondWithResult(_0x200d99,null))[_0xafd4('0x47')](handleError(_0x200d99,null));};exports[_0xafd4('0x27')]=function(_0x591e68,_0x315ad){return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x591e68['params']['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x315ad,null))[_0xafd4('0x26')](removeEntity(_0x315ad,null))[_0xafd4('0x47')](handleError(_0x315ad,null));};exports[_0xafd4('0x58')]=function(_0x104219,_0x1075a5){return db['CmList']['describe']()[_0xafd4('0x26')](respondWithResult(_0x1075a5,null))[_0xafd4('0x47')](handleError(_0x1075a5,null));};exports[_0xafd4('0x59')]=function(_0x3fd91f,_0x21929d,_0x1c2d31){if(_0x3fd91f['body']['id']){delete _0x3fd91f['body']['id'];}return db['CmList']['find']({'where':{'id':_0x3fd91f[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x21929d,null))[_0xafd4('0x26')](function(_0x488291){if(_0x488291){_0x3fd91f[_0xafd4('0x4f')][_0xafd4('0x5a')]=_0x488291['id'];return db[_0xafd4('0x5b')][_0xafd4('0x4e')](_0x3fd91f[_0xafd4('0x4f')]);}})['then'](respondWithResult(_0x21929d,null))[_0xafd4('0x47')](handleError(_0x21929d,null));};exports[_0xafd4('0x5c')]=function(_0x8797b9,_0x154462,_0x5f59ce){var _0x5f3dda={'raw':![],'where':{}};var _0x65bb70={};var _0x2c0378={'count':0x0,'rows':[]};return db[_0xafd4('0x4a')][_0xafd4('0x5d')]({'where':{'id':_0x8797b9[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x154462,null))['then'](function(_0x5e09db){if(_0x5e09db){_0x65bb70[_0xafd4('0x31')]=_['keys'](db[_0xafd4('0x5b')][_0xafd4('0x4b')]);_0x65bb70[_0xafd4('0x33')]=_['keys'](_0x8797b9['query']);_0x65bb70[_0xafd4('0x35')]=_[_0xafd4('0x37')](_0x65bb70[_0xafd4('0x31')],_0x65bb70[_0xafd4('0x33')]);_0x5f3dda[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x65bb70[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x8797b9[_0xafd4('0x33')][_0xafd4('0x38')]));_0x5f3dda[_0xafd4('0x36')]=_0x5f3dda[_0xafd4('0x36')]['length']?_0x5f3dda['attributes']:_0x65bb70[_0xafd4('0x31')];if(!_0x8797b9[_0xafd4('0x33')][_0xafd4('0x39')](_0xafd4('0x3a'))){_0x5f3dda['limit']=qs[_0xafd4('0x1d')](_0x8797b9[_0xafd4('0x33')][_0xafd4('0x1d')]);_0x5f3dda[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x8797b9[_0xafd4('0x33')]['offset']);}_0x5f3dda['order']=qs['sort'](_0x8797b9['query'][_0xafd4('0x3c')]);_0x5f3dda['where']=qs[_0xafd4('0x35')](_[_0xafd4('0x5e')](_0x8797b9[_0xafd4('0x33')],_0x65bb70[_0xafd4('0x35')]));_0x5f3dda[_0xafd4('0x3e')]['ListId']=_0x5e09db['id'];if(_0x8797b9[_0xafd4('0x33')][_0xafd4('0x3d')]){_0x5f3dda[_0xafd4('0x3e')]=_[_0xafd4('0x41')](_0x5f3dda['where'],{'$or':_[_0xafd4('0x32')](_0x5f3dda[_0xafd4('0x36')],function(_0x1a1b9e){var _0x3d67bb={};_0x3d67bb[_0x1a1b9e]={'$like':'%'+_0x8797b9[_0xafd4('0x33')]['filter']+'%'};return _0x3d67bb;})});}_0x5f3dda=_[_0xafd4('0x41')]({},_0x5f3dda,_0x8797b9[_0xafd4('0x42')]);return db[_0xafd4('0x5b')][_0xafd4('0x1e')]({'where':_0x5f3dda['where']})[_0xafd4('0x26')](function(_0x6eff1f){_0x2c0378[_0xafd4('0x1e')]=_0x6eff1f;if(_0x8797b9[_0xafd4('0x33')][_0xafd4('0x43')]){_0x5f3dda[_0xafd4('0x44')]=[{'all':!![]}];}return db[_0xafd4('0x5b')]['findAll'](_0x5f3dda);})[_0xafd4('0x26')](function(_0x3ff965){_0x2c0378[_0xafd4('0x46')]=_0x3ff965;return _0x2c0378;});}})[_0xafd4('0x26')](respondWithFilteredResult(_0x154462,_0x5f3dda))[_0xafd4('0x47')](handleError(_0x154462,null));};exports[_0xafd4('0x5f')]=function(_0x419adf,_0x239755,_0x1d965c){return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x419adf[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x239755,null))['then'](function(_0x3ac923){if(_0x3ac923){return _0x3ac923[_0xafd4('0x5f')](_0x419adf[_0xafd4('0x33')][_0xafd4('0x60')]);}})[_0xafd4('0x26')](respondWithStatusCode(_0x239755,null))[_0xafd4('0x47')](handleError(_0x239755,null));};exports['addContacts']=function(_0x34e376,_0x570aa7,_0x58ec78){return db['CmList']['find']({'where':{'id':_0x34e376[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x570aa7,null))[_0xafd4('0x26')](function(_0x4dedff){if(_0x4dedff){var _0xdfb9ae=[];var _0x18c6a6={'success':[],'errors':[]};return db[_0xafd4('0x61')][_0xafd4('0x58')]()[_0xafd4('0x26')](function(_0x25988f){if(_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')]&&_[_0xafd4('0x63')](_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')])){if(_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')][_0xafd4('0x4c')]){_0x34e376[_0xafd4('0x4f')]['tags']=_0x34e376['body']['tags'][_0xafd4('0x64')](';')+';';}else{_0x34e376[_0xafd4('0x4f')][_0xafd4('0x62')]=null;}}else{_0x34e376['body'][_0xafd4('0x62')]=null;}if(_0x34e376['body']&&_['isArray'](_0x34e376['body'])){for(var _0x499024=0x0;_0x499024<_0x34e376[_0xafd4('0x4f')][_0xafd4('0x4c')];_0x499024+=0x1){_0x34e376[_0xafd4('0x4f')][_0x499024][_0xafd4('0x5a')]=_0x34e376['params']['id'];_0xdfb9ae[_0xafd4('0x65')](_0x34e376['body'][_0x499024]);}return BPromise['each'](_0xdfb9ae,function(_0x4b7b09){return db[_0xafd4('0x61')][_0xafd4('0x4e')](_[_0xafd4('0x66')](_0x4b7b09,['ids','id'])||{},{'fields':_[_0xafd4('0x34')](_0x25988f),'raw':!![]})[_0xafd4('0x26')](function(_0x269933){_0x18c6a6[_0xafd4('0x67')][_0xafd4('0x65')](_0x269933['dataValues']);})['catch'](function(_0x20b16a){_0x18c6a6[_0xafd4('0x68')][_0xafd4('0x65')]({'data':_0x4b7b09,'error':_0x20b16a[_0xafd4('0x69')]});});})[_0xafd4('0x26')](function(_0x1dfa3e){return _0x18c6a6;})[_0xafd4('0x47')](function(_0x539f8d){return _0x539f8d;});}else{_0x570aa7[_0xafd4('0x1f')](0x190)[_0xafd4('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xafd4('0x26')](respondWithResult(_0x570aa7,null))[_0xafd4('0x47')](handleError(_0x570aa7,null));};exports['getContacts']=function(_0x51cb82,_0x16f1ca,_0x4d16b3){var _0x585020;return db['CmList']['find']({'where':{'id':_0x51cb82['params']['id']},'include':[{'model':db[_0xafd4('0x6a')],'as':'CustomFields'}]})[_0xafd4('0x26')](handleEntityNotFound(_0x16f1ca,null))[_0xafd4('0x26')](function(_0x484ae7){if(_0x484ae7){_0x585020=_0x484ae7;return db[_0xafd4('0x61')]['rawAttributes'];}})[_0xafd4('0x26')](function(_0x5a624f){if(_0x5a624f){var _0x3be0e3={};var _0x3a1871={};_0x3a1871[_0xafd4('0x31')]=_['concat'](_[_0xafd4('0x34')](_0x5a624f),_[_0xafd4('0x32')](_0x585020['CustomFields'],function(_0x29ff6f){return util['format'](_0xafd4('0x6b'),_0x29ff6f['id']);}));_0x3a1871[_0xafd4('0x33')]=_[_0xafd4('0x34')](_0x51cb82[_0xafd4('0x33')]);_0x3a1871[_0xafd4('0x35')]=_[_0xafd4('0x37')](_0x3a1871['model'],_0x3a1871[_0xafd4('0x33')]);_0x3be0e3[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x3a1871[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x51cb82[_0xafd4('0x33')][_0xafd4('0x38')]));_0x3be0e3[_0xafd4('0x36')]=_0x3be0e3[_0xafd4('0x36')]['length']?_0x3be0e3['attributes']:_0x3a1871['model'];if(!_0x51cb82[_0xafd4('0x33')][_0xafd4('0x39')]('nolimit')){_0x3be0e3['limit']=qs['limit'](_0x51cb82['query'][_0xafd4('0x1d')]);_0x3be0e3[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x51cb82[_0xafd4('0x33')][_0xafd4('0x1b')]);}_0x3be0e3[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x51cb82[_0xafd4('0x33')][_0xafd4('0x3c')]);_0x3be0e3[_0xafd4('0x3e')]=qs[_0xafd4('0x35')](_[_0xafd4('0x5e')](_0x51cb82[_0xafd4('0x33')],_0x3a1871[_0xafd4('0x35')]));_0x3be0e3[_0xafd4('0x6c')]=!![];if(_0x51cb82['query'][_0xafd4('0x3d')]){_0x3be0e3[_0xafd4('0x3e')]=_['merge'](_0x3be0e3[_0xafd4('0x3e')],{'$or':_['map'](_0x3be0e3['attributes'],function(_0x29e2f9){var _0x49053b={};_0x49053b[_0x29e2f9]={'$like':'%'+_0x51cb82[_0xafd4('0x33')][_0xafd4('0x3d')]+'%'};return _0x49053b;})});}_0x3be0e3=_['merge']({},_0x3be0e3,_0x51cb82[_0xafd4('0x42')]);return _0x585020['getContacts'](_0x3be0e3);}})['then'](respondWithResult(_0x16f1ca,null))[_0xafd4('0x47')](handleError(_0x16f1ca,null));};exports[_0xafd4('0x6d')]=function(_0x419446,_0x492cbb,_0x1b4e40){var _0x270da9;return db[_0xafd4('0x4a')]['find']({'where':{'id':_0x419446['params']['id']},'include':[{'model':db[_0xafd4('0x6a')],'as':'CustomFields'}]})[_0xafd4('0x26')](handleEntityNotFound(_0x492cbb,null))['then'](function(_0x1bdcd7){if(_0x1bdcd7){_0x270da9=_0x1bdcd7;return db[_0xafd4('0x61')]['rawAttributes'];}})['then'](function(_0x2f995d){if(_0x2f995d){var _0x49efa3={};var _0x2dc84d={};_0x2dc84d['model']=_[_0xafd4('0x6e')](_[_0xafd4('0x34')](_0x2f995d),_[_0xafd4('0x32')](_0x270da9['CustomFields'],function(_0x213527){return util[_0xafd4('0x6f')](_0xafd4('0x6b'),_0x213527['id']);}));_0x2dc84d['query']=_[_0xafd4('0x34')](_0x419446['query']);_0x2dc84d[_0xafd4('0x35')]=_['intersection'](_0x2dc84d[_0xafd4('0x31')],_0x2dc84d[_0xafd4('0x33')]);_0x49efa3[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x2dc84d[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x419446[_0xafd4('0x33')][_0xafd4('0x38')]));_0x49efa3[_0xafd4('0x36')]=_0x49efa3[_0xafd4('0x36')][_0xafd4('0x4c')]?_0x49efa3['attributes']:_0x2dc84d[_0xafd4('0x31')];if(!_0x419446['query']['hasOwnProperty'](_0xafd4('0x3a'))){_0x49efa3[_0xafd4('0x1d')]=qs[_0xafd4('0x1d')](_0x419446['query'][_0xafd4('0x1d')]);_0x49efa3[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x419446[_0xafd4('0x33')][_0xafd4('0x1b')]);}_0x49efa3[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x419446['query'][_0xafd4('0x3c')]);_0x49efa3[_0xafd4('0x3e')]=qs['filters'](_[_0xafd4('0x5e')](_0x419446['query'],_0x2dc84d[_0xafd4('0x35')]));_0x49efa3[_0xafd4('0x6c')]=!![];if(_0x419446[_0xafd4('0x33')]['filter']){_0x49efa3[_0xafd4('0x3e')]=_[_0xafd4('0x41')](_0x49efa3[_0xafd4('0x3e')],{'$or':_['map'](_0x49efa3['attributes'],function(_0x2b338){var _0x53ddf5={};_0x53ddf5[_0x2b338]={'$like':'%'+_0x419446['query'][_0xafd4('0x3d')]+'%'};return _0x53ddf5;})});}_0x49efa3=_[_0xafd4('0x41')]({},_0x49efa3,_0x419446[_0xafd4('0x42')]);return _0x270da9[_0xafd4('0x70')](_0x49efa3);}})[_0xafd4('0x26')](function(_0x195e96){if(!_[_0xafd4('0x71')](_0x195e96)){var _0x372f43=toCsv(_0x195e96);var _0x35a793=Date[_0xafd4('0x72')]();fs['writeFileSync'](util[_0xafd4('0x6f')](_0xafd4('0x73'),_0x270da9['id'],_0x35a793),_0x372f43);_0x492cbb['setHeader'](_0xafd4('0x74'),_0xafd4('0x75')+util[_0xafd4('0x6f')](_0xafd4('0x76'),_0x270da9['id'],_0x35a793));_0x492cbb['setHeader'](_0xafd4('0x77'),_0xafd4('0x78'));return _0x492cbb['download'](util[_0xafd4('0x6f')](_0xafd4('0x73'),_0x270da9['id'],_0x35a793));}else{return _0x492cbb[_0xafd4('0x79')](0xcc);}})[_0xafd4('0x47')](handleError(_0x492cbb,null));};exports['addCustomField']=function(_0x401e71,_0x4134ba,_0xd5cf24){var _0x3c5e63;delete _0x401e71[_0xafd4('0x4f')]['id'];return db['CmList'][_0xafd4('0x5d')]({'where':{'id':_0x401e71[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x4134ba,null))['then'](function(_0x5e9baf){if(_0x5e9baf){return db[_0xafd4('0x7a')][_0xafd4('0x7b')](function(_0x1b74f9){return db['CmCustomField'][_0xafd4('0x4e')](_0x401e71[_0xafd4('0x4f')],{'transaction':_0x1b74f9})[_0xafd4('0x26')](function(_0x44e9f4){_0x3c5e63=_0x44e9f4;return _0x5e9baf[_0xafd4('0x7c')](_0x44e9f4,{'transaction':_0x1b74f9});})['then'](function(){var _0x475bfe={'type':db[_0xafd4('0x7d')]['TEXT'],'transaction':_0x1b74f9};switch(_0x401e71[_0xafd4('0x4f')]['type']){case _0xafd4('0x7e'):_0x475bfe[_0xafd4('0x2f')]=db[_0xafd4('0x7d')][_0xafd4('0x7f')];break;case _0xafd4('0x80'):_0x475bfe['type']=db[_0xafd4('0x7d')][_0xafd4('0x81')];break;case _0xafd4('0x82'):_0x475bfe[_0xafd4('0x2f')]=db['Sequelize']['BOOLEAN'];_0x475bfe[_0xafd4('0x83')]=![];break;default:}return db['sequelize'][_0xafd4('0x84')][_0xafd4('0x85')](_0xafd4('0x86'),util['format']('cf_%s',_0x3c5e63['id']),_0x475bfe);})[_0xafd4('0x26')](function(){return _0x3c5e63;});});}})[_0xafd4('0x26')](respondWithResult(_0x4134ba,null))['catch'](handleError(_0x4134ba,null));};exports[_0xafd4('0x87')]=function(_0x1f3ae2,_0x12bb8c,_0x5ccf7b){var _0x1c0164={};var _0x2dfa51={};var _0x4cd71d;var _0x42365f;return db[_0xafd4('0x4a')]['findOne']({'where':{'id':_0x1f3ae2[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x12bb8c,null))['then'](function(_0x57b739){if(_0x57b739){_0x4cd71d=_0x57b739;_0x2dfa51['model']=_[_0xafd4('0x34')](db[_0xafd4('0x6a')][_0xafd4('0x4b')]);_0x2dfa51[_0xafd4('0x33')]=_['keys'](_0x1f3ae2[_0xafd4('0x33')]);_0x2dfa51[_0xafd4('0x35')]=_['intersection'](_0x2dfa51['model'],_0x2dfa51[_0xafd4('0x33')]);_0x1c0164[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x2dfa51[_0xafd4('0x31')],qs['fields'](_0x1f3ae2[_0xafd4('0x33')][_0xafd4('0x38')]));_0x1c0164['attributes']=_0x1c0164['attributes'][_0xafd4('0x4c')]?_0x1c0164[_0xafd4('0x36')]:_0x2dfa51['model'];_0x1c0164[_0xafd4('0x3b')]=qs[_0xafd4('0x3c')](_0x1f3ae2[_0xafd4('0x33')]['sort']);_0x1c0164['where']=qs[_0xafd4('0x35')](_[_0xafd4('0x5e')](_0x1f3ae2['query'],_0x2dfa51['filters']));_0x1c0164[_0xafd4('0x3e')]=_['merge'](_0x1c0164[_0xafd4('0x3e')],{'$or':[{'ListId':_0x57b739['id']},{'ListId':null}]});if(_0x1f3ae2[_0xafd4('0x33')][_0xafd4('0x3d')]){_0x1c0164['where']=_['merge'](_0x1c0164['where'],{'$or':_[_0xafd4('0x32')](_0x1c0164['attributes'],function(_0x1cb39d){var _0x5834af={};_0x5834af[_0x1cb39d]={'$like':'%'+_0x1f3ae2['query'][_0xafd4('0x3d')]+'%'};return _0x5834af;})});}_0x1c0164=_[_0xafd4('0x41')]({},_0x1c0164,_0x1f3ae2[_0xafd4('0x42')]);return db[_0xafd4('0x6a')][_0xafd4('0x88')](_0x1c0164);}})[_0xafd4('0x26')](respondWithResult(_0x12bb8c,null))[_0xafd4('0x47')](handleError(_0x12bb8c,null));};exports[_0xafd4('0x89')]=function(_0x721c22,_0x18eae4,_0x1f7ded){return db['CmList'][_0xafd4('0x4d')]({'where':{'id':_0x721c22[_0xafd4('0x49')]['id']}})['then'](handleEntityNotFound(_0x18eae4,null))[_0xafd4('0x26')](function(_0x184617){if(_0x184617){return _0x184617[_0xafd4('0x89')](_0x721c22[_0xafd4('0x4f')][_0xafd4('0x60')],_[_0xafd4('0x66')](_0x721c22['body'],[_0xafd4('0x60'),'id'])||{})[_0xafd4('0x8a')](function(_0x34eca0){for(var _0xe6964=0x0;_0xe6964<_0x721c22[_0xafd4('0x4f')][_0xafd4('0x60')][_0xafd4('0x4c')];_0xe6964+=0x1){socket['emit'](_0xafd4('0x8b'),{'UserId':_0x721c22[_0xafd4('0x4f')][_0xafd4('0x60')][_0xe6964],'CmListId':_0x721c22[_0xafd4('0x49')]['id']});}return _0x34eca0;});}})[_0xafd4('0x26')](respondWithResult(_0x18eae4,null))[_0xafd4('0x47')](handleError(_0x18eae4,null));};exports[_0xafd4('0x8c')]=function(_0x575621,_0x418210,_0x2b8eb0){return db[_0xafd4('0x4a')][_0xafd4('0x4d')]({'where':{'id':_0x575621[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x418210,null))['then'](function(_0xdd371b){if(_0xdd371b){return _0xdd371b['removeAgents'](_0x575621['query'][_0xafd4('0x60')])[_0xafd4('0x26')](function(){if(_[_0xafd4('0x63')](_0x575621[_0xafd4('0x33')]['ids'])){for(var _0x1f7293=0x0;_0x1f7293<_0x575621['query']['ids'][_0xafd4('0x4c')];_0x1f7293+=0x1){socket[_0xafd4('0x8d')]('userCmList:remove',{'UserId':Number(_0x575621[_0xafd4('0x33')]['ids'][_0x1f7293]),'CmListId':Number(_0x575621[_0xafd4('0x49')]['id'])});}}else{socket['emit'](_0xafd4('0x8e'),{'UserId':Number(_0x575621[_0xafd4('0x33')][_0xafd4('0x60')]),'CmListId':Number(_0x575621[_0xafd4('0x49')]['id'])});}});}})[_0xafd4('0x26')](respondWithStatusCode(_0x418210,null))[_0xafd4('0x47')](handleError(_0x418210,null));};exports[_0xafd4('0x8f')]=function(_0x543b22,_0x465fcc,_0x5579e9){var _0x4daf5e={};var _0x379a58={};var _0x23c180;var _0x16fd3f;return db[_0xafd4('0x4a')][_0xafd4('0x5d')]({'where':{'id':_0x543b22[_0xafd4('0x49')]['id']}})[_0xafd4('0x26')](handleEntityNotFound(_0x465fcc,null))[_0xafd4('0x26')](function(_0x5abde3){if(_0x5abde3){_0x23c180=_0x5abde3;_0x379a58['model']=_[_0xafd4('0x34')](db[_0xafd4('0x90')][_0xafd4('0x4b')]);_0x379a58['query']=_[_0xafd4('0x34')](_0x543b22[_0xafd4('0x33')]);_0x379a58['filters']=_[_0xafd4('0x37')](_0x379a58[_0xafd4('0x31')],_0x379a58[_0xafd4('0x33')]);_0x4daf5e[_0xafd4('0x36')]=_[_0xafd4('0x37')](_0x379a58[_0xafd4('0x31')],qs[_0xafd4('0x38')](_0x543b22[_0xafd4('0x33')][_0xafd4('0x38')]));_0x4daf5e['attributes']=_0x4daf5e['attributes']['length']?_0x4daf5e['attributes']:_0x379a58[_0xafd4('0x31')];_0x4daf5e[_0xafd4('0x3b')]=qs['sort'](_0x543b22[_0xafd4('0x33')][_0xafd4('0x3c')]);_0x4daf5e[_0xafd4('0x3e')]=qs['filters'](_[_0xafd4('0x5e')](_0x543b22[_0xafd4('0x33')],_0x379a58[_0xafd4('0x35')]));if(_0x543b22[_0xafd4('0x33')]['filter']){_0x4daf5e[_0xafd4('0x3e')]=_[_0xafd4('0x41')](_0x4daf5e[_0xafd4('0x3e')],{'$or':_[_0xafd4('0x32')](_0x4daf5e[_0xafd4('0x36')],function(_0x3de684){var _0x20bb6a={};_0x20bb6a[_0x3de684]={'$like':'%'+_0x543b22[_0xafd4('0x33')][_0xafd4('0x3d')]+'%'};return _0x20bb6a;})});}_0x4daf5e=_[_0xafd4('0x41')]({},_0x4daf5e,_0x543b22[_0xafd4('0x42')]);return _0x23c180[_0xafd4('0x8f')](_0x4daf5e);}})['then'](function(_0xc9d632){if(_0xc9d632){_0x16fd3f=_0xc9d632[_0xafd4('0x4c')];if(!_0x543b22[_0xafd4('0x33')][_0xafd4('0x39')](_0xafd4('0x3a'))){_0x4daf5e[_0xafd4('0x1d')]=qs[_0xafd4('0x1d')](_0x543b22[_0xafd4('0x33')][_0xafd4('0x1d')]);_0x4daf5e[_0xafd4('0x1b')]=qs[_0xafd4('0x1b')](_0x543b22['query'][_0xafd4('0x1b')]);}return _0x23c180['getAgents'](_0x4daf5e);}})['then'](function(_0x1f9915){if(_0x1f9915){return _0x1f9915?{'count':_0x16fd3f,'rows':_0x1f9915}:null;}})[_0xafd4('0x26')](respondWithResult(_0x465fcc,null))['catch'](handleError(_0x465fcc,null));};
\ No newline at end of file
index c89c619..87ac4ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x55ca,0x126));var _0xa55c=function(_0x264b79,_0xc62859){_0x264b79=_0x264b79-0x0;var _0x548c85=_0x55ca[_0x264b79];return _0x548c85;};'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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe14b,0x93));var _0xbe14=function(_0x5dc694,_0x174d38){_0x5dc694=_0x5dc694-0x0;var _0x5741b6=_0xe14b[_0x5dc694];return _0x5741b6;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents;
\ No newline at end of file
index b1de524..9c1c3b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['path','rimraf','../../config/environment','exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x40a2d0,_0x5f0640){var _0x5c9fcc=function(_0x58b5bf){while(--_0x58b5bf){_0x40a2d0['push'](_0x40a2d0['shift']());}};_0x5c9fcc(++_0x5f0640);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0xf3cd[_0x2b0a86];return _0x955940;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./cmList.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0xa75b,0x170));var _0xba75=function(_0x5b8a03,_0x4fc8a0){_0x5b8a03=_0x5b8a03-0x0;var _0x3f8545=_0xa75b[_0x5b8a03];return _0x3f8545;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var rp=require(_0xba75('0x4'));var fs=require('fs');var path=require(_0xba75('0x5'));var rimraf=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var attributes=require(_0xba75('0x8'));module[_0xba75('0x9')]=function(_0x41afc9,_0x2baa28){return _0x41afc9[_0xba75('0xa')](_0xba75('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea6abc0..4af63d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','CmList,\x20%s,\x20%s','debug','stringify','error','message','info','result','util','bluebird','randomstring'];(function(_0x453fa2,_0x22559b){var _0x3ed179=function(_0x4d315c){while(--_0x4d315c){_0x453fa2['push'](_0x453fa2['shift']());}};_0x3ed179(++_0x22559b);}(_0x3ad8,0x15d));var _0x83ad=function(_0x217eed,_0x3bb92c){_0x217eed=_0x217eed-0x0;var _0x23d5fe=_0x3ad8[_0x217eed];return _0x23d5fe;};'use strict';var _=require('lodash');var util=require(_0x83ad('0x0'));var moment=require('moment');var BPromise=require(_0x83ad('0x1'));var rs=require(_0x83ad('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83ad('0x3'))['db'];var utils=require(_0x83ad('0x4'));var logger=require(_0x83ad('0x5'))(_0x83ad('0x6'));var config=require(_0x83ad('0x7'));var jayson=require(_0x83ad('0x8'));var client=jayson['client'][_0x83ad('0x9')]({'port':0x232a});config[_0x83ad('0xa')]=_[_0x83ad('0xb')](config['redis'],{'host':_0x83ad('0xc'),'port':0x18eb});var socket=require(_0x83ad('0xd'))(new Redis(config['redis']));require('./cmList.socket')[_0x83ad('0xe')](socket);function respondWithRpcPromise(_0x4a778b,_0x4f1535,_0x524f4a){return new BPromise(function(_0x5f5c9d,_0x466aac){return client['request'](_0x4a778b,_0x524f4a)['then'](function(_0x8c12db){logger['info'](_0x83ad('0xf'),_0x4f1535,'request\x20sent');logger[_0x83ad('0x10')]('CmList,\x20%s,\x20%s,\x20%s',_0x4f1535,'request\x20sent',JSON[_0x83ad('0x11')](_0x8c12db));if(_0x8c12db[_0x83ad('0x12')]){if(_0x8c12db[_0x83ad('0x12')]['code']===0x1f4){logger['error'](_0x83ad('0xf'),_0x4f1535,_0x8c12db[_0x83ad('0x12')][_0x83ad('0x13')]);return _0x466aac(_0x8c12db[_0x83ad('0x12')]['message']);}logger[_0x83ad('0x12')]('CmList,\x20%s,\x20%s',_0x4f1535,_0x8c12db[_0x83ad('0x12')][_0x83ad('0x13')]);return _0x5f5c9d(_0x8c12db[_0x83ad('0x12')][_0x83ad('0x13')]);}else{logger[_0x83ad('0x14')](_0x83ad('0xf'),_0x4f1535,'request\x20sent');_0x5f5c9d(_0x8c12db[_0x83ad('0x15')]['message']);}})['catch'](function(_0x34c0df){logger['error']('CmList,\x20%s,\x20%s',_0x4f1535,_0x34c0df);_0x466aac(_0x34c0df);});});}
\ No newline at end of file
+var _0x3576=['CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./cmList.socket','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x260b48,_0x117977){var _0x3f730b=function(_0x7a1e53){while(--_0x7a1e53){_0x260b48['push'](_0x260b48['shift']());}};_0x3f730b(++_0x117977);}(_0x3576,0x170));var _0x6357=function(_0x19d1cf,_0x4e4258){_0x19d1cf=_0x19d1cf-0x0;var _0x3be17b=_0x3576[_0x19d1cf];return _0x3be17b;};'use strict';var _=require(_0x6357('0x0'));var util=require(_0x6357('0x1'));var moment=require(_0x6357('0x2'));var BPromise=require(_0x6357('0x3'));var rs=require(_0x6357('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6357('0x5'))['db'];var utils=require(_0x6357('0x6'));var logger=require(_0x6357('0x7'))(_0x6357('0x8'));var config=require('../../config/environment');var jayson=require(_0x6357('0x9'));var client=jayson[_0x6357('0xa')][_0x6357('0xb')]({'port':0x232a});config['redis']=_[_0x6357('0xc')](config['redis'],{'host':_0x6357('0xd'),'port':0x18eb});var socket=require(_0x6357('0xe'))(new Redis(config[_0x6357('0xf')]));require(_0x6357('0x10'))['register'](socket);function respondWithRpcPromise(_0x5c756f,_0x2a86ee,_0x323d40){return new BPromise(function(_0x14f8c7,_0xa02a4e){return client[_0x6357('0x11')](_0x5c756f,_0x323d40)[_0x6357('0x12')](function(_0x5d76cf){logger[_0x6357('0x13')]('CmList,\x20%s,\x20%s',_0x2a86ee,'request\x20sent');logger[_0x6357('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x2a86ee,_0x6357('0x15'),JSON[_0x6357('0x16')](_0x5d76cf));if(_0x5d76cf[_0x6357('0x17')]){if(_0x5d76cf['error']['code']===0x1f4){logger['error'](_0x6357('0x18'),_0x2a86ee,_0x5d76cf[_0x6357('0x17')][_0x6357('0x19')]);return _0xa02a4e(_0x5d76cf[_0x6357('0x17')][_0x6357('0x19')]);}logger['error'](_0x6357('0x18'),_0x2a86ee,_0x5d76cf['error']['message']);return _0x14f8c7(_0x5d76cf[_0x6357('0x17')][_0x6357('0x19')]);}else{logger['info']('CmList,\x20%s,\x20%s',_0x2a86ee,_0x6357('0x15'));_0x14f8c7(_0x5d76cf[_0x6357('0x1a')][_0x6357('0x19')]);}})[_0x6357('0x1b')](function(_0x4b08b1){logger[_0x6357('0x17')](_0x6357('0x18'),_0x2a86ee,_0x4b08b1);_0xa02a4e(_0x4b08b1);});});}
\ No newline at end of file
index 1a7fdbe..1abf1d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33b1=['update','emit','register','length','cmList:','save','remove'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x33b1,0x186));var _0x133b=function(_0x49fa18,_0x25e866){_0x49fa18=_0x49fa18-0x0;var _0x5975eb=_0x33b1[_0x49fa18];return _0x5975eb;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x133b('0x0'),_0x133b('0x1'),_0x133b('0x2')];function createListener(_0x31192e,_0x2d8540){return function(_0x449ec6){_0x2d8540[_0x133b('0x3')](_0x31192e,_0x449ec6);};}function removeListener(_0x855592,_0xafda25){return function(){CmListEvents['removeListener'](_0x855592,_0xafda25);};}exports[_0x133b('0x4')]=function(_0x28cc0a){for(var _0x2d61bb=0x0,_0x2d30ad=events[_0x133b('0x5')];_0x2d61bb<_0x2d30ad;_0x2d61bb++){var _0x4b11a2=events[_0x2d61bb];var _0x6d9c63=createListener(_0x133b('0x6')+_0x4b11a2,_0x28cc0a);CmListEvents['on'](_0x4b11a2,_0x6d9c63);}};
\ No newline at end of file
+var _0x26a7=['save','update','emit','removeListener','length','./cmList.events'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x26a7,0x1a3));var _0x726a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x26a7[_0x397e5f];return _0x5302b8;};'use strict';var CmListEvents=require(_0x726a('0x0'));var events=[_0x726a('0x1'),'remove',_0x726a('0x2')];function createListener(_0x703407,_0x46a978){return function(_0x2ab7a0){_0x46a978[_0x726a('0x3')](_0x703407,_0x2ab7a0);};}function removeListener(_0xdbf6ff,_0x52ea36){return function(){CmListEvents[_0x726a('0x4')](_0xdbf6ff,_0x52ea36);};}exports['register']=function(_0x2a4f03){for(var _0x555c67=0x0,_0x184135=events[_0x726a('0x5')];_0x555c67<_0x184135;_0x555c67++){var _0x4e31bc=events[_0x555c67];var _0x31b98f=createListener('cmList:'+_0x4e31bc,_0x2a4f03);CmListEvents['on'](_0x4e31bc,_0x31b98f);}};
\ No newline at end of file
index 4c336f6..8bd8d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534d=['isAuthenticated','index','describe','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addContacts','addCustomField','addAgents','put','/:id','update','delete','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get'];(function(_0x1a246a,_0x2fc05e){var _0x35cf39=function(_0x1a298b){while(--_0x1a298b){_0x1a246a['push'](_0x1a246a['shift']());}};_0x35cf39(++_0x2fc05e);}(_0x534d,0xa4));var _0xd534=function(_0x2dd0ab,_0x7e2c90){_0x2dd0ab=_0x2dd0ab-0x0;var _0x576859=_0x534d[_0x2dd0ab];return _0x576859;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require('connect-timeout');var express=require(_0xd534('0x3'));var router=express[_0xd534('0x4')]();var fs_extra=require(_0xd534('0x5'));var auth=require(_0xd534('0x6'));var interaction=require(_0xd534('0x7'));var config=require(_0xd534('0x8'));var controller=require(_0xd534('0x9'));router[_0xd534('0xa')]('/',auth[_0xd534('0xb')](),controller[_0xd534('0xc')]);router['get']('/describe',auth[_0xd534('0xb')](),controller[_0xd534('0xd')]);router['get']('/:id',auth[_0xd534('0xb')](),controller[_0xd534('0xe')]);router[_0xd534('0xa')](_0xd534('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xd534('0xa')](_0xd534('0x10'),auth['isAuthenticated'](),controller[_0xd534('0x11')]);router[_0xd534('0xa')](_0xd534('0x12'),auth[_0xd534('0xb')](),controller[_0xd534('0x13')]);router['get'](_0xd534('0x14'),auth[_0xd534('0xb')](),controller[_0xd534('0x15')]);router[_0xd534('0xa')](_0xd534('0x16'),auth[_0xd534('0xb')](),controller[_0xd534('0x17')]);router[_0xd534('0x18')]('/',auth[_0xd534('0xb')](),controller[_0xd534('0x19')]);router[_0xd534('0x18')]('/:id/dispositions',auth[_0xd534('0xb')](),controller['addDisposition']);router[_0xd534('0x18')]('/:id/contacts',auth[_0xd534('0xb')](),controller[_0xd534('0x1a')]);router[_0xd534('0x18')]('/:id/fields',auth[_0xd534('0xb')](),controller[_0xd534('0x1b')]);router[_0xd534('0x18')](_0xd534('0x16'),auth[_0xd534('0xb')](),controller[_0xd534('0x1c')]);router[_0xd534('0x1d')](_0xd534('0x1e'),auth[_0xd534('0xb')](),controller[_0xd534('0x1f')]);router[_0xd534('0x20')](_0xd534('0x1e'),auth['isAuthenticated'](),controller['destroy']);router[_0xd534('0x20')](_0xd534('0xf'),auth[_0xd534('0xb')](),controller['removeDispositions']);router[_0xd534('0x20')](_0xd534('0x16'),auth[_0xd534('0xb')](),controller[_0xd534('0x21')]);module[_0xd534('0x22')]=router;
\ No newline at end of file
+var _0xff42=['getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','addDisposition','post','/:id/contacts','addContacts','addCustomField','put','/:id','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','/:id/dispositions'];(function(_0x58260f,_0x137498){var _0x59ebc5=function(_0x2afd09){while(--_0x2afd09){_0x58260f['push'](_0x58260f['shift']());}};_0x59ebc5(++_0x137498);}(_0xff42,0x1f0));var _0x2ff4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xff42[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2ff4('0x0'));var util=require(_0x2ff4('0x1'));var path=require(_0x2ff4('0x2'));var timeout=require('connect-timeout');var express=require(_0x2ff4('0x3'));var router=express[_0x2ff4('0x4')]();var fs_extra=require(_0x2ff4('0x5'));var auth=require(_0x2ff4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ff4('0x7'));var controller=require(_0x2ff4('0x8'));router[_0x2ff4('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ff4('0xa')]);router[_0x2ff4('0x9')](_0x2ff4('0xb'),auth[_0x2ff4('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2ff4('0x9')](_0x2ff4('0xd'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0xe')]);router[_0x2ff4('0x9')]('/:id/contacts',auth[_0x2ff4('0xc')](),controller[_0x2ff4('0xf')]);router[_0x2ff4('0x9')](_0x2ff4('0x10'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x11')]);router['get'](_0x2ff4('0x12'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x13')]);router[_0x2ff4('0x9')](_0x2ff4('0x14'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2ff4('0x16')]);router['post'](_0x2ff4('0xd'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x17')]);router[_0x2ff4('0x18')](_0x2ff4('0x19'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x1a')]);router[_0x2ff4('0x18')]('/:id/fields',auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x1b')]);router[_0x2ff4('0x18')](_0x2ff4('0x14'),auth[_0x2ff4('0xc')](),controller['addAgents']);router[_0x2ff4('0x1c')](_0x2ff4('0x1d'),auth[_0x2ff4('0xc')](),controller['update']);router[_0x2ff4('0x1e')](_0x2ff4('0x1d'),auth['isAuthenticated'](),controller['destroy']);router[_0x2ff4('0x1e')](_0x2ff4('0xd'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x1f')]);router[_0x2ff4('0x1e')](_0x2ff4('0x14'),auth[_0x2ff4('0xc')](),controller[_0x2ff4('0x20')]);module[_0x2ff4('0x21')]=router;
\ No newline at end of file
index b14db11..929c954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44d9=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x4278bb,_0x247d6c){var _0x278825=function(_0x4c7d32){while(--_0x4c7d32){_0x4278bb['push'](_0x4278bb['shift']());}};_0x278825(++_0x247d6c);}(_0x44d9,0x17b));var _0x944d=function(_0x29da12,_0x156ada){_0x29da12=_0x29da12-0x0;var _0x47b75d=_0x44d9[_0x29da12];return _0x47b75d;};'use strict';var Sequelize=require(_0x944d('0x0'));module[_0x944d('0x1')]={'name':{'type':Sequelize[_0x944d('0x2')],'get':function(_0x10479a){return this[_0x944d('0x3')](_0x944d('0x4'));}},'field':{'type':Sequelize[_0x944d('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x944d('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xe9ff=['exports','getDataValue','field','STRING','sequelize'];(function(_0x46319c,_0x5a5ea4){var _0x4b741b=function(_0x37a168){while(--_0x37a168){_0x46319c['push'](_0x46319c['shift']());}};_0x4b741b(++_0x5a5ea4);}(_0xe9ff,0xcc));var _0xfe9f=function(_0x449b40,_0x57760d){_0x449b40=_0x449b40-0x0;var _0x5ec2d0=_0xe9ff[_0x449b40];return _0x5ec2d0;};'use strict';var Sequelize=require(_0xfe9f('0x0'));module[_0xfe9f('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5b6d8b){return this[_0xfe9f('0x2')](_0xfe9f('0x3'));}},'field':{'type':Sequelize[_0xfe9f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xfe9f('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xfe9f('0x4')],'allowNull':![]}};
\ No newline at end of file
index 65d7ec8..6e1c59d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x506380,_0x2a8cde){var _0x560628=function(_0xc6b8d2){while(--_0xc6b8d2){_0x506380['push'](_0x506380['shift']());}};_0x560628(++_0x2a8cde);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x856777,_0x39027f){var _0x204d1a=function(_0x2a0f9d){while(--_0x2a0f9d){_0x856777['push'](_0x856777['shift']());}};_0x204d1a(++_0x39027f);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 c0ba601..a35a6df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc75=['rimraf','../../config/environment','./condition.attributes','exports','define','Condition','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c9221,_0x5e7a92){var _0x444c32=function(_0x45861b){while(--_0x45861b){_0x4c9221['push'](_0x4c9221['shift']());}};_0x444c32(++_0x5e7a92);}(_0xbc75,0xe6));var _0x5bc7=function(_0x4afb0f,_0x424bef){_0x4afb0f=_0x4afb0f-0x0;var _0x1ae8d3=_0xbc75[_0x4afb0f];return _0x1ae8d3;};'use strict';var _=require(_0x5bc7('0x0'));var util=require(_0x5bc7('0x1'));var logger=require(_0x5bc7('0x2'))(_0x5bc7('0x3'));var moment=require(_0x5bc7('0x4'));var BPromise=require(_0x5bc7('0x5'));var rp=require(_0x5bc7('0x6'));var fs=require('fs');var path=require(_0x5bc7('0x7'));var rimraf=require(_0x5bc7('0x8'));var config=require(_0x5bc7('0x9'));var attributes=require(_0x5bc7('0xa'));module[_0x5bc7('0xb')]=function(_0x380ecc,_0x29e6a1){return _0x380ecc[_0x5bc7('0xc')](_0x5bc7('0xd'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cfe=['../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','api','path','rimraf'];(function(_0x266752,_0x37641c){var _0x564b2a=function(_0x22080f){while(--_0x22080f){_0x266752['push'](_0x266752['shift']());}};_0x564b2a(++_0x37641c);}(_0x5cfe,0xe6));var _0xe5cf=function(_0x2648e7,_0x396ce5){_0x2648e7=_0x2648e7-0x0;var _0x2697c8=_0x5cfe[_0x2648e7];return _0x2697c8;};'use strict';var _=require(_0xe5cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe5cf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5cf('0x2'));var rimraf=require(_0xe5cf('0x3'));var config=require(_0xe5cf('0x4'));var attributes=require(_0xe5cf('0x5'));module['exports']=function(_0xb7a223,_0x33da02){return _0xb7a223[_0xe5cf('0x6')](_0xe5cf('0x7'),attributes,{'tableName':_0xe5cf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f35cc2c..cd28004 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60cd=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x60cd,0x159));var _0xd60c=function(_0x24ade4,_0x56ebb0){_0x24ade4=_0x24ade4-0x0;var _0x374858=_0x60cd[_0x24ade4];return _0x374858;};'use strict';var _=require(_0xd60c('0x0'));var util=require(_0xd60c('0x1'));var moment=require(_0xd60c('0x2'));var BPromise=require('bluebird');var rs=require(_0xd60c('0x3'));var fs=require('fs');var Redis=require(_0xd60c('0x4'));var db=require(_0xd60c('0x5'))['db'];var utils=require(_0xd60c('0x6'));var logger=require(_0xd60c('0x7'))(_0xd60c('0x8'));var config=require(_0xd60c('0x9'));var jayson=require(_0xd60c('0xa'));var client=jayson['client'][_0xd60c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x504d98,_0x43a085,_0x264777){return new BPromise(function(_0x7816a0,_0x3eaf80){return client[_0xd60c('0xc')](_0x504d98,_0x264777)['then'](function(_0x59ad72){logger[_0xd60c('0xd')](_0xd60c('0xe'),_0x43a085,'request\x20sent');logger['debug'](_0xd60c('0xf'),_0x43a085,_0xd60c('0x10'),JSON[_0xd60c('0x11')](_0x59ad72));if(_0x59ad72['error']){if(_0x59ad72[_0xd60c('0x12')][_0xd60c('0x13')]===0x1f4){logger[_0xd60c('0x12')](_0xd60c('0xe'),_0x43a085,_0x59ad72[_0xd60c('0x12')]['message']);return _0x3eaf80(_0x59ad72['error']['message']);}logger[_0xd60c('0x12')](_0xd60c('0xe'),_0x43a085,_0x59ad72[_0xd60c('0x12')][_0xd60c('0x14')]);return _0x7816a0(_0x59ad72['error'][_0xd60c('0x14')]);}else{logger[_0xd60c('0xd')](_0xd60c('0xe'),_0x43a085,_0xd60c('0x10'));_0x7816a0(_0x59ad72['result'][_0xd60c('0x14')]);}})[_0xd60c('0x15')](function(_0x20484f){logger[_0xd60c('0x12')]('Condition,\x20%s,\x20%s',_0x43a085,_0x20484f);_0x3eaf80(_0x20484f);});});}
\ No newline at end of file
+var _0x81a0=['request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','lodash','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x280c69,_0x51f7e2){var _0x475ad0=function(_0x34f71e){while(--_0x34f71e){_0x280c69['push'](_0x280c69['shift']());}};_0x475ad0(++_0x51f7e2);}(_0x81a0,0x1ec));var _0x081a=function(_0x4e3553,_0xfbb05a){_0x4e3553=_0x4e3553-0x0;var _0x2da08b=_0x81a0[_0x4e3553];return _0x2da08b;};'use strict';var _=require(_0x081a('0x0'));var util=require('util');var moment=require(_0x081a('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(_0x081a('0x2'));var logger=require('../../config/logger')(_0x081a('0x3'));var config=require(_0x081a('0x4'));var jayson=require(_0x081a('0x5'));var client=jayson[_0x081a('0x6')][_0x081a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b3b7f,_0x1b03ec,_0x5decf8){return new BPromise(function(_0x1d0b9,_0x460001){return client[_0x081a('0x8')](_0x1b3b7f,_0x5decf8)['then'](function(_0x26a5ab){logger[_0x081a('0x9')]('Condition,\x20%s,\x20%s',_0x1b03ec,'request\x20sent');logger[_0x081a('0xa')](_0x081a('0xb'),_0x1b03ec,_0x081a('0xc'),JSON[_0x081a('0xd')](_0x26a5ab));if(_0x26a5ab[_0x081a('0xe')]){if(_0x26a5ab[_0x081a('0xe')][_0x081a('0xf')]===0x1f4){logger['error'](_0x081a('0x10'),_0x1b03ec,_0x26a5ab['error'][_0x081a('0x11')]);return _0x460001(_0x26a5ab['error']['message']);}logger[_0x081a('0xe')](_0x081a('0x10'),_0x1b03ec,_0x26a5ab[_0x081a('0xe')][_0x081a('0x11')]);return _0x1d0b9(_0x26a5ab['error'][_0x081a('0x11')]);}else{logger[_0x081a('0x9')]('Condition,\x20%s,\x20%s',_0x1b03ec,_0x081a('0xc'));_0x1d0b9(_0x26a5ab['result'][_0x081a('0x11')]);}})['catch'](function(_0x2abe6e){logger['error'](_0x081a('0x10'),_0x1b03ec,_0x2abe6e);_0x460001(_0x2abe6e);});});}
\ No newline at end of file
index aa4aff4..9929782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ebb=['../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','util','express','fs-extra'];(function(_0x312273,_0x3a8b70){var _0x58f13c=function(_0x97bcc4){while(--_0x97bcc4){_0x312273['push'](_0x312273['shift']());}};_0x58f13c(++_0x3a8b70);}(_0x0ebb,0x142));var _0xb0eb=function(_0x1d03f9,_0x5c9b3b){_0x1d03f9=_0x1d03f9-0x0;var _0x5a59ee=_0x0ebb[_0x1d03f9];return _0x5a59ee;};'use strict';var multer=require('multer');var util=require(_0xb0eb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0eb('0x1'));var router=express['Router']();var fs_extra=require(_0xb0eb('0x2'));var auth=require(_0xb0eb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xb0eb('0x4'));var controller=require(_0xb0eb('0x5'));router[_0xb0eb('0x6')](_0xb0eb('0x7'),auth[_0xb0eb('0x8')](),controller[_0xb0eb('0x9')]);router[_0xb0eb('0xa')](_0xb0eb('0x7'),auth[_0xb0eb('0x8')](),controller[_0xb0eb('0xb')]);module[_0xb0eb('0xc')]=router;
\ No newline at end of file
+var _0x292d=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x4ce296,_0xf36e86){var _0x378c9a=function(_0x5ea76e){while(--_0x5ea76e){_0x4ce296['push'](_0x4ce296['shift']());}};_0x378c9a(++_0xf36e86);}(_0x292d,0x178));var _0xd292=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x292d[_0x49beea];return _0x27693a;};'use strict';var multer=require('multer');var util=require(_0xd292('0x0'));var path=require(_0xd292('0x1'));var timeout=require(_0xd292('0x2'));var express=require(_0xd292('0x3'));var router=express[_0xd292('0x4')]();var fs_extra=require(_0xd292('0x5'));var auth=require(_0xd292('0x6'));var interaction=require(_0xd292('0x7'));var config=require('../../config/environment');var controller=require(_0xd292('0x8'));router[_0xd292('0x9')](_0xd292('0xa'),auth[_0xd292('0xb')](),controller[_0xd292('0xc')]);router[_0xd292('0xd')](_0xd292('0xa'),auth[_0xd292('0xb')](),controller[_0xd292('0xe')]);module['exports']=router;
\ No newline at end of file
index 893483e..10a19b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['name','exports','STRING'];(function(_0x2de3f0,_0x59af1b){var _0x25efc7=function(_0x55f8bc){while(--_0x55f8bc){_0x2de3f0['push'](_0x2de3f0['shift']());}};_0x25efc7(++_0x59af1b);}(_0x2032,0xd9));var _0x2203=function(_0x152a42,_0x1129a8){_0x152a42=_0x152a42-0x0;var _0x212159=_0x2032[_0x152a42];return _0x212159;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe706=['STRING','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe706,0xa3));var _0x6e70=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0xe706[_0x5805d7];return _0x170fe4;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}};
\ No newline at end of file
index eb0ca07..285827c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fcb=['attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','order','getItems','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','body','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','type','iframe','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1'];(function(_0x58e631,_0x4690e3){var _0x40ae88=function(_0x472d0f){while(--_0x472d0f){_0x58e631['push'](_0x58e631['shift']());}};_0x40ae88(++_0x4690e3);}(_0x7fcb,0x105));var _0xb7fc=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x7fcb[_0x178856];return _0x3c7fe7;};'use strict';var emlformat=require(_0xb7fc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7fc('0x1'));var moment=require('moment');var BPromise=require(_0xb7fc('0x2'));var Mustache=require(_0xb7fc('0x3'));var util=require('util');var path=require(_0xb7fc('0x4'));var sox=require(_0xb7fc('0x5'));var csv=require(_0xb7fc('0x6'));var ejs=require(_0xb7fc('0x7'));var fs=require('fs');var fs_extra=require(_0xb7fc('0x8'));var _=require(_0xb7fc('0x9'));var squel=require(_0xb7fc('0xa'));var crypto=require(_0xb7fc('0xb'));var jsforce=require(_0xb7fc('0xc'));var deskjs=require(_0xb7fc('0xd'));var toCsv=require(_0xb7fc('0x6'));var querystring=require(_0xb7fc('0xe'));var Papa=require(_0xb7fc('0xf'));var Redis=require(_0xb7fc('0x10'));var authService=require(_0xb7fc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb7fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7fc('0x13'))(_0xb7fc('0x14'));var utils=require(_0xb7fc('0x15'));var config=require(_0xb7fc('0x16'));var licenseUtil=require(_0xb7fc('0x17'));var db=require(_0xb7fc('0x18'))['db'];config[_0xb7fc('0x19')]=_[_0xb7fc('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7fc('0x19')]));require(_0xb7fc('0x1b'))[_0xb7fc('0x1c')](socket);function respondWithStatusCode(_0x5a65e4,_0x5df6bd){_0x5df6bd=_0x5df6bd||0xcc;return function(_0x5c59de){if(_0x5c59de){return _0x5a65e4[_0xb7fc('0x1d')](_0x5df6bd);}return _0x5a65e4[_0xb7fc('0x1e')](_0x5df6bd)[_0xb7fc('0x1f')]();};}function respondWithResult(_0x74713d,_0x458310){_0x458310=_0x458310||0xc8;return function(_0x228c0f){if(_0x228c0f){return _0x74713d[_0xb7fc('0x1e')](_0x458310)[_0xb7fc('0x20')](_0x228c0f);}};}function respondWithFilteredResult(_0x2967ea,_0x387b10){return function(_0x5bdb6d){if(_0x5bdb6d){var _0x223d82=typeof _0x387b10[_0xb7fc('0x21')]===_0xb7fc('0x22')&&typeof _0x387b10[_0xb7fc('0x23')]==='undefined';var _0x22f6f8=_0x5bdb6d[_0xb7fc('0x24')];var _0x5c0fae=_0x223d82?0x0:_0x387b10['offset'];var _0x245e30=_0x223d82?_0x5bdb6d[_0xb7fc('0x24')]:_0x387b10[_0xb7fc('0x21')]+_0x387b10['limit'];var _0x5ac18e;if(_0x245e30>=_0x22f6f8){_0x245e30=_0x22f6f8;_0x5ac18e=0xc8;}else{_0x5ac18e=0xce;}_0x2967ea[_0xb7fc('0x1e')](_0x5ac18e);return _0x2967ea[_0xb7fc('0x25')](_0xb7fc('0x26'),_0x5c0fae+'-'+_0x245e30+'/'+_0x22f6f8)[_0xb7fc('0x20')](_0x5bdb6d);}return null;};}function patchUpdates(_0x413923){return function(_0x7fefca){try{jsonpatch['apply'](_0x7fefca,_0x413923,!![]);}catch(_0x35c1e1){return BPromise[_0xb7fc('0x27')](_0x35c1e1);}return _0x7fefca['save']();};}function saveUpdates(_0x5c70b6,_0x2b5fce){return function(_0x277c37){if(_0x277c37){return _0x277c37[_0xb7fc('0x28')](_0x5c70b6)['then'](function(_0xe1bdcb){return _0xe1bdcb;});}return null;};}function removeEntity(_0x7204ec,_0x4111f8){return function(_0xaf6f79){if(_0xaf6f79){return _0xaf6f79['destroy']()[_0xb7fc('0x29')](function(){var _0x4bd017=_0xaf6f79[_0xb7fc('0x2a')]({'plain':!![]});var _0xe94edc='CustomDashboards';return db[_0xb7fc('0x2b')][_0xb7fc('0x2c')]({'where':{'type':_0xe94edc,'resourceId':_0x4bd017['id']}})[_0xb7fc('0x29')](function(){return _0xaf6f79;});})[_0xb7fc('0x29')](function(){_0x7204ec[_0xb7fc('0x1e')](0xcc)[_0xb7fc('0x1f')]();});}};}function handleEntityNotFound(_0x4b5e8f,_0x422152){return function(_0x49ef69){if(!_0x49ef69){_0x4b5e8f[_0xb7fc('0x1d')](0x194);}return _0x49ef69;};}function handleError(_0x444171,_0x3eea41){_0x3eea41=_0x3eea41||0x1f4;return function(_0x63663f){logger[_0xb7fc('0x2d')](_0x63663f[_0xb7fc('0x2e')]);if(_0x63663f[_0xb7fc('0x2f')]){delete _0x63663f[_0xb7fc('0x2f')];}_0x444171[_0xb7fc('0x1e')](_0x3eea41)[_0xb7fc('0x30')](_0x63663f);};}exports[_0xb7fc('0x31')]=function(_0x30cf06,_0x477f33){var _0x5aa69e={},_0x4eb9dc={},_0x1b3a09={'count':0x0,'rows':[]};var _0x52b9b2=_[_0xb7fc('0x32')](db[_0xb7fc('0x33')][_0xb7fc('0x34')],function(_0x36b0ce){return{'name':_0x36b0ce[_0xb7fc('0x35')],'type':_0x36b0ce['type'][_0xb7fc('0x36')]};});_0x4eb9dc[_0xb7fc('0x37')]=_[_0xb7fc('0x32')](_0x52b9b2,_0xb7fc('0x2f'));_0x4eb9dc['query']=_['keys'](_0x30cf06['query']);_0x4eb9dc[_0xb7fc('0x38')]=_[_0xb7fc('0x39')](_0x4eb9dc[_0xb7fc('0x37')],_0x4eb9dc[_0xb7fc('0x3a')]);_0x5aa69e[_0xb7fc('0x3b')]=_[_0xb7fc('0x39')](_0x4eb9dc[_0xb7fc('0x37')],qs[_0xb7fc('0x3c')](_0x30cf06[_0xb7fc('0x3a')][_0xb7fc('0x3c')]));_0x5aa69e[_0xb7fc('0x3b')]=_0x5aa69e['attributes'][_0xb7fc('0x3d')]?_0x5aa69e[_0xb7fc('0x3b')]:_0x4eb9dc[_0xb7fc('0x37')];if(!_0x30cf06[_0xb7fc('0x3a')][_0xb7fc('0x3e')](_0xb7fc('0x3f'))){_0x5aa69e[_0xb7fc('0x23')]=qs[_0xb7fc('0x23')](_0x30cf06['query'][_0xb7fc('0x23')]);_0x5aa69e[_0xb7fc('0x21')]=qs['offset'](_0x30cf06['query'][_0xb7fc('0x21')]);}_0x5aa69e['order']=qs[_0xb7fc('0x40')](_0x30cf06[_0xb7fc('0x3a')][_0xb7fc('0x40')]);_0x5aa69e['where']=qs['filters'](_[_0xb7fc('0x41')](_0x30cf06[_0xb7fc('0x3a')],_0x4eb9dc[_0xb7fc('0x38')]),_0x52b9b2);if(_0x30cf06['query'][_0xb7fc('0x42')]){_0x5aa69e[_0xb7fc('0x43')]=_[_0xb7fc('0x44')](_0x5aa69e['where'],{'$or':_[_0xb7fc('0x32')](_0x52b9b2,function(_0x43ffbe){if(_0x43ffbe['type']!==_0xb7fc('0x45')){var _0x14ab79={};_0x14ab79[_0x43ffbe[_0xb7fc('0x2f')]]={'$like':'%'+_0x30cf06[_0xb7fc('0x3a')][_0xb7fc('0x42')]+'%'};return _0x14ab79;}})});}_0x5aa69e=_['merge']({},_0x5aa69e,_0x30cf06['options']);var _0x15960e={'where':_0x5aa69e['where']};return db['Dashboard'][_0xb7fc('0x24')](_0x15960e)[_0xb7fc('0x29')](function(_0x1612a7){_0x1b3a09['count']=_0x1612a7;if(_0x30cf06['query'][_0xb7fc('0x46')]){_0x5aa69e['include']=[{'all':!![]}];}return db[_0xb7fc('0x33')][_0xb7fc('0x47')](_0x5aa69e);})[_0xb7fc('0x29')](function(_0x358bd8){_0x1b3a09[_0xb7fc('0x48')]=_0x358bd8;return _0x1b3a09;})[_0xb7fc('0x29')](respondWithFilteredResult(_0x477f33,_0x5aa69e))['catch'](handleError(_0x477f33,null));};exports[_0xb7fc('0x49')]=function(_0x3006f0,_0x4bd383){var _0x1bfaa5={'raw':![],'where':{'id':_0x3006f0[_0xb7fc('0x4a')]['id']}},_0x44010e={};_0x44010e['model']=_['keys'](db['Dashboard'][_0xb7fc('0x34')]);_0x44010e[_0xb7fc('0x3a')]=_[_0xb7fc('0x4b')](_0x3006f0[_0xb7fc('0x3a')]);_0x44010e[_0xb7fc('0x38')]=_['intersection'](_0x44010e['model'],_0x44010e[_0xb7fc('0x3a')]);_0x1bfaa5[_0xb7fc('0x3b')]=_['intersection'](_0x44010e[_0xb7fc('0x37')],qs[_0xb7fc('0x3c')](_0x3006f0[_0xb7fc('0x3a')][_0xb7fc('0x3c')]));_0x1bfaa5['attributes']=_0x1bfaa5[_0xb7fc('0x3b')][_0xb7fc('0x3d')]?_0x1bfaa5['attributes']:_0x44010e[_0xb7fc('0x37')];if(_0x3006f0[_0xb7fc('0x3a')][_0xb7fc('0x46')]){_0x1bfaa5[_0xb7fc('0x4c')]=[{'all':!![]}];}_0x1bfaa5=_[_0xb7fc('0x44')]({},_0x1bfaa5,_0x3006f0['options']);return db[_0xb7fc('0x33')][_0xb7fc('0x4d')](_0x1bfaa5)[_0xb7fc('0x29')](handleEntityNotFound(_0x4bd383,null))[_0xb7fc('0x29')](respondWithResult(_0x4bd383,null))['catch'](handleError(_0x4bd383,null));};exports[_0xb7fc('0x4e')]=function(_0x2fb793,_0x1ba25c){return db['Dashboard'][_0xb7fc('0x4e')](_0x2fb793['body'],{})[_0xb7fc('0x29')](function(_0x9c79ef){var _0x5614f8=_0x2fb793[_0xb7fc('0x4f')][_0xb7fc('0x2a')]({'plain':!![]});if(!_0x5614f8)throw new Error(_0xb7fc('0x50'));if(_0x5614f8[_0xb7fc('0x51')]===_0xb7fc('0x4f')){var _0x23894e=_0x9c79ef[_0xb7fc('0x2a')]({'plain':!![]});var _0xcbf56f=_0xb7fc('0x52');return db['UserProfileSection'][_0xb7fc('0x4d')]({'where':{'name':_0xcbf56f,'userProfileId':_0x5614f8[_0xb7fc('0x53')]},'raw':!![]})[_0xb7fc('0x29')](function(_0x1512c9){if(_0x1512c9&&_0x1512c9['autoAssociation']===0x0){return db[_0xb7fc('0x2b')][_0xb7fc('0x4e')]({'name':_0x23894e[_0xb7fc('0x2f')],'resourceId':_0x23894e['id'],'type':_0x1512c9[_0xb7fc('0x2f')],'sectionId':_0x1512c9['id']},{})[_0xb7fc('0x29')](function(){return _0x9c79ef;});}else{return _0x9c79ef;}})[_0xb7fc('0x54')](function(_0x18ba69){logger['error'](_0xb7fc('0x55'),_0x18ba69);throw _0x18ba69;});}return _0x9c79ef;})[_0xb7fc('0x29')](respondWithResult(_0x1ba25c,0xc9))[_0xb7fc('0x54')](handleError(_0x1ba25c,null));};exports[_0xb7fc('0x56')]=function(_0xf9e10b,_0x4d6a26){var _0x9666a4={'where':{'id':_0xf9e10b[_0xb7fc('0x4a')]['id']}},_0x301e3f={};_0x301e3f[_0xb7fc('0x37')]=_[_0xb7fc('0x4b')](db['Dashboard'][_0xb7fc('0x34')]);_0x9666a4[_0xb7fc('0x3b')]=_[_0xb7fc('0x39')](_0x301e3f[_0xb7fc('0x37')],qs[_0xb7fc('0x3c')](_0xf9e10b['query'][_0xb7fc('0x3c')]));_0x9666a4[_0xb7fc('0x3b')]=_0x9666a4[_0xb7fc('0x3b')][_0xb7fc('0x3d')]?_0x9666a4[_0xb7fc('0x3b')]:_0x301e3f[_0xb7fc('0x37')];if(_0xf9e10b['query']['includeAll']){_0x9666a4['include']=[{'all':!![]}];}_0x9666a4=_[_0xb7fc('0x44')]({},_0x9666a4,_0xf9e10b[_0xb7fc('0x57')]);return db[_0xb7fc('0x33')][_0xb7fc('0x4d')](_0x9666a4)[_0xb7fc('0x29')](handleEntityNotFound(_0x4d6a26,null))[_0xb7fc('0x29')](function(_0x571dcb){if(_0x571dcb){var _0x565cf1=_0x571dcb[_0xb7fc('0x2a')]({'plain':!![]});_0x565cf1=qs['omit'](_0x565cf1,['id','createdAt','updatedAt']);_0xf9e10b[_0xb7fc('0x58')]=_[_0xb7fc('0x59')](_0xf9e10b[_0xb7fc('0x58')],['id',_0xb7fc('0x5a'),_0xb7fc('0x5b')]);return db[_0xb7fc('0x33')][_0xb7fc('0x4e')](_[_0xb7fc('0x44')](_0x565cf1,_0xf9e10b['body']),{'include':_0xf9e10b['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb7fc('0x29')](function(_0x8c6f8){var _0x10a28e=_0xf9e10b['user'][_0xb7fc('0x2a')]({'plain':!![]});if(!_0x10a28e)throw new Error(_0xb7fc('0x50'));if(_0x10a28e[_0xb7fc('0x51')]===_0xb7fc('0x4f')){var _0x4f27b2=_0x8c6f8[_0xb7fc('0x2a')]({'plain':!![]});var _0x1616f8=_0xb7fc('0x52');return db[_0xb7fc('0x5c')][_0xb7fc('0x4d')]({'where':{'name':_0x1616f8,'userProfileId':_0x10a28e[_0xb7fc('0x53')]},'raw':!![]})['then'](function(_0xf0db2e){if(_0xf0db2e&&_0xf0db2e[_0xb7fc('0x5d')]===0x0){return db[_0xb7fc('0x2b')][_0xb7fc('0x4e')]({'name':_0x4f27b2[_0xb7fc('0x2f')],'resourceId':_0x4f27b2['id'],'type':_0xf0db2e['name'],'sectionId':_0xf0db2e['id']},{})['then'](function(){return _0x8c6f8;});}else{return _0x8c6f8;}})[_0xb7fc('0x54')](function(_0x4197bf){logger[_0xb7fc('0x2d')](_0xb7fc('0x55'),_0x4197bf);throw _0x4197bf;});}return _0x8c6f8;});}})[_0xb7fc('0x29')](respondWithResult(_0x4d6a26,0xc9))[_0xb7fc('0x54')](handleError(_0x4d6a26,null));};exports[_0xb7fc('0x28')]=function(_0x37fd67,_0x1a5496){if(_0x37fd67[_0xb7fc('0x58')]['id']){delete _0x37fd67[_0xb7fc('0x58')]['id'];}return db[_0xb7fc('0x33')][_0xb7fc('0x4d')]({'where':{'id':_0x37fd67['params']['id']}})['then'](handleEntityNotFound(_0x1a5496,null))['then'](saveUpdates(_0x37fd67['body'],null))[_0xb7fc('0x29')](respondWithResult(_0x1a5496,null))[_0xb7fc('0x54')](handleError(_0x1a5496,null));};exports['destroy']=function(_0x458126,_0x278254){return db[_0xb7fc('0x33')][_0xb7fc('0x4d')]({'where':{'id':_0x458126['params']['id']}})[_0xb7fc('0x29')](handleEntityNotFound(_0x278254,null))[_0xb7fc('0x29')](removeEntity(_0x278254,null))['catch'](handleError(_0x278254,null));};function widgetAttributes(_0x1a25d3){try{switch(_0x1a25d3[_0xb7fc('0x5e')]){case _0xb7fc('0x5f'):return[{'name':'attrUrl','value':_0x1a25d3['attrUrl']||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3[_0xb7fc('0x60')][0x0][_0xb7fc('0x61')]:undefined)||_0xb7fc('0x62')}];case _0xb7fc('0x63'):return[{'name':_0xb7fc('0x64'),'value':_0x1a25d3[_0xb7fc('0x64')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3[_0xb7fc('0x60')][0x0][_0xb7fc('0x61')]:undefined)||''}];case'clock':return[{'name':_0xb7fc('0x65'),'value':_0x1a25d3['attrHourFormat']||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3[_0xb7fc('0x60')][0x0][_0xb7fc('0x61')]:undefined)||'HH:mm:ss'},{'name':_0xb7fc('0x66'),'value':_0x1a25d3[_0xb7fc('0x66')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x1]?_0x1a25d3[_0xb7fc('0x60')][0x1][_0xb7fc('0x61')]:undefined)||_0xb7fc('0x67')},{'name':_0xb7fc('0x68'),'value':_0x1a25d3[_0xb7fc('0x68')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3['attrs'][0x2]?_0x1a25d3[_0xb7fc('0x60')][0x2][_0xb7fc('0x61')]:undefined)||0xc}];case'counter':return[{'name':_0xb7fc('0x69'),'value':_0x1a25d3[_0xb7fc('0x69')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3['attrs'][0x0][_0xb7fc('0x61')]:undefined)||_0xb7fc('0x6a')},{'name':_0xb7fc('0x6b'),'value':_0x1a25d3[_0xb7fc('0x6b')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x1]?_0x1a25d3[_0xb7fc('0x60')][0x1]['value']:undefined)||[]},{'name':_0xb7fc('0x68'),'value':_0x1a25d3[_0xb7fc('0x68')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x2]?_0x1a25d3[_0xb7fc('0x60')][0x2][_0xb7fc('0x61')]:undefined)||0x14}];case _0xb7fc('0x6c'):case _0xb7fc('0x6d'):return[{'name':_0xb7fc('0x6e'),'value':_0x1a25d3[_0xb7fc('0x6e')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3[_0xb7fc('0x60')][0x0][_0xb7fc('0x61')]:undefined)||_0xb7fc('0x6a')},{'name':_0xb7fc('0x6f'),'value':_0x1a25d3['attrSerie2']||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3['attrs'][0x1]?_0x1a25d3[_0xb7fc('0x60')][0x1][_0xb7fc('0x61')]:undefined)||null},{'name':_0xb7fc('0x70'),'value':_0x1a25d3['attrSerie3']||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3['attrs'][0x2]?_0x1a25d3[_0xb7fc('0x60')][0x2][_0xb7fc('0x61')]:undefined)||null},{'name':_0xb7fc('0x6b'),'value':_0x1a25d3[_0xb7fc('0x6b')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3['attrs'][0x3]?_0x1a25d3[_0xb7fc('0x60')][0x3]['value']:undefined)||[]}];case _0xb7fc('0x71'):return[{'name':_0xb7fc('0x72'),'type':_0x1a25d3[_0xb7fc('0x73')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3[_0xb7fc('0x60')][0x0]['type']:undefined)||null,'value':_0x1a25d3['attrReport']||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x0]?_0x1a25d3[_0xb7fc('0x60')][0x0]['value']:undefined)||null},{'name':_0xb7fc('0x74'),'value':_0x1a25d3[_0xb7fc('0x74')]||(_0x1a25d3[_0xb7fc('0x60')]&&_0x1a25d3[_0xb7fc('0x60')][0x1]?_0x1a25d3[_0xb7fc('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5ccdf5){logger[_0xb7fc('0x2d')](_0xb7fc('0x75'),JSON[_0xb7fc('0x76')](_0x5ccdf5));return[];}}exports['addItem']=function(_0x560869,_0x4cdc19,_0xf8cf67){if(_0x560869[_0xb7fc('0x58')]['id']){delete _0x560869[_0xb7fc('0x58')]['id'];}return db[_0xb7fc('0x33')][_0xb7fc('0x4d')]({'where':{'id':_0x560869[_0xb7fc('0x4a')]['id']}})[_0xb7fc('0x29')](handleEntityNotFound(_0x4cdc19,null))['then'](function(_0x2a2c97){if(_0x2a2c97){_0x560869[_0xb7fc('0x58')][_0xb7fc('0x77')]=_0x2a2c97['id'];_0x560869[_0xb7fc('0x58')]['attrs']=widgetAttributes(_0x560869[_0xb7fc('0x58')]);return db[_0xb7fc('0x78')][_0xb7fc('0x4e')](_0x560869[_0xb7fc('0x58')]);}})[_0xb7fc('0x29')](respondWithResult(_0x4cdc19,null))['catch'](handleError(_0x4cdc19,null));};exports['getItems']=function(_0x564d85,_0x108215,_0x5c5115){var _0x1ef4b9={};var _0x577a7c={};var _0x1af7ba;var _0x4c8c04;return db[_0xb7fc('0x33')][_0xb7fc('0x79')]({'where':{'id':_0x564d85[_0xb7fc('0x4a')]['id']}})[_0xb7fc('0x29')](handleEntityNotFound(_0x108215,null))[_0xb7fc('0x29')](function(_0x48a885){if(_0x48a885){_0x1af7ba=_0x48a885;_0x577a7c[_0xb7fc('0x37')]=_[_0xb7fc('0x4b')](db[_0xb7fc('0x78')][_0xb7fc('0x34')]);_0x577a7c[_0xb7fc('0x3a')]=_[_0xb7fc('0x4b')](_0x564d85['query']);_0x577a7c[_0xb7fc('0x38')]=_[_0xb7fc('0x39')](_0x577a7c[_0xb7fc('0x37')],_0x577a7c[_0xb7fc('0x3a')]);_0x1ef4b9['attributes']=_[_0xb7fc('0x39')](_0x577a7c[_0xb7fc('0x37')],qs[_0xb7fc('0x3c')](_0x564d85[_0xb7fc('0x3a')]['fields']));_0x1ef4b9[_0xb7fc('0x3b')]=_0x1ef4b9[_0xb7fc('0x3b')][_0xb7fc('0x3d')]?_0x1ef4b9['attributes']:_0x577a7c[_0xb7fc('0x37')];_0x1ef4b9[_0xb7fc('0x7a')]=qs['sort'](_0x564d85[_0xb7fc('0x3a')]['sort']);_0x1ef4b9['where']=qs[_0xb7fc('0x38')](_[_0xb7fc('0x41')](_0x564d85[_0xb7fc('0x3a')],_0x577a7c['filters']));if(_0x564d85[_0xb7fc('0x3a')][_0xb7fc('0x42')]){_0x1ef4b9[_0xb7fc('0x43')]=_[_0xb7fc('0x44')](_0x1ef4b9[_0xb7fc('0x43')],{'$or':_[_0xb7fc('0x32')](_0x1ef4b9['attributes'],function(_0x27a58f){var _0x35a1b9={};_0x35a1b9[_0x27a58f]={'$like':'%'+_0x564d85[_0xb7fc('0x3a')]['filter']+'%'};return _0x35a1b9;})});}_0x1ef4b9=_[_0xb7fc('0x44')]({},_0x1ef4b9,_0x564d85[_0xb7fc('0x57')]);return _0x1af7ba[_0xb7fc('0x7b')](_0x1ef4b9);}})[_0xb7fc('0x29')](function(_0x59ff0c){if(_0x59ff0c){_0x4c8c04=_0x59ff0c['length'];if(!_0x564d85[_0xb7fc('0x3a')]['hasOwnProperty'](_0xb7fc('0x3f'))){_0x1ef4b9[_0xb7fc('0x23')]=qs[_0xb7fc('0x23')](_0x564d85[_0xb7fc('0x3a')][_0xb7fc('0x23')]);_0x1ef4b9[_0xb7fc('0x21')]=qs['offset'](_0x564d85[_0xb7fc('0x3a')]['offset']);}return _0x1af7ba[_0xb7fc('0x7b')](_0x1ef4b9);}})[_0xb7fc('0x29')](function(_0x4ba932){if(_0x4ba932){return _0x4ba932?{'count':_0x4c8c04,'rows':_0x4ba932}:null;}})[_0xb7fc('0x29')](respondWithResult(_0x108215,null))[_0xb7fc('0x54')](handleError(_0x108215,null));};
\ No newline at end of file
+var _0xb4d6=['attrHourFormat','value','attrTimezone','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','UserProfileResource','end','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','UserProfileSection','update','iframe','attrUrl','attrs','https://','attrPath','clock'];(function(_0x5bfe14,_0x55df2b){var _0x2889e9=function(_0x83cd83){while(--_0x83cd83){_0x5bfe14['push'](_0x5bfe14['shift']());}};_0x2889e9(++_0x55df2b);}(_0xb4d6,0x181));var _0x6b4d=function(_0x438cce,_0x404d76){_0x438cce=_0x438cce-0x0;var _0x31c2f7=_0xb4d6[_0x438cce];return _0x31c2f7;};'use strict';var emlformat=require(_0x6b4d('0x0'));var rimraf=require(_0x6b4d('0x1'));var zipdir=require(_0x6b4d('0x2'));var jsonpatch=require(_0x6b4d('0x3'));var rp=require(_0x6b4d('0x4'));var moment=require(_0x6b4d('0x5'));var BPromise=require(_0x6b4d('0x6'));var Mustache=require('mustache');var util=require(_0x6b4d('0x7'));var path=require('path');var sox=require(_0x6b4d('0x8'));var csv=require(_0x6b4d('0x9'));var ejs=require(_0x6b4d('0xa'));var fs=require('fs');var fs_extra=require(_0x6b4d('0xb'));var _=require(_0x6b4d('0xc'));var squel=require(_0x6b4d('0xd'));var crypto=require(_0x6b4d('0xe'));var jsforce=require(_0x6b4d('0xf'));var deskjs=require(_0x6b4d('0x10'));var toCsv=require(_0x6b4d('0x9'));var querystring=require(_0x6b4d('0x11'));var Papa=require(_0x6b4d('0x12'));var Redis=require(_0x6b4d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6b4d('0x14'));var as=require(_0x6b4d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b4d('0x16'))(_0x6b4d('0x17'));var utils=require(_0x6b4d('0x18'));var config=require(_0x6b4d('0x19'));var licenseUtil=require(_0x6b4d('0x1a'));var db=require(_0x6b4d('0x1b'))['db'];config['redis']=_[_0x6b4d('0x1c')](config[_0x6b4d('0x1d')],{'host':_0x6b4d('0x1e'),'port':0x18eb});var socket=require(_0x6b4d('0x1f'))(new Redis(config['redis']));require(_0x6b4d('0x20'))[_0x6b4d('0x21')](socket);function respondWithStatusCode(_0xf10c7,_0x4cac73){_0x4cac73=_0x4cac73||0xcc;return function(_0x567aaf){if(_0x567aaf){return _0xf10c7[_0x6b4d('0x22')](_0x4cac73);}return _0xf10c7['status'](_0x4cac73)['end']();};}function respondWithResult(_0x291abd,_0x22aa30){_0x22aa30=_0x22aa30||0xc8;return function(_0xf52b9d){if(_0xf52b9d){return _0x291abd[_0x6b4d('0x23')](_0x22aa30)[_0x6b4d('0x24')](_0xf52b9d);}};}function respondWithFilteredResult(_0x345e8a,_0x351076){return function(_0x27239c){if(_0x27239c){var _0x134196=typeof _0x351076[_0x6b4d('0x25')]===_0x6b4d('0x26')&&typeof _0x351076[_0x6b4d('0x27')]===_0x6b4d('0x26');var _0x560161=_0x27239c[_0x6b4d('0x28')];var _0x12e6e6=_0x134196?0x0:_0x351076['offset'];var _0x303a7c=_0x134196?_0x27239c[_0x6b4d('0x28')]:_0x351076['offset']+_0x351076[_0x6b4d('0x27')];var _0x15995c;if(_0x303a7c>=_0x560161){_0x303a7c=_0x560161;_0x15995c=0xc8;}else{_0x15995c=0xce;}_0x345e8a['status'](_0x15995c);return _0x345e8a[_0x6b4d('0x29')]('Content-Range',_0x12e6e6+'-'+_0x303a7c+'/'+_0x560161)[_0x6b4d('0x24')](_0x27239c);}return null;};}function patchUpdates(_0x30376a){return function(_0x334b06){try{jsonpatch[_0x6b4d('0x2a')](_0x334b06,_0x30376a,!![]);}catch(_0x2bc868){return BPromise[_0x6b4d('0x2b')](_0x2bc868);}return _0x334b06['save']();};}function saveUpdates(_0x192944,_0x471a1d){return function(_0x30b6f7){if(_0x30b6f7){return _0x30b6f7['update'](_0x192944)[_0x6b4d('0x2c')](function(_0x2b8a44){return _0x2b8a44;});}return null;};}function removeEntity(_0x5bd20a,_0x33bec3){return function(_0x333522){if(_0x333522){return _0x333522[_0x6b4d('0x2d')]()[_0x6b4d('0x2c')](function(){var _0x547082=_0x333522['get']({'plain':!![]});var _0x209d28='CustomDashboards';return db[_0x6b4d('0x2e')]['destroy']({'where':{'type':_0x209d28,'resourceId':_0x547082['id']}})[_0x6b4d('0x2c')](function(){return _0x333522;});})[_0x6b4d('0x2c')](function(){_0x5bd20a['status'](0xcc)[_0x6b4d('0x2f')]();});}};}function handleEntityNotFound(_0x271041,_0x25fbb6){return function(_0x5ed304){if(!_0x5ed304){_0x271041[_0x6b4d('0x22')](0x194);}return _0x5ed304;};}function handleError(_0x3d5ca0,_0x455450){_0x455450=_0x455450||0x1f4;return function(_0x3e2e28){logger['error'](_0x3e2e28[_0x6b4d('0x30')]);if(_0x3e2e28['name']){delete _0x3e2e28[_0x6b4d('0x31')];}_0x3d5ca0[_0x6b4d('0x23')](_0x455450)[_0x6b4d('0x32')](_0x3e2e28);};}exports[_0x6b4d('0x33')]=function(_0x5270b3,_0x1e6088){var _0x1a8028={},_0x2a40b7={},_0x48fe35={'count':0x0,'rows':[]};var _0x2328e4=_[_0x6b4d('0x34')](db[_0x6b4d('0x35')][_0x6b4d('0x36')],function(_0x41092a){return{'name':_0x41092a[_0x6b4d('0x37')],'type':_0x41092a['type'][_0x6b4d('0x38')]};});_0x2a40b7[_0x6b4d('0x39')]=_[_0x6b4d('0x34')](_0x2328e4,_0x6b4d('0x31'));_0x2a40b7[_0x6b4d('0x3a')]=_[_0x6b4d('0x3b')](_0x5270b3[_0x6b4d('0x3a')]);_0x2a40b7['filters']=_[_0x6b4d('0x3c')](_0x2a40b7[_0x6b4d('0x39')],_0x2a40b7['query']);_0x1a8028[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0x2a40b7['model'],qs[_0x6b4d('0x3e')](_0x5270b3[_0x6b4d('0x3a')][_0x6b4d('0x3e')]));_0x1a8028['attributes']=_0x1a8028[_0x6b4d('0x3d')][_0x6b4d('0x3f')]?_0x1a8028[_0x6b4d('0x3d')]:_0x2a40b7[_0x6b4d('0x39')];if(!_0x5270b3[_0x6b4d('0x3a')][_0x6b4d('0x40')](_0x6b4d('0x41'))){_0x1a8028[_0x6b4d('0x27')]=qs['limit'](_0x5270b3[_0x6b4d('0x3a')]['limit']);_0x1a8028[_0x6b4d('0x25')]=qs[_0x6b4d('0x25')](_0x5270b3[_0x6b4d('0x3a')][_0x6b4d('0x25')]);}_0x1a8028['order']=qs['sort'](_0x5270b3['query'][_0x6b4d('0x42')]);_0x1a8028[_0x6b4d('0x43')]=qs[_0x6b4d('0x44')](_['pick'](_0x5270b3[_0x6b4d('0x3a')],_0x2a40b7[_0x6b4d('0x44')]),_0x2328e4);if(_0x5270b3['query'][_0x6b4d('0x45')]){_0x1a8028[_0x6b4d('0x43')]=_['merge'](_0x1a8028[_0x6b4d('0x43')],{'$or':_[_0x6b4d('0x34')](_0x2328e4,function(_0x12cdff){if(_0x12cdff[_0x6b4d('0x46')]!==_0x6b4d('0x47')){var _0x550367={};_0x550367[_0x12cdff[_0x6b4d('0x31')]]={'$like':'%'+_0x5270b3['query']['filter']+'%'};return _0x550367;}})});}_0x1a8028=_[_0x6b4d('0x48')]({},_0x1a8028,_0x5270b3['options']);var _0x12fead={'where':_0x1a8028[_0x6b4d('0x43')]};return db[_0x6b4d('0x35')][_0x6b4d('0x28')](_0x12fead)[_0x6b4d('0x2c')](function(_0x2a286b){_0x48fe35[_0x6b4d('0x28')]=_0x2a286b;if(_0x5270b3['query'][_0x6b4d('0x49')]){_0x1a8028[_0x6b4d('0x4a')]=[{'all':!![]}];}return db['Dashboard'][_0x6b4d('0x4b')](_0x1a8028);})[_0x6b4d('0x2c')](function(_0x3a0285){_0x48fe35[_0x6b4d('0x4c')]=_0x3a0285;return _0x48fe35;})[_0x6b4d('0x2c')](respondWithFilteredResult(_0x1e6088,_0x1a8028))[_0x6b4d('0x4d')](handleError(_0x1e6088,null));};exports[_0x6b4d('0x4e')]=function(_0x3b610a,_0x4e2c9e){var _0x2a00ef={'raw':![],'where':{'id':_0x3b610a[_0x6b4d('0x4f')]['id']}},_0xd4b23b={};_0xd4b23b[_0x6b4d('0x39')]=_[_0x6b4d('0x3b')](db[_0x6b4d('0x35')][_0x6b4d('0x36')]);_0xd4b23b['query']=_[_0x6b4d('0x3b')](_0x3b610a[_0x6b4d('0x3a')]);_0xd4b23b['filters']=_[_0x6b4d('0x3c')](_0xd4b23b[_0x6b4d('0x39')],_0xd4b23b['query']);_0x2a00ef[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0xd4b23b[_0x6b4d('0x39')],qs[_0x6b4d('0x3e')](_0x3b610a[_0x6b4d('0x3a')][_0x6b4d('0x3e')]));_0x2a00ef['attributes']=_0x2a00ef[_0x6b4d('0x3d')][_0x6b4d('0x3f')]?_0x2a00ef[_0x6b4d('0x3d')]:_0xd4b23b[_0x6b4d('0x39')];if(_0x3b610a['query'][_0x6b4d('0x49')]){_0x2a00ef[_0x6b4d('0x4a')]=[{'all':!![]}];}_0x2a00ef=_['merge']({},_0x2a00ef,_0x3b610a[_0x6b4d('0x50')]);return db[_0x6b4d('0x35')][_0x6b4d('0x51')](_0x2a00ef)[_0x6b4d('0x2c')](handleEntityNotFound(_0x4e2c9e,null))['then'](respondWithResult(_0x4e2c9e,null))[_0x6b4d('0x4d')](handleError(_0x4e2c9e,null));};exports['create']=function(_0x2a9062,_0x4453c4){return db['Dashboard'][_0x6b4d('0x52')](_0x2a9062[_0x6b4d('0x53')],{})[_0x6b4d('0x2c')](function(_0x5640ac){var _0xa8a540=_0x2a9062[_0x6b4d('0x54')][_0x6b4d('0x55')]({'plain':!![]});if(!_0xa8a540)throw new Error(_0x6b4d('0x56'));if(_0xa8a540[_0x6b4d('0x57')]==='user'){var _0x7f492c=_0x5640ac['get']({'plain':!![]});var _0x267204=_0x6b4d('0x58');return db['UserProfileSection'][_0x6b4d('0x51')]({'where':{'name':_0x267204,'userProfileId':_0xa8a540[_0x6b4d('0x59')]},'raw':!![]})[_0x6b4d('0x2c')](function(_0x38fcf1){if(_0x38fcf1&&_0x38fcf1[_0x6b4d('0x5a')]===0x0){return db[_0x6b4d('0x2e')][_0x6b4d('0x52')]({'name':_0x7f492c[_0x6b4d('0x31')],'resourceId':_0x7f492c['id'],'type':_0x38fcf1[_0x6b4d('0x31')],'sectionId':_0x38fcf1['id']},{})[_0x6b4d('0x2c')](function(){return _0x5640ac;});}else{return _0x5640ac;}})[_0x6b4d('0x4d')](function(_0x1bf3a0){logger[_0x6b4d('0x5b')](_0x6b4d('0x5c'),_0x1bf3a0);throw _0x1bf3a0;});}return _0x5640ac;})[_0x6b4d('0x2c')](respondWithResult(_0x4453c4,0xc9))[_0x6b4d('0x4d')](handleError(_0x4453c4,null));};exports[_0x6b4d('0x5d')]=function(_0x2297a6,_0x524410){var _0x428e3f={'where':{'id':_0x2297a6[_0x6b4d('0x4f')]['id']}},_0x1d9fbc={};_0x1d9fbc[_0x6b4d('0x39')]=_[_0x6b4d('0x3b')](db[_0x6b4d('0x35')][_0x6b4d('0x36')]);_0x428e3f[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0x1d9fbc['model'],qs['fields'](_0x2297a6[_0x6b4d('0x3a')][_0x6b4d('0x3e')]));_0x428e3f[_0x6b4d('0x3d')]=_0x428e3f[_0x6b4d('0x3d')][_0x6b4d('0x3f')]?_0x428e3f[_0x6b4d('0x3d')]:_0x1d9fbc[_0x6b4d('0x39')];if(_0x2297a6[_0x6b4d('0x3a')]['includeAll']){_0x428e3f[_0x6b4d('0x4a')]=[{'all':!![]}];}_0x428e3f=_['merge']({},_0x428e3f,_0x2297a6['options']);return db['Dashboard'][_0x6b4d('0x51')](_0x428e3f)[_0x6b4d('0x2c')](handleEntityNotFound(_0x524410,null))[_0x6b4d('0x2c')](function(_0xefe6c0){if(_0xefe6c0){var _0x42c381=_0xefe6c0[_0x6b4d('0x55')]({'plain':!![]});_0x42c381=qs['omit'](_0x42c381,['id',_0x6b4d('0x5e'),'updatedAt']);_0x2297a6[_0x6b4d('0x53')]=_['omit'](_0x2297a6['body'],['id',_0x6b4d('0x5e'),'updatedAt']);return db[_0x6b4d('0x35')]['create'](_['merge'](_0x42c381,_0x2297a6['body']),{'include':_0x2297a6[_0x6b4d('0x3a')][_0x6b4d('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x56217a){var _0x5ab1dc=_0x2297a6['user'][_0x6b4d('0x55')]({'plain':!![]});if(!_0x5ab1dc)throw new Error(_0x6b4d('0x56'));if(_0x5ab1dc[_0x6b4d('0x57')]==='user'){var _0x98abd9=_0x56217a[_0x6b4d('0x55')]({'plain':!![]});var _0x1c4ba4=_0x6b4d('0x58');return db[_0x6b4d('0x5f')]['find']({'where':{'name':_0x1c4ba4,'userProfileId':_0x5ab1dc[_0x6b4d('0x59')]},'raw':!![]})[_0x6b4d('0x2c')](function(_0x450547){if(_0x450547&&_0x450547['autoAssociation']===0x0){return db[_0x6b4d('0x2e')]['create']({'name':_0x98abd9[_0x6b4d('0x31')],'resourceId':_0x98abd9['id'],'type':_0x450547['name'],'sectionId':_0x450547['id']},{})['then'](function(){return _0x56217a;});}else{return _0x56217a;}})['catch'](function(_0x493b09){logger[_0x6b4d('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x493b09);throw _0x493b09;});}return _0x56217a;});}})['then'](respondWithResult(_0x524410,0xc9))[_0x6b4d('0x4d')](handleError(_0x524410,null));};exports[_0x6b4d('0x60')]=function(_0x309cfd,_0x37dc5d){if(_0x309cfd[_0x6b4d('0x53')]['id']){delete _0x309cfd[_0x6b4d('0x53')]['id'];}return db[_0x6b4d('0x35')][_0x6b4d('0x51')]({'where':{'id':_0x309cfd['params']['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x37dc5d,null))[_0x6b4d('0x2c')](saveUpdates(_0x309cfd[_0x6b4d('0x53')],null))[_0x6b4d('0x2c')](respondWithResult(_0x37dc5d,null))['catch'](handleError(_0x37dc5d,null));};exports[_0x6b4d('0x2d')]=function(_0x2cc7ce,_0x1c720f){return db[_0x6b4d('0x35')][_0x6b4d('0x51')]({'where':{'id':_0x2cc7ce[_0x6b4d('0x4f')]['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x1c720f,null))[_0x6b4d('0x2c')](removeEntity(_0x1c720f,null))[_0x6b4d('0x4d')](handleError(_0x1c720f,null));};function widgetAttributes(_0x4b6f71){try{switch(_0x4b6f71['type']){case _0x6b4d('0x61'):return[{'name':_0x6b4d('0x62'),'value':_0x4b6f71[_0x6b4d('0x62')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71['attrs'][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0]['value']:undefined)||_0x6b4d('0x64')}];case'custom':return[{'name':_0x6b4d('0x65'),'value':_0x4b6f71[_0x6b4d('0x65')]||(_0x4b6f71['attrs']&&_0x4b6f71['attrs'][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0]['value']:undefined)||''}];case _0x6b4d('0x66'):return[{'name':_0x6b4d('0x67'),'value':_0x4b6f71['attrHourFormat']||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71['attrs'][0x0][_0x6b4d('0x68')]:undefined)||'HH:mm:ss'},{'name':_0x6b4d('0x69'),'value':_0x4b6f71[_0x6b4d('0x69')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71['attrs'][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1][_0x6b4d('0x68')]:undefined)||'0.00'},{'name':_0x6b4d('0x6a'),'value':_0x4b6f71[_0x6b4d('0x6a')]||(_0x4b6f71['attrs']&&_0x4b6f71[_0x6b4d('0x63')][0x2]?_0x4b6f71['attrs'][0x2][_0x6b4d('0x68')]:undefined)||0xc}];case'counter':return[{'name':_0x6b4d('0x6b'),'value':_0x4b6f71[_0x6b4d('0x6b')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x6b4d('0x6c'),'value':_0x4b6f71[_0x6b4d('0x6c')]||(_0x4b6f71['attrs']&&_0x4b6f71[_0x6b4d('0x63')][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1]['value']:undefined)||[]},{'name':_0x6b4d('0x6a'),'value':_0x4b6f71[_0x6b4d('0x6a')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71['attrs'][0x2]?_0x4b6f71[_0x6b4d('0x63')][0x2][_0x6b4d('0x68')]:undefined)||0x14}];case _0x6b4d('0x6d'):case _0x6b4d('0x6e'):return[{'name':_0x6b4d('0x6f'),'value':_0x4b6f71[_0x6b4d('0x6f')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0][_0x6b4d('0x68')]:undefined)||'total'},{'name':_0x6b4d('0x70'),'value':_0x4b6f71[_0x6b4d('0x70')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1][_0x6b4d('0x68')]:undefined)||null},{'name':'attrSerie3','value':_0x4b6f71['attrSerie3']||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x2]?_0x4b6f71[_0x6b4d('0x63')][0x2][_0x6b4d('0x68')]:undefined)||null},{'name':_0x6b4d('0x6c'),'value':_0x4b6f71[_0x6b4d('0x6c')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x3]?_0x4b6f71[_0x6b4d('0x63')][0x3][_0x6b4d('0x68')]:undefined)||[]}];case _0x6b4d('0x71'):return[{'name':_0x6b4d('0x72'),'type':_0x4b6f71[_0x6b4d('0x73')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x0]?_0x4b6f71['attrs'][0x0][_0x6b4d('0x46')]:undefined)||null,'value':_0x4b6f71[_0x6b4d('0x72')]||(_0x4b6f71['attrs']&&_0x4b6f71['attrs'][0x0]?_0x4b6f71[_0x6b4d('0x63')][0x0][_0x6b4d('0x68')]:undefined)||null},{'name':_0x6b4d('0x74'),'value':_0x4b6f71[_0x6b4d('0x74')]||(_0x4b6f71[_0x6b4d('0x63')]&&_0x4b6f71[_0x6b4d('0x63')][0x1]?_0x4b6f71[_0x6b4d('0x63')][0x1][_0x6b4d('0x68')]:undefined)||0x0}];default:return[];}}catch(_0x58d80b){logger[_0x6b4d('0x5b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x58d80b));return[];}}exports[_0x6b4d('0x75')]=function(_0x3655f7,_0x48e653,_0x417bb7){if(_0x3655f7[_0x6b4d('0x53')]['id']){delete _0x3655f7[_0x6b4d('0x53')]['id'];}return db[_0x6b4d('0x35')][_0x6b4d('0x51')]({'where':{'id':_0x3655f7['params']['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x48e653,null))[_0x6b4d('0x2c')](function(_0x375362){if(_0x375362){_0x3655f7[_0x6b4d('0x53')][_0x6b4d('0x76')]=_0x375362['id'];_0x3655f7[_0x6b4d('0x53')][_0x6b4d('0x63')]=widgetAttributes(_0x3655f7['body']);return db[_0x6b4d('0x77')][_0x6b4d('0x52')](_0x3655f7[_0x6b4d('0x53')]);}})[_0x6b4d('0x2c')](respondWithResult(_0x48e653,null))[_0x6b4d('0x4d')](handleError(_0x48e653,null));};exports[_0x6b4d('0x78')]=function(_0xd1167c,_0x42e5f4,_0x3a43f3){var _0x46401a={};var _0xd8a99={};var _0x269a26;var _0x5c3771;return db[_0x6b4d('0x35')][_0x6b4d('0x79')]({'where':{'id':_0xd1167c['params']['id']}})[_0x6b4d('0x2c')](handleEntityNotFound(_0x42e5f4,null))['then'](function(_0x482125){if(_0x482125){_0x269a26=_0x482125;_0xd8a99[_0x6b4d('0x39')]=_['keys'](db['DashboardItem'][_0x6b4d('0x36')]);_0xd8a99[_0x6b4d('0x3a')]=_['keys'](_0xd1167c[_0x6b4d('0x3a')]);_0xd8a99[_0x6b4d('0x44')]=_[_0x6b4d('0x3c')](_0xd8a99[_0x6b4d('0x39')],_0xd8a99[_0x6b4d('0x3a')]);_0x46401a[_0x6b4d('0x3d')]=_[_0x6b4d('0x3c')](_0xd8a99[_0x6b4d('0x39')],qs[_0x6b4d('0x3e')](_0xd1167c['query'][_0x6b4d('0x3e')]));_0x46401a[_0x6b4d('0x3d')]=_0x46401a['attributes'][_0x6b4d('0x3f')]?_0x46401a['attributes']:_0xd8a99['model'];_0x46401a['order']=qs[_0x6b4d('0x42')](_0xd1167c[_0x6b4d('0x3a')][_0x6b4d('0x42')]);_0x46401a[_0x6b4d('0x43')]=qs[_0x6b4d('0x44')](_['pick'](_0xd1167c[_0x6b4d('0x3a')],_0xd8a99['filters']));if(_0xd1167c[_0x6b4d('0x3a')]['filter']){_0x46401a[_0x6b4d('0x43')]=_[_0x6b4d('0x48')](_0x46401a[_0x6b4d('0x43')],{'$or':_[_0x6b4d('0x34')](_0x46401a[_0x6b4d('0x3d')],function(_0x241c74){var _0x6728df={};_0x6728df[_0x241c74]={'$like':'%'+_0xd1167c[_0x6b4d('0x3a')]['filter']+'%'};return _0x6728df;})});}_0x46401a=_[_0x6b4d('0x48')]({},_0x46401a,_0xd1167c[_0x6b4d('0x50')]);return _0x269a26['getItems'](_0x46401a);}})['then'](function(_0x21b3b5){if(_0x21b3b5){_0x5c3771=_0x21b3b5[_0x6b4d('0x3f')];if(!_0xd1167c['query'][_0x6b4d('0x40')](_0x6b4d('0x41'))){_0x46401a[_0x6b4d('0x27')]=qs[_0x6b4d('0x27')](_0xd1167c['query']['limit']);_0x46401a['offset']=qs[_0x6b4d('0x25')](_0xd1167c['query'][_0x6b4d('0x25')]);}return _0x269a26[_0x6b4d('0x78')](_0x46401a);}})[_0x6b4d('0x2c')](function(_0x155e6a){if(_0x155e6a){return _0x155e6a?{'count':_0x5c3771,'rows':_0x155e6a}:null;}})[_0x6b4d('0x2c')](respondWithResult(_0x42e5f4,null))[_0x6b4d('0x4d')](handleError(_0x42e5f4,null));};
\ No newline at end of file
index 3fa3d49..03ddf9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x281e=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x496cba,_0x92dd1f){var _0x248927=function(_0x364ffd){while(--_0x364ffd){_0x496cba['push'](_0x496cba['shift']());}};_0x248927(++_0x92dd1f);}(_0x281e,0x168));var _0xe281=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x281e[_0x1f36bb];return _0xaf97fa;};'use strict';var EventEmitter=require(_0xe281('0x0'));var Dashboard=require(_0xe281('0x1'))['db'][_0xe281('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe281('0x3')](0x0);var events={'afterCreate':_0xe281('0x4'),'afterUpdate':_0xe281('0x5'),'afterDestroy':_0xe281('0x6')};function emitEvent(_0x44ec5f){return function(_0x54e0d1,_0x4a5b43,_0x1239eb){DashboardEvents['emit'](_0x44ec5f+':'+_0x54e0d1['id'],_0x54e0d1);DashboardEvents[_0xe281('0x7')](_0x44ec5f,_0x54e0d1);_0x1239eb(null);};}for(var e in events){if(events[_0xe281('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0x5bd7=['update','emit','hook','exports','../../mysqldb','Dashboard','setMaxListeners'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x5bd7,0x12a));var _0x75bd=function(_0x1436d8,_0x5135aa){_0x1436d8=_0x1436d8-0x0;var _0x252c31=_0x5bd7[_0x1436d8];return _0x252c31;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x75bd('0x0'))['db'][_0x75bd('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x75bd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x75bd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x45639e){return function(_0x24036f,_0x524c93,_0x440c0d){DashboardEvents[_0x75bd('0x4')](_0x45639e+':'+_0x24036f['id'],_0x24036f);DashboardEvents[_0x75bd('0x4')](_0x45639e,_0x24036f);_0x440c0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x75bd('0x5')](e,emitEvent(event));}}module[_0x75bd('0x6')]=DashboardEvents;
\ No newline at end of file
index 693bd39..5f9a2a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b70=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Dashboard','lodash'];(function(_0x49c62f,_0xa471a9){var _0xa7152b=function(_0x2f20a5){while(--_0x2f20a5){_0x49c62f['push'](_0x49c62f['shift']());}};_0xa7152b(++_0xa471a9);}(_0x1b70,0xa7));var _0x01b7=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x1b70[_0x19dd7a];return _0x3feb6a;};'use strict';var _=require(_0x01b7('0x0'));var util=require(_0x01b7('0x1'));var logger=require(_0x01b7('0x2'))(_0x01b7('0x3'));var moment=require(_0x01b7('0x4'));var BPromise=require(_0x01b7('0x5'));var rp=require(_0x01b7('0x6'));var fs=require('fs');var path=require(_0x01b7('0x7'));var rimraf=require(_0x01b7('0x8'));var config=require(_0x01b7('0x9'));var attributes=require('./dashboard.attributes');module[_0x01b7('0xa')]=function(_0x27cd5e,_0x13564b){return _0x27cd5e['define'](_0x01b7('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1546=['../../config/logger','request-promise','path','rimraf','../../config/environment','define','Dashboard','dashboards','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1546,0x18b));var _0x6154=function(_0x391862,_0x14772a){_0x391862=_0x391862-0x0;var _0x3cad7f=_0x1546[_0x391862];return _0x3cad7f;};'use strict';var _=require('lodash');var util=require(_0x6154('0x0'));var logger=require(_0x6154('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6154('0x2'));var fs=require('fs');var path=require(_0x6154('0x3'));var rimraf=require(_0x6154('0x4'));var config=require(_0x6154('0x5'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x37082f,_0xcf55bb){return _0x37082f[_0x6154('0x6')](_0x6154('0x7'),attributes,{'tableName':_0x6154('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7804485..cb09492 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ba1=['rpc','jayson/promise','client','redis','defaults','localhost','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0x0ba1,0xca));var _0x10ba=function(_0x13b38e,_0x4ca0b1){_0x13b38e=_0x13b38e-0x0;var _0x27c754=_0x0ba1[_0x13b38e];return _0x27c754;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x10ba('0x0'));var BPromise=require(_0x10ba('0x1'));var rs=require(_0x10ba('0x2'));var fs=require('fs');var Redis=require(_0x10ba('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x10ba('0x4'));var logger=require('../../config/logger')(_0x10ba('0x5'));var config=require('../../config/environment');var jayson=require(_0x10ba('0x6'));var client=jayson[_0x10ba('0x7')]['http']({'port':0x232a});config[_0x10ba('0x8')]=_[_0x10ba('0x9')](config[_0x10ba('0x8')],{'host':_0x10ba('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10ba('0x8')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x565ecd,_0x125899,_0x34b210){return new BPromise(function(_0x358a1b,_0x87b612){return client[_0x10ba('0xb')](_0x565ecd,_0x34b210)[_0x10ba('0xc')](function(_0x337f18){logger[_0x10ba('0xd')](_0x10ba('0xe'),_0x125899,'request\x20sent');logger[_0x10ba('0xf')](_0x10ba('0x10'),_0x125899,_0x10ba('0x11'),JSON[_0x10ba('0x12')](_0x337f18));if(_0x337f18[_0x10ba('0x13')]){if(_0x337f18['error']['code']===0x1f4){logger[_0x10ba('0x13')](_0x10ba('0xe'),_0x125899,_0x337f18[_0x10ba('0x13')][_0x10ba('0x14')]);return _0x87b612(_0x337f18[_0x10ba('0x13')][_0x10ba('0x14')]);}logger[_0x10ba('0x13')](_0x10ba('0xe'),_0x125899,_0x337f18[_0x10ba('0x13')][_0x10ba('0x14')]);return _0x358a1b(_0x337f18[_0x10ba('0x13')][_0x10ba('0x14')]);}else{logger[_0x10ba('0xd')](_0x10ba('0xe'),_0x125899,_0x10ba('0x11'));_0x358a1b(_0x337f18[_0x10ba('0x15')][_0x10ba('0x14')]);}})[_0x10ba('0x16')](function(_0x17a58f){logger[_0x10ba('0x13')](_0x10ba('0xe'),_0x125899,_0x17a58f);_0x87b612(_0x17a58f);});});}
\ No newline at end of file
+var _0x3d61=['util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./dashboard.socket','register','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Dashboard,\x20%s,\x20%s','result','catch','lodash'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x3d61,0x10d));var _0x13d6=function(_0x1d23a8,_0x112e6d){_0x1d23a8=_0x1d23a8-0x0;var _0x2b1c6f=_0x3d61[_0x1d23a8];return _0x2b1c6f;};'use strict';var _=require(_0x13d6('0x0'));var util=require(_0x13d6('0x1'));var moment=require(_0x13d6('0x2'));var BPromise=require('bluebird');var rs=require(_0x13d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x13d6('0x4'))(_0x13d6('0x5'));var config=require(_0x13d6('0x6'));var jayson=require(_0x13d6('0x7'));var client=jayson[_0x13d6('0x8')][_0x13d6('0x9')]({'port':0x232a});config[_0x13d6('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x13d6('0xb'))(new Redis(config[_0x13d6('0xa')]));require(_0x13d6('0xc'))[_0x13d6('0xd')](socket);function respondWithRpcPromise(_0x28a420,_0x4a653a,_0x3053c7){return new BPromise(function(_0x100173,_0x7a4278){return client[_0x13d6('0xe')](_0x28a420,_0x3053c7)[_0x13d6('0xf')](function(_0x43efdf){logger[_0x13d6('0x10')]('Dashboard,\x20%s,\x20%s',_0x4a653a,'request\x20sent');logger[_0x13d6('0x11')](_0x13d6('0x12'),_0x4a653a,_0x13d6('0x13'),JSON[_0x13d6('0x14')](_0x43efdf));if(_0x43efdf[_0x13d6('0x15')]){if(_0x43efdf[_0x13d6('0x15')][_0x13d6('0x16')]===0x1f4){logger['error']('Dashboard,\x20%s,\x20%s',_0x4a653a,_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);return _0x7a4278(_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);}logger[_0x13d6('0x15')](_0x13d6('0x18'),_0x4a653a,_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);return _0x100173(_0x43efdf[_0x13d6('0x15')][_0x13d6('0x17')]);}else{logger[_0x13d6('0x10')](_0x13d6('0x18'),_0x4a653a,_0x13d6('0x13'));_0x100173(_0x43efdf[_0x13d6('0x19')]['message']);}})[_0x13d6('0x1a')](function(_0x4d4b09){logger['error']('Dashboard,\x20%s,\x20%s',_0x4a653a,_0x4d4b09);_0x7a4278(_0x4d4b09);});});}
\ No newline at end of file
index 92394c5..66ca195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7753=['remove','update','emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x3ca6ab,_0x53d896){var _0x434984=function(_0x15cc16){while(--_0x15cc16){_0x3ca6ab['push'](_0x3ca6ab['shift']());}};_0x434984(++_0x53d896);}(_0x7753,0x19e));var _0x3775=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x7753[_0x1e3671];return _0x48d5f5;};'use strict';var DashboardEvents=require(_0x3775('0x0'));var events=[_0x3775('0x1'),_0x3775('0x2'),_0x3775('0x3')];function createListener(_0x9db159,_0x3adf12){return function(_0x1d2a85){_0x3adf12[_0x3775('0x4')](_0x9db159,_0x1d2a85);};}function removeListener(_0x3a92db,_0x40d6ef){return function(){DashboardEvents['removeListener'](_0x3a92db,_0x40d6ef);};}exports[_0x3775('0x5')]=function(_0x2b1fbe){for(var _0x419eb0=0x0,_0x12bb6c=events[_0x3775('0x6')];_0x419eb0<_0x12bb6c;_0x419eb0++){var _0x1ea130=events[_0x419eb0];var _0x1ad48e=createListener(_0x3775('0x7')+_0x1ea130,_0x2b1fbe);DashboardEvents['on'](_0x1ea130,_0x1ad48e);}};
\ No newline at end of file
+var _0xcc67=['removeListener','length','./dashboard.events','remove','update','emit'];(function(_0x507b08,_0x1fe1f4){var _0xe75256=function(_0x54c969){while(--_0x54c969){_0x507b08['push'](_0x507b08['shift']());}};_0xe75256(++_0x1fe1f4);}(_0xcc67,0x13a));var _0x7cc6=function(_0x19edc8,_0x33c32a){_0x19edc8=_0x19edc8-0x0;var _0x394b20=_0xcc67[_0x19edc8];return _0x394b20;};'use strict';var DashboardEvents=require(_0x7cc6('0x0'));var events=['save',_0x7cc6('0x1'),_0x7cc6('0x2')];function createListener(_0x474057,_0x2635a3){return function(_0x577418){_0x2635a3[_0x7cc6('0x3')](_0x474057,_0x577418);};}function removeListener(_0x5997c2,_0x293eba){return function(){DashboardEvents[_0x7cc6('0x4')](_0x5997c2,_0x293eba);};}exports['register']=function(_0x10835e){for(var _0x5d89c5=0x0,_0x911375=events[_0x7cc6('0x5')];_0x5d89c5<_0x911375;_0x5d89c5++){var _0x10e31b=events[_0x5d89c5];var _0x5a3975=createListener('dashboard:'+_0x10e31b,_0x10835e);DashboardEvents['on'](_0x10e31b,_0x5a3975);}};
\ No newline at end of file
index 259c0e2..60dfffd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35a6=['delete','destroy','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x35a6,0x9c));var _0x635a=function(_0x4e848,_0xdc4e75){_0x4e848=_0x4e848-0x0;var _0x1eba5e=_0x35a6[_0x4e848];return _0x1eba5e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x635a('0x0'));var timeout=require(_0x635a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x635a('0x2'));var auth=require(_0x635a('0x3'));var interaction=require(_0x635a('0x4'));var config=require(_0x635a('0x5'));var controller=require(_0x635a('0x6'));router[_0x635a('0x7')]('/',auth[_0x635a('0x8')](),controller['index']);router[_0x635a('0x7')](_0x635a('0x9'),auth[_0x635a('0x8')](),controller[_0x635a('0xa')]);router[_0x635a('0x7')](_0x635a('0xb'),auth[_0x635a('0x8')](),controller[_0x635a('0xc')]);router[_0x635a('0xd')]('/',auth['isAuthenticated'](),controller[_0x635a('0xe')]);router['post'](_0x635a('0xf'),auth[_0x635a('0x8')](),controller[_0x635a('0x10')]);router['post'](_0x635a('0xb'),auth['isAuthenticated'](),controller[_0x635a('0x11')]);router[_0x635a('0x12')](_0x635a('0x9'),auth[_0x635a('0x8')](),controller[_0x635a('0x13')]);router[_0x635a('0x14')]('/:id',auth[_0x635a('0x8')](),controller[_0x635a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x9505=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','post','create','/:id/clone','put','delete','destroy','exports','path'];(function(_0x1620c7,_0x457d19){var _0x3406bd=function(_0x4b2177){while(--_0x4b2177){_0x1620c7['push'](_0x1620c7['shift']());}};_0x3406bd(++_0x457d19);}(_0x9505,0x1e2));var _0x5950=function(_0x3d42c3,_0x33782d){_0x3d42c3=_0x3d42c3-0x0;var _0x436928=_0x9505[_0x3d42c3];return _0x436928;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5950('0x0'));var timeout=require(_0x5950('0x1'));var express=require(_0x5950('0x2'));var router=express[_0x5950('0x3')]();var fs_extra=require(_0x5950('0x4'));var auth=require(_0x5950('0x5'));var interaction=require(_0x5950('0x6'));var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router[_0x5950('0x8')](_0x5950('0xb'),auth[_0x5950('0x9')](),controller[_0x5950('0xc')]);router[_0x5950('0x8')](_0x5950('0xd'),auth[_0x5950('0x9')](),controller['getItems']);router[_0x5950('0xe')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xf')]);router[_0x5950('0xe')](_0x5950('0x10'),auth[_0x5950('0x9')](),controller['clone']);router[_0x5950('0xe')]('/:id/items',auth[_0x5950('0x9')](),controller['addItem']);router[_0x5950('0x11')]('/:id',auth[_0x5950('0x9')](),controller['update']);router[_0x5950('0x12')]('/:id',auth[_0x5950('0x9')](),controller[_0x5950('0x13')]);module[_0x5950('0x14')]=router;
\ No newline at end of file
index 931ea1d..e20fb10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['#2196f3','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0x4de25c,_0x4b2a85){var _0x141139=function(_0x22d4fe){while(--_0x22d4fe){_0x4de25c['push'](_0x4de25c['shift']());}};_0x141139(++_0x4b2a85);}(_0x326f,0xd1));var _0xf326=function(_0x4d627f,_0xfaa81c){_0x4d627f=_0x4d627f-0x0;var _0x3e0deb=_0x326f[_0x4d627f];return _0x3e0deb;};'use strict';var Sequelize=require(_0xf326('0x0'));var squel=require('squel');var _=require('lodash');module[_0xf326('0x1')]={'title':{'type':Sequelize[_0xf326('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf326('0x3')](_0xf326('0x4')),'get':function(){try{return JSON[_0xf326('0x5')](this[_0xf326('0x6')](_0xf326('0x7')));}catch(_0x1b5a56){return[];}},'set':function(_0x3ace29){try{this['setDataValue'](_0xf326('0x7'),JSON[_0xf326('0x8')](_0x3ace29));}catch(_0x165f95){this[_0xf326('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf326('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf326('0xa')]},'col':{'type':Sequelize[_0xf326('0xa')]},'background':{'type':Sequelize[_0xf326('0x2')],'allowNull':![],'defaultValue':_0xf326('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf326('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xf326('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x1261=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x1261,0x144));var _0x1126=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x1261[_0x1795df];return _0x3f13c0;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x1126('0x0'));var _=require(_0x1126('0x1'));module[_0x1126('0x2')]={'title':{'type':Sequelize[_0x1126('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1126('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x1126('0x4')](_0x1126('0x5')),'get':function(){try{return JSON[_0x1126('0x6')](this[_0x1126('0x7')](_0x1126('0x8')));}catch(_0x5a2189){return[];}},'set':function(_0x5c68c8){try{this[_0x1126('0x9')](_0x1126('0x8'),JSON['stringify'](_0x5c68c8));}catch(_0x17e5f0){this[_0x1126('0x9')](_0x1126('0x8'),JSON[_0x1126('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x1126('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1126('0xb')]},'col':{'type':Sequelize[_0x1126('0xb')]},'background':{'type':Sequelize[_0x1126('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1126('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1126('0xb')],'defaultValue':0xc}};
\ No newline at end of file
index b6ab48d..0da98ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28a2=['keys','DashboardItem','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','custom','attrPath','clock','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','stack','name','send','show','params','model'];(function(_0x184f7c,_0x4799d0){var _0x16ee6a=function(_0x174b43){while(--_0x174b43){_0x184f7c['push'](_0x184f7c['shift']());}};_0x16ee6a(++_0x4799d0);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x228a('0x0'));var rimraf=require(_0x228a('0x1'));var zipdir=require(_0x228a('0x2'));var jsonpatch=require(_0x228a('0x3'));var rp=require(_0x228a('0x4'));var moment=require(_0x228a('0x5'));var BPromise=require(_0x228a('0x6'));var Mustache=require('mustache');var util=require(_0x228a('0x7'));var path=require('path');var sox=require(_0x228a('0x8'));var csv=require(_0x228a('0x9'));var ejs=require(_0x228a('0xa'));var fs=require('fs');var fs_extra=require(_0x228a('0xb'));var _=require(_0x228a('0xc'));var squel=require('squel');var crypto=require(_0x228a('0xd'));var jsforce=require(_0x228a('0xe'));var deskjs=require(_0x228a('0xf'));var toCsv=require(_0x228a('0x9'));var querystring=require('querystring');var Papa=require(_0x228a('0x10'));var Redis=require(_0x228a('0x11'));var authService=require(_0x228a('0x12'));var qs=require(_0x228a('0x13'));var as=require(_0x228a('0x14'));var hardwareService=require(_0x228a('0x15'));var logger=require(_0x228a('0x16'))(_0x228a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x228a('0x18'))['db'];config[_0x228a('0x19')]=_[_0x228a('0x1a')](config[_0x228a('0x19')],{'host':_0x228a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x228a('0x19')]));require(_0x228a('0x1c'))[_0x228a('0x1d')](socket);function respondWithStatusCode(_0x53ff6d,_0x515e79){_0x515e79=_0x515e79||0xcc;return function(_0x2956a9){if(_0x2956a9){return _0x53ff6d[_0x228a('0x1e')](_0x515e79);}return _0x53ff6d[_0x228a('0x1f')](_0x515e79)[_0x228a('0x20')]();};}function respondWithResult(_0x262ce9,_0x36f4d1){_0x36f4d1=_0x36f4d1||0xc8;return function(_0xa01bc){if(_0xa01bc){return _0x262ce9[_0x228a('0x1f')](_0x36f4d1)['json'](_0xa01bc);}};}function respondWithFilteredResult(_0x34de98,_0x4adff3){return function(_0x2f71ad){if(_0x2f71ad){var _0x2c764e=typeof _0x4adff3[_0x228a('0x21')]===_0x228a('0x22')&&typeof _0x4adff3['limit']==='undefined';var _0x1334b8=_0x2f71ad[_0x228a('0x23')];var _0x4d12ce=_0x2c764e?0x0:_0x4adff3[_0x228a('0x21')];var _0x233009=_0x2c764e?_0x2f71ad[_0x228a('0x23')]:_0x4adff3[_0x228a('0x21')]+_0x4adff3[_0x228a('0x24')];var _0x2f0f30;if(_0x233009>=_0x1334b8){_0x233009=_0x1334b8;_0x2f0f30=0xc8;}else{_0x2f0f30=0xce;}_0x34de98['status'](_0x2f0f30);return _0x34de98[_0x228a('0x25')]('Content-Range',_0x4d12ce+'-'+_0x233009+'/'+_0x1334b8)[_0x228a('0x26')](_0x2f71ad);}return null;};}function patchUpdates(_0x4837af){return function(_0x1b138f){try{jsonpatch[_0x228a('0x27')](_0x1b138f,_0x4837af,!![]);}catch(_0x3c14ca){return BPromise[_0x228a('0x28')](_0x3c14ca);}return _0x1b138f[_0x228a('0x29')]();};}function saveUpdates(_0x386a66,_0x104c80){return function(_0x334f64){if(_0x334f64){return _0x334f64[_0x228a('0x2a')](_0x386a66)[_0x228a('0x2b')](function(_0x40a2b7){return _0x40a2b7;});}return null;};}function removeEntity(_0x4d3363,_0x58b3d3){return function(_0xda1c4c){if(_0xda1c4c){return _0xda1c4c[_0x228a('0x2c')]()[_0x228a('0x2b')](function(){_0x4d3363['status'](0xcc)[_0x228a('0x20')]();});}};}function handleEntityNotFound(_0x148a62,_0x28e4d6){return function(_0x574820){if(!_0x574820){_0x148a62['sendStatus'](0x194);}return _0x574820;};}function handleError(_0x4d8c9e,_0x31d047){_0x31d047=_0x31d047||0x1f4;return function(_0x196f7){logger['error'](_0x196f7[_0x228a('0x2d')]);if(_0x196f7[_0x228a('0x2e')]){delete _0x196f7['name'];}_0x4d8c9e['status'](_0x31d047)[_0x228a('0x2f')](_0x196f7);};}exports[_0x228a('0x30')]=function(_0x59cc09,_0x4be255){var _0x20cb70={'raw':![],'where':{'id':_0x59cc09[_0x228a('0x31')]['id']}},_0x58eb46={};_0x58eb46[_0x228a('0x32')]=_[_0x228a('0x33')](db[_0x228a('0x34')]['rawAttributes']);_0x58eb46[_0x228a('0x35')]=_[_0x228a('0x33')](_0x59cc09['query']);_0x58eb46[_0x228a('0x36')]=_[_0x228a('0x37')](_0x58eb46[_0x228a('0x32')],_0x58eb46[_0x228a('0x35')]);_0x20cb70[_0x228a('0x38')]=_[_0x228a('0x37')](_0x58eb46[_0x228a('0x32')],qs[_0x228a('0x39')](_0x59cc09[_0x228a('0x35')][_0x228a('0x39')]));_0x20cb70['attributes']=_0x20cb70[_0x228a('0x38')][_0x228a('0x3a')]?_0x20cb70[_0x228a('0x38')]:_0x58eb46['model'];if(_0x59cc09[_0x228a('0x35')][_0x228a('0x3b')]){_0x20cb70[_0x228a('0x3c')]=[{'all':!![]}];}_0x20cb70=_[_0x228a('0x3d')]({},_0x20cb70,_0x59cc09['options']);return db['DashboardItem'][_0x228a('0x3e')](_0x20cb70)[_0x228a('0x2b')](handleEntityNotFound(_0x4be255,null))['then'](respondWithResult(_0x4be255,null))[_0x228a('0x3f')](handleError(_0x4be255,null));};exports['destroy']=function(_0x28f350,_0x11762b){return db[_0x228a('0x34')]['find']({'where':{'id':_0x28f350[_0x228a('0x31')]['id']}})[_0x228a('0x2b')](handleEntityNotFound(_0x11762b,null))[_0x228a('0x2b')](removeEntity(_0x11762b,null))['catch'](handleError(_0x11762b,null));};function widgetAttributes(_0x67e498){try{switch(_0x67e498[_0x228a('0x40')]){case _0x228a('0x41'):return[{'name':_0x228a('0x42'),'value':_0x67e498[_0x228a('0x42')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498['attrs'][0x0]?_0x67e498['attrs'][0x0]['value']:undefined)||'https://'}];case _0x228a('0x44'):return[{'name':_0x228a('0x45'),'value':_0x67e498[_0x228a('0x45')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x0]?_0x67e498['attrs'][0x0]['value']:undefined)||''}];case _0x228a('0x46'):return[{'name':'attrHourFormat','value':_0x67e498['attrHourFormat']||(_0x67e498[_0x228a('0x43')]&&_0x67e498['attrs'][0x0]?_0x67e498[_0x228a('0x43')][0x0][_0x228a('0x47')]:undefined)||_0x228a('0x48')},{'name':_0x228a('0x49'),'value':_0x67e498[_0x228a('0x49')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x1]?_0x67e498[_0x228a('0x43')][0x1][_0x228a('0x47')]:undefined)||_0x228a('0x4a')},{'name':_0x228a('0x4b'),'value':_0x67e498[_0x228a('0x4b')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x2]?_0x67e498['attrs'][0x2]['value']:undefined)||0xc}];case _0x228a('0x4c'):return[{'name':_0x228a('0x4d'),'value':_0x67e498[_0x228a('0x4d')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x0]?_0x67e498[_0x228a('0x43')][0x0][_0x228a('0x47')]:undefined)||_0x228a('0x4e')},{'name':'attrVoiceQueues','value':_0x67e498[_0x228a('0x4f')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x1]?_0x67e498[_0x228a('0x43')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x67e498['attrFontSize']||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x2]?_0x67e498[_0x228a('0x43')][0x2][_0x228a('0x47')]:undefined)||0x14}];case _0x228a('0x50'):case _0x228a('0x51'):return[{'name':_0x228a('0x52'),'value':_0x67e498[_0x228a('0x52')]||(_0x67e498['attrs']&&_0x67e498['attrs'][0x0]?_0x67e498['attrs'][0x0][_0x228a('0x47')]:undefined)||_0x228a('0x4e')},{'name':_0x228a('0x53'),'value':_0x67e498[_0x228a('0x53')]||(_0x67e498['attrs']&&_0x67e498[_0x228a('0x43')][0x1]?_0x67e498[_0x228a('0x43')][0x1][_0x228a('0x47')]:undefined)||null},{'name':'attrSerie3','value':_0x67e498[_0x228a('0x54')]||(_0x67e498['attrs']&&_0x67e498[_0x228a('0x43')][0x2]?_0x67e498[_0x228a('0x43')][0x2][_0x228a('0x47')]:undefined)||null},{'name':_0x228a('0x4f'),'value':_0x67e498['attrVoiceQueues']||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x3]?_0x67e498[_0x228a('0x43')][0x3]['value']:undefined)||[]}];case _0x228a('0x55'):return[{'name':_0x228a('0x56'),'type':_0x67e498[_0x228a('0x57')]||(_0x67e498[_0x228a('0x43')]&&_0x67e498[_0x228a('0x43')][0x0]?_0x67e498['attrs'][0x0]['type']:undefined)||null,'value':_0x67e498[_0x228a('0x56')]||(_0x67e498['attrs']&&_0x67e498[_0x228a('0x43')][0x0]?_0x67e498['attrs'][0x0][_0x228a('0x47')]:undefined)||null},{'name':_0x228a('0x58'),'value':_0x67e498['attrRefresh']||(_0x67e498['attrs']&&_0x67e498[_0x228a('0x43')][0x1]?_0x67e498[_0x228a('0x43')][0x1][_0x228a('0x47')]:undefined)||0x0}];default:return[];}}catch(_0x5606f6){logger['error'](_0x228a('0x59'),JSON[_0x228a('0x5a')](_0x5606f6));return[];}}exports[_0x228a('0x5b')]=function(_0x40e3c9,_0x346989){if(_0x40e3c9['body']){_0x40e3c9[_0x228a('0x5c')][_0x228a('0x43')]=widgetAttributes(_0x40e3c9[_0x228a('0x5c')]);}return db['DashboardItem']['create'](_0x40e3c9[_0x228a('0x5c')],{})[_0x228a('0x2b')](respondWithResult(_0x346989,0xc9))[_0x228a('0x3f')](handleError(_0x346989,null));};exports[_0x228a('0x2a')]=function(_0x341249,_0x1ecbfd){if(_0x341249['body']['id']){delete _0x341249[_0x228a('0x5c')]['id'];}_0x341249['body']['attrs']=widgetAttributes(_0x341249[_0x228a('0x5c')]);return db[_0x228a('0x34')][_0x228a('0x3e')]({'where':{'id':_0x341249['params']['id']}})[_0x228a('0x2b')](handleEntityNotFound(_0x1ecbfd,null))[_0x228a('0x2b')](saveUpdates(_0x341249['body'],null))[_0x228a('0x2b')](respondWithResult(_0x1ecbfd,null))[_0x228a('0x3f')](handleError(_0x1ecbfd,null));};
\ No newline at end of file
+var _0x68b5=['attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','params','DashboardItem','query','filters','intersection','model','attributes','fields','include','find','catch','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','HH:mm:ss'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x68b5,0xc0));var _0x568b=function(_0x310d94,_0x27b519){_0x310d94=_0x310d94-0x0;var _0x377dc9=_0x68b5[_0x310d94];return _0x377dc9;};'use strict';var emlformat=require(_0x568b('0x0'));var rimraf=require(_0x568b('0x1'));var zipdir=require(_0x568b('0x2'));var jsonpatch=require(_0x568b('0x3'));var rp=require('request-promise');var moment=require(_0x568b('0x4'));var BPromise=require(_0x568b('0x5'));var Mustache=require(_0x568b('0x6'));var util=require(_0x568b('0x7'));var path=require('path');var sox=require(_0x568b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x568b('0x9'));var _=require(_0x568b('0xa'));var squel=require(_0x568b('0xb'));var crypto=require(_0x568b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x568b('0xd'));var toCsv=require(_0x568b('0xe'));var querystring=require(_0x568b('0xf'));var Papa=require(_0x568b('0x10'));var Redis=require(_0x568b('0x11'));var authService=require(_0x568b('0x12'));var qs=require(_0x568b('0x13'));var as=require(_0x568b('0x14'));var hardwareService=require(_0x568b('0x15'));var logger=require(_0x568b('0x16'))(_0x568b('0x17'));var utils=require('../../config/utils');var config=require(_0x568b('0x18'));var licenseUtil=require(_0x568b('0x19'));var db=require('../../mysqldb')['db'];config[_0x568b('0x1a')]=_[_0x568b('0x1b')](config[_0x568b('0x1a')],{'host':_0x568b('0x1c'),'port':0x18eb});var socket=require(_0x568b('0x1d'))(new Redis(config['redis']));require(_0x568b('0x1e'))[_0x568b('0x1f')](socket);function respondWithStatusCode(_0x2afded,_0xeed54b){_0xeed54b=_0xeed54b||0xcc;return function(_0x32ed80){if(_0x32ed80){return _0x2afded[_0x568b('0x20')](_0xeed54b);}return _0x2afded[_0x568b('0x21')](_0xeed54b)[_0x568b('0x22')]();};}function respondWithResult(_0x4074c1,_0x46e1a0){_0x46e1a0=_0x46e1a0||0xc8;return function(_0x5dd238){if(_0x5dd238){return _0x4074c1[_0x568b('0x21')](_0x46e1a0)[_0x568b('0x23')](_0x5dd238);}};}function respondWithFilteredResult(_0x73c855,_0x1716df){return function(_0x487d57){if(_0x487d57){var _0x2591ab=typeof _0x1716df['offset']===_0x568b('0x24')&&typeof _0x1716df[_0x568b('0x25')]===_0x568b('0x24');var _0x19e6a4=_0x487d57[_0x568b('0x26')];var _0x3d5098=_0x2591ab?0x0:_0x1716df['offset'];var _0x2a6d77=_0x2591ab?_0x487d57[_0x568b('0x26')]:_0x1716df[_0x568b('0x27')]+_0x1716df[_0x568b('0x25')];var _0x11e770;if(_0x2a6d77>=_0x19e6a4){_0x2a6d77=_0x19e6a4;_0x11e770=0xc8;}else{_0x11e770=0xce;}_0x73c855['status'](_0x11e770);return _0x73c855[_0x568b('0x28')](_0x568b('0x29'),_0x3d5098+'-'+_0x2a6d77+'/'+_0x19e6a4)[_0x568b('0x23')](_0x487d57);}return null;};}function patchUpdates(_0x5512c7){return function(_0x1440d0){try{jsonpatch[_0x568b('0x2a')](_0x1440d0,_0x5512c7,!![]);}catch(_0x436b59){return BPromise[_0x568b('0x2b')](_0x436b59);}return _0x1440d0[_0x568b('0x2c')]();};}function saveUpdates(_0x137570,_0x3523ed){return function(_0x3e448b){if(_0x3e448b){return _0x3e448b['update'](_0x137570)[_0x568b('0x2d')](function(_0x189027){return _0x189027;});}return null;};}function removeEntity(_0x16ead0,_0x4cc526){return function(_0x38fefa){if(_0x38fefa){return _0x38fefa[_0x568b('0x2e')]()[_0x568b('0x2d')](function(){_0x16ead0['status'](0xcc)[_0x568b('0x22')]();});}};}function handleEntityNotFound(_0x38c934,_0x9640e7){return function(_0x3d4a44){if(!_0x3d4a44){_0x38c934[_0x568b('0x20')](0x194);}return _0x3d4a44;};}function handleError(_0x413459,_0x12267e){_0x12267e=_0x12267e||0x1f4;return function(_0x1a6b76){logger[_0x568b('0x2f')](_0x1a6b76['stack']);if(_0x1a6b76[_0x568b('0x30')]){delete _0x1a6b76[_0x568b('0x30')];}_0x413459['status'](_0x12267e)[_0x568b('0x31')](_0x1a6b76);};}exports['show']=function(_0x1e1c92,_0x29389f){var _0x1650e7={'raw':![],'where':{'id':_0x1e1c92[_0x568b('0x32')]['id']}},_0x51c2de={};_0x51c2de['model']=_['keys'](db[_0x568b('0x33')]['rawAttributes']);_0x51c2de['query']=_['keys'](_0x1e1c92[_0x568b('0x34')]);_0x51c2de[_0x568b('0x35')]=_[_0x568b('0x36')](_0x51c2de[_0x568b('0x37')],_0x51c2de[_0x568b('0x34')]);_0x1650e7[_0x568b('0x38')]=_[_0x568b('0x36')](_0x51c2de[_0x568b('0x37')],qs[_0x568b('0x39')](_0x1e1c92[_0x568b('0x34')][_0x568b('0x39')]));_0x1650e7['attributes']=_0x1650e7['attributes']['length']?_0x1650e7[_0x568b('0x38')]:_0x51c2de['model'];if(_0x1e1c92['query']['includeAll']){_0x1650e7[_0x568b('0x3a')]=[{'all':!![]}];}_0x1650e7=_['merge']({},_0x1650e7,_0x1e1c92['options']);return db[_0x568b('0x33')][_0x568b('0x3b')](_0x1650e7)[_0x568b('0x2d')](handleEntityNotFound(_0x29389f,null))['then'](respondWithResult(_0x29389f,null))[_0x568b('0x3c')](handleError(_0x29389f,null));};exports['destroy']=function(_0x361b54,_0x598559){return db[_0x568b('0x33')]['find']({'where':{'id':_0x361b54[_0x568b('0x32')]['id']}})[_0x568b('0x2d')](handleEntityNotFound(_0x598559,null))[_0x568b('0x2d')](removeEntity(_0x598559,null))[_0x568b('0x3c')](handleError(_0x598559,null));};function widgetAttributes(_0x53927c){try{switch(_0x53927c['type']){case'iframe':return[{'name':'attrUrl','value':_0x53927c[_0x568b('0x3d')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0]['value']:undefined)||_0x568b('0x3f')}];case _0x568b('0x40'):return[{'name':_0x568b('0x41'),'value':_0x53927c[_0x568b('0x41')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||''}];case'clock':return[{'name':_0x568b('0x43'),'value':_0x53927c['attrHourFormat']||(_0x53927c[_0x568b('0x3e')]&&_0x53927c['attrs'][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||_0x568b('0x44')},{'name':_0x568b('0x45'),'value':_0x53927c[_0x568b('0x45')]||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x1]?_0x53927c[_0x568b('0x3e')][0x1][_0x568b('0x42')]:undefined)||'0.00'},{'name':_0x568b('0x46'),'value':_0x53927c['attrFontSize']||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x2]?_0x53927c['attrs'][0x2][_0x568b('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x568b('0x47'),'value':_0x53927c[_0x568b('0x47')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||_0x568b('0x48')},{'name':'attrVoiceQueues','value':_0x53927c[_0x568b('0x49')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x1]?_0x53927c['attrs'][0x1][_0x568b('0x42')]:undefined)||[]},{'name':_0x568b('0x46'),'value':_0x53927c['attrFontSize']||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x2]?_0x53927c['attrs'][0x2]['value']:undefined)||0x14}];case _0x568b('0x4a'):case _0x568b('0x4b'):return[{'name':_0x568b('0x4c'),'value':_0x53927c[_0x568b('0x4c')]||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c['attrs'][0x0][_0x568b('0x42')]:undefined)||_0x568b('0x48')},{'name':_0x568b('0x4d'),'value':_0x53927c[_0x568b('0x4d')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c['attrs'][0x1]?_0x53927c['attrs'][0x1]['value']:undefined)||null},{'name':_0x568b('0x4e'),'value':_0x53927c['attrSerie3']||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x2]?_0x53927c['attrs'][0x2][_0x568b('0x42')]:undefined)||null},{'name':_0x568b('0x49'),'value':_0x53927c[_0x568b('0x49')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x3]?_0x53927c[_0x568b('0x3e')][0x3][_0x568b('0x42')]:undefined)||[]}];case'web-report':return[{'name':_0x568b('0x4f'),'type':_0x53927c[_0x568b('0x50')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c['attrs'][0x0]['type']:undefined)||null,'value':_0x53927c[_0x568b('0x4f')]||(_0x53927c['attrs']&&_0x53927c[_0x568b('0x3e')][0x0]?_0x53927c[_0x568b('0x3e')][0x0][_0x568b('0x42')]:undefined)||null},{'name':_0x568b('0x51'),'value':_0x53927c[_0x568b('0x51')]||(_0x53927c[_0x568b('0x3e')]&&_0x53927c[_0x568b('0x3e')][0x1]?_0x53927c['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1627ba){logger[_0x568b('0x2f')](_0x568b('0x52'),JSON[_0x568b('0x53')](_0x1627ba));return[];}}exports[_0x568b('0x54')]=function(_0x51b8d6,_0x54e8ce){if(_0x51b8d6[_0x568b('0x55')]){_0x51b8d6['body']['attrs']=widgetAttributes(_0x51b8d6[_0x568b('0x55')]);}return db[_0x568b('0x33')]['create'](_0x51b8d6['body'],{})['then'](respondWithResult(_0x54e8ce,0xc9))[_0x568b('0x3c')](handleError(_0x54e8ce,null));};exports[_0x568b('0x56')]=function(_0x22aa49,_0x38f38f){if(_0x22aa49[_0x568b('0x55')]['id']){delete _0x22aa49['body']['id'];}_0x22aa49[_0x568b('0x55')][_0x568b('0x3e')]=widgetAttributes(_0x22aa49[_0x568b('0x55')]);return db[_0x568b('0x33')][_0x568b('0x3b')]({'where':{'id':_0x22aa49[_0x568b('0x32')]['id']}})[_0x568b('0x2d')](handleEntityNotFound(_0x38f38f,null))[_0x568b('0x2d')](saveUpdates(_0x22aa49['body'],null))[_0x568b('0x2d')](respondWithResult(_0x38f38f,null))['catch'](handleError(_0x38f38f,null));};
\ No newline at end of file
index c88373c..2c7e275 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3719=['exports','events','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x17fcf0,_0x157a9e){var _0x4ad145=function(_0x3e5d68){while(--_0x3e5d68){_0x17fcf0['push'](_0x17fcf0['shift']());}};_0x4ad145(++_0x157a9e);}(_0x3719,0x123));var _0x9371=function(_0x4d50c1,_0x55f7fc){_0x4d50c1=_0x4d50c1-0x0;var _0x432008=_0x3719[_0x4d50c1];return _0x432008;};'use strict';var EventEmitter=require(_0x9371('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x9371('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9371('0x2')](0x0);var events={'afterCreate':_0x9371('0x3'),'afterUpdate':_0x9371('0x4'),'afterDestroy':_0x9371('0x5')};function emitEvent(_0x48bd20){return function(_0xfdc271,_0x6d2129,_0xa604ad){DashboardItemEvents[_0x9371('0x6')](_0x48bd20+':'+_0xfdc271['id'],_0xfdc271);DashboardItemEvents[_0x9371('0x6')](_0x48bd20,_0xfdc271);_0xa604ad(null);};}for(var e in events){if(events[_0x9371('0x7')](e)){var event=events[e];DashboardItem[_0x9371('0x8')](e,emitEvent(event));}}module[_0x9371('0x9')]=DashboardItemEvents;
\ No newline at end of file
+var _0x7276=['../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x256cc1,_0x568424){var _0x330d0a=function(_0x4c8cc1){while(--_0x4c8cc1){_0x256cc1['push'](_0x256cc1['shift']());}};_0x330d0a(++_0x568424);}(_0x7276,0xfb));var _0x6727=function(_0x404227,_0x5bcf4c){_0x404227=_0x404227-0x0;var _0x220eef=_0x7276[_0x404227];return _0x220eef;};'use strict';var EventEmitter=require(_0x6727('0x0'));var DashboardItem=require(_0x6727('0x1'))['db'][_0x6727('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6727('0x3')](0x0);var events={'afterCreate':_0x6727('0x4'),'afterUpdate':_0x6727('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2603b2){return function(_0x31b091,_0x2b6af0,_0x1b26ad){DashboardItemEvents[_0x6727('0x6')](_0x2603b2+':'+_0x31b091['id'],_0x31b091);DashboardItemEvents['emit'](_0x2603b2,_0x31b091);_0x1b26ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x6727('0x7')](e,emitEvent(event));}}module[_0x6727('0x8')]=DashboardItemEvents;
\ No newline at end of file
index 0e5e602..e394772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x212b=['api','moment','bluebird','path','rimraf','../../config/environment','exports','DashboardItem','dashboard_items','lodash','../../config/logger'];(function(_0x436017,_0x47c412){var _0x50ed01=function(_0x1dd020){while(--_0x1dd020){_0x436017['push'](_0x436017['shift']());}};_0x50ed01(++_0x47c412);}(_0x212b,0x148));var _0xb212=function(_0x289a5b,_0x5a5af8){_0x289a5b=_0x289a5b-0x0;var _0x564b95=_0x212b[_0x289a5b];return _0x564b95;};'use strict';var _=require(_0xb212('0x0'));var util=require('util');var logger=require(_0xb212('0x1'))(_0xb212('0x2'));var moment=require(_0xb212('0x3'));var BPromise=require(_0xb212('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb212('0x5'));var rimraf=require(_0xb212('0x6'));var config=require(_0xb212('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xb212('0x8')]=function(_0x49a13c,_0x21825a){return _0x49a13c['define'](_0xb212('0x9'),attributes,{'tableName':_0xb212('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9aee=['path','rimraf','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37ea31,_0xb5b1e1){var _0x11759d=function(_0x559982){while(--_0x559982){_0x37ea31['push'](_0x37ea31['shift']());}};_0x11759d(++_0xb5b1e1);}(_0x9aee,0x71));var _0xe9ae=function(_0x1d0946,_0x3732fc){_0x1d0946=_0x1d0946-0x0;var _0x205df=_0x9aee[_0x1d0946];return _0x205df;};'use strict';var _=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var logger=require(_0xe9ae('0x2'))(_0xe9ae('0x3'));var moment=require(_0xe9ae('0x4'));var BPromise=require(_0xe9ae('0x5'));var rp=require(_0xe9ae('0x6'));var fs=require('fs');var path=require(_0xe9ae('0x7'));var rimraf=require(_0xe9ae('0x8'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0xf3aa52,_0x4e889d){return _0xf3aa52['define'](_0xe9ae('0x9'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 287566f..a1526d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31d8=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','socket.io-emitter','redis','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x31d8,0x17c));var _0x831d=function(_0x1e3527,_0x58a50f){_0x1e3527=_0x1e3527-0x0;var _0x245036=_0x31d8[_0x1e3527];return _0x245036;};'use strict';var _=require('lodash');var util=require(_0x831d('0x0'));var moment=require(_0x831d('0x1'));var BPromise=require(_0x831d('0x2'));var rs=require(_0x831d('0x3'));var fs=require('fs');var Redis=require(_0x831d('0x4'));var db=require(_0x831d('0x5'))['db'];var utils=require(_0x831d('0x6'));var logger=require(_0x831d('0x7'))(_0x831d('0x8'));var config=require(_0x831d('0x9'));var jayson=require(_0x831d('0xa'));var client=jayson[_0x831d('0xb')][_0x831d('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x831d('0xd'))(new Redis(config[_0x831d('0xe')]));require(_0x831d('0xf'))['register'](socket);function respondWithRpcPromise(_0x36471b,_0x4e7ce9,_0x396362){return new BPromise(function(_0x16f302,_0x4ec9a5){return client[_0x831d('0x10')](_0x36471b,_0x396362)[_0x831d('0x11')](function(_0x5cfaf6){logger[_0x831d('0x12')](_0x831d('0x13'),_0x4e7ce9,'request\x20sent');logger['debug'](_0x831d('0x14'),_0x4e7ce9,_0x831d('0x15'),JSON[_0x831d('0x16')](_0x5cfaf6));if(_0x5cfaf6['error']){if(_0x5cfaf6['error']['code']===0x1f4){logger[_0x831d('0x17')](_0x831d('0x13'),_0x4e7ce9,_0x5cfaf6['error']['message']);return _0x4ec9a5(_0x5cfaf6[_0x831d('0x17')]['message']);}logger[_0x831d('0x17')](_0x831d('0x13'),_0x4e7ce9,_0x5cfaf6['error'][_0x831d('0x18')]);return _0x16f302(_0x5cfaf6[_0x831d('0x17')][_0x831d('0x18')]);}else{logger[_0x831d('0x12')](_0x831d('0x13'),_0x4e7ce9,_0x831d('0x15'));_0x16f302(_0x5cfaf6[_0x831d('0x19')]['message']);}})[_0x831d('0x1a')](function(_0xb92efd){logger[_0x831d('0x17')](_0x831d('0x13'),_0x4e7ce9,_0xb92efd);_0x4ec9a5(_0xb92efd);});});}
\ No newline at end of file
+var _0x986c=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30f07a,_0x98341){var _0xb38461=function(_0x7b287a){while(--_0x7b287a){_0x30f07a['push'](_0x30f07a['shift']());}};_0xb38461(++_0x98341);}(_0x986c,0xbd));var _0xc986=function(_0x170664,_0x2c94ed){_0x170664=_0x170664-0x0;var _0x45b096=_0x986c[_0x170664];return _0x45b096;};'use strict';var _=require(_0xc986('0x0'));var util=require('util');var moment=require(_0xc986('0x1'));var BPromise=require(_0xc986('0x2'));var rs=require(_0xc986('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc986('0x4'));var logger=require(_0xc986('0x5'))(_0xc986('0x6'));var config=require(_0xc986('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc986('0x8')][_0xc986('0x9')]({'port':0x232a});config[_0xc986('0xa')]=_[_0xc986('0xb')](config[_0xc986('0xa')],{'host':_0xc986('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc986('0xa')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x2d7be4,_0x4be94e,_0x2ddcb0){return new BPromise(function(_0x33f1c3,_0x1b1567){return client[_0xc986('0xd')](_0x2d7be4,_0x2ddcb0)[_0xc986('0xe')](function(_0x4ae267){logger[_0xc986('0xf')](_0xc986('0x10'),_0x4be94e,_0xc986('0x11'));logger[_0xc986('0x12')](_0xc986('0x13'),_0x4be94e,_0xc986('0x11'),JSON[_0xc986('0x14')](_0x4ae267));if(_0x4ae267[_0xc986('0x15')]){if(_0x4ae267[_0xc986('0x15')][_0xc986('0x16')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x4be94e,_0x4ae267[_0xc986('0x15')][_0xc986('0x17')]);return _0x1b1567(_0x4ae267['error'][_0xc986('0x17')]);}logger['error'](_0xc986('0x10'),_0x4be94e,_0x4ae267[_0xc986('0x15')][_0xc986('0x17')]);return _0x33f1c3(_0x4ae267[_0xc986('0x15')][_0xc986('0x17')]);}else{logger[_0xc986('0xf')](_0xc986('0x10'),_0x4be94e,_0xc986('0x11'));_0x33f1c3(_0x4ae267[_0xc986('0x18')][_0xc986('0x17')]);}})[_0xc986('0x19')](function(_0x5e6fb5){logger[_0xc986('0x15')](_0xc986('0x10'),_0x4be94e,_0x5e6fb5);_0x1b1567(_0x5e6fb5);});});}
\ No newline at end of file
index 7040a17..74f42f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd3e=['save','update','emit','removeListener','length','dashboardItem:'];(function(_0x16b52a,_0x2e6470){var _0x1c760f=function(_0x21cc4c){while(--_0x21cc4c){_0x16b52a['push'](_0x16b52a['shift']());}};_0x1c760f(++_0x2e6470);}(_0xdd3e,0x16e));var _0xedd3=function(_0x1b2b3e,_0x389074){_0x1b2b3e=_0x1b2b3e-0x0;var _0x11daa8=_0xdd3e[_0x1b2b3e];return _0x11daa8;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xedd3('0x0'),'remove',_0xedd3('0x1')];function createListener(_0x5603dc,_0x1460ba){return function(_0xca5cae){_0x1460ba[_0xedd3('0x2')](_0x5603dc,_0xca5cae);};}function removeListener(_0x3a118a,_0x5b1284){return function(){DashboardItemEvents[_0xedd3('0x3')](_0x3a118a,_0x5b1284);};}exports['register']=function(_0x280fe3){for(var _0x5c16e8=0x0,_0x287aa7=events[_0xedd3('0x4')];_0x5c16e8<_0x287aa7;_0x5c16e8++){var _0xb05e30=events[_0x5c16e8];var _0x2c989f=createListener(_0xedd3('0x5')+_0xb05e30,_0x280fe3);DashboardItemEvents['on'](_0xb05e30,_0x2c989f);}};
\ No newline at end of file
+var _0xd039=['dashboardItem:','./dashboardItem.events','save','emit','removeListener','register','length'];(function(_0x5d48da,_0x594257){var _0x15e846=function(_0x10defc){while(--_0x10defc){_0x5d48da['push'](_0x5d48da['shift']());}};_0x15e846(++_0x594257);}(_0xd039,0xef));var _0x9d03=function(_0x4bff30,_0x5d8caa){_0x4bff30=_0x4bff30-0x0;var _0x112bcf=_0xd039[_0x4bff30];return _0x112bcf;};'use strict';var DashboardItemEvents=require(_0x9d03('0x0'));var events=[_0x9d03('0x1'),'remove','update'];function createListener(_0x2ed894,_0xd68f7e){return function(_0x223759){_0xd68f7e[_0x9d03('0x2')](_0x2ed894,_0x223759);};}function removeListener(_0x2596b2,_0x59e0b5){return function(){DashboardItemEvents[_0x9d03('0x3')](_0x2596b2,_0x59e0b5);};}exports[_0x9d03('0x4')]=function(_0x12148d){for(var _0x4110d5=0x0,_0x2e8f98=events[_0x9d03('0x5')];_0x4110d5<_0x2e8f98;_0x4110d5++){var _0x3af2f9=events[_0x4110d5];var _0x46687b=createListener(_0x9d03('0x6')+_0x3af2f9,_0x12148d);DashboardItemEvents['on'](_0x3af2f9,_0x46687b);}};
\ No newline at end of file
index f3d874d..decc663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff6a=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','delete'];(function(_0x538aa4,_0x4f247f){var _0x510113=function(_0x20e971){while(--_0x20e971){_0x538aa4['push'](_0x538aa4['shift']());}};_0x510113(++_0x4f247f);}(_0xff6a,0x1b2));var _0xaff6=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xff6a[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xaff6('0x0'));var util=require(_0xaff6('0x1'));var path=require(_0xaff6('0x2'));var timeout=require(_0xaff6('0x3'));var express=require(_0xaff6('0x4'));var router=express[_0xaff6('0x5')]();var fs_extra=require(_0xaff6('0x6'));var auth=require(_0xaff6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaff6('0x8'));var controller=require(_0xaff6('0x9'));router[_0xaff6('0xa')](_0xaff6('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xaff6('0xc')](),controller[_0xaff6('0xd')]);router[_0xaff6('0xe')](_0xaff6('0xb'),auth[_0xaff6('0xc')](),controller['update']);router[_0xaff6('0xf')]('/:id',auth[_0xaff6('0xc')](),controller[_0xaff6('0x10')]);module[_0xaff6('0x11')]=router;
\ No newline at end of file
+var _0xdd95=['post','create','/:id','update','delete','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xdd95,0x66));var _0x5dd9=function(_0x154b4c,_0xa38e2){_0x154b4c=_0x154b4c-0x0;var _0x100586=_0xdd95[_0x154b4c];return _0x100586;};'use strict';var multer=require(_0x5dd9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dd9('0x1'));var router=express[_0x5dd9('0x2')]();var fs_extra=require(_0x5dd9('0x3'));var auth=require(_0x5dd9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5dd9('0x5'));var controller=require(_0x5dd9('0x6'));router[_0x5dd9('0x7')]('/:id',auth[_0x5dd9('0x8')](),controller[_0x5dd9('0x9')]);router[_0x5dd9('0xa')]('/',auth[_0x5dd9('0x8')](),controller[_0x5dd9('0xb')]);router['put'](_0x5dd9('0xc'),auth[_0x5dd9('0x8')](),controller[_0x5dd9('0xd')]);router[_0x5dd9('0xe')](_0x5dd9('0xc'),auth[_0x5dd9('0x8')](),controller[_0x5dd9('0xf')]);module['exports']=router;
\ No newline at end of file
index e808937..eef2582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ab=['first','second','third','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x57ab,0xf9));var _0xb57a=function(_0x4858bc,_0x176641){_0x4858bc=_0x4858bc-0x0;var _0x5f2e11=_0x57ab[_0x4858bc];return _0x5f2e11;};'use strict';var Sequelize=require(_0xb57a('0x0'));module[_0xb57a('0x1')]={'name':{'type':Sequelize[_0xb57a('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb57a('0x3'),_0xb57a('0x4'),_0xb57a('0x5')),'allowNull':![],'defaultValue':_0xb57a('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc783=['ENUM','second','sequelize','exports'];(function(_0x5ce1c1,_0x57c9b0){var _0x229af0=function(_0x5da1e2){while(--_0x5da1e2){_0x5ce1c1['push'](_0x5ce1c1['shift']());}};_0x229af0(++_0x57c9b0);}(_0xc783,0xf6));var _0x3c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc783[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3c78('0x0'));module[_0x3c78('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x3c78('0x2')]('first',_0x3c78('0x3'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b79a04b..119d274 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f24=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Dispositions','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','create'];(function(_0x27e2bc,_0x1f5bb1){var _0x303eed=function(_0x5f48c8){while(--_0x5f48c8){_0x27e2bc['push'](_0x27e2bc['shift']());}};_0x303eed(++_0x1f5bb1);}(_0x0f24,0x16d));var _0x40f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f24[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x40f2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x40f2('0x1'));var jsonpatch=require(_0x40f2('0x2'));var rp=require(_0x40f2('0x3'));var moment=require(_0x40f2('0x4'));var BPromise=require(_0x40f2('0x5'));var Mustache=require(_0x40f2('0x6'));var util=require(_0x40f2('0x7'));var path=require(_0x40f2('0x8'));var sox=require(_0x40f2('0x9'));var csv=require(_0x40f2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40f2('0xb'));var _=require(_0x40f2('0xc'));var squel=require(_0x40f2('0xd'));var crypto=require('crypto');var jsforce=require(_0x40f2('0xe'));var deskjs=require(_0x40f2('0xf'));var toCsv=require(_0x40f2('0xa'));var querystring=require(_0x40f2('0x10'));var Papa=require('papaparse');var Redis=require(_0x40f2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x40f2('0x12'));var as=require(_0x40f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x40f2('0x14'))(_0x40f2('0x15'));var utils=require(_0x40f2('0x16'));var config=require(_0x40f2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x40f2('0x18'))['db'];function respondWithStatusCode(_0x3d5aae,_0x56ecb1){_0x56ecb1=_0x56ecb1||0xcc;return function(_0x523960){if(_0x523960){return _0x3d5aae[_0x40f2('0x19')](_0x56ecb1);}return _0x3d5aae['status'](_0x56ecb1)['end']();};}function respondWithResult(_0x3e8b08,_0x486b1c){_0x486b1c=_0x486b1c||0xc8;return function(_0x539d6b){if(_0x539d6b){return _0x3e8b08[_0x40f2('0x1a')](_0x486b1c)[_0x40f2('0x1b')](_0x539d6b);}};}function respondWithFilteredResult(_0x3e01ff,_0x178c8b){return function(_0x201dbf){if(_0x201dbf){var _0x17ae84=typeof _0x178c8b['offset']===_0x40f2('0x1c')&&typeof _0x178c8b[_0x40f2('0x1d')]==='undefined';var _0x45262e=_0x201dbf[_0x40f2('0x1e')];var _0x28ac32=_0x17ae84?0x0:_0x178c8b[_0x40f2('0x1f')];var _0x4a7867=_0x17ae84?_0x201dbf[_0x40f2('0x1e')]:_0x178c8b['offset']+_0x178c8b[_0x40f2('0x1d')];var _0x4de888;if(_0x4a7867>=_0x45262e){_0x4a7867=_0x45262e;_0x4de888=0xc8;}else{_0x4de888=0xce;}_0x3e01ff[_0x40f2('0x1a')](_0x4de888);return _0x3e01ff[_0x40f2('0x20')](_0x40f2('0x21'),_0x28ac32+'-'+_0x4a7867+'/'+_0x45262e)[_0x40f2('0x1b')](_0x201dbf);}return null;};}function patchUpdates(_0x40a84f){return function(_0x504840){try{jsonpatch[_0x40f2('0x22')](_0x504840,_0x40a84f,!![]);}catch(_0x37ceb5){return BPromise[_0x40f2('0x23')](_0x37ceb5);}return _0x504840[_0x40f2('0x24')]();};}function saveUpdates(_0x4c0f25,_0xca9efa){return function(_0x1e106a){if(_0x1e106a){return _0x1e106a[_0x40f2('0x25')](_0x4c0f25)[_0x40f2('0x26')](function(_0x36b94a){return _0x36b94a;});}return null;};}function removeEntity(_0x33d279,_0x168f1c){return function(_0x5a3af9){if(_0x5a3af9){return _0x5a3af9['destroy']()[_0x40f2('0x26')](function(){var _0x358b5f=_0x5a3af9['get']({'plain':!![]});var _0xc7900d='Dispositions';return db[_0x40f2('0x27')][_0x40f2('0x28')]({'where':{'type':_0xc7900d,'resourceId':_0x358b5f['id']}})[_0x40f2('0x26')](function(){return _0x5a3af9;});})['then'](function(){_0x33d279[_0x40f2('0x1a')](0xcc)[_0x40f2('0x29')]();});}};}function handleEntityNotFound(_0x552e40,_0x70b9d1){return function(_0xd51166){if(!_0xd51166){_0x552e40[_0x40f2('0x19')](0x194);}return _0xd51166;};}function handleError(_0x3f6624,_0x1ca15a){_0x1ca15a=_0x1ca15a||0x1f4;return function(_0x20857b){logger[_0x40f2('0x2a')](_0x20857b[_0x40f2('0x2b')]);if(_0x20857b[_0x40f2('0x2c')]){delete _0x20857b[_0x40f2('0x2c')];}_0x3f6624[_0x40f2('0x1a')](_0x1ca15a)[_0x40f2('0x2d')](_0x20857b);};}exports[_0x40f2('0x2e')]=function(_0x1c657b,_0x5985de){var _0x3ec80f={},_0xb329de={},_0x166093={'count':0x0,'rows':[]};var _0x2b6847=_[_0x40f2('0x2f')](db[_0x40f2('0x30')][_0x40f2('0x31')],function(_0x3ff479){return{'name':_0x3ff479[_0x40f2('0x32')],'type':_0x3ff479['type'][_0x40f2('0x33')]};});_0xb329de[_0x40f2('0x34')]=_[_0x40f2('0x2f')](_0x2b6847,_0x40f2('0x2c'));_0xb329de[_0x40f2('0x35')]=_['keys'](_0x1c657b[_0x40f2('0x35')]);_0xb329de['filters']=_['intersection'](_0xb329de[_0x40f2('0x34')],_0xb329de[_0x40f2('0x35')]);_0x3ec80f[_0x40f2('0x36')]=_['intersection'](_0xb329de[_0x40f2('0x34')],qs[_0x40f2('0x37')](_0x1c657b[_0x40f2('0x35')]['fields']));_0x3ec80f[_0x40f2('0x36')]=_0x3ec80f[_0x40f2('0x36')][_0x40f2('0x38')]?_0x3ec80f[_0x40f2('0x36')]:_0xb329de[_0x40f2('0x34')];if(!_0x1c657b[_0x40f2('0x35')][_0x40f2('0x39')](_0x40f2('0x3a'))){_0x3ec80f[_0x40f2('0x1d')]=qs[_0x40f2('0x1d')](_0x1c657b['query'][_0x40f2('0x1d')]);_0x3ec80f[_0x40f2('0x1f')]=qs[_0x40f2('0x1f')](_0x1c657b[_0x40f2('0x35')][_0x40f2('0x1f')]);}_0x3ec80f[_0x40f2('0x3b')]=qs[_0x40f2('0x3c')](_0x1c657b[_0x40f2('0x35')][_0x40f2('0x3c')]);_0x3ec80f[_0x40f2('0x3d')]=qs[_0x40f2('0x3e')](_[_0x40f2('0x3f')](_0x1c657b[_0x40f2('0x35')],_0xb329de[_0x40f2('0x3e')]),_0x2b6847);if(_0x1c657b[_0x40f2('0x35')][_0x40f2('0x40')]){_0x3ec80f[_0x40f2('0x3d')]=_[_0x40f2('0x41')](_0x3ec80f['where'],{'$or':_[_0x40f2('0x2f')](_0x2b6847,function(_0x5bdfc6){if(_0x5bdfc6[_0x40f2('0x42')]!==_0x40f2('0x43')){var _0x5b7609={};_0x5b7609[_0x5bdfc6[_0x40f2('0x2c')]]={'$like':'%'+_0x1c657b[_0x40f2('0x35')][_0x40f2('0x40')]+'%'};return _0x5b7609;}})});}_0x3ec80f=_['merge']({},_0x3ec80f,_0x1c657b[_0x40f2('0x44')]);var _0xd9a671={'where':_0x3ec80f[_0x40f2('0x3d')]};return db[_0x40f2('0x30')]['count'](_0xd9a671)[_0x40f2('0x26')](function(_0x29ddfe){_0x166093[_0x40f2('0x1e')]=_0x29ddfe;if(_0x1c657b[_0x40f2('0x35')][_0x40f2('0x45')]){_0x3ec80f[_0x40f2('0x46')]=[{'all':!![]}];}return db[_0x40f2('0x30')][_0x40f2('0x47')](_0x3ec80f);})['then'](function(_0x5054a3){_0x166093[_0x40f2('0x48')]=_0x5054a3;return _0x166093;})[_0x40f2('0x26')](respondWithFilteredResult(_0x5985de,_0x3ec80f))[_0x40f2('0x49')](handleError(_0x5985de,null));};exports[_0x40f2('0x4a')]=function(_0x1c7dab,_0x346988){var _0x3a1f0e={'raw':!![],'where':{'id':_0x1c7dab[_0x40f2('0x4b')]['id']}},_0x963fb5={};_0x963fb5[_0x40f2('0x34')]=_[_0x40f2('0x4c')](db[_0x40f2('0x30')][_0x40f2('0x31')]);_0x963fb5['query']=_[_0x40f2('0x4c')](_0x1c7dab[_0x40f2('0x35')]);_0x963fb5['filters']=_[_0x40f2('0x4d')](_0x963fb5['model'],_0x963fb5['query']);_0x3a1f0e[_0x40f2('0x36')]=_[_0x40f2('0x4d')](_0x963fb5[_0x40f2('0x34')],qs['fields'](_0x1c7dab[_0x40f2('0x35')][_0x40f2('0x37')]));_0x3a1f0e[_0x40f2('0x36')]=_0x3a1f0e[_0x40f2('0x36')][_0x40f2('0x38')]?_0x3a1f0e[_0x40f2('0x36')]:_0x963fb5[_0x40f2('0x34')];if(_0x1c7dab[_0x40f2('0x35')][_0x40f2('0x45')]){_0x3a1f0e['include']=[{'all':!![]}];}_0x3a1f0e=_[_0x40f2('0x41')]({},_0x3a1f0e,_0x1c7dab[_0x40f2('0x44')]);return db['Disposition'][_0x40f2('0x4e')](_0x3a1f0e)['then'](handleEntityNotFound(_0x346988,null))[_0x40f2('0x26')](respondWithResult(_0x346988,null))[_0x40f2('0x49')](handleError(_0x346988,null));};exports[_0x40f2('0x4f')]=function(_0x38b9b1,_0x20a73d){return db[_0x40f2('0x30')][_0x40f2('0x4f')](_0x38b9b1[_0x40f2('0x50')],{})['then'](function(_0x3fcf1b){var _0x19e8ea=_0x38b9b1[_0x40f2('0x51')]['get']({'plain':!![]});if(!_0x19e8ea)throw new Error(_0x40f2('0x52'));if(_0x19e8ea[_0x40f2('0x53')]===_0x40f2('0x51')){var _0x3ebae5=_0x3fcf1b[_0x40f2('0x54')]({'plain':!![]});var _0x32b1fe=_0x40f2('0x55');return db[_0x40f2('0x56')]['find']({'where':{'name':_0x32b1fe,'userProfileId':_0x19e8ea['userProfileId']},'raw':!![]})['then'](function(_0x5a5cea){if(_0x5a5cea&&_0x5a5cea[_0x40f2('0x57')]===0x0){return db[_0x40f2('0x27')]['create']({'name':_0x3ebae5[_0x40f2('0x2c')],'resourceId':_0x3ebae5['id'],'type':_0x5a5cea[_0x40f2('0x2c')],'sectionId':_0x5a5cea['id']},{})['then'](function(){return _0x3fcf1b;});}else{return _0x3fcf1b;}})['catch'](function(_0x3aa7cf){logger['error'](_0x40f2('0x58'),_0x3aa7cf);throw _0x3aa7cf;});}return _0x3fcf1b;})[_0x40f2('0x26')](respondWithResult(_0x20a73d,0xc9))[_0x40f2('0x49')](handleError(_0x20a73d,null));};exports[_0x40f2('0x25')]=function(_0x7c931a,_0x3aa395){if(_0x7c931a[_0x40f2('0x50')]['id']){delete _0x7c931a[_0x40f2('0x50')]['id'];}return db[_0x40f2('0x30')]['find']({'where':{'id':_0x7c931a[_0x40f2('0x4b')]['id']}})[_0x40f2('0x26')](handleEntityNotFound(_0x3aa395,null))[_0x40f2('0x26')](saveUpdates(_0x7c931a['body'],null))['then'](respondWithResult(_0x3aa395,null))[_0x40f2('0x49')](handleError(_0x3aa395,null));};exports['destroy']=function(_0x4b18da,_0x3f04e7){return db[_0x40f2('0x30')][_0x40f2('0x4e')]({'where':{'id':_0x4b18da[_0x40f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f04e7,null))[_0x40f2('0x26')](removeEntity(_0x3f04e7,null))[_0x40f2('0x49')](handleError(_0x3f04e7,null));};
\ No newline at end of file
+var _0x7ca8=['util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','rows','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x592786,_0x583d26){var _0x2cfa5f=function(_0x3ec2e0){while(--_0x3ec2e0){_0x592786['push'](_0x592786['shift']());}};_0x2cfa5f(++_0x583d26);}(_0x7ca8,0xf5));var _0x87ca=function(_0x17c285,_0x5da6db){_0x17c285=_0x17c285-0x0;var _0xc8f50e=_0x7ca8[_0x17c285];return _0xc8f50e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87ca('0x0'));var zipdir=require(_0x87ca('0x1'));var jsonpatch=require(_0x87ca('0x2'));var rp=require(_0x87ca('0x3'));var moment=require(_0x87ca('0x4'));var BPromise=require(_0x87ca('0x5'));var Mustache=require(_0x87ca('0x6'));var util=require(_0x87ca('0x7'));var path=require(_0x87ca('0x8'));var sox=require(_0x87ca('0x9'));var csv=require(_0x87ca('0xa'));var ejs=require(_0x87ca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x87ca('0xc'));var crypto=require(_0x87ca('0xd'));var jsforce=require(_0x87ca('0xe'));var deskjs=require(_0x87ca('0xf'));var toCsv=require(_0x87ca('0xa'));var querystring=require(_0x87ca('0x10'));var Papa=require('papaparse');var Redis=require(_0x87ca('0x11'));var authService=require(_0x87ca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x87ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87ca('0x14'))('api');var utils=require(_0x87ca('0x15'));var config=require(_0x87ca('0x16'));var licenseUtil=require(_0x87ca('0x17'));var db=require(_0x87ca('0x18'))['db'];function respondWithStatusCode(_0x3ed2a1,_0x393511){_0x393511=_0x393511||0xcc;return function(_0x298997){if(_0x298997){return _0x3ed2a1[_0x87ca('0x19')](_0x393511);}return _0x3ed2a1[_0x87ca('0x1a')](_0x393511)['end']();};}function respondWithResult(_0x25224f,_0x5644ee){_0x5644ee=_0x5644ee||0xc8;return function(_0xaaa33c){if(_0xaaa33c){return _0x25224f[_0x87ca('0x1a')](_0x5644ee)[_0x87ca('0x1b')](_0xaaa33c);}};}function respondWithFilteredResult(_0x32436b,_0x51c77a){return function(_0x3ef441){if(_0x3ef441){var _0x58f71f=typeof _0x51c77a[_0x87ca('0x1c')]===_0x87ca('0x1d')&&typeof _0x51c77a[_0x87ca('0x1e')]===_0x87ca('0x1d');var _0x5e855b=_0x3ef441[_0x87ca('0x1f')];var _0x5e9ef3=_0x58f71f?0x0:_0x51c77a[_0x87ca('0x1c')];var _0x69c241=_0x58f71f?_0x3ef441[_0x87ca('0x1f')]:_0x51c77a['offset']+_0x51c77a['limit'];var _0x1d1b97;if(_0x69c241>=_0x5e855b){_0x69c241=_0x5e855b;_0x1d1b97=0xc8;}else{_0x1d1b97=0xce;}_0x32436b[_0x87ca('0x1a')](_0x1d1b97);return _0x32436b[_0x87ca('0x20')](_0x87ca('0x21'),_0x5e9ef3+'-'+_0x69c241+'/'+_0x5e855b)[_0x87ca('0x1b')](_0x3ef441);}return null;};}function patchUpdates(_0x172669){return function(_0x30899e){try{jsonpatch[_0x87ca('0x22')](_0x30899e,_0x172669,!![]);}catch(_0x118d05){return BPromise[_0x87ca('0x23')](_0x118d05);}return _0x30899e[_0x87ca('0x24')]();};}function saveUpdates(_0x34e9f7,_0x591540){return function(_0x3060fc){if(_0x3060fc){return _0x3060fc[_0x87ca('0x25')](_0x34e9f7)[_0x87ca('0x26')](function(_0x581652){return _0x581652;});}return null;};}function removeEntity(_0x1d5d24,_0x17987c){return function(_0x1e09a3){if(_0x1e09a3){return _0x1e09a3[_0x87ca('0x27')]()[_0x87ca('0x26')](function(){var _0x484b0b=_0x1e09a3['get']({'plain':!![]});var _0x32b6b6=_0x87ca('0x28');return db[_0x87ca('0x29')][_0x87ca('0x27')]({'where':{'type':_0x32b6b6,'resourceId':_0x484b0b['id']}})[_0x87ca('0x26')](function(){return _0x1e09a3;});})['then'](function(){_0x1d5d24[_0x87ca('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x235697,_0x19e3d1){return function(_0x37a22f){if(!_0x37a22f){_0x235697[_0x87ca('0x19')](0x194);}return _0x37a22f;};}function handleError(_0x2016e7,_0x5cb8f4){_0x5cb8f4=_0x5cb8f4||0x1f4;return function(_0x35fa09){logger[_0x87ca('0x2a')](_0x35fa09[_0x87ca('0x2b')]);if(_0x35fa09[_0x87ca('0x2c')]){delete _0x35fa09[_0x87ca('0x2c')];}_0x2016e7[_0x87ca('0x1a')](_0x5cb8f4)[_0x87ca('0x2d')](_0x35fa09);};}exports['index']=function(_0x18b89f,_0x5535bd){var _0x302b5f={},_0x5ba1f5={},_0x436d08={'count':0x0,'rows':[]};var _0x123982=_[_0x87ca('0x2e')](db[_0x87ca('0x2f')][_0x87ca('0x30')],function(_0x2220a5){return{'name':_0x2220a5[_0x87ca('0x31')],'type':_0x2220a5['type'][_0x87ca('0x32')]};});_0x5ba1f5[_0x87ca('0x33')]=_['map'](_0x123982,'name');_0x5ba1f5[_0x87ca('0x34')]=_[_0x87ca('0x35')](_0x18b89f[_0x87ca('0x34')]);_0x5ba1f5[_0x87ca('0x36')]=_[_0x87ca('0x37')](_0x5ba1f5[_0x87ca('0x33')],_0x5ba1f5[_0x87ca('0x34')]);_0x302b5f[_0x87ca('0x38')]=_[_0x87ca('0x37')](_0x5ba1f5[_0x87ca('0x33')],qs[_0x87ca('0x39')](_0x18b89f[_0x87ca('0x34')]['fields']));_0x302b5f[_0x87ca('0x38')]=_0x302b5f[_0x87ca('0x38')][_0x87ca('0x3a')]?_0x302b5f[_0x87ca('0x38')]:_0x5ba1f5[_0x87ca('0x33')];if(!_0x18b89f[_0x87ca('0x34')][_0x87ca('0x3b')](_0x87ca('0x3c'))){_0x302b5f[_0x87ca('0x1e')]=qs['limit'](_0x18b89f['query'][_0x87ca('0x1e')]);_0x302b5f[_0x87ca('0x1c')]=qs[_0x87ca('0x1c')](_0x18b89f[_0x87ca('0x34')][_0x87ca('0x1c')]);}_0x302b5f[_0x87ca('0x3d')]=qs[_0x87ca('0x3e')](_0x18b89f['query'][_0x87ca('0x3e')]);_0x302b5f[_0x87ca('0x3f')]=qs[_0x87ca('0x36')](_[_0x87ca('0x40')](_0x18b89f['query'],_0x5ba1f5[_0x87ca('0x36')]),_0x123982);if(_0x18b89f[_0x87ca('0x34')][_0x87ca('0x41')]){_0x302b5f['where']=_[_0x87ca('0x42')](_0x302b5f[_0x87ca('0x3f')],{'$or':_[_0x87ca('0x2e')](_0x123982,function(_0xab4e2){if(_0xab4e2[_0x87ca('0x43')]!=='VIRTUAL'){var _0x98c84a={};_0x98c84a[_0xab4e2['name']]={'$like':'%'+_0x18b89f['query'][_0x87ca('0x41')]+'%'};return _0x98c84a;}})});}_0x302b5f=_['merge']({},_0x302b5f,_0x18b89f[_0x87ca('0x44')]);var _0x5707fc={'where':_0x302b5f['where']};return db['Disposition'][_0x87ca('0x1f')](_0x5707fc)[_0x87ca('0x26')](function(_0x4467cb){_0x436d08[_0x87ca('0x1f')]=_0x4467cb;if(_0x18b89f['query'][_0x87ca('0x45')]){_0x302b5f[_0x87ca('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x302b5f);})['then'](function(_0x3c6d20){_0x436d08[_0x87ca('0x47')]=_0x3c6d20;return _0x436d08;})[_0x87ca('0x26')](respondWithFilteredResult(_0x5535bd,_0x302b5f))['catch'](handleError(_0x5535bd,null));};exports['show']=function(_0x3c5022,_0x519da4){var _0x4ae6fe={'raw':!![],'where':{'id':_0x3c5022['params']['id']}},_0xfee87={};_0xfee87[_0x87ca('0x33')]=_[_0x87ca('0x35')](db[_0x87ca('0x2f')][_0x87ca('0x30')]);_0xfee87[_0x87ca('0x34')]=_[_0x87ca('0x35')](_0x3c5022[_0x87ca('0x34')]);_0xfee87['filters']=_[_0x87ca('0x37')](_0xfee87[_0x87ca('0x33')],_0xfee87[_0x87ca('0x34')]);_0x4ae6fe['attributes']=_[_0x87ca('0x37')](_0xfee87[_0x87ca('0x33')],qs[_0x87ca('0x39')](_0x3c5022['query']['fields']));_0x4ae6fe[_0x87ca('0x38')]=_0x4ae6fe[_0x87ca('0x38')][_0x87ca('0x3a')]?_0x4ae6fe[_0x87ca('0x38')]:_0xfee87['model'];if(_0x3c5022['query']['includeAll']){_0x4ae6fe[_0x87ca('0x46')]=[{'all':!![]}];}_0x4ae6fe=_['merge']({},_0x4ae6fe,_0x3c5022[_0x87ca('0x44')]);return db[_0x87ca('0x2f')][_0x87ca('0x48')](_0x4ae6fe)[_0x87ca('0x26')](handleEntityNotFound(_0x519da4,null))[_0x87ca('0x26')](respondWithResult(_0x519da4,null))[_0x87ca('0x49')](handleError(_0x519da4,null));};exports[_0x87ca('0x4a')]=function(_0x27ff1e,_0x40da77){return db['Disposition'][_0x87ca('0x4a')](_0x27ff1e[_0x87ca('0x4b')],{})[_0x87ca('0x26')](function(_0x26c7b6){var _0x2f0a4f=_0x27ff1e[_0x87ca('0x4c')][_0x87ca('0x4d')]({'plain':!![]});if(!_0x2f0a4f)throw new Error(_0x87ca('0x4e'));if(_0x2f0a4f['role']===_0x87ca('0x4c')){var _0x49687b=_0x26c7b6['get']({'plain':!![]});var _0x433a39=_0x87ca('0x28');return db[_0x87ca('0x4f')][_0x87ca('0x48')]({'where':{'name':_0x433a39,'userProfileId':_0x2f0a4f[_0x87ca('0x50')]},'raw':!![]})[_0x87ca('0x26')](function(_0x263191){if(_0x263191&&_0x263191[_0x87ca('0x51')]===0x0){return db['UserProfileResource'][_0x87ca('0x4a')]({'name':_0x49687b[_0x87ca('0x2c')],'resourceId':_0x49687b['id'],'type':_0x263191['name'],'sectionId':_0x263191['id']},{})[_0x87ca('0x26')](function(){return _0x26c7b6;});}else{return _0x26c7b6;}})[_0x87ca('0x49')](function(_0x45c6fa){logger[_0x87ca('0x2a')](_0x87ca('0x52'),_0x45c6fa);throw _0x45c6fa;});}return _0x26c7b6;})[_0x87ca('0x26')](respondWithResult(_0x40da77,0xc9))['catch'](handleError(_0x40da77,null));};exports[_0x87ca('0x25')]=function(_0x37d5d6,_0x53ea5e){if(_0x37d5d6['body']['id']){delete _0x37d5d6[_0x87ca('0x4b')]['id'];}return db[_0x87ca('0x2f')][_0x87ca('0x48')]({'where':{'id':_0x37d5d6['params']['id']}})[_0x87ca('0x26')](handleEntityNotFound(_0x53ea5e,null))['then'](saveUpdates(_0x37d5d6[_0x87ca('0x4b')],null))['then'](respondWithResult(_0x53ea5e,null))[_0x87ca('0x49')](handleError(_0x53ea5e,null));};exports[_0x87ca('0x27')]=function(_0x1ec309,_0x493665){return db[_0x87ca('0x2f')][_0x87ca('0x48')]({'where':{'id':_0x1ec309[_0x87ca('0x53')]['id']}})['then'](handleEntityNotFound(_0x493665,null))[_0x87ca('0x26')](removeEntity(_0x493665,null))['catch'](handleError(_0x493665,null));};
\ No newline at end of file
index f81a12e..ac2d6b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0406=['ListId','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name'];(function(_0x27dff9,_0x3963eb){var _0xd0521e=function(_0x245a27){while(--_0x245a27){_0x27dff9['push'](_0x27dff9['shift']());}};_0xd0521e(++_0x3963eb);}(_0x0406,0xc0));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6040('0x0'));var util=require(_0x6040('0x1'));var logger=require(_0x6040('0x2'))(_0x6040('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6040('0x4'));var fs=require('fs');var path=require(_0x6040('0x5'));var rimraf=require(_0x6040('0x6'));var config=require(_0x6040('0x7'));var attributes=require(_0x6040('0x8'));module[_0x6040('0x9')]=function(_0x1ac1c3,_0x4ec176){return _0x1ac1c3[_0x6040('0xa')](_0x6040('0xb'),attributes,{'tableName':_0x6040('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x6040('0xd'),'fields':[_0x6040('0xe'),_0x6040('0xf')]},{'unique':!![],'name':'name_chat','fields':[_0x6040('0xe'),_0x6040('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0x6040('0xe'),_0x6040('0x11')]},{'unique':!![],'name':_0x6040('0x12'),'fields':[_0x6040('0xe'),_0x6040('0x13')]},{'unique':!![],'name':_0x6040('0x14'),'fields':[_0x6040('0xe'),_0x6040('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0x6040('0xe'),_0x6040('0x16')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x6040('0xe'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cc4=['name_voice','name','ListId','name_chat','name_mail','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger','moment','bluebird','request-promise','path','./disposition.attributes','exports','Disposition','tools_dispositions'];(function(_0x5ce5fb,_0x251a6a){var _0xdb46a2=function(_0xc8c205){while(--_0xc8c205){_0x5ce5fb['push'](_0x5ce5fb['shift']());}};_0xdb46a2(++_0x251a6a);}(_0x4cc4,0x96));var _0x44cc=function(_0x8e1298,_0x1c6e8e){_0x8e1298=_0x8e1298-0x0;var _0x59e5dc=_0x4cc4[_0x8e1298];return _0x59e5dc;};'use strict';var _=require(_0x44cc('0x0'));var util=require('util');var logger=require(_0x44cc('0x1'))('api');var moment=require(_0x44cc('0x2'));var BPromise=require(_0x44cc('0x3'));var rp=require(_0x44cc('0x4'));var fs=require('fs');var path=require(_0x44cc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44cc('0x6'));module[_0x44cc('0x7')]=function(_0x4fd424,_0x2bf63f){return _0x4fd424['define'](_0x44cc('0x8'),attributes,{'tableName':_0x44cc('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x44cc('0xa'),'fields':[_0x44cc('0xb'),_0x44cc('0xc')]},{'unique':!![],'name':_0x44cc('0xd'),'fields':[_0x44cc('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x44cc('0xe'),'fields':[_0x44cc('0xb'),'MailAccountId']},{'unique':!![],'name':_0x44cc('0xf'),'fields':[_0x44cc('0xb'),'SmsAccountId']},{'unique':!![],'name':_0x44cc('0x10'),'fields':['name',_0x44cc('0x11')]},{'unique':!![],'name':_0x44cc('0x12'),'fields':[_0x44cc('0xb'),_0x44cc('0x13')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x44cc('0xb'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
index a2d60ff..ae620b4 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(_0x474c4f,_0x597f33){var _0x2d6b42=function(_0x296211){while(--_0x296211){_0x474c4f['push'](_0x474c4f['shift']());}};_0x2d6b42(++_0x597f33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x244785,_0x56d386){var _0x4a3724=function(_0x25dc1a){while(--_0x25dc1a){_0x244785['push'](_0x244785['shift']());}};_0x4a3724(++_0x56d386);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 9d5c54e..e13849e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4757=['../../components/interaction/service','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ceb03,_0x9be599){var _0x188a6f=function(_0x5a3fcf){while(--_0x5a3fcf){_0x1ceb03['push'](_0x1ceb03['shift']());}};_0x188a6f(++_0x9be599);}(_0x4757,0x1ec));var _0x7475=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x4757[_0x5093e9];return _0x4c9a22;};'use strict';var multer=require(_0x7475('0x0'));var util=require(_0x7475('0x1'));var path=require(_0x7475('0x2'));var timeout=require(_0x7475('0x3'));var express=require(_0x7475('0x4'));var router=express[_0x7475('0x5')]();var fs_extra=require(_0x7475('0x6'));var auth=require(_0x7475('0x7'));var interaction=require(_0x7475('0x8'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x7475('0x9')]('/',auth['isAuthenticated'](),controller[_0x7475('0xa')]);router['get'](_0x7475('0xb'),auth[_0x7475('0xc')](),controller[_0x7475('0xd')]);router['post']('/',auth[_0x7475('0xc')](),controller[_0x7475('0xe')]);router[_0x7475('0xf')](_0x7475('0xb'),auth[_0x7475('0xc')](),controller[_0x7475('0x10')]);router[_0x7475('0x11')]('/:id',auth[_0x7475('0xc')](),controller[_0x7475('0x12')]);module[_0x7475('0x13')]=router;
\ No newline at end of file
+var _0x1277=['../../config/environment','./disposition.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x1bb180,_0x4e9d4e){var _0x59d7fb=function(_0x22ad21){while(--_0x22ad21){_0x1bb180['push'](_0x1bb180['shift']());}};_0x59d7fb(++_0x4e9d4e);}(_0x1277,0x1bc));var _0x7127=function(_0x4ca551,_0x5b2728){_0x4ca551=_0x4ca551-0x0;var _0x5ee620=_0x1277[_0x4ca551];return _0x5ee620;};'use strict';var multer=require(_0x7127('0x0'));var util=require(_0x7127('0x1'));var path=require(_0x7127('0x2'));var timeout=require(_0x7127('0x3'));var express=require(_0x7127('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7127('0x5'));var config=require(_0x7127('0x6'));var controller=require(_0x7127('0x7'));router['get']('/',auth[_0x7127('0x8')](),controller[_0x7127('0x9')]);router['get'](_0x7127('0xa'),auth[_0x7127('0x8')](),controller[_0x7127('0xb')]);router[_0x7127('0xc')]('/',auth[_0x7127('0x8')](),controller[_0x7127('0xd')]);router[_0x7127('0xe')]('/:id',auth[_0x7127('0x8')](),controller[_0x7127('0xf')]);router[_0x7127('0x10')](_0x7127('0xa'),auth[_0x7127('0x8')](),controller[_0x7127('0x11')]);module['exports']=router;
\ No newline at end of file
index dcf6e9c..e1f4582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7292=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP'];(function(_0x269e89,_0x802307){var _0x416edd=function(_0x7a81c5){while(--_0x7a81c5){_0x269e89['push'](_0x269e89['shift']());}};_0x416edd(++_0x802307);}(_0x7292,0xde));var _0x2729=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x7292[_0x45d3f0];return _0x314b79;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'name':{'type':Sequelize[_0x2729('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x2729('0x3')]('yes','no'),'defaultValue':_0x2729('0x4')},'headerinfo':{'type':Sequelize[_0x2729('0x2')],'defaultValue':_0x2729('0x5')},'localstationid':{'type':Sequelize[_0x2729('0x2')],'unique':_0x2729('0x6')},'minrate':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x7'),_0x2729('0x8'),_0x2729('0x9'),_0x2729('0xa'),_0x2729('0xb'),_0x2729('0xc')),'defaultValue':_0x2729('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x2729('0x7'),'4800',_0x2729('0x9'),_0x2729('0xa'),_0x2729('0xb'),_0x2729('0xc')),'defaultValue':_0x2729('0xc')},'modem':{'type':Sequelize[_0x2729('0x2')],'defaultValue':_0x2729('0xd')},'gateway':{'type':Sequelize[_0x2729('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2729('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2729('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2729('0x3')](_0x2729('0xf'),'IAX',_0x2729('0x10'),_0x2729('0x11')),'defaultValue':_0x2729('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2729('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2729('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2729('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2729('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2729('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2729('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2729('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2729('0x13')],'defaultValue':![],'comment':_0x2729('0x14'),'set':function(_0x1f5eb6){if(!_0x1f5eb6)this[_0x2729('0x15')](_0x2729('0x16'),null);this['setDataValue'](_0x2729('0x17'),_0x1f5eb6);}}};
\ No newline at end of file
+var _0xcb39=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','STRING','v17,v27,v29','SIP','IAX','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x3e3f14,_0x3ccac3){var _0x17b619=function(_0x23640b){while(--_0x23640b){_0x3e3f14['push'](_0x3e3f14['shift']());}};_0x17b619(++_0x3ccac3);}(_0xcb39,0x76));var _0x9cb3=function(_0x585700,_0x5eaa85){_0x585700=_0x585700-0x0;var _0x57eebb=_0xcb39[_0x585700];return _0x57eebb;};'use strict';var Sequelize=require(_0x9cb3('0x0'));module[_0x9cb3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x9cb3('0x2')](_0x9cb3('0x3'),'no'),'defaultValue':_0x9cb3('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9cb3('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x9cb3('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x9cb3('0x6'),_0x9cb3('0x7'),_0x9cb3('0x8'),_0x9cb3('0x9'),'12000',_0x9cb3('0xa')),'defaultValue':_0x9cb3('0x7')},'maxrate':{'type':Sequelize[_0x9cb3('0x2')](_0x9cb3('0x6'),_0x9cb3('0x7'),'7200',_0x9cb3('0x9'),'12000',_0x9cb3('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x9cb3('0xb')],'defaultValue':_0x9cb3('0xc')},'gateway':{'type':Sequelize[_0x9cb3('0xb')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9cb3('0xb')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9cb3('0x2')](_0x9cb3('0xd'),_0x9cb3('0xe'),'DADHI','KHOMP'),'defaultValue':_0x9cb3('0xd')},'key':{'type':Sequelize[_0x9cb3('0xb')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9cb3('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9cb3('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9cb3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9cb3('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9cb3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9cb3('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9cb3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9cb3('0x11')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x14c0fe){if(!_0x14c0fe)this[_0x9cb3('0x12')](_0x9cb3('0x13'),null);this[_0x9cb3('0x12')]('mandatoryDisposition',_0x14c0fe);}}};
\ No newline at end of file
index 738c8c5..9c44da7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['options','include','findAll','rows','catch','params','Pause','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','findOne','pick','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','getInteractions','Contact','Owner','internal','Tag','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','Fax\x20Extension','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','update','omit','tech','key','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','List','CmContact','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','then','sendStatus','name','FaxAccount','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL'];(function(_0x3b49fe,_0xd5fac4){var _0xc2abcb=function(_0x5b41a1){while(--_0x5b41a1){_0x3b49fe['push'](_0x3b49fe['shift']());}};_0xc2abcb(++_0xd5fac4);}(_0x7880,0x1f4));var _0x0788=function(_0x44da96,_0x1f19d5){_0x44da96=_0x44da96-0x0;var _0x519253=_0x7880[_0x44da96];return _0x519253;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];config[_0x0788('0x1a')]=_[_0x0788('0x1b')](config[_0x0788('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0788('0x1c'))(new Redis(config[_0x0788('0x1a')]));require(_0x0788('0x1d'))[_0x0788('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0788('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x0788('0x1f')][_0x0788('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3fd1e4,_0xb406fb,_0x2ddd1a,_0x430e34){return new BPromise(function(_0x5e1a29,_0x573822){var _0x17d805=_0x430e34||client;return _0x17d805[_0x0788('0x21')](_0x3fd1e4,_0x2ddd1a)['then'](function(_0x654e4b){logger[_0x0788('0x22')](_0x0788('0x23'),_0xb406fb,'request\x20sent');logger[_0x0788('0x24')](_0x0788('0x25'),_0xb406fb,'request\x20sent',JSON[_0x0788('0x26')](_0x654e4b));if(_0x654e4b['error']){if(_0x654e4b[_0x0788('0x27')]['code']===0x1f4){logger[_0x0788('0x27')](_0x0788('0x23'),_0xb406fb,_0x654e4b[_0x0788('0x27')][_0x0788('0x28')]);return _0x573822(_0x654e4b[_0x0788('0x27')]['message']);}logger['error'](_0x0788('0x23'),_0xb406fb,_0x654e4b[_0x0788('0x27')][_0x0788('0x28')]);return _0x5e1a29(_0x654e4b[_0x0788('0x27')]['message']);}else{logger['info'](_0x0788('0x23'),_0xb406fb,_0x0788('0x29'));_0x5e1a29(_0x654e4b[_0x0788('0x2a')]['message']);}})['catch'](function(_0x240459){logger[_0x0788('0x27')]('FaxAccount,\x20%s,\x20%s',_0xb406fb,_0x240459);_0x573822(_0x240459);});});}function respondWithStatusCode(_0x48816a,_0x5a54a5){_0x5a54a5=_0x5a54a5||0xcc;return function(_0x44798c){if(_0x44798c){return _0x48816a['sendStatus'](_0x5a54a5);}return _0x48816a[_0x0788('0x2b')](_0x5a54a5)[_0x0788('0x2c')]();};}function respondWithResult(_0x467d52,_0x18fc0e){_0x18fc0e=_0x18fc0e||0xc8;return function(_0xf9ba32){if(_0xf9ba32){return _0x467d52[_0x0788('0x2b')](_0x18fc0e)[_0x0788('0x2d')](_0xf9ba32);}};}function respondWithFilteredResult(_0x3ffe4f,_0x5b7594){return function(_0x5a5178){if(_0x5a5178){var _0x3c5246=typeof _0x5b7594[_0x0788('0x2e')]==='undefined'&&typeof _0x5b7594['limit']===_0x0788('0x2f');var _0x68658a=_0x5a5178[_0x0788('0x30')];var _0x436031=_0x3c5246?0x0:_0x5b7594[_0x0788('0x2e')];var _0x44bff2=_0x3c5246?_0x5a5178[_0x0788('0x30')]:_0x5b7594[_0x0788('0x2e')]+_0x5b7594[_0x0788('0x31')];var _0x85e579;if(_0x44bff2>=_0x68658a){_0x44bff2=_0x68658a;_0x85e579=0xc8;}else{_0x85e579=0xce;}_0x3ffe4f['status'](_0x85e579);return _0x3ffe4f[_0x0788('0x32')](_0x0788('0x33'),_0x436031+'-'+_0x44bff2+'/'+_0x68658a)[_0x0788('0x2d')](_0x5a5178);}return null;};}function patchUpdates(_0x2a64e4){return function(_0xce4534){try{jsonpatch[_0x0788('0x34')](_0xce4534,_0x2a64e4,!![]);}catch(_0x26f584){return BPromise[_0x0788('0x35')](_0x26f584);}return _0xce4534[_0x0788('0x36')]();};}function saveUpdates(_0xaed27e,_0x4fa055){return function(_0x4ae132){if(_0x4ae132){return _0x4ae132['update'](_0xaed27e)['then'](function(_0x516cce){return _0x516cce;});}return null;};}function removeEntity(_0x586a06,_0x208a89){return function(_0x38a4ae){if(_0x38a4ae){return _0x38a4ae[_0x0788('0x37')]()['then'](function(){var _0xe80dba=_0x38a4ae[_0x0788('0x38')]({'plain':!![]});var _0x112476=_0x0788('0x39');return db['UserProfileResource'][_0x0788('0x37')]({'where':{'type':_0x112476,'resourceId':_0xe80dba['id']}})['then'](function(){return _0x38a4ae;});})[_0x0788('0x3a')](function(){_0x586a06['status'](0xcc)[_0x0788('0x2c')]();});}};}function handleEntityNotFound(_0x1beb1f,_0x498e16){return function(_0x16f053){if(!_0x16f053){_0x1beb1f[_0x0788('0x3b')](0x194);}return _0x16f053;};}function handleError(_0x503aa0,_0x17240e){_0x17240e=_0x17240e||0x1f4;return function(_0x5eb693){logger[_0x0788('0x27')](_0x5eb693['stack']);if(_0x5eb693[_0x0788('0x3c')]){delete _0x5eb693['name'];}_0x503aa0[_0x0788('0x2b')](_0x17240e)['send'](_0x5eb693);};}exports['index']=function(_0x3e31f8,_0x68d9d4){var _0x2e48cf={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2d17b0={},_0x8cfffc={'count':0x0,'rows':[]};var _0x530d83=_['map'](db[_0x0788('0x3d')][_0x0788('0x3e')],function(_0x45b247){return{'name':_0x45b247[_0x0788('0x3f')],'type':_0x45b247[_0x0788('0x40')]['key']};});_0x2d17b0['model']=_[_0x0788('0x41')](_0x530d83,_0x0788('0x3c'));_0x2d17b0[_0x0788('0x42')]=_[_0x0788('0x43')](_0x3e31f8[_0x0788('0x42')]);_0x2d17b0[_0x0788('0x44')]=_[_0x0788('0x45')](_0x2d17b0[_0x0788('0x46')],_0x2d17b0[_0x0788('0x42')]);_0x2e48cf['attributes']=_['intersection'](_0x2d17b0[_0x0788('0x46')],qs[_0x0788('0x47')](_0x3e31f8[_0x0788('0x42')]['fields']));_0x2e48cf['attributes']=_0x2e48cf['attributes'][_0x0788('0x48')]?_0x2e48cf[_0x0788('0x49')]:_0x2d17b0[_0x0788('0x46')];if(!_0x3e31f8[_0x0788('0x42')][_0x0788('0x4a')](_0x0788('0x4b'))){_0x2e48cf[_0x0788('0x31')]=qs[_0x0788('0x31')](_0x3e31f8['query'][_0x0788('0x31')]);_0x2e48cf[_0x0788('0x2e')]=qs[_0x0788('0x2e')](_0x3e31f8[_0x0788('0x42')]['offset']);}_0x2e48cf[_0x0788('0x4c')]=qs[_0x0788('0x4d')](_0x3e31f8['query']['sort']);_0x2e48cf['where']=qs[_0x0788('0x44')](_['pick'](_0x3e31f8[_0x0788('0x42')],_0x2d17b0[_0x0788('0x44')]),_0x530d83);if(_0x3e31f8[_0x0788('0x42')][_0x0788('0x4e')]){_0x2e48cf[_0x0788('0x4f')]=_[_0x0788('0x50')](_0x2e48cf[_0x0788('0x4f')],{'$or':_[_0x0788('0x41')](_0x530d83,function(_0x5bffdb){if(_0x5bffdb['type']!==_0x0788('0x51')){var _0xe7dfdc={};_0xe7dfdc[_0x5bffdb[_0x0788('0x3c')]]={'$like':'%'+_0x3e31f8['query'][_0x0788('0x4e')]+'%'};return _0xe7dfdc;}})});}_0x2e48cf=_[_0x0788('0x50')]({},_0x2e48cf,_0x3e31f8[_0x0788('0x52')]);var _0x4563cd={'where':_0x2e48cf[_0x0788('0x4f')]};return db['FaxAccount']['count'](_0x4563cd)[_0x0788('0x3a')](function(_0x40d317){_0x8cfffc['count']=_0x40d317;if(_0x3e31f8[_0x0788('0x42')]['includeAll']){_0x2e48cf[_0x0788('0x53')]=[{'all':!![]}];}return db[_0x0788('0x3d')][_0x0788('0x54')](_0x2e48cf);})[_0x0788('0x3a')](function(_0x3c757a){_0x8cfffc[_0x0788('0x55')]=_0x3c757a;return _0x8cfffc;})[_0x0788('0x3a')](respondWithFilteredResult(_0x68d9d4,_0x2e48cf))[_0x0788('0x56')](handleError(_0x68d9d4,null));};exports['show']=function(_0x179c6e,_0x363ab9){var _0x3f2f1b={'raw':![],'where':{'id':_0x179c6e[_0x0788('0x57')]['id']},'include':[{'model':db[_0x0788('0x58')],'as':'mandatoryDispositionPause'}]},_0x5ef557={};_0x5ef557[_0x0788('0x46')]=_[_0x0788('0x43')](db[_0x0788('0x3d')][_0x0788('0x3e')]);_0x5ef557[_0x0788('0x42')]=_[_0x0788('0x43')](_0x179c6e['query']);_0x5ef557['filters']=_[_0x0788('0x45')](_0x5ef557[_0x0788('0x46')],_0x5ef557['query']);_0x3f2f1b[_0x0788('0x49')]=_[_0x0788('0x45')](_0x5ef557[_0x0788('0x46')],qs[_0x0788('0x47')](_0x179c6e[_0x0788('0x42')][_0x0788('0x47')]));_0x3f2f1b[_0x0788('0x49')]=_0x3f2f1b[_0x0788('0x49')][_0x0788('0x48')]?_0x3f2f1b[_0x0788('0x49')]:_0x5ef557[_0x0788('0x46')];if(_0x179c6e[_0x0788('0x42')]['includeAll']){_0x3f2f1b[_0x0788('0x53')]=[{'all':!![]}];}_0x3f2f1b=_[_0x0788('0x50')]({},_0x3f2f1b,_0x179c6e[_0x0788('0x52')]);return db['FaxAccount'][_0x0788('0x59')](_0x3f2f1b)[_0x0788('0x3a')](handleEntityNotFound(_0x363ab9,null))['then'](respondWithResult(_0x363ab9,null))['catch'](handleError(_0x363ab9,null));};exports[_0x0788('0x5a')]=function(_0x26826a,_0x3fb3c2){return db[_0x0788('0x3d')][_0x0788('0x5a')](_0x26826a[_0x0788('0x5b')],{})['then'](function(_0x336d30){var _0x3be076=_0x26826a[_0x0788('0x5c')]['get']({'plain':!![]});if(!_0x3be076)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3be076[_0x0788('0x5d')]==='user'){var _0x208db3=_0x336d30[_0x0788('0x38')]({'plain':!![]});var _0x223767=_0x0788('0x39');return db[_0x0788('0x5e')][_0x0788('0x59')]({'where':{'name':_0x223767,'userProfileId':_0x3be076[_0x0788('0x5f')]},'raw':!![]})[_0x0788('0x3a')](function(_0x67dfa3){if(_0x67dfa3&&_0x67dfa3[_0x0788('0x60')]===0x0){return db['UserProfileResource'][_0x0788('0x5a')]({'name':_0x208db3[_0x0788('0x3c')],'resourceId':_0x208db3['id'],'type':_0x67dfa3[_0x0788('0x3c')],'sectionId':_0x67dfa3['id']},{})[_0x0788('0x3a')](function(){return _0x336d30;});}else{return _0x336d30;}})['catch'](function(_0xef26fd){logger[_0x0788('0x27')](_0x0788('0x61'),_0xef26fd);throw _0xef26fd;});}return _0x336d30;})[_0x0788('0x3a')](respondWithResult(_0x3fb3c2,0xc9))[_0x0788('0x56')](handleError(_0x3fb3c2,null));};exports['update']=function(_0xf2031,_0x4aa3af){if(_0xf2031[_0x0788('0x5b')]['id']){delete _0xf2031[_0x0788('0x5b')]['id'];}return db[_0x0788('0x3d')][_0x0788('0x59')]({'where':{'id':_0xf2031[_0x0788('0x57')]['id']},'include':[{'model':db[_0x0788('0x58')],'as':_0x0788('0x62')}]})[_0x0788('0x3a')](handleEntityNotFound(_0x4aa3af,null))[_0x0788('0x3a')](saveUpdates(_0xf2031['body'],null))[_0x0788('0x3a')](respondWithResult(_0x4aa3af,null))[_0x0788('0x56')](handleError(_0x4aa3af,null));};exports[_0x0788('0x37')]=function(_0x59a436,_0x50eeae){return db[_0x0788('0x3d')][_0x0788('0x59')]({'where':{'id':_0x59a436[_0x0788('0x57')]['id']}})['then'](handleEntityNotFound(_0x50eeae,null))[_0x0788('0x3a')](removeEntity(_0x50eeae,null))[_0x0788('0x56')](handleError(_0x50eeae,null));};exports[_0x0788('0x63')]=function(_0x2851cf,_0x4d82a5){return db['FaxAccount']['describe']()[_0x0788('0x3a')](respondWithResult(_0x4d82a5,null))[_0x0788('0x56')](handleError(_0x4d82a5,null));};exports[_0x0788('0x64')]=function(_0x4fc729,_0x59b296,_0xaa2d4d){if(_0x4fc729['body']['id']){delete _0x4fc729[_0x0788('0x5b')]['id'];}return db[_0x0788('0x3d')][_0x0788('0x59')]({'where':{'id':_0x4fc729[_0x0788('0x57')]['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x59b296,null))[_0x0788('0x3a')](function(_0x20b01a){if(_0x20b01a){_0x4fc729[_0x0788('0x5b')][_0x0788('0x65')]=_0x20b01a['id'];return db[_0x0788('0x66')]['create'](_0x4fc729[_0x0788('0x5b')]);}})[_0x0788('0x3a')](respondWithResult(_0x59b296,null))['catch'](handleError(_0x59b296,null));};exports['getDispositions']=function(_0x3b053e,_0x2dcd79,_0x1c50e9){var _0x219252={'raw':![],'where':{}};var _0x3628d6={};var _0x192798={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0788('0x67')]({'where':{'id':_0x3b053e[_0x0788('0x57')]['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x2dcd79,null))[_0x0788('0x3a')](function(_0x4e0282){if(_0x4e0282){_0x3628d6[_0x0788('0x46')]=_[_0x0788('0x43')](db[_0x0788('0x66')][_0x0788('0x3e')]);_0x3628d6['query']=_['keys'](_0x3b053e[_0x0788('0x42')]);_0x3628d6[_0x0788('0x44')]=_[_0x0788('0x45')](_0x3628d6[_0x0788('0x46')],_0x3628d6[_0x0788('0x42')]);_0x219252[_0x0788('0x49')]=_[_0x0788('0x45')](_0x3628d6[_0x0788('0x46')],qs[_0x0788('0x47')](_0x3b053e['query'][_0x0788('0x47')]));_0x219252[_0x0788('0x49')]=_0x219252[_0x0788('0x49')]['length']?_0x219252['attributes']:_0x3628d6[_0x0788('0x46')];if(!_0x3b053e['query'][_0x0788('0x4a')](_0x0788('0x4b'))){_0x219252[_0x0788('0x31')]=qs[_0x0788('0x31')](_0x3b053e[_0x0788('0x42')][_0x0788('0x31')]);_0x219252[_0x0788('0x2e')]=qs[_0x0788('0x2e')](_0x3b053e[_0x0788('0x42')]['offset']);}_0x219252[_0x0788('0x4c')]=qs[_0x0788('0x4d')](_0x3b053e[_0x0788('0x42')]['sort']);_0x219252[_0x0788('0x4f')]=qs[_0x0788('0x44')](_[_0x0788('0x68')](_0x3b053e['query'],_0x3628d6[_0x0788('0x44')]));_0x219252[_0x0788('0x4f')][_0x0788('0x65')]=_0x4e0282['id'];if(_0x3b053e[_0x0788('0x42')][_0x0788('0x4e')]){_0x219252[_0x0788('0x4f')]=_[_0x0788('0x50')](_0x219252[_0x0788('0x4f')],{'$or':_[_0x0788('0x41')](_0x219252['attributes'],function(_0x471b3a){var _0x623d29={};_0x623d29[_0x471b3a]={'$like':'%'+_0x3b053e[_0x0788('0x42')][_0x0788('0x4e')]+'%'};return _0x623d29;})});}_0x219252=_[_0x0788('0x50')]({},_0x219252,_0x3b053e['options']);return db[_0x0788('0x66')][_0x0788('0x30')]({'where':_0x219252[_0x0788('0x4f')]})['then'](function(_0x1788d1){_0x192798[_0x0788('0x30')]=_0x1788d1;if(_0x3b053e[_0x0788('0x42')][_0x0788('0x69')]){_0x219252[_0x0788('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x0788('0x54')](_0x219252);})[_0x0788('0x3a')](function(_0x523ab4){_0x192798[_0x0788('0x55')]=_0x523ab4;return _0x192798;});}})[_0x0788('0x3a')](respondWithFilteredResult(_0x2dcd79,_0x219252))['catch'](handleError(_0x2dcd79,null));};exports[_0x0788('0x6a')]=function(_0xe14a8e,_0x9a0ef,_0x5c2d95){return db[_0x0788('0x3d')][_0x0788('0x59')]({'where':{'id':_0xe14a8e[_0x0788('0x57')]['id']}})['then'](handleEntityNotFound(_0x9a0ef,null))[_0x0788('0x3a')](function(_0x1b3046){if(_0x1b3046){return _0x1b3046[_0x0788('0x6a')](_0xe14a8e[_0x0788('0x42')][_0x0788('0x6b')]);}})[_0x0788('0x3a')](respondWithStatusCode(_0x9a0ef,null))[_0x0788('0x56')](handleError(_0x9a0ef,null));};exports[_0x0788('0x6c')]=function(_0x50d898,_0x36ebc1,_0x3a58fa){if(_0x50d898[_0x0788('0x5b')]['id']){delete _0x50d898[_0x0788('0x5b')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x50d898[_0x0788('0x57')]['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x36ebc1,null))['then'](function(_0x2b7b4a){if(_0x2b7b4a){_0x50d898[_0x0788('0x5b')][_0x0788('0x65')]=_0x2b7b4a['id'];return db['CannedAnswer']['create'](_0x50d898[_0x0788('0x5b')]);}})[_0x0788('0x3a')](respondWithResult(_0x36ebc1,null))['catch'](handleError(_0x36ebc1,null));};exports['getAnswers']=function(_0x4ace43,_0x17ea6a,_0x3536f7){var _0x59260c={'raw':![],'where':{}};var _0x1827e4={};var _0x583b14={'count':0x0,'rows':[]};return db[_0x0788('0x3d')][_0x0788('0x67')]({'where':{'id':_0x4ace43[_0x0788('0x57')]['id']}})['then'](handleEntityNotFound(_0x17ea6a,null))[_0x0788('0x3a')](function(_0x4eec56){if(_0x4eec56){_0x1827e4[_0x0788('0x46')]=_['keys'](db[_0x0788('0x6d')][_0x0788('0x3e')]);_0x1827e4[_0x0788('0x42')]=_[_0x0788('0x43')](_0x4ace43[_0x0788('0x42')]);_0x1827e4[_0x0788('0x44')]=_[_0x0788('0x45')](_0x1827e4[_0x0788('0x46')],_0x1827e4[_0x0788('0x42')]);_0x59260c[_0x0788('0x49')]=_[_0x0788('0x45')](_0x1827e4[_0x0788('0x46')],qs[_0x0788('0x47')](_0x4ace43['query']['fields']));_0x59260c['attributes']=_0x59260c[_0x0788('0x49')][_0x0788('0x48')]?_0x59260c[_0x0788('0x49')]:_0x1827e4[_0x0788('0x46')];if(!_0x4ace43[_0x0788('0x42')][_0x0788('0x4a')](_0x0788('0x4b'))){_0x59260c[_0x0788('0x31')]=qs[_0x0788('0x31')](_0x4ace43[_0x0788('0x42')][_0x0788('0x31')]);_0x59260c['offset']=qs['offset'](_0x4ace43[_0x0788('0x42')][_0x0788('0x2e')]);}_0x59260c[_0x0788('0x4c')]=qs[_0x0788('0x4d')](_0x4ace43[_0x0788('0x42')][_0x0788('0x4d')]);_0x59260c[_0x0788('0x4f')]=qs[_0x0788('0x44')](_['pick'](_0x4ace43['query'],_0x1827e4[_0x0788('0x44')]));_0x59260c[_0x0788('0x4f')][_0x0788('0x65')]=_0x4eec56['id'];if(_0x4ace43[_0x0788('0x42')][_0x0788('0x4e')]){_0x59260c[_0x0788('0x4f')]=_['merge'](_0x59260c[_0x0788('0x4f')],{'$or':_[_0x0788('0x41')](_0x59260c[_0x0788('0x49')],function(_0x3ec405){var _0x206822={};_0x206822[_0x3ec405]={'$like':'%'+_0x4ace43[_0x0788('0x42')][_0x0788('0x4e')]+'%'};return _0x206822;})});}_0x59260c=_[_0x0788('0x50')]({},_0x59260c,_0x4ace43[_0x0788('0x52')]);return db['CannedAnswer'][_0x0788('0x30')]({'where':_0x59260c[_0x0788('0x4f')]})[_0x0788('0x3a')](function(_0x4540bc){_0x583b14[_0x0788('0x30')]=_0x4540bc;if(_0x4ace43[_0x0788('0x42')]['includeAll']){_0x59260c[_0x0788('0x53')]=[{'all':!![]}];}return db[_0x0788('0x6d')][_0x0788('0x54')](_0x59260c);})[_0x0788('0x3a')](function(_0x1f29c9){_0x583b14[_0x0788('0x55')]=_0x1f29c9;return _0x583b14;});}})[_0x0788('0x3a')](respondWithFilteredResult(_0x17ea6a,_0x59260c))[_0x0788('0x56')](handleError(_0x17ea6a,null));};exports[_0x0788('0x6e')]=function(_0x9e76de,_0x5192f3,_0x45eaaa){return db['FaxAccount'][_0x0788('0x59')]({'where':{'id':_0x9e76de['params']['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x5192f3,null))['then'](function(_0x2e9f15){if(_0x2e9f15){return _0x2e9f15[_0x0788('0x6e')](_0x9e76de[_0x0788('0x42')][_0x0788('0x6b')]);}})['then'](respondWithStatusCode(_0x5192f3,null))[_0x0788('0x56')](handleError(_0x5192f3,null));};exports[_0x0788('0x6f')]=function(_0x189556,_0x48943b,_0x682e9f){return db[_0x0788('0x70')]['find']({'where':{'id':_0x189556[_0x0788('0x57')]['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x48943b,null))[_0x0788('0x3a')](function(_0x2a78e4){if(_0x2a78e4){return _0x2a78e4[_0x0788('0x6f')](_0x189556[_0x0788('0x5b')][_0x0788('0x6b')],_['omit'](_0x189556[_0x0788('0x5b')],[_0x0788('0x6b'),'id'])||{});}})[_0x0788('0x3a')](respondWithResult(_0x48943b,null))[_0x0788('0x56')](handleError(_0x48943b,null));};exports[_0x0788('0x71')]=function(_0x374a10,_0xa34a75,_0x1a094b){var _0x5761b1={'raw':![],'where':{}};var _0x5130c4={};var _0x26233b={'count':0x0,'rows':[]};return db[_0x0788('0x3d')][_0x0788('0x67')]({'where':{'id':_0x374a10[_0x0788('0x57')]['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0xa34a75,null))[_0x0788('0x3a')](function(_0x4177bf){if(_0x4177bf){_0x5130c4['model']=_[_0x0788('0x43')](db['FaxInteraction']['rawAttributes']);_0x5130c4[_0x0788('0x42')]=_[_0x0788('0x43')](_0x374a10['query']);_0x5130c4[_0x0788('0x44')]=_[_0x0788('0x45')](_0x5130c4[_0x0788('0x46')],_0x5130c4[_0x0788('0x42')]);_0x5761b1[_0x0788('0x49')]=_[_0x0788('0x45')](_0x5130c4['model'],qs[_0x0788('0x47')](_0x374a10[_0x0788('0x42')]['fields']));_0x5761b1[_0x0788('0x49')]=_0x5761b1[_0x0788('0x49')]['length']?_0x5761b1[_0x0788('0x49')]:_0x5130c4[_0x0788('0x46')];if(!_0x374a10[_0x0788('0x42')][_0x0788('0x4a')](_0x0788('0x4b'))){_0x5761b1[_0x0788('0x31')]=qs[_0x0788('0x31')](_0x374a10['query'][_0x0788('0x31')]);_0x5761b1[_0x0788('0x2e')]=qs[_0x0788('0x2e')](_0x374a10[_0x0788('0x42')]['offset']);}_0x5761b1[_0x0788('0x4c')]=qs[_0x0788('0x4d')](_0x374a10['query']['sort']);_0x5761b1[_0x0788('0x4f')]=qs[_0x0788('0x44')](_[_0x0788('0x68')](_0x374a10[_0x0788('0x42')],_0x5130c4[_0x0788('0x44')]));_0x5761b1[_0x0788('0x4f')]['FaxAccountId']=_0x4177bf['id'];if(_0x374a10[_0x0788('0x42')][_0x0788('0x4e')]){_0x5761b1[_0x0788('0x4f')]=_[_0x0788('0x50')](_0x5761b1[_0x0788('0x4f')],{'$or':_[_0x0788('0x41')](_0x5761b1[_0x0788('0x49')],function(_0x3539d4){var _0x237ac8={};_0x237ac8[_0x3539d4]={'$like':'%'+_0x374a10[_0x0788('0x42')][_0x0788('0x4e')]+'%'};return _0x237ac8;})});}_0x5761b1=_[_0x0788('0x50')]({},_0x5761b1,_0x374a10[_0x0788('0x52')]);return db[_0x0788('0x70')][_0x0788('0x30')]({'where':_0x5761b1[_0x0788('0x4f')]})[_0x0788('0x3a')](function(_0x4bb16c){_0x26233b[_0x0788('0x30')]=_0x4bb16c;if(_0x374a10[_0x0788('0x42')][_0x0788('0x69')]){_0x5761b1[_0x0788('0x53')]=[{'model':db['CmContact'],'as':_0x0788('0x72'),'required':![]},{'model':db['User'],'as':_0x0788('0x73'),'attributes':['name','fullname',_0x0788('0x74')],'required':![]},{'model':db[_0x0788('0x75')],'as':'Tags','attributes':['id',_0x0788('0x3c'),'color'],'where':_0x374a10[_0x0788('0x42')]['tag']?{'id':_0x374a10[_0x0788('0x42')][_0x0788('0x76')]}:undefined,'required':_0x374a10[_0x0788('0x42')][_0x0788('0x76')]?!![]:![]}];}return db[_0x0788('0x70')][_0x0788('0x54')](_0x5761b1);})['then'](function(_0x473491){_0x26233b['rows']=_0x473491;return _0x26233b;});}})[_0x0788('0x3a')](respondWithFilteredResult(_0xa34a75,_0x5761b1))[_0x0788('0x56')](handleError(_0xa34a75,null));};exports['addApplications']=function(_0x4a5fd1,_0x4c1ca6,_0xf115d){return db['FaxAccount']['findOne']({'where':{'id':_0x4a5fd1['params']['id']}})['then'](handleEntityNotFound(_0x4c1ca6,null))['then'](function(_0x577aa5){if(_0x577aa5){return db[_0x0788('0x77')][_0x0788('0x78')](function(_0x55e987){return db[_0x0788('0x79')]['destroy']({'where':{'FaxAccountId':_0x4a5fd1[_0x0788('0x57')]['id']},'transaction':_0x55e987})['then'](function(_0x1c505e){var _0xeac33=_[_0x0788('0x41')](_0x4a5fd1[_0x0788('0x5b')],function(_0xd7b16f){_0xd7b16f[_0x0788('0x65')]=_0x4a5fd1[_0x0788('0x57')]['id'];return _0xd7b16f;});return db[_0x0788('0x79')][_0x0788('0x7a')](_0xeac33,{'transaction':_0x55e987});});})[_0x0788('0x3a')](function(){return db['FaxApplication'][_0x0788('0x7b')]({'where':{'FaxAccountId':_0x4a5fd1['params']['id']},'order':_0x0788('0x7c')});});}})['then'](respondWithResult(_0x4c1ca6,null))['catch'](handleError(_0x4c1ca6,null));};exports[_0x0788('0x7d')]=function(_0x1eee66,_0x18a9f2,_0x4ea339){var _0x376e37={};var _0x1b52f6={};var _0x5be647;var _0x5eb313;return db[_0x0788('0x3d')][_0x0788('0x67')]({'where':{'id':_0x1eee66[_0x0788('0x57')]['id']}})['then'](handleEntityNotFound(_0x18a9f2,null))['then'](function(_0x32df6f){if(_0x32df6f){_0x5be647=_0x32df6f;_0x1b52f6[_0x0788('0x46')]=_[_0x0788('0x43')](db[_0x0788('0x79')][_0x0788('0x3e')]);_0x1b52f6[_0x0788('0x42')]=_[_0x0788('0x43')](_0x1eee66[_0x0788('0x42')]);_0x1b52f6[_0x0788('0x44')]=_['intersection'](_0x1b52f6[_0x0788('0x46')],_0x1b52f6['query']);_0x376e37[_0x0788('0x49')]=_[_0x0788('0x45')](_0x1b52f6[_0x0788('0x46')],qs[_0x0788('0x47')](_0x1eee66[_0x0788('0x42')]['fields']));_0x376e37[_0x0788('0x49')]=_0x376e37[_0x0788('0x49')]['length']?_0x376e37[_0x0788('0x49')]:_0x1b52f6[_0x0788('0x46')];_0x376e37['order']=qs[_0x0788('0x4d')](_0x1eee66['query'][_0x0788('0x4d')]);_0x376e37[_0x0788('0x4f')]=qs['filters'](_[_0x0788('0x68')](_0x1eee66[_0x0788('0x42')],_0x1b52f6[_0x0788('0x44')]));if(_0x1eee66[_0x0788('0x42')][_0x0788('0x4e')]){_0x376e37[_0x0788('0x4f')]=_[_0x0788('0x50')](_0x376e37[_0x0788('0x4f')],{'$or':_['map'](_0x376e37[_0x0788('0x49')],function(_0xc9855c){var _0x3a30c5={};_0x3a30c5[_0xc9855c]={'$like':'%'+_0x1eee66['query']['filter']+'%'};return _0x3a30c5;})});}_0x376e37=_[_0x0788('0x50')]({},_0x376e37,_0x1eee66[_0x0788('0x52')]);return _0x5be647[_0x0788('0x7d')](_0x376e37);}})[_0x0788('0x3a')](function(_0x3760d1){if(_0x3760d1){_0x5eb313=_0x3760d1[_0x0788('0x48')];if(!_0x1eee66['query'][_0x0788('0x4a')](_0x0788('0x4b'))){_0x376e37[_0x0788('0x31')]=qs[_0x0788('0x31')](_0x1eee66[_0x0788('0x42')][_0x0788('0x31')]);_0x376e37[_0x0788('0x2e')]=qs[_0x0788('0x2e')](_0x1eee66[_0x0788('0x42')][_0x0788('0x2e')]);}return _0x5be647[_0x0788('0x7d')](_0x376e37);}})[_0x0788('0x3a')](function(_0x191690){if(_0x191690){return _0x191690?{'count':_0x5eb313,'rows':_0x191690}:null;}})[_0x0788('0x3a')](respondWithResult(_0x18a9f2,null))[_0x0788('0x56')](handleError(_0x18a9f2,null));};function Extension(_0x21cd8b,_0x3ffb9a,_0x1989c4,_0x2dfe0c){this[_0x0788('0x7e')]=_0x0788('0x7f');this['exten']=_0x21cd8b[_0x0788('0x80')];this[_0x0788('0x81')]=_0x2dfe0c;this[_0x0788('0x40')]=_0x0788('0x82');this['description']=_0x0788('0x83');this[_0x0788('0x65')]=_0x21cd8b['id'];this['priority']=_0x3ffb9a;this[_0x0788('0x84')]=_0x1989c4;}function createExtensionsReciveFax(_0x4a34e2){var _0x5c2b2b=0x1;var _0x5e9238=[];_0x5e9238['push'](new Extension(_0x4a34e2,_0x5c2b2b,'',_0x0788('0x85')));_0x5c2b2b+=0x1;_0x5e9238[_0x0788('0x86')](new Extension(_0x4a34e2,_0x5c2b2b,_0x0788('0x87'),_0x0788('0x88')));_0x5c2b2b+=0x1;for(var _0x463d51 in _0x4a34e2){if(_0x4a34e2[_0x0788('0x4a')](_0x463d51)&&(_0x463d51===_0x0788('0x89')||_0x463d51===_0x0788('0x80')||_0x463d51===_0x0788('0x8a')||_0x463d51===_0x0788('0x8b')||_0x463d51===_0x0788('0x8c')||_0x463d51===_0x0788('0x8d')||_0x463d51==='minrate'||_0x463d51===_0x0788('0x8e')||_0x463d51===_0x0788('0x8f'))){_0x5e9238['push'](new Extension(_0x4a34e2,_0x5c2b2b,_0x0788('0x90')+_0x463d51+')='+_0x4a34e2[_0x463d51],_0x0788('0x88')));_0x5c2b2b+=0x1;}}_0x5e9238[_0x0788('0x86')](new Extension(_0x4a34e2,_0x5c2b2b,'6',_0x0788('0x91')));_0x5c2b2b+=0x1;_0x5e9238[_0x0788('0x86')](new Extension(_0x4a34e2,_0x5c2b2b,_0x0788('0x92'),_0x0788('0x93')));_0x5c2b2b=0x0;return _0x5e9238;}exports[_0x0788('0x94')]=function(_0x2012f7,_0x2f5d4b,_0x973d5f){var _0x233482;return db[_0x0788('0x77')]['transaction'](function(_0x11de9c){return db[_0x0788('0x3d')]['create'](_0x2012f7['body'],{'transaction':_0x11de9c})[_0x0788('0x3a')](function(_0x1a6a97){_0x233482=_0x1a6a97['get']({'plain':!![]});return db[_0x0788('0x95')][_0x0788('0x7a')](createExtensionsReciveFax(_0x233482),{'transaction':_0x11de9c});});})[_0x0788('0x3a')](function(){return _0x233482;})['then'](respondWithResult(_0x2f5d4b,null))['catch'](handleError(_0x2f5d4b,null));};exports[_0x0788('0x96')]=function(_0x21adf8,_0x4db297,_0x5ad0b7){var _0x2ad898;return db[_0x0788('0x77')]['transaction'](function(_0x529978){return db[_0x0788('0x3d')][_0x0788('0x97')](_0x21adf8['body'],{'where':{'id':_0x21adf8[_0x0788('0x5b')]['id']},'transaction':_0x529978})[_0x0788('0x3a')](function(_0x5cf69e){return db[_0x0788('0x95')][_0x0788('0x37')]({'where':{'FaxAccountId':_0x21adf8[_0x0788('0x5b')]['id']},'transaction':_0x529978})[_0x0788('0x3a')](function(_0x12b844){return db['VoiceExtension'][_0x0788('0x7a')](createExtensionsReciveFax(_[_0x0788('0x98')](_0x21adf8[_0x0788('0x5b')],[_0x0788('0x99'),_0x0788('0x9a'),'createdAt',_0x0788('0x9b'),'TrunkId','ListId'])),{'transaction':_0x529978});});});})[_0x0788('0x3a')](function(){return db[_0x0788('0x3d')][_0x0788('0x9c')](_0x21adf8[_0x0788('0x5b')]['id']);})['then'](respondWithResult(_0x4db297,null))[_0x0788('0x56')](handleError(_0x4db297,null));};exports[_0x0788('0x9d')]=function(_0x11e477,_0x4ae7cd,_0x3ea229){var _0x23c172={'raw':!![],'where':{}};var _0x74d633={};var _0x4333a2={'count':0x0,'rows':[]};return db[_0x0788('0x3d')]['findOne']({'where':{'id':_0x11e477[_0x0788('0x57')]['id']}})['then'](handleEntityNotFound(_0x4ae7cd,null))[_0x0788('0x3a')](function(_0x28287d){if(_0x28287d){_0x74d633[_0x0788('0x46')]=_[_0x0788('0x43')](db[_0x0788('0x9e')]['rawAttributes']);_0x74d633[_0x0788('0x42')]=_['keys'](_0x11e477[_0x0788('0x42')]);_0x74d633['filters']=_[_0x0788('0x45')](_0x74d633[_0x0788('0x46')],_0x74d633['query']);_0x23c172[_0x0788('0x49')]=_[_0x0788('0x45')](_0x74d633[_0x0788('0x46')],qs[_0x0788('0x47')](_0x11e477[_0x0788('0x42')][_0x0788('0x47')]));_0x23c172[_0x0788('0x49')]=_0x23c172[_0x0788('0x49')][_0x0788('0x48')]?_0x23c172[_0x0788('0x49')]:_0x74d633[_0x0788('0x46')];if(!_0x11e477['query'][_0x0788('0x4a')]('nolimit')){_0x23c172[_0x0788('0x31')]=qs['limit'](_0x11e477[_0x0788('0x42')][_0x0788('0x31')]);_0x23c172['offset']=qs['offset'](_0x11e477['query'][_0x0788('0x2e')]);}_0x23c172['order']=qs['sort'](_0x11e477[_0x0788('0x42')][_0x0788('0x4d')]);_0x23c172[_0x0788('0x4f')]=qs['filters'](_[_0x0788('0x68')](_0x11e477[_0x0788('0x42')],_0x74d633[_0x0788('0x44')]));_0x23c172['where']['FaxAccountId']=_0x28287d['id'];if(_0x11e477[_0x0788('0x42')][_0x0788('0x4e')]){_0x23c172[_0x0788('0x4f')]=_['merge'](_0x23c172[_0x0788('0x4f')],{'$or':_[_0x0788('0x41')](_0x23c172[_0x0788('0x49')],function(_0x5c65e6){var _0x5c994b={};_0x5c994b[_0x5c65e6]={'$like':'%'+_0x11e477[_0x0788('0x42')]['filter']+'%'};return _0x5c994b;})});}if(_0x11e477[_0x0788('0x42')][_0x0788('0x9f')]){var _0x50fcd9=_0x11e477['query'][_0x0788('0x9f')][_0x0788('0xa0')](',');var _0x4abac2={};_0x4abac2[_0x50fcd9[0x0]]={'$gte':moment(_0x50fcd9[0x1])[_0x0788('0xa1')](_0x0788('0xa2'))};_0x23c172['where']=_[_0x0788('0x50')](_0x23c172[_0x0788('0x4f')],_0x4abac2);}_0x23c172=_[_0x0788('0x50')]({},_0x23c172,_0x11e477[_0x0788('0x52')]);return db['FaxMessage'][_0x0788('0x30')]({'where':_0x23c172[_0x0788('0x4f')]})[_0x0788('0x3a')](function(_0x3d7dd9){_0x4333a2[_0x0788('0x30')]=_0x3d7dd9;if(_0x11e477[_0x0788('0x42')][_0x0788('0x69')]){_0x23c172[_0x0788('0x53')]=[{'all':!![]}];}return db[_0x0788('0x9e')]['findAll'](_0x23c172);})[_0x0788('0x3a')](function(_0xaac879){_0x4333a2['rows']=_0xaac879;return _0x4333a2;});}})[_0x0788('0x3a')](respondWithFilteredResult(_0x4ae7cd,_0x23c172))[_0x0788('0x56')](handleError(_0x4ae7cd,null));};exports['send']=function(_0x5f1a46,_0x248f60,_0x3ccd23){var _0x42b7f4,_0x58eef7={},_0x2fb787;if(_0x5f1a46[_0x0788('0x5b')]['to']){_0x2fb787=_0x5f1a46[_0x0788('0x5b')]['to'][0x0];}return db['FaxAccount'][_0x0788('0x59')]({'where':{'id':_0x5f1a46[_0x0788('0x57')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x0788('0xa3'),'where':{'fax':_0x2fb787},'limit':0x1,'order':[[_0x0788('0x9b'),_0x0788('0xa4')]]}]}]})[_0x0788('0x3a')](handleEntityNotFound(_0x248f60,null))[_0x0788('0x3a')](function(_0x351665){_0x42b7f4=_0x351665;if(_0x5f1a46[_0x0788('0x5b')]['attachments']&&_0x5f1a46['body'][_0x0788('0xa5')][_0x0788('0x48')]){for(var _0x3f00b4=0x0;_0x3f00b4<_0x5f1a46['body'][_0x0788('0xa5')][_0x0788('0x48')];_0x3f00b4+=0x1){_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][_0x3f00b4]={'filename':_0x5f1a46['body']['attachments'][_0x3f00b4][_0x0788('0x3c')],'id':_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][_0x3f00b4]['id'],'path':path[_0x0788('0xa6')](config[_0x0788('0xa7')],_0x0788('0xa8'),_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][_0x3f00b4][_0x0788('0xa9')])};}}return respondWithRpcPromise('CheckAfterSend',_0x0788('0xaa'),{'FaxAccountId':_[_0x0788('0xab')](_0x5f1a46[_0x0788('0x57')]['id'])?undefined:_0x5f1a46[_0x0788('0x57')]['id'],'path':_[_0x0788('0xab')](_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][0x0]['path'])?undefined:_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][0x0][_0x0788('0x7')],'fax':_['isNil'](_0x5f1a46[_0x0788('0x5b')]['to'][0x0])?undefined:_0x5f1a46[_0x0788('0x5b')]['to'][0x0]},client9002);})[_0x0788('0x3a')](function(){if(_0x42b7f4){if(_[_0x0788('0xab')](_0x5f1a46[_0x0788('0x5b')]['from'])){_0x5f1a46['body']['from']=util[_0x0788('0xa1')](_0x0788('0xac'),_0x42b7f4[_0x0788('0x3c')],_0x42b7f4[_0x0788('0xad')]);}if(_0x42b7f4[_0x0788('0xae')]){if(_0x42b7f4[_0x0788('0xae')][_0x0788('0xa3')]['length']){return _0x42b7f4[_0x0788('0xae')][_0x0788('0xa3')][0x0];}else{return db[_0x0788('0xaf')][_0x0788('0x5a')](_['defaults'](_0x5f1a46[_0x0788('0x5b')],{'firstName':_0x5f1a46[_0x0788('0x5b')]['to'][0x0],'phone':_0x5f1a46[_0x0788('0x5b')]['to'][0x0],'fax':_0x5f1a46[_0x0788('0x5b')]['to'][0x0],'ListId':_0x42b7f4[_0x0788('0xb0')]}));}}else{throw new Error(_0x0788('0xb1'));}}else{throw new Error(_0x0788('0xb2'));}})[_0x0788('0x3a')](function(_0x2ce22d){if(_0x2ce22d){return db[_0x0788('0x70')][_0x0788('0x59')]({'where':{'ContactId':_0x2ce22d['id'],'closed':![],'FaxAccountId':_0x42b7f4['id']}})[_0x0788('0x3a')](function(_0x13c86e){if(_0x13c86e){return[_0x13c86e,![]];}return db[_0x0788('0x70')][_0x0788('0x5a')]({'UserId':_0x5f1a46['user']['id'],'ContactId':_0x2ce22d['id'],'FaxAccountId':_0x42b7f4['id'],'fax':_0x5f1a46[_0x0788('0x5b')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x0788('0x50')](_0x5f1a46[_0x0788('0x5b')],{'read':![],'body':_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][0x0][_0x0788('0xb3')],'FaxAccountId':_0x42b7f4['id'],'UserId':_0x5f1a46[_0x0788('0x5c')]['id'],'ContactId':_0x2ce22d['id'],'AttachmentId':_0x5f1a46[_0x0788('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x0788('0x9e')],'as':_0x0788('0xb4')}]})['then'](function(_0x2ec158){return[_0x2ec158,!![]];});});}else{throw new Error(_0x0788('0xb5'));}})[_0x0788('0xb6')](function(_0x515b8c,_0x588d9b){if(_0x588d9b){return _0x515b8c;}return db[_0x0788('0x9e')][_0x0788('0x5a')]({'direction':'out','read':![],'body':_0x5f1a46['body'][_0x0788('0xa5')][0x0]['filename'],'FaxAccountId':_0x42b7f4['id'],'FaxInteractionId':_0x515b8c['id'],'UserId':_0x5f1a46[_0x0788('0x5c')]['id'],'ContactId':_0x515b8c['ContactId'],'AttachmentId':_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][0x0]['id']})[_0x0788('0x3a')](function(_0x3ac8ce){_0x515b8c['dataValues']['Messages']=[];_0x515b8c[_0x0788('0xb7')][_0x0788('0xb4')][_0x0788('0x86')](_0x3ac8ce[_0x0788('0xb7')]);return _0x515b8c;});})['then'](function(_0x13fc23){respondWithRpcPromise(_0x0788('0xb8'),_0x0788('0xb8'),{'FaxAccountId':_[_0x0788('0xab')](_0x5f1a46['params']['id'])?undefined:_0x5f1a46[_0x0788('0x57')]['id'],'path':_[_0x0788('0xab')](_0x5f1a46['body'][_0x0788('0xa5')][0x0][_0x0788('0x7')])?undefined:_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][0x0][_0x0788('0x7')],'fax':_[_0x0788('0xab')](_0x5f1a46['body']['to'][0x0])?undefined:_0x5f1a46[_0x0788('0x5b')]['to'][0x0],'AttachmentId':_0x5f1a46[_0x0788('0x5b')][_0x0788('0xa5')][0x0]['id']},client9002)[_0x0788('0x3a')](function(_0x500c44){logger[_0x0788('0x22')]('SendFaxRpc,\x20%s',_0x500c44);})[_0x0788('0x56')](function(_0x578d3e){logger['info'](_0x0788('0xb9'),_0x578d3e);});return _0x13fc23;})[_0x0788('0x3a')](respondWithResult(_0x248f60,null))[_0x0788('0x56')](handleError(_0x248f60,null));};exports[_0x0788('0xba')]=function(_0x3f1716,_0x2d0b82,_0x253c8a){return db[_0x0788('0x3d')][_0x0788('0x59')]({'where':{'id':_0x3f1716[_0x0788('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d0b82,null))['then'](function(_0x523f74){if(_0x523f74){return _0x523f74[_0x0788('0xba')](_0x3f1716[_0x0788('0x5b')][_0x0788('0x6b')],_[_0x0788('0x98')](_0x3f1716[_0x0788('0x5b')],[_0x0788('0x6b'),'id'])||{})[_0x0788('0xb6')](function(_0x2ace5b){for(var _0x535263=0x0;_0x535263<_0x3f1716[_0x0788('0x5b')][_0x0788('0x6b')]['length'];_0x535263+=0x1){socket[_0x0788('0xbb')](_0x0788('0xbc'),{'UserId':_0x3f1716[_0x0788('0x5b')]['ids'][_0x535263],'FaxAccountId':_0x3f1716[_0x0788('0x57')]['id']});}return _0x2ace5b;});}})[_0x0788('0x3a')](respondWithResult(_0x2d0b82,null))[_0x0788('0x56')](handleError(_0x2d0b82,null));};exports[_0x0788('0xbd')]=function(_0x2be285,_0x85084c,_0x98bdf9){return db[_0x0788('0x3d')][_0x0788('0x59')]({'where':{'id':_0x2be285[_0x0788('0x57')]['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x85084c,null))[_0x0788('0x3a')](function(_0x4655f1){if(_0x4655f1){return _0x4655f1[_0x0788('0xbd')](_0x2be285[_0x0788('0x42')]['ids'])[_0x0788('0x3a')](function(){if(_[_0x0788('0xbe')](_0x2be285[_0x0788('0x42')]['ids'])){for(var _0x3dbcf4=0x0;_0x3dbcf4<_0x2be285[_0x0788('0x42')][_0x0788('0x6b')]['length'];_0x3dbcf4+=0x1){socket[_0x0788('0xbb')](_0x0788('0xbf'),{'UserId':Number(_0x2be285['query'][_0x0788('0x6b')][_0x3dbcf4]),'FaxAccountId':Number(_0x2be285[_0x0788('0x57')]['id'])});}}else{socket[_0x0788('0xbb')]('userFaxAccount:remove',{'UserId':Number(_0x2be285[_0x0788('0x42')]['ids']),'FaxAccountId':Number(_0x2be285['params']['id'])});}});}})[_0x0788('0x3a')](respondWithStatusCode(_0x85084c,null))[_0x0788('0x56')](handleError(_0x85084c,null));};exports[_0x0788('0xc0')]=function(_0x83913b,_0x5e9b26,_0x42f2d6){var _0x5bf415={};var _0x57a3b8={};var _0x55433b;var _0xcbbb45;return db['FaxAccount']['findOne']({'where':{'id':_0x83913b['params']['id']}})[_0x0788('0x3a')](handleEntityNotFound(_0x5e9b26,null))[_0x0788('0x3a')](function(_0x6981c4){if(_0x6981c4){_0x55433b=_0x6981c4;_0x57a3b8[_0x0788('0x46')]=_[_0x0788('0x43')](db[_0x0788('0xc1')][_0x0788('0x3e')]);_0x57a3b8[_0x0788('0x42')]=_[_0x0788('0x43')](_0x83913b[_0x0788('0x42')]);_0x57a3b8[_0x0788('0x44')]=_[_0x0788('0x45')](_0x57a3b8[_0x0788('0x46')],_0x57a3b8['query']);_0x5bf415[_0x0788('0x49')]=_['intersection'](_0x57a3b8[_0x0788('0x46')],qs[_0x0788('0x47')](_0x83913b[_0x0788('0x42')][_0x0788('0x47')]));_0x5bf415[_0x0788('0x49')]=_0x5bf415[_0x0788('0x49')]['length']?_0x5bf415[_0x0788('0x49')]:_0x57a3b8[_0x0788('0x46')];_0x5bf415[_0x0788('0x4c')]=qs[_0x0788('0x4d')](_0x83913b[_0x0788('0x42')][_0x0788('0x4d')]);_0x5bf415['where']=qs['filters'](_[_0x0788('0x68')](_0x83913b[_0x0788('0x42')],_0x57a3b8[_0x0788('0x44')]));if(_0x83913b[_0x0788('0x42')][_0x0788('0x4e')]){_0x5bf415['where']=_['merge'](_0x5bf415['where'],{'$or':_[_0x0788('0x41')](_0x5bf415[_0x0788('0x49')],function(_0x22e733){var _0x2d51ef={};_0x2d51ef[_0x22e733]={'$like':'%'+_0x83913b[_0x0788('0x42')][_0x0788('0x4e')]+'%'};return _0x2d51ef;})});}_0x5bf415=_[_0x0788('0x50')]({},_0x5bf415,_0x83913b[_0x0788('0x52')]);return _0x55433b[_0x0788('0xc0')](_0x5bf415);}})['then'](function(_0x4c304b){if(_0x4c304b){_0xcbbb45=_0x4c304b[_0x0788('0x48')];if(!_0x83913b[_0x0788('0x42')][_0x0788('0x4a')](_0x0788('0x4b'))){_0x5bf415[_0x0788('0x31')]=qs[_0x0788('0x31')](_0x83913b[_0x0788('0x42')][_0x0788('0x31')]);_0x5bf415[_0x0788('0x2e')]=qs[_0x0788('0x2e')](_0x83913b[_0x0788('0x42')][_0x0788('0x2e')]);}return _0x55433b[_0x0788('0xc0')](_0x5bf415);}})['then'](function(_0x2d6eee){if(_0x2d6eee){return _0x2d6eee?{'count':_0xcbbb45,'rows':_0x2d6eee}:null;}})[_0x0788('0x3a')](respondWithResult(_0x5e9b26,null))[_0x0788('0x56')](handleError(_0x5e9b26,null));};
\ No newline at end of file
+var _0xc2c7=['fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','findOne','Disposition','sort','include','removeDispositions','ids','CannedAnswer','rows','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','Owner','fullname','internal','tag','addApplications','transaction','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','localstationid','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm','gateway','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','bulkCreate','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection'];(function(_0x166833,_0x3762fa){var _0x2ebe30=function(_0x368bf4){while(--_0x368bf4){_0x166833['push'](_0x166833['shift']());}};_0x2ebe30(++_0x3762fa);}(_0xc2c7,0x134));var _0x7c2c=function(_0x270889,_0x418ff4){_0x270889=_0x270889-0x0;var _0x5f1615=_0xc2c7[_0x270889];return _0x5f1615;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];config[_0x7c2c('0x19')]=_[_0x7c2c('0x1a')](config[_0x7c2c('0x19')],{'host':_0x7c2c('0x1b'),'port':0x18eb});var socket=require(_0x7c2c('0x1c'))(new Redis(config[_0x7c2c('0x19')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x7c2c('0x1d'));var client=jayson[_0x7c2c('0x1e')][_0x7c2c('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x7c2c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x206ecd,_0x5e55e0,_0x88f54b,_0x5a5fe2){return new BPromise(function(_0x1aa355,_0x51b73c){var _0x342ea2=_0x5a5fe2||client;return _0x342ea2[_0x7c2c('0x20')](_0x206ecd,_0x88f54b)[_0x7c2c('0x21')](function(_0x2a9539){logger[_0x7c2c('0x22')](_0x7c2c('0x23'),_0x5e55e0,_0x7c2c('0x24'));logger[_0x7c2c('0x25')](_0x7c2c('0x26'),_0x5e55e0,_0x7c2c('0x24'),JSON[_0x7c2c('0x27')](_0x2a9539));if(_0x2a9539[_0x7c2c('0x28')]){if(_0x2a9539['error'][_0x7c2c('0x29')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5e55e0,_0x2a9539[_0x7c2c('0x28')][_0x7c2c('0x2a')]);return _0x51b73c(_0x2a9539[_0x7c2c('0x28')][_0x7c2c('0x2a')]);}logger[_0x7c2c('0x28')](_0x7c2c('0x23'),_0x5e55e0,_0x2a9539[_0x7c2c('0x28')]['message']);return _0x1aa355(_0x2a9539[_0x7c2c('0x28')]['message']);}else{logger[_0x7c2c('0x22')]('FaxAccount,\x20%s,\x20%s',_0x5e55e0,_0x7c2c('0x24'));_0x1aa355(_0x2a9539[_0x7c2c('0x2b')][_0x7c2c('0x2a')]);}})['catch'](function(_0x4d6ec7){logger[_0x7c2c('0x28')](_0x7c2c('0x23'),_0x5e55e0,_0x4d6ec7);_0x51b73c(_0x4d6ec7);});});}function respondWithStatusCode(_0x3d2b8d,_0x150690){_0x150690=_0x150690||0xcc;return function(_0x31d8f3){if(_0x31d8f3){return _0x3d2b8d[_0x7c2c('0x2c')](_0x150690);}return _0x3d2b8d[_0x7c2c('0x2d')](_0x150690)['end']();};}function respondWithResult(_0x358c67,_0xf39941){_0xf39941=_0xf39941||0xc8;return function(_0x3b2652){if(_0x3b2652){return _0x358c67[_0x7c2c('0x2d')](_0xf39941)[_0x7c2c('0x2e')](_0x3b2652);}};}function respondWithFilteredResult(_0x1f8846,_0xf2bfd1){return function(_0x26f472){if(_0x26f472){var _0xa040ff=typeof _0xf2bfd1['offset']===_0x7c2c('0x2f')&&typeof _0xf2bfd1[_0x7c2c('0x30')]===_0x7c2c('0x2f');var _0x720667=_0x26f472['count'];var _0xcb98ba=_0xa040ff?0x0:_0xf2bfd1[_0x7c2c('0x31')];var _0x4192c8=_0xa040ff?_0x26f472[_0x7c2c('0x32')]:_0xf2bfd1[_0x7c2c('0x31')]+_0xf2bfd1[_0x7c2c('0x30')];var _0x463ef7;if(_0x4192c8>=_0x720667){_0x4192c8=_0x720667;_0x463ef7=0xc8;}else{_0x463ef7=0xce;}_0x1f8846['status'](_0x463ef7);return _0x1f8846[_0x7c2c('0x33')](_0x7c2c('0x34'),_0xcb98ba+'-'+_0x4192c8+'/'+_0x720667)[_0x7c2c('0x2e')](_0x26f472);}return null;};}function patchUpdates(_0x1a8fce){return function(_0xf26fb3){try{jsonpatch['apply'](_0xf26fb3,_0x1a8fce,!![]);}catch(_0x47ef3c){return BPromise[_0x7c2c('0x35')](_0x47ef3c);}return _0xf26fb3['save']();};}function saveUpdates(_0x4b97bb,_0x15ee13){return function(_0x31b1f2){if(_0x31b1f2){return _0x31b1f2[_0x7c2c('0x36')](_0x4b97bb)[_0x7c2c('0x21')](function(_0x536dcf){return _0x536dcf;});}return null;};}function removeEntity(_0x447a52,_0x38a937){return function(_0x3980ba){if(_0x3980ba){return _0x3980ba[_0x7c2c('0x37')]()[_0x7c2c('0x21')](function(){var _0x6ef8c4=_0x3980ba[_0x7c2c('0x38')]({'plain':!![]});var _0xab5072=_0x7c2c('0x39');return db[_0x7c2c('0x3a')][_0x7c2c('0x37')]({'where':{'type':_0xab5072,'resourceId':_0x6ef8c4['id']}})[_0x7c2c('0x21')](function(){return _0x3980ba;});})[_0x7c2c('0x21')](function(){_0x447a52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd30d,_0x4acc5d){return function(_0x4c421c){if(!_0x4c421c){_0x3cd30d['sendStatus'](0x194);}return _0x4c421c;};}function handleError(_0x28e3cc,_0xc77f11){_0xc77f11=_0xc77f11||0x1f4;return function(_0x129bf0){logger[_0x7c2c('0x28')](_0x129bf0[_0x7c2c('0x3b')]);if(_0x129bf0[_0x7c2c('0x3c')]){delete _0x129bf0[_0x7c2c('0x3c')];}_0x28e3cc[_0x7c2c('0x2d')](_0xc77f11)[_0x7c2c('0x3d')](_0x129bf0);};}exports[_0x7c2c('0x3e')]=function(_0x6a9b35,_0x58696a){var _0x4c7402={'include':[{'model':db[_0x7c2c('0x3f')],'as':_0x7c2c('0x40')}]},_0x3920b6={},_0x360928={'count':0x0,'rows':[]};var _0x5e8c96=_[_0x7c2c('0x41')](db[_0x7c2c('0x42')][_0x7c2c('0x43')],function(_0x45fddf){return{'name':_0x45fddf[_0x7c2c('0x44')],'type':_0x45fddf[_0x7c2c('0x45')][_0x7c2c('0x46')]};});_0x3920b6[_0x7c2c('0x47')]=_[_0x7c2c('0x41')](_0x5e8c96,'name');_0x3920b6[_0x7c2c('0x48')]=_['keys'](_0x6a9b35[_0x7c2c('0x48')]);_0x3920b6[_0x7c2c('0x49')]=_['intersection'](_0x3920b6[_0x7c2c('0x47')],_0x3920b6['query']);_0x4c7402[_0x7c2c('0x4a')]=_[_0x7c2c('0x4b')](_0x3920b6[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x6a9b35['query'][_0x7c2c('0x4c')]));_0x4c7402['attributes']=_0x4c7402['attributes'][_0x7c2c('0x4d')]?_0x4c7402[_0x7c2c('0x4a')]:_0x3920b6[_0x7c2c('0x47')];if(!_0x6a9b35['query'][_0x7c2c('0x4e')](_0x7c2c('0x4f'))){_0x4c7402['limit']=qs[_0x7c2c('0x30')](_0x6a9b35['query'][_0x7c2c('0x30')]);_0x4c7402[_0x7c2c('0x31')]=qs['offset'](_0x6a9b35['query'][_0x7c2c('0x31')]);}_0x4c7402[_0x7c2c('0x50')]=qs['sort'](_0x6a9b35[_0x7c2c('0x48')]['sort']);_0x4c7402['where']=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x6a9b35[_0x7c2c('0x48')],_0x3920b6[_0x7c2c('0x49')]),_0x5e8c96);if(_0x6a9b35[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x4c7402[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x4c7402[_0x7c2c('0x53')],{'$or':_['map'](_0x5e8c96,function(_0x57eaf8){if(_0x57eaf8[_0x7c2c('0x45')]!==_0x7c2c('0x55')){var _0x3ce2fb={};_0x3ce2fb[_0x57eaf8['name']]={'$like':'%'+_0x6a9b35['query'][_0x7c2c('0x52')]+'%'};return _0x3ce2fb;}})});}_0x4c7402=_[_0x7c2c('0x54')]({},_0x4c7402,_0x6a9b35[_0x7c2c('0x56')]);var _0x2b79d5={'where':_0x4c7402['where']};return db['FaxAccount']['count'](_0x2b79d5)[_0x7c2c('0x21')](function(_0x36184a){_0x360928[_0x7c2c('0x32')]=_0x36184a;if(_0x6a9b35[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x4c7402['include']=[{'all':!![]}];}return db[_0x7c2c('0x42')][_0x7c2c('0x58')](_0x4c7402);})['then'](function(_0x19621a){_0x360928['rows']=_0x19621a;return _0x360928;})[_0x7c2c('0x21')](respondWithFilteredResult(_0x58696a,_0x4c7402))[_0x7c2c('0x59')](handleError(_0x58696a,null));};exports[_0x7c2c('0x5a')]=function(_0x55e123,_0x5835cd){var _0x327f3a={'raw':![],'where':{'id':_0x55e123[_0x7c2c('0x5b')]['id']},'include':[{'model':db[_0x7c2c('0x3f')],'as':'mandatoryDispositionPause'}]},_0x5e4bc3={};_0x5e4bc3[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db['FaxAccount'][_0x7c2c('0x43')]);_0x5e4bc3[_0x7c2c('0x48')]=_['keys'](_0x55e123[_0x7c2c('0x48')]);_0x5e4bc3[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x5e4bc3['model'],_0x5e4bc3[_0x7c2c('0x48')]);_0x327f3a['attributes']=_[_0x7c2c('0x4b')](_0x5e4bc3[_0x7c2c('0x47')],qs['fields'](_0x55e123[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x327f3a[_0x7c2c('0x4a')]=_0x327f3a[_0x7c2c('0x4a')]['length']?_0x327f3a[_0x7c2c('0x4a')]:_0x5e4bc3[_0x7c2c('0x47')];if(_0x55e123['query'][_0x7c2c('0x57')]){_0x327f3a['include']=[{'all':!![]}];}_0x327f3a=_[_0x7c2c('0x54')]({},_0x327f3a,_0x55e123[_0x7c2c('0x56')]);return db[_0x7c2c('0x42')][_0x7c2c('0x5d')](_0x327f3a)[_0x7c2c('0x21')](handleEntityNotFound(_0x5835cd,null))['then'](respondWithResult(_0x5835cd,null))[_0x7c2c('0x59')](handleError(_0x5835cd,null));};exports[_0x7c2c('0x5e')]=function(_0x4c4661,_0x53025a){return db['FaxAccount'][_0x7c2c('0x5e')](_0x4c4661['body'],{})[_0x7c2c('0x21')](function(_0x4bcef3){var _0x469515=_0x4c4661[_0x7c2c('0x5f')][_0x7c2c('0x38')]({'plain':!![]});if(!_0x469515)throw new Error(_0x7c2c('0x60'));if(_0x469515[_0x7c2c('0x61')]===_0x7c2c('0x5f')){var _0x2bb0f8=_0x4bcef3[_0x7c2c('0x38')]({'plain':!![]});var _0x5eb300='FaxAccounts';return db['UserProfileSection'][_0x7c2c('0x5d')]({'where':{'name':_0x5eb300,'userProfileId':_0x469515[_0x7c2c('0x62')]},'raw':!![]})[_0x7c2c('0x21')](function(_0x299c15){if(_0x299c15&&_0x299c15[_0x7c2c('0x63')]===0x0){return db[_0x7c2c('0x3a')][_0x7c2c('0x5e')]({'name':_0x2bb0f8[_0x7c2c('0x3c')],'resourceId':_0x2bb0f8['id'],'type':_0x299c15['name'],'sectionId':_0x299c15['id']},{})['then'](function(){return _0x4bcef3;});}else{return _0x4bcef3;}})[_0x7c2c('0x59')](function(_0x1b8126){logger['error'](_0x7c2c('0x64'),_0x1b8126);throw _0x1b8126;});}return _0x4bcef3;})['then'](respondWithResult(_0x53025a,0xc9))['catch'](handleError(_0x53025a,null));};exports[_0x7c2c('0x36')]=function(_0x118728,_0x2b4b31){if(_0x118728[_0x7c2c('0x65')]['id']){delete _0x118728[_0x7c2c('0x65')]['id'];}return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x118728[_0x7c2c('0x5b')]['id']},'include':[{'model':db[_0x7c2c('0x3f')],'as':_0x7c2c('0x40')}]})[_0x7c2c('0x21')](handleEntityNotFound(_0x2b4b31,null))[_0x7c2c('0x21')](saveUpdates(_0x118728[_0x7c2c('0x65')],null))[_0x7c2c('0x21')](respondWithResult(_0x2b4b31,null))['catch'](handleError(_0x2b4b31,null));};exports[_0x7c2c('0x37')]=function(_0x5404ec,_0x489f2c){return db['FaxAccount']['find']({'where':{'id':_0x5404ec[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x489f2c,null))[_0x7c2c('0x21')](removeEntity(_0x489f2c,null))[_0x7c2c('0x59')](handleError(_0x489f2c,null));};exports[_0x7c2c('0x66')]=function(_0x117f2a,_0x59e46d){return db[_0x7c2c('0x42')][_0x7c2c('0x66')]()[_0x7c2c('0x21')](respondWithResult(_0x59e46d,null))[_0x7c2c('0x59')](handleError(_0x59e46d,null));};exports[_0x7c2c('0x67')]=function(_0x43abd8,_0x49f520,_0x289091){if(_0x43abd8[_0x7c2c('0x65')]['id']){delete _0x43abd8['body']['id'];}return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x43abd8['params']['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x49f520,null))[_0x7c2c('0x21')](function(_0x5605ef){if(_0x5605ef){_0x43abd8['body'][_0x7c2c('0x68')]=_0x5605ef['id'];return db['Disposition'][_0x7c2c('0x5e')](_0x43abd8['body']);}})[_0x7c2c('0x21')](respondWithResult(_0x49f520,null))[_0x7c2c('0x59')](handleError(_0x49f520,null));};exports['getDispositions']=function(_0x222362,_0x5285f2,_0x1fe241){var _0x2b597d={'raw':![],'where':{}};var _0x20eb63={};var _0x56f737={'count':0x0,'rows':[]};return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x222362[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x5285f2,null))['then'](function(_0x158352){if(_0x158352){_0x20eb63[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x6a')][_0x7c2c('0x43')]);_0x20eb63[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x222362[_0x7c2c('0x48')]);_0x20eb63[_0x7c2c('0x49')]=_['intersection'](_0x20eb63[_0x7c2c('0x47')],_0x20eb63[_0x7c2c('0x48')]);_0x2b597d['attributes']=_[_0x7c2c('0x4b')](_0x20eb63['model'],qs['fields'](_0x222362[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x2b597d[_0x7c2c('0x4a')]=_0x2b597d['attributes'][_0x7c2c('0x4d')]?_0x2b597d[_0x7c2c('0x4a')]:_0x20eb63[_0x7c2c('0x47')];if(!_0x222362['query'][_0x7c2c('0x4e')](_0x7c2c('0x4f'))){_0x2b597d[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x222362['query'][_0x7c2c('0x30')]);_0x2b597d['offset']=qs[_0x7c2c('0x31')](_0x222362['query'][_0x7c2c('0x31')]);}_0x2b597d[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x222362[_0x7c2c('0x48')][_0x7c2c('0x6b')]);_0x2b597d[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_['pick'](_0x222362[_0x7c2c('0x48')],_0x20eb63[_0x7c2c('0x49')]));_0x2b597d[_0x7c2c('0x53')][_0x7c2c('0x68')]=_0x158352['id'];if(_0x222362[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x2b597d[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x2b597d['where'],{'$or':_[_0x7c2c('0x41')](_0x2b597d[_0x7c2c('0x4a')],function(_0x2391a7){var _0x308cdc={};_0x308cdc[_0x2391a7]={'$like':'%'+_0x222362[_0x7c2c('0x48')]['filter']+'%'};return _0x308cdc;})});}_0x2b597d=_[_0x7c2c('0x54')]({},_0x2b597d,_0x222362[_0x7c2c('0x56')]);return db['Disposition'][_0x7c2c('0x32')]({'where':_0x2b597d[_0x7c2c('0x53')]})['then'](function(_0x2d8d84){_0x56f737['count']=_0x2d8d84;if(_0x222362[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x2b597d[_0x7c2c('0x6c')]=[{'all':!![]}];}return db[_0x7c2c('0x6a')][_0x7c2c('0x58')](_0x2b597d);})[_0x7c2c('0x21')](function(_0x3fe323){_0x56f737['rows']=_0x3fe323;return _0x56f737;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0x5285f2,_0x2b597d))[_0x7c2c('0x59')](handleError(_0x5285f2,null));};exports['removeDispositions']=function(_0x33b491,_0x333a76,_0x2a188c){return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x33b491[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x333a76,null))[_0x7c2c('0x21')](function(_0x14fcb5){if(_0x14fcb5){return _0x14fcb5[_0x7c2c('0x6d')](_0x33b491[_0x7c2c('0x48')][_0x7c2c('0x6e')]);}})[_0x7c2c('0x21')](respondWithStatusCode(_0x333a76,null))[_0x7c2c('0x59')](handleError(_0x333a76,null));};exports['addAnswer']=function(_0x3e666f,_0x2bddbc,_0x551c44){if(_0x3e666f[_0x7c2c('0x65')]['id']){delete _0x3e666f[_0x7c2c('0x65')]['id'];}return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x3e666f[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2bddbc,null))[_0x7c2c('0x21')](function(_0x13dec1){if(_0x13dec1){_0x3e666f[_0x7c2c('0x65')]['FaxAccountId']=_0x13dec1['id'];return db[_0x7c2c('0x6f')][_0x7c2c('0x5e')](_0x3e666f[_0x7c2c('0x65')]);}})['then'](respondWithResult(_0x2bddbc,null))[_0x7c2c('0x59')](handleError(_0x2bddbc,null));};exports['getAnswers']=function(_0x342022,_0x5f2a6b,_0x481479){var _0x1684db={'raw':![],'where':{}};var _0x1a9698={};var _0x97011a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7c2c('0x69')]({'where':{'id':_0x342022[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x5f2a6b,null))[_0x7c2c('0x21')](function(_0x4d944d){if(_0x4d944d){_0x1a9698[_0x7c2c('0x47')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1a9698['query']=_['keys'](_0x342022[_0x7c2c('0x48')]);_0x1a9698[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x1a9698[_0x7c2c('0x47')],_0x1a9698[_0x7c2c('0x48')]);_0x1684db['attributes']=_[_0x7c2c('0x4b')](_0x1a9698[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x1684db[_0x7c2c('0x4a')]=_0x1684db['attributes']['length']?_0x1684db[_0x7c2c('0x4a')]:_0x1a9698[_0x7c2c('0x47')];if(!_0x342022[_0x7c2c('0x48')][_0x7c2c('0x4e')]('nolimit')){_0x1684db[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x30')]);_0x1684db[_0x7c2c('0x31')]=qs[_0x7c2c('0x31')](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x31')]);}_0x1684db[_0x7c2c('0x50')]=qs['sort'](_0x342022[_0x7c2c('0x48')][_0x7c2c('0x6b')]);_0x1684db['where']=qs[_0x7c2c('0x49')](_['pick'](_0x342022[_0x7c2c('0x48')],_0x1a9698['filters']));_0x1684db[_0x7c2c('0x53')][_0x7c2c('0x68')]=_0x4d944d['id'];if(_0x342022[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x1684db[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x1684db[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x1684db[_0x7c2c('0x4a')],function(_0x4cd396){var _0x3b062e={};_0x3b062e[_0x4cd396]={'$like':'%'+_0x342022[_0x7c2c('0x48')][_0x7c2c('0x52')]+'%'};return _0x3b062e;})});}_0x1684db=_['merge']({},_0x1684db,_0x342022[_0x7c2c('0x56')]);return db[_0x7c2c('0x6f')]['count']({'where':_0x1684db[_0x7c2c('0x53')]})['then'](function(_0x11244c){_0x97011a['count']=_0x11244c;if(_0x342022[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x1684db[_0x7c2c('0x6c')]=[{'all':!![]}];}return db[_0x7c2c('0x6f')]['findAll'](_0x1684db);})[_0x7c2c('0x21')](function(_0x15db4c){_0x97011a[_0x7c2c('0x70')]=_0x15db4c;return _0x97011a;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0x5f2a6b,_0x1684db))[_0x7c2c('0x59')](handleError(_0x5f2a6b,null));};exports[_0x7c2c('0x71')]=function(_0x5c2983,_0x117076,_0x4c1f7e){return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x5c2983['params']['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x117076,null))[_0x7c2c('0x21')](function(_0x5e5c7c){if(_0x5e5c7c){return _0x5e5c7c[_0x7c2c('0x71')](_0x5c2983[_0x7c2c('0x48')][_0x7c2c('0x6e')]);}})['then'](respondWithStatusCode(_0x117076,null))['catch'](handleError(_0x117076,null));};exports[_0x7c2c('0x72')]=function(_0x6ffda9,_0x251235,_0x3f614b){return db[_0x7c2c('0x73')][_0x7c2c('0x5d')]({'where':{'id':_0x6ffda9[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x251235,null))[_0x7c2c('0x21')](function(_0x48ed26){if(_0x48ed26){return _0x48ed26['addInteraction'](_0x6ffda9[_0x7c2c('0x65')][_0x7c2c('0x6e')],_[_0x7c2c('0x74')](_0x6ffda9[_0x7c2c('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x251235,null))[_0x7c2c('0x59')](handleError(_0x251235,null));};exports[_0x7c2c('0x75')]=function(_0x4a0cfb,_0xd93d75,_0x5c83de){var _0x51078c={'raw':![],'where':{}};var _0x5692c1={};var _0x30774d={'count':0x0,'rows':[]};return db['FaxAccount'][_0x7c2c('0x69')]({'where':{'id':_0x4a0cfb[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0xd93d75,null))[_0x7c2c('0x21')](function(_0x4fd8a2){if(_0x4fd8a2){_0x5692c1[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x73')][_0x7c2c('0x43')]);_0x5692c1[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x4a0cfb[_0x7c2c('0x48')]);_0x5692c1['filters']=_[_0x7c2c('0x4b')](_0x5692c1['model'],_0x5692c1[_0x7c2c('0x48')]);_0x51078c[_0x7c2c('0x4a')]=_[_0x7c2c('0x4b')](_0x5692c1[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x4a0cfb['query'][_0x7c2c('0x4c')]));_0x51078c[_0x7c2c('0x4a')]=_0x51078c['attributes'][_0x7c2c('0x4d')]?_0x51078c['attributes']:_0x5692c1[_0x7c2c('0x47')];if(!_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x4e')]('nolimit')){_0x51078c[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x4a0cfb[_0x7c2c('0x48')]['limit']);_0x51078c[_0x7c2c('0x31')]=qs['offset'](_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x31')]);}_0x51078c[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x6b')]);_0x51078c['where']=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x4a0cfb['query'],_0x5692c1[_0x7c2c('0x49')]));_0x51078c[_0x7c2c('0x53')][_0x7c2c('0x68')]=_0x4fd8a2['id'];if(_0x4a0cfb[_0x7c2c('0x48')]['filter']){_0x51078c['where']=_[_0x7c2c('0x54')](_0x51078c['where'],{'$or':_['map'](_0x51078c[_0x7c2c('0x4a')],function(_0x4356e7){var _0x53c0dd={};_0x53c0dd[_0x4356e7]={'$like':'%'+_0x4a0cfb['query']['filter']+'%'};return _0x53c0dd;})});}_0x51078c=_[_0x7c2c('0x54')]({},_0x51078c,_0x4a0cfb['options']);return db['FaxInteraction'][_0x7c2c('0x32')]({'where':_0x51078c['where']})[_0x7c2c('0x21')](function(_0x3f21d1){_0x30774d[_0x7c2c('0x32')]=_0x3f21d1;if(_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x51078c['include']=[{'model':db[_0x7c2c('0x76')],'as':'Contact','required':![]},{'model':db[_0x7c2c('0x77')],'as':_0x7c2c('0x78'),'attributes':[_0x7c2c('0x3c'),_0x7c2c('0x79'),_0x7c2c('0x7a')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x7b')]?{'id':_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x7b')]}:undefined,'required':_0x4a0cfb[_0x7c2c('0x48')][_0x7c2c('0x7b')]?!![]:![]}];}return db[_0x7c2c('0x73')][_0x7c2c('0x58')](_0x51078c);})[_0x7c2c('0x21')](function(_0x58afc2){_0x30774d[_0x7c2c('0x70')]=_0x58afc2;return _0x30774d;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0xd93d75,_0x51078c))[_0x7c2c('0x59')](handleError(_0xd93d75,null));};exports[_0x7c2c('0x7c')]=function(_0x160969,_0x17e4b9,_0x3ab9a6){return db['FaxAccount'][_0x7c2c('0x69')]({'where':{'id':_0x160969['params']['id']}})['then'](handleEntityNotFound(_0x17e4b9,null))[_0x7c2c('0x21')](function(_0x457561){if(_0x457561){return db['sequelize'][_0x7c2c('0x7d')](function(_0x2e29b9){return db[_0x7c2c('0x7e')][_0x7c2c('0x37')]({'where':{'FaxAccountId':_0x160969[_0x7c2c('0x5b')]['id']},'transaction':_0x2e29b9})[_0x7c2c('0x21')](function(_0x4c2811){var _0x1f318c=_[_0x7c2c('0x41')](_0x160969[_0x7c2c('0x65')],function(_0x15048a){_0x15048a[_0x7c2c('0x68')]=_0x160969[_0x7c2c('0x5b')]['id'];return _0x15048a;});return db[_0x7c2c('0x7e')]['bulkCreate'](_0x1f318c,{'transaction':_0x2e29b9});});})[_0x7c2c('0x21')](function(){return db[_0x7c2c('0x7e')][_0x7c2c('0x7f')]({'where':{'FaxAccountId':_0x160969['params']['id']},'order':_0x7c2c('0x80')});});}})[_0x7c2c('0x21')](respondWithResult(_0x17e4b9,null))[_0x7c2c('0x59')](handleError(_0x17e4b9,null));};exports[_0x7c2c('0x81')]=function(_0x3ae9fc,_0x42ecc2,_0x3416f3){var _0x450016={};var _0x3389a0={};var _0x16dc25;var _0x2fc37d;return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x3ae9fc[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x42ecc2,null))['then'](function(_0x2b6b19){if(_0x2b6b19){_0x16dc25=_0x2b6b19;_0x3389a0['model']=_[_0x7c2c('0x5c')](db[_0x7c2c('0x7e')]['rawAttributes']);_0x3389a0[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x3ae9fc['query']);_0x3389a0['filters']=_[_0x7c2c('0x4b')](_0x3389a0[_0x7c2c('0x47')],_0x3389a0[_0x7c2c('0x48')]);_0x450016[_0x7c2c('0x4a')]=_['intersection'](_0x3389a0['model'],qs[_0x7c2c('0x4c')](_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x450016[_0x7c2c('0x4a')]=_0x450016['attributes'][_0x7c2c('0x4d')]?_0x450016[_0x7c2c('0x4a')]:_0x3389a0[_0x7c2c('0x47')];_0x450016[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x3ae9fc['query'][_0x7c2c('0x6b')]);_0x450016[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x3ae9fc['query'],_0x3389a0[_0x7c2c('0x49')]));if(_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x450016['where']=_['merge'](_0x450016[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x450016['attributes'],function(_0x2d1397){var _0x3e23a2={};_0x3e23a2[_0x2d1397]={'$like':'%'+_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x52')]+'%'};return _0x3e23a2;})});}_0x450016=_['merge']({},_0x450016,_0x3ae9fc[_0x7c2c('0x56')]);return _0x16dc25[_0x7c2c('0x81')](_0x450016);}})[_0x7c2c('0x21')](function(_0x22f3aa){if(_0x22f3aa){_0x2fc37d=_0x22f3aa[_0x7c2c('0x4d')];if(!_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x4e')](_0x7c2c('0x4f'))){_0x450016['limit']=qs[_0x7c2c('0x30')](_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x30')]);_0x450016[_0x7c2c('0x31')]=qs[_0x7c2c('0x31')](_0x3ae9fc[_0x7c2c('0x48')][_0x7c2c('0x31')]);}return _0x16dc25['getApplications'](_0x450016);}})[_0x7c2c('0x21')](function(_0x1692cd){if(_0x1692cd){return _0x1692cd?{'count':_0x2fc37d,'rows':_0x1692cd}:null;}})[_0x7c2c('0x21')](respondWithResult(_0x42ecc2,null))['catch'](handleError(_0x42ecc2,null));};function Extension(_0x1c1005,_0x39545f,_0x39c65d,_0x21f7a6){this['context']=_0x7c2c('0x82');this['exten']=_0x1c1005[_0x7c2c('0x83')];this['app']=_0x21f7a6;this[_0x7c2c('0x45')]=_0x7c2c('0x84');this[_0x7c2c('0x85')]=_0x7c2c('0x86');this['FaxAccountId']=_0x1c1005['id'];this[_0x7c2c('0x80')]=_0x39545f;this['appdata']=_0x39c65d;}function createExtensionsReciveFax(_0x28119b){var _0x8f790f=0x1;var _0x4b8ada=[];_0x4b8ada[_0x7c2c('0x87')](new Extension(_0x28119b,_0x8f790f,'','Answer'));_0x8f790f+=0x1;_0x4b8ada['push'](new Extension(_0x28119b,_0x8f790f,_0x7c2c('0x88'),'Set'));_0x8f790f+=0x1;for(var _0x165179 in _0x28119b){if(_0x28119b[_0x7c2c('0x4e')](_0x165179)&&(_0x165179===_0x7c2c('0x89')||_0x165179===_0x7c2c('0x83')||_0x165179===_0x7c2c('0x8a')||_0x165179==='faxdetect'||_0x165179===_0x7c2c('0x8b')||_0x165179===_0x7c2c('0x8c')||_0x165179===_0x7c2c('0x8d')||_0x165179==='modem'||_0x165179===_0x7c2c('0x8e'))){_0x4b8ada[_0x7c2c('0x87')](new Extension(_0x28119b,_0x8f790f,_0x7c2c('0x8f')+_0x165179+')='+_0x28119b[_0x165179],'Set'));_0x8f790f+=0x1;}}_0x4b8ada[_0x7c2c('0x87')](new Extension(_0x28119b,_0x8f790f,'6',_0x7c2c('0x90')));_0x8f790f+=0x1;_0x4b8ada['push'](new Extension(_0x28119b,_0x8f790f,_0x7c2c('0x91'),_0x7c2c('0x92')));_0x8f790f=0x0;return _0x4b8ada;}exports[_0x7c2c('0x93')]=function(_0x350c95,_0x501a08,_0x3b4a14){var _0x110fba;return db[_0x7c2c('0x94')]['transaction'](function(_0xa623a){return db[_0x7c2c('0x42')]['create'](_0x350c95[_0x7c2c('0x65')],{'transaction':_0xa623a})['then'](function(_0x22b323){_0x110fba=_0x22b323[_0x7c2c('0x38')]({'plain':!![]});return db['VoiceExtension'][_0x7c2c('0x95')](createExtensionsReciveFax(_0x110fba),{'transaction':_0xa623a});});})[_0x7c2c('0x21')](function(){return _0x110fba;})[_0x7c2c('0x21')](respondWithResult(_0x501a08,null))[_0x7c2c('0x59')](handleError(_0x501a08,null));};exports[_0x7c2c('0x96')]=function(_0x1396e1,_0x5422cc,_0x152022){var _0x130bfd;return db[_0x7c2c('0x94')][_0x7c2c('0x7d')](function(_0x2fd6d8){return db[_0x7c2c('0x42')]['update'](_0x1396e1[_0x7c2c('0x65')],{'where':{'id':_0x1396e1[_0x7c2c('0x65')]['id']},'transaction':_0x2fd6d8})[_0x7c2c('0x21')](function(_0xf320b){return db[_0x7c2c('0x97')][_0x7c2c('0x37')]({'where':{'FaxAccountId':_0x1396e1[_0x7c2c('0x65')]['id']},'transaction':_0x2fd6d8})['then'](function(_0x349d46){return db[_0x7c2c('0x97')][_0x7c2c('0x95')](createExtensionsReciveFax(_['omit'](_0x1396e1[_0x7c2c('0x65')],[_0x7c2c('0x98'),_0x7c2c('0x46'),_0x7c2c('0x99'),_0x7c2c('0x9a'),_0x7c2c('0x9b'),_0x7c2c('0x9c')])),{'transaction':_0x2fd6d8});});});})[_0x7c2c('0x21')](function(){return db[_0x7c2c('0x42')][_0x7c2c('0x9d')](_0x1396e1[_0x7c2c('0x65')]['id']);})[_0x7c2c('0x21')](respondWithResult(_0x5422cc,null))[_0x7c2c('0x59')](handleError(_0x5422cc,null));};exports[_0x7c2c('0x9e')]=function(_0x51cea0,_0x422c09,_0x3ab457){var _0x442c1d={'raw':!![],'where':{}};var _0x3a1411={};var _0x190f8c={'count':0x0,'rows':[]};return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x51cea0[_0x7c2c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x422c09,null))[_0x7c2c('0x21')](function(_0x545199){if(_0x545199){_0x3a1411[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x9f')][_0x7c2c('0x43')]);_0x3a1411['query']=_[_0x7c2c('0x5c')](_0x51cea0[_0x7c2c('0x48')]);_0x3a1411[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x3a1411[_0x7c2c('0x47')],_0x3a1411['query']);_0x442c1d[_0x7c2c('0x4a')]=_[_0x7c2c('0x4b')](_0x3a1411[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x51cea0[_0x7c2c('0x48')]['fields']));_0x442c1d[_0x7c2c('0x4a')]=_0x442c1d[_0x7c2c('0x4a')][_0x7c2c('0x4d')]?_0x442c1d[_0x7c2c('0x4a')]:_0x3a1411['model'];if(!_0x51cea0[_0x7c2c('0x48')]['hasOwnProperty'](_0x7c2c('0x4f'))){_0x442c1d[_0x7c2c('0x30')]=qs['limit'](_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x30')]);_0x442c1d['offset']=qs[_0x7c2c('0x31')](_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x31')]);}_0x442c1d[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x51cea0[_0x7c2c('0x48')]['sort']);_0x442c1d[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x51cea0[_0x7c2c('0x48')],_0x3a1411['filters']));_0x442c1d['where'][_0x7c2c('0x68')]=_0x545199['id'];if(_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x442c1d[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x442c1d[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x442c1d[_0x7c2c('0x4a')],function(_0x1a8847){var _0x5dcd29={};_0x5dcd29[_0x1a8847]={'$like':'%'+_0x51cea0['query']['filter']+'%'};return _0x5dcd29;})});}if(_0x51cea0['query']['$gte']){var _0x590f52=_0x51cea0['query'][_0x7c2c('0xa0')][_0x7c2c('0xa1')](',');var _0x5653dc={};_0x5653dc[_0x590f52[0x0]]={'$gte':moment(_0x590f52[0x1])[_0x7c2c('0xa2')](_0x7c2c('0xa3'))};_0x442c1d['where']=_[_0x7c2c('0x54')](_0x442c1d[_0x7c2c('0x53')],_0x5653dc);}_0x442c1d=_['merge']({},_0x442c1d,_0x51cea0[_0x7c2c('0x56')]);return db[_0x7c2c('0x9f')]['count']({'where':_0x442c1d[_0x7c2c('0x53')]})[_0x7c2c('0x21')](function(_0x549469){_0x190f8c[_0x7c2c('0x32')]=_0x549469;if(_0x51cea0[_0x7c2c('0x48')][_0x7c2c('0x57')]){_0x442c1d[_0x7c2c('0x6c')]=[{'all':!![]}];}return db['FaxMessage'][_0x7c2c('0x58')](_0x442c1d);})[_0x7c2c('0x21')](function(_0x28ba24){_0x190f8c[_0x7c2c('0x70')]=_0x28ba24;return _0x190f8c;});}})[_0x7c2c('0x21')](respondWithFilteredResult(_0x422c09,_0x442c1d))[_0x7c2c('0x59')](handleError(_0x422c09,null));};exports[_0x7c2c('0x3d')]=function(_0x3c6eaf,_0x403916,_0x2f5e0e){var _0x3be1c6,_0x114e57={},_0x5cb619;if(_0x3c6eaf[_0x7c2c('0x65')]['to']){_0x5cb619=_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0];}return db[_0x7c2c('0x42')]['find']({'where':{'id':_0x3c6eaf[_0x7c2c('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x7c2c('0xa4'),'where':{'fax':_0x5cb619},'limit':0x1,'order':[[_0x7c2c('0x9a'),'DESC']]}]}]})[_0x7c2c('0x21')](handleEntityNotFound(_0x403916,null))['then'](function(_0x1de015){_0x3be1c6=_0x1de015;if(_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')]&&_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][_0x7c2c('0x4d')]){for(var _0x336e56=0x0;_0x336e56<_0x3c6eaf[_0x7c2c('0x65')]['attachments']['length'];_0x336e56+=0x1){_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][_0x336e56]={'filename':_0x3c6eaf[_0x7c2c('0x65')]['attachments'][_0x336e56][_0x7c2c('0x3c')],'id':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][_0x336e56]['id'],'path':path[_0x7c2c('0xa6')](config[_0x7c2c('0xa7')],'server/files/attachments',_0x3c6eaf[_0x7c2c('0x65')]['attachments'][_0x336e56][_0x7c2c('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x7c2c('0xa9'),{'FaxAccountId':_[_0x7c2c('0xaa')](_0x3c6eaf['params']['id'])?undefined:_0x3c6eaf[_0x7c2c('0x5b')]['id'],'path':_['isNil'](_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0][_0x7c2c('0xab')])?undefined:_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0][_0x7c2c('0xab')],'fax':_[_0x7c2c('0xaa')](_0x3c6eaf['body']['to'][0x0])?undefined:_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0]},client9002);})[_0x7c2c('0x21')](function(){if(_0x3be1c6){if(_['isNil'](_0x3c6eaf[_0x7c2c('0x65')]['from'])){_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xac')]=util[_0x7c2c('0xa2')](_0x7c2c('0xad'),_0x3be1c6[_0x7c2c('0x3c')],_0x3be1c6[_0x7c2c('0xae')]);}if(_0x3be1c6[_0x7c2c('0xaf')]){if(_0x3be1c6['List'][_0x7c2c('0xa4')][_0x7c2c('0x4d')]){return _0x3be1c6[_0x7c2c('0xaf')]['Contacts'][0x0];}else{return db['CmContact'][_0x7c2c('0x5e')](_[_0x7c2c('0x1a')](_0x3c6eaf[_0x7c2c('0x65')],{'firstName':_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'phone':_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'fax':_0x3c6eaf['body']['to'][0x0],'ListId':_0x3be1c6['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x7c2c('0x21')](function(_0xf21527){if(_0xf21527){return db[_0x7c2c('0x73')][_0x7c2c('0x5d')]({'where':{'ContactId':_0xf21527['id'],'closed':![],'FaxAccountId':_0x3be1c6['id']}})[_0x7c2c('0x21')](function(_0x31549a){if(_0x31549a){return[_0x31549a,![]];}return db[_0x7c2c('0x73')][_0x7c2c('0x5e')]({'UserId':_0x3c6eaf[_0x7c2c('0x5f')]['id'],'ContactId':_0xf21527['id'],'FaxAccountId':_0x3be1c6['id'],'fax':_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'firstMsgDirection':_0x7c2c('0xb0'),'Messages':[_[_0x7c2c('0x54')](_0x3c6eaf[_0x7c2c('0x65')],{'read':![],'body':_0x3c6eaf['body']['attachments'][0x0][_0x7c2c('0xb1')],'FaxAccountId':_0x3be1c6['id'],'UserId':_0x3c6eaf[_0x7c2c('0x5f')]['id'],'ContactId':_0xf21527['id'],'AttachmentId':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x7c2c('0xb2')}]})[_0x7c2c('0x21')](function(_0x132cb4){return[_0x132cb4,!![]];});});}else{throw new Error(_0x7c2c('0xb3'));}})[_0x7c2c('0xb4')](function(_0x2b0247,_0xfdff3a){if(_0xfdff3a){return _0x2b0247;}return db['FaxMessage']['create']({'direction':_0x7c2c('0xb0'),'read':![],'body':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0][_0x7c2c('0xb1')],'FaxAccountId':_0x3be1c6['id'],'FaxInteractionId':_0x2b0247['id'],'UserId':_0x3c6eaf['user']['id'],'ContactId':_0x2b0247[_0x7c2c('0xb5')],'AttachmentId':_0x3c6eaf['body']['attachments'][0x0]['id']})['then'](function(_0x3c162a){_0x2b0247['dataValues'][_0x7c2c('0xb2')]=[];_0x2b0247[_0x7c2c('0xb6')]['Messages'][_0x7c2c('0x87')](_0x3c162a[_0x7c2c('0xb6')]);return _0x2b0247;});})[_0x7c2c('0x21')](function(_0x31eac0){respondWithRpcPromise(_0x7c2c('0xb7'),'SendFax',{'FaxAccountId':_[_0x7c2c('0xaa')](_0x3c6eaf[_0x7c2c('0x5b')]['id'])?undefined:_0x3c6eaf['params']['id'],'path':_['isNil'](_0x3c6eaf['body'][_0x7c2c('0xa5')][0x0][_0x7c2c('0xab')])?undefined:_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0]['path'],'fax':_[_0x7c2c('0xaa')](_0x3c6eaf['body']['to'][0x0])?undefined:_0x3c6eaf[_0x7c2c('0x65')]['to'][0x0],'AttachmentId':_0x3c6eaf[_0x7c2c('0x65')][_0x7c2c('0xa5')][0x0]['id']},client9002)[_0x7c2c('0x21')](function(_0x310ed1){logger[_0x7c2c('0x22')](_0x7c2c('0xb8'),_0x310ed1);})[_0x7c2c('0x59')](function(_0x547d90){logger[_0x7c2c('0x22')](_0x7c2c('0xb8'),_0x547d90);});return _0x31eac0;})[_0x7c2c('0x21')](respondWithResult(_0x403916,null))[_0x7c2c('0x59')](handleError(_0x403916,null));};exports[_0x7c2c('0xb9')]=function(_0x46e87c,_0x210c63,_0x5db9b6){return db[_0x7c2c('0x42')][_0x7c2c('0x5d')]({'where':{'id':_0x46e87c[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x210c63,null))['then'](function(_0x30f70d){if(_0x30f70d){return _0x30f70d[_0x7c2c('0xb9')](_0x46e87c[_0x7c2c('0x65')]['ids'],_['omit'](_0x46e87c[_0x7c2c('0x65')],[_0x7c2c('0x6e'),'id'])||{})[_0x7c2c('0xb4')](function(_0xae75d1){for(var _0x3f4d17=0x0;_0x3f4d17<_0x46e87c['body']['ids'][_0x7c2c('0x4d')];_0x3f4d17+=0x1){socket['emit'](_0x7c2c('0xba'),{'UserId':_0x46e87c[_0x7c2c('0x65')][_0x7c2c('0x6e')][_0x3f4d17],'FaxAccountId':_0x46e87c[_0x7c2c('0x5b')]['id']});}return _0xae75d1;});}})['then'](respondWithResult(_0x210c63,null))[_0x7c2c('0x59')](handleError(_0x210c63,null));};exports[_0x7c2c('0xbb')]=function(_0x5864d8,_0x502b84,_0x198343){return db[_0x7c2c('0x42')]['find']({'where':{'id':_0x5864d8[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x502b84,null))['then'](function(_0xc2c963){if(_0xc2c963){return _0xc2c963[_0x7c2c('0xbb')](_0x5864d8[_0x7c2c('0x48')][_0x7c2c('0x6e')])[_0x7c2c('0x21')](function(){if(_[_0x7c2c('0xbc')](_0x5864d8[_0x7c2c('0x48')][_0x7c2c('0x6e')])){for(var _0x21ebec=0x0;_0x21ebec<_0x5864d8[_0x7c2c('0x48')]['ids'][_0x7c2c('0x4d')];_0x21ebec+=0x1){socket[_0x7c2c('0xbd')](_0x7c2c('0xbe'),{'UserId':Number(_0x5864d8[_0x7c2c('0x48')][_0x7c2c('0x6e')][_0x21ebec]),'FaxAccountId':Number(_0x5864d8[_0x7c2c('0x5b')]['id'])});}}else{socket[_0x7c2c('0xbd')](_0x7c2c('0xbe'),{'UserId':Number(_0x5864d8[_0x7c2c('0x48')]['ids']),'FaxAccountId':Number(_0x5864d8[_0x7c2c('0x5b')]['id'])});}});}})[_0x7c2c('0x21')](respondWithStatusCode(_0x502b84,null))[_0x7c2c('0x59')](handleError(_0x502b84,null));};exports[_0x7c2c('0xbf')]=function(_0x201cd8,_0x18d3bc,_0x2f602a){var _0x19ef61={};var _0x375e2c={};var _0x56e7a5;var _0x2f4707;return db[_0x7c2c('0x42')][_0x7c2c('0x69')]({'where':{'id':_0x201cd8[_0x7c2c('0x5b')]['id']}})[_0x7c2c('0x21')](handleEntityNotFound(_0x18d3bc,null))['then'](function(_0x46bffc){if(_0x46bffc){_0x56e7a5=_0x46bffc;_0x375e2c[_0x7c2c('0x47')]=_[_0x7c2c('0x5c')](db[_0x7c2c('0x77')][_0x7c2c('0x43')]);_0x375e2c[_0x7c2c('0x48')]=_[_0x7c2c('0x5c')](_0x201cd8[_0x7c2c('0x48')]);_0x375e2c[_0x7c2c('0x49')]=_[_0x7c2c('0x4b')](_0x375e2c[_0x7c2c('0x47')],_0x375e2c[_0x7c2c('0x48')]);_0x19ef61[_0x7c2c('0x4a')]=_['intersection'](_0x375e2c[_0x7c2c('0x47')],qs[_0x7c2c('0x4c')](_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x4c')]));_0x19ef61[_0x7c2c('0x4a')]=_0x19ef61['attributes']['length']?_0x19ef61['attributes']:_0x375e2c[_0x7c2c('0x47')];_0x19ef61[_0x7c2c('0x50')]=qs[_0x7c2c('0x6b')](_0x201cd8[_0x7c2c('0x48')]['sort']);_0x19ef61[_0x7c2c('0x53')]=qs[_0x7c2c('0x49')](_[_0x7c2c('0x51')](_0x201cd8[_0x7c2c('0x48')],_0x375e2c[_0x7c2c('0x49')]));if(_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x52')]){_0x19ef61[_0x7c2c('0x53')]=_[_0x7c2c('0x54')](_0x19ef61[_0x7c2c('0x53')],{'$or':_[_0x7c2c('0x41')](_0x19ef61['attributes'],function(_0x28bb65){var _0x1792f6={};_0x1792f6[_0x28bb65]={'$like':'%'+_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x52')]+'%'};return _0x1792f6;})});}_0x19ef61=_[_0x7c2c('0x54')]({},_0x19ef61,_0x201cd8[_0x7c2c('0x56')]);return _0x56e7a5[_0x7c2c('0xbf')](_0x19ef61);}})[_0x7c2c('0x21')](function(_0x331d0b){if(_0x331d0b){_0x2f4707=_0x331d0b['length'];if(!_0x201cd8[_0x7c2c('0x48')][_0x7c2c('0x4e')]('nolimit')){_0x19ef61[_0x7c2c('0x30')]=qs[_0x7c2c('0x30')](_0x201cd8[_0x7c2c('0x48')]['limit']);_0x19ef61[_0x7c2c('0x31')]=qs['offset'](_0x201cd8['query'][_0x7c2c('0x31')]);}return _0x56e7a5[_0x7c2c('0xbf')](_0x19ef61);}})[_0x7c2c('0x21')](function(_0x184b3f){if(_0x184b3f){return _0x184b3f?{'count':_0x2f4707,'rows':_0x184b3f}:null;}})[_0x7c2c('0x21')](respondWithResult(_0x18d3bc,null))[_0x7c2c('0x59')](handleError(_0x18d3bc,null));};
\ No newline at end of file
index 1535437..6bb108e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd11=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x57a934,_0x332d71){var _0x20b108=function(_0x99248c){while(--_0x99248c){_0x57a934['push'](_0x57a934['shift']());}};_0x20b108(++_0x332d71);}(_0xfd11,0xf5));var _0x1fd1=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0xfd11[_0x34325b];return _0x3da348;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x1fd1('0x0'))['db'][_0x1fd1('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1fd1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fd1('0x3'),'afterDestroy':_0x1fd1('0x4')};function emitEvent(_0x2b43f1){return function(_0x3fc0dd,_0x7847a8,_0x1a154d){FaxAccountEvents[_0x1fd1('0x5')](_0x2b43f1+':'+_0x3fc0dd['id'],_0x3fc0dd);FaxAccountEvents['emit'](_0x2b43f1,_0x3fc0dd);_0x1a154d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x1fd1('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0xa594=['events','../../mysqldb','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x42f47f,_0x11ca9e){var _0x561d43=function(_0x29e50f){while(--_0x29e50f){_0x42f47f['push'](_0x42f47f['shift']());}};_0x561d43(++_0x11ca9e);}(_0xa594,0x18c));var _0x4a59=function(_0x59342a,_0x16827b){_0x59342a=_0x59342a-0x0;var _0x17abc9=_0xa594[_0x59342a];return _0x17abc9;};'use strict';var EventEmitter=require(_0x4a59('0x0'));var FaxAccount=require(_0x4a59('0x1'))['db'][_0x4a59('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4a59('0x3')](0x0);var events={'afterCreate':_0x4a59('0x4'),'afterUpdate':_0x4a59('0x5'),'afterDestroy':'remove'};function emitEvent(_0x48bcec){return function(_0x57d871,_0x192529,_0x4f4636){FaxAccountEvents[_0x4a59('0x6')](_0x48bcec+':'+_0x57d871['id'],_0x57d871);FaxAccountEvents[_0x4a59('0x6')](_0x48bcec,_0x57d871);_0x4f4636(null);};}for(var e in events){if(events[_0x4a59('0x7')](e)){var event=events[e];FaxAccount[_0x4a59('0x8')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
index 420f273..39d591f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ee=['rimraf','../../config/environment','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45ee,0x1a5));var _0xe45e=function(_0x2f47cc,_0x2cb108){_0x2f47cc=_0x2f47cc-0x0;var _0x8b4394=_0x45ee[_0x2f47cc];return _0x8b4394;};'use strict';var _=require(_0xe45e('0x0'));var util=require(_0xe45e('0x1'));var logger=require(_0xe45e('0x2'))(_0xe45e('0x3'));var moment=require(_0xe45e('0x4'));var BPromise=require(_0xe45e('0x5'));var rp=require(_0xe45e('0x6'));var fs=require('fs');var path=require(_0xe45e('0x7'));var rimraf=require(_0xe45e('0x8'));var config=require(_0xe45e('0x9'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x372ecd,_0x44033a){return _0x372ecd[_0xe45e('0xa')](_0xe45e('0xb'),attributes,{'tableName':_0xe45e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa42c=['rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4e6012,_0x1c4dec){var _0x25afd8=function(_0x778621){while(--_0x778621){_0x4e6012['push'](_0x4e6012['shift']());}};_0x25afd8(++_0x1c4dec);}(_0xa42c,0x1ce));var _0xca42=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0xa42c[_0x3662b4];return _0x50928c;};'use strict';var _=require(_0xca42('0x0'));var util=require('util');var logger=require(_0xca42('0x1'))(_0xca42('0x2'));var moment=require('moment');var BPromise=require(_0xca42('0x3'));var rp=require(_0xca42('0x4'));var fs=require('fs');var path=require(_0xca42('0x5'));var rimraf=require(_0xca42('0x6'));var config=require(_0xca42('0x7'));var attributes=require(_0xca42('0x8'));module['exports']=function(_0x433935,_0x5d2fd0){return _0x433935[_0xca42('0x9')](_0xca42('0xa'),attributes,{'tableName':_0xca42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 255638b..ce600b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x474f=['attributes','limit','include','model','map','then','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','account','applications','priority','asc','length','create','contact','FaxInteraction','spread','autoclose','close','unmanaged','*,*,*,*','ContactId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where'];(function(_0x21c07e,_0x1dda15){var _0x3eab00=function(_0x4fbb07){while(--_0x4fbb07){_0x21c07e['push'](_0x21c07e['shift']());}};_0x3eab00(++_0x1dda15);}(_0x474f,0x95));var _0xf474=function(_0x29dba6,_0x554f23){_0x29dba6=_0x29dba6-0x0;var _0x54e4f6=_0x474f[_0x29dba6];return _0x54e4f6;};'use strict';var _=require(_0xf474('0x0'));var util=require('util');var moment=require(_0xf474('0x1'));var BPromise=require(_0xf474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf474('0x3'));var db=require(_0xf474('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf474('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf474('0x6')][_0xf474('0x7')]({'port':0x232c});config[_0xf474('0x8')]=_[_0xf474('0x9')](config['redis'],{'host':_0xf474('0xa'),'port':0x18eb});var socket=require(_0xf474('0xb'))(new Redis(config[_0xf474('0x8')]));require(_0xf474('0xc'))[_0xf474('0xd')](socket);function respondWithRpcPromise(_0x3b6975,_0x59b42d,_0x7d8a6c){return new BPromise(function(_0x59e886,_0x9e2e99){return client[_0xf474('0xe')](_0x3b6975,_0x7d8a6c)['then'](function(_0x5baeea){logger[_0xf474('0xf')](_0xf474('0x10'),_0x59b42d,_0xf474('0x11'));logger[_0xf474('0x12')](_0xf474('0x13'),_0x59b42d,_0xf474('0x11'),JSON[_0xf474('0x14')](_0x5baeea));if(_0x5baeea['error']){if(_0x5baeea[_0xf474('0x15')][_0xf474('0x16')]===0x1f4){logger[_0xf474('0x15')](_0xf474('0x10'),_0x59b42d,_0x5baeea[_0xf474('0x15')][_0xf474('0x17')]);return _0x9e2e99(_0x5baeea['error'][_0xf474('0x17')]);}logger['error'](_0xf474('0x10'),_0x59b42d,_0x5baeea['error']['message']);return _0x59e886(_0x5baeea[_0xf474('0x15')][_0xf474('0x17')]);}else{logger[_0xf474('0xf')](_0xf474('0x10'),_0x59b42d,_0xf474('0x11'));_0x59e886(_0x5baeea[_0xf474('0x18')]['message']);}})[_0xf474('0x19')](function(_0xa567d0){logger[_0xf474('0x15')]('FaxAccount,\x20%s,\x20%s',_0x59b42d,_0xa567d0);_0x9e2e99(_0xa567d0);});});}exports[_0xf474('0x1a')]=function(_0x3ea683){var _0x278e2a=this;return new Promise(function(_0x596345,_0x548eef){return db[_0xf474('0x1b')]['findAll']({'raw':_0x3ea683[_0xf474('0x1c')]?_0x3ea683[_0xf474('0x1c')][_0xf474('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ea683[_0xf474('0x1c')]?_0x3ea683['options'][_0xf474('0x1e')]||null:null,'attributes':_0x3ea683[_0xf474('0x1c')]?_0x3ea683[_0xf474('0x1c')][_0xf474('0x1f')]||null:null,'limit':_0x3ea683[_0xf474('0x1c')]?_0x3ea683['options'][_0xf474('0x20')]||null:null,'include':_0x3ea683[_0xf474('0x1c')]?_0x3ea683[_0xf474('0x1c')][_0xf474('0x21')]?_['map'](_0x3ea683['options']['include'],function(_0x5e4f4d){return{'model':db[_0x5e4f4d[_0xf474('0x22')]],'as':_0x5e4f4d['as'],'attributes':_0x5e4f4d['attributes'],'include':_0x5e4f4d['include']?_[_0xf474('0x23')](_0x5e4f4d[_0xf474('0x21')],function(_0xbcd1d4){return{'model':db[_0xbcd1d4[_0xf474('0x22')]],'as':_0xbcd1d4['as'],'attributes':_0xbcd1d4[_0xf474('0x1f')],'include':_0xbcd1d4[_0xf474('0x21')]?_[_0xf474('0x23')](_0xbcd1d4[_0xf474('0x21')],function(_0x238f37){return{'model':db[_0x238f37[_0xf474('0x22')]],'as':_0x238f37['as'],'attributes':_0x238f37[_0xf474('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf474('0x24')](function(_0x48234d){logger[_0xf474('0xf')](_0xf474('0x1a'),_0x3ea683);logger[_0xf474('0x12')]('GetFaxAccount',_0x3ea683,JSON[_0xf474('0x14')](_0x48234d));_0x596345(_0x48234d);})[_0xf474('0x19')](function(_0x150f62){logger[_0xf474('0x15')]('GetFaxAccount',_0x150f62[_0xf474('0x17')],_0x3ea683);_0x548eef(_0x278e2a['error'](0x1f4,_0x150f62[_0xf474('0x17')]));});});};exports[_0xf474('0x25')]=function(_0x370bf4,_0xfeaf86,_0x541928){var _0x13afed=this;return new Promise(function(_0x3a2717,_0x21eae7){var _0x41ba02={'body':_0x370bf4[_0xf474('0x26')],'channel':_0xf474('0x27')};var _0x3c7170=[];var _0x2c74c6=[];var _0x38ef77={};return db[_0xf474('0x28')][_0xf474('0x29')]()['then'](function(_0x2e559e){if(!_0x2e559e){throw new db[(_0xf474('0x2a'))][(_0xf474('0x2b'))](_0xf474('0x2c'));}_0x3c7170=_[_0xf474('0x2d')](_['keys'](_0x2e559e),[_0xf474('0x2e'),_0xf474('0x2f')]);_0x2c74c6=_[_0xf474('0x2d')](_[_0xf474('0x30')](_0x2e559e),[_0xf474('0x2e'),'updatedAt',_0xf474('0x31'),_0xf474('0x32')]);if(_0x370bf4['body']['id']){delete _0x370bf4[_0xf474('0x26')]['id'];}if(_[_0xf474('0x33')](_0x370bf4['body'][_0xf474('0x34')])){throw new db[(_0xf474('0x2a'))]['ValidationError'](_0xf474('0x35'));}if(_[_0xf474('0x33')](_0x370bf4[_0xf474('0x26')][_0xf474('0x26')])||_0x370bf4['body'][_0xf474('0x26')]===''){throw new db[(_0xf474('0x2a'))]['ValidationError'](_0xf474('0x36'));}if(_[_0xf474('0x33')](_0x370bf4[_0xf474('0x26')][_0xf474('0x37')])){throw new db[(_0xf474('0x2a'))][(_0xf474('0x2b'))](_0xf474('0x38')+_0x2c74c6);}if(!_[_0xf474('0x39')](_0x2c74c6,_0x370bf4[_0xf474('0x26')][_0xf474('0x37')])){throw new db[(_0xf474('0x2a'))][(_0xf474('0x2b'))](_0xf474('0x3a')+_0x2c74c6);}_0x38ef77[_0x370bf4[_0xf474('0x26')][_0xf474('0x37')]]=_0x370bf4[_0xf474('0x26')][_0xf474('0x34')];})[_0xf474('0x24')](function(){return db[_0xf474('0x1b')][_0xf474('0x3b')]({'where':{'id':_0x370bf4['account']['id']},'include':[{'model':db[_0xf474('0x3c')],'as':_0xf474('0x3d'),'include':[{'model':db[_0xf474('0x28')],'as':_0xf474('0x3e'),'where':_0x38ef77,'limit':0x1,'order':[['updatedAt',_0xf474('0x3f')]]}]},{'model':db[_0xf474('0x40')],'as':_0xf474('0x41')}]});})['then'](function(_0x413841){if(_0x413841&&_0x413841[_0xf474('0x3d')]){var _0x25e632=_0x413841[_0xf474('0x42')]({'plain':!![]});_0x41ba02[_0xf474('0x43')]=_0x25e632;_0x41ba02[_0xf474('0x44')]=_0x25e632[_0xf474('0x41')];_0x41ba02['list']=_0x25e632['List'];_0x41ba02[_0xf474('0x44')]=_['orderBy'](_0x41ba02[_0xf474('0x44')],[_0xf474('0x45')],[_0xf474('0x46')]);if(_0x41ba02[_0xf474('0x43')][_0xf474('0x41')]){delete _0x41ba02[_0xf474('0x43')][_0xf474('0x41')];}if(_0x41ba02[_0xf474('0x43')]['List']&&_0x41ba02[_0xf474('0x43')]['List'][_0xf474('0x3e')][_0xf474('0x47')]){return _0x41ba02[_0xf474('0x43')][_0xf474('0x3d')]['Contacts'][0x0];}var _0x452b3e=_[_0xf474('0x9')](_0x370bf4[_0xf474('0x26')],{'firstName':_0x370bf4['body'][_0xf474('0x34')],'ListId':_0x25e632[_0xf474('0x32')]});_0x452b3e[_0x370bf4[_0xf474('0x26')][_0xf474('0x37')]]=_0x370bf4['body'][_0xf474('0x34')];return db[_0xf474('0x28')][_0xf474('0x48')](_0x452b3e,{'fields':_0x3c7170,'raw':!![]});}})['then'](function(_0x20b4c3){_0x41ba02[_0xf474('0x49')]=_0x20b4c3;if(_0x20b4c3){var _0x408827={'ContactId':_0x20b4c3['id'],'FaxAccountId':_0x370bf4['account']['id'],'fax':_0x20b4c3[_0xf474('0x27')]};return db[_0xf474('0x4a')][_0xf474('0x3b')]({'where':{'ContactId':_0x20b4c3['id'],'closed':![],'FaxAccountId':_0x370bf4[_0xf474('0x43')]['id']}})['then'](function(_0x35797f){if(_0x35797f){return[_0x35797f,![]];}return db[_0xf474('0x4a')]['create'](_0x408827)[_0xf474('0x24')](function(_0x8f134f){return[_0x8f134f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf474('0x4b')](function(_0x3b3e5c,_0x34497b){var _0x59e9ca=_0x3b3e5c['get']({'plain':!![]});if(_0x34497b){if(_0x41ba02[_0xf474('0x43')][_0xf474('0x4c')]){_0x41ba02[_0xf474('0x44')]['push']({'id':0x0,'priority':_0x41ba02[_0xf474('0x44')]['length']+0x1,'app':_0xf474('0x4d'),'appdata':_0xf474('0x4e'),'interval':_0xf474('0x4f')});}_0x59e9ca['created']=!![];}else{_0x59e9ca['created']=![];}_0x41ba02['interaction']=_0x59e9ca;return db['FaxMessage'][_0xf474('0x48')]({'body':_0x370bf4[_0xf474('0x26')][_0xf474('0x26')],'FaxAccountId':_0x370bf4[_0xf474('0x43')]['id'],'FaxInteractionId':_0x3b3e5c['id'],'direction':'in','ContactId':_0x3b3e5c[_0xf474('0x50')],'AttachmentId':_0x370bf4[_0xf474('0x26')]['AttachmentId']});})[_0xf474('0x24')](function(_0x233492){_0x41ba02['message']=_0x233492;if(_0x41ba02[_0xf474('0x51')][_0xf474('0x52')]){return db[_0xf474('0x53')][_0xf474('0x3b')]({'attributes':['id',_0xf474('0x54')],'where':{'id':_0x41ba02[_0xf474('0x51')][_0xf474('0x52')]}})[_0xf474('0x24')](function(_0x5185f9){if(_0x5185f9){_0x41ba02['applications'][_0xf474('0x55')]({'id':0x0,'priority':0x0,'app':_0xf474('0x56'),'appdata':_0x5185f9[_0xf474('0x54')]+','+(_0x41ba02[_0xf474('0x43')][_0xf474('0x57')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xf474('0x58'),_0x41ba02);});}return respondWithRpcPromise(_0xf474('0x59'),_0xf474('0x58'),_0x41ba02);})[_0xf474('0x24')](function(_0xafecc2){_0x3a2717(_0xafecc2);})['catch'](function(_0x401247){_0x21eae7(_0x13afed[_0xf474('0x15')](0x1f4,_0x401247[_0xf474('0x17')]));});});};
\ No newline at end of file
+var _0x8b5f=['interaction','FaxMessage','ContactId','AttachmentId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','findAll','raw','options','include','map','attributes','model','NotifyFaxAccount','body','Sequelize','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','CmContact','Contacts','DESC','Applications','applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','*,*,*,*','created'];(function(_0x48e88c,_0xa4471d){var _0x5067ad=function(_0x4e8743){while(--_0x4e8743){_0x48e88c['push'](_0x48e88c['shift']());}};_0x5067ad(++_0xa4471d);}(_0x8b5f,0x113));var _0xf8b5=function(_0x574d63,_0x26e925){_0x574d63=_0x574d63-0x0;var _0x4b0bb1=_0x8b5f[_0x574d63];return _0x4b0bb1;};'use strict';var _=require('lodash');var util=require(_0xf8b5('0x0'));var moment=require(_0xf8b5('0x1'));var BPromise=require('bluebird');var rs=require(_0xf8b5('0x2'));var fs=require('fs');var Redis=require(_0xf8b5('0x3'));var db=require(_0xf8b5('0x4'))['db'];var utils=require(_0xf8b5('0x5'));var logger=require(_0xf8b5('0x6'))(_0xf8b5('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8b5('0x8'));var client=jayson['client'][_0xf8b5('0x9')]({'port':0x232c});config[_0xf8b5('0xa')]=_[_0xf8b5('0xb')](config[_0xf8b5('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf8b5('0xc'))(new Redis(config[_0xf8b5('0xa')]));require(_0xf8b5('0xd'))[_0xf8b5('0xe')](socket);function respondWithRpcPromise(_0x4a8509,_0x5475f1,_0x427f10){return new BPromise(function(_0x20e143,_0x93a67a){return client[_0xf8b5('0xf')](_0x4a8509,_0x427f10)[_0xf8b5('0x10')](function(_0x3e995e){logger[_0xf8b5('0x11')](_0xf8b5('0x12'),_0x5475f1,_0xf8b5('0x13'));logger[_0xf8b5('0x14')](_0xf8b5('0x15'),_0x5475f1,_0xf8b5('0x13'),JSON[_0xf8b5('0x16')](_0x3e995e));if(_0x3e995e[_0xf8b5('0x17')]){if(_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x18')]===0x1f4){logger[_0xf8b5('0x17')](_0xf8b5('0x12'),_0x5475f1,_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x19')]);return _0x93a67a(_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x19')]);}logger[_0xf8b5('0x17')](_0xf8b5('0x12'),_0x5475f1,_0x3e995e[_0xf8b5('0x17')][_0xf8b5('0x19')]);return _0x20e143(_0x3e995e['error']['message']);}else{logger[_0xf8b5('0x11')]('FaxAccount,\x20%s,\x20%s',_0x5475f1,'request\x20sent');_0x20e143(_0x3e995e[_0xf8b5('0x1a')]['message']);}})['catch'](function(_0x32f0d7){logger[_0xf8b5('0x17')](_0xf8b5('0x12'),_0x5475f1,_0x32f0d7);_0x93a67a(_0x32f0d7);});});}exports[_0xf8b5('0x1b')]=function(_0x2fff03){var _0x42a7de=this;return new Promise(function(_0x1a5fd6,_0x578470){return db['FaxAccount'][_0xf8b5('0x1c')]({'raw':_0x2fff03['options']?_0x2fff03['options'][_0xf8b5('0x1d')]===undefined?!![]:![]:!![],'where':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03[_0xf8b5('0x1e')]['where']||null:null,'attributes':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03['options']['attributes']||null:null,'limit':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03[_0xf8b5('0x1e')]['limit']||null:null,'include':_0x2fff03[_0xf8b5('0x1e')]?_0x2fff03[_0xf8b5('0x1e')][_0xf8b5('0x1f')]?_[_0xf8b5('0x20')](_0x2fff03[_0xf8b5('0x1e')][_0xf8b5('0x1f')],function(_0x2a1e1f){return{'model':db[_0x2a1e1f['model']],'as':_0x2a1e1f['as'],'attributes':_0x2a1e1f[_0xf8b5('0x21')],'include':_0x2a1e1f[_0xf8b5('0x1f')]?_['map'](_0x2a1e1f['include'],function(_0x2253c0){return{'model':db[_0x2253c0[_0xf8b5('0x22')]],'as':_0x2253c0['as'],'attributes':_0x2253c0[_0xf8b5('0x21')],'include':_0x2253c0[_0xf8b5('0x1f')]?_[_0xf8b5('0x20')](_0x2253c0[_0xf8b5('0x1f')],function(_0x57911e){return{'model':db[_0x57911e[_0xf8b5('0x22')]],'as':_0x57911e['as'],'attributes':_0x57911e[_0xf8b5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf8b5('0x10')](function(_0x52262d){logger['info'](_0xf8b5('0x1b'),_0x2fff03);logger[_0xf8b5('0x14')](_0xf8b5('0x1b'),_0x2fff03,JSON[_0xf8b5('0x16')](_0x52262d));_0x1a5fd6(_0x52262d);})['catch'](function(_0x30f994){logger[_0xf8b5('0x17')](_0xf8b5('0x1b'),_0x30f994[_0xf8b5('0x19')],_0x2fff03);_0x578470(_0x42a7de[_0xf8b5('0x17')](0x1f4,_0x30f994['message']));});});};exports[_0xf8b5('0x23')]=function(_0x245665,_0x1448c2,_0x3605fe){var _0x475bff=this;return new Promise(function(_0x5a7188,_0x30dfae){var _0x4b84d0={'body':_0x245665[_0xf8b5('0x24')],'channel':'fax'};var _0x38c1b9=[];var _0x911d1d=[];var _0x2756d9={};return db['CmContact']['describe']()[_0xf8b5('0x10')](function(_0x552f39){if(!_0x552f39){throw new db[(_0xf8b5('0x25'))]['ValidationError']('no\x20available\x20attributes');}_0x38c1b9=_[_0xf8b5('0x26')](_[_0xf8b5('0x27')](_0x552f39),['createdAt','updatedAt']);_0x911d1d=_[_0xf8b5('0x26')](_[_0xf8b5('0x27')](_0x552f39),[_0xf8b5('0x28'),_0xf8b5('0x29'),_0xf8b5('0x2a'),_0xf8b5('0x2b')]);if(_0x245665[_0xf8b5('0x24')]['id']){delete _0x245665['body']['id'];}if(_[_0xf8b5('0x2c')](_0x245665[_0xf8b5('0x24')][_0xf8b5('0x2d')])){throw new db[(_0xf8b5('0x25'))][(_0xf8b5('0x2e'))](_0xf8b5('0x2f'));}if(_[_0xf8b5('0x2c')](_0x245665[_0xf8b5('0x24')][_0xf8b5('0x24')])||_0x245665[_0xf8b5('0x24')][_0xf8b5('0x24')]===''){throw new db[(_0xf8b5('0x25'))][(_0xf8b5('0x2e'))](_0xf8b5('0x30'));}if(_[_0xf8b5('0x2c')](_0x245665[_0xf8b5('0x24')]['mapKey'])){throw new db['Sequelize'][(_0xf8b5('0x2e'))](_0xf8b5('0x31')+_0x911d1d);}if(!_[_0xf8b5('0x32')](_0x911d1d,_0x245665[_0xf8b5('0x24')][_0xf8b5('0x33')])){throw new db[(_0xf8b5('0x25'))][(_0xf8b5('0x2e'))](_0xf8b5('0x34')+_0x911d1d);}_0x2756d9[_0x245665[_0xf8b5('0x24')][_0xf8b5('0x33')]]=_0x245665[_0xf8b5('0x24')]['from'];})[_0xf8b5('0x10')](function(){return db[_0xf8b5('0x35')][_0xf8b5('0x36')]({'where':{'id':_0x245665[_0xf8b5('0x37')]['id']},'include':[{'model':db['CmList'],'as':_0xf8b5('0x38'),'include':[{'model':db[_0xf8b5('0x39')],'as':_0xf8b5('0x3a'),'where':_0x2756d9,'limit':0x1,'order':[['updatedAt',_0xf8b5('0x3b')]]}]},{'model':db['FaxApplication'],'as':_0xf8b5('0x3c')}]});})['then'](function(_0x4acea5){if(_0x4acea5&&_0x4acea5[_0xf8b5('0x38')]){var _0x75de10=_0x4acea5['get']({'plain':!![]});_0x4b84d0[_0xf8b5('0x37')]=_0x75de10;_0x4b84d0[_0xf8b5('0x3d')]=_0x75de10[_0xf8b5('0x3c')];_0x4b84d0[_0xf8b5('0x3e')]=_0x75de10[_0xf8b5('0x38')];_0x4b84d0[_0xf8b5('0x3d')]=_[_0xf8b5('0x3f')](_0x4b84d0[_0xf8b5('0x3d')],[_0xf8b5('0x40')],[_0xf8b5('0x41')]);if(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x3c')]){delete _0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x3c')];}if(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x38')]&&_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x38')][_0xf8b5('0x3a')][_0xf8b5('0x42')]){return _0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x38')][_0xf8b5('0x3a')][0x0];}var _0x286a08=_['defaults'](_0x245665['body'],{'firstName':_0x245665['body'][_0xf8b5('0x2d')],'ListId':_0x75de10[_0xf8b5('0x2b')]});_0x286a08[_0x245665[_0xf8b5('0x24')][_0xf8b5('0x33')]]=_0x245665[_0xf8b5('0x24')][_0xf8b5('0x2d')];return db[_0xf8b5('0x39')][_0xf8b5('0x43')](_0x286a08,{'fields':_0x38c1b9,'raw':!![]});}})['then'](function(_0x10ec23){_0x4b84d0[_0xf8b5('0x44')]=_0x10ec23;if(_0x10ec23){var _0x5f2e13={'ContactId':_0x10ec23['id'],'FaxAccountId':_0x245665[_0xf8b5('0x37')]['id'],'fax':_0x10ec23['fax']};return db[_0xf8b5('0x45')]['find']({'where':{'ContactId':_0x10ec23['id'],'closed':![],'FaxAccountId':_0x245665[_0xf8b5('0x37')]['id']}})['then'](function(_0x1728c2){if(_0x1728c2){return[_0x1728c2,![]];}return db['FaxInteraction'][_0xf8b5('0x43')](_0x5f2e13)[_0xf8b5('0x10')](function(_0x4ba1ec){return[_0x4ba1ec,!![]];});});}else{throw new Error(_0xf8b5('0x46'));}})[_0xf8b5('0x47')](function(_0x354db8,_0x13f73d){var _0x3bb779=_0x354db8[_0xf8b5('0x48')]({'plain':!![]});if(_0x13f73d){if(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x49')]){_0x4b84d0[_0xf8b5('0x3d')][_0xf8b5('0x4a')]({'id':0x0,'priority':_0x4b84d0[_0xf8b5('0x3d')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xf8b5('0x4b')});}_0x3bb779[_0xf8b5('0x4c')]=!![];}else{_0x3bb779[_0xf8b5('0x4c')]=![];}_0x4b84d0[_0xf8b5('0x4d')]=_0x3bb779;return db[_0xf8b5('0x4e')][_0xf8b5('0x43')]({'body':_0x245665[_0xf8b5('0x24')]['body'],'FaxAccountId':_0x245665['account']['id'],'FaxInteractionId':_0x354db8['id'],'direction':'in','ContactId':_0x354db8[_0xf8b5('0x4f')],'AttachmentId':_0x245665[_0xf8b5('0x24')][_0xf8b5('0x50')]});})['then'](function(_0x1b2627){_0x4b84d0[_0xf8b5('0x19')]=_0x1b2627;if(_0x4b84d0[_0xf8b5('0x4d')]['UserId']){return db[_0xf8b5('0x51')]['find']({'attributes':['id',_0xf8b5('0x52')],'where':{'id':_0x4b84d0[_0xf8b5('0x4d')]['UserId']}})['then'](function(_0x510680){if(_0x510680){_0x4b84d0['applications'][_0xf8b5('0x53')]({'id':0x0,'priority':0x0,'app':_0xf8b5('0x54'),'appdata':_0x510680[_0xf8b5('0x52')]+','+(_0x4b84d0[_0xf8b5('0x37')][_0xf8b5('0x55')]||0xa),'interval':_0xf8b5('0x4b')});}return respondWithRpcPromise(_0xf8b5('0x56'),_0xf8b5('0x57'),_0x4b84d0);});}return respondWithRpcPromise(_0xf8b5('0x56'),_0xf8b5('0x57'),_0x4b84d0);})[_0xf8b5('0x10')](function(_0x3bfc1d){_0x5a7188(_0x3bfc1d);})['catch'](function(_0x313990){_0x30dfae(_0x475bff[_0xf8b5('0x17')](0x1f4,_0x313990[_0xf8b5('0x19')]));});});};
\ No newline at end of file
index 482dfa6..7fe757d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2494=['removeListener','length','faxAccount:','update','emit'];(function(_0x428cd5,_0x362ff7){var _0x43e5d3=function(_0x5b9d28){while(--_0x5b9d28){_0x428cd5['push'](_0x428cd5['shift']());}};_0x43e5d3(++_0x362ff7);}(_0x2494,0x17a));var _0x4249=function(_0x49208d,_0xfc9e0b){_0x49208d=_0x49208d-0x0;var _0x5cdc72=_0x2494[_0x49208d];return _0x5cdc72;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save','remove',_0x4249('0x0')];function createListener(_0x4ba8e9,_0x38c9a6){return function(_0x469a49){_0x38c9a6[_0x4249('0x1')](_0x4ba8e9,_0x469a49);};}function removeListener(_0x9b410d,_0x213763){return function(){FaxAccountEvents[_0x4249('0x2')](_0x9b410d,_0x213763);};}exports['register']=function(_0x3c7629){for(var _0xd65487=0x0,_0x5cb65e=events[_0x4249('0x3')];_0xd65487<_0x5cb65e;_0xd65487++){var _0x4718b6=events[_0xd65487];var _0x49145f=createListener(_0x4249('0x4')+_0x4718b6,_0x3c7629);FaxAccountEvents['on'](_0x4718b6,_0x49145f);}};
\ No newline at end of file
+var _0x2734=['length','./faxAccount.events','remove','update','emit','removeListener'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x2734,0x85));var _0x4273=function(_0x21033b,_0x43f9b1){_0x21033b=_0x21033b-0x0;var _0x173e97=_0x2734[_0x21033b];return _0x173e97;};'use strict';var FaxAccountEvents=require(_0x4273('0x0'));var events=['save',_0x4273('0x1'),_0x4273('0x2')];function createListener(_0x1a8cb9,_0x2e68c9){return function(_0x206d2c){_0x2e68c9[_0x4273('0x3')](_0x1a8cb9,_0x206d2c);};}function removeListener(_0x39ecb2,_0x29006d){return function(){FaxAccountEvents[_0x4273('0x4')](_0x39ecb2,_0x29006d);};}exports['register']=function(_0x65334c){for(var _0x36b3bc=0x0,_0x3960f6=events[_0x4273('0x5')];_0x36b3bc<_0x3960f6;_0x36b3bc++){var _0x56d603=events[_0x36b3bc];var _0x114506=createListener('faxAccount:'+_0x56d603,_0x65334c);FaxAccountEvents['on'](_0x56d603,_0x114506);}};
\ No newline at end of file
index 381a0de..50d9e72 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(_0x3eb435,_0x3be1e3){var _0x42203d=function(_0x4d63da){while(--_0x4d63da){_0x3eb435['push'](_0x3eb435['shift']());}};_0x42203d(++_0x3be1e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xb58ab4,_0x396977){var _0x5e30a5=function(_0xfbd8fd){while(--_0xfbd8fd){_0xb58ab4['push'](_0xb58ab4['shift']());}};_0x5e30a5(++_0x396977);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 25111fa..1550821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4277=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x10e7b9,_0x7399f4){var _0x2e4827=function(_0x14a736){while(--_0x14a736){_0x10e7b9['push'](_0x10e7b9['shift']());}};_0x2e4827(++_0x7399f4);}(_0x4277,0x17f));var _0x7427=function(_0x3db302,_0xe8be0f){_0x3db302=_0x3db302-0x0;var _0x4eff8a=_0x4277[_0x3db302];return _0x4eff8a;};'use strict';var Sequelize=require(_0x7427('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7427('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7427('0x2')],'allowNull':![],'defaultValue':_0x7427('0x3')},'appdata':{'type':Sequelize[_0x7427('0x4')]()},'description':{'type':Sequelize[_0x7427('0x2')]},'interval':{'type':Sequelize[_0x7427('0x2')],'defaultValue':_0x7427('0x5')}};
\ No newline at end of file
+var _0xbcf4=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0xb0d185,_0x4c85b7){var _0x2f03ec=function(_0x810848){while(--_0x810848){_0xb0d185['push'](_0xb0d185['shift']());}};_0x2f03ec(++_0x4c85b7);}(_0xbcf4,0x1d9));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4bcf('0x0'));module[_0x4bcf('0x1')]={'priority':{'type':Sequelize[_0x4bcf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4bcf('0x3')],'allowNull':![],'defaultValue':_0x4bcf('0x4')},'appdata':{'type':Sequelize[_0x4bcf('0x5')]()},'description':{'type':Sequelize[_0x4bcf('0x3')]},'interval':{'type':Sequelize[_0x4bcf('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 6d51b9a..2223b93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15cd=['filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x15cd,0x1ac));var _0xd15c=function(_0x14d175,_0x230bf7){_0x14d175=_0x14d175-0x0;var _0x2946e9=_0x15cd[_0x14d175];return _0x2946e9;};'use strict';var emlformat=require(_0xd15c('0x0'));var rimraf=require(_0xd15c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd15c('0x2'));var rp=require(_0xd15c('0x3'));var moment=require('moment');var BPromise=require(_0xd15c('0x4'));var Mustache=require(_0xd15c('0x5'));var util=require('util');var path=require(_0xd15c('0x6'));var sox=require(_0xd15c('0x7'));var csv=require(_0xd15c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd15c('0x9'));var _=require(_0xd15c('0xa'));var squel=require('squel');var crypto=require(_0xd15c('0xb'));var jsforce=require(_0xd15c('0xc'));var deskjs=require(_0xd15c('0xd'));var toCsv=require(_0xd15c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd15c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd15c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd15c('0x10'))(_0xd15c('0x11'));var utils=require('../../config/utils');var config=require(_0xd15c('0x12'));var licenseUtil=require(_0xd15c('0x13'));var db=require(_0xd15c('0x14'))['db'];function respondWithStatusCode(_0x3491ea,_0x5e438c){_0x5e438c=_0x5e438c||0xcc;return function(_0xa6c5bc){if(_0xa6c5bc){return _0x3491ea[_0xd15c('0x15')](_0x5e438c);}return _0x3491ea[_0xd15c('0x16')](_0x5e438c)['end']();};}function respondWithResult(_0x42424f,_0xa8ffa0){_0xa8ffa0=_0xa8ffa0||0xc8;return function(_0x56aa8e){if(_0x56aa8e){return _0x42424f[_0xd15c('0x16')](_0xa8ffa0)[_0xd15c('0x17')](_0x56aa8e);}};}function respondWithFilteredResult(_0x4a8288,_0x2adf07){return function(_0x106062){if(_0x106062){var _0x17c652=typeof _0x2adf07[_0xd15c('0x18')]===_0xd15c('0x19')&&typeof _0x2adf07[_0xd15c('0x1a')]===_0xd15c('0x19');var _0x35e56f=_0x106062[_0xd15c('0x1b')];var _0x349474=_0x17c652?0x0:_0x2adf07['offset'];var _0x38c35d=_0x17c652?_0x106062[_0xd15c('0x1b')]:_0x2adf07['offset']+_0x2adf07[_0xd15c('0x1a')];var _0x155fe6;if(_0x38c35d>=_0x35e56f){_0x38c35d=_0x35e56f;_0x155fe6=0xc8;}else{_0x155fe6=0xce;}_0x4a8288['status'](_0x155fe6);return _0x4a8288['set']('Content-Range',_0x349474+'-'+_0x38c35d+'/'+_0x35e56f)['json'](_0x106062);}return null;};}function patchUpdates(_0x3679f6){return function(_0x3f3ab2){try{jsonpatch[_0xd15c('0x1c')](_0x3f3ab2,_0x3679f6,!![]);}catch(_0x5140b8){return BPromise[_0xd15c('0x1d')](_0x5140b8);}return _0x3f3ab2['save']();};}function saveUpdates(_0x2b3d1e,_0x410afe){return function(_0x16116f){if(_0x16116f){return _0x16116f[_0xd15c('0x1e')](_0x2b3d1e)['then'](function(_0x5073a7){return _0x5073a7;});}return null;};}function removeEntity(_0x43973f,_0x2dfa5d){return function(_0xcef1c0){if(_0xcef1c0){return _0xcef1c0[_0xd15c('0x1f')]()[_0xd15c('0x20')](function(){_0x43973f['status'](0xcc)[_0xd15c('0x21')]();});}};}function handleEntityNotFound(_0x548259,_0x2d62eb){return function(_0x320aca){if(!_0x320aca){_0x548259[_0xd15c('0x15')](0x194);}return _0x320aca;};}function handleError(_0x34bb46,_0x17fd1){_0x17fd1=_0x17fd1||0x1f4;return function(_0x39b2f8){logger[_0xd15c('0x22')](_0x39b2f8[_0xd15c('0x23')]);if(_0x39b2f8[_0xd15c('0x24')]){delete _0x39b2f8['name'];}_0x34bb46['status'](_0x17fd1)[_0xd15c('0x25')](_0x39b2f8);};}exports[_0xd15c('0x26')]=function(_0x44b20b,_0x542137){var _0x5b4899={},_0x3a4644={},_0x4333e0={'count':0x0,'rows':[]};var _0x50fef0=_[_0xd15c('0x27')](db[_0xd15c('0x28')][_0xd15c('0x29')],function(_0x4ddd8c){return{'name':_0x4ddd8c[_0xd15c('0x2a')],'type':_0x4ddd8c[_0xd15c('0x2b')][_0xd15c('0x2c')]};});_0x3a4644[_0xd15c('0x2d')]=_[_0xd15c('0x27')](_0x50fef0,_0xd15c('0x24'));_0x3a4644[_0xd15c('0x2e')]=_[_0xd15c('0x2f')](_0x44b20b['query']);_0x3a4644[_0xd15c('0x30')]=_[_0xd15c('0x31')](_0x3a4644[_0xd15c('0x2d')],_0x3a4644['query']);_0x5b4899['attributes']=_[_0xd15c('0x31')](_0x3a4644[_0xd15c('0x2d')],qs[_0xd15c('0x32')](_0x44b20b[_0xd15c('0x2e')]['fields']));_0x5b4899[_0xd15c('0x33')]=_0x5b4899[_0xd15c('0x33')]['length']?_0x5b4899[_0xd15c('0x33')]:_0x3a4644[_0xd15c('0x2d')];if(!_0x44b20b[_0xd15c('0x2e')][_0xd15c('0x34')]('nolimit')){_0x5b4899['limit']=qs[_0xd15c('0x1a')](_0x44b20b[_0xd15c('0x2e')]['limit']);_0x5b4899[_0xd15c('0x18')]=qs[_0xd15c('0x18')](_0x44b20b[_0xd15c('0x2e')][_0xd15c('0x18')]);}_0x5b4899[_0xd15c('0x35')]=qs['sort'](_0x44b20b[_0xd15c('0x2e')][_0xd15c('0x36')]);_0x5b4899[_0xd15c('0x37')]=qs['filters'](_[_0xd15c('0x38')](_0x44b20b['query'],_0x3a4644[_0xd15c('0x30')]),_0x50fef0);if(_0x44b20b[_0xd15c('0x2e')][_0xd15c('0x39')]){_0x5b4899['where']=_[_0xd15c('0x3a')](_0x5b4899[_0xd15c('0x37')],{'$or':_[_0xd15c('0x27')](_0x50fef0,function(_0xc9929b){if(_0xc9929b['type']!=='VIRTUAL'){var _0x544662={};_0x544662[_0xc9929b[_0xd15c('0x24')]]={'$like':'%'+_0x44b20b[_0xd15c('0x2e')][_0xd15c('0x39')]+'%'};return _0x544662;}})});}_0x5b4899=_[_0xd15c('0x3a')]({},_0x5b4899,_0x44b20b[_0xd15c('0x3b')]);var _0x243343={'where':_0x5b4899['where']};return db[_0xd15c('0x28')]['count'](_0x243343)[_0xd15c('0x20')](function(_0x29b6d0){_0x4333e0[_0xd15c('0x1b')]=_0x29b6d0;if(_0x44b20b[_0xd15c('0x2e')][_0xd15c('0x3c')]){_0x5b4899['include']=[{'all':!![]}];}return db[_0xd15c('0x28')][_0xd15c('0x3d')](_0x5b4899);})[_0xd15c('0x20')](function(_0x249be2){_0x4333e0['rows']=_0x249be2;return _0x4333e0;})[_0xd15c('0x20')](respondWithFilteredResult(_0x542137,_0x5b4899))['catch'](handleError(_0x542137,null));};exports[_0xd15c('0x3e')]=function(_0x3457e4,_0x3272d8){var _0x5283c0={'raw':!![],'where':{'id':_0x3457e4['params']['id']}},_0x3f9beb={};_0x3f9beb[_0xd15c('0x2d')]=_['keys'](db[_0xd15c('0x28')][_0xd15c('0x29')]);_0x3f9beb[_0xd15c('0x2e')]=_['keys'](_0x3457e4[_0xd15c('0x2e')]);_0x3f9beb[_0xd15c('0x30')]=_[_0xd15c('0x31')](_0x3f9beb[_0xd15c('0x2d')],_0x3f9beb[_0xd15c('0x2e')]);_0x5283c0['attributes']=_[_0xd15c('0x31')](_0x3f9beb[_0xd15c('0x2d')],qs[_0xd15c('0x32')](_0x3457e4[_0xd15c('0x2e')][_0xd15c('0x32')]));_0x5283c0['attributes']=_0x5283c0[_0xd15c('0x33')]['length']?_0x5283c0[_0xd15c('0x33')]:_0x3f9beb[_0xd15c('0x2d')];if(_0x3457e4[_0xd15c('0x2e')][_0xd15c('0x3c')]){_0x5283c0['include']=[{'all':!![]}];}_0x5283c0=_[_0xd15c('0x3a')]({},_0x5283c0,_0x3457e4[_0xd15c('0x3b')]);return db[_0xd15c('0x28')][_0xd15c('0x3f')](_0x5283c0)[_0xd15c('0x20')](handleEntityNotFound(_0x3272d8,null))['then'](respondWithResult(_0x3272d8,null))[_0xd15c('0x40')](handleError(_0x3272d8,null));};exports['create']=function(_0x489234,_0xb6aae3){return db[_0xd15c('0x28')][_0xd15c('0x41')](_0x489234[_0xd15c('0x42')],{})[_0xd15c('0x20')](respondWithResult(_0xb6aae3,0xc9))[_0xd15c('0x40')](handleError(_0xb6aae3,null));};exports[_0xd15c('0x1e')]=function(_0x2d831b,_0x123017){if(_0x2d831b[_0xd15c('0x42')]['id']){delete _0x2d831b[_0xd15c('0x42')]['id'];}return db[_0xd15c('0x28')][_0xd15c('0x3f')]({'where':{'id':_0x2d831b[_0xd15c('0x43')]['id']}})[_0xd15c('0x20')](handleEntityNotFound(_0x123017,null))['then'](saveUpdates(_0x2d831b[_0xd15c('0x42')],null))['then'](respondWithResult(_0x123017,null))[_0xd15c('0x40')](handleError(_0x123017,null));};exports[_0xd15c('0x1f')]=function(_0x15f4a0,_0x293172){return db[_0xd15c('0x28')][_0xd15c('0x3f')]({'where':{'id':_0x15f4a0[_0xd15c('0x43')]['id']}})['then'](handleEntityNotFound(_0x293172,null))[_0xd15c('0x20')](removeEntity(_0x293172,null))[_0xd15c('0x40')](handleError(_0x293172,null));};
\ No newline at end of file
+var _0x34dd=['stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','fields','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x2f1820,_0x59560e){var _0x51ea5f=function(_0x1764b3){while(--_0x1764b3){_0x2f1820['push'](_0x2f1820['shift']());}};_0x51ea5f(++_0x59560e);}(_0x34dd,0x71));var _0xd34d=function(_0x1fc691,_0x2d39a1){_0x1fc691=_0x1fc691-0x0;var _0x2a67f8=_0x34dd[_0x1fc691];return _0x2a67f8;};'use strict';var emlformat=require(_0xd34d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd34d('0x1'));var jsonpatch=require(_0xd34d('0x2'));var rp=require(_0xd34d('0x3'));var moment=require(_0xd34d('0x4'));var BPromise=require(_0xd34d('0x5'));var Mustache=require(_0xd34d('0x6'));var util=require(_0xd34d('0x7'));var path=require('path');var sox=require(_0xd34d('0x8'));var csv=require(_0xd34d('0x9'));var ejs=require(_0xd34d('0xa'));var fs=require('fs');var fs_extra=require(_0xd34d('0xb'));var _=require('lodash');var squel=require(_0xd34d('0xc'));var crypto=require(_0xd34d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd34d('0xe'));var toCsv=require(_0xd34d('0x9'));var querystring=require(_0xd34d('0xf'));var Papa=require(_0xd34d('0x10'));var Redis=require('ioredis');var authService=require(_0xd34d('0x11'));var qs=require(_0xd34d('0x12'));var as=require(_0xd34d('0x13'));var hardwareService=require(_0xd34d('0x14'));var logger=require(_0xd34d('0x15'))(_0xd34d('0x16'));var utils=require('../../config/utils');var config=require(_0xd34d('0x17'));var licenseUtil=require(_0xd34d('0x18'));var db=require(_0xd34d('0x19'))['db'];function respondWithStatusCode(_0x572b9a,_0x36c728){_0x36c728=_0x36c728||0xcc;return function(_0x2fc748){if(_0x2fc748){return _0x572b9a[_0xd34d('0x1a')](_0x36c728);}return _0x572b9a[_0xd34d('0x1b')](_0x36c728)['end']();};}function respondWithResult(_0x2e4435,_0x2c03ee){_0x2c03ee=_0x2c03ee||0xc8;return function(_0x191810){if(_0x191810){return _0x2e4435['status'](_0x2c03ee)['json'](_0x191810);}};}function respondWithFilteredResult(_0x1a0746,_0x523168){return function(_0x229589){if(_0x229589){var _0x1dfa3b=typeof _0x523168[_0xd34d('0x1c')]==='undefined'&&typeof _0x523168['limit']===_0xd34d('0x1d');var _0x476115=_0x229589[_0xd34d('0x1e')];var _0x36859c=_0x1dfa3b?0x0:_0x523168[_0xd34d('0x1c')];var _0x4e7241=_0x1dfa3b?_0x229589[_0xd34d('0x1e')]:_0x523168[_0xd34d('0x1c')]+_0x523168['limit'];var _0x376743;if(_0x4e7241>=_0x476115){_0x4e7241=_0x476115;_0x376743=0xc8;}else{_0x376743=0xce;}_0x1a0746[_0xd34d('0x1b')](_0x376743);return _0x1a0746[_0xd34d('0x1f')](_0xd34d('0x20'),_0x36859c+'-'+_0x4e7241+'/'+_0x476115)[_0xd34d('0x21')](_0x229589);}return null;};}function patchUpdates(_0x553b4c){return function(_0x150eba){try{jsonpatch[_0xd34d('0x22')](_0x150eba,_0x553b4c,!![]);}catch(_0x268082){return BPromise[_0xd34d('0x23')](_0x268082);}return _0x150eba[_0xd34d('0x24')]();};}function saveUpdates(_0x4c47a1,_0x226967){return function(_0x148bc2){if(_0x148bc2){return _0x148bc2[_0xd34d('0x25')](_0x4c47a1)[_0xd34d('0x26')](function(_0x48ab8e){return _0x48ab8e;});}return null;};}function removeEntity(_0x59fc00,_0x89aef){return function(_0x428b42){if(_0x428b42){return _0x428b42[_0xd34d('0x27')]()[_0xd34d('0x26')](function(){_0x59fc00[_0xd34d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x293cb5,_0x9c8b16){return function(_0xbb729a){if(!_0xbb729a){_0x293cb5[_0xd34d('0x1a')](0x194);}return _0xbb729a;};}function handleError(_0x24d03b,_0x346ea8){_0x346ea8=_0x346ea8||0x1f4;return function(_0x3ba85f){logger[_0xd34d('0x28')](_0x3ba85f[_0xd34d('0x29')]);if(_0x3ba85f['name']){delete _0x3ba85f[_0xd34d('0x2a')];}_0x24d03b['status'](_0x346ea8)[_0xd34d('0x2b')](_0x3ba85f);};}exports[_0xd34d('0x2c')]=function(_0x33e65a,_0x4afbf4){var _0xd97d72={},_0x26e08a={},_0x1e62c1={'count':0x0,'rows':[]};var _0x51b60f=_[_0xd34d('0x2d')](db[_0xd34d('0x2e')][_0xd34d('0x2f')],function(_0x47cc55){return{'name':_0x47cc55[_0xd34d('0x30')],'type':_0x47cc55['type'][_0xd34d('0x31')]};});_0x26e08a[_0xd34d('0x32')]=_[_0xd34d('0x2d')](_0x51b60f,_0xd34d('0x2a'));_0x26e08a['query']=_[_0xd34d('0x33')](_0x33e65a[_0xd34d('0x34')]);_0x26e08a[_0xd34d('0x35')]=_[_0xd34d('0x36')](_0x26e08a['model'],_0x26e08a[_0xd34d('0x34')]);_0xd97d72['attributes']=_['intersection'](_0x26e08a[_0xd34d('0x32')],qs['fields'](_0x33e65a[_0xd34d('0x34')]['fields']));_0xd97d72['attributes']=_0xd97d72['attributes']['length']?_0xd97d72[_0xd34d('0x37')]:_0x26e08a[_0xd34d('0x32')];if(!_0x33e65a['query'][_0xd34d('0x38')](_0xd34d('0x39'))){_0xd97d72[_0xd34d('0x3a')]=qs[_0xd34d('0x3a')](_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3a')]);_0xd97d72[_0xd34d('0x1c')]=qs[_0xd34d('0x1c')](_0x33e65a['query'][_0xd34d('0x1c')]);}_0xd97d72[_0xd34d('0x3b')]=qs[_0xd34d('0x3c')](_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3c')]);_0xd97d72[_0xd34d('0x3d')]=qs['filters'](_['pick'](_0x33e65a[_0xd34d('0x34')],_0x26e08a[_0xd34d('0x35')]),_0x51b60f);if(_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3e')]){_0xd97d72[_0xd34d('0x3d')]=_['merge'](_0xd97d72['where'],{'$or':_['map'](_0x51b60f,function(_0x7aa6df){if(_0x7aa6df[_0xd34d('0x3f')]!==_0xd34d('0x40')){var _0x43d71b={};_0x43d71b[_0x7aa6df[_0xd34d('0x2a')]]={'$like':'%'+_0x33e65a[_0xd34d('0x34')][_0xd34d('0x3e')]+'%'};return _0x43d71b;}})});}_0xd97d72=_[_0xd34d('0x41')]({},_0xd97d72,_0x33e65a[_0xd34d('0x42')]);var _0x5a6a07={'where':_0xd97d72['where']};return db[_0xd34d('0x2e')][_0xd34d('0x1e')](_0x5a6a07)['then'](function(_0x277561){_0x1e62c1['count']=_0x277561;if(_0x33e65a['query'][_0xd34d('0x43')]){_0xd97d72['include']=[{'all':!![]}];}return db[_0xd34d('0x2e')]['findAll'](_0xd97d72);})[_0xd34d('0x26')](function(_0x16b446){_0x1e62c1[_0xd34d('0x44')]=_0x16b446;return _0x1e62c1;})[_0xd34d('0x26')](respondWithFilteredResult(_0x4afbf4,_0xd97d72))[_0xd34d('0x45')](handleError(_0x4afbf4,null));};exports[_0xd34d('0x46')]=function(_0x2aa386,_0x2aee95){var _0x2dea1b={'raw':!![],'where':{'id':_0x2aa386[_0xd34d('0x47')]['id']}},_0x4e5707={};_0x4e5707[_0xd34d('0x32')]=_['keys'](db[_0xd34d('0x2e')][_0xd34d('0x2f')]);_0x4e5707['query']=_['keys'](_0x2aa386[_0xd34d('0x34')]);_0x4e5707[_0xd34d('0x35')]=_['intersection'](_0x4e5707[_0xd34d('0x32')],_0x4e5707[_0xd34d('0x34')]);_0x2dea1b['attributes']=_[_0xd34d('0x36')](_0x4e5707[_0xd34d('0x32')],qs[_0xd34d('0x48')](_0x2aa386[_0xd34d('0x34')][_0xd34d('0x48')]));_0x2dea1b[_0xd34d('0x37')]=_0x2dea1b['attributes'][_0xd34d('0x49')]?_0x2dea1b[_0xd34d('0x37')]:_0x4e5707[_0xd34d('0x32')];if(_0x2aa386[_0xd34d('0x34')]['includeAll']){_0x2dea1b['include']=[{'all':!![]}];}_0x2dea1b=_['merge']({},_0x2dea1b,_0x2aa386[_0xd34d('0x42')]);return db[_0xd34d('0x2e')][_0xd34d('0x4a')](_0x2dea1b)[_0xd34d('0x26')](handleEntityNotFound(_0x2aee95,null))[_0xd34d('0x26')](respondWithResult(_0x2aee95,null))[_0xd34d('0x45')](handleError(_0x2aee95,null));};exports['create']=function(_0x1961ba,_0xd1ec0c){return db[_0xd34d('0x2e')][_0xd34d('0x4b')](_0x1961ba[_0xd34d('0x4c')],{})[_0xd34d('0x26')](respondWithResult(_0xd1ec0c,0xc9))[_0xd34d('0x45')](handleError(_0xd1ec0c,null));};exports['update']=function(_0x4c8c7e,_0x43e0bf){if(_0x4c8c7e[_0xd34d('0x4c')]['id']){delete _0x4c8c7e[_0xd34d('0x4c')]['id'];}return db[_0xd34d('0x2e')][_0xd34d('0x4a')]({'where':{'id':_0x4c8c7e['params']['id']}})[_0xd34d('0x26')](handleEntityNotFound(_0x43e0bf,null))['then'](saveUpdates(_0x4c8c7e[_0xd34d('0x4c')],null))[_0xd34d('0x26')](respondWithResult(_0x43e0bf,null))[_0xd34d('0x45')](handleError(_0x43e0bf,null));};exports[_0xd34d('0x27')]=function(_0x5f13a6,_0x2e5316){return db[_0xd34d('0x2e')][_0xd34d('0x4a')]({'where':{'id':_0x5f13a6['params']['id']}})[_0xd34d('0x26')](handleEntityNotFound(_0x2e5316,null))[_0xd34d('0x26')](removeEntity(_0x2e5316,null))[_0xd34d('0x45')](handleError(_0x2e5316,null));};
\ No newline at end of file
index b1b9d80..4b86f52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cfc=['../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x46c5d8,_0x199d5c){var _0x36dbf5=function(_0x4cb3d3){while(--_0x4cb3d3){_0x46c5d8['push'](_0x46c5d8['shift']());}};_0x36dbf5(++_0x199d5c);}(_0x8cfc,0xcc));var _0xc8cf=function(_0x36067f,_0xba548e){_0x36067f=_0x36067f-0x0;var _0x44f0b3=_0x8cfc[_0x36067f];return _0x44f0b3;};'use strict';var _=require(_0xc8cf('0x0'));var util=require('util');var logger=require(_0xc8cf('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc8cf('0x2'));var rp=require(_0xc8cf('0x3'));var fs=require('fs');var path=require(_0xc8cf('0x4'));var rimraf=require(_0xc8cf('0x5'));var config=require(_0xc8cf('0x6'));var attributes=require(_0xc8cf('0x7'));module[_0xc8cf('0x8')]=function(_0x20affa,_0x557aa7){return _0x20affa[_0xc8cf('0x9')](_0xc8cf('0xa'),attributes,{'tableName':_0xc8cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8cf('0xc'),'collate':_0xc8cf('0xd')});};
\ No newline at end of file
+var _0x54eb=['fax_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','define','FaxApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54eb,0x1ae));var _0xb54e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x54eb[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xb54e('0x0'));var util=require(_0xb54e('0x1'));var logger=require(_0xb54e('0x2'))(_0xb54e('0x3'));var moment=require(_0xb54e('0x4'));var BPromise=require(_0xb54e('0x5'));var rp=require(_0xb54e('0x6'));var fs=require('fs');var path=require(_0xb54e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x405aa1,_0x5317b7){return _0x405aa1[_0xb54e('0x8')](_0xb54e('0x9'),attributes,{'tableName':_0xb54e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 1e2879a..48b937e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5e4=['raw','where','attributes','limit','UpdateFaxApplication','debug','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','FaxApplication','options'];(function(_0x261e5,_0x4fa17c){var _0x332bde=function(_0x4912b6){while(--_0x4912b6){_0x261e5['push'](_0x261e5['shift']());}};_0x332bde(++_0x4fa17c);}(_0xa5e4,0xee));var _0x4a5e=function(_0x377097,_0x40bed1){_0x377097=_0x377097-0x0;var _0x4008bb=_0xa5e4[_0x377097];return _0x4008bb;};'use strict';var _=require(_0x4a5e('0x0'));var util=require(_0x4a5e('0x1'));var moment=require(_0x4a5e('0x2'));var BPromise=require(_0x4a5e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a5e('0x4'));var logger=require(_0x4a5e('0x5'))(_0x4a5e('0x6'));var config=require(_0x4a5e('0x7'));var jayson=require(_0x4a5e('0x8'));var client=jayson[_0x4a5e('0x9')][_0x4a5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x578e6b,_0x59730d,_0x2230cc){return new BPromise(function(_0x312d1a,_0x31d0f5){return client[_0x4a5e('0xb')](_0x578e6b,_0x2230cc)[_0x4a5e('0xc')](function(_0xfa6e7f){logger[_0x4a5e('0xd')](_0x4a5e('0xe'),_0x59730d,_0x4a5e('0xf'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x59730d,_0x4a5e('0xf'),JSON[_0x4a5e('0x10')](_0xfa6e7f));if(_0xfa6e7f['error']){if(_0xfa6e7f[_0x4a5e('0x11')]['code']===0x1f4){logger['error'](_0x4a5e('0xe'),_0x59730d,_0xfa6e7f['error'][_0x4a5e('0x12')]);return _0x31d0f5(_0xfa6e7f[_0x4a5e('0x11')][_0x4a5e('0x12')]);}logger[_0x4a5e('0x11')]('FaxApplication,\x20%s,\x20%s',_0x59730d,_0xfa6e7f['error'][_0x4a5e('0x12')]);return _0x312d1a(_0xfa6e7f[_0x4a5e('0x11')][_0x4a5e('0x12')]);}else{logger[_0x4a5e('0xd')](_0x4a5e('0xe'),_0x59730d,_0x4a5e('0xf'));_0x312d1a(_0xfa6e7f[_0x4a5e('0x13')]['message']);}})[_0x4a5e('0x14')](function(_0x2a3dea){logger[_0x4a5e('0x11')](_0x4a5e('0xe'),_0x59730d,_0x2a3dea);_0x31d0f5(_0x2a3dea);});});}exports['UpdateFaxApplication']=function(_0x3d3529){var _0x30afc4=this;return new Promise(function(_0x11d786,_0x2a1e1f){return db[_0x4a5e('0x15')]['update'](_0x3d3529['body'],{'raw':_0x3d3529[_0x4a5e('0x16')]?_0x3d3529[_0x4a5e('0x16')][_0x4a5e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d3529[_0x4a5e('0x16')]?_0x3d3529['options'][_0x4a5e('0x18')]||null:null,'attributes':_0x3d3529[_0x4a5e('0x16')]?_0x3d3529[_0x4a5e('0x16')][_0x4a5e('0x19')]||null:null,'limit':_0x3d3529['options']?_0x3d3529[_0x4a5e('0x16')][_0x4a5e('0x1a')]||null:null})[_0x4a5e('0xc')](function(_0x4d9611){logger['info'](_0x4a5e('0x1b'),_0x3d3529);logger[_0x4a5e('0x1c')](_0x4a5e('0x1b'),_0x3d3529,JSON[_0x4a5e('0x10')](_0x4d9611));_0x11d786(_0x4d9611);})[_0x4a5e('0x14')](function(_0x124f6b){logger[_0x4a5e('0x11')]('UpdateFaxApplication',_0x124f6b[_0x4a5e('0x12')],_0x3d3529);_0x2a1e1f(_0x30afc4['error'](0x1f4,_0x124f6b['message']));});});};
\ No newline at end of file
+var _0x8734=['FaxApplication,\x20%s,\x20%s','message','result','FaxApplication','update','options','raw','attributes','limit','UpdateFaxApplication','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','error','code'];(function(_0x25dfdf,_0x542333){var _0x5220da=function(_0x53accc){while(--_0x53accc){_0x25dfdf['push'](_0x25dfdf['shift']());}};_0x5220da(++_0x542333);}(_0x8734,0x134));var _0x4873=function(_0x1a48f2,_0x5d2109){_0x1a48f2=_0x1a48f2-0x0;var _0x2b46c6=_0x8734[_0x1a48f2];return _0x2b46c6;};'use strict';var _=require(_0x4873('0x0'));var util=require('util');var moment=require(_0x4873('0x1'));var BPromise=require(_0x4873('0x2'));var rs=require(_0x4873('0x3'));var fs=require('fs');var Redis=require(_0x4873('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4873('0x5'));var logger=require('../../config/logger')(_0x4873('0x6'));var config=require(_0x4873('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4873('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ea436,_0x567400,_0x22ed5c){return new BPromise(function(_0x54fdb5,_0x2833e5){return client[_0x4873('0x9')](_0x5ea436,_0x22ed5c)[_0x4873('0xa')](function(_0x41ecd9){logger[_0x4873('0xb')]('FaxApplication,\x20%s,\x20%s',_0x567400,_0x4873('0xc'));logger[_0x4873('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x567400,_0x4873('0xc'),JSON['stringify'](_0x41ecd9));if(_0x41ecd9[_0x4873('0xe')]){if(_0x41ecd9[_0x4873('0xe')][_0x4873('0xf')]===0x1f4){logger['error'](_0x4873('0x10'),_0x567400,_0x41ecd9['error'][_0x4873('0x11')]);return _0x2833e5(_0x41ecd9[_0x4873('0xe')][_0x4873('0x11')]);}logger['error'](_0x4873('0x10'),_0x567400,_0x41ecd9[_0x4873('0xe')][_0x4873('0x11')]);return _0x54fdb5(_0x41ecd9[_0x4873('0xe')]['message']);}else{logger['info'](_0x4873('0x10'),_0x567400,_0x4873('0xc'));_0x54fdb5(_0x41ecd9[_0x4873('0x12')][_0x4873('0x11')]);}})['catch'](function(_0x471eb3){logger[_0x4873('0xe')]('FaxApplication,\x20%s,\x20%s',_0x567400,_0x471eb3);_0x2833e5(_0x471eb3);});});}exports['UpdateFaxApplication']=function(_0x469b41){var _0x4d5801=this;return new Promise(function(_0x3075eb,_0x564c50){return db[_0x4873('0x13')][_0x4873('0x14')](_0x469b41['body'],{'raw':_0x469b41['options']?_0x469b41[_0x4873('0x15')][_0x4873('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469b41['options']?_0x469b41[_0x4873('0x15')]['where']||null:null,'attributes':_0x469b41[_0x4873('0x15')]?_0x469b41[_0x4873('0x15')][_0x4873('0x17')]||null:null,'limit':_0x469b41[_0x4873('0x15')]?_0x469b41['options'][_0x4873('0x18')]||null:null})[_0x4873('0xa')](function(_0x1baee1){logger[_0x4873('0xb')]('UpdateFaxApplication',_0x469b41);logger[_0x4873('0xd')](_0x4873('0x19'),_0x469b41,JSON['stringify'](_0x1baee1));_0x3075eb(_0x1baee1);})[_0x4873('0x1a')](function(_0x4a9cd6){logger[_0x4873('0xe')](_0x4873('0x19'),_0x4a9cd6[_0x4873('0x11')],_0x469b41);_0x564c50(_0x4d5801[_0x4873('0xe')](0x1f4,_0x4a9cd6[_0x4873('0x11')]));});});};
\ No newline at end of file
index ae3eda6..ea444d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4c=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x8f4c,0x113));var _0xc8f4=function(_0x28fad6,_0x2d2220){_0x28fad6=_0x28fad6-0x0;var _0x3c6f2f=_0x8f4c[_0x28fad6];return _0x3c6f2f;};'use strict';var multer=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var path=require(_0xc8f4('0x2'));var timeout=require(_0xc8f4('0x3'));var express=require(_0xc8f4('0x4'));var router=express[_0xc8f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc8f4('0x6'));var interaction=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var controller=require('./faxApplication.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0xc')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router[_0xc8f4('0xf')]('/:id',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x11')](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x5c00=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x276ff1,_0x8489c0){var _0x5e6000=function(_0xb7fe9d){while(--_0xb7fe9d){_0x276ff1['push'](_0x276ff1['shift']());}};_0x5e6000(++_0x8489c0);}(_0x5c00,0x17e));var _0x05c0=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x5c00[_0x425716];return _0x2d39af;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./faxApplication.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0xc')]('/',auth['isAuthenticated'](),controller[_0x05c0('0xd')]);router[_0x05c0('0xe')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router[_0x05c0('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x05c0('0x12')]);module['exports']=router;
\ No newline at end of file
index 07f64e7..2409526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd1=['STRING','ENUM','out','sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbd1,0x12f));var _0x1bbd=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbbd1[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x1bbd('0x0'));module[_0x1bbd('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1bbd('0x2')]},'disposition':{'type':Sequelize[_0x1bbd('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1bbd('0x3')]},'note':{'type':Sequelize[_0x1bbd('0x3')]},'read1stAt':{'type':Sequelize[_0x1bbd('0x2')]},'fax':{'type':Sequelize[_0x1bbd('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1bbd('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x1bbd('0x4')]('in',_0x1bbd('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xdb33=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0xdb33,0x18c));var _0x3db3=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xdb33[_0x44216d];return _0xeca523;};'use strict';var Sequelize=require(_0x3db3('0x0'));module[_0x3db3('0x1')]={'closed':{'type':Sequelize[_0x3db3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3db3('0x3')]},'disposition':{'type':Sequelize[_0x3db3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3db3('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3db3('0x3')]},'fax':{'type':Sequelize[_0x3db3('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3db3('0x5')]('in',_0x3db3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3db3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3db3('0x5')]('in',_0x3db3('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 39c09f8..da65e82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e3=['limit','count','json','apply','update','destroy','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','FaxInteraction','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','offset','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','fax_accounts','a.id\x20=\x20i.FaxAccountId','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','forEach','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','compact','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','isEmpty','i.FaxAccountId\x20IS\x20NULL','agent','FaxAccountId','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.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','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','includeAll','options','create','describe','addMessage','FaxMessage','ids','omit','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','emit','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','createWriteStream','download','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','undefined'];(function(_0x3185af,_0x58ae43){var _0x1c4e3c=function(_0x54b09e){while(--_0x54b09e){_0x3185af['push'](_0x3185af['shift']());}};_0x1c4e3c(++_0x58ae43);}(_0x96e3,0x179));var _0x396e=function(_0x2f36b2,_0x1cfc4f){_0x2f36b2=_0x2f36b2-0x0;var _0x8a378c=_0x96e3[_0x2f36b2];return _0x8a378c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x396e('0x0'));var zipdir=require(_0x396e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x396e('0x2'));var moment=require(_0x396e('0x3'));var BPromise=require(_0x396e('0x4'));var Mustache=require(_0x396e('0x5'));var util=require(_0x396e('0x6'));var path=require(_0x396e('0x7'));var sox=require(_0x396e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x396e('0x9'));var _=require(_0x396e('0xa'));var squel=require(_0x396e('0xb'));var crypto=require('crypto');var jsforce=require(_0x396e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x396e('0xd'));var querystring=require(_0x396e('0xe'));var Papa=require(_0x396e('0xf'));var Redis=require(_0x396e('0x10'));var authService=require(_0x396e('0x11'));var qs=require(_0x396e('0x12'));var as=require(_0x396e('0x13'));var hardwareService=require(_0x396e('0x14'));var logger=require(_0x396e('0x15'))('api');var utils=require(_0x396e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x396e('0x17'));var db=require(_0x396e('0x18'))['db'];config[_0x396e('0x19')]=_[_0x396e('0x1a')](config['redis'],{'host':_0x396e('0x1b'),'port':0x18eb});var socket=require(_0x396e('0x1c'))(new Redis(config[_0x396e('0x19')]));require('./faxInteraction.socket')[_0x396e('0x1d')](socket);function respondWithStatusCode(_0x5144f9,_0x1e5702){_0x1e5702=_0x1e5702||0xcc;return function(_0x3c97b5){if(_0x3c97b5){return _0x5144f9['sendStatus'](_0x1e5702);}return _0x5144f9['status'](_0x1e5702)[_0x396e('0x1e')]();};}function respondWithResult(_0x238583,_0xe5b6ac){_0xe5b6ac=_0xe5b6ac||0xc8;return function(_0x5a1f9d){if(_0x5a1f9d){return _0x238583[_0x396e('0x1f')](_0xe5b6ac)['json'](_0x5a1f9d);}};}function respondWithFilteredResult(_0xf15a02,_0x561ee6){return function(_0x54f411){if(_0x54f411){var _0x5a12e0=typeof _0x561ee6['offset']===_0x396e('0x20')&&typeof _0x561ee6[_0x396e('0x21')]===_0x396e('0x20');var _0x926f3=_0x54f411['count'];var _0x102362=_0x5a12e0?0x0:_0x561ee6['offset'];var _0x50b688=_0x5a12e0?_0x54f411[_0x396e('0x22')]:_0x561ee6['offset']+_0x561ee6[_0x396e('0x21')];var _0x5c9c97;if(_0x50b688>=_0x926f3){_0x50b688=_0x926f3;_0x5c9c97=0xc8;}else{_0x5c9c97=0xce;}_0xf15a02[_0x396e('0x1f')](_0x5c9c97);return _0xf15a02['set']('Content-Range',_0x102362+'-'+_0x50b688+'/'+_0x926f3)[_0x396e('0x23')](_0x54f411);}return null;};}function patchUpdates(_0x336ba1){return function(_0x2313ad){try{jsonpatch[_0x396e('0x24')](_0x2313ad,_0x336ba1,!![]);}catch(_0x49d9e3){return BPromise['reject'](_0x49d9e3);}return _0x2313ad['save']();};}function saveUpdates(_0x3cf871,_0x44f256){return function(_0x1423ed){if(_0x1423ed){return _0x1423ed[_0x396e('0x25')](_0x3cf871)['then'](function(_0x159011){return _0x159011;});}return null;};}function removeEntity(_0x419bdd,_0x11ead8){return function(_0x3532c8){if(_0x3532c8){return _0x3532c8[_0x396e('0x26')]()[_0x396e('0x27')](function(){_0x419bdd[_0x396e('0x1f')](0xcc)[_0x396e('0x1e')]();});}};}function handleEntityNotFound(_0x13b226,_0x1aba0d){return function(_0x3cf504){if(!_0x3cf504){_0x13b226[_0x396e('0x28')](0x194);}return _0x3cf504;};}function handleError(_0x5c853a,_0x3ca450){_0x3ca450=_0x3ca450||0x1f4;return function(_0x40c433){logger[_0x396e('0x29')](_0x40c433[_0x396e('0x2a')]);if(_0x40c433[_0x396e('0x2b')]){delete _0x40c433[_0x396e('0x2b')];}_0x5c853a[_0x396e('0x1f')](_0x3ca450)[_0x396e('0x2c')](_0x40c433);};}function getInteractionUsers(_0x2acbe6,_0x388373){return new BPromise(function(_0x2b4817,_0x48868d){try{if(_0x388373[_0x2acbe6['id']]){_0x2acbe6[_0x396e('0x2d')]=_[_0x396e('0x2e')](_0x388373[_0x2acbe6['id']],function(_0x49c2fb){return{'id':_0x49c2fb['id'],'fullname':_0x49c2fb[_0x396e('0x2f')]};});}}catch(_0x43b17a){_0x48868d(_0x43b17a);}_0x2b4817(_0x2acbe6);});}function getInteractionTags(_0x19a946,_0x5006a1){return new BPromise(function(_0x3189e4,_0x417d82){try{if(_0x19a946[_0x396e('0x30')]){_0x19a946[_0x396e('0x31')]=[];_0x19a946[_0x396e('0x30')][_0x396e('0x32')](',')['forEach'](function(_0x173df0){_0x19a946[_0x396e('0x31')][_0x396e('0x33')](_0x5006a1[_0x173df0]);});}delete _0x19a946['TagIds'];}catch(_0x485505){_0x417d82(_0x485505);}_0x3189e4(_0x19a946);});}function updateFaxInteraction(_0x18c384,_0x13ca8f,_0x4aac45){return new BPromise(function(_0x574263,_0x49f7c6){return getInteractionUsers(_0x18c384,_0x4aac45)['then'](function(_0x595d02){return getInteractionTags(_0x595d02,_0x13ca8f);})[_0x396e('0x27')](function(_0x4cedc5){_0x574263(_0x4cedc5);})[_0x396e('0x34')](function(_0x53378f){_0x49f7c6(_0x53378f);});});}exports[_0x396e('0x35')]=function(_0x21b545,_0x3c3bd2){var _0x25603c={},_0x3535f5={},_0x788a5d={'count':0x0,'rows':[]};var _0x3701da=_['map'](db[_0x396e('0x36')][_0x396e('0x37')],function(_0x33acb5){return{'name':_0x33acb5['fieldName'],'type':_0x33acb5[_0x396e('0x38')]['key']};});_0x3535f5['model']=_[_0x396e('0x2e')](_0x3701da,_0x396e('0x2b'));_0x3535f5[_0x396e('0x39')]=_[_0x396e('0x3a')](_0x21b545[_0x396e('0x39')]);_0x3535f5[_0x396e('0x3b')]=_[_0x396e('0x3c')](_0x3535f5['model'],_0x3535f5[_0x396e('0x39')]);_0x25603c['attributes']=_[_0x396e('0x3c')](_0x3535f5[_0x396e('0x3d')],qs[_0x396e('0x3e')](_0x21b545[_0x396e('0x39')]['fields']));_0x25603c[_0x396e('0x3f')]=_0x25603c['attributes'][_0x396e('0x40')]?_0x25603c[_0x396e('0x3f')]:_0x3535f5[_0x396e('0x3d')];if(!_0x21b545[_0x396e('0x39')]['hasOwnProperty']('nolimit')){_0x25603c[_0x396e('0x21')]=qs[_0x396e('0x21')](_0x21b545[_0x396e('0x39')][_0x396e('0x21')]);_0x25603c[_0x396e('0x41')]=qs['offset'](_0x21b545[_0x396e('0x39')][_0x396e('0x41')]);}_0x25603c[_0x396e('0x42')]=qs[_0x396e('0x43')](_0x21b545[_0x396e('0x39')]['sort']);_0x25603c[_0x396e('0x44')]=qs[_0x396e('0x3b')](_['pick'](_0x21b545['query'],_0x3535f5['filters']),_0x3701da);var _0x3937a8=[];var _0x2442b5=squel['select']()[_0x396e('0x45')]('id')[_0x396e('0x45')](_0x396e('0x2b'))[_0x396e('0x45')](_0x396e('0x46'))[_0x396e('0x47')](_0x396e('0x48'));var _0x38af16=squel[_0x396e('0x49')]()[_0x396e('0x45')](_0x396e('0x4a'))[_0x396e('0x45')](_0x396e('0x4b'))['field']('ui.FaxInteractionId')[_0x396e('0x47')]('user_has_fax_interactions','ui')['left_join'](_0x396e('0x4c'),'u',_0x396e('0x4d'));var _0x20b20d=squel[_0x396e('0x49')]()[_0x396e('0x47')](_0x396e('0x4e'),'i')['left_join'](_0x396e('0x4f'),'c',_0x396e('0x50'))['left_join'](_0x396e('0x4c'),'o',_0x396e('0x51'))[_0x396e('0x52')](_0x396e('0x53'),'a',_0x396e('0x54'))[_0x396e('0x52')]('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')[_0x396e('0x52')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x396e('0x52')](_0x396e('0x48'),'t',_0x396e('0x55'));var _0x2f69a8=squel['expr']();var _0x4d90aa=[];var _0xdabeec=squel[_0x396e('0x56')]();var _0x2868e3;if(_0x21b545[_0x396e('0x39')][_0x396e('0x57')]){_0x2868e3=as[_0x396e('0x58')](_0x21b545['query'][_0x396e('0x57')]);var _0x15c531=_0x2868e3[_0x396e('0x59')];for(var _0x436987=0x0;_0x436987<_0x2868e3['conditions'][_0x396e('0x40')];_0x436987++){var _0x53f8af=_0x2868e3[_0x396e('0x5a')][_0x436987];var _0x558172='i';var _0x5af5d9=_['find'](_0x3701da,['name',_0x53f8af[_0x396e('0x45')]]);if(!_0x5af5d9){switch(_0x53f8af['field']){case _0x396e('0x5b'):if(_0x53f8af[_0x396e('0x5c')]==0x1){_0x20b20d[_0x396e('0x5d')]('`'+_0x53f8af[_0x396e('0x45')]+_0x396e('0x5e'));}else{_0x20b20d[_0x396e('0x5d')]('`'+_0x53f8af[_0x396e('0x45')]+_0x396e('0x5f'));}break;case _0x396e('0x60'):if(_0x53f8af['operator']===_0x396e('0x61')){if(_0x53f8af['value'][_0x396e('0x32')]('\x20')[_0x396e('0x40')]>0x1){_0x2f69a8[_0x15c531](_0x396e('0x62'),qs[_0x396e('0x63')](_0x53f8af[_0x396e('0x5c')]),null);}else{var _0x3522fc='%'+_0x53f8af[_0x396e('0x5c')]+'%';_0x2f69a8[_0x15c531](_0x396e('0x64'),_0x3522fc,_0x3522fc,_0x3522fc);}}else{_0x5af5d9=_[_0x396e('0x65')](_0x3701da,[_0x396e('0x2b'),_0x396e('0x66')]);_0x53f8af[_0x396e('0x45')]=_0x396e('0x66');_0x5191e0=as[_0x396e('0x67')](_0x558172,_0x5af5d9[_0x396e('0x38')],_0x53f8af);_0x2f69a8[_0x15c531](_0x5191e0['text'],_0x5191e0[_0x396e('0x5c')][_0x396e('0x68')],_0x5191e0[_0x396e('0x5c')][_0x396e('0x1e')]);}break;case _0x396e('0x69'):var _0x28ef6c=_0x53f8af['value'][_0x396e('0x32')](',')[_0x396e('0x2e')](function(_0x3ffbb3){return Number(_0x3ffbb3);});_0x28ef6c[_0x396e('0x6a')](function(_0xbc2b6d){_0xdabeec['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbc2b6d+',%');});_0x4d90aa=_['union'](_0x4d90aa,_0x28ef6c);break;case'User':if(_0x53f8af['operator']===_0x396e('0x61')){_0x2f69a8[_0x15c531](_0x396e('0x6b'),'%'+_0x53f8af[_0x396e('0x5c')]+'%',null);}else{_0x5af5d9=_[_0x396e('0x65')](_0x3701da,['name',_0x396e('0x6c')]);_0x53f8af['field']=_0x396e('0x6c');_0x5191e0=as[_0x396e('0x67')](_0x558172,_0x5af5d9[_0x396e('0x38')],_0x53f8af);_0x2f69a8[_0x15c531](_0x5191e0[_0x396e('0x6d')],_0x5191e0['value'][_0x396e('0x68')],_0x5191e0[_0x396e('0x5c')][_0x396e('0x1e')]);}break;case _0x396e('0x6e'):_0x5191e0=as[_0x396e('0x67')]('me',null,_0x53f8af);_0x2f69a8[_0x15c531](_0x5191e0[_0x396e('0x6d')],_0x5191e0[_0x396e('0x5c')][_0x396e('0x68')],_0x5191e0[_0x396e('0x5c')][_0x396e('0x1e')]);break;}}else{var _0x5191e0=as[_0x396e('0x67')](_0x558172,_0x5af5d9[_0x396e('0x38')],_0x53f8af);_0x2f69a8[_0x15c531](_0x5191e0['text'],_0x5191e0['value'][_0x396e('0x68')],_0x5191e0['value']['end']);}}}else{var _0x4e5b33=_(_0x21b545[_0x396e('0x39')])[_0x396e('0x3a')]()[_0x396e('0x2e')](function(_0x704365){return _['some'](_0x3701da,[_0x396e('0x2b'),_0x704365])?_0x704365:undefined;})[_0x396e('0x6f')]()['value']();if(!_['isEmpty'](_0x4e5b33)){_0x4e5b33[_0x396e('0x6a')](function(_0x477714){if(_0x477714==='FaxAccountId'){_0x20b20d['where'](_0x396e('0x70'),[]['concat'](_0x21b545['query'][_0x477714]));}else if(_0x477714==='createdAt'){var _0x1e0953=JSON[_0x396e('0x71')](_0x21b545[_0x396e('0x39')][_0x477714])[_0x396e('0x72')];var _0x3166d8=JSON['parse'](_0x21b545[_0x396e('0x39')][_0x477714])[_0x396e('0x73')];_0x20b20d[_0x396e('0x44')](_0x396e('0x74'),_0x1e0953,_0x3166d8);}else{if(_0x21b545[_0x396e('0x39')][_0x477714]===_0x396e('0x75')){_0x20b20d[_0x396e('0x44')]('i.'+_0x477714+'\x20IS\x20NULL');}else{_0x20b20d[_0x396e('0x44')]('i.'+_0x477714+_0x396e('0x76'),_0x21b545[_0x396e('0x39')][_0x477714]);}}});}if(_0x21b545[_0x396e('0x39')][_0x396e('0x77')]){if(_0x21b545[_0x396e('0x39')]['read']==0x1){_0x20b20d[_0x396e('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x20b20d[_0x396e('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x21b545[_0x396e('0x39')][_0x396e('0x78')]){_0x4d90aa=_['isArray'](_0x21b545[_0x396e('0x39')]['tag'])?_0x21b545[_0x396e('0x39')]['tag']:new Array(_0x21b545[_0x396e('0x39')][_0x396e('0x78')]);_0x4d90aa[_0x396e('0x6a')](function(_0x1cf460){_0xdabeec['or'](_0x396e('0x79'),'%,'+_0x1cf460+',%');});}if(_0x21b545[_0x396e('0x39')]['filter']){var _0x58cc39=_0x21b545[_0x396e('0x39')][_0x396e('0x7a')][_0x396e('0x7b')]('\x5c','\x5c\x5c')[_0x396e('0x7b')](/'/g,'\x27\x27');if(qs[_0x396e('0x7c')](_0x58cc39)){_0x2f69a8['or'](_0x396e('0x7d'),_0x58cc39+'%')['or'](_0x396e('0x7e'),_0x58cc39+'%');}_0x2f69a8['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x58cc39+'%');}}_0x20b20d['where'](_0x2f69a8);_0x20b20d[_0x396e('0x7f')](_0x396e('0x80'));var _0x9faa8d={'type':db['Sequelize'][_0x396e('0x81')][_0x396e('0x82')],'raw':!![]};var _0x4d9e05=_0x20b20d[_0x396e('0x83')]();_0x4d9e05[_0x396e('0x45')]('i.id');_0x4d9e05[_0x396e('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x396e('0x5b'));if(_0x25603c[_0x396e('0x42')]){_0x25603c['order'][_0x396e('0x6a')](function(_0x348e9c){var _0x2df014=_0x348e9c[0x0]===_0x396e('0x84')?_0x348e9c[0x0]:'i.'+_0x348e9c[0x0];_0x20b20d['order'](_0x2df014,_0x348e9c[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x4d90aa)){_0x20b20d[_0x396e('0x5d')](_0xdabeec);_0x4d9e05[_0x396e('0x44')](_0x396e('0x85'),_0x4d90aa);}BPromise[_0x396e('0x86')]()[_0x396e('0x27')](function(){if(!_0x2868e3){if(_0x21b545[_0x396e('0x39')]['FaxAccountId'])return;_0x4d9e05[_0x396e('0x44')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x20b20d[_0x396e('0x44')](_0x396e('0x87'));return;}if(_0x21b545[_0x396e('0x88')][_0x396e('0x89')]!=='agent')return;return _0x21b545['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x396e('0x27')](function(_0x3190ae){if(_[_0x396e('0x8a')](_0x3190ae)){_0x4d9e05['where'](_0x396e('0x8b'));_0x20b20d['where'](_0x396e('0x8b'));}else{_0x4d9e05[_0x396e('0x44')](_0x396e('0x70'),_[_0x396e('0x2e')](_0x3190ae,'id'));_0x20b20d['where']('i.FaxAccountId\x20IN\x20?',_[_0x396e('0x2e')](_0x3190ae,'id'));}});})[_0x396e('0x27')](function(){if(_0x21b545[_0x396e('0x88')][_0x396e('0x89')]===_0x396e('0x8c')&&!_0x2868e3&&!_0x21b545[_0x396e('0x39')][_0x396e('0x8d')])return[];return db['sequelize'][_0x396e('0x39')](_0x4d9e05['toString'](),_0x9faa8d);})[_0x396e('0x27')](function(_0x5e0151){_0x788a5d['count']=_0x5e0151[_0x396e('0x40')];if(_0x788a5d[_0x396e('0x22')]===0x0)return[];return db[_0x396e('0x8e')][_0x396e('0x39')](_0x2442b5['toString'](),_0x9faa8d)['then'](function(_0x28768d){_0x3937a8=_[_0x396e('0x8f')](_0x28768d,'id');_0x9faa8d=_[_0x396e('0x90')](_0x9faa8d,{'model':db[_0x396e('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x21b545[_0x396e('0x39')][_0x396e('0x3e')]){_0x25603c[_0x396e('0x3f')][_0x396e('0x6a')](function(_0x4bf3bb){_0x20b20d[_0x396e('0x45')]('i.'+_0x4bf3bb);});}else{_0x20b20d['field'](_0x396e('0x91'),'unreadMessages');_0x20b20d[_0x396e('0x45')](_0x396e('0x92'),_0x396e('0x93'));_0x20b20d[_0x396e('0x45')](_0x396e('0x94'),'Account.mandatoryDisposition');_0x20b20d[_0x396e('0x45')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x20b20d[_0x396e('0x45')](_0x396e('0x95'));_0x20b20d[_0x396e('0x45')](_0x396e('0x96'),_0x396e('0x97'));_0x20b20d[_0x396e('0x45')](_0x396e('0x98'),_0x396e('0x99'));_0x20b20d['field'](_0x396e('0x9a'),'Contact.email');_0x20b20d['field'](_0x396e('0x9b'),_0x396e('0x9c'));_0x20b20d[_0x396e('0x45')]('c.mobile',_0x396e('0x9d'));_0x20b20d['field'](_0x396e('0x9e'),_0x396e('0x9f'));_0x20b20d[_0x396e('0x45')](_0x396e('0xa0'),_0x396e('0xa1'));_0x20b20d['field'](_0x396e('0xa2'),'Owner.internal');_0x20b20d['field'](_0x396e('0xa3'),_0x396e('0x30'));}if(_0x25603c[_0x396e('0x21')])_0x20b20d['limit'](_0x25603c[_0x396e('0x21')]);if(_0x25603c[_0x396e('0x41')])_0x20b20d['offset'](_0x25603c[_0x396e('0x41')]);return db[_0x396e('0x8e')]['query'](_0x20b20d[_0x396e('0xa4')](),_0x9faa8d);})['then'](function(_0x9af7d2){if(_0x9af7d2['length']>0x0)_0x38af16[_0x396e('0x44')](_0x396e('0xa5'),_[_0x396e('0x2e')](_0x9af7d2,'id'));return db[_0x396e('0x8e')][_0x396e('0x39')](_0x38af16[_0x396e('0xa4')](),_0x9faa8d)[_0x396e('0x27')](function(_0x533b76){var _0x5c27a8=_[_0x396e('0xa6')](_0x533b76,_0x396e('0xa7'));var _0x10611b=[];_0x9af7d2['forEach'](function(_0x3d8318){_0x10611b['push'](updateFaxInteraction(_0x3d8318,_0x3937a8,_0x5c27a8));});return BPromise[_0x396e('0xa8')](_0x10611b);});});})[_0x396e('0x27')](function(_0x581c2b){_0x788a5d['rows']=_0x581c2b;return _0x788a5d;})[_0x396e('0x27')](respondWithFilteredResult(_0x3c3bd2,_0x25603c))[_0x396e('0x34')](handleError(_0x3c3bd2,null));};exports[_0x396e('0xa9')]=function(_0x3b1033,_0x45f4f0){var _0x5ea61b={'raw':![],'where':{'id':_0x3b1033[_0x396e('0xaa')]['id']}},_0x59140e={};_0x59140e[_0x396e('0x3d')]=_['keys'](db[_0x396e('0x36')][_0x396e('0x37')]);_0x59140e[_0x396e('0x39')]=_[_0x396e('0x3a')](_0x3b1033[_0x396e('0x39')]);_0x59140e[_0x396e('0x3b')]=_[_0x396e('0x3c')](_0x59140e[_0x396e('0x3d')],_0x59140e['query']);_0x5ea61b[_0x396e('0x3f')]=_[_0x396e('0x3c')](_0x59140e[_0x396e('0x3d')],qs[_0x396e('0x3e')](_0x3b1033['query'][_0x396e('0x3e')]));_0x5ea61b[_0x396e('0x3f')]=_0x5ea61b['attributes']['length']?_0x5ea61b[_0x396e('0x3f')]:_0x59140e[_0x396e('0x3d')];if(_0x3b1033['query'][_0x396e('0xab')]){_0x5ea61b['include']=[{'all':!![]}];}_0x5ea61b=_['merge']({},_0x5ea61b,_0x3b1033[_0x396e('0xac')]);return db['FaxInteraction'][_0x396e('0x65')](_0x5ea61b)['then'](handleEntityNotFound(_0x45f4f0,null))[_0x396e('0x27')](respondWithResult(_0x45f4f0,null))['catch'](handleError(_0x45f4f0,null));};exports[_0x396e('0xad')]=function(_0x3c8a16,_0x9ceae1){return db[_0x396e('0x36')][_0x396e('0xad')](_0x3c8a16['body'],{})[_0x396e('0x27')](respondWithResult(_0x9ceae1,0xc9))[_0x396e('0x34')](handleError(_0x9ceae1,null));};exports[_0x396e('0x25')]=function(_0x598357,_0x259ee3){if(_0x598357['body']['id']){delete _0x598357['body']['id'];}return db[_0x396e('0x36')][_0x396e('0x65')]({'where':{'id':_0x598357['params']['id']}})[_0x396e('0x27')](handleEntityNotFound(_0x259ee3,null))[_0x396e('0x27')](saveUpdates(_0x598357['body'],null))[_0x396e('0x27')](respondWithResult(_0x259ee3,null))[_0x396e('0x34')](handleError(_0x259ee3,null));};exports[_0x396e('0x26')]=function(_0x1ad3d1,_0x4b2d7a){return db[_0x396e('0x36')][_0x396e('0x65')]({'where':{'id':_0x1ad3d1[_0x396e('0xaa')]['id']}})['then'](handleEntityNotFound(_0x4b2d7a,null))[_0x396e('0x27')](removeEntity(_0x4b2d7a,null))[_0x396e('0x34')](handleError(_0x4b2d7a,null));};exports[_0x396e('0xae')]=function(_0x1c22fd,_0x2859e0){return db[_0x396e('0x36')][_0x396e('0xae')]()['then'](respondWithResult(_0x2859e0,null))['catch'](handleError(_0x2859e0,null));};exports[_0x396e('0xaf')]=function(_0x4eb47d,_0x1e6de9,_0x2f00a4){return db[_0x396e('0xb0')][_0x396e('0x65')]({'where':{'id':_0x4eb47d[_0x396e('0xaa')]['id']}})[_0x396e('0x27')](handleEntityNotFound(_0x1e6de9,null))['then'](function(_0x46d566){if(_0x46d566){return _0x46d566[_0x396e('0xaf')](_0x4eb47d[_0x396e('0x6e')][_0x396e('0xb1')],_[_0x396e('0xb2')](_0x4eb47d[_0x396e('0x6e')],[_0x396e('0xb1'),'id'])||{});}})[_0x396e('0x27')](respondWithResult(_0x1e6de9,null))[_0x396e('0x34')](handleError(_0x1e6de9,null));};exports['getMessages']=function(_0x2ac42a,_0x47db79,_0x1ce89d){var _0x213a1e={'raw':![],'where':{}};var _0x18446e={};var _0x4c0695={'count':0x0,'rows':[]};return db[_0x396e('0x36')][_0x396e('0xb3')]({'where':{'id':_0x2ac42a[_0x396e('0xaa')]['id']}})[_0x396e('0x27')](handleEntityNotFound(_0x47db79,null))[_0x396e('0x27')](function(_0x334820){if(_0x334820){_0x18446e[_0x396e('0x3d')]=_[_0x396e('0x3a')](db[_0x396e('0xb0')][_0x396e('0x37')]);_0x18446e[_0x396e('0x39')]=_[_0x396e('0x3a')](_0x2ac42a[_0x396e('0x39')]);_0x18446e[_0x396e('0x3b')]=_['intersection'](_0x18446e[_0x396e('0x3d')],_0x18446e[_0x396e('0x39')]);_0x213a1e['attributes']=_[_0x396e('0x3c')](_0x18446e[_0x396e('0x3d')],qs[_0x396e('0x3e')](_0x2ac42a[_0x396e('0x39')][_0x396e('0x3e')]));_0x213a1e[_0x396e('0x3f')]=_0x213a1e[_0x396e('0x3f')][_0x396e('0x40')]?_0x213a1e[_0x396e('0x3f')]:_0x18446e['model'];if(!_0x2ac42a['query']['hasOwnProperty'](_0x396e('0xb4'))){_0x213a1e[_0x396e('0x21')]=qs['limit'](_0x2ac42a[_0x396e('0x39')][_0x396e('0x21')]);_0x213a1e['offset']=qs[_0x396e('0x41')](_0x2ac42a[_0x396e('0x39')][_0x396e('0x41')]);}_0x213a1e[_0x396e('0x42')]=qs['sort'](_0x2ac42a[_0x396e('0x39')][_0x396e('0x43')]);_0x213a1e['where']=qs[_0x396e('0x3b')](_['pick'](_0x2ac42a['query'],_0x18446e[_0x396e('0x3b')]));_0x213a1e[_0x396e('0x44')][_0x396e('0xa7')]=_0x334820['id'];if(_0x2ac42a[_0x396e('0x39')][_0x396e('0x7a')]){_0x213a1e[_0x396e('0x44')]=_[_0x396e('0x90')](_0x213a1e[_0x396e('0x44')],{'$or':_[_0x396e('0x2e')](_0x213a1e[_0x396e('0x3f')],function(_0x4f3540){var _0x569a02={};_0x569a02[_0x4f3540]={'$like':'%'+_0x2ac42a[_0x396e('0x39')][_0x396e('0x7a')]+'%'};return _0x569a02;})});}if(_0x2ac42a[_0x396e('0x39')][_0x396e('0x72')]){var _0x33162d=_0x2ac42a[_0x396e('0x39')][_0x396e('0x72')][_0x396e('0x32')](',');var _0x5e1069={};_0x5e1069[_0x33162d[0x0]]={'$gte':moment(_0x33162d[0x1])[_0x396e('0xb5')](_0x396e('0xb6'))};_0x213a1e[_0x396e('0x44')]=_['merge'](_0x213a1e['where'],_0x5e1069);}_0x213a1e=_[_0x396e('0x90')]({},_0x213a1e,_0x2ac42a[_0x396e('0xac')]);return db[_0x396e('0xb0')][_0x396e('0x22')]({'where':_0x213a1e[_0x396e('0x44')]})[_0x396e('0x27')](function(_0x40201c){_0x4c0695[_0x396e('0x22')]=_0x40201c;if(_0x2ac42a[_0x396e('0x39')][_0x396e('0xab')]){_0x213a1e['include']=[{'all':!![]}];}return db['FaxMessage'][_0x396e('0xb7')](_0x213a1e);})[_0x396e('0x27')](function(_0x594f5e){_0x4c0695[_0x396e('0xb8')]=_0x594f5e;return _0x4c0695;});}})[_0x396e('0x27')](respondWithFilteredResult(_0x47db79,_0x213a1e))['catch'](handleError(_0x47db79,null));};exports['addTags']=function(_0x3b075c,_0xc1603c,_0x64746d){return db[_0x396e('0x36')][_0x396e('0x65')]({'where':{'id':_0x3b075c[_0x396e('0xaa')]['id']}})[_0x396e('0x27')](handleEntityNotFound(_0xc1603c,null))[_0x396e('0x27')](function(_0x8ea8a1){if(_0x8ea8a1){return _0x8ea8a1[_0x396e('0xb9')](_0x3b075c[_0x396e('0x6e')][_0x396e('0xb1')],_[_0x396e('0xb2')](_0x3b075c[_0x396e('0x6e')],[_0x396e('0xb1'),'id'])||{})['spread'](function(){return db[_0x396e('0x69')][_0x396e('0xb7')]({'attributes':['id',_0x396e('0x2b'),_0x396e('0x46')],'where':{'id':_0x3b075c[_0x396e('0x6e')][_0x396e('0xb1')]}});})['then'](function(_0x5c9693){socket[_0x396e('0xba')]('faxInteractionTags:save',{'id':Number(_0x3b075c[_0x396e('0xaa')]['id']),'tags':_0x5c9693||[]});return{'id':Number(_0x3b075c[_0x396e('0xaa')]['id']),'tags':_0x5c9693||[]};});}})[_0x396e('0x27')](respondWithResult(_0xc1603c,null))[_0x396e('0x34')](handleError(_0xc1603c,null));};exports['removeTags']=function(_0x4f3fb2,_0x4b819b,_0x367c43){return db[_0x396e('0x36')][_0x396e('0x65')]({'where':{'id':_0x4f3fb2[_0x396e('0xaa')]['id']}})[_0x396e('0x27')](handleEntityNotFound(_0x4b819b,null))[_0x396e('0x27')](function(_0x4d484e){if(_0x4d484e){return _0x4d484e['removeTags'](_0x4f3fb2[_0x396e('0x39')][_0x396e('0xb1')]);}})[_0x396e('0x27')](respondWithStatusCode(_0x4b819b,null))[_0x396e('0x34')](handleError(_0x4b819b,null));};exports['download']=function(_0x24842c,_0x27b3b8){var _0xb9e85d=moment()[_0x396e('0xbb')]()['toString']();var _0x242165=path[_0x396e('0xbc')](config[_0x396e('0xbd')],_0x396e('0xbe'),_0x396e('0xbf'),_0x396e('0xc0'));var _0xd6b7c7=path[_0x396e('0xbc')](config[_0x396e('0xbd')],_0x396e('0xbe'),_0x396e('0xbf'),_0x396e('0xc1'));var _0x32bdd1=path[_0x396e('0xbc')](_0x242165,_0xb9e85d);var _0xc92bb9=util[_0x396e('0xb5')](_0x396e('0xc2'),_0x24842c[_0x396e('0xaa')]['id'],_0xb9e85d);var _0x52aca1=path[_0x396e('0xbc')](_0x242165,_0xc92bb9);var _0x10fdb3=[];_0x10fdb3[_0x396e('0x33')]({'model':db[_0x396e('0xc3')],'as':'Attachment','raw':!![]});var _0xa7aa33=[{'model':db[_0x396e('0xb0')],'as':_0x396e('0xc4'),'attributes':['id',_0x396e('0x6e'),_0x396e('0xc5')],'include':_0x10fdb3}];return db[_0x396e('0x36')][_0x396e('0x65')]({'where':{'id':_0x24842c[_0x396e('0xaa')]['id']},'include':_0xa7aa33})[_0x396e('0x27')](handleEntityNotFound(_0x27b3b8,null))[_0x396e('0x27')](function(_0x24bc91){if(_0x24bc91&&_0x24bc91[_0x396e('0xc4')]){var _0x244a28=_0x24bc91[_0x396e('0xc6')]({'plain':!![]});fs[_0x396e('0xc7')](_0x32bdd1);for(var _0x362dfb=0x0;_0x362dfb<_0x244a28[_0x396e('0xc4')][_0x396e('0x40')];_0x362dfb++){var _0x32b6c5=_0x244a28['Messages'][_0x362dfb][_0x396e('0xc3')];if(_0x32b6c5){var _0x3ce8a1=path[_0x396e('0xbc')](_0xd6b7c7,_0x32b6c5[_0x396e('0xc8')]);if(fs['existsSync'](_0x3ce8a1)){fs[_0x396e('0xc9')](_0x3ce8a1)['pipe'](fs[_0x396e('0xca')](path[_0x396e('0xbc')](_0x32bdd1,_0x32b6c5['basename'])));}}}return BPromise[_0x396e('0x86')]()['then'](function(){return new BPromise(function(_0x26d05e,_0x2080cb){zipdir(_0x32bdd1,{'saveTo':_0x52aca1},function(_0x4a7242,_0xe5b308){if(_0x4a7242)return _0x2080cb(_0x4a7242);return _0x26d05e(_0xe5b308);});})[_0x396e('0x27')](function(){return new BPromise(function(_0x2ae603,_0xbee35c){rimraf(_0x32bdd1,function(_0x222520){if(_0x222520)_0xbee35c(_0x222520);return _0x2ae603();});});})[_0x396e('0x27')](function(){return _0x27b3b8[_0x396e('0xcb')](_0x52aca1,_0xc92bb9,function(_0x103ccd){if(_0x103ccd){console['log']('err',_0x103ccd);}else{fs[_0x396e('0xcc')](_0x52aca1);}});});});}else{return _0x27b3b8[_0x396e('0x28')](0xc8);}})[_0x396e('0x34')](handleError(_0x27b3b8,null));};
\ No newline at end of file
+var _0xd600=['root','server','files','attachments','format','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','Users','fullname','TagIds','push','catch','index','map','FaxInteraction','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','end','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','faxInteractionTags:save','removeTags','download','unix','join','tmp'];(function(_0x23fcad,_0x2b4c2e){var _0x3e4d60=function(_0x2a25a9){while(--_0x2a25a9){_0x23fcad['push'](_0x23fcad['shift']());}};_0x3e4d60(++_0x2b4c2e);}(_0xd600,0x1d4));var _0x0d60=function(_0xcd3afd,_0x5c0dbe){_0xcd3afd=_0xcd3afd-0x0;var _0x1ee24b=_0xd600[_0xcd3afd];return _0x1ee24b;};'use strict';var emlformat=require(_0x0d60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d60('0x1'));var jsonpatch=require(_0x0d60('0x2'));var rp=require(_0x0d60('0x3'));var moment=require(_0x0d60('0x4'));var BPromise=require(_0x0d60('0x5'));var Mustache=require(_0x0d60('0x6'));var util=require(_0x0d60('0x7'));var path=require(_0x0d60('0x8'));var sox=require('sox');var csv=require(_0x0d60('0x9'));var ejs=require(_0x0d60('0xa'));var fs=require('fs');var fs_extra=require(_0x0d60('0xb'));var _=require(_0x0d60('0xc'));var squel=require(_0x0d60('0xd'));var crypto=require(_0x0d60('0xe'));var jsforce=require(_0x0d60('0xf'));var deskjs=require(_0x0d60('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d60('0x11'));var Redis=require(_0x0d60('0x12'));var authService=require(_0x0d60('0x13'));var qs=require(_0x0d60('0x14'));var as=require(_0x0d60('0x15'));var hardwareService=require(_0x0d60('0x16'));var logger=require(_0x0d60('0x17'))(_0x0d60('0x18'));var utils=require('../../config/utils');var config=require(_0x0d60('0x19'));var licenseUtil=require(_0x0d60('0x1a'));var db=require(_0x0d60('0x1b'))['db'];config[_0x0d60('0x1c')]=_[_0x0d60('0x1d')](config[_0x0d60('0x1c')],{'host':_0x0d60('0x1e'),'port':0x18eb});var socket=require(_0x0d60('0x1f'))(new Redis(config[_0x0d60('0x1c')]));require(_0x0d60('0x20'))['register'](socket);function respondWithStatusCode(_0x275c3d,_0x264d09){_0x264d09=_0x264d09||0xcc;return function(_0x2e47a0){if(_0x2e47a0){return _0x275c3d[_0x0d60('0x21')](_0x264d09);}return _0x275c3d['status'](_0x264d09)['end']();};}function respondWithResult(_0x5d0796,_0x57704e){_0x57704e=_0x57704e||0xc8;return function(_0x3478d5){if(_0x3478d5){return _0x5d0796[_0x0d60('0x22')](_0x57704e)[_0x0d60('0x23')](_0x3478d5);}};}function respondWithFilteredResult(_0x1b1178,_0x4f79ad){return function(_0x589cae){if(_0x589cae){var _0x12868b=typeof _0x4f79ad[_0x0d60('0x24')]===_0x0d60('0x25')&&typeof _0x4f79ad[_0x0d60('0x26')]==='undefined';var _0x2e5aae=_0x589cae[_0x0d60('0x27')];var _0x40b7b2=_0x12868b?0x0:_0x4f79ad[_0x0d60('0x24')];var _0x5abd01=_0x12868b?_0x589cae[_0x0d60('0x27')]:_0x4f79ad[_0x0d60('0x24')]+_0x4f79ad[_0x0d60('0x26')];var _0x35ed6f;if(_0x5abd01>=_0x2e5aae){_0x5abd01=_0x2e5aae;_0x35ed6f=0xc8;}else{_0x35ed6f=0xce;}_0x1b1178['status'](_0x35ed6f);return _0x1b1178[_0x0d60('0x28')](_0x0d60('0x29'),_0x40b7b2+'-'+_0x5abd01+'/'+_0x2e5aae)[_0x0d60('0x23')](_0x589cae);}return null;};}function patchUpdates(_0x35967d){return function(_0x39a4ba){try{jsonpatch[_0x0d60('0x2a')](_0x39a4ba,_0x35967d,!![]);}catch(_0x58ce5d){return BPromise[_0x0d60('0x2b')](_0x58ce5d);}return _0x39a4ba['save']();};}function saveUpdates(_0x36c3b5,_0x3414d3){return function(_0x18af63){if(_0x18af63){return _0x18af63[_0x0d60('0x2c')](_0x36c3b5)[_0x0d60('0x2d')](function(_0x572df3){return _0x572df3;});}return null;};}function removeEntity(_0x3c9c69,_0x408574){return function(_0x3dc7ed){if(_0x3dc7ed){return _0x3dc7ed['destroy']()['then'](function(){_0x3c9c69[_0x0d60('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a22d,_0x2f8e0d){return function(_0x2f69d0){if(!_0x2f69d0){_0x31a22d[_0x0d60('0x21')](0x194);}return _0x2f69d0;};}function handleError(_0x18f601,_0x415b5d){_0x415b5d=_0x415b5d||0x1f4;return function(_0x41f4ad){logger[_0x0d60('0x2e')](_0x41f4ad['stack']);if(_0x41f4ad[_0x0d60('0x2f')]){delete _0x41f4ad[_0x0d60('0x2f')];}_0x18f601[_0x0d60('0x22')](_0x415b5d)[_0x0d60('0x30')](_0x41f4ad);};}function getInteractionUsers(_0x297604,_0x7c0e72){return new BPromise(function(_0x3b3529,_0x229766){try{if(_0x7c0e72[_0x297604['id']]){_0x297604[_0x0d60('0x31')]=_['map'](_0x7c0e72[_0x297604['id']],function(_0x836cc9){return{'id':_0x836cc9['id'],'fullname':_0x836cc9[_0x0d60('0x32')]};});}}catch(_0x390848){_0x229766(_0x390848);}_0x3b3529(_0x297604);});}function getInteractionTags(_0xc6648e,_0x55aee1){return new BPromise(function(_0xd4cc92,_0x34c893){try{if(_0xc6648e[_0x0d60('0x33')]){_0xc6648e['Tags']=[];_0xc6648e[_0x0d60('0x33')]['split'](',')['forEach'](function(_0x5ba72c){_0xc6648e['Tags'][_0x0d60('0x34')](_0x55aee1[_0x5ba72c]);});}delete _0xc6648e[_0x0d60('0x33')];}catch(_0x32021c){_0x34c893(_0x32021c);}_0xd4cc92(_0xc6648e);});}function updateFaxInteraction(_0x145638,_0x2216d8,_0xd7ead){return new BPromise(function(_0x870d18,_0x18a368){return getInteractionUsers(_0x145638,_0xd7ead)[_0x0d60('0x2d')](function(_0x54e48e){return getInteractionTags(_0x54e48e,_0x2216d8);})['then'](function(_0x4926fb){_0x870d18(_0x4926fb);})[_0x0d60('0x35')](function(_0x2243c5){_0x18a368(_0x2243c5);});});}exports[_0x0d60('0x36')]=function(_0x222f70,_0x5f1a7){var _0x325d0d={},_0x17dbe9={},_0x4094e5={'count':0x0,'rows':[]};var _0xd8a24a=_[_0x0d60('0x37')](db[_0x0d60('0x38')][_0x0d60('0x39')],function(_0x3abb12){return{'name':_0x3abb12[_0x0d60('0x3a')],'type':_0x3abb12['type'][_0x0d60('0x3b')]};});_0x17dbe9['model']=_[_0x0d60('0x37')](_0xd8a24a,_0x0d60('0x2f'));_0x17dbe9[_0x0d60('0x3c')]=_[_0x0d60('0x3d')](_0x222f70[_0x0d60('0x3c')]);_0x17dbe9['filters']=_[_0x0d60('0x3e')](_0x17dbe9[_0x0d60('0x3f')],_0x17dbe9[_0x0d60('0x3c')]);_0x325d0d[_0x0d60('0x40')]=_[_0x0d60('0x3e')](_0x17dbe9[_0x0d60('0x3f')],qs[_0x0d60('0x41')](_0x222f70['query'][_0x0d60('0x41')]));_0x325d0d['attributes']=_0x325d0d[_0x0d60('0x40')][_0x0d60('0x42')]?_0x325d0d[_0x0d60('0x40')]:_0x17dbe9[_0x0d60('0x3f')];if(!_0x222f70['query'][_0x0d60('0x43')](_0x0d60('0x44'))){_0x325d0d[_0x0d60('0x26')]=qs['limit'](_0x222f70['query'][_0x0d60('0x26')]);_0x325d0d[_0x0d60('0x24')]=qs[_0x0d60('0x24')](_0x222f70['query']['offset']);}_0x325d0d[_0x0d60('0x45')]=qs[_0x0d60('0x46')](_0x222f70[_0x0d60('0x3c')]['sort']);_0x325d0d['where']=qs[_0x0d60('0x47')](_['pick'](_0x222f70['query'],_0x17dbe9[_0x0d60('0x47')]),_0xd8a24a);var _0x1d938b=[];var _0x594f2a=squel[_0x0d60('0x48')]()['field']('id')[_0x0d60('0x49')]('name')[_0x0d60('0x49')](_0x0d60('0x4a'))[_0x0d60('0x4b')](_0x0d60('0x4c'));var _0x429318=squel[_0x0d60('0x48')]()['field'](_0x0d60('0x4d'))[_0x0d60('0x49')](_0x0d60('0x4e'))[_0x0d60('0x49')]('ui.FaxInteractionId')[_0x0d60('0x4b')](_0x0d60('0x4f'),'ui')[_0x0d60('0x50')](_0x0d60('0x51'),'u',_0x0d60('0x52'));var _0x16c733=squel['select']()[_0x0d60('0x4b')](_0x0d60('0x53'),'i')[_0x0d60('0x50')]('cm_contacts','c',_0x0d60('0x54'))[_0x0d60('0x50')]('users','o','o.id\x20=\x20i.UserId')[_0x0d60('0x50')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0x0d60('0x50')](_0x0d60('0x55'),'me',_0x0d60('0x56'))[_0x0d60('0x50')](_0x0d60('0x57'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x0d60('0x50')]('tools_tags','t',_0x0d60('0x58'));var _0x38651b=squel[_0x0d60('0x59')]();var _0x2d14c8=[];var _0x475f5e=squel[_0x0d60('0x59')]();var _0x4ba778;if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x5a')]){_0x4ba778=as[_0x0d60('0x5b')](_0x222f70[_0x0d60('0x3c')]['search']);var _0x552e45=_0x4ba778[_0x0d60('0x5c')];for(var _0x46e860=0x0;_0x46e860<_0x4ba778[_0x0d60('0x5d')]['length'];_0x46e860++){var _0x58c6f7=_0x4ba778['conditions'][_0x46e860];var _0x177f77='i';var _0x3da343=_[_0x0d60('0x5e')](_0xd8a24a,[_0x0d60('0x2f'),_0x58c6f7[_0x0d60('0x49')]]);if(!_0x3da343){switch(_0x58c6f7['field']){case _0x0d60('0x5f'):if(_0x58c6f7[_0x0d60('0x60')]==0x1){_0x16c733['having']('`'+_0x58c6f7[_0x0d60('0x49')]+_0x0d60('0x61'));}else{_0x16c733[_0x0d60('0x62')]('`'+_0x58c6f7['field']+_0x0d60('0x63'));}break;case _0x0d60('0x64'):if(_0x58c6f7[_0x0d60('0x65')]===_0x0d60('0x66')){if(_0x58c6f7['value'][_0x0d60('0x67')]('\x20')[_0x0d60('0x42')]>0x1){_0x38651b[_0x552e45](_0x0d60('0x68'),qs[_0x0d60('0x69')](_0x58c6f7[_0x0d60('0x60')]),null);}else{var _0x543f15='%'+_0x58c6f7[_0x0d60('0x60')]+'%';_0x38651b[_0x552e45](_0x0d60('0x6a'),_0x543f15,_0x543f15,_0x543f15);}}else{_0x3da343=_[_0x0d60('0x5e')](_0xd8a24a,['name',_0x0d60('0x6b')]);_0x58c6f7['field']=_0x0d60('0x6b');_0x2c6872=as[_0x0d60('0x6c')](_0x177f77,_0x3da343[_0x0d60('0x6d')],_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872[_0x0d60('0x6e')],_0x2c6872[_0x0d60('0x60')][_0x0d60('0x6f')],_0x2c6872['value'][_0x0d60('0x70')]);}break;case _0x0d60('0x71'):var _0x164da7=_0x58c6f7[_0x0d60('0x60')]['split'](',')[_0x0d60('0x37')](function(_0x58531d){return Number(_0x58531d);});_0x164da7[_0x0d60('0x72')](function(_0x13a1ac){_0x475f5e['or'](_0x0d60('0x73'),'%,'+_0x13a1ac+',%');});_0x2d14c8=_[_0x0d60('0x74')](_0x2d14c8,_0x164da7);break;case _0x0d60('0x75'):if(_0x58c6f7['operator']==='$substring'){_0x38651b[_0x552e45](_0x0d60('0x76'),'%'+_0x58c6f7[_0x0d60('0x60')]+'%',null);}else{_0x3da343=_['find'](_0xd8a24a,['name','UserId']);_0x58c6f7[_0x0d60('0x49')]='UserId';_0x2c6872=as['buildExpression'](_0x177f77,_0x3da343['type'],_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872['text'],_0x2c6872[_0x0d60('0x60')][_0x0d60('0x6f')],_0x2c6872[_0x0d60('0x60')][_0x0d60('0x70')]);}break;case _0x0d60('0x77'):_0x2c6872=as[_0x0d60('0x6c')]('me',null,_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872[_0x0d60('0x6e')],_0x2c6872['value'][_0x0d60('0x6f')],_0x2c6872[_0x0d60('0x60')]['end']);break;}}else{var _0x2c6872=as[_0x0d60('0x6c')](_0x177f77,_0x3da343[_0x0d60('0x6d')],_0x58c6f7);_0x38651b[_0x552e45](_0x2c6872[_0x0d60('0x6e')],_0x2c6872['value']['start'],_0x2c6872['value'][_0x0d60('0x70')]);}}}else{var _0x4420b7=_(_0x222f70[_0x0d60('0x3c')])[_0x0d60('0x3d')]()[_0x0d60('0x37')](function(_0x103799){return _['some'](_0xd8a24a,[_0x0d60('0x2f'),_0x103799])?_0x103799:undefined;})['compact']()[_0x0d60('0x60')]();if(!_[_0x0d60('0x78')](_0x4420b7)){_0x4420b7[_0x0d60('0x72')](function(_0x32dcfd){if(_0x32dcfd===_0x0d60('0x79')){_0x16c733[_0x0d60('0x7a')](_0x0d60('0x7b'),[][_0x0d60('0x7c')](_0x222f70[_0x0d60('0x3c')][_0x32dcfd]));}else if(_0x32dcfd==='createdAt'){var _0x39dc4c=JSON[_0x0d60('0x7d')](_0x222f70[_0x0d60('0x3c')][_0x32dcfd])[_0x0d60('0x7e')];var _0x4ece64=JSON[_0x0d60('0x7d')](_0x222f70['query'][_0x32dcfd])[_0x0d60('0x7f')];_0x16c733[_0x0d60('0x7a')](_0x0d60('0x80'),_0x39dc4c,_0x4ece64);}else{if(_0x222f70[_0x0d60('0x3c')][_0x32dcfd]===_0x0d60('0x81')){_0x16c733[_0x0d60('0x7a')]('i.'+_0x32dcfd+_0x0d60('0x82'));}else{_0x16c733[_0x0d60('0x7a')]('i.'+_0x32dcfd+_0x0d60('0x83'),_0x222f70[_0x0d60('0x3c')][_0x32dcfd]);}}});}if(_0x222f70['query'][_0x0d60('0x84')]){if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x84')]==0x1){_0x16c733['having'](_0x0d60('0x85'));}else{_0x16c733[_0x0d60('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x222f70[_0x0d60('0x3c')]['tag']){_0x2d14c8=_[_0x0d60('0x86')](_0x222f70[_0x0d60('0x3c')][_0x0d60('0x87')])?_0x222f70[_0x0d60('0x3c')][_0x0d60('0x87')]:new Array(_0x222f70[_0x0d60('0x3c')]['tag']);_0x2d14c8[_0x0d60('0x72')](function(_0x48b657){_0x475f5e['or'](_0x0d60('0x73'),'%,'+_0x48b657+',%');});}if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x88')]){var _0x228249=_0x222f70[_0x0d60('0x3c')][_0x0d60('0x88')][_0x0d60('0x89')]('\x5c','\x5c\x5c')[_0x0d60('0x89')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x228249)){_0x38651b['or'](_0x0d60('0x8a'),_0x228249+'%')['or'](_0x0d60('0x8b'),_0x228249+'%');}_0x38651b['or'](_0x0d60('0x8c'),_0x228249+'%');}}_0x16c733[_0x0d60('0x7a')](_0x38651b);_0x16c733[_0x0d60('0x8d')](_0x0d60('0x8e'));var _0xf7c98f={'type':db[_0x0d60('0x8f')][_0x0d60('0x90')][_0x0d60('0x91')],'raw':!![]};var _0x39a51c=_0x16c733[_0x0d60('0x92')]();_0x39a51c[_0x0d60('0x49')]('i.id');_0x39a51c['field'](_0x0d60('0x93'),_0x0d60('0x5f'));if(_0x325d0d['order']){_0x325d0d[_0x0d60('0x45')][_0x0d60('0x72')](function(_0x30458f){var _0x2baa4d=_0x30458f[0x0]===_0x0d60('0x94')?_0x30458f[0x0]:'i.'+_0x30458f[0x0];_0x16c733[_0x0d60('0x45')](_0x2baa4d,_0x30458f[0x1]===_0x0d60('0x95')?![]:!![]);});}if(!_[_0x0d60('0x78')](_0x2d14c8)){_0x16c733[_0x0d60('0x62')](_0x475f5e);_0x39a51c[_0x0d60('0x7a')](_0x0d60('0x96'),_0x2d14c8);}BPromise[_0x0d60('0x97')]()[_0x0d60('0x2d')](function(){if(!_0x4ba778){if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x79')])return;_0x39a51c[_0x0d60('0x7a')](_0x0d60('0x98'));_0x16c733[_0x0d60('0x7a')](_0x0d60('0x98'));return;}if(_0x222f70[_0x0d60('0x99')]['role']!==_0x0d60('0x9a'))return;return _0x222f70[_0x0d60('0x99')][_0x0d60('0x9b')]({'attributes':['id'],'raw':!![]})[_0x0d60('0x2d')](function(_0x52e5a1){if(_[_0x0d60('0x78')](_0x52e5a1)){_0x39a51c[_0x0d60('0x7a')](_0x0d60('0x9c'));_0x16c733[_0x0d60('0x7a')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x39a51c['where'](_0x0d60('0x7b'),_['map'](_0x52e5a1,'id'));_0x16c733['where'](_0x0d60('0x7b'),_['map'](_0x52e5a1,'id'));}});})[_0x0d60('0x2d')](function(){if(_0x222f70['user'][_0x0d60('0x9d')]===_0x0d60('0x9a')&&!_0x4ba778&&!_0x222f70['query'][_0x0d60('0x79')])return[];return db[_0x0d60('0x9e')][_0x0d60('0x3c')](_0x39a51c[_0x0d60('0x9f')](),_0xf7c98f);})[_0x0d60('0x2d')](function(_0x50c9a5){_0x4094e5[_0x0d60('0x27')]=_0x50c9a5[_0x0d60('0x42')];if(_0x4094e5[_0x0d60('0x27')]===0x0)return[];return db[_0x0d60('0x9e')]['query'](_0x594f2a[_0x0d60('0x9f')](),_0xf7c98f)[_0x0d60('0x2d')](function(_0x1a012d){_0x1d938b=_[_0x0d60('0xa0')](_0x1a012d,'id');_0xf7c98f=_[_0x0d60('0xa1')](_0xf7c98f,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x222f70[_0x0d60('0x3c')][_0x0d60('0x41')]){_0x325d0d[_0x0d60('0x40')][_0x0d60('0x72')](function(_0x59baf4){_0x16c733[_0x0d60('0x49')]('i.'+_0x59baf4);});}else{_0x16c733[_0x0d60('0x49')](_0x0d60('0x93'),_0x0d60('0x5f'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xa2'),_0x0d60('0xa3'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xa4'),_0x0d60('0xa5'));_0x16c733['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x0d60('0x94'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xa6'));_0x16c733['field'](_0x0d60('0xa7'),_0x0d60('0xa8'));_0x16c733[_0x0d60('0x49')]('c.lastName',_0x0d60('0xa9'));_0x16c733['field'](_0x0d60('0xaa'),_0x0d60('0xab'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xac'),_0x0d60('0xad'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xae'),_0x0d60('0xaf'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xb0'),_0x0d60('0xb1'));_0x16c733[_0x0d60('0x49')](_0x0d60('0xb2'),_0x0d60('0xb3'));_0x16c733[_0x0d60('0x49')]('o.internal','Owner.internal');_0x16c733[_0x0d60('0x49')](_0x0d60('0xb4'),'TagIds');}if(_0x325d0d['limit'])_0x16c733[_0x0d60('0x26')](_0x325d0d[_0x0d60('0x26')]);if(_0x325d0d[_0x0d60('0x24')])_0x16c733[_0x0d60('0x24')](_0x325d0d[_0x0d60('0x24')]);return db[_0x0d60('0x9e')][_0x0d60('0x3c')](_0x16c733['toString'](),_0xf7c98f);})[_0x0d60('0x2d')](function(_0x557fb1){if(_0x557fb1[_0x0d60('0x42')]>0x0)_0x429318[_0x0d60('0x7a')](_0x0d60('0xb5'),_[_0x0d60('0x37')](_0x557fb1,'id'));return db[_0x0d60('0x9e')][_0x0d60('0x3c')](_0x429318[_0x0d60('0x9f')](),_0xf7c98f)['then'](function(_0x4bc648){var _0x341465=_[_0x0d60('0xb6')](_0x4bc648,_0x0d60('0xb7'));var _0x52084e=[];_0x557fb1[_0x0d60('0x72')](function(_0x1aaa65){_0x52084e[_0x0d60('0x34')](updateFaxInteraction(_0x1aaa65,_0x1d938b,_0x341465));});return BPromise[_0x0d60('0xb8')](_0x52084e);});});})['then'](function(_0x36efbd){_0x4094e5[_0x0d60('0xb9')]=_0x36efbd;return _0x4094e5;})[_0x0d60('0x2d')](respondWithFilteredResult(_0x5f1a7,_0x325d0d))[_0x0d60('0x35')](handleError(_0x5f1a7,null));};exports[_0x0d60('0xba')]=function(_0x2a2230,_0x35f617){var _0x5cead9={'raw':![],'where':{'id':_0x2a2230[_0x0d60('0xbb')]['id']}},_0x547652={};_0x547652[_0x0d60('0x3f')]=_['keys'](db[_0x0d60('0x38')]['rawAttributes']);_0x547652[_0x0d60('0x3c')]=_[_0x0d60('0x3d')](_0x2a2230[_0x0d60('0x3c')]);_0x547652[_0x0d60('0x47')]=_[_0x0d60('0x3e')](_0x547652[_0x0d60('0x3f')],_0x547652[_0x0d60('0x3c')]);_0x5cead9[_0x0d60('0x40')]=_[_0x0d60('0x3e')](_0x547652[_0x0d60('0x3f')],qs[_0x0d60('0x41')](_0x2a2230[_0x0d60('0x3c')][_0x0d60('0x41')]));_0x5cead9[_0x0d60('0x40')]=_0x5cead9[_0x0d60('0x40')][_0x0d60('0x42')]?_0x5cead9['attributes']:_0x547652[_0x0d60('0x3f')];if(_0x2a2230[_0x0d60('0x3c')]['includeAll']){_0x5cead9[_0x0d60('0xbc')]=[{'all':!![]}];}_0x5cead9=_[_0x0d60('0xa1')]({},_0x5cead9,_0x2a2230[_0x0d60('0xbd')]);return db['FaxInteraction'][_0x0d60('0x5e')](_0x5cead9)['then'](handleEntityNotFound(_0x35f617,null))[_0x0d60('0x2d')](respondWithResult(_0x35f617,null))[_0x0d60('0x35')](handleError(_0x35f617,null));};exports[_0x0d60('0xbe')]=function(_0x3eacab,_0x1d2900){return db[_0x0d60('0x38')][_0x0d60('0xbe')](_0x3eacab[_0x0d60('0x77')],{})[_0x0d60('0x2d')](respondWithResult(_0x1d2900,0xc9))[_0x0d60('0x35')](handleError(_0x1d2900,null));};exports['update']=function(_0x459d07,_0x40ca07){if(_0x459d07['body']['id']){delete _0x459d07[_0x0d60('0x77')]['id'];}return db[_0x0d60('0x38')]['find']({'where':{'id':_0x459d07['params']['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x40ca07,null))[_0x0d60('0x2d')](saveUpdates(_0x459d07[_0x0d60('0x77')],null))[_0x0d60('0x2d')](respondWithResult(_0x40ca07,null))['catch'](handleError(_0x40ca07,null));};exports[_0x0d60('0xbf')]=function(_0x8be095,_0x2ae682){return db['FaxInteraction']['find']({'where':{'id':_0x8be095['params']['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x2ae682,null))[_0x0d60('0x2d')](removeEntity(_0x2ae682,null))[_0x0d60('0x35')](handleError(_0x2ae682,null));};exports['describe']=function(_0x46d1d4,_0x5e8fc3){return db[_0x0d60('0x38')][_0x0d60('0xc0')]()['then'](respondWithResult(_0x5e8fc3,null))['catch'](handleError(_0x5e8fc3,null));};exports[_0x0d60('0xc1')]=function(_0x6393f0,_0x28f946,_0x41af3b){return db[_0x0d60('0xc2')][_0x0d60('0x5e')]({'where':{'id':_0x6393f0[_0x0d60('0xbb')]['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x28f946,null))[_0x0d60('0x2d')](function(_0x581d36){if(_0x581d36){return _0x581d36['addMessage'](_0x6393f0['body'][_0x0d60('0xc3')],_[_0x0d60('0xc4')](_0x6393f0[_0x0d60('0x77')],[_0x0d60('0xc3'),'id'])||{});}})[_0x0d60('0x2d')](respondWithResult(_0x28f946,null))[_0x0d60('0x35')](handleError(_0x28f946,null));};exports['getMessages']=function(_0x3b0b81,_0x11f7e2,_0x41a07d){var _0x3d3b5e={'raw':![],'where':{}};var _0x4f75f3={};var _0x71b36c={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x3b0b81['params']['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x11f7e2,null))['then'](function(_0x57850b){if(_0x57850b){_0x4f75f3['model']=_[_0x0d60('0x3d')](db[_0x0d60('0xc2')][_0x0d60('0x39')]);_0x4f75f3[_0x0d60('0x3c')]=_[_0x0d60('0x3d')](_0x3b0b81[_0x0d60('0x3c')]);_0x4f75f3[_0x0d60('0x47')]=_['intersection'](_0x4f75f3[_0x0d60('0x3f')],_0x4f75f3['query']);_0x3d3b5e[_0x0d60('0x40')]=_[_0x0d60('0x3e')](_0x4f75f3[_0x0d60('0x3f')],qs[_0x0d60('0x41')](_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x41')]));_0x3d3b5e[_0x0d60('0x40')]=_0x3d3b5e['attributes'][_0x0d60('0x42')]?_0x3d3b5e[_0x0d60('0x40')]:_0x4f75f3[_0x0d60('0x3f')];if(!_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x43')](_0x0d60('0x44'))){_0x3d3b5e[_0x0d60('0x26')]=qs['limit'](_0x3b0b81[_0x0d60('0x3c')]['limit']);_0x3d3b5e[_0x0d60('0x24')]=qs[_0x0d60('0x24')](_0x3b0b81['query'][_0x0d60('0x24')]);}_0x3d3b5e[_0x0d60('0x45')]=qs[_0x0d60('0x46')](_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x46')]);_0x3d3b5e[_0x0d60('0x7a')]=qs[_0x0d60('0x47')](_['pick'](_0x3b0b81[_0x0d60('0x3c')],_0x4f75f3[_0x0d60('0x47')]));_0x3d3b5e[_0x0d60('0x7a')][_0x0d60('0xb7')]=_0x57850b['id'];if(_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x88')]){_0x3d3b5e[_0x0d60('0x7a')]=_[_0x0d60('0xa1')](_0x3d3b5e['where'],{'$or':_[_0x0d60('0x37')](_0x3d3b5e['attributes'],function(_0xcfae0e){var _0xf7ecf0={};_0xf7ecf0[_0xcfae0e]={'$like':'%'+_0x3b0b81['query'][_0x0d60('0x88')]+'%'};return _0xf7ecf0;})});}if(_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0x7e')]){var _0x20beaf=_0x3b0b81['query']['$gte']['split'](',');var _0x556474={};_0x556474[_0x20beaf[0x0]]={'$gte':moment(_0x20beaf[0x1])['format'](_0x0d60('0xc5'))};_0x3d3b5e[_0x0d60('0x7a')]=_['merge'](_0x3d3b5e['where'],_0x556474);}_0x3d3b5e=_[_0x0d60('0xa1')]({},_0x3d3b5e,_0x3b0b81[_0x0d60('0xbd')]);return db['FaxMessage'][_0x0d60('0x27')]({'where':_0x3d3b5e['where']})[_0x0d60('0x2d')](function(_0x2ff4fa){_0x71b36c['count']=_0x2ff4fa;if(_0x3b0b81[_0x0d60('0x3c')][_0x0d60('0xc6')]){_0x3d3b5e[_0x0d60('0xbc')]=[{'all':!![]}];}return db[_0x0d60('0xc2')][_0x0d60('0xc7')](_0x3d3b5e);})['then'](function(_0x22e222){_0x71b36c[_0x0d60('0xb9')]=_0x22e222;return _0x71b36c;});}})[_0x0d60('0x2d')](respondWithFilteredResult(_0x11f7e2,_0x3d3b5e))[_0x0d60('0x35')](handleError(_0x11f7e2,null));};exports[_0x0d60('0xc8')]=function(_0x3fb267,_0x40ce5e,_0x18a73e){return db[_0x0d60('0x38')]['find']({'where':{'id':_0x3fb267[_0x0d60('0xbb')]['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x40ce5e,null))[_0x0d60('0x2d')](function(_0x16f50d){if(_0x16f50d){return _0x16f50d['setTags'](_0x3fb267[_0x0d60('0x77')]['ids'],_[_0x0d60('0xc4')](_0x3fb267[_0x0d60('0x77')],[_0x0d60('0xc3'),'id'])||{})['spread'](function(){return db[_0x0d60('0x71')][_0x0d60('0xc7')]({'attributes':['id','name','color'],'where':{'id':_0x3fb267['body'][_0x0d60('0xc3')]}});})[_0x0d60('0x2d')](function(_0x990263){socket['emit'](_0x0d60('0xc9'),{'id':Number(_0x3fb267['params']['id']),'tags':_0x990263||[]});return{'id':Number(_0x3fb267[_0x0d60('0xbb')]['id']),'tags':_0x990263||[]};});}})['then'](respondWithResult(_0x40ce5e,null))[_0x0d60('0x35')](handleError(_0x40ce5e,null));};exports[_0x0d60('0xca')]=function(_0x52803d,_0x33e3f3,_0x1243f0){return db[_0x0d60('0x38')][_0x0d60('0x5e')]({'where':{'id':_0x52803d[_0x0d60('0xbb')]['id']}})[_0x0d60('0x2d')](handleEntityNotFound(_0x33e3f3,null))[_0x0d60('0x2d')](function(_0x4eca12){if(_0x4eca12){return _0x4eca12[_0x0d60('0xca')](_0x52803d[_0x0d60('0x3c')][_0x0d60('0xc3')]);}})[_0x0d60('0x2d')](respondWithStatusCode(_0x33e3f3,null))[_0x0d60('0x35')](handleError(_0x33e3f3,null));};exports[_0x0d60('0xcb')]=function(_0xb02f82,_0x25be7a){var _0x268a06=moment()[_0x0d60('0xcc')]()[_0x0d60('0x9f')]();var _0x4c60aa=path[_0x0d60('0xcd')](config['root'],'server','files',_0x0d60('0xce'));var _0x4af265=path[_0x0d60('0xcd')](config[_0x0d60('0xcf')],_0x0d60('0xd0'),_0x0d60('0xd1'),_0x0d60('0xd2'));var _0x37d3c1=path[_0x0d60('0xcd')](_0x4c60aa,_0x268a06);var _0x333095=util[_0x0d60('0xd3')](_0x0d60('0xd4'),_0xb02f82['params']['id'],_0x268a06);var _0x396e86=path[_0x0d60('0xcd')](_0x4c60aa,_0x333095);var _0x3fbb3c=[];_0x3fbb3c[_0x0d60('0x34')]({'model':db[_0x0d60('0xd5')],'as':_0x0d60('0xd5'),'raw':!![]});var _0x518012=[{'model':db[_0x0d60('0xc2')],'as':_0x0d60('0xd6'),'attributes':['id','body',_0x0d60('0xd7')],'include':_0x3fbb3c}];return db[_0x0d60('0x38')][_0x0d60('0x5e')]({'where':{'id':_0xb02f82[_0x0d60('0xbb')]['id']},'include':_0x518012})[_0x0d60('0x2d')](handleEntityNotFound(_0x25be7a,null))[_0x0d60('0x2d')](function(_0x4b2601){if(_0x4b2601&&_0x4b2601[_0x0d60('0xd6')]){var _0x45b0c1=_0x4b2601[_0x0d60('0xd8')]({'plain':!![]});fs[_0x0d60('0xd9')](_0x37d3c1);for(var _0x30b007=0x0;_0x30b007<_0x45b0c1['Messages'][_0x0d60('0x42')];_0x30b007++){var _0x174841=_0x45b0c1[_0x0d60('0xd6')][_0x30b007][_0x0d60('0xd5')];if(_0x174841){var _0x144e54=path[_0x0d60('0xcd')](_0x4af265,_0x174841['basename']);if(fs[_0x0d60('0xda')](_0x144e54)){fs[_0x0d60('0xdb')](_0x144e54)[_0x0d60('0xdc')](fs[_0x0d60('0xdd')](path[_0x0d60('0xcd')](_0x37d3c1,_0x174841[_0x0d60('0xde')])));}}}return BPromise[_0x0d60('0x97')]()[_0x0d60('0x2d')](function(){return new BPromise(function(_0x287128,_0x4c792f){zipdir(_0x37d3c1,{'saveTo':_0x396e86},function(_0x1abafd,_0x12ae45){if(_0x1abafd)return _0x4c792f(_0x1abafd);return _0x287128(_0x12ae45);});})[_0x0d60('0x2d')](function(){return new BPromise(function(_0x11cb28,_0x5e2cbd){rimraf(_0x37d3c1,function(_0x1d6906){if(_0x1d6906)_0x5e2cbd(_0x1d6906);return _0x11cb28();});});})[_0x0d60('0x2d')](function(){return _0x25be7a[_0x0d60('0xcb')](_0x396e86,_0x333095,function(_0x36fdaa){if(_0x36fdaa){console[_0x0d60('0xdf')]('err',_0x36fdaa);}else{fs[_0x0d60('0xe0')](_0x396e86);}});});});}else{return _0x25be7a['sendStatus'](0xc8);}})[_0x0d60('0x35')](handleError(_0x25be7a,null));};
\ No newline at end of file
index 143ee06..b0b7d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc42e=['events','../../mysqldb','FaxMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc42e,0x132));var _0xec42=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0xc42e[_0x4c98b9];return _0x3a257a;};'use strict';var EventEmitter=require(_0xec42('0x0'));var FaxInteraction=require(_0xec42('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xec42('0x1'))['db'][_0xec42('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xec42('0x3')](0x0);var events={'afterCreate':_0xec42('0x4'),'afterUpdate':'update','afterDestroy':_0xec42('0x5')};function emitEvent(_0x59fcbc){return function(_0x57f7c5,_0x1d1cc9,_0x289e7f){_0x57f7c5[_0xec42('0x6')]({'attributes':['id'],'raw':!![]})[_0xec42('0x7')](function(_0x5c053f){_0x57f7c5[_0xec42('0x8')]('Users',_0x5c053f[_0xec42('0x9')](function(_0x4a3694){return{'id':_0x4a3694['id']};}));return FaxMessage[_0xec42('0xa')]({'where':{'FaxInteractionId':_0x57f7c5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xec42('0x7')](function(_0x2ec92b){_0x57f7c5['setDataValue']('unreadMessages',_0x2ec92b[_0xec42('0xb')]);FaxInteractionEvents[_0xec42('0xc')](_0x59fcbc+':'+_0x57f7c5['id'],_0x57f7c5);FaxInteractionEvents[_0xec42('0xc')](_0x59fcbc,_0x57f7c5);_0x289e7f(null);})[_0xec42('0xd')](_0x289e7f(null));};}for(var e in events){if(events[_0xec42('0xe')](e)){var event=events[e];FaxInteraction[_0xec42('0xf')](e,emitEvent(event));}}module[_0xec42('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xfd32=['unreadMessages','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','findAll'];(function(_0x12c72d,_0x320832){var _0x211a39=function(_0x363f10){while(--_0x363f10){_0x12c72d['push'](_0x12c72d['shift']());}};_0x211a39(++_0x320832);}(_0xfd32,0x6b));var _0x2fd3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd32[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x2fd3('0x0'));var FaxInteraction=require(_0x2fd3('0x1'))['db'][_0x2fd3('0x2')];var FaxMessage=require(_0x2fd3('0x1'))['db'][_0x2fd3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2fd3('0x4')](0x0);var events={'afterCreate':_0x2fd3('0x5'),'afterUpdate':_0x2fd3('0x6'),'afterDestroy':_0x2fd3('0x7')};function emitEvent(_0x2c3168){return function(_0x7aa4f7,_0x5c664d,_0x2c5466){_0x7aa4f7[_0x2fd3('0x8')]({'attributes':['id'],'raw':!![]})[_0x2fd3('0x9')](function(_0x30abf5){_0x7aa4f7[_0x2fd3('0xa')]('Users',_0x30abf5['map'](function(_0x4f2fe1){return{'id':_0x4f2fe1['id']};}));return FaxMessage[_0x2fd3('0xb')]({'where':{'FaxInteractionId':_0x7aa4f7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2fd3('0x9')](function(_0x58d37f){_0x7aa4f7['setDataValue'](_0x2fd3('0xc'),_0x58d37f['length']);FaxInteractionEvents['emit'](_0x2c3168+':'+_0x7aa4f7['id'],_0x7aa4f7);FaxInteractionEvents['emit'](_0x2c3168,_0x7aa4f7);_0x2c5466(null);})[_0x2fd3('0xd')](_0x2c5466(null));};}for(var e in events){if(events[_0x2fd3('0xe')](e)){var event=events[e];FaxInteraction[_0x2fd3('0xf')](e,emitEvent(event));}}module[_0x2fd3('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index c5ca0a9..1f9e8b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83a7=['fax_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x1eca25,_0x10f71c){var _0x54eff2=function(_0x40b3cd){while(--_0x40b3cd){_0x1eca25['push'](_0x1eca25['shift']());}};_0x54eff2(++_0x10f71c);}(_0x83a7,0x1f2));var _0x783a=function(_0x1f1523,_0x31cf46){_0x1f1523=_0x1f1523-0x0;var _0x3708d0=_0x83a7[_0x1f1523];return _0x3708d0;};'use strict';var _=require(_0x783a('0x0'));var util=require(_0x783a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x783a('0x2'));var BPromise=require(_0x783a('0x3'));var rp=require(_0x783a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x783a('0x5'));var attributes=require(_0x783a('0x6'));module[_0x783a('0x7')]=function(_0x4d9468,_0x41eeba){return _0x4d9468[_0x783a('0x8')]('FaxInteraction',attributes,{'tableName':_0x783a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5633f3,_0x1b0e26,_0x544245){if(_0x5633f3['changed'](_0x783a('0xa'))){_0x5633f3[_0x783a('0xb')]=moment()['format'](_0x783a('0xc'));}_0x544245(null,_0x5633f3);}}});};
\ No newline at end of file
+var _0xea1d=['exports','define','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0xdabb0c,_0x3714f7){var _0x5553d3=function(_0x45197b){while(--_0x45197b){_0xdabb0c['push'](_0xdabb0c['shift']());}};_0x5553d3(++_0x3714f7);}(_0xea1d,0x1d1));var _0xdea1=function(_0x530788,_0x234040){_0x530788=_0x530788-0x0;var _0x3c9b88=_0xea1d[_0x530788];return _0x3c9b88;};'use strict';var _=require(_0xdea1('0x0'));var util=require(_0xdea1('0x1'));var logger=require(_0xdea1('0x2'))(_0xdea1('0x3'));var moment=require(_0xdea1('0x4'));var BPromise=require(_0xdea1('0x5'));var rp=require(_0xdea1('0x6'));var fs=require('fs');var path=require(_0xdea1('0x7'));var rimraf=require(_0xdea1('0x8'));var config=require(_0xdea1('0x9'));var attributes=require(_0xdea1('0xa'));module[_0xdea1('0xb')]=function(_0x467032,_0x320c10){return _0x467032[_0xdea1('0xc')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xed483e,_0x2f2032,_0x42a2f1){if(_0xed483e[_0xdea1('0xd')](_0xdea1('0xe'))){_0xed483e[_0xdea1('0xf')]=moment()['format'](_0xdea1('0x10'));}_0x42a2f1(null,_0xed483e);}}});};
\ No newline at end of file
index bc0f685..2436cb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0546=['debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','attributes','limit','AddTagsToFaxInteraction','find','where','omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','request\x20sent'];(function(_0x3ea29e,_0x77859b){var _0x4f98d5=function(_0x1fa477){while(--_0x1fa477){_0x3ea29e['push'](_0x3ea29e['shift']());}};_0x4f98d5(++_0x77859b);}(_0x0546,0x6d));var _0x6054=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x0546[_0x4ded65];return _0x5864fb;};'use strict';var _=require(_0x6054('0x0'));var util=require('util');var moment=require(_0x6054('0x1'));var BPromise=require(_0x6054('0x2'));var rs=require(_0x6054('0x3'));var fs=require('fs');var Redis=require(_0x6054('0x4'));var db=require(_0x6054('0x5'))['db'];var utils=require(_0x6054('0x6'));var logger=require(_0x6054('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6054('0x8'));var client=jayson[_0x6054('0x9')][_0x6054('0xa')]({'port':0x232a});config[_0x6054('0xb')]=_[_0x6054('0xc')](config[_0x6054('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6054('0xd'))(new Redis(config[_0x6054('0xb')]));require(_0x6054('0xe'))[_0x6054('0xf')](socket);function respondWithRpcPromise(_0x1d70d2,_0x477f54,_0x3b19d2){return new BPromise(function(_0x27f014,_0x3e87b4){return client[_0x6054('0x10')](_0x1d70d2,_0x3b19d2)[_0x6054('0x11')](function(_0x137c8f){logger[_0x6054('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x477f54,_0x6054('0x13'));logger[_0x6054('0x14')](_0x6054('0x15'),_0x477f54,_0x6054('0x13'),JSON[_0x6054('0x16')](_0x137c8f));if(_0x137c8f['error']){if(_0x137c8f[_0x6054('0x17')][_0x6054('0x18')]===0x1f4){logger[_0x6054('0x17')](_0x6054('0x19'),_0x477f54,_0x137c8f[_0x6054('0x17')][_0x6054('0x1a')]);return _0x3e87b4(_0x137c8f[_0x6054('0x17')][_0x6054('0x1a')]);}logger[_0x6054('0x17')](_0x6054('0x19'),_0x477f54,_0x137c8f[_0x6054('0x17')][_0x6054('0x1a')]);return _0x27f014(_0x137c8f[_0x6054('0x17')]['message']);}else{logger['info'](_0x6054('0x19'),_0x477f54,_0x6054('0x13'));_0x27f014(_0x137c8f[_0x6054('0x1b')][_0x6054('0x1a')]);}})[_0x6054('0x1c')](function(_0x8f1e7c){logger['error'](_0x6054('0x19'),_0x477f54,_0x8f1e7c);_0x3e87b4(_0x8f1e7c);});});}exports[_0x6054('0x1d')]=function(_0x5f0045){var _0x5fe750=this;return new Promise(function(_0x2bc1b4,_0x5b5724){return db[_0x6054('0x1e')][_0x6054('0x1f')](_0x5f0045[_0x6054('0x20')],{'raw':_0x5f0045['options']?_0x5f0045[_0x6054('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f0045[_0x6054('0x21')]?_0x5f0045[_0x6054('0x21')]['where']||null:null,'attributes':_0x5f0045[_0x6054('0x21')]?_0x5f0045[_0x6054('0x21')][_0x6054('0x22')]||null:null,'limit':_0x5f0045['options']?_0x5f0045[_0x6054('0x21')][_0x6054('0x23')]||null:null})[_0x6054('0x11')](function(_0x56d70d){logger[_0x6054('0x12')]('UpdateFaxInteraction',_0x5f0045);logger[_0x6054('0x14')](_0x6054('0x1d'),_0x5f0045,JSON[_0x6054('0x16')](_0x56d70d));_0x2bc1b4(_0x56d70d);})['catch'](function(_0x208318){logger['error'](_0x6054('0x1d'),_0x208318['message'],_0x5f0045);_0x5b5724(_0x5fe750[_0x6054('0x17')](0x1f4,_0x208318[_0x6054('0x1a')]));});});};exports[_0x6054('0x24')]=function(_0xeb9084){return new Promise(function(_0x36a4bf,_0x2d47b1){return db[_0x6054('0x1e')][_0x6054('0x25')]({'where':_0xeb9084[_0x6054('0x21')]?_0xeb9084[_0x6054('0x21')][_0x6054('0x26')]||null:null})[_0x6054('0x11')](function(_0x58d10c){if(_0x58d10c){return _0x58d10c['addTags'](_0xeb9084[_0x6054('0x20')]['ids'],_[_0x6054('0x27')](_0xeb9084[_0x6054('0x20')],[_0x6054('0x28'),'id'])||{});}})[_0x6054('0x29')](function(_0x588abe){logger[_0x6054('0x12')](_0x6054('0x2a'),_0xeb9084);logger[_0x6054('0x14')](_0x6054('0x2a'),_0xeb9084,JSON[_0x6054('0x16')](_0x588abe));_0x36a4bf(_0x588abe);})[_0x6054('0x1c')](function(_0x2ba0cb){logger['error']('AddTags',_0x2ba0cb[_0x6054('0x1a')],_0xeb9084);_0x2d47b1(_this['error'](0x1f4,_0x2ba0cb[_0x6054('0x1a')]));});});};
\ No newline at end of file
+var _0xddd9=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FaxInteraction','update','options','raw','where','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','body','ids','spread','debug','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x546ac6,_0x21e5e5){var _0x1dfbf9=function(_0x4bc431){while(--_0x4bc431){_0x546ac6['push'](_0x546ac6['shift']());}};_0x1dfbf9(++_0x21e5e5);}(_0xddd9,0x119));var _0x9ddd=function(_0x3fae70,_0x2cfe67){_0x3fae70=_0x3fae70-0x0;var _0x940b32=_0xddd9[_0x3fae70];return _0x940b32;};'use strict';var _=require(_0x9ddd('0x0'));var util=require(_0x9ddd('0x1'));var moment=require(_0x9ddd('0x2'));var BPromise=require(_0x9ddd('0x3'));var rs=require(_0x9ddd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ddd('0x5'))['db'];var utils=require(_0x9ddd('0x6'));var logger=require(_0x9ddd('0x7'))('rpc');var config=require(_0x9ddd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ddd('0x9')][_0x9ddd('0xa')]({'port':0x232a});config[_0x9ddd('0xb')]=_[_0x9ddd('0xc')](config[_0x9ddd('0xb')],{'host':_0x9ddd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9ddd('0xb')]));require(_0x9ddd('0xe'))[_0x9ddd('0xf')](socket);function respondWithRpcPromise(_0x277e84,_0x3e54a0,_0x1c23f8){return new BPromise(function(_0x32d8dc,_0x17b2cc){return client[_0x9ddd('0x10')](_0x277e84,_0x1c23f8)[_0x9ddd('0x11')](function(_0x54c922){logger[_0x9ddd('0x12')](_0x9ddd('0x13'),_0x3e54a0,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3e54a0,_0x9ddd('0x14'),JSON[_0x9ddd('0x15')](_0x54c922));if(_0x54c922[_0x9ddd('0x16')]){if(_0x54c922['error'][_0x9ddd('0x17')]===0x1f4){logger[_0x9ddd('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x3e54a0,_0x54c922[_0x9ddd('0x16')][_0x9ddd('0x18')]);return _0x17b2cc(_0x54c922['error']['message']);}logger[_0x9ddd('0x16')](_0x9ddd('0x13'),_0x3e54a0,_0x54c922[_0x9ddd('0x16')][_0x9ddd('0x18')]);return _0x32d8dc(_0x54c922['error'][_0x9ddd('0x18')]);}else{logger['info'](_0x9ddd('0x13'),_0x3e54a0,_0x9ddd('0x14'));_0x32d8dc(_0x54c922[_0x9ddd('0x19')][_0x9ddd('0x18')]);}})[_0x9ddd('0x1a')](function(_0x1f6c62){logger[_0x9ddd('0x16')](_0x9ddd('0x13'),_0x3e54a0,_0x1f6c62);_0x17b2cc(_0x1f6c62);});});}exports['UpdateFaxInteraction']=function(_0x16ca84){var _0x2fed81=this;return new Promise(function(_0x10d4c0,_0x3a89c9){return db[_0x9ddd('0x1b')][_0x9ddd('0x1c')](_0x16ca84['body'],{'raw':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84['options'][_0x9ddd('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84[_0x9ddd('0x1d')][_0x9ddd('0x1f')]||null:null,'attributes':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84[_0x9ddd('0x1d')]['attributes']||null:null,'limit':_0x16ca84[_0x9ddd('0x1d')]?_0x16ca84[_0x9ddd('0x1d')][_0x9ddd('0x20')]||null:null})[_0x9ddd('0x11')](function(_0x139fce){logger[_0x9ddd('0x12')](_0x9ddd('0x21'),_0x16ca84);logger['debug'](_0x9ddd('0x21'),_0x16ca84,JSON[_0x9ddd('0x15')](_0x139fce));_0x10d4c0(_0x139fce);})['catch'](function(_0x476824){logger[_0x9ddd('0x16')]('UpdateFaxInteraction',_0x476824['message'],_0x16ca84);_0x3a89c9(_0x2fed81[_0x9ddd('0x16')](0x1f4,_0x476824[_0x9ddd('0x18')]));});});};exports[_0x9ddd('0x22')]=function(_0x41e5a9){return new Promise(function(_0x1d2c39,_0x3a5c0e){return db[_0x9ddd('0x1b')]['find']({'where':_0x41e5a9['options']?_0x41e5a9[_0x9ddd('0x1d')][_0x9ddd('0x1f')]||null:null})['then'](function(_0x2e692a){if(_0x2e692a){return _0x2e692a[_0x9ddd('0x23')](_0x41e5a9[_0x9ddd('0x24')][_0x9ddd('0x25')],_['omit'](_0x41e5a9[_0x9ddd('0x24')],[_0x9ddd('0x25'),'id'])||{});}})[_0x9ddd('0x26')](function(_0x3eb0a1){logger[_0x9ddd('0x12')]('AddTags',_0x41e5a9);logger[_0x9ddd('0x27')](_0x9ddd('0x28'),_0x41e5a9,JSON['stringify'](_0x3eb0a1));_0x1d2c39(_0x3eb0a1);})['catch'](function(_0x51a6d8){logger[_0x9ddd('0x16')](_0x9ddd('0x28'),_0x51a6d8[_0x9ddd('0x18')],_0x41e5a9);_0x3a5c0e(_this[_0x9ddd('0x16')](0x1f4,_0x51a6d8[_0x9ddd('0x18')]));});});};
\ No newline at end of file
index 2ed5c96..0a7c98b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dd7=['remove','update','emit','register','save'];(function(_0x19b704,_0x1197d0){var _0x3af958=function(_0x3c74d6){while(--_0x3c74d6){_0x19b704['push'](_0x19b704['shift']());}};_0x3af958(++_0x1197d0);}(_0x4dd7,0x1da));var _0x74dd=function(_0x21e68d,_0x467166){_0x21e68d=_0x21e68d-0x0;var _0x5a8031=_0x4dd7[_0x21e68d];return _0x5a8031;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x74dd('0x0'),_0x74dd('0x1'),_0x74dd('0x2')];function createListener(_0x18f206,_0x5e2434){return function(_0x53dfc5){_0x5e2434[_0x74dd('0x3')](_0x18f206,_0x53dfc5);};}function removeListener(_0x6720ac,_0x28c0d7){return function(){FaxInteractionEvents['removeListener'](_0x6720ac,_0x28c0d7);};}exports[_0x74dd('0x4')]=function(_0x5652d0){for(var _0x1be9fa=0x0,_0x59ea64=events['length'];_0x1be9fa<_0x59ea64;_0x1be9fa++){var _0x5737c1=events[_0x1be9fa];var _0xf27342=createListener('faxInteraction:'+_0x5737c1,_0x5652d0);FaxInteractionEvents['on'](_0x5737c1,_0xf27342);}};
\ No newline at end of file
+var _0x397f=['register','length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0x1ee056,_0x35733f){var _0x2a26f8=function(_0x4a13b3){while(--_0x4a13b3){_0x1ee056['push'](_0x1ee056['shift']());}};_0x2a26f8(++_0x35733f);}(_0x397f,0x1bc));var _0xf397=function(_0x23dc03,_0x522814){_0x23dc03=_0x23dc03-0x0;var _0x317567=_0x397f[_0x23dc03];return _0x317567;};'use strict';var FaxInteractionEvents=require(_0xf397('0x0'));var events=[_0xf397('0x1'),_0xf397('0x2'),_0xf397('0x3')];function createListener(_0x2d82d2,_0x5df84a){return function(_0x5fed7d){_0x5df84a[_0xf397('0x4')](_0x2d82d2,_0x5fed7d);};}function removeListener(_0x1b545d,_0x4cde45){return function(){FaxInteractionEvents[_0xf397('0x5')](_0x1b545d,_0x4cde45);};}exports[_0xf397('0x6')]=function(_0x611156){for(var _0x2cc5f7=0x0,_0x197e5a=events[_0xf397('0x7')];_0x2cc5f7<_0x197e5a;_0x2cc5f7++){var _0x2bc9e7=events[_0x2cc5f7];var _0x2170af=createListener(_0xf397('0x8')+_0x2bc9e7,_0x611156);FaxInteractionEvents['on'](_0x2bc9e7,_0x2170af);}};
\ No newline at end of file
index 6ad3727..d1a076c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37b1=['/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated'];(function(_0x2f4a32,_0x83f690){var _0x5a19de=function(_0x529052){while(--_0x529052){_0x2f4a32['push'](_0x2f4a32['shift']());}};_0x5a19de(++_0x83f690);}(_0x37b1,0x92));var _0x137b=function(_0x393ea9,_0x7080c0){_0x393ea9=_0x393ea9-0x0;var _0x5c7d42=_0x37b1[_0x393ea9];return _0x5c7d42;};'use strict';var multer=require(_0x137b('0x0'));var util=require('util');var path=require(_0x137b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x137b('0x2'));var auth=require(_0x137b('0x3'));var interaction=require(_0x137b('0x4'));var config=require(_0x137b('0x5'));var controller=require(_0x137b('0x6'));router[_0x137b('0x7')]('/',auth[_0x137b('0x8')](),controller['index']);router['get'](_0x137b('0x9'),auth[_0x137b('0x8')](),controller[_0x137b('0xa')]);router['get'](_0x137b('0xb'),auth[_0x137b('0x8')](),controller[_0x137b('0xc')]);router[_0x137b('0x7')](_0x137b('0xd'),auth[_0x137b('0x8')](),controller[_0x137b('0xe')]);router[_0x137b('0x7')]('/:id/download',auth[_0x137b('0x8')](),controller[_0x137b('0xf')]);router[_0x137b('0x10')]('/',auth[_0x137b('0x8')](),controller[_0x137b('0x11')]);router[_0x137b('0x10')](_0x137b('0xd'),auth[_0x137b('0x8')](),controller['addMessage']);router['post'](_0x137b('0x12'),auth[_0x137b('0x8')](),interaction[_0x137b('0x13')](_0x137b('0x14'),_0x137b('0x15')),controller[_0x137b('0x16')]);router[_0x137b('0x17')](_0x137b('0xb'),auth[_0x137b('0x8')](),interaction[_0x137b('0x13')](_0x137b('0x14'),_0x137b('0x18')),controller[_0x137b('0x19')]);router['delete'](_0x137b('0xb'),auth[_0x137b('0x8')](),interaction[_0x137b('0x13')]('fax',_0x137b('0x1a')),controller[_0x137b('0x1b')]);router[_0x137b('0x1c')](_0x137b('0x12'),auth[_0x137b('0x8')](),controller[_0x137b('0x1d')]);module[_0x137b('0x1e')]=router;
\ No newline at end of file
+var _0x0e38=['delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','fax','addTags','put','faxinteraction:update'];(function(_0x48fa99,_0x1b3544){var _0x30547b=function(_0x1e74e5){while(--_0x1e74e5){_0x48fa99['push'](_0x48fa99['shift']());}};_0x30547b(++_0x1b3544);}(_0x0e38,0x1f3));var _0x80e3=function(_0x58faab,_0x1f257){_0x58faab=_0x58faab-0x0;var _0x46ec13=_0x0e38[_0x58faab];return _0x46ec13;};'use strict';var multer=require(_0x80e3('0x0'));var util=require(_0x80e3('0x1'));var path=require(_0x80e3('0x2'));var timeout=require(_0x80e3('0x3'));var express=require(_0x80e3('0x4'));var router=express[_0x80e3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x80e3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x80e3('0x7'));var controller=require(_0x80e3('0x8'));router[_0x80e3('0x9')]('/',auth[_0x80e3('0xa')](),controller[_0x80e3('0xb')]);router[_0x80e3('0x9')](_0x80e3('0xc'),auth['isAuthenticated'](),controller[_0x80e3('0xd')]);router['get'](_0x80e3('0xe'),auth[_0x80e3('0xa')](),controller[_0x80e3('0xf')]);router['get'](_0x80e3('0x10'),auth[_0x80e3('0xa')](),controller[_0x80e3('0x11')]);router[_0x80e3('0x9')](_0x80e3('0x12'),auth['isAuthenticated'](),controller[_0x80e3('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x80e3('0x14')]);router[_0x80e3('0x15')](_0x80e3('0x10'),auth[_0x80e3('0xa')](),controller[_0x80e3('0x16')]);router[_0x80e3('0x15')](_0x80e3('0x17'),auth[_0x80e3('0xa')](),interaction[_0x80e3('0x18')](_0x80e3('0x19'),'faxinteraction:addtags'),controller[_0x80e3('0x1a')]);router[_0x80e3('0x1b')](_0x80e3('0xe'),auth[_0x80e3('0xa')](),interaction['tracked'](_0x80e3('0x19'),_0x80e3('0x1c')),controller['update']);router[_0x80e3('0x1d')](_0x80e3('0xe'),auth[_0x80e3('0xa')](),interaction[_0x80e3('0x18')](_0x80e3('0x19'),_0x80e3('0x1e')),controller['destroy']);router[_0x80e3('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x80e3('0x1f')]);module[_0x80e3('0x20')]=router;
\ No newline at end of file
index 5710d84..44b6843 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a59=['sequelize','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x431bc2,_0x31a56d){var _0x5bd128=function(_0x5e95ce){while(--_0x5e95ce){_0x431bc2['push'](_0x431bc2['shift']());}};_0x5bd128(++_0x31a56d);}(_0x7a59,0x16e));var _0x97a5=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0x7a59[_0x5a2285];return _0x48f6ed;};'use strict';var Sequelize=require(_0x97a5('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x97a5('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x97a5('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x97a5('0x3')]('in',_0x97a5('0x4')),'defaultValue':_0x97a5('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x97a5('0x5')]}};
\ No newline at end of file
+var _0x5636=['ENUM','out','DATE','sequelize','exports'];(function(_0x4fa0ea,_0x2cd534){var _0x51d027=function(_0xe67342){while(--_0xe67342){_0x4fa0ea['push'](_0x4fa0ea['shift']());}};_0x51d027(++_0x2cd534);}(_0x5636,0x102));var _0x6563=function(_0x1a2c1e,_0x7b5066){_0x1a2c1e=_0x1a2c1e-0x0;var _0x446072=_0x5636[_0x1a2c1e];return _0x446072;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6563('0x2')]('in',_0x6563('0x3')),'defaultValue':_0x6563('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6563('0x4')]}};
\ No newline at end of file
index 81d4b3a..0bf63f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['jayson/promise','client','http','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','then','rows','show','keys','length','find','update','body','params','../../config/logger','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','user','agent','get','FaxInteraction','FaxInteractionId','UserId','isNil','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','User','fullname','email','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','contact','internal','rejectmessage','create','CmContact','ContactId','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','attachments','Attachment','basename','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','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register'];(function(_0x629a48,_0x5dbd3f){var _0x44b629=function(_0x3686b7){while(--_0x3686b7){_0x629a48['push'](_0x629a48['shift']());}};_0x44b629(++_0x5dbd3f);}(_0x7a54,0x106));var _0x47a5=function(_0x41aadd,_0xd042af){_0x41aadd=_0x41aadd-0x0;var _0x3e69f7=_0x7a54[_0x41aadd];return _0x3e69f7;};'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'];config[_0x47a5('0x16')]=_[_0x47a5('0x17')](config['redis'],{'host':_0x47a5('0x18'),'port':0x18eb});var socket=require(_0x47a5('0x19'))(new Redis(config[_0x47a5('0x16')]));require(_0x47a5('0x1a'))[_0x47a5('0x1b')](socket);var jayson=require(_0x47a5('0x1c'));var client=jayson[_0x47a5('0x1d')][_0x47a5('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x47a5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x11faf5,_0x3b001e,_0x2a2cbb,_0x1ef44c){return new BPromise(function(_0x574af6,_0x549de3){var _0x138bc0=_0x1ef44c||client;return _0x138bc0['request'](_0x11faf5,_0x2a2cbb)['then'](function(_0x423a81){logger[_0x47a5('0x1f')](_0x47a5('0x20'),_0x3b001e,_0x47a5('0x21'));logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x3b001e,_0x47a5('0x21'),JSON[_0x47a5('0x24')](_0x423a81));if(_0x423a81[_0x47a5('0x25')]){if(_0x423a81['error'][_0x47a5('0x26')]===0x1f4){logger[_0x47a5('0x25')]('FaxMessage,\x20%s,\x20%s',_0x3b001e,_0x423a81[_0x47a5('0x25')][_0x47a5('0x27')]);return _0x549de3(_0x423a81[_0x47a5('0x25')]['message']);}logger[_0x47a5('0x25')](_0x47a5('0x20'),_0x3b001e,_0x423a81[_0x47a5('0x25')][_0x47a5('0x27')]);return _0x574af6(_0x423a81['error'][_0x47a5('0x27')]);}else{logger[_0x47a5('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x3b001e,_0x47a5('0x21'));_0x574af6(_0x423a81[_0x47a5('0x28')][_0x47a5('0x27')]);}})[_0x47a5('0x29')](function(_0x3abd6a){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3b001e,_0x3abd6a);_0x549de3(_0x3abd6a);});});}function respondWithStatusCode(_0x136745,_0x5686db){_0x5686db=_0x5686db||0xcc;return function(_0x1ea9c8){if(_0x1ea9c8){return _0x136745['sendStatus'](_0x5686db);}return _0x136745[_0x47a5('0x2a')](_0x5686db)[_0x47a5('0x2b')]();};}function respondWithResult(_0x36ad34,_0x1dac65){_0x1dac65=_0x1dac65||0xc8;return function(_0x21f296){if(_0x21f296){return _0x36ad34[_0x47a5('0x2a')](_0x1dac65)[_0x47a5('0x2c')](_0x21f296);}};}function respondWithFilteredResult(_0x136b14,_0x16631f){return function(_0x361bfa){if(_0x361bfa){var _0x1127f8=typeof _0x16631f[_0x47a5('0x2d')]===_0x47a5('0x2e')&&typeof _0x16631f['limit']===_0x47a5('0x2e');var _0x51833b=_0x361bfa[_0x47a5('0x2f')];var _0x9ac908=_0x1127f8?0x0:_0x16631f[_0x47a5('0x2d')];var _0x4d6b57=_0x1127f8?_0x361bfa[_0x47a5('0x2f')]:_0x16631f[_0x47a5('0x2d')]+_0x16631f[_0x47a5('0x30')];var _0x1f1c68;if(_0x4d6b57>=_0x51833b){_0x4d6b57=_0x51833b;_0x1f1c68=0xc8;}else{_0x1f1c68=0xce;}_0x136b14['status'](_0x1f1c68);return _0x136b14['set'](_0x47a5('0x31'),_0x9ac908+'-'+_0x4d6b57+'/'+_0x51833b)[_0x47a5('0x2c')](_0x361bfa);}return null;};}function patchUpdates(_0x5bd7eb){return function(_0x4e1006){try{jsonpatch[_0x47a5('0x32')](_0x4e1006,_0x5bd7eb,!![]);}catch(_0x51544e){return BPromise['reject'](_0x51544e);}return _0x4e1006[_0x47a5('0x33')]();};}function saveUpdates(_0x53119b,_0x122ed6){return function(_0xd972c){if(_0xd972c){return _0xd972c['update'](_0x53119b)['then'](function(_0x274e34){return _0x274e34;});}return null;};}function removeEntity(_0x5910bb,_0x403028){return function(_0x87e4c9){if(_0x87e4c9){return _0x87e4c9[_0x47a5('0x34')]()['then'](function(){_0x5910bb[_0x47a5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c754,_0x65542e){return function(_0x5a8a7c){if(!_0x5a8a7c){_0x53c754[_0x47a5('0x35')](0x194);}return _0x5a8a7c;};}function handleError(_0x5ef577,_0x21ad34){_0x21ad34=_0x21ad34||0x1f4;return function(_0x3534cb){logger[_0x47a5('0x25')](_0x3534cb[_0x47a5('0x36')]);if(_0x3534cb[_0x47a5('0x37')]){delete _0x3534cb[_0x47a5('0x37')];}_0x5ef577[_0x47a5('0x2a')](_0x21ad34)[_0x47a5('0x38')](_0x3534cb);};}exports[_0x47a5('0x39')]=function(_0x4caed5,_0x396a9a){var _0x10f136={},_0x511c06={},_0x2c50d6={'count':0x0,'rows':[]};var _0x2bf53d=_[_0x47a5('0x3a')](db['FaxMessage'][_0x47a5('0x3b')],function(_0x10f660){return{'name':_0x10f660['fieldName'],'type':_0x10f660[_0x47a5('0x3c')][_0x47a5('0x3d')]};});_0x511c06['model']=_['map'](_0x2bf53d,'name');_0x511c06[_0x47a5('0x3e')]=_['keys'](_0x4caed5[_0x47a5('0x3e')]);_0x511c06[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x511c06[_0x47a5('0x41')],_0x511c06[_0x47a5('0x3e')]);_0x10f136[_0x47a5('0x42')]=_[_0x47a5('0x40')](_0x511c06[_0x47a5('0x41')],qs[_0x47a5('0x43')](_0x4caed5[_0x47a5('0x3e')][_0x47a5('0x43')]));_0x10f136[_0x47a5('0x42')]=_0x10f136[_0x47a5('0x42')]['length']?_0x10f136[_0x47a5('0x42')]:_0x511c06[_0x47a5('0x41')];if(!_0x4caed5[_0x47a5('0x3e')][_0x47a5('0x44')]('nolimit')){_0x10f136[_0x47a5('0x30')]=qs['limit'](_0x4caed5['query']['limit']);_0x10f136['offset']=qs[_0x47a5('0x2d')](_0x4caed5['query'][_0x47a5('0x2d')]);}_0x10f136[_0x47a5('0x45')]=qs[_0x47a5('0x46')](_0x4caed5['query'][_0x47a5('0x46')]);_0x10f136[_0x47a5('0x47')]=qs['filters'](_['pick'](_0x4caed5[_0x47a5('0x3e')],_0x511c06['filters']),_0x2bf53d);if(_0x4caed5[_0x47a5('0x3e')][_0x47a5('0x48')]){_0x10f136[_0x47a5('0x47')]=_[_0x47a5('0x49')](_0x10f136[_0x47a5('0x47')],{'$or':_[_0x47a5('0x3a')](_0x2bf53d,function(_0x434227){if(_0x434227[_0x47a5('0x3c')]!==_0x47a5('0x4a')){var _0x162fa0={};_0x162fa0[_0x434227[_0x47a5('0x37')]]={'$like':'%'+_0x4caed5[_0x47a5('0x3e')][_0x47a5('0x48')]+'%'};return _0x162fa0;}})});}_0x10f136=_[_0x47a5('0x49')]({},_0x10f136,_0x4caed5[_0x47a5('0x4b')]);var _0x3a2b38={'where':_0x10f136['where']};return db[_0x47a5('0x4c')][_0x47a5('0x2f')](_0x3a2b38)['then'](function(_0x52b3a8){_0x2c50d6[_0x47a5('0x2f')]=_0x52b3a8;if(_0x4caed5['query'][_0x47a5('0x4d')]){_0x10f136[_0x47a5('0x4e')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x10f136);})[_0x47a5('0x4f')](function(_0x52d409){_0x2c50d6[_0x47a5('0x50')]=_0x52d409;return _0x2c50d6;})[_0x47a5('0x4f')](respondWithFilteredResult(_0x396a9a,_0x10f136))[_0x47a5('0x29')](handleError(_0x396a9a,null));};exports[_0x47a5('0x51')]=function(_0x44fe8a,_0x26acd2){var _0x238ebb={'raw':!![],'where':{'id':_0x44fe8a['params']['id']}},_0x53e994={};_0x53e994[_0x47a5('0x41')]=_[_0x47a5('0x52')](db[_0x47a5('0x4c')][_0x47a5('0x3b')]);_0x53e994[_0x47a5('0x3e')]=_[_0x47a5('0x52')](_0x44fe8a[_0x47a5('0x3e')]);_0x53e994['filters']=_[_0x47a5('0x40')](_0x53e994[_0x47a5('0x41')],_0x53e994[_0x47a5('0x3e')]);_0x238ebb['attributes']=_[_0x47a5('0x40')](_0x53e994['model'],qs[_0x47a5('0x43')](_0x44fe8a[_0x47a5('0x3e')][_0x47a5('0x43')]));_0x238ebb[_0x47a5('0x42')]=_0x238ebb['attributes'][_0x47a5('0x53')]?_0x238ebb[_0x47a5('0x42')]:_0x53e994[_0x47a5('0x41')];if(_0x44fe8a[_0x47a5('0x3e')][_0x47a5('0x4d')]){_0x238ebb[_0x47a5('0x4e')]=[{'all':!![]}];}_0x238ebb=_[_0x47a5('0x49')]({},_0x238ebb,_0x44fe8a['options']);return db[_0x47a5('0x4c')][_0x47a5('0x54')](_0x238ebb)[_0x47a5('0x4f')](handleEntityNotFound(_0x26acd2,null))[_0x47a5('0x4f')](respondWithResult(_0x26acd2,null))[_0x47a5('0x29')](handleError(_0x26acd2,null));};exports[_0x47a5('0x55')]=function(_0x572233,_0x1ad6a9){if(_0x572233[_0x47a5('0x56')]['id']){delete _0x572233[_0x47a5('0x56')]['id'];}return db['FaxMessage'][_0x47a5('0x54')]({'where':{'id':_0x572233[_0x47a5('0x57')]['id']}})[_0x47a5('0x4f')](handleEntityNotFound(_0x1ad6a9,null))['then'](saveUpdates(_0x572233['body'],null))[_0x47a5('0x4f')](respondWithResult(_0x1ad6a9,null))[_0x47a5('0x29')](handleError(_0x1ad6a9,null));};exports['destroy']=function(_0x4cf792,_0x6d6b2b){return db['FaxMessage'][_0x47a5('0x54')]({'where':{'id':_0x4cf792['params']['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x4f')](removeEntity(_0x6d6b2b,null))[_0x47a5('0x29')](handleError(_0x6d6b2b,null));};exports['describe']=function(_0x1b958b,_0x72fe){return db['FaxMessage']['describe']()[_0x47a5('0x4f')](respondWithResult(_0x72fe,null))[_0x47a5('0x29')](handleError(_0x72fe,null));};var interaction_log=require(_0x47a5('0x58'))(_0x47a5('0x59'));exports['accept']=function(_0x199621,_0x2b4255,_0x1af800){var _0x5a33b8={'agent':{},'channel':_0x47a5('0x5a')};if(_0x199621['body']['id']){delete _0x199621[_0x47a5('0x56')]['id'];}_0x199621[_0x47a5('0x56')][_0x47a5('0x5b')]=!![];_0x199621[_0x47a5('0x56')][_0x47a5('0x5c')]=moment()['format'](_0x47a5('0x5d'));_0x199621['body']['UserId']=_0x199621['body']['UserId']||_0x199621[_0x47a5('0x5e')]['id'];_0x5a33b8[_0x47a5('0x5f')]['id']=_0x199621[_0x47a5('0x56')]['UserId'];return db['FaxMessage'][_0x47a5('0x54')]({'where':{'id':_0x199621[_0x47a5('0x57')]['id'],'UserId':null}})[_0x47a5('0x4f')](handleEntityNotFound(_0x2b4255,null))[_0x47a5('0x4f')](saveUpdates(_0x199621[_0x47a5('0x56')],null))['then'](function(_0x3474b7){if(_0x3474b7){_0x5a33b8['message']=_0x3474b7[_0x47a5('0x60')]({'plain':!![]});return db[_0x47a5('0x61')]['find']({'where':{'id':_0x3474b7[_0x47a5('0x62')]}});}return null;})[_0x47a5('0x4f')](handleEntityNotFound(_0x2b4255,null))[_0x47a5('0x4f')](function(_0x3e8274){if(_0x3e8274){return _0x3e8274[_0x47a5('0x55')]({'UserId':_0x199621[_0x47a5('0x56')][_0x47a5('0x63')],'read1stAt':_[_0x47a5('0x64')](_0x3e8274['read1stAt'])?moment()[_0x47a5('0x65')](_0x47a5('0x5d')):undefined});}return null;})[_0x47a5('0x4f')](function(_0x26e7fc){if(_0x26e7fc){_0x5a33b8[_0x47a5('0x66')]=_0x26e7fc['get']({'plain':!![]});interaction_log[_0x47a5('0x1f')](_0x47a5('0x67'),_0x199621[_0x47a5('0x5e')]['id'],_0x199621[_0x47a5('0x5e')][_0x47a5('0x37')],_0x199621[_0x47a5('0x5e')][_0x47a5('0x68')],_0x5a33b8[_0x47a5('0x66')]['id'],_0x199621[_0x47a5('0x56')]?JSON[_0x47a5('0x24')](_0x199621[_0x47a5('0x56')]):_0x47a5('0x69'));return respondWithRpcPromise(_0x47a5('0x6a'),_0x47a5('0x6b'),_0x5a33b8);}return null;})[_0x47a5('0x4f')](function(_0x5a6161){var _0x42dd7d=_0x47a5('0x6c')+_0x5a6161[_0x47a5('0x27')]['ContactId'];return db[_0x47a5('0x6d')][_0x47a5('0x3e')](_0x42dd7d,{'type':db[_0x47a5('0x6e')][_0x47a5('0x6f')]['SELECT'],'raw':!![]})[_0x47a5('0x4f')](function(_0x522ccf){return _0x522ccf;});})[_0x47a5('0x4f')](function(_0x487e21){if(_0x487e21){_0x5a33b8[_0x47a5('0x27')]['contact']=_0x487e21[0x0];if(!_0x199621[_0x47a5('0x56')][_0x47a5('0x63')])return;return db[_0x47a5('0x70')]['find']({'where':{'id':_0x199621['body']['UserId'],'role':_0x47a5('0x5f')},'attributes':['id',_0x47a5('0x37'),_0x47a5('0x71'),_0x47a5('0x72'),'internal'],'raw':!![]});}return null;})[_0x47a5('0x4f')](function(_0xc12a6a){if(!_0xc12a6a)return null;_0x5a33b8[_0x47a5('0x27')][_0x47a5('0x5f')]=_0xc12a6a;return _0x5a33b8;})[_0x47a5('0x4f')](function(_0xb9f589){if(_0xb9f589){if(_0x199621[_0x47a5('0x56')][_0x47a5('0x73')]){_0x5a33b8[_0x47a5('0x27')][_0x47a5('0x74')]=util[_0x47a5('0x65')](_0x47a5('0x75'),_0x199621['user'][_0x47a5('0x37')]);_0x5a33b8['message'][_0x47a5('0x76')]=_0x5a33b8[_0x47a5('0x76')];_0x5a33b8[_0x47a5('0x27')][_0x47a5('0x77')]=_0x47a5('0x78');return respondWithRpcPromise(_0x47a5('0x79'),_0x47a5('0x79'),{'event':_0x47a5('0x7a'),'message':_0x5a33b8[_0x47a5('0x27')]},client9002)[_0x47a5('0x4f')](function(){return _0x5a33b8;});}return _0x5a33b8;}return null;})[_0x47a5('0x4f')](respondWithResult(_0x2b4255,null))[_0x47a5('0x29')](handleError(_0x2b4255,null));};var interaction_log=require(_0x47a5('0x58'))(_0x47a5('0x59'));exports[_0x47a5('0x7b')]=function(_0x4de126,_0x48eb77,_0x5ccc89){var _0x4d09a4={'agent':{},'channel':_0x47a5('0x5a')};if(_0x4de126[_0x47a5('0x56')]['id']){delete _0x4de126['body']['id'];}_0x4de126[_0x47a5('0x56')][_0x47a5('0x63')]=_0x4de126[_0x47a5('0x56')][_0x47a5('0x63')]||_0x4de126[_0x47a5('0x5e')]['id'];_0x4d09a4[_0x47a5('0x5f')]['id']=_0x4de126[_0x47a5('0x56')][_0x47a5('0x63')];return db[_0x47a5('0x4c')][_0x47a5('0x54')]({'where':{'id':_0x4de126[_0x47a5('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48eb77,null))[_0x47a5('0x4f')](function(_0x1fbd42){if(_0x1fbd42){_0x4d09a4[_0x47a5('0x27')]=_0x1fbd42['get']({'plain':!![]});return db[_0x47a5('0x61')][_0x47a5('0x54')]({'where':{'id':_0x1fbd42[_0x47a5('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x48eb77,null))[_0x47a5('0x4f')](function(_0x5205ba){if(_0x5205ba){_0x4d09a4['interaction']=_0x5205ba[_0x47a5('0x60')]({'plain':!![]});interaction_log[_0x47a5('0x1f')](_0x47a5('0x7c'),_0x4de126[_0x47a5('0x5e')]['id'],_0x4de126[_0x47a5('0x5e')][_0x47a5('0x37')],_0x4de126['user']['role'],_0x4d09a4[_0x47a5('0x66')]['id'],_0x4de126['body']?JSON[_0x47a5('0x24')](_0x4de126[_0x47a5('0x56')]):_0x47a5('0x69'));return respondWithRpcPromise(_0x47a5('0x7d'),'rejectMessage',_0x4d09a4);}return null;})[_0x47a5('0x4f')](function(_0x550bde){var _0x5f3a04=_0x47a5('0x6c')+_0x550bde[_0x47a5('0x27')]['ContactId'];return db[_0x47a5('0x6d')][_0x47a5('0x3e')](_0x5f3a04,{'type':db[_0x47a5('0x6e')]['QueryTypes'][_0x47a5('0x7e')],'raw':!![]})['then'](function(_0x2307da){return _0x2307da;});})[_0x47a5('0x4f')](function(_0x63e2e5){if(_0x63e2e5){_0x4d09a4['message'][_0x47a5('0x7f')]=_0x63e2e5[0x0];if(!_0x4de126[_0x47a5('0x56')][_0x47a5('0x63')])return;return db['User'][_0x47a5('0x54')]({'where':{'id':_0x4de126['body'][_0x47a5('0x63')],'role':'agent'},'attributes':['id',_0x47a5('0x37'),_0x47a5('0x71'),_0x47a5('0x72'),_0x47a5('0x80')],'raw':!![]});}return null;})['then'](function(_0x42fcce){if(!_0x42fcce)return null;_0x4d09a4[_0x47a5('0x27')][_0x47a5('0x5f')]=_0x42fcce;return _0x4d09a4;})[_0x47a5('0x4f')](function(_0x22d84a){if(_0x22d84a){_0x22d84a['message']['interface']=util[_0x47a5('0x65')]('SIP/%s',_0x4de126[_0x47a5('0x5e')][_0x47a5('0x37')]);_0x22d84a[_0x47a5('0x27')]['channel']=_0x4d09a4[_0x47a5('0x76')];_0x22d84a[_0x47a5('0x27')]['event']=_0x47a5('0x7b');respondWithRpcPromise(_0x47a5('0x79'),_0x47a5('0x79'),{'event':_0x47a5('0x81'),'message':_0x22d84a['message']},client9002);return _0x4d09a4;}return null;})['then'](respondWithResult(_0x48eb77,null))[_0x47a5('0x29')](handleError(_0x48eb77,null));};exports[_0x47a5('0x82')]=function(_0x48e7f3,_0x27d422){var _0x23f055;return db['FaxMessage'][_0x47a5('0x82')](_0x48e7f3[_0x47a5('0x56')],{})[_0x47a5('0x4f')](function(_0x59f010){_0x23f055=_0x59f010;return db[_0x47a5('0x83')]['findOne']({'where':{'id':_0x23f055[_0x47a5('0x84')]}});})['then'](function(_0x243c8b){if(_[_0x47a5('0x64')](_0x243c8b)){return;}else{_0x23f055['fax']=_0x243c8b[_0x47a5('0x5a')];return db['Attachment'][_0x47a5('0x85')]({'where':{'id':_0x23f055[_0x47a5('0x86')]}});}})[_0x47a5('0x4f')](function(_0x2be771){return respondWithRpcPromise('SendFax',_0x47a5('0x87'),{'FaxAccountId':_['isNil'](_0x48e7f3['body'])?undefined:_0x48e7f3[_0x47a5('0x56')][_0x47a5('0x88')],'path':_[_0x47a5('0x64')](_0x2be771)?undefined:util[_0x47a5('0x65')](_0x47a5('0x89'),_0x2be771['basename']),'fax':_[_0x47a5('0x64')](_0x23f055[_0x47a5('0x5a')])?undefined:_0x23f055[_0x47a5('0x5a')],'AttachmentId':_0x23f055[_0x47a5('0x86')]},client9002);})['then'](respondWithResult(_0x27d422,0xc9))[_0x47a5('0x29')](handleError(_0x27d422,null));};exports['download']=function(_0x12891d,_0x13b958){var _0x3f93f0=path[_0x47a5('0x8a')](config[_0x47a5('0x8b')],_0x47a5('0x8c'),_0x47a5('0x8d'),_0x47a5('0x8e'));return db[_0x47a5('0x4c')]['find']({'where':{'id':_0x12891d[_0x47a5('0x57')]['id']},'include':[{'model':db[_0x47a5('0x8f')],'as':'Attachment'}]})[_0x47a5('0x4f')](handleEntityNotFound(_0x13b958,null))[_0x47a5('0x4f')](function(_0x6d6a5){if(_0x6d6a5){return _0x13b958['download'](path['join'](_0x3f93f0,_0x6d6a5[_0x47a5('0x8f')][_0x47a5('0x90')]));}})['catch'](handleError(_0x13b958,null));};
\ No newline at end of file
+var _0x1967=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','end','name','send','index','map','FaxMessage','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filters','filter','where','type','VIRTUAL','include','rows','show','params','rawAttributes','includeAll','merge','options','find','body','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','read1stAt','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','ContactId','sequelize','SELECT','contact','User','fullname','email','internal','interface','channel','EventManager','acceptmessage','fax-interactions','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SIP/%s','event','create','findOne','Attachment','SendFax','isNil','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','attachments','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1967,0x173));var _0x7196=function(_0x181881,_0x4523b2){_0x181881=_0x181881-0x0;var _0x135617=_0x1967[_0x181881];return _0x135617;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];config[_0x7196('0x1c')]=_[_0x7196('0x1d')](config[_0x7196('0x1c')],{'host':_0x7196('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7196('0x1c')]));require(_0x7196('0x1f'))[_0x7196('0x20')](socket);var jayson=require(_0x7196('0x21'));var client=jayson['client'][_0x7196('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x7196('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2590a6,_0xf7e97,_0x3ed1ad,_0x12dce7){return new BPromise(function(_0x2e3e0e,_0x22bd62){var _0x1ed296=_0x12dce7||client;return _0x1ed296[_0x7196('0x23')](_0x2590a6,_0x3ed1ad)[_0x7196('0x24')](function(_0x385f2d){logger['info']('FaxMessage,\x20%s,\x20%s',_0xf7e97,_0x7196('0x25'));logger[_0x7196('0x26')](_0x7196('0x27'),_0xf7e97,'request\x20sent',JSON[_0x7196('0x28')](_0x385f2d));if(_0x385f2d['error']){if(_0x385f2d['error'][_0x7196('0x29')]===0x1f4){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0xf7e97,_0x385f2d['error']['message']);return _0x22bd62(_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);}logger['error'](_0x7196('0x2b'),_0xf7e97,_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);return _0x2e3e0e(_0x385f2d[_0x7196('0x2a')][_0x7196('0x2c')]);}else{logger['info'](_0x7196('0x2b'),_0xf7e97,'request\x20sent');_0x2e3e0e(_0x385f2d[_0x7196('0x2d')][_0x7196('0x2c')]);}})[_0x7196('0x2e')](function(_0xa69810){logger[_0x7196('0x2a')](_0x7196('0x2b'),_0xf7e97,_0xa69810);_0x22bd62(_0xa69810);});});}function respondWithStatusCode(_0x530ab5,_0x57c404){_0x57c404=_0x57c404||0xcc;return function(_0x1482e5){if(_0x1482e5){return _0x530ab5[_0x7196('0x2f')](_0x57c404);}return _0x530ab5[_0x7196('0x30')](_0x57c404)['end']();};}function respondWithResult(_0x5aa538,_0x41cfd2){_0x41cfd2=_0x41cfd2||0xc8;return function(_0x162cfc){if(_0x162cfc){return _0x5aa538[_0x7196('0x30')](_0x41cfd2)['json'](_0x162cfc);}};}function respondWithFilteredResult(_0x35eef9,_0x4ecea1){return function(_0x4fd339){if(_0x4fd339){var _0x59d79d=typeof _0x4ecea1[_0x7196('0x31')]===_0x7196('0x32')&&typeof _0x4ecea1[_0x7196('0x33')]==='undefined';var _0x35116f=_0x4fd339[_0x7196('0x34')];var _0x2f9583=_0x59d79d?0x0:_0x4ecea1[_0x7196('0x31')];var _0x50c386=_0x59d79d?_0x4fd339[_0x7196('0x34')]:_0x4ecea1[_0x7196('0x31')]+_0x4ecea1[_0x7196('0x33')];var _0x651d7e;if(_0x50c386>=_0x35116f){_0x50c386=_0x35116f;_0x651d7e=0xc8;}else{_0x651d7e=0xce;}_0x35eef9[_0x7196('0x30')](_0x651d7e);return _0x35eef9[_0x7196('0x35')](_0x7196('0x36'),_0x2f9583+'-'+_0x50c386+'/'+_0x35116f)[_0x7196('0x37')](_0x4fd339);}return null;};}function patchUpdates(_0x354175){return function(_0xf33b59){try{jsonpatch[_0x7196('0x38')](_0xf33b59,_0x354175,!![]);}catch(_0x54e46b){return BPromise[_0x7196('0x39')](_0x54e46b);}return _0xf33b59['save']();};}function saveUpdates(_0x2452f6,_0x4c3365){return function(_0x372ddc){if(_0x372ddc){return _0x372ddc[_0x7196('0x3a')](_0x2452f6)['then'](function(_0x628e7d){return _0x628e7d;});}return null;};}function removeEntity(_0x2bcadd,_0x4531d7){return function(_0x3a56b4){if(_0x3a56b4){return _0x3a56b4[_0x7196('0x3b')]()['then'](function(){_0x2bcadd[_0x7196('0x30')](0xcc)[_0x7196('0x3c')]();});}};}function handleEntityNotFound(_0x2174ca,_0xf2b652){return function(_0x3e8f98){if(!_0x3e8f98){_0x2174ca[_0x7196('0x2f')](0x194);}return _0x3e8f98;};}function handleError(_0x50a101,_0x23d7aa){_0x23d7aa=_0x23d7aa||0x1f4;return function(_0xe04e44){logger[_0x7196('0x2a')](_0xe04e44['stack']);if(_0xe04e44[_0x7196('0x3d')]){delete _0xe04e44[_0x7196('0x3d')];}_0x50a101[_0x7196('0x30')](_0x23d7aa)[_0x7196('0x3e')](_0xe04e44);};}exports[_0x7196('0x3f')]=function(_0x31fca7,_0x938e49){var _0x1ab720={},_0x92cfb1={},_0x3ee114={'count':0x0,'rows':[]};var _0x5354d3=_[_0x7196('0x40')](db[_0x7196('0x41')]['rawAttributes'],function(_0x186efe){return{'name':_0x186efe['fieldName'],'type':_0x186efe['type'][_0x7196('0x42')]};});_0x92cfb1[_0x7196('0x43')]=_['map'](_0x5354d3,'name');_0x92cfb1[_0x7196('0x44')]=_[_0x7196('0x45')](_0x31fca7[_0x7196('0x44')]);_0x92cfb1['filters']=_[_0x7196('0x46')](_0x92cfb1[_0x7196('0x43')],_0x92cfb1[_0x7196('0x44')]);_0x1ab720[_0x7196('0x47')]=_[_0x7196('0x46')](_0x92cfb1[_0x7196('0x43')],qs[_0x7196('0x48')](_0x31fca7[_0x7196('0x44')]['fields']));_0x1ab720[_0x7196('0x47')]=_0x1ab720[_0x7196('0x47')]['length']?_0x1ab720[_0x7196('0x47')]:_0x92cfb1[_0x7196('0x43')];if(!_0x31fca7['query'][_0x7196('0x49')](_0x7196('0x4a'))){_0x1ab720[_0x7196('0x33')]=qs['limit'](_0x31fca7[_0x7196('0x44')][_0x7196('0x33')]);_0x1ab720['offset']=qs[_0x7196('0x31')](_0x31fca7[_0x7196('0x44')]['offset']);}_0x1ab720[_0x7196('0x4b')]=qs['sort'](_0x31fca7['query']['sort']);_0x1ab720['where']=qs['filters'](_[_0x7196('0x4c')](_0x31fca7['query'],_0x92cfb1[_0x7196('0x4d')]),_0x5354d3);if(_0x31fca7[_0x7196('0x44')][_0x7196('0x4e')]){_0x1ab720[_0x7196('0x4f')]=_['merge'](_0x1ab720[_0x7196('0x4f')],{'$or':_['map'](_0x5354d3,function(_0x12ee76){if(_0x12ee76[_0x7196('0x50')]!==_0x7196('0x51')){var _0x5e34e8={};_0x5e34e8[_0x12ee76[_0x7196('0x3d')]]={'$like':'%'+_0x31fca7[_0x7196('0x44')][_0x7196('0x4e')]+'%'};return _0x5e34e8;}})});}_0x1ab720=_['merge']({},_0x1ab720,_0x31fca7['options']);var _0x1faa7b={'where':_0x1ab720['where']};return db[_0x7196('0x41')]['count'](_0x1faa7b)['then'](function(_0x14b489){_0x3ee114['count']=_0x14b489;if(_0x31fca7['query']['includeAll']){_0x1ab720[_0x7196('0x52')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1ab720);})[_0x7196('0x24')](function(_0x182c8b){_0x3ee114[_0x7196('0x53')]=_0x182c8b;return _0x3ee114;})[_0x7196('0x24')](respondWithFilteredResult(_0x938e49,_0x1ab720))['catch'](handleError(_0x938e49,null));};exports[_0x7196('0x54')]=function(_0x564688,_0x36844f){var _0x143c58={'raw':!![],'where':{'id':_0x564688[_0x7196('0x55')]['id']}},_0x513855={};_0x513855[_0x7196('0x43')]=_[_0x7196('0x45')](db['FaxMessage'][_0x7196('0x56')]);_0x513855['query']=_[_0x7196('0x45')](_0x564688[_0x7196('0x44')]);_0x513855[_0x7196('0x4d')]=_[_0x7196('0x46')](_0x513855[_0x7196('0x43')],_0x513855[_0x7196('0x44')]);_0x143c58[_0x7196('0x47')]=_[_0x7196('0x46')](_0x513855['model'],qs['fields'](_0x564688[_0x7196('0x44')][_0x7196('0x48')]));_0x143c58[_0x7196('0x47')]=_0x143c58[_0x7196('0x47')]['length']?_0x143c58[_0x7196('0x47')]:_0x513855[_0x7196('0x43')];if(_0x564688[_0x7196('0x44')][_0x7196('0x57')]){_0x143c58[_0x7196('0x52')]=[{'all':!![]}];}_0x143c58=_[_0x7196('0x58')]({},_0x143c58,_0x564688[_0x7196('0x59')]);return db[_0x7196('0x41')][_0x7196('0x5a')](_0x143c58)[_0x7196('0x24')](handleEntityNotFound(_0x36844f,null))[_0x7196('0x24')](respondWithResult(_0x36844f,null))['catch'](handleError(_0x36844f,null));};exports[_0x7196('0x3a')]=function(_0x6b65c1,_0x10ee13){if(_0x6b65c1['body']['id']){delete _0x6b65c1[_0x7196('0x5b')]['id'];}return db['FaxMessage'][_0x7196('0x5a')]({'where':{'id':_0x6b65c1[_0x7196('0x55')]['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x10ee13,null))[_0x7196('0x24')](saveUpdates(_0x6b65c1[_0x7196('0x5b')],null))['then'](respondWithResult(_0x10ee13,null))[_0x7196('0x2e')](handleError(_0x10ee13,null));};exports['destroy']=function(_0x4be36d,_0x5b9824){return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x4be36d[_0x7196('0x55')]['id']}})[_0x7196('0x24')](handleEntityNotFound(_0x5b9824,null))[_0x7196('0x24')](removeEntity(_0x5b9824,null))[_0x7196('0x2e')](handleError(_0x5b9824,null));};exports[_0x7196('0x5c')]=function(_0x560ddb,_0x293467){return db[_0x7196('0x41')][_0x7196('0x5c')]()[_0x7196('0x24')](respondWithResult(_0x293467,null))[_0x7196('0x2e')](handleError(_0x293467,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x7196('0x5d')]=function(_0x1c7eb2,_0xeb7e6e,_0x799399){var _0x14cb38={'agent':{},'channel':_0x7196('0x5e')};if(_0x1c7eb2[_0x7196('0x5b')]['id']){delete _0x1c7eb2[_0x7196('0x5b')]['id'];}_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x5f')]=!![];_0x1c7eb2[_0x7196('0x5b')]['readAt']=moment()[_0x7196('0x60')](_0x7196('0x61'));_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x62')]=_0x1c7eb2['body'][_0x7196('0x62')]||_0x1c7eb2[_0x7196('0x63')]['id'];_0x14cb38[_0x7196('0x64')]['id']=_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x62')];return db[_0x7196('0x41')][_0x7196('0x5a')]({'where':{'id':_0x1c7eb2['params']['id'],'UserId':null}})[_0x7196('0x24')](handleEntityNotFound(_0xeb7e6e,null))[_0x7196('0x24')](saveUpdates(_0x1c7eb2[_0x7196('0x5b')],null))[_0x7196('0x24')](function(_0x52827f){if(_0x52827f){_0x14cb38[_0x7196('0x2c')]=_0x52827f[_0x7196('0x65')]({'plain':!![]});return db[_0x7196('0x66')][_0x7196('0x5a')]({'where':{'id':_0x52827f[_0x7196('0x67')]}});}return null;})[_0x7196('0x24')](handleEntityNotFound(_0xeb7e6e,null))[_0x7196('0x24')](function(_0x517dfb){if(_0x517dfb){return _0x517dfb['update']({'UserId':_0x1c7eb2['body'][_0x7196('0x62')],'read1stAt':_['isNil'](_0x517dfb[_0x7196('0x68')])?moment()[_0x7196('0x60')](_0x7196('0x61')):undefined});}return null;})[_0x7196('0x24')](function(_0x1f4f0a){if(_0x1f4f0a){_0x14cb38[_0x7196('0x69')]=_0x1f4f0a[_0x7196('0x65')]({'plain':!![]});interaction_log[_0x7196('0x6a')](_0x7196('0x6b'),_0x1c7eb2['user']['id'],_0x1c7eb2['user'][_0x7196('0x3d')],_0x1c7eb2[_0x7196('0x63')][_0x7196('0x6c')],_0x14cb38[_0x7196('0x69')]['id'],_0x1c7eb2[_0x7196('0x5b')]?JSON[_0x7196('0x28')](_0x1c7eb2[_0x7196('0x5b')]):_0x7196('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x14cb38);}return null;})[_0x7196('0x24')](function(_0x529f56){var _0x30d114='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x529f56[_0x7196('0x2c')][_0x7196('0x6e')];return db[_0x7196('0x6f')][_0x7196('0x44')](_0x30d114,{'type':db['Sequelize']['QueryTypes'][_0x7196('0x70')],'raw':!![]})['then'](function(_0x3d2bee){return _0x3d2bee;});})[_0x7196('0x24')](function(_0x4526e8){if(_0x4526e8){_0x14cb38[_0x7196('0x2c')][_0x7196('0x71')]=_0x4526e8[0x0];if(!_0x1c7eb2[_0x7196('0x5b')]['UserId'])return;return db[_0x7196('0x72')][_0x7196('0x5a')]({'where':{'id':_0x1c7eb2[_0x7196('0x5b')][_0x7196('0x62')],'role':_0x7196('0x64')},'attributes':['id',_0x7196('0x3d'),_0x7196('0x73'),_0x7196('0x74'),_0x7196('0x75')],'raw':!![]});}return null;})[_0x7196('0x24')](function(_0x3d3768){if(!_0x3d3768)return null;_0x14cb38[_0x7196('0x2c')]['agent']=_0x3d3768;return _0x14cb38;})[_0x7196('0x24')](function(_0x13f802){if(_0x13f802){if(_0x1c7eb2['body']['manual']){_0x14cb38[_0x7196('0x2c')][_0x7196('0x76')]=util[_0x7196('0x60')]('SIP/%s',_0x1c7eb2[_0x7196('0x63')]['name']);_0x14cb38[_0x7196('0x2c')][_0x7196('0x77')]=_0x14cb38['channel'];_0x14cb38[_0x7196('0x2c')]['event']='accept';return respondWithRpcPromise(_0x7196('0x78'),_0x7196('0x78'),{'event':_0x7196('0x79'),'message':_0x14cb38['message']},client9002)[_0x7196('0x24')](function(){return _0x14cb38;});}return _0x14cb38;}return null;})['then'](respondWithResult(_0xeb7e6e,null))[_0x7196('0x2e')](handleError(_0xeb7e6e,null));};var interaction_log=require(_0x7196('0x16'))(_0x7196('0x7a'));exports[_0x7196('0x39')]=function(_0x2bb345,_0x5bd2f8,_0x20e96d){var _0x13c8c0={'agent':{},'channel':_0x7196('0x5e')};if(_0x2bb345[_0x7196('0x5b')]['id']){delete _0x2bb345[_0x7196('0x5b')]['id'];}_0x2bb345[_0x7196('0x5b')][_0x7196('0x62')]=_0x2bb345[_0x7196('0x5b')]['UserId']||_0x2bb345[_0x7196('0x63')]['id'];_0x13c8c0[_0x7196('0x64')]['id']=_0x2bb345[_0x7196('0x5b')][_0x7196('0x62')];return db['FaxMessage'][_0x7196('0x5a')]({'where':{'id':_0x2bb345[_0x7196('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5bd2f8,null))[_0x7196('0x24')](function(_0x53d470){if(_0x53d470){_0x13c8c0[_0x7196('0x2c')]=_0x53d470['get']({'plain':!![]});return db[_0x7196('0x66')][_0x7196('0x5a')]({'where':{'id':_0x53d470['FaxInteractionId']}});}return null;})[_0x7196('0x24')](handleEntityNotFound(_0x5bd2f8,null))[_0x7196('0x24')](function(_0x2c2c53){if(_0x2c2c53){_0x13c8c0['interaction']=_0x2c2c53['get']({'plain':!![]});interaction_log[_0x7196('0x6a')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bb345['user']['id'],_0x2bb345[_0x7196('0x63')][_0x7196('0x3d')],_0x2bb345[_0x7196('0x63')]['role'],_0x13c8c0[_0x7196('0x69')]['id'],_0x2bb345[_0x7196('0x5b')]?JSON[_0x7196('0x28')](_0x2bb345[_0x7196('0x5b')]):_0x7196('0x6d'));return respondWithRpcPromise(_0x7196('0x7b'),_0x7196('0x7c'),_0x13c8c0);}return null;})[_0x7196('0x24')](function(_0x32ba47){var _0x446f28=_0x7196('0x7d')+_0x32ba47['message']['ContactId'];return db[_0x7196('0x6f')]['query'](_0x446f28,{'type':db['Sequelize'][_0x7196('0x7e')][_0x7196('0x70')],'raw':!![]})[_0x7196('0x24')](function(_0x3fe7fd){return _0x3fe7fd;});})['then'](function(_0x50f2c4){if(_0x50f2c4){_0x13c8c0[_0x7196('0x2c')][_0x7196('0x71')]=_0x50f2c4[0x0];if(!_0x2bb345[_0x7196('0x5b')][_0x7196('0x62')])return;return db['User'][_0x7196('0x5a')]({'where':{'id':_0x2bb345['body']['UserId'],'role':_0x7196('0x64')},'attributes':['id',_0x7196('0x3d'),_0x7196('0x73'),'email',_0x7196('0x75')],'raw':!![]});}return null;})[_0x7196('0x24')](function(_0x1824e2){if(!_0x1824e2)return null;_0x13c8c0[_0x7196('0x2c')][_0x7196('0x64')]=_0x1824e2;return _0x13c8c0;})[_0x7196('0x24')](function(_0x214ec2){if(_0x214ec2){_0x214ec2[_0x7196('0x2c')]['interface']=util[_0x7196('0x60')](_0x7196('0x7f'),_0x2bb345[_0x7196('0x63')][_0x7196('0x3d')]);_0x214ec2[_0x7196('0x2c')]['channel']=_0x13c8c0[_0x7196('0x77')];_0x214ec2[_0x7196('0x2c')][_0x7196('0x80')]='reject';respondWithRpcPromise(_0x7196('0x78'),'EventManager',{'event':'rejectmessage','message':_0x214ec2[_0x7196('0x2c')]},client9002);return _0x13c8c0;}return null;})[_0x7196('0x24')](respondWithResult(_0x5bd2f8,null))['catch'](handleError(_0x5bd2f8,null));};exports[_0x7196('0x81')]=function(_0x40eb16,_0x48ceda){var _0x4cc782;return db[_0x7196('0x41')][_0x7196('0x81')](_0x40eb16[_0x7196('0x5b')],{})[_0x7196('0x24')](function(_0x34a46c){_0x4cc782=_0x34a46c;return db['CmContact'][_0x7196('0x82')]({'where':{'id':_0x4cc782[_0x7196('0x6e')]}});})[_0x7196('0x24')](function(_0x5b09a1){if(_['isNil'](_0x5b09a1)){return;}else{_0x4cc782['fax']=_0x5b09a1[_0x7196('0x5e')];return db[_0x7196('0x83')][_0x7196('0x82')]({'where':{'id':_0x4cc782['AttachmentId']}});}})[_0x7196('0x24')](function(_0x503d1f){return respondWithRpcPromise(_0x7196('0x84'),'SendFax',{'FaxAccountId':_[_0x7196('0x85')](_0x40eb16[_0x7196('0x5b')])?undefined:_0x40eb16[_0x7196('0x5b')][_0x7196('0x86')],'path':_[_0x7196('0x85')](_0x503d1f)?undefined:util[_0x7196('0x60')](_0x7196('0x87'),_0x503d1f['basename']),'fax':_[_0x7196('0x85')](_0x4cc782['fax'])?undefined:_0x4cc782['fax'],'AttachmentId':_0x4cc782['AttachmentId']},client9002);})['then'](respondWithResult(_0x48ceda,0xc9))['catch'](handleError(_0x48ceda,null));};exports[_0x7196('0x88')]=function(_0x12b032,_0x3fe3f5){var _0x5bab25=path[_0x7196('0x89')](config['root'],'server','files',_0x7196('0x8a'));return db['FaxMessage'][_0x7196('0x5a')]({'where':{'id':_0x12b032[_0x7196('0x55')]['id']},'include':[{'model':db[_0x7196('0x83')],'as':_0x7196('0x83')}]})[_0x7196('0x24')](handleEntityNotFound(_0x3fe3f5,null))[_0x7196('0x24')](function(_0x237a73){if(_0x237a73){return _0x3fe3f5[_0x7196('0x88')](path['join'](_0x5bab25,_0x237a73[_0x7196('0x83')][_0x7196('0x8b')]));}})[_0x7196('0x2e')](handleError(_0x3fe3f5,null));};
\ No newline at end of file
index 2b12e3d..30e0f53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x960c=['emit','hasOwnProperty','hook','events','FaxMessage','save','update','remove'];(function(_0x32a548,_0x2cbe5a){var _0x2a7d54=function(_0x588c14){while(--_0x588c14){_0x32a548['push'](_0x32a548['shift']());}};_0x2a7d54(++_0x2cbe5a);}(_0x960c,0x113));var _0xc960=function(_0xaae014,_0x236d99){_0xaae014=_0xaae014-0x0;var _0x16c2c9=_0x960c[_0xaae014];return _0x16c2c9;};'use strict';var EventEmitter=require(_0xc960('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xc960('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc960('0x2'),'afterUpdate':_0xc960('0x3'),'afterDestroy':_0xc960('0x4')};function emitEvent(_0x5c6ea5){return function(_0x1b54d7,_0x3ff69d,_0x485db9){FaxMessageEvents['emit'](_0x5c6ea5+':'+_0x1b54d7['id'],_0x1b54d7);FaxMessageEvents[_0xc960('0x5')](_0x5c6ea5,_0x1b54d7);_0x485db9(null);};}for(var e in events){if(events[_0xc960('0x6')](e)){var event=events[e];FaxMessage[_0xc960('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','update','remove'];(function(_0x5dc684,_0xf3e38c){var _0x138b5a=function(_0x45e275){while(--_0x45e275){_0x5dc684['push'](_0x5dc684['shift']());}};_0x138b5a(++_0xf3e38c);}(_0xd634,0xf4));var _0x4d63=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xd634[_0x247fa1];return _0x244f35;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){FaxMessageEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);FaxMessageEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];FaxMessage[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=FaxMessageEvents;
\ No newline at end of file
index e8861d8..56b9ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d2a=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','FaxInteraction','FaxInteractionId','then','createdAt','catch','error'];(function(_0x32ef5a,_0x38647a){var _0x31c603=function(_0x249484){while(--_0x249484){_0x32ef5a['push'](_0x32ef5a['shift']());}};_0x31c603(++_0x38647a);}(_0x4d2a,0x17b));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa4d2('0x0'));var util=require('util');var logger=require(_0xa4d2('0x1'))(_0xa4d2('0x2'));var moment=require(_0xa4d2('0x3'));var BPromise=require(_0xa4d2('0x4'));var rp=require(_0xa4d2('0x5'));var fs=require('fs');var path=require(_0xa4d2('0x6'));var rimraf=require(_0xa4d2('0x7'));var config=require('../../config/environment');var attributes=require(_0xa4d2('0x8'));module[_0xa4d2('0x9')]=function(_0x3e3217,_0x1e03c1){return _0x3e3217[_0xa4d2('0xa')](_0xa4d2('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xa4d2('0xc')],'type':_0xa4d2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ff9eb,_0x369c43,_0x1a0381){var _0x4492fd=_0x3e3217[_0xa4d2('0xe')];var _0x1ea918=_0x1ff9eb[_0xa4d2('0xf')]({'plain':!![]});if(_0x1ea918['direction']['toLowerCase']()==='in'||_0x1ea918[_0xa4d2('0x10')][_0xa4d2('0x11')]()===_0xa4d2('0x12')&&!_0x1ea918[_0xa4d2('0x13')]&&!_['isNil'](_0x1ea918['UserId'])){_0x4492fd[_0xa4d2('0x14')]['findOne']({'where':{'id':_0x1ea918[_0xa4d2('0x15')]}})[_0xa4d2('0x16')](function(_0x36675b){if(_0x36675b){_0x36675b['update']({'lastMsgAt':_0x1ea918[_0xa4d2('0x17')],'lastMsgDirection':_0x1ea918['direction'][_0xa4d2('0x11')]()});}})[_0xa4d2('0x18')](function(_0x8567bd){console[_0xa4d2('0x19')](_0x8567bd);});}_0x1a0381();}},'charset':'utf8mb4','collate':_0xa4d2('0x1a')});};
\ No newline at end of file
+var _0x6b12=['api','moment','request-promise','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x272ab5,_0x58a1be){var _0x37f52f=function(_0x437868){while(--_0x437868){_0x272ab5['push'](_0x272ab5['shift']());}};_0x37f52f(++_0x58a1be);}(_0x6b12,0x193));var _0x26b1=function(_0x51d3b1,_0x21fc0f){_0x51d3b1=_0x51d3b1-0x0;var _0x205d36=_0x6b12[_0x51d3b1];return _0x205d36;};'use strict';var _=require(_0x26b1('0x0'));var util=require(_0x26b1('0x1'));var logger=require('../../config/logger')(_0x26b1('0x2'));var moment=require(_0x26b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x26b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x26b1('0x5'));var config=require(_0x26b1('0x6'));var attributes=require(_0x26b1('0x7'));module['exports']=function(_0x29a61e,_0xeead96){return _0x29a61e[_0x26b1('0x8')](_0x26b1('0x9'),attributes,{'tableName':_0x26b1('0xa'),'paranoid':![],'indexes':[{'name':_0x26b1('0xb'),'fields':[_0x26b1('0xc')],'type':_0x26b1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf2a2b1,_0x185912,_0x2bd324){var _0x10f365=_0x29a61e[_0x26b1('0xe')];var _0x4929d8=_0xf2a2b1['get']({'plain':!![]});if(_0x4929d8['direction']['toLowerCase']()==='in'||_0x4929d8['direction'][_0x26b1('0xf')]()===_0x26b1('0x10')&&!_0x4929d8[_0x26b1('0x11')]&&!_[_0x26b1('0x12')](_0x4929d8[_0x26b1('0x13')])){_0x10f365['FaxInteraction'][_0x26b1('0x14')]({'where':{'id':_0x4929d8[_0x26b1('0x15')]}})['then'](function(_0x51f632){if(_0x51f632){_0x51f632[_0x26b1('0x16')]({'lastMsgAt':_0x4929d8[_0x26b1('0x17')],'lastMsgDirection':_0x4929d8['direction'][_0x26b1('0xf')]()});}})['catch'](function(_0x583e40){console[_0x26b1('0x18')](_0x583e40);});}_0x2bd324();}},'charset':_0x26b1('0x19'),'collate':_0x26b1('0x1a')});};
\ No newline at end of file
index a225576..a009dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','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','UpdateFaxMessage','update','where'];(function(_0x9dd6f2,_0x55472b){var _0xba1735=function(_0x55aa53){while(--_0x55aa53){_0x9dd6f2['push'](_0x9dd6f2['shift']());}};_0xba1735(++_0x55472b);}(_0xac31,0xca));var _0x1ac3=function(_0x52ff6e,_0x4d631b){_0x52ff6e=_0x52ff6e-0x0;var _0xfecdd7=_0xac31[_0x52ff6e];return _0xfecdd7;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});};
\ No newline at end of file
+var _0x032e=['FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','where','attributes','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info'];(function(_0x156750,_0x5d6c6f){var _0x4d7864=function(_0x5f4277){while(--_0x5f4277){_0x156750['push'](_0x156750['shift']());}};_0x4d7864(++_0x5d6c6f);}(_0x032e,0x124));var _0xe032=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x032e[_0xbb091];return _0x467a04;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var moment=require(_0xe032('0x1'));var BPromise=require(_0xe032('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe032('0x3'))['db'];var utils=require(_0xe032('0x4'));var logger=require(_0xe032('0x5'))(_0xe032('0x6'));var config=require(_0xe032('0x7'));var jayson=require(_0xe032('0x8'));var client=jayson[_0xe032('0x9')][_0xe032('0xa')]({'port':0x232a});config[_0xe032('0xb')]=_[_0xe032('0xc')](config[_0xe032('0xb')],{'host':_0xe032('0xd'),'port':0x18eb});var socket=require(_0xe032('0xe'))(new Redis(config[_0xe032('0xb')]));require(_0xe032('0xf'))[_0xe032('0x10')](socket);function respondWithRpcPromise(_0x2dc9e5,_0x167bd9,_0x4aec53){return new BPromise(function(_0x1382e1,_0x1ce2ae){return client[_0xe032('0x11')](_0x2dc9e5,_0x4aec53)[_0xe032('0x12')](function(_0x244f93){logger[_0xe032('0x13')](_0xe032('0x14'),_0x167bd9,'request\x20sent');logger[_0xe032('0x15')](_0xe032('0x16'),_0x167bd9,_0xe032('0x17'),JSON[_0xe032('0x18')](_0x244f93));if(_0x244f93['error']){if(_0x244f93[_0xe032('0x19')][_0xe032('0x1a')]===0x1f4){logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1ce2ae(_0x244f93[_0xe032('0x19')]['message']);}logger[_0xe032('0x19')](_0xe032('0x14'),_0x167bd9,_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);return _0x1382e1(_0x244f93[_0xe032('0x19')][_0xe032('0x1b')]);}else{logger['info'](_0xe032('0x14'),_0x167bd9,_0xe032('0x17'));_0x1382e1(_0x244f93[_0xe032('0x1c')][_0xe032('0x1b')]);}})[_0xe032('0x1d')](function(_0x5721ce){logger['error']('FaxMessage,\x20%s,\x20%s',_0x167bd9,_0x5721ce);_0x1ce2ae(_0x5721ce);});});}exports[_0xe032('0x1e')]=function(_0x505d8c){var _0x46dc27=this;return new Promise(function(_0x4608e4,_0x3f0257){return db[_0xe032('0x1f')][_0xe032('0x20')](_0x505d8c[_0xe032('0x21')],{'raw':_0x505d8c[_0xe032('0x22')]?_0x505d8c['options'][_0xe032('0x23')]===undefined?!![]:![]:!![]})[_0xe032('0x12')](function(_0x232e8f){logger[_0xe032('0x13')](_0xe032('0x1e'),_0x505d8c);logger[_0xe032('0x15')](_0xe032('0x1e'),_0x505d8c,JSON[_0xe032('0x18')](_0x232e8f));_0x4608e4(_0x232e8f);})['catch'](function(_0x4f1aa3){logger['error'](_0xe032('0x1e'),_0x4f1aa3[_0xe032('0x1b')],_0x505d8c);_0x3f0257(_0x46dc27[_0xe032('0x19')](0x1f4,_0x4f1aa3[_0xe032('0x1b')]));});});};exports[_0xe032('0x24')]=function(_0x200671){var _0x36ece7=this;return new Promise(function(_0x2b6ffa,_0x4dcbf1){return db[_0xe032('0x1f')]['update'](_0x200671[_0xe032('0x21')],{'raw':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200671['options']?_0x200671['options'][_0xe032('0x25')]||null:null,'attributes':_0x200671[_0xe032('0x22')]?_0x200671[_0xe032('0x22')][_0xe032('0x26')]||null:null,'limit':_0x200671['options']?_0x200671['options']['limit']||null:null})[_0xe032('0x12')](function(_0x1dd34f){logger[_0xe032('0x13')](_0xe032('0x24'),_0x200671);logger['debug'](_0xe032('0x24'),_0x200671,JSON[_0xe032('0x18')](_0x1dd34f));_0x2b6ffa(_0x1dd34f);})[_0xe032('0x1d')](function(_0x4348f8){logger[_0xe032('0x19')]('UpdateFaxMessage',_0x4348f8[_0xe032('0x1b')],_0x200671);_0x4dcbf1(_0x36ece7[_0xe032('0x19')](0x1f4,_0x4348f8[_0xe032('0x1b')]));});});};
\ No newline at end of file
index 87cffd0..8cc5b8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfea0=['update','removeListener','register','./faxMessage.events','save','remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfea0,0x1e9));var _0x0fea=function(_0xbdf952,_0x598f27){_0xbdf952=_0xbdf952-0x0;var _0x4a5e1d=_0xfea0[_0xbdf952];return _0x4a5e1d;};'use strict';var FaxMessageEvents=require(_0x0fea('0x0'));var events=[_0x0fea('0x1'),_0x0fea('0x2'),_0x0fea('0x3')];function createListener(_0x4fa5c8,_0x55f1bb){return function(_0x29f65d){_0x55f1bb['emit'](_0x4fa5c8,_0x29f65d);};}function removeListener(_0x327de2,_0x2073bc){return function(){FaxMessageEvents[_0x0fea('0x4')](_0x327de2,_0x2073bc);};}exports[_0x0fea('0x5')]=function(_0x5e8c05){for(var _0x59095c=0x0,_0x422514=events['length'];_0x59095c<_0x422514;_0x59095c++){var _0x2b3a06=events[_0x59095c];var _0x3954e4=createListener('faxMessage:'+_0x2b3a06,_0x5e8c05);FaxMessageEvents['on'](_0x2b3a06,_0x3954e4);}};
\ No newline at end of file
+var _0x191c=['register','length','faxMessage:','./faxMessage.events','save','removeListener'];(function(_0x33edb5,_0x4e59d1){var _0x525435=function(_0x4b161b){while(--_0x4b161b){_0x33edb5['push'](_0x33edb5['shift']());}};_0x525435(++_0x4e59d1);}(_0x191c,0xb1));var _0xc191=function(_0xd7e22f,_0x2a75cd){_0xd7e22f=_0xd7e22f-0x0;var _0x354650=_0x191c[_0xd7e22f];return _0x354650;};'use strict';var FaxMessageEvents=require(_0xc191('0x0'));var events=[_0xc191('0x1'),'remove','update'];function createListener(_0x5c179c,_0x38b155){return function(_0x3066ac){_0x38b155['emit'](_0x5c179c,_0x3066ac);};}function removeListener(_0x397542,_0x4e892e){return function(){FaxMessageEvents[_0xc191('0x2')](_0x397542,_0x4e892e);};}exports[_0xc191('0x3')]=function(_0x4510a3){for(var _0x260641=0x0,_0x4f69ff=events[_0xc191('0x4')];_0x260641<_0x4f69ff;_0x260641++){var _0x317208=events[_0x260641];var _0x59cb62=createListener(_0xc191('0x5')+_0x317208,_0x4510a3);FaxMessageEvents['on'](_0x317208,_0x59cb62);}};
\ No newline at end of file
index 67b20e0..b2f48fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['/describe','isAuthenticated','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','/:id','update','put','accept','/:id/reject','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','index','get'];(function(_0x438c82,_0xd70276){var _0x17073a=function(_0x3e21d2){while(--_0x3e21d2){_0x438c82['push'](_0x438c82['shift']());}};_0x17073a(++_0xd70276);}(_0xa74f,0x9a));var _0xfa74=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa74f[_0x288f5e];return _0x476cc9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0x7')](_0xfa74('0xc'),auth['isAuthenticated'](),controller[_0xfa74('0xd')]);router[_0xfa74('0xe')]('/',auth['isAuthenticated'](),interaction[_0xfa74('0xf')](_0xfa74('0x10'),_0xfa74('0x11')),controller[_0xfa74('0x12')]);router['put'](_0xfa74('0x13'),auth[_0xfa74('0x9')](),controller[_0xfa74('0x14')]);router[_0xfa74('0x15')]('/:id/accept',auth[_0xfa74('0x9')](),controller[_0xfa74('0x16')]);router[_0xfa74('0x15')](_0xfa74('0x17'),auth[_0xfa74('0x9')](),controller['reject']);router[_0xfa74('0x18')](_0xfa74('0x13'),auth[_0xfa74('0x9')](),controller[_0xfa74('0x19')]);module[_0xfa74('0x1a')]=router;
\ No newline at end of file
+var _0xcea2=['create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x8b1a5e,_0x2744eb){var _0x1146b1=function(_0x5a9f50){while(--_0x5a9f50){_0x8b1a5e['push'](_0x8b1a5e['shift']());}};_0x1146b1(++_0x2744eb);}(_0xcea2,0x15a));var _0x2cea=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcea2[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0xd')]);router[_0x2cea('0x9')](_0x2cea('0xe'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xf')]);router[_0x2cea('0x10')]('/',auth[_0x2cea('0x8')](),interaction[_0x2cea('0x11')]('fax','faxmessage:create'),controller[_0x2cea('0x12')]);router[_0x2cea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2cea('0x14')]);router['put'](_0x2cea('0x15'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x2cea('0x17')]);router['delete'](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x18')]);module[_0x2cea('0x19')]=router;
\ No newline at end of file
index 48abde3..e6a8f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71fb=['STRING','INTEGER','rrmemory','beepall','sequelize','exports'];(function(_0x16ec9d,_0x36ac5d){var _0x1e98b=function(_0x18a954){while(--_0x18a954){_0x16ec9d['push'](_0x16ec9d['shift']());}};_0x1e98b(++_0x36ac5d);}(_0x71fb,0xd0));var _0xb71f=function(_0x5793da,_0x28279b){_0x5793da=_0x5793da-0x0;var _0x4bf723=_0x71fb[_0x5793da];return _0x4bf723;};'use strict';var Sequelize=require(_0xb71f('0x0'));module[_0xb71f('0x1')]={'name':{'type':Sequelize[_0xb71f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb71f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb71f('0x4'),_0xb71f('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb71f('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1cd0=['roundrobin','exports','STRING','INTEGER','beepall'];(function(_0x427956,_0x2d1ec2){var _0x55ba46=function(_0x37ab97){while(--_0x37ab97){_0x427956['push'](_0x427956['shift']());}};_0x55ba46(++_0x2d1ec2);}(_0x1cd0,0x1e1));var _0x01cd=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x1cd0[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require('sequelize');module[_0x01cd('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x01cd('0x1')]},'timeout':{'type':Sequelize[_0x01cd('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x01cd('0x3'),_0x01cd('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index b9a10d4..1931160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['getMembers','findOne','UserFaxQueue','nolimit','findAll','User','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','hasOwnProperty','ids','Team','Agents','voicePause','interface','sequelize','transaction','addTeams','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','isEmpty','addAgents','userFaxQueue:save','removeAgents','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxQueues','UserProfileResource','then','error','stack','name','send','index','FaxQueue','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','type','merge','options','includeAll','include','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe'];(function(_0x437545,_0x4ab48b){var _0x408060=function(_0x564586){while(--_0x564586){_0x437545['push'](_0x437545['shift']());}};_0x408060(++_0x4ab48b);}(_0x32b6,0x1d1));var _0x632b=function(_0xee4f73,_0x2f05d5){_0xee4f73=_0xee4f73-0x0;var _0x2ecc82=_0x32b6[_0xee4f73];return _0x2ecc82;};'use strict';var emlformat=require(_0x632b('0x0'));var rimraf=require(_0x632b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x632b('0x2'));var rp=require(_0x632b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x632b('0x4'));var util=require(_0x632b('0x5'));var path=require(_0x632b('0x6'));var sox=require(_0x632b('0x7'));var csv=require(_0x632b('0x8'));var ejs=require(_0x632b('0x9'));var fs=require('fs');var fs_extra=require(_0x632b('0xa'));var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x8'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x632b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x632b('0x12'))(_0x632b('0x13'));var utils=require(_0x632b('0x14'));var config=require(_0x632b('0x15'));var licenseUtil=require(_0x632b('0x16'));var db=require(_0x632b('0x17'))['db'];config[_0x632b('0x18')]=_[_0x632b('0x19')](config[_0x632b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x632b('0x1a'))(new Redis(config[_0x632b('0x18')]));require(_0x632b('0x1b'))['register'](socket);function respondWithStatusCode(_0x721883,_0x1a3a60){_0x1a3a60=_0x1a3a60||0xcc;return function(_0x108249){if(_0x108249){return _0x721883[_0x632b('0x1c')](_0x1a3a60);}return _0x721883[_0x632b('0x1d')](_0x1a3a60)[_0x632b('0x1e')]();};}function respondWithResult(_0x4efe39,_0x17ddc5){_0x17ddc5=_0x17ddc5||0xc8;return function(_0x52f353){if(_0x52f353){return _0x4efe39['status'](_0x17ddc5)[_0x632b('0x1f')](_0x52f353);}};}function respondWithFilteredResult(_0x5afa1e,_0x2c8340){return function(_0x3bb27f){if(_0x3bb27f){var _0x28c472=typeof _0x2c8340['offset']===_0x632b('0x20')&&typeof _0x2c8340[_0x632b('0x21')]===_0x632b('0x20');var _0x3683e4=_0x3bb27f['count'];var _0x472e34=_0x28c472?0x0:_0x2c8340[_0x632b('0x22')];var _0x4f377f=_0x28c472?_0x3bb27f[_0x632b('0x23')]:_0x2c8340['offset']+_0x2c8340['limit'];var _0x1b1092;if(_0x4f377f>=_0x3683e4){_0x4f377f=_0x3683e4;_0x1b1092=0xc8;}else{_0x1b1092=0xce;}_0x5afa1e['status'](_0x1b1092);return _0x5afa1e[_0x632b('0x24')](_0x632b('0x25'),_0x472e34+'-'+_0x4f377f+'/'+_0x3683e4)[_0x632b('0x1f')](_0x3bb27f);}return null;};}function patchUpdates(_0x540bfb){return function(_0x10fc32){try{jsonpatch[_0x632b('0x26')](_0x10fc32,_0x540bfb,!![]);}catch(_0x59d83a){return BPromise[_0x632b('0x27')](_0x59d83a);}return _0x10fc32[_0x632b('0x28')]();};}function saveUpdates(_0x30ffb9,_0x1e448c){return function(_0x45d017){if(_0x45d017){return _0x45d017[_0x632b('0x29')](_0x30ffb9)['then'](function(_0x5e7b20){return _0x5e7b20;});}return null;};}function removeEntity(_0x11fe61,_0x4d3a70){return function(_0x4ebd26){if(_0x4ebd26){return _0x4ebd26[_0x632b('0x2a')]()['then'](function(){var _0x273e89=_0x4ebd26[_0x632b('0x2b')]({'plain':!![]});var _0x29d9aa=_0x632b('0x2c');return db[_0x632b('0x2d')][_0x632b('0x2a')]({'where':{'type':_0x29d9aa,'resourceId':_0x273e89['id']}})[_0x632b('0x2e')](function(){return _0x4ebd26;});})[_0x632b('0x2e')](function(){_0x11fe61[_0x632b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bb484,_0x35348e){return function(_0x1819fa){if(!_0x1819fa){_0x1bb484[_0x632b('0x1c')](0x194);}return _0x1819fa;};}function handleError(_0x17a5ba,_0x2a34fa){_0x2a34fa=_0x2a34fa||0x1f4;return function(_0x3c5dc9){logger[_0x632b('0x2f')](_0x3c5dc9[_0x632b('0x30')]);if(_0x3c5dc9[_0x632b('0x31')]){delete _0x3c5dc9[_0x632b('0x31')];}_0x17a5ba[_0x632b('0x1d')](_0x2a34fa)[_0x632b('0x32')](_0x3c5dc9);};}exports[_0x632b('0x33')]=function(_0x227497,_0x3dff99){var _0x18efab={},_0x36936d={},_0x3f3dc4={'count':0x0,'rows':[]};var _0x12f00=_['map'](db[_0x632b('0x34')][_0x632b('0x35')],function(_0x397f36){return{'name':_0x397f36[_0x632b('0x36')],'type':_0x397f36['type'][_0x632b('0x37')]};});_0x36936d['model']=_[_0x632b('0x38')](_0x12f00,_0x632b('0x31'));_0x36936d['query']=_[_0x632b('0x39')](_0x227497[_0x632b('0x3a')]);_0x36936d[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x36936d[_0x632b('0x3d')],_0x36936d[_0x632b('0x3a')]);_0x18efab[_0x632b('0x3e')]=_[_0x632b('0x3c')](_0x36936d['model'],qs['fields'](_0x227497[_0x632b('0x3a')][_0x632b('0x3f')]));_0x18efab[_0x632b('0x3e')]=_0x18efab[_0x632b('0x3e')][_0x632b('0x40')]?_0x18efab[_0x632b('0x3e')]:_0x36936d[_0x632b('0x3d')];if(!_0x227497[_0x632b('0x3a')]['hasOwnProperty']('nolimit')){_0x18efab[_0x632b('0x21')]=qs['limit'](_0x227497[_0x632b('0x3a')][_0x632b('0x21')]);_0x18efab[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x227497[_0x632b('0x3a')][_0x632b('0x22')]);}_0x18efab[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x227497[_0x632b('0x3a')][_0x632b('0x42')]);_0x18efab[_0x632b('0x43')]=qs[_0x632b('0x3b')](_[_0x632b('0x44')](_0x227497[_0x632b('0x3a')],_0x36936d[_0x632b('0x3b')]),_0x12f00);if(_0x227497[_0x632b('0x3a')][_0x632b('0x45')]){_0x18efab['where']=_['merge'](_0x18efab['where'],{'$or':_['map'](_0x12f00,function(_0x57f099){if(_0x57f099[_0x632b('0x46')]!=='VIRTUAL'){var _0x5529cb={};_0x5529cb[_0x57f099['name']]={'$like':'%'+_0x227497[_0x632b('0x3a')][_0x632b('0x45')]+'%'};return _0x5529cb;}})});}_0x18efab=_[_0x632b('0x47')]({},_0x18efab,_0x227497[_0x632b('0x48')]);var _0x5a1017={'where':_0x18efab[_0x632b('0x43')]};return db[_0x632b('0x34')][_0x632b('0x23')](_0x5a1017)['then'](function(_0x15bb30){_0x3f3dc4[_0x632b('0x23')]=_0x15bb30;if(_0x227497[_0x632b('0x3a')][_0x632b('0x49')]){_0x18efab[_0x632b('0x4a')]=[{'all':!![]}];}return db[_0x632b('0x34')]['findAll'](_0x18efab);})[_0x632b('0x2e')](function(_0x2b90c8){_0x3f3dc4[_0x632b('0x4b')]=_0x2b90c8;return _0x3f3dc4;})[_0x632b('0x2e')](respondWithFilteredResult(_0x3dff99,_0x18efab))['catch'](handleError(_0x3dff99,null));};exports['show']=function(_0x39b17c,_0x26b35b){var _0x70ddc9={'raw':!![],'where':{'id':_0x39b17c[_0x632b('0x4c')]['id']}},_0x3566e7={};_0x3566e7[_0x632b('0x3d')]=_['keys'](db[_0x632b('0x34')][_0x632b('0x35')]);_0x3566e7[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x39b17c[_0x632b('0x3a')]);_0x3566e7[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x3566e7[_0x632b('0x3d')],_0x3566e7['query']);_0x70ddc9[_0x632b('0x3e')]=_['intersection'](_0x3566e7[_0x632b('0x3d')],qs['fields'](_0x39b17c[_0x632b('0x3a')][_0x632b('0x3f')]));_0x70ddc9[_0x632b('0x3e')]=_0x70ddc9[_0x632b('0x3e')][_0x632b('0x40')]?_0x70ddc9['attributes']:_0x3566e7[_0x632b('0x3d')];if(_0x39b17c[_0x632b('0x3a')][_0x632b('0x49')]){_0x70ddc9['include']=[{'all':!![]}];}_0x70ddc9=_[_0x632b('0x47')]({},_0x70ddc9,_0x39b17c[_0x632b('0x48')]);return db[_0x632b('0x34')][_0x632b('0x4d')](_0x70ddc9)[_0x632b('0x2e')](handleEntityNotFound(_0x26b35b,null))['then'](respondWithResult(_0x26b35b,null))[_0x632b('0x4e')](handleError(_0x26b35b,null));};exports['create']=function(_0x33da2b,_0x369cdc){return db[_0x632b('0x34')][_0x632b('0x4f')](_0x33da2b[_0x632b('0x50')],{})['then'](function(_0x4c9b4e){var _0x3726b6=_0x33da2b[_0x632b('0x51')][_0x632b('0x2b')]({'plain':!![]});if(!_0x3726b6)throw new Error(_0x632b('0x52'));if(_0x3726b6[_0x632b('0x53')]===_0x632b('0x51')){var _0x509bf7=_0x4c9b4e[_0x632b('0x2b')]({'plain':!![]});var _0x1d35b2=_0x632b('0x2c');return db['UserProfileSection'][_0x632b('0x4d')]({'where':{'name':_0x1d35b2,'userProfileId':_0x3726b6[_0x632b('0x54')]},'raw':!![]})[_0x632b('0x2e')](function(_0x1a79fa){if(_0x1a79fa&&_0x1a79fa['autoAssociation']===0x0){return db[_0x632b('0x2d')][_0x632b('0x4f')]({'name':_0x509bf7[_0x632b('0x31')],'resourceId':_0x509bf7['id'],'type':_0x1a79fa[_0x632b('0x31')],'sectionId':_0x1a79fa['id']},{})[_0x632b('0x2e')](function(){return _0x4c9b4e;});}else{return _0x4c9b4e;}})['catch'](function(_0x2c058d){logger[_0x632b('0x2f')](_0x632b('0x55'),_0x2c058d);throw _0x2c058d;});}return _0x4c9b4e;})[_0x632b('0x2e')](respondWithResult(_0x369cdc,0xc9))[_0x632b('0x4e')](handleError(_0x369cdc,null));};exports['update']=function(_0x3c2cd4,_0x240d78){if(_0x3c2cd4[_0x632b('0x50')]['id']){delete _0x3c2cd4[_0x632b('0x50')]['id'];}return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x3c2cd4[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x240d78,null))[_0x632b('0x2e')](saveUpdates(_0x3c2cd4[_0x632b('0x50')],null))[_0x632b('0x2e')](respondWithResult(_0x240d78,null))['catch'](handleError(_0x240d78,null));};exports[_0x632b('0x2a')]=function(_0x1d2edc,_0xe85c2f){return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x1d2edc['params']['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0xe85c2f,null))[_0x632b('0x2e')](removeEntity(_0xe85c2f,null))[_0x632b('0x4e')](handleError(_0xe85c2f,null));};exports[_0x632b('0x56')]=function(_0x387d76,_0xe7274a){return db[_0x632b('0x34')]['describe']()[_0x632b('0x2e')](respondWithResult(_0xe7274a,null))['catch'](handleError(_0xe7274a,null));};exports[_0x632b('0x57')]=function(_0x541b51,_0xddc351,_0x562b67){var _0x389944={'raw':!![],'where':{}},_0x18ee82={},_0x579fe1;return db['FaxQueue'][_0x632b('0x58')]({'where':{'id':_0x541b51[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0xddc351,null))[_0x632b('0x2e')](function(_0x52eed9){if(_0x52eed9){_0x579fe1=_0x52eed9[_0x632b('0x2b')]({'plain':!![]});_0x18ee82[_0x632b('0x3d')]=_['keys'](db[_0x632b('0x59')]['rawAttributes']);_0x18ee82[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x541b51['query']);_0x18ee82[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x18ee82[_0x632b('0x3d')],_0x18ee82[_0x632b('0x3a')]);_0x389944['attributes']=_[_0x632b('0x3c')](_0x18ee82[_0x632b('0x3d')],qs[_0x632b('0x3f')](_0x541b51[_0x632b('0x3a')]['fields']));_0x389944[_0x632b('0x3e')]=_0x389944[_0x632b('0x3e')][_0x632b('0x40')]?_0x389944[_0x632b('0x3e')]:_0x18ee82[_0x632b('0x3d')];if(!_0x541b51[_0x632b('0x3a')]['hasOwnProperty'](_0x632b('0x5a'))){_0x389944[_0x632b('0x21')]=qs[_0x632b('0x21')](_0x541b51['query']['limit']);_0x389944[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x541b51[_0x632b('0x3a')][_0x632b('0x22')]);}_0x389944[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x541b51[_0x632b('0x3a')]['sort']);_0x389944[_0x632b('0x43')]=qs[_0x632b('0x3b')](_[_0x632b('0x44')](_0x541b51[_0x632b('0x3a')],_0x18ee82[_0x632b('0x3b')]));_0x389944[_0x632b('0x43')]['FaxQueueId']=_0x52eed9['id'];if(_0x541b51[_0x632b('0x3a')][_0x632b('0x45')]){_0x389944[_0x632b('0x43')]=_[_0x632b('0x47')](_0x389944['where'],{'$or':_[_0x632b('0x38')](_0x389944[_0x632b('0x3e')],function(_0x4a1c15){var _0x5530e8={};_0x5530e8[_0x4a1c15]={'$like':'%'+_0x541b51[_0x632b('0x3a')][_0x632b('0x45')]+'%'};return _0x5530e8;})});}_0x389944=_[_0x632b('0x47')]({},_0x389944,_0x541b51[_0x632b('0x48')]);return db[_0x632b('0x59')][_0x632b('0x5b')](_0x389944);}})['then'](function(_0x1222ab){if(_0x1222ab){return db[_0x632b('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0x1222ab,'UserId'),'role':_0x632b('0x5d')},'attributes':['id',_0x632b('0x31'),_0x632b('0x5e'),_0x632b('0x5f'),_0x632b('0x60')]});}})['then'](function(_0x4b876e){if(_0x4b876e){return{'count':_0x4b876e[_0x632b('0x23')],'rows':_[_0x632b('0x38')](_0x4b876e['rows'],function(_0x580b12){return{'membername':_0x580b12[_0x632b('0x31')],'UserId':_0x580b12['id'],'queue_name':_0x579fe1[_0x632b('0x31')],'FaxQueueId':_0x579fe1['id'],'interface':util['format'](_0x632b('0x61'),_0x632b('0x62'),_0x580b12[_0x632b('0x31')]),'penalty':0x0,'paused':_0x580b12['faxPause'],'createdAt':_0x580b12['createdAt'],'updatedAt':_0x580b12['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x632b('0x2e')](respondWithFilteredResult(_0xddc351,_0x389944))[_0x632b('0x4e')](handleError(_0xddc351,null));};exports[_0x632b('0x63')]=function(_0x51f7dd,_0x53b038,_0x515773){var _0x38190c={};var _0x5dc9b2={};var _0x112c26;var _0x244754;return db[_0x632b('0x34')][_0x632b('0x58')]({'where':{'id':_0x51f7dd[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x53b038,null))[_0x632b('0x2e')](function(_0x360796){if(_0x360796){_0x112c26=_0x360796;_0x5dc9b2[_0x632b('0x3d')]=_[_0x632b('0x39')](db['Team']['rawAttributes']);_0x5dc9b2[_0x632b('0x3a')]=_['keys'](_0x51f7dd[_0x632b('0x3a')]);_0x5dc9b2[_0x632b('0x3b')]=_[_0x632b('0x3c')](_0x5dc9b2[_0x632b('0x3d')],_0x5dc9b2['query']);_0x38190c[_0x632b('0x3e')]=_['intersection'](_0x5dc9b2['model'],qs['fields'](_0x51f7dd[_0x632b('0x3a')]['fields']));_0x38190c[_0x632b('0x3e')]=_0x38190c[_0x632b('0x3e')][_0x632b('0x40')]?_0x38190c[_0x632b('0x3e')]:_0x5dc9b2[_0x632b('0x3d')];_0x38190c['order']=qs['sort'](_0x51f7dd[_0x632b('0x3a')][_0x632b('0x42')]);_0x38190c[_0x632b('0x43')]=qs[_0x632b('0x3b')](_[_0x632b('0x44')](_0x51f7dd[_0x632b('0x3a')],_0x5dc9b2[_0x632b('0x3b')]));if(_0x51f7dd['query'][_0x632b('0x45')]){_0x38190c[_0x632b('0x43')]=_['merge'](_0x38190c['where'],{'$or':_[_0x632b('0x38')](_0x38190c['attributes'],function(_0x5d1587){var _0x45306b={};_0x45306b[_0x5d1587]={'$like':'%'+_0x51f7dd['query'][_0x632b('0x45')]+'%'};return _0x45306b;})});}_0x38190c=_['merge']({},_0x38190c,_0x51f7dd[_0x632b('0x48')]);return _0x112c26['getTeams'](_0x38190c);}})[_0x632b('0x2e')](function(_0x3669d9){if(_0x3669d9){_0x244754=_0x3669d9['length'];if(!_0x51f7dd[_0x632b('0x3a')][_0x632b('0x64')](_0x632b('0x5a'))){_0x38190c[_0x632b('0x21')]=qs[_0x632b('0x21')](_0x51f7dd[_0x632b('0x3a')][_0x632b('0x21')]);_0x38190c[_0x632b('0x22')]=qs['offset'](_0x51f7dd['query'][_0x632b('0x22')]);}return _0x112c26[_0x632b('0x63')](_0x38190c);}})[_0x632b('0x2e')](function(_0x4120e5){if(_0x4120e5){return _0x4120e5?{'count':_0x244754,'rows':_0x4120e5}:null;}})[_0x632b('0x2e')](respondWithResult(_0x53b038,null))[_0x632b('0x4e')](handleError(_0x53b038,null));};exports['addTeams']=function(_0x1a7ffb,_0x53fb10,_0x25499b){var _0x54d69c=_0x1a7ffb[_0x632b('0x50')][_0x632b('0x65')];return db[_0x632b('0x66')][_0x632b('0x5b')]({'where':{'id':_0x54d69c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x632b('0x67'),'attributes':['id',_0x632b('0x31'),'online',_0x632b('0x68'),_0x632b('0x69')],'raw':!![]}]})[_0x632b('0x2e')](function(_0x2a8f82){if(_0x2a8f82){var _0x132eac=_['flatMap'](_0x2a8f82,function(_0x32db92){var _0x988036=_0x32db92['get']({'plain':!![]});return _0x988036[_0x632b('0x67')];});return db['FaxQueue'][_0x632b('0x4d')]({'where':{'id':_0x1a7ffb['params']['id']}})[_0x632b('0x2e')](function(_0x4d08ee){return db[_0x632b('0x6a')][_0x632b('0x6b')](function(_0x1f96c0){return _0x4d08ee[_0x632b('0x6c')](_0x54d69c,{'transaction':_0x1f96c0})[_0x632b('0x2e')](function(){return BPromise['each'](_0x132eac,function(_0x1b1547){return db[_0x632b('0x59')]['findOrCreate']({'where':{'UserId':_0x1b1547['id'],'FaxQueueId':_0x1a7ffb[_0x632b('0x4c')]['id']},'transaction':_0x1f96c0});});})['then'](function(){_0x132eac[_0x632b('0x6d')](function(_0x520c87){socket[_0x632b('0x6e')]('userFaxQueue:save',{'UserId':_0x520c87['id'],'FaxQueueId':_0x4d08ee['id']});});});});});}})[_0x632b('0x2e')](respondWithStatusCode(_0x53fb10,null))[_0x632b('0x4e')](handleError(_0x53fb10,null));};exports[_0x632b('0x6f')]=function(_0x4a4c48,_0x2a889e,_0x4524fe){return db[_0x632b('0x66')][_0x632b('0x5b')]({'where':{'id':_0x4a4c48[_0x632b('0x3a')][_0x632b('0x65')]},'attributes':['id'],'include':[{'model':db[_0x632b('0x5c')],'as':_0x632b('0x67'),'attributes':['id'],'raw':!![]}]})[_0x632b('0x2e')](handleEntityNotFound(_0x2a889e,null))[_0x632b('0x2e')](function(_0x124a8a){var _0xf1a293=_[_0x632b('0x38')](_0x124a8a,'id');var _0x55c36d=[];var _0x23385d=[];var _0x376112=squel[_0x632b('0x70')]();_0x376112[_0x632b('0x71')](_0x632b('0x72'))[_0x632b('0x73')](_0x632b('0x74'),'tq')[_0x632b('0x75')](_0x632b('0x76'),'ut',_0x632b('0x77'))[_0x632b('0x43')](_0x632b('0x78'),_0x4a4c48['params']['id']);for(var _0x3fbe9f=0x0;_0x3fbe9f<_0x124a8a[_0x632b('0x40')];_0x3fbe9f+=0x1){let _0x13723c=_0x124a8a[_0x3fbe9f];for(var _0x46620f=0x0;_0x46620f<_0x13723c[_0x632b('0x67')][_0x632b('0x40')];_0x46620f+=0x1){let _0x1e5140=_0x13723c[_0x632b('0x67')][_0x46620f];var _0x583349=_0x376112[_0x632b('0x79')]();_0x583349[_0x632b('0x43')](_0x632b('0x7a'),_0x1e5140['id']);_0x23385d[_0x632b('0x7b')](db[_0x632b('0x6a')][_0x632b('0x3a')](_0x583349[_0x632b('0x7c')](),{'type':db[_0x632b('0x6a')][_0x632b('0x7d')]['SELECT']})[_0x632b('0x2e')](function(_0x130077){if(_0x130077[_0x632b('0x40')]===0x1){return _0x1e5140['id'];}else{var _0x4556eb=_[_0x632b('0x7e')](_[_0x632b('0x38')](_0x130077,'TeamId'),function(_0x371450){return _[_0x632b('0x7f')](_0xf1a293,_0x371450);});if(_0x4556eb){return _0x1e5140['id'];}}}));}}return BPromise[_0x632b('0x80')](_0x23385d)['then'](function(_0x53010c){_0x55c36d=_(_0x55c36d)[_0x632b('0x81')](_0x53010c)[_0x632b('0x82')]()[_0x632b('0x83')]();return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x4a4c48[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](function(_0x47eeac){return db[_0x632b('0x6a')]['transaction'](function(_0x3bd4d1){return _0x47eeac['removeTeams'](_0x4a4c48['query'][_0x632b('0x65')],{'transaction':_0x3bd4d1})[_0x632b('0x2e')](function(){if(!_[_0x632b('0x84')](_0x55c36d)){return _0x47eeac['removeAgents'](_0x55c36d,{'transaction':_0x3bd4d1});}})['then'](function(){_0x55c36d[_0x632b('0x6d')](function(_0x31bd25){socket[_0x632b('0x6e')]('userFaxQueue:remove',{'UserId':_0x31bd25,'FaxQueueId':_0x47eeac['id']});});});});});});})['then'](respondWithStatusCode(_0x2a889e,null))[_0x632b('0x4e')](handleError(_0x2a889e,null));};exports[_0x632b('0x85')]=function(_0x273bbf,_0xe7d9c3,_0x66cbf3){return db[_0x632b('0x34')]['find']({'where':{'id':_0x273bbf[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0xe7d9c3,null))[_0x632b('0x2e')](function(_0x32facd){if(_0x32facd){return _0x32facd[_0x632b('0x85')](_0x273bbf[_0x632b('0x50')]['ids'],_['omit'](_0x273bbf[_0x632b('0x50')],[_0x632b('0x65'),'id'])||{})['spread'](function(_0x366b8f){for(var _0x22ef4a=0x0;_0x22ef4a<_0x273bbf[_0x632b('0x50')][_0x632b('0x65')][_0x632b('0x40')];_0x22ef4a+=0x1){socket[_0x632b('0x6e')](_0x632b('0x86'),{'UserId':_0x273bbf[_0x632b('0x50')]['ids'][_0x22ef4a],'FaxQueueId':_0x273bbf['params']['id']});}return _0x366b8f;});}})[_0x632b('0x2e')](respondWithResult(_0xe7d9c3,null))[_0x632b('0x4e')](handleError(_0xe7d9c3,null));};exports['removeAgents']=function(_0x282cf4,_0x228ed1,_0x78b7e8){return db[_0x632b('0x34')][_0x632b('0x4d')]({'where':{'id':_0x282cf4['params']['id']}})['then'](handleEntityNotFound(_0x228ed1,null))[_0x632b('0x2e')](function(_0x660c00){if(_0x660c00){return _0x660c00[_0x632b('0x87')](_0x282cf4[_0x632b('0x3a')][_0x632b('0x65')])[_0x632b('0x2e')](function(){if(_['isArray'](_0x282cf4[_0x632b('0x3a')]['ids'])){for(var _0x414f18=0x0;_0x414f18<_0x282cf4[_0x632b('0x3a')][_0x632b('0x65')][_0x632b('0x40')];_0x414f18+=0x1){socket[_0x632b('0x6e')](_0x632b('0x88'),{'UserId':Number(_0x282cf4[_0x632b('0x3a')][_0x632b('0x65')][_0x414f18]),'FaxQueueId':Number(_0x282cf4[_0x632b('0x4c')]['id'])});}}else{socket[_0x632b('0x6e')]('userFaxQueue:remove',{'UserId':Number(_0x282cf4[_0x632b('0x3a')][_0x632b('0x65')]),'FaxQueueId':Number(_0x282cf4[_0x632b('0x4c')]['id'])});}});}})[_0x632b('0x2e')](respondWithStatusCode(_0x228ed1,null))['catch'](handleError(_0x228ed1,null));};exports[_0x632b('0x89')]=function(_0x381c35,_0x4a5caf,_0x5114e0){var _0x5e3df2={};var _0x36993d={};var _0x120d18;var _0x38dd38;return db[_0x632b('0x34')]['findOne']({'where':{'id':_0x381c35[_0x632b('0x4c')]['id']}})[_0x632b('0x2e')](handleEntityNotFound(_0x4a5caf,null))[_0x632b('0x2e')](function(_0x5bd1bb){if(_0x5bd1bb){_0x120d18=_0x5bd1bb;_0x36993d[_0x632b('0x3d')]=_['keys'](db['User'][_0x632b('0x35')]);_0x36993d[_0x632b('0x3a')]=_[_0x632b('0x39')](_0x381c35['query']);_0x36993d['filters']=_['intersection'](_0x36993d[_0x632b('0x3d')],_0x36993d[_0x632b('0x3a')]);_0x5e3df2[_0x632b('0x3e')]=_['intersection'](_0x36993d[_0x632b('0x3d')],qs[_0x632b('0x3f')](_0x381c35[_0x632b('0x3a')][_0x632b('0x3f')]));_0x5e3df2[_0x632b('0x3e')]=_0x5e3df2['attributes'][_0x632b('0x40')]?_0x5e3df2['attributes']:_0x36993d['model'];_0x5e3df2[_0x632b('0x41')]=qs[_0x632b('0x42')](_0x381c35['query']['sort']);_0x5e3df2[_0x632b('0x43')]=qs[_0x632b('0x3b')](_[_0x632b('0x44')](_0x381c35['query'],_0x36993d[_0x632b('0x3b')]));if(_0x381c35['query']['filter']){_0x5e3df2[_0x632b('0x43')]=_[_0x632b('0x47')](_0x5e3df2[_0x632b('0x43')],{'$or':_[_0x632b('0x38')](_0x5e3df2['attributes'],function(_0x42fbe6){var _0xef888d={};_0xef888d[_0x42fbe6]={'$like':'%'+_0x381c35[_0x632b('0x3a')][_0x632b('0x45')]+'%'};return _0xef888d;})});}_0x5e3df2=_[_0x632b('0x47')]({},_0x5e3df2,_0x381c35[_0x632b('0x48')]);return _0x120d18['getAgents'](_0x5e3df2);}})[_0x632b('0x2e')](function(_0x508b0f){if(_0x508b0f){_0x38dd38=_0x508b0f[_0x632b('0x40')];if(!_0x381c35['query'][_0x632b('0x64')](_0x632b('0x5a'))){_0x5e3df2[_0x632b('0x21')]=qs[_0x632b('0x21')](_0x381c35[_0x632b('0x3a')][_0x632b('0x21')]);_0x5e3df2[_0x632b('0x22')]=qs[_0x632b('0x22')](_0x381c35[_0x632b('0x3a')][_0x632b('0x22')]);}return _0x120d18[_0x632b('0x89')](_0x5e3df2);}})[_0x632b('0x2e')](function(_0x3784d2){if(_0x3784d2){return _0x3784d2?{'count':_0x38dd38,'rows':_0x3784d2}:null;}})[_0x632b('0x2e')](respondWithResult(_0x4a5caf,null))[_0x632b('0x4e')](handleError(_0x4a5caf,null));};
\ No newline at end of file
+var _0x793b=['offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','UserFaxQueue','FaxQueueId','findAll','User','faxPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','order','getTeams','addTeams','ids','Team','Agents','interface','flatMap','sequelize','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','end','status','json'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x793b,0x189));var _0xb793=function(_0x4c192f,_0x2d3e1b){_0x4c192f=_0x4c192f-0x0;var _0x437587=_0x793b[_0x4c192f];return _0x437587;};'use strict';var emlformat=require(_0xb793('0x0'));var rimraf=require(_0xb793('0x1'));var zipdir=require(_0xb793('0x2'));var jsonpatch=require(_0xb793('0x3'));var rp=require(_0xb793('0x4'));var moment=require('moment');var BPromise=require(_0xb793('0x5'));var Mustache=require(_0xb793('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb793('0x7'));var csv=require(_0xb793('0x8'));var ejs=require(_0xb793('0x9'));var fs=require('fs');var fs_extra=require(_0xb793('0xa'));var _=require(_0xb793('0xb'));var squel=require(_0xb793('0xc'));var crypto=require(_0xb793('0xd'));var jsforce=require(_0xb793('0xe'));var deskjs=require(_0xb793('0xf'));var toCsv=require(_0xb793('0x8'));var querystring=require(_0xb793('0x10'));var Papa=require(_0xb793('0x11'));var Redis=require(_0xb793('0x12'));var authService=require(_0xb793('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb793('0x14'));var hardwareService=require(_0xb793('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xb793('0x16'));var config=require(_0xb793('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb793('0x18'))['db'];config[_0xb793('0x19')]=_['defaults'](config[_0xb793('0x19')],{'host':_0xb793('0x1a'),'port':0x18eb});var socket=require(_0xb793('0x1b'))(new Redis(config[_0xb793('0x19')]));require(_0xb793('0x1c'))[_0xb793('0x1d')](socket);function respondWithStatusCode(_0x19d2cb,_0x48664f){_0x48664f=_0x48664f||0xcc;return function(_0x253eee){if(_0x253eee){return _0x19d2cb['sendStatus'](_0x48664f);}return _0x19d2cb['status'](_0x48664f)[_0xb793('0x1e')]();};}function respondWithResult(_0x18fb18,_0x115165){_0x115165=_0x115165||0xc8;return function(_0x1ff6cb){if(_0x1ff6cb){return _0x18fb18[_0xb793('0x1f')](_0x115165)[_0xb793('0x20')](_0x1ff6cb);}};}function respondWithFilteredResult(_0x18c005,_0x408410){return function(_0x977026){if(_0x977026){var _0x2914a2=typeof _0x408410[_0xb793('0x21')]===_0xb793('0x22')&&typeof _0x408410[_0xb793('0x23')]===_0xb793('0x22');var _0x422fbc=_0x977026[_0xb793('0x24')];var _0x5058ea=_0x2914a2?0x0:_0x408410[_0xb793('0x21')];var _0x1f1374=_0x2914a2?_0x977026['count']:_0x408410[_0xb793('0x21')]+_0x408410[_0xb793('0x23')];var _0x7d91d;if(_0x1f1374>=_0x422fbc){_0x1f1374=_0x422fbc;_0x7d91d=0xc8;}else{_0x7d91d=0xce;}_0x18c005[_0xb793('0x1f')](_0x7d91d);return _0x18c005[_0xb793('0x25')]('Content-Range',_0x5058ea+'-'+_0x1f1374+'/'+_0x422fbc)['json'](_0x977026);}return null;};}function patchUpdates(_0x43855b){return function(_0x36a713){try{jsonpatch[_0xb793('0x26')](_0x36a713,_0x43855b,!![]);}catch(_0x42081a){return BPromise[_0xb793('0x27')](_0x42081a);}return _0x36a713[_0xb793('0x28')]();};}function saveUpdates(_0x4d4544,_0x1e470c){return function(_0x503d69){if(_0x503d69){return _0x503d69[_0xb793('0x29')](_0x4d4544)[_0xb793('0x2a')](function(_0x14ecb0){return _0x14ecb0;});}return null;};}function removeEntity(_0x11290a,_0x76e6f9){return function(_0x164107){if(_0x164107){return _0x164107[_0xb793('0x2b')]()['then'](function(){var _0x1eef51=_0x164107[_0xb793('0x2c')]({'plain':!![]});var _0x411f00=_0xb793('0x2d');return db[_0xb793('0x2e')][_0xb793('0x2b')]({'where':{'type':_0x411f00,'resourceId':_0x1eef51['id']}})['then'](function(){return _0x164107;});})[_0xb793('0x2a')](function(){_0x11290a[_0xb793('0x1f')](0xcc)[_0xb793('0x1e')]();});}};}function handleEntityNotFound(_0x4ec642,_0x89d007){return function(_0x14fc80){if(!_0x14fc80){_0x4ec642[_0xb793('0x2f')](0x194);}return _0x14fc80;};}function handleError(_0x150590,_0x4a8c38){_0x4a8c38=_0x4a8c38||0x1f4;return function(_0x493a8c){logger[_0xb793('0x30')](_0x493a8c['stack']);if(_0x493a8c['name']){delete _0x493a8c[_0xb793('0x31')];}_0x150590[_0xb793('0x1f')](_0x4a8c38)[_0xb793('0x32')](_0x493a8c);};}exports[_0xb793('0x33')]=function(_0x52956a,_0x78afcd){var _0x30bbea={},_0x13ce1f={},_0x31162d={'count':0x0,'rows':[]};var _0x500cf5=_[_0xb793('0x34')](db[_0xb793('0x35')][_0xb793('0x36')],function(_0x2b9959){return{'name':_0x2b9959[_0xb793('0x37')],'type':_0x2b9959[_0xb793('0x38')][_0xb793('0x39')]};});_0x13ce1f[_0xb793('0x3a')]=_['map'](_0x500cf5,'name');_0x13ce1f[_0xb793('0x3b')]=_[_0xb793('0x3c')](_0x52956a[_0xb793('0x3b')]);_0x13ce1f[_0xb793('0x3d')]=_['intersection'](_0x13ce1f[_0xb793('0x3a')],_0x13ce1f[_0xb793('0x3b')]);_0x30bbea[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x13ce1f[_0xb793('0x3a')],qs['fields'](_0x52956a[_0xb793('0x3b')][_0xb793('0x40')]));_0x30bbea[_0xb793('0x3e')]=_0x30bbea[_0xb793('0x3e')][_0xb793('0x41')]?_0x30bbea[_0xb793('0x3e')]:_0x13ce1f[_0xb793('0x3a')];if(!_0x52956a['query'][_0xb793('0x42')](_0xb793('0x43'))){_0x30bbea['limit']=qs[_0xb793('0x23')](_0x52956a[_0xb793('0x3b')]['limit']);_0x30bbea[_0xb793('0x21')]=qs['offset'](_0x52956a[_0xb793('0x3b')][_0xb793('0x21')]);}_0x30bbea['order']=qs[_0xb793('0x44')](_0x52956a[_0xb793('0x3b')]['sort']);_0x30bbea['where']=qs[_0xb793('0x3d')](_[_0xb793('0x45')](_0x52956a[_0xb793('0x3b')],_0x13ce1f[_0xb793('0x3d')]),_0x500cf5);if(_0x52956a[_0xb793('0x3b')][_0xb793('0x46')]){_0x30bbea[_0xb793('0x47')]=_['merge'](_0x30bbea[_0xb793('0x47')],{'$or':_['map'](_0x500cf5,function(_0x231881){if(_0x231881[_0xb793('0x38')]!==_0xb793('0x48')){var _0x389bc3={};_0x389bc3[_0x231881[_0xb793('0x31')]]={'$like':'%'+_0x52956a['query']['filter']+'%'};return _0x389bc3;}})});}_0x30bbea=_[_0xb793('0x49')]({},_0x30bbea,_0x52956a['options']);var _0xcd1bb1={'where':_0x30bbea[_0xb793('0x47')]};return db[_0xb793('0x35')]['count'](_0xcd1bb1)[_0xb793('0x2a')](function(_0x42ae72){_0x31162d['count']=_0x42ae72;if(_0x52956a[_0xb793('0x3b')][_0xb793('0x4a')]){_0x30bbea[_0xb793('0x4b')]=[{'all':!![]}];}return db[_0xb793('0x35')]['findAll'](_0x30bbea);})[_0xb793('0x2a')](function(_0x3b58a0){_0x31162d[_0xb793('0x4c')]=_0x3b58a0;return _0x31162d;})['then'](respondWithFilteredResult(_0x78afcd,_0x30bbea))[_0xb793('0x4d')](handleError(_0x78afcd,null));};exports[_0xb793('0x4e')]=function(_0x38b94a,_0x577ae0){var _0x20c806={'raw':!![],'where':{'id':_0x38b94a['params']['id']}},_0x2b4adb={};_0x2b4adb[_0xb793('0x3a')]=_[_0xb793('0x3c')](db['FaxQueue'][_0xb793('0x36')]);_0x2b4adb['query']=_['keys'](_0x38b94a[_0xb793('0x3b')]);_0x2b4adb['filters']=_[_0xb793('0x3f')](_0x2b4adb[_0xb793('0x3a')],_0x2b4adb[_0xb793('0x3b')]);_0x20c806['attributes']=_[_0xb793('0x3f')](_0x2b4adb[_0xb793('0x3a')],qs[_0xb793('0x40')](_0x38b94a[_0xb793('0x3b')][_0xb793('0x40')]));_0x20c806['attributes']=_0x20c806[_0xb793('0x3e')][_0xb793('0x41')]?_0x20c806[_0xb793('0x3e')]:_0x2b4adb[_0xb793('0x3a')];if(_0x38b94a['query'][_0xb793('0x4a')]){_0x20c806['include']=[{'all':!![]}];}_0x20c806=_['merge']({},_0x20c806,_0x38b94a[_0xb793('0x4f')]);return db[_0xb793('0x35')][_0xb793('0x50')](_0x20c806)[_0xb793('0x2a')](handleEntityNotFound(_0x577ae0,null))[_0xb793('0x2a')](respondWithResult(_0x577ae0,null))[_0xb793('0x4d')](handleError(_0x577ae0,null));};exports[_0xb793('0x51')]=function(_0x583fd8,_0x3addc2){return db[_0xb793('0x35')][_0xb793('0x51')](_0x583fd8[_0xb793('0x52')],{})[_0xb793('0x2a')](function(_0x28f62c){var _0x410bc4=_0x583fd8[_0xb793('0x53')][_0xb793('0x2c')]({'plain':!![]});if(!_0x410bc4)throw new Error(_0xb793('0x54'));if(_0x410bc4['role']==='user'){var _0xd1721c=_0x28f62c[_0xb793('0x2c')]({'plain':!![]});var _0x2b233c=_0xb793('0x2d');return db['UserProfileSection'][_0xb793('0x50')]({'where':{'name':_0x2b233c,'userProfileId':_0x410bc4[_0xb793('0x55')]},'raw':!![]})[_0xb793('0x2a')](function(_0x1ff0b9){if(_0x1ff0b9&&_0x1ff0b9[_0xb793('0x56')]===0x0){return db['UserProfileResource'][_0xb793('0x51')]({'name':_0xd1721c[_0xb793('0x31')],'resourceId':_0xd1721c['id'],'type':_0x1ff0b9['name'],'sectionId':_0x1ff0b9['id']},{})[_0xb793('0x2a')](function(){return _0x28f62c;});}else{return _0x28f62c;}})[_0xb793('0x4d')](function(_0x3335f8){logger[_0xb793('0x30')](_0xb793('0x57'),_0x3335f8);throw _0x3335f8;});}return _0x28f62c;})['then'](respondWithResult(_0x3addc2,0xc9))[_0xb793('0x4d')](handleError(_0x3addc2,null));};exports[_0xb793('0x29')]=function(_0x10c2da,_0x3636de){if(_0x10c2da['body']['id']){delete _0x10c2da[_0xb793('0x52')]['id'];}return db[_0xb793('0x35')]['find']({'where':{'id':_0x10c2da['params']['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0x3636de,null))['then'](saveUpdates(_0x10c2da['body'],null))[_0xb793('0x2a')](respondWithResult(_0x3636de,null))[_0xb793('0x4d')](handleError(_0x3636de,null));};exports[_0xb793('0x2b')]=function(_0x38157a,_0xb84c8a){return db['FaxQueue'][_0xb793('0x50')]({'where':{'id':_0x38157a['params']['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0xb84c8a,null))['then'](removeEntity(_0xb84c8a,null))[_0xb793('0x4d')](handleError(_0xb84c8a,null));};exports[_0xb793('0x58')]=function(_0x3f45c7,_0x322efe){return db[_0xb793('0x35')]['describe']()['then'](respondWithResult(_0x322efe,null))[_0xb793('0x4d')](handleError(_0x322efe,null));};exports[_0xb793('0x59')]=function(_0xe559be,_0xd45962,_0x5da227){var _0x15dae4={'raw':!![],'where':{}},_0x1672e9={},_0x5c9bed;return db['FaxQueue']['findOne']({'where':{'id':_0xe559be[_0xb793('0x5a')]['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0xd45962,null))['then'](function(_0x4bf10c){if(_0x4bf10c){_0x5c9bed=_0x4bf10c[_0xb793('0x2c')]({'plain':!![]});_0x1672e9[_0xb793('0x3a')]=_[_0xb793('0x3c')](db[_0xb793('0x5b')][_0xb793('0x36')]);_0x1672e9['query']=_[_0xb793('0x3c')](_0xe559be[_0xb793('0x3b')]);_0x1672e9[_0xb793('0x3d')]=_[_0xb793('0x3f')](_0x1672e9[_0xb793('0x3a')],_0x1672e9[_0xb793('0x3b')]);_0x15dae4['attributes']=_[_0xb793('0x3f')](_0x1672e9[_0xb793('0x3a')],qs[_0xb793('0x40')](_0xe559be[_0xb793('0x3b')]['fields']));_0x15dae4[_0xb793('0x3e')]=_0x15dae4[_0xb793('0x3e')]['length']?_0x15dae4[_0xb793('0x3e')]:_0x1672e9[_0xb793('0x3a')];if(!_0xe559be[_0xb793('0x3b')]['hasOwnProperty'](_0xb793('0x43'))){_0x15dae4[_0xb793('0x23')]=qs[_0xb793('0x23')](_0xe559be[_0xb793('0x3b')]['limit']);_0x15dae4[_0xb793('0x21')]=qs['offset'](_0xe559be[_0xb793('0x3b')][_0xb793('0x21')]);}_0x15dae4['order']=qs['sort'](_0xe559be[_0xb793('0x3b')][_0xb793('0x44')]);_0x15dae4[_0xb793('0x47')]=qs[_0xb793('0x3d')](_[_0xb793('0x45')](_0xe559be['query'],_0x1672e9[_0xb793('0x3d')]));_0x15dae4['where'][_0xb793('0x5c')]=_0x4bf10c['id'];if(_0xe559be[_0xb793('0x3b')]['filter']){_0x15dae4[_0xb793('0x47')]=_['merge'](_0x15dae4[_0xb793('0x47')],{'$or':_[_0xb793('0x34')](_0x15dae4['attributes'],function(_0xf235d4){var _0x4d5ccc={};_0x4d5ccc[_0xf235d4]={'$like':'%'+_0xe559be[_0xb793('0x3b')][_0xb793('0x46')]+'%'};return _0x4d5ccc;})});}_0x15dae4=_[_0xb793('0x49')]({},_0x15dae4,_0xe559be[_0xb793('0x4f')]);return db[_0xb793('0x5b')][_0xb793('0x5d')](_0x15dae4);}})[_0xb793('0x2a')](function(_0x3d199d){if(_0x3d199d){return db[_0xb793('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x3d199d,'UserId'),'role':'agent'},'attributes':['id','name',_0xb793('0x5f'),_0xb793('0x60'),_0xb793('0x61')]});}})['then'](function(_0x4191ba){if(_0x4191ba){return{'count':_0x4191ba[_0xb793('0x24')],'rows':_[_0xb793('0x34')](_0x4191ba[_0xb793('0x4c')],function(_0x18a6d9){return{'membername':_0x18a6d9[_0xb793('0x31')],'UserId':_0x18a6d9['id'],'queue_name':_0x5c9bed[_0xb793('0x31')],'FaxQueueId':_0x5c9bed['id'],'interface':util[_0xb793('0x62')](_0xb793('0x63'),_0xb793('0x64'),_0x18a6d9[_0xb793('0x31')]),'penalty':0x0,'paused':_0x18a6d9[_0xb793('0x5f')],'createdAt':_0x18a6d9[_0xb793('0x61')],'updatedAt':_0x18a6d9[_0xb793('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb793('0x2a')](respondWithFilteredResult(_0xd45962,_0x15dae4))[_0xb793('0x4d')](handleError(_0xd45962,null));};exports['getTeams']=function(_0x2c8405,_0x3ef054,_0x460efa){var _0x4b06a7={};var _0x22cfaf={};var _0x5c2d51;var _0x4850eb;return db[_0xb793('0x35')][_0xb793('0x65')]({'where':{'id':_0x2c8405[_0xb793('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ef054,null))[_0xb793('0x2a')](function(_0x469113){if(_0x469113){_0x5c2d51=_0x469113;_0x22cfaf[_0xb793('0x3a')]=_['keys'](db['Team'][_0xb793('0x36')]);_0x22cfaf['query']=_[_0xb793('0x3c')](_0x2c8405[_0xb793('0x3b')]);_0x22cfaf['filters']=_[_0xb793('0x3f')](_0x22cfaf[_0xb793('0x3a')],_0x22cfaf[_0xb793('0x3b')]);_0x4b06a7[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x22cfaf[_0xb793('0x3a')],qs[_0xb793('0x40')](_0x2c8405[_0xb793('0x3b')][_0xb793('0x40')]));_0x4b06a7[_0xb793('0x3e')]=_0x4b06a7[_0xb793('0x3e')][_0xb793('0x41')]?_0x4b06a7[_0xb793('0x3e')]:_0x22cfaf['model'];_0x4b06a7[_0xb793('0x66')]=qs['sort'](_0x2c8405['query'][_0xb793('0x44')]);_0x4b06a7[_0xb793('0x47')]=qs[_0xb793('0x3d')](_[_0xb793('0x45')](_0x2c8405['query'],_0x22cfaf[_0xb793('0x3d')]));if(_0x2c8405[_0xb793('0x3b')]['filter']){_0x4b06a7[_0xb793('0x47')]=_[_0xb793('0x49')](_0x4b06a7[_0xb793('0x47')],{'$or':_['map'](_0x4b06a7[_0xb793('0x3e')],function(_0x30138e){var _0x5dd1e2={};_0x5dd1e2[_0x30138e]={'$like':'%'+_0x2c8405[_0xb793('0x3b')][_0xb793('0x46')]+'%'};return _0x5dd1e2;})});}_0x4b06a7=_[_0xb793('0x49')]({},_0x4b06a7,_0x2c8405[_0xb793('0x4f')]);return _0x5c2d51[_0xb793('0x67')](_0x4b06a7);}})['then'](function(_0x327259){if(_0x327259){_0x4850eb=_0x327259[_0xb793('0x41')];if(!_0x2c8405['query'][_0xb793('0x42')](_0xb793('0x43'))){_0x4b06a7['limit']=qs[_0xb793('0x23')](_0x2c8405[_0xb793('0x3b')][_0xb793('0x23')]);_0x4b06a7[_0xb793('0x21')]=qs[_0xb793('0x21')](_0x2c8405[_0xb793('0x3b')][_0xb793('0x21')]);}return _0x5c2d51['getTeams'](_0x4b06a7);}})[_0xb793('0x2a')](function(_0x5f11cf){if(_0x5f11cf){return _0x5f11cf?{'count':_0x4850eb,'rows':_0x5f11cf}:null;}})[_0xb793('0x2a')](respondWithResult(_0x3ef054,null))[_0xb793('0x4d')](handleError(_0x3ef054,null));};exports[_0xb793('0x68')]=function(_0x288255,_0x4bab49,_0x5f45ed){var _0x2f3a7b=_0x288255[_0xb793('0x52')][_0xb793('0x69')];return db[_0xb793('0x6a')][_0xb793('0x5d')]({'where':{'id':_0x2f3a7b},'attributes':['id'],'include':[{'model':db[_0xb793('0x5e')],'as':_0xb793('0x6b'),'attributes':['id','name','online','voicePause',_0xb793('0x6c')],'raw':!![]}]})[_0xb793('0x2a')](function(_0x3e1fe6){if(_0x3e1fe6){var _0x434615=_[_0xb793('0x6d')](_0x3e1fe6,function(_0x39722d){var _0x270b71=_0x39722d['get']({'plain':!![]});return _0x270b71[_0xb793('0x6b')];});return db[_0xb793('0x35')]['find']({'where':{'id':_0x288255['params']['id']}})[_0xb793('0x2a')](function(_0x46ec24){return db[_0xb793('0x6e')]['transaction'](function(_0x2a2483){return _0x46ec24['addTeams'](_0x2f3a7b,{'transaction':_0x2a2483})['then'](function(){return BPromise[_0xb793('0x6f')](_0x434615,function(_0x396d07){return db[_0xb793('0x5b')][_0xb793('0x70')]({'where':{'UserId':_0x396d07['id'],'FaxQueueId':_0x288255[_0xb793('0x5a')]['id']},'transaction':_0x2a2483});});})['then'](function(){_0x434615['forEach'](function(_0x44b5a8){socket[_0xb793('0x71')](_0xb793('0x72'),{'UserId':_0x44b5a8['id'],'FaxQueueId':_0x46ec24['id']});});});});});}})[_0xb793('0x2a')](respondWithStatusCode(_0x4bab49,null))[_0xb793('0x4d')](handleError(_0x4bab49,null));};exports[_0xb793('0x73')]=function(_0x314624,_0x40f8d1,_0x407b41){return db[_0xb793('0x6a')][_0xb793('0x5d')]({'where':{'id':_0x314624[_0xb793('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb793('0x5e')],'as':_0xb793('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xb793('0x2a')](handleEntityNotFound(_0x40f8d1,null))[_0xb793('0x2a')](function(_0x197fc0){var _0x1f94b3=_[_0xb793('0x34')](_0x197fc0,'id');var _0x3a3b41=[];var _0x344eb4=[];var _0x4dad33=squel[_0xb793('0x74')]();_0x4dad33[_0xb793('0x75')]('tq.TeamId')[_0xb793('0x76')](_0xb793('0x77'),'tq')['join'](_0xb793('0x78'),'ut',_0xb793('0x79'))[_0xb793('0x47')]('FaxQueueId\x20=\x20?',_0x314624['params']['id']);for(var _0x5a16aa=0x0;_0x5a16aa<_0x197fc0[_0xb793('0x41')];_0x5a16aa+=0x1){let _0x557602=_0x197fc0[_0x5a16aa];for(var _0x5b49fb=0x0;_0x5b49fb<_0x557602['Agents'][_0xb793('0x41')];_0x5b49fb+=0x1){let _0x14a1d1=_0x557602[_0xb793('0x6b')][_0x5b49fb];var _0x1e6f12=_0x4dad33[_0xb793('0x7a')]();_0x1e6f12[_0xb793('0x47')]('ut.UserId\x20=\x20?',_0x14a1d1['id']);_0x344eb4[_0xb793('0x7b')](db[_0xb793('0x6e')][_0xb793('0x3b')](_0x1e6f12[_0xb793('0x7c')](),{'type':db[_0xb793('0x6e')][_0xb793('0x7d')]['SELECT']})[_0xb793('0x2a')](function(_0x53b97f){if(_0x53b97f['length']===0x1){return _0x14a1d1['id'];}else{var _0x21f231=_[_0xb793('0x7e')](_[_0xb793('0x34')](_0x53b97f,_0xb793('0x7f')),function(_0xa3e597){return _[_0xb793('0x80')](_0x1f94b3,_0xa3e597);});if(_0x21f231){return _0x14a1d1['id'];}}}));}}return BPromise[_0xb793('0x81')](_0x344eb4)['then'](function(_0x34b028){_0x3a3b41=_(_0x3a3b41)[_0xb793('0x82')](_0x34b028)[_0xb793('0x83')]()[_0xb793('0x84')]();return db['FaxQueue'][_0xb793('0x50')]({'where':{'id':_0x314624[_0xb793('0x5a')]['id']}})[_0xb793('0x2a')](function(_0x59bc94){return db[_0xb793('0x6e')][_0xb793('0x85')](function(_0x2c952a){return _0x59bc94['removeTeams'](_0x314624['query'][_0xb793('0x69')],{'transaction':_0x2c952a})[_0xb793('0x2a')](function(){if(!_[_0xb793('0x86')](_0x3a3b41)){return _0x59bc94[_0xb793('0x87')](_0x3a3b41,{'transaction':_0x2c952a});}})[_0xb793('0x2a')](function(){_0x3a3b41[_0xb793('0x88')](function(_0x121fab){socket['emit']('userFaxQueue:remove',{'UserId':_0x121fab,'FaxQueueId':_0x59bc94['id']});});});});});});})[_0xb793('0x2a')](respondWithStatusCode(_0x40f8d1,null))[_0xb793('0x4d')](handleError(_0x40f8d1,null));};exports[_0xb793('0x89')]=function(_0x18a073,_0xde7643,_0x19afbe){return db[_0xb793('0x35')][_0xb793('0x50')]({'where':{'id':_0x18a073['params']['id']}})['then'](handleEntityNotFound(_0xde7643,null))['then'](function(_0x3e9acb){if(_0x3e9acb){return _0x3e9acb[_0xb793('0x89')](_0x18a073[_0xb793('0x52')][_0xb793('0x69')],_['omit'](_0x18a073[_0xb793('0x52')],[_0xb793('0x69'),'id'])||{})[_0xb793('0x8a')](function(_0x5f5441){for(var _0x56a74=0x0;_0x56a74<_0x18a073['body'][_0xb793('0x69')][_0xb793('0x41')];_0x56a74+=0x1){socket['emit'](_0xb793('0x72'),{'UserId':_0x18a073[_0xb793('0x52')][_0xb793('0x69')][_0x56a74],'FaxQueueId':_0x18a073[_0xb793('0x5a')]['id']});}return _0x5f5441;});}})[_0xb793('0x2a')](respondWithResult(_0xde7643,null))[_0xb793('0x4d')](handleError(_0xde7643,null));};exports['removeAgents']=function(_0x240f81,_0x359e20,_0x45ca87){return db[_0xb793('0x35')][_0xb793('0x50')]({'where':{'id':_0x240f81['params']['id']}})[_0xb793('0x2a')](handleEntityNotFound(_0x359e20,null))[_0xb793('0x2a')](function(_0x3546fa){if(_0x3546fa){return _0x3546fa[_0xb793('0x87')](_0x240f81[_0xb793('0x3b')][_0xb793('0x69')])[_0xb793('0x2a')](function(){if(_[_0xb793('0x8b')](_0x240f81[_0xb793('0x3b')]['ids'])){for(var _0x214948=0x0;_0x214948<_0x240f81['query'][_0xb793('0x69')][_0xb793('0x41')];_0x214948+=0x1){socket[_0xb793('0x71')](_0xb793('0x8c'),{'UserId':Number(_0x240f81[_0xb793('0x3b')][_0xb793('0x69')][_0x214948]),'FaxQueueId':Number(_0x240f81[_0xb793('0x5a')]['id'])});}}else{socket[_0xb793('0x71')]('userFaxQueue:remove',{'UserId':Number(_0x240f81[_0xb793('0x3b')][_0xb793('0x69')]),'FaxQueueId':Number(_0x240f81[_0xb793('0x5a')]['id'])});}});}})[_0xb793('0x2a')](respondWithStatusCode(_0x359e20,null))['catch'](handleError(_0x359e20,null));};exports[_0xb793('0x8d')]=function(_0x2bd3a2,_0x49d60b,_0x13ea98){var _0x2f2910={};var _0x495597={};var _0x34a731;var _0x4d8d0f;return db[_0xb793('0x35')][_0xb793('0x65')]({'where':{'id':_0x2bd3a2['params']['id']}})['then'](handleEntityNotFound(_0x49d60b,null))['then'](function(_0x27cb88){if(_0x27cb88){_0x34a731=_0x27cb88;_0x495597[_0xb793('0x3a')]=_['keys'](db[_0xb793('0x5e')][_0xb793('0x36')]);_0x495597['query']=_[_0xb793('0x3c')](_0x2bd3a2[_0xb793('0x3b')]);_0x495597[_0xb793('0x3d')]=_[_0xb793('0x3f')](_0x495597[_0xb793('0x3a')],_0x495597[_0xb793('0x3b')]);_0x2f2910[_0xb793('0x3e')]=_[_0xb793('0x3f')](_0x495597[_0xb793('0x3a')],qs[_0xb793('0x40')](_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x40')]));_0x2f2910[_0xb793('0x3e')]=_0x2f2910['attributes'][_0xb793('0x41')]?_0x2f2910[_0xb793('0x3e')]:_0x495597[_0xb793('0x3a')];_0x2f2910['order']=qs[_0xb793('0x44')](_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x44')]);_0x2f2910[_0xb793('0x47')]=qs['filters'](_['pick'](_0x2bd3a2[_0xb793('0x3b')],_0x495597['filters']));if(_0x2bd3a2[_0xb793('0x3b')]['filter']){_0x2f2910['where']=_['merge'](_0x2f2910['where'],{'$or':_[_0xb793('0x34')](_0x2f2910['attributes'],function(_0x5eb2a5){var _0x3aaaa8={};_0x3aaaa8[_0x5eb2a5]={'$like':'%'+_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x46')]+'%'};return _0x3aaaa8;})});}_0x2f2910=_[_0xb793('0x49')]({},_0x2f2910,_0x2bd3a2[_0xb793('0x4f')]);return _0x34a731[_0xb793('0x8d')](_0x2f2910);}})['then'](function(_0x520d1f){if(_0x520d1f){_0x4d8d0f=_0x520d1f[_0xb793('0x41')];if(!_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x42')](_0xb793('0x43'))){_0x2f2910[_0xb793('0x23')]=qs[_0xb793('0x23')](_0x2bd3a2[_0xb793('0x3b')][_0xb793('0x23')]);_0x2f2910[_0xb793('0x21')]=qs['offset'](_0x2bd3a2[_0xb793('0x3b')]['offset']);}return _0x34a731[_0xb793('0x8d')](_0x2f2910);}})[_0xb793('0x2a')](function(_0x366ee7){if(_0x366ee7){return _0x366ee7?{'count':_0x4d8d0f,'rows':_0x366ee7}:null;}})['then'](respondWithResult(_0x49d60b,null))[_0xb793('0x4d')](handleError(_0x49d60b,null));};
\ No newline at end of file
index e966fb8..0d4f50a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x419e=['hasOwnProperty','hook','exports','events','FaxQueue','setMaxListeners','save','emit'];(function(_0x5e7dd4,_0x563e5b){var _0x4714e3=function(_0x301c85){while(--_0x301c85){_0x5e7dd4['push'](_0x5e7dd4['shift']());}};_0x4714e3(++_0x563e5b);}(_0x419e,0x16b));var _0xe419=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0x419e[_0x1c208e];return _0x5104ff;};'use strict';var EventEmitter=require(_0xe419('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xe419('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe419('0x2')](0x0);var events={'afterCreate':_0xe419('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c6a44){return function(_0x51fd6d,_0x54487a,_0xd33ec7){FaxQueueEvents[_0xe419('0x4')](_0x5c6a44+':'+_0x51fd6d['id'],_0x51fd6d);FaxQueueEvents['emit'](_0x5c6a44,_0x51fd6d);_0xd33ec7(null);};}for(var e in events){if(events[_0xe419('0x5')](e)){var event=events[e];FaxQueue[_0xe419('0x6')](e,emitEvent(event));}}module[_0xe419('0x7')]=FaxQueueEvents;
\ No newline at end of file
+var _0xea95=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xea95,0x149));var _0x5ea9=function(_0x2cf8b2,_0xf59563){_0x2cf8b2=_0x2cf8b2-0x0;var _0x4e20e8=_0xea95[_0x2cf8b2];return _0x4e20e8;};'use strict';var EventEmitter=require(_0x5ea9('0x0'));var FaxQueue=require(_0x5ea9('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5ea9('0x2')](0x0);var events={'afterCreate':_0x5ea9('0x3'),'afterUpdate':_0x5ea9('0x4'),'afterDestroy':_0x5ea9('0x5')};function emitEvent(_0x3d5e22){return function(_0xaddb81,_0x2f21d5,_0x3f761e){FaxQueueEvents['emit'](_0x3d5e22+':'+_0xaddb81['id'],_0xaddb81);FaxQueueEvents[_0x5ea9('0x6')](_0x3d5e22,_0xaddb81);_0x3f761e(null);};}for(var e in events){if(events[_0x5ea9('0x7')](e)){var event=events[e];FaxQueue[_0x5ea9('0x8')](e,emitEvent(event));}}module[_0x5ea9('0x9')]=FaxQueueEvents;
\ No newline at end of file
index b715df7..e608c19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x865f=['bluebird','request-promise','path','rimraf','../../config/environment','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x865f,0x11c));var _0xf865=function(_0x454c15,_0x4ca704){_0x454c15=_0x454c15-0x0;var _0x4be39b=_0x865f[_0x454c15];return _0x4be39b;};'use strict';var _=require(_0xf865('0x0'));var util=require(_0xf865('0x1'));var logger=require(_0xf865('0x2'))('api');var moment=require(_0xf865('0x3'));var BPromise=require(_0xf865('0x4'));var rp=require(_0xf865('0x5'));var fs=require('fs');var path=require(_0xf865('0x6'));var rimraf=require(_0xf865('0x7'));var config=require(_0xf865('0x8'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x291902,_0x591a4a){return _0x291902[_0xf865('0x9')](_0xf865('0xa'),attributes,{'tableName':_0xf865('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9e2=['define','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x461c18,_0x5605b9){var _0x35501c=function(_0x1cd251){while(--_0x1cd251){_0x461c18['push'](_0x461c18['shift']());}};_0x35501c(++_0x5605b9);}(_0xc9e2,0x135));var _0x2c9e=function(_0x42792d,_0x33bea2){_0x42792d=_0x42792d-0x0;var _0x1d294e=_0xc9e2[_0x42792d];return _0x1d294e;};'use strict';var _=require(_0x2c9e('0x0'));var util=require(_0x2c9e('0x1'));var logger=require(_0x2c9e('0x2'))('api');var moment=require(_0x2c9e('0x3'));var BPromise=require(_0x2c9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c9e('0x5'));var rimraf=require(_0x2c9e('0x6'));var config=require(_0x2c9e('0x7'));var attributes=require(_0x2c9e('0x8'));module[_0x2c9e('0x9')]=function(_0xc2cff2,_0x2b91a6){return _0xc2cff2[_0x2c9e('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9448522..8630020 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x046c=['GetFaxQueue','find','then','ShowFaxQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxQueue.socket','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x37fec9,_0x195053){var _0x66ec42=function(_0x382801){while(--_0x382801){_0x37fec9['push'](_0x37fec9['shift']());}};_0x66ec42(++_0x195053);}(_0x046c,0x194));var _0xc046=function(_0x4631eb,_0x55649e){_0x4631eb=_0x4631eb-0x0;var _0x562eca=_0x046c[_0x4631eb];return _0x562eca;};'use strict';var _=require(_0xc046('0x0'));var util=require('util');var moment=require(_0xc046('0x1'));var BPromise=require(_0xc046('0x2'));var rs=require(_0xc046('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc046('0x4'))['db'];var utils=require(_0xc046('0x5'));var logger=require(_0xc046('0x6'))(_0xc046('0x7'));var config=require(_0xc046('0x8'));var jayson=require(_0xc046('0x9'));var client=jayson[_0xc046('0xa')]['http']({'port':0x232a});config[_0xc046('0xb')]=_['defaults'](config[_0xc046('0xb')],{'host':_0xc046('0xc'),'port':0x18eb});var socket=require(_0xc046('0xd'))(new Redis(config[_0xc046('0xb')]));require(_0xc046('0xe'))['register'](socket);function respondWithRpcPromise(_0x59da42,_0x4a8617,_0x475cd0){return new BPromise(function(_0x2cdf68,_0x46e3e8){return client['request'](_0x59da42,_0x475cd0)['then'](function(_0x3a6490){logger[_0xc046('0xf')](_0xc046('0x10'),_0x4a8617,_0xc046('0x11'));logger[_0xc046('0x12')](_0xc046('0x13'),_0x4a8617,'request\x20sent',JSON[_0xc046('0x14')](_0x3a6490));if(_0x3a6490[_0xc046('0x15')]){if(_0x3a6490[_0xc046('0x15')][_0xc046('0x16')]===0x1f4){logger[_0xc046('0x15')](_0xc046('0x10'),_0x4a8617,_0x3a6490[_0xc046('0x15')][_0xc046('0x17')]);return _0x46e3e8(_0x3a6490[_0xc046('0x15')][_0xc046('0x17')]);}logger[_0xc046('0x15')]('FaxQueue,\x20%s,\x20%s',_0x4a8617,_0x3a6490[_0xc046('0x15')][_0xc046('0x17')]);return _0x2cdf68(_0x3a6490['error'][_0xc046('0x17')]);}else{logger['info'](_0xc046('0x10'),_0x4a8617,_0xc046('0x11'));_0x2cdf68(_0x3a6490[_0xc046('0x18')][_0xc046('0x17')]);}})[_0xc046('0x19')](function(_0x3431f2){logger[_0xc046('0x15')](_0xc046('0x10'),_0x4a8617,_0x3431f2);_0x46e3e8(_0x3431f2);});});}exports['GetFaxQueue']=function(_0x299ff6){var _0x29788f=this;return new Promise(function(_0x5bdf19,_0x12d0fb){return db[_0xc046('0x1a')][_0xc046('0x1b')]({'raw':_0x299ff6[_0xc046('0x1c')]?_0x299ff6[_0xc046('0x1c')][_0xc046('0x1d')]===undefined?!![]:![]:!![],'where':_0x299ff6[_0xc046('0x1c')]?_0x299ff6[_0xc046('0x1c')][_0xc046('0x1e')]||null:null,'attributes':_0x299ff6['options']?_0x299ff6[_0xc046('0x1c')][_0xc046('0x1f')]||null:null,'limit':_0x299ff6[_0xc046('0x1c')]?_0x299ff6[_0xc046('0x1c')][_0xc046('0x20')]||null:null,'include':_0x299ff6[_0xc046('0x1c')]?_0x299ff6['options'][_0xc046('0x21')]?_['map'](_0x299ff6['options'][_0xc046('0x21')],function(_0xd4bd60){return{'model':db[_0xd4bd60[_0xc046('0x22')]],'as':_0xd4bd60['as'],'attributes':_0xd4bd60[_0xc046('0x1f')],'include':_0xd4bd60[_0xc046('0x21')]?_[_0xc046('0x23')](_0xd4bd60['include'],function(_0xde1c37){return{'model':db[_0xde1c37['model']],'as':_0xde1c37['as'],'attributes':_0xde1c37[_0xc046('0x1f')],'include':_0xde1c37[_0xc046('0x21')]?_[_0xc046('0x23')](_0xde1c37['include'],function(_0x267a23){return{'model':db[_0x267a23[_0xc046('0x22')]],'as':_0x267a23['as'],'attributes':_0x267a23[_0xc046('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4976ab){logger[_0xc046('0xf')](_0xc046('0x24'),_0x299ff6);logger[_0xc046('0x12')](_0xc046('0x24'),_0x299ff6,JSON[_0xc046('0x14')](_0x4976ab));_0x5bdf19(_0x4976ab);})['catch'](function(_0x56e1e5){logger[_0xc046('0x15')]('GetFaxQueue',_0x56e1e5[_0xc046('0x17')],_0x299ff6);_0x12d0fb(_0x29788f['error'](0x1f4,_0x56e1e5[_0xc046('0x17')]));});});};exports['ShowFaxQueue']=function(_0x4bae97){var _0x357f4e=this;return new Promise(function(_0x5bb39c,_0x249806){return db[_0xc046('0x1a')][_0xc046('0x25')]({'raw':_0x4bae97[_0xc046('0x1c')]?_0x4bae97[_0xc046('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4bae97[_0xc046('0x1c')]?_0x4bae97[_0xc046('0x1c')][_0xc046('0x1e')]||null:null,'attributes':_0x4bae97[_0xc046('0x1c')]?_0x4bae97[_0xc046('0x1c')][_0xc046('0x1f')]||null:null,'include':_0x4bae97[_0xc046('0x1c')]?_0x4bae97[_0xc046('0x1c')][_0xc046('0x21')]?_[_0xc046('0x23')](_0x4bae97[_0xc046('0x1c')]['include'],function(_0x4299a0){return{'model':db[_0x4299a0['model']],'as':_0x4299a0['as'],'attributes':_0x4299a0[_0xc046('0x1f')],'include':_0x4299a0[_0xc046('0x21')]?_[_0xc046('0x23')](_0x4299a0[_0xc046('0x21')],function(_0x330397){return{'model':db[_0x330397['model']],'as':_0x330397['as'],'attributes':_0x330397[_0xc046('0x1f')],'include':_0x330397[_0xc046('0x21')]?_[_0xc046('0x23')](_0x330397[_0xc046('0x21')],function(_0xd4092a){return{'model':db[_0xd4092a['model']],'as':_0xd4092a['as'],'attributes':_0xd4092a[_0xc046('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc046('0x26')](function(_0x510232){logger[_0xc046('0xf')](_0xc046('0x27'),_0x4bae97);logger['debug'](_0xc046('0x27'),_0x4bae97,JSON[_0xc046('0x14')](_0x510232));_0x5bb39c(_0x510232);})[_0xc046('0x19')](function(_0x2f717b){logger[_0xc046('0x15')]('ShowFaxQueue',_0x2f717b[_0xc046('0x17')],_0x4bae97);_0x249806(_0x357f4e[_0xc046('0x15')](0x1f4,_0x2f717b[_0xc046('0x17')]));});});};
\ No newline at end of file
+var _0x616f=['ShowFaxQueue','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','http','redis','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x14b9f8,_0x232201){var _0x39c5ff=function(_0x550d31){while(--_0x550d31){_0x14b9f8['push'](_0x14b9f8['shift']());}};_0x39c5ff(++_0x232201);}(_0x616f,0x160));var _0xf616=function(_0x43e885,_0x5700f1){_0x43e885=_0x43e885-0x0;var _0x18df65=_0x616f[_0x43e885];return _0x18df65;};'use strict';var _=require('lodash');var util=require(_0xf616('0x0'));var moment=require(_0xf616('0x1'));var BPromise=require(_0xf616('0x2'));var rs=require(_0xf616('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf616('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf616('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf616('0x6')]({'port':0x232a});config[_0xf616('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf616('0x7')]));require(_0xf616('0x8'))[_0xf616('0x9')](socket);function respondWithRpcPromise(_0x595c15,_0x4042dd,_0x326cb0){return new BPromise(function(_0x33f77a,_0xbfdc33){return client[_0xf616('0xa')](_0x595c15,_0x326cb0)[_0xf616('0xb')](function(_0x1b56f8){logger[_0xf616('0xc')](_0xf616('0xd'),_0x4042dd,_0xf616('0xe'));logger[_0xf616('0xf')](_0xf616('0x10'),_0x4042dd,_0xf616('0xe'),JSON[_0xf616('0x11')](_0x1b56f8));if(_0x1b56f8[_0xf616('0x12')]){if(_0x1b56f8[_0xf616('0x12')][_0xf616('0x13')]===0x1f4){logger['error'](_0xf616('0xd'),_0x4042dd,_0x1b56f8['error'][_0xf616('0x14')]);return _0xbfdc33(_0x1b56f8['error']['message']);}logger[_0xf616('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4042dd,_0x1b56f8[_0xf616('0x12')][_0xf616('0x14')]);return _0x33f77a(_0x1b56f8['error'][_0xf616('0x14')]);}else{logger[_0xf616('0xc')](_0xf616('0xd'),_0x4042dd,_0xf616('0xe'));_0x33f77a(_0x1b56f8[_0xf616('0x15')][_0xf616('0x14')]);}})[_0xf616('0x16')](function(_0x3a3e59){logger[_0xf616('0x12')]('FaxQueue,\x20%s,\x20%s',_0x4042dd,_0x3a3e59);_0xbfdc33(_0x3a3e59);});});}exports[_0xf616('0x17')]=function(_0x467b6e){var _0x4fe4f2=this;return new Promise(function(_0x3b241e,_0x4316a1){return db[_0xf616('0x18')][_0xf616('0x19')]({'raw':_0x467b6e[_0xf616('0x1a')]?_0x467b6e[_0xf616('0x1a')][_0xf616('0x1b')]===undefined?!![]:![]:!![],'where':_0x467b6e[_0xf616('0x1a')]?_0x467b6e['options']['where']||null:null,'attributes':_0x467b6e[_0xf616('0x1a')]?_0x467b6e['options']['attributes']||null:null,'limit':_0x467b6e[_0xf616('0x1a')]?_0x467b6e[_0xf616('0x1a')][_0xf616('0x1c')]||null:null,'include':_0x467b6e[_0xf616('0x1a')]?_0x467b6e[_0xf616('0x1a')][_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x467b6e[_0xf616('0x1a')][_0xf616('0x1d')],function(_0x2b1135){return{'model':db[_0x2b1135[_0xf616('0x1f')]],'as':_0x2b1135['as'],'attributes':_0x2b1135[_0xf616('0x20')],'include':_0x2b1135[_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x2b1135[_0xf616('0x1d')],function(_0x321d56){return{'model':db[_0x321d56[_0xf616('0x1f')]],'as':_0x321d56['as'],'attributes':_0x321d56[_0xf616('0x20')],'include':_0x321d56[_0xf616('0x1d')]?_['map'](_0x321d56[_0xf616('0x1d')],function(_0x5d234e){return{'model':db[_0x5d234e[_0xf616('0x1f')]],'as':_0x5d234e['as'],'attributes':_0x5d234e[_0xf616('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d24e8){logger['info'](_0xf616('0x17'),_0x467b6e);logger[_0xf616('0xf')]('GetFaxQueue',_0x467b6e,JSON[_0xf616('0x11')](_0x5d24e8));_0x3b241e(_0x5d24e8);})['catch'](function(_0x2b0094){logger['error'](_0xf616('0x17'),_0x2b0094[_0xf616('0x14')],_0x467b6e);_0x4316a1(_0x4fe4f2['error'](0x1f4,_0x2b0094[_0xf616('0x14')]));});});};exports[_0xf616('0x21')]=function(_0x10a10f){var _0x368797=this;return new Promise(function(_0x4ab9fa,_0x402d97){return db['FaxQueue'][_0xf616('0x22')]({'raw':_0x10a10f[_0xf616('0x1a')]?_0x10a10f[_0xf616('0x1a')][_0xf616('0x1b')]===undefined?!![]:![]:!![],'where':_0x10a10f[_0xf616('0x1a')]?_0x10a10f[_0xf616('0x1a')]['where']||null:null,'attributes':_0x10a10f[_0xf616('0x1a')]?_0x10a10f['options'][_0xf616('0x20')]||null:null,'include':_0x10a10f[_0xf616('0x1a')]?_0x10a10f[_0xf616('0x1a')][_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x10a10f[_0xf616('0x1a')][_0xf616('0x1d')],function(_0x2228f6){return{'model':db[_0x2228f6[_0xf616('0x1f')]],'as':_0x2228f6['as'],'attributes':_0x2228f6[_0xf616('0x20')],'include':_0x2228f6[_0xf616('0x1d')]?_['map'](_0x2228f6[_0xf616('0x1d')],function(_0x399c58){return{'model':db[_0x399c58[_0xf616('0x1f')]],'as':_0x399c58['as'],'attributes':_0x399c58[_0xf616('0x20')],'include':_0x399c58[_0xf616('0x1d')]?_[_0xf616('0x1e')](_0x399c58[_0xf616('0x1d')],function(_0x175565){return{'model':db[_0x175565['model']],'as':_0x175565['as'],'attributes':_0x175565[_0xf616('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58cd52){logger[_0xf616('0xc')]('ShowFaxQueue',_0x10a10f);logger[_0xf616('0xf')](_0xf616('0x21'),_0x10a10f,JSON[_0xf616('0x11')](_0x58cd52));_0x4ab9fa(_0x58cd52);})['catch'](function(_0x301a5c){logger['error'](_0xf616('0x21'),_0x301a5c[_0xf616('0x14')],_0x10a10f);_0x402d97(_0x368797['error'](0x1f4,_0x301a5c[_0xf616('0x14')]));});});};
\ No newline at end of file
index a448fd1..13c5fb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e8=['update','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x187672,_0x34cf25){var _0x486935=function(_0x9cf6dc){while(--_0x9cf6dc){_0x187672['push'](_0x187672['shift']());}};_0x486935(++_0x34cf25);}(_0x46e8,0x1c5));var _0x846e=function(_0x3e533a,_0x3d9f19){_0x3e533a=_0x3e533a-0x0;var _0xecb235=_0x46e8[_0x3e533a];return _0xecb235;};'use strict';var FaxQueueEvents=require(_0x846e('0x0'));var events=[_0x846e('0x1'),_0x846e('0x2'),_0x846e('0x3')];function createListener(_0x432c7a,_0x5cda3e){return function(_0x5ebb1e){_0x5cda3e['emit'](_0x432c7a,_0x5ebb1e);};}function removeListener(_0x784091,_0xc97937){return function(){FaxQueueEvents[_0x846e('0x4')](_0x784091,_0xc97937);};}exports[_0x846e('0x5')]=function(_0x4443a2){for(var _0x3144c8=0x0,_0x273985=events[_0x846e('0x6')];_0x3144c8<_0x273985;_0x3144c8++){var _0x497218=events[_0x3144c8];var _0x45aa8c=createListener(_0x846e('0x7')+_0x497218,_0x4443a2);FaxQueueEvents['on'](_0x497218,_0x45aa8c);}};
\ No newline at end of file
+var _0xd83b=['faxQueue:','./faxQueue.events','remove','update','emit','removeListener','length'];(function(_0x5a7123,_0xf3d016){var _0x166efc=function(_0x2c7334){while(--_0x2c7334){_0x5a7123['push'](_0x5a7123['shift']());}};_0x166efc(++_0xf3d016);}(_0xd83b,0x71));var _0xbd83=function(_0x15a5b4,_0x90b469){_0x15a5b4=_0x15a5b4-0x0;var _0x26f037=_0xd83b[_0x15a5b4];return _0x26f037;};'use strict';var FaxQueueEvents=require(_0xbd83('0x0'));var events=['save',_0xbd83('0x1'),_0xbd83('0x2')];function createListener(_0x2fb686,_0x5835f4){return function(_0x346312){_0x5835f4[_0xbd83('0x3')](_0x2fb686,_0x346312);};}function removeListener(_0x42b2c4,_0x3452e8){return function(){FaxQueueEvents[_0xbd83('0x4')](_0x42b2c4,_0x3452e8);};}exports['register']=function(_0x4c257e){for(var _0x5c7e62=0x0,_0x346f7b=events[_0xbd83('0x5')];_0x5c7e62<_0x346f7b;_0x5c7e62++){var _0x318818=events[_0x5c7e62];var _0x5beb21=createListener(_0xbd83('0x6')+_0x318818,_0x4c257e);FaxQueueEvents['on'](_0x318818,_0x5beb21);}};
\ No newline at end of file
index 1904003..906a32a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eba=['/:id/users','addAgents','put','update','delete','removeTeams','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/:id','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x2eba,0xc7));var _0xa2eb=function(_0x49dfa9,_0x536598){_0x49dfa9=_0x49dfa9-0x0;var _0xdd2949=_0x2eba[_0x49dfa9];return _0xdd2949;};'use strict';var multer=require('multer');var util=require(_0xa2eb('0x0'));var path=require(_0xa2eb('0x1'));var timeout=require(_0xa2eb('0x2'));var express=require(_0xa2eb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa2eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa2eb('0x5'));var controller=require(_0xa2eb('0x6'));router[_0xa2eb('0x7')]('/',auth[_0xa2eb('0x8')](),controller['index']);router['get']('/describe',auth[_0xa2eb('0x8')](),controller['describe']);router[_0xa2eb('0x7')](_0xa2eb('0x9'),auth[_0xa2eb('0x8')](),controller['show']);router['get'](_0xa2eb('0xa'),auth[_0xa2eb('0x8')](),controller[_0xa2eb('0xb')]);router['get'](_0xa2eb('0xc'),auth[_0xa2eb('0x8')](),controller['getTeams']);router[_0xa2eb('0x7')]('/:id/users',auth[_0xa2eb('0x8')](),controller[_0xa2eb('0xd')]);router[_0xa2eb('0xe')]('/',auth[_0xa2eb('0x8')](),controller[_0xa2eb('0xf')]);router[_0xa2eb('0xe')]('/:id/teams',auth[_0xa2eb('0x8')](),controller[_0xa2eb('0x10')]);router[_0xa2eb('0xe')](_0xa2eb('0x11'),auth[_0xa2eb('0x8')](),controller[_0xa2eb('0x12')]);router[_0xa2eb('0x13')](_0xa2eb('0x9'),auth[_0xa2eb('0x8')](),controller[_0xa2eb('0x14')]);router[_0xa2eb('0x15')](_0xa2eb('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0xa2eb('0x15')](_0xa2eb('0xc'),auth[_0xa2eb('0x8')](),controller[_0xa2eb('0x16')]);router[_0xa2eb('0x15')](_0xa2eb('0x11'),auth[_0xa2eb('0x8')](),controller['removeAgents']);module[_0xa2eb('0x17')]=router;
\ No newline at end of file
+var _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0xcf98,0x8d));var _0x8cf9=function(_0x500b29,_0x12a64b){_0x500b29=_0x500b29-0x0;var _0x2fde5b=_0xcf98[_0x500b29];return _0x2fde5b;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router;
\ No newline at end of file
index 616cfd3..3161b46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf589=['DATE','moment','sequelize','STRING'];(function(_0x1d6aa6,_0x5b1a01){var _0x11fd54=function(_0x53cf8b){while(--_0x53cf8b){_0x1d6aa6['push'](_0x1d6aa6['shift']());}};_0x11fd54(++_0x5b1a01);}(_0xf589,0xe1));var _0x9f58=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xf589[_0x465028];return _0xb783d4;};'use strict';var moment=require(_0x9f58('0x0'));var Sequelize=require(_0x9f58('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9f58('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9f58('0x2')]},'joinAt':{'type':Sequelize[_0x9f58('0x3')]},'leaveAt':{'type':Sequelize[_0x9f58('0x3')]},'acceptAt':{'type':Sequelize[_0x9f58('0x3')]},'exitAt':{'type':Sequelize[_0x9f58('0x3')]},'reason':{'type':Sequelize[_0x9f58('0x2')]}};
\ No newline at end of file
+var _0x8171=['moment','sequelize','STRING','DATE'];(function(_0x4b0526,_0x46a8b8){var _0x42558b=function(_0x9688e6){while(--_0x9688e6){_0x4b0526['push'](_0x4b0526['shift']());}};_0x42558b(++_0x46a8b8);}(_0x8171,0x188));var _0x1817=function(_0x434466,_0x59544d){_0x434466=_0x434466-0x0;var _0x14ca4d=_0x8171[_0x434466];return _0x14ca4d;};'use strict';var moment=require(_0x1817('0x0'));var Sequelize=require(_0x1817('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x1817('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1817('0x2')]},'joinAt':{'type':Sequelize[_0x1817('0x3')]},'leaveAt':{'type':Sequelize[_0x1817('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1817('0x3')]},'reason':{'type':Sequelize[_0x1817('0x2')]}};
\ No newline at end of file
index dffc4c8..c7cb631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f7d=['type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x14f7fe,_0x5132c4){var _0x3d8309=function(_0x22f5c7){while(--_0x22f5c7){_0x14f7fe['push'](_0x14f7fe['shift']());}};_0x3d8309(++_0x5132c4);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x3decb6,_0x1d1b35){_0x3decb6=_0x3decb6-0x0;var _0x2dc33f=_0x8f7d[_0x3decb6];return _0x2dc33f;};'use strict';var emlformat=require(_0xd8f7('0x0'));var rimraf=require(_0xd8f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8f7('0x3'));var Mustache=require('mustache');var util=require(_0xd8f7('0x4'));var path=require(_0xd8f7('0x5'));var sox=require(_0xd8f7('0x6'));var csv=require(_0xd8f7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8f7('0x8'));var _=require(_0xd8f7('0x9'));var squel=require(_0xd8f7('0xa'));var crypto=require(_0xd8f7('0xb'));var jsforce=require(_0xd8f7('0xc'));var deskjs=require(_0xd8f7('0xd'));var toCsv=require(_0xd8f7('0x7'));var querystring=require(_0xd8f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8f7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd8f7('0x10'));var as=require(_0xd8f7('0x11'));var hardwareService=require(_0xd8f7('0x12'));var logger=require(_0xd8f7('0x13'))(_0xd8f7('0x14'));var utils=require(_0xd8f7('0x15'));var config=require(_0xd8f7('0x16'));var licenseUtil=require(_0xd8f7('0x17'));var db=require(_0xd8f7('0x18'))['db'];function respondWithStatusCode(_0x41ebd3,_0x29467b){_0x29467b=_0x29467b||0xcc;return function(_0x21ee60){if(_0x21ee60){return _0x41ebd3[_0xd8f7('0x19')](_0x29467b);}return _0x41ebd3[_0xd8f7('0x1a')](_0x29467b)[_0xd8f7('0x1b')]();};}function respondWithResult(_0x4406c7,_0x4b4114){_0x4b4114=_0x4b4114||0xc8;return function(_0x5c1177){if(_0x5c1177){return _0x4406c7['status'](_0x4b4114)[_0xd8f7('0x1c')](_0x5c1177);}};}function respondWithFilteredResult(_0x2b58c1,_0x341152){return function(_0x109488){if(_0x109488){var _0x299208=typeof _0x341152[_0xd8f7('0x1d')]===_0xd8f7('0x1e')&&typeof _0x341152[_0xd8f7('0x1f')]==='undefined';var _0x478e46=_0x109488['count'];var _0x202298=_0x299208?0x0:_0x341152[_0xd8f7('0x1d')];var _0x5d31c5=_0x299208?_0x109488[_0xd8f7('0x20')]:_0x341152[_0xd8f7('0x1d')]+_0x341152[_0xd8f7('0x1f')];var _0x48a97b;if(_0x5d31c5>=_0x478e46){_0x5d31c5=_0x478e46;_0x48a97b=0xc8;}else{_0x48a97b=0xce;}_0x2b58c1[_0xd8f7('0x1a')](_0x48a97b);return _0x2b58c1['set'](_0xd8f7('0x21'),_0x202298+'-'+_0x5d31c5+'/'+_0x478e46)[_0xd8f7('0x1c')](_0x109488);}return null;};}function patchUpdates(_0x4e0ec4){return function(_0xcbc2a5){try{jsonpatch[_0xd8f7('0x22')](_0xcbc2a5,_0x4e0ec4,!![]);}catch(_0x57bf17){return BPromise[_0xd8f7('0x23')](_0x57bf17);}return _0xcbc2a5[_0xd8f7('0x24')]();};}function saveUpdates(_0x54bc78,_0x2fc6cb){return function(_0x58469a){if(_0x58469a){return _0x58469a['update'](_0x54bc78)[_0xd8f7('0x25')](function(_0x4e1e10){return _0x4e1e10;});}return null;};}function removeEntity(_0x148d6f,_0x1bbe84){return function(_0x4d84bb){if(_0x4d84bb){return _0x4d84bb[_0xd8f7('0x26')]()[_0xd8f7('0x25')](function(){_0x148d6f[_0xd8f7('0x1a')](0xcc)[_0xd8f7('0x1b')]();});}};}function handleEntityNotFound(_0x8874d4,_0x380247){return function(_0x3ca18a){if(!_0x3ca18a){_0x8874d4[_0xd8f7('0x19')](0x194);}return _0x3ca18a;};}function handleError(_0x424b91,_0x8a8403){_0x8a8403=_0x8a8403||0x1f4;return function(_0x4ba0f){logger[_0xd8f7('0x27')](_0x4ba0f[_0xd8f7('0x28')]);if(_0x4ba0f['name']){delete _0x4ba0f['name'];}_0x424b91[_0xd8f7('0x1a')](_0x8a8403)[_0xd8f7('0x29')](_0x4ba0f);};}exports[_0xd8f7('0x2a')]=function(_0x20ef3a,_0x35ef58){var _0x101935={},_0x5d54b9={},_0x480635={'count':0x0,'rows':[]};var _0x12bf13=_[_0xd8f7('0x2b')](db[_0xd8f7('0x2c')][_0xd8f7('0x2d')],function(_0x3e2f76){return{'name':_0x3e2f76[_0xd8f7('0x2e')],'type':_0x3e2f76['type']['key']};});_0x5d54b9[_0xd8f7('0x2f')]=_['map'](_0x12bf13,_0xd8f7('0x30'));_0x5d54b9['query']=_[_0xd8f7('0x31')](_0x20ef3a[_0xd8f7('0x32')]);_0x5d54b9[_0xd8f7('0x33')]=_[_0xd8f7('0x34')](_0x5d54b9[_0xd8f7('0x2f')],_0x5d54b9[_0xd8f7('0x32')]);_0x101935['attributes']=_['intersection'](_0x5d54b9[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x20ef3a['query'][_0xd8f7('0x35')]));_0x101935[_0xd8f7('0x36')]=_0x101935[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x101935[_0xd8f7('0x36')]:_0x5d54b9[_0xd8f7('0x2f')];if(!_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x38')](_0xd8f7('0x39'))){_0x101935[_0xd8f7('0x1f')]=qs[_0xd8f7('0x1f')](_0x20ef3a['query']['limit']);_0x101935[_0xd8f7('0x1d')]=qs['offset'](_0x20ef3a['query'][_0xd8f7('0x1d')]);}_0x101935[_0xd8f7('0x3a')]=qs[_0xd8f7('0x3b')](_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3b')]);_0x101935[_0xd8f7('0x3c')]=qs['filters'](_['pick'](_0x20ef3a[_0xd8f7('0x32')],_0x5d54b9['filters']),_0x12bf13);if(_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]){_0x101935[_0xd8f7('0x3c')]=_[_0xd8f7('0x3e')](_0x101935[_0xd8f7('0x3c')],{'$or':_[_0xd8f7('0x2b')](_0x12bf13,function(_0x40a26c){if(_0x40a26c[_0xd8f7('0x3f')]!==_0xd8f7('0x40')){var _0x41c08c={};_0x41c08c[_0x40a26c[_0xd8f7('0x30')]]={'$like':'%'+_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]+'%'};return _0x41c08c;}})});}_0x101935=_['merge']({},_0x101935,_0x20ef3a[_0xd8f7('0x41')]);var _0x143e1a={'where':_0x101935[_0xd8f7('0x3c')]};return db[_0xd8f7('0x2c')][_0xd8f7('0x20')](_0x143e1a)[_0xd8f7('0x25')](function(_0x153ff0){_0x480635[_0xd8f7('0x20')]=_0x153ff0;if(_0x20ef3a['query'][_0xd8f7('0x42')]){_0x101935[_0xd8f7('0x43')]=[{'all':!![]}];}return db[_0xd8f7('0x2c')][_0xd8f7('0x44')](_0x101935);})[_0xd8f7('0x25')](function(_0x254c15){_0x480635['rows']=_0x254c15;return _0x480635;})[_0xd8f7('0x25')](respondWithFilteredResult(_0x35ef58,_0x101935))[_0xd8f7('0x45')](handleError(_0x35ef58,null));};exports[_0xd8f7('0x46')]=function(_0x51d5a2,_0x265429){var _0x244d12={'raw':!![],'where':{'id':_0x51d5a2[_0xd8f7('0x47')]['id']}},_0x5cadee={};_0x5cadee[_0xd8f7('0x2f')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x5cadee[_0xd8f7('0x32')]=_[_0xd8f7('0x31')](_0x51d5a2[_0xd8f7('0x32')]);_0x5cadee[_0xd8f7('0x33')]=_['intersection'](_0x5cadee[_0xd8f7('0x2f')],_0x5cadee[_0xd8f7('0x32')]);_0x244d12[_0xd8f7('0x36')]=_[_0xd8f7('0x34')](_0x5cadee[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x35')]));_0x244d12[_0xd8f7('0x36')]=_0x244d12[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x244d12[_0xd8f7('0x36')]:_0x5cadee[_0xd8f7('0x2f')];if(_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x42')]){_0x244d12[_0xd8f7('0x43')]=[{'all':!![]}];}_0x244d12=_['merge']({},_0x244d12,_0x51d5a2['options']);return db[_0xd8f7('0x2c')][_0xd8f7('0x48')](_0x244d12)[_0xd8f7('0x25')](handleEntityNotFound(_0x265429,null))['then'](respondWithResult(_0x265429,null))[_0xd8f7('0x45')](handleError(_0x265429,null));};exports[_0xd8f7('0x49')]=function(_0x20832d,_0x1e8343){return db['FaxQueueReport'][_0xd8f7('0x49')](_0x20832d[_0xd8f7('0x4a')],{})[_0xd8f7('0x25')](respondWithResult(_0x1e8343,0xc9))[_0xd8f7('0x45')](handleError(_0x1e8343,null));};exports[_0xd8f7('0x4b')]=function(_0x3a317c,_0x522fb2){if(_0x3a317c[_0xd8f7('0x4a')]['id']){delete _0x3a317c[_0xd8f7('0x4a')]['id'];}return db[_0xd8f7('0x2c')][_0xd8f7('0x48')]({'where':{'id':_0x3a317c[_0xd8f7('0x47')]['id']}})[_0xd8f7('0x25')](handleEntityNotFound(_0x522fb2,null))[_0xd8f7('0x25')](saveUpdates(_0x3a317c['body'],null))[_0xd8f7('0x25')](respondWithResult(_0x522fb2,null))['catch'](handleError(_0x522fb2,null));};exports[_0xd8f7('0x26')]=function(_0x2a797d,_0x19ccef){return db['FaxQueueReport']['find']({'where':{'id':_0x2a797d['params']['id']}})['then'](handleEntityNotFound(_0x19ccef,null))['then'](removeEntity(_0x19ccef,null))['catch'](handleError(_0x19ccef,null));};exports[_0xd8f7('0x4c')]=function(_0x14a307,_0x2bca2b){return db[_0xd8f7('0x2c')][_0xd8f7('0x4c')]()[_0xd8f7('0x25')](respondWithResult(_0x2bca2b,null))[_0xd8f7('0x45')](handleError(_0x2bca2b,null));};
\ No newline at end of file
+var _0x851e=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','error','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','include','findAll','catch','show','params','rawAttributes','keys','includeAll','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x851e,0x1e8));var _0xe851=function(_0x1c16ee,_0xefb5ba){_0x1c16ee=_0x1c16ee-0x0;var _0x1a8f88=_0x851e[_0x1c16ee];return _0x1a8f88;};'use strict';var emlformat=require(_0xe851('0x0'));var rimraf=require(_0xe851('0x1'));var zipdir=require(_0xe851('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe851('0x3'));var BPromise=require(_0xe851('0x4'));var Mustache=require(_0xe851('0x5'));var util=require(_0xe851('0x6'));var path=require(_0xe851('0x7'));var sox=require('sox');var csv=require(_0xe851('0x8'));var ejs=require(_0xe851('0x9'));var fs=require('fs');var fs_extra=require(_0xe851('0xa'));var _=require(_0xe851('0xb'));var squel=require(_0xe851('0xc'));var crypto=require('crypto');var jsforce=require(_0xe851('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe851('0xe'));var Papa=require(_0xe851('0xf'));var Redis=require(_0xe851('0x10'));var authService=require(_0xe851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe851('0x12'));var hardwareService=require(_0xe851('0x13'));var logger=require(_0xe851('0x14'))('api');var utils=require(_0xe851('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe851('0x16'));var db=require(_0xe851('0x17'))['db'];function respondWithStatusCode(_0x5bb014,_0x2b76af){_0x2b76af=_0x2b76af||0xcc;return function(_0x4fff7e){if(_0x4fff7e){return _0x5bb014[_0xe851('0x18')](_0x2b76af);}return _0x5bb014['status'](_0x2b76af)[_0xe851('0x19')]();};}function respondWithResult(_0x32b54e,_0x5960f2){_0x5960f2=_0x5960f2||0xc8;return function(_0x391632){if(_0x391632){return _0x32b54e[_0xe851('0x1a')](_0x5960f2)[_0xe851('0x1b')](_0x391632);}};}function respondWithFilteredResult(_0x4e5195,_0x4d902d){return function(_0x11ba80){if(_0x11ba80){var _0x2f073c=typeof _0x4d902d[_0xe851('0x1c')]===_0xe851('0x1d')&&typeof _0x4d902d[_0xe851('0x1e')]===_0xe851('0x1d');var _0x53c7e0=_0x11ba80[_0xe851('0x1f')];var _0x48a1b3=_0x2f073c?0x0:_0x4d902d[_0xe851('0x1c')];var _0x55dd83=_0x2f073c?_0x11ba80[_0xe851('0x1f')]:_0x4d902d['offset']+_0x4d902d[_0xe851('0x1e')];var _0x2d8015;if(_0x55dd83>=_0x53c7e0){_0x55dd83=_0x53c7e0;_0x2d8015=0xc8;}else{_0x2d8015=0xce;}_0x4e5195[_0xe851('0x1a')](_0x2d8015);return _0x4e5195[_0xe851('0x20')](_0xe851('0x21'),_0x48a1b3+'-'+_0x55dd83+'/'+_0x53c7e0)[_0xe851('0x1b')](_0x11ba80);}return null;};}function patchUpdates(_0x37ab53){return function(_0x409796){try{jsonpatch['apply'](_0x409796,_0x37ab53,!![]);}catch(_0x238a5c){return BPromise['reject'](_0x238a5c);}return _0x409796[_0xe851('0x22')]();};}function saveUpdates(_0x545b9d,_0x3eb7f9){return function(_0x453392){if(_0x453392){return _0x453392['update'](_0x545b9d)['then'](function(_0x1d5aa2){return _0x1d5aa2;});}return null;};}function removeEntity(_0x44ccb3,_0x3bb018){return function(_0x181b19){if(_0x181b19){return _0x181b19[_0xe851('0x23')]()[_0xe851('0x24')](function(){_0x44ccb3['status'](0xcc)[_0xe851('0x19')]();});}};}function handleEntityNotFound(_0x2d508,_0x5bff24){return function(_0x4e9e11){if(!_0x4e9e11){_0x2d508[_0xe851('0x18')](0x194);}return _0x4e9e11;};}function handleError(_0x579efe,_0x1c1db4){_0x1c1db4=_0x1c1db4||0x1f4;return function(_0x328255){logger[_0xe851('0x25')](_0x328255[_0xe851('0x26')]);if(_0x328255[_0xe851('0x27')]){delete _0x328255[_0xe851('0x27')];}_0x579efe[_0xe851('0x1a')](_0x1c1db4)[_0xe851('0x28')](_0x328255);};}exports[_0xe851('0x29')]=function(_0x25f50a,_0x595de7){var _0x570b86={},_0x5d2a79={},_0x7754da={'count':0x0,'rows':[]};var _0x3a8631=_[_0xe851('0x2a')](db[_0xe851('0x2b')]['rawAttributes'],function(_0x4d9d17){return{'name':_0x4d9d17[_0xe851('0x2c')],'type':_0x4d9d17[_0xe851('0x2d')][_0xe851('0x2e')]};});_0x5d2a79[_0xe851('0x2f')]=_[_0xe851('0x2a')](_0x3a8631,_0xe851('0x27'));_0x5d2a79[_0xe851('0x30')]=_['keys'](_0x25f50a['query']);_0x5d2a79[_0xe851('0x31')]=_[_0xe851('0x32')](_0x5d2a79[_0xe851('0x2f')],_0x5d2a79[_0xe851('0x30')]);_0x570b86[_0xe851('0x33')]=_[_0xe851('0x32')](_0x5d2a79[_0xe851('0x2f')],qs[_0xe851('0x34')](_0x25f50a[_0xe851('0x30')][_0xe851('0x34')]));_0x570b86['attributes']=_0x570b86[_0xe851('0x33')][_0xe851('0x35')]?_0x570b86[_0xe851('0x33')]:_0x5d2a79['model'];if(!_0x25f50a[_0xe851('0x30')][_0xe851('0x36')]('nolimit')){_0x570b86[_0xe851('0x1e')]=qs[_0xe851('0x1e')](_0x25f50a[_0xe851('0x30')]['limit']);_0x570b86[_0xe851('0x1c')]=qs[_0xe851('0x1c')](_0x25f50a[_0xe851('0x30')][_0xe851('0x1c')]);}_0x570b86['order']=qs[_0xe851('0x37')](_0x25f50a[_0xe851('0x30')][_0xe851('0x37')]);_0x570b86['where']=qs[_0xe851('0x31')](_['pick'](_0x25f50a[_0xe851('0x30')],_0x5d2a79[_0xe851('0x31')]),_0x3a8631);if(_0x25f50a[_0xe851('0x30')][_0xe851('0x38')]){_0x570b86[_0xe851('0x39')]=_[_0xe851('0x3a')](_0x570b86[_0xe851('0x39')],{'$or':_[_0xe851('0x2a')](_0x3a8631,function(_0x29e339){if(_0x29e339[_0xe851('0x2d')]!=='VIRTUAL'){var _0x3daf20={};_0x3daf20[_0x29e339['name']]={'$like':'%'+_0x25f50a[_0xe851('0x30')][_0xe851('0x38')]+'%'};return _0x3daf20;}})});}_0x570b86=_[_0xe851('0x3a')]({},_0x570b86,_0x25f50a[_0xe851('0x3b')]);var _0x58e484={'where':_0x570b86[_0xe851('0x39')]};return db[_0xe851('0x2b')][_0xe851('0x1f')](_0x58e484)[_0xe851('0x24')](function(_0x423c60){_0x7754da[_0xe851('0x1f')]=_0x423c60;if(_0x25f50a[_0xe851('0x30')]['includeAll']){_0x570b86[_0xe851('0x3c')]=[{'all':!![]}];}return db[_0xe851('0x2b')][_0xe851('0x3d')](_0x570b86);})[_0xe851('0x24')](function(_0x4890b9){_0x7754da['rows']=_0x4890b9;return _0x7754da;})[_0xe851('0x24')](respondWithFilteredResult(_0x595de7,_0x570b86))[_0xe851('0x3e')](handleError(_0x595de7,null));};exports[_0xe851('0x3f')]=function(_0x38da1a,_0x3ad6bd){var _0x119115={'raw':!![],'where':{'id':_0x38da1a[_0xe851('0x40')]['id']}},_0x355f76={};_0x355f76['model']=_['keys'](db[_0xe851('0x2b')][_0xe851('0x41')]);_0x355f76[_0xe851('0x30')]=_[_0xe851('0x42')](_0x38da1a['query']);_0x355f76[_0xe851('0x31')]=_[_0xe851('0x32')](_0x355f76[_0xe851('0x2f')],_0x355f76['query']);_0x119115[_0xe851('0x33')]=_[_0xe851('0x32')](_0x355f76[_0xe851('0x2f')],qs[_0xe851('0x34')](_0x38da1a[_0xe851('0x30')][_0xe851('0x34')]));_0x119115[_0xe851('0x33')]=_0x119115['attributes']['length']?_0x119115['attributes']:_0x355f76['model'];if(_0x38da1a[_0xe851('0x30')][_0xe851('0x43')]){_0x119115[_0xe851('0x3c')]=[{'all':!![]}];}_0x119115=_[_0xe851('0x3a')]({},_0x119115,_0x38da1a[_0xe851('0x3b')]);return db[_0xe851('0x2b')][_0xe851('0x44')](_0x119115)['then'](handleEntityNotFound(_0x3ad6bd,null))[_0xe851('0x24')](respondWithResult(_0x3ad6bd,null))[_0xe851('0x3e')](handleError(_0x3ad6bd,null));};exports[_0xe851('0x45')]=function(_0x47ce4b,_0x600ef8){return db[_0xe851('0x2b')][_0xe851('0x45')](_0x47ce4b[_0xe851('0x46')],{})[_0xe851('0x24')](respondWithResult(_0x600ef8,0xc9))[_0xe851('0x3e')](handleError(_0x600ef8,null));};exports[_0xe851('0x47')]=function(_0x4662da,_0x1fb5ed){if(_0x4662da[_0xe851('0x46')]['id']){delete _0x4662da[_0xe851('0x46')]['id'];}return db[_0xe851('0x2b')]['find']({'where':{'id':_0x4662da[_0xe851('0x40')]['id']}})['then'](handleEntityNotFound(_0x1fb5ed,null))[_0xe851('0x24')](saveUpdates(_0x4662da[_0xe851('0x46')],null))[_0xe851('0x24')](respondWithResult(_0x1fb5ed,null))[_0xe851('0x3e')](handleError(_0x1fb5ed,null));};exports[_0xe851('0x23')]=function(_0x5458f6,_0x1a2adb){return db[_0xe851('0x2b')]['find']({'where':{'id':_0x5458f6['params']['id']}})['then'](handleEntityNotFound(_0x1a2adb,null))[_0xe851('0x24')](removeEntity(_0x1a2adb,null))[_0xe851('0x3e')](handleError(_0x1a2adb,null));};exports[_0xe851('0x48')]=function(_0x2e5117,_0x403c95){return db[_0xe851('0x2b')][_0xe851('0x48')]()[_0xe851('0x24')](respondWithResult(_0x403c95,null))[_0xe851('0x3e')](handleError(_0x403c95,null));};
\ No newline at end of file
index 3b4d608..de2f26d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4fe330,_0xa0460f){var _0x2126fd=function(_0x4cd750){while(--_0x4cd750){_0x4fe330['push'](_0x4fe330['shift']());}};_0x2126fd(++_0xa0460f);}(_0x53ec,0x192));var _0xc53e=function(_0x1ef2e3,_0x380ec2){_0x1ef2e3=_0x1ef2e3-0x0;var _0x173e11=_0x53ec[_0x1ef2e3];return _0x173e11;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x240095,_0x3077fb){var _0x5b3fca=function(_0x2f41e4){while(--_0x2f41e4){_0x240095['push'](_0x240095['shift']());}};_0x5b3fca(++_0x3077fb);}(_0x7a54,0x106));var _0x47a5=function(_0x24725f,_0x16c840){_0x24725f=_0x24725f-0x0;var _0x528713=_0x7a54[_0x24725f];return _0x528713;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index fa40a25..6f2c37e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4a6=['client','http','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueueReport,\x20%s,\x20%s','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','update','body','attributes','limit','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x395a03,_0x362943){var _0x8de6f=function(_0x56ae29){while(--_0x56ae29){_0x395a03['push'](_0x395a03['shift']());}};_0x8de6f(++_0x362943);}(_0xe4a6,0x69));var _0x6e4a=function(_0x58f401,_0x1136c9){_0x58f401=_0x58f401-0x0;var _0x146e3d=_0xe4a6[_0x58f401];return _0x146e3d;};'use strict';var _=require('lodash');var util=require(_0x6e4a('0x0'));var moment=require(_0x6e4a('0x1'));var BPromise=require(_0x6e4a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e4a('0x3'))['db'];var utils=require(_0x6e4a('0x4'));var logger=require(_0x6e4a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6e4a('0x6'));var client=jayson[_0x6e4a('0x7')][_0x6e4a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x448ea8,_0x2d59c7,_0x8ff85c){return new BPromise(function(_0x4ad1a4,_0x1f64e2){return client['request'](_0x448ea8,_0x8ff85c)[_0x6e4a('0x9')](function(_0x412cd0){logger[_0x6e4a('0xa')]('FaxQueueReport,\x20%s,\x20%s',_0x2d59c7,_0x6e4a('0xb'));logger[_0x6e4a('0xc')](_0x6e4a('0xd'),_0x2d59c7,_0x6e4a('0xb'),JSON[_0x6e4a('0xe')](_0x412cd0));if(_0x412cd0['error']){if(_0x412cd0[_0x6e4a('0xf')]['code']===0x1f4){logger[_0x6e4a('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2d59c7,_0x412cd0[_0x6e4a('0xf')][_0x6e4a('0x10')]);return _0x1f64e2(_0x412cd0[_0x6e4a('0xf')][_0x6e4a('0x10')]);}logger['error'](_0x6e4a('0x11'),_0x2d59c7,_0x412cd0[_0x6e4a('0xf')][_0x6e4a('0x10')]);return _0x4ad1a4(_0x412cd0[_0x6e4a('0xf')]['message']);}else{logger['info'](_0x6e4a('0x11'),_0x2d59c7,_0x6e4a('0xb'));_0x4ad1a4(_0x412cd0['result'][_0x6e4a('0x10')]);}})[_0x6e4a('0x12')](function(_0x5c0202){logger[_0x6e4a('0xf')](_0x6e4a('0x11'),_0x2d59c7,_0x5c0202);_0x1f64e2(_0x5c0202);});});}exports[_0x6e4a('0x13')]=function(_0x34a8f9){var _0x57b604=this;return new Promise(function(_0x3f57b6,_0x4f59c1){return db[_0x6e4a('0x14')]['create'](_0x34a8f9['body'],{'raw':_0x34a8f9[_0x6e4a('0x15')]?_0x34a8f9[_0x6e4a('0x15')][_0x6e4a('0x16')]===undefined?!![]:![]:!![]})[_0x6e4a('0x9')](function(_0x54cf2b){logger[_0x6e4a('0xa')](_0x6e4a('0x13'),_0x34a8f9);logger[_0x6e4a('0xc')](_0x6e4a('0x13'),_0x34a8f9,JSON['stringify'](_0x54cf2b));_0x3f57b6(_0x54cf2b);})[_0x6e4a('0x12')](function(_0x1b68a9){logger[_0x6e4a('0xf')](_0x6e4a('0x13'),_0x1b68a9[_0x6e4a('0x10')],_0x34a8f9);_0x4f59c1(_0x57b604[_0x6e4a('0xf')](0x1f4,_0x1b68a9[_0x6e4a('0x10')]));});});};exports[_0x6e4a('0x17')]=function(_0x19ff25){var _0x431d67=this;return new Promise(function(_0x1c3dbd,_0xcbc1e1){return db[_0x6e4a('0x14')][_0x6e4a('0x18')](_0x19ff25[_0x6e4a('0x19')],{'raw':_0x19ff25[_0x6e4a('0x15')]?_0x19ff25['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19ff25[_0x6e4a('0x15')]?_0x19ff25['options']['where']||null:null,'attributes':_0x19ff25[_0x6e4a('0x15')]?_0x19ff25[_0x6e4a('0x15')][_0x6e4a('0x1a')]||null:null,'limit':_0x19ff25[_0x6e4a('0x15')]?_0x19ff25[_0x6e4a('0x15')][_0x6e4a('0x1b')]||null:null})['then'](function(_0x32fd29){logger[_0x6e4a('0xa')](_0x6e4a('0x17'),_0x19ff25);logger[_0x6e4a('0xc')](_0x6e4a('0x17'),_0x19ff25,JSON[_0x6e4a('0xe')](_0x32fd29));_0x1c3dbd(_0x32fd29);})['catch'](function(_0x54d117){logger[_0x6e4a('0xf')](_0x6e4a('0x17'),_0x54d117[_0x6e4a('0x10')],_0x19ff25);_0xcbc1e1(_0x431d67[_0x6e4a('0xf')](0x1f4,_0x54d117['message']));});});};
\ No newline at end of file
+var _0x2b66=['raw','CreateFaxQueueReport','debug','stringify','UpdateFaxQueueReport','update','where','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','error','code','message','FaxQueueReport,\x20%s,\x20%s','catch','FaxQueueReport','create','body','options'];(function(_0x24c963,_0x5f32a4){var _0x32a0eb=function(_0x3fd2eb){while(--_0x3fd2eb){_0x24c963['push'](_0x24c963['shift']());}};_0x32a0eb(++_0x5f32a4);}(_0x2b66,0xef));var _0x62b6=function(_0x2ca885,_0x2e5949){_0x2ca885=_0x2ca885-0x0;var _0x37834c=_0x2b66[_0x2ca885];return _0x37834c;};'use strict';var _=require(_0x62b6('0x0'));var util=require('util');var moment=require(_0x62b6('0x1'));var BPromise=require(_0x62b6('0x2'));var rs=require(_0x62b6('0x3'));var fs=require('fs');var Redis=require(_0x62b6('0x4'));var db=require(_0x62b6('0x5'))['db'];var utils=require(_0x62b6('0x6'));var logger=require(_0x62b6('0x7'))(_0x62b6('0x8'));var config=require(_0x62b6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x62b6('0xa')][_0x62b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x208403,_0xf07a62,_0x40d027){return new BPromise(function(_0x4f1e7f,_0x145799){return client[_0x62b6('0xc')](_0x208403,_0x40d027)[_0x62b6('0xd')](function(_0x2c66db){logger[_0x62b6('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0xf07a62,_0x62b6('0xf'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xf07a62,_0x62b6('0xf'),JSON['stringify'](_0x2c66db));if(_0x2c66db[_0x62b6('0x10')]){if(_0x2c66db[_0x62b6('0x10')][_0x62b6('0x11')]===0x1f4){logger[_0x62b6('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0xf07a62,_0x2c66db[_0x62b6('0x10')][_0x62b6('0x12')]);return _0x145799(_0x2c66db[_0x62b6('0x10')]['message']);}logger[_0x62b6('0x10')](_0x62b6('0x13'),_0xf07a62,_0x2c66db[_0x62b6('0x10')][_0x62b6('0x12')]);return _0x4f1e7f(_0x2c66db[_0x62b6('0x10')][_0x62b6('0x12')]);}else{logger[_0x62b6('0xe')](_0x62b6('0x13'),_0xf07a62,'request\x20sent');_0x4f1e7f(_0x2c66db['result']['message']);}})[_0x62b6('0x14')](function(_0x425d51){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xf07a62,_0x425d51);_0x145799(_0x425d51);});});}exports['CreateFaxQueueReport']=function(_0x3f03ec){var _0x39593c=this;return new Promise(function(_0x3de2a1,_0x116e3f){return db[_0x62b6('0x15')][_0x62b6('0x16')](_0x3f03ec[_0x62b6('0x17')],{'raw':_0x3f03ec[_0x62b6('0x18')]?_0x3f03ec['options'][_0x62b6('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2388df){logger[_0x62b6('0xe')](_0x62b6('0x1a'),_0x3f03ec);logger[_0x62b6('0x1b')]('CreateFaxQueueReport',_0x3f03ec,JSON[_0x62b6('0x1c')](_0x2388df));_0x3de2a1(_0x2388df);})[_0x62b6('0x14')](function(_0xc1692f){logger[_0x62b6('0x10')](_0x62b6('0x1a'),_0xc1692f[_0x62b6('0x12')],_0x3f03ec);_0x116e3f(_0x39593c['error'](0x1f4,_0xc1692f['message']));});});};exports[_0x62b6('0x1d')]=function(_0x48c1d8){var _0x5dec41=this;return new Promise(function(_0x53a93a,_0x4a9eea){return db[_0x62b6('0x15')][_0x62b6('0x1e')](_0x48c1d8[_0x62b6('0x17')],{'raw':_0x48c1d8[_0x62b6('0x18')]?_0x48c1d8['options'][_0x62b6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48c1d8[_0x62b6('0x18')]?_0x48c1d8['options'][_0x62b6('0x1f')]||null:null,'attributes':_0x48c1d8['options']?_0x48c1d8[_0x62b6('0x18')]['attributes']||null:null,'limit':_0x48c1d8[_0x62b6('0x18')]?_0x48c1d8['options'][_0x62b6('0x20')]||null:null})[_0x62b6('0xd')](function(_0x4dc055){logger[_0x62b6('0xe')]('UpdateFaxQueueReport',_0x48c1d8);logger[_0x62b6('0x1b')](_0x62b6('0x1d'),_0x48c1d8,JSON[_0x62b6('0x1c')](_0x4dc055));_0x53a93a(_0x4dc055);})[_0x62b6('0x14')](function(_0x3d6ba3){logger['error'](_0x62b6('0x1d'),_0x3d6ba3[_0x62b6('0x12')],_0x48c1d8);_0x4a9eea(_0x5dec41['error'](0x1f4,_0x3d6ba3['message']));});});};
\ No newline at end of file
index ccd30f0..eb54fe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1d9=['update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','isAuthenticated','describe','show','post','put','/:id'];(function(_0x3c816e,_0x3c270d){var _0x400222=function(_0x25d07e){while(--_0x25d07e){_0x3c816e['push'](_0x3c816e['shift']());}};_0x400222(++_0x3c270d);}(_0xc1d9,0x11a));var _0x9c1d=function(_0x1cd5ba,_0x3ab045){_0x1cd5ba=_0x1cd5ba-0x0;var _0x25617b=_0xc1d9[_0x1cd5ba];return _0x25617b;};'use strict';var multer=require(_0x9c1d('0x0'));var util=require('util');var path=require(_0x9c1d('0x1'));var timeout=require(_0x9c1d('0x2'));var express=require(_0x9c1d('0x3'));var router=express[_0x9c1d('0x4')]();var fs_extra=require(_0x9c1d('0x5'));var auth=require(_0x9c1d('0x6'));var interaction=require(_0x9c1d('0x7'));var config=require(_0x9c1d('0x8'));var controller=require(_0x9c1d('0x9'));router[_0x9c1d('0xa')]('/',auth['isAuthenticated'](),controller[_0x9c1d('0xb')]);router[_0x9c1d('0xa')]('/describe',auth[_0x9c1d('0xc')](),controller[_0x9c1d('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9c1d('0xe')]);router[_0x9c1d('0xf')]('/',auth[_0x9c1d('0xc')](),controller['create']);router[_0x9c1d('0x10')](_0x9c1d('0x11'),auth[_0x9c1d('0xc')](),controller[_0x9c1d('0x12')]);router[_0x9c1d('0x13')](_0x9c1d('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x671a=['post','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x475649,_0x5d6e75){var _0x3ccb2c=function(_0x140e13){while(--_0x140e13){_0x475649['push'](_0x475649['shift']());}};_0x3ccb2c(++_0x5d6e75);}(_0x671a,0xe9));var _0xa671=function(_0x20d435,_0x1c5415){_0x20d435=_0x20d435-0x0;var _0x54288d=_0x671a[_0x20d435];return _0x54288d;};'use strict';var multer=require(_0xa671('0x0'));var util=require(_0xa671('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa671('0x2'));var router=express[_0xa671('0x3')]();var fs_extra=require(_0xa671('0x4'));var auth=require(_0xa671('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa671('0x6'));var controller=require(_0xa671('0x7'));router['get']('/',auth[_0xa671('0x8')](),controller[_0xa671('0x9')]);router[_0xa671('0xa')](_0xa671('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa671('0xa')](_0xa671('0xc'),auth[_0xa671('0x8')](),controller[_0xa671('0xd')]);router[_0xa671('0xe')]('/',auth[_0xa671('0x8')](),controller['create']);router[_0xa671('0xf')](_0xa671('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa671('0x10')](_0xa671('0xc'),auth[_0xa671('0x8')](),controller[_0xa671('0x11')]);module[_0xa671('0x12')]=router;
\ No newline at end of file
index b61b1e1..67a9b96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x12e431,_0x3e69ff){var _0x410b36=function(_0x590a2f){while(--_0x590a2f){_0x12e431['push'](_0x12e431['shift']());}};_0x410b36(++_0x3e69ff);}(_0xf4eb,0xec));var _0xbf4e=function(_0x307b17,_0x1b588a){_0x307b17=_0x307b17-0x0;var _0x48fa07=_0xf4eb[_0x307b17];return _0x48fa07;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xd73239,_0x488346){var _0x41cee6=function(_0x4a8bb3){while(--_0x4a8bb3){_0xd73239['push'](_0xd73239['shift']());}};_0x41cee6(++_0x488346);}(_0x008c,0x188));var _0xc008=function(_0x4f1e23,_0x166b91){_0x4f1e23=_0x4f1e23-0x0;var _0x4354b1=_0x008c[_0x4f1e23];return _0x4354b1;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
index 124abdd..14fa2ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23d9=['Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','FaxTransferReport','includeAll','findAll','rows','show','params','length','include','catch','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0x530158,_0x5af00c){var _0x8fa6b0=function(_0x6e2cbf){while(--_0x6e2cbf){_0x530158['push'](_0x530158['shift']());}};_0x8fa6b0(++_0x5af00c);}(_0x23d9,0x7b));var _0x923d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x923d('0x0'));var rimraf=require(_0x923d('0x1'));var zipdir=require(_0x923d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x923d('0x3'));var moment=require(_0x923d('0x4'));var BPromise=require(_0x923d('0x5'));var Mustache=require(_0x923d('0x6'));var util=require(_0x923d('0x7'));var path=require(_0x923d('0x8'));var sox=require(_0x923d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x923d('0xa'));var _=require(_0x923d('0xb'));var squel=require(_0x923d('0xc'));var crypto=require(_0x923d('0xd'));var jsforce=require(_0x923d('0xe'));var deskjs=require(_0x923d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x923d('0x10'));var Papa=require(_0x923d('0x11'));var Redis=require(_0x923d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x923d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x923d('0x14'));var logger=require(_0x923d('0x15'))(_0x923d('0x16'));var utils=require(_0x923d('0x17'));var config=require(_0x923d('0x18'));var licenseUtil=require(_0x923d('0x19'));var db=require(_0x923d('0x1a'))['db'];function respondWithStatusCode(_0x2f3e84,_0x3b3942){_0x3b3942=_0x3b3942||0xcc;return function(_0x489776){if(_0x489776){return _0x2f3e84[_0x923d('0x1b')](_0x3b3942);}return _0x2f3e84['status'](_0x3b3942)[_0x923d('0x1c')]();};}function respondWithResult(_0x1b2aac,_0x243f7f){_0x243f7f=_0x243f7f||0xc8;return function(_0x45e6a1){if(_0x45e6a1){return _0x1b2aac['status'](_0x243f7f)[_0x923d('0x1d')](_0x45e6a1);}};}function respondWithFilteredResult(_0x17a5b5,_0x1df138){return function(_0x3cee9a){if(_0x3cee9a){var _0x12b11f=typeof _0x1df138[_0x923d('0x1e')]===_0x923d('0x1f')&&typeof _0x1df138[_0x923d('0x20')]==='undefined';var _0x4f407e=_0x3cee9a[_0x923d('0x21')];var _0x48e467=_0x12b11f?0x0:_0x1df138['offset'];var _0x31ac36=_0x12b11f?_0x3cee9a['count']:_0x1df138['offset']+_0x1df138[_0x923d('0x20')];var _0x4d0234;if(_0x31ac36>=_0x4f407e){_0x31ac36=_0x4f407e;_0x4d0234=0xc8;}else{_0x4d0234=0xce;}_0x17a5b5[_0x923d('0x22')](_0x4d0234);return _0x17a5b5['set'](_0x923d('0x23'),_0x48e467+'-'+_0x31ac36+'/'+_0x4f407e)[_0x923d('0x1d')](_0x3cee9a);}return null;};}function patchUpdates(_0x594f08){return function(_0x2ffff0){try{jsonpatch[_0x923d('0x24')](_0x2ffff0,_0x594f08,!![]);}catch(_0x57227c){return BPromise[_0x923d('0x25')](_0x57227c);}return _0x2ffff0[_0x923d('0x26')]();};}function saveUpdates(_0x784648,_0x30c289){return function(_0x17ab51){if(_0x17ab51){return _0x17ab51[_0x923d('0x27')](_0x784648)[_0x923d('0x28')](function(_0x51a346){return _0x51a346;});}return null;};}function removeEntity(_0x56f9ac,_0x5b6112){return function(_0x1b362d){if(_0x1b362d){return _0x1b362d['destroy']()[_0x923d('0x28')](function(){_0x56f9ac[_0x923d('0x22')](0xcc)[_0x923d('0x1c')]();});}};}function handleEntityNotFound(_0x2e8ce7,_0x2f666a){return function(_0x3705b1){if(!_0x3705b1){_0x2e8ce7[_0x923d('0x1b')](0x194);}return _0x3705b1;};}function handleError(_0x40f7c6,_0x50318b){_0x50318b=_0x50318b||0x1f4;return function(_0x2afbf1){logger[_0x923d('0x29')](_0x2afbf1[_0x923d('0x2a')]);if(_0x2afbf1[_0x923d('0x2b')]){delete _0x2afbf1[_0x923d('0x2b')];}_0x40f7c6['status'](_0x50318b)[_0x923d('0x2c')](_0x2afbf1);};}exports[_0x923d('0x2d')]=function(_0x3bdefa,_0x1f55a7){var _0x55d7f2={},_0x427ce4={},_0xd2fba6={'count':0x0,'rows':[]};var _0xb2bfc1=_[_0x923d('0x2e')](db['FaxTransferReport'][_0x923d('0x2f')],function(_0x2aa9c6){return{'name':_0x2aa9c6[_0x923d('0x30')],'type':_0x2aa9c6['type'][_0x923d('0x31')]};});_0x427ce4[_0x923d('0x32')]=_['map'](_0xb2bfc1,_0x923d('0x2b'));_0x427ce4['query']=_[_0x923d('0x33')](_0x3bdefa[_0x923d('0x34')]);_0x427ce4['filters']=_[_0x923d('0x35')](_0x427ce4[_0x923d('0x32')],_0x427ce4[_0x923d('0x34')]);_0x55d7f2[_0x923d('0x36')]=_[_0x923d('0x35')](_0x427ce4[_0x923d('0x32')],qs['fields'](_0x3bdefa[_0x923d('0x34')]['fields']));_0x55d7f2[_0x923d('0x36')]=_0x55d7f2[_0x923d('0x36')]['length']?_0x55d7f2['attributes']:_0x427ce4[_0x923d('0x32')];if(!_0x3bdefa[_0x923d('0x34')]['hasOwnProperty']('nolimit')){_0x55d7f2['limit']=qs[_0x923d('0x20')](_0x3bdefa[_0x923d('0x34')][_0x923d('0x20')]);_0x55d7f2[_0x923d('0x1e')]=qs[_0x923d('0x1e')](_0x3bdefa[_0x923d('0x34')]['offset']);}_0x55d7f2[_0x923d('0x37')]=qs[_0x923d('0x38')](_0x3bdefa[_0x923d('0x34')][_0x923d('0x38')]);_0x55d7f2[_0x923d('0x39')]=qs[_0x923d('0x3a')](_[_0x923d('0x3b')](_0x3bdefa['query'],_0x427ce4[_0x923d('0x3a')]),_0xb2bfc1);if(_0x3bdefa[_0x923d('0x34')]['filter']){_0x55d7f2[_0x923d('0x39')]=_[_0x923d('0x3c')](_0x55d7f2[_0x923d('0x39')],{'$or':_[_0x923d('0x2e')](_0xb2bfc1,function(_0xb4aeca){if(_0xb4aeca[_0x923d('0x3d')]!==_0x923d('0x3e')){var _0x5f00bb={};_0x5f00bb[_0xb4aeca[_0x923d('0x2b')]]={'$like':'%'+_0x3bdefa[_0x923d('0x34')][_0x923d('0x3f')]+'%'};return _0x5f00bb;}})});}_0x55d7f2=_[_0x923d('0x3c')]({},_0x55d7f2,_0x3bdefa[_0x923d('0x40')]);var _0x5275ce={'where':_0x55d7f2['where']};return db[_0x923d('0x41')]['count'](_0x5275ce)[_0x923d('0x28')](function(_0x10720c){_0xd2fba6[_0x923d('0x21')]=_0x10720c;if(_0x3bdefa[_0x923d('0x34')][_0x923d('0x42')]){_0x55d7f2['include']=[{'all':!![]}];}return db[_0x923d('0x41')][_0x923d('0x43')](_0x55d7f2);})[_0x923d('0x28')](function(_0x578651){_0xd2fba6[_0x923d('0x44')]=_0x578651;return _0xd2fba6;})[_0x923d('0x28')](respondWithFilteredResult(_0x1f55a7,_0x55d7f2))['catch'](handleError(_0x1f55a7,null));};exports[_0x923d('0x45')]=function(_0x14ae8f,_0x5f2506){var _0x3ddeaa={'raw':!![],'where':{'id':_0x14ae8f[_0x923d('0x46')]['id']}},_0x5787b4={};_0x5787b4[_0x923d('0x32')]=_['keys'](db[_0x923d('0x41')][_0x923d('0x2f')]);_0x5787b4['query']=_[_0x923d('0x33')](_0x14ae8f[_0x923d('0x34')]);_0x5787b4[_0x923d('0x3a')]=_[_0x923d('0x35')](_0x5787b4[_0x923d('0x32')],_0x5787b4[_0x923d('0x34')]);_0x3ddeaa[_0x923d('0x36')]=_[_0x923d('0x35')](_0x5787b4['model'],qs['fields'](_0x14ae8f[_0x923d('0x34')]['fields']));_0x3ddeaa['attributes']=_0x3ddeaa[_0x923d('0x36')][_0x923d('0x47')]?_0x3ddeaa[_0x923d('0x36')]:_0x5787b4[_0x923d('0x32')];if(_0x14ae8f[_0x923d('0x34')][_0x923d('0x42')]){_0x3ddeaa[_0x923d('0x48')]=[{'all':!![]}];}_0x3ddeaa=_[_0x923d('0x3c')]({},_0x3ddeaa,_0x14ae8f[_0x923d('0x40')]);return db[_0x923d('0x41')]['find'](_0x3ddeaa)['then'](handleEntityNotFound(_0x5f2506,null))[_0x923d('0x28')](respondWithResult(_0x5f2506,null))[_0x923d('0x49')](handleError(_0x5f2506,null));};exports[_0x923d('0x4a')]=function(_0x5a763f,_0x402c7e){return db[_0x923d('0x41')][_0x923d('0x4a')](_0x5a763f['body'],{})[_0x923d('0x28')](respondWithResult(_0x402c7e,0xc9))[_0x923d('0x49')](handleError(_0x402c7e,null));};exports[_0x923d('0x27')]=function(_0x101ded,_0x501c3a){if(_0x101ded[_0x923d('0x4b')]['id']){delete _0x101ded[_0x923d('0x4b')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x101ded[_0x923d('0x46')]['id']}})[_0x923d('0x28')](handleEntityNotFound(_0x501c3a,null))['then'](saveUpdates(_0x101ded[_0x923d('0x4b')],null))['then'](respondWithResult(_0x501c3a,null))[_0x923d('0x49')](handleError(_0x501c3a,null));};exports[_0x923d('0x4c')]=function(_0x154bc3,_0x1254a7){return db['FaxTransferReport'][_0x923d('0x4d')]({'where':{'id':_0x154bc3[_0x923d('0x46')]['id']}})[_0x923d('0x28')](handleEntityNotFound(_0x1254a7,null))[_0x923d('0x28')](removeEntity(_0x1254a7,null))[_0x923d('0x49')](handleError(_0x1254a7,null));};exports[_0x923d('0x4e')]=function(_0x152811,_0x3240a2){return db[_0x923d('0x41')]['describe']()[_0x923d('0x28')](respondWithResult(_0x3240a2,null))[_0x923d('0x49')](handleError(_0x3240a2,null));};
\ No newline at end of file
+var _0x9b09=['rows','catch','show','params','merge','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','options','includeAll','include','findAll'];(function(_0x4e1857,_0x2a6ccc){var _0x2ddd26=function(_0x35495f){while(--_0x35495f){_0x4e1857['push'](_0x4e1857['shift']());}};_0x2ddd26(++_0x2a6ccc);}(_0x9b09,0xf3));var _0x99b0=function(_0x384231,_0x50be41){_0x384231=_0x384231-0x0;var _0x2480bf=_0x9b09[_0x384231];return _0x2480bf;};'use strict';var emlformat=require(_0x99b0('0x0'));var rimraf=require(_0x99b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99b0('0x2'));var rp=require(_0x99b0('0x3'));var moment=require(_0x99b0('0x4'));var BPromise=require(_0x99b0('0x5'));var Mustache=require(_0x99b0('0x6'));var util=require(_0x99b0('0x7'));var path=require(_0x99b0('0x8'));var sox=require(_0x99b0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99b0('0xa'));var _=require(_0x99b0('0xb'));var squel=require(_0x99b0('0xc'));var crypto=require(_0x99b0('0xd'));var jsforce=require(_0x99b0('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x99b0('0xf'));var Papa=require(_0x99b0('0x10'));var Redis=require(_0x99b0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x99b0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x99b0('0x13'));var logger=require(_0x99b0('0x14'))(_0x99b0('0x15'));var utils=require(_0x99b0('0x16'));var config=require(_0x99b0('0x17'));var licenseUtil=require(_0x99b0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x293141,_0x11e3cf){_0x11e3cf=_0x11e3cf||0xcc;return function(_0x103eb6){if(_0x103eb6){return _0x293141[_0x99b0('0x19')](_0x11e3cf);}return _0x293141[_0x99b0('0x1a')](_0x11e3cf)[_0x99b0('0x1b')]();};}function respondWithResult(_0x3c1ffe,_0x226a65){_0x226a65=_0x226a65||0xc8;return function(_0xcf3c17){if(_0xcf3c17){return _0x3c1ffe[_0x99b0('0x1a')](_0x226a65)[_0x99b0('0x1c')](_0xcf3c17);}};}function respondWithFilteredResult(_0x3678a5,_0x20920c){return function(_0x262aa5){if(_0x262aa5){var _0x2e52eb=typeof _0x20920c[_0x99b0('0x1d')]===_0x99b0('0x1e')&&typeof _0x20920c['limit']===_0x99b0('0x1e');var _0x533350=_0x262aa5['count'];var _0x19ad7a=_0x2e52eb?0x0:_0x20920c['offset'];var _0x4b5065=_0x2e52eb?_0x262aa5[_0x99b0('0x1f')]:_0x20920c[_0x99b0('0x1d')]+_0x20920c[_0x99b0('0x20')];var _0x270979;if(_0x4b5065>=_0x533350){_0x4b5065=_0x533350;_0x270979=0xc8;}else{_0x270979=0xce;}_0x3678a5[_0x99b0('0x1a')](_0x270979);return _0x3678a5['set'](_0x99b0('0x21'),_0x19ad7a+'-'+_0x4b5065+'/'+_0x533350)[_0x99b0('0x1c')](_0x262aa5);}return null;};}function patchUpdates(_0x45e729){return function(_0x292e6d){try{jsonpatch[_0x99b0('0x22')](_0x292e6d,_0x45e729,!![]);}catch(_0x53234b){return BPromise[_0x99b0('0x23')](_0x53234b);}return _0x292e6d[_0x99b0('0x24')]();};}function saveUpdates(_0x1bd72c,_0x4836ef){return function(_0x59a3ae){if(_0x59a3ae){return _0x59a3ae['update'](_0x1bd72c)['then'](function(_0x3ee296){return _0x3ee296;});}return null;};}function removeEntity(_0x41e5ca,_0x200e6b){return function(_0x4483fc){if(_0x4483fc){return _0x4483fc[_0x99b0('0x25')]()[_0x99b0('0x26')](function(){_0x41e5ca[_0x99b0('0x1a')](0xcc)[_0x99b0('0x1b')]();});}};}function handleEntityNotFound(_0x12ed8b,_0x1c7f51){return function(_0x33bd8e){if(!_0x33bd8e){_0x12ed8b[_0x99b0('0x19')](0x194);}return _0x33bd8e;};}function handleError(_0x1ec726,_0x4fc216){_0x4fc216=_0x4fc216||0x1f4;return function(_0x1b39e4){logger[_0x99b0('0x27')](_0x1b39e4[_0x99b0('0x28')]);if(_0x1b39e4[_0x99b0('0x29')]){delete _0x1b39e4['name'];}_0x1ec726[_0x99b0('0x1a')](_0x4fc216)[_0x99b0('0x2a')](_0x1b39e4);};}exports[_0x99b0('0x2b')]=function(_0x579c48,_0x276b9b){var _0xe5d21b={},_0x5944fa={},_0x5432e2={'count':0x0,'rows':[]};var _0x586813=_['map'](db[_0x99b0('0x2c')][_0x99b0('0x2d')],function(_0x184a90){return{'name':_0x184a90[_0x99b0('0x2e')],'type':_0x184a90['type'][_0x99b0('0x2f')]};});_0x5944fa['model']=_['map'](_0x586813,_0x99b0('0x29'));_0x5944fa['query']=_[_0x99b0('0x30')](_0x579c48[_0x99b0('0x31')]);_0x5944fa[_0x99b0('0x32')]=_[_0x99b0('0x33')](_0x5944fa[_0x99b0('0x34')],_0x5944fa[_0x99b0('0x31')]);_0xe5d21b[_0x99b0('0x35')]=_['intersection'](_0x5944fa[_0x99b0('0x34')],qs[_0x99b0('0x36')](_0x579c48['query']['fields']));_0xe5d21b[_0x99b0('0x35')]=_0xe5d21b[_0x99b0('0x35')][_0x99b0('0x37')]?_0xe5d21b['attributes']:_0x5944fa['model'];if(!_0x579c48['query'][_0x99b0('0x38')](_0x99b0('0x39'))){_0xe5d21b[_0x99b0('0x20')]=qs['limit'](_0x579c48['query'][_0x99b0('0x20')]);_0xe5d21b['offset']=qs[_0x99b0('0x1d')](_0x579c48[_0x99b0('0x31')]['offset']);}_0xe5d21b[_0x99b0('0x3a')]=qs[_0x99b0('0x3b')](_0x579c48[_0x99b0('0x31')]['sort']);_0xe5d21b[_0x99b0('0x3c')]=qs['filters'](_[_0x99b0('0x3d')](_0x579c48[_0x99b0('0x31')],_0x5944fa[_0x99b0('0x32')]),_0x586813);if(_0x579c48[_0x99b0('0x31')][_0x99b0('0x3e')]){_0xe5d21b[_0x99b0('0x3c')]=_['merge'](_0xe5d21b[_0x99b0('0x3c')],{'$or':_[_0x99b0('0x3f')](_0x586813,function(_0x20cddb){if(_0x20cddb[_0x99b0('0x40')]!=='VIRTUAL'){var _0x59e341={};_0x59e341[_0x20cddb[_0x99b0('0x29')]]={'$like':'%'+_0x579c48[_0x99b0('0x31')][_0x99b0('0x3e')]+'%'};return _0x59e341;}})});}_0xe5d21b=_['merge']({},_0xe5d21b,_0x579c48[_0x99b0('0x41')]);var _0x12361c={'where':_0xe5d21b[_0x99b0('0x3c')]};return db[_0x99b0('0x2c')][_0x99b0('0x1f')](_0x12361c)['then'](function(_0x33f6c1){_0x5432e2[_0x99b0('0x1f')]=_0x33f6c1;if(_0x579c48[_0x99b0('0x31')][_0x99b0('0x42')]){_0xe5d21b[_0x99b0('0x43')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x99b0('0x44')](_0xe5d21b);})[_0x99b0('0x26')](function(_0x1b94a3){_0x5432e2[_0x99b0('0x45')]=_0x1b94a3;return _0x5432e2;})[_0x99b0('0x26')](respondWithFilteredResult(_0x276b9b,_0xe5d21b))[_0x99b0('0x46')](handleError(_0x276b9b,null));};exports[_0x99b0('0x47')]=function(_0x2e5225,_0x32655b){var _0x3c77a5={'raw':!![],'where':{'id':_0x2e5225[_0x99b0('0x48')]['id']}},_0xb9a9b9={};_0xb9a9b9['model']=_[_0x99b0('0x30')](db[_0x99b0('0x2c')][_0x99b0('0x2d')]);_0xb9a9b9[_0x99b0('0x31')]=_[_0x99b0('0x30')](_0x2e5225['query']);_0xb9a9b9[_0x99b0('0x32')]=_['intersection'](_0xb9a9b9[_0x99b0('0x34')],_0xb9a9b9[_0x99b0('0x31')]);_0x3c77a5[_0x99b0('0x35')]=_[_0x99b0('0x33')](_0xb9a9b9[_0x99b0('0x34')],qs[_0x99b0('0x36')](_0x2e5225['query'][_0x99b0('0x36')]));_0x3c77a5[_0x99b0('0x35')]=_0x3c77a5[_0x99b0('0x35')][_0x99b0('0x37')]?_0x3c77a5[_0x99b0('0x35')]:_0xb9a9b9['model'];if(_0x2e5225[_0x99b0('0x31')][_0x99b0('0x42')]){_0x3c77a5['include']=[{'all':!![]}];}_0x3c77a5=_[_0x99b0('0x49')]({},_0x3c77a5,_0x2e5225[_0x99b0('0x41')]);return db['FaxTransferReport'][_0x99b0('0x4a')](_0x3c77a5)['then'](handleEntityNotFound(_0x32655b,null))[_0x99b0('0x26')](respondWithResult(_0x32655b,null))[_0x99b0('0x46')](handleError(_0x32655b,null));};exports[_0x99b0('0x4b')]=function(_0x5197ed,_0x36d066){return db['FaxTransferReport'][_0x99b0('0x4b')](_0x5197ed[_0x99b0('0x4c')],{})['then'](respondWithResult(_0x36d066,0xc9))[_0x99b0('0x46')](handleError(_0x36d066,null));};exports[_0x99b0('0x4d')]=function(_0x330dee,_0x4eba1c){if(_0x330dee[_0x99b0('0x4c')]['id']){delete _0x330dee['body']['id'];}return db[_0x99b0('0x2c')]['find']({'where':{'id':_0x330dee[_0x99b0('0x48')]['id']}})[_0x99b0('0x26')](handleEntityNotFound(_0x4eba1c,null))['then'](saveUpdates(_0x330dee[_0x99b0('0x4c')],null))['then'](respondWithResult(_0x4eba1c,null))[_0x99b0('0x46')](handleError(_0x4eba1c,null));};exports[_0x99b0('0x25')]=function(_0x20a401,_0x22a3da){return db[_0x99b0('0x2c')][_0x99b0('0x4a')]({'where':{'id':_0x20a401['params']['id']}})[_0x99b0('0x26')](handleEntityNotFound(_0x22a3da,null))['then'](removeEntity(_0x22a3da,null))[_0x99b0('0x46')](handleError(_0x22a3da,null));};exports['describe']=function(_0xdc0ec9,_0x20bf60){return db[_0x99b0('0x2c')]['describe']()['then'](respondWithResult(_0x20bf60,null))[_0x99b0('0x46')](handleError(_0x20bf60,null));};
\ No newline at end of file
index 1d0776b..f88e372 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea67=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x48250e,_0x3e78f1){var _0x3174c5=function(_0x501736){while(--_0x501736){_0x48250e['push'](_0x48250e['shift']());}};_0x3174c5(++_0x3e78f1);}(_0xea67,0x185));var _0x7ea6=function(_0x3b4922,_0x2fa365){_0x3b4922=_0x3b4922-0x0;var _0x239729=_0xea67[_0x3b4922];return _0x239729;};'use strict';var _=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var logger=require(_0x7ea6('0x2'))(_0x7ea6('0x3'));var moment=require(_0x7ea6('0x4'));var BPromise=require(_0x7ea6('0x5'));var rp=require(_0x7ea6('0x6'));var fs=require('fs');var path=require(_0x7ea6('0x7'));var rimraf=require(_0x7ea6('0x8'));var config=require(_0x7ea6('0x9'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x1ea3b7,_0x4ea901){return _0x1ea3b7[_0x7ea6('0xa')](_0x7ea6('0xb'),attributes,{'tableName':_0x7ea6('0xc'),'paranoid':![],'indexes':[{'name':_0x7ea6('0xd'),'fields':[_0x7ea6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x584e=['report_fax_transfer','lodash','../../config/logger','api','moment','path','rimraf','./faxTransferReport.attributes','FaxTransferReport'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x584e,0xa3));var _0xe584=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x584e[_0x5beda8];return _0x2aa042;};'use strict';var _=require(_0xe584('0x0'));var util=require('util');var logger=require(_0xe584('0x1'))(_0xe584('0x2'));var moment=require(_0xe584('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe584('0x4'));var rimraf=require(_0xe584('0x5'));var config=require('../../config/environment');var attributes=require(_0xe584('0x6'));module['exports']=function(_0x59f5d0,_0x3413d9){return _0x59f5d0['define'](_0xe584('0x7'),attributes,{'tableName':_0xe584('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 298bc66..4331351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x079a=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3b2db2,_0x3f644d){var _0x1ea951=function(_0x59d44f){while(--_0x59d44f){_0x3b2db2['push'](_0x3b2db2['shift']());}};_0x1ea951(++_0x3f644d);}(_0x079a,0x13b));var _0xa079=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x079a[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xa079('0x0'));var util=require(_0xa079('0x1'));var moment=require(_0xa079('0x2'));var BPromise=require(_0xa079('0x3'));var rs=require(_0xa079('0x4'));var fs=require('fs');var Redis=require(_0xa079('0x5'));var db=require(_0xa079('0x6'))['db'];var utils=require(_0xa079('0x7'));var logger=require('../../config/logger')(_0xa079('0x8'));var config=require(_0xa079('0x9'));var jayson=require(_0xa079('0xa'));var client=jayson[_0xa079('0xb')][_0xa079('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36aac8,_0x54d84d,_0x4375bc){return new BPromise(function(_0x4ac9a1,_0x30dd03){return client['request'](_0x36aac8,_0x4375bc)[_0xa079('0xd')](function(_0x46240c){logger[_0xa079('0xe')](_0xa079('0xf'),_0x54d84d,_0xa079('0x10'));logger[_0xa079('0x11')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x54d84d,_0xa079('0x10'),JSON[_0xa079('0x12')](_0x46240c));if(_0x46240c[_0xa079('0x13')]){if(_0x46240c['error']['code']===0x1f4){logger['error'](_0xa079('0xf'),_0x54d84d,_0x46240c[_0xa079('0x13')][_0xa079('0x14')]);return _0x30dd03(_0x46240c[_0xa079('0x13')][_0xa079('0x14')]);}logger[_0xa079('0x13')](_0xa079('0xf'),_0x54d84d,_0x46240c[_0xa079('0x13')]['message']);return _0x4ac9a1(_0x46240c[_0xa079('0x13')][_0xa079('0x14')]);}else{logger[_0xa079('0xe')](_0xa079('0xf'),_0x54d84d,_0xa079('0x10'));_0x4ac9a1(_0x46240c[_0xa079('0x15')][_0xa079('0x14')]);}})[_0xa079('0x16')](function(_0x44f9a6){logger[_0xa079('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x54d84d,_0x44f9a6);_0x30dd03(_0x44f9a6);});});}
\ No newline at end of file
+var _0x0762=['stringify','error','message','result','catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x2f8b7b,_0x2b2b1c){var _0x4c845f=function(_0x7132f6){while(--_0x7132f6){_0x2f8b7b['push'](_0x2f8b7b['shift']());}};_0x4c845f(++_0x2b2b1c);}(_0x0762,0xc0));var _0x2076=function(_0x849e8d,_0x21b681){_0x849e8d=_0x849e8d-0x0;var _0x53d15d=_0x0762[_0x849e8d];return _0x53d15d;};'use strict';var _=require('lodash');var util=require(_0x2076('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2076('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2076('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2076('0x3'))(_0x2076('0x4'));var config=require(_0x2076('0x5'));var jayson=require(_0x2076('0x6'));var client=jayson[_0x2076('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x360b5a,_0x4dcfd4,_0x14140b){return new BPromise(function(_0x2c458f,_0x527812){return client['request'](_0x360b5a,_0x14140b)['then'](function(_0x36bfe1){logger[_0x2076('0x8')](_0x2076('0x9'),_0x4dcfd4,_0x2076('0xa'));logger['debug'](_0x2076('0xb'),_0x4dcfd4,_0x2076('0xa'),JSON[_0x2076('0xc')](_0x36bfe1));if(_0x36bfe1['error']){if(_0x36bfe1[_0x2076('0xd')]['code']===0x1f4){logger['error'](_0x2076('0x9'),_0x4dcfd4,_0x36bfe1[_0x2076('0xd')][_0x2076('0xe')]);return _0x527812(_0x36bfe1[_0x2076('0xd')][_0x2076('0xe')]);}logger[_0x2076('0xd')](_0x2076('0x9'),_0x4dcfd4,_0x36bfe1[_0x2076('0xd')][_0x2076('0xe')]);return _0x2c458f(_0x36bfe1[_0x2076('0xd')]['message']);}else{logger[_0x2076('0x8')](_0x2076('0x9'),_0x4dcfd4,_0x2076('0xa'));_0x2c458f(_0x36bfe1[_0x2076('0xf')][_0x2076('0xe')]);}})[_0x2076('0x10')](function(_0xbc155f){logger[_0x2076('0xd')](_0x2076('0x9'),_0x4dcfd4,_0xbc155f);_0x527812(_0xbc155f);});});}
\ No newline at end of file
index 59988bf..31d75dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a4d=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x97f6d2,_0x5567c2){var _0x285063=function(_0x431d23){while(--_0x431d23){_0x97f6d2['push'](_0x97f6d2['shift']());}};_0x285063(++_0x5567c2);}(_0x7a4d,0x14d));var _0xd7a4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x7a4d[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require('multer');var util=require(_0xd7a4('0x0'));var path=require(_0xd7a4('0x1'));var timeout=require(_0xd7a4('0x2'));var express=require(_0xd7a4('0x3'));var router=express[_0xd7a4('0x4')]();var fs_extra=require(_0xd7a4('0x5'));var auth=require(_0xd7a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a4('0x7'));var controller=require(_0xd7a4('0x8'));router['get']('/',auth[_0xd7a4('0x9')](),controller[_0xd7a4('0xa')]);router[_0xd7a4('0xb')](_0xd7a4('0xc'),auth[_0xd7a4('0x9')](),controller[_0xd7a4('0xd')]);router[_0xd7a4('0xb')](_0xd7a4('0xe'),auth[_0xd7a4('0x9')](),controller[_0xd7a4('0xf')]);router[_0xd7a4('0x10')]('/',auth[_0xd7a4('0x9')](),controller[_0xd7a4('0x11')]);router[_0xd7a4('0x12')]('/:id',auth[_0xd7a4('0x9')](),controller[_0xd7a4('0x13')]);router['delete'](_0xd7a4('0xe'),auth['isAuthenticated'](),controller[_0xd7a4('0x14')]);module[_0xd7a4('0x15')]=router;
\ No newline at end of file
+var _0x94d3=['post','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x94d3,0x70));var _0x394d=function(_0x29e7a4,_0x549702){_0x29e7a4=_0x29e7a4-0x0;var _0x4ce914=_0x94d3[_0x29e7a4];return _0x4ce914;};'use strict';var multer=require(_0x394d('0x0'));var util=require(_0x394d('0x1'));var path=require(_0x394d('0x2'));var timeout=require(_0x394d('0x3'));var express=require(_0x394d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x394d('0x5'));var interaction=require(_0x394d('0x6'));var config=require('../../config/environment');var controller=require(_0x394d('0x7'));router['get']('/',auth[_0x394d('0x8')](),controller[_0x394d('0x9')]);router[_0x394d('0xa')](_0x394d('0xb'),auth[_0x394d('0x8')](),controller[_0x394d('0xc')]);router[_0x394d('0xa')](_0x394d('0xd'),auth[_0x394d('0x8')](),controller['show']);router[_0x394d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x394d('0xf')](_0x394d('0xd'),auth[_0x394d('0x8')](),controller[_0x394d('0x10')]);router['delete']('/:id',auth[_0x394d('0x8')](),controller[_0x394d('0x11')]);module['exports']=router;
\ No newline at end of file
index 0e9cc15..a579b28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b1b=['/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put'];(function(_0x4c606e,_0x4d18e4){var _0x155c9e=function(_0x318736){while(--_0x318736){_0x4c606e['push'](_0x4c606e['shift']());}};_0x155c9e(++_0x4d18e4);}(_0x7b1b,0x100));var _0xb7b1=function(_0x4e44e3,_0x45a08b){_0x4e44e3=_0x4e44e3-0x0;var _0x2bb218=_0x7b1b[_0x4e44e3];return _0x2bb218;};'use strict';var multer=require(_0xb7b1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb7b1('0x1'));var express=require(_0xb7b1('0x2'));var router=express[_0xb7b1('0x3')]();var fs_extra=require(_0xb7b1('0x4'));var auth=require(_0xb7b1('0x5'));var interaction=require(_0xb7b1('0x6'));var config=require(_0xb7b1('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xb7b1('0x8')](),controller['index']);router[_0xb7b1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb7b1('0xa')]);router[_0xb7b1('0x9')](_0xb7b1('0xb'),auth[_0xb7b1('0x8')](),controller[_0xb7b1('0xc')]);router['get'](_0xb7b1('0xd'),auth[_0xb7b1('0x8')](),controller['getFields']);router[_0xb7b1('0xe')]('/',auth[_0xb7b1('0x8')](),controller['create']);router[_0xb7b1('0xe')](_0xb7b1('0xb'),auth[_0xb7b1('0x8')](),controller[_0xb7b1('0xf')]);router[_0xb7b1('0x10')](_0xb7b1('0x11'),auth[_0xb7b1('0x8')](),controller[_0xb7b1('0x12')]);router[_0xb7b1('0x13')](_0xb7b1('0x11'),auth['isAuthenticated'](),controller[_0xb7b1('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa990=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put','destroy','util','path'];(function(_0x4ccaba,_0x2494f8){var _0x126e09=function(_0x17eeb2){while(--_0x17eeb2){_0x4ccaba['push'](_0x4ccaba['shift']());}};_0x126e09(++_0x2494f8);}(_0xa990,0xf0));var _0x0a99=function(_0x28bf90,_0x3e9d56){_0x28bf90=_0x28bf90-0x0;var _0x24be81=_0xa990[_0x28bf90];return _0x24be81;};'use strict';var multer=require('multer');var util=require(_0x0a99('0x0'));var path=require(_0x0a99('0x1'));var timeout=require(_0x0a99('0x2'));var express=require(_0x0a99('0x3'));var router=express[_0x0a99('0x4')]();var fs_extra=require(_0x0a99('0x5'));var auth=require(_0x0a99('0x6'));var interaction=require(_0x0a99('0x7'));var config=require(_0x0a99('0x8'));var controller=require(_0x0a99('0x9'));router[_0x0a99('0xa')]('/',auth['isAuthenticated'](),controller[_0x0a99('0xb')]);router[_0x0a99('0xa')](_0x0a99('0xc'),auth[_0x0a99('0xd')](),controller[_0x0a99('0xe')]);router[_0x0a99('0xa')](_0x0a99('0xf'),auth[_0x0a99('0xd')](),controller['getConfigurations']);router[_0x0a99('0xa')]('/:id/fields',auth[_0x0a99('0xd')](),controller[_0x0a99('0x10')]);router[_0x0a99('0x11')]('/',auth[_0x0a99('0xd')](),controller[_0x0a99('0x12')]);router[_0x0a99('0x11')](_0x0a99('0xf'),auth['isAuthenticated'](),controller[_0x0a99('0x13')]);router[_0x0a99('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a99('0x15')]);module['exports']=router;
\ No newline at end of file
index 75d906e..939cca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x725d=['STRING','ENUM','integrationTab','newTab','exports'];(function(_0x30ffe6,_0x16ce7f){var _0x488f2=function(_0x101eee){while(--_0x101eee){_0x30ffe6['push'](_0x30ffe6['shift']());}};_0x488f2(++_0x16ce7f);}(_0x725d,0x199));var _0xd725=function(_0x32032a,_0x24e8d1){_0x32032a=_0x32032a-0x0;var _0x5d5792=_0x725d[_0x32032a];return _0x5d5792;};'use strict';var Sequelize=require('sequelize');module[_0xd725('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd725('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xd725('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd725('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd725('0x1')]},'tokenSecret':{'type':Sequelize[_0xd725('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd725('0x2')](_0xd725('0x3'),_0xd725('0x4')),'defaultValue':_0xd725('0x3')}};
\ No newline at end of file
+var _0x78f6=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x2dbdc3,_0x2435a0){var _0x538a79=function(_0x386fd0){while(--_0x386fd0){_0x2dbdc3['push'](_0x2dbdc3['shift']());}};_0x538a79(++_0x2435a0);}(_0x78f6,0x19f));var _0x678f=function(_0x1e3bd4,_0x29012e){_0x1e3bd4=_0x1e3bd4-0x0;var _0x273516=_0x78f6[_0x1e3bd4];return _0x273516;};'use strict';var Sequelize=require(_0x678f('0x0'));module[_0x678f('0x1')]={'name':{'type':Sequelize[_0x678f('0x2')]},'description':{'type':Sequelize[_0x678f('0x2')]},'username':{'type':Sequelize[_0x678f('0x2')]},'remoteUri':{'type':Sequelize[_0x678f('0x2')]},'authType':{'type':Sequelize[_0x678f('0x3')](_0x678f('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x678f('0x2')]},'consumerSecret':{'type':Sequelize[_0x678f('0x2')]},'token':{'type':Sequelize[_0x678f('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x678f('0x3')](_0x678f('0x5'),'newTab'),'defaultValue':_0x678f('0x5')}};
\ No newline at end of file
index 51df559..ae514af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb37b=['authType','username','password','consumerKey','consumerSecret','tokenSecret','remoteUri','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','label','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','DeskAccount,\x20%s,\x20%s','catch','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','end','sendStatus','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','DeskAccount','count','includeAll','include','findAll','rows','show','params','find','create','update','body','getConfigurations','findOne','DeskConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','getFields','priority'];(function(_0x38de33,_0x4361bb){var _0x40f16d=function(_0x25975c){while(--_0x25975c){_0x38de33['push'](_0x38de33['shift']());}};_0x40f16d(++_0x4361bb);}(_0xb37b,0x105));var _0xbb37=function(_0x253666,_0x14b4fb){_0x253666=_0x253666-0x0;var _0x2ae308=_0xb37b[_0x253666];return _0x2ae308;};'use strict';var emlformat=require(_0xbb37('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb37('0x1'));var jsonpatch=require(_0xbb37('0x2'));var rp=require(_0xbb37('0x3'));var moment=require(_0xbb37('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbb37('0x5'));var path=require(_0xbb37('0x6'));var sox=require(_0xbb37('0x7'));var csv=require('to-csv');var ejs=require(_0xbb37('0x8'));var fs=require('fs');var fs_extra=require(_0xbb37('0x9'));var _=require(_0xbb37('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb37('0xb'));var deskjs=require(_0xbb37('0xc'));var toCsv=require(_0xbb37('0xd'));var querystring=require('querystring');var Papa=require(_0xbb37('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbb37('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb37('0x10'))(_0xbb37('0x11'));var utils=require(_0xbb37('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbb37('0x13'))['db'];var integrations=require(_0xbb37('0x14'));var jayson=require(_0xbb37('0x15'));var client=jayson['client'][_0xbb37('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x245bb7,_0x3e8ad3,_0x2aa881,_0x3d41eb){return new BPromise(function(_0x209788,_0x372bac){var _0x353291=_0x3d41eb||client;return _0x353291[_0xbb37('0x17')](_0x245bb7,_0x2aa881)[_0xbb37('0x18')](function(_0x2e434d){logger[_0xbb37('0x19')]('DeskAccount,\x20%s,\x20%s',_0x3e8ad3,_0xbb37('0x1a'));logger['debug'](_0xbb37('0x1b'),_0x3e8ad3,_0xbb37('0x1a'),JSON['stringify'](_0x2e434d));if(_0x2e434d[_0xbb37('0x1c')]){if(_0x2e434d[_0xbb37('0x1c')][_0xbb37('0x1d')]===0x1f4){logger[_0xbb37('0x1c')]('DeskAccount,\x20%s,\x20%s',_0x3e8ad3,_0x2e434d[_0xbb37('0x1c')][_0xbb37('0x1e')]);return _0x372bac(_0x2e434d[_0xbb37('0x1c')]['message']);}logger[_0xbb37('0x1c')]('DeskAccount,\x20%s,\x20%s',_0x3e8ad3,_0x2e434d[_0xbb37('0x1c')][_0xbb37('0x1e')]);return _0x209788(_0x2e434d[_0xbb37('0x1c')][_0xbb37('0x1e')]);}else{logger['info'](_0xbb37('0x1f'),_0x3e8ad3,_0xbb37('0x1a'));_0x209788(_0x2e434d['result']['message']);}})[_0xbb37('0x20')](function(_0x2ca7b8){logger[_0xbb37('0x1c')]('DeskAccount,\x20%s,\x20%s',_0x3e8ad3,_0x2ca7b8);_0x372bac(_0x2ca7b8);});});}function respondWithStatusCode(_0x1e29a4,_0x57ca76){_0x57ca76=_0x57ca76||0xcc;return function(_0x12d1e5){if(_0x12d1e5){return _0x1e29a4['sendStatus'](_0x57ca76);}return _0x1e29a4[_0xbb37('0x21')](_0x57ca76)['end']();};}function respondWithResult(_0x107d6c,_0x15f63f){_0x15f63f=_0x15f63f||0xc8;return function(_0x27c21b){if(_0x27c21b){return _0x107d6c[_0xbb37('0x21')](_0x15f63f)[_0xbb37('0x22')](_0x27c21b);}};}function respondWithFilteredResult(_0x41b3af,_0x1e24a1){return function(_0xc5dd0){if(_0xc5dd0){var _0x48b5fe=typeof _0x1e24a1[_0xbb37('0x23')]===_0xbb37('0x24')&&typeof _0x1e24a1[_0xbb37('0x25')]===_0xbb37('0x24');var _0x1787e9=_0xc5dd0['count'];var _0x4710fc=_0x48b5fe?0x0:_0x1e24a1[_0xbb37('0x23')];var _0xc4bf42=_0x48b5fe?_0xc5dd0['count']:_0x1e24a1[_0xbb37('0x23')]+_0x1e24a1[_0xbb37('0x25')];var _0x4f0f93;if(_0xc4bf42>=_0x1787e9){_0xc4bf42=_0x1787e9;_0x4f0f93=0xc8;}else{_0x4f0f93=0xce;}_0x41b3af[_0xbb37('0x21')](_0x4f0f93);return _0x41b3af[_0xbb37('0x26')](_0xbb37('0x27'),_0x4710fc+'-'+_0xc4bf42+'/'+_0x1787e9)[_0xbb37('0x22')](_0xc5dd0);}return null;};}function patchUpdates(_0xdc590b){return function(_0x51a1f0){try{jsonpatch[_0xbb37('0x28')](_0x51a1f0,_0xdc590b,!![]);}catch(_0x28fe80){return BPromise[_0xbb37('0x29')](_0x28fe80);}return _0x51a1f0[_0xbb37('0x2a')]();};}function saveUpdates(_0xec5ad1,_0x54dd3e){return function(_0x4a7782){if(_0x4a7782){return _0x4a7782['update'](_0xec5ad1)['then'](function(_0x38a981){return _0x38a981;});}return null;};}function removeEntity(_0x1c51c0,_0x3b6d95){return function(_0x182f4d){if(_0x182f4d){return _0x182f4d[_0xbb37('0x2b')]()[_0xbb37('0x18')](function(){_0x1c51c0[_0xbb37('0x21')](0xcc)[_0xbb37('0x2c')]();});}};}function handleEntityNotFound(_0xc7c318,_0x540668){return function(_0x111d30){if(!_0x111d30){_0xc7c318[_0xbb37('0x2d')](0x194);}return _0x111d30;};}function handleError(_0xa63ce5,_0x9aa99f){_0x9aa99f=_0x9aa99f||0x1f4;return function(_0x4211d4){logger[_0xbb37('0x1c')](_0x4211d4['stack']);if(_0x4211d4[_0xbb37('0x2e')]){delete _0x4211d4[_0xbb37('0x2e')];}_0xa63ce5[_0xbb37('0x21')](_0x9aa99f)[_0xbb37('0x2f')](_0x4211d4);};}exports[_0xbb37('0x30')]=function(_0x45dd02,_0x38bb32){var _0x4a9c6a={},_0x273e6a={},_0x28062f={'count':0x0,'rows':[]};var _0x591047=_[_0xbb37('0x31')](db['DeskAccount'][_0xbb37('0x32')],function(_0x4ee448){return{'name':_0x4ee448[_0xbb37('0x33')],'type':_0x4ee448['type'][_0xbb37('0x34')]};});_0x273e6a['model']=_[_0xbb37('0x31')](_0x591047,_0xbb37('0x2e'));_0x273e6a[_0xbb37('0x35')]=_[_0xbb37('0x36')](_0x45dd02[_0xbb37('0x35')]);_0x273e6a[_0xbb37('0x37')]=_[_0xbb37('0x38')](_0x273e6a[_0xbb37('0x39')],_0x273e6a['query']);_0x4a9c6a[_0xbb37('0x3a')]=_[_0xbb37('0x38')](_0x273e6a['model'],qs[_0xbb37('0x3b')](_0x45dd02[_0xbb37('0x35')][_0xbb37('0x3b')]));_0x4a9c6a[_0xbb37('0x3a')]=_0x4a9c6a[_0xbb37('0x3a')][_0xbb37('0x3c')]?_0x4a9c6a['attributes']:_0x273e6a[_0xbb37('0x39')];if(!_0x45dd02['query'][_0xbb37('0x3d')]('nolimit')){_0x4a9c6a['limit']=qs[_0xbb37('0x25')](_0x45dd02[_0xbb37('0x35')][_0xbb37('0x25')]);_0x4a9c6a['offset']=qs[_0xbb37('0x23')](_0x45dd02['query'][_0xbb37('0x23')]);}_0x4a9c6a[_0xbb37('0x3e')]=qs[_0xbb37('0x3f')](_0x45dd02['query']['sort']);_0x4a9c6a[_0xbb37('0x40')]=qs['filters'](_[_0xbb37('0x41')](_0x45dd02[_0xbb37('0x35')],_0x273e6a[_0xbb37('0x37')]),_0x591047);if(_0x45dd02['query'][_0xbb37('0x42')]){_0x4a9c6a[_0xbb37('0x40')]=_[_0xbb37('0x43')](_0x4a9c6a[_0xbb37('0x40')],{'$or':_[_0xbb37('0x31')](_0x591047,function(_0x467283){if(_0x467283[_0xbb37('0x44')]!==_0xbb37('0x45')){var _0x5c1174={};_0x5c1174[_0x467283[_0xbb37('0x2e')]]={'$like':'%'+_0x45dd02['query'][_0xbb37('0x42')]+'%'};return _0x5c1174;}})});}_0x4a9c6a=_[_0xbb37('0x43')]({},_0x4a9c6a,_0x45dd02[_0xbb37('0x46')]);var _0x1733c3={'where':_0x4a9c6a[_0xbb37('0x40')]};return db[_0xbb37('0x47')][_0xbb37('0x48')](_0x1733c3)[_0xbb37('0x18')](function(_0x529d90){_0x28062f[_0xbb37('0x48')]=_0x529d90;if(_0x45dd02[_0xbb37('0x35')][_0xbb37('0x49')]){_0x4a9c6a[_0xbb37('0x4a')]=[{'all':!![]}];}return db[_0xbb37('0x47')][_0xbb37('0x4b')](_0x4a9c6a);})[_0xbb37('0x18')](function(_0x20d448){_0x28062f[_0xbb37('0x4c')]=_0x20d448;return _0x28062f;})[_0xbb37('0x18')](respondWithFilteredResult(_0x38bb32,_0x4a9c6a))['catch'](handleError(_0x38bb32,null));};exports[_0xbb37('0x4d')]=function(_0x501b8e,_0x11dd9d){var _0x2bee5d={'raw':![],'where':{'id':_0x501b8e[_0xbb37('0x4e')]['id']}},_0x197609={};_0x197609[_0xbb37('0x39')]=_['keys'](db[_0xbb37('0x47')][_0xbb37('0x32')]);_0x197609[_0xbb37('0x35')]=_[_0xbb37('0x36')](_0x501b8e[_0xbb37('0x35')]);_0x197609[_0xbb37('0x37')]=_[_0xbb37('0x38')](_0x197609[_0xbb37('0x39')],_0x197609['query']);_0x2bee5d[_0xbb37('0x3a')]=_[_0xbb37('0x38')](_0x197609[_0xbb37('0x39')],qs['fields'](_0x501b8e[_0xbb37('0x35')][_0xbb37('0x3b')]));_0x2bee5d[_0xbb37('0x3a')]=_0x2bee5d[_0xbb37('0x3a')][_0xbb37('0x3c')]?_0x2bee5d['attributes']:_0x197609['model'];if(_0x501b8e[_0xbb37('0x35')][_0xbb37('0x49')]){_0x2bee5d[_0xbb37('0x4a')]=[{'all':!![]}];}_0x2bee5d=_['merge']({},_0x2bee5d,_0x501b8e[_0xbb37('0x46')]);return db[_0xbb37('0x47')][_0xbb37('0x4f')](_0x2bee5d)['then'](handleEntityNotFound(_0x11dd9d,null))[_0xbb37('0x18')](respondWithResult(_0x11dd9d,null))[_0xbb37('0x20')](handleError(_0x11dd9d,null));};exports[_0xbb37('0x50')]=function(_0x3f41d0,_0x5a99bd){return db[_0xbb37('0x47')]['create'](_0x3f41d0['body'],{})['then'](respondWithResult(_0x5a99bd,0xc9))[_0xbb37('0x20')](handleError(_0x5a99bd,null));};exports[_0xbb37('0x51')]=function(_0x4a44d0,_0x479ca3){if(_0x4a44d0[_0xbb37('0x52')]['id']){delete _0x4a44d0[_0xbb37('0x52')]['id'];}return db[_0xbb37('0x47')][_0xbb37('0x4f')]({'where':{'id':_0x4a44d0[_0xbb37('0x4e')]['id']}})[_0xbb37('0x18')](handleEntityNotFound(_0x479ca3,null))[_0xbb37('0x18')](saveUpdates(_0x4a44d0['body'],null))['then'](respondWithResult(_0x479ca3,null))[_0xbb37('0x20')](handleError(_0x479ca3,null));};exports['destroy']=function(_0x15b100,_0x195419){return db['DeskAccount']['find']({'where':{'id':_0x15b100[_0xbb37('0x4e')]['id']}})[_0xbb37('0x18')](handleEntityNotFound(_0x195419,null))[_0xbb37('0x18')](removeEntity(_0x195419,null))[_0xbb37('0x20')](handleError(_0x195419,null));};exports[_0xbb37('0x53')]=function(_0x49972b,_0x4f9290,_0x322622){var _0x59982f={};var _0x2a86bb={};var _0x591f7f;var _0x4de98c;return db[_0xbb37('0x47')][_0xbb37('0x54')]({'where':{'id':_0x49972b[_0xbb37('0x4e')]['id']}})[_0xbb37('0x18')](handleEntityNotFound(_0x4f9290,null))['then'](function(_0x282f0a){if(_0x282f0a){_0x591f7f=_0x282f0a;_0x2a86bb[_0xbb37('0x39')]=_[_0xbb37('0x36')](db[_0xbb37('0x55')]['rawAttributes']);_0x2a86bb[_0xbb37('0x35')]=_[_0xbb37('0x36')](_0x49972b[_0xbb37('0x35')]);_0x2a86bb['filters']=_[_0xbb37('0x38')](_0x2a86bb[_0xbb37('0x39')],_0x2a86bb[_0xbb37('0x35')]);_0x59982f['attributes']=_[_0xbb37('0x38')](_0x2a86bb[_0xbb37('0x39')],qs[_0xbb37('0x3b')](_0x49972b[_0xbb37('0x35')][_0xbb37('0x3b')]));_0x59982f[_0xbb37('0x3a')]=_0x59982f[_0xbb37('0x3a')]['length']?_0x59982f['attributes']:_0x2a86bb[_0xbb37('0x39')];_0x59982f[_0xbb37('0x3e')]=qs[_0xbb37('0x3f')](_0x49972b[_0xbb37('0x35')]['sort']);_0x59982f[_0xbb37('0x40')]=qs['filters'](_['pick'](_0x49972b[_0xbb37('0x35')],_0x2a86bb['filters']));if(_0x49972b[_0xbb37('0x35')][_0xbb37('0x42')]){_0x59982f[_0xbb37('0x40')]=_['merge'](_0x59982f[_0xbb37('0x40')],{'$or':_[_0xbb37('0x31')](_0x59982f[_0xbb37('0x3a')],function(_0x23dbb4){var _0x3ecd5d={};_0x3ecd5d[_0x23dbb4]={'$like':'%'+_0x49972b[_0xbb37('0x35')][_0xbb37('0x42')]+'%'};return _0x3ecd5d;})});}_0x59982f=_[_0xbb37('0x43')]({},_0x59982f,_0x49972b['options']);return _0x591f7f[_0xbb37('0x53')](_0x59982f);}})[_0xbb37('0x18')](function(_0x2b8149){if(_0x2b8149){_0x4de98c=_0x2b8149[_0xbb37('0x3c')];if(!_0x49972b[_0xbb37('0x35')]['hasOwnProperty']('nolimit')){_0x59982f[_0xbb37('0x25')]=qs['limit'](_0x49972b[_0xbb37('0x35')]['limit']);_0x59982f['offset']=qs[_0xbb37('0x23')](_0x49972b[_0xbb37('0x35')][_0xbb37('0x23')]);}return _0x591f7f['getConfigurations'](_0x59982f);}})[_0xbb37('0x18')](function(_0x224bc3){if(_0x224bc3){return _0x224bc3?{'count':_0x4de98c,'rows':_0x224bc3}:null;}})[_0xbb37('0x18')](respondWithResult(_0x4f9290,null))[_0xbb37('0x20')](handleError(_0x4f9290,null));};exports['addConfiguration']=function(_0x458fbc,_0x2fa866,_0x153161){if(_0x458fbc[_0xbb37('0x52')]['id']){delete _0x458fbc[_0xbb37('0x52')]['id'];}return db[_0xbb37('0x47')][_0xbb37('0x54')]({'where':{'id':_0x458fbc[_0xbb37('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2fa866,null))['then'](function(_0x2c5aa4){if(_0x2c5aa4){_0x458fbc[_0xbb37('0x52')][_0xbb37('0x56')]=_0x2c5aa4['id'];_0x458fbc[_0xbb37('0x52')][_0xbb37('0x57')]=integrations['getSubjects'](_0x458fbc[_0xbb37('0x52')]['channel'],_0x458fbc[_0xbb37('0x52')][_0xbb37('0x44')]);_0x458fbc['body'][_0xbb37('0x58')]=integrations[_0xbb37('0x59')](_0x458fbc[_0xbb37('0x52')][_0xbb37('0x5a')],_0x458fbc[_0xbb37('0x52')][_0xbb37('0x44')]);return db[_0xbb37('0x55')][_0xbb37('0x50')](_0x458fbc[_0xbb37('0x52')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db['DeskField'],'as':_0xbb37('0x58')}]});}return null;})[_0xbb37('0x18')](respondWithResult(_0x2fa866,null))[_0xbb37('0x20')](handleError(_0x2fa866,null));};exports[_0xbb37('0x5b')]=function(_0x120be8,_0x1916cc,_0x135de8){var _0x4b0ecb=[{'name':_0xbb37('0x5c'),'label':_0xbb37('0x5c'),'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 _0x4c4e4b='';return db[_0xbb37('0x47')][_0xbb37('0x54')]({'where':{'id':_0x120be8[_0xbb37('0x4e')]['id']},'attributes':['id','remoteUri',_0xbb37('0x5d'),_0xbb37('0x5e'),_0xbb37('0x5f'),_0xbb37('0x60'),_0xbb37('0x61'),'token',_0xbb37('0x62')]})[_0xbb37('0x18')](handleEntityNotFound(_0x1916cc,null))[_0xbb37('0x18')](function(_0x488121){if(_0x488121){_0x4c4e4b=_0x488121[_0xbb37('0x63')];var _0x2ef41a=_0x4c4e4b['slice'](-0x1);if(_0x2ef41a==='/'){_0x4c4e4b=_0x4c4e4b['substring'](0x0,_0x4c4e4b[_0xbb37('0x64')](_0x2ef41a));}var _0x582f19={'method':_0xbb37('0x65'),'uri':util[_0xbb37('0x66')](_0xbb37('0x67'),_0x4c4e4b),'headers':{'Content-Type':'application/json','Accept':_0xbb37('0x68')},'json':!![]};if(_0x488121[_0xbb37('0x5d')]===_0xbb37('0x69')){_0x582f19[_0xbb37('0x6a')][_0xbb37('0x6b')]=util[_0xbb37('0x66')](_0xbb37('0x6c'),new Buffer(util[_0xbb37('0x66')](_0xbb37('0x6d'),_0x488121[_0xbb37('0x5e')],_0x488121['password']))[_0xbb37('0x6e')](_0xbb37('0x6f')));}return rp(_0x582f19)[_0xbb37('0x18')](function(_0x58497e){return _0x4b0ecb[_0xbb37('0x70')](_[_0xbb37('0x31')](_0x58497e['_embedded'][_0xbb37('0x71')],function(_0x28bd9d){return{'id':_0x28bd9d['name'],'name':_0x28bd9d[_0xbb37('0x2e')],'type':_0x28bd9d['type'],'active':_0x28bd9d['active'],'label':_0x28bd9d[_0xbb37('0x72')],'custom':!![]};}));});}})[_0xbb37('0x18')](function(_0x34d698){return{'count':_0x34d698[_0xbb37('0x3c')],'rows':_0x34d698};})['then'](respondWithResult(_0x1916cc,null))[_0xbb37('0x20')](function(_0x54904d){var _0x221185=_0x120be8[_0xbb37('0x35')][_0xbb37('0x73')]?0x1f4:_0x54904d[_0xbb37('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xbb37('0x5b'),_0x221185,JSON['stringify'](_0x54904d));delete _0x54904d[_0xbb37('0x2e')];if(_0x221185===0x191){_0x221185=0x190;}_0x1916cc[_0xbb37('0x21')](_0x221185)['send'](_0x120be8[_0xbb37('0x35')][_0xbb37('0x73')]?{'message':_0xbb37('0x75'),'statusCode':_0x54904d[_0xbb37('0x74')]}:_0x54904d);});};
\ No newline at end of file
+var _0x4738=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','end','offset','undefined','count','limit','json','reject','save','update','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','order','AccountId','getSubjects','Descriptions','getDescriptions','channel','DeskField','Subjects','priority','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x4738,0xe8));var _0x8473=function(_0x8aadfe,_0x451fb6){_0x8aadfe=_0x8aadfe-0x0;var _0x3d148d=_0x4738[_0x8aadfe];return _0x3d148d;};'use strict';var emlformat=require(_0x8473('0x0'));var rimraf=require(_0x8473('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8473('0x2'));var rp=require(_0x8473('0x3'));var moment=require(_0x8473('0x4'));var BPromise=require(_0x8473('0x5'));var Mustache=require(_0x8473('0x6'));var util=require(_0x8473('0x7'));var path=require(_0x8473('0x8'));var sox=require(_0x8473('0x9'));var csv=require(_0x8473('0xa'));var ejs=require(_0x8473('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8473('0xc'));var squel=require(_0x8473('0xd'));var crypto=require(_0x8473('0xe'));var jsforce=require(_0x8473('0xf'));var deskjs=require(_0x8473('0x10'));var toCsv=require(_0x8473('0xa'));var querystring=require('querystring');var Papa=require(_0x8473('0x11'));var Redis=require('ioredis');var authService=require(_0x8473('0x12'));var qs=require(_0x8473('0x13'));var as=require(_0x8473('0x14'));var hardwareService=require(_0x8473('0x15'));var logger=require('../../config/logger')(_0x8473('0x16'));var utils=require(_0x8473('0x17'));var config=require(_0x8473('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8473('0x19'))['db'];var integrations=require(_0x8473('0x1a'));var jayson=require(_0x8473('0x1b'));var client=jayson[_0x8473('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43407e,_0x417050,_0x56d6ce,_0x151012){return new BPromise(function(_0xf4295a,_0x53c6d3){var _0x4f4bba=_0x151012||client;return _0x4f4bba[_0x8473('0x1d')](_0x43407e,_0x56d6ce)[_0x8473('0x1e')](function(_0x33c1e5){logger[_0x8473('0x1f')](_0x8473('0x20'),_0x417050,_0x8473('0x21'));logger[_0x8473('0x22')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x417050,_0x8473('0x21'),JSON[_0x8473('0x23')](_0x33c1e5));if(_0x33c1e5['error']){if(_0x33c1e5[_0x8473('0x24')]['code']===0x1f4){logger[_0x8473('0x24')](_0x8473('0x20'),_0x417050,_0x33c1e5['error']['message']);return _0x53c6d3(_0x33c1e5[_0x8473('0x24')][_0x8473('0x25')]);}logger[_0x8473('0x24')](_0x8473('0x20'),_0x417050,_0x33c1e5[_0x8473('0x24')][_0x8473('0x25')]);return _0xf4295a(_0x33c1e5[_0x8473('0x24')][_0x8473('0x25')]);}else{logger[_0x8473('0x1f')](_0x8473('0x20'),_0x417050,_0x8473('0x21'));_0xf4295a(_0x33c1e5['result']['message']);}})['catch'](function(_0x4702e0){logger['error']('DeskAccount,\x20%s,\x20%s',_0x417050,_0x4702e0);_0x53c6d3(_0x4702e0);});});}function respondWithStatusCode(_0x290110,_0x3a5cbc){_0x3a5cbc=_0x3a5cbc||0xcc;return function(_0x596df4){if(_0x596df4){return _0x290110[_0x8473('0x26')](_0x3a5cbc);}return _0x290110[_0x8473('0x27')](_0x3a5cbc)[_0x8473('0x28')]();};}function respondWithResult(_0x4c0017,_0x86e23f){_0x86e23f=_0x86e23f||0xc8;return function(_0x41e6f0){if(_0x41e6f0){return _0x4c0017[_0x8473('0x27')](_0x86e23f)['json'](_0x41e6f0);}};}function respondWithFilteredResult(_0x1d53aa,_0x58b773){return function(_0x555142){if(_0x555142){var _0x5d7cf2=typeof _0x58b773[_0x8473('0x29')]===_0x8473('0x2a')&&typeof _0x58b773['limit']===_0x8473('0x2a');var _0x5c560b=_0x555142[_0x8473('0x2b')];var _0x635758=_0x5d7cf2?0x0:_0x58b773[_0x8473('0x29')];var _0x505be8=_0x5d7cf2?_0x555142[_0x8473('0x2b')]:_0x58b773[_0x8473('0x29')]+_0x58b773[_0x8473('0x2c')];var _0x12edf2;if(_0x505be8>=_0x5c560b){_0x505be8=_0x5c560b;_0x12edf2=0xc8;}else{_0x12edf2=0xce;}_0x1d53aa[_0x8473('0x27')](_0x12edf2);return _0x1d53aa['set']('Content-Range',_0x635758+'-'+_0x505be8+'/'+_0x5c560b)[_0x8473('0x2d')](_0x555142);}return null;};}function patchUpdates(_0xb754b3){return function(_0x268424){try{jsonpatch['apply'](_0x268424,_0xb754b3,!![]);}catch(_0x3cbc51){return BPromise[_0x8473('0x2e')](_0x3cbc51);}return _0x268424[_0x8473('0x2f')]();};}function saveUpdates(_0x51b054,_0x2dbdf2){return function(_0x15fd6f){if(_0x15fd6f){return _0x15fd6f[_0x8473('0x30')](_0x51b054)[_0x8473('0x1e')](function(_0x43e621){return _0x43e621;});}return null;};}function removeEntity(_0x190537,_0x258a82){return function(_0x3d899a){if(_0x3d899a){return _0x3d899a['destroy']()[_0x8473('0x1e')](function(){_0x190537[_0x8473('0x27')](0xcc)[_0x8473('0x28')]();});}};}function handleEntityNotFound(_0x5a23ef,_0x1e8ff2){return function(_0x11d2d4){if(!_0x11d2d4){_0x5a23ef['sendStatus'](0x194);}return _0x11d2d4;};}function handleError(_0x1748bc,_0x3b7d63){_0x3b7d63=_0x3b7d63||0x1f4;return function(_0x32409b){logger[_0x8473('0x24')](_0x32409b['stack']);if(_0x32409b['name']){delete _0x32409b[_0x8473('0x31')];}_0x1748bc[_0x8473('0x27')](_0x3b7d63)[_0x8473('0x32')](_0x32409b);};}exports[_0x8473('0x33')]=function(_0xdcdce5,_0x710c3c){var _0x112a6e={},_0x3f21a4={},_0x78f04d={'count':0x0,'rows':[]};var _0x2d5801=_[_0x8473('0x34')](db[_0x8473('0x35')][_0x8473('0x36')],function(_0x37b00f){return{'name':_0x37b00f[_0x8473('0x37')],'type':_0x37b00f[_0x8473('0x38')][_0x8473('0x39')]};});_0x3f21a4[_0x8473('0x3a')]=_[_0x8473('0x34')](_0x2d5801,_0x8473('0x31'));_0x3f21a4[_0x8473('0x3b')]=_[_0x8473('0x3c')](_0xdcdce5['query']);_0x3f21a4['filters']=_[_0x8473('0x3d')](_0x3f21a4['model'],_0x3f21a4[_0x8473('0x3b')]);_0x112a6e[_0x8473('0x3e')]=_[_0x8473('0x3d')](_0x3f21a4[_0x8473('0x3a')],qs[_0x8473('0x3f')](_0xdcdce5['query'][_0x8473('0x3f')]));_0x112a6e['attributes']=_0x112a6e['attributes'][_0x8473('0x40')]?_0x112a6e[_0x8473('0x3e')]:_0x3f21a4[_0x8473('0x3a')];if(!_0xdcdce5[_0x8473('0x3b')][_0x8473('0x41')](_0x8473('0x42'))){_0x112a6e[_0x8473('0x2c')]=qs[_0x8473('0x2c')](_0xdcdce5[_0x8473('0x3b')]['limit']);_0x112a6e[_0x8473('0x29')]=qs['offset'](_0xdcdce5[_0x8473('0x3b')][_0x8473('0x29')]);}_0x112a6e['order']=qs[_0x8473('0x43')](_0xdcdce5[_0x8473('0x3b')][_0x8473('0x43')]);_0x112a6e['where']=qs[_0x8473('0x44')](_[_0x8473('0x45')](_0xdcdce5['query'],_0x3f21a4[_0x8473('0x44')]),_0x2d5801);if(_0xdcdce5[_0x8473('0x3b')][_0x8473('0x46')]){_0x112a6e[_0x8473('0x47')]=_[_0x8473('0x48')](_0x112a6e[_0x8473('0x47')],{'$or':_[_0x8473('0x34')](_0x2d5801,function(_0x293c95){if(_0x293c95[_0x8473('0x38')]!==_0x8473('0x49')){var _0xd617ba={};_0xd617ba[_0x293c95['name']]={'$like':'%'+_0xdcdce5[_0x8473('0x3b')][_0x8473('0x46')]+'%'};return _0xd617ba;}})});}_0x112a6e=_[_0x8473('0x48')]({},_0x112a6e,_0xdcdce5[_0x8473('0x4a')]);var _0x24eebe={'where':_0x112a6e[_0x8473('0x47')]};return db['DeskAccount'][_0x8473('0x2b')](_0x24eebe)[_0x8473('0x1e')](function(_0x3f0632){_0x78f04d[_0x8473('0x2b')]=_0x3f0632;if(_0xdcdce5[_0x8473('0x3b')][_0x8473('0x4b')]){_0x112a6e[_0x8473('0x4c')]=[{'all':!![]}];}return db[_0x8473('0x35')][_0x8473('0x4d')](_0x112a6e);})[_0x8473('0x1e')](function(_0x31db58){_0x78f04d['rows']=_0x31db58;return _0x78f04d;})['then'](respondWithFilteredResult(_0x710c3c,_0x112a6e))[_0x8473('0x4e')](handleError(_0x710c3c,null));};exports[_0x8473('0x4f')]=function(_0xde4f85,_0x583618){var _0x8d2fe2={'raw':![],'where':{'id':_0xde4f85[_0x8473('0x50')]['id']}},_0x4fb8e5={};_0x4fb8e5[_0x8473('0x3a')]=_[_0x8473('0x3c')](db[_0x8473('0x35')]['rawAttributes']);_0x4fb8e5[_0x8473('0x3b')]=_['keys'](_0xde4f85[_0x8473('0x3b')]);_0x4fb8e5[_0x8473('0x44')]=_[_0x8473('0x3d')](_0x4fb8e5[_0x8473('0x3a')],_0x4fb8e5['query']);_0x8d2fe2[_0x8473('0x3e')]=_[_0x8473('0x3d')](_0x4fb8e5[_0x8473('0x3a')],qs['fields'](_0xde4f85[_0x8473('0x3b')][_0x8473('0x3f')]));_0x8d2fe2[_0x8473('0x3e')]=_0x8d2fe2[_0x8473('0x3e')]['length']?_0x8d2fe2['attributes']:_0x4fb8e5[_0x8473('0x3a')];if(_0xde4f85[_0x8473('0x3b')][_0x8473('0x4b')]){_0x8d2fe2[_0x8473('0x4c')]=[{'all':!![]}];}_0x8d2fe2=_['merge']({},_0x8d2fe2,_0xde4f85[_0x8473('0x4a')]);return db[_0x8473('0x35')][_0x8473('0x51')](_0x8d2fe2)[_0x8473('0x1e')](handleEntityNotFound(_0x583618,null))[_0x8473('0x1e')](respondWithResult(_0x583618,null))[_0x8473('0x4e')](handleError(_0x583618,null));};exports['create']=function(_0x36efad,_0x1b6e0b){return db['DeskAccount'][_0x8473('0x52')](_0x36efad[_0x8473('0x53')],{})[_0x8473('0x1e')](respondWithResult(_0x1b6e0b,0xc9))[_0x8473('0x4e')](handleError(_0x1b6e0b,null));};exports[_0x8473('0x30')]=function(_0x42847e,_0x463a76){if(_0x42847e['body']['id']){delete _0x42847e[_0x8473('0x53')]['id'];}return db[_0x8473('0x35')]['find']({'where':{'id':_0x42847e[_0x8473('0x50')]['id']}})['then'](handleEntityNotFound(_0x463a76,null))[_0x8473('0x1e')](saveUpdates(_0x42847e[_0x8473('0x53')],null))[_0x8473('0x1e')](respondWithResult(_0x463a76,null))[_0x8473('0x4e')](handleError(_0x463a76,null));};exports['destroy']=function(_0x5c1a9b,_0x4db02e){return db[_0x8473('0x35')]['find']({'where':{'id':_0x5c1a9b[_0x8473('0x50')]['id']}})['then'](handleEntityNotFound(_0x4db02e,null))['then'](removeEntity(_0x4db02e,null))[_0x8473('0x4e')](handleError(_0x4db02e,null));};exports[_0x8473('0x54')]=function(_0x2510a5,_0x1f48ff,_0xabcfd9){var _0x39fc8f={};var _0x3aeb60={};var _0x25b9b4;var _0x108cee;return db['DeskAccount'][_0x8473('0x55')]({'where':{'id':_0x2510a5[_0x8473('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f48ff,null))[_0x8473('0x1e')](function(_0x4756b0){if(_0x4756b0){_0x25b9b4=_0x4756b0;_0x3aeb60['model']=_[_0x8473('0x3c')](db[_0x8473('0x56')][_0x8473('0x36')]);_0x3aeb60[_0x8473('0x3b')]=_[_0x8473('0x3c')](_0x2510a5[_0x8473('0x3b')]);_0x3aeb60[_0x8473('0x44')]=_[_0x8473('0x3d')](_0x3aeb60['model'],_0x3aeb60['query']);_0x39fc8f[_0x8473('0x3e')]=_[_0x8473('0x3d')](_0x3aeb60[_0x8473('0x3a')],qs[_0x8473('0x3f')](_0x2510a5[_0x8473('0x3b')][_0x8473('0x3f')]));_0x39fc8f['attributes']=_0x39fc8f['attributes'][_0x8473('0x40')]?_0x39fc8f['attributes']:_0x3aeb60['model'];_0x39fc8f[_0x8473('0x57')]=qs[_0x8473('0x43')](_0x2510a5[_0x8473('0x3b')][_0x8473('0x43')]);_0x39fc8f['where']=qs[_0x8473('0x44')](_[_0x8473('0x45')](_0x2510a5[_0x8473('0x3b')],_0x3aeb60['filters']));if(_0x2510a5[_0x8473('0x3b')][_0x8473('0x46')]){_0x39fc8f['where']=_[_0x8473('0x48')](_0x39fc8f[_0x8473('0x47')],{'$or':_['map'](_0x39fc8f['attributes'],function(_0x4d0ffa){var _0x3a2fcc={};_0x3a2fcc[_0x4d0ffa]={'$like':'%'+_0x2510a5['query'][_0x8473('0x46')]+'%'};return _0x3a2fcc;})});}_0x39fc8f=_['merge']({},_0x39fc8f,_0x2510a5['options']);return _0x25b9b4['getConfigurations'](_0x39fc8f);}})[_0x8473('0x1e')](function(_0x32d151){if(_0x32d151){_0x108cee=_0x32d151[_0x8473('0x40')];if(!_0x2510a5[_0x8473('0x3b')][_0x8473('0x41')](_0x8473('0x42'))){_0x39fc8f[_0x8473('0x2c')]=qs[_0x8473('0x2c')](_0x2510a5[_0x8473('0x3b')][_0x8473('0x2c')]);_0x39fc8f[_0x8473('0x29')]=qs['offset'](_0x2510a5['query'][_0x8473('0x29')]);}return _0x25b9b4['getConfigurations'](_0x39fc8f);}})[_0x8473('0x1e')](function(_0x4e46c1){if(_0x4e46c1){return _0x4e46c1?{'count':_0x108cee,'rows':_0x4e46c1}:null;}})[_0x8473('0x1e')](respondWithResult(_0x1f48ff,null))[_0x8473('0x4e')](handleError(_0x1f48ff,null));};exports['addConfiguration']=function(_0x5b8b2a,_0x5b9441,_0x2aacb4){if(_0x5b8b2a[_0x8473('0x53')]['id']){delete _0x5b8b2a[_0x8473('0x53')]['id'];}return db[_0x8473('0x35')][_0x8473('0x55')]({'where':{'id':_0x5b8b2a[_0x8473('0x50')]['id']}})[_0x8473('0x1e')](handleEntityNotFound(_0x5b9441,null))[_0x8473('0x1e')](function(_0x9375a4){if(_0x9375a4){_0x5b8b2a[_0x8473('0x53')][_0x8473('0x58')]=_0x9375a4['id'];_0x5b8b2a['body']['Subjects']=integrations[_0x8473('0x59')](_0x5b8b2a['body']['channel'],_0x5b8b2a['body'][_0x8473('0x38')]);_0x5b8b2a['body'][_0x8473('0x5a')]=integrations[_0x8473('0x5b')](_0x5b8b2a[_0x8473('0x53')][_0x8473('0x5c')],_0x5b8b2a[_0x8473('0x53')]['type']);return db['DeskConfiguration'][_0x8473('0x52')](_0x5b8b2a['body'],{'include':[{'model':db[_0x8473('0x5d')],'as':_0x8473('0x5e')},{'model':db[_0x8473('0x5d')],'as':_0x8473('0x5a')}]});}return null;})[_0x8473('0x1e')](respondWithResult(_0x5b9441,null))[_0x8473('0x4e')](handleError(_0x5b9441,null));};exports['getFields']=function(_0x18cc1c,_0x1289be,_0x531b17){var _0x5dea13=[{'name':'priority','label':_0x8473('0x5f'),'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 _0x5c0b2c='';return db[_0x8473('0x35')][_0x8473('0x55')]({'where':{'id':_0x18cc1c[_0x8473('0x50')]['id']},'attributes':['id','remoteUri',_0x8473('0x60'),_0x8473('0x61'),_0x8473('0x62'),_0x8473('0x63'),_0x8473('0x64'),_0x8473('0x65'),_0x8473('0x66')]})['then'](handleEntityNotFound(_0x1289be,null))[_0x8473('0x1e')](function(_0xcbf496){if(_0xcbf496){_0x5c0b2c=_0xcbf496[_0x8473('0x67')];var _0x1b68bb=_0x5c0b2c[_0x8473('0x68')](-0x1);if(_0x1b68bb==='/'){_0x5c0b2c=_0x5c0b2c[_0x8473('0x69')](0x0,_0x5c0b2c[_0x8473('0x6a')](_0x1b68bb));}var _0x402ff6={'method':_0x8473('0x6b'),'uri':util[_0x8473('0x6c')](_0x8473('0x6d'),_0x5c0b2c),'headers':{'Content-Type':'application/json','Accept':_0x8473('0x6e')},'json':!![]};if(_0xcbf496[_0x8473('0x60')]===_0x8473('0x6f')){_0x402ff6[_0x8473('0x70')][_0x8473('0x71')]=util['format'](_0x8473('0x72'),new Buffer(util[_0x8473('0x6c')](_0x8473('0x73'),_0xcbf496[_0x8473('0x61')],_0xcbf496['password']))[_0x8473('0x74')](_0x8473('0x75')));}return rp(_0x402ff6)[_0x8473('0x1e')](function(_0x3787fa){return _0x5dea13[_0x8473('0x76')](_[_0x8473('0x34')](_0x3787fa['_embedded']['entries'],function(_0x4336a4){return{'id':_0x4336a4[_0x8473('0x31')],'name':_0x4336a4['name'],'type':_0x4336a4[_0x8473('0x38')],'active':_0x4336a4[_0x8473('0x77')],'label':_0x4336a4[_0x8473('0x78')],'custom':!![]};}));});}})['then'](function(_0x122012){return{'count':_0x122012['length'],'rows':_0x122012};})[_0x8473('0x1e')](respondWithResult(_0x1289be,null))['catch'](function(_0x34e1d8){var _0x53f366=_0x18cc1c[_0x8473('0x3b')]['test']?0x1f4:_0x34e1d8[_0x8473('0x79')]||0x1f4;logger['error'](_0x8473('0x7a'),_0x8473('0x7b'),_0x53f366,JSON[_0x8473('0x23')](_0x34e1d8));delete _0x34e1d8[_0x8473('0x31')];if(_0x53f366===0x191){_0x53f366=0x190;}_0x1289be[_0x8473('0x27')](_0x53f366)[_0x8473('0x32')](_0x18cc1c[_0x8473('0x3b')]['test']?{'message':_0x8473('0x7c'),'statusCode':_0x34e1d8['statusCode']}:_0x34e1d8);});};
\ No newline at end of file
index 6cb2f6a..456bf3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131f=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','DeskAccount','int_desk_accounts','lodash'];(function(_0x1b2185,_0x597cb0){var _0x420419=function(_0x2f4163){while(--_0x2f4163){_0x1b2185['push'](_0x1b2185['shift']());}};_0x420419(++_0x597cb0);}(_0x131f,0x137));var _0xf131=function(_0x31d3d2,_0x1c6102){_0x31d3d2=_0x31d3d2-0x0;var _0x519f31=_0x131f[_0x31d3d2];return _0x519f31;};'use strict';var _=require(_0xf131('0x0'));var util=require(_0xf131('0x1'));var logger=require('../../config/logger')(_0xf131('0x2'));var moment=require(_0xf131('0x3'));var BPromise=require(_0xf131('0x4'));var rp=require(_0xf131('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf131('0x6'));var config=require(_0xf131('0x7'));var attributes=require(_0xf131('0x8'));var integrations=require(_0xf131('0x9'));module['exports']=function(_0x55d7f0,_0x50898e){return _0x55d7f0['define'](_0xf131('0xa'),attributes,{'tableName':_0xf131('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3963=['int_desk_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount'];(function(_0x14b9fa,_0x78afa5){var _0xcf0855=function(_0x3a0c5b){while(--_0x3a0c5b){_0x14b9fa['push'](_0x14b9fa['shift']());}};_0xcf0855(++_0x78afa5);}(_0x3963,0x1e2));var _0x3396=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x3963[_0x11f5ff];return _0x46eefb;};'use strict';var _=require(_0x3396('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3396('0x1'));var moment=require('moment');var BPromise=require(_0x3396('0x2'));var rp=require(_0x3396('0x3'));var fs=require('fs');var path=require(_0x3396('0x4'));var rimraf=require(_0x3396('0x5'));var config=require(_0x3396('0x6'));var attributes=require(_0x3396('0x7'));var integrations=require(_0x3396('0x8'));module[_0x3396('0x9')]=function(_0x5d69ec,_0x3cce55){return _0x5d69ec[_0x3396('0xa')](_0x3396('0xb'),attributes,{'tableName':_0x3396('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6fbf10a..d70d88f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdabc=['DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetDeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowDeskAccount','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x194618,_0x23e42a){var _0x5a35df=function(_0xdac0ff){while(--_0xdac0ff){_0x194618['push'](_0x194618['shift']());}};_0x5a35df(++_0x23e42a);}(_0xdabc,0x12e));var _0xcdab=function(_0x317d61,_0x5e6335){_0x317d61=_0x317d61-0x0;var _0x3abc20=_0xdabc[_0x317d61];return _0x3abc20;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcdab('0x0'));var BPromise=require(_0xcdab('0x1'));var rs=require(_0xcdab('0x2'));var fs=require('fs');var Redis=require(_0xcdab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdab('0x4'));var logger=require(_0xcdab('0x5'))(_0xcdab('0x6'));var config=require('../../config/environment');var jayson=require(_0xcdab('0x7'));var client=jayson[_0xcdab('0x8')][_0xcdab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf9be73,_0x598819,_0x5052d4){return new BPromise(function(_0x531911,_0x13198f){return client[_0xcdab('0xa')](_0xf9be73,_0x5052d4)[_0xcdab('0xb')](function(_0x171747){logger[_0xcdab('0xc')](_0xcdab('0xd'),_0x598819,'request\x20sent');logger[_0xcdab('0xe')](_0xcdab('0xf'),_0x598819,'request\x20sent',JSON[_0xcdab('0x10')](_0x171747));if(_0x171747[_0xcdab('0x11')]){if(_0x171747[_0xcdab('0x11')][_0xcdab('0x12')]===0x1f4){logger[_0xcdab('0x11')](_0xcdab('0xd'),_0x598819,_0x171747[_0xcdab('0x11')][_0xcdab('0x13')]);return _0x13198f(_0x171747[_0xcdab('0x11')][_0xcdab('0x13')]);}logger['error'](_0xcdab('0xd'),_0x598819,_0x171747[_0xcdab('0x11')][_0xcdab('0x13')]);return _0x531911(_0x171747[_0xcdab('0x11')]['message']);}else{logger['info'](_0xcdab('0xd'),_0x598819,_0xcdab('0x14'));_0x531911(_0x171747[_0xcdab('0x15')][_0xcdab('0x13')]);}})['catch'](function(_0x5a56c3){logger['error'](_0xcdab('0xd'),_0x598819,_0x5a56c3);_0x13198f(_0x5a56c3);});});}exports[_0xcdab('0x16')]=function(_0x64261b){var _0x1896db=this;return new Promise(function(_0x2adbb4,_0x1645fe){return db['DeskAccount'][_0xcdab('0x17')]({'raw':_0x64261b[_0xcdab('0x18')]?_0x64261b[_0xcdab('0x18')][_0xcdab('0x19')]===undefined?!![]:![]:!![],'where':_0x64261b[_0xcdab('0x18')]?_0x64261b[_0xcdab('0x18')][_0xcdab('0x1a')]||null:null,'attributes':_0x64261b['options']?_0x64261b[_0xcdab('0x18')][_0xcdab('0x1b')]||null:null,'limit':_0x64261b[_0xcdab('0x18')]?_0x64261b[_0xcdab('0x18')][_0xcdab('0x1c')]||null:null,'include':_0x64261b['options']?_0x64261b[_0xcdab('0x18')][_0xcdab('0x1d')]?_[_0xcdab('0x1e')](_0x64261b['options'][_0xcdab('0x1d')],function(_0x3b5fc4){return{'model':db[_0x3b5fc4[_0xcdab('0x1f')]],'as':_0x3b5fc4['as'],'attributes':_0x3b5fc4[_0xcdab('0x1b')],'include':_0x3b5fc4['include']?_['map'](_0x3b5fc4[_0xcdab('0x1d')],function(_0x3c3e01){return{'model':db[_0x3c3e01[_0xcdab('0x1f')]],'as':_0x3c3e01['as'],'attributes':_0x3c3e01[_0xcdab('0x1b')],'include':_0x3c3e01['include']?_[_0xcdab('0x1e')](_0x3c3e01[_0xcdab('0x1d')],function(_0x132f5c){return{'model':db[_0x132f5c[_0xcdab('0x1f')]],'as':_0x132f5c['as'],'attributes':_0x132f5c[_0xcdab('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56dd6e){logger[_0xcdab('0xc')](_0xcdab('0x16'),_0x64261b);logger[_0xcdab('0xe')](_0xcdab('0x16'),_0x64261b,JSON[_0xcdab('0x10')](_0x56dd6e));_0x2adbb4(_0x56dd6e);})['catch'](function(_0x15dfea){logger['error']('GetDeskAccount',_0x15dfea[_0xcdab('0x13')],_0x64261b);_0x1645fe(_0x1896db[_0xcdab('0x11')](0x1f4,_0x15dfea['message']));});});};exports['ShowDeskAccount']=function(_0x1386ed){var _0x5b6c49=this;return new Promise(function(_0x5f07df,_0x450bd1){return db['DeskAccount'][_0xcdab('0x20')]({'raw':_0x1386ed['options']?_0x1386ed[_0xcdab('0x18')][_0xcdab('0x19')]===undefined?!![]:![]:!![],'where':_0x1386ed[_0xcdab('0x18')]?_0x1386ed[_0xcdab('0x18')][_0xcdab('0x1a')]||null:null,'attributes':_0x1386ed['options']?_0x1386ed[_0xcdab('0x18')][_0xcdab('0x1b')]||null:null,'include':_0x1386ed['options']?_0x1386ed[_0xcdab('0x18')]['include']?_[_0xcdab('0x1e')](_0x1386ed[_0xcdab('0x18')][_0xcdab('0x1d')],function(_0xf8442){return{'model':db[_0xf8442[_0xcdab('0x1f')]],'as':_0xf8442['as'],'attributes':_0xf8442[_0xcdab('0x1b')],'include':_0xf8442['include']?_[_0xcdab('0x1e')](_0xf8442[_0xcdab('0x1d')],function(_0x54adf6){return{'model':db[_0x54adf6[_0xcdab('0x1f')]],'as':_0x54adf6['as'],'attributes':_0x54adf6[_0xcdab('0x1b')],'include':_0x54adf6[_0xcdab('0x1d')]?_[_0xcdab('0x1e')](_0x54adf6[_0xcdab('0x1d')],function(_0xecf3e3){return{'model':db[_0xecf3e3[_0xcdab('0x1f')]],'as':_0xecf3e3['as'],'attributes':_0xecf3e3[_0xcdab('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdab('0xb')](function(_0x5c9145){logger[_0xcdab('0xc')](_0xcdab('0x21'),_0x1386ed);logger[_0xcdab('0xe')](_0xcdab('0x21'),_0x1386ed,JSON[_0xcdab('0x10')](_0x5c9145));_0x5f07df(_0x5c9145);})[_0xcdab('0x22')](function(_0x1c1eb2){logger['error'](_0xcdab('0x21'),_0x1c1eb2[_0xcdab('0x13')],_0x1386ed);_0x450bd1(_0x5b6c49['error'](0x1f4,_0x1c1eb2[_0xcdab('0x13')]));});});};
\ No newline at end of file
+var _0x5d4d=['debug','stringify','ShowDeskAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d4d,0x162));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d4('0x0'));var util=require(_0xd5d4('0x1'));var moment=require(_0xd5d4('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5d4('0x4'))['db'];var utils=require(_0xd5d4('0x5'));var logger=require('../../config/logger')(_0xd5d4('0x6'));var config=require(_0xd5d4('0x7'));var jayson=require(_0xd5d4('0x8'));var client=jayson['client'][_0xd5d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f8fec,_0x8ffb3e,_0x500ae4){return new BPromise(function(_0x359989,_0x57749a){return client[_0xd5d4('0xa')](_0x8f8fec,_0x500ae4)[_0xd5d4('0xb')](function(_0x10573c){logger[_0xd5d4('0xc')](_0xd5d4('0xd'),_0x8ffb3e,_0xd5d4('0xe'));logger['debug'](_0xd5d4('0xf'),_0x8ffb3e,_0xd5d4('0xe'),JSON['stringify'](_0x10573c));if(_0x10573c[_0xd5d4('0x10')]){if(_0x10573c[_0xd5d4('0x10')]['code']===0x1f4){logger['error'](_0xd5d4('0xd'),_0x8ffb3e,_0x10573c['error'][_0xd5d4('0x11')]);return _0x57749a(_0x10573c[_0xd5d4('0x10')][_0xd5d4('0x11')]);}logger[_0xd5d4('0x10')](_0xd5d4('0xd'),_0x8ffb3e,_0x10573c[_0xd5d4('0x10')][_0xd5d4('0x11')]);return _0x359989(_0x10573c[_0xd5d4('0x10')]['message']);}else{logger[_0xd5d4('0xc')](_0xd5d4('0xd'),_0x8ffb3e,_0xd5d4('0xe'));_0x359989(_0x10573c[_0xd5d4('0x12')]['message']);}})[_0xd5d4('0x13')](function(_0x47a621){logger[_0xd5d4('0x10')](_0xd5d4('0xd'),_0x8ffb3e,_0x47a621);_0x57749a(_0x47a621);});});}exports[_0xd5d4('0x14')]=function(_0x5103d4){var _0x38b13a=this;return new Promise(function(_0x5d24ac,_0x738a5){return db[_0xd5d4('0x15')][_0xd5d4('0x16')]({'raw':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x18')]===undefined?!![]:![]:!![],'where':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x19')]||null:null,'attributes':_0x5103d4['options']?_0x5103d4['options'][_0xd5d4('0x1a')]||null:null,'limit':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x1b')]||null:null,'include':_0x5103d4[_0xd5d4('0x17')]?_0x5103d4['options'][_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x5103d4[_0xd5d4('0x17')][_0xd5d4('0x1c')],function(_0x2269c){return{'model':db[_0x2269c[_0xd5d4('0x1e')]],'as':_0x2269c['as'],'attributes':_0x2269c[_0xd5d4('0x1a')],'include':_0x2269c['include']?_[_0xd5d4('0x1d')](_0x2269c[_0xd5d4('0x1c')],function(_0x41366d){return{'model':db[_0x41366d[_0xd5d4('0x1e')]],'as':_0x41366d['as'],'attributes':_0x41366d[_0xd5d4('0x1a')],'include':_0x41366d[_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x41366d['include'],function(_0x5974e2){return{'model':db[_0x5974e2[_0xd5d4('0x1e')]],'as':_0x5974e2['as'],'attributes':_0x5974e2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f134f){logger['info']('GetDeskAccount',_0x5103d4);logger[_0xd5d4('0x1f')](_0xd5d4('0x14'),_0x5103d4,JSON[_0xd5d4('0x20')](_0x3f134f));_0x5d24ac(_0x3f134f);})['catch'](function(_0x46258c){logger[_0xd5d4('0x10')](_0xd5d4('0x14'),_0x46258c[_0xd5d4('0x11')],_0x5103d4);_0x738a5(_0x38b13a[_0xd5d4('0x10')](0x1f4,_0x46258c[_0xd5d4('0x11')]));});});};exports[_0xd5d4('0x21')]=function(_0x1e4918){var _0x3bc4ad=this;return new Promise(function(_0x42dc40,_0x4bc0c4){return db[_0xd5d4('0x15')][_0xd5d4('0x22')]({'raw':_0x1e4918[_0xd5d4('0x17')]?_0x1e4918['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e4918[_0xd5d4('0x17')]?_0x1e4918[_0xd5d4('0x17')]['where']||null:null,'attributes':_0x1e4918['options']?_0x1e4918[_0xd5d4('0x17')]['attributes']||null:null,'include':_0x1e4918['options']?_0x1e4918[_0xd5d4('0x17')][_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x1e4918[_0xd5d4('0x17')][_0xd5d4('0x1c')],function(_0x2deecc){return{'model':db[_0x2deecc[_0xd5d4('0x1e')]],'as':_0x2deecc['as'],'attributes':_0x2deecc[_0xd5d4('0x1a')],'include':_0x2deecc[_0xd5d4('0x1c')]?_[_0xd5d4('0x1d')](_0x2deecc[_0xd5d4('0x1c')],function(_0x16717a){return{'model':db[_0x16717a[_0xd5d4('0x1e')]],'as':_0x16717a['as'],'attributes':_0x16717a[_0xd5d4('0x1a')],'include':_0x16717a[_0xd5d4('0x1c')]?_['map'](_0x16717a['include'],function(_0x5a3b8c){return{'model':db[_0x5a3b8c[_0xd5d4('0x1e')]],'as':_0x5a3b8c['as'],'attributes':_0x5a3b8c[_0xd5d4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd5d4('0xb')](function(_0x570942){logger[_0xd5d4('0xc')](_0xd5d4('0x21'),_0x1e4918);logger[_0xd5d4('0x1f')]('ShowDeskAccount',_0x1e4918,JSON[_0xd5d4('0x20')](_0x570942));_0x42dc40(_0x570942);})['catch'](function(_0x2e9bde){logger[_0xd5d4('0x10')]('ShowDeskAccount',_0x2e9bde[_0xd5d4('0x11')],_0x1e4918);_0x4bc0c4(_0x3bc4ad[_0xd5d4('0x10')](0x1f4,_0x2e9bde['message']));});});};
\ No newline at end of file
index a368799..3eabf42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x55ca,0x126));var _0xa55c=function(_0x2c9f51,_0x2eec01){_0x2c9f51=_0x2c9f51-0x0;var _0x12abf9=_0x55ca[_0x2c9f51];return _0x12abf9;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router;
\ No newline at end of file
+var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0xa69122,_0x3c1c3c){var _0x582a21=function(_0x514021){while(--_0x514021){_0xa69122['push'](_0xa69122['shift']());}};_0x582a21(++_0x3c1c3c);}(_0xedd9,0xfc));var _0x9edd=function(_0x55922d,_0x34145d){_0x55922d=_0x55922d-0x0;var _0x52d59c=_0xedd9[_0x55922d];return _0x52d59c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router;
\ No newline at end of file
index 0aa3cd6..a674e48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6c6=['STRING','exports'];(function(_0x50e8b0,_0x4c0aa9){var _0x282fdf=function(_0x45a88c){while(--_0x45a88c){_0x50e8b0['push'](_0x50e8b0['shift']());}};_0x282fdf(++_0x4c0aa9);}(_0xc6c6,0x13d));var _0x6c6c=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0xc6c6[_0x324fe8];return _0x4a1cd9;};'use strict';var Sequelize=require('sequelize');module[_0x6c6c('0x0')]={'name':{'type':Sequelize[_0x6c6c('0x1')]},'description':{'type':Sequelize[_0x6c6c('0x1')]}};
\ No newline at end of file
+var _0x5f13=['sequelize','exports','STRING'];(function(_0x95396b,_0x1dd407){var _0x565040=function(_0x31938d){while(--_0x31938d){_0x95396b['push'](_0x95396b['shift']());}};_0x565040(++_0x1dd407);}(_0x5f13,0x192));var _0x35f1=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x5f13[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x35f1('0x0'));module[_0x35f1('0x1')]={'name':{'type':Sequelize[_0x35f1('0x2')]},'description':{'type':Sequelize[_0x35f1('0x2')]}};
\ No newline at end of file
index e547108..faa37c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda81=['ids','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','index','map','rawAttributes','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','DeskConfiguration','count','findAll','catch','show','params','includeAll','merge','options','find','create','body','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','nolimit','getTags','Tag','setTags'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xda81,0x1be));var _0x1da8=function(_0x57001c,_0x282095){_0x57001c=_0x57001c-0x0;var _0xeb4840=_0xda81[_0x57001c];return _0xeb4840;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1da8('0x0'));var rp=require(_0x1da8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1da8('0x2'));var util=require(_0x1da8('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x1da8('0x4'));var ejs=require(_0x1da8('0x5'));var fs=require('fs');var fs_extra=require(_0x1da8('0x6'));var _=require(_0x1da8('0x7'));var squel=require(_0x1da8('0x8'));var crypto=require(_0x1da8('0x9'));var jsforce=require(_0x1da8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1da8('0x4'));var querystring=require(_0x1da8('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1da8('0xc'));var qs=require(_0x1da8('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1da8('0xe'))(_0x1da8('0xf'));var utils=require(_0x1da8('0x10'));var config=require(_0x1da8('0x11'));var licenseUtil=require(_0x1da8('0x12'));var db=require('../../mysqldb')['db'];var jayson=require(_0x1da8('0x13'));var client=jayson[_0x1da8('0x14')][_0x1da8('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x28d70d,_0x1397b8,_0x332629,_0x4df75e){return new BPromise(function(_0x2f70c0,_0x2b1f2f){var _0x327677=_0x4df75e||client;return _0x327677[_0x1da8('0x16')](_0x28d70d,_0x332629)[_0x1da8('0x17')](function(_0xc5a3d7){logger[_0x1da8('0x18')](_0x1da8('0x19'),_0x1397b8,_0x1da8('0x1a'));logger[_0x1da8('0x1b')](_0x1da8('0x1c'),_0x1397b8,_0x1da8('0x1a'),JSON[_0x1da8('0x1d')](_0xc5a3d7));if(_0xc5a3d7['error']){if(_0xc5a3d7[_0x1da8('0x1e')]['code']===0x1f4){logger[_0x1da8('0x1e')]('DeskConfiguration,\x20%s,\x20%s',_0x1397b8,_0xc5a3d7[_0x1da8('0x1e')][_0x1da8('0x1f')]);return _0x2b1f2f(_0xc5a3d7[_0x1da8('0x1e')][_0x1da8('0x1f')]);}logger[_0x1da8('0x1e')](_0x1da8('0x19'),_0x1397b8,_0xc5a3d7['error']['message']);return _0x2f70c0(_0xc5a3d7[_0x1da8('0x1e')][_0x1da8('0x1f')]);}else{logger[_0x1da8('0x18')]('DeskConfiguration,\x20%s,\x20%s',_0x1397b8,_0x1da8('0x1a'));_0x2f70c0(_0xc5a3d7[_0x1da8('0x20')][_0x1da8('0x1f')]);}})['catch'](function(_0x123dc3){logger['error'](_0x1da8('0x19'),_0x1397b8,_0x123dc3);_0x2b1f2f(_0x123dc3);});});}function respondWithStatusCode(_0x198a25,_0xb7efa4){_0xb7efa4=_0xb7efa4||0xcc;return function(_0x1882eb){if(_0x1882eb){return _0x198a25['sendStatus'](_0xb7efa4);}return _0x198a25[_0x1da8('0x21')](_0xb7efa4)[_0x1da8('0x22')]();};}function respondWithResult(_0x4e9c50,_0x222c47){_0x222c47=_0x222c47||0xc8;return function(_0x5c48fe){if(_0x5c48fe){return _0x4e9c50[_0x1da8('0x21')](_0x222c47)[_0x1da8('0x23')](_0x5c48fe);}};}function respondWithFilteredResult(_0x4b8bf5,_0x25ba10){return function(_0x38a721){if(_0x38a721){var _0x66186b=typeof _0x25ba10[_0x1da8('0x24')]===_0x1da8('0x25')&&typeof _0x25ba10[_0x1da8('0x26')]===_0x1da8('0x25');var _0xf4f82a=_0x38a721['count'];var _0x5ba9f6=_0x66186b?0x0:_0x25ba10['offset'];var _0x363d8e=_0x66186b?_0x38a721['count']:_0x25ba10['offset']+_0x25ba10[_0x1da8('0x26')];var _0x5a8ba4;if(_0x363d8e>=_0xf4f82a){_0x363d8e=_0xf4f82a;_0x5a8ba4=0xc8;}else{_0x5a8ba4=0xce;}_0x4b8bf5[_0x1da8('0x21')](_0x5a8ba4);return _0x4b8bf5[_0x1da8('0x27')](_0x1da8('0x28'),_0x5ba9f6+'-'+_0x363d8e+'/'+_0xf4f82a)[_0x1da8('0x23')](_0x38a721);}return null;};}function patchUpdates(_0x36e2bc){return function(_0x4bb646){try{jsonpatch[_0x1da8('0x29')](_0x4bb646,_0x36e2bc,!![]);}catch(_0x4d7579){return BPromise['reject'](_0x4d7579);}return _0x4bb646[_0x1da8('0x2a')]();};}function saveUpdates(_0x34891a,_0x510499){return function(_0x323efa){if(_0x323efa){return _0x323efa['update'](_0x34891a)['then'](function(_0x4dfd1c){return _0x4dfd1c;});}return null;};}function removeEntity(_0x1a03ba,_0x3af99e){return function(_0x2484c2){if(_0x2484c2){return _0x2484c2[_0x1da8('0x2b')]()[_0x1da8('0x17')](function(){_0x1a03ba['status'](0xcc)[_0x1da8('0x22')]();});}};}function handleEntityNotFound(_0xc45a60,_0x231486){return function(_0x5357b1){if(!_0x5357b1){_0xc45a60[_0x1da8('0x2c')](0x194);}return _0x5357b1;};}function handleError(_0x47d8d5,_0x3e8892){_0x3e8892=_0x3e8892||0x1f4;return function(_0x51b725){logger[_0x1da8('0x1e')](_0x51b725[_0x1da8('0x2d')]);if(_0x51b725[_0x1da8('0x2e')]){delete _0x51b725['name'];}_0x47d8d5[_0x1da8('0x21')](_0x3e8892)['send'](_0x51b725);};}exports[_0x1da8('0x2f')]=function(_0xebf84,_0x562d1b){var _0x82927c={},_0x20a64c={},_0x26ff87={'count':0x0,'rows':[]};var _0x4d47cd=_[_0x1da8('0x30')](db['DeskConfiguration'][_0x1da8('0x31')],function(_0x5af863){return{'name':_0x5af863['fieldName'],'type':_0x5af863[_0x1da8('0x32')][_0x1da8('0x33')]};});_0x20a64c['model']=_[_0x1da8('0x30')](_0x4d47cd,_0x1da8('0x2e'));_0x20a64c[_0x1da8('0x34')]=_[_0x1da8('0x35')](_0xebf84['query']);_0x20a64c[_0x1da8('0x36')]=_['intersection'](_0x20a64c[_0x1da8('0x37')],_0x20a64c[_0x1da8('0x34')]);_0x82927c['attributes']=_[_0x1da8('0x38')](_0x20a64c['model'],qs['fields'](_0xebf84[_0x1da8('0x34')][_0x1da8('0x39')]));_0x82927c[_0x1da8('0x3a')]=_0x82927c[_0x1da8('0x3a')][_0x1da8('0x3b')]?_0x82927c['attributes']:_0x20a64c[_0x1da8('0x37')];if(!_0xebf84[_0x1da8('0x34')][_0x1da8('0x3c')]('nolimit')){_0x82927c[_0x1da8('0x26')]=qs[_0x1da8('0x26')](_0xebf84[_0x1da8('0x34')][_0x1da8('0x26')]);_0x82927c[_0x1da8('0x24')]=qs[_0x1da8('0x24')](_0xebf84[_0x1da8('0x34')]['offset']);}_0x82927c[_0x1da8('0x3d')]=qs[_0x1da8('0x3e')](_0xebf84[_0x1da8('0x34')]['sort']);_0x82927c[_0x1da8('0x3f')]=qs['filters'](_['pick'](_0xebf84[_0x1da8('0x34')],_0x20a64c['filters']),_0x4d47cd);if(_0xebf84['query'][_0x1da8('0x40')]){_0x82927c[_0x1da8('0x3f')]=_['merge'](_0x82927c[_0x1da8('0x3f')],{'$or':_[_0x1da8('0x30')](_0x4d47cd,function(_0x44a4e9){if(_0x44a4e9['type']!==_0x1da8('0x41')){var _0x2b3c74={};_0x2b3c74[_0x44a4e9[_0x1da8('0x2e')]]={'$like':'%'+_0xebf84[_0x1da8('0x34')]['filter']+'%'};return _0x2b3c74;}})});}_0x82927c=_['merge']({},_0x82927c,_0xebf84['options']);var _0x3900a7={'where':_0x82927c[_0x1da8('0x3f')]};return db[_0x1da8('0x42')][_0x1da8('0x43')](_0x3900a7)['then'](function(_0x579031){_0x26ff87['count']=_0x579031;if(_0xebf84[_0x1da8('0x34')]['includeAll']){_0x82927c['include']=[{'all':!![]}];}return db[_0x1da8('0x42')][_0x1da8('0x44')](_0x82927c);})[_0x1da8('0x17')](function(_0x3f1ba4){_0x26ff87['rows']=_0x3f1ba4;return _0x26ff87;})[_0x1da8('0x17')](respondWithFilteredResult(_0x562d1b,_0x82927c))[_0x1da8('0x45')](handleError(_0x562d1b,null));};exports[_0x1da8('0x46')]=function(_0x4b2287,_0x1c996a){var _0x3c75d7={'raw':![],'where':{'id':_0x4b2287[_0x1da8('0x47')]['id']}},_0x3c08bb={};_0x3c08bb[_0x1da8('0x37')]=_[_0x1da8('0x35')](db[_0x1da8('0x42')][_0x1da8('0x31')]);_0x3c08bb[_0x1da8('0x34')]=_[_0x1da8('0x35')](_0x4b2287[_0x1da8('0x34')]);_0x3c08bb[_0x1da8('0x36')]=_['intersection'](_0x3c08bb[_0x1da8('0x37')],_0x3c08bb[_0x1da8('0x34')]);_0x3c75d7[_0x1da8('0x3a')]=_['intersection'](_0x3c08bb[_0x1da8('0x37')],qs[_0x1da8('0x39')](_0x4b2287[_0x1da8('0x34')][_0x1da8('0x39')]));_0x3c75d7[_0x1da8('0x3a')]=_0x3c75d7['attributes'][_0x1da8('0x3b')]?_0x3c75d7[_0x1da8('0x3a')]:_0x3c08bb[_0x1da8('0x37')];if(_0x4b2287[_0x1da8('0x34')][_0x1da8('0x48')]){_0x3c75d7['include']=[{'all':!![]}];}_0x3c75d7=_[_0x1da8('0x49')]({},_0x3c75d7,_0x4b2287[_0x1da8('0x4a')]);return db[_0x1da8('0x42')][_0x1da8('0x4b')](_0x3c75d7)['then'](handleEntityNotFound(_0x1c996a,null))[_0x1da8('0x17')](respondWithResult(_0x1c996a,null))[_0x1da8('0x45')](handleError(_0x1c996a,null));};exports[_0x1da8('0x4c')]=function(_0x7763db,_0x13885d){return db[_0x1da8('0x42')][_0x1da8('0x4c')](_0x7763db[_0x1da8('0x4d')],{})[_0x1da8('0x17')](respondWithResult(_0x13885d,0xc9))['catch'](handleError(_0x13885d,null));};exports['update']=function(_0x2c79da,_0x5f1bdf){if(_0x2c79da[_0x1da8('0x4d')]['id']){delete _0x2c79da[_0x1da8('0x4d')]['id'];}return db[_0x1da8('0x42')][_0x1da8('0x4b')]({'where':{'id':_0x2c79da[_0x1da8('0x47')]['id']}})['then'](handleEntityNotFound(_0x5f1bdf,null))['then'](saveUpdates(_0x2c79da[_0x1da8('0x4d')],null))['then'](respondWithResult(_0x5f1bdf,null))['catch'](handleError(_0x5f1bdf,null));};exports['destroy']=function(_0x4fdf19,_0x49c53d){return db[_0x1da8('0x42')][_0x1da8('0x4b')]({'where':{'id':_0x4fdf19[_0x1da8('0x47')]['id']}})[_0x1da8('0x17')](handleEntityNotFound(_0x49c53d,null))[_0x1da8('0x17')](removeEntity(_0x49c53d,null))['catch'](handleError(_0x49c53d,null));};exports[_0x1da8('0x4e')]=function(_0x13321d,_0x5917dc,_0x5432bb){var _0x5c38fe={};var _0xa146ba={};var _0x5ec2bd;var _0xc24f66;return db[_0x1da8('0x42')][_0x1da8('0x4f')]({'where':{'id':_0x13321d[_0x1da8('0x47')]['id']}})[_0x1da8('0x17')](handleEntityNotFound(_0x5917dc,null))[_0x1da8('0x17')](function(_0x20e354){if(_0x20e354){_0x5ec2bd=_0x20e354;_0xa146ba[_0x1da8('0x37')]=_[_0x1da8('0x35')](db[_0x1da8('0x50')][_0x1da8('0x31')]);_0xa146ba[_0x1da8('0x34')]=_['keys'](_0x13321d[_0x1da8('0x34')]);_0xa146ba[_0x1da8('0x36')]=_[_0x1da8('0x38')](_0xa146ba['model'],_0xa146ba[_0x1da8('0x34')]);_0x5c38fe[_0x1da8('0x3a')]=_['intersection'](_0xa146ba[_0x1da8('0x37')],qs[_0x1da8('0x39')](_0x13321d['query'][_0x1da8('0x39')]));_0x5c38fe[_0x1da8('0x3a')]=_0x5c38fe['attributes'][_0x1da8('0x3b')]?_0x5c38fe[_0x1da8('0x3a')]:_0xa146ba[_0x1da8('0x37')];_0x5c38fe[_0x1da8('0x3d')]=qs[_0x1da8('0x3e')](_0x13321d[_0x1da8('0x34')][_0x1da8('0x3e')]);_0x5c38fe[_0x1da8('0x3f')]=qs[_0x1da8('0x36')](_[_0x1da8('0x51')](_0x13321d['query'],_0xa146ba[_0x1da8('0x36')]));if(_0x13321d[_0x1da8('0x34')][_0x1da8('0x40')]){_0x5c38fe[_0x1da8('0x3f')]=_['merge'](_0x5c38fe[_0x1da8('0x3f')],{'$or':_[_0x1da8('0x30')](_0x5c38fe[_0x1da8('0x3a')],function(_0x4be3f4){var _0x2a1924={};_0x2a1924[_0x4be3f4]={'$like':'%'+_0x13321d[_0x1da8('0x34')][_0x1da8('0x40')]+'%'};return _0x2a1924;})});}_0x5c38fe=_[_0x1da8('0x49')]({},_0x5c38fe,_0x13321d[_0x1da8('0x4a')]);return _0x5ec2bd[_0x1da8('0x4e')](_0x5c38fe);}})['then'](function(_0xeef582){if(_0xeef582){_0xc24f66=_0xeef582[_0x1da8('0x3b')];if(!_0x13321d['query']['hasOwnProperty']('nolimit')){_0x5c38fe[_0x1da8('0x26')]=qs[_0x1da8('0x26')](_0x13321d[_0x1da8('0x34')]['limit']);_0x5c38fe[_0x1da8('0x24')]=qs[_0x1da8('0x24')](_0x13321d[_0x1da8('0x34')]['offset']);}return _0x5ec2bd[_0x1da8('0x4e')](_0x5c38fe);}})[_0x1da8('0x17')](function(_0xfe1a4f){if(_0xfe1a4f){return _0xfe1a4f?{'count':_0xc24f66,'rows':_0xfe1a4f}:null;}})['then'](respondWithResult(_0x5917dc,null))[_0x1da8('0x45')](handleError(_0x5917dc,null));};exports[_0x1da8('0x52')]=function(_0x89d75d,_0x1196b9,_0xc5f67a){var _0x411e9e={};var _0x54e6a9={};var _0x23ade0;var _0x1511e8;return db[_0x1da8('0x42')][_0x1da8('0x4f')]({'where':{'id':_0x89d75d[_0x1da8('0x47')]['id']}})['then'](handleEntityNotFound(_0x1196b9,null))[_0x1da8('0x17')](function(_0x4d9c40){if(_0x4d9c40){_0x23ade0=_0x4d9c40;_0x54e6a9[_0x1da8('0x37')]=_[_0x1da8('0x35')](db[_0x1da8('0x50')]['rawAttributes']);_0x54e6a9[_0x1da8('0x34')]=_[_0x1da8('0x35')](_0x89d75d[_0x1da8('0x34')]);_0x54e6a9[_0x1da8('0x36')]=_[_0x1da8('0x38')](_0x54e6a9[_0x1da8('0x37')],_0x54e6a9[_0x1da8('0x34')]);_0x411e9e[_0x1da8('0x3a')]=_[_0x1da8('0x38')](_0x54e6a9[_0x1da8('0x37')],qs[_0x1da8('0x39')](_0x89d75d[_0x1da8('0x34')][_0x1da8('0x39')]));_0x411e9e[_0x1da8('0x3a')]=_0x411e9e[_0x1da8('0x3a')][_0x1da8('0x3b')]?_0x411e9e[_0x1da8('0x3a')]:_0x54e6a9[_0x1da8('0x37')];_0x411e9e['order']=qs[_0x1da8('0x3e')](_0x89d75d['query'][_0x1da8('0x3e')]);_0x411e9e[_0x1da8('0x3f')]=qs[_0x1da8('0x36')](_[_0x1da8('0x51')](_0x89d75d[_0x1da8('0x34')],_0x54e6a9['filters']));if(_0x89d75d['query']['filter']){_0x411e9e['where']=_[_0x1da8('0x49')](_0x411e9e[_0x1da8('0x3f')],{'$or':_[_0x1da8('0x30')](_0x411e9e['attributes'],function(_0x15823b){var _0x5f1d2a={};_0x5f1d2a[_0x15823b]={'$like':'%'+_0x89d75d[_0x1da8('0x34')][_0x1da8('0x40')]+'%'};return _0x5f1d2a;})});}_0x411e9e=_[_0x1da8('0x49')]({},_0x411e9e,_0x89d75d['options']);return _0x23ade0[_0x1da8('0x52')](_0x411e9e);}})['then'](function(_0xb2d9bd){if(_0xb2d9bd){_0x1511e8=_0xb2d9bd[_0x1da8('0x3b')];if(!_0x89d75d[_0x1da8('0x34')][_0x1da8('0x3c')]('nolimit')){_0x411e9e[_0x1da8('0x26')]=qs[_0x1da8('0x26')](_0x89d75d[_0x1da8('0x34')][_0x1da8('0x26')]);_0x411e9e['offset']=qs[_0x1da8('0x24')](_0x89d75d[_0x1da8('0x34')]['offset']);}return _0x23ade0[_0x1da8('0x52')](_0x411e9e);}})[_0x1da8('0x17')](function(_0x5c2b0a){if(_0x5c2b0a){return _0x5c2b0a?{'count':_0x1511e8,'rows':_0x5c2b0a}:null;}})[_0x1da8('0x17')](respondWithResult(_0x1196b9,null))[_0x1da8('0x45')](handleError(_0x1196b9,null));};exports[_0x1da8('0x53')]=function(_0x15c0ae,_0x1b2912,_0x372f9b){var _0x5bfabe={};var _0x3956dc={};var _0x57bcae;var _0x2e8a0f;return db[_0x1da8('0x42')][_0x1da8('0x4f')]({'where':{'id':_0x15c0ae['params']['id']}})[_0x1da8('0x17')](handleEntityNotFound(_0x1b2912,null))[_0x1da8('0x17')](function(_0x3cd703){if(_0x3cd703){_0x57bcae=_0x3cd703;_0x3956dc[_0x1da8('0x37')]=_[_0x1da8('0x35')](db[_0x1da8('0x50')][_0x1da8('0x31')]);_0x3956dc[_0x1da8('0x34')]=_['keys'](_0x15c0ae[_0x1da8('0x34')]);_0x3956dc[_0x1da8('0x36')]=_['intersection'](_0x3956dc[_0x1da8('0x37')],_0x3956dc[_0x1da8('0x34')]);_0x5bfabe[_0x1da8('0x3a')]=_[_0x1da8('0x38')](_0x3956dc[_0x1da8('0x37')],qs[_0x1da8('0x39')](_0x15c0ae[_0x1da8('0x34')][_0x1da8('0x39')]));_0x5bfabe[_0x1da8('0x3a')]=_0x5bfabe[_0x1da8('0x3a')][_0x1da8('0x3b')]?_0x5bfabe[_0x1da8('0x3a')]:_0x3956dc[_0x1da8('0x37')];_0x5bfabe[_0x1da8('0x3d')]=qs['sort'](_0x15c0ae['query'][_0x1da8('0x3e')]);_0x5bfabe[_0x1da8('0x3f')]=qs[_0x1da8('0x36')](_[_0x1da8('0x51')](_0x15c0ae['query'],_0x3956dc['filters']));if(_0x15c0ae[_0x1da8('0x34')]['filter']){_0x5bfabe['where']=_[_0x1da8('0x49')](_0x5bfabe[_0x1da8('0x3f')],{'$or':_[_0x1da8('0x30')](_0x5bfabe[_0x1da8('0x3a')],function(_0x4c70ff){var _0x11c659={};_0x11c659[_0x4c70ff]={'$like':'%'+_0x15c0ae['query'][_0x1da8('0x40')]+'%'};return _0x11c659;})});}_0x5bfabe=_[_0x1da8('0x49')]({},_0x5bfabe,_0x15c0ae[_0x1da8('0x4a')]);return _0x57bcae['getDescriptions'](_0x5bfabe);}})[_0x1da8('0x17')](function(_0x1a0c12){if(_0x1a0c12){_0x2e8a0f=_0x1a0c12[_0x1da8('0x3b')];if(!_0x15c0ae[_0x1da8('0x34')][_0x1da8('0x3c')](_0x1da8('0x54'))){_0x5bfabe['limit']=qs['limit'](_0x15c0ae[_0x1da8('0x34')][_0x1da8('0x26')]);_0x5bfabe[_0x1da8('0x24')]=qs[_0x1da8('0x24')](_0x15c0ae['query']['offset']);}return _0x57bcae[_0x1da8('0x53')](_0x5bfabe);}})[_0x1da8('0x17')](function(_0x5aa95c){if(_0x5aa95c){return _0x5aa95c?{'count':_0x2e8a0f,'rows':_0x5aa95c}:null;}})[_0x1da8('0x17')](respondWithResult(_0x1b2912,null))[_0x1da8('0x45')](handleError(_0x1b2912,null));};exports[_0x1da8('0x55')]=function(_0x293c26,_0x52f677,_0x36fac5){var _0x2d2bbc={};var _0x6208c2={};var _0x2b0676;var _0x32d180;return db['DeskConfiguration'][_0x1da8('0x4f')]({'where':{'id':_0x293c26[_0x1da8('0x47')]['id']}})[_0x1da8('0x17')](handleEntityNotFound(_0x52f677,null))['then'](function(_0x363674){if(_0x363674){_0x2b0676=_0x363674;_0x6208c2[_0x1da8('0x37')]=_[_0x1da8('0x35')](db[_0x1da8('0x56')][_0x1da8('0x31')]);_0x6208c2[_0x1da8('0x34')]=_['keys'](_0x293c26[_0x1da8('0x34')]);_0x6208c2['filters']=_[_0x1da8('0x38')](_0x6208c2[_0x1da8('0x37')],_0x6208c2[_0x1da8('0x34')]);_0x2d2bbc[_0x1da8('0x3a')]=_['intersection'](_0x6208c2[_0x1da8('0x37')],qs[_0x1da8('0x39')](_0x293c26[_0x1da8('0x34')][_0x1da8('0x39')]));_0x2d2bbc[_0x1da8('0x3a')]=_0x2d2bbc[_0x1da8('0x3a')][_0x1da8('0x3b')]?_0x2d2bbc[_0x1da8('0x3a')]:_0x6208c2['model'];_0x2d2bbc['order']=qs[_0x1da8('0x3e')](_0x293c26['query'][_0x1da8('0x3e')]);_0x2d2bbc['where']=qs['filters'](_[_0x1da8('0x51')](_0x293c26['query'],_0x6208c2[_0x1da8('0x36')]));if(_0x293c26[_0x1da8('0x34')][_0x1da8('0x40')]){_0x2d2bbc[_0x1da8('0x3f')]=_[_0x1da8('0x49')](_0x2d2bbc[_0x1da8('0x3f')],{'$or':_[_0x1da8('0x30')](_0x2d2bbc[_0x1da8('0x3a')],function(_0x59adc0){var _0x5857b2={};_0x5857b2[_0x59adc0]={'$like':'%'+_0x293c26[_0x1da8('0x34')][_0x1da8('0x40')]+'%'};return _0x5857b2;})});}_0x2d2bbc=_[_0x1da8('0x49')]({},_0x2d2bbc,_0x293c26['options']);return _0x2b0676['getTags'](_0x2d2bbc);}})[_0x1da8('0x17')](function(_0x2623ac){if(_0x2623ac){_0x32d180=_0x2623ac['length'];if(!_0x293c26[_0x1da8('0x34')]['hasOwnProperty'](_0x1da8('0x54'))){_0x2d2bbc[_0x1da8('0x26')]=qs[_0x1da8('0x26')](_0x293c26['query'][_0x1da8('0x26')]);_0x2d2bbc[_0x1da8('0x24')]=qs[_0x1da8('0x24')](_0x293c26[_0x1da8('0x34')][_0x1da8('0x24')]);}return _0x2b0676[_0x1da8('0x55')](_0x2d2bbc);}})[_0x1da8('0x17')](function(_0x744b6d){if(_0x744b6d){return _0x744b6d?{'count':_0x32d180,'rows':_0x744b6d}:null;}})['then'](respondWithResult(_0x52f677,null))['catch'](handleError(_0x52f677,null));};exports[_0x1da8('0x57')]=function(_0x1e59e4,_0x4d7d3f,_0x5d25a8){if(_0x1e59e4[_0x1da8('0x4d')]['id']){delete _0x1e59e4['body']['id'];}return db[_0x1da8('0x42')][_0x1da8('0x4f')]({'where':{'id':_0x1e59e4[_0x1da8('0x47')]['id']}})[_0x1da8('0x17')](handleEntityNotFound(_0x4d7d3f,null))[_0x1da8('0x17')](function(_0xac66e){if(_0xac66e){return _0xac66e[_0x1da8('0x57')](_0x1e59e4[_0x1da8('0x4d')][_0x1da8('0x58')]||[]);}return null;})[_0x1da8('0x17')](respondWithResult(_0x4d7d3f,null))[_0x1da8('0x45')](handleError(_0x4d7d3f,null));};
\ No newline at end of file
+var _0xdf28=['getFields','getSubjects','findOne','DeskField','getDescriptions','hasOwnProperty','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','stack','name','index','DeskConfiguration','rawAttributes','fieldName','key','model','map','keys','filters','intersection','attributes','fields','length','nolimit','query','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params'];(function(_0x4eda24,_0x407afa){var _0x5300cf=function(_0x3b3e6f){while(--_0x3b3e6f){_0x4eda24['push'](_0x4eda24['shift']());}};_0x5300cf(++_0x407afa);}(_0xdf28,0x1e5));var _0x8df2=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xdf28[_0x4914ad];return _0x3cd61f;};'use strict';var emlformat=require(_0x8df2('0x0'));var rimraf=require(_0x8df2('0x1'));var zipdir=require(_0x8df2('0x2'));var jsonpatch=require(_0x8df2('0x3'));var rp=require('request-promise');var moment=require(_0x8df2('0x4'));var BPromise=require(_0x8df2('0x5'));var Mustache=require(_0x8df2('0x6'));var util=require('util');var path=require(_0x8df2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8df2('0x8'));var fs=require('fs');var fs_extra=require(_0x8df2('0x9'));var _=require(_0x8df2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8df2('0xb'));var deskjs=require(_0x8df2('0xc'));var toCsv=require(_0x8df2('0xd'));var querystring=require(_0x8df2('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8df2('0xf'));var qs=require(_0x8df2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8df2('0x11'));var logger=require(_0x8df2('0x12'))(_0x8df2('0x13'));var utils=require(_0x8df2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8df2('0x15'));var db=require(_0x8df2('0x16'))['db'];var jayson=require(_0x8df2('0x17'));var client=jayson[_0x8df2('0x18')][_0x8df2('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x232140,_0x5a7ddd,_0x1921c9,_0x546ddb){return new BPromise(function(_0x449bca,_0x2f5b57){var _0x1aa2d0=_0x546ddb||client;return _0x1aa2d0[_0x8df2('0x1a')](_0x232140,_0x1921c9)[_0x8df2('0x1b')](function(_0x35f774){logger[_0x8df2('0x1c')](_0x8df2('0x1d'),_0x5a7ddd,_0x8df2('0x1e'));logger[_0x8df2('0x1f')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5a7ddd,_0x8df2('0x1e'),JSON[_0x8df2('0x20')](_0x35f774));if(_0x35f774[_0x8df2('0x21')]){if(_0x35f774[_0x8df2('0x21')]['code']===0x1f4){logger[_0x8df2('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x5a7ddd,_0x35f774[_0x8df2('0x21')][_0x8df2('0x22')]);return _0x2f5b57(_0x35f774[_0x8df2('0x21')]['message']);}logger[_0x8df2('0x21')](_0x8df2('0x1d'),_0x5a7ddd,_0x35f774[_0x8df2('0x21')][_0x8df2('0x22')]);return _0x449bca(_0x35f774[_0x8df2('0x21')][_0x8df2('0x22')]);}else{logger[_0x8df2('0x1c')]('DeskConfiguration,\x20%s,\x20%s',_0x5a7ddd,_0x8df2('0x1e'));_0x449bca(_0x35f774[_0x8df2('0x23')][_0x8df2('0x22')]);}})['catch'](function(_0x54e24){logger['error'](_0x8df2('0x1d'),_0x5a7ddd,_0x54e24);_0x2f5b57(_0x54e24);});});}function respondWithStatusCode(_0x140ed9,_0x447db6){_0x447db6=_0x447db6||0xcc;return function(_0x1d984a){if(_0x1d984a){return _0x140ed9[_0x8df2('0x24')](_0x447db6);}return _0x140ed9[_0x8df2('0x25')](_0x447db6)['end']();};}function respondWithResult(_0xbbcf43,_0x2a4e9f){_0x2a4e9f=_0x2a4e9f||0xc8;return function(_0x1dcc71){if(_0x1dcc71){return _0xbbcf43[_0x8df2('0x25')](_0x2a4e9f)['json'](_0x1dcc71);}};}function respondWithFilteredResult(_0x395839,_0x2e55ae){return function(_0x56e7ee){if(_0x56e7ee){var _0x33d64d=typeof _0x2e55ae['offset']===_0x8df2('0x26')&&typeof _0x2e55ae[_0x8df2('0x27')]===_0x8df2('0x26');var _0x29c403=_0x56e7ee[_0x8df2('0x28')];var _0x208039=_0x33d64d?0x0:_0x2e55ae[_0x8df2('0x29')];var _0x5c4a74=_0x33d64d?_0x56e7ee[_0x8df2('0x28')]:_0x2e55ae[_0x8df2('0x29')]+_0x2e55ae[_0x8df2('0x27')];var _0x1b83cf;if(_0x5c4a74>=_0x29c403){_0x5c4a74=_0x29c403;_0x1b83cf=0xc8;}else{_0x1b83cf=0xce;}_0x395839[_0x8df2('0x25')](_0x1b83cf);return _0x395839[_0x8df2('0x2a')](_0x8df2('0x2b'),_0x208039+'-'+_0x5c4a74+'/'+_0x29c403)[_0x8df2('0x2c')](_0x56e7ee);}return null;};}function patchUpdates(_0x3257b1){return function(_0x24df90){try{jsonpatch[_0x8df2('0x2d')](_0x24df90,_0x3257b1,!![]);}catch(_0x42f971){return BPromise[_0x8df2('0x2e')](_0x42f971);}return _0x24df90['save']();};}function saveUpdates(_0x38ce0a,_0x21e2f4){return function(_0x23cc7e){if(_0x23cc7e){return _0x23cc7e[_0x8df2('0x2f')](_0x38ce0a)[_0x8df2('0x1b')](function(_0x48b9b4){return _0x48b9b4;});}return null;};}function removeEntity(_0x256d20,_0x4fd014){return function(_0x1293c1){if(_0x1293c1){return _0x1293c1[_0x8df2('0x30')]()[_0x8df2('0x1b')](function(){_0x256d20[_0x8df2('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4850df,_0x86f87b){return function(_0xe39487){if(!_0xe39487){_0x4850df['sendStatus'](0x194);}return _0xe39487;};}function handleError(_0x5c40e4,_0x3e64e9){_0x3e64e9=_0x3e64e9||0x1f4;return function(_0x1613fd){logger[_0x8df2('0x21')](_0x1613fd[_0x8df2('0x31')]);if(_0x1613fd[_0x8df2('0x32')]){delete _0x1613fd[_0x8df2('0x32')];}_0x5c40e4['status'](_0x3e64e9)['send'](_0x1613fd);};}exports[_0x8df2('0x33')]=function(_0x4abbee,_0x448726){var _0x471c97={},_0x2b4aee={},_0x1def4c={'count':0x0,'rows':[]};var _0x2b951e=_['map'](db[_0x8df2('0x34')][_0x8df2('0x35')],function(_0x511cdd){return{'name':_0x511cdd[_0x8df2('0x36')],'type':_0x511cdd['type'][_0x8df2('0x37')]};});_0x2b4aee[_0x8df2('0x38')]=_[_0x8df2('0x39')](_0x2b951e,'name');_0x2b4aee['query']=_[_0x8df2('0x3a')](_0x4abbee['query']);_0x2b4aee[_0x8df2('0x3b')]=_[_0x8df2('0x3c')](_0x2b4aee['model'],_0x2b4aee['query']);_0x471c97[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x2b4aee[_0x8df2('0x38')],qs[_0x8df2('0x3e')](_0x4abbee['query'][_0x8df2('0x3e')]));_0x471c97[_0x8df2('0x3d')]=_0x471c97[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x471c97[_0x8df2('0x3d')]:_0x2b4aee['model'];if(!_0x4abbee['query']['hasOwnProperty'](_0x8df2('0x40'))){_0x471c97[_0x8df2('0x27')]=qs['limit'](_0x4abbee[_0x8df2('0x41')][_0x8df2('0x27')]);_0x471c97[_0x8df2('0x29')]=qs['offset'](_0x4abbee[_0x8df2('0x41')][_0x8df2('0x29')]);}_0x471c97[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x4abbee['query'][_0x8df2('0x43')]);_0x471c97['where']=qs[_0x8df2('0x3b')](_[_0x8df2('0x44')](_0x4abbee[_0x8df2('0x41')],_0x2b4aee[_0x8df2('0x3b')]),_0x2b951e);if(_0x4abbee[_0x8df2('0x41')]['filter']){_0x471c97[_0x8df2('0x45')]=_[_0x8df2('0x46')](_0x471c97[_0x8df2('0x45')],{'$or':_[_0x8df2('0x39')](_0x2b951e,function(_0x272943){if(_0x272943[_0x8df2('0x47')]!==_0x8df2('0x48')){var _0x26c02a={};_0x26c02a[_0x272943[_0x8df2('0x32')]]={'$like':'%'+_0x4abbee['query'][_0x8df2('0x49')]+'%'};return _0x26c02a;}})});}_0x471c97=_[_0x8df2('0x46')]({},_0x471c97,_0x4abbee[_0x8df2('0x4a')]);var _0x5ab8d5={'where':_0x471c97[_0x8df2('0x45')]};return db['DeskConfiguration'][_0x8df2('0x28')](_0x5ab8d5)[_0x8df2('0x1b')](function(_0x8b592c){_0x1def4c[_0x8df2('0x28')]=_0x8b592c;if(_0x4abbee[_0x8df2('0x41')][_0x8df2('0x4b')]){_0x471c97[_0x8df2('0x4c')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x8df2('0x4d')](_0x471c97);})[_0x8df2('0x1b')](function(_0x5c4c64){_0x1def4c[_0x8df2('0x4e')]=_0x5c4c64;return _0x1def4c;})[_0x8df2('0x1b')](respondWithFilteredResult(_0x448726,_0x471c97))[_0x8df2('0x4f')](handleError(_0x448726,null));};exports[_0x8df2('0x50')]=function(_0x195a57,_0x536530){var _0x2cfa30={'raw':![],'where':{'id':_0x195a57['params']['id']}},_0x5904cd={};_0x5904cd[_0x8df2('0x38')]=_[_0x8df2('0x3a')](db['DeskConfiguration'][_0x8df2('0x35')]);_0x5904cd[_0x8df2('0x41')]=_[_0x8df2('0x3a')](_0x195a57[_0x8df2('0x41')]);_0x5904cd[_0x8df2('0x3b')]=_[_0x8df2('0x3c')](_0x5904cd[_0x8df2('0x38')],_0x5904cd[_0x8df2('0x41')]);_0x2cfa30[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x5904cd[_0x8df2('0x38')],qs['fields'](_0x195a57['query']['fields']));_0x2cfa30[_0x8df2('0x3d')]=_0x2cfa30[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x2cfa30[_0x8df2('0x3d')]:_0x5904cd[_0x8df2('0x38')];if(_0x195a57[_0x8df2('0x41')]['includeAll']){_0x2cfa30[_0x8df2('0x4c')]=[{'all':!![]}];}_0x2cfa30=_[_0x8df2('0x46')]({},_0x2cfa30,_0x195a57['options']);return db[_0x8df2('0x34')][_0x8df2('0x51')](_0x2cfa30)[_0x8df2('0x1b')](handleEntityNotFound(_0x536530,null))[_0x8df2('0x1b')](respondWithResult(_0x536530,null))[_0x8df2('0x4f')](handleError(_0x536530,null));};exports[_0x8df2('0x52')]=function(_0x25d854,_0x9c75f){return db[_0x8df2('0x34')]['create'](_0x25d854[_0x8df2('0x53')],{})[_0x8df2('0x1b')](respondWithResult(_0x9c75f,0xc9))[_0x8df2('0x4f')](handleError(_0x9c75f,null));};exports[_0x8df2('0x2f')]=function(_0x120a8e,_0x2c314a){if(_0x120a8e[_0x8df2('0x53')]['id']){delete _0x120a8e[_0x8df2('0x53')]['id'];}return db[_0x8df2('0x34')]['find']({'where':{'id':_0x120a8e[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x2c314a,null))['then'](saveUpdates(_0x120a8e[_0x8df2('0x53')],null))['then'](respondWithResult(_0x2c314a,null))[_0x8df2('0x4f')](handleError(_0x2c314a,null));};exports[_0x8df2('0x30')]=function(_0x651ed2,_0x5dfcb6){return db['DeskConfiguration'][_0x8df2('0x51')]({'where':{'id':_0x651ed2['params']['id']}})['then'](handleEntityNotFound(_0x5dfcb6,null))[_0x8df2('0x1b')](removeEntity(_0x5dfcb6,null))[_0x8df2('0x4f')](handleError(_0x5dfcb6,null));};exports[_0x8df2('0x55')]=function(_0x350cb9,_0x5e5ae9,_0x217978){var _0x393cf7={};var _0xdcd507={};var _0x5403c4;var _0x16fe75;return db[_0x8df2('0x34')]['findOne']({'where':{'id':_0x350cb9['params']['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x5e5ae9,null))[_0x8df2('0x1b')](function(_0x411967){if(_0x411967){_0x5403c4=_0x411967;_0xdcd507[_0x8df2('0x38')]=_['keys'](db['DeskField'][_0x8df2('0x35')]);_0xdcd507['query']=_['keys'](_0x350cb9[_0x8df2('0x41')]);_0xdcd507['filters']=_[_0x8df2('0x3c')](_0xdcd507['model'],_0xdcd507[_0x8df2('0x41')]);_0x393cf7[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0xdcd507[_0x8df2('0x38')],qs[_0x8df2('0x3e')](_0x350cb9[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x393cf7[_0x8df2('0x3d')]=_0x393cf7[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x393cf7[_0x8df2('0x3d')]:_0xdcd507[_0x8df2('0x38')];_0x393cf7[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x350cb9['query'][_0x8df2('0x43')]);_0x393cf7[_0x8df2('0x45')]=qs[_0x8df2('0x3b')](_['pick'](_0x350cb9['query'],_0xdcd507[_0x8df2('0x3b')]));if(_0x350cb9[_0x8df2('0x41')]['filter']){_0x393cf7[_0x8df2('0x45')]=_[_0x8df2('0x46')](_0x393cf7['where'],{'$or':_[_0x8df2('0x39')](_0x393cf7[_0x8df2('0x3d')],function(_0x31f9b6){var _0x88565a={};_0x88565a[_0x31f9b6]={'$like':'%'+_0x350cb9[_0x8df2('0x41')][_0x8df2('0x49')]+'%'};return _0x88565a;})});}_0x393cf7=_[_0x8df2('0x46')]({},_0x393cf7,_0x350cb9[_0x8df2('0x4a')]);return _0x5403c4['getFields'](_0x393cf7);}})[_0x8df2('0x1b')](function(_0x29889f){if(_0x29889f){_0x16fe75=_0x29889f[_0x8df2('0x3f')];if(!_0x350cb9['query']['hasOwnProperty'](_0x8df2('0x40'))){_0x393cf7[_0x8df2('0x27')]=qs[_0x8df2('0x27')](_0x350cb9[_0x8df2('0x41')][_0x8df2('0x27')]);_0x393cf7[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x350cb9[_0x8df2('0x41')][_0x8df2('0x29')]);}return _0x5403c4[_0x8df2('0x55')](_0x393cf7);}})[_0x8df2('0x1b')](function(_0x528d82){if(_0x528d82){return _0x528d82?{'count':_0x16fe75,'rows':_0x528d82}:null;}})[_0x8df2('0x1b')](respondWithResult(_0x5e5ae9,null))[_0x8df2('0x4f')](handleError(_0x5e5ae9,null));};exports[_0x8df2('0x56')]=function(_0x58d87d,_0x28a961,_0x567748){var _0x967884={};var _0x522e52={};var _0x4cbdfb;var _0x443217;return db['DeskConfiguration'][_0x8df2('0x57')]({'where':{'id':_0x58d87d[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x28a961,null))[_0x8df2('0x1b')](function(_0x46e5a6){if(_0x46e5a6){_0x4cbdfb=_0x46e5a6;_0x522e52[_0x8df2('0x38')]=_[_0x8df2('0x3a')](db[_0x8df2('0x58')][_0x8df2('0x35')]);_0x522e52[_0x8df2('0x41')]=_['keys'](_0x58d87d[_0x8df2('0x41')]);_0x522e52[_0x8df2('0x3b')]=_[_0x8df2('0x3c')](_0x522e52[_0x8df2('0x38')],_0x522e52[_0x8df2('0x41')]);_0x967884[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x522e52[_0x8df2('0x38')],qs['fields'](_0x58d87d[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x967884[_0x8df2('0x3d')]=_0x967884['attributes']['length']?_0x967884['attributes']:_0x522e52['model'];_0x967884[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x58d87d[_0x8df2('0x41')]['sort']);_0x967884[_0x8df2('0x45')]=qs[_0x8df2('0x3b')](_[_0x8df2('0x44')](_0x58d87d[_0x8df2('0x41')],_0x522e52[_0x8df2('0x3b')]));if(_0x58d87d[_0x8df2('0x41')][_0x8df2('0x49')]){_0x967884[_0x8df2('0x45')]=_['merge'](_0x967884['where'],{'$or':_['map'](_0x967884[_0x8df2('0x3d')],function(_0xb66d2a){var _0x3e5891={};_0x3e5891[_0xb66d2a]={'$like':'%'+_0x58d87d[_0x8df2('0x41')]['filter']+'%'};return _0x3e5891;})});}_0x967884=_[_0x8df2('0x46')]({},_0x967884,_0x58d87d[_0x8df2('0x4a')]);return _0x4cbdfb[_0x8df2('0x56')](_0x967884);}})[_0x8df2('0x1b')](function(_0x3709bc){if(_0x3709bc){_0x443217=_0x3709bc[_0x8df2('0x3f')];if(!_0x58d87d[_0x8df2('0x41')]['hasOwnProperty'](_0x8df2('0x40'))){_0x967884[_0x8df2('0x27')]=qs[_0x8df2('0x27')](_0x58d87d[_0x8df2('0x41')][_0x8df2('0x27')]);_0x967884[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x58d87d[_0x8df2('0x41')]['offset']);}return _0x4cbdfb['getSubjects'](_0x967884);}})[_0x8df2('0x1b')](function(_0x26f2b5){if(_0x26f2b5){return _0x26f2b5?{'count':_0x443217,'rows':_0x26f2b5}:null;}})['then'](respondWithResult(_0x28a961,null))[_0x8df2('0x4f')](handleError(_0x28a961,null));};exports[_0x8df2('0x59')]=function(_0x3f19a4,_0x237e87,_0x2c5717){var _0x2d0cc8={};var _0x2d5885={};var _0x24818e;var _0x48da3f;return db[_0x8df2('0x34')][_0x8df2('0x57')]({'where':{'id':_0x3f19a4[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x237e87,null))['then'](function(_0x4c7954){if(_0x4c7954){_0x24818e=_0x4c7954;_0x2d5885['model']=_[_0x8df2('0x3a')](db['DeskField'][_0x8df2('0x35')]);_0x2d5885[_0x8df2('0x41')]=_[_0x8df2('0x3a')](_0x3f19a4[_0x8df2('0x41')]);_0x2d5885['filters']=_[_0x8df2('0x3c')](_0x2d5885[_0x8df2('0x38')],_0x2d5885[_0x8df2('0x41')]);_0x2d0cc8['attributes']=_[_0x8df2('0x3c')](_0x2d5885[_0x8df2('0x38')],qs['fields'](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x2d0cc8[_0x8df2('0x3d')]=_0x2d0cc8[_0x8df2('0x3d')][_0x8df2('0x3f')]?_0x2d0cc8[_0x8df2('0x3d')]:_0x2d5885[_0x8df2('0x38')];_0x2d0cc8[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x43')]);_0x2d0cc8[_0x8df2('0x45')]=qs[_0x8df2('0x3b')](_[_0x8df2('0x44')](_0x3f19a4[_0x8df2('0x41')],_0x2d5885[_0x8df2('0x3b')]));if(_0x3f19a4['query'][_0x8df2('0x49')]){_0x2d0cc8[_0x8df2('0x45')]=_['merge'](_0x2d0cc8[_0x8df2('0x45')],{'$or':_[_0x8df2('0x39')](_0x2d0cc8['attributes'],function(_0x12482b){var _0x3b3b9c={};_0x3b3b9c[_0x12482b]={'$like':'%'+_0x3f19a4[_0x8df2('0x41')]['filter']+'%'};return _0x3b3b9c;})});}_0x2d0cc8=_[_0x8df2('0x46')]({},_0x2d0cc8,_0x3f19a4['options']);return _0x24818e[_0x8df2('0x59')](_0x2d0cc8);}})[_0x8df2('0x1b')](function(_0x3d2ac0){if(_0x3d2ac0){_0x48da3f=_0x3d2ac0['length'];if(!_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x5a')]('nolimit')){_0x2d0cc8['limit']=qs[_0x8df2('0x27')](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x27')]);_0x2d0cc8[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x3f19a4[_0x8df2('0x41')][_0x8df2('0x29')]);}return _0x24818e['getDescriptions'](_0x2d0cc8);}})['then'](function(_0x112451){if(_0x112451){return _0x112451?{'count':_0x48da3f,'rows':_0x112451}:null;}})[_0x8df2('0x1b')](respondWithResult(_0x237e87,null))[_0x8df2('0x4f')](handleError(_0x237e87,null));};exports[_0x8df2('0x5b')]=function(_0x3a7f93,_0xb1f1e8,_0x1c597e){var _0x64efaa={};var _0x37f0b9={};var _0x5e799a;var _0x5bb750;return db['DeskConfiguration'][_0x8df2('0x57')]({'where':{'id':_0x3a7f93['params']['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0xb1f1e8,null))[_0x8df2('0x1b')](function(_0x58ab1b){if(_0x58ab1b){_0x5e799a=_0x58ab1b;_0x37f0b9[_0x8df2('0x38')]=_[_0x8df2('0x3a')](db[_0x8df2('0x5c')][_0x8df2('0x35')]);_0x37f0b9[_0x8df2('0x41')]=_[_0x8df2('0x3a')](_0x3a7f93[_0x8df2('0x41')]);_0x37f0b9[_0x8df2('0x3b')]=_['intersection'](_0x37f0b9[_0x8df2('0x38')],_0x37f0b9[_0x8df2('0x41')]);_0x64efaa[_0x8df2('0x3d')]=_[_0x8df2('0x3c')](_0x37f0b9[_0x8df2('0x38')],qs[_0x8df2('0x3e')](_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x3e')]));_0x64efaa['attributes']=_0x64efaa['attributes'][_0x8df2('0x3f')]?_0x64efaa[_0x8df2('0x3d')]:_0x37f0b9[_0x8df2('0x38')];_0x64efaa[_0x8df2('0x42')]=qs[_0x8df2('0x43')](_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x43')]);_0x64efaa[_0x8df2('0x45')]=qs['filters'](_[_0x8df2('0x44')](_0x3a7f93['query'],_0x37f0b9[_0x8df2('0x3b')]));if(_0x3a7f93['query'][_0x8df2('0x49')]){_0x64efaa[_0x8df2('0x45')]=_[_0x8df2('0x46')](_0x64efaa[_0x8df2('0x45')],{'$or':_['map'](_0x64efaa[_0x8df2('0x3d')],function(_0x5ca7a4){var _0x436d5d={};_0x436d5d[_0x5ca7a4]={'$like':'%'+_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x49')]+'%'};return _0x436d5d;})});}_0x64efaa=_[_0x8df2('0x46')]({},_0x64efaa,_0x3a7f93['options']);return _0x5e799a['getTags'](_0x64efaa);}})[_0x8df2('0x1b')](function(_0x2b612a){if(_0x2b612a){_0x5bb750=_0x2b612a[_0x8df2('0x3f')];if(!_0x3a7f93['query']['hasOwnProperty'](_0x8df2('0x40'))){_0x64efaa[_0x8df2('0x27')]=qs[_0x8df2('0x27')](_0x3a7f93['query'][_0x8df2('0x27')]);_0x64efaa[_0x8df2('0x29')]=qs[_0x8df2('0x29')](_0x3a7f93[_0x8df2('0x41')][_0x8df2('0x29')]);}return _0x5e799a[_0x8df2('0x5b')](_0x64efaa);}})['then'](function(_0x4d0e03){if(_0x4d0e03){return _0x4d0e03?{'count':_0x5bb750,'rows':_0x4d0e03}:null;}})['then'](respondWithResult(_0xb1f1e8,null))['catch'](handleError(_0xb1f1e8,null));};exports[_0x8df2('0x5d')]=function(_0x107351,_0x29e069,_0x2949bc){if(_0x107351[_0x8df2('0x53')]['id']){delete _0x107351[_0x8df2('0x53')]['id'];}return db[_0x8df2('0x34')][_0x8df2('0x57')]({'where':{'id':_0x107351[_0x8df2('0x54')]['id']}})[_0x8df2('0x1b')](handleEntityNotFound(_0x29e069,null))[_0x8df2('0x1b')](function(_0x1dcaea){if(_0x1dcaea){return _0x1dcaea[_0x8df2('0x5d')](_0x107351[_0x8df2('0x53')][_0x8df2('0x5e')]||[]);}return null;})['then'](respondWithResult(_0x29e069,null))['catch'](handleError(_0x29e069,null));};
\ No newline at end of file
index 88ac4f9..bd4dd08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0047=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x20dbe3,_0x2cc5b3){var _0x57b693=function(_0x462771){while(--_0x462771){_0x20dbe3['push'](_0x20dbe3['shift']());}};_0x57b693(++_0x2cc5b3);}(_0x0047,0x197));var _0x7004=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x0047[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var logger=require(_0x7004('0x2'))(_0x7004('0x3'));var moment=require(_0x7004('0x4'));var BPromise=require(_0x7004('0x5'));var rp=require(_0x7004('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7004('0x7'));var config=require('../../config/environment');var attributes=require(_0x7004('0x8'));module['exports']=function(_0x21573d,_0x43b60f){return _0x21573d[_0x7004('0x9')](_0x7004('0xa'),attributes,{'tableName':_0x7004('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf60=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash'];(function(_0x5ee24a,_0x1a77ef){var _0x36bbee=function(_0x1bee26){while(--_0x1bee26){_0x5ee24a['push'](_0x5ee24a['shift']());}};_0x36bbee(++_0x1a77ef);}(_0xcf60,0xef));var _0x0cf6=function(_0x1d2793,_0x19d93f){_0x1d2793=_0x1d2793-0x0;var _0x39f938=_0xcf60[_0x1d2793];return _0x39f938;};'use strict';var _=require(_0x0cf6('0x0'));var util=require(_0x0cf6('0x1'));var logger=require(_0x0cf6('0x2'))(_0x0cf6('0x3'));var moment=require(_0x0cf6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cf6('0x5'));var rimraf=require(_0x0cf6('0x6'));var config=require(_0x0cf6('0x7'));var attributes=require(_0x0cf6('0x8'));module[_0x0cf6('0x9')]=function(_0x3b376a,_0x23d569){return _0x3b376a[_0x0cf6('0xa')](_0x0cf6('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9601287..609534a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd664=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','ioredis'];(function(_0x22b327,_0x8b59fa){var _0x5f11d3=function(_0x39d349){while(--_0x39d349){_0x22b327['push'](_0x22b327['shift']());}};_0x5f11d3(++_0x8b59fa);}(_0xd664,0xa5));var _0x4d66=function(_0x1d02fc,_0x24f483){_0x1d02fc=_0x1d02fc-0x0;var _0x159ecc=_0xd664[_0x1d02fc];return _0x159ecc;};'use strict';var _=require(_0x4d66('0x0'));var util=require(_0x4d66('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d66('0x2'));var db=require(_0x4d66('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d66('0x4'))(_0x4d66('0x5'));var config=require(_0x4d66('0x6'));var jayson=require(_0x4d66('0x7'));var client=jayson[_0x4d66('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3853,_0x2b7a3b,_0x2f85c8){return new BPromise(function(_0x5d913c,_0x92cbea){return client[_0x4d66('0x9')](_0x1b3853,_0x2f85c8)[_0x4d66('0xa')](function(_0xcea314){logger[_0x4d66('0xb')](_0x4d66('0xc'),_0x2b7a3b,'request\x20sent');logger[_0x4d66('0xd')](_0x4d66('0xe'),_0x2b7a3b,_0x4d66('0xf'),JSON[_0x4d66('0x10')](_0xcea314));if(_0xcea314[_0x4d66('0x11')]){if(_0xcea314[_0x4d66('0x11')][_0x4d66('0x12')]===0x1f4){logger[_0x4d66('0x11')](_0x4d66('0xc'),_0x2b7a3b,_0xcea314[_0x4d66('0x11')][_0x4d66('0x13')]);return _0x92cbea(_0xcea314[_0x4d66('0x11')][_0x4d66('0x13')]);}logger[_0x4d66('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x2b7a3b,_0xcea314[_0x4d66('0x11')]['message']);return _0x5d913c(_0xcea314[_0x4d66('0x11')][_0x4d66('0x13')]);}else{logger[_0x4d66('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x2b7a3b,_0x4d66('0xf'));_0x5d913c(_0xcea314[_0x4d66('0x14')][_0x4d66('0x13')]);}})['catch'](function(_0xbd27f2){logger[_0x4d66('0x11')](_0x4d66('0xc'),_0x2b7a3b,_0xbd27f2);_0x92cbea(_0xbd27f2);});});}
\ No newline at end of file
+var _0x659c=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x86b6c1,_0x83a6c8){var _0x5f059f=function(_0xce399){while(--_0xce399){_0x86b6c1['push'](_0x86b6c1['shift']());}};_0x5f059f(++_0x83a6c8);}(_0x659c,0x1aa));var _0xc659=function(_0x1a7edf,_0x5c4e04){_0x1a7edf=_0x1a7edf-0x0;var _0x56c1d9=_0x659c[_0x1a7edf];return _0x56c1d9;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc659('0x1'));var rs=require(_0xc659('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc659('0x3'))['db'];var utils=require(_0xc659('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc659('0x5'));var jayson=require(_0xc659('0x6'));var client=jayson[_0xc659('0x7')][_0xc659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15e20b,_0x33e9d9,_0x536208){return new BPromise(function(_0x51b67f,_0x2cc93d){return client['request'](_0x15e20b,_0x536208)['then'](function(_0x4fadc2){logger[_0xc659('0x9')](_0xc659('0xa'),_0x33e9d9,_0xc659('0xb'));logger[_0xc659('0xc')](_0xc659('0xd'),_0x33e9d9,_0xc659('0xb'),JSON[_0xc659('0xe')](_0x4fadc2));if(_0x4fadc2[_0xc659('0xf')]){if(_0x4fadc2['error'][_0xc659('0x10')]===0x1f4){logger[_0xc659('0xf')](_0xc659('0xa'),_0x33e9d9,_0x4fadc2['error']['message']);return _0x2cc93d(_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);}logger['error'](_0xc659('0xa'),_0x33e9d9,_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);return _0x51b67f(_0x4fadc2[_0xc659('0xf')][_0xc659('0x11')]);}else{logger[_0xc659('0x9')](_0xc659('0xa'),_0x33e9d9,_0xc659('0xb'));_0x51b67f(_0x4fadc2[_0xc659('0x12')][_0xc659('0x11')]);}})['catch'](function(_0x272210){logger[_0xc659('0xf')](_0xc659('0xa'),_0x33e9d9,_0x272210);_0x2cc93d(_0x272210);});});}
\ No newline at end of file
index 0eb33af..13a648b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b37=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','util','path','connect-timeout','express'];(function(_0x4313b7,_0x48641c){var _0x57dbbe=function(_0x500936){while(--_0x500936){_0x4313b7['push'](_0x4313b7['shift']());}};_0x57dbbe(++_0x48641c);}(_0x0b37,0x1d7));var _0x70b3=function(_0x1ad95b,_0x2f1a2b){_0x1ad95b=_0x1ad95b-0x0;var _0x20fed6=_0x0b37[_0x1ad95b];return _0x20fed6;};'use strict';var multer=require('multer');var util=require(_0x70b3('0x0'));var path=require(_0x70b3('0x1'));var timeout=require(_0x70b3('0x2'));var express=require(_0x70b3('0x3'));var router=express['Router']();var fs_extra=require(_0x70b3('0x4'));var auth=require(_0x70b3('0x5'));var interaction=require(_0x70b3('0x6'));var config=require(_0x70b3('0x7'));var controller=require(_0x70b3('0x8'));router[_0x70b3('0x9')]('/',auth['isAuthenticated'](),controller[_0x70b3('0xa')]);router['get'](_0x70b3('0xb'),auth[_0x70b3('0xc')](),controller[_0x70b3('0xd')]);router[_0x70b3('0xe')]('/',auth[_0x70b3('0xc')](),controller['create']);router[_0x70b3('0xf')]('/:id',auth[_0x70b3('0xc')](),controller[_0x70b3('0x10')]);router[_0x70b3('0x11')](_0x70b3('0xb'),auth[_0x70b3('0xc')](),controller['destroy']);module[_0x70b3('0x12')]=router;
\ No newline at end of file
+var _0x0f97=['get','/:id','isAuthenticated','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index'];(function(_0x159fe4,_0x5ef1ba){var _0x14a745=function(_0x504bb8){while(--_0x504bb8){_0x159fe4['push'](_0x159fe4['shift']());}};_0x14a745(++_0x5ef1ba);}(_0x0f97,0x196));var _0x70f9=function(_0x37768b,_0xedcc5a){_0x37768b=_0x37768b-0x0;var _0x1f3c43=_0x0f97[_0x37768b];return _0x1f3c43;};'use strict';var multer=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var path=require(_0x70f9('0x2'));var timeout=require(_0x70f9('0x3'));var express=require(_0x70f9('0x4'));var router=express[_0x70f9('0x5')]();var fs_extra=require(_0x70f9('0x6'));var auth=require(_0x70f9('0x7'));var interaction=require(_0x70f9('0x8'));var config=require(_0x70f9('0x9'));var controller=require(_0x70f9('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x70f9('0xb')]);router[_0x70f9('0xc')](_0x70f9('0xd'),auth[_0x70f9('0xe')](),controller['show']);router['post']('/',auth[_0x70f9('0xe')](),controller[_0x70f9('0xf')]);router[_0x70f9('0x10')](_0x70f9('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x70f9('0xe')](),controller[_0x70f9('0x11')]);module[_0x70f9('0x12')]=router;
\ No newline at end of file
index 8388542..c90a2ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e0=['STRING','customVariable','BOOLEAN','exports','string','variable','keyValue','picklist'];(function(_0x1e3dc3,_0x1a7724){var _0x32cef5=function(_0x1b654f){while(--_0x1b654f){_0x1e3dc3['push'](_0x1e3dc3['shift']());}};_0x32cef5(++_0x1a7724);}(_0xc4e0,0x8b));var _0x0c4e=function(_0x31b2b0,_0xa64104){_0x31b2b0=_0x31b2b0-0x0;var _0x59f047=_0xc4e0[_0x31b2b0];return _0x59f047;};'use strict';var Sequelize=require('sequelize');module[_0x0c4e('0x0')]={'type':{'type':Sequelize['ENUM'](_0x0c4e('0x1'),_0x0c4e('0x2'),'customVariable',_0x0c4e('0x3'),_0x0c4e('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0c4e('0x5')]},'key':{'type':Sequelize[_0x0c4e('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x0c4e('0x6'))},'keyContent':{'type':Sequelize[_0x0c4e('0x5')]},'idField':{'type':Sequelize[_0x0c4e('0x5')]},'nameField':{'type':Sequelize[_0x0c4e('0x5')]},'customField':{'type':Sequelize[_0x0c4e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c4e('0x5')]}};
\ No newline at end of file
+var _0x14f0=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports'];(function(_0x28e7e1,_0x45f235){var _0x1d8a9e=function(_0x3e50cc){while(--_0x3e50cc){_0x28e7e1['push'](_0x28e7e1['shift']());}};_0x1d8a9e(++_0x45f235);}(_0x14f0,0x193));var _0x014f=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x14f0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x014f('0x0'));module[_0x014f('0x1')]={'type':{'type':Sequelize[_0x014f('0x2')](_0x014f('0x3'),_0x014f('0x4'),_0x014f('0x5'),_0x014f('0x6'),_0x014f('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x014f('0x8')]},'key':{'type':Sequelize[_0x014f('0x8')]},'keyType':{'type':Sequelize[_0x014f('0x2')](_0x014f('0x3'),'variable',_0x014f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x014f('0x8')]},'nameField':{'type':Sequelize[_0x014f('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x014f('0x8')]}};
\ No newline at end of file
index 233fb5d..f5e10bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a82=['type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','zip-dir','moment','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/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','DeskField','rawAttributes','fieldName'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x2a82,0xb3));var _0x22a8=function(_0x436f6b,_0x2fc4a4){_0x436f6b=_0x436f6b-0x0;var _0x36bc5e=_0x2a82[_0x436f6b];return _0x36bc5e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x22a8('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x22a8('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x22a8('0x2'));var util=require(_0x22a8('0x3'));var path=require(_0x22a8('0x4'));var sox=require(_0x22a8('0x5'));var csv=require('to-csv');var ejs=require(_0x22a8('0x6'));var fs=require('fs');var fs_extra=require(_0x22a8('0x7'));var _=require(_0x22a8('0x8'));var squel=require(_0x22a8('0x9'));var crypto=require(_0x22a8('0xa'));var jsforce=require(_0x22a8('0xb'));var deskjs=require(_0x22a8('0xc'));var toCsv=require(_0x22a8('0xd'));var querystring=require(_0x22a8('0xe'));var Papa=require(_0x22a8('0xf'));var Redis=require(_0x22a8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x22a8('0x11'));var as=require(_0x22a8('0x12'));var hardwareService=require(_0x22a8('0x13'));var logger=require(_0x22a8('0x14'))(_0x22a8('0x15'));var utils=require(_0x22a8('0x16'));var config=require(_0x22a8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x22a8('0x18'))['db'];function respondWithStatusCode(_0x3c298b,_0x1324d5){_0x1324d5=_0x1324d5||0xcc;return function(_0x2110bf){if(_0x2110bf){return _0x3c298b[_0x22a8('0x19')](_0x1324d5);}return _0x3c298b[_0x22a8('0x1a')](_0x1324d5)['end']();};}function respondWithResult(_0x175f8c,_0x1e9619){_0x1e9619=_0x1e9619||0xc8;return function(_0x3a4dea){if(_0x3a4dea){return _0x175f8c['status'](_0x1e9619)[_0x22a8('0x1b')](_0x3a4dea);}};}function respondWithFilteredResult(_0x3dae68,_0x4f6bf9){return function(_0x5edc59){if(_0x5edc59){var _0x5964f1=typeof _0x4f6bf9[_0x22a8('0x1c')]===_0x22a8('0x1d')&&typeof _0x4f6bf9[_0x22a8('0x1e')]==='undefined';var _0x2453cc=_0x5edc59[_0x22a8('0x1f')];var _0x1482ca=_0x5964f1?0x0:_0x4f6bf9[_0x22a8('0x1c')];var _0x23b9bd=_0x5964f1?_0x5edc59[_0x22a8('0x1f')]:_0x4f6bf9[_0x22a8('0x1c')]+_0x4f6bf9[_0x22a8('0x1e')];var _0x33f56a;if(_0x23b9bd>=_0x2453cc){_0x23b9bd=_0x2453cc;_0x33f56a=0xc8;}else{_0x33f56a=0xce;}_0x3dae68[_0x22a8('0x1a')](_0x33f56a);return _0x3dae68[_0x22a8('0x20')](_0x22a8('0x21'),_0x1482ca+'-'+_0x23b9bd+'/'+_0x2453cc)['json'](_0x5edc59);}return null;};}function patchUpdates(_0xac92e0){return function(_0x3f28d1){try{jsonpatch[_0x22a8('0x22')](_0x3f28d1,_0xac92e0,!![]);}catch(_0x50eab1){return BPromise[_0x22a8('0x23')](_0x50eab1);}return _0x3f28d1[_0x22a8('0x24')]();};}function saveUpdates(_0x1bffcc,_0x511b91){return function(_0x272a30){if(_0x272a30){return _0x272a30[_0x22a8('0x25')](_0x1bffcc)[_0x22a8('0x26')](function(_0x540dd7){return _0x540dd7;});}return null;};}function removeEntity(_0x18bade,_0x298b3c){return function(_0x2ff3c9){if(_0x2ff3c9){return _0x2ff3c9[_0x22a8('0x27')]()['then'](function(){_0x18bade['status'](0xcc)[_0x22a8('0x28')]();});}};}function handleEntityNotFound(_0x442e95,_0x27bf34){return function(_0x32eaae){if(!_0x32eaae){_0x442e95[_0x22a8('0x19')](0x194);}return _0x32eaae;};}function handleError(_0x5e21b1,_0x17a8fa){_0x17a8fa=_0x17a8fa||0x1f4;return function(_0x54bad2){logger[_0x22a8('0x29')](_0x54bad2[_0x22a8('0x2a')]);if(_0x54bad2[_0x22a8('0x2b')]){delete _0x54bad2['name'];}_0x5e21b1[_0x22a8('0x1a')](_0x17a8fa)['send'](_0x54bad2);};}exports[_0x22a8('0x2c')]=function(_0x4ea74b,_0x5b3271){var _0x28fba7={},_0x4da764={},_0x1d6e52={'count':0x0,'rows':[]};var _0x51b612=_[_0x22a8('0x2d')](db[_0x22a8('0x2e')][_0x22a8('0x2f')],function(_0x173db9){return{'name':_0x173db9[_0x22a8('0x30')],'type':_0x173db9[_0x22a8('0x31')][_0x22a8('0x32')]};});_0x4da764[_0x22a8('0x33')]=_['map'](_0x51b612,_0x22a8('0x2b'));_0x4da764[_0x22a8('0x34')]=_[_0x22a8('0x35')](_0x4ea74b[_0x22a8('0x34')]);_0x4da764['filters']=_[_0x22a8('0x36')](_0x4da764[_0x22a8('0x33')],_0x4da764[_0x22a8('0x34')]);_0x28fba7['attributes']=_[_0x22a8('0x36')](_0x4da764['model'],qs[_0x22a8('0x37')](_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x37')]));_0x28fba7['attributes']=_0x28fba7[_0x22a8('0x38')]['length']?_0x28fba7[_0x22a8('0x38')]:_0x4da764['model'];if(!_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x39')](_0x22a8('0x3a'))){_0x28fba7['limit']=qs['limit'](_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x1e')]);_0x28fba7[_0x22a8('0x1c')]=qs[_0x22a8('0x1c')](_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x1c')]);}_0x28fba7['order']=qs[_0x22a8('0x3b')](_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x3b')]);_0x28fba7[_0x22a8('0x3c')]=qs[_0x22a8('0x3d')](_[_0x22a8('0x3e')](_0x4ea74b[_0x22a8('0x34')],_0x4da764[_0x22a8('0x3d')]),_0x51b612);if(_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x3f')]){_0x28fba7[_0x22a8('0x3c')]=_[_0x22a8('0x40')](_0x28fba7[_0x22a8('0x3c')],{'$or':_[_0x22a8('0x2d')](_0x51b612,function(_0x3bbd3d){if(_0x3bbd3d[_0x22a8('0x31')]!==_0x22a8('0x41')){var _0x315e3d={};_0x315e3d[_0x3bbd3d['name']]={'$like':'%'+_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x3f')]+'%'};return _0x315e3d;}})});}_0x28fba7=_[_0x22a8('0x40')]({},_0x28fba7,_0x4ea74b[_0x22a8('0x42')]);var _0x55ada0={'where':_0x28fba7['where']};return db[_0x22a8('0x2e')][_0x22a8('0x1f')](_0x55ada0)[_0x22a8('0x26')](function(_0x5b5475){_0x1d6e52[_0x22a8('0x1f')]=_0x5b5475;if(_0x4ea74b[_0x22a8('0x34')][_0x22a8('0x43')]){_0x28fba7[_0x22a8('0x44')]=[{'all':!![]}];}return db['DeskField'][_0x22a8('0x45')](_0x28fba7);})['then'](function(_0x37d992){_0x1d6e52[_0x22a8('0x46')]=_0x37d992;return _0x1d6e52;})[_0x22a8('0x26')](respondWithFilteredResult(_0x5b3271,_0x28fba7))[_0x22a8('0x47')](handleError(_0x5b3271,null));};exports['show']=function(_0x50d13a,_0x2ec42d){var _0xcac0bc={'raw':!![],'where':{'id':_0x50d13a[_0x22a8('0x48')]['id']}},_0xc20f57={};_0xc20f57[_0x22a8('0x33')]=_['keys'](db[_0x22a8('0x2e')]['rawAttributes']);_0xc20f57['query']=_[_0x22a8('0x35')](_0x50d13a[_0x22a8('0x34')]);_0xc20f57[_0x22a8('0x3d')]=_['intersection'](_0xc20f57['model'],_0xc20f57[_0x22a8('0x34')]);_0xcac0bc[_0x22a8('0x38')]=_[_0x22a8('0x36')](_0xc20f57[_0x22a8('0x33')],qs[_0x22a8('0x37')](_0x50d13a[_0x22a8('0x34')][_0x22a8('0x37')]));_0xcac0bc[_0x22a8('0x38')]=_0xcac0bc['attributes']['length']?_0xcac0bc[_0x22a8('0x38')]:_0xc20f57[_0x22a8('0x33')];if(_0x50d13a[_0x22a8('0x34')][_0x22a8('0x43')]){_0xcac0bc[_0x22a8('0x44')]=[{'all':!![]}];}_0xcac0bc=_['merge']({},_0xcac0bc,_0x50d13a[_0x22a8('0x42')]);return db[_0x22a8('0x2e')][_0x22a8('0x49')](_0xcac0bc)[_0x22a8('0x26')](handleEntityNotFound(_0x2ec42d,null))[_0x22a8('0x26')](respondWithResult(_0x2ec42d,null))[_0x22a8('0x47')](handleError(_0x2ec42d,null));};exports[_0x22a8('0x4a')]=function(_0x3bebed,_0x3e1298){return db[_0x22a8('0x2e')][_0x22a8('0x4a')](_0x3bebed[_0x22a8('0x4b')],{})['then'](respondWithResult(_0x3e1298,0xc9))[_0x22a8('0x47')](handleError(_0x3e1298,null));};exports[_0x22a8('0x25')]=function(_0x3da980,_0xd25e2c){if(_0x3da980[_0x22a8('0x4b')]['id']){delete _0x3da980[_0x22a8('0x4b')]['id'];}return db[_0x22a8('0x2e')][_0x22a8('0x49')]({'where':{'id':_0x3da980['params']['id']}})[_0x22a8('0x26')](handleEntityNotFound(_0xd25e2c,null))[_0x22a8('0x26')](saveUpdates(_0x3da980[_0x22a8('0x4b')],null))[_0x22a8('0x26')](respondWithResult(_0xd25e2c,null))['catch'](handleError(_0xd25e2c,null));};exports[_0x22a8('0x27')]=function(_0x4e80cf,_0x566a60){return db[_0x22a8('0x2e')][_0x22a8('0x49')]({'where':{'id':_0x4e80cf[_0x22a8('0x48')]['id']}})[_0x22a8('0x26')](handleEntityNotFound(_0x566a60,null))['then'](removeEntity(_0x566a60,null))[_0x22a8('0x47')](handleError(_0x566a60,null));};
\ No newline at end of file
+var _0x9483=['nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','DeskField','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x468ab2,_0x17feeb){var _0x198ad7=function(_0x1a366c){while(--_0x1a366c){_0x468ab2['push'](_0x468ab2['shift']());}};_0x198ad7(++_0x17feeb);}(_0x9483,0x12e));var _0x3948=function(_0x3623c6,_0xee8f88){_0x3623c6=_0x3623c6-0x0;var _0x5651c2=_0x9483[_0x3623c6];return _0x5651c2;};'use strict';var emlformat=require(_0x3948('0x0'));var rimraf=require(_0x3948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3948('0x2'));var rp=require(_0x3948('0x3'));var moment=require(_0x3948('0x4'));var BPromise=require(_0x3948('0x5'));var Mustache=require('mustache');var util=require(_0x3948('0x6'));var path=require(_0x3948('0x7'));var sox=require('sox');var csv=require(_0x3948('0x8'));var ejs=require(_0x3948('0x9'));var fs=require('fs');var fs_extra=require(_0x3948('0xa'));var _=require(_0x3948('0xb'));var squel=require(_0x3948('0xc'));var crypto=require(_0x3948('0xd'));var jsforce=require(_0x3948('0xe'));var deskjs=require(_0x3948('0xf'));var toCsv=require(_0x3948('0x8'));var querystring=require(_0x3948('0x10'));var Papa=require(_0x3948('0x11'));var Redis=require(_0x3948('0x12'));var authService=require(_0x3948('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3948('0x14'));var hardwareService=require(_0x3948('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3948('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x485d92,_0x227c19){_0x227c19=_0x227c19||0xcc;return function(_0x1004f2){if(_0x1004f2){return _0x485d92[_0x3948('0x17')](_0x227c19);}return _0x485d92[_0x3948('0x18')](_0x227c19)[_0x3948('0x19')]();};}function respondWithResult(_0x3b2cc4,_0xf0c470){_0xf0c470=_0xf0c470||0xc8;return function(_0x56dd18){if(_0x56dd18){return _0x3b2cc4[_0x3948('0x18')](_0xf0c470)[_0x3948('0x1a')](_0x56dd18);}};}function respondWithFilteredResult(_0x4309b1,_0x1f0e90){return function(_0x16ec7f){if(_0x16ec7f){var _0x3aa26f=typeof _0x1f0e90[_0x3948('0x1b')]==='undefined'&&typeof _0x1f0e90[_0x3948('0x1c')]==='undefined';var _0x1bee8e=_0x16ec7f['count'];var _0x47d732=_0x3aa26f?0x0:_0x1f0e90[_0x3948('0x1b')];var _0x49f85c=_0x3aa26f?_0x16ec7f[_0x3948('0x1d')]:_0x1f0e90['offset']+_0x1f0e90[_0x3948('0x1c')];var _0x2acc56;if(_0x49f85c>=_0x1bee8e){_0x49f85c=_0x1bee8e;_0x2acc56=0xc8;}else{_0x2acc56=0xce;}_0x4309b1[_0x3948('0x18')](_0x2acc56);return _0x4309b1[_0x3948('0x1e')](_0x3948('0x1f'),_0x47d732+'-'+_0x49f85c+'/'+_0x1bee8e)[_0x3948('0x1a')](_0x16ec7f);}return null;};}function patchUpdates(_0x3d9177){return function(_0x390ef0){try{jsonpatch['apply'](_0x390ef0,_0x3d9177,!![]);}catch(_0x23402e){return BPromise[_0x3948('0x20')](_0x23402e);}return _0x390ef0[_0x3948('0x21')]();};}function saveUpdates(_0x2af58b,_0x2734b8){return function(_0x30a0b2){if(_0x30a0b2){return _0x30a0b2[_0x3948('0x22')](_0x2af58b)[_0x3948('0x23')](function(_0x41602d){return _0x41602d;});}return null;};}function removeEntity(_0x59d526,_0x595277){return function(_0x2adc0a){if(_0x2adc0a){return _0x2adc0a[_0x3948('0x24')]()['then'](function(){_0x59d526[_0x3948('0x18')](0xcc)[_0x3948('0x19')]();});}};}function handleEntityNotFound(_0x29b8e6,_0x2b246b){return function(_0x1e0eba){if(!_0x1e0eba){_0x29b8e6[_0x3948('0x17')](0x194);}return _0x1e0eba;};}function handleError(_0x6360c5,_0x1ae121){_0x1ae121=_0x1ae121||0x1f4;return function(_0x50258e){logger[_0x3948('0x25')](_0x50258e['stack']);if(_0x50258e[_0x3948('0x26')]){delete _0x50258e[_0x3948('0x26')];}_0x6360c5[_0x3948('0x18')](_0x1ae121)[_0x3948('0x27')](_0x50258e);};}exports[_0x3948('0x28')]=function(_0x3e1f11,_0x41f0a2){var _0x2d7ee0={},_0x302bd2={},_0x5888d4={'count':0x0,'rows':[]};var _0x208709=_[_0x3948('0x29')](db[_0x3948('0x2a')][_0x3948('0x2b')],function(_0x123038){return{'name':_0x123038['fieldName'],'type':_0x123038['type'][_0x3948('0x2c')]};});_0x302bd2[_0x3948('0x2d')]=_[_0x3948('0x29')](_0x208709,_0x3948('0x26'));_0x302bd2['query']=_['keys'](_0x3e1f11[_0x3948('0x2e')]);_0x302bd2[_0x3948('0x2f')]=_[_0x3948('0x30')](_0x302bd2['model'],_0x302bd2[_0x3948('0x2e')]);_0x2d7ee0[_0x3948('0x31')]=_[_0x3948('0x30')](_0x302bd2[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x3e1f11['query'][_0x3948('0x32')]));_0x2d7ee0[_0x3948('0x31')]=_0x2d7ee0[_0x3948('0x31')][_0x3948('0x33')]?_0x2d7ee0['attributes']:_0x302bd2['model'];if(!_0x3e1f11[_0x3948('0x2e')][_0x3948('0x34')](_0x3948('0x35'))){_0x2d7ee0[_0x3948('0x1c')]=qs[_0x3948('0x1c')](_0x3e1f11[_0x3948('0x2e')]['limit']);_0x2d7ee0['offset']=qs['offset'](_0x3e1f11[_0x3948('0x2e')][_0x3948('0x1b')]);}_0x2d7ee0['order']=qs[_0x3948('0x36')](_0x3e1f11['query'][_0x3948('0x36')]);_0x2d7ee0['where']=qs[_0x3948('0x2f')](_[_0x3948('0x37')](_0x3e1f11[_0x3948('0x2e')],_0x302bd2[_0x3948('0x2f')]),_0x208709);if(_0x3e1f11[_0x3948('0x2e')][_0x3948('0x38')]){_0x2d7ee0[_0x3948('0x39')]=_[_0x3948('0x3a')](_0x2d7ee0[_0x3948('0x39')],{'$or':_['map'](_0x208709,function(_0x1096cb){if(_0x1096cb['type']!=='VIRTUAL'){var _0x2ef665={};_0x2ef665[_0x1096cb[_0x3948('0x26')]]={'$like':'%'+_0x3e1f11['query'][_0x3948('0x38')]+'%'};return _0x2ef665;}})});}_0x2d7ee0=_[_0x3948('0x3a')]({},_0x2d7ee0,_0x3e1f11[_0x3948('0x3b')]);var _0x4052f7={'where':_0x2d7ee0[_0x3948('0x39')]};return db[_0x3948('0x2a')][_0x3948('0x1d')](_0x4052f7)[_0x3948('0x23')](function(_0x2600eb){_0x5888d4[_0x3948('0x1d')]=_0x2600eb;if(_0x3e1f11['query']['includeAll']){_0x2d7ee0[_0x3948('0x3c')]=[{'all':!![]}];}return db[_0x3948('0x2a')][_0x3948('0x3d')](_0x2d7ee0);})[_0x3948('0x23')](function(_0x5266f0){_0x5888d4[_0x3948('0x3e')]=_0x5266f0;return _0x5888d4;})[_0x3948('0x23')](respondWithFilteredResult(_0x41f0a2,_0x2d7ee0))[_0x3948('0x3f')](handleError(_0x41f0a2,null));};exports[_0x3948('0x40')]=function(_0x5a528c,_0x190f9e){var _0x2aff13={'raw':!![],'where':{'id':_0x5a528c[_0x3948('0x41')]['id']}},_0x149b98={};_0x149b98['model']=_[_0x3948('0x42')](db[_0x3948('0x2a')][_0x3948('0x2b')]);_0x149b98['query']=_['keys'](_0x5a528c[_0x3948('0x2e')]);_0x149b98[_0x3948('0x2f')]=_['intersection'](_0x149b98[_0x3948('0x2d')],_0x149b98[_0x3948('0x2e')]);_0x2aff13[_0x3948('0x31')]=_[_0x3948('0x30')](_0x149b98[_0x3948('0x2d')],qs[_0x3948('0x32')](_0x5a528c[_0x3948('0x2e')]['fields']));_0x2aff13['attributes']=_0x2aff13['attributes'][_0x3948('0x33')]?_0x2aff13[_0x3948('0x31')]:_0x149b98[_0x3948('0x2d')];if(_0x5a528c['query'][_0x3948('0x43')]){_0x2aff13[_0x3948('0x3c')]=[{'all':!![]}];}_0x2aff13=_[_0x3948('0x3a')]({},_0x2aff13,_0x5a528c[_0x3948('0x3b')]);return db['DeskField'][_0x3948('0x44')](_0x2aff13)[_0x3948('0x23')](handleEntityNotFound(_0x190f9e,null))[_0x3948('0x23')](respondWithResult(_0x190f9e,null))[_0x3948('0x3f')](handleError(_0x190f9e,null));};exports[_0x3948('0x45')]=function(_0x2c5130,_0x4fe2a3){return db['DeskField'][_0x3948('0x45')](_0x2c5130['body'],{})[_0x3948('0x23')](respondWithResult(_0x4fe2a3,0xc9))['catch'](handleError(_0x4fe2a3,null));};exports[_0x3948('0x22')]=function(_0x5543ed,_0x5ddfbc){if(_0x5543ed['body']['id']){delete _0x5543ed['body']['id'];}return db['DeskField'][_0x3948('0x44')]({'where':{'id':_0x5543ed[_0x3948('0x41')]['id']}})[_0x3948('0x23')](handleEntityNotFound(_0x5ddfbc,null))[_0x3948('0x23')](saveUpdates(_0x5543ed[_0x3948('0x46')],null))['then'](respondWithResult(_0x5ddfbc,null))[_0x3948('0x3f')](handleError(_0x5ddfbc,null));};exports['destroy']=function(_0x23d8e7,_0x612cd){return db[_0x3948('0x2a')]['find']({'where':{'id':_0x23d8e7[_0x3948('0x41')]['id']}})['then'](handleEntityNotFound(_0x612cd,null))[_0x3948('0x23')](removeEntity(_0x612cd,null))[_0x3948('0x3f')](handleError(_0x612cd,null));};
\ No newline at end of file
index cbec1cf..e548938 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07a9=['DeskField','desk_unique_index','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x470f24,_0x2436a9){var _0x2c6fc8=function(_0x3ef190){while(--_0x3ef190){_0x470f24['push'](_0x470f24['shift']());}};_0x2c6fc8(++_0x2436a9);}(_0x07a9,0x154));var _0x907a=function(_0x44cb11,_0x2194ff){_0x44cb11=_0x44cb11-0x0;var _0x1bc827=_0x07a9[_0x44cb11];return _0x1bc827;};'use strict';var _=require('lodash');var util=require(_0x907a('0x0'));var logger=require('../../config/logger')(_0x907a('0x1'));var moment=require(_0x907a('0x2'));var BPromise=require(_0x907a('0x3'));var rp=require(_0x907a('0x4'));var fs=require('fs');var path=require(_0x907a('0x5'));var rimraf=require(_0x907a('0x6'));var config=require(_0x907a('0x7'));var attributes=require('./intDeskField.attributes');module[_0x907a('0x8')]=function(_0x5943a3,_0x1bd0a9){return _0x5943a3[_0x907a('0x9')](_0x907a('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x907a('0xb'),'fields':[_0x907a('0xc'),_0x907a('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x512c=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util'];(function(_0x22a3fd,_0x4bcdef){var _0x477357=function(_0x5b191e){while(--_0x5b191e){_0x22a3fd['push'](_0x22a3fd['shift']());}};_0x477357(++_0x4bcdef);}(_0x512c,0x194));var _0xc512=function(_0xede61b,_0x2615f9){_0xede61b=_0xede61b-0x0;var _0x1c6340=_0x512c[_0xede61b];return _0x1c6340;};'use strict';var _=require(_0xc512('0x0'));var util=require(_0xc512('0x1'));var logger=require('../../config/logger')(_0xc512('0x2'));var moment=require('moment');var BPromise=require(_0xc512('0x3'));var rp=require(_0xc512('0x4'));var fs=require('fs');var path=require(_0xc512('0x5'));var rimraf=require(_0xc512('0x6'));var config=require(_0xc512('0x7'));var attributes=require(_0xc512('0x8'));module['exports']=function(_0x289b46,_0x3db3c3){return _0x289b46['define'](_0xc512('0x9'),attributes,{'tableName':_0xc512('0xa'),'paranoid':![],'indexes':[{'name':_0xc512('0xb'),'fields':[_0xc512('0xc'),_0xc512('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fe0f891..508807d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c5=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x10a6c5,_0x3b8168){var _0x79e4b8=function(_0x4699c8){while(--_0x4699c8){_0x10a6c5['push'](_0x10a6c5['shift']());}};_0x79e4b8(++_0x3b8168);}(_0xd3c5,0x1dd));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5d3c('0x0'));var util=require('util');var moment=require(_0x5d3c('0x1'));var BPromise=require(_0x5d3c('0x2'));var rs=require(_0x5d3c('0x3'));var fs=require('fs');var Redis=require(_0x5d3c('0x4'));var db=require(_0x5d3c('0x5'))['db'];var utils=require(_0x5d3c('0x6'));var logger=require('../../config/logger')(_0x5d3c('0x7'));var config=require(_0x5d3c('0x8'));var jayson=require(_0x5d3c('0x9'));var client=jayson[_0x5d3c('0xa')][_0x5d3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54a864,_0x2f9459,_0xc23a8c){return new BPromise(function(_0x482264,_0x1d6483){return client[_0x5d3c('0xc')](_0x54a864,_0xc23a8c)[_0x5d3c('0xd')](function(_0x43d1bd){logger[_0x5d3c('0xe')](_0x5d3c('0xf'),_0x2f9459,'request\x20sent');logger[_0x5d3c('0x10')](_0x5d3c('0x11'),_0x2f9459,_0x5d3c('0x12'),JSON[_0x5d3c('0x13')](_0x43d1bd));if(_0x43d1bd[_0x5d3c('0x14')]){if(_0x43d1bd[_0x5d3c('0x14')][_0x5d3c('0x15')]===0x1f4){logger[_0x5d3c('0x14')](_0x5d3c('0xf'),_0x2f9459,_0x43d1bd[_0x5d3c('0x14')][_0x5d3c('0x16')]);return _0x1d6483(_0x43d1bd[_0x5d3c('0x14')][_0x5d3c('0x16')]);}logger[_0x5d3c('0x14')](_0x5d3c('0xf'),_0x2f9459,_0x43d1bd['error'][_0x5d3c('0x16')]);return _0x482264(_0x43d1bd[_0x5d3c('0x14')][_0x5d3c('0x16')]);}else{logger[_0x5d3c('0xe')](_0x5d3c('0xf'),_0x2f9459,_0x5d3c('0x12'));_0x482264(_0x43d1bd[_0x5d3c('0x17')][_0x5d3c('0x16')]);}})[_0x5d3c('0x18')](function(_0x20c1f9){logger['error'](_0x5d3c('0xf'),_0x2f9459,_0x20c1f9);_0x1d6483(_0x20c1f9);});});}
\ No newline at end of file
+var _0xd757=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch'];(function(_0x53a2b3,_0x33995a){var _0x34e018=function(_0x1f0a89){while(--_0x1f0a89){_0x53a2b3['push'](_0x53a2b3['shift']());}};_0x34e018(++_0x33995a);}(_0xd757,0x8c));var _0x7d75=function(_0x353d59,_0x1bd2b1){_0x353d59=_0x353d59-0x0;var _0x268555=_0xd757[_0x353d59];return _0x268555;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var moment=require('moment');var BPromise=require(_0x7d75('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d75('0x3'));var db=require(_0x7d75('0x4'))['db'];var utils=require(_0x7d75('0x5'));var logger=require('../../config/logger')(_0x7d75('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7d75('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xff466a,_0x2af99b,_0x356c6a){return new BPromise(function(_0x4feb63,_0xa8d08){return client[_0x7d75('0x8')](_0xff466a,_0x356c6a)[_0x7d75('0x9')](function(_0x1f28b6){logger[_0x7d75('0xa')](_0x7d75('0xb'),_0x2af99b,_0x7d75('0xc'));logger[_0x7d75('0xd')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2af99b,_0x7d75('0xc'),JSON[_0x7d75('0xe')](_0x1f28b6));if(_0x1f28b6['error']){if(_0x1f28b6['error'][_0x7d75('0xf')]===0x1f4){logger[_0x7d75('0x10')](_0x7d75('0xb'),_0x2af99b,_0x1f28b6['error'][_0x7d75('0x11')]);return _0xa8d08(_0x1f28b6[_0x7d75('0x10')][_0x7d75('0x11')]);}logger['error'](_0x7d75('0xb'),_0x2af99b,_0x1f28b6[_0x7d75('0x10')][_0x7d75('0x11')]);return _0x4feb63(_0x1f28b6[_0x7d75('0x10')][_0x7d75('0x11')]);}else{logger[_0x7d75('0xa')](_0x7d75('0xb'),_0x2af99b,_0x7d75('0xc'));_0x4feb63(_0x1f28b6[_0x7d75('0x12')]['message']);}})[_0x7d75('0x13')](function(_0x46e1c1){logger[_0x7d75('0x10')](_0x7d75('0xb'),_0x2af99b,_0x46e1c1);_0xa8d08(_0x46e1c1);});});}
\ No newline at end of file
index 84c83a0..d19d583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a00=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','index','get'];(function(_0x2b014e,_0x2058b1){var _0x42e056=function(_0x1db88e){while(--_0x1db88e){_0x2b014e['push'](_0x2b014e['shift']());}};_0x42e056(++_0x2058b1);}(_0x3a00,0x7a));var _0x03a0=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0x3a00[_0x5933fb];return _0x44d988;};'use strict';var multer=require(_0x03a0('0x0'));var util=require('util');var path=require(_0x03a0('0x1'));var timeout=require(_0x03a0('0x2'));var express=require('express');var router=express[_0x03a0('0x3')]();var fs_extra=require(_0x03a0('0x4'));var auth=require(_0x03a0('0x5'));var interaction=require(_0x03a0('0x6'));var config=require('../../config/environment');var controller=require(_0x03a0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x03a0('0x8')]);router[_0x03a0('0x9')]('/:id',auth[_0x03a0('0xa')](),controller[_0x03a0('0xb')]);router[_0x03a0('0x9')](_0x03a0('0xc'),auth[_0x03a0('0xa')](),controller[_0x03a0('0xd')]);router[_0x03a0('0x9')](_0x03a0('0xe'),auth['isAuthenticated'](),controller[_0x03a0('0xf')]);router[_0x03a0('0x10')]('/',auth[_0x03a0('0xa')](),controller[_0x03a0('0x11')]);router['post'](_0x03a0('0xc'),auth[_0x03a0('0xa')](),controller['addConfiguration']);router['put']('/:id',auth[_0x03a0('0xa')](),controller['update']);router[_0x03a0('0x12')](_0x03a0('0x13'),auth[_0x03a0('0xa')](),controller[_0x03a0('0x14')]);module[_0x03a0('0x15')]=router;
\ No newline at end of file
+var _0x2f3d=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','/:id/configurations','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x38d519,_0x392d75){var _0x2cbed8=function(_0x1a282f){while(--_0x1a282f){_0x38d519['push'](_0x38d519['shift']());}};_0x2cbed8(++_0x392d75);}(_0x2f3d,0x1c4));var _0xd2f3=function(_0x10c664,_0x26a9fe){_0x10c664=_0x10c664-0x0;var _0x271092=_0x2f3d[_0x10c664];return _0x271092;};'use strict';var multer=require('multer');var util=require(_0xd2f3('0x0'));var path=require(_0xd2f3('0x1'));var timeout=require(_0xd2f3('0x2'));var express=require(_0xd2f3('0x3'));var router=express[_0xd2f3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd2f3('0x5'));var interaction=require(_0xd2f3('0x6'));var config=require(_0xd2f3('0x7'));var controller=require(_0xd2f3('0x8'));router[_0xd2f3('0x9')]('/',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xb')]);router[_0xd2f3('0x9')](_0xd2f3('0xc'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xd')]);router[_0xd2f3('0x9')]('/:id/configurations',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xe')]);router[_0xd2f3('0x9')]('/:id/fields',auth[_0xd2f3('0xa')](),controller[_0xd2f3('0xf')]);router['post']('/',auth[_0xd2f3('0xa')](),controller['create']);router[_0xd2f3('0x10')](_0xd2f3('0x11'),auth[_0xd2f3('0xa')](),controller[_0xd2f3('0x12')]);router[_0xd2f3('0x13')](_0xd2f3('0xc'),auth['isAuthenticated'](),controller[_0xd2f3('0x14')]);router[_0xd2f3('0x15')](_0xd2f3('0xc'),auth[_0xd2f3('0xa')](),controller['destroy']);module[_0xd2f3('0x16')]=router;
\ No newline at end of file
index 060d51e..54510f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd386=['STRING','sequelize','exports'];(function(_0x18c4a8,_0x96c52e){var _0x189ff1=function(_0x4a3ea8){while(--_0x4a3ea8){_0x18c4a8['push'](_0x18c4a8['shift']());}};_0x189ff1(++_0x96c52e);}(_0xd386,0x10c));var _0x6d38=function(_0x3b6735,_0x1c6cd4){_0x3b6735=_0x3b6735-0x0;var _0x364538=_0xd386[_0x3b6735];return _0x364538;};'use strict';var Sequelize=require(_0x6d38('0x0'));module[_0x6d38('0x1')]={'name':{'type':Sequelize[_0x6d38('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x6d38('0x2')]},'remoteUri':{'type':Sequelize[_0x6d38('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6d38('0x2')]},'clientSecret':{'type':Sequelize[_0x6d38('0x2')]},'serverUrl':{'type':Sequelize[_0x6d38('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6d38('0x2')]}};
\ No newline at end of file
+var _0x23fb=['STRING','sequelize','exports'];(function(_0x3042d5,_0x349534){var _0x1acfef=function(_0x5a920f){while(--_0x5a920f){_0x3042d5['push'](_0x3042d5['shift']());}};_0x1acfef(++_0x349534);}(_0x23fb,0x11b));var _0xb23f=function(_0x53a356,_0x9da31a){_0x53a356=_0x53a356-0x0;var _0xc2b531=_0x23fb[_0x53a356];return _0xc2b531;};'use strict';var Sequelize=require(_0xb23f('0x0'));module[_0xb23f('0x1')]={'name':{'type':Sequelize[_0xb23f('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb23f('0x2')]},'remoteUri':{'type':Sequelize[_0xb23f('0x2')]},'tenantId':{'type':Sequelize[_0xb23f('0x2')]},'clientId':{'type':Sequelize[_0xb23f('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb23f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb23f('0x2')]}};
\ No newline at end of file
index ed9d9fc..70a6e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe128=['keys','fields','include','merge','find','create','body','params','getConfigurations','Dynamics365Configuration','map','findOne','getSubjects','channel','getDescriptions','Dynamics365Field','Subjects','Descriptions','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','password','remoteUri','tenantId','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','username','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','EntityDefinitions(','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','jayson/promise','client','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','end','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll'];(function(_0x512dee,_0x1225ce){var _0x5f588d=function(_0x2be21b){while(--_0x2be21b){_0x512dee['push'](_0x512dee['shift']());}};_0x5f588d(++_0x1225ce);}(_0xe128,0x16d));var _0x8e12=function(_0xd685e,_0x360045){_0xd685e=_0xd685e-0x0;var _0x5ef5e0=_0xe128[_0xd685e];return _0x5ef5e0;};'use strict';var emlformat=require(_0x8e12('0x0'));var rimraf=require(_0x8e12('0x1'));var zipdir=require(_0x8e12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e12('0x3'));var moment=require(_0x8e12('0x4'));var BPromise=require(_0x8e12('0x5'));var Mustache=require(_0x8e12('0x6'));var util=require(_0x8e12('0x7'));var path=require(_0x8e12('0x8'));var sox=require('sox');var csv=require(_0x8e12('0x9'));var ejs=require(_0x8e12('0xa'));var fs=require('fs');var fs_extra=require(_0x8e12('0xb'));var _=require(_0x8e12('0xc'));var squel=require(_0x8e12('0xd'));var crypto=require(_0x8e12('0xe'));var jsforce=require(_0x8e12('0xf'));var deskjs=require(_0x8e12('0x10'));var toCsv=require(_0x8e12('0x9'));var querystring=require(_0x8e12('0x11'));var Papa=require('papaparse');var Redis=require(_0x8e12('0x12'));var authService=require(_0x8e12('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8e12('0x14'));var hardwareService=require(_0x8e12('0x15'));var logger=require(_0x8e12('0x16'))(_0x8e12('0x17'));var utils=require(_0x8e12('0x18'));var config=require(_0x8e12('0x19'));var licenseUtil=require(_0x8e12('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x8e12('0x1b'));var jayson=require(_0x8e12('0x1c'));var client=jayson[_0x8e12('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d6883,_0x3c57fc,_0x5f33b8,_0x490158){return new BPromise(function(_0x12d885,_0x1f3796){var _0x496079=_0x490158||client;return _0x496079['request'](_0x3d6883,_0x5f33b8)[_0x8e12('0x1e')](function(_0x5bbbea){logger[_0x8e12('0x1f')](_0x8e12('0x20'),_0x3c57fc,_0x8e12('0x21'));logger[_0x8e12('0x22')](_0x8e12('0x23'),_0x3c57fc,'request\x20sent',JSON[_0x8e12('0x24')](_0x5bbbea));if(_0x5bbbea[_0x8e12('0x25')]){if(_0x5bbbea[_0x8e12('0x25')][_0x8e12('0x26')]===0x1f4){logger['error'](_0x8e12('0x20'),_0x3c57fc,_0x5bbbea[_0x8e12('0x25')][_0x8e12('0x27')]);return _0x1f3796(_0x5bbbea[_0x8e12('0x25')][_0x8e12('0x27')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3c57fc,_0x5bbbea[_0x8e12('0x25')][_0x8e12('0x27')]);return _0x12d885(_0x5bbbea[_0x8e12('0x25')][_0x8e12('0x27')]);}else{logger[_0x8e12('0x1f')](_0x8e12('0x20'),_0x3c57fc,_0x8e12('0x21'));_0x12d885(_0x5bbbea[_0x8e12('0x28')][_0x8e12('0x27')]);}})[_0x8e12('0x29')](function(_0x3139e9){logger['error'](_0x8e12('0x20'),_0x3c57fc,_0x3139e9);_0x1f3796(_0x3139e9);});});}function respondWithStatusCode(_0x1dd6af,_0x1a4776){_0x1a4776=_0x1a4776||0xcc;return function(_0x115595){if(_0x115595){return _0x1dd6af[_0x8e12('0x2a')](_0x1a4776);}return _0x1dd6af[_0x8e12('0x2b')](_0x1a4776)['end']();};}function respondWithResult(_0x292743,_0x13aefb){_0x13aefb=_0x13aefb||0xc8;return function(_0x487c83){if(_0x487c83){return _0x292743[_0x8e12('0x2b')](_0x13aefb)[_0x8e12('0x2c')](_0x487c83);}};}function respondWithFilteredResult(_0x3d5c3a,_0x5ae99f){return function(_0x3be358){if(_0x3be358){var _0x28c1a2=typeof _0x5ae99f['offset']===_0x8e12('0x2d')&&typeof _0x5ae99f[_0x8e12('0x2e')]===_0x8e12('0x2d');var _0x581d0a=_0x3be358['count'];var _0x36e165=_0x28c1a2?0x0:_0x5ae99f['offset'];var _0x5edea2=_0x28c1a2?_0x3be358[_0x8e12('0x2f')]:_0x5ae99f[_0x8e12('0x30')]+_0x5ae99f[_0x8e12('0x2e')];var _0x279716;if(_0x5edea2>=_0x581d0a){_0x5edea2=_0x581d0a;_0x279716=0xc8;}else{_0x279716=0xce;}_0x3d5c3a[_0x8e12('0x2b')](_0x279716);return _0x3d5c3a[_0x8e12('0x31')]('Content-Range',_0x36e165+'-'+_0x5edea2+'/'+_0x581d0a)[_0x8e12('0x2c')](_0x3be358);}return null;};}function patchUpdates(_0x2b41c2){return function(_0x593d57){try{jsonpatch[_0x8e12('0x32')](_0x593d57,_0x2b41c2,!![]);}catch(_0x2d80ed){return BPromise[_0x8e12('0x33')](_0x2d80ed);}return _0x593d57[_0x8e12('0x34')]();};}function saveUpdates(_0x1f1ea7,_0x5d5042){return function(_0x339c24){if(_0x339c24){return _0x339c24[_0x8e12('0x35')](_0x1f1ea7)[_0x8e12('0x1e')](function(_0x320f36){return _0x320f36;});}return null;};}function removeEntity(_0x121edb,_0x1d7000){return function(_0x20fa47){if(_0x20fa47){return _0x20fa47[_0x8e12('0x36')]()['then'](function(){_0x121edb[_0x8e12('0x2b')](0xcc)[_0x8e12('0x37')]();});}};}function handleEntityNotFound(_0x5e6211,_0x4cc83b){return function(_0x2549ff){if(!_0x2549ff){_0x5e6211[_0x8e12('0x2a')](0x194);}return _0x2549ff;};}function handleError(_0x2bfffa,_0x5d0c5e){_0x5d0c5e=_0x5d0c5e||0x1f4;return function(_0x1d4a4a){logger[_0x8e12('0x25')](_0x1d4a4a[_0x8e12('0x38')]);if(_0x1d4a4a['name']){delete _0x1d4a4a[_0x8e12('0x39')];}_0x2bfffa[_0x8e12('0x2b')](_0x5d0c5e)[_0x8e12('0x3a')](_0x1d4a4a);};}exports[_0x8e12('0x3b')]=function(_0xa49f4c,_0x587f0a){var _0x255aa4={},_0x1726ac={},_0x5af7a3={'count':0x0,'rows':[]};var _0x43ee1e=_['map'](db[_0x8e12('0x3c')][_0x8e12('0x3d')],function(_0x16189e){return{'name':_0x16189e[_0x8e12('0x3e')],'type':_0x16189e[_0x8e12('0x3f')]['key']};});_0x1726ac[_0x8e12('0x40')]=_['map'](_0x43ee1e,_0x8e12('0x39'));_0x1726ac[_0x8e12('0x41')]=_['keys'](_0xa49f4c[_0x8e12('0x41')]);_0x1726ac[_0x8e12('0x42')]=_[_0x8e12('0x43')](_0x1726ac['model'],_0x1726ac['query']);_0x255aa4['attributes']=_[_0x8e12('0x43')](_0x1726ac['model'],qs['fields'](_0xa49f4c[_0x8e12('0x41')]['fields']));_0x255aa4[_0x8e12('0x44')]=_0x255aa4['attributes'][_0x8e12('0x45')]?_0x255aa4[_0x8e12('0x44')]:_0x1726ac[_0x8e12('0x40')];if(!_0xa49f4c[_0x8e12('0x41')][_0x8e12('0x46')](_0x8e12('0x47'))){_0x255aa4['limit']=qs[_0x8e12('0x2e')](_0xa49f4c[_0x8e12('0x41')]['limit']);_0x255aa4[_0x8e12('0x30')]=qs[_0x8e12('0x30')](_0xa49f4c['query']['offset']);}_0x255aa4[_0x8e12('0x48')]=qs[_0x8e12('0x49')](_0xa49f4c['query'][_0x8e12('0x49')]);_0x255aa4[_0x8e12('0x4a')]=qs['filters'](_[_0x8e12('0x4b')](_0xa49f4c[_0x8e12('0x41')],_0x1726ac[_0x8e12('0x42')]),_0x43ee1e);if(_0xa49f4c['query']['filter']){_0x255aa4[_0x8e12('0x4a')]=_['merge'](_0x255aa4[_0x8e12('0x4a')],{'$or':_['map'](_0x43ee1e,function(_0x1e0b7b){if(_0x1e0b7b[_0x8e12('0x3f')]!=='VIRTUAL'){var _0x1db676={};_0x1db676[_0x1e0b7b[_0x8e12('0x39')]]={'$like':'%'+_0xa49f4c[_0x8e12('0x41')][_0x8e12('0x4c')]+'%'};return _0x1db676;}})});}_0x255aa4=_['merge']({},_0x255aa4,_0xa49f4c[_0x8e12('0x4d')]);var _0x44a58e={'where':_0x255aa4['where']};return db[_0x8e12('0x3c')][_0x8e12('0x2f')](_0x44a58e)[_0x8e12('0x1e')](function(_0x3e97b1){_0x5af7a3[_0x8e12('0x2f')]=_0x3e97b1;if(_0xa49f4c['query']['includeAll']){_0x255aa4['include']=[{'all':!![]}];}return db[_0x8e12('0x3c')][_0x8e12('0x4e')](_0x255aa4);})[_0x8e12('0x1e')](function(_0x5791f8){_0x5af7a3['rows']=_0x5791f8;return _0x5af7a3;})[_0x8e12('0x1e')](respondWithFilteredResult(_0x587f0a,_0x255aa4))[_0x8e12('0x29')](handleError(_0x587f0a,null));};exports['show']=function(_0x1f053b,_0x4b6256){var _0x876406={'raw':![],'where':{'id':_0x1f053b['params']['id']}},_0x1ef73e={};_0x1ef73e['model']=_['keys'](db[_0x8e12('0x3c')][_0x8e12('0x3d')]);_0x1ef73e[_0x8e12('0x41')]=_[_0x8e12('0x4f')](_0x1f053b[_0x8e12('0x41')]);_0x1ef73e[_0x8e12('0x42')]=_[_0x8e12('0x43')](_0x1ef73e['model'],_0x1ef73e['query']);_0x876406[_0x8e12('0x44')]=_['intersection'](_0x1ef73e['model'],qs[_0x8e12('0x50')](_0x1f053b[_0x8e12('0x41')][_0x8e12('0x50')]));_0x876406[_0x8e12('0x44')]=_0x876406[_0x8e12('0x44')][_0x8e12('0x45')]?_0x876406[_0x8e12('0x44')]:_0x1ef73e[_0x8e12('0x40')];if(_0x1f053b[_0x8e12('0x41')]['includeAll']){_0x876406[_0x8e12('0x51')]=[{'all':!![]}];}_0x876406=_[_0x8e12('0x52')]({},_0x876406,_0x1f053b[_0x8e12('0x4d')]);return db[_0x8e12('0x3c')][_0x8e12('0x53')](_0x876406)[_0x8e12('0x1e')](handleEntityNotFound(_0x4b6256,null))[_0x8e12('0x1e')](respondWithResult(_0x4b6256,null))[_0x8e12('0x29')](handleError(_0x4b6256,null));};exports[_0x8e12('0x54')]=function(_0x172f43,_0x857aae){return db[_0x8e12('0x3c')][_0x8e12('0x54')](_0x172f43[_0x8e12('0x55')],{})[_0x8e12('0x1e')](respondWithResult(_0x857aae,0xc9))['catch'](handleError(_0x857aae,null));};exports[_0x8e12('0x35')]=function(_0x7e885c,_0x411785){if(_0x7e885c[_0x8e12('0x55')]['id']){delete _0x7e885c['body']['id'];}return db[_0x8e12('0x3c')][_0x8e12('0x53')]({'where':{'id':_0x7e885c[_0x8e12('0x56')]['id']}})[_0x8e12('0x1e')](handleEntityNotFound(_0x411785,null))[_0x8e12('0x1e')](saveUpdates(_0x7e885c['body'],null))[_0x8e12('0x1e')](respondWithResult(_0x411785,null))[_0x8e12('0x29')](handleError(_0x411785,null));};exports['destroy']=function(_0x1722be,_0x288b60){return db[_0x8e12('0x3c')]['find']({'where':{'id':_0x1722be[_0x8e12('0x56')]['id']}})[_0x8e12('0x1e')](handleEntityNotFound(_0x288b60,null))['then'](removeEntity(_0x288b60,null))['catch'](handleError(_0x288b60,null));};exports[_0x8e12('0x57')]=function(_0x52ddf9,_0x3b00bd,_0x331b47){var _0x12feec={};var _0x403a65={};var _0x1b0ad3;var _0x35491a;return db[_0x8e12('0x3c')]['findOne']({'where':{'id':_0x52ddf9[_0x8e12('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b00bd,null))['then'](function(_0xa0ac2d){if(_0xa0ac2d){_0x1b0ad3=_0xa0ac2d;_0x403a65[_0x8e12('0x40')]=_['keys'](db[_0x8e12('0x58')][_0x8e12('0x3d')]);_0x403a65[_0x8e12('0x41')]=_[_0x8e12('0x4f')](_0x52ddf9[_0x8e12('0x41')]);_0x403a65[_0x8e12('0x42')]=_['intersection'](_0x403a65[_0x8e12('0x40')],_0x403a65[_0x8e12('0x41')]);_0x12feec[_0x8e12('0x44')]=_['intersection'](_0x403a65[_0x8e12('0x40')],qs['fields'](_0x52ddf9['query'][_0x8e12('0x50')]));_0x12feec[_0x8e12('0x44')]=_0x12feec[_0x8e12('0x44')][_0x8e12('0x45')]?_0x12feec[_0x8e12('0x44')]:_0x403a65['model'];_0x12feec[_0x8e12('0x48')]=qs[_0x8e12('0x49')](_0x52ddf9[_0x8e12('0x41')][_0x8e12('0x49')]);_0x12feec[_0x8e12('0x4a')]=qs[_0x8e12('0x42')](_[_0x8e12('0x4b')](_0x52ddf9[_0x8e12('0x41')],_0x403a65[_0x8e12('0x42')]));if(_0x52ddf9[_0x8e12('0x41')][_0x8e12('0x4c')]){_0x12feec[_0x8e12('0x4a')]=_[_0x8e12('0x52')](_0x12feec[_0x8e12('0x4a')],{'$or':_[_0x8e12('0x59')](_0x12feec[_0x8e12('0x44')],function(_0x28d1d2){var _0xd40edf={};_0xd40edf[_0x28d1d2]={'$like':'%'+_0x52ddf9[_0x8e12('0x41')][_0x8e12('0x4c')]+'%'};return _0xd40edf;})});}_0x12feec=_[_0x8e12('0x52')]({},_0x12feec,_0x52ddf9['options']);return _0x1b0ad3[_0x8e12('0x57')](_0x12feec);}})[_0x8e12('0x1e')](function(_0x115f34){if(_0x115f34){_0x35491a=_0x115f34[_0x8e12('0x45')];if(!_0x52ddf9[_0x8e12('0x41')][_0x8e12('0x46')](_0x8e12('0x47'))){_0x12feec[_0x8e12('0x2e')]=qs[_0x8e12('0x2e')](_0x52ddf9[_0x8e12('0x41')][_0x8e12('0x2e')]);_0x12feec[_0x8e12('0x30')]=qs[_0x8e12('0x30')](_0x52ddf9[_0x8e12('0x41')][_0x8e12('0x30')]);}return _0x1b0ad3[_0x8e12('0x57')](_0x12feec);}})['then'](function(_0x52fc15){if(_0x52fc15){return _0x52fc15?{'count':_0x35491a,'rows':_0x52fc15}:null;}})['then'](respondWithResult(_0x3b00bd,null))[_0x8e12('0x29')](handleError(_0x3b00bd,null));};exports['addConfiguration']=function(_0x45efeb,_0x572a95,_0x483c70){if(_0x45efeb[_0x8e12('0x55')]['id']){delete _0x45efeb[_0x8e12('0x55')]['id'];}return db[_0x8e12('0x3c')][_0x8e12('0x5a')]({'where':{'id':_0x45efeb['params']['id']}})[_0x8e12('0x1e')](handleEntityNotFound(_0x572a95,null))[_0x8e12('0x1e')](function(_0x18c648){if(_0x18c648){_0x45efeb['body']['AccountId']=_0x18c648['id'];_0x45efeb[_0x8e12('0x55')]['Subjects']=integrations[_0x8e12('0x5b')](_0x45efeb[_0x8e12('0x55')][_0x8e12('0x5c')],_0x45efeb[_0x8e12('0x55')]['type']);_0x45efeb['body']['Descriptions']=integrations[_0x8e12('0x5d')](_0x45efeb['body'][_0x8e12('0x5c')],_0x45efeb[_0x8e12('0x55')]['type']);return db[_0x8e12('0x58')]['create'](_0x45efeb[_0x8e12('0x55')],{'include':[{'model':db[_0x8e12('0x5e')],'as':_0x8e12('0x5f')},{'model':db[_0x8e12('0x5e')],'as':_0x8e12('0x60')}]});}return null;})[_0x8e12('0x1e')](respondWithResult(_0x572a95,null))[_0x8e12('0x29')](handleError(_0x572a95,null));};exports['getFields']=function(_0x69d575,_0x4d07dd,_0x1b4b40){var _0x46970f=_0x69d575[_0x8e12('0x41')][_0x8e12('0x61')];var _0x5ea6c5=_0x46970f===_0x8e12('0x62')?'Incident':_0x8e12('0x63');var _0x387a32='';var _0x4ab42c='';var _0x566896='';var _0x19297a='';var _0x3a1675='';var _0x3a749a='';var _0x32a5ea='';var _0x390560='';var _0x3ce8d4=[_0x8e12('0x64'),_0x8e12('0x65'),_0x8e12('0x66'),_0x8e12('0x67'),_0x8e12('0x68'),_0x8e12('0x69'),_0x8e12('0x6a'),_0x8e12('0x6b'),_0x8e12('0x6c'),_0x8e12('0x6d')];var _0x46ee0f=[_0x8e12('0x6e'),_0x8e12('0x6f'),_0x8e12('0x70'),_0x8e12('0x71'),'contactidname','contactidyominame',_0x8e12('0x72'),_0x8e12('0x73'),'createdbyexternalpartyname',_0x8e12('0x74'),_0x8e12('0x75'),'createdbyyominame',_0x8e12('0x76'),_0x8e12('0x77'),_0x8e12('0x78'),_0x8e12('0x79'),'customeridtype',_0x8e12('0x7a'),'emailaddress',_0x8e12('0x7b'),_0x8e12('0x7c'),'entityimage_url',_0x8e12('0x7d'),'exchangerate',_0x8e12('0x7e'),_0x8e12('0x7f'),_0x8e12('0x80'),_0x8e12('0x81'),'kbarticleidname',_0x8e12('0x82'),_0x8e12('0x83'),_0x8e12('0x84'),_0x8e12('0x85'),_0x8e12('0x86'),_0x8e12('0x87'),_0x8e12('0x88'),_0x8e12('0x89'),_0x8e12('0x8a'),'msdyn_incidenttypename',_0x8e12('0x8b'),_0x8e12('0x8c'),_0x8e12('0x8d'),_0x8e12('0x8e'),_0x8e12('0x8f'),_0x8e12('0x90'),'owneridyominame',_0x8e12('0x91'),'primarycontactidname','primarycontactidyominame',_0x8e12('0x92'),_0x8e12('0x93'),_0x8e12('0x94'),_0x8e12('0x95'),_0x8e12('0x96'),_0x8e12('0x97'),'responsiblecontactidname',_0x8e12('0x98'),_0x8e12('0x99'),_0x8e12('0x9a'),_0x8e12('0x9b'),_0x8e12('0x9c'),_0x8e12('0x9d'),'statuscode',_0x8e12('0x9e'),_0x8e12('0x9f'),'timezoneruleversionnumber',_0x8e12('0xa0'),_0x8e12('0xa1'),_0x8e12('0xa2'),_0x8e12('0xa3')];var _0x29faff=_0x3ce8d4['concat'](_0x46ee0f);return db[_0x8e12('0x3c')][_0x8e12('0x5a')]({'where':{'id':_0x69d575[_0x8e12('0x56')]['id']},'attributes':['id','username',_0x8e12('0xa4'),_0x8e12('0xa5'),_0x8e12('0xa6'),_0x8e12('0xa7'),'clientSecret']})[_0x8e12('0x1e')](handleEntityNotFound(_0x4d07dd,null))[_0x8e12('0x1e')](function(_0x338c34){if(_0x338c34){_0x390560=_0x338c34['remoteUri'];var _0xe78ff1=_0x390560[_0x8e12('0xa8')](-0x1);if(_0xe78ff1==='/'){_0x390560=_0x390560[_0x8e12('0xa9')](0x0,_0x390560[_0x8e12('0xaa')](_0xe78ff1));}_0x32a5ea=util[_0x8e12('0xab')](_0x8e12('0xac'),_0x390560);var _0x29941d={'method':_0x8e12('0xad'),'uri':_0x8e12('0xae')+_0x338c34[_0x8e12('0xa6')]+'/oauth2/token','form':{'client_id':_0x338c34[_0x8e12('0xa7')],'resource':_0x390560,'username':_0x338c34[_0x8e12('0xaf')],'password':_0x338c34[_0x8e12('0xa4')],'grant_type':_0x8e12('0xa4'),'client_secret':_0x338c34[_0x8e12('0xb0')]},'json':!![]};return rp(_0x29941d);}})['then'](function(_0x265f5c){_0x3a749a=_0x265f5c[_0x8e12('0xb1')];var _0x18b27f={'method':_0x8e12('0xb2'),'uri':encodeURI(_0x32a5ea+_0x8e12('0xb3')+_0x5ea6c5+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x3a749a,'If-None-Match':null,'OData-Version':_0x8e12('0xb4')},'json':!![]};return rp(_0x18b27f);})[_0x8e12('0x1e')](function(_0x2389e6){var _0x26cc35=_0x2389e6[_0x8e12('0xb5')][0x0];var _0x5ba34e=_0x26cc35[_0x8e12('0xb6')];var _0x42018e={'method':_0x8e12('0xb2'),'uri':_0x32a5ea+_0x8e12('0xb7')+_0x5ba34e+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x8e12('0xb8')+_0x3a749a,'If-None-Match':null,'OData-Version':_0x8e12('0xb4')},'json':!![]};return rp(_0x42018e);})[_0x8e12('0x1e')](function(_0x262f8b){_0x387a32=_0x262f8b;_0x4ab42c=_0x387a32[_0x8e12('0xb9')];_0x4ab42c=_[_0x8e12('0xba')](_0x4ab42c,function(_0x38da09){return!_0x29faff[_0x8e12('0xbb')](_0x38da09[_0x8e12('0xbc')]);});var _0x5e82a9=[];var _0x39a702=[];_0x4ab42c[_0x8e12('0xbd')](function(_0x2f9c1c){if(_0x2f9c1c['@odata.type']){var _0x55208b=_0x2f9c1c['@odata.type'][_0x8e12('0xa9')](_0x2f9c1c[_0x8e12('0xbe')]['lastIndexOf']('.')+0x1);if(_0x55208b==='PicklistAttributeMetadata'){_0x5e82a9[_0x8e12('0xbf')](getSelectList(_0x32a5ea,_0x46970f,_0x39a702,_0x387a32[_0x8e12('0xb6')],_0x2f9c1c[_0x8e12('0xb6')],_0x3a749a));}}});return Promise[_0x8e12('0xc0')](_0x5e82a9);})['then'](function(_0x38a538){_0x566896=_0x38a538[0x0];var _0xfc1d22=[];var _0x1d5839=[];_0x4ab42c[_0x8e12('0xbd')](function(_0x340a6d){if(!_[_0x8e12('0xc1')](_0x340a6d['@odata.type'])){var _0x57c09c=_0x340a6d[_0x8e12('0xbe')]['substring'](_0x340a6d[_0x8e12('0xbe')][_0x8e12('0xaa')]('.')+0x1);if(_0x57c09c===_0x8e12('0xc2')){_0xfc1d22[_0x8e12('0xbf')](getBooleanList(_0x32a5ea,_0x46970f,_0x1d5839,_0x387a32[_0x8e12('0xb6')],_0x340a6d[_0x8e12('0xb6')],_0x3a749a));}}});return Promise[_0x8e12('0xc0')](_0xfc1d22);})[_0x8e12('0x1e')](function(_0x315d52){_0x19297a=_0x315d52[0x0];var _0x415008=[];var _0x331eea=[];_0x4ab42c['forEach'](function(_0x5e0d5f){if(_0x5e0d5f[_0x8e12('0xbe')]){var _0x4f09bd=_0x5e0d5f[_0x8e12('0xbe')][_0x8e12('0xa9')](_0x5e0d5f[_0x8e12('0xbe')][_0x8e12('0xaa')]('.')+0x1);if(_0x4f09bd==='StringAttributeMetadata'||_0x4f09bd===_0x8e12('0xc3')||_0x4f09bd===_0x8e12('0xc4')||_0x4f09bd===_0x8e12('0xc5')||_0x4f09bd==='MemoAttributeMetadata'||_0x4f09bd===_0x8e12('0xc6')||_0x4f09bd===_0x8e12('0xc7')||_0x4f09bd===_0x8e12('0xc8')||_0x4f09bd===_0x8e12('0xc9')||_0x4f09bd===_0x8e12('0xca')){_0x415008[_0x8e12('0xbf')](getInputList(_0x32a5ea,_0x46970f,_0x4f09bd,_0x331eea,_0x387a32['MetadataId'],_0x5e0d5f[_0x8e12('0xb6')],_0x3a749a));}}});return Promise[_0x8e12('0xc0')](_0x415008);})[_0x8e12('0x1e')](function(_0x4ac3a1){_0x3a1675=_0x4ac3a1[0x0];var _0x9f5c9a=_0x566896[_0x8e12('0xcb')](_0x19297a)[_0x8e12('0xcb')](_0x3a1675);var _0x5a8893={'count':_0x9f5c9a[_0x8e12('0x45')],'rows':_0x9f5c9a};return _0x5a8893;})['then'](respondWithResult(_0x4d07dd,null))[_0x8e12('0x29')](function(_0xa32654){var _0x235c10=_0x69d575['query'][_0x8e12('0xcc')]?0x1f4:_0xa32654[_0x8e12('0xcd')]||0x1f4;logger['error'](_0xa32654['stack']);delete _0xa32654[_0x8e12('0x39')];if(_0x235c10===0x191){_0x235c10=0x190;}_0x4d07dd[_0x8e12('0x2b')](_0x235c10)[_0x8e12('0x3a')](_0x69d575[_0x8e12('0x41')][_0x8e12('0xcc')]?{'message':_0x8e12('0xce'),'statusCode':_0xa32654[_0x8e12('0xcd')]}:_0xa32654);});};function getSelectList(_0x40303f,_0x3185ce,_0xe645ef,_0x2113f2,_0x8a793f,_0x23a398){var _0x12205c={'method':_0x8e12('0xb2'),'uri':_0x40303f+_0x8e12('0xb7')+_0x2113f2+_0x8e12('0xcf')+_0x8a793f+_0x8e12('0xd0')+_0x8e12('0xd1'),'headers':{'Authorization':'Bearer\x20'+_0x23a398,'If-None-Match':null,'OData-Version':_0x8e12('0xb4')},'json':!![]};return rp(_0x12205c)[_0x8e12('0x1e')](function(_0x2ac1b1){var _0x2419af=[];var _0x40a353=_0x2ac1b1[_0x8e12('0xd2')][_0x8e12('0xd3')];_0x40a353[_0x8e12('0xbd')](function(_0x30d8f9){_0x2419af[_0x8e12('0xbf')]({'name':_0x30d8f9[_0x8e12('0xd4')][_0x8e12('0xd5')][_0x8e12('0xd4')],'value':String(_0x30d8f9['Value'])});});var _0x5103cf={'id':_0x3185ce+'_'+_0x2ac1b1[_0x8e12('0xbc')],'name':_0x2ac1b1[_0x8e12('0xd6')][_0x8e12('0xd5')][_0x8e12('0xd4')],'custom':![],'options':_0x2419af};_0xe645ef['push'](_0x5103cf);return _0xe645ef;});}function getBooleanList(_0x23cb51,_0x4a7392,_0x2eddf0,_0x29771a,_0x44b70a,_0x35c81f){var _0x3c66fd={'method':'GET','uri':_0x23cb51+_0x8e12('0xb7')+_0x29771a+_0x8e12('0xcf')+_0x44b70a+_0x8e12('0xd7'),'headers':{'Authorization':_0x8e12('0xb8')+_0x35c81f,'If-None-Match':null,'OData-Version':_0x8e12('0xb4')},'json':!![]};return rp(_0x3c66fd)[_0x8e12('0x1e')](function(_0x30ef86){var _0x16aa6c=[];_0x16aa6c[_0x8e12('0xbf')]({'name':_0x30ef86[_0x8e12('0xd2')][_0x8e12('0xd8')]['Label'][_0x8e12('0xd5')][_0x8e12('0xd4')],'value':_0x8e12('0xd9')},{'name':_0x30ef86[_0x8e12('0xd2')][_0x8e12('0xda')][_0x8e12('0xd4')][_0x8e12('0xd5')][_0x8e12('0xd4')],'value':_0x8e12('0xdb')});var _0x464d63={'id':_0x4a7392+'_'+_0x30ef86['LogicalName'],'name':_0x30ef86[_0x8e12('0xd6')][_0x8e12('0xd5')][_0x8e12('0xd4')],'custom':![],'options':_0x16aa6c};_0x2eddf0['push'](_0x464d63);return _0x2eddf0;});}function getInputList(_0x21153d,_0x2bd139,_0x21ee3c,_0x3c57b8,_0x2b4709,_0x12658f,_0x11847a){var _0xeca905={'method':_0x8e12('0xb2'),'uri':_0x21153d+_0x8e12('0xb7')+_0x2b4709+_0x8e12('0xcf')+_0x12658f+_0x8e12('0xdc')+_0x21ee3c+_0x8e12('0xdd'),'headers':{'Authorization':'Bearer\x20'+_0x11847a,'If-None-Match':null,'OData-Version':_0x8e12('0xb4')},'json':!![]};return rp(_0xeca905)['then'](function(_0x452700){var _0x13e825={'id':_0x2bd139+'_'+_0x452700['LogicalName'],'name':_0x452700[_0x8e12('0xd6')][_0x8e12('0xd5')]?_0x452700[_0x8e12('0xd6')][_0x8e12('0xd5')][_0x8e12('0xd4')]:_0x452700[_0x8e12('0xbc')],'custom':![],'options':[]};_0x3c57b8[_0x8e12('0xbf')](_0x13e825);return _0x3c57b8;});}
\ No newline at end of file
+var _0xeb56=['VIRTUAL','includeAll','include','show','params','rawAttributes','keys','options','find','create','body','update','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','subject','phonenumber','directioncode','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','remoteUri','slice','substring','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','username','password','clientSecret','GET','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','all','isNil','lastIndexOf','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','push','concat','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','Dynamics365Account','fieldName','type','filters','intersection','model','fields','query','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x323c7e,_0x3d16ec){var _0x2b0f72=function(_0x5a2310){while(--_0x5a2310){_0x323c7e['push'](_0x323c7e['shift']());}};_0x2b0f72(++_0x3d16ec);}(_0xeb56,0x90));var _0x6eb5=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xeb56[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x6eb5('0x0'));var rimraf=require(_0x6eb5('0x1'));var zipdir=require(_0x6eb5('0x2'));var jsonpatch=require(_0x6eb5('0x3'));var rp=require(_0x6eb5('0x4'));var moment=require('moment');var BPromise=require(_0x6eb5('0x5'));var Mustache=require(_0x6eb5('0x6'));var util=require(_0x6eb5('0x7'));var path=require(_0x6eb5('0x8'));var sox=require(_0x6eb5('0x9'));var csv=require(_0x6eb5('0xa'));var ejs=require(_0x6eb5('0xb'));var fs=require('fs');var fs_extra=require(_0x6eb5('0xc'));var _=require(_0x6eb5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6eb5('0xa'));var querystring=require(_0x6eb5('0xe'));var Papa=require(_0x6eb5('0xf'));var Redis=require(_0x6eb5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6eb5('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6eb5('0x12'));var config=require(_0x6eb5('0x13'));var licenseUtil=require(_0x6eb5('0x14'));var db=require(_0x6eb5('0x15'))['db'];var integrations=require(_0x6eb5('0x16'));var jayson=require(_0x6eb5('0x17'));var client=jayson[_0x6eb5('0x18')][_0x6eb5('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x24892a,_0x26a68f,_0x1cbb9f,_0x185e09){return new BPromise(function(_0x3bdc8a,_0x34bc3b){var _0x42538d=_0x185e09||client;return _0x42538d[_0x6eb5('0x1a')](_0x24892a,_0x1cbb9f)['then'](function(_0x376a5b){logger[_0x6eb5('0x1b')](_0x6eb5('0x1c'),_0x26a68f,'request\x20sent');logger[_0x6eb5('0x1d')](_0x6eb5('0x1e'),_0x26a68f,_0x6eb5('0x1f'),JSON[_0x6eb5('0x20')](_0x376a5b));if(_0x376a5b[_0x6eb5('0x21')]){if(_0x376a5b[_0x6eb5('0x21')][_0x6eb5('0x22')]===0x1f4){logger[_0x6eb5('0x21')](_0x6eb5('0x1c'),_0x26a68f,_0x376a5b['error'][_0x6eb5('0x23')]);return _0x34bc3b(_0x376a5b[_0x6eb5('0x21')][_0x6eb5('0x23')]);}logger[_0x6eb5('0x21')](_0x6eb5('0x1c'),_0x26a68f,_0x376a5b[_0x6eb5('0x21')][_0x6eb5('0x23')]);return _0x3bdc8a(_0x376a5b['error']['message']);}else{logger[_0x6eb5('0x1b')](_0x6eb5('0x1c'),_0x26a68f,_0x6eb5('0x1f'));_0x3bdc8a(_0x376a5b[_0x6eb5('0x24')]['message']);}})[_0x6eb5('0x25')](function(_0x488266){logger[_0x6eb5('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x26a68f,_0x488266);_0x34bc3b(_0x488266);});});}function respondWithStatusCode(_0x219405,_0xe9cf90){_0xe9cf90=_0xe9cf90||0xcc;return function(_0x1b5502){if(_0x1b5502){return _0x219405[_0x6eb5('0x26')](_0xe9cf90);}return _0x219405['status'](_0xe9cf90)[_0x6eb5('0x27')]();};}function respondWithResult(_0x429fc2,_0x2e600c){_0x2e600c=_0x2e600c||0xc8;return function(_0x1be4fd){if(_0x1be4fd){return _0x429fc2['status'](_0x2e600c)[_0x6eb5('0x28')](_0x1be4fd);}};}function respondWithFilteredResult(_0x375c94,_0x1d629a){return function(_0x1ca4f2){if(_0x1ca4f2){var _0x341d35=typeof _0x1d629a[_0x6eb5('0x29')]===_0x6eb5('0x2a')&&typeof _0x1d629a['limit']===_0x6eb5('0x2a');var _0xcca7be=_0x1ca4f2[_0x6eb5('0x2b')];var _0x67e80b=_0x341d35?0x0:_0x1d629a[_0x6eb5('0x29')];var _0x1b41e3=_0x341d35?_0x1ca4f2[_0x6eb5('0x2b')]:_0x1d629a[_0x6eb5('0x29')]+_0x1d629a[_0x6eb5('0x2c')];var _0x9199f9;if(_0x1b41e3>=_0xcca7be){_0x1b41e3=_0xcca7be;_0x9199f9=0xc8;}else{_0x9199f9=0xce;}_0x375c94[_0x6eb5('0x2d')](_0x9199f9);return _0x375c94[_0x6eb5('0x2e')](_0x6eb5('0x2f'),_0x67e80b+'-'+_0x1b41e3+'/'+_0xcca7be)[_0x6eb5('0x28')](_0x1ca4f2);}return null;};}function patchUpdates(_0x402173){return function(_0x36bbd4){try{jsonpatch[_0x6eb5('0x30')](_0x36bbd4,_0x402173,!![]);}catch(_0x1dce3f){return BPromise[_0x6eb5('0x31')](_0x1dce3f);}return _0x36bbd4['save']();};}function saveUpdates(_0x5b1e51,_0x4de546){return function(_0x35c97a){if(_0x35c97a){return _0x35c97a['update'](_0x5b1e51)[_0x6eb5('0x32')](function(_0x2a8bba){return _0x2a8bba;});}return null;};}function removeEntity(_0x37ad37,_0x20451b){return function(_0x272fb7){if(_0x272fb7){return _0x272fb7[_0x6eb5('0x33')]()['then'](function(){_0x37ad37['status'](0xcc)[_0x6eb5('0x27')]();});}};}function handleEntityNotFound(_0x2bfe43,_0x15ee0f){return function(_0x47cf7f){if(!_0x47cf7f){_0x2bfe43[_0x6eb5('0x26')](0x194);}return _0x47cf7f;};}function handleError(_0x200d67,_0x4bb1a9){_0x4bb1a9=_0x4bb1a9||0x1f4;return function(_0x18f5c8){logger['error'](_0x18f5c8[_0x6eb5('0x34')]);if(_0x18f5c8[_0x6eb5('0x35')]){delete _0x18f5c8[_0x6eb5('0x35')];}_0x200d67[_0x6eb5('0x2d')](_0x4bb1a9)[_0x6eb5('0x36')](_0x18f5c8);};}exports[_0x6eb5('0x37')]=function(_0x2b4465,_0x3143b9){var _0x23ad19={},_0x556f76={},_0x3dc8fe={'count':0x0,'rows':[]};var _0x597e7c=_[_0x6eb5('0x38')](db[_0x6eb5('0x39')]['rawAttributes'],function(_0x5079a4){return{'name':_0x5079a4[_0x6eb5('0x3a')],'type':_0x5079a4[_0x6eb5('0x3b')]['key']};});_0x556f76['model']=_[_0x6eb5('0x38')](_0x597e7c,'name');_0x556f76['query']=_['keys'](_0x2b4465['query']);_0x556f76[_0x6eb5('0x3c')]=_[_0x6eb5('0x3d')](_0x556f76[_0x6eb5('0x3e')],_0x556f76['query']);_0x23ad19['attributes']=_[_0x6eb5('0x3d')](_0x556f76[_0x6eb5('0x3e')],qs[_0x6eb5('0x3f')](_0x2b4465[_0x6eb5('0x40')]['fields']));_0x23ad19['attributes']=_0x23ad19['attributes'][_0x6eb5('0x41')]?_0x23ad19[_0x6eb5('0x42')]:_0x556f76[_0x6eb5('0x3e')];if(!_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x43')](_0x6eb5('0x44'))){_0x23ad19['limit']=qs['limit'](_0x2b4465['query'][_0x6eb5('0x2c')]);_0x23ad19[_0x6eb5('0x29')]=qs['offset'](_0x2b4465['query'][_0x6eb5('0x29')]);}_0x23ad19[_0x6eb5('0x45')]=qs[_0x6eb5('0x46')](_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x46')]);_0x23ad19['where']=qs[_0x6eb5('0x3c')](_[_0x6eb5('0x47')](_0x2b4465[_0x6eb5('0x40')],_0x556f76['filters']),_0x597e7c);if(_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x48')]){_0x23ad19[_0x6eb5('0x49')]=_[_0x6eb5('0x4a')](_0x23ad19[_0x6eb5('0x49')],{'$or':_[_0x6eb5('0x38')](_0x597e7c,function(_0x108430){if(_0x108430[_0x6eb5('0x3b')]!==_0x6eb5('0x4b')){var _0x55be70={};_0x55be70[_0x108430['name']]={'$like':'%'+_0x2b4465['query'][_0x6eb5('0x48')]+'%'};return _0x55be70;}})});}_0x23ad19=_[_0x6eb5('0x4a')]({},_0x23ad19,_0x2b4465['options']);var _0x16f5e9={'where':_0x23ad19[_0x6eb5('0x49')]};return db[_0x6eb5('0x39')][_0x6eb5('0x2b')](_0x16f5e9)[_0x6eb5('0x32')](function(_0x43e9fe){_0x3dc8fe[_0x6eb5('0x2b')]=_0x43e9fe;if(_0x2b4465[_0x6eb5('0x40')][_0x6eb5('0x4c')]){_0x23ad19[_0x6eb5('0x4d')]=[{'all':!![]}];}return db[_0x6eb5('0x39')]['findAll'](_0x23ad19);})[_0x6eb5('0x32')](function(_0x3a52a3){_0x3dc8fe['rows']=_0x3a52a3;return _0x3dc8fe;})[_0x6eb5('0x32')](respondWithFilteredResult(_0x3143b9,_0x23ad19))[_0x6eb5('0x25')](handleError(_0x3143b9,null));};exports[_0x6eb5('0x4e')]=function(_0x3f86ff,_0x144922){var _0x4436b5={'raw':![],'where':{'id':_0x3f86ff[_0x6eb5('0x4f')]['id']}},_0x5952c5={};_0x5952c5['model']=_['keys'](db[_0x6eb5('0x39')][_0x6eb5('0x50')]);_0x5952c5[_0x6eb5('0x40')]=_[_0x6eb5('0x51')](_0x3f86ff['query']);_0x5952c5[_0x6eb5('0x3c')]=_[_0x6eb5('0x3d')](_0x5952c5[_0x6eb5('0x3e')],_0x5952c5[_0x6eb5('0x40')]);_0x4436b5['attributes']=_['intersection'](_0x5952c5['model'],qs[_0x6eb5('0x3f')](_0x3f86ff[_0x6eb5('0x40')][_0x6eb5('0x3f')]));_0x4436b5[_0x6eb5('0x42')]=_0x4436b5[_0x6eb5('0x42')][_0x6eb5('0x41')]?_0x4436b5[_0x6eb5('0x42')]:_0x5952c5[_0x6eb5('0x3e')];if(_0x3f86ff[_0x6eb5('0x40')][_0x6eb5('0x4c')]){_0x4436b5['include']=[{'all':!![]}];}_0x4436b5=_[_0x6eb5('0x4a')]({},_0x4436b5,_0x3f86ff[_0x6eb5('0x52')]);return db[_0x6eb5('0x39')][_0x6eb5('0x53')](_0x4436b5)[_0x6eb5('0x32')](handleEntityNotFound(_0x144922,null))[_0x6eb5('0x32')](respondWithResult(_0x144922,null))[_0x6eb5('0x25')](handleError(_0x144922,null));};exports[_0x6eb5('0x54')]=function(_0x51639f,_0x1f9df0){return db[_0x6eb5('0x39')][_0x6eb5('0x54')](_0x51639f[_0x6eb5('0x55')],{})['then'](respondWithResult(_0x1f9df0,0xc9))[_0x6eb5('0x25')](handleError(_0x1f9df0,null));};exports[_0x6eb5('0x56')]=function(_0x1ed248,_0x3aa48f){if(_0x1ed248[_0x6eb5('0x55')]['id']){delete _0x1ed248[_0x6eb5('0x55')]['id'];}return db['Dynamics365Account'][_0x6eb5('0x53')]({'where':{'id':_0x1ed248[_0x6eb5('0x4f')]['id']}})[_0x6eb5('0x32')](handleEntityNotFound(_0x3aa48f,null))[_0x6eb5('0x32')](saveUpdates(_0x1ed248['body'],null))[_0x6eb5('0x32')](respondWithResult(_0x3aa48f,null))['catch'](handleError(_0x3aa48f,null));};exports[_0x6eb5('0x33')]=function(_0x3e53e1,_0x3b3568){return db[_0x6eb5('0x39')][_0x6eb5('0x53')]({'where':{'id':_0x3e53e1[_0x6eb5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3b3568,null))[_0x6eb5('0x32')](removeEntity(_0x3b3568,null))[_0x6eb5('0x25')](handleError(_0x3b3568,null));};exports[_0x6eb5('0x57')]=function(_0x37c92a,_0x422dfa,_0xea2129){var _0x48752f={};var _0x5c09ad={};var _0x4c3bdb;var _0x2387b4;return db[_0x6eb5('0x39')][_0x6eb5('0x58')]({'where':{'id':_0x37c92a[_0x6eb5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x422dfa,null))[_0x6eb5('0x32')](function(_0xecf07d){if(_0xecf07d){_0x4c3bdb=_0xecf07d;_0x5c09ad[_0x6eb5('0x3e')]=_[_0x6eb5('0x51')](db[_0x6eb5('0x59')][_0x6eb5('0x50')]);_0x5c09ad[_0x6eb5('0x40')]=_[_0x6eb5('0x51')](_0x37c92a[_0x6eb5('0x40')]);_0x5c09ad[_0x6eb5('0x3c')]=_['intersection'](_0x5c09ad[_0x6eb5('0x3e')],_0x5c09ad[_0x6eb5('0x40')]);_0x48752f['attributes']=_['intersection'](_0x5c09ad[_0x6eb5('0x3e')],qs[_0x6eb5('0x3f')](_0x37c92a['query'][_0x6eb5('0x3f')]));_0x48752f[_0x6eb5('0x42')]=_0x48752f[_0x6eb5('0x42')][_0x6eb5('0x41')]?_0x48752f['attributes']:_0x5c09ad[_0x6eb5('0x3e')];_0x48752f[_0x6eb5('0x45')]=qs[_0x6eb5('0x46')](_0x37c92a[_0x6eb5('0x40')]['sort']);_0x48752f[_0x6eb5('0x49')]=qs[_0x6eb5('0x3c')](_[_0x6eb5('0x47')](_0x37c92a['query'],_0x5c09ad[_0x6eb5('0x3c')]));if(_0x37c92a[_0x6eb5('0x40')]['filter']){_0x48752f[_0x6eb5('0x49')]=_[_0x6eb5('0x4a')](_0x48752f[_0x6eb5('0x49')],{'$or':_[_0x6eb5('0x38')](_0x48752f[_0x6eb5('0x42')],function(_0x3e08bd){var _0x4a29f2={};_0x4a29f2[_0x3e08bd]={'$like':'%'+_0x37c92a[_0x6eb5('0x40')][_0x6eb5('0x48')]+'%'};return _0x4a29f2;})});}_0x48752f=_[_0x6eb5('0x4a')]({},_0x48752f,_0x37c92a[_0x6eb5('0x52')]);return _0x4c3bdb[_0x6eb5('0x57')](_0x48752f);}})[_0x6eb5('0x32')](function(_0x38eac9){if(_0x38eac9){_0x2387b4=_0x38eac9['length'];if(!_0x37c92a['query'][_0x6eb5('0x43')](_0x6eb5('0x44'))){_0x48752f[_0x6eb5('0x2c')]=qs[_0x6eb5('0x2c')](_0x37c92a[_0x6eb5('0x40')][_0x6eb5('0x2c')]);_0x48752f[_0x6eb5('0x29')]=qs['offset'](_0x37c92a[_0x6eb5('0x40')][_0x6eb5('0x29')]);}return _0x4c3bdb[_0x6eb5('0x57')](_0x48752f);}})[_0x6eb5('0x32')](function(_0x5a1e26){if(_0x5a1e26){return _0x5a1e26?{'count':_0x2387b4,'rows':_0x5a1e26}:null;}})[_0x6eb5('0x32')](respondWithResult(_0x422dfa,null))[_0x6eb5('0x25')](handleError(_0x422dfa,null));};exports[_0x6eb5('0x5a')]=function(_0x2630dd,_0x451436,_0x15083c){if(_0x2630dd[_0x6eb5('0x55')]['id']){delete _0x2630dd[_0x6eb5('0x55')]['id'];}return db[_0x6eb5('0x39')][_0x6eb5('0x58')]({'where':{'id':_0x2630dd['params']['id']}})[_0x6eb5('0x32')](handleEntityNotFound(_0x451436,null))['then'](function(_0x5cae6c){if(_0x5cae6c){_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5b')]=_0x5cae6c['id'];_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5c')]=integrations[_0x6eb5('0x5d')](_0x2630dd['body'][_0x6eb5('0x5e')],_0x2630dd[_0x6eb5('0x55')]['type']);_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5f')]=integrations[_0x6eb5('0x60')](_0x2630dd[_0x6eb5('0x55')][_0x6eb5('0x5e')],_0x2630dd[_0x6eb5('0x55')]['type']);return db[_0x6eb5('0x59')][_0x6eb5('0x54')](_0x2630dd[_0x6eb5('0x55')],{'include':[{'model':db[_0x6eb5('0x61')],'as':_0x6eb5('0x5c')},{'model':db[_0x6eb5('0x61')],'as':_0x6eb5('0x5f')}]});}return null;})[_0x6eb5('0x32')](respondWithResult(_0x451436,null))['catch'](handleError(_0x451436,null));};exports[_0x6eb5('0x62')]=function(_0x1302d6,_0x22889a,_0xb588ef){var _0x2d007f=_0x1302d6['query'][_0x6eb5('0x63')];var _0x181a65=_0x2d007f===_0x6eb5('0x64')?_0x6eb5('0x65'):_0x6eb5('0x66');var _0x130093='';var _0x4d60d8='';var _0x18d2c2='';var _0x24c267='';var _0x5d268f='';var _0xec4683='';var _0x229666='';var _0x1b2da3='';var _0x54e1f9=['title',_0x6eb5('0x67'),_0x6eb5('0x68'),_0x6eb5('0x69'),'caseorigincode',_0x6eb5('0x6a'),_0x6eb5('0x6b'),'regardingobjectid',_0x6eb5('0x6c'),'phonecall_activity_parties'];var _0x459997=['accountidname',_0x6eb5('0x6d'),_0x6eb5('0x6e'),_0x6eb5('0x6f'),_0x6eb5('0x70'),'contactidyominame',_0x6eb5('0x71'),_0x6eb5('0x72'),'createdbyexternalpartyname',_0x6eb5('0x73'),_0x6eb5('0x74'),_0x6eb5('0x75'),'createdon',_0x6eb5('0x76'),'createdonbehalfbyyominame',_0x6eb5('0x77'),'customeridtype',_0x6eb5('0x78'),_0x6eb5('0x79'),_0x6eb5('0x7a'),_0x6eb5('0x7b'),_0x6eb5('0x7c'),_0x6eb5('0x7d'),_0x6eb5('0x7e'),_0x6eb5('0x7f'),_0x6eb5('0x80'),_0x6eb5('0x81'),_0x6eb5('0x82'),_0x6eb5('0x83'),_0x6eb5('0x84'),_0x6eb5('0x85'),_0x6eb5('0x86'),_0x6eb5('0x87'),_0x6eb5('0x88'),_0x6eb5('0x89'),_0x6eb5('0x8a'),_0x6eb5('0x8b'),_0x6eb5('0x8c'),'msdyn_incidenttypename','msdyn_iotalertname',_0x6eb5('0x8d'),_0x6eb5('0x8e'),_0x6eb5('0x8f'),_0x6eb5('0x90'),_0x6eb5('0x91'),_0x6eb5('0x92'),_0x6eb5('0x93'),'primarycontactidname','primarycontactidyominame','prioritycodename','productidname',_0x6eb5('0x94'),_0x6eb5('0x95'),_0x6eb5('0x96'),_0x6eb5('0x97'),_0x6eb5('0x98'),'responsiblecontactidyominame',_0x6eb5('0x99'),'slainvokedidname','slaname',_0x6eb5('0x9a'),_0x6eb5('0x9b'),_0x6eb5('0x9c'),_0x6eb5('0x9d'),_0x6eb5('0x9e'),_0x6eb5('0x9f'),_0x6eb5('0xa0'),_0x6eb5('0xa1'),_0x6eb5('0xa2'),_0x6eb5('0xa3')];var _0x573922=_0x54e1f9['concat'](_0x459997);return db[_0x6eb5('0x39')][_0x6eb5('0x58')]({'where':{'id':_0x1302d6[_0x6eb5('0x4f')]['id']},'attributes':['id','username','password',_0x6eb5('0xa4'),'tenantId','clientId','clientSecret']})[_0x6eb5('0x32')](handleEntityNotFound(_0x22889a,null))['then'](function(_0x2c752f){if(_0x2c752f){_0x1b2da3=_0x2c752f[_0x6eb5('0xa4')];var _0x2a44d7=_0x1b2da3[_0x6eb5('0xa5')](-0x1);if(_0x2a44d7==='/'){_0x1b2da3=_0x1b2da3[_0x6eb5('0xa6')](0x0,_0x1b2da3['lastIndexOf'](_0x2a44d7));}_0x229666=util[_0x6eb5('0xa7')](_0x6eb5('0xa8'),_0x1b2da3);var _0x12fc5a={'method':'POST','uri':_0x6eb5('0xa9')+_0x2c752f[_0x6eb5('0xaa')]+_0x6eb5('0xab'),'form':{'client_id':_0x2c752f[_0x6eb5('0xac')],'resource':_0x1b2da3,'username':_0x2c752f[_0x6eb5('0xad')],'password':_0x2c752f[_0x6eb5('0xae')],'grant_type':_0x6eb5('0xae'),'client_secret':_0x2c752f[_0x6eb5('0xaf')]},'json':!![]};return rp(_0x12fc5a);}})[_0x6eb5('0x32')](function(_0x3efd87){_0xec4683=_0x3efd87['access_token'];var _0x3fd53a={'method':_0x6eb5('0xb0'),'uri':encodeURI(_0x229666+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x181a65+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xec4683,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3fd53a);})[_0x6eb5('0x32')](function(_0x1fb507){var _0x1e2a1f=_0x1fb507[_0x6eb5('0xb1')][0x0];var _0x1b6ad4=_0x1e2a1f[_0x6eb5('0xb2')];var _0x40281c={'method':_0x6eb5('0xb0'),'uri':_0x229666+_0x6eb5('0xb3')+_0x1b6ad4+_0x6eb5('0xb4'),'headers':{'Authorization':_0x6eb5('0xb5')+_0xec4683,'If-None-Match':null,'OData-Version':_0x6eb5('0xb6')},'json':!![]};return rp(_0x40281c);})['then'](function(_0x9fa6d1){_0x130093=_0x9fa6d1;_0x4d60d8=_0x130093[_0x6eb5('0xb7')];_0x4d60d8=_[_0x6eb5('0xb8')](_0x4d60d8,function(_0x6aec07){return!_0x573922[_0x6eb5('0xb9')](_0x6aec07[_0x6eb5('0xba')]);});var _0x3dbc35=[];var _0x14bf4e=[];_0x4d60d8[_0x6eb5('0xbb')](function(_0x309e52){if(_0x309e52[_0x6eb5('0xbc')]){var _0x47d0c4=_0x309e52[_0x6eb5('0xbc')][_0x6eb5('0xa6')](_0x309e52[_0x6eb5('0xbc')]['lastIndexOf']('.')+0x1);if(_0x47d0c4==='PicklistAttributeMetadata'){_0x3dbc35['push'](getSelectList(_0x229666,_0x2d007f,_0x14bf4e,_0x130093[_0x6eb5('0xb2')],_0x309e52[_0x6eb5('0xb2')],_0xec4683));}}});return Promise[_0x6eb5('0xbd')](_0x3dbc35);})['then'](function(_0x1c110a){_0x18d2c2=_0x1c110a[0x0];var _0x19051b=[];var _0x3e790f=[];_0x4d60d8['forEach'](function(_0x1734f3){if(!_[_0x6eb5('0xbe')](_0x1734f3[_0x6eb5('0xbc')])){var _0x2c76b9=_0x1734f3[_0x6eb5('0xbc')][_0x6eb5('0xa6')](_0x1734f3[_0x6eb5('0xbc')][_0x6eb5('0xbf')]('.')+0x1);if(_0x2c76b9===_0x6eb5('0xc0')){_0x19051b['push'](getBooleanList(_0x229666,_0x2d007f,_0x3e790f,_0x130093['MetadataId'],_0x1734f3[_0x6eb5('0xb2')],_0xec4683));}}});return Promise[_0x6eb5('0xbd')](_0x19051b);})[_0x6eb5('0x32')](function(_0x20a790){_0x24c267=_0x20a790[0x0];var _0x801fee=[];var _0x22efb2=[];_0x4d60d8[_0x6eb5('0xbb')](function(_0x2a5024){if(_0x2a5024[_0x6eb5('0xbc')]){var _0x24ca6a=_0x2a5024['@odata.type'][_0x6eb5('0xa6')](_0x2a5024[_0x6eb5('0xbc')]['lastIndexOf']('.')+0x1);if(_0x24ca6a===_0x6eb5('0xc1')||_0x24ca6a===_0x6eb5('0xc2')||_0x24ca6a===_0x6eb5('0xc3')||_0x24ca6a==='IntegerAttributeMetadata'||_0x24ca6a===_0x6eb5('0xc4')||_0x24ca6a===_0x6eb5('0xc5')||_0x24ca6a===_0x6eb5('0xc6')||_0x24ca6a===_0x6eb5('0xc7')||_0x24ca6a==='StateAttributeMetadata'||_0x24ca6a===_0x6eb5('0xc8')){_0x801fee[_0x6eb5('0xc9')](getInputList(_0x229666,_0x2d007f,_0x24ca6a,_0x22efb2,_0x130093['MetadataId'],_0x2a5024['MetadataId'],_0xec4683));}}});return Promise['all'](_0x801fee);})['then'](function(_0x1b57d0){_0x5d268f=_0x1b57d0[0x0];var _0x12dc0b=_0x18d2c2[_0x6eb5('0xca')](_0x24c267)['concat'](_0x5d268f);var _0x1d10d4={'count':_0x12dc0b['length'],'rows':_0x12dc0b};return _0x1d10d4;})[_0x6eb5('0x32')](respondWithResult(_0x22889a,null))[_0x6eb5('0x25')](function(_0x474098){var _0x30a50d=_0x1302d6[_0x6eb5('0x40')][_0x6eb5('0xcb')]?0x1f4:_0x474098[_0x6eb5('0xcc')]||0x1f4;logger['error'](_0x474098['stack']);delete _0x474098[_0x6eb5('0x35')];if(_0x30a50d===0x191){_0x30a50d=0x190;}_0x22889a[_0x6eb5('0x2d')](_0x30a50d)['send'](_0x1302d6[_0x6eb5('0x40')][_0x6eb5('0xcb')]?{'message':_0x6eb5('0xcd'),'statusCode':_0x474098['statusCode']}:_0x474098);});};function getSelectList(_0x22380e,_0x3a48be,_0x203e84,_0x44637a,_0x4ea35a,_0x41116d){var _0x8cba8e={'method':_0x6eb5('0xb0'),'uri':_0x22380e+_0x6eb5('0xb3')+_0x44637a+')/Attributes('+_0x4ea35a+_0x6eb5('0xce')+_0x6eb5('0xcf'),'headers':{'Authorization':_0x6eb5('0xb5')+_0x41116d,'If-None-Match':null,'OData-Version':_0x6eb5('0xb6')},'json':!![]};return rp(_0x8cba8e)[_0x6eb5('0x32')](function(_0x39f711){var _0x45f6d2=[];var _0x4d5449=_0x39f711[_0x6eb5('0xd0')][_0x6eb5('0xd1')];_0x4d5449['forEach'](function(_0x58a0ed){_0x45f6d2['push']({'name':_0x58a0ed[_0x6eb5('0xd2')][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'value':String(_0x58a0ed['Value'])});});var _0x11eda3={'id':_0x3a48be+'_'+_0x39f711[_0x6eb5('0xba')],'name':_0x39f711[_0x6eb5('0xd4')]['UserLocalizedLabel'][_0x6eb5('0xd2')],'custom':![],'options':_0x45f6d2};_0x203e84['push'](_0x11eda3);return _0x203e84;});}function getBooleanList(_0x2ede21,_0x5e1a8a,_0x608457,_0x3107f7,_0x513204,_0x35234b){var _0x45f203={'method':'GET','uri':_0x2ede21+_0x6eb5('0xb3')+_0x3107f7+_0x6eb5('0xd5')+_0x513204+_0x6eb5('0xd6'),'headers':{'Authorization':_0x6eb5('0xb5')+_0x35234b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x45f203)[_0x6eb5('0x32')](function(_0x526744){var _0x4325cd=[];_0x4325cd[_0x6eb5('0xc9')]({'name':_0x526744[_0x6eb5('0xd0')][_0x6eb5('0xd7')]['Label'][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'value':_0x6eb5('0xd8')},{'name':_0x526744[_0x6eb5('0xd0')]['FalseOption'][_0x6eb5('0xd2')][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'value':_0x6eb5('0xd9')});var _0x225630={'id':_0x5e1a8a+'_'+_0x526744['LogicalName'],'name':_0x526744[_0x6eb5('0xd4')][_0x6eb5('0xd3')][_0x6eb5('0xd2')],'custom':![],'options':_0x4325cd};_0x608457[_0x6eb5('0xc9')](_0x225630);return _0x608457;});}function getInputList(_0x3a7a3d,_0x18cdb7,_0x25874f,_0x5d999a,_0x5a06fd,_0x1e9641,_0x544a59){var _0xbce53a={'method':_0x6eb5('0xb0'),'uri':_0x3a7a3d+_0x6eb5('0xb3')+_0x5a06fd+')/Attributes('+_0x1e9641+')/Microsoft.Dynamics.CRM.'+_0x25874f+_0x6eb5('0xda'),'headers':{'Authorization':_0x6eb5('0xb5')+_0x544a59,'If-None-Match':null,'OData-Version':_0x6eb5('0xb6')},'json':!![]};return rp(_0xbce53a)['then'](function(_0x2caf89){var _0x1d2bba={'id':_0x18cdb7+'_'+_0x2caf89[_0x6eb5('0xba')],'name':_0x2caf89['DisplayName'][_0x6eb5('0xd3')]?_0x2caf89[_0x6eb5('0xd4')][_0x6eb5('0xd3')][_0x6eb5('0xd2')]:_0x2caf89[_0x6eb5('0xba')],'custom':![],'options':[]};_0x5d999a[_0x6eb5('0xc9')](_0x1d2bba);return _0x5d999a;});}
\ No newline at end of file
index 3b5a4eb..46428ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4387a8,_0x47f48c){var _0x47acb6=function(_0x19cadc){while(--_0x19cadc){_0x4387a8['push'](_0x4387a8['shift']());}};_0x47acb6(++_0x47f48c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./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 9424c8c..20bd41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c68=['limit','include','model','map','GetDynamics365Account','catch','raw','ShowDynamics365Account','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account','findAll','options','attributes'];(function(_0x1a9b87,_0x4b9987){var _0x3e5a50=function(_0x488ffa){while(--_0x488ffa){_0x1a9b87['push'](_0x1a9b87['shift']());}};_0x3e5a50(++_0x4b9987);}(_0x9c68,0x194));var _0x89c6=function(_0x32abe8,_0x41f2b0){_0x32abe8=_0x32abe8-0x0;var _0x52c9de=_0x9c68[_0x32abe8];return _0x52c9de;};'use strict';var _=require(_0x89c6('0x0'));var util=require(_0x89c6('0x1'));var moment=require('moment');var BPromise=require(_0x89c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89c6('0x3'));var db=require(_0x89c6('0x4'))['db'];var utils=require(_0x89c6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x89c6('0x6'));var jayson=require(_0x89c6('0x7'));var client=jayson[_0x89c6('0x8')][_0x89c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x440cbd,_0x43b50b,_0x2a28a4){return new BPromise(function(_0x3b8b1f,_0x140822){return client[_0x89c6('0xa')](_0x440cbd,_0x2a28a4)[_0x89c6('0xb')](function(_0xaf3a45){logger[_0x89c6('0xc')](_0x89c6('0xd'),_0x43b50b,_0x89c6('0xe'));logger[_0x89c6('0xf')](_0x89c6('0x10'),_0x43b50b,_0x89c6('0xe'),JSON[_0x89c6('0x11')](_0xaf3a45));if(_0xaf3a45[_0x89c6('0x12')]){if(_0xaf3a45['error'][_0x89c6('0x13')]===0x1f4){logger[_0x89c6('0x12')](_0x89c6('0xd'),_0x43b50b,_0xaf3a45[_0x89c6('0x12')][_0x89c6('0x14')]);return _0x140822(_0xaf3a45['error'][_0x89c6('0x14')]);}logger[_0x89c6('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x43b50b,_0xaf3a45[_0x89c6('0x12')][_0x89c6('0x14')]);return _0x3b8b1f(_0xaf3a45[_0x89c6('0x12')]['message']);}else{logger[_0x89c6('0xc')](_0x89c6('0xd'),_0x43b50b,_0x89c6('0xe'));_0x3b8b1f(_0xaf3a45['result'][_0x89c6('0x14')]);}})['catch'](function(_0x4addce){logger[_0x89c6('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x43b50b,_0x4addce);_0x140822(_0x4addce);});});}exports['GetDynamics365Account']=function(_0x12a868){var _0x43592c=this;return new Promise(function(_0x16f044,_0x45944c){return db[_0x89c6('0x15')][_0x89c6('0x16')]({'raw':_0x12a868[_0x89c6('0x17')]?_0x12a868[_0x89c6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x12a868[_0x89c6('0x17')]?_0x12a868[_0x89c6('0x17')]['where']||null:null,'attributes':_0x12a868[_0x89c6('0x17')]?_0x12a868[_0x89c6('0x17')][_0x89c6('0x18')]||null:null,'limit':_0x12a868[_0x89c6('0x17')]?_0x12a868[_0x89c6('0x17')][_0x89c6('0x19')]||null:null,'include':_0x12a868['options']?_0x12a868['options']['include']?_['map'](_0x12a868['options'][_0x89c6('0x1a')],function(_0x53b702){return{'model':db[_0x53b702[_0x89c6('0x1b')]],'as':_0x53b702['as'],'attributes':_0x53b702[_0x89c6('0x18')],'include':_0x53b702['include']?_[_0x89c6('0x1c')](_0x53b702['include'],function(_0x4ac59a){return{'model':db[_0x4ac59a[_0x89c6('0x1b')]],'as':_0x4ac59a['as'],'attributes':_0x4ac59a[_0x89c6('0x18')],'include':_0x4ac59a[_0x89c6('0x1a')]?_['map'](_0x4ac59a[_0x89c6('0x1a')],function(_0x5105d0){return{'model':db[_0x5105d0[_0x89c6('0x1b')]],'as':_0x5105d0['as'],'attributes':_0x5105d0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x292833){logger[_0x89c6('0xc')](_0x89c6('0x1d'),_0x12a868);logger[_0x89c6('0xf')]('GetDynamics365Account',_0x12a868,JSON['stringify'](_0x292833));_0x16f044(_0x292833);})[_0x89c6('0x1e')](function(_0x1513a4){logger[_0x89c6('0x12')](_0x89c6('0x1d'),_0x1513a4[_0x89c6('0x14')],_0x12a868);_0x45944c(_0x43592c[_0x89c6('0x12')](0x1f4,_0x1513a4['message']));});});};exports['ShowDynamics365Account']=function(_0x2cd737){var _0x57740d=this;return new Promise(function(_0x23b3f3,_0x3dc444){return db[_0x89c6('0x15')]['find']({'raw':_0x2cd737[_0x89c6('0x17')]?_0x2cd737[_0x89c6('0x17')][_0x89c6('0x1f')]===undefined?!![]:![]:!![],'where':_0x2cd737[_0x89c6('0x17')]?_0x2cd737[_0x89c6('0x17')]['where']||null:null,'attributes':_0x2cd737[_0x89c6('0x17')]?_0x2cd737[_0x89c6('0x17')]['attributes']||null:null,'include':_0x2cd737[_0x89c6('0x17')]?_0x2cd737[_0x89c6('0x17')][_0x89c6('0x1a')]?_[_0x89c6('0x1c')](_0x2cd737[_0x89c6('0x17')][_0x89c6('0x1a')],function(_0x447cb3){return{'model':db[_0x447cb3[_0x89c6('0x1b')]],'as':_0x447cb3['as'],'attributes':_0x447cb3[_0x89c6('0x18')],'include':_0x447cb3[_0x89c6('0x1a')]?_[_0x89c6('0x1c')](_0x447cb3['include'],function(_0x23bdfb){return{'model':db[_0x23bdfb[_0x89c6('0x1b')]],'as':_0x23bdfb['as'],'attributes':_0x23bdfb['attributes'],'include':_0x23bdfb[_0x89c6('0x1a')]?_[_0x89c6('0x1c')](_0x23bdfb['include'],function(_0xfe0f0e){return{'model':db[_0xfe0f0e[_0x89c6('0x1b')]],'as':_0xfe0f0e['as'],'attributes':_0xfe0f0e[_0x89c6('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33f004){logger['info']('ShowDynamics365Account',_0x2cd737);logger[_0x89c6('0xf')](_0x89c6('0x20'),_0x2cd737,JSON[_0x89c6('0x11')](_0x33f004));_0x23b3f3(_0x33f004);})['catch'](function(_0xe283b2){logger[_0x89c6('0x12')](_0x89c6('0x20'),_0xe283b2[_0x89c6('0x14')],_0x2cd737);_0x3dc444(_0x57740d['error'](0x1f4,_0xe283b2[_0x89c6('0x14')]));});});};
\ No newline at end of file
+var _0x9e70=['request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','model','map','attributes','catch','ShowDynamics365Account','find','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x1d33dd,_0x5f00e0){var _0x2356d7=function(_0x3300c5){while(--_0x3300c5){_0x1d33dd['push'](_0x1d33dd['shift']());}};_0x2356d7(++_0x5f00e0);}(_0x9e70,0x121));var _0x09e7=function(_0x18e6d9,_0x362a7e){_0x18e6d9=_0x18e6d9-0x0;var _0x1e9fa5=_0x9e70[_0x18e6d9];return _0x1e9fa5;};'use strict';var _=require(_0x09e7('0x0'));var util=require('util');var moment=require(_0x09e7('0x1'));var BPromise=require(_0x09e7('0x2'));var rs=require(_0x09e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x09e7('0x4'));var logger=require(_0x09e7('0x5'))('rpc');var config=require(_0x09e7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x09e7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x561501,_0x1a8a84,_0x1665f0){return new BPromise(function(_0x11815b,_0x5eb576){return client[_0x09e7('0x8')](_0x561501,_0x1665f0)[_0x09e7('0x9')](function(_0x26e7e8){logger[_0x09e7('0xa')](_0x09e7('0xb'),_0x1a8a84,_0x09e7('0xc'));logger[_0x09e7('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1a8a84,_0x09e7('0xc'),JSON[_0x09e7('0xe')](_0x26e7e8));if(_0x26e7e8[_0x09e7('0xf')]){if(_0x26e7e8[_0x09e7('0xf')][_0x09e7('0x10')]===0x1f4){logger[_0x09e7('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x1a8a84,_0x26e7e8[_0x09e7('0xf')][_0x09e7('0x11')]);return _0x5eb576(_0x26e7e8[_0x09e7('0xf')][_0x09e7('0x11')]);}logger['error'](_0x09e7('0xb'),_0x1a8a84,_0x26e7e8['error']['message']);return _0x11815b(_0x26e7e8[_0x09e7('0xf')]['message']);}else{logger[_0x09e7('0xa')](_0x09e7('0xb'),_0x1a8a84,_0x09e7('0xc'));_0x11815b(_0x26e7e8[_0x09e7('0x12')]['message']);}})['catch'](function(_0x2b40ed){logger['error'](_0x09e7('0xb'),_0x1a8a84,_0x2b40ed);_0x5eb576(_0x2b40ed);});});}exports[_0x09e7('0x13')]=function(_0x4d249a){var _0x493e82=this;return new Promise(function(_0x5e673f,_0x17eab6){return db[_0x09e7('0x14')][_0x09e7('0x15')]({'raw':_0x4d249a['options']?_0x4d249a[_0x09e7('0x16')][_0x09e7('0x17')]===undefined?!![]:![]:!![],'where':_0x4d249a[_0x09e7('0x16')]?_0x4d249a['options'][_0x09e7('0x18')]||null:null,'attributes':_0x4d249a[_0x09e7('0x16')]?_0x4d249a[_0x09e7('0x16')]['attributes']||null:null,'limit':_0x4d249a[_0x09e7('0x16')]?_0x4d249a[_0x09e7('0x16')][_0x09e7('0x19')]||null:null,'include':_0x4d249a[_0x09e7('0x16')]?_0x4d249a[_0x09e7('0x16')]['include']?_['map'](_0x4d249a[_0x09e7('0x16')][_0x09e7('0x1a')],function(_0x3401fd){return{'model':db[_0x3401fd[_0x09e7('0x1b')]],'as':_0x3401fd['as'],'attributes':_0x3401fd['attributes'],'include':_0x3401fd[_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x3401fd[_0x09e7('0x1a')],function(_0x552de7){return{'model':db[_0x552de7[_0x09e7('0x1b')]],'as':_0x552de7['as'],'attributes':_0x552de7[_0x09e7('0x1d')],'include':_0x552de7['include']?_[_0x09e7('0x1c')](_0x552de7['include'],function(_0x2054a3){return{'model':db[_0x2054a3[_0x09e7('0x1b')]],'as':_0x2054a3['as'],'attributes':_0x2054a3[_0x09e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x09e7('0x9')](function(_0x1c81ad){logger[_0x09e7('0xa')](_0x09e7('0x13'),_0x4d249a);logger['debug']('GetDynamics365Account',_0x4d249a,JSON[_0x09e7('0xe')](_0x1c81ad));_0x5e673f(_0x1c81ad);})[_0x09e7('0x1e')](function(_0x52e511){logger[_0x09e7('0xf')](_0x09e7('0x13'),_0x52e511['message'],_0x4d249a);_0x17eab6(_0x493e82[_0x09e7('0xf')](0x1f4,_0x52e511[_0x09e7('0x11')]));});});};exports[_0x09e7('0x1f')]=function(_0x3aa2b7){var _0x3ccd0f=this;return new Promise(function(_0x6aa96b,_0x102823){return db[_0x09e7('0x14')][_0x09e7('0x20')]({'raw':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')][_0x09e7('0x18')]||null:null,'attributes':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')]['attributes']||null:null,'include':_0x3aa2b7[_0x09e7('0x16')]?_0x3aa2b7[_0x09e7('0x16')][_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x3aa2b7[_0x09e7('0x16')][_0x09e7('0x1a')],function(_0x5abf6e){return{'model':db[_0x5abf6e['model']],'as':_0x5abf6e['as'],'attributes':_0x5abf6e[_0x09e7('0x1d')],'include':_0x5abf6e[_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x5abf6e[_0x09e7('0x1a')],function(_0x3d8a48){return{'model':db[_0x3d8a48[_0x09e7('0x1b')]],'as':_0x3d8a48['as'],'attributes':_0x3d8a48[_0x09e7('0x1d')],'include':_0x3d8a48[_0x09e7('0x1a')]?_[_0x09e7('0x1c')](_0x3d8a48['include'],function(_0x2ff79a){return{'model':db[_0x2ff79a['model']],'as':_0x2ff79a['as'],'attributes':_0x2ff79a['attributes']};}):[]};}):[]};}):[]:[]})[_0x09e7('0x9')](function(_0x4df50f){logger[_0x09e7('0xa')]('ShowDynamics365Account',_0x3aa2b7);logger[_0x09e7('0xd')]('ShowDynamics365Account',_0x3aa2b7,JSON['stringify'](_0x4df50f));_0x6aa96b(_0x4df50f);})[_0x09e7('0x1e')](function(_0x32fa0b){logger['error'](_0x09e7('0x1f'),_0x32fa0b[_0x09e7('0x11')],_0x3aa2b7);_0x102823(_0x3ccd0f[_0x09e7('0xf')](0x1f4,_0x32fa0b[_0x09e7('0x11')]));});});};
\ No newline at end of file
index 0bb732d..78100d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ff5=['/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x431b38,_0x24aba7){var _0x20be54=function(_0xe90722){while(--_0xe90722){_0x431b38['push'](_0x431b38['shift']());}};_0x20be54(++_0x24aba7);}(_0x7ff5,0xcd));var _0x57ff=function(_0x13a017,_0x27703e){_0x13a017=_0x13a017-0x0;var _0x541441=_0x7ff5[_0x13a017];return _0x541441;};'use strict';var multer=require('multer');var util=require(_0x57ff('0x0'));var path=require(_0x57ff('0x1'));var timeout=require(_0x57ff('0x2'));var express=require('express');var router=express[_0x57ff('0x3')]();var fs_extra=require(_0x57ff('0x4'));var auth=require(_0x57ff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57ff('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x57ff('0x7')]('/',auth[_0x57ff('0x8')](),controller[_0x57ff('0x9')]);router[_0x57ff('0x7')]('/:id',auth[_0x57ff('0x8')](),controller[_0x57ff('0xa')]);router[_0x57ff('0x7')](_0x57ff('0xb'),auth[_0x57ff('0x8')](),controller[_0x57ff('0xc')]);router[_0x57ff('0x7')](_0x57ff('0xd'),auth['isAuthenticated'](),controller[_0x57ff('0xe')]);router[_0x57ff('0x7')](_0x57ff('0xf'),auth[_0x57ff('0x8')](),controller[_0x57ff('0x10')]);router[_0x57ff('0x11')]('/',auth['isAuthenticated'](),controller[_0x57ff('0x12')]);router[_0x57ff('0x13')](_0x57ff('0x14'),auth[_0x57ff('0x8')](),controller[_0x57ff('0x15')]);router[_0x57ff('0x16')](_0x57ff('0x14'),auth[_0x57ff('0x8')](),controller[_0x57ff('0x17')]);module[_0x57ff('0x18')]=router;
\ No newline at end of file
+var _0x3070=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x3070,0x75));var _0x0307=function(_0x38266e,_0x1215ca){_0x38266e=_0x38266e-0x0;var _0x372c2d=_0x3070[_0x38266e];return _0x372c2d;};'use strict';var multer=require('multer');var util=require(_0x0307('0x0'));var path=require('path');var timeout=require(_0x0307('0x1'));var express=require(_0x0307('0x2'));var router=express[_0x0307('0x3')]();var fs_extra=require(_0x0307('0x4'));var auth=require(_0x0307('0x5'));var interaction=require(_0x0307('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router[_0x0307('0x7')]('/',auth[_0x0307('0x8')](),controller[_0x0307('0x9')]);router[_0x0307('0x7')]('/:id',auth[_0x0307('0x8')](),controller[_0x0307('0xa')]);router['get'](_0x0307('0xb'),auth[_0x0307('0x8')](),controller[_0x0307('0xc')]);router[_0x0307('0x7')](_0x0307('0xd'),auth[_0x0307('0x8')](),controller[_0x0307('0xe')]);router[_0x0307('0x7')](_0x0307('0xf'),auth['isAuthenticated'](),controller[_0x0307('0x10')]);router['post']('/',auth[_0x0307('0x8')](),controller[_0x0307('0x11')]);router[_0x0307('0x12')](_0x0307('0x13'),auth[_0x0307('0x8')](),controller[_0x0307('0x14')]);router[_0x0307('0x15')](_0x0307('0x13'),auth[_0x0307('0x8')](),controller[_0x0307('0x16')]);module[_0x0307('0x17')]=router;
\ No newline at end of file
index bb305a5..bca2e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26de=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26de,0x190));var _0xe26d=function(_0x2443d9,_0x32d420){_0x2443d9=_0x2443d9-0x0;var _0x12f606=_0x26de[_0x2443d9];return _0x12f606;};'use strict';var Sequelize=require(_0xe26d('0x0'));module[_0xe26d('0x1')]={'name':{'type':Sequelize[_0xe26d('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe26d('0x3')](_0xe26d('0x4'),_0xe26d('0x5')),'defaultValue':_0xe26d('0x4')}};
\ No newline at end of file
+var _0xfae0=['STRING','ENUM','incident','phonecall','exports'];(function(_0x4bcbfc,_0x312cea){var _0x520817=function(_0x32cc21){while(--_0x32cc21){_0x4bcbfc['push'](_0x4bcbfc['shift']());}};_0x520817(++_0x312cea);}(_0xfae0,0xdb));var _0x0fae=function(_0x5352d0,_0x41e8b4){_0x5352d0=_0x5352d0-0x0;var _0x352b00=_0xfae0[_0x5352d0];return _0x352b00;};'use strict';var Sequelize=require('sequelize');module[_0x0fae('0x0')]={'name':{'type':Sequelize[_0x0fae('0x1')]},'description':{'type':Sequelize[_0x0fae('0x1')]},'ticketType':{'type':Sequelize[_0x0fae('0x2')](_0x0fae('0x3'),_0x0fae('0x4')),'defaultValue':_0x0fae('0x3')}};
\ No newline at end of file
index f478a90..3ef0e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3eb=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','create','update','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','end','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0xb3eb,0x77));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb3e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb3e('0x1'));var moment=require(_0xbb3e('0x2'));var BPromise=require(_0xbb3e('0x3'));var Mustache=require(_0xbb3e('0x4'));var util=require(_0xbb3e('0x5'));var path=require(_0xbb3e('0x6'));var sox=require(_0xbb3e('0x7'));var csv=require(_0xbb3e('0x8'));var ejs=require(_0xbb3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbb3e('0xa'));var crypto=require('crypto');var jsforce=require(_0xbb3e('0xb'));var deskjs=require(_0xbb3e('0xc'));var toCsv=require(_0xbb3e('0x8'));var querystring=require('querystring');var Papa=require(_0xbb3e('0xd'));var Redis=require(_0xbb3e('0xe'));var authService=require(_0xbb3e('0xf'));var qs=require(_0xbb3e('0x10'));var as=require(_0xbb3e('0x11'));var hardwareService=require(_0xbb3e('0x12'));var logger=require(_0xbb3e('0x13'))(_0xbb3e('0x14'));var utils=require(_0xbb3e('0x15'));var config=require(_0xbb3e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb3e('0x17'))['db'];var jayson=require(_0xbb3e('0x18'));var client=jayson[_0xbb3e('0x19')][_0xbb3e('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x27190b,_0x535818,_0x2bbc65,_0x31cdd3){return new BPromise(function(_0x16d82c,_0x2e7794){var _0x2d1153=_0x31cdd3||client;return _0x2d1153[_0xbb3e('0x1b')](_0x27190b,_0x2bbc65)[_0xbb3e('0x1c')](function(_0x2ebdc2){logger['info'](_0xbb3e('0x1d'),_0x535818,_0xbb3e('0x1e'));logger[_0xbb3e('0x1f')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x535818,_0xbb3e('0x1e'),JSON[_0xbb3e('0x20')](_0x2ebdc2));if(_0x2ebdc2[_0xbb3e('0x21')]){if(_0x2ebdc2[_0xbb3e('0x21')][_0xbb3e('0x22')]===0x1f4){logger[_0xbb3e('0x21')](_0xbb3e('0x1d'),_0x535818,_0x2ebdc2[_0xbb3e('0x21')]['message']);return _0x2e7794(_0x2ebdc2[_0xbb3e('0x21')][_0xbb3e('0x23')]);}logger[_0xbb3e('0x21')](_0xbb3e('0x1d'),_0x535818,_0x2ebdc2['error'][_0xbb3e('0x23')]);return _0x16d82c(_0x2ebdc2[_0xbb3e('0x21')][_0xbb3e('0x23')]);}else{logger[_0xbb3e('0x24')]('Dynamics365Configuration,\x20%s,\x20%s',_0x535818,'request\x20sent');_0x16d82c(_0x2ebdc2['result'][_0xbb3e('0x23')]);}})[_0xbb3e('0x25')](function(_0x8d1d7){logger[_0xbb3e('0x21')](_0xbb3e('0x1d'),_0x535818,_0x8d1d7);_0x2e7794(_0x8d1d7);});});}function respondWithStatusCode(_0x465a4e,_0x280fa8){_0x280fa8=_0x280fa8||0xcc;return function(_0x223ddb){if(_0x223ddb){return _0x465a4e[_0xbb3e('0x26')](_0x280fa8);}return _0x465a4e['status'](_0x280fa8)['end']();};}function respondWithResult(_0x2ede5b,_0x102681){_0x102681=_0x102681||0xc8;return function(_0x1515d7){if(_0x1515d7){return _0x2ede5b[_0xbb3e('0x27')](_0x102681)[_0xbb3e('0x28')](_0x1515d7);}};}function respondWithFilteredResult(_0x4cd1b4,_0x3d603d){return function(_0x2fe22f){if(_0x2fe22f){var _0x5375ba=typeof _0x3d603d['offset']===_0xbb3e('0x29')&&typeof _0x3d603d['limit']===_0xbb3e('0x29');var _0x4b6377=_0x2fe22f[_0xbb3e('0x2a')];var _0x47cad7=_0x5375ba?0x0:_0x3d603d['offset'];var _0x4730f7=_0x5375ba?_0x2fe22f[_0xbb3e('0x2a')]:_0x3d603d[_0xbb3e('0x2b')]+_0x3d603d[_0xbb3e('0x2c')];var _0x13a04c;if(_0x4730f7>=_0x4b6377){_0x4730f7=_0x4b6377;_0x13a04c=0xc8;}else{_0x13a04c=0xce;}_0x4cd1b4[_0xbb3e('0x27')](_0x13a04c);return _0x4cd1b4['set'](_0xbb3e('0x2d'),_0x47cad7+'-'+_0x4730f7+'/'+_0x4b6377)[_0xbb3e('0x28')](_0x2fe22f);}return null;};}function patchUpdates(_0x468dc7){return function(_0x9234cc){try{jsonpatch[_0xbb3e('0x2e')](_0x9234cc,_0x468dc7,!![]);}catch(_0x564dc9){return BPromise[_0xbb3e('0x2f')](_0x564dc9);}return _0x9234cc[_0xbb3e('0x30')]();};}function saveUpdates(_0x15bbc6,_0x296101){return function(_0x2548d4){if(_0x2548d4){return _0x2548d4['update'](_0x15bbc6)[_0xbb3e('0x1c')](function(_0x1899b9){return _0x1899b9;});}return null;};}function removeEntity(_0x152d6c,_0x4fa7a7){return function(_0x5839df){if(_0x5839df){return _0x5839df[_0xbb3e('0x31')]()[_0xbb3e('0x1c')](function(){_0x152d6c['status'](0xcc)[_0xbb3e('0x32')]();});}};}function handleEntityNotFound(_0x436cc5,_0x3db906){return function(_0x4d00a4){if(!_0x4d00a4){_0x436cc5['sendStatus'](0x194);}return _0x4d00a4;};}function handleError(_0x12ca1f,_0x4cb099){_0x4cb099=_0x4cb099||0x1f4;return function(_0x45b1ea){logger[_0xbb3e('0x21')](_0x45b1ea[_0xbb3e('0x33')]);if(_0x45b1ea[_0xbb3e('0x34')]){delete _0x45b1ea[_0xbb3e('0x34')];}_0x12ca1f[_0xbb3e('0x27')](_0x4cb099)[_0xbb3e('0x35')](_0x45b1ea);};}exports['index']=function(_0x2d3b16,_0x296ced){var _0x5a7da7={},_0x2c469e={},_0x2b7359={'count':0x0,'rows':[]};var _0x5b5f39=_[_0xbb3e('0x36')](db[_0xbb3e('0x37')][_0xbb3e('0x38')],function(_0x57ab0b){return{'name':_0x57ab0b[_0xbb3e('0x39')],'type':_0x57ab0b[_0xbb3e('0x3a')][_0xbb3e('0x3b')]};});_0x2c469e[_0xbb3e('0x3c')]=_[_0xbb3e('0x36')](_0x5b5f39,'name');_0x2c469e[_0xbb3e('0x3d')]=_[_0xbb3e('0x3e')](_0x2d3b16[_0xbb3e('0x3d')]);_0x2c469e[_0xbb3e('0x3f')]=_[_0xbb3e('0x40')](_0x2c469e[_0xbb3e('0x3c')],_0x2c469e[_0xbb3e('0x3d')]);_0x5a7da7['attributes']=_[_0xbb3e('0x40')](_0x2c469e[_0xbb3e('0x3c')],qs[_0xbb3e('0x41')](_0x2d3b16['query']['fields']));_0x5a7da7[_0xbb3e('0x42')]=_0x5a7da7[_0xbb3e('0x42')][_0xbb3e('0x43')]?_0x5a7da7['attributes']:_0x2c469e[_0xbb3e('0x3c')];if(!_0x2d3b16[_0xbb3e('0x3d')][_0xbb3e('0x44')](_0xbb3e('0x45'))){_0x5a7da7['limit']=qs[_0xbb3e('0x2c')](_0x2d3b16[_0xbb3e('0x3d')][_0xbb3e('0x2c')]);_0x5a7da7[_0xbb3e('0x2b')]=qs['offset'](_0x2d3b16['query'][_0xbb3e('0x2b')]);}_0x5a7da7[_0xbb3e('0x46')]=qs[_0xbb3e('0x47')](_0x2d3b16['query'][_0xbb3e('0x47')]);_0x5a7da7['where']=qs[_0xbb3e('0x3f')](_[_0xbb3e('0x48')](_0x2d3b16[_0xbb3e('0x3d')],_0x2c469e[_0xbb3e('0x3f')]),_0x5b5f39);if(_0x2d3b16[_0xbb3e('0x3d')][_0xbb3e('0x49')]){_0x5a7da7[_0xbb3e('0x4a')]=_[_0xbb3e('0x4b')](_0x5a7da7['where'],{'$or':_[_0xbb3e('0x36')](_0x5b5f39,function(_0x4c535f){if(_0x4c535f[_0xbb3e('0x3a')]!==_0xbb3e('0x4c')){var _0x12668c={};_0x12668c[_0x4c535f['name']]={'$like':'%'+_0x2d3b16[_0xbb3e('0x3d')]['filter']+'%'};return _0x12668c;}})});}_0x5a7da7=_[_0xbb3e('0x4b')]({},_0x5a7da7,_0x2d3b16[_0xbb3e('0x4d')]);var _0x4acf68={'where':_0x5a7da7[_0xbb3e('0x4a')]};return db[_0xbb3e('0x37')]['count'](_0x4acf68)[_0xbb3e('0x1c')](function(_0x7cef31){_0x2b7359[_0xbb3e('0x2a')]=_0x7cef31;if(_0x2d3b16[_0xbb3e('0x3d')][_0xbb3e('0x4e')]){_0x5a7da7[_0xbb3e('0x4f')]=[{'all':!![]}];}return db[_0xbb3e('0x37')]['findAll'](_0x5a7da7);})[_0xbb3e('0x1c')](function(_0x199b2c){_0x2b7359[_0xbb3e('0x50')]=_0x199b2c;return _0x2b7359;})['then'](respondWithFilteredResult(_0x296ced,_0x5a7da7))[_0xbb3e('0x25')](handleError(_0x296ced,null));};exports['show']=function(_0x191c39,_0x50e679){var _0x3f2a57={'raw':![],'where':{'id':_0x191c39[_0xbb3e('0x51')]['id']}},_0x3463da={};_0x3463da['model']=_[_0xbb3e('0x3e')](db[_0xbb3e('0x37')][_0xbb3e('0x38')]);_0x3463da[_0xbb3e('0x3d')]=_['keys'](_0x191c39[_0xbb3e('0x3d')]);_0x3463da['filters']=_[_0xbb3e('0x40')](_0x3463da['model'],_0x3463da[_0xbb3e('0x3d')]);_0x3f2a57['attributes']=_[_0xbb3e('0x40')](_0x3463da[_0xbb3e('0x3c')],qs['fields'](_0x191c39['query']['fields']));_0x3f2a57[_0xbb3e('0x42')]=_0x3f2a57[_0xbb3e('0x42')][_0xbb3e('0x43')]?_0x3f2a57[_0xbb3e('0x42')]:_0x3463da[_0xbb3e('0x3c')];if(_0x191c39[_0xbb3e('0x3d')]['includeAll']){_0x3f2a57[_0xbb3e('0x4f')]=[{'all':!![]}];}_0x3f2a57=_['merge']({},_0x3f2a57,_0x191c39[_0xbb3e('0x4d')]);return db[_0xbb3e('0x37')]['find'](_0x3f2a57)[_0xbb3e('0x1c')](handleEntityNotFound(_0x50e679,null))['then'](respondWithResult(_0x50e679,null))['catch'](handleError(_0x50e679,null));};exports[_0xbb3e('0x52')]=function(_0x2973f1,_0x316dde){return db['Dynamics365Configuration'][_0xbb3e('0x52')](_0x2973f1['body'],{})[_0xbb3e('0x1c')](respondWithResult(_0x316dde,0xc9))[_0xbb3e('0x25')](handleError(_0x316dde,null));};exports[_0xbb3e('0x53')]=function(_0x32ef0e,_0x3516ea){if(_0x32ef0e['body']['id']){delete _0x32ef0e[_0xbb3e('0x54')]['id'];}return db[_0xbb3e('0x37')]['find']({'where':{'id':_0x32ef0e[_0xbb3e('0x51')]['id']}})['then'](handleEntityNotFound(_0x3516ea,null))[_0xbb3e('0x1c')](saveUpdates(_0x32ef0e[_0xbb3e('0x54')],null))['then'](respondWithResult(_0x3516ea,null))[_0xbb3e('0x25')](handleError(_0x3516ea,null));};exports['destroy']=function(_0x4a103f,_0x2cdac3){return db[_0xbb3e('0x37')][_0xbb3e('0x55')]({'where':{'id':_0x4a103f[_0xbb3e('0x51')]['id']}})[_0xbb3e('0x1c')](handleEntityNotFound(_0x2cdac3,null))['then'](removeEntity(_0x2cdac3,null))[_0xbb3e('0x25')](handleError(_0x2cdac3,null));};exports[_0xbb3e('0x56')]=function(_0x505395,_0x349d8d,_0x3df178){var _0x2b6cad={};var _0xdd3ae3={};var _0x255f05;var _0x293c6c;return db[_0xbb3e('0x37')][_0xbb3e('0x57')]({'where':{'id':_0x505395[_0xbb3e('0x51')]['id']}})[_0xbb3e('0x1c')](handleEntityNotFound(_0x349d8d,null))[_0xbb3e('0x1c')](function(_0x358ce1){if(_0x358ce1){_0x255f05=_0x358ce1;_0xdd3ae3['model']=_[_0xbb3e('0x3e')](db[_0xbb3e('0x58')][_0xbb3e('0x38')]);_0xdd3ae3[_0xbb3e('0x3d')]=_[_0xbb3e('0x3e')](_0x505395['query']);_0xdd3ae3[_0xbb3e('0x3f')]=_[_0xbb3e('0x40')](_0xdd3ae3['model'],_0xdd3ae3[_0xbb3e('0x3d')]);_0x2b6cad[_0xbb3e('0x42')]=_[_0xbb3e('0x40')](_0xdd3ae3['model'],qs[_0xbb3e('0x41')](_0x505395['query'][_0xbb3e('0x41')]));_0x2b6cad[_0xbb3e('0x42')]=_0x2b6cad[_0xbb3e('0x42')][_0xbb3e('0x43')]?_0x2b6cad['attributes']:_0xdd3ae3['model'];_0x2b6cad[_0xbb3e('0x46')]=qs[_0xbb3e('0x47')](_0x505395[_0xbb3e('0x3d')][_0xbb3e('0x47')]);_0x2b6cad['where']=qs[_0xbb3e('0x3f')](_[_0xbb3e('0x48')](_0x505395['query'],_0xdd3ae3[_0xbb3e('0x3f')]));if(_0x505395[_0xbb3e('0x3d')][_0xbb3e('0x49')]){_0x2b6cad[_0xbb3e('0x4a')]=_[_0xbb3e('0x4b')](_0x2b6cad[_0xbb3e('0x4a')],{'$or':_[_0xbb3e('0x36')](_0x2b6cad[_0xbb3e('0x42')],function(_0x14233c){var _0x76416e={};_0x76416e[_0x14233c]={'$like':'%'+_0x505395[_0xbb3e('0x3d')][_0xbb3e('0x49')]+'%'};return _0x76416e;})});}_0x2b6cad=_['merge']({},_0x2b6cad,_0x505395['options']);return _0x255f05['getFields'](_0x2b6cad);}})[_0xbb3e('0x1c')](function(_0x5690b1){if(_0x5690b1){_0x293c6c=_0x5690b1[_0xbb3e('0x43')];if(!_0x505395['query']['hasOwnProperty'](_0xbb3e('0x45'))){_0x2b6cad['limit']=qs[_0xbb3e('0x2c')](_0x505395[_0xbb3e('0x3d')][_0xbb3e('0x2c')]);_0x2b6cad[_0xbb3e('0x2b')]=qs['offset'](_0x505395[_0xbb3e('0x3d')][_0xbb3e('0x2b')]);}return _0x255f05['getFields'](_0x2b6cad);}})[_0xbb3e('0x1c')](function(_0x3b2d6a){if(_0x3b2d6a){return _0x3b2d6a?{'count':_0x293c6c,'rows':_0x3b2d6a}:null;}})[_0xbb3e('0x1c')](respondWithResult(_0x349d8d,null))[_0xbb3e('0x25')](handleError(_0x349d8d,null));};exports[_0xbb3e('0x59')]=function(_0x34176c,_0x4e0fe6,_0x449d78){var _0x2244cf={};var _0x3352c={};var _0x1a2c32;var _0x19ef59;return db[_0xbb3e('0x37')][_0xbb3e('0x57')]({'where':{'id':_0x34176c['params']['id']}})['then'](handleEntityNotFound(_0x4e0fe6,null))['then'](function(_0x1f6df7){if(_0x1f6df7){_0x1a2c32=_0x1f6df7;_0x3352c[_0xbb3e('0x3c')]=_[_0xbb3e('0x3e')](db['Dynamics365Field'][_0xbb3e('0x38')]);_0x3352c['query']=_[_0xbb3e('0x3e')](_0x34176c['query']);_0x3352c[_0xbb3e('0x3f')]=_['intersection'](_0x3352c[_0xbb3e('0x3c')],_0x3352c['query']);_0x2244cf[_0xbb3e('0x42')]=_['intersection'](_0x3352c[_0xbb3e('0x3c')],qs[_0xbb3e('0x41')](_0x34176c[_0xbb3e('0x3d')][_0xbb3e('0x41')]));_0x2244cf['attributes']=_0x2244cf[_0xbb3e('0x42')]['length']?_0x2244cf[_0xbb3e('0x42')]:_0x3352c['model'];_0x2244cf[_0xbb3e('0x46')]=qs[_0xbb3e('0x47')](_0x34176c[_0xbb3e('0x3d')][_0xbb3e('0x47')]);_0x2244cf[_0xbb3e('0x4a')]=qs[_0xbb3e('0x3f')](_[_0xbb3e('0x48')](_0x34176c[_0xbb3e('0x3d')],_0x3352c['filters']));if(_0x34176c[_0xbb3e('0x3d')][_0xbb3e('0x49')]){_0x2244cf[_0xbb3e('0x4a')]=_[_0xbb3e('0x4b')](_0x2244cf[_0xbb3e('0x4a')],{'$or':_[_0xbb3e('0x36')](_0x2244cf['attributes'],function(_0x2d1029){var _0x1ba252={};_0x1ba252[_0x2d1029]={'$like':'%'+_0x34176c[_0xbb3e('0x3d')]['filter']+'%'};return _0x1ba252;})});}_0x2244cf=_['merge']({},_0x2244cf,_0x34176c[_0xbb3e('0x4d')]);return _0x1a2c32['getSubjects'](_0x2244cf);}})['then'](function(_0x2edeb0){if(_0x2edeb0){_0x19ef59=_0x2edeb0[_0xbb3e('0x43')];if(!_0x34176c['query'][_0xbb3e('0x44')](_0xbb3e('0x45'))){_0x2244cf[_0xbb3e('0x2c')]=qs['limit'](_0x34176c['query'][_0xbb3e('0x2c')]);_0x2244cf[_0xbb3e('0x2b')]=qs[_0xbb3e('0x2b')](_0x34176c[_0xbb3e('0x3d')][_0xbb3e('0x2b')]);}return _0x1a2c32[_0xbb3e('0x59')](_0x2244cf);}})['then'](function(_0x83540a){if(_0x83540a){return _0x83540a?{'count':_0x19ef59,'rows':_0x83540a}:null;}})[_0xbb3e('0x1c')](respondWithResult(_0x4e0fe6,null))['catch'](handleError(_0x4e0fe6,null));};exports[_0xbb3e('0x5a')]=function(_0x34c6ae,_0x34a7d8,_0x10be88){var _0x391d7c={};var _0x25c8df={};var _0x1294a4;var _0x536e36;return db['Dynamics365Configuration'][_0xbb3e('0x57')]({'where':{'id':_0x34c6ae['params']['id']}})[_0xbb3e('0x1c')](handleEntityNotFound(_0x34a7d8,null))['then'](function(_0x36fca6){if(_0x36fca6){_0x1294a4=_0x36fca6;_0x25c8df[_0xbb3e('0x3c')]=_[_0xbb3e('0x3e')](db[_0xbb3e('0x58')][_0xbb3e('0x38')]);_0x25c8df[_0xbb3e('0x3d')]=_[_0xbb3e('0x3e')](_0x34c6ae[_0xbb3e('0x3d')]);_0x25c8df[_0xbb3e('0x3f')]=_[_0xbb3e('0x40')](_0x25c8df[_0xbb3e('0x3c')],_0x25c8df[_0xbb3e('0x3d')]);_0x391d7c[_0xbb3e('0x42')]=_['intersection'](_0x25c8df['model'],qs['fields'](_0x34c6ae[_0xbb3e('0x3d')][_0xbb3e('0x41')]));_0x391d7c['attributes']=_0x391d7c[_0xbb3e('0x42')]['length']?_0x391d7c[_0xbb3e('0x42')]:_0x25c8df['model'];_0x391d7c['order']=qs[_0xbb3e('0x47')](_0x34c6ae[_0xbb3e('0x3d')][_0xbb3e('0x47')]);_0x391d7c[_0xbb3e('0x4a')]=qs[_0xbb3e('0x3f')](_[_0xbb3e('0x48')](_0x34c6ae['query'],_0x25c8df[_0xbb3e('0x3f')]));if(_0x34c6ae[_0xbb3e('0x3d')][_0xbb3e('0x49')]){_0x391d7c['where']=_[_0xbb3e('0x4b')](_0x391d7c['where'],{'$or':_[_0xbb3e('0x36')](_0x391d7c['attributes'],function(_0x41b6f5){var _0x36255b={};_0x36255b[_0x41b6f5]={'$like':'%'+_0x34c6ae[_0xbb3e('0x3d')]['filter']+'%'};return _0x36255b;})});}_0x391d7c=_[_0xbb3e('0x4b')]({},_0x391d7c,_0x34c6ae[_0xbb3e('0x4d')]);return _0x1294a4['getDescriptions'](_0x391d7c);}})['then'](function(_0x2a69e2){if(_0x2a69e2){_0x536e36=_0x2a69e2['length'];if(!_0x34c6ae['query']['hasOwnProperty'](_0xbb3e('0x45'))){_0x391d7c[_0xbb3e('0x2c')]=qs[_0xbb3e('0x2c')](_0x34c6ae[_0xbb3e('0x3d')][_0xbb3e('0x2c')]);_0x391d7c['offset']=qs[_0xbb3e('0x2b')](_0x34c6ae['query'][_0xbb3e('0x2b')]);}return _0x1294a4[_0xbb3e('0x5a')](_0x391d7c);}})[_0xbb3e('0x1c')](function(_0x1e175f){if(_0x1e175f){return _0x1e175f?{'count':_0x536e36,'rows':_0x1e175f}:null;}})[_0xbb3e('0x1c')](respondWithResult(_0x34a7d8,null))[_0xbb3e('0x25')](handleError(_0x34a7d8,null));};
\ No newline at end of file
+var _0xf646=['count','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','where','merge','filter','options','includeAll','rows','params','length','include','create','body','catch','find','getFields','findOne','order','nolimit','getSubjects','Dynamics365Field','getDescriptions','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','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','offset','undefined','limit'];(function(_0x20167a,_0x1b650f){var _0x1579f6=function(_0x3bc981){while(--_0x3bc981){_0x20167a['push'](_0x20167a['shift']());}};_0x1579f6(++_0x1b650f);}(_0xf646,0xe6));var _0x6f64=function(_0x3e2b25,_0x4cacf1){_0x3e2b25=_0x3e2b25-0x0;var _0x3df5b8=_0xf646[_0x3e2b25];return _0x3df5b8;};'use strict';var emlformat=require(_0x6f64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f64('0x1'));var jsonpatch=require(_0x6f64('0x2'));var rp=require(_0x6f64('0x3'));var moment=require(_0x6f64('0x4'));var BPromise=require(_0x6f64('0x5'));var Mustache=require(_0x6f64('0x6'));var util=require('util');var path=require(_0x6f64('0x7'));var sox=require(_0x6f64('0x8'));var csv=require('to-csv');var ejs=require(_0x6f64('0x9'));var fs=require('fs');var fs_extra=require(_0x6f64('0xa'));var _=require(_0x6f64('0xb'));var squel=require(_0x6f64('0xc'));var crypto=require(_0x6f64('0xd'));var jsforce=require(_0x6f64('0xe'));var deskjs=require(_0x6f64('0xf'));var toCsv=require(_0x6f64('0x10'));var querystring=require(_0x6f64('0x11'));var Papa=require('papaparse');var Redis=require(_0x6f64('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6f64('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f64('0x14'));var logger=require(_0x6f64('0x15'))(_0x6f64('0x16'));var utils=require(_0x6f64('0x17'));var config=require(_0x6f64('0x18'));var licenseUtil=require(_0x6f64('0x19'));var db=require(_0x6f64('0x1a'))['db'];var jayson=require(_0x6f64('0x1b'));var client=jayson['client'][_0x6f64('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3cc798,_0x5d3f36,_0x230e7f,_0x461a1d){return new BPromise(function(_0x5cd840,_0x1ec5b3){var _0x5c0d75=_0x461a1d||client;return _0x5c0d75[_0x6f64('0x1d')](_0x3cc798,_0x230e7f)[_0x6f64('0x1e')](function(_0x1628fb){logger[_0x6f64('0x1f')](_0x6f64('0x20'),_0x5d3f36,'request\x20sent');logger[_0x6f64('0x21')](_0x6f64('0x22'),_0x5d3f36,_0x6f64('0x23'),JSON[_0x6f64('0x24')](_0x1628fb));if(_0x1628fb[_0x6f64('0x25')]){if(_0x1628fb['error'][_0x6f64('0x26')]===0x1f4){logger[_0x6f64('0x25')](_0x6f64('0x20'),_0x5d3f36,_0x1628fb['error']['message']);return _0x1ec5b3(_0x1628fb[_0x6f64('0x25')][_0x6f64('0x27')]);}logger[_0x6f64('0x25')](_0x6f64('0x20'),_0x5d3f36,_0x1628fb[_0x6f64('0x25')][_0x6f64('0x27')]);return _0x5cd840(_0x1628fb[_0x6f64('0x25')][_0x6f64('0x27')]);}else{logger[_0x6f64('0x1f')](_0x6f64('0x20'),_0x5d3f36,_0x6f64('0x23'));_0x5cd840(_0x1628fb[_0x6f64('0x28')][_0x6f64('0x27')]);}})['catch'](function(_0xa7b06b){logger[_0x6f64('0x25')](_0x6f64('0x20'),_0x5d3f36,_0xa7b06b);_0x1ec5b3(_0xa7b06b);});});}function respondWithStatusCode(_0x3815c4,_0x5e8e47){_0x5e8e47=_0x5e8e47||0xcc;return function(_0x413dd2){if(_0x413dd2){return _0x3815c4['sendStatus'](_0x5e8e47);}return _0x3815c4[_0x6f64('0x29')](_0x5e8e47)[_0x6f64('0x2a')]();};}function respondWithResult(_0x55044f,_0x4a7995){_0x4a7995=_0x4a7995||0xc8;return function(_0x267c52){if(_0x267c52){return _0x55044f[_0x6f64('0x29')](_0x4a7995)['json'](_0x267c52);}};}function respondWithFilteredResult(_0x101273,_0x2a2741){return function(_0x47c509){if(_0x47c509){var _0x379945=typeof _0x2a2741[_0x6f64('0x2b')]===_0x6f64('0x2c')&&typeof _0x2a2741[_0x6f64('0x2d')]===_0x6f64('0x2c');var _0x439095=_0x47c509['count'];var _0x3603dd=_0x379945?0x0:_0x2a2741[_0x6f64('0x2b')];var _0x1c1d8f=_0x379945?_0x47c509[_0x6f64('0x2e')]:_0x2a2741['offset']+_0x2a2741[_0x6f64('0x2d')];var _0x4e131b;if(_0x1c1d8f>=_0x439095){_0x1c1d8f=_0x439095;_0x4e131b=0xc8;}else{_0x4e131b=0xce;}_0x101273['status'](_0x4e131b);return _0x101273[_0x6f64('0x2f')](_0x6f64('0x30'),_0x3603dd+'-'+_0x1c1d8f+'/'+_0x439095)['json'](_0x47c509);}return null;};}function patchUpdates(_0x4574ed){return function(_0x508d66){try{jsonpatch[_0x6f64('0x31')](_0x508d66,_0x4574ed,!![]);}catch(_0x2a9bca){return BPromise[_0x6f64('0x32')](_0x2a9bca);}return _0x508d66['save']();};}function saveUpdates(_0x36c5d0,_0x3b0b77){return function(_0x4e1aa8){if(_0x4e1aa8){return _0x4e1aa8[_0x6f64('0x33')](_0x36c5d0)[_0x6f64('0x1e')](function(_0x14c6a7){return _0x14c6a7;});}return null;};}function removeEntity(_0x316969,_0x5714fb){return function(_0x583433){if(_0x583433){return _0x583433[_0x6f64('0x34')]()[_0x6f64('0x1e')](function(){_0x316969['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x565318,_0x43d9a8){return function(_0x286b64){if(!_0x286b64){_0x565318[_0x6f64('0x35')](0x194);}return _0x286b64;};}function handleError(_0x32860d,_0x179f55){_0x179f55=_0x179f55||0x1f4;return function(_0x326f33){logger[_0x6f64('0x25')](_0x326f33[_0x6f64('0x36')]);if(_0x326f33[_0x6f64('0x37')]){delete _0x326f33[_0x6f64('0x37')];}_0x32860d[_0x6f64('0x29')](_0x179f55)['send'](_0x326f33);};}exports['index']=function(_0x46a0fa,_0x32faf6){var _0x3b29d0={},_0x20ac73={},_0x70654={'count':0x0,'rows':[]};var _0x28c216=_['map'](db[_0x6f64('0x38')][_0x6f64('0x39')],function(_0x4b5666){return{'name':_0x4b5666[_0x6f64('0x3a')],'type':_0x4b5666[_0x6f64('0x3b')][_0x6f64('0x3c')]};});_0x20ac73[_0x6f64('0x3d')]=_[_0x6f64('0x3e')](_0x28c216,'name');_0x20ac73[_0x6f64('0x3f')]=_[_0x6f64('0x40')](_0x46a0fa['query']);_0x20ac73[_0x6f64('0x41')]=_[_0x6f64('0x42')](_0x20ac73[_0x6f64('0x3d')],_0x20ac73[_0x6f64('0x3f')]);_0x3b29d0[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x20ac73[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x3b29d0[_0x6f64('0x43')]=_0x3b29d0[_0x6f64('0x43')]['length']?_0x3b29d0['attributes']:_0x20ac73['model'];if(!_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x45')]('nolimit')){_0x3b29d0['limit']=qs[_0x6f64('0x2d')](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0x3b29d0[_0x6f64('0x2b')]=qs[_0x6f64('0x2b')](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x2b')]);}_0x3b29d0['order']=qs['sort'](_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x46')]);_0x3b29d0['where']=qs[_0x6f64('0x41')](_[_0x6f64('0x47')](_0x46a0fa[_0x6f64('0x3f')],_0x20ac73[_0x6f64('0x41')]),_0x28c216);if(_0x46a0fa[_0x6f64('0x3f')]['filter']){_0x3b29d0[_0x6f64('0x48')]=_[_0x6f64('0x49')](_0x3b29d0[_0x6f64('0x48')],{'$or':_[_0x6f64('0x3e')](_0x28c216,function(_0x3fb5c9){if(_0x3fb5c9['type']!=='VIRTUAL'){var _0x1d8cdc={};_0x1d8cdc[_0x3fb5c9[_0x6f64('0x37')]]={'$like':'%'+_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x4a')]+'%'};return _0x1d8cdc;}})});}_0x3b29d0=_[_0x6f64('0x49')]({},_0x3b29d0,_0x46a0fa[_0x6f64('0x4b')]);var _0x33a966={'where':_0x3b29d0[_0x6f64('0x48')]};return db['Dynamics365Configuration'][_0x6f64('0x2e')](_0x33a966)[_0x6f64('0x1e')](function(_0x152e2e){_0x70654[_0x6f64('0x2e')]=_0x152e2e;if(_0x46a0fa[_0x6f64('0x3f')][_0x6f64('0x4c')]){_0x3b29d0['include']=[{'all':!![]}];}return db[_0x6f64('0x38')]['findAll'](_0x3b29d0);})[_0x6f64('0x1e')](function(_0x80a83d){_0x70654[_0x6f64('0x4d')]=_0x80a83d;return _0x70654;})[_0x6f64('0x1e')](respondWithFilteredResult(_0x32faf6,_0x3b29d0))['catch'](handleError(_0x32faf6,null));};exports['show']=function(_0x53eaa2,_0x423add){var _0x415c1c={'raw':![],'where':{'id':_0x53eaa2[_0x6f64('0x4e')]['id']}},_0x2fb674={};_0x2fb674['model']=_[_0x6f64('0x40')](db[_0x6f64('0x38')][_0x6f64('0x39')]);_0x2fb674[_0x6f64('0x3f')]=_[_0x6f64('0x40')](_0x53eaa2[_0x6f64('0x3f')]);_0x2fb674['filters']=_['intersection'](_0x2fb674['model'],_0x2fb674[_0x6f64('0x3f')]);_0x415c1c[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x2fb674[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0x53eaa2[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x415c1c['attributes']=_0x415c1c[_0x6f64('0x43')][_0x6f64('0x4f')]?_0x415c1c[_0x6f64('0x43')]:_0x2fb674[_0x6f64('0x3d')];if(_0x53eaa2['query'][_0x6f64('0x4c')]){_0x415c1c[_0x6f64('0x50')]=[{'all':!![]}];}_0x415c1c=_[_0x6f64('0x49')]({},_0x415c1c,_0x53eaa2[_0x6f64('0x4b')]);return db[_0x6f64('0x38')]['find'](_0x415c1c)[_0x6f64('0x1e')](handleEntityNotFound(_0x423add,null))[_0x6f64('0x1e')](respondWithResult(_0x423add,null))['catch'](handleError(_0x423add,null));};exports[_0x6f64('0x51')]=function(_0x322bfc,_0x307018){return db[_0x6f64('0x38')][_0x6f64('0x51')](_0x322bfc[_0x6f64('0x52')],{})['then'](respondWithResult(_0x307018,0xc9))[_0x6f64('0x53')](handleError(_0x307018,null));};exports[_0x6f64('0x33')]=function(_0x866e41,_0x2b28d9){if(_0x866e41['body']['id']){delete _0x866e41[_0x6f64('0x52')]['id'];}return db[_0x6f64('0x38')]['find']({'where':{'id':_0x866e41['params']['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x2b28d9,null))[_0x6f64('0x1e')](saveUpdates(_0x866e41['body'],null))[_0x6f64('0x1e')](respondWithResult(_0x2b28d9,null))[_0x6f64('0x53')](handleError(_0x2b28d9,null));};exports['destroy']=function(_0x240dc2,_0x35e8cd){return db['Dynamics365Configuration'][_0x6f64('0x54')]({'where':{'id':_0x240dc2['params']['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x35e8cd,null))[_0x6f64('0x1e')](removeEntity(_0x35e8cd,null))[_0x6f64('0x53')](handleError(_0x35e8cd,null));};exports[_0x6f64('0x55')]=function(_0xa96eeb,_0x40d5b8,_0x37b1ed){var _0x1fa1e1={};var _0x62b39f={};var _0x2b2c38;var _0x3e21a9;return db[_0x6f64('0x38')][_0x6f64('0x56')]({'where':{'id':_0xa96eeb[_0x6f64('0x4e')]['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x40d5b8,null))[_0x6f64('0x1e')](function(_0x48fc56){if(_0x48fc56){_0x2b2c38=_0x48fc56;_0x62b39f[_0x6f64('0x3d')]=_[_0x6f64('0x40')](db['Dynamics365Field']['rawAttributes']);_0x62b39f[_0x6f64('0x3f')]=_['keys'](_0xa96eeb[_0x6f64('0x3f')]);_0x62b39f[_0x6f64('0x41')]=_[_0x6f64('0x42')](_0x62b39f[_0x6f64('0x3d')],_0x62b39f[_0x6f64('0x3f')]);_0x1fa1e1[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x62b39f[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x1fa1e1[_0x6f64('0x43')]=_0x1fa1e1[_0x6f64('0x43')][_0x6f64('0x4f')]?_0x1fa1e1[_0x6f64('0x43')]:_0x62b39f[_0x6f64('0x3d')];_0x1fa1e1[_0x6f64('0x57')]=qs['sort'](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x46')]);_0x1fa1e1['where']=qs[_0x6f64('0x41')](_[_0x6f64('0x47')](_0xa96eeb[_0x6f64('0x3f')],_0x62b39f[_0x6f64('0x41')]));if(_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x4a')]){_0x1fa1e1[_0x6f64('0x48')]=_[_0x6f64('0x49')](_0x1fa1e1[_0x6f64('0x48')],{'$or':_[_0x6f64('0x3e')](_0x1fa1e1[_0x6f64('0x43')],function(_0x509ac3){var _0x363d79={};_0x363d79[_0x509ac3]={'$like':'%'+_0xa96eeb['query'][_0x6f64('0x4a')]+'%'};return _0x363d79;})});}_0x1fa1e1=_[_0x6f64('0x49')]({},_0x1fa1e1,_0xa96eeb[_0x6f64('0x4b')]);return _0x2b2c38['getFields'](_0x1fa1e1);}})[_0x6f64('0x1e')](function(_0x135803){if(_0x135803){_0x3e21a9=_0x135803[_0x6f64('0x4f')];if(!_0xa96eeb[_0x6f64('0x3f')]['hasOwnProperty'](_0x6f64('0x58'))){_0x1fa1e1[_0x6f64('0x2d')]=qs[_0x6f64('0x2d')](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0x1fa1e1[_0x6f64('0x2b')]=qs['offset'](_0xa96eeb[_0x6f64('0x3f')][_0x6f64('0x2b')]);}return _0x2b2c38[_0x6f64('0x55')](_0x1fa1e1);}})['then'](function(_0xb6c335){if(_0xb6c335){return _0xb6c335?{'count':_0x3e21a9,'rows':_0xb6c335}:null;}})['then'](respondWithResult(_0x40d5b8,null))[_0x6f64('0x53')](handleError(_0x40d5b8,null));};exports[_0x6f64('0x59')]=function(_0x468434,_0x22e3e1,_0x131f38){var _0xbe5686={};var _0x11ea7f={};var _0x12059b;var _0x2ad88c;return db['Dynamics365Configuration'][_0x6f64('0x56')]({'where':{'id':_0x468434[_0x6f64('0x4e')]['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x22e3e1,null))['then'](function(_0x150233){if(_0x150233){_0x12059b=_0x150233;_0x11ea7f[_0x6f64('0x3d')]=_['keys'](db[_0x6f64('0x5a')][_0x6f64('0x39')]);_0x11ea7f['query']=_['keys'](_0x468434[_0x6f64('0x3f')]);_0x11ea7f[_0x6f64('0x41')]=_[_0x6f64('0x42')](_0x11ea7f[_0x6f64('0x3d')],_0x11ea7f[_0x6f64('0x3f')]);_0xbe5686[_0x6f64('0x43')]=_[_0x6f64('0x42')](_0x11ea7f[_0x6f64('0x3d')],qs[_0x6f64('0x44')](_0x468434[_0x6f64('0x3f')][_0x6f64('0x44')]));_0xbe5686[_0x6f64('0x43')]=_0xbe5686['attributes'][_0x6f64('0x4f')]?_0xbe5686[_0x6f64('0x43')]:_0x11ea7f['model'];_0xbe5686[_0x6f64('0x57')]=qs['sort'](_0x468434[_0x6f64('0x3f')]['sort']);_0xbe5686['where']=qs['filters'](_['pick'](_0x468434['query'],_0x11ea7f['filters']));if(_0x468434[_0x6f64('0x3f')][_0x6f64('0x4a')]){_0xbe5686[_0x6f64('0x48')]=_['merge'](_0xbe5686['where'],{'$or':_['map'](_0xbe5686['attributes'],function(_0x1acb55){var _0x2c50f0={};_0x2c50f0[_0x1acb55]={'$like':'%'+_0x468434[_0x6f64('0x3f')][_0x6f64('0x4a')]+'%'};return _0x2c50f0;})});}_0xbe5686=_[_0x6f64('0x49')]({},_0xbe5686,_0x468434['options']);return _0x12059b['getSubjects'](_0xbe5686);}})[_0x6f64('0x1e')](function(_0x4d737d){if(_0x4d737d){_0x2ad88c=_0x4d737d[_0x6f64('0x4f')];if(!_0x468434[_0x6f64('0x3f')][_0x6f64('0x45')](_0x6f64('0x58'))){_0xbe5686['limit']=qs['limit'](_0x468434[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0xbe5686[_0x6f64('0x2b')]=qs['offset'](_0x468434[_0x6f64('0x3f')][_0x6f64('0x2b')]);}return _0x12059b[_0x6f64('0x59')](_0xbe5686);}})['then'](function(_0x1518fd){if(_0x1518fd){return _0x1518fd?{'count':_0x2ad88c,'rows':_0x1518fd}:null;}})[_0x6f64('0x1e')](respondWithResult(_0x22e3e1,null))[_0x6f64('0x53')](handleError(_0x22e3e1,null));};exports[_0x6f64('0x5b')]=function(_0x321d45,_0x2cb1bf,_0x1353d2){var _0x23145b={};var _0x4861a0={};var _0x4590d2;var _0x158913;return db[_0x6f64('0x38')]['findOne']({'where':{'id':_0x321d45[_0x6f64('0x4e')]['id']}})[_0x6f64('0x1e')](handleEntityNotFound(_0x2cb1bf,null))[_0x6f64('0x1e')](function(_0x49e778){if(_0x49e778){_0x4590d2=_0x49e778;_0x4861a0['model']=_[_0x6f64('0x40')](db[_0x6f64('0x5a')][_0x6f64('0x39')]);_0x4861a0[_0x6f64('0x3f')]=_[_0x6f64('0x40')](_0x321d45[_0x6f64('0x3f')]);_0x4861a0[_0x6f64('0x41')]=_['intersection'](_0x4861a0['model'],_0x4861a0[_0x6f64('0x3f')]);_0x23145b[_0x6f64('0x43')]=_['intersection'](_0x4861a0[_0x6f64('0x3d')],qs['fields'](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x44')]));_0x23145b['attributes']=_0x23145b[_0x6f64('0x43')][_0x6f64('0x4f')]?_0x23145b['attributes']:_0x4861a0[_0x6f64('0x3d')];_0x23145b['order']=qs[_0x6f64('0x46')](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x46')]);_0x23145b[_0x6f64('0x48')]=qs[_0x6f64('0x41')](_[_0x6f64('0x47')](_0x321d45[_0x6f64('0x3f')],_0x4861a0['filters']));if(_0x321d45['query'][_0x6f64('0x4a')]){_0x23145b['where']=_[_0x6f64('0x49')](_0x23145b['where'],{'$or':_[_0x6f64('0x3e')](_0x23145b[_0x6f64('0x43')],function(_0x3ef908){var _0x572642={};_0x572642[_0x3ef908]={'$like':'%'+_0x321d45['query'][_0x6f64('0x4a')]+'%'};return _0x572642;})});}_0x23145b=_[_0x6f64('0x49')]({},_0x23145b,_0x321d45[_0x6f64('0x4b')]);return _0x4590d2[_0x6f64('0x5b')](_0x23145b);}})['then'](function(_0x225db9){if(_0x225db9){_0x158913=_0x225db9[_0x6f64('0x4f')];if(!_0x321d45[_0x6f64('0x3f')][_0x6f64('0x45')](_0x6f64('0x58'))){_0x23145b[_0x6f64('0x2d')]=qs[_0x6f64('0x2d')](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x2d')]);_0x23145b[_0x6f64('0x2b')]=qs[_0x6f64('0x2b')](_0x321d45[_0x6f64('0x3f')][_0x6f64('0x2b')]);}return _0x4590d2['getDescriptions'](_0x23145b);}})['then'](function(_0x137538){if(_0x137538){return _0x137538?{'count':_0x158913,'rows':_0x137538}:null;}})[_0x6f64('0x1e')](respondWithResult(_0x2cb1bf,null))[_0x6f64('0x53')](handleError(_0x2cb1bf,null));};
\ No newline at end of file
index 4fc7155..eaf66b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0xe62449,_0x3253eb){var _0x1e26e3=function(_0x668e1f){while(--_0x668e1f){_0xe62449['push'](_0xe62449['shift']());}};_0x1e26e3(++_0x3253eb);}(_0x9bde,0xe1));var _0xe9bd=function(_0x445aca,_0x77f4c8){_0x445aca=_0x445aca-0x0;var _0x407487=_0x9bde[_0x445aca];return _0x407487;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xe5b3,0x133));var _0x3e5b=function(_0x30bb07,_0x32682a){_0x30bb07=_0x30bb07-0x0;var _0x36a1d6=_0xe5b3[_0x30bb07];return _0x36a1d6;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d9f03ab..0125138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0efc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x41502d,_0x43e07b){var _0x2bce70=function(_0x30470d){while(--_0x30470d){_0x41502d['push'](_0x41502d['shift']());}};_0x2bce70(++_0x43e07b);}(_0x0efc,0xec));var _0xc0ef=function(_0x1c9f1b,_0x1450dd){_0x1c9f1b=_0x1c9f1b-0x0;var _0x540ab0=_0x0efc[_0x1c9f1b];return _0x540ab0;};'use strict';var _=require(_0xc0ef('0x0'));var util=require(_0xc0ef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0ef('0x2'));var db=require(_0xc0ef('0x3'))['db'];var utils=require(_0xc0ef('0x4'));var logger=require(_0xc0ef('0x5'))(_0xc0ef('0x6'));var config=require(_0xc0ef('0x7'));var jayson=require(_0xc0ef('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48ff68,_0x54697a,_0x52cdf3){return new BPromise(function(_0x279b38,_0x120853){return client[_0xc0ef('0x9')](_0x48ff68,_0x52cdf3)[_0xc0ef('0xa')](function(_0x1af400){logger[_0xc0ef('0xb')](_0xc0ef('0xc'),_0x54697a,_0xc0ef('0xd'));logger[_0xc0ef('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x54697a,_0xc0ef('0xd'),JSON[_0xc0ef('0xf')](_0x1af400));if(_0x1af400[_0xc0ef('0x10')]){if(_0x1af400['error']['code']===0x1f4){logger[_0xc0ef('0x10')](_0xc0ef('0xc'),_0x54697a,_0x1af400['error'][_0xc0ef('0x11')]);return _0x120853(_0x1af400['error']['message']);}logger[_0xc0ef('0x10')](_0xc0ef('0xc'),_0x54697a,_0x1af400[_0xc0ef('0x10')]['message']);return _0x279b38(_0x1af400['error'][_0xc0ef('0x11')]);}else{logger[_0xc0ef('0xb')](_0xc0ef('0xc'),_0x54697a,'request\x20sent');_0x279b38(_0x1af400[_0xc0ef('0x12')][_0xc0ef('0x11')]);}})[_0xc0ef('0x13')](function(_0x58c7f0){logger[_0xc0ef('0x10')](_0xc0ef('0xc'),_0x54697a,_0x58c7f0);_0x120853(_0x58c7f0);});});}
\ No newline at end of file
+var _0x7c36=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','moment'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x7c36,0xfa));var _0x67c3=function(_0x18e617,_0xdc2aa1){_0x18e617=_0x18e617-0x0;var _0x525be6=_0x7c36[_0x18e617];return _0x525be6;};'use strict';var _=require(_0x67c3('0x0'));var util=require('util');var moment=require(_0x67c3('0x1'));var BPromise=require(_0x67c3('0x2'));var rs=require(_0x67c3('0x3'));var fs=require('fs');var Redis=require(_0x67c3('0x4'));var db=require(_0x67c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x67c3('0x6'))(_0x67c3('0x7'));var config=require(_0x67c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67c3('0x9')][_0x67c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24de7b,_0x3bd084,_0x202773){return new BPromise(function(_0x2b6451,_0x44ad14){return client['request'](_0x24de7b,_0x202773)[_0x67c3('0xb')](function(_0x24435b){logger['info'](_0x67c3('0xc'),_0x3bd084,'request\x20sent');logger['debug'](_0x67c3('0xd'),_0x3bd084,'request\x20sent',JSON[_0x67c3('0xe')](_0x24435b));if(_0x24435b[_0x67c3('0xf')]){if(_0x24435b[_0x67c3('0xf')]['code']===0x1f4){logger[_0x67c3('0xf')](_0x67c3('0xc'),_0x3bd084,_0x24435b[_0x67c3('0xf')][_0x67c3('0x10')]);return _0x44ad14(_0x24435b[_0x67c3('0xf')][_0x67c3('0x10')]);}logger[_0x67c3('0xf')](_0x67c3('0xc'),_0x3bd084,_0x24435b[_0x67c3('0xf')]['message']);return _0x2b6451(_0x24435b['error'][_0x67c3('0x10')]);}else{logger[_0x67c3('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3bd084,_0x67c3('0x12'));_0x2b6451(_0x24435b[_0x67c3('0x13')][_0x67c3('0x10')]);}})[_0x67c3('0x14')](function(_0x3b2148){logger['error'](_0x67c3('0xc'),_0x3bd084,_0x3b2148);_0x44ad14(_0x3b2148);});});}
\ No newline at end of file
index cfb9950..6af4992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa713=['../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','create','put','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x33ac1f,_0x1818f1){var _0x140043=function(_0x3ef911){while(--_0x3ef911){_0x33ac1f['push'](_0x33ac1f['shift']());}};_0x140043(++_0x1818f1);}(_0xa713,0x15f));var _0x3a71=function(_0x3843c8,_0x2dce4c){_0x3843c8=_0x3843c8-0x0;var _0x556ba8=_0xa713[_0x3843c8];return _0x556ba8;};'use strict';var multer=require('multer');var util=require(_0x3a71('0x0'));var path=require('path');var timeout=require(_0x3a71('0x1'));var express=require('express');var router=express[_0x3a71('0x2')]();var fs_extra=require(_0x3a71('0x3'));var auth=require(_0x3a71('0x4'));var interaction=require(_0x3a71('0x5'));var config=require(_0x3a71('0x6'));var controller=require(_0x3a71('0x7'));router[_0x3a71('0x8')]('/',auth[_0x3a71('0x9')](),controller[_0x3a71('0xa')]);router[_0x3a71('0x8')](_0x3a71('0xb'),auth[_0x3a71('0x9')](),controller[_0x3a71('0xc')]);router['post']('/',auth[_0x3a71('0x9')](),controller[_0x3a71('0xd')]);router[_0x3a71('0xe')](_0x3a71('0xb'),auth[_0x3a71('0x9')](),controller['update']);router[_0x3a71('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3a71('0x10')]=router;
\ No newline at end of file
+var _0x5590=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer'];(function(_0x1d7eb1,_0x31f2a8){var _0x23f655=function(_0x47f740){while(--_0x47f740){_0x1d7eb1['push'](_0x1d7eb1['shift']());}};_0x23f655(++_0x31f2a8);}(_0x5590,0xaa));var _0x0559=function(_0x4d0ee9,_0x2c7166){_0x4d0ee9=_0x4d0ee9-0x0;var _0x47d782=_0x5590[_0x4d0ee9];return _0x47d782;};'use strict';var multer=require(_0x0559('0x0'));var util=require(_0x0559('0x1'));var path=require('path');var timeout=require(_0x0559('0x2'));var express=require('express');var router=express[_0x0559('0x3')]();var fs_extra=require(_0x0559('0x4'));var auth=require(_0x0559('0x5'));var interaction=require(_0x0559('0x6'));var config=require(_0x0559('0x7'));var controller=require(_0x0559('0x8'));router[_0x0559('0x9')]('/',auth[_0x0559('0xa')](),controller[_0x0559('0xb')]);router['get']('/:id',auth[_0x0559('0xa')](),controller[_0x0559('0xc')]);router['post']('/',auth[_0x0559('0xa')](),controller[_0x0559('0xd')]);router['put'](_0x0559('0xe'),auth['isAuthenticated'](),controller[_0x0559('0xf')]);router[_0x0559('0x10')](_0x0559('0xe'),auth[_0x0559('0xa')](),controller[_0x0559('0x11')]);module[_0x0559('0x12')]=router;
\ No newline at end of file
index e00c9e5..a76fc45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa86b=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x99f7c7,_0x2edcbc){var _0x5b8029=function(_0x45a382){while(--_0x45a382){_0x99f7c7['push'](_0x99f7c7['shift']());}};_0x5b8029(++_0x2edcbc);}(_0xa86b,0x1a0));var _0xba86=function(_0x4112ee,_0x14e5e0){_0x4112ee=_0x4112ee-0x0;var _0x32e233=_0xa86b[_0x4112ee];return _0x32e233;};'use strict';var Sequelize=require(_0xba86('0x0'));module[_0xba86('0x1')]={'type':{'type':Sequelize[_0xba86('0x2')](_0xba86('0x3'),_0xba86('0x4'),_0xba86('0x5'),'keyValue',_0xba86('0x6')),'defaultValue':_0xba86('0x3')},'content':{'type':Sequelize[_0xba86('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xba86('0x3'),_0xba86('0x4'),_0xba86('0x5'))},'keyContent':{'type':Sequelize[_0xba86('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xba86('0x7')]},'customField':{'type':Sequelize[_0xba86('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf751=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM'];(function(_0x204a15,_0x55b155){var _0x36ce8a=function(_0x1b4a2c){while(--_0x1b4a2c){_0x204a15['push'](_0x204a15['shift']());}};_0x36ce8a(++_0x55b155);}(_0xf751,0xac));var _0x1f75=function(_0x3e90e9,_0x1f2bcb){_0x3e90e9=_0x3e90e9-0x0;var _0x43e62b=_0xf751[_0x3e90e9];return _0x43e62b;};'use strict';var Sequelize=require(_0x1f75('0x0'));module[_0x1f75('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1f75('0x2'),_0x1f75('0x3'),_0x1f75('0x4'),_0x1f75('0x5'),'picklist'),'defaultValue':_0x1f75('0x2')},'content':{'type':Sequelize[_0x1f75('0x6')]},'key':{'type':Sequelize[_0x1f75('0x6')]},'keyType':{'type':Sequelize[_0x1f75('0x7')](_0x1f75('0x2'),_0x1f75('0x3'),_0x1f75('0x4'))},'keyContent':{'type':Sequelize[_0x1f75('0x6')]},'idField':{'type':Sequelize[_0x1f75('0x6')]},'nameField':{'type':Sequelize[_0x1f75('0x6')]},'customField':{'type':Sequelize[_0x1f75('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f75('0x6')]}};
\ No newline at end of file
index 815a78f..ee1b6e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa999=['include','Dynamics365Field','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','status','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x455c39,_0x3afaae){var _0x52f109=function(_0x4de079){while(--_0x4de079){_0x455c39['push'](_0x455c39['shift']());}};_0x52f109(++_0x3afaae);}(_0xa999,0xf4));var _0x9a99=function(_0xade553,_0x465007){_0xade553=_0xade553-0x0;var _0x2c8092=_0xa999[_0xade553];return _0x2c8092;};'use strict';var emlformat=require(_0x9a99('0x0'));var rimraf=require(_0x9a99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a99('0x2'));var rp=require(_0x9a99('0x3'));var moment=require(_0x9a99('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9a99('0x5'));var util=require(_0x9a99('0x6'));var path=require('path');var sox=require(_0x9a99('0x7'));var csv=require(_0x9a99('0x8'));var ejs=require(_0x9a99('0x9'));var fs=require('fs');var fs_extra=require(_0x9a99('0xa'));var _=require(_0x9a99('0xb'));var squel=require(_0x9a99('0xc'));var crypto=require('crypto');var jsforce=require(_0x9a99('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9a99('0x8'));var querystring=require(_0x9a99('0xe'));var Papa=require(_0x9a99('0xf'));var Redis=require(_0x9a99('0x10'));var authService=require(_0x9a99('0x11'));var qs=require(_0x9a99('0x12'));var as=require(_0x9a99('0x13'));var hardwareService=require(_0x9a99('0x14'));var logger=require(_0x9a99('0x15'))(_0x9a99('0x16'));var utils=require(_0x9a99('0x17'));var config=require(_0x9a99('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a99('0x19'))['db'];function respondWithStatusCode(_0x4517bf,_0x14edc3){_0x14edc3=_0x14edc3||0xcc;return function(_0x455b88){if(_0x455b88){return _0x4517bf[_0x9a99('0x1a')](_0x14edc3);}return _0x4517bf['status'](_0x14edc3)['end']();};}function respondWithResult(_0x417c6d,_0x585ebb){_0x585ebb=_0x585ebb||0xc8;return function(_0x7b7a78){if(_0x7b7a78){return _0x417c6d['status'](_0x585ebb)[_0x9a99('0x1b')](_0x7b7a78);}};}function respondWithFilteredResult(_0x5aa914,_0x2a44c7){return function(_0xd49fb0){if(_0xd49fb0){var _0x285eb6=typeof _0x2a44c7[_0x9a99('0x1c')]===_0x9a99('0x1d')&&typeof _0x2a44c7[_0x9a99('0x1e')]===_0x9a99('0x1d');var _0x26a052=_0xd49fb0[_0x9a99('0x1f')];var _0x53e6ca=_0x285eb6?0x0:_0x2a44c7[_0x9a99('0x1c')];var _0x5997e0=_0x285eb6?_0xd49fb0[_0x9a99('0x1f')]:_0x2a44c7['offset']+_0x2a44c7['limit'];var _0x5236a3;if(_0x5997e0>=_0x26a052){_0x5997e0=_0x26a052;_0x5236a3=0xc8;}else{_0x5236a3=0xce;}_0x5aa914['status'](_0x5236a3);return _0x5aa914[_0x9a99('0x20')](_0x9a99('0x21'),_0x53e6ca+'-'+_0x5997e0+'/'+_0x26a052)[_0x9a99('0x1b')](_0xd49fb0);}return null;};}function patchUpdates(_0x5083d0){return function(_0x135f92){try{jsonpatch[_0x9a99('0x22')](_0x135f92,_0x5083d0,!![]);}catch(_0x34d3a0){return BPromise[_0x9a99('0x23')](_0x34d3a0);}return _0x135f92[_0x9a99('0x24')]();};}function saveUpdates(_0x5772ae,_0x3b92e5){return function(_0x45b457){if(_0x45b457){return _0x45b457[_0x9a99('0x25')](_0x5772ae)[_0x9a99('0x26')](function(_0x5a5f62){return _0x5a5f62;});}return null;};}function removeEntity(_0x50487f,_0x15c2a9){return function(_0x1016fc){if(_0x1016fc){return _0x1016fc[_0x9a99('0x27')]()[_0x9a99('0x26')](function(){_0x50487f['status'](0xcc)[_0x9a99('0x28')]();});}};}function handleEntityNotFound(_0x4d3b0b,_0x2e6895){return function(_0x3277ed){if(!_0x3277ed){_0x4d3b0b[_0x9a99('0x1a')](0x194);}return _0x3277ed;};}function handleError(_0x3b4f63,_0x24ea7d){_0x24ea7d=_0x24ea7d||0x1f4;return function(_0x5c437e){logger[_0x9a99('0x29')](_0x5c437e['stack']);if(_0x5c437e[_0x9a99('0x2a')]){delete _0x5c437e[_0x9a99('0x2a')];}_0x3b4f63[_0x9a99('0x2b')](_0x24ea7d)[_0x9a99('0x2c')](_0x5c437e);};}exports[_0x9a99('0x2d')]=function(_0x1d7ac1,_0x11ca4b){var _0xfa8b02={},_0x343e0a={},_0x53de4f={'count':0x0,'rows':[]};var _0x46c91b=_[_0x9a99('0x2e')](db['Dynamics365Field'][_0x9a99('0x2f')],function(_0x185787){return{'name':_0x185787[_0x9a99('0x30')],'type':_0x185787[_0x9a99('0x31')][_0x9a99('0x32')]};});_0x343e0a[_0x9a99('0x33')]=_[_0x9a99('0x2e')](_0x46c91b,_0x9a99('0x2a'));_0x343e0a[_0x9a99('0x34')]=_['keys'](_0x1d7ac1['query']);_0x343e0a['filters']=_[_0x9a99('0x35')](_0x343e0a[_0x9a99('0x33')],_0x343e0a[_0x9a99('0x34')]);_0xfa8b02['attributes']=_[_0x9a99('0x35')](_0x343e0a[_0x9a99('0x33')],qs[_0x9a99('0x36')](_0x1d7ac1[_0x9a99('0x34')]['fields']));_0xfa8b02['attributes']=_0xfa8b02[_0x9a99('0x37')][_0x9a99('0x38')]?_0xfa8b02['attributes']:_0x343e0a[_0x9a99('0x33')];if(!_0x1d7ac1[_0x9a99('0x34')][_0x9a99('0x39')]('nolimit')){_0xfa8b02['limit']=qs[_0x9a99('0x1e')](_0x1d7ac1[_0x9a99('0x34')]['limit']);_0xfa8b02['offset']=qs[_0x9a99('0x1c')](_0x1d7ac1[_0x9a99('0x34')][_0x9a99('0x1c')]);}_0xfa8b02[_0x9a99('0x3a')]=qs['sort'](_0x1d7ac1[_0x9a99('0x34')][_0x9a99('0x3b')]);_0xfa8b02[_0x9a99('0x3c')]=qs[_0x9a99('0x3d')](_[_0x9a99('0x3e')](_0x1d7ac1['query'],_0x343e0a[_0x9a99('0x3d')]),_0x46c91b);if(_0x1d7ac1[_0x9a99('0x34')][_0x9a99('0x3f')]){_0xfa8b02[_0x9a99('0x3c')]=_[_0x9a99('0x40')](_0xfa8b02[_0x9a99('0x3c')],{'$or':_[_0x9a99('0x2e')](_0x46c91b,function(_0x5c0c9c){if(_0x5c0c9c[_0x9a99('0x31')]!==_0x9a99('0x41')){var _0x4c85e3={};_0x4c85e3[_0x5c0c9c[_0x9a99('0x2a')]]={'$like':'%'+_0x1d7ac1[_0x9a99('0x34')][_0x9a99('0x3f')]+'%'};return _0x4c85e3;}})});}_0xfa8b02=_[_0x9a99('0x40')]({},_0xfa8b02,_0x1d7ac1[_0x9a99('0x42')]);var _0x39dda2={'where':_0xfa8b02[_0x9a99('0x3c')]};return db['Dynamics365Field']['count'](_0x39dda2)[_0x9a99('0x26')](function(_0x49d6d8){_0x53de4f[_0x9a99('0x1f')]=_0x49d6d8;if(_0x1d7ac1[_0x9a99('0x34')][_0x9a99('0x43')]){_0xfa8b02[_0x9a99('0x44')]=[{'all':!![]}];}return db[_0x9a99('0x45')][_0x9a99('0x46')](_0xfa8b02);})[_0x9a99('0x26')](function(_0x4f090b){_0x53de4f[_0x9a99('0x47')]=_0x4f090b;return _0x53de4f;})[_0x9a99('0x26')](respondWithFilteredResult(_0x11ca4b,_0xfa8b02))[_0x9a99('0x48')](handleError(_0x11ca4b,null));};exports['show']=function(_0x21b6db,_0x428e86){var _0x422f15={'raw':!![],'where':{'id':_0x21b6db[_0x9a99('0x49')]['id']}},_0x542744={};_0x542744[_0x9a99('0x33')]=_[_0x9a99('0x4a')](db[_0x9a99('0x45')]['rawAttributes']);_0x542744[_0x9a99('0x34')]=_[_0x9a99('0x4a')](_0x21b6db['query']);_0x542744['filters']=_[_0x9a99('0x35')](_0x542744[_0x9a99('0x33')],_0x542744['query']);_0x422f15[_0x9a99('0x37')]=_[_0x9a99('0x35')](_0x542744['model'],qs[_0x9a99('0x36')](_0x21b6db['query'][_0x9a99('0x36')]));_0x422f15[_0x9a99('0x37')]=_0x422f15[_0x9a99('0x37')][_0x9a99('0x38')]?_0x422f15[_0x9a99('0x37')]:_0x542744[_0x9a99('0x33')];if(_0x21b6db[_0x9a99('0x34')][_0x9a99('0x43')]){_0x422f15['include']=[{'all':!![]}];}_0x422f15=_[_0x9a99('0x40')]({},_0x422f15,_0x21b6db[_0x9a99('0x42')]);return db[_0x9a99('0x45')]['find'](_0x422f15)['then'](handleEntityNotFound(_0x428e86,null))[_0x9a99('0x26')](respondWithResult(_0x428e86,null))['catch'](handleError(_0x428e86,null));};exports[_0x9a99('0x4b')]=function(_0x23104d,_0x7edc1a){return db[_0x9a99('0x45')]['create'](_0x23104d[_0x9a99('0x4c')],{})[_0x9a99('0x26')](respondWithResult(_0x7edc1a,0xc9))[_0x9a99('0x48')](handleError(_0x7edc1a,null));};exports[_0x9a99('0x25')]=function(_0x1f1918,_0x18eee3){if(_0x1f1918[_0x9a99('0x4c')]['id']){delete _0x1f1918[_0x9a99('0x4c')]['id'];}return db[_0x9a99('0x45')][_0x9a99('0x4d')]({'where':{'id':_0x1f1918[_0x9a99('0x49')]['id']}})[_0x9a99('0x26')](handleEntityNotFound(_0x18eee3,null))[_0x9a99('0x26')](saveUpdates(_0x1f1918[_0x9a99('0x4c')],null))[_0x9a99('0x26')](respondWithResult(_0x18eee3,null))[_0x9a99('0x48')](handleError(_0x18eee3,null));};exports[_0x9a99('0x27')]=function(_0x4df264,_0x491ad0){return db['Dynamics365Field'][_0x9a99('0x4d')]({'where':{'id':_0x4df264[_0x9a99('0x49')]['id']}})[_0x9a99('0x26')](handleEntityNotFound(_0x491ad0,null))['then'](removeEntity(_0x491ad0,null))[_0x9a99('0x48')](handleError(_0x491ad0,null));};
\ No newline at end of file
+var _0xbd1a=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x5a2c92,_0x13c851){var _0xaf6cf7=function(_0x2bc2f6){while(--_0x2bc2f6){_0x5a2c92['push'](_0x5a2c92['shift']());}};_0xaf6cf7(++_0x13c851);}(_0xbd1a,0x90));var _0xabd1=function(_0x31a16a,_0x1d60e3){_0x31a16a=_0x31a16a-0x0;var _0x21c892=_0xbd1a[_0x31a16a];return _0x21c892;};'use strict';var emlformat=require(_0xabd1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xabd1('0x1'));var rp=require('request-promise');var moment=require(_0xabd1('0x2'));var BPromise=require(_0xabd1('0x3'));var Mustache=require(_0xabd1('0x4'));var util=require(_0xabd1('0x5'));var path=require(_0xabd1('0x6'));var sox=require(_0xabd1('0x7'));var csv=require('to-csv');var ejs=require(_0xabd1('0x8'));var fs=require('fs');var fs_extra=require(_0xabd1('0x9'));var _=require(_0xabd1('0xa'));var squel=require(_0xabd1('0xb'));var crypto=require(_0xabd1('0xc'));var jsforce=require(_0xabd1('0xd'));var deskjs=require(_0xabd1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xabd1('0xf'));var Papa=require(_0xabd1('0x10'));var Redis=require('ioredis');var authService=require(_0xabd1('0x11'));var qs=require(_0xabd1('0x12'));var as=require(_0xabd1('0x13'));var hardwareService=require(_0xabd1('0x14'));var logger=require(_0xabd1('0x15'))(_0xabd1('0x16'));var utils=require(_0xabd1('0x17'));var config=require(_0xabd1('0x18'));var licenseUtil=require(_0xabd1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e1dba,_0x6ccea5){_0x6ccea5=_0x6ccea5||0xcc;return function(_0xe3b3c6){if(_0xe3b3c6){return _0x1e1dba[_0xabd1('0x1a')](_0x6ccea5);}return _0x1e1dba[_0xabd1('0x1b')](_0x6ccea5)[_0xabd1('0x1c')]();};}function respondWithResult(_0x1d2969,_0xc9090b){_0xc9090b=_0xc9090b||0xc8;return function(_0x9c0d0b){if(_0x9c0d0b){return _0x1d2969[_0xabd1('0x1b')](_0xc9090b)['json'](_0x9c0d0b);}};}function respondWithFilteredResult(_0x25e2b3,_0x1282fe){return function(_0x4f1671){if(_0x4f1671){var _0x2ec2a1=typeof _0x1282fe[_0xabd1('0x1d')]===_0xabd1('0x1e')&&typeof _0x1282fe['limit']===_0xabd1('0x1e');var _0x429e44=_0x4f1671[_0xabd1('0x1f')];var _0x1cea4a=_0x2ec2a1?0x0:_0x1282fe[_0xabd1('0x1d')];var _0x516e6f=_0x2ec2a1?_0x4f1671[_0xabd1('0x1f')]:_0x1282fe[_0xabd1('0x1d')]+_0x1282fe[_0xabd1('0x20')];var _0x13d629;if(_0x516e6f>=_0x429e44){_0x516e6f=_0x429e44;_0x13d629=0xc8;}else{_0x13d629=0xce;}_0x25e2b3['status'](_0x13d629);return _0x25e2b3['set'](_0xabd1('0x21'),_0x1cea4a+'-'+_0x516e6f+'/'+_0x429e44)[_0xabd1('0x22')](_0x4f1671);}return null;};}function patchUpdates(_0x59bbec){return function(_0x526b57){try{jsonpatch[_0xabd1('0x23')](_0x526b57,_0x59bbec,!![]);}catch(_0x44d472){return BPromise[_0xabd1('0x24')](_0x44d472);}return _0x526b57['save']();};}function saveUpdates(_0x2c33da,_0x39a883){return function(_0x1bd3b3){if(_0x1bd3b3){return _0x1bd3b3['update'](_0x2c33da)[_0xabd1('0x25')](function(_0x695560){return _0x695560;});}return null;};}function removeEntity(_0x5cb02c,_0x32f890){return function(_0x1ae1ae){if(_0x1ae1ae){return _0x1ae1ae[_0xabd1('0x26')]()[_0xabd1('0x25')](function(){_0x5cb02c[_0xabd1('0x1b')](0xcc)[_0xabd1('0x1c')]();});}};}function handleEntityNotFound(_0x2d3680,_0x3fd91c){return function(_0x24efe1){if(!_0x24efe1){_0x2d3680[_0xabd1('0x1a')](0x194);}return _0x24efe1;};}function handleError(_0x15be36,_0x3c1520){_0x3c1520=_0x3c1520||0x1f4;return function(_0x35f922){logger[_0xabd1('0x27')](_0x35f922['stack']);if(_0x35f922[_0xabd1('0x28')]){delete _0x35f922[_0xabd1('0x28')];}_0x15be36[_0xabd1('0x1b')](_0x3c1520)[_0xabd1('0x29')](_0x35f922);};}exports[_0xabd1('0x2a')]=function(_0x7f7469,_0x2e10b9){var _0xdb907f={},_0x1dd4d2={},_0xb1dc03={'count':0x0,'rows':[]};var _0x4c6403=_[_0xabd1('0x2b')](db[_0xabd1('0x2c')][_0xabd1('0x2d')],function(_0x39c76f){return{'name':_0x39c76f[_0xabd1('0x2e')],'type':_0x39c76f[_0xabd1('0x2f')][_0xabd1('0x30')]};});_0x1dd4d2['model']=_[_0xabd1('0x2b')](_0x4c6403,_0xabd1('0x28'));_0x1dd4d2[_0xabd1('0x31')]=_[_0xabd1('0x32')](_0x7f7469[_0xabd1('0x31')]);_0x1dd4d2[_0xabd1('0x33')]=_['intersection'](_0x1dd4d2['model'],_0x1dd4d2[_0xabd1('0x31')]);_0xdb907f['attributes']=_[_0xabd1('0x34')](_0x1dd4d2['model'],qs[_0xabd1('0x35')](_0x7f7469[_0xabd1('0x31')][_0xabd1('0x35')]));_0xdb907f[_0xabd1('0x36')]=_0xdb907f[_0xabd1('0x36')]['length']?_0xdb907f[_0xabd1('0x36')]:_0x1dd4d2[_0xabd1('0x37')];if(!_0x7f7469[_0xabd1('0x31')][_0xabd1('0x38')](_0xabd1('0x39'))){_0xdb907f[_0xabd1('0x20')]=qs[_0xabd1('0x20')](_0x7f7469[_0xabd1('0x31')][_0xabd1('0x20')]);_0xdb907f[_0xabd1('0x1d')]=qs[_0xabd1('0x1d')](_0x7f7469[_0xabd1('0x31')]['offset']);}_0xdb907f[_0xabd1('0x3a')]=qs['sort'](_0x7f7469[_0xabd1('0x31')][_0xabd1('0x3b')]);_0xdb907f[_0xabd1('0x3c')]=qs[_0xabd1('0x33')](_[_0xabd1('0x3d')](_0x7f7469[_0xabd1('0x31')],_0x1dd4d2[_0xabd1('0x33')]),_0x4c6403);if(_0x7f7469['query'][_0xabd1('0x3e')]){_0xdb907f['where']=_[_0xabd1('0x3f')](_0xdb907f['where'],{'$or':_[_0xabd1('0x2b')](_0x4c6403,function(_0x360c25){if(_0x360c25[_0xabd1('0x2f')]!==_0xabd1('0x40')){var _0x21a00c={};_0x21a00c[_0x360c25[_0xabd1('0x28')]]={'$like':'%'+_0x7f7469[_0xabd1('0x31')][_0xabd1('0x3e')]+'%'};return _0x21a00c;}})});}_0xdb907f=_['merge']({},_0xdb907f,_0x7f7469['options']);var _0x777d4f={'where':_0xdb907f[_0xabd1('0x3c')]};return db[_0xabd1('0x2c')][_0xabd1('0x1f')](_0x777d4f)['then'](function(_0xbc760e){_0xb1dc03[_0xabd1('0x1f')]=_0xbc760e;if(_0x7f7469['query'][_0xabd1('0x41')]){_0xdb907f[_0xabd1('0x42')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0xdb907f);})[_0xabd1('0x25')](function(_0x33584b){_0xb1dc03[_0xabd1('0x43')]=_0x33584b;return _0xb1dc03;})[_0xabd1('0x25')](respondWithFilteredResult(_0x2e10b9,_0xdb907f))[_0xabd1('0x44')](handleError(_0x2e10b9,null));};exports[_0xabd1('0x45')]=function(_0xced3a4,_0x1c261b){var _0x40109d={'raw':!![],'where':{'id':_0xced3a4[_0xabd1('0x46')]['id']}},_0x15c4f9={};_0x15c4f9[_0xabd1('0x37')]=_[_0xabd1('0x32')](db[_0xabd1('0x2c')][_0xabd1('0x2d')]);_0x15c4f9[_0xabd1('0x31')]=_[_0xabd1('0x32')](_0xced3a4[_0xabd1('0x31')]);_0x15c4f9[_0xabd1('0x33')]=_[_0xabd1('0x34')](_0x15c4f9['model'],_0x15c4f9[_0xabd1('0x31')]);_0x40109d['attributes']=_[_0xabd1('0x34')](_0x15c4f9[_0xabd1('0x37')],qs[_0xabd1('0x35')](_0xced3a4[_0xabd1('0x31')][_0xabd1('0x35')]));_0x40109d['attributes']=_0x40109d['attributes'][_0xabd1('0x47')]?_0x40109d[_0xabd1('0x36')]:_0x15c4f9[_0xabd1('0x37')];if(_0xced3a4['query'][_0xabd1('0x41')]){_0x40109d['include']=[{'all':!![]}];}_0x40109d=_[_0xabd1('0x3f')]({},_0x40109d,_0xced3a4[_0xabd1('0x48')]);return db[_0xabd1('0x2c')][_0xabd1('0x49')](_0x40109d)[_0xabd1('0x25')](handleEntityNotFound(_0x1c261b,null))[_0xabd1('0x25')](respondWithResult(_0x1c261b,null))['catch'](handleError(_0x1c261b,null));};exports[_0xabd1('0x4a')]=function(_0x55a3a4,_0x11b05e){return db[_0xabd1('0x2c')][_0xabd1('0x4a')](_0x55a3a4[_0xabd1('0x4b')],{})[_0xabd1('0x25')](respondWithResult(_0x11b05e,0xc9))['catch'](handleError(_0x11b05e,null));};exports['update']=function(_0x53ba07,_0x5c9524){if(_0x53ba07['body']['id']){delete _0x53ba07[_0xabd1('0x4b')]['id'];}return db['Dynamics365Field'][_0xabd1('0x49')]({'where':{'id':_0x53ba07[_0xabd1('0x46')]['id']}})[_0xabd1('0x25')](handleEntityNotFound(_0x5c9524,null))[_0xabd1('0x25')](saveUpdates(_0x53ba07[_0xabd1('0x4b')],null))[_0xabd1('0x25')](respondWithResult(_0x5c9524,null))[_0xabd1('0x44')](handleError(_0x5c9524,null));};exports[_0xabd1('0x26')]=function(_0x26e426,_0x5075e6){return db['Dynamics365Field']['find']({'where':{'id':_0x26e426[_0xabd1('0x46')]['id']}})[_0xabd1('0x25')](handleEntityNotFound(_0x5075e6,null))[_0xabd1('0x25')](removeEntity(_0x5075e6,null))[_0xabd1('0x44')](handleError(_0x5075e6,null));};
\ No newline at end of file
index f17f111..d2b4b0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd825=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_dynamics365_fields','dynamics365_unique_index','FieldId','../../config/logger'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xd825,0xfb));var _0x5d82=function(_0x13ad01,_0x2271db){_0x13ad01=_0x13ad01-0x0;var _0x28993a=_0xd825[_0x13ad01];return _0x28993a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5d82('0x0'))(_0x5d82('0x1'));var moment=require(_0x5d82('0x2'));var BPromise=require(_0x5d82('0x3'));var rp=require(_0x5d82('0x4'));var fs=require('fs');var path=require(_0x5d82('0x5'));var rimraf=require(_0x5d82('0x6'));var config=require(_0x5d82('0x7'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x29d400,_0x26356d){return _0x29d400[_0x5d82('0x8')]('Dynamics365Field',attributes,{'tableName':_0x5d82('0x9'),'paranoid':![],'indexes':[{'name':_0x5d82('0xa'),'fields':['idField',_0x5d82('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x77a4=['lodash','util','api','moment','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId'];(function(_0x130c28,_0x5ac312){var _0x1a7ced=function(_0x353911){while(--_0x353911){_0x130c28['push'](_0x130c28['shift']());}};_0x1a7ced(++_0x5ac312);}(_0x77a4,0x15f));var _0x477a=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0x77a4[_0x3a13cf];return _0x4817c;};'use strict';var _=require(_0x477a('0x0'));var util=require(_0x477a('0x1'));var logger=require('../../config/logger')(_0x477a('0x2'));var moment=require(_0x477a('0x3'));var BPromise=require(_0x477a('0x4'));var rp=require(_0x477a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x477a('0x6'));var config=require('../../config/environment');var attributes=require(_0x477a('0x7'));module['exports']=function(_0x15965e,_0x4c49dd){return _0x15965e[_0x477a('0x8')](_0x477a('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x477a('0xa'),'fields':[_0x477a('0xb'),_0x477a('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5dd78ba..10c8694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1c548a,_0x374b8f){var _0xabdfac=function(_0x289c59){while(--_0x289c59){_0x1c548a['push'](_0x1c548a['shift']());}};_0xabdfac(++_0x374b8f);}(_0xdae4,0x159));var _0x4dae=function(_0x4fa96e,_0x211c58){_0x4fa96e=_0x4fa96e-0x0;var _0x4814a9=_0xdae4[_0x4fa96e];return _0x4814a9;};'use strict';var _=require('lodash');var util=require(_0x4dae('0x0'));var moment=require(_0x4dae('0x1'));var BPromise=require(_0x4dae('0x2'));var rs=require(_0x4dae('0x3'));var fs=require('fs');var Redis=require(_0x4dae('0x4'));var db=require(_0x4dae('0x5'))['db'];var utils=require(_0x4dae('0x6'));var logger=require('../../config/logger')(_0x4dae('0x7'));var config=require(_0x4dae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4dae('0x9')][_0x4dae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d6871,_0x553238,_0x55af5f){return new BPromise(function(_0x4bd67d,_0x524955){return client[_0x4dae('0xb')](_0x1d6871,_0x55af5f)['then'](function(_0x1e7070){logger[_0x4dae('0xc')](_0x4dae('0xd'),_0x553238,_0x4dae('0xe'));logger[_0x4dae('0xf')](_0x4dae('0x10'),_0x553238,'request\x20sent',JSON[_0x4dae('0x11')](_0x1e7070));if(_0x1e7070['error']){if(_0x1e7070[_0x4dae('0x12')][_0x4dae('0x13')]===0x1f4){logger['error'](_0x4dae('0xd'),_0x553238,_0x1e7070['error'][_0x4dae('0x14')]);return _0x524955(_0x1e7070['error']['message']);}logger[_0x4dae('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x553238,_0x1e7070[_0x4dae('0x12')][_0x4dae('0x14')]);return _0x4bd67d(_0x1e7070[_0x4dae('0x12')][_0x4dae('0x14')]);}else{logger[_0x4dae('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x553238,'request\x20sent');_0x4bd67d(_0x1e7070[_0x4dae('0x15')][_0x4dae('0x14')]);}})[_0x4dae('0x16')](function(_0x168f92){logger[_0x4dae('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x553238,_0x168f92);_0x524955(_0x168f92);});});}
\ No newline at end of file
+var _0x772f=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x772f,0xbb));var _0xf772=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x772f[_0x308213];return _0x2e1619;};'use strict';var _=require(_0xf772('0x0'));var util=require(_0xf772('0x1'));var moment=require(_0xf772('0x2'));var BPromise=require(_0xf772('0x3'));var rs=require(_0xf772('0x4'));var fs=require('fs');var Redis=require(_0xf772('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf772('0x6'));var logger=require(_0xf772('0x7'))(_0xf772('0x8'));var config=require(_0xf772('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf772('0xa')][_0xf772('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cb72a,_0x317331,_0x4167a9){return new BPromise(function(_0x584d77,_0x4ebc58){return client[_0xf772('0xc')](_0x3cb72a,_0x4167a9)[_0xf772('0xd')](function(_0x194166){logger[_0xf772('0xe')](_0xf772('0xf'),_0x317331,_0xf772('0x10'));logger[_0xf772('0x11')](_0xf772('0x12'),_0x317331,'request\x20sent',JSON['stringify'](_0x194166));if(_0x194166[_0xf772('0x13')]){if(_0x194166[_0xf772('0x13')][_0xf772('0x14')]===0x1f4){logger[_0xf772('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x317331,_0x194166[_0xf772('0x13')][_0xf772('0x15')]);return _0x4ebc58(_0x194166[_0xf772('0x13')]['message']);}logger[_0xf772('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x317331,_0x194166[_0xf772('0x13')][_0xf772('0x15')]);return _0x584d77(_0x194166[_0xf772('0x13')][_0xf772('0x15')]);}else{logger[_0xf772('0xe')](_0xf772('0xf'),_0x317331,_0xf772('0x10'));_0x584d77(_0x194166[_0xf772('0x16')][_0xf772('0x15')]);}})['catch'](function(_0x243a94){logger[_0xf772('0x13')](_0xf772('0xf'),_0x317331,_0x243a94);_0x4ebc58(_0x243a94);});});}
\ No newline at end of file
index f9099c6..ff13add 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdafb=['multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports'];(function(_0x15a08f,_0x40f34b){var _0x4c1f39=function(_0x56f32e){while(--_0x56f32e){_0x15a08f['push'](_0x15a08f['shift']());}};_0x4c1f39(++_0x40f34b);}(_0xdafb,0x1e4));var _0xbdaf=function(_0x1d5a60,_0x22bbb9){_0x1d5a60=_0x1d5a60-0x0;var _0x2c11ba=_0xdafb[_0x1d5a60];return _0x2c11ba;};'use strict';var multer=require(_0xbdaf('0x0'));var util=require(_0xbdaf('0x1'));var path=require(_0xbdaf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbdaf('0x3'));var auth=require(_0xbdaf('0x4'));var interaction=require(_0xbdaf('0x5'));var config=require(_0xbdaf('0x6'));var controller=require(_0xbdaf('0x7'));router[_0xbdaf('0x8')]('/',auth[_0xbdaf('0x9')](),controller[_0xbdaf('0xa')]);router['get'](_0xbdaf('0xb'),auth[_0xbdaf('0x9')](),controller['show']);router[_0xbdaf('0x8')](_0xbdaf('0xc'),auth[_0xbdaf('0x9')](),controller[_0xbdaf('0xd')]);router[_0xbdaf('0x8')](_0xbdaf('0xe'),auth[_0xbdaf('0x9')](),controller[_0xbdaf('0xf')]);router[_0xbdaf('0x10')]('/',auth[_0xbdaf('0x9')](),controller[_0xbdaf('0x11')]);router[_0xbdaf('0x10')](_0xbdaf('0xc'),auth[_0xbdaf('0x9')](),controller[_0xbdaf('0x12')]);router[_0xbdaf('0x13')](_0xbdaf('0xb'),auth[_0xbdaf('0x9')](),controller['update']);router[_0xbdaf('0x14')](_0xbdaf('0xb'),auth[_0xbdaf('0x9')](),controller['destroy']);module[_0xbdaf('0x15')]=router;
\ No newline at end of file
+var _0x74ca=['./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e6702,_0x4c8d19){var _0x5debfe=function(_0x1a4275){while(--_0x1a4275){_0x1e6702['push'](_0x1e6702['shift']());}};_0x5debfe(++_0x4c8d19);}(_0x74ca,0x8b));var _0xa74c=function(_0x350507,_0x5599cc){_0x350507=_0x350507-0x0;var _0x3d8898=_0x74ca[_0x350507];return _0x3d8898;};'use strict';var multer=require(_0xa74c('0x0'));var util=require(_0xa74c('0x1'));var path=require(_0xa74c('0x2'));var timeout=require(_0xa74c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa74c('0x4'));var auth=require(_0xa74c('0x5'));var interaction=require(_0xa74c('0x6'));var config=require(_0xa74c('0x7'));var controller=require(_0xa74c('0x8'));router[_0xa74c('0x9')]('/',auth[_0xa74c('0xa')](),controller['index']);router['get'](_0xa74c('0xb'),auth[_0xa74c('0xa')](),controller[_0xa74c('0xc')]);router[_0xa74c('0x9')](_0xa74c('0xd'),auth[_0xa74c('0xa')](),controller[_0xa74c('0xe')]);router['get'](_0xa74c('0xf'),auth[_0xa74c('0xa')](),controller[_0xa74c('0x10')]);router[_0xa74c('0x11')]('/',auth[_0xa74c('0xa')](),controller['create']);router[_0xa74c('0x11')](_0xa74c('0xd'),auth['isAuthenticated'](),controller[_0xa74c('0x12')]);router[_0xa74c('0x13')](_0xa74c('0xb'),auth[_0xa74c('0xa')](),controller[_0xa74c('0x14')]);router['delete']('/:id',auth[_0xa74c('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fe2c7a4..3710ac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','STRING','username','sequelize'];(function(_0x5e9437,_0x512eb4){var _0x4ada0a=function(_0x3d939f){while(--_0x3d939f){_0x5e9437['push'](_0x5e9437['shift']());}};_0x4ada0a(++_0x512eb4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5261a7,_0x2d06bd){_0x5261a7=_0x5261a7-0x0;var _0x1d8ad7=_0x5f2f[_0x5261a7];return _0x1d8ad7;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'name':{'type':Sequelize[_0xf5f2('0x2')]},'description':{'type':Sequelize[_0xf5f2('0x2')]},'username':{'type':Sequelize[_0xf5f2('0x2')],'unique':_0xf5f2('0x3')},'apiKey':{'type':Sequelize[_0xf5f2('0x2')]},'remoteUri':{'type':Sequelize[_0xf5f2('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x5204=['exports','STRING','username','sequelize'];(function(_0x375611,_0x47201c){var _0x2ca53d=function(_0x2adac1){while(--_0x2adac1){_0x375611['push'](_0x375611['shift']());}};_0x2ca53d(++_0x47201c);}(_0x5204,0xdf));var _0x4520=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x5204[_0x596c43];return _0x4e1315;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}};
\ No newline at end of file
index d17a2e8..3a58680 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9491=['statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','sendStatus','name','send','index','map','FreshdeskAccount','fieldName','type','model','query','keys','intersection','attributes','fields','length','limit','sort','pick','filters','where','merge','includeAll','include','findAll','show','params','rawAttributes','create','body','find','destroy','findOne','order','filter','options','getConfigurations','hasOwnProperty','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','api/v2/ticket_fields','Basic\x20%s','format','%s:X','toString','base64','requester','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test'];(function(_0x1f87f6,_0x58e9bf){var _0x36460e=function(_0x4dd2ce){while(--_0x4dd2ce){_0x1f87f6['push'](_0x1f87f6['shift']());}};_0x36460e(++_0x58e9bf);}(_0x9491,0x82));var _0x1949=function(_0x25d26d,_0x54b0eb){_0x25d26d=_0x25d26d-0x0;var _0x10dd7b=_0x9491[_0x25d26d];return _0x10dd7b;};'use strict';var emlformat=require(_0x1949('0x0'));var rimraf=require(_0x1949('0x1'));var zipdir=require(_0x1949('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1949('0x3'));var moment=require(_0x1949('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1949('0x5'));var path=require(_0x1949('0x6'));var sox=require(_0x1949('0x7'));var csv=require(_0x1949('0x8'));var ejs=require(_0x1949('0x9'));var fs=require('fs');var fs_extra=require(_0x1949('0xa'));var _=require('lodash');var squel=require(_0x1949('0xb'));var crypto=require('crypto');var jsforce=require(_0x1949('0xc'));var deskjs=require(_0x1949('0xd'));var toCsv=require(_0x1949('0x8'));var querystring=require(_0x1949('0xe'));var Papa=require('papaparse');var Redis=require(_0x1949('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1949('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1949('0x11'));var logger=require(_0x1949('0x12'))('api');var utils=require(_0x1949('0x13'));var config=require(_0x1949('0x14'));var licenseUtil=require(_0x1949('0x15'));var db=require(_0x1949('0x16'))['db'];var integrations=require(_0x1949('0x17'));var jayson=require(_0x1949('0x18'));var client=jayson[_0x1949('0x19')][_0x1949('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x172207,_0x2aa035,_0x25fca1,_0x16258e){return new BPromise(function(_0x4ff932,_0x19fad5){var _0x199311=_0x16258e||client;return _0x199311[_0x1949('0x1b')](_0x172207,_0x25fca1)[_0x1949('0x1c')](function(_0x49ee25){logger[_0x1949('0x1d')](_0x1949('0x1e'),_0x2aa035,'request\x20sent');logger[_0x1949('0x1f')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2aa035,_0x1949('0x20'),JSON[_0x1949('0x21')](_0x49ee25));if(_0x49ee25['error']){if(_0x49ee25[_0x1949('0x22')][_0x1949('0x23')]===0x1f4){logger[_0x1949('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x2aa035,_0x49ee25[_0x1949('0x22')]['message']);return _0x19fad5(_0x49ee25['error'][_0x1949('0x24')]);}logger[_0x1949('0x22')](_0x1949('0x1e'),_0x2aa035,_0x49ee25[_0x1949('0x22')][_0x1949('0x24')]);return _0x4ff932(_0x49ee25[_0x1949('0x22')][_0x1949('0x24')]);}else{logger[_0x1949('0x1d')]('FreshdeskAccount,\x20%s,\x20%s',_0x2aa035,_0x1949('0x20'));_0x4ff932(_0x49ee25['result']['message']);}})[_0x1949('0x25')](function(_0x50037b){logger['error'](_0x1949('0x1e'),_0x2aa035,_0x50037b);_0x19fad5(_0x50037b);});});}function respondWithStatusCode(_0x38dfe7,_0x210fe2){_0x210fe2=_0x210fe2||0xcc;return function(_0x218cbd){if(_0x218cbd){return _0x38dfe7['sendStatus'](_0x210fe2);}return _0x38dfe7[_0x1949('0x26')](_0x210fe2)[_0x1949('0x27')]();};}function respondWithResult(_0x4c659d,_0x23aed3){_0x23aed3=_0x23aed3||0xc8;return function(_0x15fb7b){if(_0x15fb7b){return _0x4c659d['status'](_0x23aed3)[_0x1949('0x28')](_0x15fb7b);}};}function respondWithFilteredResult(_0x234421,_0x413d1b){return function(_0x217997){if(_0x217997){var _0x406ed3=typeof _0x413d1b[_0x1949('0x29')]==='undefined'&&typeof _0x413d1b['limit']===_0x1949('0x2a');var _0x23a677=_0x217997['count'];var _0xe40df7=_0x406ed3?0x0:_0x413d1b[_0x1949('0x29')];var _0x30570d=_0x406ed3?_0x217997[_0x1949('0x2b')]:_0x413d1b[_0x1949('0x29')]+_0x413d1b['limit'];var _0x87c76f;if(_0x30570d>=_0x23a677){_0x30570d=_0x23a677;_0x87c76f=0xc8;}else{_0x87c76f=0xce;}_0x234421['status'](_0x87c76f);return _0x234421[_0x1949('0x2c')](_0x1949('0x2d'),_0xe40df7+'-'+_0x30570d+'/'+_0x23a677)['json'](_0x217997);}return null;};}function patchUpdates(_0x2a2aea){return function(_0x267676){try{jsonpatch[_0x1949('0x2e')](_0x267676,_0x2a2aea,!![]);}catch(_0x511e15){return BPromise[_0x1949('0x2f')](_0x511e15);}return _0x267676['save']();};}function saveUpdates(_0x47400a,_0x53c897){return function(_0x47d82d){if(_0x47d82d){return _0x47d82d[_0x1949('0x30')](_0x47400a)[_0x1949('0x1c')](function(_0x494bd7){return _0x494bd7;});}return null;};}function removeEntity(_0x53a18d,_0x5cbb0a){return function(_0x78f820){if(_0x78f820){return _0x78f820['destroy']()[_0x1949('0x1c')](function(){_0x53a18d[_0x1949('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x241be7,_0x3ec606){return function(_0x1b09ce){if(!_0x1b09ce){_0x241be7[_0x1949('0x31')](0x194);}return _0x1b09ce;};}function handleError(_0x38ebe8,_0x209dc0){_0x209dc0=_0x209dc0||0x1f4;return function(_0x3e6dc9){logger[_0x1949('0x22')](_0x3e6dc9['stack']);if(_0x3e6dc9['name']){delete _0x3e6dc9[_0x1949('0x32')];}_0x38ebe8['status'](_0x209dc0)[_0x1949('0x33')](_0x3e6dc9);};}exports[_0x1949('0x34')]=function(_0x18f63e,_0x45641f){var _0xb02f22={},_0x160d72={},_0x4eb755={'count':0x0,'rows':[]};var _0x54c848=_[_0x1949('0x35')](db[_0x1949('0x36')]['rawAttributes'],function(_0x263f7c){return{'name':_0x263f7c[_0x1949('0x37')],'type':_0x263f7c[_0x1949('0x38')]['key']};});_0x160d72[_0x1949('0x39')]=_[_0x1949('0x35')](_0x54c848,_0x1949('0x32'));_0x160d72[_0x1949('0x3a')]=_[_0x1949('0x3b')](_0x18f63e[_0x1949('0x3a')]);_0x160d72['filters']=_[_0x1949('0x3c')](_0x160d72[_0x1949('0x39')],_0x160d72[_0x1949('0x3a')]);_0xb02f22[_0x1949('0x3d')]=_[_0x1949('0x3c')](_0x160d72[_0x1949('0x39')],qs[_0x1949('0x3e')](_0x18f63e['query'][_0x1949('0x3e')]));_0xb02f22[_0x1949('0x3d')]=_0xb02f22[_0x1949('0x3d')][_0x1949('0x3f')]?_0xb02f22[_0x1949('0x3d')]:_0x160d72[_0x1949('0x39')];if(!_0x18f63e[_0x1949('0x3a')]['hasOwnProperty']('nolimit')){_0xb02f22[_0x1949('0x40')]=qs[_0x1949('0x40')](_0x18f63e[_0x1949('0x3a')][_0x1949('0x40')]);_0xb02f22[_0x1949('0x29')]=qs[_0x1949('0x29')](_0x18f63e[_0x1949('0x3a')][_0x1949('0x29')]);}_0xb02f22['order']=qs[_0x1949('0x41')](_0x18f63e[_0x1949('0x3a')]['sort']);_0xb02f22['where']=qs['filters'](_[_0x1949('0x42')](_0x18f63e[_0x1949('0x3a')],_0x160d72[_0x1949('0x43')]),_0x54c848);if(_0x18f63e[_0x1949('0x3a')]['filter']){_0xb02f22['where']=_['merge'](_0xb02f22[_0x1949('0x44')],{'$or':_[_0x1949('0x35')](_0x54c848,function(_0x101e54){if(_0x101e54[_0x1949('0x38')]!=='VIRTUAL'){var _0x16c7e3={};_0x16c7e3[_0x101e54[_0x1949('0x32')]]={'$like':'%'+_0x18f63e[_0x1949('0x3a')]['filter']+'%'};return _0x16c7e3;}})});}_0xb02f22=_[_0x1949('0x45')]({},_0xb02f22,_0x18f63e['options']);var _0x52038d={'where':_0xb02f22['where']};return db[_0x1949('0x36')]['count'](_0x52038d)[_0x1949('0x1c')](function(_0x6660ee){_0x4eb755[_0x1949('0x2b')]=_0x6660ee;if(_0x18f63e['query'][_0x1949('0x46')]){_0xb02f22[_0x1949('0x47')]=[{'all':!![]}];}return db[_0x1949('0x36')][_0x1949('0x48')](_0xb02f22);})['then'](function(_0x2cc568){_0x4eb755['rows']=_0x2cc568;return _0x4eb755;})[_0x1949('0x1c')](respondWithFilteredResult(_0x45641f,_0xb02f22))[_0x1949('0x25')](handleError(_0x45641f,null));};exports[_0x1949('0x49')]=function(_0x43b3f4,_0x9e05a9){var _0x525123={'raw':![],'where':{'id':_0x43b3f4[_0x1949('0x4a')]['id']}},_0x190d63={};_0x190d63[_0x1949('0x39')]=_['keys'](db[_0x1949('0x36')][_0x1949('0x4b')]);_0x190d63[_0x1949('0x3a')]=_['keys'](_0x43b3f4[_0x1949('0x3a')]);_0x190d63[_0x1949('0x43')]=_['intersection'](_0x190d63[_0x1949('0x39')],_0x190d63[_0x1949('0x3a')]);_0x525123[_0x1949('0x3d')]=_[_0x1949('0x3c')](_0x190d63[_0x1949('0x39')],qs[_0x1949('0x3e')](_0x43b3f4[_0x1949('0x3a')]['fields']));_0x525123[_0x1949('0x3d')]=_0x525123[_0x1949('0x3d')][_0x1949('0x3f')]?_0x525123[_0x1949('0x3d')]:_0x190d63[_0x1949('0x39')];if(_0x43b3f4[_0x1949('0x3a')][_0x1949('0x46')]){_0x525123[_0x1949('0x47')]=[{'all':!![]}];}_0x525123=_[_0x1949('0x45')]({},_0x525123,_0x43b3f4['options']);return db[_0x1949('0x36')]['find'](_0x525123)[_0x1949('0x1c')](handleEntityNotFound(_0x9e05a9,null))[_0x1949('0x1c')](respondWithResult(_0x9e05a9,null))[_0x1949('0x25')](handleError(_0x9e05a9,null));};exports[_0x1949('0x4c')]=function(_0x2e1b66,_0x34254){return db[_0x1949('0x36')][_0x1949('0x4c')](_0x2e1b66['body'],{})[_0x1949('0x1c')](respondWithResult(_0x34254,0xc9))[_0x1949('0x25')](handleError(_0x34254,null));};exports[_0x1949('0x30')]=function(_0x3d91c6,_0x19e5d6){if(_0x3d91c6[_0x1949('0x4d')]['id']){delete _0x3d91c6['body']['id'];}return db[_0x1949('0x36')][_0x1949('0x4e')]({'where':{'id':_0x3d91c6[_0x1949('0x4a')]['id']}})['then'](handleEntityNotFound(_0x19e5d6,null))[_0x1949('0x1c')](saveUpdates(_0x3d91c6[_0x1949('0x4d')],null))['then'](respondWithResult(_0x19e5d6,null))[_0x1949('0x25')](handleError(_0x19e5d6,null));};exports[_0x1949('0x4f')]=function(_0x34ded0,_0x116d94){return db['FreshdeskAccount'][_0x1949('0x4e')]({'where':{'id':_0x34ded0[_0x1949('0x4a')]['id']}})['then'](handleEntityNotFound(_0x116d94,null))[_0x1949('0x1c')](removeEntity(_0x116d94,null))[_0x1949('0x25')](handleError(_0x116d94,null));};exports['getConfigurations']=function(_0x585f74,_0x3a817d,_0x1d88f1){var _0x33085e={};var _0x15dad4={};var _0x3c881a;var _0x2a6e23;return db[_0x1949('0x36')][_0x1949('0x50')]({'where':{'id':_0x585f74[_0x1949('0x4a')]['id']}})[_0x1949('0x1c')](handleEntityNotFound(_0x3a817d,null))[_0x1949('0x1c')](function(_0x374ce4){if(_0x374ce4){_0x3c881a=_0x374ce4;_0x15dad4['model']=_[_0x1949('0x3b')](db['FreshdeskConfiguration'][_0x1949('0x4b')]);_0x15dad4[_0x1949('0x3a')]=_[_0x1949('0x3b')](_0x585f74[_0x1949('0x3a')]);_0x15dad4[_0x1949('0x43')]=_[_0x1949('0x3c')](_0x15dad4['model'],_0x15dad4[_0x1949('0x3a')]);_0x33085e[_0x1949('0x3d')]=_[_0x1949('0x3c')](_0x15dad4[_0x1949('0x39')],qs[_0x1949('0x3e')](_0x585f74[_0x1949('0x3a')]['fields']));_0x33085e[_0x1949('0x3d')]=_0x33085e[_0x1949('0x3d')][_0x1949('0x3f')]?_0x33085e[_0x1949('0x3d')]:_0x15dad4['model'];_0x33085e[_0x1949('0x51')]=qs[_0x1949('0x41')](_0x585f74[_0x1949('0x3a')][_0x1949('0x41')]);_0x33085e[_0x1949('0x44')]=qs['filters'](_['pick'](_0x585f74[_0x1949('0x3a')],_0x15dad4[_0x1949('0x43')]));if(_0x585f74[_0x1949('0x3a')]['filter']){_0x33085e[_0x1949('0x44')]=_[_0x1949('0x45')](_0x33085e[_0x1949('0x44')],{'$or':_[_0x1949('0x35')](_0x33085e['attributes'],function(_0x2f1d71){var _0x42bdce={};_0x42bdce[_0x2f1d71]={'$like':'%'+_0x585f74[_0x1949('0x3a')][_0x1949('0x52')]+'%'};return _0x42bdce;})});}_0x33085e=_[_0x1949('0x45')]({},_0x33085e,_0x585f74[_0x1949('0x53')]);return _0x3c881a[_0x1949('0x54')](_0x33085e);}})['then'](function(_0x3fbb14){if(_0x3fbb14){_0x2a6e23=_0x3fbb14[_0x1949('0x3f')];if(!_0x585f74[_0x1949('0x3a')][_0x1949('0x55')](_0x1949('0x56'))){_0x33085e[_0x1949('0x40')]=qs[_0x1949('0x40')](_0x585f74[_0x1949('0x3a')][_0x1949('0x40')]);_0x33085e['offset']=qs['offset'](_0x585f74[_0x1949('0x3a')]['offset']);}return _0x3c881a[_0x1949('0x54')](_0x33085e);}})['then'](function(_0x3d4fec){if(_0x3d4fec){return _0x3d4fec?{'count':_0x2a6e23,'rows':_0x3d4fec}:null;}})['then'](respondWithResult(_0x3a817d,null))['catch'](handleError(_0x3a817d,null));};exports[_0x1949('0x57')]=function(_0x5b6c7f,_0x5615c3,_0x33870a){if(_0x5b6c7f[_0x1949('0x4d')]['id']){delete _0x5b6c7f[_0x1949('0x4d')]['id'];}return db[_0x1949('0x36')][_0x1949('0x50')]({'where':{'id':_0x5b6c7f[_0x1949('0x4a')]['id']}})[_0x1949('0x1c')](handleEntityNotFound(_0x5615c3,null))[_0x1949('0x1c')](function(_0x1c6e3c){if(_0x1c6e3c){_0x5b6c7f[_0x1949('0x4d')]['AccountId']=_0x1c6e3c['id'];_0x5b6c7f[_0x1949('0x4d')]['Subjects']=integrations[_0x1949('0x58')](_0x5b6c7f['body'][_0x1949('0x59')],_0x5b6c7f['body'][_0x1949('0x38')]);_0x5b6c7f[_0x1949('0x4d')][_0x1949('0x5a')]=integrations[_0x1949('0x5b')](_0x5b6c7f[_0x1949('0x4d')][_0x1949('0x59')],_0x5b6c7f[_0x1949('0x4d')]['type']);return db[_0x1949('0x5c')][_0x1949('0x4c')](_0x5b6c7f['body'],{'include':[{'model':db[_0x1949('0x5d')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x1949('0x5a')}]});}return null;})['then'](respondWithResult(_0x5615c3,null))[_0x1949('0x25')](handleError(_0x5615c3,null));};exports['getFields']=function(_0x376431,_0x13edfd,_0x13effa){var _0x9267e0='';return db[_0x1949('0x36')][_0x1949('0x50')]({'where':{'id':_0x376431['params']['id']},'attributes':['id',_0x1949('0x5e'),_0x1949('0x5f')]})[_0x1949('0x1c')](handleEntityNotFound(_0x13edfd,null))[_0x1949('0x1c')](function(_0x3cc2f6){if(_0x3cc2f6){_0x9267e0=_0x3cc2f6[_0x1949('0x5e')];var _0x13ed30=_0x9267e0[_0x1949('0x60')](-0x1);if(_0x13ed30==='/'){_0x9267e0=_0x9267e0[_0x1949('0x61')](0x0,_0x9267e0[_0x1949('0x62')](_0x13ed30));}return rp({'method':_0x1949('0x63'),'uri':util['format']('%s/%s',_0x9267e0,_0x1949('0x64')),'headers':{'Authorization':util['format'](_0x1949('0x65'),new Buffer(util[_0x1949('0x66')](_0x1949('0x67'),_0x3cc2f6[_0x1949('0x5f')]))[_0x1949('0x68')](_0x1949('0x69')))},'json':!![]});}})[_0x1949('0x1c')](function(_0x55fdbb){if(_0x55fdbb){var _0x510169=[_0x1949('0x6a'),'subject',_0x1949('0x6b'),_0x1949('0x6c'),_0x1949('0x26'),_0x1949('0x6d'),_0x1949('0x6e'),'source',_0x1949('0x6f'),_0x1949('0x6e'),_0x1949('0x70')];_[_0x1949('0x71')](_0x55fdbb,function(_0x2b69bf){return _0x510169[_0x1949('0x72')](_0x2b69bf[_0x1949('0x32')])||!_0x2b69bf[_0x1949('0x73')]&&_0x2b69bf[_0x1949('0x38')]!==_0x1949('0x74')&&_0x2b69bf['type']!==_0x1949('0x75');});return{'count':_0x55fdbb[_0x1949('0x3f')],'rows':_[_0x1949('0x35')](_0x55fdbb,function(_0x44d034){return{'id':_0x44d034[_0x1949('0x32')],'name':_0x44d034[_0x1949('0x76')],'custom':!_0x44d034['default'],'options':_0x44d034[_0x1949('0x77')]?_[_0x1949('0x35')](_0x44d034[_0x1949('0x77')],function(_0x218356){return{'name':_[_0x1949('0x78')](_0x218356),'value':_0x218356};}):[]};})};}})[_0x1949('0x1c')](respondWithResult(_0x13edfd,null))[_0x1949('0x25')](function(_0x5a9943){var _0x37f70c=_0x376431['query'][_0x1949('0x79')]?0x1f4:_0x5a9943[_0x1949('0x7a')]||0x1f4;logger[_0x1949('0x22')](_0x1949('0x7b'),_0x1949('0x7c'),_0x37f70c,JSON[_0x1949('0x21')](_0x5a9943));delete _0x5a9943[_0x1949('0x32')];if(_0x37f70c===0x191){_0x37f70c=0x190;}_0x13edfd['status'](_0x37f70c)[_0x1949('0x33')](_0x376431[_0x1949('0x3a')][_0x1949('0x79')]?{'message':_0x1949('0x7d'),'statusCode':_0x5a9943[_0x1949('0x7a')]}:_0x5a9943);});};
\ No newline at end of file
+var _0x55d7=['http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FreshdeskAccount','count','include','findAll','rows','show','includeAll','options','find','create','body','params','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','subject','agent','description','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x55d7,0x65));var _0x755d=function(_0x13eca7,_0x29b30d){_0x13eca7=_0x13eca7-0x0;var _0x1abd34=_0x55d7[_0x13eca7];return _0x1abd34;};'use strict';var emlformat=require(_0x755d('0x0'));var rimraf=require(_0x755d('0x1'));var zipdir=require(_0x755d('0x2'));var jsonpatch=require(_0x755d('0x3'));var rp=require(_0x755d('0x4'));var moment=require('moment');var BPromise=require(_0x755d('0x5'));var Mustache=require(_0x755d('0x6'));var util=require(_0x755d('0x7'));var path=require(_0x755d('0x8'));var sox=require(_0x755d('0x9'));var csv=require(_0x755d('0xa'));var ejs=require(_0x755d('0xb'));var fs=require('fs');var fs_extra=require(_0x755d('0xc'));var _=require('lodash');var squel=require(_0x755d('0xd'));var crypto=require(_0x755d('0xe'));var jsforce=require(_0x755d('0xf'));var deskjs=require(_0x755d('0x10'));var toCsv=require(_0x755d('0xa'));var querystring=require(_0x755d('0x11'));var Papa=require(_0x755d('0x12'));var Redis=require(_0x755d('0x13'));var authService=require(_0x755d('0x14'));var qs=require(_0x755d('0x15'));var as=require(_0x755d('0x16'));var hardwareService=require(_0x755d('0x17'));var logger=require('../../config/logger')(_0x755d('0x18'));var utils=require(_0x755d('0x19'));var config=require(_0x755d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x755d('0x1b'))['db'];var integrations=require(_0x755d('0x1c'));var jayson=require('jayson/promise');var client=jayson[_0x755d('0x1d')][_0x755d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x56f8ad,_0x315da0,_0x204eea,_0x1c74ff){return new BPromise(function(_0x19b9ac,_0x69001){var _0x4ba416=_0x1c74ff||client;return _0x4ba416['request'](_0x56f8ad,_0x204eea)[_0x755d('0x1f')](function(_0x1e982d){logger['info'](_0x755d('0x20'),_0x315da0,_0x755d('0x21'));logger[_0x755d('0x22')](_0x755d('0x23'),_0x315da0,_0x755d('0x21'),JSON[_0x755d('0x24')](_0x1e982d));if(_0x1e982d[_0x755d('0x25')]){if(_0x1e982d[_0x755d('0x25')][_0x755d('0x26')]===0x1f4){logger[_0x755d('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x315da0,_0x1e982d[_0x755d('0x25')]['message']);return _0x69001(_0x1e982d[_0x755d('0x25')][_0x755d('0x27')]);}logger[_0x755d('0x25')](_0x755d('0x20'),_0x315da0,_0x1e982d[_0x755d('0x25')][_0x755d('0x27')]);return _0x19b9ac(_0x1e982d[_0x755d('0x25')][_0x755d('0x27')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x315da0,_0x755d('0x21'));_0x19b9ac(_0x1e982d[_0x755d('0x28')][_0x755d('0x27')]);}})[_0x755d('0x29')](function(_0x15ad68){logger[_0x755d('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x315da0,_0x15ad68);_0x69001(_0x15ad68);});});}function respondWithStatusCode(_0x5724fb,_0x228fb0){_0x228fb0=_0x228fb0||0xcc;return function(_0x49c076){if(_0x49c076){return _0x5724fb['sendStatus'](_0x228fb0);}return _0x5724fb[_0x755d('0x2a')](_0x228fb0)[_0x755d('0x2b')]();};}function respondWithResult(_0x335ffa,_0x4c6c3e){_0x4c6c3e=_0x4c6c3e||0xc8;return function(_0xf6d9d4){if(_0xf6d9d4){return _0x335ffa[_0x755d('0x2a')](_0x4c6c3e)[_0x755d('0x2c')](_0xf6d9d4);}};}function respondWithFilteredResult(_0x404155,_0x119712){return function(_0x11837f){if(_0x11837f){var _0x1d5132=typeof _0x119712[_0x755d('0x2d')]===_0x755d('0x2e')&&typeof _0x119712['limit']===_0x755d('0x2e');var _0x3d92fa=_0x11837f['count'];var _0x157139=_0x1d5132?0x0:_0x119712[_0x755d('0x2d')];var _0x5321ae=_0x1d5132?_0x11837f['count']:_0x119712['offset']+_0x119712[_0x755d('0x2f')];var _0x359c77;if(_0x5321ae>=_0x3d92fa){_0x5321ae=_0x3d92fa;_0x359c77=0xc8;}else{_0x359c77=0xce;}_0x404155[_0x755d('0x2a')](_0x359c77);return _0x404155[_0x755d('0x30')](_0x755d('0x31'),_0x157139+'-'+_0x5321ae+'/'+_0x3d92fa)[_0x755d('0x2c')](_0x11837f);}return null;};}function patchUpdates(_0x3e5b25){return function(_0x58bc02){try{jsonpatch[_0x755d('0x32')](_0x58bc02,_0x3e5b25,!![]);}catch(_0x2aa971){return BPromise[_0x755d('0x33')](_0x2aa971);}return _0x58bc02[_0x755d('0x34')]();};}function saveUpdates(_0x2bc300,_0x5bf99d){return function(_0x42e7e4){if(_0x42e7e4){return _0x42e7e4[_0x755d('0x35')](_0x2bc300)[_0x755d('0x1f')](function(_0x108b23){return _0x108b23;});}return null;};}function removeEntity(_0x285666,_0x189569){return function(_0x294cc9){if(_0x294cc9){return _0x294cc9[_0x755d('0x36')]()['then'](function(){_0x285666[_0x755d('0x2a')](0xcc)[_0x755d('0x2b')]();});}};}function handleEntityNotFound(_0x29a7bd,_0x36938d){return function(_0x3d25d8){if(!_0x3d25d8){_0x29a7bd['sendStatus'](0x194);}return _0x3d25d8;};}function handleError(_0x5ec1dc,_0x43f275){_0x43f275=_0x43f275||0x1f4;return function(_0x287713){logger[_0x755d('0x25')](_0x287713[_0x755d('0x37')]);if(_0x287713[_0x755d('0x38')]){delete _0x287713['name'];}_0x5ec1dc['status'](_0x43f275)[_0x755d('0x39')](_0x287713);};}exports[_0x755d('0x3a')]=function(_0x2302b1,_0x16271d){var _0x112206={},_0x555503={},_0x5d8a4d={'count':0x0,'rows':[]};var _0x14011a=_['map'](db['FreshdeskAccount'][_0x755d('0x3b')],function(_0xb0ab1e){return{'name':_0xb0ab1e[_0x755d('0x3c')],'type':_0xb0ab1e[_0x755d('0x3d')]['key']};});_0x555503[_0x755d('0x3e')]=_[_0x755d('0x3f')](_0x14011a,_0x755d('0x38'));_0x555503['query']=_[_0x755d('0x40')](_0x2302b1['query']);_0x555503[_0x755d('0x41')]=_[_0x755d('0x42')](_0x555503[_0x755d('0x3e')],_0x555503[_0x755d('0x43')]);_0x112206[_0x755d('0x44')]=_[_0x755d('0x42')](_0x555503[_0x755d('0x3e')],qs[_0x755d('0x45')](_0x2302b1[_0x755d('0x43')][_0x755d('0x45')]));_0x112206[_0x755d('0x44')]=_0x112206[_0x755d('0x44')][_0x755d('0x46')]?_0x112206[_0x755d('0x44')]:_0x555503[_0x755d('0x3e')];if(!_0x2302b1['query'][_0x755d('0x47')](_0x755d('0x48'))){_0x112206[_0x755d('0x2f')]=qs[_0x755d('0x2f')](_0x2302b1[_0x755d('0x43')][_0x755d('0x2f')]);_0x112206['offset']=qs[_0x755d('0x2d')](_0x2302b1['query'][_0x755d('0x2d')]);}_0x112206[_0x755d('0x49')]=qs[_0x755d('0x4a')](_0x2302b1[_0x755d('0x43')][_0x755d('0x4a')]);_0x112206[_0x755d('0x4b')]=qs[_0x755d('0x41')](_[_0x755d('0x4c')](_0x2302b1[_0x755d('0x43')],_0x555503['filters']),_0x14011a);if(_0x2302b1['query'][_0x755d('0x4d')]){_0x112206[_0x755d('0x4b')]=_['merge'](_0x112206[_0x755d('0x4b')],{'$or':_[_0x755d('0x3f')](_0x14011a,function(_0x3906dd){if(_0x3906dd[_0x755d('0x3d')]!==_0x755d('0x4e')){var _0x4931ee={};_0x4931ee[_0x3906dd['name']]={'$like':'%'+_0x2302b1['query']['filter']+'%'};return _0x4931ee;}})});}_0x112206=_[_0x755d('0x4f')]({},_0x112206,_0x2302b1['options']);var _0x1ecfff={'where':_0x112206[_0x755d('0x4b')]};return db[_0x755d('0x50')][_0x755d('0x51')](_0x1ecfff)[_0x755d('0x1f')](function(_0x59efea){_0x5d8a4d[_0x755d('0x51')]=_0x59efea;if(_0x2302b1['query']['includeAll']){_0x112206[_0x755d('0x52')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x755d('0x53')](_0x112206);})[_0x755d('0x1f')](function(_0xc88fe0){_0x5d8a4d[_0x755d('0x54')]=_0xc88fe0;return _0x5d8a4d;})[_0x755d('0x1f')](respondWithFilteredResult(_0x16271d,_0x112206))[_0x755d('0x29')](handleError(_0x16271d,null));};exports[_0x755d('0x55')]=function(_0xc515f7,_0x1959b1){var _0x350cb8={'raw':![],'where':{'id':_0xc515f7['params']['id']}},_0x305b16={};_0x305b16[_0x755d('0x3e')]=_[_0x755d('0x40')](db[_0x755d('0x50')][_0x755d('0x3b')]);_0x305b16[_0x755d('0x43')]=_[_0x755d('0x40')](_0xc515f7[_0x755d('0x43')]);_0x305b16['filters']=_[_0x755d('0x42')](_0x305b16['model'],_0x305b16[_0x755d('0x43')]);_0x350cb8['attributes']=_[_0x755d('0x42')](_0x305b16['model'],qs['fields'](_0xc515f7[_0x755d('0x43')]['fields']));_0x350cb8[_0x755d('0x44')]=_0x350cb8[_0x755d('0x44')]['length']?_0x350cb8[_0x755d('0x44')]:_0x305b16[_0x755d('0x3e')];if(_0xc515f7[_0x755d('0x43')][_0x755d('0x56')]){_0x350cb8[_0x755d('0x52')]=[{'all':!![]}];}_0x350cb8=_[_0x755d('0x4f')]({},_0x350cb8,_0xc515f7[_0x755d('0x57')]);return db[_0x755d('0x50')][_0x755d('0x58')](_0x350cb8)['then'](handleEntityNotFound(_0x1959b1,null))[_0x755d('0x1f')](respondWithResult(_0x1959b1,null))[_0x755d('0x29')](handleError(_0x1959b1,null));};exports['create']=function(_0x69c44a,_0x4504fa){return db[_0x755d('0x50')][_0x755d('0x59')](_0x69c44a[_0x755d('0x5a')],{})[_0x755d('0x1f')](respondWithResult(_0x4504fa,0xc9))[_0x755d('0x29')](handleError(_0x4504fa,null));};exports[_0x755d('0x35')]=function(_0x1a487d,_0x49f98a){if(_0x1a487d[_0x755d('0x5a')]['id']){delete _0x1a487d['body']['id'];}return db['FreshdeskAccount'][_0x755d('0x58')]({'where':{'id':_0x1a487d['params']['id']}})['then'](handleEntityNotFound(_0x49f98a,null))[_0x755d('0x1f')](saveUpdates(_0x1a487d[_0x755d('0x5a')],null))[_0x755d('0x1f')](respondWithResult(_0x49f98a,null))[_0x755d('0x29')](handleError(_0x49f98a,null));};exports[_0x755d('0x36')]=function(_0x47d8c8,_0x5bd76e){return db[_0x755d('0x50')][_0x755d('0x58')]({'where':{'id':_0x47d8c8[_0x755d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5bd76e,null))[_0x755d('0x1f')](removeEntity(_0x5bd76e,null))['catch'](handleError(_0x5bd76e,null));};exports[_0x755d('0x5c')]=function(_0x5f3f36,_0x2ed535,_0x2b55e7){var _0x3f5706={};var _0x492a04={};var _0x260bdb;var _0x545c7c;return db[_0x755d('0x50')]['findOne']({'where':{'id':_0x5f3f36[_0x755d('0x5b')]['id']}})[_0x755d('0x1f')](handleEntityNotFound(_0x2ed535,null))['then'](function(_0x5edad5){if(_0x5edad5){_0x260bdb=_0x5edad5;_0x492a04[_0x755d('0x3e')]=_[_0x755d('0x40')](db[_0x755d('0x5d')][_0x755d('0x3b')]);_0x492a04[_0x755d('0x43')]=_[_0x755d('0x40')](_0x5f3f36[_0x755d('0x43')]);_0x492a04['filters']=_[_0x755d('0x42')](_0x492a04[_0x755d('0x3e')],_0x492a04[_0x755d('0x43')]);_0x3f5706['attributes']=_['intersection'](_0x492a04[_0x755d('0x3e')],qs['fields'](_0x5f3f36[_0x755d('0x43')][_0x755d('0x45')]));_0x3f5706[_0x755d('0x44')]=_0x3f5706[_0x755d('0x44')][_0x755d('0x46')]?_0x3f5706[_0x755d('0x44')]:_0x492a04['model'];_0x3f5706[_0x755d('0x49')]=qs[_0x755d('0x4a')](_0x5f3f36[_0x755d('0x43')][_0x755d('0x4a')]);_0x3f5706[_0x755d('0x4b')]=qs[_0x755d('0x41')](_[_0x755d('0x4c')](_0x5f3f36[_0x755d('0x43')],_0x492a04[_0x755d('0x41')]));if(_0x5f3f36[_0x755d('0x43')][_0x755d('0x4d')]){_0x3f5706[_0x755d('0x4b')]=_['merge'](_0x3f5706[_0x755d('0x4b')],{'$or':_['map'](_0x3f5706[_0x755d('0x44')],function(_0x3b1619){var _0x427abf={};_0x427abf[_0x3b1619]={'$like':'%'+_0x5f3f36[_0x755d('0x43')][_0x755d('0x4d')]+'%'};return _0x427abf;})});}_0x3f5706=_[_0x755d('0x4f')]({},_0x3f5706,_0x5f3f36['options']);return _0x260bdb['getConfigurations'](_0x3f5706);}})['then'](function(_0x10ee72){if(_0x10ee72){_0x545c7c=_0x10ee72['length'];if(!_0x5f3f36[_0x755d('0x43')][_0x755d('0x47')]('nolimit')){_0x3f5706[_0x755d('0x2f')]=qs[_0x755d('0x2f')](_0x5f3f36[_0x755d('0x43')]['limit']);_0x3f5706['offset']=qs[_0x755d('0x2d')](_0x5f3f36[_0x755d('0x43')]['offset']);}return _0x260bdb[_0x755d('0x5c')](_0x3f5706);}})[_0x755d('0x1f')](function(_0x4ab156){if(_0x4ab156){return _0x4ab156?{'count':_0x545c7c,'rows':_0x4ab156}:null;}})[_0x755d('0x1f')](respondWithResult(_0x2ed535,null))[_0x755d('0x29')](handleError(_0x2ed535,null));};exports[_0x755d('0x5e')]=function(_0x13ec1b,_0xbcfe9b,_0x15b490){if(_0x13ec1b[_0x755d('0x5a')]['id']){delete _0x13ec1b[_0x755d('0x5a')]['id'];}return db[_0x755d('0x50')][_0x755d('0x5f')]({'where':{'id':_0x13ec1b[_0x755d('0x5b')]['id']}})[_0x755d('0x1f')](handleEntityNotFound(_0xbcfe9b,null))['then'](function(_0xeca893){if(_0xeca893){_0x13ec1b['body'][_0x755d('0x60')]=_0xeca893['id'];_0x13ec1b[_0x755d('0x5a')][_0x755d('0x61')]=integrations[_0x755d('0x62')](_0x13ec1b['body'][_0x755d('0x63')],_0x13ec1b[_0x755d('0x5a')]['type']);_0x13ec1b[_0x755d('0x5a')]['Descriptions']=integrations['getDescriptions'](_0x13ec1b[_0x755d('0x5a')][_0x755d('0x63')],_0x13ec1b[_0x755d('0x5a')][_0x755d('0x3d')]);return db[_0x755d('0x5d')][_0x755d('0x59')](_0x13ec1b[_0x755d('0x5a')],{'include':[{'model':db[_0x755d('0x64')],'as':_0x755d('0x61')},{'model':db[_0x755d('0x64')],'as':_0x755d('0x65')}]});}return null;})[_0x755d('0x1f')](respondWithResult(_0xbcfe9b,null))[_0x755d('0x29')](handleError(_0xbcfe9b,null));};exports[_0x755d('0x66')]=function(_0x35ec23,_0x1f0047,_0x541b9d){var _0x28dad5='';return db[_0x755d('0x50')]['findOne']({'where':{'id':_0x35ec23[_0x755d('0x5b')]['id']},'attributes':['id',_0x755d('0x67'),_0x755d('0x68')]})[_0x755d('0x1f')](handleEntityNotFound(_0x1f0047,null))[_0x755d('0x1f')](function(_0x2ffbbc){if(_0x2ffbbc){_0x28dad5=_0x2ffbbc[_0x755d('0x67')];var _0x1817e8=_0x28dad5[_0x755d('0x69')](-0x1);if(_0x1817e8==='/'){_0x28dad5=_0x28dad5[_0x755d('0x6a')](0x0,_0x28dad5[_0x755d('0x6b')](_0x1817e8));}return rp({'method':'GET','uri':util[_0x755d('0x6c')](_0x755d('0x6d'),_0x28dad5,_0x755d('0x6e')),'headers':{'Authorization':util[_0x755d('0x6c')](_0x755d('0x6f'),new Buffer(util[_0x755d('0x6c')](_0x755d('0x70'),_0x2ffbbc[_0x755d('0x68')]))[_0x755d('0x71')]('base64'))},'json':!![]});}})[_0x755d('0x1f')](function(_0x16c338){if(_0x16c338){var _0x2d0c53=[_0x755d('0x72'),_0x755d('0x73'),_0x755d('0x74'),_0x755d('0x75'),_0x755d('0x2a'),'priority',_0x755d('0x76'),_0x755d('0x77'),_0x755d('0x78'),_0x755d('0x76'),_0x755d('0x79')];_[_0x755d('0x7a')](_0x16c338,function(_0x559940){return _0x2d0c53['includes'](_0x559940[_0x755d('0x38')])||!_0x559940[_0x755d('0x7b')]&&_0x559940[_0x755d('0x3d')]!==_0x755d('0x7c')&&_0x559940[_0x755d('0x3d')]!==_0x755d('0x7d');});return{'count':_0x16c338[_0x755d('0x46')],'rows':_[_0x755d('0x3f')](_0x16c338,function(_0x2cd6cd){return{'id':_0x2cd6cd[_0x755d('0x38')],'name':_0x2cd6cd[_0x755d('0x7e')],'custom':!_0x2cd6cd['default'],'options':_0x2cd6cd[_0x755d('0x7f')]?_['map'](_0x2cd6cd['choices'],function(_0x30c690){return{'name':_[_0x755d('0x80')](_0x30c690),'value':_0x30c690};}):[]};})};}})[_0x755d('0x1f')](respondWithResult(_0x1f0047,null))['catch'](function(_0x49747c){var _0x280845=_0x35ec23[_0x755d('0x43')][_0x755d('0x81')]?0x1f4:_0x49747c['statusCode']||0x1f4;logger[_0x755d('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x280845,JSON[_0x755d('0x24')](_0x49747c));delete _0x49747c[_0x755d('0x38')];if(_0x280845===0x191){_0x280845=0x190;}_0x1f0047[_0x755d('0x2a')](_0x280845)['send'](_0x35ec23['query'][_0x755d('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x49747c[_0x755d('0x82')]}:_0x49747c);});};
\ No newline at end of file
index 0f5de00..3cea8ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc259=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x917047,_0x1fb40e){var _0x88d356=function(_0x372284){while(--_0x372284){_0x917047['push'](_0x917047['shift']());}};_0x88d356(++_0x1fb40e);}(_0xc259,0x16d));var _0x9c25=function(_0x2f7d09,_0x8733fb){_0x2f7d09=_0x2f7d09-0x0;var _0x33d03d=_0xc259[_0x2f7d09];return _0x33d03d;};'use strict';var _=require('lodash');var util=require(_0x9c25('0x0'));var logger=require(_0x9c25('0x1'))(_0x9c25('0x2'));var moment=require(_0x9c25('0x3'));var BPromise=require(_0x9c25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c25('0x5'));var config=require(_0x9c25('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9c25('0x7'));module[_0x9c25('0x8')]=function(_0x208f68,_0x34fa4e){return _0x208f68[_0x9c25('0x9')](_0x9c25('0xa'),attributes,{'tableName':_0x9c25('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69f5=['path','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x450d4d,_0x4a4112){var _0x5317ad=function(_0x4b9ec0){while(--_0x4b9ec0){_0x450d4d['push'](_0x450d4d['shift']());}};_0x5317ad(++_0x4a4112);}(_0x69f5,0x1a7));var _0x569f=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x69f5[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0x569f('0x0'));var util=require(_0x569f('0x1'));var logger=require(_0x569f('0x2'))('api');var moment=require(_0x569f('0x3'));var BPromise=require(_0x569f('0x4'));var rp=require(_0x569f('0x5'));var fs=require('fs');var path=require(_0x569f('0x6'));var rimraf=require('rimraf');var config=require(_0x569f('0x7'));var attributes=require(_0x569f('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x569f('0x9')]=function(_0x26c25c,_0x5d26bb){return _0x26c25c[_0x569f('0xa')](_0x569f('0xb'),attributes,{'tableName':_0x569f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 041eb63..c2f71d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf19=['debug','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowFreshdeskAccount','find','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x347c5c,_0x444af1){var _0x33e604=function(_0x1be95c){while(--_0x1be95c){_0x347c5c['push'](_0x347c5c['shift']());}};_0x33e604(++_0x444af1);}(_0xbf19,0x1a0));var _0x9bf1=function(_0x5d94c6,_0x457829){_0x5d94c6=_0x5d94c6-0x0;var _0x429cd1=_0xbf19[_0x5d94c6];return _0x429cd1;};'use strict';var _=require(_0x9bf1('0x0'));var util=require(_0x9bf1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9bf1('0x2'));var fs=require('fs');var Redis=require(_0x9bf1('0x3'));var db=require(_0x9bf1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9bf1('0x5'))('rpc');var config=require(_0x9bf1('0x6'));var jayson=require(_0x9bf1('0x7'));var client=jayson[_0x9bf1('0x8')][_0x9bf1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x260f11,_0x97431e,_0xeba1a1){return new BPromise(function(_0x149fda,_0x2a96e8){return client[_0x9bf1('0xa')](_0x260f11,_0xeba1a1)[_0x9bf1('0xb')](function(_0x414227){logger['info'](_0x9bf1('0xc'),_0x97431e,'request\x20sent');logger[_0x9bf1('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x97431e,'request\x20sent',JSON[_0x9bf1('0xe')](_0x414227));if(_0x414227[_0x9bf1('0xf')]){if(_0x414227['error'][_0x9bf1('0x10')]===0x1f4){logger[_0x9bf1('0xf')](_0x9bf1('0xc'),_0x97431e,_0x414227['error'][_0x9bf1('0x11')]);return _0x2a96e8(_0x414227['error'][_0x9bf1('0x11')]);}logger[_0x9bf1('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x97431e,_0x414227[_0x9bf1('0xf')][_0x9bf1('0x11')]);return _0x149fda(_0x414227[_0x9bf1('0xf')][_0x9bf1('0x11')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x97431e,'request\x20sent');_0x149fda(_0x414227[_0x9bf1('0x12')][_0x9bf1('0x11')]);}})['catch'](function(_0x3f4b65){logger[_0x9bf1('0xf')](_0x9bf1('0xc'),_0x97431e,_0x3f4b65);_0x2a96e8(_0x3f4b65);});});}exports[_0x9bf1('0x13')]=function(_0x29a32e){var _0x3881a1=this;return new Promise(function(_0x390e67,_0x264cb6){return db[_0x9bf1('0x14')][_0x9bf1('0x15')]({'raw':_0x29a32e[_0x9bf1('0x16')]?_0x29a32e[_0x9bf1('0x16')][_0x9bf1('0x17')]===undefined?!![]:![]:!![],'where':_0x29a32e[_0x9bf1('0x16')]?_0x29a32e[_0x9bf1('0x16')][_0x9bf1('0x18')]||null:null,'attributes':_0x29a32e[_0x9bf1('0x16')]?_0x29a32e[_0x9bf1('0x16')]['attributes']||null:null,'limit':_0x29a32e[_0x9bf1('0x16')]?_0x29a32e[_0x9bf1('0x16')][_0x9bf1('0x19')]||null:null,'include':_0x29a32e[_0x9bf1('0x16')]?_0x29a32e[_0x9bf1('0x16')][_0x9bf1('0x1a')]?_[_0x9bf1('0x1b')](_0x29a32e['options'][_0x9bf1('0x1a')],function(_0x25277e){return{'model':db[_0x25277e['model']],'as':_0x25277e['as'],'attributes':_0x25277e[_0x9bf1('0x1c')],'include':_0x25277e['include']?_[_0x9bf1('0x1b')](_0x25277e[_0x9bf1('0x1a')],function(_0x313be8){return{'model':db[_0x313be8[_0x9bf1('0x1d')]],'as':_0x313be8['as'],'attributes':_0x313be8[_0x9bf1('0x1c')],'include':_0x313be8[_0x9bf1('0x1a')]?_[_0x9bf1('0x1b')](_0x313be8['include'],function(_0x181465){return{'model':db[_0x181465[_0x9bf1('0x1d')]],'as':_0x181465['as'],'attributes':_0x181465[_0x9bf1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9bf1('0xb')](function(_0x13ba45){logger['info']('GetFreshdeskAccount',_0x29a32e);logger[_0x9bf1('0xd')](_0x9bf1('0x13'),_0x29a32e,JSON[_0x9bf1('0xe')](_0x13ba45));_0x390e67(_0x13ba45);})['catch'](function(_0x3326e0){logger[_0x9bf1('0xf')](_0x9bf1('0x13'),_0x3326e0[_0x9bf1('0x11')],_0x29a32e);_0x264cb6(_0x3881a1[_0x9bf1('0xf')](0x1f4,_0x3326e0[_0x9bf1('0x11')]));});});};exports[_0x9bf1('0x1e')]=function(_0x39079b){var _0x3cf7b9=this;return new Promise(function(_0x1e2dbf,_0x3a9cdf){return db['FreshdeskAccount'][_0x9bf1('0x1f')]({'raw':_0x39079b[_0x9bf1('0x16')]?_0x39079b[_0x9bf1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x39079b[_0x9bf1('0x16')]?_0x39079b[_0x9bf1('0x16')][_0x9bf1('0x18')]||null:null,'attributes':_0x39079b[_0x9bf1('0x16')]?_0x39079b[_0x9bf1('0x16')][_0x9bf1('0x1c')]||null:null,'include':_0x39079b[_0x9bf1('0x16')]?_0x39079b[_0x9bf1('0x16')]['include']?_[_0x9bf1('0x1b')](_0x39079b[_0x9bf1('0x16')][_0x9bf1('0x1a')],function(_0x41ae5a){return{'model':db[_0x41ae5a[_0x9bf1('0x1d')]],'as':_0x41ae5a['as'],'attributes':_0x41ae5a['attributes'],'include':_0x41ae5a[_0x9bf1('0x1a')]?_[_0x9bf1('0x1b')](_0x41ae5a['include'],function(_0x4b52e3){return{'model':db[_0x4b52e3[_0x9bf1('0x1d')]],'as':_0x4b52e3['as'],'attributes':_0x4b52e3['attributes'],'include':_0x4b52e3[_0x9bf1('0x1a')]?_[_0x9bf1('0x1b')](_0x4b52e3[_0x9bf1('0x1a')],function(_0x3b33b2){return{'model':db[_0x3b33b2[_0x9bf1('0x1d')]],'as':_0x3b33b2['as'],'attributes':_0x3b33b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x9bf1('0xb')](function(_0x1f9bef){logger['info'](_0x9bf1('0x1e'),_0x39079b);logger['debug']('ShowFreshdeskAccount',_0x39079b,JSON[_0x9bf1('0xe')](_0x1f9bef));_0x1e2dbf(_0x1f9bef);})[_0x9bf1('0x20')](function(_0xc59dd6){logger[_0x9bf1('0xf')]('ShowFreshdeskAccount',_0xc59dd6[_0x9bf1('0x11')],_0x39079b);_0x3a9cdf(_0x3cf7b9['error'](0x1f4,_0xc59dd6[_0x9bf1('0x11')]));});});};
\ No newline at end of file
+var _0xec3d=['FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','FreshdeskAccount,\x20%s,\x20%s','result','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowFreshdeskAccount','FreshdeskAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x5de42e,_0x21f72f){var _0x3b3199=function(_0x18fd86){while(--_0x18fd86){_0x5de42e['push'](_0x5de42e['shift']());}};_0x3b3199(++_0x21f72f);}(_0xec3d,0x1a1));var _0xdec3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdec3('0x0'));var util=require(_0xdec3('0x1'));var moment=require(_0xdec3('0x2'));var BPromise=require(_0xdec3('0x3'));var rs=require(_0xdec3('0x4'));var fs=require('fs');var Redis=require(_0xdec3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdec3('0x6'));var logger=require(_0xdec3('0x7'))('rpc');var config=require(_0xdec3('0x8'));var jayson=require(_0xdec3('0x9'));var client=jayson[_0xdec3('0xa')][_0xdec3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f80e2,_0x195f79,_0x28d7e7){return new BPromise(function(_0x345cf3,_0x199f54){return client[_0xdec3('0xc')](_0x1f80e2,_0x28d7e7)[_0xdec3('0xd')](function(_0x4342aa){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0xdec3('0xe'));logger['debug'](_0xdec3('0xf'),_0x195f79,_0xdec3('0xe'),JSON['stringify'](_0x4342aa));if(_0x4342aa[_0xdec3('0x10')]){if(_0x4342aa['error'][_0xdec3('0x11')]===0x1f4){logger[_0xdec3('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0x4342aa['error'][_0xdec3('0x12')]);return _0x199f54(_0x4342aa[_0xdec3('0x10')][_0xdec3('0x12')]);}logger[_0xdec3('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0x4342aa[_0xdec3('0x10')][_0xdec3('0x12')]);return _0x345cf3(_0x4342aa[_0xdec3('0x10')][_0xdec3('0x12')]);}else{logger[_0xdec3('0x13')](_0xdec3('0x14'),_0x195f79,'request\x20sent');_0x345cf3(_0x4342aa[_0xdec3('0x15')]['message']);}})['catch'](function(_0x2c34da){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x195f79,_0x2c34da);_0x199f54(_0x2c34da);});});}exports[_0xdec3('0x16')]=function(_0x307b1b){var _0x2da1b3=this;return new Promise(function(_0x41e9f9,_0x2ebbdf){return db['FreshdeskAccount'][_0xdec3('0x17')]({'raw':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x19')]===undefined?!![]:![]:!![],'where':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1a')]||null:null,'attributes':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1b')]||null:null,'limit':_0x307b1b[_0xdec3('0x18')]?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1c')]||null:null,'include':_0x307b1b['options']?_0x307b1b[_0xdec3('0x18')][_0xdec3('0x1d')]?_['map'](_0x307b1b['options'][_0xdec3('0x1d')],function(_0x343bde){return{'model':db[_0x343bde[_0xdec3('0x1e')]],'as':_0x343bde['as'],'attributes':_0x343bde[_0xdec3('0x1b')],'include':_0x343bde[_0xdec3('0x1d')]?_['map'](_0x343bde[_0xdec3('0x1d')],function(_0x64aac3){return{'model':db[_0x64aac3[_0xdec3('0x1e')]],'as':_0x64aac3['as'],'attributes':_0x64aac3[_0xdec3('0x1b')],'include':_0x64aac3[_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x64aac3['include'],function(_0x37a0b0){return{'model':db[_0x37a0b0[_0xdec3('0x1e')]],'as':_0x37a0b0['as'],'attributes':_0x37a0b0[_0xdec3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14d1b7){logger[_0xdec3('0x13')](_0xdec3('0x16'),_0x307b1b);logger['debug'](_0xdec3('0x16'),_0x307b1b,JSON['stringify'](_0x14d1b7));_0x41e9f9(_0x14d1b7);})[_0xdec3('0x20')](function(_0x228d9d){logger[_0xdec3('0x10')](_0xdec3('0x16'),_0x228d9d[_0xdec3('0x12')],_0x307b1b);_0x2ebbdf(_0x2da1b3[_0xdec3('0x10')](0x1f4,_0x228d9d[_0xdec3('0x12')]));});});};exports[_0xdec3('0x21')]=function(_0x4f8343){var _0x13f083=this;return new Promise(function(_0x1b30bd,_0x4b550a){return db[_0xdec3('0x22')]['find']({'raw':_0x4f8343['options']?_0x4f8343[_0xdec3('0x18')][_0xdec3('0x19')]===undefined?!![]:![]:!![],'where':_0x4f8343[_0xdec3('0x18')]?_0x4f8343[_0xdec3('0x18')][_0xdec3('0x1a')]||null:null,'attributes':_0x4f8343[_0xdec3('0x18')]?_0x4f8343['options'][_0xdec3('0x1b')]||null:null,'include':_0x4f8343[_0xdec3('0x18')]?_0x4f8343['options'][_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x4f8343[_0xdec3('0x18')][_0xdec3('0x1d')],function(_0x6bd915){return{'model':db[_0x6bd915[_0xdec3('0x1e')]],'as':_0x6bd915['as'],'attributes':_0x6bd915[_0xdec3('0x1b')],'include':_0x6bd915[_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x6bd915[_0xdec3('0x1d')],function(_0x3efd57){return{'model':db[_0x3efd57['model']],'as':_0x3efd57['as'],'attributes':_0x3efd57[_0xdec3('0x1b')],'include':_0x3efd57[_0xdec3('0x1d')]?_[_0xdec3('0x1f')](_0x3efd57[_0xdec3('0x1d')],function(_0x1603c6){return{'model':db[_0x1603c6[_0xdec3('0x1e')]],'as':_0x1603c6['as'],'attributes':_0x1603c6[_0xdec3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdec3('0xd')](function(_0x41eb67){logger[_0xdec3('0x13')](_0xdec3('0x21'),_0x4f8343);logger['debug'](_0xdec3('0x21'),_0x4f8343,JSON[_0xdec3('0x23')](_0x41eb67));_0x1b30bd(_0x41eb67);})[_0xdec3('0x20')](function(_0x196517){logger[_0xdec3('0x10')]('ShowFreshdeskAccount',_0x196517[_0xdec3('0x12')],_0x4f8343);_0x4b550a(_0x13f083[_0xdec3('0x10')](0x1f4,_0x196517[_0xdec3('0x12')]));});});};
\ No newline at end of file
index dc012f4..751d31f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d9d=['isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','/:id'];(function(_0x304fe9,_0x31fd10){var _0x370b53=function(_0x483b48){while(--_0x483b48){_0x304fe9['push'](_0x304fe9['shift']());}};_0x370b53(++_0x31fd10);}(_0x2d9d,0xcf));var _0xd2d9=function(_0x1f2c93,_0x5bfe8a){_0x1f2c93=_0x1f2c93-0x0;var _0x46542c=_0x2d9d[_0x1f2c93];return _0x46542c;};'use strict';var multer=require('multer');var util=require(_0xd2d9('0x0'));var path=require('path');var timeout=require(_0xd2d9('0x1'));var express=require(_0xd2d9('0x2'));var router=express[_0xd2d9('0x3')]();var fs_extra=require(_0xd2d9('0x4'));var auth=require(_0xd2d9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2d9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd2d9('0x7')](_0xd2d9('0x8'),auth[_0xd2d9('0x9')](),controller[_0xd2d9('0xa')]);router[_0xd2d9('0x7')](_0xd2d9('0xb'),auth[_0xd2d9('0x9')](),controller[_0xd2d9('0xc')]);router['get'](_0xd2d9('0xd'),auth[_0xd2d9('0x9')](),controller[_0xd2d9('0xe')]);router[_0xd2d9('0x7')](_0xd2d9('0xf'),auth['isAuthenticated'](),controller[_0xd2d9('0x10')]);router['get'](_0xd2d9('0x11'),auth[_0xd2d9('0x9')](),controller[_0xd2d9('0x12')]);router[_0xd2d9('0x13')]('/',auth[_0xd2d9('0x9')](),controller[_0xd2d9('0x14')]);router['post'](_0xd2d9('0x11'),auth[_0xd2d9('0x9')](),controller['setTags']);router['put'](_0xd2d9('0x8'),auth[_0xd2d9('0x9')](),controller[_0xd2d9('0x15')]);router[_0xd2d9('0x16')](_0xd2d9('0x8'),auth['isAuthenticated'](),controller[_0xd2d9('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x0718=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1e1982,_0x5f5093){var _0x533112=function(_0xafcaa1){while(--_0xafcaa1){_0x1e1982['push'](_0x1e1982['shift']());}};_0x533112(++_0x5f5093);}(_0x0718,0xf5));var _0x8071=function(_0x1db36f,_0x2ecd35){_0x1db36f=_0x1db36f-0x0;var _0x1d0fa9=_0x0718[_0x1db36f];return _0x1d0fa9;};'use strict';var multer=require(_0x8071('0x0'));var util=require(_0x8071('0x1'));var path=require('path');var timeout=require(_0x8071('0x2'));var express=require(_0x8071('0x3'));var router=express[_0x8071('0x4')]();var fs_extra=require(_0x8071('0x5'));var auth=require(_0x8071('0x6'));var interaction=require(_0x8071('0x7'));var config=require(_0x8071('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8071('0x9')]('/',auth[_0x8071('0xa')](),controller[_0x8071('0xb')]);router[_0x8071('0x9')](_0x8071('0xc'),auth[_0x8071('0xa')](),controller[_0x8071('0xd')]);router[_0x8071('0x9')](_0x8071('0xe'),auth[_0x8071('0xa')](),controller[_0x8071('0xf')]);router['get'](_0x8071('0x10'),auth[_0x8071('0xa')](),controller[_0x8071('0x11')]);router['get'](_0x8071('0x12'),auth[_0x8071('0xa')](),controller[_0x8071('0x13')]);router[_0x8071('0x9')](_0x8071('0x14'),auth['isAuthenticated'](),controller[_0x8071('0x15')]);router[_0x8071('0x16')]('/',auth[_0x8071('0xa')](),controller['create']);router[_0x8071('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x8071('0x17')](_0x8071('0xc'),auth[_0x8071('0xa')](),controller[_0x8071('0x18')]);router[_0x8071('0x19')](_0x8071('0xc'),auth['isAuthenticated'](),controller[_0x8071('0x1a')]);module[_0x8071('0x1b')]=router;
\ No newline at end of file
index fcf23e7..e047442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f49=['sequelize','STRING'];(function(_0x309e30,_0x788f3){var _0x2f971f=function(_0x123d72){while(--_0x123d72){_0x309e30['push'](_0x309e30['shift']());}};_0x2f971f(++_0x788f3);}(_0x7f49,0x66));var _0x97f4=function(_0x317224,_0x5a7c66){_0x317224=_0x317224-0x0;var _0x1b5eaf=_0x7f49[_0x317224];return _0x1b5eaf;};'use strict';var Sequelize=require(_0x97f4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x97f4('0x1')]}};
\ No newline at end of file
+var _0x3b01=['exports','STRING'];(function(_0x5de5e7,_0x194091){var _0x3afaec=function(_0xbce5f0){while(--_0xbce5f0){_0x5de5e7['push'](_0x5de5e7['shift']());}};_0x3afaec(++_0x194091);}(_0x3b01,0x1f0));var _0x13b0=function(_0x4ecc45,_0x51fb59){_0x4ecc45=_0x4ecc45-0x0;var _0x3c9671=_0x3b01[_0x4ecc45];return _0x3c9671;};'use strict';var Sequelize=require('sequelize');module[_0x13b0('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x13b0('0x1')]}};
\ No newline at end of file
index 9545b2a..06831cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc4c=['sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','body','find','params','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x210c76,_0x24f0f8){var _0x2b808d=function(_0x569faa){while(--_0x569faa){_0x210c76['push'](_0x210c76['shift']());}};_0x2b808d(++_0x24f0f8);}(_0xfc4c,0x11e));var _0xcfc4=function(_0x474c3e,_0x1a5743){_0x474c3e=_0x474c3e-0x0;var _0x141464=_0xfc4c[_0x474c3e];return _0x141464;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfc4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcfc4('0x1'));var rp=require(_0xcfc4('0x2'));var moment=require(_0xcfc4('0x3'));var BPromise=require(_0xcfc4('0x4'));var Mustache=require(_0xcfc4('0x5'));var util=require(_0xcfc4('0x6'));var path=require(_0xcfc4('0x7'));var sox=require(_0xcfc4('0x8'));var csv=require(_0xcfc4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcfc4('0xa'));var squel=require(_0xcfc4('0xb'));var crypto=require(_0xcfc4('0xc'));var jsforce=require(_0xcfc4('0xd'));var deskjs=require(_0xcfc4('0xe'));var toCsv=require(_0xcfc4('0x9'));var querystring=require(_0xcfc4('0xf'));var Papa=require(_0xcfc4('0x10'));var Redis=require(_0xcfc4('0x11'));var authService=require(_0xcfc4('0x12'));var qs=require(_0xcfc4('0x13'));var as=require(_0xcfc4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfc4('0x15'))(_0xcfc4('0x16'));var utils=require(_0xcfc4('0x17'));var config=require(_0xcfc4('0x18'));var licenseUtil=require(_0xcfc4('0x19'));var db=require(_0xcfc4('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xcfc4('0x1b')][_0xcfc4('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x8fe174,_0x3a014b,_0x2d0999,_0x85a71b){return new BPromise(function(_0x48c3a7,_0x389349){var _0x4734dd=_0x85a71b||client;return _0x4734dd[_0xcfc4('0x1d')](_0x8fe174,_0x2d0999)[_0xcfc4('0x1e')](function(_0x94d52c){logger['info'](_0xcfc4('0x1f'),_0x3a014b,_0xcfc4('0x20'));logger[_0xcfc4('0x21')](_0xcfc4('0x22'),_0x3a014b,_0xcfc4('0x20'),JSON[_0xcfc4('0x23')](_0x94d52c));if(_0x94d52c[_0xcfc4('0x24')]){if(_0x94d52c[_0xcfc4('0x24')][_0xcfc4('0x25')]===0x1f4){logger[_0xcfc4('0x24')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a014b,_0x94d52c['error'][_0xcfc4('0x26')]);return _0x389349(_0x94d52c[_0xcfc4('0x24')][_0xcfc4('0x26')]);}logger['error'](_0xcfc4('0x1f'),_0x3a014b,_0x94d52c[_0xcfc4('0x24')][_0xcfc4('0x26')]);return _0x48c3a7(_0x94d52c[_0xcfc4('0x24')]['message']);}else{logger[_0xcfc4('0x27')](_0xcfc4('0x1f'),_0x3a014b,'request\x20sent');_0x48c3a7(_0x94d52c[_0xcfc4('0x28')][_0xcfc4('0x26')]);}})['catch'](function(_0x313201){logger['error'](_0xcfc4('0x1f'),_0x3a014b,_0x313201);_0x389349(_0x313201);});});}function respondWithStatusCode(_0x3a9474,_0x23c129){_0x23c129=_0x23c129||0xcc;return function(_0x241af1){if(_0x241af1){return _0x3a9474['sendStatus'](_0x23c129);}return _0x3a9474[_0xcfc4('0x29')](_0x23c129)[_0xcfc4('0x2a')]();};}function respondWithResult(_0x382328,_0x73370d){_0x73370d=_0x73370d||0xc8;return function(_0x52d5c4){if(_0x52d5c4){return _0x382328['status'](_0x73370d)[_0xcfc4('0x2b')](_0x52d5c4);}};}function respondWithFilteredResult(_0x3461a7,_0x5ceaa0){return function(_0x58e203){if(_0x58e203){var _0x1e1784=typeof _0x5ceaa0[_0xcfc4('0x2c')]===_0xcfc4('0x2d')&&typeof _0x5ceaa0[_0xcfc4('0x2e')]===_0xcfc4('0x2d');var _0x1506f0=_0x58e203[_0xcfc4('0x2f')];var _0x4862f6=_0x1e1784?0x0:_0x5ceaa0[_0xcfc4('0x2c')];var _0x2f4648=_0x1e1784?_0x58e203[_0xcfc4('0x2f')]:_0x5ceaa0[_0xcfc4('0x2c')]+_0x5ceaa0[_0xcfc4('0x2e')];var _0x4ab901;if(_0x2f4648>=_0x1506f0){_0x2f4648=_0x1506f0;_0x4ab901=0xc8;}else{_0x4ab901=0xce;}_0x3461a7[_0xcfc4('0x29')](_0x4ab901);return _0x3461a7[_0xcfc4('0x30')](_0xcfc4('0x31'),_0x4862f6+'-'+_0x2f4648+'/'+_0x1506f0)['json'](_0x58e203);}return null;};}function patchUpdates(_0x255eeb){return function(_0x26589a){try{jsonpatch['apply'](_0x26589a,_0x255eeb,!![]);}catch(_0xf73400){return BPromise[_0xcfc4('0x32')](_0xf73400);}return _0x26589a[_0xcfc4('0x33')]();};}function saveUpdates(_0x7d49db,_0x10c9e4){return function(_0x4baa9d){if(_0x4baa9d){return _0x4baa9d[_0xcfc4('0x34')](_0x7d49db)[_0xcfc4('0x1e')](function(_0x3e7819){return _0x3e7819;});}return null;};}function removeEntity(_0x4aa58c,_0x61f7b){return function(_0x3a0e2f){if(_0x3a0e2f){return _0x3a0e2f[_0xcfc4('0x35')]()[_0xcfc4('0x1e')](function(){_0x4aa58c[_0xcfc4('0x29')](0xcc)[_0xcfc4('0x2a')]();});}};}function handleEntityNotFound(_0x3ef137,_0x49b0fc){return function(_0x5d03cd){if(!_0x5d03cd){_0x3ef137['sendStatus'](0x194);}return _0x5d03cd;};}function handleError(_0x56d128,_0x5d3ab5){_0x5d3ab5=_0x5d3ab5||0x1f4;return function(_0x3e64a9){logger['error'](_0x3e64a9[_0xcfc4('0x36')]);if(_0x3e64a9[_0xcfc4('0x37')]){delete _0x3e64a9[_0xcfc4('0x37')];}_0x56d128['status'](_0x5d3ab5)['send'](_0x3e64a9);};}exports[_0xcfc4('0x38')]=function(_0x22a0c6,_0x31fa01){var _0x3f31d2={},_0x197d30={},_0x510123={'count':0x0,'rows':[]};var _0x3f5c86=_[_0xcfc4('0x39')](db['FreshdeskConfiguration'][_0xcfc4('0x3a')],function(_0x4a6532){return{'name':_0x4a6532[_0xcfc4('0x3b')],'type':_0x4a6532['type'][_0xcfc4('0x3c')]};});_0x197d30['model']=_[_0xcfc4('0x39')](_0x3f5c86,'name');_0x197d30[_0xcfc4('0x3d')]=_[_0xcfc4('0x3e')](_0x22a0c6[_0xcfc4('0x3d')]);_0x197d30[_0xcfc4('0x3f')]=_[_0xcfc4('0x40')](_0x197d30[_0xcfc4('0x41')],_0x197d30[_0xcfc4('0x3d')]);_0x3f31d2[_0xcfc4('0x42')]=_[_0xcfc4('0x40')](_0x197d30['model'],qs[_0xcfc4('0x43')](_0x22a0c6['query']['fields']));_0x3f31d2[_0xcfc4('0x42')]=_0x3f31d2['attributes'][_0xcfc4('0x44')]?_0x3f31d2[_0xcfc4('0x42')]:_0x197d30['model'];if(!_0x22a0c6['query'][_0xcfc4('0x45')]('nolimit')){_0x3f31d2[_0xcfc4('0x2e')]=qs[_0xcfc4('0x2e')](_0x22a0c6[_0xcfc4('0x3d')][_0xcfc4('0x2e')]);_0x3f31d2['offset']=qs[_0xcfc4('0x2c')](_0x22a0c6[_0xcfc4('0x3d')]['offset']);}_0x3f31d2[_0xcfc4('0x46')]=qs['sort'](_0x22a0c6[_0xcfc4('0x3d')][_0xcfc4('0x47')]);_0x3f31d2[_0xcfc4('0x48')]=qs[_0xcfc4('0x3f')](_[_0xcfc4('0x49')](_0x22a0c6[_0xcfc4('0x3d')],_0x197d30[_0xcfc4('0x3f')]),_0x3f5c86);if(_0x22a0c6[_0xcfc4('0x3d')]['filter']){_0x3f31d2[_0xcfc4('0x48')]=_[_0xcfc4('0x4a')](_0x3f31d2[_0xcfc4('0x48')],{'$or':_[_0xcfc4('0x39')](_0x3f5c86,function(_0x18b0c4){if(_0x18b0c4[_0xcfc4('0x4b')]!==_0xcfc4('0x4c')){var _0xca6616={};_0xca6616[_0x18b0c4[_0xcfc4('0x37')]]={'$like':'%'+_0x22a0c6[_0xcfc4('0x3d')][_0xcfc4('0x4d')]+'%'};return _0xca6616;}})});}_0x3f31d2=_[_0xcfc4('0x4a')]({},_0x3f31d2,_0x22a0c6[_0xcfc4('0x4e')]);var _0x3a4485={'where':_0x3f31d2[_0xcfc4('0x48')]};return db[_0xcfc4('0x4f')][_0xcfc4('0x2f')](_0x3a4485)[_0xcfc4('0x1e')](function(_0xeae3a4){_0x510123['count']=_0xeae3a4;if(_0x22a0c6[_0xcfc4('0x3d')][_0xcfc4('0x50')]){_0x3f31d2[_0xcfc4('0x51')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xcfc4('0x52')](_0x3f31d2);})[_0xcfc4('0x1e')](function(_0x5b37bf){_0x510123[_0xcfc4('0x53')]=_0x5b37bf;return _0x510123;})['then'](respondWithFilteredResult(_0x31fa01,_0x3f31d2))[_0xcfc4('0x54')](handleError(_0x31fa01,null));};exports['show']=function(_0x20d714,_0xbc313b){var _0x362409={'raw':![],'where':{'id':_0x20d714['params']['id']}},_0x2ada20={};_0x2ada20[_0xcfc4('0x41')]=_[_0xcfc4('0x3e')](db[_0xcfc4('0x4f')]['rawAttributes']);_0x2ada20[_0xcfc4('0x3d')]=_[_0xcfc4('0x3e')](_0x20d714['query']);_0x2ada20[_0xcfc4('0x3f')]=_[_0xcfc4('0x40')](_0x2ada20[_0xcfc4('0x41')],_0x2ada20['query']);_0x362409[_0xcfc4('0x42')]=_[_0xcfc4('0x40')](_0x2ada20[_0xcfc4('0x41')],qs[_0xcfc4('0x43')](_0x20d714[_0xcfc4('0x3d')][_0xcfc4('0x43')]));_0x362409[_0xcfc4('0x42')]=_0x362409[_0xcfc4('0x42')]['length']?_0x362409[_0xcfc4('0x42')]:_0x2ada20[_0xcfc4('0x41')];if(_0x20d714[_0xcfc4('0x3d')][_0xcfc4('0x50')]){_0x362409[_0xcfc4('0x51')]=[{'all':!![]}];}_0x362409=_[_0xcfc4('0x4a')]({},_0x362409,_0x20d714['options']);return db['FreshdeskConfiguration']['find'](_0x362409)[_0xcfc4('0x1e')](handleEntityNotFound(_0xbc313b,null))['then'](respondWithResult(_0xbc313b,null))[_0xcfc4('0x54')](handleError(_0xbc313b,null));};exports['create']=function(_0x379e21,_0x39969c){return db['FreshdeskConfiguration']['create'](_0x379e21[_0xcfc4('0x55')],{})[_0xcfc4('0x1e')](respondWithResult(_0x39969c,0xc9))[_0xcfc4('0x54')](handleError(_0x39969c,null));};exports['update']=function(_0x58e4e4,_0xf0fffb){if(_0x58e4e4[_0xcfc4('0x55')]['id']){delete _0x58e4e4['body']['id'];}return db[_0xcfc4('0x4f')][_0xcfc4('0x56')]({'where':{'id':_0x58e4e4[_0xcfc4('0x57')]['id']}})[_0xcfc4('0x1e')](handleEntityNotFound(_0xf0fffb,null))[_0xcfc4('0x1e')](saveUpdates(_0x58e4e4[_0xcfc4('0x55')],null))[_0xcfc4('0x1e')](respondWithResult(_0xf0fffb,null))[_0xcfc4('0x54')](handleError(_0xf0fffb,null));};exports['destroy']=function(_0x12d367,_0x1af25a){return db[_0xcfc4('0x4f')][_0xcfc4('0x56')]({'where':{'id':_0x12d367[_0xcfc4('0x57')]['id']}})[_0xcfc4('0x1e')](handleEntityNotFound(_0x1af25a,null))[_0xcfc4('0x1e')](removeEntity(_0x1af25a,null))[_0xcfc4('0x54')](handleError(_0x1af25a,null));};exports[_0xcfc4('0x58')]=function(_0x1ea3a7,_0x2da551,_0x5229c8){var _0x5ea2de={};var _0x5da9be={};var _0x368e0e;var _0x2d74fa;return db['FreshdeskConfiguration'][_0xcfc4('0x59')]({'where':{'id':_0x1ea3a7['params']['id']}})[_0xcfc4('0x1e')](handleEntityNotFound(_0x2da551,null))[_0xcfc4('0x1e')](function(_0x17a44c){if(_0x17a44c){_0x368e0e=_0x17a44c;_0x5da9be[_0xcfc4('0x41')]=_[_0xcfc4('0x3e')](db[_0xcfc4('0x5a')][_0xcfc4('0x3a')]);_0x5da9be[_0xcfc4('0x3d')]=_['keys'](_0x1ea3a7[_0xcfc4('0x3d')]);_0x5da9be[_0xcfc4('0x3f')]=_[_0xcfc4('0x40')](_0x5da9be[_0xcfc4('0x41')],_0x5da9be[_0xcfc4('0x3d')]);_0x5ea2de['attributes']=_[_0xcfc4('0x40')](_0x5da9be[_0xcfc4('0x41')],qs[_0xcfc4('0x43')](_0x1ea3a7['query'][_0xcfc4('0x43')]));_0x5ea2de['attributes']=_0x5ea2de[_0xcfc4('0x42')][_0xcfc4('0x44')]?_0x5ea2de['attributes']:_0x5da9be[_0xcfc4('0x41')];_0x5ea2de['order']=qs[_0xcfc4('0x47')](_0x1ea3a7[_0xcfc4('0x3d')]['sort']);_0x5ea2de['where']=qs['filters'](_[_0xcfc4('0x49')](_0x1ea3a7[_0xcfc4('0x3d')],_0x5da9be[_0xcfc4('0x3f')]));if(_0x1ea3a7[_0xcfc4('0x3d')][_0xcfc4('0x4d')]){_0x5ea2de['where']=_[_0xcfc4('0x4a')](_0x5ea2de[_0xcfc4('0x48')],{'$or':_[_0xcfc4('0x39')](_0x5ea2de['attributes'],function(_0x5ea5e9){var _0x162c92={};_0x162c92[_0x5ea5e9]={'$like':'%'+_0x1ea3a7['query'][_0xcfc4('0x4d')]+'%'};return _0x162c92;})});}_0x5ea2de=_[_0xcfc4('0x4a')]({},_0x5ea2de,_0x1ea3a7['options']);return _0x368e0e['getFields'](_0x5ea2de);}})[_0xcfc4('0x1e')](function(_0x39cbf8){if(_0x39cbf8){_0x2d74fa=_0x39cbf8[_0xcfc4('0x44')];if(!_0x1ea3a7[_0xcfc4('0x3d')][_0xcfc4('0x45')](_0xcfc4('0x5b'))){_0x5ea2de['limit']=qs[_0xcfc4('0x2e')](_0x1ea3a7[_0xcfc4('0x3d')][_0xcfc4('0x2e')]);_0x5ea2de[_0xcfc4('0x2c')]=qs['offset'](_0x1ea3a7[_0xcfc4('0x3d')][_0xcfc4('0x2c')]);}return _0x368e0e[_0xcfc4('0x58')](_0x5ea2de);}})[_0xcfc4('0x1e')](function(_0xed7ad7){if(_0xed7ad7){return _0xed7ad7?{'count':_0x2d74fa,'rows':_0xed7ad7}:null;}})['then'](respondWithResult(_0x2da551,null))[_0xcfc4('0x54')](handleError(_0x2da551,null));};exports[_0xcfc4('0x5c')]=function(_0x2bff00,_0x208171,_0x512aa4){var _0x225692={};var _0x2093f8={};var _0x41e549;var _0x4a8891;return db[_0xcfc4('0x4f')][_0xcfc4('0x59')]({'where':{'id':_0x2bff00['params']['id']}})[_0xcfc4('0x1e')](handleEntityNotFound(_0x208171,null))[_0xcfc4('0x1e')](function(_0x3c6423){if(_0x3c6423){_0x41e549=_0x3c6423;_0x2093f8[_0xcfc4('0x41')]=_[_0xcfc4('0x3e')](db[_0xcfc4('0x5a')][_0xcfc4('0x3a')]);_0x2093f8[_0xcfc4('0x3d')]=_[_0xcfc4('0x3e')](_0x2bff00[_0xcfc4('0x3d')]);_0x2093f8[_0xcfc4('0x3f')]=_[_0xcfc4('0x40')](_0x2093f8[_0xcfc4('0x41')],_0x2093f8[_0xcfc4('0x3d')]);_0x225692['attributes']=_[_0xcfc4('0x40')](_0x2093f8['model'],qs[_0xcfc4('0x43')](_0x2bff00[_0xcfc4('0x3d')][_0xcfc4('0x43')]));_0x225692[_0xcfc4('0x42')]=_0x225692[_0xcfc4('0x42')][_0xcfc4('0x44')]?_0x225692[_0xcfc4('0x42')]:_0x2093f8['model'];_0x225692[_0xcfc4('0x46')]=qs[_0xcfc4('0x47')](_0x2bff00[_0xcfc4('0x3d')][_0xcfc4('0x47')]);_0x225692[_0xcfc4('0x48')]=qs['filters'](_['pick'](_0x2bff00[_0xcfc4('0x3d')],_0x2093f8['filters']));if(_0x2bff00[_0xcfc4('0x3d')][_0xcfc4('0x4d')]){_0x225692[_0xcfc4('0x48')]=_[_0xcfc4('0x4a')](_0x225692[_0xcfc4('0x48')],{'$or':_['map'](_0x225692['attributes'],function(_0x90fac0){var _0x42b0d7={};_0x42b0d7[_0x90fac0]={'$like':'%'+_0x2bff00[_0xcfc4('0x3d')]['filter']+'%'};return _0x42b0d7;})});}_0x225692=_['merge']({},_0x225692,_0x2bff00[_0xcfc4('0x4e')]);return _0x41e549[_0xcfc4('0x5c')](_0x225692);}})['then'](function(_0xa132e2){if(_0xa132e2){_0x4a8891=_0xa132e2[_0xcfc4('0x44')];if(!_0x2bff00['query'][_0xcfc4('0x45')](_0xcfc4('0x5b'))){_0x225692[_0xcfc4('0x2e')]=qs[_0xcfc4('0x2e')](_0x2bff00[_0xcfc4('0x3d')][_0xcfc4('0x2e')]);_0x225692[_0xcfc4('0x2c')]=qs[_0xcfc4('0x2c')](_0x2bff00[_0xcfc4('0x3d')]['offset']);}return _0x41e549[_0xcfc4('0x5c')](_0x225692);}})['then'](function(_0x2fa139){if(_0x2fa139){return _0x2fa139?{'count':_0x4a8891,'rows':_0x2fa139}:null;}})[_0xcfc4('0x1e')](respondWithResult(_0x208171,null))[_0xcfc4('0x54')](handleError(_0x208171,null));};exports['getDescriptions']=function(_0x28076b,_0x462e4e,_0x25625c){var _0x352961={};var _0xd75ffb={};var _0x5daae5;var _0x477f92;return db[_0xcfc4('0x4f')]['findOne']({'where':{'id':_0x28076b[_0xcfc4('0x57')]['id']}})[_0xcfc4('0x1e')](handleEntityNotFound(_0x462e4e,null))[_0xcfc4('0x1e')](function(_0x48d90e){if(_0x48d90e){_0x5daae5=_0x48d90e;_0xd75ffb['model']=_[_0xcfc4('0x3e')](db[_0xcfc4('0x5a')][_0xcfc4('0x3a')]);_0xd75ffb[_0xcfc4('0x3d')]=_[_0xcfc4('0x3e')](_0x28076b[_0xcfc4('0x3d')]);_0xd75ffb['filters']=_[_0xcfc4('0x40')](_0xd75ffb[_0xcfc4('0x41')],_0xd75ffb[_0xcfc4('0x3d')]);_0x352961['attributes']=_['intersection'](_0xd75ffb[_0xcfc4('0x41')],qs['fields'](_0x28076b[_0xcfc4('0x3d')][_0xcfc4('0x43')]));_0x352961[_0xcfc4('0x42')]=_0x352961[_0xcfc4('0x42')][_0xcfc4('0x44')]?_0x352961[_0xcfc4('0x42')]:_0xd75ffb['model'];_0x352961[_0xcfc4('0x46')]=qs[_0xcfc4('0x47')](_0x28076b[_0xcfc4('0x3d')][_0xcfc4('0x47')]);_0x352961[_0xcfc4('0x48')]=qs[_0xcfc4('0x3f')](_[_0xcfc4('0x49')](_0x28076b[_0xcfc4('0x3d')],_0xd75ffb['filters']));if(_0x28076b['query'][_0xcfc4('0x4d')]){_0x352961[_0xcfc4('0x48')]=_[_0xcfc4('0x4a')](_0x352961[_0xcfc4('0x48')],{'$or':_[_0xcfc4('0x39')](_0x352961[_0xcfc4('0x42')],function(_0xc73c8e){var _0x33c280={};_0x33c280[_0xc73c8e]={'$like':'%'+_0x28076b['query'][_0xcfc4('0x4d')]+'%'};return _0x33c280;})});}_0x352961=_[_0xcfc4('0x4a')]({},_0x352961,_0x28076b['options']);return _0x5daae5[_0xcfc4('0x5d')](_0x352961);}})[_0xcfc4('0x1e')](function(_0x54608c){if(_0x54608c){_0x477f92=_0x54608c[_0xcfc4('0x44')];if(!_0x28076b[_0xcfc4('0x3d')]['hasOwnProperty'](_0xcfc4('0x5b'))){_0x352961[_0xcfc4('0x2e')]=qs[_0xcfc4('0x2e')](_0x28076b[_0xcfc4('0x3d')][_0xcfc4('0x2e')]);_0x352961[_0xcfc4('0x2c')]=qs[_0xcfc4('0x2c')](_0x28076b['query'][_0xcfc4('0x2c')]);}return _0x5daae5[_0xcfc4('0x5d')](_0x352961);}})[_0xcfc4('0x1e')](function(_0x942b0b){if(_0x942b0b){return _0x942b0b?{'count':_0x477f92,'rows':_0x942b0b}:null;}})[_0xcfc4('0x1e')](respondWithResult(_0x462e4e,null))[_0xcfc4('0x54')](handleError(_0x462e4e,null));};exports[_0xcfc4('0x5e')]=function(_0x4531e2,_0x10d4b6,_0x576162){var _0x36a2e={};var _0xf3335a={};var _0x4ff8c0;var _0x2d48e0;return db[_0xcfc4('0x4f')][_0xcfc4('0x59')]({'where':{'id':_0x4531e2[_0xcfc4('0x57')]['id']}})['then'](handleEntityNotFound(_0x10d4b6,null))[_0xcfc4('0x1e')](function(_0x1d6abb){if(_0x1d6abb){_0x4ff8c0=_0x1d6abb;_0xf3335a[_0xcfc4('0x41')]=_[_0xcfc4('0x3e')](db[_0xcfc4('0x5f')][_0xcfc4('0x3a')]);_0xf3335a['query']=_[_0xcfc4('0x3e')](_0x4531e2['query']);_0xf3335a[_0xcfc4('0x3f')]=_[_0xcfc4('0x40')](_0xf3335a['model'],_0xf3335a[_0xcfc4('0x3d')]);_0x36a2e[_0xcfc4('0x42')]=_[_0xcfc4('0x40')](_0xf3335a[_0xcfc4('0x41')],qs['fields'](_0x4531e2[_0xcfc4('0x3d')]['fields']));_0x36a2e[_0xcfc4('0x42')]=_0x36a2e[_0xcfc4('0x42')][_0xcfc4('0x44')]?_0x36a2e[_0xcfc4('0x42')]:_0xf3335a[_0xcfc4('0x41')];_0x36a2e[_0xcfc4('0x46')]=qs['sort'](_0x4531e2[_0xcfc4('0x3d')][_0xcfc4('0x47')]);_0x36a2e[_0xcfc4('0x48')]=qs[_0xcfc4('0x3f')](_['pick'](_0x4531e2[_0xcfc4('0x3d')],_0xf3335a[_0xcfc4('0x3f')]));if(_0x4531e2[_0xcfc4('0x3d')][_0xcfc4('0x4d')]){_0x36a2e[_0xcfc4('0x48')]=_[_0xcfc4('0x4a')](_0x36a2e[_0xcfc4('0x48')],{'$or':_[_0xcfc4('0x39')](_0x36a2e[_0xcfc4('0x42')],function(_0x5c4e7c){var _0x6a49fc={};_0x6a49fc[_0x5c4e7c]={'$like':'%'+_0x4531e2[_0xcfc4('0x3d')][_0xcfc4('0x4d')]+'%'};return _0x6a49fc;})});}_0x36a2e=_[_0xcfc4('0x4a')]({},_0x36a2e,_0x4531e2['options']);return _0x4ff8c0['getTags'](_0x36a2e);}})[_0xcfc4('0x1e')](function(_0x14a606){if(_0x14a606){_0x2d48e0=_0x14a606[_0xcfc4('0x44')];if(!_0x4531e2[_0xcfc4('0x3d')][_0xcfc4('0x45')](_0xcfc4('0x5b'))){_0x36a2e['limit']=qs[_0xcfc4('0x2e')](_0x4531e2['query'][_0xcfc4('0x2e')]);_0x36a2e[_0xcfc4('0x2c')]=qs[_0xcfc4('0x2c')](_0x4531e2['query']['offset']);}return _0x4ff8c0['getTags'](_0x36a2e);}})[_0xcfc4('0x1e')](function(_0x1ab294){if(_0x1ab294){return _0x1ab294?{'count':_0x2d48e0,'rows':_0x1ab294}:null;}})['then'](respondWithResult(_0x10d4b6,null))[_0xcfc4('0x54')](handleError(_0x10d4b6,null));};exports[_0xcfc4('0x60')]=function(_0x1d7067,_0xd0f700,_0x3cea58){if(_0x1d7067['body']['id']){delete _0x1d7067[_0xcfc4('0x55')]['id'];}return db[_0xcfc4('0x4f')][_0xcfc4('0x59')]({'where':{'id':_0x1d7067[_0xcfc4('0x57')]['id']}})[_0xcfc4('0x1e')](handleEntityNotFound(_0xd0f700,null))[_0xcfc4('0x1e')](function(_0x1d97d1){if(_0x1d97d1){return _0x1d97d1[_0xcfc4('0x60')](_0x1d7067['body'][_0xcfc4('0x61')]||[]);}return null;})[_0xcfc4('0x1e')](respondWithResult(_0xd0f700,null))['catch'](handleError(_0xd0f700,null));};
\ No newline at end of file
+var _0x00ef=['fields','length','nolimit','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','FreshdeskField','sort','hasOwnProperty','getSubjects','getDescriptions','order','pick','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','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','../../config/utils','../../config/environment','../../config/license/util','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x4566db,_0x5da9a1){var _0x3167e6=function(_0x154ed8){while(--_0x154ed8){_0x4566db['push'](_0x4566db['shift']());}};_0x3167e6(++_0x5da9a1);}(_0x00ef,0x19d));var _0xf00e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x00ef[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf00e('0x0'));var rimraf=require(_0xf00e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf00e('0x2'));var moment=require(_0xf00e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf00e('0x4'));var util=require(_0xf00e('0x5'));var path=require(_0xf00e('0x6'));var sox=require(_0xf00e('0x7'));var csv=require('to-csv');var ejs=require(_0xf00e('0x8'));var fs=require('fs');var fs_extra=require(_0xf00e('0x9'));var _=require(_0xf00e('0xa'));var squel=require(_0xf00e('0xb'));var crypto=require(_0xf00e('0xc'));var jsforce=require(_0xf00e('0xd'));var deskjs=require(_0xf00e('0xe'));var toCsv=require(_0xf00e('0xf'));var querystring=require(_0xf00e('0x10'));var Papa=require(_0xf00e('0x11'));var Redis=require(_0xf00e('0x12'));var authService=require(_0xf00e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf00e('0x14'));var hardwareService=require(_0xf00e('0x15'));var logger=require(_0xf00e('0x16'))('api');var utils=require(_0xf00e('0x17'));var config=require(_0xf00e('0x18'));var licenseUtil=require(_0xf00e('0x19'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf00e('0x1a')][_0xf00e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x23255d,_0x376c72,_0x5df05c,_0x1116de){return new BPromise(function(_0x1b78c4,_0x21ee37){var _0x1fe93f=_0x1116de||client;return _0x1fe93f['request'](_0x23255d,_0x5df05c)[_0xf00e('0x1c')](function(_0x1cfb37){logger[_0xf00e('0x1d')](_0xf00e('0x1e'),_0x376c72,_0xf00e('0x1f'));logger['debug'](_0xf00e('0x20'),_0x376c72,_0xf00e('0x1f'),JSON[_0xf00e('0x21')](_0x1cfb37));if(_0x1cfb37[_0xf00e('0x22')]){if(_0x1cfb37['error'][_0xf00e('0x23')]===0x1f4){logger['error'](_0xf00e('0x1e'),_0x376c72,_0x1cfb37[_0xf00e('0x22')][_0xf00e('0x24')]);return _0x21ee37(_0x1cfb37[_0xf00e('0x22')][_0xf00e('0x24')]);}logger[_0xf00e('0x22')](_0xf00e('0x1e'),_0x376c72,_0x1cfb37[_0xf00e('0x22')][_0xf00e('0x24')]);return _0x1b78c4(_0x1cfb37[_0xf00e('0x22')]['message']);}else{logger[_0xf00e('0x1d')](_0xf00e('0x1e'),_0x376c72,_0xf00e('0x1f'));_0x1b78c4(_0x1cfb37[_0xf00e('0x25')]['message']);}})[_0xf00e('0x26')](function(_0xc9cf2a){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x376c72,_0xc9cf2a);_0x21ee37(_0xc9cf2a);});});}function respondWithStatusCode(_0x20be86,_0x45baa3){_0x45baa3=_0x45baa3||0xcc;return function(_0xe52ad5){if(_0xe52ad5){return _0x20be86[_0xf00e('0x27')](_0x45baa3);}return _0x20be86['status'](_0x45baa3)[_0xf00e('0x28')]();};}function respondWithResult(_0x5775c0,_0x66edf7){_0x66edf7=_0x66edf7||0xc8;return function(_0x6fd553){if(_0x6fd553){return _0x5775c0[_0xf00e('0x29')](_0x66edf7)[_0xf00e('0x2a')](_0x6fd553);}};}function respondWithFilteredResult(_0x16adb9,_0x561553){return function(_0x28022a){if(_0x28022a){var _0x57c401=typeof _0x561553['offset']==='undefined'&&typeof _0x561553[_0xf00e('0x2b')]===_0xf00e('0x2c');var _0x164a61=_0x28022a[_0xf00e('0x2d')];var _0x563187=_0x57c401?0x0:_0x561553['offset'];var _0x13e519=_0x57c401?_0x28022a['count']:_0x561553[_0xf00e('0x2e')]+_0x561553[_0xf00e('0x2b')];var _0x27f3a6;if(_0x13e519>=_0x164a61){_0x13e519=_0x164a61;_0x27f3a6=0xc8;}else{_0x27f3a6=0xce;}_0x16adb9[_0xf00e('0x29')](_0x27f3a6);return _0x16adb9[_0xf00e('0x2f')](_0xf00e('0x30'),_0x563187+'-'+_0x13e519+'/'+_0x164a61)[_0xf00e('0x2a')](_0x28022a);}return null;};}function patchUpdates(_0xe9066){return function(_0xdf469d){try{jsonpatch[_0xf00e('0x31')](_0xdf469d,_0xe9066,!![]);}catch(_0x5a5145){return BPromise['reject'](_0x5a5145);}return _0xdf469d[_0xf00e('0x32')]();};}function saveUpdates(_0x1f6f3f,_0x436005){return function(_0x26aedd){if(_0x26aedd){return _0x26aedd[_0xf00e('0x33')](_0x1f6f3f)[_0xf00e('0x1c')](function(_0x3370d4){return _0x3370d4;});}return null;};}function removeEntity(_0x586b23,_0x216356){return function(_0x53ad45){if(_0x53ad45){return _0x53ad45[_0xf00e('0x34')]()[_0xf00e('0x1c')](function(){_0x586b23[_0xf00e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a2e6a,_0x18a6a9){return function(_0x11617d){if(!_0x11617d){_0x9a2e6a[_0xf00e('0x27')](0x194);}return _0x11617d;};}function handleError(_0x2103a2,_0x274ee1){_0x274ee1=_0x274ee1||0x1f4;return function(_0x106ce5){logger[_0xf00e('0x22')](_0x106ce5[_0xf00e('0x35')]);if(_0x106ce5[_0xf00e('0x36')]){delete _0x106ce5[_0xf00e('0x36')];}_0x2103a2[_0xf00e('0x29')](_0x274ee1)['send'](_0x106ce5);};}exports['index']=function(_0x3eea4c,_0x581773){var _0x44822c={},_0x43d866={},_0x525a6e={'count':0x0,'rows':[]};var _0x327cff=_['map'](db[_0xf00e('0x37')][_0xf00e('0x38')],function(_0x303d4e){return{'name':_0x303d4e[_0xf00e('0x39')],'type':_0x303d4e[_0xf00e('0x3a')][_0xf00e('0x3b')]};});_0x43d866[_0xf00e('0x3c')]=_[_0xf00e('0x3d')](_0x327cff,_0xf00e('0x36'));_0x43d866[_0xf00e('0x3e')]=_[_0xf00e('0x3f')](_0x3eea4c[_0xf00e('0x3e')]);_0x43d866[_0xf00e('0x40')]=_[_0xf00e('0x41')](_0x43d866[_0xf00e('0x3c')],_0x43d866[_0xf00e('0x3e')]);_0x44822c[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x43d866['model'],qs[_0xf00e('0x43')](_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x44822c[_0xf00e('0x42')]=_0x44822c[_0xf00e('0x42')][_0xf00e('0x44')]?_0x44822c[_0xf00e('0x42')]:_0x43d866[_0xf00e('0x3c')];if(!_0x3eea4c[_0xf00e('0x3e')]['hasOwnProperty'](_0xf00e('0x45'))){_0x44822c[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x2b')]);_0x44822c[_0xf00e('0x2e')]=qs[_0xf00e('0x2e')](_0x3eea4c[_0xf00e('0x3e')]['offset']);}_0x44822c['order']=qs['sort'](_0x3eea4c[_0xf00e('0x3e')]['sort']);_0x44822c[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_['pick'](_0x3eea4c[_0xf00e('0x3e')],_0x43d866['filters']),_0x327cff);if(_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x47')]){_0x44822c[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x44822c[_0xf00e('0x46')],{'$or':_['map'](_0x327cff,function(_0x184887){if(_0x184887['type']!==_0xf00e('0x49')){var _0x5bad9c={};_0x5bad9c[_0x184887[_0xf00e('0x36')]]={'$like':'%'+_0x3eea4c[_0xf00e('0x3e')]['filter']+'%'};return _0x5bad9c;}})});}_0x44822c=_['merge']({},_0x44822c,_0x3eea4c[_0xf00e('0x4a')]);var _0x1cdcc2={'where':_0x44822c[_0xf00e('0x46')]};return db[_0xf00e('0x37')][_0xf00e('0x2d')](_0x1cdcc2)[_0xf00e('0x1c')](function(_0xacbdaf){_0x525a6e[_0xf00e('0x2d')]=_0xacbdaf;if(_0x3eea4c[_0xf00e('0x3e')][_0xf00e('0x4b')]){_0x44822c['include']=[{'all':!![]}];}return db[_0xf00e('0x37')][_0xf00e('0x4c')](_0x44822c);})[_0xf00e('0x1c')](function(_0x2e1bcf){_0x525a6e[_0xf00e('0x4d')]=_0x2e1bcf;return _0x525a6e;})[_0xf00e('0x1c')](respondWithFilteredResult(_0x581773,_0x44822c))[_0xf00e('0x26')](handleError(_0x581773,null));};exports[_0xf00e('0x4e')]=function(_0x158d24,_0x4a4011){var _0x1534a8={'raw':![],'where':{'id':_0x158d24[_0xf00e('0x4f')]['id']}},_0x47eefd={};_0x47eefd[_0xf00e('0x3c')]=_[_0xf00e('0x3f')](db[_0xf00e('0x37')][_0xf00e('0x38')]);_0x47eefd[_0xf00e('0x3e')]=_[_0xf00e('0x3f')](_0x158d24[_0xf00e('0x3e')]);_0x47eefd['filters']=_[_0xf00e('0x41')](_0x47eefd[_0xf00e('0x3c')],_0x47eefd[_0xf00e('0x3e')]);_0x1534a8['attributes']=_[_0xf00e('0x41')](_0x47eefd[_0xf00e('0x3c')],qs[_0xf00e('0x43')](_0x158d24[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x1534a8[_0xf00e('0x42')]=_0x1534a8[_0xf00e('0x42')][_0xf00e('0x44')]?_0x1534a8[_0xf00e('0x42')]:_0x47eefd[_0xf00e('0x3c')];if(_0x158d24['query'][_0xf00e('0x4b')]){_0x1534a8['include']=[{'all':!![]}];}_0x1534a8=_['merge']({},_0x1534a8,_0x158d24['options']);return db[_0xf00e('0x37')][_0xf00e('0x50')](_0x1534a8)['then'](handleEntityNotFound(_0x4a4011,null))[_0xf00e('0x1c')](respondWithResult(_0x4a4011,null))[_0xf00e('0x26')](handleError(_0x4a4011,null));};exports[_0xf00e('0x51')]=function(_0x291d3d,_0x4ef7a4){return db[_0xf00e('0x37')][_0xf00e('0x51')](_0x291d3d['body'],{})[_0xf00e('0x1c')](respondWithResult(_0x4ef7a4,0xc9))['catch'](handleError(_0x4ef7a4,null));};exports[_0xf00e('0x33')]=function(_0x31ac51,_0x68715e){if(_0x31ac51['body']['id']){delete _0x31ac51[_0xf00e('0x52')]['id'];}return db[_0xf00e('0x37')][_0xf00e('0x50')]({'where':{'id':_0x31ac51[_0xf00e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x68715e,null))[_0xf00e('0x1c')](saveUpdates(_0x31ac51[_0xf00e('0x52')],null))[_0xf00e('0x1c')](respondWithResult(_0x68715e,null))[_0xf00e('0x26')](handleError(_0x68715e,null));};exports[_0xf00e('0x34')]=function(_0x5b8e05,_0x47fb0a){return db[_0xf00e('0x37')][_0xf00e('0x50')]({'where':{'id':_0x5b8e05[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x47fb0a,null))['then'](removeEntity(_0x47fb0a,null))['catch'](handleError(_0x47fb0a,null));};exports[_0xf00e('0x53')]=function(_0x293f98,_0x42e877,_0x26d970){var _0x3c9ca8={};var _0x392cf4={};var _0x21c0ab;var _0x43f77b;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x293f98[_0xf00e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x42e877,null))[_0xf00e('0x1c')](function(_0x2a120a){if(_0x2a120a){_0x21c0ab=_0x2a120a;_0x392cf4[_0xf00e('0x3c')]=_['keys'](db[_0xf00e('0x55')][_0xf00e('0x38')]);_0x392cf4[_0xf00e('0x3e')]=_['keys'](_0x293f98[_0xf00e('0x3e')]);_0x392cf4[_0xf00e('0x40')]=_[_0xf00e('0x41')](_0x392cf4['model'],_0x392cf4[_0xf00e('0x3e')]);_0x3c9ca8[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x392cf4[_0xf00e('0x3c')],qs[_0xf00e('0x43')](_0x293f98['query'][_0xf00e('0x43')]));_0x3c9ca8[_0xf00e('0x42')]=_0x3c9ca8[_0xf00e('0x42')][_0xf00e('0x44')]?_0x3c9ca8[_0xf00e('0x42')]:_0x392cf4[_0xf00e('0x3c')];_0x3c9ca8['order']=qs[_0xf00e('0x56')](_0x293f98[_0xf00e('0x3e')][_0xf00e('0x56')]);_0x3c9ca8[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_['pick'](_0x293f98[_0xf00e('0x3e')],_0x392cf4[_0xf00e('0x40')]));if(_0x293f98['query'][_0xf00e('0x47')]){_0x3c9ca8[_0xf00e('0x46')]=_['merge'](_0x3c9ca8[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x3c9ca8[_0xf00e('0x42')],function(_0x5dbd83){var _0x4d0e5c={};_0x4d0e5c[_0x5dbd83]={'$like':'%'+_0x293f98[_0xf00e('0x3e')][_0xf00e('0x47')]+'%'};return _0x4d0e5c;})});}_0x3c9ca8=_[_0xf00e('0x48')]({},_0x3c9ca8,_0x293f98[_0xf00e('0x4a')]);return _0x21c0ab[_0xf00e('0x53')](_0x3c9ca8);}})[_0xf00e('0x1c')](function(_0x2f4249){if(_0x2f4249){_0x43f77b=_0x2f4249['length'];if(!_0x293f98[_0xf00e('0x3e')][_0xf00e('0x57')](_0xf00e('0x45'))){_0x3c9ca8[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x293f98['query'][_0xf00e('0x2b')]);_0x3c9ca8[_0xf00e('0x2e')]=qs[_0xf00e('0x2e')](_0x293f98[_0xf00e('0x3e')][_0xf00e('0x2e')]);}return _0x21c0ab[_0xf00e('0x53')](_0x3c9ca8);}})['then'](function(_0x1429e2){if(_0x1429e2){return _0x1429e2?{'count':_0x43f77b,'rows':_0x1429e2}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x42e877,null))['catch'](handleError(_0x42e877,null));};exports[_0xf00e('0x58')]=function(_0x54c642,_0x2f1fee,_0x569f61){var _0x26ffb8={};var _0x6c143c={};var _0x13c7f2;var _0x3b0e84;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x54c642[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x2f1fee,null))[_0xf00e('0x1c')](function(_0xaff8f1){if(_0xaff8f1){_0x13c7f2=_0xaff8f1;_0x6c143c[_0xf00e('0x3c')]=_[_0xf00e('0x3f')](db['FreshdeskField'][_0xf00e('0x38')]);_0x6c143c[_0xf00e('0x3e')]=_[_0xf00e('0x3f')](_0x54c642[_0xf00e('0x3e')]);_0x6c143c['filters']=_[_0xf00e('0x41')](_0x6c143c[_0xf00e('0x3c')],_0x6c143c['query']);_0x26ffb8[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x6c143c['model'],qs['fields'](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x26ffb8[_0xf00e('0x42')]=_0x26ffb8['attributes'][_0xf00e('0x44')]?_0x26ffb8[_0xf00e('0x42')]:_0x6c143c['model'];_0x26ffb8['order']=qs[_0xf00e('0x56')](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x56')]);_0x26ffb8[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_['pick'](_0x54c642[_0xf00e('0x3e')],_0x6c143c[_0xf00e('0x40')]));if(_0x54c642['query']['filter']){_0x26ffb8[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x26ffb8[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x26ffb8[_0xf00e('0x42')],function(_0x1a0eb1){var _0x2a76b0={};_0x2a76b0[_0x1a0eb1]={'$like':'%'+_0x54c642[_0xf00e('0x3e')][_0xf00e('0x47')]+'%'};return _0x2a76b0;})});}_0x26ffb8=_['merge']({},_0x26ffb8,_0x54c642[_0xf00e('0x4a')]);return _0x13c7f2['getSubjects'](_0x26ffb8);}})[_0xf00e('0x1c')](function(_0x4c792d){if(_0x4c792d){_0x3b0e84=_0x4c792d[_0xf00e('0x44')];if(!_0x54c642[_0xf00e('0x3e')][_0xf00e('0x57')](_0xf00e('0x45'))){_0x26ffb8[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x2b')]);_0x26ffb8['offset']=qs[_0xf00e('0x2e')](_0x54c642[_0xf00e('0x3e')][_0xf00e('0x2e')]);}return _0x13c7f2['getSubjects'](_0x26ffb8);}})[_0xf00e('0x1c')](function(_0x3f33d9){if(_0x3f33d9){return _0x3f33d9?{'count':_0x3b0e84,'rows':_0x3f33d9}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x2f1fee,null))[_0xf00e('0x26')](handleError(_0x2f1fee,null));};exports[_0xf00e('0x59')]=function(_0x2d1fa6,_0x40be85,_0x48ba3b){var _0x49d71a={};var _0x28c1fa={};var _0x5e3c0e;var _0x35dbed;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x2d1fa6[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x40be85,null))['then'](function(_0x49993b){if(_0x49993b){_0x5e3c0e=_0x49993b;_0x28c1fa[_0xf00e('0x3c')]=_['keys'](db['FreshdeskField'][_0xf00e('0x38')]);_0x28c1fa[_0xf00e('0x3e')]=_['keys'](_0x2d1fa6[_0xf00e('0x3e')]);_0x28c1fa['filters']=_[_0xf00e('0x41')](_0x28c1fa[_0xf00e('0x3c')],_0x28c1fa[_0xf00e('0x3e')]);_0x49d71a['attributes']=_[_0xf00e('0x41')](_0x28c1fa['model'],qs[_0xf00e('0x43')](_0x2d1fa6[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x49d71a[_0xf00e('0x42')]=_0x49d71a[_0xf00e('0x42')][_0xf00e('0x44')]?_0x49d71a['attributes']:_0x28c1fa[_0xf00e('0x3c')];_0x49d71a[_0xf00e('0x5a')]=qs[_0xf00e('0x56')](_0x2d1fa6['query'][_0xf00e('0x56')]);_0x49d71a[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_[_0xf00e('0x5b')](_0x2d1fa6[_0xf00e('0x3e')],_0x28c1fa[_0xf00e('0x40')]));if(_0x2d1fa6['query'][_0xf00e('0x47')]){_0x49d71a[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x49d71a[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x49d71a['attributes'],function(_0x59bea5){var _0x2760d8={};_0x2760d8[_0x59bea5]={'$like':'%'+_0x2d1fa6[_0xf00e('0x3e')]['filter']+'%'};return _0x2760d8;})});}_0x49d71a=_['merge']({},_0x49d71a,_0x2d1fa6[_0xf00e('0x4a')]);return _0x5e3c0e[_0xf00e('0x59')](_0x49d71a);}})[_0xf00e('0x1c')](function(_0x3334b7){if(_0x3334b7){_0x35dbed=_0x3334b7[_0xf00e('0x44')];if(!_0x2d1fa6[_0xf00e('0x3e')][_0xf00e('0x57')]('nolimit')){_0x49d71a[_0xf00e('0x2b')]=qs[_0xf00e('0x2b')](_0x2d1fa6['query']['limit']);_0x49d71a[_0xf00e('0x2e')]=qs['offset'](_0x2d1fa6[_0xf00e('0x3e')][_0xf00e('0x2e')]);}return _0x5e3c0e[_0xf00e('0x59')](_0x49d71a);}})['then'](function(_0x195bec){if(_0x195bec){return _0x195bec?{'count':_0x35dbed,'rows':_0x195bec}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x40be85,null))[_0xf00e('0x26')](handleError(_0x40be85,null));};exports[_0xf00e('0x5c')]=function(_0x31a53b,_0x2659a2,_0x1fcba2){var _0x361904={};var _0x2c30f1={};var _0x187b3d;var _0x47110b;return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x31a53b['params']['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x2659a2,null))[_0xf00e('0x1c')](function(_0x5b47c1){if(_0x5b47c1){_0x187b3d=_0x5b47c1;_0x2c30f1[_0xf00e('0x3c')]=_[_0xf00e('0x3f')](db[_0xf00e('0x5d')][_0xf00e('0x38')]);_0x2c30f1['query']=_[_0xf00e('0x3f')](_0x31a53b['query']);_0x2c30f1[_0xf00e('0x40')]=_[_0xf00e('0x41')](_0x2c30f1['model'],_0x2c30f1[_0xf00e('0x3e')]);_0x361904[_0xf00e('0x42')]=_[_0xf00e('0x41')](_0x2c30f1['model'],qs[_0xf00e('0x43')](_0x31a53b[_0xf00e('0x3e')][_0xf00e('0x43')]));_0x361904[_0xf00e('0x42')]=_0x361904[_0xf00e('0x42')][_0xf00e('0x44')]?_0x361904['attributes']:_0x2c30f1[_0xf00e('0x3c')];_0x361904[_0xf00e('0x5a')]=qs[_0xf00e('0x56')](_0x31a53b[_0xf00e('0x3e')][_0xf00e('0x56')]);_0x361904[_0xf00e('0x46')]=qs[_0xf00e('0x40')](_[_0xf00e('0x5b')](_0x31a53b['query'],_0x2c30f1[_0xf00e('0x40')]));if(_0x31a53b[_0xf00e('0x3e')][_0xf00e('0x47')]){_0x361904[_0xf00e('0x46')]=_[_0xf00e('0x48')](_0x361904[_0xf00e('0x46')],{'$or':_[_0xf00e('0x3d')](_0x361904[_0xf00e('0x42')],function(_0x333cc2){var _0x5f22ac={};_0x5f22ac[_0x333cc2]={'$like':'%'+_0x31a53b[_0xf00e('0x3e')]['filter']+'%'};return _0x5f22ac;})});}_0x361904=_[_0xf00e('0x48')]({},_0x361904,_0x31a53b['options']);return _0x187b3d[_0xf00e('0x5c')](_0x361904);}})[_0xf00e('0x1c')](function(_0x124963){if(_0x124963){_0x47110b=_0x124963[_0xf00e('0x44')];if(!_0x31a53b['query']['hasOwnProperty'](_0xf00e('0x45'))){_0x361904[_0xf00e('0x2b')]=qs['limit'](_0x31a53b['query'][_0xf00e('0x2b')]);_0x361904[_0xf00e('0x2e')]=qs[_0xf00e('0x2e')](_0x31a53b[_0xf00e('0x3e')]['offset']);}return _0x187b3d['getTags'](_0x361904);}})[_0xf00e('0x1c')](function(_0xb6f3c1){if(_0xb6f3c1){return _0xb6f3c1?{'count':_0x47110b,'rows':_0xb6f3c1}:null;}})[_0xf00e('0x1c')](respondWithResult(_0x2659a2,null))[_0xf00e('0x26')](handleError(_0x2659a2,null));};exports[_0xf00e('0x5e')]=function(_0x15affa,_0x48f661,_0x160644){if(_0x15affa[_0xf00e('0x52')]['id']){delete _0x15affa[_0xf00e('0x52')]['id'];}return db[_0xf00e('0x37')][_0xf00e('0x54')]({'where':{'id':_0x15affa[_0xf00e('0x4f')]['id']}})[_0xf00e('0x1c')](handleEntityNotFound(_0x48f661,null))[_0xf00e('0x1c')](function(_0x573f03){if(_0x573f03){return _0x573f03['setTags'](_0x15affa[_0xf00e('0x52')][_0xf00e('0x5f')]||[]);}return null;})[_0xf00e('0x1c')](respondWithResult(_0x48f661,null))['catch'](handleError(_0x48f661,null));};
\ No newline at end of file
index 61b6bc4..33d6b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a3c=['int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x320f22,_0x488293){var _0x281311=function(_0x5088e9){while(--_0x5088e9){_0x320f22['push'](_0x320f22['shift']());}};_0x281311(++_0x488293);}(_0x1a3c,0xa9));var _0xc1a3=function(_0x5e9576,_0x2a128a){_0x5e9576=_0x5e9576-0x0;var _0x5f43ae=_0x1a3c[_0x5e9576];return _0x5f43ae;};'use strict';var _=require(_0xc1a3('0x0'));var util=require(_0xc1a3('0x1'));var logger=require(_0xc1a3('0x2'))(_0xc1a3('0x3'));var moment=require(_0xc1a3('0x4'));var BPromise=require(_0xc1a3('0x5'));var rp=require(_0xc1a3('0x6'));var fs=require('fs');var path=require(_0xc1a3('0x7'));var rimraf=require(_0xc1a3('0x8'));var config=require('../../config/environment');var attributes=require(_0xc1a3('0x9'));module[_0xc1a3('0xa')]=function(_0x521f54,_0x14e87c){return _0x521f54[_0xc1a3('0xb')](_0xc1a3('0xc'),attributes,{'tableName':_0xc1a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd76=['path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x334524,_0x1fca82){var _0x870ae9=function(_0x422546){while(--_0x422546){_0x334524['push'](_0x334524['shift']());}};_0x870ae9(++_0x1fca82);}(_0xfd76,0x1cf));var _0x6fd7=function(_0x54375f,_0x17956c){_0x54375f=_0x54375f-0x0;var _0x1de28e=_0xfd76[_0x54375f];return _0x1de28e;};'use strict';var _=require(_0x6fd7('0x0'));var util=require('util');var logger=require(_0x6fd7('0x1'))('api');var moment=require(_0x6fd7('0x2'));var BPromise=require(_0x6fd7('0x3'));var rp=require(_0x6fd7('0x4'));var fs=require('fs');var path=require(_0x6fd7('0x5'));var rimraf=require(_0x6fd7('0x6'));var config=require(_0x6fd7('0x7'));var attributes=require(_0x6fd7('0x8'));module['exports']=function(_0x178e1c,_0x2db372){return _0x178e1c[_0x6fd7('0x9')](_0x6fd7('0xa'),attributes,{'tableName':_0x6fd7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d92c54d..d4cb56e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c1=['info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x19c1,0x149));var _0x119c=function(_0x36ead0,_0x4dceec){_0x36ead0=_0x36ead0-0x0;var _0x907df9=_0x19c1[_0x36ead0];return _0x907df9;};'use strict';var _=require(_0x119c('0x0'));var util=require(_0x119c('0x1'));var moment=require(_0x119c('0x2'));var BPromise=require(_0x119c('0x3'));var rs=require(_0x119c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x119c('0x5'));var logger=require('../../config/logger')(_0x119c('0x6'));var config=require(_0x119c('0x7'));var jayson=require(_0x119c('0x8'));var client=jayson['client'][_0x119c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4da645,_0x553be0,_0x3174b3){return new BPromise(function(_0x4bc07f,_0x175189){return client[_0x119c('0xa')](_0x4da645,_0x3174b3)['then'](function(_0x68d837){logger[_0x119c('0xb')](_0x119c('0xc'),_0x553be0,_0x119c('0xd'));logger['debug'](_0x119c('0xe'),_0x553be0,_0x119c('0xd'),JSON[_0x119c('0xf')](_0x68d837));if(_0x68d837[_0x119c('0x10')]){if(_0x68d837[_0x119c('0x10')][_0x119c('0x11')]===0x1f4){logger[_0x119c('0x10')](_0x119c('0xc'),_0x553be0,_0x68d837[_0x119c('0x10')][_0x119c('0x12')]);return _0x175189(_0x68d837[_0x119c('0x10')][_0x119c('0x12')]);}logger[_0x119c('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x553be0,_0x68d837[_0x119c('0x10')][_0x119c('0x12')]);return _0x4bc07f(_0x68d837[_0x119c('0x10')][_0x119c('0x12')]);}else{logger[_0x119c('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x553be0,_0x119c('0xd'));_0x4bc07f(_0x68d837['result']['message']);}})[_0x119c('0x13')](function(_0x5d1300){logger[_0x119c('0x10')](_0x119c('0xc'),_0x553be0,_0x5d1300);_0x175189(_0x5d1300);});});}
\ No newline at end of file
+var _0xff02=['jayson/promise','client','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xff02,0x84));var _0x2ff0=function(_0x1cba4d,_0x25452c){_0x1cba4d=_0x1cba4d-0x0;var _0x2e8e1f=_0xff02[_0x1cba4d];return _0x2e8e1f;};'use strict';var _=require('lodash');var util=require(_0x2ff0('0x0'));var moment=require(_0x2ff0('0x1'));var BPromise=require(_0x2ff0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ff0('0x3'));var db=require(_0x2ff0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ff0('0x5'))(_0x2ff0('0x6'));var config=require(_0x2ff0('0x7'));var jayson=require(_0x2ff0('0x8'));var client=jayson[_0x2ff0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x514ad1,_0x807d18,_0x280a37){return new BPromise(function(_0x193bfa,_0x2570ba){return client[_0x2ff0('0xa')](_0x514ad1,_0x280a37)['then'](function(_0x5f5588){logger[_0x2ff0('0xb')](_0x2ff0('0xc'),_0x807d18,_0x2ff0('0xd'));logger[_0x2ff0('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x807d18,_0x2ff0('0xd'),JSON['stringify'](_0x5f5588));if(_0x5f5588[_0x2ff0('0xf')]){if(_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x10')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x807d18,_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x11')]);return _0x2570ba(_0x5f5588['error'][_0x2ff0('0x11')]);}logger[_0x2ff0('0xf')](_0x2ff0('0xc'),_0x807d18,_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x11')]);return _0x193bfa(_0x5f5588[_0x2ff0('0xf')][_0x2ff0('0x11')]);}else{logger[_0x2ff0('0xb')](_0x2ff0('0xc'),_0x807d18,_0x2ff0('0xd'));_0x193bfa(_0x5f5588[_0x2ff0('0x12')][_0x2ff0('0x11')]);}})[_0x2ff0('0x13')](function(_0x1a7951){logger[_0x2ff0('0xf')](_0x2ff0('0xc'),_0x807d18,_0x1a7951);_0x2570ba(_0x1a7951);});});}
\ No newline at end of file
index 58d4ed0..5d3e54b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca6b=['destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','put','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca6b,0x1c1));var _0xbca6=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xca6b[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xbca6('0x0'));var util=require(_0xbca6('0x1'));var path=require(_0xbca6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbca6('0x3'));var auth=require(_0xbca6('0x4'));var interaction=require(_0xbca6('0x5'));var config=require(_0xbca6('0x6'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth[_0xbca6('0x7')](),controller[_0xbca6('0x8')]);router[_0xbca6('0x9')](_0xbca6('0xa'),auth[_0xbca6('0x7')](),controller[_0xbca6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbca6('0xc')]('/:id',auth[_0xbca6('0x7')](),controller[_0xbca6('0xd')]);router[_0xbca6('0xe')](_0xbca6('0xa'),auth['isAuthenticated'](),controller[_0xbca6('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x8694=['isAuthenticated','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','show','post','put'];(function(_0x56e159,_0x33a6bd){var _0x1d3efa=function(_0x2100e5){while(--_0x2100e5){_0x56e159['push'](_0x56e159['shift']());}};_0x1d3efa(++_0x33a6bd);}(_0x8694,0x77));var _0x4869=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x8694[_0x162780];return _0x1ea2dc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4869('0x0'));var timeout=require(_0x4869('0x1'));var express=require(_0x4869('0x2'));var router=express[_0x4869('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4869('0x4'));var interaction=require(_0x4869('0x5'));var config=require(_0x4869('0x6'));var controller=require(_0x4869('0x7'));router[_0x4869('0x8')]('/',auth['isAuthenticated'](),controller[_0x4869('0x9')]);router[_0x4869('0x8')](_0x4869('0xa'),auth['isAuthenticated'](),controller[_0x4869('0xb')]);router[_0x4869('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4869('0xd')](_0x4869('0xa'),auth[_0x4869('0xe')](),controller[_0x4869('0xf')]);router[_0x4869('0x10')](_0x4869('0xa'),auth[_0x4869('0xe')](),controller[_0x4869('0x11')]);module[_0x4869('0x12')]=router;
\ No newline at end of file
index b72b4a2..d90782e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x824d=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x3bc156,_0x1eed77){var _0x3ca95=function(_0x2a9124){while(--_0x2a9124){_0x3bc156['push'](_0x3bc156['shift']());}};_0x3ca95(++_0x1eed77);}(_0x824d,0x10c));var _0xd824=function(_0x6db8db,_0x256322){_0x6db8db=_0x6db8db-0x0;var _0x21a66a=_0x824d[_0x6db8db];return _0x21a66a;};'use strict';var Sequelize=require(_0xd824('0x0'));module[_0xd824('0x1')]={'type':{'type':Sequelize[_0xd824('0x2')]('string',_0xd824('0x3'),_0xd824('0x4'),_0xd824('0x5'),_0xd824('0x6')),'defaultValue':_0xd824('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd824('0x2')](_0xd824('0x7'),'variable',_0xd824('0x4'))},'keyContent':{'type':Sequelize[_0xd824('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd824('0x8')]},'customField':{'type':Sequelize[_0xd824('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd824('0x8')]}};
\ No newline at end of file
+var _0xc480=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x2636ea,_0x2222c5){var _0x27a5ee=function(_0x361cf5){while(--_0x361cf5){_0x2636ea['push'](_0x2636ea['shift']());}};_0x27a5ee(++_0x2222c5);}(_0xc480,0xf2));var _0x0c48=function(_0x901a37,_0x1b0b67){_0x901a37=_0x901a37-0x0;var _0x138d9d=_0xc480[_0x901a37];return _0x138d9d;};'use strict';var Sequelize=require(_0x0c48('0x0'));module[_0x0c48('0x1')]={'type':{'type':Sequelize[_0x0c48('0x2')](_0x0c48('0x3'),_0x0c48('0x4'),_0x0c48('0x5'),_0x0c48('0x6'),'picklist'),'defaultValue':_0x0c48('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0c48('0x7')]},'keyType':{'type':Sequelize[_0x0c48('0x2')]('string',_0x0c48('0x4'),_0x0c48('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0c48('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0c48('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0c48('0x7')]}};
\ No newline at end of file
index d45dd16..8c57496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd9=['VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','FreshdeskField','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type'];(function(_0x551acf,_0x5229a9){var _0x8db56b=function(_0x537903){while(--_0x537903){_0x551acf['push'](_0x551acf['shift']());}};_0x8db56b(++_0x5229a9);}(_0x0fd9,0xa3));var _0x90fd=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x0fd9[_0x2aecb2];return _0x3ebb80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['FreshdeskField']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['FreshdeskField'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));};
\ No newline at end of file
+var _0xad95=['offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','FreshdeskField','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x51f492,_0x6b3e08){var _0x4c76eb=function(_0x21ee25){while(--_0x21ee25){_0x51f492['push'](_0x51f492['shift']());}};_0x4c76eb(++_0x6b3e08);}(_0xad95,0x70));var _0x5ad9=function(_0x2d46e0,_0x5e6cd4){_0x2d46e0=_0x2d46e0-0x0;var _0x452cae=_0xad95[_0x2d46e0];return _0x452cae;};'use strict';var emlformat=require(_0x5ad9('0x0'));var rimraf=require(_0x5ad9('0x1'));var zipdir=require(_0x5ad9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ad9('0x3'));var BPromise=require(_0x5ad9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5ad9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ad9('0x6'));var squel=require(_0x5ad9('0x7'));var crypto=require(_0x5ad9('0x8'));var jsforce=require(_0x5ad9('0x9'));var deskjs=require(_0x5ad9('0xa'));var toCsv=require('to-csv');var querystring=require(_0x5ad9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ad9('0xc'));var qs=require(_0x5ad9('0xd'));var as=require(_0x5ad9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ad9('0xf'))(_0x5ad9('0x10'));var utils=require('../../config/utils');var config=require(_0x5ad9('0x11'));var licenseUtil=require(_0x5ad9('0x12'));var db=require(_0x5ad9('0x13'))['db'];function respondWithStatusCode(_0x3b2718,_0x262ce4){_0x262ce4=_0x262ce4||0xcc;return function(_0xc7e5e9){if(_0xc7e5e9){return _0x3b2718['sendStatus'](_0x262ce4);}return _0x3b2718['status'](_0x262ce4)['end']();};}function respondWithResult(_0x431358,_0x4519ad){_0x4519ad=_0x4519ad||0xc8;return function(_0x52cb37){if(_0x52cb37){return _0x431358[_0x5ad9('0x14')](_0x4519ad)[_0x5ad9('0x15')](_0x52cb37);}};}function respondWithFilteredResult(_0x3f16ef,_0x543743){return function(_0x3da125){if(_0x3da125){var _0x32b0bd=typeof _0x543743[_0x5ad9('0x16')]===_0x5ad9('0x17')&&typeof _0x543743[_0x5ad9('0x18')]===_0x5ad9('0x17');var _0x521cc3=_0x3da125[_0x5ad9('0x19')];var _0x54f392=_0x32b0bd?0x0:_0x543743[_0x5ad9('0x16')];var _0x28682f=_0x32b0bd?_0x3da125[_0x5ad9('0x19')]:_0x543743[_0x5ad9('0x16')]+_0x543743[_0x5ad9('0x18')];var _0x2ba5c0;if(_0x28682f>=_0x521cc3){_0x28682f=_0x521cc3;_0x2ba5c0=0xc8;}else{_0x2ba5c0=0xce;}_0x3f16ef[_0x5ad9('0x14')](_0x2ba5c0);return _0x3f16ef['set'](_0x5ad9('0x1a'),_0x54f392+'-'+_0x28682f+'/'+_0x521cc3)['json'](_0x3da125);}return null;};}function patchUpdates(_0x49363b){return function(_0x3356e5){try{jsonpatch['apply'](_0x3356e5,_0x49363b,!![]);}catch(_0xded166){return BPromise[_0x5ad9('0x1b')](_0xded166);}return _0x3356e5[_0x5ad9('0x1c')]();};}function saveUpdates(_0xebbe63,_0x1274f7){return function(_0x57b2ba){if(_0x57b2ba){return _0x57b2ba[_0x5ad9('0x1d')](_0xebbe63)['then'](function(_0x807b05){return _0x807b05;});}return null;};}function removeEntity(_0x5b816d,_0x570d3c){return function(_0x524249){if(_0x524249){return _0x524249[_0x5ad9('0x1e')]()[_0x5ad9('0x1f')](function(){_0x5b816d[_0x5ad9('0x14')](0xcc)[_0x5ad9('0x20')]();});}};}function handleEntityNotFound(_0x1252e6,_0x36da5f){return function(_0x11d919){if(!_0x11d919){_0x1252e6['sendStatus'](0x194);}return _0x11d919;};}function handleError(_0x54e9dd,_0xe6540f){_0xe6540f=_0xe6540f||0x1f4;return function(_0x4f3889){logger[_0x5ad9('0x21')](_0x4f3889['stack']);if(_0x4f3889[_0x5ad9('0x22')]){delete _0x4f3889['name'];}_0x54e9dd['status'](_0xe6540f)[_0x5ad9('0x23')](_0x4f3889);};}exports[_0x5ad9('0x24')]=function(_0x49b3df,_0x509d41){var _0x3942fa={},_0x129804={},_0x1b6faf={'count':0x0,'rows':[]};var _0x2ad078=_[_0x5ad9('0x25')](db[_0x5ad9('0x26')]['rawAttributes'],function(_0x132ec6){return{'name':_0x132ec6[_0x5ad9('0x27')],'type':_0x132ec6[_0x5ad9('0x28')][_0x5ad9('0x29')]};});_0x129804['model']=_['map'](_0x2ad078,_0x5ad9('0x22'));_0x129804[_0x5ad9('0x2a')]=_['keys'](_0x49b3df['query']);_0x129804['filters']=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],_0x129804['query']);_0x3942fa[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x129804[_0x5ad9('0x2c')],qs[_0x5ad9('0x2e')](_0x49b3df['query']['fields']));_0x3942fa[_0x5ad9('0x2d')]=_0x3942fa[_0x5ad9('0x2d')][_0x5ad9('0x2f')]?_0x3942fa[_0x5ad9('0x2d')]:_0x129804[_0x5ad9('0x2c')];if(!_0x49b3df['query'][_0x5ad9('0x30')](_0x5ad9('0x31'))){_0x3942fa[_0x5ad9('0x18')]=qs[_0x5ad9('0x18')](_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x18')]);_0x3942fa['offset']=qs[_0x5ad9('0x16')](_0x49b3df[_0x5ad9('0x2a')]['offset']);}_0x3942fa[_0x5ad9('0x32')]=qs[_0x5ad9('0x33')](_0x49b3df['query'][_0x5ad9('0x33')]);_0x3942fa[_0x5ad9('0x34')]=qs[_0x5ad9('0x35')](_['pick'](_0x49b3df[_0x5ad9('0x2a')],_0x129804[_0x5ad9('0x35')]),_0x2ad078);if(_0x49b3df[_0x5ad9('0x2a')][_0x5ad9('0x36')]){_0x3942fa['where']=_[_0x5ad9('0x37')](_0x3942fa[_0x5ad9('0x34')],{'$or':_[_0x5ad9('0x25')](_0x2ad078,function(_0x143700){if(_0x143700[_0x5ad9('0x28')]!==_0x5ad9('0x38')){var _0x1f0c06={};_0x1f0c06[_0x143700[_0x5ad9('0x22')]]={'$like':'%'+_0x49b3df[_0x5ad9('0x2a')]['filter']+'%'};return _0x1f0c06;}})});}_0x3942fa=_[_0x5ad9('0x37')]({},_0x3942fa,_0x49b3df[_0x5ad9('0x39')]);var _0x41d733={'where':_0x3942fa[_0x5ad9('0x34')]};return db[_0x5ad9('0x26')]['count'](_0x41d733)[_0x5ad9('0x1f')](function(_0xbbfaa0){_0x1b6faf[_0x5ad9('0x19')]=_0xbbfaa0;if(_0x49b3df['query'][_0x5ad9('0x3a')]){_0x3942fa[_0x5ad9('0x3b')]=[{'all':!![]}];}return db[_0x5ad9('0x26')]['findAll'](_0x3942fa);})[_0x5ad9('0x1f')](function(_0x5cfe5b){_0x1b6faf['rows']=_0x5cfe5b;return _0x1b6faf;})[_0x5ad9('0x1f')](respondWithFilteredResult(_0x509d41,_0x3942fa))[_0x5ad9('0x3c')](handleError(_0x509d41,null));};exports[_0x5ad9('0x3d')]=function(_0x24f377,_0x5b8608){var _0x526fda={'raw':!![],'where':{'id':_0x24f377['params']['id']}},_0x552c39={};_0x552c39[_0x5ad9('0x2c')]=_['keys'](db[_0x5ad9('0x26')]['rawAttributes']);_0x552c39[_0x5ad9('0x2a')]=_[_0x5ad9('0x3e')](_0x24f377[_0x5ad9('0x2a')]);_0x552c39[_0x5ad9('0x35')]=_[_0x5ad9('0x2b')](_0x552c39[_0x5ad9('0x2c')],_0x552c39[_0x5ad9('0x2a')]);_0x526fda[_0x5ad9('0x2d')]=_[_0x5ad9('0x2b')](_0x552c39['model'],qs[_0x5ad9('0x2e')](_0x24f377[_0x5ad9('0x2a')][_0x5ad9('0x2e')]));_0x526fda[_0x5ad9('0x2d')]=_0x526fda[_0x5ad9('0x2d')]['length']?_0x526fda[_0x5ad9('0x2d')]:_0x552c39['model'];if(_0x24f377['query']['includeAll']){_0x526fda[_0x5ad9('0x3b')]=[{'all':!![]}];}_0x526fda=_[_0x5ad9('0x37')]({},_0x526fda,_0x24f377[_0x5ad9('0x39')]);return db['FreshdeskField'][_0x5ad9('0x3f')](_0x526fda)[_0x5ad9('0x1f')](handleEntityNotFound(_0x5b8608,null))[_0x5ad9('0x1f')](respondWithResult(_0x5b8608,null))[_0x5ad9('0x3c')](handleError(_0x5b8608,null));};exports['create']=function(_0x126086,_0x420677){return db[_0x5ad9('0x26')][_0x5ad9('0x40')](_0x126086['body'],{})[_0x5ad9('0x1f')](respondWithResult(_0x420677,0xc9))[_0x5ad9('0x3c')](handleError(_0x420677,null));};exports[_0x5ad9('0x1d')]=function(_0x1e03f,_0x479bbc){if(_0x1e03f[_0x5ad9('0x41')]['id']){delete _0x1e03f[_0x5ad9('0x41')]['id'];}return db['FreshdeskField'][_0x5ad9('0x3f')]({'where':{'id':_0x1e03f['params']['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x479bbc,null))[_0x5ad9('0x1f')](saveUpdates(_0x1e03f[_0x5ad9('0x41')],null))[_0x5ad9('0x1f')](respondWithResult(_0x479bbc,null))[_0x5ad9('0x3c')](handleError(_0x479bbc,null));};exports[_0x5ad9('0x1e')]=function(_0xa0f426,_0x2c3945){return db[_0x5ad9('0x26')][_0x5ad9('0x3f')]({'where':{'id':_0xa0f426[_0x5ad9('0x42')]['id']}})[_0x5ad9('0x1f')](handleEntityNotFound(_0x2c3945,null))[_0x5ad9('0x1f')](removeEntity(_0x2c3945,null))[_0x5ad9('0x3c')](handleError(_0x2c3945,null));};
\ No newline at end of file
index 168d879..242cf9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a79=['moment','bluebird','request-promise','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x4bfade,_0xb26c0e){var _0x272465=function(_0x3b38cb){while(--_0x3b38cb){_0x4bfade['push'](_0x4bfade['shift']());}};_0x272465(++_0xb26c0e);}(_0x9a79,0xbc));var _0x99a7=function(_0x1d887f,_0x3737a5){_0x1d887f=_0x1d887f-0x0;var _0x4125b5=_0x9a79[_0x1d887f];return _0x4125b5;};'use strict';var _=require(_0x99a7('0x0'));var util=require(_0x99a7('0x1'));var logger=require(_0x99a7('0x2'))(_0x99a7('0x3'));var moment=require(_0x99a7('0x4'));var BPromise=require(_0x99a7('0x5'));var rp=require(_0x99a7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99a7('0x7'));var config=require('../../config/environment');var attributes=require(_0x99a7('0x8'));module[_0x99a7('0x9')]=function(_0x1d2016,_0xacabd8){return _0x1d2016[_0x99a7('0xa')](_0x99a7('0xb'),attributes,{'tableName':_0x99a7('0xc'),'paranoid':![],'indexes':[{'name':_0x99a7('0xd'),'fields':[_0x99a7('0xe'),_0x99a7('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1928=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x1928,0x138));var _0x8192=function(_0x3ed024,_0x2d5789){_0x3ed024=_0x3ed024-0x0;var _0x52bb99=_0x1928[_0x3ed024];return _0x52bb99;};'use strict';var _=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var logger=require(_0x8192('0x2'))('api');var moment=require(_0x8192('0x3'));var BPromise=require(_0x8192('0x4'));var rp=require(_0x8192('0x5'));var fs=require('fs');var path=require(_0x8192('0x6'));var rimraf=require(_0x8192('0x7'));var config=require(_0x8192('0x8'));var attributes=require(_0x8192('0x9'));module[_0x8192('0xa')]=function(_0x426163,_0x25f90e){return _0x426163[_0x8192('0xb')](_0x8192('0xc'),attributes,{'tableName':_0x8192('0xd'),'paranoid':![],'indexes':[{'name':_0x8192('0xe'),'fields':['idField',_0x8192('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f1a5d41..77d88c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9527=['http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9527,0x182));var _0x7952=function(_0x52b7b0,_0x5b21e2){_0x52b7b0=_0x52b7b0-0x0;var _0x303ce1=_0x9527[_0x52b7b0];return _0x303ce1;};'use strict';var _=require('lodash');var util=require(_0x7952('0x0'));var moment=require(_0x7952('0x1'));var BPromise=require(_0x7952('0x2'));var rs=require(_0x7952('0x3'));var fs=require('fs');var Redis=require(_0x7952('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7952('0x5'));var logger=require('../../config/logger')(_0x7952('0x6'));var config=require(_0x7952('0x7'));var jayson=require(_0x7952('0x8'));var client=jayson[_0x7952('0x9')][_0x7952('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x307ab7,_0x26e023,_0xbb7d93){return new BPromise(function(_0x16a569,_0x40e238){return client[_0x7952('0xb')](_0x307ab7,_0xbb7d93)[_0x7952('0xc')](function(_0xe1a630){logger[_0x7952('0xd')](_0x7952('0xe'),_0x26e023,_0x7952('0xf'));logger[_0x7952('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x26e023,_0x7952('0xf'),JSON[_0x7952('0x11')](_0xe1a630));if(_0xe1a630[_0x7952('0x12')]){if(_0xe1a630[_0x7952('0x12')][_0x7952('0x13')]===0x1f4){logger['error'](_0x7952('0xe'),_0x26e023,_0xe1a630['error'][_0x7952('0x14')]);return _0x40e238(_0xe1a630[_0x7952('0x12')][_0x7952('0x14')]);}logger['error'](_0x7952('0xe'),_0x26e023,_0xe1a630[_0x7952('0x12')][_0x7952('0x14')]);return _0x16a569(_0xe1a630[_0x7952('0x12')][_0x7952('0x14')]);}else{logger[_0x7952('0xd')](_0x7952('0xe'),_0x26e023,'request\x20sent');_0x16a569(_0xe1a630['result']['message']);}})[_0x7952('0x15')](function(_0x590bbd){logger[_0x7952('0x12')](_0x7952('0xe'),_0x26e023,_0x590bbd);_0x40e238(_0x590bbd);});});}
\ No newline at end of file
+var _0xe300=['../../config/logger','../../config/environment','jayson/promise','request','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x16ec41,_0x5b2974){var _0x4973f7=function(_0x400c3b){while(--_0x400c3b){_0x16ec41['push'](_0x16ec41['shift']());}};_0x4973f7(++_0x5b2974);}(_0xe300,0xdf));var _0x0e30=function(_0x121f69,_0x4412c2){_0x121f69=_0x121f69-0x0;var _0x240a3f=_0xe300[_0x121f69];return _0x240a3f;};'use strict';var _=require('lodash');var util=require(_0x0e30('0x0'));var moment=require(_0x0e30('0x1'));var BPromise=require(_0x0e30('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e30('0x3'))['db'];var utils=require(_0x0e30('0x4'));var logger=require(_0x0e30('0x5'))('rpc');var config=require(_0x0e30('0x6'));var jayson=require(_0x0e30('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x549b25,_0x5e335a,_0x1fe6ff){return new BPromise(function(_0x5be0b5,_0xb62281){return client[_0x0e30('0x8')](_0x549b25,_0x1fe6ff)['then'](function(_0xc6f53e){logger[_0x0e30('0x9')](_0x0e30('0xa'),_0x5e335a,'request\x20sent');logger[_0x0e30('0xb')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5e335a,_0x0e30('0xc'),JSON[_0x0e30('0xd')](_0xc6f53e));if(_0xc6f53e[_0x0e30('0xe')]){if(_0xc6f53e[_0x0e30('0xe')][_0x0e30('0xf')]===0x1f4){logger[_0x0e30('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5e335a,_0xc6f53e[_0x0e30('0xe')][_0x0e30('0x10')]);return _0xb62281(_0xc6f53e[_0x0e30('0xe')][_0x0e30('0x10')]);}logger['error'](_0x0e30('0xa'),_0x5e335a,_0xc6f53e['error'][_0x0e30('0x10')]);return _0x5be0b5(_0xc6f53e[_0x0e30('0xe')][_0x0e30('0x10')]);}else{logger[_0x0e30('0x9')]('FreshdeskField,\x20%s,\x20%s',_0x5e335a,_0x0e30('0xc'));_0x5be0b5(_0xc6f53e[_0x0e30('0x11')]['message']);}})[_0x0e30('0x12')](function(_0x2e46a2){logger[_0x0e30('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x5e335a,_0x2e46a2);_0xb62281(_0x2e46a2);});});}
\ No newline at end of file
index 62b9efa..3098674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x13ffab,_0x449a1c){var _0x11cfda=function(_0x2cd296){while(--_0x2cd296){_0x13ffab['push'](_0x13ffab['shift']());}};_0x11cfda(++_0x449a1c);}(_0xda3f,0xec));var _0xfda3=function(_0x1fae6c,_0x1a7f3a){_0x1fae6c=_0x1fae6c-0x0;var _0x2508ee=_0xda3f[_0x1fae6c];return _0x2508ee;};'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('./intFreshsalesAccount.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')]('/',auth['isAuthenticated'](),controller[_0xfda3('0xe')]);router[_0xfda3('0xd')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xf')]);router['put'](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfda3('0x12')]=router;
\ No newline at end of file
+var _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x4b5b68,_0x3c02bd){var _0x3108ae=function(_0xdb9d31){while(--_0xdb9d31){_0x4b5b68['push'](_0x4b5b68['shift']());}};_0x3108ae(++_0x3c02bd);}(_0xe511,0x16f));var _0x1e51=function(_0x3ed0ec,_0x44ece7){_0x3ed0ec=_0x3ed0ec-0x0;var _0x4b32f4=_0xe511[_0x3ed0ec];return _0x4b32f4;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router;
\ No newline at end of file
index 149b8d8..9ed5ac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0x1a37,0xb4));var _0x71a3=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x1a37[_0x2aecb2];return _0x3ebb80;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x524e=['username','remoteUri','STRING'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x524e,0x15e));var _0xe524=function(_0x26529a,_0x3ba5d9){_0x26529a=_0x26529a-0x0;var _0x1af2ea=_0x524e[_0x26529a];return _0x1af2ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe524('0x0')]},'description':{'type':Sequelize[_0xe524('0x0')]},'username':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x1')},'apiKey':{'type':Sequelize[_0xe524('0x0')]},'remoteUri':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x2')},'serverUrl':{'type':Sequelize[_0xe524('0x0')],'allowNull':![]}};
\ No newline at end of file
index e8d728e..5a8f69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeef=['getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','http','then','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','FreshsalesAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','save','update','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','include','findAll','rows','keys','attributes','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','pick','filter','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshsalesField','getFields','username','remoteUri','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','test'];(function(_0x87fcd7,_0x18ed28){var _0x2ab98c=function(_0x56a415){while(--_0x56a415){_0x87fcd7['push'](_0x87fcd7['shift']());}};_0x2ab98c(++_0x18ed28);}(_0xaeef,0x14a));var _0xfaee=function(_0x22026d,_0x4d1794){_0x22026d=_0x22026d-0x0;var _0x59a418=_0xaeef[_0x22026d];return _0x59a418;};'use strict';var emlformat=require(_0xfaee('0x0'));var rimraf=require(_0xfaee('0x1'));var zipdir=require(_0xfaee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfaee('0x3'));var moment=require(_0xfaee('0x4'));var BPromise=require(_0xfaee('0x5'));var Mustache=require(_0xfaee('0x6'));var util=require(_0xfaee('0x7'));var path=require('path');var sox=require(_0xfaee('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfaee('0x9'));var _=require(_0xfaee('0xa'));var squel=require('squel');var crypto=require(_0xfaee('0xb'));var jsforce=require(_0xfaee('0xc'));var deskjs=require(_0xfaee('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfaee('0xe'));var Redis=require(_0xfaee('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfaee('0x10'));var as=require(_0xfaee('0x11'));var hardwareService=require(_0xfaee('0x12'));var logger=require(_0xfaee('0x13'))(_0xfaee('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfaee('0x15'));var db=require(_0xfaee('0x16'))['db'];var integrations=require(_0xfaee('0x17'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfaee('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x33d374,_0x298db5,_0x278a53,_0x2415fd){return new BPromise(function(_0x12b00c,_0x38a323){var _0x19da9f=_0x2415fd||client;return _0x19da9f['request'](_0x33d374,_0x278a53)[_0xfaee('0x19')](function(_0x334867){logger[_0xfaee('0x1a')]('FreshsalesAccount,\x20%s,\x20%s',_0x298db5,_0xfaee('0x1b'));logger['debug'](_0xfaee('0x1c'),_0x298db5,_0xfaee('0x1b'),JSON['stringify'](_0x334867));if(_0x334867[_0xfaee('0x1d')]){if(_0x334867[_0xfaee('0x1d')]['code']===0x1f4){logger[_0xfaee('0x1d')]('FreshsalesAccount,\x20%s,\x20%s',_0x298db5,_0x334867['error'][_0xfaee('0x1e')]);return _0x38a323(_0x334867['error'][_0xfaee('0x1e')]);}logger[_0xfaee('0x1d')](_0xfaee('0x1f'),_0x298db5,_0x334867[_0xfaee('0x1d')]['message']);return _0x12b00c(_0x334867[_0xfaee('0x1d')][_0xfaee('0x1e')]);}else{logger[_0xfaee('0x1a')](_0xfaee('0x1f'),_0x298db5,_0xfaee('0x1b'));_0x12b00c(_0x334867[_0xfaee('0x20')]['message']);}})[_0xfaee('0x21')](function(_0x21a5a0){logger[_0xfaee('0x1d')](_0xfaee('0x1f'),_0x298db5,_0x21a5a0);_0x38a323(_0x21a5a0);});});}function respondWithStatusCode(_0x3191e7,_0x2011c4){_0x2011c4=_0x2011c4||0xcc;return function(_0x2a76aa){if(_0x2a76aa){return _0x3191e7[_0xfaee('0x22')](_0x2011c4);}return _0x3191e7[_0xfaee('0x23')](_0x2011c4)[_0xfaee('0x24')]();};}function respondWithResult(_0x49c651,_0x1563b8){_0x1563b8=_0x1563b8||0xc8;return function(_0x5c980a){if(_0x5c980a){return _0x49c651[_0xfaee('0x23')](_0x1563b8)['json'](_0x5c980a);}};}function respondWithFilteredResult(_0xa7d03d,_0x5b617b){return function(_0x31c5f4){if(_0x31c5f4){var _0x214186=typeof _0x5b617b['offset']===_0xfaee('0x25')&&typeof _0x5b617b[_0xfaee('0x26')]===_0xfaee('0x25');var _0x4bbd1b=_0x31c5f4['count'];var _0x25b1ae=_0x214186?0x0:_0x5b617b[_0xfaee('0x27')];var _0x185eb4=_0x214186?_0x31c5f4[_0xfaee('0x28')]:_0x5b617b['offset']+_0x5b617b[_0xfaee('0x26')];var _0x2447c3;if(_0x185eb4>=_0x4bbd1b){_0x185eb4=_0x4bbd1b;_0x2447c3=0xc8;}else{_0x2447c3=0xce;}_0xa7d03d[_0xfaee('0x23')](_0x2447c3);return _0xa7d03d[_0xfaee('0x29')](_0xfaee('0x2a'),_0x25b1ae+'-'+_0x185eb4+'/'+_0x4bbd1b)[_0xfaee('0x2b')](_0x31c5f4);}return null;};}function patchUpdates(_0x1e8f4a){return function(_0x12bd80){try{jsonpatch['apply'](_0x12bd80,_0x1e8f4a,!![]);}catch(_0x23fdaa){return BPromise['reject'](_0x23fdaa);}return _0x12bd80[_0xfaee('0x2c')]();};}function saveUpdates(_0x29c551,_0x2e65de){return function(_0x2d9b2b){if(_0x2d9b2b){return _0x2d9b2b[_0xfaee('0x2d')](_0x29c551)['then'](function(_0x514ea1){return _0x514ea1;});}return null;};}function removeEntity(_0x41a704,_0x4eb023){return function(_0x40e73e){if(_0x40e73e){return _0x40e73e[_0xfaee('0x2e')]()[_0xfaee('0x19')](function(){_0x41a704[_0xfaee('0x23')](0xcc)[_0xfaee('0x24')]();});}};}function handleEntityNotFound(_0x5966af,_0x5da9af){return function(_0x5e28f8){if(!_0x5e28f8){_0x5966af[_0xfaee('0x22')](0x194);}return _0x5e28f8;};}function handleError(_0x7611bf,_0x989b8){_0x989b8=_0x989b8||0x1f4;return function(_0x17bdc0){logger[_0xfaee('0x1d')](_0x17bdc0[_0xfaee('0x2f')]);if(_0x17bdc0[_0xfaee('0x30')]){delete _0x17bdc0[_0xfaee('0x30')];}_0x7611bf['status'](_0x989b8)[_0xfaee('0x31')](_0x17bdc0);};}exports[_0xfaee('0x32')]=function(_0x4e92b3,_0x2098a5){var _0x4335d0={},_0x221a55={},_0x10177c={'count':0x0,'rows':[]};var _0x3c62f8=_[_0xfaee('0x33')](db[_0xfaee('0x34')][_0xfaee('0x35')],function(_0x513075){return{'name':_0x513075[_0xfaee('0x36')],'type':_0x513075[_0xfaee('0x37')][_0xfaee('0x38')]};});_0x221a55[_0xfaee('0x39')]=_['map'](_0x3c62f8,_0xfaee('0x30'));_0x221a55[_0xfaee('0x3a')]=_['keys'](_0x4e92b3[_0xfaee('0x3a')]);_0x221a55[_0xfaee('0x3b')]=_[_0xfaee('0x3c')](_0x221a55['model'],_0x221a55['query']);_0x4335d0['attributes']=_[_0xfaee('0x3c')](_0x221a55['model'],qs[_0xfaee('0x3d')](_0x4e92b3[_0xfaee('0x3a')][_0xfaee('0x3d')]));_0x4335d0['attributes']=_0x4335d0['attributes'][_0xfaee('0x3e')]?_0x4335d0['attributes']:_0x221a55[_0xfaee('0x39')];if(!_0x4e92b3['query'][_0xfaee('0x3f')](_0xfaee('0x40'))){_0x4335d0[_0xfaee('0x26')]=qs[_0xfaee('0x26')](_0x4e92b3['query'][_0xfaee('0x26')]);_0x4335d0[_0xfaee('0x27')]=qs['offset'](_0x4e92b3[_0xfaee('0x3a')]['offset']);}_0x4335d0[_0xfaee('0x41')]=qs['sort'](_0x4e92b3[_0xfaee('0x3a')][_0xfaee('0x42')]);_0x4335d0[_0xfaee('0x43')]=qs[_0xfaee('0x3b')](_['pick'](_0x4e92b3[_0xfaee('0x3a')],_0x221a55[_0xfaee('0x3b')]),_0x3c62f8);if(_0x4e92b3[_0xfaee('0x3a')]['filter']){_0x4335d0['where']=_[_0xfaee('0x44')](_0x4335d0[_0xfaee('0x43')],{'$or':_[_0xfaee('0x33')](_0x3c62f8,function(_0x3fdfc6){if(_0x3fdfc6[_0xfaee('0x37')]!=='VIRTUAL'){var _0xd30b3c={};_0xd30b3c[_0x3fdfc6['name']]={'$like':'%'+_0x4e92b3[_0xfaee('0x3a')]['filter']+'%'};return _0xd30b3c;}})});}_0x4335d0=_[_0xfaee('0x44')]({},_0x4335d0,_0x4e92b3[_0xfaee('0x45')]);var _0x585d8c={'where':_0x4335d0[_0xfaee('0x43')]};return db[_0xfaee('0x34')][_0xfaee('0x28')](_0x585d8c)[_0xfaee('0x19')](function(_0x5d701){_0x10177c[_0xfaee('0x28')]=_0x5d701;if(_0x4e92b3[_0xfaee('0x3a')]['includeAll']){_0x4335d0[_0xfaee('0x46')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xfaee('0x47')](_0x4335d0);})['then'](function(_0x4a59f6){_0x10177c[_0xfaee('0x48')]=_0x4a59f6;return _0x10177c;})['then'](respondWithFilteredResult(_0x2098a5,_0x4335d0))[_0xfaee('0x21')](handleError(_0x2098a5,null));};exports['show']=function(_0x148151,_0x4c600b){var _0xd898b0={'raw':![],'where':{'id':_0x148151['params']['id']}},_0x3e4b35={};_0x3e4b35['model']=_['keys'](db[_0xfaee('0x34')]['rawAttributes']);_0x3e4b35[_0xfaee('0x3a')]=_[_0xfaee('0x49')](_0x148151['query']);_0x3e4b35[_0xfaee('0x3b')]=_[_0xfaee('0x3c')](_0x3e4b35[_0xfaee('0x39')],_0x3e4b35[_0xfaee('0x3a')]);_0xd898b0['attributes']=_[_0xfaee('0x3c')](_0x3e4b35[_0xfaee('0x39')],qs[_0xfaee('0x3d')](_0x148151[_0xfaee('0x3a')][_0xfaee('0x3d')]));_0xd898b0[_0xfaee('0x4a')]=_0xd898b0[_0xfaee('0x4a')][_0xfaee('0x3e')]?_0xd898b0[_0xfaee('0x4a')]:_0x3e4b35[_0xfaee('0x39')];if(_0x148151[_0xfaee('0x3a')]['includeAll']){_0xd898b0[_0xfaee('0x46')]=[{'all':!![]}];}_0xd898b0=_[_0xfaee('0x44')]({},_0xd898b0,_0x148151[_0xfaee('0x45')]);return db[_0xfaee('0x34')][_0xfaee('0x4b')](_0xd898b0)[_0xfaee('0x19')](handleEntityNotFound(_0x4c600b,null))[_0xfaee('0x19')](respondWithResult(_0x4c600b,null))['catch'](handleError(_0x4c600b,null));};exports[_0xfaee('0x4c')]=function(_0x1aee1e,_0x3d70c4){return db[_0xfaee('0x34')][_0xfaee('0x4c')](_0x1aee1e[_0xfaee('0x4d')],{})[_0xfaee('0x19')](respondWithResult(_0x3d70c4,0xc9))['catch'](handleError(_0x3d70c4,null));};exports['update']=function(_0x512373,_0x1ca431){if(_0x512373[_0xfaee('0x4d')]['id']){delete _0x512373[_0xfaee('0x4d')]['id'];}return db['FreshsalesAccount'][_0xfaee('0x4b')]({'where':{'id':_0x512373[_0xfaee('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ca431,null))[_0xfaee('0x19')](saveUpdates(_0x512373['body'],null))['then'](respondWithResult(_0x1ca431,null))[_0xfaee('0x21')](handleError(_0x1ca431,null));};exports[_0xfaee('0x2e')]=function(_0x1b4d51,_0x132c5d){return db[_0xfaee('0x34')][_0xfaee('0x4b')]({'where':{'id':_0x1b4d51[_0xfaee('0x4e')]['id']}})[_0xfaee('0x19')](handleEntityNotFound(_0x132c5d,null))['then'](removeEntity(_0x132c5d,null))[_0xfaee('0x21')](handleError(_0x132c5d,null));};exports[_0xfaee('0x4f')]=function(_0x304763,_0x28ad48,_0x3ee55f){var _0x24b50a={};var _0x3b7e71={};var _0x4a530d;var _0x473ba6;return db[_0xfaee('0x34')][_0xfaee('0x50')]({'where':{'id':_0x304763[_0xfaee('0x4e')]['id']}})[_0xfaee('0x19')](handleEntityNotFound(_0x28ad48,null))[_0xfaee('0x19')](function(_0xf5fc26){if(_0xf5fc26){_0x4a530d=_0xf5fc26;_0x3b7e71['model']=_['keys'](db[_0xfaee('0x51')][_0xfaee('0x35')]);_0x3b7e71[_0xfaee('0x3a')]=_[_0xfaee('0x49')](_0x304763[_0xfaee('0x3a')]);_0x3b7e71['filters']=_['intersection'](_0x3b7e71[_0xfaee('0x39')],_0x3b7e71[_0xfaee('0x3a')]);_0x24b50a['attributes']=_[_0xfaee('0x3c')](_0x3b7e71[_0xfaee('0x39')],qs['fields'](_0x304763['query'][_0xfaee('0x3d')]));_0x24b50a[_0xfaee('0x4a')]=_0x24b50a[_0xfaee('0x4a')][_0xfaee('0x3e')]?_0x24b50a['attributes']:_0x3b7e71[_0xfaee('0x39')];_0x24b50a[_0xfaee('0x41')]=qs[_0xfaee('0x42')](_0x304763['query'][_0xfaee('0x42')]);_0x24b50a[_0xfaee('0x43')]=qs['filters'](_[_0xfaee('0x52')](_0x304763[_0xfaee('0x3a')],_0x3b7e71['filters']));if(_0x304763[_0xfaee('0x3a')][_0xfaee('0x53')]){_0x24b50a[_0xfaee('0x43')]=_[_0xfaee('0x44')](_0x24b50a['where'],{'$or':_[_0xfaee('0x33')](_0x24b50a[_0xfaee('0x4a')],function(_0x1d1e67){var _0x19eed5={};_0x19eed5[_0x1d1e67]={'$like':'%'+_0x304763[_0xfaee('0x3a')][_0xfaee('0x53')]+'%'};return _0x19eed5;})});}_0x24b50a=_[_0xfaee('0x44')]({},_0x24b50a,_0x304763['options']);return _0x4a530d['getConfigurations'](_0x24b50a);}})[_0xfaee('0x19')](function(_0x4b5e5f){if(_0x4b5e5f){_0x473ba6=_0x4b5e5f[_0xfaee('0x3e')];if(!_0x304763[_0xfaee('0x3a')]['hasOwnProperty'](_0xfaee('0x40'))){_0x24b50a['limit']=qs[_0xfaee('0x26')](_0x304763[_0xfaee('0x3a')][_0xfaee('0x26')]);_0x24b50a[_0xfaee('0x27')]=qs[_0xfaee('0x27')](_0x304763[_0xfaee('0x3a')][_0xfaee('0x27')]);}return _0x4a530d[_0xfaee('0x4f')](_0x24b50a);}})['then'](function(_0x4aaebe){if(_0x4aaebe){return _0x4aaebe?{'count':_0x473ba6,'rows':_0x4aaebe}:null;}})['then'](respondWithResult(_0x28ad48,null))['catch'](handleError(_0x28ad48,null));};exports[_0xfaee('0x54')]=function(_0x130e16,_0x4c2974,_0x3c6c7e){if(_0x130e16['body']['id']){delete _0x130e16['body']['id'];}return db['FreshsalesAccount'][_0xfaee('0x50')]({'where':{'id':_0x130e16[_0xfaee('0x4e')]['id']}})[_0xfaee('0x19')](handleEntityNotFound(_0x4c2974,null))[_0xfaee('0x19')](function(_0x2bc738){if(_0x2bc738){_0x130e16[_0xfaee('0x4d')][_0xfaee('0x55')]=_0x2bc738['id'];_0x130e16[_0xfaee('0x4d')]['Subjects']=integrations[_0xfaee('0x56')](_0x130e16[_0xfaee('0x4d')][_0xfaee('0x57')],_0x130e16[_0xfaee('0x4d')]['type']);_0x130e16[_0xfaee('0x4d')][_0xfaee('0x58')]=integrations[_0xfaee('0x59')](_0x130e16[_0xfaee('0x4d')][_0xfaee('0x57')],_0x130e16[_0xfaee('0x4d')][_0xfaee('0x37')]);return db[_0xfaee('0x51')][_0xfaee('0x4c')](_0x130e16['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xfaee('0x5a')},{'model':db[_0xfaee('0x5b')],'as':_0xfaee('0x58')}]});}return null;})[_0xfaee('0x19')](respondWithResult(_0x4c2974,null))[_0xfaee('0x21')](handleError(_0x4c2974,null));};exports[_0xfaee('0x5c')]=function(_0x3ff2db,_0x592261,_0x3ffdf4){var _0x2c212a='';var _0x29cdb2='';return db[_0xfaee('0x34')][_0xfaee('0x50')]({'where':{'id':_0x3ff2db[_0xfaee('0x4e')]['id']},'attributes':['id',_0xfaee('0x5d'),'remoteUri','apiKey']})[_0xfaee('0x19')](handleEntityNotFound(_0x592261,null))['then'](function(_0x3936b){if(_0x3936b){_0x29cdb2=_0x3936b[_0xfaee('0x5d')];_0x2c212a=_0x3936b[_0xfaee('0x5e')];var _0x40bd8f=_0x3936b[_0xfaee('0x5e')][_0xfaee('0x5f')](-0x1);if(_0x40bd8f==='/'){_0x2c212a=_0x2c212a[_0xfaee('0x60')](0x0,_0x2c212a['lastIndexOf'](_0x40bd8f));}return rp({'method':_0xfaee('0x61'),'uri':util[_0xfaee('0x62')](_0xfaee('0x63'),_0x2c212a,_0xfaee('0x64')),'headers':{'Authorization':_0xfaee('0x65')+_0x3936b[_0xfaee('0x66')]},'json':!![]});}})[_0xfaee('0x19')](function(_0x29a07b){if(_0x29a07b){var _0x33ed77=_0x29a07b[_0xfaee('0x67')];var _0x38e712=![];var _0x10c711=null;for(_0x10c711=0x0;_0x10c711<_0x33ed77[_0xfaee('0x3e')];_0x10c711++){if(_0x33ed77[_0x10c711][_0xfaee('0x68')]===_0x29cdb2){_0x38e712=!![];}}if(_0x38e712){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x592261,null))[_0xfaee('0x21')](function(_0x28dcb1){var _0x225b0f=_0x3ff2db[_0xfaee('0x3a')][_0xfaee('0x69')]?0x1f4:_0x28dcb1['statusCode']||0x1f4;logger[_0xfaee('0x1d')](_0xfaee('0x6a'),_0xfaee('0x5c'),_0x225b0f,JSON[_0xfaee('0x6b')](_0x28dcb1));delete _0x28dcb1[_0xfaee('0x30')];if(_0x225b0f===0x191){_0x225b0f=0x190;}_0x592261[_0xfaee('0x23')](_0x225b0f)[_0xfaee('0x31')](_0x3ff2db[_0xfaee('0x3a')][_0xfaee('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x28dcb1[_0xfaee('0x6c')]}:_0x28dcb1);});};
\ No newline at end of file
+var _0x87f8=['Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','statusCode','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','status','end','json','limit','undefined','count','offset','set','apply','reject','save','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','params','find','body','findOne','sort','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesConfiguration','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87f8,0x152));var _0x887f=function(_0x5e373c,_0x3235fe){_0x5e373c=_0x5e373c-0x0;var _0x186161=_0x87f8[_0x5e373c];return _0x186161;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x887f('0x0'));var rp=require(_0x887f('0x1'));var moment=require('moment');var BPromise=require(_0x887f('0x2'));var Mustache=require('mustache');var util=require(_0x887f('0x3'));var path=require(_0x887f('0x4'));var sox=require(_0x887f('0x5'));var csv=require(_0x887f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x887f('0x7'));var _=require(_0x887f('0x8'));var squel=require(_0x887f('0x9'));var crypto=require(_0x887f('0xa'));var jsforce=require(_0x887f('0xb'));var deskjs=require(_0x887f('0xc'));var toCsv=require(_0x887f('0x6'));var querystring=require('querystring');var Papa=require(_0x887f('0xd'));var Redis=require('ioredis');var authService=require(_0x887f('0xe'));var qs=require(_0x887f('0xf'));var as=require(_0x887f('0x10'));var hardwareService=require(_0x887f('0x11'));var logger=require('../../config/logger')(_0x887f('0x12'));var utils=require(_0x887f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x887f('0x14'))['db'];var integrations=require(_0x887f('0x15'));var jayson=require(_0x887f('0x16'));var client=jayson['client'][_0x887f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x3abe48,_0x571066,_0x16bbc4,_0x58152e){return new BPromise(function(_0x59b7ab,_0xabcefd){var _0x46920e=_0x58152e||client;return _0x46920e['request'](_0x3abe48,_0x16bbc4)[_0x887f('0x18')](function(_0xf69779){logger[_0x887f('0x19')]('FreshsalesAccount,\x20%s,\x20%s',_0x571066,_0x887f('0x1a'));logger[_0x887f('0x1b')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x571066,_0x887f('0x1a'),JSON[_0x887f('0x1c')](_0xf69779));if(_0xf69779[_0x887f('0x1d')]){if(_0xf69779[_0x887f('0x1d')][_0x887f('0x1e')]===0x1f4){logger[_0x887f('0x1d')](_0x887f('0x1f'),_0x571066,_0xf69779[_0x887f('0x1d')][_0x887f('0x20')]);return _0xabcefd(_0xf69779[_0x887f('0x1d')][_0x887f('0x20')]);}logger[_0x887f('0x1d')](_0x887f('0x1f'),_0x571066,_0xf69779['error'][_0x887f('0x20')]);return _0x59b7ab(_0xf69779[_0x887f('0x1d')]['message']);}else{logger[_0x887f('0x19')](_0x887f('0x1f'),_0x571066,'request\x20sent');_0x59b7ab(_0xf69779[_0x887f('0x21')]['message']);}})[_0x887f('0x22')](function(_0x23c0ea){logger['error'](_0x887f('0x1f'),_0x571066,_0x23c0ea);_0xabcefd(_0x23c0ea);});});}function respondWithStatusCode(_0x3af68e,_0x3d6948){_0x3d6948=_0x3d6948||0xcc;return function(_0x9f7131){if(_0x9f7131){return _0x3af68e['sendStatus'](_0x3d6948);}return _0x3af68e[_0x887f('0x23')](_0x3d6948)[_0x887f('0x24')]();};}function respondWithResult(_0x5c7f41,_0x1a1657){_0x1a1657=_0x1a1657||0xc8;return function(_0x42c8bd){if(_0x42c8bd){return _0x5c7f41['status'](_0x1a1657)[_0x887f('0x25')](_0x42c8bd);}};}function respondWithFilteredResult(_0x7eef96,_0x108890){return function(_0x4f25b1){if(_0x4f25b1){var _0x267e67=typeof _0x108890['offset']==='undefined'&&typeof _0x108890[_0x887f('0x26')]===_0x887f('0x27');var _0xee5126=_0x4f25b1[_0x887f('0x28')];var _0x1c5ce3=_0x267e67?0x0:_0x108890['offset'];var _0x59d489=_0x267e67?_0x4f25b1[_0x887f('0x28')]:_0x108890[_0x887f('0x29')]+_0x108890[_0x887f('0x26')];var _0x36cbf0;if(_0x59d489>=_0xee5126){_0x59d489=_0xee5126;_0x36cbf0=0xc8;}else{_0x36cbf0=0xce;}_0x7eef96['status'](_0x36cbf0);return _0x7eef96[_0x887f('0x2a')]('Content-Range',_0x1c5ce3+'-'+_0x59d489+'/'+_0xee5126)[_0x887f('0x25')](_0x4f25b1);}return null;};}function patchUpdates(_0x543c26){return function(_0xbc9cea){try{jsonpatch[_0x887f('0x2b')](_0xbc9cea,_0x543c26,!![]);}catch(_0x32c332){return BPromise[_0x887f('0x2c')](_0x32c332);}return _0xbc9cea[_0x887f('0x2d')]();};}function saveUpdates(_0x3375c7,_0x21040d){return function(_0x173944){if(_0x173944){return _0x173944['update'](_0x3375c7)[_0x887f('0x18')](function(_0x3d395d){return _0x3d395d;});}return null;};}function removeEntity(_0x8f6faf,_0x470578){return function(_0x372ff2){if(_0x372ff2){return _0x372ff2[_0x887f('0x2e')]()['then'](function(){_0x8f6faf[_0x887f('0x23')](0xcc)[_0x887f('0x24')]();});}};}function handleEntityNotFound(_0x450f83,_0x785968){return function(_0x297d6e){if(!_0x297d6e){_0x450f83['sendStatus'](0x194);}return _0x297d6e;};}function handleError(_0x2a4d88,_0x1bd047){_0x1bd047=_0x1bd047||0x1f4;return function(_0x4efdff){logger[_0x887f('0x1d')](_0x4efdff[_0x887f('0x2f')]);if(_0x4efdff[_0x887f('0x30')]){delete _0x4efdff['name'];}_0x2a4d88[_0x887f('0x23')](_0x1bd047)[_0x887f('0x31')](_0x4efdff);};}exports[_0x887f('0x32')]=function(_0x202c99,_0x580bae){var _0x474a9c={},_0x22295f={},_0x4c1219={'count':0x0,'rows':[]};var _0x51e449=_[_0x887f('0x33')](db[_0x887f('0x34')][_0x887f('0x35')],function(_0x5a4d32){return{'name':_0x5a4d32[_0x887f('0x36')],'type':_0x5a4d32['type']['key']};});_0x22295f[_0x887f('0x37')]=_[_0x887f('0x33')](_0x51e449,_0x887f('0x30'));_0x22295f['query']=_[_0x887f('0x38')](_0x202c99[_0x887f('0x39')]);_0x22295f[_0x887f('0x3a')]=_['intersection'](_0x22295f[_0x887f('0x37')],_0x22295f[_0x887f('0x39')]);_0x474a9c['attributes']=_[_0x887f('0x3b')](_0x22295f[_0x887f('0x37')],qs[_0x887f('0x3c')](_0x202c99[_0x887f('0x39')][_0x887f('0x3c')]));_0x474a9c[_0x887f('0x3d')]=_0x474a9c['attributes'][_0x887f('0x3e')]?_0x474a9c[_0x887f('0x3d')]:_0x22295f[_0x887f('0x37')];if(!_0x202c99[_0x887f('0x39')][_0x887f('0x3f')](_0x887f('0x40'))){_0x474a9c[_0x887f('0x26')]=qs['limit'](_0x202c99[_0x887f('0x39')][_0x887f('0x26')]);_0x474a9c[_0x887f('0x29')]=qs[_0x887f('0x29')](_0x202c99['query'][_0x887f('0x29')]);}_0x474a9c[_0x887f('0x41')]=qs['sort'](_0x202c99[_0x887f('0x39')]['sort']);_0x474a9c['where']=qs[_0x887f('0x3a')](_[_0x887f('0x42')](_0x202c99[_0x887f('0x39')],_0x22295f[_0x887f('0x3a')]),_0x51e449);if(_0x202c99[_0x887f('0x39')][_0x887f('0x43')]){_0x474a9c['where']=_[_0x887f('0x44')](_0x474a9c[_0x887f('0x45')],{'$or':_[_0x887f('0x33')](_0x51e449,function(_0x39d3a5){if(_0x39d3a5[_0x887f('0x46')]!==_0x887f('0x47')){var _0x3a0e95={};_0x3a0e95[_0x39d3a5[_0x887f('0x30')]]={'$like':'%'+_0x202c99[_0x887f('0x39')][_0x887f('0x43')]+'%'};return _0x3a0e95;}})});}_0x474a9c=_['merge']({},_0x474a9c,_0x202c99[_0x887f('0x48')]);var _0x9d59f3={'where':_0x474a9c[_0x887f('0x45')]};return db['FreshsalesAccount'][_0x887f('0x28')](_0x9d59f3)[_0x887f('0x18')](function(_0x5a354f){_0x4c1219[_0x887f('0x28')]=_0x5a354f;if(_0x202c99[_0x887f('0x39')][_0x887f('0x49')]){_0x474a9c[_0x887f('0x4a')]=[{'all':!![]}];}return db[_0x887f('0x34')][_0x887f('0x4b')](_0x474a9c);})[_0x887f('0x18')](function(_0x514e59){_0x4c1219['rows']=_0x514e59;return _0x4c1219;})[_0x887f('0x18')](respondWithFilteredResult(_0x580bae,_0x474a9c))[_0x887f('0x22')](handleError(_0x580bae,null));};exports['show']=function(_0x297021,_0x3fcd12){var _0x2bdd65={'raw':![],'where':{'id':_0x297021[_0x887f('0x4c')]['id']}},_0x26a960={};_0x26a960[_0x887f('0x37')]=_['keys'](db['FreshsalesAccount'][_0x887f('0x35')]);_0x26a960['query']=_[_0x887f('0x38')](_0x297021['query']);_0x26a960[_0x887f('0x3a')]=_[_0x887f('0x3b')](_0x26a960[_0x887f('0x37')],_0x26a960[_0x887f('0x39')]);_0x2bdd65[_0x887f('0x3d')]=_['intersection'](_0x26a960[_0x887f('0x37')],qs[_0x887f('0x3c')](_0x297021[_0x887f('0x39')][_0x887f('0x3c')]));_0x2bdd65[_0x887f('0x3d')]=_0x2bdd65[_0x887f('0x3d')][_0x887f('0x3e')]?_0x2bdd65[_0x887f('0x3d')]:_0x26a960['model'];if(_0x297021[_0x887f('0x39')][_0x887f('0x49')]){_0x2bdd65[_0x887f('0x4a')]=[{'all':!![]}];}_0x2bdd65=_[_0x887f('0x44')]({},_0x2bdd65,_0x297021[_0x887f('0x48')]);return db[_0x887f('0x34')][_0x887f('0x4d')](_0x2bdd65)[_0x887f('0x18')](handleEntityNotFound(_0x3fcd12,null))['then'](respondWithResult(_0x3fcd12,null))[_0x887f('0x22')](handleError(_0x3fcd12,null));};exports['create']=function(_0x5188d1,_0x5f1e2a){return db['FreshsalesAccount']['create'](_0x5188d1['body'],{})['then'](respondWithResult(_0x5f1e2a,0xc9))[_0x887f('0x22')](handleError(_0x5f1e2a,null));};exports['update']=function(_0xa34900,_0x3cc7a7){if(_0xa34900['body']['id']){delete _0xa34900['body']['id'];}return db['FreshsalesAccount'][_0x887f('0x4d')]({'where':{'id':_0xa34900[_0x887f('0x4c')]['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x3cc7a7,null))['then'](saveUpdates(_0xa34900[_0x887f('0x4e')],null))['then'](respondWithResult(_0x3cc7a7,null))[_0x887f('0x22')](handleError(_0x3cc7a7,null));};exports['destroy']=function(_0x2dc255,_0x563350){return db[_0x887f('0x34')]['find']({'where':{'id':_0x2dc255['params']['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x563350,null))[_0x887f('0x18')](removeEntity(_0x563350,null))[_0x887f('0x22')](handleError(_0x563350,null));};exports['getConfigurations']=function(_0x10974b,_0x3f57bf,_0x3ccb7c){var _0x24bea4={};var _0x300a04={};var _0x2f7420;var _0x405c8e;return db[_0x887f('0x34')][_0x887f('0x4f')]({'where':{'id':_0x10974b[_0x887f('0x4c')]['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x3f57bf,null))[_0x887f('0x18')](function(_0x22ba5d){if(_0x22ba5d){_0x2f7420=_0x22ba5d;_0x300a04[_0x887f('0x37')]=_[_0x887f('0x38')](db['FreshsalesConfiguration'][_0x887f('0x35')]);_0x300a04[_0x887f('0x39')]=_[_0x887f('0x38')](_0x10974b['query']);_0x300a04['filters']=_[_0x887f('0x3b')](_0x300a04[_0x887f('0x37')],_0x300a04[_0x887f('0x39')]);_0x24bea4['attributes']=_[_0x887f('0x3b')](_0x300a04[_0x887f('0x37')],qs[_0x887f('0x3c')](_0x10974b[_0x887f('0x39')][_0x887f('0x3c')]));_0x24bea4[_0x887f('0x3d')]=_0x24bea4[_0x887f('0x3d')]['length']?_0x24bea4[_0x887f('0x3d')]:_0x300a04[_0x887f('0x37')];_0x24bea4[_0x887f('0x41')]=qs[_0x887f('0x50')](_0x10974b['query'][_0x887f('0x50')]);_0x24bea4[_0x887f('0x45')]=qs[_0x887f('0x3a')](_[_0x887f('0x42')](_0x10974b[_0x887f('0x39')],_0x300a04[_0x887f('0x3a')]));if(_0x10974b[_0x887f('0x39')]['filter']){_0x24bea4[_0x887f('0x45')]=_[_0x887f('0x44')](_0x24bea4['where'],{'$or':_[_0x887f('0x33')](_0x24bea4[_0x887f('0x3d')],function(_0xfe151d){var _0x45a36b={};_0x45a36b[_0xfe151d]={'$like':'%'+_0x10974b[_0x887f('0x39')][_0x887f('0x43')]+'%'};return _0x45a36b;})});}_0x24bea4=_['merge']({},_0x24bea4,_0x10974b[_0x887f('0x48')]);return _0x2f7420[_0x887f('0x51')](_0x24bea4);}})['then'](function(_0x49f7f8){if(_0x49f7f8){_0x405c8e=_0x49f7f8[_0x887f('0x3e')];if(!_0x10974b[_0x887f('0x39')]['hasOwnProperty']('nolimit')){_0x24bea4[_0x887f('0x26')]=qs[_0x887f('0x26')](_0x10974b[_0x887f('0x39')]['limit']);_0x24bea4['offset']=qs[_0x887f('0x29')](_0x10974b[_0x887f('0x39')]['offset']);}return _0x2f7420[_0x887f('0x51')](_0x24bea4);}})[_0x887f('0x18')](function(_0x5773a8){if(_0x5773a8){return _0x5773a8?{'count':_0x405c8e,'rows':_0x5773a8}:null;}})[_0x887f('0x18')](respondWithResult(_0x3f57bf,null))['catch'](handleError(_0x3f57bf,null));};exports[_0x887f('0x52')]=function(_0x23647d,_0x3f54e2,_0x4db87e){if(_0x23647d[_0x887f('0x4e')]['id']){delete _0x23647d[_0x887f('0x4e')]['id'];}return db[_0x887f('0x34')][_0x887f('0x4f')]({'where':{'id':_0x23647d[_0x887f('0x4c')]['id']}})[_0x887f('0x18')](handleEntityNotFound(_0x3f54e2,null))[_0x887f('0x18')](function(_0x72f49f){if(_0x72f49f){_0x23647d['body'][_0x887f('0x53')]=_0x72f49f['id'];_0x23647d[_0x887f('0x4e')][_0x887f('0x54')]=integrations[_0x887f('0x55')](_0x23647d[_0x887f('0x4e')][_0x887f('0x56')],_0x23647d[_0x887f('0x4e')][_0x887f('0x46')]);_0x23647d['body']['Descriptions']=integrations[_0x887f('0x57')](_0x23647d['body'][_0x887f('0x56')],_0x23647d[_0x887f('0x4e')][_0x887f('0x46')]);return db[_0x887f('0x58')][_0x887f('0x59')](_0x23647d[_0x887f('0x4e')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x887f('0x5a')}]});}return null;})['then'](respondWithResult(_0x3f54e2,null))['catch'](handleError(_0x3f54e2,null));};exports[_0x887f('0x5b')]=function(_0x4c9241,_0x23e566,_0x12ce96){var _0x4f3383='';var _0x5ae8c3='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x4c9241['params']['id']},'attributes':['id',_0x887f('0x5c'),_0x887f('0x5d'),_0x887f('0x5e')]})['then'](handleEntityNotFound(_0x23e566,null))[_0x887f('0x18')](function(_0x36344e){if(_0x36344e){_0x5ae8c3=_0x36344e[_0x887f('0x5c')];_0x4f3383=_0x36344e['remoteUri'];var _0x2c39db=_0x36344e['remoteUri'][_0x887f('0x5f')](-0x1);if(_0x2c39db==='/'){_0x4f3383=_0x4f3383['substring'](0x0,_0x4f3383[_0x887f('0x60')](_0x2c39db));}return rp({'method':_0x887f('0x61'),'uri':util['format'](_0x887f('0x62'),_0x4f3383,_0x887f('0x63')),'headers':{'Authorization':_0x887f('0x64')+_0x36344e[_0x887f('0x5e')]},'json':!![]});}})[_0x887f('0x18')](function(_0x1787f5){if(_0x1787f5){var _0x1ef2e0=_0x1787f5[_0x887f('0x65')];var _0x419dc1=![];var _0xc95a0c=null;for(_0xc95a0c=0x0;_0xc95a0c<_0x1ef2e0['length'];_0xc95a0c++){if(_0x1ef2e0[_0xc95a0c][_0x887f('0x66')]===_0x5ae8c3){_0x419dc1=!![];}}if(_0x419dc1){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x887f('0x67')});}}})[_0x887f('0x18')](respondWithResult(_0x23e566,null))[_0x887f('0x22')](function(_0x7622ed){var _0x30f7bb=_0x4c9241['query'][_0x887f('0x68')]?0x1f4:_0x7622ed['statusCode']||0x1f4;logger[_0x887f('0x1d')](_0x887f('0x69'),'getFields',_0x30f7bb,JSON[_0x887f('0x1c')](_0x7622ed));delete _0x7622ed[_0x887f('0x30')];if(_0x30f7bb===0x191){_0x30f7bb=0x190;}_0x23e566[_0x887f('0x23')](_0x30f7bb)['send'](_0x4c9241['query'][_0x887f('0x68')]?{'message':'Wrong\x20credentials','statusCode':_0x7622ed[_0x887f('0x6a')]}:_0x7622ed);});};
\ No newline at end of file
index ab47fbe..f63b68b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x30cc3a,_0x1a0a46){var _0x378ecc=function(_0x4627d2){while(--_0x4627d2){_0x30cc3a['push'](_0x30cc3a['shift']());}};_0x378ecc(++_0x1a0a46);}(_0x2a07,0x74));var _0x72a0=function(_0x3f2302,_0x3c3363){_0x3f2302=_0x3f2302-0x0;var _0x55fed4=_0x2a07[_0x3f2302];return _0x55fed4;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));var integrations=require(_0x72a0('0xa'));module[_0x72a0('0xb')]=function(_0x20dab9,_0x193e3b){return _0x20dab9[_0x72a0('0xc')](_0x72a0('0xd'),attributes,{'tableName':_0x72a0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x36eea2,_0x463488){var _0x187729=function(_0x558db7){while(--_0x558db7){_0x36eea2['push'](_0x36eea2['shift']());}};_0x187729(++_0x463488);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1230b7f..ea048d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d11=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FreshsalesAccount','findAll','options','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x448a56,_0x3cd4d1){var _0x1ba466=function(_0x39feff){while(--_0x39feff){_0x448a56['push'](_0x448a56['shift']());}};_0x1ba466(++_0x3cd4d1);}(_0x6d11,0xbf));var _0x16d1=function(_0x28fd11,_0xb7b5ca){_0x28fd11=_0x28fd11-0x0;var _0x51caa0=_0x6d11[_0x28fd11];return _0x51caa0;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['GetFreshsalesAccount']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')]({'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'where':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')]['where']||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'limit':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x19')]||null:null,'include':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')]['include']?_[_0x16d1('0x1a')](_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x47cad4){return{'model':db[_0x47cad4[_0x16d1('0x1c')]],'as':_0x47cad4['as'],'attributes':_0x47cad4[_0x16d1('0x18')],'include':_0x47cad4[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x47cad4[_0x16d1('0x1b')],function(_0x335c24){return{'model':db[_0x335c24[_0x16d1('0x1c')]],'as':_0x335c24['as'],'attributes':_0x335c24[_0x16d1('0x18')],'include':_0x335c24[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x335c24[_0x16d1('0x1b')],function(_0x2b8403){return{'model':db[_0x2b8403['model']],'as':_0x2b8403['as'],'attributes':_0x2b8403[_0x16d1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x16d1('0xa')](function(_0x4257f1){logger['info'](_0x16d1('0x1d'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1d'),_0x46a25e,JSON[_0x16d1('0x10')](_0x4257f1));_0x1da1b8(_0x4257f1);})[_0x16d1('0x14')](function(_0x462e5b){logger[_0x16d1('0x11')]('GetFreshsalesAccount',_0x462e5b[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x462e5b[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1e')]=function(_0x55c021){var _0x4b27f6=this;return new Promise(function(_0x2f16ee,_0x4ab3d4){return db[_0x16d1('0x15')][_0x16d1('0x1f')]({'raw':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x20')]===undefined?!![]:![]:!![],'where':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x21')]||null:null,'attributes':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'include':_0x55c021[_0x16d1('0x17')]?_0x55c021['options'][_0x16d1('0x1b')]?_['map'](_0x55c021[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x2b9126){return{'model':db[_0x2b9126[_0x16d1('0x1c')]],'as':_0x2b9126['as'],'attributes':_0x2b9126[_0x16d1('0x18')],'include':_0x2b9126[_0x16d1('0x1b')]?_['map'](_0x2b9126['include'],function(_0x58d72d){return{'model':db[_0x58d72d[_0x16d1('0x1c')]],'as':_0x58d72d['as'],'attributes':_0x58d72d[_0x16d1('0x18')],'include':_0x58d72d[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x58d72d['include'],function(_0x885454){return{'model':db[_0x885454[_0x16d1('0x1c')]],'as':_0x885454['as'],'attributes':_0x885454['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x508ed7){logger[_0x16d1('0xb')](_0x16d1('0x1e'),_0x55c021);logger[_0x16d1('0xd')]('ShowFreshsalesAccount',_0x55c021,JSON[_0x16d1('0x10')](_0x508ed7));_0x2f16ee(_0x508ed7);})[_0x16d1('0x14')](function(_0x2928ad){logger[_0x16d1('0x11')](_0x16d1('0x1e'),_0x2928ad[_0x16d1('0x13')],_0x55c021);_0x4ab3d4(_0x4b27f6[_0x16d1('0x11')](0x1f4,_0x2928ad['message']));});});};
\ No newline at end of file
+var _0x77d4=['util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshsalesAccount','find'];(function(_0x487b42,_0x4e903c){var _0x2982cf=function(_0x3c4421){while(--_0x3c4421){_0x487b42['push'](_0x487b42['shift']());}};_0x2982cf(++_0x4e903c);}(_0x77d4,0x108));var _0x477d=function(_0x428d78,_0x372962){_0x428d78=_0x428d78-0x0;var _0x3f8d3f=_0x77d4[_0x428d78];return _0x3f8d3f;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var moment=require('moment');var BPromise=require(_0x477d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x477d('0x4'));var config=require(_0x477d('0x5'));var jayson=require(_0x477d('0x6'));var client=jayson[_0x477d('0x7')][_0x477d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45ca2d,_0x5153df,_0x4f4fb4){return new BPromise(function(_0x2dd5d2,_0x579859){return client['request'](_0x45ca2d,_0x4f4fb4)[_0x477d('0x9')](function(_0x29f11b){logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));logger['debug'](_0x477d('0xd'),_0x5153df,'request\x20sent',JSON[_0x477d('0xe')](_0x29f11b));if(_0x29f11b[_0x477d('0xf')]){if(_0x29f11b['error'][_0x477d('0x10')]===0x1f4){logger[_0x477d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x5153df,_0x29f11b['error'][_0x477d('0x11')]);return _0x579859(_0x29f11b[_0x477d('0xf')]['message']);}logger[_0x477d('0xf')](_0x477d('0xb'),_0x5153df,_0x29f11b['error']['message']);return _0x2dd5d2(_0x29f11b[_0x477d('0xf')]['message']);}else{logger[_0x477d('0xa')](_0x477d('0xb'),_0x5153df,_0x477d('0xc'));_0x2dd5d2(_0x29f11b['result'][_0x477d('0x11')]);}})[_0x477d('0x12')](function(_0x29c6f8){logger[_0x477d('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x5153df,_0x29c6f8);_0x579859(_0x29c6f8);});});}exports[_0x477d('0x13')]=function(_0x5d5553){var _0x367965=this;return new Promise(function(_0x1399d7,_0x159beb){return db[_0x477d('0x14')][_0x477d('0x15')]({'raw':_0x5d5553[_0x477d('0x16')]?_0x5d5553['options'][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x5d5553['options']?_0x5d5553[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x19')]||null:null,'limit':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1a')]||null:null,'include':_0x5d5553[_0x477d('0x16')]?_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x5d5553[_0x477d('0x16')][_0x477d('0x1b')],function(_0x4e6a44){return{'model':db[_0x4e6a44[_0x477d('0x1d')]],'as':_0x4e6a44['as'],'attributes':_0x4e6a44['attributes'],'include':_0x4e6a44[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x4e6a44[_0x477d('0x1b')],function(_0x2287b4){return{'model':db[_0x2287b4['model']],'as':_0x2287b4['as'],'attributes':_0x2287b4[_0x477d('0x19')],'include':_0x2287b4[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x2287b4['include'],function(_0x585648){return{'model':db[_0x585648[_0x477d('0x1d')]],'as':_0x585648['as'],'attributes':_0x585648[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x5c8ef1){logger[_0x477d('0xa')](_0x477d('0x13'),_0x5d5553);logger[_0x477d('0x1e')](_0x477d('0x13'),_0x5d5553,JSON[_0x477d('0xe')](_0x5c8ef1));_0x1399d7(_0x5c8ef1);})['catch'](function(_0x2fc959){logger[_0x477d('0xf')](_0x477d('0x13'),_0x2fc959[_0x477d('0x11')],_0x5d5553);_0x159beb(_0x367965[_0x477d('0xf')](0x1f4,_0x2fc959[_0x477d('0x11')]));});});};exports[_0x477d('0x1f')]=function(_0x98b5d9){var _0x204541=this;return new Promise(function(_0x8fe6c4,_0x41b790){return db[_0x477d('0x14')][_0x477d('0x20')]({'raw':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x17')]===undefined?!![]:![]:!![],'where':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9[_0x477d('0x16')][_0x477d('0x18')]||null:null,'attributes':_0x98b5d9[_0x477d('0x16')]?_0x98b5d9['options'][_0x477d('0x19')]||null:null,'include':_0x98b5d9['options']?_0x98b5d9[_0x477d('0x16')][_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x98b5d9['options'][_0x477d('0x1b')],function(_0x1201a9){return{'model':db[_0x1201a9[_0x477d('0x1d')]],'as':_0x1201a9['as'],'attributes':_0x1201a9[_0x477d('0x19')],'include':_0x1201a9[_0x477d('0x1b')]?_[_0x477d('0x1c')](_0x1201a9[_0x477d('0x1b')],function(_0xf84c4c){return{'model':db[_0xf84c4c[_0x477d('0x1d')]],'as':_0xf84c4c['as'],'attributes':_0xf84c4c[_0x477d('0x19')],'include':_0xf84c4c['include']?_[_0x477d('0x1c')](_0xf84c4c[_0x477d('0x1b')],function(_0xb41cd8){return{'model':db[_0xb41cd8['model']],'as':_0xb41cd8['as'],'attributes':_0xb41cd8[_0x477d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x477d('0x9')](function(_0x1b0410){logger['info']('ShowFreshsalesAccount',_0x98b5d9);logger[_0x477d('0x1e')](_0x477d('0x1f'),_0x98b5d9,JSON[_0x477d('0xe')](_0x1b0410));_0x8fe6c4(_0x1b0410);})[_0x477d('0x12')](function(_0x1c0d86){logger['error'](_0x477d('0x1f'),_0x1c0d86['message'],_0x98b5d9);_0x41b790(_0x204541[_0x477d('0xf')](0x1f4,_0x1c0d86[_0x477d('0x11')]));});});};
\ No newline at end of file
index 7cbc04e..6a1c040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x51c821,_0x2e60bb){var _0x501dfd=function(_0x3ac41e){while(--_0x3ac41e){_0x51c821['push'](_0x51c821['shift']());}};_0x501dfd(++_0x2e60bb);}(_0x750a,0x1f0));var _0xa750=function(_0x399942,_0x3171e3){_0x399942=_0x399942-0x0;var _0xc019cd=_0x750a[_0x399942];return _0xc019cd;};'use strict';var multer=require(_0xa750('0x0'));var util=require(_0xa750('0x1'));var path=require(_0xa750('0x2'));var timeout=require(_0xa750('0x3'));var express=require(_0xa750('0x4'));var router=express[_0xa750('0x5')]();var fs_extra=require(_0xa750('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa750('0x7'));var config=require(_0xa750('0x8'));var controller=require(_0xa750('0x9'));router[_0xa750('0xa')]('/',auth[_0xa750('0xb')](),controller[_0xa750('0xc')]);router[_0xa750('0xa')]('/:id',auth[_0xa750('0xb')](),controller[_0xa750('0xd')]);router[_0xa750('0xa')](_0xa750('0xe'),auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0xa')](_0xa750('0x10'),auth['isAuthenticated'](),controller[_0xa750('0x11')]);router[_0xa750('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa750('0x12')]);router[_0xa750('0x13')]('/',auth[_0xa750('0xb')](),controller['create']);router[_0xa750('0x14')](_0xa750('0x15'),auth[_0xa750('0xb')](),controller[_0xa750('0x16')]);router[_0xa750('0x17')](_0xa750('0x15'),auth[_0xa750('0xb')](),controller['destroy']);module[_0xa750('0x18')]=router;
\ No newline at end of file
+var _0x30bd=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','put','update'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x30bd,0x96));var _0xd30b=function(_0x449521,_0x291181){_0x449521=_0x449521-0x0;var _0x2cca8b=_0x30bd[_0x449521];return _0x2cca8b;};'use strict';var multer=require(_0xd30b('0x0'));var util=require(_0xd30b('0x1'));var path=require('path');var timeout=require(_0xd30b('0x2'));var express=require('express');var router=express[_0xd30b('0x3')]();var fs_extra=require(_0xd30b('0x4'));var auth=require(_0xd30b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd30b('0x6'));router[_0xd30b('0x7')]('/',auth[_0xd30b('0x8')](),controller[_0xd30b('0x9')]);router['get'](_0xd30b('0xa'),auth['isAuthenticated'](),controller[_0xd30b('0xb')]);router[_0xd30b('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xd30b('0x7')]('/:id/descriptions',auth[_0xd30b('0x8')](),controller['getDescriptions']);router['get'](_0xd30b('0xc'),auth[_0xd30b('0x8')](),controller[_0xd30b('0xd')]);router[_0xd30b('0xe')]('/',auth[_0xd30b('0x8')](),controller[_0xd30b('0xf')]);router[_0xd30b('0x10')]('/:id',auth[_0xd30b('0x8')](),controller[_0xd30b('0x11')]);router[_0xd30b('0x12')](_0xd30b('0xa'),auth[_0xd30b('0x8')](),controller[_0xd30b('0x13')]);module[_0xd30b('0x14')]=router;
\ No newline at end of file
index 0f90d42..509cf23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e63=['sequelize','exports','STRING'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x3e63,0x1c8));var _0x33e6=function(_0x2ee974,_0x1cceb5){_0x2ee974=_0x2ee974-0x0;var _0x20c5fb=_0x3e63[_0x2ee974];return _0x20c5fb;};'use strict';var Sequelize=require(_0x33e6('0x0'));module[_0x33e6('0x1')]={'name':{'type':Sequelize[_0x33e6('0x2')]},'description':{'type':Sequelize[_0x33e6('0x2')]}};
\ No newline at end of file
+var _0x5003=['sequelize','exports','STRING'];(function(_0x316a88,_0x451333){var _0x2d35b1=function(_0x234608){while(--_0x234608){_0x316a88['push'](_0x316a88['shift']());}};_0x2d35b1(++_0x451333);}(_0x5003,0x138));var _0x3500=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5003[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3500('0x0'));module[_0x3500('0x1')]={'name':{'type':Sequelize[_0x3500('0x2')]},'description':{'type':Sequelize[_0x3500('0x2')]}};
\ No newline at end of file
index 5078baf..68cabbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x758e=['nolimit','order','sort','where','filter','merge','includeAll','include','rows','show','rawAttributes','options','find','create','body','params','destroy','findOne','keys','pick','getSubjects','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','count','apply','reject','save','update','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x3e5cc1,_0x5ef0d2){var _0x27374a=function(_0x1fc08d){while(--_0x1fc08d){_0x3e5cc1['push'](_0x3e5cc1['shift']());}};_0x27374a(++_0x5ef0d2);}(_0x758e,0x194));var _0xe758=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x758e[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xe758('0x0'));var rimraf=require(_0xe758('0x1'));var zipdir=require(_0xe758('0x2'));var jsonpatch=require(_0xe758('0x3'));var rp=require(_0xe758('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe758('0x5'));var util=require(_0xe758('0x6'));var path=require(_0xe758('0x7'));var sox=require(_0xe758('0x8'));var csv=require(_0xe758('0x9'));var ejs=require(_0xe758('0xa'));var fs=require('fs');var fs_extra=require(_0xe758('0xb'));var _=require(_0xe758('0xc'));var squel=require(_0xe758('0xd'));var crypto=require(_0xe758('0xe'));var jsforce=require(_0xe758('0xf'));var deskjs=require(_0xe758('0x10'));var toCsv=require(_0xe758('0x9'));var querystring=require(_0xe758('0x11'));var Papa=require(_0xe758('0x12'));var Redis=require(_0xe758('0x13'));var authService=require(_0xe758('0x14'));var qs=require(_0xe758('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe758('0x16'));var logger=require(_0xe758('0x17'))(_0xe758('0x18'));var utils=require(_0xe758('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe758('0x1a'));var db=require(_0xe758('0x1b'))['db'];var jayson=require(_0xe758('0x1c'));var client=jayson[_0xe758('0x1d')][_0xe758('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ee69d,_0x2450e0,_0x560a17,_0xad0b62){return new BPromise(function(_0x94626f,_0x4523bd){var _0x4c64d5=_0xad0b62||client;return _0x4c64d5[_0xe758('0x1f')](_0x5ee69d,_0x560a17)[_0xe758('0x20')](function(_0x33d88d){logger[_0xe758('0x21')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2450e0,_0xe758('0x22'));logger[_0xe758('0x23')](_0xe758('0x24'),_0x2450e0,'request\x20sent',JSON[_0xe758('0x25')](_0x33d88d));if(_0x33d88d['error']){if(_0x33d88d['error'][_0xe758('0x26')]===0x1f4){logger[_0xe758('0x27')](_0xe758('0x28'),_0x2450e0,_0x33d88d[_0xe758('0x27')]['message']);return _0x4523bd(_0x33d88d[_0xe758('0x27')][_0xe758('0x29')]);}logger[_0xe758('0x27')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2450e0,_0x33d88d[_0xe758('0x27')]['message']);return _0x94626f(_0x33d88d[_0xe758('0x27')][_0xe758('0x29')]);}else{logger['info'](_0xe758('0x28'),_0x2450e0,'request\x20sent');_0x94626f(_0x33d88d['result'][_0xe758('0x29')]);}})[_0xe758('0x2a')](function(_0x32ca90){logger[_0xe758('0x27')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2450e0,_0x32ca90);_0x4523bd(_0x32ca90);});});}function respondWithStatusCode(_0x137224,_0x49f9c6){_0x49f9c6=_0x49f9c6||0xcc;return function(_0x37dc60){if(_0x37dc60){return _0x137224[_0xe758('0x2b')](_0x49f9c6);}return _0x137224[_0xe758('0x2c')](_0x49f9c6)[_0xe758('0x2d')]();};}function respondWithResult(_0x5cc549,_0xcaa7c4){_0xcaa7c4=_0xcaa7c4||0xc8;return function(_0x5bbd12){if(_0x5bbd12){return _0x5cc549['status'](_0xcaa7c4)[_0xe758('0x2e')](_0x5bbd12);}};}function respondWithFilteredResult(_0x35352e,_0x5a46bb){return function(_0x4b015f){if(_0x4b015f){var _0x4dbf0b=typeof _0x5a46bb[_0xe758('0x2f')]==='undefined'&&typeof _0x5a46bb[_0xe758('0x30')]==='undefined';var _0x39c907=_0x4b015f['count'];var _0x485aa6=_0x4dbf0b?0x0:_0x5a46bb[_0xe758('0x2f')];var _0x26d559=_0x4dbf0b?_0x4b015f[_0xe758('0x31')]:_0x5a46bb[_0xe758('0x2f')]+_0x5a46bb['limit'];var _0x39a360;if(_0x26d559>=_0x39c907){_0x26d559=_0x39c907;_0x39a360=0xc8;}else{_0x39a360=0xce;}_0x35352e[_0xe758('0x2c')](_0x39a360);return _0x35352e['set']('Content-Range',_0x485aa6+'-'+_0x26d559+'/'+_0x39c907)[_0xe758('0x2e')](_0x4b015f);}return null;};}function patchUpdates(_0x46c628){return function(_0x3c7b00){try{jsonpatch[_0xe758('0x32')](_0x3c7b00,_0x46c628,!![]);}catch(_0x4f5e6c){return BPromise[_0xe758('0x33')](_0x4f5e6c);}return _0x3c7b00[_0xe758('0x34')]();};}function saveUpdates(_0x35a638,_0x1e3285){return function(_0x110ce0){if(_0x110ce0){return _0x110ce0[_0xe758('0x35')](_0x35a638)[_0xe758('0x20')](function(_0x196c36){return _0x196c36;});}return null;};}function removeEntity(_0x184c39,_0x4f2130){return function(_0x7417ad){if(_0x7417ad){return _0x7417ad['destroy']()[_0xe758('0x20')](function(){_0x184c39[_0xe758('0x2c')](0xcc)[_0xe758('0x2d')]();});}};}function handleEntityNotFound(_0x274c28,_0xa33c11){return function(_0x17c41d){if(!_0x17c41d){_0x274c28['sendStatus'](0x194);}return _0x17c41d;};}function handleError(_0x55ddcb,_0x34ad7b){_0x34ad7b=_0x34ad7b||0x1f4;return function(_0xfe4b3d){logger[_0xe758('0x27')](_0xfe4b3d[_0xe758('0x36')]);if(_0xfe4b3d[_0xe758('0x37')]){delete _0xfe4b3d[_0xe758('0x37')];}_0x55ddcb[_0xe758('0x2c')](_0x34ad7b)[_0xe758('0x38')](_0xfe4b3d);};}exports[_0xe758('0x39')]=function(_0x2b1df1,_0x2fb62c){var _0x3b0166={},_0x2ebdd8={},_0x32d716={'count':0x0,'rows':[]};var _0x4854af=_[_0xe758('0x3a')](db[_0xe758('0x3b')]['rawAttributes'],function(_0x1257e4){return{'name':_0x1257e4[_0xe758('0x3c')],'type':_0x1257e4[_0xe758('0x3d')][_0xe758('0x3e')]};});_0x2ebdd8['model']=_['map'](_0x4854af,_0xe758('0x37'));_0x2ebdd8[_0xe758('0x3f')]=_['keys'](_0x2b1df1[_0xe758('0x3f')]);_0x2ebdd8[_0xe758('0x40')]=_[_0xe758('0x41')](_0x2ebdd8['model'],_0x2ebdd8[_0xe758('0x3f')]);_0x3b0166['attributes']=_[_0xe758('0x41')](_0x2ebdd8[_0xe758('0x42')],qs[_0xe758('0x43')](_0x2b1df1[_0xe758('0x3f')][_0xe758('0x43')]));_0x3b0166[_0xe758('0x44')]=_0x3b0166[_0xe758('0x44')][_0xe758('0x45')]?_0x3b0166['attributes']:_0x2ebdd8[_0xe758('0x42')];if(!_0x2b1df1[_0xe758('0x3f')][_0xe758('0x46')](_0xe758('0x47'))){_0x3b0166['limit']=qs[_0xe758('0x30')](_0x2b1df1[_0xe758('0x3f')][_0xe758('0x30')]);_0x3b0166[_0xe758('0x2f')]=qs[_0xe758('0x2f')](_0x2b1df1['query'][_0xe758('0x2f')]);}_0x3b0166[_0xe758('0x48')]=qs[_0xe758('0x49')](_0x2b1df1[_0xe758('0x3f')][_0xe758('0x49')]);_0x3b0166[_0xe758('0x4a')]=qs[_0xe758('0x40')](_['pick'](_0x2b1df1[_0xe758('0x3f')],_0x2ebdd8[_0xe758('0x40')]),_0x4854af);if(_0x2b1df1[_0xe758('0x3f')][_0xe758('0x4b')]){_0x3b0166[_0xe758('0x4a')]=_[_0xe758('0x4c')](_0x3b0166[_0xe758('0x4a')],{'$or':_['map'](_0x4854af,function(_0x18b3eb){if(_0x18b3eb['type']!=='VIRTUAL'){var _0x28f3ee={};_0x28f3ee[_0x18b3eb[_0xe758('0x37')]]={'$like':'%'+_0x2b1df1[_0xe758('0x3f')][_0xe758('0x4b')]+'%'};return _0x28f3ee;}})});}_0x3b0166=_[_0xe758('0x4c')]({},_0x3b0166,_0x2b1df1['options']);var _0x22c568={'where':_0x3b0166[_0xe758('0x4a')]};return db[_0xe758('0x3b')][_0xe758('0x31')](_0x22c568)[_0xe758('0x20')](function(_0x4a791f){_0x32d716['count']=_0x4a791f;if(_0x2b1df1[_0xe758('0x3f')][_0xe758('0x4d')]){_0x3b0166[_0xe758('0x4e')]=[{'all':!![]}];}return db[_0xe758('0x3b')]['findAll'](_0x3b0166);})[_0xe758('0x20')](function(_0xde30d3){_0x32d716[_0xe758('0x4f')]=_0xde30d3;return _0x32d716;})[_0xe758('0x20')](respondWithFilteredResult(_0x2fb62c,_0x3b0166))[_0xe758('0x2a')](handleError(_0x2fb62c,null));};exports[_0xe758('0x50')]=function(_0x538207,_0xc87d9e){var _0x6f04ba={'raw':![],'where':{'id':_0x538207['params']['id']}},_0x522569={};_0x522569['model']=_['keys'](db[_0xe758('0x3b')][_0xe758('0x51')]);_0x522569[_0xe758('0x3f')]=_['keys'](_0x538207[_0xe758('0x3f')]);_0x522569[_0xe758('0x40')]=_[_0xe758('0x41')](_0x522569[_0xe758('0x42')],_0x522569[_0xe758('0x3f')]);_0x6f04ba['attributes']=_[_0xe758('0x41')](_0x522569[_0xe758('0x42')],qs['fields'](_0x538207[_0xe758('0x3f')][_0xe758('0x43')]));_0x6f04ba[_0xe758('0x44')]=_0x6f04ba[_0xe758('0x44')][_0xe758('0x45')]?_0x6f04ba['attributes']:_0x522569[_0xe758('0x42')];if(_0x538207[_0xe758('0x3f')][_0xe758('0x4d')]){_0x6f04ba[_0xe758('0x4e')]=[{'all':!![]}];}_0x6f04ba=_['merge']({},_0x6f04ba,_0x538207[_0xe758('0x52')]);return db[_0xe758('0x3b')][_0xe758('0x53')](_0x6f04ba)[_0xe758('0x20')](handleEntityNotFound(_0xc87d9e,null))['then'](respondWithResult(_0xc87d9e,null))['catch'](handleError(_0xc87d9e,null));};exports[_0xe758('0x54')]=function(_0x5e20ea,_0x17851){return db[_0xe758('0x3b')]['create'](_0x5e20ea[_0xe758('0x55')],{})[_0xe758('0x20')](respondWithResult(_0x17851,0xc9))[_0xe758('0x2a')](handleError(_0x17851,null));};exports['update']=function(_0x2f4cd3,_0x14e917){if(_0x2f4cd3['body']['id']){delete _0x2f4cd3['body']['id'];}return db[_0xe758('0x3b')][_0xe758('0x53')]({'where':{'id':_0x2f4cd3[_0xe758('0x56')]['id']}})[_0xe758('0x20')](handleEntityNotFound(_0x14e917,null))['then'](saveUpdates(_0x2f4cd3['body'],null))[_0xe758('0x20')](respondWithResult(_0x14e917,null))[_0xe758('0x2a')](handleError(_0x14e917,null));};exports[_0xe758('0x57')]=function(_0x3aece4,_0x2899fc){return db[_0xe758('0x3b')]['find']({'where':{'id':_0x3aece4['params']['id']}})[_0xe758('0x20')](handleEntityNotFound(_0x2899fc,null))[_0xe758('0x20')](removeEntity(_0x2899fc,null))['catch'](handleError(_0x2899fc,null));};exports['getSubjects']=function(_0x57e123,_0x43471e,_0x43e33d){var _0x1ed07c={};var _0x5ad5e1={};var _0x11fd50;var _0xb3c0c6;return db[_0xe758('0x3b')][_0xe758('0x58')]({'where':{'id':_0x57e123[_0xe758('0x56')]['id']}})['then'](handleEntityNotFound(_0x43471e,null))['then'](function(_0x5892c4){if(_0x5892c4){_0x11fd50=_0x5892c4;_0x5ad5e1[_0xe758('0x42')]=_[_0xe758('0x59')](db['FreshsalesField'][_0xe758('0x51')]);_0x5ad5e1[_0xe758('0x3f')]=_[_0xe758('0x59')](_0x57e123[_0xe758('0x3f')]);_0x5ad5e1['filters']=_[_0xe758('0x41')](_0x5ad5e1['model'],_0x5ad5e1[_0xe758('0x3f')]);_0x1ed07c['attributes']=_[_0xe758('0x41')](_0x5ad5e1[_0xe758('0x42')],qs[_0xe758('0x43')](_0x57e123['query']['fields']));_0x1ed07c[_0xe758('0x44')]=_0x1ed07c[_0xe758('0x44')][_0xe758('0x45')]?_0x1ed07c[_0xe758('0x44')]:_0x5ad5e1['model'];_0x1ed07c['order']=qs[_0xe758('0x49')](_0x57e123[_0xe758('0x3f')]['sort']);_0x1ed07c[_0xe758('0x4a')]=qs[_0xe758('0x40')](_[_0xe758('0x5a')](_0x57e123[_0xe758('0x3f')],_0x5ad5e1[_0xe758('0x40')]));if(_0x57e123['query'][_0xe758('0x4b')]){_0x1ed07c[_0xe758('0x4a')]=_[_0xe758('0x4c')](_0x1ed07c[_0xe758('0x4a')],{'$or':_[_0xe758('0x3a')](_0x1ed07c[_0xe758('0x44')],function(_0x4ac7ed){var _0x57f4e6={};_0x57f4e6[_0x4ac7ed]={'$like':'%'+_0x57e123[_0xe758('0x3f')][_0xe758('0x4b')]+'%'};return _0x57f4e6;})});}_0x1ed07c=_[_0xe758('0x4c')]({},_0x1ed07c,_0x57e123[_0xe758('0x52')]);return _0x11fd50[_0xe758('0x5b')](_0x1ed07c);}})['then'](function(_0x209499){if(_0x209499){_0xb3c0c6=_0x209499[_0xe758('0x45')];if(!_0x57e123[_0xe758('0x3f')][_0xe758('0x46')](_0xe758('0x47'))){_0x1ed07c[_0xe758('0x30')]=qs['limit'](_0x57e123['query'][_0xe758('0x30')]);_0x1ed07c[_0xe758('0x2f')]=qs['offset'](_0x57e123[_0xe758('0x3f')][_0xe758('0x2f')]);}return _0x11fd50[_0xe758('0x5b')](_0x1ed07c);}})[_0xe758('0x20')](function(_0x4ae0ce){if(_0x4ae0ce){return _0x4ae0ce?{'count':_0xb3c0c6,'rows':_0x4ae0ce}:null;}})['then'](respondWithResult(_0x43471e,null))[_0xe758('0x2a')](handleError(_0x43471e,null));};exports[_0xe758('0x5c')]=function(_0xad6d44,_0x49e81f,_0x24377d){var _0x2d8994={};var _0x104523={};var _0x5ec3be;var _0x50bcbf;return db[_0xe758('0x3b')][_0xe758('0x58')]({'where':{'id':_0xad6d44[_0xe758('0x56')]['id']}})[_0xe758('0x20')](handleEntityNotFound(_0x49e81f,null))[_0xe758('0x20')](function(_0x51a2aa){if(_0x51a2aa){_0x5ec3be=_0x51a2aa;_0x104523[_0xe758('0x42')]=_[_0xe758('0x59')](db[_0xe758('0x5d')][_0xe758('0x51')]);_0x104523['query']=_[_0xe758('0x59')](_0xad6d44[_0xe758('0x3f')]);_0x104523[_0xe758('0x40')]=_[_0xe758('0x41')](_0x104523[_0xe758('0x42')],_0x104523[_0xe758('0x3f')]);_0x2d8994[_0xe758('0x44')]=_[_0xe758('0x41')](_0x104523[_0xe758('0x42')],qs[_0xe758('0x43')](_0xad6d44[_0xe758('0x3f')][_0xe758('0x43')]));_0x2d8994[_0xe758('0x44')]=_0x2d8994[_0xe758('0x44')][_0xe758('0x45')]?_0x2d8994[_0xe758('0x44')]:_0x104523[_0xe758('0x42')];_0x2d8994[_0xe758('0x48')]=qs['sort'](_0xad6d44[_0xe758('0x3f')][_0xe758('0x49')]);_0x2d8994[_0xe758('0x4a')]=qs[_0xe758('0x40')](_[_0xe758('0x5a')](_0xad6d44['query'],_0x104523['filters']));if(_0xad6d44[_0xe758('0x3f')][_0xe758('0x4b')]){_0x2d8994[_0xe758('0x4a')]=_[_0xe758('0x4c')](_0x2d8994[_0xe758('0x4a')],{'$or':_[_0xe758('0x3a')](_0x2d8994['attributes'],function(_0x1e350d){var _0x1c8226={};_0x1c8226[_0x1e350d]={'$like':'%'+_0xad6d44['query'][_0xe758('0x4b')]+'%'};return _0x1c8226;})});}_0x2d8994=_[_0xe758('0x4c')]({},_0x2d8994,_0xad6d44[_0xe758('0x52')]);return _0x5ec3be[_0xe758('0x5c')](_0x2d8994);}})[_0xe758('0x20')](function(_0x3f1940){if(_0x3f1940){_0x50bcbf=_0x3f1940[_0xe758('0x45')];if(!_0xad6d44[_0xe758('0x3f')][_0xe758('0x46')](_0xe758('0x47'))){_0x2d8994[_0xe758('0x30')]=qs[_0xe758('0x30')](_0xad6d44[_0xe758('0x3f')]['limit']);_0x2d8994[_0xe758('0x2f')]=qs[_0xe758('0x2f')](_0xad6d44[_0xe758('0x3f')][_0xe758('0x2f')]);}return _0x5ec3be[_0xe758('0x5c')](_0x2d8994);}})[_0xe758('0x20')](function(_0x142fbf){if(_0x142fbf){return _0x142fbf?{'count':_0x50bcbf,'rows':_0x142fbf}:null;}})[_0xe758('0x20')](respondWithResult(_0x49e81f,null))['catch'](handleError(_0x49e81f,null));};exports[_0xe758('0x5e')]=function(_0x1f9fd8,_0x5e6aaf,_0xb35dd2){var _0x4c1f3c={};var _0x4363e9={};var _0x3c9fac;var _0x5e91d4;return db[_0xe758('0x3b')][_0xe758('0x58')]({'where':{'id':_0x1f9fd8[_0xe758('0x56')]['id']}})[_0xe758('0x20')](handleEntityNotFound(_0x5e6aaf,null))[_0xe758('0x20')](function(_0x4257ab){if(_0x4257ab){_0x3c9fac=_0x4257ab;_0x4363e9[_0xe758('0x42')]=_[_0xe758('0x59')](db[_0xe758('0x5d')][_0xe758('0x51')]);_0x4363e9[_0xe758('0x3f')]=_[_0xe758('0x59')](_0x1f9fd8[_0xe758('0x3f')]);_0x4363e9['filters']=_[_0xe758('0x41')](_0x4363e9[_0xe758('0x42')],_0x4363e9[_0xe758('0x3f')]);_0x4c1f3c[_0xe758('0x44')]=_['intersection'](_0x4363e9['model'],qs[_0xe758('0x43')](_0x1f9fd8[_0xe758('0x3f')][_0xe758('0x43')]));_0x4c1f3c[_0xe758('0x44')]=_0x4c1f3c[_0xe758('0x44')]['length']?_0x4c1f3c[_0xe758('0x44')]:_0x4363e9[_0xe758('0x42')];_0x4c1f3c['order']=qs['sort'](_0x1f9fd8['query'][_0xe758('0x49')]);_0x4c1f3c['where']=qs[_0xe758('0x40')](_[_0xe758('0x5a')](_0x1f9fd8[_0xe758('0x3f')],_0x4363e9[_0xe758('0x40')]));if(_0x1f9fd8[_0xe758('0x3f')]['filter']){_0x4c1f3c[_0xe758('0x4a')]=_[_0xe758('0x4c')](_0x4c1f3c[_0xe758('0x4a')],{'$or':_[_0xe758('0x3a')](_0x4c1f3c[_0xe758('0x44')],function(_0x320823){var _0x1224f9={};_0x1224f9[_0x320823]={'$like':'%'+_0x1f9fd8[_0xe758('0x3f')][_0xe758('0x4b')]+'%'};return _0x1224f9;})});}_0x4c1f3c=_[_0xe758('0x4c')]({},_0x4c1f3c,_0x1f9fd8['options']);return _0x3c9fac[_0xe758('0x5e')](_0x4c1f3c);}})[_0xe758('0x20')](function(_0x18e376){if(_0x18e376){_0x5e91d4=_0x18e376['length'];if(!_0x1f9fd8[_0xe758('0x3f')][_0xe758('0x46')]('nolimit')){_0x4c1f3c[_0xe758('0x30')]=qs[_0xe758('0x30')](_0x1f9fd8[_0xe758('0x3f')][_0xe758('0x30')]);_0x4c1f3c['offset']=qs[_0xe758('0x2f')](_0x1f9fd8['query'][_0xe758('0x2f')]);}return _0x3c9fac['getFields'](_0x4c1f3c);}})[_0xe758('0x20')](function(_0x609d0b){if(_0x609d0b){return _0x609d0b?{'count':_0x5e91d4,'rows':_0x609d0b}:null;}})[_0xe758('0x20')](respondWithResult(_0x5e6aaf,null))[_0xe758('0x2a')](handleError(_0x5e6aaf,null));};
\ No newline at end of file
+var _0x01dc=['stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','FreshsalesConfiguration','findAll','rows','params','keys','includeAll','include','body','find','findOne','FreshsalesField','getSubjects','getDescriptions','order','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xda0e17,_0x3db08b){var _0x441135=function(_0x293190){while(--_0x293190){_0xda0e17['push'](_0xda0e17['shift']());}};_0x441135(++_0x3db08b);}(_0x01dc,0x1bb));var _0xc01d=function(_0x3b386a,_0x3a33c5){_0x3b386a=_0x3b386a-0x0;var _0x468fbe=_0x01dc[_0x3b386a];return _0x468fbe;};'use strict';var emlformat=require(_0xc01d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc01d('0x1'));var jsonpatch=require(_0xc01d('0x2'));var rp=require(_0xc01d('0x3'));var moment=require(_0xc01d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc01d('0x5'));var util=require('util');var path=require(_0xc01d('0x6'));var sox=require(_0xc01d('0x7'));var csv=require(_0xc01d('0x8'));var ejs=require(_0xc01d('0x9'));var fs=require('fs');var fs_extra=require(_0xc01d('0xa'));var _=require(_0xc01d('0xb'));var squel=require(_0xc01d('0xc'));var crypto=require(_0xc01d('0xd'));var jsforce=require(_0xc01d('0xe'));var deskjs=require(_0xc01d('0xf'));var toCsv=require(_0xc01d('0x8'));var querystring=require(_0xc01d('0x10'));var Papa=require(_0xc01d('0x11'));var Redis=require(_0xc01d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc01d('0x13'));var as=require(_0xc01d('0x14'));var hardwareService=require(_0xc01d('0x15'));var logger=require(_0xc01d('0x16'))(_0xc01d('0x17'));var utils=require('../../config/utils');var config=require(_0xc01d('0x18'));var licenseUtil=require(_0xc01d('0x19'));var db=require(_0xc01d('0x1a'))['db'];var jayson=require(_0xc01d('0x1b'));var client=jayson[_0xc01d('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ac933,_0x47fa22,_0x370a6f,_0x2328b3){return new BPromise(function(_0x399cc7,_0xdcd6b2){var _0x166bd4=_0x2328b3||client;return _0x166bd4['request'](_0x4ac933,_0x370a6f)['then'](function(_0x50a7a7){logger[_0xc01d('0x1d')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x47fa22,'request\x20sent');logger[_0xc01d('0x1e')](_0xc01d('0x1f'),_0x47fa22,'request\x20sent',JSON[_0xc01d('0x20')](_0x50a7a7));if(_0x50a7a7[_0xc01d('0x21')]){if(_0x50a7a7[_0xc01d('0x21')]['code']===0x1f4){logger[_0xc01d('0x21')](_0xc01d('0x22'),_0x47fa22,_0x50a7a7[_0xc01d('0x21')][_0xc01d('0x23')]);return _0xdcd6b2(_0x50a7a7['error'][_0xc01d('0x23')]);}logger[_0xc01d('0x21')](_0xc01d('0x22'),_0x47fa22,_0x50a7a7[_0xc01d('0x21')][_0xc01d('0x23')]);return _0x399cc7(_0x50a7a7[_0xc01d('0x21')]['message']);}else{logger[_0xc01d('0x1d')](_0xc01d('0x22'),_0x47fa22,_0xc01d('0x24'));_0x399cc7(_0x50a7a7[_0xc01d('0x25')][_0xc01d('0x23')]);}})[_0xc01d('0x26')](function(_0x34bba9){logger[_0xc01d('0x21')](_0xc01d('0x22'),_0x47fa22,_0x34bba9);_0xdcd6b2(_0x34bba9);});});}function respondWithStatusCode(_0x47fd18,_0xb91618){_0xb91618=_0xb91618||0xcc;return function(_0x36ad37){if(_0x36ad37){return _0x47fd18['sendStatus'](_0xb91618);}return _0x47fd18[_0xc01d('0x27')](_0xb91618)[_0xc01d('0x28')]();};}function respondWithResult(_0x51dded,_0x177343){_0x177343=_0x177343||0xc8;return function(_0x5d95d9){if(_0x5d95d9){return _0x51dded[_0xc01d('0x27')](_0x177343)['json'](_0x5d95d9);}};}function respondWithFilteredResult(_0x31d310,_0x517e18){return function(_0x21132b){if(_0x21132b){var _0x251f0c=typeof _0x517e18[_0xc01d('0x29')]==='undefined'&&typeof _0x517e18['limit']===_0xc01d('0x2a');var _0x22185d=_0x21132b['count'];var _0x32a956=_0x251f0c?0x0:_0x517e18[_0xc01d('0x29')];var _0x563097=_0x251f0c?_0x21132b[_0xc01d('0x2b')]:_0x517e18[_0xc01d('0x29')]+_0x517e18[_0xc01d('0x2c')];var _0x4fae63;if(_0x563097>=_0x22185d){_0x563097=_0x22185d;_0x4fae63=0xc8;}else{_0x4fae63=0xce;}_0x31d310[_0xc01d('0x27')](_0x4fae63);return _0x31d310[_0xc01d('0x2d')](_0xc01d('0x2e'),_0x32a956+'-'+_0x563097+'/'+_0x22185d)[_0xc01d('0x2f')](_0x21132b);}return null;};}function patchUpdates(_0x5a7697){return function(_0x488f88){try{jsonpatch[_0xc01d('0x30')](_0x488f88,_0x5a7697,!![]);}catch(_0x109cda){return BPromise[_0xc01d('0x31')](_0x109cda);}return _0x488f88[_0xc01d('0x32')]();};}function saveUpdates(_0x107a13,_0x316819){return function(_0x5250ab){if(_0x5250ab){return _0x5250ab[_0xc01d('0x33')](_0x107a13)[_0xc01d('0x34')](function(_0xae5fe7){return _0xae5fe7;});}return null;};}function removeEntity(_0x1610b8,_0x3d473e){return function(_0x146dcd){if(_0x146dcd){return _0x146dcd[_0xc01d('0x35')]()[_0xc01d('0x34')](function(){_0x1610b8[_0xc01d('0x27')](0xcc)[_0xc01d('0x28')]();});}};}function handleEntityNotFound(_0x3a24a1,_0x10f002){return function(_0x2a18e4){if(!_0x2a18e4){_0x3a24a1[_0xc01d('0x36')](0x194);}return _0x2a18e4;};}function handleError(_0x5a4f69,_0x36ab63){_0x36ab63=_0x36ab63||0x1f4;return function(_0x396b20){logger[_0xc01d('0x21')](_0x396b20[_0xc01d('0x37')]);if(_0x396b20[_0xc01d('0x38')]){delete _0x396b20[_0xc01d('0x38')];}_0x5a4f69['status'](_0x36ab63)[_0xc01d('0x39')](_0x396b20);};}exports[_0xc01d('0x3a')]=function(_0x249325,_0x3d57f3){var _0x24a325={},_0x5c6837={},_0x28e33c={'count':0x0,'rows':[]};var _0x23c4ed=_[_0xc01d('0x3b')](db['FreshsalesConfiguration'][_0xc01d('0x3c')],function(_0x1c7495){return{'name':_0x1c7495[_0xc01d('0x3d')],'type':_0x1c7495['type'][_0xc01d('0x3e')]};});_0x5c6837['model']=_[_0xc01d('0x3b')](_0x23c4ed,_0xc01d('0x38'));_0x5c6837[_0xc01d('0x3f')]=_['keys'](_0x249325[_0xc01d('0x3f')]);_0x5c6837[_0xc01d('0x40')]=_[_0xc01d('0x41')](_0x5c6837[_0xc01d('0x42')],_0x5c6837[_0xc01d('0x3f')]);_0x24a325[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0x5c6837[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x249325[_0xc01d('0x3f')][_0xc01d('0x44')]));_0x24a325[_0xc01d('0x43')]=_0x24a325[_0xc01d('0x43')][_0xc01d('0x45')]?_0x24a325[_0xc01d('0x43')]:_0x5c6837[_0xc01d('0x42')];if(!_0x249325[_0xc01d('0x3f')][_0xc01d('0x46')](_0xc01d('0x47'))){_0x24a325[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x249325['query'][_0xc01d('0x2c')]);_0x24a325['offset']=qs[_0xc01d('0x29')](_0x249325[_0xc01d('0x3f')][_0xc01d('0x29')]);}_0x24a325['order']=qs[_0xc01d('0x48')](_0x249325[_0xc01d('0x3f')][_0xc01d('0x48')]);_0x24a325[_0xc01d('0x49')]=qs['filters'](_[_0xc01d('0x4a')](_0x249325[_0xc01d('0x3f')],_0x5c6837['filters']),_0x23c4ed);if(_0x249325['query'][_0xc01d('0x4b')]){_0x24a325[_0xc01d('0x49')]=_['merge'](_0x24a325[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0x23c4ed,function(_0x542a46){if(_0x542a46[_0xc01d('0x4c')]!==_0xc01d('0x4d')){var _0x1bca4e={};_0x1bca4e[_0x542a46[_0xc01d('0x38')]]={'$like':'%'+_0x249325[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x1bca4e;}})});}_0x24a325=_[_0xc01d('0x4e')]({},_0x24a325,_0x249325[_0xc01d('0x4f')]);var _0x23d548={'where':_0x24a325[_0xc01d('0x49')]};return db[_0xc01d('0x50')][_0xc01d('0x2b')](_0x23d548)['then'](function(_0x44c9bf){_0x28e33c['count']=_0x44c9bf;if(_0x249325[_0xc01d('0x3f')]['includeAll']){_0x24a325['include']=[{'all':!![]}];}return db[_0xc01d('0x50')][_0xc01d('0x51')](_0x24a325);})[_0xc01d('0x34')](function(_0x5cbbb8){_0x28e33c[_0xc01d('0x52')]=_0x5cbbb8;return _0x28e33c;})['then'](respondWithFilteredResult(_0x3d57f3,_0x24a325))[_0xc01d('0x26')](handleError(_0x3d57f3,null));};exports['show']=function(_0x39181d,_0x45c00c){var _0x45fcdc={'raw':![],'where':{'id':_0x39181d[_0xc01d('0x53')]['id']}},_0xdb8683={};_0xdb8683['model']=_[_0xc01d('0x54')](db[_0xc01d('0x50')][_0xc01d('0x3c')]);_0xdb8683['query']=_[_0xc01d('0x54')](_0x39181d[_0xc01d('0x3f')]);_0xdb8683[_0xc01d('0x40')]=_['intersection'](_0xdb8683[_0xc01d('0x42')],_0xdb8683[_0xc01d('0x3f')]);_0x45fcdc[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0xdb8683[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x39181d[_0xc01d('0x3f')][_0xc01d('0x44')]));_0x45fcdc[_0xc01d('0x43')]=_0x45fcdc['attributes'][_0xc01d('0x45')]?_0x45fcdc[_0xc01d('0x43')]:_0xdb8683[_0xc01d('0x42')];if(_0x39181d['query'][_0xc01d('0x55')]){_0x45fcdc[_0xc01d('0x56')]=[{'all':!![]}];}_0x45fcdc=_[_0xc01d('0x4e')]({},_0x45fcdc,_0x39181d[_0xc01d('0x4f')]);return db['FreshsalesConfiguration']['find'](_0x45fcdc)[_0xc01d('0x34')](handleEntityNotFound(_0x45c00c,null))[_0xc01d('0x34')](respondWithResult(_0x45c00c,null))['catch'](handleError(_0x45c00c,null));};exports['create']=function(_0x827e05,_0x243307){return db[_0xc01d('0x50')]['create'](_0x827e05[_0xc01d('0x57')],{})['then'](respondWithResult(_0x243307,0xc9))['catch'](handleError(_0x243307,null));};exports[_0xc01d('0x33')]=function(_0x42c74c,_0x162779){if(_0x42c74c[_0xc01d('0x57')]['id']){delete _0x42c74c['body']['id'];}return db[_0xc01d('0x50')][_0xc01d('0x58')]({'where':{'id':_0x42c74c[_0xc01d('0x53')]['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x162779,null))[_0xc01d('0x34')](saveUpdates(_0x42c74c[_0xc01d('0x57')],null))[_0xc01d('0x34')](respondWithResult(_0x162779,null))[_0xc01d('0x26')](handleError(_0x162779,null));};exports[_0xc01d('0x35')]=function(_0x2fb5ff,_0x1d4ddf){return db[_0xc01d('0x50')][_0xc01d('0x58')]({'where':{'id':_0x2fb5ff[_0xc01d('0x53')]['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x1d4ddf,null))['then'](removeEntity(_0x1d4ddf,null))[_0xc01d('0x26')](handleError(_0x1d4ddf,null));};exports['getSubjects']=function(_0x48e265,_0x449065,_0x127896){var _0xc86479={};var _0x2cb054={};var _0xbac2e3;var _0x508d0a;return db[_0xc01d('0x50')][_0xc01d('0x59')]({'where':{'id':_0x48e265[_0xc01d('0x53')]['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x449065,null))[_0xc01d('0x34')](function(_0x7f1ec){if(_0x7f1ec){_0xbac2e3=_0x7f1ec;_0x2cb054[_0xc01d('0x42')]=_[_0xc01d('0x54')](db[_0xc01d('0x5a')][_0xc01d('0x3c')]);_0x2cb054[_0xc01d('0x3f')]=_[_0xc01d('0x54')](_0x48e265[_0xc01d('0x3f')]);_0x2cb054[_0xc01d('0x40')]=_[_0xc01d('0x41')](_0x2cb054['model'],_0x2cb054['query']);_0xc86479['attributes']=_['intersection'](_0x2cb054[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x44')]));_0xc86479[_0xc01d('0x43')]=_0xc86479[_0xc01d('0x43')][_0xc01d('0x45')]?_0xc86479[_0xc01d('0x43')]:_0x2cb054[_0xc01d('0x42')];_0xc86479['order']=qs['sort'](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x48')]);_0xc86479[_0xc01d('0x49')]=qs[_0xc01d('0x40')](_[_0xc01d('0x4a')](_0x48e265['query'],_0x2cb054[_0xc01d('0x40')]));if(_0x48e265[_0xc01d('0x3f')][_0xc01d('0x4b')]){_0xc86479[_0xc01d('0x49')]=_[_0xc01d('0x4e')](_0xc86479[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0xc86479[_0xc01d('0x43')],function(_0x123ade){var _0x519bb4={};_0x519bb4[_0x123ade]={'$like':'%'+_0x48e265[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x519bb4;})});}_0xc86479=_['merge']({},_0xc86479,_0x48e265['options']);return _0xbac2e3[_0xc01d('0x5b')](_0xc86479);}})[_0xc01d('0x34')](function(_0xe8f2c2){if(_0xe8f2c2){_0x508d0a=_0xe8f2c2[_0xc01d('0x45')];if(!_0x48e265['query'][_0xc01d('0x46')](_0xc01d('0x47'))){_0xc86479[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x2c')]);_0xc86479[_0xc01d('0x29')]=qs[_0xc01d('0x29')](_0x48e265[_0xc01d('0x3f')][_0xc01d('0x29')]);}return _0xbac2e3['getSubjects'](_0xc86479);}})[_0xc01d('0x34')](function(_0x3a8f0a){if(_0x3a8f0a){return _0x3a8f0a?{'count':_0x508d0a,'rows':_0x3a8f0a}:null;}})['then'](respondWithResult(_0x449065,null))['catch'](handleError(_0x449065,null));};exports[_0xc01d('0x5c')]=function(_0x45b597,_0x579137,_0x420dfc){var _0xcda393={};var _0x364121={};var _0x1e66c6;var _0x1ebd3a;return db[_0xc01d('0x50')][_0xc01d('0x59')]({'where':{'id':_0x45b597['params']['id']}})[_0xc01d('0x34')](handleEntityNotFound(_0x579137,null))[_0xc01d('0x34')](function(_0x21e8e8){if(_0x21e8e8){_0x1e66c6=_0x21e8e8;_0x364121[_0xc01d('0x42')]=_[_0xc01d('0x54')](db[_0xc01d('0x5a')][_0xc01d('0x3c')]);_0x364121[_0xc01d('0x3f')]=_[_0xc01d('0x54')](_0x45b597[_0xc01d('0x3f')]);_0x364121[_0xc01d('0x40')]=_[_0xc01d('0x41')](_0x364121[_0xc01d('0x42')],_0x364121['query']);_0xcda393[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0x364121[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x45b597['query'][_0xc01d('0x44')]));_0xcda393[_0xc01d('0x43')]=_0xcda393[_0xc01d('0x43')][_0xc01d('0x45')]?_0xcda393[_0xc01d('0x43')]:_0x364121[_0xc01d('0x42')];_0xcda393[_0xc01d('0x5d')]=qs['sort'](_0x45b597[_0xc01d('0x3f')][_0xc01d('0x48')]);_0xcda393[_0xc01d('0x49')]=qs['filters'](_[_0xc01d('0x4a')](_0x45b597[_0xc01d('0x3f')],_0x364121[_0xc01d('0x40')]));if(_0x45b597[_0xc01d('0x3f')]['filter']){_0xcda393[_0xc01d('0x49')]=_[_0xc01d('0x4e')](_0xcda393[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0xcda393[_0xc01d('0x43')],function(_0x53eb26){var _0x443d26={};_0x443d26[_0x53eb26]={'$like':'%'+_0x45b597[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x443d26;})});}_0xcda393=_[_0xc01d('0x4e')]({},_0xcda393,_0x45b597[_0xc01d('0x4f')]);return _0x1e66c6[_0xc01d('0x5c')](_0xcda393);}})['then'](function(_0x142eee){if(_0x142eee){_0x1ebd3a=_0x142eee[_0xc01d('0x45')];if(!_0x45b597[_0xc01d('0x3f')][_0xc01d('0x46')](_0xc01d('0x47'))){_0xcda393[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x45b597[_0xc01d('0x3f')][_0xc01d('0x2c')]);_0xcda393['offset']=qs[_0xc01d('0x29')](_0x45b597[_0xc01d('0x3f')][_0xc01d('0x29')]);}return _0x1e66c6[_0xc01d('0x5c')](_0xcda393);}})['then'](function(_0x1416eb){if(_0x1416eb){return _0x1416eb?{'count':_0x1ebd3a,'rows':_0x1416eb}:null;}})[_0xc01d('0x34')](respondWithResult(_0x579137,null))[_0xc01d('0x26')](handleError(_0x579137,null));};exports['getFields']=function(_0x20a163,_0x633b75,_0x518f3a){var _0x158f76={};var _0x11f551={};var _0x1ea90f;var _0x28c5ac;return db[_0xc01d('0x50')]['findOne']({'where':{'id':_0x20a163['params']['id']}})['then'](handleEntityNotFound(_0x633b75,null))[_0xc01d('0x34')](function(_0x547cf9){if(_0x547cf9){_0x1ea90f=_0x547cf9;_0x11f551[_0xc01d('0x42')]=_[_0xc01d('0x54')](db[_0xc01d('0x5a')][_0xc01d('0x3c')]);_0x11f551['query']=_[_0xc01d('0x54')](_0x20a163[_0xc01d('0x3f')]);_0x11f551[_0xc01d('0x40')]=_['intersection'](_0x11f551[_0xc01d('0x42')],_0x11f551[_0xc01d('0x3f')]);_0x158f76[_0xc01d('0x43')]=_[_0xc01d('0x41')](_0x11f551[_0xc01d('0x42')],qs[_0xc01d('0x44')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x44')]));_0x158f76[_0xc01d('0x43')]=_0x158f76[_0xc01d('0x43')]['length']?_0x158f76[_0xc01d('0x43')]:_0x11f551[_0xc01d('0x42')];_0x158f76[_0xc01d('0x5d')]=qs[_0xc01d('0x48')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x48')]);_0x158f76[_0xc01d('0x49')]=qs['filters'](_['pick'](_0x20a163[_0xc01d('0x3f')],_0x11f551[_0xc01d('0x40')]));if(_0x20a163[_0xc01d('0x3f')][_0xc01d('0x4b')]){_0x158f76[_0xc01d('0x49')]=_[_0xc01d('0x4e')](_0x158f76[_0xc01d('0x49')],{'$or':_[_0xc01d('0x3b')](_0x158f76['attributes'],function(_0x19bdaf){var _0x8a93e8={};_0x8a93e8[_0x19bdaf]={'$like':'%'+_0x20a163[_0xc01d('0x3f')][_0xc01d('0x4b')]+'%'};return _0x8a93e8;})});}_0x158f76=_[_0xc01d('0x4e')]({},_0x158f76,_0x20a163[_0xc01d('0x4f')]);return _0x1ea90f[_0xc01d('0x5e')](_0x158f76);}})[_0xc01d('0x34')](function(_0x306f71){if(_0x306f71){_0x28c5ac=_0x306f71['length'];if(!_0x20a163[_0xc01d('0x3f')][_0xc01d('0x46')](_0xc01d('0x47'))){_0x158f76[_0xc01d('0x2c')]=qs[_0xc01d('0x2c')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x2c')]);_0x158f76['offset']=qs[_0xc01d('0x29')](_0x20a163[_0xc01d('0x3f')][_0xc01d('0x29')]);}return _0x1ea90f[_0xc01d('0x5e')](_0x158f76);}})[_0xc01d('0x34')](function(_0x3ecefd){if(_0x3ecefd){return _0x3ecefd?{'count':_0x28c5ac,'rows':_0x3ecefd}:null;}})[_0xc01d('0x34')](respondWithResult(_0x633b75,null))[_0xc01d('0x26')](handleError(_0x633b75,null));};
\ No newline at end of file
index b990d79..acf18ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdebb=['bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','api','moment'];(function(_0x28a627,_0x4ac654){var _0x40b112=function(_0x4bed0b){while(--_0x4bed0b){_0x28a627['push'](_0x28a627['shift']());}};_0x40b112(++_0x4ac654);}(_0xdebb,0x1e9));var _0xbdeb=function(_0xfb90d3,_0x4e7cea){_0xfb90d3=_0xfb90d3-0x0;var _0x306f34=_0xdebb[_0xfb90d3];return _0x306f34;};'use strict';var _=require(_0xbdeb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdeb('0x1'));var moment=require(_0xbdeb('0x2'));var BPromise=require(_0xbdeb('0x3'));var rp=require(_0xbdeb('0x4'));var fs=require('fs');var path=require(_0xbdeb('0x5'));var rimraf=require('rimraf');var config=require(_0xbdeb('0x6'));var attributes=require(_0xbdeb('0x7'));module[_0xbdeb('0x8')]=function(_0x4f81a7,_0x313852){return _0x4f81a7[_0xbdeb('0x9')](_0xbdeb('0xa'),attributes,{'tableName':_0xbdeb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc0e7=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','int_freshsales_configurations'];(function(_0x425355,_0x53d26b){var _0x4a3d30=function(_0x51b9a7){while(--_0x51b9a7){_0x425355['push'](_0x425355['shift']());}};_0x4a3d30(++_0x53d26b);}(_0xc0e7,0x16b));var _0x7c0e=function(_0x4d120d,_0x55a2c9){_0x4d120d=_0x4d120d-0x0;var _0x12b156=_0xc0e7[_0x4d120d];return _0x12b156;};'use strict';var _=require(_0x7c0e('0x0'));var util=require(_0x7c0e('0x1'));var logger=require('../../config/logger')(_0x7c0e('0x2'));var moment=require(_0x7c0e('0x3'));var BPromise=require(_0x7c0e('0x4'));var rp=require(_0x7c0e('0x5'));var fs=require('fs');var path=require(_0x7c0e('0x6'));var rimraf=require('rimraf');var config=require(_0x7c0e('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x7c0e('0x8')]=function(_0x16e34b,_0x1709a5){return _0x16e34b[_0x7c0e('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x7c0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 90973c9..0c2ccb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3ba=['request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x250295,_0x4fe8b7){var _0x15e5c4=function(_0x1a2cc1){while(--_0x1a2cc1){_0x250295['push'](_0x250295['shift']());}};_0x15e5c4(++_0x4fe8b7);}(_0xe3ba,0xdd));var _0xae3b=function(_0x29fc2c,_0x4ff86a){_0x29fc2c=_0x29fc2c-0x0;var _0x1adbc8=_0xe3ba[_0x29fc2c];return _0x1adbc8;};'use strict';var _=require(_0xae3b('0x0'));var util=require(_0xae3b('0x1'));var moment=require(_0xae3b('0x2'));var BPromise=require(_0xae3b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae3b('0x4'));var db=require(_0xae3b('0x5'))['db'];var utils=require(_0xae3b('0x6'));var logger=require(_0xae3b('0x7'))('rpc');var config=require(_0xae3b('0x8'));var jayson=require(_0xae3b('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3aad6a,_0x552691,_0x4c64b2){return new BPromise(function(_0x43c695,_0x2edb72){return client[_0xae3b('0xa')](_0x3aad6a,_0x4c64b2)[_0xae3b('0xb')](function(_0x17f1e2){logger[_0xae3b('0xc')](_0xae3b('0xd'),_0x552691,_0xae3b('0xe'));logger[_0xae3b('0xf')](_0xae3b('0x10'),_0x552691,_0xae3b('0xe'),JSON['stringify'](_0x17f1e2));if(_0x17f1e2['error']){if(_0x17f1e2[_0xae3b('0x11')]['code']===0x1f4){logger['error'](_0xae3b('0xd'),_0x552691,_0x17f1e2['error'][_0xae3b('0x12')]);return _0x2edb72(_0x17f1e2[_0xae3b('0x11')][_0xae3b('0x12')]);}logger[_0xae3b('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x552691,_0x17f1e2[_0xae3b('0x11')][_0xae3b('0x12')]);return _0x43c695(_0x17f1e2[_0xae3b('0x11')][_0xae3b('0x12')]);}else{logger[_0xae3b('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x552691,_0xae3b('0xe'));_0x43c695(_0x17f1e2[_0xae3b('0x13')]['message']);}})[_0xae3b('0x14')](function(_0x40cc30){logger[_0xae3b('0x11')](_0xae3b('0xd'),_0x552691,_0x40cc30);_0x2edb72(_0x40cc30);});});}
\ No newline at end of file
+var _0xcb86=['client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4807d9,_0x1ee2e7){var _0x1283f1=function(_0x1ab8a6){while(--_0x1ab8a6){_0x4807d9['push'](_0x4807d9['shift']());}};_0x1283f1(++_0x1ee2e7);}(_0xcb86,0xd5));var _0x6cb8=function(_0x5d0e7c,_0x265ef9){_0x5d0e7c=_0x5d0e7c-0x0;var _0x43f8f2=_0xcb86[_0x5d0e7c];return _0x43f8f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6cb8('0x0'));var BPromise=require(_0x6cb8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cb8('0x2'));var db=require(_0x6cb8('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cb8('0x4'))(_0x6cb8('0x5'));var config=require('../../config/environment');var jayson=require(_0x6cb8('0x6'));var client=jayson[_0x6cb8('0x7')][_0x6cb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30d676,_0x28093a,_0x18a9ac){return new BPromise(function(_0x561858,_0x551d17){return client[_0x6cb8('0x9')](_0x30d676,_0x18a9ac)[_0x6cb8('0xa')](function(_0x119cad){logger['info'](_0x6cb8('0xb'),_0x28093a,_0x6cb8('0xc'));logger[_0x6cb8('0xd')](_0x6cb8('0xe'),_0x28093a,_0x6cb8('0xc'),JSON[_0x6cb8('0xf')](_0x119cad));if(_0x119cad[_0x6cb8('0x10')]){if(_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x11')]===0x1f4){logger[_0x6cb8('0x10')](_0x6cb8('0xb'),_0x28093a,_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x12')]);return _0x551d17(_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x12')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x28093a,_0x119cad[_0x6cb8('0x10')][_0x6cb8('0x12')]);return _0x561858(_0x119cad['error']['message']);}else{logger[_0x6cb8('0x13')](_0x6cb8('0xb'),_0x28093a,'request\x20sent');_0x561858(_0x119cad[_0x6cb8('0x14')][_0x6cb8('0x12')]);}})[_0x6cb8('0x15')](function(_0x3b6239){logger[_0x6cb8('0x10')](_0x6cb8('0xb'),_0x28093a,_0x3b6239);_0x551d17(_0x3b6239);});});}
\ No newline at end of file
index 9b198a4..af50b1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf257=['../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3ae42e,_0x38662a){var _0x57c5f2=function(_0x21bcb7){while(--_0x21bcb7){_0x3ae42e['push'](_0x3ae42e['shift']());}};_0x57c5f2(++_0x38662a);}(_0xf257,0x82));var _0x7f25=function(_0x1cbb29,_0x1e9873){_0x1cbb29=_0x1cbb29-0x0;var _0x1bc3c9=_0xf257[_0x1cbb29];return _0x1bc3c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f25('0x0'));var timeout=require(_0x7f25('0x1'));var express=require(_0x7f25('0x2'));var router=express[_0x7f25('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f25('0x4'));var interaction=require(_0x7f25('0x5'));var config=require(_0x7f25('0x6'));var controller=require(_0x7f25('0x7'));router[_0x7f25('0x8')]('/',auth[_0x7f25('0x9')](),controller[_0x7f25('0xa')]);router[_0x7f25('0x8')](_0x7f25('0xb'),auth[_0x7f25('0x9')](),controller[_0x7f25('0xc')]);router[_0x7f25('0xd')]('/',auth[_0x7f25('0x9')](),controller[_0x7f25('0xe')]);router['put'](_0x7f25('0xb'),auth[_0x7f25('0x9')](),controller['update']);router['delete'](_0x7f25('0xb'),auth['isAuthenticated'](),controller[_0x7f25('0xf')]);module[_0x7f25('0x10')]=router;
\ No newline at end of file
+var _0x98e5=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','put','update','exports','connect-timeout','express'];(function(_0x4d13eb,_0x187a20){var _0x25ec2a=function(_0x1e7b32){while(--_0x1e7b32){_0x4d13eb['push'](_0x4d13eb['shift']());}};_0x25ec2a(++_0x187a20);}(_0x98e5,0x8a));var _0x598e=function(_0x35caa8,_0x100229){_0x35caa8=_0x35caa8-0x0;var _0x72dcf0=_0x98e5[_0x35caa8];return _0x72dcf0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x598e('0x0'));var express=require(_0x598e('0x1'));var router=express['Router']();var fs_extra=require(_0x598e('0x2'));var auth=require(_0x598e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x598e('0x4'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x598e('0x5')](),controller['index']);router[_0x598e('0x6')](_0x598e('0x7'),auth[_0x598e('0x5')](),controller[_0x598e('0x8')]);router[_0x598e('0x9')]('/',auth[_0x598e('0x5')](),controller[_0x598e('0xa')]);router[_0x598e('0xb')](_0x598e('0x7'),auth[_0x598e('0x5')](),controller[_0x598e('0xc')]);router['delete'](_0x598e('0x7'),auth[_0x598e('0x5')](),controller['destroy']);module[_0x598e('0xd')]=router;
\ No newline at end of file
index 6c665ce..908faa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b47=['STRING','sequelize','ENUM','string','variable','keyValue','picklist'];(function(_0x584006,_0x3c3a1b){var _0x5a8276=function(_0x3d716a){while(--_0x3d716a){_0x584006['push'](_0x584006['shift']());}};_0x5a8276(++_0x3c3a1b);}(_0x8b47,0x78));var _0x78b4=function(_0x190297,_0x21b3b5){_0x190297=_0x190297-0x0;var _0x24e17e=_0x8b47[_0x190297];return _0x24e17e;};'use strict';var Sequelize=require(_0x78b4('0x0'));module['exports']={'type':{'type':Sequelize[_0x78b4('0x1')](_0x78b4('0x2'),_0x78b4('0x3'),'customVariable',_0x78b4('0x4'),_0x78b4('0x5')),'defaultValue':_0x78b4('0x2')},'content':{'type':Sequelize[_0x78b4('0x6')]},'key':{'type':Sequelize[_0x78b4('0x6')]},'keyType':{'type':Sequelize[_0x78b4('0x1')](_0x78b4('0x2'),_0x78b4('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x78b4('0x6')]},'idField':{'type':Sequelize[_0x78b4('0x6')]},'nameField':{'type':Sequelize[_0x78b4('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x78b4('0x6')]}};
\ No newline at end of file
+var _0xd86d=['ENUM','customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x100623,_0x311484){var _0x21b00f=function(_0x1085c6){while(--_0x1085c6){_0x100623['push'](_0x100623['shift']());}};_0x21b00f(++_0x311484);}(_0xd86d,0x76));var _0xdd86=function(_0x11df53,_0x3fd765){_0x11df53=_0x11df53-0x0;var _0x3e10a9=_0xd86d[_0x11df53];return _0x3e10a9;};'use strict';var Sequelize=require(_0xdd86('0x0'));module[_0xdd86('0x1')]={'type':{'type':Sequelize[_0xdd86('0x2')]('string','variable',_0xdd86('0x3'),'keyValue',_0xdd86('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdd86('0x5')]},'keyType':{'type':Sequelize[_0xdd86('0x2')]('string',_0xdd86('0x6'),_0xdd86('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdd86('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdd86('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd86('0x5')]}};
\ No newline at end of file
index 5322575..9eb50ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3f1=['body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','map','FreshsalesField','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create'];(function(_0x45f0dc,_0x5b8996){var _0x1fc5e6=function(_0x436c78){while(--_0x436c78){_0x45f0dc['push'](_0x45f0dc['shift']());}};_0x1fc5e6(++_0x5b8996);}(_0xd3f1,0x17d));var _0x1d3f=function(_0x37e96e,_0x5a6678){_0x37e96e=_0x37e96e-0x0;var _0x1e7633=_0xd3f1[_0x37e96e];return _0x1e7633;};'use strict';var emlformat=require(_0x1d3f('0x0'));var rimraf=require(_0x1d3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d3f('0x2'));var rp=require(_0x1d3f('0x3'));var moment=require(_0x1d3f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d3f('0x5'));var path=require('path');var sox=require(_0x1d3f('0x6'));var csv=require('to-csv');var ejs=require(_0x1d3f('0x7'));var fs=require('fs');var fs_extra=require(_0x1d3f('0x8'));var _=require(_0x1d3f('0x9'));var squel=require(_0x1d3f('0xa'));var crypto=require(_0x1d3f('0xb'));var jsforce=require(_0x1d3f('0xc'));var deskjs=require(_0x1d3f('0xd'));var toCsv=require(_0x1d3f('0xe'));var querystring=require(_0x1d3f('0xf'));var Papa=require('papaparse');var Redis=require(_0x1d3f('0x10'));var authService=require(_0x1d3f('0x11'));var qs=require(_0x1d3f('0x12'));var as=require(_0x1d3f('0x13'));var hardwareService=require(_0x1d3f('0x14'));var logger=require(_0x1d3f('0x15'))(_0x1d3f('0x16'));var utils=require(_0x1d3f('0x17'));var config=require(_0x1d3f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d3f('0x19'))['db'];function respondWithStatusCode(_0x5d181a,_0x348798){_0x348798=_0x348798||0xcc;return function(_0x32c06a){if(_0x32c06a){return _0x5d181a[_0x1d3f('0x1a')](_0x348798);}return _0x5d181a[_0x1d3f('0x1b')](_0x348798)[_0x1d3f('0x1c')]();};}function respondWithResult(_0x1de9a4,_0x121616){_0x121616=_0x121616||0xc8;return function(_0x1c78f1){if(_0x1c78f1){return _0x1de9a4[_0x1d3f('0x1b')](_0x121616)[_0x1d3f('0x1d')](_0x1c78f1);}};}function respondWithFilteredResult(_0x25e356,_0x5ce323){return function(_0x35011a){if(_0x35011a){var _0x1acb4b=typeof _0x5ce323[_0x1d3f('0x1e')]===_0x1d3f('0x1f')&&typeof _0x5ce323[_0x1d3f('0x20')]===_0x1d3f('0x1f');var _0x1753d5=_0x35011a[_0x1d3f('0x21')];var _0x82c479=_0x1acb4b?0x0:_0x5ce323[_0x1d3f('0x1e')];var _0x55f209=_0x1acb4b?_0x35011a['count']:_0x5ce323[_0x1d3f('0x1e')]+_0x5ce323['limit'];var _0x27f1a5;if(_0x55f209>=_0x1753d5){_0x55f209=_0x1753d5;_0x27f1a5=0xc8;}else{_0x27f1a5=0xce;}_0x25e356[_0x1d3f('0x1b')](_0x27f1a5);return _0x25e356[_0x1d3f('0x22')](_0x1d3f('0x23'),_0x82c479+'-'+_0x55f209+'/'+_0x1753d5)[_0x1d3f('0x1d')](_0x35011a);}return null;};}function patchUpdates(_0x432283){return function(_0x4709a2){try{jsonpatch[_0x1d3f('0x24')](_0x4709a2,_0x432283,!![]);}catch(_0x32f09d){return BPromise['reject'](_0x32f09d);}return _0x4709a2[_0x1d3f('0x25')]();};}function saveUpdates(_0x393940,_0x48d79f){return function(_0x1ae8da){if(_0x1ae8da){return _0x1ae8da[_0x1d3f('0x26')](_0x393940)[_0x1d3f('0x27')](function(_0x4c6041){return _0x4c6041;});}return null;};}function removeEntity(_0x2af4dd,_0x32adc4){return function(_0x1910bd){if(_0x1910bd){return _0x1910bd['destroy']()['then'](function(){_0x2af4dd[_0x1d3f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x157438,_0x2b9ee8){return function(_0x5327a2){if(!_0x5327a2){_0x157438[_0x1d3f('0x1a')](0x194);}return _0x5327a2;};}function handleError(_0x2f4b24,_0x53700f){_0x53700f=_0x53700f||0x1f4;return function(_0x344226){logger[_0x1d3f('0x28')](_0x344226[_0x1d3f('0x29')]);if(_0x344226[_0x1d3f('0x2a')]){delete _0x344226['name'];}_0x2f4b24[_0x1d3f('0x1b')](_0x53700f)[_0x1d3f('0x2b')](_0x344226);};}exports['index']=function(_0x5aca9a,_0x5a89b9){var _0x3524fd={},_0x61807={},_0x3ede9d={'count':0x0,'rows':[]};var _0x35a038=_[_0x1d3f('0x2c')](db[_0x1d3f('0x2d')][_0x1d3f('0x2e')],function(_0x4543c5){return{'name':_0x4543c5['fieldName'],'type':_0x4543c5['type'][_0x1d3f('0x2f')]};});_0x61807[_0x1d3f('0x30')]=_[_0x1d3f('0x2c')](_0x35a038,_0x1d3f('0x2a'));_0x61807[_0x1d3f('0x31')]=_[_0x1d3f('0x32')](_0x5aca9a[_0x1d3f('0x31')]);_0x61807['filters']=_[_0x1d3f('0x33')](_0x61807[_0x1d3f('0x30')],_0x61807[_0x1d3f('0x31')]);_0x3524fd['attributes']=_[_0x1d3f('0x33')](_0x61807[_0x1d3f('0x30')],qs['fields'](_0x5aca9a[_0x1d3f('0x31')][_0x1d3f('0x34')]));_0x3524fd['attributes']=_0x3524fd[_0x1d3f('0x35')][_0x1d3f('0x36')]?_0x3524fd[_0x1d3f('0x35')]:_0x61807['model'];if(!_0x5aca9a['query'][_0x1d3f('0x37')](_0x1d3f('0x38'))){_0x3524fd[_0x1d3f('0x20')]=qs['limit'](_0x5aca9a[_0x1d3f('0x31')][_0x1d3f('0x20')]);_0x3524fd['offset']=qs['offset'](_0x5aca9a[_0x1d3f('0x31')][_0x1d3f('0x1e')]);}_0x3524fd['order']=qs[_0x1d3f('0x39')](_0x5aca9a['query'][_0x1d3f('0x39')]);_0x3524fd[_0x1d3f('0x3a')]=qs['filters'](_[_0x1d3f('0x3b')](_0x5aca9a[_0x1d3f('0x31')],_0x61807[_0x1d3f('0x3c')]),_0x35a038);if(_0x5aca9a[_0x1d3f('0x31')][_0x1d3f('0x3d')]){_0x3524fd[_0x1d3f('0x3a')]=_[_0x1d3f('0x3e')](_0x3524fd[_0x1d3f('0x3a')],{'$or':_['map'](_0x35a038,function(_0x3c0e4e){if(_0x3c0e4e[_0x1d3f('0x3f')]!==_0x1d3f('0x40')){var _0x26d3b7={};_0x26d3b7[_0x3c0e4e[_0x1d3f('0x2a')]]={'$like':'%'+_0x5aca9a[_0x1d3f('0x31')][_0x1d3f('0x3d')]+'%'};return _0x26d3b7;}})});}_0x3524fd=_[_0x1d3f('0x3e')]({},_0x3524fd,_0x5aca9a['options']);var _0x1aa722={'where':_0x3524fd[_0x1d3f('0x3a')]};return db[_0x1d3f('0x2d')][_0x1d3f('0x21')](_0x1aa722)['then'](function(_0x17b684){_0x3ede9d['count']=_0x17b684;if(_0x5aca9a[_0x1d3f('0x31')][_0x1d3f('0x41')]){_0x3524fd['include']=[{'all':!![]}];}return db[_0x1d3f('0x2d')][_0x1d3f('0x42')](_0x3524fd);})[_0x1d3f('0x27')](function(_0x4c1209){_0x3ede9d[_0x1d3f('0x43')]=_0x4c1209;return _0x3ede9d;})['then'](respondWithFilteredResult(_0x5a89b9,_0x3524fd))[_0x1d3f('0x44')](handleError(_0x5a89b9,null));};exports[_0x1d3f('0x45')]=function(_0x4cbef3,_0x51c8d3){var _0x240fe9={'raw':!![],'where':{'id':_0x4cbef3[_0x1d3f('0x46')]['id']}},_0x142cc9={};_0x142cc9[_0x1d3f('0x30')]=_['keys'](db[_0x1d3f('0x2d')][_0x1d3f('0x2e')]);_0x142cc9['query']=_[_0x1d3f('0x32')](_0x4cbef3[_0x1d3f('0x31')]);_0x142cc9['filters']=_[_0x1d3f('0x33')](_0x142cc9['model'],_0x142cc9[_0x1d3f('0x31')]);_0x240fe9[_0x1d3f('0x35')]=_[_0x1d3f('0x33')](_0x142cc9[_0x1d3f('0x30')],qs['fields'](_0x4cbef3[_0x1d3f('0x31')][_0x1d3f('0x34')]));_0x240fe9[_0x1d3f('0x35')]=_0x240fe9['attributes']['length']?_0x240fe9[_0x1d3f('0x35')]:_0x142cc9[_0x1d3f('0x30')];if(_0x4cbef3[_0x1d3f('0x31')][_0x1d3f('0x41')]){_0x240fe9[_0x1d3f('0x47')]=[{'all':!![]}];}_0x240fe9=_[_0x1d3f('0x3e')]({},_0x240fe9,_0x4cbef3[_0x1d3f('0x48')]);return db[_0x1d3f('0x2d')][_0x1d3f('0x49')](_0x240fe9)[_0x1d3f('0x27')](handleEntityNotFound(_0x51c8d3,null))[_0x1d3f('0x27')](respondWithResult(_0x51c8d3,null))['catch'](handleError(_0x51c8d3,null));};exports[_0x1d3f('0x4a')]=function(_0x452c94,_0x54670f){return db[_0x1d3f('0x2d')][_0x1d3f('0x4a')](_0x452c94[_0x1d3f('0x4b')],{})[_0x1d3f('0x27')](respondWithResult(_0x54670f,0xc9))[_0x1d3f('0x44')](handleError(_0x54670f,null));};exports[_0x1d3f('0x26')]=function(_0x4c5c51,_0x1742f4){if(_0x4c5c51[_0x1d3f('0x4b')]['id']){delete _0x4c5c51['body']['id'];}return db[_0x1d3f('0x2d')]['find']({'where':{'id':_0x4c5c51[_0x1d3f('0x46')]['id']}})[_0x1d3f('0x27')](handleEntityNotFound(_0x1742f4,null))[_0x1d3f('0x27')](saveUpdates(_0x4c5c51[_0x1d3f('0x4b')],null))[_0x1d3f('0x27')](respondWithResult(_0x1742f4,null))['catch'](handleError(_0x1742f4,null));};exports['destroy']=function(_0x5cab51,_0x19953e){return db[_0x1d3f('0x2d')][_0x1d3f('0x49')]({'where':{'id':_0x5cab51['params']['id']}})[_0x1d3f('0x27')](handleEntityNotFound(_0x19953e,null))[_0x1d3f('0x27')](removeEntity(_0x19953e,null))[_0x1d3f('0x44')](handleError(_0x19953e,null));};
\ No newline at end of file
+var _0x84b0=['../../mysqldb','sendStatus','end','json','limit','undefined','offset','count','status','set','apply','reject','save','then','error','name','index','map','FreshsalesField','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','find','eml-format','rimraf','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x47c2f6,_0x33bc6b){var _0x5df17a=function(_0x590bad){while(--_0x590bad){_0x47c2f6['push'](_0x47c2f6['shift']());}};_0x5df17a(++_0x33bc6b);}(_0x84b0,0x1d4));var _0x084b=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x84b0[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x084b('0x0'));var rimraf=require(_0x084b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x084b('0x2'));var moment=require(_0x084b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x084b('0x4'));var path=require(_0x084b('0x5'));var sox=require(_0x084b('0x6'));var csv=require('to-csv');var ejs=require(_0x084b('0x7'));var fs=require('fs');var fs_extra=require(_0x084b('0x8'));var _=require('lodash');var squel=require(_0x084b('0x9'));var crypto=require('crypto');var jsforce=require(_0x084b('0xa'));var deskjs=require(_0x084b('0xb'));var toCsv=require(_0x084b('0xc'));var querystring=require(_0x084b('0xd'));var Papa=require(_0x084b('0xe'));var Redis=require(_0x084b('0xf'));var authService=require(_0x084b('0x10'));var qs=require(_0x084b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x084b('0x12'))(_0x084b('0x13'));var utils=require('../../config/utils');var config=require(_0x084b('0x14'));var licenseUtil=require(_0x084b('0x15'));var db=require(_0x084b('0x16'))['db'];function respondWithStatusCode(_0xdf9f1c,_0x3b3309){_0x3b3309=_0x3b3309||0xcc;return function(_0x5897e8){if(_0x5897e8){return _0xdf9f1c[_0x084b('0x17')](_0x3b3309);}return _0xdf9f1c['status'](_0x3b3309)[_0x084b('0x18')]();};}function respondWithResult(_0x39b4c7,_0x1e9467){_0x1e9467=_0x1e9467||0xc8;return function(_0x14992d){if(_0x14992d){return _0x39b4c7['status'](_0x1e9467)[_0x084b('0x19')](_0x14992d);}};}function respondWithFilteredResult(_0x30b227,_0xe01edc){return function(_0x3c9d53){if(_0x3c9d53){var _0x5870b2=typeof _0xe01edc['offset']==='undefined'&&typeof _0xe01edc[_0x084b('0x1a')]===_0x084b('0x1b');var _0x2f7e54=_0x3c9d53['count'];var _0x22926d=_0x5870b2?0x0:_0xe01edc[_0x084b('0x1c')];var _0x223db7=_0x5870b2?_0x3c9d53[_0x084b('0x1d')]:_0xe01edc[_0x084b('0x1c')]+_0xe01edc[_0x084b('0x1a')];var _0x57b303;if(_0x223db7>=_0x2f7e54){_0x223db7=_0x2f7e54;_0x57b303=0xc8;}else{_0x57b303=0xce;}_0x30b227[_0x084b('0x1e')](_0x57b303);return _0x30b227[_0x084b('0x1f')]('Content-Range',_0x22926d+'-'+_0x223db7+'/'+_0x2f7e54)[_0x084b('0x19')](_0x3c9d53);}return null;};}function patchUpdates(_0x243ac3){return function(_0x2eb448){try{jsonpatch[_0x084b('0x20')](_0x2eb448,_0x243ac3,!![]);}catch(_0x2a4768){return BPromise[_0x084b('0x21')](_0x2a4768);}return _0x2eb448[_0x084b('0x22')]();};}function saveUpdates(_0x2da2c1,_0x2d7ada){return function(_0x242f60){if(_0x242f60){return _0x242f60['update'](_0x2da2c1)[_0x084b('0x23')](function(_0x586e63){return _0x586e63;});}return null;};}function removeEntity(_0x1ae297,_0x31a701){return function(_0x39c90b){if(_0x39c90b){return _0x39c90b['destroy']()[_0x084b('0x23')](function(){_0x1ae297['status'](0xcc)[_0x084b('0x18')]();});}};}function handleEntityNotFound(_0x2668b0,_0x22b12a){return function(_0x458a25){if(!_0x458a25){_0x2668b0['sendStatus'](0x194);}return _0x458a25;};}function handleError(_0x37eb2a,_0x50656f){_0x50656f=_0x50656f||0x1f4;return function(_0x227618){logger[_0x084b('0x24')](_0x227618['stack']);if(_0x227618['name']){delete _0x227618[_0x084b('0x25')];}_0x37eb2a[_0x084b('0x1e')](_0x50656f)['send'](_0x227618);};}exports[_0x084b('0x26')]=function(_0x18ef3e,_0x57662c){var _0x3fdf36={},_0x1acee6={},_0x119c2e={'count':0x0,'rows':[]};var _0x4e8c48=_[_0x084b('0x27')](db[_0x084b('0x28')]['rawAttributes'],function(_0x39566f){return{'name':_0x39566f['fieldName'],'type':_0x39566f['type']['key']};});_0x1acee6[_0x084b('0x29')]=_[_0x084b('0x27')](_0x4e8c48,_0x084b('0x25'));_0x1acee6[_0x084b('0x2a')]=_[_0x084b('0x2b')](_0x18ef3e[_0x084b('0x2a')]);_0x1acee6['filters']=_[_0x084b('0x2c')](_0x1acee6[_0x084b('0x29')],_0x1acee6[_0x084b('0x2a')]);_0x3fdf36[_0x084b('0x2d')]=_[_0x084b('0x2c')](_0x1acee6[_0x084b('0x29')],qs['fields'](_0x18ef3e[_0x084b('0x2a')][_0x084b('0x2e')]));_0x3fdf36['attributes']=_0x3fdf36[_0x084b('0x2d')][_0x084b('0x2f')]?_0x3fdf36[_0x084b('0x2d')]:_0x1acee6[_0x084b('0x29')];if(!_0x18ef3e['query'][_0x084b('0x30')](_0x084b('0x31'))){_0x3fdf36[_0x084b('0x1a')]=qs[_0x084b('0x1a')](_0x18ef3e['query'][_0x084b('0x1a')]);_0x3fdf36[_0x084b('0x1c')]=qs[_0x084b('0x1c')](_0x18ef3e[_0x084b('0x2a')][_0x084b('0x1c')]);}_0x3fdf36[_0x084b('0x32')]=qs[_0x084b('0x33')](_0x18ef3e[_0x084b('0x2a')][_0x084b('0x33')]);_0x3fdf36[_0x084b('0x34')]=qs[_0x084b('0x35')](_['pick'](_0x18ef3e[_0x084b('0x2a')],_0x1acee6['filters']),_0x4e8c48);if(_0x18ef3e['query']['filter']){_0x3fdf36[_0x084b('0x34')]=_[_0x084b('0x36')](_0x3fdf36[_0x084b('0x34')],{'$or':_[_0x084b('0x27')](_0x4e8c48,function(_0x39c705){if(_0x39c705[_0x084b('0x37')]!==_0x084b('0x38')){var _0x4eb251={};_0x4eb251[_0x39c705['name']]={'$like':'%'+_0x18ef3e[_0x084b('0x2a')][_0x084b('0x39')]+'%'};return _0x4eb251;}})});}_0x3fdf36=_[_0x084b('0x36')]({},_0x3fdf36,_0x18ef3e[_0x084b('0x3a')]);var _0x1e3932={'where':_0x3fdf36[_0x084b('0x34')]};return db[_0x084b('0x28')][_0x084b('0x1d')](_0x1e3932)[_0x084b('0x23')](function(_0x4dc7cf){_0x119c2e[_0x084b('0x1d')]=_0x4dc7cf;if(_0x18ef3e['query'][_0x084b('0x3b')]){_0x3fdf36[_0x084b('0x3c')]=[{'all':!![]}];}return db[_0x084b('0x28')]['findAll'](_0x3fdf36);})[_0x084b('0x23')](function(_0x3bf293){_0x119c2e[_0x084b('0x3d')]=_0x3bf293;return _0x119c2e;})[_0x084b('0x23')](respondWithFilteredResult(_0x57662c,_0x3fdf36))[_0x084b('0x3e')](handleError(_0x57662c,null));};exports[_0x084b('0x3f')]=function(_0x11ffb4,_0x22a548){var _0x1453b0={'raw':!![],'where':{'id':_0x11ffb4[_0x084b('0x40')]['id']}},_0x14085c={};_0x14085c[_0x084b('0x29')]=_['keys'](db[_0x084b('0x28')][_0x084b('0x41')]);_0x14085c[_0x084b('0x2a')]=_[_0x084b('0x2b')](_0x11ffb4[_0x084b('0x2a')]);_0x14085c[_0x084b('0x35')]=_['intersection'](_0x14085c[_0x084b('0x29')],_0x14085c['query']);_0x1453b0[_0x084b('0x2d')]=_[_0x084b('0x2c')](_0x14085c[_0x084b('0x29')],qs['fields'](_0x11ffb4['query'][_0x084b('0x2e')]));_0x1453b0[_0x084b('0x2d')]=_0x1453b0['attributes'][_0x084b('0x2f')]?_0x1453b0[_0x084b('0x2d')]:_0x14085c['model'];if(_0x11ffb4[_0x084b('0x2a')][_0x084b('0x3b')]){_0x1453b0['include']=[{'all':!![]}];}_0x1453b0=_[_0x084b('0x36')]({},_0x1453b0,_0x11ffb4[_0x084b('0x3a')]);return db[_0x084b('0x28')]['find'](_0x1453b0)[_0x084b('0x23')](handleEntityNotFound(_0x22a548,null))[_0x084b('0x23')](respondWithResult(_0x22a548,null))[_0x084b('0x3e')](handleError(_0x22a548,null));};exports[_0x084b('0x42')]=function(_0xb62eb2,_0x4e8926){return db[_0x084b('0x28')][_0x084b('0x42')](_0xb62eb2[_0x084b('0x43')],{})[_0x084b('0x23')](respondWithResult(_0x4e8926,0xc9))['catch'](handleError(_0x4e8926,null));};exports[_0x084b('0x44')]=function(_0x393c87,_0xba8ea1){if(_0x393c87[_0x084b('0x43')]['id']){delete _0x393c87[_0x084b('0x43')]['id'];}return db[_0x084b('0x28')]['find']({'where':{'id':_0x393c87['params']['id']}})['then'](handleEntityNotFound(_0xba8ea1,null))[_0x084b('0x23')](saveUpdates(_0x393c87[_0x084b('0x43')],null))[_0x084b('0x23')](respondWithResult(_0xba8ea1,null))[_0x084b('0x3e')](handleError(_0xba8ea1,null));};exports['destroy']=function(_0x530ea0,_0x1a4849){return db[_0x084b('0x28')][_0x084b('0x45')]({'where':{'id':_0x530ea0[_0x084b('0x40')]['id']}})[_0x084b('0x23')](handleEntityNotFound(_0x1a4849,null))[_0x084b('0x23')](removeEntity(_0x1a4849,null))[_0x084b('0x3e')](handleError(_0x1a4849,null));};
\ No newline at end of file
index 87488f1..21305ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ccb=['int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','FreshsalesField'];(function(_0x20af12,_0x319f05){var _0x55cb67=function(_0x5d6b67){while(--_0x5d6b67){_0x20af12['push'](_0x20af12['shift']());}};_0x55cb67(++_0x319f05);}(_0x4ccb,0x196));var _0xb4cc=function(_0xb24c49,_0x2f8c56){_0xb24c49=_0xb24c49-0x0;var _0x5a4af1=_0x4ccb[_0xb24c49];return _0x5a4af1;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[{'name':_0xb4cc('0xb'),'fields':['idField',_0xb4cc('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6132=['util','api','moment','bluebird','rimraf','./intFreshsalesField.attributes','define','int_freshsales_fields','freshsales_unique_index'];(function(_0x330caa,_0x4f781c){var _0x1159b9=function(_0x546557){while(--_0x546557){_0x330caa['push'](_0x330caa['shift']());}};_0x1159b9(++_0x4f781c);}(_0x6132,0xf3));var _0x2613=function(_0x58e9a1,_0x4eabdb){_0x58e9a1=_0x58e9a1-0x0;var _0x44ca4b=_0x6132[_0x58e9a1];return _0x44ca4b;};'use strict';var _=require('lodash');var util=require(_0x2613('0x0'));var logger=require('../../config/logger')(_0x2613('0x1'));var moment=require(_0x2613('0x2'));var BPromise=require(_0x2613('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2613('0x4'));var config=require('../../config/environment');var attributes=require(_0x2613('0x5'));module['exports']=function(_0x4479f6,_0x3f8ef6){return _0x4479f6[_0x2613('0x6')]('FreshsalesField',attributes,{'tableName':_0x2613('0x7'),'paranoid':![],'indexes':[{'name':_0x2613('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0a23663..066b556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1883=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4857be,_0xfff1bb){var _0x1abfb0=function(_0x2f3d30){while(--_0x2f3d30){_0x4857be['push'](_0x4857be['shift']());}};_0x1abfb0(++_0xfff1bb);}(_0x1883,0xab));var _0x3188=function(_0x36e64e,_0x3a5e9a){_0x36e64e=_0x36e64e-0x0;var _0x3e9125=_0x1883[_0x36e64e];return _0x3e9125;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var moment=require(_0x3188('0x2'));var BPromise=require(_0x3188('0x3'));var rs=require(_0x3188('0x4'));var fs=require('fs');var Redis=require(_0x3188('0x5'));var db=require(_0x3188('0x6'))['db'];var utils=require(_0x3188('0x7'));var logger=require(_0x3188('0x8'))(_0x3188('0x9'));var config=require(_0x3188('0xa'));var jayson=require(_0x3188('0xb'));var client=jayson[_0x3188('0xc')][_0x3188('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24f2f1,_0x3ce7fd,_0x3e3afb){return new BPromise(function(_0x5c8f26,_0x446ab7){return client[_0x3188('0xe')](_0x24f2f1,_0x3e3afb)['then'](function(_0x2213b5){logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));logger[_0x3188('0x11')](_0x3188('0x12'),_0x3ce7fd,'request\x20sent',JSON[_0x3188('0x13')](_0x2213b5));if(_0x2213b5[_0x3188('0x14')]){if(_0x2213b5['error']['code']===0x1f4){logger[_0x3188('0x14')](_0x3188('0xf'),_0x3ce7fd,_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);return _0x446ab7(_0x2213b5[_0x3188('0x14')][_0x3188('0x15')]);}logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x2213b5['error']['message']);return _0x5c8f26(_0x2213b5[_0x3188('0x14')]['message']);}else{logger['info'](_0x3188('0xf'),_0x3ce7fd,_0x3188('0x10'));_0x5c8f26(_0x2213b5[_0x3188('0x16')][_0x3188('0x15')]);}})[_0x3188('0x17')](function(_0x259321){logger['error'](_0x3188('0xf'),_0x3ce7fd,_0x259321);_0x446ab7(_0x259321);});});}
\ No newline at end of file
+var _0x46ed=['FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x46ed,0x168));var _0xd46e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x46ed[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});}
\ No newline at end of file
index 25089cf..65c8d5e 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(_0x4c478d,_0x3a6f90){var _0x1e8141=function(_0x5b75c5){while(--_0x5b75c5){_0x4c478d['push'](_0x4c478d['shift']());}};_0x1e8141(++_0x3a6f90);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3425ab,_0x3af47b){var _0x20a6b3=function(_0xe8de8c){while(--_0xe8de8c){_0x3425ab['push'](_0x3425ab['shift']());}};_0x20a6b3(++_0x3af47b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 c28fb57..c137993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e7=['username','integrationTab','sequelize','exports','STRING'];(function(_0x445557,_0x1a1a0c){var _0x6f8e6d=function(_0x128908){while(--_0x128908){_0x445557['push'](_0x445557['shift']());}};_0x6f8e6d(++_0x1a1a0c);}(_0x99e7,0x1b5));var _0x799e=function(_0x351b46,_0x26b265){_0x351b46=_0x351b46-0x0;var _0x1515df=_0x99e7[_0x351b46];return _0x1515df;};'use strict';var Sequelize=require(_0x799e('0x0'));module[_0x799e('0x1')]={'name':{'type':Sequelize[_0x799e('0x2')]},'description':{'type':Sequelize[_0x799e('0x2')]},'username':{'type':Sequelize[_0x799e('0x2')],'unique':_0x799e('0x3')},'remoteUri':{'type':Sequelize[_0x799e('0x2')]},'password':{'type':Sequelize[_0x799e('0x2')]},'clientId':{'type':Sequelize[_0x799e('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x799e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x799e('0x4'),'newTab'),'defaultValue':_0x799e('0x4')}};
\ No newline at end of file
+var _0xde3a=['ENUM','integrationTab','sequelize','exports','username','STRING'];(function(_0x100303,_0x94e9a6){var _0x2281d1=function(_0xae8f7e){while(--_0xae8f7e){_0x100303['push'](_0x100303['shift']());}};_0x2281d1(++_0x94e9a6);}(_0xde3a,0x140));var _0xade3=function(_0x43d50f,_0x1a5ec3){_0x43d50f=_0x43d50f-0x0;var _0xd30928=_0xde3a[_0x43d50f];return _0xd30928;};'use strict';var Sequelize=require(_0xade3('0x0'));module[_0xade3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xade3('0x2')},'remoteUri':{'type':Sequelize[_0xade3('0x3')]},'password':{'type':Sequelize[_0xade3('0x3')]},'clientId':{'type':Sequelize[_0xade3('0x3')]},'clientSecret':{'type':Sequelize[_0xade3('0x3')]},'securityToken':{'type':Sequelize[_0xade3('0x3')]},'serverUrl':{'type':Sequelize[_0xade3('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xade3('0x4')](_0xade3('0x5'),'newTab'),'defaultValue':_0xade3('0x5')}};
\ No newline at end of file
index 1395fd8..dd61725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe23=['name','send','index','map','SalesforceAccount','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','substring','login','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','Subject','Description','string','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','value','True','False','false','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0xbe23,0xd5));var _0x3be2=function(_0x2faf2b,_0x5d9eac){_0x2faf2b=_0x2faf2b-0x0;var _0x2f2726=_0xbe23[_0x2faf2b];return _0x2f2726;};'use strict';var emlformat=require(_0x3be2('0x0'));var rimraf=require(_0x3be2('0x1'));var zipdir=require(_0x3be2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3be2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3be2('0x4'));var util=require(_0x3be2('0x5'));var path=require(_0x3be2('0x6'));var sox=require(_0x3be2('0x7'));var csv=require(_0x3be2('0x8'));var ejs=require(_0x3be2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3be2('0xa'));var squel=require(_0x3be2('0xb'));var crypto=require('crypto');var jsforce=require(_0x3be2('0xc'));var deskjs=require(_0x3be2('0xd'));var toCsv=require(_0x3be2('0x8'));var querystring=require(_0x3be2('0xe'));var Papa=require(_0x3be2('0xf'));var Redis=require(_0x3be2('0x10'));var authService=require(_0x3be2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3be2('0x12'));var hardwareService=require(_0x3be2('0x13'));var logger=require(_0x3be2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x3be2('0x15'));var licenseUtil=require(_0x3be2('0x16'));var db=require(_0x3be2('0x17'))['db'];var integrations=require(_0x3be2('0x18'));var jayson=require(_0x3be2('0x19'));var client=jayson[_0x3be2('0x1a')][_0x3be2('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xb1ef7d,_0x2732a2,_0x43858c,_0xa38e1f){return new BPromise(function(_0x46129d,_0x4477c3){var _0x768a14=_0xa38e1f||client;return _0x768a14['request'](_0xb1ef7d,_0x43858c)['then'](function(_0x2e2d25){logger['info'](_0x3be2('0x1c'),_0x2732a2,'request\x20sent');logger[_0x3be2('0x1d')](_0x3be2('0x1e'),_0x2732a2,_0x3be2('0x1f'),JSON[_0x3be2('0x20')](_0x2e2d25));if(_0x2e2d25[_0x3be2('0x21')]){if(_0x2e2d25[_0x3be2('0x21')][_0x3be2('0x22')]===0x1f4){logger[_0x3be2('0x21')](_0x3be2('0x1c'),_0x2732a2,_0x2e2d25['error'][_0x3be2('0x23')]);return _0x4477c3(_0x2e2d25['error'][_0x3be2('0x23')]);}logger[_0x3be2('0x21')](_0x3be2('0x1c'),_0x2732a2,_0x2e2d25['error'][_0x3be2('0x23')]);return _0x46129d(_0x2e2d25[_0x3be2('0x21')][_0x3be2('0x23')]);}else{logger[_0x3be2('0x24')](_0x3be2('0x1c'),_0x2732a2,_0x3be2('0x1f'));_0x46129d(_0x2e2d25[_0x3be2('0x25')]['message']);}})[_0x3be2('0x26')](function(_0x18db45){logger[_0x3be2('0x21')](_0x3be2('0x1c'),_0x2732a2,_0x18db45);_0x4477c3(_0x18db45);});});}function respondWithStatusCode(_0x5b1035,_0x3df150){_0x3df150=_0x3df150||0xcc;return function(_0x3fd6d4){if(_0x3fd6d4){return _0x5b1035[_0x3be2('0x27')](_0x3df150);}return _0x5b1035[_0x3be2('0x28')](_0x3df150)[_0x3be2('0x29')]();};}function respondWithResult(_0x110a60,_0x49c57f){_0x49c57f=_0x49c57f||0xc8;return function(_0x2061c1){if(_0x2061c1){return _0x110a60[_0x3be2('0x28')](_0x49c57f)['json'](_0x2061c1);}};}function respondWithFilteredResult(_0x3327be,_0x1f87a9){return function(_0x17ce74){if(_0x17ce74){var _0x167e0d=typeof _0x1f87a9[_0x3be2('0x2a')]===_0x3be2('0x2b')&&typeof _0x1f87a9[_0x3be2('0x2c')]===_0x3be2('0x2b');var _0x2df7a7=_0x17ce74[_0x3be2('0x2d')];var _0x199c66=_0x167e0d?0x0:_0x1f87a9[_0x3be2('0x2a')];var _0x7a7e75=_0x167e0d?_0x17ce74[_0x3be2('0x2d')]:_0x1f87a9[_0x3be2('0x2a')]+_0x1f87a9['limit'];var _0x513663;if(_0x7a7e75>=_0x2df7a7){_0x7a7e75=_0x2df7a7;_0x513663=0xc8;}else{_0x513663=0xce;}_0x3327be['status'](_0x513663);return _0x3327be[_0x3be2('0x2e')](_0x3be2('0x2f'),_0x199c66+'-'+_0x7a7e75+'/'+_0x2df7a7)['json'](_0x17ce74);}return null;};}function patchUpdates(_0xdb245a){return function(_0x20e30a){try{jsonpatch['apply'](_0x20e30a,_0xdb245a,!![]);}catch(_0x1a77af){return BPromise[_0x3be2('0x30')](_0x1a77af);}return _0x20e30a[_0x3be2('0x31')]();};}function saveUpdates(_0x432920,_0x3f84f8){return function(_0x1f6a6c){if(_0x1f6a6c){return _0x1f6a6c['update'](_0x432920)[_0x3be2('0x32')](function(_0x1fdef2){return _0x1fdef2;});}return null;};}function removeEntity(_0xffe978,_0x4d3e4d){return function(_0x50fdef){if(_0x50fdef){return _0x50fdef[_0x3be2('0x33')]()[_0x3be2('0x32')](function(){_0xffe978['status'](0xcc)[_0x3be2('0x29')]();});}};}function handleEntityNotFound(_0x4e6f2e,_0x53149a){return function(_0x2f0a99){if(!_0x2f0a99){_0x4e6f2e[_0x3be2('0x27')](0x194);}return _0x2f0a99;};}function handleError(_0x1bdb5f,_0x4f4cc0){_0x4f4cc0=_0x4f4cc0||0x1f4;return function(_0x41bb05){logger[_0x3be2('0x21')](_0x41bb05[_0x3be2('0x34')]);if(_0x41bb05[_0x3be2('0x35')]){delete _0x41bb05[_0x3be2('0x35')];}_0x1bdb5f[_0x3be2('0x28')](_0x4f4cc0)[_0x3be2('0x36')](_0x41bb05);};}exports[_0x3be2('0x37')]=function(_0x93df07,_0x257112){var _0x17a0c6={},_0x503e0b={},_0x3c1702={'count':0x0,'rows':[]};var _0x30135b=_[_0x3be2('0x38')](db[_0x3be2('0x39')][_0x3be2('0x3a')],function(_0x545fd5){return{'name':_0x545fd5['fieldName'],'type':_0x545fd5[_0x3be2('0x3b')][_0x3be2('0x3c')]};});_0x503e0b[_0x3be2('0x3d')]=_[_0x3be2('0x38')](_0x30135b,'name');_0x503e0b[_0x3be2('0x3e')]=_['keys'](_0x93df07[_0x3be2('0x3e')]);_0x503e0b[_0x3be2('0x3f')]=_['intersection'](_0x503e0b[_0x3be2('0x3d')],_0x503e0b[_0x3be2('0x3e')]);_0x17a0c6[_0x3be2('0x40')]=_[_0x3be2('0x41')](_0x503e0b['model'],qs[_0x3be2('0x42')](_0x93df07['query']['fields']));_0x17a0c6[_0x3be2('0x40')]=_0x17a0c6[_0x3be2('0x40')][_0x3be2('0x43')]?_0x17a0c6[_0x3be2('0x40')]:_0x503e0b[_0x3be2('0x3d')];if(!_0x93df07[_0x3be2('0x3e')][_0x3be2('0x44')](_0x3be2('0x45'))){_0x17a0c6[_0x3be2('0x2c')]=qs[_0x3be2('0x2c')](_0x93df07[_0x3be2('0x3e')][_0x3be2('0x2c')]);_0x17a0c6[_0x3be2('0x2a')]=qs[_0x3be2('0x2a')](_0x93df07[_0x3be2('0x3e')][_0x3be2('0x2a')]);}_0x17a0c6[_0x3be2('0x46')]=qs[_0x3be2('0x47')](_0x93df07[_0x3be2('0x3e')]['sort']);_0x17a0c6['where']=qs[_0x3be2('0x3f')](_[_0x3be2('0x48')](_0x93df07['query'],_0x503e0b[_0x3be2('0x3f')]),_0x30135b);if(_0x93df07[_0x3be2('0x3e')][_0x3be2('0x49')]){_0x17a0c6['where']=_['merge'](_0x17a0c6[_0x3be2('0x4a')],{'$or':_['map'](_0x30135b,function(_0x2153f7){if(_0x2153f7['type']!=='VIRTUAL'){var _0x560c7b={};_0x560c7b[_0x2153f7[_0x3be2('0x35')]]={'$like':'%'+_0x93df07[_0x3be2('0x3e')][_0x3be2('0x49')]+'%'};return _0x560c7b;}})});}_0x17a0c6=_[_0x3be2('0x4b')]({},_0x17a0c6,_0x93df07[_0x3be2('0x4c')]);var _0x28c8ce={'where':_0x17a0c6[_0x3be2('0x4a')]};return db['SalesforceAccount'][_0x3be2('0x2d')](_0x28c8ce)[_0x3be2('0x32')](function(_0x4788e8){_0x3c1702[_0x3be2('0x2d')]=_0x4788e8;if(_0x93df07[_0x3be2('0x3e')][_0x3be2('0x4d')]){_0x17a0c6[_0x3be2('0x4e')]=[{'all':!![]}];}return db[_0x3be2('0x39')][_0x3be2('0x4f')](_0x17a0c6);})[_0x3be2('0x32')](function(_0x1ce5eb){_0x3c1702[_0x3be2('0x50')]=_0x1ce5eb;return _0x3c1702;})[_0x3be2('0x32')](respondWithFilteredResult(_0x257112,_0x17a0c6))['catch'](handleError(_0x257112,null));};exports[_0x3be2('0x51')]=function(_0x4b5ada,_0x32bd28){var _0x2f10a3={'raw':![],'where':{'id':_0x4b5ada[_0x3be2('0x52')]['id']}},_0x177393={};_0x177393[_0x3be2('0x3d')]=_['keys'](db[_0x3be2('0x39')][_0x3be2('0x3a')]);_0x177393[_0x3be2('0x3e')]=_[_0x3be2('0x53')](_0x4b5ada[_0x3be2('0x3e')]);_0x177393[_0x3be2('0x3f')]=_[_0x3be2('0x41')](_0x177393[_0x3be2('0x3d')],_0x177393[_0x3be2('0x3e')]);_0x2f10a3[_0x3be2('0x40')]=_[_0x3be2('0x41')](_0x177393[_0x3be2('0x3d')],qs[_0x3be2('0x42')](_0x4b5ada[_0x3be2('0x3e')][_0x3be2('0x42')]));_0x2f10a3['attributes']=_0x2f10a3[_0x3be2('0x40')][_0x3be2('0x43')]?_0x2f10a3[_0x3be2('0x40')]:_0x177393[_0x3be2('0x3d')];if(_0x4b5ada[_0x3be2('0x3e')]['includeAll']){_0x2f10a3[_0x3be2('0x4e')]=[{'all':!![]}];}_0x2f10a3=_[_0x3be2('0x4b')]({},_0x2f10a3,_0x4b5ada[_0x3be2('0x4c')]);return db[_0x3be2('0x39')][_0x3be2('0x54')](_0x2f10a3)[_0x3be2('0x32')](handleEntityNotFound(_0x32bd28,null))[_0x3be2('0x32')](respondWithResult(_0x32bd28,null))[_0x3be2('0x26')](handleError(_0x32bd28,null));};exports[_0x3be2('0x55')]=function(_0x260df6,_0x20284b){return db[_0x3be2('0x39')][_0x3be2('0x55')](_0x260df6[_0x3be2('0x56')],{})[_0x3be2('0x32')](respondWithResult(_0x20284b,0xc9))[_0x3be2('0x26')](handleError(_0x20284b,null));};exports[_0x3be2('0x57')]=function(_0x5c4661,_0x1a71d3){if(_0x5c4661['body']['id']){delete _0x5c4661[_0x3be2('0x56')]['id'];}return db[_0x3be2('0x39')][_0x3be2('0x54')]({'where':{'id':_0x5c4661[_0x3be2('0x52')]['id']}})[_0x3be2('0x32')](handleEntityNotFound(_0x1a71d3,null))[_0x3be2('0x32')](saveUpdates(_0x5c4661[_0x3be2('0x56')],null))[_0x3be2('0x32')](respondWithResult(_0x1a71d3,null))[_0x3be2('0x26')](handleError(_0x1a71d3,null));};exports[_0x3be2('0x33')]=function(_0x3790f2,_0x59e24a){return db[_0x3be2('0x39')]['find']({'where':{'id':_0x3790f2[_0x3be2('0x52')]['id']}})[_0x3be2('0x32')](handleEntityNotFound(_0x59e24a,null))[_0x3be2('0x32')](removeEntity(_0x59e24a,null))[_0x3be2('0x26')](handleError(_0x59e24a,null));};exports[_0x3be2('0x58')]=function(_0x59c3ef,_0x240244,_0x1950db){var _0x5a92db={};var _0x12e64c={};var _0x2a7bbd;var _0x251515;return db[_0x3be2('0x39')]['findOne']({'where':{'id':_0x59c3ef[_0x3be2('0x52')]['id']}})[_0x3be2('0x32')](handleEntityNotFound(_0x240244,null))['then'](function(_0x376fc8){if(_0x376fc8){_0x2a7bbd=_0x376fc8;_0x12e64c[_0x3be2('0x3d')]=_[_0x3be2('0x53')](db[_0x3be2('0x59')][_0x3be2('0x3a')]);_0x12e64c[_0x3be2('0x3e')]=_[_0x3be2('0x53')](_0x59c3ef[_0x3be2('0x3e')]);_0x12e64c[_0x3be2('0x3f')]=_[_0x3be2('0x41')](_0x12e64c['model'],_0x12e64c[_0x3be2('0x3e')]);_0x5a92db[_0x3be2('0x40')]=_[_0x3be2('0x41')](_0x12e64c[_0x3be2('0x3d')],qs[_0x3be2('0x42')](_0x59c3ef[_0x3be2('0x3e')][_0x3be2('0x42')]));_0x5a92db['attributes']=_0x5a92db[_0x3be2('0x40')][_0x3be2('0x43')]?_0x5a92db[_0x3be2('0x40')]:_0x12e64c[_0x3be2('0x3d')];_0x5a92db[_0x3be2('0x46')]=qs['sort'](_0x59c3ef['query']['sort']);_0x5a92db[_0x3be2('0x4a')]=qs[_0x3be2('0x3f')](_[_0x3be2('0x48')](_0x59c3ef[_0x3be2('0x3e')],_0x12e64c[_0x3be2('0x3f')]));if(_0x59c3ef['query']['filter']){_0x5a92db[_0x3be2('0x4a')]=_[_0x3be2('0x4b')](_0x5a92db['where'],{'$or':_[_0x3be2('0x38')](_0x5a92db[_0x3be2('0x40')],function(_0x1b26ed){var _0x4213d7={};_0x4213d7[_0x1b26ed]={'$like':'%'+_0x59c3ef['query'][_0x3be2('0x49')]+'%'};return _0x4213d7;})});}_0x5a92db=_[_0x3be2('0x4b')]({},_0x5a92db,_0x59c3ef[_0x3be2('0x4c')]);return _0x2a7bbd['getConfigurations'](_0x5a92db);}})[_0x3be2('0x32')](function(_0x47bf4a){if(_0x47bf4a){_0x251515=_0x47bf4a[_0x3be2('0x43')];if(!_0x59c3ef[_0x3be2('0x3e')][_0x3be2('0x44')](_0x3be2('0x45'))){_0x5a92db[_0x3be2('0x2c')]=qs[_0x3be2('0x2c')](_0x59c3ef[_0x3be2('0x3e')][_0x3be2('0x2c')]);_0x5a92db['offset']=qs[_0x3be2('0x2a')](_0x59c3ef['query'][_0x3be2('0x2a')]);}return _0x2a7bbd[_0x3be2('0x58')](_0x5a92db);}})[_0x3be2('0x32')](function(_0x3bdfd1){if(_0x3bdfd1){return _0x3bdfd1?{'count':_0x251515,'rows':_0x3bdfd1}:null;}})[_0x3be2('0x32')](respondWithResult(_0x240244,null))[_0x3be2('0x26')](handleError(_0x240244,null));};exports[_0x3be2('0x5a')]=function(_0x19361c,_0x5822e3,_0x529318){if(_0x19361c[_0x3be2('0x56')]['id']){delete _0x19361c[_0x3be2('0x56')]['id'];}return db['SalesforceAccount'][_0x3be2('0x5b')]({'where':{'id':_0x19361c[_0x3be2('0x52')]['id']}})[_0x3be2('0x32')](handleEntityNotFound(_0x5822e3,null))[_0x3be2('0x32')](function(_0x49c047){if(_0x49c047){_0x19361c[_0x3be2('0x56')][_0x3be2('0x5c')]=_0x49c047['id'];_0x19361c[_0x3be2('0x56')][_0x3be2('0x5d')]=integrations[_0x3be2('0x5e')](_0x19361c[_0x3be2('0x56')][_0x3be2('0x5f')],_0x19361c[_0x3be2('0x56')][_0x3be2('0x3b')]);_0x19361c[_0x3be2('0x56')]['Descriptions']=integrations[_0x3be2('0x60')](_0x19361c[_0x3be2('0x56')][_0x3be2('0x5f')],_0x19361c['body'][_0x3be2('0x3b')]);return db['SalesforceConfiguration'][_0x3be2('0x55')](_0x19361c[_0x3be2('0x56')],{'include':[{'model':db[_0x3be2('0x61')],'as':_0x3be2('0x5d')},{'model':db[_0x3be2('0x61')],'as':_0x3be2('0x62')}]});}return null;})[_0x3be2('0x32')](respondWithResult(_0x5822e3,null))['catch'](handleError(_0x5822e3,null));};exports[_0x3be2('0x63')]=function(_0x441651,_0x277a5c,_0x24b834){var _0x30f478;var _0xad77b6='';var _0x5da9c9=_0x3be2('0x64');return db[_0x3be2('0x39')][_0x3be2('0x5b')]({'where':{'id':_0x441651[_0x3be2('0x52')]['id']},'attributes':['id',_0x3be2('0x65'),'clientId',_0x3be2('0x66'),_0x3be2('0x67'),_0x3be2('0x68'),_0x3be2('0x69')]})[_0x3be2('0x32')](handleEntityNotFound(_0x277a5c,null))['then'](function(_0x3cfa73){if(_0x3cfa73){_0xad77b6=_0x3cfa73[_0x3be2('0x65')];var _0x2132c7=_0xad77b6['slice'](-0x1);if(_0x2132c7==='/'){_0xad77b6=_0xad77b6[_0x3be2('0x6a')](0x0,_0xad77b6['lastIndexOf'](_0x2132c7));}_0x30f478=new jsforce['Connection']({'oauth2':{'loginUrl':_0xad77b6,'clientId':_0x3cfa73['clientId'],'clientSecret':_0x3cfa73[_0x3be2('0x66')]}});return _0x30f478[_0x3be2('0x6b')](_0x3cfa73[_0x3be2('0x67')],_0x3cfa73[_0x3be2('0x68')][_0x3be2('0x6c')](_0x3cfa73['securityToken']));}})[_0x3be2('0x32')](function(_0x11fd39){if(_0x11fd39){if(!_[_0x3be2('0x6d')](_0x441651[_0x3be2('0x3e')]['ticketType'])){_0x5da9c9=_0x441651[_0x3be2('0x3e')][_0x3be2('0x6e')];}return _0x30f478[_0x3be2('0x6f')](_0x5da9c9)['describe']();}})['then'](function(_0x29d501){var _0x58ec53=['OwnerId',_0x3be2('0x70'),_0x3be2('0x71'),'IsRecurrence',_0x3be2('0x72'),_0x3be2('0x73')];var _0x1d3e5f=[_0x3be2('0x74'),'int','picklist',_0x3be2('0x75'),_0x3be2('0x76'),_0x3be2('0x77'),_0x3be2('0x78')];if(_0x29d501){_[_0x3be2('0x79')](_0x29d501['fields'],function(_0x53d6fe){return _0x58ec53[_0x3be2('0x7a')](_0x53d6fe['name'])||!_0x1d3e5f[_0x3be2('0x7a')](_0x53d6fe[_0x3be2('0x3b')]);});return{'count':_0x29d501[_0x3be2('0x42')]['length'],'rows':_[_0x3be2('0x38')](_0x29d501[_0x3be2('0x42')],function(_0x3670d6){return{'id':_0x3670d6[_0x3be2('0x35')],'name':_0x3670d6[_0x3be2('0x7b')],'custom':_0x3670d6[_0x3be2('0x7c')],'options':_0x3670d6['picklistValues'][_0x3be2('0x43')]>0x0?_['map'](_0x3670d6[_0x3be2('0x7d')],function(_0x2da25f){return{'name':_0x2da25f[_0x3be2('0x7b')],'value':_0x2da25f[_0x3be2('0x7e')]};}):_0x3670d6[_0x3be2('0x3b')]=='boolean'?[{'name':_0x3be2('0x7f'),'value':'true'},{'name':_0x3be2('0x80'),'value':_0x3be2('0x81')}]:[]};})};}})['then'](respondWithResult(_0x277a5c,null))['catch'](function(_0x116202){var _0x203923=_0x441651[_0x3be2('0x3e')][_0x3be2('0x82')]?0x1f4:_0x116202[_0x3be2('0x83')]||0x1f4;logger[_0x3be2('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x3be2('0x63'),_0x203923,JSON[_0x3be2('0x20')](_0x116202));delete _0x116202[_0x3be2('0x35')];if(_0x203923===0x191){_0x203923=0x190;}_0x277a5c[_0x3be2('0x28')](_0x203923)[_0x3be2('0x36')](_0x441651['query'][_0x3be2('0x82')]?{'message':_0x3be2('0x84'),'statusCode':_0x116202['statusCode']}:_0x116202);});};
\ No newline at end of file
+var _0x624c=['phone','remove','includes','custom','picklistValues','label','value','True','False','test','statusCode','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','SalesforceAccount','rawAttributes','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','keys','fields','create','body','find','getConfigurations','findOne','SalesforceConfiguration','order','nolimit','addConfiguration','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','picklist','boolean','email'];(function(_0x432351,_0x20ae89){var _0x24ca09=function(_0x2bf186){while(--_0x2bf186){_0x432351['push'](_0x432351['shift']());}};_0x24ca09(++_0x20ae89);}(_0x624c,0x195));var _0xc624=function(_0x38b3cb,_0x4ad7b3){_0x38b3cb=_0x38b3cb-0x0;var _0x5a9a84=_0x624c[_0x38b3cb];return _0x5a9a84;};'use strict';var emlformat=require(_0xc624('0x0'));var rimraf=require(_0xc624('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc624('0x2'));var moment=require('moment');var BPromise=require(_0xc624('0x3'));var Mustache=require(_0xc624('0x4'));var util=require(_0xc624('0x5'));var path=require(_0xc624('0x6'));var sox=require(_0xc624('0x7'));var csv=require(_0xc624('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc624('0x9'));var _=require(_0xc624('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc624('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc624('0x8'));var querystring=require(_0xc624('0xc'));var Papa=require(_0xc624('0xd'));var Redis=require('ioredis');var authService=require(_0xc624('0xe'));var qs=require(_0xc624('0xf'));var as=require(_0xc624('0x10'));var hardwareService=require(_0xc624('0x11'));var logger=require('../../config/logger')(_0xc624('0x12'));var utils=require(_0xc624('0x13'));var config=require(_0xc624('0x14'));var licenseUtil=require(_0xc624('0x15'));var db=require(_0xc624('0x16'))['db'];var integrations=require(_0xc624('0x17'));var jayson=require(_0xc624('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e13ee,_0x94dbc,_0x1182d1,_0x51dea2){return new BPromise(function(_0x388717,_0x258add){var _0x486ece=_0x51dea2||client;return _0x486ece[_0xc624('0x19')](_0x1e13ee,_0x1182d1)[_0xc624('0x1a')](function(_0x485794){logger[_0xc624('0x1b')](_0xc624('0x1c'),_0x94dbc,'request\x20sent');logger[_0xc624('0x1d')](_0xc624('0x1e'),_0x94dbc,_0xc624('0x1f'),JSON[_0xc624('0x20')](_0x485794));if(_0x485794[_0xc624('0x21')]){if(_0x485794[_0xc624('0x21')][_0xc624('0x22')]===0x1f4){logger['error'](_0xc624('0x1c'),_0x94dbc,_0x485794[_0xc624('0x21')][_0xc624('0x23')]);return _0x258add(_0x485794[_0xc624('0x21')][_0xc624('0x23')]);}logger[_0xc624('0x21')](_0xc624('0x1c'),_0x94dbc,_0x485794['error'][_0xc624('0x23')]);return _0x388717(_0x485794[_0xc624('0x21')][_0xc624('0x23')]);}else{logger[_0xc624('0x1b')]('SalesforceAccount,\x20%s,\x20%s',_0x94dbc,_0xc624('0x1f'));_0x388717(_0x485794[_0xc624('0x24')][_0xc624('0x23')]);}})[_0xc624('0x25')](function(_0x34e0af){logger[_0xc624('0x21')](_0xc624('0x1c'),_0x94dbc,_0x34e0af);_0x258add(_0x34e0af);});});}function respondWithStatusCode(_0x1a1b29,_0x2e5b1e){_0x2e5b1e=_0x2e5b1e||0xcc;return function(_0x2a2005){if(_0x2a2005){return _0x1a1b29[_0xc624('0x26')](_0x2e5b1e);}return _0x1a1b29[_0xc624('0x27')](_0x2e5b1e)[_0xc624('0x28')]();};}function respondWithResult(_0x22036c,_0x54d159){_0x54d159=_0x54d159||0xc8;return function(_0x466a9c){if(_0x466a9c){return _0x22036c[_0xc624('0x27')](_0x54d159)[_0xc624('0x29')](_0x466a9c);}};}function respondWithFilteredResult(_0x2aead5,_0x2cf43b){return function(_0x321300){if(_0x321300){var _0x51c0b6=typeof _0x2cf43b[_0xc624('0x2a')]===_0xc624('0x2b')&&typeof _0x2cf43b[_0xc624('0x2c')]==='undefined';var _0x52f3f2=_0x321300['count'];var _0x182ae8=_0x51c0b6?0x0:_0x2cf43b[_0xc624('0x2a')];var _0x2700eb=_0x51c0b6?_0x321300['count']:_0x2cf43b[_0xc624('0x2a')]+_0x2cf43b[_0xc624('0x2c')];var _0xdf9097;if(_0x2700eb>=_0x52f3f2){_0x2700eb=_0x52f3f2;_0xdf9097=0xc8;}else{_0xdf9097=0xce;}_0x2aead5[_0xc624('0x27')](_0xdf9097);return _0x2aead5[_0xc624('0x2d')](_0xc624('0x2e'),_0x182ae8+'-'+_0x2700eb+'/'+_0x52f3f2)['json'](_0x321300);}return null;};}function patchUpdates(_0x234fa7){return function(_0x56c518){try{jsonpatch[_0xc624('0x2f')](_0x56c518,_0x234fa7,!![]);}catch(_0x491265){return BPromise[_0xc624('0x30')](_0x491265);}return _0x56c518[_0xc624('0x31')]();};}function saveUpdates(_0x32f7fa,_0x467b2f){return function(_0x2e8040){if(_0x2e8040){return _0x2e8040['update'](_0x32f7fa)['then'](function(_0x11cf67){return _0x11cf67;});}return null;};}function removeEntity(_0x1c8324,_0x2924ad){return function(_0x355597){if(_0x355597){return _0x355597[_0xc624('0x32')]()[_0xc624('0x1a')](function(){_0x1c8324[_0xc624('0x27')](0xcc)[_0xc624('0x28')]();});}};}function handleEntityNotFound(_0xd57f7b,_0x1a9df5){return function(_0x2fe641){if(!_0x2fe641){_0xd57f7b[_0xc624('0x26')](0x194);}return _0x2fe641;};}function handleError(_0x1265ec,_0x4dfcf2){_0x4dfcf2=_0x4dfcf2||0x1f4;return function(_0x8e1f19){logger[_0xc624('0x21')](_0x8e1f19[_0xc624('0x33')]);if(_0x8e1f19[_0xc624('0x34')]){delete _0x8e1f19[_0xc624('0x34')];}_0x1265ec[_0xc624('0x27')](_0x4dfcf2)[_0xc624('0x35')](_0x8e1f19);};}exports['index']=function(_0x1ca79b,_0x144abc){var _0x536599={},_0x20e940={},_0x4830d1={'count':0x0,'rows':[]};var _0x5d1aad=_[_0xc624('0x36')](db[_0xc624('0x37')][_0xc624('0x38')],function(_0x8a2975){return{'name':_0x8a2975['fieldName'],'type':_0x8a2975['type'][_0xc624('0x39')]};});_0x20e940[_0xc624('0x3a')]=_['map'](_0x5d1aad,_0xc624('0x34'));_0x20e940[_0xc624('0x3b')]=_['keys'](_0x1ca79b[_0xc624('0x3b')]);_0x20e940[_0xc624('0x3c')]=_[_0xc624('0x3d')](_0x20e940[_0xc624('0x3a')],_0x20e940[_0xc624('0x3b')]);_0x536599[_0xc624('0x3e')]=_[_0xc624('0x3d')](_0x20e940['model'],qs['fields'](_0x1ca79b[_0xc624('0x3b')]['fields']));_0x536599[_0xc624('0x3e')]=_0x536599[_0xc624('0x3e')][_0xc624('0x3f')]?_0x536599['attributes']:_0x20e940['model'];if(!_0x1ca79b[_0xc624('0x3b')][_0xc624('0x40')]('nolimit')){_0x536599[_0xc624('0x2c')]=qs[_0xc624('0x2c')](_0x1ca79b['query'][_0xc624('0x2c')]);_0x536599[_0xc624('0x2a')]=qs[_0xc624('0x2a')](_0x1ca79b[_0xc624('0x3b')][_0xc624('0x2a')]);}_0x536599['order']=qs[_0xc624('0x41')](_0x1ca79b[_0xc624('0x3b')][_0xc624('0x41')]);_0x536599[_0xc624('0x42')]=qs[_0xc624('0x3c')](_[_0xc624('0x43')](_0x1ca79b[_0xc624('0x3b')],_0x20e940[_0xc624('0x3c')]),_0x5d1aad);if(_0x1ca79b[_0xc624('0x3b')][_0xc624('0x44')]){_0x536599[_0xc624('0x42')]=_[_0xc624('0x45')](_0x536599[_0xc624('0x42')],{'$or':_[_0xc624('0x36')](_0x5d1aad,function(_0x232aa2){if(_0x232aa2['type']!==_0xc624('0x46')){var _0xa2fd07={};_0xa2fd07[_0x232aa2[_0xc624('0x34')]]={'$like':'%'+_0x1ca79b['query'][_0xc624('0x44')]+'%'};return _0xa2fd07;}})});}_0x536599=_[_0xc624('0x45')]({},_0x536599,_0x1ca79b[_0xc624('0x47')]);var _0x1bd80c={'where':_0x536599[_0xc624('0x42')]};return db[_0xc624('0x37')][_0xc624('0x48')](_0x1bd80c)[_0xc624('0x1a')](function(_0x22b712){_0x4830d1[_0xc624('0x48')]=_0x22b712;if(_0x1ca79b['query'][_0xc624('0x49')]){_0x536599[_0xc624('0x4a')]=[{'all':!![]}];}return db[_0xc624('0x37')]['findAll'](_0x536599);})[_0xc624('0x1a')](function(_0x19832e){_0x4830d1['rows']=_0x19832e;return _0x4830d1;})['then'](respondWithFilteredResult(_0x144abc,_0x536599))[_0xc624('0x25')](handleError(_0x144abc,null));};exports[_0xc624('0x4b')]=function(_0x3c57cb,_0x50ca89){var _0x299369={'raw':![],'where':{'id':_0x3c57cb[_0xc624('0x4c')]['id']}},_0xbdd479={};_0xbdd479['model']=_['keys'](db[_0xc624('0x37')][_0xc624('0x38')]);_0xbdd479['query']=_[_0xc624('0x4d')](_0x3c57cb[_0xc624('0x3b')]);_0xbdd479['filters']=_[_0xc624('0x3d')](_0xbdd479[_0xc624('0x3a')],_0xbdd479['query']);_0x299369[_0xc624('0x3e')]=_['intersection'](_0xbdd479[_0xc624('0x3a')],qs['fields'](_0x3c57cb[_0xc624('0x3b')][_0xc624('0x4e')]));_0x299369[_0xc624('0x3e')]=_0x299369['attributes']['length']?_0x299369['attributes']:_0xbdd479['model'];if(_0x3c57cb[_0xc624('0x3b')][_0xc624('0x49')]){_0x299369['include']=[{'all':!![]}];}_0x299369=_[_0xc624('0x45')]({},_0x299369,_0x3c57cb[_0xc624('0x47')]);return db[_0xc624('0x37')]['find'](_0x299369)[_0xc624('0x1a')](handleEntityNotFound(_0x50ca89,null))['then'](respondWithResult(_0x50ca89,null))[_0xc624('0x25')](handleError(_0x50ca89,null));};exports[_0xc624('0x4f')]=function(_0x2e0a43,_0x22b625){return db[_0xc624('0x37')]['create'](_0x2e0a43[_0xc624('0x50')],{})['then'](respondWithResult(_0x22b625,0xc9))[_0xc624('0x25')](handleError(_0x22b625,null));};exports['update']=function(_0x4333fd,_0x39fac6){if(_0x4333fd[_0xc624('0x50')]['id']){delete _0x4333fd[_0xc624('0x50')]['id'];}return db[_0xc624('0x37')][_0xc624('0x51')]({'where':{'id':_0x4333fd['params']['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0x39fac6,null))[_0xc624('0x1a')](saveUpdates(_0x4333fd[_0xc624('0x50')],null))[_0xc624('0x1a')](respondWithResult(_0x39fac6,null))[_0xc624('0x25')](handleError(_0x39fac6,null));};exports[_0xc624('0x32')]=function(_0x53fddb,_0xc985ee){return db[_0xc624('0x37')][_0xc624('0x51')]({'where':{'id':_0x53fddb[_0xc624('0x4c')]['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0xc985ee,null))[_0xc624('0x1a')](removeEntity(_0xc985ee,null))[_0xc624('0x25')](handleError(_0xc985ee,null));};exports[_0xc624('0x52')]=function(_0x514a73,_0x82e770,_0x6aafb0){var _0x4a3471={};var _0x2cd261={};var _0x2b942e;var _0x3fc850;return db['SalesforceAccount'][_0xc624('0x53')]({'where':{'id':_0x514a73[_0xc624('0x4c')]['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0x82e770,null))[_0xc624('0x1a')](function(_0x436af0){if(_0x436af0){_0x2b942e=_0x436af0;_0x2cd261[_0xc624('0x3a')]=_[_0xc624('0x4d')](db[_0xc624('0x54')][_0xc624('0x38')]);_0x2cd261[_0xc624('0x3b')]=_[_0xc624('0x4d')](_0x514a73[_0xc624('0x3b')]);_0x2cd261['filters']=_['intersection'](_0x2cd261[_0xc624('0x3a')],_0x2cd261['query']);_0x4a3471['attributes']=_[_0xc624('0x3d')](_0x2cd261[_0xc624('0x3a')],qs['fields'](_0x514a73['query'][_0xc624('0x4e')]));_0x4a3471[_0xc624('0x3e')]=_0x4a3471[_0xc624('0x3e')][_0xc624('0x3f')]?_0x4a3471[_0xc624('0x3e')]:_0x2cd261[_0xc624('0x3a')];_0x4a3471[_0xc624('0x55')]=qs[_0xc624('0x41')](_0x514a73[_0xc624('0x3b')][_0xc624('0x41')]);_0x4a3471[_0xc624('0x42')]=qs[_0xc624('0x3c')](_[_0xc624('0x43')](_0x514a73[_0xc624('0x3b')],_0x2cd261[_0xc624('0x3c')]));if(_0x514a73['query'][_0xc624('0x44')]){_0x4a3471[_0xc624('0x42')]=_[_0xc624('0x45')](_0x4a3471[_0xc624('0x42')],{'$or':_[_0xc624('0x36')](_0x4a3471['attributes'],function(_0x5e774a){var _0x32776f={};_0x32776f[_0x5e774a]={'$like':'%'+_0x514a73[_0xc624('0x3b')]['filter']+'%'};return _0x32776f;})});}_0x4a3471=_[_0xc624('0x45')]({},_0x4a3471,_0x514a73[_0xc624('0x47')]);return _0x2b942e[_0xc624('0x52')](_0x4a3471);}})['then'](function(_0x37cc11){if(_0x37cc11){_0x3fc850=_0x37cc11[_0xc624('0x3f')];if(!_0x514a73[_0xc624('0x3b')][_0xc624('0x40')](_0xc624('0x56'))){_0x4a3471[_0xc624('0x2c')]=qs['limit'](_0x514a73[_0xc624('0x3b')]['limit']);_0x4a3471['offset']=qs[_0xc624('0x2a')](_0x514a73[_0xc624('0x3b')][_0xc624('0x2a')]);}return _0x2b942e[_0xc624('0x52')](_0x4a3471);}})['then'](function(_0x459fed){if(_0x459fed){return _0x459fed?{'count':_0x3fc850,'rows':_0x459fed}:null;}})['then'](respondWithResult(_0x82e770,null))[_0xc624('0x25')](handleError(_0x82e770,null));};exports[_0xc624('0x57')]=function(_0x1da5ac,_0x3c3cd7,_0x139ffd){if(_0x1da5ac[_0xc624('0x50')]['id']){delete _0x1da5ac[_0xc624('0x50')]['id'];}return db[_0xc624('0x37')][_0xc624('0x53')]({'where':{'id':_0x1da5ac[_0xc624('0x4c')]['id']}})[_0xc624('0x1a')](handleEntityNotFound(_0x3c3cd7,null))[_0xc624('0x1a')](function(_0x4d9b85){if(_0x4d9b85){_0x1da5ac[_0xc624('0x50')]['AccountId']=_0x4d9b85['id'];_0x1da5ac[_0xc624('0x50')][_0xc624('0x58')]=integrations[_0xc624('0x59')](_0x1da5ac[_0xc624('0x50')]['channel'],_0x1da5ac[_0xc624('0x50')][_0xc624('0x5a')]);_0x1da5ac['body'][_0xc624('0x5b')]=integrations[_0xc624('0x5c')](_0x1da5ac['body'][_0xc624('0x5d')],_0x1da5ac['body']['type']);return db['SalesforceConfiguration']['create'](_0x1da5ac[_0xc624('0x50')],{'include':[{'model':db['SalesforceField'],'as':_0xc624('0x58')},{'model':db[_0xc624('0x5e')],'as':_0xc624('0x5b')}]});}return null;})[_0xc624('0x1a')](respondWithResult(_0x3c3cd7,null))[_0xc624('0x25')](handleError(_0x3c3cd7,null));};exports[_0xc624('0x5f')]=function(_0x4e1bae,_0x146b8d,_0x2c6587){var _0x27bf20;var _0x312a39='';var _0x38adfb=_0xc624('0x60');return db[_0xc624('0x37')][_0xc624('0x53')]({'where':{'id':_0x4e1bae[_0xc624('0x4c')]['id']},'attributes':['id','remoteUri',_0xc624('0x61'),_0xc624('0x62'),_0xc624('0x63'),_0xc624('0x64'),_0xc624('0x65')]})['then'](handleEntityNotFound(_0x146b8d,null))[_0xc624('0x1a')](function(_0x46f912){if(_0x46f912){_0x312a39=_0x46f912[_0xc624('0x66')];var _0x1071ef=_0x312a39['slice'](-0x1);if(_0x1071ef==='/'){_0x312a39=_0x312a39[_0xc624('0x67')](0x0,_0x312a39[_0xc624('0x68')](_0x1071ef));}_0x27bf20=new jsforce[(_0xc624('0x69'))]({'oauth2':{'loginUrl':_0x312a39,'clientId':_0x46f912[_0xc624('0x61')],'clientSecret':_0x46f912[_0xc624('0x62')]}});return _0x27bf20[_0xc624('0x6a')](_0x46f912[_0xc624('0x63')],_0x46f912[_0xc624('0x64')][_0xc624('0x6b')](_0x46f912['securityToken']));}})['then'](function(_0x384b29){if(_0x384b29){if(!_[_0xc624('0x6c')](_0x4e1bae[_0xc624('0x3b')][_0xc624('0x6d')])){_0x38adfb=_0x4e1bae['query'][_0xc624('0x6d')];}return _0x27bf20['sobject'](_0x38adfb)['describe']();}})[_0xc624('0x1a')](function(_0xd7a1b5){var _0x543e7a=[_0xc624('0x6e'),_0xc624('0x6f'),_0xc624('0x70'),_0xc624('0x71'),_0xc624('0x72'),_0xc624('0x73')];var _0x220101=['string','int',_0xc624('0x74'),_0xc624('0x75'),_0xc624('0x76'),'textarea',_0xc624('0x77')];if(_0xd7a1b5){_[_0xc624('0x78')](_0xd7a1b5['fields'],function(_0x20e701){return _0x543e7a[_0xc624('0x79')](_0x20e701[_0xc624('0x34')])||!_0x220101[_0xc624('0x79')](_0x20e701[_0xc624('0x5a')]);});return{'count':_0xd7a1b5[_0xc624('0x4e')][_0xc624('0x3f')],'rows':_[_0xc624('0x36')](_0xd7a1b5[_0xc624('0x4e')],function(_0x530125){return{'id':_0x530125[_0xc624('0x34')],'name':_0x530125['label'],'custom':_0x530125[_0xc624('0x7a')],'options':_0x530125[_0xc624('0x7b')][_0xc624('0x3f')]>0x0?_[_0xc624('0x36')](_0x530125['picklistValues'],function(_0x41a52c){return{'name':_0x41a52c[_0xc624('0x7c')],'value':_0x41a52c[_0xc624('0x7d')]};}):_0x530125[_0xc624('0x5a')]==_0xc624('0x75')?[{'name':_0xc624('0x7e'),'value':'true'},{'name':_0xc624('0x7f'),'value':'false'}]:[]};})};}})[_0xc624('0x1a')](respondWithResult(_0x146b8d,null))[_0xc624('0x25')](function(_0x38c4e8){var _0xe5da0=_0x4e1bae[_0xc624('0x3b')][_0xc624('0x80')]?0x1f4:_0x38c4e8[_0xc624('0x81')]||0x1f4;logger[_0xc624('0x21')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xe5da0,JSON[_0xc624('0x20')](_0x38c4e8));delete _0x38c4e8[_0xc624('0x34')];if(_0xe5da0===0x191){_0xe5da0=0x190;}_0x146b8d[_0xc624('0x27')](_0xe5da0)[_0xc624('0x35')](_0x4e1bae[_0xc624('0x3b')][_0xc624('0x80')]?{'message':_0xc624('0x82'),'statusCode':_0x38c4e8[_0xc624('0x81')]}:_0x38c4e8);});};
\ No newline at end of file
index 99450b0..52fb71d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f48=['lodash','util','api','moment','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts'];(function(_0x46f2f2,_0x4e40cf){var _0x528801=function(_0x168dce){while(--_0x168dce){_0x46f2f2['push'](_0x46f2f2['shift']());}};_0x528801(++_0x4e40cf);}(_0x5f48,0xb0));var _0x85f4=function(_0x802172,_0x683637){_0x802172=_0x802172-0x0;var _0x508c37=_0x5f48[_0x802172];return _0x508c37;};'use strict';var _=require(_0x85f4('0x0'));var util=require(_0x85f4('0x1'));var logger=require('../../config/logger')(_0x85f4('0x2'));var moment=require(_0x85f4('0x3'));var BPromise=require('bluebird');var rp=require(_0x85f4('0x4'));var fs=require('fs');var path=require(_0x85f4('0x5'));var rimraf=require(_0x85f4('0x6'));var config=require('../../config/environment');var attributes=require(_0x85f4('0x7'));var integrations=require(_0x85f4('0x8'));module['exports']=function(_0x106d9f,_0x5c2b71){return _0x106d9f['define'](_0x85f4('0x9'),attributes,{'tableName':_0x85f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x98e4=['rimraf','../../config/environment','../../components/integrations/configuration','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x34b7a0,_0x5620fb){var _0x5df4ff=function(_0x4ca55b){while(--_0x4ca55b){_0x34b7a0['push'](_0x34b7a0['shift']());}};_0x5df4ff(++_0x5620fb);}(_0x98e4,0x160));var _0x498e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x98e4[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0x498e('0x0'));var util=require(_0x498e('0x1'));var logger=require(_0x498e('0x2'))(_0x498e('0x3'));var moment=require(_0x498e('0x4'));var BPromise=require(_0x498e('0x5'));var rp=require(_0x498e('0x6'));var fs=require('fs');var path=require(_0x498e('0x7'));var rimraf=require(_0x498e('0x8'));var config=require(_0x498e('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x498e('0xa'));module['exports']=function(_0x69b73a,_0x3f9808){return _0x69b73a['define']('SalesforceAccount',attributes,{'tableName':_0x498e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 818ef77..2f6f171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74cf=['include','map','model','then','ShowSalesforceAccount','find','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit'];(function(_0x4c4592,_0x1480c3){var _0x27ab89=function(_0x4df2f5){while(--_0x4df2f5){_0x4c4592['push'](_0x4c4592['shift']());}};_0x27ab89(++_0x1480c3);}(_0x74cf,0x11e));var _0xf74c=function(_0x58fe86,_0x19655f){_0x58fe86=_0x58fe86-0x0;var _0x3f0732=_0x74cf[_0x58fe86];return _0x3f0732;};'use strict';var _=require(_0xf74c('0x0'));var util=require(_0xf74c('0x1'));var moment=require(_0xf74c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf74c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf74c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf74c('0x5'))(_0xf74c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf74c('0x7'));var client=jayson[_0xf74c('0x8')][_0xf74c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cbee3,_0x2aedf0,_0x1691e0){return new BPromise(function(_0x179d1b,_0x1ab8a3){return client[_0xf74c('0xa')](_0x3cbee3,_0x1691e0)['then'](function(_0x949f2a){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x2aedf0,'request\x20sent');logger[_0xf74c('0xb')](_0xf74c('0xc'),_0x2aedf0,_0xf74c('0xd'),JSON[_0xf74c('0xe')](_0x949f2a));if(_0x949f2a['error']){if(_0x949f2a[_0xf74c('0xf')][_0xf74c('0x10')]===0x1f4){logger['error'](_0xf74c('0x11'),_0x2aedf0,_0x949f2a['error'][_0xf74c('0x12')]);return _0x1ab8a3(_0x949f2a[_0xf74c('0xf')][_0xf74c('0x12')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x2aedf0,_0x949f2a['error']['message']);return _0x179d1b(_0x949f2a[_0xf74c('0xf')]['message']);}else{logger[_0xf74c('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x2aedf0,_0xf74c('0xd'));_0x179d1b(_0x949f2a[_0xf74c('0x14')][_0xf74c('0x12')]);}})[_0xf74c('0x15')](function(_0x26bdf2){logger[_0xf74c('0xf')](_0xf74c('0x11'),_0x2aedf0,_0x26bdf2);_0x1ab8a3(_0x26bdf2);});});}exports[_0xf74c('0x16')]=function(_0x4d61c6){var _0xa5fad9=this;return new Promise(function(_0x500bb2,_0x4f75a6){return db[_0xf74c('0x17')]['findAll']({'raw':_0x4d61c6[_0xf74c('0x18')]?_0x4d61c6[_0xf74c('0x18')][_0xf74c('0x19')]===undefined?!![]:![]:!![],'where':_0x4d61c6[_0xf74c('0x18')]?_0x4d61c6[_0xf74c('0x18')][_0xf74c('0x1a')]||null:null,'attributes':_0x4d61c6[_0xf74c('0x18')]?_0x4d61c6[_0xf74c('0x18')][_0xf74c('0x1b')]||null:null,'limit':_0x4d61c6[_0xf74c('0x18')]?_0x4d61c6[_0xf74c('0x18')][_0xf74c('0x1c')]||null:null,'include':_0x4d61c6[_0xf74c('0x18')]?_0x4d61c6[_0xf74c('0x18')][_0xf74c('0x1d')]?_[_0xf74c('0x1e')](_0x4d61c6[_0xf74c('0x18')][_0xf74c('0x1d')],function(_0x1af14f){return{'model':db[_0x1af14f[_0xf74c('0x1f')]],'as':_0x1af14f['as'],'attributes':_0x1af14f[_0xf74c('0x1b')],'include':_0x1af14f['include']?_[_0xf74c('0x1e')](_0x1af14f[_0xf74c('0x1d')],function(_0x1a993b){return{'model':db[_0x1a993b[_0xf74c('0x1f')]],'as':_0x1a993b['as'],'attributes':_0x1a993b[_0xf74c('0x1b')],'include':_0x1a993b['include']?_[_0xf74c('0x1e')](_0x1a993b[_0xf74c('0x1d')],function(_0x26b6ae){return{'model':db[_0x26b6ae[_0xf74c('0x1f')]],'as':_0x26b6ae['as'],'attributes':_0x26b6ae[_0xf74c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf74c('0x20')](function(_0x358de1){logger[_0xf74c('0x13')]('GetSalesforceAccount',_0x4d61c6);logger['debug'](_0xf74c('0x16'),_0x4d61c6,JSON['stringify'](_0x358de1));_0x500bb2(_0x358de1);})[_0xf74c('0x15')](function(_0x30a39f){logger['error'](_0xf74c('0x16'),_0x30a39f['message'],_0x4d61c6);_0x4f75a6(_0xa5fad9[_0xf74c('0xf')](0x1f4,_0x30a39f[_0xf74c('0x12')]));});});};exports[_0xf74c('0x21')]=function(_0x3178f2){var _0x203ca0=this;return new Promise(function(_0x48d4eb,_0x3fb7a7){return db['SalesforceAccount'][_0xf74c('0x22')]({'raw':_0x3178f2['options']?_0x3178f2[_0xf74c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3178f2['options']?_0x3178f2['options'][_0xf74c('0x1a')]||null:null,'attributes':_0x3178f2[_0xf74c('0x18')]?_0x3178f2[_0xf74c('0x18')][_0xf74c('0x1b')]||null:null,'include':_0x3178f2['options']?_0x3178f2[_0xf74c('0x18')][_0xf74c('0x1d')]?_[_0xf74c('0x1e')](_0x3178f2[_0xf74c('0x18')][_0xf74c('0x1d')],function(_0x1a3f4c){return{'model':db[_0x1a3f4c[_0xf74c('0x1f')]],'as':_0x1a3f4c['as'],'attributes':_0x1a3f4c[_0xf74c('0x1b')],'include':_0x1a3f4c[_0xf74c('0x1d')]?_['map'](_0x1a3f4c[_0xf74c('0x1d')],function(_0x55277e){return{'model':db[_0x55277e[_0xf74c('0x1f')]],'as':_0x55277e['as'],'attributes':_0x55277e[_0xf74c('0x1b')],'include':_0x55277e[_0xf74c('0x1d')]?_[_0xf74c('0x1e')](_0x55277e[_0xf74c('0x1d')],function(_0x519e08){return{'model':db[_0x519e08[_0xf74c('0x1f')]],'as':_0x519e08['as'],'attributes':_0x519e08[_0xf74c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf74c('0x20')](function(_0x20ce01){logger[_0xf74c('0x13')](_0xf74c('0x21'),_0x3178f2);logger[_0xf74c('0xb')](_0xf74c('0x21'),_0x3178f2,JSON[_0xf74c('0xe')](_0x20ce01));_0x48d4eb(_0x20ce01);})[_0xf74c('0x15')](function(_0x55c2ed){logger['error'](_0xf74c('0x21'),_0x55c2ed[_0xf74c('0x12')],_0x3178f2);_0x3fb7a7(_0x203ca0[_0xf74c('0xf')](0x1f4,_0x55c2ed[_0xf74c('0x12')]));});});};
\ No newline at end of file
+var _0x66c7=['info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','attributes','map','model','then','find','raw','ShowSalesforceAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x2584b8,_0x5e096c){var _0x28a489=function(_0x438912){while(--_0x438912){_0x2584b8['push'](_0x2584b8['shift']());}};_0x28a489(++_0x5e096c);}(_0x66c7,0x15c));var _0x766c=function(_0x412860,_0x23dfcc){_0x412860=_0x412860-0x0;var _0x59a702=_0x66c7[_0x412860];return _0x59a702;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require('bluebird');var rs=require(_0x766c('0x3'));var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require(_0x766c('0x5'))['db'];var utils=require(_0x766c('0x6'));var logger=require(_0x766c('0x7'))(_0x766c('0x8'));var config=require('../../config/environment');var jayson=require(_0x766c('0x9'));var client=jayson[_0x766c('0xa')][_0x766c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0b5f7,_0x46d290,_0x3c4683){return new BPromise(function(_0x22a524,_0x4488b8){return client['request'](_0xb0b5f7,_0x3c4683)['then'](function(_0x141744){logger[_0x766c('0xc')](_0x766c('0xd'),_0x46d290,'request\x20sent');logger[_0x766c('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x46d290,_0x766c('0xf'),JSON[_0x766c('0x10')](_0x141744));if(_0x141744[_0x766c('0x11')]){if(_0x141744[_0x766c('0x11')][_0x766c('0x12')]===0x1f4){logger[_0x766c('0x11')](_0x766c('0xd'),_0x46d290,_0x141744[_0x766c('0x11')][_0x766c('0x13')]);return _0x4488b8(_0x141744[_0x766c('0x11')][_0x766c('0x13')]);}logger[_0x766c('0x11')](_0x766c('0xd'),_0x46d290,_0x141744[_0x766c('0x11')][_0x766c('0x13')]);return _0x22a524(_0x141744['error']['message']);}else{logger['info'](_0x766c('0xd'),_0x46d290,_0x766c('0xf'));_0x22a524(_0x141744[_0x766c('0x14')][_0x766c('0x13')]);}})[_0x766c('0x15')](function(_0x357602){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x46d290,_0x357602);_0x4488b8(_0x357602);});});}exports[_0x766c('0x16')]=function(_0x23c566){var _0x105f60=this;return new Promise(function(_0x47c887,_0x2cd2e7){return db[_0x766c('0x17')][_0x766c('0x18')]({'raw':_0x23c566['options']?_0x23c566['options']['raw']===undefined?!![]:![]:!![],'where':_0x23c566[_0x766c('0x19')]?_0x23c566['options'][_0x766c('0x1a')]||null:null,'attributes':_0x23c566[_0x766c('0x19')]?_0x23c566['options']['attributes']||null:null,'limit':_0x23c566[_0x766c('0x19')]?_0x23c566[_0x766c('0x19')][_0x766c('0x1b')]||null:null,'include':_0x23c566['options']?_0x23c566[_0x766c('0x19')][_0x766c('0x1c')]?_['map'](_0x23c566['options']['include'],function(_0x43d91f){return{'model':db[_0x43d91f['model']],'as':_0x43d91f['as'],'attributes':_0x43d91f[_0x766c('0x1d')],'include':_0x43d91f[_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x43d91f['include'],function(_0x44659e){return{'model':db[_0x44659e[_0x766c('0x1f')]],'as':_0x44659e['as'],'attributes':_0x44659e[_0x766c('0x1d')],'include':_0x44659e[_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x44659e[_0x766c('0x1c')],function(_0x5ad1d6){return{'model':db[_0x5ad1d6[_0x766c('0x1f')]],'as':_0x5ad1d6['as'],'attributes':_0x5ad1d6[_0x766c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x766c('0x20')](function(_0x3a6757){logger[_0x766c('0xc')]('GetSalesforceAccount',_0x23c566);logger['debug'](_0x766c('0x16'),_0x23c566,JSON[_0x766c('0x10')](_0x3a6757));_0x47c887(_0x3a6757);})[_0x766c('0x15')](function(_0x549dde){logger[_0x766c('0x11')](_0x766c('0x16'),_0x549dde['message'],_0x23c566);_0x2cd2e7(_0x105f60[_0x766c('0x11')](0x1f4,_0x549dde['message']));});});};exports['ShowSalesforceAccount']=function(_0x3a4561){var _0x10421d=this;return new Promise(function(_0x1eac49,_0x5b94cf){return db[_0x766c('0x17')][_0x766c('0x21')]({'raw':_0x3a4561[_0x766c('0x19')]?_0x3a4561[_0x766c('0x19')][_0x766c('0x22')]===undefined?!![]:![]:!![],'where':_0x3a4561['options']?_0x3a4561['options'][_0x766c('0x1a')]||null:null,'attributes':_0x3a4561[_0x766c('0x19')]?_0x3a4561[_0x766c('0x19')][_0x766c('0x1d')]||null:null,'include':_0x3a4561[_0x766c('0x19')]?_0x3a4561['options'][_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x3a4561[_0x766c('0x19')]['include'],function(_0x17f5c6){return{'model':db[_0x17f5c6['model']],'as':_0x17f5c6['as'],'attributes':_0x17f5c6['attributes'],'include':_0x17f5c6[_0x766c('0x1c')]?_[_0x766c('0x1e')](_0x17f5c6[_0x766c('0x1c')],function(_0x182a81){return{'model':db[_0x182a81[_0x766c('0x1f')]],'as':_0x182a81['as'],'attributes':_0x182a81[_0x766c('0x1d')],'include':_0x182a81['include']?_['map'](_0x182a81[_0x766c('0x1c')],function(_0xad7de3){return{'model':db[_0xad7de3[_0x766c('0x1f')]],'as':_0xad7de3['as'],'attributes':_0xad7de3[_0x766c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x766c('0x20')](function(_0x20a900){logger[_0x766c('0xc')](_0x766c('0x23'),_0x3a4561);logger[_0x766c('0xe')](_0x766c('0x23'),_0x3a4561,JSON[_0x766c('0x10')](_0x20a900));_0x1eac49(_0x20a900);})[_0x766c('0x15')](function(_0x18b9b0){logger['error'](_0x766c('0x23'),_0x18b9b0['message'],_0x3a4561);_0x5b94cf(_0x10421d[_0x766c('0x11')](0x1f4,_0x18b9b0['message']));});});};
\ No newline at end of file
index 8dd633a..5d4ea03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x21715e,_0x394b71){var _0x11732c=function(_0x51e590){while(--_0x51e590){_0x21715e['push'](_0x21715e['shift']());}};_0x11732c(++_0x394b71);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2d49c4,_0x3dd163){_0x2d49c4=_0x2d49c4-0x0;var _0x418d3d=_0x5f2f[_0x2d49c4];return _0x418d3d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router;
\ No newline at end of file
+var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x430852,_0x318a72){var _0x23e3e8=function(_0x34dd61){while(--_0x34dd61){_0x430852['push'](_0x430852['shift']());}};_0x23e3e8(++_0x318a72);}(_0x2ef3,0xba));var _0x32ef=function(_0x220b2c,_0x26c763){_0x220b2c=_0x220b2c-0x0;var _0x5af126=_0x2ef3[_0x220b2c];return _0x5af126;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router;
\ No newline at end of file
index 7e6e7ac..1da19c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dbb=['lead','sequelize','exports','STRING','Task','Case','contact_lead','contact','account_contact_lead','account','nothing'];(function(_0x4a4280,_0x1ab95d){var _0x3873da=function(_0x6e2382){while(--_0x6e2382){_0x4a4280['push'](_0x4a4280['shift']());}};_0x3873da(++_0x1ab95d);}(_0x5dbb,0xdd));var _0xb5db=function(_0x4e31da,_0x1f8308){_0x4e31da=_0x4e31da-0x0;var _0x30651d=_0x5dbb[_0x4e31da];return _0x30651d;};'use strict';var Sequelize=require(_0xb5db('0x0'));module[_0xb5db('0x1')]={'name':{'type':Sequelize[_0xb5db('0x2')]},'description':{'type':Sequelize[_0xb5db('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xb5db('0x3'),_0xb5db('0x4')),'defaultValue':_0xb5db('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xb5db('0x5'),_0xb5db('0x6'),'lead',_0xb5db('0x7'),_0xb5db('0x8')),'defaultValue':_0xb5db('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0xb5db('0x9'),'contact',_0xb5db('0xa'),_0xb5db('0x8')),'defaultValue':_0xb5db('0xa')},'leadId':{'type':Sequelize[_0xb5db('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xb5db('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xb5db('0x2')]}};
\ No newline at end of file
+var _0x96bc=['account','sequelize','STRING','ENUM','Case','contact_lead','contact','lead'];(function(_0x2293a1,_0x28b408){var _0x96ae80=function(_0x3be9d){while(--_0x3be9d){_0x2293a1['push'](_0x2293a1['shift']());}};_0x96ae80(++_0x28b408);}(_0x96bc,0x91));var _0xc96b=function(_0x38e95c,_0x48160f){_0x38e95c=_0x38e95c-0x0;var _0x144381=_0x96bc[_0x38e95c];return _0x144381;};'use strict';var Sequelize=require(_0xc96b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc96b('0x1')]},'ticketType':{'type':Sequelize[_0xc96b('0x2')]('Task',_0xc96b('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xc96b('0x2')](_0xc96b('0x4'),_0xc96b('0x5'),_0xc96b('0x6'),'account_contact_lead',_0xc96b('0x7')),'defaultValue':_0xc96b('0x4')},'moduleCreate':{'type':Sequelize[_0xc96b('0x2')]('nothing',_0xc96b('0x5'),_0xc96b('0x6'),_0xc96b('0x7')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xc96b('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xc96b('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xc96b('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xc96b('0x1')]}};
\ No newline at end of file
index 747800a..16f461d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x446c=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','SalesforceConfiguration','findAll','rows','show','params','keys','includeAll','create','body','getFields','SalesforceField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then'];(function(_0x254fdb,_0x5c67b){var _0x30fefc=function(_0x29aeae){while(--_0x29aeae){_0x254fdb['push'](_0x254fdb['shift']());}};_0x30fefc(++_0x5c67b);}(_0x446c,0x156));var _0xc446=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0x446c[_0x3048ea];return _0x1a13c4;};'use strict';var emlformat=require(_0xc446('0x0'));var rimraf=require(_0xc446('0x1'));var zipdir=require(_0xc446('0x2'));var jsonpatch=require(_0xc446('0x3'));var rp=require('request-promise');var moment=require(_0xc446('0x4'));var BPromise=require(_0xc446('0x5'));var Mustache=require(_0xc446('0x6'));var util=require('util');var path=require(_0xc446('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc446('0x8'));var fs=require('fs');var fs_extra=require(_0xc446('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc446('0xa'));var jsforce=require(_0xc446('0xb'));var deskjs=require(_0xc446('0xc'));var toCsv=require(_0xc446('0xd'));var querystring=require(_0xc446('0xe'));var Papa=require('papaparse');var Redis=require(_0xc446('0xf'));var authService=require(_0xc446('0x10'));var qs=require(_0xc446('0x11'));var as=require(_0xc446('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc446('0x13'))(_0xc446('0x14'));var utils=require(_0xc446('0x15'));var config=require(_0xc446('0x16'));var licenseUtil=require(_0xc446('0x17'));var db=require(_0xc446('0x18'))['db'];var jayson=require(_0xc446('0x19'));var client=jayson[_0xc446('0x1a')][_0xc446('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2bc17f,_0x89a7,_0x306814,_0x1cfc0a){return new BPromise(function(_0x72faac,_0x21d8e4){var _0x20afd7=_0x1cfc0a||client;return _0x20afd7[_0xc446('0x1c')](_0x2bc17f,_0x306814)[_0xc446('0x1d')](function(_0x2b09db){logger['info'](_0xc446('0x1e'),_0x89a7,_0xc446('0x1f'));logger[_0xc446('0x20')](_0xc446('0x21'),_0x89a7,_0xc446('0x1f'),JSON[_0xc446('0x22')](_0x2b09db));if(_0x2b09db[_0xc446('0x23')]){if(_0x2b09db[_0xc446('0x23')][_0xc446('0x24')]===0x1f4){logger[_0xc446('0x23')]('SalesforceConfiguration,\x20%s,\x20%s',_0x89a7,_0x2b09db[_0xc446('0x23')][_0xc446('0x25')]);return _0x21d8e4(_0x2b09db['error'][_0xc446('0x25')]);}logger[_0xc446('0x23')](_0xc446('0x1e'),_0x89a7,_0x2b09db[_0xc446('0x23')][_0xc446('0x25')]);return _0x72faac(_0x2b09db[_0xc446('0x23')][_0xc446('0x25')]);}else{logger[_0xc446('0x26')](_0xc446('0x1e'),_0x89a7,_0xc446('0x1f'));_0x72faac(_0x2b09db['result'][_0xc446('0x25')]);}})[_0xc446('0x27')](function(_0x21dc0e){logger[_0xc446('0x23')](_0xc446('0x1e'),_0x89a7,_0x21dc0e);_0x21d8e4(_0x21dc0e);});});}function respondWithStatusCode(_0xb696e,_0x36a6f5){_0x36a6f5=_0x36a6f5||0xcc;return function(_0x1b785a){if(_0x1b785a){return _0xb696e[_0xc446('0x28')](_0x36a6f5);}return _0xb696e[_0xc446('0x29')](_0x36a6f5)[_0xc446('0x2a')]();};}function respondWithResult(_0x3b1748,_0x25f58d){_0x25f58d=_0x25f58d||0xc8;return function(_0x438410){if(_0x438410){return _0x3b1748[_0xc446('0x29')](_0x25f58d)[_0xc446('0x2b')](_0x438410);}};}function respondWithFilteredResult(_0x465e18,_0x51933d){return function(_0xb3ab06){if(_0xb3ab06){var _0x24943b=typeof _0x51933d[_0xc446('0x2c')]===_0xc446('0x2d')&&typeof _0x51933d[_0xc446('0x2e')]===_0xc446('0x2d');var _0x5d5aa8=_0xb3ab06['count'];var _0x37532c=_0x24943b?0x0:_0x51933d[_0xc446('0x2c')];var _0x19f57f=_0x24943b?_0xb3ab06[_0xc446('0x2f')]:_0x51933d['offset']+_0x51933d[_0xc446('0x2e')];var _0x8d3429;if(_0x19f57f>=_0x5d5aa8){_0x19f57f=_0x5d5aa8;_0x8d3429=0xc8;}else{_0x8d3429=0xce;}_0x465e18[_0xc446('0x29')](_0x8d3429);return _0x465e18[_0xc446('0x30')](_0xc446('0x31'),_0x37532c+'-'+_0x19f57f+'/'+_0x5d5aa8)[_0xc446('0x2b')](_0xb3ab06);}return null;};}function patchUpdates(_0x39302a){return function(_0x45b7c4){try{jsonpatch[_0xc446('0x32')](_0x45b7c4,_0x39302a,!![]);}catch(_0xfdec0b){return BPromise['reject'](_0xfdec0b);}return _0x45b7c4['save']();};}function saveUpdates(_0x4c1b7c,_0x32bbac){return function(_0x1bba90){if(_0x1bba90){return _0x1bba90[_0xc446('0x33')](_0x4c1b7c)[_0xc446('0x1d')](function(_0x177752){return _0x177752;});}return null;};}function removeEntity(_0x3244ab,_0x467d9c){return function(_0x47cda3){if(_0x47cda3){return _0x47cda3[_0xc446('0x34')]()[_0xc446('0x1d')](function(){_0x3244ab[_0xc446('0x29')](0xcc)[_0xc446('0x2a')]();});}};}function handleEntityNotFound(_0x964c61,_0x510f39){return function(_0x1f8e6f){if(!_0x1f8e6f){_0x964c61[_0xc446('0x28')](0x194);}return _0x1f8e6f;};}function handleError(_0x44d03f,_0x1b76c3){_0x1b76c3=_0x1b76c3||0x1f4;return function(_0x2c291c){logger[_0xc446('0x23')](_0x2c291c[_0xc446('0x35')]);if(_0x2c291c[_0xc446('0x36')]){delete _0x2c291c['name'];}_0x44d03f['status'](_0x1b76c3)[_0xc446('0x37')](_0x2c291c);};}exports[_0xc446('0x38')]=function(_0xf94cbd,_0x52c597){var _0x2b4dae={},_0x446c5f={},_0x23f03b={'count':0x0,'rows':[]};var _0x4d10a0=_['map'](db['SalesforceConfiguration'][_0xc446('0x39')],function(_0x5ceff9){return{'name':_0x5ceff9[_0xc446('0x3a')],'type':_0x5ceff9[_0xc446('0x3b')]['key']};});_0x446c5f[_0xc446('0x3c')]=_[_0xc446('0x3d')](_0x4d10a0,_0xc446('0x36'));_0x446c5f[_0xc446('0x3e')]=_['keys'](_0xf94cbd[_0xc446('0x3e')]);_0x446c5f[_0xc446('0x3f')]=_['intersection'](_0x446c5f[_0xc446('0x3c')],_0x446c5f[_0xc446('0x3e')]);_0x2b4dae[_0xc446('0x40')]=_[_0xc446('0x41')](_0x446c5f[_0xc446('0x3c')],qs['fields'](_0xf94cbd[_0xc446('0x3e')][_0xc446('0x42')]));_0x2b4dae[_0xc446('0x40')]=_0x2b4dae[_0xc446('0x40')][_0xc446('0x43')]?_0x2b4dae['attributes']:_0x446c5f[_0xc446('0x3c')];if(!_0xf94cbd[_0xc446('0x3e')][_0xc446('0x44')](_0xc446('0x45'))){_0x2b4dae[_0xc446('0x2e')]=qs['limit'](_0xf94cbd[_0xc446('0x3e')]['limit']);_0x2b4dae[_0xc446('0x2c')]=qs[_0xc446('0x2c')](_0xf94cbd['query'][_0xc446('0x2c')]);}_0x2b4dae[_0xc446('0x46')]=qs[_0xc446('0x47')](_0xf94cbd[_0xc446('0x3e')][_0xc446('0x47')]);_0x2b4dae[_0xc446('0x48')]=qs['filters'](_[_0xc446('0x49')](_0xf94cbd[_0xc446('0x3e')],_0x446c5f[_0xc446('0x3f')]),_0x4d10a0);if(_0xf94cbd['query'][_0xc446('0x4a')]){_0x2b4dae[_0xc446('0x48')]=_[_0xc446('0x4b')](_0x2b4dae[_0xc446('0x48')],{'$or':_[_0xc446('0x3d')](_0x4d10a0,function(_0x2a2aaa){if(_0x2a2aaa[_0xc446('0x3b')]!==_0xc446('0x4c')){var _0x4545c0={};_0x4545c0[_0x2a2aaa[_0xc446('0x36')]]={'$like':'%'+_0xf94cbd[_0xc446('0x3e')][_0xc446('0x4a')]+'%'};return _0x4545c0;}})});}_0x2b4dae=_[_0xc446('0x4b')]({},_0x2b4dae,_0xf94cbd[_0xc446('0x4d')]);var _0x3d1581={'where':_0x2b4dae['where']};return db['SalesforceConfiguration'][_0xc446('0x2f')](_0x3d1581)[_0xc446('0x1d')](function(_0x501424){_0x23f03b['count']=_0x501424;if(_0xf94cbd['query']['includeAll']){_0x2b4dae[_0xc446('0x4e')]=[{'all':!![]}];}return db[_0xc446('0x4f')][_0xc446('0x50')](_0x2b4dae);})[_0xc446('0x1d')](function(_0x19ca3d){_0x23f03b[_0xc446('0x51')]=_0x19ca3d;return _0x23f03b;})[_0xc446('0x1d')](respondWithFilteredResult(_0x52c597,_0x2b4dae))[_0xc446('0x27')](handleError(_0x52c597,null));};exports[_0xc446('0x52')]=function(_0x2114d2,_0x5e5c4a){var _0x40aa4f={'raw':![],'where':{'id':_0x2114d2[_0xc446('0x53')]['id']}},_0x317559={};_0x317559['model']=_[_0xc446('0x54')](db['SalesforceConfiguration'][_0xc446('0x39')]);_0x317559[_0xc446('0x3e')]=_[_0xc446('0x54')](_0x2114d2[_0xc446('0x3e')]);_0x317559[_0xc446('0x3f')]=_['intersection'](_0x317559[_0xc446('0x3c')],_0x317559['query']);_0x40aa4f[_0xc446('0x40')]=_['intersection'](_0x317559[_0xc446('0x3c')],qs['fields'](_0x2114d2[_0xc446('0x3e')][_0xc446('0x42')]));_0x40aa4f['attributes']=_0x40aa4f['attributes'][_0xc446('0x43')]?_0x40aa4f['attributes']:_0x317559[_0xc446('0x3c')];if(_0x2114d2[_0xc446('0x3e')][_0xc446('0x55')]){_0x40aa4f[_0xc446('0x4e')]=[{'all':!![]}];}_0x40aa4f=_[_0xc446('0x4b')]({},_0x40aa4f,_0x2114d2[_0xc446('0x4d')]);return db[_0xc446('0x4f')]['find'](_0x40aa4f)[_0xc446('0x1d')](handleEntityNotFound(_0x5e5c4a,null))[_0xc446('0x1d')](respondWithResult(_0x5e5c4a,null))[_0xc446('0x27')](handleError(_0x5e5c4a,null));};exports[_0xc446('0x56')]=function(_0x4cf59b,_0x3860ba){return db[_0xc446('0x4f')][_0xc446('0x56')](_0x4cf59b[_0xc446('0x57')],{})[_0xc446('0x1d')](respondWithResult(_0x3860ba,0xc9))[_0xc446('0x27')](handleError(_0x3860ba,null));};exports[_0xc446('0x33')]=function(_0x553435,_0x93969e){if(_0x553435[_0xc446('0x57')]['id']){delete _0x553435[_0xc446('0x57')]['id'];}return db[_0xc446('0x4f')]['find']({'where':{'id':_0x553435['params']['id']}})[_0xc446('0x1d')](handleEntityNotFound(_0x93969e,null))['then'](saveUpdates(_0x553435[_0xc446('0x57')],null))[_0xc446('0x1d')](respondWithResult(_0x93969e,null))[_0xc446('0x27')](handleError(_0x93969e,null));};exports['destroy']=function(_0x1d3be5,_0x21fa07){return db[_0xc446('0x4f')]['find']({'where':{'id':_0x1d3be5['params']['id']}})[_0xc446('0x1d')](handleEntityNotFound(_0x21fa07,null))[_0xc446('0x1d')](removeEntity(_0x21fa07,null))[_0xc446('0x27')](handleError(_0x21fa07,null));};exports[_0xc446('0x58')]=function(_0x1e1393,_0x426f0d,_0x12225e){var _0x467751={};var _0x35ba56={};var _0x3d0031;var _0x41733e;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1e1393['params']['id']}})['then'](handleEntityNotFound(_0x426f0d,null))['then'](function(_0x1aee84){if(_0x1aee84){_0x3d0031=_0x1aee84;_0x35ba56[_0xc446('0x3c')]=_[_0xc446('0x54')](db[_0xc446('0x59')][_0xc446('0x39')]);_0x35ba56['query']=_[_0xc446('0x54')](_0x1e1393['query']);_0x35ba56[_0xc446('0x3f')]=_[_0xc446('0x41')](_0x35ba56[_0xc446('0x3c')],_0x35ba56['query']);_0x467751[_0xc446('0x40')]=_['intersection'](_0x35ba56[_0xc446('0x3c')],qs[_0xc446('0x42')](_0x1e1393['query'][_0xc446('0x42')]));_0x467751[_0xc446('0x40')]=_0x467751[_0xc446('0x40')][_0xc446('0x43')]?_0x467751['attributes']:_0x35ba56[_0xc446('0x3c')];_0x467751[_0xc446('0x46')]=qs[_0xc446('0x47')](_0x1e1393[_0xc446('0x3e')]['sort']);_0x467751['where']=qs[_0xc446('0x3f')](_[_0xc446('0x49')](_0x1e1393[_0xc446('0x3e')],_0x35ba56[_0xc446('0x3f')]));if(_0x1e1393[_0xc446('0x3e')][_0xc446('0x4a')]){_0x467751[_0xc446('0x48')]=_['merge'](_0x467751[_0xc446('0x48')],{'$or':_[_0xc446('0x3d')](_0x467751[_0xc446('0x40')],function(_0x581f89){var _0x595f4a={};_0x595f4a[_0x581f89]={'$like':'%'+_0x1e1393['query']['filter']+'%'};return _0x595f4a;})});}_0x467751=_['merge']({},_0x467751,_0x1e1393[_0xc446('0x4d')]);return _0x3d0031['getFields'](_0x467751);}})[_0xc446('0x1d')](function(_0x209e70){if(_0x209e70){_0x41733e=_0x209e70[_0xc446('0x43')];if(!_0x1e1393[_0xc446('0x3e')][_0xc446('0x44')](_0xc446('0x45'))){_0x467751[_0xc446('0x2e')]=qs[_0xc446('0x2e')](_0x1e1393[_0xc446('0x3e')][_0xc446('0x2e')]);_0x467751['offset']=qs[_0xc446('0x2c')](_0x1e1393[_0xc446('0x3e')][_0xc446('0x2c')]);}return _0x3d0031[_0xc446('0x58')](_0x467751);}})['then'](function(_0x3d9c4a){if(_0x3d9c4a){return _0x3d9c4a?{'count':_0x41733e,'rows':_0x3d9c4a}:null;}})[_0xc446('0x1d')](respondWithResult(_0x426f0d,null))[_0xc446('0x27')](handleError(_0x426f0d,null));};exports[_0xc446('0x5a')]=function(_0x56c074,_0x4d7cc5,_0x30e551){var _0x4cd70={};var _0x593f9c={};var _0x504082;var _0x5f2ab8;return db[_0xc446('0x4f')][_0xc446('0x5b')]({'where':{'id':_0x56c074[_0xc446('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d7cc5,null))[_0xc446('0x1d')](function(_0x4bd1b8){if(_0x4bd1b8){_0x504082=_0x4bd1b8;_0x593f9c[_0xc446('0x3c')]=_[_0xc446('0x54')](db[_0xc446('0x59')][_0xc446('0x39')]);_0x593f9c[_0xc446('0x3e')]=_[_0xc446('0x54')](_0x56c074[_0xc446('0x3e')]);_0x593f9c['filters']=_[_0xc446('0x41')](_0x593f9c[_0xc446('0x3c')],_0x593f9c[_0xc446('0x3e')]);_0x4cd70[_0xc446('0x40')]=_[_0xc446('0x41')](_0x593f9c['model'],qs['fields'](_0x56c074[_0xc446('0x3e')]['fields']));_0x4cd70[_0xc446('0x40')]=_0x4cd70[_0xc446('0x40')][_0xc446('0x43')]?_0x4cd70[_0xc446('0x40')]:_0x593f9c['model'];_0x4cd70[_0xc446('0x46')]=qs[_0xc446('0x47')](_0x56c074[_0xc446('0x3e')][_0xc446('0x47')]);_0x4cd70[_0xc446('0x48')]=qs[_0xc446('0x3f')](_[_0xc446('0x49')](_0x56c074[_0xc446('0x3e')],_0x593f9c['filters']));if(_0x56c074['query'][_0xc446('0x4a')]){_0x4cd70['where']=_['merge'](_0x4cd70[_0xc446('0x48')],{'$or':_[_0xc446('0x3d')](_0x4cd70['attributes'],function(_0x180841){var _0x22f890={};_0x22f890[_0x180841]={'$like':'%'+_0x56c074['query']['filter']+'%'};return _0x22f890;})});}_0x4cd70=_[_0xc446('0x4b')]({},_0x4cd70,_0x56c074[_0xc446('0x4d')]);return _0x504082[_0xc446('0x5a')](_0x4cd70);}})[_0xc446('0x1d')](function(_0x55c3cc){if(_0x55c3cc){_0x5f2ab8=_0x55c3cc[_0xc446('0x43')];if(!_0x56c074[_0xc446('0x3e')][_0xc446('0x44')](_0xc446('0x45'))){_0x4cd70[_0xc446('0x2e')]=qs[_0xc446('0x2e')](_0x56c074[_0xc446('0x3e')]['limit']);_0x4cd70[_0xc446('0x2c')]=qs[_0xc446('0x2c')](_0x56c074[_0xc446('0x3e')][_0xc446('0x2c')]);}return _0x504082[_0xc446('0x5a')](_0x4cd70);}})['then'](function(_0x498560){if(_0x498560){return _0x498560?{'count':_0x5f2ab8,'rows':_0x498560}:null;}})[_0xc446('0x1d')](respondWithResult(_0x4d7cc5,null))['catch'](handleError(_0x4d7cc5,null));};exports['getDescriptions']=function(_0x432ddd,_0x197ae0,_0x4ef667){var _0x59782d={};var _0x317f0f={};var _0x1df147;var _0x416adc;return db[_0xc446('0x4f')][_0xc446('0x5b')]({'where':{'id':_0x432ddd[_0xc446('0x53')]['id']}})[_0xc446('0x1d')](handleEntityNotFound(_0x197ae0,null))[_0xc446('0x1d')](function(_0x29b170){if(_0x29b170){_0x1df147=_0x29b170;_0x317f0f['model']=_[_0xc446('0x54')](db[_0xc446('0x59')]['rawAttributes']);_0x317f0f[_0xc446('0x3e')]=_[_0xc446('0x54')](_0x432ddd[_0xc446('0x3e')]);_0x317f0f[_0xc446('0x3f')]=_[_0xc446('0x41')](_0x317f0f['model'],_0x317f0f['query']);_0x59782d[_0xc446('0x40')]=_[_0xc446('0x41')](_0x317f0f[_0xc446('0x3c')],qs[_0xc446('0x42')](_0x432ddd[_0xc446('0x3e')][_0xc446('0x42')]));_0x59782d['attributes']=_0x59782d[_0xc446('0x40')][_0xc446('0x43')]?_0x59782d[_0xc446('0x40')]:_0x317f0f[_0xc446('0x3c')];_0x59782d[_0xc446('0x46')]=qs[_0xc446('0x47')](_0x432ddd[_0xc446('0x3e')]['sort']);_0x59782d[_0xc446('0x48')]=qs[_0xc446('0x3f')](_['pick'](_0x432ddd[_0xc446('0x3e')],_0x317f0f[_0xc446('0x3f')]));if(_0x432ddd['query'][_0xc446('0x4a')]){_0x59782d[_0xc446('0x48')]=_[_0xc446('0x4b')](_0x59782d['where'],{'$or':_[_0xc446('0x3d')](_0x59782d[_0xc446('0x40')],function(_0x290452){var _0x462d8b={};_0x462d8b[_0x290452]={'$like':'%'+_0x432ddd[_0xc446('0x3e')][_0xc446('0x4a')]+'%'};return _0x462d8b;})});}_0x59782d=_['merge']({},_0x59782d,_0x432ddd[_0xc446('0x4d')]);return _0x1df147[_0xc446('0x5c')](_0x59782d);}})['then'](function(_0x1aa546){if(_0x1aa546){_0x416adc=_0x1aa546[_0xc446('0x43')];if(!_0x432ddd[_0xc446('0x3e')][_0xc446('0x44')]('nolimit')){_0x59782d['limit']=qs[_0xc446('0x2e')](_0x432ddd[_0xc446('0x3e')][_0xc446('0x2e')]);_0x59782d['offset']=qs['offset'](_0x432ddd[_0xc446('0x3e')][_0xc446('0x2c')]);}return _0x1df147['getDescriptions'](_0x59782d);}})[_0xc446('0x1d')](function(_0xe9784b){if(_0xe9784b){return _0xe9784b?{'count':_0x416adc,'rows':_0xe9784b}:null;}})['then'](respondWithResult(_0x197ae0,null))[_0xc446('0x27')](handleError(_0x197ae0,null));};
\ No newline at end of file
+var _0x0763=['stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','where','merge','filter','options','count','includeAll','include','findAll','show','params','length','create','body','find','getFields','SalesforceField','nolimit','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','limit','set','apply','reject','update','destroy','end','sendStatus'];(function(_0x14278e,_0x326950){var _0x5b3191=function(_0x143000){while(--_0x143000){_0x14278e['push'](_0x14278e['shift']());}};_0x5b3191(++_0x326950);}(_0x0763,0x87));var _0x3076=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x0763[_0x35d775];return _0x59384d;};'use strict';var emlformat=require(_0x3076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3076('0x1'));var jsonpatch=require(_0x3076('0x2'));var rp=require('request-promise');var moment=require(_0x3076('0x3'));var BPromise=require(_0x3076('0x4'));var Mustache=require(_0x3076('0x5'));var util=require(_0x3076('0x6'));var path=require('path');var sox=require(_0x3076('0x7'));var csv=require(_0x3076('0x8'));var ejs=require(_0x3076('0x9'));var fs=require('fs');var fs_extra=require(_0x3076('0xa'));var _=require(_0x3076('0xb'));var squel=require(_0x3076('0xc'));var crypto=require(_0x3076('0xd'));var jsforce=require(_0x3076('0xe'));var deskjs=require(_0x3076('0xf'));var toCsv=require(_0x3076('0x8'));var querystring=require('querystring');var Papa=require(_0x3076('0x10'));var Redis=require(_0x3076('0x11'));var authService=require(_0x3076('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3076('0x13'));var logger=require(_0x3076('0x14'))(_0x3076('0x15'));var utils=require(_0x3076('0x16'));var config=require(_0x3076('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3076('0x18'))['db'];var jayson=require(_0x3076('0x19'));var client=jayson[_0x3076('0x1a')][_0x3076('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3dfb6f,_0xb7c119,_0x43f24d,_0x3a6f74){return new BPromise(function(_0x54ff6a,_0x5542c7){var _0x2a296b=_0x3a6f74||client;return _0x2a296b[_0x3076('0x1c')](_0x3dfb6f,_0x43f24d)[_0x3076('0x1d')](function(_0x1b2256){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0xb7c119,_0x3076('0x1e'));logger[_0x3076('0x1f')](_0x3076('0x20'),_0xb7c119,_0x3076('0x1e'),JSON[_0x3076('0x21')](_0x1b2256));if(_0x1b2256[_0x3076('0x22')]){if(_0x1b2256[_0x3076('0x22')][_0x3076('0x23')]===0x1f4){logger[_0x3076('0x22')](_0x3076('0x24'),_0xb7c119,_0x1b2256[_0x3076('0x22')][_0x3076('0x25')]);return _0x5542c7(_0x1b2256['error'][_0x3076('0x25')]);}logger[_0x3076('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0xb7c119,_0x1b2256[_0x3076('0x22')]['message']);return _0x54ff6a(_0x1b2256[_0x3076('0x22')][_0x3076('0x25')]);}else{logger[_0x3076('0x26')]('SalesforceConfiguration,\x20%s,\x20%s',_0xb7c119,_0x3076('0x1e'));_0x54ff6a(_0x1b2256[_0x3076('0x27')][_0x3076('0x25')]);}})[_0x3076('0x28')](function(_0x58f284){logger[_0x3076('0x22')](_0x3076('0x24'),_0xb7c119,_0x58f284);_0x5542c7(_0x58f284);});});}function respondWithStatusCode(_0xa975bc,_0x195606){_0x195606=_0x195606||0xcc;return function(_0x39a33c){if(_0x39a33c){return _0xa975bc['sendStatus'](_0x195606);}return _0xa975bc[_0x3076('0x29')](_0x195606)['end']();};}function respondWithResult(_0x116de4,_0x4f4bdc){_0x4f4bdc=_0x4f4bdc||0xc8;return function(_0x53b45d){if(_0x53b45d){return _0x116de4[_0x3076('0x29')](_0x4f4bdc)[_0x3076('0x2a')](_0x53b45d);}};}function respondWithFilteredResult(_0x2f0848,_0x1b169b){return function(_0x28d834){if(_0x28d834){var _0x258427=typeof _0x1b169b[_0x3076('0x2b')]===_0x3076('0x2c')&&typeof _0x1b169b[_0x3076('0x2d')]===_0x3076('0x2c');var _0x11ac48=_0x28d834['count'];var _0x181591=_0x258427?0x0:_0x1b169b[_0x3076('0x2b')];var _0x32bdbd=_0x258427?_0x28d834['count']:_0x1b169b[_0x3076('0x2b')]+_0x1b169b[_0x3076('0x2d')];var _0x587585;if(_0x32bdbd>=_0x11ac48){_0x32bdbd=_0x11ac48;_0x587585=0xc8;}else{_0x587585=0xce;}_0x2f0848[_0x3076('0x29')](_0x587585);return _0x2f0848[_0x3076('0x2e')]('Content-Range',_0x181591+'-'+_0x32bdbd+'/'+_0x11ac48)[_0x3076('0x2a')](_0x28d834);}return null;};}function patchUpdates(_0x5337bc){return function(_0x4d6f8f){try{jsonpatch[_0x3076('0x2f')](_0x4d6f8f,_0x5337bc,!![]);}catch(_0x3aa320){return BPromise[_0x3076('0x30')](_0x3aa320);}return _0x4d6f8f['save']();};}function saveUpdates(_0x269302,_0x3c1e76){return function(_0x344b84){if(_0x344b84){return _0x344b84[_0x3076('0x31')](_0x269302)['then'](function(_0x44fd84){return _0x44fd84;});}return null;};}function removeEntity(_0x298127,_0x326c5f){return function(_0x1958c4){if(_0x1958c4){return _0x1958c4[_0x3076('0x32')]()['then'](function(){_0x298127[_0x3076('0x29')](0xcc)[_0x3076('0x33')]();});}};}function handleEntityNotFound(_0x17be06,_0x468564){return function(_0x2f53c6){if(!_0x2f53c6){_0x17be06[_0x3076('0x34')](0x194);}return _0x2f53c6;};}function handleError(_0x545614,_0x171d0a){_0x171d0a=_0x171d0a||0x1f4;return function(_0x538502){logger[_0x3076('0x22')](_0x538502[_0x3076('0x35')]);if(_0x538502[_0x3076('0x36')]){delete _0x538502[_0x3076('0x36')];}_0x545614[_0x3076('0x29')](_0x171d0a)[_0x3076('0x37')](_0x538502);};}exports[_0x3076('0x38')]=function(_0x45e543,_0x27dbee){var _0x2c912c={},_0x2ea216={},_0xda5264={'count':0x0,'rows':[]};var _0x130944=_[_0x3076('0x39')](db[_0x3076('0x3a')][_0x3076('0x3b')],function(_0xf7dc05){return{'name':_0xf7dc05[_0x3076('0x3c')],'type':_0xf7dc05[_0x3076('0x3d')][_0x3076('0x3e')]};});_0x2ea216[_0x3076('0x3f')]=_[_0x3076('0x39')](_0x130944,_0x3076('0x36'));_0x2ea216[_0x3076('0x40')]=_[_0x3076('0x41')](_0x45e543[_0x3076('0x40')]);_0x2ea216[_0x3076('0x42')]=_['intersection'](_0x2ea216[_0x3076('0x3f')],_0x2ea216[_0x3076('0x40')]);_0x2c912c[_0x3076('0x43')]=_[_0x3076('0x44')](_0x2ea216['model'],qs[_0x3076('0x45')](_0x45e543[_0x3076('0x40')][_0x3076('0x45')]));_0x2c912c[_0x3076('0x43')]=_0x2c912c[_0x3076('0x43')]['length']?_0x2c912c[_0x3076('0x43')]:_0x2ea216[_0x3076('0x3f')];if(!_0x45e543[_0x3076('0x40')][_0x3076('0x46')]('nolimit')){_0x2c912c[_0x3076('0x2d')]=qs[_0x3076('0x2d')](_0x45e543[_0x3076('0x40')][_0x3076('0x2d')]);_0x2c912c[_0x3076('0x2b')]=qs[_0x3076('0x2b')](_0x45e543[_0x3076('0x40')][_0x3076('0x2b')]);}_0x2c912c[_0x3076('0x47')]=qs['sort'](_0x45e543[_0x3076('0x40')][_0x3076('0x48')]);_0x2c912c['where']=qs['filters'](_[_0x3076('0x49')](_0x45e543[_0x3076('0x40')],_0x2ea216[_0x3076('0x42')]),_0x130944);if(_0x45e543[_0x3076('0x40')]['filter']){_0x2c912c[_0x3076('0x4a')]=_[_0x3076('0x4b')](_0x2c912c[_0x3076('0x4a')],{'$or':_['map'](_0x130944,function(_0x146d3b){if(_0x146d3b[_0x3076('0x3d')]!=='VIRTUAL'){var _0x47d67b={};_0x47d67b[_0x146d3b['name']]={'$like':'%'+_0x45e543['query'][_0x3076('0x4c')]+'%'};return _0x47d67b;}})});}_0x2c912c=_['merge']({},_0x2c912c,_0x45e543[_0x3076('0x4d')]);var _0x5f09bd={'where':_0x2c912c['where']};return db[_0x3076('0x3a')][_0x3076('0x4e')](_0x5f09bd)[_0x3076('0x1d')](function(_0x7405d6){_0xda5264[_0x3076('0x4e')]=_0x7405d6;if(_0x45e543[_0x3076('0x40')][_0x3076('0x4f')]){_0x2c912c[_0x3076('0x50')]=[{'all':!![]}];}return db[_0x3076('0x3a')][_0x3076('0x51')](_0x2c912c);})[_0x3076('0x1d')](function(_0x46fdf0){_0xda5264['rows']=_0x46fdf0;return _0xda5264;})[_0x3076('0x1d')](respondWithFilteredResult(_0x27dbee,_0x2c912c))['catch'](handleError(_0x27dbee,null));};exports[_0x3076('0x52')]=function(_0x4043ef,_0x4bd856){var _0x5a7b95={'raw':![],'where':{'id':_0x4043ef[_0x3076('0x53')]['id']}},_0x431a9e={};_0x431a9e[_0x3076('0x3f')]=_[_0x3076('0x41')](db['SalesforceConfiguration'][_0x3076('0x3b')]);_0x431a9e[_0x3076('0x40')]=_['keys'](_0x4043ef[_0x3076('0x40')]);_0x431a9e['filters']=_['intersection'](_0x431a9e[_0x3076('0x3f')],_0x431a9e[_0x3076('0x40')]);_0x5a7b95[_0x3076('0x43')]=_[_0x3076('0x44')](_0x431a9e[_0x3076('0x3f')],qs[_0x3076('0x45')](_0x4043ef[_0x3076('0x40')]['fields']));_0x5a7b95[_0x3076('0x43')]=_0x5a7b95['attributes'][_0x3076('0x54')]?_0x5a7b95[_0x3076('0x43')]:_0x431a9e['model'];if(_0x4043ef['query']['includeAll']){_0x5a7b95[_0x3076('0x50')]=[{'all':!![]}];}_0x5a7b95=_[_0x3076('0x4b')]({},_0x5a7b95,_0x4043ef[_0x3076('0x4d')]);return db['SalesforceConfiguration']['find'](_0x5a7b95)['then'](handleEntityNotFound(_0x4bd856,null))[_0x3076('0x1d')](respondWithResult(_0x4bd856,null))[_0x3076('0x28')](handleError(_0x4bd856,null));};exports[_0x3076('0x55')]=function(_0x4d3983,_0xca559d){return db['SalesforceConfiguration'][_0x3076('0x55')](_0x4d3983[_0x3076('0x56')],{})[_0x3076('0x1d')](respondWithResult(_0xca559d,0xc9))[_0x3076('0x28')](handleError(_0xca559d,null));};exports[_0x3076('0x31')]=function(_0x12acfe,_0x5a19a8){if(_0x12acfe[_0x3076('0x56')]['id']){delete _0x12acfe[_0x3076('0x56')]['id'];}return db[_0x3076('0x3a')][_0x3076('0x57')]({'where':{'id':_0x12acfe[_0x3076('0x53')]['id']}})['then'](handleEntityNotFound(_0x5a19a8,null))[_0x3076('0x1d')](saveUpdates(_0x12acfe[_0x3076('0x56')],null))['then'](respondWithResult(_0x5a19a8,null))[_0x3076('0x28')](handleError(_0x5a19a8,null));};exports['destroy']=function(_0x336be0,_0x37098d){return db[_0x3076('0x3a')][_0x3076('0x57')]({'where':{'id':_0x336be0[_0x3076('0x53')]['id']}})[_0x3076('0x1d')](handleEntityNotFound(_0x37098d,null))[_0x3076('0x1d')](removeEntity(_0x37098d,null))[_0x3076('0x28')](handleError(_0x37098d,null));};exports[_0x3076('0x58')]=function(_0x4f70f9,_0x4edccb,_0x15aa1f){var _0x5b83ca={};var _0xcc85e={};var _0x3edeca;var _0x2ef926;return db[_0x3076('0x3a')]['findOne']({'where':{'id':_0x4f70f9['params']['id']}})['then'](handleEntityNotFound(_0x4edccb,null))[_0x3076('0x1d')](function(_0x905476){if(_0x905476){_0x3edeca=_0x905476;_0xcc85e[_0x3076('0x3f')]=_[_0x3076('0x41')](db[_0x3076('0x59')][_0x3076('0x3b')]);_0xcc85e[_0x3076('0x40')]=_[_0x3076('0x41')](_0x4f70f9[_0x3076('0x40')]);_0xcc85e[_0x3076('0x42')]=_['intersection'](_0xcc85e[_0x3076('0x3f')],_0xcc85e['query']);_0x5b83ca[_0x3076('0x43')]=_[_0x3076('0x44')](_0xcc85e[_0x3076('0x3f')],qs[_0x3076('0x45')](_0x4f70f9['query'][_0x3076('0x45')]));_0x5b83ca['attributes']=_0x5b83ca[_0x3076('0x43')][_0x3076('0x54')]?_0x5b83ca[_0x3076('0x43')]:_0xcc85e['model'];_0x5b83ca[_0x3076('0x47')]=qs[_0x3076('0x48')](_0x4f70f9['query'][_0x3076('0x48')]);_0x5b83ca['where']=qs[_0x3076('0x42')](_['pick'](_0x4f70f9[_0x3076('0x40')],_0xcc85e[_0x3076('0x42')]));if(_0x4f70f9[_0x3076('0x40')]['filter']){_0x5b83ca[_0x3076('0x4a')]=_['merge'](_0x5b83ca[_0x3076('0x4a')],{'$or':_[_0x3076('0x39')](_0x5b83ca[_0x3076('0x43')],function(_0x436d8b){var _0x12ede1={};_0x12ede1[_0x436d8b]={'$like':'%'+_0x4f70f9['query']['filter']+'%'};return _0x12ede1;})});}_0x5b83ca=_[_0x3076('0x4b')]({},_0x5b83ca,_0x4f70f9['options']);return _0x3edeca[_0x3076('0x58')](_0x5b83ca);}})[_0x3076('0x1d')](function(_0x510534){if(_0x510534){_0x2ef926=_0x510534[_0x3076('0x54')];if(!_0x4f70f9['query'][_0x3076('0x46')](_0x3076('0x5a'))){_0x5b83ca['limit']=qs[_0x3076('0x2d')](_0x4f70f9[_0x3076('0x40')][_0x3076('0x2d')]);_0x5b83ca[_0x3076('0x2b')]=qs[_0x3076('0x2b')](_0x4f70f9[_0x3076('0x40')][_0x3076('0x2b')]);}return _0x3edeca[_0x3076('0x58')](_0x5b83ca);}})[_0x3076('0x1d')](function(_0x45b55a){if(_0x45b55a){return _0x45b55a?{'count':_0x2ef926,'rows':_0x45b55a}:null;}})[_0x3076('0x1d')](respondWithResult(_0x4edccb,null))[_0x3076('0x28')](handleError(_0x4edccb,null));};exports['getSubjects']=function(_0x3ca81a,_0x2c482d,_0x39bf51){var _0xa57207={};var _0x5bc813={};var _0x55b00e;var _0xc24f26;return db[_0x3076('0x3a')][_0x3076('0x5b')]({'where':{'id':_0x3ca81a['params']['id']}})[_0x3076('0x1d')](handleEntityNotFound(_0x2c482d,null))[_0x3076('0x1d')](function(_0x3b0355){if(_0x3b0355){_0x55b00e=_0x3b0355;_0x5bc813[_0x3076('0x3f')]=_[_0x3076('0x41')](db[_0x3076('0x59')][_0x3076('0x3b')]);_0x5bc813[_0x3076('0x40')]=_[_0x3076('0x41')](_0x3ca81a[_0x3076('0x40')]);_0x5bc813['filters']=_[_0x3076('0x44')](_0x5bc813[_0x3076('0x3f')],_0x5bc813['query']);_0xa57207[_0x3076('0x43')]=_[_0x3076('0x44')](_0x5bc813['model'],qs[_0x3076('0x45')](_0x3ca81a[_0x3076('0x40')][_0x3076('0x45')]));_0xa57207[_0x3076('0x43')]=_0xa57207[_0x3076('0x43')]['length']?_0xa57207[_0x3076('0x43')]:_0x5bc813['model'];_0xa57207[_0x3076('0x47')]=qs[_0x3076('0x48')](_0x3ca81a['query'][_0x3076('0x48')]);_0xa57207[_0x3076('0x4a')]=qs['filters'](_[_0x3076('0x49')](_0x3ca81a['query'],_0x5bc813[_0x3076('0x42')]));if(_0x3ca81a[_0x3076('0x40')][_0x3076('0x4c')]){_0xa57207[_0x3076('0x4a')]=_[_0x3076('0x4b')](_0xa57207[_0x3076('0x4a')],{'$or':_[_0x3076('0x39')](_0xa57207[_0x3076('0x43')],function(_0x1e65ce){var _0x14e42e={};_0x14e42e[_0x1e65ce]={'$like':'%'+_0x3ca81a[_0x3076('0x40')]['filter']+'%'};return _0x14e42e;})});}_0xa57207=_[_0x3076('0x4b')]({},_0xa57207,_0x3ca81a[_0x3076('0x4d')]);return _0x55b00e[_0x3076('0x5c')](_0xa57207);}})[_0x3076('0x1d')](function(_0x3b2476){if(_0x3b2476){_0xc24f26=_0x3b2476[_0x3076('0x54')];if(!_0x3ca81a[_0x3076('0x40')]['hasOwnProperty'](_0x3076('0x5a'))){_0xa57207[_0x3076('0x2d')]=qs[_0x3076('0x2d')](_0x3ca81a[_0x3076('0x40')]['limit']);_0xa57207[_0x3076('0x2b')]=qs['offset'](_0x3ca81a[_0x3076('0x40')][_0x3076('0x2b')]);}return _0x55b00e[_0x3076('0x5c')](_0xa57207);}})[_0x3076('0x1d')](function(_0x3b2a35){if(_0x3b2a35){return _0x3b2a35?{'count':_0xc24f26,'rows':_0x3b2a35}:null;}})[_0x3076('0x1d')](respondWithResult(_0x2c482d,null))[_0x3076('0x28')](handleError(_0x2c482d,null));};exports[_0x3076('0x5d')]=function(_0x3d356b,_0x3ded42,_0x418a62){var _0x1b0808={};var _0x41ea57={};var _0x52ed53;var _0x206e37;return db[_0x3076('0x3a')][_0x3076('0x5b')]({'where':{'id':_0x3d356b[_0x3076('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ded42,null))[_0x3076('0x1d')](function(_0x170b13){if(_0x170b13){_0x52ed53=_0x170b13;_0x41ea57[_0x3076('0x3f')]=_[_0x3076('0x41')](db[_0x3076('0x59')][_0x3076('0x3b')]);_0x41ea57[_0x3076('0x40')]=_['keys'](_0x3d356b[_0x3076('0x40')]);_0x41ea57['filters']=_[_0x3076('0x44')](_0x41ea57['model'],_0x41ea57[_0x3076('0x40')]);_0x1b0808[_0x3076('0x43')]=_[_0x3076('0x44')](_0x41ea57[_0x3076('0x3f')],qs[_0x3076('0x45')](_0x3d356b['query'][_0x3076('0x45')]));_0x1b0808[_0x3076('0x43')]=_0x1b0808['attributes'][_0x3076('0x54')]?_0x1b0808[_0x3076('0x43')]:_0x41ea57[_0x3076('0x3f')];_0x1b0808[_0x3076('0x47')]=qs[_0x3076('0x48')](_0x3d356b[_0x3076('0x40')][_0x3076('0x48')]);_0x1b0808[_0x3076('0x4a')]=qs['filters'](_[_0x3076('0x49')](_0x3d356b[_0x3076('0x40')],_0x41ea57[_0x3076('0x42')]));if(_0x3d356b[_0x3076('0x40')][_0x3076('0x4c')]){_0x1b0808[_0x3076('0x4a')]=_[_0x3076('0x4b')](_0x1b0808['where'],{'$or':_['map'](_0x1b0808['attributes'],function(_0x392654){var _0x477e52={};_0x477e52[_0x392654]={'$like':'%'+_0x3d356b['query'][_0x3076('0x4c')]+'%'};return _0x477e52;})});}_0x1b0808=_[_0x3076('0x4b')]({},_0x1b0808,_0x3d356b[_0x3076('0x4d')]);return _0x52ed53[_0x3076('0x5d')](_0x1b0808);}})[_0x3076('0x1d')](function(_0x61570a){if(_0x61570a){_0x206e37=_0x61570a[_0x3076('0x54')];if(!_0x3d356b[_0x3076('0x40')][_0x3076('0x46')](_0x3076('0x5a'))){_0x1b0808[_0x3076('0x2d')]=qs[_0x3076('0x2d')](_0x3d356b['query'][_0x3076('0x2d')]);_0x1b0808[_0x3076('0x2b')]=qs[_0x3076('0x2b')](_0x3d356b[_0x3076('0x40')]['offset']);}return _0x52ed53[_0x3076('0x5d')](_0x1b0808);}})[_0x3076('0x1d')](function(_0x2ddf75){if(_0x2ddf75){return _0x2ddf75?{'count':_0x206e37,'rows':_0x2ddf75}:null;}})['then'](respondWithResult(_0x3ded42,null))['catch'](handleError(_0x3ded42,null));};
\ No newline at end of file
index 8760c3a..d25b2f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b5a=['../../config/environment','exports','define','SalesforceConfiguration','lodash','util','bluebird','path','rimraf'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x3b5a,0x109));var _0xa3b5=function(_0x4f267a,_0x4d3149){_0x4f267a=_0x4f267a-0x0;var _0x3eafdf=_0x3b5a[_0x4f267a];return _0x3eafdf;};'use strict';var _=require(_0xa3b5('0x0'));var util=require(_0xa3b5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa3b5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3b5('0x3'));var rimraf=require(_0xa3b5('0x4'));var config=require(_0xa3b5('0x5'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xa3b5('0x6')]=function(_0x32c32d,_0x4b50fe){return _0x32c32d[_0xa3b5('0x7')](_0xa3b5('0x8'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea7b=['path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','util','moment','request-promise'];(function(_0x4e5e7b,_0x5c3d23){var _0x333893=function(_0x4b45f9){while(--_0x4b45f9){_0x4e5e7b['push'](_0x4e5e7b['shift']());}};_0x333893(++_0x5c3d23);}(_0xea7b,0x114));var _0xbea7=function(_0x21a95e,_0x4de45e){_0x21a95e=_0x21a95e-0x0;var _0x828e72=_0xea7b[_0x21a95e];return _0x828e72;};'use strict';var _=require(_0xbea7('0x0'));var util=require(_0xbea7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbea7('0x2'));var BPromise=require('bluebird');var rp=require(_0xbea7('0x3'));var fs=require('fs');var path=require(_0xbea7('0x4'));var rimraf=require(_0xbea7('0x5'));var config=require(_0xbea7('0x6'));var attributes=require(_0xbea7('0x7'));module['exports']=function(_0x4b4d25,_0x4d1d22){return _0x4b4d25[_0xbea7('0x8')](_0xbea7('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 81b0ce0..4ed2c22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4730=['jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x162f12,_0x7278dc){var _0x2becc2=function(_0x2d6b3b){while(--_0x2d6b3b){_0x162f12['push'](_0x162f12['shift']());}};_0x2becc2(++_0x7278dc);}(_0x4730,0xe8));var _0x0473=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0x4730[_0x300c89];return _0x41762e;};'use strict';var _=require(_0x0473('0x0'));var util=require(_0x0473('0x1'));var moment=require(_0x0473('0x2'));var BPromise=require(_0x0473('0x3'));var rs=require(_0x0473('0x4'));var fs=require('fs');var Redis=require(_0x0473('0x5'));var db=require(_0x0473('0x6'))['db'];var utils=require(_0x0473('0x7'));var logger=require(_0x0473('0x8'))(_0x0473('0x9'));var config=require(_0x0473('0xa'));var jayson=require(_0x0473('0xb'));var client=jayson[_0x0473('0xc')][_0x0473('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5be1ac,_0x2f39e7,_0x3f191a){return new BPromise(function(_0x5b6a1a,_0x1b6663){return client[_0x0473('0xe')](_0x5be1ac,_0x3f191a)[_0x0473('0xf')](function(_0x118f5a){logger['info'](_0x0473('0x10'),_0x2f39e7,'request\x20sent');logger[_0x0473('0x11')](_0x0473('0x12'),_0x2f39e7,_0x0473('0x13'),JSON[_0x0473('0x14')](_0x118f5a));if(_0x118f5a[_0x0473('0x15')]){if(_0x118f5a[_0x0473('0x15')][_0x0473('0x16')]===0x1f4){logger[_0x0473('0x15')](_0x0473('0x10'),_0x2f39e7,_0x118f5a[_0x0473('0x15')][_0x0473('0x17')]);return _0x1b6663(_0x118f5a[_0x0473('0x15')][_0x0473('0x17')]);}logger[_0x0473('0x15')](_0x0473('0x10'),_0x2f39e7,_0x118f5a[_0x0473('0x15')][_0x0473('0x17')]);return _0x5b6a1a(_0x118f5a[_0x0473('0x15')]['message']);}else{logger[_0x0473('0x18')](_0x0473('0x10'),_0x2f39e7,_0x0473('0x13'));_0x5b6a1a(_0x118f5a[_0x0473('0x19')]['message']);}})[_0x0473('0x1a')](function(_0x4806d1){logger[_0x0473('0x15')](_0x0473('0x10'),_0x2f39e7,_0x4806d1);_0x1b6663(_0x4806d1);});});}
\ No newline at end of file
+var _0x2f77=['util','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x2f77,0xd1));var _0x72f7=function(_0x28d1db,_0x36a119){_0x28d1db=_0x28d1db-0x0;var _0x22b879=_0x2f77[_0x28d1db];return _0x22b879;};'use strict';var _=require(_0x72f7('0x0'));var util=require(_0x72f7('0x1'));var moment=require('moment');var BPromise=require(_0x72f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x72f7('0x4'));var logger=require('../../config/logger')(_0x72f7('0x5'));var config=require('../../config/environment');var jayson=require(_0x72f7('0x6'));var client=jayson[_0x72f7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d9bb2,_0x358f79,_0x2d906a){return new BPromise(function(_0x132b28,_0x14de6c){return client[_0x72f7('0x8')](_0x3d9bb2,_0x2d906a)[_0x72f7('0x9')](function(_0x48ed6a){logger[_0x72f7('0xa')](_0x72f7('0xb'),_0x358f79,_0x72f7('0xc'));logger[_0x72f7('0xd')](_0x72f7('0xe'),_0x358f79,'request\x20sent',JSON[_0x72f7('0xf')](_0x48ed6a));if(_0x48ed6a[_0x72f7('0x10')]){if(_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x11')]===0x1f4){logger[_0x72f7('0x10')](_0x72f7('0xb'),_0x358f79,_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);return _0x14de6c(_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);}logger[_0x72f7('0x10')](_0x72f7('0xb'),_0x358f79,_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);return _0x132b28(_0x48ed6a[_0x72f7('0x10')][_0x72f7('0x12')]);}else{logger[_0x72f7('0xa')](_0x72f7('0xb'),_0x358f79,'request\x20sent');_0x132b28(_0x48ed6a[_0x72f7('0x13')][_0x72f7('0x12')]);}})[_0x72f7('0x14')](function(_0x409780){logger[_0x72f7('0x10')](_0x72f7('0xb'),_0x358f79,_0x409780);_0x14de6c(_0x409780);});});}
\ No newline at end of file
index bb6c491..6759c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x549c=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete'];(function(_0x272ea6,_0x3f0673){var _0x43ef03=function(_0x2307e2){while(--_0x2307e2){_0x272ea6['push'](_0x272ea6['shift']());}};_0x43ef03(++_0x3f0673);}(_0x549c,0xbb));var _0xc549=function(_0x2074b6,_0x5cb3c1){_0x2074b6=_0x2074b6-0x0;var _0x5cafc3=_0x549c[_0x2074b6];return _0x5cafc3;};'use strict';var multer=require('multer');var util=require(_0xc549('0x0'));var path=require('path');var timeout=require(_0xc549('0x1'));var express=require(_0xc549('0x2'));var router=express[_0xc549('0x3')]();var fs_extra=require(_0xc549('0x4'));var auth=require(_0xc549('0x5'));var interaction=require(_0xc549('0x6'));var config=require('../../config/environment');var controller=require(_0xc549('0x7'));router['get']('/',auth[_0xc549('0x8')](),controller[_0xc549('0x9')]);router[_0xc549('0xa')](_0xc549('0xb'),auth[_0xc549('0x8')](),controller[_0xc549('0xc')]);router[_0xc549('0xd')]('/',auth[_0xc549('0x8')](),controller[_0xc549('0xe')]);router[_0xc549('0xf')]('/:id',auth[_0xc549('0x8')](),controller['update']);router[_0xc549('0x10')](_0xc549('0xb'),auth[_0xc549('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0c0c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x2a8390,_0x4fc1fb){var _0x36c91c=function(_0x455bb2){while(--_0x455bb2){_0x2a8390['push'](_0x2a8390['shift']());}};_0x36c91c(++_0x4fc1fb);}(_0x0c0c,0x1cc));var _0xc0c0=function(_0x1b53b5,_0x52512b){_0x1b53b5=_0x1b53b5-0x0;var _0x1fe62c=_0x0c0c[_0x1b53b5];return _0x1fe62c;};'use strict';var multer=require(_0xc0c0('0x0'));var util=require(_0xc0c0('0x1'));var path=require(_0xc0c0('0x2'));var timeout=require(_0xc0c0('0x3'));var express=require(_0xc0c0('0x4'));var router=express[_0xc0c0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc0c0('0x6'));var interaction=require(_0xc0c0('0x7'));var config=require('../../config/environment');var controller=require(_0xc0c0('0x8'));router[_0xc0c0('0x9')]('/',auth[_0xc0c0('0xa')](),controller[_0xc0c0('0xb')]);router[_0xc0c0('0x9')](_0xc0c0('0xc'),auth[_0xc0c0('0xa')](),controller[_0xc0c0('0xd')]);router[_0xc0c0('0xe')]('/',auth[_0xc0c0('0xa')](),controller[_0xc0c0('0xf')]);router['put'](_0xc0c0('0xc'),auth[_0xc0c0('0xa')](),controller[_0xc0c0('0x10')]);router[_0xc0c0('0x11')](_0xc0c0('0xc'),auth[_0xc0c0('0xa')](),controller[_0xc0c0('0x12')]);module[_0xc0c0('0x13')]=router;
\ No newline at end of file
index 42020fb..fe17731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b8=['variable','customVariable','keyValue','STRING','exports','ENUM','string'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd7b8,0xeb));var _0x8d7b=function(_0x97aa59,_0x228eba){_0x97aa59=_0x97aa59-0x0;var _0x5a0e9b=_0xd7b8[_0x97aa59];return _0x5a0e9b;};'use strict';var Sequelize=require('sequelize');module[_0x8d7b('0x0')]={'type':{'type':Sequelize[_0x8d7b('0x1')](_0x8d7b('0x2'),_0x8d7b('0x3'),_0x8d7b('0x4'),_0x8d7b('0x5'),'picklist'),'defaultValue':_0x8d7b('0x2')},'content':{'type':Sequelize[_0x8d7b('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x8d7b('0x3'),_0x8d7b('0x4'))},'keyContent':{'type':Sequelize[_0x8d7b('0x6')]},'idField':{'type':Sequelize[_0x8d7b('0x6')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4614=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x1a1091,_0x2f8505){var _0x171a98=function(_0xd5db19){while(--_0xd5db19){_0x1a1091['push'](_0x1a1091['shift']());}};_0x171a98(++_0x2f8505);}(_0x4614,0x179));var _0x4461=function(_0x4b98fc,_0x1bba86){_0x4b98fc=_0x4b98fc-0x0;var _0x2fd1ec=_0x4614[_0x4b98fc];return _0x2fd1ec;};'use strict';var Sequelize=require(_0x4461('0x0'));module[_0x4461('0x1')]={'type':{'type':Sequelize[_0x4461('0x2')](_0x4461('0x3'),_0x4461('0x4'),_0x4461('0x5'),_0x4461('0x6'),_0x4461('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4461('0x8')]},'keyType':{'type':Sequelize[_0x4461('0x2')](_0x4461('0x3'),_0x4461('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x4461('0x8')]},'idField':{'type':Sequelize[_0x4461('0x8')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index c37d014..a40a37f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e78=['key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','params','include','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceField','rawAttributes','fieldName','type'];(function(_0x5796d0,_0x2a021c){var _0x5a14f1=function(_0x259c8c){while(--_0x259c8c){_0x5796d0['push'](_0x5796d0['shift']());}};_0x5a14f1(++_0x2a021c);}(_0x4e78,0x143));var _0x84e7=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x4e78[_0x474d97];return _0x1edf25;};'use strict';var emlformat=require(_0x84e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84e7('0x1'));var jsonpatch=require(_0x84e7('0x2'));var rp=require(_0x84e7('0x3'));var moment=require('moment');var BPromise=require(_0x84e7('0x4'));var Mustache=require(_0x84e7('0x5'));var util=require(_0x84e7('0x6'));var path=require(_0x84e7('0x7'));var sox=require(_0x84e7('0x8'));var csv=require(_0x84e7('0x9'));var ejs=require(_0x84e7('0xa'));var fs=require('fs');var fs_extra=require(_0x84e7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x84e7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x84e7('0xd'));var Papa=require(_0x84e7('0xe'));var Redis=require('ioredis');var authService=require(_0x84e7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84e7('0x10'));var logger=require(_0x84e7('0x11'))(_0x84e7('0x12'));var utils=require('../../config/utils');var config=require(_0x84e7('0x13'));var licenseUtil=require(_0x84e7('0x14'));var db=require(_0x84e7('0x15'))['db'];function respondWithStatusCode(_0x2c4a4d,_0x4834e0){_0x4834e0=_0x4834e0||0xcc;return function(_0x4761ac){if(_0x4761ac){return _0x2c4a4d[_0x84e7('0x16')](_0x4834e0);}return _0x2c4a4d[_0x84e7('0x17')](_0x4834e0)[_0x84e7('0x18')]();};}function respondWithResult(_0x1512f7,_0x12a63b){_0x12a63b=_0x12a63b||0xc8;return function(_0x16e89f){if(_0x16e89f){return _0x1512f7[_0x84e7('0x17')](_0x12a63b)[_0x84e7('0x19')](_0x16e89f);}};}function respondWithFilteredResult(_0xa65ec2,_0x36ab2e){return function(_0x1d43ad){if(_0x1d43ad){var _0x23f954=typeof _0x36ab2e['offset']==='undefined'&&typeof _0x36ab2e[_0x84e7('0x1a')]===_0x84e7('0x1b');var _0x8098b0=_0x1d43ad[_0x84e7('0x1c')];var _0x42c021=_0x23f954?0x0:_0x36ab2e[_0x84e7('0x1d')];var _0x41b4d4=_0x23f954?_0x1d43ad[_0x84e7('0x1c')]:_0x36ab2e[_0x84e7('0x1d')]+_0x36ab2e['limit'];var _0x1779fb;if(_0x41b4d4>=_0x8098b0){_0x41b4d4=_0x8098b0;_0x1779fb=0xc8;}else{_0x1779fb=0xce;}_0xa65ec2['status'](_0x1779fb);return _0xa65ec2[_0x84e7('0x1e')](_0x84e7('0x1f'),_0x42c021+'-'+_0x41b4d4+'/'+_0x8098b0)[_0x84e7('0x19')](_0x1d43ad);}return null;};}function patchUpdates(_0x64009){return function(_0x54cd9a){try{jsonpatch[_0x84e7('0x20')](_0x54cd9a,_0x64009,!![]);}catch(_0x4f6e57){return BPromise[_0x84e7('0x21')](_0x4f6e57);}return _0x54cd9a[_0x84e7('0x22')]();};}function saveUpdates(_0x3f9327,_0x443a85){return function(_0x5596be){if(_0x5596be){return _0x5596be[_0x84e7('0x23')](_0x3f9327)[_0x84e7('0x24')](function(_0x57d96d){return _0x57d96d;});}return null;};}function removeEntity(_0x447c24,_0x1ceb9b){return function(_0xbd11ec){if(_0xbd11ec){return _0xbd11ec[_0x84e7('0x25')]()['then'](function(){_0x447c24[_0x84e7('0x17')](0xcc)[_0x84e7('0x18')]();});}};}function handleEntityNotFound(_0x41eb92,_0xc7eb17){return function(_0x1a2820){if(!_0x1a2820){_0x41eb92[_0x84e7('0x16')](0x194);}return _0x1a2820;};}function handleError(_0x19c627,_0x18b871){_0x18b871=_0x18b871||0x1f4;return function(_0x3fbfca){logger[_0x84e7('0x26')](_0x3fbfca[_0x84e7('0x27')]);if(_0x3fbfca[_0x84e7('0x28')]){delete _0x3fbfca[_0x84e7('0x28')];}_0x19c627['status'](_0x18b871)[_0x84e7('0x29')](_0x3fbfca);};}exports[_0x84e7('0x2a')]=function(_0x3166bd,_0x3fb61f){var _0x5644e1={},_0xae1833={},_0x356f73={'count':0x0,'rows':[]};var _0x184656=_['map'](db[_0x84e7('0x2b')][_0x84e7('0x2c')],function(_0x192724){return{'name':_0x192724[_0x84e7('0x2d')],'type':_0x192724[_0x84e7('0x2e')][_0x84e7('0x2f')]};});_0xae1833[_0x84e7('0x30')]=_[_0x84e7('0x31')](_0x184656,_0x84e7('0x28'));_0xae1833['query']=_[_0x84e7('0x32')](_0x3166bd[_0x84e7('0x33')]);_0xae1833[_0x84e7('0x34')]=_[_0x84e7('0x35')](_0xae1833[_0x84e7('0x30')],_0xae1833[_0x84e7('0x33')]);_0x5644e1[_0x84e7('0x36')]=_['intersection'](_0xae1833['model'],qs[_0x84e7('0x37')](_0x3166bd[_0x84e7('0x33')]['fields']));_0x5644e1[_0x84e7('0x36')]=_0x5644e1[_0x84e7('0x36')][_0x84e7('0x38')]?_0x5644e1['attributes']:_0xae1833['model'];if(!_0x3166bd[_0x84e7('0x33')][_0x84e7('0x39')](_0x84e7('0x3a'))){_0x5644e1[_0x84e7('0x1a')]=qs['limit'](_0x3166bd[_0x84e7('0x33')][_0x84e7('0x1a')]);_0x5644e1['offset']=qs[_0x84e7('0x1d')](_0x3166bd['query'][_0x84e7('0x1d')]);}_0x5644e1['order']=qs[_0x84e7('0x3b')](_0x3166bd[_0x84e7('0x33')][_0x84e7('0x3b')]);_0x5644e1[_0x84e7('0x3c')]=qs[_0x84e7('0x34')](_[_0x84e7('0x3d')](_0x3166bd[_0x84e7('0x33')],_0xae1833[_0x84e7('0x34')]),_0x184656);if(_0x3166bd['query'][_0x84e7('0x3e')]){_0x5644e1['where']=_[_0x84e7('0x3f')](_0x5644e1[_0x84e7('0x3c')],{'$or':_[_0x84e7('0x31')](_0x184656,function(_0x2f8ece){if(_0x2f8ece['type']!==_0x84e7('0x40')){var _0x3ac0d7={};_0x3ac0d7[_0x2f8ece[_0x84e7('0x28')]]={'$like':'%'+_0x3166bd['query'][_0x84e7('0x3e')]+'%'};return _0x3ac0d7;}})});}_0x5644e1=_[_0x84e7('0x3f')]({},_0x5644e1,_0x3166bd[_0x84e7('0x41')]);var _0x42c117={'where':_0x5644e1['where']};return db['SalesforceField']['count'](_0x42c117)[_0x84e7('0x24')](function(_0x48f1e0){_0x356f73['count']=_0x48f1e0;if(_0x3166bd[_0x84e7('0x33')]['includeAll']){_0x5644e1['include']=[{'all':!![]}];}return db[_0x84e7('0x2b')]['findAll'](_0x5644e1);})[_0x84e7('0x24')](function(_0x54db57){_0x356f73[_0x84e7('0x42')]=_0x54db57;return _0x356f73;})['then'](respondWithFilteredResult(_0x3fb61f,_0x5644e1))['catch'](handleError(_0x3fb61f,null));};exports[_0x84e7('0x43')]=function(_0x35c757,_0x5a99aa){var _0x1b66ec={'raw':!![],'where':{'id':_0x35c757[_0x84e7('0x44')]['id']}},_0x556f61={};_0x556f61[_0x84e7('0x30')]=_['keys'](db['SalesforceField'][_0x84e7('0x2c')]);_0x556f61[_0x84e7('0x33')]=_[_0x84e7('0x32')](_0x35c757[_0x84e7('0x33')]);_0x556f61['filters']=_[_0x84e7('0x35')](_0x556f61[_0x84e7('0x30')],_0x556f61[_0x84e7('0x33')]);_0x1b66ec[_0x84e7('0x36')]=_[_0x84e7('0x35')](_0x556f61[_0x84e7('0x30')],qs[_0x84e7('0x37')](_0x35c757[_0x84e7('0x33')][_0x84e7('0x37')]));_0x1b66ec[_0x84e7('0x36')]=_0x1b66ec['attributes']['length']?_0x1b66ec['attributes']:_0x556f61[_0x84e7('0x30')];if(_0x35c757['query']['includeAll']){_0x1b66ec[_0x84e7('0x45')]=[{'all':!![]}];}_0x1b66ec=_[_0x84e7('0x3f')]({},_0x1b66ec,_0x35c757[_0x84e7('0x41')]);return db['SalesforceField']['find'](_0x1b66ec)[_0x84e7('0x24')](handleEntityNotFound(_0x5a99aa,null))[_0x84e7('0x24')](respondWithResult(_0x5a99aa,null))[_0x84e7('0x46')](handleError(_0x5a99aa,null));};exports['create']=function(_0x334c07,_0x47f2ce){return db[_0x84e7('0x2b')][_0x84e7('0x47')](_0x334c07['body'],{})[_0x84e7('0x24')](respondWithResult(_0x47f2ce,0xc9))[_0x84e7('0x46')](handleError(_0x47f2ce,null));};exports[_0x84e7('0x23')]=function(_0x4a5006,_0xc68b29){if(_0x4a5006[_0x84e7('0x48')]['id']){delete _0x4a5006[_0x84e7('0x48')]['id'];}return db[_0x84e7('0x2b')][_0x84e7('0x49')]({'where':{'id':_0x4a5006[_0x84e7('0x44')]['id']}})[_0x84e7('0x24')](handleEntityNotFound(_0xc68b29,null))['then'](saveUpdates(_0x4a5006[_0x84e7('0x48')],null))[_0x84e7('0x24')](respondWithResult(_0xc68b29,null))[_0x84e7('0x46')](handleError(_0xc68b29,null));};exports['destroy']=function(_0xbb99e7,_0x1afb0b){return db['SalesforceField']['find']({'where':{'id':_0xbb99e7[_0x84e7('0x44')]['id']}})[_0x84e7('0x24')](handleEntityNotFound(_0x1afb0b,null))[_0x84e7('0x24')](removeEntity(_0x1afb0b,null))['catch'](handleError(_0x1afb0b,null));};
\ No newline at end of file
+var _0x514d=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','findAll','show','params','include','options','create','catch','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x1d9ff0,_0x5baadb){var _0x48d3d8=function(_0x15bcb8){while(--_0x15bcb8){_0x1d9ff0['push'](_0x1d9ff0['shift']());}};_0x48d3d8(++_0x5baadb);}(_0x514d,0x87));var _0xd514=function(_0x3bb836,_0x3e5ed9){_0x3bb836=_0x3bb836-0x0;var _0x27483a=_0x514d[_0x3bb836];return _0x27483a;};'use strict';var emlformat=require(_0xd514('0x0'));var rimraf=require(_0xd514('0x1'));var zipdir=require(_0xd514('0x2'));var jsonpatch=require(_0xd514('0x3'));var rp=require(_0xd514('0x4'));var moment=require(_0xd514('0x5'));var BPromise=require(_0xd514('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd514('0x7'));var sox=require(_0xd514('0x8'));var csv=require(_0xd514('0x9'));var ejs=require(_0xd514('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd514('0xb'));var squel=require(_0xd514('0xc'));var crypto=require('crypto');var jsforce=require(_0xd514('0xd'));var deskjs=require(_0xd514('0xe'));var toCsv=require(_0xd514('0x9'));var querystring=require(_0xd514('0xf'));var Papa=require(_0xd514('0x10'));var Redis=require('ioredis');var authService=require(_0xd514('0x11'));var qs=require(_0xd514('0x12'));var as=require(_0xd514('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd514('0x14'))(_0xd514('0x15'));var utils=require(_0xd514('0x16'));var config=require(_0xd514('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd514('0x18'))['db'];function respondWithStatusCode(_0x52c1cd,_0x4e49b1){_0x4e49b1=_0x4e49b1||0xcc;return function(_0x17c8e2){if(_0x17c8e2){return _0x52c1cd[_0xd514('0x19')](_0x4e49b1);}return _0x52c1cd[_0xd514('0x1a')](_0x4e49b1)[_0xd514('0x1b')]();};}function respondWithResult(_0x4ad26d,_0x3085f0){_0x3085f0=_0x3085f0||0xc8;return function(_0x534ae9){if(_0x534ae9){return _0x4ad26d['status'](_0x3085f0)[_0xd514('0x1c')](_0x534ae9);}};}function respondWithFilteredResult(_0x654e8f,_0xece449){return function(_0x36adcd){if(_0x36adcd){var _0x52cec3=typeof _0xece449[_0xd514('0x1d')]==='undefined'&&typeof _0xece449['limit']==='undefined';var _0xa11f68=_0x36adcd[_0xd514('0x1e')];var _0x3e6752=_0x52cec3?0x0:_0xece449[_0xd514('0x1d')];var _0x28bc79=_0x52cec3?_0x36adcd['count']:_0xece449[_0xd514('0x1d')]+_0xece449[_0xd514('0x1f')];var _0x572ebc;if(_0x28bc79>=_0xa11f68){_0x28bc79=_0xa11f68;_0x572ebc=0xc8;}else{_0x572ebc=0xce;}_0x654e8f[_0xd514('0x1a')](_0x572ebc);return _0x654e8f[_0xd514('0x20')](_0xd514('0x21'),_0x3e6752+'-'+_0x28bc79+'/'+_0xa11f68)[_0xd514('0x1c')](_0x36adcd);}return null;};}function patchUpdates(_0x21b7ed){return function(_0x5429ff){try{jsonpatch['apply'](_0x5429ff,_0x21b7ed,!![]);}catch(_0x44fc19){return BPromise[_0xd514('0x22')](_0x44fc19);}return _0x5429ff[_0xd514('0x23')]();};}function saveUpdates(_0x232886,_0x2eff39){return function(_0x2a3c10){if(_0x2a3c10){return _0x2a3c10[_0xd514('0x24')](_0x232886)[_0xd514('0x25')](function(_0x4960b7){return _0x4960b7;});}return null;};}function removeEntity(_0x39a16d,_0x41f04d){return function(_0x53a87e){if(_0x53a87e){return _0x53a87e['destroy']()[_0xd514('0x25')](function(){_0x39a16d[_0xd514('0x1a')](0xcc)[_0xd514('0x1b')]();});}};}function handleEntityNotFound(_0x3b97d5,_0xd0c22f){return function(_0x44e909){if(!_0x44e909){_0x3b97d5[_0xd514('0x19')](0x194);}return _0x44e909;};}function handleError(_0x1c834b,_0x6244b2){_0x6244b2=_0x6244b2||0x1f4;return function(_0x391c56){logger['error'](_0x391c56['stack']);if(_0x391c56['name']){delete _0x391c56[_0xd514('0x26')];}_0x1c834b[_0xd514('0x1a')](_0x6244b2)[_0xd514('0x27')](_0x391c56);};}exports[_0xd514('0x28')]=function(_0x39dac0,_0x203f7d){var _0x360a4b={},_0x4691a9={},_0x58801a={'count':0x0,'rows':[]};var _0x53bb7a=_[_0xd514('0x29')](db[_0xd514('0x2a')][_0xd514('0x2b')],function(_0x43cb45){return{'name':_0x43cb45[_0xd514('0x2c')],'type':_0x43cb45[_0xd514('0x2d')][_0xd514('0x2e')]};});_0x4691a9['model']=_[_0xd514('0x29')](_0x53bb7a,_0xd514('0x26'));_0x4691a9[_0xd514('0x2f')]=_[_0xd514('0x30')](_0x39dac0['query']);_0x4691a9['filters']=_[_0xd514('0x31')](_0x4691a9[_0xd514('0x32')],_0x4691a9['query']);_0x360a4b['attributes']=_[_0xd514('0x31')](_0x4691a9[_0xd514('0x32')],qs['fields'](_0x39dac0['query'][_0xd514('0x33')]));_0x360a4b[_0xd514('0x34')]=_0x360a4b[_0xd514('0x34')][_0xd514('0x35')]?_0x360a4b[_0xd514('0x34')]:_0x4691a9[_0xd514('0x32')];if(!_0x39dac0[_0xd514('0x2f')][_0xd514('0x36')](_0xd514('0x37'))){_0x360a4b[_0xd514('0x1f')]=qs[_0xd514('0x1f')](_0x39dac0[_0xd514('0x2f')][_0xd514('0x1f')]);_0x360a4b['offset']=qs['offset'](_0x39dac0[_0xd514('0x2f')][_0xd514('0x1d')]);}_0x360a4b[_0xd514('0x38')]=qs[_0xd514('0x39')](_0x39dac0[_0xd514('0x2f')][_0xd514('0x39')]);_0x360a4b['where']=qs[_0xd514('0x3a')](_[_0xd514('0x3b')](_0x39dac0[_0xd514('0x2f')],_0x4691a9[_0xd514('0x3a')]),_0x53bb7a);if(_0x39dac0[_0xd514('0x2f')]['filter']){_0x360a4b[_0xd514('0x3c')]=_[_0xd514('0x3d')](_0x360a4b[_0xd514('0x3c')],{'$or':_['map'](_0x53bb7a,function(_0x54bda5){if(_0x54bda5[_0xd514('0x2d')]!==_0xd514('0x3e')){var _0x4386bb={};_0x4386bb[_0x54bda5[_0xd514('0x26')]]={'$like':'%'+_0x39dac0[_0xd514('0x2f')][_0xd514('0x3f')]+'%'};return _0x4386bb;}})});}_0x360a4b=_[_0xd514('0x3d')]({},_0x360a4b,_0x39dac0['options']);var _0x3a885f={'where':_0x360a4b[_0xd514('0x3c')]};return db[_0xd514('0x2a')]['count'](_0x3a885f)[_0xd514('0x25')](function(_0x5b84ed){_0x58801a['count']=_0x5b84ed;if(_0x39dac0['query'][_0xd514('0x40')]){_0x360a4b['include']=[{'all':!![]}];}return db[_0xd514('0x2a')][_0xd514('0x41')](_0x360a4b);})['then'](function(_0x44838d){_0x58801a['rows']=_0x44838d;return _0x58801a;})[_0xd514('0x25')](respondWithFilteredResult(_0x203f7d,_0x360a4b))['catch'](handleError(_0x203f7d,null));};exports[_0xd514('0x42')]=function(_0x267eb9,_0x4edaf4){var _0x16303e={'raw':!![],'where':{'id':_0x267eb9[_0xd514('0x43')]['id']}},_0x2b723d={};_0x2b723d[_0xd514('0x32')]=_[_0xd514('0x30')](db[_0xd514('0x2a')]['rawAttributes']);_0x2b723d[_0xd514('0x2f')]=_[_0xd514('0x30')](_0x267eb9[_0xd514('0x2f')]);_0x2b723d[_0xd514('0x3a')]=_[_0xd514('0x31')](_0x2b723d[_0xd514('0x32')],_0x2b723d['query']);_0x16303e['attributes']=_[_0xd514('0x31')](_0x2b723d[_0xd514('0x32')],qs[_0xd514('0x33')](_0x267eb9[_0xd514('0x2f')][_0xd514('0x33')]));_0x16303e[_0xd514('0x34')]=_0x16303e[_0xd514('0x34')][_0xd514('0x35')]?_0x16303e[_0xd514('0x34')]:_0x2b723d[_0xd514('0x32')];if(_0x267eb9[_0xd514('0x2f')][_0xd514('0x40')]){_0x16303e[_0xd514('0x44')]=[{'all':!![]}];}_0x16303e=_['merge']({},_0x16303e,_0x267eb9[_0xd514('0x45')]);return db['SalesforceField']['find'](_0x16303e)[_0xd514('0x25')](handleEntityNotFound(_0x4edaf4,null))[_0xd514('0x25')](respondWithResult(_0x4edaf4,null))['catch'](handleError(_0x4edaf4,null));};exports[_0xd514('0x46')]=function(_0x3b8cc0,_0x483e71){return db[_0xd514('0x2a')][_0xd514('0x46')](_0x3b8cc0['body'],{})[_0xd514('0x25')](respondWithResult(_0x483e71,0xc9))[_0xd514('0x47')](handleError(_0x483e71,null));};exports['update']=function(_0x5528ed,_0x4eed5e){if(_0x5528ed[_0xd514('0x48')]['id']){delete _0x5528ed['body']['id'];}return db[_0xd514('0x2a')][_0xd514('0x49')]({'where':{'id':_0x5528ed['params']['id']}})[_0xd514('0x25')](handleEntityNotFound(_0x4eed5e,null))[_0xd514('0x25')](saveUpdates(_0x5528ed[_0xd514('0x48')],null))[_0xd514('0x25')](respondWithResult(_0x4eed5e,null))[_0xd514('0x47')](handleError(_0x4eed5e,null));};exports[_0xd514('0x4a')]=function(_0x40d606,_0x38d278){return db['SalesforceField'][_0xd514('0x49')]({'where':{'id':_0x40d606[_0xd514('0x43')]['id']}})[_0xd514('0x25')](handleEntityNotFound(_0x38d278,null))[_0xd514('0x25')](removeEntity(_0x38d278,null))[_0xd514('0x47')](handleError(_0x38d278,null));};
\ No newline at end of file
index b5a3139..939edcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3083=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId'];(function(_0x36f93b,_0x456ec6){var _0x16797b=function(_0xcb3dd8){while(--_0xcb3dd8){_0x36f93b['push'](_0x36f93b['shift']());}};_0x16797b(++_0x456ec6);}(_0x3083,0x1a0));var _0x3308=function(_0x587693,_0x27fe90){_0x587693=_0x587693-0x0;var _0x510a1a=_0x3083[_0x587693];return _0x510a1a;};'use strict';var _=require('lodash');var util=require(_0x3308('0x0'));var logger=require(_0x3308('0x1'))(_0x3308('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3308('0x3'));var fs=require('fs');var path=require(_0x3308('0x4'));var rimraf=require(_0x3308('0x5'));var config=require(_0x3308('0x6'));var attributes=require(_0x3308('0x7'));module[_0x3308('0x8')]=function(_0x4ed54a,_0x441d59){return _0x4ed54a['define'](_0x3308('0x9'),attributes,{'tableName':_0x3308('0xa'),'paranoid':![],'indexes':[{'name':_0x3308('0xb'),'fields':['idField',_0x3308('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4aad=['FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','int_salesforce_fields','idField'];(function(_0x49c3f0,_0x4bb280){var _0x25689e=function(_0x427247){while(--_0x427247){_0x49c3f0['push'](_0x49c3f0['shift']());}};_0x25689e(++_0x4bb280);}(_0x4aad,0x175));var _0xd4aa=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x4aad[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0xd4aa('0x0'));var logger=require(_0xd4aa('0x1'))(_0xd4aa('0x2'));var moment=require(_0xd4aa('0x3'));var BPromise=require(_0xd4aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4aa('0x5'));var rimraf=require(_0xd4aa('0x6'));var config=require(_0xd4aa('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0xd4aa('0x8')]=function(_0x57cc7a,_0x3ecc31){return _0x57cc7a['define']('SalesforceField',attributes,{'tableName':_0xd4aa('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xd4aa('0xa'),_0xd4aa('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 6432273..0bdd8a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa44a=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','SalesforceField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result'];(function(_0x1bf278,_0x561245){var _0x211a52=function(_0x210cd0){while(--_0x210cd0){_0x1bf278['push'](_0x1bf278['shift']());}};_0x211a52(++_0x561245);}(_0xa44a,0x166));var _0xaa44=function(_0x59e4e3,_0x430f6c){_0x59e4e3=_0x59e4e3-0x0;var _0x54be45=_0xa44a[_0x59e4e3];return _0x54be45;};'use strict';var _=require('lodash');var util=require(_0xaa44('0x0'));var moment=require(_0xaa44('0x1'));var BPromise=require(_0xaa44('0x2'));var rs=require(_0xaa44('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa44('0x4'))['db'];var utils=require(_0xaa44('0x5'));var logger=require(_0xaa44('0x6'))(_0xaa44('0x7'));var config=require(_0xaa44('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x29e0d2,_0x5b9635,_0x258bc9){return new BPromise(function(_0x3dec3f,_0x14a2cc){return client[_0xaa44('0x9')](_0x29e0d2,_0x258bc9)[_0xaa44('0xa')](function(_0x7da112){logger['info'](_0xaa44('0xb'),_0x5b9635,'request\x20sent');logger[_0xaa44('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5b9635,_0xaa44('0xd'),JSON[_0xaa44('0xe')](_0x7da112));if(_0x7da112[_0xaa44('0xf')]){if(_0x7da112['error'][_0xaa44('0x10')]===0x1f4){logger['error'](_0xaa44('0xb'),_0x5b9635,_0x7da112[_0xaa44('0xf')][_0xaa44('0x11')]);return _0x14a2cc(_0x7da112['error']['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x5b9635,_0x7da112['error']['message']);return _0x3dec3f(_0x7da112[_0xaa44('0xf')]['message']);}else{logger[_0xaa44('0x12')]('SalesforceField,\x20%s,\x20%s',_0x5b9635,_0xaa44('0xd'));_0x3dec3f(_0x7da112[_0xaa44('0x13')][_0xaa44('0x11')]);}})[_0xaa44('0x14')](function(_0x5af852){logger[_0xaa44('0xf')](_0xaa44('0xb'),_0x5b9635,_0x5af852);_0x14a2cc(_0x5af852);});});}
\ No newline at end of file
+var _0x1e6b=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','SalesforceField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x44caf4,_0x238750){var _0x117cad=function(_0x3e64c8){while(--_0x3e64c8){_0x44caf4['push'](_0x44caf4['shift']());}};_0x117cad(++_0x238750);}(_0x1e6b,0x1dc));var _0xb1e6=function(_0x15b742,_0x3c0f98){_0x15b742=_0x15b742-0x0;var _0x36a6c5=_0x1e6b[_0x15b742];return _0x36a6c5;};'use strict';var _=require(_0xb1e6('0x0'));var util=require(_0xb1e6('0x1'));var moment=require(_0xb1e6('0x2'));var BPromise=require(_0xb1e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1e6('0x4'))['db'];var utils=require(_0xb1e6('0x5'));var logger=require(_0xb1e6('0x6'))(_0xb1e6('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1e6('0x8'));var client=jayson[_0xb1e6('0x9')][_0xb1e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x233613,_0x339231,_0x427804){return new BPromise(function(_0x39b68d,_0x564978){return client[_0xb1e6('0xb')](_0x233613,_0x427804)[_0xb1e6('0xc')](function(_0x36b36d){logger[_0xb1e6('0xd')]('SalesforceField,\x20%s,\x20%s',_0x339231,_0xb1e6('0xe'));logger[_0xb1e6('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x339231,'request\x20sent',JSON['stringify'](_0x36b36d));if(_0x36b36d[_0xb1e6('0x10')]){if(_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x11')]===0x1f4){logger[_0xb1e6('0x10')](_0xb1e6('0x12'),_0x339231,_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x13')]);return _0x564978(_0x36b36d['error'][_0xb1e6('0x13')]);}logger[_0xb1e6('0x10')](_0xb1e6('0x12'),_0x339231,_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x13')]);return _0x39b68d(_0x36b36d[_0xb1e6('0x10')][_0xb1e6('0x13')]);}else{logger[_0xb1e6('0xd')](_0xb1e6('0x12'),_0x339231,'request\x20sent');_0x39b68d(_0x36b36d[_0xb1e6('0x14')][_0xb1e6('0x13')]);}})['catch'](function(_0x520aac){logger[_0xb1e6('0x10')]('SalesforceField,\x20%s,\x20%s',_0x339231,_0x520aac);_0x564978(_0x520aac);});});}
\ No newline at end of file
index c462f1f..5ca5534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddcc=['getFields','post','create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','/:id/configurations'];(function(_0x1c31e0,_0x43d5f8){var _0x35735c=function(_0x482e65){while(--_0x482e65){_0x1c31e0['push'](_0x1c31e0['shift']());}};_0x35735c(++_0x43d5f8);}(_0xddcc,0x8a));var _0xcddc=function(_0x422060,_0x5415a4){_0x422060=_0x422060-0x0;var _0x21426b=_0xddcc[_0x422060];return _0x21426b;};'use strict';var multer=require(_0xcddc('0x0'));var util=require(_0xcddc('0x1'));var path=require('path');var timeout=require(_0xcddc('0x2'));var express=require(_0xcddc('0x3'));var router=express[_0xcddc('0x4')]();var fs_extra=require(_0xcddc('0x5'));var auth=require(_0xcddc('0x6'));var interaction=require(_0xcddc('0x7'));var config=require(_0xcddc('0x8'));var controller=require(_0xcddc('0x9'));router[_0xcddc('0xa')]('/',auth[_0xcddc('0xb')](),controller['index']);router[_0xcddc('0xa')](_0xcddc('0xc'),auth[_0xcddc('0xb')](),controller['show']);router[_0xcddc('0xa')](_0xcddc('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xcddc('0xa')]('/:id/fields',auth[_0xcddc('0xb')](),controller[_0xcddc('0xe')]);router[_0xcddc('0xf')]('/',auth[_0xcddc('0xb')](),controller[_0xcddc('0x10')]);router[_0xcddc('0xf')](_0xcddc('0xd'),auth[_0xcddc('0xb')](),controller['addConfiguration']);router[_0xcddc('0x11')](_0xcddc('0xc'),auth[_0xcddc('0xb')](),controller['update']);router['delete'](_0xcddc('0xc'),auth[_0xcddc('0xb')](),controller['destroy']);module[_0xcddc('0x12')]=router;
\ No newline at end of file
+var _0x0f49=['../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x0f49,0xb2));var _0x90f4=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0x0f49[_0x3a9815];return _0x188653;};'use strict';var multer=require('multer');var util=require(_0x90f4('0x0'));var path=require(_0x90f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x90f4('0x2'));var router=express[_0x90f4('0x3')]();var fs_extra=require(_0x90f4('0x4'));var auth=require(_0x90f4('0x5'));var interaction=require(_0x90f4('0x6'));var config=require(_0x90f4('0x7'));var controller=require(_0x90f4('0x8'));router[_0x90f4('0x9')]('/',auth[_0x90f4('0xa')](),controller[_0x90f4('0xb')]);router[_0x90f4('0x9')]('/:id',auth[_0x90f4('0xa')](),controller[_0x90f4('0xc')]);router[_0x90f4('0x9')](_0x90f4('0xd'),auth[_0x90f4('0xa')](),controller[_0x90f4('0xe')]);router[_0x90f4('0x9')](_0x90f4('0xf'),auth[_0x90f4('0xa')](),controller['getFields']);router[_0x90f4('0x10')]('/',auth[_0x90f4('0xa')](),controller[_0x90f4('0x11')]);router[_0x90f4('0x10')](_0x90f4('0xd'),auth[_0x90f4('0xa')](),controller[_0x90f4('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x90f4('0x13')]);router[_0x90f4('0x14')](_0x90f4('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x90f4('0x16')]=router;
\ No newline at end of file
index df5b33e..79ddb93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc39=['remoteUri','sequelize','exports','username','STRING'];(function(_0x3ecc75,_0x23c3dc){var _0x183e94=function(_0x175d01){while(--_0x175d01){_0x3ecc75['push'](_0x3ecc75['shift']());}};_0x183e94(++_0x23c3dc);}(_0xcc39,0x1e6));var _0x9cc3=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xcc39[_0x3c6ae2];return _0x4edda;};'use strict';var Sequelize=require(_0x9cc3('0x0'));module[_0x9cc3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x9cc3('0x2')},'password':{'type':Sequelize[_0x9cc3('0x3')]},'email':{'type':Sequelize[_0x9cc3('0x3')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9cc3('0x4')},'serverUrl':{'type':Sequelize[_0x9cc3('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0xf0dd=['sequelize','STRING','username','remoteUri'];(function(_0x1cbfe1,_0x50e351){var _0x462030=function(_0x572c21){while(--_0x572c21){_0x1cbfe1['push'](_0x1cbfe1['shift']());}};_0x462030(++_0x50e351);}(_0xf0dd,0x84));var _0xdf0d=function(_0x226212,_0x3471a3){_0x226212=_0x226212-0x0;var _0x37e7bf=_0xf0dd[_0x226212];return _0x37e7bf;};'use strict';var Sequelize=require(_0xdf0d('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf0d('0x1')]},'description':{'type':Sequelize[_0xdf0d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xdf0d('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xdf0d('0x1')]},'remoteUri':{'type':Sequelize[_0xdf0d('0x1')],'unique':_0xdf0d('0x3')},'serverUrl':{'type':Sequelize[_0xdf0d('0x1')],'allowNull':![]}};
\ No newline at end of file
index 9fafcf4..29840d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9931=['opened_at','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','close_code','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','password','email','remoteUri','serverUrl','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','log','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','statusCode','test','boolean','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','client','http','request','then','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','destroy','end','sendStatus','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','ServicenowConfiguration','filters','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','made_sla','hold_reason','knowledge','subcategory','notify','severity','caused_by','watch_list','upon_reject','approval_history','number','resolved_by','opened_by','user_input','sys_domain','closed_at','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start'];(function(_0x583b3f,_0x40897e){var _0x430f41=function(_0xbff5){while(--_0xbff5){_0x583b3f['push'](_0x583b3f['shift']());}};_0x430f41(++_0x40897e);}(_0x9931,0x1b5));var _0x1993=function(_0x240746,_0x27c3d8){_0x240746=_0x240746-0x0;var _0x37ca18=_0x9931[_0x240746];return _0x37ca18;};'use strict';var emlformat=require(_0x1993('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1993('0x1'));var jsonpatch=require(_0x1993('0x2'));var rp=require(_0x1993('0x3'));var moment=require('moment');var BPromise=require(_0x1993('0x4'));var Mustache=require(_0x1993('0x5'));var util=require(_0x1993('0x6'));var path=require(_0x1993('0x7'));var sox=require(_0x1993('0x8'));var csv=require(_0x1993('0x9'));var ejs=require(_0x1993('0xa'));var fs=require('fs');var fs_extra=require(_0x1993('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1993('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1993('0x9'));var querystring=require(_0x1993('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1993('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1993('0xf'));var hardwareService=require(_0x1993('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1993('0x11'));var config=require(_0x1993('0x12'));var licenseUtil=require(_0x1993('0x13'));var db=require(_0x1993('0x14'))['db'];var integrations=require(_0x1993('0x15'));var jayson=require('jayson/promise');var client=jayson[_0x1993('0x16')][_0x1993('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x43cb7f,_0x4989b7,_0x230df0,_0x583a43){return new BPromise(function(_0xa85dec,_0x169230){var _0x24caef=_0x583a43||client;return _0x24caef[_0x1993('0x18')](_0x43cb7f,_0x230df0)[_0x1993('0x19')](function(_0x499053){logger[_0x1993('0x1a')]('ServicenowAccount,\x20%s,\x20%s',_0x4989b7,'request\x20sent');logger[_0x1993('0x1b')](_0x1993('0x1c'),_0x4989b7,_0x1993('0x1d'),JSON[_0x1993('0x1e')](_0x499053));if(_0x499053['error']){if(_0x499053[_0x1993('0x1f')][_0x1993('0x20')]===0x1f4){logger[_0x1993('0x1f')](_0x1993('0x21'),_0x4989b7,_0x499053[_0x1993('0x1f')][_0x1993('0x22')]);return _0x169230(_0x499053[_0x1993('0x1f')][_0x1993('0x22')]);}logger['error'](_0x1993('0x21'),_0x4989b7,_0x499053['error'][_0x1993('0x22')]);return _0xa85dec(_0x499053[_0x1993('0x1f')][_0x1993('0x22')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4989b7,'request\x20sent');_0xa85dec(_0x499053[_0x1993('0x23')][_0x1993('0x22')]);}})['catch'](function(_0x2d4589){logger[_0x1993('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0x4989b7,_0x2d4589);_0x169230(_0x2d4589);});});}function respondWithStatusCode(_0x1f20c3,_0x2e445a){_0x2e445a=_0x2e445a||0xcc;return function(_0x42968f){if(_0x42968f){return _0x1f20c3['sendStatus'](_0x2e445a);}return _0x1f20c3['status'](_0x2e445a)['end']();};}function respondWithResult(_0x95ae76,_0xf77066){_0xf77066=_0xf77066||0xc8;return function(_0x1d2f61){if(_0x1d2f61){return _0x95ae76['status'](_0xf77066)['json'](_0x1d2f61);}};}function respondWithFilteredResult(_0x238104,_0x154e70){return function(_0x221ef4){if(_0x221ef4){var _0x5922c8=typeof _0x154e70[_0x1993('0x24')]===_0x1993('0x25')&&typeof _0x154e70[_0x1993('0x26')]===_0x1993('0x25');var _0x21a68e=_0x221ef4[_0x1993('0x27')];var _0x41c201=_0x5922c8?0x0:_0x154e70[_0x1993('0x24')];var _0x1c9fb3=_0x5922c8?_0x221ef4['count']:_0x154e70[_0x1993('0x24')]+_0x154e70[_0x1993('0x26')];var _0x195a97;if(_0x1c9fb3>=_0x21a68e){_0x1c9fb3=_0x21a68e;_0x195a97=0xc8;}else{_0x195a97=0xce;}_0x238104[_0x1993('0x28')](_0x195a97);return _0x238104[_0x1993('0x29')](_0x1993('0x2a'),_0x41c201+'-'+_0x1c9fb3+'/'+_0x21a68e)[_0x1993('0x2b')](_0x221ef4);}return null;};}function patchUpdates(_0x5d6ff5){return function(_0x199d54){try{jsonpatch[_0x1993('0x2c')](_0x199d54,_0x5d6ff5,!![]);}catch(_0x2a8b4a){return BPromise[_0x1993('0x2d')](_0x2a8b4a);}return _0x199d54[_0x1993('0x2e')]();};}function saveUpdates(_0x38dc7b,_0x1c3bbc){return function(_0xfd1ef0){if(_0xfd1ef0){return _0xfd1ef0['update'](_0x38dc7b)['then'](function(_0x1c7817){return _0x1c7817;});}return null;};}function removeEntity(_0x50617e,_0x3eebcc){return function(_0x45ba17){if(_0x45ba17){return _0x45ba17[_0x1993('0x2f')]()[_0x1993('0x19')](function(){_0x50617e[_0x1993('0x28')](0xcc)[_0x1993('0x30')]();});}};}function handleEntityNotFound(_0x3e52d7,_0x2a74eb){return function(_0x565fb6){if(!_0x565fb6){_0x3e52d7[_0x1993('0x31')](0x194);}return _0x565fb6;};}function handleError(_0x40c410,_0x493360){_0x493360=_0x493360||0x1f4;return function(_0x299225){logger['error'](_0x299225[_0x1993('0x32')]);if(_0x299225['name']){delete _0x299225[_0x1993('0x33')];}_0x40c410[_0x1993('0x28')](_0x493360)[_0x1993('0x34')](_0x299225);};}exports[_0x1993('0x35')]=function(_0x5705d0,_0x5c99ac){var _0x528031={},_0x56b690={},_0x257163={'count':0x0,'rows':[]};var _0x5d352e=_[_0x1993('0x36')](db[_0x1993('0x37')][_0x1993('0x38')],function(_0x23fe98){return{'name':_0x23fe98[_0x1993('0x39')],'type':_0x23fe98[_0x1993('0x3a')]['key']};});_0x56b690[_0x1993('0x3b')]=_['map'](_0x5d352e,_0x1993('0x33'));_0x56b690['query']=_['keys'](_0x5705d0[_0x1993('0x3c')]);_0x56b690['filters']=_['intersection'](_0x56b690[_0x1993('0x3b')],_0x56b690['query']);_0x528031[_0x1993('0x3d')]=_[_0x1993('0x3e')](_0x56b690[_0x1993('0x3b')],qs[_0x1993('0x3f')](_0x5705d0[_0x1993('0x3c')][_0x1993('0x3f')]));_0x528031[_0x1993('0x3d')]=_0x528031[_0x1993('0x3d')][_0x1993('0x40')]?_0x528031['attributes']:_0x56b690[_0x1993('0x3b')];if(!_0x5705d0[_0x1993('0x3c')][_0x1993('0x41')](_0x1993('0x42'))){_0x528031['limit']=qs[_0x1993('0x26')](_0x5705d0[_0x1993('0x3c')]['limit']);_0x528031[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x5705d0[_0x1993('0x3c')][_0x1993('0x24')]);}_0x528031['order']=qs['sort'](_0x5705d0[_0x1993('0x3c')][_0x1993('0x43')]);_0x528031[_0x1993('0x44')]=qs['filters'](_[_0x1993('0x45')](_0x5705d0[_0x1993('0x3c')],_0x56b690['filters']),_0x5d352e);if(_0x5705d0[_0x1993('0x3c')][_0x1993('0x46')]){_0x528031['where']=_[_0x1993('0x47')](_0x528031[_0x1993('0x44')],{'$or':_[_0x1993('0x36')](_0x5d352e,function(_0x5bd347){if(_0x5bd347[_0x1993('0x3a')]!==_0x1993('0x48')){var _0x25b094={};_0x25b094[_0x5bd347[_0x1993('0x33')]]={'$like':'%'+_0x5705d0[_0x1993('0x3c')][_0x1993('0x46')]+'%'};return _0x25b094;}})});}_0x528031=_[_0x1993('0x47')]({},_0x528031,_0x5705d0[_0x1993('0x49')]);var _0x5e36be={'where':_0x528031['where']};return db[_0x1993('0x37')]['count'](_0x5e36be)[_0x1993('0x19')](function(_0x2567d8){_0x257163['count']=_0x2567d8;if(_0x5705d0['query'][_0x1993('0x4a')]){_0x528031[_0x1993('0x4b')]=[{'all':!![]}];}return db[_0x1993('0x37')][_0x1993('0x4c')](_0x528031);})['then'](function(_0xda7eea){_0x257163[_0x1993('0x4d')]=_0xda7eea;return _0x257163;})[_0x1993('0x19')](respondWithFilteredResult(_0x5c99ac,_0x528031))[_0x1993('0x4e')](handleError(_0x5c99ac,null));};exports[_0x1993('0x4f')]=function(_0x567e6f,_0x4ab94a){var _0x346e47={'raw':![],'where':{'id':_0x567e6f[_0x1993('0x50')]['id']}},_0x12cdc6={};_0x12cdc6['model']=_['keys'](db[_0x1993('0x37')][_0x1993('0x38')]);_0x12cdc6[_0x1993('0x3c')]=_[_0x1993('0x51')](_0x567e6f[_0x1993('0x3c')]);_0x12cdc6['filters']=_[_0x1993('0x3e')](_0x12cdc6['model'],_0x12cdc6[_0x1993('0x3c')]);_0x346e47['attributes']=_['intersection'](_0x12cdc6[_0x1993('0x3b')],qs[_0x1993('0x3f')](_0x567e6f[_0x1993('0x3c')][_0x1993('0x3f')]));_0x346e47['attributes']=_0x346e47['attributes'][_0x1993('0x40')]?_0x346e47['attributes']:_0x12cdc6[_0x1993('0x3b')];if(_0x567e6f[_0x1993('0x3c')]['includeAll']){_0x346e47[_0x1993('0x4b')]=[{'all':!![]}];}_0x346e47=_[_0x1993('0x47')]({},_0x346e47,_0x567e6f[_0x1993('0x49')]);return db[_0x1993('0x37')][_0x1993('0x52')](_0x346e47)[_0x1993('0x19')](handleEntityNotFound(_0x4ab94a,null))[_0x1993('0x19')](respondWithResult(_0x4ab94a,null))[_0x1993('0x4e')](handleError(_0x4ab94a,null));};exports['create']=function(_0x42d719,_0x3c9e64){return db[_0x1993('0x37')][_0x1993('0x53')](_0x42d719[_0x1993('0x54')],{})[_0x1993('0x19')](respondWithResult(_0x3c9e64,0xc9))['catch'](handleError(_0x3c9e64,null));};exports[_0x1993('0x55')]=function(_0x3b809b,_0x46a798){if(_0x3b809b[_0x1993('0x54')]['id']){delete _0x3b809b[_0x1993('0x54')]['id'];}return db[_0x1993('0x37')][_0x1993('0x52')]({'where':{'id':_0x3b809b[_0x1993('0x50')]['id']}})['then'](handleEntityNotFound(_0x46a798,null))['then'](saveUpdates(_0x3b809b[_0x1993('0x54')],null))['then'](respondWithResult(_0x46a798,null))[_0x1993('0x4e')](handleError(_0x46a798,null));};exports[_0x1993('0x2f')]=function(_0x33e701,_0x328326){return db[_0x1993('0x37')][_0x1993('0x52')]({'where':{'id':_0x33e701[_0x1993('0x50')]['id']}})[_0x1993('0x19')](handleEntityNotFound(_0x328326,null))[_0x1993('0x19')](removeEntity(_0x328326,null))[_0x1993('0x4e')](handleError(_0x328326,null));};exports['getConfigurations']=function(_0x3c83e4,_0x14d253,_0x213f67){var _0x34aa12={};var _0x3f085e={};var _0x49a1af;var _0x397cca;return db['ServicenowAccount']['findOne']({'where':{'id':_0x3c83e4[_0x1993('0x50')]['id']}})['then'](handleEntityNotFound(_0x14d253,null))[_0x1993('0x19')](function(_0xcf26c2){if(_0xcf26c2){_0x49a1af=_0xcf26c2;_0x3f085e['model']=_[_0x1993('0x51')](db[_0x1993('0x56')][_0x1993('0x38')]);_0x3f085e[_0x1993('0x3c')]=_['keys'](_0x3c83e4[_0x1993('0x3c')]);_0x3f085e[_0x1993('0x57')]=_[_0x1993('0x3e')](_0x3f085e[_0x1993('0x3b')],_0x3f085e[_0x1993('0x3c')]);_0x34aa12[_0x1993('0x3d')]=_[_0x1993('0x3e')](_0x3f085e[_0x1993('0x3b')],qs[_0x1993('0x3f')](_0x3c83e4[_0x1993('0x3c')]['fields']));_0x34aa12['attributes']=_0x34aa12[_0x1993('0x3d')]['length']?_0x34aa12[_0x1993('0x3d')]:_0x3f085e[_0x1993('0x3b')];_0x34aa12[_0x1993('0x58')]=qs[_0x1993('0x43')](_0x3c83e4[_0x1993('0x3c')]['sort']);_0x34aa12[_0x1993('0x44')]=qs[_0x1993('0x57')](_['pick'](_0x3c83e4[_0x1993('0x3c')],_0x3f085e[_0x1993('0x57')]));if(_0x3c83e4[_0x1993('0x3c')][_0x1993('0x46')]){_0x34aa12[_0x1993('0x44')]=_[_0x1993('0x47')](_0x34aa12[_0x1993('0x44')],{'$or':_[_0x1993('0x36')](_0x34aa12[_0x1993('0x3d')],function(_0x40b3da){var _0x525825={};_0x525825[_0x40b3da]={'$like':'%'+_0x3c83e4[_0x1993('0x3c')][_0x1993('0x46')]+'%'};return _0x525825;})});}_0x34aa12=_[_0x1993('0x47')]({},_0x34aa12,_0x3c83e4[_0x1993('0x49')]);return _0x49a1af[_0x1993('0x59')](_0x34aa12);}})[_0x1993('0x19')](function(_0x4e736a){if(_0x4e736a){_0x397cca=_0x4e736a[_0x1993('0x40')];if(!_0x3c83e4[_0x1993('0x3c')][_0x1993('0x41')](_0x1993('0x42'))){_0x34aa12[_0x1993('0x26')]=qs[_0x1993('0x26')](_0x3c83e4[_0x1993('0x3c')][_0x1993('0x26')]);_0x34aa12[_0x1993('0x24')]=qs['offset'](_0x3c83e4[_0x1993('0x3c')][_0x1993('0x24')]);}return _0x49a1af['getConfigurations'](_0x34aa12);}})['then'](function(_0x321e00){if(_0x321e00){return _0x321e00?{'count':_0x397cca,'rows':_0x321e00}:null;}})[_0x1993('0x19')](respondWithResult(_0x14d253,null))['catch'](handleError(_0x14d253,null));};exports[_0x1993('0x5a')]=function(_0x4af776,_0x232e8a,_0x2c9511){if(_0x4af776[_0x1993('0x54')]['id']){delete _0x4af776[_0x1993('0x54')]['id'];}return db[_0x1993('0x37')]['findOne']({'where':{'id':_0x4af776['params']['id']}})[_0x1993('0x19')](handleEntityNotFound(_0x232e8a,null))['then'](function(_0x1221e5){if(_0x1221e5){_0x4af776['body'][_0x1993('0x5b')]=_0x1221e5['id'];_0x4af776[_0x1993('0x54')][_0x1993('0x5c')]=integrations[_0x1993('0x5d')](_0x4af776[_0x1993('0x54')][_0x1993('0x5e')],_0x4af776[_0x1993('0x54')]['type']);_0x4af776[_0x1993('0x54')]['Descriptions']=integrations['getDescriptions'](_0x4af776['body'][_0x1993('0x5e')],_0x4af776[_0x1993('0x54')][_0x1993('0x3a')]);return db[_0x1993('0x56')]['create'](_0x4af776['body'],{'include':[{'model':db[_0x1993('0x5f')],'as':_0x1993('0x5c')},{'model':db[_0x1993('0x5f')],'as':'Descriptions'}]});}return null;})[_0x1993('0x19')](respondWithResult(_0x232e8a,null))[_0x1993('0x4e')](handleError(_0x232e8a,null));};exports['getFields']=function(_0x4ea69d,_0x504623,_0x9bf75){var _0x2498b6=[_0x1993('0x60'),_0x1993('0x61'),_0x1993('0x62'),_0x1993('0x63'),'close_code',_0x1993('0x64'),'incident_state',_0x1993('0x65'),'category'];var _0x316a89=['parent',_0x1993('0x60'),_0x1993('0x66'),_0x1993('0x67'),_0x1993('0x68'),'sys_updated_on','child_incidents',_0x1993('0x61'),_0x1993('0x69'),_0x1993('0x6a'),_0x1993('0x6b'),'sys_updated_by',_0x1993('0x6c'),_0x1993('0x6d'),'sys_created_on',_0x1993('0x6e'),'state','sys_created_by','knowledge','order','calendar_stc',_0x1993('0x6f'),'cmdb_ci','delivery_plan',_0x1993('0x70'),_0x1993('0x71'),_0x1993('0x72'),_0x1993('0x73'),_0x1993('0x74'),_0x1993('0x75'),_0x1993('0x76'),_0x1993('0x77'),_0x1993('0x78'),_0x1993('0x79'),'business_duration','group_list',_0x1993('0x7a'),_0x1993('0x7b'),_0x1993('0x7c'),_0x1993('0x7d'),_0x1993('0x7e'),_0x1993('0x63'),'work_notes',_0x1993('0x7f'),_0x1993('0x80'),_0x1993('0x81'),'delivery_task','work_start',_0x1993('0x82'),_0x1993('0x83'),_0x1993('0x84'),_0x1993('0x85'),_0x1993('0x86'),_0x1993('0x64'),'sys_class_name',_0x1993('0x87'),_0x1993('0x88'),'follow_up',_0x1993('0x89'),_0x1993('0x8a'),_0x1993('0x8b'),_0x1993('0x8c'),'incident_state',_0x1993('0x8d'),_0x1993('0x8e'),'company','reassignment_count',_0x1993('0x8f'),'assigned_to',_0x1993('0x65'),_0x1993('0x90'),_0x1993('0x91'),_0x1993('0x92'),_0x1993('0x93'),'due_date',_0x1993('0x94'),_0x1993('0x95'),_0x1993('0x96'),_0x1993('0x97'),_0x1993('0x98'),_0x1993('0x99'),_0x1993('0x9a'),_0x1993('0x9b')];var _0x3494e9='';var _0xa36f20='';var _0x3e735b=[];var _0x59b9d0='';var _0x26888b='';var _0x3cf141=[];var _0x107b17='';var _0x3af7d2='';var _0x33426b={};var _0x43a388='';return db[_0x1993('0x37')]['findOne']({'where':{'id':_0x4ea69d[_0x1993('0x50')]['id']},'attributes':['id','username',_0x1993('0x9c'),_0x1993('0x9d'),_0x1993('0x9e'),_0x1993('0x9f')]})[_0x1993('0x19')](handleEntityNotFound(_0x504623,null))['then'](function(_0x9e22e4){if(_0x9e22e4){_0x43a388=_0x9e22e4['remoteUri'];var _0x5230f1=_0x43a388[_0x1993('0xa0')](-0x1);if(_0x5230f1==='/'){_0x43a388=_0x43a388['substring'](0x0,_0x43a388['lastIndexOf'](_0x5230f1));}_0x3af7d2=util[_0x1993('0xa1')](_0x1993('0xa2'),_0x43a388);_0x107b17=util[_0x1993('0xa1')](_0x1993('0xa3'),_0x43a388);_0x33426b={'user':_0x9e22e4[_0x1993('0xa4')],'pass':_0x9e22e4['password']};var _0xce7123={'method':_0x1993('0xa5'),'uri':_0x3af7d2+'incident?sysparm_display_value=all','auth':_0x33426b,'json':!![]};return rp(_0xce7123);}})[_0x1993('0x19')](function(_0x1ca36b){if(_0x1ca36b[_0x1993('0x23')]['length']>0x0){_0x3494e9=_0x1ca36b[_0x1993('0x23')];}console[_0x1993('0xa6')]('incident\x20table\x20objects',_0x3494e9);_0x3cf141=[];_0xa36f20=Object[_0x1993('0xa7')]([],_0x3494e9);_['remove'](_0xa36f20,function(_0x18ac45){return!_0x2498b6[_0x1993('0xa8')](_0x18ac45[_0x1993('0x33')]);});_0xa36f20[_0x1993('0xa9')](function(_0x45c358){var _0x13de10=createFieldObject(_0x107b17,_0x33426b,_0x45c358[_0x1993('0xaa')],_0x45c358[_0x1993('0x33')],_0x45c358[_0x1993('0xab')],![]);_0x3cf141[_0x1993('0xac')](_0x13de10);});return Promise[_0x1993('0xad')](_0x3cf141);})[_0x1993('0x19')](function(_0x5acd37){_0x3e735b=_0x5acd37;_0x59b9d0=Object[_0x1993('0xa7')]([],_0x3494e9);console[_0x1993('0xa6')](_0x1993('0xae'),_0x3494e9);_[_0x1993('0xaf')](_0x59b9d0,function(_0x10f25e){return _0x316a89[_0x1993('0xa8')](_0x10f25e[_0x1993('0x33')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x59b9d0);_0x3cf141=[];_0x59b9d0[_0x1993('0xa9')](function(_0x4f1af2){var _0x47dc85=createFieldObject(_0x107b17,_0x33426b,_0x4f1af2['internalType'],_0x4f1af2[_0x1993('0x33')],_0x4f1af2['label'],!![]);_0x3cf141['push'](_0x47dc85);});return Promise[_0x1993('0xad')](_0x3cf141);})['then'](function(_0x2765fc){_0x26888b=_0x2765fc;var _0x3bd4eb=_0x3e735b[_0x1993('0xb0')](_0x26888b);return{'count':_0x3bd4eb[_0x1993('0x40')],'rows':_0x3bd4eb};})[_0x1993('0x19')](respondWithResult(_0x504623,null))[_0x1993('0x4e')](function(_0x4260f1){console[_0x1993('0xa6')](_0x1993('0xb1')+_0x4260f1);var _0x39523b=_0x4ea69d[_0x1993('0x3c')]['test']?0x1f4:_0x4260f1[_0x1993('0xb2')]||0x1f4;logger['error'](_0x4260f1[_0x1993('0x32')]);delete _0x4260f1[_0x1993('0x33')];if(_0x39523b===0x191){_0x39523b=0x190;}_0x504623['status'](_0x39523b)[_0x1993('0x34')](_0x4ea69d[_0x1993('0x3c')][_0x1993('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x4260f1[_0x1993('0xb2')]}:_0x4260f1);});};function createFieldObject(_0x5ea0b3,_0x18a63f,_0xbb2f65,_0x372c1a,_0xb468c2,_0x77808a){return new Promise(function(_0x4bc099,_0x5552a0){var _0x1a2814={'id':_0x372c1a,'name':_0xb468c2,'custom':_0x77808a};if(_0xbb2f65===_0x1993('0xb4')){_0x1a2814[_0x1993('0x49')]=[{'name':_0x1993('0xb5'),'value':_0x1993('0xb6')},{'name':'False','value':_0x1993('0xb7')}];_0x4bc099(_0x1a2814);}else{var _0x43da72={'method':'GET','uri':_0x5ea0b3+_0x1993('0xb8')+_0x372c1a,'auth':_0x18a63f,'json':!![]};return rp(_0x43da72)[_0x1993('0x19')](function(_0x3a04b8){var _0x7e490f=[];if(_0x3a04b8['result'][_0x1993('0x40')]>0x0){_0x3a04b8[_0x1993('0x23')][_0x1993('0xa9')](function(_0x54b0dc){if(_0x54b0dc[_0x1993('0xb9')]===_0x1993('0xb7')){var _0x169994={'name':_0x54b0dc['label'],'value':_0x54b0dc['value']};_0x7e490f[_0x1993('0xac')](_0x169994);}});}_0x1a2814['options']=_0x7e490f;if(_0x1a2814['options'][_0x1993('0x40')]>0x0){_0x4bc099(_0x1a2814);}else{if(_0x77808a==![]){_0x4bc099();}else{_0x4bc099(_0x1a2814);}}});}});}
\ No newline at end of file
+var _0x0d00=['includes','forEach','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','statusCode','test','boolean','true','false','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','rawAttributes','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','catch','show','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','filters','length','hasOwnProperty','AccountId','Subjects','channel','ServicenowField','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','escalation','upon_approval','correlation_id','location','category','username','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove'];(function(_0x50efab,_0x44bb23){var _0x3d83b2=function(_0x231b40){while(--_0x231b40){_0x50efab['push'](_0x50efab['shift']());}};_0x3d83b2(++_0x44bb23);}(_0x0d00,0x186));var _0x00d0=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x0d00[_0x590b63];return _0x3c9380;};'use strict';var emlformat=require(_0x00d0('0x0'));var rimraf=require(_0x00d0('0x1'));var zipdir=require(_0x00d0('0x2'));var jsonpatch=require(_0x00d0('0x3'));var rp=require(_0x00d0('0x4'));var moment=require('moment');var BPromise=require(_0x00d0('0x5'));var Mustache=require(_0x00d0('0x6'));var util=require(_0x00d0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x00d0('0x8'));var ejs=require(_0x00d0('0x9'));var fs=require('fs');var fs_extra=require(_0x00d0('0xa'));var _=require(_0x00d0('0xb'));var squel=require(_0x00d0('0xc'));var crypto=require(_0x00d0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x00d0('0xe'));var toCsv=require(_0x00d0('0x8'));var querystring=require(_0x00d0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00d0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x00d0('0x11'));var hardwareService=require(_0x00d0('0x12'));var logger=require(_0x00d0('0x13'))(_0x00d0('0x14'));var utils=require(_0x00d0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x00d0('0x16'));var db=require(_0x00d0('0x17'))['db'];var integrations=require(_0x00d0('0x18'));var jayson=require(_0x00d0('0x19'));var client=jayson[_0x00d0('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3f7a,_0x1dd312,_0x4da1b5,_0xaf4c17){return new BPromise(function(_0x930248,_0xe7b506){var _0x341ef9=_0xaf4c17||client;return _0x341ef9[_0x00d0('0x1b')](_0x4a3f7a,_0x4da1b5)[_0x00d0('0x1c')](function(_0x3063c3){logger[_0x00d0('0x1d')](_0x00d0('0x1e'),_0x1dd312,_0x00d0('0x1f'));logger[_0x00d0('0x20')](_0x00d0('0x21'),_0x1dd312,'request\x20sent',JSON['stringify'](_0x3063c3));if(_0x3063c3[_0x00d0('0x22')]){if(_0x3063c3[_0x00d0('0x22')][_0x00d0('0x23')]===0x1f4){logger[_0x00d0('0x22')](_0x00d0('0x1e'),_0x1dd312,_0x3063c3[_0x00d0('0x22')][_0x00d0('0x24')]);return _0xe7b506(_0x3063c3[_0x00d0('0x22')]['message']);}logger[_0x00d0('0x22')](_0x00d0('0x1e'),_0x1dd312,_0x3063c3[_0x00d0('0x22')][_0x00d0('0x24')]);return _0x930248(_0x3063c3[_0x00d0('0x22')][_0x00d0('0x24')]);}else{logger[_0x00d0('0x1d')](_0x00d0('0x1e'),_0x1dd312,_0x00d0('0x1f'));_0x930248(_0x3063c3['result'][_0x00d0('0x24')]);}})['catch'](function(_0x2c4c77){logger[_0x00d0('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x1dd312,_0x2c4c77);_0xe7b506(_0x2c4c77);});});}function respondWithStatusCode(_0x564eeb,_0x3dce43){_0x3dce43=_0x3dce43||0xcc;return function(_0x583ccc){if(_0x583ccc){return _0x564eeb[_0x00d0('0x25')](_0x3dce43);}return _0x564eeb[_0x00d0('0x26')](_0x3dce43)[_0x00d0('0x27')]();};}function respondWithResult(_0x45c0a0,_0x41213b){_0x41213b=_0x41213b||0xc8;return function(_0x596348){if(_0x596348){return _0x45c0a0[_0x00d0('0x26')](_0x41213b)[_0x00d0('0x28')](_0x596348);}};}function respondWithFilteredResult(_0x463c82,_0x57d57e){return function(_0x1981f0){if(_0x1981f0){var _0x4d62cb=typeof _0x57d57e[_0x00d0('0x29')]===_0x00d0('0x2a')&&typeof _0x57d57e[_0x00d0('0x2b')]===_0x00d0('0x2a');var _0x2c4ab2=_0x1981f0[_0x00d0('0x2c')];var _0x334ecc=_0x4d62cb?0x0:_0x57d57e[_0x00d0('0x29')];var _0x3e1828=_0x4d62cb?_0x1981f0[_0x00d0('0x2c')]:_0x57d57e[_0x00d0('0x29')]+_0x57d57e[_0x00d0('0x2b')];var _0x426c87;if(_0x3e1828>=_0x2c4ab2){_0x3e1828=_0x2c4ab2;_0x426c87=0xc8;}else{_0x426c87=0xce;}_0x463c82['status'](_0x426c87);return _0x463c82[_0x00d0('0x2d')](_0x00d0('0x2e'),_0x334ecc+'-'+_0x3e1828+'/'+_0x2c4ab2)[_0x00d0('0x28')](_0x1981f0);}return null;};}function patchUpdates(_0x3ef727){return function(_0x54b044){try{jsonpatch[_0x00d0('0x2f')](_0x54b044,_0x3ef727,!![]);}catch(_0x4361e1){return BPromise['reject'](_0x4361e1);}return _0x54b044[_0x00d0('0x30')]();};}function saveUpdates(_0x1c3fba,_0x3a292e){return function(_0x153958){if(_0x153958){return _0x153958[_0x00d0('0x31')](_0x1c3fba)['then'](function(_0x38d3b7){return _0x38d3b7;});}return null;};}function removeEntity(_0x5cafad,_0x25fd84){return function(_0x1cb040){if(_0x1cb040){return _0x1cb040[_0x00d0('0x32')]()['then'](function(){_0x5cafad['status'](0xcc)[_0x00d0('0x27')]();});}};}function handleEntityNotFound(_0x43f3bb,_0x388202){return function(_0x55ba21){if(!_0x55ba21){_0x43f3bb[_0x00d0('0x25')](0x194);}return _0x55ba21;};}function handleError(_0x490c18,_0x125b98){_0x125b98=_0x125b98||0x1f4;return function(_0x29b1b3){logger[_0x00d0('0x22')](_0x29b1b3[_0x00d0('0x33')]);if(_0x29b1b3['name']){delete _0x29b1b3[_0x00d0('0x34')];}_0x490c18[_0x00d0('0x26')](_0x125b98)[_0x00d0('0x35')](_0x29b1b3);};}exports[_0x00d0('0x36')]=function(_0x16f56d,_0x3f89b8){var _0x2281cf={},_0x5a0f69={},_0x532ba9={'count':0x0,'rows':[]};var _0x160fa3=_[_0x00d0('0x37')](db['ServicenowAccount'][_0x00d0('0x38')],function(_0x4bfc6c){return{'name':_0x4bfc6c['fieldName'],'type':_0x4bfc6c['type'][_0x00d0('0x39')]};});_0x5a0f69[_0x00d0('0x3a')]=_[_0x00d0('0x37')](_0x160fa3,'name');_0x5a0f69[_0x00d0('0x3b')]=_[_0x00d0('0x3c')](_0x16f56d[_0x00d0('0x3b')]);_0x5a0f69['filters']=_[_0x00d0('0x3d')](_0x5a0f69[_0x00d0('0x3a')],_0x5a0f69[_0x00d0('0x3b')]);_0x2281cf['attributes']=_[_0x00d0('0x3d')](_0x5a0f69[_0x00d0('0x3a')],qs[_0x00d0('0x3e')](_0x16f56d['query'][_0x00d0('0x3e')]));_0x2281cf[_0x00d0('0x3f')]=_0x2281cf[_0x00d0('0x3f')]['length']?_0x2281cf[_0x00d0('0x3f')]:_0x5a0f69[_0x00d0('0x3a')];if(!_0x16f56d[_0x00d0('0x3b')]['hasOwnProperty'](_0x00d0('0x40'))){_0x2281cf[_0x00d0('0x2b')]=qs[_0x00d0('0x2b')](_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x2b')]);_0x2281cf[_0x00d0('0x29')]=qs[_0x00d0('0x29')](_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x29')]);}_0x2281cf[_0x00d0('0x41')]=qs[_0x00d0('0x42')](_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x42')]);_0x2281cf[_0x00d0('0x43')]=qs['filters'](_[_0x00d0('0x44')](_0x16f56d[_0x00d0('0x3b')],_0x5a0f69['filters']),_0x160fa3);if(_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x45')]){_0x2281cf[_0x00d0('0x43')]=_[_0x00d0('0x46')](_0x2281cf['where'],{'$or':_[_0x00d0('0x37')](_0x160fa3,function(_0x49e208){if(_0x49e208[_0x00d0('0x47')]!==_0x00d0('0x48')){var _0x5d388f={};_0x5d388f[_0x49e208[_0x00d0('0x34')]]={'$like':'%'+_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x45')]+'%'};return _0x5d388f;}})});}_0x2281cf=_[_0x00d0('0x46')]({},_0x2281cf,_0x16f56d[_0x00d0('0x49')]);var _0x2db28e={'where':_0x2281cf[_0x00d0('0x43')]};return db[_0x00d0('0x4a')][_0x00d0('0x2c')](_0x2db28e)[_0x00d0('0x1c')](function(_0x23db37){_0x532ba9[_0x00d0('0x2c')]=_0x23db37;if(_0x16f56d[_0x00d0('0x3b')][_0x00d0('0x4b')]){_0x2281cf[_0x00d0('0x4c')]=[{'all':!![]}];}return db[_0x00d0('0x4a')][_0x00d0('0x4d')](_0x2281cf);})[_0x00d0('0x1c')](function(_0x16c96b){_0x532ba9['rows']=_0x16c96b;return _0x532ba9;})['then'](respondWithFilteredResult(_0x3f89b8,_0x2281cf))[_0x00d0('0x4e')](handleError(_0x3f89b8,null));};exports[_0x00d0('0x4f')]=function(_0x2348e8,_0x3458e4){var _0x15a1a2={'raw':![],'where':{'id':_0x2348e8['params']['id']}},_0x4395f6={};_0x4395f6[_0x00d0('0x3a')]=_[_0x00d0('0x3c')](db[_0x00d0('0x4a')][_0x00d0('0x38')]);_0x4395f6[_0x00d0('0x3b')]=_['keys'](_0x2348e8[_0x00d0('0x3b')]);_0x4395f6['filters']=_[_0x00d0('0x3d')](_0x4395f6['model'],_0x4395f6['query']);_0x15a1a2[_0x00d0('0x3f')]=_[_0x00d0('0x3d')](_0x4395f6[_0x00d0('0x3a')],qs['fields'](_0x2348e8[_0x00d0('0x3b')][_0x00d0('0x3e')]));_0x15a1a2[_0x00d0('0x3f')]=_0x15a1a2['attributes']['length']?_0x15a1a2[_0x00d0('0x3f')]:_0x4395f6[_0x00d0('0x3a')];if(_0x2348e8['query'][_0x00d0('0x4b')]){_0x15a1a2[_0x00d0('0x4c')]=[{'all':!![]}];}_0x15a1a2=_['merge']({},_0x15a1a2,_0x2348e8[_0x00d0('0x49')]);return db[_0x00d0('0x4a')][_0x00d0('0x50')](_0x15a1a2)[_0x00d0('0x1c')](handleEntityNotFound(_0x3458e4,null))[_0x00d0('0x1c')](respondWithResult(_0x3458e4,null))[_0x00d0('0x4e')](handleError(_0x3458e4,null));};exports[_0x00d0('0x51')]=function(_0x51dba5,_0x46fb08){return db['ServicenowAccount']['create'](_0x51dba5[_0x00d0('0x52')],{})[_0x00d0('0x1c')](respondWithResult(_0x46fb08,0xc9))[_0x00d0('0x4e')](handleError(_0x46fb08,null));};exports[_0x00d0('0x31')]=function(_0x4b6a11,_0x1d42ba){if(_0x4b6a11[_0x00d0('0x52')]['id']){delete _0x4b6a11[_0x00d0('0x52')]['id'];}return db[_0x00d0('0x4a')][_0x00d0('0x50')]({'where':{'id':_0x4b6a11[_0x00d0('0x53')]['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x1d42ba,null))[_0x00d0('0x1c')](saveUpdates(_0x4b6a11[_0x00d0('0x52')],null))[_0x00d0('0x1c')](respondWithResult(_0x1d42ba,null))[_0x00d0('0x4e')](handleError(_0x1d42ba,null));};exports[_0x00d0('0x32')]=function(_0x26b541,_0x508e3f){return db[_0x00d0('0x4a')][_0x00d0('0x50')]({'where':{'id':_0x26b541[_0x00d0('0x53')]['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x508e3f,null))[_0x00d0('0x1c')](removeEntity(_0x508e3f,null))[_0x00d0('0x4e')](handleError(_0x508e3f,null));};exports[_0x00d0('0x54')]=function(_0x407e2c,_0x556dee,_0x2e5687){var _0x163c85={};var _0x1a9fa5={};var _0x49edcd;var _0xd489bf;return db[_0x00d0('0x4a')][_0x00d0('0x55')]({'where':{'id':_0x407e2c[_0x00d0('0x53')]['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x556dee,null))[_0x00d0('0x1c')](function(_0x2027ce){if(_0x2027ce){_0x49edcd=_0x2027ce;_0x1a9fa5[_0x00d0('0x3a')]=_['keys'](db[_0x00d0('0x56')][_0x00d0('0x38')]);_0x1a9fa5[_0x00d0('0x3b')]=_[_0x00d0('0x3c')](_0x407e2c[_0x00d0('0x3b')]);_0x1a9fa5[_0x00d0('0x57')]=_[_0x00d0('0x3d')](_0x1a9fa5[_0x00d0('0x3a')],_0x1a9fa5[_0x00d0('0x3b')]);_0x163c85[_0x00d0('0x3f')]=_['intersection'](_0x1a9fa5[_0x00d0('0x3a')],qs[_0x00d0('0x3e')](_0x407e2c['query'][_0x00d0('0x3e')]));_0x163c85['attributes']=_0x163c85[_0x00d0('0x3f')][_0x00d0('0x58')]?_0x163c85[_0x00d0('0x3f')]:_0x1a9fa5[_0x00d0('0x3a')];_0x163c85[_0x00d0('0x41')]=qs['sort'](_0x407e2c['query'][_0x00d0('0x42')]);_0x163c85[_0x00d0('0x43')]=qs[_0x00d0('0x57')](_[_0x00d0('0x44')](_0x407e2c[_0x00d0('0x3b')],_0x1a9fa5[_0x00d0('0x57')]));if(_0x407e2c['query'][_0x00d0('0x45')]){_0x163c85[_0x00d0('0x43')]=_['merge'](_0x163c85['where'],{'$or':_[_0x00d0('0x37')](_0x163c85[_0x00d0('0x3f')],function(_0x85fa7e){var _0x3e7dd1={};_0x3e7dd1[_0x85fa7e]={'$like':'%'+_0x407e2c[_0x00d0('0x3b')][_0x00d0('0x45')]+'%'};return _0x3e7dd1;})});}_0x163c85=_['merge']({},_0x163c85,_0x407e2c[_0x00d0('0x49')]);return _0x49edcd['getConfigurations'](_0x163c85);}})['then'](function(_0x97df65){if(_0x97df65){_0xd489bf=_0x97df65[_0x00d0('0x58')];if(!_0x407e2c[_0x00d0('0x3b')][_0x00d0('0x59')](_0x00d0('0x40'))){_0x163c85[_0x00d0('0x2b')]=qs[_0x00d0('0x2b')](_0x407e2c[_0x00d0('0x3b')][_0x00d0('0x2b')]);_0x163c85['offset']=qs[_0x00d0('0x29')](_0x407e2c['query']['offset']);}return _0x49edcd[_0x00d0('0x54')](_0x163c85);}})[_0x00d0('0x1c')](function(_0x412853){if(_0x412853){return _0x412853?{'count':_0xd489bf,'rows':_0x412853}:null;}})[_0x00d0('0x1c')](respondWithResult(_0x556dee,null))[_0x00d0('0x4e')](handleError(_0x556dee,null));};exports['addConfiguration']=function(_0x3d3eaa,_0x32a6c7,_0x29960b){if(_0x3d3eaa[_0x00d0('0x52')]['id']){delete _0x3d3eaa['body']['id'];}return db['ServicenowAccount'][_0x00d0('0x55')]({'where':{'id':_0x3d3eaa['params']['id']}})[_0x00d0('0x1c')](handleEntityNotFound(_0x32a6c7,null))['then'](function(_0xedb25d){if(_0xedb25d){_0x3d3eaa[_0x00d0('0x52')][_0x00d0('0x5a')]=_0xedb25d['id'];_0x3d3eaa['body'][_0x00d0('0x5b')]=integrations['getSubjects'](_0x3d3eaa[_0x00d0('0x52')]['channel'],_0x3d3eaa['body'][_0x00d0('0x47')]);_0x3d3eaa[_0x00d0('0x52')]['Descriptions']=integrations['getDescriptions'](_0x3d3eaa['body'][_0x00d0('0x5c')],_0x3d3eaa[_0x00d0('0x52')][_0x00d0('0x47')]);return db[_0x00d0('0x56')][_0x00d0('0x51')](_0x3d3eaa[_0x00d0('0x52')],{'include':[{'model':db[_0x00d0('0x5d')],'as':_0x00d0('0x5b')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x32a6c7,null))[_0x00d0('0x4e')](handleError(_0x32a6c7,null));};exports[_0x00d0('0x5e')]=function(_0x3bea08,_0x49f1d0,_0x2a4271){var _0x45d202=['made_sla',_0x00d0('0x5f'),_0x00d0('0x60'),_0x00d0('0x61'),_0x00d0('0x62'),_0x00d0('0x63'),_0x00d0('0x64'),_0x00d0('0x65'),'category'];var _0x3e2897=[_0x00d0('0x66'),_0x00d0('0x67'),_0x00d0('0x68'),_0x00d0('0x69'),_0x00d0('0x6a'),_0x00d0('0x6b'),'child_incidents','hold_reason',_0x00d0('0x6c'),_0x00d0('0x6d'),_0x00d0('0x6e'),_0x00d0('0x6f'),_0x00d0('0x70'),'user_input',_0x00d0('0x71'),_0x00d0('0x72'),'state',_0x00d0('0x73'),_0x00d0('0x60'),_0x00d0('0x41'),_0x00d0('0x74'),_0x00d0('0x75'),_0x00d0('0x76'),_0x00d0('0x77'),'impact',_0x00d0('0x78'),_0x00d0('0x79'),'business_service',_0x00d0('0x7a'),_0x00d0('0x7b'),_0x00d0('0x7c'),_0x00d0('0x7d'),_0x00d0('0x7e'),_0x00d0('0x7f'),_0x00d0('0x80'),'group_list',_0x00d0('0x81'),'reopened_time','resolved_at','caller_id','approval_set',_0x00d0('0x61'),_0x00d0('0x82'),_0x00d0('0x83'),_0x00d0('0x62'),_0x00d0('0x84'),'delivery_task','work_start',_0x00d0('0x85'),_0x00d0('0x86'),_0x00d0('0x87'),_0x00d0('0x88'),_0x00d0('0x89'),_0x00d0('0x63'),'sys_class_name',_0x00d0('0x8a'),_0x00d0('0x8b'),'follow_up','parent_incident','sys_id','contact_type',_0x00d0('0x8c'),_0x00d0('0x64'),_0x00d0('0x8d'),_0x00d0('0x8e'),_0x00d0('0x8f'),_0x00d0('0x90'),_0x00d0('0x91'),_0x00d0('0x92'),_0x00d0('0x65'),_0x00d0('0x93'),_0x00d0('0x94'),_0x00d0('0x95'),_0x00d0('0x96'),_0x00d0('0x97'),'sys_mod_count','reopen_count','sys_tags',_0x00d0('0x98'),_0x00d0('0x99'),_0x00d0('0x9a'),_0x00d0('0x9b'),_0x00d0('0x9c')];var _0x10fb54='';var _0x21bae0='';var _0x4c56a2=[];var _0x2289b4='';var _0x2562ae='';var _0x2c7468=[];var _0x1823d7='';var _0x9b84b4='';var _0x4a39fd={};var _0x4569cc='';return db['ServicenowAccount'][_0x00d0('0x55')]({'where':{'id':_0x3bea08[_0x00d0('0x53')]['id']},'attributes':['id',_0x00d0('0x9d'),'password',_0x00d0('0x9e'),_0x00d0('0x9f'),'serverUrl']})[_0x00d0('0x1c')](handleEntityNotFound(_0x49f1d0,null))[_0x00d0('0x1c')](function(_0xdd9404){if(_0xdd9404){_0x4569cc=_0xdd9404[_0x00d0('0x9f')];var _0x1a4582=_0x4569cc[_0x00d0('0xa0')](-0x1);if(_0x1a4582==='/'){_0x4569cc=_0x4569cc[_0x00d0('0xa1')](0x0,_0x4569cc[_0x00d0('0xa2')](_0x1a4582));}_0x9b84b4=util[_0x00d0('0xa3')](_0x00d0('0xa4'),_0x4569cc);_0x1823d7=util[_0x00d0('0xa3')](_0x00d0('0xa5'),_0x4569cc);_0x4a39fd={'user':_0xdd9404[_0x00d0('0x9d')],'pass':_0xdd9404[_0x00d0('0xa6')]};var _0xf08fed={'method':_0x00d0('0xa7'),'uri':_0x9b84b4+_0x00d0('0xa8'),'auth':_0x4a39fd,'json':!![]};return rp(_0xf08fed);}})['then'](function(_0x26a45f){if(_0x26a45f[_0x00d0('0xa9')][_0x00d0('0x58')]>0x0){_0x10fb54=_0x26a45f[_0x00d0('0xa9')];}console[_0x00d0('0xaa')](_0x00d0('0xab'),_0x10fb54);_0x2c7468=[];_0x21bae0=Object[_0x00d0('0xac')]([],_0x10fb54);_[_0x00d0('0xad')](_0x21bae0,function(_0x41c2ba){return!_0x45d202[_0x00d0('0xae')](_0x41c2ba[_0x00d0('0x34')]);});_0x21bae0[_0x00d0('0xaf')](function(_0x12bf71){var _0x2a51e4=createFieldObject(_0x1823d7,_0x4a39fd,_0x12bf71['internalType'],_0x12bf71[_0x00d0('0x34')],_0x12bf71[_0x00d0('0xb0')],![]);_0x2c7468[_0x00d0('0xb1')](_0x2a51e4);});return Promise[_0x00d0('0xb2')](_0x2c7468);})[_0x00d0('0x1c')](function(_0x5d4afb){_0x4c56a2=_0x5d4afb;_0x2289b4=Object['assign']([],_0x10fb54);console[_0x00d0('0xaa')](_0x00d0('0xb3'),_0x10fb54);_[_0x00d0('0xad')](_0x2289b4,function(_0x4246f7){return _0x3e2897[_0x00d0('0xae')](_0x4246f7[_0x00d0('0x34')]);});console[_0x00d0('0xaa')](_0x00d0('0xb4'),_0x2289b4);_0x2c7468=[];_0x2289b4['forEach'](function(_0x39b8f6){var _0xae0382=createFieldObject(_0x1823d7,_0x4a39fd,_0x39b8f6[_0x00d0('0xb5')],_0x39b8f6[_0x00d0('0x34')],_0x39b8f6[_0x00d0('0xb0')],!![]);_0x2c7468[_0x00d0('0xb1')](_0xae0382);});return Promise[_0x00d0('0xb2')](_0x2c7468);})['then'](function(_0x30d2ff){_0x2562ae=_0x30d2ff;var _0xb3f9d2=_0x4c56a2[_0x00d0('0xb6')](_0x2562ae);return{'count':_0xb3f9d2[_0x00d0('0x58')],'rows':_0xb3f9d2};})[_0x00d0('0x1c')](respondWithResult(_0x49f1d0,null))[_0x00d0('0x4e')](function(_0x14fe2b){console[_0x00d0('0xaa')]('ServiceNow\x20error:\x20'+_0x14fe2b);var _0x502333=_0x3bea08['query']['test']?0x1f4:_0x14fe2b[_0x00d0('0xb7')]||0x1f4;logger[_0x00d0('0x22')](_0x14fe2b[_0x00d0('0x33')]);delete _0x14fe2b[_0x00d0('0x34')];if(_0x502333===0x191){_0x502333=0x190;}_0x49f1d0[_0x00d0('0x26')](_0x502333)['send'](_0x3bea08[_0x00d0('0x3b')][_0x00d0('0xb8')]?{'message':'Wrong\x20credentials','statusCode':_0x14fe2b['statusCode']}:_0x14fe2b);});};function createFieldObject(_0xc921e0,_0x5a5472,_0x47f27b,_0x243bdd,_0x37a51c,_0x37f90c){return new Promise(function(_0x348f21,_0x22aad7){var _0x1fa3ff={'id':_0x243bdd,'name':_0x37a51c,'custom':_0x37f90c};if(_0x47f27b===_0x00d0('0xb9')){_0x1fa3ff[_0x00d0('0x49')]=[{'name':'True','value':_0x00d0('0xba')},{'name':'False','value':'false'}];_0x348f21(_0x1fa3ff);}else{var _0x2a3a03={'method':'GET','uri':_0xc921e0+'sys_choice?sysparm_query=name=incident^element='+_0x243bdd,'auth':_0x5a5472,'json':!![]};return rp(_0x2a3a03)['then'](function(_0x3edeba){var _0x3c6507=[];if(_0x3edeba['result'][_0x00d0('0x58')]>0x0){_0x3edeba['result'][_0x00d0('0xaf')](function(_0x24ee20){if(_0x24ee20['inactive']===_0x00d0('0xbb')){var _0x214484={'name':_0x24ee20[_0x00d0('0xb0')],'value':_0x24ee20['value']};_0x3c6507[_0x00d0('0xb1')](_0x214484);}});}_0x1fa3ff[_0x00d0('0x49')]=_0x3c6507;if(_0x1fa3ff[_0x00d0('0x49')]['length']>0x0){_0x348f21(_0x1fa3ff);}else{if(_0x37f90c==![]){_0x348f21();}else{_0x348f21(_0x1fa3ff);}}});}});}
\ No newline at end of file
index 0387168..3a8f8af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x57b7f9,_0x45a8e4){var _0x2cc4fe=function(_0x5dcbdf){while(--_0x5dcbdf){_0x57b7f9['push'](_0x57b7f9['shift']());}};_0x2cc4fe(++_0x45a8e4);}(_0xeff8,0x186));var _0x8eff=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xeff8[_0x33bc64];return _0x3fdd34;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x53ec=['path','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x53ec,0x192));var _0xc53e=function(_0x57fd0d,_0x2630ea){_0x57fd0d=_0x57fd0d-0x0;var _0x4b57f6=_0x53ec[_0x57fd0d];return _0x4b57f6;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('ServicenowAccount',attributes,{'tableName':_0xc53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b65e077..e72c8b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b4c=['then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','include','model','attributes','map','ShowServicenowAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x0b4c,0x1f2));var _0xc0b4=function(_0x4f703c,_0x4ffa6b){_0x4f703c=_0x4f703c-0x0;var _0x5b6963=_0x0b4c[_0x4f703c];return _0x5b6963;};'use strict';var _=require('lodash');var util=require(_0xc0b4('0x0'));var moment=require(_0xc0b4('0x1'));var BPromise=require(_0xc0b4('0x2'));var rs=require(_0xc0b4('0x3'));var fs=require('fs');var Redis=require(_0xc0b4('0x4'));var db=require(_0xc0b4('0x5'))['db'];var utils=require(_0xc0b4('0x6'));var logger=require(_0xc0b4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc0b4('0x8'));var client=jayson[_0xc0b4('0x9')][_0xc0b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41906c,_0x5f320e,_0x1650e8){return new BPromise(function(_0x44662f,_0xa0ce06){return client[_0xc0b4('0xb')](_0x41906c,_0x1650e8)[_0xc0b4('0xc')](function(_0x4c2ef8){logger[_0xc0b4('0xd')](_0xc0b4('0xe'),_0x5f320e,_0xc0b4('0xf'));logger[_0xc0b4('0x10')](_0xc0b4('0x11'),_0x5f320e,_0xc0b4('0xf'),JSON[_0xc0b4('0x12')](_0x4c2ef8));if(_0x4c2ef8['error']){if(_0x4c2ef8['error'][_0xc0b4('0x13')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5f320e,_0x4c2ef8[_0xc0b4('0x14')][_0xc0b4('0x15')]);return _0xa0ce06(_0x4c2ef8['error'][_0xc0b4('0x15')]);}logger[_0xc0b4('0x14')](_0xc0b4('0xe'),_0x5f320e,_0x4c2ef8['error']['message']);return _0x44662f(_0x4c2ef8[_0xc0b4('0x14')][_0xc0b4('0x15')]);}else{logger['info'](_0xc0b4('0xe'),_0x5f320e,_0xc0b4('0xf'));_0x44662f(_0x4c2ef8[_0xc0b4('0x16')]['message']);}})[_0xc0b4('0x17')](function(_0x4f315d){logger[_0xc0b4('0x14')](_0xc0b4('0xe'),_0x5f320e,_0x4f315d);_0xa0ce06(_0x4f315d);});});}exports[_0xc0b4('0x18')]=function(_0x1c09d4){var _0x342d78=this;return new Promise(function(_0xcd9621,_0x1a961f){return db[_0xc0b4('0x19')]['findAll']({'raw':_0x1c09d4['options']?_0x1c09d4[_0xc0b4('0x1a')][_0xc0b4('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c09d4['options']?_0x1c09d4[_0xc0b4('0x1a')][_0xc0b4('0x1c')]||null:null,'attributes':_0x1c09d4['options']?_0x1c09d4['options']['attributes']||null:null,'limit':_0x1c09d4['options']?_0x1c09d4[_0xc0b4('0x1a')]['limit']||null:null,'include':_0x1c09d4[_0xc0b4('0x1a')]?_0x1c09d4[_0xc0b4('0x1a')][_0xc0b4('0x1d')]?_['map'](_0x1c09d4[_0xc0b4('0x1a')]['include'],function(_0x31a7fc){return{'model':db[_0x31a7fc[_0xc0b4('0x1e')]],'as':_0x31a7fc['as'],'attributes':_0x31a7fc[_0xc0b4('0x1f')],'include':_0x31a7fc[_0xc0b4('0x1d')]?_[_0xc0b4('0x20')](_0x31a7fc[_0xc0b4('0x1d')],function(_0x2cb1ae){return{'model':db[_0x2cb1ae[_0xc0b4('0x1e')]],'as':_0x2cb1ae['as'],'attributes':_0x2cb1ae[_0xc0b4('0x1f')],'include':_0x2cb1ae[_0xc0b4('0x1d')]?_[_0xc0b4('0x20')](_0x2cb1ae[_0xc0b4('0x1d')],function(_0x59ab94){return{'model':db[_0x59ab94['model']],'as':_0x59ab94['as'],'attributes':_0x59ab94[_0xc0b4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b9682){logger['info']('GetServicenowAccount',_0x1c09d4);logger[_0xc0b4('0x10')]('GetServicenowAccount',_0x1c09d4,JSON['stringify'](_0x2b9682));_0xcd9621(_0x2b9682);})[_0xc0b4('0x17')](function(_0x328d29){logger[_0xc0b4('0x14')](_0xc0b4('0x18'),_0x328d29['message'],_0x1c09d4);_0x1a961f(_0x342d78[_0xc0b4('0x14')](0x1f4,_0x328d29[_0xc0b4('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x2f5069){var _0x5f1662=this;return new Promise(function(_0x43afcd,_0x24bdef){return db[_0xc0b4('0x19')]['find']({'raw':_0x2f5069['options']?_0x2f5069[_0xc0b4('0x1a')][_0xc0b4('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f5069[_0xc0b4('0x1a')]?_0x2f5069[_0xc0b4('0x1a')][_0xc0b4('0x1c')]||null:null,'attributes':_0x2f5069[_0xc0b4('0x1a')]?_0x2f5069[_0xc0b4('0x1a')][_0xc0b4('0x1f')]||null:null,'include':_0x2f5069[_0xc0b4('0x1a')]?_0x2f5069[_0xc0b4('0x1a')]['include']?_[_0xc0b4('0x20')](_0x2f5069[_0xc0b4('0x1a')][_0xc0b4('0x1d')],function(_0x115810){return{'model':db[_0x115810[_0xc0b4('0x1e')]],'as':_0x115810['as'],'attributes':_0x115810[_0xc0b4('0x1f')],'include':_0x115810[_0xc0b4('0x1d')]?_[_0xc0b4('0x20')](_0x115810[_0xc0b4('0x1d')],function(_0x395dc3){return{'model':db[_0x395dc3[_0xc0b4('0x1e')]],'as':_0x395dc3['as'],'attributes':_0x395dc3[_0xc0b4('0x1f')],'include':_0x395dc3['include']?_[_0xc0b4('0x20')](_0x395dc3[_0xc0b4('0x1d')],function(_0x31687d){return{'model':db[_0x31687d[_0xc0b4('0x1e')]],'as':_0x31687d['as'],'attributes':_0x31687d[_0xc0b4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc0b4('0xc')](function(_0x2ea510){logger[_0xc0b4('0xd')](_0xc0b4('0x21'),_0x2f5069);logger[_0xc0b4('0x10')]('ShowServicenowAccount',_0x2f5069,JSON['stringify'](_0x2ea510));_0x43afcd(_0x2ea510);})[_0xc0b4('0x17')](function(_0x28ceb7){logger[_0xc0b4('0x14')](_0xc0b4('0x21'),_0x28ceb7[_0xc0b4('0x15')],_0x2f5069);_0x24bdef(_0x5f1662['error'](0x1f4,_0x28ceb7[_0xc0b4('0x15')]));});});};
\ No newline at end of file
+var _0x4baa=['catch','ShowServicenowAccount','find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetServicenowAccount','ServicenowAccount','raw','options','where','attributes','limit','include','map','model','stringify'];(function(_0x1be9bf,_0x24e8d4){var _0xc71541=function(_0x35b045){while(--_0x35b045){_0x1be9bf['push'](_0x1be9bf['shift']());}};_0xc71541(++_0x24e8d4);}(_0x4baa,0x151));var _0xa4ba=function(_0x2b3bb9,_0x1556ce){_0x2b3bb9=_0x2b3bb9-0x0;var _0x5d3da5=_0x4baa[_0x2b3bb9];return _0x5d3da5;};'use strict';var _=require('lodash');var util=require(_0xa4ba('0x0'));var moment=require(_0xa4ba('0x1'));var BPromise=require(_0xa4ba('0x2'));var rs=require(_0xa4ba('0x3'));var fs=require('fs');var Redis=require(_0xa4ba('0x4'));var db=require(_0xa4ba('0x5'))['db'];var utils=require(_0xa4ba('0x6'));var logger=require(_0xa4ba('0x7'))(_0xa4ba('0x8'));var config=require(_0xa4ba('0x9'));var jayson=require(_0xa4ba('0xa'));var client=jayson['client'][_0xa4ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21986a,_0x4b768e,_0x47d3bf){return new BPromise(function(_0x9e6f8b,_0x42eda6){return client[_0xa4ba('0xc')](_0x21986a,_0x47d3bf)['then'](function(_0x4c0486){logger[_0xa4ba('0xd')](_0xa4ba('0xe'),_0x4b768e,_0xa4ba('0xf'));logger[_0xa4ba('0x10')](_0xa4ba('0x11'),_0x4b768e,_0xa4ba('0xf'),JSON['stringify'](_0x4c0486));if(_0x4c0486[_0xa4ba('0x12')]){if(_0x4c0486[_0xa4ba('0x12')][_0xa4ba('0x13')]===0x1f4){logger[_0xa4ba('0x12')](_0xa4ba('0xe'),_0x4b768e,_0x4c0486[_0xa4ba('0x12')]['message']);return _0x42eda6(_0x4c0486['error'][_0xa4ba('0x14')]);}logger[_0xa4ba('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x4b768e,_0x4c0486[_0xa4ba('0x12')][_0xa4ba('0x14')]);return _0x9e6f8b(_0x4c0486['error'][_0xa4ba('0x14')]);}else{logger[_0xa4ba('0xd')](_0xa4ba('0xe'),_0x4b768e,_0xa4ba('0xf'));_0x9e6f8b(_0x4c0486[_0xa4ba('0x15')]['message']);}})['catch'](function(_0x34d17d){logger[_0xa4ba('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x4b768e,_0x34d17d);_0x42eda6(_0x34d17d);});});}exports[_0xa4ba('0x16')]=function(_0x26d23a){var _0x20f168=this;return new Promise(function(_0x5dda10,_0x3fd0ee){return db[_0xa4ba('0x17')]['findAll']({'raw':_0x26d23a['options']?_0x26d23a['options'][_0xa4ba('0x18')]===undefined?!![]:![]:!![],'where':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a[_0xa4ba('0x19')][_0xa4ba('0x1a')]||null:null,'attributes':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a[_0xa4ba('0x19')][_0xa4ba('0x1b')]||null:null,'limit':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a['options'][_0xa4ba('0x1c')]||null:null,'include':_0x26d23a[_0xa4ba('0x19')]?_0x26d23a[_0xa4ba('0x19')][_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0x26d23a[_0xa4ba('0x19')]['include'],function(_0x562559){return{'model':db[_0x562559[_0xa4ba('0x1f')]],'as':_0x562559['as'],'attributes':_0x562559[_0xa4ba('0x1b')],'include':_0x562559[_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0x562559[_0xa4ba('0x1d')],function(_0xb7a16c){return{'model':db[_0xb7a16c[_0xa4ba('0x1f')]],'as':_0xb7a16c['as'],'attributes':_0xb7a16c[_0xa4ba('0x1b')],'include':_0xb7a16c[_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0xb7a16c[_0xa4ba('0x1d')],function(_0x449e43){return{'model':db[_0x449e43[_0xa4ba('0x1f')]],'as':_0x449e43['as'],'attributes':_0x449e43[_0xa4ba('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13e1e7){logger[_0xa4ba('0xd')](_0xa4ba('0x16'),_0x26d23a);logger[_0xa4ba('0x10')](_0xa4ba('0x16'),_0x26d23a,JSON[_0xa4ba('0x20')](_0x13e1e7));_0x5dda10(_0x13e1e7);})[_0xa4ba('0x21')](function(_0x5fec32){logger[_0xa4ba('0x12')](_0xa4ba('0x16'),_0x5fec32[_0xa4ba('0x14')],_0x26d23a);_0x3fd0ee(_0x20f168[_0xa4ba('0x12')](0x1f4,_0x5fec32['message']));});});};exports[_0xa4ba('0x22')]=function(_0x184cbf){var _0x490a28=this;return new Promise(function(_0x75787e,_0x4f1d42){return db[_0xa4ba('0x17')][_0xa4ba('0x23')]({'raw':_0x184cbf['options']?_0x184cbf['options']['raw']===undefined?!![]:![]:!![],'where':_0x184cbf[_0xa4ba('0x19')]?_0x184cbf['options']['where']||null:null,'attributes':_0x184cbf[_0xa4ba('0x19')]?_0x184cbf['options'][_0xa4ba('0x1b')]||null:null,'include':_0x184cbf[_0xa4ba('0x19')]?_0x184cbf[_0xa4ba('0x19')][_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0x184cbf[_0xa4ba('0x19')][_0xa4ba('0x1d')],function(_0xb56708){return{'model':db[_0xb56708[_0xa4ba('0x1f')]],'as':_0xb56708['as'],'attributes':_0xb56708[_0xa4ba('0x1b')],'include':_0xb56708[_0xa4ba('0x1d')]?_[_0xa4ba('0x1e')](_0xb56708[_0xa4ba('0x1d')],function(_0x301246){return{'model':db[_0x301246[_0xa4ba('0x1f')]],'as':_0x301246['as'],'attributes':_0x301246[_0xa4ba('0x1b')],'include':_0x301246[_0xa4ba('0x1d')]?_['map'](_0x301246[_0xa4ba('0x1d')],function(_0x57c4d2){return{'model':db[_0x57c4d2[_0xa4ba('0x1f')]],'as':_0x57c4d2['as'],'attributes':_0x57c4d2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4ba('0x24')](function(_0x3690e2){logger['info'](_0xa4ba('0x22'),_0x184cbf);logger[_0xa4ba('0x10')](_0xa4ba('0x22'),_0x184cbf,JSON[_0xa4ba('0x20')](_0x3690e2));_0x75787e(_0x3690e2);})[_0xa4ba('0x21')](function(_0x6d2a0e){logger[_0xa4ba('0x12')](_0xa4ba('0x22'),_0x6d2a0e['message'],_0x184cbf);_0x4f1d42(_0x490a28[_0xa4ba('0x12')](0x1f4,_0x6d2a0e['message']));});});};
\ No newline at end of file
index 133a355..77dcb70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bff=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x4121a3,_0x736927){var _0x836207=function(_0x363ff5){while(--_0x363ff5){_0x4121a3['push'](_0x4121a3['shift']());}};_0x836207(++_0x736927);}(_0x6bff,0x66));var _0xf6bf=function(_0x3b2491,_0x47e2c7){_0x3b2491=_0x3b2491-0x0;var _0x293ee5=_0x6bff[_0x3b2491];return _0x293ee5;};'use strict';var multer=require(_0xf6bf('0x0'));var util=require(_0xf6bf('0x1'));var path=require(_0xf6bf('0x2'));var timeout=require(_0xf6bf('0x3'));var express=require(_0xf6bf('0x4'));var router=express['Router']();var fs_extra=require(_0xf6bf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf6bf('0x6'));var controller=require(_0xf6bf('0x7'));router[_0xf6bf('0x8')]('/',auth['isAuthenticated'](),controller[_0xf6bf('0x9')]);router[_0xf6bf('0x8')](_0xf6bf('0xa'),auth['isAuthenticated'](),controller[_0xf6bf('0xb')]);router['get']('/:id/fields',auth[_0xf6bf('0xc')](),controller[_0xf6bf('0xd')]);router['get'](_0xf6bf('0xe'),auth[_0xf6bf('0xc')](),controller[_0xf6bf('0xf')]);router[_0xf6bf('0x8')](_0xf6bf('0x10'),auth[_0xf6bf('0xc')](),controller[_0xf6bf('0x11')]);router[_0xf6bf('0x12')]('/',auth[_0xf6bf('0xc')](),controller[_0xf6bf('0x13')]);router[_0xf6bf('0x14')](_0xf6bf('0xa'),auth[_0xf6bf('0xc')](),controller[_0xf6bf('0x15')]);router['delete'](_0xf6bf('0xa'),auth[_0xf6bf('0xc')](),controller[_0xf6bf('0x16')]);module[_0xf6bf('0x17')]=router;
\ No newline at end of file
+var _0x5615=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5615,0x1cf));var _0x5561=function(_0x1dc4e8,_0x12744c){_0x1dc4e8=_0x1dc4e8-0x0;var _0x566bf1=_0x5615[_0x1dc4e8];return _0x566bf1;};'use strict';var multer=require(_0x5561('0x0'));var util=require(_0x5561('0x1'));var path=require(_0x5561('0x2'));var timeout=require(_0x5561('0x3'));var express=require(_0x5561('0x4'));var router=express['Router']();var fs_extra=require(_0x5561('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5561('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x5561('0x7')]('/',auth[_0x5561('0x8')](),controller[_0x5561('0x9')]);router[_0x5561('0x7')]('/:id',auth[_0x5561('0x8')](),controller[_0x5561('0xa')]);router[_0x5561('0x7')]('/:id/fields',auth[_0x5561('0x8')](),controller[_0x5561('0xb')]);router[_0x5561('0x7')](_0x5561('0xc'),auth[_0x5561('0x8')](),controller[_0x5561('0xd')]);router[_0x5561('0x7')]('/:id/descriptions',auth[_0x5561('0x8')](),controller[_0x5561('0xe')]);router[_0x5561('0xf')]('/',auth[_0x5561('0x8')](),controller[_0x5561('0x10')]);router[_0x5561('0x11')](_0x5561('0x12'),auth['isAuthenticated'](),controller[_0x5561('0x13')]);router[_0x5561('0x14')](_0x5561('0x12'),auth[_0x5561('0x8')](),controller[_0x5561('0x15')]);module[_0x5561('0x16')]=router;
\ No newline at end of file
index a32bb96..95d7394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9030=['sequelize','exports','STRING'];(function(_0x4949e2,_0xcd3e8b){var _0x342723=function(_0x148981){while(--_0x148981){_0x4949e2['push'](_0x4949e2['shift']());}};_0x342723(++_0xcd3e8b);}(_0x9030,0xf0));var _0x0903=function(_0x5eb282,_0x12652a){_0x5eb282=_0x5eb282-0x0;var _0x4ba985=_0x9030[_0x5eb282];return _0x4ba985;};'use strict';var Sequelize=require(_0x0903('0x0'));module[_0x0903('0x1')]={'name':{'type':Sequelize[_0x0903('0x2')]},'description':{'type':Sequelize[_0x0903('0x2')]}};
\ No newline at end of file
+var _0xaae8=['exports','STRING','sequelize'];(function(_0x4ccf96,_0x34978e){var _0xd103b7=function(_0x55736b){while(--_0x55736b){_0x4ccf96['push'](_0x4ccf96['shift']());}};_0xd103b7(++_0x34978e);}(_0xaae8,0x80));var _0x8aae=function(_0x37bec9,_0x312463){_0x37bec9=_0x37bec9-0x0;var _0x3ac88d=_0xaae8[_0x37bec9];return _0x3ac88d;};'use strict';var Sequelize=require(_0x8aae('0x0'));module[_0x8aae('0x1')]={'name':{'type':Sequelize[_0x8aae('0x2')]},'description':{'type':Sequelize[_0x8aae('0x2')]}};
\ No newline at end of file
index 69bec33..c6da4f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e19=['map','keys','filters','intersection','attributes','fields','query','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','then','rows','rawAttributes','length','find','create','body','params','getFields','getSubjects','findOne','getDescriptions','ServicenowField','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','type','key'];(function(_0x3319b3,_0x4e6124){var _0x19ea31=function(_0x51222e){while(--_0x51222e){_0x3319b3['push'](_0x3319b3['shift']());}};_0x19ea31(++_0x4e6124);}(_0x9e19,0x1a2));var _0x99e1=function(_0x2de699,_0x29ccd8){_0x2de699=_0x2de699-0x0;var _0x1754b7=_0x9e19[_0x2de699];return _0x1754b7;};'use strict';var emlformat=require(_0x99e1('0x0'));var rimraf=require(_0x99e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99e1('0x2'));var rp=require('request-promise');var moment=require(_0x99e1('0x3'));var BPromise=require(_0x99e1('0x4'));var Mustache=require(_0x99e1('0x5'));var util=require(_0x99e1('0x6'));var path=require('path');var sox=require(_0x99e1('0x7'));var csv=require(_0x99e1('0x8'));var ejs=require(_0x99e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x99e1('0xa'));var squel=require(_0x99e1('0xb'));var crypto=require(_0x99e1('0xc'));var jsforce=require(_0x99e1('0xd'));var deskjs=require(_0x99e1('0xe'));var toCsv=require(_0x99e1('0x8'));var querystring=require(_0x99e1('0xf'));var Papa=require(_0x99e1('0x10'));var Redis=require(_0x99e1('0x11'));var authService=require(_0x99e1('0x12'));var qs=require(_0x99e1('0x13'));var as=require(_0x99e1('0x14'));var hardwareService=require(_0x99e1('0x15'));var logger=require(_0x99e1('0x16'))(_0x99e1('0x17'));var utils=require(_0x99e1('0x18'));var config=require(_0x99e1('0x19'));var licenseUtil=require(_0x99e1('0x1a'));var db=require(_0x99e1('0x1b'))['db'];var jayson=require(_0x99e1('0x1c'));var client=jayson[_0x99e1('0x1d')][_0x99e1('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xb7d48e,_0x29435f,_0x1d78ab,_0xd9404d){return new BPromise(function(_0x57622b,_0x2a9563){var _0x16b035=_0xd9404d||client;return _0x16b035[_0x99e1('0x1f')](_0xb7d48e,_0x1d78ab)['then'](function(_0x25faef){logger[_0x99e1('0x20')](_0x99e1('0x21'),_0x29435f,'request\x20sent');logger[_0x99e1('0x22')](_0x99e1('0x23'),_0x29435f,'request\x20sent',JSON[_0x99e1('0x24')](_0x25faef));if(_0x25faef[_0x99e1('0x25')]){if(_0x25faef[_0x99e1('0x25')][_0x99e1('0x26')]===0x1f4){logger[_0x99e1('0x25')](_0x99e1('0x21'),_0x29435f,_0x25faef[_0x99e1('0x25')][_0x99e1('0x27')]);return _0x2a9563(_0x25faef[_0x99e1('0x25')][_0x99e1('0x27')]);}logger[_0x99e1('0x25')]('ServicenowConfiguration,\x20%s,\x20%s',_0x29435f,_0x25faef[_0x99e1('0x25')][_0x99e1('0x27')]);return _0x57622b(_0x25faef[_0x99e1('0x25')][_0x99e1('0x27')]);}else{logger['info'](_0x99e1('0x21'),_0x29435f,_0x99e1('0x28'));_0x57622b(_0x25faef['result']['message']);}})[_0x99e1('0x29')](function(_0x35d3e1){logger[_0x99e1('0x25')]('ServicenowConfiguration,\x20%s,\x20%s',_0x29435f,_0x35d3e1);_0x2a9563(_0x35d3e1);});});}function respondWithStatusCode(_0x23605f,_0x54e61d){_0x54e61d=_0x54e61d||0xcc;return function(_0x1f3b42){if(_0x1f3b42){return _0x23605f[_0x99e1('0x2a')](_0x54e61d);}return _0x23605f[_0x99e1('0x2b')](_0x54e61d)[_0x99e1('0x2c')]();};}function respondWithResult(_0x45aa03,_0x20293c){_0x20293c=_0x20293c||0xc8;return function(_0x1778c3){if(_0x1778c3){return _0x45aa03[_0x99e1('0x2b')](_0x20293c)[_0x99e1('0x2d')](_0x1778c3);}};}function respondWithFilteredResult(_0x106de9,_0x355920){return function(_0x3550cb){if(_0x3550cb){var _0x2b4360=typeof _0x355920[_0x99e1('0x2e')]===_0x99e1('0x2f')&&typeof _0x355920[_0x99e1('0x30')]===_0x99e1('0x2f');var _0x1122f0=_0x3550cb[_0x99e1('0x31')];var _0x482630=_0x2b4360?0x0:_0x355920['offset'];var _0xda0310=_0x2b4360?_0x3550cb[_0x99e1('0x31')]:_0x355920['offset']+_0x355920[_0x99e1('0x30')];var _0x2b6534;if(_0xda0310>=_0x1122f0){_0xda0310=_0x1122f0;_0x2b6534=0xc8;}else{_0x2b6534=0xce;}_0x106de9[_0x99e1('0x2b')](_0x2b6534);return _0x106de9[_0x99e1('0x32')](_0x99e1('0x33'),_0x482630+'-'+_0xda0310+'/'+_0x1122f0)[_0x99e1('0x2d')](_0x3550cb);}return null;};}function patchUpdates(_0x3206b8){return function(_0x4d5ffb){try{jsonpatch[_0x99e1('0x34')](_0x4d5ffb,_0x3206b8,!![]);}catch(_0x3e6870){return BPromise[_0x99e1('0x35')](_0x3e6870);}return _0x4d5ffb[_0x99e1('0x36')]();};}function saveUpdates(_0x24b2b6,_0x8099fd){return function(_0x473295){if(_0x473295){return _0x473295[_0x99e1('0x37')](_0x24b2b6)['then'](function(_0x552bff){return _0x552bff;});}return null;};}function removeEntity(_0x23e502,_0x27cde1){return function(_0x1412c3){if(_0x1412c3){return _0x1412c3[_0x99e1('0x38')]()['then'](function(){_0x23e502[_0x99e1('0x2b')](0xcc)[_0x99e1('0x2c')]();});}};}function handleEntityNotFound(_0x12f610,_0x50a2a2){return function(_0x218a5c){if(!_0x218a5c){_0x12f610['sendStatus'](0x194);}return _0x218a5c;};}function handleError(_0xe0bee9,_0x220569){_0x220569=_0x220569||0x1f4;return function(_0x38f104){logger[_0x99e1('0x25')](_0x38f104[_0x99e1('0x39')]);if(_0x38f104[_0x99e1('0x3a')]){delete _0x38f104[_0x99e1('0x3a')];}_0xe0bee9[_0x99e1('0x2b')](_0x220569)[_0x99e1('0x3b')](_0x38f104);};}exports['index']=function(_0x2bcd23,_0x5ce63a){var _0x1b841e={},_0x443ec0={},_0x4f4607={'count':0x0,'rows':[]};var _0x4a58c5=_['map'](db['ServicenowConfiguration']['rawAttributes'],function(_0x4c4972){return{'name':_0x4c4972['fieldName'],'type':_0x4c4972[_0x99e1('0x3c')][_0x99e1('0x3d')]};});_0x443ec0['model']=_[_0x99e1('0x3e')](_0x4a58c5,_0x99e1('0x3a'));_0x443ec0['query']=_[_0x99e1('0x3f')](_0x2bcd23['query']);_0x443ec0[_0x99e1('0x40')]=_[_0x99e1('0x41')](_0x443ec0['model'],_0x443ec0['query']);_0x1b841e[_0x99e1('0x42')]=_[_0x99e1('0x41')](_0x443ec0['model'],qs[_0x99e1('0x43')](_0x2bcd23[_0x99e1('0x44')][_0x99e1('0x43')]));_0x1b841e['attributes']=_0x1b841e[_0x99e1('0x42')]['length']?_0x1b841e[_0x99e1('0x42')]:_0x443ec0[_0x99e1('0x45')];if(!_0x2bcd23[_0x99e1('0x44')][_0x99e1('0x46')](_0x99e1('0x47'))){_0x1b841e[_0x99e1('0x30')]=qs[_0x99e1('0x30')](_0x2bcd23['query'][_0x99e1('0x30')]);_0x1b841e[_0x99e1('0x2e')]=qs['offset'](_0x2bcd23['query'][_0x99e1('0x2e')]);}_0x1b841e[_0x99e1('0x48')]=qs[_0x99e1('0x49')](_0x2bcd23[_0x99e1('0x44')][_0x99e1('0x49')]);_0x1b841e[_0x99e1('0x4a')]=qs['filters'](_[_0x99e1('0x4b')](_0x2bcd23['query'],_0x443ec0[_0x99e1('0x40')]),_0x4a58c5);if(_0x2bcd23[_0x99e1('0x44')][_0x99e1('0x4c')]){_0x1b841e[_0x99e1('0x4a')]=_[_0x99e1('0x4d')](_0x1b841e['where'],{'$or':_[_0x99e1('0x3e')](_0x4a58c5,function(_0x434b15){if(_0x434b15[_0x99e1('0x3c')]!==_0x99e1('0x4e')){var _0x2c5151={};_0x2c5151[_0x434b15[_0x99e1('0x3a')]]={'$like':'%'+_0x2bcd23[_0x99e1('0x44')]['filter']+'%'};return _0x2c5151;}})});}_0x1b841e=_['merge']({},_0x1b841e,_0x2bcd23[_0x99e1('0x4f')]);var _0x3d8975={'where':_0x1b841e[_0x99e1('0x4a')]};return db[_0x99e1('0x50')][_0x99e1('0x31')](_0x3d8975)['then'](function(_0x39b6a9){_0x4f4607['count']=_0x39b6a9;if(_0x2bcd23[_0x99e1('0x44')][_0x99e1('0x51')]){_0x1b841e[_0x99e1('0x52')]=[{'all':!![]}];}return db[_0x99e1('0x50')]['findAll'](_0x1b841e);})[_0x99e1('0x53')](function(_0x3facba){_0x4f4607[_0x99e1('0x54')]=_0x3facba;return _0x4f4607;})['then'](respondWithFilteredResult(_0x5ce63a,_0x1b841e))[_0x99e1('0x29')](handleError(_0x5ce63a,null));};exports['show']=function(_0x1acbc7,_0x328320){var _0x3d7430={'raw':![],'where':{'id':_0x1acbc7['params']['id']}},_0x33009b={};_0x33009b[_0x99e1('0x45')]=_[_0x99e1('0x3f')](db[_0x99e1('0x50')][_0x99e1('0x55')]);_0x33009b['query']=_[_0x99e1('0x3f')](_0x1acbc7[_0x99e1('0x44')]);_0x33009b['filters']=_[_0x99e1('0x41')](_0x33009b[_0x99e1('0x45')],_0x33009b[_0x99e1('0x44')]);_0x3d7430[_0x99e1('0x42')]=_[_0x99e1('0x41')](_0x33009b['model'],qs['fields'](_0x1acbc7[_0x99e1('0x44')][_0x99e1('0x43')]));_0x3d7430['attributes']=_0x3d7430[_0x99e1('0x42')][_0x99e1('0x56')]?_0x3d7430['attributes']:_0x33009b[_0x99e1('0x45')];if(_0x1acbc7[_0x99e1('0x44')][_0x99e1('0x51')]){_0x3d7430['include']=[{'all':!![]}];}_0x3d7430=_[_0x99e1('0x4d')]({},_0x3d7430,_0x1acbc7[_0x99e1('0x4f')]);return db['ServicenowConfiguration'][_0x99e1('0x57')](_0x3d7430)[_0x99e1('0x53')](handleEntityNotFound(_0x328320,null))[_0x99e1('0x53')](respondWithResult(_0x328320,null))[_0x99e1('0x29')](handleError(_0x328320,null));};exports['create']=function(_0x24926f,_0x112157){return db['ServicenowConfiguration'][_0x99e1('0x58')](_0x24926f[_0x99e1('0x59')],{})[_0x99e1('0x53')](respondWithResult(_0x112157,0xc9))[_0x99e1('0x29')](handleError(_0x112157,null));};exports['update']=function(_0x5f0918,_0x58cc28){if(_0x5f0918[_0x99e1('0x59')]['id']){delete _0x5f0918['body']['id'];}return db[_0x99e1('0x50')][_0x99e1('0x57')]({'where':{'id':_0x5f0918['params']['id']}})[_0x99e1('0x53')](handleEntityNotFound(_0x58cc28,null))[_0x99e1('0x53')](saveUpdates(_0x5f0918[_0x99e1('0x59')],null))[_0x99e1('0x53')](respondWithResult(_0x58cc28,null))['catch'](handleError(_0x58cc28,null));};exports[_0x99e1('0x38')]=function(_0x1d7a99,_0x2da881){return db[_0x99e1('0x50')][_0x99e1('0x57')]({'where':{'id':_0x1d7a99[_0x99e1('0x5a')]['id']}})[_0x99e1('0x53')](handleEntityNotFound(_0x2da881,null))[_0x99e1('0x53')](removeEntity(_0x2da881,null))[_0x99e1('0x29')](handleError(_0x2da881,null));};exports[_0x99e1('0x5b')]=function(_0x80962f,_0x2873ef,_0x45c474){var _0x3bf0e3={};var _0x3e8258={};var _0x1f5a55;var _0x4b4144;return db[_0x99e1('0x50')]['findOne']({'where':{'id':_0x80962f[_0x99e1('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2873ef,null))['then'](function(_0x5ddc6e){if(_0x5ddc6e){_0x1f5a55=_0x5ddc6e;_0x3e8258['model']=_['keys'](db['ServicenowField']['rawAttributes']);_0x3e8258[_0x99e1('0x44')]=_[_0x99e1('0x3f')](_0x80962f['query']);_0x3e8258['filters']=_['intersection'](_0x3e8258['model'],_0x3e8258['query']);_0x3bf0e3['attributes']=_[_0x99e1('0x41')](_0x3e8258[_0x99e1('0x45')],qs[_0x99e1('0x43')](_0x80962f[_0x99e1('0x44')][_0x99e1('0x43')]));_0x3bf0e3[_0x99e1('0x42')]=_0x3bf0e3['attributes'][_0x99e1('0x56')]?_0x3bf0e3[_0x99e1('0x42')]:_0x3e8258[_0x99e1('0x45')];_0x3bf0e3[_0x99e1('0x48')]=qs[_0x99e1('0x49')](_0x80962f[_0x99e1('0x44')][_0x99e1('0x49')]);_0x3bf0e3['where']=qs[_0x99e1('0x40')](_[_0x99e1('0x4b')](_0x80962f[_0x99e1('0x44')],_0x3e8258['filters']));if(_0x80962f['query'][_0x99e1('0x4c')]){_0x3bf0e3[_0x99e1('0x4a')]=_[_0x99e1('0x4d')](_0x3bf0e3['where'],{'$or':_[_0x99e1('0x3e')](_0x3bf0e3[_0x99e1('0x42')],function(_0x2efb40){var _0x22a513={};_0x22a513[_0x2efb40]={'$like':'%'+_0x80962f[_0x99e1('0x44')][_0x99e1('0x4c')]+'%'};return _0x22a513;})});}_0x3bf0e3=_['merge']({},_0x3bf0e3,_0x80962f['options']);return _0x1f5a55[_0x99e1('0x5b')](_0x3bf0e3);}})[_0x99e1('0x53')](function(_0x2232c3){if(_0x2232c3){_0x4b4144=_0x2232c3['length'];if(!_0x80962f['query'][_0x99e1('0x46')](_0x99e1('0x47'))){_0x3bf0e3[_0x99e1('0x30')]=qs[_0x99e1('0x30')](_0x80962f[_0x99e1('0x44')][_0x99e1('0x30')]);_0x3bf0e3[_0x99e1('0x2e')]=qs[_0x99e1('0x2e')](_0x80962f[_0x99e1('0x44')]['offset']);}return _0x1f5a55[_0x99e1('0x5b')](_0x3bf0e3);}})['then'](function(_0x3df515){if(_0x3df515){return _0x3df515?{'count':_0x4b4144,'rows':_0x3df515}:null;}})['then'](respondWithResult(_0x2873ef,null))['catch'](handleError(_0x2873ef,null));};exports[_0x99e1('0x5c')]=function(_0x41f2c0,_0x11e0e7,_0x3dd6da){var _0x264cef={};var _0x2f9e82={};var _0x18e529;var _0x5f1a6c;return db['ServicenowConfiguration'][_0x99e1('0x5d')]({'where':{'id':_0x41f2c0['params']['id']}})['then'](handleEntityNotFound(_0x11e0e7,null))[_0x99e1('0x53')](function(_0x5f5097){if(_0x5f5097){_0x18e529=_0x5f5097;_0x2f9e82[_0x99e1('0x45')]=_[_0x99e1('0x3f')](db['ServicenowField'][_0x99e1('0x55')]);_0x2f9e82[_0x99e1('0x44')]=_['keys'](_0x41f2c0[_0x99e1('0x44')]);_0x2f9e82[_0x99e1('0x40')]=_[_0x99e1('0x41')](_0x2f9e82[_0x99e1('0x45')],_0x2f9e82['query']);_0x264cef[_0x99e1('0x42')]=_['intersection'](_0x2f9e82['model'],qs[_0x99e1('0x43')](_0x41f2c0[_0x99e1('0x44')][_0x99e1('0x43')]));_0x264cef[_0x99e1('0x42')]=_0x264cef[_0x99e1('0x42')]['length']?_0x264cef[_0x99e1('0x42')]:_0x2f9e82[_0x99e1('0x45')];_0x264cef[_0x99e1('0x48')]=qs[_0x99e1('0x49')](_0x41f2c0[_0x99e1('0x44')][_0x99e1('0x49')]);_0x264cef['where']=qs[_0x99e1('0x40')](_[_0x99e1('0x4b')](_0x41f2c0[_0x99e1('0x44')],_0x2f9e82[_0x99e1('0x40')]));if(_0x41f2c0['query']['filter']){_0x264cef[_0x99e1('0x4a')]=_[_0x99e1('0x4d')](_0x264cef[_0x99e1('0x4a')],{'$or':_[_0x99e1('0x3e')](_0x264cef[_0x99e1('0x42')],function(_0x9be4e){var _0x1d06e3={};_0x1d06e3[_0x9be4e]={'$like':'%'+_0x41f2c0[_0x99e1('0x44')][_0x99e1('0x4c')]+'%'};return _0x1d06e3;})});}_0x264cef=_[_0x99e1('0x4d')]({},_0x264cef,_0x41f2c0['options']);return _0x18e529[_0x99e1('0x5c')](_0x264cef);}})[_0x99e1('0x53')](function(_0x25c2d3){if(_0x25c2d3){_0x5f1a6c=_0x25c2d3[_0x99e1('0x56')];if(!_0x41f2c0['query']['hasOwnProperty'](_0x99e1('0x47'))){_0x264cef[_0x99e1('0x30')]=qs[_0x99e1('0x30')](_0x41f2c0['query']['limit']);_0x264cef[_0x99e1('0x2e')]=qs['offset'](_0x41f2c0[_0x99e1('0x44')][_0x99e1('0x2e')]);}return _0x18e529[_0x99e1('0x5c')](_0x264cef);}})[_0x99e1('0x53')](function(_0x21eed9){if(_0x21eed9){return _0x21eed9?{'count':_0x5f1a6c,'rows':_0x21eed9}:null;}})[_0x99e1('0x53')](respondWithResult(_0x11e0e7,null))[_0x99e1('0x29')](handleError(_0x11e0e7,null));};exports[_0x99e1('0x5e')]=function(_0x1ec270,_0x37dc23,_0x84617b){var _0xaea7ff={};var _0x32b0dd={};var _0xeea2b0;var _0x1f97f1;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x1ec270[_0x99e1('0x5a')]['id']}})[_0x99e1('0x53')](handleEntityNotFound(_0x37dc23,null))[_0x99e1('0x53')](function(_0x7a8de3){if(_0x7a8de3){_0xeea2b0=_0x7a8de3;_0x32b0dd[_0x99e1('0x45')]=_['keys'](db[_0x99e1('0x5f')][_0x99e1('0x55')]);_0x32b0dd[_0x99e1('0x44')]=_['keys'](_0x1ec270[_0x99e1('0x44')]);_0x32b0dd['filters']=_['intersection'](_0x32b0dd[_0x99e1('0x45')],_0x32b0dd[_0x99e1('0x44')]);_0xaea7ff[_0x99e1('0x42')]=_[_0x99e1('0x41')](_0x32b0dd['model'],qs[_0x99e1('0x43')](_0x1ec270['query'][_0x99e1('0x43')]));_0xaea7ff['attributes']=_0xaea7ff['attributes'][_0x99e1('0x56')]?_0xaea7ff['attributes']:_0x32b0dd['model'];_0xaea7ff[_0x99e1('0x48')]=qs[_0x99e1('0x49')](_0x1ec270[_0x99e1('0x44')]['sort']);_0xaea7ff['where']=qs[_0x99e1('0x40')](_[_0x99e1('0x4b')](_0x1ec270[_0x99e1('0x44')],_0x32b0dd[_0x99e1('0x40')]));if(_0x1ec270['query']['filter']){_0xaea7ff[_0x99e1('0x4a')]=_[_0x99e1('0x4d')](_0xaea7ff['where'],{'$or':_[_0x99e1('0x3e')](_0xaea7ff[_0x99e1('0x42')],function(_0x277c86){var _0xa6f465={};_0xa6f465[_0x277c86]={'$like':'%'+_0x1ec270['query'][_0x99e1('0x4c')]+'%'};return _0xa6f465;})});}_0xaea7ff=_['merge']({},_0xaea7ff,_0x1ec270['options']);return _0xeea2b0['getDescriptions'](_0xaea7ff);}})[_0x99e1('0x53')](function(_0x558a79){if(_0x558a79){_0x1f97f1=_0x558a79[_0x99e1('0x56')];if(!_0x1ec270['query']['hasOwnProperty'](_0x99e1('0x47'))){_0xaea7ff[_0x99e1('0x30')]=qs[_0x99e1('0x30')](_0x1ec270[_0x99e1('0x44')]['limit']);_0xaea7ff[_0x99e1('0x2e')]=qs[_0x99e1('0x2e')](_0x1ec270[_0x99e1('0x44')][_0x99e1('0x2e')]);}return _0xeea2b0[_0x99e1('0x5e')](_0xaea7ff);}})['then'](function(_0x2c0b80){if(_0x2c0b80){return _0x2c0b80?{'count':_0x1f97f1,'rows':_0x2c0b80}:null;}})[_0x99e1('0x53')](respondWithResult(_0x37dc23,null))[_0x99e1('0x29')](handleError(_0x37dc23,null));};
\ No newline at end of file
+var _0xbbfa=['model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','where','merge','filter','include','findAll','rows','catch','show','params','length','options','find','create','body','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type'];(function(_0xbcb6,_0x8e00a9){var _0x58899b=function(_0x35e0c4){while(--_0x35e0c4){_0xbcb6['push'](_0xbcb6['shift']());}};_0x58899b(++_0x8e00a9);}(_0xbbfa,0x133));var _0xabbf=function(_0x32917a,_0x3559ea){_0x32917a=_0x32917a-0x0;var _0x1881e1=_0xbbfa[_0x32917a];return _0x1881e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabbf('0x1'));var rp=require(_0xabbf('0x2'));var moment=require(_0xabbf('0x3'));var BPromise=require(_0xabbf('0x4'));var Mustache=require('mustache');var util=require(_0xabbf('0x5'));var path=require(_0xabbf('0x6'));var sox=require(_0xabbf('0x7'));var csv=require('to-csv');var ejs=require(_0xabbf('0x8'));var fs=require('fs');var fs_extra=require(_0xabbf('0x9'));var _=require(_0xabbf('0xa'));var squel=require(_0xabbf('0xb'));var crypto=require(_0xabbf('0xc'));var jsforce=require(_0xabbf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xabbf('0xe'));var querystring=require('querystring');var Papa=require(_0xabbf('0xf'));var Redis=require(_0xabbf('0x10'));var authService=require(_0xabbf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xabbf('0x12'));var hardwareService=require(_0xabbf('0x13'));var logger=require(_0xabbf('0x14'))('api');var utils=require(_0xabbf('0x15'));var config=require(_0xabbf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xabbf('0x17'))['db'];var jayson=require(_0xabbf('0x18'));var client=jayson[_0xabbf('0x19')][_0xabbf('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4e7089,_0x11b4bd,_0x14f54f,_0x5367a9){return new BPromise(function(_0x59cf47,_0x5290f0){var _0x1d0700=_0x5367a9||client;return _0x1d0700[_0xabbf('0x1b')](_0x4e7089,_0x14f54f)['then'](function(_0x17d3b2){logger[_0xabbf('0x1c')](_0xabbf('0x1d'),_0x11b4bd,_0xabbf('0x1e'));logger[_0xabbf('0x1f')](_0xabbf('0x20'),_0x11b4bd,'request\x20sent',JSON[_0xabbf('0x21')](_0x17d3b2));if(_0x17d3b2[_0xabbf('0x22')]){if(_0x17d3b2[_0xabbf('0x22')][_0xabbf('0x23')]===0x1f4){logger[_0xabbf('0x22')](_0xabbf('0x1d'),_0x11b4bd,_0x17d3b2[_0xabbf('0x22')][_0xabbf('0x24')]);return _0x5290f0(_0x17d3b2[_0xabbf('0x22')][_0xabbf('0x24')]);}logger[_0xabbf('0x22')]('ServicenowConfiguration,\x20%s,\x20%s',_0x11b4bd,_0x17d3b2[_0xabbf('0x22')]['message']);return _0x59cf47(_0x17d3b2[_0xabbf('0x22')]['message']);}else{logger[_0xabbf('0x1c')]('ServicenowConfiguration,\x20%s,\x20%s',_0x11b4bd,'request\x20sent');_0x59cf47(_0x17d3b2['result'][_0xabbf('0x24')]);}})['catch'](function(_0x34c336){logger['error'](_0xabbf('0x1d'),_0x11b4bd,_0x34c336);_0x5290f0(_0x34c336);});});}function respondWithStatusCode(_0x163cfb,_0x5d53cd){_0x5d53cd=_0x5d53cd||0xcc;return function(_0x1792be){if(_0x1792be){return _0x163cfb[_0xabbf('0x25')](_0x5d53cd);}return _0x163cfb[_0xabbf('0x26')](_0x5d53cd)['end']();};}function respondWithResult(_0xedd6d9,_0x34e43f){_0x34e43f=_0x34e43f||0xc8;return function(_0x23ac9e){if(_0x23ac9e){return _0xedd6d9[_0xabbf('0x26')](_0x34e43f)[_0xabbf('0x27')](_0x23ac9e);}};}function respondWithFilteredResult(_0x398cb3,_0xa968fc){return function(_0x242a94){if(_0x242a94){var _0x27bb06=typeof _0xa968fc[_0xabbf('0x28')]===_0xabbf('0x29')&&typeof _0xa968fc[_0xabbf('0x2a')]==='undefined';var _0x517b3a=_0x242a94[_0xabbf('0x2b')];var _0x3f446e=_0x27bb06?0x0:_0xa968fc[_0xabbf('0x28')];var _0x369f83=_0x27bb06?_0x242a94['count']:_0xa968fc[_0xabbf('0x28')]+_0xa968fc['limit'];var _0x55fe1a;if(_0x369f83>=_0x517b3a){_0x369f83=_0x517b3a;_0x55fe1a=0xc8;}else{_0x55fe1a=0xce;}_0x398cb3['status'](_0x55fe1a);return _0x398cb3[_0xabbf('0x2c')](_0xabbf('0x2d'),_0x3f446e+'-'+_0x369f83+'/'+_0x517b3a)[_0xabbf('0x27')](_0x242a94);}return null;};}function patchUpdates(_0x5499ea){return function(_0x4a6d06){try{jsonpatch[_0xabbf('0x2e')](_0x4a6d06,_0x5499ea,!![]);}catch(_0x4ff3ac){return BPromise[_0xabbf('0x2f')](_0x4ff3ac);}return _0x4a6d06['save']();};}function saveUpdates(_0x2ff01e,_0x54e250){return function(_0x4e8f59){if(_0x4e8f59){return _0x4e8f59[_0xabbf('0x30')](_0x2ff01e)[_0xabbf('0x31')](function(_0x35db0d){return _0x35db0d;});}return null;};}function removeEntity(_0x17a09c,_0x5a43c0){return function(_0x18f2c0){if(_0x18f2c0){return _0x18f2c0[_0xabbf('0x32')]()['then'](function(){_0x17a09c['status'](0xcc)[_0xabbf('0x33')]();});}};}function handleEntityNotFound(_0x39e47b,_0x74aa6f){return function(_0x2a0bbb){if(!_0x2a0bbb){_0x39e47b[_0xabbf('0x25')](0x194);}return _0x2a0bbb;};}function handleError(_0x30354e,_0x3174ea){_0x3174ea=_0x3174ea||0x1f4;return function(_0x6442e3){logger[_0xabbf('0x22')](_0x6442e3[_0xabbf('0x34')]);if(_0x6442e3[_0xabbf('0x35')]){delete _0x6442e3[_0xabbf('0x35')];}_0x30354e['status'](_0x3174ea)[_0xabbf('0x36')](_0x6442e3);};}exports[_0xabbf('0x37')]=function(_0xca8f72,_0x2b59e3){var _0x23fe97={},_0x364d32={},_0x1a663c={'count':0x0,'rows':[]};var _0x5ee186=_[_0xabbf('0x38')](db[_0xabbf('0x39')][_0xabbf('0x3a')],function(_0x3d6748){return{'name':_0x3d6748[_0xabbf('0x3b')],'type':_0x3d6748[_0xabbf('0x3c')]['key']};});_0x364d32[_0xabbf('0x3d')]=_['map'](_0x5ee186,'name');_0x364d32[_0xabbf('0x3e')]=_[_0xabbf('0x3f')](_0xca8f72[_0xabbf('0x3e')]);_0x364d32['filters']=_['intersection'](_0x364d32['model'],_0x364d32[_0xabbf('0x3e')]);_0x23fe97[_0xabbf('0x40')]=_[_0xabbf('0x41')](_0x364d32[_0xabbf('0x3d')],qs[_0xabbf('0x42')](_0xca8f72['query'][_0xabbf('0x42')]));_0x23fe97[_0xabbf('0x40')]=_0x23fe97[_0xabbf('0x40')]['length']?_0x23fe97[_0xabbf('0x40')]:_0x364d32[_0xabbf('0x3d')];if(!_0xca8f72['query'][_0xabbf('0x43')]('nolimit')){_0x23fe97[_0xabbf('0x2a')]=qs['limit'](_0xca8f72['query'][_0xabbf('0x2a')]);_0x23fe97['offset']=qs['offset'](_0xca8f72['query'][_0xabbf('0x28')]);}_0x23fe97[_0xabbf('0x44')]=qs['sort'](_0xca8f72[_0xabbf('0x3e')][_0xabbf('0x45')]);_0x23fe97['where']=qs[_0xabbf('0x46')](_[_0xabbf('0x47')](_0xca8f72[_0xabbf('0x3e')],_0x364d32[_0xabbf('0x46')]),_0x5ee186);if(_0xca8f72[_0xabbf('0x3e')]['filter']){_0x23fe97[_0xabbf('0x48')]=_[_0xabbf('0x49')](_0x23fe97[_0xabbf('0x48')],{'$or':_[_0xabbf('0x38')](_0x5ee186,function(_0x51893f){if(_0x51893f[_0xabbf('0x3c')]!=='VIRTUAL'){var _0x2db236={};_0x2db236[_0x51893f[_0xabbf('0x35')]]={'$like':'%'+_0xca8f72[_0xabbf('0x3e')][_0xabbf('0x4a')]+'%'};return _0x2db236;}})});}_0x23fe97=_['merge']({},_0x23fe97,_0xca8f72['options']);var _0x599d39={'where':_0x23fe97[_0xabbf('0x48')]};return db[_0xabbf('0x39')][_0xabbf('0x2b')](_0x599d39)['then'](function(_0x49d810){_0x1a663c[_0xabbf('0x2b')]=_0x49d810;if(_0xca8f72[_0xabbf('0x3e')]['includeAll']){_0x23fe97[_0xabbf('0x4b')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xabbf('0x4c')](_0x23fe97);})[_0xabbf('0x31')](function(_0x513725){_0x1a663c[_0xabbf('0x4d')]=_0x513725;return _0x1a663c;})[_0xabbf('0x31')](respondWithFilteredResult(_0x2b59e3,_0x23fe97))[_0xabbf('0x4e')](handleError(_0x2b59e3,null));};exports[_0xabbf('0x4f')]=function(_0x2a8a1a,_0x2fa4ed){var _0x3d546a={'raw':![],'where':{'id':_0x2a8a1a[_0xabbf('0x50')]['id']}},_0x210bbe={};_0x210bbe[_0xabbf('0x3d')]=_['keys'](db['ServicenowConfiguration'][_0xabbf('0x3a')]);_0x210bbe[_0xabbf('0x3e')]=_['keys'](_0x2a8a1a['query']);_0x210bbe[_0xabbf('0x46')]=_[_0xabbf('0x41')](_0x210bbe[_0xabbf('0x3d')],_0x210bbe[_0xabbf('0x3e')]);_0x3d546a[_0xabbf('0x40')]=_[_0xabbf('0x41')](_0x210bbe['model'],qs['fields'](_0x2a8a1a[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x3d546a[_0xabbf('0x40')]=_0x3d546a[_0xabbf('0x40')][_0xabbf('0x51')]?_0x3d546a[_0xabbf('0x40')]:_0x210bbe['model'];if(_0x2a8a1a[_0xabbf('0x3e')]['includeAll']){_0x3d546a[_0xabbf('0x4b')]=[{'all':!![]}];}_0x3d546a=_[_0xabbf('0x49')]({},_0x3d546a,_0x2a8a1a[_0xabbf('0x52')]);return db[_0xabbf('0x39')][_0xabbf('0x53')](_0x3d546a)[_0xabbf('0x31')](handleEntityNotFound(_0x2fa4ed,null))['then'](respondWithResult(_0x2fa4ed,null))[_0xabbf('0x4e')](handleError(_0x2fa4ed,null));};exports[_0xabbf('0x54')]=function(_0x5b9af3,_0x389cf9){return db[_0xabbf('0x39')][_0xabbf('0x54')](_0x5b9af3[_0xabbf('0x55')],{})[_0xabbf('0x31')](respondWithResult(_0x389cf9,0xc9))[_0xabbf('0x4e')](handleError(_0x389cf9,null));};exports['update']=function(_0x51eb63,_0x2513a4){if(_0x51eb63[_0xabbf('0x55')]['id']){delete _0x51eb63[_0xabbf('0x55')]['id'];}return db['ServicenowConfiguration'][_0xabbf('0x53')]({'where':{'id':_0x51eb63['params']['id']}})[_0xabbf('0x31')](handleEntityNotFound(_0x2513a4,null))[_0xabbf('0x31')](saveUpdates(_0x51eb63[_0xabbf('0x55')],null))['then'](respondWithResult(_0x2513a4,null))[_0xabbf('0x4e')](handleError(_0x2513a4,null));};exports[_0xabbf('0x32')]=function(_0x150d67,_0x33de93){return db[_0xabbf('0x39')][_0xabbf('0x53')]({'where':{'id':_0x150d67[_0xabbf('0x50')]['id']}})[_0xabbf('0x31')](handleEntityNotFound(_0x33de93,null))['then'](removeEntity(_0x33de93,null))[_0xabbf('0x4e')](handleError(_0x33de93,null));};exports[_0xabbf('0x56')]=function(_0x3ff762,_0xae482,_0x334c89){var _0x31e78c={};var _0x393d09={};var _0x1a5a08;var _0x55b5e1;return db['ServicenowConfiguration'][_0xabbf('0x57')]({'where':{'id':_0x3ff762[_0xabbf('0x50')]['id']}})['then'](handleEntityNotFound(_0xae482,null))[_0xabbf('0x31')](function(_0x16be8){if(_0x16be8){_0x1a5a08=_0x16be8;_0x393d09[_0xabbf('0x3d')]=_[_0xabbf('0x3f')](db[_0xabbf('0x58')]['rawAttributes']);_0x393d09[_0xabbf('0x3e')]=_[_0xabbf('0x3f')](_0x3ff762[_0xabbf('0x3e')]);_0x393d09[_0xabbf('0x46')]=_[_0xabbf('0x41')](_0x393d09[_0xabbf('0x3d')],_0x393d09[_0xabbf('0x3e')]);_0x31e78c['attributes']=_['intersection'](_0x393d09[_0xabbf('0x3d')],qs[_0xabbf('0x42')](_0x3ff762[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x31e78c[_0xabbf('0x40')]=_0x31e78c[_0xabbf('0x40')][_0xabbf('0x51')]?_0x31e78c[_0xabbf('0x40')]:_0x393d09[_0xabbf('0x3d')];_0x31e78c[_0xabbf('0x44')]=qs['sort'](_0x3ff762['query'][_0xabbf('0x45')]);_0x31e78c[_0xabbf('0x48')]=qs[_0xabbf('0x46')](_[_0xabbf('0x47')](_0x3ff762[_0xabbf('0x3e')],_0x393d09[_0xabbf('0x46')]));if(_0x3ff762[_0xabbf('0x3e')]['filter']){_0x31e78c['where']=_[_0xabbf('0x49')](_0x31e78c['where'],{'$or':_[_0xabbf('0x38')](_0x31e78c[_0xabbf('0x40')],function(_0x5c3124){var _0x316386={};_0x316386[_0x5c3124]={'$like':'%'+_0x3ff762['query'][_0xabbf('0x4a')]+'%'};return _0x316386;})});}_0x31e78c=_[_0xabbf('0x49')]({},_0x31e78c,_0x3ff762[_0xabbf('0x52')]);return _0x1a5a08[_0xabbf('0x56')](_0x31e78c);}})[_0xabbf('0x31')](function(_0x5749b9){if(_0x5749b9){_0x55b5e1=_0x5749b9[_0xabbf('0x51')];if(!_0x3ff762[_0xabbf('0x3e')]['hasOwnProperty'](_0xabbf('0x59'))){_0x31e78c[_0xabbf('0x2a')]=qs['limit'](_0x3ff762[_0xabbf('0x3e')][_0xabbf('0x2a')]);_0x31e78c[_0xabbf('0x28')]=qs[_0xabbf('0x28')](_0x3ff762['query']['offset']);}return _0x1a5a08[_0xabbf('0x56')](_0x31e78c);}})[_0xabbf('0x31')](function(_0x229f80){if(_0x229f80){return _0x229f80?{'count':_0x55b5e1,'rows':_0x229f80}:null;}})['then'](respondWithResult(_0xae482,null))[_0xabbf('0x4e')](handleError(_0xae482,null));};exports[_0xabbf('0x5a')]=function(_0x16b00c,_0x23535a,_0x20383e){var _0x222a66={};var _0x340eca={};var _0x1e8b70;var _0x568ff3;return db[_0xabbf('0x39')][_0xabbf('0x57')]({'where':{'id':_0x16b00c['params']['id']}})['then'](handleEntityNotFound(_0x23535a,null))[_0xabbf('0x31')](function(_0x41f9fa){if(_0x41f9fa){_0x1e8b70=_0x41f9fa;_0x340eca[_0xabbf('0x3d')]=_[_0xabbf('0x3f')](db[_0xabbf('0x58')][_0xabbf('0x3a')]);_0x340eca[_0xabbf('0x3e')]=_['keys'](_0x16b00c[_0xabbf('0x3e')]);_0x340eca['filters']=_[_0xabbf('0x41')](_0x340eca[_0xabbf('0x3d')],_0x340eca[_0xabbf('0x3e')]);_0x222a66[_0xabbf('0x40')]=_['intersection'](_0x340eca['model'],qs[_0xabbf('0x42')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x222a66[_0xabbf('0x40')]=_0x222a66[_0xabbf('0x40')][_0xabbf('0x51')]?_0x222a66[_0xabbf('0x40')]:_0x340eca['model'];_0x222a66[_0xabbf('0x44')]=qs[_0xabbf('0x45')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x45')]);_0x222a66[_0xabbf('0x48')]=qs[_0xabbf('0x46')](_[_0xabbf('0x47')](_0x16b00c['query'],_0x340eca[_0xabbf('0x46')]));if(_0x16b00c['query']['filter']){_0x222a66[_0xabbf('0x48')]=_[_0xabbf('0x49')](_0x222a66['where'],{'$or':_['map'](_0x222a66[_0xabbf('0x40')],function(_0x2fd0fd){var _0x18667d={};_0x18667d[_0x2fd0fd]={'$like':'%'+_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x4a')]+'%'};return _0x18667d;})});}_0x222a66=_[_0xabbf('0x49')]({},_0x222a66,_0x16b00c['options']);return _0x1e8b70[_0xabbf('0x5a')](_0x222a66);}})[_0xabbf('0x31')](function(_0x88f0e5){if(_0x88f0e5){_0x568ff3=_0x88f0e5[_0xabbf('0x51')];if(!_0x16b00c['query'][_0xabbf('0x43')](_0xabbf('0x59'))){_0x222a66[_0xabbf('0x2a')]=qs[_0xabbf('0x2a')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x2a')]);_0x222a66[_0xabbf('0x28')]=qs[_0xabbf('0x28')](_0x16b00c[_0xabbf('0x3e')][_0xabbf('0x28')]);}return _0x1e8b70['getSubjects'](_0x222a66);}})[_0xabbf('0x31')](function(_0x4dac27){if(_0x4dac27){return _0x4dac27?{'count':_0x568ff3,'rows':_0x4dac27}:null;}})[_0xabbf('0x31')](respondWithResult(_0x23535a,null))[_0xabbf('0x4e')](handleError(_0x23535a,null));};exports[_0xabbf('0x5b')]=function(_0x1fbab1,_0x502208,_0x2a1792){var _0x56fa90={};var _0x394708={};var _0x15d05b;var _0x25947b;return db[_0xabbf('0x39')][_0xabbf('0x57')]({'where':{'id':_0x1fbab1[_0xabbf('0x50')]['id']}})[_0xabbf('0x31')](handleEntityNotFound(_0x502208,null))[_0xabbf('0x31')](function(_0x39705f){if(_0x39705f){_0x15d05b=_0x39705f;_0x394708[_0xabbf('0x3d')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x394708[_0xabbf('0x3e')]=_[_0xabbf('0x3f')](_0x1fbab1['query']);_0x394708[_0xabbf('0x46')]=_[_0xabbf('0x41')](_0x394708[_0xabbf('0x3d')],_0x394708['query']);_0x56fa90[_0xabbf('0x40')]=_[_0xabbf('0x41')](_0x394708['model'],qs['fields'](_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x42')]));_0x56fa90[_0xabbf('0x40')]=_0x56fa90[_0xabbf('0x40')][_0xabbf('0x51')]?_0x56fa90[_0xabbf('0x40')]:_0x394708[_0xabbf('0x3d')];_0x56fa90[_0xabbf('0x44')]=qs[_0xabbf('0x45')](_0x1fbab1[_0xabbf('0x3e')]['sort']);_0x56fa90[_0xabbf('0x48')]=qs['filters'](_[_0xabbf('0x47')](_0x1fbab1[_0xabbf('0x3e')],_0x394708[_0xabbf('0x46')]));if(_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x4a')]){_0x56fa90[_0xabbf('0x48')]=_['merge'](_0x56fa90['where'],{'$or':_[_0xabbf('0x38')](_0x56fa90[_0xabbf('0x40')],function(_0x4f0a11){var _0x68b4aa={};_0x68b4aa[_0x4f0a11]={'$like':'%'+_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x4a')]+'%'};return _0x68b4aa;})});}_0x56fa90=_[_0xabbf('0x49')]({},_0x56fa90,_0x1fbab1[_0xabbf('0x52')]);return _0x15d05b[_0xabbf('0x5b')](_0x56fa90);}})['then'](function(_0x48b934){if(_0x48b934){_0x25947b=_0x48b934[_0xabbf('0x51')];if(!_0x1fbab1[_0xabbf('0x3e')]['hasOwnProperty'](_0xabbf('0x59'))){_0x56fa90[_0xabbf('0x2a')]=qs[_0xabbf('0x2a')](_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x2a')]);_0x56fa90[_0xabbf('0x28')]=qs[_0xabbf('0x28')](_0x1fbab1[_0xabbf('0x3e')][_0xabbf('0x28')]);}return _0x15d05b['getDescriptions'](_0x56fa90);}})[_0xabbf('0x31')](function(_0x38f06b){if(_0x38f06b){return _0x38f06b?{'count':_0x25947b,'rows':_0x38f06b}:null;}})['then'](respondWithResult(_0x502208,null))[_0xabbf('0x4e')](handleError(_0x502208,null));};
\ No newline at end of file
index cac04c2..82319c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde1e=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports'];(function(_0x267dfa,_0x299108){var _0x11d589=function(_0x554ce9){while(--_0x554ce9){_0x267dfa['push'](_0x267dfa['shift']());}};_0x11d589(++_0x299108);}(_0xde1e,0x9d));var _0xede1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xde1e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xede1('0x0'));var util=require(_0xede1('0x1'));var logger=require(_0xede1('0x2'))(_0xede1('0x3'));var moment=require(_0xede1('0x4'));var BPromise=require(_0xede1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xede1('0x6'));var rimraf=require(_0xede1('0x7'));var config=require(_0xede1('0x8'));var attributes=require(_0xede1('0x9'));module[_0xede1('0xa')]=function(_0x3b760f,_0x4e9527){return _0x3b760f[_0xede1('0xb')](_0xede1('0xc'),attributes,{'tableName':_0xede1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fb3=['api','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','util','../../config/logger'];(function(_0x41c4a0,_0x4e61a7){var _0x4d9326=function(_0x4dd574){while(--_0x4dd574){_0x41c4a0['push'](_0x41c4a0['shift']());}};_0x4d9326(++_0x4e61a7);}(_0x7fb3,0xf9));var _0x37fb=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x7fb3[_0x4ed32d];return _0xf624df;};'use strict';var _=require(_0x37fb('0x0'));var util=require(_0x37fb('0x1'));var logger=require(_0x37fb('0x2'))(_0x37fb('0x3'));var moment=require('moment');var BPromise=require(_0x37fb('0x4'));var rp=require(_0x37fb('0x5'));var fs=require('fs');var path=require(_0x37fb('0x6'));var rimraf=require(_0x37fb('0x7'));var config=require('../../config/environment');var attributes=require(_0x37fb('0x8'));module[_0x37fb('0x9')]=function(_0x2443bd,_0x23a839){return _0x2443bd[_0x37fb('0xa')](_0x37fb('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 258343c..5ce9591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb681=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0xcad0c8,_0x304a8a){var _0x4e6e9b=function(_0x186f4f){while(--_0x186f4f){_0xcad0c8['push'](_0xcad0c8['shift']());}};_0x4e6e9b(++_0x304a8a);}(_0xb681,0x153));var _0x1b68=function(_0x2c59fc,_0x4769d9){_0x2c59fc=_0x2c59fc-0x0;var _0x36bf45=_0xb681[_0x2c59fc];return _0x36bf45;};'use strict';var _=require(_0x1b68('0x0'));var util=require(_0x1b68('0x1'));var moment=require(_0x1b68('0x2'));var BPromise=require(_0x1b68('0x3'));var rs=require(_0x1b68('0x4'));var fs=require('fs');var Redis=require(_0x1b68('0x5'));var db=require(_0x1b68('0x6'))['db'];var utils=require(_0x1b68('0x7'));var logger=require(_0x1b68('0x8'))(_0x1b68('0x9'));var config=require('../../config/environment');var jayson=require(_0x1b68('0xa'));var client=jayson['client'][_0x1b68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x103d40,_0x1166ab,_0x536e88){return new BPromise(function(_0x5b3ebb,_0x54c76f){return client['request'](_0x103d40,_0x536e88)['then'](function(_0x1f0f1b){logger[_0x1b68('0xc')](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));logger[_0x1b68('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x1166ab,_0x1b68('0xe'),JSON['stringify'](_0x1f0f1b));if(_0x1f0f1b[_0x1b68('0x10')]){if(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x11')]===0x1f4){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x54c76f(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);return _0x5b3ebb(_0x1f0f1b[_0x1b68('0x10')][_0x1b68('0x12')]);}else{logger['info'](_0x1b68('0xd'),_0x1166ab,_0x1b68('0xe'));_0x5b3ebb(_0x1f0f1b[_0x1b68('0x13')][_0x1b68('0x12')]);}})[_0x1b68('0x14')](function(_0x2255cf){logger[_0x1b68('0x10')](_0x1b68('0xd'),_0x1166ab,_0x2255cf);_0x54c76f(_0x2255cf);});});}
\ No newline at end of file
+var _0xbc89=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1dd6a1,_0x532dd0){var _0x301dca=function(_0x1dc56f){while(--_0x1dc56f){_0x1dd6a1['push'](_0x1dd6a1['shift']());}};_0x301dca(++_0x532dd0);}(_0xbc89,0x9c));var _0x9bc8=function(_0x2d5934,_0x1acc4f){_0x2d5934=_0x2d5934-0x0;var _0x5807c8=_0xbc89[_0x2d5934];return _0x5807c8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9bc8('0x0'));var rs=require(_0x9bc8('0x1'));var fs=require('fs');var Redis=require(_0x9bc8('0x2'));var db=require(_0x9bc8('0x3'))['db'];var utils=require(_0x9bc8('0x4'));var logger=require(_0x9bc8('0x5'))(_0x9bc8('0x6'));var config=require(_0x9bc8('0x7'));var jayson=require(_0x9bc8('0x8'));var client=jayson[_0x9bc8('0x9')][_0x9bc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x417bb1,_0x5f16c8,_0x5eb132){return new BPromise(function(_0x486e97,_0x578b31){return client[_0x9bc8('0xb')](_0x417bb1,_0x5eb132)[_0x9bc8('0xc')](function(_0x212f43){logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,_0x9bc8('0xf'));logger[_0x9bc8('0x10')](_0x9bc8('0x11'),_0x5f16c8,_0x9bc8('0xf'),JSON[_0x9bc8('0x12')](_0x212f43));if(_0x212f43[_0x9bc8('0x13')]){if(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x14')]===0x1f4){logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')]['message']);return _0x578b31(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);return _0x486e97(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}else{logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,'request\x20sent');_0x486e97(_0x212f43[_0x9bc8('0x16')][_0x9bc8('0x15')]);}})[_0x9bc8('0x17')](function(_0x16d830){logger[_0x9bc8('0x13')](_0x9bc8('0xe'),_0x5f16c8,_0x16d830);_0x578b31(_0x16d830);});});}
\ No newline at end of file
index 283a874..0bd1e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e78=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2fb732,_0x46e1b6){var _0x4daba3=function(_0x13ab37){while(--_0x13ab37){_0x2fb732['push'](_0x2fb732['shift']());}};_0x4daba3(++_0x46e1b6);}(_0x9e78,0x172));var _0x89e7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9e78[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0x89e7('0x0'));var util=require(_0x89e7('0x1'));var path=require(_0x89e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x89e7('0x3'));var router=express[_0x89e7('0x4')]();var fs_extra=require(_0x89e7('0x5'));var auth=require(_0x89e7('0x6'));var interaction=require(_0x89e7('0x7'));var config=require(_0x89e7('0x8'));var controller=require('./intServicenowField.controller');router[_0x89e7('0x9')]('/',auth[_0x89e7('0xa')](),controller[_0x89e7('0xb')]);router[_0x89e7('0x9')](_0x89e7('0xc'),auth[_0x89e7('0xa')](),controller[_0x89e7('0xd')]);router[_0x89e7('0xe')]('/',auth[_0x89e7('0xa')](),controller[_0x89e7('0xf')]);router['put'](_0x89e7('0xc'),auth['isAuthenticated'](),controller[_0x89e7('0x10')]);router[_0x89e7('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x89e7('0x12')]);module[_0x89e7('0x13')]=router;
\ No newline at end of file
+var _0x4c46=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x38ea20,_0x5f3c35){var _0x273671=function(_0x3cb6f6){while(--_0x3cb6f6){_0x38ea20['push'](_0x38ea20['shift']());}};_0x273671(++_0x5f3c35);}(_0x4c46,0x1e2));var _0x64c4=function(_0x575d43,_0x5b74ce){_0x575d43=_0x575d43-0x0;var _0x5d0e4a=_0x4c46[_0x575d43];return _0x5d0e4a;};'use strict';var multer=require('multer');var util=require(_0x64c4('0x0'));var path=require(_0x64c4('0x1'));var timeout=require(_0x64c4('0x2'));var express=require(_0x64c4('0x3'));var router=express[_0x64c4('0x4')]();var fs_extra=require(_0x64c4('0x5'));var auth=require(_0x64c4('0x6'));var interaction=require(_0x64c4('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x64c4('0x8')](),controller[_0x64c4('0x9')]);router[_0x64c4('0xa')](_0x64c4('0xb'),auth[_0x64c4('0x8')](),controller[_0x64c4('0xc')]);router[_0x64c4('0xd')]('/',auth[_0x64c4('0x8')](),controller[_0x64c4('0xe')]);router[_0x64c4('0xf')](_0x64c4('0xb'),auth[_0x64c4('0x8')](),controller[_0x64c4('0x10')]);router[_0x64c4('0x11')](_0x64c4('0xb'),auth['isAuthenticated'](),controller[_0x64c4('0x12')]);module[_0x64c4('0x13')]=router;
\ No newline at end of file
index 39e5418..84c83a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a31=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x492471,_0x45c3a6){var _0x211a59=function(_0x9ba0c){while(--_0x9ba0c){_0x492471['push'](_0x492471['shift']());}};_0x211a59(++_0x45c3a6);}(_0x0a31,0x1eb));var _0x10a3=function(_0x4145d0,_0x789ba8){_0x4145d0=_0x4145d0-0x0;var _0xb40199=_0x0a31[_0x4145d0];return _0xb40199;};'use strict';var Sequelize=require(_0x10a3('0x0'));module['exports']={'type':{'type':Sequelize[_0x10a3('0x1')](_0x10a3('0x2'),_0x10a3('0x3'),_0x10a3('0x4'),_0x10a3('0x5'),_0x10a3('0x6')),'defaultValue':_0x10a3('0x2')},'content':{'type':Sequelize[_0x10a3('0x7')]},'key':{'type':Sequelize[_0x10a3('0x7')]},'keyType':{'type':Sequelize[_0x10a3('0x1')]('string',_0x10a3('0x3'),_0x10a3('0x4'))},'keyContent':{'type':Sequelize[_0x10a3('0x7')]},'idField':{'type':Sequelize[_0x10a3('0x7')]},'nameField':{'type':Sequelize[_0x10a3('0x7')]},'customField':{'type':Sequelize[_0x10a3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x10a3('0x7')]}};
\ No newline at end of file
+var _0x3f63=['STRING','ENUM','string','variable','customVariable','picklist'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3f63,0x73));var _0x33f6=function(_0x55a0ca,_0x4e62a4){_0x55a0ca=_0x55a0ca-0x0;var _0x1d726e=_0x3f63[_0x55a0ca];return _0x1d726e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x33f6('0x0')](_0x33f6('0x1'),_0x33f6('0x2'),_0x33f6('0x3'),'keyValue',_0x33f6('0x4')),'defaultValue':_0x33f6('0x1')},'content':{'type':Sequelize[_0x33f6('0x5')]},'key':{'type':Sequelize[_0x33f6('0x5')]},'keyType':{'type':Sequelize[_0x33f6('0x0')](_0x33f6('0x1'),_0x33f6('0x2'),_0x33f6('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x33f6('0x5')]},'nameField':{'type':Sequelize[_0x33f6('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x33f6('0x5')]}};
\ No newline at end of file
index 12e16c3..2f15cbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf03a=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','fieldName','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ServicenowField','includeAll','rows','catch','show','params','rawAttributes','intersection','include','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf03a,0x7a));var _0xaf03=function(_0x5cf294,_0x39baaa){_0x5cf294=_0x5cf294-0x0;var _0x4d83f6=_0xf03a[_0x5cf294];return _0x4d83f6;};'use strict';var emlformat=require(_0xaf03('0x0'));var rimraf=require(_0xaf03('0x1'));var zipdir=require(_0xaf03('0x2'));var jsonpatch=require(_0xaf03('0x3'));var rp=require('request-promise');var moment=require(_0xaf03('0x4'));var BPromise=require(_0xaf03('0x5'));var Mustache=require(_0xaf03('0x6'));var util=require(_0xaf03('0x7'));var path=require(_0xaf03('0x8'));var sox=require('sox');var csv=require(_0xaf03('0x9'));var ejs=require(_0xaf03('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf03('0xb'));var squel=require(_0xaf03('0xc'));var crypto=require(_0xaf03('0xd'));var jsforce=require(_0xaf03('0xe'));var deskjs=require(_0xaf03('0xf'));var toCsv=require(_0xaf03('0x9'));var querystring=require(_0xaf03('0x10'));var Papa=require(_0xaf03('0x11'));var Redis=require(_0xaf03('0x12'));var authService=require(_0xaf03('0x13'));var qs=require(_0xaf03('0x14'));var as=require(_0xaf03('0x15'));var hardwareService=require(_0xaf03('0x16'));var logger=require(_0xaf03('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf03('0x18'))['db'];function respondWithStatusCode(_0x31dc32,_0x238097){_0x238097=_0x238097||0xcc;return function(_0x1b75dd){if(_0x1b75dd){return _0x31dc32['sendStatus'](_0x238097);}return _0x31dc32[_0xaf03('0x19')](_0x238097)[_0xaf03('0x1a')]();};}function respondWithResult(_0x3bd70f,_0xa4d3d5){_0xa4d3d5=_0xa4d3d5||0xc8;return function(_0x52b7b5){if(_0x52b7b5){return _0x3bd70f[_0xaf03('0x19')](_0xa4d3d5)[_0xaf03('0x1b')](_0x52b7b5);}};}function respondWithFilteredResult(_0x549374,_0x435301){return function(_0x53603){if(_0x53603){var _0x2a783c=typeof _0x435301[_0xaf03('0x1c')]===_0xaf03('0x1d')&&typeof _0x435301[_0xaf03('0x1e')]===_0xaf03('0x1d');var _0x573126=_0x53603[_0xaf03('0x1f')];var _0x67927=_0x2a783c?0x0:_0x435301[_0xaf03('0x1c')];var _0x560b16=_0x2a783c?_0x53603['count']:_0x435301[_0xaf03('0x1c')]+_0x435301[_0xaf03('0x1e')];var _0x5730d1;if(_0x560b16>=_0x573126){_0x560b16=_0x573126;_0x5730d1=0xc8;}else{_0x5730d1=0xce;}_0x549374[_0xaf03('0x19')](_0x5730d1);return _0x549374[_0xaf03('0x20')](_0xaf03('0x21'),_0x67927+'-'+_0x560b16+'/'+_0x573126)['json'](_0x53603);}return null;};}function patchUpdates(_0x295487){return function(_0x5d1104){try{jsonpatch[_0xaf03('0x22')](_0x5d1104,_0x295487,!![]);}catch(_0x5e9108){return BPromise[_0xaf03('0x23')](_0x5e9108);}return _0x5d1104[_0xaf03('0x24')]();};}function saveUpdates(_0x42aa43,_0x2517cf){return function(_0x4078f8){if(_0x4078f8){return _0x4078f8['update'](_0x42aa43)[_0xaf03('0x25')](function(_0x3e573d){return _0x3e573d;});}return null;};}function removeEntity(_0x1f4faa,_0x271bff){return function(_0x2e8d8c){if(_0x2e8d8c){return _0x2e8d8c[_0xaf03('0x26')]()[_0xaf03('0x25')](function(){_0x1f4faa['status'](0xcc)[_0xaf03('0x1a')]();});}};}function handleEntityNotFound(_0x480006,_0x4ac6bc){return function(_0x430f3e){if(!_0x430f3e){_0x480006['sendStatus'](0x194);}return _0x430f3e;};}function handleError(_0x4694ca,_0x310385){_0x310385=_0x310385||0x1f4;return function(_0x4de4e6){logger[_0xaf03('0x27')](_0x4de4e6['stack']);if(_0x4de4e6[_0xaf03('0x28')]){delete _0x4de4e6[_0xaf03('0x28')];}_0x4694ca[_0xaf03('0x19')](_0x310385)[_0xaf03('0x29')](_0x4de4e6);};}exports['index']=function(_0x2d5d2c,_0x48dd61){var _0x9b336c={},_0x3e689f={},_0x739ab1={'count':0x0,'rows':[]};var _0x1c1e11=_[_0xaf03('0x2a')](db['ServicenowField']['rawAttributes'],function(_0x50e9cd){return{'name':_0x50e9cd[_0xaf03('0x2b')],'type':_0x50e9cd['type'][_0xaf03('0x2c')]};});_0x3e689f[_0xaf03('0x2d')]=_[_0xaf03('0x2a')](_0x1c1e11,_0xaf03('0x28'));_0x3e689f[_0xaf03('0x2e')]=_[_0xaf03('0x2f')](_0x2d5d2c[_0xaf03('0x2e')]);_0x3e689f[_0xaf03('0x30')]=_['intersection'](_0x3e689f['model'],_0x3e689f[_0xaf03('0x2e')]);_0x9b336c['attributes']=_['intersection'](_0x3e689f[_0xaf03('0x2d')],qs[_0xaf03('0x31')](_0x2d5d2c[_0xaf03('0x2e')]['fields']));_0x9b336c[_0xaf03('0x32')]=_0x9b336c[_0xaf03('0x32')][_0xaf03('0x33')]?_0x9b336c[_0xaf03('0x32')]:_0x3e689f[_0xaf03('0x2d')];if(!_0x2d5d2c[_0xaf03('0x2e')][_0xaf03('0x34')]('nolimit')){_0x9b336c[_0xaf03('0x1e')]=qs[_0xaf03('0x1e')](_0x2d5d2c['query'][_0xaf03('0x1e')]);_0x9b336c[_0xaf03('0x1c')]=qs['offset'](_0x2d5d2c[_0xaf03('0x2e')]['offset']);}_0x9b336c[_0xaf03('0x35')]=qs[_0xaf03('0x36')](_0x2d5d2c['query'][_0xaf03('0x36')]);_0x9b336c[_0xaf03('0x37')]=qs[_0xaf03('0x30')](_[_0xaf03('0x38')](_0x2d5d2c[_0xaf03('0x2e')],_0x3e689f[_0xaf03('0x30')]),_0x1c1e11);if(_0x2d5d2c['query'][_0xaf03('0x39')]){_0x9b336c['where']=_[_0xaf03('0x3a')](_0x9b336c[_0xaf03('0x37')],{'$or':_[_0xaf03('0x2a')](_0x1c1e11,function(_0x1ce140){if(_0x1ce140[_0xaf03('0x3b')]!==_0xaf03('0x3c')){var _0x5d1a6d={};_0x5d1a6d[_0x1ce140['name']]={'$like':'%'+_0x2d5d2c[_0xaf03('0x2e')]['filter']+'%'};return _0x5d1a6d;}})});}_0x9b336c=_[_0xaf03('0x3a')]({},_0x9b336c,_0x2d5d2c[_0xaf03('0x3d')]);var _0x1a42b9={'where':_0x9b336c['where']};return db[_0xaf03('0x3e')]['count'](_0x1a42b9)['then'](function(_0x3d68ba){_0x739ab1[_0xaf03('0x1f')]=_0x3d68ba;if(_0x2d5d2c['query'][_0xaf03('0x3f')]){_0x9b336c['include']=[{'all':!![]}];}return db[_0xaf03('0x3e')]['findAll'](_0x9b336c);})[_0xaf03('0x25')](function(_0x21b977){_0x739ab1[_0xaf03('0x40')]=_0x21b977;return _0x739ab1;})[_0xaf03('0x25')](respondWithFilteredResult(_0x48dd61,_0x9b336c))[_0xaf03('0x41')](handleError(_0x48dd61,null));};exports[_0xaf03('0x42')]=function(_0x1976e9,_0x264f7c){var _0x41242b={'raw':!![],'where':{'id':_0x1976e9[_0xaf03('0x43')]['id']}},_0x17acd9={};_0x17acd9['model']=_[_0xaf03('0x2f')](db['ServicenowField'][_0xaf03('0x44')]);_0x17acd9[_0xaf03('0x2e')]=_[_0xaf03('0x2f')](_0x1976e9[_0xaf03('0x2e')]);_0x17acd9[_0xaf03('0x30')]=_[_0xaf03('0x45')](_0x17acd9[_0xaf03('0x2d')],_0x17acd9[_0xaf03('0x2e')]);_0x41242b['attributes']=_['intersection'](_0x17acd9[_0xaf03('0x2d')],qs[_0xaf03('0x31')](_0x1976e9[_0xaf03('0x2e')][_0xaf03('0x31')]));_0x41242b[_0xaf03('0x32')]=_0x41242b[_0xaf03('0x32')][_0xaf03('0x33')]?_0x41242b[_0xaf03('0x32')]:_0x17acd9['model'];if(_0x1976e9[_0xaf03('0x2e')][_0xaf03('0x3f')]){_0x41242b[_0xaf03('0x46')]=[{'all':!![]}];}_0x41242b=_[_0xaf03('0x3a')]({},_0x41242b,_0x1976e9[_0xaf03('0x3d')]);return db[_0xaf03('0x3e')]['find'](_0x41242b)[_0xaf03('0x25')](handleEntityNotFound(_0x264f7c,null))[_0xaf03('0x25')](respondWithResult(_0x264f7c,null))[_0xaf03('0x41')](handleError(_0x264f7c,null));};exports[_0xaf03('0x47')]=function(_0x31a559,_0x30de07){return db['ServicenowField'][_0xaf03('0x47')](_0x31a559[_0xaf03('0x48')],{})[_0xaf03('0x25')](respondWithResult(_0x30de07,0xc9))[_0xaf03('0x41')](handleError(_0x30de07,null));};exports[_0xaf03('0x49')]=function(_0x12b41d,_0x255c0b){if(_0x12b41d[_0xaf03('0x48')]['id']){delete _0x12b41d[_0xaf03('0x48')]['id'];}return db[_0xaf03('0x3e')][_0xaf03('0x4a')]({'where':{'id':_0x12b41d[_0xaf03('0x43')]['id']}})['then'](handleEntityNotFound(_0x255c0b,null))[_0xaf03('0x25')](saveUpdates(_0x12b41d['body'],null))[_0xaf03('0x25')](respondWithResult(_0x255c0b,null))[_0xaf03('0x41')](handleError(_0x255c0b,null));};exports[_0xaf03('0x26')]=function(_0x93c1a7,_0x1db4c7){return db[_0xaf03('0x3e')][_0xaf03('0x4a')]({'where':{'id':_0x93c1a7['params']['id']}})[_0xaf03('0x25')](handleEntityNotFound(_0x1db4c7,null))['then'](removeEntity(_0x1db4c7,null))['catch'](handleError(_0x1db4c7,null));};
\ No newline at end of file
+var _0xb647=['where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter'];(function(_0x40a07f,_0x35d50e){var _0x4b8246=function(_0x3ffb30){while(--_0x3ffb30){_0x40a07f['push'](_0x40a07f['shift']());}};_0x4b8246(++_0x35d50e);}(_0xb647,0x181));var _0x7b64=function(_0x406733,_0x58036c){_0x406733=_0x406733-0x0;var _0x4e4994=_0xb647[_0x406733];return _0x4e4994;};'use strict';var emlformat=require(_0x7b64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b64('0x1'));var jsonpatch=require(_0x7b64('0x2'));var rp=require(_0x7b64('0x3'));var moment=require(_0x7b64('0x4'));var BPromise=require(_0x7b64('0x5'));var Mustache=require('mustache');var util=require(_0x7b64('0x6'));var path=require(_0x7b64('0x7'));var sox=require(_0x7b64('0x8'));var csv=require(_0x7b64('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b64('0xa'));var _=require(_0x7b64('0xb'));var squel=require(_0x7b64('0xc'));var crypto=require(_0x7b64('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7b64('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b64('0xf'));var Papa=require(_0x7b64('0x10'));var Redis=require(_0x7b64('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7b64('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b64('0x13'))('api');var utils=require(_0x7b64('0x14'));var config=require(_0x7b64('0x15'));var licenseUtil=require(_0x7b64('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f16b8,_0xb00b43){_0xb00b43=_0xb00b43||0xcc;return function(_0x164133){if(_0x164133){return _0x4f16b8['sendStatus'](_0xb00b43);}return _0x4f16b8[_0x7b64('0x17')](_0xb00b43)[_0x7b64('0x18')]();};}function respondWithResult(_0x1f13bb,_0x5476f5){_0x5476f5=_0x5476f5||0xc8;return function(_0x3c3f71){if(_0x3c3f71){return _0x1f13bb[_0x7b64('0x17')](_0x5476f5)[_0x7b64('0x19')](_0x3c3f71);}};}function respondWithFilteredResult(_0x4cd3b8,_0x2a2c1b){return function(_0x1fa737){if(_0x1fa737){var _0x18d691=typeof _0x2a2c1b[_0x7b64('0x1a')]===_0x7b64('0x1b')&&typeof _0x2a2c1b[_0x7b64('0x1c')]===_0x7b64('0x1b');var _0x407560=_0x1fa737['count'];var _0x29f0ce=_0x18d691?0x0:_0x2a2c1b[_0x7b64('0x1a')];var _0x100ca7=_0x18d691?_0x1fa737[_0x7b64('0x1d')]:_0x2a2c1b['offset']+_0x2a2c1b[_0x7b64('0x1c')];var _0x18db0e;if(_0x100ca7>=_0x407560){_0x100ca7=_0x407560;_0x18db0e=0xc8;}else{_0x18db0e=0xce;}_0x4cd3b8[_0x7b64('0x17')](_0x18db0e);return _0x4cd3b8[_0x7b64('0x1e')](_0x7b64('0x1f'),_0x29f0ce+'-'+_0x100ca7+'/'+_0x407560)[_0x7b64('0x19')](_0x1fa737);}return null;};}function patchUpdates(_0x4a73e3){return function(_0x205316){try{jsonpatch[_0x7b64('0x20')](_0x205316,_0x4a73e3,!![]);}catch(_0x557da4){return BPromise[_0x7b64('0x21')](_0x557da4);}return _0x205316[_0x7b64('0x22')]();};}function saveUpdates(_0x367d23,_0x2543a6){return function(_0x4d294d){if(_0x4d294d){return _0x4d294d[_0x7b64('0x23')](_0x367d23)[_0x7b64('0x24')](function(_0x45acb1){return _0x45acb1;});}return null;};}function removeEntity(_0x5b2239,_0x5db75b){return function(_0xfd19f0){if(_0xfd19f0){return _0xfd19f0[_0x7b64('0x25')]()['then'](function(){_0x5b2239[_0x7b64('0x17')](0xcc)[_0x7b64('0x18')]();});}};}function handleEntityNotFound(_0x30c83f,_0x2d5bb5){return function(_0x373411){if(!_0x373411){_0x30c83f[_0x7b64('0x26')](0x194);}return _0x373411;};}function handleError(_0x432b7d,_0x11b47a){_0x11b47a=_0x11b47a||0x1f4;return function(_0x319840){logger['error'](_0x319840[_0x7b64('0x27')]);if(_0x319840['name']){delete _0x319840[_0x7b64('0x28')];}_0x432b7d[_0x7b64('0x17')](_0x11b47a)[_0x7b64('0x29')](_0x319840);};}exports[_0x7b64('0x2a')]=function(_0x4c6fa1,_0x587ab3){var _0x5c1cb1={},_0x5ba8d7={},_0x5b966f={'count':0x0,'rows':[]};var _0x4cf119=_[_0x7b64('0x2b')](db[_0x7b64('0x2c')][_0x7b64('0x2d')],function(_0x3a29cb){return{'name':_0x3a29cb['fieldName'],'type':_0x3a29cb[_0x7b64('0x2e')][_0x7b64('0x2f')]};});_0x5ba8d7[_0x7b64('0x30')]=_[_0x7b64('0x2b')](_0x4cf119,_0x7b64('0x28'));_0x5ba8d7[_0x7b64('0x31')]=_['keys'](_0x4c6fa1['query']);_0x5ba8d7[_0x7b64('0x32')]=_[_0x7b64('0x33')](_0x5ba8d7[_0x7b64('0x30')],_0x5ba8d7[_0x7b64('0x31')]);_0x5c1cb1[_0x7b64('0x34')]=_[_0x7b64('0x33')](_0x5ba8d7[_0x7b64('0x30')],qs[_0x7b64('0x35')](_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x35')]));_0x5c1cb1[_0x7b64('0x34')]=_0x5c1cb1[_0x7b64('0x34')]['length']?_0x5c1cb1['attributes']:_0x5ba8d7[_0x7b64('0x30')];if(!_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x36')](_0x7b64('0x37'))){_0x5c1cb1['limit']=qs[_0x7b64('0x1c')](_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x1c')]);_0x5c1cb1[_0x7b64('0x1a')]=qs['offset'](_0x4c6fa1['query'][_0x7b64('0x1a')]);}_0x5c1cb1[_0x7b64('0x38')]=qs['sort'](_0x4c6fa1[_0x7b64('0x31')]['sort']);_0x5c1cb1['where']=qs[_0x7b64('0x32')](_[_0x7b64('0x39')](_0x4c6fa1['query'],_0x5ba8d7[_0x7b64('0x32')]),_0x4cf119);if(_0x4c6fa1['query'][_0x7b64('0x3a')]){_0x5c1cb1[_0x7b64('0x3b')]=_['merge'](_0x5c1cb1[_0x7b64('0x3b')],{'$or':_[_0x7b64('0x2b')](_0x4cf119,function(_0x21b28d){if(_0x21b28d[_0x7b64('0x2e')]!==_0x7b64('0x3c')){var _0x258956={};_0x258956[_0x21b28d[_0x7b64('0x28')]]={'$like':'%'+_0x4c6fa1[_0x7b64('0x31')][_0x7b64('0x3a')]+'%'};return _0x258956;}})});}_0x5c1cb1=_[_0x7b64('0x3d')]({},_0x5c1cb1,_0x4c6fa1[_0x7b64('0x3e')]);var _0x4fdf17={'where':_0x5c1cb1[_0x7b64('0x3b')]};return db[_0x7b64('0x2c')]['count'](_0x4fdf17)[_0x7b64('0x24')](function(_0x57238f){_0x5b966f[_0x7b64('0x1d')]=_0x57238f;if(_0x4c6fa1['query'][_0x7b64('0x3f')]){_0x5c1cb1[_0x7b64('0x40')]=[{'all':!![]}];}return db[_0x7b64('0x2c')][_0x7b64('0x41')](_0x5c1cb1);})[_0x7b64('0x24')](function(_0x5cb85f){_0x5b966f[_0x7b64('0x42')]=_0x5cb85f;return _0x5b966f;})[_0x7b64('0x24')](respondWithFilteredResult(_0x587ab3,_0x5c1cb1))[_0x7b64('0x43')](handleError(_0x587ab3,null));};exports['show']=function(_0x3b1ed1,_0x5e9446){var _0x1c58cb={'raw':!![],'where':{'id':_0x3b1ed1[_0x7b64('0x44')]['id']}},_0x306872={};_0x306872[_0x7b64('0x30')]=_['keys'](db[_0x7b64('0x2c')][_0x7b64('0x2d')]);_0x306872[_0x7b64('0x31')]=_[_0x7b64('0x45')](_0x3b1ed1[_0x7b64('0x31')]);_0x306872['filters']=_[_0x7b64('0x33')](_0x306872[_0x7b64('0x30')],_0x306872[_0x7b64('0x31')]);_0x1c58cb['attributes']=_[_0x7b64('0x33')](_0x306872[_0x7b64('0x30')],qs[_0x7b64('0x35')](_0x3b1ed1[_0x7b64('0x31')]['fields']));_0x1c58cb['attributes']=_0x1c58cb['attributes'][_0x7b64('0x46')]?_0x1c58cb[_0x7b64('0x34')]:_0x306872[_0x7b64('0x30')];if(_0x3b1ed1['query'][_0x7b64('0x3f')]){_0x1c58cb[_0x7b64('0x40')]=[{'all':!![]}];}_0x1c58cb=_['merge']({},_0x1c58cb,_0x3b1ed1['options']);return db['ServicenowField'][_0x7b64('0x47')](_0x1c58cb)[_0x7b64('0x24')](handleEntityNotFound(_0x5e9446,null))[_0x7b64('0x24')](respondWithResult(_0x5e9446,null))[_0x7b64('0x43')](handleError(_0x5e9446,null));};exports['create']=function(_0x56b0d8,_0xe67049){return db['ServicenowField'][_0x7b64('0x48')](_0x56b0d8[_0x7b64('0x49')],{})['then'](respondWithResult(_0xe67049,0xc9))[_0x7b64('0x43')](handleError(_0xe67049,null));};exports[_0x7b64('0x23')]=function(_0x18d415,_0x39414a){if(_0x18d415[_0x7b64('0x49')]['id']){delete _0x18d415[_0x7b64('0x49')]['id'];}return db[_0x7b64('0x2c')]['find']({'where':{'id':_0x18d415[_0x7b64('0x44')]['id']}})[_0x7b64('0x24')](handleEntityNotFound(_0x39414a,null))[_0x7b64('0x24')](saveUpdates(_0x18d415[_0x7b64('0x49')],null))['then'](respondWithResult(_0x39414a,null))[_0x7b64('0x43')](handleError(_0x39414a,null));};exports[_0x7b64('0x25')]=function(_0x1c6de8,_0x2a7856){return db['ServicenowField'][_0x7b64('0x47')]({'where':{'id':_0x1c6de8['params']['id']}})[_0x7b64('0x24')](handleEntityNotFound(_0x2a7856,null))[_0x7b64('0x24')](removeEntity(_0x2a7856,null))['catch'](handleError(_0x2a7856,null));};
\ No newline at end of file
index 4d559c5..2d0131c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31be=['ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x31be,0x90));var _0xe31b=function(_0x4d5523,_0x193a4e){_0x4d5523=_0x4d5523-0x0;var _0x2fc865=_0x31be[_0x4d5523];return _0x2fc865;};'use strict';var _=require(_0xe31b('0x0'));var util=require(_0xe31b('0x1'));var logger=require('../../config/logger')(_0xe31b('0x2'));var moment=require(_0xe31b('0x3'));var BPromise=require('bluebird');var rp=require(_0xe31b('0x4'));var fs=require('fs');var path=require(_0xe31b('0x5'));var rimraf=require(_0xe31b('0x6'));var config=require(_0xe31b('0x7'));var attributes=require(_0xe31b('0x8'));module['exports']=function(_0x92a517,_0x4c8b38){return _0x92a517[_0xe31b('0x9')](_0xe31b('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xe31b('0xb'),'fields':[_0xe31b('0xc'),_0xe31b('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9202=['request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','idField','FieldId','lodash','util','moment','bluebird'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x9202,0x1c3));var _0x2920=function(_0x185ba0,_0x2dad2b){_0x185ba0=_0x185ba0-0x0;var _0x595a59=_0x9202[_0x185ba0];return _0x595a59;};'use strict';var _=require(_0x2920('0x0'));var util=require(_0x2920('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2920('0x2'));var BPromise=require(_0x2920('0x3'));var rp=require(_0x2920('0x4'));var fs=require('fs');var path=require(_0x2920('0x5'));var rimraf=require(_0x2920('0x6'));var config=require(_0x2920('0x7'));var attributes=require(_0x2920('0x8'));module[_0x2920('0x9')]=function(_0x52ae35,_0x4efe4c){return _0x52ae35[_0x2920('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x2920('0xb'),_0x2920('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 43dbe67..a816f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac4a,0x13f));var _0xaac4=function(_0x40feb9,_0x14d8a8){_0x40feb9=_0x40feb9-0x0;var _0x276bcb=_0xac4a[_0x40feb9];return _0x276bcb;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xac4a,0x13f));var _0xaac4=function(_0x551add,_0x417d26){_0x551add=_0x551add-0x0;var _0x143014=_0xac4a[_0x551add];return _0x143014;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
index d2aa8cc..9f08200 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x14422c,_0x5342ea){var _0x3187d0=function(_0x25b02c){while(--_0x25b02c){_0x14422c['push'](_0x14422c['shift']());}};_0x3187d0(++_0x5342ea);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x112168,_0x105574){var _0x1a72e7=function(_0x56bfb1){while(--_0x56bfb1){_0x112168['push'](_0x112168['shift']());}};_0x1a72e7(++_0x105574);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 a883992..3d827bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5c9d09,_0xf5c0e3){var _0x19fad1=function(_0x41de0a){while(--_0x41de0a){_0x5c9d09['push'](_0x5c9d09['shift']());}};_0x19fad1(++_0xf5c0e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x2ae3c6,_0x4fdd28){var _0x4af38f=function(_0x58512f){while(--_0x58512f){_0x2ae3c6['push'](_0x2ae3c6['shift']());}};_0x4af38f(++_0x4fdd28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 8173ed8..98019f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa368=['fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','rawAttributes','keys','options','create','body','destroy','find','getConfigurations','findOne','length','AccountId','getSubjects','channel','SugarcrmConfiguration','Subjects','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','duration_hours','parent_id','parent_type','parent_name','username','password','remoteUri','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','Calls','values','module_fields','includes','label','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','filters','attributes','intersection'];(function(_0x5b1956,_0x49603f){var _0xacd2b0=function(_0x3a2660){while(--_0x3a2660){_0x5b1956['push'](_0x5b1956['shift']());}};_0xacd2b0(++_0x49603f);}(_0xa368,0x1be));var _0x8a36=function(_0x6041e3,_0xbd3370){_0x6041e3=_0x6041e3-0x0;var _0x3ab7cf=_0xa368[_0x6041e3];return _0x3ab7cf;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8a36('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a36('0x1'));var moment=require(_0x8a36('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8a36('0x3'));var util=require(_0x8a36('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x8a36('0x5'));var ejs=require(_0x8a36('0x6'));var fs=require('fs');var fs_extra=require(_0x8a36('0x7'));var _=require(_0x8a36('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a36('0x9'));var deskjs=require(_0x8a36('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8a36('0xb'));var Papa=require(_0x8a36('0xc'));var Redis=require(_0x8a36('0xd'));var authService=require(_0x8a36('0xe'));var qs=require(_0x8a36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a36('0x10'));var logger=require(_0x8a36('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x8a36('0x12'));var licenseUtil=require(_0x8a36('0x13'));var db=require(_0x8a36('0x14'))['db'];var integrations=require(_0x8a36('0x15'));var jayson=require(_0x8a36('0x16'));var client=jayson[_0x8a36('0x17')][_0x8a36('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1a64bb,_0x2dbc76,_0x37a3ea,_0x38c59b){return new BPromise(function(_0x2417b6,_0x29daad){var _0x8135ff=_0x38c59b||client;return _0x8135ff[_0x8a36('0x19')](_0x1a64bb,_0x37a3ea)[_0x8a36('0x1a')](function(_0x97324b){logger[_0x8a36('0x1b')]('SugarcrmAccount,\x20%s,\x20%s',_0x2dbc76,_0x8a36('0x1c'));logger[_0x8a36('0x1d')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x2dbc76,_0x8a36('0x1c'),JSON['stringify'](_0x97324b));if(_0x97324b[_0x8a36('0x1e')]){if(_0x97324b[_0x8a36('0x1e')]['code']===0x1f4){logger[_0x8a36('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x2dbc76,_0x97324b[_0x8a36('0x1e')][_0x8a36('0x1f')]);return _0x29daad(_0x97324b['error'][_0x8a36('0x1f')]);}logger[_0x8a36('0x1e')](_0x8a36('0x20'),_0x2dbc76,_0x97324b[_0x8a36('0x1e')][_0x8a36('0x1f')]);return _0x2417b6(_0x97324b['error'][_0x8a36('0x1f')]);}else{logger[_0x8a36('0x1b')](_0x8a36('0x20'),_0x2dbc76,_0x8a36('0x1c'));_0x2417b6(_0x97324b[_0x8a36('0x21')]['message']);}})[_0x8a36('0x22')](function(_0x1e8743){logger[_0x8a36('0x1e')](_0x8a36('0x20'),_0x2dbc76,_0x1e8743);_0x29daad(_0x1e8743);});});}function respondWithStatusCode(_0x4b2d1f,_0x1afd42){_0x1afd42=_0x1afd42||0xcc;return function(_0x4609d4){if(_0x4609d4){return _0x4b2d1f[_0x8a36('0x23')](_0x1afd42);}return _0x4b2d1f[_0x8a36('0x24')](_0x1afd42)[_0x8a36('0x25')]();};}function respondWithResult(_0x4553fc,_0x299d96){_0x299d96=_0x299d96||0xc8;return function(_0x3e309b){if(_0x3e309b){return _0x4553fc[_0x8a36('0x24')](_0x299d96)[_0x8a36('0x26')](_0x3e309b);}};}function respondWithFilteredResult(_0x3130f4,_0x357668){return function(_0x2834d3){if(_0x2834d3){var _0x3dfce1=typeof _0x357668[_0x8a36('0x27')]===_0x8a36('0x28')&&typeof _0x357668[_0x8a36('0x29')]===_0x8a36('0x28');var _0x1db5ad=_0x2834d3[_0x8a36('0x2a')];var _0x4c477e=_0x3dfce1?0x0:_0x357668[_0x8a36('0x27')];var _0x5f180e=_0x3dfce1?_0x2834d3['count']:_0x357668['offset']+_0x357668[_0x8a36('0x29')];var _0x46306e;if(_0x5f180e>=_0x1db5ad){_0x5f180e=_0x1db5ad;_0x46306e=0xc8;}else{_0x46306e=0xce;}_0x3130f4['status'](_0x46306e);return _0x3130f4[_0x8a36('0x2b')](_0x8a36('0x2c'),_0x4c477e+'-'+_0x5f180e+'/'+_0x1db5ad)['json'](_0x2834d3);}return null;};}function patchUpdates(_0x8452da){return function(_0x212f52){try{jsonpatch[_0x8a36('0x2d')](_0x212f52,_0x8452da,!![]);}catch(_0x494dd8){return BPromise[_0x8a36('0x2e')](_0x494dd8);}return _0x212f52['save']();};}function saveUpdates(_0x229979,_0x228bbe){return function(_0x63b4de){if(_0x63b4de){return _0x63b4de[_0x8a36('0x2f')](_0x229979)[_0x8a36('0x1a')](function(_0x55775a){return _0x55775a;});}return null;};}function removeEntity(_0x5eab87,_0x2a4fad){return function(_0x1a8b70){if(_0x1a8b70){return _0x1a8b70['destroy']()[_0x8a36('0x1a')](function(){_0x5eab87[_0x8a36('0x24')](0xcc)[_0x8a36('0x25')]();});}};}function handleEntityNotFound(_0x552734,_0x390c4d){return function(_0x40987d){if(!_0x40987d){_0x552734[_0x8a36('0x23')](0x194);}return _0x40987d;};}function handleError(_0xcba2a6,_0x37b6d3){_0x37b6d3=_0x37b6d3||0x1f4;return function(_0x4b19e3){logger['error'](_0x4b19e3[_0x8a36('0x30')]);if(_0x4b19e3[_0x8a36('0x31')]){delete _0x4b19e3[_0x8a36('0x31')];}_0xcba2a6[_0x8a36('0x24')](_0x37b6d3)[_0x8a36('0x32')](_0x4b19e3);};}exports[_0x8a36('0x33')]=function(_0x496c0b,_0x3b990a){var _0x21901f={},_0x5aa0f4={},_0x1c4717={'count':0x0,'rows':[]};var _0x4e055d=_[_0x8a36('0x34')](db[_0x8a36('0x35')]['rawAttributes'],function(_0x22b0ed){return{'name':_0x22b0ed[_0x8a36('0x36')],'type':_0x22b0ed[_0x8a36('0x37')][_0x8a36('0x38')]};});_0x5aa0f4[_0x8a36('0x39')]=_[_0x8a36('0x34')](_0x4e055d,_0x8a36('0x31'));_0x5aa0f4[_0x8a36('0x3a')]=_['keys'](_0x496c0b[_0x8a36('0x3a')]);_0x5aa0f4[_0x8a36('0x3b')]=_['intersection'](_0x5aa0f4['model'],_0x5aa0f4['query']);_0x21901f[_0x8a36('0x3c')]=_[_0x8a36('0x3d')](_0x5aa0f4[_0x8a36('0x39')],qs[_0x8a36('0x3e')](_0x496c0b[_0x8a36('0x3a')][_0x8a36('0x3e')]));_0x21901f[_0x8a36('0x3c')]=_0x21901f[_0x8a36('0x3c')]['length']?_0x21901f[_0x8a36('0x3c')]:_0x5aa0f4['model'];if(!_0x496c0b[_0x8a36('0x3a')][_0x8a36('0x3f')](_0x8a36('0x40'))){_0x21901f['limit']=qs[_0x8a36('0x29')](_0x496c0b['query'][_0x8a36('0x29')]);_0x21901f[_0x8a36('0x27')]=qs[_0x8a36('0x27')](_0x496c0b['query'][_0x8a36('0x27')]);}_0x21901f[_0x8a36('0x41')]=qs['sort'](_0x496c0b[_0x8a36('0x3a')][_0x8a36('0x42')]);_0x21901f[_0x8a36('0x43')]=qs['filters'](_[_0x8a36('0x44')](_0x496c0b[_0x8a36('0x3a')],_0x5aa0f4[_0x8a36('0x3b')]),_0x4e055d);if(_0x496c0b[_0x8a36('0x3a')]['filter']){_0x21901f[_0x8a36('0x43')]=_[_0x8a36('0x45')](_0x21901f[_0x8a36('0x43')],{'$or':_[_0x8a36('0x34')](_0x4e055d,function(_0x1537fc){if(_0x1537fc['type']!==_0x8a36('0x46')){var _0x2e826e={};_0x2e826e[_0x1537fc[_0x8a36('0x31')]]={'$like':'%'+_0x496c0b['query'][_0x8a36('0x47')]+'%'};return _0x2e826e;}})});}_0x21901f=_[_0x8a36('0x45')]({},_0x21901f,_0x496c0b['options']);var _0x4504d8={'where':_0x21901f['where']};return db[_0x8a36('0x35')][_0x8a36('0x2a')](_0x4504d8)['then'](function(_0x136917){_0x1c4717[_0x8a36('0x2a')]=_0x136917;if(_0x496c0b[_0x8a36('0x3a')][_0x8a36('0x48')]){_0x21901f[_0x8a36('0x49')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x8a36('0x4a')](_0x21901f);})[_0x8a36('0x1a')](function(_0x4c75c0){_0x1c4717[_0x8a36('0x4b')]=_0x4c75c0;return _0x1c4717;})[_0x8a36('0x1a')](respondWithFilteredResult(_0x3b990a,_0x21901f))[_0x8a36('0x22')](handleError(_0x3b990a,null));};exports[_0x8a36('0x4c')]=function(_0x102b72,_0x1be0d9){var _0x299ccc={'raw':![],'where':{'id':_0x102b72[_0x8a36('0x4d')]['id']}},_0xfc2c4e={};_0xfc2c4e['model']=_['keys'](db[_0x8a36('0x35')][_0x8a36('0x4e')]);_0xfc2c4e[_0x8a36('0x3a')]=_[_0x8a36('0x4f')](_0x102b72[_0x8a36('0x3a')]);_0xfc2c4e['filters']=_[_0x8a36('0x3d')](_0xfc2c4e[_0x8a36('0x39')],_0xfc2c4e['query']);_0x299ccc['attributes']=_[_0x8a36('0x3d')](_0xfc2c4e[_0x8a36('0x39')],qs['fields'](_0x102b72[_0x8a36('0x3a')][_0x8a36('0x3e')]));_0x299ccc['attributes']=_0x299ccc['attributes']['length']?_0x299ccc['attributes']:_0xfc2c4e['model'];if(_0x102b72[_0x8a36('0x3a')][_0x8a36('0x48')]){_0x299ccc[_0x8a36('0x49')]=[{'all':!![]}];}_0x299ccc=_[_0x8a36('0x45')]({},_0x299ccc,_0x102b72[_0x8a36('0x50')]);return db[_0x8a36('0x35')]['find'](_0x299ccc)[_0x8a36('0x1a')](handleEntityNotFound(_0x1be0d9,null))[_0x8a36('0x1a')](respondWithResult(_0x1be0d9,null))[_0x8a36('0x22')](handleError(_0x1be0d9,null));};exports[_0x8a36('0x51')]=function(_0x1f5489,_0x508110){return db[_0x8a36('0x35')][_0x8a36('0x51')](_0x1f5489[_0x8a36('0x52')],{})['then'](respondWithResult(_0x508110,0xc9))[_0x8a36('0x22')](handleError(_0x508110,null));};exports['update']=function(_0x30ecaa,_0x49821a){if(_0x30ecaa['body']['id']){delete _0x30ecaa[_0x8a36('0x52')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x30ecaa['params']['id']}})['then'](handleEntityNotFound(_0x49821a,null))[_0x8a36('0x1a')](saveUpdates(_0x30ecaa[_0x8a36('0x52')],null))[_0x8a36('0x1a')](respondWithResult(_0x49821a,null))[_0x8a36('0x22')](handleError(_0x49821a,null));};exports[_0x8a36('0x53')]=function(_0x398a2d,_0x6f64a4){return db[_0x8a36('0x35')][_0x8a36('0x54')]({'where':{'id':_0x398a2d[_0x8a36('0x4d')]['id']}})[_0x8a36('0x1a')](handleEntityNotFound(_0x6f64a4,null))['then'](removeEntity(_0x6f64a4,null))[_0x8a36('0x22')](handleError(_0x6f64a4,null));};exports[_0x8a36('0x55')]=function(_0x4de417,_0x3ef8fc,_0x3874b2){var _0x49ce5b={};var _0x36d8d2={};var _0x15367f;var _0x2e07e6;return db[_0x8a36('0x35')][_0x8a36('0x56')]({'where':{'id':_0x4de417[_0x8a36('0x4d')]['id']}})[_0x8a36('0x1a')](handleEntityNotFound(_0x3ef8fc,null))[_0x8a36('0x1a')](function(_0x2f0591){if(_0x2f0591){_0x15367f=_0x2f0591;_0x36d8d2[_0x8a36('0x39')]=_[_0x8a36('0x4f')](db['SugarcrmConfiguration'][_0x8a36('0x4e')]);_0x36d8d2[_0x8a36('0x3a')]=_['keys'](_0x4de417[_0x8a36('0x3a')]);_0x36d8d2[_0x8a36('0x3b')]=_['intersection'](_0x36d8d2[_0x8a36('0x39')],_0x36d8d2['query']);_0x49ce5b[_0x8a36('0x3c')]=_[_0x8a36('0x3d')](_0x36d8d2[_0x8a36('0x39')],qs[_0x8a36('0x3e')](_0x4de417[_0x8a36('0x3a')][_0x8a36('0x3e')]));_0x49ce5b['attributes']=_0x49ce5b['attributes'][_0x8a36('0x57')]?_0x49ce5b['attributes']:_0x36d8d2[_0x8a36('0x39')];_0x49ce5b[_0x8a36('0x41')]=qs[_0x8a36('0x42')](_0x4de417[_0x8a36('0x3a')]['sort']);_0x49ce5b['where']=qs[_0x8a36('0x3b')](_[_0x8a36('0x44')](_0x4de417[_0x8a36('0x3a')],_0x36d8d2[_0x8a36('0x3b')]));if(_0x4de417[_0x8a36('0x3a')][_0x8a36('0x47')]){_0x49ce5b['where']=_[_0x8a36('0x45')](_0x49ce5b[_0x8a36('0x43')],{'$or':_['map'](_0x49ce5b[_0x8a36('0x3c')],function(_0x5ad519){var _0x3b27e3={};_0x3b27e3[_0x5ad519]={'$like':'%'+_0x4de417[_0x8a36('0x3a')][_0x8a36('0x47')]+'%'};return _0x3b27e3;})});}_0x49ce5b=_[_0x8a36('0x45')]({},_0x49ce5b,_0x4de417[_0x8a36('0x50')]);return _0x15367f[_0x8a36('0x55')](_0x49ce5b);}})['then'](function(_0xd8fc47){if(_0xd8fc47){_0x2e07e6=_0xd8fc47[_0x8a36('0x57')];if(!_0x4de417['query']['hasOwnProperty'](_0x8a36('0x40'))){_0x49ce5b['limit']=qs[_0x8a36('0x29')](_0x4de417[_0x8a36('0x3a')][_0x8a36('0x29')]);_0x49ce5b[_0x8a36('0x27')]=qs[_0x8a36('0x27')](_0x4de417[_0x8a36('0x3a')][_0x8a36('0x27')]);}return _0x15367f[_0x8a36('0x55')](_0x49ce5b);}})[_0x8a36('0x1a')](function(_0x3f3678){if(_0x3f3678){return _0x3f3678?{'count':_0x2e07e6,'rows':_0x3f3678}:null;}})[_0x8a36('0x1a')](respondWithResult(_0x3ef8fc,null))[_0x8a36('0x22')](handleError(_0x3ef8fc,null));};exports['addConfiguration']=function(_0x40dc79,_0x10160a,_0x4028f6){if(_0x40dc79['body']['id']){delete _0x40dc79[_0x8a36('0x52')]['id'];}return db[_0x8a36('0x35')]['findOne']({'where':{'id':_0x40dc79[_0x8a36('0x4d')]['id']}})[_0x8a36('0x1a')](handleEntityNotFound(_0x10160a,null))[_0x8a36('0x1a')](function(_0x1f6f8a){if(_0x1f6f8a){_0x40dc79['body'][_0x8a36('0x58')]=_0x1f6f8a['id'];_0x40dc79['body']['Subjects']=integrations[_0x8a36('0x59')](_0x40dc79[_0x8a36('0x52')][_0x8a36('0x5a')],_0x40dc79['body'][_0x8a36('0x37')]);_0x40dc79[_0x8a36('0x52')]['Descriptions']=integrations['getDescriptions'](_0x40dc79[_0x8a36('0x52')][_0x8a36('0x5a')],_0x40dc79[_0x8a36('0x52')][_0x8a36('0x37')]);return db[_0x8a36('0x5b')][_0x8a36('0x51')](_0x40dc79[_0x8a36('0x52')],{'include':[{'model':db['SugarcrmField'],'as':_0x8a36('0x5c')},{'model':db[_0x8a36('0x5d')],'as':_0x8a36('0x5e')}]});}return null;})[_0x8a36('0x1a')](respondWithResult(_0x10160a,null))[_0x8a36('0x22')](handleError(_0x10160a,null));};exports[_0x8a36('0x5f')]=function(_0x39b2a8,_0xe997f0,_0x453494){var _0x54ad36='';var _0x124343=['id','name',_0x8a36('0x60'),'created_by',_0x8a36('0x61'),_0x8a36('0x62'),_0x8a36('0x63'),'duration_minutes',_0x8a36('0x64'),_0x8a36('0x65'),_0x8a36('0x66'),'direction'];return db[_0x8a36('0x35')][_0x8a36('0x56')]({'where':{'id':_0x39b2a8[_0x8a36('0x4d')]['id']},'attributes':['id',_0x8a36('0x67'),_0x8a36('0x68'),_0x8a36('0x69')]})['then'](handleEntityNotFound(_0xe997f0,null))[_0x8a36('0x1a')](function(_0x13e9c6){if(_0x13e9c6){_0x54ad36=_0x13e9c6[_0x8a36('0x69')];var _0x35b074=_0x54ad36['slice'](-0x1);if(_0x35b074==='/'){_0x54ad36=_0x54ad36['substring'](0x0,_0x54ad36[_0x8a36('0x6a')](_0x35b074));}return rp({'method':_0x8a36('0x6b'),'uri':util['format'](_0x8a36('0x6c'),_0x54ad36,_0x8a36('0x6d')),'json':!![],'form':{'method':_0x8a36('0x6e'),'input_type':_0x8a36('0x6f'),'response_type':_0x8a36('0x6f'),'rest_data':JSON[_0x8a36('0x70')]({'user_auth':{'user_name':_0x13e9c6[_0x8a36('0x67')],'password':_0x13e9c6['password'],'encryption':_0x8a36('0x71')},'application':_0x8a36('0x72')})}});}})[_0x8a36('0x1a')](function(_0x30f85a){if(_0x30f85a&&_0x30f85a[_0x8a36('0x31')]!==_0x8a36('0x73')&&_0x30f85a[_0x8a36('0x31')]!==_0x8a36('0x74')){return rp({'method':_0x8a36('0x6b'),'uri':util[_0x8a36('0x75')](_0x8a36('0x6c'),_0x54ad36,_0x8a36('0x6d')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8a36('0x70')]({'session':_0x30f85a['id'],'module_name':_0x8a36('0x76')})}})[_0x8a36('0x1a')](function(_0x25b4a2){if(_0x25b4a2){var _0x849ccc=_[_0x8a36('0x77')](_0x25b4a2[_0x8a36('0x78')]);_['remove'](_0x849ccc,function(_0x285e19){return _0x124343[_0x8a36('0x79')](_0x285e19[_0x8a36('0x31')]);});return{'count':_0x849ccc['length'],'rows':_[_0x8a36('0x34')](_0x849ccc,function(_0x10fba2){return{'id':_0x10fba2[_0x8a36('0x31')],'name':_0x10fba2[_0x8a36('0x7a')],'custom':_[_0x8a36('0x7b')](_0x10fba2[_0x8a36('0x31')],'_c')?!![]:![],'options':_0x10fba2[_0x8a36('0x50')]?_[_0x8a36('0x34')](_[_0x8a36('0x77')](_0x10fba2['options']),function(_0x2be6ef){return{'name':_0x2be6ef['value'],'value':_0x2be6ef['name']};}):[]};})};}})[_0x8a36('0x1a')](respondWithResult(_0xe997f0,null))[_0x8a36('0x22')](function(_0x562470){var _0x1947b4=_0x39b2a8[_0x8a36('0x3a')]['test']?0x1f4:_0x562470[_0x8a36('0x7c')]||0x1f4;logger[_0x8a36('0x1e')](_0x8a36('0x7d'),_0x8a36('0x5f'),_0x1947b4,JSON[_0x8a36('0x70')](_0x562470));delete _0x562470[_0x8a36('0x31')];if(_0x1947b4===0x191){_0x1947b4=0x190;}_0xe997f0['status'](_0x1947b4)[_0x8a36('0x32')](_0x39b2a8[_0x8a36('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x562470[_0x8a36('0x7c')]}:_0x562470);});}else{var _0x2d01ac=0x1f4;_0xe997f0['status'](_0x2d01ac)[_0x8a36('0x32')]({'message':_0x8a36('0x7e'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xa705=['show','options','create','update','find','params','getConfigurations','findOne','body','AccountId','Subjects','getSubjects','channel','SugarcrmConfiguration','SugarcrmField','Descriptions','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','Calls','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x15482e,_0x25b23c){var _0x4a0651=function(_0x5afab4){while(--_0x5afab4){_0x15482e['push'](_0x15482e['shift']());}};_0x4a0651(++_0x25b23c);}(_0xa705,0xb5));var _0x5a70=function(_0x1a06af,_0x9679e7){_0x1a06af=_0x1a06af-0x0;var _0x3d5ea9=_0xa705[_0x1a06af];return _0x3d5ea9;};'use strict';var emlformat=require(_0x5a70('0x0'));var rimraf=require(_0x5a70('0x1'));var zipdir=require(_0x5a70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a70('0x3'));var moment=require('moment');var BPromise=require(_0x5a70('0x4'));var Mustache=require('mustache');var util=require(_0x5a70('0x5'));var path=require(_0x5a70('0x6'));var sox=require('sox');var csv=require(_0x5a70('0x7'));var ejs=require(_0x5a70('0x8'));var fs=require('fs');var fs_extra=require(_0x5a70('0x9'));var _=require(_0x5a70('0xa'));var squel=require(_0x5a70('0xb'));var crypto=require('crypto');var jsforce=require(_0x5a70('0xc'));var deskjs=require(_0x5a70('0xd'));var toCsv=require(_0x5a70('0x7'));var querystring=require(_0x5a70('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a70('0xf'));var authService=require(_0x5a70('0x10'));var qs=require(_0x5a70('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a70('0x12'));var logger=require(_0x5a70('0x13'))(_0x5a70('0x14'));var utils=require(_0x5a70('0x15'));var config=require(_0x5a70('0x16'));var licenseUtil=require(_0x5a70('0x17'));var db=require(_0x5a70('0x18'))['db'];var integrations=require(_0x5a70('0x19'));var jayson=require(_0x5a70('0x1a'));var client=jayson[_0x5a70('0x1b')][_0x5a70('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4b28c3,_0x5c6c72,_0x482699,_0x5c8194){return new BPromise(function(_0x5f4568,_0x3b9fee){var _0x96e559=_0x5c8194||client;return _0x96e559[_0x5a70('0x1d')](_0x4b28c3,_0x482699)['then'](function(_0x1058f4){logger['info'](_0x5a70('0x1e'),_0x5c6c72,_0x5a70('0x1f'));logger[_0x5a70('0x20')](_0x5a70('0x21'),_0x5c6c72,'request\x20sent',JSON[_0x5a70('0x22')](_0x1058f4));if(_0x1058f4[_0x5a70('0x23')]){if(_0x1058f4['error'][_0x5a70('0x24')]===0x1f4){logger['error'](_0x5a70('0x1e'),_0x5c6c72,_0x1058f4[_0x5a70('0x23')][_0x5a70('0x25')]);return _0x3b9fee(_0x1058f4['error']['message']);}logger[_0x5a70('0x23')](_0x5a70('0x1e'),_0x5c6c72,_0x1058f4[_0x5a70('0x23')][_0x5a70('0x25')]);return _0x5f4568(_0x1058f4['error'][_0x5a70('0x25')]);}else{logger[_0x5a70('0x26')](_0x5a70('0x1e'),_0x5c6c72,_0x5a70('0x1f'));_0x5f4568(_0x1058f4[_0x5a70('0x27')][_0x5a70('0x25')]);}})[_0x5a70('0x28')](function(_0x4ad30a){logger[_0x5a70('0x23')](_0x5a70('0x1e'),_0x5c6c72,_0x4ad30a);_0x3b9fee(_0x4ad30a);});});}function respondWithStatusCode(_0x4e9d68,_0x2c0cbb){_0x2c0cbb=_0x2c0cbb||0xcc;return function(_0x54ea3e){if(_0x54ea3e){return _0x4e9d68[_0x5a70('0x29')](_0x2c0cbb);}return _0x4e9d68[_0x5a70('0x2a')](_0x2c0cbb)[_0x5a70('0x2b')]();};}function respondWithResult(_0x5bbe2a,_0x1ded3c){_0x1ded3c=_0x1ded3c||0xc8;return function(_0xa5edb1){if(_0xa5edb1){return _0x5bbe2a[_0x5a70('0x2a')](_0x1ded3c)[_0x5a70('0x2c')](_0xa5edb1);}};}function respondWithFilteredResult(_0x9afa2c,_0x29c8a1){return function(_0x13307e){if(_0x13307e){var _0x40cda1=typeof _0x29c8a1[_0x5a70('0x2d')]===_0x5a70('0x2e')&&typeof _0x29c8a1[_0x5a70('0x2f')]==='undefined';var _0x19355a=_0x13307e[_0x5a70('0x30')];var _0x20d8a9=_0x40cda1?0x0:_0x29c8a1['offset'];var _0x28953e=_0x40cda1?_0x13307e['count']:_0x29c8a1['offset']+_0x29c8a1[_0x5a70('0x2f')];var _0x31f4b4;if(_0x28953e>=_0x19355a){_0x28953e=_0x19355a;_0x31f4b4=0xc8;}else{_0x31f4b4=0xce;}_0x9afa2c[_0x5a70('0x2a')](_0x31f4b4);return _0x9afa2c[_0x5a70('0x31')](_0x5a70('0x32'),_0x20d8a9+'-'+_0x28953e+'/'+_0x19355a)[_0x5a70('0x2c')](_0x13307e);}return null;};}function patchUpdates(_0x3493a1){return function(_0x581ce3){try{jsonpatch[_0x5a70('0x33')](_0x581ce3,_0x3493a1,!![]);}catch(_0x87d139){return BPromise[_0x5a70('0x34')](_0x87d139);}return _0x581ce3[_0x5a70('0x35')]();};}function saveUpdates(_0x179884,_0x56bf17){return function(_0x29d48a){if(_0x29d48a){return _0x29d48a['update'](_0x179884)[_0x5a70('0x36')](function(_0xbb1b0d){return _0xbb1b0d;});}return null;};}function removeEntity(_0x333b36,_0x1467fa){return function(_0x5cfbc2){if(_0x5cfbc2){return _0x5cfbc2[_0x5a70('0x37')]()[_0x5a70('0x36')](function(){_0x333b36[_0x5a70('0x2a')](0xcc)[_0x5a70('0x2b')]();});}};}function handleEntityNotFound(_0x11e2e3,_0x55bbce){return function(_0x109959){if(!_0x109959){_0x11e2e3[_0x5a70('0x29')](0x194);}return _0x109959;};}function handleError(_0x47a61d,_0x58f447){_0x58f447=_0x58f447||0x1f4;return function(_0x1a376b){logger['error'](_0x1a376b[_0x5a70('0x38')]);if(_0x1a376b[_0x5a70('0x39')]){delete _0x1a376b[_0x5a70('0x39')];}_0x47a61d[_0x5a70('0x2a')](_0x58f447)[_0x5a70('0x3a')](_0x1a376b);};}exports[_0x5a70('0x3b')]=function(_0x34e7a0,_0x598355){var _0x4ce9e9={},_0x59dc9f={},_0x43f6ad={'count':0x0,'rows':[]};var _0x4191e4=_[_0x5a70('0x3c')](db[_0x5a70('0x3d')]['rawAttributes'],function(_0x277a86){return{'name':_0x277a86[_0x5a70('0x3e')],'type':_0x277a86[_0x5a70('0x3f')][_0x5a70('0x40')]};});_0x59dc9f[_0x5a70('0x41')]=_[_0x5a70('0x3c')](_0x4191e4,_0x5a70('0x39'));_0x59dc9f[_0x5a70('0x42')]=_[_0x5a70('0x43')](_0x34e7a0['query']);_0x59dc9f['filters']=_[_0x5a70('0x44')](_0x59dc9f[_0x5a70('0x41')],_0x59dc9f[_0x5a70('0x42')]);_0x4ce9e9[_0x5a70('0x45')]=_[_0x5a70('0x44')](_0x59dc9f[_0x5a70('0x41')],qs[_0x5a70('0x46')](_0x34e7a0['query']['fields']));_0x4ce9e9[_0x5a70('0x45')]=_0x4ce9e9[_0x5a70('0x45')][_0x5a70('0x47')]?_0x4ce9e9[_0x5a70('0x45')]:_0x59dc9f[_0x5a70('0x41')];if(!_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x48')](_0x5a70('0x49'))){_0x4ce9e9['limit']=qs[_0x5a70('0x2f')](_0x34e7a0['query'][_0x5a70('0x2f')]);_0x4ce9e9['offset']=qs['offset'](_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x2d')]);}_0x4ce9e9[_0x5a70('0x4a')]=qs[_0x5a70('0x4b')](_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x4b')]);_0x4ce9e9[_0x5a70('0x4c')]=qs[_0x5a70('0x4d')](_[_0x5a70('0x4e')](_0x34e7a0[_0x5a70('0x42')],_0x59dc9f['filters']),_0x4191e4);if(_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x4f')]){_0x4ce9e9['where']=_[_0x5a70('0x50')](_0x4ce9e9['where'],{'$or':_['map'](_0x4191e4,function(_0x27b137){if(_0x27b137[_0x5a70('0x3f')]!==_0x5a70('0x51')){var _0x4df307={};_0x4df307[_0x27b137['name']]={'$like':'%'+_0x34e7a0[_0x5a70('0x42')][_0x5a70('0x4f')]+'%'};return _0x4df307;}})});}_0x4ce9e9=_[_0x5a70('0x50')]({},_0x4ce9e9,_0x34e7a0['options']);var _0x5c3f71={'where':_0x4ce9e9[_0x5a70('0x4c')]};return db[_0x5a70('0x3d')]['count'](_0x5c3f71)[_0x5a70('0x36')](function(_0x2f9b5c){_0x43f6ad[_0x5a70('0x30')]=_0x2f9b5c;if(_0x34e7a0['query'][_0x5a70('0x52')]){_0x4ce9e9[_0x5a70('0x53')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x5a70('0x54')](_0x4ce9e9);})[_0x5a70('0x36')](function(_0x40848a){_0x43f6ad['rows']=_0x40848a;return _0x43f6ad;})['then'](respondWithFilteredResult(_0x598355,_0x4ce9e9))[_0x5a70('0x28')](handleError(_0x598355,null));};exports[_0x5a70('0x55')]=function(_0x2e431c,_0x59d35a){var _0x245bcb={'raw':![],'where':{'id':_0x2e431c['params']['id']}},_0x1bf74a={};_0x1bf74a['model']=_['keys'](db[_0x5a70('0x3d')]['rawAttributes']);_0x1bf74a['query']=_[_0x5a70('0x43')](_0x2e431c[_0x5a70('0x42')]);_0x1bf74a[_0x5a70('0x4d')]=_['intersection'](_0x1bf74a['model'],_0x1bf74a[_0x5a70('0x42')]);_0x245bcb[_0x5a70('0x45')]=_['intersection'](_0x1bf74a['model'],qs['fields'](_0x2e431c[_0x5a70('0x42')][_0x5a70('0x46')]));_0x245bcb[_0x5a70('0x45')]=_0x245bcb[_0x5a70('0x45')]['length']?_0x245bcb[_0x5a70('0x45')]:_0x1bf74a[_0x5a70('0x41')];if(_0x2e431c[_0x5a70('0x42')][_0x5a70('0x52')]){_0x245bcb[_0x5a70('0x53')]=[{'all':!![]}];}_0x245bcb=_[_0x5a70('0x50')]({},_0x245bcb,_0x2e431c[_0x5a70('0x56')]);return db[_0x5a70('0x3d')]['find'](_0x245bcb)[_0x5a70('0x36')](handleEntityNotFound(_0x59d35a,null))['then'](respondWithResult(_0x59d35a,null))[_0x5a70('0x28')](handleError(_0x59d35a,null));};exports[_0x5a70('0x57')]=function(_0x32c0c0,_0x55215d){return db[_0x5a70('0x3d')]['create'](_0x32c0c0['body'],{})[_0x5a70('0x36')](respondWithResult(_0x55215d,0xc9))[_0x5a70('0x28')](handleError(_0x55215d,null));};exports[_0x5a70('0x58')]=function(_0x461b81,_0x367715){if(_0x461b81['body']['id']){delete _0x461b81['body']['id'];}return db[_0x5a70('0x3d')][_0x5a70('0x59')]({'where':{'id':_0x461b81['params']['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x367715,null))[_0x5a70('0x36')](saveUpdates(_0x461b81['body'],null))[_0x5a70('0x36')](respondWithResult(_0x367715,null))['catch'](handleError(_0x367715,null));};exports['destroy']=function(_0x3c41e6,_0x4dd33e){return db[_0x5a70('0x3d')][_0x5a70('0x59')]({'where':{'id':_0x3c41e6[_0x5a70('0x5a')]['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x4dd33e,null))[_0x5a70('0x36')](removeEntity(_0x4dd33e,null))['catch'](handleError(_0x4dd33e,null));};exports[_0x5a70('0x5b')]=function(_0x3fed8b,_0x5e3e93,_0x519092){var _0x1a2037={};var _0x308f44={};var _0x4d6191;var _0x4bee77;return db[_0x5a70('0x3d')][_0x5a70('0x5c')]({'where':{'id':_0x3fed8b[_0x5a70('0x5a')]['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x5e3e93,null))['then'](function(_0x215678){if(_0x215678){_0x4d6191=_0x215678;_0x308f44[_0x5a70('0x41')]=_[_0x5a70('0x43')](db['SugarcrmConfiguration']['rawAttributes']);_0x308f44['query']=_[_0x5a70('0x43')](_0x3fed8b[_0x5a70('0x42')]);_0x308f44['filters']=_[_0x5a70('0x44')](_0x308f44[_0x5a70('0x41')],_0x308f44['query']);_0x1a2037[_0x5a70('0x45')]=_[_0x5a70('0x44')](_0x308f44[_0x5a70('0x41')],qs['fields'](_0x3fed8b[_0x5a70('0x42')]['fields']));_0x1a2037[_0x5a70('0x45')]=_0x1a2037[_0x5a70('0x45')][_0x5a70('0x47')]?_0x1a2037[_0x5a70('0x45')]:_0x308f44[_0x5a70('0x41')];_0x1a2037['order']=qs[_0x5a70('0x4b')](_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x4b')]);_0x1a2037[_0x5a70('0x4c')]=qs[_0x5a70('0x4d')](_[_0x5a70('0x4e')](_0x3fed8b[_0x5a70('0x42')],_0x308f44[_0x5a70('0x4d')]));if(_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x4f')]){_0x1a2037['where']=_['merge'](_0x1a2037[_0x5a70('0x4c')],{'$or':_[_0x5a70('0x3c')](_0x1a2037[_0x5a70('0x45')],function(_0x31a7d4){var _0x682a5e={};_0x682a5e[_0x31a7d4]={'$like':'%'+_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x4f')]+'%'};return _0x682a5e;})});}_0x1a2037=_['merge']({},_0x1a2037,_0x3fed8b[_0x5a70('0x56')]);return _0x4d6191[_0x5a70('0x5b')](_0x1a2037);}})[_0x5a70('0x36')](function(_0x2cd42f){if(_0x2cd42f){_0x4bee77=_0x2cd42f[_0x5a70('0x47')];if(!_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x48')](_0x5a70('0x49'))){_0x1a2037[_0x5a70('0x2f')]=qs[_0x5a70('0x2f')](_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x2f')]);_0x1a2037[_0x5a70('0x2d')]=qs['offset'](_0x3fed8b[_0x5a70('0x42')][_0x5a70('0x2d')]);}return _0x4d6191['getConfigurations'](_0x1a2037);}})['then'](function(_0x45c369){if(_0x45c369){return _0x45c369?{'count':_0x4bee77,'rows':_0x45c369}:null;}})[_0x5a70('0x36')](respondWithResult(_0x5e3e93,null))[_0x5a70('0x28')](handleError(_0x5e3e93,null));};exports['addConfiguration']=function(_0x4d365c,_0x46387e,_0x3a61a9){if(_0x4d365c[_0x5a70('0x5d')]['id']){delete _0x4d365c[_0x5a70('0x5d')]['id'];}return db[_0x5a70('0x3d')][_0x5a70('0x5c')]({'where':{'id':_0x4d365c[_0x5a70('0x5a')]['id']}})[_0x5a70('0x36')](handleEntityNotFound(_0x46387e,null))[_0x5a70('0x36')](function(_0x540a75){if(_0x540a75){_0x4d365c['body'][_0x5a70('0x5e')]=_0x540a75['id'];_0x4d365c[_0x5a70('0x5d')][_0x5a70('0x5f')]=integrations[_0x5a70('0x60')](_0x4d365c['body'][_0x5a70('0x61')],_0x4d365c['body'][_0x5a70('0x3f')]);_0x4d365c[_0x5a70('0x5d')]['Descriptions']=integrations['getDescriptions'](_0x4d365c['body'][_0x5a70('0x61')],_0x4d365c[_0x5a70('0x5d')]['type']);return db[_0x5a70('0x62')][_0x5a70('0x57')](_0x4d365c[_0x5a70('0x5d')],{'include':[{'model':db[_0x5a70('0x63')],'as':_0x5a70('0x5f')},{'model':db[_0x5a70('0x63')],'as':_0x5a70('0x64')}]});}return null;})[_0x5a70('0x36')](respondWithResult(_0x46387e,null))[_0x5a70('0x28')](handleError(_0x46387e,null));};exports['getFields']=function(_0x2af748,_0xe663f4,_0xc625ba){var _0x47ba85='';var _0x1c006c=['id',_0x5a70('0x39'),_0x5a70('0x65'),'created_by',_0x5a70('0x66'),'date_start',_0x5a70('0x67'),_0x5a70('0x68'),_0x5a70('0x69'),_0x5a70('0x6a'),_0x5a70('0x6b'),_0x5a70('0x6c')];return db[_0x5a70('0x3d')][_0x5a70('0x5c')]({'where':{'id':_0x2af748[_0x5a70('0x5a')]['id']},'attributes':['id',_0x5a70('0x6d'),_0x5a70('0x6e'),_0x5a70('0x6f')]})[_0x5a70('0x36')](handleEntityNotFound(_0xe663f4,null))['then'](function(_0x778262){if(_0x778262){_0x47ba85=_0x778262[_0x5a70('0x6f')];var _0x3f618a=_0x47ba85['slice'](-0x1);if(_0x3f618a==='/'){_0x47ba85=_0x47ba85[_0x5a70('0x70')](0x0,_0x47ba85[_0x5a70('0x71')](_0x3f618a));}return rp({'method':_0x5a70('0x72'),'uri':util[_0x5a70('0x73')]('%s%s',_0x47ba85,_0x5a70('0x74')),'json':!![],'form':{'method':_0x5a70('0x75'),'input_type':'JSON','response_type':_0x5a70('0x76'),'rest_data':JSON[_0x5a70('0x22')]({'user_auth':{'user_name':_0x778262[_0x5a70('0x6d')],'password':_0x778262[_0x5a70('0x6e')],'encryption':'PLAIN'},'application':_0x5a70('0x77')})}});}})[_0x5a70('0x36')](function(_0x3413e8){if(_0x3413e8&&_0x3413e8[_0x5a70('0x39')]!==_0x5a70('0x78')&&_0x3413e8[_0x5a70('0x39')]!==_0x5a70('0x79')){return rp({'method':_0x5a70('0x72'),'uri':util['format']('%s%s',_0x47ba85,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5a70('0x76'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3413e8['id'],'module_name':_0x5a70('0x7a')})}})[_0x5a70('0x36')](function(_0xa660){if(_0xa660){var _0x55e8d4=_['values'](_0xa660[_0x5a70('0x7b')]);_[_0x5a70('0x7c')](_0x55e8d4,function(_0x55983c){return _0x1c006c['includes'](_0x55983c['name']);});return{'count':_0x55e8d4[_0x5a70('0x47')],'rows':_[_0x5a70('0x3c')](_0x55e8d4,function(_0x5f5074){return{'id':_0x5f5074['name'],'name':_0x5f5074[_0x5a70('0x7d')],'custom':_[_0x5a70('0x7e')](_0x5f5074['name'],'_c')?!![]:![],'options':_0x5f5074['options']?_[_0x5a70('0x3c')](_['values'](_0x5f5074['options']),function(_0x408c0a){return{'name':_0x408c0a[_0x5a70('0x7f')],'value':_0x408c0a[_0x5a70('0x39')]};}):[]};})};}})['then'](respondWithResult(_0xe663f4,null))[_0x5a70('0x28')](function(_0x2654d7){var _0x582fb7=_0x2af748[_0x5a70('0x42')][_0x5a70('0x80')]?0x1f4:_0x2654d7[_0x5a70('0x81')]||0x1f4;logger['error'](_0x5a70('0x82'),_0x5a70('0x83'),_0x582fb7,JSON[_0x5a70('0x22')](_0x2654d7));delete _0x2654d7['name'];if(_0x582fb7===0x191){_0x582fb7=0x190;}_0xe663f4['status'](_0x582fb7)[_0x5a70('0x3a')](_0x2af748[_0x5a70('0x42')][_0x5a70('0x80')]?{'message':_0x5a70('0x84'),'statusCode':_0x2654d7[_0x5a70('0x81')]}:_0x2654d7);});}else{var _0x48845e=0x1f4;_0xe663f4[_0x5a70('0x2a')](_0x48845e)['send']({'message':_0x5a70('0x84'),'statusCode':0x190});}});};
\ No newline at end of file
index 3e02701..c39c60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x847d=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x4997bd,_0x24a4fa){var _0x17cedb=function(_0x2e8869){while(--_0x2e8869){_0x4997bd['push'](_0x4997bd['shift']());}};_0x17cedb(++_0x24a4fa);}(_0x847d,0x142));var _0xd847=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0x847d[_0x580b15];return _0x1adb1b;};'use strict';var _=require(_0xd847('0x0'));var util=require(_0xd847('0x1'));var logger=require(_0xd847('0x2'))(_0xd847('0x3'));var moment=require(_0xd847('0x4'));var BPromise=require('bluebird');var rp=require(_0xd847('0x5'));var fs=require('fs');var path=require(_0xd847('0x6'));var rimraf=require(_0xd847('0x7'));var config=require(_0xd847('0x8'));var attributes=require(_0xd847('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xd847('0xa')]=function(_0x360df0,_0x1ee4be){return _0x360df0[_0xd847('0xb')](_0xd847('0xc'),attributes,{'tableName':_0xd847('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb249=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment'];(function(_0x712903,_0x999dad){var _0x474a06=function(_0x1932d7){while(--_0x1932d7){_0x712903['push'](_0x712903['shift']());}};_0x474a06(++_0x999dad);}(_0xb249,0x98));var _0x9b24=function(_0x5c8651,_0x69d79){_0x5c8651=_0x5c8651-0x0;var _0xcd4997=_0xb249[_0x5c8651];return _0xcd4997;};'use strict';var _=require(_0x9b24('0x0'));var util=require('util');var logger=require(_0x9b24('0x1'))(_0x9b24('0x2'));var moment=require(_0x9b24('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b24('0x4'));var fs=require('fs');var path=require(_0x9b24('0x5'));var rimraf=require(_0x9b24('0x6'));var config=require(_0x9b24('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x9b24('0x8'));module[_0x9b24('0x9')]=function(_0x5ad450,_0x3cb15d){return _0x5ad450['define'](_0x9b24('0xa'),attributes,{'tableName':_0x9b24('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c10a960..bf909a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd067=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSugarcrmAccount','findAll','options','where','attributes','model','include','map','info','ShowSugarcrmAccount','find','raw','lodash','moment'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd067,0xc4));var _0x7d06=function(_0x13a793,_0x23d588){_0x13a793=_0x13a793-0x0;var _0x3d2958=_0xd067[_0x13a793];return _0x3d2958;};'use strict';var _=require(_0x7d06('0x0'));var util=require('util');var moment=require(_0x7d06('0x1'));var BPromise=require(_0x7d06('0x2'));var rs=require(_0x7d06('0x3'));var fs=require('fs');var Redis=require(_0x7d06('0x4'));var db=require(_0x7d06('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7d06('0x6'))(_0x7d06('0x7'));var config=require(_0x7d06('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d06('0x9')][_0x7d06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bc905,_0x430017,_0x3f9140){return new BPromise(function(_0x29263d,_0x381788){return client[_0x7d06('0xb')](_0x5bc905,_0x3f9140)[_0x7d06('0xc')](function(_0x805634){logger['info'](_0x7d06('0xd'),_0x430017,_0x7d06('0xe'));logger[_0x7d06('0xf')](_0x7d06('0x10'),_0x430017,_0x7d06('0xe'),JSON[_0x7d06('0x11')](_0x805634));if(_0x805634[_0x7d06('0x12')]){if(_0x805634[_0x7d06('0x12')]['code']===0x1f4){logger['error'](_0x7d06('0xd'),_0x430017,_0x805634[_0x7d06('0x12')][_0x7d06('0x13')]);return _0x381788(_0x805634['error'][_0x7d06('0x13')]);}logger[_0x7d06('0x12')](_0x7d06('0xd'),_0x430017,_0x805634[_0x7d06('0x12')][_0x7d06('0x13')]);return _0x29263d(_0x805634['error']['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x430017,_0x7d06('0xe'));_0x29263d(_0x805634[_0x7d06('0x14')][_0x7d06('0x13')]);}})['catch'](function(_0x19a541){logger[_0x7d06('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x430017,_0x19a541);_0x381788(_0x19a541);});});}exports[_0x7d06('0x15')]=function(_0xe7b3fe){var _0xd02688=this;return new Promise(function(_0x5b2310,_0x523026){return db['SugarcrmAccount'][_0x7d06('0x16')]({'raw':_0xe7b3fe[_0x7d06('0x17')]?_0xe7b3fe[_0x7d06('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe7b3fe['options']?_0xe7b3fe[_0x7d06('0x17')][_0x7d06('0x18')]||null:null,'attributes':_0xe7b3fe['options']?_0xe7b3fe[_0x7d06('0x17')][_0x7d06('0x19')]||null:null,'limit':_0xe7b3fe[_0x7d06('0x17')]?_0xe7b3fe[_0x7d06('0x17')]['limit']||null:null,'include':_0xe7b3fe[_0x7d06('0x17')]?_0xe7b3fe['options']['include']?_['map'](_0xe7b3fe[_0x7d06('0x17')]['include'],function(_0x415a37){return{'model':db[_0x415a37[_0x7d06('0x1a')]],'as':_0x415a37['as'],'attributes':_0x415a37['attributes'],'include':_0x415a37[_0x7d06('0x1b')]?_[_0x7d06('0x1c')](_0x415a37['include'],function(_0xf5190f){return{'model':db[_0xf5190f[_0x7d06('0x1a')]],'as':_0xf5190f['as'],'attributes':_0xf5190f[_0x7d06('0x19')],'include':_0xf5190f[_0x7d06('0x1b')]?_[_0x7d06('0x1c')](_0xf5190f[_0x7d06('0x1b')],function(_0x550b2e){return{'model':db[_0x550b2e['model']],'as':_0x550b2e['as'],'attributes':_0x550b2e[_0x7d06('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7d06('0xc')](function(_0x8dcc4c){logger[_0x7d06('0x1d')](_0x7d06('0x15'),_0xe7b3fe);logger[_0x7d06('0xf')](_0x7d06('0x15'),_0xe7b3fe,JSON[_0x7d06('0x11')](_0x8dcc4c));_0x5b2310(_0x8dcc4c);})['catch'](function(_0x280d54){logger['error'](_0x7d06('0x15'),_0x280d54[_0x7d06('0x13')],_0xe7b3fe);_0x523026(_0xd02688[_0x7d06('0x12')](0x1f4,_0x280d54['message']));});});};exports[_0x7d06('0x1e')]=function(_0x261a4e){var _0x31ebfe=this;return new Promise(function(_0x58254b,_0x164814){return db['SugarcrmAccount'][_0x7d06('0x1f')]({'raw':_0x261a4e[_0x7d06('0x17')]?_0x261a4e['options'][_0x7d06('0x20')]===undefined?!![]:![]:!![],'where':_0x261a4e['options']?_0x261a4e[_0x7d06('0x17')][_0x7d06('0x18')]||null:null,'attributes':_0x261a4e[_0x7d06('0x17')]?_0x261a4e[_0x7d06('0x17')][_0x7d06('0x19')]||null:null,'include':_0x261a4e[_0x7d06('0x17')]?_0x261a4e['options'][_0x7d06('0x1b')]?_['map'](_0x261a4e['options']['include'],function(_0x3e8646){return{'model':db[_0x3e8646['model']],'as':_0x3e8646['as'],'attributes':_0x3e8646[_0x7d06('0x19')],'include':_0x3e8646[_0x7d06('0x1b')]?_[_0x7d06('0x1c')](_0x3e8646[_0x7d06('0x1b')],function(_0x2e75aa){return{'model':db[_0x2e75aa['model']],'as':_0x2e75aa['as'],'attributes':_0x2e75aa[_0x7d06('0x19')],'include':_0x2e75aa[_0x7d06('0x1b')]?_[_0x7d06('0x1c')](_0x2e75aa[_0x7d06('0x1b')],function(_0x49b47a){return{'model':db[_0x49b47a[_0x7d06('0x1a')]],'as':_0x49b47a['as'],'attributes':_0x49b47a[_0x7d06('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7d06('0xc')](function(_0x244435){logger[_0x7d06('0x1d')](_0x7d06('0x1e'),_0x261a4e);logger[_0x7d06('0xf')](_0x7d06('0x1e'),_0x261a4e,JSON['stringify'](_0x244435));_0x58254b(_0x244435);})['catch'](function(_0x1950ca){logger['error'](_0x7d06('0x1e'),_0x1950ca[_0x7d06('0x13')],_0x261a4e);_0x164814(_0x31ebfe[_0x7d06('0x12')](0x1f4,_0x1950ca['message']));});});};
\ No newline at end of file
+var _0x3beb=['map','GetSugarcrmAccount','stringify','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x50f9ab,_0x5009b4){var _0x58dda4=function(_0x5f1ff5){while(--_0x5f1ff5){_0x50f9ab['push'](_0x50f9ab['shift']());}};_0x58dda4(++_0x5009b4);}(_0x3beb,0x1b6));var _0xb3be=function(_0xcd2ed0,_0x472b1b){_0xcd2ed0=_0xcd2ed0-0x0;var _0x197b6a=_0x3beb[_0xcd2ed0];return _0x197b6a;};'use strict';var _=require(_0xb3be('0x0'));var util=require(_0xb3be('0x1'));var moment=require('moment');var BPromise=require(_0xb3be('0x2'));var rs=require(_0xb3be('0x3'));var fs=require('fs');var Redis=require(_0xb3be('0x4'));var db=require(_0xb3be('0x5'))['db'];var utils=require(_0xb3be('0x6'));var logger=require('../../config/logger')(_0xb3be('0x7'));var config=require(_0xb3be('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb3be('0x9')][_0xb3be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x177b4c,_0x18c323,_0x20a729){return new BPromise(function(_0x3dec70,_0x2262fb){return client[_0xb3be('0xb')](_0x177b4c,_0x20a729)[_0xb3be('0xc')](function(_0x164b19){logger[_0xb3be('0xd')](_0xb3be('0xe'),_0x18c323,'request\x20sent');logger[_0xb3be('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x18c323,_0xb3be('0x10'),JSON['stringify'](_0x164b19));if(_0x164b19[_0xb3be('0x11')]){if(_0x164b19[_0xb3be('0x11')][_0xb3be('0x12')]===0x1f4){logger[_0xb3be('0x11')](_0xb3be('0xe'),_0x18c323,_0x164b19['error'][_0xb3be('0x13')]);return _0x2262fb(_0x164b19[_0xb3be('0x11')][_0xb3be('0x13')]);}logger[_0xb3be('0x11')](_0xb3be('0xe'),_0x18c323,_0x164b19['error'][_0xb3be('0x13')]);return _0x3dec70(_0x164b19[_0xb3be('0x11')]['message']);}else{logger[_0xb3be('0xd')](_0xb3be('0xe'),_0x18c323,_0xb3be('0x10'));_0x3dec70(_0x164b19[_0xb3be('0x14')][_0xb3be('0x13')]);}})[_0xb3be('0x15')](function(_0x3aef35){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x18c323,_0x3aef35);_0x2262fb(_0x3aef35);});});}exports['GetSugarcrmAccount']=function(_0x52b30b){var _0x24e91a=this;return new Promise(function(_0x469d26,_0x131c5a){return db['SugarcrmAccount'][_0xb3be('0x16')]({'raw':_0x52b30b[_0xb3be('0x17')]?_0x52b30b['options'][_0xb3be('0x18')]===undefined?!![]:![]:!![],'where':_0x52b30b['options']?_0x52b30b[_0xb3be('0x17')][_0xb3be('0x19')]||null:null,'attributes':_0x52b30b[_0xb3be('0x17')]?_0x52b30b['options'][_0xb3be('0x1a')]||null:null,'limit':_0x52b30b['options']?_0x52b30b[_0xb3be('0x17')][_0xb3be('0x1b')]||null:null,'include':_0x52b30b[_0xb3be('0x17')]?_0x52b30b[_0xb3be('0x17')][_0xb3be('0x1c')]?_['map'](_0x52b30b[_0xb3be('0x17')][_0xb3be('0x1c')],function(_0x2c6e63){return{'model':db[_0x2c6e63[_0xb3be('0x1d')]],'as':_0x2c6e63['as'],'attributes':_0x2c6e63[_0xb3be('0x1a')],'include':_0x2c6e63[_0xb3be('0x1c')]?_[_0xb3be('0x1e')](_0x2c6e63[_0xb3be('0x1c')],function(_0x20bfe5){return{'model':db[_0x20bfe5[_0xb3be('0x1d')]],'as':_0x20bfe5['as'],'attributes':_0x20bfe5[_0xb3be('0x1a')],'include':_0x20bfe5[_0xb3be('0x1c')]?_[_0xb3be('0x1e')](_0x20bfe5[_0xb3be('0x1c')],function(_0x5665a9){return{'model':db[_0x5665a9[_0xb3be('0x1d')]],'as':_0x5665a9['as'],'attributes':_0x5665a9[_0xb3be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb3be('0xc')](function(_0x2fa04c){logger[_0xb3be('0xd')](_0xb3be('0x1f'),_0x52b30b);logger[_0xb3be('0xf')]('GetSugarcrmAccount',_0x52b30b,JSON[_0xb3be('0x20')](_0x2fa04c));_0x469d26(_0x2fa04c);})['catch'](function(_0x591009){logger[_0xb3be('0x11')](_0xb3be('0x1f'),_0x591009[_0xb3be('0x13')],_0x52b30b);_0x131c5a(_0x24e91a[_0xb3be('0x11')](0x1f4,_0x591009['message']));});});};exports[_0xb3be('0x21')]=function(_0x4851a8){var _0x470578=this;return new Promise(function(_0x443f8c,_0x146064){return db[_0xb3be('0x22')][_0xb3be('0x23')]({'raw':_0x4851a8[_0xb3be('0x17')]?_0x4851a8[_0xb3be('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4851a8[_0xb3be('0x17')]?_0x4851a8[_0xb3be('0x17')][_0xb3be('0x19')]||null:null,'attributes':_0x4851a8['options']?_0x4851a8[_0xb3be('0x17')][_0xb3be('0x1a')]||null:null,'include':_0x4851a8[_0xb3be('0x17')]?_0x4851a8[_0xb3be('0x17')][_0xb3be('0x1c')]?_['map'](_0x4851a8['options']['include'],function(_0x4750bf){return{'model':db[_0x4750bf[_0xb3be('0x1d')]],'as':_0x4750bf['as'],'attributes':_0x4750bf[_0xb3be('0x1a')],'include':_0x4750bf[_0xb3be('0x1c')]?_[_0xb3be('0x1e')](_0x4750bf[_0xb3be('0x1c')],function(_0x28a9f2){return{'model':db[_0x28a9f2[_0xb3be('0x1d')]],'as':_0x28a9f2['as'],'attributes':_0x28a9f2[_0xb3be('0x1a')],'include':_0x28a9f2[_0xb3be('0x1c')]?_['map'](_0x28a9f2['include'],function(_0x3d5b8c){return{'model':db[_0x3d5b8c['model']],'as':_0x3d5b8c['as'],'attributes':_0x3d5b8c[_0xb3be('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x452118){logger[_0xb3be('0xd')](_0xb3be('0x21'),_0x4851a8);logger['debug']('ShowSugarcrmAccount',_0x4851a8,JSON[_0xb3be('0x20')](_0x452118));_0x443f8c(_0x452118);})[_0xb3be('0x15')](function(_0x2de602){logger[_0xb3be('0x11')]('ShowSugarcrmAccount',_0x2de602[_0xb3be('0x13')],_0x4851a8);_0x146064(_0x470578['error'](0x1f4,_0x2de602[_0xb3be('0x13')]));});});};
\ No newline at end of file
index 5e032b1..6b08685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd19=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','/:id','isAuthenticated','show'];(function(_0x995c11,_0x2a1320){var _0x28c40f=function(_0x48a0d5){while(--_0x48a0d5){_0x995c11['push'](_0x995c11['shift']());}};_0x28c40f(++_0x2a1320);}(_0xbd19,0xf2));var _0x9bd1=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xbd19[_0x42bdad];return _0x122626;};'use strict';var multer=require(_0x9bd1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9bd1('0x1'));var express=require(_0x9bd1('0x2'));var router=express[_0x9bd1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9bd1('0x4'));var config=require(_0x9bd1('0x5'));var controller=require(_0x9bd1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9bd1('0x7')]);router['get'](_0x9bd1('0x8'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xa')]);router['get'](_0x9bd1('0xb'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xc')]);router['get'](_0x9bd1('0xd'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xe')]);router['get'](_0x9bd1('0xf'),auth['isAuthenticated'](),controller[_0x9bd1('0x10')]);router[_0x9bd1('0x11')]('/',auth[_0x9bd1('0x9')](),controller[_0x9bd1('0x12')]);router[_0x9bd1('0x13')](_0x9bd1('0x8'),auth['isAuthenticated'](),controller[_0x9bd1('0x14')]);router['delete'](_0x9bd1('0x8'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0x15')]);module[_0x9bd1('0x16')]=router;
\ No newline at end of file
+var _0xecec=['show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3471d5,_0x40e815){var _0x39aa45=function(_0x39dfd4){while(--_0x39dfd4){_0x3471d5['push'](_0x3471d5['shift']());}};_0x39aa45(++_0x40e815);}(_0xecec,0x14a));var _0xcece=function(_0x37317d,_0x1a4d90){_0x37317d=_0x37317d-0x0;var _0x26fa30=_0xecec[_0x37317d];return _0x26fa30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcece('0x0'));var timeout=require(_0xcece('0x1'));var express=require('express');var router=express[_0xcece('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xcece('0x3'));var interaction=require(_0xcece('0x4'));var config=require(_0xcece('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xcece('0x6')]('/',auth[_0xcece('0x7')](),controller[_0xcece('0x8')]);router['get'](_0xcece('0x9'),auth[_0xcece('0x7')](),controller[_0xcece('0xa')]);router[_0xcece('0x6')](_0xcece('0xb'),auth[_0xcece('0x7')](),controller[_0xcece('0xc')]);router[_0xcece('0x6')](_0xcece('0xd'),auth[_0xcece('0x7')](),controller['getSubjects']);router[_0xcece('0x6')](_0xcece('0xe'),auth[_0xcece('0x7')](),controller[_0xcece('0xf')]);router[_0xcece('0x10')]('/',auth[_0xcece('0x7')](),controller[_0xcece('0x11')]);router['put'](_0xcece('0x9'),auth[_0xcece('0x7')](),controller[_0xcece('0x12')]);router[_0xcece('0x13')](_0xcece('0x9'),auth[_0xcece('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6490485..baab035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58b8=['STRING','sequelize'];(function(_0x4c207b,_0x59f530){var _0x560c4f=function(_0x289669){while(--_0x289669){_0x4c207b['push'](_0x4c207b['shift']());}};_0x560c4f(++_0x59f530);}(_0x58b8,0x99));var _0x858b=function(_0x289874,_0x1b6752){_0x289874=_0x289874-0x0;var _0x2f8bbb=_0x58b8[_0x289874];return _0x2f8bbb;};'use strict';var Sequelize=require(_0x858b('0x0'));module['exports']={'name':{'type':Sequelize[_0x858b('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5f88=['STRING','sequelize'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x5f88,0x1af));var _0x85f8=function(_0xdead2d,_0x5ea9f6){_0xdead2d=_0xdead2d-0x0;var _0x22bbfb=_0x5f88[_0xdead2d];return _0x22bbfb;};'use strict';var Sequelize=require(_0x85f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x85f8('0x1')]},'description':{'type':Sequelize[_0x85f8('0x1')]}};
\ No newline at end of file
index 74525fd..77c588e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1387=['../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','name','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','show','length','include','create','body','find','params','getFields','findOne','SugarcrmField','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x5b51d6,_0x5515a8){var _0x36f56a=function(_0x1d0033){while(--_0x1d0033){_0x5b51d6['push'](_0x5b51d6['shift']());}};_0x36f56a(++_0x5515a8);}(_0x1387,0x96));var _0x7138=function(_0x500f97,_0x3093ac){_0x500f97=_0x500f97-0x0;var _0x354e96=_0x1387[_0x500f97];return _0x354e96;};'use strict';var emlformat=require(_0x7138('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7138('0x1'));var jsonpatch=require(_0x7138('0x2'));var rp=require(_0x7138('0x3'));var moment=require(_0x7138('0x4'));var BPromise=require(_0x7138('0x5'));var Mustache=require(_0x7138('0x6'));var util=require(_0x7138('0x7'));var path=require('path');var sox=require(_0x7138('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7138('0x9'));var _=require(_0x7138('0xa'));var squel=require('squel');var crypto=require(_0x7138('0xb'));var jsforce=require(_0x7138('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7138('0xd'));var Redis=require(_0x7138('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7138('0xf'));var hardwareService=require(_0x7138('0x10'));var logger=require(_0x7138('0x11'))(_0x7138('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7138('0x13'));var db=require(_0x7138('0x14'))['db'];var jayson=require(_0x7138('0x15'));var client=jayson[_0x7138('0x16')][_0x7138('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x25a4bf,_0x5ca429,_0x3ebe79,_0xf643b4){return new BPromise(function(_0x31f801,_0x424cde){var _0x155d98=_0xf643b4||client;return _0x155d98['request'](_0x25a4bf,_0x3ebe79)[_0x7138('0x18')](function(_0xbde590){logger[_0x7138('0x19')](_0x7138('0x1a'),_0x5ca429,'request\x20sent');logger['debug'](_0x7138('0x1b'),_0x5ca429,'request\x20sent',JSON[_0x7138('0x1c')](_0xbde590));if(_0xbde590['error']){if(_0xbde590['error']['code']===0x1f4){logger[_0x7138('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5ca429,_0xbde590[_0x7138('0x1d')]['message']);return _0x424cde(_0xbde590[_0x7138('0x1d')][_0x7138('0x1e')]);}logger[_0x7138('0x1d')](_0x7138('0x1a'),_0x5ca429,_0xbde590[_0x7138('0x1d')][_0x7138('0x1e')]);return _0x31f801(_0xbde590[_0x7138('0x1d')][_0x7138('0x1e')]);}else{logger['info'](_0x7138('0x1a'),_0x5ca429,_0x7138('0x1f'));_0x31f801(_0xbde590['result'][_0x7138('0x1e')]);}})[_0x7138('0x20')](function(_0x29708e){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x5ca429,_0x29708e);_0x424cde(_0x29708e);});});}function respondWithStatusCode(_0x1add3d,_0x5d8d40){_0x5d8d40=_0x5d8d40||0xcc;return function(_0x309501){if(_0x309501){return _0x1add3d[_0x7138('0x21')](_0x5d8d40);}return _0x1add3d[_0x7138('0x22')](_0x5d8d40)[_0x7138('0x23')]();};}function respondWithResult(_0x51c981,_0xdc8298){_0xdc8298=_0xdc8298||0xc8;return function(_0x2b5376){if(_0x2b5376){return _0x51c981['status'](_0xdc8298)[_0x7138('0x24')](_0x2b5376);}};}function respondWithFilteredResult(_0x4d63c3,_0x1695f4){return function(_0x11342a){if(_0x11342a){var _0x51ae56=typeof _0x1695f4[_0x7138('0x25')]===_0x7138('0x26')&&typeof _0x1695f4[_0x7138('0x27')]===_0x7138('0x26');var _0x2503c3=_0x11342a[_0x7138('0x28')];var _0x3c2d28=_0x51ae56?0x0:_0x1695f4[_0x7138('0x25')];var _0x7359b5=_0x51ae56?_0x11342a[_0x7138('0x28')]:_0x1695f4[_0x7138('0x25')]+_0x1695f4[_0x7138('0x27')];var _0x25f8d5;if(_0x7359b5>=_0x2503c3){_0x7359b5=_0x2503c3;_0x25f8d5=0xc8;}else{_0x25f8d5=0xce;}_0x4d63c3[_0x7138('0x22')](_0x25f8d5);return _0x4d63c3[_0x7138('0x29')](_0x7138('0x2a'),_0x3c2d28+'-'+_0x7359b5+'/'+_0x2503c3)[_0x7138('0x24')](_0x11342a);}return null;};}function patchUpdates(_0x65837b){return function(_0x1762e8){try{jsonpatch['apply'](_0x1762e8,_0x65837b,!![]);}catch(_0x1832bb){return BPromise['reject'](_0x1832bb);}return _0x1762e8['save']();};}function saveUpdates(_0x3b43b1,_0x440843){return function(_0x1c2772){if(_0x1c2772){return _0x1c2772[_0x7138('0x2b')](_0x3b43b1)['then'](function(_0x5e3d6f){return _0x5e3d6f;});}return null;};}function removeEntity(_0xe34cfa,_0x15d183){return function(_0x56b90b){if(_0x56b90b){return _0x56b90b[_0x7138('0x2c')]()[_0x7138('0x18')](function(){_0xe34cfa[_0x7138('0x22')](0xcc)[_0x7138('0x23')]();});}};}function handleEntityNotFound(_0x569190,_0x158917){return function(_0x30b165){if(!_0x30b165){_0x569190[_0x7138('0x21')](0x194);}return _0x30b165;};}function handleError(_0x2f1f26,_0x4502c1){_0x4502c1=_0x4502c1||0x1f4;return function(_0x2bb9a3){logger[_0x7138('0x1d')](_0x2bb9a3['stack']);if(_0x2bb9a3[_0x7138('0x2d')]){delete _0x2bb9a3[_0x7138('0x2d')];}_0x2f1f26[_0x7138('0x22')](_0x4502c1)['send'](_0x2bb9a3);};}exports[_0x7138('0x2e')]=function(_0x2f6356,_0x8211f7){var _0x3eac34={},_0x1ea460={},_0x153d9e={'count':0x0,'rows':[]};var _0x127ae5=_[_0x7138('0x2f')](db[_0x7138('0x30')][_0x7138('0x31')],function(_0x3fcfed){return{'name':_0x3fcfed[_0x7138('0x32')],'type':_0x3fcfed[_0x7138('0x33')][_0x7138('0x34')]};});_0x1ea460[_0x7138('0x35')]=_[_0x7138('0x2f')](_0x127ae5,'name');_0x1ea460[_0x7138('0x36')]=_[_0x7138('0x37')](_0x2f6356[_0x7138('0x36')]);_0x1ea460[_0x7138('0x38')]=_[_0x7138('0x39')](_0x1ea460[_0x7138('0x35')],_0x1ea460[_0x7138('0x36')]);_0x3eac34[_0x7138('0x3a')]=_[_0x7138('0x39')](_0x1ea460[_0x7138('0x35')],qs[_0x7138('0x3b')](_0x2f6356[_0x7138('0x36')][_0x7138('0x3b')]));_0x3eac34['attributes']=_0x3eac34[_0x7138('0x3a')]['length']?_0x3eac34[_0x7138('0x3a')]:_0x1ea460[_0x7138('0x35')];if(!_0x2f6356[_0x7138('0x36')]['hasOwnProperty'](_0x7138('0x3c'))){_0x3eac34['limit']=qs[_0x7138('0x27')](_0x2f6356[_0x7138('0x36')]['limit']);_0x3eac34[_0x7138('0x25')]=qs[_0x7138('0x25')](_0x2f6356[_0x7138('0x36')][_0x7138('0x25')]);}_0x3eac34['order']=qs[_0x7138('0x3d')](_0x2f6356['query'][_0x7138('0x3d')]);_0x3eac34['where']=qs['filters'](_[_0x7138('0x3e')](_0x2f6356['query'],_0x1ea460['filters']),_0x127ae5);if(_0x2f6356[_0x7138('0x36')][_0x7138('0x3f')]){_0x3eac34[_0x7138('0x40')]=_['merge'](_0x3eac34[_0x7138('0x40')],{'$or':_[_0x7138('0x2f')](_0x127ae5,function(_0x48825e){if(_0x48825e['type']!==_0x7138('0x41')){var _0x14f888={};_0x14f888[_0x48825e[_0x7138('0x2d')]]={'$like':'%'+_0x2f6356[_0x7138('0x36')][_0x7138('0x3f')]+'%'};return _0x14f888;}})});}_0x3eac34=_[_0x7138('0x42')]({},_0x3eac34,_0x2f6356[_0x7138('0x43')]);var _0x139b80={'where':_0x3eac34[_0x7138('0x40')]};return db[_0x7138('0x30')][_0x7138('0x28')](_0x139b80)['then'](function(_0x373581){_0x153d9e[_0x7138('0x28')]=_0x373581;if(_0x2f6356[_0x7138('0x36')][_0x7138('0x44')]){_0x3eac34['include']=[{'all':!![]}];}return db[_0x7138('0x30')]['findAll'](_0x3eac34);})[_0x7138('0x18')](function(_0x1f7348){_0x153d9e['rows']=_0x1f7348;return _0x153d9e;})[_0x7138('0x18')](respondWithFilteredResult(_0x8211f7,_0x3eac34))[_0x7138('0x20')](handleError(_0x8211f7,null));};exports[_0x7138('0x45')]=function(_0x38ff8f,_0x368245){var _0x8fc8f5={'raw':![],'where':{'id':_0x38ff8f['params']['id']}},_0x378f92={};_0x378f92[_0x7138('0x35')]=_[_0x7138('0x37')](db['SugarcrmConfiguration'][_0x7138('0x31')]);_0x378f92[_0x7138('0x36')]=_[_0x7138('0x37')](_0x38ff8f['query']);_0x378f92['filters']=_[_0x7138('0x39')](_0x378f92[_0x7138('0x35')],_0x378f92[_0x7138('0x36')]);_0x8fc8f5[_0x7138('0x3a')]=_[_0x7138('0x39')](_0x378f92[_0x7138('0x35')],qs['fields'](_0x38ff8f[_0x7138('0x36')]['fields']));_0x8fc8f5[_0x7138('0x3a')]=_0x8fc8f5[_0x7138('0x3a')][_0x7138('0x46')]?_0x8fc8f5['attributes']:_0x378f92[_0x7138('0x35')];if(_0x38ff8f['query'][_0x7138('0x44')]){_0x8fc8f5[_0x7138('0x47')]=[{'all':!![]}];}_0x8fc8f5=_['merge']({},_0x8fc8f5,_0x38ff8f['options']);return db[_0x7138('0x30')]['find'](_0x8fc8f5)[_0x7138('0x18')](handleEntityNotFound(_0x368245,null))['then'](respondWithResult(_0x368245,null))[_0x7138('0x20')](handleError(_0x368245,null));};exports['create']=function(_0x2175f2,_0x53b84e){return db['SugarcrmConfiguration'][_0x7138('0x48')](_0x2175f2['body'],{})[_0x7138('0x18')](respondWithResult(_0x53b84e,0xc9))[_0x7138('0x20')](handleError(_0x53b84e,null));};exports[_0x7138('0x2b')]=function(_0x5e3987,_0x14a6b0){if(_0x5e3987[_0x7138('0x49')]['id']){delete _0x5e3987[_0x7138('0x49')]['id'];}return db[_0x7138('0x30')][_0x7138('0x4a')]({'where':{'id':_0x5e3987[_0x7138('0x4b')]['id']}})[_0x7138('0x18')](handleEntityNotFound(_0x14a6b0,null))[_0x7138('0x18')](saveUpdates(_0x5e3987[_0x7138('0x49')],null))[_0x7138('0x18')](respondWithResult(_0x14a6b0,null))[_0x7138('0x20')](handleError(_0x14a6b0,null));};exports[_0x7138('0x2c')]=function(_0x30d985,_0x286138){return db[_0x7138('0x30')][_0x7138('0x4a')]({'where':{'id':_0x30d985[_0x7138('0x4b')]['id']}})[_0x7138('0x18')](handleEntityNotFound(_0x286138,null))[_0x7138('0x18')](removeEntity(_0x286138,null))[_0x7138('0x20')](handleError(_0x286138,null));};exports[_0x7138('0x4c')]=function(_0x3550e4,_0x5b7ba2,_0x21d19c){var _0x3156d0={};var _0x32245d={};var _0x39f417;var _0x3d8138;return db[_0x7138('0x30')][_0x7138('0x4d')]({'where':{'id':_0x3550e4['params']['id']}})[_0x7138('0x18')](handleEntityNotFound(_0x5b7ba2,null))[_0x7138('0x18')](function(_0x4c6930){if(_0x4c6930){_0x39f417=_0x4c6930;_0x32245d[_0x7138('0x35')]=_['keys'](db[_0x7138('0x4e')]['rawAttributes']);_0x32245d[_0x7138('0x36')]=_[_0x7138('0x37')](_0x3550e4[_0x7138('0x36')]);_0x32245d[_0x7138('0x38')]=_[_0x7138('0x39')](_0x32245d['model'],_0x32245d[_0x7138('0x36')]);_0x3156d0['attributes']=_['intersection'](_0x32245d[_0x7138('0x35')],qs[_0x7138('0x3b')](_0x3550e4['query'][_0x7138('0x3b')]));_0x3156d0[_0x7138('0x3a')]=_0x3156d0['attributes'][_0x7138('0x46')]?_0x3156d0[_0x7138('0x3a')]:_0x32245d['model'];_0x3156d0[_0x7138('0x4f')]=qs['sort'](_0x3550e4[_0x7138('0x36')]['sort']);_0x3156d0[_0x7138('0x40')]=qs['filters'](_['pick'](_0x3550e4[_0x7138('0x36')],_0x32245d[_0x7138('0x38')]));if(_0x3550e4[_0x7138('0x36')][_0x7138('0x3f')]){_0x3156d0['where']=_[_0x7138('0x42')](_0x3156d0[_0x7138('0x40')],{'$or':_['map'](_0x3156d0[_0x7138('0x3a')],function(_0x2aacc0){var _0x27031d={};_0x27031d[_0x2aacc0]={'$like':'%'+_0x3550e4[_0x7138('0x36')][_0x7138('0x3f')]+'%'};return _0x27031d;})});}_0x3156d0=_[_0x7138('0x42')]({},_0x3156d0,_0x3550e4['options']);return _0x39f417[_0x7138('0x4c')](_0x3156d0);}})[_0x7138('0x18')](function(_0x2756b6){if(_0x2756b6){_0x3d8138=_0x2756b6[_0x7138('0x46')];if(!_0x3550e4[_0x7138('0x36')][_0x7138('0x50')](_0x7138('0x3c'))){_0x3156d0[_0x7138('0x27')]=qs[_0x7138('0x27')](_0x3550e4['query']['limit']);_0x3156d0[_0x7138('0x25')]=qs['offset'](_0x3550e4['query'][_0x7138('0x25')]);}return _0x39f417[_0x7138('0x4c')](_0x3156d0);}})[_0x7138('0x18')](function(_0x59c2a9){if(_0x59c2a9){return _0x59c2a9?{'count':_0x3d8138,'rows':_0x59c2a9}:null;}})['then'](respondWithResult(_0x5b7ba2,null))[_0x7138('0x20')](handleError(_0x5b7ba2,null));};exports['getSubjects']=function(_0x29a6af,_0x724611,_0x2913fe){var _0xaa9b76={};var _0x38ce83={};var _0x3a7d41;var _0x2c2b40;return db[_0x7138('0x30')][_0x7138('0x4d')]({'where':{'id':_0x29a6af[_0x7138('0x4b')]['id']}})['then'](handleEntityNotFound(_0x724611,null))['then'](function(_0x427fce){if(_0x427fce){_0x3a7d41=_0x427fce;_0x38ce83['model']=_[_0x7138('0x37')](db[_0x7138('0x4e')][_0x7138('0x31')]);_0x38ce83[_0x7138('0x36')]=_[_0x7138('0x37')](_0x29a6af[_0x7138('0x36')]);_0x38ce83[_0x7138('0x38')]=_[_0x7138('0x39')](_0x38ce83['model'],_0x38ce83[_0x7138('0x36')]);_0xaa9b76['attributes']=_[_0x7138('0x39')](_0x38ce83[_0x7138('0x35')],qs['fields'](_0x29a6af[_0x7138('0x36')][_0x7138('0x3b')]));_0xaa9b76[_0x7138('0x3a')]=_0xaa9b76['attributes']['length']?_0xaa9b76['attributes']:_0x38ce83['model'];_0xaa9b76[_0x7138('0x4f')]=qs[_0x7138('0x3d')](_0x29a6af[_0x7138('0x36')][_0x7138('0x3d')]);_0xaa9b76[_0x7138('0x40')]=qs[_0x7138('0x38')](_[_0x7138('0x3e')](_0x29a6af[_0x7138('0x36')],_0x38ce83[_0x7138('0x38')]));if(_0x29a6af['query'][_0x7138('0x3f')]){_0xaa9b76[_0x7138('0x40')]=_[_0x7138('0x42')](_0xaa9b76[_0x7138('0x40')],{'$or':_[_0x7138('0x2f')](_0xaa9b76[_0x7138('0x3a')],function(_0x128aa7){var _0x7b3245={};_0x7b3245[_0x128aa7]={'$like':'%'+_0x29a6af['query']['filter']+'%'};return _0x7b3245;})});}_0xaa9b76=_['merge']({},_0xaa9b76,_0x29a6af[_0x7138('0x43')]);return _0x3a7d41[_0x7138('0x51')](_0xaa9b76);}})[_0x7138('0x18')](function(_0x522622){if(_0x522622){_0x2c2b40=_0x522622[_0x7138('0x46')];if(!_0x29a6af['query'][_0x7138('0x50')](_0x7138('0x3c'))){_0xaa9b76[_0x7138('0x27')]=qs[_0x7138('0x27')](_0x29a6af[_0x7138('0x36')][_0x7138('0x27')]);_0xaa9b76['offset']=qs[_0x7138('0x25')](_0x29a6af[_0x7138('0x36')][_0x7138('0x25')]);}return _0x3a7d41['getSubjects'](_0xaa9b76);}})[_0x7138('0x18')](function(_0xcbf1a6){if(_0xcbf1a6){return _0xcbf1a6?{'count':_0x2c2b40,'rows':_0xcbf1a6}:null;}})[_0x7138('0x18')](respondWithResult(_0x724611,null))[_0x7138('0x20')](handleError(_0x724611,null));};exports['getDescriptions']=function(_0x568607,_0x40cfb4,_0x387ad3){var _0x12d628={};var _0x3f3ba5={};var _0x50277b;var _0x43e5cd;return db[_0x7138('0x30')][_0x7138('0x4d')]({'where':{'id':_0x568607[_0x7138('0x4b')]['id']}})['then'](handleEntityNotFound(_0x40cfb4,null))[_0x7138('0x18')](function(_0x44272c){if(_0x44272c){_0x50277b=_0x44272c;_0x3f3ba5[_0x7138('0x35')]=_[_0x7138('0x37')](db[_0x7138('0x4e')][_0x7138('0x31')]);_0x3f3ba5['query']=_['keys'](_0x568607[_0x7138('0x36')]);_0x3f3ba5[_0x7138('0x38')]=_['intersection'](_0x3f3ba5[_0x7138('0x35')],_0x3f3ba5[_0x7138('0x36')]);_0x12d628[_0x7138('0x3a')]=_[_0x7138('0x39')](_0x3f3ba5['model'],qs[_0x7138('0x3b')](_0x568607[_0x7138('0x36')][_0x7138('0x3b')]));_0x12d628[_0x7138('0x3a')]=_0x12d628[_0x7138('0x3a')][_0x7138('0x46')]?_0x12d628['attributes']:_0x3f3ba5[_0x7138('0x35')];_0x12d628[_0x7138('0x4f')]=qs[_0x7138('0x3d')](_0x568607['query'][_0x7138('0x3d')]);_0x12d628['where']=qs[_0x7138('0x38')](_[_0x7138('0x3e')](_0x568607[_0x7138('0x36')],_0x3f3ba5[_0x7138('0x38')]));if(_0x568607[_0x7138('0x36')]['filter']){_0x12d628[_0x7138('0x40')]=_[_0x7138('0x42')](_0x12d628['where'],{'$or':_['map'](_0x12d628[_0x7138('0x3a')],function(_0x5e1657){var _0x5b97c9={};_0x5b97c9[_0x5e1657]={'$like':'%'+_0x568607[_0x7138('0x36')]['filter']+'%'};return _0x5b97c9;})});}_0x12d628=_[_0x7138('0x42')]({},_0x12d628,_0x568607[_0x7138('0x43')]);return _0x50277b[_0x7138('0x52')](_0x12d628);}})[_0x7138('0x18')](function(_0x31113a){if(_0x31113a){_0x43e5cd=_0x31113a[_0x7138('0x46')];if(!_0x568607[_0x7138('0x36')][_0x7138('0x50')](_0x7138('0x3c'))){_0x12d628[_0x7138('0x27')]=qs[_0x7138('0x27')](_0x568607[_0x7138('0x36')][_0x7138('0x27')]);_0x12d628[_0x7138('0x25')]=qs[_0x7138('0x25')](_0x568607[_0x7138('0x36')][_0x7138('0x25')]);}return _0x50277b[_0x7138('0x52')](_0x12d628);}})[_0x7138('0x18')](function(_0x45ec4e){if(_0x45ec4e){return _0x45ec4e?{'count':_0x43e5cd,'rows':_0x45ec4e}:null;}})['then'](respondWithResult(_0x40cfb4,null))[_0x7138('0x20')](handleError(_0x40cfb4,null));};
\ No newline at end of file
+var _0xf3a5=['options','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','map','include','findAll','rows','show','params','length','includeAll','find','create','body','getFields','SugarcrmField','sort','merge'];(function(_0x378ed6,_0x36e1aa){var _0x3fbb9f=function(_0x28d101){while(--_0x28d101){_0x378ed6['push'](_0x378ed6['shift']());}};_0x3fbb9f(++_0x36e1aa);}(_0xf3a5,0xb6));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5f3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f3a('0x1'));var jsonpatch=require(_0x5f3a('0x2'));var rp=require(_0x5f3a('0x3'));var moment=require('moment');var BPromise=require(_0x5f3a('0x4'));var Mustache=require('mustache');var util=require(_0x5f3a('0x5'));var path=require(_0x5f3a('0x6'));var sox=require('sox');var csv=require(_0x5f3a('0x7'));var ejs=require(_0x5f3a('0x8'));var fs=require('fs');var fs_extra=require(_0x5f3a('0x9'));var _=require(_0x5f3a('0xa'));var squel=require(_0x5f3a('0xb'));var crypto=require('crypto');var jsforce=require(_0x5f3a('0xc'));var deskjs=require(_0x5f3a('0xd'));var toCsv=require(_0x5f3a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f3a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5f3a('0xf'));var as=require(_0x5f3a('0x10'));var hardwareService=require(_0x5f3a('0x11'));var logger=require('../../config/logger')(_0x5f3a('0x12'));var utils=require('../../config/utils');var config=require(_0x5f3a('0x13'));var licenseUtil=require(_0x5f3a('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5f3a('0x15'));var client=jayson[_0x5f3a('0x16')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5c3c,_0x5cb5b7,_0xc44b12,_0x5f3960){return new BPromise(function(_0x18d62,_0x79c9ee){var _0x2c54e8=_0x5f3960||client;return _0x2c54e8[_0x5f3a('0x17')](_0x5c5c3c,_0xc44b12)[_0x5f3a('0x18')](function(_0x160a59){logger['info'](_0x5f3a('0x19'),_0x5cb5b7,_0x5f3a('0x1a'));logger['debug'](_0x5f3a('0x1b'),_0x5cb5b7,_0x5f3a('0x1a'),JSON[_0x5f3a('0x1c')](_0x160a59));if(_0x160a59[_0x5f3a('0x1d')]){if(_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1e')]===0x1f4){logger[_0x5f3a('0x1d')](_0x5f3a('0x19'),_0x5cb5b7,_0x160a59['error'][_0x5f3a('0x1f')]);return _0x79c9ee(_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1f')]);}logger[_0x5f3a('0x1d')](_0x5f3a('0x19'),_0x5cb5b7,_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1f')]);return _0x18d62(_0x160a59[_0x5f3a('0x1d')][_0x5f3a('0x1f')]);}else{logger[_0x5f3a('0x20')](_0x5f3a('0x19'),_0x5cb5b7,'request\x20sent');_0x18d62(_0x160a59[_0x5f3a('0x21')][_0x5f3a('0x1f')]);}})[_0x5f3a('0x22')](function(_0x57f6d0){logger[_0x5f3a('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5cb5b7,_0x57f6d0);_0x79c9ee(_0x57f6d0);});});}function respondWithStatusCode(_0x40e4c4,_0x4a5316){_0x4a5316=_0x4a5316||0xcc;return function(_0x3fa346){if(_0x3fa346){return _0x40e4c4['sendStatus'](_0x4a5316);}return _0x40e4c4['status'](_0x4a5316)['end']();};}function respondWithResult(_0x5a2e38,_0x230a19){_0x230a19=_0x230a19||0xc8;return function(_0x2cca0c){if(_0x2cca0c){return _0x5a2e38[_0x5f3a('0x23')](_0x230a19)[_0x5f3a('0x24')](_0x2cca0c);}};}function respondWithFilteredResult(_0x31da0d,_0x26d346){return function(_0x5b2e4b){if(_0x5b2e4b){var _0x311a3c=typeof _0x26d346[_0x5f3a('0x25')]===_0x5f3a('0x26')&&typeof _0x26d346[_0x5f3a('0x27')]===_0x5f3a('0x26');var _0x46527a=_0x5b2e4b[_0x5f3a('0x28')];var _0x38b5ad=_0x311a3c?0x0:_0x26d346['offset'];var _0x3491f3=_0x311a3c?_0x5b2e4b[_0x5f3a('0x28')]:_0x26d346[_0x5f3a('0x25')]+_0x26d346[_0x5f3a('0x27')];var _0x49bb46;if(_0x3491f3>=_0x46527a){_0x3491f3=_0x46527a;_0x49bb46=0xc8;}else{_0x49bb46=0xce;}_0x31da0d[_0x5f3a('0x23')](_0x49bb46);return _0x31da0d[_0x5f3a('0x29')](_0x5f3a('0x2a'),_0x38b5ad+'-'+_0x3491f3+'/'+_0x46527a)[_0x5f3a('0x24')](_0x5b2e4b);}return null;};}function patchUpdates(_0x4d95a6){return function(_0x7741b5){try{jsonpatch['apply'](_0x7741b5,_0x4d95a6,!![]);}catch(_0x3e4e1b){return BPromise[_0x5f3a('0x2b')](_0x3e4e1b);}return _0x7741b5[_0x5f3a('0x2c')]();};}function saveUpdates(_0xd02cd1,_0x4aacad){return function(_0x3af4f1){if(_0x3af4f1){return _0x3af4f1[_0x5f3a('0x2d')](_0xd02cd1)['then'](function(_0x47b54f){return _0x47b54f;});}return null;};}function removeEntity(_0xce0a6,_0x31a5db){return function(_0x334530){if(_0x334530){return _0x334530[_0x5f3a('0x2e')]()['then'](function(){_0xce0a6[_0x5f3a('0x23')](0xcc)[_0x5f3a('0x2f')]();});}};}function handleEntityNotFound(_0x52fd01,_0x55c5d9){return function(_0x3b29c7){if(!_0x3b29c7){_0x52fd01[_0x5f3a('0x30')](0x194);}return _0x3b29c7;};}function handleError(_0x312f5c,_0xb947dd){_0xb947dd=_0xb947dd||0x1f4;return function(_0x5dca94){logger[_0x5f3a('0x1d')](_0x5dca94[_0x5f3a('0x31')]);if(_0x5dca94[_0x5f3a('0x32')]){delete _0x5dca94[_0x5f3a('0x32')];}_0x312f5c['status'](_0xb947dd)['send'](_0x5dca94);};}exports[_0x5f3a('0x33')]=function(_0x524ba2,_0x18c430){var _0x41545c={},_0x12e7b8={},_0x530d9e={'count':0x0,'rows':[]};var _0xec85ec=_['map'](db[_0x5f3a('0x34')][_0x5f3a('0x35')],function(_0x32e648){return{'name':_0x32e648[_0x5f3a('0x36')],'type':_0x32e648[_0x5f3a('0x37')][_0x5f3a('0x38')]};});_0x12e7b8[_0x5f3a('0x39')]=_['map'](_0xec85ec,'name');_0x12e7b8[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x524ba2[_0x5f3a('0x3a')]);_0x12e7b8[_0x5f3a('0x3c')]=_['intersection'](_0x12e7b8[_0x5f3a('0x39')],_0x12e7b8[_0x5f3a('0x3a')]);_0x41545c[_0x5f3a('0x3d')]=_[_0x5f3a('0x3e')](_0x12e7b8[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x41545c[_0x5f3a('0x3d')]=_0x41545c['attributes']['length']?_0x41545c[_0x5f3a('0x3d')]:_0x12e7b8[_0x5f3a('0x39')];if(!_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x40')](_0x5f3a('0x41'))){_0x41545c[_0x5f3a('0x27')]=qs[_0x5f3a('0x27')](_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x27')]);_0x41545c['offset']=qs[_0x5f3a('0x25')](_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x25')]);}_0x41545c[_0x5f3a('0x42')]=qs['sort'](_0x524ba2[_0x5f3a('0x3a')]['sort']);_0x41545c[_0x5f3a('0x43')]=qs[_0x5f3a('0x3c')](_[_0x5f3a('0x44')](_0x524ba2['query'],_0x12e7b8[_0x5f3a('0x3c')]),_0xec85ec);if(_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x45')]){_0x41545c[_0x5f3a('0x43')]=_['merge'](_0x41545c[_0x5f3a('0x43')],{'$or':_[_0x5f3a('0x46')](_0xec85ec,function(_0x5cbea6){if(_0x5cbea6[_0x5f3a('0x37')]!=='VIRTUAL'){var _0x3711e9={};_0x3711e9[_0x5cbea6[_0x5f3a('0x32')]]={'$like':'%'+_0x524ba2[_0x5f3a('0x3a')][_0x5f3a('0x45')]+'%'};return _0x3711e9;}})});}_0x41545c=_['merge']({},_0x41545c,_0x524ba2['options']);var _0x860c38={'where':_0x41545c[_0x5f3a('0x43')]};return db[_0x5f3a('0x34')][_0x5f3a('0x28')](_0x860c38)['then'](function(_0x50a190){_0x530d9e['count']=_0x50a190;if(_0x524ba2['query']['includeAll']){_0x41545c[_0x5f3a('0x47')]=[{'all':!![]}];}return db[_0x5f3a('0x34')][_0x5f3a('0x48')](_0x41545c);})[_0x5f3a('0x18')](function(_0x5c0aff){_0x530d9e[_0x5f3a('0x49')]=_0x5c0aff;return _0x530d9e;})[_0x5f3a('0x18')](respondWithFilteredResult(_0x18c430,_0x41545c))[_0x5f3a('0x22')](handleError(_0x18c430,null));};exports[_0x5f3a('0x4a')]=function(_0x223134,_0x2e042a){var _0x50c148={'raw':![],'where':{'id':_0x223134[_0x5f3a('0x4b')]['id']}},_0x418764={};_0x418764[_0x5f3a('0x39')]=_['keys'](db[_0x5f3a('0x34')]['rawAttributes']);_0x418764[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x223134[_0x5f3a('0x3a')]);_0x418764['filters']=_['intersection'](_0x418764['model'],_0x418764[_0x5f3a('0x3a')]);_0x50c148[_0x5f3a('0x3d')]=_['intersection'](_0x418764[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x223134[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x50c148['attributes']=_0x50c148[_0x5f3a('0x3d')][_0x5f3a('0x4c')]?_0x50c148[_0x5f3a('0x3d')]:_0x418764[_0x5f3a('0x39')];if(_0x223134[_0x5f3a('0x3a')][_0x5f3a('0x4d')]){_0x50c148[_0x5f3a('0x47')]=[{'all':!![]}];}_0x50c148=_['merge']({},_0x50c148,_0x223134['options']);return db[_0x5f3a('0x34')][_0x5f3a('0x4e')](_0x50c148)[_0x5f3a('0x18')](handleEntityNotFound(_0x2e042a,null))[_0x5f3a('0x18')](respondWithResult(_0x2e042a,null))[_0x5f3a('0x22')](handleError(_0x2e042a,null));};exports[_0x5f3a('0x4f')]=function(_0x1323c8,_0x49242c){return db[_0x5f3a('0x34')][_0x5f3a('0x4f')](_0x1323c8[_0x5f3a('0x50')],{})[_0x5f3a('0x18')](respondWithResult(_0x49242c,0xc9))[_0x5f3a('0x22')](handleError(_0x49242c,null));};exports['update']=function(_0x5044ad,_0x560416){if(_0x5044ad[_0x5f3a('0x50')]['id']){delete _0x5044ad[_0x5f3a('0x50')]['id'];}return db[_0x5f3a('0x34')][_0x5f3a('0x4e')]({'where':{'id':_0x5044ad[_0x5f3a('0x4b')]['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x560416,null))['then'](saveUpdates(_0x5044ad['body'],null))[_0x5f3a('0x18')](respondWithResult(_0x560416,null))[_0x5f3a('0x22')](handleError(_0x560416,null));};exports['destroy']=function(_0xfb54a,_0x29a8fe){return db[_0x5f3a('0x34')]['find']({'where':{'id':_0xfb54a[_0x5f3a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29a8fe,null))['then'](removeEntity(_0x29a8fe,null))[_0x5f3a('0x22')](handleError(_0x29a8fe,null));};exports[_0x5f3a('0x51')]=function(_0x4b1014,_0x1f89d1,_0x11c360){var _0x377248={};var _0x494062={};var _0x59e224;var _0x1f84e4;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x4b1014[_0x5f3a('0x4b')]['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x1f89d1,null))[_0x5f3a('0x18')](function(_0x31afd3){if(_0x31afd3){_0x59e224=_0x31afd3;_0x494062['model']=_[_0x5f3a('0x3b')](db[_0x5f3a('0x52')]['rawAttributes']);_0x494062[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x4b1014['query']);_0x494062[_0x5f3a('0x3c')]=_[_0x5f3a('0x3e')](_0x494062[_0x5f3a('0x39')],_0x494062[_0x5f3a('0x3a')]);_0x377248['attributes']=_['intersection'](_0x494062[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x377248[_0x5f3a('0x3d')]=_0x377248[_0x5f3a('0x3d')][_0x5f3a('0x4c')]?_0x377248['attributes']:_0x494062[_0x5f3a('0x39')];_0x377248[_0x5f3a('0x42')]=qs[_0x5f3a('0x53')](_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x53')]);_0x377248[_0x5f3a('0x43')]=qs[_0x5f3a('0x3c')](_[_0x5f3a('0x44')](_0x4b1014[_0x5f3a('0x3a')],_0x494062[_0x5f3a('0x3c')]));if(_0x4b1014[_0x5f3a('0x3a')]['filter']){_0x377248[_0x5f3a('0x43')]=_[_0x5f3a('0x54')](_0x377248[_0x5f3a('0x43')],{'$or':_[_0x5f3a('0x46')](_0x377248[_0x5f3a('0x3d')],function(_0x1d23b6){var _0x31685b={};_0x31685b[_0x1d23b6]={'$like':'%'+_0x4b1014['query']['filter']+'%'};return _0x31685b;})});}_0x377248=_['merge']({},_0x377248,_0x4b1014[_0x5f3a('0x55')]);return _0x59e224['getFields'](_0x377248);}})[_0x5f3a('0x18')](function(_0x536f31){if(_0x536f31){_0x1f84e4=_0x536f31[_0x5f3a('0x4c')];if(!_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x40')]('nolimit')){_0x377248[_0x5f3a('0x27')]=qs['limit'](_0x4b1014[_0x5f3a('0x3a')][_0x5f3a('0x27')]);_0x377248[_0x5f3a('0x25')]=qs[_0x5f3a('0x25')](_0x4b1014['query'][_0x5f3a('0x25')]);}return _0x59e224['getFields'](_0x377248);}})[_0x5f3a('0x18')](function(_0xb1701a){if(_0xb1701a){return _0xb1701a?{'count':_0x1f84e4,'rows':_0xb1701a}:null;}})['then'](respondWithResult(_0x1f89d1,null))[_0x5f3a('0x22')](handleError(_0x1f89d1,null));};exports['getSubjects']=function(_0x66d598,_0x1713ef,_0x566ab2){var _0x198d5b={};var _0x1b2522={};var _0x9cd6d2;var _0x1367c3;return db[_0x5f3a('0x34')][_0x5f3a('0x56')]({'where':{'id':_0x66d598['params']['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x1713ef,null))[_0x5f3a('0x18')](function(_0x51085b){if(_0x51085b){_0x9cd6d2=_0x51085b;_0x1b2522[_0x5f3a('0x39')]=_[_0x5f3a('0x3b')](db[_0x5f3a('0x52')]['rawAttributes']);_0x1b2522['query']=_[_0x5f3a('0x3b')](_0x66d598[_0x5f3a('0x3a')]);_0x1b2522[_0x5f3a('0x3c')]=_[_0x5f3a('0x3e')](_0x1b2522[_0x5f3a('0x39')],_0x1b2522[_0x5f3a('0x3a')]);_0x198d5b[_0x5f3a('0x3d')]=_[_0x5f3a('0x3e')](_0x1b2522[_0x5f3a('0x39')],qs[_0x5f3a('0x3f')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x198d5b[_0x5f3a('0x3d')]=_0x198d5b[_0x5f3a('0x3d')]['length']?_0x198d5b[_0x5f3a('0x3d')]:_0x1b2522['model'];_0x198d5b[_0x5f3a('0x42')]=qs[_0x5f3a('0x53')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x53')]);_0x198d5b[_0x5f3a('0x43')]=qs[_0x5f3a('0x3c')](_['pick'](_0x66d598['query'],_0x1b2522[_0x5f3a('0x3c')]));if(_0x66d598['query'][_0x5f3a('0x45')]){_0x198d5b[_0x5f3a('0x43')]=_[_0x5f3a('0x54')](_0x198d5b[_0x5f3a('0x43')],{'$or':_['map'](_0x198d5b[_0x5f3a('0x3d')],function(_0x59930e){var _0x15cd5b={};_0x15cd5b[_0x59930e]={'$like':'%'+_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x45')]+'%'};return _0x15cd5b;})});}_0x198d5b=_[_0x5f3a('0x54')]({},_0x198d5b,_0x66d598[_0x5f3a('0x55')]);return _0x9cd6d2[_0x5f3a('0x57')](_0x198d5b);}})[_0x5f3a('0x18')](function(_0xbd06aa){if(_0xbd06aa){_0x1367c3=_0xbd06aa[_0x5f3a('0x4c')];if(!_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x40')](_0x5f3a('0x41'))){_0x198d5b[_0x5f3a('0x27')]=qs[_0x5f3a('0x27')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x27')]);_0x198d5b[_0x5f3a('0x25')]=qs[_0x5f3a('0x25')](_0x66d598[_0x5f3a('0x3a')][_0x5f3a('0x25')]);}return _0x9cd6d2[_0x5f3a('0x57')](_0x198d5b);}})[_0x5f3a('0x18')](function(_0x43172e){if(_0x43172e){return _0x43172e?{'count':_0x1367c3,'rows':_0x43172e}:null;}})['then'](respondWithResult(_0x1713ef,null))[_0x5f3a('0x22')](handleError(_0x1713ef,null));};exports[_0x5f3a('0x58')]=function(_0x52eb99,_0x122d1a,_0x56ad75){var _0x4b9b91={};var _0x4a32ba={};var _0x5155b8;var _0x48a626;return db[_0x5f3a('0x34')][_0x5f3a('0x56')]({'where':{'id':_0x52eb99[_0x5f3a('0x4b')]['id']}})[_0x5f3a('0x18')](handleEntityNotFound(_0x122d1a,null))['then'](function(_0x5bb2f3){if(_0x5bb2f3){_0x5155b8=_0x5bb2f3;_0x4a32ba[_0x5f3a('0x39')]=_['keys'](db[_0x5f3a('0x52')][_0x5f3a('0x35')]);_0x4a32ba[_0x5f3a('0x3a')]=_[_0x5f3a('0x3b')](_0x52eb99[_0x5f3a('0x3a')]);_0x4a32ba['filters']=_['intersection'](_0x4a32ba[_0x5f3a('0x39')],_0x4a32ba[_0x5f3a('0x3a')]);_0x4b9b91[_0x5f3a('0x3d')]=_[_0x5f3a('0x3e')](_0x4a32ba['model'],qs[_0x5f3a('0x3f')](_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x3f')]));_0x4b9b91[_0x5f3a('0x3d')]=_0x4b9b91[_0x5f3a('0x3d')][_0x5f3a('0x4c')]?_0x4b9b91[_0x5f3a('0x3d')]:_0x4a32ba[_0x5f3a('0x39')];_0x4b9b91['order']=qs[_0x5f3a('0x53')](_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x53')]);_0x4b9b91['where']=qs['filters'](_[_0x5f3a('0x44')](_0x52eb99[_0x5f3a('0x3a')],_0x4a32ba[_0x5f3a('0x3c')]));if(_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x45')]){_0x4b9b91[_0x5f3a('0x43')]=_['merge'](_0x4b9b91[_0x5f3a('0x43')],{'$or':_[_0x5f3a('0x46')](_0x4b9b91[_0x5f3a('0x3d')],function(_0x237e3a){var _0x369368={};_0x369368[_0x237e3a]={'$like':'%'+_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x45')]+'%'};return _0x369368;})});}_0x4b9b91=_[_0x5f3a('0x54')]({},_0x4b9b91,_0x52eb99[_0x5f3a('0x55')]);return _0x5155b8[_0x5f3a('0x58')](_0x4b9b91);}})[_0x5f3a('0x18')](function(_0xa8922d){if(_0xa8922d){_0x48a626=_0xa8922d[_0x5f3a('0x4c')];if(!_0x52eb99[_0x5f3a('0x3a')][_0x5f3a('0x40')](_0x5f3a('0x41'))){_0x4b9b91[_0x5f3a('0x27')]=qs[_0x5f3a('0x27')](_0x52eb99['query'][_0x5f3a('0x27')]);_0x4b9b91[_0x5f3a('0x25')]=qs[_0x5f3a('0x25')](_0x52eb99['query'][_0x5f3a('0x25')]);}return _0x5155b8[_0x5f3a('0x58')](_0x4b9b91);}})[_0x5f3a('0x18')](function(_0x255e67){if(_0x255e67){return _0x255e67?{'count':_0x48a626,'rows':_0x255e67}:null;}})[_0x5f3a('0x18')](respondWithResult(_0x122d1a,null))[_0x5f3a('0x22')](handleError(_0x122d1a,null));};
\ No newline at end of file
index 56cdc55..823f72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e8a=['request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a22e9,_0x5a2229){var _0x5dafe9=function(_0x5b560f){while(--_0x5b560f){_0x1a22e9['push'](_0x1a22e9['shift']());}};_0x5dafe9(++_0x5a2229);}(_0x3e8a,0x78));var _0xa3e8=function(_0x17cfdc,_0x4d6016){_0x17cfdc=_0x17cfdc-0x0;var _0x125059=_0x3e8a[_0x17cfdc];return _0x125059;};'use strict';var _=require(_0xa3e8('0x0'));var util=require(_0xa3e8('0x1'));var logger=require(_0xa3e8('0x2'))(_0xa3e8('0x3'));var moment=require(_0xa3e8('0x4'));var BPromise=require(_0xa3e8('0x5'));var rp=require(_0xa3e8('0x6'));var fs=require('fs');var path=require(_0xa3e8('0x7'));var rimraf=require(_0xa3e8('0x8'));var config=require('../../config/environment');var attributes=require(_0xa3e8('0x9'));module[_0xa3e8('0xa')]=function(_0x220eae,_0x5dc785){return _0x220eae[_0xa3e8('0xb')](_0xa3e8('0xc'),attributes,{'tableName':_0xa3e8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb30d=['define','int_sugarcrm_configurations','util','../../config/logger','api','bluebird','path','rimraf','./intSugarcrmConfiguration.attributes','exports'];(function(_0x5375e0,_0x41ca48){var _0x488322=function(_0x4d0e2c){while(--_0x4d0e2c){_0x5375e0['push'](_0x5375e0['shift']());}};_0x488322(++_0x41ca48);}(_0xb30d,0xf2));var _0xdb30=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0xb30d[_0x191154];return _0x3dcd73;};'use strict';var _=require('lodash');var util=require(_0xdb30('0x0'));var logger=require(_0xdb30('0x1'))(_0xdb30('0x2'));var moment=require('moment');var BPromise=require(_0xdb30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb30('0x4'));var rimraf=require(_0xdb30('0x5'));var config=require('../../config/environment');var attributes=require(_0xdb30('0x6'));module[_0xdb30('0x7')]=function(_0x56fb72,_0x5abee4){return _0x56fb72[_0xdb30('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xdb30('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c6fba0d..f29a151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eba=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0x1eba,0x70));var _0xa1eb=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x1eba[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require(_0xa1eb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c81da,_0x2e8b8f,_0x28b95b){return new BPromise(function(_0x584fd9,_0x34ea90){return client[_0xa1eb('0xc')](_0x5c81da,_0x28b95b)[_0xa1eb('0xd')](function(_0x46892c){logger[_0xa1eb('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2e8b8f,_0xa1eb('0xf'));logger[_0xa1eb('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2e8b8f,_0xa1eb('0xf'),JSON[_0xa1eb('0x11')](_0x46892c));if(_0x46892c[_0xa1eb('0x12')]){if(_0x46892c[_0xa1eb('0x12')][_0xa1eb('0x13')]===0x1f4){logger['error'](_0xa1eb('0x14'),_0x2e8b8f,_0x46892c[_0xa1eb('0x12')][_0xa1eb('0x15')]);return _0x34ea90(_0x46892c[_0xa1eb('0x12')][_0xa1eb('0x15')]);}logger[_0xa1eb('0x12')](_0xa1eb('0x14'),_0x2e8b8f,_0x46892c[_0xa1eb('0x12')][_0xa1eb('0x15')]);return _0x584fd9(_0x46892c['error'][_0xa1eb('0x15')]);}else{logger[_0xa1eb('0xe')](_0xa1eb('0x14'),_0x2e8b8f,_0xa1eb('0xf'));_0x584fd9(_0x46892c[_0xa1eb('0x16')][_0xa1eb('0x15')]);}})[_0xa1eb('0x17')](function(_0x3750d0){logger[_0xa1eb('0x12')](_0xa1eb('0x14'),_0x2e8b8f,_0x3750d0);_0x34ea90(_0x3750d0);});});}
\ No newline at end of file
+var _0x5442=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','SugarcrmConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x430412,_0x41489b){var _0x222658=function(_0xfa0890){while(--_0xfa0890){_0x430412['push'](_0x430412['shift']());}};_0x222658(++_0x41489b);}(_0x5442,0xec));var _0x2544=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x5442[_0x3e5bc8];return _0xfd84bc;};'use strict';var _=require(_0x2544('0x0'));var util=require(_0x2544('0x1'));var moment=require(_0x2544('0x2'));var BPromise=require(_0x2544('0x3'));var rs=require(_0x2544('0x4'));var fs=require('fs');var Redis=require(_0x2544('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2544('0x6'));var logger=require(_0x2544('0x7'))(_0x2544('0x8'));var config=require(_0x2544('0x9'));var jayson=require(_0x2544('0xa'));var client=jayson[_0x2544('0xb')][_0x2544('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10fa21,_0x4170f2,_0x50875a){return new BPromise(function(_0x54070a,_0x3bc002){return client[_0x2544('0xd')](_0x10fa21,_0x50875a)[_0x2544('0xe')](function(_0x1ec139){logger[_0x2544('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4170f2,'request\x20sent');logger[_0x2544('0x10')](_0x2544('0x11'),_0x4170f2,'request\x20sent',JSON['stringify'](_0x1ec139));if(_0x1ec139[_0x2544('0x12')]){if(_0x1ec139[_0x2544('0x12')]['code']===0x1f4){logger['error'](_0x2544('0x13'),_0x4170f2,_0x1ec139[_0x2544('0x12')][_0x2544('0x14')]);return _0x3bc002(_0x1ec139[_0x2544('0x12')][_0x2544('0x14')]);}logger[_0x2544('0x12')](_0x2544('0x13'),_0x4170f2,_0x1ec139[_0x2544('0x12')]['message']);return _0x54070a(_0x1ec139['error']['message']);}else{logger[_0x2544('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4170f2,_0x2544('0x15'));_0x54070a(_0x1ec139[_0x2544('0x16')][_0x2544('0x14')]);}})['catch'](function(_0x249db5){logger[_0x2544('0x12')](_0x2544('0x13'),_0x4170f2,_0x249db5);_0x3bc002(_0x249db5);});});}
\ No newline at end of file
index 1ec0977..580f189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x189f=['/:id','update','delete','destroy','util','Router','fs-extra','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','show','post','put'];(function(_0x9171e0,_0x2ee1b3){var _0x2659fb=function(_0x48eacc){while(--_0x48eacc){_0x9171e0['push'](_0x9171e0['shift']());}};_0x2659fb(++_0x2ee1b3);}(_0x189f,0xb8));var _0xf189=function(_0x532155,_0x110247){_0x532155=_0x532155-0x0;var _0x3f2619=_0x189f[_0x532155];return _0x3f2619;};'use strict';var multer=require('multer');var util=require(_0xf189('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf189('0x1')]();var fs_extra=require(_0xf189('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf189('0x3'));var controller=require(_0xf189('0x4'));router['get']('/',auth[_0xf189('0x5')](),controller[_0xf189('0x6')]);router[_0xf189('0x7')]('/:id',auth[_0xf189('0x5')](),controller[_0xf189('0x8')]);router[_0xf189('0x9')]('/',auth[_0xf189('0x5')](),controller['create']);router[_0xf189('0xa')](_0xf189('0xb'),auth['isAuthenticated'](),controller[_0xf189('0xc')]);router[_0xf189('0xd')](_0xf189('0xb'),auth[_0xf189('0x5')](),controller[_0xf189('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xc596=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','post','put','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x3fe8c8,_0x1e5dda){var _0x5dc1f3=function(_0x13a227){while(--_0x13a227){_0x3fe8c8['push'](_0x3fe8c8['shift']());}};_0x5dc1f3(++_0x1e5dda);}(_0xc596,0x1e1));var _0x6c59=function(_0x4f4de2,_0x257b5d){_0x4f4de2=_0x4f4de2-0x0;var _0x1cbf3a=_0xc596[_0x4f4de2];return _0x1cbf3a;};'use strict';var multer=require('multer');var util=require(_0x6c59('0x0'));var path=require(_0x6c59('0x1'));var timeout=require(_0x6c59('0x2'));var express=require(_0x6c59('0x3'));var router=express[_0x6c59('0x4')]();var fs_extra=require(_0x6c59('0x5'));var auth=require(_0x6c59('0x6'));var interaction=require(_0x6c59('0x7'));var config=require(_0x6c59('0x8'));var controller=require(_0x6c59('0x9'));router[_0x6c59('0xa')]('/',auth[_0x6c59('0xb')](),controller['index']);router['get'](_0x6c59('0xc'),auth[_0x6c59('0xb')](),controller['show']);router[_0x6c59('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6c59('0xe')]('/:id',auth[_0x6c59('0xb')](),controller[_0x6c59('0xf')]);router[_0x6c59('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6c59('0x11')]=router;
\ No newline at end of file
index d10157e..6af25d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430e=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x24b1fe,_0x33f289){var _0x3e6787=function(_0x1086b4){while(--_0x1086b4){_0x24b1fe['push'](_0x24b1fe['shift']());}};_0x3e6787(++_0x33f289);}(_0x430e,0x141));var _0xe430=function(_0x5874ca,_0xf90b52){_0x5874ca=_0x5874ca-0x0;var _0x4b41d7=_0x430e[_0x5874ca];return _0x4b41d7;};'use strict';var Sequelize=require('sequelize');module[_0xe430('0x0')]={'type':{'type':Sequelize[_0xe430('0x1')](_0xe430('0x2'),_0xe430('0x3'),_0xe430('0x4'),_0xe430('0x5'),_0xe430('0x6')),'defaultValue':_0xe430('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe430('0x7')]},'keyType':{'type':Sequelize[_0xe430('0x1')](_0xe430('0x2'),_0xe430('0x3'),_0xe430('0x4'))},'keyContent':{'type':Sequelize[_0xe430('0x7')]},'idField':{'type':Sequelize[_0xe430('0x7')]},'nameField':{'type':Sequelize[_0xe430('0x7')]},'customField':{'type':Sequelize[_0xe430('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe430('0x7')]}};
\ No newline at end of file
+var _0xd802=['BOOLEAN','sequelize','exports','variable','picklist','ENUM','STRING'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xd802,0x1c8));var _0x2d80=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0xd802[_0x161f59];return _0x3ffa0e;};'use strict';var Sequelize=require(_0x2d80('0x0'));module[_0x2d80('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2d80('0x2'),'customVariable','keyValue',_0x2d80('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2d80('0x4')]('string',_0x2d80('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x2d80('0x5')]},'idField':{'type':Sequelize[_0x2d80('0x5')]},'nameField':{'type':Sequelize[_0x2d80('0x5')]},'customField':{'type':Sequelize[_0x2d80('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2d80('0x5')]}};
\ No newline at end of file
index d36410f..151fa97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0f4=['map','SugarcrmField','fieldName','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','intersection','length','find','create','body','destroy','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index'];(function(_0x53a935,_0x4cd284){var _0x50b406=function(_0x40689c){while(--_0x40689c){_0x53a935['push'](_0x53a935['shift']());}};_0x50b406(++_0x4cd284);}(_0xe0f4,0x6c));var _0x4e0f=function(_0x34aa8d,_0x3d3094){_0x34aa8d=_0x34aa8d-0x0;var _0x3e9dba=_0xe0f4[_0x34aa8d];return _0x3e9dba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4e0f('0x0'));var jsonpatch=require(_0x4e0f('0x1'));var rp=require('request-promise');var moment=require(_0x4e0f('0x2'));var BPromise=require(_0x4e0f('0x3'));var Mustache=require(_0x4e0f('0x4'));var util=require(_0x4e0f('0x5'));var path=require(_0x4e0f('0x6'));var sox=require('sox');var csv=require(_0x4e0f('0x7'));var ejs=require(_0x4e0f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e0f('0x9'));var squel=require('squel');var crypto=require(_0x4e0f('0xa'));var jsforce=require(_0x4e0f('0xb'));var deskjs=require(_0x4e0f('0xc'));var toCsv=require(_0x4e0f('0x7'));var querystring=require(_0x4e0f('0xd'));var Papa=require('papaparse');var Redis=require(_0x4e0f('0xe'));var authService=require(_0x4e0f('0xf'));var qs=require(_0x4e0f('0x10'));var as=require(_0x4e0f('0x11'));var hardwareService=require(_0x4e0f('0x12'));var logger=require(_0x4e0f('0x13'))(_0x4e0f('0x14'));var utils=require(_0x4e0f('0x15'));var config=require(_0x4e0f('0x16'));var licenseUtil=require(_0x4e0f('0x17'));var db=require(_0x4e0f('0x18'))['db'];function respondWithStatusCode(_0xad2735,_0x15ab46){_0x15ab46=_0x15ab46||0xcc;return function(_0x391a93){if(_0x391a93){return _0xad2735[_0x4e0f('0x19')](_0x15ab46);}return _0xad2735['status'](_0x15ab46)[_0x4e0f('0x1a')]();};}function respondWithResult(_0x351be6,_0x1576d0){_0x1576d0=_0x1576d0||0xc8;return function(_0x170d90){if(_0x170d90){return _0x351be6[_0x4e0f('0x1b')](_0x1576d0)[_0x4e0f('0x1c')](_0x170d90);}};}function respondWithFilteredResult(_0x1d5784,_0x48b4f1){return function(_0x4922bf){if(_0x4922bf){var _0x53b45a=typeof _0x48b4f1[_0x4e0f('0x1d')]===_0x4e0f('0x1e')&&typeof _0x48b4f1[_0x4e0f('0x1f')]===_0x4e0f('0x1e');var _0x6f60d9=_0x4922bf[_0x4e0f('0x20')];var _0x3083b6=_0x53b45a?0x0:_0x48b4f1[_0x4e0f('0x1d')];var _0x48788b=_0x53b45a?_0x4922bf['count']:_0x48b4f1[_0x4e0f('0x1d')]+_0x48b4f1[_0x4e0f('0x1f')];var _0x25fce2;if(_0x48788b>=_0x6f60d9){_0x48788b=_0x6f60d9;_0x25fce2=0xc8;}else{_0x25fce2=0xce;}_0x1d5784[_0x4e0f('0x1b')](_0x25fce2);return _0x1d5784[_0x4e0f('0x21')](_0x4e0f('0x22'),_0x3083b6+'-'+_0x48788b+'/'+_0x6f60d9)[_0x4e0f('0x1c')](_0x4922bf);}return null;};}function patchUpdates(_0x5cbdca){return function(_0x164578){try{jsonpatch[_0x4e0f('0x23')](_0x164578,_0x5cbdca,!![]);}catch(_0xb739){return BPromise[_0x4e0f('0x24')](_0xb739);}return _0x164578[_0x4e0f('0x25')]();};}function saveUpdates(_0x49d085,_0x2a8f81){return function(_0xb379cb){if(_0xb379cb){return _0xb379cb[_0x4e0f('0x26')](_0x49d085)[_0x4e0f('0x27')](function(_0x3bef78){return _0x3bef78;});}return null;};}function removeEntity(_0xa82ca1,_0x35f6a4){return function(_0xbf369a){if(_0xbf369a){return _0xbf369a['destroy']()[_0x4e0f('0x27')](function(){_0xa82ca1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39bc92,_0x34a20d){return function(_0x41ddaf){if(!_0x41ddaf){_0x39bc92['sendStatus'](0x194);}return _0x41ddaf;};}function handleError(_0x3844aa,_0x3d7484){_0x3d7484=_0x3d7484||0x1f4;return function(_0x24f969){logger[_0x4e0f('0x28')](_0x24f969[_0x4e0f('0x29')]);if(_0x24f969[_0x4e0f('0x2a')]){delete _0x24f969['name'];}_0x3844aa[_0x4e0f('0x1b')](_0x3d7484)['send'](_0x24f969);};}exports[_0x4e0f('0x2b')]=function(_0x3a86ab,_0x1fceeb){var _0xf7d429={},_0x5002b0={},_0x448c43={'count':0x0,'rows':[]};var _0x5967c5=_[_0x4e0f('0x2c')](db[_0x4e0f('0x2d')]['rawAttributes'],function(_0x17fb96){return{'name':_0x17fb96[_0x4e0f('0x2e')],'type':_0x17fb96[_0x4e0f('0x2f')]['key']};});_0x5002b0[_0x4e0f('0x30')]=_[_0x4e0f('0x2c')](_0x5967c5,'name');_0x5002b0[_0x4e0f('0x31')]=_[_0x4e0f('0x32')](_0x3a86ab[_0x4e0f('0x31')]);_0x5002b0[_0x4e0f('0x33')]=_['intersection'](_0x5002b0['model'],_0x5002b0[_0x4e0f('0x31')]);_0xf7d429[_0x4e0f('0x34')]=_['intersection'](_0x5002b0[_0x4e0f('0x30')],qs[_0x4e0f('0x35')](_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x35')]));_0xf7d429[_0x4e0f('0x34')]=_0xf7d429[_0x4e0f('0x34')]['length']?_0xf7d429[_0x4e0f('0x34')]:_0x5002b0['model'];if(!_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x36')](_0x4e0f('0x37'))){_0xf7d429[_0x4e0f('0x1f')]=qs['limit'](_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x1f')]);_0xf7d429['offset']=qs[_0x4e0f('0x1d')](_0x3a86ab[_0x4e0f('0x31')]['offset']);}_0xf7d429[_0x4e0f('0x38')]=qs['sort'](_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x39')]);_0xf7d429[_0x4e0f('0x3a')]=qs[_0x4e0f('0x33')](_[_0x4e0f('0x3b')](_0x3a86ab[_0x4e0f('0x31')],_0x5002b0[_0x4e0f('0x33')]),_0x5967c5);if(_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x3c')]){_0xf7d429[_0x4e0f('0x3a')]=_[_0x4e0f('0x3d')](_0xf7d429[_0x4e0f('0x3a')],{'$or':_[_0x4e0f('0x2c')](_0x5967c5,function(_0x1ceec7){if(_0x1ceec7[_0x4e0f('0x2f')]!==_0x4e0f('0x3e')){var _0x3517b9={};_0x3517b9[_0x1ceec7['name']]={'$like':'%'+_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x3c')]+'%'};return _0x3517b9;}})});}_0xf7d429=_['merge']({},_0xf7d429,_0x3a86ab[_0x4e0f('0x3f')]);var _0x2fd0ff={'where':_0xf7d429[_0x4e0f('0x3a')]};return db[_0x4e0f('0x2d')][_0x4e0f('0x20')](_0x2fd0ff)[_0x4e0f('0x27')](function(_0xe47044){_0x448c43['count']=_0xe47044;if(_0x3a86ab[_0x4e0f('0x31')][_0x4e0f('0x40')]){_0xf7d429[_0x4e0f('0x41')]=[{'all':!![]}];}return db[_0x4e0f('0x2d')][_0x4e0f('0x42')](_0xf7d429);})[_0x4e0f('0x27')](function(_0x551bdf){_0x448c43['rows']=_0x551bdf;return _0x448c43;})['then'](respondWithFilteredResult(_0x1fceeb,_0xf7d429))[_0x4e0f('0x43')](handleError(_0x1fceeb,null));};exports['show']=function(_0x2f77a8,_0x495d51){var _0x583cef={'raw':!![],'where':{'id':_0x2f77a8[_0x4e0f('0x44')]['id']}},_0x2373ba={};_0x2373ba[_0x4e0f('0x30')]=_[_0x4e0f('0x32')](db[_0x4e0f('0x2d')][_0x4e0f('0x45')]);_0x2373ba[_0x4e0f('0x31')]=_[_0x4e0f('0x32')](_0x2f77a8['query']);_0x2373ba['filters']=_[_0x4e0f('0x46')](_0x2373ba[_0x4e0f('0x30')],_0x2373ba[_0x4e0f('0x31')]);_0x583cef['attributes']=_[_0x4e0f('0x46')](_0x2373ba['model'],qs['fields'](_0x2f77a8[_0x4e0f('0x31')][_0x4e0f('0x35')]));_0x583cef['attributes']=_0x583cef[_0x4e0f('0x34')][_0x4e0f('0x47')]?_0x583cef[_0x4e0f('0x34')]:_0x2373ba[_0x4e0f('0x30')];if(_0x2f77a8[_0x4e0f('0x31')]['includeAll']){_0x583cef['include']=[{'all':!![]}];}_0x583cef=_[_0x4e0f('0x3d')]({},_0x583cef,_0x2f77a8[_0x4e0f('0x3f')]);return db[_0x4e0f('0x2d')][_0x4e0f('0x48')](_0x583cef)[_0x4e0f('0x27')](handleEntityNotFound(_0x495d51,null))[_0x4e0f('0x27')](respondWithResult(_0x495d51,null))[_0x4e0f('0x43')](handleError(_0x495d51,null));};exports[_0x4e0f('0x49')]=function(_0x9589bf,_0x3565ab){return db[_0x4e0f('0x2d')]['create'](_0x9589bf[_0x4e0f('0x4a')],{})[_0x4e0f('0x27')](respondWithResult(_0x3565ab,0xc9))[_0x4e0f('0x43')](handleError(_0x3565ab,null));};exports[_0x4e0f('0x26')]=function(_0x2e5023,_0x4f4644){if(_0x2e5023[_0x4e0f('0x4a')]['id']){delete _0x2e5023[_0x4e0f('0x4a')]['id'];}return db[_0x4e0f('0x2d')][_0x4e0f('0x48')]({'where':{'id':_0x2e5023[_0x4e0f('0x44')]['id']}})[_0x4e0f('0x27')](handleEntityNotFound(_0x4f4644,null))[_0x4e0f('0x27')](saveUpdates(_0x2e5023[_0x4e0f('0x4a')],null))[_0x4e0f('0x27')](respondWithResult(_0x4f4644,null))[_0x4e0f('0x43')](handleError(_0x4f4644,null));};exports[_0x4e0f('0x4b')]=function(_0x41df1b,_0x177fc4){return db[_0x4e0f('0x2d')][_0x4e0f('0x48')]({'where':{'id':_0x41df1b['params']['id']}})[_0x4e0f('0x27')](handleEntityNotFound(_0x177fc4,null))[_0x4e0f('0x27')](removeEntity(_0x177fc4,null))['catch'](handleError(_0x177fc4,null));};
\ No newline at end of file
+var _0x9b8c=['../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x45e96d,_0xa4a268){var _0x237c53=function(_0x537f86){while(--_0x537f86){_0x45e96d['push'](_0x45e96d['shift']());}};_0x237c53(++_0xa4a268);}(_0x9b8c,0x84));var _0xc9b8=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x9b8c[_0x16eb11];return _0x3ae7ef;};'use strict';var emlformat=require(_0xc9b8('0x0'));var rimraf=require(_0xc9b8('0x1'));var zipdir=require(_0xc9b8('0x2'));var jsonpatch=require(_0xc9b8('0x3'));var rp=require(_0xc9b8('0x4'));var moment=require(_0xc9b8('0x5'));var BPromise=require(_0xc9b8('0x6'));var Mustache=require('mustache');var util=require(_0xc9b8('0x7'));var path=require(_0xc9b8('0x8'));var sox=require(_0xc9b8('0x9'));var csv=require(_0xc9b8('0xa'));var ejs=require(_0xc9b8('0xb'));var fs=require('fs');var fs_extra=require(_0xc9b8('0xc'));var _=require(_0xc9b8('0xd'));var squel=require('squel');var crypto=require(_0xc9b8('0xe'));var jsforce=require(_0xc9b8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc9b8('0x10'));var Papa=require(_0xc9b8('0x11'));var Redis=require('ioredis');var authService=require(_0xc9b8('0x12'));var qs=require(_0xc9b8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9b8('0x14'));var logger=require(_0xc9b8('0x15'))('api');var utils=require(_0xc9b8('0x16'));var config=require(_0xc9b8('0x17'));var licenseUtil=require(_0xc9b8('0x18'));var db=require(_0xc9b8('0x19'))['db'];function respondWithStatusCode(_0x3511c5,_0x401c1a){_0x401c1a=_0x401c1a||0xcc;return function(_0x1a7867){if(_0x1a7867){return _0x3511c5[_0xc9b8('0x1a')](_0x401c1a);}return _0x3511c5['status'](_0x401c1a)[_0xc9b8('0x1b')]();};}function respondWithResult(_0x4d218f,_0x1002d9){_0x1002d9=_0x1002d9||0xc8;return function(_0x45a4c9){if(_0x45a4c9){return _0x4d218f[_0xc9b8('0x1c')](_0x1002d9)['json'](_0x45a4c9);}};}function respondWithFilteredResult(_0x4ff95a,_0x52b7e5){return function(_0x11c0ac){if(_0x11c0ac){var _0x3ac810=typeof _0x52b7e5[_0xc9b8('0x1d')]===_0xc9b8('0x1e')&&typeof _0x52b7e5[_0xc9b8('0x1f')]===_0xc9b8('0x1e');var _0x5cb28a=_0x11c0ac[_0xc9b8('0x20')];var _0x1ad2bc=_0x3ac810?0x0:_0x52b7e5[_0xc9b8('0x1d')];var _0x52ba07=_0x3ac810?_0x11c0ac[_0xc9b8('0x20')]:_0x52b7e5['offset']+_0x52b7e5['limit'];var _0xe1e84e;if(_0x52ba07>=_0x5cb28a){_0x52ba07=_0x5cb28a;_0xe1e84e=0xc8;}else{_0xe1e84e=0xce;}_0x4ff95a[_0xc9b8('0x1c')](_0xe1e84e);return _0x4ff95a[_0xc9b8('0x21')](_0xc9b8('0x22'),_0x1ad2bc+'-'+_0x52ba07+'/'+_0x5cb28a)['json'](_0x11c0ac);}return null;};}function patchUpdates(_0x20dbaf){return function(_0x1dd3f9){try{jsonpatch[_0xc9b8('0x23')](_0x1dd3f9,_0x20dbaf,!![]);}catch(_0x431e14){return BPromise[_0xc9b8('0x24')](_0x431e14);}return _0x1dd3f9[_0xc9b8('0x25')]();};}function saveUpdates(_0x14222c,_0x389cc9){return function(_0x3b5be9){if(_0x3b5be9){return _0x3b5be9[_0xc9b8('0x26')](_0x14222c)[_0xc9b8('0x27')](function(_0x518fc0){return _0x518fc0;});}return null;};}function removeEntity(_0x25823f,_0x43365e){return function(_0x3dd394){if(_0x3dd394){return _0x3dd394[_0xc9b8('0x28')]()[_0xc9b8('0x27')](function(){_0x25823f[_0xc9b8('0x1c')](0xcc)[_0xc9b8('0x1b')]();});}};}function handleEntityNotFound(_0x1a8d72,_0x3082c7){return function(_0x148a1a){if(!_0x148a1a){_0x1a8d72[_0xc9b8('0x1a')](0x194);}return _0x148a1a;};}function handleError(_0x214e56,_0x18611f){_0x18611f=_0x18611f||0x1f4;return function(_0x45df5c){logger[_0xc9b8('0x29')](_0x45df5c[_0xc9b8('0x2a')]);if(_0x45df5c['name']){delete _0x45df5c[_0xc9b8('0x2b')];}_0x214e56[_0xc9b8('0x1c')](_0x18611f)[_0xc9b8('0x2c')](_0x45df5c);};}exports[_0xc9b8('0x2d')]=function(_0x48fb8a,_0x4d4648){var _0x3cc640={},_0x1e9554={},_0x1dc6e7={'count':0x0,'rows':[]};var _0x2f1c56=_['map'](db['SugarcrmField'][_0xc9b8('0x2e')],function(_0x4bfdae){return{'name':_0x4bfdae[_0xc9b8('0x2f')],'type':_0x4bfdae[_0xc9b8('0x30')][_0xc9b8('0x31')]};});_0x1e9554[_0xc9b8('0x32')]=_['map'](_0x2f1c56,_0xc9b8('0x2b'));_0x1e9554[_0xc9b8('0x33')]=_[_0xc9b8('0x34')](_0x48fb8a['query']);_0x1e9554['filters']=_[_0xc9b8('0x35')](_0x1e9554['model'],_0x1e9554[_0xc9b8('0x33')]);_0x3cc640[_0xc9b8('0x36')]=_[_0xc9b8('0x35')](_0x1e9554['model'],qs[_0xc9b8('0x37')](_0x48fb8a['query']['fields']));_0x3cc640[_0xc9b8('0x36')]=_0x3cc640[_0xc9b8('0x36')][_0xc9b8('0x38')]?_0x3cc640['attributes']:_0x1e9554[_0xc9b8('0x32')];if(!_0x48fb8a[_0xc9b8('0x33')]['hasOwnProperty'](_0xc9b8('0x39'))){_0x3cc640[_0xc9b8('0x1f')]=qs[_0xc9b8('0x1f')](_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x1f')]);_0x3cc640['offset']=qs['offset'](_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x1d')]);}_0x3cc640[_0xc9b8('0x3a')]=qs[_0xc9b8('0x3b')](_0x48fb8a[_0xc9b8('0x33')]['sort']);_0x3cc640[_0xc9b8('0x3c')]=qs['filters'](_[_0xc9b8('0x3d')](_0x48fb8a[_0xc9b8('0x33')],_0x1e9554[_0xc9b8('0x3e')]),_0x2f1c56);if(_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x3f')]){_0x3cc640[_0xc9b8('0x3c')]=_['merge'](_0x3cc640[_0xc9b8('0x3c')],{'$or':_[_0xc9b8('0x40')](_0x2f1c56,function(_0x2d5613){if(_0x2d5613[_0xc9b8('0x30')]!==_0xc9b8('0x41')){var _0x4d735a={};_0x4d735a[_0x2d5613[_0xc9b8('0x2b')]]={'$like':'%'+_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x3f')]+'%'};return _0x4d735a;}})});}_0x3cc640=_[_0xc9b8('0x42')]({},_0x3cc640,_0x48fb8a[_0xc9b8('0x43')]);var _0x57d0fc={'where':_0x3cc640[_0xc9b8('0x3c')]};return db['SugarcrmField']['count'](_0x57d0fc)[_0xc9b8('0x27')](function(_0x332f4c){_0x1dc6e7['count']=_0x332f4c;if(_0x48fb8a[_0xc9b8('0x33')][_0xc9b8('0x44')]){_0x3cc640[_0xc9b8('0x45')]=[{'all':!![]}];}return db[_0xc9b8('0x46')][_0xc9b8('0x47')](_0x3cc640);})['then'](function(_0x37199f){_0x1dc6e7[_0xc9b8('0x48')]=_0x37199f;return _0x1dc6e7;})[_0xc9b8('0x27')](respondWithFilteredResult(_0x4d4648,_0x3cc640))[_0xc9b8('0x49')](handleError(_0x4d4648,null));};exports[_0xc9b8('0x4a')]=function(_0x5f238f,_0x5ba885){var _0x3ab09c={'raw':!![],'where':{'id':_0x5f238f['params']['id']}},_0x439235={};_0x439235['model']=_[_0xc9b8('0x34')](db[_0xc9b8('0x46')][_0xc9b8('0x2e')]);_0x439235[_0xc9b8('0x33')]=_['keys'](_0x5f238f[_0xc9b8('0x33')]);_0x439235[_0xc9b8('0x3e')]=_['intersection'](_0x439235['model'],_0x439235[_0xc9b8('0x33')]);_0x3ab09c[_0xc9b8('0x36')]=_[_0xc9b8('0x35')](_0x439235['model'],qs[_0xc9b8('0x37')](_0x5f238f[_0xc9b8('0x33')]['fields']));_0x3ab09c[_0xc9b8('0x36')]=_0x3ab09c['attributes'][_0xc9b8('0x38')]?_0x3ab09c['attributes']:_0x439235['model'];if(_0x5f238f['query'][_0xc9b8('0x44')]){_0x3ab09c[_0xc9b8('0x45')]=[{'all':!![]}];}_0x3ab09c=_['merge']({},_0x3ab09c,_0x5f238f['options']);return db['SugarcrmField'][_0xc9b8('0x4b')](_0x3ab09c)[_0xc9b8('0x27')](handleEntityNotFound(_0x5ba885,null))['then'](respondWithResult(_0x5ba885,null))[_0xc9b8('0x49')](handleError(_0x5ba885,null));};exports['create']=function(_0x1b0ef9,_0x155585){return db[_0xc9b8('0x46')]['create'](_0x1b0ef9['body'],{})[_0xc9b8('0x27')](respondWithResult(_0x155585,0xc9))[_0xc9b8('0x49')](handleError(_0x155585,null));};exports[_0xc9b8('0x26')]=function(_0x1bc461,_0x3cae75){if(_0x1bc461[_0xc9b8('0x4c')]['id']){delete _0x1bc461[_0xc9b8('0x4c')]['id'];}return db['SugarcrmField'][_0xc9b8('0x4b')]({'where':{'id':_0x1bc461[_0xc9b8('0x4d')]['id']}})[_0xc9b8('0x27')](handleEntityNotFound(_0x3cae75,null))[_0xc9b8('0x27')](saveUpdates(_0x1bc461[_0xc9b8('0x4c')],null))[_0xc9b8('0x27')](respondWithResult(_0x3cae75,null))[_0xc9b8('0x49')](handleError(_0x3cae75,null));};exports['destroy']=function(_0x20fdaa,_0x2debf7){return db['SugarcrmField'][_0xc9b8('0x4b')]({'where':{'id':_0x20fdaa[_0xc9b8('0x4d')]['id']}})[_0xc9b8('0x27')](handleEntityNotFound(_0x2debf7,null))['then'](removeEntity(_0x2debf7,null))[_0xc9b8('0x49')](handleError(_0x2debf7,null));};
\ No newline at end of file
index 9712d83..688ce52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab07=['rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','api','bluebird'];(function(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0xab07,0xb8));var _0x7ab0=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xab07[_0x2a0738];return _0x159679;};'use strict';var _=require(_0x7ab0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7ab0('0x1'));var moment=require('moment');var BPromise=require(_0x7ab0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ab0('0x3'));var config=require('../../config/environment');var attributes=require(_0x7ab0('0x4'));module[_0x7ab0('0x5')]=function(_0x4fdc86,_0x319992){return _0x4fdc86[_0x7ab0('0x6')](_0x7ab0('0x7'),attributes,{'tableName':_0x7ab0('0x8'),'paranoid':![],'indexes':[{'name':_0x7ab0('0x9'),'fields':[_0x7ab0('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x19c1=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','rimraf','./intSugarcrmField.attributes','exports','define'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x19c1,0x1f3));var _0x119c=function(_0x2d2460,_0x2f98ef){_0x2d2460=_0x2d2460-0x0;var _0x2c0186=_0x19c1[_0x2d2460];return _0x2c0186;};'use strict';var _=require('lodash');var util=require(_0x119c('0x0'));var logger=require(_0x119c('0x1'))('api');var moment=require(_0x119c('0x2'));var BPromise=require(_0x119c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x119c('0x4'));var config=require('../../config/environment');var attributes=require(_0x119c('0x5'));module[_0x119c('0x6')]=function(_0x516204,_0x1517ed){return _0x516204[_0x119c('0x7')](_0x119c('0x8'),attributes,{'tableName':_0x119c('0x9'),'paranoid':![],'indexes':[{'name':_0x119c('0xa'),'fields':[_0x119c('0xb'),_0x119c('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 028eda6..0c3d239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad02=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x21a848,_0x5ce41a){var _0x5aaf99=function(_0x342593){while(--_0x342593){_0x21a848['push'](_0x21a848['shift']());}};_0x5aaf99(++_0x5ce41a);}(_0xad02,0x1e1));var _0x2ad0=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xad02[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0x2ad0('0x0'));var util=require('util');var moment=require(_0x2ad0('0x1'));var BPromise=require('bluebird');var rs=require(_0x2ad0('0x2'));var fs=require('fs');var Redis=require(_0x2ad0('0x3'));var db=require(_0x2ad0('0x4'))['db'];var utils=require(_0x2ad0('0x5'));var logger=require(_0x2ad0('0x6'))(_0x2ad0('0x7'));var config=require(_0x2ad0('0x8'));var jayson=require(_0x2ad0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16f8be,_0x1ba388,_0x5cd346){return new BPromise(function(_0x440709,_0x46a70c){return client[_0x2ad0('0xa')](_0x16f8be,_0x5cd346)[_0x2ad0('0xb')](function(_0x2fd342){logger['info'](_0x2ad0('0xc'),_0x1ba388,_0x2ad0('0xd'));logger[_0x2ad0('0xe')](_0x2ad0('0xf'),_0x1ba388,_0x2ad0('0xd'),JSON[_0x2ad0('0x10')](_0x2fd342));if(_0x2fd342[_0x2ad0('0x11')]){if(_0x2fd342[_0x2ad0('0x11')]['code']===0x1f4){logger[_0x2ad0('0x11')](_0x2ad0('0xc'),_0x1ba388,_0x2fd342[_0x2ad0('0x11')][_0x2ad0('0x12')]);return _0x46a70c(_0x2fd342[_0x2ad0('0x11')][_0x2ad0('0x12')]);}logger[_0x2ad0('0x11')](_0x2ad0('0xc'),_0x1ba388,_0x2fd342[_0x2ad0('0x11')][_0x2ad0('0x12')]);return _0x440709(_0x2fd342[_0x2ad0('0x11')][_0x2ad0('0x12')]);}else{logger['info'](_0x2ad0('0xc'),_0x1ba388,_0x2ad0('0xd'));_0x440709(_0x2fd342[_0x2ad0('0x13')]['message']);}})[_0x2ad0('0x14')](function(_0x1ed7cb){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1ba388,_0x1ed7cb);_0x46a70c(_0x1ed7cb);});});}
\ No newline at end of file
+var _0x50f4=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x50f4,0xf8));var _0x450f=function(_0x23b7dd,_0x198cf7){_0x23b7dd=_0x23b7dd-0x0;var _0xc39796=_0x50f4[_0x23b7dd];return _0xc39796;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x450f('0x0'));var rs=require(_0x450f('0x1'));var fs=require('fs');var Redis=require(_0x450f('0x2'));var db=require(_0x450f('0x3'))['db'];var utils=require(_0x450f('0x4'));var logger=require(_0x450f('0x5'))(_0x450f('0x6'));var config=require(_0x450f('0x7'));var jayson=require(_0x450f('0x8'));var client=jayson[_0x450f('0x9')][_0x450f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570642,_0x3d23dd,_0x5980e8){return new BPromise(function(_0x107b65,_0x1fcee6){return client[_0x450f('0xb')](_0x570642,_0x5980e8)[_0x450f('0xc')](function(_0x3097cf){logger[_0x450f('0xd')](_0x450f('0xe'),_0x3d23dd,'request\x20sent');logger[_0x450f('0xf')](_0x450f('0x10'),_0x3d23dd,_0x450f('0x11'),JSON[_0x450f('0x12')](_0x3097cf));if(_0x3097cf[_0x450f('0x13')]){if(_0x3097cf['error'][_0x450f('0x14')]===0x1f4){logger[_0x450f('0x13')](_0x450f('0xe'),_0x3d23dd,_0x3097cf['error'][_0x450f('0x15')]);return _0x1fcee6(_0x3097cf['error'][_0x450f('0x15')]);}logger[_0x450f('0x13')](_0x450f('0xe'),_0x3d23dd,_0x3097cf[_0x450f('0x13')][_0x450f('0x15')]);return _0x107b65(_0x3097cf[_0x450f('0x13')][_0x450f('0x15')]);}else{logger[_0x450f('0xd')](_0x450f('0xe'),_0x3d23dd,_0x450f('0x11'));_0x107b65(_0x3097cf[_0x450f('0x16')][_0x450f('0x15')]);}})[_0x450f('0x17')](function(_0x38992a){logger['error'](_0x450f('0xe'),_0x3d23dd,_0x38992a);_0x1fcee6(_0x38992a);});});}
\ No newline at end of file
index 66abb44..dcfbf3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb708=['show','get','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','/:id'];(function(_0x31be28,_0x598de7){var _0x4d23f2=function(_0x53828e){while(--_0x53828e){_0x31be28['push'](_0x31be28['shift']());}};_0x4d23f2(++_0x598de7);}(_0xb708,0xe7));var _0x8b70=function(_0x1895b7,_0x21fbc7){_0x1895b7=_0x1895b7-0x0;var _0x1aecdc=_0xb708[_0x1895b7];return _0x1aecdc;};'use strict';var multer=require(_0x8b70('0x0'));var util=require('util');var path=require(_0x8b70('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b70('0x2'));var router=express[_0x8b70('0x3')]();var fs_extra=require(_0x8b70('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b70('0x5'));var config=require(_0x8b70('0x6'));var controller=require(_0x8b70('0x7'));router['get']('/',auth[_0x8b70('0x8')](),controller[_0x8b70('0x9')]);router['get'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller[_0x8b70('0xb')]);router[_0x8b70('0xc')]('/:id/configurations',auth[_0x8b70('0x8')](),controller[_0x8b70('0xd')]);router['get'](_0x8b70('0xe'),auth[_0x8b70('0x8')](),controller['getFields']);router[_0x8b70('0xf')]('/',auth['isAuthenticated'](),controller[_0x8b70('0x10')]);router[_0x8b70('0xf')](_0x8b70('0x11'),auth['isAuthenticated'](),controller[_0x8b70('0x12')]);router[_0x8b70('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8b70('0x14')]);router['delete'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller['destroy']);module[_0x8b70('0x15')]=router;
\ No newline at end of file
+var _0xa5ca=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete'];(function(_0x4c63a5,_0x595700){var _0x3754e9=function(_0x426eb4){while(--_0x426eb4){_0x4c63a5['push'](_0x4c63a5['shift']());}};_0x3754e9(++_0x595700);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xa5ca[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var path=require(_0xaa5c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa5c('0x3')]();var fs_extra=require(_0xaa5c('0x4'));var auth=require(_0xaa5c('0x5'));var interaction=require(_0xaa5c('0x6'));var config=require(_0xaa5c('0x7'));var controller=require(_0xaa5c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xaa5c('0x9')](_0xaa5c('0xa'),auth[_0xaa5c('0xb')](),controller['show']);router['get'](_0xaa5c('0xc'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0xd')]);router['get'](_0xaa5c('0xe'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0xf')]);router[_0xaa5c('0x10')]('/',auth[_0xaa5c('0xb')](),controller[_0xaa5c('0x11')]);router[_0xaa5c('0x10')](_0xaa5c('0xc'),auth[_0xaa5c('0xb')](),controller[_0xaa5c('0x12')]);router[_0xaa5c('0x13')](_0xaa5c('0xa'),auth[_0xaa5c('0xb')](),controller['update']);router[_0xaa5c('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xaa5c('0x15')]=router;
\ No newline at end of file
index 32a9d27..d3b3151 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec33=['STRING','HelpDesk','sequelize'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xec33,0x1d0));var _0x3ec3=function(_0x3d12f2,_0x48a57b){_0x3d12f2=_0x3d12f2-0x0;var _0x10ce18=_0xec33[_0x3d12f2];return _0x10ce18;};'use strict';var Sequelize=require(_0x3ec3('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ec3('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3ec3('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3ec3('0x1')],'allowNull':![],'defaultValue':_0x3ec3('0x2')},'remoteUri':{'type':Sequelize[_0x3ec3('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3ec3('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3ec3('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x4e48=['sequelize','STRING'];(function(_0x28f183,_0x64a30a){var _0x1ade64=function(_0x56cb29){while(--_0x56cb29){_0x28f183['push'](_0x28f183['shift']());}};_0x1ade64(++_0x64a30a);}(_0x4e48,0x120));var _0x84e4=function(_0xe6b3da,_0x4dd32e){_0xe6b3da=_0xe6b3da-0x0;var _0x21a666=_0x4e48[_0xe6b3da];return _0x21a666;};'use strict';var Sequelize=require(_0x84e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x84e4('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x84e4('0x1')],'allowNull':![]}};
\ No newline at end of file
index 9802c65..fba9df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0d0=['channel','VtigerField','Subjects','getFields','username','description','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','false','label','startsWith','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','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','jayson/promise','request','then','info','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','stack','name','send','index','map','VtigerAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','length','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','AccountId','getSubjects','Descriptions','getDescriptions'];(function(_0x41dad3,_0x47213b){var _0x15b03b=function(_0x15a741){while(--_0x15a741){_0x41dad3['push'](_0x41dad3['shift']());}};_0x15b03b(++_0x47213b);}(_0xd0d0,0x126));var _0x0d0d=function(_0x38356a,_0x5ca333){_0x38356a=_0x38356a-0x0;var _0x1655b1=_0xd0d0[_0x38356a];return _0x1655b1;};'use strict';var emlformat=require(_0x0d0d('0x0'));var rimraf=require(_0x0d0d('0x1'));var zipdir=require(_0x0d0d('0x2'));var jsonpatch=require(_0x0d0d('0x3'));var rp=require(_0x0d0d('0x4'));var moment=require('moment');var BPromise=require(_0x0d0d('0x5'));var Mustache=require('mustache');var util=require(_0x0d0d('0x6'));var path=require(_0x0d0d('0x7'));var sox=require(_0x0d0d('0x8'));var csv=require(_0x0d0d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d0d('0xa'));var _=require('lodash');var squel=require(_0x0d0d('0xb'));var crypto=require('crypto');var jsforce=require(_0x0d0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0d0d('0x9'));var querystring=require(_0x0d0d('0xd'));var Papa=require('papaparse');var Redis=require(_0x0d0d('0xe'));var authService=require(_0x0d0d('0xf'));var qs=require(_0x0d0d('0x10'));var as=require(_0x0d0d('0x11'));var hardwareService=require(_0x0d0d('0x12'));var logger=require(_0x0d0d('0x13'))(_0x0d0d('0x14'));var utils=require(_0x0d0d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0d0d('0x16'));var db=require(_0x0d0d('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0d0d('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33e975,_0x5429d5,_0x2851e1,_0x4c27a2){return new BPromise(function(_0x1da37d,_0x1248c3){var _0x477fe4=_0x4c27a2||client;return _0x477fe4[_0x0d0d('0x19')](_0x33e975,_0x2851e1)[_0x0d0d('0x1a')](function(_0xf34ac4){logger[_0x0d0d('0x1b')]('VtigerAccount,\x20%s,\x20%s',_0x5429d5,'request\x20sent');logger['debug'](_0x0d0d('0x1c'),_0x5429d5,_0x0d0d('0x1d'),JSON[_0x0d0d('0x1e')](_0xf34ac4));if(_0xf34ac4[_0x0d0d('0x1f')]){if(_0xf34ac4[_0x0d0d('0x1f')]['code']===0x1f4){logger[_0x0d0d('0x1f')](_0x0d0d('0x20'),_0x5429d5,_0xf34ac4['error'][_0x0d0d('0x21')]);return _0x1248c3(_0xf34ac4[_0x0d0d('0x1f')][_0x0d0d('0x21')]);}logger[_0x0d0d('0x1f')](_0x0d0d('0x20'),_0x5429d5,_0xf34ac4['error']['message']);return _0x1da37d(_0xf34ac4[_0x0d0d('0x1f')][_0x0d0d('0x21')]);}else{logger[_0x0d0d('0x1b')](_0x0d0d('0x20'),_0x5429d5,'request\x20sent');_0x1da37d(_0xf34ac4[_0x0d0d('0x22')][_0x0d0d('0x21')]);}})[_0x0d0d('0x23')](function(_0x129d56){logger['error'](_0x0d0d('0x20'),_0x5429d5,_0x129d56);_0x1248c3(_0x129d56);});});}function respondWithStatusCode(_0x6c8d4c,_0x5a58d0){_0x5a58d0=_0x5a58d0||0xcc;return function(_0x9077b1){if(_0x9077b1){return _0x6c8d4c['sendStatus'](_0x5a58d0);}return _0x6c8d4c['status'](_0x5a58d0)[_0x0d0d('0x24')]();};}function respondWithResult(_0xa1af6d,_0xb81472){_0xb81472=_0xb81472||0xc8;return function(_0x59e432){if(_0x59e432){return _0xa1af6d[_0x0d0d('0x25')](_0xb81472)[_0x0d0d('0x26')](_0x59e432);}};}function respondWithFilteredResult(_0x462299,_0x1f2b64){return function(_0x2f6813){if(_0x2f6813){var _0x5b97b6=typeof _0x1f2b64['offset']===_0x0d0d('0x27')&&typeof _0x1f2b64[_0x0d0d('0x28')]==='undefined';var _0x3d62a5=_0x2f6813[_0x0d0d('0x29')];var _0x2c5b7a=_0x5b97b6?0x0:_0x1f2b64[_0x0d0d('0x2a')];var _0x1d121=_0x5b97b6?_0x2f6813[_0x0d0d('0x29')]:_0x1f2b64['offset']+_0x1f2b64[_0x0d0d('0x28')];var _0x566154;if(_0x1d121>=_0x3d62a5){_0x1d121=_0x3d62a5;_0x566154=0xc8;}else{_0x566154=0xce;}_0x462299[_0x0d0d('0x25')](_0x566154);return _0x462299['set'](_0x0d0d('0x2b'),_0x2c5b7a+'-'+_0x1d121+'/'+_0x3d62a5)[_0x0d0d('0x26')](_0x2f6813);}return null;};}function patchUpdates(_0xe28034){return function(_0x17e87b){try{jsonpatch['apply'](_0x17e87b,_0xe28034,!![]);}catch(_0xb3933d){return BPromise[_0x0d0d('0x2c')](_0xb3933d);}return _0x17e87b[_0x0d0d('0x2d')]();};}function saveUpdates(_0x261820,_0x46062e){return function(_0x414e1b){if(_0x414e1b){return _0x414e1b[_0x0d0d('0x2e')](_0x261820)[_0x0d0d('0x1a')](function(_0x397617){return _0x397617;});}return null;};}function removeEntity(_0x1bc20e,_0x583505){return function(_0x88580b){if(_0x88580b){return _0x88580b['destroy']()['then'](function(){_0x1bc20e[_0x0d0d('0x25')](0xcc)[_0x0d0d('0x24')]();});}};}function handleEntityNotFound(_0x233424,_0x142698){return function(_0x4bce94){if(!_0x4bce94){_0x233424['sendStatus'](0x194);}return _0x4bce94;};}function handleError(_0x4af199,_0x521605){_0x521605=_0x521605||0x1f4;return function(_0x3254fd){logger['error'](_0x3254fd[_0x0d0d('0x2f')]);if(_0x3254fd[_0x0d0d('0x30')]){delete _0x3254fd['name'];}_0x4af199[_0x0d0d('0x25')](_0x521605)[_0x0d0d('0x31')](_0x3254fd);};}exports[_0x0d0d('0x32')]=function(_0x433e21,_0x3c2137){var _0x264c25={},_0x4f2e97={},_0x4acad6={'count':0x0,'rows':[]};var _0x1e3db3=_[_0x0d0d('0x33')](db[_0x0d0d('0x34')][_0x0d0d('0x35')],function(_0x4942ff){return{'name':_0x4942ff['fieldName'],'type':_0x4942ff[_0x0d0d('0x36')]['key']};});_0x4f2e97[_0x0d0d('0x37')]=_[_0x0d0d('0x33')](_0x1e3db3,_0x0d0d('0x30'));_0x4f2e97[_0x0d0d('0x38')]=_[_0x0d0d('0x39')](_0x433e21[_0x0d0d('0x38')]);_0x4f2e97[_0x0d0d('0x3a')]=_['intersection'](_0x4f2e97[_0x0d0d('0x37')],_0x4f2e97['query']);_0x264c25[_0x0d0d('0x3b')]=_[_0x0d0d('0x3c')](_0x4f2e97[_0x0d0d('0x37')],qs[_0x0d0d('0x3d')](_0x433e21[_0x0d0d('0x38')][_0x0d0d('0x3d')]));_0x264c25[_0x0d0d('0x3b')]=_0x264c25[_0x0d0d('0x3b')]['length']?_0x264c25[_0x0d0d('0x3b')]:_0x4f2e97[_0x0d0d('0x37')];if(!_0x433e21[_0x0d0d('0x38')][_0x0d0d('0x3e')](_0x0d0d('0x3f'))){_0x264c25['limit']=qs['limit'](_0x433e21[_0x0d0d('0x38')]['limit']);_0x264c25[_0x0d0d('0x2a')]=qs[_0x0d0d('0x2a')](_0x433e21[_0x0d0d('0x38')][_0x0d0d('0x2a')]);}_0x264c25[_0x0d0d('0x40')]=qs[_0x0d0d('0x41')](_0x433e21[_0x0d0d('0x38')][_0x0d0d('0x41')]);_0x264c25[_0x0d0d('0x42')]=qs['filters'](_[_0x0d0d('0x43')](_0x433e21['query'],_0x4f2e97['filters']),_0x1e3db3);if(_0x433e21[_0x0d0d('0x38')][_0x0d0d('0x44')]){_0x264c25['where']=_['merge'](_0x264c25[_0x0d0d('0x42')],{'$or':_[_0x0d0d('0x33')](_0x1e3db3,function(_0x30f2b3){if(_0x30f2b3[_0x0d0d('0x36')]!==_0x0d0d('0x45')){var _0x531e39={};_0x531e39[_0x30f2b3[_0x0d0d('0x30')]]={'$like':'%'+_0x433e21[_0x0d0d('0x38')]['filter']+'%'};return _0x531e39;}})});}_0x264c25=_[_0x0d0d('0x46')]({},_0x264c25,_0x433e21[_0x0d0d('0x47')]);var _0x412949={'where':_0x264c25['where']};return db[_0x0d0d('0x34')][_0x0d0d('0x29')](_0x412949)[_0x0d0d('0x1a')](function(_0x4f4621){_0x4acad6['count']=_0x4f4621;if(_0x433e21[_0x0d0d('0x38')][_0x0d0d('0x48')]){_0x264c25[_0x0d0d('0x49')]=[{'all':!![]}];}return db['VtigerAccount'][_0x0d0d('0x4a')](_0x264c25);})[_0x0d0d('0x1a')](function(_0x582de3){_0x4acad6[_0x0d0d('0x4b')]=_0x582de3;return _0x4acad6;})[_0x0d0d('0x1a')](respondWithFilteredResult(_0x3c2137,_0x264c25))[_0x0d0d('0x23')](handleError(_0x3c2137,null));};exports[_0x0d0d('0x4c')]=function(_0x50a371,_0xf63b53){var _0x9a55da={'raw':![],'where':{'id':_0x50a371[_0x0d0d('0x4d')]['id']}},_0x4cc598={};_0x4cc598[_0x0d0d('0x37')]=_[_0x0d0d('0x39')](db[_0x0d0d('0x34')][_0x0d0d('0x35')]);_0x4cc598[_0x0d0d('0x38')]=_['keys'](_0x50a371[_0x0d0d('0x38')]);_0x4cc598[_0x0d0d('0x3a')]=_[_0x0d0d('0x3c')](_0x4cc598['model'],_0x4cc598[_0x0d0d('0x38')]);_0x9a55da[_0x0d0d('0x3b')]=_[_0x0d0d('0x3c')](_0x4cc598[_0x0d0d('0x37')],qs[_0x0d0d('0x3d')](_0x50a371['query']['fields']));_0x9a55da[_0x0d0d('0x3b')]=_0x9a55da[_0x0d0d('0x3b')][_0x0d0d('0x4e')]?_0x9a55da['attributes']:_0x4cc598[_0x0d0d('0x37')];if(_0x50a371['query'][_0x0d0d('0x48')]){_0x9a55da[_0x0d0d('0x49')]=[{'all':!![]}];}_0x9a55da=_[_0x0d0d('0x46')]({},_0x9a55da,_0x50a371['options']);return db['VtigerAccount'][_0x0d0d('0x4f')](_0x9a55da)['then'](handleEntityNotFound(_0xf63b53,null))[_0x0d0d('0x1a')](respondWithResult(_0xf63b53,null))['catch'](handleError(_0xf63b53,null));};exports['create']=function(_0x18294c,_0xdfcf9d){return db[_0x0d0d('0x34')][_0x0d0d('0x50')](_0x18294c[_0x0d0d('0x51')],{})['then'](respondWithResult(_0xdfcf9d,0xc9))[_0x0d0d('0x23')](handleError(_0xdfcf9d,null));};exports[_0x0d0d('0x2e')]=function(_0x22a196,_0x127793){if(_0x22a196['body']['id']){delete _0x22a196[_0x0d0d('0x51')]['id'];}return db[_0x0d0d('0x34')]['find']({'where':{'id':_0x22a196[_0x0d0d('0x4d')]['id']}})[_0x0d0d('0x1a')](handleEntityNotFound(_0x127793,null))['then'](saveUpdates(_0x22a196[_0x0d0d('0x51')],null))[_0x0d0d('0x1a')](respondWithResult(_0x127793,null))[_0x0d0d('0x23')](handleError(_0x127793,null));};exports[_0x0d0d('0x52')]=function(_0x1f29a1,_0x182e29){return db['VtigerAccount']['find']({'where':{'id':_0x1f29a1[_0x0d0d('0x4d')]['id']}})[_0x0d0d('0x1a')](handleEntityNotFound(_0x182e29,null))[_0x0d0d('0x1a')](removeEntity(_0x182e29,null))['catch'](handleError(_0x182e29,null));};exports[_0x0d0d('0x53')]=function(_0x2568cf,_0x3d1f1b,_0x3da24d){var _0x3f4487={};var _0x30dadd={};var _0x5ad5f9;var _0x59bbd4;return db[_0x0d0d('0x34')][_0x0d0d('0x54')]({'where':{'id':_0x2568cf[_0x0d0d('0x4d')]['id']}})[_0x0d0d('0x1a')](handleEntityNotFound(_0x3d1f1b,null))[_0x0d0d('0x1a')](function(_0x5a6b8a){if(_0x5a6b8a){_0x5ad5f9=_0x5a6b8a;_0x30dadd['model']=_['keys'](db[_0x0d0d('0x55')][_0x0d0d('0x35')]);_0x30dadd[_0x0d0d('0x38')]=_['keys'](_0x2568cf[_0x0d0d('0x38')]);_0x30dadd[_0x0d0d('0x3a')]=_[_0x0d0d('0x3c')](_0x30dadd[_0x0d0d('0x37')],_0x30dadd[_0x0d0d('0x38')]);_0x3f4487['attributes']=_[_0x0d0d('0x3c')](_0x30dadd[_0x0d0d('0x37')],qs[_0x0d0d('0x3d')](_0x2568cf[_0x0d0d('0x38')][_0x0d0d('0x3d')]));_0x3f4487['attributes']=_0x3f4487['attributes'][_0x0d0d('0x4e')]?_0x3f4487[_0x0d0d('0x3b')]:_0x30dadd['model'];_0x3f4487[_0x0d0d('0x40')]=qs[_0x0d0d('0x41')](_0x2568cf[_0x0d0d('0x38')]['sort']);_0x3f4487['where']=qs[_0x0d0d('0x3a')](_['pick'](_0x2568cf[_0x0d0d('0x38')],_0x30dadd[_0x0d0d('0x3a')]));if(_0x2568cf[_0x0d0d('0x38')][_0x0d0d('0x44')]){_0x3f4487[_0x0d0d('0x42')]=_[_0x0d0d('0x46')](_0x3f4487[_0x0d0d('0x42')],{'$or':_[_0x0d0d('0x33')](_0x3f4487[_0x0d0d('0x3b')],function(_0x1f3218){var _0x18812c={};_0x18812c[_0x1f3218]={'$like':'%'+_0x2568cf['query'][_0x0d0d('0x44')]+'%'};return _0x18812c;})});}_0x3f4487=_['merge']({},_0x3f4487,_0x2568cf[_0x0d0d('0x47')]);return _0x5ad5f9[_0x0d0d('0x53')](_0x3f4487);}})[_0x0d0d('0x1a')](function(_0x5b0a51){if(_0x5b0a51){_0x59bbd4=_0x5b0a51['length'];if(!_0x2568cf[_0x0d0d('0x38')]['hasOwnProperty'](_0x0d0d('0x3f'))){_0x3f4487['limit']=qs[_0x0d0d('0x28')](_0x2568cf[_0x0d0d('0x38')][_0x0d0d('0x28')]);_0x3f4487[_0x0d0d('0x2a')]=qs[_0x0d0d('0x2a')](_0x2568cf[_0x0d0d('0x38')][_0x0d0d('0x2a')]);}return _0x5ad5f9[_0x0d0d('0x53')](_0x3f4487);}})[_0x0d0d('0x1a')](function(_0x1bf00b){if(_0x1bf00b){return _0x1bf00b?{'count':_0x59bbd4,'rows':_0x1bf00b}:null;}})['then'](respondWithResult(_0x3d1f1b,null))[_0x0d0d('0x23')](handleError(_0x3d1f1b,null));};exports['addConfiguration']=function(_0x13cfb9,_0x38ee42,_0x21aebd){if(_0x13cfb9[_0x0d0d('0x51')]['id']){delete _0x13cfb9[_0x0d0d('0x51')]['id'];}return db[_0x0d0d('0x34')][_0x0d0d('0x54')]({'where':{'id':_0x13cfb9[_0x0d0d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x38ee42,null))[_0x0d0d('0x1a')](function(_0x4e8cf3){if(_0x4e8cf3){_0x13cfb9[_0x0d0d('0x51')][_0x0d0d('0x56')]=_0x4e8cf3['id'];_0x13cfb9[_0x0d0d('0x51')]['Subjects']=integrations[_0x0d0d('0x57')](_0x13cfb9['body']['channel'],_0x13cfb9[_0x0d0d('0x51')][_0x0d0d('0x36')]);_0x13cfb9[_0x0d0d('0x51')][_0x0d0d('0x58')]=integrations[_0x0d0d('0x59')](_0x13cfb9[_0x0d0d('0x51')][_0x0d0d('0x5a')],_0x13cfb9[_0x0d0d('0x51')]['type']);return db[_0x0d0d('0x55')][_0x0d0d('0x50')](_0x13cfb9['body'],{'include':[{'model':db[_0x0d0d('0x5b')],'as':_0x0d0d('0x5c')},{'model':db[_0x0d0d('0x5b')],'as':_0x0d0d('0x58')}]});}return null;})['then'](respondWithResult(_0x38ee42,null))['catch'](handleError(_0x38ee42,null));};var md5=require('md5');exports[_0x0d0d('0x5d')]=function(_0x9ffae4,_0x23856b,_0x3156b8){var _0xb501aa=null;var _0x257cb2=null;var _0x5c2318=null;var _0xa71617=null;var _0x35f6a3='';return db['VtigerAccount'][_0x0d0d('0x54')]({'where':{'id':_0x9ffae4[_0x0d0d('0x4d')]['id']},'attributes':['id',_0x0d0d('0x30'),_0x0d0d('0x5e'),_0x0d0d('0x5f'),'moduleName',_0x0d0d('0x60'),_0x0d0d('0x61'),_0x0d0d('0x62')]})[_0x0d0d('0x1a')](handleEntityNotFound(_0x23856b,null))[_0x0d0d('0x1a')](function(_0x593802){if(_0x593802){_0xb501aa=_0x593802['username'];_0x257cb2=_0x593802[_0x0d0d('0x62')];_0x5c2318=_0x593802['moduleName'];_0x35f6a3=_0x593802[_0x0d0d('0x60')];var _0x4721c9=_0x35f6a3[_0x0d0d('0x63')](-0x1);if(_0x4721c9==='/'){_0x35f6a3=_0x35f6a3['substring'](0x0,_0x35f6a3[_0x0d0d('0x64')](_0x4721c9));}_0xa71617=util[_0x0d0d('0x65')](_0x0d0d('0x66'),_0x35f6a3);var _0x633b21={'method':_0x0d0d('0x67'),'uri':_0xa71617,'qs':{'operation':_0x0d0d('0x68'),'username':_0x593802['username']},'json':!![]};return rp(_0x633b21);}})[_0x0d0d('0x1a')](function(_0x3e31ea){if(_0x3e31ea[_0x0d0d('0x69')]){var _0x2f36be={'method':_0x0d0d('0x6a'),'uri':_0xa71617,'form':{'operation':_0x0d0d('0x6b'),'username':_0xb501aa,'accessKey':md5(_0x3e31ea[_0x0d0d('0x22')][_0x0d0d('0x6c')]+_0x257cb2)},'json':!![]};return rp(_0x2f36be);}})['then'](function(_0x3cf662){if(_0x3cf662[_0x0d0d('0x69')]){var _0x4dcc81={'method':_0x0d0d('0x67'),'uri':_0xa71617,'qs':{'operation':_0x0d0d('0x6d'),'username':_0xb501aa,'sessionName':_0x3cf662[_0x0d0d('0x22')][_0x0d0d('0x6e')],'elementType':_0x5c2318},'json':!![]};return rp(_0x4dcc81);}})[_0x0d0d('0x1a')](function(_0x10b783){if(_0x10b783[_0x0d0d('0x69')]){var _0x283487=[_0x0d0d('0x6f'),_0x0d0d('0x70'),_0x0d0d('0x71')];_['remove'](_0x10b783[_0x0d0d('0x22')][_0x0d0d('0x3d')],function(_0x1d3143){return _0x283487[_0x0d0d('0x72')](_0x1d3143[_0x0d0d('0x36')]['name']);});_[_0x0d0d('0x73')](_0x10b783[_0x0d0d('0x22')]['fields'],function(_0x5389d8){return _0x5389d8[_0x0d0d('0x74')]===_0x0d0d('0x75');});return{'count':_0x10b783['result'][_0x0d0d('0x3d')][_0x0d0d('0x4e')],'rows':_[_0x0d0d('0x33')](_0x10b783[_0x0d0d('0x22')]['fields'],function(_0x42f896){return{'id':_0x42f896[_0x0d0d('0x30')],'name':_0x42f896[_0x0d0d('0x76')],'custom':_[_0x0d0d('0x77')](_0x42f896[_0x0d0d('0x30')],'cf_')?!![]:![],'options':_0x42f896[_0x0d0d('0x36')][_0x0d0d('0x30')]===_0x0d0d('0x78')&&_0x42f896[_0x0d0d('0x36')]['picklistValues'][_0x0d0d('0x4e')]>0x0?_[_0x0d0d('0x33')](_0x42f896[_0x0d0d('0x36')][_0x0d0d('0x79')],function(_0x534841){return{'name':_0x534841[_0x0d0d('0x76')],'value':_0x534841['value']};}):[]};})};}})[_0x0d0d('0x1a')](respondWithResult(_0x23856b,null))['catch'](function(_0x3ce92b){console[_0x0d0d('0x7a')](_0x0d0d('0x7b')+_0x3ce92b);var _0x3b35a5=_0x9ffae4[_0x0d0d('0x38')][_0x0d0d('0x7c')]?0x1f4:_0x3ce92b[_0x0d0d('0x7d')]||0x1f4;logger['error'](_0x0d0d('0x7e'),_0x0d0d('0x5d'),_0x3b35a5,JSON[_0x0d0d('0x1e')](_0x3ce92b));delete _0x3ce92b[_0x0d0d('0x30')];if(_0x3b35a5===0x191){_0x3b35a5=0x190;}_0x23856b[_0x0d0d('0x25')](_0x3b35a5)[_0x0d0d('0x31')](_0x9ffae4[_0x0d0d('0x38')][_0x0d0d('0x7c')]?{'message':_0x0d0d('0x7f'),'statusCode':_0x3ce92b[_0x0d0d('0x7d')]}:_0x3ce92b);});};
\ No newline at end of file
+var _0xb682=['end','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','getConfigurations','VtigerConfiguration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','Subjects','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','token','GET','describe','sessionName','reference','remove','editable','false','startsWith','cf_','picklistValues','label','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','save','destroy','then'];(function(_0x58cca0,_0x49b8e3){var _0x143bf4=function(_0x3c581a){while(--_0x3c581a){_0x58cca0['push'](_0x58cca0['shift']());}};_0x143bf4(++_0x49b8e3);}(_0xb682,0xce));var _0x2b68=function(_0x37e0a8,_0x184bc8){_0x37e0a8=_0x37e0a8-0x0;var _0x5ca63c=_0xb682[_0x37e0a8];return _0x5ca63c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b68('0x0'));var zipdir=require(_0x2b68('0x1'));var jsonpatch=require(_0x2b68('0x2'));var rp=require('request-promise');var moment=require(_0x2b68('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2b68('0x4'));var sox=require(_0x2b68('0x5'));var csv=require(_0x2b68('0x6'));var ejs=require(_0x2b68('0x7'));var fs=require('fs');var fs_extra=require(_0x2b68('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b68('0x9'));var jsforce=require(_0x2b68('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2b68('0x6'));var querystring=require(_0x2b68('0xb'));var Papa=require('papaparse');var Redis=require(_0x2b68('0xc'));var authService=require(_0x2b68('0xd'));var qs=require(_0x2b68('0xe'));var as=require(_0x2b68('0xf'));var hardwareService=require(_0x2b68('0x10'));var logger=require(_0x2b68('0x11'))('api');var utils=require(_0x2b68('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2b68('0x13'));var db=require(_0x2b68('0x14'))['db'];var integrations=require(_0x2b68('0x15'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d6455,_0x13397d,_0x30fae0,_0x206863){return new BPromise(function(_0x532263,_0x5a70d1){var _0x402f7f=_0x206863||client;return _0x402f7f[_0x2b68('0x16')](_0x5d6455,_0x30fae0)['then'](function(_0x22439e){logger[_0x2b68('0x17')](_0x2b68('0x18'),_0x13397d,_0x2b68('0x19'));logger[_0x2b68('0x1a')](_0x2b68('0x1b'),_0x13397d,_0x2b68('0x19'),JSON[_0x2b68('0x1c')](_0x22439e));if(_0x22439e[_0x2b68('0x1d')]){if(_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1e')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x13397d,_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1f')]);return _0x5a70d1(_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1f')]);}logger[_0x2b68('0x1d')](_0x2b68('0x18'),_0x13397d,_0x22439e['error'][_0x2b68('0x1f')]);return _0x532263(_0x22439e[_0x2b68('0x1d')][_0x2b68('0x1f')]);}else{logger[_0x2b68('0x17')]('VtigerAccount,\x20%s,\x20%s',_0x13397d,'request\x20sent');_0x532263(_0x22439e[_0x2b68('0x20')][_0x2b68('0x1f')]);}})[_0x2b68('0x21')](function(_0x5a4fed){logger['error'](_0x2b68('0x18'),_0x13397d,_0x5a4fed);_0x5a70d1(_0x5a4fed);});});}function respondWithStatusCode(_0x403bdb,_0x268501){_0x268501=_0x268501||0xcc;return function(_0x4427bb){if(_0x4427bb){return _0x403bdb[_0x2b68('0x22')](_0x268501);}return _0x403bdb[_0x2b68('0x23')](_0x268501)['end']();};}function respondWithResult(_0xc97a4,_0x3bc0d9){_0x3bc0d9=_0x3bc0d9||0xc8;return function(_0x16c462){if(_0x16c462){return _0xc97a4[_0x2b68('0x23')](_0x3bc0d9)['json'](_0x16c462);}};}function respondWithFilteredResult(_0x5aab41,_0x51bbac){return function(_0x3eb03a){if(_0x3eb03a){var _0x8a20a6=typeof _0x51bbac[_0x2b68('0x24')]==='undefined'&&typeof _0x51bbac[_0x2b68('0x25')]==='undefined';var _0x38aace=_0x3eb03a['count'];var _0x137493=_0x8a20a6?0x0:_0x51bbac[_0x2b68('0x24')];var _0x28b12d=_0x8a20a6?_0x3eb03a[_0x2b68('0x26')]:_0x51bbac[_0x2b68('0x24')]+_0x51bbac[_0x2b68('0x25')];var _0x416d2a;if(_0x28b12d>=_0x38aace){_0x28b12d=_0x38aace;_0x416d2a=0xc8;}else{_0x416d2a=0xce;}_0x5aab41[_0x2b68('0x23')](_0x416d2a);return _0x5aab41[_0x2b68('0x27')](_0x2b68('0x28'),_0x137493+'-'+_0x28b12d+'/'+_0x38aace)[_0x2b68('0x29')](_0x3eb03a);}return null;};}function patchUpdates(_0x43661f){return function(_0x371927){try{jsonpatch[_0x2b68('0x2a')](_0x371927,_0x43661f,!![]);}catch(_0xa005f0){return BPromise['reject'](_0xa005f0);}return _0x371927[_0x2b68('0x2b')]();};}function saveUpdates(_0x6b2f14,_0x464dc5){return function(_0x20f776){if(_0x20f776){return _0x20f776['update'](_0x6b2f14)['then'](function(_0x2272c4){return _0x2272c4;});}return null;};}function removeEntity(_0x25a304,_0xc7032a){return function(_0x5b9b9f){if(_0x5b9b9f){return _0x5b9b9f[_0x2b68('0x2c')]()[_0x2b68('0x2d')](function(){_0x25a304[_0x2b68('0x23')](0xcc)[_0x2b68('0x2e')]();});}};}function handleEntityNotFound(_0x4538e9,_0x32d295){return function(_0x19743f){if(!_0x19743f){_0x4538e9['sendStatus'](0x194);}return _0x19743f;};}function handleError(_0x1a8c53,_0x1dbc12){_0x1dbc12=_0x1dbc12||0x1f4;return function(_0x47ab09){logger['error'](_0x47ab09[_0x2b68('0x2f')]);if(_0x47ab09[_0x2b68('0x30')]){delete _0x47ab09[_0x2b68('0x30')];}_0x1a8c53[_0x2b68('0x23')](_0x1dbc12)[_0x2b68('0x31')](_0x47ab09);};}exports[_0x2b68('0x32')]=function(_0x9aa3d3,_0x455175){var _0x51212d={},_0x123225={},_0x3bc2a3={'count':0x0,'rows':[]};var _0x4762d2=_[_0x2b68('0x33')](db[_0x2b68('0x34')][_0x2b68('0x35')],function(_0x21fed6){return{'name':_0x21fed6[_0x2b68('0x36')],'type':_0x21fed6[_0x2b68('0x37')][_0x2b68('0x38')]};});_0x123225[_0x2b68('0x39')]=_[_0x2b68('0x33')](_0x4762d2,_0x2b68('0x30'));_0x123225[_0x2b68('0x3a')]=_['keys'](_0x9aa3d3['query']);_0x123225[_0x2b68('0x3b')]=_[_0x2b68('0x3c')](_0x123225[_0x2b68('0x39')],_0x123225[_0x2b68('0x3a')]);_0x51212d['attributes']=_[_0x2b68('0x3c')](_0x123225[_0x2b68('0x39')],qs[_0x2b68('0x3d')](_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x3d')]));_0x51212d[_0x2b68('0x3e')]=_0x51212d[_0x2b68('0x3e')][_0x2b68('0x3f')]?_0x51212d[_0x2b68('0x3e')]:_0x123225[_0x2b68('0x39')];if(!_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x40')](_0x2b68('0x41'))){_0x51212d[_0x2b68('0x25')]=qs[_0x2b68('0x25')](_0x9aa3d3['query'][_0x2b68('0x25')]);_0x51212d[_0x2b68('0x24')]=qs[_0x2b68('0x24')](_0x9aa3d3['query']['offset']);}_0x51212d[_0x2b68('0x42')]=qs[_0x2b68('0x43')](_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x43')]);_0x51212d[_0x2b68('0x44')]=qs[_0x2b68('0x3b')](_[_0x2b68('0x45')](_0x9aa3d3[_0x2b68('0x3a')],_0x123225['filters']),_0x4762d2);if(_0x9aa3d3[_0x2b68('0x3a')]['filter']){_0x51212d[_0x2b68('0x44')]=_[_0x2b68('0x46')](_0x51212d[_0x2b68('0x44')],{'$or':_[_0x2b68('0x33')](_0x4762d2,function(_0x4ea8e7){if(_0x4ea8e7[_0x2b68('0x37')]!=='VIRTUAL'){var _0x19a469={};_0x19a469[_0x4ea8e7[_0x2b68('0x30')]]={'$like':'%'+_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x47')]+'%'};return _0x19a469;}})});}_0x51212d=_[_0x2b68('0x46')]({},_0x51212d,_0x9aa3d3[_0x2b68('0x48')]);var _0x533e41={'where':_0x51212d[_0x2b68('0x44')]};return db[_0x2b68('0x34')][_0x2b68('0x26')](_0x533e41)[_0x2b68('0x2d')](function(_0x36783e){_0x3bc2a3[_0x2b68('0x26')]=_0x36783e;if(_0x9aa3d3[_0x2b68('0x3a')][_0x2b68('0x49')]){_0x51212d['include']=[{'all':!![]}];}return db[_0x2b68('0x34')][_0x2b68('0x4a')](_0x51212d);})[_0x2b68('0x2d')](function(_0x2e0814){_0x3bc2a3[_0x2b68('0x4b')]=_0x2e0814;return _0x3bc2a3;})[_0x2b68('0x2d')](respondWithFilteredResult(_0x455175,_0x51212d))[_0x2b68('0x21')](handleError(_0x455175,null));};exports[_0x2b68('0x4c')]=function(_0x1a5f59,_0x2469ae){var _0x49dd37={'raw':![],'where':{'id':_0x1a5f59[_0x2b68('0x4d')]['id']}},_0x560342={};_0x560342[_0x2b68('0x39')]=_[_0x2b68('0x4e')](db[_0x2b68('0x34')][_0x2b68('0x35')]);_0x560342['query']=_['keys'](_0x1a5f59['query']);_0x560342[_0x2b68('0x3b')]=_[_0x2b68('0x3c')](_0x560342[_0x2b68('0x39')],_0x560342[_0x2b68('0x3a')]);_0x49dd37['attributes']=_[_0x2b68('0x3c')](_0x560342['model'],qs['fields'](_0x1a5f59[_0x2b68('0x3a')]['fields']));_0x49dd37[_0x2b68('0x3e')]=_0x49dd37[_0x2b68('0x3e')]['length']?_0x49dd37[_0x2b68('0x3e')]:_0x560342[_0x2b68('0x39')];if(_0x1a5f59[_0x2b68('0x3a')][_0x2b68('0x49')]){_0x49dd37[_0x2b68('0x4f')]=[{'all':!![]}];}_0x49dd37=_[_0x2b68('0x46')]({},_0x49dd37,_0x1a5f59['options']);return db[_0x2b68('0x34')][_0x2b68('0x50')](_0x49dd37)['then'](handleEntityNotFound(_0x2469ae,null))[_0x2b68('0x2d')](respondWithResult(_0x2469ae,null))['catch'](handleError(_0x2469ae,null));};exports[_0x2b68('0x51')]=function(_0xb0aea4,_0x45ce28){return db[_0x2b68('0x34')][_0x2b68('0x51')](_0xb0aea4[_0x2b68('0x52')],{})[_0x2b68('0x2d')](respondWithResult(_0x45ce28,0xc9))[_0x2b68('0x21')](handleError(_0x45ce28,null));};exports['update']=function(_0x19a844,_0x45a7c4){if(_0x19a844[_0x2b68('0x52')]['id']){delete _0x19a844[_0x2b68('0x52')]['id'];}return db[_0x2b68('0x34')]['find']({'where':{'id':_0x19a844['params']['id']}})[_0x2b68('0x2d')](handleEntityNotFound(_0x45a7c4,null))[_0x2b68('0x2d')](saveUpdates(_0x19a844[_0x2b68('0x52')],null))[_0x2b68('0x2d')](respondWithResult(_0x45a7c4,null))[_0x2b68('0x21')](handleError(_0x45a7c4,null));};exports[_0x2b68('0x2c')]=function(_0x2f1f51,_0x1aa879){return db['VtigerAccount'][_0x2b68('0x50')]({'where':{'id':_0x2f1f51[_0x2b68('0x4d')]['id']}})[_0x2b68('0x2d')](handleEntityNotFound(_0x1aa879,null))[_0x2b68('0x2d')](removeEntity(_0x1aa879,null))[_0x2b68('0x21')](handleError(_0x1aa879,null));};exports[_0x2b68('0x53')]=function(_0x5c15a2,_0x4c873c,_0x48991e){var _0xcce213={};var _0x47a65={};var _0x568b31;var _0x4fbac5;return db['VtigerAccount']['findOne']({'where':{'id':_0x5c15a2[_0x2b68('0x4d')]['id']}})[_0x2b68('0x2d')](handleEntityNotFound(_0x4c873c,null))['then'](function(_0x10e7c1){if(_0x10e7c1){_0x568b31=_0x10e7c1;_0x47a65[_0x2b68('0x39')]=_[_0x2b68('0x4e')](db[_0x2b68('0x54')][_0x2b68('0x35')]);_0x47a65['query']=_[_0x2b68('0x4e')](_0x5c15a2[_0x2b68('0x3a')]);_0x47a65['filters']=_['intersection'](_0x47a65['model'],_0x47a65[_0x2b68('0x3a')]);_0xcce213[_0x2b68('0x3e')]=_['intersection'](_0x47a65[_0x2b68('0x39')],qs[_0x2b68('0x3d')](_0x5c15a2['query'][_0x2b68('0x3d')]));_0xcce213[_0x2b68('0x3e')]=_0xcce213[_0x2b68('0x3e')]['length']?_0xcce213['attributes']:_0x47a65[_0x2b68('0x39')];_0xcce213[_0x2b68('0x42')]=qs[_0x2b68('0x43')](_0x5c15a2[_0x2b68('0x3a')]['sort']);_0xcce213[_0x2b68('0x44')]=qs[_0x2b68('0x3b')](_[_0x2b68('0x45')](_0x5c15a2[_0x2b68('0x3a')],_0x47a65[_0x2b68('0x3b')]));if(_0x5c15a2[_0x2b68('0x3a')][_0x2b68('0x47')]){_0xcce213[_0x2b68('0x44')]=_[_0x2b68('0x46')](_0xcce213[_0x2b68('0x44')],{'$or':_['map'](_0xcce213['attributes'],function(_0x3b439e){var _0xff00e={};_0xff00e[_0x3b439e]={'$like':'%'+_0x5c15a2[_0x2b68('0x3a')][_0x2b68('0x47')]+'%'};return _0xff00e;})});}_0xcce213=_[_0x2b68('0x46')]({},_0xcce213,_0x5c15a2[_0x2b68('0x48')]);return _0x568b31[_0x2b68('0x53')](_0xcce213);}})[_0x2b68('0x2d')](function(_0x26b550){if(_0x26b550){_0x4fbac5=_0x26b550[_0x2b68('0x3f')];if(!_0x5c15a2[_0x2b68('0x3a')][_0x2b68('0x40')](_0x2b68('0x41'))){_0xcce213['limit']=qs['limit'](_0x5c15a2[_0x2b68('0x3a')]['limit']);_0xcce213['offset']=qs['offset'](_0x5c15a2['query']['offset']);}return _0x568b31[_0x2b68('0x53')](_0xcce213);}})['then'](function(_0x514b9a){if(_0x514b9a){return _0x514b9a?{'count':_0x4fbac5,'rows':_0x514b9a}:null;}})['then'](respondWithResult(_0x4c873c,null))[_0x2b68('0x21')](handleError(_0x4c873c,null));};exports[_0x2b68('0x55')]=function(_0x2660a7,_0x1d3dff,_0x19a803){if(_0x2660a7[_0x2b68('0x52')]['id']){delete _0x2660a7[_0x2b68('0x52')]['id'];}return db[_0x2b68('0x34')][_0x2b68('0x56')]({'where':{'id':_0x2660a7['params']['id']}})['then'](handleEntityNotFound(_0x1d3dff,null))[_0x2b68('0x2d')](function(_0x5d1f9c){if(_0x5d1f9c){_0x2660a7[_0x2b68('0x52')][_0x2b68('0x57')]=_0x5d1f9c['id'];_0x2660a7[_0x2b68('0x52')]['Subjects']=integrations[_0x2b68('0x58')](_0x2660a7[_0x2b68('0x52')][_0x2b68('0x59')],_0x2660a7[_0x2b68('0x52')][_0x2b68('0x37')]);_0x2660a7[_0x2b68('0x52')][_0x2b68('0x5a')]=integrations['getDescriptions'](_0x2660a7[_0x2b68('0x52')]['channel'],_0x2660a7[_0x2b68('0x52')][_0x2b68('0x37')]);return db[_0x2b68('0x54')][_0x2b68('0x51')](_0x2660a7['body'],{'include':[{'model':db['VtigerField'],'as':_0x2b68('0x5b')},{'model':db[_0x2b68('0x5c')],'as':_0x2b68('0x5a')}]});}return null;})[_0x2b68('0x2d')](respondWithResult(_0x1d3dff,null))[_0x2b68('0x21')](handleError(_0x1d3dff,null));};var md5=require(_0x2b68('0x5d'));exports[_0x2b68('0x5e')]=function(_0x2b646e,_0x1e548e,_0x51a4a2){var _0x56e1c8=null;var _0x573e9a=null;var _0x15e8b3=null;var _0x5ac78d=null;var _0x3362cc='';return db[_0x2b68('0x34')][_0x2b68('0x56')]({'where':{'id':_0x2b646e[_0x2b68('0x4d')]['id']},'attributes':['id','name',_0x2b68('0x5f'),_0x2b68('0x60'),'moduleName',_0x2b68('0x61'),_0x2b68('0x62'),_0x2b68('0x63')]})[_0x2b68('0x2d')](handleEntityNotFound(_0x1e548e,null))[_0x2b68('0x2d')](function(_0x4f5e98){if(_0x4f5e98){_0x56e1c8=_0x4f5e98['username'];_0x573e9a=_0x4f5e98[_0x2b68('0x63')];_0x15e8b3=_0x4f5e98[_0x2b68('0x64')];_0x3362cc=_0x4f5e98[_0x2b68('0x61')];var _0x5b0bc7=_0x3362cc[_0x2b68('0x65')](-0x1);if(_0x5b0bc7==='/'){_0x3362cc=_0x3362cc[_0x2b68('0x66')](0x0,_0x3362cc[_0x2b68('0x67')](_0x5b0bc7));}_0x5ac78d=util['format'](_0x2b68('0x68'),_0x3362cc);var _0x3756a6={'method':'GET','uri':_0x5ac78d,'qs':{'operation':_0x2b68('0x69'),'username':_0x4f5e98[_0x2b68('0x5f')]},'json':!![]};return rp(_0x3756a6);}})[_0x2b68('0x2d')](function(_0x34fee7){if(_0x34fee7[_0x2b68('0x6a')]){var _0x3d287b={'method':_0x2b68('0x6b'),'uri':_0x5ac78d,'form':{'operation':_0x2b68('0x6c'),'username':_0x56e1c8,'accessKey':md5(_0x34fee7[_0x2b68('0x20')][_0x2b68('0x6d')]+_0x573e9a)},'json':!![]};return rp(_0x3d287b);}})[_0x2b68('0x2d')](function(_0x20b17b){if(_0x20b17b[_0x2b68('0x6a')]){var _0x2b5720={'method':_0x2b68('0x6e'),'uri':_0x5ac78d,'qs':{'operation':_0x2b68('0x6f'),'username':_0x56e1c8,'sessionName':_0x20b17b['result'][_0x2b68('0x70')],'elementType':_0x15e8b3},'json':!![]};return rp(_0x2b5720);}})[_0x2b68('0x2d')](function(_0x1f605b){if(_0x1f605b[_0x2b68('0x6a')]){var _0x110b6d=['autogenerated',_0x2b68('0x71'),'owner'];_[_0x2b68('0x72')](_0x1f605b['result'][_0x2b68('0x3d')],function(_0x1e4dfe){return _0x110b6d['includes'](_0x1e4dfe[_0x2b68('0x37')][_0x2b68('0x30')]);});_[_0x2b68('0x72')](_0x1f605b[_0x2b68('0x20')]['fields'],function(_0x7448bd){return _0x7448bd[_0x2b68('0x73')]===_0x2b68('0x74');});return{'count':_0x1f605b[_0x2b68('0x20')][_0x2b68('0x3d')][_0x2b68('0x3f')],'rows':_[_0x2b68('0x33')](_0x1f605b[_0x2b68('0x20')][_0x2b68('0x3d')],function(_0x29a9ee){return{'id':_0x29a9ee[_0x2b68('0x30')],'name':_0x29a9ee['label'],'custom':_[_0x2b68('0x75')](_0x29a9ee['name'],_0x2b68('0x76'))?!![]:![],'options':_0x29a9ee[_0x2b68('0x37')][_0x2b68('0x30')]==='picklist'&&_0x29a9ee['type']['picklistValues'][_0x2b68('0x3f')]>0x0?_[_0x2b68('0x33')](_0x29a9ee[_0x2b68('0x37')][_0x2b68('0x77')],function(_0x5dee8a){return{'name':_0x5dee8a[_0x2b68('0x78')],'value':_0x5dee8a['value']};}):[]};})};}})['then'](respondWithResult(_0x1e548e,null))[_0x2b68('0x21')](function(_0x4a0825){console[_0x2b68('0x79')]('vTiger\x20error:\x20'+_0x4a0825);var _0x2986d6=_0x2b646e[_0x2b68('0x3a')][_0x2b68('0x7a')]?0x1f4:_0x4a0825[_0x2b68('0x7b')]||0x1f4;logger[_0x2b68('0x1d')](_0x2b68('0x7c'),_0x2b68('0x5e'),_0x2986d6,JSON[_0x2b68('0x1c')](_0x4a0825));delete _0x4a0825[_0x2b68('0x30')];if(_0x2986d6===0x191){_0x2986d6=0x190;}_0x1e548e['status'](_0x2986d6)[_0x2b68('0x31')](_0x2b646e['query'][_0x2b68('0x7a')]?{'message':_0x2b68('0x7d'),'statusCode':_0x4a0825[_0x2b68('0x7b')]}:_0x4a0825);});};
\ No newline at end of file
index cff6d54..c433b85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4df=['VtigerAccount','int_vtiger_accounts','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0xd4df,0xb2));var _0xfd4d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4df[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfd4d('0x0'))('api');var moment=require(_0xfd4d('0x1'));var BPromise=require(_0xfd4d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4d('0x3'));var rimraf=require(_0xfd4d('0x4'));var config=require(_0xfd4d('0x5'));var attributes=require(_0xfd4d('0x6'));var integrations=require(_0xfd4d('0x7'));module['exports']=function(_0x2c4b5a,_0x2fda04){return _0x2c4b5a[_0xfd4d('0x8')](_0xfd4d('0x9'),attributes,{'tableName':_0xfd4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a8a=['api','moment','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','int_vtiger_accounts','lodash','util'];(function(_0x312776,_0x433590){var _0x148a74=function(_0x4cd919){while(--_0x4cd919){_0x312776['push'](_0x312776['shift']());}};_0x148a74(++_0x433590);}(_0x0a8a,0x1e8));var _0xa0a8=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x0a8a[_0x188a93];return _0x23b40d;};'use strict';var _=require(_0xa0a8('0x0'));var util=require(_0xa0a8('0x1'));var logger=require('../../config/logger')(_0xa0a8('0x2'));var moment=require(_0xa0a8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa0a8('0x4'));var fs=require('fs');var path=require(_0xa0a8('0x5'));var rimraf=require(_0xa0a8('0x6'));var config=require('../../config/environment');var attributes=require(_0xa0a8('0x7'));var integrations=require(_0xa0a8('0x8'));module['exports']=function(_0x586dca,_0x5e54ce){return _0x586dca['define']('VtigerAccount',attributes,{'tableName':_0xa0a8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe2a73e..edebf73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa902=['include','map','model','ShowVtigerAccount','VtigerAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xa902,0x8d));var _0x2a90=function(_0x513a4b,_0x51ef90){_0x513a4b=_0x513a4b-0x0;var _0x5417b5=_0xa902[_0x513a4b];return _0x5417b5;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}exports[_0x2a90('0x17')]=function(_0x5c3e4b){var _0x162f0b=this;return new Promise(function(_0x1d9a28,_0x4190ff){return db['VtigerAccount'][_0x2a90('0x18')]({'raw':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1c')]||null:null,'limit':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')]['limit']||null:null,'include':_0x5c3e4b[_0x2a90('0x19')]?_0x5c3e4b[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x5c3e4b['options'][_0x2a90('0x1d')],function(_0xd033d){return{'model':db[_0xd033d['model']],'as':_0xd033d['as'],'attributes':_0xd033d[_0x2a90('0x1c')],'include':_0xd033d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0xd033d[_0x2a90('0x1d')],function(_0x2a212c){return{'model':db[_0x2a212c[_0x2a90('0x1f')]],'as':_0x2a212c['as'],'attributes':_0x2a212c[_0x2a90('0x1c')],'include':_0x2a212c[_0x2a90('0x1d')]?_['map'](_0x2a212c[_0x2a90('0x1d')],function(_0x17f978){return{'model':db[_0x17f978[_0x2a90('0x1f')]],'as':_0x17f978['as'],'attributes':_0x17f978[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x5208d8){logger['info'](_0x2a90('0x17'),_0x5c3e4b);logger['debug']('GetVtigerAccount',_0x5c3e4b,JSON['stringify'](_0x5208d8));_0x1d9a28(_0x5208d8);})[_0x2a90('0x16')](function(_0x3c78f5){logger['error']('GetVtigerAccount',_0x3c78f5[_0x2a90('0x14')],_0x5c3e4b);_0x4190ff(_0x162f0b['error'](0x1f4,_0x3c78f5[_0x2a90('0x14')]));});});};exports[_0x2a90('0x20')]=function(_0x3b580f){var _0x27b6b6=this;return new Promise(function(_0xf18d11,_0x11586c){return db[_0x2a90('0x21')]['find']({'raw':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1a')]===undefined?!![]:![]:!![],'where':_0x3b580f['options']?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1b')]||null:null,'attributes':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')]['attributes']||null:null,'include':_0x3b580f[_0x2a90('0x19')]?_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x3b580f[_0x2a90('0x19')][_0x2a90('0x1d')],function(_0x4d4149){return{'model':db[_0x4d4149[_0x2a90('0x1f')]],'as':_0x4d4149['as'],'attributes':_0x4d4149[_0x2a90('0x1c')],'include':_0x4d4149[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x4d4149['include'],function(_0x1bab1d){return{'model':db[_0x1bab1d[_0x2a90('0x1f')]],'as':_0x1bab1d['as'],'attributes':_0x1bab1d['attributes'],'include':_0x1bab1d[_0x2a90('0x1d')]?_[_0x2a90('0x1e')](_0x1bab1d['include'],function(_0x5073a4){return{'model':db[_0x5073a4[_0x2a90('0x1f')]],'as':_0x5073a4['as'],'attributes':_0x5073a4[_0x2a90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2a90('0xc')](function(_0x4cd36c){logger[_0x2a90('0xd')]('ShowVtigerAccount',_0x3b580f);logger[_0x2a90('0xf')]('ShowVtigerAccount',_0x3b580f,JSON[_0x2a90('0x12')](_0x4cd36c));_0xf18d11(_0x4cd36c);})['catch'](function(_0x5322dc){logger[_0x2a90('0x13')]('ShowVtigerAccount',_0x5322dc[_0x2a90('0x14')],_0x3b580f);_0x11586c(_0x27b6b6[_0x2a90('0x13')](0x1f4,_0x5322dc[_0x2a90('0x14')]));});});};
\ No newline at end of file
+var _0x5c00=['where','limit','include','map','model','attributes','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVtigerAccount','findAll','options','raw'];(function(_0x2245da,_0x43164d){var _0x1c2998=function(_0x3b980e){while(--_0x3b980e){_0x2245da['push'](_0x2245da['shift']());}};_0x1c2998(++_0x43164d);}(_0x5c00,0x17e));var _0x05c0=function(_0x2a2799,_0x5e25a8){_0x2a2799=_0x2a2799-0x0;var _0x17f761=_0x5c00[_0x2a2799];return _0x17f761;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}exports[_0x05c0('0x16')]=function(_0x521cbd){var _0x422401=this;return new Promise(function(_0x1230e5,_0x4613c0){return db['VtigerAccount'][_0x05c0('0x17')]({'raw':_0x521cbd[_0x05c0('0x18')]?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x19')]===undefined?!![]:![]:!![],'where':_0x521cbd[_0x05c0('0x18')]?_0x521cbd['options'][_0x05c0('0x1a')]||null:null,'attributes':_0x521cbd[_0x05c0('0x18')]?_0x521cbd['options']['attributes']||null:null,'limit':_0x521cbd['options']?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x1b')]||null:null,'include':_0x521cbd[_0x05c0('0x18')]?_0x521cbd[_0x05c0('0x18')][_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x521cbd[_0x05c0('0x18')]['include'],function(_0x9b4930){return{'model':db[_0x9b4930[_0x05c0('0x1e')]],'as':_0x9b4930['as'],'attributes':_0x9b4930['attributes'],'include':_0x9b4930['include']?_['map'](_0x9b4930['include'],function(_0x56aa78){return{'model':db[_0x56aa78[_0x05c0('0x1e')]],'as':_0x56aa78['as'],'attributes':_0x56aa78[_0x05c0('0x1f')],'include':_0x56aa78['include']?_[_0x05c0('0x1d')](_0x56aa78[_0x05c0('0x1c')],function(_0x3617dc){return{'model':db[_0x3617dc[_0x05c0('0x1e')]],'as':_0x3617dc['as'],'attributes':_0x3617dc['attributes']};}):[]};}):[]};}):[]:[]})[_0x05c0('0xb')](function(_0x1c14b1){logger[_0x05c0('0xc')](_0x05c0('0x16'),_0x521cbd);logger[_0x05c0('0xf')](_0x05c0('0x16'),_0x521cbd,JSON['stringify'](_0x1c14b1));_0x1230e5(_0x1c14b1);})['catch'](function(_0x2df109){logger[_0x05c0('0x11')](_0x05c0('0x16'),_0x2df109[_0x05c0('0x13')],_0x521cbd);_0x4613c0(_0x422401[_0x05c0('0x11')](0x1f4,_0x2df109[_0x05c0('0x13')]));});});};exports[_0x05c0('0x20')]=function(_0x3c9eb1){var _0x33eff3=this;return new Promise(function(_0x87b07c,_0x3e38f0){return db[_0x05c0('0x21')]['find']({'raw':_0x3c9eb1['options']?_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x19')]===undefined?!![]:![]:!![],'where':_0x3c9eb1[_0x05c0('0x18')]?_0x3c9eb1['options'][_0x05c0('0x1a')]||null:null,'attributes':_0x3c9eb1[_0x05c0('0x18')]?_0x3c9eb1['options'][_0x05c0('0x1f')]||null:null,'include':_0x3c9eb1['options']?_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x3c9eb1[_0x05c0('0x18')][_0x05c0('0x1c')],function(_0x2a9e82){return{'model':db[_0x2a9e82[_0x05c0('0x1e')]],'as':_0x2a9e82['as'],'attributes':_0x2a9e82[_0x05c0('0x1f')],'include':_0x2a9e82[_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x2a9e82[_0x05c0('0x1c')],function(_0x3a9c63){return{'model':db[_0x3a9c63[_0x05c0('0x1e')]],'as':_0x3a9c63['as'],'attributes':_0x3a9c63[_0x05c0('0x1f')],'include':_0x3a9c63[_0x05c0('0x1c')]?_[_0x05c0('0x1d')](_0x3a9c63[_0x05c0('0x1c')],function(_0x21c22){return{'model':db[_0x21c22[_0x05c0('0x1e')]],'as':_0x21c22['as'],'attributes':_0x21c22[_0x05c0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x05c0('0xb')](function(_0x337847){logger[_0x05c0('0xc')](_0x05c0('0x20'),_0x3c9eb1);logger[_0x05c0('0xf')](_0x05c0('0x20'),_0x3c9eb1,JSON[_0x05c0('0x10')](_0x337847));_0x87b07c(_0x337847);})[_0x05c0('0x15')](function(_0x40d4db){logger[_0x05c0('0x11')](_0x05c0('0x20'),_0x40d4db[_0x05c0('0x13')],_0x3c9eb1);_0x3e38f0(_0x33eff3[_0x05c0('0x11')](0x1f4,_0x40d4db['message']));});});};
\ No newline at end of file
index 9cfdd9b..b682a26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b70=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','post','destroy','exports','multer','util','path'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0x6b70,0xf9));var _0x06b7=function(_0x13f2ec,_0x407206){_0x13f2ec=_0x13f2ec-0x0;var _0x389ca9=_0x6b70[_0x13f2ec];return _0x389ca9;};'use strict';var multer=require(_0x06b7('0x0'));var util=require(_0x06b7('0x1'));var path=require(_0x06b7('0x2'));var timeout=require(_0x06b7('0x3'));var express=require(_0x06b7('0x4'));var router=express[_0x06b7('0x5')]();var fs_extra=require(_0x06b7('0x6'));var auth=require(_0x06b7('0x7'));var interaction=require(_0x06b7('0x8'));var config=require(_0x06b7('0x9'));var controller=require(_0x06b7('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x06b7('0xb')](_0x06b7('0xc'),auth[_0x06b7('0xd')](),controller['show']);router['get'](_0x06b7('0xe'),auth[_0x06b7('0xd')](),controller[_0x06b7('0xf')]);router[_0x06b7('0xb')]('/:id/subjects',auth[_0x06b7('0xd')](),controller[_0x06b7('0x10')]);router[_0x06b7('0xb')](_0x06b7('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x06b7('0x12')]('/',auth[_0x06b7('0xd')](),controller['create']);router['put'](_0x06b7('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x06b7('0xc'),auth[_0x06b7('0xd')](),controller[_0x06b7('0x13')]);module[_0x06b7('0x14')]=router;
\ No newline at end of file
+var _0x896a=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getDescriptions','post','create','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4d88f6,_0x52f758){var _0x2041c8=function(_0x16f556){while(--_0x16f556){_0x4d88f6['push'](_0x4d88f6['shift']());}};_0x2041c8(++_0x52f758);}(_0x896a,0xd4));var _0xa896=function(_0x554221,_0x1018ed){_0x554221=_0x554221-0x0;var _0x47a7b2=_0x896a[_0x554221];return _0x47a7b2;};'use strict';var multer=require(_0xa896('0x0'));var util=require(_0xa896('0x1'));var path=require(_0xa896('0x2'));var timeout=require(_0xa896('0x3'));var express=require('express');var router=express[_0xa896('0x4')]();var fs_extra=require(_0xa896('0x5'));var auth=require(_0xa896('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa896('0x7'));var controller=require(_0xa896('0x8'));router[_0xa896('0x9')]('/',auth[_0xa896('0xa')](),controller[_0xa896('0xb')]);router[_0xa896('0x9')](_0xa896('0xc'),auth[_0xa896('0xa')](),controller[_0xa896('0xd')]);router[_0xa896('0x9')](_0xa896('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xa896('0x9')](_0xa896('0xf'),auth[_0xa896('0xa')](),controller['getSubjects']);router[_0xa896('0x9')]('/:id/descriptions',auth[_0xa896('0xa')](),controller[_0xa896('0x10')]);router[_0xa896('0x11')]('/',auth[_0xa896('0xa')](),controller[_0xa896('0x12')]);router['put'](_0xa896('0xc'),auth[_0xa896('0xa')](),controller['update']);router['delete'](_0xa896('0xc'),auth[_0xa896('0xa')](),controller['destroy']);module[_0xa896('0x13')]=router;
\ No newline at end of file
index 3503dd5..660abb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71cd=['exports','STRING'];(function(_0x3a15ec,_0x26d664){var _0x31048d=function(_0x7e1a9e){while(--_0x7e1a9e){_0x3a15ec['push'](_0x3a15ec['shift']());}};_0x31048d(++_0x26d664);}(_0x71cd,0x98));var _0xd71c=function(_0x234e1a,_0x500d79){_0x234e1a=_0x234e1a-0x0;var _0x55aad2=_0x71cd[_0x234e1a];return _0x55aad2;};'use strict';var Sequelize=require('sequelize');module[_0xd71c('0x0')]={'name':{'type':Sequelize[_0xd71c('0x1')]},'description':{'type':Sequelize[_0xd71c('0x1')]}};
\ No newline at end of file
+var _0x49df=['exports','STRING','sequelize'];(function(_0x16a62e,_0x736189){var _0x1d5fa8=function(_0x1bd322){while(--_0x1bd322){_0x16a62e['push'](_0x16a62e['shift']());}};_0x1d5fa8(++_0x736189);}(_0x49df,0x179));var _0xf49d=function(_0x4fbc20,_0x33bbc4){_0x4fbc20=_0x4fbc20-0x0;var _0x419740=_0x49df[_0x4fbc20];return _0x419740;};'use strict';var Sequelize=require(_0xf49d('0x0'));module[_0xf49d('0x1')]={'name':{'type':Sequelize[_0xf49d('0x2')]},'description':{'type':Sequelize[_0xf49d('0x2')]}};
\ No newline at end of file
index 0c49763..86e8513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f33=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','include','findAll','show','params','keys','fields','includeAll','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x1f33,0x1cd));var _0x31f3=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1f33[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x31f3('0x0'));var rimraf=require(_0x31f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31f3('0x2'));var rp=require(_0x31f3('0x3'));var moment=require(_0x31f3('0x4'));var BPromise=require(_0x31f3('0x5'));var Mustache=require(_0x31f3('0x6'));var util=require(_0x31f3('0x7'));var path=require(_0x31f3('0x8'));var sox=require(_0x31f3('0x9'));var csv=require(_0x31f3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31f3('0xb'));var _=require('lodash');var squel=require(_0x31f3('0xc'));var crypto=require(_0x31f3('0xd'));var jsforce=require(_0x31f3('0xe'));var deskjs=require(_0x31f3('0xf'));var toCsv=require(_0x31f3('0xa'));var querystring=require(_0x31f3('0x10'));var Papa=require(_0x31f3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x31f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31f3('0x13'))(_0x31f3('0x14'));var utils=require('../../config/utils');var config=require(_0x31f3('0x15'));var licenseUtil=require(_0x31f3('0x16'));var db=require(_0x31f3('0x17'))['db'];var jayson=require(_0x31f3('0x18'));var client=jayson['client'][_0x31f3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4dae7c,_0xc56c34,_0x197184,_0x4300af){return new BPromise(function(_0x23e637,_0x1a1d35){var _0x3c75a0=_0x4300af||client;return _0x3c75a0[_0x31f3('0x1a')](_0x4dae7c,_0x197184)[_0x31f3('0x1b')](function(_0x298b9f){logger[_0x31f3('0x1c')](_0x31f3('0x1d'),_0xc56c34,_0x31f3('0x1e'));logger[_0x31f3('0x1f')](_0x31f3('0x20'),_0xc56c34,_0x31f3('0x1e'),JSON[_0x31f3('0x21')](_0x298b9f));if(_0x298b9f[_0x31f3('0x22')]){if(_0x298b9f[_0x31f3('0x22')]['code']===0x1f4){logger['error'](_0x31f3('0x1d'),_0xc56c34,_0x298b9f['error'][_0x31f3('0x23')]);return _0x1a1d35(_0x298b9f['error'][_0x31f3('0x23')]);}logger[_0x31f3('0x22')](_0x31f3('0x1d'),_0xc56c34,_0x298b9f[_0x31f3('0x22')][_0x31f3('0x23')]);return _0x23e637(_0x298b9f[_0x31f3('0x22')]['message']);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0xc56c34,'request\x20sent');_0x23e637(_0x298b9f[_0x31f3('0x24')][_0x31f3('0x23')]);}})[_0x31f3('0x25')](function(_0x5989d7){logger[_0x31f3('0x22')]('VtigerConfiguration,\x20%s,\x20%s',_0xc56c34,_0x5989d7);_0x1a1d35(_0x5989d7);});});}function respondWithStatusCode(_0x9b6426,_0x25b1ef){_0x25b1ef=_0x25b1ef||0xcc;return function(_0x2b648b){if(_0x2b648b){return _0x9b6426[_0x31f3('0x26')](_0x25b1ef);}return _0x9b6426[_0x31f3('0x27')](_0x25b1ef)[_0x31f3('0x28')]();};}function respondWithResult(_0x288ac3,_0x389019){_0x389019=_0x389019||0xc8;return function(_0x45322b){if(_0x45322b){return _0x288ac3[_0x31f3('0x27')](_0x389019)['json'](_0x45322b);}};}function respondWithFilteredResult(_0x38a4e1,_0xc308c8){return function(_0x47243d){if(_0x47243d){var _0x2184a2=typeof _0xc308c8['offset']==='undefined'&&typeof _0xc308c8['limit']===_0x31f3('0x29');var _0x30e040=_0x47243d[_0x31f3('0x2a')];var _0x280efa=_0x2184a2?0x0:_0xc308c8[_0x31f3('0x2b')];var _0x11120c=_0x2184a2?_0x47243d['count']:_0xc308c8[_0x31f3('0x2b')]+_0xc308c8[_0x31f3('0x2c')];var _0x1cc5ce;if(_0x11120c>=_0x30e040){_0x11120c=_0x30e040;_0x1cc5ce=0xc8;}else{_0x1cc5ce=0xce;}_0x38a4e1['status'](_0x1cc5ce);return _0x38a4e1[_0x31f3('0x2d')](_0x31f3('0x2e'),_0x280efa+'-'+_0x11120c+'/'+_0x30e040)[_0x31f3('0x2f')](_0x47243d);}return null;};}function patchUpdates(_0x32c1b8){return function(_0x4ec0b6){try{jsonpatch[_0x31f3('0x30')](_0x4ec0b6,_0x32c1b8,!![]);}catch(_0x132ccf){return BPromise['reject'](_0x132ccf);}return _0x4ec0b6[_0x31f3('0x31')]();};}function saveUpdates(_0x3074de,_0x4fada4){return function(_0x19f2d6){if(_0x19f2d6){return _0x19f2d6[_0x31f3('0x32')](_0x3074de)[_0x31f3('0x1b')](function(_0x7a808a){return _0x7a808a;});}return null;};}function removeEntity(_0x1df01d,_0x4f9876){return function(_0x4a7883){if(_0x4a7883){return _0x4a7883[_0x31f3('0x33')]()['then'](function(){_0x1df01d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x531953,_0x4e02ae){return function(_0x5f1ce1){if(!_0x5f1ce1){_0x531953[_0x31f3('0x26')](0x194);}return _0x5f1ce1;};}function handleError(_0x258954,_0xaea480){_0xaea480=_0xaea480||0x1f4;return function(_0x57f983){logger['error'](_0x57f983[_0x31f3('0x34')]);if(_0x57f983['name']){delete _0x57f983[_0x31f3('0x35')];}_0x258954[_0x31f3('0x27')](_0xaea480)[_0x31f3('0x36')](_0x57f983);};}exports[_0x31f3('0x37')]=function(_0x3842b6,_0x4cbc10){var _0x1d96c2={},_0x23b20c={},_0x1ab318={'count':0x0,'rows':[]};var _0xb33811=_['map'](db['VtigerConfiguration'][_0x31f3('0x38')],function(_0x7ee411){return{'name':_0x7ee411[_0x31f3('0x39')],'type':_0x7ee411[_0x31f3('0x3a')][_0x31f3('0x3b')]};});_0x23b20c[_0x31f3('0x3c')]=_[_0x31f3('0x3d')](_0xb33811,_0x31f3('0x35'));_0x23b20c[_0x31f3('0x3e')]=_['keys'](_0x3842b6[_0x31f3('0x3e')]);_0x23b20c[_0x31f3('0x3f')]=_[_0x31f3('0x40')](_0x23b20c[_0x31f3('0x3c')],_0x23b20c[_0x31f3('0x3e')]);_0x1d96c2['attributes']=_[_0x31f3('0x40')](_0x23b20c[_0x31f3('0x3c')],qs['fields'](_0x3842b6[_0x31f3('0x3e')]['fields']));_0x1d96c2[_0x31f3('0x41')]=_0x1d96c2['attributes'][_0x31f3('0x42')]?_0x1d96c2[_0x31f3('0x41')]:_0x23b20c['model'];if(!_0x3842b6[_0x31f3('0x3e')][_0x31f3('0x43')](_0x31f3('0x44'))){_0x1d96c2[_0x31f3('0x2c')]=qs['limit'](_0x3842b6[_0x31f3('0x3e')][_0x31f3('0x2c')]);_0x1d96c2['offset']=qs[_0x31f3('0x2b')](_0x3842b6[_0x31f3('0x3e')][_0x31f3('0x2b')]);}_0x1d96c2[_0x31f3('0x45')]=qs['sort'](_0x3842b6['query'][_0x31f3('0x46')]);_0x1d96c2[_0x31f3('0x47')]=qs['filters'](_[_0x31f3('0x48')](_0x3842b6[_0x31f3('0x3e')],_0x23b20c[_0x31f3('0x3f')]),_0xb33811);if(_0x3842b6[_0x31f3('0x3e')][_0x31f3('0x49')]){_0x1d96c2[_0x31f3('0x47')]=_[_0x31f3('0x4a')](_0x1d96c2[_0x31f3('0x47')],{'$or':_[_0x31f3('0x3d')](_0xb33811,function(_0x3fb96e){if(_0x3fb96e[_0x31f3('0x3a')]!==_0x31f3('0x4b')){var _0x5b6b57={};_0x5b6b57[_0x3fb96e[_0x31f3('0x35')]]={'$like':'%'+_0x3842b6[_0x31f3('0x3e')][_0x31f3('0x49')]+'%'};return _0x5b6b57;}})});}_0x1d96c2=_[_0x31f3('0x4a')]({},_0x1d96c2,_0x3842b6[_0x31f3('0x4c')]);var _0x5a809f={'where':_0x1d96c2[_0x31f3('0x47')]};return db[_0x31f3('0x4d')]['count'](_0x5a809f)[_0x31f3('0x1b')](function(_0x398711){_0x1ab318['count']=_0x398711;if(_0x3842b6[_0x31f3('0x3e')]['includeAll']){_0x1d96c2[_0x31f3('0x4e')]=[{'all':!![]}];}return db[_0x31f3('0x4d')][_0x31f3('0x4f')](_0x1d96c2);})[_0x31f3('0x1b')](function(_0x34d61c){_0x1ab318['rows']=_0x34d61c;return _0x1ab318;})[_0x31f3('0x1b')](respondWithFilteredResult(_0x4cbc10,_0x1d96c2))[_0x31f3('0x25')](handleError(_0x4cbc10,null));};exports[_0x31f3('0x50')]=function(_0xa99e51,_0x1dc4fe){var _0x2390a1={'raw':![],'where':{'id':_0xa99e51[_0x31f3('0x51')]['id']}},_0x25b99c={};_0x25b99c[_0x31f3('0x3c')]=_[_0x31f3('0x52')](db[_0x31f3('0x4d')][_0x31f3('0x38')]);_0x25b99c[_0x31f3('0x3e')]=_[_0x31f3('0x52')](_0xa99e51[_0x31f3('0x3e')]);_0x25b99c[_0x31f3('0x3f')]=_['intersection'](_0x25b99c[_0x31f3('0x3c')],_0x25b99c[_0x31f3('0x3e')]);_0x2390a1[_0x31f3('0x41')]=_[_0x31f3('0x40')](_0x25b99c[_0x31f3('0x3c')],qs[_0x31f3('0x53')](_0xa99e51[_0x31f3('0x3e')][_0x31f3('0x53')]));_0x2390a1[_0x31f3('0x41')]=_0x2390a1[_0x31f3('0x41')]['length']?_0x2390a1['attributes']:_0x25b99c[_0x31f3('0x3c')];if(_0xa99e51[_0x31f3('0x3e')][_0x31f3('0x54')]){_0x2390a1['include']=[{'all':!![]}];}_0x2390a1=_[_0x31f3('0x4a')]({},_0x2390a1,_0xa99e51[_0x31f3('0x4c')]);return db[_0x31f3('0x4d')][_0x31f3('0x55')](_0x2390a1)[_0x31f3('0x1b')](handleEntityNotFound(_0x1dc4fe,null))[_0x31f3('0x1b')](respondWithResult(_0x1dc4fe,null))['catch'](handleError(_0x1dc4fe,null));};exports[_0x31f3('0x56')]=function(_0x498c04,_0xb10914){return db[_0x31f3('0x4d')]['create'](_0x498c04[_0x31f3('0x57')],{})[_0x31f3('0x1b')](respondWithResult(_0xb10914,0xc9))[_0x31f3('0x25')](handleError(_0xb10914,null));};exports[_0x31f3('0x32')]=function(_0x3aafe2,_0x1bb1de){if(_0x3aafe2['body']['id']){delete _0x3aafe2[_0x31f3('0x57')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x3aafe2[_0x31f3('0x51')]['id']}})[_0x31f3('0x1b')](handleEntityNotFound(_0x1bb1de,null))['then'](saveUpdates(_0x3aafe2[_0x31f3('0x57')],null))[_0x31f3('0x1b')](respondWithResult(_0x1bb1de,null))['catch'](handleError(_0x1bb1de,null));};exports[_0x31f3('0x33')]=function(_0x44b86b,_0xf0bc0d){return db[_0x31f3('0x4d')][_0x31f3('0x55')]({'where':{'id':_0x44b86b[_0x31f3('0x51')]['id']}})[_0x31f3('0x1b')](handleEntityNotFound(_0xf0bc0d,null))[_0x31f3('0x1b')](removeEntity(_0xf0bc0d,null))['catch'](handleError(_0xf0bc0d,null));};exports[_0x31f3('0x58')]=function(_0x2af895,_0x4b137b,_0x3e47e6){var _0x32530b={};var _0x128a57={};var _0x37ec95;var _0x1ec42e;return db['VtigerConfiguration'][_0x31f3('0x59')]({'where':{'id':_0x2af895['params']['id']}})[_0x31f3('0x1b')](handleEntityNotFound(_0x4b137b,null))[_0x31f3('0x1b')](function(_0x5dad09){if(_0x5dad09){_0x37ec95=_0x5dad09;_0x128a57[_0x31f3('0x3c')]=_[_0x31f3('0x52')](db[_0x31f3('0x5a')][_0x31f3('0x38')]);_0x128a57['query']=_[_0x31f3('0x52')](_0x2af895['query']);_0x128a57['filters']=_['intersection'](_0x128a57[_0x31f3('0x3c')],_0x128a57[_0x31f3('0x3e')]);_0x32530b[_0x31f3('0x41')]=_[_0x31f3('0x40')](_0x128a57['model'],qs['fields'](_0x2af895[_0x31f3('0x3e')]['fields']));_0x32530b['attributes']=_0x32530b[_0x31f3('0x41')][_0x31f3('0x42')]?_0x32530b[_0x31f3('0x41')]:_0x128a57['model'];_0x32530b['order']=qs[_0x31f3('0x46')](_0x2af895[_0x31f3('0x3e')][_0x31f3('0x46')]);_0x32530b['where']=qs[_0x31f3('0x3f')](_['pick'](_0x2af895[_0x31f3('0x3e')],_0x128a57[_0x31f3('0x3f')]));if(_0x2af895['query'][_0x31f3('0x49')]){_0x32530b[_0x31f3('0x47')]=_['merge'](_0x32530b['where'],{'$or':_[_0x31f3('0x3d')](_0x32530b[_0x31f3('0x41')],function(_0x47ac2a){var _0x20d898={};_0x20d898[_0x47ac2a]={'$like':'%'+_0x2af895['query'][_0x31f3('0x49')]+'%'};return _0x20d898;})});}_0x32530b=_['merge']({},_0x32530b,_0x2af895[_0x31f3('0x4c')]);return _0x37ec95[_0x31f3('0x58')](_0x32530b);}})[_0x31f3('0x1b')](function(_0x3bb944){if(_0x3bb944){_0x1ec42e=_0x3bb944['length'];if(!_0x2af895[_0x31f3('0x3e')]['hasOwnProperty'](_0x31f3('0x44'))){_0x32530b['limit']=qs[_0x31f3('0x2c')](_0x2af895[_0x31f3('0x3e')]['limit']);_0x32530b[_0x31f3('0x2b')]=qs[_0x31f3('0x2b')](_0x2af895[_0x31f3('0x3e')][_0x31f3('0x2b')]);}return _0x37ec95[_0x31f3('0x58')](_0x32530b);}})[_0x31f3('0x1b')](function(_0x5cab55){if(_0x5cab55){return _0x5cab55?{'count':_0x1ec42e,'rows':_0x5cab55}:null;}})[_0x31f3('0x1b')](respondWithResult(_0x4b137b,null))[_0x31f3('0x25')](handleError(_0x4b137b,null));};exports[_0x31f3('0x5b')]=function(_0x3e6577,_0xdf7c58,_0x57930d){var _0xc1f43b={};var _0x38c095={};var _0x531d4e;var _0x1545c3;return db[_0x31f3('0x4d')][_0x31f3('0x59')]({'where':{'id':_0x3e6577['params']['id']}})['then'](handleEntityNotFound(_0xdf7c58,null))[_0x31f3('0x1b')](function(_0x4297d9){if(_0x4297d9){_0x531d4e=_0x4297d9;_0x38c095[_0x31f3('0x3c')]=_[_0x31f3('0x52')](db[_0x31f3('0x5a')][_0x31f3('0x38')]);_0x38c095[_0x31f3('0x3e')]=_[_0x31f3('0x52')](_0x3e6577[_0x31f3('0x3e')]);_0x38c095[_0x31f3('0x3f')]=_[_0x31f3('0x40')](_0x38c095[_0x31f3('0x3c')],_0x38c095['query']);_0xc1f43b['attributes']=_['intersection'](_0x38c095['model'],qs[_0x31f3('0x53')](_0x3e6577[_0x31f3('0x3e')][_0x31f3('0x53')]));_0xc1f43b[_0x31f3('0x41')]=_0xc1f43b[_0x31f3('0x41')][_0x31f3('0x42')]?_0xc1f43b['attributes']:_0x38c095[_0x31f3('0x3c')];_0xc1f43b[_0x31f3('0x45')]=qs[_0x31f3('0x46')](_0x3e6577[_0x31f3('0x3e')][_0x31f3('0x46')]);_0xc1f43b['where']=qs[_0x31f3('0x3f')](_[_0x31f3('0x48')](_0x3e6577[_0x31f3('0x3e')],_0x38c095[_0x31f3('0x3f')]));if(_0x3e6577[_0x31f3('0x3e')][_0x31f3('0x49')]){_0xc1f43b['where']=_[_0x31f3('0x4a')](_0xc1f43b[_0x31f3('0x47')],{'$or':_[_0x31f3('0x3d')](_0xc1f43b[_0x31f3('0x41')],function(_0x1e8754){var _0x51cb97={};_0x51cb97[_0x1e8754]={'$like':'%'+_0x3e6577['query'][_0x31f3('0x49')]+'%'};return _0x51cb97;})});}_0xc1f43b=_[_0x31f3('0x4a')]({},_0xc1f43b,_0x3e6577[_0x31f3('0x4c')]);return _0x531d4e[_0x31f3('0x5b')](_0xc1f43b);}})[_0x31f3('0x1b')](function(_0x3c68bf){if(_0x3c68bf){_0x1545c3=_0x3c68bf[_0x31f3('0x42')];if(!_0x3e6577[_0x31f3('0x3e')][_0x31f3('0x43')](_0x31f3('0x44'))){_0xc1f43b[_0x31f3('0x2c')]=qs[_0x31f3('0x2c')](_0x3e6577[_0x31f3('0x3e')][_0x31f3('0x2c')]);_0xc1f43b['offset']=qs[_0x31f3('0x2b')](_0x3e6577[_0x31f3('0x3e')][_0x31f3('0x2b')]);}return _0x531d4e[_0x31f3('0x5b')](_0xc1f43b);}})[_0x31f3('0x1b')](function(_0x45888f){if(_0x45888f){return _0x45888f?{'count':_0x1545c3,'rows':_0x45888f}:null;}})[_0x31f3('0x1b')](respondWithResult(_0xdf7c58,null))[_0x31f3('0x25')](handleError(_0xdf7c58,null));};exports[_0x31f3('0x5c')]=function(_0x483b91,_0x2461cc,_0x3032fc){var _0xe85323={};var _0x5a7b1f={};var _0x10a02d;var _0x37df07;return db[_0x31f3('0x4d')][_0x31f3('0x59')]({'where':{'id':_0x483b91[_0x31f3('0x51')]['id']}})[_0x31f3('0x1b')](handleEntityNotFound(_0x2461cc,null))[_0x31f3('0x1b')](function(_0x14404b){if(_0x14404b){_0x10a02d=_0x14404b;_0x5a7b1f[_0x31f3('0x3c')]=_[_0x31f3('0x52')](db[_0x31f3('0x5a')][_0x31f3('0x38')]);_0x5a7b1f['query']=_['keys'](_0x483b91[_0x31f3('0x3e')]);_0x5a7b1f[_0x31f3('0x3f')]=_[_0x31f3('0x40')](_0x5a7b1f[_0x31f3('0x3c')],_0x5a7b1f[_0x31f3('0x3e')]);_0xe85323['attributes']=_[_0x31f3('0x40')](_0x5a7b1f[_0x31f3('0x3c')],qs[_0x31f3('0x53')](_0x483b91[_0x31f3('0x3e')]['fields']));_0xe85323[_0x31f3('0x41')]=_0xe85323[_0x31f3('0x41')][_0x31f3('0x42')]?_0xe85323[_0x31f3('0x41')]:_0x5a7b1f['model'];_0xe85323[_0x31f3('0x45')]=qs[_0x31f3('0x46')](_0x483b91['query'][_0x31f3('0x46')]);_0xe85323['where']=qs[_0x31f3('0x3f')](_[_0x31f3('0x48')](_0x483b91[_0x31f3('0x3e')],_0x5a7b1f['filters']));if(_0x483b91[_0x31f3('0x3e')]['filter']){_0xe85323[_0x31f3('0x47')]=_['merge'](_0xe85323[_0x31f3('0x47')],{'$or':_['map'](_0xe85323[_0x31f3('0x41')],function(_0x113f32){var _0x2e5cb9={};_0x2e5cb9[_0x113f32]={'$like':'%'+_0x483b91[_0x31f3('0x3e')]['filter']+'%'};return _0x2e5cb9;})});}_0xe85323=_[_0x31f3('0x4a')]({},_0xe85323,_0x483b91[_0x31f3('0x4c')]);return _0x10a02d['getDescriptions'](_0xe85323);}})[_0x31f3('0x1b')](function(_0x4c6c72){if(_0x4c6c72){_0x37df07=_0x4c6c72['length'];if(!_0x483b91[_0x31f3('0x3e')][_0x31f3('0x43')](_0x31f3('0x44'))){_0xe85323[_0x31f3('0x2c')]=qs['limit'](_0x483b91[_0x31f3('0x3e')][_0x31f3('0x2c')]);_0xe85323[_0x31f3('0x2b')]=qs[_0x31f3('0x2b')](_0x483b91[_0x31f3('0x3e')][_0x31f3('0x2b')]);}return _0x10a02d[_0x31f3('0x5c')](_0xe85323);}})[_0x31f3('0x1b')](function(_0x11181b){if(_0x11181b){return _0x11181b?{'count':_0x37df07,'rows':_0x11181b}:null;}})[_0x31f3('0x1b')](respondWithResult(_0x2461cc,null))['catch'](handleError(_0x2461cc,null));};
\ No newline at end of file
+var _0xeb28=['destroy','getFields','keys','getSubjects','findOne','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','VtigerConfiguration','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body'];(function(_0x239193,_0x1585ef){var _0x4f51c3=function(_0x8eba2c){while(--_0x8eba2c){_0x239193['push'](_0x239193['shift']());}};_0x4f51c3(++_0x1585ef);}(_0xeb28,0xc3));var _0x8eb2=function(_0x19eefd,_0x2c68dd){_0x19eefd=_0x19eefd-0x0;var _0x5f4f82=_0xeb28[_0x19eefd];return _0x5f4f82;};'use strict';var emlformat=require(_0x8eb2('0x0'));var rimraf=require(_0x8eb2('0x1'));var zipdir=require(_0x8eb2('0x2'));var jsonpatch=require(_0x8eb2('0x3'));var rp=require(_0x8eb2('0x4'));var moment=require(_0x8eb2('0x5'));var BPromise=require(_0x8eb2('0x6'));var Mustache=require(_0x8eb2('0x7'));var util=require(_0x8eb2('0x8'));var path=require(_0x8eb2('0x9'));var sox=require(_0x8eb2('0xa'));var csv=require(_0x8eb2('0xb'));var ejs=require(_0x8eb2('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8eb2('0xd'));var jsforce=require(_0x8eb2('0xe'));var deskjs=require(_0x8eb2('0xf'));var toCsv=require(_0x8eb2('0xb'));var querystring=require(_0x8eb2('0x10'));var Papa=require(_0x8eb2('0x11'));var Redis=require(_0x8eb2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8eb2('0x13'));var as=require(_0x8eb2('0x14'));var hardwareService=require(_0x8eb2('0x15'));var logger=require(_0x8eb2('0x16'))(_0x8eb2('0x17'));var utils=require(_0x8eb2('0x18'));var config=require(_0x8eb2('0x19'));var licenseUtil=require(_0x8eb2('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8eb2('0x1b'));var client=jayson[_0x8eb2('0x1c')][_0x8eb2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xc26dd0,_0x100065,_0x1dbc34,_0x1eb911){return new BPromise(function(_0x3491aa,_0x293e86){var _0x44842=_0x1eb911||client;return _0x44842['request'](_0xc26dd0,_0x1dbc34)['then'](function(_0x267837){logger[_0x8eb2('0x1e')](_0x8eb2('0x1f'),_0x100065,_0x8eb2('0x20'));logger[_0x8eb2('0x21')](_0x8eb2('0x22'),_0x100065,'request\x20sent',JSON['stringify'](_0x267837));if(_0x267837[_0x8eb2('0x23')]){if(_0x267837[_0x8eb2('0x23')][_0x8eb2('0x24')]===0x1f4){logger['error'](_0x8eb2('0x1f'),_0x100065,_0x267837[_0x8eb2('0x23')][_0x8eb2('0x25')]);return _0x293e86(_0x267837[_0x8eb2('0x23')][_0x8eb2('0x25')]);}logger[_0x8eb2('0x23')](_0x8eb2('0x1f'),_0x100065,_0x267837[_0x8eb2('0x23')][_0x8eb2('0x25')]);return _0x3491aa(_0x267837['error'][_0x8eb2('0x25')]);}else{logger[_0x8eb2('0x1e')](_0x8eb2('0x1f'),_0x100065,_0x8eb2('0x20'));_0x3491aa(_0x267837[_0x8eb2('0x26')]['message']);}})['catch'](function(_0x3781e5){logger[_0x8eb2('0x23')](_0x8eb2('0x1f'),_0x100065,_0x3781e5);_0x293e86(_0x3781e5);});});}function respondWithStatusCode(_0xde38bf,_0x55c680){_0x55c680=_0x55c680||0xcc;return function(_0x45e112){if(_0x45e112){return _0xde38bf[_0x8eb2('0x27')](_0x55c680);}return _0xde38bf['status'](_0x55c680)[_0x8eb2('0x28')]();};}function respondWithResult(_0x102fc6,_0x115f71){_0x115f71=_0x115f71||0xc8;return function(_0x3b51dd){if(_0x3b51dd){return _0x102fc6[_0x8eb2('0x29')](_0x115f71)[_0x8eb2('0x2a')](_0x3b51dd);}};}function respondWithFilteredResult(_0x48a210,_0x44ad1d){return function(_0x56e24e){if(_0x56e24e){var _0x581e61=typeof _0x44ad1d[_0x8eb2('0x2b')]===_0x8eb2('0x2c')&&typeof _0x44ad1d[_0x8eb2('0x2d')]==='undefined';var _0x42ccd8=_0x56e24e[_0x8eb2('0x2e')];var _0x21847f=_0x581e61?0x0:_0x44ad1d[_0x8eb2('0x2b')];var _0x478697=_0x581e61?_0x56e24e[_0x8eb2('0x2e')]:_0x44ad1d['offset']+_0x44ad1d[_0x8eb2('0x2d')];var _0xf77d9f;if(_0x478697>=_0x42ccd8){_0x478697=_0x42ccd8;_0xf77d9f=0xc8;}else{_0xf77d9f=0xce;}_0x48a210[_0x8eb2('0x29')](_0xf77d9f);return _0x48a210[_0x8eb2('0x2f')]('Content-Range',_0x21847f+'-'+_0x478697+'/'+_0x42ccd8)[_0x8eb2('0x2a')](_0x56e24e);}return null;};}function patchUpdates(_0x2e30ab){return function(_0x538a07){try{jsonpatch[_0x8eb2('0x30')](_0x538a07,_0x2e30ab,!![]);}catch(_0x5dd5ca){return BPromise[_0x8eb2('0x31')](_0x5dd5ca);}return _0x538a07[_0x8eb2('0x32')]();};}function saveUpdates(_0x171317,_0x433f8b){return function(_0x5a720f){if(_0x5a720f){return _0x5a720f[_0x8eb2('0x33')](_0x171317)[_0x8eb2('0x34')](function(_0x3c3efe){return _0x3c3efe;});}return null;};}function removeEntity(_0x111512,_0x45b7cc){return function(_0x1f1f9b){if(_0x1f1f9b){return _0x1f1f9b['destroy']()[_0x8eb2('0x34')](function(){_0x111512['status'](0xcc)[_0x8eb2('0x28')]();});}};}function handleEntityNotFound(_0x3d59f9,_0x5c14c5){return function(_0x21c8c6){if(!_0x21c8c6){_0x3d59f9['sendStatus'](0x194);}return _0x21c8c6;};}function handleError(_0xc3b497,_0x2a00ec){_0x2a00ec=_0x2a00ec||0x1f4;return function(_0x1d640a){logger[_0x8eb2('0x23')](_0x1d640a[_0x8eb2('0x35')]);if(_0x1d640a[_0x8eb2('0x36')]){delete _0x1d640a[_0x8eb2('0x36')];}_0xc3b497[_0x8eb2('0x29')](_0x2a00ec)[_0x8eb2('0x37')](_0x1d640a);};}exports[_0x8eb2('0x38')]=function(_0x13f02a,_0x2f3236){var _0x44d38a={},_0x4c1b35={},_0xc49666={'count':0x0,'rows':[]};var _0x521925=_['map'](db[_0x8eb2('0x39')][_0x8eb2('0x3a')],function(_0xbbafea){return{'name':_0xbbafea['fieldName'],'type':_0xbbafea[_0x8eb2('0x3b')][_0x8eb2('0x3c')]};});_0x4c1b35[_0x8eb2('0x3d')]=_[_0x8eb2('0x3e')](_0x521925,_0x8eb2('0x36'));_0x4c1b35['query']=_['keys'](_0x13f02a[_0x8eb2('0x3f')]);_0x4c1b35[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0x4c1b35['model'],_0x4c1b35[_0x8eb2('0x3f')]);_0x44d38a[_0x8eb2('0x42')]=_[_0x8eb2('0x41')](_0x4c1b35[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0x13f02a['query'][_0x8eb2('0x43')]));_0x44d38a['attributes']=_0x44d38a[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x44d38a['attributes']:_0x4c1b35[_0x8eb2('0x3d')];if(!_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x45')](_0x8eb2('0x46'))){_0x44d38a['limit']=qs[_0x8eb2('0x2d')](_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x2d')]);_0x44d38a[_0x8eb2('0x2b')]=qs[_0x8eb2('0x2b')](_0x13f02a[_0x8eb2('0x3f')]['offset']);}_0x44d38a[_0x8eb2('0x47')]=qs[_0x8eb2('0x48')](_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x48')]);_0x44d38a[_0x8eb2('0x49')]=qs[_0x8eb2('0x40')](_[_0x8eb2('0x4a')](_0x13f02a[_0x8eb2('0x3f')],_0x4c1b35[_0x8eb2('0x40')]),_0x521925);if(_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x4b')]){_0x44d38a[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x44d38a[_0x8eb2('0x49')],{'$or':_[_0x8eb2('0x3e')](_0x521925,function(_0x271c12){if(_0x271c12[_0x8eb2('0x3b')]!=='VIRTUAL'){var _0x4b84a1={};_0x4b84a1[_0x271c12[_0x8eb2('0x36')]]={'$like':'%'+_0x13f02a[_0x8eb2('0x3f')][_0x8eb2('0x4b')]+'%'};return _0x4b84a1;}})});}_0x44d38a=_[_0x8eb2('0x4c')]({},_0x44d38a,_0x13f02a[_0x8eb2('0x4d')]);var _0x13a257={'where':_0x44d38a[_0x8eb2('0x49')]};return db[_0x8eb2('0x39')][_0x8eb2('0x2e')](_0x13a257)[_0x8eb2('0x34')](function(_0x5a8e7a){_0xc49666['count']=_0x5a8e7a;if(_0x13f02a['query'][_0x8eb2('0x4e')]){_0x44d38a['include']=[{'all':!![]}];}return db[_0x8eb2('0x39')][_0x8eb2('0x4f')](_0x44d38a);})[_0x8eb2('0x34')](function(_0x577c72){_0xc49666['rows']=_0x577c72;return _0xc49666;})['then'](respondWithFilteredResult(_0x2f3236,_0x44d38a))[_0x8eb2('0x50')](handleError(_0x2f3236,null));};exports[_0x8eb2('0x51')]=function(_0x2814ae,_0xd9faa7){var _0x564daa={'raw':![],'where':{'id':_0x2814ae[_0x8eb2('0x52')]['id']}},_0x3b112f={};_0x3b112f[_0x8eb2('0x3d')]=_['keys'](db[_0x8eb2('0x39')][_0x8eb2('0x3a')]);_0x3b112f['query']=_['keys'](_0x2814ae[_0x8eb2('0x3f')]);_0x3b112f[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0x3b112f['model'],_0x3b112f['query']);_0x564daa[_0x8eb2('0x42')]=_[_0x8eb2('0x41')](_0x3b112f[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0x2814ae['query'][_0x8eb2('0x43')]));_0x564daa[_0x8eb2('0x42')]=_0x564daa[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x564daa[_0x8eb2('0x42')]:_0x3b112f[_0x8eb2('0x3d')];if(_0x2814ae[_0x8eb2('0x3f')][_0x8eb2('0x4e')]){_0x564daa[_0x8eb2('0x53')]=[{'all':!![]}];}_0x564daa=_[_0x8eb2('0x4c')]({},_0x564daa,_0x2814ae[_0x8eb2('0x4d')]);return db[_0x8eb2('0x39')][_0x8eb2('0x54')](_0x564daa)[_0x8eb2('0x34')](handleEntityNotFound(_0xd9faa7,null))[_0x8eb2('0x34')](respondWithResult(_0xd9faa7,null))[_0x8eb2('0x50')](handleError(_0xd9faa7,null));};exports[_0x8eb2('0x55')]=function(_0x26b021,_0x825699){return db['VtigerConfiguration']['create'](_0x26b021['body'],{})[_0x8eb2('0x34')](respondWithResult(_0x825699,0xc9))['catch'](handleError(_0x825699,null));};exports[_0x8eb2('0x33')]=function(_0x1a9826,_0x12aaf5){if(_0x1a9826[_0x8eb2('0x56')]['id']){delete _0x1a9826[_0x8eb2('0x56')]['id'];}return db[_0x8eb2('0x39')][_0x8eb2('0x54')]({'where':{'id':_0x1a9826[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x12aaf5,null))[_0x8eb2('0x34')](saveUpdates(_0x1a9826[_0x8eb2('0x56')],null))[_0x8eb2('0x34')](respondWithResult(_0x12aaf5,null))['catch'](handleError(_0x12aaf5,null));};exports[_0x8eb2('0x57')]=function(_0x22d38e,_0x4bc80b){return db[_0x8eb2('0x39')][_0x8eb2('0x54')]({'where':{'id':_0x22d38e[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x4bc80b,null))[_0x8eb2('0x34')](removeEntity(_0x4bc80b,null))[_0x8eb2('0x50')](handleError(_0x4bc80b,null));};exports[_0x8eb2('0x58')]=function(_0xe55e60,_0x2599da,_0x2f7e5d){var _0x27bdf4={};var _0xeab7ec={};var _0x2b8763;var _0x1ff980;return db[_0x8eb2('0x39')]['findOne']({'where':{'id':_0xe55e60[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x2599da,null))[_0x8eb2('0x34')](function(_0x2651c2){if(_0x2651c2){_0x2b8763=_0x2651c2;_0xeab7ec['model']=_[_0x8eb2('0x59')](db['VtigerField'][_0x8eb2('0x3a')]);_0xeab7ec[_0x8eb2('0x3f')]=_[_0x8eb2('0x59')](_0xe55e60[_0x8eb2('0x3f')]);_0xeab7ec[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0xeab7ec[_0x8eb2('0x3d')],_0xeab7ec[_0x8eb2('0x3f')]);_0x27bdf4[_0x8eb2('0x42')]=_['intersection'](_0xeab7ec[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0xe55e60['query']['fields']));_0x27bdf4[_0x8eb2('0x42')]=_0x27bdf4[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x27bdf4[_0x8eb2('0x42')]:_0xeab7ec['model'];_0x27bdf4['order']=qs[_0x8eb2('0x48')](_0xe55e60[_0x8eb2('0x3f')][_0x8eb2('0x48')]);_0x27bdf4[_0x8eb2('0x49')]=qs[_0x8eb2('0x40')](_[_0x8eb2('0x4a')](_0xe55e60[_0x8eb2('0x3f')],_0xeab7ec[_0x8eb2('0x40')]));if(_0xe55e60[_0x8eb2('0x3f')]['filter']){_0x27bdf4[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x27bdf4['where'],{'$or':_['map'](_0x27bdf4['attributes'],function(_0x217751){var _0x36b0c9={};_0x36b0c9[_0x217751]={'$like':'%'+_0xe55e60[_0x8eb2('0x3f')][_0x8eb2('0x4b')]+'%'};return _0x36b0c9;})});}_0x27bdf4=_[_0x8eb2('0x4c')]({},_0x27bdf4,_0xe55e60['options']);return _0x2b8763['getFields'](_0x27bdf4);}})[_0x8eb2('0x34')](function(_0x1e4e72){if(_0x1e4e72){_0x1ff980=_0x1e4e72[_0x8eb2('0x44')];if(!_0xe55e60['query']['hasOwnProperty'](_0x8eb2('0x46'))){_0x27bdf4['limit']=qs[_0x8eb2('0x2d')](_0xe55e60[_0x8eb2('0x3f')][_0x8eb2('0x2d')]);_0x27bdf4['offset']=qs[_0x8eb2('0x2b')](_0xe55e60[_0x8eb2('0x3f')]['offset']);}return _0x2b8763[_0x8eb2('0x58')](_0x27bdf4);}})[_0x8eb2('0x34')](function(_0x34ba58){if(_0x34ba58){return _0x34ba58?{'count':_0x1ff980,'rows':_0x34ba58}:null;}})[_0x8eb2('0x34')](respondWithResult(_0x2599da,null))['catch'](handleError(_0x2599da,null));};exports[_0x8eb2('0x5a')]=function(_0x5af3c1,_0x55055d,_0x40316d){var _0x197355={};var _0x54a404={};var _0x3b7516;var _0x233aa5;return db[_0x8eb2('0x39')][_0x8eb2('0x5b')]({'where':{'id':_0x5af3c1[_0x8eb2('0x52')]['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0x55055d,null))[_0x8eb2('0x34')](function(_0x51ca72){if(_0x51ca72){_0x3b7516=_0x51ca72;_0x54a404[_0x8eb2('0x3d')]=_[_0x8eb2('0x59')](db['VtigerField'][_0x8eb2('0x3a')]);_0x54a404[_0x8eb2('0x3f')]=_['keys'](_0x5af3c1[_0x8eb2('0x3f')]);_0x54a404[_0x8eb2('0x40')]=_[_0x8eb2('0x41')](_0x54a404[_0x8eb2('0x3d')],_0x54a404[_0x8eb2('0x3f')]);_0x197355[_0x8eb2('0x42')]=_[_0x8eb2('0x41')](_0x54a404[_0x8eb2('0x3d')],qs['fields'](_0x5af3c1['query']['fields']));_0x197355[_0x8eb2('0x42')]=_0x197355[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x197355[_0x8eb2('0x42')]:_0x54a404[_0x8eb2('0x3d')];_0x197355[_0x8eb2('0x47')]=qs[_0x8eb2('0x48')](_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x48')]);_0x197355['where']=qs['filters'](_[_0x8eb2('0x4a')](_0x5af3c1[_0x8eb2('0x3f')],_0x54a404['filters']));if(_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x4b')]){_0x197355[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x197355[_0x8eb2('0x49')],{'$or':_[_0x8eb2('0x3e')](_0x197355[_0x8eb2('0x42')],function(_0x145515){var _0x221602={};_0x221602[_0x145515]={'$like':'%'+_0x5af3c1[_0x8eb2('0x3f')]['filter']+'%'};return _0x221602;})});}_0x197355=_[_0x8eb2('0x4c')]({},_0x197355,_0x5af3c1[_0x8eb2('0x4d')]);return _0x3b7516[_0x8eb2('0x5a')](_0x197355);}})['then'](function(_0x1cd1d9){if(_0x1cd1d9){_0x233aa5=_0x1cd1d9[_0x8eb2('0x44')];if(!_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x45')]('nolimit')){_0x197355[_0x8eb2('0x2d')]=qs[_0x8eb2('0x2d')](_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x2d')]);_0x197355[_0x8eb2('0x2b')]=qs['offset'](_0x5af3c1[_0x8eb2('0x3f')][_0x8eb2('0x2b')]);}return _0x3b7516[_0x8eb2('0x5a')](_0x197355);}})[_0x8eb2('0x34')](function(_0xcd8c74){if(_0xcd8c74){return _0xcd8c74?{'count':_0x233aa5,'rows':_0xcd8c74}:null;}})[_0x8eb2('0x34')](respondWithResult(_0x55055d,null))['catch'](handleError(_0x55055d,null));};exports[_0x8eb2('0x5c')]=function(_0x357ac1,_0xbce895,_0x583d0d){var _0x5675c6={};var _0x22674e={};var _0x1a608b;var _0x1ab95c;return db[_0x8eb2('0x39')][_0x8eb2('0x5b')]({'where':{'id':_0x357ac1['params']['id']}})[_0x8eb2('0x34')](handleEntityNotFound(_0xbce895,null))[_0x8eb2('0x34')](function(_0x25e92b){if(_0x25e92b){_0x1a608b=_0x25e92b;_0x22674e['model']=_[_0x8eb2('0x59')](db[_0x8eb2('0x5d')][_0x8eb2('0x3a')]);_0x22674e[_0x8eb2('0x3f')]=_[_0x8eb2('0x59')](_0x357ac1['query']);_0x22674e['filters']=_['intersection'](_0x22674e[_0x8eb2('0x3d')],_0x22674e[_0x8eb2('0x3f')]);_0x5675c6[_0x8eb2('0x42')]=_['intersection'](_0x22674e[_0x8eb2('0x3d')],qs[_0x8eb2('0x43')](_0x357ac1[_0x8eb2('0x3f')]['fields']));_0x5675c6[_0x8eb2('0x42')]=_0x5675c6[_0x8eb2('0x42')][_0x8eb2('0x44')]?_0x5675c6[_0x8eb2('0x42')]:_0x22674e[_0x8eb2('0x3d')];_0x5675c6[_0x8eb2('0x47')]=qs['sort'](_0x357ac1['query']['sort']);_0x5675c6['where']=qs['filters'](_[_0x8eb2('0x4a')](_0x357ac1[_0x8eb2('0x3f')],_0x22674e[_0x8eb2('0x40')]));if(_0x357ac1[_0x8eb2('0x3f')]['filter']){_0x5675c6[_0x8eb2('0x49')]=_[_0x8eb2('0x4c')](_0x5675c6['where'],{'$or':_[_0x8eb2('0x3e')](_0x5675c6[_0x8eb2('0x42')],function(_0x2c550b){var _0x520206={};_0x520206[_0x2c550b]={'$like':'%'+_0x357ac1[_0x8eb2('0x3f')][_0x8eb2('0x4b')]+'%'};return _0x520206;})});}_0x5675c6=_['merge']({},_0x5675c6,_0x357ac1[_0x8eb2('0x4d')]);return _0x1a608b[_0x8eb2('0x5c')](_0x5675c6);}})['then'](function(_0x3c44){if(_0x3c44){_0x1ab95c=_0x3c44[_0x8eb2('0x44')];if(!_0x357ac1[_0x8eb2('0x3f')][_0x8eb2('0x45')](_0x8eb2('0x46'))){_0x5675c6[_0x8eb2('0x2d')]=qs[_0x8eb2('0x2d')](_0x357ac1['query'][_0x8eb2('0x2d')]);_0x5675c6[_0x8eb2('0x2b')]=qs[_0x8eb2('0x2b')](_0x357ac1[_0x8eb2('0x3f')][_0x8eb2('0x2b')]);}return _0x1a608b[_0x8eb2('0x5c')](_0x5675c6);}})['then'](function(_0x517c8c){if(_0x517c8c){return _0x517c8c?{'count':_0x1ab95c,'rows':_0x517c8c}:null;}})[_0x8eb2('0x34')](respondWithResult(_0xbce895,null))[_0x8eb2('0x50')](handleError(_0xbce895,null));};
\ No newline at end of file
index 97f1d97..1d0a530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe510=['request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','int_vtiger_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xe510,0x7f));var _0x0e51=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe510[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x0e51('0x0'));var util=require(_0x0e51('0x1'));var logger=require(_0x0e51('0x2'))(_0x0e51('0x3'));var moment=require(_0x0e51('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e51('0x5'));var fs=require('fs');var path=require(_0x0e51('0x6'));var rimraf=require(_0x0e51('0x7'));var config=require(_0x0e51('0x8'));var attributes=require(_0x0e51('0x9'));module[_0x0e51('0xa')]=function(_0x47826f,_0x2e0d04){return _0x47826f['define']('VtigerConfiguration',attributes,{'tableName':_0x0e51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2586=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x2586,0x169));var _0x6258=function(_0xb04c93,_0x311321){_0xb04c93=_0xb04c93-0x0;var _0x41bc02=_0x2586[_0xb04c93];return _0x41bc02;};'use strict';var _=require(_0x6258('0x0'));var util=require(_0x6258('0x1'));var logger=require(_0x6258('0x2'))('api');var moment=require(_0x6258('0x3'));var BPromise=require(_0x6258('0x4'));var rp=require(_0x6258('0x5'));var fs=require('fs');var path=require(_0x6258('0x6'));var rimraf=require(_0x6258('0x7'));var config=require(_0x6258('0x8'));var attributes=require(_0x6258('0x9'));module[_0x6258('0xa')]=function(_0x1c4b8f,_0xa2395b){return _0x1c4b8f[_0x6258('0xb')](_0x6258('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbcbeef..73d14a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6412=['rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x118993,_0x482628){var _0x7dbf9a=function(_0x10e2fd){while(--_0x10e2fd){_0x118993['push'](_0x118993['shift']());}};_0x7dbf9a(++_0x482628);}(_0x6412,0x169));var _0x2641=function(_0xe55254,_0x3fd3a6){_0xe55254=_0xe55254-0x0;var _0x2be49c=_0x6412[_0xe55254];return _0x2be49c;};'use strict';var _=require(_0x2641('0x0'));var util=require('util');var moment=require(_0x2641('0x1'));var BPromise=require('bluebird');var rs=require(_0x2641('0x2'));var fs=require('fs');var Redis=require(_0x2641('0x3'));var db=require(_0x2641('0x4'))['db'];var utils=require(_0x2641('0x5'));var logger=require(_0x2641('0x6'))(_0x2641('0x7'));var config=require(_0x2641('0x8'));var jayson=require(_0x2641('0x9'));var client=jayson[_0x2641('0xa')][_0x2641('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c84c0,_0x9d19f8,_0x24d636){return new BPromise(function(_0x460247,_0x4db248){return client[_0x2641('0xc')](_0x3c84c0,_0x24d636)['then'](function(_0x4155b7){logger[_0x2641('0xd')](_0x2641('0xe'),_0x9d19f8,_0x2641('0xf'));logger[_0x2641('0x10')](_0x2641('0x11'),_0x9d19f8,_0x2641('0xf'),JSON[_0x2641('0x12')](_0x4155b7));if(_0x4155b7['error']){if(_0x4155b7[_0x2641('0x13')]['code']===0x1f4){logger[_0x2641('0x13')](_0x2641('0xe'),_0x9d19f8,_0x4155b7['error']['message']);return _0x4db248(_0x4155b7[_0x2641('0x13')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x9d19f8,_0x4155b7[_0x2641('0x13')][_0x2641('0x14')]);return _0x460247(_0x4155b7[_0x2641('0x13')][_0x2641('0x14')]);}else{logger[_0x2641('0xd')](_0x2641('0xe'),_0x9d19f8,_0x2641('0xf'));_0x460247(_0x4155b7[_0x2641('0x15')][_0x2641('0x14')]);}})[_0x2641('0x16')](function(_0x2ec612){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x9d19f8,_0x2ec612);_0x4db248(_0x2ec612);});});}
\ No newline at end of file
+var _0x9162=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x21558d,_0x4fd784){var _0x4eb5f7=function(_0x2ec466){while(--_0x2ec466){_0x21558d['push'](_0x21558d['shift']());}};_0x4eb5f7(++_0x4fd784);}(_0x9162,0x138));var _0x2916=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x9162[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x2916('0x0'));var util=require(_0x2916('0x1'));var moment=require(_0x2916('0x2'));var BPromise=require(_0x2916('0x3'));var rs=require(_0x2916('0x4'));var fs=require('fs');var Redis=require(_0x2916('0x5'));var db=require(_0x2916('0x6'))['db'];var utils=require(_0x2916('0x7'));var logger=require(_0x2916('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2916('0x9'));var client=jayson[_0x2916('0xa')][_0x2916('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x575f45,_0x1423ba,_0x4c1b59){return new BPromise(function(_0x4b2a62,_0x26f18d){return client[_0x2916('0xc')](_0x575f45,_0x4c1b59)[_0x2916('0xd')](function(_0x270b41){logger[_0x2916('0xe')](_0x2916('0xf'),_0x1423ba,_0x2916('0x10'));logger[_0x2916('0x11')](_0x2916('0x12'),_0x1423ba,'request\x20sent',JSON[_0x2916('0x13')](_0x270b41));if(_0x270b41[_0x2916('0x14')]){if(_0x270b41[_0x2916('0x14')]['code']===0x1f4){logger[_0x2916('0x14')](_0x2916('0xf'),_0x1423ba,_0x270b41[_0x2916('0x14')][_0x2916('0x15')]);return _0x26f18d(_0x270b41[_0x2916('0x14')][_0x2916('0x15')]);}logger[_0x2916('0x14')](_0x2916('0xf'),_0x1423ba,_0x270b41[_0x2916('0x14')]['message']);return _0x4b2a62(_0x270b41[_0x2916('0x14')]['message']);}else{logger[_0x2916('0xe')](_0x2916('0xf'),_0x1423ba,_0x2916('0x10'));_0x4b2a62(_0x270b41[_0x2916('0x16')][_0x2916('0x15')]);}})[_0x2916('0x17')](function(_0x5c69b0){logger['error'](_0x2916('0xf'),_0x1423ba,_0x5c69b0);_0x26f18d(_0x5c69b0);});});}
\ No newline at end of file
index bcfad74..d61afbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c5b=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1ab3a7,_0x2429d6){var _0x5a49c4=function(_0xa37030){while(--_0xa37030){_0x1ab3a7['push'](_0x1ab3a7['shift']());}};_0x5a49c4(++_0x2429d6);}(_0x6c5b,0x12c));var _0xb6c5=function(_0x6e5c2f,_0x21945e){_0x6e5c2f=_0x6e5c2f-0x0;var _0x48364f=_0x6c5b[_0x6e5c2f];return _0x48364f;};'use strict';var multer=require(_0xb6c5('0x0'));var util=require(_0xb6c5('0x1'));var path=require('path');var timeout=require(_0xb6c5('0x2'));var express=require(_0xb6c5('0x3'));var router=express[_0xb6c5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb6c5('0x5'));var config=require(_0xb6c5('0x6'));var controller=require(_0xb6c5('0x7'));router[_0xb6c5('0x8')]('/',auth[_0xb6c5('0x9')](),controller[_0xb6c5('0xa')]);router['get'](_0xb6c5('0xb'),auth[_0xb6c5('0x9')](),controller[_0xb6c5('0xc')]);router[_0xb6c5('0xd')]('/',auth[_0xb6c5('0x9')](),controller[_0xb6c5('0xe')]);router[_0xb6c5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb6c5('0x10')]);router[_0xb6c5('0x11')](_0xb6c5('0xb'),auth[_0xb6c5('0x9')](),controller[_0xb6c5('0x12')]);module[_0xb6c5('0x13')]=router;
\ No newline at end of file
+var _0xf654=['delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x231d02,_0x28b7f2){var _0x29aa92=function(_0x53541c){while(--_0x53541c){_0x231d02['push'](_0x231d02['shift']());}};_0x29aa92(++_0x28b7f2);}(_0xf654,0x146));var _0x4f65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf654[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4f65('0x0'));var express=require(_0x4f65('0x1'));var router=express[_0x4f65('0x2')]();var fs_extra=require(_0x4f65('0x3'));var auth=require(_0x4f65('0x4'));var interaction=require(_0x4f65('0x5'));var config=require(_0x4f65('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4f65('0x7')]);router[_0x4f65('0x8')](_0x4f65('0x9'),auth[_0x4f65('0xa')](),controller[_0x4f65('0xb')]);router[_0x4f65('0xc')]('/',auth[_0x4f65('0xa')](),controller[_0x4f65('0xd')]);router[_0x4f65('0xe')](_0x4f65('0x9'),auth[_0x4f65('0xa')](),controller[_0x4f65('0xf')]);router[_0x4f65('0x10')]('/:id',auth[_0x4f65('0xa')](),controller[_0x4f65('0x11')]);module[_0x4f65('0x12')]=router;
\ No newline at end of file
index 3e92d1c..9235cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5978=['sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x5978,0x100));var _0x8597=function(_0x994274,_0x42678f){_0x994274=_0x994274-0x0;var _0x4c5de8=_0x5978[_0x994274];return _0x4c5de8;};'use strict';var Sequelize=require(_0x8597('0x0'));module[_0x8597('0x1')]={'type':{'type':Sequelize[_0x8597('0x2')](_0x8597('0x3'),_0x8597('0x4'),'customVariable',_0x8597('0x5'),_0x8597('0x6')),'defaultValue':_0x8597('0x3')},'content':{'type':Sequelize[_0x8597('0x7')]},'key':{'type':Sequelize[_0x8597('0x7')]},'keyType':{'type':Sequelize[_0x8597('0x2')]('string',_0x8597('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x8597('0x7')]},'idField':{'type':Sequelize[_0x8597('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1cee=['variable','customVariable','keyValue','STRING','ENUM','string','BOOLEAN','sequelize'];(function(_0x28cefb,_0x4c294c){var _0x2c251e=function(_0x35ad3c){while(--_0x35ad3c){_0x28cefb['push'](_0x28cefb['shift']());}};_0x2c251e(++_0x4c294c);}(_0x1cee,0x1df));var _0xe1ce=function(_0x5c2b4c,_0x348620){_0x5c2b4c=_0x5c2b4c-0x0;var _0x567ba5=_0x1cee[_0x5c2b4c];return _0x567ba5;};'use strict';var Sequelize=require(_0xe1ce('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xe1ce('0x1'),_0xe1ce('0x2'),_0xe1ce('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe1ce('0x4')]},'keyType':{'type':Sequelize[_0xe1ce('0x5')](_0xe1ce('0x6'),_0xe1ce('0x1'),_0xe1ce('0x2'))},'keyContent':{'type':Sequelize[_0xe1ce('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe1ce('0x4')]},'customField':{'type':Sequelize[_0xe1ce('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe1ce('0x4')]}};
\ No newline at end of file
index a4c352f..ad6c0b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6100=['stack','name','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x2262ad,_0x4ba21d){var _0x4c24f8=function(_0x57cc2c){while(--_0x57cc2c){_0x2262ad['push'](_0x2262ad['shift']());}};_0x4c24f8(++_0x4ba21d);}(_0x6100,0x1dd));var _0x0610=function(_0x3287a6,_0x889189){_0x3287a6=_0x3287a6-0x0;var _0xd533d=_0x6100[_0x3287a6];return _0xd533d;};'use strict';var emlformat=require(_0x0610('0x0'));var rimraf=require(_0x0610('0x1'));var zipdir=require(_0x0610('0x2'));var jsonpatch=require(_0x0610('0x3'));var rp=require(_0x0610('0x4'));var moment=require(_0x0610('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0610('0x6'));var util=require(_0x0610('0x7'));var path=require('path');var sox=require(_0x0610('0x8'));var csv=require(_0x0610('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0610('0xa'));var _=require(_0x0610('0xb'));var squel=require(_0x0610('0xc'));var crypto=require(_0x0610('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0610('0x9'));var querystring=require('querystring');var Papa=require(_0x0610('0xe'));var Redis=require(_0x0610('0xf'));var authService=require(_0x0610('0x10'));var qs=require(_0x0610('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0610('0x12'));var logger=require(_0x0610('0x13'))('api');var utils=require(_0x0610('0x14'));var config=require(_0x0610('0x15'));var licenseUtil=require(_0x0610('0x16'));var db=require(_0x0610('0x17'))['db'];function respondWithStatusCode(_0x17e9ab,_0x448128){_0x448128=_0x448128||0xcc;return function(_0x252d8d){if(_0x252d8d){return _0x17e9ab[_0x0610('0x18')](_0x448128);}return _0x17e9ab[_0x0610('0x19')](_0x448128)[_0x0610('0x1a')]();};}function respondWithResult(_0x4d53cf,_0x46e547){_0x46e547=_0x46e547||0xc8;return function(_0x52bcdc){if(_0x52bcdc){return _0x4d53cf[_0x0610('0x19')](_0x46e547)[_0x0610('0x1b')](_0x52bcdc);}};}function respondWithFilteredResult(_0x2125ec,_0x25061e){return function(_0xf67eff){if(_0xf67eff){var _0x445156=typeof _0x25061e[_0x0610('0x1c')]===_0x0610('0x1d')&&typeof _0x25061e[_0x0610('0x1e')]===_0x0610('0x1d');var _0x4f06dc=_0xf67eff[_0x0610('0x1f')];var _0xe813a5=_0x445156?0x0:_0x25061e[_0x0610('0x1c')];var _0x1841ed=_0x445156?_0xf67eff['count']:_0x25061e[_0x0610('0x1c')]+_0x25061e['limit'];var _0x28cfca;if(_0x1841ed>=_0x4f06dc){_0x1841ed=_0x4f06dc;_0x28cfca=0xc8;}else{_0x28cfca=0xce;}_0x2125ec[_0x0610('0x19')](_0x28cfca);return _0x2125ec[_0x0610('0x20')](_0x0610('0x21'),_0xe813a5+'-'+_0x1841ed+'/'+_0x4f06dc)[_0x0610('0x1b')](_0xf67eff);}return null;};}function patchUpdates(_0x30d383){return function(_0x24801a){try{jsonpatch[_0x0610('0x22')](_0x24801a,_0x30d383,!![]);}catch(_0x3ae03f){return BPromise[_0x0610('0x23')](_0x3ae03f);}return _0x24801a[_0x0610('0x24')]();};}function saveUpdates(_0x3a9777,_0x4f5009){return function(_0x219893){if(_0x219893){return _0x219893[_0x0610('0x25')](_0x3a9777)[_0x0610('0x26')](function(_0x4dadc7){return _0x4dadc7;});}return null;};}function removeEntity(_0x5218d8,_0x5596bd){return function(_0x5ce055){if(_0x5ce055){return _0x5ce055[_0x0610('0x27')]()['then'](function(){_0x5218d8[_0x0610('0x19')](0xcc)[_0x0610('0x1a')]();});}};}function handleEntityNotFound(_0x887a1b,_0x4e0487){return function(_0x1fc0e2){if(!_0x1fc0e2){_0x887a1b[_0x0610('0x18')](0x194);}return _0x1fc0e2;};}function handleError(_0x468b61,_0x1f7fcb){_0x1f7fcb=_0x1f7fcb||0x1f4;return function(_0x5ad5e3){logger[_0x0610('0x28')](_0x5ad5e3[_0x0610('0x29')]);if(_0x5ad5e3[_0x0610('0x2a')]){delete _0x5ad5e3[_0x0610('0x2a')];}_0x468b61['status'](_0x1f7fcb)['send'](_0x5ad5e3);};}exports['index']=function(_0x364e52,_0x1d5ab0){var _0x576c28={},_0x918e63={},_0x59c342={'count':0x0,'rows':[]};var _0x267268=_[_0x0610('0x2b')](db[_0x0610('0x2c')][_0x0610('0x2d')],function(_0x27e947){return{'name':_0x27e947[_0x0610('0x2e')],'type':_0x27e947[_0x0610('0x2f')][_0x0610('0x30')]};});_0x918e63[_0x0610('0x31')]=_[_0x0610('0x2b')](_0x267268,_0x0610('0x2a'));_0x918e63[_0x0610('0x32')]=_['keys'](_0x364e52[_0x0610('0x32')]);_0x918e63[_0x0610('0x33')]=_[_0x0610('0x34')](_0x918e63[_0x0610('0x31')],_0x918e63['query']);_0x576c28[_0x0610('0x35')]=_[_0x0610('0x34')](_0x918e63[_0x0610('0x31')],qs[_0x0610('0x36')](_0x364e52['query']['fields']));_0x576c28[_0x0610('0x35')]=_0x576c28[_0x0610('0x35')][_0x0610('0x37')]?_0x576c28[_0x0610('0x35')]:_0x918e63[_0x0610('0x31')];if(!_0x364e52[_0x0610('0x32')][_0x0610('0x38')](_0x0610('0x39'))){_0x576c28['limit']=qs[_0x0610('0x1e')](_0x364e52['query'][_0x0610('0x1e')]);_0x576c28[_0x0610('0x1c')]=qs[_0x0610('0x1c')](_0x364e52[_0x0610('0x32')]['offset']);}_0x576c28['order']=qs[_0x0610('0x3a')](_0x364e52[_0x0610('0x32')][_0x0610('0x3a')]);_0x576c28[_0x0610('0x3b')]=qs['filters'](_[_0x0610('0x3c')](_0x364e52[_0x0610('0x32')],_0x918e63[_0x0610('0x33')]),_0x267268);if(_0x364e52[_0x0610('0x32')][_0x0610('0x3d')]){_0x576c28[_0x0610('0x3b')]=_[_0x0610('0x3e')](_0x576c28[_0x0610('0x3b')],{'$or':_['map'](_0x267268,function(_0xc6c5a5){if(_0xc6c5a5[_0x0610('0x2f')]!=='VIRTUAL'){var _0x4eeac7={};_0x4eeac7[_0xc6c5a5[_0x0610('0x2a')]]={'$like':'%'+_0x364e52['query'][_0x0610('0x3d')]+'%'};return _0x4eeac7;}})});}_0x576c28=_[_0x0610('0x3e')]({},_0x576c28,_0x364e52['options']);var _0x151bab={'where':_0x576c28[_0x0610('0x3b')]};return db[_0x0610('0x2c')][_0x0610('0x1f')](_0x151bab)['then'](function(_0x5ef68c){_0x59c342[_0x0610('0x1f')]=_0x5ef68c;if(_0x364e52[_0x0610('0x32')]['includeAll']){_0x576c28['include']=[{'all':!![]}];}return db[_0x0610('0x2c')][_0x0610('0x3f')](_0x576c28);})['then'](function(_0x1d4d05){_0x59c342[_0x0610('0x40')]=_0x1d4d05;return _0x59c342;})[_0x0610('0x26')](respondWithFilteredResult(_0x1d5ab0,_0x576c28))[_0x0610('0x41')](handleError(_0x1d5ab0,null));};exports[_0x0610('0x42')]=function(_0x3d7113,_0x527037){var _0x2693cc={'raw':!![],'where':{'id':_0x3d7113['params']['id']}},_0x39f478={};_0x39f478['model']=_[_0x0610('0x43')](db['VtigerField'][_0x0610('0x2d')]);_0x39f478[_0x0610('0x32')]=_[_0x0610('0x43')](_0x3d7113[_0x0610('0x32')]);_0x39f478[_0x0610('0x33')]=_[_0x0610('0x34')](_0x39f478['model'],_0x39f478[_0x0610('0x32')]);_0x2693cc[_0x0610('0x35')]=_['intersection'](_0x39f478['model'],qs[_0x0610('0x36')](_0x3d7113[_0x0610('0x32')]['fields']));_0x2693cc[_0x0610('0x35')]=_0x2693cc[_0x0610('0x35')]['length']?_0x2693cc[_0x0610('0x35')]:_0x39f478[_0x0610('0x31')];if(_0x3d7113[_0x0610('0x32')][_0x0610('0x44')]){_0x2693cc[_0x0610('0x45')]=[{'all':!![]}];}_0x2693cc=_[_0x0610('0x3e')]({},_0x2693cc,_0x3d7113['options']);return db[_0x0610('0x2c')][_0x0610('0x46')](_0x2693cc)[_0x0610('0x26')](handleEntityNotFound(_0x527037,null))[_0x0610('0x26')](respondWithResult(_0x527037,null))['catch'](handleError(_0x527037,null));};exports[_0x0610('0x47')]=function(_0x5f1378,_0x3248ab){return db[_0x0610('0x2c')][_0x0610('0x47')](_0x5f1378[_0x0610('0x48')],{})[_0x0610('0x26')](respondWithResult(_0x3248ab,0xc9))['catch'](handleError(_0x3248ab,null));};exports['update']=function(_0x2401cb,_0x14f67c){if(_0x2401cb['body']['id']){delete _0x2401cb[_0x0610('0x48')]['id'];}return db[_0x0610('0x2c')][_0x0610('0x46')]({'where':{'id':_0x2401cb[_0x0610('0x49')]['id']}})[_0x0610('0x26')](handleEntityNotFound(_0x14f67c,null))[_0x0610('0x26')](saveUpdates(_0x2401cb['body'],null))[_0x0610('0x26')](respondWithResult(_0x14f67c,null))['catch'](handleError(_0x14f67c,null));};exports['destroy']=function(_0x4e7b38,_0x5ea259){return db[_0x0610('0x2c')]['find']({'where':{'id':_0x4e7b38[_0x0610('0x49')]['id']}})[_0x0610('0x26')](handleEntityNotFound(_0x5ea259,null))[_0x0610('0x26')](removeEntity(_0x5ea259,null))['catch'](handleError(_0x5ea259,null));};
\ No newline at end of file
+var _0x8e12=['pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e12,0x191));var _0x28e1=function(_0x58c578,_0xb9c575){_0x58c578=_0x58c578-0x0;var _0x219f47=_0x8e12[_0x58c578];return _0x219f47;};'use strict';var emlformat=require(_0x28e1('0x0'));var rimraf=require(_0x28e1('0x1'));var zipdir=require(_0x28e1('0x2'));var jsonpatch=require(_0x28e1('0x3'));var rp=require(_0x28e1('0x4'));var moment=require(_0x28e1('0x5'));var BPromise=require(_0x28e1('0x6'));var Mustache=require('mustache');var util=require(_0x28e1('0x7'));var path=require(_0x28e1('0x8'));var sox=require(_0x28e1('0x9'));var csv=require(_0x28e1('0xa'));var ejs=require(_0x28e1('0xb'));var fs=require('fs');var fs_extra=require(_0x28e1('0xc'));var _=require('lodash');var squel=require(_0x28e1('0xd'));var crypto=require('crypto');var jsforce=require(_0x28e1('0xe'));var deskjs=require(_0x28e1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x28e1('0x10'));var Papa=require(_0x28e1('0x11'));var Redis=require(_0x28e1('0x12'));var authService=require(_0x28e1('0x13'));var qs=require(_0x28e1('0x14'));var as=require(_0x28e1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x28e1('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x28e1('0x17'))['db'];function respondWithStatusCode(_0x3c4db9,_0x44f6c1){_0x44f6c1=_0x44f6c1||0xcc;return function(_0x4ae44e){if(_0x4ae44e){return _0x3c4db9['sendStatus'](_0x44f6c1);}return _0x3c4db9[_0x28e1('0x18')](_0x44f6c1)[_0x28e1('0x19')]();};}function respondWithResult(_0x3850e4,_0x22d8ed){_0x22d8ed=_0x22d8ed||0xc8;return function(_0x12e114){if(_0x12e114){return _0x3850e4[_0x28e1('0x18')](_0x22d8ed)[_0x28e1('0x1a')](_0x12e114);}};}function respondWithFilteredResult(_0x3e11bd,_0x1211d7){return function(_0x1119f5){if(_0x1119f5){var _0x590c5d=typeof _0x1211d7[_0x28e1('0x1b')]===_0x28e1('0x1c')&&typeof _0x1211d7[_0x28e1('0x1d')]===_0x28e1('0x1c');var _0x15df1b=_0x1119f5[_0x28e1('0x1e')];var _0x48262e=_0x590c5d?0x0:_0x1211d7[_0x28e1('0x1b')];var _0x3b988b=_0x590c5d?_0x1119f5[_0x28e1('0x1e')]:_0x1211d7[_0x28e1('0x1b')]+_0x1211d7[_0x28e1('0x1d')];var _0x463e13;if(_0x3b988b>=_0x15df1b){_0x3b988b=_0x15df1b;_0x463e13=0xc8;}else{_0x463e13=0xce;}_0x3e11bd[_0x28e1('0x18')](_0x463e13);return _0x3e11bd[_0x28e1('0x1f')]('Content-Range',_0x48262e+'-'+_0x3b988b+'/'+_0x15df1b)[_0x28e1('0x1a')](_0x1119f5);}return null;};}function patchUpdates(_0x4a6e22){return function(_0x22012d){try{jsonpatch[_0x28e1('0x20')](_0x22012d,_0x4a6e22,!![]);}catch(_0x3bdc60){return BPromise[_0x28e1('0x21')](_0x3bdc60);}return _0x22012d[_0x28e1('0x22')]();};}function saveUpdates(_0x4b578a,_0x90ab2a){return function(_0x3bfb7e){if(_0x3bfb7e){return _0x3bfb7e[_0x28e1('0x23')](_0x4b578a)[_0x28e1('0x24')](function(_0x16fc14){return _0x16fc14;});}return null;};}function removeEntity(_0x587bef,_0x40fd8c){return function(_0x28d605){if(_0x28d605){return _0x28d605['destroy']()['then'](function(){_0x587bef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x402776,_0x36f272){return function(_0x1ec27d){if(!_0x1ec27d){_0x402776['sendStatus'](0x194);}return _0x1ec27d;};}function handleError(_0x343b34,_0x34ff87){_0x34ff87=_0x34ff87||0x1f4;return function(_0x456a91){logger[_0x28e1('0x25')](_0x456a91[_0x28e1('0x26')]);if(_0x456a91[_0x28e1('0x27')]){delete _0x456a91[_0x28e1('0x27')];}_0x343b34[_0x28e1('0x18')](_0x34ff87)[_0x28e1('0x28')](_0x456a91);};}exports[_0x28e1('0x29')]=function(_0x293358,_0x3da202){var _0x439778={},_0x1b3fe6={},_0x4eefcf={'count':0x0,'rows':[]};var _0x344ac8=_[_0x28e1('0x2a')](db[_0x28e1('0x2b')][_0x28e1('0x2c')],function(_0x349db2){return{'name':_0x349db2[_0x28e1('0x2d')],'type':_0x349db2[_0x28e1('0x2e')][_0x28e1('0x2f')]};});_0x1b3fe6[_0x28e1('0x30')]=_[_0x28e1('0x2a')](_0x344ac8,_0x28e1('0x27'));_0x1b3fe6[_0x28e1('0x31')]=_[_0x28e1('0x32')](_0x293358[_0x28e1('0x31')]);_0x1b3fe6[_0x28e1('0x33')]=_[_0x28e1('0x34')](_0x1b3fe6[_0x28e1('0x30')],_0x1b3fe6['query']);_0x439778[_0x28e1('0x35')]=_[_0x28e1('0x34')](_0x1b3fe6[_0x28e1('0x30')],qs[_0x28e1('0x36')](_0x293358[_0x28e1('0x31')][_0x28e1('0x36')]));_0x439778[_0x28e1('0x35')]=_0x439778['attributes'][_0x28e1('0x37')]?_0x439778[_0x28e1('0x35')]:_0x1b3fe6[_0x28e1('0x30')];if(!_0x293358[_0x28e1('0x31')][_0x28e1('0x38')](_0x28e1('0x39'))){_0x439778[_0x28e1('0x1d')]=qs['limit'](_0x293358[_0x28e1('0x31')][_0x28e1('0x1d')]);_0x439778['offset']=qs[_0x28e1('0x1b')](_0x293358[_0x28e1('0x31')]['offset']);}_0x439778[_0x28e1('0x3a')]=qs[_0x28e1('0x3b')](_0x293358[_0x28e1('0x31')][_0x28e1('0x3b')]);_0x439778[_0x28e1('0x3c')]=qs[_0x28e1('0x33')](_[_0x28e1('0x3d')](_0x293358['query'],_0x1b3fe6['filters']),_0x344ac8);if(_0x293358[_0x28e1('0x31')][_0x28e1('0x3e')]){_0x439778[_0x28e1('0x3c')]=_['merge'](_0x439778[_0x28e1('0x3c')],{'$or':_[_0x28e1('0x2a')](_0x344ac8,function(_0x227936){if(_0x227936[_0x28e1('0x2e')]!==_0x28e1('0x3f')){var _0x3300fe={};_0x3300fe[_0x227936['name']]={'$like':'%'+_0x293358[_0x28e1('0x31')][_0x28e1('0x3e')]+'%'};return _0x3300fe;}})});}_0x439778=_[_0x28e1('0x40')]({},_0x439778,_0x293358['options']);var _0x9befac={'where':_0x439778['where']};return db['VtigerField'][_0x28e1('0x1e')](_0x9befac)[_0x28e1('0x24')](function(_0x2d0271){_0x4eefcf[_0x28e1('0x1e')]=_0x2d0271;if(_0x293358['query'][_0x28e1('0x41')]){_0x439778[_0x28e1('0x42')]=[{'all':!![]}];}return db[_0x28e1('0x2b')][_0x28e1('0x43')](_0x439778);})['then'](function(_0x2a689a){_0x4eefcf[_0x28e1('0x44')]=_0x2a689a;return _0x4eefcf;})[_0x28e1('0x24')](respondWithFilteredResult(_0x3da202,_0x439778))[_0x28e1('0x45')](handleError(_0x3da202,null));};exports[_0x28e1('0x46')]=function(_0x4cafe3,_0x1fee51){var _0x134b7a={'raw':!![],'where':{'id':_0x4cafe3[_0x28e1('0x47')]['id']}},_0x36d8d9={};_0x36d8d9[_0x28e1('0x30')]=_['keys'](db[_0x28e1('0x2b')]['rawAttributes']);_0x36d8d9[_0x28e1('0x31')]=_[_0x28e1('0x32')](_0x4cafe3['query']);_0x36d8d9[_0x28e1('0x33')]=_['intersection'](_0x36d8d9[_0x28e1('0x30')],_0x36d8d9[_0x28e1('0x31')]);_0x134b7a[_0x28e1('0x35')]=_['intersection'](_0x36d8d9[_0x28e1('0x30')],qs['fields'](_0x4cafe3[_0x28e1('0x31')][_0x28e1('0x36')]));_0x134b7a['attributes']=_0x134b7a['attributes'][_0x28e1('0x37')]?_0x134b7a['attributes']:_0x36d8d9[_0x28e1('0x30')];if(_0x4cafe3['query'][_0x28e1('0x41')]){_0x134b7a[_0x28e1('0x42')]=[{'all':!![]}];}_0x134b7a=_[_0x28e1('0x40')]({},_0x134b7a,_0x4cafe3[_0x28e1('0x48')]);return db[_0x28e1('0x2b')][_0x28e1('0x49')](_0x134b7a)[_0x28e1('0x24')](handleEntityNotFound(_0x1fee51,null))['then'](respondWithResult(_0x1fee51,null))['catch'](handleError(_0x1fee51,null));};exports[_0x28e1('0x4a')]=function(_0x46fd20,_0x4d0abd){return db[_0x28e1('0x2b')][_0x28e1('0x4a')](_0x46fd20[_0x28e1('0x4b')],{})[_0x28e1('0x24')](respondWithResult(_0x4d0abd,0xc9))[_0x28e1('0x45')](handleError(_0x4d0abd,null));};exports[_0x28e1('0x23')]=function(_0x13ef2c,_0x17beef){if(_0x13ef2c[_0x28e1('0x4b')]['id']){delete _0x13ef2c[_0x28e1('0x4b')]['id'];}return db[_0x28e1('0x2b')]['find']({'where':{'id':_0x13ef2c[_0x28e1('0x47')]['id']}})[_0x28e1('0x24')](handleEntityNotFound(_0x17beef,null))[_0x28e1('0x24')](saveUpdates(_0x13ef2c[_0x28e1('0x4b')],null))['then'](respondWithResult(_0x17beef,null))[_0x28e1('0x45')](handleError(_0x17beef,null));};exports[_0x28e1('0x4c')]=function(_0x5a870a,_0x502fab){return db[_0x28e1('0x2b')][_0x28e1('0x49')]({'where':{'id':_0x5a870a[_0x28e1('0x47')]['id']}})['then'](handleEntityNotFound(_0x502fab,null))[_0x28e1('0x24')](removeEntity(_0x502fab,null))[_0x28e1('0x45')](handleError(_0x502fab,null));};
\ No newline at end of file
index 8382df3..d594282 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa6=['rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','api','moment','path'];(function(_0x599041,_0x40fbea){var _0x1c4969=function(_0x138048){while(--_0x138048){_0x599041['push'](_0x599041['shift']());}};_0x1c4969(++_0x40fbea);}(_0xcaa6,0x105));var _0x6caa=function(_0xfde49a,_0x11f9c2){_0xfde49a=_0xfde49a-0x0;var _0x59948a=_0xcaa6[_0xfde49a];return _0x59948a;};'use strict';var _=require(_0x6caa('0x0'));var util=require(_0x6caa('0x1'));var logger=require('../../config/logger')(_0x6caa('0x2'));var moment=require(_0x6caa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6caa('0x4'));var rimraf=require(_0x6caa('0x5'));var config=require(_0x6caa('0x6'));var attributes=require(_0x6caa('0x7'));module[_0x6caa('0x8')]=function(_0x19e8d0,_0x34d324){return _0x19e8d0[_0x6caa('0x9')](_0x6caa('0xa'),attributes,{'tableName':_0x6caa('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x6caa('0xc'),_0x6caa('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x06dc=['util','api','moment','bluebird','path','../../config/environment','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x06dc,0xd1));var _0xc06d=function(_0x361e5d,_0x15e1a4){_0x361e5d=_0x361e5d-0x0;var _0x4c303d=_0x06dc[_0x361e5d];return _0x4c303d;};'use strict';var _=require(_0xc06d('0x0'));var util=require(_0xc06d('0x1'));var logger=require('../../config/logger')(_0xc06d('0x2'));var moment=require(_0xc06d('0x3'));var BPromise=require(_0xc06d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc06d('0x5'));var rimraf=require('rimraf');var config=require(_0xc06d('0x6'));var attributes=require(_0xc06d('0x7'));module[_0xc06d('0x8')]=function(_0x10654d,_0x2672db){return _0x10654d['define'](_0xc06d('0x9'),attributes,{'tableName':_0xc06d('0xa'),'paranoid':![],'indexes':[{'name':_0xc06d('0xb'),'fields':[_0xc06d('0xc'),_0xc06d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 601f87c..4dfe055 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec2c=['then','info','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0xec2c,0x191));var _0xcec2=function(_0x3d368b,_0xbbc5db){_0x3d368b=_0x3d368b-0x0;var _0x579af1=_0xec2c[_0x3d368b];return _0x579af1;};'use strict';var _=require(_0xcec2('0x0'));var util=require(_0xcec2('0x1'));var moment=require(_0xcec2('0x2'));var BPromise=require(_0xcec2('0x3'));var rs=require(_0xcec2('0x4'));var fs=require('fs');var Redis=require(_0xcec2('0x5'));var db=require(_0xcec2('0x6'))['db'];var utils=require(_0xcec2('0x7'));var logger=require(_0xcec2('0x8'))(_0xcec2('0x9'));var config=require(_0xcec2('0xa'));var jayson=require(_0xcec2('0xb'));var client=jayson['client'][_0xcec2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e13e2,_0x4adac4,_0x3ec100){return new BPromise(function(_0x28bab5,_0x248564){return client['request'](_0x3e13e2,_0x3ec100)[_0xcec2('0xd')](function(_0x1e6782){logger[_0xcec2('0xe')](_0xcec2('0xf'),_0x4adac4,'request\x20sent');logger[_0xcec2('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4adac4,_0xcec2('0x11'),JSON[_0xcec2('0x12')](_0x1e6782));if(_0x1e6782[_0xcec2('0x13')]){if(_0x1e6782['error'][_0xcec2('0x14')]===0x1f4){logger[_0xcec2('0x13')](_0xcec2('0xf'),_0x4adac4,_0x1e6782[_0xcec2('0x13')][_0xcec2('0x15')]);return _0x248564(_0x1e6782[_0xcec2('0x13')][_0xcec2('0x15')]);}logger[_0xcec2('0x13')](_0xcec2('0xf'),_0x4adac4,_0x1e6782[_0xcec2('0x13')][_0xcec2('0x15')]);return _0x28bab5(_0x1e6782[_0xcec2('0x13')]['message']);}else{logger['info'](_0xcec2('0xf'),_0x4adac4,_0xcec2('0x11'));_0x28bab5(_0x1e6782[_0xcec2('0x16')][_0xcec2('0x15')]);}})['catch'](function(_0x386aba){logger[_0xcec2('0x13')](_0xcec2('0xf'),_0x4adac4,_0x386aba);_0x248564(_0x386aba);});});}
\ No newline at end of file
+var _0x0257=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2c94ed,_0x2d1010){var _0x11af16=function(_0x5b5480){while(--_0x5b5480){_0x2c94ed['push'](_0x2c94ed['shift']());}};_0x11af16(++_0x2d1010);}(_0x0257,0x104));var _0x7025=function(_0x44f315,_0x5a799f){_0x44f315=_0x44f315-0x0;var _0x20478e=_0x0257[_0x44f315];return _0x20478e;};'use strict';var _=require(_0x7025('0x0'));var util=require(_0x7025('0x1'));var moment=require(_0x7025('0x2'));var BPromise=require(_0x7025('0x3'));var rs=require(_0x7025('0x4'));var fs=require('fs');var Redis=require(_0x7025('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7025('0x6'));var logger=require(_0x7025('0x7'))(_0x7025('0x8'));var config=require(_0x7025('0x9'));var jayson=require(_0x7025('0xa'));var client=jayson[_0x7025('0xb')][_0x7025('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19cb6e,_0x88099f,_0x3240bc){return new BPromise(function(_0x24a0dc,_0xe34541){return client['request'](_0x19cb6e,_0x3240bc)[_0x7025('0xd')](function(_0x2d50b2){logger[_0x7025('0xe')](_0x7025('0xf'),_0x88099f,_0x7025('0x10'));logger[_0x7025('0x11')](_0x7025('0x12'),_0x88099f,_0x7025('0x10'),JSON[_0x7025('0x13')](_0x2d50b2));if(_0x2d50b2[_0x7025('0x14')]){if(_0x2d50b2['error'][_0x7025('0x15')]===0x1f4){logger[_0x7025('0x14')](_0x7025('0xf'),_0x88099f,_0x2d50b2[_0x7025('0x14')][_0x7025('0x16')]);return _0xe34541(_0x2d50b2['error'][_0x7025('0x16')]);}logger[_0x7025('0x14')](_0x7025('0xf'),_0x88099f,_0x2d50b2[_0x7025('0x14')][_0x7025('0x16')]);return _0x24a0dc(_0x2d50b2['error']['message']);}else{logger[_0x7025('0xe')](_0x7025('0xf'),_0x88099f,_0x7025('0x10'));_0x24a0dc(_0x2d50b2[_0x7025('0x17')][_0x7025('0x16')]);}})[_0x7025('0x18')](function(_0x272cdc){logger['error'](_0x7025('0xf'),_0x88099f,_0x272cdc);_0xe34541(_0x272cdc);});});}
\ No newline at end of file
index 8838228..71b9d45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1329=['index','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x399fb4,_0x3b9673){var _0x599673=function(_0x5f16a1){while(--_0x5f16a1){_0x399fb4['push'](_0x399fb4['shift']());}};_0x599673(++_0x3b9673);}(_0x1329,0x199));var _0x9132=function(_0x29f916,_0x4f7394){_0x29f916=_0x29f916-0x0;var _0x536d03=_0x1329[_0x29f916];return _0x536d03;};'use strict';var multer=require(_0x9132('0x0'));var util=require(_0x9132('0x1'));var path=require(_0x9132('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9132('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9132('0x4'));var interaction=require(_0x9132('0x5'));var config=require(_0x9132('0x6'));var controller=require(_0x9132('0x7'));router[_0x9132('0x8')]('/',auth['isAuthenticated'](),controller[_0x9132('0x9')]);router[_0x9132('0x8')](_0x9132('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9132('0x8')](_0x9132('0xb'),auth[_0x9132('0xc')](),controller[_0x9132('0xd')]);router['get'](_0x9132('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0x9132('0xf')]('/',auth[_0x9132('0xc')](),controller[_0x9132('0x10')]);router[_0x9132('0xf')](_0x9132('0xb'),auth[_0x9132('0xc')](),controller[_0x9132('0x11')]);router[_0x9132('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9132('0x13')]);router[_0x9132('0x14')](_0x9132('0xa'),auth[_0x9132('0xc')](),controller[_0x9132('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x9ad9=['put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x9ad9,0x1a8));var _0x99ad=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x9ad9[_0x16629d];return _0x56ccee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x99ad('0x0'));var timeout=require(_0x99ad('0x1'));var express=require(_0x99ad('0x2'));var router=express[_0x99ad('0x3')]();var fs_extra=require(_0x99ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x99ad('0x5'));var config=require(_0x99ad('0x6'));var controller=require(_0x99ad('0x7'));router[_0x99ad('0x8')]('/',auth[_0x99ad('0x9')](),controller[_0x99ad('0xa')]);router[_0x99ad('0x8')](_0x99ad('0xb'),auth['isAuthenticated'](),controller[_0x99ad('0xc')]);router[_0x99ad('0x8')](_0x99ad('0xd'),auth[_0x99ad('0x9')](),controller[_0x99ad('0xe')]);router['get']('/:id/fields',auth[_0x99ad('0x9')](),controller['getFields']);router[_0x99ad('0xf')]('/',auth['isAuthenticated'](),controller[_0x99ad('0x10')]);router['post'](_0x99ad('0xd'),auth[_0x99ad('0x9')](),controller['addConfiguration']);router[_0x99ad('0x11')](_0x99ad('0xb'),auth['isAuthenticated'](),controller[_0x99ad('0x12')]);router[_0x99ad('0x13')](_0x99ad('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x99ad('0x14')]=router;
\ No newline at end of file
index 4af451c..d1285fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd916=['integrationTab','newTab','sequelize','exports','STRING','ENUM','password'];(function(_0x5bdadb,_0x25f39c){var _0x678ed7=function(_0xf91647){while(--_0xf91647){_0x5bdadb['push'](_0x5bdadb['shift']());}};_0x678ed7(++_0x25f39c);}(_0xd916,0x18a));var _0x6d91=function(_0x403af3,_0x358849){_0x403af3=_0x403af3-0x0;var _0x4b3b2f=_0xd916[_0x403af3];return _0x4b3b2f;};'use strict';var Sequelize=require(_0x6d91('0x0'));module[_0x6d91('0x1')]={'name':{'type':Sequelize[_0x6d91('0x2')]},'description':{'type':Sequelize[_0x6d91('0x2')]},'username':{'type':Sequelize[_0x6d91('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6d91('0x2')]},'token':{'type':Sequelize[_0x6d91('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x6d91('0x3')](_0x6d91('0x4'),'token'),'defaultValue':_0x6d91('0x4')},'serverUrl':{'type':Sequelize[_0x6d91('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6d91('0x3')](_0x6d91('0x5'),_0x6d91('0x6')),'defaultValue':_0x6d91('0x5')}};
\ No newline at end of file
+var _0xaa64=['ENUM','password','token','integrationTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x20cf7e,_0x54c9e8){var _0x2a7427=function(_0x2993d5){while(--_0x2993d5){_0x20cf7e['push'](_0x20cf7e['shift']());}};_0x2a7427(++_0x54c9e8);}(_0xaa64,0xf7));var _0x4aa6=function(_0xfdab07,_0x2220b4){_0xfdab07=_0xfdab07-0x0;var _0x34b9c4=_0xaa64[_0xfdab07];return _0x34b9c4;};'use strict';var Sequelize=require(_0x4aa6('0x0'));module[_0x4aa6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4aa6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4aa6('0x3')},'password':{'type':Sequelize[_0x4aa6('0x2')]},'token':{'type':Sequelize[_0x4aa6('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4aa6('0x4')},'authType':{'type':Sequelize[_0x4aa6('0x5')](_0x4aa6('0x6'),_0x4aa6('0x7')),'defaultValue':_0x4aa6('0x6')},'serverUrl':{'type':Sequelize[_0x4aa6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4aa6('0x5')]('integrationTab','newTab'),'defaultValue':_0x4aa6('0x8')}};
\ No newline at end of file
index e4e01f8..c133a1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2855=['ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','headers','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','ticket_fields','includes','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','ZendeskAccount','findAll','rows','params','keys','rawAttributes','find','create','body','findOne'];(function(_0x2f4390,_0x1538d9){var _0x12ceb8=function(_0x282b4f){while(--_0x282b4f){_0x2f4390['push'](_0x2f4390['shift']());}};_0x12ceb8(++_0x1538d9);}(_0x2855,0x1b0));var _0x5285=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x2855[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require(_0x5285('0x0'));var rimraf=require(_0x5285('0x1'));var zipdir=require(_0x5285('0x2'));var jsonpatch=require(_0x5285('0x3'));var rp=require(_0x5285('0x4'));var moment=require(_0x5285('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5285('0x6'));var util=require('util');var path=require(_0x5285('0x7'));var sox=require(_0x5285('0x8'));var csv=require(_0x5285('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5285('0xa'));var _=require(_0x5285('0xb'));var squel=require('squel');var crypto=require(_0x5285('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5285('0x9'));var querystring=require(_0x5285('0xd'));var Papa=require(_0x5285('0xe'));var Redis=require(_0x5285('0xf'));var authService=require(_0x5285('0x10'));var qs=require(_0x5285('0x11'));var as=require(_0x5285('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5285('0x13'));var utils=require(_0x5285('0x14'));var config=require(_0x5285('0x15'));var licenseUtil=require(_0x5285('0x16'));var db=require(_0x5285('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x5285('0x18'));var client=jayson[_0x5285('0x19')][_0x5285('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4cac77,_0x33f842,_0x15cbb7,_0x399e0f){return new BPromise(function(_0x561c95,_0x6b4d1a){var _0x4b08c3=_0x399e0f||client;return _0x4b08c3[_0x5285('0x1b')](_0x4cac77,_0x15cbb7)[_0x5285('0x1c')](function(_0x868f21){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x33f842,_0x5285('0x1d'));logger[_0x5285('0x1e')](_0x5285('0x1f'),_0x33f842,_0x5285('0x1d'),JSON[_0x5285('0x20')](_0x868f21));if(_0x868f21[_0x5285('0x21')]){if(_0x868f21[_0x5285('0x21')][_0x5285('0x22')]===0x1f4){logger[_0x5285('0x21')](_0x5285('0x23'),_0x33f842,_0x868f21[_0x5285('0x21')][_0x5285('0x24')]);return _0x6b4d1a(_0x868f21['error'][_0x5285('0x24')]);}logger[_0x5285('0x21')](_0x5285('0x23'),_0x33f842,_0x868f21['error'][_0x5285('0x24')]);return _0x561c95(_0x868f21[_0x5285('0x21')][_0x5285('0x24')]);}else{logger['info'](_0x5285('0x23'),_0x33f842,_0x5285('0x1d'));_0x561c95(_0x868f21['result'][_0x5285('0x24')]);}})[_0x5285('0x25')](function(_0x3a1cf0){logger[_0x5285('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x33f842,_0x3a1cf0);_0x6b4d1a(_0x3a1cf0);});});}function respondWithStatusCode(_0x4446ea,_0x5c5c16){_0x5c5c16=_0x5c5c16||0xcc;return function(_0x1b492a){if(_0x1b492a){return _0x4446ea['sendStatus'](_0x5c5c16);}return _0x4446ea[_0x5285('0x26')](_0x5c5c16)[_0x5285('0x27')]();};}function respondWithResult(_0x495b96,_0x30b304){_0x30b304=_0x30b304||0xc8;return function(_0x25d32c){if(_0x25d32c){return _0x495b96['status'](_0x30b304)[_0x5285('0x28')](_0x25d32c);}};}function respondWithFilteredResult(_0x5b0c26,_0x42914f){return function(_0x37b048){if(_0x37b048){var _0x3a75ca=typeof _0x42914f[_0x5285('0x29')]==='undefined'&&typeof _0x42914f[_0x5285('0x2a')]===_0x5285('0x2b');var _0x27face=_0x37b048[_0x5285('0x2c')];var _0x35ec71=_0x3a75ca?0x0:_0x42914f[_0x5285('0x29')];var _0x3deedf=_0x3a75ca?_0x37b048['count']:_0x42914f[_0x5285('0x29')]+_0x42914f[_0x5285('0x2a')];var _0x5a5c4f;if(_0x3deedf>=_0x27face){_0x3deedf=_0x27face;_0x5a5c4f=0xc8;}else{_0x5a5c4f=0xce;}_0x5b0c26[_0x5285('0x26')](_0x5a5c4f);return _0x5b0c26[_0x5285('0x2d')](_0x5285('0x2e'),_0x35ec71+'-'+_0x3deedf+'/'+_0x27face)[_0x5285('0x28')](_0x37b048);}return null;};}function patchUpdates(_0x25472b){return function(_0x37b7b4){try{jsonpatch[_0x5285('0x2f')](_0x37b7b4,_0x25472b,!![]);}catch(_0x4af5a1){return BPromise[_0x5285('0x30')](_0x4af5a1);}return _0x37b7b4[_0x5285('0x31')]();};}function saveUpdates(_0x2a27cd,_0x3ffa0c){return function(_0x251524){if(_0x251524){return _0x251524[_0x5285('0x32')](_0x2a27cd)[_0x5285('0x1c')](function(_0x5631d4){return _0x5631d4;});}return null;};}function removeEntity(_0x3c4693,_0x6f9c3){return function(_0x59be4c){if(_0x59be4c){return _0x59be4c[_0x5285('0x33')]()[_0x5285('0x1c')](function(){_0x3c4693[_0x5285('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c92ae,_0x372927){return function(_0x1c7fbc){if(!_0x1c7fbc){_0x4c92ae[_0x5285('0x34')](0x194);}return _0x1c7fbc;};}function handleError(_0x36b047,_0x7709d0){_0x7709d0=_0x7709d0||0x1f4;return function(_0x4b4890){logger['error'](_0x4b4890[_0x5285('0x35')]);if(_0x4b4890['name']){delete _0x4b4890[_0x5285('0x36')];}_0x36b047['status'](_0x7709d0)[_0x5285('0x37')](_0x4b4890);};}exports[_0x5285('0x38')]=function(_0x4e912c,_0x4b17f1){var _0x48c510={},_0x54a3b8={},_0x3071b2={'count':0x0,'rows':[]};var _0x39689a=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x26e64d){return{'name':_0x26e64d[_0x5285('0x39')],'type':_0x26e64d['type'][_0x5285('0x3a')]};});_0x54a3b8[_0x5285('0x3b')]=_[_0x5285('0x3c')](_0x39689a,'name');_0x54a3b8[_0x5285('0x3d')]=_['keys'](_0x4e912c[_0x5285('0x3d')]);_0x54a3b8[_0x5285('0x3e')]=_['intersection'](_0x54a3b8[_0x5285('0x3b')],_0x54a3b8['query']);_0x48c510[_0x5285('0x3f')]=_[_0x5285('0x40')](_0x54a3b8[_0x5285('0x3b')],qs[_0x5285('0x41')](_0x4e912c[_0x5285('0x3d')][_0x5285('0x41')]));_0x48c510[_0x5285('0x3f')]=_0x48c510[_0x5285('0x3f')][_0x5285('0x42')]?_0x48c510['attributes']:_0x54a3b8[_0x5285('0x3b')];if(!_0x4e912c['query']['hasOwnProperty'](_0x5285('0x43'))){_0x48c510[_0x5285('0x2a')]=qs[_0x5285('0x2a')](_0x4e912c[_0x5285('0x3d')][_0x5285('0x2a')]);_0x48c510[_0x5285('0x29')]=qs[_0x5285('0x29')](_0x4e912c['query'][_0x5285('0x29')]);}_0x48c510[_0x5285('0x44')]=qs[_0x5285('0x45')](_0x4e912c[_0x5285('0x3d')]['sort']);_0x48c510[_0x5285('0x46')]=qs[_0x5285('0x3e')](_[_0x5285('0x47')](_0x4e912c[_0x5285('0x3d')],_0x54a3b8[_0x5285('0x3e')]),_0x39689a);if(_0x4e912c[_0x5285('0x3d')][_0x5285('0x48')]){_0x48c510[_0x5285('0x46')]=_[_0x5285('0x49')](_0x48c510['where'],{'$or':_[_0x5285('0x3c')](_0x39689a,function(_0x2e7bc8){if(_0x2e7bc8[_0x5285('0x4a')]!=='VIRTUAL'){var _0x1fca47={};_0x1fca47[_0x2e7bc8[_0x5285('0x36')]]={'$like':'%'+_0x4e912c[_0x5285('0x3d')][_0x5285('0x48')]+'%'};return _0x1fca47;}})});}_0x48c510=_[_0x5285('0x49')]({},_0x48c510,_0x4e912c[_0x5285('0x4b')]);var _0x369d7e={'where':_0x48c510[_0x5285('0x46')]};return db['ZendeskAccount'][_0x5285('0x2c')](_0x369d7e)['then'](function(_0x46f2c4){_0x3071b2['count']=_0x46f2c4;if(_0x4e912c[_0x5285('0x3d')][_0x5285('0x4c')]){_0x48c510[_0x5285('0x4d')]=[{'all':!![]}];}return db[_0x5285('0x4e')][_0x5285('0x4f')](_0x48c510);})[_0x5285('0x1c')](function(_0x5b7ce2){_0x3071b2[_0x5285('0x50')]=_0x5b7ce2;return _0x3071b2;})[_0x5285('0x1c')](respondWithFilteredResult(_0x4b17f1,_0x48c510))[_0x5285('0x25')](handleError(_0x4b17f1,null));};exports['show']=function(_0xe06dcc,_0x42dca5){var _0x3833f0={'raw':![],'where':{'id':_0xe06dcc[_0x5285('0x51')]['id']}},_0x3569f8={};_0x3569f8[_0x5285('0x3b')]=_[_0x5285('0x52')](db['ZendeskAccount'][_0x5285('0x53')]);_0x3569f8['query']=_[_0x5285('0x52')](_0xe06dcc[_0x5285('0x3d')]);_0x3569f8['filters']=_[_0x5285('0x40')](_0x3569f8[_0x5285('0x3b')],_0x3569f8[_0x5285('0x3d')]);_0x3833f0['attributes']=_[_0x5285('0x40')](_0x3569f8['model'],qs[_0x5285('0x41')](_0xe06dcc['query'][_0x5285('0x41')]));_0x3833f0[_0x5285('0x3f')]=_0x3833f0['attributes'][_0x5285('0x42')]?_0x3833f0['attributes']:_0x3569f8['model'];if(_0xe06dcc[_0x5285('0x3d')]['includeAll']){_0x3833f0[_0x5285('0x4d')]=[{'all':!![]}];}_0x3833f0=_[_0x5285('0x49')]({},_0x3833f0,_0xe06dcc[_0x5285('0x4b')]);return db[_0x5285('0x4e')][_0x5285('0x54')](_0x3833f0)['then'](handleEntityNotFound(_0x42dca5,null))[_0x5285('0x1c')](respondWithResult(_0x42dca5,null))['catch'](handleError(_0x42dca5,null));};exports[_0x5285('0x55')]=function(_0x30bb30,_0x7f2350){return db[_0x5285('0x4e')]['create'](_0x30bb30[_0x5285('0x56')],{})['then'](respondWithResult(_0x7f2350,0xc9))['catch'](handleError(_0x7f2350,null));};exports['update']=function(_0x1327cd,_0x28b878){if(_0x1327cd[_0x5285('0x56')]['id']){delete _0x1327cd[_0x5285('0x56')]['id'];}return db[_0x5285('0x4e')][_0x5285('0x54')]({'where':{'id':_0x1327cd[_0x5285('0x51')]['id']}})[_0x5285('0x1c')](handleEntityNotFound(_0x28b878,null))[_0x5285('0x1c')](saveUpdates(_0x1327cd[_0x5285('0x56')],null))[_0x5285('0x1c')](respondWithResult(_0x28b878,null))['catch'](handleError(_0x28b878,null));};exports['destroy']=function(_0x124a65,_0x156d44){return db['ZendeskAccount'][_0x5285('0x54')]({'where':{'id':_0x124a65[_0x5285('0x51')]['id']}})[_0x5285('0x1c')](handleEntityNotFound(_0x156d44,null))[_0x5285('0x1c')](removeEntity(_0x156d44,null))['catch'](handleError(_0x156d44,null));};exports['getConfigurations']=function(_0x5e314f,_0x5c978d,_0x5aafc9){var _0x4c5a34={};var _0x47e5a2={};var _0x17883c;var _0x512642;return db[_0x5285('0x4e')][_0x5285('0x57')]({'where':{'id':_0x5e314f['params']['id']}})[_0x5285('0x1c')](handleEntityNotFound(_0x5c978d,null))['then'](function(_0x399a18){if(_0x399a18){_0x17883c=_0x399a18;_0x47e5a2[_0x5285('0x3b')]=_[_0x5285('0x52')](db[_0x5285('0x58')][_0x5285('0x53')]);_0x47e5a2[_0x5285('0x3d')]=_[_0x5285('0x52')](_0x5e314f[_0x5285('0x3d')]);_0x47e5a2[_0x5285('0x3e')]=_[_0x5285('0x40')](_0x47e5a2['model'],_0x47e5a2[_0x5285('0x3d')]);_0x4c5a34['attributes']=_[_0x5285('0x40')](_0x47e5a2[_0x5285('0x3b')],qs['fields'](_0x5e314f[_0x5285('0x3d')][_0x5285('0x41')]));_0x4c5a34[_0x5285('0x3f')]=_0x4c5a34[_0x5285('0x3f')][_0x5285('0x42')]?_0x4c5a34[_0x5285('0x3f')]:_0x47e5a2[_0x5285('0x3b')];_0x4c5a34[_0x5285('0x44')]=qs[_0x5285('0x45')](_0x5e314f['query'][_0x5285('0x45')]);_0x4c5a34[_0x5285('0x46')]=qs[_0x5285('0x3e')](_[_0x5285('0x47')](_0x5e314f[_0x5285('0x3d')],_0x47e5a2[_0x5285('0x3e')]));if(_0x5e314f[_0x5285('0x3d')][_0x5285('0x48')]){_0x4c5a34['where']=_['merge'](_0x4c5a34[_0x5285('0x46')],{'$or':_['map'](_0x4c5a34[_0x5285('0x3f')],function(_0x361163){var _0x13272e={};_0x13272e[_0x361163]={'$like':'%'+_0x5e314f['query'][_0x5285('0x48')]+'%'};return _0x13272e;})});}_0x4c5a34=_['merge']({},_0x4c5a34,_0x5e314f[_0x5285('0x4b')]);return _0x17883c['getConfigurations'](_0x4c5a34);}})[_0x5285('0x1c')](function(_0x567f4d){if(_0x567f4d){_0x512642=_0x567f4d[_0x5285('0x42')];if(!_0x5e314f[_0x5285('0x3d')][_0x5285('0x59')](_0x5285('0x43'))){_0x4c5a34[_0x5285('0x2a')]=qs[_0x5285('0x2a')](_0x5e314f[_0x5285('0x3d')][_0x5285('0x2a')]);_0x4c5a34[_0x5285('0x29')]=qs[_0x5285('0x29')](_0x5e314f[_0x5285('0x3d')][_0x5285('0x29')]);}return _0x17883c['getConfigurations'](_0x4c5a34);}})[_0x5285('0x1c')](function(_0x52346a){if(_0x52346a){return _0x52346a?{'count':_0x512642,'rows':_0x52346a}:null;}})[_0x5285('0x1c')](respondWithResult(_0x5c978d,null))[_0x5285('0x25')](handleError(_0x5c978d,null));};exports[_0x5285('0x5a')]=function(_0x141424,_0x4c9649,_0x56d013){if(_0x141424['body']['id']){delete _0x141424[_0x5285('0x56')]['id'];}return db['ZendeskAccount'][_0x5285('0x57')]({'where':{'id':_0x141424[_0x5285('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c9649,null))[_0x5285('0x1c')](function(_0x5272e3){if(_0x5272e3){_0x141424['body'][_0x5285('0x5b')]=_0x5272e3['id'];_0x141424[_0x5285('0x56')][_0x5285('0x5c')]=integrations[_0x5285('0x5d')](_0x141424['body'][_0x5285('0x5e')],_0x141424[_0x5285('0x56')][_0x5285('0x4a')]);_0x141424[_0x5285('0x56')][_0x5285('0x5f')]=integrations[_0x5285('0x60')](_0x141424[_0x5285('0x56')][_0x5285('0x5e')],_0x141424[_0x5285('0x56')][_0x5285('0x4a')]);return db[_0x5285('0x58')][_0x5285('0x55')](_0x141424[_0x5285('0x56')],{'include':[{'model':db[_0x5285('0x61')],'as':_0x5285('0x5c')},{'model':db[_0x5285('0x61')],'as':_0x5285('0x5f')}]});}return null;})['then'](respondWithResult(_0x4c9649,null))['catch'](handleError(_0x4c9649,null));};exports['getFields']=function(_0x3549d1,_0x477e87,_0x22ea31){var _0x172025='';return db[_0x5285('0x4e')]['findOne']({'where':{'id':_0x3549d1['params']['id']},'attributes':['id',_0x5285('0x62'),_0x5285('0x63'),_0x5285('0x64'),_0x5285('0x65'),'remoteUri']})[_0x5285('0x1c')](handleEntityNotFound(_0x477e87,null))[_0x5285('0x1c')](function(_0x40afe7){if(_0x40afe7){_0x172025=_0x40afe7[_0x5285('0x66')];var _0x3f866a=_0x172025[_0x5285('0x67')](-0x1);if(_0x3f866a==='/'){_0x172025=_0x172025[_0x5285('0x68')](0x0,_0x172025[_0x5285('0x69')](_0x3f866a));}var _0x2fc57a={'method':_0x5285('0x6a'),'uri':util[_0x5285('0x6b')](_0x5285('0x6c'),_0x172025,'ticket_fields'),'json':!![]};switch(_0x40afe7[_0x5285('0x65')]){case _0x5285('0x63'):_0x2fc57a[_0x5285('0x6d')]={'Authorization':util[_0x5285('0x6b')]('Basic\x20%s',new Buffer(util[_0x5285('0x6b')](_0x5285('0x6e'),_0x40afe7[_0x5285('0x62')],_0x40afe7[_0x5285('0x63')]))[_0x5285('0x6f')](_0x5285('0x70')))};break;case _0x5285('0x64'):_0x2fc57a[_0x5285('0x6d')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0x5285('0x71'),_0x40afe7['username'],_0x40afe7[_0x5285('0x64')]))[_0x5285('0x6f')](_0x5285('0x70')))};break;default:throw new db[(_0x5285('0x72'))][(_0x5285('0x73'))]('Unknown\x20authentication\x20type');}return rp(_0x2fc57a);}})['then'](function(_0x1d47f9){if(_0x1d47f9){var _0x5d1b7a=[_0x5285('0x74'),_0x5285('0x75'),_0x5285('0x76'),_0x5285('0x77')];_['remove'](_0x1d47f9[_0x5285('0x78')],function(_0xa84a9e){return _0x5d1b7a[_0x5285('0x79')](_0xa84a9e['type']);});return{'count':_0x1d47f9[_0x5285('0x78')][_0x5285('0x42')],'rows':_[_0x5285('0x3c')](_0x1d47f9['ticket_fields'],function(_0x321a70){return{'id':_0x321a70['id'],'name':_0x321a70['position']>0x7?_0x321a70[_0x5285('0x7a')]:_0x321a70[_0x5285('0x4a')],'custom':_0x321a70['position']>0x7?!![]:![],'options':_0x321a70[_0x5285('0x7b')]?_0x321a70['system_field_options']:_0x321a70[_0x5285('0x7c')]?_0x321a70['custom_field_options']:[]};})};}})[_0x5285('0x1c')](respondWithResult(_0x477e87,null))['catch'](function(_0x1b9a1b){var _0x1da738=_0x3549d1[_0x5285('0x3d')][_0x5285('0x7d')]?0x1f4:_0x1b9a1b[_0x5285('0x7e')]||0x1f4;logger[_0x5285('0x21')](_0x5285('0x7f'),_0x5285('0x80'),_0x1da738,JSON[_0x5285('0x20')](_0x1b9a1b));delete _0x1b9a1b[_0x5285('0x36')];if(_0x1da738===0x191){_0x1da738=0x190;}_0x477e87['status'](_0x1da738)[_0x5285('0x37')](_0x3549d1[_0x5285('0x3d')][_0x5285('0x7d')]?{'message':_0x5285('0x81'),'statusCode':_0x1b9a1b[_0x5285('0x7e')]}:_0x1b9a1b);});};
\ No newline at end of file
+var _0xb66a=['title','system_field_options','custom_field_options','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','includeAll','find','create','body','params','ZendeskConfiguration','nolimit','getConfigurations','addConfiguration','findOne','Subjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','password','token','authType','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','username','toString','base64','headers','%s/token:%s','Sequelize','ValidationError','subject','description','group','remove','includes','position'];(function(_0x280364,_0x3d81ab){var _0x2eaa58=function(_0x7341df){while(--_0x7341df){_0x280364['push'](_0x280364['shift']());}};_0x2eaa58(++_0x3d81ab);}(_0xb66a,0x102));var _0xab66=function(_0x1853d3,_0x2f473c){_0x1853d3=_0x1853d3-0x0;var _0x2d6a0e=_0xb66a[_0x1853d3];return _0x2d6a0e;};'use strict';var emlformat=require(_0xab66('0x0'));var rimraf=require(_0xab66('0x1'));var zipdir=require(_0xab66('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab66('0x3'));var BPromise=require(_0xab66('0x4'));var Mustache=require('mustache');var util=require(_0xab66('0x5'));var path=require(_0xab66('0x6'));var sox=require(_0xab66('0x7'));var csv=require('to-csv');var ejs=require(_0xab66('0x8'));var fs=require('fs');var fs_extra=require(_0xab66('0x9'));var _=require('lodash');var squel=require(_0xab66('0xa'));var crypto=require(_0xab66('0xb'));var jsforce=require(_0xab66('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab66('0xd'));var Papa=require(_0xab66('0xe'));var Redis=require(_0xab66('0xf'));var authService=require(_0xab66('0x10'));var qs=require(_0xab66('0x11'));var as=require(_0xab66('0x12'));var hardwareService=require(_0xab66('0x13'));var logger=require(_0xab66('0x14'))('api');var utils=require(_0xab66('0x15'));var config=require(_0xab66('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xab66('0x17'))['db'];var integrations=require(_0xab66('0x18'));var jayson=require(_0xab66('0x19'));var client=jayson['client'][_0xab66('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xd3075e,_0x593bbb,_0x563f55,_0x27c19b){return new BPromise(function(_0x243f8b,_0x39e226){var _0x25f4fc=_0x27c19b||client;return _0x25f4fc[_0xab66('0x1b')](_0xd3075e,_0x563f55)[_0xab66('0x1c')](function(_0x4da51d){logger[_0xab66('0x1d')](_0xab66('0x1e'),_0x593bbb,_0xab66('0x1f'));logger[_0xab66('0x20')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x593bbb,_0xab66('0x1f'),JSON[_0xab66('0x21')](_0x4da51d));if(_0x4da51d[_0xab66('0x22')]){if(_0x4da51d['error']['code']===0x1f4){logger[_0xab66('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x593bbb,_0x4da51d['error']['message']);return _0x39e226(_0x4da51d[_0xab66('0x22')]['message']);}logger[_0xab66('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x593bbb,_0x4da51d[_0xab66('0x22')][_0xab66('0x23')]);return _0x243f8b(_0x4da51d['error'][_0xab66('0x23')]);}else{logger[_0xab66('0x1d')](_0xab66('0x1e'),_0x593bbb,'request\x20sent');_0x243f8b(_0x4da51d[_0xab66('0x24')]['message']);}})[_0xab66('0x25')](function(_0x234c27){logger[_0xab66('0x22')](_0xab66('0x1e'),_0x593bbb,_0x234c27);_0x39e226(_0x234c27);});});}function respondWithStatusCode(_0x3444fc,_0x4f4c5b){_0x4f4c5b=_0x4f4c5b||0xcc;return function(_0x48ed20){if(_0x48ed20){return _0x3444fc[_0xab66('0x26')](_0x4f4c5b);}return _0x3444fc[_0xab66('0x27')](_0x4f4c5b)[_0xab66('0x28')]();};}function respondWithResult(_0x565c71,_0x30ff12){_0x30ff12=_0x30ff12||0xc8;return function(_0x1ee28f){if(_0x1ee28f){return _0x565c71[_0xab66('0x27')](_0x30ff12)['json'](_0x1ee28f);}};}function respondWithFilteredResult(_0x3a1554,_0x594156){return function(_0x164450){if(_0x164450){var _0x14e014=typeof _0x594156[_0xab66('0x29')]===_0xab66('0x2a')&&typeof _0x594156[_0xab66('0x2b')]==='undefined';var _0x23e546=_0x164450[_0xab66('0x2c')];var _0x271ac1=_0x14e014?0x0:_0x594156['offset'];var _0x4dd40c=_0x14e014?_0x164450['count']:_0x594156[_0xab66('0x29')]+_0x594156[_0xab66('0x2b')];var _0x983d5b;if(_0x4dd40c>=_0x23e546){_0x4dd40c=_0x23e546;_0x983d5b=0xc8;}else{_0x983d5b=0xce;}_0x3a1554[_0xab66('0x27')](_0x983d5b);return _0x3a1554[_0xab66('0x2d')](_0xab66('0x2e'),_0x271ac1+'-'+_0x4dd40c+'/'+_0x23e546)[_0xab66('0x2f')](_0x164450);}return null;};}function patchUpdates(_0x24805c){return function(_0x38a1d7){try{jsonpatch['apply'](_0x38a1d7,_0x24805c,!![]);}catch(_0x19f574){return BPromise['reject'](_0x19f574);}return _0x38a1d7[_0xab66('0x30')]();};}function saveUpdates(_0x20342c,_0x2f43ff){return function(_0x51abb9){if(_0x51abb9){return _0x51abb9[_0xab66('0x31')](_0x20342c)['then'](function(_0x2636c3){return _0x2636c3;});}return null;};}function removeEntity(_0x48a98f,_0xd41739){return function(_0x552ba){if(_0x552ba){return _0x552ba[_0xab66('0x32')]()['then'](function(){_0x48a98f[_0xab66('0x27')](0xcc)[_0xab66('0x28')]();});}};}function handleEntityNotFound(_0xa3bc77,_0x24ad95){return function(_0x52c871){if(!_0x52c871){_0xa3bc77[_0xab66('0x26')](0x194);}return _0x52c871;};}function handleError(_0x5bf50a,_0x481d3f){_0x481d3f=_0x481d3f||0x1f4;return function(_0x20f5fa){logger['error'](_0x20f5fa[_0xab66('0x33')]);if(_0x20f5fa[_0xab66('0x34')]){delete _0x20f5fa[_0xab66('0x34')];}_0x5bf50a[_0xab66('0x27')](_0x481d3f)[_0xab66('0x35')](_0x20f5fa);};}exports[_0xab66('0x36')]=function(_0x394326,_0xfaa6b1){var _0x5eeeb9={},_0x51d68f={},_0x5b3af7={'count':0x0,'rows':[]};var _0x142c51=_[_0xab66('0x37')](db[_0xab66('0x38')][_0xab66('0x39')],function(_0x17d459){return{'name':_0x17d459['fieldName'],'type':_0x17d459['type'][_0xab66('0x3a')]};});_0x51d68f[_0xab66('0x3b')]=_[_0xab66('0x37')](_0x142c51,_0xab66('0x34'));_0x51d68f[_0xab66('0x3c')]=_[_0xab66('0x3d')](_0x394326['query']);_0x51d68f['filters']=_[_0xab66('0x3e')](_0x51d68f[_0xab66('0x3b')],_0x51d68f[_0xab66('0x3c')]);_0x5eeeb9[_0xab66('0x3f')]=_[_0xab66('0x3e')](_0x51d68f[_0xab66('0x3b')],qs['fields'](_0x394326[_0xab66('0x3c')][_0xab66('0x40')]));_0x5eeeb9[_0xab66('0x3f')]=_0x5eeeb9['attributes'][_0xab66('0x41')]?_0x5eeeb9[_0xab66('0x3f')]:_0x51d68f[_0xab66('0x3b')];if(!_0x394326['query'][_0xab66('0x42')]('nolimit')){_0x5eeeb9[_0xab66('0x2b')]=qs[_0xab66('0x2b')](_0x394326[_0xab66('0x3c')]['limit']);_0x5eeeb9[_0xab66('0x29')]=qs[_0xab66('0x29')](_0x394326[_0xab66('0x3c')]['offset']);}_0x5eeeb9[_0xab66('0x43')]=qs['sort'](_0x394326['query'][_0xab66('0x44')]);_0x5eeeb9[_0xab66('0x45')]=qs[_0xab66('0x46')](_[_0xab66('0x47')](_0x394326['query'],_0x51d68f[_0xab66('0x46')]),_0x142c51);if(_0x394326['query'][_0xab66('0x48')]){_0x5eeeb9['where']=_[_0xab66('0x49')](_0x5eeeb9[_0xab66('0x45')],{'$or':_[_0xab66('0x37')](_0x142c51,function(_0x12539f){if(_0x12539f[_0xab66('0x4a')]!==_0xab66('0x4b')){var _0x4fa031={};_0x4fa031[_0x12539f[_0xab66('0x34')]]={'$like':'%'+_0x394326[_0xab66('0x3c')][_0xab66('0x48')]+'%'};return _0x4fa031;}})});}_0x5eeeb9=_[_0xab66('0x49')]({},_0x5eeeb9,_0x394326[_0xab66('0x4c')]);var _0x4177e7={'where':_0x5eeeb9['where']};return db['ZendeskAccount'][_0xab66('0x2c')](_0x4177e7)[_0xab66('0x1c')](function(_0x4eec94){_0x5b3af7[_0xab66('0x2c')]=_0x4eec94;if(_0x394326[_0xab66('0x3c')]['includeAll']){_0x5eeeb9[_0xab66('0x4d')]=[{'all':!![]}];}return db[_0xab66('0x38')][_0xab66('0x4e')](_0x5eeeb9);})[_0xab66('0x1c')](function(_0x5c0c9b){_0x5b3af7[_0xab66('0x4f')]=_0x5c0c9b;return _0x5b3af7;})[_0xab66('0x1c')](respondWithFilteredResult(_0xfaa6b1,_0x5eeeb9))[_0xab66('0x25')](handleError(_0xfaa6b1,null));};exports[_0xab66('0x50')]=function(_0x1da31d,_0x53b6c3){var _0x5ce4a8={'raw':![],'where':{'id':_0x1da31d['params']['id']}},_0x467ebd={};_0x467ebd['model']=_['keys'](db[_0xab66('0x38')][_0xab66('0x39')]);_0x467ebd['query']=_['keys'](_0x1da31d[_0xab66('0x3c')]);_0x467ebd[_0xab66('0x46')]=_[_0xab66('0x3e')](_0x467ebd[_0xab66('0x3b')],_0x467ebd['query']);_0x5ce4a8[_0xab66('0x3f')]=_['intersection'](_0x467ebd['model'],qs[_0xab66('0x40')](_0x1da31d[_0xab66('0x3c')][_0xab66('0x40')]));_0x5ce4a8[_0xab66('0x3f')]=_0x5ce4a8[_0xab66('0x3f')][_0xab66('0x41')]?_0x5ce4a8[_0xab66('0x3f')]:_0x467ebd['model'];if(_0x1da31d[_0xab66('0x3c')][_0xab66('0x51')]){_0x5ce4a8['include']=[{'all':!![]}];}_0x5ce4a8=_['merge']({},_0x5ce4a8,_0x1da31d[_0xab66('0x4c')]);return db[_0xab66('0x38')][_0xab66('0x52')](_0x5ce4a8)[_0xab66('0x1c')](handleEntityNotFound(_0x53b6c3,null))[_0xab66('0x1c')](respondWithResult(_0x53b6c3,null))[_0xab66('0x25')](handleError(_0x53b6c3,null));};exports[_0xab66('0x53')]=function(_0x4f1fc0,_0x1a0a18){return db[_0xab66('0x38')][_0xab66('0x53')](_0x4f1fc0[_0xab66('0x54')],{})[_0xab66('0x1c')](respondWithResult(_0x1a0a18,0xc9))[_0xab66('0x25')](handleError(_0x1a0a18,null));};exports[_0xab66('0x31')]=function(_0x446149,_0x4b9bbd){if(_0x446149[_0xab66('0x54')]['id']){delete _0x446149[_0xab66('0x54')]['id'];}return db[_0xab66('0x38')][_0xab66('0x52')]({'where':{'id':_0x446149[_0xab66('0x55')]['id']}})['then'](handleEntityNotFound(_0x4b9bbd,null))[_0xab66('0x1c')](saveUpdates(_0x446149['body'],null))[_0xab66('0x1c')](respondWithResult(_0x4b9bbd,null))['catch'](handleError(_0x4b9bbd,null));};exports['destroy']=function(_0x595cdc,_0x4473e8){return db[_0xab66('0x38')][_0xab66('0x52')]({'where':{'id':_0x595cdc[_0xab66('0x55')]['id']}})['then'](handleEntityNotFound(_0x4473e8,null))[_0xab66('0x1c')](removeEntity(_0x4473e8,null))['catch'](handleError(_0x4473e8,null));};exports['getConfigurations']=function(_0x459f58,_0x2f3226,_0x2ce2fd){var _0x1835c3={};var _0x203daf={};var _0x5722aa;var _0x53dd29;return db[_0xab66('0x38')]['findOne']({'where':{'id':_0x459f58[_0xab66('0x55')]['id']}})[_0xab66('0x1c')](handleEntityNotFound(_0x2f3226,null))[_0xab66('0x1c')](function(_0x5d522e){if(_0x5d522e){_0x5722aa=_0x5d522e;_0x203daf[_0xab66('0x3b')]=_['keys'](db[_0xab66('0x56')][_0xab66('0x39')]);_0x203daf[_0xab66('0x3c')]=_[_0xab66('0x3d')](_0x459f58[_0xab66('0x3c')]);_0x203daf[_0xab66('0x46')]=_['intersection'](_0x203daf['model'],_0x203daf['query']);_0x1835c3[_0xab66('0x3f')]=_[_0xab66('0x3e')](_0x203daf[_0xab66('0x3b')],qs[_0xab66('0x40')](_0x459f58[_0xab66('0x3c')]['fields']));_0x1835c3[_0xab66('0x3f')]=_0x1835c3['attributes'][_0xab66('0x41')]?_0x1835c3['attributes']:_0x203daf[_0xab66('0x3b')];_0x1835c3['order']=qs[_0xab66('0x44')](_0x459f58[_0xab66('0x3c')][_0xab66('0x44')]);_0x1835c3['where']=qs[_0xab66('0x46')](_[_0xab66('0x47')](_0x459f58[_0xab66('0x3c')],_0x203daf[_0xab66('0x46')]));if(_0x459f58[_0xab66('0x3c')]['filter']){_0x1835c3['where']=_[_0xab66('0x49')](_0x1835c3[_0xab66('0x45')],{'$or':_[_0xab66('0x37')](_0x1835c3[_0xab66('0x3f')],function(_0x3bfa7c){var _0x327552={};_0x327552[_0x3bfa7c]={'$like':'%'+_0x459f58[_0xab66('0x3c')][_0xab66('0x48')]+'%'};return _0x327552;})});}_0x1835c3=_[_0xab66('0x49')]({},_0x1835c3,_0x459f58[_0xab66('0x4c')]);return _0x5722aa['getConfigurations'](_0x1835c3);}})[_0xab66('0x1c')](function(_0x2ff8c3){if(_0x2ff8c3){_0x53dd29=_0x2ff8c3['length'];if(!_0x459f58[_0xab66('0x3c')][_0xab66('0x42')](_0xab66('0x57'))){_0x1835c3[_0xab66('0x2b')]=qs['limit'](_0x459f58[_0xab66('0x3c')]['limit']);_0x1835c3[_0xab66('0x29')]=qs[_0xab66('0x29')](_0x459f58[_0xab66('0x3c')][_0xab66('0x29')]);}return _0x5722aa[_0xab66('0x58')](_0x1835c3);}})[_0xab66('0x1c')](function(_0x1ba1ed){if(_0x1ba1ed){return _0x1ba1ed?{'count':_0x53dd29,'rows':_0x1ba1ed}:null;}})['then'](respondWithResult(_0x2f3226,null))[_0xab66('0x25')](handleError(_0x2f3226,null));};exports[_0xab66('0x59')]=function(_0x5428c5,_0x494ce7,_0x1eae0d){if(_0x5428c5['body']['id']){delete _0x5428c5[_0xab66('0x54')]['id'];}return db[_0xab66('0x38')][_0xab66('0x5a')]({'where':{'id':_0x5428c5[_0xab66('0x55')]['id']}})[_0xab66('0x1c')](handleEntityNotFound(_0x494ce7,null))[_0xab66('0x1c')](function(_0xe47d70){if(_0xe47d70){_0x5428c5['body']['AccountId']=_0xe47d70['id'];_0x5428c5[_0xab66('0x54')][_0xab66('0x5b')]=integrations['getSubjects'](_0x5428c5[_0xab66('0x54')][_0xab66('0x5c')],_0x5428c5[_0xab66('0x54')]['type']);_0x5428c5[_0xab66('0x54')]['Descriptions']=integrations[_0xab66('0x5d')](_0x5428c5[_0xab66('0x54')][_0xab66('0x5c')],_0x5428c5[_0xab66('0x54')][_0xab66('0x4a')]);return db['ZendeskConfiguration'][_0xab66('0x53')](_0x5428c5[_0xab66('0x54')],{'include':[{'model':db[_0xab66('0x5e')],'as':_0xab66('0x5b')},{'model':db[_0xab66('0x5e')],'as':_0xab66('0x5f')}]});}return null;})[_0xab66('0x1c')](respondWithResult(_0x494ce7,null))[_0xab66('0x25')](handleError(_0x494ce7,null));};exports[_0xab66('0x60')]=function(_0x547252,_0x192142,_0x4c2e1f){var _0xc64e1b='';return db[_0xab66('0x38')][_0xab66('0x5a')]({'where':{'id':_0x547252[_0xab66('0x55')]['id']},'attributes':['id','username',_0xab66('0x61'),_0xab66('0x62'),_0xab66('0x63'),'remoteUri']})['then'](handleEntityNotFound(_0x192142,null))['then'](function(_0x41f112){if(_0x41f112){_0xc64e1b=_0x41f112['remoteUri'];var _0x1377e9=_0xc64e1b['slice'](-0x1);if(_0x1377e9==='/'){_0xc64e1b=_0xc64e1b[_0xab66('0x64')](0x0,_0xc64e1b[_0xab66('0x65')](_0x1377e9));}var _0x14e55d={'method':_0xab66('0x66'),'uri':util[_0xab66('0x67')](_0xab66('0x68'),_0xc64e1b,_0xab66('0x69')),'json':!![]};switch(_0x41f112['authType']){case'password':_0x14e55d['headers']={'Authorization':util['format'](_0xab66('0x6a'),new Buffer(util[_0xab66('0x67')]('%s:%s',_0x41f112[_0xab66('0x6b')],_0x41f112[_0xab66('0x61')]))[_0xab66('0x6c')](_0xab66('0x6d')))};break;case _0xab66('0x62'):_0x14e55d[_0xab66('0x6e')]={'Authorization':util['format'](_0xab66('0x6a'),new Buffer(util[_0xab66('0x67')](_0xab66('0x6f'),_0x41f112['username'],_0x41f112['token']))[_0xab66('0x6c')]('base64'))};break;default:throw new db[(_0xab66('0x70'))][(_0xab66('0x71'))]('Unknown\x20authentication\x20type');}return rp(_0x14e55d);}})[_0xab66('0x1c')](function(_0x103025){if(_0x103025){var _0x31188a=[_0xab66('0x72'),_0xab66('0x73'),_0xab66('0x74'),'assignee'];_[_0xab66('0x75')](_0x103025[_0xab66('0x69')],function(_0x14fe5f){return _0x31188a[_0xab66('0x76')](_0x14fe5f['type']);});return{'count':_0x103025[_0xab66('0x69')][_0xab66('0x41')],'rows':_['map'](_0x103025[_0xab66('0x69')],function(_0x49f9f6){return{'id':_0x49f9f6['id'],'name':_0x49f9f6[_0xab66('0x77')]>0x7?_0x49f9f6[_0xab66('0x78')]:_0x49f9f6[_0xab66('0x4a')],'custom':_0x49f9f6[_0xab66('0x77')]>0x7?!![]:![],'options':_0x49f9f6['system_field_options']?_0x49f9f6[_0xab66('0x79')]:_0x49f9f6[_0xab66('0x7a')]?_0x49f9f6[_0xab66('0x7a')]:[]};})};}})[_0xab66('0x1c')](respondWithResult(_0x192142,null))[_0xab66('0x25')](function(_0x4fbd54){var _0x1bc8fa=_0x547252[_0xab66('0x3c')][_0xab66('0x7b')]?0x1f4:_0x4fbd54[_0xab66('0x7c')]||0x1f4;logger[_0xab66('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xab66('0x60'),_0x1bc8fa,JSON[_0xab66('0x21')](_0x4fbd54));delete _0x4fbd54['name'];if(_0x1bc8fa===0x191){_0x1bc8fa=0x190;}_0x192142[_0xab66('0x27')](_0x1bc8fa)[_0xab66('0x35')](_0x547252[_0xab66('0x3c')]['test']?{'message':_0xab66('0x7d'),'statusCode':_0x4fbd54[_0xab66('0x7c')]}:_0x4fbd54);});};
\ No newline at end of file
index 8fda626..195ca05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf798=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','api','moment'];(function(_0x1ff723,_0x423e54){var _0x1991d5=function(_0x13dbf1){while(--_0x13dbf1){_0x1ff723['push'](_0x1ff723['shift']());}};_0x1991d5(++_0x423e54);}(_0xf798,0xd9));var _0x8f79=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf798[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x8f79('0x0'));var util=require(_0x8f79('0x1'));var logger=require('../../config/logger')(_0x8f79('0x2'));var moment=require(_0x8f79('0x3'));var BPromise=require(_0x8f79('0x4'));var rp=require(_0x8f79('0x5'));var fs=require('fs');var path=require(_0x8f79('0x6'));var rimraf=require(_0x8f79('0x7'));var config=require(_0x8f79('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x8f79('0x9'));module[_0x8f79('0xa')]=function(_0x37343a,_0x5421da){return _0x37343a[_0x8f79('0xb')](_0x8f79('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f85=['moment','bluebird','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x3cf418,_0x48945d){var _0x2518cc=function(_0xc83156){while(--_0xc83156){_0x3cf418['push'](_0x3cf418['shift']());}};_0x2518cc(++_0x48945d);}(_0x9f85,0x184));var _0x59f8=function(_0x512f55,_0x42cdce){_0x512f55=_0x512f55-0x0;var _0x19050a=_0x9f85[_0x512f55];return _0x19050a;};'use strict';var _=require(_0x59f8('0x0'));var util=require(_0x59f8('0x1'));var logger=require(_0x59f8('0x2'))(_0x59f8('0x3'));var moment=require(_0x59f8('0x4'));var BPromise=require(_0x59f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x59f8('0x6'));var config=require(_0x59f8('0x7'));var attributes=require(_0x59f8('0x8'));var integrations=require(_0x59f8('0x9'));module[_0x59f8('0xa')]=function(_0x298161,_0x1402fe){return _0x298161[_0x59f8('0xb')](_0x59f8('0xc'),attributes,{'tableName':_0x59f8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9679dd0..820fb5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a16=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','result','catch','findAll','options','raw','where','attributes','limit','include','model','map','GetZendeskAccount','ZendeskAccount','find','ShowZendeskAccount','lodash'];(function(_0x81b938,_0x30380a){var _0x98d810=function(_0x5c04f3){while(--_0x5c04f3){_0x81b938['push'](_0x81b938['shift']());}};_0x98d810(++_0x30380a);}(_0x7a16,0x171));var _0x67a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a16[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x67a1('0x0'));var util=require('util');var moment=require(_0x67a1('0x1'));var BPromise=require(_0x67a1('0x2'));var rs=require(_0x67a1('0x3'));var fs=require('fs');var Redis=require(_0x67a1('0x4'));var db=require(_0x67a1('0x5'))['db'];var utils=require(_0x67a1('0x6'));var logger=require(_0x67a1('0x7'))(_0x67a1('0x8'));var config=require(_0x67a1('0x9'));var jayson=require(_0x67a1('0xa'));var client=jayson['client'][_0x67a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abca4,_0x55acd2,_0x4c204d){return new BPromise(function(_0x3b8abc,_0x245dbd){return client[_0x67a1('0xc')](_0x5abca4,_0x4c204d)[_0x67a1('0xd')](function(_0x3a7a51){logger[_0x67a1('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x55acd2,_0x67a1('0xf'));logger[_0x67a1('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x55acd2,_0x67a1('0xf'),JSON[_0x67a1('0x11')](_0x3a7a51));if(_0x3a7a51['error']){if(_0x3a7a51[_0x67a1('0x12')][_0x67a1('0x13')]===0x1f4){logger[_0x67a1('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x55acd2,_0x3a7a51[_0x67a1('0x12')][_0x67a1('0x14')]);return _0x245dbd(_0x3a7a51[_0x67a1('0x12')]['message']);}logger['error'](_0x67a1('0x15'),_0x55acd2,_0x3a7a51[_0x67a1('0x12')]['message']);return _0x3b8abc(_0x3a7a51[_0x67a1('0x12')][_0x67a1('0x14')]);}else{logger['info'](_0x67a1('0x15'),_0x55acd2,_0x67a1('0xf'));_0x3b8abc(_0x3a7a51[_0x67a1('0x16')][_0x67a1('0x14')]);}})[_0x67a1('0x17')](function(_0x5a3736){logger[_0x67a1('0x12')](_0x67a1('0x15'),_0x55acd2,_0x5a3736);_0x245dbd(_0x5a3736);});});}exports['GetZendeskAccount']=function(_0x222722){var _0x784a0c=this;return new Promise(function(_0x257662,_0x2b9346){return db['ZendeskAccount'][_0x67a1('0x18')]({'raw':_0x222722[_0x67a1('0x19')]?_0x222722['options'][_0x67a1('0x1a')]===undefined?!![]:![]:!![],'where':_0x222722['options']?_0x222722[_0x67a1('0x19')][_0x67a1('0x1b')]||null:null,'attributes':_0x222722[_0x67a1('0x19')]?_0x222722['options'][_0x67a1('0x1c')]||null:null,'limit':_0x222722[_0x67a1('0x19')]?_0x222722['options'][_0x67a1('0x1d')]||null:null,'include':_0x222722['options']?_0x222722[_0x67a1('0x19')]['include']?_['map'](_0x222722[_0x67a1('0x19')][_0x67a1('0x1e')],function(_0x579d3a){return{'model':db[_0x579d3a[_0x67a1('0x1f')]],'as':_0x579d3a['as'],'attributes':_0x579d3a[_0x67a1('0x1c')],'include':_0x579d3a[_0x67a1('0x1e')]?_[_0x67a1('0x20')](_0x579d3a[_0x67a1('0x1e')],function(_0x1bfbe3){return{'model':db[_0x1bfbe3[_0x67a1('0x1f')]],'as':_0x1bfbe3['as'],'attributes':_0x1bfbe3['attributes'],'include':_0x1bfbe3[_0x67a1('0x1e')]?_[_0x67a1('0x20')](_0x1bfbe3[_0x67a1('0x1e')],function(_0x4db40a){return{'model':db[_0x4db40a['model']],'as':_0x4db40a['as'],'attributes':_0x4db40a[_0x67a1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x569751){logger[_0x67a1('0xe')](_0x67a1('0x21'),_0x222722);logger[_0x67a1('0x10')](_0x67a1('0x21'),_0x222722,JSON[_0x67a1('0x11')](_0x569751));_0x257662(_0x569751);})[_0x67a1('0x17')](function(_0x5696c5){logger[_0x67a1('0x12')](_0x67a1('0x21'),_0x5696c5[_0x67a1('0x14')],_0x222722);_0x2b9346(_0x784a0c[_0x67a1('0x12')](0x1f4,_0x5696c5[_0x67a1('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x2af29e){var _0x3453ba=this;return new Promise(function(_0x4c4da8,_0x325ac0){return db[_0x67a1('0x22')][_0x67a1('0x23')]({'raw':_0x2af29e['options']?_0x2af29e[_0x67a1('0x19')][_0x67a1('0x1a')]===undefined?!![]:![]:!![],'where':_0x2af29e[_0x67a1('0x19')]?_0x2af29e[_0x67a1('0x19')][_0x67a1('0x1b')]||null:null,'attributes':_0x2af29e[_0x67a1('0x19')]?_0x2af29e['options'][_0x67a1('0x1c')]||null:null,'include':_0x2af29e['options']?_0x2af29e[_0x67a1('0x19')][_0x67a1('0x1e')]?_[_0x67a1('0x20')](_0x2af29e['options'][_0x67a1('0x1e')],function(_0x4b2e0b){return{'model':db[_0x4b2e0b['model']],'as':_0x4b2e0b['as'],'attributes':_0x4b2e0b[_0x67a1('0x1c')],'include':_0x4b2e0b[_0x67a1('0x1e')]?_[_0x67a1('0x20')](_0x4b2e0b[_0x67a1('0x1e')],function(_0x1a309d){return{'model':db[_0x1a309d[_0x67a1('0x1f')]],'as':_0x1a309d['as'],'attributes':_0x1a309d[_0x67a1('0x1c')],'include':_0x1a309d[_0x67a1('0x1e')]?_['map'](_0x1a309d[_0x67a1('0x1e')],function(_0x590d4f){return{'model':db[_0x590d4f[_0x67a1('0x1f')]],'as':_0x590d4f['as'],'attributes':_0x590d4f[_0x67a1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x67a1('0xd')](function(_0xeef363){logger[_0x67a1('0xe')](_0x67a1('0x24'),_0x2af29e);logger['debug'](_0x67a1('0x24'),_0x2af29e,JSON[_0x67a1('0x11')](_0xeef363));_0x4c4da8(_0xeef363);})['catch'](function(_0x7a254a){logger[_0x67a1('0x12')]('ShowZendeskAccount',_0x7a254a[_0x67a1('0x14')],_0x2af29e);_0x325ac0(_0x3453ba[_0x67a1('0x12')](0x1f4,_0x7a254a[_0x67a1('0x14')]));});});};
\ No newline at end of file
+var _0x9772=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','model','include','map','ShowZendeskAccount','find','raw','lodash','bluebird','ioredis'];(function(_0x26e2d9,_0x55f20f){var _0x496105=function(_0x2e78ca){while(--_0x2e78ca){_0x26e2d9['push'](_0x26e2d9['shift']());}};_0x496105(++_0x55f20f);}(_0x9772,0x189));var _0x2977=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x9772[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x2977('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2977('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2977('0x2'));var db=require(_0x2977('0x3'))['db'];var utils=require(_0x2977('0x4'));var logger=require(_0x2977('0x5'))(_0x2977('0x6'));var config=require('../../config/environment');var jayson=require(_0x2977('0x7'));var client=jayson[_0x2977('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43b555,_0x473577,_0x4e0567){return new BPromise(function(_0x1df08f,_0x1ac290){return client[_0x2977('0x9')](_0x43b555,_0x4e0567)[_0x2977('0xa')](function(_0x271450){logger[_0x2977('0xb')](_0x2977('0xc'),_0x473577,_0x2977('0xd'));logger[_0x2977('0xe')](_0x2977('0xf'),_0x473577,_0x2977('0xd'),JSON[_0x2977('0x10')](_0x271450));if(_0x271450['error']){if(_0x271450['error']['code']===0x1f4){logger[_0x2977('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x473577,_0x271450[_0x2977('0x11')][_0x2977('0x12')]);return _0x1ac290(_0x271450[_0x2977('0x11')]['message']);}logger[_0x2977('0x11')](_0x2977('0xc'),_0x473577,_0x271450[_0x2977('0x11')]['message']);return _0x1df08f(_0x271450['error'][_0x2977('0x12')]);}else{logger[_0x2977('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x473577,'request\x20sent');_0x1df08f(_0x271450[_0x2977('0x13')][_0x2977('0x12')]);}})[_0x2977('0x14')](function(_0x47a095){logger[_0x2977('0x11')](_0x2977('0xc'),_0x473577,_0x47a095);_0x1ac290(_0x47a095);});});}exports[_0x2977('0x15')]=function(_0x41528e){var _0x4ae1d4=this;return new Promise(function(_0x1cf4c1,_0x2a3702){return db[_0x2977('0x16')][_0x2977('0x17')]({'raw':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')][_0x2977('0x19')]||null:null,'attributes':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')][_0x2977('0x1a')]||null:null,'limit':_0x41528e['options']?_0x41528e[_0x2977('0x18')]['limit']||null:null,'include':_0x41528e[_0x2977('0x18')]?_0x41528e[_0x2977('0x18')]['include']?_['map'](_0x41528e['options']['include'],function(_0x719fda){return{'model':db[_0x719fda[_0x2977('0x1b')]],'as':_0x719fda['as'],'attributes':_0x719fda[_0x2977('0x1a')],'include':_0x719fda[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x719fda[_0x2977('0x1c')],function(_0x10cac4){return{'model':db[_0x10cac4['model']],'as':_0x10cac4['as'],'attributes':_0x10cac4[_0x2977('0x1a')],'include':_0x10cac4[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x10cac4[_0x2977('0x1c')],function(_0x1a23eb){return{'model':db[_0x1a23eb[_0x2977('0x1b')]],'as':_0x1a23eb['as'],'attributes':_0x1a23eb[_0x2977('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7bd0){logger[_0x2977('0xb')](_0x2977('0x15'),_0x41528e);logger[_0x2977('0xe')](_0x2977('0x15'),_0x41528e,JSON[_0x2977('0x10')](_0x4f7bd0));_0x1cf4c1(_0x4f7bd0);})[_0x2977('0x14')](function(_0x43d5f5){logger[_0x2977('0x11')]('GetZendeskAccount',_0x43d5f5[_0x2977('0x12')],_0x41528e);_0x2a3702(_0x4ae1d4[_0x2977('0x11')](0x1f4,_0x43d5f5[_0x2977('0x12')]));});});};exports[_0x2977('0x1e')]=function(_0xe9fe86){var _0x34d232=this;return new Promise(function(_0x4ce4b6,_0x6ef04c){return db[_0x2977('0x16')][_0x2977('0x1f')]({'raw':_0xe9fe86['options']?_0xe9fe86[_0x2977('0x18')][_0x2977('0x20')]===undefined?!![]:![]:!![],'where':_0xe9fe86[_0x2977('0x18')]?_0xe9fe86['options'][_0x2977('0x19')]||null:null,'attributes':_0xe9fe86[_0x2977('0x18')]?_0xe9fe86['options'][_0x2977('0x1a')]||null:null,'include':_0xe9fe86['options']?_0xe9fe86['options'][_0x2977('0x1c')]?_[_0x2977('0x1d')](_0xe9fe86[_0x2977('0x18')]['include'],function(_0x4d7fd2){return{'model':db[_0x4d7fd2[_0x2977('0x1b')]],'as':_0x4d7fd2['as'],'attributes':_0x4d7fd2['attributes'],'include':_0x4d7fd2[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x4d7fd2['include'],function(_0x3bd961){return{'model':db[_0x3bd961[_0x2977('0x1b')]],'as':_0x3bd961['as'],'attributes':_0x3bd961[_0x2977('0x1a')],'include':_0x3bd961[_0x2977('0x1c')]?_[_0x2977('0x1d')](_0x3bd961[_0x2977('0x1c')],function(_0x55e17e){return{'model':db[_0x55e17e[_0x2977('0x1b')]],'as':_0x55e17e['as'],'attributes':_0x55e17e[_0x2977('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2977('0xa')](function(_0x422ceb){logger[_0x2977('0xb')](_0x2977('0x1e'),_0xe9fe86);logger[_0x2977('0xe')]('ShowZendeskAccount',_0xe9fe86,JSON[_0x2977('0x10')](_0x422ceb));_0x4ce4b6(_0x422ceb);})[_0x2977('0x14')](function(_0x21f7f6){logger['error']('ShowZendeskAccount',_0x21f7f6[_0x2977('0x12')],_0xe9fe86);_0x6ef04c(_0x34d232[_0x2977('0x11')](0x1f4,_0x21f7f6['message']));});});};
\ No newline at end of file
index 956a96a..9cd1de6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0xd35514,_0x12db33){var _0x557c55=function(_0x3ea635){while(--_0x3ea635){_0xd35514['push'](_0xd35514['shift']());}};_0x557c55(++_0x12db33);}(_0xf4eb,0xec));var _0xbf4e=function(_0x47b3a3,_0x13b58c){_0x47b3a3=_0x47b3a3-0x0;var _0x5f1a93=_0xf4eb[_0x47b3a3];return _0x5f1a93;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router;
\ No newline at end of file
+var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'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('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router;
\ No newline at end of file
index 8bd9cc4..436e490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd26b=['sequelize','exports','STRING'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xd26b,0xed));var _0xbd26=function(_0x228e54,_0x37e1b0){_0x228e54=_0x228e54-0x0;var _0x58aac6=_0xd26b[_0x228e54];return _0x58aac6;};'use strict';var Sequelize=require(_0xbd26('0x0'));module[_0xbd26('0x1')]={'name':{'type':Sequelize[_0xbd26('0x2')]},'description':{'type':Sequelize[_0xbd26('0x2')]}};
\ No newline at end of file
+var _0x6812=['STRING','sequelize','exports'];(function(_0x2adc0d,_0x371b7a){var _0x4b5786=function(_0x4edd35){while(--_0x4edd35){_0x2adc0d['push'](_0x2adc0d['shift']());}};_0x4b5786(++_0x371b7a);}(_0x6812,0x1ab));var _0x2681=function(_0x2e7671,_0xc64e5e){_0x2e7671=_0x2e7671-0x0;var _0x342a67=_0x6812[_0x2e7671];return _0x342a67;};'use strict';var Sequelize=require(_0x2681('0x0'));module[_0x2681('0x1')]={'name':{'type':Sequelize[_0x2681('0x2')]},'description':{'type':Sequelize[_0x2681('0x2')]}};
\ No newline at end of file
index 8301a0d..935071c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x111b=['ZendeskField','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','end','sendStatus','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','options','create','body','params','getFields','findOne'];(function(_0x91d349,_0x3730fb){var _0x22fdc6=function(_0x1908c3){while(--_0x1908c3){_0x91d349['push'](_0x91d349['shift']());}};_0x22fdc6(++_0x3730fb);}(_0x111b,0x1e1));var _0xb111=function(_0x21e98d,_0xc09284){_0x21e98d=_0x21e98d-0x0;var _0x140c2b=_0x111b[_0x21e98d];return _0x140c2b;};'use strict';var emlformat=require(_0xb111('0x0'));var rimraf=require(_0xb111('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb111('0x2'));var rp=require(_0xb111('0x3'));var moment=require(_0xb111('0x4'));var BPromise=require(_0xb111('0x5'));var Mustache=require(_0xb111('0x6'));var util=require('util');var path=require(_0xb111('0x7'));var sox=require('sox');var csv=require(_0xb111('0x8'));var ejs=require(_0xb111('0x9'));var fs=require('fs');var fs_extra=require(_0xb111('0xa'));var _=require(_0xb111('0xb'));var squel=require('squel');var crypto=require(_0xb111('0xc'));var jsforce=require(_0xb111('0xd'));var deskjs=require(_0xb111('0xe'));var toCsv=require(_0xb111('0x8'));var querystring=require(_0xb111('0xf'));var Papa=require(_0xb111('0x10'));var Redis=require(_0xb111('0x11'));var authService=require(_0xb111('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb111('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb111('0x14'))(_0xb111('0x15'));var utils=require(_0xb111('0x16'));var config=require(_0xb111('0x17'));var licenseUtil=require(_0xb111('0x18'));var db=require(_0xb111('0x19'))['db'];var jayson=require(_0xb111('0x1a'));var client=jayson[_0xb111('0x1b')][_0xb111('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1beef7,_0x4ecae4,_0x3a0028,_0x53cf09){return new BPromise(function(_0x29ae8d,_0x90a54c){var _0x55a811=_0x53cf09||client;return _0x55a811[_0xb111('0x1d')](_0x1beef7,_0x3a0028)[_0xb111('0x1e')](function(_0x1d08af){logger['info'](_0xb111('0x1f'),_0x4ecae4,'request\x20sent');logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4ecae4,_0xb111('0x20'),JSON[_0xb111('0x21')](_0x1d08af));if(_0x1d08af['error']){if(_0x1d08af['error'][_0xb111('0x22')]===0x1f4){logger[_0xb111('0x23')](_0xb111('0x1f'),_0x4ecae4,_0x1d08af[_0xb111('0x23')][_0xb111('0x24')]);return _0x90a54c(_0x1d08af['error'][_0xb111('0x24')]);}logger[_0xb111('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ecae4,_0x1d08af[_0xb111('0x23')]['message']);return _0x29ae8d(_0x1d08af[_0xb111('0x23')][_0xb111('0x24')]);}else{logger['info'](_0xb111('0x1f'),_0x4ecae4,_0xb111('0x20'));_0x29ae8d(_0x1d08af[_0xb111('0x25')]['message']);}})[_0xb111('0x26')](function(_0x488820){logger[_0xb111('0x23')](_0xb111('0x1f'),_0x4ecae4,_0x488820);_0x90a54c(_0x488820);});});}function respondWithStatusCode(_0x4fb40b,_0x41757f){_0x41757f=_0x41757f||0xcc;return function(_0x4d0bbe){if(_0x4d0bbe){return _0x4fb40b['sendStatus'](_0x41757f);}return _0x4fb40b[_0xb111('0x27')](_0x41757f)['end']();};}function respondWithResult(_0x55f7c0,_0x35dc9e){_0x35dc9e=_0x35dc9e||0xc8;return function(_0x1378fb){if(_0x1378fb){return _0x55f7c0[_0xb111('0x27')](_0x35dc9e)[_0xb111('0x28')](_0x1378fb);}};}function respondWithFilteredResult(_0xaa2c2c,_0x158737){return function(_0x16c32f){if(_0x16c32f){var _0x593b6f=typeof _0x158737['offset']===_0xb111('0x29')&&typeof _0x158737[_0xb111('0x2a')]==='undefined';var _0x40a954=_0x16c32f[_0xb111('0x2b')];var _0x5d13d1=_0x593b6f?0x0:_0x158737['offset'];var _0x1d8797=_0x593b6f?_0x16c32f[_0xb111('0x2b')]:_0x158737[_0xb111('0x2c')]+_0x158737[_0xb111('0x2a')];var _0xbe34ae;if(_0x1d8797>=_0x40a954){_0x1d8797=_0x40a954;_0xbe34ae=0xc8;}else{_0xbe34ae=0xce;}_0xaa2c2c[_0xb111('0x27')](_0xbe34ae);return _0xaa2c2c[_0xb111('0x2d')](_0xb111('0x2e'),_0x5d13d1+'-'+_0x1d8797+'/'+_0x40a954)[_0xb111('0x28')](_0x16c32f);}return null;};}function patchUpdates(_0x5255cf){return function(_0x39316d){try{jsonpatch[_0xb111('0x2f')](_0x39316d,_0x5255cf,!![]);}catch(_0x12b132){return BPromise['reject'](_0x12b132);}return _0x39316d[_0xb111('0x30')]();};}function saveUpdates(_0x1d1db3,_0x36ad41){return function(_0x2a3878){if(_0x2a3878){return _0x2a3878[_0xb111('0x31')](_0x1d1db3)[_0xb111('0x1e')](function(_0x484321){return _0x484321;});}return null;};}function removeEntity(_0x13abe1,_0x3092fa){return function(_0x29dda5){if(_0x29dda5){return _0x29dda5[_0xb111('0x32')]()['then'](function(){_0x13abe1[_0xb111('0x27')](0xcc)[_0xb111('0x33')]();});}};}function handleEntityNotFound(_0x257661,_0x52ef10){return function(_0x364653){if(!_0x364653){_0x257661[_0xb111('0x34')](0x194);}return _0x364653;};}function handleError(_0x3ec492,_0x8a9d3){_0x8a9d3=_0x8a9d3||0x1f4;return function(_0x2bf680){logger[_0xb111('0x23')](_0x2bf680[_0xb111('0x35')]);if(_0x2bf680['name']){delete _0x2bf680[_0xb111('0x36')];}_0x3ec492[_0xb111('0x27')](_0x8a9d3)['send'](_0x2bf680);};}exports[_0xb111('0x37')]=function(_0x499423,_0x5d1cb1){var _0x349540={},_0x423189={},_0x9dc3ea={'count':0x0,'rows':[]};var _0x5f4476=_[_0xb111('0x38')](db[_0xb111('0x39')][_0xb111('0x3a')],function(_0x4009f9){return{'name':_0x4009f9[_0xb111('0x3b')],'type':_0x4009f9[_0xb111('0x3c')][_0xb111('0x3d')]};});_0x423189[_0xb111('0x3e')]=_[_0xb111('0x38')](_0x5f4476,_0xb111('0x36'));_0x423189[_0xb111('0x3f')]=_[_0xb111('0x40')](_0x499423[_0xb111('0x3f')]);_0x423189[_0xb111('0x41')]=_[_0xb111('0x42')](_0x423189['model'],_0x423189[_0xb111('0x3f')]);_0x349540[_0xb111('0x43')]=_[_0xb111('0x42')](_0x423189[_0xb111('0x3e')],qs[_0xb111('0x44')](_0x499423['query'][_0xb111('0x44')]));_0x349540[_0xb111('0x43')]=_0x349540['attributes'][_0xb111('0x45')]?_0x349540[_0xb111('0x43')]:_0x423189[_0xb111('0x3e')];if(!_0x499423['query'][_0xb111('0x46')](_0xb111('0x47'))){_0x349540[_0xb111('0x2a')]=qs[_0xb111('0x2a')](_0x499423['query'][_0xb111('0x2a')]);_0x349540[_0xb111('0x2c')]=qs['offset'](_0x499423['query']['offset']);}_0x349540[_0xb111('0x48')]=qs[_0xb111('0x49')](_0x499423['query'][_0xb111('0x49')]);_0x349540[_0xb111('0x4a')]=qs[_0xb111('0x41')](_[_0xb111('0x4b')](_0x499423[_0xb111('0x3f')],_0x423189[_0xb111('0x41')]),_0x5f4476);if(_0x499423['query']['filter']){_0x349540['where']=_[_0xb111('0x4c')](_0x349540['where'],{'$or':_[_0xb111('0x38')](_0x5f4476,function(_0x2b321f){if(_0x2b321f[_0xb111('0x3c')]!==_0xb111('0x4d')){var _0x2caf2a={};_0x2caf2a[_0x2b321f[_0xb111('0x36')]]={'$like':'%'+_0x499423['query'][_0xb111('0x4e')]+'%'};return _0x2caf2a;}})});}_0x349540=_['merge']({},_0x349540,_0x499423['options']);var _0xf258af={'where':_0x349540[_0xb111('0x4a')]};return db[_0xb111('0x39')]['count'](_0xf258af)[_0xb111('0x1e')](function(_0x336e92){_0x9dc3ea[_0xb111('0x2b')]=_0x336e92;if(_0x499423[_0xb111('0x3f')][_0xb111('0x4f')]){_0x349540[_0xb111('0x50')]=[{'all':!![]}];}return db[_0xb111('0x39')][_0xb111('0x51')](_0x349540);})[_0xb111('0x1e')](function(_0x101c37){_0x9dc3ea[_0xb111('0x52')]=_0x101c37;return _0x9dc3ea;})['then'](respondWithFilteredResult(_0x5d1cb1,_0x349540))[_0xb111('0x26')](handleError(_0x5d1cb1,null));};exports['show']=function(_0x2a1a7d,_0x19a16a){var _0x39485a={'raw':![],'where':{'id':_0x2a1a7d['params']['id']}},_0x3e1931={};_0x3e1931[_0xb111('0x3e')]=_[_0xb111('0x40')](db['ZendeskConfiguration'][_0xb111('0x3a')]);_0x3e1931['query']=_[_0xb111('0x40')](_0x2a1a7d[_0xb111('0x3f')]);_0x3e1931[_0xb111('0x41')]=_[_0xb111('0x42')](_0x3e1931[_0xb111('0x3e')],_0x3e1931[_0xb111('0x3f')]);_0x39485a['attributes']=_[_0xb111('0x42')](_0x3e1931[_0xb111('0x3e')],qs['fields'](_0x2a1a7d[_0xb111('0x3f')][_0xb111('0x44')]));_0x39485a['attributes']=_0x39485a[_0xb111('0x43')][_0xb111('0x45')]?_0x39485a['attributes']:_0x3e1931['model'];if(_0x2a1a7d[_0xb111('0x3f')]['includeAll']){_0x39485a[_0xb111('0x50')]=[{'all':!![]}];}_0x39485a=_['merge']({},_0x39485a,_0x2a1a7d[_0xb111('0x53')]);return db[_0xb111('0x39')]['find'](_0x39485a)['then'](handleEntityNotFound(_0x19a16a,null))[_0xb111('0x1e')](respondWithResult(_0x19a16a,null))[_0xb111('0x26')](handleError(_0x19a16a,null));};exports[_0xb111('0x54')]=function(_0x1cbfd6,_0x350e4f){return db[_0xb111('0x39')][_0xb111('0x54')](_0x1cbfd6[_0xb111('0x55')],{})['then'](respondWithResult(_0x350e4f,0xc9))[_0xb111('0x26')](handleError(_0x350e4f,null));};exports[_0xb111('0x31')]=function(_0x5764bc,_0xb4e1c7){if(_0x5764bc['body']['id']){delete _0x5764bc[_0xb111('0x55')]['id'];}return db[_0xb111('0x39')]['find']({'where':{'id':_0x5764bc['params']['id']}})[_0xb111('0x1e')](handleEntityNotFound(_0xb4e1c7,null))[_0xb111('0x1e')](saveUpdates(_0x5764bc['body'],null))[_0xb111('0x1e')](respondWithResult(_0xb4e1c7,null))[_0xb111('0x26')](handleError(_0xb4e1c7,null));};exports['destroy']=function(_0x31eb95,_0x151f2d){return db[_0xb111('0x39')]['find']({'where':{'id':_0x31eb95[_0xb111('0x56')]['id']}})['then'](handleEntityNotFound(_0x151f2d,null))[_0xb111('0x1e')](removeEntity(_0x151f2d,null))['catch'](handleError(_0x151f2d,null));};exports[_0xb111('0x57')]=function(_0xf03406,_0x15bc3e,_0x4af5b6){var _0x218365={};var _0x3e1e41={};var _0x43c3ef;var _0x5a96db;return db[_0xb111('0x39')][_0xb111('0x58')]({'where':{'id':_0xf03406['params']['id']}})[_0xb111('0x1e')](handleEntityNotFound(_0x15bc3e,null))['then'](function(_0x19b473){if(_0x19b473){_0x43c3ef=_0x19b473;_0x3e1e41['model']=_['keys'](db[_0xb111('0x59')]['rawAttributes']);_0x3e1e41[_0xb111('0x3f')]=_['keys'](_0xf03406[_0xb111('0x3f')]);_0x3e1e41['filters']=_[_0xb111('0x42')](_0x3e1e41['model'],_0x3e1e41['query']);_0x218365['attributes']=_[_0xb111('0x42')](_0x3e1e41[_0xb111('0x3e')],qs['fields'](_0xf03406[_0xb111('0x3f')][_0xb111('0x44')]));_0x218365[_0xb111('0x43')]=_0x218365['attributes'][_0xb111('0x45')]?_0x218365['attributes']:_0x3e1e41[_0xb111('0x3e')];_0x218365[_0xb111('0x48')]=qs['sort'](_0xf03406[_0xb111('0x3f')][_0xb111('0x49')]);_0x218365[_0xb111('0x4a')]=qs[_0xb111('0x41')](_[_0xb111('0x4b')](_0xf03406[_0xb111('0x3f')],_0x3e1e41[_0xb111('0x41')]));if(_0xf03406['query'][_0xb111('0x4e')]){_0x218365['where']=_[_0xb111('0x4c')](_0x218365[_0xb111('0x4a')],{'$or':_[_0xb111('0x38')](_0x218365[_0xb111('0x43')],function(_0x3102f5){var _0x3203b9={};_0x3203b9[_0x3102f5]={'$like':'%'+_0xf03406[_0xb111('0x3f')][_0xb111('0x4e')]+'%'};return _0x3203b9;})});}_0x218365=_[_0xb111('0x4c')]({},_0x218365,_0xf03406[_0xb111('0x53')]);return _0x43c3ef['getFields'](_0x218365);}})[_0xb111('0x1e')](function(_0x587097){if(_0x587097){_0x5a96db=_0x587097[_0xb111('0x45')];if(!_0xf03406[_0xb111('0x3f')][_0xb111('0x46')](_0xb111('0x47'))){_0x218365[_0xb111('0x2a')]=qs[_0xb111('0x2a')](_0xf03406[_0xb111('0x3f')][_0xb111('0x2a')]);_0x218365[_0xb111('0x2c')]=qs[_0xb111('0x2c')](_0xf03406[_0xb111('0x3f')][_0xb111('0x2c')]);}return _0x43c3ef[_0xb111('0x57')](_0x218365);}})[_0xb111('0x1e')](function(_0x545da8){if(_0x545da8){return _0x545da8?{'count':_0x5a96db,'rows':_0x545da8}:null;}})[_0xb111('0x1e')](respondWithResult(_0x15bc3e,null))[_0xb111('0x26')](handleError(_0x15bc3e,null));};exports['getSubjects']=function(_0x2f842d,_0x451f37,_0x448b21){var _0x2d1fc4={};var _0x1a4ebd={};var _0x26a3cf;var _0x2e4c5b;return db['ZendeskConfiguration'][_0xb111('0x58')]({'where':{'id':_0x2f842d[_0xb111('0x56')]['id']}})['then'](handleEntityNotFound(_0x451f37,null))['then'](function(_0x259c0f){if(_0x259c0f){_0x26a3cf=_0x259c0f;_0x1a4ebd[_0xb111('0x3e')]=_[_0xb111('0x40')](db[_0xb111('0x59')][_0xb111('0x3a')]);_0x1a4ebd[_0xb111('0x3f')]=_[_0xb111('0x40')](_0x2f842d[_0xb111('0x3f')]);_0x1a4ebd[_0xb111('0x41')]=_[_0xb111('0x42')](_0x1a4ebd[_0xb111('0x3e')],_0x1a4ebd['query']);_0x2d1fc4[_0xb111('0x43')]=_[_0xb111('0x42')](_0x1a4ebd[_0xb111('0x3e')],qs[_0xb111('0x44')](_0x2f842d[_0xb111('0x3f')][_0xb111('0x44')]));_0x2d1fc4['attributes']=_0x2d1fc4[_0xb111('0x43')][_0xb111('0x45')]?_0x2d1fc4[_0xb111('0x43')]:_0x1a4ebd[_0xb111('0x3e')];_0x2d1fc4[_0xb111('0x48')]=qs[_0xb111('0x49')](_0x2f842d[_0xb111('0x3f')][_0xb111('0x49')]);_0x2d1fc4[_0xb111('0x4a')]=qs[_0xb111('0x41')](_['pick'](_0x2f842d[_0xb111('0x3f')],_0x1a4ebd['filters']));if(_0x2f842d[_0xb111('0x3f')][_0xb111('0x4e')]){_0x2d1fc4['where']=_[_0xb111('0x4c')](_0x2d1fc4[_0xb111('0x4a')],{'$or':_[_0xb111('0x38')](_0x2d1fc4['attributes'],function(_0x147be6){var _0x1c6429={};_0x1c6429[_0x147be6]={'$like':'%'+_0x2f842d[_0xb111('0x3f')][_0xb111('0x4e')]+'%'};return _0x1c6429;})});}_0x2d1fc4=_[_0xb111('0x4c')]({},_0x2d1fc4,_0x2f842d[_0xb111('0x53')]);return _0x26a3cf[_0xb111('0x5a')](_0x2d1fc4);}})[_0xb111('0x1e')](function(_0x233e19){if(_0x233e19){_0x2e4c5b=_0x233e19[_0xb111('0x45')];if(!_0x2f842d[_0xb111('0x3f')]['hasOwnProperty'](_0xb111('0x47'))){_0x2d1fc4[_0xb111('0x2a')]=qs['limit'](_0x2f842d[_0xb111('0x3f')][_0xb111('0x2a')]);_0x2d1fc4['offset']=qs[_0xb111('0x2c')](_0x2f842d['query'][_0xb111('0x2c')]);}return _0x26a3cf[_0xb111('0x5a')](_0x2d1fc4);}})[_0xb111('0x1e')](function(_0x1b783a){if(_0x1b783a){return _0x1b783a?{'count':_0x2e4c5b,'rows':_0x1b783a}:null;}})[_0xb111('0x1e')](respondWithResult(_0x451f37,null))[_0xb111('0x26')](handleError(_0x451f37,null));};exports[_0xb111('0x5b')]=function(_0x212a9f,_0x29bfca,_0x5c5db8){var _0x57830e={};var _0x5d5472={};var _0xb675fc;var _0x518549;return db['ZendeskConfiguration'][_0xb111('0x58')]({'where':{'id':_0x212a9f[_0xb111('0x56')]['id']}})[_0xb111('0x1e')](handleEntityNotFound(_0x29bfca,null))[_0xb111('0x1e')](function(_0x5de076){if(_0x5de076){_0xb675fc=_0x5de076;_0x5d5472[_0xb111('0x3e')]=_[_0xb111('0x40')](db[_0xb111('0x59')][_0xb111('0x3a')]);_0x5d5472[_0xb111('0x3f')]=_[_0xb111('0x40')](_0x212a9f[_0xb111('0x3f')]);_0x5d5472['filters']=_[_0xb111('0x42')](_0x5d5472['model'],_0x5d5472[_0xb111('0x3f')]);_0x57830e['attributes']=_[_0xb111('0x42')](_0x5d5472[_0xb111('0x3e')],qs['fields'](_0x212a9f[_0xb111('0x3f')][_0xb111('0x44')]));_0x57830e[_0xb111('0x43')]=_0x57830e[_0xb111('0x43')][_0xb111('0x45')]?_0x57830e[_0xb111('0x43')]:_0x5d5472['model'];_0x57830e[_0xb111('0x48')]=qs['sort'](_0x212a9f['query']['sort']);_0x57830e[_0xb111('0x4a')]=qs[_0xb111('0x41')](_['pick'](_0x212a9f[_0xb111('0x3f')],_0x5d5472[_0xb111('0x41')]));if(_0x212a9f['query'][_0xb111('0x4e')]){_0x57830e[_0xb111('0x4a')]=_[_0xb111('0x4c')](_0x57830e[_0xb111('0x4a')],{'$or':_[_0xb111('0x38')](_0x57830e[_0xb111('0x43')],function(_0x687afb){var _0x23cee0={};_0x23cee0[_0x687afb]={'$like':'%'+_0x212a9f[_0xb111('0x3f')][_0xb111('0x4e')]+'%'};return _0x23cee0;})});}_0x57830e=_[_0xb111('0x4c')]({},_0x57830e,_0x212a9f[_0xb111('0x53')]);return _0xb675fc[_0xb111('0x5b')](_0x57830e);}})[_0xb111('0x1e')](function(_0x2dc134){if(_0x2dc134){_0x518549=_0x2dc134[_0xb111('0x45')];if(!_0x212a9f[_0xb111('0x3f')]['hasOwnProperty']('nolimit')){_0x57830e['limit']=qs[_0xb111('0x2a')](_0x212a9f[_0xb111('0x3f')][_0xb111('0x2a')]);_0x57830e[_0xb111('0x2c')]=qs[_0xb111('0x2c')](_0x212a9f['query'][_0xb111('0x2c')]);}return _0xb675fc[_0xb111('0x5b')](_0x57830e);}})[_0xb111('0x1e')](function(_0x4d3339){if(_0x4d3339){return _0x4d3339?{'count':_0x518549,'rows':_0x4d3339}:null;}})[_0xb111('0x1e')](respondWithResult(_0x29bfca,null))[_0xb111('0x26')](handleError(_0x29bfca,null));};exports[_0xb111('0x5c')]=function(_0x268a15,_0x4747c3,_0x3b4c76){var _0x227c36={};var _0xc6d22b={};var _0x369f62;var _0x15de6d;return db[_0xb111('0x39')][_0xb111('0x58')]({'where':{'id':_0x268a15['params']['id']}})[_0xb111('0x1e')](handleEntityNotFound(_0x4747c3,null))[_0xb111('0x1e')](function(_0x58748d){if(_0x58748d){_0x369f62=_0x58748d;_0xc6d22b[_0xb111('0x3e')]=_[_0xb111('0x40')](db['Tag']['rawAttributes']);_0xc6d22b[_0xb111('0x3f')]=_['keys'](_0x268a15[_0xb111('0x3f')]);_0xc6d22b['filters']=_[_0xb111('0x42')](_0xc6d22b['model'],_0xc6d22b[_0xb111('0x3f')]);_0x227c36[_0xb111('0x43')]=_[_0xb111('0x42')](_0xc6d22b[_0xb111('0x3e')],qs['fields'](_0x268a15[_0xb111('0x3f')][_0xb111('0x44')]));_0x227c36[_0xb111('0x43')]=_0x227c36[_0xb111('0x43')]['length']?_0x227c36[_0xb111('0x43')]:_0xc6d22b[_0xb111('0x3e')];_0x227c36[_0xb111('0x48')]=qs['sort'](_0x268a15['query'][_0xb111('0x49')]);_0x227c36['where']=qs[_0xb111('0x41')](_[_0xb111('0x4b')](_0x268a15[_0xb111('0x3f')],_0xc6d22b[_0xb111('0x41')]));if(_0x268a15['query'][_0xb111('0x4e')]){_0x227c36[_0xb111('0x4a')]=_[_0xb111('0x4c')](_0x227c36['where'],{'$or':_[_0xb111('0x38')](_0x227c36[_0xb111('0x43')],function(_0x5301db){var _0x412932={};_0x412932[_0x5301db]={'$like':'%'+_0x268a15[_0xb111('0x3f')]['filter']+'%'};return _0x412932;})});}_0x227c36=_[_0xb111('0x4c')]({},_0x227c36,_0x268a15[_0xb111('0x53')]);return _0x369f62[_0xb111('0x5c')](_0x227c36);}})['then'](function(_0x3c67bb){if(_0x3c67bb){_0x15de6d=_0x3c67bb['length'];if(!_0x268a15[_0xb111('0x3f')][_0xb111('0x46')](_0xb111('0x47'))){_0x227c36['limit']=qs[_0xb111('0x2a')](_0x268a15['query'][_0xb111('0x2a')]);_0x227c36[_0xb111('0x2c')]=qs[_0xb111('0x2c')](_0x268a15[_0xb111('0x3f')][_0xb111('0x2c')]);}return _0x369f62[_0xb111('0x5c')](_0x227c36);}})[_0xb111('0x1e')](function(_0x538efe){if(_0x538efe){return _0x538efe?{'count':_0x15de6d,'rows':_0x538efe}:null;}})['then'](respondWithResult(_0x4747c3,null))[_0xb111('0x26')](handleError(_0x4747c3,null));};exports[_0xb111('0x5d')]=function(_0x229131,_0x22b069,_0xb04a54){if(_0x229131['body']['id']){delete _0x229131[_0xb111('0x55')]['id'];}return db['ZendeskConfiguration'][_0xb111('0x58')]({'where':{'id':_0x229131[_0xb111('0x56')]['id']}})['then'](handleEntityNotFound(_0x22b069,null))[_0xb111('0x1e')](function(_0x56880a){if(_0x56880a){return _0x56880a[_0xb111('0x5d')](_0x229131[_0xb111('0x55')][_0xb111('0x5e')]||[]);}return null;})[_0xb111('0x1e')](respondWithResult(_0x22b069,null))['catch'](handleError(_0x22b069,null));};
\ No newline at end of file
+var _0x44f5=['mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','end','stack','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','show','includeAll','include','create','body','update','find','params','getFields','findOne','ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x1f610a,_0x3f0858){var _0x47dd00=function(_0x184b4c){while(--_0x184b4c){_0x1f610a['push'](_0x1f610a['shift']());}};_0x47dd00(++_0x3f0858);}(_0x44f5,0x173));var _0x544f=function(_0x563fc0,_0x1ae0b0){_0x563fc0=_0x563fc0-0x0;var _0x11dfce=_0x44f5[_0x563fc0];return _0x11dfce;};'use strict';var emlformat=require(_0x544f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x544f('0x1'));var jsonpatch=require(_0x544f('0x2'));var rp=require('request-promise');var moment=require(_0x544f('0x3'));var BPromise=require(_0x544f('0x4'));var Mustache=require(_0x544f('0x5'));var util=require(_0x544f('0x6'));var path=require(_0x544f('0x7'));var sox=require(_0x544f('0x8'));var csv=require(_0x544f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x544f('0xa'));var squel=require(_0x544f('0xb'));var crypto=require(_0x544f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x544f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x544f('0xe'));var Papa=require('papaparse');var Redis=require(_0x544f('0xf'));var authService=require(_0x544f('0x10'));var qs=require(_0x544f('0x11'));var as=require(_0x544f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x544f('0x13'))('api');var utils=require(_0x544f('0x14'));var config=require(_0x544f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x544f('0x16'))['db'];var jayson=require(_0x544f('0x17'));var client=jayson[_0x544f('0x18')][_0x544f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2f03ae,_0x59f0fa,_0x5eb513,_0x5b0e88){return new BPromise(function(_0x5608c0,_0x57fe5f){var _0x1f980c=_0x5b0e88||client;return _0x1f980c[_0x544f('0x1a')](_0x2f03ae,_0x5eb513)['then'](function(_0x1ee079){logger[_0x544f('0x1b')](_0x544f('0x1c'),_0x59f0fa,_0x544f('0x1d'));logger[_0x544f('0x1e')](_0x544f('0x1f'),_0x59f0fa,_0x544f('0x1d'),JSON['stringify'](_0x1ee079));if(_0x1ee079[_0x544f('0x20')]){if(_0x1ee079[_0x544f('0x20')][_0x544f('0x21')]===0x1f4){logger[_0x544f('0x20')](_0x544f('0x1c'),_0x59f0fa,_0x1ee079['error'][_0x544f('0x22')]);return _0x57fe5f(_0x1ee079[_0x544f('0x20')][_0x544f('0x22')]);}logger[_0x544f('0x20')](_0x544f('0x1c'),_0x59f0fa,_0x1ee079[_0x544f('0x20')]['message']);return _0x5608c0(_0x1ee079[_0x544f('0x20')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x59f0fa,_0x544f('0x1d'));_0x5608c0(_0x1ee079[_0x544f('0x23')][_0x544f('0x22')]);}})[_0x544f('0x24')](function(_0x7b828b){logger[_0x544f('0x20')](_0x544f('0x1c'),_0x59f0fa,_0x7b828b);_0x57fe5f(_0x7b828b);});});}function respondWithStatusCode(_0x2e4ad8,_0x78af30){_0x78af30=_0x78af30||0xcc;return function(_0x39baf9){if(_0x39baf9){return _0x2e4ad8[_0x544f('0x25')](_0x78af30);}return _0x2e4ad8[_0x544f('0x26')](_0x78af30)['end']();};}function respondWithResult(_0x15346b,_0x23f848){_0x23f848=_0x23f848||0xc8;return function(_0x5d8c55){if(_0x5d8c55){return _0x15346b['status'](_0x23f848)[_0x544f('0x27')](_0x5d8c55);}};}function respondWithFilteredResult(_0x236a7d,_0x3007a6){return function(_0x4c42f2){if(_0x4c42f2){var _0x1c1896=typeof _0x3007a6[_0x544f('0x28')]===_0x544f('0x29')&&typeof _0x3007a6[_0x544f('0x2a')]===_0x544f('0x29');var _0x8949ea=_0x4c42f2[_0x544f('0x2b')];var _0x379fef=_0x1c1896?0x0:_0x3007a6['offset'];var _0x25b14b=_0x1c1896?_0x4c42f2['count']:_0x3007a6[_0x544f('0x28')]+_0x3007a6[_0x544f('0x2a')];var _0x1c9f15;if(_0x25b14b>=_0x8949ea){_0x25b14b=_0x8949ea;_0x1c9f15=0xc8;}else{_0x1c9f15=0xce;}_0x236a7d[_0x544f('0x26')](_0x1c9f15);return _0x236a7d[_0x544f('0x2c')]('Content-Range',_0x379fef+'-'+_0x25b14b+'/'+_0x8949ea)[_0x544f('0x27')](_0x4c42f2);}return null;};}function patchUpdates(_0x32cff6){return function(_0x312e25){try{jsonpatch[_0x544f('0x2d')](_0x312e25,_0x32cff6,!![]);}catch(_0x34e7e5){return BPromise[_0x544f('0x2e')](_0x34e7e5);}return _0x312e25['save']();};}function saveUpdates(_0x339caf,_0x3ca429){return function(_0x44e47e){if(_0x44e47e){return _0x44e47e['update'](_0x339caf)[_0x544f('0x2f')](function(_0x395fce){return _0x395fce;});}return null;};}function removeEntity(_0x48e1ee,_0x4dd011){return function(_0x4dc272){if(_0x4dc272){return _0x4dc272[_0x544f('0x30')]()['then'](function(){_0x48e1ee[_0x544f('0x26')](0xcc)[_0x544f('0x31')]();});}};}function handleEntityNotFound(_0x3e4aec,_0x21ca76){return function(_0x1e7f27){if(!_0x1e7f27){_0x3e4aec[_0x544f('0x25')](0x194);}return _0x1e7f27;};}function handleError(_0x5d6ee6,_0x4e7b1e){_0x4e7b1e=_0x4e7b1e||0x1f4;return function(_0x3bdda6){logger[_0x544f('0x20')](_0x3bdda6[_0x544f('0x32')]);if(_0x3bdda6['name']){delete _0x3bdda6['name'];}_0x5d6ee6[_0x544f('0x26')](_0x4e7b1e)['send'](_0x3bdda6);};}exports['index']=function(_0x4524db,_0x591e18){var _0x238b93={},_0x7ed48b={},_0x42ba69={'count':0x0,'rows':[]};var _0x4af17d=_[_0x544f('0x33')](db[_0x544f('0x34')][_0x544f('0x35')],function(_0x558bdd){return{'name':_0x558bdd[_0x544f('0x36')],'type':_0x558bdd[_0x544f('0x37')][_0x544f('0x38')]};});_0x7ed48b[_0x544f('0x39')]=_['map'](_0x4af17d,_0x544f('0x3a'));_0x7ed48b[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x4524db[_0x544f('0x3b')]);_0x7ed48b[_0x544f('0x3d')]=_['intersection'](_0x7ed48b[_0x544f('0x39')],_0x7ed48b[_0x544f('0x3b')]);_0x238b93['attributes']=_[_0x544f('0x3e')](_0x7ed48b[_0x544f('0x39')],qs[_0x544f('0x3f')](_0x4524db[_0x544f('0x3b')][_0x544f('0x3f')]));_0x238b93[_0x544f('0x40')]=_0x238b93['attributes'][_0x544f('0x41')]?_0x238b93[_0x544f('0x40')]:_0x7ed48b[_0x544f('0x39')];if(!_0x4524db[_0x544f('0x3b')]['hasOwnProperty'](_0x544f('0x42'))){_0x238b93[_0x544f('0x2a')]=qs['limit'](_0x4524db[_0x544f('0x3b')][_0x544f('0x2a')]);_0x238b93[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x4524db[_0x544f('0x3b')][_0x544f('0x28')]);}_0x238b93[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x4524db[_0x544f('0x3b')]['sort']);_0x238b93[_0x544f('0x45')]=qs[_0x544f('0x3d')](_[_0x544f('0x46')](_0x4524db[_0x544f('0x3b')],_0x7ed48b['filters']),_0x4af17d);if(_0x4524db[_0x544f('0x3b')][_0x544f('0x47')]){_0x238b93[_0x544f('0x45')]=_[_0x544f('0x48')](_0x238b93[_0x544f('0x45')],{'$or':_['map'](_0x4af17d,function(_0x3b4d32){if(_0x3b4d32[_0x544f('0x37')]!==_0x544f('0x49')){var _0x4fafbb={};_0x4fafbb[_0x3b4d32[_0x544f('0x3a')]]={'$like':'%'+_0x4524db['query'][_0x544f('0x47')]+'%'};return _0x4fafbb;}})});}_0x238b93=_[_0x544f('0x48')]({},_0x238b93,_0x4524db[_0x544f('0x4a')]);var _0xf0c6c9={'where':_0x238b93[_0x544f('0x45')]};return db['ZendeskConfiguration'][_0x544f('0x2b')](_0xf0c6c9)[_0x544f('0x2f')](function(_0x59c504){_0x42ba69[_0x544f('0x2b')]=_0x59c504;if(_0x4524db[_0x544f('0x3b')]['includeAll']){_0x238b93['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x238b93);})['then'](function(_0x44c90e){_0x42ba69[_0x544f('0x4b')]=_0x44c90e;return _0x42ba69;})[_0x544f('0x2f')](respondWithFilteredResult(_0x591e18,_0x238b93))[_0x544f('0x24')](handleError(_0x591e18,null));};exports[_0x544f('0x4c')]=function(_0x4c2604,_0x2bfdeb){var _0x28580c={'raw':![],'where':{'id':_0x4c2604['params']['id']}},_0x364e23={};_0x364e23[_0x544f('0x39')]=_['keys'](db[_0x544f('0x34')][_0x544f('0x35')]);_0x364e23[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x4c2604['query']);_0x364e23[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x364e23[_0x544f('0x39')],_0x364e23[_0x544f('0x3b')]);_0x28580c[_0x544f('0x40')]=_['intersection'](_0x364e23[_0x544f('0x39')],qs[_0x544f('0x3f')](_0x4c2604[_0x544f('0x3b')][_0x544f('0x3f')]));_0x28580c['attributes']=_0x28580c[_0x544f('0x40')][_0x544f('0x41')]?_0x28580c['attributes']:_0x364e23['model'];if(_0x4c2604[_0x544f('0x3b')][_0x544f('0x4d')]){_0x28580c[_0x544f('0x4e')]=[{'all':!![]}];}_0x28580c=_['merge']({},_0x28580c,_0x4c2604[_0x544f('0x4a')]);return db[_0x544f('0x34')]['find'](_0x28580c)[_0x544f('0x2f')](handleEntityNotFound(_0x2bfdeb,null))[_0x544f('0x2f')](respondWithResult(_0x2bfdeb,null))['catch'](handleError(_0x2bfdeb,null));};exports[_0x544f('0x4f')]=function(_0x5e448e,_0x5be276){return db[_0x544f('0x34')][_0x544f('0x4f')](_0x5e448e[_0x544f('0x50')],{})['then'](respondWithResult(_0x5be276,0xc9))[_0x544f('0x24')](handleError(_0x5be276,null));};exports[_0x544f('0x51')]=function(_0x32c1fe,_0x223340){if(_0x32c1fe[_0x544f('0x50')]['id']){delete _0x32c1fe[_0x544f('0x50')]['id'];}return db[_0x544f('0x34')][_0x544f('0x52')]({'where':{'id':_0x32c1fe['params']['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x223340,null))[_0x544f('0x2f')](saveUpdates(_0x32c1fe[_0x544f('0x50')],null))[_0x544f('0x2f')](respondWithResult(_0x223340,null))[_0x544f('0x24')](handleError(_0x223340,null));};exports['destroy']=function(_0x1ac523,_0x5c1433){return db['ZendeskConfiguration'][_0x544f('0x52')]({'where':{'id':_0x1ac523[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x5c1433,null))['then'](removeEntity(_0x5c1433,null))['catch'](handleError(_0x5c1433,null));};exports[_0x544f('0x54')]=function(_0x81c225,_0x3b5db1,_0xa92eaa){var _0x2f627a={};var _0x581e9d={};var _0x351e55;var _0x314ba4;return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x81c225[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x3b5db1,null))[_0x544f('0x2f')](function(_0x1fcd82){if(_0x1fcd82){_0x351e55=_0x1fcd82;_0x581e9d[_0x544f('0x39')]=_['keys'](db[_0x544f('0x56')][_0x544f('0x35')]);_0x581e9d[_0x544f('0x3b')]=_['keys'](_0x81c225[_0x544f('0x3b')]);_0x581e9d['filters']=_['intersection'](_0x581e9d[_0x544f('0x39')],_0x581e9d['query']);_0x2f627a[_0x544f('0x40')]=_[_0x544f('0x3e')](_0x581e9d['model'],qs[_0x544f('0x3f')](_0x81c225[_0x544f('0x3b')]['fields']));_0x2f627a[_0x544f('0x40')]=_0x2f627a[_0x544f('0x40')][_0x544f('0x41')]?_0x2f627a['attributes']:_0x581e9d['model'];_0x2f627a[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x81c225['query'][_0x544f('0x44')]);_0x2f627a[_0x544f('0x45')]=qs[_0x544f('0x3d')](_['pick'](_0x81c225[_0x544f('0x3b')],_0x581e9d[_0x544f('0x3d')]));if(_0x81c225[_0x544f('0x3b')][_0x544f('0x47')]){_0x2f627a['where']=_[_0x544f('0x48')](_0x2f627a[_0x544f('0x45')],{'$or':_[_0x544f('0x33')](_0x2f627a[_0x544f('0x40')],function(_0x16247e){var _0x186c02={};_0x186c02[_0x16247e]={'$like':'%'+_0x81c225[_0x544f('0x3b')]['filter']+'%'};return _0x186c02;})});}_0x2f627a=_[_0x544f('0x48')]({},_0x2f627a,_0x81c225[_0x544f('0x4a')]);return _0x351e55[_0x544f('0x54')](_0x2f627a);}})[_0x544f('0x2f')](function(_0x4b7a1e){if(_0x4b7a1e){_0x314ba4=_0x4b7a1e[_0x544f('0x41')];if(!_0x81c225[_0x544f('0x3b')][_0x544f('0x57')](_0x544f('0x42'))){_0x2f627a[_0x544f('0x2a')]=qs[_0x544f('0x2a')](_0x81c225[_0x544f('0x3b')]['limit']);_0x2f627a[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x81c225['query']['offset']);}return _0x351e55['getFields'](_0x2f627a);}})[_0x544f('0x2f')](function(_0x17d291){if(_0x17d291){return _0x17d291?{'count':_0x314ba4,'rows':_0x17d291}:null;}})[_0x544f('0x2f')](respondWithResult(_0x3b5db1,null))[_0x544f('0x24')](handleError(_0x3b5db1,null));};exports[_0x544f('0x58')]=function(_0x3b35e0,_0xff3e2a,_0xb5a9d0){var _0x2facdc={};var _0x2e1c83={};var _0x42f7d2;var _0x59e97a;return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x3b35e0[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0xff3e2a,null))['then'](function(_0x3e5f12){if(_0x3e5f12){_0x42f7d2=_0x3e5f12;_0x2e1c83[_0x544f('0x39')]=_['keys'](db[_0x544f('0x56')][_0x544f('0x35')]);_0x2e1c83[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x3b35e0[_0x544f('0x3b')]);_0x2e1c83[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x2e1c83['model'],_0x2e1c83[_0x544f('0x3b')]);_0x2facdc[_0x544f('0x40')]=_[_0x544f('0x3e')](_0x2e1c83[_0x544f('0x39')],qs[_0x544f('0x3f')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x3f')]));_0x2facdc[_0x544f('0x40')]=_0x2facdc[_0x544f('0x40')]['length']?_0x2facdc[_0x544f('0x40')]:_0x2e1c83[_0x544f('0x39')];_0x2facdc[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x44')]);_0x2facdc[_0x544f('0x45')]=qs[_0x544f('0x3d')](_[_0x544f('0x46')](_0x3b35e0[_0x544f('0x3b')],_0x2e1c83[_0x544f('0x3d')]));if(_0x3b35e0[_0x544f('0x3b')]['filter']){_0x2facdc['where']=_['merge'](_0x2facdc[_0x544f('0x45')],{'$or':_[_0x544f('0x33')](_0x2facdc[_0x544f('0x40')],function(_0x4699d3){var _0x252dc7={};_0x252dc7[_0x4699d3]={'$like':'%'+_0x3b35e0[_0x544f('0x3b')][_0x544f('0x47')]+'%'};return _0x252dc7;})});}_0x2facdc=_['merge']({},_0x2facdc,_0x3b35e0[_0x544f('0x4a')]);return _0x42f7d2[_0x544f('0x58')](_0x2facdc);}})[_0x544f('0x2f')](function(_0xc699ed){if(_0xc699ed){_0x59e97a=_0xc699ed[_0x544f('0x41')];if(!_0x3b35e0[_0x544f('0x3b')][_0x544f('0x57')](_0x544f('0x42'))){_0x2facdc[_0x544f('0x2a')]=qs[_0x544f('0x2a')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x2a')]);_0x2facdc[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x3b35e0[_0x544f('0x3b')][_0x544f('0x28')]);}return _0x42f7d2[_0x544f('0x58')](_0x2facdc);}})['then'](function(_0x491814){if(_0x491814){return _0x491814?{'count':_0x59e97a,'rows':_0x491814}:null;}})[_0x544f('0x2f')](respondWithResult(_0xff3e2a,null))[_0x544f('0x24')](handleError(_0xff3e2a,null));};exports[_0x544f('0x59')]=function(_0x39fac7,_0x2fa94a,_0x43a522){var _0x432e32={};var _0x4692ee={};var _0x572e7c;var _0x2a46ca;return db[_0x544f('0x34')]['findOne']({'where':{'id':_0x39fac7[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x2fa94a,null))[_0x544f('0x2f')](function(_0x16b303){if(_0x16b303){_0x572e7c=_0x16b303;_0x4692ee[_0x544f('0x39')]=_[_0x544f('0x3c')](db['ZendeskField'][_0x544f('0x35')]);_0x4692ee[_0x544f('0x3b')]=_[_0x544f('0x3c')](_0x39fac7[_0x544f('0x3b')]);_0x4692ee[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x4692ee['model'],_0x4692ee['query']);_0x432e32[_0x544f('0x40')]=_['intersection'](_0x4692ee['model'],qs[_0x544f('0x3f')](_0x39fac7['query'][_0x544f('0x3f')]));_0x432e32[_0x544f('0x40')]=_0x432e32[_0x544f('0x40')][_0x544f('0x41')]?_0x432e32['attributes']:_0x4692ee[_0x544f('0x39')];_0x432e32['order']=qs[_0x544f('0x44')](_0x39fac7[_0x544f('0x3b')][_0x544f('0x44')]);_0x432e32['where']=qs['filters'](_[_0x544f('0x46')](_0x39fac7[_0x544f('0x3b')],_0x4692ee[_0x544f('0x3d')]));if(_0x39fac7[_0x544f('0x3b')][_0x544f('0x47')]){_0x432e32[_0x544f('0x45')]=_[_0x544f('0x48')](_0x432e32[_0x544f('0x45')],{'$or':_['map'](_0x432e32[_0x544f('0x40')],function(_0x5474c0){var _0x2260f0={};_0x2260f0[_0x5474c0]={'$like':'%'+_0x39fac7['query'][_0x544f('0x47')]+'%'};return _0x2260f0;})});}_0x432e32=_[_0x544f('0x48')]({},_0x432e32,_0x39fac7['options']);return _0x572e7c[_0x544f('0x59')](_0x432e32);}})['then'](function(_0x28f16a){if(_0x28f16a){_0x2a46ca=_0x28f16a[_0x544f('0x41')];if(!_0x39fac7['query']['hasOwnProperty'](_0x544f('0x42'))){_0x432e32['limit']=qs[_0x544f('0x2a')](_0x39fac7['query'][_0x544f('0x2a')]);_0x432e32[_0x544f('0x28')]=qs[_0x544f('0x28')](_0x39fac7[_0x544f('0x3b')]['offset']);}return _0x572e7c[_0x544f('0x59')](_0x432e32);}})[_0x544f('0x2f')](function(_0x301385){if(_0x301385){return _0x301385?{'count':_0x2a46ca,'rows':_0x301385}:null;}})['then'](respondWithResult(_0x2fa94a,null))[_0x544f('0x24')](handleError(_0x2fa94a,null));};exports[_0x544f('0x5a')]=function(_0x454669,_0x4437c1,_0x59ccd9){var _0x4524e1={};var _0x4b3d2f={};var _0x2174e3;var _0x2df89e;return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x454669['params']['id']}})['then'](handleEntityNotFound(_0x4437c1,null))[_0x544f('0x2f')](function(_0x42ccd0){if(_0x42ccd0){_0x2174e3=_0x42ccd0;_0x4b3d2f[_0x544f('0x39')]=_[_0x544f('0x3c')](db[_0x544f('0x5b')][_0x544f('0x35')]);_0x4b3d2f['query']=_[_0x544f('0x3c')](_0x454669[_0x544f('0x3b')]);_0x4b3d2f[_0x544f('0x3d')]=_[_0x544f('0x3e')](_0x4b3d2f[_0x544f('0x39')],_0x4b3d2f[_0x544f('0x3b')]);_0x4524e1[_0x544f('0x40')]=_[_0x544f('0x3e')](_0x4b3d2f[_0x544f('0x39')],qs['fields'](_0x454669[_0x544f('0x3b')][_0x544f('0x3f')]));_0x4524e1[_0x544f('0x40')]=_0x4524e1[_0x544f('0x40')]['length']?_0x4524e1[_0x544f('0x40')]:_0x4b3d2f[_0x544f('0x39')];_0x4524e1[_0x544f('0x43')]=qs[_0x544f('0x44')](_0x454669[_0x544f('0x3b')][_0x544f('0x44')]);_0x4524e1[_0x544f('0x45')]=qs[_0x544f('0x3d')](_[_0x544f('0x46')](_0x454669['query'],_0x4b3d2f[_0x544f('0x3d')]));if(_0x454669[_0x544f('0x3b')]['filter']){_0x4524e1['where']=_[_0x544f('0x48')](_0x4524e1[_0x544f('0x45')],{'$or':_[_0x544f('0x33')](_0x4524e1[_0x544f('0x40')],function(_0x98e4a0){var _0x5bb854={};_0x5bb854[_0x98e4a0]={'$like':'%'+_0x454669[_0x544f('0x3b')]['filter']+'%'};return _0x5bb854;})});}_0x4524e1=_[_0x544f('0x48')]({},_0x4524e1,_0x454669[_0x544f('0x4a')]);return _0x2174e3[_0x544f('0x5a')](_0x4524e1);}})[_0x544f('0x2f')](function(_0x28c65c){if(_0x28c65c){_0x2df89e=_0x28c65c[_0x544f('0x41')];if(!_0x454669[_0x544f('0x3b')][_0x544f('0x57')]('nolimit')){_0x4524e1[_0x544f('0x2a')]=qs[_0x544f('0x2a')](_0x454669[_0x544f('0x3b')][_0x544f('0x2a')]);_0x4524e1['offset']=qs[_0x544f('0x28')](_0x454669[_0x544f('0x3b')][_0x544f('0x28')]);}return _0x2174e3[_0x544f('0x5a')](_0x4524e1);}})[_0x544f('0x2f')](function(_0x1e7566){if(_0x1e7566){return _0x1e7566?{'count':_0x2df89e,'rows':_0x1e7566}:null;}})['then'](respondWithResult(_0x4437c1,null))['catch'](handleError(_0x4437c1,null));};exports['setTags']=function(_0x252b4c,_0x23a433,_0x44b3c0){if(_0x252b4c[_0x544f('0x50')]['id']){delete _0x252b4c[_0x544f('0x50')]['id'];}return db[_0x544f('0x34')][_0x544f('0x55')]({'where':{'id':_0x252b4c[_0x544f('0x53')]['id']}})[_0x544f('0x2f')](handleEntityNotFound(_0x23a433,null))[_0x544f('0x2f')](function(_0xc40e77){if(_0xc40e77){return _0xc40e77[_0x544f('0x5c')](_0x252b4c[_0x544f('0x50')][_0x544f('0x5d')]||[]);}return null;})[_0x544f('0x2f')](respondWithResult(_0x23a433,null))[_0x544f('0x24')](handleError(_0x23a433,null));};
\ No newline at end of file
index 07e4271..d9c27ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['util','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x0972,0x64));var _0x2097=function(_0x24f9e1,_0x472af2){_0x24f9e1=_0x24f9e1-0x0;var _0x1d1beb=_0x0972[_0x24f9e1];return _0x1d1beb;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd914=['util','api','moment','bluebird','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x4b4e70,_0x30d09b){var _0x7771a0=function(_0x2181b1){while(--_0x2181b1){_0x4b4e70['push'](_0x4b4e70['shift']());}};_0x7771a0(++_0x30d09b);}(_0xd914,0x17f));var _0x4d91=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0xd914[_0x4df85c];return _0x4e2a61;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var logger=require('../../config/logger')(_0x4d91('0x2'));var moment=require(_0x4d91('0x3'));var BPromise=require(_0x4d91('0x4'));var rp=require(_0x4d91('0x5'));var fs=require('fs');var path=require(_0x4d91('0x6'));var rimraf=require(_0x4d91('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d91('0x8'));module['exports']=function(_0x3ab6f8,_0x42d7ae){return _0x3ab6f8[_0x4d91('0x9')](_0x4d91('0xa'),attributes,{'tableName':_0x4d91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9abd566..fccedce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34db=['http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e92a7,_0x1b51cc){var _0x55d54b=function(_0x44e842){while(--_0x44e842){_0x5e92a7['push'](_0x5e92a7['shift']());}};_0x55d54b(++_0x1b51cc);}(_0x34db,0x171));var _0xb34d=function(_0xcd5bc7,_0x3d5f27){_0xcd5bc7=_0xcd5bc7-0x0;var _0x345ce6=_0x34db[_0xcd5bc7];return _0x345ce6;};'use strict';var _=require(_0xb34d('0x0'));var util=require(_0xb34d('0x1'));var moment=require(_0xb34d('0x2'));var BPromise=require(_0xb34d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb34d('0x4'));var db=require(_0xb34d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb34d('0x6'))(_0xb34d('0x7'));var config=require(_0xb34d('0x8'));var jayson=require(_0xb34d('0x9'));var client=jayson[_0xb34d('0xa')][_0xb34d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d4fb6,_0x4ceb3d,_0x163f17){return new BPromise(function(_0x1c867c,_0x23a95c){return client[_0xb34d('0xc')](_0x3d4fb6,_0x163f17)['then'](function(_0xe1bf68){logger[_0xb34d('0xd')](_0xb34d('0xe'),_0x4ceb3d,_0xb34d('0xf'));logger['debug'](_0xb34d('0x10'),_0x4ceb3d,_0xb34d('0xf'),JSON['stringify'](_0xe1bf68));if(_0xe1bf68[_0xb34d('0x11')]){if(_0xe1bf68[_0xb34d('0x11')]['code']===0x1f4){logger[_0xb34d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ceb3d,_0xe1bf68[_0xb34d('0x11')][_0xb34d('0x12')]);return _0x23a95c(_0xe1bf68[_0xb34d('0x11')]['message']);}logger[_0xb34d('0x11')](_0xb34d('0xe'),_0x4ceb3d,_0xe1bf68[_0xb34d('0x11')]['message']);return _0x1c867c(_0xe1bf68[_0xb34d('0x11')]['message']);}else{logger[_0xb34d('0xd')](_0xb34d('0xe'),_0x4ceb3d,_0xb34d('0xf'));_0x1c867c(_0xe1bf68['result'][_0xb34d('0x12')]);}})[_0xb34d('0x13')](function(_0x10100d){logger[_0xb34d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4ceb3d,_0x10100d);_0x23a95c(_0x10100d);});});}
\ No newline at end of file
+var _0xb842=['http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e2fa6,_0x51be36){var _0x33cad2=function(_0x237356){while(--_0x237356){_0x3e2fa6['push'](_0x3e2fa6['shift']());}};_0x33cad2(++_0x51be36);}(_0xb842,0xf4));var _0x2b84=function(_0x19e08e,_0x178f46){_0x19e08e=_0x19e08e-0x0;var _0x14c229=_0xb842[_0x19e08e];return _0x14c229;};'use strict';var _=require(_0x2b84('0x0'));var util=require(_0x2b84('0x1'));var moment=require('moment');var BPromise=require(_0x2b84('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b84('0x3'));var db=require(_0x2b84('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2b84('0x5'));var config=require(_0x2b84('0x6'));var jayson=require(_0x2b84('0x7'));var client=jayson[_0x2b84('0x8')][_0x2b84('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x401a8d,_0x20345a,_0x59737c){return new BPromise(function(_0x21a2d8,_0x2faac4){return client[_0x2b84('0xa')](_0x401a8d,_0x59737c)[_0x2b84('0xb')](function(_0x370582){logger[_0x2b84('0xc')](_0x2b84('0xd'),_0x20345a,'request\x20sent');logger[_0x2b84('0xe')](_0x2b84('0xf'),_0x20345a,_0x2b84('0x10'),JSON[_0x2b84('0x11')](_0x370582));if(_0x370582[_0x2b84('0x12')]){if(_0x370582['error'][_0x2b84('0x13')]===0x1f4){logger[_0x2b84('0x12')](_0x2b84('0xd'),_0x20345a,_0x370582[_0x2b84('0x12')][_0x2b84('0x14')]);return _0x2faac4(_0x370582[_0x2b84('0x12')][_0x2b84('0x14')]);}logger[_0x2b84('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x20345a,_0x370582[_0x2b84('0x12')]['message']);return _0x21a2d8(_0x370582[_0x2b84('0x12')][_0x2b84('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x20345a,_0x2b84('0x10'));_0x21a2d8(_0x370582[_0x2b84('0x15')][_0x2b84('0x14')]);}})[_0x2b84('0x16')](function(_0x7beb36){logger[_0x2b84('0x12')](_0x2b84('0xd'),_0x20345a,_0x7beb36);_0x2faac4(_0x7beb36);});});}
\ No newline at end of file
index 1c7d94e..5479ee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1563=['index','/:id','show','post','create','update','delete','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0xf21aa3,_0x5073ac){var _0xff9765=function(_0x752a5b){while(--_0x752a5b){_0xf21aa3['push'](_0xf21aa3['shift']());}};_0xff9765(++_0x5073ac);}(_0x1563,0x1e4));var _0x3156=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x1563[_0x3203a1];return _0x24215e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3156('0x0'));var express=require(_0x3156('0x1'));var router=express[_0x3156('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3156('0x3'));var interaction=require(_0x3156('0x4'));var config=require(_0x3156('0x5'));var controller=require(_0x3156('0x6'));router[_0x3156('0x7')]('/',auth[_0x3156('0x8')](),controller[_0x3156('0x9')]);router[_0x3156('0x7')](_0x3156('0xa'),auth['isAuthenticated'](),controller[_0x3156('0xb')]);router[_0x3156('0xc')]('/',auth[_0x3156('0x8')](),controller[_0x3156('0xd')]);router['put'](_0x3156('0xa'),auth[_0x3156('0x8')](),controller[_0x3156('0xe')]);router[_0x3156('0xf')](_0x3156('0xa'),auth[_0x3156('0x8')](),controller['destroy']);module[_0x3156('0x10')]=router;
\ No newline at end of file
+var _0xc561=['./intZendeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xc561,0x191));var _0x1c56=function(_0x53ea1c,_0x2d4c01){_0x53ea1c=_0x53ea1c-0x0;var _0x29dbb5=_0xc561[_0x53ea1c];return _0x29dbb5;};'use strict';var multer=require(_0x1c56('0x0'));var util=require(_0x1c56('0x1'));var path=require(_0x1c56('0x2'));var timeout=require(_0x1c56('0x3'));var express=require('express');var router=express[_0x1c56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1c56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1c56('0x6'));var controller=require(_0x1c56('0x7'));router[_0x1c56('0x8')]('/',auth[_0x1c56('0x9')](),controller[_0x1c56('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1c56('0xb')]);router[_0x1c56('0xc')]('/',auth[_0x1c56('0x9')](),controller[_0x1c56('0xd')]);router[_0x1c56('0xe')](_0x1c56('0xf'),auth[_0x1c56('0x9')](),controller['update']);router['delete'](_0x1c56('0xf'),auth[_0x1c56('0x9')](),controller[_0x1c56('0x10')]);module['exports']=router;
\ No newline at end of file
index 784fdfd..2d98b61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf419=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x312331,_0x1ef0d7){var _0x5e4ad1=function(_0x2c90f2){while(--_0x2c90f2){_0x312331['push'](_0x312331['shift']());}};_0x5e4ad1(++_0x1ef0d7);}(_0xf419,0x117));var _0x9f41=function(_0x422e83,_0xeec804){_0x422e83=_0x422e83-0x0;var _0x58bb59=_0xf419[_0x422e83];return _0x58bb59;};'use strict';var Sequelize=require(_0x9f41('0x0'));module[_0x9f41('0x1')]={'type':{'type':Sequelize[_0x9f41('0x2')](_0x9f41('0x3'),_0x9f41('0x4'),_0x9f41('0x5'),'keyValue','picklist'),'defaultValue':_0x9f41('0x3')},'content':{'type':Sequelize[_0x9f41('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9f41('0x2')](_0x9f41('0x3'),_0x9f41('0x4'),_0x9f41('0x5'))},'keyContent':{'type':Sequelize[_0x9f41('0x6')]},'idField':{'type':Sequelize[_0x9f41('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9f41('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f41('0x6')]}};
\ No newline at end of file
+var _0x3585=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING','customVariable'];(function(_0x3a517b,_0x3bda2c){var _0x18c595=function(_0x3a8185){while(--_0x3a8185){_0x3a517b['push'](_0x3a517b['shift']());}};_0x18c595(++_0x3bda2c);}(_0x3585,0x83));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5358('0x0'));module[_0x5358('0x1')]={'type':{'type':Sequelize[_0x5358('0x2')]('string',_0x5358('0x3'),'customVariable',_0x5358('0x4'),_0x5358('0x5')),'defaultValue':_0x5358('0x6')},'content':{'type':Sequelize[_0x5358('0x7')]},'key':{'type':Sequelize[_0x5358('0x7')]},'keyType':{'type':Sequelize[_0x5358('0x2')](_0x5358('0x6'),_0x5358('0x3'),_0x5358('0x8'))},'keyContent':{'type':Sequelize[_0x5358('0x7')]},'idField':{'type':Sequelize[_0x5358('0x7')]},'nameField':{'type':Sequelize[_0x5358('0x7')]},'customField':{'type':Sequelize[_0x5358('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2cab08e..cdce3c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97a9=['then','destroy','error','stack','name','index','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','save','update'];(function(_0x45778a,_0x2c635e){var _0x595025=function(_0x511541){while(--_0x511541){_0x45778a['push'](_0x45778a['shift']());}};_0x595025(++_0x2c635e);}(_0x97a9,0x157));var _0x997a=function(_0x4fa079,_0x36bce8){_0x4fa079=_0x4fa079-0x0;var _0x2694d8=_0x97a9[_0x4fa079];return _0x2694d8;};'use strict';var emlformat=require(_0x997a('0x0'));var rimraf=require(_0x997a('0x1'));var zipdir=require(_0x997a('0x2'));var jsonpatch=require(_0x997a('0x3'));var rp=require('request-promise');var moment=require(_0x997a('0x4'));var BPromise=require(_0x997a('0x5'));var Mustache=require(_0x997a('0x6'));var util=require(_0x997a('0x7'));var path=require(_0x997a('0x8'));var sox=require(_0x997a('0x9'));var csv=require(_0x997a('0xa'));var ejs=require(_0x997a('0xb'));var fs=require('fs');var fs_extra=require(_0x997a('0xc'));var _=require(_0x997a('0xd'));var squel=require(_0x997a('0xe'));var crypto=require('crypto');var jsforce=require(_0x997a('0xf'));var deskjs=require(_0x997a('0x10'));var toCsv=require(_0x997a('0xa'));var querystring=require(_0x997a('0x11'));var Papa=require(_0x997a('0x12'));var Redis=require(_0x997a('0x13'));var authService=require(_0x997a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x997a('0x15'));var hardwareService=require(_0x997a('0x16'));var logger=require('../../config/logger')(_0x997a('0x17'));var utils=require('../../config/utils');var config=require(_0x997a('0x18'));var licenseUtil=require(_0x997a('0x19'));var db=require(_0x997a('0x1a'))['db'];function respondWithStatusCode(_0x4c262e,_0x40e910){_0x40e910=_0x40e910||0xcc;return function(_0x4bc69c){if(_0x4bc69c){return _0x4c262e[_0x997a('0x1b')](_0x40e910);}return _0x4c262e['status'](_0x40e910)[_0x997a('0x1c')]();};}function respondWithResult(_0x4277fa,_0x2341d2){_0x2341d2=_0x2341d2||0xc8;return function(_0x9eaada){if(_0x9eaada){return _0x4277fa[_0x997a('0x1d')](_0x2341d2)['json'](_0x9eaada);}};}function respondWithFilteredResult(_0x52487d,_0x1a77ca){return function(_0x1f99b0){if(_0x1f99b0){var _0x9a3a30=typeof _0x1a77ca[_0x997a('0x1e')]==='undefined'&&typeof _0x1a77ca['limit']===_0x997a('0x1f');var _0x1cae72=_0x1f99b0[_0x997a('0x20')];var _0x45151f=_0x9a3a30?0x0:_0x1a77ca[_0x997a('0x1e')];var _0x2fb0d4=_0x9a3a30?_0x1f99b0[_0x997a('0x20')]:_0x1a77ca[_0x997a('0x1e')]+_0x1a77ca['limit'];var _0x144b99;if(_0x2fb0d4>=_0x1cae72){_0x2fb0d4=_0x1cae72;_0x144b99=0xc8;}else{_0x144b99=0xce;}_0x52487d[_0x997a('0x1d')](_0x144b99);return _0x52487d[_0x997a('0x21')]('Content-Range',_0x45151f+'-'+_0x2fb0d4+'/'+_0x1cae72)[_0x997a('0x22')](_0x1f99b0);}return null;};}function patchUpdates(_0x2c7631){return function(_0x348192){try{jsonpatch['apply'](_0x348192,_0x2c7631,!![]);}catch(_0xf70909){return BPromise['reject'](_0xf70909);}return _0x348192[_0x997a('0x23')]();};}function saveUpdates(_0x34557,_0x4890f3){return function(_0x58fe57){if(_0x58fe57){return _0x58fe57[_0x997a('0x24')](_0x34557)[_0x997a('0x25')](function(_0x58ac64){return _0x58ac64;});}return null;};}function removeEntity(_0xccf9fa,_0x20a3ad){return function(_0x424f6b){if(_0x424f6b){return _0x424f6b[_0x997a('0x26')]()[_0x997a('0x25')](function(){_0xccf9fa[_0x997a('0x1d')](0xcc)[_0x997a('0x1c')]();});}};}function handleEntityNotFound(_0x18b164,_0x44ffc8){return function(_0x24866a){if(!_0x24866a){_0x18b164[_0x997a('0x1b')](0x194);}return _0x24866a;};}function handleError(_0x5913a8,_0x490517){_0x490517=_0x490517||0x1f4;return function(_0xbc9b6c){logger[_0x997a('0x27')](_0xbc9b6c[_0x997a('0x28')]);if(_0xbc9b6c[_0x997a('0x29')]){delete _0xbc9b6c[_0x997a('0x29')];}_0x5913a8[_0x997a('0x1d')](_0x490517)['send'](_0xbc9b6c);};}exports[_0x997a('0x2a')]=function(_0x236d4b,_0x720f34){var _0x275032={},_0x2065e9={},_0x119346={'count':0x0,'rows':[]};var _0x4fc840=_['map'](db[_0x997a('0x2b')][_0x997a('0x2c')],function(_0x280fc9){return{'name':_0x280fc9[_0x997a('0x2d')],'type':_0x280fc9[_0x997a('0x2e')][_0x997a('0x2f')]};});_0x2065e9[_0x997a('0x30')]=_['map'](_0x4fc840,_0x997a('0x29'));_0x2065e9[_0x997a('0x31')]=_[_0x997a('0x32')](_0x236d4b[_0x997a('0x31')]);_0x2065e9[_0x997a('0x33')]=_['intersection'](_0x2065e9['model'],_0x2065e9[_0x997a('0x31')]);_0x275032['attributes']=_[_0x997a('0x34')](_0x2065e9[_0x997a('0x30')],qs[_0x997a('0x35')](_0x236d4b[_0x997a('0x31')][_0x997a('0x35')]));_0x275032[_0x997a('0x36')]=_0x275032[_0x997a('0x36')][_0x997a('0x37')]?_0x275032[_0x997a('0x36')]:_0x2065e9['model'];if(!_0x236d4b['query'][_0x997a('0x38')](_0x997a('0x39'))){_0x275032[_0x997a('0x3a')]=qs['limit'](_0x236d4b[_0x997a('0x31')][_0x997a('0x3a')]);_0x275032[_0x997a('0x1e')]=qs[_0x997a('0x1e')](_0x236d4b[_0x997a('0x31')][_0x997a('0x1e')]);}_0x275032['order']=qs[_0x997a('0x3b')](_0x236d4b[_0x997a('0x31')][_0x997a('0x3b')]);_0x275032[_0x997a('0x3c')]=qs[_0x997a('0x33')](_[_0x997a('0x3d')](_0x236d4b[_0x997a('0x31')],_0x2065e9[_0x997a('0x33')]),_0x4fc840);if(_0x236d4b[_0x997a('0x31')]['filter']){_0x275032[_0x997a('0x3c')]=_[_0x997a('0x3e')](_0x275032[_0x997a('0x3c')],{'$or':_[_0x997a('0x3f')](_0x4fc840,function(_0x39f3ea){if(_0x39f3ea[_0x997a('0x2e')]!==_0x997a('0x40')){var _0x5b073c={};_0x5b073c[_0x39f3ea['name']]={'$like':'%'+_0x236d4b['query'][_0x997a('0x41')]+'%'};return _0x5b073c;}})});}_0x275032=_[_0x997a('0x3e')]({},_0x275032,_0x236d4b['options']);var _0x14c88f={'where':_0x275032['where']};return db['ZendeskField'][_0x997a('0x20')](_0x14c88f)[_0x997a('0x25')](function(_0xf14e61){_0x119346[_0x997a('0x20')]=_0xf14e61;if(_0x236d4b[_0x997a('0x31')][_0x997a('0x42')]){_0x275032[_0x997a('0x43')]=[{'all':!![]}];}return db[_0x997a('0x2b')][_0x997a('0x44')](_0x275032);})[_0x997a('0x25')](function(_0x171b8e){_0x119346['rows']=_0x171b8e;return _0x119346;})[_0x997a('0x25')](respondWithFilteredResult(_0x720f34,_0x275032))[_0x997a('0x45')](handleError(_0x720f34,null));};exports[_0x997a('0x46')]=function(_0x55f5bf,_0x3e5877){var _0x5c6785={'raw':!![],'where':{'id':_0x55f5bf[_0x997a('0x47')]['id']}},_0x540e8c={};_0x540e8c['model']=_[_0x997a('0x32')](db[_0x997a('0x2b')][_0x997a('0x2c')]);_0x540e8c[_0x997a('0x31')]=_['keys'](_0x55f5bf[_0x997a('0x31')]);_0x540e8c[_0x997a('0x33')]=_[_0x997a('0x34')](_0x540e8c['model'],_0x540e8c[_0x997a('0x31')]);_0x5c6785[_0x997a('0x36')]=_[_0x997a('0x34')](_0x540e8c[_0x997a('0x30')],qs[_0x997a('0x35')](_0x55f5bf[_0x997a('0x31')][_0x997a('0x35')]));_0x5c6785[_0x997a('0x36')]=_0x5c6785['attributes'][_0x997a('0x37')]?_0x5c6785[_0x997a('0x36')]:_0x540e8c['model'];if(_0x55f5bf[_0x997a('0x31')]['includeAll']){_0x5c6785[_0x997a('0x43')]=[{'all':!![]}];}_0x5c6785=_['merge']({},_0x5c6785,_0x55f5bf[_0x997a('0x48')]);return db[_0x997a('0x2b')]['find'](_0x5c6785)[_0x997a('0x25')](handleEntityNotFound(_0x3e5877,null))[_0x997a('0x25')](respondWithResult(_0x3e5877,null))[_0x997a('0x45')](handleError(_0x3e5877,null));};exports[_0x997a('0x49')]=function(_0x52d974,_0x5a4942){return db['ZendeskField']['create'](_0x52d974[_0x997a('0x4a')],{})[_0x997a('0x25')](respondWithResult(_0x5a4942,0xc9))[_0x997a('0x45')](handleError(_0x5a4942,null));};exports['update']=function(_0x5c5df1,_0x32249e){if(_0x5c5df1[_0x997a('0x4a')]['id']){delete _0x5c5df1['body']['id'];}return db[_0x997a('0x2b')][_0x997a('0x4b')]({'where':{'id':_0x5c5df1['params']['id']}})['then'](handleEntityNotFound(_0x32249e,null))[_0x997a('0x25')](saveUpdates(_0x5c5df1[_0x997a('0x4a')],null))[_0x997a('0x25')](respondWithResult(_0x32249e,null))['catch'](handleError(_0x32249e,null));};exports[_0x997a('0x26')]=function(_0x2ff1e5,_0x594fdc){return db['ZendeskField'][_0x997a('0x4b')]({'where':{'id':_0x2ff1e5[_0x997a('0x47')]['id']}})['then'](handleEntityNotFound(_0x594fdc,null))[_0x997a('0x25')](removeEntity(_0x594fdc,null))[_0x997a('0x45')](handleError(_0x594fdc,null));};
\ No newline at end of file
+var _0x3ef3=['json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','map','ZendeskField','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x272876,_0x478630){var _0x11619e=function(_0x213469){while(--_0x213469){_0x272876['push'](_0x272876['shift']());}};_0x11619e(++_0x478630);}(_0x3ef3,0x1ee));var _0x33ef=function(_0x40788e,_0x539bc0){_0x40788e=_0x40788e-0x0;var _0x3323db=_0x3ef3[_0x40788e];return _0x3323db;};'use strict';var emlformat=require(_0x33ef('0x0'));var rimraf=require(_0x33ef('0x1'));var zipdir=require(_0x33ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x33ef('0x3'));var moment=require(_0x33ef('0x4'));var BPromise=require(_0x33ef('0x5'));var Mustache=require(_0x33ef('0x6'));var util=require(_0x33ef('0x7'));var path=require('path');var sox=require(_0x33ef('0x8'));var csv=require('to-csv');var ejs=require(_0x33ef('0x9'));var fs=require('fs');var fs_extra=require(_0x33ef('0xa'));var _=require(_0x33ef('0xb'));var squel=require(_0x33ef('0xc'));var crypto=require(_0x33ef('0xd'));var jsforce=require(_0x33ef('0xe'));var deskjs=require(_0x33ef('0xf'));var toCsv=require(_0x33ef('0x10'));var querystring=require(_0x33ef('0x11'));var Papa=require(_0x33ef('0x12'));var Redis=require(_0x33ef('0x13'));var authService=require(_0x33ef('0x14'));var qs=require(_0x33ef('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33ef('0x16'));var logger=require(_0x33ef('0x17'))(_0x33ef('0x18'));var utils=require(_0x33ef('0x19'));var config=require(_0x33ef('0x1a'));var licenseUtil=require(_0x33ef('0x1b'));var db=require(_0x33ef('0x1c'))['db'];function respondWithStatusCode(_0x4d63fb,_0x5dda39){_0x5dda39=_0x5dda39||0xcc;return function(_0x26f1b9){if(_0x26f1b9){return _0x4d63fb[_0x33ef('0x1d')](_0x5dda39);}return _0x4d63fb['status'](_0x5dda39)['end']();};}function respondWithResult(_0x5ce840,_0x32fd71){_0x32fd71=_0x32fd71||0xc8;return function(_0x5a825b){if(_0x5a825b){return _0x5ce840[_0x33ef('0x1e')](_0x32fd71)[_0x33ef('0x1f')](_0x5a825b);}};}function respondWithFilteredResult(_0x2d78da,_0x576598){return function(_0x2aa1e7){if(_0x2aa1e7){var _0x567f85=typeof _0x576598[_0x33ef('0x20')]===_0x33ef('0x21')&&typeof _0x576598[_0x33ef('0x22')]===_0x33ef('0x21');var _0xd24586=_0x2aa1e7['count'];var _0x427bee=_0x567f85?0x0:_0x576598[_0x33ef('0x20')];var _0x57f99a=_0x567f85?_0x2aa1e7[_0x33ef('0x23')]:_0x576598[_0x33ef('0x20')]+_0x576598['limit'];var _0x5cadba;if(_0x57f99a>=_0xd24586){_0x57f99a=_0xd24586;_0x5cadba=0xc8;}else{_0x5cadba=0xce;}_0x2d78da[_0x33ef('0x1e')](_0x5cadba);return _0x2d78da[_0x33ef('0x24')]('Content-Range',_0x427bee+'-'+_0x57f99a+'/'+_0xd24586)[_0x33ef('0x1f')](_0x2aa1e7);}return null;};}function patchUpdates(_0x439286){return function(_0x501a46){try{jsonpatch[_0x33ef('0x25')](_0x501a46,_0x439286,!![]);}catch(_0x1224d3){return BPromise[_0x33ef('0x26')](_0x1224d3);}return _0x501a46[_0x33ef('0x27')]();};}function saveUpdates(_0x249c80,_0x256c62){return function(_0xaa8f5c){if(_0xaa8f5c){return _0xaa8f5c[_0x33ef('0x28')](_0x249c80)[_0x33ef('0x29')](function(_0x255a1d){return _0x255a1d;});}return null;};}function removeEntity(_0x4d4ded,_0x597f12){return function(_0x42efd3){if(_0x42efd3){return _0x42efd3['destroy']()[_0x33ef('0x29')](function(){_0x4d4ded[_0x33ef('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb9f4,_0x426531){return function(_0x4bf11e){if(!_0x4bf11e){_0x1fb9f4[_0x33ef('0x1d')](0x194);}return _0x4bf11e;};}function handleError(_0x8a4d03,_0x3eaa6a){_0x3eaa6a=_0x3eaa6a||0x1f4;return function(_0x548225){logger['error'](_0x548225[_0x33ef('0x2a')]);if(_0x548225[_0x33ef('0x2b')]){delete _0x548225['name'];}_0x8a4d03[_0x33ef('0x1e')](_0x3eaa6a)[_0x33ef('0x2c')](_0x548225);};}exports['index']=function(_0x24beed,_0x170cd3){var _0x38e812={},_0x213b08={},_0x22096d={'count':0x0,'rows':[]};var _0x2ed17a=_[_0x33ef('0x2d')](db[_0x33ef('0x2e')][_0x33ef('0x2f')],function(_0x37dbeb){return{'name':_0x37dbeb['fieldName'],'type':_0x37dbeb[_0x33ef('0x30')][_0x33ef('0x31')]};});_0x213b08[_0x33ef('0x32')]=_[_0x33ef('0x2d')](_0x2ed17a,'name');_0x213b08['query']=_[_0x33ef('0x33')](_0x24beed[_0x33ef('0x34')]);_0x213b08[_0x33ef('0x35')]=_[_0x33ef('0x36')](_0x213b08[_0x33ef('0x32')],_0x213b08[_0x33ef('0x34')]);_0x38e812[_0x33ef('0x37')]=_[_0x33ef('0x36')](_0x213b08['model'],qs[_0x33ef('0x38')](_0x24beed[_0x33ef('0x34')]['fields']));_0x38e812[_0x33ef('0x37')]=_0x38e812['attributes'][_0x33ef('0x39')]?_0x38e812[_0x33ef('0x37')]:_0x213b08[_0x33ef('0x32')];if(!_0x24beed[_0x33ef('0x34')][_0x33ef('0x3a')](_0x33ef('0x3b'))){_0x38e812[_0x33ef('0x22')]=qs[_0x33ef('0x22')](_0x24beed[_0x33ef('0x34')][_0x33ef('0x22')]);_0x38e812['offset']=qs[_0x33ef('0x20')](_0x24beed[_0x33ef('0x34')][_0x33ef('0x20')]);}_0x38e812[_0x33ef('0x3c')]=qs['sort'](_0x24beed[_0x33ef('0x34')]['sort']);_0x38e812[_0x33ef('0x3d')]=qs['filters'](_['pick'](_0x24beed[_0x33ef('0x34')],_0x213b08[_0x33ef('0x35')]),_0x2ed17a);if(_0x24beed['query'][_0x33ef('0x3e')]){_0x38e812[_0x33ef('0x3d')]=_[_0x33ef('0x3f')](_0x38e812['where'],{'$or':_[_0x33ef('0x2d')](_0x2ed17a,function(_0x421f9c){if(_0x421f9c[_0x33ef('0x30')]!==_0x33ef('0x40')){var _0x1d9220={};_0x1d9220[_0x421f9c[_0x33ef('0x2b')]]={'$like':'%'+_0x24beed['query'][_0x33ef('0x3e')]+'%'};return _0x1d9220;}})});}_0x38e812=_[_0x33ef('0x3f')]({},_0x38e812,_0x24beed[_0x33ef('0x41')]);var _0x563a76={'where':_0x38e812[_0x33ef('0x3d')]};return db[_0x33ef('0x2e')][_0x33ef('0x23')](_0x563a76)[_0x33ef('0x29')](function(_0x1e4005){_0x22096d[_0x33ef('0x23')]=_0x1e4005;if(_0x24beed[_0x33ef('0x34')][_0x33ef('0x42')]){_0x38e812[_0x33ef('0x43')]=[{'all':!![]}];}return db[_0x33ef('0x2e')][_0x33ef('0x44')](_0x38e812);})[_0x33ef('0x29')](function(_0x2cb2ac){_0x22096d['rows']=_0x2cb2ac;return _0x22096d;})[_0x33ef('0x29')](respondWithFilteredResult(_0x170cd3,_0x38e812))['catch'](handleError(_0x170cd3,null));};exports[_0x33ef('0x45')]=function(_0x5da4d3,_0x9cf06d){var _0x28bf5d={'raw':!![],'where':{'id':_0x5da4d3[_0x33ef('0x46')]['id']}},_0x517db3={};_0x517db3[_0x33ef('0x32')]=_[_0x33ef('0x33')](db[_0x33ef('0x2e')][_0x33ef('0x2f')]);_0x517db3[_0x33ef('0x34')]=_[_0x33ef('0x33')](_0x5da4d3['query']);_0x517db3[_0x33ef('0x35')]=_[_0x33ef('0x36')](_0x517db3['model'],_0x517db3[_0x33ef('0x34')]);_0x28bf5d[_0x33ef('0x37')]=_[_0x33ef('0x36')](_0x517db3[_0x33ef('0x32')],qs[_0x33ef('0x38')](_0x5da4d3[_0x33ef('0x34')]['fields']));_0x28bf5d['attributes']=_0x28bf5d[_0x33ef('0x37')][_0x33ef('0x39')]?_0x28bf5d[_0x33ef('0x37')]:_0x517db3[_0x33ef('0x32')];if(_0x5da4d3[_0x33ef('0x34')][_0x33ef('0x42')]){_0x28bf5d[_0x33ef('0x43')]=[{'all':!![]}];}_0x28bf5d=_['merge']({},_0x28bf5d,_0x5da4d3[_0x33ef('0x41')]);return db['ZendeskField']['find'](_0x28bf5d)[_0x33ef('0x29')](handleEntityNotFound(_0x9cf06d,null))[_0x33ef('0x29')](respondWithResult(_0x9cf06d,null))[_0x33ef('0x47')](handleError(_0x9cf06d,null));};exports[_0x33ef('0x48')]=function(_0x4d98d2,_0x5cc663){return db[_0x33ef('0x2e')][_0x33ef('0x48')](_0x4d98d2['body'],{})['then'](respondWithResult(_0x5cc663,0xc9))[_0x33ef('0x47')](handleError(_0x5cc663,null));};exports[_0x33ef('0x28')]=function(_0x50f0ce,_0x38b75c){if(_0x50f0ce['body']['id']){delete _0x50f0ce['body']['id'];}return db[_0x33ef('0x2e')][_0x33ef('0x49')]({'where':{'id':_0x50f0ce[_0x33ef('0x46')]['id']}})['then'](handleEntityNotFound(_0x38b75c,null))[_0x33ef('0x29')](saveUpdates(_0x50f0ce['body'],null))['then'](respondWithResult(_0x38b75c,null))['catch'](handleError(_0x38b75c,null));};exports[_0x33ef('0x4a')]=function(_0x2286da,_0x43737a){return db[_0x33ef('0x2e')][_0x33ef('0x49')]({'where':{'id':_0x2286da['params']['id']}})[_0x33ef('0x29')](handleEntityNotFound(_0x43737a,null))[_0x33ef('0x29')](removeEntity(_0x43737a,null))[_0x33ef('0x47')](handleError(_0x43737a,null));};
\ No newline at end of file
index bfffb08..6e07123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe2=['FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x6410d7,_0x15ccea){var _0x326ed4=function(_0x25f644){while(--_0x25f644){_0x6410d7['push'](_0x6410d7['shift']());}};_0x326ed4(++_0x15ccea);}(_0x9fe2,0x1cf));var _0x29fe=function(_0x352699,_0x4230c5){_0x352699=_0x352699-0x0;var _0x2a5f25=_0x9fe2[_0x352699];return _0x2a5f25;};'use strict';var _=require(_0x29fe('0x0'));var util=require(_0x29fe('0x1'));var logger=require(_0x29fe('0x2'))('api');var moment=require(_0x29fe('0x3'));var BPromise=require('bluebird');var rp=require(_0x29fe('0x4'));var fs=require('fs');var path=require(_0x29fe('0x5'));var rimraf=require(_0x29fe('0x6'));var config=require(_0x29fe('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x29fe('0x8')]=function(_0x580c7b,_0x44a996){return _0x580c7b[_0x29fe('0x9')](_0x29fe('0xa'),attributes,{'tableName':_0x29fe('0xb'),'paranoid':![],'indexes':[{'name':_0x29fe('0xc'),'fields':['idField',_0x29fe('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf23b=['idField','FieldId','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index'];(function(_0x308953,_0x3893a4){var _0x3b4197=function(_0x1e676a){while(--_0x1e676a){_0x308953['push'](_0x308953['shift']());}};_0x3b4197(++_0x3893a4);}(_0xf23b,0x72));var _0xbf23=function(_0x5413b1,_0x67022d){_0x5413b1=_0x5413b1-0x0;var _0x23347e=_0xf23b[_0x5413b1];return _0x23347e;};'use strict';var _=require(_0xbf23('0x0'));var util=require(_0xbf23('0x1'));var logger=require('../../config/logger')(_0xbf23('0x2'));var moment=require(_0xbf23('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf23('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf23('0x5'));var config=require(_0xbf23('0x6'));var attributes=require(_0xbf23('0x7'));module['exports']=function(_0x12a0f1,_0x3227fa){return _0x12a0f1[_0xbf23('0x8')](_0xbf23('0x9'),attributes,{'tableName':_0xbf23('0xa'),'paranoid':![],'indexes':[{'name':_0xbf23('0xb'),'fields':[_0xbf23('0xc'),_0xbf23('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 17078e9..714cc2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd09b=['message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd09b,0xf9));var _0xbd09=function(_0x479558,_0x12a54d){_0x479558=_0x479558-0x0;var _0x1bfab8=_0xd09b[_0x479558];return _0x1bfab8;};'use strict';var _=require(_0xbd09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbd09('0x1'));var rs=require(_0xbd09('0x2'));var fs=require('fs');var Redis=require(_0xbd09('0x3'));var db=require(_0xbd09('0x4'))['db'];var utils=require(_0xbd09('0x5'));var logger=require(_0xbd09('0x6'))('rpc');var config=require(_0xbd09('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bc5d5,_0x2c00f2,_0x3d0cae){return new BPromise(function(_0x29660b,_0x333b26){return client[_0xbd09('0x9')](_0x4bc5d5,_0x3d0cae)[_0xbd09('0xa')](function(_0x3ff09d){logger[_0xbd09('0xb')](_0xbd09('0xc'),_0x2c00f2,_0xbd09('0xd'));logger['debug'](_0xbd09('0xe'),_0x2c00f2,_0xbd09('0xd'),JSON['stringify'](_0x3ff09d));if(_0x3ff09d[_0xbd09('0xf')]){if(_0x3ff09d[_0xbd09('0xf')][_0xbd09('0x10')]===0x1f4){logger[_0xbd09('0xf')](_0xbd09('0xc'),_0x2c00f2,_0x3ff09d[_0xbd09('0xf')]['message']);return _0x333b26(_0x3ff09d['error'][_0xbd09('0x11')]);}logger[_0xbd09('0xf')]('ZendeskField,\x20%s,\x20%s',_0x2c00f2,_0x3ff09d[_0xbd09('0xf')]['message']);return _0x29660b(_0x3ff09d['error']['message']);}else{logger[_0xbd09('0xb')](_0xbd09('0xc'),_0x2c00f2,_0xbd09('0xd'));_0x29660b(_0x3ff09d['result'][_0xbd09('0x11')]);}})[_0xbd09('0x12')](function(_0x280010){logger['error'](_0xbd09('0xc'),_0x2c00f2,_0x280010);_0x333b26(_0x280010);});});}
\ No newline at end of file
+var _0x8216=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x8216,0x183));var _0x6821=function(_0x3d3950,_0x471be7){_0x3d3950=_0x3d3950-0x0;var _0x27d361=_0x8216[_0x3d3950];return _0x27d361;};'use strict';var _=require(_0x6821('0x0'));var util=require(_0x6821('0x1'));var moment=require(_0x6821('0x2'));var BPromise=require(_0x6821('0x3'));var rs=require(_0x6821('0x4'));var fs=require('fs');var Redis=require(_0x6821('0x5'));var db=require(_0x6821('0x6'))['db'];var utils=require(_0x6821('0x7'));var logger=require(_0x6821('0x8'))(_0x6821('0x9'));var config=require(_0x6821('0xa'));var jayson=require(_0x6821('0xb'));var client=jayson[_0x6821('0xc')][_0x6821('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x134893,_0x18d46f,_0x369dc1){return new BPromise(function(_0x465d35,_0x41b713){return client[_0x6821('0xe')](_0x134893,_0x369dc1)[_0x6821('0xf')](function(_0x13473c){logger[_0x6821('0x10')](_0x6821('0x11'),_0x18d46f,_0x6821('0x12'));logger[_0x6821('0x13')](_0x6821('0x14'),_0x18d46f,'request\x20sent',JSON[_0x6821('0x15')](_0x13473c));if(_0x13473c[_0x6821('0x16')]){if(_0x13473c[_0x6821('0x16')]['code']===0x1f4){logger[_0x6821('0x16')](_0x6821('0x11'),_0x18d46f,_0x13473c['error']['message']);return _0x41b713(_0x13473c[_0x6821('0x16')]['message']);}logger[_0x6821('0x16')](_0x6821('0x11'),_0x18d46f,_0x13473c[_0x6821('0x16')][_0x6821('0x17')]);return _0x465d35(_0x13473c[_0x6821('0x16')][_0x6821('0x17')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x18d46f,'request\x20sent');_0x465d35(_0x13473c[_0x6821('0x18')][_0x6821('0x17')]);}})[_0x6821('0x19')](function(_0x5692b3){logger['error']('ZendeskField,\x20%s,\x20%s',_0x18d46f,_0x5692b3);_0x41b713(_0x5692b3);});});}
\ No newline at end of file
index 0a08e49..2cb8c82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x269f=['/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x269f,0x130));var _0xf269=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x269f[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0xf269('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf269('0x1'));var express=require('express');var router=express[_0xf269('0x2')]();var fs_extra=require(_0xf269('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf269('0x4'));var config=require(_0xf269('0x5'));var controller=require('./intZohoAccount.controller');router[_0xf269('0x6')]('/',auth[_0xf269('0x7')](),controller[_0xf269('0x8')]);router['get'](_0xf269('0x9'),auth[_0xf269('0x7')](),controller[_0xf269('0xa')]);router[_0xf269('0x6')]('/:id/configurations',auth[_0xf269('0x7')](),controller['getConfigurations']);router[_0xf269('0x6')](_0xf269('0xb'),auth[_0xf269('0x7')](),controller[_0xf269('0xc')]);router['post']('/',auth[_0xf269('0x7')](),controller[_0xf269('0xd')]);router[_0xf269('0xe')](_0xf269('0xf'),auth[_0xf269('0x7')](),controller[_0xf269('0x10')]);router[_0xf269('0x11')](_0xf269('0x9'),auth[_0xf269('0x7')](),controller['update']);router[_0xf269('0x12')]('/:id',auth[_0xf269('0x7')](),controller[_0xf269('0x13')]);module[_0xf269('0x14')]=router;
\ No newline at end of file
+var _0x33cf=['../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x282630,_0x1fcf6a){var _0x34078b=function(_0x43cc9e){while(--_0x43cc9e){_0x282630['push'](_0x282630['shift']());}};_0x34078b(++_0x1fcf6a);}(_0x33cf,0x14a));var _0xf33c=function(_0x425da6,_0x20676f){_0x425da6=_0x425da6-0x0;var _0x360ed1=_0x33cf[_0x425da6];return _0x360ed1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf33c('0x0'));var timeout=require(_0xf33c('0x1'));var express=require(_0xf33c('0x2'));var router=express[_0xf33c('0x3')]();var fs_extra=require(_0xf33c('0x4'));var auth=require(_0xf33c('0x5'));var interaction=require(_0xf33c('0x6'));var config=require(_0xf33c('0x7'));var controller=require(_0xf33c('0x8'));router['get']('/',auth[_0xf33c('0x9')](),controller[_0xf33c('0xa')]);router['get']('/:id',auth[_0xf33c('0x9')](),controller['show']);router[_0xf33c('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf33c('0xc')]);router[_0xf33c('0xb')]('/:id/fields',auth[_0xf33c('0x9')](),controller[_0xf33c('0xd')]);router[_0xf33c('0xe')]('/',auth[_0xf33c('0x9')](),controller[_0xf33c('0xf')]);router[_0xf33c('0xe')](_0xf33c('0x10'),auth[_0xf33c('0x9')](),controller[_0xf33c('0x11')]);router['put'](_0xf33c('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xf33c('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf33c('0x14')]=router;
\ No newline at end of file
index a0478e0..b12d461 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['sequelize','exports','STRING'];(function(_0x2db667,_0x193cf5){var _0x83ff9=function(_0x5da022){while(--_0x5da022){_0x2db667['push'](_0x2db667['shift']());}};_0x83ff9(++_0x193cf5);}(_0x9a19,0x114));var _0x99a1=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x9a19[_0x2ca2d0];return _0x521c23;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'name':{'type':Sequelize[_0x99a1('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x99a1('0x2')]},'zone':{'type':Sequelize[_0x99a1('0x2')]},'clientId':{'type':Sequelize[_0x99a1('0x2')]},'clientSecret':{'type':Sequelize[_0x99a1('0x2')]},'serverUrl':{'type':Sequelize[_0x99a1('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x99a1('0x2')]},'refreshToken':{'type':Sequelize[_0x99a1('0x2')]}};
\ No newline at end of file
+var _0xedd9=['exports','STRING'];(function(_0x233e15,_0x1a5399){var _0x187723=function(_0x33a369){while(--_0x33a369){_0x233e15['push'](_0x233e15['shift']());}};_0x187723(++_0x1a5399);}(_0xedd9,0xfc));var _0x9edd=function(_0x36936b,_0x47abad){_0x36936b=_0x36936b-0x0;var _0x5ebf66=_0xedd9[_0x36936b];return _0x5ebf66;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}};
\ No newline at end of file
index 920a188..d7b2bea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76ba=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','update','then','stack','name','ZohoAccount','rawAttributes','key','model','map','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','keys','fields','find','create','body','params','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','refreshToken','com','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x367090,_0x37a179){var _0x596b39=function(_0x1d7fc8){while(--_0x1d7fc8){_0x367090['push'](_0x367090['shift']());}};_0x596b39(++_0x37a179);}(_0x76ba,0x105));var _0xa76b=function(_0x254a35,_0x387f38){_0x254a35=_0x254a35-0x0;var _0xb14e21=_0x76ba[_0x254a35];return _0xb14e21;};'use strict';var emlformat=require(_0xa76b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa76b('0x1'));var jsonpatch=require(_0xa76b('0x2'));var rp=require('request-promise');var moment=require(_0xa76b('0x3'));var BPromise=require(_0xa76b('0x4'));var Mustache=require('mustache');var util=require(_0xa76b('0x5'));var path=require('path');var sox=require(_0xa76b('0x6'));var csv=require(_0xa76b('0x7'));var ejs=require(_0xa76b('0x8'));var fs=require('fs');var fs_extra=require(_0xa76b('0x9'));var _=require(_0xa76b('0xa'));var squel=require('squel');var crypto=require(_0xa76b('0xb'));var jsforce=require(_0xa76b('0xc'));var deskjs=require(_0xa76b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa76b('0xe'));var Papa=require(_0xa76b('0xf'));var Redis=require(_0xa76b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa76b('0x11'));var as=require(_0xa76b('0x12'));var hardwareService=require(_0xa76b('0x13'));var logger=require('../../config/logger')(_0xa76b('0x14'));var utils=require(_0xa76b('0x15'));var config=require(_0xa76b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa76b('0x17'))['db'];var integrations=require(_0xa76b('0x18'));var jayson=require(_0xa76b('0x19'));var client=jayson[_0xa76b('0x1a')][_0xa76b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x29ee89,_0xe10055,_0x182ee7,_0x6b641c){return new BPromise(function(_0x2e13f3,_0x1b7e6a){var _0x4728e6=_0x6b641c||client;return _0x4728e6[_0xa76b('0x1c')](_0x29ee89,_0x182ee7)['then'](function(_0x2cd6cd){logger[_0xa76b('0x1d')](_0xa76b('0x1e'),_0xe10055,_0xa76b('0x1f'));logger[_0xa76b('0x20')](_0xa76b('0x21'),_0xe10055,_0xa76b('0x1f'),JSON[_0xa76b('0x22')](_0x2cd6cd));if(_0x2cd6cd['error']){if(_0x2cd6cd['error']['code']===0x1f4){logger[_0xa76b('0x23')](_0xa76b('0x1e'),_0xe10055,_0x2cd6cd[_0xa76b('0x23')]['message']);return _0x1b7e6a(_0x2cd6cd['error'][_0xa76b('0x24')]);}logger[_0xa76b('0x23')]('ZohoAccount,\x20%s,\x20%s',_0xe10055,_0x2cd6cd[_0xa76b('0x23')][_0xa76b('0x24')]);return _0x2e13f3(_0x2cd6cd[_0xa76b('0x23')][_0xa76b('0x24')]);}else{logger['info'](_0xa76b('0x1e'),_0xe10055,'request\x20sent');_0x2e13f3(_0x2cd6cd[_0xa76b('0x25')][_0xa76b('0x24')]);}})[_0xa76b('0x26')](function(_0x23827f){logger[_0xa76b('0x23')](_0xa76b('0x1e'),_0xe10055,_0x23827f);_0x1b7e6a(_0x23827f);});});}function respondWithStatusCode(_0x224db5,_0x27fa32){_0x27fa32=_0x27fa32||0xcc;return function(_0xf58d34){if(_0xf58d34){return _0x224db5[_0xa76b('0x27')](_0x27fa32);}return _0x224db5[_0xa76b('0x28')](_0x27fa32)[_0xa76b('0x29')]();};}function respondWithResult(_0x563854,_0x28c74a){_0x28c74a=_0x28c74a||0xc8;return function(_0x56a5ba){if(_0x56a5ba){return _0x563854[_0xa76b('0x28')](_0x28c74a)[_0xa76b('0x2a')](_0x56a5ba);}};}function respondWithFilteredResult(_0x5ce7a4,_0x1c8702){return function(_0x10eb21){if(_0x10eb21){var _0x386a3f=typeof _0x1c8702['offset']===_0xa76b('0x2b')&&typeof _0x1c8702[_0xa76b('0x2c')]==='undefined';var _0x3a7108=_0x10eb21['count'];var _0x26d642=_0x386a3f?0x0:_0x1c8702[_0xa76b('0x2d')];var _0x22eb89=_0x386a3f?_0x10eb21[_0xa76b('0x2e')]:_0x1c8702['offset']+_0x1c8702[_0xa76b('0x2c')];var _0x367df4;if(_0x22eb89>=_0x3a7108){_0x22eb89=_0x3a7108;_0x367df4=0xc8;}else{_0x367df4=0xce;}_0x5ce7a4[_0xa76b('0x28')](_0x367df4);return _0x5ce7a4['set'](_0xa76b('0x2f'),_0x26d642+'-'+_0x22eb89+'/'+_0x3a7108)['json'](_0x10eb21);}return null;};}function patchUpdates(_0x10750c){return function(_0x580513){try{jsonpatch[_0xa76b('0x30')](_0x580513,_0x10750c,!![]);}catch(_0x305169){return BPromise['reject'](_0x305169);}return _0x580513['save']();};}function saveUpdates(_0x5928ec,_0x411a52){return function(_0x77e286){if(_0x77e286){return _0x77e286[_0xa76b('0x31')](_0x5928ec)[_0xa76b('0x32')](function(_0x3f67b3){return _0x3f67b3;});}return null;};}function removeEntity(_0x83354e,_0x12b185){return function(_0x431ed7){if(_0x431ed7){return _0x431ed7['destroy']()[_0xa76b('0x32')](function(){_0x83354e[_0xa76b('0x28')](0xcc)[_0xa76b('0x29')]();});}};}function handleEntityNotFound(_0x901571,_0x7ef315){return function(_0x221607){if(!_0x221607){_0x901571['sendStatus'](0x194);}return _0x221607;};}function handleError(_0x4bdf3e,_0x4b056a){_0x4b056a=_0x4b056a||0x1f4;return function(_0x1bf785){logger[_0xa76b('0x23')](_0x1bf785[_0xa76b('0x33')]);if(_0x1bf785[_0xa76b('0x34')]){delete _0x1bf785[_0xa76b('0x34')];}_0x4bdf3e[_0xa76b('0x28')](_0x4b056a)['send'](_0x1bf785);};}exports['index']=function(_0x119da2,_0x30c811){var _0x11458c={},_0x55c443={},_0x4fd704={'count':0x0,'rows':[]};var _0x2a865d=_['map'](db[_0xa76b('0x35')][_0xa76b('0x36')],function(_0x1b0bd7){return{'name':_0x1b0bd7['fieldName'],'type':_0x1b0bd7['type'][_0xa76b('0x37')]};});_0x55c443[_0xa76b('0x38')]=_[_0xa76b('0x39')](_0x2a865d,'name');_0x55c443[_0xa76b('0x3a')]=_['keys'](_0x119da2['query']);_0x55c443[_0xa76b('0x3b')]=_[_0xa76b('0x3c')](_0x55c443['model'],_0x55c443[_0xa76b('0x3a')]);_0x11458c['attributes']=_[_0xa76b('0x3c')](_0x55c443[_0xa76b('0x38')],qs['fields'](_0x119da2[_0xa76b('0x3a')]['fields']));_0x11458c[_0xa76b('0x3d')]=_0x11458c[_0xa76b('0x3d')][_0xa76b('0x3e')]?_0x11458c[_0xa76b('0x3d')]:_0x55c443[_0xa76b('0x38')];if(!_0x119da2[_0xa76b('0x3a')]['hasOwnProperty'](_0xa76b('0x3f'))){_0x11458c[_0xa76b('0x2c')]=qs[_0xa76b('0x2c')](_0x119da2['query'][_0xa76b('0x2c')]);_0x11458c[_0xa76b('0x2d')]=qs['offset'](_0x119da2[_0xa76b('0x3a')][_0xa76b('0x2d')]);}_0x11458c[_0xa76b('0x40')]=qs[_0xa76b('0x41')](_0x119da2[_0xa76b('0x3a')]['sort']);_0x11458c[_0xa76b('0x42')]=qs['filters'](_[_0xa76b('0x43')](_0x119da2[_0xa76b('0x3a')],_0x55c443[_0xa76b('0x3b')]),_0x2a865d);if(_0x119da2['query'][_0xa76b('0x44')]){_0x11458c['where']=_[_0xa76b('0x45')](_0x11458c[_0xa76b('0x42')],{'$or':_[_0xa76b('0x39')](_0x2a865d,function(_0x2cdb34){if(_0x2cdb34[_0xa76b('0x46')]!==_0xa76b('0x47')){var _0x1012c7={};_0x1012c7[_0x2cdb34['name']]={'$like':'%'+_0x119da2[_0xa76b('0x3a')]['filter']+'%'};return _0x1012c7;}})});}_0x11458c=_[_0xa76b('0x45')]({},_0x11458c,_0x119da2[_0xa76b('0x48')]);var _0x3c635d={'where':_0x11458c[_0xa76b('0x42')]};return db[_0xa76b('0x35')][_0xa76b('0x2e')](_0x3c635d)[_0xa76b('0x32')](function(_0x450128){_0x4fd704[_0xa76b('0x2e')]=_0x450128;if(_0x119da2['query'][_0xa76b('0x49')]){_0x11458c[_0xa76b('0x4a')]=[{'all':!![]}];}return db[_0xa76b('0x35')][_0xa76b('0x4b')](_0x11458c);})[_0xa76b('0x32')](function(_0x4a6784){_0x4fd704[_0xa76b('0x4c')]=_0x4a6784;return _0x4fd704;})[_0xa76b('0x32')](respondWithFilteredResult(_0x30c811,_0x11458c))[_0xa76b('0x26')](handleError(_0x30c811,null));};exports['show']=function(_0x4767eb,_0x338ae2){var _0x3701f2={'raw':![],'where':{'id':_0x4767eb['params']['id']}},_0x4a3ed3={};_0x4a3ed3['model']=_[_0xa76b('0x4d')](db[_0xa76b('0x35')][_0xa76b('0x36')]);_0x4a3ed3[_0xa76b('0x3a')]=_['keys'](_0x4767eb['query']);_0x4a3ed3[_0xa76b('0x3b')]=_[_0xa76b('0x3c')](_0x4a3ed3['model'],_0x4a3ed3[_0xa76b('0x3a')]);_0x3701f2[_0xa76b('0x3d')]=_[_0xa76b('0x3c')](_0x4a3ed3[_0xa76b('0x38')],qs['fields'](_0x4767eb[_0xa76b('0x3a')][_0xa76b('0x4e')]));_0x3701f2['attributes']=_0x3701f2['attributes'][_0xa76b('0x3e')]?_0x3701f2[_0xa76b('0x3d')]:_0x4a3ed3['model'];if(_0x4767eb['query'][_0xa76b('0x49')]){_0x3701f2[_0xa76b('0x4a')]=[{'all':!![]}];}_0x3701f2=_['merge']({},_0x3701f2,_0x4767eb['options']);return db['ZohoAccount'][_0xa76b('0x4f')](_0x3701f2)[_0xa76b('0x32')](handleEntityNotFound(_0x338ae2,null))['then'](respondWithResult(_0x338ae2,null))[_0xa76b('0x26')](handleError(_0x338ae2,null));};exports[_0xa76b('0x50')]=function(_0x884769,_0x1faae5){return db[_0xa76b('0x35')][_0xa76b('0x50')](_0x884769[_0xa76b('0x51')],{})[_0xa76b('0x32')](respondWithResult(_0x1faae5,0xc9))[_0xa76b('0x26')](handleError(_0x1faae5,null));};exports[_0xa76b('0x31')]=function(_0x47e442,_0x50ebb8){if(_0x47e442['body']['id']){delete _0x47e442['body']['id'];}return db[_0xa76b('0x35')][_0xa76b('0x4f')]({'where':{'id':_0x47e442[_0xa76b('0x52')]['id']}})[_0xa76b('0x32')](handleEntityNotFound(_0x50ebb8,null))[_0xa76b('0x32')](saveUpdates(_0x47e442['body'],null))[_0xa76b('0x32')](respondWithResult(_0x50ebb8,null))[_0xa76b('0x26')](handleError(_0x50ebb8,null));};exports[_0xa76b('0x53')]=function(_0x18a038,_0x507415){return db[_0xa76b('0x35')][_0xa76b('0x4f')]({'where':{'id':_0x18a038[_0xa76b('0x52')]['id']}})[_0xa76b('0x32')](handleEntityNotFound(_0x507415,null))[_0xa76b('0x32')](removeEntity(_0x507415,null))['catch'](handleError(_0x507415,null));};exports[_0xa76b('0x54')]=function(_0x2fd4d4,_0x8ec2dc,_0x268b9f){var _0x1184af={};var _0x37ec07={};var _0x181e08;var _0x404cf6;return db[_0xa76b('0x35')][_0xa76b('0x55')]({'where':{'id':_0x2fd4d4['params']['id']}})['then'](handleEntityNotFound(_0x8ec2dc,null))[_0xa76b('0x32')](function(_0x130470){if(_0x130470){_0x181e08=_0x130470;_0x37ec07[_0xa76b('0x38')]=_[_0xa76b('0x4d')](db['ZohoConfiguration']['rawAttributes']);_0x37ec07[_0xa76b('0x3a')]=_[_0xa76b('0x4d')](_0x2fd4d4[_0xa76b('0x3a')]);_0x37ec07[_0xa76b('0x3b')]=_[_0xa76b('0x3c')](_0x37ec07['model'],_0x37ec07[_0xa76b('0x3a')]);_0x1184af[_0xa76b('0x3d')]=_[_0xa76b('0x3c')](_0x37ec07[_0xa76b('0x38')],qs[_0xa76b('0x4e')](_0x2fd4d4['query'][_0xa76b('0x4e')]));_0x1184af[_0xa76b('0x3d')]=_0x1184af[_0xa76b('0x3d')][_0xa76b('0x3e')]?_0x1184af['attributes']:_0x37ec07[_0xa76b('0x38')];_0x1184af[_0xa76b('0x40')]=qs[_0xa76b('0x41')](_0x2fd4d4['query'][_0xa76b('0x41')]);_0x1184af[_0xa76b('0x42')]=qs[_0xa76b('0x3b')](_['pick'](_0x2fd4d4[_0xa76b('0x3a')],_0x37ec07[_0xa76b('0x3b')]));if(_0x2fd4d4[_0xa76b('0x3a')][_0xa76b('0x44')]){_0x1184af[_0xa76b('0x42')]=_[_0xa76b('0x45')](_0x1184af[_0xa76b('0x42')],{'$or':_[_0xa76b('0x39')](_0x1184af[_0xa76b('0x3d')],function(_0x578f70){var _0x39a06a={};_0x39a06a[_0x578f70]={'$like':'%'+_0x2fd4d4[_0xa76b('0x3a')][_0xa76b('0x44')]+'%'};return _0x39a06a;})});}_0x1184af=_['merge']({},_0x1184af,_0x2fd4d4[_0xa76b('0x48')]);return _0x181e08[_0xa76b('0x54')](_0x1184af);}})[_0xa76b('0x32')](function(_0xf158b9){if(_0xf158b9){_0x404cf6=_0xf158b9[_0xa76b('0x3e')];if(!_0x2fd4d4['query'][_0xa76b('0x56')](_0xa76b('0x3f'))){_0x1184af[_0xa76b('0x2c')]=qs[_0xa76b('0x2c')](_0x2fd4d4[_0xa76b('0x3a')][_0xa76b('0x2c')]);_0x1184af[_0xa76b('0x2d')]=qs[_0xa76b('0x2d')](_0x2fd4d4[_0xa76b('0x3a')]['offset']);}return _0x181e08['getConfigurations'](_0x1184af);}})[_0xa76b('0x32')](function(_0xf0a9f6){if(_0xf0a9f6){return _0xf0a9f6?{'count':_0x404cf6,'rows':_0xf0a9f6}:null;}})['then'](respondWithResult(_0x8ec2dc,null))['catch'](handleError(_0x8ec2dc,null));};exports[_0xa76b('0x57')]=function(_0x3d4c03,_0x2a5034,_0x454584){if(_0x3d4c03[_0xa76b('0x51')]['id']){delete _0x3d4c03['body']['id'];}return db[_0xa76b('0x35')]['findOne']({'where':{'id':_0x3d4c03[_0xa76b('0x52')]['id']}})['then'](handleEntityNotFound(_0x2a5034,null))['then'](function(_0x38b544){if(_0x38b544){_0x3d4c03[_0xa76b('0x51')][_0xa76b('0x58')]=_0x38b544['id'];_0x3d4c03[_0xa76b('0x51')][_0xa76b('0x59')]=integrations['getSubjects'](_0x3d4c03[_0xa76b('0x51')][_0xa76b('0x5a')],_0x3d4c03[_0xa76b('0x51')][_0xa76b('0x46')]);_0x3d4c03[_0xa76b('0x51')][_0xa76b('0x5b')]=integrations['getDescriptions'](_0x3d4c03['body'][_0xa76b('0x5a')],_0x3d4c03[_0xa76b('0x51')][_0xa76b('0x46')]);return db[_0xa76b('0x5c')]['create'](_0x3d4c03[_0xa76b('0x51')],{'include':[{'model':db[_0xa76b('0x5d')],'as':'Subjects'},{'model':db[_0xa76b('0x5d')],'as':_0xa76b('0x5b')}]});}return null;})[_0xa76b('0x32')](respondWithResult(_0x2a5034,null))[_0xa76b('0x26')](handleError(_0x2a5034,null));};function getAccessToken(_0x5d45b3){return new Promise(function(_0x2e0356,_0x4d4873){var _0x82bdce;switch(_0x5d45b3[_0xa76b('0x5e')]){case'US':_0x82bdce=_0xa76b('0x5f');break;case'AU':_0x82bdce=_0xa76b('0x60');break;case'EU':_0x82bdce='https://accounts.zoho.eu';break;case'IN':_0x82bdce=_0xa76b('0x61');break;case'CN':_0x82bdce=_0xa76b('0x62');break;default:_0x82bdce=_0xa76b('0x63');break;}var _0x30aff6={'method':_0xa76b('0x64'),'uri':_0x82bdce+_0xa76b('0x65'),'qs':{'refresh_token':_0x5d45b3['refreshToken'],'client_id':_0x5d45b3[_0xa76b('0x66')],'client_secret':_0x5d45b3[_0xa76b('0x67')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x30aff6)[_0xa76b('0x32')](function(_0x26a0f3){if(_0x26a0f3[_0xa76b('0x68')]){_0x2e0356(_0x26a0f3[_0xa76b('0x68')]);}else{_0x4d4873(_0xa76b('0x69'));}})[_0xa76b('0x26')](function(_0x1b5ba1){_0x4d4873(_0x1b5ba1);});});}exports['getFields']=function(_0x1ad313,_0x4c1da2,_0x18cc88){var _0x38d212,_0x17584c,_0x156a9f,_0x4d815e,_0x1e1228;return db[_0xa76b('0x35')][_0xa76b('0x55')]({'where':{'id':_0x1ad313[_0xa76b('0x52')]['id']},'attributes':['id',_0xa76b('0x6a'),_0xa76b('0x5e'),_0xa76b('0x66'),_0xa76b('0x67'),_0xa76b('0x6b'),_0xa76b('0x6c'),_0xa76b('0x6d')]})['then'](handleEntityNotFound(_0x4c1da2,null))['then'](function(_0x448e56){_0x1e1228=_0x448e56;_0x38d212=_0x1e1228[_0xa76b('0x6a')];_0x17584c=_0x38d212==='zoho.eu'?'eu':_0xa76b('0x6e');_0x156a9f=_0x1e1228[_0xa76b('0x6b')];var _0x21522d=_0x156a9f[_0xa76b('0x6f')](-0x1);if(_0x21522d==='/'||_0x21522d==='\x5c'||_0x21522d===':'){_0x156a9f=_0x156a9f['substring'](0x0,_0x156a9f['lastIndexOf'](_0x21522d));}if(!_0x1e1228[_0xa76b('0x6d')]){throw new Error(_0xa76b('0x70'));}return getAccessToken(_0x1e1228);})['then'](function(_0x4dab4b){if(_0x4dab4b){return rp({'method':_0xa76b('0x71'),'uri':util[_0xa76b('0x72')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x17584c),'qs':{'module':_0xa76b('0x73')},'headers':{'Authorization':_0xa76b('0x74')+_0x4dab4b},'json':!![]});}})[_0xa76b('0x32')](function(_0x489090){if(_0x489090){if(_0x489090[_0xa76b('0x75')]&&_0x489090[_0xa76b('0x75')]['error']){throw new Error(_0x489090['response']['error'][_0xa76b('0x24')]);}var _0x18e8aa=[];var _0x3e2ad4=[];var _0x5a346c=[_0xa76b('0x76'),_0xa76b('0x77'),'Description',_0xa76b('0x78'),_0xa76b('0x79'),'Call_Result',_0xa76b('0x7a'),_0xa76b('0x7b')];_0x3e2ad4=_[_0xa76b('0x7c')](_0x489090[_0xa76b('0x4e')],function(_0x1971f8){return _0x5a346c[_0xa76b('0x7d')](_0x1971f8[_0xa76b('0x7e')]);});for(var _0x5d787f=0x0;_0x5d787f<_0x3e2ad4[_0xa76b('0x3e')];_0x5d787f++){if(_0x3e2ad4[_0x5d787f][_0xa76b('0x7f')]===![]){_0x18e8aa[_0xa76b('0x80')]({'id':_0x3e2ad4[_0x5d787f]['id'],'name':_0x3e2ad4[_0x5d787f][_0xa76b('0x81')],'custom':_0x3e2ad4[_0x5d787f][_0xa76b('0x82')],'options':_0x3e2ad4[_0x5d787f][_0xa76b('0x83')]===_0xa76b('0x84')&&_0x3e2ad4[_0x5d787f][_0xa76b('0x85')][_0xa76b('0x3e')]>-0x1?_['map'](_0x3e2ad4[_0x5d787f]['pick_list_values'],function(_0x1c6b4a){return{'name':_0x1c6b4a,'value':_0x1c6b4a};}):[]});}}return{'count':_0x18e8aa[_0xa76b('0x3e')],'rows':_0x18e8aa};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4c1da2,null))[_0xa76b('0x26')](function(_0x5838fa){var _0x4fe878=_0x1ad313[_0xa76b('0x3a')][_0xa76b('0x86')]?0x1f4:_0x5838fa[_0xa76b('0x87')]||0x1f4;logger[_0xa76b('0x23')](_0xa76b('0x88'),'getFields',_0x4fe878,JSON[_0xa76b('0x22')](_0x5838fa));delete _0x5838fa[_0xa76b('0x34')];if(_0x4fe878===0x191){_0x4fe878=0x190;}_0x4c1da2['status'](_0x4fe878)[_0xa76b('0x89')](_0x1ad313['query'][_0xa76b('0x86')]?{'message':_0xa76b('0x8a'),'statusCode':_0x5838fa[_0xa76b('0x87')]}:_0x5838fa);});};
\ No newline at end of file
+var _0x8bee=['create','body','update','params','ZohoConfiguration','sort','getConfigurations','hasOwnProperty','findOne','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','zoho.eu','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','set','reject','save','destroy','sendStatus','stack','name','send','map','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','findAll','rows','keys','find'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8bee,0xc5));var _0xe8be=function(_0x18b301,_0x1cbde4){_0x18b301=_0x18b301-0x0;var _0x4287f8=_0x8bee[_0x18b301];return _0x4287f8;};'use strict';var emlformat=require(_0xe8be('0x0'));var rimraf=require(_0xe8be('0x1'));var zipdir=require(_0xe8be('0x2'));var jsonpatch=require(_0xe8be('0x3'));var rp=require(_0xe8be('0x4'));var moment=require(_0xe8be('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe8be('0x6'));var path=require('path');var sox=require(_0xe8be('0x7'));var csv=require(_0xe8be('0x8'));var ejs=require(_0xe8be('0x9'));var fs=require('fs');var fs_extra=require(_0xe8be('0xa'));var _=require(_0xe8be('0xb'));var squel=require(_0xe8be('0xc'));var crypto=require(_0xe8be('0xd'));var jsforce=require(_0xe8be('0xe'));var deskjs=require(_0xe8be('0xf'));var toCsv=require(_0xe8be('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe8be('0x10'));var authService=require(_0xe8be('0x11'));var qs=require(_0xe8be('0x12'));var as=require(_0xe8be('0x13'));var hardwareService=require(_0xe8be('0x14'));var logger=require(_0xe8be('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe8be('0x16'))['db'];var integrations=require(_0xe8be('0x17'));var jayson=require(_0xe8be('0x18'));var client=jayson[_0xe8be('0x19')][_0xe8be('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2704b3,_0x3d9467,_0x506e97,_0x5b0ce5){return new BPromise(function(_0x1754ab,_0x56c4b9){var _0x4f792b=_0x5b0ce5||client;return _0x4f792b[_0xe8be('0x1b')](_0x2704b3,_0x506e97)[_0xe8be('0x1c')](function(_0x547a90){logger[_0xe8be('0x1d')]('ZohoAccount,\x20%s,\x20%s',_0x3d9467,'request\x20sent');logger['debug'](_0xe8be('0x1e'),_0x3d9467,_0xe8be('0x1f'),JSON[_0xe8be('0x20')](_0x547a90));if(_0x547a90[_0xe8be('0x21')]){if(_0x547a90[_0xe8be('0x21')]['code']===0x1f4){logger['error'](_0xe8be('0x22'),_0x3d9467,_0x547a90['error'][_0xe8be('0x23')]);return _0x56c4b9(_0x547a90[_0xe8be('0x21')][_0xe8be('0x23')]);}logger[_0xe8be('0x21')](_0xe8be('0x22'),_0x3d9467,_0x547a90[_0xe8be('0x21')][_0xe8be('0x23')]);return _0x1754ab(_0x547a90[_0xe8be('0x21')]['message']);}else{logger[_0xe8be('0x1d')](_0xe8be('0x22'),_0x3d9467,'request\x20sent');_0x1754ab(_0x547a90[_0xe8be('0x24')][_0xe8be('0x23')]);}})[_0xe8be('0x25')](function(_0xd861bb){logger[_0xe8be('0x21')](_0xe8be('0x22'),_0x3d9467,_0xd861bb);_0x56c4b9(_0xd861bb);});});}function respondWithStatusCode(_0x780099,_0x3818e4){_0x3818e4=_0x3818e4||0xcc;return function(_0x21c6ca){if(_0x21c6ca){return _0x780099['sendStatus'](_0x3818e4);}return _0x780099['status'](_0x3818e4)[_0xe8be('0x26')]();};}function respondWithResult(_0x586774,_0x3a0a00){_0x3a0a00=_0x3a0a00||0xc8;return function(_0x11edf3){if(_0x11edf3){return _0x586774[_0xe8be('0x27')](_0x3a0a00)[_0xe8be('0x28')](_0x11edf3);}};}function respondWithFilteredResult(_0x26ee1e,_0x3e84dd){return function(_0xfe56bf){if(_0xfe56bf){var _0x206480=typeof _0x3e84dd[_0xe8be('0x29')]===_0xe8be('0x2a')&&typeof _0x3e84dd[_0xe8be('0x2b')]===_0xe8be('0x2a');var _0x10dcb6=_0xfe56bf['count'];var _0x59a277=_0x206480?0x0:_0x3e84dd[_0xe8be('0x29')];var _0x25facf=_0x206480?_0xfe56bf[_0xe8be('0x2c')]:_0x3e84dd['offset']+_0x3e84dd[_0xe8be('0x2b')];var _0x11cfd4;if(_0x25facf>=_0x10dcb6){_0x25facf=_0x10dcb6;_0x11cfd4=0xc8;}else{_0x11cfd4=0xce;}_0x26ee1e['status'](_0x11cfd4);return _0x26ee1e[_0xe8be('0x2d')]('Content-Range',_0x59a277+'-'+_0x25facf+'/'+_0x10dcb6)[_0xe8be('0x28')](_0xfe56bf);}return null;};}function patchUpdates(_0x32547d){return function(_0x318d2c){try{jsonpatch['apply'](_0x318d2c,_0x32547d,!![]);}catch(_0x5be5d1){return BPromise[_0xe8be('0x2e')](_0x5be5d1);}return _0x318d2c[_0xe8be('0x2f')]();};}function saveUpdates(_0x58d226,_0xb6d610){return function(_0x2f8e64){if(_0x2f8e64){return _0x2f8e64['update'](_0x58d226)[_0xe8be('0x1c')](function(_0x492cd9){return _0x492cd9;});}return null;};}function removeEntity(_0x11c97e,_0x55da7c){return function(_0x3cbdbc){if(_0x3cbdbc){return _0x3cbdbc[_0xe8be('0x30')]()[_0xe8be('0x1c')](function(){_0x11c97e[_0xe8be('0x27')](0xcc)[_0xe8be('0x26')]();});}};}function handleEntityNotFound(_0x909b4,_0xe6febe){return function(_0x5d5986){if(!_0x5d5986){_0x909b4[_0xe8be('0x31')](0x194);}return _0x5d5986;};}function handleError(_0x56d95c,_0x204015){_0x204015=_0x204015||0x1f4;return function(_0x2b1102){logger[_0xe8be('0x21')](_0x2b1102[_0xe8be('0x32')]);if(_0x2b1102['name']){delete _0x2b1102[_0xe8be('0x33')];}_0x56d95c[_0xe8be('0x27')](_0x204015)[_0xe8be('0x34')](_0x2b1102);};}exports['index']=function(_0x23ace7,_0x2cc3ba){var _0x522c4d={},_0x5b4d8e={},_0x13f7b5={'count':0x0,'rows':[]};var _0x30b0cc=_[_0xe8be('0x35')](db['ZohoAccount'][_0xe8be('0x36')],function(_0x3349d4){return{'name':_0x3349d4['fieldName'],'type':_0x3349d4['type']['key']};});_0x5b4d8e[_0xe8be('0x37')]=_[_0xe8be('0x35')](_0x30b0cc,'name');_0x5b4d8e[_0xe8be('0x38')]=_['keys'](_0x23ace7[_0xe8be('0x38')]);_0x5b4d8e[_0xe8be('0x39')]=_[_0xe8be('0x3a')](_0x5b4d8e[_0xe8be('0x37')],_0x5b4d8e[_0xe8be('0x38')]);_0x522c4d[_0xe8be('0x3b')]=_['intersection'](_0x5b4d8e[_0xe8be('0x37')],qs[_0xe8be('0x3c')](_0x23ace7[_0xe8be('0x38')][_0xe8be('0x3c')]));_0x522c4d['attributes']=_0x522c4d[_0xe8be('0x3b')][_0xe8be('0x3d')]?_0x522c4d[_0xe8be('0x3b')]:_0x5b4d8e[_0xe8be('0x37')];if(!_0x23ace7[_0xe8be('0x38')]['hasOwnProperty'](_0xe8be('0x3e'))){_0x522c4d[_0xe8be('0x2b')]=qs['limit'](_0x23ace7['query'][_0xe8be('0x2b')]);_0x522c4d[_0xe8be('0x29')]=qs[_0xe8be('0x29')](_0x23ace7[_0xe8be('0x38')]['offset']);}_0x522c4d[_0xe8be('0x3f')]=qs['sort'](_0x23ace7['query']['sort']);_0x522c4d[_0xe8be('0x40')]=qs[_0xe8be('0x39')](_[_0xe8be('0x41')](_0x23ace7[_0xe8be('0x38')],_0x5b4d8e['filters']),_0x30b0cc);if(_0x23ace7[_0xe8be('0x38')][_0xe8be('0x42')]){_0x522c4d[_0xe8be('0x40')]=_[_0xe8be('0x43')](_0x522c4d[_0xe8be('0x40')],{'$or':_[_0xe8be('0x35')](_0x30b0cc,function(_0x54f5be){if(_0x54f5be['type']!==_0xe8be('0x44')){var _0x4a841e={};_0x4a841e[_0x54f5be['name']]={'$like':'%'+_0x23ace7[_0xe8be('0x38')][_0xe8be('0x42')]+'%'};return _0x4a841e;}})});}_0x522c4d=_[_0xe8be('0x43')]({},_0x522c4d,_0x23ace7[_0xe8be('0x45')]);var _0x334404={'where':_0x522c4d[_0xe8be('0x40')]};return db[_0xe8be('0x46')][_0xe8be('0x2c')](_0x334404)[_0xe8be('0x1c')](function(_0xd3aa4e){_0x13f7b5[_0xe8be('0x2c')]=_0xd3aa4e;if(_0x23ace7[_0xe8be('0x38')][_0xe8be('0x47')]){_0x522c4d[_0xe8be('0x48')]=[{'all':!![]}];}return db[_0xe8be('0x46')][_0xe8be('0x49')](_0x522c4d);})[_0xe8be('0x1c')](function(_0x4ae9e4){_0x13f7b5[_0xe8be('0x4a')]=_0x4ae9e4;return _0x13f7b5;})['then'](respondWithFilteredResult(_0x2cc3ba,_0x522c4d))[_0xe8be('0x25')](handleError(_0x2cc3ba,null));};exports['show']=function(_0x4577ef,_0x204245){var _0x4fe15e={'raw':![],'where':{'id':_0x4577ef['params']['id']}},_0x25acca={};_0x25acca[_0xe8be('0x37')]=_[_0xe8be('0x4b')](db[_0xe8be('0x46')][_0xe8be('0x36')]);_0x25acca['query']=_['keys'](_0x4577ef[_0xe8be('0x38')]);_0x25acca[_0xe8be('0x39')]=_[_0xe8be('0x3a')](_0x25acca[_0xe8be('0x37')],_0x25acca['query']);_0x4fe15e[_0xe8be('0x3b')]=_[_0xe8be('0x3a')](_0x25acca[_0xe8be('0x37')],qs[_0xe8be('0x3c')](_0x4577ef['query'][_0xe8be('0x3c')]));_0x4fe15e[_0xe8be('0x3b')]=_0x4fe15e['attributes'][_0xe8be('0x3d')]?_0x4fe15e['attributes']:_0x25acca['model'];if(_0x4577ef[_0xe8be('0x38')][_0xe8be('0x47')]){_0x4fe15e[_0xe8be('0x48')]=[{'all':!![]}];}_0x4fe15e=_[_0xe8be('0x43')]({},_0x4fe15e,_0x4577ef['options']);return db[_0xe8be('0x46')][_0xe8be('0x4c')](_0x4fe15e)[_0xe8be('0x1c')](handleEntityNotFound(_0x204245,null))[_0xe8be('0x1c')](respondWithResult(_0x204245,null))[_0xe8be('0x25')](handleError(_0x204245,null));};exports['create']=function(_0x5eaa65,_0x396f57){return db['ZohoAccount'][_0xe8be('0x4d')](_0x5eaa65[_0xe8be('0x4e')],{})[_0xe8be('0x1c')](respondWithResult(_0x396f57,0xc9))['catch'](handleError(_0x396f57,null));};exports[_0xe8be('0x4f')]=function(_0x355604,_0x1b4af7){if(_0x355604['body']['id']){delete _0x355604[_0xe8be('0x4e')]['id'];}return db[_0xe8be('0x46')][_0xe8be('0x4c')]({'where':{'id':_0x355604[_0xe8be('0x50')]['id']}})[_0xe8be('0x1c')](handleEntityNotFound(_0x1b4af7,null))[_0xe8be('0x1c')](saveUpdates(_0x355604[_0xe8be('0x4e')],null))[_0xe8be('0x1c')](respondWithResult(_0x1b4af7,null))[_0xe8be('0x25')](handleError(_0x1b4af7,null));};exports[_0xe8be('0x30')]=function(_0x2df838,_0x39a7d7){return db[_0xe8be('0x46')][_0xe8be('0x4c')]({'where':{'id':_0x2df838[_0xe8be('0x50')]['id']}})[_0xe8be('0x1c')](handleEntityNotFound(_0x39a7d7,null))[_0xe8be('0x1c')](removeEntity(_0x39a7d7,null))[_0xe8be('0x25')](handleError(_0x39a7d7,null));};exports['getConfigurations']=function(_0x57ca6b,_0x4cf23c,_0x17dab7){var _0x16a7a7={};var _0x3ddda3={};var _0x57b4a8;var _0x354c52;return db['ZohoAccount']['findOne']({'where':{'id':_0x57ca6b[_0xe8be('0x50')]['id']}})['then'](handleEntityNotFound(_0x4cf23c,null))[_0xe8be('0x1c')](function(_0x5309e7){if(_0x5309e7){_0x57b4a8=_0x5309e7;_0x3ddda3[_0xe8be('0x37')]=_[_0xe8be('0x4b')](db[_0xe8be('0x51')][_0xe8be('0x36')]);_0x3ddda3['query']=_[_0xe8be('0x4b')](_0x57ca6b[_0xe8be('0x38')]);_0x3ddda3[_0xe8be('0x39')]=_[_0xe8be('0x3a')](_0x3ddda3[_0xe8be('0x37')],_0x3ddda3[_0xe8be('0x38')]);_0x16a7a7[_0xe8be('0x3b')]=_[_0xe8be('0x3a')](_0x3ddda3[_0xe8be('0x37')],qs['fields'](_0x57ca6b[_0xe8be('0x38')][_0xe8be('0x3c')]));_0x16a7a7[_0xe8be('0x3b')]=_0x16a7a7[_0xe8be('0x3b')]['length']?_0x16a7a7['attributes']:_0x3ddda3[_0xe8be('0x37')];_0x16a7a7[_0xe8be('0x3f')]=qs[_0xe8be('0x52')](_0x57ca6b[_0xe8be('0x38')][_0xe8be('0x52')]);_0x16a7a7['where']=qs['filters'](_['pick'](_0x57ca6b[_0xe8be('0x38')],_0x3ddda3[_0xe8be('0x39')]));if(_0x57ca6b['query'][_0xe8be('0x42')]){_0x16a7a7[_0xe8be('0x40')]=_['merge'](_0x16a7a7[_0xe8be('0x40')],{'$or':_[_0xe8be('0x35')](_0x16a7a7[_0xe8be('0x3b')],function(_0x33a2eb){var _0x2710df={};_0x2710df[_0x33a2eb]={'$like':'%'+_0x57ca6b[_0xe8be('0x38')]['filter']+'%'};return _0x2710df;})});}_0x16a7a7=_[_0xe8be('0x43')]({},_0x16a7a7,_0x57ca6b[_0xe8be('0x45')]);return _0x57b4a8[_0xe8be('0x53')](_0x16a7a7);}})['then'](function(_0x9dd133){if(_0x9dd133){_0x354c52=_0x9dd133['length'];if(!_0x57ca6b[_0xe8be('0x38')][_0xe8be('0x54')](_0xe8be('0x3e'))){_0x16a7a7['limit']=qs[_0xe8be('0x2b')](_0x57ca6b['query'][_0xe8be('0x2b')]);_0x16a7a7[_0xe8be('0x29')]=qs['offset'](_0x57ca6b[_0xe8be('0x38')]['offset']);}return _0x57b4a8[_0xe8be('0x53')](_0x16a7a7);}})['then'](function(_0x227abc){if(_0x227abc){return _0x227abc?{'count':_0x354c52,'rows':_0x227abc}:null;}})[_0xe8be('0x1c')](respondWithResult(_0x4cf23c,null))[_0xe8be('0x25')](handleError(_0x4cf23c,null));};exports['addConfiguration']=function(_0x16d48d,_0x105d70,_0x53a028){if(_0x16d48d['body']['id']){delete _0x16d48d[_0xe8be('0x4e')]['id'];}return db[_0xe8be('0x46')][_0xe8be('0x55')]({'where':{'id':_0x16d48d[_0xe8be('0x50')]['id']}})['then'](handleEntityNotFound(_0x105d70,null))[_0xe8be('0x1c')](function(_0x2a97b5){if(_0x2a97b5){_0x16d48d[_0xe8be('0x4e')]['AccountId']=_0x2a97b5['id'];_0x16d48d['body'][_0xe8be('0x56')]=integrations[_0xe8be('0x57')](_0x16d48d[_0xe8be('0x4e')][_0xe8be('0x58')],_0x16d48d[_0xe8be('0x4e')][_0xe8be('0x59')]);_0x16d48d[_0xe8be('0x4e')][_0xe8be('0x5a')]=integrations[_0xe8be('0x5b')](_0x16d48d['body'][_0xe8be('0x58')],_0x16d48d['body'][_0xe8be('0x59')]);return db['ZohoConfiguration'][_0xe8be('0x4d')](_0x16d48d[_0xe8be('0x4e')],{'include':[{'model':db[_0xe8be('0x5c')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xe8be('0x5a')}]});}return null;})[_0xe8be('0x1c')](respondWithResult(_0x105d70,null))[_0xe8be('0x25')](handleError(_0x105d70,null));};function getAccessToken(_0x15ba62){return new Promise(function(_0xf761d6,_0x2bf481){var _0x44068d;switch(_0x15ba62[_0xe8be('0x5d')]){case'US':_0x44068d=_0xe8be('0x5e');break;case'AU':_0x44068d=_0xe8be('0x5f');break;case'EU':_0x44068d=_0xe8be('0x60');break;case'IN':_0x44068d=_0xe8be('0x61');break;case'CN':_0x44068d=_0xe8be('0x62');break;default:_0x44068d=_0xe8be('0x60');break;}var _0x3c4c17={'method':_0xe8be('0x63'),'uri':_0x44068d+_0xe8be('0x64'),'qs':{'refresh_token':_0x15ba62[_0xe8be('0x65')],'client_id':_0x15ba62[_0xe8be('0x66')],'client_secret':_0x15ba62[_0xe8be('0x67')],'grant_type':_0xe8be('0x68')},'json':!![]};return rp(_0x3c4c17)[_0xe8be('0x1c')](function(_0x5a32cc){if(_0x5a32cc[_0xe8be('0x69')]){_0xf761d6(_0x5a32cc[_0xe8be('0x69')]);}else{_0x2bf481(_0xe8be('0x6a'));}})[_0xe8be('0x25')](function(_0x945620){_0x2bf481(_0x945620);});});}exports[_0xe8be('0x6b')]=function(_0x4ab010,_0x203255,_0x3be272){var _0x2054ae,_0x4bdfb5,_0x45d59d,_0x38e282,_0x5cd123;return db[_0xe8be('0x46')][_0xe8be('0x55')]({'where':{'id':_0x4ab010[_0xe8be('0x50')]['id']},'attributes':['id','host',_0xe8be('0x5d'),_0xe8be('0x66'),'clientSecret',_0xe8be('0x6c'),_0xe8be('0x6d'),_0xe8be('0x65')]})[_0xe8be('0x1c')](handleEntityNotFound(_0x203255,null))['then'](function(_0x2a3fe6){_0x5cd123=_0x2a3fe6;_0x2054ae=_0x5cd123['host'];_0x4bdfb5=_0x2054ae===_0xe8be('0x6e')?'eu':'com';_0x45d59d=_0x5cd123[_0xe8be('0x6c')];var _0x12e606=_0x45d59d['slice'](-0x1);if(_0x12e606==='/'||_0x12e606==='\x5c'||_0x12e606===':'){_0x45d59d=_0x45d59d['substring'](0x0,_0x45d59d[_0xe8be('0x6f')](_0x12e606));}if(!_0x5cd123[_0xe8be('0x65')]){throw new Error(_0xe8be('0x70'));}return getAccessToken(_0x5cd123);})[_0xe8be('0x1c')](function(_0x6746b2){if(_0x6746b2){return rp({'method':_0xe8be('0x71'),'uri':util[_0xe8be('0x72')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4bdfb5),'qs':{'module':'Calls'},'headers':{'Authorization':_0xe8be('0x73')+_0x6746b2},'json':!![]});}})[_0xe8be('0x1c')](function(_0x483c62){if(_0x483c62){if(_0x483c62[_0xe8be('0x74')]&&_0x483c62[_0xe8be('0x74')][_0xe8be('0x21')]){throw new Error(_0x483c62['response'][_0xe8be('0x21')][_0xe8be('0x23')]);}var _0xcb31=[];var _0x105f30=[];var _0x1b2693=['Owner',_0xe8be('0x75'),_0xe8be('0x76'),_0xe8be('0x77'),_0xe8be('0x78'),_0xe8be('0x79'),_0xe8be('0x7a'),_0xe8be('0x7b')];_0x105f30=_['remove'](_0x483c62['fields'],function(_0x58dbbf){return _0x1b2693[_0xe8be('0x7c')](_0x58dbbf[_0xe8be('0x7d')]);});for(var _0x35b757=0x0;_0x35b757<_0x105f30[_0xe8be('0x3d')];_0x35b757++){if(_0x105f30[_0x35b757][_0xe8be('0x7e')]===![]){_0xcb31[_0xe8be('0x7f')]({'id':_0x105f30[_0x35b757]['id'],'name':_0x105f30[_0x35b757][_0xe8be('0x80')],'custom':_0x105f30[_0x35b757][_0xe8be('0x81')],'options':_0x105f30[_0x35b757][_0xe8be('0x82')]===_0xe8be('0x83')&&_0x105f30[_0x35b757][_0xe8be('0x84')][_0xe8be('0x3d')]>-0x1?_[_0xe8be('0x35')](_0x105f30[_0x35b757][_0xe8be('0x84')],function(_0x29e707){return{'name':_0x29e707,'value':_0x29e707};}):[]});}}return{'count':_0xcb31[_0xe8be('0x3d')],'rows':_0xcb31};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x203255,null))[_0xe8be('0x25')](function(_0x499e34){var _0x38f78e=_0x4ab010['query'][_0xe8be('0x85')]?0x1f4:_0x499e34[_0xe8be('0x86')]||0x1f4;logger['error'](_0xe8be('0x87'),_0xe8be('0x6b'),_0x38f78e,JSON[_0xe8be('0x20')](_0x499e34));delete _0x499e34[_0xe8be('0x33')];if(_0x38f78e===0x191){_0x38f78e=0x190;}_0x203255[_0xe8be('0x27')](_0x38f78e)[_0xe8be('0x34')](_0x4ab010[_0xe8be('0x38')]['test']?{'message':_0xe8be('0x88'),'statusCode':_0x499e34[_0xe8be('0x86')]}:_0x499e34);});};
\ No newline at end of file
index ae6f7ab..3ada302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86a7=['refresh_token','refreshToken','info','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','application/x-www-form-urlencoded','parse','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','util','api','path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','zone','serverUrl','changed','clientId','clientSecret','code','host','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','then'];(function(_0x4f93a9,_0x2793c3){var _0x8fab33=function(_0x35bb8e){while(--_0x35bb8e){_0x4f93a9['push'](_0x4f93a9['shift']());}};_0x8fab33(++_0x2793c3);}(_0x86a7,0xe3));var _0x786a=function(_0x1aae6a,_0x56bb19){_0x1aae6a=_0x1aae6a-0x0;var _0x297a71=_0x86a7[_0x1aae6a];return _0x297a71;};'use strict';var _=require('lodash');var util=require(_0x786a('0x0'));var logger=require('../../config/logger')(_0x786a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x786a('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x786a('0x3'));var integrations=require(_0x786a('0x4'));module[_0x786a('0x5')]=function(_0x5d5b8b,_0x44b52f){return _0x5d5b8b['define'](_0x786a('0x6'),attributes,{'tableName':_0x786a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x409920,_0x52db1c,_0x658903){if(_0x409920['changed'](_0x786a('0x8'))||_0x409920['changed'](_0x786a('0x9'))||_0x409920[_0x786a('0xa')](_0x786a('0xb'))||_0x409920['changed'](_0x786a('0xc'))||_0x409920[_0x786a('0xa')](_0x786a('0xd'))||_0x409920[_0x786a('0xa')](_0x786a('0xe'))){var _0x59de73,_0x2ed842;_0x59de73=_0x409920['serverUrl'];var _0x25ad1d=_0x59de73[_0x786a('0xf')](-0x1);if(_0x25ad1d==='/'||_0x25ad1d==='\x5c'||_0x25ad1d===':'){_0x59de73=_0x59de73[_0x786a('0x10')](0x0,_0x59de73['lastIndexOf'](_0x25ad1d));}switch(_0x409920[_0x786a('0x8')]){case'US':_0x2ed842=_0x786a('0x11');break;case'AU':_0x2ed842=_0x786a('0x12');break;case'IN':_0x2ed842=_0x786a('0x13');break;case'CN':_0x2ed842=_0x786a('0x14');break;default:_0x2ed842=_0x786a('0x15');break;}var _0x2778a9={'method':_0x786a('0x16'),'uri':_0x2ed842+'/oauth/v2/token','form':{'grant_type':_0x786a('0x17'),'client_id':_0x409920[_0x786a('0xb')],'client_secret':_0x409920[_0x786a('0xc')],'redirect_uri':_0x409920[_0x786a('0x9')],'code':_0x409920['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2778a9)[_0x786a('0x18')](function(_0x145eac){var _0x46142e=JSON['parse'](_0x145eac);if(_0x46142e[_0x786a('0x19')]){_0x409920[_0x786a('0x1a')]=_0x46142e['refresh_token'];logger[_0x786a('0x1b')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x409920[_0x786a('0x1c')],_0x409920['id']));}else{logger[_0x786a('0x1d')](util[_0x786a('0x1e')](_0x786a('0x1f'),_0x409920[_0x786a('0x1c')],_0x409920['id']),util[_0x786a('0x20')](_0x46142e,{'showHidden':![],'depth':null}));}return _0x658903(null,_0x52db1c);})['catch'](function(_0x58fead){logger[_0x786a('0x1d')](util['format'](_0x786a('0x1f'),_0x409920[_0x786a('0x1c')],_0x409920['id']),util[_0x786a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x658903(_0x58fead);});}else{return _0x658903(null,_0x52db1c);}},'beforeUpdate':function(_0x1ae55d,_0x11ec3a,_0x2f5ae7){if(_0x1ae55d[_0x786a('0xa')](_0x786a('0x8'))||_0x1ae55d[_0x786a('0xa')](_0x786a('0x9'))||_0x1ae55d['changed']('clientId')||_0x1ae55d[_0x786a('0xa')]('clientSecret')||_0x1ae55d[_0x786a('0xa')]('code')||_0x1ae55d[_0x786a('0xa')]('host')){var _0x3b34e1,_0xb8d23d;_0x3b34e1=_0x1ae55d[_0x786a('0x9')];var _0x75e8a7=_0x3b34e1[_0x786a('0xf')](-0x1);if(_0x75e8a7==='/'||_0x75e8a7==='\x5c'||_0x75e8a7===':'){_0x3b34e1=_0x3b34e1[_0x786a('0x10')](0x0,_0x3b34e1['lastIndexOf'](_0x75e8a7));}switch(_0x1ae55d[_0x786a('0x8')]){case'US':_0xb8d23d='https://accounts.zoho.com';break;case'AU':_0xb8d23d=_0x786a('0x12');break;case'IN':_0xb8d23d='https://accounts.zoho.in';break;case'CN':_0xb8d23d='https://accounts.zoho.com.cn';break;default:_0xb8d23d='https://accounts.zoho.eu';break;}var _0x48d8d1={'method':'POST','uri':_0xb8d23d+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x1ae55d[_0x786a('0xb')],'client_secret':_0x1ae55d['clientSecret'],'redirect_uri':_0x1ae55d[_0x786a('0x9')],'code':_0x1ae55d[_0x786a('0xd')]},'headers':{'Content-Type':_0x786a('0x21')}};return rp(_0x48d8d1)['then'](function(_0x5eae7a){var _0x38afcf=JSON[_0x786a('0x22')](_0x5eae7a);if(_0x38afcf[_0x786a('0x19')]){_0x1ae55d['refreshToken']=_0x38afcf[_0x786a('0x19')];logger['info'](util[_0x786a('0x1e')](_0x786a('0x23'),_0x1ae55d[_0x786a('0x1c')],_0x1ae55d['id']));}else{logger[_0x786a('0x1d')](util[_0x786a('0x1e')](_0x786a('0x1f'),_0x1ae55d[_0x786a('0x1c')],_0x1ae55d['id']),util[_0x786a('0x20')](_0x38afcf,{'showHidden':![],'depth':null}));}return _0x2f5ae7(null,_0x11ec3a);})['catch'](function(_0x19a834){logger['error'](util[_0x786a('0x1e')](_0x786a('0x1f'),_0x1ae55d['name'],_0x1ae55d['id']),util[_0x786a('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x2f5ae7(_0x19a834);});}else{return _0x2f5ae7(null,_0x11ec3a);}}}});};
\ No newline at end of file
+var _0xae4c=['substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','host','slice'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0xae4c,0x96));var _0xcae4=function(_0x4ef77b,_0x6a3df){_0x4ef77b=_0x4ef77b-0x0;var _0x58d1a6=_0xae4c[_0x4ef77b];return _0x58d1a6;};'use strict';var _=require(_0xcae4('0x0'));var util=require(_0xcae4('0x1'));var logger=require(_0xcae4('0x2'))(_0xcae4('0x3'));var moment=require(_0xcae4('0x4'));var BPromise=require(_0xcae4('0x5'));var rp=require(_0xcae4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcae4('0x7'));var config=require('../../config/environment');var attributes=require(_0xcae4('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xcae4('0x9')]=function(_0x2d02f3,_0x1f42e1){return _0x2d02f3['define'](_0xcae4('0xa'),attributes,{'tableName':_0xcae4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1bc52b,_0x3efa5a,_0x13707a){if(_0x1bc52b[_0xcae4('0xc')](_0xcae4('0xd'))||_0x1bc52b[_0xcae4('0xc')](_0xcae4('0xe'))||_0x1bc52b[_0xcae4('0xc')](_0xcae4('0xf'))||_0x1bc52b[_0xcae4('0xc')]('clientSecret')||_0x1bc52b['changed']('code')||_0x1bc52b[_0xcae4('0xc')](_0xcae4('0x10'))){var _0x503f81,_0x386247;_0x503f81=_0x1bc52b[_0xcae4('0xe')];var _0x20af53=_0x503f81[_0xcae4('0x11')](-0x1);if(_0x20af53==='/'||_0x20af53==='\x5c'||_0x20af53===':'){_0x503f81=_0x503f81[_0xcae4('0x12')](0x0,_0x503f81['lastIndexOf'](_0x20af53));}switch(_0x1bc52b[_0xcae4('0xd')]){case'US':_0x386247=_0xcae4('0x13');break;case'AU':_0x386247=_0xcae4('0x14');break;case'IN':_0x386247='https://accounts.zoho.in';break;case'CN':_0x386247=_0xcae4('0x15');break;default:_0x386247=_0xcae4('0x16');break;}var _0x10875f={'method':_0xcae4('0x17'),'uri':_0x386247+_0xcae4('0x18'),'form':{'grant_type':_0xcae4('0x19'),'client_id':_0x1bc52b['clientId'],'client_secret':_0x1bc52b[_0xcae4('0x1a')],'redirect_uri':_0x1bc52b[_0xcae4('0xe')],'code':_0x1bc52b[_0xcae4('0x1b')]},'headers':{'Content-Type':_0xcae4('0x1c')}};return rp(_0x10875f)[_0xcae4('0x1d')](function(_0x3cf8e8){var _0x3d3721=JSON[_0xcae4('0x1e')](_0x3cf8e8);if(_0x3d3721[_0xcae4('0x1f')]){_0x1bc52b[_0xcae4('0x20')]=_0x3d3721[_0xcae4('0x1f')];logger[_0xcae4('0x21')](util[_0xcae4('0x22')](_0xcae4('0x23'),_0x1bc52b[_0xcae4('0x24')],_0x1bc52b['id']));}else{logger[_0xcae4('0x25')](util[_0xcae4('0x22')](_0xcae4('0x26'),_0x1bc52b[_0xcae4('0x24')],_0x1bc52b['id']),util[_0xcae4('0x27')](_0x3d3721,{'showHidden':![],'depth':null}));}return _0x13707a(null,_0x3efa5a);})[_0xcae4('0x28')](function(_0x27639e){logger[_0xcae4('0x25')](util['format'](_0xcae4('0x26'),_0x1bc52b[_0xcae4('0x24')],_0x1bc52b['id']),util[_0xcae4('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x13707a(_0x27639e);});}else{return _0x13707a(null,_0x3efa5a);}},'beforeUpdate':function(_0x5f38b3,_0x557f24,_0x59b9c6){if(_0x5f38b3[_0xcae4('0xc')](_0xcae4('0xd'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0xe'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0xf'))||_0x5f38b3['changed'](_0xcae4('0x1a'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0x1b'))||_0x5f38b3[_0xcae4('0xc')](_0xcae4('0x10'))){var _0xa6867e,_0x37fe6d;_0xa6867e=_0x5f38b3[_0xcae4('0xe')];var _0x43b4a4=_0xa6867e[_0xcae4('0x11')](-0x1);if(_0x43b4a4==='/'||_0x43b4a4==='\x5c'||_0x43b4a4===':'){_0xa6867e=_0xa6867e[_0xcae4('0x12')](0x0,_0xa6867e['lastIndexOf'](_0x43b4a4));}switch(_0x5f38b3[_0xcae4('0xd')]){case'US':_0x37fe6d=_0xcae4('0x13');break;case'AU':_0x37fe6d='https://accounts.zoho.com.au';break;case'IN':_0x37fe6d=_0xcae4('0x29');break;case'CN':_0x37fe6d='https://accounts.zoho.com.cn';break;default:_0x37fe6d='https://accounts.zoho.eu';break;}var _0x4b5f28={'method':_0xcae4('0x17'),'uri':_0x37fe6d+'/oauth/v2/token','form':{'grant_type':_0xcae4('0x19'),'client_id':_0x5f38b3[_0xcae4('0xf')],'client_secret':_0x5f38b3[_0xcae4('0x1a')],'redirect_uri':_0x5f38b3[_0xcae4('0xe')],'code':_0x5f38b3[_0xcae4('0x1b')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4b5f28)[_0xcae4('0x1d')](function(_0x120d60){var _0x97ea21=JSON['parse'](_0x120d60);if(_0x97ea21[_0xcae4('0x1f')]){_0x5f38b3['refreshToken']=_0x97ea21[_0xcae4('0x1f')];logger[_0xcae4('0x21')](util[_0xcae4('0x22')](_0xcae4('0x23'),_0x5f38b3[_0xcae4('0x24')],_0x5f38b3['id']));}else{logger[_0xcae4('0x25')](util[_0xcae4('0x22')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5f38b3[_0xcae4('0x24')],_0x5f38b3['id']),util['inspect'](_0x97ea21,{'showHidden':![],'depth':null}));}return _0x59b9c6(null,_0x557f24);})[_0xcae4('0x28')](function(_0x4e3aa3){logger[_0xcae4('0x25')](util['format'](_0xcae4('0x26'),_0x5f38b3[_0xcae4('0x24')],_0x5f38b3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x59b9c6(_0x4e3aa3);});}else{return _0x59b9c6(null,_0x557f24);}}}});};
\ No newline at end of file
index 4d0c434..bf1c6ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc7a=['include','model','attributes','map','GetZohoAccount','ShowZohoAccount','find','where','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','ZohoAccount','options'];(function(_0x1d7743,_0x2e45f4){var _0xc6663c=function(_0x95c054){while(--_0x95c054){_0x1d7743['push'](_0x1d7743['shift']());}};_0xc6663c(++_0x2e45f4);}(_0xbc7a,0xa4));var _0xabc7=function(_0x19c612,_0x15860f){_0x19c612=_0x19c612-0x0;var _0x546e1c=_0xbc7a[_0x19c612];return _0x546e1c;};'use strict';var _=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var moment=require(_0xabc7('0x2'));var BPromise=require('bluebird');var rs=require(_0xabc7('0x3'));var fs=require('fs');var Redis=require(_0xabc7('0x4'));var db=require(_0xabc7('0x5'))['db'];var utils=require(_0xabc7('0x6'));var logger=require(_0xabc7('0x7'))(_0xabc7('0x8'));var config=require('../../config/environment');var jayson=require(_0xabc7('0x9'));var client=jayson[_0xabc7('0xa')][_0xabc7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28396c,_0x54a7d4,_0x2536d1){return new BPromise(function(_0x5b6d13,_0x441642){return client['request'](_0x28396c,_0x2536d1)[_0xabc7('0xc')](function(_0x2d15b4){logger[_0xabc7('0xd')](_0xabc7('0xe'),_0x54a7d4,_0xabc7('0xf'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x54a7d4,_0xabc7('0xf'),JSON['stringify'](_0x2d15b4));if(_0x2d15b4[_0xabc7('0x10')]){if(_0x2d15b4[_0xabc7('0x10')][_0xabc7('0x11')]===0x1f4){logger['error'](_0xabc7('0xe'),_0x54a7d4,_0x2d15b4[_0xabc7('0x10')]['message']);return _0x441642(_0x2d15b4['error'][_0xabc7('0x12')]);}logger[_0xabc7('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x54a7d4,_0x2d15b4[_0xabc7('0x10')]['message']);return _0x5b6d13(_0x2d15b4[_0xabc7('0x10')][_0xabc7('0x12')]);}else{logger[_0xabc7('0xd')](_0xabc7('0xe'),_0x54a7d4,'request\x20sent');_0x5b6d13(_0x2d15b4['result'][_0xabc7('0x12')]);}})[_0xabc7('0x13')](function(_0x4216a2){logger[_0xabc7('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x54a7d4,_0x4216a2);_0x441642(_0x4216a2);});});}exports['GetZohoAccount']=function(_0x4184e1){var _0x181dd6=this;return new Promise(function(_0x541a68,_0x31b9ed){return db[_0xabc7('0x14')]['findAll']({'raw':_0x4184e1[_0xabc7('0x15')]?_0x4184e1[_0xabc7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4184e1[_0xabc7('0x15')]?_0x4184e1['options']['where']||null:null,'attributes':_0x4184e1['options']?_0x4184e1[_0xabc7('0x15')]['attributes']||null:null,'limit':_0x4184e1[_0xabc7('0x15')]?_0x4184e1['options']['limit']||null:null,'include':_0x4184e1[_0xabc7('0x15')]?_0x4184e1[_0xabc7('0x15')][_0xabc7('0x16')]?_['map'](_0x4184e1[_0xabc7('0x15')][_0xabc7('0x16')],function(_0x34dcc8){return{'model':db[_0x34dcc8[_0xabc7('0x17')]],'as':_0x34dcc8['as'],'attributes':_0x34dcc8[_0xabc7('0x18')],'include':_0x34dcc8[_0xabc7('0x16')]?_[_0xabc7('0x19')](_0x34dcc8[_0xabc7('0x16')],function(_0x924f1b){return{'model':db[_0x924f1b['model']],'as':_0x924f1b['as'],'attributes':_0x924f1b[_0xabc7('0x18')],'include':_0x924f1b[_0xabc7('0x16')]?_[_0xabc7('0x19')](_0x924f1b['include'],function(_0xc42c6d){return{'model':db[_0xc42c6d['model']],'as':_0xc42c6d['as'],'attributes':_0xc42c6d[_0xabc7('0x18')]};}):[]};}):[]};}):[]:[]})[_0xabc7('0xc')](function(_0x305cdb){logger[_0xabc7('0xd')]('GetZohoAccount',_0x4184e1);logger['debug'](_0xabc7('0x1a'),_0x4184e1,JSON['stringify'](_0x305cdb));_0x541a68(_0x305cdb);})['catch'](function(_0x1fdbea){logger[_0xabc7('0x10')](_0xabc7('0x1a'),_0x1fdbea[_0xabc7('0x12')],_0x4184e1);_0x31b9ed(_0x181dd6[_0xabc7('0x10')](0x1f4,_0x1fdbea[_0xabc7('0x12')]));});});};exports[_0xabc7('0x1b')]=function(_0x43b4a9){var _0x415dfd=this;return new Promise(function(_0xdcb9aa,_0x516805){return db['ZohoAccount'][_0xabc7('0x1c')]({'raw':_0x43b4a9[_0xabc7('0x15')]?_0x43b4a9[_0xabc7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x43b4a9['options']?_0x43b4a9['options'][_0xabc7('0x1d')]||null:null,'attributes':_0x43b4a9[_0xabc7('0x15')]?_0x43b4a9[_0xabc7('0x15')][_0xabc7('0x18')]||null:null,'include':_0x43b4a9[_0xabc7('0x15')]?_0x43b4a9[_0xabc7('0x15')][_0xabc7('0x16')]?_[_0xabc7('0x19')](_0x43b4a9[_0xabc7('0x15')][_0xabc7('0x16')],function(_0x371cbb){return{'model':db[_0x371cbb[_0xabc7('0x17')]],'as':_0x371cbb['as'],'attributes':_0x371cbb[_0xabc7('0x18')],'include':_0x371cbb[_0xabc7('0x16')]?_[_0xabc7('0x19')](_0x371cbb['include'],function(_0x3da004){return{'model':db[_0x3da004[_0xabc7('0x17')]],'as':_0x3da004['as'],'attributes':_0x3da004[_0xabc7('0x18')],'include':_0x3da004[_0xabc7('0x16')]?_[_0xabc7('0x19')](_0x3da004[_0xabc7('0x16')],function(_0x4a6918){return{'model':db[_0x4a6918[_0xabc7('0x17')]],'as':_0x4a6918['as'],'attributes':_0x4a6918[_0xabc7('0x18')]};}):[]};}):[]};}):[]:[]})[_0xabc7('0xc')](function(_0x5e8153){logger[_0xabc7('0xd')]('ShowZohoAccount',_0x43b4a9);logger['debug'](_0xabc7('0x1b'),_0x43b4a9,JSON[_0xabc7('0x1e')](_0x5e8153));_0xdcb9aa(_0x5e8153);})['catch'](function(_0x1f3c8a){logger[_0xabc7('0x10')](_0xabc7('0x1b'),_0x1f3c8a[_0xabc7('0x12')],_0x43b4a9);_0x516805(_0x415dfd[_0xabc7('0x10')](0x1f4,_0x1f3c8a[_0xabc7('0x12')]));});});};
\ No newline at end of file
+var _0x79a3=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','ZohoAccount','findAll','options','where','attributes','limit','include','map','model','GetZohoAccount','stringify','catch','ShowZohoAccount','find','raw','debug','lodash','moment','bluebird','ioredis'];(function(_0x327394,_0x5abcc9){var _0x306213=function(_0x73c8de){while(--_0x73c8de){_0x327394['push'](_0x327394['shift']());}};_0x306213(++_0x5abcc9);}(_0x79a3,0x80));var _0x379a=function(_0x341781,_0x207d7e){_0x341781=_0x341781-0x0;var _0x2f9145=_0x79a3[_0x341781];return _0x2f9145;};'use strict';var _=require(_0x379a('0x0'));var util=require('util');var moment=require(_0x379a('0x1'));var BPromise=require(_0x379a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x379a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x379a('0x4'));var config=require(_0x379a('0x5'));var jayson=require(_0x379a('0x6'));var client=jayson[_0x379a('0x7')][_0x379a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eacbe,_0x4d0435,_0x484a91){return new BPromise(function(_0x23e684,_0x11d27d){return client[_0x379a('0x9')](_0x4eacbe,_0x484a91)[_0x379a('0xa')](function(_0x37a440){logger[_0x379a('0xb')](_0x379a('0xc'),_0x4d0435,'request\x20sent');logger['debug'](_0x379a('0xd'),_0x4d0435,'request\x20sent',JSON['stringify'](_0x37a440));if(_0x37a440[_0x379a('0xe')]){if(_0x37a440[_0x379a('0xe')][_0x379a('0xf')]===0x1f4){logger[_0x379a('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4d0435,_0x37a440['error']['message']);return _0x11d27d(_0x37a440[_0x379a('0xe')][_0x379a('0x10')]);}logger[_0x379a('0xe')](_0x379a('0xc'),_0x4d0435,_0x37a440['error']['message']);return _0x23e684(_0x37a440[_0x379a('0xe')][_0x379a('0x10')]);}else{logger[_0x379a('0xb')](_0x379a('0xc'),_0x4d0435,'request\x20sent');_0x23e684(_0x37a440['result'][_0x379a('0x10')]);}})['catch'](function(_0x3124f1){logger[_0x379a('0xe')](_0x379a('0xc'),_0x4d0435,_0x3124f1);_0x11d27d(_0x3124f1);});});}exports['GetZohoAccount']=function(_0x48f0a9){var _0x3f994d=this;return new Promise(function(_0xd6cc17,_0x499923){return db[_0x379a('0x11')][_0x379a('0x12')]({'raw':_0x48f0a9['options']?_0x48f0a9['options']['raw']===undefined?!![]:![]:!![],'where':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9['options'][_0x379a('0x14')]||null:null,'attributes':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9[_0x379a('0x13')][_0x379a('0x15')]||null:null,'limit':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9[_0x379a('0x13')][_0x379a('0x16')]||null:null,'include':_0x48f0a9[_0x379a('0x13')]?_0x48f0a9['options'][_0x379a('0x17')]?_[_0x379a('0x18')](_0x48f0a9[_0x379a('0x13')][_0x379a('0x17')],function(_0x31752c){return{'model':db[_0x31752c[_0x379a('0x19')]],'as':_0x31752c['as'],'attributes':_0x31752c[_0x379a('0x15')],'include':_0x31752c['include']?_[_0x379a('0x18')](_0x31752c[_0x379a('0x17')],function(_0x18bb37){return{'model':db[_0x18bb37['model']],'as':_0x18bb37['as'],'attributes':_0x18bb37['attributes'],'include':_0x18bb37[_0x379a('0x17')]?_['map'](_0x18bb37[_0x379a('0x17')],function(_0xc1fc5a){return{'model':db[_0xc1fc5a['model']],'as':_0xc1fc5a['as'],'attributes':_0xc1fc5a[_0x379a('0x15')]};}):[]};}):[]};}):[]:[]})[_0x379a('0xa')](function(_0x19f945){logger['info'](_0x379a('0x1a'),_0x48f0a9);logger['debug'](_0x379a('0x1a'),_0x48f0a9,JSON[_0x379a('0x1b')](_0x19f945));_0xd6cc17(_0x19f945);})[_0x379a('0x1c')](function(_0x3f92b1){logger['error'](_0x379a('0x1a'),_0x3f92b1[_0x379a('0x10')],_0x48f0a9);_0x499923(_0x3f994d[_0x379a('0xe')](0x1f4,_0x3f92b1[_0x379a('0x10')]));});});};exports[_0x379a('0x1d')]=function(_0x5c68f2){var _0x23a45b=this;return new Promise(function(_0x37f538,_0x16d8a1){return db[_0x379a('0x11')][_0x379a('0x1e')]({'raw':_0x5c68f2['options']?_0x5c68f2[_0x379a('0x13')][_0x379a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c68f2[_0x379a('0x13')]?_0x5c68f2[_0x379a('0x13')][_0x379a('0x14')]||null:null,'attributes':_0x5c68f2[_0x379a('0x13')]?_0x5c68f2['options']['attributes']||null:null,'include':_0x5c68f2[_0x379a('0x13')]?_0x5c68f2['options'][_0x379a('0x17')]?_[_0x379a('0x18')](_0x5c68f2[_0x379a('0x13')]['include'],function(_0x5525ba){return{'model':db[_0x5525ba[_0x379a('0x19')]],'as':_0x5525ba['as'],'attributes':_0x5525ba[_0x379a('0x15')],'include':_0x5525ba[_0x379a('0x17')]?_[_0x379a('0x18')](_0x5525ba['include'],function(_0xdaf60f){return{'model':db[_0xdaf60f[_0x379a('0x19')]],'as':_0xdaf60f['as'],'attributes':_0xdaf60f[_0x379a('0x15')],'include':_0xdaf60f[_0x379a('0x17')]?_['map'](_0xdaf60f[_0x379a('0x17')],function(_0x415b6f){return{'model':db[_0x415b6f[_0x379a('0x19')]],'as':_0x415b6f['as'],'attributes':_0x415b6f[_0x379a('0x15')]};}):[]};}):[]};}):[]:[]})[_0x379a('0xa')](function(_0x297e63){logger[_0x379a('0xb')](_0x379a('0x1d'),_0x5c68f2);logger[_0x379a('0x20')](_0x379a('0x1d'),_0x5c68f2,JSON['stringify'](_0x297e63));_0x37f538(_0x297e63);})[_0x379a('0x1c')](function(_0x3111bd){logger[_0x379a('0xe')]('ShowZohoAccount',_0x3111bd[_0x379a('0x10')],_0x5c68f2);_0x16d8a1(_0x23a45b[_0x379a('0xe')](0x1f4,_0x3111bd['message']));});});};
\ No newline at end of file
index 4c043c7..1b16306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aa2=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9aa2,0x93));var _0x29aa=function(_0x5ad848,_0x31e5bd){_0x5ad848=_0x5ad848-0x0;var _0xa276d0=_0x9aa2[_0x5ad848];return _0xa276d0;};'use strict';var multer=require(_0x29aa('0x0'));var util=require(_0x29aa('0x1'));var path=require(_0x29aa('0x2'));var timeout=require(_0x29aa('0x3'));var express=require(_0x29aa('0x4'));var router=express[_0x29aa('0x5')]();var fs_extra=require(_0x29aa('0x6'));var auth=require(_0x29aa('0x7'));var interaction=require(_0x29aa('0x8'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x29aa('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x29aa('0x9')](_0x29aa('0xa'),auth[_0x29aa('0xb')](),controller[_0x29aa('0xc')]);router[_0x29aa('0x9')](_0x29aa('0xd'),auth[_0x29aa('0xb')](),controller[_0x29aa('0xe')]);router[_0x29aa('0x9')](_0x29aa('0xf'),auth[_0x29aa('0xb')](),controller[_0x29aa('0x10')]);router[_0x29aa('0x9')](_0x29aa('0x11'),auth[_0x29aa('0xb')](),controller[_0x29aa('0x12')]);router[_0x29aa('0x13')]('/',auth[_0x29aa('0xb')](),controller['create']);router['put'](_0x29aa('0xa'),auth[_0x29aa('0xb')](),controller[_0x29aa('0x14')]);router[_0x29aa('0x15')](_0x29aa('0xa'),auth[_0x29aa('0xb')](),controller[_0x29aa('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xe26c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','util','path','connect-timeout'];(function(_0x4da65f,_0x24ef59){var _0x488cae=function(_0x260edb){while(--_0x260edb){_0x4da65f['push'](_0x4da65f['shift']());}};_0x488cae(++_0x24ef59);}(_0xe26c,0x189));var _0xce26=function(_0x37332e,_0x17f0cd){_0x37332e=_0x37332e-0x0;var _0x292647=_0xe26c[_0x37332e];return _0x292647;};'use strict';var multer=require('multer');var util=require(_0xce26('0x0'));var path=require(_0xce26('0x1'));var timeout=require(_0xce26('0x2'));var express=require(_0xce26('0x3'));var router=express[_0xce26('0x4')]();var fs_extra=require(_0xce26('0x5'));var auth=require(_0xce26('0x6'));var interaction=require(_0xce26('0x7'));var config=require(_0xce26('0x8'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth[_0xce26('0x9')](),controller['index']);router[_0xce26('0xa')](_0xce26('0xb'),auth['isAuthenticated'](),controller[_0xce26('0xc')]);router[_0xce26('0xa')]('/:id/fields',auth[_0xce26('0x9')](),controller[_0xce26('0xd')]);router[_0xce26('0xa')]('/:id/subjects',auth[_0xce26('0x9')](),controller[_0xce26('0xe')]);router[_0xce26('0xa')](_0xce26('0xf'),auth[_0xce26('0x9')](),controller[_0xce26('0x10')]);router[_0xce26('0x11')]('/',auth[_0xce26('0x9')](),controller['create']);router[_0xce26('0x12')](_0xce26('0xb'),auth[_0xce26('0x9')](),controller[_0xce26('0x13')]);router[_0xce26('0x14')](_0xce26('0xb'),auth[_0xce26('0x9')](),controller['destroy']);module[_0xce26('0x15')]=router;
\ No newline at end of file
index 22e1d22..76149f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8c3=['sequelize','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x9e575,_0x5894d4){var _0x522277=function(_0x1f5458){while(--_0x1f5458){_0x9e575['push'](_0x9e575['shift']());}};_0x522277(++_0x5894d4);}(_0xe8c3,0x19d));var _0x3e8c=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xe8c3[_0x19a49f];return _0x5351ae;};'use strict';var Sequelize=require(_0x3e8c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e8c('0x1')]},'moduleCreate':{'type':Sequelize[_0x3e8c('0x2')](_0x3e8c('0x3'),_0x3e8c('0x4'),_0x3e8c('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x3e8c('0x2')](_0x3e8c('0x6'),_0x3e8c('0x4'),_0x3e8c('0x3')),'defaultValue':_0x3e8c('0x6')},'description':{'type':Sequelize[_0x3e8c('0x1')]}};
\ No newline at end of file
+var _0xdd12=['contact','sequelize','exports','ENUM','lead','nothing','contact_lead'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0xdd12,0xf6));var _0x2dd1=function(_0x10d0db,_0x490773){_0x10d0db=_0x10d0db-0x0;var _0x1ccef3=_0xdd12[_0x10d0db];return _0x1ccef3;};'use strict';var Sequelize=require(_0x2dd1('0x0'));module[_0x2dd1('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x2dd1('0x2')](_0x2dd1('0x3'),'contact',_0x2dd1('0x4')),'defaultValue':_0x2dd1('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x2dd1('0x5'),_0x2dd1('0x6'),_0x2dd1('0x3')),'defaultValue':_0x2dd1('0x5')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 335e8a5..c136b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaedf=['merge','includeAll','findAll','rows','params','keys','include','find','create','body','findOne','ZohoField','filters','options','getFields','getSubjects','getDescriptions','nolimit','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x2a18b7,_0x5041c8){var _0x45e74e=function(_0x1d32d6){while(--_0x1d32d6){_0x2a18b7['push'](_0x2a18b7['shift']());}};_0x45e74e(++_0x5041c8);}(_0xaedf,0x17e));var _0xfaed=function(_0x3defc9,_0x33026e){_0x3defc9=_0x3defc9-0x0;var _0xdc452f=_0xaedf[_0x3defc9];return _0xdc452f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfaed('0x0'));var rp=require(_0xfaed('0x1'));var moment=require(_0xfaed('0x2'));var BPromise=require(_0xfaed('0x3'));var Mustache=require('mustache');var util=require(_0xfaed('0x4'));var path=require(_0xfaed('0x5'));var sox=require(_0xfaed('0x6'));var csv=require(_0xfaed('0x7'));var ejs=require(_0xfaed('0x8'));var fs=require('fs');var fs_extra=require(_0xfaed('0x9'));var _=require(_0xfaed('0xa'));var squel=require(_0xfaed('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaed('0xc'));var deskjs=require(_0xfaed('0xd'));var toCsv=require(_0xfaed('0x7'));var querystring=require(_0xfaed('0xe'));var Papa=require(_0xfaed('0xf'));var Redis=require(_0xfaed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfaed('0x11'));var as=require(_0xfaed('0x12'));var hardwareService=require(_0xfaed('0x13'));var logger=require(_0xfaed('0x14'))('api');var utils=require(_0xfaed('0x15'));var config=require(_0xfaed('0x16'));var licenseUtil=require(_0xfaed('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfaed('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ffa55,_0x13431d,_0x112977,_0x1a1ead){return new BPromise(function(_0x16e23f,_0x310da9){var _0xf24b98=_0x1a1ead||client;return _0xf24b98[_0xfaed('0x19')](_0x3ffa55,_0x112977)[_0xfaed('0x1a')](function(_0x1f5f30){logger[_0xfaed('0x1b')](_0xfaed('0x1c'),_0x13431d,'request\x20sent');logger[_0xfaed('0x1d')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x13431d,_0xfaed('0x1e'),JSON[_0xfaed('0x1f')](_0x1f5f30));if(_0x1f5f30[_0xfaed('0x20')]){if(_0x1f5f30['error'][_0xfaed('0x21')]===0x1f4){logger[_0xfaed('0x20')](_0xfaed('0x1c'),_0x13431d,_0x1f5f30[_0xfaed('0x20')][_0xfaed('0x22')]);return _0x310da9(_0x1f5f30[_0xfaed('0x20')][_0xfaed('0x22')]);}logger[_0xfaed('0x20')](_0xfaed('0x1c'),_0x13431d,_0x1f5f30['error'][_0xfaed('0x22')]);return _0x16e23f(_0x1f5f30[_0xfaed('0x20')][_0xfaed('0x22')]);}else{logger[_0xfaed('0x1b')](_0xfaed('0x1c'),_0x13431d,'request\x20sent');_0x16e23f(_0x1f5f30[_0xfaed('0x23')]['message']);}})[_0xfaed('0x24')](function(_0x12e310){logger[_0xfaed('0x20')](_0xfaed('0x1c'),_0x13431d,_0x12e310);_0x310da9(_0x12e310);});});}function respondWithStatusCode(_0x447bc6,_0xf4e752){_0xf4e752=_0xf4e752||0xcc;return function(_0x401968){if(_0x401968){return _0x447bc6[_0xfaed('0x25')](_0xf4e752);}return _0x447bc6[_0xfaed('0x26')](_0xf4e752)[_0xfaed('0x27')]();};}function respondWithResult(_0xed2bce,_0x1b3faf){_0x1b3faf=_0x1b3faf||0xc8;return function(_0x198576){if(_0x198576){return _0xed2bce['status'](_0x1b3faf)[_0xfaed('0x28')](_0x198576);}};}function respondWithFilteredResult(_0x2940dc,_0xbd692b){return function(_0xf90399){if(_0xf90399){var _0x2d81a0=typeof _0xbd692b['offset']===_0xfaed('0x29')&&typeof _0xbd692b[_0xfaed('0x2a')]===_0xfaed('0x29');var _0x10fa04=_0xf90399[_0xfaed('0x2b')];var _0x553e7f=_0x2d81a0?0x0:_0xbd692b[_0xfaed('0x2c')];var _0x243445=_0x2d81a0?_0xf90399[_0xfaed('0x2b')]:_0xbd692b[_0xfaed('0x2c')]+_0xbd692b[_0xfaed('0x2a')];var _0x2e94c9;if(_0x243445>=_0x10fa04){_0x243445=_0x10fa04;_0x2e94c9=0xc8;}else{_0x2e94c9=0xce;}_0x2940dc[_0xfaed('0x26')](_0x2e94c9);return _0x2940dc[_0xfaed('0x2d')](_0xfaed('0x2e'),_0x553e7f+'-'+_0x243445+'/'+_0x10fa04)['json'](_0xf90399);}return null;};}function patchUpdates(_0x25e0ab){return function(_0x4587b5){try{jsonpatch[_0xfaed('0x2f')](_0x4587b5,_0x25e0ab,!![]);}catch(_0x5588b2){return BPromise[_0xfaed('0x30')](_0x5588b2);}return _0x4587b5[_0xfaed('0x31')]();};}function saveUpdates(_0x5cb350,_0x1fbec4){return function(_0x466ec8){if(_0x466ec8){return _0x466ec8[_0xfaed('0x32')](_0x5cb350)[_0xfaed('0x1a')](function(_0x8c1e04){return _0x8c1e04;});}return null;};}function removeEntity(_0x2fc56f,_0x3731e8){return function(_0x54d2e7){if(_0x54d2e7){return _0x54d2e7[_0xfaed('0x33')]()['then'](function(){_0x2fc56f[_0xfaed('0x26')](0xcc)[_0xfaed('0x27')]();});}};}function handleEntityNotFound(_0x3ee831,_0x56e1b3){return function(_0x27bcf5){if(!_0x27bcf5){_0x3ee831[_0xfaed('0x25')](0x194);}return _0x27bcf5;};}function handleError(_0x5ae86a,_0x55dbaa){_0x55dbaa=_0x55dbaa||0x1f4;return function(_0x3b39f8){logger[_0xfaed('0x20')](_0x3b39f8[_0xfaed('0x34')]);if(_0x3b39f8[_0xfaed('0x35')]){delete _0x3b39f8['name'];}_0x5ae86a['status'](_0x55dbaa)[_0xfaed('0x36')](_0x3b39f8);};}exports[_0xfaed('0x37')]=function(_0x5597b1,_0x4338d0){var _0x2d6581={},_0x1c8bf4={},_0x1dd5d0={'count':0x0,'rows':[]};var _0x39f8a0=_[_0xfaed('0x38')](db[_0xfaed('0x39')][_0xfaed('0x3a')],function(_0x37c2ea){return{'name':_0x37c2ea[_0xfaed('0x3b')],'type':_0x37c2ea[_0xfaed('0x3c')]['key']};});_0x1c8bf4['model']=_['map'](_0x39f8a0,_0xfaed('0x35'));_0x1c8bf4[_0xfaed('0x3d')]=_['keys'](_0x5597b1[_0xfaed('0x3d')]);_0x1c8bf4['filters']=_[_0xfaed('0x3e')](_0x1c8bf4[_0xfaed('0x3f')],_0x1c8bf4[_0xfaed('0x3d')]);_0x2d6581['attributes']=_[_0xfaed('0x3e')](_0x1c8bf4[_0xfaed('0x3f')],qs[_0xfaed('0x40')](_0x5597b1[_0xfaed('0x3d')]['fields']));_0x2d6581[_0xfaed('0x41')]=_0x2d6581['attributes'][_0xfaed('0x42')]?_0x2d6581[_0xfaed('0x41')]:_0x1c8bf4[_0xfaed('0x3f')];if(!_0x5597b1[_0xfaed('0x3d')][_0xfaed('0x43')]('nolimit')){_0x2d6581['limit']=qs['limit'](_0x5597b1[_0xfaed('0x3d')][_0xfaed('0x2a')]);_0x2d6581[_0xfaed('0x2c')]=qs[_0xfaed('0x2c')](_0x5597b1[_0xfaed('0x3d')]['offset']);}_0x2d6581[_0xfaed('0x44')]=qs[_0xfaed('0x45')](_0x5597b1[_0xfaed('0x3d')]['sort']);_0x2d6581[_0xfaed('0x46')]=qs['filters'](_[_0xfaed('0x47')](_0x5597b1[_0xfaed('0x3d')],_0x1c8bf4['filters']),_0x39f8a0);if(_0x5597b1[_0xfaed('0x3d')][_0xfaed('0x48')]){_0x2d6581['where']=_[_0xfaed('0x49')](_0x2d6581[_0xfaed('0x46')],{'$or':_[_0xfaed('0x38')](_0x39f8a0,function(_0x19bb0c){if(_0x19bb0c[_0xfaed('0x3c')]!=='VIRTUAL'){var _0x1d0861={};_0x1d0861[_0x19bb0c['name']]={'$like':'%'+_0x5597b1[_0xfaed('0x3d')]['filter']+'%'};return _0x1d0861;}})});}_0x2d6581=_['merge']({},_0x2d6581,_0x5597b1['options']);var _0x51e7d3={'where':_0x2d6581['where']};return db[_0xfaed('0x39')][_0xfaed('0x2b')](_0x51e7d3)[_0xfaed('0x1a')](function(_0x5cc712){_0x1dd5d0[_0xfaed('0x2b')]=_0x5cc712;if(_0x5597b1[_0xfaed('0x3d')][_0xfaed('0x4a')]){_0x2d6581['include']=[{'all':!![]}];}return db[_0xfaed('0x39')][_0xfaed('0x4b')](_0x2d6581);})[_0xfaed('0x1a')](function(_0x3c74c0){_0x1dd5d0[_0xfaed('0x4c')]=_0x3c74c0;return _0x1dd5d0;})['then'](respondWithFilteredResult(_0x4338d0,_0x2d6581))[_0xfaed('0x24')](handleError(_0x4338d0,null));};exports['show']=function(_0x3b018a,_0x40588d){var _0x311561={'raw':![],'where':{'id':_0x3b018a[_0xfaed('0x4d')]['id']}},_0x12c5ea={};_0x12c5ea[_0xfaed('0x3f')]=_[_0xfaed('0x4e')](db[_0xfaed('0x39')][_0xfaed('0x3a')]);_0x12c5ea['query']=_[_0xfaed('0x4e')](_0x3b018a[_0xfaed('0x3d')]);_0x12c5ea['filters']=_['intersection'](_0x12c5ea[_0xfaed('0x3f')],_0x12c5ea[_0xfaed('0x3d')]);_0x311561[_0xfaed('0x41')]=_[_0xfaed('0x3e')](_0x12c5ea['model'],qs[_0xfaed('0x40')](_0x3b018a['query'][_0xfaed('0x40')]));_0x311561[_0xfaed('0x41')]=_0x311561[_0xfaed('0x41')][_0xfaed('0x42')]?_0x311561[_0xfaed('0x41')]:_0x12c5ea[_0xfaed('0x3f')];if(_0x3b018a['query'][_0xfaed('0x4a')]){_0x311561[_0xfaed('0x4f')]=[{'all':!![]}];}_0x311561=_['merge']({},_0x311561,_0x3b018a['options']);return db['ZohoConfiguration'][_0xfaed('0x50')](_0x311561)['then'](handleEntityNotFound(_0x40588d,null))['then'](respondWithResult(_0x40588d,null))[_0xfaed('0x24')](handleError(_0x40588d,null));};exports[_0xfaed('0x51')]=function(_0x1d48f2,_0x2b417d){return db[_0xfaed('0x39')][_0xfaed('0x51')](_0x1d48f2['body'],{})[_0xfaed('0x1a')](respondWithResult(_0x2b417d,0xc9))[_0xfaed('0x24')](handleError(_0x2b417d,null));};exports[_0xfaed('0x32')]=function(_0x8b6eeb,_0x39dc0d){if(_0x8b6eeb['body']['id']){delete _0x8b6eeb[_0xfaed('0x52')]['id'];}return db['ZohoConfiguration'][_0xfaed('0x50')]({'where':{'id':_0x8b6eeb[_0xfaed('0x4d')]['id']}})[_0xfaed('0x1a')](handleEntityNotFound(_0x39dc0d,null))[_0xfaed('0x1a')](saveUpdates(_0x8b6eeb['body'],null))[_0xfaed('0x1a')](respondWithResult(_0x39dc0d,null))[_0xfaed('0x24')](handleError(_0x39dc0d,null));};exports[_0xfaed('0x33')]=function(_0x1ff062,_0x3d2a51){return db[_0xfaed('0x39')][_0xfaed('0x50')]({'where':{'id':_0x1ff062['params']['id']}})['then'](handleEntityNotFound(_0x3d2a51,null))['then'](removeEntity(_0x3d2a51,null))['catch'](handleError(_0x3d2a51,null));};exports['getFields']=function(_0x55350c,_0x2e7e78,_0x3390ed){var _0x175012={};var _0xa958ca={};var _0x3586b8;var _0x2ff7d9;return db[_0xfaed('0x39')][_0xfaed('0x53')]({'where':{'id':_0x55350c['params']['id']}})[_0xfaed('0x1a')](handleEntityNotFound(_0x2e7e78,null))[_0xfaed('0x1a')](function(_0x405449){if(_0x405449){_0x3586b8=_0x405449;_0xa958ca[_0xfaed('0x3f')]=_[_0xfaed('0x4e')](db[_0xfaed('0x54')]['rawAttributes']);_0xa958ca[_0xfaed('0x3d')]=_[_0xfaed('0x4e')](_0x55350c[_0xfaed('0x3d')]);_0xa958ca['filters']=_[_0xfaed('0x3e')](_0xa958ca[_0xfaed('0x3f')],_0xa958ca[_0xfaed('0x3d')]);_0x175012['attributes']=_[_0xfaed('0x3e')](_0xa958ca[_0xfaed('0x3f')],qs['fields'](_0x55350c[_0xfaed('0x3d')][_0xfaed('0x40')]));_0x175012[_0xfaed('0x41')]=_0x175012['attributes'][_0xfaed('0x42')]?_0x175012['attributes']:_0xa958ca['model'];_0x175012['order']=qs[_0xfaed('0x45')](_0x55350c[_0xfaed('0x3d')]['sort']);_0x175012[_0xfaed('0x46')]=qs[_0xfaed('0x55')](_[_0xfaed('0x47')](_0x55350c['query'],_0xa958ca[_0xfaed('0x55')]));if(_0x55350c[_0xfaed('0x3d')][_0xfaed('0x48')]){_0x175012[_0xfaed('0x46')]=_[_0xfaed('0x49')](_0x175012['where'],{'$or':_[_0xfaed('0x38')](_0x175012[_0xfaed('0x41')],function(_0x28b306){var _0x4c5f06={};_0x4c5f06[_0x28b306]={'$like':'%'+_0x55350c[_0xfaed('0x3d')]['filter']+'%'};return _0x4c5f06;})});}_0x175012=_[_0xfaed('0x49')]({},_0x175012,_0x55350c[_0xfaed('0x56')]);return _0x3586b8[_0xfaed('0x57')](_0x175012);}})[_0xfaed('0x1a')](function(_0x1660ed){if(_0x1660ed){_0x2ff7d9=_0x1660ed[_0xfaed('0x42')];if(!_0x55350c['query'][_0xfaed('0x43')]('nolimit')){_0x175012[_0xfaed('0x2a')]=qs[_0xfaed('0x2a')](_0x55350c['query'][_0xfaed('0x2a')]);_0x175012['offset']=qs[_0xfaed('0x2c')](_0x55350c[_0xfaed('0x3d')][_0xfaed('0x2c')]);}return _0x3586b8['getFields'](_0x175012);}})[_0xfaed('0x1a')](function(_0x1ab59d){if(_0x1ab59d){return _0x1ab59d?{'count':_0x2ff7d9,'rows':_0x1ab59d}:null;}})[_0xfaed('0x1a')](respondWithResult(_0x2e7e78,null))[_0xfaed('0x24')](handleError(_0x2e7e78,null));};exports['getSubjects']=function(_0x38cd9e,_0x2563fb,_0x34d5f0){var _0x2a75e4={};var _0x54ac39={};var _0x12ccf3;var _0x1a644d;return db[_0xfaed('0x39')][_0xfaed('0x53')]({'where':{'id':_0x38cd9e[_0xfaed('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2563fb,null))[_0xfaed('0x1a')](function(_0x31f960){if(_0x31f960){_0x12ccf3=_0x31f960;_0x54ac39[_0xfaed('0x3f')]=_[_0xfaed('0x4e')](db[_0xfaed('0x54')][_0xfaed('0x3a')]);_0x54ac39[_0xfaed('0x3d')]=_[_0xfaed('0x4e')](_0x38cd9e['query']);_0x54ac39[_0xfaed('0x55')]=_['intersection'](_0x54ac39[_0xfaed('0x3f')],_0x54ac39[_0xfaed('0x3d')]);_0x2a75e4[_0xfaed('0x41')]=_[_0xfaed('0x3e')](_0x54ac39[_0xfaed('0x3f')],qs[_0xfaed('0x40')](_0x38cd9e[_0xfaed('0x3d')]['fields']));_0x2a75e4[_0xfaed('0x41')]=_0x2a75e4[_0xfaed('0x41')][_0xfaed('0x42')]?_0x2a75e4[_0xfaed('0x41')]:_0x54ac39[_0xfaed('0x3f')];_0x2a75e4[_0xfaed('0x44')]=qs[_0xfaed('0x45')](_0x38cd9e['query'][_0xfaed('0x45')]);_0x2a75e4[_0xfaed('0x46')]=qs[_0xfaed('0x55')](_[_0xfaed('0x47')](_0x38cd9e[_0xfaed('0x3d')],_0x54ac39[_0xfaed('0x55')]));if(_0x38cd9e[_0xfaed('0x3d')][_0xfaed('0x48')]){_0x2a75e4[_0xfaed('0x46')]=_['merge'](_0x2a75e4[_0xfaed('0x46')],{'$or':_[_0xfaed('0x38')](_0x2a75e4[_0xfaed('0x41')],function(_0x5f0d83){var _0xf18eb4={};_0xf18eb4[_0x5f0d83]={'$like':'%'+_0x38cd9e[_0xfaed('0x3d')][_0xfaed('0x48')]+'%'};return _0xf18eb4;})});}_0x2a75e4=_['merge']({},_0x2a75e4,_0x38cd9e[_0xfaed('0x56')]);return _0x12ccf3[_0xfaed('0x58')](_0x2a75e4);}})[_0xfaed('0x1a')](function(_0x7eb84d){if(_0x7eb84d){_0x1a644d=_0x7eb84d[_0xfaed('0x42')];if(!_0x38cd9e[_0xfaed('0x3d')][_0xfaed('0x43')]('nolimit')){_0x2a75e4[_0xfaed('0x2a')]=qs[_0xfaed('0x2a')](_0x38cd9e[_0xfaed('0x3d')][_0xfaed('0x2a')]);_0x2a75e4[_0xfaed('0x2c')]=qs[_0xfaed('0x2c')](_0x38cd9e[_0xfaed('0x3d')][_0xfaed('0x2c')]);}return _0x12ccf3[_0xfaed('0x58')](_0x2a75e4);}})[_0xfaed('0x1a')](function(_0x18071b){if(_0x18071b){return _0x18071b?{'count':_0x1a644d,'rows':_0x18071b}:null;}})[_0xfaed('0x1a')](respondWithResult(_0x2563fb,null))[_0xfaed('0x24')](handleError(_0x2563fb,null));};exports[_0xfaed('0x59')]=function(_0xebde2,_0x49a42e,_0x3b7367){var _0x21c8bd={};var _0x2100ce={};var _0x30b5fe;var _0x1da2aa;return db[_0xfaed('0x39')][_0xfaed('0x53')]({'where':{'id':_0xebde2['params']['id']}})['then'](handleEntityNotFound(_0x49a42e,null))[_0xfaed('0x1a')](function(_0x26afe7){if(_0x26afe7){_0x30b5fe=_0x26afe7;_0x2100ce[_0xfaed('0x3f')]=_['keys'](db[_0xfaed('0x54')][_0xfaed('0x3a')]);_0x2100ce[_0xfaed('0x3d')]=_[_0xfaed('0x4e')](_0xebde2[_0xfaed('0x3d')]);_0x2100ce[_0xfaed('0x55')]=_[_0xfaed('0x3e')](_0x2100ce[_0xfaed('0x3f')],_0x2100ce[_0xfaed('0x3d')]);_0x21c8bd[_0xfaed('0x41')]=_[_0xfaed('0x3e')](_0x2100ce[_0xfaed('0x3f')],qs[_0xfaed('0x40')](_0xebde2['query'][_0xfaed('0x40')]));_0x21c8bd[_0xfaed('0x41')]=_0x21c8bd[_0xfaed('0x41')][_0xfaed('0x42')]?_0x21c8bd[_0xfaed('0x41')]:_0x2100ce['model'];_0x21c8bd[_0xfaed('0x44')]=qs[_0xfaed('0x45')](_0xebde2[_0xfaed('0x3d')][_0xfaed('0x45')]);_0x21c8bd[_0xfaed('0x46')]=qs[_0xfaed('0x55')](_['pick'](_0xebde2[_0xfaed('0x3d')],_0x2100ce[_0xfaed('0x55')]));if(_0xebde2[_0xfaed('0x3d')][_0xfaed('0x48')]){_0x21c8bd[_0xfaed('0x46')]=_[_0xfaed('0x49')](_0x21c8bd[_0xfaed('0x46')],{'$or':_[_0xfaed('0x38')](_0x21c8bd[_0xfaed('0x41')],function(_0x267d6b){var _0x83c95c={};_0x83c95c[_0x267d6b]={'$like':'%'+_0xebde2['query'][_0xfaed('0x48')]+'%'};return _0x83c95c;})});}_0x21c8bd=_[_0xfaed('0x49')]({},_0x21c8bd,_0xebde2[_0xfaed('0x56')]);return _0x30b5fe[_0xfaed('0x59')](_0x21c8bd);}})['then'](function(_0xf0c349){if(_0xf0c349){_0x1da2aa=_0xf0c349[_0xfaed('0x42')];if(!_0xebde2[_0xfaed('0x3d')][_0xfaed('0x43')](_0xfaed('0x5a'))){_0x21c8bd[_0xfaed('0x2a')]=qs['limit'](_0xebde2['query'][_0xfaed('0x2a')]);_0x21c8bd[_0xfaed('0x2c')]=qs[_0xfaed('0x2c')](_0xebde2[_0xfaed('0x3d')][_0xfaed('0x2c')]);}return _0x30b5fe['getDescriptions'](_0x21c8bd);}})[_0xfaed('0x1a')](function(_0x3a2c09){if(_0x3a2c09){return _0x3a2c09?{'count':_0x1da2aa,'rows':_0x3a2c09}:null;}})[_0xfaed('0x1a')](respondWithResult(_0x49a42e,null))[_0xfaed('0x24')](handleError(_0x49a42e,null));};
\ No newline at end of file
+var _0xa79c=['key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','find','create','body','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','http','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type'];(function(_0x26721c,_0x247642){var _0x5b2a9c=function(_0x4e73b5){while(--_0x4e73b5){_0x26721c['push'](_0x26721c['shift']());}};_0x5b2a9c(++_0x247642);}(_0xa79c,0x198));var _0xca79=function(_0x5e0842,_0x21f6d4){_0x5e0842=_0x5e0842-0x0;var _0x3d7d42=_0xa79c[_0x5e0842];return _0x3d7d42;};'use strict';var emlformat=require(_0xca79('0x0'));var rimraf=require(_0xca79('0x1'));var zipdir=require(_0xca79('0x2'));var jsonpatch=require(_0xca79('0x3'));var rp=require(_0xca79('0x4'));var moment=require(_0xca79('0x5'));var BPromise=require(_0xca79('0x6'));var Mustache=require(_0xca79('0x7'));var util=require(_0xca79('0x8'));var path=require(_0xca79('0x9'));var sox=require(_0xca79('0xa'));var csv=require(_0xca79('0xb'));var ejs=require(_0xca79('0xc'));var fs=require('fs');var fs_extra=require(_0xca79('0xd'));var _=require(_0xca79('0xe'));var squel=require(_0xca79('0xf'));var crypto=require(_0xca79('0x10'));var jsforce=require(_0xca79('0x11'));var deskjs=require(_0xca79('0x12'));var toCsv=require('to-csv');var querystring=require(_0xca79('0x13'));var Papa=require(_0xca79('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xca79('0x15'));var as=require(_0xca79('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca79('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xca79('0x18'));var licenseUtil=require(_0xca79('0x19'));var db=require(_0xca79('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xca79('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5cb463,_0x262e1f,_0x55d784,_0x54861e){return new BPromise(function(_0x2fa59a,_0x388207){var _0x5ddd88=_0x54861e||client;return _0x5ddd88[_0xca79('0x1c')](_0x5cb463,_0x55d784)['then'](function(_0x52a9d4){logger[_0xca79('0x1d')](_0xca79('0x1e'),_0x262e1f,_0xca79('0x1f'));logger['debug'](_0xca79('0x20'),_0x262e1f,_0xca79('0x1f'),JSON[_0xca79('0x21')](_0x52a9d4));if(_0x52a9d4[_0xca79('0x22')]){if(_0x52a9d4[_0xca79('0x22')][_0xca79('0x23')]===0x1f4){logger[_0xca79('0x22')](_0xca79('0x1e'),_0x262e1f,_0x52a9d4[_0xca79('0x22')][_0xca79('0x24')]);return _0x388207(_0x52a9d4[_0xca79('0x22')]['message']);}logger[_0xca79('0x22')]('ZohoConfiguration,\x20%s,\x20%s',_0x262e1f,_0x52a9d4[_0xca79('0x22')][_0xca79('0x24')]);return _0x2fa59a(_0x52a9d4[_0xca79('0x22')][_0xca79('0x24')]);}else{logger[_0xca79('0x1d')]('ZohoConfiguration,\x20%s,\x20%s',_0x262e1f,_0xca79('0x1f'));_0x2fa59a(_0x52a9d4['result'][_0xca79('0x24')]);}})[_0xca79('0x25')](function(_0x4231b4){logger[_0xca79('0x22')](_0xca79('0x1e'),_0x262e1f,_0x4231b4);_0x388207(_0x4231b4);});});}function respondWithStatusCode(_0x1d30fc,_0x503199){_0x503199=_0x503199||0xcc;return function(_0x178b8b){if(_0x178b8b){return _0x1d30fc[_0xca79('0x26')](_0x503199);}return _0x1d30fc[_0xca79('0x27')](_0x503199)[_0xca79('0x28')]();};}function respondWithResult(_0x3e3ab8,_0x634b61){_0x634b61=_0x634b61||0xc8;return function(_0x1ab430){if(_0x1ab430){return _0x3e3ab8[_0xca79('0x27')](_0x634b61)[_0xca79('0x29')](_0x1ab430);}};}function respondWithFilteredResult(_0x122383,_0x294301){return function(_0x355922){if(_0x355922){var _0x55d9c9=typeof _0x294301[_0xca79('0x2a')]===_0xca79('0x2b')&&typeof _0x294301['limit']===_0xca79('0x2b');var _0x26db8a=_0x355922[_0xca79('0x2c')];var _0x30e262=_0x55d9c9?0x0:_0x294301['offset'];var _0x41f88e=_0x55d9c9?_0x355922[_0xca79('0x2c')]:_0x294301[_0xca79('0x2a')]+_0x294301[_0xca79('0x2d')];var _0x38625b;if(_0x41f88e>=_0x26db8a){_0x41f88e=_0x26db8a;_0x38625b=0xc8;}else{_0x38625b=0xce;}_0x122383[_0xca79('0x27')](_0x38625b);return _0x122383[_0xca79('0x2e')](_0xca79('0x2f'),_0x30e262+'-'+_0x41f88e+'/'+_0x26db8a)[_0xca79('0x29')](_0x355922);}return null;};}function patchUpdates(_0x213db0){return function(_0x5d0e99){try{jsonpatch[_0xca79('0x30')](_0x5d0e99,_0x213db0,!![]);}catch(_0x4cb3df){return BPromise[_0xca79('0x31')](_0x4cb3df);}return _0x5d0e99[_0xca79('0x32')]();};}function saveUpdates(_0x19e6ad,_0x3ad9cc){return function(_0x1989a5){if(_0x1989a5){return _0x1989a5[_0xca79('0x33')](_0x19e6ad)['then'](function(_0x153279){return _0x153279;});}return null;};}function removeEntity(_0x5b4373,_0x2cf1ff){return function(_0x232bd1){if(_0x232bd1){return _0x232bd1[_0xca79('0x34')]()[_0xca79('0x35')](function(){_0x5b4373[_0xca79('0x27')](0xcc)[_0xca79('0x28')]();});}};}function handleEntityNotFound(_0x4ffa10,_0x44ef10){return function(_0x138171){if(!_0x138171){_0x4ffa10['sendStatus'](0x194);}return _0x138171;};}function handleError(_0x236f0f,_0x4d4f08){_0x4d4f08=_0x4d4f08||0x1f4;return function(_0x50015c){logger['error'](_0x50015c[_0xca79('0x36')]);if(_0x50015c[_0xca79('0x37')]){delete _0x50015c[_0xca79('0x37')];}_0x236f0f['status'](_0x4d4f08)[_0xca79('0x38')](_0x50015c);};}exports[_0xca79('0x39')]=function(_0x5311c0,_0x41996a){var _0x5c214c={},_0x26b406={},_0xd38387={'count':0x0,'rows':[]};var _0x77774c=_['map'](db[_0xca79('0x3a')][_0xca79('0x3b')],function(_0x99246c){return{'name':_0x99246c[_0xca79('0x3c')],'type':_0x99246c[_0xca79('0x3d')][_0xca79('0x3e')]};});_0x26b406['model']=_[_0xca79('0x3f')](_0x77774c,_0xca79('0x37'));_0x26b406[_0xca79('0x40')]=_[_0xca79('0x41')](_0x5311c0[_0xca79('0x40')]);_0x26b406['filters']=_[_0xca79('0x42')](_0x26b406[_0xca79('0x43')],_0x26b406[_0xca79('0x40')]);_0x5c214c[_0xca79('0x44')]=_['intersection'](_0x26b406[_0xca79('0x43')],qs[_0xca79('0x45')](_0x5311c0[_0xca79('0x40')]['fields']));_0x5c214c[_0xca79('0x44')]=_0x5c214c[_0xca79('0x44')][_0xca79('0x46')]?_0x5c214c['attributes']:_0x26b406[_0xca79('0x43')];if(!_0x5311c0[_0xca79('0x40')][_0xca79('0x47')](_0xca79('0x48'))){_0x5c214c['limit']=qs[_0xca79('0x2d')](_0x5311c0['query'][_0xca79('0x2d')]);_0x5c214c[_0xca79('0x2a')]=qs['offset'](_0x5311c0['query'][_0xca79('0x2a')]);}_0x5c214c[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x5311c0[_0xca79('0x40')][_0xca79('0x4a')]);_0x5c214c['where']=qs[_0xca79('0x4b')](_[_0xca79('0x4c')](_0x5311c0[_0xca79('0x40')],_0x26b406['filters']),_0x77774c);if(_0x5311c0['query'][_0xca79('0x4d')]){_0x5c214c[_0xca79('0x4e')]=_[_0xca79('0x4f')](_0x5c214c['where'],{'$or':_[_0xca79('0x3f')](_0x77774c,function(_0x2ca78b){if(_0x2ca78b[_0xca79('0x3d')]!==_0xca79('0x50')){var _0x3c0418={};_0x3c0418[_0x2ca78b[_0xca79('0x37')]]={'$like':'%'+_0x5311c0[_0xca79('0x40')][_0xca79('0x4d')]+'%'};return _0x3c0418;}})});}_0x5c214c=_[_0xca79('0x4f')]({},_0x5c214c,_0x5311c0[_0xca79('0x51')]);var _0x248112={'where':_0x5c214c[_0xca79('0x4e')]};return db[_0xca79('0x3a')][_0xca79('0x2c')](_0x248112)[_0xca79('0x35')](function(_0x229db1){_0xd38387[_0xca79('0x2c')]=_0x229db1;if(_0x5311c0[_0xca79('0x40')][_0xca79('0x52')]){_0x5c214c[_0xca79('0x53')]=[{'all':!![]}];}return db[_0xca79('0x3a')]['findAll'](_0x5c214c);})['then'](function(_0xa50a79){_0xd38387['rows']=_0xa50a79;return _0xd38387;})['then'](respondWithFilteredResult(_0x41996a,_0x5c214c))[_0xca79('0x25')](handleError(_0x41996a,null));};exports[_0xca79('0x54')]=function(_0x545a60,_0x2ff0e0){var _0x5846c={'raw':![],'where':{'id':_0x545a60[_0xca79('0x55')]['id']}},_0x293af6={};_0x293af6[_0xca79('0x43')]=_[_0xca79('0x41')](db['ZohoConfiguration'][_0xca79('0x3b')]);_0x293af6['query']=_['keys'](_0x545a60['query']);_0x293af6[_0xca79('0x4b')]=_[_0xca79('0x42')](_0x293af6[_0xca79('0x43')],_0x293af6[_0xca79('0x40')]);_0x5846c[_0xca79('0x44')]=_[_0xca79('0x42')](_0x293af6[_0xca79('0x43')],qs['fields'](_0x545a60[_0xca79('0x40')][_0xca79('0x45')]));_0x5846c['attributes']=_0x5846c[_0xca79('0x44')][_0xca79('0x46')]?_0x5846c[_0xca79('0x44')]:_0x293af6[_0xca79('0x43')];if(_0x545a60[_0xca79('0x40')][_0xca79('0x52')]){_0x5846c['include']=[{'all':!![]}];}_0x5846c=_['merge']({},_0x5846c,_0x545a60[_0xca79('0x51')]);return db[_0xca79('0x3a')][_0xca79('0x56')](_0x5846c)[_0xca79('0x35')](handleEntityNotFound(_0x2ff0e0,null))[_0xca79('0x35')](respondWithResult(_0x2ff0e0,null))[_0xca79('0x25')](handleError(_0x2ff0e0,null));};exports[_0xca79('0x57')]=function(_0x53ef13,_0x590df1){return db[_0xca79('0x3a')][_0xca79('0x57')](_0x53ef13[_0xca79('0x58')],{})[_0xca79('0x35')](respondWithResult(_0x590df1,0xc9))['catch'](handleError(_0x590df1,null));};exports[_0xca79('0x33')]=function(_0x2d45ec,_0x2b0734){if(_0x2d45ec[_0xca79('0x58')]['id']){delete _0x2d45ec[_0xca79('0x58')]['id'];}return db[_0xca79('0x3a')][_0xca79('0x56')]({'where':{'id':_0x2d45ec[_0xca79('0x55')]['id']}})[_0xca79('0x35')](handleEntityNotFound(_0x2b0734,null))[_0xca79('0x35')](saveUpdates(_0x2d45ec[_0xca79('0x58')],null))['then'](respondWithResult(_0x2b0734,null))[_0xca79('0x25')](handleError(_0x2b0734,null));};exports[_0xca79('0x34')]=function(_0x76381c,_0x3e639c){return db[_0xca79('0x3a')][_0xca79('0x56')]({'where':{'id':_0x76381c['params']['id']}})[_0xca79('0x35')](handleEntityNotFound(_0x3e639c,null))[_0xca79('0x35')](removeEntity(_0x3e639c,null))[_0xca79('0x25')](handleError(_0x3e639c,null));};exports[_0xca79('0x59')]=function(_0x2022d3,_0xb7bcd4,_0xd44e73){var _0x4086c9={};var _0xe492eb={};var _0x1f2d1f;var _0x2fc357;return db[_0xca79('0x3a')][_0xca79('0x5a')]({'where':{'id':_0x2022d3['params']['id']}})[_0xca79('0x35')](handleEntityNotFound(_0xb7bcd4,null))[_0xca79('0x35')](function(_0x31f7f3){if(_0x31f7f3){_0x1f2d1f=_0x31f7f3;_0xe492eb[_0xca79('0x43')]=_[_0xca79('0x41')](db[_0xca79('0x5b')][_0xca79('0x3b')]);_0xe492eb[_0xca79('0x40')]=_[_0xca79('0x41')](_0x2022d3[_0xca79('0x40')]);_0xe492eb[_0xca79('0x4b')]=_['intersection'](_0xe492eb[_0xca79('0x43')],_0xe492eb[_0xca79('0x40')]);_0x4086c9[_0xca79('0x44')]=_['intersection'](_0xe492eb[_0xca79('0x43')],qs[_0xca79('0x45')](_0x2022d3['query'][_0xca79('0x45')]));_0x4086c9[_0xca79('0x44')]=_0x4086c9[_0xca79('0x44')][_0xca79('0x46')]?_0x4086c9['attributes']:_0xe492eb[_0xca79('0x43')];_0x4086c9[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x2022d3['query'][_0xca79('0x4a')]);_0x4086c9[_0xca79('0x4e')]=qs[_0xca79('0x4b')](_['pick'](_0x2022d3[_0xca79('0x40')],_0xe492eb['filters']));if(_0x2022d3['query'][_0xca79('0x4d')]){_0x4086c9['where']=_[_0xca79('0x4f')](_0x4086c9[_0xca79('0x4e')],{'$or':_[_0xca79('0x3f')](_0x4086c9[_0xca79('0x44')],function(_0x550e9b){var _0x56bb70={};_0x56bb70[_0x550e9b]={'$like':'%'+_0x2022d3['query']['filter']+'%'};return _0x56bb70;})});}_0x4086c9=_[_0xca79('0x4f')]({},_0x4086c9,_0x2022d3[_0xca79('0x51')]);return _0x1f2d1f[_0xca79('0x59')](_0x4086c9);}})[_0xca79('0x35')](function(_0x19cd30){if(_0x19cd30){_0x2fc357=_0x19cd30[_0xca79('0x46')];if(!_0x2022d3[_0xca79('0x40')]['hasOwnProperty']('nolimit')){_0x4086c9[_0xca79('0x2d')]=qs[_0xca79('0x2d')](_0x2022d3[_0xca79('0x40')]['limit']);_0x4086c9[_0xca79('0x2a')]=qs[_0xca79('0x2a')](_0x2022d3[_0xca79('0x40')][_0xca79('0x2a')]);}return _0x1f2d1f[_0xca79('0x59')](_0x4086c9);}})[_0xca79('0x35')](function(_0xf864c){if(_0xf864c){return _0xf864c?{'count':_0x2fc357,'rows':_0xf864c}:null;}})['then'](respondWithResult(_0xb7bcd4,null))[_0xca79('0x25')](handleError(_0xb7bcd4,null));};exports['getSubjects']=function(_0x27c010,_0x4c6999,_0x44a28c){var _0xd22eb3={};var _0x17c1ae={};var _0x131c5f;var _0x46874f;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x27c010[_0xca79('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c6999,null))['then'](function(_0x79bcb){if(_0x79bcb){_0x131c5f=_0x79bcb;_0x17c1ae[_0xca79('0x43')]=_['keys'](db[_0xca79('0x5b')][_0xca79('0x3b')]);_0x17c1ae[_0xca79('0x40')]=_[_0xca79('0x41')](_0x27c010[_0xca79('0x40')]);_0x17c1ae[_0xca79('0x4b')]=_[_0xca79('0x42')](_0x17c1ae['model'],_0x17c1ae['query']);_0xd22eb3[_0xca79('0x44')]=_[_0xca79('0x42')](_0x17c1ae[_0xca79('0x43')],qs[_0xca79('0x45')](_0x27c010[_0xca79('0x40')][_0xca79('0x45')]));_0xd22eb3[_0xca79('0x44')]=_0xd22eb3['attributes'][_0xca79('0x46')]?_0xd22eb3[_0xca79('0x44')]:_0x17c1ae[_0xca79('0x43')];_0xd22eb3[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x27c010['query'][_0xca79('0x4a')]);_0xd22eb3[_0xca79('0x4e')]=qs[_0xca79('0x4b')](_[_0xca79('0x4c')](_0x27c010[_0xca79('0x40')],_0x17c1ae[_0xca79('0x4b')]));if(_0x27c010[_0xca79('0x40')][_0xca79('0x4d')]){_0xd22eb3['where']=_[_0xca79('0x4f')](_0xd22eb3[_0xca79('0x4e')],{'$or':_[_0xca79('0x3f')](_0xd22eb3[_0xca79('0x44')],function(_0xf03467){var _0x23b574={};_0x23b574[_0xf03467]={'$like':'%'+_0x27c010[_0xca79('0x40')][_0xca79('0x4d')]+'%'};return _0x23b574;})});}_0xd22eb3=_[_0xca79('0x4f')]({},_0xd22eb3,_0x27c010['options']);return _0x131c5f['getSubjects'](_0xd22eb3);}})[_0xca79('0x35')](function(_0x225cbc){if(_0x225cbc){_0x46874f=_0x225cbc[_0xca79('0x46')];if(!_0x27c010['query'][_0xca79('0x47')](_0xca79('0x48'))){_0xd22eb3['limit']=qs[_0xca79('0x2d')](_0x27c010['query'][_0xca79('0x2d')]);_0xd22eb3['offset']=qs['offset'](_0x27c010[_0xca79('0x40')][_0xca79('0x2a')]);}return _0x131c5f[_0xca79('0x5c')](_0xd22eb3);}})[_0xca79('0x35')](function(_0x2956ea){if(_0x2956ea){return _0x2956ea?{'count':_0x46874f,'rows':_0x2956ea}:null;}})[_0xca79('0x35')](respondWithResult(_0x4c6999,null))[_0xca79('0x25')](handleError(_0x4c6999,null));};exports[_0xca79('0x5d')]=function(_0x40dcbd,_0xf6d05c,_0x171a8a){var _0x1d0abf={};var _0x529f58={};var _0x14b551;var _0x272dcd;return db[_0xca79('0x3a')][_0xca79('0x5a')]({'where':{'id':_0x40dcbd[_0xca79('0x55')]['id']}})[_0xca79('0x35')](handleEntityNotFound(_0xf6d05c,null))[_0xca79('0x35')](function(_0x44ed53){if(_0x44ed53){_0x14b551=_0x44ed53;_0x529f58[_0xca79('0x43')]=_[_0xca79('0x41')](db[_0xca79('0x5b')]['rawAttributes']);_0x529f58[_0xca79('0x40')]=_['keys'](_0x40dcbd[_0xca79('0x40')]);_0x529f58[_0xca79('0x4b')]=_[_0xca79('0x42')](_0x529f58[_0xca79('0x43')],_0x529f58[_0xca79('0x40')]);_0x1d0abf['attributes']=_[_0xca79('0x42')](_0x529f58[_0xca79('0x43')],qs[_0xca79('0x45')](_0x40dcbd[_0xca79('0x40')][_0xca79('0x45')]));_0x1d0abf[_0xca79('0x44')]=_0x1d0abf['attributes'][_0xca79('0x46')]?_0x1d0abf[_0xca79('0x44')]:_0x529f58[_0xca79('0x43')];_0x1d0abf[_0xca79('0x49')]=qs[_0xca79('0x4a')](_0x40dcbd['query'][_0xca79('0x4a')]);_0x1d0abf[_0xca79('0x4e')]=qs['filters'](_[_0xca79('0x4c')](_0x40dcbd[_0xca79('0x40')],_0x529f58[_0xca79('0x4b')]));if(_0x40dcbd[_0xca79('0x40')][_0xca79('0x4d')]){_0x1d0abf[_0xca79('0x4e')]=_[_0xca79('0x4f')](_0x1d0abf[_0xca79('0x4e')],{'$or':_['map'](_0x1d0abf['attributes'],function(_0x20645f){var _0x5d79e5={};_0x5d79e5[_0x20645f]={'$like':'%'+_0x40dcbd[_0xca79('0x40')]['filter']+'%'};return _0x5d79e5;})});}_0x1d0abf=_[_0xca79('0x4f')]({},_0x1d0abf,_0x40dcbd[_0xca79('0x51')]);return _0x14b551[_0xca79('0x5d')](_0x1d0abf);}})[_0xca79('0x35')](function(_0x84ff27){if(_0x84ff27){_0x272dcd=_0x84ff27[_0xca79('0x46')];if(!_0x40dcbd[_0xca79('0x40')]['hasOwnProperty'](_0xca79('0x48'))){_0x1d0abf['limit']=qs['limit'](_0x40dcbd[_0xca79('0x40')][_0xca79('0x2d')]);_0x1d0abf['offset']=qs[_0xca79('0x2a')](_0x40dcbd[_0xca79('0x40')][_0xca79('0x2a')]);}return _0x14b551[_0xca79('0x5d')](_0x1d0abf);}})[_0xca79('0x35')](function(_0x2802c6){if(_0x2802c6){return _0x2802c6?{'count':_0x272dcd,'rows':_0x2802c6}:null;}})[_0xca79('0x35')](respondWithResult(_0xf6d05c,null))['catch'](handleError(_0xf6d05c,null));};
\ No newline at end of file
index 8e5bada..b8a8250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87a7=['util','api','moment','bluebird','path','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x34756e,_0x3c036a){var _0x365e63=function(_0xc96601){while(--_0xc96601){_0x34756e['push'](_0x34756e['shift']());}};_0x365e63(++_0x3c036a);}(_0x87a7,0x15d));var _0x787a=function(_0x4f7fce,_0x4ed4a2){_0x4f7fce=_0x4f7fce-0x0;var _0x361515=_0x87a7[_0x4f7fce];return _0x361515;};'use strict';var _=require(_0x787a('0x0'));var util=require(_0x787a('0x1'));var logger=require('../../config/logger')(_0x787a('0x2'));var moment=require(_0x787a('0x3'));var BPromise=require(_0x787a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x787a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x787a('0x6'));module['exports']=function(_0x3107ce,_0x2c06eb){return _0x3107ce[_0x787a('0x7')](_0x787a('0x8'),attributes,{'tableName':_0x787a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ba1=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x439e58,_0x42e1ff){var _0x5db31f=function(_0xe4c8ff){while(--_0xe4c8ff){_0x439e58['push'](_0x439e58['shift']());}};_0x5db31f(++_0x42e1ff);}(_0x9ba1,0x73));var _0x19ba=function(_0x9c27f3,_0x1522c4){_0x9c27f3=_0x9c27f3-0x0;var _0x46c1b6=_0x9ba1[_0x9c27f3];return _0x46c1b6;};'use strict';var _=require(_0x19ba('0x0'));var util=require(_0x19ba('0x1'));var logger=require(_0x19ba('0x2'))(_0x19ba('0x3'));var moment=require(_0x19ba('0x4'));var BPromise=require(_0x19ba('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19ba('0x6'));var rimraf=require(_0x19ba('0x7'));var config=require(_0x19ba('0x8'));var attributes=require(_0x19ba('0x9'));module[_0x19ba('0xa')]=function(_0x99a82b,_0x5c51c3){return _0x99a82b[_0x19ba('0xb')](_0x19ba('0xc'),attributes,{'tableName':_0x19ba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6a8d148..2847f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb4b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x36cfcf,_0x13c2c4){var _0x586c1f=function(_0x5b4893){while(--_0x5b4893){_0x36cfcf['push'](_0x36cfcf['shift']());}};_0x586c1f(++_0x13c2c4);}(_0xdb4b,0xe2));var _0xbdb4=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0xdb4b[_0x2eec1f];return _0x543075;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbdb4('0x0'));var BPromise=require(_0xbdb4('0x1'));var rs=require(_0xbdb4('0x2'));var fs=require('fs');var Redis=require(_0xbdb4('0x3'));var db=require(_0xbdb4('0x4'))['db'];var utils=require(_0xbdb4('0x5'));var logger=require(_0xbdb4('0x6'))(_0xbdb4('0x7'));var config=require(_0xbdb4('0x8'));var jayson=require(_0xbdb4('0x9'));var client=jayson[_0xbdb4('0xa')][_0xbdb4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x501fff,_0x5dbcb3,_0x36b094){return new BPromise(function(_0x5e9cda,_0x3aaa63){return client['request'](_0x501fff,_0x36b094)[_0xbdb4('0xc')](function(_0x5d9bdb){logger[_0xbdb4('0xd')](_0xbdb4('0xe'),_0x5dbcb3,_0xbdb4('0xf'));logger['debug'](_0xbdb4('0x10'),_0x5dbcb3,_0xbdb4('0xf'),JSON[_0xbdb4('0x11')](_0x5d9bdb));if(_0x5d9bdb[_0xbdb4('0x12')]){if(_0x5d9bdb[_0xbdb4('0x12')][_0xbdb4('0x13')]===0x1f4){logger[_0xbdb4('0x12')](_0xbdb4('0xe'),_0x5dbcb3,_0x5d9bdb[_0xbdb4('0x12')][_0xbdb4('0x14')]);return _0x3aaa63(_0x5d9bdb[_0xbdb4('0x12')][_0xbdb4('0x14')]);}logger[_0xbdb4('0x12')](_0xbdb4('0xe'),_0x5dbcb3,_0x5d9bdb['error']['message']);return _0x5e9cda(_0x5d9bdb[_0xbdb4('0x12')][_0xbdb4('0x14')]);}else{logger['info'](_0xbdb4('0xe'),_0x5dbcb3,'request\x20sent');_0x5e9cda(_0x5d9bdb[_0xbdb4('0x15')][_0xbdb4('0x14')]);}})[_0xbdb4('0x16')](function(_0x3b0b10){logger[_0xbdb4('0x12')](_0xbdb4('0xe'),_0x5dbcb3,_0x3b0b10);_0x3aaa63(_0x3b0b10);});});}
\ No newline at end of file
+var _0x013b=['message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x013b,0x1e8));var _0xb013=function(_0x38b8c6,_0x541f91){_0x38b8c6=_0x38b8c6-0x0;var _0x3104d6=_0x013b[_0x38b8c6];return _0x3104d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb013('0x0'));var BPromise=require(_0xb013('0x1'));var rs=require(_0xb013('0x2'));var fs=require('fs');var Redis=require(_0xb013('0x3'));var db=require(_0xb013('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb013('0x5'))(_0xb013('0x6'));var config=require(_0xb013('0x7'));var jayson=require(_0xb013('0x8'));var client=jayson[_0xb013('0x9')][_0xb013('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x752b18,_0x53bf02,_0x419ba9){return new BPromise(function(_0x4bd2a1,_0x303057){return client['request'](_0x752b18,_0x419ba9)[_0xb013('0xb')](function(_0x223210){logger[_0xb013('0xc')](_0xb013('0xd'),_0x53bf02,_0xb013('0xe'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x53bf02,_0xb013('0xe'),JSON['stringify'](_0x223210));if(_0x223210[_0xb013('0xf')]){if(_0x223210[_0xb013('0xf')]['code']===0x1f4){logger[_0xb013('0xf')](_0xb013('0xd'),_0x53bf02,_0x223210['error']['message']);return _0x303057(_0x223210[_0xb013('0xf')]['message']);}logger[_0xb013('0xf')](_0xb013('0xd'),_0x53bf02,_0x223210[_0xb013('0xf')]['message']);return _0x4bd2a1(_0x223210[_0xb013('0xf')][_0xb013('0x10')]);}else{logger[_0xb013('0xc')](_0xb013('0xd'),_0x53bf02,'request\x20sent');_0x4bd2a1(_0x223210['result'][_0xb013('0x10')]);}})[_0xb013('0x11')](function(_0x1b5c6e){logger[_0xb013('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x53bf02,_0x1b5c6e);_0x303057(_0x1b5c6e);});});}
\ No newline at end of file
index d4331f5..6bc760d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ccb=['Router','fs-extra','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','update','exports','multer','util','path','connect-timeout'];(function(_0x4628c6,_0x212c5e){var _0x181ddc=function(_0x36280a){while(--_0x36280a){_0x4628c6['push'](_0x4628c6['shift']());}};_0x181ddc(++_0x212c5e);}(_0x4ccb,0x1a5));var _0xb4cc=function(_0x49d22a,_0x2adfe8){_0x49d22a=_0x49d22a-0x0;var _0x4a0028=_0x4ccb[_0x49d22a];return _0x4a0028;};'use strict';var multer=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var path=require(_0xb4cc('0x2'));var timeout=require(_0xb4cc('0x3'));var express=require('express');var router=express[_0xb4cc('0x4')]();var fs_extra=require(_0xb4cc('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb4cc('0x6'));var controller=require(_0xb4cc('0x7'));router[_0xb4cc('0x8')]('/',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xa')]);router[_0xb4cc('0x8')](_0xb4cc('0xb'),auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xc')]);router[_0xb4cc('0xd')]('/',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xe')]);router['put']('/:id',auth[_0xb4cc('0x9')](),controller[_0xb4cc('0xf')]);router['delete'](_0xb4cc('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xb4cc('0x10')]=router;
\ No newline at end of file
+var _0x9974=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x4c825c,_0x123fbd){var _0x510e46=function(_0x4d78a9){while(--_0x4d78a9){_0x4c825c['push'](_0x4c825c['shift']());}};_0x510e46(++_0x123fbd);}(_0x9974,0xb1));var _0x4997=function(_0x57d9e0,_0xadcc2f){_0x57d9e0=_0x57d9e0-0x0;var _0x2a2e6a=_0x9974[_0x57d9e0];return _0x2a2e6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4997('0x0'));var timeout=require(_0x4997('0x1'));var express=require(_0x4997('0x2'));var router=express[_0x4997('0x3')]();var fs_extra=require(_0x4997('0x4'));var auth=require(_0x4997('0x5'));var interaction=require(_0x4997('0x6'));var config=require(_0x4997('0x7'));var controller=require('./intZohoField.controller');router[_0x4997('0x8')]('/',auth['isAuthenticated'](),controller[_0x4997('0x9')]);router[_0x4997('0x8')](_0x4997('0xa'),auth[_0x4997('0xb')](),controller[_0x4997('0xc')]);router[_0x4997('0xd')]('/',auth['isAuthenticated'](),controller[_0x4997('0xe')]);router[_0x4997('0xf')](_0x4997('0xa'),auth[_0x4997('0xb')](),controller[_0x4997('0x10')]);router[_0x4997('0x11')]('/:id',auth[_0x4997('0xb')](),controller[_0x4997('0x12')]);module[_0x4997('0x13')]=router;
\ No newline at end of file
index 1306fdc..d9677b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fcf=['string','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1e7c22,_0x485d2c){var _0x572ff7=function(_0x436cfe){while(--_0x436cfe){_0x1e7c22['push'](_0x1e7c22['shift']());}};_0x572ff7(++_0x485d2c);}(_0x5fcf,0x19f));var _0xf5fc=function(_0x1a790c,_0x320244){_0x1a790c=_0x1a790c-0x0;var _0x12af5e=_0x5fcf[_0x1a790c];return _0x12af5e;};'use strict';var Sequelize=require(_0xf5fc('0x0'));module[_0xf5fc('0x1')]={'type':{'type':Sequelize[_0xf5fc('0x2')]('string',_0xf5fc('0x3'),_0xf5fc('0x4'),_0xf5fc('0x5'),_0xf5fc('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf5fc('0x7')]},'key':{'type':Sequelize[_0xf5fc('0x7')]},'keyType':{'type':Sequelize[_0xf5fc('0x2')](_0xf5fc('0x8'),_0xf5fc('0x3'),_0xf5fc('0x4'))},'keyContent':{'type':Sequelize[_0xf5fc('0x7')]},'idField':{'type':Sequelize[_0xf5fc('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf5fc('0x7')]}};
\ No newline at end of file
+var _0x95f9=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0xb72e55,_0x1e6520){var _0x2b6271=function(_0x2ea164){while(--_0x2ea164){_0xb72e55['push'](_0xb72e55['shift']());}};_0x2b6271(++_0x1e6520);}(_0x95f9,0x105));var _0x995f=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x95f9[_0x2df507];return _0x1f7167;};'use strict';var Sequelize=require(_0x995f('0x0'));module[_0x995f('0x1')]={'type':{'type':Sequelize[_0x995f('0x2')](_0x995f('0x3'),_0x995f('0x4'),_0x995f('0x5'),_0x995f('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x995f('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x995f('0x2')](_0x995f('0x3'),_0x995f('0x4'),_0x995f('0x5'))},'keyContent':{'type':Sequelize[_0x995f('0x7')]},'idField':{'type':Sequelize[_0x995f('0x7')]},'nameField':{'type':Sequelize[_0x995f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 84d05d4..569d8a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d41=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','ZohoField','fieldName','type','model','query','keys'];(function(_0x2657c1,_0x50043d){var _0x2a94c3=function(_0x6915e2){while(--_0x6915e2){_0x2657c1['push'](_0x2657c1['shift']());}};_0x2a94c3(++_0x50043d);}(_0x2d41,0x1dd));var _0x12d4=function(_0x1130b6,_0xb58cb8){_0x1130b6=_0x1130b6-0x0;var _0x1da4ff=_0x2d41[_0x1130b6];return _0x1da4ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x12d4('0x0'));var jsonpatch=require(_0x12d4('0x1'));var rp=require(_0x12d4('0x2'));var moment=require(_0x12d4('0x3'));var BPromise=require(_0x12d4('0x4'));var Mustache=require(_0x12d4('0x5'));var util=require(_0x12d4('0x6'));var path=require(_0x12d4('0x7'));var sox=require(_0x12d4('0x8'));var csv=require(_0x12d4('0x9'));var ejs=require(_0x12d4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x12d4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x12d4('0xc'));var toCsv=require(_0x12d4('0x9'));var querystring=require(_0x12d4('0xd'));var Papa=require(_0x12d4('0xe'));var Redis=require('ioredis');var authService=require(_0x12d4('0xf'));var qs=require(_0x12d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12d4('0x11'));var logger=require('../../config/logger')(_0x12d4('0x12'));var utils=require(_0x12d4('0x13'));var config=require(_0x12d4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x12d4('0x15'))['db'];function respondWithStatusCode(_0x5402a8,_0x17389a){_0x17389a=_0x17389a||0xcc;return function(_0x41d9cf){if(_0x41d9cf){return _0x5402a8[_0x12d4('0x16')](_0x17389a);}return _0x5402a8[_0x12d4('0x17')](_0x17389a)[_0x12d4('0x18')]();};}function respondWithResult(_0x3bfcfc,_0x2cb158){_0x2cb158=_0x2cb158||0xc8;return function(_0x56b8f0){if(_0x56b8f0){return _0x3bfcfc[_0x12d4('0x17')](_0x2cb158)[_0x12d4('0x19')](_0x56b8f0);}};}function respondWithFilteredResult(_0x23167a,_0x216096){return function(_0x495ff5){if(_0x495ff5){var _0xb42239=typeof _0x216096[_0x12d4('0x1a')]==='undefined'&&typeof _0x216096[_0x12d4('0x1b')]===_0x12d4('0x1c');var _0x52317c=_0x495ff5[_0x12d4('0x1d')];var _0x40a968=_0xb42239?0x0:_0x216096[_0x12d4('0x1a')];var _0x753e00=_0xb42239?_0x495ff5[_0x12d4('0x1d')]:_0x216096[_0x12d4('0x1a')]+_0x216096['limit'];var _0x9ee105;if(_0x753e00>=_0x52317c){_0x753e00=_0x52317c;_0x9ee105=0xc8;}else{_0x9ee105=0xce;}_0x23167a[_0x12d4('0x17')](_0x9ee105);return _0x23167a[_0x12d4('0x1e')](_0x12d4('0x1f'),_0x40a968+'-'+_0x753e00+'/'+_0x52317c)[_0x12d4('0x19')](_0x495ff5);}return null;};}function patchUpdates(_0x11230d){return function(_0x103d66){try{jsonpatch[_0x12d4('0x20')](_0x103d66,_0x11230d,!![]);}catch(_0x57bf9b){return BPromise[_0x12d4('0x21')](_0x57bf9b);}return _0x103d66[_0x12d4('0x22')]();};}function saveUpdates(_0x112486,_0x2c9561){return function(_0x1938ff){if(_0x1938ff){return _0x1938ff[_0x12d4('0x23')](_0x112486)['then'](function(_0x30743e){return _0x30743e;});}return null;};}function removeEntity(_0x56fb0a,_0x520924){return function(_0x17cc9e){if(_0x17cc9e){return _0x17cc9e['destroy']()['then'](function(){_0x56fb0a['status'](0xcc)[_0x12d4('0x18')]();});}};}function handleEntityNotFound(_0x404b77,_0x58c92c){return function(_0x321ad2){if(!_0x321ad2){_0x404b77[_0x12d4('0x16')](0x194);}return _0x321ad2;};}function handleError(_0x29e391,_0xdafe7c){_0xdafe7c=_0xdafe7c||0x1f4;return function(_0x4a0fc0){logger[_0x12d4('0x24')](_0x4a0fc0[_0x12d4('0x25')]);if(_0x4a0fc0['name']){delete _0x4a0fc0[_0x12d4('0x26')];}_0x29e391['status'](_0xdafe7c)[_0x12d4('0x27')](_0x4a0fc0);};}exports[_0x12d4('0x28')]=function(_0x1db949,_0x5657ab){var _0x3494cd={},_0x4ea1c1={},_0x43603e={'count':0x0,'rows':[]};var _0x25eddb=_[_0x12d4('0x29')](db[_0x12d4('0x2a')]['rawAttributes'],function(_0x4d482d){return{'name':_0x4d482d[_0x12d4('0x2b')],'type':_0x4d482d[_0x12d4('0x2c')]['key']};});_0x4ea1c1[_0x12d4('0x2d')]=_[_0x12d4('0x29')](_0x25eddb,_0x12d4('0x26'));_0x4ea1c1[_0x12d4('0x2e')]=_[_0x12d4('0x2f')](_0x1db949[_0x12d4('0x2e')]);_0x4ea1c1[_0x12d4('0x30')]=_[_0x12d4('0x31')](_0x4ea1c1['model'],_0x4ea1c1[_0x12d4('0x2e')]);_0x3494cd[_0x12d4('0x32')]=_[_0x12d4('0x31')](_0x4ea1c1[_0x12d4('0x2d')],qs[_0x12d4('0x33')](_0x1db949[_0x12d4('0x2e')]['fields']));_0x3494cd[_0x12d4('0x32')]=_0x3494cd[_0x12d4('0x32')]['length']?_0x3494cd[_0x12d4('0x32')]:_0x4ea1c1['model'];if(!_0x1db949[_0x12d4('0x2e')][_0x12d4('0x34')](_0x12d4('0x35'))){_0x3494cd[_0x12d4('0x1b')]=qs[_0x12d4('0x1b')](_0x1db949[_0x12d4('0x2e')][_0x12d4('0x1b')]);_0x3494cd[_0x12d4('0x1a')]=qs[_0x12d4('0x1a')](_0x1db949[_0x12d4('0x2e')][_0x12d4('0x1a')]);}_0x3494cd[_0x12d4('0x36')]=qs[_0x12d4('0x37')](_0x1db949[_0x12d4('0x2e')][_0x12d4('0x37')]);_0x3494cd[_0x12d4('0x38')]=qs['filters'](_['pick'](_0x1db949[_0x12d4('0x2e')],_0x4ea1c1[_0x12d4('0x30')]),_0x25eddb);if(_0x1db949[_0x12d4('0x2e')][_0x12d4('0x39')]){_0x3494cd[_0x12d4('0x38')]=_[_0x12d4('0x3a')](_0x3494cd[_0x12d4('0x38')],{'$or':_[_0x12d4('0x29')](_0x25eddb,function(_0x111b5e){if(_0x111b5e[_0x12d4('0x2c')]!==_0x12d4('0x3b')){var _0x2f2664={};_0x2f2664[_0x111b5e[_0x12d4('0x26')]]={'$like':'%'+_0x1db949[_0x12d4('0x2e')][_0x12d4('0x39')]+'%'};return _0x2f2664;}})});}_0x3494cd=_['merge']({},_0x3494cd,_0x1db949[_0x12d4('0x3c')]);var _0x2045f2={'where':_0x3494cd[_0x12d4('0x38')]};return db[_0x12d4('0x2a')][_0x12d4('0x1d')](_0x2045f2)[_0x12d4('0x3d')](function(_0x41001a){_0x43603e[_0x12d4('0x1d')]=_0x41001a;if(_0x1db949[_0x12d4('0x2e')][_0x12d4('0x3e')]){_0x3494cd[_0x12d4('0x3f')]=[{'all':!![]}];}return db[_0x12d4('0x2a')][_0x12d4('0x40')](_0x3494cd);})[_0x12d4('0x3d')](function(_0x42355f){_0x43603e[_0x12d4('0x41')]=_0x42355f;return _0x43603e;})[_0x12d4('0x3d')](respondWithFilteredResult(_0x5657ab,_0x3494cd))[_0x12d4('0x42')](handleError(_0x5657ab,null));};exports[_0x12d4('0x43')]=function(_0x94da64,_0x409c7a){var _0x24d654={'raw':!![],'where':{'id':_0x94da64[_0x12d4('0x44')]['id']}},_0x225a71={};_0x225a71[_0x12d4('0x2d')]=_[_0x12d4('0x2f')](db['ZohoField'][_0x12d4('0x45')]);_0x225a71[_0x12d4('0x2e')]=_[_0x12d4('0x2f')](_0x94da64[_0x12d4('0x2e')]);_0x225a71[_0x12d4('0x30')]=_['intersection'](_0x225a71[_0x12d4('0x2d')],_0x225a71[_0x12d4('0x2e')]);_0x24d654['attributes']=_[_0x12d4('0x31')](_0x225a71[_0x12d4('0x2d')],qs[_0x12d4('0x33')](_0x94da64['query']['fields']));_0x24d654[_0x12d4('0x32')]=_0x24d654[_0x12d4('0x32')][_0x12d4('0x46')]?_0x24d654['attributes']:_0x225a71[_0x12d4('0x2d')];if(_0x94da64[_0x12d4('0x2e')]['includeAll']){_0x24d654[_0x12d4('0x3f')]=[{'all':!![]}];}_0x24d654=_[_0x12d4('0x3a')]({},_0x24d654,_0x94da64[_0x12d4('0x3c')]);return db['ZohoField'][_0x12d4('0x47')](_0x24d654)['then'](handleEntityNotFound(_0x409c7a,null))['then'](respondWithResult(_0x409c7a,null))[_0x12d4('0x42')](handleError(_0x409c7a,null));};exports[_0x12d4('0x48')]=function(_0x142651,_0x4d2a45){return db[_0x12d4('0x2a')]['create'](_0x142651[_0x12d4('0x49')],{})[_0x12d4('0x3d')](respondWithResult(_0x4d2a45,0xc9))[_0x12d4('0x42')](handleError(_0x4d2a45,null));};exports[_0x12d4('0x23')]=function(_0x5ab936,_0x4fccfe){if(_0x5ab936[_0x12d4('0x49')]['id']){delete _0x5ab936['body']['id'];}return db['ZohoField']['find']({'where':{'id':_0x5ab936[_0x12d4('0x44')]['id']}})[_0x12d4('0x3d')](handleEntityNotFound(_0x4fccfe,null))[_0x12d4('0x3d')](saveUpdates(_0x5ab936[_0x12d4('0x49')],null))['then'](respondWithResult(_0x4fccfe,null))['catch'](handleError(_0x4fccfe,null));};exports[_0x12d4('0x4a')]=function(_0x95b5,_0x2c6a6e){return db['ZohoField'][_0x12d4('0x47')]({'where':{'id':_0x95b5['params']['id']}})[_0x12d4('0x3d')](handleEntityNotFound(_0x2c6a6e,null))[_0x12d4('0x3d')](removeEntity(_0x2c6a6e,null))['catch'](handleError(_0x2c6a6e,null));};
\ No newline at end of file
+var _0x802a=['includeAll','include','rows','catch','show','length','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options'];(function(_0x4932a6,_0x530e29){var _0x3b45b9=function(_0x1d1eb7){while(--_0x1d1eb7){_0x4932a6['push'](_0x4932a6['shift']());}};_0x3b45b9(++_0x530e29);}(_0x802a,0xe5));var _0xa802=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x802a[_0x1da527];return _0x40fc7c;};'use strict';var emlformat=require(_0xa802('0x0'));var rimraf=require(_0xa802('0x1'));var zipdir=require(_0xa802('0x2'));var jsonpatch=require(_0xa802('0x3'));var rp=require('request-promise');var moment=require(_0xa802('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa802('0x5'));var path=require(_0xa802('0x6'));var sox=require(_0xa802('0x7'));var csv=require(_0xa802('0x8'));var ejs=require(_0xa802('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa802('0xa'));var squel=require('squel');var crypto=require(_0xa802('0xb'));var jsforce=require(_0xa802('0xc'));var deskjs=require(_0xa802('0xd'));var toCsv=require(_0xa802('0x8'));var querystring=require(_0xa802('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa802('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa802('0x10'));var hardwareService=require(_0xa802('0x11'));var logger=require(_0xa802('0x12'))(_0xa802('0x13'));var utils=require(_0xa802('0x14'));var config=require(_0xa802('0x15'));var licenseUtil=require(_0xa802('0x16'));var db=require(_0xa802('0x17'))['db'];function respondWithStatusCode(_0x527853,_0x34bbee){_0x34bbee=_0x34bbee||0xcc;return function(_0x56e947){if(_0x56e947){return _0x527853[_0xa802('0x18')](_0x34bbee);}return _0x527853[_0xa802('0x19')](_0x34bbee)['end']();};}function respondWithResult(_0x1d145d,_0x3b5bba){_0x3b5bba=_0x3b5bba||0xc8;return function(_0x8ef489){if(_0x8ef489){return _0x1d145d[_0xa802('0x19')](_0x3b5bba)[_0xa802('0x1a')](_0x8ef489);}};}function respondWithFilteredResult(_0x3f23f5,_0x490b7c){return function(_0x53e939){if(_0x53e939){var _0x5dbaff=typeof _0x490b7c[_0xa802('0x1b')]===_0xa802('0x1c')&&typeof _0x490b7c[_0xa802('0x1d')]===_0xa802('0x1c');var _0x4e3dd3=_0x53e939[_0xa802('0x1e')];var _0x245cb9=_0x5dbaff?0x0:_0x490b7c[_0xa802('0x1b')];var _0x35fbf2=_0x5dbaff?_0x53e939[_0xa802('0x1e')]:_0x490b7c['offset']+_0x490b7c[_0xa802('0x1d')];var _0x52ecac;if(_0x35fbf2>=_0x4e3dd3){_0x35fbf2=_0x4e3dd3;_0x52ecac=0xc8;}else{_0x52ecac=0xce;}_0x3f23f5[_0xa802('0x19')](_0x52ecac);return _0x3f23f5[_0xa802('0x1f')](_0xa802('0x20'),_0x245cb9+'-'+_0x35fbf2+'/'+_0x4e3dd3)[_0xa802('0x1a')](_0x53e939);}return null;};}function patchUpdates(_0x213c0c){return function(_0x21d633){try{jsonpatch[_0xa802('0x21')](_0x21d633,_0x213c0c,!![]);}catch(_0x4391cc){return BPromise['reject'](_0x4391cc);}return _0x21d633[_0xa802('0x22')]();};}function saveUpdates(_0x235fea,_0x469993){return function(_0x4daadc){if(_0x4daadc){return _0x4daadc[_0xa802('0x23')](_0x235fea)['then'](function(_0x7c8a3d){return _0x7c8a3d;});}return null;};}function removeEntity(_0x51ef76,_0xad1791){return function(_0x1b4d99){if(_0x1b4d99){return _0x1b4d99[_0xa802('0x24')]()[_0xa802('0x25')](function(){_0x51ef76[_0xa802('0x19')](0xcc)[_0xa802('0x26')]();});}};}function handleEntityNotFound(_0x37a5e8,_0x578974){return function(_0x55e06a){if(!_0x55e06a){_0x37a5e8['sendStatus'](0x194);}return _0x55e06a;};}function handleError(_0x3f5f77,_0x3edd86){_0x3edd86=_0x3edd86||0x1f4;return function(_0x1a19fb){logger[_0xa802('0x27')](_0x1a19fb['stack']);if(_0x1a19fb[_0xa802('0x28')]){delete _0x1a19fb[_0xa802('0x28')];}_0x3f5f77[_0xa802('0x19')](_0x3edd86)[_0xa802('0x29')](_0x1a19fb);};}exports[_0xa802('0x2a')]=function(_0xb79b07,_0x36db64){var _0x475ca4={},_0x2d4f23={},_0x4b82a3={'count':0x0,'rows':[]};var _0x86a18d=_[_0xa802('0x2b')](db[_0xa802('0x2c')][_0xa802('0x2d')],function(_0x34afc5){return{'name':_0x34afc5[_0xa802('0x2e')],'type':_0x34afc5[_0xa802('0x2f')]['key']};});_0x2d4f23[_0xa802('0x30')]=_[_0xa802('0x2b')](_0x86a18d,_0xa802('0x28'));_0x2d4f23[_0xa802('0x31')]=_[_0xa802('0x32')](_0xb79b07['query']);_0x2d4f23[_0xa802('0x33')]=_[_0xa802('0x34')](_0x2d4f23[_0xa802('0x30')],_0x2d4f23[_0xa802('0x31')]);_0x475ca4[_0xa802('0x35')]=_[_0xa802('0x34')](_0x2d4f23[_0xa802('0x30')],qs['fields'](_0xb79b07[_0xa802('0x31')][_0xa802('0x36')]));_0x475ca4['attributes']=_0x475ca4[_0xa802('0x35')]['length']?_0x475ca4[_0xa802('0x35')]:_0x2d4f23['model'];if(!_0xb79b07[_0xa802('0x31')][_0xa802('0x37')]('nolimit')){_0x475ca4[_0xa802('0x1d')]=qs[_0xa802('0x1d')](_0xb79b07['query'][_0xa802('0x1d')]);_0x475ca4[_0xa802('0x1b')]=qs['offset'](_0xb79b07['query'][_0xa802('0x1b')]);}_0x475ca4[_0xa802('0x38')]=qs[_0xa802('0x39')](_0xb79b07[_0xa802('0x31')][_0xa802('0x39')]);_0x475ca4[_0xa802('0x3a')]=qs['filters'](_['pick'](_0xb79b07[_0xa802('0x31')],_0x2d4f23[_0xa802('0x33')]),_0x86a18d);if(_0xb79b07['query']['filter']){_0x475ca4['where']=_[_0xa802('0x3b')](_0x475ca4['where'],{'$or':_[_0xa802('0x2b')](_0x86a18d,function(_0x5b4fe3){if(_0x5b4fe3[_0xa802('0x2f')]!==_0xa802('0x3c')){var _0x18758d={};_0x18758d[_0x5b4fe3[_0xa802('0x28')]]={'$like':'%'+_0xb79b07[_0xa802('0x31')][_0xa802('0x3d')]+'%'};return _0x18758d;}})});}_0x475ca4=_['merge']({},_0x475ca4,_0xb79b07[_0xa802('0x3e')]);var _0x1cce9e={'where':_0x475ca4[_0xa802('0x3a')]};return db['ZohoField'][_0xa802('0x1e')](_0x1cce9e)[_0xa802('0x25')](function(_0x5f29bd){_0x4b82a3[_0xa802('0x1e')]=_0x5f29bd;if(_0xb79b07['query'][_0xa802('0x3f')]){_0x475ca4[_0xa802('0x40')]=[{'all':!![]}];}return db[_0xa802('0x2c')]['findAll'](_0x475ca4);})[_0xa802('0x25')](function(_0x323823){_0x4b82a3[_0xa802('0x41')]=_0x323823;return _0x4b82a3;})[_0xa802('0x25')](respondWithFilteredResult(_0x36db64,_0x475ca4))[_0xa802('0x42')](handleError(_0x36db64,null));};exports[_0xa802('0x43')]=function(_0x585eac,_0x48024c){var _0x14eff3={'raw':!![],'where':{'id':_0x585eac['params']['id']}},_0x30d193={};_0x30d193[_0xa802('0x30')]=_['keys'](db['ZohoField'][_0xa802('0x2d')]);_0x30d193[_0xa802('0x31')]=_[_0xa802('0x32')](_0x585eac[_0xa802('0x31')]);_0x30d193[_0xa802('0x33')]=_[_0xa802('0x34')](_0x30d193[_0xa802('0x30')],_0x30d193[_0xa802('0x31')]);_0x14eff3['attributes']=_[_0xa802('0x34')](_0x30d193['model'],qs[_0xa802('0x36')](_0x585eac[_0xa802('0x31')]['fields']));_0x14eff3['attributes']=_0x14eff3[_0xa802('0x35')][_0xa802('0x44')]?_0x14eff3[_0xa802('0x35')]:_0x30d193[_0xa802('0x30')];if(_0x585eac[_0xa802('0x31')]['includeAll']){_0x14eff3['include']=[{'all':!![]}];}_0x14eff3=_[_0xa802('0x3b')]({},_0x14eff3,_0x585eac[_0xa802('0x3e')]);return db[_0xa802('0x2c')]['find'](_0x14eff3)[_0xa802('0x25')](handleEntityNotFound(_0x48024c,null))['then'](respondWithResult(_0x48024c,null))[_0xa802('0x42')](handleError(_0x48024c,null));};exports[_0xa802('0x45')]=function(_0x5ab6a4,_0x1f17ab){return db['ZohoField'][_0xa802('0x45')](_0x5ab6a4[_0xa802('0x46')],{})[_0xa802('0x25')](respondWithResult(_0x1f17ab,0xc9))[_0xa802('0x42')](handleError(_0x1f17ab,null));};exports[_0xa802('0x23')]=function(_0x56edde,_0x4e71c0){if(_0x56edde[_0xa802('0x46')]['id']){delete _0x56edde[_0xa802('0x46')]['id'];}return db[_0xa802('0x2c')][_0xa802('0x47')]({'where':{'id':_0x56edde[_0xa802('0x48')]['id']}})[_0xa802('0x25')](handleEntityNotFound(_0x4e71c0,null))[_0xa802('0x25')](saveUpdates(_0x56edde[_0xa802('0x46')],null))[_0xa802('0x25')](respondWithResult(_0x4e71c0,null))[_0xa802('0x42')](handleError(_0x4e71c0,null));};exports['destroy']=function(_0xc150c9,_0x17e1cf){return db[_0xa802('0x2c')][_0xa802('0x47')]({'where':{'id':_0xc150c9[_0xa802('0x48')]['id']}})[_0xa802('0x25')](handleEntityNotFound(_0x17e1cf,null))[_0xa802('0x25')](removeEntity(_0x17e1cf,null))['catch'](handleError(_0x17e1cf,null));};
\ No newline at end of file
index eec4208..8cc6008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd046=['util','../../config/logger','api','bluebird','rimraf','./intZohoField.attributes','define','zoho_unique_index','idField'];(function(_0x2bc3dc,_0x335431){var _0x2517ea=function(_0x80cff9){while(--_0x80cff9){_0x2bc3dc['push'](_0x2bc3dc['shift']());}};_0x2517ea(++_0x335431);}(_0xd046,0x129));var _0x6d04=function(_0x3a213b,_0x1626a6){_0x3a213b=_0x3a213b-0x0;var _0x1353cd=_0xd046[_0x3a213b];return _0x1353cd;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var logger=require(_0x6d04('0x1'))(_0x6d04('0x2'));var moment=require('moment');var BPromise=require(_0x6d04('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d04('0x4'));var config=require('../../config/environment');var attributes=require(_0x6d04('0x5'));module['exports']=function(_0x4bacb1,_0xf3b4e7){return _0x4bacb1[_0x6d04('0x6')]('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x6d04('0x7'),'fields':[_0x6d04('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4137=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9c6e38,_0x1fc24e){var _0x148e08=function(_0x415b66){while(--_0x415b66){_0x9c6e38['push'](_0x9c6e38['shift']());}};_0x148e08(++_0x1fc24e);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));module[_0x7413('0xb')]=function(_0x4fbade,_0xc808cd){return _0x4fbade[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':_0x7413('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x7413('0xf'),_0x7413('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4899026..c36071f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ba0=['code','ZohoField,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x50c947,_0x5c1f4d){var _0x48bae3=function(_0x35392b){while(--_0x35392b){_0x50c947['push'](_0x50c947['shift']());}};_0x48bae3(++_0x5c1f4d);}(_0x0ba0,0x195));var _0x00ba=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x0ba0[_0x2f45ea];return _0x485a84;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x00ba('0x0'));var BPromise=require(_0x00ba('0x1'));var rs=require(_0x00ba('0x2'));var fs=require('fs');var Redis=require(_0x00ba('0x3'));var db=require(_0x00ba('0x4'))['db'];var utils=require(_0x00ba('0x5'));var logger=require('../../config/logger')(_0x00ba('0x6'));var config=require(_0x00ba('0x7'));var jayson=require(_0x00ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x48988f,_0x3ce784,_0x3e3554){return new BPromise(function(_0x4359e7,_0x552d13){return client['request'](_0x48988f,_0x3e3554)[_0x00ba('0x9')](function(_0x4574ae){logger[_0x00ba('0xa')]('ZohoField,\x20%s,\x20%s',_0x3ce784,_0x00ba('0xb'));logger[_0x00ba('0xc')](_0x00ba('0xd'),_0x3ce784,'request\x20sent',JSON['stringify'](_0x4574ae));if(_0x4574ae[_0x00ba('0xe')]){if(_0x4574ae[_0x00ba('0xe')][_0x00ba('0xf')]===0x1f4){logger[_0x00ba('0xe')](_0x00ba('0x10'),_0x3ce784,_0x4574ae[_0x00ba('0xe')][_0x00ba('0x11')]);return _0x552d13(_0x4574ae[_0x00ba('0xe')][_0x00ba('0x11')]);}logger[_0x00ba('0xe')](_0x00ba('0x10'),_0x3ce784,_0x4574ae[_0x00ba('0xe')][_0x00ba('0x11')]);return _0x4359e7(_0x4574ae[_0x00ba('0xe')][_0x00ba('0x11')]);}else{logger[_0x00ba('0xa')]('ZohoField,\x20%s,\x20%s',_0x3ce784,_0x00ba('0xb'));_0x4359e7(_0x4574ae[_0x00ba('0x12')][_0x00ba('0x11')]);}})[_0x00ba('0x13')](function(_0x2699c9){logger[_0x00ba('0xe')](_0x00ba('0x10'),_0x3ce784,_0x2699c9);_0x552d13(_0x2699c9);});});}
\ No newline at end of file
+var _0xe392=['ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug'];(function(_0xa704d,_0x1fc249){var _0x39d517=function(_0x3cbf8b){while(--_0x3cbf8b){_0xa704d['push'](_0xa704d['shift']());}};_0x39d517(++_0x1fc249);}(_0xe392,0x11c));var _0x2e39=function(_0x3fc170,_0x3045fc){_0x3fc170=_0x3fc170-0x0;var _0x404f7f=_0xe392[_0x3fc170];return _0x404f7f;};'use strict';var _=require(_0x2e39('0x0'));var util=require(_0x2e39('0x1'));var moment=require('moment');var BPromise=require(_0x2e39('0x2'));var rs=require(_0x2e39('0x3'));var fs=require('fs');var Redis=require(_0x2e39('0x4'));var db=require(_0x2e39('0x5'))['db'];var utils=require(_0x2e39('0x6'));var logger=require(_0x2e39('0x7'))(_0x2e39('0x8'));var config=require(_0x2e39('0x9'));var jayson=require(_0x2e39('0xa'));var client=jayson['client'][_0x2e39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x730c5b,_0x5477dc,_0x47e628){return new BPromise(function(_0x40b556,_0x175ea1){return client['request'](_0x730c5b,_0x47e628)['then'](function(_0x2c4d78){logger[_0x2e39('0xc')]('ZohoField,\x20%s,\x20%s',_0x5477dc,_0x2e39('0xd'));logger[_0x2e39('0xe')](_0x2e39('0xf'),_0x5477dc,_0x2e39('0xd'),JSON[_0x2e39('0x10')](_0x2c4d78));if(_0x2c4d78[_0x2e39('0x11')]){if(_0x2c4d78[_0x2e39('0x11')][_0x2e39('0x12')]===0x1f4){logger['error'](_0x2e39('0x13'),_0x5477dc,_0x2c4d78['error']['message']);return _0x175ea1(_0x2c4d78[_0x2e39('0x11')]['message']);}logger[_0x2e39('0x11')](_0x2e39('0x13'),_0x5477dc,_0x2c4d78[_0x2e39('0x11')][_0x2e39('0x14')]);return _0x40b556(_0x2c4d78[_0x2e39('0x11')]['message']);}else{logger[_0x2e39('0xc')](_0x2e39('0x13'),_0x5477dc,'request\x20sent');_0x40b556(_0x2c4d78[_0x2e39('0x15')][_0x2e39('0x14')]);}})[_0x2e39('0x16')](function(_0x258e50){logger[_0x2e39('0x11')](_0x2e39('0x13'),_0x5477dc,_0x258e50);_0x175ea1(_0x258e50);});});}
\ No newline at end of file
index dad1e9c..632d400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2f210a,_0x5b8377){var _0x3b7548=function(_0x393dfd){while(--_0x393dfd){_0x2f210a['push'](_0x2f210a['shift']());}};_0x3b7548(++_0x5b8377);}(_0x70e0,0x17b));var _0x070e=function(_0xe6555a,_0xa8c790){_0xe6555a=_0xe6555a-0x0;var _0x5cba48=_0x70e0[_0xe6555a];return _0x5cba48;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xd4d369,_0x4f6ad2){var _0x293e5d=function(_0xb0e6a4){while(--_0xb0e6a4){_0xd4d369['push'](_0xd4d369['shift']());}};_0x293e5d(++_0x4f6ad2);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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 edb1474..c7bb4ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2dc=['unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xc2dc,0x106));var _0xcc2d=function(_0x594670,_0x4b9fdd){_0x594670=_0x594670-0x0;var _0x36a5b7=_0xc2dc[_0x594670];return _0x36a5b7;};'use strict';var Sequelize=require(_0xcc2d('0x0'));module[_0xcc2d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcc2d('0x2')},'version':{'type':Sequelize[_0xcc2d('0x3')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0xcc2d('0x4')},'filename':{'type':Sequelize[_0xcc2d('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xcc2d('0x5')]},'active':{'type':Sequelize[_0xcc2d('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xcc2d('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xcc2d('0x7')},'description':{'type':Sequelize[_0xcc2d('0x3')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcc2d('0x3')]},'link':{'type':Sequelize[_0xcc2d('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xbe06=['STRING','unique_name_and_version','app.js','INTEGER','sequelize'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xbe06,0x144));var _0x6be0=function(_0x4c1f32,_0x124738){_0x4c1f32=_0x4c1f32-0x0;var _0x5b0e7f=_0xbe06[_0x4c1f32];return _0x5b0e7f;};'use strict';var Sequelize=require(_0x6be0('0x0'));module['exports']={'name':{'type':Sequelize[_0x6be0('0x1')],'allowNull':![],'unique':_0x6be0('0x2')},'version':{'type':Sequelize[_0x6be0('0x1')],'allowNull':![],'unique':_0x6be0('0x2')},'main':{'type':Sequelize[_0x6be0('0x1')],'defaultValue':_0x6be0('0x3')},'filename':{'type':Sequelize[_0x6be0('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6be0('0x1')]},'size':{'type':Sequelize[_0x6be0('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x6be0('0x1')],'unique':'state'},'description':{'type':Sequelize[_0x6be0('0x1')]},'title':{'type':Sequelize[_0x6be0('0x1')]},'remoteUri':{'type':Sequelize[_0x6be0('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index 623cc47..66909fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xadb5,0xad));var _0x5adb=function(_0x189257,_0x186e7f){_0x189257=_0x189257-0x0;var _0x399b7e=_0xadb5[_0x189257];return _0x399b7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
+var _0x9f0e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x4eacbe,_0x2a0b4f){var _0x33e818=function(_0x2bf3a4){while(--_0x2bf3a4){_0x4eacbe['push'](_0x4eacbe['shift']());}};_0x33e818(++_0x2a0b4f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x4e6c76,_0x30a298){_0x4e6c76=_0x4e6c76-0x0;var _0x141ffa=_0x9f0e[_0x4e6c76];return _0x141ffa;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['Integration'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['Integration'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['Integration'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};
\ No newline at end of file
index 94c46eb..15254fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe952=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./integration.attributes'];(function(_0x231f99,_0x132ecc){var _0x1048ca=function(_0xe3068b){while(--_0xe3068b){_0x231f99['push'](_0x231f99['shift']());}};_0x1048ca(++_0x132ecc);}(_0xe952,0x14c));var _0x2e95=function(_0x57a6f3,_0x15ae46){_0x57a6f3=_0x57a6f3-0x0;var _0x580317=_0xe952[_0x57a6f3];return _0x580317;};'use strict';var _=require(_0x2e95('0x0'));var util=require(_0x2e95('0x1'));var logger=require(_0x2e95('0x2'))(_0x2e95('0x3'));var moment=require(_0x2e95('0x4'));var BPromise=require('bluebird');var rp=require(_0x2e95('0x5'));var fs=require('fs');var path=require(_0x2e95('0x6'));var rimraf=require(_0x2e95('0x7'));var config=require('../../config/environment');var attributes=require(_0x2e95('0x8'));module[_0x2e95('0x9')]=function(_0x2322fa,_0x159fc0){return _0x2322fa[_0x2e95('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1363=['moment','bluebird','request-promise','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util'];(function(_0x1bb030,_0x27d05f){var _0x28ef4f=function(_0xb1150e){while(--_0xb1150e){_0x1bb030['push'](_0x1bb030['shift']());}};_0x28ef4f(++_0x27d05f);}(_0x1363,0x1d7));var _0x3136=function(_0x54b19a,_0x123ecc){_0x54b19a=_0x54b19a-0x0;var _0x5cff5b=_0x1363[_0x54b19a];return _0x5cff5b;};'use strict';var _=require(_0x3136('0x0'));var util=require(_0x3136('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3136('0x2'));var BPromise=require(_0x3136('0x3'));var rp=require(_0x3136('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3136('0x5'));var attributes=require(_0x3136('0x6'));module[_0x3136('0x7')]=function(_0x4f20b8,_0x59602b){return _0x4f20b8[_0x3136('0x8')](_0x3136('0x9'),attributes,{'tableName':_0x3136('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 960ddc2..0da794f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x37e389,_0x28af4b){var _0x3d7435=function(_0x116b34){while(--_0x116b34){_0x37e389['push'](_0x37e389['shift']());}};_0x3d7435(++_0x28af4b);}(_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});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x4975,0x86));var _0x5497=function(_0x301e17,_0x58a7b3){_0x301e17=_0x301e17-0x0;var _0x5eaaf6=_0x4975[_0x301e17];return _0x5eaaf6;};'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')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index 3532d10..47a6a52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x50ff1e,_0x306229){var _0x16c0fb=function(_0x4e837c){while(--_0x4e837c){_0x50ff1e['push'](_0x50ff1e['shift']());}};_0x16c0fb(++_0x306229);}(_0x66fa,0x117));var _0xa66f=function(_0x5aa220,_0x3f3ff4){_0x5aa220=_0x5aa220-0x0;var _0x43d774=_0x66fa[_0x5aa220];return _0x43d774;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router;
\ No newline at end of file
+var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x2e2a52,_0x23c72e){var _0x22da43=function(_0x35c486){while(--_0x35c486){_0x2e2a52['push'](_0x2e2a52['shift']());}};_0x22da43(++_0x23c72e);}(_0x7880,0x1f4));var _0x0788=function(_0x27a0bd,_0x41e831){_0x27a0bd=_0x27a0bd-0x0;var _0xa68da6=_0x7880[_0x27a0bd];return _0xa68da6;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router;
\ No newline at end of file
index 1e206a4..a344573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ed=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING'];(function(_0x47e73b,_0x32c809){var _0xc196a0=function(_0x1dbfac){while(--_0x1dbfac){_0x47e73b['push'](_0x47e73b['shift']());}};_0xc196a0(++_0x32c809);}(_0x71ed,0x1b9));var _0xd71e=function(_0x2deb2e,_0x286517){_0x2deb2e=_0x2deb2e-0x0;var _0x494740=_0x71ed[_0x2deb2e];return _0x494740;};'use strict';var Sequelize=require(_0xd71e('0x0'));module[_0xd71e('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xd71e('0x2')]},'exitStatus':{'type':Sequelize[_0xd71e('0x2')]},'ticketId':{'type':Sequelize[_0xd71e('0x2')]},'integrationId':{'type':Sequelize[_0xd71e('0x3')]},'contacts':{'type':Sequelize[_0xd71e('0x2')]},'uniqueid':{'type':Sequelize[_0xd71e('0x2')]},'calleridnum':{'type':Sequelize[_0xd71e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd71e('0x2')]},'interface':{'type':Sequelize[_0xd71e('0x2')]},'membername':{'type':Sequelize[_0xd71e('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd71e('0x4')]},'agentconnectAt':{'type':Sequelize[_0xd71e('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xd71e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xd71e('0x4')]},'talktime':{'type':Sequelize[_0xd71e('0x3')]},'agentacw':{'type':Sequelize[_0xd71e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd71e('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xd71e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xd71e('0x4')]},'agentdump':{'type':Sequelize[_0xd71e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xd71e('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd71e('0x2')]},'channelstate':{'type':Sequelize[_0xd71e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd71e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd71e('0x2')]},'language':{'type':Sequelize[_0xd71e('0x2')]},'accountcode':{'type':Sequelize[_0xd71e('0x2')]},'context':{'type':Sequelize[_0xd71e('0x2')]},'exten':{'type':Sequelize[_0xd71e('0x2')]},'priority':{'type':Sequelize[_0xd71e('0x2')]},'destchannel':{'type':Sequelize[_0xd71e('0x2')]},'destchannelstate':{'type':Sequelize[_0xd71e('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd71e('0x2')]},'destcalleridname':{'type':Sequelize[_0xd71e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd71e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd71e('0x2')]},'destlanguage':{'type':Sequelize[_0xd71e('0x2')]},'destaccountcode':{'type':Sequelize[_0xd71e('0x2')]},'destcontext':{'type':Sequelize[_0xd71e('0x2')]},'destexten':{'type':Sequelize[_0xd71e('0x2')]},'destpriority':{'type':Sequelize[_0xd71e('0x2')]},'destuniqueid':{'type':Sequelize[_0xd71e('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xd71e('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xd71e('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xd71e('0x2')]},'attachment':{'type':Sequelize[_0xd71e('0x6')]},'html':{'type':Sequelize[_0xd71e('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xd71e('0x7')](_0xd71e('0x8'),_0xd71e('0x9'),'RECEIVED',_0xd71e('0xa'))},'url':{'type':Sequelize[_0xd71e('0x2')]},'app':{'type':Sequelize[_0xd71e('0x2')]},'appdata':{'type':Sequelize[_0xd71e('0x2')]},'projectId':{'type':Sequelize[_0xd71e('0x3')]}};
\ No newline at end of file
+var _0x9eca=['exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM','SENDING','FAILED','sequelize'];(function(_0xa6a3e4,_0x2254e5){var _0x5cb899=function(_0x9b5728){while(--_0x9b5728){_0xa6a3e4['push'](_0xa6a3e4['shift']());}};_0x5cb899(++_0x2254e5);}(_0x9eca,0x1e9));var _0xa9ec=function(_0x497a8b,_0x1df4ea){_0x497a8b=_0x497a8b-0x0;var _0x142cc3=_0x9eca[_0x497a8b];return _0x142cc3;};'use strict';var Sequelize=require(_0xa9ec('0x0'));module[_0xa9ec('0x1')]={'integration':{'type':Sequelize[_0xa9ec('0x2')]},'eventChannel':{'type':Sequelize[_0xa9ec('0x2')]},'exitStatus':{'type':Sequelize[_0xa9ec('0x2')]},'ticketId':{'type':Sequelize[_0xa9ec('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xa9ec('0x2')]},'uniqueid':{'type':Sequelize[_0xa9ec('0x2')]},'calleridnum':{'type':Sequelize[_0xa9ec('0x2')]},'calleridname':{'type':Sequelize[_0xa9ec('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xa9ec('0x2')]},'membername':{'type':Sequelize[_0xa9ec('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa9ec('0x3')]},'agentconnectAt':{'type':Sequelize[_0xa9ec('0x3')]},'holdtime':{'type':Sequelize[_0xa9ec('0x4')]},'agentcomplete':{'type':Sequelize[_0xa9ec('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa9ec('0x3')]},'talktime':{'type':Sequelize[_0xa9ec('0x4')]},'agentacw':{'type':Sequelize[_0xa9ec('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa9ec('0x4')]},'reason':{'type':Sequelize[_0xa9ec('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xa9ec('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa9ec('0x3')]},'lastevent':{'type':Sequelize[_0xa9ec('0x2')]},'channel':{'type':Sequelize[_0xa9ec('0x2')]},'channelstate':{'type':Sequelize[_0xa9ec('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa9ec('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa9ec('0x2')]},'connectedlinename':{'type':Sequelize[_0xa9ec('0x2')]},'language':{'type':Sequelize[_0xa9ec('0x2')]},'accountcode':{'type':Sequelize[_0xa9ec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa9ec('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xa9ec('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa9ec('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa9ec('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa9ec('0x2')]},'destlanguage':{'type':Sequelize[_0xa9ec('0x2')]},'destaccountcode':{'type':Sequelize[_0xa9ec('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xa9ec('0x2')]},'messageId':{'type':Sequelize[_0xa9ec('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xa9ec('0x2')]},'to':{'type':Sequelize[_0xa9ec('0x2')]},'cc':{'type':Sequelize[_0xa9ec('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xa9ec('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xa9ec('0x7')]('SENT',_0xa9ec('0x8'),'RECEIVED',_0xa9ec('0x9'))},'url':{'type':Sequelize[_0xa9ec('0x2')]},'app':{'type':Sequelize[_0xa9ec('0x2')]},'appdata':{'type':Sequelize[_0xa9ec('0x2')]},'projectId':{'type':Sequelize[_0xa9ec('0x4')]}};
\ No newline at end of file
index 4ffd074..8748e5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3926=['length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','index','IntegrationReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields'];(function(_0x2bec0c,_0x90912e){var _0x258e99=function(_0x2a6b9b){while(--_0x2a6b9b){_0x2bec0c['push'](_0x2bec0c['shift']());}};_0x258e99(++_0x90912e);}(_0x3926,0xb1));var _0x6392=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x3926[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0x6392('0x0'));var rimraf=require(_0x6392('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6392('0x2'));var rp=require(_0x6392('0x3'));var moment=require(_0x6392('0x4'));var BPromise=require(_0x6392('0x5'));var Mustache=require(_0x6392('0x6'));var util=require(_0x6392('0x7'));var path=require(_0x6392('0x8'));var sox=require(_0x6392('0x9'));var csv=require(_0x6392('0xa'));var ejs=require(_0x6392('0xb'));var fs=require('fs');var fs_extra=require(_0x6392('0xc'));var _=require(_0x6392('0xd'));var squel=require(_0x6392('0xe'));var crypto=require(_0x6392('0xf'));var jsforce=require(_0x6392('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6392('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6392('0x11'));var qs=require(_0x6392('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6392('0x13'));var logger=require(_0x6392('0x14'))(_0x6392('0x15'));var utils=require(_0x6392('0x16'));var config=require(_0x6392('0x17'));var licenseUtil=require(_0x6392('0x18'));var db=require(_0x6392('0x19'))['db'];function respondWithStatusCode(_0x2613bf,_0x18bbe3){_0x18bbe3=_0x18bbe3||0xcc;return function(_0x2f76f2){if(_0x2f76f2){return _0x2613bf[_0x6392('0x1a')](_0x18bbe3);}return _0x2613bf[_0x6392('0x1b')](_0x18bbe3)['end']();};}function respondWithResult(_0x942cc4,_0x5f1dd6){_0x5f1dd6=_0x5f1dd6||0xc8;return function(_0x199390){if(_0x199390){return _0x942cc4['status'](_0x5f1dd6)[_0x6392('0x1c')](_0x199390);}};}function respondWithFilteredResult(_0x3f4fe2,_0x56ac12){return function(_0x19e058){if(_0x19e058){var _0x5674c1=typeof _0x56ac12[_0x6392('0x1d')]===_0x6392('0x1e')&&typeof _0x56ac12[_0x6392('0x1f')]===_0x6392('0x1e');var _0x2e6abf=_0x19e058[_0x6392('0x20')];var _0x3beec3=_0x5674c1?0x0:_0x56ac12[_0x6392('0x1d')];var _0x3716ed=_0x5674c1?_0x19e058[_0x6392('0x20')]:_0x56ac12[_0x6392('0x1d')]+_0x56ac12[_0x6392('0x1f')];var _0x5761b2;if(_0x3716ed>=_0x2e6abf){_0x3716ed=_0x2e6abf;_0x5761b2=0xc8;}else{_0x5761b2=0xce;}_0x3f4fe2[_0x6392('0x1b')](_0x5761b2);return _0x3f4fe2[_0x6392('0x21')](_0x6392('0x22'),_0x3beec3+'-'+_0x3716ed+'/'+_0x2e6abf)[_0x6392('0x1c')](_0x19e058);}return null;};}function patchUpdates(_0x26b2c5){return function(_0x537391){try{jsonpatch[_0x6392('0x23')](_0x537391,_0x26b2c5,!![]);}catch(_0x3cadc3){return BPromise['reject'](_0x3cadc3);}return _0x537391[_0x6392('0x24')]();};}function saveUpdates(_0x3333e5,_0x98fd03){return function(_0x4fd519){if(_0x4fd519){return _0x4fd519[_0x6392('0x25')](_0x3333e5)[_0x6392('0x26')](function(_0x349e86){return _0x349e86;});}return null;};}function removeEntity(_0x1a62bc,_0x38b846){return function(_0x19f088){if(_0x19f088){return _0x19f088[_0x6392('0x27')]()[_0x6392('0x26')](function(){_0x1a62bc[_0x6392('0x1b')](0xcc)[_0x6392('0x28')]();});}};}function handleEntityNotFound(_0x41e228,_0xbdf6b9){return function(_0x5e9b9a){if(!_0x5e9b9a){_0x41e228[_0x6392('0x1a')](0x194);}return _0x5e9b9a;};}function handleError(_0x2ea53e,_0x1024a9){_0x1024a9=_0x1024a9||0x1f4;return function(_0x44b036){logger['error'](_0x44b036[_0x6392('0x29')]);if(_0x44b036['name']){delete _0x44b036[_0x6392('0x2a')];}_0x2ea53e[_0x6392('0x1b')](_0x1024a9)['send'](_0x44b036);};}exports[_0x6392('0x2b')]=function(_0x2c9680,_0x3644f9){var _0x20cba0={},_0x4c8777={},_0x1652e8={'count':0x0,'rows':[]};var _0x18934e=_['map'](db[_0x6392('0x2c')][_0x6392('0x2d')],function(_0xfda5f9){return{'name':_0xfda5f9[_0x6392('0x2e')],'type':_0xfda5f9[_0x6392('0x2f')][_0x6392('0x30')]};});_0x4c8777[_0x6392('0x31')]=_['map'](_0x18934e,_0x6392('0x2a'));_0x4c8777[_0x6392('0x32')]=_['keys'](_0x2c9680['query']);_0x4c8777['filters']=_[_0x6392('0x33')](_0x4c8777[_0x6392('0x31')],_0x4c8777['query']);_0x20cba0[_0x6392('0x34')]=_[_0x6392('0x33')](_0x4c8777[_0x6392('0x31')],qs[_0x6392('0x35')](_0x2c9680[_0x6392('0x32')][_0x6392('0x35')]));_0x20cba0[_0x6392('0x34')]=_0x20cba0[_0x6392('0x34')][_0x6392('0x36')]?_0x20cba0['attributes']:_0x4c8777[_0x6392('0x31')];if(!_0x2c9680['query'][_0x6392('0x37')](_0x6392('0x38'))){_0x20cba0[_0x6392('0x1f')]=qs['limit'](_0x2c9680[_0x6392('0x32')][_0x6392('0x1f')]);_0x20cba0[_0x6392('0x1d')]=qs[_0x6392('0x1d')](_0x2c9680['query'][_0x6392('0x1d')]);}_0x20cba0['order']=qs[_0x6392('0x39')](_0x2c9680['query'][_0x6392('0x39')]);_0x20cba0[_0x6392('0x3a')]=qs[_0x6392('0x3b')](_[_0x6392('0x3c')](_0x2c9680[_0x6392('0x32')],_0x4c8777[_0x6392('0x3b')]),_0x18934e);if(_0x2c9680[_0x6392('0x32')][_0x6392('0x3d')]){_0x20cba0['where']=_['merge'](_0x20cba0[_0x6392('0x3a')],{'$or':_[_0x6392('0x3e')](_0x18934e,function(_0x378137){if(_0x378137[_0x6392('0x2f')]!==_0x6392('0x3f')){var _0x1a4110={};_0x1a4110[_0x378137[_0x6392('0x2a')]]={'$like':'%'+_0x2c9680[_0x6392('0x32')][_0x6392('0x3d')]+'%'};return _0x1a4110;}})});}_0x20cba0=_[_0x6392('0x40')]({},_0x20cba0,_0x2c9680[_0x6392('0x41')]);var _0x4832c5={'where':_0x20cba0[_0x6392('0x3a')]};return db[_0x6392('0x2c')]['count'](_0x4832c5)['then'](function(_0xdb9174){_0x1652e8[_0x6392('0x20')]=_0xdb9174;if(_0x2c9680['query'][_0x6392('0x42')]){_0x20cba0[_0x6392('0x43')]=[{'all':!![]}];}return db[_0x6392('0x2c')][_0x6392('0x44')](_0x20cba0);})[_0x6392('0x26')](function(_0x4b0525){_0x1652e8[_0x6392('0x45')]=_0x4b0525;return _0x1652e8;})[_0x6392('0x26')](respondWithFilteredResult(_0x3644f9,_0x20cba0))[_0x6392('0x46')](handleError(_0x3644f9,null));};exports['show']=function(_0x3f44c5,_0x481b1e){var _0x193595={'raw':![],'where':{'id':_0x3f44c5[_0x6392('0x47')]['id']}},_0x3e0f93={};_0x3e0f93[_0x6392('0x31')]=_[_0x6392('0x48')](db[_0x6392('0x2c')][_0x6392('0x2d')]);_0x3e0f93[_0x6392('0x32')]=_['keys'](_0x3f44c5[_0x6392('0x32')]);_0x3e0f93['filters']=_[_0x6392('0x33')](_0x3e0f93[_0x6392('0x31')],_0x3e0f93[_0x6392('0x32')]);_0x193595[_0x6392('0x34')]=_[_0x6392('0x33')](_0x3e0f93[_0x6392('0x31')],qs[_0x6392('0x35')](_0x3f44c5['query'][_0x6392('0x35')]));_0x193595['attributes']=_0x193595[_0x6392('0x34')][_0x6392('0x36')]?_0x193595[_0x6392('0x34')]:_0x3e0f93[_0x6392('0x31')];if(_0x3f44c5['query'][_0x6392('0x42')]){_0x193595['include']=[{'all':!![]}];}_0x193595=_[_0x6392('0x40')]({},_0x193595,_0x3f44c5['options']);return db[_0x6392('0x2c')][_0x6392('0x49')](_0x193595)['then'](handleEntityNotFound(_0x481b1e,null))['then'](respondWithResult(_0x481b1e,null))[_0x6392('0x46')](handleError(_0x481b1e,null));};exports[_0x6392('0x4a')]=function(_0x28ef4e,_0x506a77){return db[_0x6392('0x2c')][_0x6392('0x4a')](_0x28ef4e[_0x6392('0x4b')],{})['then'](respondWithResult(_0x506a77,0xc9))[_0x6392('0x46')](handleError(_0x506a77,null));};exports[_0x6392('0x25')]=function(_0x53311f,_0x1174ad){if(_0x53311f[_0x6392('0x4b')]['id']){delete _0x53311f[_0x6392('0x4b')]['id'];}return db[_0x6392('0x2c')][_0x6392('0x49')]({'where':{'id':_0x53311f[_0x6392('0x47')]['id']}})[_0x6392('0x26')](handleEntityNotFound(_0x1174ad,null))[_0x6392('0x26')](saveUpdates(_0x53311f['body'],null))[_0x6392('0x26')](respondWithResult(_0x1174ad,null))[_0x6392('0x46')](handleError(_0x1174ad,null));};exports[_0x6392('0x27')]=function(_0xb59592,_0x2e6ecf){return db['IntegrationReport']['find']({'where':{'id':_0xb59592[_0x6392('0x47')]['id']}})[_0x6392('0x26')](handleEntityNotFound(_0x2e6ecf,null))['then'](removeEntity(_0x2e6ecf,null))['catch'](handleError(_0x2e6ecf,null));};exports[_0x6392('0x4c')]=function(_0x3f45e0,_0x38738e){return db[_0x6392('0x2c')][_0x6392('0x4c')]()[_0x6392('0x26')](respondWithResult(_0x38738e,null))[_0x6392('0x46')](handleError(_0x38738e,null));};
\ No newline at end of file
+var _0x979c=['save','update','destroy','error','stack','name','map','IntegrationReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','then','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject'];(function(_0x18e4ef,_0x5bf4ae){var _0xbab6ac=function(_0x43b12f){while(--_0x43b12f){_0x18e4ef['push'](_0x18e4ef['shift']());}};_0xbab6ac(++_0x5bf4ae);}(_0x979c,0xc1));var _0xc979=function(_0x56c358,_0x9a557f){_0x56c358=_0x56c358-0x0;var _0x5d138b=_0x979c[_0x56c358];return _0x5d138b;};'use strict';var emlformat=require(_0xc979('0x0'));var rimraf=require(_0xc979('0x1'));var zipdir=require(_0xc979('0x2'));var jsonpatch=require(_0xc979('0x3'));var rp=require('request-promise');var moment=require(_0xc979('0x4'));var BPromise=require(_0xc979('0x5'));var Mustache=require(_0xc979('0x6'));var util=require(_0xc979('0x7'));var path=require(_0xc979('0x8'));var sox=require(_0xc979('0x9'));var csv=require('to-csv');var ejs=require(_0xc979('0xa'));var fs=require('fs');var fs_extra=require(_0xc979('0xb'));var _=require(_0xc979('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc979('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc979('0xe'));var querystring=require(_0xc979('0xf'));var Papa=require(_0xc979('0x10'));var Redis=require(_0xc979('0x11'));var authService=require(_0xc979('0x12'));var qs=require(_0xc979('0x13'));var as=require(_0xc979('0x14'));var hardwareService=require(_0xc979('0x15'));var logger=require(_0xc979('0x16'))(_0xc979('0x17'));var utils=require('../../config/utils');var config=require(_0xc979('0x18'));var licenseUtil=require(_0xc979('0x19'));var db=require(_0xc979('0x1a'))['db'];function respondWithStatusCode(_0x1819f9,_0x1a9e0b){_0x1a9e0b=_0x1a9e0b||0xcc;return function(_0x4be947){if(_0x4be947){return _0x1819f9[_0xc979('0x1b')](_0x1a9e0b);}return _0x1819f9[_0xc979('0x1c')](_0x1a9e0b)[_0xc979('0x1d')]();};}function respondWithResult(_0x2a1ab9,_0x24c5aa){_0x24c5aa=_0x24c5aa||0xc8;return function(_0x51b002){if(_0x51b002){return _0x2a1ab9[_0xc979('0x1c')](_0x24c5aa)[_0xc979('0x1e')](_0x51b002);}};}function respondWithFilteredResult(_0x4546f6,_0xeebeb2){return function(_0x13bdc0){if(_0x13bdc0){var _0x3d458e=typeof _0xeebeb2['offset']===_0xc979('0x1f')&&typeof _0xeebeb2[_0xc979('0x20')]==='undefined';var _0x251f3c=_0x13bdc0[_0xc979('0x21')];var _0x3cd931=_0x3d458e?0x0:_0xeebeb2[_0xc979('0x22')];var _0x4eab6f=_0x3d458e?_0x13bdc0[_0xc979('0x21')]:_0xeebeb2[_0xc979('0x22')]+_0xeebeb2['limit'];var _0x2a832e;if(_0x4eab6f>=_0x251f3c){_0x4eab6f=_0x251f3c;_0x2a832e=0xc8;}else{_0x2a832e=0xce;}_0x4546f6[_0xc979('0x1c')](_0x2a832e);return _0x4546f6['set'](_0xc979('0x23'),_0x3cd931+'-'+_0x4eab6f+'/'+_0x251f3c)[_0xc979('0x1e')](_0x13bdc0);}return null;};}function patchUpdates(_0x49f6fe){return function(_0x61bdfb){try{jsonpatch[_0xc979('0x24')](_0x61bdfb,_0x49f6fe,!![]);}catch(_0x37660a){return BPromise[_0xc979('0x25')](_0x37660a);}return _0x61bdfb[_0xc979('0x26')]();};}function saveUpdates(_0xa4e8a9,_0x4465ed){return function(_0x3a29b8){if(_0x3a29b8){return _0x3a29b8[_0xc979('0x27')](_0xa4e8a9)['then'](function(_0x3336b8){return _0x3336b8;});}return null;};}function removeEntity(_0xf130f7,_0x24abb0){return function(_0x3fc4df){if(_0x3fc4df){return _0x3fc4df[_0xc979('0x28')]()['then'](function(){_0xf130f7[_0xc979('0x1c')](0xcc)[_0xc979('0x1d')]();});}};}function handleEntityNotFound(_0xbc3077,_0x10abb2){return function(_0x52f84f){if(!_0x52f84f){_0xbc3077['sendStatus'](0x194);}return _0x52f84f;};}function handleError(_0x5a3ee9,_0x5a9bfc){_0x5a9bfc=_0x5a9bfc||0x1f4;return function(_0x15e1dd){logger[_0xc979('0x29')](_0x15e1dd[_0xc979('0x2a')]);if(_0x15e1dd[_0xc979('0x2b')]){delete _0x15e1dd[_0xc979('0x2b')];}_0x5a3ee9['status'](_0x5a9bfc)['send'](_0x15e1dd);};}exports['index']=function(_0x45eaf5,_0x379c25){var _0x4aaba6={},_0x109142={},_0x313833={'count':0x0,'rows':[]};var _0x25f3fc=_[_0xc979('0x2c')](db[_0xc979('0x2d')][_0xc979('0x2e')],function(_0x559080){return{'name':_0x559080[_0xc979('0x2f')],'type':_0x559080['type'][_0xc979('0x30')]};});_0x109142[_0xc979('0x31')]=_[_0xc979('0x2c')](_0x25f3fc,'name');_0x109142['query']=_[_0xc979('0x32')](_0x45eaf5[_0xc979('0x33')]);_0x109142['filters']=_[_0xc979('0x34')](_0x109142[_0xc979('0x31')],_0x109142['query']);_0x4aaba6[_0xc979('0x35')]=_['intersection'](_0x109142[_0xc979('0x31')],qs['fields'](_0x45eaf5[_0xc979('0x33')][_0xc979('0x36')]));_0x4aaba6['attributes']=_0x4aaba6[_0xc979('0x35')][_0xc979('0x37')]?_0x4aaba6[_0xc979('0x35')]:_0x109142['model'];if(!_0x45eaf5[_0xc979('0x33')]['hasOwnProperty']('nolimit')){_0x4aaba6['limit']=qs[_0xc979('0x20')](_0x45eaf5['query'][_0xc979('0x20')]);_0x4aaba6['offset']=qs['offset'](_0x45eaf5['query']['offset']);}_0x4aaba6[_0xc979('0x38')]=qs[_0xc979('0x39')](_0x45eaf5[_0xc979('0x33')][_0xc979('0x39')]);_0x4aaba6['where']=qs[_0xc979('0x3a')](_[_0xc979('0x3b')](_0x45eaf5[_0xc979('0x33')],_0x109142[_0xc979('0x3a')]),_0x25f3fc);if(_0x45eaf5[_0xc979('0x33')][_0xc979('0x3c')]){_0x4aaba6[_0xc979('0x3d')]=_['merge'](_0x4aaba6[_0xc979('0x3d')],{'$or':_['map'](_0x25f3fc,function(_0x69e954){if(_0x69e954[_0xc979('0x3e')]!==_0xc979('0x3f')){var _0x17cc62={};_0x17cc62[_0x69e954['name']]={'$like':'%'+_0x45eaf5[_0xc979('0x33')][_0xc979('0x3c')]+'%'};return _0x17cc62;}})});}_0x4aaba6=_[_0xc979('0x40')]({},_0x4aaba6,_0x45eaf5[_0xc979('0x41')]);var _0x44382b={'where':_0x4aaba6[_0xc979('0x3d')]};return db[_0xc979('0x2d')][_0xc979('0x21')](_0x44382b)[_0xc979('0x42')](function(_0x5a172e){_0x313833[_0xc979('0x21')]=_0x5a172e;if(_0x45eaf5['query']['includeAll']){_0x4aaba6[_0xc979('0x43')]=[{'all':!![]}];}return db[_0xc979('0x2d')][_0xc979('0x44')](_0x4aaba6);})[_0xc979('0x42')](function(_0x45e2a9){_0x313833[_0xc979('0x45')]=_0x45e2a9;return _0x313833;})[_0xc979('0x42')](respondWithFilteredResult(_0x379c25,_0x4aaba6))[_0xc979('0x46')](handleError(_0x379c25,null));};exports[_0xc979('0x47')]=function(_0x1f7046,_0x249015){var _0x5cc062={'raw':![],'where':{'id':_0x1f7046[_0xc979('0x48')]['id']}},_0x2f2e8e={};_0x2f2e8e[_0xc979('0x31')]=_[_0xc979('0x32')](db[_0xc979('0x2d')][_0xc979('0x2e')]);_0x2f2e8e[_0xc979('0x33')]=_[_0xc979('0x32')](_0x1f7046['query']);_0x2f2e8e['filters']=_[_0xc979('0x34')](_0x2f2e8e[_0xc979('0x31')],_0x2f2e8e[_0xc979('0x33')]);_0x5cc062[_0xc979('0x35')]=_['intersection'](_0x2f2e8e['model'],qs[_0xc979('0x36')](_0x1f7046[_0xc979('0x33')]['fields']));_0x5cc062[_0xc979('0x35')]=_0x5cc062[_0xc979('0x35')][_0xc979('0x37')]?_0x5cc062['attributes']:_0x2f2e8e[_0xc979('0x31')];if(_0x1f7046[_0xc979('0x33')]['includeAll']){_0x5cc062[_0xc979('0x43')]=[{'all':!![]}];}_0x5cc062=_[_0xc979('0x40')]({},_0x5cc062,_0x1f7046[_0xc979('0x41')]);return db[_0xc979('0x2d')][_0xc979('0x49')](_0x5cc062)[_0xc979('0x42')](handleEntityNotFound(_0x249015,null))[_0xc979('0x42')](respondWithResult(_0x249015,null))['catch'](handleError(_0x249015,null));};exports[_0xc979('0x4a')]=function(_0x3ac315,_0x10498b){return db[_0xc979('0x2d')][_0xc979('0x4a')](_0x3ac315['body'],{})[_0xc979('0x42')](respondWithResult(_0x10498b,0xc9))['catch'](handleError(_0x10498b,null));};exports[_0xc979('0x27')]=function(_0x10e08a,_0x255925){if(_0x10e08a[_0xc979('0x4b')]['id']){delete _0x10e08a[_0xc979('0x4b')]['id'];}return db[_0xc979('0x2d')][_0xc979('0x49')]({'where':{'id':_0x10e08a[_0xc979('0x48')]['id']}})[_0xc979('0x42')](handleEntityNotFound(_0x255925,null))[_0xc979('0x42')](saveUpdates(_0x10e08a[_0xc979('0x4b')],null))[_0xc979('0x42')](respondWithResult(_0x255925,null))[_0xc979('0x46')](handleError(_0x255925,null));};exports[_0xc979('0x28')]=function(_0xe3c078,_0x45897d){return db[_0xc979('0x2d')]['find']({'where':{'id':_0xe3c078[_0xc979('0x48')]['id']}})[_0xc979('0x42')](handleEntityNotFound(_0x45897d,null))[_0xc979('0x42')](removeEntity(_0x45897d,null))['catch'](handleError(_0x45897d,null));};exports[_0xc979('0x4c')]=function(_0xb2ba72,_0x38387f){return db[_0xc979('0x2d')][_0xc979('0x4c')]()[_0xc979('0x42')](respondWithResult(_0x38387f,null))['catch'](handleError(_0x38387f,null));};
\ No newline at end of file
index 2caa378..278ad9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b13=['report_integration','lodash','util','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x534873,_0x26dcb3){var _0x7e04ab=function(_0x5cedd7){while(--_0x5cedd7){_0x534873['push'](_0x534873['shift']());}};_0x7e04ab(++_0x26dcb3);}(_0x1b13,0x7a));var _0x31b1=function(_0x38ac1d,_0xff2d72){_0x38ac1d=_0x38ac1d-0x0;var _0x4b7fe5=_0x1b13[_0x38ac1d];return _0x4b7fe5;};'use strict';var _=require(_0x31b1('0x0'));var util=require(_0x31b1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x31b1('0x2'));var fs=require('fs');var path=require(_0x31b1('0x3'));var rimraf=require(_0x31b1('0x4'));var config=require(_0x31b1('0x5'));var attributes=require(_0x31b1('0x6'));module[_0x31b1('0x7')]=function(_0x294de3,_0x42bc83){return _0x294de3[_0x31b1('0x8')](_0x31b1('0x9'),attributes,{'tableName':_0x31b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfd0=['moment','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','lodash','util','../../config/logger','api'];(function(_0x336d54,_0x4cb876){var _0x571a8d=function(_0x3746f6){while(--_0x3746f6){_0x336d54['push'](_0x336d54['shift']());}};_0x571a8d(++_0x4cb876);}(_0xbfd0,0x194));var _0x0bfd=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xbfd0[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x0bfd('0x0'));var util=require(_0x0bfd('0x1'));var logger=require(_0x0bfd('0x2'))(_0x0bfd('0x3'));var moment=require(_0x0bfd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bfd('0x5'));var rimraf=require(_0x0bfd('0x6'));var config=require(_0x0bfd('0x7'));var attributes=require(_0x0bfd('0x8'));module[_0x0bfd('0x9')]=function(_0x5c989e,_0x1a5570){return _0x5c989e[_0x0bfd('0xa')](_0x0bfd('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ab5188a..48a601c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5ed327,_0x3a64e7){var _0x3c1860=function(_0x27fef7){while(--_0x27fef7){_0x5ed327['push'](_0x5ed327['shift']());}};_0x3c1860(++_0x3a64e7);}(_0x326f,0xd1));var _0xf326=function(_0x2cb7d4,_0x296c45){_0x2cb7d4=_0x2cb7d4-0x0;var _0xe1bf34=_0x326f[_0x2cb7d4];return _0xe1bf34;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0xc6ac=['http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5766c6,_0x168e65){var _0x967949=function(_0x357ef3){while(--_0x357ef3){_0x5766c6['push'](_0x5766c6['shift']());}};_0x967949(++_0x168e65);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x30b591,_0x51a633){_0x30b591=_0x30b591-0x0;var _0x1b0281=_0xc6ac[_0x30b591];return _0x1b0281;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}
\ No newline at end of file
index 892a3af..eea559a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a44=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','/:id','multer','path'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x1a44,0xc4));var _0x41a4=function(_0x3e4ab9,_0x52f3ff){_0x3e4ab9=_0x3e4ab9-0x0;var _0x32e315=_0x1a44[_0x3e4ab9];return _0x32e315;};'use strict';var multer=require(_0x41a4('0x0'));var util=require('util');var path=require(_0x41a4('0x1'));var timeout=require(_0x41a4('0x2'));var express=require(_0x41a4('0x3'));var router=express[_0x41a4('0x4')]();var fs_extra=require(_0x41a4('0x5'));var auth=require(_0x41a4('0x6'));var interaction=require(_0x41a4('0x7'));var config=require('../../config/environment');var controller=require(_0x41a4('0x8'));router[_0x41a4('0x9')]('/',auth[_0x41a4('0xa')](),controller[_0x41a4('0xb')]);router['get']('/:id',auth[_0x41a4('0xa')](),controller[_0x41a4('0xc')]);router[_0x41a4('0x9')](_0x41a4('0xd'),auth[_0x41a4('0xa')](),controller['getIntervals']);router['post']('/',auth[_0x41a4('0xa')](),controller[_0x41a4('0xe')]);router[_0x41a4('0xf')](_0x41a4('0xd'),auth[_0x41a4('0xa')](),controller[_0x41a4('0x10')]);router['post'](_0x41a4('0x11'),auth[_0x41a4('0xa')](),controller[_0x41a4('0x12')]);router[_0x41a4('0x13')]('/:id',auth[_0x41a4('0xa')](),controller[_0x41a4('0x14')]);router['delete'](_0x41a4('0x15'),auth[_0x41a4('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xaac6=['../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0xaac6,0x11b));var _0x6aac=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xaac6[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x6aac('0x0'));var util=require(_0x6aac('0x1'));var path=require(_0x6aac('0x2'));var timeout=require(_0x6aac('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aac('0x4'));var auth=require(_0x6aac('0x5'));var interaction=require(_0x6aac('0x6'));var config=require('../../config/environment');var controller=require(_0x6aac('0x7'));router[_0x6aac('0x8')]('/',auth[_0x6aac('0x9')](),controller[_0x6aac('0xa')]);router['get'](_0x6aac('0xb'),auth[_0x6aac('0x9')](),controller['show']);router[_0x6aac('0x8')](_0x6aac('0xc'),auth[_0x6aac('0x9')](),controller[_0x6aac('0xd')]);router[_0x6aac('0xe')]('/',auth[_0x6aac('0x9')](),controller[_0x6aac('0xf')]);router[_0x6aac('0xe')](_0x6aac('0xc'),auth['isAuthenticated'](),controller[_0x6aac('0x10')]);router['post'](_0x6aac('0x11'),auth[_0x6aac('0x9')](),controller[_0x6aac('0x12')]);router[_0x6aac('0x13')](_0x6aac('0xb'),auth['isAuthenticated'](),controller[_0x6aac('0x14')]);router[_0x6aac('0x15')]('/:id',auth[_0x6aac('0x9')](),controller[_0x6aac('0x16')]);module[_0x6aac('0x17')]=router;
\ No newline at end of file
index 010302b..315cbfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f7=['STRING','exports'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xf9f7,0x1ef));var _0x7f9f=function(_0x1e081a,_0x482d6b){_0x1e081a=_0x1e081a-0x0;var _0x428209=_0xf9f7[_0x1e081a];return _0x428209;};'use strict';var Sequelize=require('sequelize');module[_0x7f9f('0x0')]={'name':{'type':Sequelize[_0x7f9f('0x1')]},'description':{'type':Sequelize[_0x7f9f('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x2d6e=['STRING','sequelize'];(function(_0x5a8fd7,_0x50c51c){var _0x5c1279=function(_0x7d6711){while(--_0x7d6711){_0x5a8fd7['push'](_0x5a8fd7['shift']());}};_0x5c1279(++_0x50c51c);}(_0x2d6e,0xc9));var _0xe2d6=function(_0x17228c,_0x110d1f){_0x17228c=_0x17228c-0x0;var _0x520b28=_0x2d6e[_0x17228c];return _0x520b28;};'use strict';var Sequelize=require(_0xe2d6('0x0'));module['exports']={'name':{'type':Sequelize[_0xe2d6('0x1')]},'description':{'type':Sequelize[_0xe2d6('0x1')]},'interval':{'type':Sequelize[_0xe2d6('0x1')],'allowNull':!![]}};
\ No newline at end of file
index d1ec2cb..653e196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62ae=['addIntervals','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','sort','where','merge','VIRTUAL','filter','options','Interval','include','findAll','show','params','intersection','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','order','pick','hasOwnProperty','nolimit'];(function(_0x56f151,_0x281759){var _0x52c1e3=function(_0x12ba6d){while(--_0x12ba6d){_0x56f151['push'](_0x56f151['shift']());}};_0x52c1e3(++_0x281759);}(_0x62ae,0x11a));var _0xe62a=function(_0x2bd6a1,_0x1da8d5){_0x2bd6a1=_0x2bd6a1-0x0;var _0x4fa98d=_0x62ae[_0x2bd6a1];return _0x4fa98d;};'use strict';var emlformat=require(_0xe62a('0x0'));var rimraf=require(_0xe62a('0x1'));var zipdir=require(_0xe62a('0x2'));var jsonpatch=require(_0xe62a('0x3'));var rp=require(_0xe62a('0x4'));var moment=require(_0xe62a('0x5'));var BPromise=require(_0xe62a('0x6'));var Mustache=require('mustache');var util=require(_0xe62a('0x7'));var path=require(_0xe62a('0x8'));var sox=require(_0xe62a('0x9'));var csv=require('to-csv');var ejs=require(_0xe62a('0xa'));var fs=require('fs');var fs_extra=require(_0xe62a('0xb'));var _=require('lodash');var squel=require(_0xe62a('0xc'));var crypto=require(_0xe62a('0xd'));var jsforce=require(_0xe62a('0xe'));var deskjs=require(_0xe62a('0xf'));var toCsv=require(_0xe62a('0x10'));var querystring=require(_0xe62a('0x11'));var Papa=require(_0xe62a('0x12'));var Redis=require('ioredis');var authService=require(_0xe62a('0x13'));var qs=require(_0xe62a('0x14'));var as=require(_0xe62a('0x15'));var hardwareService=require(_0xe62a('0x16'));var logger=require(_0xe62a('0x17'))('api');var utils=require(_0xe62a('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe62a('0x19'))['db'];var extensions=require(_0xe62a('0x1a'));function respondWithStatusCode(_0x1c5574,_0x4b85da){_0x4b85da=_0x4b85da||0xcc;return function(_0x3a4190){if(_0x3a4190){return _0x1c5574[_0xe62a('0x1b')](_0x4b85da);}return _0x1c5574['status'](_0x4b85da)[_0xe62a('0x1c')]();};}function respondWithResult(_0x55a378,_0x3fcf69){_0x3fcf69=_0x3fcf69||0xc8;return function(_0x4c25b0){if(_0x4c25b0){return _0x55a378['status'](_0x3fcf69)['json'](_0x4c25b0);}};}function respondWithFilteredResult(_0x5684a1,_0x3a15fd){return function(_0x2affa5){if(_0x2affa5){var _0x5c7321=typeof _0x3a15fd['offset']===_0xe62a('0x1d')&&typeof _0x3a15fd[_0xe62a('0x1e')]==='undefined';var _0x1e5b37=_0x2affa5[_0xe62a('0x1f')];var _0x138af3=_0x5c7321?0x0:_0x3a15fd[_0xe62a('0x20')];var _0x4b96c1=_0x5c7321?_0x2affa5[_0xe62a('0x1f')]:_0x3a15fd[_0xe62a('0x20')]+_0x3a15fd[_0xe62a('0x1e')];var _0x26ddb4;if(_0x4b96c1>=_0x1e5b37){_0x4b96c1=_0x1e5b37;_0x26ddb4=0xc8;}else{_0x26ddb4=0xce;}_0x5684a1[_0xe62a('0x21')](_0x26ddb4);return _0x5684a1[_0xe62a('0x22')](_0xe62a('0x23'),_0x138af3+'-'+_0x4b96c1+'/'+_0x1e5b37)['json'](_0x2affa5);}return null;};}function patchUpdates(_0x350d8d){return function(_0x52862a){try{jsonpatch[_0xe62a('0x24')](_0x52862a,_0x350d8d,!![]);}catch(_0x18b676){return BPromise[_0xe62a('0x25')](_0x18b676);}return _0x52862a[_0xe62a('0x26')]();};}function saveUpdates(_0x42d6e8,_0x389377){return function(_0x4148b6){if(_0x4148b6){return _0x4148b6[_0xe62a('0x27')](_0x42d6e8)[_0xe62a('0x28')](function(_0x586417){return _0x586417;});}return null;};}function removeEntity(_0x16063b,_0x3f0081){return function(_0xe7cf37){if(_0xe7cf37){return _0xe7cf37[_0xe62a('0x29')]()[_0xe62a('0x28')](function(){var _0x3f1e90=_0xe7cf37[_0xe62a('0x2a')]({'plain':!![]});var _0x2ef48e=_0xe62a('0x2b');return db[_0xe62a('0x2c')]['destroy']({'where':{'type':_0x2ef48e,'resourceId':_0x3f1e90['id']}})[_0xe62a('0x28')](function(){return _0xe7cf37;});})[_0xe62a('0x28')](function(){_0x16063b[_0xe62a('0x21')](0xcc)[_0xe62a('0x1c')]();});}};}function handleEntityNotFound(_0x52cba5,_0x914a78){return function(_0x40a18e){if(!_0x40a18e){_0x52cba5[_0xe62a('0x1b')](0x194);}return _0x40a18e;};}function handleError(_0x1c5ff4,_0x23c58a){_0x23c58a=_0x23c58a||0x1f4;return function(_0x133ee7){logger[_0xe62a('0x2d')](_0x133ee7['stack']);if(_0x133ee7[_0xe62a('0x2e')]){delete _0x133ee7[_0xe62a('0x2e')];}_0x1c5ff4[_0xe62a('0x21')](_0x23c58a)[_0xe62a('0x2f')](_0x133ee7);};}exports[_0xe62a('0x30')]=function(_0x44bebc,_0x372874){var _0x63b301={},_0x1e4a0f={},_0x1b4542={'count':0x0,'rows':[]};var _0x398c14=_[_0xe62a('0x31')](db['Interval'][_0xe62a('0x32')],function(_0x377067){return{'name':_0x377067[_0xe62a('0x33')],'type':_0x377067['type'][_0xe62a('0x34')]};});_0x1e4a0f[_0xe62a('0x35')]=_[_0xe62a('0x31')](_0x398c14,_0xe62a('0x2e'));_0x1e4a0f[_0xe62a('0x36')]=_[_0xe62a('0x37')](_0x44bebc[_0xe62a('0x36')]);_0x1e4a0f[_0xe62a('0x38')]=_['intersection'](_0x1e4a0f[_0xe62a('0x35')],_0x1e4a0f[_0xe62a('0x36')]);_0x63b301[_0xe62a('0x39')]=_['intersection'](_0x1e4a0f[_0xe62a('0x35')],qs[_0xe62a('0x3a')](_0x44bebc[_0xe62a('0x36')][_0xe62a('0x3a')]));_0x63b301['attributes']=_0x63b301['attributes'][_0xe62a('0x3b')]?_0x63b301[_0xe62a('0x39')]:_0x1e4a0f[_0xe62a('0x35')];if(!_0x44bebc[_0xe62a('0x36')]['hasOwnProperty']('nolimit')){_0x63b301[_0xe62a('0x1e')]=qs['limit'](_0x44bebc[_0xe62a('0x36')]['limit']);_0x63b301[_0xe62a('0x20')]=qs[_0xe62a('0x20')](_0x44bebc[_0xe62a('0x36')][_0xe62a('0x20')]);}_0x63b301['order']=qs[_0xe62a('0x3c')](_0x44bebc['query']['sort']);_0x63b301[_0xe62a('0x3d')]=qs['filters'](_['pick'](_0x44bebc[_0xe62a('0x36')],_0x1e4a0f[_0xe62a('0x38')]),_0x398c14);if(_0x44bebc[_0xe62a('0x36')]['filter']){_0x63b301['where']=_[_0xe62a('0x3e')](_0x63b301['where'],{'$or':_[_0xe62a('0x31')](_0x398c14,function(_0x147b60){if(_0x147b60['type']!==_0xe62a('0x3f')){var _0x1ee807={};_0x1ee807[_0x147b60[_0xe62a('0x2e')]]={'$like':'%'+_0x44bebc[_0xe62a('0x36')][_0xe62a('0x40')]+'%'};return _0x1ee807;}})});}_0x63b301=_[_0xe62a('0x3e')]({},_0x63b301,_0x44bebc[_0xe62a('0x41')]);var _0x177059={'where':_0x63b301[_0xe62a('0x3d')]};return db[_0xe62a('0x42')]['count'](_0x177059)[_0xe62a('0x28')](function(_0x31db16){_0x1b4542[_0xe62a('0x1f')]=_0x31db16;if(_0x44bebc['query']['includeAll']){_0x63b301[_0xe62a('0x43')]=[{'all':!![]}];}return db['Interval'][_0xe62a('0x44')](_0x63b301);})['then'](function(_0x5d90c1){_0x1b4542['rows']=_0x5d90c1;return _0x1b4542;})['then'](respondWithFilteredResult(_0x372874,_0x63b301))['catch'](handleError(_0x372874,null));};exports[_0xe62a('0x45')]=function(_0x47e1d6,_0x142aa3){var _0x1d16fa={'raw':!![],'where':{'id':_0x47e1d6[_0xe62a('0x46')]['id']}},_0x4ce0e8={};_0x4ce0e8['model']=_['keys'](db[_0xe62a('0x42')][_0xe62a('0x32')]);_0x4ce0e8[_0xe62a('0x36')]=_[_0xe62a('0x37')](_0x47e1d6[_0xe62a('0x36')]);_0x4ce0e8[_0xe62a('0x38')]=_[_0xe62a('0x47')](_0x4ce0e8[_0xe62a('0x35')],_0x4ce0e8[_0xe62a('0x36')]);_0x1d16fa[_0xe62a('0x39')]=_[_0xe62a('0x47')](_0x4ce0e8[_0xe62a('0x35')],qs['fields'](_0x47e1d6[_0xe62a('0x36')]['fields']));_0x1d16fa['attributes']=_0x1d16fa['attributes']['length']?_0x1d16fa['attributes']:_0x4ce0e8[_0xe62a('0x35')];if(_0x47e1d6[_0xe62a('0x36')][_0xe62a('0x48')]){_0x1d16fa[_0xe62a('0x43')]=[{'all':!![]}];}_0x1d16fa=_[_0xe62a('0x3e')]({},_0x1d16fa,_0x47e1d6[_0xe62a('0x41')]);return db[_0xe62a('0x42')][_0xe62a('0x49')](_0x1d16fa)[_0xe62a('0x28')](handleEntityNotFound(_0x142aa3,null))['then'](respondWithResult(_0x142aa3,null))[_0xe62a('0x4a')](handleError(_0x142aa3,null));};exports['create']=function(_0x268937,_0x151271){return db[_0xe62a('0x42')][_0xe62a('0x4b')](_0x268937['body'],{})['then'](function(_0x42ce0f){var _0x29a27a=_0x268937['user']['get']({'plain':!![]});if(!_0x29a27a)throw new Error(_0xe62a('0x4c'));if(_0x29a27a[_0xe62a('0x4d')]===_0xe62a('0x4e')){var _0x31b73f=_0x42ce0f[_0xe62a('0x2a')]({'plain':!![]});var _0x1db81b=_0xe62a('0x2b');return db[_0xe62a('0x4f')][_0xe62a('0x49')]({'where':{'name':_0x1db81b,'userProfileId':_0x29a27a[_0xe62a('0x50')]},'raw':!![]})[_0xe62a('0x28')](function(_0x424968){if(_0x424968&&_0x424968['autoAssociation']===0x0){return db['UserProfileResource'][_0xe62a('0x4b')]({'name':_0x31b73f[_0xe62a('0x2e')],'resourceId':_0x31b73f['id'],'type':_0x424968['name'],'sectionId':_0x424968['id']},{})[_0xe62a('0x28')](function(){return _0x42ce0f;});}else{return _0x42ce0f;}})[_0xe62a('0x4a')](function(_0x3b7dac){logger[_0xe62a('0x2d')](_0xe62a('0x51'),_0x3b7dac);throw _0x3b7dac;});}return _0x42ce0f;})[_0xe62a('0x28')](respondWithResult(_0x151271,0xc9))[_0xe62a('0x4a')](handleError(_0x151271,null));};exports[_0xe62a('0x27')]=function(_0x37afe5,_0x366697){if(_0x37afe5[_0xe62a('0x52')]['id']){delete _0x37afe5['body']['id'];}return db[_0xe62a('0x42')][_0xe62a('0x49')]({'where':{'id':_0x37afe5[_0xe62a('0x46')]['id']}})[_0xe62a('0x28')](handleEntityNotFound(_0x366697,null))[_0xe62a('0x28')](saveUpdates(_0x37afe5['body'],null))[_0xe62a('0x28')](respondWithResult(_0x366697,null))[_0xe62a('0x4a')](handleError(_0x366697,null));};exports[_0xe62a('0x29')]=function(_0x5dd032,_0x2dd329){return db[_0xe62a('0x42')]['find']({'where':{'id':_0x5dd032['params']['id']}})['then'](handleEntityNotFound(_0x2dd329,null))[_0xe62a('0x28')](removeEntity(_0x2dd329,null))[_0xe62a('0x4a')](handleError(_0x2dd329,null));};exports[_0xe62a('0x53')]=function(_0x18c3f6,_0x1d0e7f,_0x3c9c8c){if(_0x18c3f6[_0xe62a('0x52')]['id']){delete _0x18c3f6[_0xe62a('0x52')]['id'];}return db[_0xe62a('0x42')][_0xe62a('0x49')]({'where':{'id':_0x18c3f6[_0xe62a('0x46')]['id']}})[_0xe62a('0x28')](handleEntityNotFound(_0x1d0e7f,null))[_0xe62a('0x28')](function(_0x14847f){if(_0x14847f){_0x18c3f6[_0xe62a('0x52')][_0xe62a('0x54')]=_0x14847f['id'];return db['Interval'][_0xe62a('0x4b')](_0x18c3f6[_0xe62a('0x52')]);}})[_0xe62a('0x28')](respondWithResult(_0x1d0e7f,null))['catch'](handleError(_0x1d0e7f,null));};exports[_0xe62a('0x55')]=function(_0x372078,_0x2694de,_0x13db0){var _0xa87fb5={};var _0x12bf48={};var _0x39047e;var _0x29aab4;return db['Interval']['findOne']({'where':{'id':_0x372078['params']['id']}})[_0xe62a('0x28')](handleEntityNotFound(_0x2694de,null))[_0xe62a('0x28')](function(_0x26127b){if(_0x26127b){_0x39047e=_0x26127b;_0x12bf48[_0xe62a('0x35')]=_['keys'](db[_0xe62a('0x42')]['rawAttributes']);_0x12bf48[_0xe62a('0x36')]=_[_0xe62a('0x37')](_0x372078[_0xe62a('0x36')]);_0x12bf48[_0xe62a('0x38')]=_[_0xe62a('0x47')](_0x12bf48[_0xe62a('0x35')],_0x12bf48['query']);_0xa87fb5['attributes']=_[_0xe62a('0x47')](_0x12bf48[_0xe62a('0x35')],qs[_0xe62a('0x3a')](_0x372078['query']['fields']));_0xa87fb5[_0xe62a('0x39')]=_0xa87fb5[_0xe62a('0x39')][_0xe62a('0x3b')]?_0xa87fb5['attributes']:_0x12bf48['model'];_0xa87fb5[_0xe62a('0x56')]=qs[_0xe62a('0x3c')](_0x372078[_0xe62a('0x36')][_0xe62a('0x3c')]);_0xa87fb5[_0xe62a('0x3d')]=qs['filters'](_[_0xe62a('0x57')](_0x372078[_0xe62a('0x36')],_0x12bf48['filters']));if(_0x372078[_0xe62a('0x36')][_0xe62a('0x40')]){_0xa87fb5[_0xe62a('0x3d')]=_[_0xe62a('0x3e')](_0xa87fb5[_0xe62a('0x3d')],{'$or':_[_0xe62a('0x31')](_0xa87fb5[_0xe62a('0x39')],function(_0xf6d0db){var _0x5ba0df={};_0x5ba0df[_0xf6d0db]={'$like':'%'+_0x372078['query'][_0xe62a('0x40')]+'%'};return _0x5ba0df;})});}_0xa87fb5=_[_0xe62a('0x3e')]({},_0xa87fb5,_0x372078['options']);return _0x39047e[_0xe62a('0x55')](_0xa87fb5);}})[_0xe62a('0x28')](function(_0x27243b){if(_0x27243b){_0x29aab4=_0x27243b['length'];if(!_0x372078[_0xe62a('0x36')][_0xe62a('0x58')](_0xe62a('0x59'))){_0xa87fb5[_0xe62a('0x1e')]=qs[_0xe62a('0x1e')](_0x372078[_0xe62a('0x36')][_0xe62a('0x1e')]);_0xa87fb5[_0xe62a('0x20')]=qs[_0xe62a('0x20')](_0x372078[_0xe62a('0x36')][_0xe62a('0x20')]);}return _0x39047e['getIntervals'](_0xa87fb5);}})[_0xe62a('0x28')](function(_0x17120e){if(_0x17120e){return _0x17120e?{'count':_0x29aab4,'rows':_0x17120e}:null;}})[_0xe62a('0x28')](respondWithResult(_0x2694de,null))['catch'](handleError(_0x2694de,null));};exports[_0xe62a('0x5a')]=function(_0xb75405,_0x116ec4,_0x183a66){return db[_0xe62a('0x42')]['findOne']({'where':{'id':_0xb75405[_0xe62a('0x46')]['id']}})['then'](handleEntityNotFound(_0x116ec4,null))['then'](function(_0x3771bb){if(_0x3771bb){return db['sequelize'][_0xe62a('0x5b')](function(_0x3f26ed){return db['Interval'][_0xe62a('0x29')]({'where':{'IntervalId':_0xb75405[_0xe62a('0x46')]['id']},'transaction':_0x3f26ed})[_0xe62a('0x28')](function(_0x243c68){var _0x24b1e6=_[_0xe62a('0x31')](_0xb75405[_0xe62a('0x52')],function(_0x30106c){delete _0x30106c['id'];_0x30106c[_0xe62a('0x54')]=_0xb75405[_0xe62a('0x46')]['id'];return _0x30106c;});return db[_0xe62a('0x42')][_0xe62a('0x5c')](_0x24b1e6,{'transaction':_0x3f26ed});});})['then'](function(){return db[_0xe62a('0x42')][_0xe62a('0x44')]({'where':{'IntervalId':_0xb75405[_0xe62a('0x46')]['id']}});});}})['then'](respondWithResult(_0x116ec4,null))[_0xe62a('0x4a')](handleError(_0x116ec4,null));};
\ No newline at end of file
+var _0xbb20=['moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','index','map','fieldName','model','keys','query','filters','intersection','attributes','fields','order','sort','where','filter','merge','type','VIRTUAL','options','Interval','includeAll','include','rows','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','IntervalId','getIntervals','findOne','rawAttributes','pick','hasOwnProperty','nolimit','addIntervals','findAll','eml-format','rimraf','request-promise'];(function(_0x5be989,_0x5657e5){var _0x183d1d=function(_0x4ebd60){while(--_0x4ebd60){_0x5be989['push'](_0x5be989['shift']());}};_0x183d1d(++_0x5657e5);}(_0xbb20,0x1a1));var _0x0bb2=function(_0x48defc,_0x32d1f3){_0x48defc=_0x48defc-0x0;var _0x4fef2b=_0xbb20[_0x48defc];return _0x4fef2b;};'use strict';var emlformat=require(_0x0bb2('0x0'));var rimraf=require(_0x0bb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bb2('0x2'));var moment=require(_0x0bb2('0x3'));var BPromise=require(_0x0bb2('0x4'));var Mustache=require(_0x0bb2('0x5'));var util=require(_0x0bb2('0x6'));var path=require('path');var sox=require(_0x0bb2('0x7'));var csv=require('to-csv');var ejs=require(_0x0bb2('0x8'));var fs=require('fs');var fs_extra=require(_0x0bb2('0x9'));var _=require(_0x0bb2('0xa'));var squel=require(_0x0bb2('0xb'));var crypto=require(_0x0bb2('0xc'));var jsforce=require(_0x0bb2('0xd'));var deskjs=require(_0x0bb2('0xe'));var toCsv=require(_0x0bb2('0xf'));var querystring=require(_0x0bb2('0x10'));var Papa=require(_0x0bb2('0x11'));var Redis=require(_0x0bb2('0x12'));var authService=require(_0x0bb2('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bb2('0x14'))(_0x0bb2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0x0bb2('0x16'));function respondWithStatusCode(_0x5e4c66,_0x1d4ee6){_0x1d4ee6=_0x1d4ee6||0xcc;return function(_0x1ba0a5){if(_0x1ba0a5){return _0x5e4c66[_0x0bb2('0x17')](_0x1d4ee6);}return _0x5e4c66[_0x0bb2('0x18')](_0x1d4ee6)[_0x0bb2('0x19')]();};}function respondWithResult(_0x5f05f0,_0x1af47d){_0x1af47d=_0x1af47d||0xc8;return function(_0x3c167e){if(_0x3c167e){return _0x5f05f0[_0x0bb2('0x18')](_0x1af47d)['json'](_0x3c167e);}};}function respondWithFilteredResult(_0x1a8a5e,_0x4196d5){return function(_0x30b0d8){if(_0x30b0d8){var _0x454b1b=typeof _0x4196d5[_0x0bb2('0x1a')]==='undefined'&&typeof _0x4196d5['limit']===_0x0bb2('0x1b');var _0x27a421=_0x30b0d8[_0x0bb2('0x1c')];var _0x50c5d2=_0x454b1b?0x0:_0x4196d5[_0x0bb2('0x1a')];var _0x4657e4=_0x454b1b?_0x30b0d8[_0x0bb2('0x1c')]:_0x4196d5['offset']+_0x4196d5[_0x0bb2('0x1d')];var _0x427bfa;if(_0x4657e4>=_0x27a421){_0x4657e4=_0x27a421;_0x427bfa=0xc8;}else{_0x427bfa=0xce;}_0x1a8a5e['status'](_0x427bfa);return _0x1a8a5e['set'](_0x0bb2('0x1e'),_0x50c5d2+'-'+_0x4657e4+'/'+_0x27a421)[_0x0bb2('0x1f')](_0x30b0d8);}return null;};}function patchUpdates(_0x257f90){return function(_0x540288){try{jsonpatch['apply'](_0x540288,_0x257f90,!![]);}catch(_0x17ccfb){return BPromise[_0x0bb2('0x20')](_0x17ccfb);}return _0x540288[_0x0bb2('0x21')]();};}function saveUpdates(_0x2b102b,_0x1a9d14){return function(_0x203c1d){if(_0x203c1d){return _0x203c1d[_0x0bb2('0x22')](_0x2b102b)[_0x0bb2('0x23')](function(_0x4a517b){return _0x4a517b;});}return null;};}function removeEntity(_0x149e4c,_0x1d713c){return function(_0x5ba8b2){if(_0x5ba8b2){return _0x5ba8b2[_0x0bb2('0x24')]()['then'](function(){var _0x298226=_0x5ba8b2[_0x0bb2('0x25')]({'plain':!![]});var _0x144d0f=_0x0bb2('0x26');return db[_0x0bb2('0x27')][_0x0bb2('0x24')]({'where':{'type':_0x144d0f,'resourceId':_0x298226['id']}})[_0x0bb2('0x23')](function(){return _0x5ba8b2;});})[_0x0bb2('0x23')](function(){_0x149e4c[_0x0bb2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x93b871,_0x46e5cb){return function(_0x3e7c89){if(!_0x3e7c89){_0x93b871[_0x0bb2('0x17')](0x194);}return _0x3e7c89;};}function handleError(_0x30dddf,_0x1e1e22){_0x1e1e22=_0x1e1e22||0x1f4;return function(_0x10699a){logger[_0x0bb2('0x28')](_0x10699a['stack']);if(_0x10699a[_0x0bb2('0x29')]){delete _0x10699a['name'];}_0x30dddf[_0x0bb2('0x18')](_0x1e1e22)['send'](_0x10699a);};}exports[_0x0bb2('0x2a')]=function(_0x253e0e,_0x4af95d){var _0x3cdb56={},_0x443c14={},_0x14decf={'count':0x0,'rows':[]};var _0x24c9a0=_[_0x0bb2('0x2b')](db['Interval']['rawAttributes'],function(_0x38273a){return{'name':_0x38273a[_0x0bb2('0x2c')],'type':_0x38273a['type']['key']};});_0x443c14[_0x0bb2('0x2d')]=_[_0x0bb2('0x2b')](_0x24c9a0,'name');_0x443c14['query']=_[_0x0bb2('0x2e')](_0x253e0e[_0x0bb2('0x2f')]);_0x443c14[_0x0bb2('0x30')]=_[_0x0bb2('0x31')](_0x443c14['model'],_0x443c14['query']);_0x3cdb56[_0x0bb2('0x32')]=_[_0x0bb2('0x31')](_0x443c14[_0x0bb2('0x2d')],qs[_0x0bb2('0x33')](_0x253e0e[_0x0bb2('0x2f')]['fields']));_0x3cdb56['attributes']=_0x3cdb56['attributes']['length']?_0x3cdb56[_0x0bb2('0x32')]:_0x443c14[_0x0bb2('0x2d')];if(!_0x253e0e[_0x0bb2('0x2f')]['hasOwnProperty']('nolimit')){_0x3cdb56[_0x0bb2('0x1d')]=qs['limit'](_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x1d')]);_0x3cdb56[_0x0bb2('0x1a')]=qs[_0x0bb2('0x1a')](_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x1a')]);}_0x3cdb56[_0x0bb2('0x34')]=qs[_0x0bb2('0x35')](_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x35')]);_0x3cdb56[_0x0bb2('0x36')]=qs[_0x0bb2('0x30')](_['pick'](_0x253e0e[_0x0bb2('0x2f')],_0x443c14[_0x0bb2('0x30')]),_0x24c9a0);if(_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x37')]){_0x3cdb56[_0x0bb2('0x36')]=_[_0x0bb2('0x38')](_0x3cdb56[_0x0bb2('0x36')],{'$or':_[_0x0bb2('0x2b')](_0x24c9a0,function(_0x3939af){if(_0x3939af[_0x0bb2('0x39')]!==_0x0bb2('0x3a')){var _0xeb8b0a={};_0xeb8b0a[_0x3939af[_0x0bb2('0x29')]]={'$like':'%'+_0x253e0e[_0x0bb2('0x2f')]['filter']+'%'};return _0xeb8b0a;}})});}_0x3cdb56=_['merge']({},_0x3cdb56,_0x253e0e[_0x0bb2('0x3b')]);var _0x5637c9={'where':_0x3cdb56[_0x0bb2('0x36')]};return db[_0x0bb2('0x3c')][_0x0bb2('0x1c')](_0x5637c9)[_0x0bb2('0x23')](function(_0x5d55a9){_0x14decf['count']=_0x5d55a9;if(_0x253e0e[_0x0bb2('0x2f')][_0x0bb2('0x3d')]){_0x3cdb56[_0x0bb2('0x3e')]=[{'all':!![]}];}return db[_0x0bb2('0x3c')]['findAll'](_0x3cdb56);})['then'](function(_0x56c9e9){_0x14decf[_0x0bb2('0x3f')]=_0x56c9e9;return _0x14decf;})[_0x0bb2('0x23')](respondWithFilteredResult(_0x4af95d,_0x3cdb56))[_0x0bb2('0x40')](handleError(_0x4af95d,null));};exports[_0x0bb2('0x41')]=function(_0x2024b6,_0x40aa50){var _0x2b8597={'raw':!![],'where':{'id':_0x2024b6[_0x0bb2('0x42')]['id']}},_0x3eaa0e={};_0x3eaa0e['model']=_[_0x0bb2('0x2e')](db['Interval']['rawAttributes']);_0x3eaa0e[_0x0bb2('0x2f')]=_['keys'](_0x2024b6[_0x0bb2('0x2f')]);_0x3eaa0e['filters']=_[_0x0bb2('0x31')](_0x3eaa0e[_0x0bb2('0x2d')],_0x3eaa0e[_0x0bb2('0x2f')]);_0x2b8597[_0x0bb2('0x32')]=_['intersection'](_0x3eaa0e['model'],qs[_0x0bb2('0x33')](_0x2024b6[_0x0bb2('0x2f')]['fields']));_0x2b8597[_0x0bb2('0x32')]=_0x2b8597[_0x0bb2('0x32')][_0x0bb2('0x43')]?_0x2b8597[_0x0bb2('0x32')]:_0x3eaa0e['model'];if(_0x2024b6[_0x0bb2('0x2f')][_0x0bb2('0x3d')]){_0x2b8597['include']=[{'all':!![]}];}_0x2b8597=_[_0x0bb2('0x38')]({},_0x2b8597,_0x2024b6[_0x0bb2('0x3b')]);return db[_0x0bb2('0x3c')]['find'](_0x2b8597)['then'](handleEntityNotFound(_0x40aa50,null))[_0x0bb2('0x23')](respondWithResult(_0x40aa50,null))['catch'](handleError(_0x40aa50,null));};exports['create']=function(_0x34af5f,_0x4202c1){return db['Interval'][_0x0bb2('0x44')](_0x34af5f[_0x0bb2('0x45')],{})[_0x0bb2('0x23')](function(_0x568c19){var _0x1ac0dd=_0x34af5f[_0x0bb2('0x46')][_0x0bb2('0x25')]({'plain':!![]});if(!_0x1ac0dd)throw new Error(_0x0bb2('0x47'));if(_0x1ac0dd['role']===_0x0bb2('0x46')){var _0x1a03c0=_0x568c19[_0x0bb2('0x25')]({'plain':!![]});var _0x33d7e7='Intervals';return db[_0x0bb2('0x48')][_0x0bb2('0x49')]({'where':{'name':_0x33d7e7,'userProfileId':_0x1ac0dd[_0x0bb2('0x4a')]},'raw':!![]})[_0x0bb2('0x23')](function(_0x52f398){if(_0x52f398&&_0x52f398['autoAssociation']===0x0){return db[_0x0bb2('0x27')]['create']({'name':_0x1a03c0[_0x0bb2('0x29')],'resourceId':_0x1a03c0['id'],'type':_0x52f398[_0x0bb2('0x29')],'sectionId':_0x52f398['id']},{})[_0x0bb2('0x23')](function(){return _0x568c19;});}else{return _0x568c19;}})[_0x0bb2('0x40')](function(_0x1c3db5){logger[_0x0bb2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c3db5);throw _0x1c3db5;});}return _0x568c19;})[_0x0bb2('0x23')](respondWithResult(_0x4202c1,0xc9))[_0x0bb2('0x40')](handleError(_0x4202c1,null));};exports[_0x0bb2('0x22')]=function(_0x4e4a7a,_0x1dcf85){if(_0x4e4a7a[_0x0bb2('0x45')]['id']){delete _0x4e4a7a[_0x0bb2('0x45')]['id'];}return db['Interval']['find']({'where':{'id':_0x4e4a7a['params']['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x1dcf85,null))[_0x0bb2('0x23')](saveUpdates(_0x4e4a7a[_0x0bb2('0x45')],null))['then'](respondWithResult(_0x1dcf85,null))[_0x0bb2('0x40')](handleError(_0x1dcf85,null));};exports[_0x0bb2('0x24')]=function(_0x17e204,_0x18f22b){return db[_0x0bb2('0x3c')][_0x0bb2('0x49')]({'where':{'id':_0x17e204['params']['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x18f22b,null))[_0x0bb2('0x23')](removeEntity(_0x18f22b,null))[_0x0bb2('0x40')](handleError(_0x18f22b,null));};exports['addInterval']=function(_0xb2493c,_0x1f7e02,_0x26c4c3){if(_0xb2493c[_0x0bb2('0x45')]['id']){delete _0xb2493c[_0x0bb2('0x45')]['id'];}return db['Interval'][_0x0bb2('0x49')]({'where':{'id':_0xb2493c[_0x0bb2('0x42')]['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x1f7e02,null))[_0x0bb2('0x23')](function(_0x4277fc){if(_0x4277fc){_0xb2493c['body'][_0x0bb2('0x4b')]=_0x4277fc['id'];return db[_0x0bb2('0x3c')]['create'](_0xb2493c[_0x0bb2('0x45')]);}})[_0x0bb2('0x23')](respondWithResult(_0x1f7e02,null))[_0x0bb2('0x40')](handleError(_0x1f7e02,null));};exports[_0x0bb2('0x4c')]=function(_0x47815d,_0x4e16e9,_0x3efacc){var _0x278f39={};var _0x13a0ea={};var _0x116043;var _0x42ae80;return db[_0x0bb2('0x3c')][_0x0bb2('0x4d')]({'where':{'id':_0x47815d['params']['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x4e16e9,null))[_0x0bb2('0x23')](function(_0x4eaac7){if(_0x4eaac7){_0x116043=_0x4eaac7;_0x13a0ea[_0x0bb2('0x2d')]=_[_0x0bb2('0x2e')](db[_0x0bb2('0x3c')][_0x0bb2('0x4e')]);_0x13a0ea[_0x0bb2('0x2f')]=_[_0x0bb2('0x2e')](_0x47815d[_0x0bb2('0x2f')]);_0x13a0ea[_0x0bb2('0x30')]=_['intersection'](_0x13a0ea['model'],_0x13a0ea['query']);_0x278f39['attributes']=_['intersection'](_0x13a0ea[_0x0bb2('0x2d')],qs[_0x0bb2('0x33')](_0x47815d[_0x0bb2('0x2f')][_0x0bb2('0x33')]));_0x278f39[_0x0bb2('0x32')]=_0x278f39['attributes'][_0x0bb2('0x43')]?_0x278f39[_0x0bb2('0x32')]:_0x13a0ea[_0x0bb2('0x2d')];_0x278f39[_0x0bb2('0x34')]=qs['sort'](_0x47815d['query'][_0x0bb2('0x35')]);_0x278f39['where']=qs['filters'](_[_0x0bb2('0x4f')](_0x47815d[_0x0bb2('0x2f')],_0x13a0ea['filters']));if(_0x47815d[_0x0bb2('0x2f')]['filter']){_0x278f39[_0x0bb2('0x36')]=_[_0x0bb2('0x38')](_0x278f39['where'],{'$or':_[_0x0bb2('0x2b')](_0x278f39[_0x0bb2('0x32')],function(_0x511cb9){var _0x487055={};_0x487055[_0x511cb9]={'$like':'%'+_0x47815d[_0x0bb2('0x2f')][_0x0bb2('0x37')]+'%'};return _0x487055;})});}_0x278f39=_['merge']({},_0x278f39,_0x47815d[_0x0bb2('0x3b')]);return _0x116043['getIntervals'](_0x278f39);}})[_0x0bb2('0x23')](function(_0x308639){if(_0x308639){_0x42ae80=_0x308639['length'];if(!_0x47815d['query'][_0x0bb2('0x50')](_0x0bb2('0x51'))){_0x278f39['limit']=qs[_0x0bb2('0x1d')](_0x47815d['query'][_0x0bb2('0x1d')]);_0x278f39[_0x0bb2('0x1a')]=qs['offset'](_0x47815d[_0x0bb2('0x2f')][_0x0bb2('0x1a')]);}return _0x116043[_0x0bb2('0x4c')](_0x278f39);}})[_0x0bb2('0x23')](function(_0x2713f3){if(_0x2713f3){return _0x2713f3?{'count':_0x42ae80,'rows':_0x2713f3}:null;}})[_0x0bb2('0x23')](respondWithResult(_0x4e16e9,null))[_0x0bb2('0x40')](handleError(_0x4e16e9,null));};exports[_0x0bb2('0x52')]=function(_0xc6851e,_0x5e3a30,_0x3b2c){return db[_0x0bb2('0x3c')][_0x0bb2('0x4d')]({'where':{'id':_0xc6851e[_0x0bb2('0x42')]['id']}})[_0x0bb2('0x23')](handleEntityNotFound(_0x5e3a30,null))[_0x0bb2('0x23')](function(_0x38806e){if(_0x38806e){return db['sequelize']['transaction'](function(_0xc6b427){return db[_0x0bb2('0x3c')]['destroy']({'where':{'IntervalId':_0xc6851e[_0x0bb2('0x42')]['id']},'transaction':_0xc6b427})[_0x0bb2('0x23')](function(_0x589b11){var _0x492c87=_['map'](_0xc6851e[_0x0bb2('0x45')],function(_0x370ffc){delete _0x370ffc['id'];_0x370ffc[_0x0bb2('0x4b')]=_0xc6851e[_0x0bb2('0x42')]['id'];return _0x370ffc;});return db[_0x0bb2('0x3c')]['bulkCreate'](_0x492c87,{'transaction':_0xc6b427});});})[_0x0bb2('0x23')](function(){return db['Interval'][_0x0bb2('0x53')]({'where':{'IntervalId':_0xc6851e[_0x0bb2('0x42')]['id']}});});}})[_0x0bb2('0x23')](respondWithResult(_0x5e3a30,null))[_0x0bb2('0x40')](handleError(_0x5e3a30,null));};
\ No newline at end of file
index ba21a50..a6fd2bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1598=['path','rimraf','../../config/environment','../../components/extensions/rewrite','Interval','tools_intervals','rewrite','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0x1598,0x1c3));var _0x8159=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1598[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8159('0x0'));var util=require('util');var logger=require(_0x8159('0x1'))(_0x8159('0x2'));var moment=require('moment');var BPromise=require(_0x8159('0x3'));var rp=require(_0x8159('0x4'));var fs=require('fs');var path=require(_0x8159('0x5'));var rimraf=require(_0x8159('0x6'));var config=require(_0x8159('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0x8159('0x8'));module['exports']=function(_0x55dcef,_0x49498e){return _0x55dcef['define'](_0x8159('0x9'),attributes,{'tableName':_0x8159('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x20d7f0,_0x3d6e61){extensions[_0x8159('0xb')](_0x55dcef,_0x20d7f0);},'afterBulkCreate':function(_0xc30171,_0x3530fd,_0x5c0355){_0x5c0355();extensions['rewrite'](_0x55dcef,_0xc30171[0x0]);},'afterUpdate':function(_0x4a80ee,_0x49291a){extensions[_0x8159('0xb')](_0x55dcef,_0x4a80ee);},'afterDestroy':function(_0x2f6f8b,_0x4cccca){extensions['rewrite'](_0x55dcef,_0x2f6f8b);}}});};
\ No newline at end of file
+var _0x76c1=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./interval.attributes','Interval','tools_intervals','rewrite','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76c1,0x15b));var _0x176c=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0x76c1[_0x52e0ee];return _0x32534c;};'use strict';var _=require(_0x176c('0x0'));var util=require(_0x176c('0x1'));var logger=require(_0x176c('0x2'))(_0x176c('0x3'));var moment=require(_0x176c('0x4'));var BPromise=require(_0x176c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x176c('0x6'));var config=require(_0x176c('0x7'));var attributes=require(_0x176c('0x8'));var extensions=require('../../components/extensions/rewrite');module['exports']=function(_0xc28671,_0x329a5e){return _0xc28671['define'](_0x176c('0x9'),attributes,{'tableName':_0x176c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x40c110,_0x5d58ba){extensions['rewrite'](_0xc28671,_0x40c110);},'afterBulkCreate':function(_0x27c52f,_0x1efd0a,_0x4951b1){_0x4951b1();extensions[_0x176c('0xb')](_0xc28671,_0x27c52f[0x0]);},'afterUpdate':function(_0x3ec9f0,_0x54dc22){extensions[_0x176c('0xb')](_0xc28671,_0x3ec9f0);},'afterDestroy':function(_0x7eb046,_0x38e660){extensions['rewrite'](_0xc28671,_0x7eb046);}}});};
\ No newline at end of file
index f4a6014..602dbe8 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(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 aa8c6e1..2f9af39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router;
\ No newline at end of file
+var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x27e8a1,_0x527a3a){var _0x78f8d4=function(_0xc02e23){while(--_0xc02e23){_0x27e8a1['push'](_0x27e8a1['shift']());}};_0x78f8d4(++_0x527a3a);}(_0x2ef3,0xba));var _0x32ef=function(_0x30d946,_0x2ecd91){_0x30d946=_0x30d946-0x0;var _0x3b74ae=_0x2ef3[_0x30d946];return _0x3b74ae;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router;
\ No newline at end of file
index 85f4f6f..f06db99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc543=['x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','base64','setEncoding','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','body'];(function(_0xf12d51,_0x452bb6){var _0x3c0b97=function(_0x12ff2d){while(--_0x12ff2d){_0xf12d51['push'](_0xf12d51['shift']());}};_0x3c0b97(++_0x452bb6);}(_0xc543,0x1a2));var _0x3c54=function(_0x2260f3,_0x1b433c){_0x2260f3=_0x2260f3-0x0;var _0xb76562=_0xc543[_0x2260f3];return _0xb76562;};'use strict';var BPromise=require(_0x3c54('0x0'));var https=require(_0x3c54('0x1'));var logger=require(_0x3c54('0x2'))(_0x3c54('0x3'));var USERNAME=_0x3c54('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x130c90,_0x6f50f2){var _0x5db395={'fields':{'project':{'key':_0x130c90['key']||_0x3c54('0x5')},'summary':(_0x130c90[_0x3c54('0x6')]||_0x3c54('0x7'))+_0x3c54('0x8')+_0x130c90['ip'],'description':_0x130c90[_0x3c54('0x9')]||JSON[_0x3c54('0xa')](_0x130c90),'issuetype':{'name':_0x130c90[_0x3c54('0xb')]||_0x3c54('0xc')}}};_0x5db395[_0x3c54('0xd')][_0x3c54('0xe')]=_0x130c90[_0x3c54('0xf')];_0x5db395[_0x3c54('0xd')][_0x3c54('0x10')]=_0x130c90['oldToken'];_0x5db395[_0x3c54('0xd')][_0x3c54('0x11')]=_0x130c90[_0x3c54('0x12')];_0x5db395[_0x3c54('0xd')][_0x3c54('0x13')]=_0x130c90[_0x3c54('0x14')];_0x5db395[_0x3c54('0xd')][_0x3c54('0x15')]=_0x130c90[_0x3c54('0x16')];_0x5db395[_0x3c54('0xd')][_0x3c54('0x17')]=_0x130c90['ip'];var _0x4ccff1={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3c54('0x18'),'method':_0x3c54('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x3c54('0x1a'),'Authorization':_0x3c54('0x1b')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3c54('0x1c'))}};var _0x1d9ff1=JSON[_0x3c54('0xa')](_0x5db395);var _0x43fe3a=https['request'](_0x4ccff1,function(_0x1ffde4){_0x1ffde4[_0x3c54('0x1d')](_0x3c54('0x1e'));var _0x3f11ed='';_0x1ffde4['on'](_0x3c54('0x1f'),function(_0x1ce150){_0x3f11ed+=_0x1ce150;});_0x1ffde4['on'](_0x3c54('0x20'),function(){if(_0x6f50f2){return _0x6f50f2[_0x3c54('0x21')](_0x1ffde4[_0x3c54('0x22')])['json'](JSON[_0x3c54('0x23')](_0x3f11ed));}});});_0x43fe3a['on'](_0x3c54('0x24'),function(_0x4610c2){if(_0x6f50f2){return _0x6f50f2[_0x3c54('0x21')](0x1f4)[_0x3c54('0x25')]({'errors':[{'message':_0x3c54('0x26'),'type':'api.jira'}]});}});_0x43fe3a['write'](_0x1d9ff1);_0x43fe3a[_0x3c54('0x20')]();}exports[_0x3c54('0x27')]=openIssue;exports[_0x3c54('0x28')]=function(_0xc20369,_0x418a03){_0xc20369[_0x3c54('0x29')]['ip']=_0xc20369['headers'][_0x3c54('0x2a')]||_0xc20369[_0x3c54('0x2b')][_0x3c54('0x2c')]||_0xc20369[_0x3c54('0x2d')][_0x3c54('0x2c')]||_0xc20369[_0x3c54('0x2b')][_0x3c54('0x2d')][_0x3c54('0x2c')];return openIssue(_0xc20369[_0x3c54('0x29')],_0x418a03);};
\ No newline at end of file
+var _0x0894=['newToken','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','data','end','status','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','body','connection','socket','remoteAddress','bluebird','https','support','3eAmWpBVP0','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x0894,0x82));var _0x4089=function(_0x5227ba,_0xb334ca){_0x5227ba=_0x5227ba-0x0;var _0x5b76e1=_0x0894[_0x5227ba];return _0x5b76e1;};'use strict';var BPromise=require(_0x4089('0x0'));var https=require(_0x4089('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x4089('0x2');var PASSWORD=_0x4089('0x3');function openIssue(_0x392371,_0x3979a2){var _0x577292={'fields':{'project':{'key':_0x392371['key']||'MOTGUI'},'summary':(_0x392371['summary']||_0x4089('0x4'))+_0x4089('0x5')+_0x392371['ip'],'description':_0x392371[_0x4089('0x6')]||JSON[_0x4089('0x7')](_0x392371),'issuetype':{'name':_0x392371[_0x4089('0x8')]||_0x4089('0x9')}}};_0x577292[_0x4089('0xa')]['customfield_11500']=_0x392371[_0x4089('0xb')];_0x577292['fields'][_0x4089('0xc')]=_0x392371[_0x4089('0xd')];_0x577292[_0x4089('0xa')]['customfield_11502']=_0x392371[_0x4089('0xe')];_0x577292[_0x4089('0xa')]['customfield_11503']=_0x392371[_0x4089('0xf')];_0x577292['fields']['customfield_11504']=_0x392371['reason'];_0x577292[_0x4089('0xa')][_0x4089('0x10')]=_0x392371['ip'];var _0x594424={'host':_0x4089('0x11'),'port':0x1bb,'path':_0x4089('0x12'),'method':_0x4089('0x13'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x4089('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x4089('0x15')](_0x4089('0x16'))}};var _0xe02c3f=JSON['stringify'](_0x577292);var _0x2e0d4a=https[_0x4089('0x17')](_0x594424,function(_0x372254){_0x372254[_0x4089('0x18')]('utf8');var _0x3d565e='';_0x372254['on'](_0x4089('0x19'),function(_0x26747e){_0x3d565e+=_0x26747e;});_0x372254['on'](_0x4089('0x1a'),function(){if(_0x3979a2){return _0x3979a2[_0x4089('0x1b')](_0x372254['statusCode'])['json'](JSON[_0x4089('0x1c')](_0x3d565e));}});});_0x2e0d4a['on'](_0x4089('0x1d'),function(_0x503fac){if(_0x3979a2){return _0x3979a2['status'](0x1f4)['json']({'errors':[{'message':_0x4089('0x1e'),'type':'api.jira'}]});}});_0x2e0d4a['write'](_0xe02c3f);_0x2e0d4a[_0x4089('0x1a')]();}exports[_0x4089('0x1f')]=openIssue;exports['send']=function(_0x308623,_0x5284e0){_0x308623[_0x4089('0x20')]['ip']=_0x308623['headers']['x-forwarded-for']||_0x308623[_0x4089('0x21')]['remoteAddress']||_0x308623[_0x4089('0x22')][_0x4089('0x23')]||_0x308623['connection'][_0x4089('0x22')][_0x4089('0x23')];return openIssue(_0x308623[_0x4089('0x20')],_0x5284e0);};
\ No newline at end of file
index 6a15632..4b7ed70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index','get'];(function(_0x98bf92,_0x6f521e){var _0x5931b3=function(_0x5715dc){while(--_0x5715dc){_0x98bf92['push'](_0x98bf92['shift']());}};_0x5931b3(++_0x6f521e);}(_0x54ef,0x112));var _0xf54e=function(_0x5a949b,_0x518d71){_0x5a949b=_0x5a949b-0x0;var _0x58042c=_0x54ef[_0x5a949b];return _0x58042c;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['get'](_0xf54e('0xe'),auth[_0xf54e('0xf')](),controller['show']);router[_0xf54e('0x10')]('/',auth[_0xf54e('0xf')](),controller[_0xf54e('0x11')]);router[_0xf54e('0x12')]('/:id',auth[_0xf54e('0xf')](),controller[_0xf54e('0x13')]);router[_0xf54e('0x14')](_0xf54e('0xe'),auth['isAuthenticated'](),controller[_0xf54e('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x54ef=['/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index','get'];(function(_0x584bfd,_0x2fc206){var _0x1b8696=function(_0xa9e9fd){while(--_0xa9e9fd){_0x584bfd['push'](_0x584bfd['shift']());}};_0x1b8696(++_0x2fc206);}(_0x54ef,0x112));var _0xf54e=function(_0x23188d,_0x20e952){_0x23188d=_0x23188d-0x0;var _0x4dd729=_0x54ef[_0x23188d];return _0x4dd729;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['get'](_0xf54e('0xe'),auth[_0xf54e('0xf')](),controller['show']);router[_0xf54e('0x10')]('/',auth[_0xf54e('0xf')](),controller[_0xf54e('0x11')]);router[_0xf54e('0x12')]('/:id',auth[_0xf54e('0xf')](),controller[_0xf54e('0x13')]);router[_0xf54e('0x14')](_0xf54e('0xe'),auth['isAuthenticated'](),controller[_0xf54e('0x15')]);module['exports']=router;
\ No newline at end of file
index a57fd34..f50fe7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x15c613,_0x4ef4dc){_0x15c613=_0x15c613-0x0;var _0x2296e8=_0x7a54[_0x15c613];return _0x2296e8;};'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(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x251c38,_0x4df890){_0x251c38=_0x251c38-0x0;var _0x3025c8=_0x7a54[_0x251c38];return _0x3025c8;};'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 f3c5b17..8ae6300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['create','body','params','describe','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','undefined','limit','count','set','apply','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','length','find'];(function(_0x3e84bd,_0x175b22){var _0x1c1c60=function(_0x5c99e3){while(--_0x5c99e3){_0x3e84bd['push'](_0x3e84bd['shift']());}};_0x1c1c60(++_0x175b22);}(_0xf494,0x1c6));var _0x4f49=function(_0x1bd9b1,_0x301af7){_0x1bd9b1=_0x1bd9b1-0x0;var _0x595c95=_0xf494[_0x1bd9b1];return _0x595c95;};'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'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}exports[_0x4f49('0x29')]=function(_0x2c00ee,_0x605c91){var _0x560050={},_0x3cbfbd={},_0x206203={'count':0x0,'rows':[]};var _0x43d8e3=_['map'](db['JscriptyAnswerReport'][_0x4f49('0x2a')],function(_0x27d004){return{'name':_0x27d004[_0x4f49('0x2b')],'type':_0x27d004['type'][_0x4f49('0x2c')]};});_0x3cbfbd[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x43d8e3,_0x4f49('0x28'));_0x3cbfbd[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x2c00ee[_0x4f49('0x2f')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],_0x3cbfbd[_0x4f49('0x2f')]);_0x560050[_0x4f49('0x33')]=_[_0x4f49('0x32')](_0x3cbfbd[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x34')]));_0x560050[_0x4f49('0x33')]=_0x560050[_0x4f49('0x33')]['length']?_0x560050[_0x4f49('0x33')]:_0x3cbfbd[_0x4f49('0x2d')];if(!_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x35')](_0x4f49('0x36'))){_0x560050[_0x4f49('0x1f')]=qs[_0x4f49('0x1f')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1f')]);_0x560050[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x1d')]);}_0x560050['order']=qs[_0x4f49('0x37')](_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x37')]);_0x560050[_0x4f49('0x38')]=qs[_0x4f49('0x31')](_[_0x4f49('0x39')](_0x2c00ee[_0x4f49('0x2f')],_0x3cbfbd[_0x4f49('0x31')]),_0x43d8e3);if(_0x2c00ee[_0x4f49('0x2f')][_0x4f49('0x3a')]){_0x560050[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0x560050[_0x4f49('0x38')],{'$or':_[_0x4f49('0x2e')](_0x43d8e3,function(_0x4e3f72){if(_0x4e3f72[_0x4f49('0x3c')]!==_0x4f49('0x3d')){var _0x543605={};_0x543605[_0x4e3f72[_0x4f49('0x28')]]={'$like':'%'+_0x2c00ee[_0x4f49('0x2f')]['filter']+'%'};return _0x543605;}})});}_0x560050=_[_0x4f49('0x3b')]({},_0x560050,_0x2c00ee[_0x4f49('0x3e')]);var _0x2548ad={'where':_0x560050[_0x4f49('0x38')]};return db[_0x4f49('0x3f')][_0x4f49('0x20')](_0x2548ad)[_0x4f49('0x25')](function(_0x5d464e){_0x206203['count']=_0x5d464e;if(_0x2c00ee['query'][_0x4f49('0x40')]){_0x560050[_0x4f49('0x41')]=[{'all':!![]}];}return db[_0x4f49('0x3f')][_0x4f49('0x42')](_0x560050);})[_0x4f49('0x25')](function(_0x1ecf6c){_0x206203[_0x4f49('0x43')]=_0x1ecf6c;return _0x206203;})[_0x4f49('0x25')](respondWithFilteredResult(_0x605c91,_0x560050))[_0x4f49('0x44')](handleError(_0x605c91,null));};exports['show']=function(_0x5238a3,_0x412395){var _0x432b5d={'raw':!![],'where':{'id':_0x5238a3['params']['id']}},_0x159642={};_0x159642[_0x4f49('0x2d')]=_['keys'](db['JscriptyAnswerReport'][_0x4f49('0x2a')]);_0x159642[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x5238a3['query']);_0x159642[_0x4f49('0x31')]=_[_0x4f49('0x32')](_0x159642['model'],_0x159642[_0x4f49('0x2f')]);_0x432b5d['attributes']=_[_0x4f49('0x32')](_0x159642[_0x4f49('0x2d')],qs[_0x4f49('0x34')](_0x5238a3['query'][_0x4f49('0x34')]));_0x432b5d[_0x4f49('0x33')]=_0x432b5d[_0x4f49('0x33')][_0x4f49('0x45')]?_0x432b5d[_0x4f49('0x33')]:_0x159642[_0x4f49('0x2d')];if(_0x5238a3[_0x4f49('0x2f')][_0x4f49('0x40')]){_0x432b5d[_0x4f49('0x41')]=[{'all':!![]}];}_0x432b5d=_[_0x4f49('0x3b')]({},_0x432b5d,_0x5238a3['options']);return db[_0x4f49('0x3f')][_0x4f49('0x46')](_0x432b5d)['then'](handleEntityNotFound(_0x412395,null))[_0x4f49('0x25')](respondWithResult(_0x412395,null))['catch'](handleError(_0x412395,null));};exports[_0x4f49('0x47')]=function(_0x41c580,_0x2d3dcd){return db[_0x4f49('0x3f')]['create'](_0x41c580[_0x4f49('0x48')],{})[_0x4f49('0x25')](respondWithResult(_0x2d3dcd,0xc9))[_0x4f49('0x44')](handleError(_0x2d3dcd,null));};exports[_0x4f49('0x24')]=function(_0x3ec266,_0x72ea05){if(_0x3ec266[_0x4f49('0x48')]['id']){delete _0x3ec266[_0x4f49('0x48')]['id'];}return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'id':_0x3ec266[_0x4f49('0x49')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x72ea05,null))[_0x4f49('0x25')](saveUpdates(_0x3ec266[_0x4f49('0x48')],null))[_0x4f49('0x25')](respondWithResult(_0x72ea05,null))[_0x4f49('0x44')](handleError(_0x72ea05,null));};exports['destroy']=function(_0x4eadc2,_0xce5121){return db[_0x4f49('0x3f')][_0x4f49('0x46')]({'where':{'id':_0x4eadc2[_0x4f49('0x49')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0xce5121,null))[_0x4f49('0x25')](removeEntity(_0xce5121,null))[_0x4f49('0x44')](handleError(_0xce5121,null));};exports['describe']=function(_0x6637f4,_0x4ff0a2){return db[_0x4f49('0x3f')][_0x4f49('0x4a')]()[_0x4f49('0x25')](respondWithResult(_0x4ff0a2,null))[_0x4f49('0x44')](handleError(_0x4ff0a2,null));};
\ No newline at end of file
+var _0xb138=['filters','pick','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x319065,_0x436641){var _0x113f56=function(_0x48527c){while(--_0x48527c){_0x319065['push'](_0x319065['shift']());}};_0x113f56(++_0x436641);}(_0xb138,0x1dd));var _0x8b13=function(_0x2adb81,_0x4c9501){_0x2adb81=_0x2adb81-0x0;var _0x125722=_0xb138[_0x2adb81];return _0x125722;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['map'](_0x35fdca,_0x8b13('0x2b'));_0x2bb51d[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x3475d8[_0x8b13('0x35')]);_0x2bb51d['filters']=_['intersection'](_0x2bb51d[_0x8b13('0x34')],_0x2bb51d['query']);_0x114b01['attributes']=_[_0x8b13('0x37')](_0x2bb51d['model'],qs[_0x8b13('0x38')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x38')]));_0x114b01[_0x8b13('0x39')]=_0x114b01[_0x8b13('0x39')][_0x8b13('0x3a')]?_0x114b01[_0x8b13('0x39')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8[_0x8b13('0x35')][_0x8b13('0x3b')]('nolimit')){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8[_0x8b13('0x35')][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3c')](_0x3475d8['query'][_0x8b13('0x3c')]);_0x114b01[_0x8b13('0x3d')]=qs[_0x8b13('0x3e')](_[_0x8b13('0x3f')](_0x3475d8[_0x8b13('0x35')],_0x2bb51d[_0x8b13('0x3e')]),_0x35fdca);if(_0x3475d8['query']['filter']){_0x114b01[_0x8b13('0x3d')]=_['merge'](_0x114b01[_0x8b13('0x3d')],{'$or':_['map'](_0x35fdca,function(_0x590a23){if(_0x590a23[_0x8b13('0x32')]!==_0x8b13('0x40')){var _0x2bc877={};_0x2bc877[_0x590a23[_0x8b13('0x2b')]]={'$like':'%'+_0x3475d8['query']['filter']+'%'};return _0x2bc877;}})});}_0x114b01=_[_0x8b13('0x41')]({},_0x114b01,_0x3475d8['options']);var _0x6ba2f3={'where':_0x114b01[_0x8b13('0x3d')]};return db['JscriptyAnswerReport'][_0x8b13('0x20')](_0x6ba2f3)[_0x8b13('0x26')](function(_0x35c1d6){_0x5ab161[_0x8b13('0x20')]=_0x35c1d6;if(_0x3475d8[_0x8b13('0x35')][_0x8b13('0x42')]){_0x114b01[_0x8b13('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x114b01);})['then'](function(_0x3eb3c5){_0x5ab161[_0x8b13('0x44')]=_0x3eb3c5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x45')](handleError(_0x1511bf,null));};exports[_0x8b13('0x46')]=function(_0x271507,_0x492f7d){var _0x4342db={'raw':!![],'where':{'id':_0x271507[_0x8b13('0x47')]['id']}},_0x50e535={};_0x50e535['model']=_[_0x8b13('0x36')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x50e535[_0x8b13('0x35')]=_[_0x8b13('0x36')](_0x271507[_0x8b13('0x35')]);_0x50e535[_0x8b13('0x3e')]=_['intersection'](_0x50e535['model'],_0x50e535['query']);_0x4342db[_0x8b13('0x39')]=_[_0x8b13('0x37')](_0x50e535[_0x8b13('0x34')],qs[_0x8b13('0x38')](_0x271507['query']['fields']));_0x4342db[_0x8b13('0x39')]=_0x4342db['attributes'][_0x8b13('0x3a')]?_0x4342db[_0x8b13('0x39')]:_0x50e535[_0x8b13('0x34')];if(_0x271507[_0x8b13('0x35')][_0x8b13('0x42')]){_0x4342db['include']=[{'all':!![]}];}_0x4342db=_[_0x8b13('0x41')]({},_0x4342db,_0x271507[_0x8b13('0x48')]);return db[_0x8b13('0x2f')][_0x8b13('0x49')](_0x4342db)[_0x8b13('0x26')](handleEntityNotFound(_0x492f7d,null))[_0x8b13('0x26')](respondWithResult(_0x492f7d,null))[_0x8b13('0x45')](handleError(_0x492f7d,null));};exports[_0x8b13('0x4a')]=function(_0x3e192b,_0x518298){return db[_0x8b13('0x2f')]['create'](_0x3e192b[_0x8b13('0x4b')],{})[_0x8b13('0x26')](respondWithResult(_0x518298,0xc9))[_0x8b13('0x45')](handleError(_0x518298,null));};exports['update']=function(_0x148efb,_0x35f612){if(_0x148efb[_0x8b13('0x4b')]['id']){delete _0x148efb[_0x8b13('0x4b')]['id'];}return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x148efb[_0x8b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x35f612,null))[_0x8b13('0x26')](saveUpdates(_0x148efb['body'],null))[_0x8b13('0x26')](respondWithResult(_0x35f612,null))[_0x8b13('0x45')](handleError(_0x35f612,null));};exports[_0x8b13('0x27')]=function(_0x435867,_0x2be640){return db[_0x8b13('0x2f')][_0x8b13('0x49')]({'where':{'id':_0x435867[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x2be640,null))[_0x8b13('0x26')](removeEntity(_0x2be640,null))[_0x8b13('0x45')](handleError(_0x2be640,null));};exports[_0x8b13('0x4c')]=function(_0xd55f3b,_0x2bdfae){return db[_0x8b13('0x2f')][_0x8b13('0x4c')]()[_0x8b13('0x26')](respondWithResult(_0x2bdfae,null))['catch'](handleError(_0x2bdfae,null));};
\ No newline at end of file
index e53103e..bb51db8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2c4=['path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird'];(function(_0x117b50,_0x906373){var _0x2e96bc=function(_0x118eaf){while(--_0x118eaf){_0x117b50['push'](_0x117b50['shift']());}};_0x2e96bc(++_0x906373);}(_0xd2c4,0x1ca));var _0x4d2c=function(_0x163cba,_0x3b18d7){_0x163cba=_0x163cba-0x0;var _0x44f96c=_0xd2c4[_0x163cba];return _0x44f96c;};'use strict';var _=require(_0x4d2c('0x0'));var util=require(_0x4d2c('0x1'));var logger=require('../../config/logger')(_0x4d2c('0x2'));var moment=require('moment');var BPromise=require(_0x4d2c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d2c('0x4'));var rimraf=require(_0x4d2c('0x5'));var config=require(_0x4d2c('0x6'));var attributes=require(_0x4d2c('0x7'));module[_0x4d2c('0x8')]=function(_0x5d0920,_0x338580){return _0x5d0920['define'](_0x4d2c('0x9'),attributes,{'tableName':_0x4d2c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c4a=['report_jscripty_answers','lodash','api','bluebird','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport'];(function(_0x2341b9,_0x57d1d0){var _0x592fe0=function(_0x13c7c9){while(--_0x13c7c9){_0x2341b9['push'](_0x2341b9['shift']());}};_0x592fe0(++_0x57d1d0);}(_0x9c4a,0x1b9));var _0xa9c4=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x9c4a[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xa9c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa9c4('0x1'));var moment=require('moment');var BPromise=require(_0xa9c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9c4('0x3'));var rimraf=require(_0xa9c4('0x4'));var config=require(_0xa9c4('0x5'));var attributes=require(_0xa9c4('0x6'));module['exports']=function(_0xc7b768,_0x2725fd){return _0xc7b768[_0xa9c4('0x7')](_0xa9c4('0x8'),attributes,{'tableName':_0xa9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 62aa86c..a86298a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x700b=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x52aa0d,_0x331c4a){var _0x3d910e=function(_0xf30e50){while(--_0xf30e50){_0x52aa0d['push'](_0x52aa0d['shift']());}};_0x3d910e(++_0x331c4a);}(_0x700b,0x78));var _0xb700=function(_0x4ee499,_0x2ef613){_0x4ee499=_0x4ee499-0x0;var _0x6c8723=_0x700b[_0x4ee499];return _0x6c8723;};'use strict';var _=require('lodash');var util=require(_0xb700('0x0'));var moment=require(_0xb700('0x1'));var BPromise=require(_0xb700('0x2'));var rs=require(_0xb700('0x3'));var fs=require('fs');var Redis=require(_0xb700('0x4'));var db=require(_0xb700('0x5'))['db'];var utils=require(_0xb700('0x6'));var logger=require(_0xb700('0x7'))(_0xb700('0x8'));var config=require(_0xb700('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25459b,_0x9fc54f,_0x35e5e7){return new BPromise(function(_0x506f9a,_0x1c4f44){return client[_0xb700('0xa')](_0x25459b,_0x35e5e7)[_0xb700('0xb')](function(_0x2d1dc2){logger[_0xb700('0xc')](_0xb700('0xd'),_0x9fc54f,_0xb700('0xe'));logger[_0xb700('0xf')](_0xb700('0x10'),_0x9fc54f,'request\x20sent',JSON[_0xb700('0x11')](_0x2d1dc2));if(_0x2d1dc2['error']){if(_0x2d1dc2[_0xb700('0x12')][_0xb700('0x13')]===0x1f4){logger['error'](_0xb700('0xd'),_0x9fc54f,_0x2d1dc2[_0xb700('0x12')][_0xb700('0x14')]);return _0x1c4f44(_0x2d1dc2[_0xb700('0x12')][_0xb700('0x14')]);}logger[_0xb700('0x12')](_0xb700('0xd'),_0x9fc54f,_0x2d1dc2[_0xb700('0x12')][_0xb700('0x14')]);return _0x506f9a(_0x2d1dc2[_0xb700('0x12')][_0xb700('0x14')]);}else{logger['info'](_0xb700('0xd'),_0x9fc54f,_0xb700('0xe'));_0x506f9a(_0x2d1dc2[_0xb700('0x15')][_0xb700('0x14')]);}})[_0xb700('0x16')](function(_0x3c8e6){logger[_0xb700('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x9fc54f,_0x3c8e6);_0x1c4f44(_0x3c8e6);});});}
\ No newline at end of file
+var _0xa5d7=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x31ab61,_0x713399){var _0x33b532=function(_0x3dda69){while(--_0x3dda69){_0x31ab61['push'](_0x31ab61['shift']());}};_0x33b532(++_0x713399);}(_0xa5d7,0x124));var _0x7a5d=function(_0x4f6e9e,_0x52db46){_0x4f6e9e=_0x4f6e9e-0x0;var _0x14bb55=_0xa5d7[_0x4f6e9e];return _0x14bb55;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var moment=require(_0x7a5d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a5d('0x3'));var db=require(_0x7a5d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a5d('0x5'))(_0x7a5d('0x6'));var config=require(_0x7a5d('0x7'));var jayson=require(_0x7a5d('0x8'));var client=jayson['client'][_0x7a5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286127,_0x51be3d,_0x124329){return new BPromise(function(_0x232401,_0xa3da5){return client[_0x7a5d('0xa')](_0x286127,_0x124329)[_0x7a5d('0xb')](function(_0x58416c){logger[_0x7a5d('0xc')](_0x7a5d('0xd'),_0x51be3d,_0x7a5d('0xe'));logger[_0x7a5d('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x51be3d,'request\x20sent',JSON[_0x7a5d('0x10')](_0x58416c));if(_0x58416c['error']){if(_0x58416c[_0x7a5d('0x11')]['code']===0x1f4){logger['error'](_0x7a5d('0xd'),_0x51be3d,_0x58416c[_0x7a5d('0x11')][_0x7a5d('0x12')]);return _0xa3da5(_0x58416c['error']['message']);}logger['error'](_0x7a5d('0xd'),_0x51be3d,_0x58416c[_0x7a5d('0x11')][_0x7a5d('0x12')]);return _0x232401(_0x58416c['error'][_0x7a5d('0x12')]);}else{logger['info'](_0x7a5d('0xd'),_0x51be3d,_0x7a5d('0xe'));_0x232401(_0x58416c[_0x7a5d('0x13')]['message']);}})[_0x7a5d('0x14')](function(_0x5e3d18){logger[_0x7a5d('0x11')](_0x7a5d('0xd'),_0x51be3d,_0x5e3d18);_0xa3da5(_0x5e3d18);});});}
\ No newline at end of file
index 00e3087..b3b171b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45d8=['getSessions','getAnswers','30s','post','/:id/clone','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions'];(function(_0x4da62b,_0x469719){var _0x39bb0c=function(_0x3d2210){while(--_0x3d2210){_0x4da62b['push'](_0x4da62b['shift']());}};_0x39bb0c(++_0x469719);}(_0x45d8,0xe1));var _0x845d=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x45d8[_0x160248];return _0x4e589d;};'use strict';var multer=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var path=require(_0x845d('0x2'));var timeout=require('connect-timeout');var express=require(_0x845d('0x3'));var router=express[_0x845d('0x4')]();var fs_extra=require(_0x845d('0x5'));var auth=require(_0x845d('0x6'));var interaction=require(_0x845d('0x7'));var config=require(_0x845d('0x8'));var controller=require(_0x845d('0x9'));router[_0x845d('0xa')]('/',auth[_0x845d('0xb')](),controller[_0x845d('0xc')]);router[_0x845d('0xa')](_0x845d('0xd'),auth[_0x845d('0xb')](),controller['show']);router['get'](_0x845d('0xe'),auth[_0x845d('0xb')](),controller[_0x845d('0xf')]);router[_0x845d('0xa')]('/:id/answers',auth[_0x845d('0xb')](),controller[_0x845d('0x10')]);router[_0x845d('0xa')]('/:id/summary',auth[_0x845d('0xb')](),timeout(_0x845d('0x11')),controller['getSummary']);router[_0x845d('0x12')]('/',auth[_0x845d('0xb')](),controller['create']);router['post'](_0x845d('0x13'),auth['isAuthenticated'](),controller['clone']);router[_0x845d('0x14')](_0x845d('0xd'),auth[_0x845d('0xb')](),controller[_0x845d('0x15')]);router[_0x845d('0x16')]('/:id',auth[_0x845d('0xb')](),controller['destroy']);module[_0x845d('0x17')]=router;
\ No newline at end of file
+var _0x82be=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','isAuthenticated','index','get','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','/:id','update','delete','exports','multer','util','express'];(function(_0x4ad51a,_0x1b8dde){var _0x1bc1ef=function(_0x246f2c){while(--_0x246f2c){_0x4ad51a['push'](_0x4ad51a['shift']());}};_0x1bc1ef(++_0x1b8dde);}(_0x82be,0x126));var _0xe82b=function(_0x46561b,_0x548918){_0x46561b=_0x46561b-0x0;var _0x142ecc=_0x82be[_0x46561b];return _0x142ecc;};'use strict';var multer=require(_0xe82b('0x0'));var util=require(_0xe82b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe82b('0x2'));var router=express[_0xe82b('0x3')]();var fs_extra=require(_0xe82b('0x4'));var auth=require(_0xe82b('0x5'));var interaction=require(_0xe82b('0x6'));var config=require('../../config/environment');var controller=require(_0xe82b('0x7'));router['get']('/',auth[_0xe82b('0x8')](),controller[_0xe82b('0x9')]);router[_0xe82b('0xa')]('/:id',auth[_0xe82b('0x8')](),controller[_0xe82b('0xb')]);router[_0xe82b('0xa')](_0xe82b('0xc'),auth['isAuthenticated'](),controller[_0xe82b('0xd')]);router[_0xe82b('0xa')]('/:id/answers',auth[_0xe82b('0x8')](),controller[_0xe82b('0xe')]);router[_0xe82b('0xa')](_0xe82b('0xf'),auth['isAuthenticated'](),timeout(_0xe82b('0x10')),controller[_0xe82b('0x11')]);router[_0xe82b('0x12')]('/',auth[_0xe82b('0x8')](),controller[_0xe82b('0x13')]);router[_0xe82b('0x12')](_0xe82b('0x14'),auth[_0xe82b('0x8')](),controller[_0xe82b('0x15')]);router[_0xe82b('0x16')](_0xe82b('0x17'),auth[_0xe82b('0x8')](),controller[_0xe82b('0x18')]);router[_0xe82b('0x19')]('/:id',auth[_0xe82b('0x8')](),controller['destroy']);module[_0xe82b('0x1a')]=router;
\ No newline at end of file
index 43caf57..fd6b8a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x713e=['isObjectLike','setDataValue','formData','format','getDataValue','BOOLEAN','sequelize','lodash','STRING','name','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x713e,0x1b6));var _0xe713=function(_0x22e644,_0x411f77){_0x22e644=_0x22e644-0x0;var _0x517ddf=_0x713e[_0x22e644];return _0x517ddf;};'use strict';var Sequelize=require(_0xe713('0x0'));var _=require(_0xe713('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xe713('0x2')],'unique':_0xe713('0x3')},'description':{'type':Sequelize[_0xe713('0x2')]},'formData':{'type':Sequelize[_0xe713('0x4')](_0xe713('0x5')),'set':function(_0x41d304){if(_[_0xe713('0x6')](_0x41d304)){this[_0xe713('0x7')]('formData',JSON['stringify'](_0x41d304));}else if(_['isString'](_0x41d304)){this['setDataValue'](_0xe713('0x8'),_0x41d304);}else{this[_0xe713('0x7')](_0xe713('0x8'),util[_0xe713('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0xe713('0x3'))||'',this[_0xe713('0xa')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe713('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe713('0xb')],'defaultValue':![]}};
\ No newline at end of file
+var _0x583f=['name','long','formData','stringify','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','STRING'];(function(_0x36fff7,_0x19cc65){var _0x31d79b=function(_0x55747e){while(--_0x55747e){_0x36fff7['push'](_0x36fff7['shift']());}};_0x31d79b(++_0x19cc65);}(_0x583f,0x1de));var _0xf583=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0x583f[_0x441f7a];return _0x4821da;};'use strict';var Sequelize=require(_0xf583('0x0'));var _=require('lodash');var util=require(_0xf583('0x1'));module['exports']={'name':{'type':Sequelize[_0xf583('0x2')],'unique':_0xf583('0x3')},'description':{'type':Sequelize[_0xf583('0x2')]},'formData':{'type':Sequelize['TEXT'](_0xf583('0x4')),'set':function(_0x593b92){if(_['isObjectLike'](_0x593b92)){this['setDataValue'](_0xf583('0x5'),JSON[_0xf583('0x6')](_0x593b92));}else if(_['isString'](_0x593b92)){this[_0xf583('0x7')](_0xf583('0x5'),_0x593b92);}else{this[_0xf583('0x7')](_0xf583('0x5'),util[_0xf583('0x8')](_0xf583('0x9'),this[_0xf583('0xa')](_0xf583('0x3'))||'',this[_0xf583('0xa')](_0xf583('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xf583('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xf583('0xc')],'defaultValue':![]}};
\ No newline at end of file
index 5b236e9..e950058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b5=['include','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','update','getSessions','findOne','JscriptySessionReport','rawAttributes','nolimit','sort','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','-createdAt','questionId','question','format','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Content-type','download','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','Projects','UserProfileResource','sendStatus','error','stack','send','index','map','JscriptyProject','type','key','name','query','intersection','model','attributes','fields','hasOwnProperty','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','length','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone'];(function(_0x1a87fe,_0x4b9e35){var _0x4ccbc0=function(_0x493476){while(--_0x493476){_0x1a87fe['push'](_0x1a87fe['shift']());}};_0x4ccbc0(++_0x4b9e35);}(_0x04b5,0x1ef));var _0x504b=function(_0x3f5f3f,_0x3ca78f){_0x3f5f3f=_0x3f5f3f-0x0;var _0x387d87=_0x04b5[_0x3f5f3f];return _0x387d87;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x504b('0x0'));var zipdir=require(_0x504b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x504b('0x2'));var moment=require(_0x504b('0x3'));var BPromise=require(_0x504b('0x4'));var Mustache=require(_0x504b('0x5'));var util=require('util');var path=require(_0x504b('0x6'));var sox=require(_0x504b('0x7'));var csv=require(_0x504b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x504b('0x9'));var _=require(_0x504b('0xa'));var squel=require(_0x504b('0xb'));var crypto=require(_0x504b('0xc'));var jsforce=require(_0x504b('0xd'));var deskjs=require(_0x504b('0xe'));var toCsv=require(_0x504b('0x8'));var querystring=require(_0x504b('0xf'));var Papa=require(_0x504b('0x10'));var Redis=require(_0x504b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x504b('0x12'));var as=require(_0x504b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x504b('0x14'));var utils=require(_0x504b('0x15'));var config=require(_0x504b('0x16'));var licenseUtil=require(_0x504b('0x17'));var db=require(_0x504b('0x18'))['db'];function respondWithStatusCode(_0x982762,_0xed922e){_0xed922e=_0xed922e||0xcc;return function(_0x17e3a8){if(_0x17e3a8){return _0x982762['sendStatus'](_0xed922e);}return _0x982762['status'](_0xed922e)[_0x504b('0x19')]();};}function respondWithResult(_0xcf295,_0x2feaea){_0x2feaea=_0x2feaea||0xc8;return function(_0x32df02){if(_0x32df02){return _0xcf295[_0x504b('0x1a')](_0x2feaea)[_0x504b('0x1b')](_0x32df02);}};}function respondWithFilteredResult(_0x4f2bb2,_0x537f6c){return function(_0x4db6a4){if(_0x4db6a4){var _0x224a76=typeof _0x537f6c[_0x504b('0x1c')]===_0x504b('0x1d')&&typeof _0x537f6c[_0x504b('0x1e')]===_0x504b('0x1d');var _0x57380f=_0x4db6a4[_0x504b('0x1f')];var _0x4a039f=_0x224a76?0x0:_0x537f6c['offset'];var _0x5e6e6b=_0x224a76?_0x4db6a4[_0x504b('0x1f')]:_0x537f6c[_0x504b('0x1c')]+_0x537f6c[_0x504b('0x1e')];var _0x1f28e5;if(_0x5e6e6b>=_0x57380f){_0x5e6e6b=_0x57380f;_0x1f28e5=0xc8;}else{_0x1f28e5=0xce;}_0x4f2bb2['status'](_0x1f28e5);return _0x4f2bb2[_0x504b('0x20')](_0x504b('0x21'),_0x4a039f+'-'+_0x5e6e6b+'/'+_0x57380f)[_0x504b('0x1b')](_0x4db6a4);}return null;};}function patchUpdates(_0x28616e){return function(_0x840a14){try{jsonpatch[_0x504b('0x22')](_0x840a14,_0x28616e,!![]);}catch(_0x1bf2b8){return BPromise['reject'](_0x1bf2b8);}return _0x840a14[_0x504b('0x23')]();};}function saveUpdates(_0x1821fd,_0x42b8cd){return function(_0x569c7b){if(_0x569c7b){return _0x569c7b['update'](_0x1821fd)[_0x504b('0x24')](function(_0x13413c){return _0x13413c;});}return null;};}function removeEntity(_0xc6fe0,_0x3fbfa0){return function(_0x16c032){if(_0x16c032){return _0x16c032[_0x504b('0x25')]()['then'](function(){var _0x2bba35=_0x16c032[_0x504b('0x26')]({'plain':!![]});var _0x3b574e=_0x504b('0x27');return db[_0x504b('0x28')][_0x504b('0x25')]({'where':{'type':_0x3b574e,'resourceId':_0x2bba35['id']}})[_0x504b('0x24')](function(){return _0x16c032;});})[_0x504b('0x24')](function(){_0xc6fe0['status'](0xcc)[_0x504b('0x19')]();});}};}function handleEntityNotFound(_0x5832f1,_0x4ffaa6){return function(_0x45319f){if(!_0x45319f){_0x5832f1[_0x504b('0x29')](0x194);}return _0x45319f;};}function handleError(_0x1f8544,_0x31b4c5){_0x31b4c5=_0x31b4c5||0x1f4;return function(_0x3495be){logger[_0x504b('0x2a')](_0x3495be[_0x504b('0x2b')]);if(_0x3495be['name']){delete _0x3495be['name'];}_0x1f8544[_0x504b('0x1a')](_0x31b4c5)[_0x504b('0x2c')](_0x3495be);};}exports[_0x504b('0x2d')]=function(_0x227af0,_0x1037fe){var _0x2272e4={},_0x5de9b0={},_0x10402b={'count':0x0,'rows':[]};var _0x411427=_[_0x504b('0x2e')](db[_0x504b('0x2f')]['rawAttributes'],function(_0x1163d6){return{'name':_0x1163d6['fieldName'],'type':_0x1163d6[_0x504b('0x30')][_0x504b('0x31')]};});_0x5de9b0['model']=_['map'](_0x411427,_0x504b('0x32'));_0x5de9b0[_0x504b('0x33')]=_['keys'](_0x227af0['query']);_0x5de9b0['filters']=_[_0x504b('0x34')](_0x5de9b0[_0x504b('0x35')],_0x5de9b0[_0x504b('0x33')]);_0x2272e4[_0x504b('0x36')]=_[_0x504b('0x34')](_0x5de9b0[_0x504b('0x35')],qs[_0x504b('0x37')](_0x227af0[_0x504b('0x33')][_0x504b('0x37')]));_0x2272e4[_0x504b('0x36')]=_0x2272e4[_0x504b('0x36')]['length']?_0x2272e4[_0x504b('0x36')]:_0x5de9b0[_0x504b('0x35')];if(!_0x227af0[_0x504b('0x33')][_0x504b('0x38')]('nolimit')){_0x2272e4[_0x504b('0x1e')]=qs[_0x504b('0x1e')](_0x227af0[_0x504b('0x33')][_0x504b('0x1e')]);_0x2272e4[_0x504b('0x1c')]=qs[_0x504b('0x1c')](_0x227af0['query'][_0x504b('0x1c')]);}_0x2272e4['order']=qs['sort'](_0x227af0[_0x504b('0x33')]['sort']);_0x2272e4[_0x504b('0x39')]=qs[_0x504b('0x3a')](_[_0x504b('0x3b')](_0x227af0[_0x504b('0x33')],_0x5de9b0[_0x504b('0x3a')]),_0x411427);if(_0x227af0[_0x504b('0x33')][_0x504b('0x3c')]){_0x2272e4[_0x504b('0x39')]=_[_0x504b('0x3d')](_0x2272e4['where'],{'$or':_[_0x504b('0x2e')](_0x411427,function(_0x36d589){if(_0x36d589[_0x504b('0x30')]!==_0x504b('0x3e')){var _0x4fe5b2={};_0x4fe5b2[_0x36d589[_0x504b('0x32')]]={'$like':'%'+_0x227af0[_0x504b('0x33')][_0x504b('0x3c')]+'%'};return _0x4fe5b2;}})});}_0x2272e4=_[_0x504b('0x3d')]({},_0x2272e4,_0x227af0[_0x504b('0x3f')]);var _0x5b7a4e={'where':_0x2272e4[_0x504b('0x39')]};return db[_0x504b('0x2f')][_0x504b('0x1f')](_0x5b7a4e)[_0x504b('0x24')](function(_0xf5e637){_0x10402b['count']=_0xf5e637;if(_0x227af0[_0x504b('0x33')][_0x504b('0x40')]){_0x2272e4['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x504b('0x41')](_0x2272e4);})[_0x504b('0x24')](function(_0x574cf9){_0x10402b[_0x504b('0x42')]=_0x574cf9;return _0x10402b;})[_0x504b('0x24')](respondWithFilteredResult(_0x1037fe,_0x2272e4))[_0x504b('0x43')](handleError(_0x1037fe,null));};exports[_0x504b('0x44')]=function(_0x33102b,_0x1173a1){var _0x105ab8={'raw':![],'where':{'id':_0x33102b[_0x504b('0x45')]['id']}},_0x46dd2b={};_0x46dd2b[_0x504b('0x35')]=_[_0x504b('0x46')](db[_0x504b('0x2f')]['rawAttributes']);_0x46dd2b[_0x504b('0x33')]=_['keys'](_0x33102b[_0x504b('0x33')]);_0x46dd2b['filters']=_[_0x504b('0x34')](_0x46dd2b[_0x504b('0x35')],_0x46dd2b[_0x504b('0x33')]);_0x105ab8[_0x504b('0x36')]=_[_0x504b('0x34')](_0x46dd2b['model'],qs[_0x504b('0x37')](_0x33102b[_0x504b('0x33')]['fields']));_0x105ab8['attributes']=_0x105ab8[_0x504b('0x36')][_0x504b('0x47')]?_0x105ab8['attributes']:_0x46dd2b[_0x504b('0x35')];if(_0x33102b['query'][_0x504b('0x40')]){_0x105ab8['include']=[{'all':!![]}];}_0x105ab8=_['merge']({},_0x105ab8,_0x33102b[_0x504b('0x3f')]);return db[_0x504b('0x2f')][_0x504b('0x48')](_0x105ab8)['then'](handleEntityNotFound(_0x1173a1,null))['then'](respondWithResult(_0x1173a1,null))[_0x504b('0x43')](handleError(_0x1173a1,null));};exports[_0x504b('0x49')]=function(_0xf17b02,_0xead4ab){return db[_0x504b('0x2f')][_0x504b('0x49')](_0xf17b02[_0x504b('0x4a')],{})[_0x504b('0x24')](function(_0x5b88e9){var _0x149782=_0xf17b02[_0x504b('0x4b')][_0x504b('0x26')]({'plain':!![]});if(!_0x149782)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x149782['role']===_0x504b('0x4b')){var _0x11fb4d=_0x5b88e9[_0x504b('0x26')]({'plain':!![]});var _0x4f11c1=_0x504b('0x27');return db[_0x504b('0x4c')]['find']({'where':{'name':_0x4f11c1,'userProfileId':_0x149782['userProfileId']},'raw':!![]})['then'](function(_0x5dcac9){if(_0x5dcac9&&_0x5dcac9[_0x504b('0x4d')]===0x0){return db['UserProfileResource'][_0x504b('0x49')]({'name':_0x11fb4d[_0x504b('0x32')],'resourceId':_0x11fb4d['id'],'type':_0x5dcac9['name'],'sectionId':_0x5dcac9['id']},{})[_0x504b('0x24')](function(){return _0x5b88e9;});}else{return _0x5b88e9;}})[_0x504b('0x43')](function(_0x4ea3ad){logger[_0x504b('0x2a')](_0x504b('0x4e'),_0x4ea3ad);throw _0x4ea3ad;});}return _0x5b88e9;})[_0x504b('0x24')](respondWithResult(_0xead4ab,0xc9))[_0x504b('0x43')](handleError(_0xead4ab,null));};exports[_0x504b('0x4f')]=function(_0x3f657c,_0x4bf610){var _0x55a450={'where':{'id':_0x3f657c[_0x504b('0x45')]['id']}},_0x42e8e8={};_0x42e8e8[_0x504b('0x35')]=_[_0x504b('0x46')](db[_0x504b('0x2f')]['rawAttributes']);_0x55a450[_0x504b('0x36')]=_[_0x504b('0x34')](_0x42e8e8[_0x504b('0x35')],qs[_0x504b('0x37')](_0x3f657c[_0x504b('0x33')][_0x504b('0x37')]));_0x55a450[_0x504b('0x36')]=_0x55a450[_0x504b('0x36')][_0x504b('0x47')]?_0x55a450[_0x504b('0x36')]:_0x42e8e8[_0x504b('0x35')];if(_0x3f657c[_0x504b('0x33')][_0x504b('0x40')]){_0x55a450[_0x504b('0x50')]=[{'all':!![]}];}_0x55a450=_[_0x504b('0x3d')]({},_0x55a450,_0x3f657c['options']);return db[_0x504b('0x2f')][_0x504b('0x48')](_0x55a450)[_0x504b('0x24')](handleEntityNotFound(_0x4bf610,null))['then'](function(_0x161063){if(_0x161063){var _0x4627c8=_0x161063['get']({'plain':!![]});_0x4627c8=qs['omit'](_0x4627c8,['id',_0x504b('0x51'),_0x504b('0x52')]);_0x3f657c['body']=_[_0x504b('0x53')](_0x3f657c[_0x504b('0x4a')],['id',_0x504b('0x51'),_0x504b('0x52')]);return db[_0x504b('0x2f')][_0x504b('0x49')](_[_0x504b('0x3d')](_0x4627c8,_0x3f657c[_0x504b('0x4a')]),{'include':_0x3f657c[_0x504b('0x33')][_0x504b('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x2b0cb5){var _0x4474fe=_0x3f657c[_0x504b('0x4b')][_0x504b('0x26')]({'plain':!![]});if(!_0x4474fe)throw new Error(_0x504b('0x54'));if(_0x4474fe[_0x504b('0x55')]==='user'){var _0x1fd4ab=_0x2b0cb5[_0x504b('0x26')]({'plain':!![]});var _0x182b56=_0x504b('0x27');return db[_0x504b('0x4c')][_0x504b('0x48')]({'where':{'name':_0x182b56,'userProfileId':_0x4474fe[_0x504b('0x56')]},'raw':!![]})['then'](function(_0x3769fb){if(_0x3769fb&&_0x3769fb[_0x504b('0x4d')]===0x0){return db['UserProfileResource'][_0x504b('0x49')]({'name':_0x1fd4ab[_0x504b('0x32')],'resourceId':_0x1fd4ab['id'],'type':_0x3769fb[_0x504b('0x32')],'sectionId':_0x3769fb['id']},{})[_0x504b('0x24')](function(){return _0x2b0cb5;});}else{return _0x2b0cb5;}})[_0x504b('0x43')](function(_0x22392a){logger[_0x504b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22392a);throw _0x22392a;});}return _0x2b0cb5;});}})['then'](respondWithResult(_0x4bf610,0xc9))['catch'](handleError(_0x4bf610,null));};exports[_0x504b('0x57')]=function(_0x3a5b60,_0x42c3b0){if(_0x3a5b60[_0x504b('0x4a')]['id']){delete _0x3a5b60['body']['id'];}return db[_0x504b('0x2f')]['find']({'where':{'id':_0x3a5b60['params']['id']}})[_0x504b('0x24')](handleEntityNotFound(_0x42c3b0,null))['then'](saveUpdates(_0x3a5b60['body'],null))['then'](respondWithResult(_0x42c3b0,null))[_0x504b('0x43')](handleError(_0x42c3b0,null));};exports[_0x504b('0x25')]=function(_0x1b2ea5,_0x236ad4){return db[_0x504b('0x2f')][_0x504b('0x48')]({'where':{'id':_0x1b2ea5[_0x504b('0x45')]['id']}})[_0x504b('0x24')](handleEntityNotFound(_0x236ad4,null))[_0x504b('0x24')](removeEntity(_0x236ad4,null))['catch'](handleError(_0x236ad4,null));};exports[_0x504b('0x58')]=function(_0x23fcf8,_0x3e01c9,_0x197ab9){var _0x3d3b93={'raw':!![],'where':{}};var _0x5023a0={};var _0x59bf95={'count':0x0,'rows':[]};return db[_0x504b('0x2f')][_0x504b('0x59')]({'where':{'id':_0x23fcf8['params']['id']}})[_0x504b('0x24')](handleEntityNotFound(_0x3e01c9,null))[_0x504b('0x24')](function(_0x162756){if(_0x162756){_0x5023a0['model']=_[_0x504b('0x46')](db[_0x504b('0x5a')][_0x504b('0x5b')]);_0x5023a0[_0x504b('0x33')]=_[_0x504b('0x46')](_0x23fcf8[_0x504b('0x33')]);_0x5023a0[_0x504b('0x3a')]=_['intersection'](_0x5023a0[_0x504b('0x35')],_0x5023a0['query']);_0x3d3b93[_0x504b('0x36')]=_[_0x504b('0x34')](_0x5023a0[_0x504b('0x35')],qs[_0x504b('0x37')](_0x23fcf8['query'][_0x504b('0x37')]));_0x3d3b93[_0x504b('0x36')]=_0x3d3b93[_0x504b('0x36')][_0x504b('0x47')]?_0x3d3b93[_0x504b('0x36')]:_0x5023a0[_0x504b('0x35')];if(!_0x23fcf8[_0x504b('0x33')][_0x504b('0x38')](_0x504b('0x5c'))){_0x3d3b93['limit']=qs[_0x504b('0x1e')](_0x23fcf8[_0x504b('0x33')]['limit']);_0x3d3b93[_0x504b('0x1c')]=qs[_0x504b('0x1c')](_0x23fcf8[_0x504b('0x33')][_0x504b('0x1c')]);}_0x3d3b93['order']=qs[_0x504b('0x5d')](_0x23fcf8[_0x504b('0x33')][_0x504b('0x5d')]);_0x3d3b93[_0x504b('0x39')]=qs[_0x504b('0x3a')](_[_0x504b('0x3b')](_0x23fcf8['query'],_0x5023a0[_0x504b('0x3a')]));_0x3d3b93[_0x504b('0x39')][_0x504b('0x5e')]=_0x162756['id'];if(_0x23fcf8[_0x504b('0x33')][_0x504b('0x3c')]){_0x3d3b93[_0x504b('0x39')]=_[_0x504b('0x3d')](_0x3d3b93[_0x504b('0x39')],{'$or':_[_0x504b('0x2e')](_0x3d3b93[_0x504b('0x36')],function(_0x44a39f){var _0x1f0272={};_0x1f0272[_0x44a39f]={'$like':'%'+_0x23fcf8['query'][_0x504b('0x3c')]+'%'};return _0x1f0272;})});}_0x3d3b93=_[_0x504b('0x3d')]({},_0x3d3b93,_0x23fcf8[_0x504b('0x3f')]);return db['JscriptySessionReport'][_0x504b('0x1f')]({'where':_0x3d3b93['where']})[_0x504b('0x24')](function(_0x2c7c26){_0x59bf95[_0x504b('0x1f')]=_0x2c7c26;if(_0x23fcf8['query'][_0x504b('0x40')]){_0x3d3b93['include']=[{'all':!![]}];}return db[_0x504b('0x5a')]['findAll'](_0x3d3b93);})['then'](function(_0x4ba394){_0x59bf95[_0x504b('0x42')]=_0x4ba394;return _0x59bf95;});}})[_0x504b('0x24')](respondWithFilteredResult(_0x3e01c9,_0x3d3b93))[_0x504b('0x43')](handleError(_0x3e01c9,null));};exports[_0x504b('0x5f')]=function(_0x56a043,_0x560778,_0x4b28d0){var _0x438fa4={'raw':!![],'where':{}};var _0x4ec275={};var _0x400f7c={'count':0x0,'rows':[]};return db[_0x504b('0x2f')][_0x504b('0x59')]({'where':{'id':_0x56a043[_0x504b('0x45')]['id']}})[_0x504b('0x24')](handleEntityNotFound(_0x560778,null))['then'](function(_0x3c65b1){if(_0x3c65b1){_0x4ec275['model']=_[_0x504b('0x46')](db[_0x504b('0x60')][_0x504b('0x5b')]);_0x4ec275[_0x504b('0x33')]=_[_0x504b('0x46')](_0x56a043[_0x504b('0x33')]);_0x4ec275[_0x504b('0x3a')]=_[_0x504b('0x34')](_0x4ec275[_0x504b('0x35')],_0x4ec275['query']);_0x438fa4[_0x504b('0x36')]=_[_0x504b('0x34')](_0x4ec275[_0x504b('0x35')],qs[_0x504b('0x37')](_0x56a043[_0x504b('0x33')][_0x504b('0x37')]));_0x438fa4[_0x504b('0x36')]=_0x438fa4[_0x504b('0x36')][_0x504b('0x47')]?_0x438fa4[_0x504b('0x36')]:_0x4ec275['model'];if(!_0x56a043[_0x504b('0x33')][_0x504b('0x38')](_0x504b('0x5c'))){_0x438fa4[_0x504b('0x1e')]=qs[_0x504b('0x1e')](_0x56a043[_0x504b('0x33')][_0x504b('0x1e')]);_0x438fa4[_0x504b('0x1c')]=qs[_0x504b('0x1c')](_0x56a043[_0x504b('0x33')][_0x504b('0x1c')]);}_0x438fa4['order']=qs[_0x504b('0x5d')](_0x56a043[_0x504b('0x33')][_0x504b('0x5d')]);_0x438fa4[_0x504b('0x39')]=qs[_0x504b('0x3a')](_[_0x504b('0x3b')](_0x56a043[_0x504b('0x33')],_0x4ec275[_0x504b('0x3a')]));_0x438fa4[_0x504b('0x39')]['ProjectId']=_0x3c65b1['id'];if(_0x56a043[_0x504b('0x33')]['filter']){_0x438fa4[_0x504b('0x39')]=_[_0x504b('0x3d')](_0x438fa4[_0x504b('0x39')],{'$or':_[_0x504b('0x2e')](_0x438fa4[_0x504b('0x36')],function(_0x37ebe9){var _0x53940d={};_0x53940d[_0x37ebe9]={'$like':'%'+_0x56a043[_0x504b('0x33')][_0x504b('0x3c')]+'%'};return _0x53940d;})});}_0x438fa4=_[_0x504b('0x3d')]({},_0x438fa4,_0x56a043[_0x504b('0x3f')]);return db[_0x504b('0x60')][_0x504b('0x1f')]({'where':_0x438fa4[_0x504b('0x39')]})[_0x504b('0x24')](function(_0x1bb84b){_0x400f7c[_0x504b('0x1f')]=_0x1bb84b;if(_0x56a043[_0x504b('0x33')][_0x504b('0x40')]){_0x438fa4[_0x504b('0x50')]=[{'all':!![]}];}return db[_0x504b('0x60')][_0x504b('0x41')](_0x438fa4);})[_0x504b('0x24')](function(_0x41a0fa){_0x400f7c[_0x504b('0x42')]=_0x41a0fa;return _0x400f7c;});}})[_0x504b('0x24')](respondWithFilteredResult(_0x560778,_0x438fa4))[_0x504b('0x43')](handleError(_0x560778,null));};function char(_0x37f7c1){return _0x504b('0x61')===typeof _0x37f7c1?String['fromCharCode'][_0x504b('0x22')](null,arguments):_0x37f7c1;}function needsEncapsulation(_0x53939b){return!!_0x53939b&&(_0x53939b[_0x504b('0x62')]()['indexOf'](char(0xd))>=0x0||_0x53939b[_0x504b('0x62')]()[_0x504b('0x63')](char(0xa))>=0x0||_0x53939b[_0x504b('0x62')]()[_0x504b('0x63')](char(0x2c))>=0x0||_0x53939b[_0x504b('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x3750ef){var _0x1eec67=char(0x22),_0x3b85ad='\x5c'+char(0x22),_0x503777=_0x3750ef['toString']()[_0x504b('0x64')](new RegExp(_0x1eec67,'g'),_0x3b85ad);return _0x1eec67+_0x503777+_0x1eec67;}exports[_0x504b('0x65')]=function(_0x5a294e,_0x5a235f,_0x18caa3){var _0x31d257,_0x5d51ef;var _0x30a6a9={'where':{'ProjectId':_0x5a294e[_0x504b('0x45')]['id']}};if(_0x5a294e['query'][_0x504b('0x66')]){_0x30a6a9[_0x504b('0x39')]['starttime']=JSON['parse'](_0x5a294e[_0x504b('0x33')][_0x504b('0x66')]);}return db[_0x504b('0x5a')][_0x504b('0x41')](_0x30a6a9)['then'](handleEntityNotFound(_0x5a235f,null))['then'](function(_0x339c05){if(_0x339c05){_0x31d257=_0x339c05;return db['JscriptyQuestionReport'][_0x504b('0x41')]({'where':{'SessionId':{'$in':_['map'](_0x31d257,'id')},'ProjectId':_0x5a294e[_0x504b('0x45')]['id']},'order':_0x504b('0x67')});}})[_0x504b('0x24')](handleEntityNotFound(_0x5a235f,null))[_0x504b('0x24')](function(_0x4b8941){if(_0x4b8941){_0x5d51ef=_0x4b8941;var _0x136df3={};for(var _0x3c5d98=0x0,_0x4cd383=_0x5d51ef[_0x504b('0x47')];_0x3c5d98<_0x4cd383;_0x3c5d98++){if(!_0x136df3['hasOwnProperty'](_0x5d51ef[_0x3c5d98][_0x504b('0x68')])){_0x136df3[_0x5d51ef[_0x3c5d98][_0x504b('0x68')]]=needsEncapsulation(_0x5d51ef[_0x3c5d98]['question'])?encapsulate(_0x5d51ef[_0x3c5d98][_0x504b('0x69')]):_0x5d51ef[_0x3c5d98]['question'];}}var _0x3bb719=[],_0xc31353={};for(var _0x5b1fc7=0x0,_0x306427=_0x31d257[_0x504b('0x47')];_0x5b1fc7<_0x306427;_0x5b1fc7++){_0xc31353={'ProjectId':_0x5a294e[_0x504b('0x45')]['id'],'SessionId':_0x31d257[_0x5b1fc7]['id'],'StartTime':moment(_0x31d257[_0x5b1fc7]['starttime'])[_0x504b('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2840fe=0x0,_0x380c02=_0x5d51ef['length'];_0x2840fe<_0x380c02;_0x2840fe++){if(_0x5d51ef[_0x2840fe]['SessionId']==_0x31d257[_0x5b1fc7]['id']&&_0x136df3[_0x504b('0x38')](_0x5d51ef[_0x2840fe][_0x504b('0x68')])){_0xc31353[_0x136df3[_0x5d51ef[_0x2840fe][_0x504b('0x68')]]]=_0x5d51ef[_0x2840fe]['answer'];}}for(var _0x16929d in _0x136df3){if(!_0xc31353[_0x504b('0x38')](_0x136df3[_0x16929d])){_0xc31353[_0x136df3[_0x16929d]]=null;}}_0x3bb719[_0x504b('0x6b')](_0xc31353);}return _0x3bb719;}})['then'](function(_0x1f260a){if(!_['isEmpty'](_0x1f260a)){var _0x2a547b=toCsv(_0x1f260a);var _0x2aa781=Date[_0x504b('0x6c')]();fs[_0x504b('0x6d')](util[_0x504b('0x6a')](_0x504b('0x6e'),_0x5a294e[_0x504b('0x45')]['id'],_0x2aa781),_0x2a547b);_0x5a235f[_0x504b('0x6f')](_0x504b('0x70'),'attachment;\x20filename='+util[_0x504b('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x5a294e[_0x504b('0x45')]['id'],_0x2aa781));_0x5a235f[_0x504b('0x6f')](_0x504b('0x71'),'text/csv');return _0x5a235f[_0x504b('0x72')](util[_0x504b('0x6a')](_0x504b('0x6e'),_0x5a294e[_0x504b('0x45')]['id'],_0x2aa781));}else{return _0x5a235f['sendStatus'](0xcc);}})[_0x504b('0x43')](handleError(_0x5a235f,null));};
\ No newline at end of file
+var _0x826c=['apply','reject','save','update','then','destroy','get','Projects','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','getSessions','JscriptySessionReport','sort','filter','getAnswers','findOne','JscriptyAnswerReport','number','indexOf','toString','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x826c,0xc8));var _0xc826=function(_0x550e2c,_0x534cb6){_0x550e2c=_0x550e2c-0x0;var _0x26ee83=_0x826c[_0x550e2c];return _0x26ee83;};'use strict';var emlformat=require(_0xc826('0x0'));var rimraf=require(_0xc826('0x1'));var zipdir=require(_0xc826('0x2'));var jsonpatch=require(_0xc826('0x3'));var rp=require(_0xc826('0x4'));var moment=require(_0xc826('0x5'));var BPromise=require(_0xc826('0x6'));var Mustache=require(_0xc826('0x7'));var util=require(_0xc826('0x8'));var path=require(_0xc826('0x9'));var sox=require('sox');var csv=require(_0xc826('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc826('0xb'));var _=require('lodash');var squel=require(_0xc826('0xc'));var crypto=require(_0xc826('0xd'));var jsforce=require(_0xc826('0xe'));var deskjs=require(_0xc826('0xf'));var toCsv=require(_0xc826('0xa'));var querystring=require(_0xc826('0x10'));var Papa=require('papaparse');var Redis=require(_0xc826('0x11'));var authService=require(_0xc826('0x12'));var qs=require(_0xc826('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc826('0x14'));var logger=require('../../config/logger')(_0xc826('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc826('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x102130,_0x3b02bd){_0x3b02bd=_0x3b02bd||0xcc;return function(_0x2203d2){if(_0x2203d2){return _0x102130[_0xc826('0x17')](_0x3b02bd);}return _0x102130['status'](_0x3b02bd)[_0xc826('0x18')]();};}function respondWithResult(_0x56a7a0,_0x2b7997){_0x2b7997=_0x2b7997||0xc8;return function(_0x441030){if(_0x441030){return _0x56a7a0[_0xc826('0x19')](_0x2b7997)[_0xc826('0x1a')](_0x441030);}};}function respondWithFilteredResult(_0x12e29c,_0x3cd94c){return function(_0x3e1bd1){if(_0x3e1bd1){var _0x475ac3=typeof _0x3cd94c['offset']===_0xc826('0x1b')&&typeof _0x3cd94c[_0xc826('0x1c')]==='undefined';var _0x46819d=_0x3e1bd1[_0xc826('0x1d')];var _0x2c0d46=_0x475ac3?0x0:_0x3cd94c[_0xc826('0x1e')];var _0x1b474f=_0x475ac3?_0x3e1bd1[_0xc826('0x1d')]:_0x3cd94c[_0xc826('0x1e')]+_0x3cd94c['limit'];var _0x1949bf;if(_0x1b474f>=_0x46819d){_0x1b474f=_0x46819d;_0x1949bf=0xc8;}else{_0x1949bf=0xce;}_0x12e29c[_0xc826('0x19')](_0x1949bf);return _0x12e29c[_0xc826('0x1f')]('Content-Range',_0x2c0d46+'-'+_0x1b474f+'/'+_0x46819d)['json'](_0x3e1bd1);}return null;};}function patchUpdates(_0x559911){return function(_0x12b78b){try{jsonpatch[_0xc826('0x20')](_0x12b78b,_0x559911,!![]);}catch(_0x2423f5){return BPromise[_0xc826('0x21')](_0x2423f5);}return _0x12b78b[_0xc826('0x22')]();};}function saveUpdates(_0x50cca6,_0x475b2e){return function(_0x21b278){if(_0x21b278){return _0x21b278[_0xc826('0x23')](_0x50cca6)[_0xc826('0x24')](function(_0x428e5f){return _0x428e5f;});}return null;};}function removeEntity(_0x146a7e,_0x3cd7d6){return function(_0x370b34){if(_0x370b34){return _0x370b34[_0xc826('0x25')]()['then'](function(){var _0x175a41=_0x370b34[_0xc826('0x26')]({'plain':!![]});var _0x5e8b8f=_0xc826('0x27');return db['UserProfileResource'][_0xc826('0x25')]({'where':{'type':_0x5e8b8f,'resourceId':_0x175a41['id']}})[_0xc826('0x24')](function(){return _0x370b34;});})[_0xc826('0x24')](function(){_0x146a7e[_0xc826('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ce8de,_0xa6cb39){return function(_0xcdebd5){if(!_0xcdebd5){_0x5ce8de['sendStatus'](0x194);}return _0xcdebd5;};}function handleError(_0x237230,_0xee7c58){_0xee7c58=_0xee7c58||0x1f4;return function(_0x598b18){logger[_0xc826('0x28')](_0x598b18[_0xc826('0x29')]);if(_0x598b18[_0xc826('0x2a')]){delete _0x598b18[_0xc826('0x2a')];}_0x237230[_0xc826('0x19')](_0xee7c58)['send'](_0x598b18);};}exports[_0xc826('0x2b')]=function(_0x393ecd,_0x35f48e){var _0x36957d={},_0x85b4fe={},_0x497952={'count':0x0,'rows':[]};var _0x5d638c=_[_0xc826('0x2c')](db[_0xc826('0x2d')][_0xc826('0x2e')],function(_0x42ff66){return{'name':_0x42ff66[_0xc826('0x2f')],'type':_0x42ff66[_0xc826('0x30')][_0xc826('0x31')]};});_0x85b4fe[_0xc826('0x32')]=_['map'](_0x5d638c,'name');_0x85b4fe[_0xc826('0x33')]=_['keys'](_0x393ecd[_0xc826('0x33')]);_0x85b4fe['filters']=_[_0xc826('0x34')](_0x85b4fe['model'],_0x85b4fe[_0xc826('0x33')]);_0x36957d[_0xc826('0x35')]=_[_0xc826('0x34')](_0x85b4fe[_0xc826('0x32')],qs[_0xc826('0x36')](_0x393ecd['query'][_0xc826('0x36')]));_0x36957d['attributes']=_0x36957d[_0xc826('0x35')][_0xc826('0x37')]?_0x36957d[_0xc826('0x35')]:_0x85b4fe[_0xc826('0x32')];if(!_0x393ecd[_0xc826('0x33')][_0xc826('0x38')](_0xc826('0x39'))){_0x36957d['limit']=qs[_0xc826('0x1c')](_0x393ecd[_0xc826('0x33')][_0xc826('0x1c')]);_0x36957d[_0xc826('0x1e')]=qs[_0xc826('0x1e')](_0x393ecd[_0xc826('0x33')]['offset']);}_0x36957d[_0xc826('0x3a')]=qs['sort'](_0x393ecd['query']['sort']);_0x36957d[_0xc826('0x3b')]=qs[_0xc826('0x3c')](_[_0xc826('0x3d')](_0x393ecd[_0xc826('0x33')],_0x85b4fe[_0xc826('0x3c')]),_0x5d638c);if(_0x393ecd[_0xc826('0x33')]['filter']){_0x36957d['where']=_[_0xc826('0x3e')](_0x36957d[_0xc826('0x3b')],{'$or':_[_0xc826('0x2c')](_0x5d638c,function(_0x1b03fb){if(_0x1b03fb[_0xc826('0x30')]!==_0xc826('0x3f')){var _0xaccdbb={};_0xaccdbb[_0x1b03fb[_0xc826('0x2a')]]={'$like':'%'+_0x393ecd[_0xc826('0x33')]['filter']+'%'};return _0xaccdbb;}})});}_0x36957d=_[_0xc826('0x3e')]({},_0x36957d,_0x393ecd[_0xc826('0x40')]);var _0x555559={'where':_0x36957d['where']};return db[_0xc826('0x2d')][_0xc826('0x1d')](_0x555559)[_0xc826('0x24')](function(_0x9c1728){_0x497952[_0xc826('0x1d')]=_0x9c1728;if(_0x393ecd['query'][_0xc826('0x41')]){_0x36957d[_0xc826('0x42')]=[{'all':!![]}];}return db[_0xc826('0x2d')][_0xc826('0x43')](_0x36957d);})[_0xc826('0x24')](function(_0xf52051){_0x497952[_0xc826('0x44')]=_0xf52051;return _0x497952;})[_0xc826('0x24')](respondWithFilteredResult(_0x35f48e,_0x36957d))['catch'](handleError(_0x35f48e,null));};exports[_0xc826('0x45')]=function(_0x119036,_0x110b04){var _0x3db43c={'raw':![],'where':{'id':_0x119036[_0xc826('0x46')]['id']}},_0x4be1ba={};_0x4be1ba[_0xc826('0x32')]=_[_0xc826('0x47')](db['JscriptyProject'][_0xc826('0x2e')]);_0x4be1ba[_0xc826('0x33')]=_[_0xc826('0x47')](_0x119036[_0xc826('0x33')]);_0x4be1ba[_0xc826('0x3c')]=_[_0xc826('0x34')](_0x4be1ba[_0xc826('0x32')],_0x4be1ba['query']);_0x3db43c[_0xc826('0x35')]=_[_0xc826('0x34')](_0x4be1ba[_0xc826('0x32')],qs['fields'](_0x119036[_0xc826('0x33')][_0xc826('0x36')]));_0x3db43c[_0xc826('0x35')]=_0x3db43c[_0xc826('0x35')][_0xc826('0x37')]?_0x3db43c[_0xc826('0x35')]:_0x4be1ba['model'];if(_0x119036[_0xc826('0x33')]['includeAll']){_0x3db43c[_0xc826('0x42')]=[{'all':!![]}];}_0x3db43c=_[_0xc826('0x3e')]({},_0x3db43c,_0x119036[_0xc826('0x40')]);return db[_0xc826('0x2d')]['find'](_0x3db43c)['then'](handleEntityNotFound(_0x110b04,null))['then'](respondWithResult(_0x110b04,null))[_0xc826('0x48')](handleError(_0x110b04,null));};exports[_0xc826('0x49')]=function(_0x54e06d,_0x5285c5){return db[_0xc826('0x2d')][_0xc826('0x49')](_0x54e06d['body'],{})[_0xc826('0x24')](function(_0x233c7f){var _0x250d37=_0x54e06d['user']['get']({'plain':!![]});if(!_0x250d37)throw new Error(_0xc826('0x4a'));if(_0x250d37['role']===_0xc826('0x4b')){var _0x43ae4e=_0x233c7f[_0xc826('0x26')]({'plain':!![]});var _0x19a69b=_0xc826('0x27');return db[_0xc826('0x4c')][_0xc826('0x4d')]({'where':{'name':_0x19a69b,'userProfileId':_0x250d37[_0xc826('0x4e')]},'raw':!![]})['then'](function(_0x34ec9a){if(_0x34ec9a&&_0x34ec9a[_0xc826('0x4f')]===0x0){return db[_0xc826('0x50')]['create']({'name':_0x43ae4e[_0xc826('0x2a')],'resourceId':_0x43ae4e['id'],'type':_0x34ec9a[_0xc826('0x2a')],'sectionId':_0x34ec9a['id']},{})[_0xc826('0x24')](function(){return _0x233c7f;});}else{return _0x233c7f;}})['catch'](function(_0xe84903){logger['error'](_0xc826('0x51'),_0xe84903);throw _0xe84903;});}return _0x233c7f;})['then'](respondWithResult(_0x5285c5,0xc9))['catch'](handleError(_0x5285c5,null));};exports[_0xc826('0x52')]=function(_0x37b03c,_0x57984d){var _0x43ccd7={'where':{'id':_0x37b03c[_0xc826('0x46')]['id']}},_0x41687a={};_0x41687a[_0xc826('0x32')]=_[_0xc826('0x47')](db[_0xc826('0x2d')][_0xc826('0x2e')]);_0x43ccd7['attributes']=_['intersection'](_0x41687a[_0xc826('0x32')],qs[_0xc826('0x36')](_0x37b03c[_0xc826('0x33')][_0xc826('0x36')]));_0x43ccd7[_0xc826('0x35')]=_0x43ccd7[_0xc826('0x35')][_0xc826('0x37')]?_0x43ccd7[_0xc826('0x35')]:_0x41687a[_0xc826('0x32')];if(_0x37b03c[_0xc826('0x33')]['includeAll']){_0x43ccd7[_0xc826('0x42')]=[{'all':!![]}];}_0x43ccd7=_[_0xc826('0x3e')]({},_0x43ccd7,_0x37b03c[_0xc826('0x40')]);return db[_0xc826('0x2d')][_0xc826('0x4d')](_0x43ccd7)[_0xc826('0x24')](handleEntityNotFound(_0x57984d,null))[_0xc826('0x24')](function(_0x548097){if(_0x548097){var _0x31fbcf=_0x548097[_0xc826('0x26')]({'plain':!![]});_0x31fbcf=qs[_0xc826('0x53')](_0x31fbcf,['id','createdAt',_0xc826('0x54')]);_0x37b03c[_0xc826('0x55')]=_[_0xc826('0x53')](_0x37b03c[_0xc826('0x55')],['id',_0xc826('0x56'),'updatedAt']);return db[_0xc826('0x2d')][_0xc826('0x49')](_[_0xc826('0x3e')](_0x31fbcf,_0x37b03c['body']),{'include':_0x37b03c[_0xc826('0x33')][_0xc826('0x41')]?[{'all':!![]}]:undefined})[_0xc826('0x24')](function(_0x50affc){var _0x57a686=_0x37b03c['user']['get']({'plain':!![]});if(!_0x57a686)throw new Error(_0xc826('0x4a'));if(_0x57a686['role']===_0xc826('0x4b')){var _0x4efb42=_0x50affc['get']({'plain':!![]});var _0x57a6fa=_0xc826('0x27');return db[_0xc826('0x4c')][_0xc826('0x4d')]({'where':{'name':_0x57a6fa,'userProfileId':_0x57a686[_0xc826('0x4e')]},'raw':!![]})[_0xc826('0x24')](function(_0x3dd627){if(_0x3dd627&&_0x3dd627[_0xc826('0x4f')]===0x0){return db[_0xc826('0x50')][_0xc826('0x49')]({'name':_0x4efb42[_0xc826('0x2a')],'resourceId':_0x4efb42['id'],'type':_0x3dd627[_0xc826('0x2a')],'sectionId':_0x3dd627['id']},{})[_0xc826('0x24')](function(){return _0x50affc;});}else{return _0x50affc;}})[_0xc826('0x48')](function(_0x5b71d1){logger[_0xc826('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b71d1);throw _0x5b71d1;});}return _0x50affc;});}})[_0xc826('0x24')](respondWithResult(_0x57984d,0xc9))['catch'](handleError(_0x57984d,null));};exports[_0xc826('0x23')]=function(_0x44e5cd,_0x527ee9){if(_0x44e5cd[_0xc826('0x55')]['id']){delete _0x44e5cd[_0xc826('0x55')]['id'];}return db['JscriptyProject'][_0xc826('0x4d')]({'where':{'id':_0x44e5cd['params']['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x527ee9,null))['then'](saveUpdates(_0x44e5cd[_0xc826('0x55')],null))['then'](respondWithResult(_0x527ee9,null))[_0xc826('0x48')](handleError(_0x527ee9,null));};exports[_0xc826('0x25')]=function(_0x410099,_0x278260){return db['JscriptyProject'][_0xc826('0x4d')]({'where':{'id':_0x410099[_0xc826('0x46')]['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x278260,null))['then'](removeEntity(_0x278260,null))['catch'](handleError(_0x278260,null));};exports[_0xc826('0x57')]=function(_0x36cc8d,_0x23d226,_0x42f1c4){var _0x32a102={'raw':!![],'where':{}};var _0x416d17={};var _0x1d5009={'count':0x0,'rows':[]};return db[_0xc826('0x2d')]['findOne']({'where':{'id':_0x36cc8d[_0xc826('0x46')]['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x23d226,null))[_0xc826('0x24')](function(_0x212551){if(_0x212551){_0x416d17['model']=_[_0xc826('0x47')](db[_0xc826('0x58')]['rawAttributes']);_0x416d17[_0xc826('0x33')]=_['keys'](_0x36cc8d['query']);_0x416d17[_0xc826('0x3c')]=_['intersection'](_0x416d17[_0xc826('0x32')],_0x416d17[_0xc826('0x33')]);_0x32a102['attributes']=_['intersection'](_0x416d17[_0xc826('0x32')],qs[_0xc826('0x36')](_0x36cc8d['query'][_0xc826('0x36')]));_0x32a102['attributes']=_0x32a102[_0xc826('0x35')][_0xc826('0x37')]?_0x32a102[_0xc826('0x35')]:_0x416d17['model'];if(!_0x36cc8d[_0xc826('0x33')][_0xc826('0x38')](_0xc826('0x39'))){_0x32a102[_0xc826('0x1c')]=qs[_0xc826('0x1c')](_0x36cc8d['query']['limit']);_0x32a102[_0xc826('0x1e')]=qs[_0xc826('0x1e')](_0x36cc8d['query'][_0xc826('0x1e')]);}_0x32a102[_0xc826('0x3a')]=qs[_0xc826('0x59')](_0x36cc8d[_0xc826('0x33')][_0xc826('0x59')]);_0x32a102[_0xc826('0x3b')]=qs[_0xc826('0x3c')](_[_0xc826('0x3d')](_0x36cc8d[_0xc826('0x33')],_0x416d17['filters']));_0x32a102['where']['ProjectId']=_0x212551['id'];if(_0x36cc8d[_0xc826('0x33')]['filter']){_0x32a102[_0xc826('0x3b')]=_['merge'](_0x32a102['where'],{'$or':_[_0xc826('0x2c')](_0x32a102[_0xc826('0x35')],function(_0x2480f8){var _0x105ece={};_0x105ece[_0x2480f8]={'$like':'%'+_0x36cc8d['query'][_0xc826('0x5a')]+'%'};return _0x105ece;})});}_0x32a102=_[_0xc826('0x3e')]({},_0x32a102,_0x36cc8d[_0xc826('0x40')]);return db[_0xc826('0x58')]['count']({'where':_0x32a102[_0xc826('0x3b')]})['then'](function(_0x5bf056){_0x1d5009[_0xc826('0x1d')]=_0x5bf056;if(_0x36cc8d[_0xc826('0x33')][_0xc826('0x41')]){_0x32a102[_0xc826('0x42')]=[{'all':!![]}];}return db[_0xc826('0x58')][_0xc826('0x43')](_0x32a102);})[_0xc826('0x24')](function(_0x588aba){_0x1d5009['rows']=_0x588aba;return _0x1d5009;});}})[_0xc826('0x24')](respondWithFilteredResult(_0x23d226,_0x32a102))['catch'](handleError(_0x23d226,null));};exports[_0xc826('0x5b')]=function(_0x5b8188,_0x1916fa,_0x5b9ba2){var _0x5c6540={'raw':!![],'where':{}};var _0x85850b={};var _0x2ec552={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc826('0x5c')]({'where':{'id':_0x5b8188[_0xc826('0x46')]['id']}})[_0xc826('0x24')](handleEntityNotFound(_0x1916fa,null))[_0xc826('0x24')](function(_0x1d5540){if(_0x1d5540){_0x85850b[_0xc826('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0xc826('0x2e')]);_0x85850b[_0xc826('0x33')]=_[_0xc826('0x47')](_0x5b8188['query']);_0x85850b['filters']=_[_0xc826('0x34')](_0x85850b[_0xc826('0x32')],_0x85850b[_0xc826('0x33')]);_0x5c6540['attributes']=_[_0xc826('0x34')](_0x85850b[_0xc826('0x32')],qs[_0xc826('0x36')](_0x5b8188[_0xc826('0x33')][_0xc826('0x36')]));_0x5c6540['attributes']=_0x5c6540[_0xc826('0x35')][_0xc826('0x37')]?_0x5c6540['attributes']:_0x85850b['model'];if(!_0x5b8188[_0xc826('0x33')][_0xc826('0x38')]('nolimit')){_0x5c6540['limit']=qs[_0xc826('0x1c')](_0x5b8188[_0xc826('0x33')][_0xc826('0x1c')]);_0x5c6540[_0xc826('0x1e')]=qs[_0xc826('0x1e')](_0x5b8188[_0xc826('0x33')]['offset']);}_0x5c6540[_0xc826('0x3a')]=qs[_0xc826('0x59')](_0x5b8188['query'][_0xc826('0x59')]);_0x5c6540[_0xc826('0x3b')]=qs[_0xc826('0x3c')](_['pick'](_0x5b8188[_0xc826('0x33')],_0x85850b[_0xc826('0x3c')]));_0x5c6540[_0xc826('0x3b')]['ProjectId']=_0x1d5540['id'];if(_0x5b8188['query'][_0xc826('0x5a')]){_0x5c6540[_0xc826('0x3b')]=_[_0xc826('0x3e')](_0x5c6540['where'],{'$or':_[_0xc826('0x2c')](_0x5c6540[_0xc826('0x35')],function(_0xa4867f){var _0x37485e={};_0x37485e[_0xa4867f]={'$like':'%'+_0x5b8188[_0xc826('0x33')]['filter']+'%'};return _0x37485e;})});}_0x5c6540=_['merge']({},_0x5c6540,_0x5b8188[_0xc826('0x40')]);return db[_0xc826('0x5d')]['count']({'where':_0x5c6540[_0xc826('0x3b')]})[_0xc826('0x24')](function(_0x66f4c1){_0x2ec552['count']=_0x66f4c1;if(_0x5b8188['query'][_0xc826('0x41')]){_0x5c6540['include']=[{'all':!![]}];}return db[_0xc826('0x5d')][_0xc826('0x43')](_0x5c6540);})[_0xc826('0x24')](function(_0xcb0a0c){_0x2ec552[_0xc826('0x44')]=_0xcb0a0c;return _0x2ec552;});}})[_0xc826('0x24')](respondWithFilteredResult(_0x1916fa,_0x5c6540))[_0xc826('0x48')](handleError(_0x1916fa,null));};function char(_0x4311bf){return _0xc826('0x5e')===typeof _0x4311bf?String['fromCharCode']['apply'](null,arguments):_0x4311bf;}function needsEncapsulation(_0xad6a84){return!!_0xad6a84&&(_0xad6a84['toString']()[_0xc826('0x5f')](char(0xd))>=0x0||_0xad6a84[_0xc826('0x60')]()[_0xc826('0x5f')](char(0xa))>=0x0||_0xad6a84[_0xc826('0x60')]()[_0xc826('0x5f')](char(0x2c))>=0x0||_0xad6a84[_0xc826('0x60')]()[_0xc826('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x50588){var _0x5a2ce9=char(0x22),_0x3b9318='\x5c'+char(0x22),_0x5309fa=_0x50588[_0xc826('0x60')]()['replace'](new RegExp(_0x5a2ce9,'g'),_0x3b9318);return _0x5a2ce9+_0x5309fa+_0x5a2ce9;}exports[_0xc826('0x61')]=function(_0x460aed,_0x1c931c,_0x3f7d9d){var _0x280b5,_0x45ddf2;var _0x132931={'where':{'ProjectId':_0x460aed[_0xc826('0x46')]['id']}};if(_0x460aed[_0xc826('0x33')]['startTime']){_0x132931[_0xc826('0x3b')][_0xc826('0x62')]=JSON[_0xc826('0x63')](_0x460aed[_0xc826('0x33')][_0xc826('0x64')]);}return db[_0xc826('0x58')][_0xc826('0x43')](_0x132931)[_0xc826('0x24')](handleEntityNotFound(_0x1c931c,null))[_0xc826('0x24')](function(_0xaf00bf){if(_0xaf00bf){_0x280b5=_0xaf00bf;return db[_0xc826('0x65')][_0xc826('0x43')]({'where':{'SessionId':{'$in':_[_0xc826('0x2c')](_0x280b5,'id')},'ProjectId':_0x460aed['params']['id']},'order':'-createdAt'});}})[_0xc826('0x24')](handleEntityNotFound(_0x1c931c,null))[_0xc826('0x24')](function(_0x527996){if(_0x527996){_0x45ddf2=_0x527996;var _0x40b966={};for(var _0x133a5d=0x0,_0xd8ecba=_0x45ddf2[_0xc826('0x37')];_0x133a5d<_0xd8ecba;_0x133a5d++){if(!_0x40b966[_0xc826('0x38')](_0x45ddf2[_0x133a5d][_0xc826('0x66')])){_0x40b966[_0x45ddf2[_0x133a5d]['questionId']]=needsEncapsulation(_0x45ddf2[_0x133a5d][_0xc826('0x67')])?encapsulate(_0x45ddf2[_0x133a5d][_0xc826('0x67')]):_0x45ddf2[_0x133a5d]['question'];}}var _0x506df7=[],_0x33424a={};for(var _0x991e03=0x0,_0x7dc484=_0x280b5[_0xc826('0x37')];_0x991e03<_0x7dc484;_0x991e03++){_0x33424a={'ProjectId':_0x460aed['params']['id'],'SessionId':_0x280b5[_0x991e03]['id'],'StartTime':moment(_0x280b5[_0x991e03][_0xc826('0x62')])[_0xc826('0x68')](_0xc826('0x69'))};for(var _0x4146cf=0x0,_0x7c8d85=_0x45ddf2[_0xc826('0x37')];_0x4146cf<_0x7c8d85;_0x4146cf++){if(_0x45ddf2[_0x4146cf][_0xc826('0x6a')]==_0x280b5[_0x991e03]['id']&&_0x40b966[_0xc826('0x38')](_0x45ddf2[_0x4146cf][_0xc826('0x66')])){_0x33424a[_0x40b966[_0x45ddf2[_0x4146cf][_0xc826('0x66')]]]=_0x45ddf2[_0x4146cf]['answer'];}}for(var _0x32dece in _0x40b966){if(!_0x33424a[_0xc826('0x38')](_0x40b966[_0x32dece])){_0x33424a[_0x40b966[_0x32dece]]=null;}}_0x506df7['push'](_0x33424a);}return _0x506df7;}})['then'](function(_0x3c6734){if(!_[_0xc826('0x6b')](_0x3c6734)){var _0xc5f297=toCsv(_0x3c6734);var _0x4d09cf=Date['now']();fs[_0xc826('0x6c')](util['format'](_0xc826('0x6d'),_0x460aed[_0xc826('0x46')]['id'],_0x4d09cf),_0xc5f297);_0x1c931c['setHeader'](_0xc826('0x6e'),_0xc826('0x6f')+util[_0xc826('0x68')](_0xc826('0x70'),_0x460aed[_0xc826('0x46')]['id'],_0x4d09cf));_0x1c931c[_0xc826('0x71')]('Content-type',_0xc826('0x72'));return _0x1c931c[_0xc826('0x73')](util['format'](_0xc826('0x6d'),_0x460aed[_0xc826('0x46')]['id'],_0x4d09cf));}else{return _0x1c931c[_0xc826('0x17')](0xcc);}})[_0xc826('0x48')](handleError(_0x1c931c,null));};
\ No newline at end of file
index 2cdb7aa..8428b2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb2=['moment','bluebird','request-promise','rimraf','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api'];(function(_0xb78a71,_0x3ebcf5){var _0x30cf8d=function(_0x451d58){while(--_0x451d58){_0xb78a71['push'](_0xb78a71['shift']());}};_0x30cf8d(++_0x3ebcf5);}(_0x2eb2,0x19f));var _0x22eb=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x2eb2[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaeab=['jscripty_projects','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x4d2314,_0x4364cc){var _0x4bc371=function(_0xa750d6){while(--_0xa750d6){_0x4d2314['push'](_0x4d2314['shift']());}};_0x4bc371(++_0x4364cc);}(_0xaeab,0x91));var _0xbaea=function(_0x4c1b4a,_0x117b33){_0x4c1b4a=_0x4c1b4a-0x0;var _0x2452e9=_0xaeab[_0x4c1b4a];return _0x2452e9;};'use strict';var _=require(_0xbaea('0x0'));var util=require('util');var logger=require(_0xbaea('0x1'))('api');var moment=require(_0xbaea('0x2'));var BPromise=require(_0xbaea('0x3'));var rp=require(_0xbaea('0x4'));var fs=require('fs');var path=require(_0xbaea('0x5'));var rimraf=require(_0xbaea('0x6'));var config=require(_0xbaea('0x7'));var attributes=require(_0xbaea('0x8'));module[_0xbaea('0x9')]=function(_0x1ae44e,_0x1e4331){return _0x1ae44e['define'](_0xbaea('0xa'),attributes,{'tableName':_0xbaea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b8df333..2200600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x226a9f,_0x172a4a){var _0x5d3a7e=function(_0xa6b217){while(--_0xa6b217){_0x226a9f['push'](_0x226a9f['shift']());}};_0x5d3a7e(++_0x172a4a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47003c,_0x91c41a){var _0x5a7479=function(_0x35291c){while(--_0x35291c){_0x47003c['push'](_0x47003c['shift']());}};_0x5a7479(++_0x91c41a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 ae60f7d..f2a2c19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc606=['post','create','put','update','delete','/:id','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc606,0x1ab));var _0x6c60=function(_0x55821d,_0x27a22e){_0x55821d=_0x55821d-0x0;var _0x58ea8a=_0xc606[_0x55821d];return _0x58ea8a;};'use strict';var multer=require('multer');var util=require(_0x6c60('0x0'));var path=require(_0x6c60('0x1'));var timeout=require(_0x6c60('0x2'));var express=require('express');var router=express[_0x6c60('0x3')]();var fs_extra=require(_0x6c60('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6c60('0x5'));var config=require(_0x6c60('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x6c60('0x7')]('/',auth[_0x6c60('0x8')](),controller[_0x6c60('0x9')]);router[_0x6c60('0x7')](_0x6c60('0xa'),auth['isAuthenticated'](),controller[_0x6c60('0xb')]);router[_0x6c60('0x7')]('/:id',auth[_0x6c60('0x8')](),controller[_0x6c60('0xc')]);router[_0x6c60('0xd')]('/',auth[_0x6c60('0x8')](),controller[_0x6c60('0xe')]);router[_0x6c60('0xf')]('/:id',auth[_0x6c60('0x8')](),controller[_0x6c60('0x10')]);router[_0x6c60('0x11')](_0x6c60('0x12'),auth[_0x6c60('0x8')](),controller['destroy']);module[_0x6c60('0x13')]=router;
\ No newline at end of file
+var _0xf6ea=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xf6ea,0x1e5));var _0xaf6e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf6ea[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0xaf6e('0x0'));var path=require(_0xaf6e('0x1'));var timeout=require(_0xaf6e('0x2'));var express=require(_0xaf6e('0x3'));var router=express[_0xaf6e('0x4')]();var fs_extra=require(_0xaf6e('0x5'));var auth=require(_0xaf6e('0x6'));var interaction=require(_0xaf6e('0x7'));var config=require(_0xaf6e('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0xaf6e('0x9')]('/',auth[_0xaf6e('0xa')](),controller[_0xaf6e('0xb')]);router[_0xaf6e('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xaf6e('0x9')](_0xaf6e('0xc'),auth[_0xaf6e('0xa')](),controller[_0xaf6e('0xd')]);router[_0xaf6e('0xe')]('/',auth[_0xaf6e('0xa')](),controller[_0xaf6e('0xf')]);router[_0xaf6e('0x10')](_0xaf6e('0xc'),auth[_0xaf6e('0xa')](),controller[_0xaf6e('0x11')]);router[_0xaf6e('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaf6e('0x13')]);module[_0xaf6e('0x14')]=router;
\ No newline at end of file
index bbf919f..9d8429f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4fe17e,_0x38c0ec){_0x4fe17e=_0x4fe17e-0x0;var _0x38497e=_0x7a54[_0x4fe17e];return _0x38497e;};'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(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7a54,0x106));var _0x47a5=function(_0x241d3b,_0x114909){_0x241d3b=_0x241d3b-0x0;var _0x44212b=_0x7a54[_0x241d3b];return _0x44212b;};'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 a61b6af..e559709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf35a=['fieldName','type','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','merge','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','JscriptyQuestionReport','rawAttributes'];(function(_0x5ecae2,_0x586e89){var _0x4165de=function(_0x5f0359){while(--_0x5f0359){_0x5ecae2['push'](_0x5ecae2['shift']());}};_0x4165de(++_0x586e89);}(_0xf35a,0x10b));var _0xaf35=function(_0x13f788,_0x46939a){_0x13f788=_0x13f788-0x0;var _0x3dbcd8=_0xf35a[_0x13f788];return _0x3dbcd8;};'use strict';var emlformat=require(_0xaf35('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf35('0x1'));var jsonpatch=require(_0xaf35('0x2'));var rp=require('request-promise');var moment=require(_0xaf35('0x3'));var BPromise=require(_0xaf35('0x4'));var Mustache=require(_0xaf35('0x5'));var util=require(_0xaf35('0x6'));var path=require(_0xaf35('0x7'));var sox=require(_0xaf35('0x8'));var csv=require(_0xaf35('0x9'));var ejs=require(_0xaf35('0xa'));var fs=require('fs');var fs_extra=require(_0xaf35('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaf35('0xc'));var deskjs=require(_0xaf35('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaf35('0xe'));var Papa=require(_0xaf35('0xf'));var Redis=require(_0xaf35('0x10'));var authService=require(_0xaf35('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaf35('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf35('0x13'))(_0xaf35('0x14'));var utils=require(_0xaf35('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xaf35('0x16'));var db=require(_0xaf35('0x17'))['db'];function respondWithStatusCode(_0x26534d,_0x220153){_0x220153=_0x220153||0xcc;return function(_0x3bc069){if(_0x3bc069){return _0x26534d[_0xaf35('0x18')](_0x220153);}return _0x26534d[_0xaf35('0x19')](_0x220153)[_0xaf35('0x1a')]();};}function respondWithResult(_0x3fb2aa,_0x528d23){_0x528d23=_0x528d23||0xc8;return function(_0x3abadf){if(_0x3abadf){return _0x3fb2aa[_0xaf35('0x19')](_0x528d23)[_0xaf35('0x1b')](_0x3abadf);}};}function respondWithFilteredResult(_0x384e51,_0x2519ef){return function(_0x57c75a){if(_0x57c75a){var _0x81b4c6=typeof _0x2519ef[_0xaf35('0x1c')]===_0xaf35('0x1d')&&typeof _0x2519ef[_0xaf35('0x1e')]===_0xaf35('0x1d');var _0x1e4b35=_0x57c75a[_0xaf35('0x1f')];var _0x24d7c5=_0x81b4c6?0x0:_0x2519ef['offset'];var _0x7a47=_0x81b4c6?_0x57c75a['count']:_0x2519ef[_0xaf35('0x1c')]+_0x2519ef[_0xaf35('0x1e')];var _0x27555b;if(_0x7a47>=_0x1e4b35){_0x7a47=_0x1e4b35;_0x27555b=0xc8;}else{_0x27555b=0xce;}_0x384e51[_0xaf35('0x19')](_0x27555b);return _0x384e51[_0xaf35('0x20')](_0xaf35('0x21'),_0x24d7c5+'-'+_0x7a47+'/'+_0x1e4b35)[_0xaf35('0x1b')](_0x57c75a);}return null;};}function patchUpdates(_0x97643){return function(_0x297cd8){try{jsonpatch[_0xaf35('0x22')](_0x297cd8,_0x97643,!![]);}catch(_0x516fb0){return BPromise[_0xaf35('0x23')](_0x516fb0);}return _0x297cd8[_0xaf35('0x24')]();};}function saveUpdates(_0x177764,_0x328a58){return function(_0x162956){if(_0x162956){return _0x162956['update'](_0x177764)[_0xaf35('0x25')](function(_0x1c14e5){return _0x1c14e5;});}return null;};}function removeEntity(_0xd12802,_0x3e7961){return function(_0x35c921){if(_0x35c921){return _0x35c921[_0xaf35('0x26')]()['then'](function(){_0xd12802['status'](0xcc)[_0xaf35('0x1a')]();});}};}function handleEntityNotFound(_0x2013c6,_0x110669){return function(_0x4e72ad){if(!_0x4e72ad){_0x2013c6[_0xaf35('0x18')](0x194);}return _0x4e72ad;};}function handleError(_0x509217,_0x3cb09c){_0x3cb09c=_0x3cb09c||0x1f4;return function(_0x4ac72f){logger['error'](_0x4ac72f[_0xaf35('0x27')]);if(_0x4ac72f[_0xaf35('0x28')]){delete _0x4ac72f[_0xaf35('0x28')];}_0x509217[_0xaf35('0x19')](_0x3cb09c)[_0xaf35('0x29')](_0x4ac72f);};}exports[_0xaf35('0x2a')]=function(_0x2808b1,_0x101616){var _0x453239={},_0x347904={},_0x11c357={'count':0x0,'rows':[]};var _0x1659dc=_['map'](db[_0xaf35('0x2b')][_0xaf35('0x2c')],function(_0x2691ed){return{'name':_0x2691ed[_0xaf35('0x2d')],'type':_0x2691ed[_0xaf35('0x2e')][_0xaf35('0x2f')]};});_0x347904[_0xaf35('0x30')]=_[_0xaf35('0x31')](_0x1659dc,'name');_0x347904['query']=_[_0xaf35('0x32')](_0x2808b1[_0xaf35('0x33')]);_0x347904['filters']=_['intersection'](_0x347904[_0xaf35('0x30')],_0x347904[_0xaf35('0x33')]);_0x453239[_0xaf35('0x34')]=_['intersection'](_0x347904[_0xaf35('0x30')],qs[_0xaf35('0x35')](_0x2808b1[_0xaf35('0x33')][_0xaf35('0x35')]));_0x453239[_0xaf35('0x34')]=_0x453239[_0xaf35('0x34')][_0xaf35('0x36')]?_0x453239[_0xaf35('0x34')]:_0x347904[_0xaf35('0x30')];if(!_0x2808b1[_0xaf35('0x33')][_0xaf35('0x37')](_0xaf35('0x38'))){_0x453239['limit']=qs['limit'](_0x2808b1[_0xaf35('0x33')][_0xaf35('0x1e')]);_0x453239['offset']=qs['offset'](_0x2808b1[_0xaf35('0x33')][_0xaf35('0x1c')]);}_0x453239[_0xaf35('0x39')]=qs[_0xaf35('0x3a')](_0x2808b1[_0xaf35('0x33')]['sort']);_0x453239[_0xaf35('0x3b')]=qs[_0xaf35('0x3c')](_[_0xaf35('0x3d')](_0x2808b1[_0xaf35('0x33')],_0x347904['filters']),_0x1659dc);if(_0x2808b1[_0xaf35('0x33')][_0xaf35('0x3e')]){_0x453239[_0xaf35('0x3b')]=_['merge'](_0x453239[_0xaf35('0x3b')],{'$or':_['map'](_0x1659dc,function(_0x3ef0a9){if(_0x3ef0a9[_0xaf35('0x2e')]!==_0xaf35('0x3f')){var _0xd2c6b={};_0xd2c6b[_0x3ef0a9[_0xaf35('0x28')]]={'$like':'%'+_0x2808b1['query'][_0xaf35('0x3e')]+'%'};return _0xd2c6b;}})});}_0x453239=_['merge']({},_0x453239,_0x2808b1[_0xaf35('0x40')]);var _0x55772a={'where':_0x453239[_0xaf35('0x3b')]};return db[_0xaf35('0x2b')][_0xaf35('0x1f')](_0x55772a)[_0xaf35('0x25')](function(_0x2febff){_0x11c357[_0xaf35('0x1f')]=_0x2febff;if(_0x2808b1[_0xaf35('0x33')][_0xaf35('0x41')]){_0x453239[_0xaf35('0x42')]=[{'all':!![]}];}return db[_0xaf35('0x2b')][_0xaf35('0x43')](_0x453239);})['then'](function(_0x3c2198){_0x11c357[_0xaf35('0x44')]=_0x3c2198;return _0x11c357;})['then'](respondWithFilteredResult(_0x101616,_0x453239))['catch'](handleError(_0x101616,null));};exports[_0xaf35('0x45')]=function(_0x1bc9a2,_0x30d1af){var _0x255a64={'raw':!![],'where':{'id':_0x1bc9a2[_0xaf35('0x46')]['id']}},_0x579a91={};_0x579a91[_0xaf35('0x30')]=_[_0xaf35('0x32')](db[_0xaf35('0x2b')]['rawAttributes']);_0x579a91[_0xaf35('0x33')]=_['keys'](_0x1bc9a2[_0xaf35('0x33')]);_0x579a91[_0xaf35('0x3c')]=_[_0xaf35('0x47')](_0x579a91[_0xaf35('0x30')],_0x579a91['query']);_0x255a64['attributes']=_[_0xaf35('0x47')](_0x579a91[_0xaf35('0x30')],qs[_0xaf35('0x35')](_0x1bc9a2[_0xaf35('0x33')][_0xaf35('0x35')]));_0x255a64[_0xaf35('0x34')]=_0x255a64[_0xaf35('0x34')][_0xaf35('0x36')]?_0x255a64[_0xaf35('0x34')]:_0x579a91['model'];if(_0x1bc9a2['query'][_0xaf35('0x41')]){_0x255a64[_0xaf35('0x42')]=[{'all':!![]}];}_0x255a64=_[_0xaf35('0x48')]({},_0x255a64,_0x1bc9a2['options']);return db[_0xaf35('0x2b')]['find'](_0x255a64)['then'](handleEntityNotFound(_0x30d1af,null))[_0xaf35('0x25')](respondWithResult(_0x30d1af,null))[_0xaf35('0x49')](handleError(_0x30d1af,null));};exports[_0xaf35('0x4a')]=function(_0x333d2b,_0x30a8ea){return db[_0xaf35('0x2b')]['create'](_0x333d2b[_0xaf35('0x4b')],{})[_0xaf35('0x25')](respondWithResult(_0x30a8ea,0xc9))[_0xaf35('0x49')](handleError(_0x30a8ea,null));};exports['update']=function(_0x2ad27f,_0xb5f1fa){if(_0x2ad27f[_0xaf35('0x4b')]['id']){delete _0x2ad27f['body']['id'];}return db[_0xaf35('0x2b')][_0xaf35('0x4c')]({'where':{'id':_0x2ad27f[_0xaf35('0x46')]['id']}})[_0xaf35('0x25')](handleEntityNotFound(_0xb5f1fa,null))[_0xaf35('0x25')](saveUpdates(_0x2ad27f[_0xaf35('0x4b')],null))[_0xaf35('0x25')](respondWithResult(_0xb5f1fa,null))[_0xaf35('0x49')](handleError(_0xb5f1fa,null));};exports[_0xaf35('0x26')]=function(_0x21be61,_0x5c218d){return db[_0xaf35('0x2b')][_0xaf35('0x4c')]({'where':{'id':_0x21be61[_0xaf35('0x46')]['id']}})[_0xaf35('0x25')](handleEntityNotFound(_0x5c218d,null))['then'](removeEntity(_0x5c218d,null))['catch'](handleError(_0x5c218d,null));};exports['describe']=function(_0x1fd066,_0xe85a3e){return db[_0xaf35('0x2b')][_0xaf35('0x4d')]()[_0xaf35('0x25')](respondWithResult(_0xe85a3e,null))[_0xaf35('0x49')](handleError(_0xe85a3e,null));};
\ No newline at end of file
+var _0xcb1a=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','fieldName','type','key','model','map','query','intersection','attributes','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','rawAttributes','fields','length','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d193b,_0x16b5f2){var _0x1cb07d=function(_0x275e7f){while(--_0x275e7f){_0x3d193b['push'](_0x3d193b['shift']());}};_0x1cb07d(++_0x16b5f2);}(_0xcb1a,0x1e9));var _0xacb1=function(_0x3c7ad7,_0xcbea9e){_0x3c7ad7=_0x3c7ad7-0x0;var _0x2d73d4=_0xcb1a[_0x3c7ad7];return _0x2d73d4;};'use strict';var emlformat=require(_0xacb1('0x0'));var rimraf=require(_0xacb1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacb1('0x2'));var rp=require(_0xacb1('0x3'));var moment=require('moment');var BPromise=require(_0xacb1('0x4'));var Mustache=require('mustache');var util=require(_0xacb1('0x5'));var path=require('path');var sox=require(_0xacb1('0x6'));var csv=require(_0xacb1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacb1('0x8'));var squel=require(_0xacb1('0x9'));var crypto=require(_0xacb1('0xa'));var jsforce=require(_0xacb1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xacb1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xacb1('0xc'));var authService=require(_0xacb1('0xd'));var qs=require(_0xacb1('0xe'));var as=require(_0xacb1('0xf'));var hardwareService=require(_0xacb1('0x10'));var logger=require('../../config/logger')(_0xacb1('0x11'));var utils=require(_0xacb1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xacb1('0x13'));var db=require(_0xacb1('0x14'))['db'];function respondWithStatusCode(_0x1ad07d,_0x2feefe){_0x2feefe=_0x2feefe||0xcc;return function(_0x5ceb47){if(_0x5ceb47){return _0x1ad07d[_0xacb1('0x15')](_0x2feefe);}return _0x1ad07d[_0xacb1('0x16')](_0x2feefe)[_0xacb1('0x17')]();};}function respondWithResult(_0x216253,_0x14ea10){_0x14ea10=_0x14ea10||0xc8;return function(_0x784919){if(_0x784919){return _0x216253[_0xacb1('0x16')](_0x14ea10)['json'](_0x784919);}};}function respondWithFilteredResult(_0xbac68a,_0x1f7e24){return function(_0x1dd24f){if(_0x1dd24f){var _0x18b1f6=typeof _0x1f7e24['offset']===_0xacb1('0x18')&&typeof _0x1f7e24[_0xacb1('0x19')]===_0xacb1('0x18');var _0x3cc033=_0x1dd24f[_0xacb1('0x1a')];var _0x72bdd8=_0x18b1f6?0x0:_0x1f7e24[_0xacb1('0x1b')];var _0x253e90=_0x18b1f6?_0x1dd24f['count']:_0x1f7e24[_0xacb1('0x1b')]+_0x1f7e24[_0xacb1('0x19')];var _0x12b02e;if(_0x253e90>=_0x3cc033){_0x253e90=_0x3cc033;_0x12b02e=0xc8;}else{_0x12b02e=0xce;}_0xbac68a['status'](_0x12b02e);return _0xbac68a['set'](_0xacb1('0x1c'),_0x72bdd8+'-'+_0x253e90+'/'+_0x3cc033)[_0xacb1('0x1d')](_0x1dd24f);}return null;};}function patchUpdates(_0x5403a7){return function(_0x691c94){try{jsonpatch[_0xacb1('0x1e')](_0x691c94,_0x5403a7,!![]);}catch(_0x1fe68b){return BPromise[_0xacb1('0x1f')](_0x1fe68b);}return _0x691c94['save']();};}function saveUpdates(_0x382911,_0x6e0652){return function(_0x318228){if(_0x318228){return _0x318228[_0xacb1('0x20')](_0x382911)['then'](function(_0x48b5db){return _0x48b5db;});}return null;};}function removeEntity(_0x2221c5,_0xae1e01){return function(_0x5effe0){if(_0x5effe0){return _0x5effe0[_0xacb1('0x21')]()[_0xacb1('0x22')](function(){_0x2221c5[_0xacb1('0x16')](0xcc)[_0xacb1('0x17')]();});}};}function handleEntityNotFound(_0x29a6ac,_0x4ef623){return function(_0x4b4eb8){if(!_0x4b4eb8){_0x29a6ac[_0xacb1('0x15')](0x194);}return _0x4b4eb8;};}function handleError(_0xdf6701,_0x23a823){_0x23a823=_0x23a823||0x1f4;return function(_0x12a240){logger[_0xacb1('0x23')](_0x12a240[_0xacb1('0x24')]);if(_0x12a240[_0xacb1('0x25')]){delete _0x12a240[_0xacb1('0x25')];}_0xdf6701['status'](_0x23a823)[_0xacb1('0x26')](_0x12a240);};}exports[_0xacb1('0x27')]=function(_0x167d75,_0x31231e){var _0x1808af={},_0x3965ab={},_0x26f161={'count':0x0,'rows':[]};var _0x3850ac=_['map'](db[_0xacb1('0x28')]['rawAttributes'],function(_0x1739c7){return{'name':_0x1739c7[_0xacb1('0x29')],'type':_0x1739c7[_0xacb1('0x2a')][_0xacb1('0x2b')]};});_0x3965ab[_0xacb1('0x2c')]=_[_0xacb1('0x2d')](_0x3850ac,'name');_0x3965ab[_0xacb1('0x2e')]=_['keys'](_0x167d75['query']);_0x3965ab['filters']=_[_0xacb1('0x2f')](_0x3965ab['model'],_0x3965ab[_0xacb1('0x2e')]);_0x1808af[_0xacb1('0x30')]=_[_0xacb1('0x2f')](_0x3965ab[_0xacb1('0x2c')],qs['fields'](_0x167d75['query']['fields']));_0x1808af['attributes']=_0x1808af['attributes']['length']?_0x1808af[_0xacb1('0x30')]:_0x3965ab[_0xacb1('0x2c')];if(!_0x167d75[_0xacb1('0x2e')]['hasOwnProperty'](_0xacb1('0x31'))){_0x1808af[_0xacb1('0x19')]=qs[_0xacb1('0x19')](_0x167d75['query'][_0xacb1('0x19')]);_0x1808af[_0xacb1('0x1b')]=qs[_0xacb1('0x1b')](_0x167d75[_0xacb1('0x2e')][_0xacb1('0x1b')]);}_0x1808af[_0xacb1('0x32')]=qs[_0xacb1('0x33')](_0x167d75[_0xacb1('0x2e')][_0xacb1('0x33')]);_0x1808af['where']=qs[_0xacb1('0x34')](_[_0xacb1('0x35')](_0x167d75[_0xacb1('0x2e')],_0x3965ab['filters']),_0x3850ac);if(_0x167d75['query'][_0xacb1('0x36')]){_0x1808af[_0xacb1('0x37')]=_[_0xacb1('0x38')](_0x1808af[_0xacb1('0x37')],{'$or':_[_0xacb1('0x2d')](_0x3850ac,function(_0xb7a74f){if(_0xb7a74f['type']!==_0xacb1('0x39')){var _0x5b4e57={};_0x5b4e57[_0xb7a74f['name']]={'$like':'%'+_0x167d75[_0xacb1('0x2e')]['filter']+'%'};return _0x5b4e57;}})});}_0x1808af=_[_0xacb1('0x38')]({},_0x1808af,_0x167d75[_0xacb1('0x3a')]);var _0x193038={'where':_0x1808af[_0xacb1('0x37')]};return db[_0xacb1('0x28')][_0xacb1('0x1a')](_0x193038)[_0xacb1('0x22')](function(_0x321620){_0x26f161[_0xacb1('0x1a')]=_0x321620;if(_0x167d75['query'][_0xacb1('0x3b')]){_0x1808af['include']=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1808af);})[_0xacb1('0x22')](function(_0x25ffd6){_0x26f161[_0xacb1('0x3c')]=_0x25ffd6;return _0x26f161;})[_0xacb1('0x22')](respondWithFilteredResult(_0x31231e,_0x1808af))[_0xacb1('0x3d')](handleError(_0x31231e,null));};exports[_0xacb1('0x3e')]=function(_0x12ff06,_0x54426e){var _0x48e9b2={'raw':!![],'where':{'id':_0x12ff06[_0xacb1('0x3f')]['id']}},_0x35bcf2={};_0x35bcf2['model']=_[_0xacb1('0x40')](db['JscriptyQuestionReport'][_0xacb1('0x41')]);_0x35bcf2[_0xacb1('0x2e')]=_[_0xacb1('0x40')](_0x12ff06[_0xacb1('0x2e')]);_0x35bcf2[_0xacb1('0x34')]=_['intersection'](_0x35bcf2[_0xacb1('0x2c')],_0x35bcf2[_0xacb1('0x2e')]);_0x48e9b2[_0xacb1('0x30')]=_[_0xacb1('0x2f')](_0x35bcf2['model'],qs[_0xacb1('0x42')](_0x12ff06[_0xacb1('0x2e')]['fields']));_0x48e9b2[_0xacb1('0x30')]=_0x48e9b2[_0xacb1('0x30')][_0xacb1('0x43')]?_0x48e9b2[_0xacb1('0x30')]:_0x35bcf2[_0xacb1('0x2c')];if(_0x12ff06[_0xacb1('0x2e')][_0xacb1('0x3b')]){_0x48e9b2['include']=[{'all':!![]}];}_0x48e9b2=_[_0xacb1('0x38')]({},_0x48e9b2,_0x12ff06[_0xacb1('0x3a')]);return db[_0xacb1('0x28')]['find'](_0x48e9b2)[_0xacb1('0x22')](handleEntityNotFound(_0x54426e,null))['then'](respondWithResult(_0x54426e,null))[_0xacb1('0x3d')](handleError(_0x54426e,null));};exports[_0xacb1('0x44')]=function(_0x216b67,_0x15893d){return db[_0xacb1('0x28')]['create'](_0x216b67[_0xacb1('0x45')],{})[_0xacb1('0x22')](respondWithResult(_0x15893d,0xc9))['catch'](handleError(_0x15893d,null));};exports['update']=function(_0x3d07f7,_0x33c09b){if(_0x3d07f7['body']['id']){delete _0x3d07f7[_0xacb1('0x45')]['id'];}return db[_0xacb1('0x28')][_0xacb1('0x46')]({'where':{'id':_0x3d07f7[_0xacb1('0x3f')]['id']}})[_0xacb1('0x22')](handleEntityNotFound(_0x33c09b,null))[_0xacb1('0x22')](saveUpdates(_0x3d07f7[_0xacb1('0x45')],null))['then'](respondWithResult(_0x33c09b,null))[_0xacb1('0x3d')](handleError(_0x33c09b,null));};exports[_0xacb1('0x21')]=function(_0x19c65e,_0x5edc18){return db[_0xacb1('0x28')][_0xacb1('0x46')]({'where':{'id':_0x19c65e['params']['id']}})[_0xacb1('0x22')](handleEntityNotFound(_0x5edc18,null))[_0xacb1('0x22')](removeEntity(_0x5edc18,null))[_0xacb1('0x3d')](handleError(_0x5edc18,null));};exports['describe']=function(_0x1593f2,_0x47ac11){return db[_0xacb1('0x28')][_0xacb1('0x47')]()[_0xacb1('0x22')](respondWithResult(_0x47ac11,null))[_0xacb1('0x3d')](handleError(_0x47ac11,null));};
\ No newline at end of file
index 48c459a..93d2c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9377=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x9377,0x72));var _0x7937=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9377[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7937('0x0'));var logger=require('../../config/logger')(_0x7937('0x1'));var moment=require(_0x7937('0x2'));var BPromise=require(_0x7937('0x3'));var rp=require(_0x7937('0x4'));var fs=require('fs');var path=require(_0x7937('0x5'));var rimraf=require('rimraf');var config=require(_0x7937('0x6'));var attributes=require(_0x7937('0x7'));module[_0x7937('0x8')]=function(_0x5a4be8,_0x14fdd6){return _0x5a4be8[_0x7937('0x9')](_0x7937('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0be2=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x39701b,_0x41d9bb){var _0x2edf15=function(_0x182e1c){while(--_0x182e1c){_0x39701b['push'](_0x39701b['shift']());}};_0x2edf15(++_0x41d9bb);}(_0x0be2,0x123));var _0x20be=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x0be2[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x20be('0x0'));var util=require('util');var logger=require(_0x20be('0x1'))('api');var moment=require(_0x20be('0x2'));var BPromise=require(_0x20be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20be('0x4'));var rimraf=require(_0x20be('0x5'));var config=require(_0x20be('0x6'));var attributes=require(_0x20be('0x7'));module[_0x20be('0x8')]=function(_0x58a919,_0x4e5e6d){return _0x58a919[_0x20be('0x9')](_0x20be('0xa'),attributes,{'tableName':_0x20be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ec66774..3f0554c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe88c=['error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe88c,0xd8));var _0xce88=function(_0xe4936,_0x3cd5c0){_0xe4936=_0xe4936-0x0;var _0x254fee=_0xe88c[_0xe4936];return _0x254fee;};'use strict';var _=require(_0xce88('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce88('0x1'));var rs=require(_0xce88('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce88('0x3'))['db'];var utils=require(_0xce88('0x4'));var logger=require(_0xce88('0x5'))('rpc');var config=require(_0xce88('0x6'));var jayson=require(_0xce88('0x7'));var client=jayson[_0xce88('0x8')][_0xce88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51b1c3,_0x4186ce,_0x1bfdd4){return new BPromise(function(_0x353e96,_0x58f7f0){return client[_0xce88('0xa')](_0x51b1c3,_0x1bfdd4)[_0xce88('0xb')](function(_0x4b9c90){logger[_0xce88('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4186ce,_0xce88('0xd'));logger[_0xce88('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4186ce,'request\x20sent',JSON['stringify'](_0x4b9c90));if(_0x4b9c90['error']){if(_0x4b9c90[_0xce88('0xf')][_0xce88('0x10')]===0x1f4){logger[_0xce88('0xf')](_0xce88('0x11'),_0x4186ce,_0x4b9c90[_0xce88('0xf')]['message']);return _0x58f7f0(_0x4b9c90[_0xce88('0xf')]['message']);}logger[_0xce88('0xf')](_0xce88('0x11'),_0x4186ce,_0x4b9c90[_0xce88('0xf')][_0xce88('0x12')]);return _0x353e96(_0x4b9c90[_0xce88('0xf')][_0xce88('0x12')]);}else{logger['info'](_0xce88('0x11'),_0x4186ce,'request\x20sent');_0x353e96(_0x4b9c90[_0xce88('0x13')][_0xce88('0x12')]);}})[_0xce88('0x14')](function(_0x332bc2){logger[_0xce88('0xf')](_0xce88('0x11'),_0x4186ce,_0x332bc2);_0x58f7f0(_0x332bc2);});});}
\ No newline at end of file
+var _0x8826=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x3a94e1,_0x22e4fd){var _0x6a09d5=function(_0x2d6d1c){while(--_0x2d6d1c){_0x3a94e1['push'](_0x3a94e1['shift']());}};_0x6a09d5(++_0x22e4fd);}(_0x8826,0x6e));var _0x6882=function(_0x68a411,_0x538590){_0x68a411=_0x68a411-0x0;var _0x4e9326=_0x8826[_0x68a411];return _0x4e9326;};'use strict';var _=require(_0x6882('0x0'));var util=require('util');var moment=require(_0x6882('0x1'));var BPromise=require(_0x6882('0x2'));var rs=require(_0x6882('0x3'));var fs=require('fs');var Redis=require(_0x6882('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6882('0x5'));var logger=require('../../config/logger')(_0x6882('0x6'));var config=require(_0x6882('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6882('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55c557,_0x4981ec,_0x54fd53){return new BPromise(function(_0x23f135,_0x1c0aed){return client[_0x6882('0x9')](_0x55c557,_0x54fd53)[_0x6882('0xa')](function(_0x382a0d){logger['info'](_0x6882('0xb'),_0x4981ec,_0x6882('0xc'));logger[_0x6882('0xd')](_0x6882('0xe'),_0x4981ec,_0x6882('0xc'),JSON[_0x6882('0xf')](_0x382a0d));if(_0x382a0d[_0x6882('0x10')]){if(_0x382a0d[_0x6882('0x10')][_0x6882('0x11')]===0x1f4){logger[_0x6882('0x10')](_0x6882('0xb'),_0x4981ec,_0x382a0d['error']['message']);return _0x1c0aed(_0x382a0d['error']['message']);}logger['error'](_0x6882('0xb'),_0x4981ec,_0x382a0d['error'][_0x6882('0x12')]);return _0x23f135(_0x382a0d[_0x6882('0x10')][_0x6882('0x12')]);}else{logger[_0x6882('0x13')](_0x6882('0xb'),_0x4981ec,_0x6882('0xc'));_0x23f135(_0x382a0d[_0x6882('0x14')][_0x6882('0x12')]);}})[_0x6882('0x15')](function(_0x31715d){logger[_0x6882('0x10')](_0x6882('0xb'),_0x4981ec,_0x31715d);_0x1c0aed(_0x31715d);});});}
\ No newline at end of file
index b74c789..3e39748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','create','put','update','delete','destroy','exports'];(function(_0x4d7b78,_0x2397a4){var _0x1379c1=function(_0x5d2cd2){while(--_0x5d2cd2){_0x4d7b78['push'](_0x4d7b78['shift']());}};_0x1379c1(++_0x2397a4);}(_0xe2fe,0x180));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require(_0xee2f('0x1'));var path=require(_0xee2f('0x2'));var timeout=require(_0xee2f('0x3'));var express=require(_0xee2f('0x4'));var router=express[_0xee2f('0x5')]();var fs_extra=require(_0xee2f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xee2f('0x7'));var config=require(_0xee2f('0x8'));var controller=require(_0xee2f('0x9'));router[_0xee2f('0xa')]('/',auth[_0xee2f('0xb')](),controller['index']);router[_0xee2f('0xa')](_0xee2f('0xc'),auth[_0xee2f('0xb')](),controller[_0xee2f('0xd')]);router['get'](_0xee2f('0xe'),auth[_0xee2f('0xb')](),controller[_0xee2f('0xf')]);router[_0xee2f('0xa')](_0xee2f('0x10'),auth['isAuthenticated'](),controller[_0xee2f('0x11')]);router['post']('/',auth[_0xee2f('0xb')](),controller[_0xee2f('0x12')]);router[_0xee2f('0x13')](_0xee2f('0xe'),auth[_0xee2f('0xb')](),controller[_0xee2f('0x14')]);router[_0xee2f('0x15')](_0xee2f('0xe'),auth[_0xee2f('0xb')](),controller[_0xee2f('0x16')]);module[_0xee2f('0x17')]=router;
\ No newline at end of file
+var _0x7b09=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','getQuestions','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x1a628b,_0x2faaf0){var _0x5360c9=function(_0x107643){while(--_0x107643){_0x1a628b['push'](_0x1a628b['shift']());}};_0x5360c9(++_0x2faaf0);}(_0x7b09,0x176));var _0x97b0=function(_0x23755f,_0x573cb3){_0x23755f=_0x23755f-0x0;var _0x3c9da1=_0x7b09[_0x23755f];return _0x3c9da1;};'use strict';var multer=require(_0x97b0('0x0'));var util=require('util');var path=require(_0x97b0('0x1'));var timeout=require(_0x97b0('0x2'));var express=require(_0x97b0('0x3'));var router=express[_0x97b0('0x4')]();var fs_extra=require(_0x97b0('0x5'));var auth=require(_0x97b0('0x6'));var interaction=require(_0x97b0('0x7'));var config=require(_0x97b0('0x8'));var controller=require(_0x97b0('0x9'));router[_0x97b0('0xa')]('/',auth[_0x97b0('0xb')](),controller[_0x97b0('0xc')]);router['get'](_0x97b0('0xd'),auth['isAuthenticated'](),controller[_0x97b0('0xe')]);router[_0x97b0('0xa')]('/:id',auth[_0x97b0('0xb')](),controller[_0x97b0('0xf')]);router[_0x97b0('0xa')]('/:id/questions',auth[_0x97b0('0xb')](),controller[_0x97b0('0x10')]);router[_0x97b0('0x11')]('/',auth[_0x97b0('0xb')](),controller[_0x97b0('0x12')]);router[_0x97b0('0x13')](_0x97b0('0x14'),auth[_0x97b0('0xb')](),controller[_0x97b0('0x15')]);router[_0x97b0('0x16')](_0x97b0('0x14'),auth['isAuthenticated'](),controller[_0x97b0('0x17')]);module[_0x97b0('0x18')]=router;
\ No newline at end of file
index c05139d..9841b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb8d=['setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x38bb6e,_0x17b4af){var _0x766d0=function(_0x339d41){while(--_0x339d41){_0x38bb6e['push'](_0x38bb6e['shift']());}};_0x766d0(++_0x17b4af);}(_0xdb8d,0xe5));var _0xddb8=function(_0x350034,_0x341770){_0x350034=_0x350034-0x0;var _0x303eb4=_0xdb8d[_0x350034];return _0x303eb4;};'use strict';var moment=require(_0xddb8('0x0'));var Sequelize=require(_0xddb8('0x1'));module[_0xddb8('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x55345c){this[_0xddb8('0x3')](_0xddb8('0x4'),_0x55345c);this[_0xddb8('0x3')]('endtime',moment()[_0xddb8('0x5')](_0xddb8('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xddb8('0x7')]},'projectname':{'type':Sequelize[_0xddb8('0x7')]},'queue':{'type':Sequelize[_0xddb8('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xc702=['BOOLEAN','moment','sequelize','DATE','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x3c1772,_0xa741f5){var _0x306d26=function(_0x56189f){while(--_0x56189f){_0x3c1772['push'](_0x3c1772['shift']());}};_0x306d26(++_0xa741f5);}(_0xc702,0xb0));var _0x2c70=function(_0x5f0e92,_0xe1a915){_0x5f0e92=_0x5f0e92-0x0;var _0x2fd607=_0xc702[_0x5f0e92];return _0x2fd607;};'use strict';var moment=require(_0x2c70('0x0'));var Sequelize=require(_0x2c70('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x2c70('0x2')],'set':function(_0x24d56a){this['setDataValue']('starttime',_0x24d56a);this[_0x2c70('0x3')]('endtime',moment()['format'](_0x2c70('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2c70('0x5')]},'projectname':{'type':Sequelize[_0x2c70('0x5')]},'queue':{'type':Sequelize[_0x2c70('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x2c70('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 28d78e0..9dd0725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ea=['../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x16f495,_0x4f205d){var _0x3283e3=function(_0x261b6b){while(--_0x261b6b){_0x16f495['push'](_0x16f495['shift']());}};_0x3283e3(++_0x4f205d);}(_0x49ea,0x8a));var _0xa49e=function(_0x416564,_0x266c3a){_0x416564=_0x416564-0x0;var _0x3523f0=_0x49ea[_0x416564];return _0x3523f0;};'use strict';var emlformat=require(_0xa49e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa49e('0x1'));var jsonpatch=require(_0xa49e('0x2'));var rp=require(_0xa49e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa49e('0x4'));var util=require(_0xa49e('0x5'));var path=require(_0xa49e('0x6'));var sox=require(_0xa49e('0x7'));var csv=require(_0xa49e('0x8'));var ejs=require(_0xa49e('0x9'));var fs=require('fs');var fs_extra=require(_0xa49e('0xa'));var _=require(_0xa49e('0xb'));var squel=require(_0xa49e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa49e('0xd'));var toCsv=require(_0xa49e('0x8'));var querystring=require(_0xa49e('0xe'));var Papa=require(_0xa49e('0xf'));var Redis=require(_0xa49e('0x10'));var authService=require(_0xa49e('0x11'));var qs=require(_0xa49e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa49e('0x13'));var logger=require('../../config/logger')(_0xa49e('0x14'));var utils=require(_0xa49e('0x15'));var config=require(_0xa49e('0x16'));var licenseUtil=require(_0xa49e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ea94f,_0x5ceb99){_0x5ceb99=_0x5ceb99||0xcc;return function(_0x3711ca){if(_0x3711ca){return _0x1ea94f[_0xa49e('0x18')](_0x5ceb99);}return _0x1ea94f['status'](_0x5ceb99)[_0xa49e('0x19')]();};}function respondWithResult(_0x59cfef,_0xcdcbb6){_0xcdcbb6=_0xcdcbb6||0xc8;return function(_0x170e98){if(_0x170e98){return _0x59cfef[_0xa49e('0x1a')](_0xcdcbb6)['json'](_0x170e98);}};}function respondWithFilteredResult(_0x1eea52,_0x4ad5d3){return function(_0xcec2b6){if(_0xcec2b6){var _0x5aeda8=typeof _0x4ad5d3[_0xa49e('0x1b')]===_0xa49e('0x1c')&&typeof _0x4ad5d3[_0xa49e('0x1d')]==='undefined';var _0x4b956a=_0xcec2b6[_0xa49e('0x1e')];var _0x56399d=_0x5aeda8?0x0:_0x4ad5d3[_0xa49e('0x1b')];var _0x35bde0=_0x5aeda8?_0xcec2b6[_0xa49e('0x1e')]:_0x4ad5d3[_0xa49e('0x1b')]+_0x4ad5d3[_0xa49e('0x1d')];var _0x276ba9;if(_0x35bde0>=_0x4b956a){_0x35bde0=_0x4b956a;_0x276ba9=0xc8;}else{_0x276ba9=0xce;}_0x1eea52[_0xa49e('0x1a')](_0x276ba9);return _0x1eea52[_0xa49e('0x1f')]('Content-Range',_0x56399d+'-'+_0x35bde0+'/'+_0x4b956a)['json'](_0xcec2b6);}return null;};}function patchUpdates(_0x305501){return function(_0x5d5921){try{jsonpatch[_0xa49e('0x20')](_0x5d5921,_0x305501,!![]);}catch(_0x500b35){return BPromise[_0xa49e('0x21')](_0x500b35);}return _0x5d5921[_0xa49e('0x22')]();};}function saveUpdates(_0x30c295,_0x29ea64){return function(_0x1e0125){if(_0x1e0125){return _0x1e0125[_0xa49e('0x23')](_0x30c295)[_0xa49e('0x24')](function(_0x7530b2){return _0x7530b2;});}return null;};}function removeEntity(_0x17526f,_0x326512){return function(_0x114559){if(_0x114559){return _0x114559[_0xa49e('0x25')]()[_0xa49e('0x24')](function(){_0x17526f['status'](0xcc)[_0xa49e('0x19')]();});}};}function handleEntityNotFound(_0x4b8959,_0x3db0fa){return function(_0x1887e3){if(!_0x1887e3){_0x4b8959['sendStatus'](0x194);}return _0x1887e3;};}function handleError(_0x12cc5b,_0x3211de){_0x3211de=_0x3211de||0x1f4;return function(_0x4f1900){logger[_0xa49e('0x26')](_0x4f1900[_0xa49e('0x27')]);if(_0x4f1900['name']){delete _0x4f1900[_0xa49e('0x28')];}_0x12cc5b[_0xa49e('0x1a')](_0x3211de)[_0xa49e('0x29')](_0x4f1900);};}exports[_0xa49e('0x2a')]=function(_0xa69d84,_0x36ac7f){var _0x4c517e={},_0x5b8ec4={},_0x3b79c6={'count':0x0,'rows':[]};var _0x46db45=_[_0xa49e('0x2b')](db[_0xa49e('0x2c')][_0xa49e('0x2d')],function(_0x5d72e1){return{'name':_0x5d72e1[_0xa49e('0x2e')],'type':_0x5d72e1[_0xa49e('0x2f')][_0xa49e('0x30')]};});_0x5b8ec4['model']=_[_0xa49e('0x2b')](_0x46db45,'name');_0x5b8ec4['query']=_['keys'](_0xa69d84[_0xa49e('0x31')]);_0x5b8ec4[_0xa49e('0x32')]=_['intersection'](_0x5b8ec4[_0xa49e('0x33')],_0x5b8ec4[_0xa49e('0x31')]);_0x4c517e[_0xa49e('0x34')]=_[_0xa49e('0x35')](_0x5b8ec4[_0xa49e('0x33')],qs['fields'](_0xa69d84[_0xa49e('0x31')]['fields']));_0x4c517e[_0xa49e('0x34')]=_0x4c517e[_0xa49e('0x34')][_0xa49e('0x36')]?_0x4c517e[_0xa49e('0x34')]:_0x5b8ec4[_0xa49e('0x33')];if(!_0xa69d84[_0xa49e('0x31')][_0xa49e('0x37')](_0xa49e('0x38'))){_0x4c517e[_0xa49e('0x1d')]=qs[_0xa49e('0x1d')](_0xa69d84[_0xa49e('0x31')]['limit']);_0x4c517e['offset']=qs[_0xa49e('0x1b')](_0xa69d84[_0xa49e('0x31')][_0xa49e('0x1b')]);}_0x4c517e['order']=qs[_0xa49e('0x39')](_0xa69d84['query'][_0xa49e('0x39')]);_0x4c517e[_0xa49e('0x3a')]=qs[_0xa49e('0x32')](_[_0xa49e('0x3b')](_0xa69d84[_0xa49e('0x31')],_0x5b8ec4[_0xa49e('0x32')]),_0x46db45);if(_0xa69d84[_0xa49e('0x31')][_0xa49e('0x3c')]){_0x4c517e['where']=_[_0xa49e('0x3d')](_0x4c517e[_0xa49e('0x3a')],{'$or':_[_0xa49e('0x2b')](_0x46db45,function(_0x40facb){if(_0x40facb[_0xa49e('0x2f')]!=='VIRTUAL'){var _0xfb4c5c={};_0xfb4c5c[_0x40facb[_0xa49e('0x28')]]={'$like':'%'+_0xa69d84['query'][_0xa49e('0x3c')]+'%'};return _0xfb4c5c;}})});}_0x4c517e=_[_0xa49e('0x3d')]({},_0x4c517e,_0xa69d84[_0xa49e('0x3e')]);var _0x48b0ad={'where':_0x4c517e[_0xa49e('0x3a')]};return db[_0xa49e('0x2c')]['count'](_0x48b0ad)[_0xa49e('0x24')](function(_0x5ad1d2){_0x3b79c6[_0xa49e('0x1e')]=_0x5ad1d2;if(_0xa69d84[_0xa49e('0x31')][_0xa49e('0x3f')]){_0x4c517e[_0xa49e('0x40')]=[{'all':!![]}];}return db[_0xa49e('0x2c')][_0xa49e('0x41')](_0x4c517e);})[_0xa49e('0x24')](function(_0x1efe98){_0x3b79c6[_0xa49e('0x42')]=_0x1efe98;return _0x3b79c6;})[_0xa49e('0x24')](respondWithFilteredResult(_0x36ac7f,_0x4c517e))[_0xa49e('0x43')](handleError(_0x36ac7f,null));};exports['show']=function(_0x1fd05b,_0x34db4d){var _0xe0814={'raw':!![],'where':{'id':_0x1fd05b[_0xa49e('0x44')]['id']}},_0x31f844={};_0x31f844[_0xa49e('0x33')]=_[_0xa49e('0x45')](db[_0xa49e('0x2c')][_0xa49e('0x2d')]);_0x31f844['query']=_['keys'](_0x1fd05b[_0xa49e('0x31')]);_0x31f844[_0xa49e('0x32')]=_[_0xa49e('0x35')](_0x31f844[_0xa49e('0x33')],_0x31f844[_0xa49e('0x31')]);_0xe0814[_0xa49e('0x34')]=_['intersection'](_0x31f844['model'],qs[_0xa49e('0x46')](_0x1fd05b['query'][_0xa49e('0x46')]));_0xe0814[_0xa49e('0x34')]=_0xe0814['attributes'][_0xa49e('0x36')]?_0xe0814[_0xa49e('0x34')]:_0x31f844[_0xa49e('0x33')];if(_0x1fd05b[_0xa49e('0x31')][_0xa49e('0x3f')]){_0xe0814['include']=[{'all':!![]}];}_0xe0814=_[_0xa49e('0x3d')]({},_0xe0814,_0x1fd05b[_0xa49e('0x3e')]);return db[_0xa49e('0x2c')][_0xa49e('0x47')](_0xe0814)[_0xa49e('0x24')](handleEntityNotFound(_0x34db4d,null))[_0xa49e('0x24')](respondWithResult(_0x34db4d,null))[_0xa49e('0x43')](handleError(_0x34db4d,null));};exports[_0xa49e('0x48')]=function(_0x22e0ba,_0x5f030f){return db['JscriptySessionReport'][_0xa49e('0x48')](_0x22e0ba['body'],{})[_0xa49e('0x24')](respondWithResult(_0x5f030f,0xc9))['catch'](handleError(_0x5f030f,null));};exports[_0xa49e('0x23')]=function(_0x4c1a36,_0x305a3d){if(_0x4c1a36['body']['id']){delete _0x4c1a36['body']['id'];}return db[_0xa49e('0x2c')]['find']({'where':{'id':_0x4c1a36['params']['id']}})[_0xa49e('0x24')](handleEntityNotFound(_0x305a3d,null))[_0xa49e('0x24')](saveUpdates(_0x4c1a36[_0xa49e('0x49')],null))[_0xa49e('0x24')](respondWithResult(_0x305a3d,null))[_0xa49e('0x43')](handleError(_0x305a3d,null));};exports[_0xa49e('0x25')]=function(_0x584da9,_0x220a65){return db[_0xa49e('0x2c')][_0xa49e('0x47')]({'where':{'id':_0x584da9['params']['id']}})[_0xa49e('0x24')](handleEntityNotFound(_0x220a65,null))[_0xa49e('0x24')](removeEntity(_0x220a65,null))[_0xa49e('0x43')](handleError(_0x220a65,null));};exports[_0xa49e('0x4a')]=function(_0x4f0bc5,_0x1fa18f){return db[_0xa49e('0x2c')][_0xa49e('0x4a')]()['then'](respondWithResult(_0x1fa18f,null))[_0xa49e('0x43')](handleError(_0x1fa18f,null));};exports[_0xa49e('0x4b')]=function(_0x57bc59,_0x23bd0e,_0x131318){var _0x1214cf={'raw':!![],'where':{}};var _0x270023={};var _0x308359={'count':0x0,'rows':[]};return db[_0xa49e('0x2c')][_0xa49e('0x4c')]({'where':{'id':_0x57bc59['params']['id']}})['then'](handleEntityNotFound(_0x23bd0e,null))['then'](function(_0x53e898){if(_0x53e898){_0x270023['model']=_[_0xa49e('0x45')](db[_0xa49e('0x4d')]['rawAttributes']);_0x270023[_0xa49e('0x31')]=_['keys'](_0x57bc59[_0xa49e('0x31')]);_0x270023[_0xa49e('0x32')]=_[_0xa49e('0x35')](_0x270023[_0xa49e('0x33')],_0x270023[_0xa49e('0x31')]);_0x1214cf['attributes']=_[_0xa49e('0x35')](_0x270023[_0xa49e('0x33')],qs[_0xa49e('0x46')](_0x57bc59[_0xa49e('0x31')][_0xa49e('0x46')]));_0x1214cf[_0xa49e('0x34')]=_0x1214cf[_0xa49e('0x34')]['length']?_0x1214cf[_0xa49e('0x34')]:_0x270023[_0xa49e('0x33')];if(!_0x57bc59[_0xa49e('0x31')][_0xa49e('0x37')](_0xa49e('0x38'))){_0x1214cf[_0xa49e('0x1d')]=qs[_0xa49e('0x1d')](_0x57bc59[_0xa49e('0x31')]['limit']);_0x1214cf['offset']=qs[_0xa49e('0x1b')](_0x57bc59[_0xa49e('0x31')][_0xa49e('0x1b')]);}_0x1214cf[_0xa49e('0x4e')]=qs['sort'](_0x57bc59[_0xa49e('0x31')][_0xa49e('0x39')]);_0x1214cf[_0xa49e('0x3a')]=qs[_0xa49e('0x32')](_['pick'](_0x57bc59[_0xa49e('0x31')],_0x270023[_0xa49e('0x32')]));_0x1214cf[_0xa49e('0x3a')][_0xa49e('0x4f')]=_0x53e898['id'];if(_0x57bc59['query'][_0xa49e('0x3c')]){_0x1214cf['where']=_['merge'](_0x1214cf[_0xa49e('0x3a')],{'$or':_[_0xa49e('0x2b')](_0x1214cf[_0xa49e('0x34')],function(_0x53c5b2){var _0x2731a3={};_0x2731a3[_0x53c5b2]={'$like':'%'+_0x57bc59[_0xa49e('0x31')][_0xa49e('0x3c')]+'%'};return _0x2731a3;})});}_0x1214cf=_[_0xa49e('0x3d')]({},_0x1214cf,_0x57bc59[_0xa49e('0x3e')]);return db[_0xa49e('0x4d')][_0xa49e('0x1e')]({'where':_0x1214cf['where']})[_0xa49e('0x24')](function(_0x29ac13){_0x308359[_0xa49e('0x1e')]=_0x29ac13;if(_0x57bc59[_0xa49e('0x31')]['includeAll']){_0x1214cf['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa49e('0x41')](_0x1214cf);})[_0xa49e('0x24')](function(_0x3f1b9e){_0x308359[_0xa49e('0x42')]=_0x3f1b9e;return _0x308359;});}})[_0xa49e('0x24')](respondWithFilteredResult(_0x23bd0e,_0x1214cf))[_0xa49e('0x43')](handleError(_0x23bd0e,null));};
\ No newline at end of file
+var _0xac04=['merge','find','create','body','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','length','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','error','name','index','map','rawAttributes','fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','JscriptySessionReport','includeAll','findAll','rows','catch','include'];(function(_0x4f431d,_0xd51a3b){var _0x4f31e1=function(_0x1c688d){while(--_0x1c688d){_0x4f431d['push'](_0x4f431d['shift']());}};_0x4f31e1(++_0xd51a3b);}(_0xac04,0x140));var _0x4ac0=function(_0x16f4ff,_0xb6dc74){_0x16f4ff=_0x16f4ff-0x0;var _0x248169=_0xac04[_0x16f4ff];return _0x248169;};'use strict';var emlformat=require(_0x4ac0('0x0'));var rimraf=require(_0x4ac0('0x1'));var zipdir=require(_0x4ac0('0x2'));var jsonpatch=require(_0x4ac0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ac0('0x4'));var Mustache=require(_0x4ac0('0x5'));var util=require(_0x4ac0('0x6'));var path=require(_0x4ac0('0x7'));var sox=require('sox');var csv=require(_0x4ac0('0x8'));var ejs=require(_0x4ac0('0x9'));var fs=require('fs');var fs_extra=require(_0x4ac0('0xa'));var _=require('lodash');var squel=require(_0x4ac0('0xb'));var crypto=require(_0x4ac0('0xc'));var jsforce=require(_0x4ac0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4ac0('0x8'));var querystring=require('querystring');var Papa=require(_0x4ac0('0xe'));var Redis=require(_0x4ac0('0xf'));var authService=require(_0x4ac0('0x10'));var qs=require(_0x4ac0('0x11'));var as=require(_0x4ac0('0x12'));var hardwareService=require(_0x4ac0('0x13'));var logger=require(_0x4ac0('0x14'))(_0x4ac0('0x15'));var utils=require(_0x4ac0('0x16'));var config=require(_0x4ac0('0x17'));var licenseUtil=require(_0x4ac0('0x18'));var db=require(_0x4ac0('0x19'))['db'];function respondWithStatusCode(_0x2a6a5c,_0x6e9365){_0x6e9365=_0x6e9365||0xcc;return function(_0x1a8fa5){if(_0x1a8fa5){return _0x2a6a5c[_0x4ac0('0x1a')](_0x6e9365);}return _0x2a6a5c[_0x4ac0('0x1b')](_0x6e9365)['end']();};}function respondWithResult(_0x154ff3,_0x3df4ed){_0x3df4ed=_0x3df4ed||0xc8;return function(_0x549e73){if(_0x549e73){return _0x154ff3['status'](_0x3df4ed)[_0x4ac0('0x1c')](_0x549e73);}};}function respondWithFilteredResult(_0x1e9ffb,_0x5ac3a4){return function(_0x2e7c4b){if(_0x2e7c4b){var _0x8645b5=typeof _0x5ac3a4[_0x4ac0('0x1d')]==='undefined'&&typeof _0x5ac3a4[_0x4ac0('0x1e')]===_0x4ac0('0x1f');var _0x3d0c75=_0x2e7c4b[_0x4ac0('0x20')];var _0x448966=_0x8645b5?0x0:_0x5ac3a4[_0x4ac0('0x1d')];var _0x25d825=_0x8645b5?_0x2e7c4b['count']:_0x5ac3a4['offset']+_0x5ac3a4[_0x4ac0('0x1e')];var _0x27794d;if(_0x25d825>=_0x3d0c75){_0x25d825=_0x3d0c75;_0x27794d=0xc8;}else{_0x27794d=0xce;}_0x1e9ffb[_0x4ac0('0x1b')](_0x27794d);return _0x1e9ffb['set'](_0x4ac0('0x21'),_0x448966+'-'+_0x25d825+'/'+_0x3d0c75)['json'](_0x2e7c4b);}return null;};}function patchUpdates(_0x4e015e){return function(_0x52e34f){try{jsonpatch['apply'](_0x52e34f,_0x4e015e,!![]);}catch(_0x2e950c){return BPromise[_0x4ac0('0x22')](_0x2e950c);}return _0x52e34f['save']();};}function saveUpdates(_0x580eda,_0x581e43){return function(_0x3550ac){if(_0x3550ac){return _0x3550ac[_0x4ac0('0x23')](_0x580eda)[_0x4ac0('0x24')](function(_0x280808){return _0x280808;});}return null;};}function removeEntity(_0xcd7447,_0x37d3db){return function(_0x5ddc8e){if(_0x5ddc8e){return _0x5ddc8e['destroy']()[_0x4ac0('0x24')](function(){_0xcd7447[_0x4ac0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50333c,_0x27fa84){return function(_0x28be08){if(!_0x28be08){_0x50333c[_0x4ac0('0x1a')](0x194);}return _0x28be08;};}function handleError(_0x196f1b,_0x369f9e){_0x369f9e=_0x369f9e||0x1f4;return function(_0x46223b){logger[_0x4ac0('0x25')](_0x46223b['stack']);if(_0x46223b[_0x4ac0('0x26')]){delete _0x46223b[_0x4ac0('0x26')];}_0x196f1b[_0x4ac0('0x1b')](_0x369f9e)['send'](_0x46223b);};}exports[_0x4ac0('0x27')]=function(_0x49134d,_0x6ba11){var _0x2c0118={},_0x352764={},_0x341917={'count':0x0,'rows':[]};var _0x4b9550=_[_0x4ac0('0x28')](db['JscriptySessionReport'][_0x4ac0('0x29')],function(_0x433068){return{'name':_0x433068[_0x4ac0('0x2a')],'type':_0x433068['type']['key']};});_0x352764['model']=_['map'](_0x4b9550,'name');_0x352764['query']=_[_0x4ac0('0x2b')](_0x49134d['query']);_0x352764[_0x4ac0('0x2c')]=_[_0x4ac0('0x2d')](_0x352764[_0x4ac0('0x2e')],_0x352764[_0x4ac0('0x2f')]);_0x2c0118[_0x4ac0('0x30')]=_['intersection'](_0x352764[_0x4ac0('0x2e')],qs[_0x4ac0('0x31')](_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x31')]));_0x2c0118['attributes']=_0x2c0118[_0x4ac0('0x30')]['length']?_0x2c0118[_0x4ac0('0x30')]:_0x352764[_0x4ac0('0x2e')];if(!_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x32')](_0x4ac0('0x33'))){_0x2c0118[_0x4ac0('0x1e')]=qs['limit'](_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x1e')]);_0x2c0118[_0x4ac0('0x1d')]=qs[_0x4ac0('0x1d')](_0x49134d[_0x4ac0('0x2f')]['offset']);}_0x2c0118[_0x4ac0('0x34')]=qs[_0x4ac0('0x35')](_0x49134d['query'][_0x4ac0('0x35')]);_0x2c0118[_0x4ac0('0x36')]=qs['filters'](_[_0x4ac0('0x37')](_0x49134d['query'],_0x352764[_0x4ac0('0x2c')]),_0x4b9550);if(_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x38')]){_0x2c0118['where']=_['merge'](_0x2c0118['where'],{'$or':_[_0x4ac0('0x28')](_0x4b9550,function(_0x1248ba){if(_0x1248ba[_0x4ac0('0x39')]!=='VIRTUAL'){var _0xf19014={};_0xf19014[_0x1248ba[_0x4ac0('0x26')]]={'$like':'%'+_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x38')]+'%'};return _0xf19014;}})});}_0x2c0118=_['merge']({},_0x2c0118,_0x49134d[_0x4ac0('0x3a')]);var _0x235cb1={'where':_0x2c0118[_0x4ac0('0x36')]};return db[_0x4ac0('0x3b')][_0x4ac0('0x20')](_0x235cb1)[_0x4ac0('0x24')](function(_0x19599b){_0x341917[_0x4ac0('0x20')]=_0x19599b;if(_0x49134d[_0x4ac0('0x2f')][_0x4ac0('0x3c')]){_0x2c0118['include']=[{'all':!![]}];}return db[_0x4ac0('0x3b')][_0x4ac0('0x3d')](_0x2c0118);})[_0x4ac0('0x24')](function(_0x3ffda3){_0x341917[_0x4ac0('0x3e')]=_0x3ffda3;return _0x341917;})[_0x4ac0('0x24')](respondWithFilteredResult(_0x6ba11,_0x2c0118))[_0x4ac0('0x3f')](handleError(_0x6ba11,null));};exports['show']=function(_0x252cd6,_0x28c5a0){var _0x19ef43={'raw':!![],'where':{'id':_0x252cd6['params']['id']}},_0xb502d2={};_0xb502d2[_0x4ac0('0x2e')]=_['keys'](db['JscriptySessionReport'][_0x4ac0('0x29')]);_0xb502d2[_0x4ac0('0x2f')]=_['keys'](_0x252cd6[_0x4ac0('0x2f')]);_0xb502d2[_0x4ac0('0x2c')]=_[_0x4ac0('0x2d')](_0xb502d2[_0x4ac0('0x2e')],_0xb502d2['query']);_0x19ef43['attributes']=_[_0x4ac0('0x2d')](_0xb502d2[_0x4ac0('0x2e')],qs['fields'](_0x252cd6['query'][_0x4ac0('0x31')]));_0x19ef43[_0x4ac0('0x30')]=_0x19ef43['attributes']['length']?_0x19ef43['attributes']:_0xb502d2[_0x4ac0('0x2e')];if(_0x252cd6['query'][_0x4ac0('0x3c')]){_0x19ef43[_0x4ac0('0x40')]=[{'all':!![]}];}_0x19ef43=_[_0x4ac0('0x41')]({},_0x19ef43,_0x252cd6[_0x4ac0('0x3a')]);return db[_0x4ac0('0x3b')][_0x4ac0('0x42')](_0x19ef43)[_0x4ac0('0x24')](handleEntityNotFound(_0x28c5a0,null))['then'](respondWithResult(_0x28c5a0,null))['catch'](handleError(_0x28c5a0,null));};exports[_0x4ac0('0x43')]=function(_0x8adac1,_0x47d726){return db[_0x4ac0('0x3b')]['create'](_0x8adac1[_0x4ac0('0x44')],{})[_0x4ac0('0x24')](respondWithResult(_0x47d726,0xc9))[_0x4ac0('0x3f')](handleError(_0x47d726,null));};exports['update']=function(_0x281f1e,_0x474768){if(_0x281f1e[_0x4ac0('0x44')]['id']){delete _0x281f1e[_0x4ac0('0x44')]['id'];}return db['JscriptySessionReport'][_0x4ac0('0x42')]({'where':{'id':_0x281f1e[_0x4ac0('0x45')]['id']}})[_0x4ac0('0x24')](handleEntityNotFound(_0x474768,null))[_0x4ac0('0x24')](saveUpdates(_0x281f1e[_0x4ac0('0x44')],null))['then'](respondWithResult(_0x474768,null))[_0x4ac0('0x3f')](handleError(_0x474768,null));};exports[_0x4ac0('0x46')]=function(_0x288168,_0x39cca0){return db[_0x4ac0('0x3b')][_0x4ac0('0x42')]({'where':{'id':_0x288168[_0x4ac0('0x45')]['id']}})[_0x4ac0('0x24')](handleEntityNotFound(_0x39cca0,null))[_0x4ac0('0x24')](removeEntity(_0x39cca0,null))['catch'](handleError(_0x39cca0,null));};exports[_0x4ac0('0x47')]=function(_0x542ee9,_0x1f8f49){return db[_0x4ac0('0x3b')][_0x4ac0('0x47')]()[_0x4ac0('0x24')](respondWithResult(_0x1f8f49,null))['catch'](handleError(_0x1f8f49,null));};exports[_0x4ac0('0x48')]=function(_0x27410b,_0x42ae16,_0x6a087f){var _0x8e32e6={'raw':!![],'where':{}};var _0x3b5750={};var _0x385f53={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4ac0('0x49')]({'where':{'id':_0x27410b[_0x4ac0('0x45')]['id']}})[_0x4ac0('0x24')](handleEntityNotFound(_0x42ae16,null))[_0x4ac0('0x24')](function(_0x562bc9){if(_0x562bc9){_0x3b5750['model']=_['keys'](db[_0x4ac0('0x4a')][_0x4ac0('0x29')]);_0x3b5750[_0x4ac0('0x2f')]=_[_0x4ac0('0x2b')](_0x27410b[_0x4ac0('0x2f')]);_0x3b5750[_0x4ac0('0x2c')]=_['intersection'](_0x3b5750[_0x4ac0('0x2e')],_0x3b5750['query']);_0x8e32e6[_0x4ac0('0x30')]=_[_0x4ac0('0x2d')](_0x3b5750[_0x4ac0('0x2e')],qs[_0x4ac0('0x31')](_0x27410b['query'][_0x4ac0('0x31')]));_0x8e32e6[_0x4ac0('0x30')]=_0x8e32e6[_0x4ac0('0x30')][_0x4ac0('0x4b')]?_0x8e32e6['attributes']:_0x3b5750[_0x4ac0('0x2e')];if(!_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x32')]('nolimit')){_0x8e32e6['limit']=qs[_0x4ac0('0x1e')](_0x27410b['query'][_0x4ac0('0x1e')]);_0x8e32e6[_0x4ac0('0x1d')]=qs[_0x4ac0('0x1d')](_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x1d')]);}_0x8e32e6['order']=qs[_0x4ac0('0x35')](_0x27410b[_0x4ac0('0x2f')]['sort']);_0x8e32e6['where']=qs[_0x4ac0('0x2c')](_[_0x4ac0('0x37')](_0x27410b[_0x4ac0('0x2f')],_0x3b5750[_0x4ac0('0x2c')]));_0x8e32e6[_0x4ac0('0x36')][_0x4ac0('0x4c')]=_0x562bc9['id'];if(_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x38')]){_0x8e32e6[_0x4ac0('0x36')]=_['merge'](_0x8e32e6[_0x4ac0('0x36')],{'$or':_[_0x4ac0('0x28')](_0x8e32e6[_0x4ac0('0x30')],function(_0x32ec36){var _0x363682={};_0x363682[_0x32ec36]={'$like':'%'+_0x27410b[_0x4ac0('0x2f')][_0x4ac0('0x38')]+'%'};return _0x363682;})});}_0x8e32e6=_[_0x4ac0('0x41')]({},_0x8e32e6,_0x27410b['options']);return db[_0x4ac0('0x4a')][_0x4ac0('0x20')]({'where':_0x8e32e6['where']})[_0x4ac0('0x24')](function(_0x11f526){_0x385f53[_0x4ac0('0x20')]=_0x11f526;if(_0x27410b['query'][_0x4ac0('0x3c')]){_0x8e32e6[_0x4ac0('0x40')]=[{'all':!![]}];}return db[_0x4ac0('0x4a')][_0x4ac0('0x3d')](_0x8e32e6);})[_0x4ac0('0x24')](function(_0x31cc1e){_0x385f53[_0x4ac0('0x3e')]=_0x31cc1e;return _0x385f53;});}})[_0x4ac0('0x24')](respondWithFilteredResult(_0x42ae16,_0x8e32e6))[_0x4ac0('0x3f')](handleError(_0x42ae16,null));};
\ No newline at end of file
index 8845097..02474d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['./jscriptySessionReport.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0xef17,0x136));var _0x7ef1=function(_0x12eb1f,_0x3de770){_0x12eb1f=_0x12eb1f-0x0;var _0x5c8a16=_0xef17[_0x12eb1f];return _0x5c8a16;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require(_0x7ef1('0x5'));var rp=require(_0x7ef1('0x6'));var fs=require('fs');var path=require(_0x7ef1('0x7'));var rimraf=require(_0x7ef1('0x8'));var config=require('../../config/environment');var attributes=require(_0x7ef1('0x9'));module['exports']=function(_0x138ed1,_0x498596){return _0x138ed1[_0x7ef1('0xa')]('JscriptySessionReport',attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd101=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd101,0xc1));var _0x1d10=function(_0x23fc42,_0x4f70f6){_0x23fc42=_0x23fc42-0x0;var _0x2743ee=_0xd101[_0x23fc42];return _0x2743ee;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./jscriptySessionReport.attributes');module[_0x1d10('0x9')]=function(_0x203072,_0x2a4e2d){return _0x203072[_0x1d10('0xa')](_0x1d10('0xb'),attributes,{'tableName':_0x1d10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e71a552..f831d4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0xabca41,_0xbfdf4a){var _0x404ccb=function(_0x11644b){while(--_0x11644b){_0xabca41['push'](_0xabca41['shift']());}};_0x404ccb(++_0xbfdf4a);}(_0x32f4,0x154));var _0x432f=function(_0xff2e73,_0x25a284){_0xff2e73=_0xff2e73-0x0;var _0x3729b6=_0x32f4[_0xff2e73];return _0x3729b6;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}
\ No newline at end of file
+var _0x4e2e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x7ed58b,_0x1bf233){var _0x2322db=function(_0x5b5787){while(--_0x5b5787){_0x7ed58b['push'](_0x7ed58b['shift']());}};_0x2322db(++_0x1bf233);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x26219f,_0x3207a2){_0x26219f=_0x26219f-0x0;var _0x20bed7=_0x4e2e[_0x26219f];return _0x20bed7;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}
\ No newline at end of file
index d4177e2..0c40e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a8=['fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports','util','path','express','Router'];(function(_0x45e928,_0x466d54){var _0x542ff2=function(_0x5f0f07){while(--_0x5f0f07){_0x45e928['push'](_0x45e928['shift']());}};_0x542ff2(++_0x466d54);}(_0xb7a8,0xec));var _0x8b7a=function(_0x2cb94d,_0x41a481){_0x2cb94d=_0x2cb94d-0x0;var _0x19ec1e=_0xb7a8[_0x2cb94d];return _0x19ec1e;};'use strict';var multer=require('multer');var util=require(_0x8b7a('0x0'));var path=require(_0x8b7a('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b7a('0x2'));var router=express[_0x8b7a('0x3')]();var fs_extra=require(_0x8b7a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var controller=require(_0x8b7a('0x7'));router[_0x8b7a('0x8')]('/',controller[_0x8b7a('0x9')]);router[_0x8b7a('0xa')](_0x8b7a('0xb'),auth[_0x8b7a('0xc')](),controller[_0x8b7a('0xd')]);module[_0x8b7a('0xe')]=router;
\ No newline at end of file
+var _0x8d0e=['./license.controller','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x581c23,_0x485718){var _0x2dea41=function(_0x16cfaa){while(--_0x16cfaa){_0x581c23['push'](_0x581c23['shift']());}};_0x2dea41(++_0x485718);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x281eaa,_0x453dd6){_0x281eaa=_0x281eaa-0x0;var _0x287af4=_0x8d0e[_0x281eaa];return _0x287af4;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',controller['index']);router[_0xe8d0('0xa')](_0xe8d0('0xb'),auth[_0xe8d0('0xc')](),controller[_0xe8d0('0xd')]);module[_0xe8d0('0xe')]=router;
\ No newline at end of file
index daefaf2..9201653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddeb=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x3bdd7f,_0x25fc7a){var _0xaf8cda=function(_0x5be72b){while(--_0x5be72b){_0x3bdd7f['push'](_0x3bdd7f['shift']());}};_0xaf8cda(++_0x25fc7a);}(_0xddeb,0x9a));var _0xbdde=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xddeb[_0x11e05d];return _0x335588;};'use strict';var Sequelize=require(_0xbdde('0x0'));module[_0xbdde('0x1')]={'license':{'type':Sequelize[_0xbdde('0x2')]},'data1':{'type':Sequelize[_0xbdde('0x3')]},'data2':{'type':Sequelize[_0xbdde('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xbdde('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x08d8=['exports','TEXT','INTEGER'];(function(_0x1df8b8,_0x25c2bb){var _0x5696db=function(_0xcf4ffb){while(--_0xcf4ffb){_0x1df8b8['push'](_0x1df8b8['shift']());}};_0x5696db(++_0x25c2bb);}(_0x08d8,0x99));var _0x808d=function(_0xca19df,_0xda79a5){_0xca19df=_0xca19df-0x0;var _0x512318=_0x08d8[_0xca19df];return _0x512318;};'use strict';var Sequelize=require('sequelize');module[_0x808d('0x0')]={'license':{'type':Sequelize[_0x808d('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x808d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 56a3daf..4d98479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','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'];(function(_0x58910b,_0x540685){var _0xfe1259=function(_0x41e447){while(--_0x41e447){_0x58910b['push'](_0x58910b['shift']());}};_0xfe1259(++_0x540685);}(_0x7a54,0x106));var _0x47a5=function(_0x58e891,_0x412456){_0x58e891=_0x58e891-0x0;var _0x44f501=_0x7a54[_0x58e891];return _0x44f501;};'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);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));};
\ No newline at end of file
+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(_0x1c9d4c,_0x37ff13){var _0x28e069=function(_0x3524b6){while(--_0x3524b6){_0x1c9d4c['push'](_0x1c9d4c['shift']());}};_0x28e069(++_0x37ff13);}(_0x4975,0x86));var _0x5497=function(_0x81e65e,_0x57cd6d){_0x81e65e=_0x81e65e-0x0;var _0x313776=_0x4975[_0x81e65e];return _0x313776;};'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
index 0a40372..c7823ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae86=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','License','license','lodash'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xae86,0x1a1));var _0x6ae8=function(_0x4f7fe0,_0x18201f){_0x4f7fe0=_0x4f7fe0-0x0;var _0x1e2851=_0xae86[_0x4f7fe0];return _0x1e2851;};'use strict';var _=require(_0x6ae8('0x0'));var util=require('util');var logger=require(_0x6ae8('0x1'))('api');var moment=require(_0x6ae8('0x2'));var BPromise=require(_0x6ae8('0x3'));var rp=require(_0x6ae8('0x4'));var fs=require('fs');var path=require(_0x6ae8('0x5'));var rimraf=require(_0x6ae8('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0x6ae8('0x7')]=function(_0xecfd5c,_0x2074d7){return _0xecfd5c[_0x6ae8('0x8')](_0x6ae8('0x9'),attributes,{'tableName':_0x6ae8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0833=['path','rimraf','../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0833,0x167));var _0x3083=function(_0x25ccdb,_0x207235){_0x25ccdb=_0x25ccdb-0x0;var _0x2bb45d=_0x0833[_0x25ccdb];return _0x2bb45d;};'use strict';var _=require(_0x3083('0x0'));var util=require(_0x3083('0x1'));var logger=require(_0x3083('0x2'))(_0x3083('0x3'));var moment=require('moment');var BPromise=require(_0x3083('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3083('0x5'));var rimraf=require(_0x3083('0x6'));var config=require(_0x3083('0x7'));var attributes=require(_0x3083('0x8'));module[_0x3083('0x9')]=function(_0x515284,_0x53c513){return _0x515284[_0x3083('0xa')](_0x3083('0xb'),attributes,{'tableName':_0x3083('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7761330..7b388c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x854e=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','info','catch'];(function(_0x2e5750,_0x2f194b){var _0x469393=function(_0x404efc){while(--_0x404efc){_0x2e5750['push'](_0x2e5750['shift']());}};_0x469393(++_0x2f194b);}(_0x854e,0x108));var _0xe854=function(_0xcfe9cb,_0x427934){_0xcfe9cb=_0xcfe9cb-0x0;var _0x163cd3=_0x854e[_0xcfe9cb];return _0x163cd3;};'use strict';var _=require('lodash');var util=require(_0xe854('0x0'));var moment=require(_0xe854('0x1'));var BPromise=require(_0xe854('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe854('0x3'));var db=require(_0xe854('0x4'))['db'];var utils=require(_0xe854('0x5'));var logger=require(_0xe854('0x6'))(_0xe854('0x7'));var config=require(_0xe854('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe854('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x598b71,_0x3e3b24,_0x33027e){return new BPromise(function(_0x3b8e8c,_0x2a6300){return client[_0xe854('0xa')](_0x598b71,_0x33027e)[_0xe854('0xb')](function(_0x4d8cc0){logger['info']('License,\x20%s,\x20%s',_0x3e3b24,_0xe854('0xc'));logger[_0xe854('0xd')](_0xe854('0xe'),_0x3e3b24,_0xe854('0xc'),JSON[_0xe854('0xf')](_0x4d8cc0));if(_0x4d8cc0[_0xe854('0x10')]){if(_0x4d8cc0[_0xe854('0x10')][_0xe854('0x11')]===0x1f4){logger[_0xe854('0x10')](_0xe854('0x12'),_0x3e3b24,_0x4d8cc0[_0xe854('0x10')][_0xe854('0x13')]);return _0x2a6300(_0x4d8cc0['error'][_0xe854('0x13')]);}logger[_0xe854('0x10')]('License,\x20%s,\x20%s',_0x3e3b24,_0x4d8cc0[_0xe854('0x10')][_0xe854('0x13')]);return _0x3b8e8c(_0x4d8cc0['error'][_0xe854('0x13')]);}else{logger[_0xe854('0x14')](_0xe854('0x12'),_0x3e3b24,_0xe854('0xc'));_0x3b8e8c(_0x4d8cc0['result'][_0xe854('0x13')]);}})[_0xe854('0x15')](function(_0x311391){logger[_0xe854('0x10')](_0xe854('0x12'),_0x3e3b24,_0x311391);_0x2a6300(_0x311391);});});}
\ No newline at end of file
+var _0xc259=['License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x405b0d,_0x5533a2){var _0x6ef51=function(_0x28fce0){while(--_0x28fce0){_0x405b0d['push'](_0x405b0d['shift']());}};_0x6ef51(++_0x5533a2);}(_0xc259,0x66));var _0x9c25=function(_0x45f062,_0x788c49){_0x45f062=_0x45f062-0x0;var _0xeb972=_0xc259[_0x45f062];return _0xeb972;};'use strict';var _=require('lodash');var util=require(_0x9c25('0x0'));var moment=require(_0x9c25('0x1'));var BPromise=require(_0x9c25('0x2'));var rs=require(_0x9c25('0x3'));var fs=require('fs');var Redis=require(_0x9c25('0x4'));var db=require(_0x9c25('0x5'))['db'];var utils=require(_0x9c25('0x6'));var logger=require(_0x9c25('0x7'))(_0x9c25('0x8'));var config=require(_0x9c25('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9c25('0xa')][_0x9c25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3dd956,_0x3380da,_0x129f6b){return new BPromise(function(_0x310f7b,_0x2ad92d){return client[_0x9c25('0xc')](_0x3dd956,_0x129f6b)[_0x9c25('0xd')](function(_0x5e9187){logger[_0x9c25('0xe')](_0x9c25('0xf'),_0x3380da,_0x9c25('0x10'));logger[_0x9c25('0x11')](_0x9c25('0x12'),_0x3380da,_0x9c25('0x10'),JSON['stringify'](_0x5e9187));if(_0x5e9187['error']){if(_0x5e9187[_0x9c25('0x13')][_0x9c25('0x14')]===0x1f4){logger[_0x9c25('0x13')](_0x9c25('0xf'),_0x3380da,_0x5e9187[_0x9c25('0x13')]['message']);return _0x2ad92d(_0x5e9187[_0x9c25('0x13')]['message']);}logger['error'](_0x9c25('0xf'),_0x3380da,_0x5e9187[_0x9c25('0x13')][_0x9c25('0x15')]);return _0x310f7b(_0x5e9187[_0x9c25('0x13')][_0x9c25('0x15')]);}else{logger[_0x9c25('0xe')](_0x9c25('0xf'),_0x3380da,'request\x20sent');_0x310f7b(_0x5e9187[_0x9c25('0x16')]['message']);}})[_0x9c25('0x17')](function(_0x44c762){logger[_0x9c25('0x13')]('License,\x20%s,\x20%s',_0x3380da,_0x44c762);_0x2ad92d(_0x44c762);});});}
\ No newline at end of file
index a2694a0..98daab2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe85a=['removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./mailAccount.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','/:id/users','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','addAgents','put','update','delete'];(function(_0x2fac71,_0x2ae81d){var _0x28cb27=function(_0x348dc6){while(--_0x348dc6){_0x2fac71['push'](_0x2fac71['shift']());}};_0x28cb27(++_0x2ae81d);}(_0xe85a,0x8f));var _0xae85=function(_0x2670de,_0x26fe87){_0x2670de=_0x2670de-0x0;var _0x5c6003=_0xe85a[_0x2670de];return _0x5c6003;};'use strict';var multer=require(_0xae85('0x0'));var util=require('util');var path=require(_0xae85('0x1'));var timeout=require(_0xae85('0x2'));var express=require(_0xae85('0x3'));var router=express[_0xae85('0x4')]();var fs_extra=require(_0xae85('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xae85('0x6'));var controller=require(_0xae85('0x7'));router[_0xae85('0x8')]('/',auth['isAuthenticated'](),controller[_0xae85('0x9')]);router[_0xae85('0x8')]('/describe',auth[_0xae85('0xa')](),controller[_0xae85('0xb')]);router[_0xae85('0x8')](_0xae85('0xc'),auth[_0xae85('0xa')](),controller[_0xae85('0xd')]);router['get'](_0xae85('0xe'),auth[_0xae85('0xa')](),controller[_0xae85('0xf')]);router['get'](_0xae85('0x10'),auth[_0xae85('0xa')](),controller[_0xae85('0x11')]);router[_0xae85('0x8')](_0xae85('0x12'),auth['isAuthenticated'](),controller[_0xae85('0x13')]);router[_0xae85('0x8')]('/:id/out_servers',auth[_0xae85('0xa')](),controller[_0xae85('0x14')]);router['get'](_0xae85('0x15'),auth[_0xae85('0xa')](),controller[_0xae85('0x16')]);router['get'](_0xae85('0x17'),auth['isAuthenticated'](),controller['getApplications']);router[_0xae85('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae85('0x18')]);router[_0xae85('0x8')](_0xae85('0x19'),auth[_0xae85('0xa')](),controller['verifySmtp']);router[_0xae85('0x8')](_0xae85('0x1a'),auth[_0xae85('0xa')](),controller['getAgents']);router[_0xae85('0x1b')](_0xae85('0xe'),auth[_0xae85('0xa')](),controller[_0xae85('0x1c')]);router[_0xae85('0x1b')](_0xae85('0x10'),auth[_0xae85('0xa')](),controller[_0xae85('0x1d')]);router['post']('/',auth[_0xae85('0xa')](),controller[_0xae85('0x1e')]);router[_0xae85('0x1b')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xae85('0x1f')]);router[_0xae85('0x1b')](_0xae85('0x20'),auth[_0xae85('0xa')](),controller[_0xae85('0x21')]);router[_0xae85('0x1b')](_0xae85('0x15'),auth[_0xae85('0xa')](),controller[_0xae85('0x22')]);router[_0xae85('0x1b')](_0xae85('0x17'),auth['isAuthenticated'](),controller[_0xae85('0x23')]);router[_0xae85('0x1b')](_0xae85('0x24'),auth[_0xae85('0xa')](),controller['send']);router['post'](_0xae85('0x1a'),auth[_0xae85('0xa')](),controller[_0xae85('0x25')]);router[_0xae85('0x26')](_0xae85('0xc'),auth[_0xae85('0xa')](),controller[_0xae85('0x27')]);router['delete'](_0xae85('0xe'),auth[_0xae85('0xa')](),controller['removeDispositions']);router[_0xae85('0x28')](_0xae85('0x10'),auth['isAuthenticated'](),controller[_0xae85('0x29')]);router['delete'](_0xae85('0x12'),auth['isAuthenticated'](),controller[_0xae85('0x2a')]);router[_0xae85('0x28')](_0xae85('0x20'),auth['isAuthenticated'](),controller[_0xae85('0x2b')]);router[_0xae85('0x28')](_0xae85('0xc'),auth[_0xae85('0xa')](),controller[_0xae85('0x2c')]);router['delete'](_0xae85('0x1a'),auth[_0xae85('0xa')](),controller[_0xae85('0x2d')]);module['exports']=router;
\ No newline at end of file
+var _0xde26=['/:id/messages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addApplications','/:id/send','addAgents','put','update','delete','/:id/dispositions','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x2a86bd,_0x2155e4){var _0x257408=function(_0x2c96e2){while(--_0x2c96e2){_0x2a86bd['push'](_0x2a86bd['shift']());}};_0x257408(++_0x2155e4);}(_0xde26,0xa9));var _0x6de2=function(_0x44d28c,_0x3a197b){_0x44d28c=_0x44d28c-0x0;var _0x754673=_0xde26[_0x44d28c];return _0x754673;};'use strict';var multer=require(_0x6de2('0x0'));var util=require(_0x6de2('0x1'));var path=require(_0x6de2('0x2'));var timeout=require(_0x6de2('0x3'));var express=require(_0x6de2('0x4'));var router=express['Router']();var fs_extra=require(_0x6de2('0x5'));var auth=require(_0x6de2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6de2('0x7'));var controller=require(_0x6de2('0x8'));router[_0x6de2('0x9')]('/',auth[_0x6de2('0xa')](),controller[_0x6de2('0xb')]);router['get'](_0x6de2('0xc'),auth[_0x6de2('0xa')](),controller[_0x6de2('0xd')]);router['get'](_0x6de2('0xe'),auth[_0x6de2('0xa')](),controller[_0x6de2('0xf')]);router[_0x6de2('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6de2('0x10')]);router[_0x6de2('0x9')](_0x6de2('0x11'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x12')]);router[_0x6de2('0x9')](_0x6de2('0x13'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x14')]);router[_0x6de2('0x9')](_0x6de2('0x15'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x16')]);router[_0x6de2('0x9')](_0x6de2('0x17'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x18')]);router[_0x6de2('0x9')](_0x6de2('0x19'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x1a')]);router[_0x6de2('0x9')](_0x6de2('0x1b'),auth[_0x6de2('0xa')](),controller['getMessages']);router[_0x6de2('0x9')](_0x6de2('0x1c'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x1d')]);router[_0x6de2('0x9')](_0x6de2('0x1e'),auth[_0x6de2('0xa')](),controller['getAgents']);router[_0x6de2('0x1f')]('/:id/dispositions',auth[_0x6de2('0xa')](),controller[_0x6de2('0x20')]);router['post'](_0x6de2('0x11'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x21')]);router['post']('/',auth[_0x6de2('0xa')](),controller[_0x6de2('0x22')]);router[_0x6de2('0x1f')](_0x6de2('0x13'),auth['isAuthenticated'](),controller['addImap']);router['post']('/:id/out_servers',auth[_0x6de2('0xa')](),controller['addSmtp']);router[_0x6de2('0x1f')](_0x6de2('0x17'),auth[_0x6de2('0xa')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x6de2('0x23')]);router['post'](_0x6de2('0x24'),auth[_0x6de2('0xa')](),controller['send']);router[_0x6de2('0x1f')](_0x6de2('0x1e'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x25')]);router[_0x6de2('0x26')](_0x6de2('0xe'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x27')]);router[_0x6de2('0x28')](_0x6de2('0x29'),auth[_0x6de2('0xa')](),controller[_0x6de2('0x2a')]);router[_0x6de2('0x28')](_0x6de2('0x11'),auth['isAuthenticated'](),controller[_0x6de2('0x2b')]);router[_0x6de2('0x28')]('/:id/in_servers',auth[_0x6de2('0xa')](),controller[_0x6de2('0x2c')]);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6de2('0x2d')]);router[_0x6de2('0x28')]('/:id',auth[_0x6de2('0xa')](),controller[_0x6de2('0x2e')]);router[_0x6de2('0x28')](_0x6de2('0x1e'),auth['isAuthenticated'](),controller[_0x6de2('0x2f')]);module[_0x6de2('0x30')]=router;
\ No newline at end of file
index 928a21a..c26f5be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xe0bd('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe0bd('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe0bd('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xe0bd('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe0bd('0x1')],'allowNull':![],'defaultValue':_0xe0bd('0x3')},'fontSize':{'type':Sequelize[_0xe0bd('0x4')](0x2)[_0xe0bd('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe0bd('0x6')],'defaultValue':function(){return _0xe0bd('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe0bd('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe0bd('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe0bd('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe0bd('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe0bd('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xe0bd('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x47f96d){if(!_0x47f96d)this[_0xe0bd('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xe0bd('0xa'),_0x47f96d);}}};
\ No newline at end of file
+var _0xfd7b=['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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports'];(function(_0x187ee1,_0x486fdd){var _0x174752=function(_0xd96a00){while(--_0xd96a00){_0x187ee1['push'](_0x187ee1['shift']());}};_0x174752(++_0x486fdd);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xfd7b[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require('sequelize');module[_0xbfd7('0x0')]={'description':{'type':Sequelize[_0xbfd7('0x1')]},'name':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbfd7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xbfd7('0x3')]},'markAsUnread':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbfd7('0x1')],'allowNull':![],'defaultValue':_0xbfd7('0x4')},'fontSize':{'type':Sequelize[_0xbfd7('0x5')](0x2)[_0xbfd7('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbfd7('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbfd7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbfd7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbfd7('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xbfd7('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x53ad21){if(!_0x53ad21)this[_0xbfd7('0x9')](_0xbfd7('0xa'),null);this[_0xbfd7('0x9')](_0xbfd7('0xb'),_0x53ad21);}}};
\ No newline at end of file
index 4fc4157..ec6f872 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31af=['secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','message','info','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','end','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','body','describe','addDisposition','getDispositions','findOne','rawAttributes','nolimit','order','MailAccountId','Disposition','removeDispositions','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','ids','ListId','isNil','active','description','cservice','cauthentication','cuser','password','pass','authentication','host','port','service','user','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Owner','Tags','color','tag','addApplications','transaction','MailApplication','priority','getApplications','getMessages','$gte','split','format','MailMessage','inlineCss','List','Contacts','updatedAt','DESC','from','attachments','server/files/attachments','basename','auth'];(function(_0x47322f,_0x35e6b4){var _0xef79d9=function(_0x357485){while(--_0x357485){_0x47322f['push'](_0x47322f['shift']());}};_0xef79d9(++_0x35e6b4);}(_0x31af,0xde));var _0xf31a=function(_0x5ab90f,_0x21dd3d){_0x5ab90f=_0x5ab90f-0x0;var _0x138331=_0x31af[_0x5ab90f];return _0x138331;};'use strict';var emlformat=require(_0xf31a('0x0'));var rimraf=require(_0xf31a('0x1'));var zipdir=require(_0xf31a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf31a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf31a('0x4'));var util=require(_0xf31a('0x5'));var path=require(_0xf31a('0x6'));var sox=require(_0xf31a('0x7'));var csv=require('to-csv');var ejs=require(_0xf31a('0x8'));var fs=require('fs');var fs_extra=require(_0xf31a('0x9'));var _=require(_0xf31a('0xa'));var squel=require(_0xf31a('0xb'));var crypto=require('crypto');var jsforce=require(_0xf31a('0xc'));var deskjs=require(_0xf31a('0xd'));var toCsv=require(_0xf31a('0xe'));var querystring=require(_0xf31a('0xf'));var Papa=require('papaparse');var htmlToText=require(_0xf31a('0x10'));var juice=require(_0xf31a('0x11'));var Redis=require(_0xf31a('0x12'));var authService=require(_0xf31a('0x13'));var qs=require(_0xf31a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf31a('0x15'));var logger=require(_0xf31a('0x16'))(_0xf31a('0x17'));var utils=require(_0xf31a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf31a('0x19'));var db=require(_0xf31a('0x1a'))['db'];config['redis']=_[_0xf31a('0x1b')](config[_0xf31a('0x1c')],{'host':_0xf31a('0x1d'),'port':0x18eb});var socket=require(_0xf31a('0x1e'))(new Redis(config[_0xf31a('0x1c')]));require(_0xf31a('0x1f'))[_0xf31a('0x20')](socket);var jayson=require(_0xf31a('0x21'));var client=jayson[_0xf31a('0x22')][_0xf31a('0x23')]({'port':0x232b});function respondWithRpcPromise(_0x6ea6f1,_0x1da226,_0x3439ba,_0xccfd8b){return new BPromise(function(_0x1429c8,_0x5c40bc){var _0x454836=_0xccfd8b||client;return _0x454836[_0xf31a('0x24')](_0x6ea6f1,_0x3439ba)[_0xf31a('0x25')](function(_0x3bff26){logger['info'](_0xf31a('0x26'),_0x1da226,_0xf31a('0x27'));logger[_0xf31a('0x28')](_0xf31a('0x29'),_0x1da226,_0xf31a('0x27'),JSON['stringify'](_0x3bff26));if(_0x3bff26[_0xf31a('0x2a')]){if(_0x3bff26[_0xf31a('0x2a')]['code']===0x1f4){logger[_0xf31a('0x2a')](_0xf31a('0x26'),_0x1da226,_0x3bff26['error'][_0xf31a('0x2b')]);return _0x5c40bc(_0x3bff26[_0xf31a('0x2a')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x1da226,_0x3bff26[_0xf31a('0x2a')][_0xf31a('0x2b')]);return _0x1429c8(_0x3bff26['error'][_0xf31a('0x2b')]);}else{logger[_0xf31a('0x2c')](_0xf31a('0x26'),_0x1da226,_0xf31a('0x27'));_0x1429c8(_0x3bff26['result']['message']);}})[_0xf31a('0x2d')](function(_0x714292){logger['error']('MailAccount,\x20%s,\x20%s',_0x1da226,_0x714292);_0x5c40bc(_0x714292);});});}function respondWithStatusCode(_0x59114a,_0x531179){_0x531179=_0x531179||0xcc;return function(_0x14c82e){if(_0x14c82e){return _0x59114a[_0xf31a('0x2e')](_0x531179);}return _0x59114a[_0xf31a('0x2f')](_0x531179)['end']();};}function respondWithResult(_0x2281c5,_0x2ace06){_0x2ace06=_0x2ace06||0xc8;return function(_0x125e98){if(_0x125e98){return _0x2281c5[_0xf31a('0x2f')](_0x2ace06)[_0xf31a('0x30')](_0x125e98);}};}function respondWithFilteredResult(_0x5a55c6,_0xed9bfd){return function(_0x2ebc27){if(_0x2ebc27){var _0x52f8aa=typeof _0xed9bfd['offset']===_0xf31a('0x31')&&typeof _0xed9bfd[_0xf31a('0x32')]==='undefined';var _0x1bcfe6=_0x2ebc27[_0xf31a('0x33')];var _0x2f739c=_0x52f8aa?0x0:_0xed9bfd['offset'];var _0x1d4d9b=_0x52f8aa?_0x2ebc27[_0xf31a('0x33')]:_0xed9bfd[_0xf31a('0x34')]+_0xed9bfd[_0xf31a('0x32')];var _0xbddc3b;if(_0x1d4d9b>=_0x1bcfe6){_0x1d4d9b=_0x1bcfe6;_0xbddc3b=0xc8;}else{_0xbddc3b=0xce;}_0x5a55c6[_0xf31a('0x2f')](_0xbddc3b);return _0x5a55c6['set'](_0xf31a('0x35'),_0x2f739c+'-'+_0x1d4d9b+'/'+_0x1bcfe6)[_0xf31a('0x30')](_0x2ebc27);}return null;};}function patchUpdates(_0x10c1f3){return function(_0xba7cdc){try{jsonpatch[_0xf31a('0x36')](_0xba7cdc,_0x10c1f3,!![]);}catch(_0x42d1a6){return BPromise[_0xf31a('0x37')](_0x42d1a6);}return _0xba7cdc[_0xf31a('0x38')]();};}function saveUpdates(_0x17c5dc,_0x137ea4){return function(_0x441838){if(_0x441838){return _0x441838[_0xf31a('0x39')](_0x17c5dc)[_0xf31a('0x25')](function(_0x25cd42){return _0x25cd42;});}return null;};}function removeEntity(_0x3146b1,_0x33c6c0){return function(_0x11c817){if(_0x11c817){return _0x11c817[_0xf31a('0x3a')]()[_0xf31a('0x25')](function(){var _0x53b42c=_0x11c817[_0xf31a('0x3b')]({'plain':!![]});var _0x39ccea=_0xf31a('0x3c');return db[_0xf31a('0x3d')][_0xf31a('0x3a')]({'where':{'type':_0x39ccea,'resourceId':_0x53b42c['id']}})['then'](function(){return _0x11c817;});})[_0xf31a('0x25')](function(){_0x3146b1[_0xf31a('0x2f')](0xcc)[_0xf31a('0x3e')]();});}};}function handleEntityNotFound(_0x5820e6,_0x474cfc){return function(_0xe333de){if(!_0xe333de){_0x5820e6[_0xf31a('0x2e')](0x194);}return _0xe333de;};}function handleError(_0x60f807,_0x11b3af){_0x11b3af=_0x11b3af||0x1f4;return function(_0x59ef5b){logger[_0xf31a('0x2a')](_0x59ef5b['stack']);if(_0x59ef5b[_0xf31a('0x3f')]){delete _0x59ef5b[_0xf31a('0x3f')];}_0x60f807['status'](_0x11b3af)[_0xf31a('0x40')](_0x59ef5b);};}exports[_0xf31a('0x41')]=function(_0x1d2f3c,_0x481d92){var _0x5d1176={'include':[{'model':db[_0xf31a('0x42')],'as':_0xf31a('0x43')},{'model':db[_0xf31a('0x44')],'as':_0xf31a('0x45')},{'model':db[_0xf31a('0x46')],'as':_0xf31a('0x47')}]},_0x2010f8={},_0x1f41f5={'count':0x0,'rows':[]};var _0x5ae1f2=_[_0xf31a('0x48')](db[_0xf31a('0x49')]['rawAttributes'],function(_0x7e6eff){return{'name':_0x7e6eff[_0xf31a('0x4a')],'type':_0x7e6eff[_0xf31a('0x4b')][_0xf31a('0x4c')]};});_0x2010f8['model']=_[_0xf31a('0x48')](_0x5ae1f2,_0xf31a('0x3f'));_0x2010f8[_0xf31a('0x4d')]=_[_0xf31a('0x4e')](_0x1d2f3c['query']);_0x2010f8[_0xf31a('0x4f')]=_['intersection'](_0x2010f8[_0xf31a('0x50')],_0x2010f8[_0xf31a('0x4d')]);_0x5d1176[_0xf31a('0x51')]=_['intersection'](_0x2010f8[_0xf31a('0x50')],qs['fields'](_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x52')]));_0x5d1176[_0xf31a('0x51')]=_0x5d1176[_0xf31a('0x51')][_0xf31a('0x53')]?_0x5d1176[_0xf31a('0x51')]:_0x2010f8[_0xf31a('0x50')];if(!_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x54')]('nolimit')){_0x5d1176[_0xf31a('0x32')]=qs[_0xf31a('0x32')](_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x32')]);_0x5d1176[_0xf31a('0x34')]=qs[_0xf31a('0x34')](_0x1d2f3c[_0xf31a('0x4d')]['offset']);}_0x5d1176['order']=qs[_0xf31a('0x55')](_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x55')]);_0x5d1176[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_[_0xf31a('0x57')](_0x1d2f3c['query'],_0x2010f8[_0xf31a('0x4f')]),_0x5ae1f2);if(_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x5d1176[_0xf31a('0x56')]=_[_0xf31a('0x59')](_0x5d1176[_0xf31a('0x56')],{'$or':_['map'](_0x5ae1f2,function(_0x2f7c24){if(_0x2f7c24[_0xf31a('0x4b')]!==_0xf31a('0x5a')){var _0xf2ee9a={};_0xf2ee9a[_0x2f7c24[_0xf31a('0x3f')]]={'$like':'%'+_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x58')]+'%'};return _0xf2ee9a;}})});}_0x5d1176=_[_0xf31a('0x59')]({},_0x5d1176,_0x1d2f3c[_0xf31a('0x5b')]);var _0x261f93={'where':_0x5d1176['where']};return db[_0xf31a('0x49')]['count'](_0x261f93)[_0xf31a('0x25')](function(_0x3f8b9b){_0x1f41f5[_0xf31a('0x33')]=_0x3f8b9b;if(_0x1d2f3c[_0xf31a('0x4d')][_0xf31a('0x5c')]){_0x5d1176[_0xf31a('0x5d')]=[{'all':!![]}];}return db[_0xf31a('0x49')][_0xf31a('0x5e')](_0x5d1176);})['then'](function(_0x4c2d6e){_0x1f41f5[_0xf31a('0x5f')]=_0x4c2d6e;return _0x1f41f5;})[_0xf31a('0x25')](respondWithFilteredResult(_0x481d92,_0x5d1176))[_0xf31a('0x2d')](handleError(_0x481d92,null));};exports[_0xf31a('0x60')]=function(_0x8c6795,_0x4d21ed){var _0xb3c85c={'raw':![],'where':{'id':_0x8c6795[_0xf31a('0x61')]['id']},'include':[{'model':db[_0xf31a('0x42')],'as':_0xf31a('0x43')},{'model':db[_0xf31a('0x44')],'as':_0xf31a('0x45')},{'model':db[_0xf31a('0x46')],'as':_0xf31a('0x47')}]},_0x3c971f={};_0x3c971f[_0xf31a('0x50')]=_[_0xf31a('0x4e')](db[_0xf31a('0x49')]['rawAttributes']);_0x3c971f[_0xf31a('0x4d')]=_[_0xf31a('0x4e')](_0x8c6795[_0xf31a('0x4d')]);_0x3c971f['filters']=_[_0xf31a('0x62')](_0x3c971f['model'],_0x3c971f[_0xf31a('0x4d')]);_0xb3c85c[_0xf31a('0x51')]=_[_0xf31a('0x62')](_0x3c971f[_0xf31a('0x50')],qs['fields'](_0x8c6795[_0xf31a('0x4d')][_0xf31a('0x52')]));_0xb3c85c[_0xf31a('0x51')]=_0xb3c85c[_0xf31a('0x51')][_0xf31a('0x53')]?_0xb3c85c[_0xf31a('0x51')]:_0x3c971f['model'];if(_0x8c6795[_0xf31a('0x4d')]['includeAll']){_0xb3c85c['include']=[{'all':!![]}];}_0xb3c85c=_['merge']({},_0xb3c85c,_0x8c6795[_0xf31a('0x5b')]);return db[_0xf31a('0x49')][_0xf31a('0x63')](_0xb3c85c)['then'](handleEntityNotFound(_0x4d21ed,null))[_0xf31a('0x25')](respondWithResult(_0x4d21ed,null))[_0xf31a('0x2d')](handleError(_0x4d21ed,null));};exports[_0xf31a('0x39')]=function(_0x4bc18c,_0x4b9586){if(_0x4bc18c[_0xf31a('0x64')]['id']){delete _0x4bc18c[_0xf31a('0x64')]['id'];}return db[_0xf31a('0x49')][_0xf31a('0x63')]({'where':{'id':_0x4bc18c[_0xf31a('0x61')]['id']},'include':[{'model':db[_0xf31a('0x42')],'as':'Imap'},{'model':db[_0xf31a('0x44')],'as':'Smtp'},{'model':db[_0xf31a('0x46')],'as':_0xf31a('0x47')}]})[_0xf31a('0x25')](handleEntityNotFound(_0x4b9586,null))['then'](saveUpdates(_0x4bc18c[_0xf31a('0x64')],null))[_0xf31a('0x25')](function(_0x24be18){if(_0x24be18&&_0x4bc18c[_0xf31a('0x64')][_0xf31a('0x43')]){return db[_0xf31a('0x42')][_0xf31a('0x39')](_0x4bc18c[_0xf31a('0x64')]['Imap'],{'where':{'MailAccountId':_0x24be18['id']}})[_0xf31a('0x25')](function(){return _0x24be18;});}return _0x24be18;})['then'](function(_0x29aeb9){if(_0x29aeb9&&_0x4bc18c['body'][_0xf31a('0x45')]){return db[_0xf31a('0x44')][_0xf31a('0x39')](_0x4bc18c[_0xf31a('0x64')]['Smtp'],{'where':{'MailAccountId':_0x29aeb9['id']}})[_0xf31a('0x25')](function(){return _0x29aeb9;});}return _0x29aeb9;})[_0xf31a('0x25')](respondWithResult(_0x4b9586,null))[_0xf31a('0x2d')](handleError(_0x4b9586,null));};exports[_0xf31a('0x65')]=function(_0x33dd58,_0x2b960b){return db[_0xf31a('0x49')][_0xf31a('0x65')]()[_0xf31a('0x25')](respondWithResult(_0x2b960b,null))[_0xf31a('0x2d')](handleError(_0x2b960b,null));};exports[_0xf31a('0x66')]=function(_0x776ec7,_0x41f206,_0x5a2636){if(_0x776ec7[_0xf31a('0x64')]['id']){delete _0x776ec7[_0xf31a('0x64')]['id'];}return db['MailAccount'][_0xf31a('0x63')]({'where':{'id':_0x776ec7[_0xf31a('0x61')]['id']}})['then'](handleEntityNotFound(_0x41f206,null))[_0xf31a('0x25')](function(_0x1a79f7){if(_0x1a79f7){_0x776ec7['body']['MailAccountId']=_0x1a79f7['id'];return db['Disposition']['create'](_0x776ec7[_0xf31a('0x64')]);}})[_0xf31a('0x25')](respondWithResult(_0x41f206,null))[_0xf31a('0x2d')](handleError(_0x41f206,null));};exports[_0xf31a('0x67')]=function(_0x5e4b8b,_0x1789d3,_0x560b8d){var _0x35d70f={'raw':![],'where':{}};var _0x46af00={};var _0x12e5a1={'count':0x0,'rows':[]};return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x5e4b8b[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x1789d3,null))[_0xf31a('0x25')](function(_0x2989d4){if(_0x2989d4){_0x46af00['model']=_[_0xf31a('0x4e')](db['Disposition'][_0xf31a('0x69')]);_0x46af00[_0xf31a('0x4d')]=_['keys'](_0x5e4b8b['query']);_0x46af00['filters']=_[_0xf31a('0x62')](_0x46af00['model'],_0x46af00[_0xf31a('0x4d')]);_0x35d70f[_0xf31a('0x51')]=_['intersection'](_0x46af00[_0xf31a('0x50')],qs[_0xf31a('0x52')](_0x5e4b8b['query']['fields']));_0x35d70f[_0xf31a('0x51')]=_0x35d70f['attributes'][_0xf31a('0x53')]?_0x35d70f[_0xf31a('0x51')]:_0x46af00['model'];if(!_0x5e4b8b['query'][_0xf31a('0x54')](_0xf31a('0x6a'))){_0x35d70f[_0xf31a('0x32')]=qs[_0xf31a('0x32')](_0x5e4b8b['query']['limit']);_0x35d70f[_0xf31a('0x34')]=qs['offset'](_0x5e4b8b['query']['offset']);}_0x35d70f[_0xf31a('0x6b')]=qs['sort'](_0x5e4b8b[_0xf31a('0x4d')][_0xf31a('0x55')]);_0x35d70f[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_[_0xf31a('0x57')](_0x5e4b8b[_0xf31a('0x4d')],_0x46af00[_0xf31a('0x4f')]));_0x35d70f[_0xf31a('0x56')][_0xf31a('0x6c')]=_0x2989d4['id'];if(_0x5e4b8b[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x35d70f['where']=_[_0xf31a('0x59')](_0x35d70f['where'],{'$or':_['map'](_0x35d70f[_0xf31a('0x51')],function(_0x70c848){var _0x31503d={};_0x31503d[_0x70c848]={'$like':'%'+_0x5e4b8b[_0xf31a('0x4d')][_0xf31a('0x58')]+'%'};return _0x31503d;})});}_0x35d70f=_[_0xf31a('0x59')]({},_0x35d70f,_0x5e4b8b[_0xf31a('0x5b')]);return db[_0xf31a('0x6d')]['count']({'where':_0x35d70f[_0xf31a('0x56')]})[_0xf31a('0x25')](function(_0x15c163){_0x12e5a1['count']=_0x15c163;if(_0x5e4b8b[_0xf31a('0x4d')][_0xf31a('0x5c')]){_0x35d70f['include']=[{'all':!![]}];}return db[_0xf31a('0x6d')][_0xf31a('0x5e')](_0x35d70f);})[_0xf31a('0x25')](function(_0x195284){_0x12e5a1[_0xf31a('0x5f')]=_0x195284;return _0x12e5a1;});}})[_0xf31a('0x25')](respondWithFilteredResult(_0x1789d3,_0x35d70f))['catch'](handleError(_0x1789d3,null));};exports[_0xf31a('0x6e')]=function(_0x3caffa,_0x214e7c,_0x372c06){return db['MailAccount']['find']({'where':{'id':_0x3caffa[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x214e7c,null))[_0xf31a('0x25')](function(_0xa88690){if(_0xa88690){return _0xa88690[_0xf31a('0x6e')](_0x3caffa[_0xf31a('0x4d')]['ids']);}})[_0xf31a('0x25')](respondWithStatusCode(_0x214e7c,null))[_0xf31a('0x2d')](handleError(_0x214e7c,null));};exports[_0xf31a('0x6f')]=function(_0xba3819,_0x1390f9,_0x35f4f7){if(_0xba3819[_0xf31a('0x64')]['id']){delete _0xba3819[_0xf31a('0x64')]['id'];}return db['MailAccount']['find']({'where':{'id':_0xba3819['params']['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x1390f9,null))[_0xf31a('0x25')](function(_0x2c0c1c){if(_0x2c0c1c){_0xba3819['body'][_0xf31a('0x6c')]=_0x2c0c1c['id'];return db[_0xf31a('0x70')][_0xf31a('0x71')](_0xba3819[_0xf31a('0x64')]);}})['then'](respondWithResult(_0x1390f9,null))['catch'](handleError(_0x1390f9,null));};exports[_0xf31a('0x72')]=function(_0x5ba20d,_0x2fccce,_0x574c84){var _0x416842={'raw':![],'where':{}};var _0x3be964={};var _0x116d61={'count':0x0,'rows':[]};return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x5ba20d['params']['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x2fccce,null))[_0xf31a('0x25')](function(_0x800262){if(_0x800262){_0x3be964['model']=_[_0xf31a('0x4e')](db[_0xf31a('0x70')][_0xf31a('0x69')]);_0x3be964['query']=_[_0xf31a('0x4e')](_0x5ba20d[_0xf31a('0x4d')]);_0x3be964[_0xf31a('0x4f')]=_[_0xf31a('0x62')](_0x3be964['model'],_0x3be964[_0xf31a('0x4d')]);_0x416842[_0xf31a('0x51')]=_['intersection'](_0x3be964['model'],qs[_0xf31a('0x52')](_0x5ba20d[_0xf31a('0x4d')]['fields']));_0x416842[_0xf31a('0x51')]=_0x416842['attributes'][_0xf31a('0x53')]?_0x416842[_0xf31a('0x51')]:_0x3be964[_0xf31a('0x50')];if(!_0x5ba20d['query'][_0xf31a('0x54')](_0xf31a('0x6a'))){_0x416842[_0xf31a('0x32')]=qs[_0xf31a('0x32')](_0x5ba20d[_0xf31a('0x4d')][_0xf31a('0x32')]);_0x416842[_0xf31a('0x34')]=qs['offset'](_0x5ba20d['query']['offset']);}_0x416842[_0xf31a('0x6b')]=qs[_0xf31a('0x55')](_0x5ba20d[_0xf31a('0x4d')][_0xf31a('0x55')]);_0x416842[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_[_0xf31a('0x57')](_0x5ba20d[_0xf31a('0x4d')],_0x3be964[_0xf31a('0x4f')]));_0x416842['where'][_0xf31a('0x6c')]=_0x800262['id'];if(_0x5ba20d[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x416842[_0xf31a('0x56')]=_[_0xf31a('0x59')](_0x416842[_0xf31a('0x56')],{'$or':_[_0xf31a('0x48')](_0x416842[_0xf31a('0x51')],function(_0x168ebe){var _0x1af943={};_0x1af943[_0x168ebe]={'$like':'%'+_0x5ba20d[_0xf31a('0x4d')][_0xf31a('0x58')]+'%'};return _0x1af943;})});}_0x416842=_[_0xf31a('0x59')]({},_0x416842,_0x5ba20d['options']);return db[_0xf31a('0x70')][_0xf31a('0x33')]({'where':_0x416842['where']})[_0xf31a('0x25')](function(_0x45908a){_0x116d61[_0xf31a('0x33')]=_0x45908a;if(_0x5ba20d[_0xf31a('0x4d')]['includeAll']){_0x416842['include']=[{'all':!![]}];}return db[_0xf31a('0x70')][_0xf31a('0x5e')](_0x416842);})[_0xf31a('0x25')](function(_0x22f6e1){_0x116d61[_0xf31a('0x5f')]=_0x22f6e1;return _0x116d61;});}})['then'](respondWithFilteredResult(_0x2fccce,_0x416842))['catch'](handleError(_0x2fccce,null));};exports['removeAnswers']=function(_0x46d39a,_0x3c4af9,_0x42bd49){return db[_0xf31a('0x49')][_0xf31a('0x63')]({'where':{'id':_0x46d39a[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x3c4af9,null))[_0xf31a('0x25')](function(_0x20e4fc){if(_0x20e4fc){return _0x20e4fc[_0xf31a('0x73')](_0x46d39a[_0xf31a('0x4d')][_0xf31a('0x74')]);}})[_0xf31a('0x25')](respondWithStatusCode(_0x3c4af9,null))['catch'](handleError(_0x3c4af9,null));};exports[_0xf31a('0x71')]=function(_0x1452e0,_0x4a3959){var _0x4c79bd={'name':_0x1452e0['body'][_0xf31a('0x3f')],'key':_0x1452e0[_0xf31a('0x64')]['key'],'email':_0x1452e0[_0xf31a('0x64')]['email'],'ListId':_0x1452e0[_0xf31a('0x64')][_0xf31a('0x75')],'active':!_[_0xf31a('0x76')](_0x1452e0['body'][_0xf31a('0x77')])?_0x1452e0[_0xf31a('0x64')][_0xf31a('0x77')]:!![],'description':_0x1452e0['body'][_0xf31a('0x78')]||null,'Imap':{},'Smtp':{}};if(_[_0xf31a('0x76')](_0x1452e0['body'][_0xf31a('0x79')])){if(_0x1452e0[_0xf31a('0x64')][_0xf31a('0x7a')]){_0x4c79bd['Imap']['user']=_0x4c79bd[_0xf31a('0x45')]['user']=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x7b')];_0x4c79bd['Imap'][_0xf31a('0x7c')]=_0x4c79bd[_0xf31a('0x45')][_0xf31a('0x7d')]=_0x1452e0['body']['cpassword'];}else{_0x4c79bd[_0xf31a('0x43')]['authentication']=_0x4c79bd[_0xf31a('0x45')][_0xf31a('0x7e')]=![];}_0x4c79bd['Imap'][_0xf31a('0x7f')]=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x43')][_0xf31a('0x7f')];_0x4c79bd[_0xf31a('0x43')][_0xf31a('0x80')]=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x43')]['port'];_0x4c79bd[_0xf31a('0x45')][_0xf31a('0x7f')]=_0x1452e0[_0xf31a('0x64')]['Smtp']['host'];_0x4c79bd[_0xf31a('0x45')][_0xf31a('0x80')]=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x45')]['port'];}else{_0x4c79bd[_0xf31a('0x43')]['service']=_0x4c79bd[_0xf31a('0x45')][_0xf31a('0x81')]=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x79')];_0x4c79bd['Imap'][_0xf31a('0x82')]=_0x4c79bd['Smtp'][_0xf31a('0x82')]=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x7b')];_0x4c79bd[_0xf31a('0x43')][_0xf31a('0x7c')]=_0x4c79bd['Smtp'][_0xf31a('0x7d')]=_0x1452e0[_0xf31a('0x64')][_0xf31a('0x83')];}return db['MailAccount'][_0xf31a('0x71')](_0x4c79bd,{'include':[{'model':db[_0xf31a('0x44')],'as':_0xf31a('0x45')},{'model':db[_0xf31a('0x42')],'as':'Imap'}]})[_0xf31a('0x25')](function(_0x2bb68e){var _0x4f1f22=_0x1452e0['user']['get']({'plain':!![]});if(!_0x4f1f22)throw new Error(_0xf31a('0x84'));if(_0x4f1f22[_0xf31a('0x85')]===_0xf31a('0x82')){var _0x60f759=_0x2bb68e[_0xf31a('0x3b')]({'plain':!![]});return db['UserProfileSection'][_0xf31a('0x63')]({'where':{'name':_0xf31a('0x3c'),'userProfileId':_0x4f1f22[_0xf31a('0x86')]},'raw':!![]})['then'](function(_0xcac525){if(_0xcac525&&_0xcac525[_0xf31a('0x87')]===0x0){return db[_0xf31a('0x3d')][_0xf31a('0x71')]({'name':_0x60f759['name'],'resourceId':_0x60f759['id'],'type':_0xcac525['name'],'sectionId':_0xcac525['id']},{})['then'](function(){return _0x2bb68e;});}else{return _0x2bb68e;}})[_0xf31a('0x2d')](function(_0x35ec27){logger['error'](_0xf31a('0x88'),_0x35ec27);throw _0x35ec27;});}return _0x2bb68e;})[_0xf31a('0x25')](respondWithResult(_0x4a3959,0xc9))[_0xf31a('0x2d')](handleError(_0x4a3959,null));};exports[_0xf31a('0x89')]=function(_0x52c604,_0xe2565f,_0x10b33b){return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x52c604[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0xe2565f,null))[_0xf31a('0x25')](function(_0x30495f){if(_0x30495f){return _0x30495f['getImap']();}return null;})[_0xf31a('0x25')](respondWithResult(_0xe2565f,null))[_0xf31a('0x2d')](handleError(_0xe2565f,null));};exports[_0xf31a('0x8a')]=function(_0x4a4945,_0x3b8180,_0x6d6166){if(_0x4a4945[_0xf31a('0x64')]['id']){delete _0x4a4945[_0xf31a('0x64')]['id'];}return db['MailAccount'][_0xf31a('0x63')]({'where':{'id':_0x4a4945[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x3b8180,null))[_0xf31a('0x25')](function(_0x5fa7c9){if(_0x5fa7c9){_0x4a4945['body']['MailAccountId']=_0x5fa7c9['id'];return db[_0xf31a('0x42')][_0xf31a('0x71')](_0x4a4945[_0xf31a('0x64')]);}})[_0xf31a('0x25')](respondWithResult(_0x3b8180,null))[_0xf31a('0x2d')](handleError(_0x3b8180,null));};exports[_0xf31a('0x8b')]=function(_0x1221a2,_0x2cf7ee,_0x5a5d5e){return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x1221a2[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x2cf7ee,null))[_0xf31a('0x25')](function(_0x5112af){if(_0x5112af){return _0x5112af[_0xf31a('0x8c')](null);}return null;})[_0xf31a('0x25')](respondWithStatusCode(_0x2cf7ee,null))[_0xf31a('0x2d')](handleError(_0x2cf7ee,null));};exports[_0xf31a('0x8d')]=function(_0x312fdf,_0x2ae2c,_0x576a2b){return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x312fdf[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x2ae2c,null))[_0xf31a('0x25')](function(_0x4f7db0){if(_0x4f7db0){return _0x4f7db0[_0xf31a('0x8d')]();}return null;})[_0xf31a('0x25')](respondWithResult(_0x2ae2c,null))[_0xf31a('0x2d')](handleError(_0x2ae2c,null));};exports[_0xf31a('0x8e')]=function(_0xe44d45,_0x32837f,_0x5cf887){if(_0xe44d45['body']['id']){delete _0xe44d45[_0xf31a('0x64')]['id'];}return db[_0xf31a('0x49')]['find']({'where':{'id':_0xe44d45[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x32837f,null))[_0xf31a('0x25')](function(_0x109c22){if(_0x109c22){_0xe44d45['body'][_0xf31a('0x6c')]=_0x109c22['id'];return db[_0xf31a('0x44')][_0xf31a('0x71')](_0xe44d45[_0xf31a('0x64')]);}})[_0xf31a('0x25')](respondWithResult(_0x32837f,null))[_0xf31a('0x2d')](handleError(_0x32837f,null));};exports[_0xf31a('0x8f')]=function(_0x339227,_0x20bf46,_0x45f52d){return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x339227[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x20bf46,null))['then'](function(_0x48ee78){if(_0x48ee78){return _0x48ee78[_0xf31a('0x90')](null);}return null;})['then'](respondWithStatusCode(_0x20bf46,null))['catch'](handleError(_0x20bf46,null));};exports[_0xf31a('0x91')]=function(_0x119f6a,_0x179f62,_0x20d021){return db[_0xf31a('0x92')][_0xf31a('0x63')]({'where':{'id':_0x119f6a['params']['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x179f62,null))['then'](function(_0x151da9){if(_0x151da9){return _0x151da9[_0xf31a('0x91')](_0x119f6a[_0xf31a('0x64')][_0xf31a('0x74')],_[_0xf31a('0x93')](_0x119f6a['body'],[_0xf31a('0x74'),'id'])||{});}})[_0xf31a('0x25')](respondWithResult(_0x179f62,null))[_0xf31a('0x2d')](handleError(_0x179f62,null));};exports[_0xf31a('0x94')]=function(_0x1373f6,_0x59a4df,_0x27281f){var _0x8cce99={'raw':![],'where':{}};var _0x2e2a11={};var _0x33801c={'count':0x0,'rows':[]};return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x1373f6['params']['id']}})['then'](handleEntityNotFound(_0x59a4df,null))[_0xf31a('0x25')](function(_0x24252c){if(_0x24252c){_0x2e2a11['model']=_[_0xf31a('0x4e')](db[_0xf31a('0x92')][_0xf31a('0x69')]);_0x2e2a11[_0xf31a('0x4d')]=_[_0xf31a('0x4e')](_0x1373f6['query']);_0x2e2a11[_0xf31a('0x4f')]=_['intersection'](_0x2e2a11[_0xf31a('0x50')],_0x2e2a11[_0xf31a('0x4d')]);_0x8cce99['attributes']=_[_0xf31a('0x62')](_0x2e2a11[_0xf31a('0x50')],qs[_0xf31a('0x52')](_0x1373f6['query'][_0xf31a('0x52')]));_0x8cce99[_0xf31a('0x51')]=_0x8cce99['attributes'][_0xf31a('0x53')]?_0x8cce99['attributes']:_0x2e2a11['model'];if(!_0x1373f6[_0xf31a('0x4d')]['hasOwnProperty'](_0xf31a('0x6a'))){_0x8cce99[_0xf31a('0x32')]=qs[_0xf31a('0x32')](_0x1373f6[_0xf31a('0x4d')][_0xf31a('0x32')]);_0x8cce99[_0xf31a('0x34')]=qs['offset'](_0x1373f6['query'][_0xf31a('0x34')]);}_0x8cce99[_0xf31a('0x6b')]=qs[_0xf31a('0x55')](_0x1373f6['query'][_0xf31a('0x55')]);_0x8cce99[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_[_0xf31a('0x57')](_0x1373f6['query'],_0x2e2a11[_0xf31a('0x4f')]));_0x8cce99[_0xf31a('0x56')][_0xf31a('0x6c')]=_0x24252c['id'];if(_0x1373f6[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x8cce99[_0xf31a('0x56')]=_[_0xf31a('0x59')](_0x8cce99[_0xf31a('0x56')],{'$or':_[_0xf31a('0x48')](_0x8cce99[_0xf31a('0x51')],function(_0xc49c9f){var _0x5b657e={};_0x5b657e[_0xc49c9f]={'$like':'%'+_0x1373f6[_0xf31a('0x4d')]['filter']+'%'};return _0x5b657e;})});}_0x8cce99=_[_0xf31a('0x59')]({},_0x8cce99,_0x1373f6[_0xf31a('0x5b')]);return db[_0xf31a('0x92')][_0xf31a('0x33')]({'where':_0x8cce99[_0xf31a('0x56')]})[_0xf31a('0x25')](function(_0x56d269){_0x33801c[_0xf31a('0x33')]=_0x56d269;if(_0x1373f6['query'][_0xf31a('0x5c')]){_0x8cce99[_0xf31a('0x5d')]=[{'model':db[_0xf31a('0x95')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xf31a('0x96'),'attributes':[_0xf31a('0x3f'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xf31a('0x97'),'attributes':['id',_0xf31a('0x3f'),_0xf31a('0x98')],'where':_0x1373f6[_0xf31a('0x4d')][_0xf31a('0x99')]?{'id':_0x1373f6[_0xf31a('0x4d')][_0xf31a('0x99')]}:undefined,'required':_0x1373f6[_0xf31a('0x4d')]['tag']?!![]:![]}];}return db[_0xf31a('0x92')][_0xf31a('0x5e')](_0x8cce99);})[_0xf31a('0x25')](function(_0x5ac508){_0x33801c[_0xf31a('0x5f')]=_0x5ac508;return _0x33801c;});}})[_0xf31a('0x25')](respondWithFilteredResult(_0x59a4df,_0x8cce99))[_0xf31a('0x2d')](handleError(_0x59a4df,null));};exports[_0xf31a('0x9a')]=function(_0x288cc2,_0x53f2ec,_0x45fac1){return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0x288cc2['params']['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x53f2ec,null))['then'](function(_0x225a01){if(_0x225a01){return db['sequelize'][_0xf31a('0x9b')](function(_0x1ecc6e){return db[_0xf31a('0x9c')][_0xf31a('0x3a')]({'where':{'MailAccountId':_0x288cc2[_0xf31a('0x61')]['id']},'transaction':_0x1ecc6e})[_0xf31a('0x25')](function(_0x102b47){var _0x4bfd2f=_['map'](_0x288cc2[_0xf31a('0x64')],function(_0x389a5a){_0x389a5a[_0xf31a('0x6c')]=_0x288cc2[_0xf31a('0x61')]['id'];return _0x389a5a;});return db['MailApplication']['bulkCreate'](_0x4bfd2f,{'transaction':_0x1ecc6e});});})[_0xf31a('0x25')](function(){return db[_0xf31a('0x9c')]['findAndCountAll']({'where':{'MailAccountId':_0x288cc2['params']['id']},'order':_0xf31a('0x9d')});});}})[_0xf31a('0x25')](respondWithResult(_0x53f2ec,null))['catch'](handleError(_0x53f2ec,null));};exports['getApplications']=function(_0xefd098,_0x4a8ef8,_0x35f61d){var _0x24061d={};var _0x1cb3d4={};var _0x4b3ba8;var _0x2afc38;return db[_0xf31a('0x49')][_0xf31a('0x68')]({'where':{'id':_0xefd098[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x4a8ef8,null))[_0xf31a('0x25')](function(_0x117d94){if(_0x117d94){_0x4b3ba8=_0x117d94;_0x1cb3d4[_0xf31a('0x50')]=_[_0xf31a('0x4e')](db[_0xf31a('0x9c')]['rawAttributes']);_0x1cb3d4[_0xf31a('0x4d')]=_[_0xf31a('0x4e')](_0xefd098[_0xf31a('0x4d')]);_0x1cb3d4[_0xf31a('0x4f')]=_[_0xf31a('0x62')](_0x1cb3d4[_0xf31a('0x50')],_0x1cb3d4[_0xf31a('0x4d')]);_0x24061d['attributes']=_['intersection'](_0x1cb3d4['model'],qs[_0xf31a('0x52')](_0xefd098[_0xf31a('0x4d')][_0xf31a('0x52')]));_0x24061d['attributes']=_0x24061d[_0xf31a('0x51')][_0xf31a('0x53')]?_0x24061d[_0xf31a('0x51')]:_0x1cb3d4[_0xf31a('0x50')];_0x24061d[_0xf31a('0x6b')]=qs[_0xf31a('0x55')](_0xefd098[_0xf31a('0x4d')][_0xf31a('0x55')]);_0x24061d[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_[_0xf31a('0x57')](_0xefd098[_0xf31a('0x4d')],_0x1cb3d4['filters']));if(_0xefd098[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x24061d['where']=_[_0xf31a('0x59')](_0x24061d[_0xf31a('0x56')],{'$or':_[_0xf31a('0x48')](_0x24061d[_0xf31a('0x51')],function(_0x464b28){var _0x3eab08={};_0x3eab08[_0x464b28]={'$like':'%'+_0xefd098['query']['filter']+'%'};return _0x3eab08;})});}_0x24061d=_[_0xf31a('0x59')]({},_0x24061d,_0xefd098[_0xf31a('0x5b')]);return _0x4b3ba8['getApplications'](_0x24061d);}})[_0xf31a('0x25')](function(_0x29afdb){if(_0x29afdb){_0x2afc38=_0x29afdb[_0xf31a('0x53')];if(!_0xefd098[_0xf31a('0x4d')][_0xf31a('0x54')](_0xf31a('0x6a'))){_0x24061d[_0xf31a('0x32')]=qs['limit'](_0xefd098['query'][_0xf31a('0x32')]);_0x24061d[_0xf31a('0x34')]=qs['offset'](_0xefd098[_0xf31a('0x4d')][_0xf31a('0x34')]);}return _0x4b3ba8[_0xf31a('0x9e')](_0x24061d);}})['then'](function(_0x5b78e5){if(_0x5b78e5){return _0x5b78e5?{'count':_0x2afc38,'rows':_0x5b78e5}:null;}})[_0xf31a('0x25')](respondWithResult(_0x4a8ef8,null))[_0xf31a('0x2d')](handleError(_0x4a8ef8,null));};exports[_0xf31a('0x9f')]=function(_0x87ab68,_0x542184,_0x5a2e07){var _0x144285={'raw':!![],'where':{}};var _0x3b1e33={};var _0x6fe381={'count':0x0,'rows':[]};return db[_0xf31a('0x49')]['findOne']({'where':{'id':_0x87ab68[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x542184,null))[_0xf31a('0x25')](function(_0x48893d){if(_0x48893d){_0x3b1e33[_0xf31a('0x50')]=_[_0xf31a('0x4e')](db['MailMessage']['rawAttributes']);_0x3b1e33[_0xf31a('0x4d')]=_[_0xf31a('0x4e')](_0x87ab68[_0xf31a('0x4d')]);_0x3b1e33[_0xf31a('0x4f')]=_['intersection'](_0x3b1e33[_0xf31a('0x50')],_0x3b1e33[_0xf31a('0x4d')]);_0x144285[_0xf31a('0x51')]=_[_0xf31a('0x62')](_0x3b1e33[_0xf31a('0x50')],qs['fields'](_0x87ab68[_0xf31a('0x4d')]['fields']));_0x144285[_0xf31a('0x51')]=_0x144285['attributes'][_0xf31a('0x53')]?_0x144285['attributes']:_0x3b1e33[_0xf31a('0x50')];if(!_0x87ab68[_0xf31a('0x4d')][_0xf31a('0x54')]('nolimit')){_0x144285['limit']=qs[_0xf31a('0x32')](_0x87ab68[_0xf31a('0x4d')][_0xf31a('0x32')]);_0x144285[_0xf31a('0x34')]=qs['offset'](_0x87ab68['query'][_0xf31a('0x34')]);}_0x144285[_0xf31a('0x6b')]=qs[_0xf31a('0x55')](_0x87ab68['query']['sort']);_0x144285[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_['pick'](_0x87ab68['query'],_0x3b1e33[_0xf31a('0x4f')]));_0x144285[_0xf31a('0x56')][_0xf31a('0x6c')]=_0x48893d['id'];if(_0x87ab68[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x144285[_0xf31a('0x56')]=_['merge'](_0x144285[_0xf31a('0x56')],{'$or':_[_0xf31a('0x48')](_0x144285[_0xf31a('0x51')],function(_0x1f9039){var _0x2bb93f={};_0x2bb93f[_0x1f9039]={'$like':'%'+_0x87ab68[_0xf31a('0x4d')][_0xf31a('0x58')]+'%'};return _0x2bb93f;})});}if(_0x87ab68[_0xf31a('0x4d')][_0xf31a('0xa0')]){var _0x5c8d7e=_0x87ab68[_0xf31a('0x4d')][_0xf31a('0xa0')][_0xf31a('0xa1')](',');var _0x3ff2dc={};_0x3ff2dc[_0x5c8d7e[0x0]]={'$gte':moment(_0x5c8d7e[0x1])[_0xf31a('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x144285[_0xf31a('0x56')]=_[_0xf31a('0x59')](_0x144285[_0xf31a('0x56')],_0x3ff2dc);}_0x144285=_[_0xf31a('0x59')]({},_0x144285,_0x87ab68[_0xf31a('0x5b')]);return db[_0xf31a('0xa3')][_0xf31a('0x33')]({'where':_0x144285[_0xf31a('0x56')]})[_0xf31a('0x25')](function(_0x52582a){_0x6fe381[_0xf31a('0x33')]=_0x52582a;if(_0x87ab68[_0xf31a('0x4d')][_0xf31a('0x5c')]){_0x144285['include']=[{'all':!![]}];}return db[_0xf31a('0xa3')][_0xf31a('0x5e')](_0x144285);})['then'](function(_0x403ba6){if(_0x87ab68[_0xf31a('0x4d')][_0xf31a('0xa4')]==='true'){for(var _0x1b3333=0x0;_0x1b3333<_0x403ba6[_0xf31a('0x53')];_0x1b3333++){_0x403ba6[_0x1b3333][_0xf31a('0x64')]=juice(_0x403ba6[_0x1b3333][_0xf31a('0x64')]);}}_0x6fe381['rows']=_0x403ba6;return _0x6fe381;});}})[_0xf31a('0x25')](respondWithFilteredResult(_0x542184,_0x144285))[_0xf31a('0x2d')](handleError(_0x542184,null));};exports[_0xf31a('0x40')]=function(_0x4c6af3,_0x73d10d,_0x283efd){var _0x3bac2,_0xc02950={},_0x45984f;if(_0x4c6af3[_0xf31a('0x64')]['to']){_0x45984f=_0x4c6af3['body']['to'][_0xf31a('0xa1')](',')[0x0];}return db[_0xf31a('0x49')]['find']({'where':{'id':_0x4c6af3['params']['id']},'include':[{'model':db['CmList'],'as':_0xf31a('0xa5'),'include':[{'model':db[_0xf31a('0x95')],'as':_0xf31a('0xa6'),'where':{'email':_0x45984f},'limit':0x1,'order':[[_0xf31a('0xa7'),_0xf31a('0xa8')]]}]},{'model':db['MailServerOut'],'as':_0xf31a('0x45'),'raw':!![]}]})[_0xf31a('0x25')](handleEntityNotFound(_0x73d10d,null))[_0xf31a('0x25')](function(_0x4c7881){if(_0x4c7881){_0x3bac2=_0x4c7881;if(_0x4c7881[_0xf31a('0x45')]){if(_[_0xf31a('0x76')](_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xa9')])){_0x4c6af3['body'][_0xf31a('0xa9')]=util[_0xf31a('0xa2')]('%s\x20<%s>',_0x4c7881[_0xf31a('0x3f')],_0x4c7881['email']||_0x4c7881[_0xf31a('0x45')][_0xf31a('0x82')]);}if(_0x4c6af3[_0xf31a('0x64')]['attachments']&&_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xaa')][_0xf31a('0x53')]){for(var _0xcad837=0x0;_0xcad837<_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xaa')]['length'];_0xcad837+=0x1){_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xaa')][_0xcad837]={'filename':_0x4c6af3['body']['attachments'][_0xcad837][_0xf31a('0x3f')],'path':path['join'](config['root'],_0xf31a('0xab'),_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xaa')][_0xcad837][_0xf31a('0xac')])};}}var _0x130045={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4c7881[_0xf31a('0x45')][_0xf31a('0x81')])){if(_0x4c7881['Smtp']['authentication']){_0x130045[_0xf31a('0xad')]={'user':_0x4c7881[_0xf31a('0x45')][_0xf31a('0x82')],'pass':_0x4c7881['Smtp'][_0xf31a('0x7d')]};}_0x130045[_0xf31a('0x7f')]=_0x4c7881[_0xf31a('0x45')]['host'];_0x130045[_0xf31a('0x80')]=_0x4c7881['Smtp'][_0xf31a('0x80')];_0x130045[_0xf31a('0xae')]=_0x4c7881[_0xf31a('0x45')]['secure'];}else{_0x130045['service']=_0x4c7881[_0xf31a('0x45')][_0xf31a('0x81')];_0x130045['auth']={'user':_0x4c7881['Smtp'][_0xf31a('0x82')],'pass':_0x4c7881['Smtp'][_0xf31a('0x7d')]};}return respondWithRpcPromise(_0xf31a('0xaf'),_0xf31a('0xb0'),{'account':_0x130045,'message':_0x4c6af3['body']});}else{throw new Error(_0xf31a('0xb1'));}}})[_0xf31a('0x25')](function(_0x413fa3){if(_0x413fa3){_0xc02950=_0x413fa3;if(_0x3bac2[_0xf31a('0xa5')]){if(_0x3bac2[_0xf31a('0xa5')][_0xf31a('0xa6')]['length']){return _0x3bac2[_0xf31a('0xa5')]['Contacts'][0x0];}else{return db[_0xf31a('0x95')][_0xf31a('0x71')](_[_0xf31a('0x1b')](_0x4c6af3[_0xf31a('0x64')],{'firstName':_0x4c6af3[_0xf31a('0x64')]['to'],'email':_0x4c6af3['body']['to'],'phone':_0x4c6af3['body']['to'],'ListId':_0x3bac2[_0xf31a('0x75')]}));}}else{throw new Error(_0xf31a('0xb1'));}}})[_0xf31a('0x25')](function(_0x26e2f8){if(_0x26e2f8){var _0xb3f712={'UserId':_0x4c6af3[_0xf31a('0x82')]['id'],'ContactId':_0x26e2f8['id'],'MailAccountId':_0x3bac2['id'],'inReplyTo':_0xc02950[_0xf31a('0xb2')],'to':_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xa9')],'cc':_0x4c6af3[_0xf31a('0x64')]['cc'],'subject':_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xb3')],'attach':_0x4c6af3['body'][_0xf31a('0xb4')],'firstMsgDirection':_0xf31a('0xb5'),'lastMsgAt':moment()[_0xf31a('0xa2')](_0xf31a('0xb6')),'lastMsgDirection':'out','Messages':[_[_0xf31a('0x59')](_0x4c6af3['body'],{'messageId':_0xc02950[_0xf31a('0xb2')],'sentAt':moment()['format'](_0xf31a('0xb6')),'read':!![],'MailAccountId':_0x3bac2['id'],'UserId':_0x4c6af3[_0xf31a('0x82')]['id'],'ContactId':_0x26e2f8['id']})]};if(_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xb7')]){_0xb3f712=_[_0xf31a('0x59')](_0xb3f712,_0x4c6af3[_0xf31a('0x64')][_0xf31a('0xb7')]);}return db['MailInteraction']['create'](_0xb3f712,{'include':[{'model':db['MailMessage'],'as':_0xf31a('0xb8')}]});}})[_0xf31a('0x25')](respondWithResult(_0x73d10d,null))[_0xf31a('0x2d')](handleError(_0x73d10d,null));};exports[_0xf31a('0xb9')]=function(_0x42625a,_0x1cd872,_0x194566){return db[_0xf31a('0x49')][_0xf31a('0x63')]({'where':{'id':_0x42625a[_0xf31a('0x61')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xf31a('0x45'),'raw':!![]}]})[_0xf31a('0x25')](handleEntityNotFound(_0x1cd872,null))['then'](function(_0x5b0b9d){if(_0x5b0b9d&&_0x5b0b9d[_0xf31a('0x45')]){var _0x51705b={'id':_0x5b0b9d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5b0b9d[_0xf31a('0x45')]['service']){_0x51705b[_0xf31a('0x81')]=_0x5b0b9d[_0xf31a('0x45')][_0xf31a('0x81')];}else{_0x51705b[_0xf31a('0x7f')]=_0x5b0b9d[_0xf31a('0x45')]['host'];_0x51705b[_0xf31a('0x80')]=_0x5b0b9d[_0xf31a('0x45')]['port'];_0x51705b[_0xf31a('0xae')]=_0x5b0b9d[_0xf31a('0x45')][_0xf31a('0xae')];}if(_0x5b0b9d[_0xf31a('0x45')][_0xf31a('0x7e')]){_0x51705b[_0xf31a('0xad')]={'user':_0x5b0b9d['Smtp']['user'],'pass':_0x5b0b9d[_0xf31a('0x45')][_0xf31a('0x7d')]};}return respondWithRpcPromise(_0xf31a('0xba'),_0xf31a('0xb9'),{'account':_0x51705b});}})[_0xf31a('0x25')](respondWithResult(_0x1cd872,null))['catch'](handleError(_0x1cd872,null));};exports[_0xf31a('0x3a')]=function(_0x3fcbce,_0x33bdb2){return db[_0xf31a('0x49')][_0xf31a('0x63')]({'where':{'id':_0x3fcbce[_0xf31a('0x61')]['id']}})['then'](handleEntityNotFound(_0x33bdb2,null))[_0xf31a('0x25')](function(_0x1cd32b){if(_0x1cd32b&&_0x1cd32b[_0xf31a('0x81')]){throw new db[(_0xf31a('0xbb'))][(_0xf31a('0xbc'))](_0xf31a('0xbd'));}return _0x1cd32b;})[_0xf31a('0x25')](removeEntity(_0x33bdb2,null))['catch'](handleError(_0x33bdb2,null));};exports[_0xf31a('0xbe')]=function(_0x5c8c32,_0x49c568,_0x22d10e){return db[_0xf31a('0x49')]['find']({'where':{'id':_0x5c8c32['params']['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x49c568,null))[_0xf31a('0x25')](function(_0xa3fd88){if(_0xa3fd88){return _0xa3fd88['addAgents'](_0x5c8c32[_0xf31a('0x64')]['ids'],_[_0xf31a('0x93')](_0x5c8c32[_0xf31a('0x64')],[_0xf31a('0x74'),'id'])||{})[_0xf31a('0xbf')](function(_0x1fea0e){for(var _0xc3bad0=0x0;_0xc3bad0<_0x5c8c32[_0xf31a('0x64')]['ids']['length'];_0xc3bad0+=0x1){socket[_0xf31a('0xc0')](_0xf31a('0xc1'),{'UserId':_0x5c8c32[_0xf31a('0x64')][_0xf31a('0x74')][_0xc3bad0],'MailAccountId':_0x5c8c32['params']['id']});}return _0x1fea0e;});}})[_0xf31a('0x25')](respondWithResult(_0x49c568,null))[_0xf31a('0x2d')](handleError(_0x49c568,null));};exports[_0xf31a('0xc2')]=function(_0x88f713,_0x1d8fb2,_0x24e01e){return db[_0xf31a('0x49')]['find']({'where':{'id':_0x88f713[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x1d8fb2,null))[_0xf31a('0x25')](function(_0x2f6c46){if(_0x2f6c46){return _0x2f6c46[_0xf31a('0xc2')](_0x88f713[_0xf31a('0x4d')][_0xf31a('0x74')])[_0xf31a('0x25')](function(){if(_[_0xf31a('0xc3')](_0x88f713[_0xf31a('0x4d')][_0xf31a('0x74')])){for(var _0x397c05=0x0;_0x397c05<_0x88f713[_0xf31a('0x4d')][_0xf31a('0x74')][_0xf31a('0x53')];_0x397c05+=0x1){socket['emit'](_0xf31a('0xc4'),{'UserId':Number(_0x88f713[_0xf31a('0x4d')]['ids'][_0x397c05]),'MailAccountId':Number(_0x88f713['params']['id'])});}}else{socket[_0xf31a('0xc0')](_0xf31a('0xc4'),{'UserId':Number(_0x88f713[_0xf31a('0x4d')][_0xf31a('0x74')]),'MailAccountId':Number(_0x88f713[_0xf31a('0x61')]['id'])});}});}})[_0xf31a('0x25')](respondWithStatusCode(_0x1d8fb2,null))[_0xf31a('0x2d')](handleError(_0x1d8fb2,null));};exports['getAgents']=function(_0x50abd6,_0x3a61c5,_0x11381a){var _0x433f72={};var _0xb710de={};var _0x120e47;var _0xdd0713;return db['MailAccount'][_0xf31a('0x68')]({'where':{'id':_0x50abd6[_0xf31a('0x61')]['id']}})[_0xf31a('0x25')](handleEntityNotFound(_0x3a61c5,null))[_0xf31a('0x25')](function(_0x4bd841){if(_0x4bd841){_0x120e47=_0x4bd841;_0xb710de[_0xf31a('0x50')]=_[_0xf31a('0x4e')](db['User'][_0xf31a('0x69')]);_0xb710de[_0xf31a('0x4d')]=_[_0xf31a('0x4e')](_0x50abd6[_0xf31a('0x4d')]);_0xb710de[_0xf31a('0x4f')]=_[_0xf31a('0x62')](_0xb710de[_0xf31a('0x50')],_0xb710de['query']);_0x433f72[_0xf31a('0x51')]=_[_0xf31a('0x62')](_0xb710de[_0xf31a('0x50')],qs[_0xf31a('0x52')](_0x50abd6[_0xf31a('0x4d')][_0xf31a('0x52')]));_0x433f72[_0xf31a('0x51')]=_0x433f72[_0xf31a('0x51')][_0xf31a('0x53')]?_0x433f72[_0xf31a('0x51')]:_0xb710de[_0xf31a('0x50')];_0x433f72[_0xf31a('0x6b')]=qs['sort'](_0x50abd6[_0xf31a('0x4d')][_0xf31a('0x55')]);_0x433f72[_0xf31a('0x56')]=qs[_0xf31a('0x4f')](_['pick'](_0x50abd6[_0xf31a('0x4d')],_0xb710de[_0xf31a('0x4f')]));if(_0x50abd6[_0xf31a('0x4d')][_0xf31a('0x58')]){_0x433f72[_0xf31a('0x56')]=_['merge'](_0x433f72[_0xf31a('0x56')],{'$or':_[_0xf31a('0x48')](_0x433f72[_0xf31a('0x51')],function(_0x46adac){var _0x15cb27={};_0x15cb27[_0x46adac]={'$like':'%'+_0x50abd6['query']['filter']+'%'};return _0x15cb27;})});}_0x433f72=_[_0xf31a('0x59')]({},_0x433f72,_0x50abd6['options']);return _0x120e47[_0xf31a('0xc5')](_0x433f72);}})[_0xf31a('0x25')](function(_0x3fc459){if(_0x3fc459){_0xdd0713=_0x3fc459['length'];if(!_0x50abd6[_0xf31a('0x4d')][_0xf31a('0x54')](_0xf31a('0x6a'))){_0x433f72['limit']=qs[_0xf31a('0x32')](_0x50abd6[_0xf31a('0x4d')][_0xf31a('0x32')]);_0x433f72[_0xf31a('0x34')]=qs[_0xf31a('0x34')](_0x50abd6[_0xf31a('0x4d')][_0xf31a('0x34')]);}return _0x120e47[_0xf31a('0xc5')](_0x433f72);}})[_0xf31a('0x25')](function(_0x3a5748){if(_0x3a5748){return _0x3a5748?{'count':_0xdd0713,'rows':_0x3a5748}:null;}})[_0xf31a('0x25')](respondWithResult(_0x3a61c5,null))[_0xf31a('0x2d')](handleError(_0x3a61c5,null));};
\ No newline at end of file
+var _0x425d=['Disposition','create','getDispositions','findAll','rows','removeDispositions','CannedAnswer','getAnswers','includeAll','removeAnswers','ids','email','isNil','active','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','findOne','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','include','Contact','User','Owner','internal','Tag','color','tag','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','true','List','CmContact','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','secure','auth','List\x20not\x20found','Contacts','messageId','subject','out','YYYY-MM-DD\x20HH:mm:ss','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','juice','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','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','UserProfileResource','name','send','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','MailAccount','params','Pause','body','find','describe','addDisposition','MailAccountId'];(function(_0x9aad68,_0x45377){var _0x281340=function(_0x494ac1){while(--_0x494ac1){_0x9aad68['push'](_0x9aad68['shift']());}};_0x281340(++_0x45377);}(_0x425d,0x1e0));var _0xd425=function(_0x1a34ab,_0x5bb305){_0x1a34ab=_0x1a34ab-0x0;var _0x46379e=_0x425d[_0x1a34ab];return _0x46379e;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var htmlToText=require(_0xd425('0x12'));var juice=require(_0xd425('0x13'));var Redis=require(_0xd425('0x14'));var authService=require(_0xd425('0x15'));var qs=require(_0xd425('0x16'));var as=require(_0xd425('0x17'));var hardwareService=require(_0xd425('0x18'));var logger=require(_0xd425('0x19'))(_0xd425('0x1a'));var utils=require(_0xd425('0x1b'));var config=require(_0xd425('0x1c'));var licenseUtil=require(_0xd425('0x1d'));var db=require(_0xd425('0x1e'))['db'];config[_0xd425('0x1f')]=_[_0xd425('0x20')](config['redis'],{'host':_0xd425('0x21'),'port':0x18eb});var socket=require(_0xd425('0x22'))(new Redis(config[_0xd425('0x1f')]));require('./mailAccount.socket')[_0xd425('0x23')](socket);var jayson=require(_0xd425('0x24'));var client=jayson[_0xd425('0x25')][_0xd425('0x26')]({'port':0x232b});function respondWithRpcPromise(_0x1fc822,_0x538a0a,_0x278626,_0x471267){return new BPromise(function(_0x7e267e,_0x5dda0c){var _0x5d6585=_0x471267||client;return _0x5d6585[_0xd425('0x27')](_0x1fc822,_0x278626)[_0xd425('0x28')](function(_0x467a6c){logger[_0xd425('0x29')]('MailAccount,\x20%s,\x20%s',_0x538a0a,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x538a0a,_0xd425('0x2a'),JSON[_0xd425('0x2b')](_0x467a6c));if(_0x467a6c[_0xd425('0x2c')]){if(_0x467a6c['error'][_0xd425('0x2d')]===0x1f4){logger[_0xd425('0x2c')]('MailAccount,\x20%s,\x20%s',_0x538a0a,_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);return _0x5dda0c(_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);}logger[_0xd425('0x2c')](_0xd425('0x2f'),_0x538a0a,_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);return _0x7e267e(_0x467a6c[_0xd425('0x2c')][_0xd425('0x2e')]);}else{logger[_0xd425('0x29')](_0xd425('0x2f'),_0x538a0a,'request\x20sent');_0x7e267e(_0x467a6c[_0xd425('0x30')][_0xd425('0x2e')]);}})[_0xd425('0x31')](function(_0x1908a5){logger[_0xd425('0x2c')](_0xd425('0x2f'),_0x538a0a,_0x1908a5);_0x5dda0c(_0x1908a5);});});}function respondWithStatusCode(_0x3c3402,_0x577e4b){_0x577e4b=_0x577e4b||0xcc;return function(_0x12f951){if(_0x12f951){return _0x3c3402[_0xd425('0x32')](_0x577e4b);}return _0x3c3402[_0xd425('0x33')](_0x577e4b)['end']();};}function respondWithResult(_0x27ef8a,_0x3ad9bd){_0x3ad9bd=_0x3ad9bd||0xc8;return function(_0x433189){if(_0x433189){return _0x27ef8a[_0xd425('0x33')](_0x3ad9bd)[_0xd425('0x34')](_0x433189);}};}function respondWithFilteredResult(_0x185d7e,_0x2fd17a){return function(_0x37b63c){if(_0x37b63c){var _0x24da23=typeof _0x2fd17a[_0xd425('0x35')]==='undefined'&&typeof _0x2fd17a[_0xd425('0x36')]===_0xd425('0x37');var _0x298602=_0x37b63c[_0xd425('0x38')];var _0x3275b1=_0x24da23?0x0:_0x2fd17a[_0xd425('0x35')];var _0x47405f=_0x24da23?_0x37b63c[_0xd425('0x38')]:_0x2fd17a[_0xd425('0x35')]+_0x2fd17a[_0xd425('0x36')];var _0x3583b0;if(_0x47405f>=_0x298602){_0x47405f=_0x298602;_0x3583b0=0xc8;}else{_0x3583b0=0xce;}_0x185d7e['status'](_0x3583b0);return _0x185d7e[_0xd425('0x39')](_0xd425('0x3a'),_0x3275b1+'-'+_0x47405f+'/'+_0x298602)[_0xd425('0x34')](_0x37b63c);}return null;};}function patchUpdates(_0x21e0bd){return function(_0x28870f){try{jsonpatch['apply'](_0x28870f,_0x21e0bd,!![]);}catch(_0x4aa168){return BPromise[_0xd425('0x3b')](_0x4aa168);}return _0x28870f['save']();};}function saveUpdates(_0x574962,_0x51669d){return function(_0x2ffb5b){if(_0x2ffb5b){return _0x2ffb5b[_0xd425('0x3c')](_0x574962)[_0xd425('0x28')](function(_0x2d586f){return _0x2d586f;});}return null;};}function removeEntity(_0x4aa5b2,_0x42b974){return function(_0x1d4414){if(_0x1d4414){return _0x1d4414[_0xd425('0x3d')]()[_0xd425('0x28')](function(){var _0x27b9e2=_0x1d4414[_0xd425('0x3e')]({'plain':!![]});var _0x35bbec='MailAccounts';return db[_0xd425('0x3f')]['destroy']({'where':{'type':_0x35bbec,'resourceId':_0x27b9e2['id']}})[_0xd425('0x28')](function(){return _0x1d4414;});})[_0xd425('0x28')](function(){_0x4aa5b2[_0xd425('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ccbed,_0x26806c){return function(_0xbbb05f){if(!_0xbbb05f){_0x3ccbed[_0xd425('0x32')](0x194);}return _0xbbb05f;};}function handleError(_0x58f36d,_0x1d38fa){_0x1d38fa=_0x1d38fa||0x1f4;return function(_0x3cf540){logger['error'](_0x3cf540['stack']);if(_0x3cf540['name']){delete _0x3cf540[_0xd425('0x40')];}_0x58f36d[_0xd425('0x33')](_0x1d38fa)[_0xd425('0x41')](_0x3cf540);};}exports['index']=function(_0x4f8323,_0x58ebb1){var _0x2fcfb9={'include':[{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')},{'model':db[_0xd425('0x44')],'as':_0xd425('0x45')},{'model':db['Pause'],'as':_0xd425('0x46')}]},_0x3f9090={},_0xe72957={'count':0x0,'rows':[]};var _0x3c88a8=_[_0xd425('0x47')](db['MailAccount'][_0xd425('0x48')],function(_0x2dffc7){return{'name':_0x2dffc7[_0xd425('0x49')],'type':_0x2dffc7['type'][_0xd425('0x4a')]};});_0x3f9090[_0xd425('0x4b')]=_[_0xd425('0x47')](_0x3c88a8,_0xd425('0x40'));_0x3f9090['query']=_[_0xd425('0x4c')](_0x4f8323[_0xd425('0x4d')]);_0x3f9090[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x3f9090[_0xd425('0x4b')],_0x3f9090[_0xd425('0x4d')]);_0x2fcfb9[_0xd425('0x50')]=_['intersection'](_0x3f9090[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x4f8323['query'][_0xd425('0x51')]));_0x2fcfb9['attributes']=_0x2fcfb9['attributes'][_0xd425('0x52')]?_0x2fcfb9['attributes']:_0x3f9090[_0xd425('0x4b')];if(!_0x4f8323['query'][_0xd425('0x53')](_0xd425('0x54'))){_0x2fcfb9[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x4f8323[_0xd425('0x4d')]['limit']);_0x2fcfb9[_0xd425('0x35')]=qs['offset'](_0x4f8323[_0xd425('0x4d')]['offset']);}_0x2fcfb9[_0xd425('0x55')]=qs[_0xd425('0x56')](_0x4f8323[_0xd425('0x4d')][_0xd425('0x56')]);_0x2fcfb9[_0xd425('0x57')]=qs['filters'](_[_0xd425('0x58')](_0x4f8323[_0xd425('0x4d')],_0x3f9090[_0xd425('0x4e')]),_0x3c88a8);if(_0x4f8323[_0xd425('0x4d')][_0xd425('0x59')]){_0x2fcfb9['where']=_[_0xd425('0x5a')](_0x2fcfb9[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x3c88a8,function(_0x2a2ab4){if(_0x2a2ab4[_0xd425('0x5b')]!==_0xd425('0x5c')){var _0x5870dd={};_0x5870dd[_0x2a2ab4[_0xd425('0x40')]]={'$like':'%'+_0x4f8323[_0xd425('0x4d')]['filter']+'%'};return _0x5870dd;}})});}_0x2fcfb9=_[_0xd425('0x5a')]({},_0x2fcfb9,_0x4f8323[_0xd425('0x5d')]);var _0x1b416b={'where':_0x2fcfb9[_0xd425('0x57')]};return db['MailAccount'][_0xd425('0x38')](_0x1b416b)[_0xd425('0x28')](function(_0x4552cd){_0xe72957[_0xd425('0x38')]=_0x4552cd;if(_0x4f8323[_0xd425('0x4d')]['includeAll']){_0x2fcfb9['include']=[{'all':!![]}];}return db[_0xd425('0x5e')]['findAll'](_0x2fcfb9);})[_0xd425('0x28')](function(_0x1072bf){_0xe72957['rows']=_0x1072bf;return _0xe72957;})[_0xd425('0x28')](respondWithFilteredResult(_0x58ebb1,_0x2fcfb9))['catch'](handleError(_0x58ebb1,null));};exports['show']=function(_0x39f588,_0x111905){var _0xe6451f={'raw':![],'where':{'id':_0x39f588[_0xd425('0x5f')]['id']},'include':[{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')},{'model':db[_0xd425('0x44')],'as':'Smtp'},{'model':db[_0xd425('0x60')],'as':_0xd425('0x46')}]},_0x1bcd39={};_0x1bcd39[_0xd425('0x4b')]=_[_0xd425('0x4c')](db[_0xd425('0x5e')][_0xd425('0x48')]);_0x1bcd39[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x39f588['query']);_0x1bcd39['filters']=_['intersection'](_0x1bcd39[_0xd425('0x4b')],_0x1bcd39[_0xd425('0x4d')]);_0xe6451f[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x1bcd39['model'],qs['fields'](_0x39f588['query']['fields']));_0xe6451f[_0xd425('0x50')]=_0xe6451f[_0xd425('0x50')]['length']?_0xe6451f[_0xd425('0x50')]:_0x1bcd39[_0xd425('0x4b')];if(_0x39f588[_0xd425('0x4d')]['includeAll']){_0xe6451f['include']=[{'all':!![]}];}_0xe6451f=_[_0xd425('0x5a')]({},_0xe6451f,_0x39f588['options']);return db['MailAccount']['find'](_0xe6451f)[_0xd425('0x28')](handleEntityNotFound(_0x111905,null))[_0xd425('0x28')](respondWithResult(_0x111905,null))[_0xd425('0x31')](handleError(_0x111905,null));};exports['update']=function(_0x3395d8,_0x48bd20){if(_0x3395d8[_0xd425('0x61')]['id']){delete _0x3395d8[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x3395d8[_0xd425('0x5f')]['id']},'include':[{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')},{'model':db[_0xd425('0x44')],'as':_0xd425('0x45')},{'model':db['Pause'],'as':_0xd425('0x46')}]})[_0xd425('0x28')](handleEntityNotFound(_0x48bd20,null))[_0xd425('0x28')](saveUpdates(_0x3395d8[_0xd425('0x61')],null))['then'](function(_0x4f5d01){if(_0x4f5d01&&_0x3395d8[_0xd425('0x61')][_0xd425('0x43')]){return db[_0xd425('0x42')][_0xd425('0x3c')](_0x3395d8[_0xd425('0x61')][_0xd425('0x43')],{'where':{'MailAccountId':_0x4f5d01['id']}})[_0xd425('0x28')](function(){return _0x4f5d01;});}return _0x4f5d01;})[_0xd425('0x28')](function(_0x1fcde4){if(_0x1fcde4&&_0x3395d8[_0xd425('0x61')][_0xd425('0x45')]){return db[_0xd425('0x44')][_0xd425('0x3c')](_0x3395d8[_0xd425('0x61')]['Smtp'],{'where':{'MailAccountId':_0x1fcde4['id']}})[_0xd425('0x28')](function(){return _0x1fcde4;});}return _0x1fcde4;})[_0xd425('0x28')](respondWithResult(_0x48bd20,null))[_0xd425('0x31')](handleError(_0x48bd20,null));};exports['describe']=function(_0x5aff3c,_0x5ade1a){return db[_0xd425('0x5e')][_0xd425('0x63')]()[_0xd425('0x28')](respondWithResult(_0x5ade1a,null))['catch'](handleError(_0x5ade1a,null));};exports[_0xd425('0x64')]=function(_0x4c1878,_0x2811a4,_0xdc942c){if(_0x4c1878[_0xd425('0x61')]['id']){delete _0x4c1878['body']['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x4c1878[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x2811a4,null))[_0xd425('0x28')](function(_0x43b1a9){if(_0x43b1a9){_0x4c1878[_0xd425('0x61')][_0xd425('0x65')]=_0x43b1a9['id'];return db[_0xd425('0x66')][_0xd425('0x67')](_0x4c1878[_0xd425('0x61')]);}})[_0xd425('0x28')](respondWithResult(_0x2811a4,null))[_0xd425('0x31')](handleError(_0x2811a4,null));};exports[_0xd425('0x68')]=function(_0x445f98,_0x443126,_0x623ff5){var _0x25cae6={'raw':![],'where':{}};var _0x541218={};var _0x583073={'count':0x0,'rows':[]};return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x445f98[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x443126,null))[_0xd425('0x28')](function(_0x1ae1e3){if(_0x1ae1e3){_0x541218['model']=_[_0xd425('0x4c')](db[_0xd425('0x66')][_0xd425('0x48')]);_0x541218[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x445f98[_0xd425('0x4d')]);_0x541218['filters']=_['intersection'](_0x541218[_0xd425('0x4b')],_0x541218[_0xd425('0x4d')]);_0x25cae6['attributes']=_[_0xd425('0x4f')](_0x541218['model'],qs[_0xd425('0x51')](_0x445f98[_0xd425('0x4d')][_0xd425('0x51')]));_0x25cae6[_0xd425('0x50')]=_0x25cae6[_0xd425('0x50')][_0xd425('0x52')]?_0x25cae6[_0xd425('0x50')]:_0x541218['model'];if(!_0x445f98[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x25cae6[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x445f98['query'][_0xd425('0x36')]);_0x25cae6[_0xd425('0x35')]=qs['offset'](_0x445f98[_0xd425('0x4d')][_0xd425('0x35')]);}_0x25cae6['order']=qs[_0xd425('0x56')](_0x445f98[_0xd425('0x4d')][_0xd425('0x56')]);_0x25cae6[_0xd425('0x57')]=qs[_0xd425('0x4e')](_['pick'](_0x445f98[_0xd425('0x4d')],_0x541218['filters']));_0x25cae6[_0xd425('0x57')][_0xd425('0x65')]=_0x1ae1e3['id'];if(_0x445f98['query'][_0xd425('0x59')]){_0x25cae6[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x25cae6[_0xd425('0x57')],{'$or':_['map'](_0x25cae6['attributes'],function(_0x23e6e5){var _0x2312c1={};_0x2312c1[_0x23e6e5]={'$like':'%'+_0x445f98[_0xd425('0x4d')]['filter']+'%'};return _0x2312c1;})});}_0x25cae6=_[_0xd425('0x5a')]({},_0x25cae6,_0x445f98[_0xd425('0x5d')]);return db['Disposition'][_0xd425('0x38')]({'where':_0x25cae6['where']})[_0xd425('0x28')](function(_0x46346c){_0x583073[_0xd425('0x38')]=_0x46346c;if(_0x445f98[_0xd425('0x4d')]['includeAll']){_0x25cae6['include']=[{'all':!![]}];}return db[_0xd425('0x66')][_0xd425('0x69')](_0x25cae6);})['then'](function(_0x61349a){_0x583073[_0xd425('0x6a')]=_0x61349a;return _0x583073;});}})['then'](respondWithFilteredResult(_0x443126,_0x25cae6))[_0xd425('0x31')](handleError(_0x443126,null));};exports[_0xd425('0x6b')]=function(_0x20e80d,_0xfb6553,_0x455fff){return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x20e80d['params']['id']}})['then'](handleEntityNotFound(_0xfb6553,null))[_0xd425('0x28')](function(_0x4ba218){if(_0x4ba218){return _0x4ba218[_0xd425('0x6b')](_0x20e80d[_0xd425('0x4d')]['ids']);}})[_0xd425('0x28')](respondWithStatusCode(_0xfb6553,null))[_0xd425('0x31')](handleError(_0xfb6553,null));};exports['addAnswer']=function(_0x592c40,_0x750685,_0x242ed8){if(_0x592c40[_0xd425('0x61')]['id']){delete _0x592c40[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x592c40[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x750685,null))['then'](function(_0x2cff42){if(_0x2cff42){_0x592c40[_0xd425('0x61')]['MailAccountId']=_0x2cff42['id'];return db[_0xd425('0x6c')][_0xd425('0x67')](_0x592c40[_0xd425('0x61')]);}})[_0xd425('0x28')](respondWithResult(_0x750685,null))[_0xd425('0x31')](handleError(_0x750685,null));};exports[_0xd425('0x6d')]=function(_0x27c24e,_0x2c3995,_0x334062){var _0x26649f={'raw':![],'where':{}};var _0x14cebc={};var _0x572452={'count':0x0,'rows':[]};return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x27c24e['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x2c3995,null))['then'](function(_0x229d7d){if(_0x229d7d){_0x14cebc[_0xd425('0x4b')]=_[_0xd425('0x4c')](db[_0xd425('0x6c')][_0xd425('0x48')]);_0x14cebc[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x27c24e['query']);_0x14cebc[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x14cebc[_0xd425('0x4b')],_0x14cebc[_0xd425('0x4d')]);_0x26649f[_0xd425('0x50')]=_['intersection'](_0x14cebc[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x27c24e[_0xd425('0x4d')][_0xd425('0x51')]));_0x26649f[_0xd425('0x50')]=_0x26649f[_0xd425('0x50')][_0xd425('0x52')]?_0x26649f[_0xd425('0x50')]:_0x14cebc[_0xd425('0x4b')];if(!_0x27c24e[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x26649f['limit']=qs[_0xd425('0x36')](_0x27c24e['query'][_0xd425('0x36')]);_0x26649f[_0xd425('0x35')]=qs[_0xd425('0x35')](_0x27c24e[_0xd425('0x4d')][_0xd425('0x35')]);}_0x26649f['order']=qs[_0xd425('0x56')](_0x27c24e[_0xd425('0x4d')][_0xd425('0x56')]);_0x26649f[_0xd425('0x57')]=qs[_0xd425('0x4e')](_[_0xd425('0x58')](_0x27c24e[_0xd425('0x4d')],_0x14cebc['filters']));_0x26649f[_0xd425('0x57')]['MailAccountId']=_0x229d7d['id'];if(_0x27c24e[_0xd425('0x4d')][_0xd425('0x59')]){_0x26649f['where']=_[_0xd425('0x5a')](_0x26649f[_0xd425('0x57')],{'$or':_['map'](_0x26649f[_0xd425('0x50')],function(_0x8c2e48){var _0xca2955={};_0xca2955[_0x8c2e48]={'$like':'%'+_0x27c24e[_0xd425('0x4d')][_0xd425('0x59')]+'%'};return _0xca2955;})});}_0x26649f=_[_0xd425('0x5a')]({},_0x26649f,_0x27c24e['options']);return db[_0xd425('0x6c')]['count']({'where':_0x26649f[_0xd425('0x57')]})['then'](function(_0x9e8b08){_0x572452[_0xd425('0x38')]=_0x9e8b08;if(_0x27c24e[_0xd425('0x4d')][_0xd425('0x6e')]){_0x26649f['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x26649f);})['then'](function(_0x2bbad4){_0x572452['rows']=_0x2bbad4;return _0x572452;});}})[_0xd425('0x28')](respondWithFilteredResult(_0x2c3995,_0x26649f))[_0xd425('0x31')](handleError(_0x2c3995,null));};exports[_0xd425('0x6f')]=function(_0x331a14,_0x284f4b,_0x1309d7){return db['MailAccount'][_0xd425('0x62')]({'where':{'id':_0x331a14[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x284f4b,null))[_0xd425('0x28')](function(_0x476edf){if(_0x476edf){return _0x476edf['removeAnswers'](_0x331a14[_0xd425('0x4d')][_0xd425('0x70')]);}})[_0xd425('0x28')](respondWithStatusCode(_0x284f4b,null))['catch'](handleError(_0x284f4b,null));};exports[_0xd425('0x67')]=function(_0xf0939e,_0x3054d7){var _0x3fc022={'name':_0xf0939e[_0xd425('0x61')]['name'],'key':_0xf0939e[_0xd425('0x61')]['key'],'email':_0xf0939e[_0xd425('0x61')][_0xd425('0x71')],'ListId':_0xf0939e['body']['ListId'],'active':!_[_0xd425('0x72')](_0xf0939e['body'][_0xd425('0x73')])?_0xf0939e[_0xd425('0x61')][_0xd425('0x73')]:!![],'description':_0xf0939e[_0xd425('0x61')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xd425('0x72')](_0xf0939e[_0xd425('0x61')][_0xd425('0x74')])){if(_0xf0939e[_0xd425('0x61')][_0xd425('0x75')]){_0x3fc022[_0xd425('0x43')]['user']=_0x3fc022[_0xd425('0x45')][_0xd425('0x76')]=_0xf0939e[_0xd425('0x61')][_0xd425('0x77')];_0x3fc022[_0xd425('0x43')][_0xd425('0x78')]=_0x3fc022['Smtp'][_0xd425('0x79')]=_0xf0939e[_0xd425('0x61')]['cpassword'];}else{_0x3fc022[_0xd425('0x43')][_0xd425('0x7a')]=_0x3fc022['Smtp'][_0xd425('0x7a')]=![];}_0x3fc022[_0xd425('0x43')][_0xd425('0x7b')]=_0xf0939e[_0xd425('0x61')]['Imap'][_0xd425('0x7b')];_0x3fc022[_0xd425('0x43')]['port']=_0xf0939e[_0xd425('0x61')][_0xd425('0x43')][_0xd425('0x7c')];_0x3fc022[_0xd425('0x45')][_0xd425('0x7b')]=_0xf0939e[_0xd425('0x61')][_0xd425('0x45')]['host'];_0x3fc022[_0xd425('0x45')]['port']=_0xf0939e[_0xd425('0x61')][_0xd425('0x45')]['port'];}else{_0x3fc022['Imap'][_0xd425('0x7d')]=_0x3fc022[_0xd425('0x45')][_0xd425('0x7d')]=_0xf0939e['body'][_0xd425('0x74')];_0x3fc022['Imap']['user']=_0x3fc022[_0xd425('0x45')][_0xd425('0x76')]=_0xf0939e[_0xd425('0x61')][_0xd425('0x77')];_0x3fc022[_0xd425('0x43')]['password']=_0x3fc022[_0xd425('0x45')][_0xd425('0x79')]=_0xf0939e[_0xd425('0x61')]['cpassword'];}return db[_0xd425('0x5e')][_0xd425('0x67')](_0x3fc022,{'include':[{'model':db[_0xd425('0x44')],'as':_0xd425('0x45')},{'model':db[_0xd425('0x42')],'as':_0xd425('0x43')}]})['then'](function(_0x57ec67){var _0x4aa9aa=_0xf0939e[_0xd425('0x76')]['get']({'plain':!![]});if(!_0x4aa9aa)throw new Error(_0xd425('0x7e'));if(_0x4aa9aa[_0xd425('0x7f')]===_0xd425('0x76')){var _0x1335ba=_0x57ec67[_0xd425('0x3e')]({'plain':!![]});return db[_0xd425('0x80')][_0xd425('0x62')]({'where':{'name':_0xd425('0x81'),'userProfileId':_0x4aa9aa[_0xd425('0x82')]},'raw':!![]})[_0xd425('0x28')](function(_0x234a9e){if(_0x234a9e&&_0x234a9e['autoAssociation']===0x0){return db[_0xd425('0x3f')][_0xd425('0x67')]({'name':_0x1335ba[_0xd425('0x40')],'resourceId':_0x1335ba['id'],'type':_0x234a9e[_0xd425('0x40')],'sectionId':_0x234a9e['id']},{})[_0xd425('0x28')](function(){return _0x57ec67;});}else{return _0x57ec67;}})[_0xd425('0x31')](function(_0x5e796d){logger[_0xd425('0x2c')](_0xd425('0x83'),_0x5e796d);throw _0x5e796d;});}return _0x57ec67;})[_0xd425('0x28')](respondWithResult(_0x3054d7,0xc9))['catch'](handleError(_0x3054d7,null));};exports[_0xd425('0x84')]=function(_0x45b627,_0x47d918,_0x1b407c){return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x45b627[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x47d918,null))['then'](function(_0x23cc22){if(_0x23cc22){return _0x23cc22[_0xd425('0x84')]();}return null;})[_0xd425('0x28')](respondWithResult(_0x47d918,null))[_0xd425('0x31')](handleError(_0x47d918,null));};exports[_0xd425('0x85')]=function(_0x158d96,_0x45dd61,_0x3f12ae){if(_0x158d96[_0xd425('0x61')]['id']){delete _0x158d96[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x158d96[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x45dd61,null))['then'](function(_0x1a3fe7){if(_0x1a3fe7){_0x158d96[_0xd425('0x61')]['MailAccountId']=_0x1a3fe7['id'];return db[_0xd425('0x42')][_0xd425('0x67')](_0x158d96['body']);}})['then'](respondWithResult(_0x45dd61,null))[_0xd425('0x31')](handleError(_0x45dd61,null));};exports[_0xd425('0x86')]=function(_0x532ad1,_0x1d8dc1,_0x266c83){return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x532ad1[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x1d8dc1,null))[_0xd425('0x28')](function(_0x408909){if(_0x408909){return _0x408909[_0xd425('0x88')](null);}return null;})[_0xd425('0x28')](respondWithStatusCode(_0x1d8dc1,null))[_0xd425('0x31')](handleError(_0x1d8dc1,null));};exports[_0xd425('0x89')]=function(_0x3d7a1c,_0x16e1d8,_0x2a3da8){return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x3d7a1c[_0xd425('0x5f')]['id']}})['then'](handleEntityNotFound(_0x16e1d8,null))['then'](function(_0x37dde5){if(_0x37dde5){return _0x37dde5[_0xd425('0x89')]();}return null;})[_0xd425('0x28')](respondWithResult(_0x16e1d8,null))['catch'](handleError(_0x16e1d8,null));};exports[_0xd425('0x8a')]=function(_0x2fb2f4,_0x72c33a,_0x46730c){if(_0x2fb2f4[_0xd425('0x61')]['id']){delete _0x2fb2f4[_0xd425('0x61')]['id'];}return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x2fb2f4[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x72c33a,null))[_0xd425('0x28')](function(_0x548d6c){if(_0x548d6c){_0x2fb2f4[_0xd425('0x61')][_0xd425('0x65')]=_0x548d6c['id'];return db[_0xd425('0x44')][_0xd425('0x67')](_0x2fb2f4[_0xd425('0x61')]);}})[_0xd425('0x28')](respondWithResult(_0x72c33a,null))[_0xd425('0x31')](handleError(_0x72c33a,null));};exports[_0xd425('0x8b')]=function(_0x30368d,_0x4dd27e,_0x791285){return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x30368d[_0xd425('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4dd27e,null))[_0xd425('0x28')](function(_0x5d13ec){if(_0x5d13ec){return _0x5d13ec['setSmtp'](null);}return null;})[_0xd425('0x28')](respondWithStatusCode(_0x4dd27e,null))[_0xd425('0x31')](handleError(_0x4dd27e,null));};exports['addInteraction']=function(_0x53e176,_0x5def4a,_0x173363){return db[_0xd425('0x8c')][_0xd425('0x62')]({'where':{'id':_0x53e176['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x5def4a,null))[_0xd425('0x28')](function(_0x5ca9ab){if(_0x5ca9ab){return _0x5ca9ab[_0xd425('0x8d')](_0x53e176['body'][_0xd425('0x70')],_[_0xd425('0x8e')](_0x53e176[_0xd425('0x61')],['ids','id'])||{});}})[_0xd425('0x28')](respondWithResult(_0x5def4a,null))['catch'](handleError(_0x5def4a,null));};exports[_0xd425('0x8f')]=function(_0x1e2702,_0x5686ae,_0x892c7){var _0x253625={'raw':![],'where':{}};var _0x172fce={};var _0x49d449={'count':0x0,'rows':[]};return db[_0xd425('0x5e')]['findOne']({'where':{'id':_0x1e2702[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x5686ae,null))[_0xd425('0x28')](function(_0x2c3db3){if(_0x2c3db3){_0x172fce['model']=_[_0xd425('0x4c')](db['MailInteraction'][_0xd425('0x48')]);_0x172fce[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x1e2702[_0xd425('0x4d')]);_0x172fce[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x172fce[_0xd425('0x4b')],_0x172fce['query']);_0x253625[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x172fce[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x1e2702[_0xd425('0x4d')][_0xd425('0x51')]));_0x253625[_0xd425('0x50')]=_0x253625[_0xd425('0x50')]['length']?_0x253625['attributes']:_0x172fce['model'];if(!_0x1e2702['query'][_0xd425('0x53')](_0xd425('0x54'))){_0x253625['limit']=qs[_0xd425('0x36')](_0x1e2702['query'][_0xd425('0x36')]);_0x253625['offset']=qs[_0xd425('0x35')](_0x1e2702[_0xd425('0x4d')]['offset']);}_0x253625[_0xd425('0x55')]=qs['sort'](_0x1e2702[_0xd425('0x4d')][_0xd425('0x56')]);_0x253625[_0xd425('0x57')]=qs['filters'](_['pick'](_0x1e2702[_0xd425('0x4d')],_0x172fce['filters']));_0x253625[_0xd425('0x57')][_0xd425('0x65')]=_0x2c3db3['id'];if(_0x1e2702[_0xd425('0x4d')]['filter']){_0x253625[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x253625[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x253625[_0xd425('0x50')],function(_0x5f468a){var _0x36bbaf={};_0x36bbaf[_0x5f468a]={'$like':'%'+_0x1e2702['query'][_0xd425('0x59')]+'%'};return _0x36bbaf;})});}_0x253625=_[_0xd425('0x5a')]({},_0x253625,_0x1e2702[_0xd425('0x5d')]);return db[_0xd425('0x8c')][_0xd425('0x38')]({'where':_0x253625[_0xd425('0x57')]})[_0xd425('0x28')](function(_0x28f8c2){_0x49d449[_0xd425('0x38')]=_0x28f8c2;if(_0x1e2702['query']['includeAll']){_0x253625[_0xd425('0x90')]=[{'model':db['CmContact'],'as':_0xd425('0x91'),'required':![]},{'model':db[_0xd425('0x92')],'as':_0xd425('0x93'),'attributes':[_0xd425('0x40'),'fullname',_0xd425('0x94')],'required':![]},{'model':db[_0xd425('0x95')],'as':'Tags','attributes':['id',_0xd425('0x40'),_0xd425('0x96')],'where':_0x1e2702['query'][_0xd425('0x97')]?{'id':_0x1e2702[_0xd425('0x4d')]['tag']}:undefined,'required':_0x1e2702[_0xd425('0x4d')][_0xd425('0x97')]?!![]:![]}];}return db[_0xd425('0x8c')]['findAll'](_0x253625);})[_0xd425('0x28')](function(_0x50afc2){_0x49d449[_0xd425('0x6a')]=_0x50afc2;return _0x49d449;});}})['then'](respondWithFilteredResult(_0x5686ae,_0x253625))['catch'](handleError(_0x5686ae,null));};exports['addApplications']=function(_0x11c95d,_0x3244d4,_0x2819e8){return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x11c95d[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x3244d4,null))[_0xd425('0x28')](function(_0xb43eb0){if(_0xb43eb0){return db['sequelize'][_0xd425('0x98')](function(_0x26e97b){return db[_0xd425('0x99')][_0xd425('0x3d')]({'where':{'MailAccountId':_0x11c95d[_0xd425('0x5f')]['id']},'transaction':_0x26e97b})[_0xd425('0x28')](function(_0x328b6f){var _0x52fd55=_[_0xd425('0x47')](_0x11c95d[_0xd425('0x61')],function(_0xd4d911){_0xd4d911['MailAccountId']=_0x11c95d[_0xd425('0x5f')]['id'];return _0xd4d911;});return db[_0xd425('0x99')][_0xd425('0x9a')](_0x52fd55,{'transaction':_0x26e97b});});})[_0xd425('0x28')](function(){return db['MailApplication'][_0xd425('0x9b')]({'where':{'MailAccountId':_0x11c95d['params']['id']},'order':_0xd425('0x9c')});});}})[_0xd425('0x28')](respondWithResult(_0x3244d4,null))[_0xd425('0x31')](handleError(_0x3244d4,null));};exports['getApplications']=function(_0x1030e1,_0x17ab99,_0xd43b8){var _0xa7142d={};var _0x297d41={};var _0x154018;var _0x294318;return db['MailAccount'][_0xd425('0x87')]({'where':{'id':_0x1030e1[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x17ab99,null))['then'](function(_0x3388e7){if(_0x3388e7){_0x154018=_0x3388e7;_0x297d41[_0xd425('0x4b')]=_['keys'](db['MailApplication'][_0xd425('0x48')]);_0x297d41[_0xd425('0x4d')]=_[_0xd425('0x4c')](_0x1030e1[_0xd425('0x4d')]);_0x297d41[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x297d41['model'],_0x297d41['query']);_0xa7142d[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x297d41[_0xd425('0x4b')],qs[_0xd425('0x51')](_0x1030e1[_0xd425('0x4d')][_0xd425('0x51')]));_0xa7142d['attributes']=_0xa7142d['attributes'][_0xd425('0x52')]?_0xa7142d[_0xd425('0x50')]:_0x297d41[_0xd425('0x4b')];_0xa7142d[_0xd425('0x55')]=qs['sort'](_0x1030e1['query'][_0xd425('0x56')]);_0xa7142d[_0xd425('0x57')]=qs[_0xd425('0x4e')](_[_0xd425('0x58')](_0x1030e1[_0xd425('0x4d')],_0x297d41[_0xd425('0x4e')]));if(_0x1030e1[_0xd425('0x4d')][_0xd425('0x59')]){_0xa7142d['where']=_[_0xd425('0x5a')](_0xa7142d[_0xd425('0x57')],{'$or':_['map'](_0xa7142d[_0xd425('0x50')],function(_0x4fd860){var _0x2da817={};_0x2da817[_0x4fd860]={'$like':'%'+_0x1030e1[_0xd425('0x4d')][_0xd425('0x59')]+'%'};return _0x2da817;})});}_0xa7142d=_[_0xd425('0x5a')]({},_0xa7142d,_0x1030e1['options']);return _0x154018[_0xd425('0x9d')](_0xa7142d);}})[_0xd425('0x28')](function(_0x96d34){if(_0x96d34){_0x294318=_0x96d34[_0xd425('0x52')];if(!_0x1030e1[_0xd425('0x4d')]['hasOwnProperty'](_0xd425('0x54'))){_0xa7142d[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x1030e1[_0xd425('0x4d')][_0xd425('0x36')]);_0xa7142d[_0xd425('0x35')]=qs[_0xd425('0x35')](_0x1030e1[_0xd425('0x4d')]['offset']);}return _0x154018[_0xd425('0x9d')](_0xa7142d);}})[_0xd425('0x28')](function(_0x3cd344){if(_0x3cd344){return _0x3cd344?{'count':_0x294318,'rows':_0x3cd344}:null;}})['then'](respondWithResult(_0x17ab99,null))[_0xd425('0x31')](handleError(_0x17ab99,null));};exports[_0xd425('0x9e')]=function(_0x5ae8a9,_0x3e6e21,_0x556aa2){var _0x2324e9={'raw':!![],'where':{}};var _0x2ae39f={};var _0x3ef200={'count':0x0,'rows':[]};return db['MailAccount'][_0xd425('0x87')]({'where':{'id':_0x5ae8a9[_0xd425('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3e6e21,null))[_0xd425('0x28')](function(_0x345fe8){if(_0x345fe8){_0x2ae39f[_0xd425('0x4b')]=_[_0xd425('0x4c')](db[_0xd425('0x9f')]['rawAttributes']);_0x2ae39f[_0xd425('0x4d')]=_['keys'](_0x5ae8a9[_0xd425('0x4d')]);_0x2ae39f[_0xd425('0x4e')]=_['intersection'](_0x2ae39f[_0xd425('0x4b')],_0x2ae39f[_0xd425('0x4d')]);_0x2324e9['attributes']=_[_0xd425('0x4f')](_0x2ae39f['model'],qs['fields'](_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x51')]));_0x2324e9[_0xd425('0x50')]=_0x2324e9[_0xd425('0x50')]['length']?_0x2324e9[_0xd425('0x50')]:_0x2ae39f['model'];if(!_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x2324e9['limit']=qs[_0xd425('0x36')](_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x36')]);_0x2324e9[_0xd425('0x35')]=qs['offset'](_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x35')]);}_0x2324e9['order']=qs[_0xd425('0x56')](_0x5ae8a9['query'][_0xd425('0x56')]);_0x2324e9['where']=qs[_0xd425('0x4e')](_[_0xd425('0x58')](_0x5ae8a9[_0xd425('0x4d')],_0x2ae39f[_0xd425('0x4e')]));_0x2324e9[_0xd425('0x57')]['MailAccountId']=_0x345fe8['id'];if(_0x5ae8a9['query'][_0xd425('0x59')]){_0x2324e9[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x2324e9[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x2324e9[_0xd425('0x50')],function(_0x16c6fe){var _0x2ddcf8={};_0x2ddcf8[_0x16c6fe]={'$like':'%'+_0x5ae8a9['query'][_0xd425('0x59')]+'%'};return _0x2ddcf8;})});}if(_0x5ae8a9[_0xd425('0x4d')][_0xd425('0xa0')]){var _0x5e3eb5=_0x5ae8a9[_0xd425('0x4d')][_0xd425('0xa0')][_0xd425('0xa1')](',');var _0x396acc={};_0x396acc[_0x5e3eb5[0x0]]={'$gte':moment(_0x5e3eb5[0x1])[_0xd425('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2324e9[_0xd425('0x57')]=_['merge'](_0x2324e9['where'],_0x396acc);}_0x2324e9=_['merge']({},_0x2324e9,_0x5ae8a9[_0xd425('0x5d')]);return db['MailMessage'][_0xd425('0x38')]({'where':_0x2324e9[_0xd425('0x57')]})['then'](function(_0x1c7a0c){_0x3ef200['count']=_0x1c7a0c;if(_0x5ae8a9[_0xd425('0x4d')][_0xd425('0x6e')]){_0x2324e9[_0xd425('0x90')]=[{'all':!![]}];}return db[_0xd425('0x9f')][_0xd425('0x69')](_0x2324e9);})[_0xd425('0x28')](function(_0x3a0d64){if(_0x5ae8a9[_0xd425('0x4d')]['inlineCss']===_0xd425('0xa3')){for(var _0x9b7949=0x0;_0x9b7949<_0x3a0d64[_0xd425('0x52')];_0x9b7949++){_0x3a0d64[_0x9b7949][_0xd425('0x61')]=juice(_0x3a0d64[_0x9b7949][_0xd425('0x61')]);}}_0x3ef200[_0xd425('0x6a')]=_0x3a0d64;return _0x3ef200;});}})[_0xd425('0x28')](respondWithFilteredResult(_0x3e6e21,_0x2324e9))[_0xd425('0x31')](handleError(_0x3e6e21,null));};exports[_0xd425('0x41')]=function(_0x432e6c,_0x257565,_0xb75c5d){var _0x5b4d87,_0xd36525={},_0x5d3a93;if(_0x432e6c['body']['to']){_0x5d3a93=_0x432e6c[_0xd425('0x61')]['to'][_0xd425('0xa1')](',')[0x0];}return db[_0xd425('0x5e')]['find']({'where':{'id':_0x432e6c[_0xd425('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0xd425('0xa4'),'include':[{'model':db[_0xd425('0xa5')],'as':'Contacts','where':{'email':_0x5d3a93},'limit':0x1,'order':[[_0xd425('0xa6'),_0xd425('0xa7')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x257565,null))['then'](function(_0x377cfd){if(_0x377cfd){_0x5b4d87=_0x377cfd;if(_0x377cfd[_0xd425('0x45')]){if(_['isNil'](_0x432e6c[_0xd425('0x61')][_0xd425('0xa8')])){_0x432e6c[_0xd425('0x61')]['from']=util[_0xd425('0xa2')](_0xd425('0xa9'),_0x377cfd['name'],_0x377cfd[_0xd425('0x71')]||_0x377cfd[_0xd425('0x45')][_0xd425('0x76')]);}if(_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')]&&_0x432e6c['body']['attachments'][_0xd425('0x52')]){for(var _0x297b5e=0x0;_0x297b5e<_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0xd425('0x52')];_0x297b5e+=0x1){_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0x297b5e]={'filename':_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0x297b5e][_0xd425('0x40')],'path':path[_0xd425('0xab')](config[_0xd425('0xac')],_0xd425('0xad'),_0x432e6c[_0xd425('0x61')][_0xd425('0xaa')][_0x297b5e][_0xd425('0xae')])};}}var _0xdda4f0={'tls':{'rejectUnauthorized':![]}};if(_[_0xd425('0x72')](_0x377cfd[_0xd425('0x45')][_0xd425('0x7d')])){if(_0x377cfd['Smtp'][_0xd425('0x7a')]){_0xdda4f0['auth']={'user':_0x377cfd[_0xd425('0x45')][_0xd425('0x76')],'pass':_0x377cfd[_0xd425('0x45')][_0xd425('0x79')]};}_0xdda4f0[_0xd425('0x7b')]=_0x377cfd[_0xd425('0x45')][_0xd425('0x7b')];_0xdda4f0['port']=_0x377cfd['Smtp'][_0xd425('0x7c')];_0xdda4f0[_0xd425('0xaf')]=_0x377cfd[_0xd425('0x45')][_0xd425('0xaf')];}else{_0xdda4f0['service']=_0x377cfd['Smtp'][_0xd425('0x7d')];_0xdda4f0[_0xd425('0xb0')]={'user':_0x377cfd[_0xd425('0x45')]['user'],'pass':_0x377cfd['Smtp'][_0xd425('0x79')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0xdda4f0,'message':_0x432e6c[_0xd425('0x61')]});}else{throw new Error(_0xd425('0xb1'));}}})[_0xd425('0x28')](function(_0x17de44){if(_0x17de44){_0xd36525=_0x17de44;if(_0x5b4d87[_0xd425('0xa4')]){if(_0x5b4d87[_0xd425('0xa4')][_0xd425('0xb2')][_0xd425('0x52')]){return _0x5b4d87['List']['Contacts'][0x0];}else{return db[_0xd425('0xa5')][_0xd425('0x67')](_[_0xd425('0x20')](_0x432e6c[_0xd425('0x61')],{'firstName':_0x432e6c[_0xd425('0x61')]['to'],'email':_0x432e6c['body']['to'],'phone':_0x432e6c[_0xd425('0x61')]['to'],'ListId':_0x5b4d87['ListId']}));}}else{throw new Error(_0xd425('0xb1'));}}})[_0xd425('0x28')](function(_0x286ce3){if(_0x286ce3){var _0xcc0054={'UserId':_0x432e6c['user']['id'],'ContactId':_0x286ce3['id'],'MailAccountId':_0x5b4d87['id'],'inReplyTo':_0xd36525[_0xd425('0xb3')],'to':_0x432e6c[_0xd425('0x61')]['from'],'cc':_0x432e6c[_0xd425('0x61')]['cc'],'subject':_0x432e6c[_0xd425('0x61')][_0xd425('0xb4')],'attach':_0x432e6c[_0xd425('0x61')]['attach'],'firstMsgDirection':_0xd425('0xb5'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xd425('0xb5'),'Messages':[_[_0xd425('0x5a')](_0x432e6c[_0xd425('0x61')],{'messageId':_0xd36525[_0xd425('0xb3')],'sentAt':moment()['format'](_0xd425('0xb6')),'read':!![],'MailAccountId':_0x5b4d87['id'],'UserId':_0x432e6c[_0xd425('0x76')]['id'],'ContactId':_0x286ce3['id']})]};if(_0x432e6c['body']['Interaction']){_0xcc0054=_[_0xd425('0x5a')](_0xcc0054,_0x432e6c[_0xd425('0x61')]['Interaction']);}return db[_0xd425('0x8c')]['create'](_0xcc0054,{'include':[{'model':db['MailMessage'],'as':_0xd425('0xb7')}]});}})[_0xd425('0x28')](respondWithResult(_0x257565,null))[_0xd425('0x31')](handleError(_0x257565,null));};exports[_0xd425('0xb8')]=function(_0x2b1820,_0x3fe209,_0x5ddf36){return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x2b1820['params']['id']},'include':[{'model':db[_0xd425('0x44')],'as':'Smtp','raw':!![]}]})[_0xd425('0x28')](handleEntityNotFound(_0x3fe209,null))[_0xd425('0x28')](function(_0x1f3170){if(_0x1f3170&&_0x1f3170[_0xd425('0x45')]){var _0x2f31f4={'id':_0x1f3170['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1f3170['Smtp'][_0xd425('0x7d')]){_0x2f31f4[_0xd425('0x7d')]=_0x1f3170['Smtp']['service'];}else{_0x2f31f4[_0xd425('0x7b')]=_0x1f3170[_0xd425('0x45')][_0xd425('0x7b')];_0x2f31f4[_0xd425('0x7c')]=_0x1f3170[_0xd425('0x45')][_0xd425('0x7c')];_0x2f31f4['secure']=_0x1f3170['Smtp'][_0xd425('0xaf')];}if(_0x1f3170[_0xd425('0x45')][_0xd425('0x7a')]){_0x2f31f4['auth']={'user':_0x1f3170[_0xd425('0x45')]['user'],'pass':_0x1f3170[_0xd425('0x45')][_0xd425('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0xd425('0xb8'),{'account':_0x2f31f4});}})[_0xd425('0x28')](respondWithResult(_0x3fe209,null))['catch'](handleError(_0x3fe209,null));};exports[_0xd425('0x3d')]=function(_0x28bb88,_0x572e7a){return db[_0xd425('0x5e')]['find']({'where':{'id':_0x28bb88[_0xd425('0x5f')]['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x572e7a,null))[_0xd425('0x28')](function(_0x3db7f2){if(_0x3db7f2&&_0x3db7f2[_0xd425('0x7d')]){throw new db['Sequelize'][(_0xd425('0xb9'))](_0xd425('0xba'));}return _0x3db7f2;})[_0xd425('0x28')](removeEntity(_0x572e7a,null))[_0xd425('0x31')](handleError(_0x572e7a,null));};exports[_0xd425('0xbb')]=function(_0x577d95,_0x772d54,_0x25511a){return db['MailAccount'][_0xd425('0x62')]({'where':{'id':_0x577d95['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x772d54,null))[_0xd425('0x28')](function(_0x1a4c25){if(_0x1a4c25){return _0x1a4c25[_0xd425('0xbb')](_0x577d95['body']['ids'],_['omit'](_0x577d95[_0xd425('0x61')],[_0xd425('0x70'),'id'])||{})[_0xd425('0xbc')](function(_0x565239){for(var _0x168c21=0x0;_0x168c21<_0x577d95[_0xd425('0x61')][_0xd425('0x70')]['length'];_0x168c21+=0x1){socket[_0xd425('0xbd')]('userMailAccount:save',{'UserId':_0x577d95[_0xd425('0x61')][_0xd425('0x70')][_0x168c21],'MailAccountId':_0x577d95[_0xd425('0x5f')]['id']});}return _0x565239;});}})[_0xd425('0x28')](respondWithResult(_0x772d54,null))[_0xd425('0x31')](handleError(_0x772d54,null));};exports[_0xd425('0xbe')]=function(_0x3938a0,_0x12ad46,_0x39877e){return db[_0xd425('0x5e')][_0xd425('0x62')]({'where':{'id':_0x3938a0['params']['id']}})['then'](handleEntityNotFound(_0x12ad46,null))['then'](function(_0x90cf9c){if(_0x90cf9c){return _0x90cf9c['removeAgents'](_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')])['then'](function(){if(_[_0xd425('0xbf')](_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')])){for(var _0x45038a=0x0;_0x45038a<_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')][_0xd425('0x52')];_0x45038a+=0x1){socket[_0xd425('0xbd')](_0xd425('0xc0'),{'UserId':Number(_0x3938a0[_0xd425('0x4d')]['ids'][_0x45038a]),'MailAccountId':Number(_0x3938a0[_0xd425('0x5f')]['id'])});}}else{socket['emit'](_0xd425('0xc0'),{'UserId':Number(_0x3938a0[_0xd425('0x4d')][_0xd425('0x70')]),'MailAccountId':Number(_0x3938a0[_0xd425('0x5f')]['id'])});}});}})[_0xd425('0x28')](respondWithStatusCode(_0x12ad46,null))[_0xd425('0x31')](handleError(_0x12ad46,null));};exports[_0xd425('0xc1')]=function(_0x35db3a,_0x4cba04,_0x5d97b6){var _0x1d5cb9={};var _0x257fad={};var _0x48372c;var _0x569c7e;return db[_0xd425('0x5e')][_0xd425('0x87')]({'where':{'id':_0x35db3a['params']['id']}})[_0xd425('0x28')](handleEntityNotFound(_0x4cba04,null))['then'](function(_0x511853){if(_0x511853){_0x48372c=_0x511853;_0x257fad['model']=_[_0xd425('0x4c')](db[_0xd425('0x92')][_0xd425('0x48')]);_0x257fad['query']=_[_0xd425('0x4c')](_0x35db3a['query']);_0x257fad[_0xd425('0x4e')]=_[_0xd425('0x4f')](_0x257fad['model'],_0x257fad[_0xd425('0x4d')]);_0x1d5cb9[_0xd425('0x50')]=_[_0xd425('0x4f')](_0x257fad[_0xd425('0x4b')],qs['fields'](_0x35db3a[_0xd425('0x4d')]['fields']));_0x1d5cb9[_0xd425('0x50')]=_0x1d5cb9[_0xd425('0x50')][_0xd425('0x52')]?_0x1d5cb9['attributes']:_0x257fad[_0xd425('0x4b')];_0x1d5cb9[_0xd425('0x55')]=qs[_0xd425('0x56')](_0x35db3a[_0xd425('0x4d')][_0xd425('0x56')]);_0x1d5cb9[_0xd425('0x57')]=qs['filters'](_[_0xd425('0x58')](_0x35db3a[_0xd425('0x4d')],_0x257fad[_0xd425('0x4e')]));if(_0x35db3a[_0xd425('0x4d')][_0xd425('0x59')]){_0x1d5cb9[_0xd425('0x57')]=_[_0xd425('0x5a')](_0x1d5cb9[_0xd425('0x57')],{'$or':_[_0xd425('0x47')](_0x1d5cb9[_0xd425('0x50')],function(_0x3c41b5){var _0x281df0={};_0x281df0[_0x3c41b5]={'$like':'%'+_0x35db3a[_0xd425('0x4d')][_0xd425('0x59')]+'%'};return _0x281df0;})});}_0x1d5cb9=_[_0xd425('0x5a')]({},_0x1d5cb9,_0x35db3a['options']);return _0x48372c[_0xd425('0xc1')](_0x1d5cb9);}})[_0xd425('0x28')](function(_0x1cc5e6){if(_0x1cc5e6){_0x569c7e=_0x1cc5e6[_0xd425('0x52')];if(!_0x35db3a[_0xd425('0x4d')][_0xd425('0x53')](_0xd425('0x54'))){_0x1d5cb9[_0xd425('0x36')]=qs[_0xd425('0x36')](_0x35db3a[_0xd425('0x4d')][_0xd425('0x36')]);_0x1d5cb9[_0xd425('0x35')]=qs['offset'](_0x35db3a[_0xd425('0x4d')][_0xd425('0x35')]);}return _0x48372c[_0xd425('0xc1')](_0x1d5cb9);}})[_0xd425('0x28')](function(_0x56234a){if(_0x56234a){return _0x56234a?{'count':_0x569c7e,'rows':_0x56234a}:null;}})[_0xd425('0x28')](respondWithResult(_0x4cba04,null))[_0xd425('0x31')](handleError(_0x4cba04,null));};
\ No newline at end of file
index b3e95ce..294d3bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafec=['hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x646dc9,_0x40859b){var _0x16ae45=function(_0x2cf13b){while(--_0x2cf13b){_0x646dc9['push'](_0x646dc9['shift']());}};_0x16ae45(++_0x40859b);}(_0xafec,0x161));var _0xcafe=function(_0x2cc4e5,_0x3688c8){_0x2cc4e5=_0x2cc4e5-0x0;var _0x3148f5=_0xafec[_0x2cc4e5];return _0x3148f5;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xcafe('0x0'))['db'][_0xcafe('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xcafe('0x2')](0x0);var events={'afterCreate':_0xcafe('0x3'),'afterUpdate':'update','afterDestroy':_0xcafe('0x4')};function emitEvent(_0x4dc193){return function(_0x5709da,_0x3bec39,_0x58538a){MailAccountEvents[_0xcafe('0x5')](_0x4dc193+':'+_0x5709da['id'],_0x5709da);MailAccountEvents[_0xcafe('0x5')](_0x4dc193,_0x5709da);_0x58538a(null);};}for(var e in events){if(events[_0xcafe('0x6')](e)){var event=events[e];MailAccount[_0xcafe('0x7')](e,emitEvent(event));}}module[_0xcafe('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0xad5f=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1d5a18,_0x585dc8){var _0x411450=function(_0x3f4ad8){while(--_0x3f4ad8){_0x1d5a18['push'](_0x1d5a18['shift']());}};_0x411450(++_0x585dc8);}(_0xad5f,0x1a8));var _0xfad5=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0xad5f[_0x1876b2];return _0x9fb1e0;};'use strict';var EventEmitter=require(_0xfad5('0x0'));var MailAccount=require(_0xfad5('0x1'))['db'][_0xfad5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xfad5('0x3')](0x0);var events={'afterCreate':_0xfad5('0x4'),'afterUpdate':_0xfad5('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcc61b1){return function(_0x316561,_0x1ae06d,_0x2da73e){MailAccountEvents[_0xfad5('0x6')](_0xcc61b1+':'+_0x316561['id'],_0x316561);MailAccountEvents[_0xfad5('0x6')](_0xcc61b1,_0x316561);_0x2da73e(null);};}for(var e in events){if(events[_0xfad5('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xfad5('0x8')]=MailAccountEvents;
\ No newline at end of file
index 4fed729..d26d80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10c1=['MailAccount','mail_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x10c1,0x1b2));var _0x110c=function(_0x86e467,_0x2d21ce){_0x86e467=_0x86e467-0x0;var _0x2a1c48=_0x10c1[_0x86e467];return _0x2a1c48;};'use strict';var _=require(_0x110c('0x0'));var util=require(_0x110c('0x1'));var logger=require('../../config/logger')(_0x110c('0x2'));var moment=require(_0x110c('0x3'));var BPromise=require(_0x110c('0x4'));var rp=require(_0x110c('0x5'));var fs=require('fs');var path=require(_0x110c('0x6'));var rimraf=require(_0x110c('0x7'));var config=require('../../config/environment');var attributes=require('./mailAccount.attributes');module[_0x110c('0x8')]=function(_0x58a057,_0x17e5f2){return _0x58a057[_0x110c('0x9')](_0x110c('0xa'),attributes,{'tableName':_0x110c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x547b=['api','moment','request-promise','rimraf','../../config/environment','./mailAccount.attributes','MailAccount','mail_accounts','lodash','util'];(function(_0x7655fc,_0x37b951){var _0x46d2d0=function(_0x1f571c){while(--_0x1f571c){_0x7655fc['push'](_0x7655fc['shift']());}};_0x46d2d0(++_0x37b951);}(_0x547b,0xa8));var _0xb547=function(_0x16da3c,_0x3e89b8){_0x16da3c=_0x16da3c-0x0;var _0x5840b6=_0x547b[_0x16da3c];return _0x5840b6;};'use strict';var _=require(_0xb547('0x0'));var util=require(_0xb547('0x1'));var logger=require('../../config/logger')(_0xb547('0x2'));var moment=require(_0xb547('0x3'));var BPromise=require('bluebird');var rp=require(_0xb547('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb547('0x5'));var config=require(_0xb547('0x6'));var attributes=require(_0xb547('0x7'));module['exports']=function(_0x4f026e,_0x45006e){return _0x4f026e['define'](_0xb547('0x8'),attributes,{'tableName':_0xb547('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1616254..43be6e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x983f=['./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','limit','map','include','model','attributes','then','ShowMailAccount','find','debug','body','mail','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','MailApplication','MailServerOut','Smtp','get','account','omit','Applications','applications','orderBy','priority','asc','autoclose','length','close','*,*,*,*','CmContact','List\x20not\x20found','messageId','generate','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','subject','interaction','created','create','contact','attachments','originTo','originCc','bcc','originChannel','Email','ChatOfflineMessageId','Attachment','UserId','name','unshift','agent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x983f,0x12b));var _0xf983=function(_0x1272f2,_0x508496){_0x1272f2=_0x1272f2-0x0;var _0x5a02a5=_0x983f[_0x1272f2];return _0x5a02a5;};'use strict';var _=require(_0xf983('0x0'));var util=require(_0xf983('0x1'));var moment=require(_0xf983('0x2'));var BPromise=require(_0xf983('0x3'));var rs=require(_0xf983('0x4'));var fs=require('fs');var Redis=require(_0xf983('0x5'));var db=require(_0xf983('0x6'))['db'];var utils=require(_0xf983('0x7'));var logger=require(_0xf983('0x8'))('rpc');var config=require(_0xf983('0x9'));var jayson=require(_0xf983('0xa'));var client=jayson[_0xf983('0xb')]['http']({'port':0x232c});config['redis']=_[_0xf983('0xc')](config[_0xf983('0xd')],{'host':_0xf983('0xe'),'port':0x18eb});var socket=require(_0xf983('0xf'))(new Redis(config[_0xf983('0xd')]));require(_0xf983('0x10'))[_0xf983('0x11')](socket);function respondWithRpcPromise(_0xbbf549,_0x4b63cd,_0x4cb21f){return new BPromise(function(_0x5cf6a0,_0xfe72b8){return client[_0xf983('0x12')](_0xbbf549,_0x4cb21f)['then'](function(_0x26265d){logger[_0xf983('0x13')](_0xf983('0x14'),_0x4b63cd,_0xf983('0x15'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x4b63cd,_0xf983('0x15'),JSON[_0xf983('0x16')](_0x26265d));if(_0x26265d['error']){if(_0x26265d[_0xf983('0x17')][_0xf983('0x18')]===0x1f4){logger[_0xf983('0x17')](_0xf983('0x14'),_0x4b63cd,_0x26265d[_0xf983('0x17')]['message']);return _0xfe72b8(_0x26265d[_0xf983('0x17')]['message']);}logger['error'](_0xf983('0x14'),_0x4b63cd,_0x26265d['error']['message']);return _0x5cf6a0(_0x26265d['error'][_0xf983('0x19')]);}else{logger[_0xf983('0x13')]('MailAccount,\x20%s,\x20%s',_0x4b63cd,_0xf983('0x15'));_0x5cf6a0(_0x26265d['result'][_0xf983('0x19')]);}})[_0xf983('0x1a')](function(_0x3501d0){logger[_0xf983('0x17')](_0xf983('0x14'),_0x4b63cd,_0x3501d0);_0xfe72b8(_0x3501d0);});});}exports[_0xf983('0x1b')]=function(_0x40fa2e){var _0x35925a=this;return new Promise(function(_0x23c6a2,_0x720dd){return db[_0xf983('0x1c')][_0xf983('0x1d')]({'raw':_0x40fa2e[_0xf983('0x1e')]?_0x40fa2e[_0xf983('0x1e')][_0xf983('0x1f')]===undefined?!![]:![]:!![],'where':_0x40fa2e[_0xf983('0x1e')]?_0x40fa2e[_0xf983('0x1e')]['where']||null:null,'attributes':_0x40fa2e[_0xf983('0x1e')]?_0x40fa2e[_0xf983('0x1e')]['attributes']||null:null,'limit':_0x40fa2e[_0xf983('0x1e')]?_0x40fa2e[_0xf983('0x1e')][_0xf983('0x20')]||null:null,'include':_0x40fa2e['options']?_0x40fa2e[_0xf983('0x1e')]['include']?_[_0xf983('0x21')](_0x40fa2e[_0xf983('0x1e')][_0xf983('0x22')],function(_0x5247cb){return{'model':db[_0x5247cb[_0xf983('0x23')]],'as':_0x5247cb['as'],'attributes':_0x5247cb[_0xf983('0x24')],'include':_0x5247cb[_0xf983('0x22')]?_['map'](_0x5247cb[_0xf983('0x22')],function(_0x501347){return{'model':db[_0x501347[_0xf983('0x23')]],'as':_0x501347['as'],'attributes':_0x501347[_0xf983('0x24')],'include':_0x501347[_0xf983('0x22')]?_[_0xf983('0x21')](_0x501347[_0xf983('0x22')],function(_0x410074){return{'model':db[_0x410074[_0xf983('0x23')]],'as':_0x410074['as'],'attributes':_0x410074[_0xf983('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf983('0x25')](function(_0x2d7453){logger['info']('GetMailAccount',_0x40fa2e);logger['debug'](_0xf983('0x1b'),_0x40fa2e,JSON[_0xf983('0x16')](_0x2d7453));_0x23c6a2(_0x2d7453);})['catch'](function(_0x4de447){logger[_0xf983('0x17')](_0xf983('0x1b'),_0x4de447[_0xf983('0x19')],_0x40fa2e);_0x720dd(_0x35925a[_0xf983('0x17')](0x1f4,_0x4de447[_0xf983('0x19')]));});});};exports[_0xf983('0x26')]=function(_0x44576b){var _0x16f9d5=this;return new Promise(function(_0x15efa9,_0x58c2c0){return db[_0xf983('0x1c')][_0xf983('0x27')]({'raw':_0x44576b['options']?_0x44576b['options']['raw']===undefined?!![]:![]:!![],'where':_0x44576b[_0xf983('0x1e')]?_0x44576b['options']['where']||null:null,'attributes':_0x44576b[_0xf983('0x1e')]?_0x44576b['options'][_0xf983('0x24')]||null:null,'include':_0x44576b[_0xf983('0x1e')]?_0x44576b['options'][_0xf983('0x22')]?_[_0xf983('0x21')](_0x44576b['options'][_0xf983('0x22')],function(_0x549502){return{'model':db[_0x549502[_0xf983('0x23')]],'as':_0x549502['as'],'attributes':_0x549502[_0xf983('0x24')],'include':_0x549502['include']?_[_0xf983('0x21')](_0x549502[_0xf983('0x22')],function(_0x12f569){return{'model':db[_0x12f569['model']],'as':_0x12f569['as'],'attributes':_0x12f569[_0xf983('0x24')],'include':_0x12f569['include']?_[_0xf983('0x21')](_0x12f569[_0xf983('0x22')],function(_0x5649d8){return{'model':db[_0x5649d8[_0xf983('0x23')]],'as':_0x5649d8['as'],'attributes':_0x5649d8[_0xf983('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf983('0x25')](function(_0x12513d){logger['info']('ShowMailAccount',_0x44576b);logger[_0xf983('0x28')](_0xf983('0x26'),_0x44576b,JSON[_0xf983('0x16')](_0x12513d));_0x15efa9(_0x12513d);})[_0xf983('0x1a')](function(_0x3558b5){logger['error'](_0xf983('0x26'),_0x3558b5[_0xf983('0x19')],_0x44576b);_0x58c2c0(_0x16f9d5['error'](0x1f4,_0x3558b5[_0xf983('0x19')]));});});};exports['NotifyMailAccount']=function(_0x354e45){var _0x4075e4=this;return new Promise(function(_0x31f18f,_0xb53b79){var _0x1a8264={'body':_0x354e45[_0xf983('0x29')],'channel':_0xf983('0x2a')};var _0x473fca=_['difference'](_['keys'](db['CmContact']['rawAttributes']),[_0xf983('0x2b'),_0xf983('0x2c'),_0xf983('0x2d'),_0xf983('0x2e')]);var _0x1038cd=![];if(_0x354e45[_0xf983('0x29')]['id']){delete _0x354e45[_0xf983('0x29')]['id'];}if(_[_0xf983('0x2f')](_0x354e45[_0xf983('0x29')][_0xf983('0x30')])){return _0xb53b79(_0x4075e4[_0xf983('0x17')](0x1f4,_0xf983('0x31')));}if(_[_0xf983('0x2f')](_0x354e45[_0xf983('0x29')][_0xf983('0x29')])||_0x354e45[_0xf983('0x29')]['body']===''){return _0xb53b79(_0x4075e4['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xf983('0x2f')](_0x354e45[_0xf983('0x29')]['mapKey'])){return _0xb53b79(_0x4075e4[_0xf983('0x17')](0x1f4,_0xf983('0x32')+_0x473fca));}if(!_[_0xf983('0x33')](_0x473fca,_0x354e45[_0xf983('0x29')][_0xf983('0x34')])){return _0xb53b79(_0x4075e4[_0xf983('0x17')](0x1f4,_0xf983('0x35')+_0x473fca));}var _0x491f2d={};_0x491f2d[_0x354e45[_0xf983('0x29')]['mapKey']]=_0x354e45['body'][_0xf983('0x30')];return db[_0xf983('0x1c')][_0xf983('0x27')]({'where':{'id':_0x354e45['account']['id']},'include':[{'model':db[_0xf983('0x36')],'as':_0xf983('0x37'),'include':[{'model':db['CmContact'],'as':_0xf983('0x38'),'where':_0x491f2d,'limit':0x1,'order':[[_0xf983('0x2c'),'DESC']]}]},{'model':db[_0xf983('0x39')],'as':'Applications'},{'model':db[_0xf983('0x3a')],'as':_0xf983('0x3b')}]})[_0xf983('0x25')](function(_0x3f0d07){if(_0x3f0d07&&_0x3f0d07[_0xf983('0x37')]){var _0x102a0d=_0x3f0d07[_0xf983('0x3c')]({'plain':!![]});_0x1a8264[_0xf983('0x3d')]=_[_0xf983('0x3e')](_0x102a0d,[_0xf983('0x3f'),'List']);_0x1a8264[_0xf983('0x40')]=_0x102a0d[_0xf983('0x3f')];_0x1a8264['list']=_0x102a0d[_0xf983('0x37')];_0x1a8264[_0xf983('0x40')]=_[_0xf983('0x41')](_0x1a8264[_0xf983('0x40')],[_0xf983('0x42')],[_0xf983('0x43')]);if(_0x1a8264[_0xf983('0x3d')]&&_0x1a8264[_0xf983('0x3d')][_0xf983('0x44')]){_0x1a8264[_0xf983('0x40')]['push']({'id':0x0,'priority':_0x1a8264[_0xf983('0x40')][_0xf983('0x45')]+0x1,'app':_0xf983('0x46'),'appdata':_0xf983('0x44'),'interval':_0xf983('0x47')});}if(_0x1a8264['account'][_0xf983('0x3f')]){delete _0x1a8264[_0xf983('0x3d')][_0xf983('0x3f')];}if(_0x1a8264[_0xf983('0x3d')][_0xf983('0x37')]){delete _0x1a8264[_0xf983('0x3d')][_0xf983('0x37')];}if(_0x102a0d['List'][_0xf983('0x38')][_0xf983('0x45')]){return _0x102a0d['List'][_0xf983('0x38')][0x0];}var _0x334df3=_[_0xf983('0xc')](_0x354e45['body'],{'firstName':_0x354e45['body'][_0xf983('0x30')],'ListId':_0x102a0d['ListId']});_0x334df3[_0x354e45[_0xf983('0x29')][_0xf983('0x34')]]=_0x354e45[_0xf983('0x29')]['from'];return db[_0xf983('0x48')]['create'](_0x334df3);}else{throw new Error(_0xf983('0x49'));}})[_0xf983('0x25')](function(_0x4b2ec8){_0x1a8264['contact']=_0x4b2ec8;if(_0x4b2ec8){if(!_0x354e45[_0xf983('0x29')]['message']['messageId']){_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x4a')]=rs[_0xf983('0x4b')]()+'\x20'+_0x354e45['body'][_0xf983('0x19')][_0xf983('0x30')];}var _0x1fe562={'ContactId':_0x4b2ec8['id'],'MailAccountId':_0x354e45['account']['id'],'inReplyTo':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x4a')],'to':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x30')],'cc':_0x354e45[_0xf983('0x29')]['message']['cc'],'subject':_0x354e45[_0xf983('0x29')][_0xf983('0x19')]['subject'],'attach':_0x354e45[_0xf983('0x29')]['message'][_0xf983('0x4c')],'lastMsgAt':moment()[_0xf983('0x4d')](_0xf983('0x4e')),'lastMsgDirection':'in'};return db[_0xf983('0x4f')][_0xf983('0x27')]({'where':{'closed':![],'MailAccountId':_0x354e45[_0xf983('0x3d')]['id']},'include':[{'model':db[_0xf983('0x50')],'as':_0xf983('0x51'),'attributes':[_0xf983('0x4a')],'where':{'messageId':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x52')]}}]})[_0xf983('0x25')](function(_0x23b497){if(_0x23b497){return[_0x23b497,![]];}return db[_0xf983('0x4f')]['create'](_0x1fe562)['then'](function(_0x2dae3c){return[_0x2dae3c,!![]];});});}else{throw new Error(_0xf983('0x53'));}})[_0xf983('0x54')](function(_0x38807f,_0x49de99){if(_0x38807f){_0x1038cd=_0x49de99;if(!_0x49de99){return _0x38807f[_0xf983('0x55')]({'inReplyTo':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x4a')],'to':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x30')],'cc':_0x354e45['body'][_0xf983('0x19')]['cc'],'subject':_0x354e45[_0xf983('0x29')]['message'][_0xf983('0x56')],'attach':_0x38807f['attach']?_0x38807f[_0xf983('0x4c')]:_0x354e45['body'][_0xf983('0x19')][_0xf983('0x4c')],'substatus':null,'substatusAt':moment()[_0xf983('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xf983('0x4d')](_0xf983('0x4e')),'lastMsgDirection':'in'});}else{return _0x38807f;}}})[_0xf983('0x25')](function(_0x489c5e){_0x1a8264[_0xf983('0x57')]=_0x489c5e[_0xf983('0x3c')]({'plain':!![]});_0x1a8264['interaction'][_0xf983('0x58')]=_0x1038cd;return db['MailMessage'][_0xf983('0x59')]({'body':_0x354e45[_0xf983('0x29')][_0xf983('0x29')],'MailAccountId':_0x354e45[_0xf983('0x3d')]['id'],'MailInteractionId':_0x489c5e['id'],'direction':'in','ContactId':_0x1a8264[_0xf983('0x5a')]['id'],'messageId':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x4a')],'from':_0x354e45[_0xf983('0x29')][_0xf983('0x19')]['from'],'to':_0x354e45[_0xf983('0x29')][_0xf983('0x19')]['to'],'cc':_0x354e45[_0xf983('0x29')]['message']['cc'],'subject':_0x354e45[_0xf983('0x29')][_0xf983('0x19')]['subject'],'attach':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x4c')],'Attachments':_0x354e45['body'][_0xf983('0x19')][_0xf983('0x5b')],'originTo':_0x354e45[_0xf983('0x29')]['message'][_0xf983('0x5c')],'originCc':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x5d')],'bcc':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x5e')],'ChatWebsiteId':_0x354e45['body'][_0xf983('0x19')]['ChatWebsiteId']||null,'originChannel':_0x354e45[_0xf983('0x29')][_0xf983('0x19')][_0xf983('0x5f')]||_0xf983('0x60'),'ChatOfflineMessageId':_0x354e45['body']['message'][_0xf983('0x61')]||null},{'include':[{'model':db[_0xf983('0x62')],'as':'Attachments'}]});})['then'](function(_0x24c1ae){_0x1a8264[_0xf983('0x19')]=_0x24c1ae;if(_0x1a8264[_0xf983('0x57')][_0xf983('0x63')]){return db['User']['find']({'attributes':['id',_0xf983('0x64')],'where':{'id':_0x1a8264[_0xf983('0x57')][_0xf983('0x63')]}})['then'](function(_0x5d5f6f){if(_0x5d5f6f){_0x1a8264[_0xf983('0x40')][_0xf983('0x65')]({'id':0x0,'priority':0x0,'app':_0xf983('0x66'),'appdata':_0x5d5f6f[_0xf983('0x64')]+','+(_0x1a8264['account']['waitForTheAssignedAgent']||0xa),'interval':_0xf983('0x47')});}return respondWithRpcPromise('Start',_0xf983('0x67'),_0x1a8264);});}return respondWithRpcPromise(_0xf983('0x68'),_0xf983('0x67'),_0x1a8264);})[_0xf983('0x25')](function(_0x3e7d92){_0x31f18f(_0x3e7d92);})['catch'](function(_0x50d0f0){_0xb53b79(_0x4075e4['error'](0x1f4,_0x50d0f0[_0xf983('0x19')]));});});};
\ No newline at end of file
+var _0x67db=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','findAll','raw','options','attributes','limit','include','map','model','then','info','GetMailAccount','debug','ShowMailAccount','find','where','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','applications','orderBy','priority','asc','push','autoclose','*,*,*,*','length','defaults','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','get','interaction','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','bluebird','randomstring','ioredis'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x67db,0x69));var _0xb67d=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x67db[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xb67d('0x0'));var moment=require('moment');var BPromise=require(_0xb67d('0x1'));var rs=require(_0xb67d('0x2'));var fs=require('fs');var Redis=require(_0xb67d('0x3'));var db=require(_0xb67d('0x4'))['db'];var utils=require(_0xb67d('0x5'));var logger=require(_0xb67d('0x6'))(_0xb67d('0x7'));var config=require(_0xb67d('0x8'));var jayson=require(_0xb67d('0x9'));var client=jayson[_0xb67d('0xa')]['http']({'port':0x232c});config[_0xb67d('0xb')]=_['defaults'](config[_0xb67d('0xb')],{'host':_0xb67d('0xc'),'port':0x18eb});var socket=require(_0xb67d('0xd'))(new Redis(config[_0xb67d('0xb')]));require(_0xb67d('0xe'))[_0xb67d('0xf')](socket);function respondWithRpcPromise(_0x51c26d,_0x26ef2f,_0x3ad225){return new BPromise(function(_0x3b80bf,_0x1e0b57){return client[_0xb67d('0x10')](_0x51c26d,_0x3ad225)['then'](function(_0x289bb1){logger['info']('MailAccount,\x20%s,\x20%s',_0x26ef2f,_0xb67d('0x11'));logger['debug'](_0xb67d('0x12'),_0x26ef2f,_0xb67d('0x11'),JSON[_0xb67d('0x13')](_0x289bb1));if(_0x289bb1['error']){if(_0x289bb1[_0xb67d('0x14')][_0xb67d('0x15')]===0x1f4){logger[_0xb67d('0x14')](_0xb67d('0x16'),_0x26ef2f,_0x289bb1[_0xb67d('0x14')][_0xb67d('0x17')]);return _0x1e0b57(_0x289bb1[_0xb67d('0x14')][_0xb67d('0x17')]);}logger[_0xb67d('0x14')](_0xb67d('0x16'),_0x26ef2f,_0x289bb1[_0xb67d('0x14')][_0xb67d('0x17')]);return _0x3b80bf(_0x289bb1[_0xb67d('0x14')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x26ef2f,'request\x20sent');_0x3b80bf(_0x289bb1[_0xb67d('0x18')][_0xb67d('0x17')]);}})[_0xb67d('0x19')](function(_0x426968){logger['error']('MailAccount,\x20%s,\x20%s',_0x26ef2f,_0x426968);_0x1e0b57(_0x426968);});});}exports['GetMailAccount']=function(_0x163119){var _0x5ed00c=this;return new Promise(function(_0x24d16f,_0x2d88b7){return db[_0xb67d('0x1a')][_0xb67d('0x1b')]({'raw':_0x163119['options']?_0x163119['options'][_0xb67d('0x1c')]===undefined?!![]:![]:!![],'where':_0x163119['options']?_0x163119['options']['where']||null:null,'attributes':_0x163119[_0xb67d('0x1d')]?_0x163119['options'][_0xb67d('0x1e')]||null:null,'limit':_0x163119[_0xb67d('0x1d')]?_0x163119[_0xb67d('0x1d')][_0xb67d('0x1f')]||null:null,'include':_0x163119[_0xb67d('0x1d')]?_0x163119[_0xb67d('0x1d')][_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x163119['options']['include'],function(_0x32f09f){return{'model':db[_0x32f09f[_0xb67d('0x22')]],'as':_0x32f09f['as'],'attributes':_0x32f09f[_0xb67d('0x1e')],'include':_0x32f09f[_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x32f09f[_0xb67d('0x20')],function(_0x6dc152){return{'model':db[_0x6dc152[_0xb67d('0x22')]],'as':_0x6dc152['as'],'attributes':_0x6dc152[_0xb67d('0x1e')],'include':_0x6dc152['include']?_['map'](_0x6dc152[_0xb67d('0x20')],function(_0x2304c8){return{'model':db[_0x2304c8[_0xb67d('0x22')]],'as':_0x2304c8['as'],'attributes':_0x2304c8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb67d('0x23')](function(_0x11334a){logger[_0xb67d('0x24')](_0xb67d('0x25'),_0x163119);logger[_0xb67d('0x26')]('GetMailAccount',_0x163119,JSON[_0xb67d('0x13')](_0x11334a));_0x24d16f(_0x11334a);})[_0xb67d('0x19')](function(_0x130bcc){logger[_0xb67d('0x14')](_0xb67d('0x25'),_0x130bcc[_0xb67d('0x17')],_0x163119);_0x2d88b7(_0x5ed00c[_0xb67d('0x14')](0x1f4,_0x130bcc[_0xb67d('0x17')]));});});};exports[_0xb67d('0x27')]=function(_0x3a58c3){var _0x30161b=this;return new Promise(function(_0x166c31,_0x5dba99){return db[_0xb67d('0x1a')][_0xb67d('0x28')]({'raw':_0x3a58c3[_0xb67d('0x1d')]?_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a58c3['options']?_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x29')]||null:null,'attributes':_0x3a58c3[_0xb67d('0x1d')]?_0x3a58c3['options']['attributes']||null:null,'include':_0x3a58c3[_0xb67d('0x1d')]?_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x3a58c3[_0xb67d('0x1d')][_0xb67d('0x20')],function(_0x5d5b06){return{'model':db[_0x5d5b06['model']],'as':_0x5d5b06['as'],'attributes':_0x5d5b06[_0xb67d('0x1e')],'include':_0x5d5b06[_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x5d5b06[_0xb67d('0x20')],function(_0x41f486){return{'model':db[_0x41f486['model']],'as':_0x41f486['as'],'attributes':_0x41f486[_0xb67d('0x1e')],'include':_0x41f486[_0xb67d('0x20')]?_[_0xb67d('0x21')](_0x41f486['include'],function(_0x339cc1){return{'model':db[_0x339cc1[_0xb67d('0x22')]],'as':_0x339cc1['as'],'attributes':_0x339cc1[_0xb67d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a3232){logger[_0xb67d('0x24')](_0xb67d('0x27'),_0x3a58c3);logger[_0xb67d('0x26')](_0xb67d('0x27'),_0x3a58c3,JSON[_0xb67d('0x13')](_0x1a3232));_0x166c31(_0x1a3232);})[_0xb67d('0x19')](function(_0x1af8fd){logger['error'](_0xb67d('0x27'),_0x1af8fd[_0xb67d('0x17')],_0x3a58c3);_0x5dba99(_0x30161b[_0xb67d('0x14')](0x1f4,_0x1af8fd['message']));});});};exports[_0xb67d('0x2a')]=function(_0x4aedd1){var _0x10da42=this;return new Promise(function(_0xd585fc,_0x4ebc95){var _0x30e1d0={'body':_0x4aedd1[_0xb67d('0x2b')],'channel':_0xb67d('0x2c')};var _0x3c9ad8=_[_0xb67d('0x2d')](_['keys'](db[_0xb67d('0x2e')][_0xb67d('0x2f')]),[_0xb67d('0x30'),_0xb67d('0x31'),_0xb67d('0x32'),_0xb67d('0x33')]);var _0x38de8c=![];if(_0x4aedd1[_0xb67d('0x2b')]['id']){delete _0x4aedd1['body']['id'];}if(_[_0xb67d('0x34')](_0x4aedd1[_0xb67d('0x2b')]['from'])){return _0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,_0xb67d('0x35')));}if(_[_0xb67d('0x34')](_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x2b')])||_0x4aedd1[_0xb67d('0x2b')]['body']===''){return _0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,_0xb67d('0x36')));}if(_['isNil'](_0x4aedd1['body']['mapKey'])){return _0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c9ad8));}if(!_[_0xb67d('0x37')](_0x3c9ad8,_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x38')])){return _0x4ebc95(_0x10da42['error'](0x1f4,_0xb67d('0x39')+_0x3c9ad8));}var _0xe3923d={};_0xe3923d[_0x4aedd1[_0xb67d('0x2b')]['mapKey']]=_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x3a')];return db[_0xb67d('0x1a')][_0xb67d('0x28')]({'where':{'id':_0x4aedd1[_0xb67d('0x3b')]['id']},'include':[{'model':db[_0xb67d('0x3c')],'as':'List','include':[{'model':db[_0xb67d('0x2e')],'as':_0xb67d('0x3d'),'where':_0xe3923d,'limit':0x1,'order':[[_0xb67d('0x31'),_0xb67d('0x3e')]]}]},{'model':db[_0xb67d('0x3f')],'as':_0xb67d('0x40')},{'model':db[_0xb67d('0x41')],'as':_0xb67d('0x42')}]})[_0xb67d('0x23')](function(_0x2fee69){if(_0x2fee69&&_0x2fee69[_0xb67d('0x43')]){var _0x8042b1=_0x2fee69['get']({'plain':!![]});_0x30e1d0['account']=_['omit'](_0x8042b1,[_0xb67d('0x40'),'List']);_0x30e1d0[_0xb67d('0x44')]=_0x8042b1['Applications'];_0x30e1d0['list']=_0x8042b1['List'];_0x30e1d0[_0xb67d('0x44')]=_[_0xb67d('0x45')](_0x30e1d0['applications'],[_0xb67d('0x46')],[_0xb67d('0x47')]);if(_0x30e1d0['account']&&_0x30e1d0['account']['autoclose']){_0x30e1d0[_0xb67d('0x44')][_0xb67d('0x48')]({'id':0x0,'priority':_0x30e1d0['applications']['length']+0x1,'app':'close','appdata':_0xb67d('0x49'),'interval':_0xb67d('0x4a')});}if(_0x30e1d0[_0xb67d('0x3b')]['Applications']){delete _0x30e1d0[_0xb67d('0x3b')][_0xb67d('0x40')];}if(_0x30e1d0[_0xb67d('0x3b')]['List']){delete _0x30e1d0[_0xb67d('0x3b')][_0xb67d('0x43')];}if(_0x8042b1['List'][_0xb67d('0x3d')][_0xb67d('0x4b')]){return _0x8042b1[_0xb67d('0x43')][_0xb67d('0x3d')][0x0];}var _0x156b01=_[_0xb67d('0x4c')](_0x4aedd1[_0xb67d('0x2b')],{'firstName':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x3a')],'ListId':_0x8042b1['ListId']});_0x156b01[_0x4aedd1['body'][_0xb67d('0x38')]]=_0x4aedd1[_0xb67d('0x2b')]['from'];return db[_0xb67d('0x2e')][_0xb67d('0x4d')](_0x156b01);}else{throw new Error(_0xb67d('0x4e'));}})[_0xb67d('0x23')](function(_0x2fdb4b){_0x30e1d0[_0xb67d('0x4f')]=_0x2fdb4b;if(_0x2fdb4b){if(!_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x50')]){_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x50')]=rs[_0xb67d('0x51')]()+'\x20'+_0x4aedd1['body']['message'][_0xb67d('0x3a')];}var _0x3ecf7e={'ContactId':_0x2fdb4b['id'],'MailAccountId':_0x4aedd1[_0xb67d('0x3b')]['id'],'inReplyTo':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x50')],'to':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x3a')],'cc':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['cc'],'subject':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x52')],'attach':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x53')],'lastMsgAt':moment()[_0xb67d('0x54')](_0xb67d('0x55')),'lastMsgDirection':'in'};return db[_0xb67d('0x56')][_0xb67d('0x28')]({'where':{'closed':![],'MailAccountId':_0x4aedd1['account']['id']},'include':[{'model':db[_0xb67d('0x57')],'as':_0xb67d('0x58'),'attributes':[_0xb67d('0x50')],'where':{'messageId':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x59')]}}]})[_0xb67d('0x23')](function(_0x1ce43f){if(_0x1ce43f){return[_0x1ce43f,![]];}return db[_0xb67d('0x56')]['create'](_0x3ecf7e)['then'](function(_0x4e0362){return[_0x4e0362,!![]];});});}else{throw new Error(_0xb67d('0x5a'));}})['spread'](function(_0x58493d,_0x28380d){if(_0x58493d){_0x38de8c=_0x28380d;if(!_0x28380d){return _0x58493d[_0xb67d('0x5b')]({'inReplyTo':_0x4aedd1['body']['message'][_0xb67d('0x50')],'to':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['from'],'cc':_0x4aedd1[_0xb67d('0x2b')]['message']['cc'],'subject':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x52')],'attach':_0x58493d['attach']?_0x58493d['attach']:_0x4aedd1['body'][_0xb67d('0x17')]['attach'],'substatus':null,'substatusAt':moment()[_0xb67d('0x54')](_0xb67d('0x55')),'lastMsgAt':moment()[_0xb67d('0x54')](_0xb67d('0x55')),'lastMsgDirection':'in'});}else{return _0x58493d;}}})[_0xb67d('0x23')](function(_0x5117c7){_0x30e1d0['interaction']=_0x5117c7[_0xb67d('0x5c')]({'plain':!![]});_0x30e1d0[_0xb67d('0x5d')]['created']=_0x38de8c;return db[_0xb67d('0x57')][_0xb67d('0x4d')]({'body':_0x4aedd1[_0xb67d('0x2b')]['body'],'MailAccountId':_0x4aedd1[_0xb67d('0x3b')]['id'],'MailInteractionId':_0x5117c7['id'],'direction':'in','ContactId':_0x30e1d0[_0xb67d('0x4f')]['id'],'messageId':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x50')],'from':_0x4aedd1[_0xb67d('0x2b')]['message']['from'],'to':_0x4aedd1['body'][_0xb67d('0x17')]['to'],'cc':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['cc'],'subject':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x52')],'attach':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x53')],'Attachments':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')]['attachments'],'originTo':_0x4aedd1['body'][_0xb67d('0x17')][_0xb67d('0x5e')],'originCc':_0x4aedd1[_0xb67d('0x2b')]['message'][_0xb67d('0x5f')],'bcc':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x60')],'ChatWebsiteId':_0x4aedd1[_0xb67d('0x2b')][_0xb67d('0x17')][_0xb67d('0x61')]||null,'originChannel':_0x4aedd1[_0xb67d('0x2b')]['message']['originChannel']||_0xb67d('0x62'),'ChatOfflineMessageId':_0x4aedd1[_0xb67d('0x2b')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb67d('0x63')],'as':_0xb67d('0x64')}]});})[_0xb67d('0x23')](function(_0x589a74){_0x30e1d0[_0xb67d('0x17')]=_0x589a74;if(_0x30e1d0[_0xb67d('0x5d')]['UserId']){return db[_0xb67d('0x65')][_0xb67d('0x28')]({'attributes':['id',_0xb67d('0x66')],'where':{'id':_0x30e1d0['interaction'][_0xb67d('0x67')]}})[_0xb67d('0x23')](function(_0x1ce34b){if(_0x1ce34b){_0x30e1d0[_0xb67d('0x44')][_0xb67d('0x68')]({'id':0x0,'priority':0x0,'app':_0xb67d('0x69'),'appdata':_0x1ce34b['name']+','+(_0x30e1d0['account'][_0xb67d('0x6a')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xb67d('0x6b'),'startRouting',_0x30e1d0);});}return respondWithRpcPromise(_0xb67d('0x6b'),_0xb67d('0x6c'),_0x30e1d0);})['then'](function(_0x34e4bf){_0xd585fc(_0x34e4bf);})[_0xb67d('0x19')](function(_0x591aa7){_0x4ebc95(_0x10da42[_0xb67d('0x14')](0x1f4,_0x591aa7[_0xb67d('0x17')]));});});};
\ No newline at end of file
index 515b292..4ed62cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f0=['emit','register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x51a5bb,_0x241814){var _0x2983c0=function(_0x56b90b){while(--_0x56b90b){_0x51a5bb['push'](_0x51a5bb['shift']());}};_0x2983c0(++_0x241814);}(_0x26f0,0xf4));var _0x026f=function(_0x1be3e1,_0x58561e){_0x1be3e1=_0x1be3e1-0x0;var _0xb11de3=_0x26f0[_0x1be3e1];return _0xb11de3;};'use strict';var MailAccountEvents=require(_0x026f('0x0'));var events=[_0x026f('0x1'),_0x026f('0x2'),_0x026f('0x3')];function createListener(_0x5a1e17,_0x3a44e8){return function(_0x14d7f8){_0x3a44e8[_0x026f('0x4')](_0x5a1e17,_0x14d7f8);};}function removeListener(_0x378202,_0x28a7f0){return function(){MailAccountEvents['removeListener'](_0x378202,_0x28a7f0);};}exports[_0x026f('0x5')]=function(_0x57cf6f){for(var _0x4206b3=0x0,_0x51a294=events[_0x026f('0x6')];_0x4206b3<_0x51a294;_0x4206b3++){var _0x2cea10=events[_0x4206b3];var _0x5dc285=createListener(_0x026f('0x7')+_0x2cea10,_0x57cf6f);MailAccountEvents['on'](_0x2cea10,_0x5dc285);}};
\ No newline at end of file
+var _0x10ee=['update','emit','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x8f6a2c,_0x435996){var _0x42a718=function(_0x572dd2){while(--_0x572dd2){_0x8f6a2c['push'](_0x8f6a2c['shift']());}};_0x42a718(++_0x435996);}(_0x10ee,0xed));var _0xe10e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x10ee[_0x138adb];return _0x1b27f2;};'use strict';var MailAccountEvents=require(_0xe10e('0x0'));var events=[_0xe10e('0x1'),_0xe10e('0x2'),_0xe10e('0x3')];function createListener(_0x4d97a4,_0x372b84){return function(_0x1258b6){_0x372b84[_0xe10e('0x4')](_0x4d97a4,_0x1258b6);};}function removeListener(_0x9c5bde,_0x368cea){return function(){MailAccountEvents['removeListener'](_0x9c5bde,_0x368cea);};}exports[_0xe10e('0x5')]=function(_0x37487b){for(var _0x1e2f90=0x0,_0x4d7b2e=events[_0xe10e('0x6')];_0x1e2f90<_0x4d7b2e;_0x1e2f90++){var _0x682ce0=events[_0x1e2f90];var _0x33430b=createListener(_0xe10e('0x7')+_0x682ce0,_0x37487b);MailAccountEvents['on'](_0x682ce0,_0x33430b);}};
\ No newline at end of file
index 857d6b2..ea073ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3ff=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa3ff,0x8c));var _0xfa3f=function(_0x3ba216,_0x2285a9){_0x3ba216=_0x3ba216-0x0;var _0x45d2e2=_0xa3ff[_0x3ba216];return _0x45d2e2;};'use strict';var multer=require(_0xfa3f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfa3f('0x1'));var express=require(_0xfa3f('0x2'));var router=express[_0xfa3f('0x3')]();var fs_extra=require(_0xfa3f('0x4'));var auth=require(_0xfa3f('0x5'));var interaction=require(_0xfa3f('0x6'));var config=require('../../config/environment');var controller=require(_0xfa3f('0x7'));router[_0xfa3f('0x8')](_0xfa3f('0x9'),auth[_0xfa3f('0xa')](),controller[_0xfa3f('0xb')]);router[_0xfa3f('0xc')](_0xfa3f('0x9'),auth['isAuthenticated'](),controller[_0xfa3f('0xd')]);router[_0xfa3f('0xe')](_0xfa3f('0x9'),auth[_0xfa3f('0xa')](),controller[_0xfa3f('0xf')]);module[_0xfa3f('0x10')]=router;
\ No newline at end of file
+var _0x8906=['isAuthenticated','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id'];(function(_0x1dc6ba,_0x403191){var _0x2a0240=function(_0xd066e4){while(--_0xd066e4){_0x1dc6ba['push'](_0x1dc6ba['shift']());}};_0x2a0240(++_0x403191);}(_0x8906,0x180));var _0x6890=function(_0x2bf2e3,_0x58acc4){_0x2bf2e3=_0x2bf2e3-0x0;var _0x2bf5ca=_0x8906[_0x2bf2e3];return _0x2bf5ca;};'use strict';var multer=require(_0x6890('0x0'));var util=require(_0x6890('0x1'));var path=require(_0x6890('0x2'));var timeout=require(_0x6890('0x3'));var express=require(_0x6890('0x4'));var router=express[_0x6890('0x5')]();var fs_extra=require(_0x6890('0x6'));var auth=require(_0x6890('0x7'));var interaction=require(_0x6890('0x8'));var config=require(_0x6890('0x9'));var controller=require(_0x6890('0xa'));router['get'](_0x6890('0xb'),auth[_0x6890('0xc')](),controller[_0x6890('0xd')]);router[_0x6890('0xe')](_0x6890('0xb'),auth[_0x6890('0xc')](),controller[_0x6890('0xf')]);router[_0x6890('0x10')]('/:id',auth[_0x6890('0xc')](),controller[_0x6890('0x11')]);module['exports']=router;
\ No newline at end of file
index efd9d65..bbe479e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed4=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xeb69eb,_0x4bee4c){var _0x14f364=function(_0x1a30c4){while(--_0x1a30c4){_0xeb69eb['push'](_0xeb69eb['shift']());}};_0x14f364(++_0x4bee4c);}(_0xfed4,0x15f));var _0x4fed=function(_0x5db8f5,_0x8313c7){_0x5db8f5=_0x5db8f5-0x0;var _0x15f28d=_0xfed4[_0x5db8f5];return _0x15f28d;};'use strict';var Sequelize=require(_0x4fed('0x0'));module[_0x4fed('0x1')]={'priority':{'type':Sequelize[_0x4fed('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4fed('0x3')],'allowNull':![],'defaultValue':_0x4fed('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4fed('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4fed('0x5')}};
\ No newline at end of file
+var _0x84e6=['TEXT','*,*,*,*','exports','STRING','noop'];(function(_0x111bab,_0x271498){var _0x5999fa=function(_0x9512f4){while(--_0x9512f4){_0x111bab['push'](_0x111bab['shift']());}};_0x5999fa(++_0x271498);}(_0x84e6,0x160));var _0x684e=function(_0x41e113,_0x4c2f91){_0x41e113=_0x41e113-0x0;var _0x10d34a=_0x84e6[_0x41e113];return _0x10d34a;};'use strict';var Sequelize=require('sequelize');module[_0x684e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x684e('0x1')],'allowNull':![],'defaultValue':_0x684e('0x2')},'appdata':{'type':Sequelize[_0x684e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x684e('0x1')],'defaultValue':_0x684e('0x4')}};
\ No newline at end of file
index 8920f3e..afa39bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x5031c1,_0x310436){var _0x418bb6=function(_0x401842){while(--_0x401842){_0x5031c1['push'](_0x5031c1['shift']());}};_0x418bb6(++_0x310436);}(_0x70e0,0x17b));var _0x070e=function(_0x29fdd5,_0x4c766a){_0x29fdd5=_0x29fdd5-0x0;var _0x1bbb55=_0x70e0[_0x29fdd5];return _0x1bbb55;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));};
\ No newline at end of file
+var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1e697e,_0x55d484){var _0x158d2e=function(_0x89b971){while(--_0x89b971){_0x1e697e['push'](_0x1e697e['shift']());}};_0x158d2e(++_0x55d484);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));};
\ No newline at end of file
index 4ed24f6..97ed867 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9252=['exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x39580c,_0x22425c){var _0x1a4cd8=function(_0x42ee09){while(--_0x42ee09){_0x39580c['push'](_0x39580c['shift']());}};_0x1a4cd8(++_0x22425c);}(_0x9252,0x156));var _0x2925=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9252[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2925('0x0'))(_0x2925('0x1'));var moment=require(_0x2925('0x2'));var BPromise=require(_0x2925('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2925('0x4'));var rimraf=require(_0x2925('0x5'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x2925('0x6')]=function(_0x19fd23,_0x184cda){return _0x19fd23[_0x2925('0x7')](_0x2925('0x8'),attributes,{'tableName':_0x2925('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2925('0xa'),'collate':_0x2925('0xb')});};
\ No newline at end of file
+var _0x0e7a=['path','rimraf','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x364ee4,_0x4ff7f1){var _0x3ea730=function(_0x2f9ff6){while(--_0x2f9ff6){_0x364ee4['push'](_0x364ee4['shift']());}};_0x3ea730(++_0x4ff7f1);}(_0x0e7a,0xf7));var _0xa0e7=function(_0x3df12f,_0xe54256){_0x3df12f=_0x3df12f-0x0;var _0x49a2db=_0x0e7a[_0x3df12f];return _0x49a2db;};'use strict';var _=require(_0xa0e7('0x0'));var util=require(_0xa0e7('0x1'));var logger=require(_0xa0e7('0x2'))(_0xa0e7('0x3'));var moment=require(_0xa0e7('0x4'));var BPromise=require(_0xa0e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0e7('0x6'));var rimraf=require(_0xa0e7('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0xa0e7('0x8')]=function(_0x5558ab,_0x4183c8){return _0x5558ab[_0xa0e7('0x9')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa0e7('0xa')});};
\ No newline at end of file
index 719d0b9..b0ddb27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6080=['rpc','../../config/environment','jayson/promise','client','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','update','body','raw','options','where','attributes','limit','UpdateMailApplication','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5f5497,_0x50803a){var _0x10e943=function(_0x2f5faa){while(--_0x2f5faa){_0x5f5497['push'](_0x5f5497['shift']());}};_0x10e943(++_0x50803a);}(_0x6080,0xd3));var _0x0608=function(_0x10d0e1,_0xdc7ea){_0x10d0e1=_0x10d0e1-0x0;var _0x318113=_0x6080[_0x10d0e1];return _0x318113;};'use strict';var _=require(_0x0608('0x0'));var util=require('util');var moment=require(_0x0608('0x1'));var BPromise=require(_0x0608('0x2'));var rs=require(_0x0608('0x3'));var fs=require('fs');var Redis=require(_0x0608('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0608('0x5'));var logger=require('../../config/logger')(_0x0608('0x6'));var config=require(_0x0608('0x7'));var jayson=require(_0x0608('0x8'));var client=jayson[_0x0608('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341af6,_0x507a1f,_0x447176){return new BPromise(function(_0x2d4eb3,_0x3f990b){return client[_0x0608('0xa')](_0x341af6,_0x447176)[_0x0608('0xb')](function(_0x1b3b21){logger['info'](_0x0608('0xc'),_0x507a1f,_0x0608('0xd'));logger['debug'](_0x0608('0xe'),_0x507a1f,'request\x20sent',JSON[_0x0608('0xf')](_0x1b3b21));if(_0x1b3b21[_0x0608('0x10')]){if(_0x1b3b21[_0x0608('0x10')][_0x0608('0x11')]===0x1f4){logger[_0x0608('0x10')]('MailApplication,\x20%s,\x20%s',_0x507a1f,_0x1b3b21['error'][_0x0608('0x12')]);return _0x3f990b(_0x1b3b21[_0x0608('0x10')][_0x0608('0x12')]);}logger['error'](_0x0608('0xc'),_0x507a1f,_0x1b3b21[_0x0608('0x10')]['message']);return _0x2d4eb3(_0x1b3b21[_0x0608('0x10')][_0x0608('0x12')]);}else{logger[_0x0608('0x13')](_0x0608('0xc'),_0x507a1f,_0x0608('0xd'));_0x2d4eb3(_0x1b3b21[_0x0608('0x14')][_0x0608('0x12')]);}})[_0x0608('0x15')](function(_0x27e0ce){logger[_0x0608('0x10')](_0x0608('0xc'),_0x507a1f,_0x27e0ce);_0x3f990b(_0x27e0ce);});});}exports['UpdateMailApplication']=function(_0x246fe9){var _0x20c812=this;return new Promise(function(_0x2e6306,_0x32f553){return db['MailApplication'][_0x0608('0x16')](_0x246fe9[_0x0608('0x17')],{'raw':_0x246fe9['options']?_0x246fe9['options'][_0x0608('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246fe9[_0x0608('0x19')]?_0x246fe9[_0x0608('0x19')][_0x0608('0x1a')]||null:null,'attributes':_0x246fe9[_0x0608('0x19')]?_0x246fe9['options'][_0x0608('0x1b')]||null:null,'limit':_0x246fe9[_0x0608('0x19')]?_0x246fe9[_0x0608('0x19')][_0x0608('0x1c')]||null:null})[_0x0608('0xb')](function(_0x55b95e){logger[_0x0608('0x13')](_0x0608('0x1d'),_0x246fe9);logger[_0x0608('0x1e')](_0x0608('0x1d'),_0x246fe9,JSON[_0x0608('0xf')](_0x55b95e));_0x2e6306(_0x55b95e);})[_0x0608('0x15')](function(_0x4f7db4){logger['error'](_0x0608('0x1d'),_0x4f7db4[_0x0608('0x12')],_0x246fe9);_0x32f553(_0x20c812[_0x0608('0x10')](0x1f4,_0x4f7db4['message']));});});};
\ No newline at end of file
+var _0x9f75=['error','MailApplication,\x20%s,\x20%s','message','result','UpdateMailApplication','MailApplication','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x9f75,0x65));var _0x59f7=function(_0x4c7a90,_0x2c3aa4){_0x4c7a90=_0x4c7a90-0x0;var _0x3a32ae=_0x9f75[_0x4c7a90];return _0x3a32ae;};'use strict';var _=require(_0x59f7('0x0'));var util=require(_0x59f7('0x1'));var moment=require('moment');var BPromise=require(_0x59f7('0x2'));var rs=require(_0x59f7('0x3'));var fs=require('fs');var Redis=require(_0x59f7('0x4'));var db=require(_0x59f7('0x5'))['db'];var utils=require(_0x59f7('0x6'));var logger=require(_0x59f7('0x7'))('rpc');var config=require(_0x59f7('0x8'));var jayson=require(_0x59f7('0x9'));var client=jayson[_0x59f7('0xa')][_0x59f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe45e85,_0x344d45,_0x219d84){return new BPromise(function(_0xe773be,_0x159487){return client[_0x59f7('0xc')](_0xe45e85,_0x219d84)[_0x59f7('0xd')](function(_0x3f6692){logger[_0x59f7('0xe')]('MailApplication,\x20%s,\x20%s',_0x344d45,'request\x20sent');logger[_0x59f7('0xf')](_0x59f7('0x10'),_0x344d45,_0x59f7('0x11'),JSON[_0x59f7('0x12')](_0x3f6692));if(_0x3f6692[_0x59f7('0x13')]){if(_0x3f6692[_0x59f7('0x13')]['code']===0x1f4){logger['error'](_0x59f7('0x14'),_0x344d45,_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);return _0x159487(_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);}logger[_0x59f7('0x13')](_0x59f7('0x14'),_0x344d45,_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);return _0xe773be(_0x3f6692[_0x59f7('0x13')][_0x59f7('0x15')]);}else{logger[_0x59f7('0xe')](_0x59f7('0x14'),_0x344d45,_0x59f7('0x11'));_0xe773be(_0x3f6692[_0x59f7('0x16')]['message']);}})['catch'](function(_0x20c5ea){logger['error'](_0x59f7('0x14'),_0x344d45,_0x20c5ea);_0x159487(_0x20c5ea);});});}exports[_0x59f7('0x17')]=function(_0x589d82){var _0x59460b=this;return new Promise(function(_0x418794,_0x29581a){return db[_0x59f7('0x18')]['update'](_0x589d82['body'],{'raw':_0x589d82[_0x59f7('0x19')]?_0x589d82['options'][_0x59f7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x589d82[_0x59f7('0x19')]?_0x589d82[_0x59f7('0x19')][_0x59f7('0x1b')]||null:null,'attributes':_0x589d82[_0x59f7('0x19')]?_0x589d82[_0x59f7('0x19')][_0x59f7('0x1c')]||null:null,'limit':_0x589d82[_0x59f7('0x19')]?_0x589d82[_0x59f7('0x19')][_0x59f7('0x1d')]||null:null})[_0x59f7('0xd')](function(_0x326624){logger[_0x59f7('0xe')]('UpdateMailApplication',_0x589d82);logger[_0x59f7('0xf')](_0x59f7('0x17'),_0x589d82,JSON[_0x59f7('0x12')](_0x326624));_0x418794(_0x326624);})['catch'](function(_0x192a11){logger[_0x59f7('0x13')](_0x59f7('0x17'),_0x192a11['message'],_0x589d82);_0x29581a(_0x59460b['error'](0x1f4,_0x192a11[_0x59f7('0x15')]));});});};
\ No newline at end of file
index 4587b97..a7cb298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe009=['../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','/:id/download','post','addMessage','/:id/tags','tracked','addTags','/:id','mail','mailinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x285d58,_0x4190f9){var _0x5e6a0c=function(_0x25fd1d){while(--_0x25fd1d){_0x285d58['push'](_0x285d58['shift']());}};_0x5e6a0c(++_0x4190f9);}(_0xe009,0x122));var _0x9e00=function(_0x2627cf,_0xb62d6c){_0x2627cf=_0x2627cf-0x0;var _0x4a1709=_0xe009[_0x2627cf];return _0x4a1709;};'use strict';var multer=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var path=require(_0x9e00('0x2'));var timeout=require(_0x9e00('0x3'));var express=require('express');var router=express[_0x9e00('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9e00('0x5'));var interaction=require(_0x9e00('0x6'));var config=require(_0x9e00('0x7'));var controller=require(_0x9e00('0x8'));router[_0x9e00('0x9')]('/',auth[_0x9e00('0xa')](),controller[_0x9e00('0xb')]);router[_0x9e00('0x9')](_0x9e00('0xc'),auth[_0x9e00('0xa')](),controller['describe']);router[_0x9e00('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9e00('0xd')]);router[_0x9e00('0x9')](_0x9e00('0xe'),auth[_0x9e00('0xa')](),controller['getMessages']);router[_0x9e00('0x9')](_0x9e00('0xf'),auth[_0x9e00('0xa')](),controller['download']);router[_0x9e00('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e00('0x10')]('/:id/messages',auth[_0x9e00('0xa')](),controller[_0x9e00('0x11')]);router[_0x9e00('0x10')](_0x9e00('0x12'),auth[_0x9e00('0xa')](),interaction[_0x9e00('0x13')]('mail','mailinteraction:addtags'),controller[_0x9e00('0x14')]);router['put'](_0x9e00('0x15'),auth[_0x9e00('0xa')](),interaction[_0x9e00('0x13')](_0x9e00('0x16'),'mailinteraction:update'),controller['update']);router['delete']('/:id',auth[_0x9e00('0xa')](),interaction['tracked'](_0x9e00('0x16'),_0x9e00('0x17')),controller['destroy']);router[_0x9e00('0x18')](_0x9e00('0x12'),auth[_0x9e00('0xa')](),controller[_0x9e00('0x19')]);module[_0x9e00('0x1a')]=router;
\ No newline at end of file
+var _0xe0a9=['post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download'];(function(_0x439597,_0x23c725){var _0x3aa98f=function(_0x175cc2){while(--_0x175cc2){_0x439597['push'](_0x439597['shift']());}};_0x3aa98f(++_0x23c725);}(_0xe0a9,0x1ec));var _0x9e0a=function(_0x2ab729,_0x15247a){_0x2ab729=_0x2ab729-0x0;var _0x234d4c=_0xe0a9[_0x2ab729];return _0x234d4c;};'use strict';var multer=require(_0x9e0a('0x0'));var util=require('util');var path=require(_0x9e0a('0x1'));var timeout=require(_0x9e0a('0x2'));var express=require('express');var router=express[_0x9e0a('0x3')]();var fs_extra=require(_0x9e0a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e0a('0x5'));var config=require(_0x9e0a('0x6'));var controller=require(_0x9e0a('0x7'));router[_0x9e0a('0x8')]('/',auth[_0x9e0a('0x9')](),controller[_0x9e0a('0xa')]);router[_0x9e0a('0x8')](_0x9e0a('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9e0a('0xc'),auth['isAuthenticated'](),controller[_0x9e0a('0xd')]);router['get'](_0x9e0a('0xe'),auth[_0x9e0a('0x9')](),controller[_0x9e0a('0xf')]);router[_0x9e0a('0x8')](_0x9e0a('0x10'),auth[_0x9e0a('0x9')](),controller[_0x9e0a('0x11')]);router[_0x9e0a('0x12')]('/',auth[_0x9e0a('0x9')](),controller[_0x9e0a('0x13')]);router[_0x9e0a('0x12')](_0x9e0a('0xe'),auth[_0x9e0a('0x9')](),controller['addMessage']);router[_0x9e0a('0x12')](_0x9e0a('0x14'),auth[_0x9e0a('0x9')](),interaction[_0x9e0a('0x15')](_0x9e0a('0x16'),_0x9e0a('0x17')),controller[_0x9e0a('0x18')]);router[_0x9e0a('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x9e0a('0x15')](_0x9e0a('0x16'),'mailinteraction:update'),controller['update']);router['delete'](_0x9e0a('0xc'),auth[_0x9e0a('0x9')](),interaction[_0x9e0a('0x15')](_0x9e0a('0x16'),_0x9e0a('0x1a')),controller[_0x9e0a('0x1b')]);router[_0x9e0a('0x1c')](_0x9e0a('0x14'),auth['isAuthenticated'](),controller[_0x9e0a('0x1d')]);module['exports']=router;
\ No newline at end of file
index 89b60fd..7324f72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c69=['TEXT','long','DATE','out','ENUM','BOOLEAN','sequelize','iconv','STRING'];(function(_0x4f0292,_0x28ec9e){var _0x2d6834=function(_0x124b20){while(--_0x124b20){_0x4f0292['push'](_0x4f0292['shift']());}};_0x2d6834(++_0x28ec9e);}(_0x5c69,0x189));var _0x95c6=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x5c69[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0x95c6('0x0'));var iconv=require(_0x95c6('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x95c6('0x2')]},'secondDisposition':{'type':Sequelize[_0x95c6('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x95c6('0x2')]},'inReplyTo':{'type':Sequelize[_0x95c6('0x2')](0x1fe)},'to':{'type':Sequelize[_0x95c6('0x2')]},'cc':{'type':Sequelize[_0x95c6('0x3')](_0x95c6('0x4'))},'subject':{'type':Sequelize[_0x95c6('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x95c6('0x5')]},'substatus':{'type':Sequelize[_0x95c6('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x95c6('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x95c6('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x95c6('0x7')]('in',_0x95c6('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x95c6('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3a0f=['long','BOOLEAN','DATE','out','ENUM','exports','STRING','TEXT'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x3a0f,0x145));var _0xf3a0=function(_0x3d8cd3,_0x1cf912){_0x3d8cd3=_0x3d8cd3-0x0;var _0x10768c=_0x3a0f[_0x3d8cd3];return _0x10768c;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0xf3a0('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf3a0('0x1')]},'secondDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf3a0('0x1')]},'note':{'type':Sequelize[_0xf3a0('0x1')]},'inReplyTo':{'type':Sequelize[_0xf3a0('0x1')](0x1fe)},'to':{'type':Sequelize[_0xf3a0('0x1')]},'cc':{'type':Sequelize[_0xf3a0('0x2')](_0xf3a0('0x3'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf3a0('0x4')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf3a0('0x5')]},'substatus':{'type':Sequelize[_0xf3a0('0x1')](0x3c)},'substatusAt':{'type':Sequelize[_0xf3a0('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xf3a0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf3a0('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xf3a0('0x7')]('in',_0xf3a0('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf3a0('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 4cd0765..edeae56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d3=['ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','MailAccountId','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','enableEmailPreview','all','rows','show','params','includeAll','include','merge','create','update','body','describe','addMessage','ids','omit','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','join','root','server','tmp','transcript-%d-%s.zip','attachments','Attachment','Messages','get','mkdirSync','each','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','readFileSync','build','writeFileSync','log','unlinkSync','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','html-to-text','juice','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','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','save','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.MailInteractionId','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','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?'];(function(_0x3c10d0,_0x5677fa){var _0x334b80=function(_0x176ccb){while(--_0x176ccb){_0x3c10d0['push'](_0x3c10d0['shift']());}};_0x334b80(++_0x5677fa);}(_0x98d3,0x173));var _0x398d=function(_0x391263,_0x57eb33){_0x391263=_0x391263-0x0;var _0x48fbdc=_0x98d3[_0x391263];return _0x48fbdc;};'use strict';var emlformat=require(_0x398d('0x0'));var rimraf=require(_0x398d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x398d('0x2'));var rp=require('request-promise');var moment=require(_0x398d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x398d('0x4'));var util=require(_0x398d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x398d('0x6'));var ejs=require(_0x398d('0x7'));var fs=require('fs');var fs_extra=require(_0x398d('0x8'));var _=require('lodash');var squel=require(_0x398d('0x9'));var crypto=require(_0x398d('0xa'));var jsforce=require(_0x398d('0xb'));var deskjs=require(_0x398d('0xc'));var toCsv=require(_0x398d('0x6'));var querystring=require('querystring');var Papa=require(_0x398d('0xd'));var htmlToText=require(_0x398d('0xe'));var juice=require(_0x398d('0xf'));var Redis=require(_0x398d('0x10'));var authService=require(_0x398d('0x11'));var qs=require(_0x398d('0x12'));var as=require(_0x398d('0x13'));var hardwareService=require(_0x398d('0x14'));var logger=require('../../config/logger')(_0x398d('0x15'));var utils=require(_0x398d('0x16'));var config=require(_0x398d('0x17'));var licenseUtil=require(_0x398d('0x18'));var db=require(_0x398d('0x19'))['db'];config[_0x398d('0x1a')]=_[_0x398d('0x1b')](config[_0x398d('0x1a')],{'host':_0x398d('0x1c'),'port':0x18eb});var socket=require(_0x398d('0x1d'))(new Redis(config[_0x398d('0x1a')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3d424f,_0x36cde2){_0x36cde2=_0x36cde2||0xcc;return function(_0x347508){if(_0x347508){return _0x3d424f[_0x398d('0x1e')](_0x36cde2);}return _0x3d424f[_0x398d('0x1f')](_0x36cde2)[_0x398d('0x20')]();};}function respondWithResult(_0x3ff03c,_0x3c151a){_0x3c151a=_0x3c151a||0xc8;return function(_0x57a2b9){if(_0x57a2b9){return _0x3ff03c[_0x398d('0x1f')](_0x3c151a)['json'](_0x57a2b9);}};}function respondWithFilteredResult(_0x673840,_0x476c36){return function(_0x297768){if(_0x297768){var _0x5de1be=typeof _0x476c36['offset']==='undefined'&&typeof _0x476c36[_0x398d('0x21')]===_0x398d('0x22');var _0x117baa=_0x297768[_0x398d('0x23')];var _0x15f024=_0x5de1be?0x0:_0x476c36[_0x398d('0x24')];var _0x38659b=_0x5de1be?_0x297768['count']:_0x476c36['offset']+_0x476c36['limit'];var _0x16e580;if(_0x38659b>=_0x117baa){_0x38659b=_0x117baa;_0x16e580=0xc8;}else{_0x16e580=0xce;}_0x673840[_0x398d('0x1f')](_0x16e580);return _0x673840[_0x398d('0x25')](_0x398d('0x26'),_0x15f024+'-'+_0x38659b+'/'+_0x117baa)[_0x398d('0x27')](_0x297768);}return null;};}function patchUpdates(_0x557df7){return function(_0x5c4c70){try{jsonpatch[_0x398d('0x28')](_0x5c4c70,_0x557df7,!![]);}catch(_0x497ad1){return BPromise['reject'](_0x497ad1);}return _0x5c4c70[_0x398d('0x29')]();};}function saveUpdates(_0x38d8da,_0x5ae3b4){return function(_0x5618b3){if(_0x5618b3){return _0x5618b3['update'](_0x38d8da)[_0x398d('0x2a')](function(_0x2cc4ef){return _0x2cc4ef;});}return null;};}function removeEntity(_0x24fa2c,_0x248555){return function(_0x2a1f4d){if(_0x2a1f4d){return _0x2a1f4d[_0x398d('0x2b')]()[_0x398d('0x2a')](function(){_0x24fa2c[_0x398d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35bd19,_0x557dce){return function(_0x4aa568){if(!_0x4aa568){_0x35bd19[_0x398d('0x1e')](0x194);}return _0x4aa568;};}function handleError(_0x27bc6e,_0x585fe0){_0x585fe0=_0x585fe0||0x1f4;return function(_0x373326){logger['error'](_0x373326[_0x398d('0x2c')]);if(_0x373326[_0x398d('0x2d')]){delete _0x373326['name'];}_0x27bc6e['status'](_0x585fe0)[_0x398d('0x2e')](_0x373326);};}function getInteractionUsers(_0x2ca780,_0x4abab6){return new BPromise(function(_0x397f07,_0x2fbcce){try{if(_0x4abab6[_0x2ca780['id']]){_0x2ca780[_0x398d('0x2f')]=_[_0x398d('0x30')](_0x4abab6[_0x2ca780['id']],function(_0x1e84ac){return{'id':_0x1e84ac['id'],'fullname':_0x1e84ac[_0x398d('0x31')]};});}}catch(_0x490bee){_0x2fbcce(_0x490bee);}_0x397f07(_0x2ca780);});}function getInteractionTags(_0x5a9f61,_0x347c8a){return new BPromise(function(_0xe6a05,_0x45f1a3){try{if(_0x5a9f61[_0x398d('0x32')]){_0x5a9f61[_0x398d('0x33')]=[];_0x5a9f61[_0x398d('0x32')][_0x398d('0x34')](',')[_0x398d('0x35')](function(_0x1827be){_0x5a9f61['Tags'][_0x398d('0x36')](_0x347c8a[_0x1827be]);});}delete _0x5a9f61[_0x398d('0x32')];}catch(_0x182650){_0x45f1a3(_0x182650);}_0xe6a05(_0x5a9f61);});}function getLastMessageText(_0x557f83){return new BPromise(function(_0x5be779,_0x2507c6){return db[_0x398d('0x37')][_0x398d('0x38')]({'where':{'$and':[{'MailInteractionId':_0x557f83['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x398d('0x39')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x398d('0x3a')],'order':_0x398d('0x3b'),'raw':!![]})[_0x398d('0x2a')](function(_0xf578f9){if(_0xf578f9&&_0xf578f9[_0x398d('0x3a')]){_0x557f83[_0x398d('0x3c')]=_[_0x398d('0x3d')](_0xf578f9[_0x398d('0x3a')]);}_0x5be779(_0x557f83);})[_0x398d('0x3e')](function(_0x1c7859){_0x2507c6(_0x1c7859);});});}function updateMailInteraction(_0x306c30,_0x302314,_0x3e4c9a,_0x24cd9b){return new BPromise(function(_0x3d5b3f,_0x5ae43b){return getInteractionUsers(_0x306c30,_0x3e4c9a)[_0x398d('0x2a')](function(_0x3a860d){return getInteractionTags(_0x3a860d,_0x302314);})[_0x398d('0x2a')](function(_0x17de78){if(_0x24cd9b){_0x3d5b3f(getLastMessageText(_0x17de78));}else{_0x3d5b3f(_0x17de78);}})[_0x398d('0x3e')](function(_0x4b0045){_0x5ae43b(_0x4b0045);});});}exports[_0x398d('0x3f')]=function(_0x48abf1,_0x17976b){var _0x3dca3f={},_0x165d26={},_0x3b7acc={'count':0x0,'rows':[]};var _0x428a07=_[_0x398d('0x30')](db[_0x398d('0x40')][_0x398d('0x41')],function(_0x518e7c){return{'name':_0x518e7c[_0x398d('0x42')],'type':_0x518e7c[_0x398d('0x43')][_0x398d('0x44')]};});_0x165d26[_0x398d('0x45')]=_[_0x398d('0x30')](_0x428a07,'name');_0x165d26[_0x398d('0x46')]=_[_0x398d('0x47')](_0x48abf1['query']);_0x165d26[_0x398d('0x48')]=_[_0x398d('0x49')](_0x165d26[_0x398d('0x45')],_0x165d26[_0x398d('0x46')]);_0x3dca3f[_0x398d('0x4a')]=_[_0x398d('0x49')](_0x165d26[_0x398d('0x45')],qs[_0x398d('0x4b')](_0x48abf1[_0x398d('0x46')]['fields']));_0x3dca3f[_0x398d('0x4a')]=_0x3dca3f[_0x398d('0x4a')][_0x398d('0x4c')]?_0x3dca3f[_0x398d('0x4a')]:_0x165d26[_0x398d('0x45')];if(!_0x48abf1[_0x398d('0x46')]['hasOwnProperty'](_0x398d('0x4d'))){_0x3dca3f[_0x398d('0x21')]=qs['limit'](_0x48abf1[_0x398d('0x46')][_0x398d('0x21')]);_0x3dca3f[_0x398d('0x24')]=qs['offset'](_0x48abf1[_0x398d('0x46')][_0x398d('0x24')]);}_0x3dca3f[_0x398d('0x4e')]=qs[_0x398d('0x4f')](_0x48abf1[_0x398d('0x46')]['sort']);_0x3dca3f[_0x398d('0x50')]=qs[_0x398d('0x48')](_[_0x398d('0x51')](_0x48abf1['query'],_0x165d26[_0x398d('0x48')]),_0x428a07);var _0x3f9fb2=[];var _0x578a0f=squel[_0x398d('0x52')]()[_0x398d('0x53')]('id')[_0x398d('0x53')](_0x398d('0x2d'))[_0x398d('0x53')](_0x398d('0x54'))[_0x398d('0x55')](_0x398d('0x56'));var _0x54b061=squel[_0x398d('0x52')]()[_0x398d('0x53')]('u.id')['field'](_0x398d('0x57'))[_0x398d('0x53')](_0x398d('0x58'))[_0x398d('0x55')]('user_has_mail_interactions','ui')[_0x398d('0x59')]('users','u',_0x398d('0x5a'));var _0x58cde5=squel[_0x398d('0x52')]()['from']('mail_interactions','i')['left_join'](_0x398d('0x5b'),'c',_0x398d('0x5c'))[_0x398d('0x59')](_0x398d('0x5d'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x398d('0x5e'),'a',_0x398d('0x5f'))[_0x398d('0x59')]('mail_messages','me',_0x398d('0x60'))[_0x398d('0x59')](_0x398d('0x61'),'it',_0x398d('0x62'))[_0x398d('0x59')](_0x398d('0x56'),'t','t.id\x20=\x20it.TagId');var _0x158828=squel[_0x398d('0x63')]();var _0x453bf5=[];var _0x169f6e=squel['expr']();var _0x3bbd2e;if(_0x48abf1[_0x398d('0x46')][_0x398d('0x64')]){_0x3bbd2e=as[_0x398d('0x65')](_0x48abf1['query']['search']);var _0x891244=_0x3bbd2e['sqlOperator'];for(var _0xc7b543=0x0;_0xc7b543<_0x3bbd2e[_0x398d('0x66')]['length'];_0xc7b543++){var _0x86b133=_0x3bbd2e['conditions'][_0xc7b543];var _0x2eac8c='i';var _0x185df4=_[_0x398d('0x67')](_0x428a07,[_0x398d('0x2d'),_0x86b133[_0x398d('0x53')]]);if(!_0x185df4){switch(_0x86b133[_0x398d('0x53')]){case _0x398d('0x68'):if(_0x86b133[_0x398d('0x69')]==0x1){_0x58cde5[_0x398d('0x6a')]('`'+_0x86b133[_0x398d('0x53')]+_0x398d('0x6b'));}else{_0x58cde5[_0x398d('0x6a')]('`'+_0x86b133[_0x398d('0x53')]+_0x398d('0x6c'));}break;case _0x398d('0x6d'):if(_0x86b133[_0x398d('0x6e')]===_0x398d('0x6f')){if(_0x86b133[_0x398d('0x69')][_0x398d('0x34')]('\x20')[_0x398d('0x4c')]>0x1){_0x158828[_0x891244](_0x398d('0x70'),qs[_0x398d('0x71')](_0x86b133['value']),null);}else{var _0x12ef87='%'+_0x86b133[_0x398d('0x69')]+'%';_0x158828[_0x891244](_0x398d('0x72'),_0x12ef87,_0x12ef87,_0x12ef87);}}else{_0x185df4=_[_0x398d('0x67')](_0x428a07,[_0x398d('0x2d'),_0x398d('0x73')]);_0x86b133[_0x398d('0x53')]=_0x398d('0x73');_0x5b073c=as[_0x398d('0x74')](_0x2eac8c,_0x185df4[_0x398d('0x43')],_0x86b133);_0x158828[_0x891244](_0x5b073c[_0x398d('0x75')],_0x5b073c['value'][_0x398d('0x76')],_0x5b073c[_0x398d('0x69')]['end']);}break;case _0x398d('0x77'):var _0x548a8a=_0x86b133['value']['split'](',')[_0x398d('0x30')](function(_0x38970c){return Number(_0x38970c);});_0x548a8a['forEach'](function(_0x17c11e){_0x169f6e['or'](_0x398d('0x78'),'%,'+_0x17c11e+',%');});_0x453bf5=_[_0x398d('0x79')](_0x453bf5,_0x548a8a);break;case'User':if(_0x86b133[_0x398d('0x6e')]===_0x398d('0x6f')){_0x158828[_0x891244](_0x398d('0x7a'),'%'+_0x86b133['value']+'%',null);}else{_0x185df4=_[_0x398d('0x67')](_0x428a07,['name',_0x398d('0x7b')]);_0x86b133['field']=_0x398d('0x7b');_0x5b073c=as['buildExpression'](_0x2eac8c,_0x185df4[_0x398d('0x43')],_0x86b133);_0x158828[_0x891244](_0x5b073c[_0x398d('0x75')],_0x5b073c[_0x398d('0x69')][_0x398d('0x76')],_0x5b073c[_0x398d('0x69')]['end']);}break;case _0x398d('0x3a'):_0x5b073c=as[_0x398d('0x74')]('me',null,_0x86b133);_0x158828[_0x891244](_0x5b073c[_0x398d('0x75')],_0x5b073c[_0x398d('0x69')][_0x398d('0x76')],_0x5b073c[_0x398d('0x69')][_0x398d('0x20')]);break;}}else{var _0x5b073c=as[_0x398d('0x74')](_0x2eac8c,_0x185df4[_0x398d('0x43')],_0x86b133);_0x158828[_0x891244](_0x5b073c[_0x398d('0x75')],_0x5b073c['value']['start'],_0x5b073c[_0x398d('0x69')][_0x398d('0x20')]);}}}else{var _0x540121=_(_0x48abf1['query'])[_0x398d('0x47')]()['map'](function(_0x1d6fe6){return _['some'](_0x428a07,[_0x398d('0x2d'),_0x1d6fe6])?_0x1d6fe6:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x540121)){_0x540121[_0x398d('0x35')](function(_0x8ffcf1){if(_0x8ffcf1===_0x398d('0x7c')){_0x58cde5[_0x398d('0x50')](_0x398d('0x7d'),[]['concat'](_0x48abf1['query'][_0x8ffcf1]));}else if(_0x8ffcf1==='createdAt'){var _0x57267a=JSON[_0x398d('0x7e')](_0x48abf1['query'][_0x8ffcf1])[_0x398d('0x7f')];var _0x46ec8b=JSON[_0x398d('0x7e')](_0x48abf1[_0x398d('0x46')][_0x8ffcf1])[_0x398d('0x80')];_0x58cde5[_0x398d('0x50')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x57267a,_0x46ec8b);}else{if(_0x48abf1['query'][_0x8ffcf1]===_0x398d('0x81')){_0x58cde5[_0x398d('0x50')]('i.'+_0x8ffcf1+'\x20IS\x20NULL');}else{_0x58cde5[_0x398d('0x50')]('i.'+_0x8ffcf1+'\x20=\x20?',_0x48abf1[_0x398d('0x46')][_0x8ffcf1]);}}});}if(_0x48abf1[_0x398d('0x46')][_0x398d('0x82')]){if(_0x48abf1[_0x398d('0x46')]['read']==0x1){_0x58cde5[_0x398d('0x6a')](_0x398d('0x83'));}else{_0x58cde5[_0x398d('0x6a')](_0x398d('0x84'));}}if(_0x48abf1[_0x398d('0x46')]['tag']){_0x453bf5=_[_0x398d('0x85')](_0x48abf1['query'][_0x398d('0x86')])?_0x48abf1[_0x398d('0x46')][_0x398d('0x86')]:new Array(_0x48abf1['query'][_0x398d('0x86')]);_0x453bf5[_0x398d('0x35')](function(_0x5492b6){_0x169f6e['or'](_0x398d('0x78'),'%,'+_0x5492b6+',%');});}if(_0x48abf1[_0x398d('0x46')][_0x398d('0x87')]){var _0x4eeee5=_0x48abf1['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x398d('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4eeee5)){_0x158828['or'](_0x398d('0x89'),_0x4eeee5+'%');}else if(qs[_0x398d('0x8a')](_0x4eeee5)){_0x158828['or'](_0x398d('0x8b'),_0x4eeee5+'%');}else{_0x158828['or'](_0x398d('0x8c'),qs[_0x398d('0x71')](_0x4eeee5))['or'](_0x398d('0x8d'),qs['getFullTextValue'](_0x4eeee5));}}}_0x58cde5[_0x398d('0x50')](_0x158828);_0x58cde5[_0x398d('0x8e')]('i.id');var _0x1b6175={'type':db[_0x398d('0x8f')][_0x398d('0x90')][_0x398d('0x91')],'raw':!![]};var _0x13c666=_0x58cde5[_0x398d('0x92')]();_0x13c666[_0x398d('0x53')](_0x398d('0x93'));_0x13c666[_0x398d('0x53')](_0x398d('0x94'),'unreadMessages');if(_0x3dca3f[_0x398d('0x4e')]){_0x3dca3f[_0x398d('0x4e')][_0x398d('0x35')](function(_0x5bd2cf){var _0x356a2d=_0x5bd2cf[0x0]===_0x398d('0x95')?_0x5bd2cf[0x0]:'i.'+_0x5bd2cf[0x0];_0x58cde5[_0x398d('0x4e')](_0x356a2d,_0x5bd2cf[0x1]===_0x398d('0x96')?![]:!![]);});}if(!_[_0x398d('0x97')](_0x453bf5)){_0x58cde5[_0x398d('0x6a')](_0x169f6e);_0x13c666[_0x398d('0x50')](_0x398d('0x98'),_0x453bf5);}BPromise['resolve']()[_0x398d('0x2a')](function(){if(!_0x3bbd2e){if(_0x48abf1[_0x398d('0x46')][_0x398d('0x7c')])return;_0x13c666[_0x398d('0x50')](_0x398d('0x99'));_0x58cde5[_0x398d('0x50')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x48abf1['user'][_0x398d('0x9a')]!==_0x398d('0x9b'))return;return _0x48abf1[_0x398d('0x9c')][_0x398d('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5a7ad9){if(_[_0x398d('0x97')](_0x5a7ad9)){_0x13c666[_0x398d('0x50')](_0x398d('0x9e'));_0x58cde5[_0x398d('0x50')](_0x398d('0x9e'));}else{_0x13c666['where']('i.MailAccountId\x20IN\x20?',_['map'](_0x5a7ad9,'id'));_0x58cde5[_0x398d('0x50')](_0x398d('0x7d'),_[_0x398d('0x30')](_0x5a7ad9,'id'));}});})[_0x398d('0x2a')](function(){if(_0x48abf1[_0x398d('0x9c')][_0x398d('0x9a')]===_0x398d('0x9b')&&!_0x3bbd2e&&!_0x48abf1[_0x398d('0x46')][_0x398d('0x7c')])return[];return db[_0x398d('0x9f')][_0x398d('0x46')](_0x13c666[_0x398d('0xa0')](),_0x1b6175);})[_0x398d('0x2a')](function(_0x49a70){_0x3b7acc[_0x398d('0x23')]=_0x49a70[_0x398d('0x4c')];if(_0x3b7acc[_0x398d('0x23')]===0x0)return[];return db[_0x398d('0x9f')]['query'](_0x578a0f['toString'](),_0x1b6175)[_0x398d('0x2a')](function(_0x42a068){_0x3f9fb2=_[_0x398d('0xa1')](_0x42a068,'id');_0x1b6175=_['merge'](_0x1b6175,{'model':db[_0x398d('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x48abf1[_0x398d('0x46')][_0x398d('0x4b')]){_0x3dca3f[_0x398d('0x4a')][_0x398d('0x35')](function(_0xbb6768){_0x58cde5[_0x398d('0x53')]('i.'+_0xbb6768);});}else{_0x58cde5[_0x398d('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x398d('0x68'));_0x58cde5[_0x398d('0x53')]('a.key',_0x398d('0xa2'));_0x58cde5[_0x398d('0x53')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x58cde5[_0x398d('0x53')](_0x398d('0xa3'),_0x398d('0x95'));_0x58cde5[_0x398d('0x53')](_0x398d('0x93'));_0x58cde5[_0x398d('0x53')](_0x398d('0xa4'));_0x58cde5[_0x398d('0x53')]('i.updatedAt');_0x58cde5[_0x398d('0x53')](_0x398d('0xa5'));_0x58cde5[_0x398d('0x53')](_0x398d('0xa6'));_0x58cde5[_0x398d('0x53')](_0x398d('0xa7'));_0x58cde5['field'](_0x398d('0xa8'));_0x58cde5['field'](_0x398d('0xa9'));_0x58cde5['field'](_0x398d('0xaa'));_0x58cde5[_0x398d('0x53')](_0x398d('0xab'));_0x58cde5[_0x398d('0x53')](_0x398d('0xac'));_0x58cde5['field'](_0x398d('0xad'));_0x58cde5[_0x398d('0x53')]('i.substatus');_0x58cde5[_0x398d('0x53')](_0x398d('0xae'));_0x58cde5[_0x398d('0x53')](_0x398d('0xaf'));_0x58cde5[_0x398d('0x53')](_0x398d('0xb0'));_0x58cde5[_0x398d('0x53')](_0x398d('0xb1'));_0x58cde5[_0x398d('0x53')](_0x398d('0xb2'),_0x398d('0xb3'));_0x58cde5[_0x398d('0x53')](_0x398d('0xb4'),_0x398d('0xb5'));_0x58cde5[_0x398d('0x53')](_0x398d('0xb6'),_0x398d('0xb7'));_0x58cde5[_0x398d('0x53')](_0x398d('0xb8'),_0x398d('0xb9'));_0x58cde5[_0x398d('0x53')](_0x398d('0xba'),'Contact.mobile');_0x58cde5[_0x398d('0x53')]('c.fax','Contact.fax');_0x58cde5['field'](_0x398d('0xbb'),_0x398d('0xbc'));_0x58cde5[_0x398d('0x53')](_0x398d('0xbd'),_0x398d('0xbe'));_0x58cde5[_0x398d('0x53')](_0x398d('0xbf'),'TagIds');}if(_0x3dca3f[_0x398d('0x21')])_0x58cde5[_0x398d('0x21')](_0x3dca3f[_0x398d('0x21')]);if(_0x3dca3f['offset'])_0x58cde5[_0x398d('0x24')](_0x3dca3f[_0x398d('0x24')]);return db['sequelize']['query'](_0x58cde5['toString'](),_0x1b6175);})[_0x398d('0x2a')](function(_0x57086e){if(_0x57086e[_0x398d('0x4c')]>0x0)_0x54b061[_0x398d('0x50')]('ui.MailInteractionId\x20IN\x20?',_[_0x398d('0x30')](_0x57086e,'id'));return db[_0x398d('0x9f')][_0x398d('0x46')](_0x54b061['toString'](),_0x1b6175)[_0x398d('0x2a')](function(_0x140f2d){var _0x516bb5=_[_0x398d('0xc0')](_0x140f2d,_0x398d('0xc1'));var _0x1df628=[];return db['Setting'][_0x398d('0x38')]({'attributes':[_0x398d('0xc2')],'raw':!![]})['then'](function(_0x6868a9){var _0x370c2a=_0x6868a9[_0x398d('0xc2')];_0x57086e[_0x398d('0x35')](function(_0x43c8f7){_0x1df628[_0x398d('0x36')](updateMailInteraction(_0x43c8f7,_0x3f9fb2,_0x516bb5,_0x370c2a));});return BPromise[_0x398d('0xc3')](_0x1df628);});});});})[_0x398d('0x2a')](function(_0x1df874){_0x3b7acc[_0x398d('0xc4')]=_0x1df874;return _0x3b7acc;})[_0x398d('0x2a')](respondWithFilteredResult(_0x17976b,_0x3dca3f))[_0x398d('0x3e')](handleError(_0x17976b,null));};exports[_0x398d('0xc5')]=function(_0x50da80,_0x4cb8d4){var _0x190a1d={'raw':![],'where':{'id':_0x50da80[_0x398d('0xc6')]['id']}},_0x4dfa75={};_0x4dfa75['model']=_[_0x398d('0x47')](db[_0x398d('0x40')][_0x398d('0x41')]);_0x4dfa75['query']=_[_0x398d('0x47')](_0x50da80['query']);_0x4dfa75['filters']=_[_0x398d('0x49')](_0x4dfa75['model'],_0x4dfa75['query']);_0x190a1d['attributes']=_[_0x398d('0x49')](_0x4dfa75[_0x398d('0x45')],qs[_0x398d('0x4b')](_0x50da80[_0x398d('0x46')]['fields']));_0x190a1d['attributes']=_0x190a1d[_0x398d('0x4a')][_0x398d('0x4c')]?_0x190a1d[_0x398d('0x4a')]:_0x4dfa75[_0x398d('0x45')];if(_0x50da80[_0x398d('0x46')][_0x398d('0xc7')]){_0x190a1d[_0x398d('0xc8')]=[{'all':!![]}];}_0x190a1d=_[_0x398d('0xc9')]({},_0x190a1d,_0x50da80['options']);return db[_0x398d('0x40')][_0x398d('0x67')](_0x190a1d)[_0x398d('0x2a')](handleEntityNotFound(_0x4cb8d4,null))['then'](respondWithResult(_0x4cb8d4,null))[_0x398d('0x3e')](handleError(_0x4cb8d4,null));};exports[_0x398d('0xca')]=function(_0x3de6b9,_0x3b3835){return db['MailInteraction'][_0x398d('0xca')](_0x3de6b9['body'],{})['then'](respondWithResult(_0x3b3835,0xc9))[_0x398d('0x3e')](handleError(_0x3b3835,null));};exports[_0x398d('0xcb')]=function(_0x8349bb,_0x3d7064){if(_0x8349bb[_0x398d('0xcc')]['id']){delete _0x8349bb[_0x398d('0xcc')]['id'];}return db[_0x398d('0x40')][_0x398d('0x67')]({'where':{'id':_0x8349bb[_0x398d('0xc6')]['id']}})['then'](handleEntityNotFound(_0x3d7064,null))[_0x398d('0x2a')](saveUpdates(_0x8349bb['body'],null))[_0x398d('0x2a')](respondWithResult(_0x3d7064,null))[_0x398d('0x3e')](handleError(_0x3d7064,null));};exports[_0x398d('0x2b')]=function(_0x223559,_0x3ab3a7){return db[_0x398d('0x40')]['find']({'where':{'id':_0x223559[_0x398d('0xc6')]['id']}})[_0x398d('0x2a')](handleEntityNotFound(_0x3ab3a7,null))[_0x398d('0x2a')](removeEntity(_0x3ab3a7,null))[_0x398d('0x3e')](handleError(_0x3ab3a7,null));};exports[_0x398d('0xcd')]=function(_0x1687a5,_0x37f45c){return db[_0x398d('0x40')]['describe']()[_0x398d('0x2a')](respondWithResult(_0x37f45c,null))[_0x398d('0x3e')](handleError(_0x37f45c,null));};exports[_0x398d('0xce')]=function(_0x28de71,_0x36515f,_0x4da961){return db[_0x398d('0x37')][_0x398d('0x67')]({'where':{'id':_0x28de71[_0x398d('0xc6')]['id']}})[_0x398d('0x2a')](handleEntityNotFound(_0x36515f,null))[_0x398d('0x2a')](function(_0x52cc7a){if(_0x52cc7a){return _0x52cc7a[_0x398d('0xce')](_0x28de71[_0x398d('0xcc')][_0x398d('0xcf')],_[_0x398d('0xd0')](_0x28de71[_0x398d('0xcc')],[_0x398d('0xcf'),'id'])||{});}})[_0x398d('0x2a')](respondWithResult(_0x36515f,null))[_0x398d('0x3e')](handleError(_0x36515f,null));};exports['getMessages']=function(_0x17f13e,_0x4e8da5,_0x3776d3){var _0x132a4a={'raw':![],'where':{}};var _0x17cd40={};var _0x1ce327={'count':0x0,'rows':[]};return db[_0x398d('0x40')]['findOne']({'where':{'id':_0x17f13e[_0x398d('0xc6')]['id']}})[_0x398d('0x2a')](handleEntityNotFound(_0x4e8da5,null))['then'](function(_0x3aaa3a){if(_0x3aaa3a){_0x17cd40['model']=_[_0x398d('0x47')](db['MailMessage'][_0x398d('0x41')]);_0x17cd40[_0x398d('0x46')]=_[_0x398d('0x47')](_0x17f13e['query']);_0x17cd40[_0x398d('0x48')]=_['intersection'](_0x17cd40[_0x398d('0x45')],_0x17cd40['query']);_0x132a4a['attributes']=_['intersection'](_0x17cd40[_0x398d('0x45')],qs[_0x398d('0x4b')](_0x17f13e['query'][_0x398d('0x4b')]));_0x132a4a['attributes']=_0x132a4a['attributes'][_0x398d('0x4c')]?_0x132a4a['attributes']:_0x17cd40['model'];if(!_0x17f13e[_0x398d('0x46')][_0x398d('0xd1')]('nolimit')){_0x132a4a['limit']=qs['limit'](_0x17f13e[_0x398d('0x46')][_0x398d('0x21')]);_0x132a4a['offset']=qs['offset'](_0x17f13e[_0x398d('0x46')]['offset']);}_0x132a4a[_0x398d('0x4e')]=qs[_0x398d('0x4f')](_0x17f13e[_0x398d('0x46')][_0x398d('0x4f')]);_0x132a4a[_0x398d('0x50')]=qs[_0x398d('0x48')](_[_0x398d('0x51')](_0x17f13e[_0x398d('0x46')],_0x17cd40[_0x398d('0x48')]));_0x132a4a['where']['MailInteractionId']=_0x3aaa3a['id'];if(_0x17f13e[_0x398d('0x46')][_0x398d('0x87')]){_0x132a4a[_0x398d('0x50')]=_[_0x398d('0xc9')](_0x132a4a['where'],{'$or':_[_0x398d('0x30')](_0x132a4a['attributes'],function(_0x173509){var _0xb3c7e7={};_0xb3c7e7[_0x173509]={'$like':'%'+_0x17f13e['query'][_0x398d('0x87')]+'%'};return _0xb3c7e7;})});}if(_0x17f13e[_0x398d('0x46')][_0x398d('0x7f')]){var _0x1b8883=_0x17f13e[_0x398d('0x46')][_0x398d('0x7f')][_0x398d('0x34')](',');var _0x4dd104={};_0x4dd104[_0x1b8883[0x0]]={'$gte':moment(_0x1b8883[0x1])['format'](_0x398d('0xd2'))};_0x132a4a['where']=_['merge'](_0x132a4a['where'],_0x4dd104);}_0x132a4a=_[_0x398d('0xc9')]({},_0x132a4a,_0x17f13e[_0x398d('0xd3')]);return db['MailMessage'][_0x398d('0x23')]({'where':_0x132a4a[_0x398d('0x50')]})[_0x398d('0x2a')](function(_0x47a5b7){_0x1ce327['count']=_0x47a5b7;if(_0x17f13e['query']['includeAll']){_0x132a4a[_0x398d('0xc8')]=[{'all':!![]}];}return db[_0x398d('0x37')][_0x398d('0xd4')](_0x132a4a);})[_0x398d('0x2a')](function(_0x323fb2){if(_0x17f13e['query'][_0x398d('0xd5')]==='true'){for(var _0x1741f3=0x0;_0x1741f3<_0x323fb2[_0x398d('0x4c')];_0x1741f3++){_0x323fb2[_0x1741f3]['body']=juice(_0x323fb2[_0x1741f3][_0x398d('0xcc')]);}}_0x1ce327[_0x398d('0xc4')]=_0x323fb2;return _0x1ce327;});}})[_0x398d('0x2a')](respondWithFilteredResult(_0x4e8da5,_0x132a4a))['catch'](handleError(_0x4e8da5,null));};exports[_0x398d('0xd6')]=function(_0xdbcfd4,_0x2320ff,_0x4b8b4d){return db[_0x398d('0x40')][_0x398d('0x67')]({'where':{'id':_0xdbcfd4['params']['id']}})[_0x398d('0x2a')](handleEntityNotFound(_0x2320ff,null))[_0x398d('0x2a')](function(_0x59a1a7){if(_0x59a1a7){return _0x59a1a7[_0x398d('0xd7')](_0xdbcfd4[_0x398d('0xcc')][_0x398d('0xcf')],_[_0x398d('0xd0')](_0xdbcfd4[_0x398d('0xcc')],[_0x398d('0xcf'),'id'])||{})[_0x398d('0xd8')](function(){return db[_0x398d('0x77')]['findAll']({'attributes':['id',_0x398d('0x2d'),_0x398d('0x54')],'where':{'id':_0xdbcfd4[_0x398d('0xcc')][_0x398d('0xcf')]}});})['then'](function(_0x3ab0b5){socket[_0x398d('0xd9')](_0x398d('0xda'),{'id':Number(_0xdbcfd4[_0x398d('0xc6')]['id']),'tags':_0x3ab0b5||[]});return{'id':Number(_0xdbcfd4[_0x398d('0xc6')]['id']),'tags':_0x3ab0b5||[]};});}})['then'](respondWithResult(_0x2320ff,null))[_0x398d('0x3e')](handleError(_0x2320ff,null));};exports[_0x398d('0xdb')]=function(_0x29aae6,_0x5e6dcd,_0x2eded7){return db[_0x398d('0x40')]['find']({'where':{'id':_0x29aae6[_0x398d('0xc6')]['id']}})['then'](handleEntityNotFound(_0x5e6dcd,null))[_0x398d('0x2a')](function(_0x702cf){if(_0x702cf){return _0x702cf[_0x398d('0xdb')](_0x29aae6[_0x398d('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x5e6dcd,null))[_0x398d('0x3e')](handleError(_0x5e6dcd,null));};exports[_0x398d('0xdc')]=function(_0x17de53,_0x3def15){var _0x2f6723=moment()['unix']()[_0x398d('0xa0')]();var _0x406aeb=path[_0x398d('0xdd')](config[_0x398d('0xde')],_0x398d('0xdf'),'files',_0x398d('0xe0'));var _0x50cb6d=path[_0x398d('0xdd')](config[_0x398d('0xde')],_0x398d('0xdf'),'files','attachments');var _0x404285=path[_0x398d('0xdd')](_0x406aeb,_0x2f6723);var _0x2f958c=util['format'](_0x398d('0xe1'),_0x17de53[_0x398d('0xc6')]['id'],_0x2f6723);var _0x5f4696=path[_0x398d('0xdd')](_0x406aeb,_0x2f958c);var _0x18d0ca=[];if(_0x17de53[_0x398d('0x46')][_0x398d('0xe2')]){_0x18d0ca[_0x398d('0x36')]({'model':db[_0x398d('0xe3')],'as':'Attachments','raw':!![]});}var _0xe655d0=[{'model':db['MailMessage'],'as':_0x398d('0xe4'),'attributes':['id',_0x398d('0xcc'),'from','to','cc','bcc','subject','createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x18d0ca}];return db[_0x398d('0x40')][_0x398d('0x67')]({'where':{'id':_0x17de53[_0x398d('0xc6')]['id']},'include':_0xe655d0})[_0x398d('0x2a')](handleEntityNotFound(_0x3def15,null))['then'](function(_0x2ec8aa){if(_0x2ec8aa&&_0x2ec8aa[_0x398d('0xe4')]){var _0x179031=_0x2ec8aa[_0x398d('0xe5')]({'plain':!![]});fs[_0x398d('0xe6')](_0x404285);return BPromise[_0x398d('0xe7')](_0x179031['Messages'],function(_0x5c0733,_0x245d19){var _0x1b20a6={'from':_0x5c0733[_0x398d('0x55')],'to':_0x5c0733['to'],'subject':_0x5c0733[_0x398d('0xe8')],'html':_0x5c0733[_0x398d('0xcc')],'headers':{'Date':moment(_0x5c0733[_0x398d('0xe9')])['format'](_0x398d('0xea'))},'attachments':[]};if(_0x5c0733['cc']){_0x1b20a6[_0x398d('0xeb')]['Cc']=_0x5c0733['cc'];}if(_0x5c0733['bcc']){_0x1b20a6[_0x398d('0xeb')]['Bcc']=_0x5c0733[_0x398d('0xec')];}return new BPromise(function(_0x1744c0,_0x3e9579){if(_0x5c0733['Attachments']){for(var _0x41229d=0x0;_0x41229d<_0x5c0733[_0x398d('0xed')][_0x398d('0x4c')];_0x41229d++){var _0x247691=_0x5c0733[_0x398d('0xed')][_0x41229d];var _0x4c0a56=path[_0x398d('0xdd')](_0x50cb6d,_0x247691['basename']);if(fs['existsSync'](_0x4c0a56)){_0x1b20a6['attachments'][_0x398d('0x36')]({'name':_0x247691[_0x398d('0x2d')],'contentType':_0x247691[_0x398d('0x43')],'data':fs[_0x398d('0xee')](_0x4c0a56)});}}}emlformat[_0x398d('0xef')](_0x1b20a6,function(_0x3df294,_0x4babfa){if(_0x3df294)return _0x3e9579(_0x3df294);fs[_0x398d('0xf0')](path['join'](_0x404285,util['format']('message%d.eml',_0x245d19)),_0x4babfa);return _0x1744c0(_0x4babfa);});});})[_0x398d('0x2a')](function(){return new BPromise(function(_0x542d97,_0x19e128){zipdir(_0x404285,{'saveTo':_0x5f4696},function(_0x538765,_0x4a244e){if(_0x538765)return _0x19e128(_0x538765);return _0x542d97(_0x4a244e);});})[_0x398d('0x2a')](function(){return new BPromise(function(_0x49473b,_0x48d4e6){rimraf(_0x404285,function(_0x5a4ff7){if(_0x5a4ff7)_0x48d4e6(_0x5a4ff7);return _0x49473b();});});})['then'](function(){return _0x3def15[_0x398d('0xdc')](_0x5f4696,_0x2f958c,function(_0x27fa03){if(_0x27fa03){console[_0x398d('0xf1')]('err',_0x27fa03);}else{fs[_0x398d('0xf2')](_0x5f4696);}});});});}else{return _0x3def15[_0x398d('0x1e')](0xc8);}})[_0x398d('0x3e')](handleError(_0x3def15,null));};
\ No newline at end of file
+var _0x8f1b=['intersection','model','fields','attributes','query','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','unreadMessages','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closedAt','i.attach','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','rows','show','params','includeAll','include','options','create','body','describe','addMessage','omit','ids','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','addTags','setTags','spread','mailInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','createdAt','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','log','err','unlinkSync','rimraf','moment','mustache','util','path','sox','ejs','fs-extra','jsforce','querystring','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Users','map','TagIds','split','forEach','Tags','push','MailMessage','findOne','out','plainBody','lastMsgText','catch','MailInteraction','rawAttributes','fieldName','type','key','keys','filters'];(function(_0x170e17,_0x8c5d96){var _0x2e5602=function(_0x22b0a9){while(--_0x22b0a9){_0x170e17['push'](_0x170e17['shift']());}};_0x2e5602(++_0x8c5d96);}(_0x8f1b,0xaf));var _0xb8f1=function(_0x2a85d3,_0x109b3b){_0x2a85d3=_0x2a85d3-0x0;var _0x2d9ed8=_0x8f1b[_0x2a85d3];return _0x2d9ed8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb8f1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb8f1('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xb8f1('0x2'));var util=require(_0xb8f1('0x3'));var path=require(_0xb8f1('0x4'));var sox=require(_0xb8f1('0x5'));var csv=require('to-csv');var ejs=require(_0xb8f1('0x6'));var fs=require('fs');var fs_extra=require(_0xb8f1('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb8f1('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb8f1('0x9'));var Papa=require(_0xb8f1('0xa'));var htmlToText=require(_0xb8f1('0xb'));var juice=require(_0xb8f1('0xc'));var Redis=require('ioredis');var authService=require(_0xb8f1('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb8f1('0xe'));var hardwareService=require(_0xb8f1('0xf'));var logger=require(_0xb8f1('0x10'))(_0xb8f1('0x11'));var utils=require(_0xb8f1('0x12'));var config=require(_0xb8f1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb8f1('0x14')]=_[_0xb8f1('0x15')](config[_0xb8f1('0x14')],{'host':_0xb8f1('0x16'),'port':0x18eb});var socket=require(_0xb8f1('0x17'))(new Redis(config[_0xb8f1('0x14')]));require(_0xb8f1('0x18'))[_0xb8f1('0x19')](socket);function respondWithStatusCode(_0x59c2c3,_0x50f1ef){_0x50f1ef=_0x50f1ef||0xcc;return function(_0x1d9a7b){if(_0x1d9a7b){return _0x59c2c3[_0xb8f1('0x1a')](_0x50f1ef);}return _0x59c2c3['status'](_0x50f1ef)[_0xb8f1('0x1b')]();};}function respondWithResult(_0x173764,_0x5d4081){_0x5d4081=_0x5d4081||0xc8;return function(_0x358555){if(_0x358555){return _0x173764[_0xb8f1('0x1c')](_0x5d4081)[_0xb8f1('0x1d')](_0x358555);}};}function respondWithFilteredResult(_0x3322bc,_0x51f396){return function(_0x559286){if(_0x559286){var _0x5a85e1=typeof _0x51f396['offset']===_0xb8f1('0x1e')&&typeof _0x51f396[_0xb8f1('0x1f')]===_0xb8f1('0x1e');var _0x1d5274=_0x559286[_0xb8f1('0x20')];var _0x56d60d=_0x5a85e1?0x0:_0x51f396[_0xb8f1('0x21')];var _0x1926bf=_0x5a85e1?_0x559286[_0xb8f1('0x20')]:_0x51f396['offset']+_0x51f396[_0xb8f1('0x1f')];var _0x46f250;if(_0x1926bf>=_0x1d5274){_0x1926bf=_0x1d5274;_0x46f250=0xc8;}else{_0x46f250=0xce;}_0x3322bc['status'](_0x46f250);return _0x3322bc[_0xb8f1('0x22')](_0xb8f1('0x23'),_0x56d60d+'-'+_0x1926bf+'/'+_0x1d5274)['json'](_0x559286);}return null;};}function patchUpdates(_0x4b5a41){return function(_0x57e063){try{jsonpatch[_0xb8f1('0x24')](_0x57e063,_0x4b5a41,!![]);}catch(_0x21a2fa){return BPromise[_0xb8f1('0x25')](_0x21a2fa);}return _0x57e063[_0xb8f1('0x26')]();};}function saveUpdates(_0xa2e3ca,_0x452576){return function(_0x103bea){if(_0x103bea){return _0x103bea[_0xb8f1('0x27')](_0xa2e3ca)[_0xb8f1('0x28')](function(_0x329d7a){return _0x329d7a;});}return null;};}function removeEntity(_0x14e0e1,_0x4fd3c7){return function(_0x36219b){if(_0x36219b){return _0x36219b[_0xb8f1('0x29')]()['then'](function(){_0x14e0e1[_0xb8f1('0x1c')](0xcc)[_0xb8f1('0x1b')]();});}};}function handleEntityNotFound(_0x335395,_0x3d679b){return function(_0x642126){if(!_0x642126){_0x335395[_0xb8f1('0x1a')](0x194);}return _0x642126;};}function handleError(_0x204d9c,_0x45131a){_0x45131a=_0x45131a||0x1f4;return function(_0x1634b6){logger[_0xb8f1('0x2a')](_0x1634b6[_0xb8f1('0x2b')]);if(_0x1634b6[_0xb8f1('0x2c')]){delete _0x1634b6[_0xb8f1('0x2c')];}_0x204d9c[_0xb8f1('0x1c')](_0x45131a)['send'](_0x1634b6);};}function getInteractionUsers(_0x454c74,_0x798dfc){return new BPromise(function(_0x862af1,_0x5d6663){try{if(_0x798dfc[_0x454c74['id']]){_0x454c74[_0xb8f1('0x2d')]=_[_0xb8f1('0x2e')](_0x798dfc[_0x454c74['id']],function(_0x554327){return{'id':_0x554327['id'],'fullname':_0x554327['fullname']};});}}catch(_0x42b195){_0x5d6663(_0x42b195);}_0x862af1(_0x454c74);});}function getInteractionTags(_0x23a23d,_0x3522a0){return new BPromise(function(_0x1e05ab,_0x12401a){try{if(_0x23a23d[_0xb8f1('0x2f')]){_0x23a23d['Tags']=[];_0x23a23d['TagIds'][_0xb8f1('0x30')](',')[_0xb8f1('0x31')](function(_0x53076a){_0x23a23d[_0xb8f1('0x32')][_0xb8f1('0x33')](_0x3522a0[_0x53076a]);});}delete _0x23a23d['TagIds'];}catch(_0x56a1f2){_0x12401a(_0x56a1f2);}_0x1e05ab(_0x23a23d);});}function getLastMessageText(_0x31fdbb){return new BPromise(function(_0x41ab75,_0x3efc66){return db[_0xb8f1('0x34')][_0xb8f1('0x35')]({'where':{'$and':[{'MailInteractionId':_0x31fdbb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb8f1('0x36')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xb8f1('0x28')](function(_0x52fe8f){if(_0x52fe8f&&_0x52fe8f[_0xb8f1('0x37')]){_0x31fdbb[_0xb8f1('0x38')]=_['trimStart'](_0x52fe8f[_0xb8f1('0x37')]);}_0x41ab75(_0x31fdbb);})[_0xb8f1('0x39')](function(_0x1da9d2){_0x3efc66(_0x1da9d2);});});}function updateMailInteraction(_0x139414,_0xbc63ed,_0xb72b47,_0x58dc4e){return new BPromise(function(_0x2c7f07,_0x86ec71){return getInteractionUsers(_0x139414,_0xb72b47)[_0xb8f1('0x28')](function(_0x1e618d){return getInteractionTags(_0x1e618d,_0xbc63ed);})['then'](function(_0x220eeb){if(_0x58dc4e){_0x2c7f07(getLastMessageText(_0x220eeb));}else{_0x2c7f07(_0x220eeb);}})['catch'](function(_0x2a05c3){_0x86ec71(_0x2a05c3);});});}exports['index']=function(_0x25b3a8,_0x23b575){var _0xdee854={},_0x3f697c={},_0x1ebf07={'count':0x0,'rows':[]};var _0x2914e8=_[_0xb8f1('0x2e')](db[_0xb8f1('0x3a')][_0xb8f1('0x3b')],function(_0x4f513d){return{'name':_0x4f513d[_0xb8f1('0x3c')],'type':_0x4f513d[_0xb8f1('0x3d')][_0xb8f1('0x3e')]};});_0x3f697c['model']=_[_0xb8f1('0x2e')](_0x2914e8,'name');_0x3f697c['query']=_[_0xb8f1('0x3f')](_0x25b3a8['query']);_0x3f697c[_0xb8f1('0x40')]=_[_0xb8f1('0x41')](_0x3f697c[_0xb8f1('0x42')],_0x3f697c['query']);_0xdee854['attributes']=_['intersection'](_0x3f697c[_0xb8f1('0x42')],qs[_0xb8f1('0x43')](_0x25b3a8['query'][_0xb8f1('0x43')]));_0xdee854['attributes']=_0xdee854[_0xb8f1('0x44')]['length']?_0xdee854[_0xb8f1('0x44')]:_0x3f697c['model'];if(!_0x25b3a8[_0xb8f1('0x45')]['hasOwnProperty'](_0xb8f1('0x46'))){_0xdee854[_0xb8f1('0x1f')]=qs['limit'](_0x25b3a8[_0xb8f1('0x45')]['limit']);_0xdee854[_0xb8f1('0x21')]=qs[_0xb8f1('0x21')](_0x25b3a8['query'][_0xb8f1('0x21')]);}_0xdee854[_0xb8f1('0x47')]=qs[_0xb8f1('0x48')](_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x48')]);_0xdee854[_0xb8f1('0x49')]=qs[_0xb8f1('0x40')](_['pick'](_0x25b3a8[_0xb8f1('0x45')],_0x3f697c[_0xb8f1('0x40')]),_0x2914e8);var _0x21cad9=[];var _0x4cc3c0=squel[_0xb8f1('0x4a')]()[_0xb8f1('0x4b')]('id')[_0xb8f1('0x4b')](_0xb8f1('0x2c'))[_0xb8f1('0x4b')](_0xb8f1('0x4c'))[_0xb8f1('0x4d')](_0xb8f1('0x4e'));var _0x51fb08=squel[_0xb8f1('0x4a')]()['field'](_0xb8f1('0x4f'))[_0xb8f1('0x4b')](_0xb8f1('0x50'))[_0xb8f1('0x4b')]('ui.MailInteractionId')[_0xb8f1('0x4d')](_0xb8f1('0x51'),'ui')[_0xb8f1('0x52')](_0xb8f1('0x53'),'u',_0xb8f1('0x54'));var _0x4fe890=squel['select']()[_0xb8f1('0x4d')](_0xb8f1('0x55'),'i')[_0xb8f1('0x52')](_0xb8f1('0x56'),'c',_0xb8f1('0x57'))[_0xb8f1('0x52')](_0xb8f1('0x53'),'o',_0xb8f1('0x58'))[_0xb8f1('0x52')](_0xb8f1('0x59'),'a',_0xb8f1('0x5a'))[_0xb8f1('0x52')]('mail_messages','me',_0xb8f1('0x5b'))[_0xb8f1('0x52')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0xb8f1('0x4e'),'t',_0xb8f1('0x5c'));var _0x4ed6fc=squel[_0xb8f1('0x5d')]();var _0x36e0fc=[];var _0x5b4e50=squel[_0xb8f1('0x5d')]();var _0x4acd9d;if(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x5e')]){_0x4acd9d=as[_0xb8f1('0x5f')](_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x5e')]);var _0x47454c=_0x4acd9d[_0xb8f1('0x60')];for(var _0x40270f=0x0;_0x40270f<_0x4acd9d[_0xb8f1('0x61')][_0xb8f1('0x62')];_0x40270f++){var _0xba046d=_0x4acd9d[_0xb8f1('0x61')][_0x40270f];var _0x4e006e='i';var _0x1e9da6=_[_0xb8f1('0x63')](_0x2914e8,[_0xb8f1('0x2c'),_0xba046d[_0xb8f1('0x4b')]]);if(!_0x1e9da6){switch(_0xba046d[_0xb8f1('0x4b')]){case'unreadMessages':if(_0xba046d[_0xb8f1('0x64')]==0x1){_0x4fe890[_0xb8f1('0x65')]('`'+_0xba046d[_0xb8f1('0x4b')]+_0xb8f1('0x66'));}else{_0x4fe890[_0xb8f1('0x65')]('`'+_0xba046d[_0xb8f1('0x4b')]+_0xb8f1('0x67'));}break;case _0xb8f1('0x68'):if(_0xba046d[_0xb8f1('0x69')]===_0xb8f1('0x6a')){if(_0xba046d[_0xb8f1('0x64')][_0xb8f1('0x30')]('\x20')['length']>0x1){_0x4ed6fc[_0x47454c](_0xb8f1('0x6b'),qs[_0xb8f1('0x6c')](_0xba046d['value']),null);}else{var _0x2a5274='%'+_0xba046d[_0xb8f1('0x64')]+'%';_0x4ed6fc[_0x47454c](_0xb8f1('0x6d'),_0x2a5274,_0x2a5274,_0x2a5274);}}else{_0x1e9da6=_['find'](_0x2914e8,[_0xb8f1('0x2c'),_0xb8f1('0x6e')]);_0xba046d['field']=_0xb8f1('0x6e');_0x335810=as[_0xb8f1('0x6f')](_0x4e006e,_0x1e9da6[_0xb8f1('0x3d')],_0xba046d);_0x4ed6fc[_0x47454c](_0x335810[_0xb8f1('0x70')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')]['end']);}break;case _0xb8f1('0x72'):var _0x4719c7=_0xba046d[_0xb8f1('0x64')][_0xb8f1('0x30')](',')[_0xb8f1('0x2e')](function(_0xbc833f){return Number(_0xbc833f);});_0x4719c7['forEach'](function(_0x47f672){_0x5b4e50['or'](_0xb8f1('0x73'),'%,'+_0x47f672+',%');});_0x36e0fc=_['union'](_0x36e0fc,_0x4719c7);break;case _0xb8f1('0x74'):if(_0xba046d['operator']===_0xb8f1('0x6a')){_0x4ed6fc[_0x47454c](_0xb8f1('0x75'),'%'+_0xba046d['value']+'%',null);}else{_0x1e9da6=_[_0xb8f1('0x63')](_0x2914e8,['name','UserId']);_0xba046d[_0xb8f1('0x4b')]=_0xb8f1('0x76');_0x335810=as[_0xb8f1('0x6f')](_0x4e006e,_0x1e9da6[_0xb8f1('0x3d')],_0xba046d);_0x4ed6fc[_0x47454c](_0x335810['text'],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x1b')]);}break;case _0xb8f1('0x37'):_0x335810=as[_0xb8f1('0x6f')]('me',null,_0xba046d);_0x4ed6fc[_0x47454c](_0x335810[_0xb8f1('0x70')],_0x335810['value'][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x1b')]);break;}}else{var _0x335810=as['buildExpression'](_0x4e006e,_0x1e9da6['type'],_0xba046d);_0x4ed6fc[_0x47454c](_0x335810[_0xb8f1('0x70')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x71')],_0x335810[_0xb8f1('0x64')][_0xb8f1('0x1b')]);}}}else{var _0x4389b4=_(_0x25b3a8[_0xb8f1('0x45')])[_0xb8f1('0x3f')]()[_0xb8f1('0x2e')](function(_0x2a7625){return _[_0xb8f1('0x77')](_0x2914e8,[_0xb8f1('0x2c'),_0x2a7625])?_0x2a7625:undefined;})[_0xb8f1('0x78')]()[_0xb8f1('0x64')]();if(!_['isEmpty'](_0x4389b4)){_0x4389b4['forEach'](function(_0x1624b5){if(_0x1624b5===_0xb8f1('0x79')){_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x7a'),[]['concat'](_0x25b3a8['query'][_0x1624b5]));}else if(_0x1624b5==='createdAt'){var _0x458326=JSON[_0xb8f1('0x7b')](_0x25b3a8['query'][_0x1624b5])[_0xb8f1('0x7c')];var _0x5365f1=JSON[_0xb8f1('0x7b')](_0x25b3a8[_0xb8f1('0x45')][_0x1624b5])[_0xb8f1('0x7d')];_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x7e'),_0x458326,_0x5365f1);}else{if(_0x25b3a8[_0xb8f1('0x45')][_0x1624b5]===_0xb8f1('0x7f')){_0x4fe890[_0xb8f1('0x49')]('i.'+_0x1624b5+'\x20IS\x20NULL');}else{_0x4fe890['where']('i.'+_0x1624b5+'\x20=\x20?',_0x25b3a8['query'][_0x1624b5]);}}});}if(_0x25b3a8[_0xb8f1('0x45')]['read']){if(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x80')]==0x1){_0x4fe890['having'](_0xb8f1('0x81'));}else{_0x4fe890['having']('`unreadMessages`\x20>\x200');}}if(_0x25b3a8['query'][_0xb8f1('0x82')]){_0x36e0fc=_[_0xb8f1('0x83')](_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x82')])?_0x25b3a8[_0xb8f1('0x45')]['tag']:new Array(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x82')]);_0x36e0fc[_0xb8f1('0x31')](function(_0x331530){_0x5b4e50['or'](_0xb8f1('0x73'),'%,'+_0x331530+',%');});}if(_0x25b3a8[_0xb8f1('0x45')]['filter']){var _0x25ab93=_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x84')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb8f1('0x85')](_0x25ab93)){_0x4ed6fc['or'](_0xb8f1('0x86'),_0x25ab93+'%');}else if(qs['isEmail'](_0x25ab93)){_0x4ed6fc['or'](_0xb8f1('0x87'),_0x25ab93+'%');}else{_0x4ed6fc['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb8f1('0x6c')](_0x25ab93))['or'](_0xb8f1('0x88'),qs['getFullTextValue'](_0x25ab93));}}}_0x4fe890['where'](_0x4ed6fc);_0x4fe890[_0xb8f1('0x89')](_0xb8f1('0x8a'));var _0xd984a2={'type':db[_0xb8f1('0x8b')]['QueryTypes'][_0xb8f1('0x8c')],'raw':!![]};var _0x3bad18=_0x4fe890[_0xb8f1('0x8d')]();_0x3bad18['field'](_0xb8f1('0x8a'));_0x3bad18[_0xb8f1('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb8f1('0x8e'));if(_0xdee854['order']){_0xdee854[_0xb8f1('0x47')][_0xb8f1('0x31')](function(_0x45f499){var _0x488603=_0x45f499[0x0]===_0xb8f1('0x8f')?_0x45f499[0x0]:'i.'+_0x45f499[0x0];_0x4fe890[_0xb8f1('0x47')](_0x488603,_0x45f499[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb8f1('0x90')](_0x36e0fc)){_0x4fe890[_0xb8f1('0x65')](_0x5b4e50);_0x3bad18['where'](_0xb8f1('0x91'),_0x36e0fc);}BPromise[_0xb8f1('0x92')]()[_0xb8f1('0x28')](function(){if(!_0x4acd9d){if(_0x25b3a8[_0xb8f1('0x45')]['MailAccountId'])return;_0x3bad18[_0xb8f1('0x49')](_0xb8f1('0x93'));_0x4fe890['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x25b3a8[_0xb8f1('0x94')][_0xb8f1('0x95')]!==_0xb8f1('0x96'))return;return _0x25b3a8[_0xb8f1('0x94')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xb8f1('0x28')](function(_0x229d3d){if(_[_0xb8f1('0x90')](_0x229d3d)){_0x3bad18[_0xb8f1('0x49')]('i.MailAccountId\x20IS\x20NULL');_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x97'));}else{_0x3bad18['where'](_0xb8f1('0x7a'),_[_0xb8f1('0x2e')](_0x229d3d,'id'));_0x4fe890[_0xb8f1('0x49')](_0xb8f1('0x7a'),_['map'](_0x229d3d,'id'));}});})['then'](function(){if(_0x25b3a8[_0xb8f1('0x94')][_0xb8f1('0x95')]===_0xb8f1('0x96')&&!_0x4acd9d&&!_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x79')])return[];return db[_0xb8f1('0x98')][_0xb8f1('0x45')](_0x3bad18['toString'](),_0xd984a2);})[_0xb8f1('0x28')](function(_0x5ba4ad){_0x1ebf07[_0xb8f1('0x20')]=_0x5ba4ad[_0xb8f1('0x62')];if(_0x1ebf07[_0xb8f1('0x20')]===0x0)return[];return db['sequelize'][_0xb8f1('0x45')](_0x4cc3c0[_0xb8f1('0x99')](),_0xd984a2)[_0xb8f1('0x28')](function(_0x1b308f){_0x21cad9=_[_0xb8f1('0x9a')](_0x1b308f,'id');_0xd984a2=_[_0xb8f1('0x9b')](_0xd984a2,{'model':db[_0xb8f1('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x25b3a8[_0xb8f1('0x45')][_0xb8f1('0x43')]){_0xdee854['attributes'][_0xb8f1('0x31')](function(_0x15c8a0){_0x4fe890[_0xb8f1('0x4b')]('i.'+_0x15c8a0);});}else{_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0x9c'),_0xb8f1('0x8e'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0x9d'),'Account.key');_0x4fe890['field'](_0xb8f1('0x9e'),_0xb8f1('0x9f'));_0x4fe890['field'](_0xb8f1('0xa0'),'contactName');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0x8a'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa1'));_0x4fe890[_0xb8f1('0x4b')]('i.updatedAt');_0x4fe890['field']('i.closed');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa2'));_0x4fe890['field'](_0xb8f1('0xa3'));_0x4fe890[_0xb8f1('0x4b')]('i.lastMsgAt');_0x4fe890[_0xb8f1('0x4b')]('i.lastMsgDirection');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa4'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa5'));_0x4fe890[_0xb8f1('0x4b')]('i.secondDisposition');_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa6'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa7'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa8'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xa9'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xaa'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xab'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xac'),_0xb8f1('0xad'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xae'),'Contact.lastName');_0x4fe890['field'](_0xb8f1('0xaf'),_0xb8f1('0xb0'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xb1'),_0xb8f1('0xb2'));_0x4fe890['field']('c.mobile',_0xb8f1('0xb3'));_0x4fe890[_0xb8f1('0x4b')](_0xb8f1('0xb4'),_0xb8f1('0xb5'));_0x4fe890[_0xb8f1('0x4b')]('o.fullname','Owner.fullname');_0x4fe890['field'](_0xb8f1('0xb6'),_0xb8f1('0xb7'));_0x4fe890[_0xb8f1('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb8f1('0x2f'));}if(_0xdee854['limit'])_0x4fe890[_0xb8f1('0x1f')](_0xdee854[_0xb8f1('0x1f')]);if(_0xdee854[_0xb8f1('0x21')])_0x4fe890['offset'](_0xdee854[_0xb8f1('0x21')]);return db['sequelize'][_0xb8f1('0x45')](_0x4fe890[_0xb8f1('0x99')](),_0xd984a2);})[_0xb8f1('0x28')](function(_0xc26b38){if(_0xc26b38[_0xb8f1('0x62')]>0x0)_0x51fb08[_0xb8f1('0x49')](_0xb8f1('0xb8'),_[_0xb8f1('0x2e')](_0xc26b38,'id'));return db[_0xb8f1('0x98')][_0xb8f1('0x45')](_0x51fb08[_0xb8f1('0x99')](),_0xd984a2)[_0xb8f1('0x28')](function(_0x10bdbd){var _0x1c1ba6=_[_0xb8f1('0xb9')](_0x10bdbd,'MailInteractionId');var _0x131a96=[];return db[_0xb8f1('0xba')][_0xb8f1('0x35')]({'attributes':[_0xb8f1('0xbb')],'raw':!![]})['then'](function(_0x871bce){var _0x407df8=_0x871bce[_0xb8f1('0xbb')];_0xc26b38[_0xb8f1('0x31')](function(_0x3e437c){_0x131a96[_0xb8f1('0x33')](updateMailInteraction(_0x3e437c,_0x21cad9,_0x1c1ba6,_0x407df8));});return BPromise['all'](_0x131a96);});});});})[_0xb8f1('0x28')](function(_0x5297eb){_0x1ebf07[_0xb8f1('0xbc')]=_0x5297eb;return _0x1ebf07;})[_0xb8f1('0x28')](respondWithFilteredResult(_0x23b575,_0xdee854))[_0xb8f1('0x39')](handleError(_0x23b575,null));};exports[_0xb8f1('0xbd')]=function(_0x253724,_0x513a5d){var _0x3d0ab7={'raw':![],'where':{'id':_0x253724[_0xb8f1('0xbe')]['id']}},_0xc3b2ed={};_0xc3b2ed[_0xb8f1('0x42')]=_[_0xb8f1('0x3f')](db[_0xb8f1('0x3a')]['rawAttributes']);_0xc3b2ed[_0xb8f1('0x45')]=_[_0xb8f1('0x3f')](_0x253724[_0xb8f1('0x45')]);_0xc3b2ed[_0xb8f1('0x40')]=_[_0xb8f1('0x41')](_0xc3b2ed[_0xb8f1('0x42')],_0xc3b2ed['query']);_0x3d0ab7[_0xb8f1('0x44')]=_[_0xb8f1('0x41')](_0xc3b2ed[_0xb8f1('0x42')],qs[_0xb8f1('0x43')](_0x253724[_0xb8f1('0x45')]['fields']));_0x3d0ab7[_0xb8f1('0x44')]=_0x3d0ab7[_0xb8f1('0x44')][_0xb8f1('0x62')]?_0x3d0ab7[_0xb8f1('0x44')]:_0xc3b2ed[_0xb8f1('0x42')];if(_0x253724['query'][_0xb8f1('0xbf')]){_0x3d0ab7[_0xb8f1('0xc0')]=[{'all':!![]}];}_0x3d0ab7=_[_0xb8f1('0x9b')]({},_0x3d0ab7,_0x253724[_0xb8f1('0xc1')]);return db[_0xb8f1('0x3a')]['find'](_0x3d0ab7)[_0xb8f1('0x28')](handleEntityNotFound(_0x513a5d,null))[_0xb8f1('0x28')](respondWithResult(_0x513a5d,null))[_0xb8f1('0x39')](handleError(_0x513a5d,null));};exports[_0xb8f1('0xc2')]=function(_0xbe1f05,_0x59c137){return db['MailInteraction'][_0xb8f1('0xc2')](_0xbe1f05['body'],{})[_0xb8f1('0x28')](respondWithResult(_0x59c137,0xc9))[_0xb8f1('0x39')](handleError(_0x59c137,null));};exports[_0xb8f1('0x27')]=function(_0x5781b6,_0x35cb45){if(_0x5781b6[_0xb8f1('0xc3')]['id']){delete _0x5781b6[_0xb8f1('0xc3')]['id'];}return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x5781b6[_0xb8f1('0xbe')]['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x35cb45,null))[_0xb8f1('0x28')](saveUpdates(_0x5781b6['body'],null))[_0xb8f1('0x28')](respondWithResult(_0x35cb45,null))[_0xb8f1('0x39')](handleError(_0x35cb45,null));};exports[_0xb8f1('0x29')]=function(_0x5bd9cf,_0x1a00c4){return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x5bd9cf['params']['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x1a00c4,null))[_0xb8f1('0x28')](removeEntity(_0x1a00c4,null))[_0xb8f1('0x39')](handleError(_0x1a00c4,null));};exports[_0xb8f1('0xc4')]=function(_0x4d138e,_0x5bec39){return db[_0xb8f1('0x3a')]['describe']()['then'](respondWithResult(_0x5bec39,null))['catch'](handleError(_0x5bec39,null));};exports['addMessage']=function(_0x492e37,_0x36cf99,_0x6ee73){return db['MailMessage'][_0xb8f1('0x63')]({'where':{'id':_0x492e37[_0xb8f1('0xbe')]['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x36cf99,null))[_0xb8f1('0x28')](function(_0x70ffb0){if(_0x70ffb0){return _0x70ffb0[_0xb8f1('0xc5')](_0x492e37[_0xb8f1('0xc3')]['ids'],_[_0xb8f1('0xc6')](_0x492e37[_0xb8f1('0xc3')],[_0xb8f1('0xc7'),'id'])||{});}})[_0xb8f1('0x28')](respondWithResult(_0x36cf99,null))[_0xb8f1('0x39')](handleError(_0x36cf99,null));};exports['getMessages']=function(_0xc08d47,_0x3911e8,_0x193693){var _0x375c3a={'raw':![],'where':{}};var _0x3d74af={};var _0x23d567={'count':0x0,'rows':[]};return db['MailInteraction'][_0xb8f1('0x35')]({'where':{'id':_0xc08d47[_0xb8f1('0xbe')]['id']}})[_0xb8f1('0x28')](handleEntityNotFound(_0x3911e8,null))['then'](function(_0x144e19){if(_0x144e19){_0x3d74af['model']=_[_0xb8f1('0x3f')](db[_0xb8f1('0x34')][_0xb8f1('0x3b')]);_0x3d74af['query']=_[_0xb8f1('0x3f')](_0xc08d47[_0xb8f1('0x45')]);_0x3d74af['filters']=_[_0xb8f1('0x41')](_0x3d74af['model'],_0x3d74af[_0xb8f1('0x45')]);_0x375c3a[_0xb8f1('0x44')]=_[_0xb8f1('0x41')](_0x3d74af[_0xb8f1('0x42')],qs['fields'](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x43')]));_0x375c3a[_0xb8f1('0x44')]=_0x375c3a[_0xb8f1('0x44')][_0xb8f1('0x62')]?_0x375c3a['attributes']:_0x3d74af['model'];if(!_0xc08d47[_0xb8f1('0x45')]['hasOwnProperty'](_0xb8f1('0x46'))){_0x375c3a['limit']=qs[_0xb8f1('0x1f')](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x1f')]);_0x375c3a[_0xb8f1('0x21')]=qs['offset'](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x21')]);}_0x375c3a['order']=qs[_0xb8f1('0x48')](_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x48')]);_0x375c3a['where']=qs[_0xb8f1('0x40')](_['pick'](_0xc08d47[_0xb8f1('0x45')],_0x3d74af[_0xb8f1('0x40')]));_0x375c3a[_0xb8f1('0x49')][_0xb8f1('0xc8')]=_0x144e19['id'];if(_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x84')]){_0x375c3a[_0xb8f1('0x49')]=_[_0xb8f1('0x9b')](_0x375c3a[_0xb8f1('0x49')],{'$or':_[_0xb8f1('0x2e')](_0x375c3a[_0xb8f1('0x44')],function(_0x4fd903){var _0x4d9df1={};_0x4d9df1[_0x4fd903]={'$like':'%'+_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x84')]+'%'};return _0x4d9df1;})});}if(_0xc08d47[_0xb8f1('0x45')]['$gte']){var _0x49b45f=_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0x7c')][_0xb8f1('0x30')](',');var _0x544ed9={};_0x544ed9[_0x49b45f[0x0]]={'$gte':moment(_0x49b45f[0x1])[_0xb8f1('0xc9')](_0xb8f1('0xca'))};_0x375c3a[_0xb8f1('0x49')]=_['merge'](_0x375c3a['where'],_0x544ed9);}_0x375c3a=_['merge']({},_0x375c3a,_0xc08d47[_0xb8f1('0xc1')]);return db['MailMessage']['count']({'where':_0x375c3a[_0xb8f1('0x49')]})[_0xb8f1('0x28')](function(_0x4545ee){_0x23d567['count']=_0x4545ee;if(_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0xbf')]){_0x375c3a[_0xb8f1('0xc0')]=[{'all':!![]}];}return db[_0xb8f1('0x34')][_0xb8f1('0xcb')](_0x375c3a);})[_0xb8f1('0x28')](function(_0x312495){if(_0xc08d47[_0xb8f1('0x45')][_0xb8f1('0xcc')]==='true'){for(var _0x2c83bf=0x0;_0x2c83bf<_0x312495[_0xb8f1('0x62')];_0x2c83bf++){_0x312495[_0x2c83bf]['body']=juice(_0x312495[_0x2c83bf][_0xb8f1('0xc3')]);}}_0x23d567['rows']=_0x312495;return _0x23d567;});}})[_0xb8f1('0x28')](respondWithFilteredResult(_0x3911e8,_0x375c3a))['catch'](handleError(_0x3911e8,null));};exports[_0xb8f1('0xcd')]=function(_0x1b0615,_0x42b6a6,_0x3fd463){return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x1b0615[_0xb8f1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x42b6a6,null))[_0xb8f1('0x28')](function(_0x132eaf){if(_0x132eaf){return _0x132eaf[_0xb8f1('0xce')](_0x1b0615[_0xb8f1('0xc3')][_0xb8f1('0xc7')],_['omit'](_0x1b0615[_0xb8f1('0xc3')],[_0xb8f1('0xc7'),'id'])||{})[_0xb8f1('0xcf')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xb8f1('0x4c')],'where':{'id':_0x1b0615['body'][_0xb8f1('0xc7')]}});})[_0xb8f1('0x28')](function(_0x2baa90){socket['emit'](_0xb8f1('0xd0'),{'id':Number(_0x1b0615[_0xb8f1('0xbe')]['id']),'tags':_0x2baa90||[]});return{'id':Number(_0x1b0615['params']['id']),'tags':_0x2baa90||[]};});}})[_0xb8f1('0x28')](respondWithResult(_0x42b6a6,null))[_0xb8f1('0x39')](handleError(_0x42b6a6,null));};exports[_0xb8f1('0xd1')]=function(_0x489990,_0x2cd775,_0x469d24){return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x489990[_0xb8f1('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2cd775,null))[_0xb8f1('0x28')](function(_0x3c3420){if(_0x3c3420){return _0x3c3420['removeTags'](_0x489990['query'][_0xb8f1('0xc7')]);}})['then'](respondWithStatusCode(_0x2cd775,null))[_0xb8f1('0x39')](handleError(_0x2cd775,null));};exports[_0xb8f1('0xd2')]=function(_0x300c43,_0x1c25ae){var _0x358e44=moment()[_0xb8f1('0xd3')]()[_0xb8f1('0x99')]();var _0x35b735=path[_0xb8f1('0xd4')](config['root'],_0xb8f1('0xd5'),_0xb8f1('0xd6'),_0xb8f1('0xd7'));var _0x39cb4b=path[_0xb8f1('0xd4')](config[_0xb8f1('0xd8')],_0xb8f1('0xd5'),'files',_0xb8f1('0xd9'));var _0x35e1a4=path[_0xb8f1('0xd4')](_0x35b735,_0x358e44);var _0x3320dd=util[_0xb8f1('0xc9')](_0xb8f1('0xda'),_0x300c43[_0xb8f1('0xbe')]['id'],_0x358e44);var _0x2824a3=path[_0xb8f1('0xd4')](_0x35b735,_0x3320dd);var _0x524a98=[];if(_0x300c43['query'][_0xb8f1('0xd9')]){_0x524a98[_0xb8f1('0x33')]({'model':db[_0xb8f1('0xdb')],'as':'Attachments','raw':!![]});}var _0x3dda09=[{'model':db[_0xb8f1('0x34')],'as':_0xb8f1('0xdc'),'attributes':['id',_0xb8f1('0xc3'),_0xb8f1('0x4d'),'to','cc',_0xb8f1('0xdd'),_0xb8f1('0xde'),_0xb8f1('0xdf')],'where':{'secret':![]},'order':qs[_0xb8f1('0x48')]('id'),'include':_0x524a98}];return db[_0xb8f1('0x3a')][_0xb8f1('0x63')]({'where':{'id':_0x300c43[_0xb8f1('0xbe')]['id']},'include':_0x3dda09})[_0xb8f1('0x28')](handleEntityNotFound(_0x1c25ae,null))[_0xb8f1('0x28')](function(_0x2b82bb){if(_0x2b82bb&&_0x2b82bb[_0xb8f1('0xdc')]){var _0x5d32b6=_0x2b82bb[_0xb8f1('0xe0')]({'plain':!![]});fs[_0xb8f1('0xe1')](_0x35e1a4);return BPromise[_0xb8f1('0xe2')](_0x5d32b6[_0xb8f1('0xdc')],function(_0x145e08,_0x215bbf){var _0xbc1f39={'from':_0x145e08[_0xb8f1('0x4d')],'to':_0x145e08['to'],'subject':_0x145e08[_0xb8f1('0xde')],'html':_0x145e08[_0xb8f1('0xc3')],'headers':{'Date':moment(_0x145e08[_0xb8f1('0xdf')])[_0xb8f1('0xc9')](_0xb8f1('0xe3'))},'attachments':[]};if(_0x145e08['cc']){_0xbc1f39['headers']['Cc']=_0x145e08['cc'];}if(_0x145e08['bcc']){_0xbc1f39[_0xb8f1('0xe4')][_0xb8f1('0xe5')]=_0x145e08['bcc'];}return new BPromise(function(_0x3be5c1,_0x4b3940){if(_0x145e08['Attachments']){for(var _0xe2327a=0x0;_0xe2327a<_0x145e08['Attachments'][_0xb8f1('0x62')];_0xe2327a++){var _0x52565c=_0x145e08[_0xb8f1('0xe6')][_0xe2327a];var _0x33ff41=path[_0xb8f1('0xd4')](_0x39cb4b,_0x52565c[_0xb8f1('0xe7')]);if(fs[_0xb8f1('0xe8')](_0x33ff41)){_0xbc1f39[_0xb8f1('0xd9')]['push']({'name':_0x52565c[_0xb8f1('0x2c')],'contentType':_0x52565c[_0xb8f1('0x3d')],'data':fs[_0xb8f1('0xe9')](_0x33ff41)});}}}emlformat[_0xb8f1('0xea')](_0xbc1f39,function(_0x455514,_0x583688){if(_0x455514)return _0x4b3940(_0x455514);fs[_0xb8f1('0xeb')](path[_0xb8f1('0xd4')](_0x35e1a4,util[_0xb8f1('0xc9')](_0xb8f1('0xec'),_0x215bbf)),_0x583688);return _0x3be5c1(_0x583688);});});})[_0xb8f1('0x28')](function(){return new BPromise(function(_0x27d04c,_0x381ebc){zipdir(_0x35e1a4,{'saveTo':_0x2824a3},function(_0x8e5b1,_0x379ea0){if(_0x8e5b1)return _0x381ebc(_0x8e5b1);return _0x27d04c(_0x379ea0);});})[_0xb8f1('0x28')](function(){return new BPromise(function(_0x4aca56,_0x130b39){rimraf(_0x35e1a4,function(_0x19b32c){if(_0x19b32c)_0x130b39(_0x19b32c);return _0x4aca56();});});})[_0xb8f1('0x28')](function(){return _0x1c25ae[_0xb8f1('0xd2')](_0x2824a3,_0x3320dd,function(_0x536f35){if(_0x536f35){console[_0xb8f1('0xed')](_0xb8f1('0xee'),_0x536f35);}else{fs[_0xb8f1('0xef')](_0x2824a3);}});});});}else{return _0x1c25ae[_0xb8f1('0x1a')](0xc8);}})['catch'](handleError(_0x1c25ae,null));};
\ No newline at end of file
index 84c6c95..ec0ccdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79b2=['save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x79b2,0x87));var _0x279b=function(_0x40765a,_0x36b8a5){_0x40765a=_0x40765a-0x0;var _0x16c8c4=_0x79b2[_0x40765a];return _0x16c8c4;};'use strict';var EventEmitter=require(_0x279b('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x279b('0x1')];var MailMessage=require(_0x279b('0x2'))['db'][_0x279b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x279b('0x4')](0x0);var events={'afterCreate':_0x279b('0x5'),'afterUpdate':_0x279b('0x6'),'afterDestroy':_0x279b('0x7')};function emitEvent(_0x3c98ef){return function(_0x2a3f3e,_0x4603b7,_0x103baf){_0x2a3f3e[_0x279b('0x8')]({'attributes':['id'],'raw':!![]})[_0x279b('0x9')](function(_0x116adc){_0x2a3f3e[_0x279b('0xa')](_0x279b('0xb'),_0x116adc['map'](function(_0x274cf3){return{'id':_0x274cf3['id']};}));return MailMessage[_0x279b('0xc')]({'where':{'MailInteractionId':_0x2a3f3e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3eb829){_0x2a3f3e[_0x279b('0xa')](_0x279b('0xd'),_0x3eb829[_0x279b('0xe')]);MailInteractionEvents[_0x279b('0xf')](_0x3c98ef+':'+_0x2a3f3e['id'],_0x2a3f3e);MailInteractionEvents[_0x279b('0xf')](_0x3c98ef,_0x2a3f3e);_0x103baf(null);})[_0x279b('0x10')](_0x103baf(null));};}for(var e in events){if(events[_0x279b('0x11')](e)){var event=events[e];MailInteraction[_0x279b('0x12')](e,emitEvent(event));}}module[_0x279b('0x13')]=MailInteractionEvents;
\ No newline at end of file
+var _0xe96f=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x3e0fed,_0x22e5c3){var _0x4f2bd6=function(_0x178f58){while(--_0x178f58){_0x3e0fed['push'](_0x3e0fed['shift']());}};_0x4f2bd6(++_0x22e5c3);}(_0xe96f,0xe3));var _0xfe96=function(_0x20c1c1,_0x338552){_0x20c1c1=_0x20c1c1-0x0;var _0x5f3592=_0xe96f[_0x20c1c1];return _0x5f3592;};'use strict';var EventEmitter=require(_0xfe96('0x0'));var MailInteraction=require(_0xfe96('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0xfe96('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xfe96('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe96('0x4'),'afterDestroy':_0xfe96('0x5')};function emitEvent(_0x13212d){return function(_0x2c9812,_0x263da7,_0x296a8c){_0x2c9812[_0xfe96('0x6')]({'attributes':['id'],'raw':!![]})[_0xfe96('0x7')](function(_0x573fae){_0x2c9812[_0xfe96('0x8')](_0xfe96('0x9'),_0x573fae[_0xfe96('0xa')](function(_0x2ce95e){return{'id':_0x2ce95e['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2c9812['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2dc832){_0x2c9812[_0xfe96('0x8')]('unreadMessages',_0x2dc832[_0xfe96('0xb')]);MailInteractionEvents[_0xfe96('0xc')](_0x13212d+':'+_0x2c9812['id'],_0x2c9812);MailInteractionEvents[_0xfe96('0xc')](_0x13212d,_0x2c9812);_0x296a8c(null);})[_0xfe96('0xd')](_0x296a8c(null));};}for(var e in events){if(events[_0xfe96('0xe')](e)){var event=events[e];MailInteraction[_0xfe96('0xf')](e,emitEvent(event));}}module[_0xfe96('0x10')]=MailInteractionEvents;
\ No newline at end of file
index 66fb152..5c7f12e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b5c=['define','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','closed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x6b5c,0x124));var _0xc6b5=function(_0xb0ed0c,_0x1a1fb1){_0xb0ed0c=_0xb0ed0c-0x0;var _0x5d5356=_0x6b5c[_0xb0ed0c];return _0x5d5356;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc6b5('0x0'))(_0xc6b5('0x1'));var moment=require('moment');var BPromise=require(_0xc6b5('0x2'));var rp=require(_0xc6b5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6b5('0x4'));var config=require(_0xc6b5('0x5'));var attributes=require(_0xc6b5('0x6'));module[_0xc6b5('0x7')]=function(_0x151e93,_0x53880b){return _0x151e93[_0xc6b5('0x8')]('MailInteraction',attributes,{'tableName':_0xc6b5('0x9'),'paranoid':![],'indexes':[{'name':_0xc6b5('0xa'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4da6cd,_0x291407,_0x1546ed){if(_0x4da6cd[_0xc6b5('0xb')]){_0x4da6cd[_0xc6b5('0xc')]=moment()[_0xc6b5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4da6cd['closed']){_0x4da6cd[_0xc6b5('0xe')]=moment()[_0xc6b5('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1546ed(null,_0x291407);},'beforeUpdate':function(_0x461bb8,_0x50dee8,_0x3288ba){if(_0x461bb8[_0xc6b5('0xf')](_0xc6b5('0xb'))){_0x461bb8[_0xc6b5('0xc')]=_0x461bb8['substatus']?moment()[_0xc6b5('0xd')](_0xc6b5('0x10')):null;}if(_0x461bb8['changed'](_0xc6b5('0x11'))){_0x461bb8[_0xc6b5('0xe')]=moment()['format'](_0xc6b5('0x10'));_0x461bb8[_0xc6b5('0xb')]=null;_0x461bb8['substatusAt']=null;}_0x3288ba(null,_0x461bb8);},'afterUpdate':function(_0x36a2dd,_0x1aadef,_0x4fa0e5){var _0x5070c1=_0x151e93[_0xc6b5('0x12')];var _0x12bfd8=_0x36a2dd[_0xc6b5('0x13')]({'plain':!![]});if(_0x12bfd8[_0xc6b5('0x11')]){return _0x5070c1['MailMessage'][_0xc6b5('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x12bfd8['id']}})[_0xc6b5('0x15')](function(){_0x4fa0e5();})[_0xc6b5('0x16')](function(_0x5091b0){_0x4fa0e5(_0x5091b0);});}else{_0x4fa0e5();}}},'charset':_0xc6b5('0x17'),'collate':_0xc6b5('0x18')});};
\ No newline at end of file
+var _0x8aeb=['bluebird','exports','define','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','models','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','api'];(function(_0x3caa1b,_0x1e41c8){var _0x2d37b8=function(_0x3a4ba5){while(--_0x3a4ba5){_0x3caa1b['push'](_0x3caa1b['shift']());}};_0x2d37b8(++_0x1e41c8);}(_0x8aeb,0xda));var _0xb8ae=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0x8aeb[_0x421725];return _0x51b322;};'use strict';var _=require(_0xb8ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb8ae('0x1'));var moment=require('moment');var BPromise=require(_0xb8ae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xb8ae('0x3')]=function(_0x5313fd,_0x3e2278){return _0x5313fd[_0xb8ae('0x4')]('MailInteraction',attributes,{'tableName':_0xb8ae('0x5'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xb8ae('0x6'),'to'],'type':_0xb8ae('0x7')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f21b0,_0x323f3d,_0x5759eb){if(_0x2f21b0[_0xb8ae('0x8')]){_0x2f21b0[_0xb8ae('0x9')]=moment()['format'](_0xb8ae('0xa'));}if(_0x2f21b0[_0xb8ae('0xb')]){_0x2f21b0['closedAt']=moment()[_0xb8ae('0xc')](_0xb8ae('0xa'));}_0x5759eb(null,_0x323f3d);},'beforeUpdate':function(_0x2ac880,_0x51d252,_0x263efd){if(_0x2ac880['changed'](_0xb8ae('0x8'))){_0x2ac880[_0xb8ae('0x9')]=_0x2ac880[_0xb8ae('0x8')]?moment()['format'](_0xb8ae('0xa')):null;}if(_0x2ac880[_0xb8ae('0xd')]('closed')){_0x2ac880['closedAt']=moment()[_0xb8ae('0xc')](_0xb8ae('0xa'));_0x2ac880['substatus']=null;_0x2ac880['substatusAt']=null;}_0x263efd(null,_0x2ac880);},'afterUpdate':function(_0x124235,_0x30eb41,_0x20dad8){var _0x540d21=_0x5313fd[_0xb8ae('0xe')];var _0x483cf6=_0x124235['get']({'plain':!![]});if(_0x483cf6[_0xb8ae('0xb')]){return _0x540d21[_0xb8ae('0xf')][_0xb8ae('0x10')]({'read':!![]},{'where':{'MailInteractionId':_0x483cf6['id']}})[_0xb8ae('0x11')](function(){_0x20dad8();})[_0xb8ae('0x12')](function(_0x23c5f6){_0x20dad8(_0x23c5f6);});}else{_0x20dad8();}}},'charset':'utf8mb4','collate':_0xb8ae('0x13')});};
\ No newline at end of file
index ba219e6..12f4bdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27af=['util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailInteraction','MailInteraction','update','options','attributes','limit','stringify','AddTagsToMailInteraction','addTags','body','ids','omit','spread','AddTags','lodash'];(function(_0x52b0b2,_0xf6dbf9){var _0x322769=function(_0x3ad9da){while(--_0x3ad9da){_0x52b0b2['push'](_0x52b0b2['shift']());}};_0x322769(++_0xf6dbf9);}(_0x27af,0x199));var _0xf27a=function(_0x531a78,_0x477d97){_0x531a78=_0x531a78-0x0;var _0x13ed6e=_0x27af[_0x531a78];return _0x13ed6e;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var moment=require(_0xf27a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf27a('0x3'));var fs=require('fs');var Redis=require(_0xf27a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf27a('0x5'))(_0xf27a('0x6'));var config=require(_0xf27a('0x7'));var jayson=require(_0xf27a('0x8'));var client=jayson[_0xf27a('0x9')][_0xf27a('0xa')]({'port':0x232a});config[_0xf27a('0xb')]=_[_0xf27a('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf27a('0xd'))(new Redis(config[_0xf27a('0xb')]));require(_0xf27a('0xe'))[_0xf27a('0xf')](socket);function respondWithRpcPromise(_0x4fb3fd,_0x49bcc6,_0x407129){return new BPromise(function(_0x2924b1,_0x475ec8){return client[_0xf27a('0x10')](_0x4fb3fd,_0x407129)[_0xf27a('0x11')](function(_0x2ce1e0){logger[_0xf27a('0x12')](_0xf27a('0x13'),_0x49bcc6,_0xf27a('0x14'));logger[_0xf27a('0x15')](_0xf27a('0x16'),_0x49bcc6,_0xf27a('0x14'),JSON['stringify'](_0x2ce1e0));if(_0x2ce1e0[_0xf27a('0x17')]){if(_0x2ce1e0['error'][_0xf27a('0x18')]===0x1f4){logger[_0xf27a('0x17')]('MailInteraction,\x20%s,\x20%s',_0x49bcc6,_0x2ce1e0[_0xf27a('0x17')][_0xf27a('0x19')]);return _0x475ec8(_0x2ce1e0['error']['message']);}logger[_0xf27a('0x17')]('MailInteraction,\x20%s,\x20%s',_0x49bcc6,_0x2ce1e0[_0xf27a('0x17')]['message']);return _0x2924b1(_0x2ce1e0['error'][_0xf27a('0x19')]);}else{logger['info'](_0xf27a('0x13'),_0x49bcc6,_0xf27a('0x14'));_0x2924b1(_0x2ce1e0['result'][_0xf27a('0x19')]);}})[_0xf27a('0x1a')](function(_0x21910a){logger['error']('MailInteraction,\x20%s,\x20%s',_0x49bcc6,_0x21910a);_0x475ec8(_0x21910a);});});}exports[_0xf27a('0x1b')]=function(_0x3e8ea3){var _0x550f3e=this;return new Promise(function(_0x587ea8,_0x6b55f6){return db[_0xf27a('0x1c')][_0xf27a('0x1d')](_0x3e8ea3['body'],{'raw':_0x3e8ea3['options']?_0x3e8ea3[_0xf27a('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e8ea3[_0xf27a('0x1e')]?_0x3e8ea3[_0xf27a('0x1e')]['where']||null:null,'attributes':_0x3e8ea3[_0xf27a('0x1e')]?_0x3e8ea3[_0xf27a('0x1e')][_0xf27a('0x1f')]||null:null,'limit':_0x3e8ea3[_0xf27a('0x1e')]?_0x3e8ea3[_0xf27a('0x1e')][_0xf27a('0x20')]||null:null})[_0xf27a('0x11')](function(_0x53b114){logger[_0xf27a('0x12')](_0xf27a('0x1b'),_0x3e8ea3);logger[_0xf27a('0x15')](_0xf27a('0x1b'),_0x3e8ea3,JSON[_0xf27a('0x21')](_0x53b114));_0x587ea8(_0x53b114);})['catch'](function(_0x22b990){logger['error']('UpdateMailInteraction',_0x22b990['message'],_0x3e8ea3);_0x6b55f6(_0x550f3e['error'](0x1f4,_0x22b990[_0xf27a('0x19')]));});});};exports[_0xf27a('0x22')]=function(_0x2b8a2c){return new Promise(function(_0x226799,_0x631a65){return db['MailInteraction']['find']({'where':_0x2b8a2c[_0xf27a('0x1e')]?_0x2b8a2c[_0xf27a('0x1e')]['where']||null:null})[_0xf27a('0x11')](function(_0x186863){if(_0x186863){return _0x186863[_0xf27a('0x23')](_0x2b8a2c[_0xf27a('0x24')][_0xf27a('0x25')],_[_0xf27a('0x26')](_0x2b8a2c['body'],['ids','id'])||{});}})[_0xf27a('0x27')](function(_0x34d412){logger[_0xf27a('0x12')](_0xf27a('0x28'),_0x2b8a2c);logger[_0xf27a('0x15')]('AddTags',_0x2b8a2c,JSON[_0xf27a('0x21')](_0x34d412));_0x226799(_0x34d412);})[_0xf27a('0x1a')](function(_0x493154){logger['error'](_0xf27a('0x28'),_0x493154[_0xf27a('0x19')],_0x2b8a2c);_0x631a65(_this['error'](0x1f4,_0x493154[_0xf27a('0x19')]));});});};
\ No newline at end of file
+var _0x273b=['body','options','raw','attributes','limit','AddTagsToMailInteraction','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update'];(function(_0x522d67,_0x57eb35){var _0x38f1c1=function(_0x4e7c86){while(--_0x4e7c86){_0x522d67['push'](_0x522d67['shift']());}};_0x38f1c1(++_0x57eb35);}(_0x273b,0xb8));var _0xb273=function(_0x55725f,_0x81a704){_0x55725f=_0x55725f-0x0;var _0x486997=_0x273b[_0x55725f];return _0x486997;};'use strict';var _=require('lodash');var util=require(_0xb273('0x0'));var moment=require(_0xb273('0x1'));var BPromise=require(_0xb273('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb273('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb273('0x4'));var logger=require(_0xb273('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb273('0x6'));var client=jayson[_0xb273('0x7')][_0xb273('0x8')]({'port':0x232a});config[_0xb273('0x9')]=_[_0xb273('0xa')](config[_0xb273('0x9')],{'host':_0xb273('0xb'),'port':0x18eb});var socket=require(_0xb273('0xc'))(new Redis(config[_0xb273('0x9')]));require(_0xb273('0xd'))[_0xb273('0xe')](socket);function respondWithRpcPromise(_0x2c39c9,_0x9cce80,_0x3a8a2e){return new BPromise(function(_0x263b5e,_0x33f44f){return client[_0xb273('0xf')](_0x2c39c9,_0x3a8a2e)[_0xb273('0x10')](function(_0xe1cf38){logger['info'](_0xb273('0x11'),_0x9cce80,_0xb273('0x12'));logger[_0xb273('0x13')](_0xb273('0x14'),_0x9cce80,_0xb273('0x12'),JSON[_0xb273('0x15')](_0xe1cf38));if(_0xe1cf38['error']){if(_0xe1cf38[_0xb273('0x16')][_0xb273('0x17')]===0x1f4){logger[_0xb273('0x16')](_0xb273('0x11'),_0x9cce80,_0xe1cf38['error'][_0xb273('0x18')]);return _0x33f44f(_0xe1cf38[_0xb273('0x16')][_0xb273('0x18')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x9cce80,_0xe1cf38[_0xb273('0x16')][_0xb273('0x18')]);return _0x263b5e(_0xe1cf38[_0xb273('0x16')][_0xb273('0x18')]);}else{logger[_0xb273('0x19')]('MailInteraction,\x20%s,\x20%s',_0x9cce80,_0xb273('0x12'));_0x263b5e(_0xe1cf38[_0xb273('0x1a')][_0xb273('0x18')]);}})[_0xb273('0x1b')](function(_0x556779){logger[_0xb273('0x16')]('MailInteraction,\x20%s,\x20%s',_0x9cce80,_0x556779);_0x33f44f(_0x556779);});});}exports[_0xb273('0x1c')]=function(_0x26749e){var _0x142d5f=this;return new Promise(function(_0x4f1e73,_0x2a4f39){return db[_0xb273('0x1d')][_0xb273('0x1e')](_0x26749e[_0xb273('0x1f')],{'raw':_0x26749e[_0xb273('0x20')]?_0x26749e[_0xb273('0x20')][_0xb273('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26749e[_0xb273('0x20')]?_0x26749e['options']['where']||null:null,'attributes':_0x26749e['options']?_0x26749e[_0xb273('0x20')][_0xb273('0x22')]||null:null,'limit':_0x26749e[_0xb273('0x20')]?_0x26749e[_0xb273('0x20')][_0xb273('0x23')]||null:null})['then'](function(_0x32a2b7){logger[_0xb273('0x19')]('UpdateMailInteraction',_0x26749e);logger[_0xb273('0x13')]('UpdateMailInteraction',_0x26749e,JSON['stringify'](_0x32a2b7));_0x4f1e73(_0x32a2b7);})[_0xb273('0x1b')](function(_0x42ef7e){logger[_0xb273('0x16')](_0xb273('0x1c'),_0x42ef7e[_0xb273('0x18')],_0x26749e);_0x2a4f39(_0x142d5f[_0xb273('0x16')](0x1f4,_0x42ef7e[_0xb273('0x18')]));});});};exports[_0xb273('0x24')]=function(_0x1d9a8b){return new Promise(function(_0x4a8697,_0x193bbe){return db['MailInteraction']['find']({'where':_0x1d9a8b[_0xb273('0x20')]?_0x1d9a8b[_0xb273('0x20')][_0xb273('0x25')]||null:null})[_0xb273('0x10')](function(_0x240d80){if(_0x240d80){return _0x240d80[_0xb273('0x26')](_0x1d9a8b['body'][_0xb273('0x27')],_[_0xb273('0x28')](_0x1d9a8b[_0xb273('0x1f')],[_0xb273('0x27'),'id'])||{});}})[_0xb273('0x29')](function(_0x2d8a55){logger[_0xb273('0x19')]('AddTags',_0x1d9a8b);logger[_0xb273('0x13')]('AddTags',_0x1d9a8b,JSON['stringify'](_0x2d8a55));_0x4a8697(_0x2d8a55);})[_0xb273('0x1b')](function(_0x4819d7){logger[_0xb273('0x16')](_0xb273('0x2a'),_0x4819d7[_0xb273('0x18')],_0x1d9a8b);_0x193bbe(_this[_0xb273('0x16')](0x1f4,_0x4819d7[_0xb273('0x18')]));});});};
\ No newline at end of file
index 3566da2..63ef4dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc7=['save','remove','update','emit','register','mailInteraction:','./mailInteraction.events'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7cc7,0x68));var _0x77cc=function(_0x5ca390,_0x4ae8d5){_0x5ca390=_0x5ca390-0x0;var _0x43f1cc=_0x7cc7[_0x5ca390];return _0x43f1cc;};'use strict';var MailInteractionEvents=require(_0x77cc('0x0'));var events=[_0x77cc('0x1'),_0x77cc('0x2'),_0x77cc('0x3')];function createListener(_0xfda386,_0x46b719){return function(_0x3575ee){_0x46b719[_0x77cc('0x4')](_0xfda386,_0x3575ee);};}function removeListener(_0x2f3d7a,_0x3230c7){return function(){MailInteractionEvents['removeListener'](_0x2f3d7a,_0x3230c7);};}exports[_0x77cc('0x5')]=function(_0x4fee4d){for(var _0x169734=0x0,_0x17b10e=events['length'];_0x169734<_0x17b10e;_0x169734++){var _0x4754d0=events[_0x169734];var _0xdfced=createListener(_0x77cc('0x6')+_0x4754d0,_0x4fee4d);MailInteractionEvents['on'](_0x4754d0,_0xdfced);}};
\ No newline at end of file
+var _0x701c=['update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0x701c,0x9f));var _0xc701=function(_0x4e71f7,_0x147594){_0x4e71f7=_0x4e71f7-0x0;var _0x29970b=_0x701c[_0x4e71f7];return _0x29970b;};'use strict';var MailInteractionEvents=require(_0xc701('0x0'));var events=[_0xc701('0x1'),_0xc701('0x2'),_0xc701('0x3')];function createListener(_0x49d417,_0x5d8a8d){return function(_0x416dcc){_0x5d8a8d[_0xc701('0x4')](_0x49d417,_0x416dcc);};}function removeListener(_0x1bc212,_0x46dc00){return function(){MailInteractionEvents[_0xc701('0x5')](_0x1bc212,_0x46dc00);};}exports[_0xc701('0x6')]=function(_0x3ea957){for(var _0x57d9e2=0x0,_0x1575ce=events[_0xc701('0x7')];_0x57d9e2<_0x1575ce;_0x57d9e2++){var _0x5cca7f=events[_0x57d9e2];var _0x457486=createListener(_0xc701('0x8')+_0x5cca7f,_0x3ea957);MailInteractionEvents['on'](_0x5cca7f,_0x457486);}};
\ No newline at end of file
index 6558a81..39fc583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1df5=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xc904d3,_0x57ab3d){var _0xec9aea=function(_0x3ee93a){while(--_0x3ee93a){_0xc904d3['push'](_0xc904d3['shift']());}};_0xec9aea(++_0x57ab3d);}(_0x1df5,0xfd));var _0x51df=function(_0xb0fdab,_0x37841f){_0xb0fdab=_0xb0fdab-0x0;var _0x369695=_0x1df5[_0xb0fdab];return _0x369695;};'use strict';var multer=require(_0x51df('0x0'));var util=require(_0x51df('0x1'));var path=require(_0x51df('0x2'));var timeout=require(_0x51df('0x3'));var express=require(_0x51df('0x4'));var router=express['Router']();var fs_extra=require(_0x51df('0x5'));var auth=require(_0x51df('0x6'));var interaction=require(_0x51df('0x7'));var config=require(_0x51df('0x8'));var controller=require(_0x51df('0x9'));router[_0x51df('0xa')]('/',auth[_0x51df('0xb')](),controller[_0x51df('0xc')]);router['get'](_0x51df('0xd'),auth['isAuthenticated'](),controller[_0x51df('0xe')]);router[_0x51df('0xa')](_0x51df('0xf'),auth[_0x51df('0xb')](),controller[_0x51df('0x10')]);router[_0x51df('0xa')](_0x51df('0x11'),auth[_0x51df('0xb')](),controller['download']);router[_0x51df('0x12')]('/',auth[_0x51df('0xb')](),interaction[_0x51df('0x13')](_0x51df('0x14'),_0x51df('0x15')),controller[_0x51df('0x16')]);router[_0x51df('0x17')](_0x51df('0xf'),auth[_0x51df('0xb')](),controller[_0x51df('0x18')]);router[_0x51df('0x17')](_0x51df('0x19'),auth[_0x51df('0xb')](),controller[_0x51df('0x1a')]);router[_0x51df('0x17')]('/:id/reject',auth[_0x51df('0xb')](),controller[_0x51df('0x1b')]);router['delete'](_0x51df('0xf'),auth[_0x51df('0xb')](),controller[_0x51df('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x3670=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x3670,0x16c));var _0x0367=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3670[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x0367('0x0'));var path=require(_0x0367('0x1'));var timeout=require(_0x0367('0x2'));var express=require(_0x0367('0x3'));var router=express[_0x0367('0x4')]();var fs_extra=require(_0x0367('0x5'));var auth=require(_0x0367('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0367('0x7'));var controller=require(_0x0367('0x8'));router[_0x0367('0x9')]('/',auth[_0x0367('0xa')](),controller[_0x0367('0xb')]);router[_0x0367('0x9')](_0x0367('0xc'),auth[_0x0367('0xa')](),controller[_0x0367('0xd')]);router[_0x0367('0x9')](_0x0367('0xe'),auth[_0x0367('0xa')](),controller[_0x0367('0xf')]);router[_0x0367('0x9')](_0x0367('0x10'),auth[_0x0367('0xa')](),controller['download']);router[_0x0367('0x11')]('/',auth['isAuthenticated'](),interaction[_0x0367('0x12')](_0x0367('0x13'),_0x0367('0x14')),controller[_0x0367('0x15')]);router[_0x0367('0x16')](_0x0367('0xe'),auth[_0x0367('0xa')](),controller[_0x0367('0x17')]);router['put'](_0x0367('0x18'),auth[_0x0367('0xa')](),controller['accept']);router[_0x0367('0x16')](_0x0367('0x19'),auth[_0x0367('0xa')](),controller['reject']);router[_0x0367('0x1a')](_0x0367('0xe'),auth[_0x0367('0xa')](),controller[_0x0367('0x1b')]);module['exports']=router;
\ No newline at end of file
index 2a85454..7409848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b1=['BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Chat','Email','sequelize','lodash','TEXT','medium'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x61b1,0xd9));var _0x161b=function(_0x226225,_0x1fde70){_0x226225=_0x226225-0x0;var _0x3f382d=_0x61b1[_0x226225];return _0x3f382d;};'use strict';var Sequelize=require(_0x161b('0x0'));var _=require(_0x161b('0x1'));module['exports']={'body':{'type':Sequelize[_0x161b('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x161b('0x3'))},'read':{'type':Sequelize[_0x161b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x161b('0x5')]('in',_0x161b('0x6')),'defaultValue':_0x161b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x161b('0x7')](0x1fe)},'from':{'type':Sequelize[_0x161b('0x7')]},'to':{'type':Sequelize['TEXT'](_0x161b('0x8'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x161b('0x2')](_0x161b('0x8'))},'subject':{'type':Sequelize[_0x161b('0x2')]},'sentAt':{'type':Sequelize[_0x161b('0x9')]},'attach':{'type':Sequelize[_0x161b('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x161b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x161b('0x2')](_0x161b('0x8'))},'originCc':{'type':Sequelize[_0x161b('0x2')](_0x161b('0x8'))},'originChannel':{'type':Sequelize[_0x161b('0x5')]('Email',_0x161b('0xb')),'defaultValue':_0x161b('0xc'),'allowNull':![]}};
\ No newline at end of file
+var _0xcbf0=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','INTEGER','DATE','Email','sequelize','lodash'];(function(_0x5b2cb2,_0x53265f){var _0xe1d1e6=function(_0x510687){while(--_0x510687){_0x5b2cb2['push'](_0x5b2cb2['shift']());}};_0xe1d1e6(++_0x53265f);}(_0xcbf0,0xc1));var _0x0cbf=function(_0x4dc620,_0x2b341f){_0x4dc620=_0x4dc620-0x0;var _0x2f0c2c=_0xcbf0[_0x4dc620];return _0x2f0c2c;};'use strict';var Sequelize=require(_0x0cbf('0x0'));var _=require(_0x0cbf('0x1'));module[_0x0cbf('0x2')]={'body':{'type':Sequelize[_0x0cbf('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x0cbf('0x4'))},'read':{'type':Sequelize[_0x0cbf('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0cbf('0x6')]('in',_0x0cbf('0x7')),'defaultValue':_0x0cbf('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0cbf('0x8')](0x1fe)},'from':{'type':Sequelize[_0x0cbf('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize['TEXT'](_0x0cbf('0x9'))},'bcc':{'type':Sequelize['TEXT'](_0x0cbf('0x9'))},'subject':{'type':Sequelize[_0x0cbf('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x0cbf('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0cbf('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0cbf('0xb')]},'originTo':{'type':Sequelize[_0x0cbf('0x3')](_0x0cbf('0x9'))},'originCc':{'type':Sequelize[_0x0cbf('0x3')](_0x0cbf('0x9'))},'originChannel':{'type':Sequelize[_0x0cbf('0x6')](_0x0cbf('0xc'),'Chat'),'defaultValue':_0x0cbf('0xc'),'allowNull':![]}};
\ No newline at end of file
index 112f947..b44e7ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126e=['out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','basename','ListId','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','mail-interactions','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','acceptmessage','mail','interaction','rejectMessage','Sequelize','QueryTypes','email','interface','event','EventManager','rejectmessage','download','toString','join','server','files','from','bcc','subject','Attachment','createdAt','headers','Bcc','Attachments','push','build','writeFileSync','log','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','html-to-text','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','name','send','index','MailMessage','rawAttributes','fieldName','type','key','map','keys','query','filters','model','intersection','attributes','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','update','body','describe','create'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x126e,0x108));var _0xe126=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x126e[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe126('0x0'));var zipdir=require(_0xe126('0x1'));var jsonpatch=require(_0xe126('0x2'));var rp=require(_0xe126('0x3'));var moment=require(_0xe126('0x4'));var BPromise=require(_0xe126('0x5'));var Mustache=require('mustache');var util=require(_0xe126('0x6'));var path=require(_0xe126('0x7'));var sox=require(_0xe126('0x8'));var csv=require(_0xe126('0x9'));var ejs=require(_0xe126('0xa'));var fs=require('fs');var fs_extra=require(_0xe126('0xb'));var _=require(_0xe126('0xc'));var squel=require('squel');var crypto=require(_0xe126('0xd'));var jsforce=require(_0xe126('0xe'));var deskjs=require(_0xe126('0xf'));var toCsv=require(_0xe126('0x9'));var querystring=require(_0xe126('0x10'));var Papa=require('papaparse');var Redis=require(_0xe126('0x11'));var authService=require(_0xe126('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe126('0x13'));var hardwareService=require(_0xe126('0x14'));var logger=require('../../config/logger')(_0xe126('0x15'));var utils=require('../../config/utils');var config=require(_0xe126('0x16'));var licenseUtil=require('../../config/license/util');var htmlToText=require(_0xe126('0x17'));var db=require(_0xe126('0x18'))['db'];config[_0xe126('0x19')]=_[_0xe126('0x1a')](config[_0xe126('0x19')],{'host':_0xe126('0x1b'),'port':0x18eb});var socket=require(_0xe126('0x1c'))(new Redis(config['redis']));require(_0xe126('0x1d'))[_0xe126('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe126('0x1f')][_0xe126('0x20')]({'port':0x232c});var client9003=jayson[_0xe126('0x1f')][_0xe126('0x20')]({'port':0x232b});var client9002=jayson['client'][_0xe126('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3a4996,_0x1c32fe,_0x521509,_0x2b0baa){return new BPromise(function(_0x553e29,_0x46c98a){var _0xa1ce97=_0x2b0baa||client;return _0xa1ce97[_0xe126('0x21')](_0x3a4996,_0x521509)[_0xe126('0x22')](function(_0x3f3dfc){logger[_0xe126('0x23')](_0xe126('0x24'),_0x1c32fe,_0xe126('0x25'));logger['debug'](_0xe126('0x26'),_0x1c32fe,_0xe126('0x25'),JSON[_0xe126('0x27')](_0x3f3dfc));if(_0x3f3dfc[_0xe126('0x28')]){if(_0x3f3dfc[_0xe126('0x28')][_0xe126('0x29')]===0x1f4){logger[_0xe126('0x28')](_0xe126('0x24'),_0x1c32fe,_0x3f3dfc['error']['message']);return _0x46c98a(_0x3f3dfc[_0xe126('0x28')][_0xe126('0x2a')]);}logger[_0xe126('0x28')]('MailMessage,\x20%s,\x20%s',_0x1c32fe,_0x3f3dfc['error']['message']);return _0x553e29(_0x3f3dfc[_0xe126('0x28')][_0xe126('0x2a')]);}else{logger['info'](_0xe126('0x24'),_0x1c32fe,_0xe126('0x25'));_0x553e29(_0x3f3dfc[_0xe126('0x2b')][_0xe126('0x2a')]);}})['catch'](function(_0x49d70d){logger[_0xe126('0x28')]('MailMessage,\x20%s,\x20%s',_0x1c32fe,_0x49d70d);_0x46c98a(_0x49d70d);});});}function respondWithStatusCode(_0x3f5de5,_0xef3a89){_0xef3a89=_0xef3a89||0xcc;return function(_0x630bcc){if(_0x630bcc){return _0x3f5de5['sendStatus'](_0xef3a89);}return _0x3f5de5[_0xe126('0x2c')](_0xef3a89)[_0xe126('0x2d')]();};}function respondWithResult(_0x4f5d09,_0x5efeab){_0x5efeab=_0x5efeab||0xc8;return function(_0x259059){if(_0x259059){return _0x4f5d09['status'](_0x5efeab)[_0xe126('0x2e')](_0x259059);}};}function respondWithFilteredResult(_0x1fb354,_0x29dec4){return function(_0x181ccc){if(_0x181ccc){var _0x57fa02=typeof _0x29dec4[_0xe126('0x2f')]===_0xe126('0x30')&&typeof _0x29dec4['limit']==='undefined';var _0x267582=_0x181ccc['count'];var _0x424a17=_0x57fa02?0x0:_0x29dec4[_0xe126('0x2f')];var _0x249e4f=_0x57fa02?_0x181ccc['count']:_0x29dec4[_0xe126('0x2f')]+_0x29dec4[_0xe126('0x31')];var _0x1e6a92;if(_0x249e4f>=_0x267582){_0x249e4f=_0x267582;_0x1e6a92=0xc8;}else{_0x1e6a92=0xce;}_0x1fb354['status'](_0x1e6a92);return _0x1fb354[_0xe126('0x32')](_0xe126('0x33'),_0x424a17+'-'+_0x249e4f+'/'+_0x267582)['json'](_0x181ccc);}return null;};}function patchUpdates(_0x5a4782){return function(_0x34df22){try{jsonpatch[_0xe126('0x34')](_0x34df22,_0x5a4782,!![]);}catch(_0x371673){return BPromise[_0xe126('0x35')](_0x371673);}return _0x34df22[_0xe126('0x36')]();};}function saveUpdates(_0x2a5d82,_0x25f0ab){return function(_0xd03338){if(_0xd03338){return _0xd03338['update'](_0x2a5d82)[_0xe126('0x22')](function(_0xf5e235){return _0xf5e235;});}return null;};}function removeEntity(_0x2a23e7,_0x35f082){return function(_0x11744c){if(_0x11744c){return _0x11744c[_0xe126('0x37')]()['then'](function(){_0x2a23e7[_0xe126('0x2c')](0xcc)[_0xe126('0x2d')]();});}};}function handleEntityNotFound(_0x42874d,_0x11058a){return function(_0x32f84b){if(!_0x32f84b){_0x42874d['sendStatus'](0x194);}return _0x32f84b;};}function handleError(_0x29b6e6,_0xb1d237){_0xb1d237=_0xb1d237||0x1f4;return function(_0x42f659){logger[_0xe126('0x28')](_0x42f659['stack']);if(_0x42f659[_0xe126('0x38')]){delete _0x42f659[_0xe126('0x38')];}_0x29b6e6[_0xe126('0x2c')](_0xb1d237)[_0xe126('0x39')](_0x42f659);};}exports[_0xe126('0x3a')]=function(_0x2fe73a,_0x57cfaf){var _0x3c2b07={},_0x1a8edf={},_0xbdec13={'count':0x0,'rows':[]};var _0x4dce1b=_['map'](db[_0xe126('0x3b')][_0xe126('0x3c')],function(_0xf06ea3){return{'name':_0xf06ea3[_0xe126('0x3d')],'type':_0xf06ea3[_0xe126('0x3e')][_0xe126('0x3f')]};});_0x1a8edf['model']=_[_0xe126('0x40')](_0x4dce1b,_0xe126('0x38'));_0x1a8edf['query']=_[_0xe126('0x41')](_0x2fe73a[_0xe126('0x42')]);_0x1a8edf[_0xe126('0x43')]=_['intersection'](_0x1a8edf[_0xe126('0x44')],_0x1a8edf[_0xe126('0x42')]);_0x3c2b07['attributes']=_[_0xe126('0x45')](_0x1a8edf[_0xe126('0x44')],qs['fields'](_0x2fe73a[_0xe126('0x42')]['fields']));_0x3c2b07[_0xe126('0x46')]=_0x3c2b07[_0xe126('0x46')]['length']?_0x3c2b07[_0xe126('0x46')]:_0x1a8edf[_0xe126('0x44')];if(!_0x2fe73a[_0xe126('0x42')]['hasOwnProperty'](_0xe126('0x47'))){_0x3c2b07['limit']=qs[_0xe126('0x31')](_0x2fe73a[_0xe126('0x42')][_0xe126('0x31')]);_0x3c2b07[_0xe126('0x2f')]=qs[_0xe126('0x2f')](_0x2fe73a[_0xe126('0x42')][_0xe126('0x2f')]);}_0x3c2b07[_0xe126('0x48')]=qs[_0xe126('0x49')](_0x2fe73a[_0xe126('0x42')][_0xe126('0x49')]);_0x3c2b07['where']=qs['filters'](_[_0xe126('0x4a')](_0x2fe73a[_0xe126('0x42')],_0x1a8edf['filters']),_0x4dce1b);if(_0x2fe73a[_0xe126('0x42')][_0xe126('0x4b')]){_0x3c2b07[_0xe126('0x4c')]=_[_0xe126('0x4d')](_0x3c2b07['where'],{'$or':_[_0xe126('0x40')](_0x4dce1b,function(_0x132ef9){if(_0x132ef9[_0xe126('0x3e')]!==_0xe126('0x4e')){var _0x376f9e={};_0x376f9e[_0x132ef9[_0xe126('0x38')]]={'$like':'%'+_0x2fe73a[_0xe126('0x42')][_0xe126('0x4b')]+'%'};return _0x376f9e;}})});}_0x3c2b07=_[_0xe126('0x4d')]({},_0x3c2b07,_0x2fe73a[_0xe126('0x4f')]);var _0x23007d={'where':_0x3c2b07[_0xe126('0x4c')]};return db[_0xe126('0x3b')]['count'](_0x23007d)['then'](function(_0x589321){_0xbdec13['count']=_0x589321;if(_0x2fe73a[_0xe126('0x42')][_0xe126('0x50')]){_0x3c2b07[_0xe126('0x51')]=[{'all':!![]}];}return db[_0xe126('0x3b')][_0xe126('0x52')](_0x3c2b07);})[_0xe126('0x22')](function(_0x3f53ad){_0xbdec13['rows']=_0x3f53ad;return _0xbdec13;})['then'](respondWithFilteredResult(_0x57cfaf,_0x3c2b07))[_0xe126('0x53')](handleError(_0x57cfaf,null));};exports[_0xe126('0x54')]=function(_0x561bf5,_0x34686a){var _0x209002={'raw':!![],'where':{'id':_0x561bf5[_0xe126('0x55')]['id']}},_0x518e43={};_0x518e43[_0xe126('0x44')]=_['keys'](db['MailMessage'][_0xe126('0x3c')]);_0x518e43[_0xe126('0x42')]=_[_0xe126('0x41')](_0x561bf5['query']);_0x518e43[_0xe126('0x43')]=_['intersection'](_0x518e43[_0xe126('0x44')],_0x518e43[_0xe126('0x42')]);_0x209002['attributes']=_[_0xe126('0x45')](_0x518e43[_0xe126('0x44')],qs['fields'](_0x561bf5['query']['fields']));_0x209002[_0xe126('0x46')]=_0x209002[_0xe126('0x46')][_0xe126('0x56')]?_0x209002[_0xe126('0x46')]:_0x518e43['model'];if(_0x561bf5[_0xe126('0x42')][_0xe126('0x50')]){_0x209002[_0xe126('0x51')]=[{'all':!![]}];}_0x209002=_[_0xe126('0x4d')]({},_0x209002,_0x561bf5[_0xe126('0x4f')]);return db[_0xe126('0x3b')][_0xe126('0x57')](_0x209002)[_0xe126('0x22')](handleEntityNotFound(_0x34686a,null))[_0xe126('0x22')](respondWithResult(_0x34686a,null))[_0xe126('0x53')](handleError(_0x34686a,null));};exports[_0xe126('0x58')]=function(_0x2f3f0d,_0x1357d2){if(_0x2f3f0d[_0xe126('0x59')]['id']){delete _0x2f3f0d[_0xe126('0x59')]['id'];}return db[_0xe126('0x3b')][_0xe126('0x57')]({'where':{'id':_0x2f3f0d[_0xe126('0x55')]['id']}})[_0xe126('0x22')](handleEntityNotFound(_0x1357d2,null))[_0xe126('0x22')](saveUpdates(_0x2f3f0d[_0xe126('0x59')],null))[_0xe126('0x22')](respondWithResult(_0x1357d2,null))[_0xe126('0x53')](handleError(_0x1357d2,null));};exports[_0xe126('0x37')]=function(_0x2b5095,_0x3e128d){return db[_0xe126('0x3b')]['find']({'where':{'id':_0x2b5095[_0xe126('0x55')]['id']}})[_0xe126('0x22')](handleEntityNotFound(_0x3e128d,null))[_0xe126('0x22')](removeEntity(_0x3e128d,null))[_0xe126('0x53')](handleError(_0x3e128d,null));};exports[_0xe126('0x5a')]=function(_0x541d1a,_0x1f71dc){return db[_0xe126('0x3b')]['describe']()[_0xe126('0x22')](respondWithResult(_0x1f71dc,null))[_0xe126('0x53')](handleError(_0x1f71dc,null));};exports['create']=function(_0x3b75cc,_0x29ce7c){return db[_0xe126('0x3b')][_0xe126('0x5b')](_0x3b75cc[_0xe126('0x59')])[_0xe126('0x22')](function(_0x32d937){if(_0x32d937){if(_0x32d937['direction']===_0xe126('0x5c')&&!_0x32d937[_0xe126('0x5d')]){var _0x4a30c8,_0x3a2ae8,_0x10d8d0;if(_0x3b75cc[_0xe126('0x59')]['to']){_0x3a2ae8=_0x3b75cc['body']['to'][_0xe126('0x5e')](',')[0x0];}return db[_0xe126('0x5f')][_0xe126('0x60')]({'where':{'id':_0x32d937[_0xe126('0x61')]},'include':[{'model':db[_0xe126('0x62')],'as':_0xe126('0x63'),'include':[{'model':db[_0xe126('0x64')],'as':_0xe126('0x65'),'where':{'email':_0x3a2ae8},'limit':0x1,'order':[[_0xe126('0x66'),_0xe126('0x67')]]}]},{'model':db[_0xe126('0x68')],'as':_0xe126('0x69'),'raw':!![]}]})[_0xe126('0x22')](function(_0x773bed){_0x4a30c8=_0x773bed;if(_0x4a30c8&&_0x4a30c8[_0xe126('0x69')]){var _0x43f72b={'tls':{'rejectUnauthorized':![]}};if(_[_0xe126('0x6a')](_0x4a30c8[_0xe126('0x69')][_0xe126('0x6b')])){_0x43f72b[_0xe126('0x6c')]=_0x4a30c8[_0xe126('0x69')][_0xe126('0x6c')];_0x43f72b['port']=_0x4a30c8[_0xe126('0x69')][_0xe126('0x6d')];_0x43f72b[_0xe126('0x6e')]=_0x4a30c8[_0xe126('0x69')][_0xe126('0x6e')];if(_0x4a30c8[_0xe126('0x69')][_0xe126('0x6f')]){_0x43f72b[_0xe126('0x70')]={'user':_0x4a30c8[_0xe126('0x69')][_0xe126('0x71')],'pass':_0x4a30c8['Smtp'][_0xe126('0x72')]};}}else{_0x43f72b[_0xe126('0x6b')]=_0x4a30c8[_0xe126('0x69')][_0xe126('0x6b')];_0x43f72b[_0xe126('0x70')]={'user':_0x4a30c8[_0xe126('0x69')][_0xe126('0x71')],'pass':_0x4a30c8[_0xe126('0x69')][_0xe126('0x72')]};_0x43f72b[_0xe126('0x6e')]=_0x4a30c8[_0xe126('0x69')][_0xe126('0x6e')];}if(_0x3b75cc[_0xe126('0x59')][_0xe126('0x73')]&&_0x3b75cc[_0xe126('0x59')][_0xe126('0x73')][_0xe126('0x56')]){for(var _0xe6ad99=0x0;_0xe6ad99<_0x3b75cc[_0xe126('0x59')][_0xe126('0x73')][_0xe126('0x56')];_0xe6ad99+=0x1){_0x3b75cc[_0xe126('0x59')][_0xe126('0x73')][_0xe6ad99]={'filename':_0x3b75cc[_0xe126('0x59')]['attachments'][_0xe6ad99][_0xe126('0x38')],'path':path['join'](config[_0xe126('0x74')],_0xe126('0x75'),_0x3b75cc[_0xe126('0x59')][_0xe126('0x73')][_0xe6ad99][_0xe126('0x76')])};}}_0x10d8d0={'account':_0x43f72b,'message':_0x3b75cc[_0xe126('0x59')]};return;}})['then'](function(){if(_0x4a30c8[_0xe126('0x63')]){if(_0x4a30c8['List'][_0xe126('0x65')][_0xe126('0x56')]){return _0x4a30c8[_0xe126('0x63')]['Contacts'][0x0];}else{return db[_0xe126('0x64')][_0xe126('0x5b')](_[_0xe126('0x1a')](_0x3b75cc[_0xe126('0x59')],{'firstName':_0x3b75cc[_0xe126('0x59')]['to'],'email':_0x3b75cc[_0xe126('0x59')]['to'],'phone':_0x3b75cc['body']['to'],'ListId':_0x4a30c8[_0xe126('0x77')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x10d8d0){return respondWithRpcPromise('SendMail',_0xe126('0x78'),_0x10d8d0,client9003)[_0xe126('0x22')](function(_0x56161c){return _0x32d937[_0xe126('0x58')]({'read':!![],'messageId':_0x56161c[_0xe126('0x79')],'sentAt':moment()[_0xe126('0x7a')](_0xe126('0x7b'))});})['catch'](function(_0x24912c){logger[_0xe126('0x28')]('%s',JSON[_0xe126('0x27')](_0x24912c));return _0x32d937;});}return _0x32d937;});}return _0x32d937;}})[_0xe126('0x22')](respondWithResult(_0x29ce7c,0xc9))[_0xe126('0x53')](handleError(_0x29ce7c,null));};var interaction_log=require(_0xe126('0x7c'))(_0xe126('0x7d'));exports[_0xe126('0x7e')]=function(_0x29b60d,_0x55dd4b,_0x1f3ffb){var _0x26ffa0={'agent':{},'channel':'mail'};if(_0x29b60d[_0xe126('0x59')]['id']){delete _0x29b60d[_0xe126('0x59')]['id'];}_0x29b60d[_0xe126('0x59')][_0xe126('0x7f')]=!![];_0x29b60d[_0xe126('0x59')][_0xe126('0x80')]=moment()[_0xe126('0x7a')](_0xe126('0x7b'));_0x29b60d[_0xe126('0x59')][_0xe126('0x81')]=_0x29b60d[_0xe126('0x59')]['UserId']||_0x29b60d[_0xe126('0x71')]['id'];_0x26ffa0[_0xe126('0x82')]['id']=_0x29b60d['body'][_0xe126('0x81')];return db[_0xe126('0x3b')][_0xe126('0x57')]({'where':{'id':_0x29b60d['params']['id'],'UserId':null}})[_0xe126('0x22')](handleEntityNotFound(_0x55dd4b,null))['then'](saveUpdates(_0x29b60d['body'],null))[_0xe126('0x22')](function(_0x169493){if(_0x169493){_0x26ffa0['message']=_0x169493[_0xe126('0x83')]({'plain':!![]});return db[_0xe126('0x84')]['find']({'where':{'id':_0x169493[_0xe126('0x85')]}});}return null;})[_0xe126('0x22')](handleEntityNotFound(_0x55dd4b,null))[_0xe126('0x22')](function(_0x56ac2e){if(_0x56ac2e){return _0x56ac2e[_0xe126('0x58')]({'UserId':_0x29b60d[_0xe126('0x59')]['UserId'],'read1stAt':_[_0xe126('0x6a')](_0x56ac2e[_0xe126('0x86')])?moment()['format'](_0xe126('0x7b')):undefined});}return null;})[_0xe126('0x22')](function(_0x1cb650){if(_0x1cb650){_0x26ffa0['interaction']=_0x1cb650['get']({'plain':!![]});interaction_log[_0xe126('0x23')](_0xe126('0x87'),_0x29b60d['user']['id'],_0x29b60d[_0xe126('0x71')][_0xe126('0x38')],_0x29b60d[_0xe126('0x71')][_0xe126('0x88')],_0x26ffa0['interaction']['id'],_0x29b60d[_0xe126('0x59')]?JSON[_0xe126('0x27')](_0x29b60d[_0xe126('0x59')]):_0xe126('0x89'));return respondWithRpcPromise('AcceptMessage',_0xe126('0x8a'),_0x26ffa0);}return null;})[_0xe126('0x22')](function(_0xe24308){var _0x45f3fb=_0xe126('0x8b')+_0xe24308[_0xe126('0x2a')][_0xe126('0x8c')];return db[_0xe126('0x8d')][_0xe126('0x42')](_0x45f3fb,{'type':db['Sequelize']['QueryTypes'][_0xe126('0x8e')],'raw':!![]})[_0xe126('0x22')](function(_0x1c760c){return _0x1c760c;});})['then'](function(_0x58d681){if(_0x58d681){_0x26ffa0['message'][_0xe126('0x8f')]=_0x58d681[0x0];if(!_0x29b60d[_0xe126('0x59')][_0xe126('0x81')])return;return db[_0xe126('0x90')][_0xe126('0x57')]({'where':{'id':_0x29b60d[_0xe126('0x59')][_0xe126('0x81')],'role':'agent'},'attributes':['id',_0xe126('0x38'),_0xe126('0x91'),'email',_0xe126('0x92')],'raw':!![]});}return null;})[_0xe126('0x22')](function(_0x1cb1a4){if(!_0x1cb1a4)return null;_0x26ffa0['message']['agent']=_0x1cb1a4;return _0x26ffa0;})[_0xe126('0x22')](function(_0x34d6a8){if(_0x34d6a8){if(_0x29b60d[_0xe126('0x59')][_0xe126('0x93')]){_0x26ffa0['message']['interface']=util['format'](_0xe126('0x94'),_0x29b60d[_0xe126('0x71')]['name']);_0x26ffa0['message'][_0xe126('0x95')]=_0x26ffa0[_0xe126('0x95')];_0x26ffa0[_0xe126('0x2a')]['event']=_0xe126('0x7e');_0x26ffa0[_0xe126('0x2a')][_0xe126('0x59')]=htmlToText['fromString'](_0x26ffa0['message']['body']);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xe126('0x96'),'message':_0x26ffa0['message']},client9002)[_0xe126('0x22')](function(){return _0x26ffa0;});}return _0x26ffa0;}return null;})[_0xe126('0x22')](respondWithResult(_0x55dd4b,null))[_0xe126('0x53')](handleError(_0x55dd4b,null));};var interaction_log=require('../../config/logger')(_0xe126('0x7d'));exports[_0xe126('0x35')]=function(_0x3c30d5,_0x1e3252,_0x1bb488){var _0x431ce6={'agent':{},'channel':_0xe126('0x97')};if(_0x3c30d5[_0xe126('0x59')]['id']){delete _0x3c30d5[_0xe126('0x59')]['id'];}_0x3c30d5[_0xe126('0x59')]['UserId']=_0x3c30d5[_0xe126('0x59')][_0xe126('0x81')]||_0x3c30d5['user']['id'];_0x431ce6[_0xe126('0x82')]['id']=_0x3c30d5[_0xe126('0x59')][_0xe126('0x81')];return db['MailMessage']['find']({'where':{'id':_0x3c30d5[_0xe126('0x55')]['id'],'UserId':null}})[_0xe126('0x22')](handleEntityNotFound(_0x1e3252,null))['then'](function(_0x297102){if(_0x297102){_0x431ce6[_0xe126('0x2a')]=_0x297102[_0xe126('0x83')]({'plain':!![]});return db['MailInteraction'][_0xe126('0x57')]({'where':{'id':_0x297102['MailInteractionId']}});}return null;})[_0xe126('0x22')](handleEntityNotFound(_0x1e3252,null))[_0xe126('0x22')](function(_0x367878){if(_0x367878){_0x431ce6[_0xe126('0x98')]=_0x367878['get']({'plain':!![]});interaction_log[_0xe126('0x23')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3c30d5[_0xe126('0x71')]['id'],_0x3c30d5[_0xe126('0x71')][_0xe126('0x38')],_0x3c30d5[_0xe126('0x71')][_0xe126('0x88')],_0x431ce6['interaction']['id'],_0x3c30d5[_0xe126('0x59')]?JSON[_0xe126('0x27')](_0x3c30d5[_0xe126('0x59')]):'null');return respondWithRpcPromise('RejectMessage',_0xe126('0x99'),_0x431ce6);}return null;})[_0xe126('0x22')](function(_0x430271){var _0x93247d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x430271['message'][_0xe126('0x8c')];return db[_0xe126('0x8d')][_0xe126('0x42')](_0x93247d,{'type':db[_0xe126('0x9a')][_0xe126('0x9b')][_0xe126('0x8e')],'raw':!![]})['then'](function(_0x317d3d){return _0x317d3d;});})['then'](function(_0x455733){if(_0x455733){_0x431ce6['message'][_0xe126('0x8f')]=_0x455733[0x0];if(!_0x3c30d5[_0xe126('0x59')][_0xe126('0x81')])return;return db['User']['find']({'where':{'id':_0x3c30d5[_0xe126('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0xe126('0x38'),'fullname',_0xe126('0x9c'),_0xe126('0x92')],'raw':!![]});}return null;})['then'](function(_0x6a7840){if(!_0x6a7840)return null;_0x431ce6[_0xe126('0x2a')]['agent']=_0x6a7840;return _0x431ce6;})[_0xe126('0x22')](function(_0x20662d){if(_0x20662d){_0x20662d['message'][_0xe126('0x9d')]=util[_0xe126('0x7a')](_0xe126('0x94'),_0x3c30d5[_0xe126('0x71')]['name']);_0x20662d[_0xe126('0x2a')][_0xe126('0x95')]=_0x431ce6[_0xe126('0x95')];_0x20662d[_0xe126('0x2a')][_0xe126('0x9e')]=_0xe126('0x35');_0x20662d[_0xe126('0x2a')][_0xe126('0x59')]=htmlToText['fromString'](_0x431ce6['message'][_0xe126('0x59')]);respondWithRpcPromise(_0xe126('0x9f'),_0xe126('0x9f'),{'event':_0xe126('0xa0'),'message':_0x20662d['message']},client9002);return _0x431ce6;}return null;})[_0xe126('0x22')](respondWithResult(_0x1e3252,null))['catch'](handleError(_0x1e3252,null));};exports[_0xe126('0xa1')]=function(_0x3a4ea2,_0x2d1e03){var _0x48298e=moment()['unix']()[_0xe126('0xa2')]();var _0x5a7436=path[_0xe126('0xa3')](config[_0xe126('0x74')],_0xe126('0xa4'),'files','tmp');var _0x4e6ba3=path[_0xe126('0xa3')](config[_0xe126('0x74')],_0xe126('0xa4'),_0xe126('0xa5'),_0xe126('0x73'));var _0x5920f4=util['format']('message-%s.eml',_0x48298e);return db[_0xe126('0x3b')]['find']({'where':{'id':_0x3a4ea2['params']['id']},'attributes':['id',_0xe126('0x59'),_0xe126('0xa6'),'to','cc',_0xe126('0xa7'),_0xe126('0xa8'),'createdAt'],'include':_0x3a4ea2['query'][_0xe126('0x73')]?[{'model':db[_0xe126('0xa9')],'as':'Attachments'}]:undefined})[_0xe126('0x22')](handleEntityNotFound(_0x2d1e03,null))['then'](function(_0x445570){if(_0x445570){var _0x3b8cbd=_0x445570;var _0x474f13={'from':_0x3b8cbd[_0xe126('0xa6')],'to':_0x3b8cbd['to'],'subject':_0x3b8cbd[_0xe126('0xa8')],'html':_0x3b8cbd[_0xe126('0x59')],'headers':{'Date':moment(_0x3b8cbd[_0xe126('0xaa')])[_0xe126('0x7a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x445570['cc']){_0x474f13['headers']['Cc']=_0x445570['cc'];}if(_0x445570['bcc']){_0x474f13[_0xe126('0xab')][_0xe126('0xac')]=_0x445570[_0xe126('0xa7')];}return new BPromise(function(_0xe5093c,_0x101e89){if(_0x445570[_0xe126('0xad')]){for(var _0x8555d9=0x0;_0x8555d9<_0x445570[_0xe126('0xad')][_0xe126('0x56')];_0x8555d9++){var _0x4841e6=_0x445570[_0xe126('0xad')][_0x8555d9];var _0xd291d=path['join'](_0x4e6ba3,_0x4841e6[_0xe126('0x76')]);if(fs['existsSync'](_0xd291d)){_0x474f13[_0xe126('0x73')][_0xe126('0xae')]({'name':_0x4841e6[_0xe126('0x38')],'contentType':_0x4841e6[_0xe126('0x3e')],'data':fs['readFileSync'](_0xd291d)});}}}emlformat[_0xe126('0xaf')](_0x474f13,function(_0x3bb51a,_0x125bee){if(_0x3bb51a)return _0x101e89(_0x3bb51a);fs[_0xe126('0xb0')](path[_0xe126('0xa3')](_0x5a7436,_0x5920f4),_0x125bee);return _0xe5093c(_0x125bee);});});}})[_0xe126('0x22')](function(_0x5dbd31){if(_0x5dbd31){return _0x2d1e03['download'](path[_0xe126('0xa3')](_0x5a7436,_0x5920f4),_0x5920f4,function(_0xe161b6){if(_0xe161b6){console[_0xe126('0xb1')]('err',_0xe161b6);}else{fs['unlinkSync'](path[_0xe126('0xa3')](_0x5a7436,_0x5920f4));}});}})[_0xe126('0x53')](handleError(_0x2d1e03,null));};
\ No newline at end of file
+var _0x5fc3=['to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailMessage.socket','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','destroy','index','map','MailMessage','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','auth','user','pass','secure','attachments','join','root','server/files/attachments','basename','defaults','ListId','SendMail','sendMail','update','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','channel','event','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','contact','fullname','rejectmessage','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','build','writeFileSync','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x5fc3,0xa8));var _0x35fc=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x5fc3[_0x128bef];return _0x1ba862;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var htmlToText=require('html-to-text');var db=require('../../mysqldb')['db'];config[_0x35fc('0x17')]=_['defaults'](config[_0x35fc('0x17')],{'host':_0x35fc('0x18'),'port':0x18eb});var socket=require(_0x35fc('0x19'))(new Redis(config[_0x35fc('0x17')]));require(_0x35fc('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x35fc('0x1b')][_0x35fc('0x1c')]({'port':0x232b});var client9002=jayson[_0x35fc('0x1b')][_0x35fc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x227a49,_0x1121fa,_0x480851,_0x26ba54){return new BPromise(function(_0x45c8b7,_0x553677){var _0x41e165=_0x26ba54||client;return _0x41e165[_0x35fc('0x1d')](_0x227a49,_0x480851)[_0x35fc('0x1e')](function(_0x5f56c6){logger[_0x35fc('0x1f')](_0x35fc('0x20'),_0x1121fa,_0x35fc('0x21'));logger['debug'](_0x35fc('0x22'),_0x1121fa,_0x35fc('0x21'),JSON[_0x35fc('0x23')](_0x5f56c6));if(_0x5f56c6[_0x35fc('0x24')]){if(_0x5f56c6[_0x35fc('0x24')][_0x35fc('0x25')]===0x1f4){logger[_0x35fc('0x24')](_0x35fc('0x20'),_0x1121fa,_0x5f56c6[_0x35fc('0x24')][_0x35fc('0x26')]);return _0x553677(_0x5f56c6['error'][_0x35fc('0x26')]);}logger[_0x35fc('0x24')](_0x35fc('0x20'),_0x1121fa,_0x5f56c6[_0x35fc('0x24')][_0x35fc('0x26')]);return _0x45c8b7(_0x5f56c6['error'][_0x35fc('0x26')]);}else{logger[_0x35fc('0x1f')]('MailMessage,\x20%s,\x20%s',_0x1121fa,_0x35fc('0x21'));_0x45c8b7(_0x5f56c6[_0x35fc('0x27')][_0x35fc('0x26')]);}})['catch'](function(_0x4086e9){logger['error'](_0x35fc('0x20'),_0x1121fa,_0x4086e9);_0x553677(_0x4086e9);});});}function respondWithStatusCode(_0xdfab9f,_0x5cb986){_0x5cb986=_0x5cb986||0xcc;return function(_0x519264){if(_0x519264){return _0xdfab9f[_0x35fc('0x28')](_0x5cb986);}return _0xdfab9f['status'](_0x5cb986)[_0x35fc('0x29')]();};}function respondWithResult(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0xc8;return function(_0x26b7cb){if(_0x26b7cb){return _0x1a5d92[_0x35fc('0x2a')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);}};}function respondWithFilteredResult(_0x9f3c8a,_0x3735da){return function(_0x134dfa){if(_0x134dfa){var _0x11ccdb=typeof _0x3735da[_0x35fc('0x2c')]==='undefined'&&typeof _0x3735da[_0x35fc('0x2d')]===_0x35fc('0x2e');var _0x22af18=_0x134dfa['count'];var _0xe79f52=_0x11ccdb?0x0:_0x3735da[_0x35fc('0x2c')];var _0x3822a8=_0x11ccdb?_0x134dfa[_0x35fc('0x2f')]:_0x3735da[_0x35fc('0x2c')]+_0x3735da[_0x35fc('0x2d')];var _0x222ddb;if(_0x3822a8>=_0x22af18){_0x3822a8=_0x22af18;_0x222ddb=0xc8;}else{_0x222ddb=0xce;}_0x9f3c8a[_0x35fc('0x2a')](_0x222ddb);return _0x9f3c8a[_0x35fc('0x30')](_0x35fc('0x31'),_0xe79f52+'-'+_0x3822a8+'/'+_0x22af18)['json'](_0x134dfa);}return null;};}function patchUpdates(_0x5e0313){return function(_0x114bc1){try{jsonpatch['apply'](_0x114bc1,_0x5e0313,!![]);}catch(_0x37b394){return BPromise[_0x35fc('0x32')](_0x37b394);}return _0x114bc1[_0x35fc('0x33')]();};}function saveUpdates(_0x227471,_0x271ba9){return function(_0x12e78f){if(_0x12e78f){return _0x12e78f['update'](_0x227471)[_0x35fc('0x1e')](function(_0x330a14){return _0x330a14;});}return null;};}function removeEntity(_0x46b9ef,_0x4441d8){return function(_0x2bbd36){if(_0x2bbd36){return _0x2bbd36[_0x35fc('0x34')]()['then'](function(){_0x46b9ef[_0x35fc('0x2a')](0xcc)[_0x35fc('0x29')]();});}};}function handleEntityNotFound(_0x1fecdf,_0x52f53d){return function(_0x2c657d){if(!_0x2c657d){_0x1fecdf['sendStatus'](0x194);}return _0x2c657d;};}function handleError(_0x2ecb2e,_0x33a377){_0x33a377=_0x33a377||0x1f4;return function(_0x266a11){logger[_0x35fc('0x24')](_0x266a11['stack']);if(_0x266a11['name']){delete _0x266a11['name'];}_0x2ecb2e[_0x35fc('0x2a')](_0x33a377)['send'](_0x266a11);};}exports[_0x35fc('0x35')]=function(_0x4b4d4a,_0x9c6b65){var _0x1f2d66={},_0x2ca9ac={},_0x22b724={'count':0x0,'rows':[]};var _0x1c10e0=_[_0x35fc('0x36')](db[_0x35fc('0x37')]['rawAttributes'],function(_0x4467f8){return{'name':_0x4467f8[_0x35fc('0x38')],'type':_0x4467f8['type'][_0x35fc('0x39')]};});_0x2ca9ac[_0x35fc('0x3a')]=_[_0x35fc('0x36')](_0x1c10e0,_0x35fc('0x3b'));_0x2ca9ac[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x4b4d4a['query']);_0x2ca9ac[_0x35fc('0x3e')]=_[_0x35fc('0x3f')](_0x2ca9ac[_0x35fc('0x3a')],_0x2ca9ac['query']);_0x1f2d66[_0x35fc('0x40')]=_[_0x35fc('0x3f')](_0x2ca9ac['model'],qs[_0x35fc('0x41')](_0x4b4d4a[_0x35fc('0x3c')][_0x35fc('0x41')]));_0x1f2d66[_0x35fc('0x40')]=_0x1f2d66[_0x35fc('0x40')][_0x35fc('0x42')]?_0x1f2d66[_0x35fc('0x40')]:_0x2ca9ac[_0x35fc('0x3a')];if(!_0x4b4d4a['query']['hasOwnProperty'](_0x35fc('0x43'))){_0x1f2d66[_0x35fc('0x2d')]=qs['limit'](_0x4b4d4a['query']['limit']);_0x1f2d66[_0x35fc('0x2c')]=qs[_0x35fc('0x2c')](_0x4b4d4a['query'][_0x35fc('0x2c')]);}_0x1f2d66[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x4b4d4a[_0x35fc('0x3c')]['sort']);_0x1f2d66['where']=qs['filters'](_['pick'](_0x4b4d4a['query'],_0x2ca9ac[_0x35fc('0x3e')]),_0x1c10e0);if(_0x4b4d4a[_0x35fc('0x3c')]['filter']){_0x1f2d66[_0x35fc('0x46')]=_['merge'](_0x1f2d66[_0x35fc('0x46')],{'$or':_[_0x35fc('0x36')](_0x1c10e0,function(_0x350237){if(_0x350237[_0x35fc('0x47')]!==_0x35fc('0x48')){var _0x5d3d0f={};_0x5d3d0f[_0x350237[_0x35fc('0x3b')]]={'$like':'%'+_0x4b4d4a[_0x35fc('0x3c')]['filter']+'%'};return _0x5d3d0f;}})});}_0x1f2d66=_[_0x35fc('0x49')]({},_0x1f2d66,_0x4b4d4a[_0x35fc('0x4a')]);var _0x2a8a09={'where':_0x1f2d66[_0x35fc('0x46')]};return db['MailMessage'][_0x35fc('0x2f')](_0x2a8a09)['then'](function(_0x583f67){_0x22b724[_0x35fc('0x2f')]=_0x583f67;if(_0x4b4d4a[_0x35fc('0x3c')][_0x35fc('0x4b')]){_0x1f2d66[_0x35fc('0x4c')]=[{'all':!![]}];}return db[_0x35fc('0x37')][_0x35fc('0x4d')](_0x1f2d66);})[_0x35fc('0x1e')](function(_0x16afa6){_0x22b724['rows']=_0x16afa6;return _0x22b724;})[_0x35fc('0x1e')](respondWithFilteredResult(_0x9c6b65,_0x1f2d66))[_0x35fc('0x4e')](handleError(_0x9c6b65,null));};exports[_0x35fc('0x4f')]=function(_0x40b5c7,_0x2ad481){var _0x1e3221={'raw':!![],'where':{'id':_0x40b5c7[_0x35fc('0x50')]['id']}},_0x1b8229={};_0x1b8229[_0x35fc('0x3a')]=_[_0x35fc('0x3d')](db[_0x35fc('0x37')][_0x35fc('0x51')]);_0x1b8229[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x40b5c7['query']);_0x1b8229['filters']=_[_0x35fc('0x3f')](_0x1b8229[_0x35fc('0x3a')],_0x1b8229[_0x35fc('0x3c')]);_0x1e3221[_0x35fc('0x40')]=_[_0x35fc('0x3f')](_0x1b8229[_0x35fc('0x3a')],qs['fields'](_0x40b5c7['query'][_0x35fc('0x41')]));_0x1e3221[_0x35fc('0x40')]=_0x1e3221[_0x35fc('0x40')][_0x35fc('0x42')]?_0x1e3221['attributes']:_0x1b8229[_0x35fc('0x3a')];if(_0x40b5c7[_0x35fc('0x3c')]['includeAll']){_0x1e3221[_0x35fc('0x4c')]=[{'all':!![]}];}_0x1e3221=_[_0x35fc('0x49')]({},_0x1e3221,_0x40b5c7['options']);return db[_0x35fc('0x37')][_0x35fc('0x52')](_0x1e3221)[_0x35fc('0x1e')](handleEntityNotFound(_0x2ad481,null))[_0x35fc('0x1e')](respondWithResult(_0x2ad481,null))['catch'](handleError(_0x2ad481,null));};exports['update']=function(_0x502a15,_0x240338){if(_0x502a15[_0x35fc('0x53')]['id']){delete _0x502a15['body']['id'];}return db[_0x35fc('0x37')][_0x35fc('0x52')]({'where':{'id':_0x502a15[_0x35fc('0x50')]['id']}})[_0x35fc('0x1e')](handleEntityNotFound(_0x240338,null))[_0x35fc('0x1e')](saveUpdates(_0x502a15['body'],null))[_0x35fc('0x1e')](respondWithResult(_0x240338,null))[_0x35fc('0x4e')](handleError(_0x240338,null));};exports[_0x35fc('0x34')]=function(_0x509e77,_0x304dba){return db[_0x35fc('0x37')]['find']({'where':{'id':_0x509e77[_0x35fc('0x50')]['id']}})[_0x35fc('0x1e')](handleEntityNotFound(_0x304dba,null))[_0x35fc('0x1e')](removeEntity(_0x304dba,null))[_0x35fc('0x4e')](handleError(_0x304dba,null));};exports[_0x35fc('0x54')]=function(_0x41453b,_0x8501d1){return db[_0x35fc('0x37')]['describe']()[_0x35fc('0x1e')](respondWithResult(_0x8501d1,null))[_0x35fc('0x4e')](handleError(_0x8501d1,null));};exports[_0x35fc('0x55')]=function(_0x4fabd4,_0x243871){return db['MailMessage']['create'](_0x4fabd4['body'])[_0x35fc('0x1e')](function(_0xb1c68a){if(_0xb1c68a){if(_0xb1c68a[_0x35fc('0x56')]===_0x35fc('0x57')&&!_0xb1c68a[_0x35fc('0x58')]){var _0x4bbea0,_0x579f5a,_0x5353ea;if(_0x4fabd4['body']['to']){_0x579f5a=_0x4fabd4['body']['to'][_0x35fc('0x59')](',')[0x0];}return db[_0x35fc('0x5a')][_0x35fc('0x5b')]({'where':{'id':_0xb1c68a[_0x35fc('0x5c')]},'include':[{'model':db['CmList'],'as':_0x35fc('0x5d'),'include':[{'model':db[_0x35fc('0x5e')],'as':_0x35fc('0x5f'),'where':{'email':_0x579f5a},'limit':0x1,'order':[[_0x35fc('0x60'),_0x35fc('0x61')]]}]},{'model':db[_0x35fc('0x62')],'as':_0x35fc('0x63'),'raw':!![]}]})[_0x35fc('0x1e')](function(_0x462ceb){_0x4bbea0=_0x462ceb;if(_0x4bbea0&&_0x4bbea0['Smtp']){var _0x35d7c8={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x64')])){_0x35d7c8[_0x35fc('0x65')]=_0x4bbea0[_0x35fc('0x63')]['host'];_0x35d7c8[_0x35fc('0x66')]=_0x4bbea0['Smtp']['port'];_0x35d7c8['secure']=_0x4bbea0[_0x35fc('0x63')]['secure'];if(_0x4bbea0[_0x35fc('0x63')]['authentication']){_0x35d7c8[_0x35fc('0x67')]={'user':_0x4bbea0['Smtp'][_0x35fc('0x68')],'pass':_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x69')]};}}else{_0x35d7c8[_0x35fc('0x64')]=_0x4bbea0['Smtp'][_0x35fc('0x64')];_0x35d7c8[_0x35fc('0x67')]={'user':_0x4bbea0[_0x35fc('0x63')]['user'],'pass':_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x69')]};_0x35d7c8[_0x35fc('0x6a')]=_0x4bbea0[_0x35fc('0x63')][_0x35fc('0x6a')];}if(_0x4fabd4[_0x35fc('0x53')][_0x35fc('0x6b')]&&_0x4fabd4[_0x35fc('0x53')]['attachments'][_0x35fc('0x42')]){for(var _0x2008b3=0x0;_0x2008b3<_0x4fabd4[_0x35fc('0x53')]['attachments'][_0x35fc('0x42')];_0x2008b3+=0x1){_0x4fabd4[_0x35fc('0x53')]['attachments'][_0x2008b3]={'filename':_0x4fabd4['body'][_0x35fc('0x6b')][_0x2008b3]['name'],'path':path[_0x35fc('0x6c')](config[_0x35fc('0x6d')],_0x35fc('0x6e'),_0x4fabd4[_0x35fc('0x53')][_0x35fc('0x6b')][_0x2008b3][_0x35fc('0x6f')])};}}_0x5353ea={'account':_0x35d7c8,'message':_0x4fabd4[_0x35fc('0x53')]};return;}})[_0x35fc('0x1e')](function(){if(_0x4bbea0[_0x35fc('0x5d')]){if(_0x4bbea0[_0x35fc('0x5d')][_0x35fc('0x5f')][_0x35fc('0x42')]){return _0x4bbea0[_0x35fc('0x5d')][_0x35fc('0x5f')][0x0];}else{return db[_0x35fc('0x5e')][_0x35fc('0x55')](_[_0x35fc('0x70')](_0x4fabd4[_0x35fc('0x53')],{'firstName':_0x4fabd4[_0x35fc('0x53')]['to'],'email':_0x4fabd4[_0x35fc('0x53')]['to'],'phone':_0x4fabd4['body']['to'],'ListId':_0x4bbea0[_0x35fc('0x71')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x35fc('0x1e')](function(){if(_0x5353ea){return respondWithRpcPromise(_0x35fc('0x72'),_0x35fc('0x73'),_0x5353ea,client9003)[_0x35fc('0x1e')](function(_0x25af78){return _0xb1c68a[_0x35fc('0x74')]({'read':!![],'messageId':_0x25af78[_0x35fc('0x75')],'sentAt':moment()[_0x35fc('0x76')](_0x35fc('0x77'))});})[_0x35fc('0x4e')](function(_0x2ee880){logger['error']('%s',JSON[_0x35fc('0x23')](_0x2ee880));return _0xb1c68a;});}return _0xb1c68a;});}return _0xb1c68a;}})[_0x35fc('0x1e')](respondWithResult(_0x243871,0xc9))[_0x35fc('0x4e')](handleError(_0x243871,null));};var interaction_log=require(_0x35fc('0x13'))(_0x35fc('0x78'));exports[_0x35fc('0x79')]=function(_0x5416cd,_0x43ef1f,_0x3353e0){var _0x277514={'agent':{},'channel':_0x35fc('0x7a')};if(_0x5416cd[_0x35fc('0x53')]['id']){delete _0x5416cd[_0x35fc('0x53')]['id'];}_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7b')]=!![];_0x5416cd[_0x35fc('0x53')]['readAt']=moment()[_0x35fc('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7c')]=_0x5416cd['body'][_0x35fc('0x7c')]||_0x5416cd[_0x35fc('0x68')]['id'];_0x277514[_0x35fc('0x7d')]['id']=_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7c')];return db[_0x35fc('0x37')][_0x35fc('0x52')]({'where':{'id':_0x5416cd[_0x35fc('0x50')]['id'],'UserId':null}})[_0x35fc('0x1e')](handleEntityNotFound(_0x43ef1f,null))['then'](saveUpdates(_0x5416cd['body'],null))['then'](function(_0x531117){if(_0x531117){_0x277514[_0x35fc('0x26')]=_0x531117[_0x35fc('0x7e')]({'plain':!![]});return db[_0x35fc('0x7f')][_0x35fc('0x52')]({'where':{'id':_0x531117[_0x35fc('0x80')]}});}return null;})['then'](handleEntityNotFound(_0x43ef1f,null))[_0x35fc('0x1e')](function(_0x19682e){if(_0x19682e){return _0x19682e[_0x35fc('0x74')]({'UserId':_0x5416cd[_0x35fc('0x53')]['UserId'],'read1stAt':_[_0x35fc('0x81')](_0x19682e[_0x35fc('0x82')])?moment()[_0x35fc('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x35fc('0x1e')](function(_0xb94316){if(_0xb94316){_0x277514[_0x35fc('0x83')]=_0xb94316[_0x35fc('0x7e')]({'plain':!![]});interaction_log[_0x35fc('0x1f')](_0x35fc('0x84'),_0x5416cd[_0x35fc('0x68')]['id'],_0x5416cd[_0x35fc('0x68')]['name'],_0x5416cd[_0x35fc('0x68')][_0x35fc('0x85')],_0x277514[_0x35fc('0x83')]['id'],_0x5416cd[_0x35fc('0x53')]?JSON[_0x35fc('0x23')](_0x5416cd[_0x35fc('0x53')]):'null');return respondWithRpcPromise(_0x35fc('0x86'),'acceptMessage',_0x277514);}return null;})['then'](function(_0x1a2da0){var _0x597670=_0x35fc('0x87')+_0x1a2da0[_0x35fc('0x26')][_0x35fc('0x88')];return db['sequelize'][_0x35fc('0x3c')](_0x597670,{'type':db[_0x35fc('0x89')][_0x35fc('0x8a')][_0x35fc('0x8b')],'raw':!![]})[_0x35fc('0x1e')](function(_0x5abdf9){return _0x5abdf9;});})['then'](function(_0x487cb5){if(_0x487cb5){_0x277514[_0x35fc('0x26')]['contact']=_0x487cb5[0x0];if(!_0x5416cd[_0x35fc('0x53')][_0x35fc('0x7c')])return;return db[_0x35fc('0x8c')][_0x35fc('0x52')]({'where':{'id':_0x5416cd['body'][_0x35fc('0x7c')],'role':_0x35fc('0x7d')},'attributes':['id',_0x35fc('0x3b'),'fullname',_0x35fc('0x8d'),_0x35fc('0x8e')],'raw':!![]});}return null;})[_0x35fc('0x1e')](function(_0x5957bc){if(!_0x5957bc)return null;_0x277514['message']['agent']=_0x5957bc;return _0x277514;})[_0x35fc('0x1e')](function(_0x2edb1b){if(_0x2edb1b){if(_0x5416cd[_0x35fc('0x53')][_0x35fc('0x8f')]){_0x277514['message'][_0x35fc('0x90')]=util[_0x35fc('0x76')]('SIP/%s',_0x5416cd['user'][_0x35fc('0x3b')]);_0x277514[_0x35fc('0x26')][_0x35fc('0x91')]=_0x277514['channel'];_0x277514['message'][_0x35fc('0x92')]=_0x35fc('0x79');_0x277514['message'][_0x35fc('0x53')]=htmlToText[_0x35fc('0x93')](_0x277514[_0x35fc('0x26')]['body']);return respondWithRpcPromise(_0x35fc('0x94'),_0x35fc('0x94'),{'event':_0x35fc('0x95'),'message':_0x277514[_0x35fc('0x26')]},client9002)['then'](function(){return _0x277514;});}return _0x277514;}return null;})[_0x35fc('0x1e')](respondWithResult(_0x43ef1f,null))[_0x35fc('0x4e')](handleError(_0x43ef1f,null));};var interaction_log=require(_0x35fc('0x13'))('mail-interactions');exports[_0x35fc('0x32')]=function(_0x26d242,_0x425f72,_0x5c6c2b){var _0x30d779={'agent':{},'channel':_0x35fc('0x7a')};if(_0x26d242['body']['id']){delete _0x26d242[_0x35fc('0x53')]['id'];}_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')]=_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')]||_0x26d242[_0x35fc('0x68')]['id'];_0x30d779[_0x35fc('0x7d')]['id']=_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')];return db['MailMessage'][_0x35fc('0x52')]({'where':{'id':_0x26d242[_0x35fc('0x50')]['id'],'UserId':null}})[_0x35fc('0x1e')](handleEntityNotFound(_0x425f72,null))[_0x35fc('0x1e')](function(_0x53857f){if(_0x53857f){_0x30d779[_0x35fc('0x26')]=_0x53857f[_0x35fc('0x7e')]({'plain':!![]});return db[_0x35fc('0x7f')][_0x35fc('0x52')]({'where':{'id':_0x53857f[_0x35fc('0x80')]}});}return null;})[_0x35fc('0x1e')](handleEntityNotFound(_0x425f72,null))[_0x35fc('0x1e')](function(_0xeedb53){if(_0xeedb53){_0x30d779['interaction']=_0xeedb53['get']({'plain':!![]});interaction_log[_0x35fc('0x1f')](_0x35fc('0x96'),_0x26d242[_0x35fc('0x68')]['id'],_0x26d242['user'][_0x35fc('0x3b')],_0x26d242[_0x35fc('0x68')][_0x35fc('0x85')],_0x30d779[_0x35fc('0x83')]['id'],_0x26d242['body']?JSON['stringify'](_0x26d242[_0x35fc('0x53')]):'null');return respondWithRpcPromise(_0x35fc('0x97'),_0x35fc('0x98'),_0x30d779);}return null;})['then'](function(_0x52712e){var _0x471c59=_0x35fc('0x87')+_0x52712e[_0x35fc('0x26')]['ContactId'];return db[_0x35fc('0x99')][_0x35fc('0x3c')](_0x471c59,{'type':db[_0x35fc('0x89')]['QueryTypes'][_0x35fc('0x8b')],'raw':!![]})[_0x35fc('0x1e')](function(_0x18b4bd){return _0x18b4bd;});})[_0x35fc('0x1e')](function(_0x5f374c){if(_0x5f374c){_0x30d779[_0x35fc('0x26')][_0x35fc('0x9a')]=_0x5f374c[0x0];if(!_0x26d242[_0x35fc('0x53')][_0x35fc('0x7c')])return;return db[_0x35fc('0x8c')][_0x35fc('0x52')]({'where':{'id':_0x26d242['body'][_0x35fc('0x7c')],'role':_0x35fc('0x7d')},'attributes':['id','name',_0x35fc('0x9b'),_0x35fc('0x8d'),'internal'],'raw':!![]});}return null;})[_0x35fc('0x1e')](function(_0x31541e){if(!_0x31541e)return null;_0x30d779[_0x35fc('0x26')][_0x35fc('0x7d')]=_0x31541e;return _0x30d779;})[_0x35fc('0x1e')](function(_0x51e8fb){if(_0x51e8fb){_0x51e8fb[_0x35fc('0x26')][_0x35fc('0x90')]=util[_0x35fc('0x76')]('SIP/%s',_0x26d242[_0x35fc('0x68')]['name']);_0x51e8fb['message'][_0x35fc('0x91')]=_0x30d779[_0x35fc('0x91')];_0x51e8fb[_0x35fc('0x26')][_0x35fc('0x92')]=_0x35fc('0x32');_0x51e8fb['message'][_0x35fc('0x53')]=htmlToText[_0x35fc('0x93')](_0x30d779[_0x35fc('0x26')]['body']);respondWithRpcPromise(_0x35fc('0x94'),_0x35fc('0x94'),{'event':_0x35fc('0x9c'),'message':_0x51e8fb[_0x35fc('0x26')]},client9002);return _0x30d779;}return null;})[_0x35fc('0x1e')](respondWithResult(_0x425f72,null))['catch'](handleError(_0x425f72,null));};exports[_0x35fc('0x9d')]=function(_0x1bd27f,_0x47b52e){var _0x4d4e5f=moment()[_0x35fc('0x9e')]()[_0x35fc('0x9f')]();var _0x207336=path[_0x35fc('0x6c')](config[_0x35fc('0x6d')],_0x35fc('0xa0'),_0x35fc('0xa1'),'tmp');var _0x5dc286=path[_0x35fc('0x6c')](config[_0x35fc('0x6d')],_0x35fc('0xa0'),_0x35fc('0xa1'),_0x35fc('0x6b'));var _0x4e40ad=util['format'](_0x35fc('0xa2'),_0x4d4e5f);return db[_0x35fc('0x37')][_0x35fc('0x52')]({'where':{'id':_0x1bd27f[_0x35fc('0x50')]['id']},'attributes':['id','body','from','to','cc',_0x35fc('0xa3'),_0x35fc('0xa4'),_0x35fc('0xa5')],'include':_0x1bd27f[_0x35fc('0x3c')]['attachments']?[{'model':db['Attachment'],'as':_0x35fc('0xa6')}]:undefined})[_0x35fc('0x1e')](handleEntityNotFound(_0x47b52e,null))['then'](function(_0x6382dd){if(_0x6382dd){var _0x155ee2=_0x6382dd;var _0x2e9097={'from':_0x155ee2[_0x35fc('0xa7')],'to':_0x155ee2['to'],'subject':_0x155ee2[_0x35fc('0xa4')],'html':_0x155ee2[_0x35fc('0x53')],'headers':{'Date':moment(_0x155ee2[_0x35fc('0xa5')])[_0x35fc('0x76')](_0x35fc('0xa8'))},'attachments':[]};if(_0x6382dd['cc']){_0x2e9097[_0x35fc('0xa9')]['Cc']=_0x6382dd['cc'];}if(_0x6382dd[_0x35fc('0xa3')]){_0x2e9097[_0x35fc('0xa9')][_0x35fc('0xaa')]=_0x6382dd[_0x35fc('0xa3')];}return new BPromise(function(_0x3e1b55,_0x70cca3){if(_0x6382dd['Attachments']){for(var _0x345026=0x0;_0x345026<_0x6382dd['Attachments'][_0x35fc('0x42')];_0x345026++){var _0x5d677a=_0x6382dd['Attachments'][_0x345026];var _0x3c96ef=path[_0x35fc('0x6c')](_0x5dc286,_0x5d677a[_0x35fc('0x6f')]);if(fs['existsSync'](_0x3c96ef)){_0x2e9097[_0x35fc('0x6b')][_0x35fc('0xab')]({'name':_0x5d677a[_0x35fc('0x3b')],'contentType':_0x5d677a[_0x35fc('0x47')],'data':fs[_0x35fc('0xac')](_0x3c96ef)});}}}emlformat[_0x35fc('0xad')](_0x2e9097,function(_0x59f733,_0x4f3342){if(_0x59f733)return _0x70cca3(_0x59f733);fs[_0x35fc('0xae')](path['join'](_0x207336,_0x4e40ad),_0x4f3342);return _0x3e1b55(_0x4f3342);});});}})['then'](function(_0x262f9a){if(_0x262f9a){return _0x47b52e['download'](path['join'](_0x207336,_0x4e40ad),_0x4e40ad,function(_0x5ae83f){if(_0x5ae83f){console[_0x35fc('0xaf')]('err',_0x5ae83f);}else{fs[_0x35fc('0xb0')](path[_0x35fc('0x6c')](_0x207336,_0x4e40ad));}});}})[_0x35fc('0x4e')](handleError(_0x47b52e,null));};
\ No newline at end of file
index 0454961..16e0196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ae=['exports','events','../../mysqldb','MailMessage','update','remove','emit','hasOwnProperty'];(function(_0x1a5852,_0x56a9a5){var _0x4c2d62=function(_0x5317da){while(--_0x5317da){_0x1a5852['push'](_0x1a5852['shift']());}};_0x4c2d62(++_0x56a9a5);}(_0x16ae,0x119));var _0xe16a=function(_0xba8be9,_0x225344){_0xba8be9=_0xba8be9-0x0;var _0x22ad96=_0x16ae[_0xba8be9];return _0x22ad96;};'use strict';var EventEmitter=require(_0xe16a('0x0'));var MailMessage=require(_0xe16a('0x1'))['db'][_0xe16a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe16a('0x3'),'afterDestroy':_0xe16a('0x4')};function emitEvent(_0x1890be){return function(_0x45170b,_0x2f475c,_0x438e64){MailMessageEvents[_0xe16a('0x5')](_0x1890be+':'+_0x45170b['id'],_0x45170b);MailMessageEvents[_0xe16a('0x5')](_0x1890be,_0x45170b);_0x438e64(null);};}for(var e in events){if(events[_0xe16a('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xe16a('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0x31ac=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x31ac,0x10e));var _0xc31a=function(_0x13865d,_0x40f28b){_0x13865d=_0x13865d-0x0;var _0x7858d5=_0x31ac[_0x13865d];return _0x7858d5;};'use strict';var EventEmitter=require(_0xc31a('0x0'));var MailMessage=require(_0xc31a('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xc31a('0x2')](0x0);var events={'afterCreate':_0xc31a('0x3'),'afterUpdate':'update','afterDestroy':_0xc31a('0x4')};function emitEvent(_0x2fc0e3){return function(_0x42409e,_0x17d333,_0x137ca6){MailMessageEvents[_0xc31a('0x5')](_0x2fc0e3+':'+_0x42409e['id'],_0x42409e);MailMessageEvents[_0xc31a('0x5')](_0x2fc0e3,_0x42409e);_0x137ca6(null);};}for(var e in events){if(events[_0xc31a('0x6')](e)){var event=events[e];MailMessage[_0xc31a('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index f2d669e..692f73d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb05f=['UserId','findOne','MailInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','out'];(function(_0x97be3d,_0x3f3bd2){var _0x47ddc4=function(_0x3036ee){while(--_0x3036ee){_0x97be3d['push'](_0x97be3d['shift']());}};_0x47ddc4(++_0x3f3bd2);}(_0xb05f,0x80));var _0xfb05=function(_0x35dccb,_0x55065e){_0x35dccb=_0x35dccb-0x0;var _0x4a3f30=_0xb05f[_0x35dccb];return _0x4a3f30;};'use strict';var _=require('lodash');var util=require(_0xfb05('0x0'));var logger=require('../../config/logger')(_0xfb05('0x1'));var moment=require(_0xfb05('0x2'));var BPromise=require(_0xfb05('0x3'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xfb05('0x4'));var rimraf=require(_0xfb05('0x5'));var config=require(_0xfb05('0x6'));var attributes=require(_0xfb05('0x7'));module[_0xfb05('0x8')]=function(_0x401c25,_0x1ea94b){return _0x401c25[_0xfb05('0x9')](_0xfb05('0xa'),attributes,{'tableName':_0xfb05('0xb'),'paranoid':![],'indexes':[{'name':_0xfb05('0xc'),'fields':['messageId']},{'name':_0xfb05('0xd'),'fields':[_0xfb05('0xe'),_0xfb05('0xf')],'type':_0xfb05('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3b5a6c,_0x56adeb,_0x13c3a5){if(_0x3b5a6c[_0xfb05('0x11')]){_0x3b5a6c[_0xfb05('0xe')]=htmlToText['fromString'](_0x3b5a6c[_0xfb05('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x13c3a5(null,_0x56adeb);},'afterCreate':function(_0x447f88,_0xa58f7b,_0x12dbc7){var _0x54b899=_0x401c25[_0xfb05('0x12')];var _0x519d83=_0x447f88['get']({'plain':!![]});if(_0x519d83[_0xfb05('0x13')][_0xfb05('0x14')]()==='in'||_0x519d83[_0xfb05('0x13')][_0xfb05('0x14')]()===_0xfb05('0x15')&&!_0x519d83['secret']&&!_['isNil'](_0x519d83[_0xfb05('0x16')])){_0x54b899['MailInteraction'][_0xfb05('0x17')]({'where':{'id':_0x519d83[_0xfb05('0x18')]}})['then'](function(_0x3d3d1f){if(_0x3d3d1f){_0x3d3d1f[_0xfb05('0x19')]({'lastMsgAt':_0x519d83[_0xfb05('0x1a')],'lastMsgDirection':_0x519d83[_0xfb05('0x13')]['toLowerCase']()});}})['catch'](function(_0x874ff7){console[_0xfb05('0x1b')](_0x874ff7);});}_0x12dbc7();}},'charset':_0xfb05('0x1c'),'collate':_0xfb05('0x1d')});};
\ No newline at end of file
+var _0x15d7=['secret','UserId','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','html-to-text','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','toLowerCase','direction','out'];(function(_0x51786e,_0x5ee24e){var _0x25b5e2=function(_0x3ce85f){while(--_0x3ce85f){_0x51786e['push'](_0x51786e['shift']());}};_0x25b5e2(++_0x5ee24e);}(_0x15d7,0xdc));var _0x715d=function(_0xcee593,_0x9886e7){_0xcee593=_0xcee593-0x0;var _0x4fa243=_0x15d7[_0xcee593];return _0x4fa243;};'use strict';var _=require(_0x715d('0x0'));var util=require('util');var logger=require(_0x715d('0x1'))(_0x715d('0x2'));var moment=require(_0x715d('0x3'));var BPromise=require(_0x715d('0x4'));var rp=require('request-promise');var htmlToText=require(_0x715d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x715d('0x6'));module[_0x715d('0x7')]=function(_0x5edbd4,_0x12b13c){return _0x5edbd4[_0x715d('0x8')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x715d('0x9'),'fields':[_0x715d('0x9')]},{'name':_0x715d('0xa'),'fields':[_0x715d('0xb'),_0x715d('0xc')],'type':_0x715d('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a1e95,_0x7f322c,_0x337f39){if(_0x2a1e95[_0x715d('0xe')]){_0x2a1e95[_0x715d('0xb')]=htmlToText[_0x715d('0xf')](_0x2a1e95[_0x715d('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x337f39(null,_0x7f322c);},'afterCreate':function(_0x3e5428,_0x546472,_0x824df0){var _0x5958bf=_0x5edbd4[_0x715d('0x10')];var _0x450c18=_0x3e5428['get']({'plain':!![]});if(_0x450c18['direction'][_0x715d('0x11')]()==='in'||_0x450c18[_0x715d('0x12')][_0x715d('0x11')]()===_0x715d('0x13')&&!_0x450c18[_0x715d('0x14')]&&!_['isNil'](_0x450c18[_0x715d('0x15')])){_0x5958bf['MailInteraction'][_0x715d('0x16')]({'where':{'id':_0x450c18[_0x715d('0x17')]}})[_0x715d('0x18')](function(_0x3c05ac){if(_0x3c05ac){_0x3c05ac[_0x715d('0x19')]({'lastMsgAt':_0x450c18[_0x715d('0x1a')],'lastMsgDirection':_0x450c18[_0x715d('0x12')][_0x715d('0x11')]()});}})[_0x715d('0x1b')](function(_0x36c84b){console[_0x715d('0x1c')](_0x36c84b);});}_0x824df0();}},'charset':'utf8mb4','collate':_0x715d('0x1d')});};
\ No newline at end of file
index ae2dad5..47e85b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['error','message','MailMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','stringify','code'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8952,0x17e));var _0x2895=function(_0x588169,_0x4ca1d0){_0x588169=_0x588169-0x0;var _0x120647=_0x8952[_0x588169];return _0x120647;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}exports['CreateMailMessage']=function(_0x493851){var _0x442cfa=this;return new Promise(function(_0x12c2fb,_0x3ec4da){return db['MailMessage'][_0x2895('0x1a')](_0x493851[_0x2895('0x1b')],{'raw':_0x493851[_0x2895('0x1c')]?_0x493851[_0x2895('0x1c')][_0x2895('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x30c6c3){logger[_0x2895('0x10')]('CreateMailMessage',_0x493851);logger[_0x2895('0x12')](_0x2895('0x1e'),_0x493851,JSON[_0x2895('0x13')](_0x30c6c3));_0x12c2fb(_0x30c6c3);})['catch'](function(_0x4e884f){logger[_0x2895('0x15')](_0x2895('0x1e'),_0x4e884f[_0x2895('0x16')],_0x493851);_0x3ec4da(_0x442cfa['error'](0x1f4,_0x4e884f[_0x2895('0x16')]));});});};
\ No newline at end of file
+var _0x3de3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','CreateMailMessage','MailMessage','create','options','catch','lodash','moment','bluebird'];(function(_0x4a4345,_0x6ac5f1){var _0xfcc719=function(_0x1afd2f){while(--_0x1afd2f){_0x4a4345['push'](_0x4a4345['shift']());}};_0xfcc719(++_0x6ac5f1);}(_0x3de3,0x1ce));var _0x33de=function(_0x56d2c0,_0x3cb4fb){_0x56d2c0=_0x56d2c0-0x0;var _0x29fef6=_0x3de3[_0x56d2c0];return _0x29fef6;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var BPromise=require(_0x33de('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33de('0x3'));var db=require(_0x33de('0x4'))['db'];var utils=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('rpc');var config=require(_0x33de('0x7'));var jayson=require(_0x33de('0x8'));var client=jayson['client'][_0x33de('0x9')]({'port':0x232a});config['redis']=_[_0x33de('0xa')](config[_0x33de('0xb')],{'host':_0x33de('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x33de('0xb')]));require(_0x33de('0xd'))[_0x33de('0xe')](socket);function respondWithRpcPromise(_0x5e1be7,_0x2cbf35,_0x348720){return new BPromise(function(_0x8b655d,_0x241211){return client[_0x33de('0xf')](_0x5e1be7,_0x348720)[_0x33de('0x10')](function(_0x8dfa3b){logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,_0x33de('0x13'));logger[_0x33de('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2cbf35,_0x33de('0x13'),JSON[_0x33de('0x15')](_0x8dfa3b));if(_0x8dfa3b['error']){if(_0x8dfa3b['error'][_0x33de('0x16')]===0x1f4){logger[_0x33de('0x17')](_0x33de('0x12'),_0x2cbf35,_0x8dfa3b[_0x33de('0x17')]['message']);return _0x241211(_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x8dfa3b[_0x33de('0x17')][_0x33de('0x18')]);return _0x8b655d(_0x8dfa3b[_0x33de('0x17')]['message']);}else{logger[_0x33de('0x11')](_0x33de('0x12'),_0x2cbf35,'request\x20sent');_0x8b655d(_0x8dfa3b[_0x33de('0x19')][_0x33de('0x18')]);}})['catch'](function(_0x5bb74e){logger[_0x33de('0x17')]('MailMessage,\x20%s,\x20%s',_0x2cbf35,_0x5bb74e);_0x241211(_0x5bb74e);});});}exports[_0x33de('0x1a')]=function(_0x2f0529){var _0x3810b5=this;return new Promise(function(_0x315c9b,_0xc4f1a4){return db[_0x33de('0x1b')][_0x33de('0x1c')](_0x2f0529['body'],{'raw':_0x2f0529['options']?_0x2f0529[_0x33de('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x33de('0x10')](function(_0x4cd8db){logger[_0x33de('0x11')](_0x33de('0x1a'),_0x2f0529);logger['debug'](_0x33de('0x1a'),_0x2f0529,JSON['stringify'](_0x4cd8db));_0x315c9b(_0x4cd8db);})[_0x33de('0x1e')](function(_0x5c602d){logger[_0x33de('0x17')](_0x33de('0x1a'),_0x5c602d[_0x33de('0x18')],_0x2f0529);_0xc4f1a4(_0x3810b5['error'](0x1f4,_0x5c602d[_0x33de('0x18')]));});});};
\ No newline at end of file
index f17e93d..f2e1127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3360=['remove','update','removeListener','mailMessage:','./mailMessage.events','save'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x3360,0x15a));var _0x0336=function(_0x1fcda7,_0xdc5f3d){_0x1fcda7=_0x1fcda7-0x0;var _0x10ee2d=_0x3360[_0x1fcda7];return _0x10ee2d;};'use strict';var MailMessageEvents=require(_0x0336('0x0'));var events=[_0x0336('0x1'),_0x0336('0x2'),_0x0336('0x3')];function createListener(_0x4a8504,_0x188d64){return function(_0x46c884){_0x188d64['emit'](_0x4a8504,_0x46c884);};}function removeListener(_0x455c27,_0x134bed){return function(){MailMessageEvents[_0x0336('0x4')](_0x455c27,_0x134bed);};}exports['register']=function(_0x3815f3){for(var _0x3e8e6b=0x0,_0xc364d3=events['length'];_0x3e8e6b<_0xc364d3;_0x3e8e6b++){var _0x5766af=events[_0x3e8e6b];var _0x47f843=createListener(_0x0336('0x5')+_0x5766af,_0x3815f3);MailMessageEvents['on'](_0x5766af,_0x47f843);}};
\ No newline at end of file
+var _0xa162=['mailMessage:','./mailMessage.events','update','emit','removeListener','length'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xa162,0x169));var _0x2a16=function(_0x482e6b,_0x31020a){_0x482e6b=_0x482e6b-0x0;var _0x212b7a=_0xa162[_0x482e6b];return _0x212b7a;};'use strict';var MailMessageEvents=require(_0x2a16('0x0'));var events=['save','remove',_0x2a16('0x1')];function createListener(_0x2a8169,_0x180c68){return function(_0xd7f882){_0x180c68[_0x2a16('0x2')](_0x2a8169,_0xd7f882);};}function removeListener(_0x3b6064,_0x4270c0){return function(){MailMessageEvents[_0x2a16('0x3')](_0x3b6064,_0x4270c0);};}exports['register']=function(_0x2674f6){for(var _0xc66f31=0x0,_0x153cdd=events[_0x2a16('0x4')];_0xc66f31<_0x153cdd;_0xc66f31++){var _0x3fb925=events[_0xc66f31];var _0x443e75=createListener(_0x2a16('0x5')+_0x3fb925,_0x2674f6);MailMessageEvents['on'](_0x3fb925,_0x443e75);}};
\ No newline at end of file
index b16a168..e901abc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4874=['describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','delete','destroy','removeTeams','exports','multer','util','express','Router','fs-extra','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x3f98f0,_0x59844c){var _0x497b7c=function(_0x27d4d6){while(--_0x27d4d6){_0x3f98f0['push'](_0x3f98f0['shift']());}};_0x497b7c(++_0x59844c);}(_0x4874,0xb2));var _0x4487=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4874[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x4487('0x0'));var util=require(_0x4487('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4487('0x2'));var router=express[_0x4487('0x3')]();var fs_extra=require(_0x4487('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4487('0x5'));var controller=require(_0x4487('0x6'));router[_0x4487('0x7')]('/',auth[_0x4487('0x8')](),controller[_0x4487('0x9')]);router[_0x4487('0x7')](_0x4487('0xa'),auth[_0x4487('0x8')](),controller[_0x4487('0xb')]);router[_0x4487('0x7')](_0x4487('0xc'),auth['isAuthenticated'](),controller[_0x4487('0xd')]);router[_0x4487('0x7')](_0x4487('0xe'),auth[_0x4487('0x8')](),controller[_0x4487('0xf')]);router[_0x4487('0x7')]('/:id/teams',auth[_0x4487('0x8')](),controller['getTeams']);router['get'](_0x4487('0x10'),auth[_0x4487('0x8')](),controller[_0x4487('0x11')]);router[_0x4487('0x12')]('/',auth[_0x4487('0x8')](),controller[_0x4487('0x13')]);router[_0x4487('0x12')](_0x4487('0x14'),auth[_0x4487('0x8')](),controller[_0x4487('0x15')]);router[_0x4487('0x12')](_0x4487('0x10'),auth[_0x4487('0x8')](),controller['addAgents']);router[_0x4487('0x16')](_0x4487('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4487('0x17')](_0x4487('0xc'),auth[_0x4487('0x8')](),controller[_0x4487('0x18')]);router[_0x4487('0x17')](_0x4487('0x14'),auth[_0x4487('0x8')](),controller[_0x4487('0x19')]);router[_0x4487('0x17')]('/:id/users',auth[_0x4487('0x8')](),controller['removeAgents']);module[_0x4487('0x1a')]=router;
\ No newline at end of file
+var _0xab29=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','addTeams','delete','/:id/teams'];(function(_0x542063,_0x423b71){var _0x36f4d7=function(_0x3b28d7){while(--_0x3b28d7){_0x542063['push'](_0x542063['shift']());}};_0x36f4d7(++_0x423b71);}(_0xab29,0x7e));var _0x9ab2=function(_0x511dff,_0x3694f9){_0x511dff=_0x511dff-0x0;var _0x1a2c36=_0xab29[_0x511dff];return _0x1a2c36;};'use strict';var multer=require('multer');var util=require(_0x9ab2('0x0'));var path=require(_0x9ab2('0x1'));var timeout=require(_0x9ab2('0x2'));var express=require(_0x9ab2('0x3'));var router=express[_0x9ab2('0x4')]();var fs_extra=require(_0x9ab2('0x5'));var auth=require(_0x9ab2('0x6'));var interaction=require(_0x9ab2('0x7'));var config=require(_0x9ab2('0x8'));var controller=require(_0x9ab2('0x9'));router[_0x9ab2('0xa')]('/',auth[_0x9ab2('0xb')](),controller['index']);router[_0x9ab2('0xa')](_0x9ab2('0xc'),auth[_0x9ab2('0xb')](),controller[_0x9ab2('0xd')]);router[_0x9ab2('0xa')](_0x9ab2('0xe'),auth['isAuthenticated'](),controller[_0x9ab2('0xf')]);router['get']('/:id/members',auth[_0x9ab2('0xb')](),controller[_0x9ab2('0x10')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x9ab2('0x11')]);router['get'](_0x9ab2('0x12'),auth[_0x9ab2('0xb')](),controller[_0x9ab2('0x13')]);router['post']('/',auth[_0x9ab2('0xb')](),controller['create']);router[_0x9ab2('0x14')]('/:id/teams',auth[_0x9ab2('0xb')](),controller[_0x9ab2('0x15')]);router[_0x9ab2('0x14')](_0x9ab2('0x12'),auth[_0x9ab2('0xb')](),controller['addAgents']);router['put'](_0x9ab2('0xe'),auth[_0x9ab2('0xb')](),controller['update']);router[_0x9ab2('0x16')](_0x9ab2('0xe'),auth[_0x9ab2('0xb')](),controller['destroy']);router[_0x9ab2('0x16')](_0x9ab2('0x17'),auth[_0x9ab2('0xb')](),controller['removeTeams']);router['delete'](_0x9ab2('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9ab2('0x18')]=router;
\ No newline at end of file
index e7691e8..0739a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe88=['STRING','name','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x309624,_0x146350){var _0x7536aa=function(_0x569394){while(--_0x569394){_0x309624['push'](_0x309624['shift']());}};_0x7536aa(++_0x146350);}(_0xfe88,0x1c5));var _0x8fe8=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xfe88[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0x8fe8('0x0'));module[_0x8fe8('0x1')]={'name':{'type':Sequelize[_0x8fe8('0x2')],'unique':_0x8fe8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8fe8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8fe8('0x4'),_0x8fe8('0x5'),_0x8fe8('0x6'))}};
\ No newline at end of file
+var _0x0b0d=['ENUM','rrmemory','sequelize','STRING','name','INTEGER'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x0b0d,0x158));var _0xd0b0=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x0b0d[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xd0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xd0b0('0x1')],'unique':_0xd0b0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd0b0('0x1')]},'timeout':{'type':Sequelize[_0xd0b0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd0b0('0x4')](_0xd0b0('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
index 74c2092..1a2a80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa506=['each','findOrCreate','forEach','userMailQueue:save','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','union','compact','transaction','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','get','MailQueues','UserProfileResource','stack','name','index','map','MailQueue','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','update','describe','getMembers','findOne','UserMailQueue','rawAttributes','pick','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x4a01b0,_0x27961b){var _0x585fb6=function(_0x375edb){while(--_0x375edb){_0x4a01b0['push'](_0x4a01b0['shift']());}};_0x585fb6(++_0x27961b);}(_0xa506,0x12f));var _0x6a50=function(_0x31704f,_0x3c67b9){_0x31704f=_0x31704f-0x0;var _0x1914f6=_0xa506[_0x31704f];return _0x1914f6;};'use strict';var emlformat=require(_0x6a50('0x0'));var rimraf=require(_0x6a50('0x1'));var zipdir=require(_0x6a50('0x2'));var jsonpatch=require(_0x6a50('0x3'));var rp=require('request-promise');var moment=require(_0x6a50('0x4'));var BPromise=require(_0x6a50('0x5'));var Mustache=require(_0x6a50('0x6'));var util=require('util');var path=require(_0x6a50('0x7'));var sox=require(_0x6a50('0x8'));var csv=require('to-csv');var ejs=require(_0x6a50('0x9'));var fs=require('fs');var fs_extra=require(_0x6a50('0xa'));var _=require('lodash');var squel=require(_0x6a50('0xb'));var crypto=require(_0x6a50('0xc'));var jsforce=require(_0x6a50('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6a50('0xe'));var querystring=require(_0x6a50('0xf'));var Papa=require(_0x6a50('0x10'));var Redis=require(_0x6a50('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6a50('0x12'));var as=require(_0x6a50('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a50('0x14'))(_0x6a50('0x15'));var utils=require('../../config/utils');var config=require(_0x6a50('0x16'));var licenseUtil=require(_0x6a50('0x17'));var db=require(_0x6a50('0x18'))['db'];config[_0x6a50('0x19')]=_[_0x6a50('0x1a')](config[_0x6a50('0x19')],{'host':_0x6a50('0x1b'),'port':0x18eb});var socket=require(_0x6a50('0x1c'))(new Redis(config[_0x6a50('0x19')]));require(_0x6a50('0x1d'))['register'](socket);function respondWithStatusCode(_0x314259,_0x26b879){_0x26b879=_0x26b879||0xcc;return function(_0x19a385){if(_0x19a385){return _0x314259[_0x6a50('0x1e')](_0x26b879);}return _0x314259['status'](_0x26b879)[_0x6a50('0x1f')]();};}function respondWithResult(_0xb336ae,_0x31a3fa){_0x31a3fa=_0x31a3fa||0xc8;return function(_0x5c2576){if(_0x5c2576){return _0xb336ae[_0x6a50('0x20')](_0x31a3fa)['json'](_0x5c2576);}};}function respondWithFilteredResult(_0x5642c1,_0x7fe9ff){return function(_0x29b31a){if(_0x29b31a){var _0x1e8a4f=typeof _0x7fe9ff[_0x6a50('0x21')]===_0x6a50('0x22')&&typeof _0x7fe9ff[_0x6a50('0x23')]===_0x6a50('0x22');var _0xf8fc59=_0x29b31a['count'];var _0x305a7c=_0x1e8a4f?0x0:_0x7fe9ff[_0x6a50('0x21')];var _0x14deb8=_0x1e8a4f?_0x29b31a[_0x6a50('0x24')]:_0x7fe9ff['offset']+_0x7fe9ff['limit'];var _0x571d1f;if(_0x14deb8>=_0xf8fc59){_0x14deb8=_0xf8fc59;_0x571d1f=0xc8;}else{_0x571d1f=0xce;}_0x5642c1[_0x6a50('0x20')](_0x571d1f);return _0x5642c1[_0x6a50('0x25')](_0x6a50('0x26'),_0x305a7c+'-'+_0x14deb8+'/'+_0xf8fc59)[_0x6a50('0x27')](_0x29b31a);}return null;};}function patchUpdates(_0x5b587f){return function(_0x364291){try{jsonpatch['apply'](_0x364291,_0x5b587f,!![]);}catch(_0xaf3520){return BPromise[_0x6a50('0x28')](_0xaf3520);}return _0x364291[_0x6a50('0x29')]();};}function saveUpdates(_0x5f3640,_0x38ee30){return function(_0x1a3789){if(_0x1a3789){return _0x1a3789['update'](_0x5f3640)['then'](function(_0x46f89b){return _0x46f89b;});}return null;};}function removeEntity(_0x9584c6,_0x18ff30){return function(_0x31227b){if(_0x31227b){return _0x31227b[_0x6a50('0x2a')]()[_0x6a50('0x2b')](function(){var _0x18cb9e=_0x31227b[_0x6a50('0x2c')]({'plain':!![]});var _0x51d51a=_0x6a50('0x2d');return db[_0x6a50('0x2e')][_0x6a50('0x2a')]({'where':{'type':_0x51d51a,'resourceId':_0x18cb9e['id']}})[_0x6a50('0x2b')](function(){return _0x31227b;});})[_0x6a50('0x2b')](function(){_0x9584c6[_0x6a50('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb7ad4,_0x4a0be9){return function(_0x4110f9){if(!_0x4110f9){_0xeb7ad4[_0x6a50('0x1e')](0x194);}return _0x4110f9;};}function handleError(_0x2b1842,_0x586deb){_0x586deb=_0x586deb||0x1f4;return function(_0x55cdbd){logger['error'](_0x55cdbd[_0x6a50('0x2f')]);if(_0x55cdbd[_0x6a50('0x30')]){delete _0x55cdbd[_0x6a50('0x30')];}_0x2b1842[_0x6a50('0x20')](_0x586deb)['send'](_0x55cdbd);};}exports[_0x6a50('0x31')]=function(_0x27f7f4,_0x1ed4ad){var _0x209eb1={},_0x29fb86={},_0x195581={'count':0x0,'rows':[]};var _0x57c304=_[_0x6a50('0x32')](db[_0x6a50('0x33')]['rawAttributes'],function(_0x4be169){return{'name':_0x4be169['fieldName'],'type':_0x4be169[_0x6a50('0x34')][_0x6a50('0x35')]};});_0x29fb86['model']=_[_0x6a50('0x32')](_0x57c304,_0x6a50('0x30'));_0x29fb86[_0x6a50('0x36')]=_[_0x6a50('0x37')](_0x27f7f4[_0x6a50('0x36')]);_0x29fb86[_0x6a50('0x38')]=_['intersection'](_0x29fb86[_0x6a50('0x39')],_0x29fb86[_0x6a50('0x36')]);_0x209eb1[_0x6a50('0x3a')]=_[_0x6a50('0x3b')](_0x29fb86[_0x6a50('0x39')],qs[_0x6a50('0x3c')](_0x27f7f4[_0x6a50('0x36')][_0x6a50('0x3c')]));_0x209eb1[_0x6a50('0x3a')]=_0x209eb1[_0x6a50('0x3a')][_0x6a50('0x3d')]?_0x209eb1[_0x6a50('0x3a')]:_0x29fb86['model'];if(!_0x27f7f4[_0x6a50('0x36')]['hasOwnProperty'](_0x6a50('0x3e'))){_0x209eb1[_0x6a50('0x23')]=qs[_0x6a50('0x23')](_0x27f7f4[_0x6a50('0x36')][_0x6a50('0x23')]);_0x209eb1['offset']=qs[_0x6a50('0x21')](_0x27f7f4['query'][_0x6a50('0x21')]);}_0x209eb1[_0x6a50('0x3f')]=qs[_0x6a50('0x40')](_0x27f7f4['query']['sort']);_0x209eb1[_0x6a50('0x41')]=qs['filters'](_['pick'](_0x27f7f4[_0x6a50('0x36')],_0x29fb86[_0x6a50('0x38')]),_0x57c304);if(_0x27f7f4[_0x6a50('0x36')][_0x6a50('0x42')]){_0x209eb1['where']=_[_0x6a50('0x43')](_0x209eb1[_0x6a50('0x41')],{'$or':_[_0x6a50('0x32')](_0x57c304,function(_0x2e47cd){if(_0x2e47cd['type']!==_0x6a50('0x44')){var _0x513591={};_0x513591[_0x2e47cd[_0x6a50('0x30')]]={'$like':'%'+_0x27f7f4[_0x6a50('0x36')][_0x6a50('0x42')]+'%'};return _0x513591;}})});}_0x209eb1=_[_0x6a50('0x43')]({},_0x209eb1,_0x27f7f4[_0x6a50('0x45')]);var _0x5d0789={'where':_0x209eb1[_0x6a50('0x41')]};return db['MailQueue'][_0x6a50('0x24')](_0x5d0789)[_0x6a50('0x2b')](function(_0x190ec7){_0x195581[_0x6a50('0x24')]=_0x190ec7;if(_0x27f7f4['query']['includeAll']){_0x209eb1['include']=[{'all':!![]}];}return db[_0x6a50('0x33')][_0x6a50('0x46')](_0x209eb1);})[_0x6a50('0x2b')](function(_0x5eedc7){_0x195581[_0x6a50('0x47')]=_0x5eedc7;return _0x195581;})[_0x6a50('0x2b')](respondWithFilteredResult(_0x1ed4ad,_0x209eb1))[_0x6a50('0x48')](handleError(_0x1ed4ad,null));};exports[_0x6a50('0x49')]=function(_0x405b4d,_0x53ee88){var _0x9d6d3e={'raw':!![],'where':{'id':_0x405b4d[_0x6a50('0x4a')]['id']}},_0x1c93ba={};_0x1c93ba[_0x6a50('0x39')]=_[_0x6a50('0x37')](db['MailQueue']['rawAttributes']);_0x1c93ba[_0x6a50('0x36')]=_[_0x6a50('0x37')](_0x405b4d[_0x6a50('0x36')]);_0x1c93ba[_0x6a50('0x38')]=_['intersection'](_0x1c93ba[_0x6a50('0x39')],_0x1c93ba['query']);_0x9d6d3e[_0x6a50('0x3a')]=_[_0x6a50('0x3b')](_0x1c93ba[_0x6a50('0x39')],qs['fields'](_0x405b4d[_0x6a50('0x36')]['fields']));_0x9d6d3e[_0x6a50('0x3a')]=_0x9d6d3e[_0x6a50('0x3a')][_0x6a50('0x3d')]?_0x9d6d3e[_0x6a50('0x3a')]:_0x1c93ba['model'];if(_0x405b4d[_0x6a50('0x36')][_0x6a50('0x4b')]){_0x9d6d3e[_0x6a50('0x4c')]=[{'all':!![]}];}_0x9d6d3e=_[_0x6a50('0x43')]({},_0x9d6d3e,_0x405b4d[_0x6a50('0x45')]);return db[_0x6a50('0x33')][_0x6a50('0x4d')](_0x9d6d3e)[_0x6a50('0x2b')](handleEntityNotFound(_0x53ee88,null))[_0x6a50('0x2b')](respondWithResult(_0x53ee88,null))['catch'](handleError(_0x53ee88,null));};exports['create']=function(_0x1367b9,_0x3c8180){return db[_0x6a50('0x33')][_0x6a50('0x4e')](_0x1367b9[_0x6a50('0x4f')],{})[_0x6a50('0x2b')](function(_0x2b25e7){var _0x345c6b=_0x1367b9[_0x6a50('0x50')][_0x6a50('0x2c')]({'plain':!![]});if(!_0x345c6b)throw new Error(_0x6a50('0x51'));if(_0x345c6b['role']==='user'){var _0xbbd808=_0x2b25e7['get']({'plain':!![]});var _0x1ef48d=_0x6a50('0x2d');return db[_0x6a50('0x52')][_0x6a50('0x4d')]({'where':{'name':_0x1ef48d,'userProfileId':_0x345c6b[_0x6a50('0x53')]},'raw':!![]})[_0x6a50('0x2b')](function(_0x28590c){if(_0x28590c&&_0x28590c['autoAssociation']===0x0){return db['UserProfileResource'][_0x6a50('0x4e')]({'name':_0xbbd808['name'],'resourceId':_0xbbd808['id'],'type':_0x28590c[_0x6a50('0x30')],'sectionId':_0x28590c['id']},{})[_0x6a50('0x2b')](function(){return _0x2b25e7;});}else{return _0x2b25e7;}})['catch'](function(_0x530ec2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x530ec2);throw _0x530ec2;});}return _0x2b25e7;})[_0x6a50('0x2b')](respondWithResult(_0x3c8180,0xc9))['catch'](handleError(_0x3c8180,null));};exports[_0x6a50('0x54')]=function(_0x3c3e1a,_0x44828f){if(_0x3c3e1a['body']['id']){delete _0x3c3e1a[_0x6a50('0x4f')]['id'];}return db[_0x6a50('0x33')][_0x6a50('0x4d')]({'where':{'id':_0x3c3e1a[_0x6a50('0x4a')]['id']}})['then'](handleEntityNotFound(_0x44828f,null))[_0x6a50('0x2b')](saveUpdates(_0x3c3e1a[_0x6a50('0x4f')],null))[_0x6a50('0x2b')](respondWithResult(_0x44828f,null))[_0x6a50('0x48')](handleError(_0x44828f,null));};exports[_0x6a50('0x2a')]=function(_0x5e35c6,_0x1e0f11){return db[_0x6a50('0x33')][_0x6a50('0x4d')]({'where':{'id':_0x5e35c6[_0x6a50('0x4a')]['id']}})[_0x6a50('0x2b')](handleEntityNotFound(_0x1e0f11,null))[_0x6a50('0x2b')](removeEntity(_0x1e0f11,null))[_0x6a50('0x48')](handleError(_0x1e0f11,null));};exports['describe']=function(_0x44c6a2,_0x36fc0e){return db['MailQueue'][_0x6a50('0x55')]()[_0x6a50('0x2b')](respondWithResult(_0x36fc0e,null))[_0x6a50('0x48')](handleError(_0x36fc0e,null));};exports[_0x6a50('0x56')]=function(_0x1b7156,_0x55ebe8,_0x595bd){var _0x497fd1={'raw':!![],'where':{}},_0x3edbed={},_0xc2b222;return db[_0x6a50('0x33')][_0x6a50('0x57')]({'where':{'id':_0x1b7156[_0x6a50('0x4a')]['id']}})[_0x6a50('0x2b')](handleEntityNotFound(_0x55ebe8,null))[_0x6a50('0x2b')](function(_0x218233){if(_0x218233){_0xc2b222=_0x218233[_0x6a50('0x2c')]({'plain':!![]});_0x3edbed[_0x6a50('0x39')]=_[_0x6a50('0x37')](db[_0x6a50('0x58')][_0x6a50('0x59')]);_0x3edbed[_0x6a50('0x36')]=_[_0x6a50('0x37')](_0x1b7156[_0x6a50('0x36')]);_0x3edbed[_0x6a50('0x38')]=_[_0x6a50('0x3b')](_0x3edbed[_0x6a50('0x39')],_0x3edbed[_0x6a50('0x36')]);_0x497fd1[_0x6a50('0x3a')]=_[_0x6a50('0x3b')](_0x3edbed[_0x6a50('0x39')],qs[_0x6a50('0x3c')](_0x1b7156['query'][_0x6a50('0x3c')]));_0x497fd1['attributes']=_0x497fd1[_0x6a50('0x3a')]['length']?_0x497fd1[_0x6a50('0x3a')]:_0x3edbed['model'];if(!_0x1b7156[_0x6a50('0x36')]['hasOwnProperty']('nolimit')){_0x497fd1['limit']=qs[_0x6a50('0x23')](_0x1b7156[_0x6a50('0x36')]['limit']);_0x497fd1[_0x6a50('0x21')]=qs[_0x6a50('0x21')](_0x1b7156[_0x6a50('0x36')][_0x6a50('0x21')]);}_0x497fd1['order']=qs[_0x6a50('0x40')](_0x1b7156[_0x6a50('0x36')][_0x6a50('0x40')]);_0x497fd1[_0x6a50('0x41')]=qs[_0x6a50('0x38')](_[_0x6a50('0x5a')](_0x1b7156[_0x6a50('0x36')],_0x3edbed[_0x6a50('0x38')]));_0x497fd1[_0x6a50('0x41')][_0x6a50('0x5b')]=_0x218233['id'];if(_0x1b7156[_0x6a50('0x36')][_0x6a50('0x42')]){_0x497fd1[_0x6a50('0x41')]=_[_0x6a50('0x43')](_0x497fd1[_0x6a50('0x41')],{'$or':_[_0x6a50('0x32')](_0x497fd1[_0x6a50('0x3a')],function(_0x35d7c4){var _0x49b775={};_0x49b775[_0x35d7c4]={'$like':'%'+_0x1b7156['query'][_0x6a50('0x42')]+'%'};return _0x49b775;})});}_0x497fd1=_[_0x6a50('0x43')]({},_0x497fd1,_0x1b7156['options']);return db[_0x6a50('0x58')][_0x6a50('0x46')](_0x497fd1);}})[_0x6a50('0x2b')](function(_0x2466ce){if(_0x2466ce){return db[_0x6a50('0x5c')][_0x6a50('0x5d')]({'where':{'id':_['map'](_0x2466ce,'UserId'),'role':_0x6a50('0x5e')},'attributes':['id',_0x6a50('0x30'),_0x6a50('0x5f'),_0x6a50('0x60'),_0x6a50('0x61')]});}})[_0x6a50('0x2b')](function(_0x31ca8f){if(_0x31ca8f){return{'count':_0x31ca8f[_0x6a50('0x24')],'rows':_[_0x6a50('0x32')](_0x31ca8f[_0x6a50('0x47')],function(_0x592b6f){return{'membername':_0x592b6f['name'],'UserId':_0x592b6f['id'],'queue_name':_0xc2b222['name'],'MailQueueId':_0xc2b222['id'],'interface':util['format'](_0x6a50('0x62'),_0x6a50('0x63'),_0x592b6f[_0x6a50('0x30')]),'penalty':0x0,'paused':_0x592b6f[_0x6a50('0x5f')],'createdAt':_0x592b6f[_0x6a50('0x61')],'updatedAt':_0x592b6f[_0x6a50('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6a50('0x2b')](respondWithFilteredResult(_0x55ebe8,_0x497fd1))[_0x6a50('0x48')](handleError(_0x55ebe8,null));};exports['getTeams']=function(_0x3ca0a3,_0xe7e252,_0x24c68c){var _0x44cd1b={};var _0x252754={};var _0x3d4f8e;var _0x21869a;return db['MailQueue'][_0x6a50('0x57')]({'where':{'id':_0x3ca0a3[_0x6a50('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe7e252,null))[_0x6a50('0x2b')](function(_0x2596e5){if(_0x2596e5){_0x3d4f8e=_0x2596e5;_0x252754[_0x6a50('0x39')]=_[_0x6a50('0x37')](db[_0x6a50('0x64')][_0x6a50('0x59')]);_0x252754[_0x6a50('0x36')]=_['keys'](_0x3ca0a3['query']);_0x252754[_0x6a50('0x38')]=_[_0x6a50('0x3b')](_0x252754['model'],_0x252754[_0x6a50('0x36')]);_0x44cd1b[_0x6a50('0x3a')]=_['intersection'](_0x252754['model'],qs[_0x6a50('0x3c')](_0x3ca0a3[_0x6a50('0x36')][_0x6a50('0x3c')]));_0x44cd1b[_0x6a50('0x3a')]=_0x44cd1b[_0x6a50('0x3a')][_0x6a50('0x3d')]?_0x44cd1b[_0x6a50('0x3a')]:_0x252754['model'];_0x44cd1b[_0x6a50('0x3f')]=qs[_0x6a50('0x40')](_0x3ca0a3['query'][_0x6a50('0x40')]);_0x44cd1b[_0x6a50('0x41')]=qs[_0x6a50('0x38')](_['pick'](_0x3ca0a3[_0x6a50('0x36')],_0x252754['filters']));if(_0x3ca0a3[_0x6a50('0x36')]['filter']){_0x44cd1b['where']=_[_0x6a50('0x43')](_0x44cd1b['where'],{'$or':_[_0x6a50('0x32')](_0x44cd1b[_0x6a50('0x3a')],function(_0x133215){var _0x411ec7={};_0x411ec7[_0x133215]={'$like':'%'+_0x3ca0a3['query'][_0x6a50('0x42')]+'%'};return _0x411ec7;})});}_0x44cd1b=_[_0x6a50('0x43')]({},_0x44cd1b,_0x3ca0a3[_0x6a50('0x45')]);return _0x3d4f8e[_0x6a50('0x65')](_0x44cd1b);}})[_0x6a50('0x2b')](function(_0x53b384){if(_0x53b384){_0x21869a=_0x53b384['length'];if(!_0x3ca0a3[_0x6a50('0x36')][_0x6a50('0x66')](_0x6a50('0x3e'))){_0x44cd1b[_0x6a50('0x23')]=qs[_0x6a50('0x23')](_0x3ca0a3[_0x6a50('0x36')][_0x6a50('0x23')]);_0x44cd1b[_0x6a50('0x21')]=qs[_0x6a50('0x21')](_0x3ca0a3[_0x6a50('0x36')]['offset']);}return _0x3d4f8e[_0x6a50('0x65')](_0x44cd1b);}})[_0x6a50('0x2b')](function(_0x3c76d3){if(_0x3c76d3){return _0x3c76d3?{'count':_0x21869a,'rows':_0x3c76d3}:null;}})[_0x6a50('0x2b')](respondWithResult(_0xe7e252,null))[_0x6a50('0x48')](handleError(_0xe7e252,null));};exports[_0x6a50('0x67')]=function(_0x48f593,_0x5ea73d,_0x43ad3a){var _0x58d525=_0x48f593[_0x6a50('0x4f')][_0x6a50('0x68')];return db[_0x6a50('0x64')][_0x6a50('0x46')]({'where':{'id':_0x58d525},'attributes':['id'],'include':[{'model':db[_0x6a50('0x5c')],'as':_0x6a50('0x69'),'attributes':['id',_0x6a50('0x30'),_0x6a50('0x6a'),_0x6a50('0x6b'),_0x6a50('0x6c')],'raw':!![]}]})[_0x6a50('0x2b')](function(_0x3e951d){if(_0x3e951d){var _0x353cf7=_[_0x6a50('0x6d')](_0x3e951d,function(_0x2668e2){var _0x2b3ba0=_0x2668e2[_0x6a50('0x2c')]({'plain':!![]});return _0x2b3ba0[_0x6a50('0x69')];});return db[_0x6a50('0x33')]['find']({'where':{'id':_0x48f593[_0x6a50('0x4a')]['id']}})[_0x6a50('0x2b')](function(_0x3202f1){return db[_0x6a50('0x6e')]['transaction'](function(_0x388f68){return _0x3202f1[_0x6a50('0x67')](_0x58d525,{'transaction':_0x388f68})['then'](function(){return BPromise[_0x6a50('0x6f')](_0x353cf7,function(_0xf6872e){return db['UserMailQueue'][_0x6a50('0x70')]({'where':{'UserId':_0xf6872e['id'],'MailQueueId':_0x48f593['params']['id']},'transaction':_0x388f68});});})[_0x6a50('0x2b')](function(){_0x353cf7[_0x6a50('0x71')](function(_0x533ab5){socket['emit'](_0x6a50('0x72'),{'UserId':_0x533ab5['id'],'MailQueueId':_0x3202f1['id']});});});});});}})[_0x6a50('0x2b')](respondWithStatusCode(_0x5ea73d,null))[_0x6a50('0x48')](handleError(_0x5ea73d,null));};exports['removeTeams']=function(_0xebc1a3,_0x2ce229,_0x7b092c){return db[_0x6a50('0x64')][_0x6a50('0x46')]({'where':{'id':_0xebc1a3[_0x6a50('0x36')][_0x6a50('0x68')]},'attributes':['id'],'include':[{'model':db[_0x6a50('0x5c')],'as':_0x6a50('0x69'),'attributes':['id'],'raw':!![]}]})[_0x6a50('0x2b')](handleEntityNotFound(_0x2ce229,null))[_0x6a50('0x2b')](function(_0x2b777f){var _0x103d3e=_[_0x6a50('0x32')](_0x2b777f,'id');var _0x31e9f8=[];var _0x358092=[];var _0x5ebc98=squel['select']();_0x5ebc98[_0x6a50('0x73')](_0x6a50('0x74'))['from'](_0x6a50('0x75'),'tq')[_0x6a50('0x76')]('user_has_teams','ut',_0x6a50('0x77'))[_0x6a50('0x41')](_0x6a50('0x78'),_0xebc1a3[_0x6a50('0x4a')]['id']);for(var _0x2559e2=0x0;_0x2559e2<_0x2b777f[_0x6a50('0x3d')];_0x2559e2+=0x1){let _0x3c6232=_0x2b777f[_0x2559e2];for(var _0x1a0cc9=0x0;_0x1a0cc9<_0x3c6232[_0x6a50('0x69')][_0x6a50('0x3d')];_0x1a0cc9+=0x1){let _0x350d32=_0x3c6232['Agents'][_0x1a0cc9];var _0x437024=_0x5ebc98[_0x6a50('0x79')]();_0x437024[_0x6a50('0x41')](_0x6a50('0x7a'),_0x350d32['id']);_0x358092['push'](db[_0x6a50('0x6e')]['query'](_0x437024[_0x6a50('0x7b')](),{'type':db[_0x6a50('0x6e')][_0x6a50('0x7c')]['SELECT']})[_0x6a50('0x2b')](function(_0x3cee69){if(_0x3cee69[_0x6a50('0x3d')]===0x1){return _0x350d32['id'];}else{var _0x5b1ce7=_['every'](_[_0x6a50('0x32')](_0x3cee69,_0x6a50('0x7d')),function(_0xd44c41){return _['includes'](_0x103d3e,_0xd44c41);});if(_0x5b1ce7){return _0x350d32['id'];}}}));}}return BPromise['all'](_0x358092)[_0x6a50('0x2b')](function(_0x493feb){_0x31e9f8=_(_0x31e9f8)[_0x6a50('0x7e')](_0x493feb)[_0x6a50('0x7f')]()['value']();return db['MailQueue'][_0x6a50('0x4d')]({'where':{'id':_0xebc1a3[_0x6a50('0x4a')]['id']}})['then'](function(_0x254712){return db[_0x6a50('0x6e')][_0x6a50('0x80')](function(_0x357904){return _0x254712[_0x6a50('0x81')](_0xebc1a3[_0x6a50('0x36')]['ids'],{'transaction':_0x357904})[_0x6a50('0x2b')](function(){if(!_[_0x6a50('0x82')](_0x31e9f8)){return _0x254712[_0x6a50('0x83')](_0x31e9f8,{'transaction':_0x357904});}})[_0x6a50('0x2b')](function(){_0x31e9f8[_0x6a50('0x71')](function(_0x30151c){socket[_0x6a50('0x84')](_0x6a50('0x85'),{'UserId':_0x30151c,'MailQueueId':_0x254712['id']});});});});});});})[_0x6a50('0x2b')](respondWithStatusCode(_0x2ce229,null))[_0x6a50('0x48')](handleError(_0x2ce229,null));};exports[_0x6a50('0x86')]=function(_0x8491c3,_0x490b3e,_0x3221fa){return db[_0x6a50('0x33')]['find']({'where':{'id':_0x8491c3[_0x6a50('0x4a')]['id']}})[_0x6a50('0x2b')](handleEntityNotFound(_0x490b3e,null))[_0x6a50('0x2b')](function(_0x2d015c){if(_0x2d015c){return _0x2d015c[_0x6a50('0x86')](_0x8491c3[_0x6a50('0x4f')][_0x6a50('0x68')],_[_0x6a50('0x87')](_0x8491c3['body'],[_0x6a50('0x68'),'id'])||{})['spread'](function(_0x25fc3b){for(var _0x298941=0x0;_0x298941<_0x8491c3[_0x6a50('0x4f')][_0x6a50('0x68')]['length'];_0x298941+=0x1){socket[_0x6a50('0x84')]('userMailQueue:save',{'UserId':_0x8491c3[_0x6a50('0x4f')][_0x6a50('0x68')][_0x298941],'MailQueueId':_0x8491c3[_0x6a50('0x4a')]['id']});}return _0x25fc3b;});}})[_0x6a50('0x2b')](respondWithResult(_0x490b3e,null))[_0x6a50('0x48')](handleError(_0x490b3e,null));};exports[_0x6a50('0x83')]=function(_0x168e72,_0x2bf9e2,_0x4a8a83){return db[_0x6a50('0x33')]['find']({'where':{'id':_0x168e72['params']['id']}})[_0x6a50('0x2b')](handleEntityNotFound(_0x2bf9e2,null))[_0x6a50('0x2b')](function(_0x5a17dc){if(_0x5a17dc){return _0x5a17dc[_0x6a50('0x83')](_0x168e72[_0x6a50('0x36')][_0x6a50('0x68')])[_0x6a50('0x2b')](function(){if(_[_0x6a50('0x88')](_0x168e72[_0x6a50('0x36')]['ids'])){for(var _0x57f69c=0x0;_0x57f69c<_0x168e72[_0x6a50('0x36')][_0x6a50('0x68')][_0x6a50('0x3d')];_0x57f69c+=0x1){socket[_0x6a50('0x84')](_0x6a50('0x85'),{'UserId':Number(_0x168e72['query'][_0x6a50('0x68')][_0x57f69c]),'MailQueueId':Number(_0x168e72['params']['id'])});}}else{socket[_0x6a50('0x84')](_0x6a50('0x85'),{'UserId':Number(_0x168e72['query'][_0x6a50('0x68')]),'MailQueueId':Number(_0x168e72[_0x6a50('0x4a')]['id'])});}});}})[_0x6a50('0x2b')](respondWithStatusCode(_0x2bf9e2,null))[_0x6a50('0x48')](handleError(_0x2bf9e2,null));};exports[_0x6a50('0x89')]=function(_0x4dabf2,_0x2006ec,_0x51735b){var _0x3eee66={};var _0x5d5567={};var _0x56e7f8;var _0x5bacef;return db[_0x6a50('0x33')][_0x6a50('0x57')]({'where':{'id':_0x4dabf2['params']['id']}})['then'](handleEntityNotFound(_0x2006ec,null))[_0x6a50('0x2b')](function(_0x471973){if(_0x471973){_0x56e7f8=_0x471973;_0x5d5567[_0x6a50('0x39')]=_[_0x6a50('0x37')](db[_0x6a50('0x5c')][_0x6a50('0x59')]);_0x5d5567[_0x6a50('0x36')]=_[_0x6a50('0x37')](_0x4dabf2['query']);_0x5d5567['filters']=_[_0x6a50('0x3b')](_0x5d5567[_0x6a50('0x39')],_0x5d5567['query']);_0x3eee66[_0x6a50('0x3a')]=_['intersection'](_0x5d5567[_0x6a50('0x39')],qs[_0x6a50('0x3c')](_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x3c')]));_0x3eee66['attributes']=_0x3eee66[_0x6a50('0x3a')][_0x6a50('0x3d')]?_0x3eee66[_0x6a50('0x3a')]:_0x5d5567[_0x6a50('0x39')];_0x3eee66[_0x6a50('0x3f')]=qs[_0x6a50('0x40')](_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x40')]);_0x3eee66['where']=qs[_0x6a50('0x38')](_[_0x6a50('0x5a')](_0x4dabf2[_0x6a50('0x36')],_0x5d5567[_0x6a50('0x38')]));if(_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x42')]){_0x3eee66[_0x6a50('0x41')]=_[_0x6a50('0x43')](_0x3eee66[_0x6a50('0x41')],{'$or':_[_0x6a50('0x32')](_0x3eee66[_0x6a50('0x3a')],function(_0x596d9d){var _0x9daf2c={};_0x9daf2c[_0x596d9d]={'$like':'%'+_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x42')]+'%'};return _0x9daf2c;})});}_0x3eee66=_[_0x6a50('0x43')]({},_0x3eee66,_0x4dabf2[_0x6a50('0x45')]);return _0x56e7f8['getAgents'](_0x3eee66);}})[_0x6a50('0x2b')](function(_0x14708c){if(_0x14708c){_0x5bacef=_0x14708c[_0x6a50('0x3d')];if(!_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x66')]('nolimit')){_0x3eee66['limit']=qs[_0x6a50('0x23')](_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x23')]);_0x3eee66[_0x6a50('0x21')]=qs[_0x6a50('0x21')](_0x4dabf2[_0x6a50('0x36')][_0x6a50('0x21')]);}return _0x56e7f8[_0x6a50('0x89')](_0x3eee66);}})[_0x6a50('0x2b')](function(_0x3e2f27){if(_0x3e2f27){return _0x3e2f27?{'count':_0x5bacef,'rows':_0x3e2f27}:null;}})[_0x6a50('0x2b')](respondWithResult(_0x2006ec,null))[_0x6a50('0x48')](handleError(_0x2006ec,null));};
\ No newline at end of file
+var _0x9931=['send','index','rawAttributes','type','key','model','map','keys','query','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','MailQueue','includeAll','include','findAll','catch','show','params','intersection','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','getMembers','findOne','UserMailQueue','order','pick','MailQueueId','options','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','MailQueues','destroy','end','error','name'];(function(_0x3e19d0,_0x4bc898){var _0x50e4c8=function(_0xe47b63){while(--_0xe47b63){_0x3e19d0['push'](_0x3e19d0['shift']());}};_0x50e4c8(++_0x4bc898);}(_0x9931,0x184));var _0x1993=function(_0x3af810,_0x590321){_0x3af810=_0x3af810-0x0;var _0x2fb51e=_0x9931[_0x3af810];return _0x2fb51e;};'use strict';var emlformat=require(_0x1993('0x0'));var rimraf=require(_0x1993('0x1'));var zipdir=require(_0x1993('0x2'));var jsonpatch=require(_0x1993('0x3'));var rp=require('request-promise');var moment=require(_0x1993('0x4'));var BPromise=require(_0x1993('0x5'));var Mustache=require(_0x1993('0x6'));var util=require(_0x1993('0x7'));var path=require(_0x1993('0x8'));var sox=require(_0x1993('0x9'));var csv=require(_0x1993('0xa'));var ejs=require(_0x1993('0xb'));var fs=require('fs');var fs_extra=require(_0x1993('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1993('0xd'));var deskjs=require(_0x1993('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1993('0xf'));var Papa=require(_0x1993('0x10'));var Redis=require(_0x1993('0x11'));var authService=require(_0x1993('0x12'));var qs=require(_0x1993('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1993('0x14'));var logger=require(_0x1993('0x15'))(_0x1993('0x16'));var utils=require(_0x1993('0x17'));var config=require(_0x1993('0x18'));var licenseUtil=require(_0x1993('0x19'));var db=require(_0x1993('0x1a'))['db'];config['redis']=_[_0x1993('0x1b')](config[_0x1993('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x1993('0x1d'))(new Redis(config[_0x1993('0x1c')]));require(_0x1993('0x1e'))[_0x1993('0x1f')](socket);function respondWithStatusCode(_0x3be129,_0x2036d4){_0x2036d4=_0x2036d4||0xcc;return function(_0x434866){if(_0x434866){return _0x3be129[_0x1993('0x20')](_0x2036d4);}return _0x3be129[_0x1993('0x21')](_0x2036d4)['end']();};}function respondWithResult(_0x2de5a9,_0x1eb16c){_0x1eb16c=_0x1eb16c||0xc8;return function(_0x18c8b1){if(_0x18c8b1){return _0x2de5a9[_0x1993('0x21')](_0x1eb16c)[_0x1993('0x22')](_0x18c8b1);}};}function respondWithFilteredResult(_0x89a5f5,_0x37e895){return function(_0x3cf578){if(_0x3cf578){var _0x57486f=typeof _0x37e895['offset']===_0x1993('0x23')&&typeof _0x37e895[_0x1993('0x24')]===_0x1993('0x23');var _0x47a918=_0x3cf578['count'];var _0x162c2a=_0x57486f?0x0:_0x37e895[_0x1993('0x25')];var _0x20c698=_0x57486f?_0x3cf578[_0x1993('0x26')]:_0x37e895['offset']+_0x37e895[_0x1993('0x24')];var _0x13583b;if(_0x20c698>=_0x47a918){_0x20c698=_0x47a918;_0x13583b=0xc8;}else{_0x13583b=0xce;}_0x89a5f5[_0x1993('0x21')](_0x13583b);return _0x89a5f5[_0x1993('0x27')](_0x1993('0x28'),_0x162c2a+'-'+_0x20c698+'/'+_0x47a918)['json'](_0x3cf578);}return null;};}function patchUpdates(_0x3b079a){return function(_0x346d5f){try{jsonpatch['apply'](_0x346d5f,_0x3b079a,!![]);}catch(_0x59a594){return BPromise[_0x1993('0x29')](_0x59a594);}return _0x346d5f[_0x1993('0x2a')]();};}function saveUpdates(_0x3dbf39,_0x4e4ba6){return function(_0x235015){if(_0x235015){return _0x235015[_0x1993('0x2b')](_0x3dbf39)['then'](function(_0x58cc22){return _0x58cc22;});}return null;};}function removeEntity(_0x217251,_0x399bb2){return function(_0x3e7c1f){if(_0x3e7c1f){return _0x3e7c1f['destroy']()[_0x1993('0x2c')](function(){var _0x4fc92f=_0x3e7c1f['get']({'plain':!![]});var _0x297d57=_0x1993('0x2d');return db['UserProfileResource'][_0x1993('0x2e')]({'where':{'type':_0x297d57,'resourceId':_0x4fc92f['id']}})[_0x1993('0x2c')](function(){return _0x3e7c1f;});})[_0x1993('0x2c')](function(){_0x217251[_0x1993('0x21')](0xcc)[_0x1993('0x2f')]();});}};}function handleEntityNotFound(_0x563d93,_0x28f111){return function(_0x18003a){if(!_0x18003a){_0x563d93[_0x1993('0x20')](0x194);}return _0x18003a;};}function handleError(_0x39a364,_0x174513){_0x174513=_0x174513||0x1f4;return function(_0x80d974){logger[_0x1993('0x30')](_0x80d974['stack']);if(_0x80d974[_0x1993('0x31')]){delete _0x80d974[_0x1993('0x31')];}_0x39a364['status'](_0x174513)[_0x1993('0x32')](_0x80d974);};}exports[_0x1993('0x33')]=function(_0x586f05,_0x4cf5e5){var _0x30d802={},_0x322f9e={},_0x3860e3={'count':0x0,'rows':[]};var _0x247220=_['map'](db['MailQueue'][_0x1993('0x34')],function(_0x3cc98e){return{'name':_0x3cc98e['fieldName'],'type':_0x3cc98e[_0x1993('0x35')][_0x1993('0x36')]};});_0x322f9e[_0x1993('0x37')]=_[_0x1993('0x38')](_0x247220,_0x1993('0x31'));_0x322f9e['query']=_[_0x1993('0x39')](_0x586f05[_0x1993('0x3a')]);_0x322f9e['filters']=_['intersection'](_0x322f9e[_0x1993('0x37')],_0x322f9e['query']);_0x30d802[_0x1993('0x3b')]=_['intersection'](_0x322f9e[_0x1993('0x37')],qs['fields'](_0x586f05[_0x1993('0x3a')]['fields']));_0x30d802[_0x1993('0x3b')]=_0x30d802[_0x1993('0x3b')][_0x1993('0x3c')]?_0x30d802[_0x1993('0x3b')]:_0x322f9e[_0x1993('0x37')];if(!_0x586f05['query'][_0x1993('0x3d')](_0x1993('0x3e'))){_0x30d802[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x586f05[_0x1993('0x3a')][_0x1993('0x24')]);_0x30d802[_0x1993('0x25')]=qs[_0x1993('0x25')](_0x586f05['query'][_0x1993('0x25')]);}_0x30d802['order']=qs[_0x1993('0x3f')](_0x586f05[_0x1993('0x3a')][_0x1993('0x3f')]);_0x30d802[_0x1993('0x40')]=qs[_0x1993('0x41')](_['pick'](_0x586f05[_0x1993('0x3a')],_0x322f9e[_0x1993('0x41')]),_0x247220);if(_0x586f05['query'][_0x1993('0x42')]){_0x30d802[_0x1993('0x40')]=_[_0x1993('0x43')](_0x30d802[_0x1993('0x40')],{'$or':_[_0x1993('0x38')](_0x247220,function(_0x3a56e3){if(_0x3a56e3[_0x1993('0x35')]!==_0x1993('0x44')){var _0x5fc510={};_0x5fc510[_0x3a56e3[_0x1993('0x31')]]={'$like':'%'+_0x586f05[_0x1993('0x3a')]['filter']+'%'};return _0x5fc510;}})});}_0x30d802=_[_0x1993('0x43')]({},_0x30d802,_0x586f05['options']);var _0x378bcd={'where':_0x30d802[_0x1993('0x40')]};return db[_0x1993('0x45')][_0x1993('0x26')](_0x378bcd)[_0x1993('0x2c')](function(_0x59ae8e){_0x3860e3['count']=_0x59ae8e;if(_0x586f05[_0x1993('0x3a')][_0x1993('0x46')]){_0x30d802[_0x1993('0x47')]=[{'all':!![]}];}return db[_0x1993('0x45')][_0x1993('0x48')](_0x30d802);})['then'](function(_0x2ab3fa){_0x3860e3['rows']=_0x2ab3fa;return _0x3860e3;})[_0x1993('0x2c')](respondWithFilteredResult(_0x4cf5e5,_0x30d802))[_0x1993('0x49')](handleError(_0x4cf5e5,null));};exports[_0x1993('0x4a')]=function(_0x3998e9,_0x405824){var _0x1b1280={'raw':!![],'where':{'id':_0x3998e9[_0x1993('0x4b')]['id']}},_0x4d1322={};_0x4d1322[_0x1993('0x37')]=_[_0x1993('0x39')](db[_0x1993('0x45')][_0x1993('0x34')]);_0x4d1322[_0x1993('0x3a')]=_[_0x1993('0x39')](_0x3998e9['query']);_0x4d1322[_0x1993('0x41')]=_['intersection'](_0x4d1322[_0x1993('0x37')],_0x4d1322[_0x1993('0x3a')]);_0x1b1280['attributes']=_[_0x1993('0x4c')](_0x4d1322['model'],qs[_0x1993('0x4d')](_0x3998e9[_0x1993('0x3a')][_0x1993('0x4d')]));_0x1b1280[_0x1993('0x3b')]=_0x1b1280[_0x1993('0x3b')][_0x1993('0x3c')]?_0x1b1280[_0x1993('0x3b')]:_0x4d1322[_0x1993('0x37')];if(_0x3998e9[_0x1993('0x3a')][_0x1993('0x46')]){_0x1b1280[_0x1993('0x47')]=[{'all':!![]}];}_0x1b1280=_[_0x1993('0x43')]({},_0x1b1280,_0x3998e9['options']);return db[_0x1993('0x45')][_0x1993('0x4e')](_0x1b1280)[_0x1993('0x2c')](handleEntityNotFound(_0x405824,null))['then'](respondWithResult(_0x405824,null))[_0x1993('0x49')](handleError(_0x405824,null));};exports[_0x1993('0x4f')]=function(_0x12e870,_0x3501fd){return db[_0x1993('0x45')]['create'](_0x12e870[_0x1993('0x50')],{})[_0x1993('0x2c')](function(_0x52f796){var _0x19b13d=_0x12e870['user'][_0x1993('0x51')]({'plain':!![]});if(!_0x19b13d)throw new Error(_0x1993('0x52'));if(_0x19b13d[_0x1993('0x53')]===_0x1993('0x54')){var _0x3e816f=_0x52f796['get']({'plain':!![]});var _0x4bb30a=_0x1993('0x2d');return db[_0x1993('0x55')][_0x1993('0x4e')]({'where':{'name':_0x4bb30a,'userProfileId':_0x19b13d[_0x1993('0x56')]},'raw':!![]})[_0x1993('0x2c')](function(_0x38b33b){if(_0x38b33b&&_0x38b33b[_0x1993('0x57')]===0x0){return db[_0x1993('0x58')][_0x1993('0x4f')]({'name':_0x3e816f[_0x1993('0x31')],'resourceId':_0x3e816f['id'],'type':_0x38b33b['name'],'sectionId':_0x38b33b['id']},{})[_0x1993('0x2c')](function(){return _0x52f796;});}else{return _0x52f796;}})['catch'](function(_0x436fba){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x436fba);throw _0x436fba;});}return _0x52f796;})[_0x1993('0x2c')](respondWithResult(_0x3501fd,0xc9))[_0x1993('0x49')](handleError(_0x3501fd,null));};exports['update']=function(_0x4e287b,_0x142e88){if(_0x4e287b[_0x1993('0x50')]['id']){delete _0x4e287b[_0x1993('0x50')]['id'];}return db['MailQueue'][_0x1993('0x4e')]({'where':{'id':_0x4e287b[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x142e88,null))[_0x1993('0x2c')](saveUpdates(_0x4e287b[_0x1993('0x50')],null))[_0x1993('0x2c')](respondWithResult(_0x142e88,null))[_0x1993('0x49')](handleError(_0x142e88,null));};exports[_0x1993('0x2e')]=function(_0x25ffa2,_0x3b7668){return db[_0x1993('0x45')][_0x1993('0x4e')]({'where':{'id':_0x25ffa2['params']['id']}})['then'](handleEntityNotFound(_0x3b7668,null))['then'](removeEntity(_0x3b7668,null))['catch'](handleError(_0x3b7668,null));};exports['describe']=function(_0x342ac6,_0x5be9ea){return db[_0x1993('0x45')]['describe']()[_0x1993('0x2c')](respondWithResult(_0x5be9ea,null))[_0x1993('0x49')](handleError(_0x5be9ea,null));};exports[_0x1993('0x59')]=function(_0x21e90a,_0x426641,_0x2f72f4){var _0x32f9c7={'raw':!![],'where':{}},_0x36835={},_0x15ce78;return db[_0x1993('0x45')][_0x1993('0x5a')]({'where':{'id':_0x21e90a[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x426641,null))[_0x1993('0x2c')](function(_0x54b1ed){if(_0x54b1ed){_0x15ce78=_0x54b1ed[_0x1993('0x51')]({'plain':!![]});_0x36835[_0x1993('0x37')]=_[_0x1993('0x39')](db[_0x1993('0x5b')][_0x1993('0x34')]);_0x36835[_0x1993('0x3a')]=_[_0x1993('0x39')](_0x21e90a[_0x1993('0x3a')]);_0x36835['filters']=_['intersection'](_0x36835['model'],_0x36835[_0x1993('0x3a')]);_0x32f9c7['attributes']=_[_0x1993('0x4c')](_0x36835[_0x1993('0x37')],qs['fields'](_0x21e90a[_0x1993('0x3a')]['fields']));_0x32f9c7[_0x1993('0x3b')]=_0x32f9c7[_0x1993('0x3b')]['length']?_0x32f9c7[_0x1993('0x3b')]:_0x36835['model'];if(!_0x21e90a[_0x1993('0x3a')][_0x1993('0x3d')](_0x1993('0x3e'))){_0x32f9c7['limit']=qs[_0x1993('0x24')](_0x21e90a[_0x1993('0x3a')]['limit']);_0x32f9c7[_0x1993('0x25')]=qs['offset'](_0x21e90a[_0x1993('0x3a')][_0x1993('0x25')]);}_0x32f9c7[_0x1993('0x5c')]=qs[_0x1993('0x3f')](_0x21e90a[_0x1993('0x3a')][_0x1993('0x3f')]);_0x32f9c7['where']=qs[_0x1993('0x41')](_[_0x1993('0x5d')](_0x21e90a['query'],_0x36835[_0x1993('0x41')]));_0x32f9c7[_0x1993('0x40')][_0x1993('0x5e')]=_0x54b1ed['id'];if(_0x21e90a[_0x1993('0x3a')][_0x1993('0x42')]){_0x32f9c7[_0x1993('0x40')]=_[_0x1993('0x43')](_0x32f9c7[_0x1993('0x40')],{'$or':_['map'](_0x32f9c7['attributes'],function(_0x4b6039){var _0x3cebca={};_0x3cebca[_0x4b6039]={'$like':'%'+_0x21e90a[_0x1993('0x3a')][_0x1993('0x42')]+'%'};return _0x3cebca;})});}_0x32f9c7=_[_0x1993('0x43')]({},_0x32f9c7,_0x21e90a[_0x1993('0x5f')]);return db[_0x1993('0x5b')][_0x1993('0x48')](_0x32f9c7);}})[_0x1993('0x2c')](function(_0x8f1d2b){if(_0x8f1d2b){return db[_0x1993('0x60')][_0x1993('0x61')]({'where':{'id':_[_0x1993('0x38')](_0x8f1d2b,_0x1993('0x62')),'role':_0x1993('0x63')},'attributes':['id',_0x1993('0x31'),_0x1993('0x64'),_0x1993('0x65'),_0x1993('0x66')]});}})[_0x1993('0x2c')](function(_0x5ab27b){if(_0x5ab27b){return{'count':_0x5ab27b[_0x1993('0x26')],'rows':_[_0x1993('0x38')](_0x5ab27b['rows'],function(_0x32966d){return{'membername':_0x32966d[_0x1993('0x31')],'UserId':_0x32966d['id'],'queue_name':_0x15ce78[_0x1993('0x31')],'MailQueueId':_0x15ce78['id'],'interface':util[_0x1993('0x67')](_0x1993('0x68'),'SIP',_0x32966d[_0x1993('0x31')]),'penalty':0x0,'paused':_0x32966d['mailPause'],'createdAt':_0x32966d[_0x1993('0x66')],'updatedAt':_0x32966d[_0x1993('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1993('0x2c')](respondWithFilteredResult(_0x426641,_0x32f9c7))['catch'](handleError(_0x426641,null));};exports[_0x1993('0x69')]=function(_0x4c4e22,_0x266930,_0x40318d){var _0x2ea0e6={};var _0x227443={};var _0x323d36;var _0x381ceb;return db[_0x1993('0x45')]['findOne']({'where':{'id':_0x4c4e22[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x266930,null))['then'](function(_0x1e27b2){if(_0x1e27b2){_0x323d36=_0x1e27b2;_0x227443[_0x1993('0x37')]=_['keys'](db[_0x1993('0x6a')]['rawAttributes']);_0x227443[_0x1993('0x3a')]=_[_0x1993('0x39')](_0x4c4e22['query']);_0x227443[_0x1993('0x41')]=_[_0x1993('0x4c')](_0x227443[_0x1993('0x37')],_0x227443['query']);_0x2ea0e6[_0x1993('0x3b')]=_[_0x1993('0x4c')](_0x227443['model'],qs['fields'](_0x4c4e22['query'][_0x1993('0x4d')]));_0x2ea0e6[_0x1993('0x3b')]=_0x2ea0e6['attributes']['length']?_0x2ea0e6[_0x1993('0x3b')]:_0x227443[_0x1993('0x37')];_0x2ea0e6[_0x1993('0x5c')]=qs[_0x1993('0x3f')](_0x4c4e22[_0x1993('0x3a')]['sort']);_0x2ea0e6[_0x1993('0x40')]=qs[_0x1993('0x41')](_[_0x1993('0x5d')](_0x4c4e22[_0x1993('0x3a')],_0x227443[_0x1993('0x41')]));if(_0x4c4e22[_0x1993('0x3a')][_0x1993('0x42')]){_0x2ea0e6[_0x1993('0x40')]=_[_0x1993('0x43')](_0x2ea0e6[_0x1993('0x40')],{'$or':_[_0x1993('0x38')](_0x2ea0e6[_0x1993('0x3b')],function(_0x413d42){var _0x43ef93={};_0x43ef93[_0x413d42]={'$like':'%'+_0x4c4e22[_0x1993('0x3a')][_0x1993('0x42')]+'%'};return _0x43ef93;})});}_0x2ea0e6=_[_0x1993('0x43')]({},_0x2ea0e6,_0x4c4e22[_0x1993('0x5f')]);return _0x323d36[_0x1993('0x69')](_0x2ea0e6);}})[_0x1993('0x2c')](function(_0xe930d4){if(_0xe930d4){_0x381ceb=_0xe930d4[_0x1993('0x3c')];if(!_0x4c4e22[_0x1993('0x3a')][_0x1993('0x3d')](_0x1993('0x3e'))){_0x2ea0e6[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x4c4e22[_0x1993('0x3a')][_0x1993('0x24')]);_0x2ea0e6[_0x1993('0x25')]=qs[_0x1993('0x25')](_0x4c4e22[_0x1993('0x3a')]['offset']);}return _0x323d36[_0x1993('0x69')](_0x2ea0e6);}})[_0x1993('0x2c')](function(_0x2d1aed){if(_0x2d1aed){return _0x2d1aed?{'count':_0x381ceb,'rows':_0x2d1aed}:null;}})[_0x1993('0x2c')](respondWithResult(_0x266930,null))[_0x1993('0x49')](handleError(_0x266930,null));};exports[_0x1993('0x6b')]=function(_0x21fce2,_0x559757,_0x5cc8b9){var _0x1f60aa=_0x21fce2[_0x1993('0x50')]['ids'];return db[_0x1993('0x6a')][_0x1993('0x48')]({'where':{'id':_0x1f60aa},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1993('0x31'),_0x1993('0x6c'),_0x1993('0x6d'),'interface'],'raw':!![]}]})['then'](function(_0x29427d){if(_0x29427d){var _0x5ca53b=_[_0x1993('0x6e')](_0x29427d,function(_0x483742){var _0x5548ca=_0x483742['get']({'plain':!![]});return _0x5548ca[_0x1993('0x6f')];});return db['MailQueue'][_0x1993('0x4e')]({'where':{'id':_0x21fce2[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](function(_0x2767ab){return db[_0x1993('0x70')][_0x1993('0x71')](function(_0xf9bb0){return _0x2767ab['addTeams'](_0x1f60aa,{'transaction':_0xf9bb0})['then'](function(){return BPromise[_0x1993('0x72')](_0x5ca53b,function(_0x5deb6b){return db[_0x1993('0x5b')][_0x1993('0x73')]({'where':{'UserId':_0x5deb6b['id'],'MailQueueId':_0x21fce2[_0x1993('0x4b')]['id']},'transaction':_0xf9bb0});});})['then'](function(){_0x5ca53b['forEach'](function(_0x32fcc4){socket['emit'](_0x1993('0x74'),{'UserId':_0x32fcc4['id'],'MailQueueId':_0x2767ab['id']});});});});});}})['then'](respondWithStatusCode(_0x559757,null))['catch'](handleError(_0x559757,null));};exports[_0x1993('0x75')]=function(_0x433e76,_0x23d528,_0x53bc3c){return db['Team'][_0x1993('0x48')]({'where':{'id':_0x433e76[_0x1993('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1993('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1993('0x2c')](handleEntityNotFound(_0x23d528,null))['then'](function(_0x5c3377){var _0xffdf3d=_[_0x1993('0x38')](_0x5c3377,'id');var _0x2ed268=[];var _0x3676fd=[];var _0x407c9f=squel['select']();_0x407c9f[_0x1993('0x76')](_0x1993('0x77'))[_0x1993('0x78')](_0x1993('0x79'),'tq')[_0x1993('0x7a')](_0x1993('0x7b'),'ut',_0x1993('0x7c'))[_0x1993('0x40')](_0x1993('0x7d'),_0x433e76['params']['id']);for(var _0xb753ea=0x0;_0xb753ea<_0x5c3377[_0x1993('0x3c')];_0xb753ea+=0x1){let _0x14c9bb=_0x5c3377[_0xb753ea];for(var _0x533a71=0x0;_0x533a71<_0x14c9bb['Agents'][_0x1993('0x3c')];_0x533a71+=0x1){let _0x430d99=_0x14c9bb[_0x1993('0x6f')][_0x533a71];var _0x1388fc=_0x407c9f['clone']();_0x1388fc[_0x1993('0x40')](_0x1993('0x7e'),_0x430d99['id']);_0x3676fd['push'](db['sequelize'][_0x1993('0x3a')](_0x1388fc[_0x1993('0x7f')](),{'type':db['sequelize'][_0x1993('0x80')]['SELECT']})[_0x1993('0x2c')](function(_0x3014cc){if(_0x3014cc[_0x1993('0x3c')]===0x1){return _0x430d99['id'];}else{var _0x77bf53=_[_0x1993('0x81')](_[_0x1993('0x38')](_0x3014cc,_0x1993('0x82')),function(_0x24af9c){return _[_0x1993('0x83')](_0xffdf3d,_0x24af9c);});if(_0x77bf53){return _0x430d99['id'];}}}));}}return BPromise[_0x1993('0x84')](_0x3676fd)[_0x1993('0x2c')](function(_0x26dc78){_0x2ed268=_(_0x2ed268)[_0x1993('0x85')](_0x26dc78)[_0x1993('0x86')]()['value']();return db[_0x1993('0x45')][_0x1993('0x4e')]({'where':{'id':_0x433e76[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](function(_0x3d259e){return db[_0x1993('0x70')][_0x1993('0x71')](function(_0x8a93c3){return _0x3d259e[_0x1993('0x75')](_0x433e76['query'][_0x1993('0x87')],{'transaction':_0x8a93c3})[_0x1993('0x2c')](function(){if(!_[_0x1993('0x88')](_0x2ed268)){return _0x3d259e[_0x1993('0x89')](_0x2ed268,{'transaction':_0x8a93c3});}})[_0x1993('0x2c')](function(){_0x2ed268[_0x1993('0x8a')](function(_0x1528f5){socket[_0x1993('0x8b')](_0x1993('0x8c'),{'UserId':_0x1528f5,'MailQueueId':_0x3d259e['id']});});});});});});})['then'](respondWithStatusCode(_0x23d528,null))[_0x1993('0x49')](handleError(_0x23d528,null));};exports['addAgents']=function(_0x5b4c21,_0xe7a2ab,_0x4a8d96){return db[_0x1993('0x45')][_0x1993('0x4e')]({'where':{'id':_0x5b4c21[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0xe7a2ab,null))[_0x1993('0x2c')](function(_0x315d2e){if(_0x315d2e){return _0x315d2e[_0x1993('0x8d')](_0x5b4c21[_0x1993('0x50')][_0x1993('0x87')],_[_0x1993('0x8e')](_0x5b4c21['body'],[_0x1993('0x87'),'id'])||{})[_0x1993('0x8f')](function(_0x91f07e){for(var _0x4ee1fa=0x0;_0x4ee1fa<_0x5b4c21[_0x1993('0x50')][_0x1993('0x87')][_0x1993('0x3c')];_0x4ee1fa+=0x1){socket[_0x1993('0x8b')](_0x1993('0x74'),{'UserId':_0x5b4c21[_0x1993('0x50')]['ids'][_0x4ee1fa],'MailQueueId':_0x5b4c21[_0x1993('0x4b')]['id']});}return _0x91f07e;});}})[_0x1993('0x2c')](respondWithResult(_0xe7a2ab,null))[_0x1993('0x49')](handleError(_0xe7a2ab,null));};exports[_0x1993('0x89')]=function(_0x747109,_0xe56530,_0x126755){return db[_0x1993('0x45')]['find']({'where':{'id':_0x747109[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0xe56530,null))[_0x1993('0x2c')](function(_0x5e6727){if(_0x5e6727){return _0x5e6727['removeAgents'](_0x747109[_0x1993('0x3a')][_0x1993('0x87')])['then'](function(){if(_[_0x1993('0x90')](_0x747109[_0x1993('0x3a')][_0x1993('0x87')])){for(var _0x14b055=0x0;_0x14b055<_0x747109[_0x1993('0x3a')][_0x1993('0x87')][_0x1993('0x3c')];_0x14b055+=0x1){socket[_0x1993('0x8b')](_0x1993('0x8c'),{'UserId':Number(_0x747109['query'][_0x1993('0x87')][_0x14b055]),'MailQueueId':Number(_0x747109[_0x1993('0x4b')]['id'])});}}else{socket[_0x1993('0x8b')](_0x1993('0x8c'),{'UserId':Number(_0x747109[_0x1993('0x3a')][_0x1993('0x87')]),'MailQueueId':Number(_0x747109[_0x1993('0x4b')]['id'])});}});}})[_0x1993('0x2c')](respondWithStatusCode(_0xe56530,null))[_0x1993('0x49')](handleError(_0xe56530,null));};exports['getAgents']=function(_0x47d299,_0x41397b,_0x4dedea){var _0x5a1a81={};var _0x38a9bb={};var _0x5e526e;var _0x3c0bdf;return db[_0x1993('0x45')][_0x1993('0x5a')]({'where':{'id':_0x47d299[_0x1993('0x4b')]['id']}})[_0x1993('0x2c')](handleEntityNotFound(_0x41397b,null))[_0x1993('0x2c')](function(_0x5cb24f){if(_0x5cb24f){_0x5e526e=_0x5cb24f;_0x38a9bb[_0x1993('0x37')]=_[_0x1993('0x39')](db[_0x1993('0x60')][_0x1993('0x34')]);_0x38a9bb['query']=_[_0x1993('0x39')](_0x47d299['query']);_0x38a9bb[_0x1993('0x41')]=_['intersection'](_0x38a9bb[_0x1993('0x37')],_0x38a9bb[_0x1993('0x3a')]);_0x5a1a81['attributes']=_['intersection'](_0x38a9bb['model'],qs['fields'](_0x47d299[_0x1993('0x3a')][_0x1993('0x4d')]));_0x5a1a81[_0x1993('0x3b')]=_0x5a1a81['attributes'][_0x1993('0x3c')]?_0x5a1a81[_0x1993('0x3b')]:_0x38a9bb[_0x1993('0x37')];_0x5a1a81[_0x1993('0x5c')]=qs['sort'](_0x47d299['query'][_0x1993('0x3f')]);_0x5a1a81[_0x1993('0x40')]=qs[_0x1993('0x41')](_[_0x1993('0x5d')](_0x47d299['query'],_0x38a9bb[_0x1993('0x41')]));if(_0x47d299[_0x1993('0x3a')][_0x1993('0x42')]){_0x5a1a81[_0x1993('0x40')]=_['merge'](_0x5a1a81[_0x1993('0x40')],{'$or':_['map'](_0x5a1a81[_0x1993('0x3b')],function(_0x50e11d){var _0x156d97={};_0x156d97[_0x50e11d]={'$like':'%'+_0x47d299['query'][_0x1993('0x42')]+'%'};return _0x156d97;})});}_0x5a1a81=_[_0x1993('0x43')]({},_0x5a1a81,_0x47d299['options']);return _0x5e526e[_0x1993('0x91')](_0x5a1a81);}})['then'](function(_0x1b132c){if(_0x1b132c){_0x3c0bdf=_0x1b132c[_0x1993('0x3c')];if(!_0x47d299[_0x1993('0x3a')][_0x1993('0x3d')](_0x1993('0x3e'))){_0x5a1a81[_0x1993('0x24')]=qs[_0x1993('0x24')](_0x47d299[_0x1993('0x3a')][_0x1993('0x24')]);_0x5a1a81['offset']=qs[_0x1993('0x25')](_0x47d299['query']['offset']);}return _0x5e526e['getAgents'](_0x5a1a81);}})[_0x1993('0x2c')](function(_0x490c70){if(_0x490c70){return _0x490c70?{'count':_0x3c0bdf,'rows':_0x490c70}:null;}})[_0x1993('0x2c')](respondWithResult(_0x41397b,null))[_0x1993('0x49')](handleError(_0x41397b,null));};
\ No newline at end of file
index d8d2b1e..edbb974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ab4=['exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x7ab4,0x109));var _0x47ab=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0x7ab4[_0x24697b];return _0x585b99;};'use strict';var EventEmitter=require(_0x47ab('0x0'));var MailQueue=require(_0x47ab('0x1'))['db'][_0x47ab('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x47ab('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x47ab('0x4')};function emitEvent(_0x1e1681){return function(_0x2f5cc8,_0x3f2f21,_0x30b934){MailQueueEvents['emit'](_0x1e1681+':'+_0x2f5cc8['id'],_0x2f5cc8);MailQueueEvents[_0x47ab('0x5')](_0x1e1681,_0x2f5cc8);_0x30b934(null);};}for(var e in events){if(events[_0x47ab('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x47ab('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0xd671=['setMaxListeners','update','remove','emit','hook','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd671,0x7e));var _0x1d67=function(_0x340d75,_0x561cb0){_0x340d75=_0x340d75-0x0;var _0x3f1114=_0xd671[_0x340d75];return _0x3f1114;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1d67('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1d67('0x1'),'afterDestroy':_0x1d67('0x2')};function emitEvent(_0x3dba34){return function(_0xc1d125,_0x5af6d3,_0x274565){MailQueueEvents[_0x1d67('0x3')](_0x3dba34+':'+_0xc1d125['id'],_0xc1d125);MailQueueEvents[_0x1d67('0x3')](_0x3dba34,_0xc1d125);_0x274565(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x1d67('0x4')](e,emitEvent(event));}}module[_0x1d67('0x5')]=MailQueueEvents;
\ No newline at end of file
index 8dfcdde..9881a17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc32=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment'];(function(_0x392319,_0x17ff41){var _0x3c57b9=function(_0x4af72b){while(--_0x4af72b){_0x392319['push'](_0x392319['shift']());}};_0x3c57b9(++_0x17ff41);}(_0xfc32,0xdb));var _0x2fc3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfc32[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x2fc3('0x0'));var util=require(_0x2fc3('0x1'));var logger=require(_0x2fc3('0x2'))(_0x2fc3('0x3'));var moment=require(_0x2fc3('0x4'));var BPromise=require(_0x2fc3('0x5'));var rp=require(_0x2fc3('0x6'));var fs=require('fs');var path=require(_0x2fc3('0x7'));var rimraf=require(_0x2fc3('0x8'));var config=require(_0x2fc3('0x9'));var attributes=require(_0x2fc3('0xa'));module[_0x2fc3('0xb')]=function(_0x3910a3,_0x4a8a65){return _0x3910a3['define'](_0x2fc3('0xc'),attributes,{'tableName':_0x2fc3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3ef=['api','moment','request-promise','path','rimraf','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger'];(function(_0x27d621,_0x1b4ab0){var _0x1911b7=function(_0x4aee3c){while(--_0x4aee3c){_0x27d621['push'](_0x27d621['shift']());}};_0x1911b7(++_0x1b4ab0);}(_0xf3ef,0x111));var _0xff3e=function(_0x37ad1c,_0x247bd6){_0x37ad1c=_0x37ad1c-0x0;var _0xedeefb=_0xf3ef[_0x37ad1c];return _0xedeefb;};'use strict';var _=require(_0xff3e('0x0'));var util=require(_0xff3e('0x1'));var logger=require(_0xff3e('0x2'))(_0xff3e('0x3'));var moment=require(_0xff3e('0x4'));var BPromise=require('bluebird');var rp=require(_0xff3e('0x5'));var fs=require('fs');var path=require(_0xff3e('0x6'));var rimraf=require(_0xff3e('0x7'));var config=require('../../config/environment');var attributes=require(_0xff3e('0x8'));module['exports']=function(_0x5e19ff,_0x514804){return _0x5e19ff[_0xff3e('0x9')](_0xff3e('0xa'),attributes,{'tableName':_0xff3e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91615ca..322278d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a59=['request\x20sent','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','debug'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x2a59,0x13a));var _0x92a5=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x2a59[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x92a5('0x0'));var util=require(_0x92a5('0x1'));var moment=require(_0x92a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x92a5('0x3'));var fs=require('fs');var Redis=require(_0x92a5('0x4'));var db=require(_0x92a5('0x5'))['db'];var utils=require(_0x92a5('0x6'));var logger=require(_0x92a5('0x7'))('rpc');var config=require(_0x92a5('0x8'));var jayson=require(_0x92a5('0x9'));var client=jayson['client'][_0x92a5('0xa')]({'port':0x232a});config['redis']=_[_0x92a5('0xb')](config['redis'],{'host':_0x92a5('0xc'),'port':0x18eb});var socket=require(_0x92a5('0xd'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x92a5('0xe')](socket);function respondWithRpcPromise(_0x2170fb,_0x23df5c,_0x32c636){return new BPromise(function(_0x151bf7,_0x1940f6){return client['request'](_0x2170fb,_0x32c636)[_0x92a5('0xf')](function(_0x1adadc){logger[_0x92a5('0x10')](_0x92a5('0x11'),_0x23df5c,'request\x20sent');logger[_0x92a5('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x23df5c,_0x92a5('0x13'),JSON[_0x92a5('0x14')](_0x1adadc));if(_0x1adadc[_0x92a5('0x15')]){if(_0x1adadc[_0x92a5('0x15')]['code']===0x1f4){logger[_0x92a5('0x15')](_0x92a5('0x11'),_0x23df5c,_0x1adadc[_0x92a5('0x15')][_0x92a5('0x16')]);return _0x1940f6(_0x1adadc['error']['message']);}logger[_0x92a5('0x15')](_0x92a5('0x11'),_0x23df5c,_0x1adadc[_0x92a5('0x15')][_0x92a5('0x16')]);return _0x151bf7(_0x1adadc[_0x92a5('0x15')][_0x92a5('0x16')]);}else{logger[_0x92a5('0x10')]('MailQueue,\x20%s,\x20%s',_0x23df5c,'request\x20sent');_0x151bf7(_0x1adadc[_0x92a5('0x17')]['message']);}})[_0x92a5('0x18')](function(_0x283197){logger[_0x92a5('0x15')](_0x92a5('0x11'),_0x23df5c,_0x283197);_0x1940f6(_0x283197);});});}exports[_0x92a5('0x19')]=function(_0x2527ea){var _0x34b64e=this;return new Promise(function(_0x52cd8f,_0x3cb887){return db[_0x92a5('0x1a')]['findAll']({'raw':_0x2527ea[_0x92a5('0x1b')]?_0x2527ea[_0x92a5('0x1b')][_0x92a5('0x1c')]===undefined?!![]:![]:!![],'where':_0x2527ea[_0x92a5('0x1b')]?_0x2527ea[_0x92a5('0x1b')][_0x92a5('0x1d')]||null:null,'attributes':_0x2527ea[_0x92a5('0x1b')]?_0x2527ea['options'][_0x92a5('0x1e')]||null:null,'limit':_0x2527ea[_0x92a5('0x1b')]?_0x2527ea[_0x92a5('0x1b')][_0x92a5('0x1f')]||null:null,'include':_0x2527ea['options']?_0x2527ea[_0x92a5('0x1b')][_0x92a5('0x20')]?_[_0x92a5('0x21')](_0x2527ea[_0x92a5('0x1b')][_0x92a5('0x20')],function(_0x274f39){return{'model':db[_0x274f39[_0x92a5('0x22')]],'as':_0x274f39['as'],'attributes':_0x274f39[_0x92a5('0x1e')],'include':_0x274f39[_0x92a5('0x20')]?_[_0x92a5('0x21')](_0x274f39['include'],function(_0x53e68d){return{'model':db[_0x53e68d[_0x92a5('0x22')]],'as':_0x53e68d['as'],'attributes':_0x53e68d['attributes'],'include':_0x53e68d[_0x92a5('0x20')]?_[_0x92a5('0x21')](_0x53e68d[_0x92a5('0x20')],function(_0x10055d){return{'model':db[_0x10055d['model']],'as':_0x10055d['as'],'attributes':_0x10055d['attributes']};}):[]};}):[]};}):[]:[]})[_0x92a5('0xf')](function(_0x5f0f0f){logger['info']('GetMailQueue',_0x2527ea);logger[_0x92a5('0x12')](_0x92a5('0x19'),_0x2527ea,JSON[_0x92a5('0x14')](_0x5f0f0f));_0x52cd8f(_0x5f0f0f);})[_0x92a5('0x18')](function(_0x23c971){logger[_0x92a5('0x15')](_0x92a5('0x19'),_0x23c971[_0x92a5('0x16')],_0x2527ea);_0x3cb887(_0x34b64e[_0x92a5('0x15')](0x1f4,_0x23c971[_0x92a5('0x16')]));});});};exports[_0x92a5('0x23')]=function(_0x271349){var _0x1e48a6=this;return new Promise(function(_0x2ebe4a,_0x5ae104){return db[_0x92a5('0x1a')][_0x92a5('0x24')]({'raw':_0x271349[_0x92a5('0x1b')]?_0x271349[_0x92a5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x271349[_0x92a5('0x1b')]?_0x271349[_0x92a5('0x1b')][_0x92a5('0x1d')]||null:null,'attributes':_0x271349[_0x92a5('0x1b')]?_0x271349['options'][_0x92a5('0x1e')]||null:null,'include':_0x271349[_0x92a5('0x1b')]?_0x271349[_0x92a5('0x1b')][_0x92a5('0x20')]?_[_0x92a5('0x21')](_0x271349['options']['include'],function(_0x58b755){return{'model':db[_0x58b755[_0x92a5('0x22')]],'as':_0x58b755['as'],'attributes':_0x58b755['attributes'],'include':_0x58b755['include']?_[_0x92a5('0x21')](_0x58b755[_0x92a5('0x20')],function(_0x3afdfe){return{'model':db[_0x3afdfe[_0x92a5('0x22')]],'as':_0x3afdfe['as'],'attributes':_0x3afdfe[_0x92a5('0x1e')],'include':_0x3afdfe[_0x92a5('0x20')]?_[_0x92a5('0x21')](_0x3afdfe['include'],function(_0x25d804){return{'model':db[_0x25d804[_0x92a5('0x22')]],'as':_0x25d804['as'],'attributes':_0x25d804[_0x92a5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x92a5('0xf')](function(_0x557524){logger['info'](_0x92a5('0x23'),_0x271349);logger[_0x92a5('0x12')](_0x92a5('0x23'),_0x271349,JSON[_0x92a5('0x14')](_0x557524));_0x2ebe4a(_0x557524);})['catch'](function(_0x44ae3e){logger[_0x92a5('0x15')](_0x92a5('0x23'),_0x44ae3e['message'],_0x271349);_0x5ae104(_0x1e48a6[_0x92a5('0x15')](0x1f4,_0x44ae3e['message']));});});};
\ No newline at end of file
+var _0xb50c=['GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','model','map','then','catch','find','ShowMailQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailQueue.socket','request','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2952c6,_0x5d10f7){var _0x4680e8=function(_0x41dae8){while(--_0x41dae8){_0x2952c6['push'](_0x2952c6['shift']());}};_0x4680e8(++_0x5d10f7);}(_0xb50c,0x1bb));var _0xcb50=function(_0x280861,_0x17e5fc){_0x280861=_0x280861-0x0;var _0x22256a=_0xb50c[_0x280861];return _0x22256a;};'use strict';var _=require(_0xcb50('0x0'));var util=require(_0xcb50('0x1'));var moment=require(_0xcb50('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb50('0x3'));var db=require(_0xcb50('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb50('0x5'))(_0xcb50('0x6'));var config=require(_0xcb50('0x7'));var jayson=require(_0xcb50('0x8'));var client=jayson[_0xcb50('0x9')]['http']({'port':0x232a});config['redis']=_[_0xcb50('0xa')](config[_0xcb50('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcb50('0xc'))(new Redis(config[_0xcb50('0xb')]));require(_0xcb50('0xd'))['register'](socket);function respondWithRpcPromise(_0x23fa92,_0x424b04,_0x429f13){return new BPromise(function(_0x247751,_0x40dab0){return client[_0xcb50('0xe')](_0x23fa92,_0x429f13)['then'](function(_0x5b8d82){logger[_0xcb50('0xf')](_0xcb50('0x10'),_0x424b04,'request\x20sent');logger[_0xcb50('0x11')](_0xcb50('0x12'),_0x424b04,_0xcb50('0x13'),JSON[_0xcb50('0x14')](_0x5b8d82));if(_0x5b8d82['error']){if(_0x5b8d82[_0xcb50('0x15')][_0xcb50('0x16')]===0x1f4){logger[_0xcb50('0x15')](_0xcb50('0x10'),_0x424b04,_0x5b8d82[_0xcb50('0x15')][_0xcb50('0x17')]);return _0x40dab0(_0x5b8d82[_0xcb50('0x15')]['message']);}logger[_0xcb50('0x15')](_0xcb50('0x10'),_0x424b04,_0x5b8d82['error'][_0xcb50('0x17')]);return _0x247751(_0x5b8d82[_0xcb50('0x15')][_0xcb50('0x17')]);}else{logger[_0xcb50('0xf')](_0xcb50('0x10'),_0x424b04,_0xcb50('0x13'));_0x247751(_0x5b8d82[_0xcb50('0x18')]['message']);}})['catch'](function(_0x338073){logger['error']('MailQueue,\x20%s,\x20%s',_0x424b04,_0x338073);_0x40dab0(_0x338073);});});}exports[_0xcb50('0x19')]=function(_0x32da1a){var _0x4268d9=this;return new Promise(function(_0xc87508,_0x37cb27){return db[_0xcb50('0x1a')][_0xcb50('0x1b')]({'raw':_0x32da1a['options']?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x1d')]===undefined?!![]:![]:!![],'where':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x1e')]||null:null,'attributes':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x1f')]||null:null,'limit':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a['options']['limit']||null:null,'include':_0x32da1a[_0xcb50('0x1c')]?_0x32da1a[_0xcb50('0x1c')][_0xcb50('0x20')]?_['map'](_0x32da1a['options'][_0xcb50('0x20')],function(_0x151405){return{'model':db[_0x151405[_0xcb50('0x21')]],'as':_0x151405['as'],'attributes':_0x151405[_0xcb50('0x1f')],'include':_0x151405[_0xcb50('0x20')]?_[_0xcb50('0x22')](_0x151405[_0xcb50('0x20')],function(_0x5ae74c){return{'model':db[_0x5ae74c['model']],'as':_0x5ae74c['as'],'attributes':_0x5ae74c[_0xcb50('0x1f')],'include':_0x5ae74c[_0xcb50('0x20')]?_['map'](_0x5ae74c[_0xcb50('0x20')],function(_0x59a979){return{'model':db[_0x59a979['model']],'as':_0x59a979['as'],'attributes':_0x59a979['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb50('0x23')](function(_0x3274ec){logger[_0xcb50('0xf')]('GetMailQueue',_0x32da1a);logger[_0xcb50('0x11')]('GetMailQueue',_0x32da1a,JSON[_0xcb50('0x14')](_0x3274ec));_0xc87508(_0x3274ec);})[_0xcb50('0x24')](function(_0x254bb7){logger[_0xcb50('0x15')](_0xcb50('0x19'),_0x254bb7['message'],_0x32da1a);_0x37cb27(_0x4268d9['error'](0x1f4,_0x254bb7['message']));});});};exports['ShowMailQueue']=function(_0x571e43){var _0x3c398d=this;return new Promise(function(_0x527a70,_0x467293){return db[_0xcb50('0x1a')][_0xcb50('0x25')]({'raw':_0x571e43['options']?_0x571e43[_0xcb50('0x1c')][_0xcb50('0x1d')]===undefined?!![]:![]:!![],'where':_0x571e43['options']?_0x571e43[_0xcb50('0x1c')][_0xcb50('0x1e')]||null:null,'attributes':_0x571e43[_0xcb50('0x1c')]?_0x571e43['options'][_0xcb50('0x1f')]||null:null,'include':_0x571e43[_0xcb50('0x1c')]?_0x571e43['options'][_0xcb50('0x20')]?_[_0xcb50('0x22')](_0x571e43[_0xcb50('0x1c')]['include'],function(_0x5e963e){return{'model':db[_0x5e963e[_0xcb50('0x21')]],'as':_0x5e963e['as'],'attributes':_0x5e963e['attributes'],'include':_0x5e963e[_0xcb50('0x20')]?_[_0xcb50('0x22')](_0x5e963e[_0xcb50('0x20')],function(_0xfdff22){return{'model':db[_0xfdff22[_0xcb50('0x21')]],'as':_0xfdff22['as'],'attributes':_0xfdff22['attributes'],'include':_0xfdff22[_0xcb50('0x20')]?_[_0xcb50('0x22')](_0xfdff22['include'],function(_0x317bd1){return{'model':db[_0x317bd1['model']],'as':_0x317bd1['as'],'attributes':_0x317bd1[_0xcb50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcb50('0x23')](function(_0x1ea722){logger[_0xcb50('0xf')](_0xcb50('0x26'),_0x571e43);logger[_0xcb50('0x11')](_0xcb50('0x26'),_0x571e43,JSON['stringify'](_0x1ea722));_0x527a70(_0x1ea722);})[_0xcb50('0x24')](function(_0x1ab4c0){logger[_0xcb50('0x15')](_0xcb50('0x26'),_0x1ab4c0[_0xcb50('0x17')],_0x571e43);_0x467293(_0x3c398d[_0xcb50('0x15')](0x1f4,_0x1ab4c0[_0xcb50('0x17')]));});});};
\ No newline at end of file
index 4f8f9c9..9f97a80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04af=['./mailQueue.events','save','remove','update','emit','length','mailQueue:'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x04af,0x1f1));var _0xf04a=function(_0x1d8cb6,_0x5c4413){_0x1d8cb6=_0x1d8cb6-0x0;var _0x55ab81=_0x04af[_0x1d8cb6];return _0x55ab81;};'use strict';var MailQueueEvents=require(_0xf04a('0x0'));var events=[_0xf04a('0x1'),_0xf04a('0x2'),_0xf04a('0x3')];function createListener(_0x8c31e9,_0x505a5d){return function(_0x310948){_0x505a5d[_0xf04a('0x4')](_0x8c31e9,_0x310948);};}function removeListener(_0x5d61ef,_0x171121){return function(){MailQueueEvents['removeListener'](_0x5d61ef,_0x171121);};}exports['register']=function(_0x89a6a8){for(var _0x1fffed=0x0,_0x5ad3a1=events[_0xf04a('0x5')];_0x1fffed<_0x5ad3a1;_0x1fffed++){var _0x42d1bb=events[_0x1fffed];var _0x43f4bd=createListener(_0xf04a('0x6')+_0x42d1bb,_0x89a6a8);MailQueueEvents['on'](_0x42d1bb,_0x43f4bd);}};
\ No newline at end of file
+var _0xc965=['update','emit','removeListener','register','length','save'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xc965,0x1df));var _0x5c96=function(_0x483657,_0x4c9172){_0x483657=_0x483657-0x0;var _0xe9877c=_0xc965[_0x483657];return _0xe9877c;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x5c96('0x0'),'remove',_0x5c96('0x1')];function createListener(_0xd1c710,_0x1bd47e){return function(_0x3bd000){_0x1bd47e[_0x5c96('0x2')](_0xd1c710,_0x3bd000);};}function removeListener(_0x5b1753,_0x1ebfcf){return function(){MailQueueEvents[_0x5c96('0x3')](_0x5b1753,_0x1ebfcf);};}exports[_0x5c96('0x4')]=function(_0x29053f){for(var _0x53e0f0=0x0,_0x3d960b=events[_0x5c96('0x5')];_0x53e0f0<_0x3d960b;_0x53e0f0++){var _0x539482=events[_0x53e0f0];var _0x3bb3d5=createListener('mailQueue:'+_0x539482,_0x29053f);MailQueueEvents['on'](_0x539482,_0x3bb3d5);}};
\ No newline at end of file
index 6c8e148..e4ee5e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf99a=['index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailQueueReport.controller','isAuthenticated'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xf99a,0x1ee));var _0xaf99=function(_0x430784,_0x43e658){_0x430784=_0x430784-0x0;var _0x250522=_0xf99a[_0x430784];return _0x250522;};'use strict';var multer=require(_0xaf99('0x0'));var util=require(_0xaf99('0x1'));var path=require(_0xaf99('0x2'));var timeout=require(_0xaf99('0x3'));var express=require(_0xaf99('0x4'));var router=express[_0xaf99('0x5')]();var fs_extra=require(_0xaf99('0x6'));var auth=require(_0xaf99('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaf99('0x8'));router['get']('/',auth[_0xaf99('0x9')](),controller[_0xaf99('0xa')]);router[_0xaf99('0xb')](_0xaf99('0xc'),auth[_0xaf99('0x9')](),controller[_0xaf99('0xd')]);router[_0xaf99('0xb')](_0xaf99('0xe'),auth[_0xaf99('0x9')](),controller[_0xaf99('0xf')]);router['post']('/',auth[_0xaf99('0x9')](),controller[_0xaf99('0x10')]);router[_0xaf99('0x11')](_0xaf99('0xe'),auth[_0xaf99('0x9')](),controller[_0xaf99('0x12')]);router[_0xaf99('0x13')](_0xaf99('0xe'),auth[_0xaf99('0x9')](),controller[_0xaf99('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x68e9=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','/:id'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x68e9,0x65));var _0x968e=function(_0xbce261,_0x5bf87e){_0xbce261=_0xbce261-0x0;var _0x23848f=_0x68e9[_0xbce261];return _0x23848f;};'use strict';var multer=require(_0x968e('0x0'));var util=require(_0x968e('0x1'));var path=require(_0x968e('0x2'));var timeout=require(_0x968e('0x3'));var express=require(_0x968e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x968e('0x5'));var config=require(_0x968e('0x6'));var controller=require('./mailQueueReport.controller');router[_0x968e('0x7')]('/',auth['isAuthenticated'](),controller[_0x968e('0x8')]);router[_0x968e('0x7')]('/describe',auth[_0x968e('0x9')](),controller['describe']);router[_0x968e('0x7')](_0x968e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x968e('0xb')]('/',auth[_0x968e('0x9')](),controller['create']);router['put'](_0x968e('0xa'),auth[_0x968e('0x9')](),controller[_0x968e('0xc')]);router[_0x968e('0xd')](_0x968e('0xa'),auth[_0x968e('0x9')](),controller[_0x968e('0xe')]);module[_0x968e('0xf')]=router;
\ No newline at end of file
index 2c46871..cff84a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf433=['sequelize','exports','STRING','DATE'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0xf433,0x198));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x3f43('0x0'));module[_0x3f43('0x1')]={'uniqueid':{'type':Sequelize[_0x3f43('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3f43('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3f43('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3f43('0x2')]}};
\ No newline at end of file
+var _0xd9bb=['sequelize','STRING','DATE'];(function(_0x198e31,_0x40a587){var _0x53a680=function(_0x294156){while(--_0x294156){_0x198e31['push'](_0x198e31['shift']());}};_0x53a680(++_0x40a587);}(_0xd9bb,0x11d));var _0xbd9b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd9bb[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd9b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbd9b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xbd9b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd9b('0x2')]},'acceptAt':{'type':Sequelize[_0xbd9b('0x2')]},'exitAt':{'type':Sequelize[_0xbd9b('0x2')]},'reason':{'type':Sequelize[_0xbd9b('0x1')]}};
\ No newline at end of file
index e92421e..bdc4e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x4a30b3,_0x3ddbdb){var _0x161079=function(_0x507543){while(--_0x507543){_0x4a30b3['push'](_0x4a30b3['shift']());}};_0x161079(++_0x3ddbdb);}(_0xcaf2,0x8a));var _0x2caf=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xcaf2[_0x29e3ec];return _0x25727e;};'use strict';var emlformat=require(_0x2caf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2caf('0x1'));var jsonpatch=require(_0x2caf('0x2'));var rp=require('request-promise');var moment=require(_0x2caf('0x3'));var BPromise=require(_0x2caf('0x4'));var Mustache=require('mustache');var util=require(_0x2caf('0x5'));var path=require('path');var sox=require(_0x2caf('0x6'));var csv=require(_0x2caf('0x7'));var ejs=require(_0x2caf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2caf('0x9'));var squel=require(_0x2caf('0xa'));var crypto=require(_0x2caf('0xb'));var jsforce=require(_0x2caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2caf('0x7'));var querystring=require(_0x2caf('0xd'));var Papa=require(_0x2caf('0xe'));var Redis=require(_0x2caf('0xf'));var authService=require(_0x2caf('0x10'));var qs=require(_0x2caf('0x11'));var as=require(_0x2caf('0x12'));var hardwareService=require(_0x2caf('0x13'));var logger=require(_0x2caf('0x14'))('api');var utils=require(_0x2caf('0x15'));var config=require(_0x2caf('0x16'));var licenseUtil=require(_0x2caf('0x17'));var db=require(_0x2caf('0x18'))['db'];function respondWithStatusCode(_0x1dda08,_0x31c0e7){_0x31c0e7=_0x31c0e7||0xcc;return function(_0x252147){if(_0x252147){return _0x1dda08[_0x2caf('0x19')](_0x31c0e7);}return _0x1dda08['status'](_0x31c0e7)[_0x2caf('0x1a')]();};}function respondWithResult(_0xec8192,_0x502033){_0x502033=_0x502033||0xc8;return function(_0x4c47b8){if(_0x4c47b8){return _0xec8192['status'](_0x502033)[_0x2caf('0x1b')](_0x4c47b8);}};}function respondWithFilteredResult(_0x4da5ba,_0x388e05){return function(_0xa75896){if(_0xa75896){var _0x3b8b67=typeof _0x388e05[_0x2caf('0x1c')]==='undefined'&&typeof _0x388e05[_0x2caf('0x1d')]==='undefined';var _0x2d5b64=_0xa75896['count'];var _0x4a33fc=_0x3b8b67?0x0:_0x388e05[_0x2caf('0x1c')];var _0x58047b=_0x3b8b67?_0xa75896[_0x2caf('0x1e')]:_0x388e05[_0x2caf('0x1c')]+_0x388e05['limit'];var _0x12624b;if(_0x58047b>=_0x2d5b64){_0x58047b=_0x2d5b64;_0x12624b=0xc8;}else{_0x12624b=0xce;}_0x4da5ba[_0x2caf('0x1f')](_0x12624b);return _0x4da5ba[_0x2caf('0x20')](_0x2caf('0x21'),_0x4a33fc+'-'+_0x58047b+'/'+_0x2d5b64)[_0x2caf('0x1b')](_0xa75896);}return null;};}function patchUpdates(_0x595f2f){return function(_0xfa426f){try{jsonpatch[_0x2caf('0x22')](_0xfa426f,_0x595f2f,!![]);}catch(_0x2b4d16){return BPromise[_0x2caf('0x23')](_0x2b4d16);}return _0xfa426f[_0x2caf('0x24')]();};}function saveUpdates(_0x9d6bae,_0x4092ba){return function(_0x256cc4){if(_0x256cc4){return _0x256cc4[_0x2caf('0x25')](_0x9d6bae)[_0x2caf('0x26')](function(_0x6814bc){return _0x6814bc;});}return null;};}function removeEntity(_0x5231fc,_0x296305){return function(_0x14bfd2){if(_0x14bfd2){return _0x14bfd2[_0x2caf('0x27')]()[_0x2caf('0x26')](function(){_0x5231fc[_0x2caf('0x1f')](0xcc)[_0x2caf('0x1a')]();});}};}function handleEntityNotFound(_0x392196,_0x164da){return function(_0x2e0a75){if(!_0x2e0a75){_0x392196[_0x2caf('0x19')](0x194);}return _0x2e0a75;};}function handleError(_0x5ad211,_0x6a32ac){_0x6a32ac=_0x6a32ac||0x1f4;return function(_0x325eda){logger[_0x2caf('0x28')](_0x325eda[_0x2caf('0x29')]);if(_0x325eda[_0x2caf('0x2a')]){delete _0x325eda[_0x2caf('0x2a')];}_0x5ad211[_0x2caf('0x1f')](_0x6a32ac)[_0x2caf('0x2b')](_0x325eda);};}exports[_0x2caf('0x2c')]=function(_0x2304f1,_0x30da75){var _0x1f477={},_0x158d60={},_0x48b5f7={'count':0x0,'rows':[]};var _0xb944cc=_[_0x2caf('0x2d')](db[_0x2caf('0x2e')][_0x2caf('0x2f')],function(_0xa8523b){return{'name':_0xa8523b[_0x2caf('0x30')],'type':_0xa8523b[_0x2caf('0x31')]['key']};});_0x158d60[_0x2caf('0x32')]=_[_0x2caf('0x2d')](_0xb944cc,'name');_0x158d60[_0x2caf('0x33')]=_[_0x2caf('0x34')](_0x2304f1[_0x2caf('0x33')]);_0x158d60['filters']=_[_0x2caf('0x35')](_0x158d60['model'],_0x158d60['query']);_0x1f477[_0x2caf('0x36')]=_[_0x2caf('0x35')](_0x158d60[_0x2caf('0x32')],qs[_0x2caf('0x37')](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x37')]));_0x1f477[_0x2caf('0x36')]=_0x1f477[_0x2caf('0x36')][_0x2caf('0x38')]?_0x1f477['attributes']:_0x158d60[_0x2caf('0x32')];if(!_0x2304f1[_0x2caf('0x33')][_0x2caf('0x39')](_0x2caf('0x3a'))){_0x1f477[_0x2caf('0x1d')]=qs[_0x2caf('0x1d')](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x1d')]);_0x1f477[_0x2caf('0x1c')]=qs[_0x2caf('0x1c')](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x1c')]);}_0x1f477['order']=qs['sort'](_0x2304f1[_0x2caf('0x33')][_0x2caf('0x3b')]);_0x1f477[_0x2caf('0x3c')]=qs[_0x2caf('0x3d')](_['pick'](_0x2304f1[_0x2caf('0x33')],_0x158d60[_0x2caf('0x3d')]),_0xb944cc);if(_0x2304f1[_0x2caf('0x33')][_0x2caf('0x3e')]){_0x1f477[_0x2caf('0x3c')]=_[_0x2caf('0x3f')](_0x1f477[_0x2caf('0x3c')],{'$or':_[_0x2caf('0x2d')](_0xb944cc,function(_0x5c133c){if(_0x5c133c['type']!==_0x2caf('0x40')){var _0x863fca={};_0x863fca[_0x5c133c[_0x2caf('0x2a')]]={'$like':'%'+_0x2304f1[_0x2caf('0x33')][_0x2caf('0x3e')]+'%'};return _0x863fca;}})});}_0x1f477=_[_0x2caf('0x3f')]({},_0x1f477,_0x2304f1[_0x2caf('0x41')]);var _0xf93228={'where':_0x1f477[_0x2caf('0x3c')]};return db[_0x2caf('0x2e')][_0x2caf('0x1e')](_0xf93228)['then'](function(_0x35ad7f){_0x48b5f7[_0x2caf('0x1e')]=_0x35ad7f;if(_0x2304f1[_0x2caf('0x33')]['includeAll']){_0x1f477[_0x2caf('0x42')]=[{'all':!![]}];}return db[_0x2caf('0x2e')][_0x2caf('0x43')](_0x1f477);})['then'](function(_0x40cb18){_0x48b5f7[_0x2caf('0x44')]=_0x40cb18;return _0x48b5f7;})['then'](respondWithFilteredResult(_0x30da75,_0x1f477))[_0x2caf('0x45')](handleError(_0x30da75,null));};exports[_0x2caf('0x46')]=function(_0x4e57b0,_0xe5fcbf){var _0x1348d8={'raw':!![],'where':{'id':_0x4e57b0[_0x2caf('0x47')]['id']}},_0x2e4126={};_0x2e4126[_0x2caf('0x32')]=_[_0x2caf('0x34')](db[_0x2caf('0x2e')][_0x2caf('0x2f')]);_0x2e4126['query']=_[_0x2caf('0x34')](_0x4e57b0['query']);_0x2e4126[_0x2caf('0x3d')]=_[_0x2caf('0x35')](_0x2e4126[_0x2caf('0x32')],_0x2e4126['query']);_0x1348d8['attributes']=_[_0x2caf('0x35')](_0x2e4126['model'],qs[_0x2caf('0x37')](_0x4e57b0[_0x2caf('0x33')][_0x2caf('0x37')]));_0x1348d8[_0x2caf('0x36')]=_0x1348d8[_0x2caf('0x36')][_0x2caf('0x38')]?_0x1348d8[_0x2caf('0x36')]:_0x2e4126[_0x2caf('0x32')];if(_0x4e57b0[_0x2caf('0x33')][_0x2caf('0x48')]){_0x1348d8[_0x2caf('0x42')]=[{'all':!![]}];}_0x1348d8=_[_0x2caf('0x3f')]({},_0x1348d8,_0x4e57b0[_0x2caf('0x41')]);return db[_0x2caf('0x2e')][_0x2caf('0x49')](_0x1348d8)[_0x2caf('0x26')](handleEntityNotFound(_0xe5fcbf,null))[_0x2caf('0x26')](respondWithResult(_0xe5fcbf,null))[_0x2caf('0x45')](handleError(_0xe5fcbf,null));};exports[_0x2caf('0x4a')]=function(_0x3a598b,_0x136dc9){return db['MailQueueReport'][_0x2caf('0x4a')](_0x3a598b[_0x2caf('0x4b')],{})['then'](respondWithResult(_0x136dc9,0xc9))['catch'](handleError(_0x136dc9,null));};exports[_0x2caf('0x25')]=function(_0x6f0a2a,_0x5a822d){if(_0x6f0a2a[_0x2caf('0x4b')]['id']){delete _0x6f0a2a[_0x2caf('0x4b')]['id'];}return db[_0x2caf('0x2e')][_0x2caf('0x49')]({'where':{'id':_0x6f0a2a[_0x2caf('0x47')]['id']}})[_0x2caf('0x26')](handleEntityNotFound(_0x5a822d,null))[_0x2caf('0x26')](saveUpdates(_0x6f0a2a[_0x2caf('0x4b')],null))[_0x2caf('0x26')](respondWithResult(_0x5a822d,null))[_0x2caf('0x45')](handleError(_0x5a822d,null));};exports[_0x2caf('0x27')]=function(_0x2b318a,_0x41b7b2){return db['MailQueueReport'][_0x2caf('0x49')]({'where':{'id':_0x2b318a[_0x2caf('0x47')]['id']}})[_0x2caf('0x26')](handleEntityNotFound(_0x41b7b2,null))['then'](removeEntity(_0x41b7b2,null))[_0x2caf('0x45')](handleError(_0x41b7b2,null));};exports[_0x2caf('0x4c')]=function(_0x28d8bd,_0x20bf52){return db[_0x2caf('0x2e')][_0x2caf('0x4c')]()[_0x2caf('0x26')](respondWithResult(_0x20bf52,null))[_0x2caf('0x45')](handleError(_0x20bf52,null));};
\ No newline at end of file
+var _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x3e9a0e,_0x1eafa2){_0x3e9a0e=_0x3e9a0e-0x0;var _0x174c92=_0x9f0e[_0x3e9a0e];return _0x174c92;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['MailQueueReport'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':!![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['MailQueueReport'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['MailQueueReport'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));};
\ No newline at end of file
index 5d49c9e..325f0fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa613=['./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x463735,_0x7f214f){var _0x198920=function(_0x3c1f7f){while(--_0x3c1f7f){_0x463735['push'](_0x463735['shift']());}};_0x198920(++_0x7f214f);}(_0xa613,0x18b));var _0x3a61=function(_0x4e1d3c,_0x4f9988){_0x4e1d3c=_0x4e1d3c-0x0;var _0x5177b2=_0xa613[_0x4e1d3c];return _0x5177b2;};'use strict';var _=require('lodash');var util=require(_0x3a61('0x0'));var logger=require(_0x3a61('0x1'))('api');var moment=require(_0x3a61('0x2'));var BPromise=require(_0x3a61('0x3'));var rp=require(_0x3a61('0x4'));var fs=require('fs');var path=require(_0x3a61('0x5'));var rimraf=require(_0x3a61('0x6'));var config=require(_0x3a61('0x7'));var attributes=require(_0x3a61('0x8'));module[_0x3a61('0x9')]=function(_0x49c116,_0x26787a){return _0x49c116[_0x3a61('0xa')](_0x3a61('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x3a61('0xc'),'fields':[_0x3a61('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xad30=['../../config/logger','moment','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xad30,0x82));var _0x0ad3=function(_0x271580,_0x4281b0){_0x271580=_0x271580-0x0;var _0x4ef178=_0xad30[_0x271580];return _0x4ef178;};'use strict';var _=require(_0x0ad3('0x0'));var util=require(_0x0ad3('0x1'));var logger=require(_0x0ad3('0x2'))('api');var moment=require(_0x0ad3('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ad3('0x4'));var fs=require('fs');var path=require(_0x0ad3('0x5'));var rimraf=require(_0x0ad3('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ad3('0x7'));module[_0x0ad3('0x8')]=function(_0x22329a,_0x34ba3a){return _0x22329a[_0x0ad3('0x9')](_0x0ad3('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0ad3('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 9f1505f..2ef9e75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9d76a9,_0x2953ba){var _0x15c956=function(_0x1298f0){while(--_0x1298f0){_0x9d76a9['push'](_0x9d76a9['shift']());}};_0x15c956(++_0x2953ba);}(_0x1261,0x144));var _0x1126=function(_0x1e4177,_0x26a73a){_0x1e4177=_0x1e4177-0x0;var _0xa6e76c=_0x1261[_0x1e4177];return _0xa6e76c;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});};
\ No newline at end of file
+var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x154ebd,_0x2cd326){var _0x5e2b19=function(_0x16b8f4){while(--_0x16b8f4){_0x154ebd['push'](_0x154ebd['shift']());}};_0x5e2b19(++_0x2cd326);}(_0xadb5,0xad));var _0x5adb=function(_0x3e19fe,_0x5cd9c5){_0x3e19fe=_0x3e19fe-0x0;var _0x35e40e=_0xadb5[_0x3e19fe];return _0x35e40e;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});};
\ No newline at end of file
index 04ba4a6..0ddf2a6 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(_0xcf4260,_0xe48af6){var _0x5ad781=function(_0x4ab8c9){while(--_0x4ab8c9){_0xcf4260['push'](_0xcf4260['shift']());}};_0x5ad781(++_0xe48af6);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2ed08e,_0x31e039){var _0x5d98cb=function(_0x345294){while(--_0x345294){_0x2ed08e['push'](_0x2ed08e['shift']());}};_0x5d98cb(++_0x31e039);}(_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
index 9d58013..e0cc9c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5fa=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x35f58d,_0x56c821){_0x35f58d=_0x35f58d-0x0;var _0xbca79b=_0xa5fa[_0x35f58d];return _0xbca79b;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'description':{'type':Sequelize[_0xaa5f('0x1')]},'host':{'type':Sequelize[_0xaa5f('0x1')]},'authentication':{'type':Sequelize[_0xaa5f('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xaa5f('0x1')]},'port':{'type':Sequelize[_0xaa5f('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xaa5f('0x1')],'defaultValue':_0xaa5f('0x4')},'connTimeout':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xaa5f('0x1')]}};
\ No newline at end of file
+var _0x74f0=['STRING','INTEGER','INBOX','exports','BOOLEAN'];(function(_0x435dde,_0x2a2fa3){var _0x4aca2d=function(_0x283a96){while(--_0x283a96){_0x435dde['push'](_0x435dde['shift']());}};_0x4aca2d(++_0x2a2fa3);}(_0x74f0,0xf3));var _0x074f=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x74f0[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require('sequelize');module[_0x074f('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x074f('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x074f('0x2')]},'password':{'type':Sequelize[_0x074f('0x2')]},'port':{'type':Sequelize[_0x074f('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x074f('0x4')},'connTimeout':{'type':Sequelize[_0x074f('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x074f('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x074f('0x2')]}};
\ No newline at end of file
index 41f8f5b..154ba0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ac9=['../../config/environment','./mailServerIn.attributes','exports','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x1ac9,0x138));var _0x91ac=function(_0x97db75,_0x3abdb8){_0x97db75=_0x97db75-0x0;var _0x259a53=_0x1ac9[_0x97db75];return _0x259a53;};'use strict';var _=require(_0x91ac('0x0'));var util=require('util');var logger=require(_0x91ac('0x1'))(_0x91ac('0x2'));var moment=require(_0x91ac('0x3'));var BPromise=require(_0x91ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91ac('0x5'));var rimraf=require(_0x91ac('0x6'));var config=require(_0x91ac('0x7'));var attributes=require(_0x91ac('0x8'));module[_0x91ac('0x9')]=function(_0x1b1fb6,_0x24060c){return _0x1b1fb6['define']('MailServerIn',attributes,{'tableName':_0x91ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb15b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0xb15b,0x8b));var _0xbb15=function(_0x51e453,_0xa3da96){_0x51e453=_0x51e453-0x0;var _0x4addc8=_0xb15b[_0x51e453];return _0x4addc8;};'use strict';var _=require(_0xbb15('0x0'));var util=require(_0xbb15('0x1'));var logger=require(_0xbb15('0x2'))(_0xbb15('0x3'));var moment=require('moment');var BPromise=require(_0xbb15('0x4'));var rp=require(_0xbb15('0x5'));var fs=require('fs');var path=require(_0xbb15('0x6'));var rimraf=require(_0xbb15('0x7'));var config=require(_0xbb15('0x8'));var attributes=require(_0xbb15('0x9'));module[_0xbb15('0xa')]=function(_0xbb3964,_0x133ef9){return _0xbb3964[_0xbb15('0xb')](_0xbb15('0xc'),attributes,{'tableName':_0xbb15('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac32202..48f53de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x620f=['then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','include','model','attributes','map','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x620f,0x160));var _0xf620=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x620f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf620('0x0'));var util=require(_0xf620('0x1'));var moment=require(_0xf620('0x2'));var BPromise=require('bluebird');var rs=require(_0xf620('0x3'));var fs=require('fs');var Redis=require(_0xf620('0x4'));var db=require(_0xf620('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf620('0x6'));var config=require('../../config/environment');var jayson=require(_0xf620('0x7'));var client=jayson[_0xf620('0x8')][_0xf620('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x288521,_0x1c308b,_0x17c0c1){return new BPromise(function(_0x98379c,_0x54231d){return client[_0xf620('0xa')](_0x288521,_0x17c0c1)[_0xf620('0xb')](function(_0x5924d7){logger[_0xf620('0xc')](_0xf620('0xd'),_0x1c308b,_0xf620('0xe'));logger['debug'](_0xf620('0xf'),_0x1c308b,_0xf620('0xe'),JSON[_0xf620('0x10')](_0x5924d7));if(_0x5924d7[_0xf620('0x11')]){if(_0x5924d7[_0xf620('0x11')][_0xf620('0x12')]===0x1f4){logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);return _0x54231d(_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);}logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x5924d7[_0xf620('0x11')]['message']);return _0x98379c(_0x5924d7[_0xf620('0x11')][_0xf620('0x13')]);}else{logger[_0xf620('0xc')](_0xf620('0xd'),_0x1c308b,'request\x20sent');_0x98379c(_0x5924d7[_0xf620('0x14')]['message']);}})['catch'](function(_0x18f05f){logger[_0xf620('0x11')](_0xf620('0xd'),_0x1c308b,_0x18f05f);_0x54231d(_0x18f05f);});});}exports[_0xf620('0x15')]=function(_0x264d38){var _0x237a86=this;return new Promise(function(_0x14db0f,_0x318f8f){return db[_0xf620('0x16')][_0xf620('0x17')]({'raw':_0x264d38[_0xf620('0x18')]?_0x264d38['options'][_0xf620('0x19')]===undefined?!![]:![]:!![],'where':_0x264d38[_0xf620('0x18')]?_0x264d38[_0xf620('0x18')][_0xf620('0x1a')]||null:null,'attributes':_0x264d38[_0xf620('0x18')]?_0x264d38[_0xf620('0x18')]['attributes']||null:null,'limit':_0x264d38[_0xf620('0x18')]?_0x264d38[_0xf620('0x18')][_0xf620('0x1b')]||null:null,'include':_0x264d38['options']?_0x264d38[_0xf620('0x18')][_0xf620('0x1c')]?_['map'](_0x264d38[_0xf620('0x18')][_0xf620('0x1c')],function(_0x179bc1){return{'model':db[_0x179bc1[_0xf620('0x1d')]],'as':_0x179bc1['as'],'attributes':_0x179bc1[_0xf620('0x1e')],'include':_0x179bc1[_0xf620('0x1c')]?_[_0xf620('0x1f')](_0x179bc1[_0xf620('0x1c')],function(_0x412a0c){return{'model':db[_0x412a0c[_0xf620('0x1d')]],'as':_0x412a0c['as'],'attributes':_0x412a0c[_0xf620('0x1e')],'include':_0x412a0c[_0xf620('0x1c')]?_[_0xf620('0x1f')](_0x412a0c[_0xf620('0x1c')],function(_0x23055f){return{'model':db[_0x23055f['model']],'as':_0x23055f['as'],'attributes':_0x23055f[_0xf620('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf620('0xb')](function(_0x53a1bc){logger[_0xf620('0xc')](_0xf620('0x15'),_0x264d38);logger['debug']('GetMailServerIn',_0x264d38,JSON[_0xf620('0x10')](_0x53a1bc));_0x14db0f(_0x53a1bc);})[_0xf620('0x20')](function(_0x1c70ed){logger[_0xf620('0x11')]('GetMailServerIn',_0x1c70ed['message'],_0x264d38);_0x318f8f(_0x237a86[_0xf620('0x11')](0x1f4,_0x1c70ed[_0xf620('0x13')]));});});};
\ No newline at end of file
+var _0x6cbf=['MailServerIn','options','where','attributes','limit','include','map','model','GetMailServerIn','debug','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5a9596,_0x195cbf){var _0xd020e0=function(_0x109a61){while(--_0x109a61){_0x5a9596['push'](_0x5a9596['shift']());}};_0xd020e0(++_0x195cbf);}(_0x6cbf,0x122));var _0xf6cb=function(_0x116528,_0x42e851){_0x116528=_0x116528-0x0;var _0x23f713=_0x6cbf[_0x116528];return _0x23f713;};'use strict';var _=require(_0xf6cb('0x0'));var util=require('util');var moment=require(_0xf6cb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6cb('0x2'));var db=require(_0xf6cb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf6cb('0x4'))(_0xf6cb('0x5'));var config=require(_0xf6cb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf6cb('0x7')][_0xf6cb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc5bde1,_0x5ab9e2,_0x39ba5e){return new BPromise(function(_0x27cc2d,_0xb73a29){return client['request'](_0xc5bde1,_0x39ba5e)['then'](function(_0x4ab999){logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,_0xf6cb('0xb'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5ab9e2,_0xf6cb('0xb'),JSON[_0xf6cb('0xc')](_0x4ab999));if(_0x4ab999[_0xf6cb('0xd')]){if(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xe')]===0x1f4){logger['error'](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0xb73a29(_0x4ab999[_0xf6cb('0xd')]['message']);}logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);return _0x27cc2d(_0x4ab999[_0xf6cb('0xd')][_0xf6cb('0xf')]);}else{logger[_0xf6cb('0x9')](_0xf6cb('0xa'),_0x5ab9e2,'request\x20sent');_0x27cc2d(_0x4ab999[_0xf6cb('0x10')]['message']);}})[_0xf6cb('0x11')](function(_0x1f3978){logger[_0xf6cb('0xd')](_0xf6cb('0xa'),_0x5ab9e2,_0x1f3978);_0xb73a29(_0x1f3978);});});}exports['GetMailServerIn']=function(_0x52980d){var _0x5613dd=this;return new Promise(function(_0x145da2,_0x330b51){return db[_0xf6cb('0x12')]['findAll']({'raw':_0x52980d['options']?_0x52980d[_0xf6cb('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x52980d[_0xf6cb('0x13')]?_0x52980d['options'][_0xf6cb('0x14')]||null:null,'attributes':_0x52980d[_0xf6cb('0x13')]?_0x52980d[_0xf6cb('0x13')][_0xf6cb('0x15')]||null:null,'limit':_0x52980d[_0xf6cb('0x13')]?_0x52980d['options'][_0xf6cb('0x16')]||null:null,'include':_0x52980d[_0xf6cb('0x13')]?_0x52980d[_0xf6cb('0x13')]['include']?_['map'](_0x52980d[_0xf6cb('0x13')]['include'],function(_0x5a3a54){return{'model':db[_0x5a3a54['model']],'as':_0x5a3a54['as'],'attributes':_0x5a3a54['attributes'],'include':_0x5a3a54[_0xf6cb('0x17')]?_[_0xf6cb('0x18')](_0x5a3a54[_0xf6cb('0x17')],function(_0x407e28){return{'model':db[_0x407e28[_0xf6cb('0x19')]],'as':_0x407e28['as'],'attributes':_0x407e28[_0xf6cb('0x15')],'include':_0x407e28[_0xf6cb('0x17')]?_[_0xf6cb('0x18')](_0x407e28[_0xf6cb('0x17')],function(_0x2f5be6){return{'model':db[_0x2f5be6[_0xf6cb('0x19')]],'as':_0x2f5be6['as'],'attributes':_0x2f5be6[_0xf6cb('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x490a87){logger[_0xf6cb('0x9')](_0xf6cb('0x1a'),_0x52980d);logger[_0xf6cb('0x1b')](_0xf6cb('0x1a'),_0x52980d,JSON[_0xf6cb('0xc')](_0x490a87));_0x145da2(_0x490a87);})[_0xf6cb('0x11')](function(_0x2ed4a8){logger[_0xf6cb('0xd')](_0xf6cb('0x1a'),_0x2ed4a8['message'],_0x52980d);_0x330b51(_0x5613dd[_0xf6cb('0xd')](0x1f4,_0x2ed4a8[_0xf6cb('0xf')]));});});};
\ No newline at end of file
index de13434..3be2640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0x2a77e4,_0x3ff081){_0x2a77e4=_0x2a77e4-0x0;var _0x1dd344=_0x7a54[_0x2a77e4];return _0x1dd344;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
index 7c13fb2..ef7d87e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ef4=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x2fb3c4,_0x3f45f9){var _0x353a1f=function(_0x3968d0){while(--_0x3968d0){_0x2fb3c4['push'](_0x2fb3c4['shift']());}};_0x353a1f(++_0x3f45f9);}(_0x0ef4,0xc7));var _0x40ef=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0x0ef4[_0xa3463d];return _0x50fd67;};'use strict';var Sequelize=require('sequelize');module[_0x40ef('0x0')]={'description':{'type':Sequelize[_0x40ef('0x1')]},'host':{'type':Sequelize[_0x40ef('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x40ef('0x2')]},'secure':{'type':Sequelize[_0x40ef('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x40ef('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x32de=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x32de,0x12c));var _0xe32d=function(_0x581481,_0x190792){_0x581481=_0x581481-0x0;var _0x4dfd79=_0x32de[_0x581481];return _0x4dfd79;};'use strict';var Sequelize=require(_0xe32d('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe32d('0x1')]},'pass':{'type':Sequelize[_0xe32d('0x1')]},'port':{'type':Sequelize[_0xe32d('0x2')]},'secure':{'type':Sequelize[_0xe32d('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xe32d('0x1')]},'authentication':{'type':Sequelize[_0xe32d('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index b4c146c..3079c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf0=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','include','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xad5cf0,_0x4d6447){var _0x44fc85=function(_0x214e28){while(--_0x214e28){_0xad5cf0['push'](_0xad5cf0['shift']());}};_0x44fc85(++_0x4d6447);}(_0xdbf0,0xc8));var _0x0dbf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdbf0[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0dbf('0x0'));var rimraf=require(_0x0dbf('0x1'));var zipdir=require(_0x0dbf('0x2'));var jsonpatch=require(_0x0dbf('0x3'));var rp=require(_0x0dbf('0x4'));var moment=require(_0x0dbf('0x5'));var BPromise=require(_0x0dbf('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0dbf('0x7'));var sox=require(_0x0dbf('0x8'));var csv=require(_0x0dbf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0dbf('0xa'));var _=require(_0x0dbf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0dbf('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0dbf('0xd'));var Papa=require(_0x0dbf('0xe'));var Redis=require(_0x0dbf('0xf'));var authService=require(_0x0dbf('0x10'));var qs=require(_0x0dbf('0x11'));var as=require(_0x0dbf('0x12'));var hardwareService=require(_0x0dbf('0x13'));var logger=require(_0x0dbf('0x14'))('api');var utils=require(_0x0dbf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0dbf('0x16'));var db=require(_0x0dbf('0x17'))['db'];function respondWithStatusCode(_0x26572a,_0x4f91b8){_0x4f91b8=_0x4f91b8||0xcc;return function(_0x4366ed){if(_0x4366ed){return _0x26572a[_0x0dbf('0x18')](_0x4f91b8);}return _0x26572a[_0x0dbf('0x19')](_0x4f91b8)[_0x0dbf('0x1a')]();};}function respondWithResult(_0x2da268,_0x4173ca){_0x4173ca=_0x4173ca||0xc8;return function(_0x5302f5){if(_0x5302f5){return _0x2da268[_0x0dbf('0x19')](_0x4173ca)[_0x0dbf('0x1b')](_0x5302f5);}};}function respondWithFilteredResult(_0xde4f98,_0x461704){return function(_0x5e24df){if(_0x5e24df){var _0x4e6c8b=typeof _0x461704[_0x0dbf('0x1c')]===_0x0dbf('0x1d')&&typeof _0x461704[_0x0dbf('0x1e')]===_0x0dbf('0x1d');var _0xe952f=_0x5e24df['count'];var _0x1839df=_0x4e6c8b?0x0:_0x461704[_0x0dbf('0x1c')];var _0x5cfcdb=_0x4e6c8b?_0x5e24df[_0x0dbf('0x1f')]:_0x461704[_0x0dbf('0x1c')]+_0x461704[_0x0dbf('0x1e')];var _0x5aaf10;if(_0x5cfcdb>=_0xe952f){_0x5cfcdb=_0xe952f;_0x5aaf10=0xc8;}else{_0x5aaf10=0xce;}_0xde4f98[_0x0dbf('0x19')](_0x5aaf10);return _0xde4f98[_0x0dbf('0x20')](_0x0dbf('0x21'),_0x1839df+'-'+_0x5cfcdb+'/'+_0xe952f)['json'](_0x5e24df);}return null;};}function patchUpdates(_0x24b592){return function(_0x5086e4){try{jsonpatch[_0x0dbf('0x22')](_0x5086e4,_0x24b592,!![]);}catch(_0x4cec54){return BPromise[_0x0dbf('0x23')](_0x4cec54);}return _0x5086e4[_0x0dbf('0x24')]();};}function saveUpdates(_0x28b966,_0x3446f1){return function(_0x53643f){if(_0x53643f){return _0x53643f[_0x0dbf('0x25')](_0x28b966)[_0x0dbf('0x26')](function(_0x3bf211){return _0x3bf211;});}return null;};}function removeEntity(_0x23af58,_0x3a7e8b){return function(_0x418e0d){if(_0x418e0d){return _0x418e0d[_0x0dbf('0x27')]()[_0x0dbf('0x26')](function(){_0x23af58[_0x0dbf('0x19')](0xcc)[_0x0dbf('0x1a')]();});}};}function handleEntityNotFound(_0x18c5ea,_0x58688e){return function(_0x4f854f){if(!_0x4f854f){_0x18c5ea[_0x0dbf('0x18')](0x194);}return _0x4f854f;};}function handleError(_0x2059fb,_0x1e575f){_0x1e575f=_0x1e575f||0x1f4;return function(_0x595035){logger['error'](_0x595035[_0x0dbf('0x28')]);if(_0x595035[_0x0dbf('0x29')]){delete _0x595035[_0x0dbf('0x29')];}_0x2059fb[_0x0dbf('0x19')](_0x1e575f)[_0x0dbf('0x2a')](_0x595035);};}exports[_0x0dbf('0x2b')]=function(_0x2ebd32,_0x2f237e){var _0x3d6e9e={},_0x48504d={},_0x4d1557={'count':0x0,'rows':[]};var _0x7a8e77=_[_0x0dbf('0x2c')](db[_0x0dbf('0x2d')][_0x0dbf('0x2e')],function(_0x261f46){return{'name':_0x261f46['fieldName'],'type':_0x261f46[_0x0dbf('0x2f')][_0x0dbf('0x30')]};});_0x48504d[_0x0dbf('0x31')]=_['map'](_0x7a8e77,_0x0dbf('0x29'));_0x48504d[_0x0dbf('0x32')]=_['keys'](_0x2ebd32['query']);_0x48504d[_0x0dbf('0x33')]=_['intersection'](_0x48504d[_0x0dbf('0x31')],_0x48504d[_0x0dbf('0x32')]);_0x3d6e9e['attributes']=_[_0x0dbf('0x34')](_0x48504d[_0x0dbf('0x31')],qs['fields'](_0x2ebd32['query'][_0x0dbf('0x35')]));_0x3d6e9e[_0x0dbf('0x36')]=_0x3d6e9e['attributes'][_0x0dbf('0x37')]?_0x3d6e9e['attributes']:_0x48504d[_0x0dbf('0x31')];if(!_0x2ebd32[_0x0dbf('0x32')][_0x0dbf('0x38')](_0x0dbf('0x39'))){_0x3d6e9e[_0x0dbf('0x1e')]=qs[_0x0dbf('0x1e')](_0x2ebd32[_0x0dbf('0x32')]['limit']);_0x3d6e9e[_0x0dbf('0x1c')]=qs[_0x0dbf('0x1c')](_0x2ebd32[_0x0dbf('0x32')][_0x0dbf('0x1c')]);}_0x3d6e9e[_0x0dbf('0x3a')]=qs[_0x0dbf('0x3b')](_0x2ebd32[_0x0dbf('0x32')]['sort']);_0x3d6e9e[_0x0dbf('0x3c')]=qs[_0x0dbf('0x33')](_[_0x0dbf('0x3d')](_0x2ebd32[_0x0dbf('0x32')],_0x48504d['filters']),_0x7a8e77);if(_0x2ebd32[_0x0dbf('0x32')][_0x0dbf('0x3e')]){_0x3d6e9e[_0x0dbf('0x3c')]=_[_0x0dbf('0x3f')](_0x3d6e9e[_0x0dbf('0x3c')],{'$or':_[_0x0dbf('0x2c')](_0x7a8e77,function(_0x5f4d5a){if(_0x5f4d5a['type']!==_0x0dbf('0x40')){var _0x806db0={};_0x806db0[_0x5f4d5a[_0x0dbf('0x29')]]={'$like':'%'+_0x2ebd32[_0x0dbf('0x32')]['filter']+'%'};return _0x806db0;}})});}_0x3d6e9e=_[_0x0dbf('0x3f')]({},_0x3d6e9e,_0x2ebd32[_0x0dbf('0x41')]);var _0x438d88={'where':_0x3d6e9e['where']};return db[_0x0dbf('0x2d')][_0x0dbf('0x1f')](_0x438d88)[_0x0dbf('0x26')](function(_0xc88a27){_0x4d1557['count']=_0xc88a27;if(_0x2ebd32[_0x0dbf('0x32')]['includeAll']){_0x3d6e9e['include']=[{'all':!![]}];}return db[_0x0dbf('0x2d')][_0x0dbf('0x42')](_0x3d6e9e);})[_0x0dbf('0x26')](function(_0x30a596){_0x4d1557[_0x0dbf('0x43')]=_0x30a596;return _0x4d1557;})[_0x0dbf('0x26')](respondWithFilteredResult(_0x2f237e,_0x3d6e9e))[_0x0dbf('0x44')](handleError(_0x2f237e,null));};exports[_0x0dbf('0x45')]=function(_0x4ec607,_0x38fbdb){var _0x52789d={'raw':!![],'where':{'id':_0x4ec607[_0x0dbf('0x46')]['id']}},_0x583a4a={};_0x583a4a[_0x0dbf('0x31')]=_[_0x0dbf('0x47')](db[_0x0dbf('0x2d')]['rawAttributes']);_0x583a4a['query']=_[_0x0dbf('0x47')](_0x4ec607[_0x0dbf('0x32')]);_0x583a4a[_0x0dbf('0x33')]=_[_0x0dbf('0x34')](_0x583a4a[_0x0dbf('0x31')],_0x583a4a[_0x0dbf('0x32')]);_0x52789d[_0x0dbf('0x36')]=_[_0x0dbf('0x34')](_0x583a4a[_0x0dbf('0x31')],qs[_0x0dbf('0x35')](_0x4ec607[_0x0dbf('0x32')][_0x0dbf('0x35')]));_0x52789d['attributes']=_0x52789d[_0x0dbf('0x36')][_0x0dbf('0x37')]?_0x52789d[_0x0dbf('0x36')]:_0x583a4a[_0x0dbf('0x31')];if(_0x4ec607[_0x0dbf('0x32')][_0x0dbf('0x48')]){_0x52789d[_0x0dbf('0x49')]=[{'all':!![]}];}_0x52789d=_['merge']({},_0x52789d,_0x4ec607[_0x0dbf('0x41')]);return db[_0x0dbf('0x2d')][_0x0dbf('0x4a')](_0x52789d)['then'](handleEntityNotFound(_0x38fbdb,null))[_0x0dbf('0x26')](respondWithResult(_0x38fbdb,null))[_0x0dbf('0x44')](handleError(_0x38fbdb,null));};exports['create']=function(_0x1335df,_0x5258ec){return db[_0x0dbf('0x2d')]['create'](_0x1335df[_0x0dbf('0x4b')],{})[_0x0dbf('0x26')](respondWithResult(_0x5258ec,0xc9))[_0x0dbf('0x44')](handleError(_0x5258ec,null));};exports[_0x0dbf('0x25')]=function(_0x11ae37,_0x2b77cf){if(_0x11ae37[_0x0dbf('0x4b')]['id']){delete _0x11ae37[_0x0dbf('0x4b')]['id'];}return db[_0x0dbf('0x2d')]['find']({'where':{'id':_0x11ae37['params']['id']}})['then'](handleEntityNotFound(_0x2b77cf,null))[_0x0dbf('0x26')](saveUpdates(_0x11ae37[_0x0dbf('0x4b')],null))[_0x0dbf('0x26')](respondWithResult(_0x2b77cf,null))['catch'](handleError(_0x2b77cf,null));};exports[_0x0dbf('0x27')]=function(_0x4ecf6a,_0x4dd3c4){return db[_0x0dbf('0x2d')][_0x0dbf('0x4a')]({'where':{'id':_0x4ecf6a[_0x0dbf('0x46')]['id']}})[_0x0dbf('0x26')](handleEntityNotFound(_0x4dd3c4,null))[_0x0dbf('0x26')](removeEntity(_0x4dd3c4,null))[_0x0dbf('0x44')](handleError(_0x4dd3c4,null));};
\ No newline at end of file
+var _0xadb0=['map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','fast-json-patch','moment','bluebird','util','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','stack','name','send','index'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xadb0,0x6a));var _0x0adb=function(_0x524724,_0x2a0709){_0x524724=_0x524724-0x0;var _0x2ae276=_0xadb0[_0x524724];return _0x2ae276;};'use strict';var emlformat=require(_0x0adb('0x0'));var rimraf=require(_0x0adb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0adb('0x2'));var rp=require('request-promise');var moment=require(_0x0adb('0x3'));var BPromise=require(_0x0adb('0x4'));var Mustache=require('mustache');var util=require(_0x0adb('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0adb('0x6'));var ejs=require(_0x0adb('0x7'));var fs=require('fs');var fs_extra=require(_0x0adb('0x8'));var _=require(_0x0adb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0adb('0xa'));var deskjs=require(_0x0adb('0xb'));var toCsv=require(_0x0adb('0x6'));var querystring=require(_0x0adb('0xc'));var Papa=require(_0x0adb('0xd'));var Redis=require(_0x0adb('0xe'));var authService=require(_0x0adb('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0adb('0x10'));var hardwareService=require(_0x0adb('0x11'));var logger=require(_0x0adb('0x12'))(_0x0adb('0x13'));var utils=require(_0x0adb('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0adb('0x15'))['db'];function respondWithStatusCode(_0xc1ba96,_0x45bab4){_0x45bab4=_0x45bab4||0xcc;return function(_0x411645){if(_0x411645){return _0xc1ba96[_0x0adb('0x16')](_0x45bab4);}return _0xc1ba96[_0x0adb('0x17')](_0x45bab4)[_0x0adb('0x18')]();};}function respondWithResult(_0x569549,_0x452a63){_0x452a63=_0x452a63||0xc8;return function(_0x507d77){if(_0x507d77){return _0x569549[_0x0adb('0x17')](_0x452a63)[_0x0adb('0x19')](_0x507d77);}};}function respondWithFilteredResult(_0x17daca,_0x213bb1){return function(_0x98db71){if(_0x98db71){var _0x5db0ff=typeof _0x213bb1[_0x0adb('0x1a')]===_0x0adb('0x1b')&&typeof _0x213bb1['limit']===_0x0adb('0x1b');var _0x289a83=_0x98db71['count'];var _0x308d73=_0x5db0ff?0x0:_0x213bb1[_0x0adb('0x1a')];var _0x3de1c3=_0x5db0ff?_0x98db71[_0x0adb('0x1c')]:_0x213bb1[_0x0adb('0x1a')]+_0x213bb1[_0x0adb('0x1d')];var _0x4f6024;if(_0x3de1c3>=_0x289a83){_0x3de1c3=_0x289a83;_0x4f6024=0xc8;}else{_0x4f6024=0xce;}_0x17daca['status'](_0x4f6024);return _0x17daca[_0x0adb('0x1e')]('Content-Range',_0x308d73+'-'+_0x3de1c3+'/'+_0x289a83)[_0x0adb('0x19')](_0x98db71);}return null;};}function patchUpdates(_0x2cfa26){return function(_0x126a0b){try{jsonpatch[_0x0adb('0x1f')](_0x126a0b,_0x2cfa26,!![]);}catch(_0x13006d){return BPromise[_0x0adb('0x20')](_0x13006d);}return _0x126a0b[_0x0adb('0x21')]();};}function saveUpdates(_0x9d4a1b,_0x1eb785){return function(_0x3b6853){if(_0x3b6853){return _0x3b6853['update'](_0x9d4a1b)['then'](function(_0x353a47){return _0x353a47;});}return null;};}function removeEntity(_0x5c5360,_0x1dd227){return function(_0x448ca5){if(_0x448ca5){return _0x448ca5[_0x0adb('0x22')]()[_0x0adb('0x23')](function(){_0x5c5360['status'](0xcc)[_0x0adb('0x18')]();});}};}function handleEntityNotFound(_0x3f3428,_0x5f26e4){return function(_0x53eb8e){if(!_0x53eb8e){_0x3f3428[_0x0adb('0x16')](0x194);}return _0x53eb8e;};}function handleError(_0x4ebc40,_0x53a8ad){_0x53a8ad=_0x53a8ad||0x1f4;return function(_0x2644cb){logger['error'](_0x2644cb[_0x0adb('0x24')]);if(_0x2644cb[_0x0adb('0x25')]){delete _0x2644cb[_0x0adb('0x25')];}_0x4ebc40['status'](_0x53a8ad)[_0x0adb('0x26')](_0x2644cb);};}exports[_0x0adb('0x27')]=function(_0x4a8b31,_0xa26813){var _0x2ac85b={},_0x53dac8={},_0x4fd44c={'count':0x0,'rows':[]};var _0x1970b7=_[_0x0adb('0x28')](db[_0x0adb('0x29')][_0x0adb('0x2a')],function(_0x521c80){return{'name':_0x521c80[_0x0adb('0x2b')],'type':_0x521c80[_0x0adb('0x2c')][_0x0adb('0x2d')]};});_0x53dac8[_0x0adb('0x2e')]=_[_0x0adb('0x28')](_0x1970b7,'name');_0x53dac8[_0x0adb('0x2f')]=_[_0x0adb('0x30')](_0x4a8b31[_0x0adb('0x2f')]);_0x53dac8[_0x0adb('0x31')]=_[_0x0adb('0x32')](_0x53dac8['model'],_0x53dac8[_0x0adb('0x2f')]);_0x2ac85b[_0x0adb('0x33')]=_[_0x0adb('0x32')](_0x53dac8['model'],qs[_0x0adb('0x34')](_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x34')]));_0x2ac85b[_0x0adb('0x33')]=_0x2ac85b[_0x0adb('0x33')][_0x0adb('0x35')]?_0x2ac85b[_0x0adb('0x33')]:_0x53dac8['model'];if(!_0x4a8b31[_0x0adb('0x2f')]['hasOwnProperty'](_0x0adb('0x36'))){_0x2ac85b[_0x0adb('0x1d')]=qs[_0x0adb('0x1d')](_0x4a8b31['query'][_0x0adb('0x1d')]);_0x2ac85b[_0x0adb('0x1a')]=qs[_0x0adb('0x1a')](_0x4a8b31[_0x0adb('0x2f')]['offset']);}_0x2ac85b[_0x0adb('0x37')]=qs[_0x0adb('0x38')](_0x4a8b31[_0x0adb('0x2f')]['sort']);_0x2ac85b[_0x0adb('0x39')]=qs[_0x0adb('0x31')](_['pick'](_0x4a8b31['query'],_0x53dac8[_0x0adb('0x31')]),_0x1970b7);if(_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x3a')]){_0x2ac85b[_0x0adb('0x39')]=_[_0x0adb('0x3b')](_0x2ac85b['where'],{'$or':_[_0x0adb('0x28')](_0x1970b7,function(_0x1d5f68){if(_0x1d5f68['type']!==_0x0adb('0x3c')){var _0x7d6cff={};_0x7d6cff[_0x1d5f68['name']]={'$like':'%'+_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x3a')]+'%'};return _0x7d6cff;}})});}_0x2ac85b=_[_0x0adb('0x3b')]({},_0x2ac85b,_0x4a8b31[_0x0adb('0x3d')]);var _0x1d4fe3={'where':_0x2ac85b[_0x0adb('0x39')]};return db[_0x0adb('0x29')][_0x0adb('0x1c')](_0x1d4fe3)[_0x0adb('0x23')](function(_0x406c1f){_0x4fd44c[_0x0adb('0x1c')]=_0x406c1f;if(_0x4a8b31[_0x0adb('0x2f')][_0x0adb('0x3e')]){_0x2ac85b[_0x0adb('0x3f')]=[{'all':!![]}];}return db[_0x0adb('0x29')][_0x0adb('0x40')](_0x2ac85b);})[_0x0adb('0x23')](function(_0x503614){_0x4fd44c[_0x0adb('0x41')]=_0x503614;return _0x4fd44c;})['then'](respondWithFilteredResult(_0xa26813,_0x2ac85b))[_0x0adb('0x42')](handleError(_0xa26813,null));};exports[_0x0adb('0x43')]=function(_0x1a928b,_0x220491){var _0x212495={'raw':!![],'where':{'id':_0x1a928b[_0x0adb('0x44')]['id']}},_0x51982c={};_0x51982c[_0x0adb('0x2e')]=_[_0x0adb('0x30')](db[_0x0adb('0x29')]['rawAttributes']);_0x51982c[_0x0adb('0x2f')]=_['keys'](_0x1a928b['query']);_0x51982c[_0x0adb('0x31')]=_[_0x0adb('0x32')](_0x51982c[_0x0adb('0x2e')],_0x51982c[_0x0adb('0x2f')]);_0x212495[_0x0adb('0x33')]=_[_0x0adb('0x32')](_0x51982c[_0x0adb('0x2e')],qs[_0x0adb('0x34')](_0x1a928b[_0x0adb('0x2f')][_0x0adb('0x34')]));_0x212495['attributes']=_0x212495[_0x0adb('0x33')][_0x0adb('0x35')]?_0x212495['attributes']:_0x51982c[_0x0adb('0x2e')];if(_0x1a928b['query'][_0x0adb('0x3e')]){_0x212495['include']=[{'all':!![]}];}_0x212495=_[_0x0adb('0x3b')]({},_0x212495,_0x1a928b[_0x0adb('0x3d')]);return db[_0x0adb('0x29')][_0x0adb('0x45')](_0x212495)['then'](handleEntityNotFound(_0x220491,null))['then'](respondWithResult(_0x220491,null))['catch'](handleError(_0x220491,null));};exports[_0x0adb('0x46')]=function(_0x4b4d4f,_0x3aa093){return db[_0x0adb('0x29')]['create'](_0x4b4d4f[_0x0adb('0x47')],{})[_0x0adb('0x23')](respondWithResult(_0x3aa093,0xc9))[_0x0adb('0x42')](handleError(_0x3aa093,null));};exports[_0x0adb('0x48')]=function(_0x2a6d9f,_0x360ba8){if(_0x2a6d9f[_0x0adb('0x47')]['id']){delete _0x2a6d9f[_0x0adb('0x47')]['id'];}return db[_0x0adb('0x29')][_0x0adb('0x45')]({'where':{'id':_0x2a6d9f[_0x0adb('0x44')]['id']}})[_0x0adb('0x23')](handleEntityNotFound(_0x360ba8,null))[_0x0adb('0x23')](saveUpdates(_0x2a6d9f['body'],null))[_0x0adb('0x23')](respondWithResult(_0x360ba8,null))[_0x0adb('0x42')](handleError(_0x360ba8,null));};exports['destroy']=function(_0x1fedb4,_0x47b5c9){return db['MailServerOut'][_0x0adb('0x45')]({'where':{'id':_0x1fedb4['params']['id']}})[_0x0adb('0x23')](handleEntityNotFound(_0x47b5c9,null))[_0x0adb('0x23')](removeEntity(_0x47b5c9,null))[_0x0adb('0x42')](handleError(_0x47b5c9,null));};
\ No newline at end of file
index ec7080f..81b2d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3210=['rimraf','../../config/environment','exports','MailServerOut','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x319dc4,_0x3ba41a){var _0x810a9b=function(_0x4c6d12){while(--_0x4c6d12){_0x319dc4['push'](_0x319dc4['shift']());}};_0x810a9b(++_0x3ba41a);}(_0x3210,0xd6));var _0x0321=function(_0x5381c4,_0x1ffd1c){_0x5381c4=_0x5381c4-0x0;var _0x90395b=_0x3210[_0x5381c4];return _0x90395b;};'use strict';var _=require(_0x0321('0x0'));var util=require(_0x0321('0x1'));var logger=require(_0x0321('0x2'))(_0x0321('0x3'));var moment=require('moment');var BPromise=require(_0x0321('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0321('0x5'));var rimraf=require(_0x0321('0x6'));var config=require(_0x0321('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x0321('0x8')]=function(_0x2ecb58,_0x175f83){return _0x2ecb58['define'](_0x0321('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x007b=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','api','moment'];(function(_0x1674cb,_0x2a9465){var _0x19b180=function(_0x353ee9){while(--_0x353ee9){_0x1674cb['push'](_0x1674cb['shift']());}};_0x19b180(++_0x2a9465);}(_0x007b,0x1ac));var _0xb007=function(_0x3f4fc4,_0x1fceee){_0x3f4fc4=_0x3f4fc4-0x0;var _0x9354f1=_0x007b[_0x3f4fc4];return _0x9354f1;};'use strict';var _=require('lodash');var util=require(_0xb007('0x0'));var logger=require(_0xb007('0x1'))(_0xb007('0x2'));var moment=require(_0xb007('0x3'));var BPromise=require('bluebird');var rp=require(_0xb007('0x4'));var fs=require('fs');var path=require(_0xb007('0x5'));var rimraf=require(_0xb007('0x6'));var config=require(_0xb007('0x7'));var attributes=require(_0xb007('0x8'));module['exports']=function(_0x228101,_0x54680c){return _0x228101[_0xb007('0x9')](_0xb007('0xa'),attributes,{'tableName':_0xb007('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7315b8f..5288ae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x472ae8,_0x2a0fc7){var _0x48240f=function(_0x25d53e){while(--_0x25d53e){_0x472ae8['push'](_0x472ae8['shift']());}};_0x48240f(++_0x2a0fc7);}(_0x2ef3,0xba));var _0x32ef=function(_0x3a3b17,_0x3289c8){_0x3a3b17=_0x3a3b17-0x0;var _0x427406=_0x2ef3[_0x3a3b17];return _0x427406;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _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(_0x85155b,_0x31ad43){var _0x477a11=function(_0x59e970){while(--_0x59e970){_0x85155b['push'](_0x85155b['shift']());}};_0x477a11(++_0x31ad43);}(_0xdb28,0x106));var _0x8db2=function(_0x2d6aff,_0x3d96c0){_0x2d6aff=_0x2d6aff-0x0;var _0x2284a1=_0xdb28[_0x2d6aff];return _0x2284a1;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index f640e76..9e82407 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x270d=['../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x120b44,_0x146046){var _0x17c262=function(_0x577164){while(--_0x577164){_0x120b44['push'](_0x120b44['shift']());}};_0x17c262(++_0x146046);}(_0x270d,0xcd));var _0xd270=function(_0x4ba35a,_0x5bb9ec){_0x4ba35a=_0x4ba35a-0x0;var _0x1b4eb6=_0x270d[_0x4ba35a];return _0x1b4eb6;};'use strict';var multer=require('multer');var util=require(_0xd270('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd270('0x1'));var router=express[_0xd270('0x2')]();var fs_extra=require(_0xd270('0x3'));var auth=require(_0xd270('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd270('0x5'));var controller=require('./mailSubstatus.controller');router[_0xd270('0x6')]('/',auth[_0xd270('0x7')](),controller[_0xd270('0x8')]);router[_0xd270('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd270('0x6')](_0xd270('0x9'),auth[_0xd270('0x7')](),controller[_0xd270('0xa')]);router['post']('/',auth[_0xd270('0x7')](),controller[_0xd270('0xb')]);router['put'](_0xd270('0x9'),auth[_0xd270('0x7')](),controller[_0xd270('0xc')]);router['delete'](_0xd270('0x9'),auth[_0xd270('0x7')](),controller[_0xd270('0xd')]);module[_0xd270('0xe')]=router;
\ No newline at end of file
+var _0x9be5=['../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0x2cc640,_0x5bad67){var _0x337bd9=function(_0x30e574){while(--_0x30e574){_0x2cc640['push'](_0x2cc640['shift']());}};_0x337bd9(++_0x5bad67);}(_0x9be5,0xc3));var _0x59be=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x9be5[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0x59be('0x0'));var util=require('util');var path=require(_0x59be('0x1'));var timeout=require(_0x59be('0x2'));var express=require('express');var router=express[_0x59be('0x3')]();var fs_extra=require(_0x59be('0x4'));var auth=require(_0x59be('0x5'));var interaction=require(_0x59be('0x6'));var config=require('../../config/environment');var controller=require(_0x59be('0x7'));router[_0x59be('0x8')]('/',auth[_0x59be('0x9')](),controller[_0x59be('0xa')]);router[_0x59be('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x59be('0xb')]);router[_0x59be('0x8')](_0x59be('0xc'),auth[_0x59be('0x9')](),controller[_0x59be('0xd')]);router[_0x59be('0xe')]('/',auth[_0x59be('0x9')](),controller[_0x59be('0xf')]);router[_0x59be('0x10')](_0x59be('0xc'),auth['isAuthenticated'](),controller[_0x59be('0x11')]);router[_0x59be('0x12')](_0x59be('0xc'),auth['isAuthenticated'](),controller[_0x59be('0x13')]);module['exports']=router;
\ No newline at end of file
index 2a08f05..587b4f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['exports'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x8958,0x93));var _0x8895=function(_0x424f2c,_0x5744f0){_0x424f2c=_0x424f2c-0x0;var _0x22190a=_0x8958[_0x424f2c];return _0x22190a;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1751=['STRING','name','sequelize','exports'];(function(_0x49b984,_0x387c83){var _0x49d1e0=function(_0x3664c7){while(--_0x3664c7){_0x49b984['push'](_0x49b984['shift']());}};_0x49d1e0(++_0x387c83);}(_0x1751,0x76));var _0x1175=function(_0x5eb838,_0x12bcb4){_0x5eb838=_0x5eb838-0x0;var _0x59c77e=_0x1751[_0x5eb838];return _0x59c77e;};'use strict';var Sequelize=require(_0x1175('0x0'));module[_0x1175('0x1')]={'name':{'type':Sequelize[_0x1175('0x2')],'unique':_0x1175('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f510e7a..e6861f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf34d=['status','offset','undefined','count','set','json','apply','reject','update','then','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x4d5dee,_0x9c4220){var _0x2f67db=function(_0x1b83eb){while(--_0x1b83eb){_0x4d5dee['push'](_0x4d5dee['shift']());}};_0x2f67db(++_0x9c4220);}(_0xf34d,0x153));var _0xdf34=function(_0x5f253e,_0x30cfbb){_0x5f253e=_0x5f253e-0x0;var _0x96e3f8=_0xf34d[_0x5f253e];return _0x96e3f8;};'use strict';var emlformat=require(_0xdf34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf34('0x1'));var jsonpatch=require(_0xdf34('0x2'));var rp=require(_0xdf34('0x3'));var moment=require(_0xdf34('0x4'));var BPromise=require(_0xdf34('0x5'));var Mustache=require(_0xdf34('0x6'));var util=require(_0xdf34('0x7'));var path=require(_0xdf34('0x8'));var sox=require(_0xdf34('0x9'));var csv=require(_0xdf34('0xa'));var ejs=require(_0xdf34('0xb'));var fs=require('fs');var fs_extra=require(_0xdf34('0xc'));var _=require('lodash');var squel=require(_0xdf34('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdf34('0xe'));var toCsv=require(_0xdf34('0xa'));var querystring=require(_0xdf34('0xf'));var Papa=require(_0xdf34('0x10'));var Redis=require(_0xdf34('0x11'));var authService=require(_0xdf34('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdf34('0x13'));var hardwareService=require(_0xdf34('0x14'));var logger=require(_0xdf34('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdf34('0x16'));var db=require(_0xdf34('0x17'))['db'];function respondWithStatusCode(_0x158b31,_0x25bdf3){_0x25bdf3=_0x25bdf3||0xcc;return function(_0x1ff5d7){if(_0x1ff5d7){return _0x158b31[_0xdf34('0x18')](_0x25bdf3);}return _0x158b31['status'](_0x25bdf3)[_0xdf34('0x19')]();};}function respondWithResult(_0x1a0ca5,_0x5cf69c){_0x5cf69c=_0x5cf69c||0xc8;return function(_0x1175ee){if(_0x1175ee){return _0x1a0ca5[_0xdf34('0x1a')](_0x5cf69c)['json'](_0x1175ee);}};}function respondWithFilteredResult(_0x59544e,_0x58e190){return function(_0x50232d){if(_0x50232d){var _0x495062=typeof _0x58e190[_0xdf34('0x1b')]==='undefined'&&typeof _0x58e190['limit']===_0xdf34('0x1c');var _0x52648a=_0x50232d[_0xdf34('0x1d')];var _0x865cd8=_0x495062?0x0:_0x58e190[_0xdf34('0x1b')];var _0x3f19cc=_0x495062?_0x50232d[_0xdf34('0x1d')]:_0x58e190[_0xdf34('0x1b')]+_0x58e190['limit'];var _0x37875e;if(_0x3f19cc>=_0x52648a){_0x3f19cc=_0x52648a;_0x37875e=0xc8;}else{_0x37875e=0xce;}_0x59544e[_0xdf34('0x1a')](_0x37875e);return _0x59544e[_0xdf34('0x1e')]('Content-Range',_0x865cd8+'-'+_0x3f19cc+'/'+_0x52648a)[_0xdf34('0x1f')](_0x50232d);}return null;};}function patchUpdates(_0x12a05e){return function(_0x293434){try{jsonpatch[_0xdf34('0x20')](_0x293434,_0x12a05e,!![]);}catch(_0xfc6b43){return BPromise[_0xdf34('0x21')](_0xfc6b43);}return _0x293434['save']();};}function saveUpdates(_0x306f64,_0x4dad68){return function(_0x353e58){if(_0x353e58){return _0x353e58[_0xdf34('0x22')](_0x306f64)['then'](function(_0x36b5c2){return _0x36b5c2;});}return null;};}function removeEntity(_0x4dde68,_0x5ccb9d){return function(_0x5c5f1a){if(_0x5c5f1a){return _0x5c5f1a['destroy']()[_0xdf34('0x23')](function(){_0x4dde68[_0xdf34('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xee7e97,_0x3f1f40){return function(_0x46359e){if(!_0x46359e){_0xee7e97[_0xdf34('0x18')](0x194);}return _0x46359e;};}function handleError(_0x3101a9,_0x4101f1){_0x4101f1=_0x4101f1||0x1f4;return function(_0x3859dd){logger[_0xdf34('0x24')](_0x3859dd[_0xdf34('0x25')]);if(_0x3859dd[_0xdf34('0x26')]){delete _0x3859dd[_0xdf34('0x26')];}_0x3101a9[_0xdf34('0x1a')](_0x4101f1)[_0xdf34('0x27')](_0x3859dd);};}exports[_0xdf34('0x28')]=function(_0x5787a1,_0x572833){var _0x5648a7={},_0x58b5c7={},_0x351361={'count':0x0,'rows':[]};var _0x369e6f=_[_0xdf34('0x29')](db[_0xdf34('0x2a')][_0xdf34('0x2b')],function(_0x3bacef){return{'name':_0x3bacef[_0xdf34('0x2c')],'type':_0x3bacef[_0xdf34('0x2d')]['key']};});_0x58b5c7[_0xdf34('0x2e')]=_[_0xdf34('0x29')](_0x369e6f,'name');_0x58b5c7[_0xdf34('0x2f')]=_[_0xdf34('0x30')](_0x5787a1[_0xdf34('0x2f')]);_0x58b5c7[_0xdf34('0x31')]=_[_0xdf34('0x32')](_0x58b5c7[_0xdf34('0x2e')],_0x58b5c7[_0xdf34('0x2f')]);_0x5648a7[_0xdf34('0x33')]=_[_0xdf34('0x32')](_0x58b5c7[_0xdf34('0x2e')],qs[_0xdf34('0x34')](_0x5787a1[_0xdf34('0x2f')][_0xdf34('0x34')]));_0x5648a7['attributes']=_0x5648a7[_0xdf34('0x33')][_0xdf34('0x35')]?_0x5648a7['attributes']:_0x58b5c7[_0xdf34('0x2e')];if(!_0x5787a1['query'][_0xdf34('0x36')](_0xdf34('0x37'))){_0x5648a7['limit']=qs['limit'](_0x5787a1[_0xdf34('0x2f')]['limit']);_0x5648a7['offset']=qs['offset'](_0x5787a1[_0xdf34('0x2f')][_0xdf34('0x1b')]);}_0x5648a7[_0xdf34('0x38')]=qs[_0xdf34('0x39')](_0x5787a1[_0xdf34('0x2f')][_0xdf34('0x39')]);_0x5648a7['where']=qs[_0xdf34('0x31')](_[_0xdf34('0x3a')](_0x5787a1[_0xdf34('0x2f')],_0x58b5c7[_0xdf34('0x31')]),_0x369e6f);if(_0x5787a1['query'][_0xdf34('0x3b')]){_0x5648a7[_0xdf34('0x3c')]=_[_0xdf34('0x3d')](_0x5648a7[_0xdf34('0x3c')],{'$or':_[_0xdf34('0x29')](_0x369e6f,function(_0xfb0aed){if(_0xfb0aed['type']!==_0xdf34('0x3e')){var _0x5d4d3f={};_0x5d4d3f[_0xfb0aed[_0xdf34('0x26')]]={'$like':'%'+_0x5787a1[_0xdf34('0x2f')][_0xdf34('0x3b')]+'%'};return _0x5d4d3f;}})});}_0x5648a7=_[_0xdf34('0x3d')]({},_0x5648a7,_0x5787a1[_0xdf34('0x3f')]);var _0x4b8f72={'where':_0x5648a7[_0xdf34('0x3c')]};return db[_0xdf34('0x2a')][_0xdf34('0x1d')](_0x4b8f72)[_0xdf34('0x23')](function(_0x7a1432){_0x351361[_0xdf34('0x1d')]=_0x7a1432;if(_0x5787a1[_0xdf34('0x2f')][_0xdf34('0x40')]){_0x5648a7[_0xdf34('0x41')]=[{'all':!![]}];}return db[_0xdf34('0x2a')]['findAll'](_0x5648a7);})[_0xdf34('0x23')](function(_0x332130){_0x351361['rows']=_0x332130;return _0x351361;})[_0xdf34('0x23')](respondWithFilteredResult(_0x572833,_0x5648a7))[_0xdf34('0x42')](handleError(_0x572833,null));};exports[_0xdf34('0x43')]=function(_0x4ef515,_0x270d1c){var _0xe6ca86={'raw':!![],'where':{'id':_0x4ef515[_0xdf34('0x44')]['id']}},_0x1fe597={};_0x1fe597[_0xdf34('0x2e')]=_[_0xdf34('0x30')](db[_0xdf34('0x2a')][_0xdf34('0x2b')]);_0x1fe597[_0xdf34('0x2f')]=_[_0xdf34('0x30')](_0x4ef515[_0xdf34('0x2f')]);_0x1fe597[_0xdf34('0x31')]=_[_0xdf34('0x32')](_0x1fe597[_0xdf34('0x2e')],_0x1fe597[_0xdf34('0x2f')]);_0xe6ca86[_0xdf34('0x33')]=_[_0xdf34('0x32')](_0x1fe597[_0xdf34('0x2e')],qs[_0xdf34('0x34')](_0x4ef515[_0xdf34('0x2f')][_0xdf34('0x34')]));_0xe6ca86[_0xdf34('0x33')]=_0xe6ca86[_0xdf34('0x33')][_0xdf34('0x35')]?_0xe6ca86[_0xdf34('0x33')]:_0x1fe597[_0xdf34('0x2e')];if(_0x4ef515[_0xdf34('0x2f')][_0xdf34('0x40')]){_0xe6ca86['include']=[{'all':!![]}];}_0xe6ca86=_['merge']({},_0xe6ca86,_0x4ef515[_0xdf34('0x3f')]);return db['MailSubstatus'][_0xdf34('0x45')](_0xe6ca86)[_0xdf34('0x23')](handleEntityNotFound(_0x270d1c,null))[_0xdf34('0x23')](respondWithResult(_0x270d1c,null))[_0xdf34('0x42')](handleError(_0x270d1c,null));};exports[_0xdf34('0x46')]=function(_0x54a52c,_0x880ee1){return db[_0xdf34('0x2a')]['create'](_0x54a52c['body'],{})['then'](respondWithResult(_0x880ee1,0xc9))[_0xdf34('0x42')](handleError(_0x880ee1,null));};exports['update']=function(_0x126959,_0x364f16){if(_0x126959[_0xdf34('0x47')]['id']){delete _0x126959['body']['id'];}return db[_0xdf34('0x2a')][_0xdf34('0x45')]({'where':{'id':_0x126959['params']['id']}})[_0xdf34('0x23')](handleEntityNotFound(_0x364f16,null))[_0xdf34('0x23')](saveUpdates(_0x126959['body'],null))['then'](respondWithResult(_0x364f16,null))[_0xdf34('0x42')](handleError(_0x364f16,null));};exports['destroy']=function(_0x14e05e,_0x1d0bfa){return db[_0xdf34('0x2a')][_0xdf34('0x45')]({'where':{'id':_0x14e05e[_0xdf34('0x44')]['id']}})[_0xdf34('0x23')](handleEntityNotFound(_0x1d0bfa,null))[_0xdf34('0x23')](removeEntity(_0x1d0bfa,null))[_0xdf34('0x42')](handleError(_0x1d0bfa,null));};exports[_0xdf34('0x48')]=function(_0x5d1ec7,_0x359dee){return db[_0xdf34('0x2a')][_0xdf34('0x48')]()[_0xdf34('0x23')](respondWithResult(_0x359dee,null))[_0xdf34('0x42')](handleError(_0x359dee,null));};
\ No newline at end of file
+var _0x117b=['eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe'];(function(_0x1a8406,_0xeba253){var _0x96dab5=function(_0xf9c2fb){while(--_0xf9c2fb){_0x1a8406['push'](_0x1a8406['shift']());}};_0x96dab5(++_0xeba253);}(_0x117b,0xe4));var _0xb117=function(_0x1318e3,_0x1e249a){_0x1318e3=_0x1318e3-0x0;var _0x3c1875=_0x117b[_0x1318e3];return _0x3c1875;};'use strict';var emlformat=require(_0xb117('0x0'));var rimraf=require(_0xb117('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb117('0x2'));var rp=require('request-promise');var moment=require(_0xb117('0x3'));var BPromise=require(_0xb117('0x4'));var Mustache=require(_0xb117('0x5'));var util=require(_0xb117('0x6'));var path=require('path');var sox=require(_0xb117('0x7'));var csv=require(_0xb117('0x8'));var ejs=require(_0xb117('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb117('0xa'));var squel=require(_0xb117('0xb'));var crypto=require(_0xb117('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb117('0xd'));var toCsv=require(_0xb117('0x8'));var querystring=require(_0xb117('0xe'));var Papa=require(_0xb117('0xf'));var Redis=require('ioredis');var authService=require(_0xb117('0x10'));var qs=require(_0xb117('0x11'));var as=require(_0xb117('0x12'));var hardwareService=require(_0xb117('0x13'));var logger=require(_0xb117('0x14'))(_0xb117('0x15'));var utils=require(_0xb117('0x16'));var config=require(_0xb117('0x17'));var licenseUtil=require(_0xb117('0x18'));var db=require(_0xb117('0x19'))['db'];function respondWithStatusCode(_0x1fdaed,_0x3e772c){_0x3e772c=_0x3e772c||0xcc;return function(_0x5e530b){if(_0x5e530b){return _0x1fdaed[_0xb117('0x1a')](_0x3e772c);}return _0x1fdaed[_0xb117('0x1b')](_0x3e772c)['end']();};}function respondWithResult(_0x53f1b9,_0x1a920c){_0x1a920c=_0x1a920c||0xc8;return function(_0x1ffa63){if(_0x1ffa63){return _0x53f1b9['status'](_0x1a920c)['json'](_0x1ffa63);}};}function respondWithFilteredResult(_0x306dd0,_0x43b214){return function(_0x1270ac){if(_0x1270ac){var _0x10c9dc=typeof _0x43b214[_0xb117('0x1c')]===_0xb117('0x1d')&&typeof _0x43b214[_0xb117('0x1e')]===_0xb117('0x1d');var _0x55cd13=_0x1270ac['count'];var _0x56b5ba=_0x10c9dc?0x0:_0x43b214['offset'];var _0x5d38ee=_0x10c9dc?_0x1270ac[_0xb117('0x1f')]:_0x43b214['offset']+_0x43b214[_0xb117('0x1e')];var _0x212881;if(_0x5d38ee>=_0x55cd13){_0x5d38ee=_0x55cd13;_0x212881=0xc8;}else{_0x212881=0xce;}_0x306dd0[_0xb117('0x1b')](_0x212881);return _0x306dd0['set'](_0xb117('0x20'),_0x56b5ba+'-'+_0x5d38ee+'/'+_0x55cd13)['json'](_0x1270ac);}return null;};}function patchUpdates(_0x3a2008){return function(_0x4e5fdd){try{jsonpatch[_0xb117('0x21')](_0x4e5fdd,_0x3a2008,!![]);}catch(_0x21cab2){return BPromise['reject'](_0x21cab2);}return _0x4e5fdd[_0xb117('0x22')]();};}function saveUpdates(_0x112c91,_0x4f5162){return function(_0x1aec09){if(_0x1aec09){return _0x1aec09[_0xb117('0x23')](_0x112c91)[_0xb117('0x24')](function(_0xc2a84e){return _0xc2a84e;});}return null;};}function removeEntity(_0x218216,_0x3622f5){return function(_0x15d8a3){if(_0x15d8a3){return _0x15d8a3[_0xb117('0x25')]()[_0xb117('0x24')](function(){_0x218216[_0xb117('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bbb75,_0x278303){return function(_0x1bfd78){if(!_0x1bfd78){_0x5bbb75[_0xb117('0x1a')](0x194);}return _0x1bfd78;};}function handleError(_0x2f29e5,_0x89e168){_0x89e168=_0x89e168||0x1f4;return function(_0x228762){logger['error'](_0x228762[_0xb117('0x26')]);if(_0x228762[_0xb117('0x27')]){delete _0x228762[_0xb117('0x27')];}_0x2f29e5[_0xb117('0x1b')](_0x89e168)['send'](_0x228762);};}exports[_0xb117('0x28')]=function(_0x4d079f,_0x228e54){var _0x1096b4={},_0x15a5e5={},_0x30063e={'count':0x0,'rows':[]};var _0x47acdc=_[_0xb117('0x29')](db[_0xb117('0x2a')][_0xb117('0x2b')],function(_0x6ff728){return{'name':_0x6ff728[_0xb117('0x2c')],'type':_0x6ff728[_0xb117('0x2d')][_0xb117('0x2e')]};});_0x15a5e5['model']=_['map'](_0x47acdc,'name');_0x15a5e5[_0xb117('0x2f')]=_[_0xb117('0x30')](_0x4d079f[_0xb117('0x2f')]);_0x15a5e5['filters']=_[_0xb117('0x31')](_0x15a5e5[_0xb117('0x32')],_0x15a5e5[_0xb117('0x2f')]);_0x1096b4['attributes']=_[_0xb117('0x31')](_0x15a5e5[_0xb117('0x32')],qs[_0xb117('0x33')](_0x4d079f[_0xb117('0x2f')][_0xb117('0x33')]));_0x1096b4[_0xb117('0x34')]=_0x1096b4['attributes'][_0xb117('0x35')]?_0x1096b4['attributes']:_0x15a5e5[_0xb117('0x32')];if(!_0x4d079f[_0xb117('0x2f')][_0xb117('0x36')](_0xb117('0x37'))){_0x1096b4[_0xb117('0x1e')]=qs[_0xb117('0x1e')](_0x4d079f['query'][_0xb117('0x1e')]);_0x1096b4[_0xb117('0x1c')]=qs[_0xb117('0x1c')](_0x4d079f['query'][_0xb117('0x1c')]);}_0x1096b4[_0xb117('0x38')]=qs[_0xb117('0x39')](_0x4d079f[_0xb117('0x2f')]['sort']);_0x1096b4[_0xb117('0x3a')]=qs[_0xb117('0x3b')](_[_0xb117('0x3c')](_0x4d079f[_0xb117('0x2f')],_0x15a5e5[_0xb117('0x3b')]),_0x47acdc);if(_0x4d079f[_0xb117('0x2f')][_0xb117('0x3d')]){_0x1096b4[_0xb117('0x3a')]=_[_0xb117('0x3e')](_0x1096b4[_0xb117('0x3a')],{'$or':_[_0xb117('0x29')](_0x47acdc,function(_0x1b1cd2){if(_0x1b1cd2['type']!==_0xb117('0x3f')){var _0x4cbd9a={};_0x4cbd9a[_0x1b1cd2[_0xb117('0x27')]]={'$like':'%'+_0x4d079f['query']['filter']+'%'};return _0x4cbd9a;}})});}_0x1096b4=_[_0xb117('0x3e')]({},_0x1096b4,_0x4d079f[_0xb117('0x40')]);var _0x1b6c66={'where':_0x1096b4[_0xb117('0x3a')]};return db['MailSubstatus'][_0xb117('0x1f')](_0x1b6c66)[_0xb117('0x24')](function(_0x24beee){_0x30063e[_0xb117('0x1f')]=_0x24beee;if(_0x4d079f[_0xb117('0x2f')][_0xb117('0x41')]){_0x1096b4[_0xb117('0x42')]=[{'all':!![]}];}return db[_0xb117('0x2a')][_0xb117('0x43')](_0x1096b4);})['then'](function(_0x4a050c){_0x30063e[_0xb117('0x44')]=_0x4a050c;return _0x30063e;})[_0xb117('0x24')](respondWithFilteredResult(_0x228e54,_0x1096b4))[_0xb117('0x45')](handleError(_0x228e54,null));};exports[_0xb117('0x46')]=function(_0x256352,_0x44a9cc){var _0x5289a5={'raw':!![],'where':{'id':_0x256352[_0xb117('0x47')]['id']}},_0x23807c={};_0x23807c[_0xb117('0x32')]=_['keys'](db['MailSubstatus'][_0xb117('0x2b')]);_0x23807c['query']=_[_0xb117('0x30')](_0x256352[_0xb117('0x2f')]);_0x23807c['filters']=_[_0xb117('0x31')](_0x23807c[_0xb117('0x32')],_0x23807c[_0xb117('0x2f')]);_0x5289a5[_0xb117('0x34')]=_[_0xb117('0x31')](_0x23807c[_0xb117('0x32')],qs[_0xb117('0x33')](_0x256352[_0xb117('0x2f')][_0xb117('0x33')]));_0x5289a5[_0xb117('0x34')]=_0x5289a5[_0xb117('0x34')][_0xb117('0x35')]?_0x5289a5['attributes']:_0x23807c[_0xb117('0x32')];if(_0x256352[_0xb117('0x2f')][_0xb117('0x41')]){_0x5289a5[_0xb117('0x42')]=[{'all':!![]}];}_0x5289a5=_[_0xb117('0x3e')]({},_0x5289a5,_0x256352[_0xb117('0x40')]);return db['MailSubstatus'][_0xb117('0x48')](_0x5289a5)[_0xb117('0x24')](handleEntityNotFound(_0x44a9cc,null))[_0xb117('0x24')](respondWithResult(_0x44a9cc,null))[_0xb117('0x45')](handleError(_0x44a9cc,null));};exports[_0xb117('0x49')]=function(_0x36f1dd,_0x4d1340){return db[_0xb117('0x2a')][_0xb117('0x49')](_0x36f1dd['body'],{})[_0xb117('0x24')](respondWithResult(_0x4d1340,0xc9))[_0xb117('0x45')](handleError(_0x4d1340,null));};exports[_0xb117('0x23')]=function(_0x4418fb,_0x4dcc49){if(_0x4418fb[_0xb117('0x4a')]['id']){delete _0x4418fb[_0xb117('0x4a')]['id'];}return db[_0xb117('0x2a')]['find']({'where':{'id':_0x4418fb['params']['id']}})[_0xb117('0x24')](handleEntityNotFound(_0x4dcc49,null))['then'](saveUpdates(_0x4418fb['body'],null))[_0xb117('0x24')](respondWithResult(_0x4dcc49,null))[_0xb117('0x45')](handleError(_0x4dcc49,null));};exports[_0xb117('0x25')]=function(_0x4168ed,_0x1655a1){return db[_0xb117('0x2a')][_0xb117('0x48')]({'where':{'id':_0x4168ed['params']['id']}})[_0xb117('0x24')](handleEntityNotFound(_0x1655a1,null))[_0xb117('0x24')](removeEntity(_0x1655a1,null))[_0xb117('0x45')](handleError(_0x1655a1,null));};exports[_0xb117('0x4b')]=function(_0x11fca5,_0x527d0b){return db['MailSubstatus'][_0xb117('0x4b')]()['then'](respondWithResult(_0x527d0b,null))[_0xb117('0x45')](handleError(_0x527d0b,null));};
\ No newline at end of file
index cea2891..e6043e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c1a=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailSubstatus','mail_substatuses'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9c1a,0x16c));var _0xa9c1=function(_0x130dac,_0x4799d4){_0x130dac=_0x130dac-0x0;var _0x4d2555=_0x9c1a[_0x130dac];return _0x4d2555;};'use strict';var _=require(_0xa9c1('0x0'));var util=require(_0xa9c1('0x1'));var logger=require(_0xa9c1('0x2'))('api');var moment=require(_0xa9c1('0x3'));var BPromise=require(_0xa9c1('0x4'));var rp=require(_0xa9c1('0x5'));var fs=require('fs');var path=require(_0xa9c1('0x6'));var rimraf=require(_0xa9c1('0x7'));var config=require(_0xa9c1('0x8'));var attributes=require('./mailSubstatus.attributes');module[_0xa9c1('0x9')]=function(_0x57ae61,_0x3b2994){return _0x57ae61[_0xa9c1('0xa')](_0xa9c1('0xb'),attributes,{'tableName':_0xa9c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1eb7=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','lodash','api','moment'];(function(_0x177b79,_0x4a820b){var _0x24b2ed=function(_0x249f47){while(--_0x249f47){_0x177b79['push'](_0x177b79['shift']());}};_0x24b2ed(++_0x4a820b);}(_0x1eb7,0x16e));var _0x71eb=function(_0x5c33ae,_0x49b8b7){_0x5c33ae=_0x5c33ae-0x0;var _0x1be750=_0x1eb7[_0x5c33ae];return _0x1be750;};'use strict';var _=require(_0x71eb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x71eb('0x1'));var moment=require(_0x71eb('0x2'));var BPromise=require('bluebird');var rp=require(_0x71eb('0x3'));var fs=require('fs');var path=require(_0x71eb('0x4'));var rimraf=require(_0x71eb('0x5'));var config=require(_0x71eb('0x6'));var attributes=require(_0x71eb('0x7'));module['exports']=function(_0x1b4a35,_0x23c71c){return _0x1b4a35[_0x71eb('0x8')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c56f985..0c087cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc488=['result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc488,0x178));var _0x8c48=function(_0x31bbbb,_0x46b803){_0x31bbbb=_0x31bbbb-0x0;var _0x1444ae=_0xc488[_0x31bbbb];return _0x1444ae;};'use strict';var _=require(_0x8c48('0x0'));var util=require(_0x8c48('0x1'));var moment=require('moment');var BPromise=require(_0x8c48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c48('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c48('0x4'));var logger=require(_0x8c48('0x5'))(_0x8c48('0x6'));var config=require('../../config/environment');var jayson=require(_0x8c48('0x7'));var client=jayson[_0x8c48('0x8')][_0x8c48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13ff26,_0x406cc0,_0xbe3e82){return new BPromise(function(_0x5b15f4,_0x4bcdd3){return client[_0x8c48('0xa')](_0x13ff26,_0xbe3e82)['then'](function(_0x4788f9){logger[_0x8c48('0xb')](_0x8c48('0xc'),_0x406cc0,_0x8c48('0xd'));logger[_0x8c48('0xe')](_0x8c48('0xf'),_0x406cc0,_0x8c48('0xd'),JSON[_0x8c48('0x10')](_0x4788f9));if(_0x4788f9[_0x8c48('0x11')]){if(_0x4788f9[_0x8c48('0x11')][_0x8c48('0x12')]===0x1f4){logger[_0x8c48('0x11')](_0x8c48('0xc'),_0x406cc0,_0x4788f9['error'][_0x8c48('0x13')]);return _0x4bcdd3(_0x4788f9['error'][_0x8c48('0x13')]);}logger[_0x8c48('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x406cc0,_0x4788f9[_0x8c48('0x11')][_0x8c48('0x13')]);return _0x5b15f4(_0x4788f9[_0x8c48('0x11')][_0x8c48('0x13')]);}else{logger[_0x8c48('0xb')](_0x8c48('0xc'),_0x406cc0,_0x8c48('0xd'));_0x5b15f4(_0x4788f9[_0x8c48('0x14')]['message']);}})[_0x8c48('0x15')](function(_0xfe642e){logger[_0x8c48('0x11')](_0x8c48('0xc'),_0x406cc0,_0xfe642e);_0x4bcdd3(_0xfe642e);});});}
\ No newline at end of file
+var _0xcde0=['http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x42a366,_0x117d6c){var _0x5154e4=function(_0x111813){while(--_0x111813){_0x42a366['push'](_0x42a366['shift']());}};_0x5154e4(++_0x117d6c);}(_0xcde0,0x19a));var _0x0cde=function(_0x17b201,_0x35ae34){_0x17b201=_0x17b201-0x0;var _0xb6cbc7=_0xcde0[_0x17b201];return _0xb6cbc7;};'use strict';var _=require('lodash');var util=require(_0x0cde('0x0'));var moment=require(_0x0cde('0x1'));var BPromise=require(_0x0cde('0x2'));var rs=require(_0x0cde('0x3'));var fs=require('fs');var Redis=require(_0x0cde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cde('0x5'));var logger=require('../../config/logger')(_0x0cde('0x6'));var config=require(_0x0cde('0x7'));var jayson=require(_0x0cde('0x8'));var client=jayson[_0x0cde('0x9')][_0x0cde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d649,_0x1ff141,_0x2ce024){return new BPromise(function(_0x4e623d,_0x54fb16){return client[_0x0cde('0xb')](_0x30d649,_0x2ce024)[_0x0cde('0xc')](function(_0x1c580e){logger[_0x0cde('0xd')](_0x0cde('0xe'),_0x1ff141,_0x0cde('0xf'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1ff141,_0x0cde('0xf'),JSON[_0x0cde('0x10')](_0x1c580e));if(_0x1c580e[_0x0cde('0x11')]){if(_0x1c580e['error']['code']===0x1f4){logger['error'](_0x0cde('0xe'),_0x1ff141,_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);return _0x54fb16(_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);}logger[_0x0cde('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1ff141,_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);return _0x4e623d(_0x1c580e[_0x0cde('0x11')][_0x0cde('0x12')]);}else{logger[_0x0cde('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x1ff141,_0x0cde('0xf'));_0x4e623d(_0x1c580e[_0x0cde('0x13')][_0x0cde('0x12')]);}})['catch'](function(_0x445892){logger['error'](_0x0cde('0xe'),_0x1ff141,_0x445892);_0x54fb16(_0x445892);});});}
\ No newline at end of file
index 24d26a8..1af66b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf48b=['/describe','describe','/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x7b534f,_0x8e91bc){var _0x2fae25=function(_0x85442b){while(--_0x85442b){_0x7b534f['push'](_0x7b534f['shift']());}};_0x2fae25(++_0x8e91bc);}(_0xf48b,0x95));var _0xbf48=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf48b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xbf48('0x0'));var path=require(_0xbf48('0x1'));var timeout=require(_0xbf48('0x2'));var express=require(_0xbf48('0x3'));var router=express['Router']();var fs_extra=require(_0xbf48('0x4'));var auth=require(_0xbf48('0x5'));var interaction=require(_0xbf48('0x6'));var config=require(_0xbf48('0x7'));var controller=require('./mailTransferReport.controller');router[_0xbf48('0x8')]('/',auth[_0xbf48('0x9')](),controller[_0xbf48('0xa')]);router[_0xbf48('0x8')](_0xbf48('0xb'),auth[_0xbf48('0x9')](),controller[_0xbf48('0xc')]);router[_0xbf48('0x8')](_0xbf48('0xd'),auth['isAuthenticated'](),controller[_0xbf48('0xe')]);router[_0xbf48('0xf')]('/',auth[_0xbf48('0x9')](),controller[_0xbf48('0x10')]);router[_0xbf48('0x11')](_0xbf48('0xd'),auth[_0xbf48('0x9')](),controller[_0xbf48('0x12')]);router[_0xbf48('0x13')](_0xbf48('0xd'),auth[_0xbf48('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe21c=['./mailTransferReport.controller','get','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4a5516,_0x5a1374){var _0x1ffe5c=function(_0x1c60d9){while(--_0x1c60d9){_0x4a5516['push'](_0x4a5516['shift']());}};_0x1ffe5c(++_0x5a1374);}(_0xe21c,0x163));var _0xce21=function(_0x1876b2,_0x5d0225){_0x1876b2=_0x1876b2-0x0;var _0x9fb1e0=_0xe21c[_0x1876b2];return _0x9fb1e0;};'use strict';var multer=require(_0xce21('0x0'));var util=require(_0xce21('0x1'));var path=require('path');var timeout=require(_0xce21('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xce21('0x3'));var auth=require(_0xce21('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce21('0x5'));var controller=require(_0xce21('0x6'));router[_0xce21('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xce21('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xce21('0x8')]);router[_0xce21('0x7')](_0xce21('0x9'),auth[_0xce21('0xa')](),controller[_0xce21('0xb')]);router[_0xce21('0xc')]('/',auth[_0xce21('0xa')](),controller[_0xce21('0xd')]);router[_0xce21('0xe')]('/:id',auth[_0xce21('0xa')](),controller[_0xce21('0xf')]);router[_0xce21('0x10')](_0xce21('0x9'),auth['isAuthenticated'](),controller[_0xce21('0x11')]);module[_0xce21('0x12')]=router;
\ No newline at end of file
index 35664b0..60474e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4ccc7a,_0x2b65d2){var _0x1f8000=function(_0x3463aa){while(--_0x3463aa){_0x4ccc7a['push'](_0x4ccc7a['shift']());}};_0x1f8000(++_0x2b65d2);}(_0x9c44,0x178));var _0x49c4=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9c44[_0x32f7d7];return _0x133d09;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26fc52,_0x5bf097){var _0x5239b1=function(_0x24b9c7){while(--_0x24b9c7){_0x26fc52['push'](_0x26fc52['shift']());}};_0x5239b1(++_0x5bf097);}(_0xedd9,0xfc));var _0x9edd=function(_0xffc740,_0x29a441){_0xffc740=_0xffc740-0x0;var _0x536fb2=_0xedd9[_0xffc740];return _0x536fb2;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index ec6df39..a343b9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a2f=['fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','MailTransferReport','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','include','catch','show','params','rawAttributes','includeAll','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x30dcd6,_0x5c6723){var _0x5010aa=function(_0x272548){while(--_0x272548){_0x30dcd6['push'](_0x30dcd6['shift']());}};_0x5010aa(++_0x5c6723);}(_0x7a2f,0x8a));var _0xf7a2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7a2f[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7a2('0x0'));var zipdir=require(_0xf7a2('0x1'));var jsonpatch=require(_0xf7a2('0x2'));var rp=require(_0xf7a2('0x3'));var moment=require('moment');var BPromise=require(_0xf7a2('0x4'));var Mustache=require(_0xf7a2('0x5'));var util=require(_0xf7a2('0x6'));var path=require(_0xf7a2('0x7'));var sox=require('sox');var csv=require(_0xf7a2('0x8'));var ejs=require(_0xf7a2('0x9'));var fs=require('fs');var fs_extra=require(_0xf7a2('0xa'));var _=require(_0xf7a2('0xb'));var squel=require(_0xf7a2('0xc'));var crypto=require(_0xf7a2('0xd'));var jsforce=require(_0xf7a2('0xe'));var deskjs=require(_0xf7a2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf7a2('0x10'));var Redis=require('ioredis');var authService=require(_0xf7a2('0x11'));var qs=require(_0xf7a2('0x12'));var as=require(_0xf7a2('0x13'));var hardwareService=require(_0xf7a2('0x14'));var logger=require('../../config/logger')(_0xf7a2('0x15'));var utils=require(_0xf7a2('0x16'));var config=require(_0xf7a2('0x17'));var licenseUtil=require(_0xf7a2('0x18'));var db=require(_0xf7a2('0x19'))['db'];function respondWithStatusCode(_0x2e9d82,_0x31ebc3){_0x31ebc3=_0x31ebc3||0xcc;return function(_0x2cf59e){if(_0x2cf59e){return _0x2e9d82[_0xf7a2('0x1a')](_0x31ebc3);}return _0x2e9d82[_0xf7a2('0x1b')](_0x31ebc3)[_0xf7a2('0x1c')]();};}function respondWithResult(_0x4f8b58,_0x123f2b){_0x123f2b=_0x123f2b||0xc8;return function(_0x4d9990){if(_0x4d9990){return _0x4f8b58[_0xf7a2('0x1b')](_0x123f2b)[_0xf7a2('0x1d')](_0x4d9990);}};}function respondWithFilteredResult(_0x110e87,_0x34c588){return function(_0x40fe63){if(_0x40fe63){var _0x1624b1=typeof _0x34c588[_0xf7a2('0x1e')]===_0xf7a2('0x1f')&&typeof _0x34c588[_0xf7a2('0x20')]===_0xf7a2('0x1f');var _0x6a60c=_0x40fe63[_0xf7a2('0x21')];var _0x47378e=_0x1624b1?0x0:_0x34c588['offset'];var _0x3b3a84=_0x1624b1?_0x40fe63[_0xf7a2('0x21')]:_0x34c588[_0xf7a2('0x1e')]+_0x34c588['limit'];var _0x528e06;if(_0x3b3a84>=_0x6a60c){_0x3b3a84=_0x6a60c;_0x528e06=0xc8;}else{_0x528e06=0xce;}_0x110e87[_0xf7a2('0x1b')](_0x528e06);return _0x110e87[_0xf7a2('0x22')](_0xf7a2('0x23'),_0x47378e+'-'+_0x3b3a84+'/'+_0x6a60c)[_0xf7a2('0x1d')](_0x40fe63);}return null;};}function patchUpdates(_0x543b3b){return function(_0x12b10d){try{jsonpatch[_0xf7a2('0x24')](_0x12b10d,_0x543b3b,!![]);}catch(_0x45e4fa){return BPromise['reject'](_0x45e4fa);}return _0x12b10d[_0xf7a2('0x25')]();};}function saveUpdates(_0x220ea5,_0x536912){return function(_0x2ab04f){if(_0x2ab04f){return _0x2ab04f[_0xf7a2('0x26')](_0x220ea5)[_0xf7a2('0x27')](function(_0x5ba5c6){return _0x5ba5c6;});}return null;};}function removeEntity(_0x5970bc,_0x37ed9e){return function(_0x14114c){if(_0x14114c){return _0x14114c[_0xf7a2('0x28')]()[_0xf7a2('0x27')](function(){_0x5970bc[_0xf7a2('0x1b')](0xcc)[_0xf7a2('0x1c')]();});}};}function handleEntityNotFound(_0x227a29,_0x32ba19){return function(_0x11df1e){if(!_0x11df1e){_0x227a29['sendStatus'](0x194);}return _0x11df1e;};}function handleError(_0x1999a5,_0x5257e5){_0x5257e5=_0x5257e5||0x1f4;return function(_0x4231b7){logger[_0xf7a2('0x29')](_0x4231b7[_0xf7a2('0x2a')]);if(_0x4231b7[_0xf7a2('0x2b')]){delete _0x4231b7[_0xf7a2('0x2b')];}_0x1999a5[_0xf7a2('0x1b')](_0x5257e5)[_0xf7a2('0x2c')](_0x4231b7);};}exports[_0xf7a2('0x2d')]=function(_0x589b49,_0x6bac31){var _0x36bd50={},_0x53c2a6={},_0x2eb267={'count':0x0,'rows':[]};var _0x380a42=_['map'](db[_0xf7a2('0x2e')]['rawAttributes'],function(_0x306ff6){return{'name':_0x306ff6[_0xf7a2('0x2f')],'type':_0x306ff6[_0xf7a2('0x30')]['key']};});_0x53c2a6[_0xf7a2('0x31')]=_['map'](_0x380a42,_0xf7a2('0x2b'));_0x53c2a6[_0xf7a2('0x32')]=_[_0xf7a2('0x33')](_0x589b49[_0xf7a2('0x32')]);_0x53c2a6['filters']=_[_0xf7a2('0x34')](_0x53c2a6['model'],_0x53c2a6[_0xf7a2('0x32')]);_0x36bd50['attributes']=_[_0xf7a2('0x34')](_0x53c2a6[_0xf7a2('0x31')],qs[_0xf7a2('0x35')](_0x589b49[_0xf7a2('0x32')][_0xf7a2('0x35')]));_0x36bd50['attributes']=_0x36bd50[_0xf7a2('0x36')][_0xf7a2('0x37')]?_0x36bd50[_0xf7a2('0x36')]:_0x53c2a6[_0xf7a2('0x31')];if(!_0x589b49[_0xf7a2('0x32')][_0xf7a2('0x38')]('nolimit')){_0x36bd50[_0xf7a2('0x20')]=qs[_0xf7a2('0x20')](_0x589b49[_0xf7a2('0x32')][_0xf7a2('0x20')]);_0x36bd50[_0xf7a2('0x1e')]=qs[_0xf7a2('0x1e')](_0x589b49[_0xf7a2('0x32')][_0xf7a2('0x1e')]);}_0x36bd50['order']=qs['sort'](_0x589b49[_0xf7a2('0x32')][_0xf7a2('0x39')]);_0x36bd50[_0xf7a2('0x3a')]=qs[_0xf7a2('0x3b')](_[_0xf7a2('0x3c')](_0x589b49[_0xf7a2('0x32')],_0x53c2a6['filters']),_0x380a42);if(_0x589b49[_0xf7a2('0x32')][_0xf7a2('0x3d')]){_0x36bd50['where']=_[_0xf7a2('0x3e')](_0x36bd50[_0xf7a2('0x3a')],{'$or':_['map'](_0x380a42,function(_0x37e242){if(_0x37e242[_0xf7a2('0x30')]!=='VIRTUAL'){var _0x1a3105={};_0x1a3105[_0x37e242[_0xf7a2('0x2b')]]={'$like':'%'+_0x589b49[_0xf7a2('0x32')]['filter']+'%'};return _0x1a3105;}})});}_0x36bd50=_['merge']({},_0x36bd50,_0x589b49['options']);var _0x4e8255={'where':_0x36bd50[_0xf7a2('0x3a')]};return db[_0xf7a2('0x2e')][_0xf7a2('0x21')](_0x4e8255)[_0xf7a2('0x27')](function(_0x3fb107){_0x2eb267[_0xf7a2('0x21')]=_0x3fb107;if(_0x589b49[_0xf7a2('0x32')]['includeAll']){_0x36bd50[_0xf7a2('0x3f')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x36bd50);})[_0xf7a2('0x27')](function(_0xc610a9){_0x2eb267['rows']=_0xc610a9;return _0x2eb267;})[_0xf7a2('0x27')](respondWithFilteredResult(_0x6bac31,_0x36bd50))[_0xf7a2('0x40')](handleError(_0x6bac31,null));};exports[_0xf7a2('0x41')]=function(_0x1597d7,_0x390949){var _0x1fe96c={'raw':!![],'where':{'id':_0x1597d7[_0xf7a2('0x42')]['id']}},_0x4d4295={};_0x4d4295[_0xf7a2('0x31')]=_[_0xf7a2('0x33')](db['MailTransferReport'][_0xf7a2('0x43')]);_0x4d4295['query']=_[_0xf7a2('0x33')](_0x1597d7[_0xf7a2('0x32')]);_0x4d4295[_0xf7a2('0x3b')]=_[_0xf7a2('0x34')](_0x4d4295[_0xf7a2('0x31')],_0x4d4295[_0xf7a2('0x32')]);_0x1fe96c[_0xf7a2('0x36')]=_['intersection'](_0x4d4295['model'],qs['fields'](_0x1597d7['query'][_0xf7a2('0x35')]));_0x1fe96c[_0xf7a2('0x36')]=_0x1fe96c[_0xf7a2('0x36')][_0xf7a2('0x37')]?_0x1fe96c[_0xf7a2('0x36')]:_0x4d4295[_0xf7a2('0x31')];if(_0x1597d7[_0xf7a2('0x32')][_0xf7a2('0x44')]){_0x1fe96c[_0xf7a2('0x3f')]=[{'all':!![]}];}_0x1fe96c=_['merge']({},_0x1fe96c,_0x1597d7[_0xf7a2('0x45')]);return db[_0xf7a2('0x2e')][_0xf7a2('0x46')](_0x1fe96c)[_0xf7a2('0x27')](handleEntityNotFound(_0x390949,null))['then'](respondWithResult(_0x390949,null))['catch'](handleError(_0x390949,null));};exports['create']=function(_0x2798d7,_0x4a4376){return db[_0xf7a2('0x2e')][_0xf7a2('0x47')](_0x2798d7[_0xf7a2('0x48')],{})[_0xf7a2('0x27')](respondWithResult(_0x4a4376,0xc9))[_0xf7a2('0x40')](handleError(_0x4a4376,null));};exports[_0xf7a2('0x26')]=function(_0x223159,_0x22d48d){if(_0x223159[_0xf7a2('0x48')]['id']){delete _0x223159['body']['id'];}return db[_0xf7a2('0x2e')]['find']({'where':{'id':_0x223159[_0xf7a2('0x42')]['id']}})['then'](handleEntityNotFound(_0x22d48d,null))['then'](saveUpdates(_0x223159[_0xf7a2('0x48')],null))['then'](respondWithResult(_0x22d48d,null))[_0xf7a2('0x40')](handleError(_0x22d48d,null));};exports[_0xf7a2('0x28')]=function(_0xc3d920,_0x55c44){return db['MailTransferReport'][_0xf7a2('0x46')]({'where':{'id':_0xc3d920[_0xf7a2('0x42')]['id']}})[_0xf7a2('0x27')](handleEntityNotFound(_0x55c44,null))[_0xf7a2('0x27')](removeEntity(_0x55c44,null))['catch'](handleError(_0x55c44,null));};exports['describe']=function(_0x3cf4a4,_0xf4850c){return db[_0xf7a2('0x2e')][_0xf7a2('0x49')]()[_0xf7a2('0x27')](respondWithResult(_0xf4850c,null))[_0xf7a2('0x40')](handleError(_0xf4850c,null));};
\ No newline at end of file
+var _0xfcad=['reject','save','then','name','send','map','MailTransferReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end','status','limit','undefined','count','set','apply'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xfcad,0xba));var _0xdfca=function(_0x3913f5,_0x224ec5){_0x3913f5=_0x3913f5-0x0;var _0x59c75f=_0xfcad[_0x3913f5];return _0x59c75f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfca('0x0'));var zipdir=require(_0xdfca('0x1'));var jsonpatch=require(_0xdfca('0x2'));var rp=require(_0xdfca('0x3'));var moment=require(_0xdfca('0x4'));var BPromise=require(_0xdfca('0x5'));var Mustache=require(_0xdfca('0x6'));var util=require(_0xdfca('0x7'));var path=require(_0xdfca('0x8'));var sox=require(_0xdfca('0x9'));var csv=require(_0xdfca('0xa'));var ejs=require(_0xdfca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfca('0xc'));var squel=require(_0xdfca('0xd'));var crypto=require(_0xdfca('0xe'));var jsforce=require(_0xdfca('0xf'));var deskjs=require(_0xdfca('0x10'));var toCsv=require(_0xdfca('0xa'));var querystring=require(_0xdfca('0x11'));var Papa=require('papaparse');var Redis=require(_0xdfca('0x12'));var authService=require(_0xdfca('0x13'));var qs=require(_0xdfca('0x14'));var as=require(_0xdfca('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfca('0x16'))(_0xdfca('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdfca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9480,_0x168c65){_0x168c65=_0x168c65||0xcc;return function(_0x587625){if(_0x587625){return _0x4b9480[_0xdfca('0x19')](_0x168c65);}return _0x4b9480['status'](_0x168c65)[_0xdfca('0x1a')]();};}function respondWithResult(_0x3f063c,_0x3ad0bb){_0x3ad0bb=_0x3ad0bb||0xc8;return function(_0x59986c){if(_0x59986c){return _0x3f063c[_0xdfca('0x1b')](_0x3ad0bb)['json'](_0x59986c);}};}function respondWithFilteredResult(_0x23638e,_0x387943){return function(_0x4b9d3a){if(_0x4b9d3a){var _0x3bf8f2=typeof _0x387943['offset']==='undefined'&&typeof _0x387943[_0xdfca('0x1c')]===_0xdfca('0x1d');var _0x158ca8=_0x4b9d3a['count'];var _0x256e9e=_0x3bf8f2?0x0:_0x387943['offset'];var _0x424d62=_0x3bf8f2?_0x4b9d3a[_0xdfca('0x1e')]:_0x387943['offset']+_0x387943[_0xdfca('0x1c')];var _0x59aa5e;if(_0x424d62>=_0x158ca8){_0x424d62=_0x158ca8;_0x59aa5e=0xc8;}else{_0x59aa5e=0xce;}_0x23638e[_0xdfca('0x1b')](_0x59aa5e);return _0x23638e[_0xdfca('0x1f')]('Content-Range',_0x256e9e+'-'+_0x424d62+'/'+_0x158ca8)['json'](_0x4b9d3a);}return null;};}function patchUpdates(_0x6f8494){return function(_0x2e89dd){try{jsonpatch[_0xdfca('0x20')](_0x2e89dd,_0x6f8494,!![]);}catch(_0x26ac6e){return BPromise[_0xdfca('0x21')](_0x26ac6e);}return _0x2e89dd[_0xdfca('0x22')]();};}function saveUpdates(_0x3f1e77,_0x29c893){return function(_0x2659a7){if(_0x2659a7){return _0x2659a7['update'](_0x3f1e77)[_0xdfca('0x23')](function(_0x5e1182){return _0x5e1182;});}return null;};}function removeEntity(_0x1131fd,_0x37d6a1){return function(_0x36bebb){if(_0x36bebb){return _0x36bebb['destroy']()['then'](function(){_0x1131fd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f14c0,_0x46e488){return function(_0x353857){if(!_0x353857){_0x3f14c0['sendStatus'](0x194);}return _0x353857;};}function handleError(_0x42a944,_0x547392){_0x547392=_0x547392||0x1f4;return function(_0x5c99e9){logger['error'](_0x5c99e9['stack']);if(_0x5c99e9['name']){delete _0x5c99e9[_0xdfca('0x24')];}_0x42a944[_0xdfca('0x1b')](_0x547392)[_0xdfca('0x25')](_0x5c99e9);};}exports['index']=function(_0x2f53a7,_0x136116){var _0x57d1c0={},_0xaf42ea={},_0x5862ee={'count':0x0,'rows':[]};var _0x87d252=_[_0xdfca('0x26')](db[_0xdfca('0x27')][_0xdfca('0x28')],function(_0x52b2c1){return{'name':_0x52b2c1['fieldName'],'type':_0x52b2c1[_0xdfca('0x29')][_0xdfca('0x2a')]};});_0xaf42ea[_0xdfca('0x2b')]=_['map'](_0x87d252,'name');_0xaf42ea[_0xdfca('0x2c')]=_['keys'](_0x2f53a7[_0xdfca('0x2c')]);_0xaf42ea['filters']=_[_0xdfca('0x2d')](_0xaf42ea[_0xdfca('0x2b')],_0xaf42ea[_0xdfca('0x2c')]);_0x57d1c0[_0xdfca('0x2e')]=_[_0xdfca('0x2d')](_0xaf42ea[_0xdfca('0x2b')],qs[_0xdfca('0x2f')](_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x2f')]));_0x57d1c0[_0xdfca('0x2e')]=_0x57d1c0[_0xdfca('0x2e')][_0xdfca('0x30')]?_0x57d1c0[_0xdfca('0x2e')]:_0xaf42ea['model'];if(!_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x31')](_0xdfca('0x32'))){_0x57d1c0['limit']=qs[_0xdfca('0x1c')](_0x2f53a7[_0xdfca('0x2c')]['limit']);_0x57d1c0[_0xdfca('0x33')]=qs[_0xdfca('0x33')](_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x33')]);}_0x57d1c0[_0xdfca('0x34')]=qs[_0xdfca('0x35')](_0x2f53a7['query'][_0xdfca('0x35')]);_0x57d1c0['where']=qs['filters'](_[_0xdfca('0x36')](_0x2f53a7[_0xdfca('0x2c')],_0xaf42ea[_0xdfca('0x37')]),_0x87d252);if(_0x2f53a7['query'][_0xdfca('0x38')]){_0x57d1c0[_0xdfca('0x39')]=_[_0xdfca('0x3a')](_0x57d1c0['where'],{'$or':_[_0xdfca('0x26')](_0x87d252,function(_0x1eb5bb){if(_0x1eb5bb[_0xdfca('0x29')]!==_0xdfca('0x3b')){var _0x3665b7={};_0x3665b7[_0x1eb5bb[_0xdfca('0x24')]]={'$like':'%'+_0x2f53a7[_0xdfca('0x2c')]['filter']+'%'};return _0x3665b7;}})});}_0x57d1c0=_['merge']({},_0x57d1c0,_0x2f53a7[_0xdfca('0x3c')]);var _0x1e2f81={'where':_0x57d1c0[_0xdfca('0x39')]};return db[_0xdfca('0x27')][_0xdfca('0x1e')](_0x1e2f81)['then'](function(_0x1d9942){_0x5862ee[_0xdfca('0x1e')]=_0x1d9942;if(_0x2f53a7[_0xdfca('0x2c')][_0xdfca('0x3d')]){_0x57d1c0[_0xdfca('0x3e')]=[{'all':!![]}];}return db[_0xdfca('0x27')][_0xdfca('0x3f')](_0x57d1c0);})['then'](function(_0x2862b3){_0x5862ee[_0xdfca('0x40')]=_0x2862b3;return _0x5862ee;})['then'](respondWithFilteredResult(_0x136116,_0x57d1c0))[_0xdfca('0x41')](handleError(_0x136116,null));};exports[_0xdfca('0x42')]=function(_0x2abf20,_0x3fbd4c){var _0x209702={'raw':!![],'where':{'id':_0x2abf20[_0xdfca('0x43')]['id']}},_0x4dba22={};_0x4dba22[_0xdfca('0x2b')]=_[_0xdfca('0x44')](db[_0xdfca('0x27')][_0xdfca('0x28')]);_0x4dba22[_0xdfca('0x2c')]=_[_0xdfca('0x44')](_0x2abf20['query']);_0x4dba22[_0xdfca('0x37')]=_['intersection'](_0x4dba22[_0xdfca('0x2b')],_0x4dba22[_0xdfca('0x2c')]);_0x209702[_0xdfca('0x2e')]=_[_0xdfca('0x2d')](_0x4dba22['model'],qs[_0xdfca('0x2f')](_0x2abf20[_0xdfca('0x2c')][_0xdfca('0x2f')]));_0x209702['attributes']=_0x209702[_0xdfca('0x2e')]['length']?_0x209702[_0xdfca('0x2e')]:_0x4dba22[_0xdfca('0x2b')];if(_0x2abf20['query'][_0xdfca('0x3d')]){_0x209702['include']=[{'all':!![]}];}_0x209702=_[_0xdfca('0x3a')]({},_0x209702,_0x2abf20[_0xdfca('0x3c')]);return db['MailTransferReport'][_0xdfca('0x45')](_0x209702)['then'](handleEntityNotFound(_0x3fbd4c,null))[_0xdfca('0x23')](respondWithResult(_0x3fbd4c,null))[_0xdfca('0x41')](handleError(_0x3fbd4c,null));};exports[_0xdfca('0x46')]=function(_0x2c43f0,_0x35856c){return db[_0xdfca('0x27')][_0xdfca('0x46')](_0x2c43f0[_0xdfca('0x47')],{})[_0xdfca('0x23')](respondWithResult(_0x35856c,0xc9))['catch'](handleError(_0x35856c,null));};exports['update']=function(_0x92f853,_0x423d7b){if(_0x92f853[_0xdfca('0x47')]['id']){delete _0x92f853[_0xdfca('0x47')]['id'];}return db[_0xdfca('0x27')][_0xdfca('0x45')]({'where':{'id':_0x92f853['params']['id']}})['then'](handleEntityNotFound(_0x423d7b,null))[_0xdfca('0x23')](saveUpdates(_0x92f853['body'],null))['then'](respondWithResult(_0x423d7b,null))[_0xdfca('0x41')](handleError(_0x423d7b,null));};exports['destroy']=function(_0x262623,_0x10d054){return db[_0xdfca('0x27')]['find']({'where':{'id':_0x262623['params']['id']}})['then'](handleEntityNotFound(_0x10d054,null))[_0xdfca('0x23')](removeEntity(_0x10d054,null))[_0xdfca('0x41')](handleError(_0x10d054,null));};exports['describe']=function(_0x2aed98,_0x15963a){return db['MailTransferReport'][_0xdfca('0x48')]()[_0xdfca('0x23')](respondWithResult(_0x15963a,null))[_0xdfca('0x41')](handleError(_0x15963a,null));};
\ No newline at end of file
index 442e022..30c3cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7b=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','report_mail_transfer','uniqueid'];(function(_0x36c20d,_0x1b8b42){var _0x147bad=function(_0x30cde0){while(--_0x30cde0){_0x36c20d['push'](_0x36c20d['shift']());}};_0x147bad(++_0x1b8b42);}(_0x6f7b,0x168));var _0xb6f7=function(_0x160f64,_0x1cf7f5){_0x160f64=_0x160f64-0x0;var _0x21860c=_0x6f7b[_0x160f64];return _0x21860c;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var logger=require(_0xb6f7('0x1'))(_0xb6f7('0x2'));var moment=require(_0xb6f7('0x3'));var BPromise=require(_0xb6f7('0x4'));var rp=require(_0xb6f7('0x5'));var fs=require('fs');var path=require(_0xb6f7('0x6'));var rimraf=require('rimraf');var config=require(_0xb6f7('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xb6f7('0x8')]=function(_0x25cec3,_0x59b2d9){return _0x25cec3[_0xb6f7('0x9')]('MailTransferReport',attributes,{'tableName':_0xb6f7('0xa'),'paranoid':![],'indexes':[{'name':_0xb6f7('0xb'),'fields':[_0xb6f7('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a5e=['moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x23cdce,_0x344a6b){var _0x2076d4=function(_0x41db1e){while(--_0x41db1e){_0x23cdce['push'](_0x23cdce['shift']());}};_0x2076d4(++_0x344a6b);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x183e80,_0x5baa52){_0x183e80=_0x183e80-0x0;var _0x1e8fda=_0x3a5e[_0x183e80];return _0x1e8fda;};'use strict';var _=require(_0xe3a5('0x0'));var util=require(_0xe3a5('0x1'));var logger=require(_0xe3a5('0x2'))(_0xe3a5('0x3'));var moment=require(_0xe3a5('0x4'));var BPromise=require(_0xe3a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3a5('0x6'));var rimraf=require(_0xe3a5('0x7'));var config=require(_0xe3a5('0x8'));var attributes=require(_0xe3a5('0x9'));module[_0xe3a5('0xa')]=function(_0x499f61,_0x5e1507){return _0x499f61[_0xe3a5('0xb')]('MailTransferReport',attributes,{'tableName':_0xe3a5('0xc'),'paranoid':![],'indexes':[{'name':_0xe3a5('0xd'),'fields':[_0xe3a5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 26a9b9f..280447f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fe2=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3eb4a6,_0x2c4aae){var _0x3401d3=function(_0x5598e9){while(--_0x5598e9){_0x3eb4a6['push'](_0x3eb4a6['shift']());}};_0x3401d3(++_0x2c4aae);}(_0x3fe2,0x1c4));var _0x23fe=function(_0x23f7a9,_0x1e615c){_0x23f7a9=_0x23f7a9-0x0;var _0x11dc17=_0x3fe2[_0x23f7a9];return _0x11dc17;};'use strict';var _=require(_0x23fe('0x0'));var util=require(_0x23fe('0x1'));var moment=require(_0x23fe('0x2'));var BPromise=require(_0x23fe('0x3'));var rs=require(_0x23fe('0x4'));var fs=require('fs');var Redis=require(_0x23fe('0x5'));var db=require(_0x23fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x23fe('0x7'))(_0x23fe('0x8'));var config=require(_0x23fe('0x9'));var jayson=require(_0x23fe('0xa'));var client=jayson[_0x23fe('0xb')][_0x23fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31b883,_0x10ad35,_0x310c32){return new BPromise(function(_0x368230,_0x392d37){return client[_0x23fe('0xd')](_0x31b883,_0x310c32)[_0x23fe('0xe')](function(_0x1f1ba8){logger[_0x23fe('0xf')](_0x23fe('0x10'),_0x10ad35,_0x23fe('0x11'));logger[_0x23fe('0x12')](_0x23fe('0x13'),_0x10ad35,_0x23fe('0x11'),JSON['stringify'](_0x1f1ba8));if(_0x1f1ba8[_0x23fe('0x14')]){if(_0x1f1ba8[_0x23fe('0x14')][_0x23fe('0x15')]===0x1f4){logger[_0x23fe('0x14')](_0x23fe('0x10'),_0x10ad35,_0x1f1ba8[_0x23fe('0x14')]['message']);return _0x392d37(_0x1f1ba8[_0x23fe('0x14')][_0x23fe('0x16')]);}logger[_0x23fe('0x14')](_0x23fe('0x10'),_0x10ad35,_0x1f1ba8[_0x23fe('0x14')][_0x23fe('0x16')]);return _0x368230(_0x1f1ba8['error']['message']);}else{logger[_0x23fe('0xf')](_0x23fe('0x10'),_0x10ad35,_0x23fe('0x11'));_0x368230(_0x1f1ba8[_0x23fe('0x17')][_0x23fe('0x16')]);}})[_0x23fe('0x18')](function(_0x5880d5){logger['error'](_0x23fe('0x10'),_0x10ad35,_0x5880d5);_0x392d37(_0x5880d5);});});}
\ No newline at end of file
+var _0x3c41=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x4e0a42,_0x90f21f){var _0x370929=function(_0x22679f){while(--_0x22679f){_0x4e0a42['push'](_0x4e0a42['shift']());}};_0x370929(++_0x90f21f);}(_0x3c41,0x8e));var _0x13c4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3c41[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x13c4('0x0'));var util=require(_0x13c4('0x1'));var moment=require(_0x13c4('0x2'));var BPromise=require(_0x13c4('0x3'));var rs=require(_0x13c4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13c4('0x5'))['db'];var utils=require(_0x13c4('0x6'));var logger=require(_0x13c4('0x7'))(_0x13c4('0x8'));var config=require(_0x13c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x13c4('0xa')][_0x13c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4950dc,_0x1850f3,_0x4979bc){return new BPromise(function(_0x1106c1,_0x287674){return client[_0x13c4('0xc')](_0x4950dc,_0x4979bc)[_0x13c4('0xd')](function(_0x30db85){logger['info'](_0x13c4('0xe'),_0x1850f3,'request\x20sent');logger['debug'](_0x13c4('0xf'),_0x1850f3,'request\x20sent',JSON[_0x13c4('0x10')](_0x30db85));if(_0x30db85[_0x13c4('0x11')]){if(_0x30db85[_0x13c4('0x11')][_0x13c4('0x12')]===0x1f4){logger[_0x13c4('0x11')](_0x13c4('0xe'),_0x1850f3,_0x30db85[_0x13c4('0x11')][_0x13c4('0x13')]);return _0x287674(_0x30db85['error'][_0x13c4('0x13')]);}logger['error'](_0x13c4('0xe'),_0x1850f3,_0x30db85[_0x13c4('0x11')][_0x13c4('0x13')]);return _0x1106c1(_0x30db85['error'][_0x13c4('0x13')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1850f3,'request\x20sent');_0x1106c1(_0x30db85[_0x13c4('0x14')][_0x13c4('0x13')]);}})['catch'](function(_0x7e6fdc){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1850f3,_0x7e6fdc);_0x287674(_0x7e6fdc);});});}
\ No newline at end of file
index 4c4160a..68fd216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3a=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','index','describe','post','create','put','/:id','isAuthenticated','update'];(function(_0x84e3d,_0x4656d7){var _0x224f3c=function(_0x515549){while(--_0x515549){_0x84e3d['push'](_0x84e3d['shift']());}};_0x224f3c(++_0x4656d7);}(_0x8e3a,0x16a));var _0xa8e3=function(_0x1568bc,_0x4701e4){_0x1568bc=_0x1568bc-0x0;var _0x366916=_0x8e3a[_0x1568bc];return _0x366916;};'use strict';var multer=require(_0xa8e3('0x0'));var util=require(_0xa8e3('0x1'));var path=require(_0xa8e3('0x2'));var timeout=require(_0xa8e3('0x3'));var express=require('express');var router=express[_0xa8e3('0x4')]();var fs_extra=require(_0xa8e3('0x5'));var auth=require(_0xa8e3('0x6'));var interaction=require(_0xa8e3('0x7'));var config=require('../../config/environment');var controller=require(_0xa8e3('0x8'));router[_0xa8e3('0x9')]('/',auth['isAuthenticated'](),controller[_0xa8e3('0xa')]);router[_0xa8e3('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa8e3('0xb')]);router[_0xa8e3('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa8e3('0xc')]('/',auth['isAuthenticated'](),controller[_0xa8e3('0xd')]);router[_0xa8e3('0xe')](_0xa8e3('0xf'),auth[_0xa8e3('0x10')](),controller[_0xa8e3('0x11')]);router['delete']('/:id',auth[_0xa8e3('0x10')](),controller[_0xa8e3('0x12')]);module[_0xa8e3('0x13')]=router;
\ No newline at end of file
+var _0x1139=['Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','isAuthenticated','index','get','show','post','create','/:id','update','destroy','exports','multer','util','path','express'];(function(_0x1394a2,_0x533264){var _0x31dcd1=function(_0x58c693){while(--_0x58c693){_0x1394a2['push'](_0x1394a2['shift']());}};_0x31dcd1(++_0x533264);}(_0x1139,0x19a));var _0x9113=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1139[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x9113('0x0'));var util=require(_0x9113('0x1'));var path=require(_0x9113('0x2'));var timeout=require('connect-timeout');var express=require(_0x9113('0x3'));var router=express[_0x9113('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9113('0x5'));var interaction=require(_0x9113('0x6'));var config=require('../../config/environment');var controller=require(_0x9113('0x7'));router['get']('/',auth[_0x9113('0x8')](),controller[_0x9113('0x9')]);router[_0x9113('0xa')]('/describe',auth[_0x9113('0x8')](),controller['describe']);router[_0x9113('0xa')]('/:id',auth[_0x9113('0x8')](),controller[_0x9113('0xb')]);router[_0x9113('0xc')]('/',auth[_0x9113('0x8')](),controller[_0x9113('0xd')]);router['put'](_0x9113('0xe'),auth[_0x9113('0x8')](),controller[_0x9113('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9113('0x10')]);module[_0x9113('0x11')]=router;
\ No newline at end of file
index 45dd2df..6e42a1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration'];(function(_0x2e5672,_0x557233){var _0x54d1ce=function(_0x2f1af4){while(--_0x2f1af4){_0x2e5672['push'](_0x2e5672['shift']());}};_0x54d1ce(++_0x557233);}(_0x2dae,0xc3));var _0xe2da=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x2dae[_0x836465];return _0x2150ea;};'use strict';var Sequelize=require(_0xe2da('0x0'));var moment=require('moment');module[_0xe2da('0x1')]={'channel':{'type':Sequelize[_0xe2da('0x2')]},'membername':{'type':Sequelize[_0xe2da('0x2')]},'interface':{'type':Sequelize[_0xe2da('0x2')]},'type':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe2da('0x3')},'duration':{'type':Sequelize[_0xe2da('0x4')]},'enterAt':{'type':Sequelize[_0xe2da('0x5')]},'exitAt':{'type':Sequelize[_0xe2da('0x5')],'set':function(_0x523c60){var _0x3e3e25=moment(_0x523c60);var _0x89c70b=moment(this[_0xe2da('0x6')](_0xe2da('0x7')));var _0x238da3=_0x3e3e25[_0xe2da('0x8')](_0x89c70b,_0xe2da('0x9'));this[_0xe2da('0xa')](_0xe2da('0xb'),_0x523c60);this['setDataValue'](_0xe2da('0xc'),_0x238da3||null);}},'data1':{'type':Sequelize[_0xe2da('0x2')],'comment':_0xe2da('0xd')},'data2':{'type':Sequelize[_0xe2da('0x2')],'comment':_0xe2da('0xe')},'data3':{'type':Sequelize[_0xe2da('0x2')],'comment':_0xe2da('0xf')},'data4':{'type':Sequelize[_0xe2da('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xe2da('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xe2da('0x2')]},'internal':{'type':Sequelize[_0xe2da('0x4')]},'uniqueid':{'type':Sequelize[_0xe2da('0x2')]}};
\ No newline at end of file
+var _0xb7c8=['INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x4abbb7,_0x4cd94e){var _0x190f58=function(_0x468999){while(--_0x468999){_0x4abbb7['push'](_0x4abbb7['shift']());}};_0x190f58(++_0x4cd94e);}(_0xb7c8,0x119));var _0x8b7c=function(_0x430656,_0x51c912){_0x430656=_0x430656-0x0;var _0x448807=_0xb7c8[_0x430656];return _0x448807;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8b7c('0x0'));module[_0x8b7c('0x1')]={'channel':{'type':Sequelize[_0x8b7c('0x2')]},'membername':{'type':Sequelize[_0x8b7c('0x2')]},'interface':{'type':Sequelize[_0x8b7c('0x2')]},'type':{'type':Sequelize[_0x8b7c('0x2')],'defaultValue':_0x8b7c('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x8b7c('0x4')]},'enterAt':{'type':Sequelize[_0x8b7c('0x5')]},'exitAt':{'type':Sequelize[_0x8b7c('0x5')],'set':function(_0x440900){var _0x107428=moment(_0x440900);var _0x12665c=moment(this[_0x8b7c('0x6')](_0x8b7c('0x7')));var _0x6afb55=_0x107428[_0x8b7c('0x8')](_0x12665c,_0x8b7c('0x9'));this[_0x8b7c('0xa')]('exitAt',_0x440900);this[_0x8b7c('0xa')]('duration',_0x6afb55||null);}},'data1':{'type':Sequelize[_0x8b7c('0x2')],'comment':_0x8b7c('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x8b7c('0xc')},'data3':{'type':Sequelize[_0x8b7c('0x2')],'comment':_0x8b7c('0xd')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x8b7c('0x2')],'comment':_0x8b7c('0xe')},'role':{'type':Sequelize[_0x8b7c('0x2')]},'internal':{'type':Sequelize[_0x8b7c('0x4')]},'uniqueid':{'type':Sequelize[_0x8b7c('0x2')]}};
\ No newline at end of file
index e4bd813..1a8e799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x3b6ea7,_0x4a7eca){var _0x1b5585=function(_0x5bc011){while(--_0x5bc011){_0x3b6ea7['push'](_0x3b6ea7['shift']());}};_0x1b5585(++_0x4a7eca);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));};
\ No newline at end of file
+var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x34e8,0x12c));var _0x834e=function(_0x456586,_0x3aaf02){_0x456586=_0x456586-0x0;var _0x2ef4d6=_0x34e8[_0x456586];return _0x2ef4d6;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
index 08f88c0..29ec1ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bb=['MemberReport','report_member','interface','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x952072,_0x102946){var _0x1b00a8=function(_0x2f8a39){while(--_0x2f8a39){_0x952072['push'](_0x952072['shift']());}};_0x1b00a8(++_0x102946);}(_0xd2bb,0xb9));var _0xbd2b=function(_0x4709dc,_0x2bc315){_0x4709dc=_0x4709dc-0x0;var _0x16b817=_0xd2bb[_0x4709dc];return _0x16b817;};'use strict';var _=require(_0xbd2b('0x0'));var util=require(_0xbd2b('0x1'));var logger=require(_0xbd2b('0x2'))(_0xbd2b('0x3'));var moment=require(_0xbd2b('0x4'));var BPromise=require(_0xbd2b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd2b('0x6'));var rimraf=require(_0xbd2b('0x7'));var config=require(_0xbd2b('0x8'));var attributes=require('./memberReport.attributes');module[_0xbd2b('0x9')]=function(_0x4965e6,_0x51883a){return _0x4965e6[_0xbd2b('0xa')](_0xbd2b('0xb'),attributes,{'tableName':_0xbd2b('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xbd2b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd9a5=['report_member','membername_interface','membername','interface','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define'];(function(_0x49140c,_0x50e83d){var _0x3e2eff=function(_0x5b9e77){while(--_0x5b9e77){_0x49140c['push'](_0x49140c['shift']());}};_0x3e2eff(++_0x50e83d);}(_0xd9a5,0x74));var _0x5d9a=function(_0x34950f,_0x345c88){_0x34950f=_0x34950f-0x0;var _0xaab5f7=_0xd9a5[_0x34950f];return _0xaab5f7;};'use strict';var _=require(_0x5d9a('0x0'));var util=require(_0x5d9a('0x1'));var logger=require(_0x5d9a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d9a('0x3'));var rp=require(_0x5d9a('0x4'));var fs=require('fs');var path=require(_0x5d9a('0x5'));var rimraf=require(_0x5d9a('0x6'));var config=require(_0x5d9a('0x7'));var attributes=require(_0x5d9a('0x8'));module['exports']=function(_0x3180e5,_0x1e7a9c){return _0x3180e5[_0x5d9a('0x9')]('MemberReport',attributes,{'tableName':_0x5d9a('0xa'),'paranoid':![],'indexes':[{'name':_0x5d9a('0xb'),'fields':[_0x5d9a('0xc'),_0x5d9a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index f58a5da..d957c8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf96b=['code','message','result','GetMemberReport','MemberReport','findAll','options','raw','attributes','include','map','model','catch','CreateMemberReport','body','UpdateMemberReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2f4c85,_0x562a7c){var _0x33a26b=function(_0x4e7f7b){while(--_0x4e7f7b){_0x2f4c85['push'](_0x2f4c85['shift']());}};_0x33a26b(++_0x562a7c);}(_0xf96b,0x109));var _0xbf96=function(_0x146797,_0x495437){_0x146797=_0x146797-0x0;var _0x3b4302=_0xf96b[_0x146797];return _0x3b4302;};'use strict';var _=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var moment=require(_0xbf96('0x2'));var BPromise=require(_0xbf96('0x3'));var rs=require(_0xbf96('0x4'));var fs=require('fs');var Redis=require(_0xbf96('0x5'));var db=require(_0xbf96('0x6'))['db'];var utils=require(_0xbf96('0x7'));var logger=require(_0xbf96('0x8'))(_0xbf96('0x9'));var config=require(_0xbf96('0xa'));var jayson=require(_0xbf96('0xb'));var client=jayson[_0xbf96('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e8271,_0x9270ca,_0x260da0){return new BPromise(function(_0x88b9fa,_0x56d77d){return client[_0xbf96('0xd')](_0x3e8271,_0x260da0)[_0xbf96('0xe')](function(_0x1ffe6b){logger[_0xbf96('0xf')](_0xbf96('0x10'),_0x9270ca,_0xbf96('0x11'));logger[_0xbf96('0x12')](_0xbf96('0x13'),_0x9270ca,'request\x20sent',JSON[_0xbf96('0x14')](_0x1ffe6b));if(_0x1ffe6b[_0xbf96('0x15')]){if(_0x1ffe6b['error'][_0xbf96('0x16')]===0x1f4){logger[_0xbf96('0x15')](_0xbf96('0x10'),_0x9270ca,_0x1ffe6b['error'][_0xbf96('0x17')]);return _0x56d77d(_0x1ffe6b[_0xbf96('0x15')][_0xbf96('0x17')]);}logger[_0xbf96('0x15')](_0xbf96('0x10'),_0x9270ca,_0x1ffe6b[_0xbf96('0x15')]['message']);return _0x88b9fa(_0x1ffe6b[_0xbf96('0x15')][_0xbf96('0x17')]);}else{logger[_0xbf96('0xf')](_0xbf96('0x10'),_0x9270ca,_0xbf96('0x11'));_0x88b9fa(_0x1ffe6b[_0xbf96('0x18')][_0xbf96('0x17')]);}})['catch'](function(_0x3296a7){logger['error'](_0xbf96('0x10'),_0x9270ca,_0x3296a7);_0x56d77d(_0x3296a7);});});}exports[_0xbf96('0x19')]=function(_0x568425){var _0x1e9707=this;return new Promise(function(_0x64b2f9,_0x597e5d){return db[_0xbf96('0x1a')][_0xbf96('0x1b')]({'raw':_0x568425[_0xbf96('0x1c')]?_0x568425[_0xbf96('0x1c')][_0xbf96('0x1d')]===undefined?!![]:![]:!![],'where':_0x568425[_0xbf96('0x1c')]?_0x568425[_0xbf96('0x1c')]['where']||null:null,'attributes':_0x568425[_0xbf96('0x1c')]?_0x568425['options'][_0xbf96('0x1e')]||null:null,'limit':_0x568425[_0xbf96('0x1c')]?_0x568425[_0xbf96('0x1c')]['limit']||null:null,'include':_0x568425[_0xbf96('0x1c')]?_0x568425['options'][_0xbf96('0x1f')]?_[_0xbf96('0x20')](_0x568425[_0xbf96('0x1c')]['include'],function(_0x1c92f9){return{'model':db[_0x1c92f9[_0xbf96('0x21')]],'as':_0x1c92f9['as'],'attributes':_0x1c92f9['attributes'],'include':_0x1c92f9['include']?_[_0xbf96('0x20')](_0x1c92f9[_0xbf96('0x1f')],function(_0x363379){return{'model':db[_0x363379['model']],'as':_0x363379['as'],'attributes':_0x363379[_0xbf96('0x1e')],'include':_0x363379['include']?_['map'](_0x363379[_0xbf96('0x1f')],function(_0x30f345){return{'model':db[_0x30f345[_0xbf96('0x21')]],'as':_0x30f345['as'],'attributes':_0x30f345[_0xbf96('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c2f86){logger[_0xbf96('0xf')](_0xbf96('0x19'),_0x568425);logger[_0xbf96('0x12')]('GetMemberReport',_0x568425,JSON['stringify'](_0x3c2f86));_0x64b2f9(_0x3c2f86);})[_0xbf96('0x22')](function(_0x1366e6){logger[_0xbf96('0x15')](_0xbf96('0x19'),_0x1366e6[_0xbf96('0x17')],_0x568425);_0x597e5d(_0x1e9707[_0xbf96('0x15')](0x1f4,_0x1366e6[_0xbf96('0x17')]));});});};exports[_0xbf96('0x23')]=function(_0x4da3e6){var _0x2725cf=this;return new Promise(function(_0x24eef8,_0x29fcde){return db['MemberReport']['create'](_0x4da3e6[_0xbf96('0x24')],{'raw':_0x4da3e6['options']?_0x4da3e6[_0xbf96('0x1c')][_0xbf96('0x1d')]===undefined?!![]:![]:!![]})[_0xbf96('0xe')](function(_0x39e086){logger[_0xbf96('0xf')](_0xbf96('0x23'),_0x4da3e6);logger[_0xbf96('0x12')](_0xbf96('0x23'),_0x4da3e6,JSON[_0xbf96('0x14')](_0x39e086));_0x24eef8(_0x39e086);})['catch'](function(_0x446f5b){logger['error'](_0xbf96('0x23'),_0x446f5b[_0xbf96('0x17')],_0x4da3e6);_0x29fcde(_0x2725cf[_0xbf96('0x15')](0x1f4,_0x446f5b['message']));});});};exports[_0xbf96('0x25')]=function(_0x16c68e){var _0xb8cd93=this;return new Promise(function(_0x18b592,_0x138dbd){return db[_0xbf96('0x1a')][_0xbf96('0x26')](_0x16c68e[_0xbf96('0x24')],{'raw':_0x16c68e['options']?_0x16c68e[_0xbf96('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c68e[_0xbf96('0x1c')]?_0x16c68e[_0xbf96('0x1c')][_0xbf96('0x27')]||null:null,'attributes':_0x16c68e[_0xbf96('0x1c')]?_0x16c68e[_0xbf96('0x1c')]['attributes']||null:null,'limit':_0x16c68e[_0xbf96('0x1c')]?_0x16c68e['options'][_0xbf96('0x28')]||null:null})[_0xbf96('0xe')](function(_0x44adfa){logger[_0xbf96('0xf')](_0xbf96('0x25'),_0x16c68e);logger[_0xbf96('0x12')]('UpdateMemberReport',_0x16c68e,JSON[_0xbf96('0x14')](_0x44adfa));_0x18b592(_0x44adfa);})['catch'](function(_0x2f367e){logger[_0xbf96('0x15')](_0xbf96('0x25'),_0x2f367e['message'],_0x16c68e);_0x138dbd(_0xb8cd93[_0xbf96('0x15')](0x1f4,_0x2f367e[_0xbf96('0x17')]));});});};
\ No newline at end of file
+var _0x5d95=['MemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','options','raw','where','limit','map','include','model','attributes','then','stringify','CreateMemberReport'];(function(_0x1f775d,_0x5d18fe){var _0x144b68=function(_0x1d49c0){while(--_0x1d49c0){_0x1f775d['push'](_0x1f775d['shift']());}};_0x144b68(++_0x5d18fe);}(_0x5d95,0x77));var _0x55d9=function(_0xfba808,_0x12b2ca){_0xfba808=_0xfba808-0x0;var _0x33ffb9=_0x5d95[_0xfba808];return _0x33ffb9;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var moment=require('moment');var BPromise=require(_0x55d9('0x2'));var rs=require(_0x55d9('0x3'));var fs=require('fs');var Redis=require(_0x55d9('0x4'));var db=require(_0x55d9('0x5'))['db'];var utils=require(_0x55d9('0x6'));var logger=require('../../config/logger')(_0x55d9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x55d9('0x8')][_0x55d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b4471,_0x5768e7,_0x5d0b9d){return new BPromise(function(_0x5e52f8,_0x4e27cc){return client[_0x55d9('0xa')](_0x5b4471,_0x5d0b9d)['then'](function(_0x4d52fa){logger[_0x55d9('0xb')](_0x55d9('0xc'),_0x5768e7,_0x55d9('0xd'));logger[_0x55d9('0xe')](_0x55d9('0xf'),_0x5768e7,_0x55d9('0xd'),JSON['stringify'](_0x4d52fa));if(_0x4d52fa['error']){if(_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x11')]===0x1f4){logger[_0x55d9('0x10')](_0x55d9('0xc'),_0x5768e7,_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);return _0x4e27cc(_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);}logger[_0x55d9('0x10')]('MemberReport,\x20%s,\x20%s',_0x5768e7,_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);return _0x5e52f8(_0x4d52fa[_0x55d9('0x10')][_0x55d9('0x12')]);}else{logger[_0x55d9('0xb')](_0x55d9('0xc'),_0x5768e7,_0x55d9('0xd'));_0x5e52f8(_0x4d52fa[_0x55d9('0x13')][_0x55d9('0x12')]);}})[_0x55d9('0x14')](function(_0x30621b){logger[_0x55d9('0x10')](_0x55d9('0xc'),_0x5768e7,_0x30621b);_0x4e27cc(_0x30621b);});});}exports[_0x55d9('0x15')]=function(_0x50faa6){var _0xce6a36=this;return new Promise(function(_0x1af997,_0x5b9283){return db['MemberReport']['findAll']({'raw':_0x50faa6[_0x55d9('0x16')]?_0x50faa6[_0x55d9('0x16')][_0x55d9('0x17')]===undefined?!![]:![]:!![],'where':_0x50faa6[_0x55d9('0x16')]?_0x50faa6['options'][_0x55d9('0x18')]||null:null,'attributes':_0x50faa6[_0x55d9('0x16')]?_0x50faa6[_0x55d9('0x16')]['attributes']||null:null,'limit':_0x50faa6[_0x55d9('0x16')]?_0x50faa6[_0x55d9('0x16')][_0x55d9('0x19')]||null:null,'include':_0x50faa6[_0x55d9('0x16')]?_0x50faa6['options']['include']?_[_0x55d9('0x1a')](_0x50faa6[_0x55d9('0x16')][_0x55d9('0x1b')],function(_0x3e1eef){return{'model':db[_0x3e1eef[_0x55d9('0x1c')]],'as':_0x3e1eef['as'],'attributes':_0x3e1eef[_0x55d9('0x1d')],'include':_0x3e1eef[_0x55d9('0x1b')]?_[_0x55d9('0x1a')](_0x3e1eef[_0x55d9('0x1b')],function(_0x4bd725){return{'model':db[_0x4bd725[_0x55d9('0x1c')]],'as':_0x4bd725['as'],'attributes':_0x4bd725[_0x55d9('0x1d')],'include':_0x4bd725['include']?_[_0x55d9('0x1a')](_0x4bd725['include'],function(_0x2c1890){return{'model':db[_0x2c1890[_0x55d9('0x1c')]],'as':_0x2c1890['as'],'attributes':_0x2c1890[_0x55d9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x55d9('0x1e')](function(_0x22218f){logger['info'](_0x55d9('0x15'),_0x50faa6);logger['debug']('GetMemberReport',_0x50faa6,JSON[_0x55d9('0x1f')](_0x22218f));_0x1af997(_0x22218f);})[_0x55d9('0x14')](function(_0x1b18bb){logger['error'](_0x55d9('0x15'),_0x1b18bb[_0x55d9('0x12')],_0x50faa6);_0x5b9283(_0xce6a36[_0x55d9('0x10')](0x1f4,_0x1b18bb[_0x55d9('0x12')]));});});};exports[_0x55d9('0x20')]=function(_0x8464a3){var _0x19ca6a=this;return new Promise(function(_0x3933ee,_0x4760e3){return db[_0x55d9('0x21')][_0x55d9('0x22')](_0x8464a3[_0x55d9('0x23')],{'raw':_0x8464a3[_0x55d9('0x16')]?_0x8464a3[_0x55d9('0x16')][_0x55d9('0x17')]===undefined?!![]:![]:!![]})[_0x55d9('0x1e')](function(_0x3306a5){logger[_0x55d9('0xb')](_0x55d9('0x20'),_0x8464a3);logger[_0x55d9('0xe')](_0x55d9('0x20'),_0x8464a3,JSON[_0x55d9('0x1f')](_0x3306a5));_0x3933ee(_0x3306a5);})[_0x55d9('0x14')](function(_0x2f23a1){logger['error']('CreateMemberReport',_0x2f23a1[_0x55d9('0x12')],_0x8464a3);_0x4760e3(_0x19ca6a[_0x55d9('0x10')](0x1f4,_0x2f23a1[_0x55d9('0x12')]));});});};exports[_0x55d9('0x24')]=function(_0x1ce38d){var _0x3ad3bc=this;return new Promise(function(_0x4772b4,_0x240180){return db['MemberReport'][_0x55d9('0x25')](_0x1ce38d[_0x55d9('0x23')],{'raw':_0x1ce38d[_0x55d9('0x16')]?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce38d['options']?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x18')]||null:null,'attributes':_0x1ce38d[_0x55d9('0x16')]?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x1d')]||null:null,'limit':_0x1ce38d[_0x55d9('0x16')]?_0x1ce38d[_0x55d9('0x16')][_0x55d9('0x19')]||null:null})[_0x55d9('0x1e')](function(_0x465d1e){logger[_0x55d9('0xb')](_0x55d9('0x24'),_0x1ce38d);logger[_0x55d9('0xe')](_0x55d9('0x24'),_0x1ce38d,JSON[_0x55d9('0x1f')](_0x465d1e));_0x4772b4(_0x465d1e);})[_0x55d9('0x14')](function(_0x20007d){logger['error'](_0x55d9('0x24'),_0x20007d['message'],_0x1ce38d);_0x240180(_0x3ad3bc[_0x55d9('0x10')](0x1f4,_0x20007d[_0x55d9('0x12')]));});});};
\ No newline at end of file
index 1a9b79d..108f8ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7401=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','exports'];(function(_0x41f0ce,_0xc11d97){var _0x523489=function(_0x549005){while(--_0x549005){_0x41f0ce['push'](_0x41f0ce['shift']());}};_0x523489(++_0xc11d97);}(_0x7401,0xf0));var _0x1740=function(_0x1bf6c4,_0x3c00a9){_0x1bf6c4=_0x1bf6c4-0x0;var _0x4c5702=_0x7401[_0x1bf6c4];return _0x4c5702;};'use strict';var multer=require(_0x1740('0x0'));var util=require('util');var path=require(_0x1740('0x1'));var timeout=require('connect-timeout');var express=require(_0x1740('0x2'));var router=express[_0x1740('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1740('0x4'));var interaction=require(_0x1740('0x5'));var config=require(_0x1740('0x6'));var controller=require(_0x1740('0x7'));router['get']('/',controller[_0x1740('0x8')]);module[_0x1740('0x9')]=router;
\ No newline at end of file
+var _0x6f1e=['get','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x2c2de0,_0x36b77a){var _0x281471=function(_0x6d2bd7){while(--_0x6d2bd7){_0x2c2de0['push'](_0x2c2de0['shift']());}};_0x281471(++_0x36b77a);}(_0x6f1e,0x84));var _0xe6f1=function(_0x443b45,_0x4085cd){_0x443b45=_0x443b45-0x0;var _0x2a256f=_0x6f1e[_0x443b45];return _0x2a256f;};'use strict';var multer=require(_0xe6f1('0x0'));var util=require(_0xe6f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe6f1('0x2'));var router=express[_0xe6f1('0x3')]();var fs_extra=require(_0xe6f1('0x4'));var auth=require(_0xe6f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe6f1('0x6'));var controller=require(_0xe6f1('0x7'));router[_0xe6f1('0x8')]('/',controller['index']);module[_0xe6f1('0x9')]=router;
\ No newline at end of file
index 513bddd..8dab53f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87b7=['STRING','version','sequelize'];(function(_0x30d6c6,_0x2ce7f9){var _0x5b8e43=function(_0x23c175){while(--_0x23c175){_0x30d6c6['push'](_0x30d6c6['shift']());}};_0x5b8e43(++_0x2ce7f9);}(_0x87b7,0xf5));var _0x787b=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x87b7[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x787b('0x0'));module['exports']={'version':{'type':Sequelize[_0x787b('0x1')],'unique':_0x787b('0x2')}};
\ No newline at end of file
+var _0x94c1=['exports','STRING','version','sequelize'];(function(_0x866374,_0xf73086){var _0x1e2183=function(_0x41e327){while(--_0x41e327){_0x866374['push'](_0x866374['shift']());}};_0x1e2183(++_0xf73086);}(_0x94c1,0x16f));var _0x194c=function(_0x3b7bf4,_0x4827b6){_0x3b7bf4=_0x3b7bf4-0x0;var _0x4a7a2e=_0x94c1[_0x3b7bf4];return _0x4a7a2e;};'use strict';var Sequelize=require(_0x194c('0x0'));module[_0x194c('0x1')]={'version':{'type':Sequelize[_0x194c('0x2')],'unique':_0x194c('0x3')}};
\ No newline at end of file
index 987909d..e07963b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90a6=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','name','send','map','Migration','rawAttributes','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x3dc307,_0x1e0595){var _0x4f1924=function(_0x31b58c){while(--_0x31b58c){_0x3dc307['push'](_0x3dc307['shift']());}};_0x4f1924(++_0x1e0595);}(_0x90a6,0xaa));var _0x690a=function(_0x3bec47,_0x491ba8){_0x3bec47=_0x3bec47-0x0;var _0x33a9fd=_0x90a6[_0x3bec47];return _0x33a9fd;};'use strict';var emlformat=require(_0x690a('0x0'));var rimraf=require(_0x690a('0x1'));var zipdir=require(_0x690a('0x2'));var jsonpatch=require(_0x690a('0x3'));var rp=require(_0x690a('0x4'));var moment=require(_0x690a('0x5'));var BPromise=require(_0x690a('0x6'));var Mustache=require(_0x690a('0x7'));var util=require(_0x690a('0x8'));var path=require('path');var sox=require(_0x690a('0x9'));var csv=require('to-csv');var ejs=require(_0x690a('0xa'));var fs=require('fs');var fs_extra=require(_0x690a('0xb'));var _=require('lodash');var squel=require(_0x690a('0xc'));var crypto=require('crypto');var jsforce=require(_0x690a('0xd'));var deskjs=require(_0x690a('0xe'));var toCsv=require(_0x690a('0xf'));var querystring=require('querystring');var Papa=require(_0x690a('0x10'));var Redis=require(_0x690a('0x11'));var authService=require(_0x690a('0x12'));var qs=require(_0x690a('0x13'));var as=require(_0x690a('0x14'));var hardwareService=require(_0x690a('0x15'));var logger=require(_0x690a('0x16'))(_0x690a('0x17'));var utils=require('../../config/utils');var config=require(_0x690a('0x18'));var licenseUtil=require(_0x690a('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c83a,_0xedb9ee){_0xedb9ee=_0xedb9ee||0xcc;return function(_0x2e25e3){if(_0x2e25e3){return _0x51c83a[_0x690a('0x1a')](_0xedb9ee);}return _0x51c83a['status'](_0xedb9ee)['end']();};}function respondWithResult(_0x278fa5,_0x254cb9){_0x254cb9=_0x254cb9||0xc8;return function(_0x39d157){if(_0x39d157){return _0x278fa5[_0x690a('0x1b')](_0x254cb9)['json'](_0x39d157);}};}function respondWithFilteredResult(_0x358e14,_0x146dbf){return function(_0x3c581f){if(_0x3c581f){var _0x51a5a2=typeof _0x146dbf[_0x690a('0x1c')]==='undefined'&&typeof _0x146dbf[_0x690a('0x1d')]==='undefined';var _0x519180=_0x3c581f[_0x690a('0x1e')];var _0x3a18fa=_0x51a5a2?0x0:_0x146dbf['offset'];var _0x9c3884=_0x51a5a2?_0x3c581f[_0x690a('0x1e')]:_0x146dbf[_0x690a('0x1c')]+_0x146dbf[_0x690a('0x1d')];var _0x361b3b;if(_0x9c3884>=_0x519180){_0x9c3884=_0x519180;_0x361b3b=0xc8;}else{_0x361b3b=0xce;}_0x358e14[_0x690a('0x1b')](_0x361b3b);return _0x358e14[_0x690a('0x1f')](_0x690a('0x20'),_0x3a18fa+'-'+_0x9c3884+'/'+_0x519180)[_0x690a('0x21')](_0x3c581f);}return null;};}function patchUpdates(_0x1668ab){return function(_0x5a0ea7){try{jsonpatch[_0x690a('0x22')](_0x5a0ea7,_0x1668ab,!![]);}catch(_0x41a16d){return BPromise[_0x690a('0x23')](_0x41a16d);}return _0x5a0ea7[_0x690a('0x24')]();};}function saveUpdates(_0x29aac6,_0x417adf){return function(_0x20f44f){if(_0x20f44f){return _0x20f44f[_0x690a('0x25')](_0x29aac6)[_0x690a('0x26')](function(_0x33d791){return _0x33d791;});}return null;};}function removeEntity(_0xc4cf53,_0x40b4ac){return function(_0x2edc85){if(_0x2edc85){return _0x2edc85['destroy']()[_0x690a('0x26')](function(){_0xc4cf53['status'](0xcc)[_0x690a('0x27')]();});}};}function handleEntityNotFound(_0x1d8071,_0x2ff601){return function(_0x35cc09){if(!_0x35cc09){_0x1d8071['sendStatus'](0x194);}return _0x35cc09;};}function handleError(_0x11de11,_0x4c16da){_0x4c16da=_0x4c16da||0x1f4;return function(_0xcc27b8){logger['error'](_0xcc27b8['stack']);if(_0xcc27b8[_0x690a('0x28')]){delete _0xcc27b8[_0x690a('0x28')];}_0x11de11[_0x690a('0x1b')](_0x4c16da)[_0x690a('0x29')](_0xcc27b8);};}exports['index']=function(_0x282ed9,_0x407103){var _0x2ed28f={},_0x167497={},_0x52728f={'count':0x0,'rows':[]};var _0x41d27e=_[_0x690a('0x2a')](db[_0x690a('0x2b')][_0x690a('0x2c')],function(_0x4e4a99){return{'name':_0x4e4a99['fieldName'],'type':_0x4e4a99['type']['key']};});_0x167497['model']=_[_0x690a('0x2a')](_0x41d27e,_0x690a('0x28'));_0x167497[_0x690a('0x2d')]=_['keys'](_0x282ed9[_0x690a('0x2d')]);_0x167497[_0x690a('0x2e')]=_[_0x690a('0x2f')](_0x167497['model'],_0x167497[_0x690a('0x2d')]);_0x2ed28f[_0x690a('0x30')]=_[_0x690a('0x2f')](_0x167497['model'],qs[_0x690a('0x31')](_0x282ed9[_0x690a('0x2d')][_0x690a('0x31')]));_0x2ed28f[_0x690a('0x30')]=_0x2ed28f[_0x690a('0x30')]['length']?_0x2ed28f[_0x690a('0x30')]:_0x167497['model'];if(!_0x282ed9['query']['hasOwnProperty'](_0x690a('0x32'))){_0x2ed28f[_0x690a('0x1d')]=qs[_0x690a('0x1d')](_0x282ed9[_0x690a('0x2d')]['limit']);_0x2ed28f[_0x690a('0x1c')]=qs[_0x690a('0x1c')](_0x282ed9['query'][_0x690a('0x1c')]);}_0x2ed28f['order']=qs[_0x690a('0x33')](_0x282ed9[_0x690a('0x2d')][_0x690a('0x33')]);_0x2ed28f[_0x690a('0x34')]=qs[_0x690a('0x2e')](_[_0x690a('0x35')](_0x282ed9['query'],_0x167497[_0x690a('0x2e')]),_0x41d27e);if(_0x282ed9[_0x690a('0x2d')][_0x690a('0x36')]){_0x2ed28f[_0x690a('0x34')]=_['merge'](_0x2ed28f['where'],{'$or':_['map'](_0x41d27e,function(_0xf8538b){if(_0xf8538b[_0x690a('0x37')]!==_0x690a('0x38')){var _0x576fcf={};_0x576fcf[_0xf8538b[_0x690a('0x28')]]={'$like':'%'+_0x282ed9[_0x690a('0x2d')][_0x690a('0x36')]+'%'};return _0x576fcf;}})});}_0x2ed28f=_[_0x690a('0x39')]({},_0x2ed28f,_0x282ed9[_0x690a('0x3a')]);var _0x12c8f4={'where':_0x2ed28f[_0x690a('0x34')]};return db[_0x690a('0x2b')][_0x690a('0x1e')](_0x12c8f4)[_0x690a('0x26')](function(_0x31aa1c){_0x52728f[_0x690a('0x1e')]=_0x31aa1c;if(_0x282ed9[_0x690a('0x2d')][_0x690a('0x3b')]){_0x2ed28f[_0x690a('0x3c')]=[{'all':!![]}];}return db[_0x690a('0x2b')][_0x690a('0x3d')](_0x2ed28f);})[_0x690a('0x26')](function(_0x2b77fe){_0x52728f[_0x690a('0x3e')]=_0x2b77fe;return _0x52728f;})[_0x690a('0x26')](respondWithFilteredResult(_0x407103,_0x2ed28f))['catch'](handleError(_0x407103,null));};
\ No newline at end of file
+var _0xe9c1=['end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','Migration','rawAttributes','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x151286,_0x102d6c){var _0x5243c3=function(_0x53d8aa){while(--_0x53d8aa){_0x151286['push'](_0x151286['shift']());}};_0x5243c3(++_0x102d6c);}(_0xe9c1,0x1a7));var _0x1e9c=function(_0x5df259,_0xc5f461){_0x5df259=_0x5df259-0x0;var _0x40e2a3=_0xe9c1[_0x5df259];return _0x40e2a3;};'use strict';var emlformat=require(_0x1e9c('0x0'));var rimraf=require(_0x1e9c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1e9c('0x2'));var moment=require(_0x1e9c('0x3'));var BPromise=require(_0x1e9c('0x4'));var Mustache=require(_0x1e9c('0x5'));var util=require(_0x1e9c('0x6'));var path=require(_0x1e9c('0x7'));var sox=require(_0x1e9c('0x8'));var csv=require(_0x1e9c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e9c('0xa'));var squel=require('squel');var crypto=require(_0x1e9c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1e9c('0xc'));var toCsv=require(_0x1e9c('0x9'));var querystring=require(_0x1e9c('0xd'));var Papa=require(_0x1e9c('0xe'));var Redis=require('ioredis');var authService=require(_0x1e9c('0xf'));var qs=require(_0x1e9c('0x10'));var as=require(_0x1e9c('0x11'));var hardwareService=require(_0x1e9c('0x12'));var logger=require(_0x1e9c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1e9c('0x14'));var licenseUtil=require(_0x1e9c('0x15'));var db=require(_0x1e9c('0x16'))['db'];function respondWithStatusCode(_0x513d73,_0x4f6568){_0x4f6568=_0x4f6568||0xcc;return function(_0x4353af){if(_0x4353af){return _0x513d73[_0x1e9c('0x17')](_0x4f6568);}return _0x513d73[_0x1e9c('0x18')](_0x4f6568)[_0x1e9c('0x19')]();};}function respondWithResult(_0x15b437,_0x1004fd){_0x1004fd=_0x1004fd||0xc8;return function(_0x4dd803){if(_0x4dd803){return _0x15b437[_0x1e9c('0x18')](_0x1004fd)[_0x1e9c('0x1a')](_0x4dd803);}};}function respondWithFilteredResult(_0x3e3569,_0x34e9cd){return function(_0x55c615){if(_0x55c615){var _0x28c55a=typeof _0x34e9cd[_0x1e9c('0x1b')]===_0x1e9c('0x1c')&&typeof _0x34e9cd['limit']===_0x1e9c('0x1c');var _0x39a912=_0x55c615[_0x1e9c('0x1d')];var _0x4215cd=_0x28c55a?0x0:_0x34e9cd['offset'];var _0x16e144=_0x28c55a?_0x55c615[_0x1e9c('0x1d')]:_0x34e9cd[_0x1e9c('0x1b')]+_0x34e9cd[_0x1e9c('0x1e')];var _0x5df39a;if(_0x16e144>=_0x39a912){_0x16e144=_0x39a912;_0x5df39a=0xc8;}else{_0x5df39a=0xce;}_0x3e3569[_0x1e9c('0x18')](_0x5df39a);return _0x3e3569[_0x1e9c('0x1f')]('Content-Range',_0x4215cd+'-'+_0x16e144+'/'+_0x39a912)[_0x1e9c('0x1a')](_0x55c615);}return null;};}function patchUpdates(_0x30ef41){return function(_0x1dd06c){try{jsonpatch[_0x1e9c('0x20')](_0x1dd06c,_0x30ef41,!![]);}catch(_0x44e4c3){return BPromise[_0x1e9c('0x21')](_0x44e4c3);}return _0x1dd06c[_0x1e9c('0x22')]();};}function saveUpdates(_0x116909,_0x414611){return function(_0x1a75ee){if(_0x1a75ee){return _0x1a75ee['update'](_0x116909)[_0x1e9c('0x23')](function(_0x401728){return _0x401728;});}return null;};}function removeEntity(_0x550182,_0x1b02fa){return function(_0xe6a210){if(_0xe6a210){return _0xe6a210[_0x1e9c('0x24')]()[_0x1e9c('0x23')](function(){_0x550182[_0x1e9c('0x18')](0xcc)[_0x1e9c('0x19')]();});}};}function handleEntityNotFound(_0xdd93c1,_0x42922f){return function(_0x1e3c32){if(!_0x1e3c32){_0xdd93c1['sendStatus'](0x194);}return _0x1e3c32;};}function handleError(_0x2fc865,_0x70c452){_0x70c452=_0x70c452||0x1f4;return function(_0x3220b7){logger['error'](_0x3220b7[_0x1e9c('0x25')]);if(_0x3220b7[_0x1e9c('0x26')]){delete _0x3220b7[_0x1e9c('0x26')];}_0x2fc865['status'](_0x70c452)[_0x1e9c('0x27')](_0x3220b7);};}exports[_0x1e9c('0x28')]=function(_0x3a7dd6,_0x348676){var _0x47ca94={},_0x113e44={},_0x153431={'count':0x0,'rows':[]};var _0x36fde6=_[_0x1e9c('0x29')](db[_0x1e9c('0x2a')][_0x1e9c('0x2b')],function(_0x1e6400){return{'name':_0x1e6400['fieldName'],'type':_0x1e6400[_0x1e9c('0x2c')][_0x1e9c('0x2d')]};});_0x113e44['model']=_[_0x1e9c('0x29')](_0x36fde6,_0x1e9c('0x26'));_0x113e44[_0x1e9c('0x2e')]=_['keys'](_0x3a7dd6[_0x1e9c('0x2e')]);_0x113e44[_0x1e9c('0x2f')]=_['intersection'](_0x113e44[_0x1e9c('0x30')],_0x113e44[_0x1e9c('0x2e')]);_0x47ca94['attributes']=_[_0x1e9c('0x31')](_0x113e44[_0x1e9c('0x30')],qs['fields'](_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x32')]));_0x47ca94[_0x1e9c('0x33')]=_0x47ca94['attributes'][_0x1e9c('0x34')]?_0x47ca94[_0x1e9c('0x33')]:_0x113e44[_0x1e9c('0x30')];if(!_0x3a7dd6['query'][_0x1e9c('0x35')]('nolimit')){_0x47ca94[_0x1e9c('0x1e')]=qs['limit'](_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x1e')]);_0x47ca94['offset']=qs[_0x1e9c('0x1b')](_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x1b')]);}_0x47ca94['order']=qs['sort'](_0x3a7dd6[_0x1e9c('0x2e')]['sort']);_0x47ca94[_0x1e9c('0x36')]=qs[_0x1e9c('0x2f')](_['pick'](_0x3a7dd6[_0x1e9c('0x2e')],_0x113e44[_0x1e9c('0x2f')]),_0x36fde6);if(_0x3a7dd6[_0x1e9c('0x2e')]['filter']){_0x47ca94[_0x1e9c('0x36')]=_[_0x1e9c('0x37')](_0x47ca94['where'],{'$or':_[_0x1e9c('0x29')](_0x36fde6,function(_0x552f67){if(_0x552f67['type']!==_0x1e9c('0x38')){var _0x4339ad={};_0x4339ad[_0x552f67['name']]={'$like':'%'+_0x3a7dd6['query'][_0x1e9c('0x39')]+'%'};return _0x4339ad;}})});}_0x47ca94=_[_0x1e9c('0x37')]({},_0x47ca94,_0x3a7dd6[_0x1e9c('0x3a')]);var _0x2ae38c={'where':_0x47ca94[_0x1e9c('0x36')]};return db[_0x1e9c('0x2a')][_0x1e9c('0x1d')](_0x2ae38c)[_0x1e9c('0x23')](function(_0x39fa25){_0x153431[_0x1e9c('0x1d')]=_0x39fa25;if(_0x3a7dd6[_0x1e9c('0x2e')][_0x1e9c('0x3b')]){_0x47ca94[_0x1e9c('0x3c')]=[{'all':!![]}];}return db[_0x1e9c('0x2a')][_0x1e9c('0x3d')](_0x47ca94);})[_0x1e9c('0x23')](function(_0x5024b8){_0x153431[_0x1e9c('0x3e')]=_0x5024b8;return _0x153431;})['then'](respondWithFilteredResult(_0x348676,_0x47ca94))[_0x1e9c('0x3f')](handleError(_0x348676,null));};
\ No newline at end of file
index 5f98b81..c215ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5855=['migrations','lodash','api','request-promise','path','./migration.attributes','exports','define','Migration'];(function(_0x571957,_0x36d989){var _0x22571f=function(_0x1c4d7e){while(--_0x1c4d7e){_0x571957['push'](_0x571957['shift']());}};_0x22571f(++_0x36d989);}(_0x5855,0xb5));var _0x5585=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x5855[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x5585('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5585('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5585('0x2'));var fs=require('fs');var path=require(_0x5585('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5585('0x4'));module[_0x5585('0x5')]=function(_0x37654c,_0x1165fa){return _0x37654c[_0x5585('0x6')](_0x5585('0x7'),attributes,{'tableName':_0x5585('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c36=['Migration','migrations','lodash','api','request-promise','path','./migration.attributes','exports','define'];(function(_0x370185,_0x970e53){var _0x542f2c=function(_0x591279){while(--_0x591279){_0x370185['push'](_0x370185['shift']());}};_0x542f2c(++_0x970e53);}(_0x2c36,0x110));var _0x62c3=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x2c36[_0x3c2166];return _0x30ccc3;};'use strict';var _=require(_0x62c3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x62c3('0x2'));var fs=require('fs');var path=require(_0x62c3('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62c3('0x4'));module[_0x62c3('0x5')]=function(_0x32275e,_0xbddd93){return _0x32275e[_0x62c3('0x6')](_0x62c3('0x7'),attributes,{'tableName':_0x62c3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 467f758..4205e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4345=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ae686,_0x574714){var _0xd4660b=function(_0x3b9bc4){while(--_0x3b9bc4){_0x5ae686['push'](_0x5ae686['shift']());}};_0xd4660b(++_0x574714);}(_0x4345,0x77));var _0x5434=function(_0x4face0,_0x252339){_0x4face0=_0x4face0-0x0;var _0x2943cf=_0x4345[_0x4face0];return _0x2943cf;};'use strict';var _=require(_0x5434('0x0'));var util=require(_0x5434('0x1'));var moment=require('moment');var BPromise=require(_0x5434('0x2'));var rs=require(_0x5434('0x3'));var fs=require('fs');var Redis=require(_0x5434('0x4'));var db=require(_0x5434('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5434('0x6'))('rpc');var config=require(_0x5434('0x7'));var jayson=require(_0x5434('0x8'));var client=jayson[_0x5434('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b26fe,_0x524e9e,_0x395e5c){return new BPromise(function(_0x457fe8,_0x17d20b){return client[_0x5434('0xa')](_0x1b26fe,_0x395e5c)[_0x5434('0xb')](function(_0x414550){logger[_0x5434('0xc')](_0x5434('0xd'),_0x524e9e,_0x5434('0xe'));logger[_0x5434('0xf')](_0x5434('0x10'),_0x524e9e,_0x5434('0xe'),JSON[_0x5434('0x11')](_0x414550));if(_0x414550[_0x5434('0x12')]){if(_0x414550['error'][_0x5434('0x13')]===0x1f4){logger['error'](_0x5434('0xd'),_0x524e9e,_0x414550[_0x5434('0x12')][_0x5434('0x14')]);return _0x17d20b(_0x414550[_0x5434('0x12')]['message']);}logger[_0x5434('0x12')](_0x5434('0xd'),_0x524e9e,_0x414550['error'][_0x5434('0x14')]);return _0x457fe8(_0x414550[_0x5434('0x12')][_0x5434('0x14')]);}else{logger[_0x5434('0xc')]('Migration,\x20%s,\x20%s',_0x524e9e,_0x5434('0xe'));_0x457fe8(_0x414550[_0x5434('0x15')]['message']);}})[_0x5434('0x16')](function(_0x4fa3d5){logger[_0x5434('0x12')](_0x5434('0xd'),_0x524e9e,_0x4fa3d5);_0x17d20b(_0x4fa3d5);});});}
\ No newline at end of file
+var _0x33a1=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Migration,\x20%s,\x20%s','info','lodash','util'];(function(_0xa17f6d,_0x5e5b27){var _0x446655=function(_0x4f7462){while(--_0x4f7462){_0xa17f6d['push'](_0xa17f6d['shift']());}};_0x446655(++_0x5e5b27);}(_0x33a1,0x7c));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133a('0x2'))['db'];var utils=require(_0x133a('0x3'));var logger=require(_0x133a('0x4'))('rpc');var config=require(_0x133a('0x5'));var jayson=require(_0x133a('0x6'));var client=jayson[_0x133a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13fe1d,_0x1a6b64,_0x31409d){return new BPromise(function(_0x5f3a8f,_0x37e7cc){return client[_0x133a('0x8')](_0x13fe1d,_0x31409d)[_0x133a('0x9')](function(_0x43974a){logger['info']('Migration,\x20%s,\x20%s',_0x1a6b64,'request\x20sent');logger[_0x133a('0xa')](_0x133a('0xb'),_0x1a6b64,_0x133a('0xc'),JSON[_0x133a('0xd')](_0x43974a));if(_0x43974a[_0x133a('0xe')]){if(_0x43974a['error']['code']===0x1f4){logger[_0x133a('0xe')]('Migration,\x20%s,\x20%s',_0x1a6b64,_0x43974a['error'][_0x133a('0xf')]);return _0x37e7cc(_0x43974a[_0x133a('0xe')]['message']);}logger[_0x133a('0xe')](_0x133a('0x10'),_0x1a6b64,_0x43974a[_0x133a('0xe')]['message']);return _0x5f3a8f(_0x43974a['error'][_0x133a('0xf')]);}else{logger[_0x133a('0x11')](_0x133a('0x10'),_0x1a6b64,_0x133a('0xc'));_0x5f3a8f(_0x43974a['result']['message']);}})['catch'](function(_0x2f85f1){logger['error'](_0x133a('0x10'),_0x1a6b64,_0x2f85f1);_0x37e7cc(_0x2f85f1);});});}
\ No newline at end of file
index 6656c3f..6ec1857 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5e5=['/:id','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','post','create','put'];(function(_0x2be510,_0xb9ef29){var _0x18b248=function(_0x46f0d1){while(--_0x46f0d1){_0x2be510['push'](_0x2be510['shift']());}};_0x18b248(++_0xb9ef29);}(_0xc5e5,0xdc));var _0x5c5e=function(_0x41cbc0,_0x14cc12){_0x41cbc0=_0x41cbc0-0x0;var _0x1143f5=_0xc5e5[_0x41cbc0];return _0x1143f5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c5e('0x0'));var timeout=require('connect-timeout');var express=require(_0x5c5e('0x1'));var router=express[_0x5c5e('0x2')]();var fs_extra=require(_0x5c5e('0x3'));var auth=require(_0x5c5e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c5e('0x5'));var controller=require(_0x5c5e('0x6'));router[_0x5c5e('0x7')]('/',auth['isAuthenticated'](),controller[_0x5c5e('0x8')]);router[_0x5c5e('0x7')]('/:id',auth[_0x5c5e('0x9')](),controller[_0x5c5e('0xa')]);router[_0x5c5e('0xb')]('/',auth[_0x5c5e('0x9')](),controller[_0x5c5e('0xc')]);router[_0x5c5e('0xd')](_0x5c5e('0xe'),auth['isAuthenticated'](),controller[_0x5c5e('0xf')]);router[_0x5c5e('0x10')]('/:id',auth[_0x5c5e('0x9')](),controller['destroy']);module[_0x5c5e('0x11')]=router;
\ No newline at end of file
+var _0x86be=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','post','create','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2226c1,_0x2bed75){var _0x178716=function(_0x54bb7e){while(--_0x54bb7e){_0x2226c1['push'](_0x2226c1['shift']());}};_0x178716(++_0x2bed75);}(_0x86be,0x176));var _0xe86b=function(_0x509c06,_0x1738f8){_0x509c06=_0x509c06-0x0;var _0x428161=_0x86be[_0x509c06];return _0x428161;};'use strict';var multer=require(_0xe86b('0x0'));var util=require('util');var path=require(_0xe86b('0x1'));var timeout=require(_0xe86b('0x2'));var express=require(_0xe86b('0x3'));var router=express[_0xe86b('0x4')]();var fs_extra=require(_0xe86b('0x5'));var auth=require(_0xe86b('0x6'));var interaction=require(_0xe86b('0x7'));var config=require(_0xe86b('0x8'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe86b('0x9')]);router[_0xe86b('0xa')](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller['show']);router[_0xe86b('0xd')]('/',auth[_0xe86b('0xc')](),controller[_0xe86b('0xe')]);router['put'](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller[_0xe86b('0xf')]);router['delete'](_0xe86b('0xb'),auth[_0xe86b('0xc')](),controller[_0xe86b('0x10')]);module[_0xe86b('0x11')]=router;
\ No newline at end of file
index ba13325..c562d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27f2=['STRING','exports','localnet','externip','turn'];(function(_0x513930,_0x14921a){var _0x29be1d=function(_0x2686f9){while(--_0x2686f9){_0x513930['push'](_0x513930['shift']());}};_0x29be1d(++_0x14921a);}(_0x27f2,0x14b));var _0x227f=function(_0x1870a2,_0x1708b1){_0x1870a2=_0x1870a2-0x0;var _0x4a58d1=_0x27f2[_0x1870a2];return _0x4a58d1;};'use strict';var Sequelize=require('sequelize');module[_0x227f('0x0')]={'type':{'type':Sequelize['ENUM'](_0x227f('0x1'),_0x227f('0x2'),'stun',_0x227f('0x3'))},'value':{'type':Sequelize[_0x227f('0x4')]},'username':{'type':Sequelize[_0x227f('0x4')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8b90=['localnet','externip','stun','STRING','sequelize'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x8b90,0x14e));var _0x08b9=function(_0x346645,_0x3e9d9c){_0x346645=_0x346645-0x0;var _0x32f590=_0x8b90[_0x346645];return _0x32f590;};'use strict';var Sequelize=require(_0x08b9('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x08b9('0x1'),_0x08b9('0x2'),_0x08b9('0x3'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x08b9('0x4')]},'password':{'type':Sequelize[_0x08b9('0x4')]}};
\ No newline at end of file
index f0c3b62..19a8999 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c59=['stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','VIRTUAL','options','Network','includeAll','include','findAll','rows','find','catch','create','sequelize','transaction','body','toUpperCase','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','server/files/templates/turn_multiple.ejs','res_stun_monitor.so','join','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','STUN','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','chan_sip.so','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s'];(function(_0xf6f996,_0x156b90){var _0xe6bbc6=function(_0x1fa332){while(--_0x1fa332){_0xf6f996['push'](_0xf6f996['shift']());}};_0xe6bbc6(++_0x156b90);}(_0x2c59,0x1e9));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x92c5('0x0'));var rimraf=require(_0x92c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x92c5('0x2'));var rp=require('request-promise');var moment=require(_0x92c5('0x3'));var BPromise=require(_0x92c5('0x4'));var Mustache=require(_0x92c5('0x5'));var util=require(_0x92c5('0x6'));var path=require(_0x92c5('0x7'));var sox=require(_0x92c5('0x8'));var csv=require(_0x92c5('0x9'));var ejs=require(_0x92c5('0xa'));var fs=require('fs');var fs_extra=require(_0x92c5('0xb'));var _=require(_0x92c5('0xc'));var squel=require(_0x92c5('0xd'));var crypto=require(_0x92c5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x92c5('0xf'));var toCsv=require(_0x92c5('0x9'));var querystring=require(_0x92c5('0x10'));var Papa=require(_0x92c5('0x11'));var Redis=require(_0x92c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x92c5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x92c5('0x14'))(_0x92c5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x92c5('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x92c5('0x17'));var client=jayson['client'][_0x92c5('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x347fc0,_0x3cf02d,_0x1b0b20,_0x4d64f5){return new BPromise(function(_0x1ddd22,_0x4dc9e8){var _0x35751f=_0x4d64f5||client;return _0x35751f['request'](_0x347fc0,_0x1b0b20)[_0x92c5('0x19')](function(_0x45d6ef){logger[_0x92c5('0x1a')](_0x92c5('0x1b'),_0x3cf02d,_0x92c5('0x1c'));logger[_0x92c5('0x1d')](_0x92c5('0x1e'),_0x3cf02d,_0x92c5('0x1c'),JSON[_0x92c5('0x1f')](_0x45d6ef));if(_0x45d6ef[_0x92c5('0x20')]){if(_0x45d6ef[_0x92c5('0x20')][_0x92c5('0x21')]===0x1f4){logger[_0x92c5('0x20')](_0x92c5('0x1b'),_0x3cf02d,_0x45d6ef['error'][_0x92c5('0x22')]);return _0x4dc9e8(_0x45d6ef[_0x92c5('0x20')][_0x92c5('0x22')]);}logger[_0x92c5('0x20')]('Network,\x20%s,\x20%s',_0x3cf02d,_0x45d6ef[_0x92c5('0x20')][_0x92c5('0x22')]);return _0x1ddd22(_0x45d6ef[_0x92c5('0x20')][_0x92c5('0x22')]);}else{logger[_0x92c5('0x1a')](_0x92c5('0x1b'),_0x3cf02d,_0x92c5('0x1c'));_0x1ddd22(_0x45d6ef[_0x92c5('0x23')]['message']);}})['catch'](function(_0x482db2){logger[_0x92c5('0x20')](_0x92c5('0x1b'),_0x3cf02d,_0x482db2);_0x4dc9e8(_0x482db2);});});}function respondWithStatusCode(_0x378cdd,_0x2e8fdf){_0x2e8fdf=_0x2e8fdf||0xcc;return function(_0x473eef){if(_0x473eef){return _0x378cdd[_0x92c5('0x24')](_0x2e8fdf);}return _0x378cdd[_0x92c5('0x25')](_0x2e8fdf)[_0x92c5('0x26')]();};}function respondWithResult(_0x5b5e90,_0x5630f5){_0x5630f5=_0x5630f5||0xc8;return function(_0x41b048){if(_0x41b048){return _0x5b5e90[_0x92c5('0x25')](_0x5630f5)['json'](_0x41b048);}};}function respondWithFilteredResult(_0x33b0f5,_0x373a35){return function(_0x4dbcd8){if(_0x4dbcd8){var _0x156a00=typeof _0x373a35[_0x92c5('0x27')]===_0x92c5('0x28')&&typeof _0x373a35[_0x92c5('0x29')]===_0x92c5('0x28');var _0x3c6495=_0x4dbcd8[_0x92c5('0x2a')];var _0x2d2d9a=_0x156a00?0x0:_0x373a35[_0x92c5('0x27')];var _0x435e95=_0x156a00?_0x4dbcd8[_0x92c5('0x2a')]:_0x373a35[_0x92c5('0x27')]+_0x373a35[_0x92c5('0x29')];var _0x124558;if(_0x435e95>=_0x3c6495){_0x435e95=_0x3c6495;_0x124558=0xc8;}else{_0x124558=0xce;}_0x33b0f5['status'](_0x124558);return _0x33b0f5[_0x92c5('0x2b')]('Content-Range',_0x2d2d9a+'-'+_0x435e95+'/'+_0x3c6495)[_0x92c5('0x2c')](_0x4dbcd8);}return null;};}function patchUpdates(_0xd010b9){return function(_0x1d56be){try{jsonpatch['apply'](_0x1d56be,_0xd010b9,!![]);}catch(_0x5ad26a){return BPromise[_0x92c5('0x2d')](_0x5ad26a);}return _0x1d56be[_0x92c5('0x2e')]();};}function saveUpdates(_0x1f589f,_0xb37046){return function(_0x1f2479){if(_0x1f2479){return _0x1f2479[_0x92c5('0x2f')](_0x1f589f)[_0x92c5('0x19')](function(_0x2e8c6e){return _0x2e8c6e;});}return null;};}function removeEntity(_0xf5d08b,_0x5d4f20){return function(_0x18cf78){if(_0x18cf78){return _0x18cf78[_0x92c5('0x30')]()['then'](function(){_0xf5d08b[_0x92c5('0x25')](0xcc)[_0x92c5('0x26')]();});}};}function handleEntityNotFound(_0x2815b6,_0x5b4b5c){return function(_0x3b5d8d){if(!_0x3b5d8d){_0x2815b6[_0x92c5('0x24')](0x194);}return _0x3b5d8d;};}function handleError(_0x4603c6,_0x80a913){_0x80a913=_0x80a913||0x1f4;return function(_0xedf972){logger['error'](_0xedf972[_0x92c5('0x31')]);if(_0xedf972[_0x92c5('0x32')]){delete _0xedf972[_0x92c5('0x32')];}_0x4603c6[_0x92c5('0x25')](_0x80a913)[_0x92c5('0x33')](_0xedf972);};}exports[_0x92c5('0x34')]=function(_0xb58722,_0x526e4f){var _0x20b9c7={},_0x1ecd1a={},_0x2fa422={'count':0x0,'rows':[]};var _0x341230=_['map'](db['Network'][_0x92c5('0x35')],function(_0xbb266f){return{'name':_0xbb266f[_0x92c5('0x36')],'type':_0xbb266f[_0x92c5('0x37')][_0x92c5('0x38')]};});_0x1ecd1a[_0x92c5('0x39')]=_['map'](_0x341230,'name');_0x1ecd1a['query']=_[_0x92c5('0x3a')](_0xb58722[_0x92c5('0x3b')]);_0x1ecd1a[_0x92c5('0x3c')]=_['intersection'](_0x1ecd1a[_0x92c5('0x39')],_0x1ecd1a[_0x92c5('0x3b')]);_0x20b9c7[_0x92c5('0x3d')]=_['intersection'](_0x1ecd1a[_0x92c5('0x39')],qs['fields'](_0xb58722['query'][_0x92c5('0x3e')]));_0x20b9c7['attributes']=_0x20b9c7[_0x92c5('0x3d')][_0x92c5('0x3f')]?_0x20b9c7[_0x92c5('0x3d')]:_0x1ecd1a[_0x92c5('0x39')];if(!_0xb58722[_0x92c5('0x3b')][_0x92c5('0x40')](_0x92c5('0x41'))){_0x20b9c7['limit']=qs[_0x92c5('0x29')](_0xb58722[_0x92c5('0x3b')][_0x92c5('0x29')]);_0x20b9c7[_0x92c5('0x27')]=qs['offset'](_0xb58722[_0x92c5('0x3b')]['offset']);}_0x20b9c7[_0x92c5('0x42')]=qs['sort'](_0xb58722[_0x92c5('0x3b')]['sort']);_0x20b9c7['where']=qs[_0x92c5('0x3c')](_[_0x92c5('0x43')](_0xb58722[_0x92c5('0x3b')],_0x1ecd1a[_0x92c5('0x3c')]),_0x341230);if(_0xb58722[_0x92c5('0x3b')][_0x92c5('0x44')]){_0x20b9c7['where']=_[_0x92c5('0x45')](_0x20b9c7[_0x92c5('0x46')],{'$or':_['map'](_0x341230,function(_0x58fa68){if(_0x58fa68[_0x92c5('0x37')]!==_0x92c5('0x47')){var _0x36d100={};_0x36d100[_0x58fa68[_0x92c5('0x32')]]={'$like':'%'+_0xb58722[_0x92c5('0x3b')][_0x92c5('0x44')]+'%'};return _0x36d100;}})});}_0x20b9c7=_[_0x92c5('0x45')]({},_0x20b9c7,_0xb58722[_0x92c5('0x48')]);var _0x56df84={'where':_0x20b9c7[_0x92c5('0x46')]};return db[_0x92c5('0x49')][_0x92c5('0x2a')](_0x56df84)[_0x92c5('0x19')](function(_0x213b3a){_0x2fa422[_0x92c5('0x2a')]=_0x213b3a;if(_0xb58722[_0x92c5('0x3b')][_0x92c5('0x4a')]){_0x20b9c7[_0x92c5('0x4b')]=[{'all':!![]}];}return db[_0x92c5('0x49')][_0x92c5('0x4c')](_0x20b9c7);})[_0x92c5('0x19')](function(_0x7974eb){_0x2fa422[_0x92c5('0x4d')]=_0x7974eb;return _0x2fa422;})[_0x92c5('0x19')](respondWithFilteredResult(_0x526e4f,_0x20b9c7))['catch'](handleError(_0x526e4f,null));};exports['show']=function(_0x3c5f17,_0x49d81b){var _0x41eb40={'raw':!![],'where':{'id':_0x3c5f17['params']['id']}},_0x363b54={};_0x363b54[_0x92c5('0x39')]=_[_0x92c5('0x3a')](db[_0x92c5('0x49')][_0x92c5('0x35')]);_0x363b54[_0x92c5('0x3b')]=_['keys'](_0x3c5f17[_0x92c5('0x3b')]);_0x363b54[_0x92c5('0x3c')]=_['intersection'](_0x363b54[_0x92c5('0x39')],_0x363b54[_0x92c5('0x3b')]);_0x41eb40[_0x92c5('0x3d')]=_['intersection'](_0x363b54[_0x92c5('0x39')],qs[_0x92c5('0x3e')](_0x3c5f17[_0x92c5('0x3b')][_0x92c5('0x3e')]));_0x41eb40[_0x92c5('0x3d')]=_0x41eb40[_0x92c5('0x3d')]['length']?_0x41eb40['attributes']:_0x363b54[_0x92c5('0x39')];if(_0x3c5f17[_0x92c5('0x3b')][_0x92c5('0x4a')]){_0x41eb40[_0x92c5('0x4b')]=[{'all':!![]}];}_0x41eb40=_['merge']({},_0x41eb40,_0x3c5f17[_0x92c5('0x48')]);return db['Network'][_0x92c5('0x4e')](_0x41eb40)[_0x92c5('0x19')](handleEntityNotFound(_0x49d81b,null))[_0x92c5('0x19')](respondWithResult(_0x49d81b,null))[_0x92c5('0x4f')](handleError(_0x49d81b,null));};exports[_0x92c5('0x50')]=function(_0x3d0bf5,_0x1a078a,_0x26d0a9){var _0x4ebac1;return db[_0x92c5('0x51')][_0x92c5('0x52')](function(_0x1eb6c1){return db[_0x92c5('0x49')][_0x92c5('0x50')](_0x3d0bf5[_0x92c5('0x53')],{'raw':!![]})[_0x92c5('0x19')](function(_0x424452){_0x4ebac1=_0x424452;return db['Network']['findAll']({'where':{'type':_0x3d0bf5[_0x92c5('0x53')][_0x92c5('0x37')]},'raw':!![]});})[_0x92c5('0x19')](function(_0x21ff6b){if(_0x4ebac1['type'][_0x92c5('0x54')]()=='STUN'){var _0x4d39bd=fs['readFileSync'](path['join'](config[_0x92c5('0x55')],'server/files/templates/stun_multiple.ejs'),_0x92c5('0x56'));var _0x20b8d0=ejs[_0x92c5('0x57')](_0x4d39bd,{'networks':_0x21ff6b||[]});fs[_0x92c5('0x58')](_0x92c5('0x59'),_0x20b8d0);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x4ebac1[_0x92c5('0x37')][_0x92c5('0x54')]()==_0x92c5('0x5b')){var _0x40f2a3=fs[_0x92c5('0x5c')](path['join'](config[_0x92c5('0x55')],_0x92c5('0x5d')),'utf8');var _0x470935=ejs[_0x92c5('0x57')](_0x40f2a3,{'networks':_0x21ff6b||[]});fs[_0x92c5('0x58')]('/etc/asterisk/turn_xcally.conf',_0x470935);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x50'),{'module':_0x92c5('0x5e')});}else{var _0x19d70d=fs[_0x92c5('0x5c')](path[_0x92c5('0x5f')](config[_0x92c5('0x55')],_0x92c5('0x60')),_0x92c5('0x56'));var _0x124785=ejs[_0x92c5('0x57')](_0x19d70d,{'networks':_0x21ff6b||[]});fs[_0x92c5('0x58')](util['format'](_0x92c5('0x61'),_0x3d0bf5[_0x92c5('0x53')][_0x92c5('0x37')][_0x92c5('0x62')]()),_0x124785);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x50'),{'module':'chan_sip.so'});}return null;})[_0x92c5('0x19')](function(){return _0x4ebac1;});})[_0x92c5('0x19')](respondWithResult(_0x1a078a,0xc9))[_0x92c5('0x4f')](handleError(_0x1a078a,null));};exports[_0x92c5('0x2f')]=function(_0x4e05ff,_0x62eebf,_0x4c5707){var _0x47277d;return db[_0x92c5('0x51')][_0x92c5('0x52')](function(_0x46368a){return db[_0x92c5('0x49')][_0x92c5('0x4e')]({'where':{'id':_0x4e05ff['params']['id']}})['then'](handleEntityNotFound(_0x62eebf,null))[_0x92c5('0x19')](saveUpdates(_0x4e05ff[_0x92c5('0x53')],null))[_0x92c5('0x19')](function(_0xf0161c){if(_0xf0161c){_0x47277d=_0xf0161c;return db[_0x92c5('0x49')][_0x92c5('0x4c')]({'where':{'type':_0x47277d[_0x92c5('0x37')]},'raw':!![]});}return null;})[_0x92c5('0x19')](function(_0x737c33){if(_0x47277d[_0x92c5('0x37')][_0x92c5('0x54')]()==_0x92c5('0x63')){var _0x5e5a96=fs['readFileSync'](path['join'](config['root'],_0x92c5('0x64')),_0x92c5('0x56'));var _0x1a3b86=ejs[_0x92c5('0x57')](_0x5e5a96,{'networks':_0x737c33||[]});fs[_0x92c5('0x58')](_0x92c5('0x59'),_0x1a3b86);return respondWithRpcPromise('Reload','update',{'module':_0x92c5('0x5e')});}else if(_0x47277d[_0x92c5('0x37')][_0x92c5('0x54')]()==_0x92c5('0x5b')){var _0x642351=fs[_0x92c5('0x5c')](path[_0x92c5('0x5f')](config[_0x92c5('0x55')],_0x92c5('0x5d')),_0x92c5('0x56'));var _0x333b8e=ejs[_0x92c5('0x57')](_0x642351,{'networks':_0x737c33||[]});fs['writeFileSync'](_0x92c5('0x65'),_0x333b8e);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x2f'),{'module':_0x92c5('0x5e')});}else{var _0x17b325=fs['readFileSync'](path[_0x92c5('0x5f')](config[_0x92c5('0x55')],_0x92c5('0x60')),_0x92c5('0x56'));var _0x57aa96=ejs[_0x92c5('0x57')](_0x17b325,{'networks':_0x737c33||[]});fs['writeFileSync'](util[_0x92c5('0x66')](_0x92c5('0x61'),_0x4e05ff['body']['type'][_0x92c5('0x62')]()),_0x57aa96);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x2f'),{'module':_0x92c5('0x67')});}return null;})[_0x92c5('0x19')](function(_0xb70dd4){if(_0xb70dd4){return _0x47277d;}return null;});})['then'](respondWithResult(_0x62eebf,null))['catch'](handleError(_0x62eebf,null));};exports[_0x92c5('0x30')]=function(_0x314df4,_0x5bb301,_0x419257){var _0x59080a;return db[_0x92c5('0x49')][_0x92c5('0x4e')]({'where':{'id':_0x314df4['params']['id']}})[_0x92c5('0x19')](function(_0x4ec5d3){_0x59080a=_0x4ec5d3;return _0x4ec5d3;})[_0x92c5('0x19')](handleEntityNotFound(_0x5bb301,null))[_0x92c5('0x19')](removeEntity(_0x5bb301,null))['then'](function(){if(_0x59080a){return db['Network']['findAll']({'where':{'type':_0x59080a[_0x92c5('0x37')]},'raw':!![]});}})[_0x92c5('0x19')](function(_0x184381){if(_0x59080a[_0x92c5('0x37')][_0x92c5('0x54')]()==_0x92c5('0x63')){var _0x17e292=fs[_0x92c5('0x5c')](path['join'](config['root'],_0x92c5('0x64')),_0x92c5('0x56'));var _0x5495b6=ejs[_0x92c5('0x57')](_0x17e292,{'networks':_0x184381||[]});fs[_0x92c5('0x58')](_0x92c5('0x59'),_0x5495b6);return respondWithRpcPromise(_0x92c5('0x5a'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x59080a[_0x92c5('0x37')][_0x92c5('0x54')]()==_0x92c5('0x5b')){var _0x292382=fs[_0x92c5('0x5c')](path[_0x92c5('0x5f')](config[_0x92c5('0x55')],_0x92c5('0x5d')),_0x92c5('0x56'));var _0x426afc=ejs['render'](_0x292382,{'networks':_0x184381||[]});fs['writeFileSync'](_0x92c5('0x65'),_0x426afc);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x30'),{'module':'res_stun_monitor.so'});}else{var _0x14f7cf=fs[_0x92c5('0x5c')](path[_0x92c5('0x5f')](config['root'],'server/files/templates/network.ejs'),_0x92c5('0x56'));var _0xe44cf7=ejs[_0x92c5('0x57')](_0x14f7cf,{'networks':_0x184381||[]});fs['writeFileSync'](util[_0x92c5('0x66')](_0x92c5('0x61'),_0x314df4[_0x92c5('0x53')][_0x92c5('0x37')][_0x92c5('0x62')]()),_0xe44cf7);return respondWithRpcPromise(_0x92c5('0x5a'),_0x92c5('0x30'),{'module':_0x92c5('0x67')});}return null;})['catch'](handleError(_0x5bb301,null));};
\ No newline at end of file
+var _0x4496=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','sequelize','create','body','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','toUpperCase','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','update','transaction','find','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel'];(function(_0x1d10e1,_0x3ee51e){var _0x466168=function(_0x4dee57){while(--_0x4dee57){_0x1d10e1['push'](_0x1d10e1['shift']());}};_0x466168(++_0x3ee51e);}(_0x4496,0x142));var _0x6449=function(_0x57981c,_0x1f5cf6){_0x57981c=_0x57981c-0x0;var _0x5e2f75=_0x4496[_0x57981c];return _0x5e2f75;};'use strict';var emlformat=require(_0x6449('0x0'));var rimraf=require(_0x6449('0x1'));var zipdir=require(_0x6449('0x2'));var jsonpatch=require(_0x6449('0x3'));var rp=require(_0x6449('0x4'));var moment=require(_0x6449('0x5'));var BPromise=require(_0x6449('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6449('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6449('0x8'));var _=require(_0x6449('0x9'));var squel=require(_0x6449('0xa'));var crypto=require(_0x6449('0xb'));var jsforce=require(_0x6449('0xc'));var deskjs=require(_0x6449('0xd'));var toCsv=require(_0x6449('0xe'));var querystring=require(_0x6449('0xf'));var Papa=require(_0x6449('0x10'));var Redis=require(_0x6449('0x11'));var authService=require(_0x6449('0x12'));var qs=require(_0x6449('0x13'));var as=require(_0x6449('0x14'));var hardwareService=require(_0x6449('0x15'));var logger=require(_0x6449('0x16'))('api');var utils=require(_0x6449('0x17'));var config=require(_0x6449('0x18'));var licenseUtil=require(_0x6449('0x19'));var db=require(_0x6449('0x1a'))['db'];var jayson=require(_0x6449('0x1b'));var client=jayson[_0x6449('0x1c')][_0x6449('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4b2457,_0x5e8336,_0x469de4,_0xb63213){return new BPromise(function(_0x5a888e,_0x4b8694){var _0xaef06=_0xb63213||client;return _0xaef06['request'](_0x4b2457,_0x469de4)[_0x6449('0x1e')](function(_0x1f9091){logger['info'](_0x6449('0x1f'),_0x5e8336,_0x6449('0x20'));logger['debug'](_0x6449('0x21'),_0x5e8336,_0x6449('0x20'),JSON[_0x6449('0x22')](_0x1f9091));if(_0x1f9091['error']){if(_0x1f9091['error']['code']===0x1f4){logger[_0x6449('0x23')](_0x6449('0x1f'),_0x5e8336,_0x1f9091[_0x6449('0x23')][_0x6449('0x24')]);return _0x4b8694(_0x1f9091['error'][_0x6449('0x24')]);}logger[_0x6449('0x23')]('Network,\x20%s,\x20%s',_0x5e8336,_0x1f9091[_0x6449('0x23')]['message']);return _0x5a888e(_0x1f9091[_0x6449('0x23')]['message']);}else{logger[_0x6449('0x25')](_0x6449('0x1f'),_0x5e8336,_0x6449('0x20'));_0x5a888e(_0x1f9091[_0x6449('0x26')]['message']);}})[_0x6449('0x27')](function(_0x365c55){logger[_0x6449('0x23')](_0x6449('0x1f'),_0x5e8336,_0x365c55);_0x4b8694(_0x365c55);});});}function respondWithStatusCode(_0x18fc81,_0x2f16ae){_0x2f16ae=_0x2f16ae||0xcc;return function(_0x1efa1e){if(_0x1efa1e){return _0x18fc81[_0x6449('0x28')](_0x2f16ae);}return _0x18fc81[_0x6449('0x29')](_0x2f16ae)[_0x6449('0x2a')]();};}function respondWithResult(_0x3c50d5,_0x22113a){_0x22113a=_0x22113a||0xc8;return function(_0x5b459d){if(_0x5b459d){return _0x3c50d5[_0x6449('0x29')](_0x22113a)[_0x6449('0x2b')](_0x5b459d);}};}function respondWithFilteredResult(_0x32e636,_0x5c0a81){return function(_0x216641){if(_0x216641){var _0x1b02cc=typeof _0x5c0a81['offset']===_0x6449('0x2c')&&typeof _0x5c0a81[_0x6449('0x2d')]==='undefined';var _0x15ca12=_0x216641[_0x6449('0x2e')];var _0x281802=_0x1b02cc?0x0:_0x5c0a81[_0x6449('0x2f')];var _0x5aca4a=_0x1b02cc?_0x216641['count']:_0x5c0a81[_0x6449('0x2f')]+_0x5c0a81['limit'];var _0x34a4c;if(_0x5aca4a>=_0x15ca12){_0x5aca4a=_0x15ca12;_0x34a4c=0xc8;}else{_0x34a4c=0xce;}_0x32e636['status'](_0x34a4c);return _0x32e636[_0x6449('0x30')](_0x6449('0x31'),_0x281802+'-'+_0x5aca4a+'/'+_0x15ca12)[_0x6449('0x2b')](_0x216641);}return null;};}function patchUpdates(_0x4d2e0a){return function(_0x4c177a){try{jsonpatch[_0x6449('0x32')](_0x4c177a,_0x4d2e0a,!![]);}catch(_0x589861){return BPromise[_0x6449('0x33')](_0x589861);}return _0x4c177a[_0x6449('0x34')]();};}function saveUpdates(_0x1b9c85,_0xb976ff){return function(_0x3ad67f){if(_0x3ad67f){return _0x3ad67f['update'](_0x1b9c85)['then'](function(_0x35497d){return _0x35497d;});}return null;};}function removeEntity(_0xd468f8,_0x5c7ada){return function(_0x344d9b){if(_0x344d9b){return _0x344d9b[_0x6449('0x35')]()['then'](function(){_0xd468f8[_0x6449('0x29')](0xcc)[_0x6449('0x2a')]();});}};}function handleEntityNotFound(_0x4754e6,_0x5f4ff0){return function(_0x1b44f0){if(!_0x1b44f0){_0x4754e6[_0x6449('0x28')](0x194);}return _0x1b44f0;};}function handleError(_0x279f31,_0x3ae3b2){_0x3ae3b2=_0x3ae3b2||0x1f4;return function(_0x11bf9e){logger[_0x6449('0x23')](_0x11bf9e['stack']);if(_0x11bf9e[_0x6449('0x36')]){delete _0x11bf9e[_0x6449('0x36')];}_0x279f31['status'](_0x3ae3b2)[_0x6449('0x37')](_0x11bf9e);};}exports[_0x6449('0x38')]=function(_0x2ad655,_0xd1f4d8){var _0x39fcd1={},_0x44cd17={},_0x14bd91={'count':0x0,'rows':[]};var _0x2828d5=_[_0x6449('0x39')](db[_0x6449('0x3a')][_0x6449('0x3b')],function(_0x3c6f92){return{'name':_0x3c6f92[_0x6449('0x3c')],'type':_0x3c6f92[_0x6449('0x3d')][_0x6449('0x3e')]};});_0x44cd17[_0x6449('0x3f')]=_[_0x6449('0x39')](_0x2828d5,_0x6449('0x36'));_0x44cd17[_0x6449('0x40')]=_[_0x6449('0x41')](_0x2ad655['query']);_0x44cd17[_0x6449('0x42')]=_['intersection'](_0x44cd17[_0x6449('0x3f')],_0x44cd17[_0x6449('0x40')]);_0x39fcd1[_0x6449('0x43')]=_[_0x6449('0x44')](_0x44cd17[_0x6449('0x3f')],qs[_0x6449('0x45')](_0x2ad655[_0x6449('0x40')][_0x6449('0x45')]));_0x39fcd1[_0x6449('0x43')]=_0x39fcd1['attributes'][_0x6449('0x46')]?_0x39fcd1[_0x6449('0x43')]:_0x44cd17[_0x6449('0x3f')];if(!_0x2ad655[_0x6449('0x40')][_0x6449('0x47')]('nolimit')){_0x39fcd1[_0x6449('0x2d')]=qs['limit'](_0x2ad655[_0x6449('0x40')][_0x6449('0x2d')]);_0x39fcd1[_0x6449('0x2f')]=qs[_0x6449('0x2f')](_0x2ad655[_0x6449('0x40')][_0x6449('0x2f')]);}_0x39fcd1[_0x6449('0x48')]=qs[_0x6449('0x49')](_0x2ad655[_0x6449('0x40')][_0x6449('0x49')]);_0x39fcd1[_0x6449('0x4a')]=qs['filters'](_[_0x6449('0x4b')](_0x2ad655['query'],_0x44cd17['filters']),_0x2828d5);if(_0x2ad655[_0x6449('0x40')][_0x6449('0x4c')]){_0x39fcd1[_0x6449('0x4a')]=_[_0x6449('0x4d')](_0x39fcd1[_0x6449('0x4a')],{'$or':_[_0x6449('0x39')](_0x2828d5,function(_0x2b29d3){if(_0x2b29d3[_0x6449('0x3d')]!=='VIRTUAL'){var _0x1412ad={};_0x1412ad[_0x2b29d3[_0x6449('0x36')]]={'$like':'%'+_0x2ad655[_0x6449('0x40')][_0x6449('0x4c')]+'%'};return _0x1412ad;}})});}_0x39fcd1=_['merge']({},_0x39fcd1,_0x2ad655['options']);var _0x227a5c={'where':_0x39fcd1[_0x6449('0x4a')]};return db[_0x6449('0x3a')][_0x6449('0x2e')](_0x227a5c)[_0x6449('0x1e')](function(_0x7ce320){_0x14bd91[_0x6449('0x2e')]=_0x7ce320;if(_0x2ad655[_0x6449('0x40')][_0x6449('0x4e')]){_0x39fcd1[_0x6449('0x4f')]=[{'all':!![]}];}return db[_0x6449('0x3a')][_0x6449('0x50')](_0x39fcd1);})[_0x6449('0x1e')](function(_0x143318){_0x14bd91[_0x6449('0x51')]=_0x143318;return _0x14bd91;})['then'](respondWithFilteredResult(_0xd1f4d8,_0x39fcd1))[_0x6449('0x27')](handleError(_0xd1f4d8,null));};exports[_0x6449('0x52')]=function(_0x1025e8,_0x572176){var _0x1eeaa5={'raw':!![],'where':{'id':_0x1025e8[_0x6449('0x53')]['id']}},_0x5debf4={};_0x5debf4[_0x6449('0x3f')]=_[_0x6449('0x41')](db[_0x6449('0x3a')][_0x6449('0x3b')]);_0x5debf4['query']=_[_0x6449('0x41')](_0x1025e8[_0x6449('0x40')]);_0x5debf4[_0x6449('0x42')]=_[_0x6449('0x44')](_0x5debf4[_0x6449('0x3f')],_0x5debf4[_0x6449('0x40')]);_0x1eeaa5['attributes']=_[_0x6449('0x44')](_0x5debf4[_0x6449('0x3f')],qs[_0x6449('0x45')](_0x1025e8['query'][_0x6449('0x45')]));_0x1eeaa5[_0x6449('0x43')]=_0x1eeaa5[_0x6449('0x43')][_0x6449('0x46')]?_0x1eeaa5[_0x6449('0x43')]:_0x5debf4['model'];if(_0x1025e8[_0x6449('0x40')][_0x6449('0x4e')]){_0x1eeaa5[_0x6449('0x4f')]=[{'all':!![]}];}_0x1eeaa5=_[_0x6449('0x4d')]({},_0x1eeaa5,_0x1025e8[_0x6449('0x54')]);return db[_0x6449('0x3a')]['find'](_0x1eeaa5)[_0x6449('0x1e')](handleEntityNotFound(_0x572176,null))[_0x6449('0x1e')](respondWithResult(_0x572176,null))['catch'](handleError(_0x572176,null));};exports['create']=function(_0x2c5e94,_0x215e09,_0x25082c){var _0x4a12a4;return db[_0x6449('0x55')]['transaction'](function(_0x367e63){return db['Network'][_0x6449('0x56')](_0x2c5e94[_0x6449('0x57')],{'raw':!![]})[_0x6449('0x1e')](function(_0x241f18){_0x4a12a4=_0x241f18;return db[_0x6449('0x3a')][_0x6449('0x50')]({'where':{'type':_0x2c5e94[_0x6449('0x57')][_0x6449('0x3d')]},'raw':!![]});})[_0x6449('0x1e')](function(_0x5a854f){if(_0x4a12a4[_0x6449('0x3d')]['toUpperCase']()==_0x6449('0x58')){var _0x2146e3=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x5c')),_0x6449('0x5d'));var _0x308f19=ejs[_0x6449('0x5e')](_0x2146e3,{'networks':_0x5a854f||[]});fs[_0x6449('0x5f')]('/etc/asterisk/stun_xcally.conf',_0x308f19);return respondWithRpcPromise(_0x6449('0x60'),'create',{'module':_0x6449('0x61')});}else if(_0x4a12a4['type'][_0x6449('0x62')]()==_0x6449('0x63')){var _0x583d80=fs[_0x6449('0x59')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x421536=ejs[_0x6449('0x5e')](_0x583d80,{'networks':_0x5a854f||[]});fs[_0x6449('0x5f')](_0x6449('0x64'),_0x421536);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x56'),{'module':'res_stun_monitor.so'});}else{var _0x505fd=fs['readFileSync'](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x65')),'utf8');var _0xf22eb1=ejs[_0x6449('0x5e')](_0x505fd,{'networks':_0x5a854f||[]});fs[_0x6449('0x5f')](util[_0x6449('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x2c5e94[_0x6449('0x57')][_0x6449('0x3d')][_0x6449('0x67')]()),_0xf22eb1);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x56'),{'module':_0x6449('0x68')});}return null;})[_0x6449('0x1e')](function(){return _0x4a12a4;});})['then'](respondWithResult(_0x215e09,0xc9))[_0x6449('0x27')](handleError(_0x215e09,null));};exports[_0x6449('0x69')]=function(_0x4cd5c6,_0x361810,_0x2f17af){var _0x473c30;return db[_0x6449('0x55')][_0x6449('0x6a')](function(_0x278715){return db[_0x6449('0x3a')][_0x6449('0x6b')]({'where':{'id':_0x4cd5c6[_0x6449('0x53')]['id']}})[_0x6449('0x1e')](handleEntityNotFound(_0x361810,null))[_0x6449('0x1e')](saveUpdates(_0x4cd5c6[_0x6449('0x57')],null))[_0x6449('0x1e')](function(_0x1f46dd){if(_0x1f46dd){_0x473c30=_0x1f46dd;return db[_0x6449('0x3a')][_0x6449('0x50')]({'where':{'type':_0x473c30[_0x6449('0x3d')]},'raw':!![]});}return null;})[_0x6449('0x1e')](function(_0x427717){if(_0x473c30[_0x6449('0x3d')]['toUpperCase']()==_0x6449('0x58')){var _0x26eead=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x5c')),'utf8');var _0x18e923=ejs['render'](_0x26eead,{'networks':_0x427717||[]});fs[_0x6449('0x5f')](_0x6449('0x6c'),_0x18e923);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x69'),{'module':_0x6449('0x61')});}else if(_0x473c30[_0x6449('0x3d')][_0x6449('0x62')]()==_0x6449('0x63')){var _0x300e22=fs[_0x6449('0x59')](path['join'](config[_0x6449('0x5b')],_0x6449('0x6d')),_0x6449('0x5d'));var _0xf8ad54=ejs[_0x6449('0x5e')](_0x300e22,{'networks':_0x427717||[]});fs[_0x6449('0x5f')](_0x6449('0x64'),_0xf8ad54);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x69'),{'module':_0x6449('0x61')});}else{var _0x378912=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config[_0x6449('0x5b')],_0x6449('0x65')),_0x6449('0x5d'));var _0x4d687f=ejs['render'](_0x378912,{'networks':_0x427717||[]});fs[_0x6449('0x5f')](util['format'](_0x6449('0x6e'),_0x4cd5c6['body'][_0x6449('0x3d')][_0x6449('0x67')]()),_0x4d687f);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x69'),{'module':_0x6449('0x68')});}return null;})[_0x6449('0x1e')](function(_0x3c78f1){if(_0x3c78f1){return _0x473c30;}return null;});})[_0x6449('0x1e')](respondWithResult(_0x361810,null))['catch'](handleError(_0x361810,null));};exports['destroy']=function(_0x4eb897,_0x5281c6,_0x513854){var _0x36376f;return db['Network'][_0x6449('0x6b')]({'where':{'id':_0x4eb897[_0x6449('0x53')]['id']}})[_0x6449('0x1e')](function(_0x492569){_0x36376f=_0x492569;return _0x492569;})['then'](handleEntityNotFound(_0x5281c6,null))[_0x6449('0x1e')](removeEntity(_0x5281c6,null))['then'](function(){if(_0x36376f){return db[_0x6449('0x3a')][_0x6449('0x50')]({'where':{'type':_0x36376f[_0x6449('0x3d')]},'raw':!![]});}})[_0x6449('0x1e')](function(_0x3ea3f6){if(_0x36376f[_0x6449('0x3d')][_0x6449('0x62')]()=='STUN'){var _0xfdddfa=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config['root'],_0x6449('0x5c')),'utf8');var _0x1f3113=ejs[_0x6449('0x5e')](_0xfdddfa,{'networks':_0x3ea3f6||[]});fs[_0x6449('0x5f')](_0x6449('0x6c'),_0x1f3113);return respondWithRpcPromise('Reload','destroy',{'module':_0x6449('0x61')});}else if(_0x36376f[_0x6449('0x3d')][_0x6449('0x62')]()==_0x6449('0x63')){var _0x2cf230=fs[_0x6449('0x59')](path[_0x6449('0x5a')](config['root'],_0x6449('0x6d')),_0x6449('0x5d'));var _0x13ff25=ejs['render'](_0x2cf230,{'networks':_0x3ea3f6||[]});fs[_0x6449('0x5f')]('/etc/asterisk/turn_xcally.conf',_0x13ff25);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x35'),{'module':_0x6449('0x61')});}else{var _0x524302=fs['readFileSync'](path[_0x6449('0x5a')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x32e8a6=ejs[_0x6449('0x5e')](_0x524302,{'networks':_0x3ea3f6||[]});fs[_0x6449('0x5f')](util['format'](_0x6449('0x6e'),_0x4eb897['body'][_0x6449('0x3d')]['toLowerCase']()),_0x32e8a6);return respondWithRpcPromise(_0x6449('0x60'),_0x6449('0x35'),{'module':_0x6449('0x68')});}return null;})['catch'](handleError(_0x5281c6,null));};
\ No newline at end of file
index b6b8865..fe289e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bca=['Network','network','util','moment','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x4eb147,_0x592482){var _0x22091a=function(_0x4eaf62){while(--_0x4eaf62){_0x4eb147['push'](_0x4eb147['shift']());}};_0x22091a(++_0x592482);}(_0x1bca,0xb6));var _0xa1bc=function(_0x422748,_0x3f8cca){_0x422748=_0x422748-0x0;var _0x5e33ef=_0x1bca[_0x422748];return _0x5e33ef;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa1bc('0x1'));var BPromise=require('bluebird');var rp=require(_0xa1bc('0x2'));var fs=require('fs');var path=require(_0xa1bc('0x3'));var rimraf=require(_0xa1bc('0x4'));var config=require('../../config/environment');var attributes=require(_0xa1bc('0x5'));module[_0xa1bc('0x6')]=function(_0x168b44,_0x268ced){return _0x168b44['define'](_0xa1bc('0x7'),attributes,{'tableName':_0xa1bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Network','lodash','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc788,0xc4));var _0x8c78=function(_0x55e059,_0x2df2c5){_0x55e059=_0x55e059-0x0;var _0x1e6bb7=_0xc788[_0x55e059];return _0x1e6bb7;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./network.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2d442ab..b9db2e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x28f81e,_0x53839e){var _0x452525=function(_0x8391aa){while(--_0x8391aa){_0x28f81e['push'](_0x28f81e['shift']());}};_0x452525(++_0x53839e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
+var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xdb05fb,_0x5ba6ba){var _0x4cbf50=function(_0xeac155){while(--_0xeac155){_0xdb05fb['push'](_0xdb05fb['shift']());}};_0x4cbf50(++_0x5ba6ba);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index 4300a8b..beebe2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bd3=['/:id/users','getAgents','create','post','/:id/notify','notify','addAgents','/:id/send','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions'];(function(_0x2bc950,_0x55a93e){var _0x539c8a=function(_0x1cd99e){while(--_0x1cd99e){_0x2bc950['push'](_0x2bc950['shift']());}};_0x539c8a(++_0x55a93e);}(_0x9bd3,0xb5));var _0x39bd=function(_0x13831d,_0x395915){_0x13831d=_0x13831d-0x0;var _0x11d46a=_0x9bd3[_0x13831d];return _0x11d46a;};'use strict';var multer=require(_0x39bd('0x0'));var util=require(_0x39bd('0x1'));var path=require('path');var timeout=require(_0x39bd('0x2'));var express=require('express');var router=express[_0x39bd('0x3')]();var fs_extra=require(_0x39bd('0x4'));var auth=require(_0x39bd('0x5'));var interaction=require(_0x39bd('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x39bd('0x7')]('/',auth[_0x39bd('0x8')](),controller[_0x39bd('0x9')]);router[_0x39bd('0x7')](_0x39bd('0xa'),auth[_0x39bd('0x8')](),controller[_0x39bd('0xb')]);router[_0x39bd('0x7')]('/:id',auth[_0x39bd('0x8')](),controller['show']);router[_0x39bd('0x7')](_0x39bd('0xc'),auth[_0x39bd('0x8')](),controller['getDispositions']);router[_0x39bd('0x7')](_0x39bd('0xd'),auth[_0x39bd('0x8')](),controller[_0x39bd('0xe')]);router[_0x39bd('0x7')](_0x39bd('0xf'),auth[_0x39bd('0x8')](),controller['getApplications']);router[_0x39bd('0x7')](_0x39bd('0x10'),auth[_0x39bd('0x8')](),controller['getInteractions']);router[_0x39bd('0x7')](_0x39bd('0x11'),auth[_0x39bd('0x8')](),controller[_0x39bd('0x12')]);router['post']('/',auth[_0x39bd('0x8')](),controller[_0x39bd('0x13')]);router[_0x39bd('0x14')](_0x39bd('0xc'),auth[_0x39bd('0x8')](),controller['addDisposition']);router[_0x39bd('0x14')](_0x39bd('0xd'),auth[_0x39bd('0x8')](),controller['addAnswer']);router['post'](_0x39bd('0x15'),controller[_0x39bd('0x16')]);router[_0x39bd('0x14')](_0x39bd('0xf'),auth[_0x39bd('0x8')](),controller['addApplications']);router['post'](_0x39bd('0x11'),auth['isAuthenticated'](),controller[_0x39bd('0x17')]);router[_0x39bd('0x14')](_0x39bd('0x18'),auth[_0x39bd('0x8')](),controller['send']);router[_0x39bd('0x19')](_0x39bd('0x1a'),auth['isAuthenticated'](),controller['update']);router[_0x39bd('0x1b')]('/:id',auth[_0x39bd('0x8')](),controller[_0x39bd('0x1c')]);router[_0x39bd('0x1b')](_0x39bd('0xc'),auth['isAuthenticated'](),controller[_0x39bd('0x1d')]);router[_0x39bd('0x1b')](_0x39bd('0xd'),auth[_0x39bd('0x8')](),controller[_0x39bd('0x1e')]);router[_0x39bd('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x39bd('0x1f')]);module[_0x39bd('0x20')]=router;
\ No newline at end of file
+var _0x6f77=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','create','post','/:id/dispositions','addDisposition','/:id/canned_answers','notify','addApplications','/:id/users','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports'];(function(_0x12c82b,_0x635cde){var _0x5a6cc9=function(_0x156221){while(--_0x156221){_0x12c82b['push'](_0x12c82b['shift']());}};_0x5a6cc9(++_0x635cde);}(_0x6f77,0xb9));var _0x76f7=function(_0x420c44,_0x11af5b){_0x420c44=_0x420c44-0x0;var _0x138afb=_0x6f77[_0x420c44];return _0x138afb;};'use strict';var multer=require('multer');var util=require(_0x76f7('0x0'));var path=require(_0x76f7('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f7('0x2'));var router=express['Router']();var fs_extra=require(_0x76f7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f7('0x4'));var config=require(_0x76f7('0x5'));var controller=require(_0x76f7('0x6'));router[_0x76f7('0x7')]('/',auth['isAuthenticated'](),controller[_0x76f7('0x8')]);router['get'](_0x76f7('0x9'),auth[_0x76f7('0xa')](),controller[_0x76f7('0xb')]);router[_0x76f7('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x76f7('0x7')]('/:id/dispositions',auth[_0x76f7('0xa')](),controller[_0x76f7('0xc')]);router[_0x76f7('0x7')]('/:id/canned_answers',auth[_0x76f7('0xa')](),controller[_0x76f7('0xd')]);router[_0x76f7('0x7')](_0x76f7('0xe'),auth[_0x76f7('0xa')](),controller[_0x76f7('0xf')]);router[_0x76f7('0x7')](_0x76f7('0x10'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x11')]);router[_0x76f7('0x7')]('/:id/users',auth[_0x76f7('0xa')](),controller[_0x76f7('0x12')]);router['post']('/',auth[_0x76f7('0xa')](),controller[_0x76f7('0x13')]);router[_0x76f7('0x14')](_0x76f7('0x15'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x16')]);router['post'](_0x76f7('0x17'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x76f7('0x14')]('/:id/notify',controller[_0x76f7('0x18')]);router[_0x76f7('0x14')](_0x76f7('0xe'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x19')]);router[_0x76f7('0x14')](_0x76f7('0x1a'),auth[_0x76f7('0xa')](),controller['addAgents']);router[_0x76f7('0x14')](_0x76f7('0x1b'),auth['isAuthenticated'](),controller[_0x76f7('0x1c')]);router[_0x76f7('0x1d')](_0x76f7('0x1e'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x1f')]);router[_0x76f7('0x20')](_0x76f7('0x1e'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x21')]);router[_0x76f7('0x20')](_0x76f7('0x15'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x22')]);router[_0x76f7('0x20')](_0x76f7('0x17'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x76f7('0x1a'),auth[_0x76f7('0xa')](),controller[_0x76f7('0x23')]);module[_0x76f7('0x24')]=router;
\ No newline at end of file
index 24f99c4..d0924cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8e7=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0xc92caa,_0x2394dd){var _0x49370d=function(_0x35abd1){while(--_0x35abd1){_0xc92caa['push'](_0xc92caa['shift']());}};_0x49370d(++_0x2394dd);}(_0xf8e7,0xa0));var _0x7f8e=function(_0x1aa04c,_0x293b15){_0x1aa04c=_0x1aa04c-0x0;var _0x20c9b0=_0xf8e7[_0x1aa04c];return _0x20c9b0;};'use strict';var Sequelize=require(_0x7f8e('0x0'));var rs=require(_0x7f8e('0x1'));module[_0x7f8e('0x2')]={'name':{'type':Sequelize[_0x7f8e('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7f8e('0x3')]},'token':{'type':Sequelize[_0x7f8e('0x3')],'defaultValue':function(){return rs[_0x7f8e('0x4')]();}},'replyUri':{'type':Sequelize[_0x7f8e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7f8e('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f8e('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7f8e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7f8e('0x3')]},'queueTransfer':{'type':Sequelize[_0x7f8e('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f8e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f8e('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7f8e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f8e('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x7f8e('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x7f8e('0x5')],'defaultValue':![],'comment':_0x7f8e('0x8'),'set':function(_0x217005){if(!_0x217005)this[_0x7f8e('0x9')](_0x7f8e('0xa'),null);this['setDataValue'](_0x7f8e('0xb'),_0x217005);}}};
\ No newline at end of file
+var _0x0fc0=['sequelize','exports','STRING','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5921c7,_0x4b5384){var _0x6405e9=function(_0x2d39e8){while(--_0x2d39e8){_0x5921c7['push'](_0x5921c7['shift']());}};_0x6405e9(++_0x4b5384);}(_0x0fc0,0x145));var _0x00fc=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0fc0[_0x2c7618];return _0x5ce3f0;};'use strict';var Sequelize=require(_0x00fc('0x0'));var rs=require('randomstring');module[_0x00fc('0x1')]={'name':{'type':Sequelize[_0x00fc('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x00fc('0x2')],'defaultValue':function(){return rs[_0x00fc('0x3')]();}},'replyUri':{'type':Sequelize[_0x00fc('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x00fc('0x4')],'defaultValue':function(){return _0x00fc('0x5');}},'notificationSound':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x00fc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x00fc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x00fc('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x00fc('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x00fc('0x6')],'defaultValue':![],'comment':_0x00fc('0x9'),'set':function(_0x5ea463){if(!_0x5ea463)this[_0x00fc('0xa')](_0x00fc('0xb'),null);this[_0x00fc('0xa')](_0x00fc('0xc'),_0x5ea463);}}};
\ No newline at end of file
index fb6d51f..4b5cc6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f2=['where','include','OpenchannelAccount','findAll','rows','show','params','keys','includeAll','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','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','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','orderBy','priority','account','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','ListId','user','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','end','sendStatus','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xa3f2,0x6c));var _0x2a3f=function(_0x568fc8,_0x3d9f45){_0x568fc8=_0x568fc8-0x0;var _0x3dee5e=_0xa3f2[_0x568fc8];return _0x3dee5e;};'use strict';var emlformat=require(_0x2a3f('0x0'));var rimraf=require(_0x2a3f('0x1'));var zipdir=require(_0x2a3f('0x2'));var jsonpatch=require(_0x2a3f('0x3'));var rp=require(_0x2a3f('0x4'));var moment=require(_0x2a3f('0x5'));var BPromise=require(_0x2a3f('0x6'));var Mustache=require(_0x2a3f('0x7'));var util=require(_0x2a3f('0x8'));var path=require(_0x2a3f('0x9'));var sox=require('sox');var csv=require(_0x2a3f('0xa'));var ejs=require(_0x2a3f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a3f('0xc'));var crypto=require(_0x2a3f('0xd'));var jsforce=require(_0x2a3f('0xe'));var deskjs=require(_0x2a3f('0xf'));var toCsv=require(_0x2a3f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2a3f('0x10'));var authService=require(_0x2a3f('0x11'));var qs=require(_0x2a3f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2a3f('0x13'))(_0x2a3f('0x14'));var utils=require(_0x2a3f('0x15'));var config=require(_0x2a3f('0x16'));var licenseUtil=require(_0x2a3f('0x17'));var db=require('../../mysqldb')['db'];config[_0x2a3f('0x18')]=_[_0x2a3f('0x19')](config[_0x2a3f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2a3f('0x1a'))(new Redis(config[_0x2a3f('0x18')]));require(_0x2a3f('0x1b'))[_0x2a3f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2a3f('0x1d')][_0x2a3f('0x1e')]({'port':0x232c});var client9002=jayson[_0x2a3f('0x1d')][_0x2a3f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x32c3c7,_0x325582,_0x3be5f4,_0x3206e0){return new BPromise(function(_0x281b88,_0x2ce114){var _0x5b449b=_0x3206e0||client;return _0x5b449b[_0x2a3f('0x1f')](_0x32c3c7,_0x3be5f4)[_0x2a3f('0x20')](function(_0x3ce3ce){logger['info'](_0x2a3f('0x21'),_0x325582,'request\x20sent');logger[_0x2a3f('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x325582,'request\x20sent',JSON[_0x2a3f('0x23')](_0x3ce3ce));if(_0x3ce3ce[_0x2a3f('0x24')]){if(_0x3ce3ce[_0x2a3f('0x24')][_0x2a3f('0x25')]===0x1f4){logger['error'](_0x2a3f('0x21'),_0x325582,_0x3ce3ce[_0x2a3f('0x24')]['message']);return _0x2ce114(_0x3ce3ce[_0x2a3f('0x24')][_0x2a3f('0x26')]);}logger[_0x2a3f('0x24')](_0x2a3f('0x21'),_0x325582,_0x3ce3ce[_0x2a3f('0x24')][_0x2a3f('0x26')]);return _0x281b88(_0x3ce3ce[_0x2a3f('0x24')][_0x2a3f('0x26')]);}else{logger[_0x2a3f('0x27')](_0x2a3f('0x21'),_0x325582,_0x2a3f('0x28'));_0x281b88(_0x3ce3ce['result']['message']);}})[_0x2a3f('0x29')](function(_0x44dcbc){logger[_0x2a3f('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x325582,_0x44dcbc);_0x2ce114(_0x44dcbc);});});}function respondWithStatusCode(_0x1c1c44,_0x687aaa){_0x687aaa=_0x687aaa||0xcc;return function(_0x3a37ba){if(_0x3a37ba){return _0x1c1c44['sendStatus'](_0x687aaa);}return _0x1c1c44['status'](_0x687aaa)['end']();};}function respondWithResult(_0x3cbf2d,_0x1cda92){_0x1cda92=_0x1cda92||0xc8;return function(_0x5a39b8){if(_0x5a39b8){return _0x3cbf2d[_0x2a3f('0x2a')](_0x1cda92)[_0x2a3f('0x2b')](_0x5a39b8);}};}function respondWithFilteredResult(_0x2891a8,_0x394df4){return function(_0x534353){if(_0x534353){var _0x54322b=typeof _0x394df4['offset']===_0x2a3f('0x2c')&&typeof _0x394df4[_0x2a3f('0x2d')]===_0x2a3f('0x2c');var _0x52ce51=_0x534353[_0x2a3f('0x2e')];var _0x7ae1fc=_0x54322b?0x0:_0x394df4[_0x2a3f('0x2f')];var _0x3f3b4e=_0x54322b?_0x534353[_0x2a3f('0x2e')]:_0x394df4[_0x2a3f('0x2f')]+_0x394df4[_0x2a3f('0x2d')];var _0x3996c1;if(_0x3f3b4e>=_0x52ce51){_0x3f3b4e=_0x52ce51;_0x3996c1=0xc8;}else{_0x3996c1=0xce;}_0x2891a8[_0x2a3f('0x2a')](_0x3996c1);return _0x2891a8[_0x2a3f('0x30')](_0x2a3f('0x31'),_0x7ae1fc+'-'+_0x3f3b4e+'/'+_0x52ce51)[_0x2a3f('0x2b')](_0x534353);}return null;};}function patchUpdates(_0x314953){return function(_0x41f991){try{jsonpatch[_0x2a3f('0x32')](_0x41f991,_0x314953,!![]);}catch(_0x56d843){return BPromise[_0x2a3f('0x33')](_0x56d843);}return _0x41f991[_0x2a3f('0x34')]();};}function saveUpdates(_0x48b1ac,_0xf84980){return function(_0x32d7c6){if(_0x32d7c6){return _0x32d7c6[_0x2a3f('0x35')](_0x48b1ac)[_0x2a3f('0x20')](function(_0x4a461f){return _0x4a461f;});}return null;};}function removeEntity(_0x598473,_0x2f6858){return function(_0x37415f){if(_0x37415f){return _0x37415f[_0x2a3f('0x36')]()[_0x2a3f('0x20')](function(){var _0x4b9f62=_0x37415f['get']({'plain':!![]});var _0xf43dc7=_0x2a3f('0x37');return db[_0x2a3f('0x38')]['destroy']({'where':{'type':_0xf43dc7,'resourceId':_0x4b9f62['id']}})['then'](function(){return _0x37415f;});})[_0x2a3f('0x20')](function(){_0x598473['status'](0xcc)[_0x2a3f('0x39')]();});}};}function handleEntityNotFound(_0x2094ef,_0x361ed0){return function(_0x2f4543){if(!_0x2f4543){_0x2094ef[_0x2a3f('0x3a')](0x194);}return _0x2f4543;};}function handleError(_0x3c9d7a,_0x437eba){_0x437eba=_0x437eba||0x1f4;return function(_0x11b33b){logger['error'](_0x11b33b['stack']);if(_0x11b33b[_0x2a3f('0x3b')]){delete _0x11b33b['name'];}_0x3c9d7a[_0x2a3f('0x2a')](_0x437eba)[_0x2a3f('0x3c')](_0x11b33b);};}exports['index']=function(_0x4d2458,_0x16aef5){var _0x2e6659={'include':[{'model':db[_0x2a3f('0x3d')],'as':_0x2a3f('0x3e')}]},_0x930b93={},_0x1e43ef={'count':0x0,'rows':[]};var _0x40f4a1=_[_0x2a3f('0x3f')](db['OpenchannelAccount'][_0x2a3f('0x40')],function(_0x3f90cb){return{'name':_0x3f90cb[_0x2a3f('0x41')],'type':_0x3f90cb[_0x2a3f('0x42')][_0x2a3f('0x43')]};});_0x930b93[_0x2a3f('0x44')]=_['map'](_0x40f4a1,_0x2a3f('0x3b'));_0x930b93[_0x2a3f('0x45')]=_['keys'](_0x4d2458[_0x2a3f('0x45')]);_0x930b93[_0x2a3f('0x46')]=_['intersection'](_0x930b93['model'],_0x930b93[_0x2a3f('0x45')]);_0x2e6659[_0x2a3f('0x47')]=_[_0x2a3f('0x48')](_0x930b93[_0x2a3f('0x44')],qs[_0x2a3f('0x49')](_0x4d2458[_0x2a3f('0x45')][_0x2a3f('0x49')]));_0x2e6659[_0x2a3f('0x47')]=_0x2e6659[_0x2a3f('0x47')][_0x2a3f('0x4a')]?_0x2e6659['attributes']:_0x930b93['model'];if(!_0x4d2458[_0x2a3f('0x45')][_0x2a3f('0x4b')](_0x2a3f('0x4c'))){_0x2e6659['limit']=qs[_0x2a3f('0x2d')](_0x4d2458[_0x2a3f('0x45')][_0x2a3f('0x2d')]);_0x2e6659[_0x2a3f('0x2f')]=qs[_0x2a3f('0x2f')](_0x4d2458[_0x2a3f('0x45')][_0x2a3f('0x2f')]);}_0x2e6659[_0x2a3f('0x4d')]=qs[_0x2a3f('0x4e')](_0x4d2458[_0x2a3f('0x45')]['sort']);_0x2e6659['where']=qs['filters'](_[_0x2a3f('0x4f')](_0x4d2458['query'],_0x930b93[_0x2a3f('0x46')]),_0x40f4a1);if(_0x4d2458[_0x2a3f('0x45')][_0x2a3f('0x50')]){_0x2e6659['where']=_[_0x2a3f('0x51')](_0x2e6659[_0x2a3f('0x52')],{'$or':_[_0x2a3f('0x3f')](_0x40f4a1,function(_0x25b6f8){if(_0x25b6f8['type']!=='VIRTUAL'){var _0x1b1f3f={};_0x1b1f3f[_0x25b6f8[_0x2a3f('0x3b')]]={'$like':'%'+_0x4d2458[_0x2a3f('0x45')][_0x2a3f('0x50')]+'%'};return _0x1b1f3f;}})});}_0x2e6659=_[_0x2a3f('0x51')]({},_0x2e6659,_0x4d2458['options']);var _0x4663e8={'where':_0x2e6659[_0x2a3f('0x52')]};return db['OpenchannelAccount'][_0x2a3f('0x2e')](_0x4663e8)[_0x2a3f('0x20')](function(_0x2ba693){_0x1e43ef['count']=_0x2ba693;if(_0x4d2458[_0x2a3f('0x45')]['includeAll']){_0x2e6659[_0x2a3f('0x53')]=[{'all':!![]}];}return db[_0x2a3f('0x54')][_0x2a3f('0x55')](_0x2e6659);})['then'](function(_0x14a019){_0x1e43ef[_0x2a3f('0x56')]=_0x14a019;return _0x1e43ef;})[_0x2a3f('0x20')](respondWithFilteredResult(_0x16aef5,_0x2e6659))[_0x2a3f('0x29')](handleError(_0x16aef5,null));};exports[_0x2a3f('0x57')]=function(_0x29e944,_0x267b30){var _0x109470={'raw':![],'where':{'id':_0x29e944[_0x2a3f('0x58')]['id']},'include':[{'model':db[_0x2a3f('0x3d')],'as':_0x2a3f('0x3e')}]},_0x196e63={};_0x196e63['model']=_[_0x2a3f('0x59')](db['OpenchannelAccount'][_0x2a3f('0x40')]);_0x196e63[_0x2a3f('0x45')]=_['keys'](_0x29e944[_0x2a3f('0x45')]);_0x196e63[_0x2a3f('0x46')]=_['intersection'](_0x196e63[_0x2a3f('0x44')],_0x196e63[_0x2a3f('0x45')]);_0x109470[_0x2a3f('0x47')]=_['intersection'](_0x196e63['model'],qs[_0x2a3f('0x49')](_0x29e944[_0x2a3f('0x45')]['fields']));_0x109470[_0x2a3f('0x47')]=_0x109470[_0x2a3f('0x47')][_0x2a3f('0x4a')]?_0x109470[_0x2a3f('0x47')]:_0x196e63[_0x2a3f('0x44')];if(_0x29e944[_0x2a3f('0x45')][_0x2a3f('0x5a')]){_0x109470[_0x2a3f('0x53')]=[{'all':!![]}];}_0x109470=_['merge']({},_0x109470,_0x29e944['options']);return db[_0x2a3f('0x54')]['find'](_0x109470)[_0x2a3f('0x20')](handleEntityNotFound(_0x267b30,null))[_0x2a3f('0x20')](respondWithResult(_0x267b30,null))[_0x2a3f('0x29')](handleError(_0x267b30,null));};exports['create']=function(_0x4fe326,_0x1496bc){return db[_0x2a3f('0x54')][_0x2a3f('0x5b')](_0x4fe326['body'],{})[_0x2a3f('0x20')](function(_0x467b4e){var _0x5c628f=_0x4fe326['user'][_0x2a3f('0x5c')]({'plain':!![]});if(!_0x5c628f)throw new Error(_0x2a3f('0x5d'));if(_0x5c628f[_0x2a3f('0x5e')]==='user'){var _0x288b2e=_0x467b4e[_0x2a3f('0x5c')]({'plain':!![]});var _0x435cbb=_0x2a3f('0x37');return db[_0x2a3f('0x5f')][_0x2a3f('0x60')]({'where':{'name':_0x435cbb,'userProfileId':_0x5c628f[_0x2a3f('0x61')]},'raw':!![]})[_0x2a3f('0x20')](function(_0x1fd4ee){if(_0x1fd4ee&&_0x1fd4ee[_0x2a3f('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x288b2e['name'],'resourceId':_0x288b2e['id'],'type':_0x1fd4ee[_0x2a3f('0x3b')],'sectionId':_0x1fd4ee['id']},{})[_0x2a3f('0x20')](function(){return _0x467b4e;});}else{return _0x467b4e;}})[_0x2a3f('0x29')](function(_0x22c121){logger[_0x2a3f('0x24')](_0x2a3f('0x63'),_0x22c121);throw _0x22c121;});}return _0x467b4e;})['then'](respondWithResult(_0x1496bc,0xc9))[_0x2a3f('0x29')](handleError(_0x1496bc,null));};exports[_0x2a3f('0x35')]=function(_0x511403,_0x108340){if(_0x511403[_0x2a3f('0x64')]['id']){delete _0x511403['body']['id'];}return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x511403[_0x2a3f('0x58')]['id']},'include':[{'model':db[_0x2a3f('0x3d')],'as':_0x2a3f('0x3e')}]})[_0x2a3f('0x20')](handleEntityNotFound(_0x108340,null))[_0x2a3f('0x20')](saveUpdates(_0x511403[_0x2a3f('0x64')],null))['then'](respondWithResult(_0x108340,null))['catch'](handleError(_0x108340,null));};exports['destroy']=function(_0x501a6a,_0x4407be){return db['OpenchannelAccount'][_0x2a3f('0x60')]({'where':{'id':_0x501a6a[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x4407be,null))[_0x2a3f('0x20')](removeEntity(_0x4407be,null))[_0x2a3f('0x29')](handleError(_0x4407be,null));};exports[_0x2a3f('0x65')]=function(_0x41280b,_0x446bc3){return db['OpenchannelAccount'][_0x2a3f('0x65')]()[_0x2a3f('0x20')](respondWithResult(_0x446bc3,null))['catch'](handleError(_0x446bc3,null));};exports[_0x2a3f('0x66')]=function(_0x462703,_0x548fbd,_0x2a9e17){if(_0x462703[_0x2a3f('0x64')]['id']){delete _0x462703[_0x2a3f('0x64')]['id'];}return db['OpenchannelAccount'][_0x2a3f('0x60')]({'where':{'id':_0x462703[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x548fbd,null))[_0x2a3f('0x20')](function(_0x1cefc9){if(_0x1cefc9){_0x462703['body'][_0x2a3f('0x67')]=_0x1cefc9['id'];return db[_0x2a3f('0x68')][_0x2a3f('0x5b')](_0x462703[_0x2a3f('0x64')]);}})['then'](respondWithResult(_0x548fbd,null))[_0x2a3f('0x29')](handleError(_0x548fbd,null));};exports[_0x2a3f('0x69')]=function(_0x3d4803,_0x4c1795,_0x1dcc77){var _0x38de61={'raw':![],'where':{}};var _0x170f3={};var _0x5a4401={'count':0x0,'rows':[]};return db[_0x2a3f('0x54')][_0x2a3f('0x6a')]({'where':{'id':_0x3d4803[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x4c1795,null))[_0x2a3f('0x20')](function(_0x1de5b8){if(_0x1de5b8){_0x170f3[_0x2a3f('0x44')]=_[_0x2a3f('0x59')](db['Disposition'][_0x2a3f('0x40')]);_0x170f3[_0x2a3f('0x45')]=_[_0x2a3f('0x59')](_0x3d4803['query']);_0x170f3['filters']=_[_0x2a3f('0x48')](_0x170f3[_0x2a3f('0x44')],_0x170f3[_0x2a3f('0x45')]);_0x38de61[_0x2a3f('0x47')]=_[_0x2a3f('0x48')](_0x170f3['model'],qs[_0x2a3f('0x49')](_0x3d4803[_0x2a3f('0x45')]['fields']));_0x38de61['attributes']=_0x38de61['attributes'][_0x2a3f('0x4a')]?_0x38de61['attributes']:_0x170f3[_0x2a3f('0x44')];if(!_0x3d4803['query'][_0x2a3f('0x4b')](_0x2a3f('0x4c'))){_0x38de61['limit']=qs['limit'](_0x3d4803['query'][_0x2a3f('0x2d')]);_0x38de61['offset']=qs[_0x2a3f('0x2f')](_0x3d4803[_0x2a3f('0x45')][_0x2a3f('0x2f')]);}_0x38de61[_0x2a3f('0x4d')]=qs[_0x2a3f('0x4e')](_0x3d4803[_0x2a3f('0x45')]['sort']);_0x38de61[_0x2a3f('0x52')]=qs[_0x2a3f('0x46')](_[_0x2a3f('0x4f')](_0x3d4803[_0x2a3f('0x45')],_0x170f3[_0x2a3f('0x46')]));_0x38de61[_0x2a3f('0x52')]['OpenchannelAccountId']=_0x1de5b8['id'];if(_0x3d4803[_0x2a3f('0x45')][_0x2a3f('0x50')]){_0x38de61['where']=_[_0x2a3f('0x51')](_0x38de61[_0x2a3f('0x52')],{'$or':_[_0x2a3f('0x3f')](_0x38de61[_0x2a3f('0x47')],function(_0x4d6545){var _0x2402e7={};_0x2402e7[_0x4d6545]={'$like':'%'+_0x3d4803[_0x2a3f('0x45')][_0x2a3f('0x50')]+'%'};return _0x2402e7;})});}_0x38de61=_['merge']({},_0x38de61,_0x3d4803[_0x2a3f('0x6b')]);return db[_0x2a3f('0x68')][_0x2a3f('0x2e')]({'where':_0x38de61[_0x2a3f('0x52')]})['then'](function(_0x2143be){_0x5a4401['count']=_0x2143be;if(_0x3d4803[_0x2a3f('0x45')][_0x2a3f('0x5a')]){_0x38de61[_0x2a3f('0x53')]=[{'all':!![]}];}return db[_0x2a3f('0x68')][_0x2a3f('0x55')](_0x38de61);})['then'](function(_0xf3cf4){_0x5a4401[_0x2a3f('0x56')]=_0xf3cf4;return _0x5a4401;});}})[_0x2a3f('0x20')](respondWithFilteredResult(_0x4c1795,_0x38de61))['catch'](handleError(_0x4c1795,null));};exports[_0x2a3f('0x6c')]=function(_0x3dbd5a,_0x140912,_0x46024a){return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x3dbd5a[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x140912,null))['then'](function(_0x5b6f2a){if(_0x5b6f2a){return _0x5b6f2a[_0x2a3f('0x6c')](_0x3dbd5a[_0x2a3f('0x45')][_0x2a3f('0x6d')]);}})[_0x2a3f('0x20')](respondWithStatusCode(_0x140912,null))['catch'](handleError(_0x140912,null));};exports[_0x2a3f('0x6e')]=function(_0x455b36,_0x60423,_0xf208cd){if(_0x455b36[_0x2a3f('0x64')]['id']){delete _0x455b36[_0x2a3f('0x64')]['id'];}return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x455b36[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x60423,null))[_0x2a3f('0x20')](function(_0x2f4624){if(_0x2f4624){_0x455b36['body']['OpenchannelAccountId']=_0x2f4624['id'];return db[_0x2a3f('0x6f')]['create'](_0x455b36['body']);}})[_0x2a3f('0x20')](respondWithResult(_0x60423,null))[_0x2a3f('0x29')](handleError(_0x60423,null));};exports[_0x2a3f('0x70')]=function(_0x166269,_0x15a716,_0x5911d5){var _0x28cb5d={'raw':![],'where':{}};var _0x1e9ffc={};var _0x1d893f={'count':0x0,'rows':[]};return db[_0x2a3f('0x54')]['findOne']({'where':{'id':_0x166269[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x15a716,null))['then'](function(_0x188e32){if(_0x188e32){_0x1e9ffc[_0x2a3f('0x44')]=_[_0x2a3f('0x59')](db[_0x2a3f('0x6f')]['rawAttributes']);_0x1e9ffc[_0x2a3f('0x45')]=_[_0x2a3f('0x59')](_0x166269[_0x2a3f('0x45')]);_0x1e9ffc[_0x2a3f('0x46')]=_[_0x2a3f('0x48')](_0x1e9ffc['model'],_0x1e9ffc[_0x2a3f('0x45')]);_0x28cb5d['attributes']=_[_0x2a3f('0x48')](_0x1e9ffc['model'],qs[_0x2a3f('0x49')](_0x166269['query'][_0x2a3f('0x49')]));_0x28cb5d['attributes']=_0x28cb5d['attributes'][_0x2a3f('0x4a')]?_0x28cb5d[_0x2a3f('0x47')]:_0x1e9ffc[_0x2a3f('0x44')];if(!_0x166269['query']['hasOwnProperty'](_0x2a3f('0x4c'))){_0x28cb5d[_0x2a3f('0x2d')]=qs[_0x2a3f('0x2d')](_0x166269['query'][_0x2a3f('0x2d')]);_0x28cb5d[_0x2a3f('0x2f')]=qs[_0x2a3f('0x2f')](_0x166269[_0x2a3f('0x45')][_0x2a3f('0x2f')]);}_0x28cb5d[_0x2a3f('0x4d')]=qs[_0x2a3f('0x4e')](_0x166269[_0x2a3f('0x45')][_0x2a3f('0x4e')]);_0x28cb5d[_0x2a3f('0x52')]=qs[_0x2a3f('0x46')](_[_0x2a3f('0x4f')](_0x166269['query'],_0x1e9ffc['filters']));_0x28cb5d[_0x2a3f('0x52')][_0x2a3f('0x67')]=_0x188e32['id'];if(_0x166269['query'][_0x2a3f('0x50')]){_0x28cb5d['where']=_[_0x2a3f('0x51')](_0x28cb5d[_0x2a3f('0x52')],{'$or':_[_0x2a3f('0x3f')](_0x28cb5d[_0x2a3f('0x47')],function(_0x3ccc48){var _0x1f4217={};_0x1f4217[_0x3ccc48]={'$like':'%'+_0x166269[_0x2a3f('0x45')][_0x2a3f('0x50')]+'%'};return _0x1f4217;})});}_0x28cb5d=_[_0x2a3f('0x51')]({},_0x28cb5d,_0x166269['options']);return db[_0x2a3f('0x6f')]['count']({'where':_0x28cb5d[_0x2a3f('0x52')]})[_0x2a3f('0x20')](function(_0x4e9dcf){_0x1d893f['count']=_0x4e9dcf;if(_0x166269[_0x2a3f('0x45')][_0x2a3f('0x5a')]){_0x28cb5d[_0x2a3f('0x53')]=[{'all':!![]}];}return db[_0x2a3f('0x6f')][_0x2a3f('0x55')](_0x28cb5d);})[_0x2a3f('0x20')](function(_0x53a2a7){_0x1d893f[_0x2a3f('0x56')]=_0x53a2a7;return _0x1d893f;});}})[_0x2a3f('0x20')](respondWithFilteredResult(_0x15a716,_0x28cb5d))['catch'](handleError(_0x15a716,null));};exports[_0x2a3f('0x71')]=function(_0x2322d4,_0x25d841,_0x5ec714){return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x2322d4[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x25d841,null))[_0x2a3f('0x20')](function(_0x573daf){if(_0x573daf){return _0x573daf['removeAnswers'](_0x2322d4[_0x2a3f('0x45')]['ids']);}})[_0x2a3f('0x20')](respondWithStatusCode(_0x25d841,null))[_0x2a3f('0x29')](handleError(_0x25d841,null));};exports[_0x2a3f('0x72')]=function(_0x127c1f,_0x822000,_0x484588){var _0x5d3fa3={'body':_0x127c1f[_0x2a3f('0x64')],'channel':_0x2a3f('0x73')};var _0x1b164d=[];var _0x2c0596=[];var _0x216335={};var _0x14587d=![];return db[_0x2a3f('0x74')][_0x2a3f('0x65')]()['then'](function(_0x341538){if(!_0x341538){throw new db[(_0x2a3f('0x75'))][(_0x2a3f('0x76'))]('no\x20available\x20attributes');}_0x1b164d=_['difference'](_[_0x2a3f('0x59')](_0x341538),[_0x2a3f('0x77'),_0x2a3f('0x78')]);_0x2c0596=_[_0x2a3f('0x79')](_[_0x2a3f('0x59')](_0x341538),[_0x2a3f('0x77'),'updatedAt',_0x2a3f('0x7a'),'ListId']);if(_0x127c1f[_0x2a3f('0x64')]['id']){delete _0x127c1f[_0x2a3f('0x64')]['id'];}if(_['isNil'](_0x127c1f[_0x2a3f('0x64')]['from'])){throw new db[(_0x2a3f('0x75'))]['ValidationError'](_0x2a3f('0x7b'));}if(_[_0x2a3f('0x7c')](_0x127c1f['body']['body'])||_0x127c1f[_0x2a3f('0x64')]['body']===''){throw new db[(_0x2a3f('0x75'))][(_0x2a3f('0x76'))](_0x2a3f('0x7d'));}if(_['isNil'](_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x7e')])){throw new db[(_0x2a3f('0x75'))][(_0x2a3f('0x76'))](_0x2a3f('0x7f')+_0x2c0596);}if(!_[_0x2a3f('0x80')](_0x2c0596,_0x127c1f[_0x2a3f('0x64')]['mapKey'])){throw new db[(_0x2a3f('0x75'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c0596);}_0x216335[_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x7e')]]=_0x127c1f[_0x2a3f('0x64')]['from'];})[_0x2a3f('0x20')](function(){return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x127c1f[_0x2a3f('0x58')]['id']},'include':[{'model':db[_0x2a3f('0x81')],'as':_0x2a3f('0x82'),'include':[{'model':db[_0x2a3f('0x74')],'as':_0x2a3f('0x83'),'where':_0x216335,'limit':0x1,'order':[[_0x2a3f('0x78'),_0x2a3f('0x84')]]}]},{'model':db[_0x2a3f('0x85')],'as':_0x2a3f('0x86')}]});})['then'](handleEntityNotFound(_0x822000,null))[_0x2a3f('0x20')](function(_0x542a25){if(_0x542a25&&_0x542a25[_0x2a3f('0x82')]){_0x5d3fa3['account']=_0x542a25;_0x5d3fa3[_0x2a3f('0x87')]=_0x542a25[_0x2a3f('0x86')];_0x5d3fa3['list']=_0x542a25[_0x2a3f('0x82')];_0x5d3fa3[_0x2a3f('0x87')]=_[_0x2a3f('0x88')](_0x5d3fa3[_0x2a3f('0x87')],[_0x2a3f('0x89')],['asc']);if(_0x5d3fa3['account'][_0x2a3f('0x86')]){delete _0x5d3fa3[_0x2a3f('0x8a')][_0x2a3f('0x86')];}if(_0x5d3fa3[_0x2a3f('0x8a')][_0x2a3f('0x82')]&&_0x5d3fa3[_0x2a3f('0x8a')][_0x2a3f('0x82')][_0x2a3f('0x83')][_0x2a3f('0x4a')]){return _0x5d3fa3[_0x2a3f('0x8a')]['List'][_0x2a3f('0x83')][0x0];}var _0x5c1dd8=_['defaults'](_0x127c1f['body'],{'firstName':_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x8b')],'ListId':_0x542a25['ListId']});_0x5c1dd8[_0x127c1f['body'][_0x2a3f('0x7e')]]=_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x8b')];return db['CmContact'][_0x2a3f('0x5b')](_0x5c1dd8,{'fields':_0x1b164d,'raw':!![]});}})['then'](handleEntityNotFound(_0x822000,null))[_0x2a3f('0x20')](function(_0x32a040){_0x5d3fa3[_0x2a3f('0x8c')]=_0x32a040;if(_0x32a040){var _0x477f94={'ContactId':_0x32a040['id'],'OpenchannelAccountId':_0x127c1f[_0x2a3f('0x58')]['id'],'from':(_0x32a040[_0x2a3f('0x8d')]||'')+'\x20'+(_0x32a040[_0x2a3f('0x8e')]||'')};var _0x5b6f0b={'OpenchannelAccountId':_0x127c1f['params']['id'],'closed':![]};if(_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x8f')]){_0x5b6f0b[_0x2a3f('0x8f')]=_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x8f')];return db[_0x2a3f('0x90')][_0x2a3f('0x60')]({'where':_0x5b6f0b})[_0x2a3f('0x20')](function(_0x3687af){if(_0x3687af){return[_0x3687af,![]];}_0x477f94['threadId']=_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x8f')];_0x477f94[_0x2a3f('0x91')]=_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x91')];return db[_0x2a3f('0x90')][_0x2a3f('0x5b')](_0x477f94)['then'](function(_0x1a6f91){return[_0x1a6f91,!![]];});});}else{_0x5b6f0b[_0x2a3f('0x8f')]=null;}_0x5b6f0b[_0x2a3f('0x92')]=_0x32a040['id'];return db[_0x2a3f('0x90')][_0x2a3f('0x60')]({'where':_0x5b6f0b})['then'](function(_0x19b0ef){if(_0x19b0ef){return[_0x19b0ef,![]];}return db[_0x2a3f('0x90')]['create'](_0x477f94)[_0x2a3f('0x20')](function(_0x5d6d63){return[_0x5d6d63,!![]];});});}})[_0x2a3f('0x93')](function(_0x35ae8c,_0x6f5b5f){if(_0x35ae8c){_0x14587d=_0x6f5b5f;if(!_0x6f5b5f){var _0x147a0c={'from':(_0x5d3fa3[_0x2a3f('0x8c')][_0x2a3f('0x8d')]||'')+'\x20'+(_0x5d3fa3[_0x2a3f('0x8c')][_0x2a3f('0x8e')]||'')};if(_0x127c1f['body'][_0x2a3f('0x8f')]&&_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x94')]&&_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x8f')]!=_0x127c1f[_0x2a3f('0x64')]['messageId']){_0x147a0c[_0x2a3f('0x8f')]=_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x94')];}return _0x35ae8c[_0x2a3f('0x35')](_0x147a0c);}else{return _0x35ae8c;}}})[_0x2a3f('0x20')](function(_0x32a666){_0x5d3fa3[_0x2a3f('0x95')]=_0x32a666[_0x2a3f('0x5c')]({'plain':!![]});_0x5d3fa3[_0x2a3f('0x95')][_0x2a3f('0x96')]=_0x14587d;if(_0x5d3fa3['interaction'][_0x2a3f('0x96')]){if(_0x5d3fa3['account']['autoclose']){_0x5d3fa3[_0x2a3f('0x87')][_0x2a3f('0x97')]({'id':0x0,'priority':_0x5d3fa3[_0x2a3f('0x87')][_0x2a3f('0x4a')]+0x1,'app':_0x2a3f('0x98'),'appdata':_0x2a3f('0x99'),'interval':_0x2a3f('0x9a')});}}return db[_0x2a3f('0x9b')][_0x2a3f('0x5b')]({'body':_0x127c1f['body']['body'],'OpenchannelAccountId':_0x127c1f[_0x2a3f('0x58')]['id'],'OpenchannelInteractionId':_0x32a666['id'],'direction':'in','ContactId':_0x5d3fa3[_0x2a3f('0x8c')]['id'],'AttachmentId':_0x127c1f[_0x2a3f('0x64')][_0x2a3f('0x9c')]});})['then'](function(_0x579bad){_0x5d3fa3[_0x2a3f('0x26')]=_0x579bad;if(_0x5d3fa3['interaction'][_0x2a3f('0x9d')]){return db[_0x2a3f('0x9e')]['find']({'attributes':['id',_0x2a3f('0x3b')],'where':{'id':_0x5d3fa3[_0x2a3f('0x95')][_0x2a3f('0x9d')]}})[_0x2a3f('0x20')](function(_0x52de8b){if(_0x52de8b){_0x5d3fa3[_0x2a3f('0x87')][_0x2a3f('0x9f')]({'id':0x0,'priority':0x0,'app':_0x2a3f('0xa0'),'appdata':_0x52de8b['name']+','+(_0x5d3fa3[_0x2a3f('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':_0x2a3f('0x9a')});_0x5d3fa3[_0x2a3f('0xa1')]=![];}return respondWithRpcPromise(_0x2a3f('0xa2'),'startRouting',_0x5d3fa3);});}return respondWithRpcPromise(_0x2a3f('0xa2'),_0x2a3f('0xa3'),_0x5d3fa3);})[_0x2a3f('0x20')](function(_0xdb5aa9){respondWithRpcPromise('EventManager',_0x2a3f('0xa4'),{'event':'notify','message':_0xdb5aa9},client9002);return _0xdb5aa9;})[_0x2a3f('0x20')](respondWithResult(_0x822000,null))[_0x2a3f('0x29')](handleError(_0x822000,null));};exports[_0x2a3f('0xa5')]=function(_0x4ad370,_0x486be4,_0x26ea90){return db[_0x2a3f('0x54')][_0x2a3f('0x6a')]({'where':{'id':_0x4ad370[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x486be4,null))[_0x2a3f('0x20')](function(_0x4587d4){if(_0x4587d4){return db[_0x2a3f('0xa6')][_0x2a3f('0xa7')](function(_0x26c18f){return db[_0x2a3f('0x85')][_0x2a3f('0x36')]({'where':{'OpenchannelAccountId':_0x4ad370[_0x2a3f('0x58')]['id']},'transaction':_0x26c18f})[_0x2a3f('0x20')](function(_0x423682){var _0x4f8e05=_[_0x2a3f('0x3f')](_0x4ad370[_0x2a3f('0x64')],function(_0x154138){_0x154138['OpenchannelAccountId']=_0x4ad370[_0x2a3f('0x58')]['id'];return _0x154138;});return db[_0x2a3f('0x85')][_0x2a3f('0xa8')](_0x4f8e05,{'transaction':_0x26c18f});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x4ad370[_0x2a3f('0x58')]['id']},'order':_0x2a3f('0x89')});});}})[_0x2a3f('0x20')](respondWithResult(_0x486be4,null))[_0x2a3f('0x29')](handleError(_0x486be4,null));};exports[_0x2a3f('0xa9')]=function(_0x263b00,_0x5c9c88,_0x5ca8a7){var _0xd87bc4={};var _0x3edc32={};var _0x44873c;var _0x2d1f85;return db[_0x2a3f('0x54')][_0x2a3f('0x6a')]({'where':{'id':_0x263b00[_0x2a3f('0x58')]['id']}})['then'](handleEntityNotFound(_0x5c9c88,null))[_0x2a3f('0x20')](function(_0x9bb077){if(_0x9bb077){_0x44873c=_0x9bb077;_0x3edc32[_0x2a3f('0x44')]=_[_0x2a3f('0x59')](db[_0x2a3f('0x85')][_0x2a3f('0x40')]);_0x3edc32[_0x2a3f('0x45')]=_[_0x2a3f('0x59')](_0x263b00[_0x2a3f('0x45')]);_0x3edc32['filters']=_[_0x2a3f('0x48')](_0x3edc32[_0x2a3f('0x44')],_0x3edc32[_0x2a3f('0x45')]);_0xd87bc4[_0x2a3f('0x47')]=_['intersection'](_0x3edc32['model'],qs[_0x2a3f('0x49')](_0x263b00[_0x2a3f('0x45')][_0x2a3f('0x49')]));_0xd87bc4[_0x2a3f('0x47')]=_0xd87bc4['attributes'][_0x2a3f('0x4a')]?_0xd87bc4[_0x2a3f('0x47')]:_0x3edc32['model'];_0xd87bc4[_0x2a3f('0x4d')]=qs[_0x2a3f('0x4e')](_0x263b00[_0x2a3f('0x45')][_0x2a3f('0x4e')]);_0xd87bc4['where']=qs[_0x2a3f('0x46')](_[_0x2a3f('0x4f')](_0x263b00['query'],_0x3edc32[_0x2a3f('0x46')]));if(_0x263b00[_0x2a3f('0x45')][_0x2a3f('0x50')]){_0xd87bc4[_0x2a3f('0x52')]=_[_0x2a3f('0x51')](_0xd87bc4[_0x2a3f('0x52')],{'$or':_[_0x2a3f('0x3f')](_0xd87bc4['attributes'],function(_0x39bc02){var _0x52df8a={};_0x52df8a[_0x39bc02]={'$like':'%'+_0x263b00['query'][_0x2a3f('0x50')]+'%'};return _0x52df8a;})});}_0xd87bc4=_['merge']({},_0xd87bc4,_0x263b00[_0x2a3f('0x6b')]);return _0x44873c[_0x2a3f('0xa9')](_0xd87bc4);}})[_0x2a3f('0x20')](function(_0x9a3218){if(_0x9a3218){_0x2d1f85=_0x9a3218[_0x2a3f('0x4a')];if(!_0x263b00['query']['hasOwnProperty'](_0x2a3f('0x4c'))){_0xd87bc4[_0x2a3f('0x2d')]=qs[_0x2a3f('0x2d')](_0x263b00[_0x2a3f('0x45')][_0x2a3f('0x2d')]);_0xd87bc4[_0x2a3f('0x2f')]=qs[_0x2a3f('0x2f')](_0x263b00[_0x2a3f('0x45')]['offset']);}return _0x44873c[_0x2a3f('0xa9')](_0xd87bc4);}})[_0x2a3f('0x20')](function(_0x4adb7a){if(_0x4adb7a){return _0x4adb7a?{'count':_0x2d1f85,'rows':_0x4adb7a}:null;}})[_0x2a3f('0x20')](respondWithResult(_0x5c9c88,null))['catch'](handleError(_0x5c9c88,null));};exports[_0x2a3f('0xaa')]=function(_0x2272d3,_0x4e0f43,_0x11056e){var _0x5a5eaf={'raw':![],'where':{}};var _0x14aef9={};var _0x16fb45={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x2a3f('0x6a')]({'where':{'id':_0x2272d3[_0x2a3f('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e0f43,null))[_0x2a3f('0x20')](function(_0x50b729){if(_0x50b729){_0x14aef9[_0x2a3f('0x44')]=_[_0x2a3f('0x59')](db['OpenchannelInteraction'][_0x2a3f('0x40')]);_0x14aef9[_0x2a3f('0x45')]=_[_0x2a3f('0x59')](_0x2272d3[_0x2a3f('0x45')]);_0x14aef9['filters']=_[_0x2a3f('0x48')](_0x14aef9['model'],_0x14aef9[_0x2a3f('0x45')]);_0x5a5eaf[_0x2a3f('0x47')]=_[_0x2a3f('0x48')](_0x14aef9[_0x2a3f('0x44')],qs[_0x2a3f('0x49')](_0x2272d3['query'][_0x2a3f('0x49')]));_0x5a5eaf[_0x2a3f('0x47')]=_0x5a5eaf['attributes'][_0x2a3f('0x4a')]?_0x5a5eaf[_0x2a3f('0x47')]:_0x14aef9[_0x2a3f('0x44')];if(!_0x2272d3['query'][_0x2a3f('0x4b')](_0x2a3f('0x4c'))){_0x5a5eaf['limit']=qs[_0x2a3f('0x2d')](_0x2272d3[_0x2a3f('0x45')][_0x2a3f('0x2d')]);_0x5a5eaf[_0x2a3f('0x2f')]=qs[_0x2a3f('0x2f')](_0x2272d3[_0x2a3f('0x45')][_0x2a3f('0x2f')]);}_0x5a5eaf[_0x2a3f('0x4d')]=qs[_0x2a3f('0x4e')](_0x2272d3['query'][_0x2a3f('0x4e')]);_0x5a5eaf[_0x2a3f('0x52')]=qs['filters'](_[_0x2a3f('0x4f')](_0x2272d3[_0x2a3f('0x45')],_0x14aef9[_0x2a3f('0x46')]));_0x5a5eaf[_0x2a3f('0x52')][_0x2a3f('0x67')]=_0x50b729['id'];if(_0x2272d3[_0x2a3f('0x45')][_0x2a3f('0x50')]){_0x5a5eaf[_0x2a3f('0x52')]=_[_0x2a3f('0x51')](_0x5a5eaf[_0x2a3f('0x52')],{'$or':_[_0x2a3f('0x3f')](_0x5a5eaf[_0x2a3f('0x47')],function(_0xc7500a){var _0x3cf028={};_0x3cf028[_0xc7500a]={'$like':'%'+_0x2272d3['query']['filter']+'%'};return _0x3cf028;})});}_0x5a5eaf=_['merge']({},_0x5a5eaf,_0x2272d3['options']);return db[_0x2a3f('0x90')][_0x2a3f('0x2e')]({'where':_0x5a5eaf[_0x2a3f('0x52')]})[_0x2a3f('0x20')](function(_0x378dab){_0x16fb45[_0x2a3f('0x2e')]=_0x378dab;if(_0x2272d3[_0x2a3f('0x45')][_0x2a3f('0x5a')]){_0x5a5eaf[_0x2a3f('0x53')]=[{'model':db[_0x2a3f('0x74')],'as':_0x2a3f('0xab'),'required':![]},{'model':db[_0x2a3f('0x9e')],'as':_0x2a3f('0xac'),'attributes':['name',_0x2a3f('0xad'),_0x2a3f('0xae')],'required':![]},{'model':db[_0x2a3f('0xaf')],'as':'Tags','attributes':['id','name','color'],'where':_0x2272d3[_0x2a3f('0x45')][_0x2a3f('0xb0')]?{'id':_0x2272d3[_0x2a3f('0x45')][_0x2a3f('0xb0')]}:undefined,'required':_0x2272d3[_0x2a3f('0x45')]['tag']?!![]:![]}];}return db[_0x2a3f('0x90')][_0x2a3f('0x55')](_0x5a5eaf);})['then'](function(_0x22df74){_0x16fb45[_0x2a3f('0x56')]=_0x22df74;return _0x16fb45;});}})[_0x2a3f('0x20')](respondWithFilteredResult(_0x4e0f43,_0x5a5eaf))['catch'](handleError(_0x4e0f43,null));};exports[_0x2a3f('0xb1')]=function(_0x3a330c,_0x2ee1ed,_0x548945){return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x3a330c['params']['id']}})['then'](handleEntityNotFound(_0x2ee1ed,null))['then'](function(_0xa20115){if(_0xa20115){return _0xa20115[_0x2a3f('0xb1')](_0x3a330c['body']['ids'],_[_0x2a3f('0xb2')](_0x3a330c[_0x2a3f('0x64')],[_0x2a3f('0x6d'),'id'])||{})[_0x2a3f('0x93')](function(_0x109495){for(var _0x2b1e69=0x0;_0x2b1e69<_0x3a330c[_0x2a3f('0x64')]['ids'][_0x2a3f('0x4a')];_0x2b1e69+=0x1){socket[_0x2a3f('0xb3')](_0x2a3f('0xb4'),{'UserId':_0x3a330c[_0x2a3f('0x64')][_0x2a3f('0x6d')][_0x2b1e69],'OpenchannelAccountId':_0x3a330c['params']['id']});}return _0x109495;});}})[_0x2a3f('0x20')](respondWithResult(_0x2ee1ed,null))[_0x2a3f('0x29')](handleError(_0x2ee1ed,null));};exports[_0x2a3f('0xb5')]=function(_0x2e3596,_0x56197a,_0x38db3c){return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x2e3596[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x56197a,null))['then'](function(_0x168f34){if(_0x168f34){return _0x168f34[_0x2a3f('0xb5')](_0x2e3596['query'][_0x2a3f('0x6d')])[_0x2a3f('0x20')](function(){if(_[_0x2a3f('0xb6')](_0x2e3596[_0x2a3f('0x45')][_0x2a3f('0x6d')])){for(var _0x42c3b6=0x0;_0x42c3b6<_0x2e3596['query'][_0x2a3f('0x6d')][_0x2a3f('0x4a')];_0x42c3b6+=0x1){socket[_0x2a3f('0xb3')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2e3596[_0x2a3f('0x45')][_0x2a3f('0x6d')][_0x42c3b6]),'OpenchannelAccountId':Number(_0x2e3596[_0x2a3f('0x58')]['id'])});}}else{socket[_0x2a3f('0xb3')](_0x2a3f('0xb7'),{'UserId':Number(_0x2e3596[_0x2a3f('0x45')][_0x2a3f('0x6d')]),'OpenchannelAccountId':Number(_0x2e3596['params']['id'])});}});}})[_0x2a3f('0x20')](respondWithStatusCode(_0x56197a,null))['catch'](handleError(_0x56197a,null));};exports[_0x2a3f('0xb8')]=function(_0x31f9a5,_0x2b82e4,_0x42131a){var _0xdc0662={};var _0x13d2be={};var _0xbf7b1f;var _0x8025ae;return db[_0x2a3f('0x54')]['findOne']({'where':{'id':_0x31f9a5[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x2b82e4,null))['then'](function(_0x5d77a9){if(_0x5d77a9){_0xbf7b1f=_0x5d77a9;_0x13d2be[_0x2a3f('0x44')]=_[_0x2a3f('0x59')](db[_0x2a3f('0x9e')][_0x2a3f('0x40')]);_0x13d2be[_0x2a3f('0x45')]=_[_0x2a3f('0x59')](_0x31f9a5[_0x2a3f('0x45')]);_0x13d2be[_0x2a3f('0x46')]=_[_0x2a3f('0x48')](_0x13d2be['model'],_0x13d2be[_0x2a3f('0x45')]);_0xdc0662[_0x2a3f('0x47')]=_[_0x2a3f('0x48')](_0x13d2be[_0x2a3f('0x44')],qs['fields'](_0x31f9a5[_0x2a3f('0x45')][_0x2a3f('0x49')]));_0xdc0662['attributes']=_0xdc0662[_0x2a3f('0x47')][_0x2a3f('0x4a')]?_0xdc0662[_0x2a3f('0x47')]:_0x13d2be[_0x2a3f('0x44')];_0xdc0662[_0x2a3f('0x4d')]=qs[_0x2a3f('0x4e')](_0x31f9a5['query'][_0x2a3f('0x4e')]);_0xdc0662[_0x2a3f('0x52')]=qs[_0x2a3f('0x46')](_[_0x2a3f('0x4f')](_0x31f9a5[_0x2a3f('0x45')],_0x13d2be[_0x2a3f('0x46')]));if(_0x31f9a5['query'][_0x2a3f('0x50')]){_0xdc0662[_0x2a3f('0x52')]=_[_0x2a3f('0x51')](_0xdc0662['where'],{'$or':_[_0x2a3f('0x3f')](_0xdc0662['attributes'],function(_0x11288c){var _0x63fe09={};_0x63fe09[_0x11288c]={'$like':'%'+_0x31f9a5[_0x2a3f('0x45')]['filter']+'%'};return _0x63fe09;})});}_0xdc0662=_[_0x2a3f('0x51')]({},_0xdc0662,_0x31f9a5['options']);return _0xbf7b1f[_0x2a3f('0xb8')](_0xdc0662);}})[_0x2a3f('0x20')](function(_0x1f0bcc){if(_0x1f0bcc){_0x8025ae=_0x1f0bcc[_0x2a3f('0x4a')];if(!_0x31f9a5[_0x2a3f('0x45')][_0x2a3f('0x4b')](_0x2a3f('0x4c'))){_0xdc0662[_0x2a3f('0x2d')]=qs[_0x2a3f('0x2d')](_0x31f9a5[_0x2a3f('0x45')][_0x2a3f('0x2d')]);_0xdc0662[_0x2a3f('0x2f')]=qs['offset'](_0x31f9a5['query'][_0x2a3f('0x2f')]);}return _0xbf7b1f[_0x2a3f('0xb8')](_0xdc0662);}})[_0x2a3f('0x20')](function(_0xd4a107){if(_0xd4a107){return _0xd4a107?{'count':_0x8025ae,'rows':_0xd4a107}:null;}})[_0x2a3f('0x20')](respondWithResult(_0x2b82e4,null))['catch'](handleError(_0x2b82e4,null));};exports[_0x2a3f('0x3c')]=function(_0x42b916,_0x23e022,_0x28d2a0){var _0x496aae,_0x2435f6,_0x522213;if(_['isNil'](_0x42b916[_0x2a3f('0x64')][_0x2a3f('0x64')])||_0x42b916[_0x2a3f('0x64')][_0x2a3f('0x64')]===''){throw new db[(_0x2a3f('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x42b916[_0x2a3f('0x64')]['to'])){}_0x496aae=_0x42b916['body']['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x42b916[_0x2a3f('0x58')]['id']}})[_0x2a3f('0x20')](handleEntityNotFound(_0x23e022,null))[_0x2a3f('0x20')](function(_0x153413){if(_0x153413){return db[_0x2a3f('0x54')][_0x2a3f('0x60')]({'where':{'id':_0x153413['id']},'include':[{'model':db[_0x2a3f('0x81')],'as':_0x2a3f('0x82'),'include':[{'model':db[_0x2a3f('0x74')],'as':'Contacts','where':{[_0x153413[_0x2a3f('0x7e')]]:_0x496aae},'limit':0x1,'order':[[_0x2a3f('0x78'),_0x2a3f('0x84')]]}]}]})[_0x2a3f('0x20')](handleEntityNotFound(_0x23e022,null))['then'](function(_0x1effbe){if(_0x1effbe&&_0x1effbe[_0x2a3f('0x82')]){_0x2435f6=_0x1effbe[_0x2a3f('0x5c')]({'plain':!![]});if(_0x2435f6[_0x2a3f('0x82')]&&_0x2435f6['List'][_0x2a3f('0x83')][_0x2a3f('0x4a')]){return _0x2435f6[_0x2a3f('0x82')][_0x2a3f('0x83')][0x0];}return db[_0x2a3f('0x74')][_0x2a3f('0x5b')](_[_0x2a3f('0x19')](_0x42b916['body'],{'firstName':_0x496aae,[_0x1effbe[_0x2a3f('0x7e')]]:_0x496aae,'phone':_0x496aae,'ListId':_0x2435f6[_0x2a3f('0xb9')]}));}})['then'](handleEntityNotFound(_0x23e022,null))[_0x2a3f('0x20')](function(_0x66466b){if(_0x66466b){_0x522213=_0x66466b;return db[_0x2a3f('0x90')][_0x2a3f('0x60')]({'where':{'ContactId':_0x522213['id'],'closed':![],'OpenchannelAccountId':_0x2435f6['id']}})['then'](function(_0x1e79b1){if(_0x1e79b1){return[_0x1e79b1,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x42b916[_0x2a3f('0xba')]['id'],'ContactId':_0x522213['id'],'OpenchannelAccountId':_0x2435f6['id'],'lastMsgDirection':_0x2a3f('0xbb'),'Messages':[_['merge'](_0x42b916[_0x2a3f('0x64')],{'read':![],'body':_0x42b916['body'][_0x2a3f('0x64')],'OpenchannelAccountId':_0x2435f6['id'],'UserId':_0x42b916[_0x2a3f('0xba')]['id'],'ContactId':_0x522213['id']})]},{'include':[{'model':db[_0x2a3f('0x9b')],'as':_0x2a3f('0xbc')}]})[_0x2a3f('0x20')](function(_0x25d983){return[_0x25d983,!![]];});});}})[_0x2a3f('0x93')](function(_0x5ca888,_0x3c1445){if(_0x3c1445){return _0x5ca888;}return db[_0x2a3f('0x9b')][_0x2a3f('0x5b')](_[_0x2a3f('0x51')](_0x42b916[_0x2a3f('0x64')],{'read':![],'body':_0x42b916['body'][_0x2a3f('0x64')],'OpenchannelAccountId':_0x2435f6['id'],'OpenchannelInteractionId':_0x5ca888['id'],'UserId':_0x42b916[_0x2a3f('0xba')]['id'],'ContactId':_0x522213['id']}))['then'](function(_0x513e22){_0x5ca888[_0x2a3f('0xbd')][_0x2a3f('0xbc')]=[];_0x5ca888[_0x2a3f('0xbd')][_0x2a3f('0xbc')][_0x2a3f('0x97')](_0x513e22[_0x2a3f('0xbd')]);return _0x5ca888;});});}})[_0x2a3f('0x20')](respondWithResult(_0x23e022,null))['catch'](handleError(_0x23e022,null));};
\ No newline at end of file
+var _0x8623=['startRouting','EventManager','addApplications','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','DESC','out','Messages','dataValues','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','status','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','end','name','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','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','addDisposition','findOne','Disposition','hasOwnProperty','pick','OpenchannelAccountId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Applications','list','applications','orderBy','priority','account','Contacts','defaults','CmContact','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start'];(function(_0x673ff2,_0x2c53b7){var _0x4b66d8=function(_0x2738cc){while(--_0x2738cc){_0x673ff2['push'](_0x673ff2['shift']());}};_0x4b66d8(++_0x2c53b7);}(_0x8623,0x194));var _0x3862=function(_0x5a9886,_0x24a473){_0x5a9886=_0x5a9886-0x0;var _0x2ff376=_0x8623[_0x5a9886];return _0x2ff376;};'use strict';var emlformat=require(_0x3862('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3862('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3862('0x2'));var BPromise=require(_0x3862('0x3'));var Mustache=require(_0x3862('0x4'));var util=require(_0x3862('0x5'));var path=require(_0x3862('0x6'));var sox=require(_0x3862('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3862('0x8'));var _=require(_0x3862('0x9'));var squel=require(_0x3862('0xa'));var crypto=require(_0x3862('0xb'));var jsforce=require(_0x3862('0xc'));var deskjs=require(_0x3862('0xd'));var toCsv=require(_0x3862('0xe'));var querystring=require(_0x3862('0xf'));var Papa=require('papaparse');var Redis=require(_0x3862('0x10'));var authService=require(_0x3862('0x11'));var qs=require(_0x3862('0x12'));var as=require(_0x3862('0x13'));var hardwareService=require(_0x3862('0x14'));var logger=require(_0x3862('0x15'))(_0x3862('0x16'));var utils=require(_0x3862('0x17'));var config=require(_0x3862('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3862('0x19'))['db'];config[_0x3862('0x1a')]=_['defaults'](config['redis'],{'host':_0x3862('0x1b'),'port':0x18eb});var socket=require(_0x3862('0x1c'))(new Redis(config[_0x3862('0x1a')]));require('./openchannelAccount.socket')[_0x3862('0x1d')](socket);var jayson=require(_0x3862('0x1e'));var client=jayson[_0x3862('0x1f')][_0x3862('0x20')]({'port':0x232c});var client9002=jayson[_0x3862('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x297641,_0x2caca5,_0x114dc0,_0x5f12af){return new BPromise(function(_0x26bd60,_0x296af2){var _0x4ad61f=_0x5f12af||client;return _0x4ad61f['request'](_0x297641,_0x114dc0)['then'](function(_0x3b9ea8){logger['info'](_0x3862('0x21'),_0x2caca5,'request\x20sent');logger['debug'](_0x3862('0x22'),_0x2caca5,_0x3862('0x23'),JSON['stringify'](_0x3b9ea8));if(_0x3b9ea8[_0x3862('0x24')]){if(_0x3b9ea8[_0x3862('0x24')][_0x3862('0x25')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2caca5,_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);return _0x296af2(_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);}logger[_0x3862('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x2caca5,_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);return _0x26bd60(_0x3b9ea8[_0x3862('0x24')][_0x3862('0x26')]);}else{logger[_0x3862('0x27')](_0x3862('0x21'),_0x2caca5,_0x3862('0x23'));_0x26bd60(_0x3b9ea8['result'][_0x3862('0x26')]);}})[_0x3862('0x28')](function(_0x5f5950){logger['error'](_0x3862('0x21'),_0x2caca5,_0x5f5950);_0x296af2(_0x5f5950);});});}function respondWithStatusCode(_0x51fd6a,_0x42950e){_0x42950e=_0x42950e||0xcc;return function(_0x289787){if(_0x289787){return _0x51fd6a['sendStatus'](_0x42950e);}return _0x51fd6a[_0x3862('0x29')](_0x42950e)['end']();};}function respondWithResult(_0x3222c6,_0x223e18){_0x223e18=_0x223e18||0xc8;return function(_0x45183b){if(_0x45183b){return _0x3222c6['status'](_0x223e18)['json'](_0x45183b);}};}function respondWithFilteredResult(_0x274ff4,_0x45870e){return function(_0x4d774a){if(_0x4d774a){var _0x32bddd=typeof _0x45870e[_0x3862('0x2a')]==='undefined'&&typeof _0x45870e[_0x3862('0x2b')]===_0x3862('0x2c');var _0x3ecdf6=_0x4d774a[_0x3862('0x2d')];var _0x510969=_0x32bddd?0x0:_0x45870e[_0x3862('0x2a')];var _0x572062=_0x32bddd?_0x4d774a[_0x3862('0x2d')]:_0x45870e[_0x3862('0x2a')]+_0x45870e[_0x3862('0x2b')];var _0x280db6;if(_0x572062>=_0x3ecdf6){_0x572062=_0x3ecdf6;_0x280db6=0xc8;}else{_0x280db6=0xce;}_0x274ff4['status'](_0x280db6);return _0x274ff4[_0x3862('0x2e')]('Content-Range',_0x510969+'-'+_0x572062+'/'+_0x3ecdf6)['json'](_0x4d774a);}return null;};}function patchUpdates(_0x5aeafc){return function(_0x2c5ba0){try{jsonpatch[_0x3862('0x2f')](_0x2c5ba0,_0x5aeafc,!![]);}catch(_0x594900){return BPromise['reject'](_0x594900);}return _0x2c5ba0[_0x3862('0x30')]();};}function saveUpdates(_0x2f4749,_0xd23a43){return function(_0x432bb4){if(_0x432bb4){return _0x432bb4[_0x3862('0x31')](_0x2f4749)[_0x3862('0x32')](function(_0x4618d7){return _0x4618d7;});}return null;};}function removeEntity(_0x5dc521,_0x284178){return function(_0x3a5735){if(_0x3a5735){return _0x3a5735[_0x3862('0x33')]()[_0x3862('0x32')](function(){var _0x126511=_0x3a5735[_0x3862('0x34')]({'plain':!![]});var _0xccccd2=_0x3862('0x35');return db[_0x3862('0x36')][_0x3862('0x33')]({'where':{'type':_0xccccd2,'resourceId':_0x126511['id']}})[_0x3862('0x32')](function(){return _0x3a5735;});})[_0x3862('0x32')](function(){_0x5dc521[_0x3862('0x29')](0xcc)[_0x3862('0x37')]();});}};}function handleEntityNotFound(_0x472f96,_0x50ba0e){return function(_0x406895){if(!_0x406895){_0x472f96['sendStatus'](0x194);}return _0x406895;};}function handleError(_0xd2bf9a,_0x2ae86a){_0x2ae86a=_0x2ae86a||0x1f4;return function(_0x4e3dd2){logger[_0x3862('0x24')](_0x4e3dd2['stack']);if(_0x4e3dd2[_0x3862('0x38')]){delete _0x4e3dd2[_0x3862('0x38')];}_0xd2bf9a[_0x3862('0x29')](_0x2ae86a)['send'](_0x4e3dd2);};}exports['index']=function(_0x1efadc,_0xc7fff4){var _0x5aad05={'include':[{'model':db[_0x3862('0x39')],'as':_0x3862('0x3a')}]},_0x337183={},_0x33145f={'count':0x0,'rows':[]};var _0x8dd13a=_['map'](db[_0x3862('0x3b')][_0x3862('0x3c')],function(_0x474626){return{'name':_0x474626[_0x3862('0x3d')],'type':_0x474626[_0x3862('0x3e')][_0x3862('0x3f')]};});_0x337183['model']=_[_0x3862('0x40')](_0x8dd13a,'name');_0x337183[_0x3862('0x41')]=_[_0x3862('0x42')](_0x1efadc[_0x3862('0x41')]);_0x337183[_0x3862('0x43')]=_[_0x3862('0x44')](_0x337183['model'],_0x337183['query']);_0x5aad05[_0x3862('0x45')]=_[_0x3862('0x44')](_0x337183[_0x3862('0x46')],qs[_0x3862('0x47')](_0x1efadc[_0x3862('0x41')]['fields']));_0x5aad05[_0x3862('0x45')]=_0x5aad05[_0x3862('0x45')][_0x3862('0x48')]?_0x5aad05[_0x3862('0x45')]:_0x337183[_0x3862('0x46')];if(!_0x1efadc[_0x3862('0x41')]['hasOwnProperty'](_0x3862('0x49'))){_0x5aad05['limit']=qs[_0x3862('0x2b')](_0x1efadc[_0x3862('0x41')][_0x3862('0x2b')]);_0x5aad05[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x1efadc[_0x3862('0x41')]['offset']);}_0x5aad05[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x1efadc[_0x3862('0x41')]['sort']);_0x5aad05[_0x3862('0x4c')]=qs[_0x3862('0x43')](_['pick'](_0x1efadc[_0x3862('0x41')],_0x337183[_0x3862('0x43')]),_0x8dd13a);if(_0x1efadc['query'][_0x3862('0x4d')]){_0x5aad05[_0x3862('0x4c')]=_[_0x3862('0x4e')](_0x5aad05[_0x3862('0x4c')],{'$or':_['map'](_0x8dd13a,function(_0x39555d){if(_0x39555d[_0x3862('0x3e')]!==_0x3862('0x4f')){var _0x20bed9={};_0x20bed9[_0x39555d[_0x3862('0x38')]]={'$like':'%'+_0x1efadc[_0x3862('0x41')]['filter']+'%'};return _0x20bed9;}})});}_0x5aad05=_[_0x3862('0x4e')]({},_0x5aad05,_0x1efadc['options']);var _0x2b1218={'where':_0x5aad05['where']};return db[_0x3862('0x3b')][_0x3862('0x2d')](_0x2b1218)[_0x3862('0x32')](function(_0x1f7ac5){_0x33145f[_0x3862('0x2d')]=_0x1f7ac5;if(_0x1efadc[_0x3862('0x41')][_0x3862('0x50')]){_0x5aad05['include']=[{'all':!![]}];}return db[_0x3862('0x3b')][_0x3862('0x51')](_0x5aad05);})['then'](function(_0x51b3bc){_0x33145f[_0x3862('0x52')]=_0x51b3bc;return _0x33145f;})['then'](respondWithFilteredResult(_0xc7fff4,_0x5aad05))['catch'](handleError(_0xc7fff4,null));};exports[_0x3862('0x53')]=function(_0x26acf5,_0x18b373){var _0x4d5412={'raw':![],'where':{'id':_0x26acf5[_0x3862('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x3862('0x3a')}]},_0x1fe155={};_0x1fe155[_0x3862('0x46')]=_[_0x3862('0x42')](db['OpenchannelAccount']['rawAttributes']);_0x1fe155['query']=_[_0x3862('0x42')](_0x26acf5[_0x3862('0x41')]);_0x1fe155[_0x3862('0x43')]=_['intersection'](_0x1fe155[_0x3862('0x46')],_0x1fe155[_0x3862('0x41')]);_0x4d5412[_0x3862('0x45')]=_[_0x3862('0x44')](_0x1fe155[_0x3862('0x46')],qs[_0x3862('0x47')](_0x26acf5[_0x3862('0x41')][_0x3862('0x47')]));_0x4d5412[_0x3862('0x45')]=_0x4d5412['attributes']['length']?_0x4d5412[_0x3862('0x45')]:_0x1fe155[_0x3862('0x46')];if(_0x26acf5[_0x3862('0x41')][_0x3862('0x50')]){_0x4d5412['include']=[{'all':!![]}];}_0x4d5412=_[_0x3862('0x4e')]({},_0x4d5412,_0x26acf5[_0x3862('0x55')]);return db[_0x3862('0x3b')][_0x3862('0x56')](_0x4d5412)[_0x3862('0x32')](handleEntityNotFound(_0x18b373,null))[_0x3862('0x32')](respondWithResult(_0x18b373,null))[_0x3862('0x28')](handleError(_0x18b373,null));};exports[_0x3862('0x57')]=function(_0x30ad7f,_0x1a3ac0){return db['OpenchannelAccount']['create'](_0x30ad7f['body'],{})[_0x3862('0x32')](function(_0x5c8dc6){var _0x2190ba=_0x30ad7f[_0x3862('0x58')]['get']({'plain':!![]});if(!_0x2190ba)throw new Error(_0x3862('0x59'));if(_0x2190ba[_0x3862('0x5a')]===_0x3862('0x58')){var _0x56647d=_0x5c8dc6[_0x3862('0x34')]({'plain':!![]});var _0x5b7cd6=_0x3862('0x35');return db[_0x3862('0x5b')][_0x3862('0x56')]({'where':{'name':_0x5b7cd6,'userProfileId':_0x2190ba[_0x3862('0x5c')]},'raw':!![]})[_0x3862('0x32')](function(_0x493fc5){if(_0x493fc5&&_0x493fc5['autoAssociation']===0x0){return db[_0x3862('0x36')][_0x3862('0x57')]({'name':_0x56647d[_0x3862('0x38')],'resourceId':_0x56647d['id'],'type':_0x493fc5[_0x3862('0x38')],'sectionId':_0x493fc5['id']},{})[_0x3862('0x32')](function(){return _0x5c8dc6;});}else{return _0x5c8dc6;}})['catch'](function(_0x1a7dd3){logger[_0x3862('0x24')](_0x3862('0x5d'),_0x1a7dd3);throw _0x1a7dd3;});}return _0x5c8dc6;})['then'](respondWithResult(_0x1a3ac0,0xc9))[_0x3862('0x28')](handleError(_0x1a3ac0,null));};exports['update']=function(_0x24792c,_0x5f4682){if(_0x24792c[_0x3862('0x5e')]['id']){delete _0x24792c[_0x3862('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x24792c[_0x3862('0x54')]['id']},'include':[{'model':db[_0x3862('0x39')],'as':_0x3862('0x3a')}]})[_0x3862('0x32')](handleEntityNotFound(_0x5f4682,null))['then'](saveUpdates(_0x24792c[_0x3862('0x5e')],null))[_0x3862('0x32')](respondWithResult(_0x5f4682,null))[_0x3862('0x28')](handleError(_0x5f4682,null));};exports[_0x3862('0x33')]=function(_0x20bcf3,_0x27b177){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x20bcf3[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x27b177,null))['then'](removeEntity(_0x27b177,null))['catch'](handleError(_0x27b177,null));};exports[_0x3862('0x5f')]=function(_0x3c3ed1,_0x2f560a){return db['OpenchannelAccount'][_0x3862('0x5f')]()[_0x3862('0x32')](respondWithResult(_0x2f560a,null))[_0x3862('0x28')](handleError(_0x2f560a,null));};exports[_0x3862('0x60')]=function(_0xbcb6a1,_0x39f778,_0x2305ce){if(_0xbcb6a1[_0x3862('0x5e')]['id']){delete _0xbcb6a1[_0x3862('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0xbcb6a1[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x39f778,null))[_0x3862('0x32')](function(_0x339dd1){if(_0x339dd1){_0xbcb6a1[_0x3862('0x5e')]['OpenchannelAccountId']=_0x339dd1['id'];return db['Disposition']['create'](_0xbcb6a1[_0x3862('0x5e')]);}})[_0x3862('0x32')](respondWithResult(_0x39f778,null))[_0x3862('0x28')](handleError(_0x39f778,null));};exports['getDispositions']=function(_0x3e8355,_0x3d63c3,_0x30654f){var _0x3ae3c4={'raw':![],'where':{}};var _0xeb7298={};var _0x517db0={'count':0x0,'rows':[]};return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x3e8355[_0x3862('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d63c3,null))[_0x3862('0x32')](function(_0x128e73){if(_0x128e73){_0xeb7298[_0x3862('0x46')]=_[_0x3862('0x42')](db[_0x3862('0x62')][_0x3862('0x3c')]);_0xeb7298[_0x3862('0x41')]=_[_0x3862('0x42')](_0x3e8355['query']);_0xeb7298['filters']=_['intersection'](_0xeb7298[_0x3862('0x46')],_0xeb7298[_0x3862('0x41')]);_0x3ae3c4['attributes']=_[_0x3862('0x44')](_0xeb7298[_0x3862('0x46')],qs[_0x3862('0x47')](_0x3e8355['query'][_0x3862('0x47')]));_0x3ae3c4[_0x3862('0x45')]=_0x3ae3c4[_0x3862('0x45')][_0x3862('0x48')]?_0x3ae3c4[_0x3862('0x45')]:_0xeb7298['model'];if(!_0x3e8355[_0x3862('0x41')][_0x3862('0x63')]('nolimit')){_0x3ae3c4[_0x3862('0x2b')]=qs[_0x3862('0x2b')](_0x3e8355[_0x3862('0x41')]['limit']);_0x3ae3c4[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x3e8355[_0x3862('0x41')][_0x3862('0x2a')]);}_0x3ae3c4[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x3e8355[_0x3862('0x41')][_0x3862('0x4b')]);_0x3ae3c4[_0x3862('0x4c')]=qs[_0x3862('0x43')](_[_0x3862('0x64')](_0x3e8355[_0x3862('0x41')],_0xeb7298[_0x3862('0x43')]));_0x3ae3c4[_0x3862('0x4c')][_0x3862('0x65')]=_0x128e73['id'];if(_0x3e8355['query'][_0x3862('0x4d')]){_0x3ae3c4['where']=_[_0x3862('0x4e')](_0x3ae3c4[_0x3862('0x4c')],{'$or':_[_0x3862('0x40')](_0x3ae3c4[_0x3862('0x45')],function(_0x55b831){var _0x2cb43e={};_0x2cb43e[_0x55b831]={'$like':'%'+_0x3e8355['query'][_0x3862('0x4d')]+'%'};return _0x2cb43e;})});}_0x3ae3c4=_[_0x3862('0x4e')]({},_0x3ae3c4,_0x3e8355[_0x3862('0x55')]);return db[_0x3862('0x62')][_0x3862('0x2d')]({'where':_0x3ae3c4[_0x3862('0x4c')]})[_0x3862('0x32')](function(_0x232096){_0x517db0['count']=_0x232096;if(_0x3e8355['query'][_0x3862('0x50')]){_0x3ae3c4[_0x3862('0x66')]=[{'all':!![]}];}return db[_0x3862('0x62')]['findAll'](_0x3ae3c4);})[_0x3862('0x32')](function(_0x38af99){_0x517db0[_0x3862('0x52')]=_0x38af99;return _0x517db0;});}})[_0x3862('0x32')](respondWithFilteredResult(_0x3d63c3,_0x3ae3c4))['catch'](handleError(_0x3d63c3,null));};exports[_0x3862('0x67')]=function(_0xceb6da,_0x1944bc,_0x2246ee){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0xceb6da['params']['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x1944bc,null))[_0x3862('0x32')](function(_0x555e39){if(_0x555e39){return _0x555e39[_0x3862('0x67')](_0xceb6da[_0x3862('0x41')][_0x3862('0x68')]);}})[_0x3862('0x32')](respondWithStatusCode(_0x1944bc,null))['catch'](handleError(_0x1944bc,null));};exports[_0x3862('0x69')]=function(_0x3b5dad,_0x3d3167,_0x16db1d){if(_0x3b5dad[_0x3862('0x5e')]['id']){delete _0x3b5dad[_0x3862('0x5e')]['id'];}return db['OpenchannelAccount'][_0x3862('0x56')]({'where':{'id':_0x3b5dad[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x3d3167,null))[_0x3862('0x32')](function(_0x5d06d1){if(_0x5d06d1){_0x3b5dad[_0x3862('0x5e')]['OpenchannelAccountId']=_0x5d06d1['id'];return db[_0x3862('0x6a')][_0x3862('0x57')](_0x3b5dad[_0x3862('0x5e')]);}})[_0x3862('0x32')](respondWithResult(_0x3d3167,null))['catch'](handleError(_0x3d3167,null));};exports[_0x3862('0x6b')]=function(_0x3c0f32,_0x35ed99,_0xbfa3e3){var _0x2f8eef={'raw':![],'where':{}};var _0x573ae6={};var _0x228f0a={'count':0x0,'rows':[]};return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x3c0f32[_0x3862('0x54')]['id']}})['then'](handleEntityNotFound(_0x35ed99,null))[_0x3862('0x32')](function(_0x5a0727){if(_0x5a0727){_0x573ae6['model']=_[_0x3862('0x42')](db[_0x3862('0x6a')]['rawAttributes']);_0x573ae6[_0x3862('0x41')]=_[_0x3862('0x42')](_0x3c0f32[_0x3862('0x41')]);_0x573ae6[_0x3862('0x43')]=_[_0x3862('0x44')](_0x573ae6[_0x3862('0x46')],_0x573ae6[_0x3862('0x41')]);_0x2f8eef['attributes']=_[_0x3862('0x44')](_0x573ae6[_0x3862('0x46')],qs[_0x3862('0x47')](_0x3c0f32[_0x3862('0x41')][_0x3862('0x47')]));_0x2f8eef[_0x3862('0x45')]=_0x2f8eef[_0x3862('0x45')][_0x3862('0x48')]?_0x2f8eef['attributes']:_0x573ae6[_0x3862('0x46')];if(!_0x3c0f32['query'][_0x3862('0x63')](_0x3862('0x49'))){_0x2f8eef[_0x3862('0x2b')]=qs['limit'](_0x3c0f32[_0x3862('0x41')][_0x3862('0x2b')]);_0x2f8eef[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x3c0f32[_0x3862('0x41')][_0x3862('0x2a')]);}_0x2f8eef[_0x3862('0x4a')]=qs['sort'](_0x3c0f32[_0x3862('0x41')][_0x3862('0x4b')]);_0x2f8eef['where']=qs['filters'](_[_0x3862('0x64')](_0x3c0f32[_0x3862('0x41')],_0x573ae6[_0x3862('0x43')]));_0x2f8eef[_0x3862('0x4c')][_0x3862('0x65')]=_0x5a0727['id'];if(_0x3c0f32[_0x3862('0x41')][_0x3862('0x4d')]){_0x2f8eef[_0x3862('0x4c')]=_[_0x3862('0x4e')](_0x2f8eef[_0x3862('0x4c')],{'$or':_[_0x3862('0x40')](_0x2f8eef[_0x3862('0x45')],function(_0x2be25e){var _0x4e1465={};_0x4e1465[_0x2be25e]={'$like':'%'+_0x3c0f32[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0x4e1465;})});}_0x2f8eef=_[_0x3862('0x4e')]({},_0x2f8eef,_0x3c0f32[_0x3862('0x55')]);return db[_0x3862('0x6a')][_0x3862('0x2d')]({'where':_0x2f8eef[_0x3862('0x4c')]})['then'](function(_0x25a603){_0x228f0a['count']=_0x25a603;if(_0x3c0f32[_0x3862('0x41')][_0x3862('0x50')]){_0x2f8eef[_0x3862('0x66')]=[{'all':!![]}];}return db[_0x3862('0x6a')][_0x3862('0x51')](_0x2f8eef);})[_0x3862('0x32')](function(_0x5bbfc5){_0x228f0a[_0x3862('0x52')]=_0x5bbfc5;return _0x228f0a;});}})[_0x3862('0x32')](respondWithFilteredResult(_0x35ed99,_0x2f8eef))[_0x3862('0x28')](handleError(_0x35ed99,null));};exports[_0x3862('0x6c')]=function(_0x3fc05f,_0x44037d,_0xc90a43){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x3fc05f[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x44037d,null))[_0x3862('0x32')](function(_0x34bb55){if(_0x34bb55){return _0x34bb55[_0x3862('0x6c')](_0x3fc05f[_0x3862('0x41')][_0x3862('0x68')]);}})['then'](respondWithStatusCode(_0x44037d,null))[_0x3862('0x28')](handleError(_0x44037d,null));};exports[_0x3862('0x6d')]=function(_0x406e49,_0x405581,_0x11dac8){var _0x3f5791={'body':_0x406e49[_0x3862('0x5e')],'channel':_0x3862('0x6e')};var _0xf9079b=[];var _0x4a1bd9=[];var _0x1ed21e={};var _0x2dca4f=![];return db['CmContact'][_0x3862('0x5f')]()[_0x3862('0x32')](function(_0x4fb8d4){if(!_0x4fb8d4){throw new db[(_0x3862('0x6f'))][(_0x3862('0x70'))](_0x3862('0x71'));}_0xf9079b=_[_0x3862('0x72')](_[_0x3862('0x42')](_0x4fb8d4),[_0x3862('0x73'),_0x3862('0x74')]);_0x4a1bd9=_[_0x3862('0x72')](_[_0x3862('0x42')](_0x4fb8d4),[_0x3862('0x73'),_0x3862('0x74'),_0x3862('0x75'),_0x3862('0x76')]);if(_0x406e49[_0x3862('0x5e')]['id']){delete _0x406e49[_0x3862('0x5e')]['id'];}if(_[_0x3862('0x77')](_0x406e49[_0x3862('0x5e')][_0x3862('0x78')])){throw new db[(_0x3862('0x6f'))][(_0x3862('0x70'))]('from\x20is\x20mandatory');}if(_[_0x3862('0x77')](_0x406e49[_0x3862('0x5e')][_0x3862('0x5e')])||_0x406e49['body']['body']===''){throw new db['Sequelize'][(_0x3862('0x70'))](_0x3862('0x79'));}if(_[_0x3862('0x77')](_0x406e49[_0x3862('0x5e')]['mapKey'])){throw new db[(_0x3862('0x6f'))][(_0x3862('0x70'))](_0x3862('0x7a')+_0x4a1bd9);}if(!_['includes'](_0x4a1bd9,_0x406e49[_0x3862('0x5e')][_0x3862('0x7b')])){throw new db[(_0x3862('0x6f'))]['ValidationError'](_0x3862('0x7c')+_0x4a1bd9);}_0x1ed21e[_0x406e49[_0x3862('0x5e')][_0x3862('0x7b')]]=_0x406e49[_0x3862('0x5e')][_0x3862('0x78')];})[_0x3862('0x32')](function(){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x406e49[_0x3862('0x54')]['id']},'include':[{'model':db[_0x3862('0x7d')],'as':_0x3862('0x7e'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1ed21e,'limit':0x1,'order':[[_0x3862('0x74'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x3862('0x7f')}]});})[_0x3862('0x32')](handleEntityNotFound(_0x405581,null))['then'](function(_0x55f63b){if(_0x55f63b&&_0x55f63b['List']){_0x3f5791['account']=_0x55f63b;_0x3f5791['applications']=_0x55f63b[_0x3862('0x7f')];_0x3f5791[_0x3862('0x80')]=_0x55f63b['List'];_0x3f5791[_0x3862('0x81')]=_[_0x3862('0x82')](_0x3f5791[_0x3862('0x81')],[_0x3862('0x83')],['asc']);if(_0x3f5791[_0x3862('0x84')][_0x3862('0x7f')]){delete _0x3f5791['account'][_0x3862('0x7f')];}if(_0x3f5791[_0x3862('0x84')]['List']&&_0x3f5791[_0x3862('0x84')][_0x3862('0x7e')][_0x3862('0x85')][_0x3862('0x48')]){return _0x3f5791[_0x3862('0x84')][_0x3862('0x7e')][_0x3862('0x85')][0x0];}var _0x4537a7=_[_0x3862('0x86')](_0x406e49['body'],{'firstName':_0x406e49[_0x3862('0x5e')][_0x3862('0x78')],'ListId':_0x55f63b[_0x3862('0x76')]});_0x4537a7[_0x406e49[_0x3862('0x5e')][_0x3862('0x7b')]]=_0x406e49[_0x3862('0x5e')][_0x3862('0x78')];return db[_0x3862('0x87')]['create'](_0x4537a7,{'fields':_0xf9079b,'raw':!![]});}})[_0x3862('0x32')](handleEntityNotFound(_0x405581,null))[_0x3862('0x32')](function(_0x41880c){_0x3f5791[_0x3862('0x88')]=_0x41880c;if(_0x41880c){var _0x3318ac={'ContactId':_0x41880c['id'],'OpenchannelAccountId':_0x406e49[_0x3862('0x54')]['id'],'from':(_0x41880c['firstName']||'')+'\x20'+(_0x41880c[_0x3862('0x89')]||'')};var _0xd8c3cf={'OpenchannelAccountId':_0x406e49[_0x3862('0x54')]['id'],'closed':![]};if(_0x406e49[_0x3862('0x5e')]['threadId']){_0xd8c3cf['threadId']=_0x406e49[_0x3862('0x5e')][_0x3862('0x8a')];return db['OpenchannelInteraction']['find']({'where':_0xd8c3cf})[_0x3862('0x32')](function(_0x18f136){if(_0x18f136){return[_0x18f136,![]];}_0x3318ac[_0x3862('0x8a')]=_0x406e49[_0x3862('0x5e')][_0x3862('0x8a')];_0x3318ac[_0x3862('0x8b')]=_0x406e49['body'][_0x3862('0x8b')];return db[_0x3862('0x8c')][_0x3862('0x57')](_0x3318ac)[_0x3862('0x32')](function(_0x5473ac){return[_0x5473ac,!![]];});});}else{_0xd8c3cf[_0x3862('0x8a')]=null;}_0xd8c3cf[_0x3862('0x8d')]=_0x41880c['id'];return db[_0x3862('0x8c')][_0x3862('0x56')]({'where':_0xd8c3cf})['then'](function(_0x5d2b0f){if(_0x5d2b0f){return[_0x5d2b0f,![]];}return db[_0x3862('0x8c')]['create'](_0x3318ac)[_0x3862('0x32')](function(_0x1555d4){return[_0x1555d4,!![]];});});}})[_0x3862('0x8e')](function(_0xe55e42,_0x24b528){if(_0xe55e42){_0x2dca4f=_0x24b528;if(!_0x24b528){var _0x58bd63={'from':(_0x3f5791['contact'][_0x3862('0x8f')]||'')+'\x20'+(_0x3f5791['contact'][_0x3862('0x89')]||'')};if(_0x406e49[_0x3862('0x5e')][_0x3862('0x8a')]&&_0x406e49[_0x3862('0x5e')]['messageId']&&_0x406e49['body'][_0x3862('0x8a')]!=_0x406e49[_0x3862('0x5e')][_0x3862('0x90')]){_0x58bd63['threadId']=_0x406e49['body'][_0x3862('0x90')];}return _0xe55e42['update'](_0x58bd63);}else{return _0xe55e42;}}})['then'](function(_0x24a7e5){_0x3f5791[_0x3862('0x91')]=_0x24a7e5[_0x3862('0x34')]({'plain':!![]});_0x3f5791['interaction'][_0x3862('0x92')]=_0x2dca4f;if(_0x3f5791['interaction'][_0x3862('0x92')]){if(_0x3f5791[_0x3862('0x84')][_0x3862('0x93')]){_0x3f5791['applications'][_0x3862('0x94')]({'id':0x0,'priority':_0x3f5791[_0x3862('0x81')][_0x3862('0x48')]+0x1,'app':_0x3862('0x95'),'appdata':_0x3862('0x96'),'interval':'*,*,*,*'});}}return db[_0x3862('0x97')]['create']({'body':_0x406e49['body']['body'],'OpenchannelAccountId':_0x406e49['params']['id'],'OpenchannelInteractionId':_0x24a7e5['id'],'direction':'in','ContactId':_0x3f5791[_0x3862('0x88')]['id'],'AttachmentId':_0x406e49[_0x3862('0x5e')]['AttachmentId']});})[_0x3862('0x32')](function(_0x5e0e87){_0x3f5791[_0x3862('0x26')]=_0x5e0e87;if(_0x3f5791[_0x3862('0x91')][_0x3862('0x98')]){return db[_0x3862('0x99')][_0x3862('0x56')]({'attributes':['id',_0x3862('0x38')],'where':{'id':_0x3f5791[_0x3862('0x91')][_0x3862('0x98')]}})[_0x3862('0x32')](function(_0x5f579c){if(_0x5f579c){_0x3f5791['applications'][_0x3862('0x9a')]({'id':0x0,'priority':0x0,'app':_0x3862('0x9b'),'appdata':_0x5f579c[_0x3862('0x38')]+','+(_0x3f5791[_0x3862('0x84')][_0x3862('0x9c')]||0xa),'interval':_0x3862('0x9d')});_0x3f5791[_0x3862('0x9e')]=![];}return respondWithRpcPromise(_0x3862('0x9f'),_0x3862('0xa0'),_0x3f5791);});}return respondWithRpcPromise(_0x3862('0x9f'),_0x3862('0xa0'),_0x3f5791);})[_0x3862('0x32')](function(_0x51ee4d){respondWithRpcPromise(_0x3862('0xa1'),_0x3862('0xa1'),{'event':_0x3862('0x6d'),'message':_0x51ee4d},client9002);return _0x51ee4d;})['then'](respondWithResult(_0x405581,null))['catch'](handleError(_0x405581,null));};exports[_0x3862('0xa2')]=function(_0x4d3428,_0x708c04,_0x36e3b9){return db[_0x3862('0x3b')]['findOne']({'where':{'id':_0x4d3428['params']['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x708c04,null))[_0x3862('0x32')](function(_0x5b4cd2){if(_0x5b4cd2){return db['sequelize'][_0x3862('0xa3')](function(_0x4eb691){return db['OpenchannelApplication'][_0x3862('0x33')]({'where':{'OpenchannelAccountId':_0x4d3428[_0x3862('0x54')]['id']},'transaction':_0x4eb691})[_0x3862('0x32')](function(_0x539b2d){var _0x4ad755=_[_0x3862('0x40')](_0x4d3428[_0x3862('0x5e')],function(_0x322121){_0x322121[_0x3862('0x65')]=_0x4d3428['params']['id'];return _0x322121;});return db[_0x3862('0xa4')][_0x3862('0xa5')](_0x4ad755,{'transaction':_0x4eb691});});})[_0x3862('0x32')](function(){return db['OpenchannelApplication'][_0x3862('0xa6')]({'where':{'OpenchannelAccountId':_0x4d3428[_0x3862('0x54')]['id']},'order':_0x3862('0x83')});});}})[_0x3862('0x32')](respondWithResult(_0x708c04,null))[_0x3862('0x28')](handleError(_0x708c04,null));};exports['getApplications']=function(_0x2521bf,_0x5c4ce2,_0x4a4007){var _0x55b43f={};var _0x352e06={};var _0x12691f;var _0x41e14c;return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x2521bf[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x5c4ce2,null))['then'](function(_0x2d00ad){if(_0x2d00ad){_0x12691f=_0x2d00ad;_0x352e06['model']=_[_0x3862('0x42')](db[_0x3862('0xa4')]['rawAttributes']);_0x352e06[_0x3862('0x41')]=_[_0x3862('0x42')](_0x2521bf[_0x3862('0x41')]);_0x352e06[_0x3862('0x43')]=_[_0x3862('0x44')](_0x352e06[_0x3862('0x46')],_0x352e06[_0x3862('0x41')]);_0x55b43f[_0x3862('0x45')]=_['intersection'](_0x352e06[_0x3862('0x46')],qs[_0x3862('0x47')](_0x2521bf[_0x3862('0x41')][_0x3862('0x47')]));_0x55b43f['attributes']=_0x55b43f[_0x3862('0x45')][_0x3862('0x48')]?_0x55b43f['attributes']:_0x352e06[_0x3862('0x46')];_0x55b43f[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x2521bf[_0x3862('0x41')]['sort']);_0x55b43f[_0x3862('0x4c')]=qs[_0x3862('0x43')](_[_0x3862('0x64')](_0x2521bf[_0x3862('0x41')],_0x352e06['filters']));if(_0x2521bf[_0x3862('0x41')][_0x3862('0x4d')]){_0x55b43f['where']=_['merge'](_0x55b43f['where'],{'$or':_[_0x3862('0x40')](_0x55b43f[_0x3862('0x45')],function(_0x13d8b5){var _0xf0ef9e={};_0xf0ef9e[_0x13d8b5]={'$like':'%'+_0x2521bf[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0xf0ef9e;})});}_0x55b43f=_[_0x3862('0x4e')]({},_0x55b43f,_0x2521bf[_0x3862('0x55')]);return _0x12691f['getApplications'](_0x55b43f);}})[_0x3862('0x32')](function(_0x2b2386){if(_0x2b2386){_0x41e14c=_0x2b2386['length'];if(!_0x2521bf[_0x3862('0x41')][_0x3862('0x63')](_0x3862('0x49'))){_0x55b43f[_0x3862('0x2b')]=qs[_0x3862('0x2b')](_0x2521bf[_0x3862('0x41')][_0x3862('0x2b')]);_0x55b43f[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x2521bf[_0x3862('0x41')]['offset']);}return _0x12691f[_0x3862('0xa7')](_0x55b43f);}})[_0x3862('0x32')](function(_0x525da2){if(_0x525da2){return _0x525da2?{'count':_0x41e14c,'rows':_0x525da2}:null;}})['then'](respondWithResult(_0x5c4ce2,null))[_0x3862('0x28')](handleError(_0x5c4ce2,null));};exports['getInteractions']=function(_0x3bd308,_0x3ed6f4,_0x2d234d){var _0x319c7a={'raw':![],'where':{}};var _0x485d11={};var _0x4ceb41={'count':0x0,'rows':[]};return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x3bd308[_0x3862('0x54')]['id']}})['then'](handleEntityNotFound(_0x3ed6f4,null))[_0x3862('0x32')](function(_0x1b494d){if(_0x1b494d){_0x485d11['model']=_[_0x3862('0x42')](db['OpenchannelInteraction'][_0x3862('0x3c')]);_0x485d11[_0x3862('0x41')]=_['keys'](_0x3bd308[_0x3862('0x41')]);_0x485d11['filters']=_[_0x3862('0x44')](_0x485d11[_0x3862('0x46')],_0x485d11[_0x3862('0x41')]);_0x319c7a[_0x3862('0x45')]=_[_0x3862('0x44')](_0x485d11[_0x3862('0x46')],qs[_0x3862('0x47')](_0x3bd308[_0x3862('0x41')]['fields']));_0x319c7a[_0x3862('0x45')]=_0x319c7a[_0x3862('0x45')][_0x3862('0x48')]?_0x319c7a[_0x3862('0x45')]:_0x485d11[_0x3862('0x46')];if(!_0x3bd308[_0x3862('0x41')][_0x3862('0x63')]('nolimit')){_0x319c7a[_0x3862('0x2b')]=qs[_0x3862('0x2b')](_0x3bd308[_0x3862('0x41')][_0x3862('0x2b')]);_0x319c7a[_0x3862('0x2a')]=qs['offset'](_0x3bd308[_0x3862('0x41')][_0x3862('0x2a')]);}_0x319c7a[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x3bd308['query']['sort']);_0x319c7a[_0x3862('0x4c')]=qs['filters'](_[_0x3862('0x64')](_0x3bd308[_0x3862('0x41')],_0x485d11[_0x3862('0x43')]));_0x319c7a[_0x3862('0x4c')][_0x3862('0x65')]=_0x1b494d['id'];if(_0x3bd308[_0x3862('0x41')]['filter']){_0x319c7a[_0x3862('0x4c')]=_['merge'](_0x319c7a[_0x3862('0x4c')],{'$or':_['map'](_0x319c7a[_0x3862('0x45')],function(_0x66ea26){var _0x15ba04={};_0x15ba04[_0x66ea26]={'$like':'%'+_0x3bd308[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0x15ba04;})});}_0x319c7a=_[_0x3862('0x4e')]({},_0x319c7a,_0x3bd308[_0x3862('0x55')]);return db[_0x3862('0x8c')]['count']({'where':_0x319c7a[_0x3862('0x4c')]})[_0x3862('0x32')](function(_0x2b2260){_0x4ceb41[_0x3862('0x2d')]=_0x2b2260;if(_0x3bd308[_0x3862('0x41')][_0x3862('0x50')]){_0x319c7a[_0x3862('0x66')]=[{'model':db['CmContact'],'as':_0x3862('0xa8'),'required':![]},{'model':db[_0x3862('0x99')],'as':'Owner','attributes':['name',_0x3862('0xa9'),_0x3862('0xaa')],'required':![]},{'model':db[_0x3862('0xab')],'as':_0x3862('0xac'),'attributes':['id',_0x3862('0x38'),_0x3862('0xad')],'where':_0x3bd308[_0x3862('0x41')][_0x3862('0xae')]?{'id':_0x3bd308['query'][_0x3862('0xae')]}:undefined,'required':_0x3bd308[_0x3862('0x41')][_0x3862('0xae')]?!![]:![]}];}return db[_0x3862('0x8c')][_0x3862('0x51')](_0x319c7a);})[_0x3862('0x32')](function(_0xdbd944){_0x4ceb41[_0x3862('0x52')]=_0xdbd944;return _0x4ceb41;});}})['then'](respondWithFilteredResult(_0x3ed6f4,_0x319c7a))[_0x3862('0x28')](handleError(_0x3ed6f4,null));};exports['addAgents']=function(_0x1dfefc,_0x200510,_0x117d8a){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x1dfefc[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x200510,null))[_0x3862('0x32')](function(_0x45471c){if(_0x45471c){return _0x45471c[_0x3862('0xaf')](_0x1dfefc[_0x3862('0x5e')]['ids'],_[_0x3862('0xb0')](_0x1dfefc[_0x3862('0x5e')],[_0x3862('0x68'),'id'])||{})[_0x3862('0x8e')](function(_0x59ca78){for(var _0x449db3=0x0;_0x449db3<_0x1dfefc['body'][_0x3862('0x68')][_0x3862('0x48')];_0x449db3+=0x1){socket[_0x3862('0xb1')](_0x3862('0xb2'),{'UserId':_0x1dfefc[_0x3862('0x5e')]['ids'][_0x449db3],'OpenchannelAccountId':_0x1dfefc[_0x3862('0x54')]['id']});}return _0x59ca78;});}})[_0x3862('0x32')](respondWithResult(_0x200510,null))['catch'](handleError(_0x200510,null));};exports['removeAgents']=function(_0x5e6904,_0xb9c75e,_0x4bd0a5){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x5e6904[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0xb9c75e,null))[_0x3862('0x32')](function(_0x456c26){if(_0x456c26){return _0x456c26[_0x3862('0xb3')](_0x5e6904[_0x3862('0x41')]['ids'])[_0x3862('0x32')](function(){if(_[_0x3862('0xb4')](_0x5e6904[_0x3862('0x41')][_0x3862('0x68')])){for(var _0x2f408a=0x0;_0x2f408a<_0x5e6904['query'][_0x3862('0x68')][_0x3862('0x48')];_0x2f408a+=0x1){socket[_0x3862('0xb1')](_0x3862('0xb5'),{'UserId':Number(_0x5e6904[_0x3862('0x41')][_0x3862('0x68')][_0x2f408a]),'OpenchannelAccountId':Number(_0x5e6904[_0x3862('0x54')]['id'])});}}else{socket[_0x3862('0xb1')](_0x3862('0xb5'),{'UserId':Number(_0x5e6904['query'][_0x3862('0x68')]),'OpenchannelAccountId':Number(_0x5e6904[_0x3862('0x54')]['id'])});}});}})[_0x3862('0x32')](respondWithStatusCode(_0xb9c75e,null))['catch'](handleError(_0xb9c75e,null));};exports[_0x3862('0xb6')]=function(_0x1f6409,_0x362911,_0x17ae07){var _0x1d44a5={};var _0x2f6676={};var _0x4a1325;var _0x1a06b1;return db[_0x3862('0x3b')]['findOne']({'where':{'id':_0x1f6409[_0x3862('0x54')]['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x362911,null))[_0x3862('0x32')](function(_0x18f55e){if(_0x18f55e){_0x4a1325=_0x18f55e;_0x2f6676['model']=_[_0x3862('0x42')](db[_0x3862('0x99')][_0x3862('0x3c')]);_0x2f6676['query']=_['keys'](_0x1f6409[_0x3862('0x41')]);_0x2f6676[_0x3862('0x43')]=_[_0x3862('0x44')](_0x2f6676[_0x3862('0x46')],_0x2f6676[_0x3862('0x41')]);_0x1d44a5[_0x3862('0x45')]=_[_0x3862('0x44')](_0x2f6676[_0x3862('0x46')],qs[_0x3862('0x47')](_0x1f6409[_0x3862('0x41')]['fields']));_0x1d44a5[_0x3862('0x45')]=_0x1d44a5[_0x3862('0x45')]['length']?_0x1d44a5[_0x3862('0x45')]:_0x2f6676['model'];_0x1d44a5[_0x3862('0x4a')]=qs[_0x3862('0x4b')](_0x1f6409[_0x3862('0x41')][_0x3862('0x4b')]);_0x1d44a5[_0x3862('0x4c')]=qs[_0x3862('0x43')](_[_0x3862('0x64')](_0x1f6409[_0x3862('0x41')],_0x2f6676[_0x3862('0x43')]));if(_0x1f6409[_0x3862('0x41')][_0x3862('0x4d')]){_0x1d44a5[_0x3862('0x4c')]=_['merge'](_0x1d44a5['where'],{'$or':_['map'](_0x1d44a5['attributes'],function(_0x550d82){var _0x4665fd={};_0x4665fd[_0x550d82]={'$like':'%'+_0x1f6409[_0x3862('0x41')][_0x3862('0x4d')]+'%'};return _0x4665fd;})});}_0x1d44a5=_[_0x3862('0x4e')]({},_0x1d44a5,_0x1f6409[_0x3862('0x55')]);return _0x4a1325[_0x3862('0xb6')](_0x1d44a5);}})[_0x3862('0x32')](function(_0x522800){if(_0x522800){_0x1a06b1=_0x522800[_0x3862('0x48')];if(!_0x1f6409[_0x3862('0x41')]['hasOwnProperty'](_0x3862('0x49'))){_0x1d44a5[_0x3862('0x2b')]=qs['limit'](_0x1f6409['query'][_0x3862('0x2b')]);_0x1d44a5[_0x3862('0x2a')]=qs[_0x3862('0x2a')](_0x1f6409[_0x3862('0x41')][_0x3862('0x2a')]);}return _0x4a1325[_0x3862('0xb6')](_0x1d44a5);}})[_0x3862('0x32')](function(_0x28d6af){if(_0x28d6af){return _0x28d6af?{'count':_0x1a06b1,'rows':_0x28d6af}:null;}})['then'](respondWithResult(_0x362911,null))[_0x3862('0x28')](handleError(_0x362911,null));};exports[_0x3862('0xb7')]=function(_0x23e4e2,_0x386b45,_0x3fa0bc){var _0x4d9e80,_0xd1e796,_0x1360cf;if(_['isNil'](_0x23e4e2[_0x3862('0x5e')][_0x3862('0x5e')])||_0x23e4e2[_0x3862('0x5e')]['body']===''){throw new db[(_0x3862('0x6f'))]['ValidationError'](_0x3862('0x79'));}if(_['isNil'](_0x23e4e2[_0x3862('0x5e')]['to'])){}_0x4d9e80=_0x23e4e2['body']['to'];return db[_0x3862('0x3b')][_0x3862('0x61')]({'where':{'id':_0x23e4e2['params']['id']}})[_0x3862('0x32')](handleEntityNotFound(_0x386b45,null))['then'](function(_0x4ad185){if(_0x4ad185){return db[_0x3862('0x3b')][_0x3862('0x56')]({'where':{'id':_0x4ad185['id']},'include':[{'model':db[_0x3862('0x7d')],'as':_0x3862('0x7e'),'include':[{'model':db[_0x3862('0x87')],'as':_0x3862('0x85'),'where':{[_0x4ad185[_0x3862('0x7b')]]:_0x4d9e80},'limit':0x1,'order':[['updatedAt',_0x3862('0xb8')]]}]}]})[_0x3862('0x32')](handleEntityNotFound(_0x386b45,null))['then'](function(_0x17a513){if(_0x17a513&&_0x17a513[_0x3862('0x7e')]){_0xd1e796=_0x17a513[_0x3862('0x34')]({'plain':!![]});if(_0xd1e796['List']&&_0xd1e796[_0x3862('0x7e')]['Contacts'][_0x3862('0x48')]){return _0xd1e796['List'][_0x3862('0x85')][0x0];}return db[_0x3862('0x87')][_0x3862('0x57')](_[_0x3862('0x86')](_0x23e4e2['body'],{'firstName':_0x4d9e80,[_0x17a513[_0x3862('0x7b')]]:_0x4d9e80,'phone':_0x4d9e80,'ListId':_0xd1e796[_0x3862('0x76')]}));}})[_0x3862('0x32')](handleEntityNotFound(_0x386b45,null))[_0x3862('0x32')](function(_0x354991){if(_0x354991){_0x1360cf=_0x354991;return db[_0x3862('0x8c')][_0x3862('0x56')]({'where':{'ContactId':_0x1360cf['id'],'closed':![],'OpenchannelAccountId':_0xd1e796['id']}})['then'](function(_0x4e856a){if(_0x4e856a){return[_0x4e856a,![]];}return db['OpenchannelInteraction'][_0x3862('0x57')]({'UserId':_0x23e4e2[_0x3862('0x58')]['id'],'ContactId':_0x1360cf['id'],'OpenchannelAccountId':_0xd1e796['id'],'lastMsgDirection':_0x3862('0xb9'),'Messages':[_[_0x3862('0x4e')](_0x23e4e2[_0x3862('0x5e')],{'read':![],'body':_0x23e4e2[_0x3862('0x5e')]['body'],'OpenchannelAccountId':_0xd1e796['id'],'UserId':_0x23e4e2[_0x3862('0x58')]['id'],'ContactId':_0x1360cf['id']})]},{'include':[{'model':db[_0x3862('0x97')],'as':_0x3862('0xba')}]})[_0x3862('0x32')](function(_0x28cc2c){return[_0x28cc2c,!![]];});});}})[_0x3862('0x8e')](function(_0x5d2cba,_0x38ef82){if(_0x38ef82){return _0x5d2cba;}return db[_0x3862('0x97')][_0x3862('0x57')](_[_0x3862('0x4e')](_0x23e4e2[_0x3862('0x5e')],{'read':![],'body':_0x23e4e2[_0x3862('0x5e')]['body'],'OpenchannelAccountId':_0xd1e796['id'],'OpenchannelInteractionId':_0x5d2cba['id'],'UserId':_0x23e4e2[_0x3862('0x58')]['id'],'ContactId':_0x1360cf['id']}))[_0x3862('0x32')](function(_0xf4d59f){_0x5d2cba[_0x3862('0xbb')]['Messages']=[];_0x5d2cba['dataValues'][_0x3862('0xba')][_0x3862('0x94')](_0xf4d59f[_0x3862('0xbb')]);return _0x5d2cba;});});}})[_0x3862('0x32')](respondWithResult(_0x386b45,null))['catch'](handleError(_0x386b45,null));};
\ No newline at end of file
index 9509a87..6ad92f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b02=['exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','remove','emit','hook'];(function(_0x1ba823,_0x2819db){var _0xf2952=function(_0x545ce2){while(--_0x545ce2){_0x1ba823['push'](_0x1ba823['shift']());}};_0xf2952(++_0x2819db);}(_0x5b02,0xe9));var _0x25b0=function(_0x59cadc,_0x28bea4){_0x59cadc=_0x59cadc-0x0;var _0x13b1a5=_0x5b02[_0x59cadc];return _0x13b1a5;};'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
+var _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0x22f1cc,_0x111731){var _0x24b0b4=function(_0x9f1fce){while(--_0x9f1fce){_0x22f1cc['push'](_0x22f1cc['shift']());}};_0x24b0b4(++_0x111731);}(_0xa74f,0x9a));var _0xfa74=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0xa74f[_0x59710f];return _0xaae66a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents;
\ No newline at end of file
index c54b8b1..c8f9113 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(_0x748b76,_0x485207){var _0x34e68a=function(_0x48deec){while(--_0x48deec){_0x748b76['push'](_0x748b76['shift']());}};_0x34e68a(++_0x485207);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x4f86ed,_0x35e8a0){var _0x57d258=function(_0x5db57c){while(--_0x5db57c){_0x4f86ed['push'](_0x4f86ed['shift']());}};_0x57d258(++_0x35e8a0);}(_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 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 3d771a8..0deeac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4058=['request','then','debug','code','error','message','OpenchannelAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket'];(function(_0x2670c2,_0x2d9114){var _0x5aa541=function(_0x4bfb66){while(--_0x4bfb66){_0x2670c2['push'](_0x2670c2['shift']());}};_0x5aa541(++_0x2d9114);}(_0x4058,0x129));var _0x8405=function(_0x3433a0,_0x707c8c){_0x3433a0=_0x3433a0-0x0;var _0x428cb7=_0x4058[_0x3433a0];return _0x428cb7;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232a});config[_0x8405('0xb')]=_[_0x8405('0xc')](config[_0x8405('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8405('0xd'))(new Redis(config[_0x8405('0xb')]));require(_0x8405('0xe'))['register'](socket);function respondWithRpcPromise(_0x30705f,_0x5e132b,_0x6979fd){return new BPromise(function(_0xb442,_0x50344e){return client[_0x8405('0xf')](_0x30705f,_0x6979fd)[_0x8405('0x10')](function(_0x5b94d5){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5e132b,'request\x20sent');logger[_0x8405('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5e132b,'request\x20sent',JSON['stringify'](_0x5b94d5));if(_0x5b94d5['error']){if(_0x5b94d5['error'][_0x8405('0x12')]===0x1f4){logger[_0x8405('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0x50344e(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}logger['error'](_0x8405('0x15'),_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0xb442(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}else{logger[_0x8405('0x16')](_0x8405('0x15'),_0x5e132b,_0x8405('0x17'));_0xb442(_0x5b94d5[_0x8405('0x18')][_0x8405('0x14')]);}})[_0x8405('0x19')](function(_0x21376d){logger[_0x8405('0x13')](_0x8405('0x15'),_0x5e132b,_0x21376d);_0x50344e(_0x21376d);});});}
\ No newline at end of file
+var _0x9b87=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x9b87,0x8e));var _0x79b8=function(_0x4dbef6,_0x2cbe40){_0x4dbef6=_0x4dbef6-0x0;var _0xcd4fa0=_0x9b87[_0x4dbef6];return _0xcd4fa0;};'use strict';var _=require(_0x79b8('0x0'));var util=require(_0x79b8('0x1'));var moment=require(_0x79b8('0x2'));var BPromise=require(_0x79b8('0x3'));var rs=require(_0x79b8('0x4'));var fs=require('fs');var Redis=require(_0x79b8('0x5'));var db=require(_0x79b8('0x6'))['db'];var utils=require(_0x79b8('0x7'));var logger=require(_0x79b8('0x8'))(_0x79b8('0x9'));var config=require(_0x79b8('0xa'));var jayson=require(_0x79b8('0xb'));var client=jayson[_0x79b8('0xc')][_0x79b8('0xd')]({'port':0x232a});config[_0x79b8('0xe')]=_[_0x79b8('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79b8('0x10'))[_0x79b8('0x11')](socket);function respondWithRpcPromise(_0x2f3453,_0x4bc41f,_0x28434){return new BPromise(function(_0x2fdb05,_0xdf585a){return client['request'](_0x2f3453,_0x28434)['then'](function(_0x46c0ce){logger[_0x79b8('0x12')](_0x79b8('0x13'),_0x4bc41f,_0x79b8('0x14'));logger[_0x79b8('0x15')](_0x79b8('0x16'),_0x4bc41f,_0x79b8('0x14'),JSON[_0x79b8('0x17')](_0x46c0ce));if(_0x46c0ce[_0x79b8('0x18')]){if(_0x46c0ce[_0x79b8('0x18')][_0x79b8('0x19')]===0x1f4){logger['error'](_0x79b8('0x13'),_0x4bc41f,_0x46c0ce['error']['message']);return _0xdf585a(_0x46c0ce[_0x79b8('0x18')][_0x79b8('0x1a')]);}logger[_0x79b8('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x4bc41f,_0x46c0ce[_0x79b8('0x18')]['message']);return _0x2fdb05(_0x46c0ce['error'][_0x79b8('0x1a')]);}else{logger[_0x79b8('0x12')](_0x79b8('0x13'),_0x4bc41f,_0x79b8('0x14'));_0x2fdb05(_0x46c0ce[_0x79b8('0x1b')][_0x79b8('0x1a')]);}})['catch'](function(_0x6a0de5){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4bc41f,_0x6a0de5);_0xdf585a(_0x6a0de5);});});}
\ No newline at end of file
index aa85626..6da0146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7119=['update','emit','removeListener','register','openchannelAccount:','save'];(function(_0x4366d4,_0x3ef5a6){var _0x2609a7=function(_0x606441){while(--_0x606441){_0x4366d4['push'](_0x4366d4['shift']());}};_0x2609a7(++_0x3ef5a6);}(_0x7119,0x1c7));var _0x9711=function(_0x471268,_0x5ce885){_0x471268=_0x471268-0x0;var _0x1298f3=_0x7119[_0x471268];return _0x1298f3;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x9711('0x0'),'remove',_0x9711('0x1')];function createListener(_0x5843e8,_0x347925){return function(_0x443d8f){_0x347925[_0x9711('0x2')](_0x5843e8,_0x443d8f);};}function removeListener(_0x2de7dd,_0x47dda0){return function(){OpenchannelAccountEvents[_0x9711('0x3')](_0x2de7dd,_0x47dda0);};}exports[_0x9711('0x4')]=function(_0x2ffe6c){for(var _0x101827=0x0,_0x191701=events['length'];_0x101827<_0x191701;_0x101827++){var _0x31af88=events[_0x101827];var _0x3a5f79=createListener(_0x9711('0x5')+_0x31af88,_0x2ffe6c);OpenchannelAccountEvents['on'](_0x31af88,_0x3a5f79);}};
\ No newline at end of file
+var _0xce25=['openchannelAccount:','remove','emit','removeListener','length'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xce25,0x196));var _0x5ce2=function(_0x638eb6,_0xd902e0){_0x638eb6=_0x638eb6-0x0;var _0x4249ce=_0xce25[_0x638eb6];return _0x4249ce;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=['save',_0x5ce2('0x0'),'update'];function createListener(_0x57ab25,_0x4dc355){return function(_0x5c8966){_0x4dc355[_0x5ce2('0x1')](_0x57ab25,_0x5c8966);};}function removeListener(_0x58f9eb,_0x3f4b36){return function(){OpenchannelAccountEvents[_0x5ce2('0x2')](_0x58f9eb,_0x3f4b36);};}exports['register']=function(_0x57a7a5){for(var _0x41fb85=0x0,_0x417149=events[_0x5ce2('0x3')];_0x41fb85<_0x417149;_0x41fb85++){var _0xcb80ee=events[_0x41fb85];var _0x4a57a6=createListener(_0x5ce2('0x4')+_0xcb80ee,_0x57a7a5);OpenchannelAccountEvents['on'](_0xcb80ee,_0x4a57a6);}};
\ No newline at end of file
index dc15ecb..39284b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac12=['/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get'];(function(_0x34f367,_0x21aea9){var _0x881649=function(_0x270b8e){while(--_0x270b8e){_0x34f367['push'](_0x34f367['shift']());}};_0x881649(++_0x21aea9);}(_0xac12,0x1c9));var _0x2ac1=function(_0x25097d,_0x340684){_0x25097d=_0x25097d-0x0;var _0x857a3c=_0xac12[_0x25097d];return _0x857a3c;};'use strict';var multer=require(_0x2ac1('0x0'));var util=require(_0x2ac1('0x1'));var path=require('path');var timeout=require(_0x2ac1('0x2'));var express=require(_0x2ac1('0x3'));var router=express['Router']();var fs_extra=require(_0x2ac1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2ac1('0x5'));var config=require(_0x2ac1('0x6'));var controller=require(_0x2ac1('0x7'));router['get']('/',auth[_0x2ac1('0x8')](),controller[_0x2ac1('0x9')]);router[_0x2ac1('0xa')](_0x2ac1('0xb'),auth[_0x2ac1('0x8')](),controller[_0x2ac1('0xc')]);router[_0x2ac1('0xd')]('/',auth[_0x2ac1('0x8')](),controller[_0x2ac1('0xe')]);router['put'](_0x2ac1('0xb'),auth[_0x2ac1('0x8')](),controller['update']);router[_0x2ac1('0xf')](_0x2ac1('0xb'),auth[_0x2ac1('0x8')](),controller[_0x2ac1('0x10')]);module[_0x2ac1('0x11')]=router;
\ No newline at end of file
+var _0xb724=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xb724,0x66));var _0x4b72=function(_0x287623,_0x5d506e){_0x287623=_0x287623-0x0;var _0x231289=_0xb724[_0x287623];return _0x231289;};'use strict';var multer=require(_0x4b72('0x0'));var util=require(_0x4b72('0x1'));var path=require(_0x4b72('0x2'));var timeout=require(_0x4b72('0x3'));var express=require(_0x4b72('0x4'));var router=express[_0x4b72('0x5')]();var fs_extra=require(_0x4b72('0x6'));var auth=require(_0x4b72('0x7'));var interaction=require(_0x4b72('0x8'));var config=require(_0x4b72('0x9'));var controller=require(_0x4b72('0xa'));router[_0x4b72('0xb')]('/',auth[_0x4b72('0xc')](),controller[_0x4b72('0xd')]);router[_0x4b72('0xb')](_0x4b72('0xe'),auth[_0x4b72('0xc')](),controller[_0x4b72('0xf')]);router[_0x4b72('0x10')]('/',auth[_0x4b72('0xc')](),controller['create']);router[_0x4b72('0x11')](_0x4b72('0xe'),auth[_0x4b72('0xc')](),controller['update']);router['delete'](_0x4b72('0xe'),auth['isAuthenticated'](),controller[_0x4b72('0x12')]);module[_0x4b72('0x13')]=router;
\ No newline at end of file
index 958c1e6..b660af1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8e3=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x18c0ce,_0x2de9c4){var _0x4323e0=function(_0x103e0f){while(--_0x103e0f){_0x18c0ce['push'](_0x18c0ce['shift']());}};_0x4323e0(++_0x2de9c4);}(_0xa8e3,0x122));var _0x3a8e=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xa8e3[_0x5ac1e5];return _0x1bccc6;};'use strict';var Sequelize=require(_0x3a8e('0x0'));module[_0x3a8e('0x1')]={'priority':{'type':Sequelize[_0x3a8e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3a8e('0x3')],'allowNull':![],'defaultValue':_0x3a8e('0x4')},'appdata':{'type':Sequelize[_0x3a8e('0x5')]()},'description':{'type':Sequelize[_0x3a8e('0x3')]},'interval':{'type':Sequelize[_0x3a8e('0x3')],'defaultValue':_0x3a8e('0x6')}};
\ No newline at end of file
+var _0x2c8d=['TEXT','exports','INTEGER','STRING'];(function(_0x58ddc,_0x316332){var _0x395b30=function(_0x4fa2a8){while(--_0x4fa2a8){_0x58ddc['push'](_0x58ddc['shift']());}};_0x395b30(++_0x316332);}(_0x2c8d,0x1d5));var _0xd2c8=function(_0x56d251,_0xf4a6aa){_0x56d251=_0x56d251-0x0;var _0x4a2707=_0x2c8d[_0x56d251];return _0x4a2707;};'use strict';var Sequelize=require('sequelize');module[_0xd2c8('0x0')]={'priority':{'type':Sequelize[_0xd2c8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd2c8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd2c8('0x3')]()},'description':{'type':Sequelize[_0xd2c8('0x2')]},'interval':{'type':Sequelize[_0xd2c8('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index d276be3..1c52e30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cde=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x38a505,_0x2e194f){var _0x2ff06f=function(_0x51e4a7){while(--_0x51e4a7){_0x38a505['push'](_0x38a505['shift']());}};_0x2ff06f(++_0x2e194f);}(_0x1cde,0x11b));var _0xe1cd=function(_0xd3978b,_0x5cf5de){_0xd3978b=_0xd3978b-0x0;var _0x4c7145=_0x1cde[_0xd3978b];return _0x4c7145;};'use strict';var emlformat=require(_0xe1cd('0x0'));var rimraf=require(_0xe1cd('0x1'));var zipdir=require(_0xe1cd('0x2'));var jsonpatch=require(_0xe1cd('0x3'));var rp=require(_0xe1cd('0x4'));var moment=require('moment');var BPromise=require(_0xe1cd('0x5'));var Mustache=require('mustache');var util=require(_0xe1cd('0x6'));var path=require(_0xe1cd('0x7'));var sox=require(_0xe1cd('0x8'));var csv=require(_0xe1cd('0x9'));var ejs=require(_0xe1cd('0xa'));var fs=require('fs');var fs_extra=require(_0xe1cd('0xb'));var _=require(_0xe1cd('0xc'));var squel=require(_0xe1cd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe1cd('0xe'));var toCsv=require(_0xe1cd('0x9'));var querystring=require(_0xe1cd('0xf'));var Papa=require(_0xe1cd('0x10'));var Redis=require(_0xe1cd('0x11'));var authService=require(_0xe1cd('0x12'));var qs=require(_0xe1cd('0x13'));var as=require(_0xe1cd('0x14'));var hardwareService=require(_0xe1cd('0x15'));var logger=require(_0xe1cd('0x16'))(_0xe1cd('0x17'));var utils=require(_0xe1cd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe1cd('0x19'));var db=require(_0xe1cd('0x1a'))['db'];function respondWithStatusCode(_0x5d46ba,_0x3763b2){_0x3763b2=_0x3763b2||0xcc;return function(_0x5088bf){if(_0x5088bf){return _0x5d46ba[_0xe1cd('0x1b')](_0x3763b2);}return _0x5d46ba[_0xe1cd('0x1c')](_0x3763b2)[_0xe1cd('0x1d')]();};}function respondWithResult(_0x23d454,_0x47f722){_0x47f722=_0x47f722||0xc8;return function(_0xff1463){if(_0xff1463){return _0x23d454[_0xe1cd('0x1c')](_0x47f722)[_0xe1cd('0x1e')](_0xff1463);}};}function respondWithFilteredResult(_0x1edcc6,_0x54ebe8){return function(_0x2d0252){if(_0x2d0252){var _0x31387a=typeof _0x54ebe8[_0xe1cd('0x1f')]===_0xe1cd('0x20')&&typeof _0x54ebe8[_0xe1cd('0x21')]===_0xe1cd('0x20');var _0x24abd4=_0x2d0252['count'];var _0x10386c=_0x31387a?0x0:_0x54ebe8[_0xe1cd('0x1f')];var _0x3a0e61=_0x31387a?_0x2d0252[_0xe1cd('0x22')]:_0x54ebe8[_0xe1cd('0x1f')]+_0x54ebe8['limit'];var _0x118dd2;if(_0x3a0e61>=_0x24abd4){_0x3a0e61=_0x24abd4;_0x118dd2=0xc8;}else{_0x118dd2=0xce;}_0x1edcc6[_0xe1cd('0x1c')](_0x118dd2);return _0x1edcc6[_0xe1cd('0x23')]('Content-Range',_0x10386c+'-'+_0x3a0e61+'/'+_0x24abd4)[_0xe1cd('0x1e')](_0x2d0252);}return null;};}function patchUpdates(_0x429dcd){return function(_0x17cd6e){try{jsonpatch[_0xe1cd('0x24')](_0x17cd6e,_0x429dcd,!![]);}catch(_0x17a5f6){return BPromise['reject'](_0x17a5f6);}return _0x17cd6e['save']();};}function saveUpdates(_0x10f13d,_0x35d810){return function(_0xc3fd5f){if(_0xc3fd5f){return _0xc3fd5f[_0xe1cd('0x25')](_0x10f13d)['then'](function(_0x246834){return _0x246834;});}return null;};}function removeEntity(_0x56a8f5,_0x55d626){return function(_0x2ae211){if(_0x2ae211){return _0x2ae211['destroy']()[_0xe1cd('0x26')](function(){_0x56a8f5[_0xe1cd('0x1c')](0xcc)[_0xe1cd('0x1d')]();});}};}function handleEntityNotFound(_0x527cf3,_0x117052){return function(_0xfdc646){if(!_0xfdc646){_0x527cf3[_0xe1cd('0x1b')](0x194);}return _0xfdc646;};}function handleError(_0x44ba25,_0xe93d9){_0xe93d9=_0xe93d9||0x1f4;return function(_0x1b558c){logger[_0xe1cd('0x27')](_0x1b558c[_0xe1cd('0x28')]);if(_0x1b558c['name']){delete _0x1b558c[_0xe1cd('0x29')];}_0x44ba25[_0xe1cd('0x1c')](_0xe93d9)[_0xe1cd('0x2a')](_0x1b558c);};}exports[_0xe1cd('0x2b')]=function(_0x28cd6,_0x38d939){var _0x1ec6d4={},_0x19c729={},_0x5aeaea={'count':0x0,'rows':[]};var _0x149b23=_[_0xe1cd('0x2c')](db[_0xe1cd('0x2d')][_0xe1cd('0x2e')],function(_0x60964c){return{'name':_0x60964c[_0xe1cd('0x2f')],'type':_0x60964c[_0xe1cd('0x30')][_0xe1cd('0x31')]};});_0x19c729[_0xe1cd('0x32')]=_[_0xe1cd('0x2c')](_0x149b23,_0xe1cd('0x29'));_0x19c729[_0xe1cd('0x33')]=_['keys'](_0x28cd6['query']);_0x19c729[_0xe1cd('0x34')]=_['intersection'](_0x19c729[_0xe1cd('0x32')],_0x19c729[_0xe1cd('0x33')]);_0x1ec6d4[_0xe1cd('0x35')]=_[_0xe1cd('0x36')](_0x19c729[_0xe1cd('0x32')],qs[_0xe1cd('0x37')](_0x28cd6[_0xe1cd('0x33')][_0xe1cd('0x37')]));_0x1ec6d4[_0xe1cd('0x35')]=_0x1ec6d4[_0xe1cd('0x35')]['length']?_0x1ec6d4[_0xe1cd('0x35')]:_0x19c729['model'];if(!_0x28cd6[_0xe1cd('0x33')][_0xe1cd('0x38')](_0xe1cd('0x39'))){_0x1ec6d4[_0xe1cd('0x21')]=qs[_0xe1cd('0x21')](_0x28cd6[_0xe1cd('0x33')][_0xe1cd('0x21')]);_0x1ec6d4[_0xe1cd('0x1f')]=qs['offset'](_0x28cd6[_0xe1cd('0x33')][_0xe1cd('0x1f')]);}_0x1ec6d4['order']=qs[_0xe1cd('0x3a')](_0x28cd6[_0xe1cd('0x33')][_0xe1cd('0x3a')]);_0x1ec6d4[_0xe1cd('0x3b')]=qs[_0xe1cd('0x34')](_[_0xe1cd('0x3c')](_0x28cd6[_0xe1cd('0x33')],_0x19c729[_0xe1cd('0x34')]),_0x149b23);if(_0x28cd6[_0xe1cd('0x33')]['filter']){_0x1ec6d4[_0xe1cd('0x3b')]=_[_0xe1cd('0x3d')](_0x1ec6d4[_0xe1cd('0x3b')],{'$or':_[_0xe1cd('0x2c')](_0x149b23,function(_0x444e6e){if(_0x444e6e['type']!==_0xe1cd('0x3e')){var _0x4f4fc5={};_0x4f4fc5[_0x444e6e[_0xe1cd('0x29')]]={'$like':'%'+_0x28cd6['query'][_0xe1cd('0x3f')]+'%'};return _0x4f4fc5;}})});}_0x1ec6d4=_[_0xe1cd('0x3d')]({},_0x1ec6d4,_0x28cd6[_0xe1cd('0x40')]);var _0xa19d58={'where':_0x1ec6d4[_0xe1cd('0x3b')]};return db[_0xe1cd('0x2d')][_0xe1cd('0x22')](_0xa19d58)[_0xe1cd('0x26')](function(_0xdda39e){_0x5aeaea['count']=_0xdda39e;if(_0x28cd6[_0xe1cd('0x33')][_0xe1cd('0x41')]){_0x1ec6d4[_0xe1cd('0x42')]=[{'all':!![]}];}return db[_0xe1cd('0x2d')][_0xe1cd('0x43')](_0x1ec6d4);})[_0xe1cd('0x26')](function(_0x3077e2){_0x5aeaea[_0xe1cd('0x44')]=_0x3077e2;return _0x5aeaea;})[_0xe1cd('0x26')](respondWithFilteredResult(_0x38d939,_0x1ec6d4))['catch'](handleError(_0x38d939,null));};exports['show']=function(_0x32a40e,_0x5a565a){var _0x2f199d={'raw':!![],'where':{'id':_0x32a40e[_0xe1cd('0x45')]['id']}},_0x45bfed={};_0x45bfed[_0xe1cd('0x32')]=_[_0xe1cd('0x46')](db[_0xe1cd('0x2d')]['rawAttributes']);_0x45bfed['query']=_['keys'](_0x32a40e[_0xe1cd('0x33')]);_0x45bfed[_0xe1cd('0x34')]=_[_0xe1cd('0x36')](_0x45bfed[_0xe1cd('0x32')],_0x45bfed['query']);_0x2f199d[_0xe1cd('0x35')]=_[_0xe1cd('0x36')](_0x45bfed[_0xe1cd('0x32')],qs['fields'](_0x32a40e['query'][_0xe1cd('0x37')]));_0x2f199d['attributes']=_0x2f199d[_0xe1cd('0x35')]['length']?_0x2f199d[_0xe1cd('0x35')]:_0x45bfed[_0xe1cd('0x32')];if(_0x32a40e[_0xe1cd('0x33')][_0xe1cd('0x41')]){_0x2f199d[_0xe1cd('0x42')]=[{'all':!![]}];}_0x2f199d=_[_0xe1cd('0x3d')]({},_0x2f199d,_0x32a40e[_0xe1cd('0x40')]);return db[_0xe1cd('0x2d')][_0xe1cd('0x47')](_0x2f199d)[_0xe1cd('0x26')](handleEntityNotFound(_0x5a565a,null))['then'](respondWithResult(_0x5a565a,null))[_0xe1cd('0x48')](handleError(_0x5a565a,null));};exports[_0xe1cd('0x49')]=function(_0x2145bc,_0x3fb652){return db[_0xe1cd('0x2d')]['create'](_0x2145bc[_0xe1cd('0x4a')],{})['then'](respondWithResult(_0x3fb652,0xc9))[_0xe1cd('0x48')](handleError(_0x3fb652,null));};exports[_0xe1cd('0x25')]=function(_0x2ac875,_0x27b9a1){if(_0x2ac875[_0xe1cd('0x4a')]['id']){delete _0x2ac875[_0xe1cd('0x4a')]['id'];}return db[_0xe1cd('0x2d')][_0xe1cd('0x47')]({'where':{'id':_0x2ac875[_0xe1cd('0x45')]['id']}})[_0xe1cd('0x26')](handleEntityNotFound(_0x27b9a1,null))[_0xe1cd('0x26')](saveUpdates(_0x2ac875[_0xe1cd('0x4a')],null))[_0xe1cd('0x26')](respondWithResult(_0x27b9a1,null))['catch'](handleError(_0x27b9a1,null));};exports[_0xe1cd('0x4b')]=function(_0x50b576,_0x1bb962){return db[_0xe1cd('0x2d')][_0xe1cd('0x47')]({'where':{'id':_0x50b576[_0xe1cd('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bb962,null))[_0xe1cd('0x26')](removeEntity(_0x1bb962,null))[_0xe1cd('0x48')](handleError(_0x1bb962,null));};
\ No newline at end of file
+var _0x10ac=['fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../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','count','Content-Range','reject','save','update','then','destroy','error','send','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection'];(function(_0xc0322,_0x2dd3c6){var _0xb07dc6=function(_0x4aef6f){while(--_0x4aef6f){_0xc0322['push'](_0xc0322['shift']());}};_0xb07dc6(++_0x2dd3c6);}(_0x10ac,0x135));var _0xc10a=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x10ac[_0x8a969d];return _0x1d8dc7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc10a('0x0'));var zipdir=require(_0xc10a('0x1'));var jsonpatch=require(_0xc10a('0x2'));var rp=require(_0xc10a('0x3'));var moment=require(_0xc10a('0x4'));var BPromise=require(_0xc10a('0x5'));var Mustache=require(_0xc10a('0x6'));var util=require(_0xc10a('0x7'));var path=require(_0xc10a('0x8'));var sox=require('sox');var csv=require(_0xc10a('0x9'));var ejs=require(_0xc10a('0xa'));var fs=require('fs');var fs_extra=require(_0xc10a('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc10a('0xc'));var deskjs=require(_0xc10a('0xd'));var toCsv=require(_0xc10a('0x9'));var querystring=require(_0xc10a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc10a('0xf'));var qs=require(_0xc10a('0x10'));var as=require(_0xc10a('0x11'));var hardwareService=require(_0xc10a('0x12'));var logger=require(_0xc10a('0x13'))(_0xc10a('0x14'));var utils=require(_0xc10a('0x15'));var config=require(_0xc10a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc10a('0x17'))['db'];function respondWithStatusCode(_0x3f674b,_0x38ce8d){_0x38ce8d=_0x38ce8d||0xcc;return function(_0x321a01){if(_0x321a01){return _0x3f674b[_0xc10a('0x18')](_0x38ce8d);}return _0x3f674b[_0xc10a('0x19')](_0x38ce8d)[_0xc10a('0x1a')]();};}function respondWithResult(_0x10a855,_0x507b22){_0x507b22=_0x507b22||0xc8;return function(_0x420255){if(_0x420255){return _0x10a855[_0xc10a('0x19')](_0x507b22)[_0xc10a('0x1b')](_0x420255);}};}function respondWithFilteredResult(_0x4d853b,_0x37e098){return function(_0x5177f6){if(_0x5177f6){var _0x294e57=typeof _0x37e098[_0xc10a('0x1c')]===_0xc10a('0x1d')&&typeof _0x37e098['limit']===_0xc10a('0x1d');var _0x5b7e55=_0x5177f6[_0xc10a('0x1e')];var _0x4cc98a=_0x294e57?0x0:_0x37e098['offset'];var _0x4e88a6=_0x294e57?_0x5177f6[_0xc10a('0x1e')]:_0x37e098[_0xc10a('0x1c')]+_0x37e098['limit'];var _0x2666ca;if(_0x4e88a6>=_0x5b7e55){_0x4e88a6=_0x5b7e55;_0x2666ca=0xc8;}else{_0x2666ca=0xce;}_0x4d853b[_0xc10a('0x19')](_0x2666ca);return _0x4d853b['set'](_0xc10a('0x1f'),_0x4cc98a+'-'+_0x4e88a6+'/'+_0x5b7e55)[_0xc10a('0x1b')](_0x5177f6);}return null;};}function patchUpdates(_0x5ec569){return function(_0x55fc75){try{jsonpatch['apply'](_0x55fc75,_0x5ec569,!![]);}catch(_0x211fa0){return BPromise[_0xc10a('0x20')](_0x211fa0);}return _0x55fc75[_0xc10a('0x21')]();};}function saveUpdates(_0x4ec059,_0x9836ab){return function(_0x175ded){if(_0x175ded){return _0x175ded[_0xc10a('0x22')](_0x4ec059)[_0xc10a('0x23')](function(_0x28fdc2){return _0x28fdc2;});}return null;};}function removeEntity(_0x1bd26b,_0x110f21){return function(_0x46a6a3){if(_0x46a6a3){return _0x46a6a3[_0xc10a('0x24')]()['then'](function(){_0x1bd26b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c4de,_0x3618bd){return function(_0x52770a){if(!_0x52770a){_0x36c4de['sendStatus'](0x194);}return _0x52770a;};}function handleError(_0x35b2e0,_0x52a104){_0x52a104=_0x52a104||0x1f4;return function(_0x5f181f){logger[_0xc10a('0x25')](_0x5f181f['stack']);if(_0x5f181f['name']){delete _0x5f181f['name'];}_0x35b2e0[_0xc10a('0x19')](_0x52a104)[_0xc10a('0x26')](_0x5f181f);};}exports['index']=function(_0x52e723,_0x554188){var _0x141346={},_0x4bab44={},_0x4ea390={'count':0x0,'rows':[]};var _0x137729=_['map'](db[_0xc10a('0x27')][_0xc10a('0x28')],function(_0x4ebcc5){return{'name':_0x4ebcc5[_0xc10a('0x29')],'type':_0x4ebcc5[_0xc10a('0x2a')][_0xc10a('0x2b')]};});_0x4bab44[_0xc10a('0x2c')]=_[_0xc10a('0x2d')](_0x137729,_0xc10a('0x2e'));_0x4bab44[_0xc10a('0x2f')]=_[_0xc10a('0x30')](_0x52e723['query']);_0x4bab44[_0xc10a('0x31')]=_[_0xc10a('0x32')](_0x4bab44[_0xc10a('0x2c')],_0x4bab44[_0xc10a('0x2f')]);_0x141346['attributes']=_[_0xc10a('0x32')](_0x4bab44[_0xc10a('0x2c')],qs[_0xc10a('0x33')](_0x52e723[_0xc10a('0x2f')]['fields']));_0x141346[_0xc10a('0x34')]=_0x141346[_0xc10a('0x34')]['length']?_0x141346[_0xc10a('0x34')]:_0x4bab44['model'];if(!_0x52e723[_0xc10a('0x2f')][_0xc10a('0x35')](_0xc10a('0x36'))){_0x141346[_0xc10a('0x37')]=qs[_0xc10a('0x37')](_0x52e723['query'][_0xc10a('0x37')]);_0x141346[_0xc10a('0x1c')]=qs[_0xc10a('0x1c')](_0x52e723[_0xc10a('0x2f')][_0xc10a('0x1c')]);}_0x141346[_0xc10a('0x38')]=qs['sort'](_0x52e723['query'][_0xc10a('0x39')]);_0x141346['where']=qs[_0xc10a('0x31')](_['pick'](_0x52e723[_0xc10a('0x2f')],_0x4bab44[_0xc10a('0x31')]),_0x137729);if(_0x52e723[_0xc10a('0x2f')][_0xc10a('0x3a')]){_0x141346['where']=_[_0xc10a('0x3b')](_0x141346[_0xc10a('0x3c')],{'$or':_[_0xc10a('0x2d')](_0x137729,function(_0x3cd305){if(_0x3cd305[_0xc10a('0x2a')]!==_0xc10a('0x3d')){var _0x48cb2b={};_0x48cb2b[_0x3cd305['name']]={'$like':'%'+_0x52e723['query'][_0xc10a('0x3a')]+'%'};return _0x48cb2b;}})});}_0x141346=_[_0xc10a('0x3b')]({},_0x141346,_0x52e723['options']);var _0x232210={'where':_0x141346['where']};return db['OpenchannelApplication']['count'](_0x232210)[_0xc10a('0x23')](function(_0x1fcf12){_0x4ea390[_0xc10a('0x1e')]=_0x1fcf12;if(_0x52e723[_0xc10a('0x2f')][_0xc10a('0x3e')]){_0x141346[_0xc10a('0x3f')]=[{'all':!![]}];}return db[_0xc10a('0x27')][_0xc10a('0x40')](_0x141346);})['then'](function(_0x1f6db8){_0x4ea390['rows']=_0x1f6db8;return _0x4ea390;})[_0xc10a('0x23')](respondWithFilteredResult(_0x554188,_0x141346))[_0xc10a('0x41')](handleError(_0x554188,null));};exports[_0xc10a('0x42')]=function(_0x113869,_0x45b225){var _0xc1215f={'raw':!![],'where':{'id':_0x113869[_0xc10a('0x43')]['id']}},_0x445fdd={};_0x445fdd[_0xc10a('0x2c')]=_['keys'](db[_0xc10a('0x27')][_0xc10a('0x28')]);_0x445fdd[_0xc10a('0x2f')]=_[_0xc10a('0x30')](_0x113869[_0xc10a('0x2f')]);_0x445fdd[_0xc10a('0x31')]=_[_0xc10a('0x32')](_0x445fdd[_0xc10a('0x2c')],_0x445fdd[_0xc10a('0x2f')]);_0xc1215f['attributes']=_['intersection'](_0x445fdd[_0xc10a('0x2c')],qs['fields'](_0x113869[_0xc10a('0x2f')][_0xc10a('0x33')]));_0xc1215f[_0xc10a('0x34')]=_0xc1215f['attributes']['length']?_0xc1215f['attributes']:_0x445fdd[_0xc10a('0x2c')];if(_0x113869[_0xc10a('0x2f')]['includeAll']){_0xc1215f[_0xc10a('0x3f')]=[{'all':!![]}];}_0xc1215f=_[_0xc10a('0x3b')]({},_0xc1215f,_0x113869[_0xc10a('0x44')]);return db['OpenchannelApplication'][_0xc10a('0x45')](_0xc1215f)[_0xc10a('0x23')](handleEntityNotFound(_0x45b225,null))[_0xc10a('0x23')](respondWithResult(_0x45b225,null))['catch'](handleError(_0x45b225,null));};exports[_0xc10a('0x46')]=function(_0xca80e5,_0x22e8cd){return db[_0xc10a('0x27')][_0xc10a('0x46')](_0xca80e5['body'],{})[_0xc10a('0x23')](respondWithResult(_0x22e8cd,0xc9))[_0xc10a('0x41')](handleError(_0x22e8cd,null));};exports[_0xc10a('0x22')]=function(_0x40073b,_0x193b3b){if(_0x40073b[_0xc10a('0x47')]['id']){delete _0x40073b[_0xc10a('0x47')]['id'];}return db[_0xc10a('0x27')]['find']({'where':{'id':_0x40073b[_0xc10a('0x43')]['id']}})[_0xc10a('0x23')](handleEntityNotFound(_0x193b3b,null))[_0xc10a('0x23')](saveUpdates(_0x40073b['body'],null))['then'](respondWithResult(_0x193b3b,null))[_0xc10a('0x41')](handleError(_0x193b3b,null));};exports[_0xc10a('0x24')]=function(_0x5b13e6,_0x3ed22f){return db[_0xc10a('0x27')]['find']({'where':{'id':_0x5b13e6['params']['id']}})[_0xc10a('0x23')](handleEntityNotFound(_0x3ed22f,null))[_0xc10a('0x23')](removeEntity(_0x3ed22f,null))[_0xc10a('0x41')](handleError(_0x3ed22f,null));};
\ No newline at end of file
index 544964f..f036106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70ed=['openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','OpenchannelApplication'];(function(_0x1df376,_0x103a79){var _0x56783c=function(_0x2fa753){while(--_0x2fa753){_0x1df376['push'](_0x1df376['shift']());}};_0x56783c(++_0x103a79);}(_0x70ed,0x1ec));var _0xd70e=function(_0x13b7fd,_0x4eaf7f){_0x13b7fd=_0x13b7fd-0x0;var _0x32a74a=_0x70ed[_0x13b7fd];return _0x32a74a;};'use strict';var _=require(_0xd70e('0x0'));var util=require(_0xd70e('0x1'));var logger=require('../../config/logger')(_0xd70e('0x2'));var moment=require(_0xd70e('0x3'));var BPromise=require(_0xd70e('0x4'));var rp=require(_0xd70e('0x5'));var fs=require('fs');var path=require(_0xd70e('0x6'));var rimraf=require(_0xd70e('0x7'));var config=require(_0xd70e('0x8'));var attributes=require(_0xd70e('0x9'));module[_0xd70e('0xa')]=function(_0x571df0,_0x4fb0b7){return _0x571df0['define'](_0xd70e('0xb'),attributes,{'tableName':_0xd70e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd70e('0xd')});};
\ No newline at end of file
+var _0x2706=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','OpenchannelApplication','utf8mb4'];(function(_0x5c104a,_0x5c7044){var _0x2807d5=function(_0xefef7e){while(--_0xefef7e){_0x5c104a['push'](_0x5c104a['shift']());}};_0x2807d5(++_0x5c7044);}(_0x2706,0x198));var _0x6270=function(_0x2fed7c,_0x34b7ff){_0x2fed7c=_0x2fed7c-0x0;var _0x3a589d=_0x2706[_0x2fed7c];return _0x3a589d;};'use strict';var _=require('lodash');var util=require(_0x6270('0x0'));var logger=require(_0x6270('0x1'))(_0x6270('0x2'));var moment=require('moment');var BPromise=require(_0x6270('0x3'));var rp=require(_0x6270('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6270('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x6270('0x6')]=function(_0x358f91,_0x595ae0){return _0x358f91[_0x6270('0x7')](_0x6270('0x8'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6270('0x9'),'collate':_0x6270('0xa')});};
\ No newline at end of file
index 13ad712..b54aeb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9926=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','info','result','catch','OpenchannelApplication','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird'];(function(_0x43506e,_0x671bd7){var _0x88dd16=function(_0x4b243e){while(--_0x4b243e){_0x43506e['push'](_0x43506e['shift']());}};_0x88dd16(++_0x671bd7);}(_0x9926,0x128));var _0x6992=function(_0x3df4b4,_0x321e93){_0x3df4b4=_0x3df4b4-0x0;var _0x32b158=_0x9926[_0x3df4b4];return _0x32b158;};'use strict';var _=require(_0x6992('0x0'));var util=require(_0x6992('0x1'));var moment=require(_0x6992('0x2'));var BPromise=require(_0x6992('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6992('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6992('0x5'))(_0x6992('0x6'));var config=require(_0x6992('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6992('0x8')][_0x6992('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x383c1a,_0x25728f,_0x26529d){return new BPromise(function(_0x1ed229,_0x4a1eea){return client[_0x6992('0xa')](_0x383c1a,_0x26529d)[_0x6992('0xb')](function(_0x13864b){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x25728f,_0x6992('0xc'));logger[_0x6992('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x25728f,_0x6992('0xc'),JSON[_0x6992('0xe')](_0x13864b));if(_0x13864b[_0x6992('0xf')]){if(_0x13864b[_0x6992('0xf')][_0x6992('0x10')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x25728f,_0x13864b['error'][_0x6992('0x11')]);return _0x4a1eea(_0x13864b[_0x6992('0xf')][_0x6992('0x11')]);}logger[_0x6992('0xf')](_0x6992('0x12'),_0x25728f,_0x13864b[_0x6992('0xf')][_0x6992('0x11')]);return _0x1ed229(_0x13864b['error']['message']);}else{logger[_0x6992('0x13')](_0x6992('0x12'),_0x25728f,_0x6992('0xc'));_0x1ed229(_0x13864b[_0x6992('0x14')]['message']);}})[_0x6992('0x15')](function(_0x5cb3ce){logger[_0x6992('0xf')](_0x6992('0x12'),_0x25728f,_0x5cb3ce);_0x4a1eea(_0x5cb3ce);});});}exports['UpdateOpenchannelApplication']=function(_0x56cdaf){var _0x41cc44=this;return new Promise(function(_0x1a6050,_0x37940a){return db[_0x6992('0x16')]['update'](_0x56cdaf[_0x6992('0x17')],{'raw':_0x56cdaf[_0x6992('0x18')]?_0x56cdaf['options'][_0x6992('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56cdaf[_0x6992('0x18')]?_0x56cdaf[_0x6992('0x18')][_0x6992('0x1a')]||null:null,'attributes':_0x56cdaf[_0x6992('0x18')]?_0x56cdaf[_0x6992('0x18')][_0x6992('0x1b')]||null:null,'limit':_0x56cdaf['options']?_0x56cdaf[_0x6992('0x18')][_0x6992('0x1c')]||null:null})[_0x6992('0xb')](function(_0x3dc2aa){logger[_0x6992('0x13')](_0x6992('0x1d'),_0x56cdaf);logger[_0x6992('0xd')](_0x6992('0x1d'),_0x56cdaf,JSON['stringify'](_0x3dc2aa));_0x1a6050(_0x3dc2aa);})['catch'](function(_0xe54350){logger['error']('UpdateOpenchannelApplication',_0xe54350[_0x6992('0x11')],_0x56cdaf);_0x37940a(_0x41cc44[_0x6992('0xf')](0x1f4,_0xe54350[_0x6992('0x11')]));});});};
\ No newline at end of file
+var _0xe659=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateOpenchannelApplication','options','raw','where','attributes','then','lodash'];(function(_0x4d6ff0,_0x4232ae){var _0x14928d=function(_0x45ed86){while(--_0x45ed86){_0x4d6ff0['push'](_0x4d6ff0['shift']());}};_0x14928d(++_0x4232ae);}(_0xe659,0x19f));var _0x9e65=function(_0x21cf80,_0x1fb0a1){_0x21cf80=_0x21cf80-0x0;var _0x5c6bed=_0xe659[_0x21cf80];return _0x5c6bed;};'use strict';var _=require(_0x9e65('0x0'));var util=require(_0x9e65('0x1'));var moment=require(_0x9e65('0x2'));var BPromise=require(_0x9e65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e65('0x4'))['db'];var utils=require(_0x9e65('0x5'));var logger=require(_0x9e65('0x6'))('rpc');var config=require(_0x9e65('0x7'));var jayson=require(_0x9e65('0x8'));var client=jayson[_0x9e65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b5f72,_0x29bc45,_0x13b65f){return new BPromise(function(_0x317d9d,_0x2405e2){return client['request'](_0x1b5f72,_0x13b65f)['then'](function(_0x307531){logger['info'](_0x9e65('0xa'),_0x29bc45,'request\x20sent');logger['debug'](_0x9e65('0xb'),_0x29bc45,_0x9e65('0xc'),JSON[_0x9e65('0xd')](_0x307531));if(_0x307531[_0x9e65('0xe')]){if(_0x307531['error'][_0x9e65('0xf')]===0x1f4){logger['error'](_0x9e65('0xa'),_0x29bc45,_0x307531['error'][_0x9e65('0x10')]);return _0x2405e2(_0x307531['error'][_0x9e65('0x10')]);}logger['error'](_0x9e65('0xa'),_0x29bc45,_0x307531[_0x9e65('0xe')][_0x9e65('0x10')]);return _0x317d9d(_0x307531[_0x9e65('0xe')][_0x9e65('0x10')]);}else{logger[_0x9e65('0x11')](_0x9e65('0xa'),_0x29bc45,_0x9e65('0xc'));_0x317d9d(_0x307531[_0x9e65('0x12')][_0x9e65('0x10')]);}})[_0x9e65('0x13')](function(_0x25b8c2){logger[_0x9e65('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x29bc45,_0x25b8c2);_0x2405e2(_0x25b8c2);});});}exports[_0x9e65('0x14')]=function(_0x3bdd9a){var _0x17dcf4=this;return new Promise(function(_0x365dd7,_0xf8c1a){return db['OpenchannelApplication']['update'](_0x3bdd9a['body'],{'raw':_0x3bdd9a['options']?_0x3bdd9a[_0x9e65('0x15')][_0x9e65('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bdd9a[_0x9e65('0x15')]?_0x3bdd9a['options'][_0x9e65('0x17')]||null:null,'attributes':_0x3bdd9a['options']?_0x3bdd9a['options'][_0x9e65('0x18')]||null:null,'limit':_0x3bdd9a[_0x9e65('0x15')]?_0x3bdd9a['options']['limit']||null:null})[_0x9e65('0x19')](function(_0x1ecaaf){logger[_0x9e65('0x11')](_0x9e65('0x14'),_0x3bdd9a);logger['debug'](_0x9e65('0x14'),_0x3bdd9a,JSON[_0x9e65('0xd')](_0x1ecaaf));_0x365dd7(_0x1ecaaf);})[_0x9e65('0x13')](function(_0xa9ae06){logger[_0x9e65('0xe')](_0x9e65('0x14'),_0xa9ae06['message'],_0x3bdd9a);_0xf8c1a(_0x17dcf4[_0x9e65('0xe')](0x1f4,_0xa9ae06[_0x9e65('0x10')]));});});};
\ No newline at end of file
index c22be29..5355006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e3d=['removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','download','post','/:id/messages','openchannelinteraction:addtags','addTags','tracked','openchannel','openchannelinteraction:update','update','delete','destroy','/:id/tags'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x2e3d,0x198));var _0xd2e3=function(_0x5e73fa,_0x2f7e20){_0x5e73fa=_0x5e73fa-0x0;var _0x382dd3=_0x2e3d[_0x5e73fa];return _0x382dd3;};'use strict';var multer=require('multer');var util=require(_0xd2e3('0x0'));var path=require('path');var timeout=require(_0xd2e3('0x1'));var express=require(_0xd2e3('0x2'));var router=express[_0xd2e3('0x3')]();var fs_extra=require(_0xd2e3('0x4'));var auth=require(_0xd2e3('0x5'));var interaction=require(_0xd2e3('0x6'));var config=require(_0xd2e3('0x7'));var controller=require(_0xd2e3('0x8'));router[_0xd2e3('0x9')]('/',auth['isAuthenticated'](),controller[_0xd2e3('0xa')]);router[_0xd2e3('0x9')](_0xd2e3('0xb'),auth[_0xd2e3('0xc')](),controller['describe']);router[_0xd2e3('0x9')](_0xd2e3('0xd'),auth[_0xd2e3('0xc')](),controller[_0xd2e3('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xd2e3('0x9')]('/:id/download',auth[_0xd2e3('0xc')](),controller[_0xd2e3('0xf')]);router[_0xd2e3('0x10')]('/',auth[_0xd2e3('0xc')](),controller['create']);router['post'](_0xd2e3('0x11'),auth[_0xd2e3('0xc')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xd2e3('0xc')](),interaction['tracked']('openchannel',_0xd2e3('0x12')),controller[_0xd2e3('0x13')]);router['put'](_0xd2e3('0xd'),auth[_0xd2e3('0xc')](),interaction[_0xd2e3('0x14')](_0xd2e3('0x15'),_0xd2e3('0x16')),controller[_0xd2e3('0x17')]);router[_0xd2e3('0x18')](_0xd2e3('0xd'),auth[_0xd2e3('0xc')](),interaction[_0xd2e3('0x14')](_0xd2e3('0x15'),'openchannelinteraction:destroy'),controller[_0xd2e3('0x19')]);router[_0xd2e3('0x18')](_0xd2e3('0x1a'),auth[_0xd2e3('0xc')](),controller[_0xd2e3('0x1b')]);module[_0xd2e3('0x1c')]=router;
\ No newline at end of file
+var _0x1abb=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout'];(function(_0x236555,_0x22d3d9){var _0x421aa8=function(_0x5f3f1f){while(--_0x5f3f1f){_0x236555['push'](_0x236555['shift']());}};_0x421aa8(++_0x22d3d9);}(_0x1abb,0x174));var _0xb1ab=function(_0x4e2bc3,_0x39fd32){_0x4e2bc3=_0x4e2bc3-0x0;var _0x42c929=_0x1abb[_0x4e2bc3];return _0x42c929;};'use strict';var multer=require(_0xb1ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb1ab('0x1'));var express=require(_0xb1ab('0x2'));var router=express['Router']();var fs_extra=require(_0xb1ab('0x3'));var auth=require(_0xb1ab('0x4'));var interaction=require(_0xb1ab('0x5'));var config=require(_0xb1ab('0x6'));var controller=require(_0xb1ab('0x7'));router['get']('/',auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x9')]);router[_0xb1ab('0xa')](_0xb1ab('0xb'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0xc')]);router[_0xb1ab('0xa')](_0xb1ab('0xd'),auth['isAuthenticated'](),controller[_0xb1ab('0xe')]);router['get'](_0xb1ab('0xf'),auth['isAuthenticated'](),controller[_0xb1ab('0x10')]);router[_0xb1ab('0xa')](_0xb1ab('0x11'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x12')]);router['post']('/',auth[_0xb1ab('0x8')](),controller['create']);router[_0xb1ab('0x13')](_0xb1ab('0xf'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x14')]);router[_0xb1ab('0x13')](_0xb1ab('0x15'),auth[_0xb1ab('0x8')](),interaction[_0xb1ab('0x16')](_0xb1ab('0x17'),_0xb1ab('0x18')),controller[_0xb1ab('0x19')]);router[_0xb1ab('0x1a')](_0xb1ab('0xd'),auth[_0xb1ab('0x8')](),interaction[_0xb1ab('0x16')](_0xb1ab('0x17'),_0xb1ab('0x1b')),controller[_0xb1ab('0x1c')]);router[_0xb1ab('0x1d')]('/:id',auth['isAuthenticated'](),interaction[_0xb1ab('0x16')](_0xb1ab('0x17'),_0xb1ab('0x1e')),controller[_0xb1ab('0x1f')]);router[_0xb1ab('0x1d')](_0xb1ab('0x15'),auth[_0xb1ab('0x8')](),controller[_0xb1ab('0x20')]);module[_0xb1ab('0x21')]=router;
\ No newline at end of file
index 113e7ec..50faf14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b5=['DATE','STRING','ENUM','BOOLEAN'];(function(_0x28700b,_0x49d6ca){var _0x54cf9f=function(_0x4c8f49){while(--_0x4c8f49){_0x28700b['push'](_0x28700b['shift']());}};_0x54cf9f(++_0x49d6ca);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x236dd3,_0x132503){_0x236dd3=_0x236dd3-0x0;var _0x4cba08=_0xc3b5[_0x236dd3];return _0x4cba08;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x5c3b('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5c3b('0x1')]},'disposition':{'type':Sequelize[_0x5c3b('0x2')]},'secondDisposition':{'type':Sequelize[_0x5c3b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x5c3b('0x2')]},'note':{'type':Sequelize[_0x5c3b('0x2')]},'read1stAt':{'type':Sequelize[_0x5c3b('0x1')]},'threadId':{'type':Sequelize[_0x5c3b('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x5c3b('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x5c3b('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5c3b('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x5c3b('0x0')],'defaultValue':![]}};
\ No newline at end of file
+var _0x567c=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x34a264,_0xb769e3){var _0xeb4173=function(_0x474094){while(--_0x474094){_0x34a264['push'](_0x34a264['shift']());}};_0xeb4173(++_0xb769e3);}(_0x567c,0x8d));var _0xc567=function(_0x4b14f2,_0x54a0d2){_0x4b14f2=_0x4b14f2-0x0;var _0x269390=_0x567c[_0x4b14f2];return _0x269390;};'use strict';var Sequelize=require(_0xc567('0x0'));module[_0xc567('0x1')]={'closed':{'type':Sequelize[_0xc567('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc567('0x3')]},'disposition':{'type':Sequelize[_0xc567('0x4')]},'secondDisposition':{'type':Sequelize[_0xc567('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc567('0x4')]},'note':{'type':Sequelize[_0xc567('0x4')]},'read1stAt':{'type':Sequelize[_0xc567('0x3')]},'threadId':{'type':Sequelize[_0xc567('0x4')]},'externalUrl':{'type':Sequelize[_0xc567('0x4')]},'lastMsgAt':{'type':Sequelize[_0xc567('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc567('0x5')]('in',_0xc567('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc567('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc567('0x2')],'defaultValue':![]}};
\ No newline at end of file
index e7b4892..1bb2b72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9694=['map','Tags','push','TagIds','catch','index','OpenchannelInteraction','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','select','field','from','tools_tags','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','body','compact','forEach','i.OpenchannelAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','isEmpty','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','find','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','server','files','join','root','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','attachments','Attachment','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','closedAt','disposition','threadId','Public','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','send','Users'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0x9694,0xc2));var _0x4969=function(_0x473ac3,_0xf8066a){_0x473ac3=_0x473ac3-0x0;var _0x563cfd=_0x9694[_0x473ac3];return _0x563cfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4969('0x0'));var zipdir=require(_0x4969('0x1'));var jsonpatch=require(_0x4969('0x2'));var rp=require(_0x4969('0x3'));var moment=require(_0x4969('0x4'));var BPromise=require(_0x4969('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4969('0x6'));var csv=require(_0x4969('0x7'));var ejs=require(_0x4969('0x8'));var fs=require('fs');var fs_extra=require(_0x4969('0x9'));var _=require(_0x4969('0xa'));var squel=require(_0x4969('0xb'));var crypto=require(_0x4969('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4969('0xd'));var Papa=require('papaparse');var Redis=require(_0x4969('0xe'));var authService=require(_0x4969('0xf'));var qs=require(_0x4969('0x10'));var as=require(_0x4969('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x4969('0x12'));var logger=require('../../config/logger')(_0x4969('0x13'));var utils=require(_0x4969('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4969('0x15'));var db=require(_0x4969('0x16'))['db'];config['redis']=_['defaults'](config[_0x4969('0x17')],{'host':_0x4969('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4969('0x19'))[_0x4969('0x1a')](socket);function respondWithStatusCode(_0x4a2604,_0x14a4a3){_0x14a4a3=_0x14a4a3||0xcc;return function(_0x226373){if(_0x226373){return _0x4a2604[_0x4969('0x1b')](_0x14a4a3);}return _0x4a2604[_0x4969('0x1c')](_0x14a4a3)[_0x4969('0x1d')]();};}function respondWithResult(_0xa577aa,_0x32ab1e){_0x32ab1e=_0x32ab1e||0xc8;return function(_0x2849f5){if(_0x2849f5){return _0xa577aa[_0x4969('0x1c')](_0x32ab1e)[_0x4969('0x1e')](_0x2849f5);}};}function respondWithFilteredResult(_0x3d34d0,_0x559dde){return function(_0x44d0ee){if(_0x44d0ee){var _0x1b97ae=typeof _0x559dde[_0x4969('0x1f')]===_0x4969('0x20')&&typeof _0x559dde['limit']===_0x4969('0x20');var _0x51fc9a=_0x44d0ee['count'];var _0x2a30cc=_0x1b97ae?0x0:_0x559dde[_0x4969('0x1f')];var _0x28d081=_0x1b97ae?_0x44d0ee[_0x4969('0x21')]:_0x559dde['offset']+_0x559dde[_0x4969('0x22')];var _0x337671;if(_0x28d081>=_0x51fc9a){_0x28d081=_0x51fc9a;_0x337671=0xc8;}else{_0x337671=0xce;}_0x3d34d0[_0x4969('0x1c')](_0x337671);return _0x3d34d0['set'](_0x4969('0x23'),_0x2a30cc+'-'+_0x28d081+'/'+_0x51fc9a)['json'](_0x44d0ee);}return null;};}function patchUpdates(_0x378a79){return function(_0x1dc12a){try{jsonpatch[_0x4969('0x24')](_0x1dc12a,_0x378a79,!![]);}catch(_0x1efca1){return BPromise[_0x4969('0x25')](_0x1efca1);}return _0x1dc12a[_0x4969('0x26')]();};}function saveUpdates(_0x3b0739,_0x4cdb60){return function(_0xc60ec3){if(_0xc60ec3){return _0xc60ec3[_0x4969('0x27')](_0x3b0739)[_0x4969('0x28')](function(_0x10e242){return _0x10e242;});}return null;};}function removeEntity(_0x25e303,_0x15c57d){return function(_0xa092e6){if(_0xa092e6){return _0xa092e6[_0x4969('0x29')]()[_0x4969('0x28')](function(){_0x25e303['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a8610,_0x5f0ba2){return function(_0x590074){if(!_0x590074){_0x3a8610[_0x4969('0x1b')](0x194);}return _0x590074;};}function handleError(_0x32a194,_0xa3f858){_0xa3f858=_0xa3f858||0x1f4;return function(_0x1d3e0b){logger[_0x4969('0x2a')](_0x1d3e0b['stack']);if(_0x1d3e0b['name']){delete _0x1d3e0b['name'];}_0x32a194[_0x4969('0x1c')](_0xa3f858)[_0x4969('0x2b')](_0x1d3e0b);};}function getInteractionUsers(_0x3535be,_0x19f907){return new BPromise(function(_0x55f167,_0x1abad1){try{if(_0x19f907[_0x3535be['id']]){_0x3535be[_0x4969('0x2c')]=_[_0x4969('0x2d')](_0x19f907[_0x3535be['id']],function(_0x4c5eb3){return{'id':_0x4c5eb3['id'],'fullname':_0x4c5eb3['fullname']};});}}catch(_0x2831c9){_0x1abad1(_0x2831c9);}_0x55f167(_0x3535be);});}function getInteractionTags(_0x3a7565,_0x2494da){return new BPromise(function(_0x3d676e,_0x5a61f0){try{if(_0x3a7565['TagIds']){_0x3a7565[_0x4969('0x2e')]=[];_0x3a7565['TagIds']['split'](',')['forEach'](function(_0x5ce4a0){_0x3a7565[_0x4969('0x2e')][_0x4969('0x2f')](_0x2494da[_0x5ce4a0]);});}delete _0x3a7565[_0x4969('0x30')];}catch(_0x287bee){_0x5a61f0(_0x287bee);}_0x3d676e(_0x3a7565);});}function updateOpenchannelInteraction(_0x2fdcc8,_0x36bc86,_0x15f006){return new BPromise(function(_0x184df6,_0x48d9bc){return getInteractionUsers(_0x2fdcc8,_0x15f006)[_0x4969('0x28')](function(_0x6aa1bc){return getInteractionTags(_0x6aa1bc,_0x36bc86);})[_0x4969('0x28')](function(_0x2671a2){_0x184df6(_0x2671a2);})[_0x4969('0x31')](function(_0x5059e1){_0x48d9bc(_0x5059e1);});});}exports[_0x4969('0x32')]=function(_0x181dec,_0x4d7732){var _0x1e4a79={},_0x39c1e8={},_0x187b8a={'count':0x0,'rows':[]};var _0xef8adc=_[_0x4969('0x2d')](db[_0x4969('0x33')][_0x4969('0x34')],function(_0x5da378){return{'name':_0x5da378[_0x4969('0x35')],'type':_0x5da378['type']['key']};});_0x39c1e8[_0x4969('0x36')]=_['map'](_0xef8adc,_0x4969('0x37'));_0x39c1e8[_0x4969('0x38')]=_[_0x4969('0x39')](_0x181dec[_0x4969('0x38')]);_0x39c1e8[_0x4969('0x3a')]=_[_0x4969('0x3b')](_0x39c1e8[_0x4969('0x36')],_0x39c1e8[_0x4969('0x38')]);_0x1e4a79[_0x4969('0x3c')]=_['intersection'](_0x39c1e8[_0x4969('0x36')],qs['fields'](_0x181dec['query']['fields']));_0x1e4a79[_0x4969('0x3c')]=_0x1e4a79[_0x4969('0x3c')][_0x4969('0x3d')]?_0x1e4a79[_0x4969('0x3c')]:_0x39c1e8[_0x4969('0x36')];if(!_0x181dec[_0x4969('0x38')]['hasOwnProperty'](_0x4969('0x3e'))){_0x1e4a79['limit']=qs[_0x4969('0x22')](_0x181dec[_0x4969('0x38')]['limit']);_0x1e4a79[_0x4969('0x1f')]=qs[_0x4969('0x1f')](_0x181dec[_0x4969('0x38')]['offset']);}_0x1e4a79['order']=qs[_0x4969('0x3f')](_0x181dec[_0x4969('0x38')][_0x4969('0x3f')]);_0x1e4a79[_0x4969('0x40')]=qs[_0x4969('0x3a')](_[_0x4969('0x41')](_0x181dec[_0x4969('0x38')],_0x39c1e8[_0x4969('0x3a')]),_0xef8adc);var _0x3b1e3d=[];var _0x2cd0b4=squel[_0x4969('0x42')]()[_0x4969('0x43')]('id')[_0x4969('0x43')]('name')[_0x4969('0x43')]('color')[_0x4969('0x44')](_0x4969('0x45'));var _0x1760d3=squel[_0x4969('0x42')]()[_0x4969('0x43')]('u.id')[_0x4969('0x43')](_0x4969('0x46'))[_0x4969('0x43')]('ui.OpenchannelInteractionId')[_0x4969('0x44')]('user_has_openchannel_interactions','ui')[_0x4969('0x47')](_0x4969('0x48'),'u',_0x4969('0x49'));var _0x4e8ff5=squel[_0x4969('0x42')]()['from'](_0x4969('0x4a'),'i')[_0x4969('0x47')](_0x4969('0x4b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x4969('0x48'),'o',_0x4969('0x4c'))['left_join'](_0x4969('0x4d'),'a',_0x4969('0x4e'))[_0x4969('0x47')](_0x4969('0x4f'),'me',_0x4969('0x50'))[_0x4969('0x47')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x4969('0x47')](_0x4969('0x45'),'t',_0x4969('0x51'));var _0x17f4c7=squel[_0x4969('0x52')]();var _0x5226fb=[];var _0xc6ed6f=squel[_0x4969('0x52')]();var _0x54ad6c;if(_0x181dec[_0x4969('0x38')][_0x4969('0x53')]){_0x54ad6c=as[_0x4969('0x54')](_0x181dec[_0x4969('0x38')][_0x4969('0x53')]);var _0x2154d6=_0x54ad6c['sqlOperator'];for(var _0x2498e1=0x0;_0x2498e1<_0x54ad6c[_0x4969('0x55')]['length'];_0x2498e1++){var _0x3224a6=_0x54ad6c[_0x4969('0x55')][_0x2498e1];var _0x352979='i';var _0x93f3c4=_['find'](_0xef8adc,[_0x4969('0x37'),_0x3224a6[_0x4969('0x43')]]);if(!_0x93f3c4){switch(_0x3224a6[_0x4969('0x43')]){case _0x4969('0x56'):if(_0x3224a6[_0x4969('0x57')]==0x1){_0x4e8ff5[_0x4969('0x58')]('`'+_0x3224a6[_0x4969('0x43')]+_0x4969('0x59'));}else{_0x4e8ff5[_0x4969('0x58')]('`'+_0x3224a6[_0x4969('0x43')]+_0x4969('0x5a'));}break;case _0x4969('0x5b'):if(_0x3224a6[_0x4969('0x5c')]===_0x4969('0x5d')){if(_0x3224a6['value'][_0x4969('0x5e')]('\x20')[_0x4969('0x3d')]>0x1){_0x17f4c7[_0x2154d6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3224a6[_0x4969('0x57')]),null);}else{var _0x4f70aa='%'+_0x3224a6['value']+'%';_0x17f4c7[_0x2154d6](_0x4969('0x5f'),_0x4f70aa,_0x4f70aa,_0x4f70aa);}}else{_0x93f3c4=_['find'](_0xef8adc,['name',_0x4969('0x60')]);_0x3224a6[_0x4969('0x43')]=_0x4969('0x60');_0x14db60=as[_0x4969('0x61')](_0x352979,_0x93f3c4[_0x4969('0x62')],_0x3224a6);_0x17f4c7[_0x2154d6](_0x14db60[_0x4969('0x63')],_0x14db60[_0x4969('0x57')][_0x4969('0x64')],_0x14db60[_0x4969('0x57')][_0x4969('0x1d')]);}break;case _0x4969('0x65'):var _0x5e9d8d=_0x3224a6[_0x4969('0x57')][_0x4969('0x5e')](',')[_0x4969('0x2d')](function(_0x2c94d1){return Number(_0x2c94d1);});_0x5e9d8d['forEach'](function(_0xd97142){_0xc6ed6f['or'](_0x4969('0x66'),'%,'+_0xd97142+',%');});_0x5226fb=_['union'](_0x5226fb,_0x5e9d8d);break;case _0x4969('0x67'):if(_0x3224a6[_0x4969('0x5c')]===_0x4969('0x5d')){_0x17f4c7[_0x2154d6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3224a6[_0x4969('0x57')]+'%',null);}else{_0x93f3c4=_['find'](_0xef8adc,[_0x4969('0x37'),'UserId']);_0x3224a6[_0x4969('0x43')]=_0x4969('0x68');_0x14db60=as[_0x4969('0x61')](_0x352979,_0x93f3c4[_0x4969('0x62')],_0x3224a6);_0x17f4c7[_0x2154d6](_0x14db60[_0x4969('0x63')],_0x14db60[_0x4969('0x57')][_0x4969('0x64')],_0x14db60[_0x4969('0x57')][_0x4969('0x1d')]);}break;case _0x4969('0x69'):_0x14db60=as[_0x4969('0x61')]('me',null,_0x3224a6);_0x17f4c7[_0x2154d6](_0x14db60[_0x4969('0x63')],_0x14db60['value'][_0x4969('0x64')],_0x14db60[_0x4969('0x57')][_0x4969('0x1d')]);break;}}else{var _0x14db60=as['buildExpression'](_0x352979,_0x93f3c4[_0x4969('0x62')],_0x3224a6);_0x17f4c7[_0x2154d6](_0x14db60[_0x4969('0x63')],_0x14db60[_0x4969('0x57')][_0x4969('0x64')],_0x14db60[_0x4969('0x57')][_0x4969('0x1d')]);}}}else{var _0x52f8a7=_(_0x181dec[_0x4969('0x38')])[_0x4969('0x39')]()[_0x4969('0x2d')](function(_0x40d645){return _['some'](_0xef8adc,[_0x4969('0x37'),_0x40d645])?_0x40d645:undefined;})[_0x4969('0x6a')]()[_0x4969('0x57')]();if(!_['isEmpty'](_0x52f8a7)){_0x52f8a7[_0x4969('0x6b')](function(_0x2cbe2f){if(_0x2cbe2f==='OpenchannelAccountId'){_0x4e8ff5['where'](_0x4969('0x6c'),[][_0x4969('0x6d')](_0x181dec[_0x4969('0x38')][_0x2cbe2f]));}else if(_0x2cbe2f==='createdAt'){var _0x5846fe=JSON[_0x4969('0x6e')](_0x181dec[_0x4969('0x38')][_0x2cbe2f])['$gte'];var _0x78722e=JSON['parse'](_0x181dec[_0x4969('0x38')][_0x2cbe2f])['$lte'];_0x4e8ff5['where'](_0x4969('0x6f'),_0x5846fe,_0x78722e);}else{if(_0x181dec[_0x4969('0x38')][_0x2cbe2f]===_0x4969('0x70')){_0x4e8ff5[_0x4969('0x40')]('i.'+_0x2cbe2f+_0x4969('0x71'));}else{_0x4e8ff5[_0x4969('0x40')]('i.'+_0x2cbe2f+_0x4969('0x72'),_0x181dec[_0x4969('0x38')][_0x2cbe2f]);}}});}if(_0x181dec[_0x4969('0x38')][_0x4969('0x73')]){if(_0x181dec['query'][_0x4969('0x73')]==0x1){_0x4e8ff5[_0x4969('0x58')](_0x4969('0x74'));}else{_0x4e8ff5[_0x4969('0x58')](_0x4969('0x75'));}}if(_0x181dec[_0x4969('0x38')][_0x4969('0x76')]){_0x5226fb=_[_0x4969('0x77')](_0x181dec['query'][_0x4969('0x76')])?_0x181dec[_0x4969('0x38')]['tag']:new Array(_0x181dec[_0x4969('0x38')][_0x4969('0x76')]);_0x5226fb[_0x4969('0x6b')](function(_0x504b9f){_0xc6ed6f['or'](_0x4969('0x66'),'%,'+_0x504b9f+',%');});}if(_0x181dec[_0x4969('0x38')][_0x4969('0x78')]){var _0x2fb8e2=_0x181dec[_0x4969('0x38')][_0x4969('0x78')]['replace']('\x5c','\x5c\x5c')[_0x4969('0x79')](/'/g,'\x27\x27');if(qs[_0x4969('0x7a')](_0x2fb8e2)){_0x17f4c7['or'](_0x4969('0x7b'),_0x2fb8e2+'%');}else{_0x17f4c7['or'](_0x4969('0x7c'),qs[_0x4969('0x7d')](_0x2fb8e2))['or']('i.from\x20LIKE\x20?',_0x2fb8e2+'%')['or'](_0x4969('0x7e'),_0x2fb8e2+'%');}}}_0x4e8ff5[_0x4969('0x40')](_0x17f4c7);_0x4e8ff5[_0x4969('0x7f')](_0x4969('0x80'));var _0x5f44a3={'type':db[_0x4969('0x81')][_0x4969('0x82')]['SELECT'],'raw':!![]};var _0x33478f=_0x4e8ff5[_0x4969('0x83')]();_0x33478f[_0x4969('0x43')]('i.id');_0x33478f['field'](_0x4969('0x84'),_0x4969('0x56'));if(_0x1e4a79[_0x4969('0x85')]){_0x1e4a79[_0x4969('0x85')][_0x4969('0x6b')](function(_0x48b0a0){var _0x254131=_0x48b0a0[0x0]===_0x4969('0x86')?_0x48b0a0[0x0]:'i.'+_0x48b0a0[0x0];_0x4e8ff5[_0x4969('0x85')](_0x254131,_0x48b0a0[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4969('0x87')](_0x5226fb)){_0x4e8ff5['having'](_0xc6ed6f);_0x33478f['where'](_0x4969('0x88'),_0x5226fb);}BPromise[_0x4969('0x89')]()[_0x4969('0x28')](function(){if(!_0x54ad6c){if(_0x181dec[_0x4969('0x38')][_0x4969('0x8a')])return;_0x33478f['where'](_0x4969('0x8b'));_0x4e8ff5[_0x4969('0x40')](_0x4969('0x8b'));return;}if(_0x181dec['user'][_0x4969('0x8c')]!==_0x4969('0x8d'))return;return _0x181dec[_0x4969('0x8e')][_0x4969('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3b772b){if(_[_0x4969('0x87')](_0x3b772b)){_0x33478f['where'](_0x4969('0x90'));_0x4e8ff5[_0x4969('0x40')](_0x4969('0x90'));}else{_0x33478f[_0x4969('0x40')](_0x4969('0x6c'),_[_0x4969('0x2d')](_0x3b772b,'id'));_0x4e8ff5[_0x4969('0x40')](_0x4969('0x6c'),_[_0x4969('0x2d')](_0x3b772b,'id'));}});})['then'](function(){if(_0x181dec[_0x4969('0x8e')][_0x4969('0x8c')]===_0x4969('0x8d')&&!_0x54ad6c&&!_0x181dec[_0x4969('0x38')][_0x4969('0x8a')])return[];return db[_0x4969('0x91')]['query'](_0x33478f[_0x4969('0x92')](),_0x5f44a3);})[_0x4969('0x28')](function(_0x2c090c){_0x187b8a[_0x4969('0x21')]=_0x2c090c[_0x4969('0x3d')];if(_0x187b8a['count']===0x0)return[];return db[_0x4969('0x91')]['query'](_0x2cd0b4[_0x4969('0x92')](),_0x5f44a3)['then'](function(_0xba8b28){_0x3b1e3d=_['keyBy'](_0xba8b28,'id');_0x5f44a3=_[_0x4969('0x93')](_0x5f44a3,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x181dec[_0x4969('0x38')][_0x4969('0x94')]){_0x1e4a79[_0x4969('0x3c')][_0x4969('0x6b')](function(_0x1b1559){_0x4e8ff5['field']('i.'+_0x1b1559);});}else{_0x4e8ff5[_0x4969('0x43')](_0x4969('0x84'),_0x4969('0x56'));_0x4e8ff5['field'](_0x4969('0x95'),_0x4969('0x96'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0x97'),_0x4969('0x98'));_0x4e8ff5[_0x4969('0x43')]('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',_0x4969('0x86'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0x99'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0x9a'),_0x4969('0x9b'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0x9c'),_0x4969('0x9d'));_0x4e8ff5[_0x4969('0x43')]('c.email',_0x4969('0x9e'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0x9f'),_0x4969('0xa0'));_0x4e8ff5[_0x4969('0x43')]('c.mobile',_0x4969('0xa1'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0xa2'),_0x4969('0xa3'));_0x4e8ff5['field'](_0x4969('0xa4'),_0x4969('0xa5'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0xa6'),_0x4969('0xa7'));_0x4e8ff5[_0x4969('0x43')](_0x4969('0xa8'),_0x4969('0x30'));}if(_0x1e4a79[_0x4969('0x22')])_0x4e8ff5[_0x4969('0x22')](_0x1e4a79[_0x4969('0x22')]);if(_0x1e4a79['offset'])_0x4e8ff5['offset'](_0x1e4a79[_0x4969('0x1f')]);return db['sequelize'][_0x4969('0x38')](_0x4e8ff5['toString'](),_0x5f44a3);})['then'](function(_0x474c33){if(_0x474c33[_0x4969('0x3d')]>0x0)_0x1760d3['where'](_0x4969('0xa9'),_['map'](_0x474c33,'id'));return db[_0x4969('0x91')][_0x4969('0x38')](_0x1760d3[_0x4969('0x92')](),_0x5f44a3)[_0x4969('0x28')](function(_0x49637b){var _0x374a24=_[_0x4969('0xaa')](_0x49637b,_0x4969('0xab'));var _0x3ac736=[];_0x474c33['forEach'](function(_0x420d59){_0x3ac736['push'](updateOpenchannelInteraction(_0x420d59,_0x3b1e3d,_0x374a24));});return BPromise[_0x4969('0xac')](_0x3ac736);});});})[_0x4969('0x28')](function(_0x202610){_0x187b8a[_0x4969('0xad')]=_0x202610;return _0x187b8a;})[_0x4969('0x28')](respondWithFilteredResult(_0x4d7732,_0x1e4a79))[_0x4969('0x31')](handleError(_0x4d7732,null));};exports[_0x4969('0xae')]=function(_0x58fc1e,_0x17bef8){var _0x53c814={};if(_0x58fc1e[_0x4969('0x38')][_0x4969('0x62')]&&_0x58fc1e[_0x4969('0x38')][_0x4969('0x62')]==='from'){_0x53c814[_0x4969('0x44')]=_0x58fc1e[_0x4969('0xaf')]['id'];}else{_0x53c814['id']=_0x58fc1e['params']['id'];}var _0x93d052={'raw':![],'where':_0x53c814},_0x5cc91c={};_0x5cc91c[_0x4969('0x36')]=_[_0x4969('0x39')](db[_0x4969('0x33')][_0x4969('0x34')]);_0x5cc91c[_0x4969('0x38')]=_[_0x4969('0x39')](_0x58fc1e['query']);_0x5cc91c[_0x4969('0x3a')]=_[_0x4969('0x3b')](_0x5cc91c[_0x4969('0x36')],_0x5cc91c[_0x4969('0x38')]);_0x93d052['attributes']=_[_0x4969('0x3b')](_0x5cc91c[_0x4969('0x36')],qs[_0x4969('0x94')](_0x58fc1e[_0x4969('0x38')]['fields']));_0x93d052[_0x4969('0x3c')]=_0x93d052[_0x4969('0x3c')][_0x4969('0x3d')]?_0x93d052[_0x4969('0x3c')]:_0x5cc91c[_0x4969('0x36')];if(_0x58fc1e['query'][_0x4969('0xb0')]){_0x93d052[_0x4969('0xb1')]=[{'all':!![]}];}_0x93d052=_[_0x4969('0x93')]({},_0x93d052,_0x58fc1e[_0x4969('0xb2')]);return db['OpenchannelInteraction'][_0x4969('0xb3')](_0x93d052)[_0x4969('0x28')](handleEntityNotFound(_0x17bef8,null))[_0x4969('0x28')](respondWithResult(_0x17bef8,null))[_0x4969('0x31')](handleError(_0x17bef8,null));};exports[_0x4969('0xb4')]=function(_0x2d042e,_0x2facf6){return db['OpenchannelInteraction']['create'](_0x2d042e[_0x4969('0x69')],{})[_0x4969('0x28')](respondWithResult(_0x2facf6,0xc9))[_0x4969('0x31')](handleError(_0x2facf6,null));};exports[_0x4969('0x27')]=function(_0x3e5ce3,_0xe26b6d){if(_0x3e5ce3[_0x4969('0x69')]['id']){delete _0x3e5ce3[_0x4969('0x69')]['id'];}return db[_0x4969('0x33')][_0x4969('0xb3')]({'where':{'id':_0x3e5ce3[_0x4969('0xaf')]['id']}})[_0x4969('0x28')](handleEntityNotFound(_0xe26b6d,null))[_0x4969('0x28')](saveUpdates(_0x3e5ce3[_0x4969('0x69')],null))[_0x4969('0x28')](respondWithResult(_0xe26b6d,null))[_0x4969('0x31')](handleError(_0xe26b6d,null));};exports[_0x4969('0x29')]=function(_0x49faf8,_0x260501){return db[_0x4969('0x33')]['find']({'where':{'id':_0x49faf8[_0x4969('0xaf')]['id']}})[_0x4969('0x28')](handleEntityNotFound(_0x260501,null))[_0x4969('0x28')](removeEntity(_0x260501,null))[_0x4969('0x31')](handleError(_0x260501,null));};exports[_0x4969('0xb5')]=function(_0x519311,_0x526538){return db['OpenchannelInteraction'][_0x4969('0xb5')]()[_0x4969('0x28')](respondWithResult(_0x526538,null))['catch'](handleError(_0x526538,null));};exports[_0x4969('0xb6')]=function(_0x1c3373,_0x2abd2d,_0x509258){return db[_0x4969('0xb7')][_0x4969('0xb3')]({'where':{'id':_0x1c3373['params']['id']}})['then'](handleEntityNotFound(_0x2abd2d,null))[_0x4969('0x28')](function(_0x5f4f11){if(_0x5f4f11){return _0x5f4f11[_0x4969('0xb6')](_0x1c3373['body'][_0x4969('0xb8')],_[_0x4969('0xb9')](_0x1c3373[_0x4969('0x69')],[_0x4969('0xb8'),'id'])||{});}})[_0x4969('0x28')](respondWithResult(_0x2abd2d,null))[_0x4969('0x31')](handleError(_0x2abd2d,null));};exports[_0x4969('0xba')]=function(_0x4200b9,_0x18d5e9,_0x42a09f){var _0x4d2018={'raw':![],'where':{}};var _0x59c886={};var _0x197299={'count':0x0,'rows':[]};return db[_0x4969('0x33')][_0x4969('0xbb')]({'where':{'id':_0x4200b9[_0x4969('0xaf')]['id']}})[_0x4969('0x28')](handleEntityNotFound(_0x18d5e9,null))[_0x4969('0x28')](function(_0x3d3d8b){if(_0x3d3d8b){_0x59c886['model']=_[_0x4969('0x39')](db[_0x4969('0xb7')][_0x4969('0x34')]);_0x59c886[_0x4969('0x38')]=_[_0x4969('0x39')](_0x4200b9[_0x4969('0x38')]);_0x59c886[_0x4969('0x3a')]=_[_0x4969('0x3b')](_0x59c886[_0x4969('0x36')],_0x59c886['query']);_0x4d2018[_0x4969('0x3c')]=_[_0x4969('0x3b')](_0x59c886[_0x4969('0x36')],qs['fields'](_0x4200b9[_0x4969('0x38')][_0x4969('0x94')]));_0x4d2018[_0x4969('0x3c')]=_0x4d2018[_0x4969('0x3c')][_0x4969('0x3d')]?_0x4d2018[_0x4969('0x3c')]:_0x59c886[_0x4969('0x36')];if(!_0x4200b9['query'][_0x4969('0xbc')]('nolimit')){_0x4d2018[_0x4969('0x22')]=qs['limit'](_0x4200b9['query'][_0x4969('0x22')]);_0x4d2018['offset']=qs[_0x4969('0x1f')](_0x4200b9[_0x4969('0x38')][_0x4969('0x1f')]);}_0x4d2018[_0x4969('0x85')]=qs[_0x4969('0x3f')](_0x4200b9[_0x4969('0x38')][_0x4969('0x3f')]);_0x4d2018['where']=qs['filters'](_[_0x4969('0x41')](_0x4200b9[_0x4969('0x38')],_0x59c886[_0x4969('0x3a')]));_0x4d2018[_0x4969('0x40')]['OpenchannelInteractionId']=_0x3d3d8b['id'];if(_0x4200b9['query'][_0x4969('0x78')]){_0x4d2018['where']=_[_0x4969('0x93')](_0x4d2018[_0x4969('0x40')],{'$or':_['map'](_0x4d2018[_0x4969('0x3c')],function(_0x2bd64c){var _0x37ebbf={};_0x37ebbf[_0x2bd64c]={'$like':'%'+_0x4200b9[_0x4969('0x38')][_0x4969('0x78')]+'%'};return _0x37ebbf;})});}if(_0x4200b9[_0x4969('0x38')]['$gte']){var _0x3f8c45=_0x4200b9[_0x4969('0x38')][_0x4969('0xbd')][_0x4969('0x5e')](',');var _0x451cd3={};_0x451cd3[_0x3f8c45[0x0]]={'$gte':moment(_0x3f8c45[0x1])[_0x4969('0xbe')](_0x4969('0xbf'))};_0x4d2018[_0x4969('0x40')]=_[_0x4969('0x93')](_0x4d2018['where'],_0x451cd3);}_0x4d2018=_[_0x4969('0x93')]({},_0x4d2018,_0x4200b9[_0x4969('0xb2')]);return db['OpenchannelMessage'][_0x4969('0x21')]({'where':_0x4d2018[_0x4969('0x40')]})[_0x4969('0x28')](function(_0x53b664){_0x197299['count']=_0x53b664;if(_0x4200b9[_0x4969('0x38')]['includeAll']){_0x4d2018[_0x4969('0xb1')]=[{'all':!![]}];}return db[_0x4969('0xb7')][_0x4969('0xc0')](_0x4d2018);})[_0x4969('0x28')](function(_0x3d1aa7){_0x197299[_0x4969('0xad')]=_0x3d1aa7;return _0x197299;});}})[_0x4969('0x28')](respondWithFilteredResult(_0x18d5e9,_0x4d2018))[_0x4969('0x31')](handleError(_0x18d5e9,null));};exports['addTags']=function(_0x57eb92,_0x26acb2,_0x5971a7){return db[_0x4969('0x33')][_0x4969('0xb3')]({'where':{'id':_0x57eb92[_0x4969('0xaf')]['id']}})[_0x4969('0x28')](handleEntityNotFound(_0x26acb2,null))['then'](function(_0x5d6f83){if(_0x5d6f83){return _0x5d6f83['setTags'](_0x57eb92['body'][_0x4969('0xb8')],_[_0x4969('0xb9')](_0x57eb92[_0x4969('0x69')],[_0x4969('0xb8'),'id'])||{})[_0x4969('0xc1')](function(){return db['Tag'][_0x4969('0xc0')]({'attributes':['id',_0x4969('0x37'),_0x4969('0xc2')],'where':{'id':_0x57eb92[_0x4969('0x69')]['ids']}});})[_0x4969('0x28')](function(_0x220a4c){socket[_0x4969('0xc3')](_0x4969('0xc4'),{'id':Number(_0x57eb92[_0x4969('0xaf')]['id']),'tags':_0x220a4c||[]});return{'id':Number(_0x57eb92['params']['id']),'tags':_0x220a4c||[]};});}})[_0x4969('0x28')](respondWithResult(_0x26acb2,null))[_0x4969('0x31')](handleError(_0x26acb2,null));};exports[_0x4969('0xc5')]=function(_0x4dee63,_0xc00e0e,_0x345c87){return db['OpenchannelInteraction'][_0x4969('0xb3')]({'where':{'id':_0x4dee63['params']['id']}})[_0x4969('0x28')](handleEntityNotFound(_0xc00e0e,null))[_0x4969('0x28')](function(_0x9ce4cf){if(_0x9ce4cf){return _0x9ce4cf[_0x4969('0xc5')](_0x4dee63[_0x4969('0x38')][_0x4969('0xb8')]);}})[_0x4969('0x28')](respondWithStatusCode(_0xc00e0e,null))['catch'](handleError(_0xc00e0e,null));};exports['download']=function(_0xaccb6c,_0x2cce4d){var _0x4999aa=moment()[_0x4969('0xc6')]()[_0x4969('0x92')]();var _0x136e35=path['join'](config['root'],_0x4969('0xc7'),_0x4969('0xc8'),'tmp');var _0x7b359b=path[_0x4969('0xc9')](config[_0x4969('0xca')],'server',_0x4969('0xc8'),'attachments');var _0xcf282=path[_0x4969('0xc9')](_0x136e35,_0x4999aa);var _0x4b5a86=util[_0x4969('0xbe')](_0x4969('0xcb'),_0xaccb6c[_0x4969('0xaf')]['id'],_0x4999aa);var _0x2aed1e=path[_0x4969('0xc9')](_0x136e35,_0x4b5a86);var _0x13a1a0=[];_0x13a1a0[_0x4969('0x2f')]({'model':db[_0x4969('0x67')],'as':_0x4969('0x67'),'attributes':['id',_0x4969('0xcc')],'raw':!![]});_0x13a1a0[_0x4969('0x2f')]({'model':db[_0x4969('0xcd')],'as':_0x4969('0x5b'),'attributes':['id',_0x4969('0xce'),_0x4969('0xcf')],'raw':!![]});if(_0xaccb6c['query'][_0x4969('0xd0')]){_0x13a1a0['push']({'model':db[_0x4969('0xd1')],'as':'Attachment','raw':!![]});}var _0x42714f=[{'model':db[_0x4969('0xb7')],'as':'Messages','attributes':['id',_0x4969('0x69'),_0x4969('0xd2'),_0x4969('0xd3'),_0x4969('0xd4'),'read'],'include':_0x13a1a0}];_0x42714f[_0x4969('0x2f')]({'model':db[_0x4969('0xd5')],'as':_0x4969('0xd6'),'attributes':['id',_0x4969('0x37')]});_0x42714f['push']({'model':db[_0x4969('0x67')],'as':_0x4969('0xd7'),'attributes':['id',_0x4969('0xcc')]});return db['OpenchannelInteraction'][_0x4969('0xb3')]({'where':{'id':_0xaccb6c[_0x4969('0xaf')]['id']},'include':_0x42714f})['then'](handleEntityNotFound(_0x2cce4d,null))[_0x4969('0x28')](function(_0x86b79a){if(_0x86b79a){var _0x4c579d=_0x86b79a[_0x4969('0xd8')]({'plain':!![]});fs[_0x4969('0xd9')](_0xcf282);var _0x31ec3e={'channel':'Openchannel','account':_0x4c579d[_0x4969('0xd6')][_0x4969('0x37')],'agent':_0x4c579d[_0x4969('0xd7')]?_0x4c579d[_0x4969('0xd7')][_0x4969('0xcc')]:'N.A.','createdAt':moment(_0x4c579d[_0x4969('0xd2')])[_0x4969('0xbe')](_0x4969('0xbf'))['toString'](),'closedAt':_0x4c579d['closed']?moment(_0x4c579d[_0x4969('0xda')])[_0x4969('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x4c579d[_0x4969('0xdb')],'visibility':_0x4c579d[_0x4969('0xdc')]?_0x4969('0xdd'):'Private','messages':_(_0x4c579d[_0x4969('0xde')])['filter']({'secret':![]})[_0x4969('0x2d')](function(_0x1f3a05){if(_0x1f3a05[_0x4969('0xd1')]){var _0x176b2f=path[_0x4969('0xc9')](_0x7b359b,_0x1f3a05[_0x4969('0xd1')][_0x4969('0xdf')]);if(fs[_0x4969('0xe0')](_0x176b2f)){fs[_0x4969('0xe1')](_0x176b2f)[_0x4969('0xe2')](fs[_0x4969('0xe3')](path['join'](_0xcf282,_0x1f3a05[_0x4969('0xd1')][_0x4969('0xdf')])));}}return{'date':moment(_0x1f3a05['createdAt'])[_0x4969('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4969('0x92')](),'sender':_0x1f3a05[_0x4969('0xd3')]===_0x4969('0xe4')?_0x1f3a05[_0x4969('0x67')]?_0x1f3a05[_0x4969('0x67')][_0x4969('0xcc')]:_0x4969('0xe5'):_0x1f3a05[_0x4969('0x5b')][_0x4969('0xce')]+(_0x1f3a05[_0x4969('0x5b')]['lastName']?'\x20'+_0x1f3a05[_0x4969('0x5b')][_0x4969('0xcf')]:''),'body':_0x1f3a05[_0x4969('0xd1')]?_0x1f3a05[_0x4969('0xd1')][_0x4969('0xdf')]:_0x1f3a05[_0x4969('0x69')],'direction':_0x1f3a05[_0x4969('0xd3')]===_0x4969('0xe4')?'A':'C','secret':_0x1f3a05[_0x4969('0xd4')],'read':_0x1f3a05[_0x4969('0x73')],'attachment':_0x1f3a05[_0x4969('0xd1')]};})[_0x4969('0x57')]()};return ejs[_0x4969('0xe6')](path[_0x4969('0xc9')](config[_0x4969('0xca')],'server',_0x4969('0xe7'),_0x4969('0xe8')),{'interaction':_0x31ec3e})[_0x4969('0x28')](function(_0x1cc230){var _0x1e4a5e=path[_0x4969('0xc9')](_0xcf282,_0x4969('0xe9')+_0x4c579d['id']+'-'+_0x4999aa+_0x4969('0xea'));var _0x250caa={'path':_0x1e4a5e,'channel':'Openchannel','interactionId':_0x4c579d['id']};return pdf[_0x4969('0xeb')](_0x1cc230,_0x250caa);})['then'](function(){return new BPromise(function(_0x17ecfc,_0x3128f6){zipdir(_0xcf282,{'saveTo':_0x2aed1e},function(_0x53d15e,_0xc6bbd5){if(_0x53d15e)return _0x3128f6(_0x53d15e);return _0x17ecfc(_0xc6bbd5);});})['then'](function(){return new BPromise(function(_0x4b76dd,_0x2047d9){rimraf(_0xcf282,function(_0x8e65cf){if(_0x8e65cf)_0x2047d9(_0x8e65cf);return _0x4b76dd();});});})[_0x4969('0x28')](function(){return _0x2cce4d[_0x4969('0xec')](_0x2aed1e,_0x4b5a86,function(_0x3ca237){if(_0x3ca237){console[_0x4969('0xed')](_0x4969('0xee'),_0x3ca237);}else{fs['unlinkSync'](_0x2aed1e);}});});});}else{return _0x2cce4d['sendStatus'](0xc8);}})['catch'](handleError(_0x2cce4d,null));};
\ No newline at end of file
+var _0x6896=['getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','includeAll','merge','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','rawAttributes','pick','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','server','files','tmp','format','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Messages','createdAt','secret','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','Attachment','basename','existsSync','pipe','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','direction','out','System','transcript-','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','field','color','tools_tags','select','u.id','ui.OpenchannelInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','unreadMessages','value','having','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?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','order','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0x6896,0x142));var _0x6689=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6896[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x6689('0x0'));var rimraf=require(_0x6689('0x1'));var zipdir=require(_0x6689('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6689('0x3'));var moment=require('moment');var BPromise=require(_0x6689('0x4'));var Mustache=require(_0x6689('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6689('0x6'));var csv=require(_0x6689('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6689('0x8'));var _=require(_0x6689('0x9'));var squel=require(_0x6689('0xa'));var crypto=require(_0x6689('0xb'));var jsforce=require(_0x6689('0xc'));var deskjs=require(_0x6689('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6689('0xe'));var Papa=require(_0x6689('0xf'));var Redis=require('ioredis');var authService=require(_0x6689('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6689('0x11'));var pdf=require(_0x6689('0x12'));var hardwareService=require(_0x6689('0x13'));var logger=require(_0x6689('0x14'))(_0x6689('0x15'));var utils=require(_0x6689('0x16'));var config=require(_0x6689('0x17'));var licenseUtil=require(_0x6689('0x18'));var db=require(_0x6689('0x19'))['db'];config[_0x6689('0x1a')]=_['defaults'](config[_0x6689('0x1a')],{'host':_0x6689('0x1b'),'port':0x18eb});var socket=require(_0x6689('0x1c'))(new Redis(config[_0x6689('0x1a')]));require('./openchannelInteraction.socket')[_0x6689('0x1d')](socket);function respondWithStatusCode(_0x2ed5bc,_0x5d0091){_0x5d0091=_0x5d0091||0xcc;return function(_0x411ba2){if(_0x411ba2){return _0x2ed5bc[_0x6689('0x1e')](_0x5d0091);}return _0x2ed5bc['status'](_0x5d0091)[_0x6689('0x1f')]();};}function respondWithResult(_0x126217,_0x3e0f21){_0x3e0f21=_0x3e0f21||0xc8;return function(_0x49cdb0){if(_0x49cdb0){return _0x126217[_0x6689('0x20')](_0x3e0f21)['json'](_0x49cdb0);}};}function respondWithFilteredResult(_0x3c59ec,_0x353856){return function(_0x3deef9){if(_0x3deef9){var _0x8bce1f=typeof _0x353856[_0x6689('0x21')]===_0x6689('0x22')&&typeof _0x353856[_0x6689('0x23')]===_0x6689('0x22');var _0x2ba21a=_0x3deef9[_0x6689('0x24')];var _0x1b52cc=_0x8bce1f?0x0:_0x353856[_0x6689('0x21')];var _0x2521b1=_0x8bce1f?_0x3deef9[_0x6689('0x24')]:_0x353856[_0x6689('0x21')]+_0x353856[_0x6689('0x23')];var _0x3c19a2;if(_0x2521b1>=_0x2ba21a){_0x2521b1=_0x2ba21a;_0x3c19a2=0xc8;}else{_0x3c19a2=0xce;}_0x3c59ec['status'](_0x3c19a2);return _0x3c59ec[_0x6689('0x25')](_0x6689('0x26'),_0x1b52cc+'-'+_0x2521b1+'/'+_0x2ba21a)[_0x6689('0x27')](_0x3deef9);}return null;};}function patchUpdates(_0x209224){return function(_0x2bfd80){try{jsonpatch['apply'](_0x2bfd80,_0x209224,!![]);}catch(_0x10a5b0){return BPromise[_0x6689('0x28')](_0x10a5b0);}return _0x2bfd80[_0x6689('0x29')]();};}function saveUpdates(_0x1b209d,_0x5da91a){return function(_0x1c8639){if(_0x1c8639){return _0x1c8639['update'](_0x1b209d)[_0x6689('0x2a')](function(_0x1e00d8){return _0x1e00d8;});}return null;};}function removeEntity(_0xd2a5e0,_0x4da314){return function(_0x4c2706){if(_0x4c2706){return _0x4c2706[_0x6689('0x2b')]()[_0x6689('0x2a')](function(){_0xd2a5e0[_0x6689('0x20')](0xcc)[_0x6689('0x1f')]();});}};}function handleEntityNotFound(_0xb8dec8,_0x5aec23){return function(_0x427a8f){if(!_0x427a8f){_0xb8dec8[_0x6689('0x1e')](0x194);}return _0x427a8f;};}function handleError(_0x583c26,_0x21e3c1){_0x21e3c1=_0x21e3c1||0x1f4;return function(_0x1e280d){logger[_0x6689('0x2c')](_0x1e280d[_0x6689('0x2d')]);if(_0x1e280d[_0x6689('0x2e')]){delete _0x1e280d[_0x6689('0x2e')];}_0x583c26['status'](_0x21e3c1)[_0x6689('0x2f')](_0x1e280d);};}function getInteractionUsers(_0x1fd771,_0x2088ae){return new BPromise(function(_0x5b3b4f,_0x161e99){try{if(_0x2088ae[_0x1fd771['id']]){_0x1fd771[_0x6689('0x30')]=_['map'](_0x2088ae[_0x1fd771['id']],function(_0x39cfd9){return{'id':_0x39cfd9['id'],'fullname':_0x39cfd9[_0x6689('0x31')]};});}}catch(_0x19e799){_0x161e99(_0x19e799);}_0x5b3b4f(_0x1fd771);});}function getInteractionTags(_0x45696f,_0x3399b6){return new BPromise(function(_0x51dff4,_0x2759ff){try{if(_0x45696f[_0x6689('0x32')]){_0x45696f[_0x6689('0x33')]=[];_0x45696f[_0x6689('0x32')][_0x6689('0x34')](',')[_0x6689('0x35')](function(_0x4518af){_0x45696f['Tags'][_0x6689('0x36')](_0x3399b6[_0x4518af]);});}delete _0x45696f[_0x6689('0x32')];}catch(_0x165375){_0x2759ff(_0x165375);}_0x51dff4(_0x45696f);});}function updateOpenchannelInteraction(_0x19885c,_0x11a0d8,_0x4997e7){return new BPromise(function(_0x5b534a,_0x1f64e0){return getInteractionUsers(_0x19885c,_0x4997e7)['then'](function(_0x31e37c){return getInteractionTags(_0x31e37c,_0x11a0d8);})['then'](function(_0x2ac1f1){_0x5b534a(_0x2ac1f1);})[_0x6689('0x37')](function(_0x573fba){_0x1f64e0(_0x573fba);});});}exports[_0x6689('0x38')]=function(_0x176466,_0x2f69b9){var _0x291537={},_0x5f2e30={},_0x3891f5={'count':0x0,'rows':[]};var _0x3d3fa2=_['map'](db[_0x6689('0x39')]['rawAttributes'],function(_0x28bc9b){return{'name':_0x28bc9b[_0x6689('0x3a')],'type':_0x28bc9b[_0x6689('0x3b')][_0x6689('0x3c')]};});_0x5f2e30[_0x6689('0x3d')]=_[_0x6689('0x3e')](_0x3d3fa2,'name');_0x5f2e30['query']=_[_0x6689('0x3f')](_0x176466['query']);_0x5f2e30[_0x6689('0x40')]=_['intersection'](_0x5f2e30[_0x6689('0x3d')],_0x5f2e30[_0x6689('0x41')]);_0x291537[_0x6689('0x42')]=_[_0x6689('0x43')](_0x5f2e30[_0x6689('0x3d')],qs[_0x6689('0x44')](_0x176466[_0x6689('0x41')][_0x6689('0x44')]));_0x291537[_0x6689('0x42')]=_0x291537[_0x6689('0x42')][_0x6689('0x45')]?_0x291537[_0x6689('0x42')]:_0x5f2e30['model'];if(!_0x176466['query'][_0x6689('0x46')](_0x6689('0x47'))){_0x291537['limit']=qs[_0x6689('0x23')](_0x176466[_0x6689('0x41')][_0x6689('0x23')]);_0x291537[_0x6689('0x21')]=qs[_0x6689('0x21')](_0x176466[_0x6689('0x41')]['offset']);}_0x291537['order']=qs['sort'](_0x176466[_0x6689('0x41')][_0x6689('0x48')]);_0x291537['where']=qs['filters'](_['pick'](_0x176466[_0x6689('0x41')],_0x5f2e30[_0x6689('0x40')]),_0x3d3fa2);var _0x84a310=[];var _0x1076c0=squel['select']()['field']('id')[_0x6689('0x49')]('name')[_0x6689('0x49')](_0x6689('0x4a'))['from'](_0x6689('0x4b'));var _0x18326e=squel[_0x6689('0x4c')]()['field'](_0x6689('0x4d'))[_0x6689('0x49')]('u.fullname')[_0x6689('0x49')](_0x6689('0x4e'))[_0x6689('0x4f')]('user_has_openchannel_interactions','ui')[_0x6689('0x50')](_0x6689('0x51'),'u',_0x6689('0x52'));var _0x167954=squel[_0x6689('0x4c')]()[_0x6689('0x4f')]('openchannel_interactions','i')['left_join'](_0x6689('0x53'),'c',_0x6689('0x54'))[_0x6689('0x50')](_0x6689('0x51'),'o',_0x6689('0x55'))[_0x6689('0x50')](_0x6689('0x56'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x6689('0x50')]('openchannel_messages','me',_0x6689('0x57'))[_0x6689('0x50')](_0x6689('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x6689('0x50')]('tools_tags','t',_0x6689('0x59'));var _0x1eb7fd=squel[_0x6689('0x5a')]();var _0x282b68=[];var _0xf4eef9=squel[_0x6689('0x5a')]();var _0x32f369;if(_0x176466[_0x6689('0x41')]['search']){_0x32f369=as[_0x6689('0x5b')](_0x176466['query'][_0x6689('0x5c')]);var _0x1c8be7=_0x32f369[_0x6689('0x5d')];for(var _0x5957dd=0x0;_0x5957dd<_0x32f369['conditions']['length'];_0x5957dd++){var _0x245129=_0x32f369['conditions'][_0x5957dd];var _0x2a7469='i';var _0x226521=_['find'](_0x3d3fa2,['name',_0x245129['field']]);if(!_0x226521){switch(_0x245129[_0x6689('0x49')]){case _0x6689('0x5e'):if(_0x245129[_0x6689('0x5f')]==0x1){_0x167954[_0x6689('0x60')]('`'+_0x245129[_0x6689('0x49')]+'`\x20=\x200');}else{_0x167954[_0x6689('0x60')]('`'+_0x245129['field']+'`\x20>\x200');}break;case _0x6689('0x61'):if(_0x245129[_0x6689('0x62')]===_0x6689('0x63')){if(_0x245129[_0x6689('0x5f')][_0x6689('0x34')]('\x20')[_0x6689('0x45')]>0x1){_0x1eb7fd[_0x1c8be7](_0x6689('0x64'),qs[_0x6689('0x65')](_0x245129['value']),null);}else{var _0x549d22='%'+_0x245129['value']+'%';_0x1eb7fd[_0x1c8be7](_0x6689('0x66'),_0x549d22,_0x549d22,_0x549d22);}}else{_0x226521=_[_0x6689('0x67')](_0x3d3fa2,[_0x6689('0x2e'),_0x6689('0x68')]);_0x245129[_0x6689('0x49')]=_0x6689('0x68');_0x5604e9=as[_0x6689('0x69')](_0x2a7469,_0x226521['type'],_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9[_0x6689('0x6a')],_0x5604e9[_0x6689('0x5f')][_0x6689('0x6b')],_0x5604e9[_0x6689('0x5f')]['end']);}break;case _0x6689('0x6c'):var _0x2ceee7=_0x245129[_0x6689('0x5f')]['split'](',')[_0x6689('0x3e')](function(_0x165148){return Number(_0x165148);});_0x2ceee7[_0x6689('0x35')](function(_0x20ce5b){_0xf4eef9['or'](_0x6689('0x6d'),'%,'+_0x20ce5b+',%');});_0x282b68=_[_0x6689('0x6e')](_0x282b68,_0x2ceee7);break;case _0x6689('0x6f'):if(_0x245129['operator']===_0x6689('0x63')){_0x1eb7fd[_0x1c8be7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x245129[_0x6689('0x5f')]+'%',null);}else{_0x226521=_[_0x6689('0x67')](_0x3d3fa2,[_0x6689('0x2e'),'UserId']);_0x245129[_0x6689('0x49')]=_0x6689('0x70');_0x5604e9=as[_0x6689('0x69')](_0x2a7469,_0x226521[_0x6689('0x3b')],_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9[_0x6689('0x6a')],_0x5604e9[_0x6689('0x5f')]['start'],_0x5604e9[_0x6689('0x5f')][_0x6689('0x1f')]);}break;case _0x6689('0x71'):_0x5604e9=as[_0x6689('0x69')]('me',null,_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9[_0x6689('0x6a')],_0x5604e9[_0x6689('0x5f')][_0x6689('0x6b')],_0x5604e9[_0x6689('0x5f')]['end']);break;}}else{var _0x5604e9=as['buildExpression'](_0x2a7469,_0x226521['type'],_0x245129);_0x1eb7fd[_0x1c8be7](_0x5604e9['text'],_0x5604e9[_0x6689('0x5f')][_0x6689('0x6b')],_0x5604e9[_0x6689('0x5f')][_0x6689('0x1f')]);}}}else{var _0x4e6d00=_(_0x176466[_0x6689('0x41')])[_0x6689('0x3f')]()[_0x6689('0x3e')](function(_0x46c22b){return _[_0x6689('0x72')](_0x3d3fa2,[_0x6689('0x2e'),_0x46c22b])?_0x46c22b:undefined;})[_0x6689('0x73')]()['value']();if(!_[_0x6689('0x74')](_0x4e6d00)){_0x4e6d00['forEach'](function(_0xc22b2f){if(_0xc22b2f===_0x6689('0x75')){_0x167954[_0x6689('0x76')](_0x6689('0x77'),[][_0x6689('0x78')](_0x176466[_0x6689('0x41')][_0xc22b2f]));}else if(_0xc22b2f==='createdAt'){var _0x5521b7=JSON['parse'](_0x176466[_0x6689('0x41')][_0xc22b2f])[_0x6689('0x79')];var _0x33aea9=JSON[_0x6689('0x7a')](_0x176466['query'][_0xc22b2f])[_0x6689('0x7b')];_0x167954[_0x6689('0x76')](_0x6689('0x7c'),_0x5521b7,_0x33aea9);}else{if(_0x176466[_0x6689('0x41')][_0xc22b2f]===_0x6689('0x7d')){_0x167954['where']('i.'+_0xc22b2f+'\x20IS\x20NULL');}else{_0x167954[_0x6689('0x76')]('i.'+_0xc22b2f+_0x6689('0x7e'),_0x176466['query'][_0xc22b2f]);}}});}if(_0x176466[_0x6689('0x41')][_0x6689('0x7f')]){if(_0x176466[_0x6689('0x41')][_0x6689('0x7f')]==0x1){_0x167954[_0x6689('0x60')](_0x6689('0x80'));}else{_0x167954[_0x6689('0x60')](_0x6689('0x81'));}}if(_0x176466[_0x6689('0x41')][_0x6689('0x82')]){_0x282b68=_[_0x6689('0x83')](_0x176466[_0x6689('0x41')][_0x6689('0x82')])?_0x176466[_0x6689('0x41')][_0x6689('0x82')]:new Array(_0x176466['query'][_0x6689('0x82')]);_0x282b68[_0x6689('0x35')](function(_0x26d867){_0xf4eef9['or'](_0x6689('0x6d'),'%,'+_0x26d867+',%');});}if(_0x176466['query'][_0x6689('0x84')]){var _0x434b77=_0x176466['query'][_0x6689('0x84')][_0x6689('0x85')]('\x5c','\x5c\x5c')[_0x6689('0x85')](/'/g,'\x27\x27');if(qs[_0x6689('0x86')](_0x434b77)){_0x1eb7fd['or'](_0x6689('0x87'),_0x434b77+'%');}else{_0x1eb7fd['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x434b77))['or'](_0x6689('0x88'),_0x434b77+'%')['or'](_0x6689('0x89'),_0x434b77+'%');}}}_0x167954['where'](_0x1eb7fd);_0x167954[_0x6689('0x8a')](_0x6689('0x8b'));var _0x4a5e0d={'type':db[_0x6689('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5ebabd=_0x167954[_0x6689('0x8d')]();_0x5ebabd[_0x6689('0x49')](_0x6689('0x8b'));_0x5ebabd[_0x6689('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x291537[_0x6689('0x8e')]){_0x291537[_0x6689('0x8e')][_0x6689('0x35')](function(_0x4287b5){var _0x6f688b=_0x4287b5[0x0]===_0x6689('0x8f')?_0x4287b5[0x0]:'i.'+_0x4287b5[0x0];_0x167954[_0x6689('0x8e')](_0x6f688b,_0x4287b5[0x1]===_0x6689('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x282b68)){_0x167954[_0x6689('0x60')](_0xf4eef9);_0x5ebabd[_0x6689('0x76')]('t.id\x20IN\x20?',_0x282b68);}BPromise[_0x6689('0x91')]()[_0x6689('0x2a')](function(){if(!_0x32f369){if(_0x176466[_0x6689('0x41')][_0x6689('0x75')])return;_0x5ebabd[_0x6689('0x76')](_0x6689('0x92'));_0x167954['where'](_0x6689('0x92'));return;}if(_0x176466['user'][_0x6689('0x93')]!==_0x6689('0x94'))return;return _0x176466[_0x6689('0x95')][_0x6689('0x96')]({'attributes':['id'],'raw':!![]})[_0x6689('0x2a')](function(_0x4ffc14){if(_[_0x6689('0x74')](_0x4ffc14)){_0x5ebabd[_0x6689('0x76')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x167954['where'](_0x6689('0x97'));}else{_0x5ebabd['where'](_0x6689('0x77'),_['map'](_0x4ffc14,'id'));_0x167954[_0x6689('0x76')](_0x6689('0x77'),_[_0x6689('0x3e')](_0x4ffc14,'id'));}});})[_0x6689('0x2a')](function(){if(_0x176466[_0x6689('0x95')][_0x6689('0x93')]===_0x6689('0x94')&&!_0x32f369&&!_0x176466[_0x6689('0x41')]['OpenchannelAccountId'])return[];return db[_0x6689('0x98')]['query'](_0x5ebabd['toString'](),_0x4a5e0d);})[_0x6689('0x2a')](function(_0x81c8bf){_0x3891f5[_0x6689('0x24')]=_0x81c8bf['length'];if(_0x3891f5['count']===0x0)return[];return db[_0x6689('0x98')][_0x6689('0x41')](_0x1076c0[_0x6689('0x99')](),_0x4a5e0d)[_0x6689('0x2a')](function(_0x454701){_0x84a310=_['keyBy'](_0x454701,'id');_0x4a5e0d=_['merge'](_0x4a5e0d,{'model':db[_0x6689('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x176466[_0x6689('0x41')][_0x6689('0x44')]){_0x291537[_0x6689('0x42')][_0x6689('0x35')](function(_0x1466ff){_0x167954[_0x6689('0x49')]('i.'+_0x1466ff);});}else{_0x167954[_0x6689('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x167954[_0x6689('0x49')](_0x6689('0x9a'),_0x6689('0x9b'));_0x167954['field']('a.mandatoryDisposition',_0x6689('0x9c'));_0x167954['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x6689('0x8f'));_0x167954[_0x6689('0x49')](_0x6689('0x9d'));_0x167954[_0x6689('0x49')](_0x6689('0x9e'),_0x6689('0x9f'));_0x167954[_0x6689('0x49')]('c.lastName','Contact.lastName');_0x167954[_0x6689('0x49')](_0x6689('0xa0'),_0x6689('0xa1'));_0x167954['field']('c.phone',_0x6689('0xa2'));_0x167954[_0x6689('0x49')](_0x6689('0xa3'),_0x6689('0xa4'));_0x167954[_0x6689('0x49')](_0x6689('0xa5'),_0x6689('0xa6'));_0x167954[_0x6689('0x49')](_0x6689('0xa7'),_0x6689('0xa8'));_0x167954[_0x6689('0x49')](_0x6689('0xa9'),_0x6689('0xaa'));_0x167954[_0x6689('0x49')](_0x6689('0xab'),_0x6689('0x32'));}if(_0x291537[_0x6689('0x23')])_0x167954[_0x6689('0x23')](_0x291537['limit']);if(_0x291537[_0x6689('0x21')])_0x167954[_0x6689('0x21')](_0x291537[_0x6689('0x21')]);return db[_0x6689('0x98')][_0x6689('0x41')](_0x167954['toString'](),_0x4a5e0d);})['then'](function(_0x4785c4){if(_0x4785c4[_0x6689('0x45')]>0x0)_0x18326e[_0x6689('0x76')](_0x6689('0xac'),_['map'](_0x4785c4,'id'));return db[_0x6689('0x98')][_0x6689('0x41')](_0x18326e[_0x6689('0x99')](),_0x4a5e0d)[_0x6689('0x2a')](function(_0x41e611){var _0x3ff396=_[_0x6689('0xad')](_0x41e611,_0x6689('0xae'));var _0x14b9e8=[];_0x4785c4[_0x6689('0x35')](function(_0x5bbc91){_0x14b9e8[_0x6689('0x36')](updateOpenchannelInteraction(_0x5bbc91,_0x84a310,_0x3ff396));});return BPromise[_0x6689('0xaf')](_0x14b9e8);});});})[_0x6689('0x2a')](function(_0xcbb0d0){_0x3891f5[_0x6689('0xb0')]=_0xcbb0d0;return _0x3891f5;})['then'](respondWithFilteredResult(_0x2f69b9,_0x291537))[_0x6689('0x37')](handleError(_0x2f69b9,null));};exports['show']=function(_0x5915bd,_0xe8838){var _0x412af6={};if(_0x5915bd[_0x6689('0x41')][_0x6689('0x3b')]&&_0x5915bd[_0x6689('0x41')][_0x6689('0x3b')]===_0x6689('0x4f')){_0x412af6[_0x6689('0x4f')]=_0x5915bd[_0x6689('0xb1')]['id'];}else{_0x412af6['id']=_0x5915bd[_0x6689('0xb1')]['id'];}var _0x359b68={'raw':![],'where':_0x412af6},_0x50bc28={};_0x50bc28[_0x6689('0x3d')]=_[_0x6689('0x3f')](db[_0x6689('0x39')]['rawAttributes']);_0x50bc28['query']=_[_0x6689('0x3f')](_0x5915bd['query']);_0x50bc28[_0x6689('0x40')]=_[_0x6689('0x43')](_0x50bc28[_0x6689('0x3d')],_0x50bc28[_0x6689('0x41')]);_0x359b68[_0x6689('0x42')]=_[_0x6689('0x43')](_0x50bc28[_0x6689('0x3d')],qs[_0x6689('0x44')](_0x5915bd[_0x6689('0x41')][_0x6689('0x44')]));_0x359b68[_0x6689('0x42')]=_0x359b68[_0x6689('0x42')][_0x6689('0x45')]?_0x359b68[_0x6689('0x42')]:_0x50bc28['model'];if(_0x5915bd['query'][_0x6689('0xb2')]){_0x359b68['include']=[{'all':!![]}];}_0x359b68=_[_0x6689('0xb3')]({},_0x359b68,_0x5915bd['options']);return db[_0x6689('0x39')][_0x6689('0x67')](_0x359b68)[_0x6689('0x2a')](handleEntityNotFound(_0xe8838,null))[_0x6689('0x2a')](respondWithResult(_0xe8838,null))[_0x6689('0x37')](handleError(_0xe8838,null));};exports[_0x6689('0xb4')]=function(_0x2129a7,_0x584432){return db['OpenchannelInteraction'][_0x6689('0xb4')](_0x2129a7[_0x6689('0x71')],{})[_0x6689('0x2a')](respondWithResult(_0x584432,0xc9))['catch'](handleError(_0x584432,null));};exports[_0x6689('0xb5')]=function(_0x1c17b2,_0x2baf5e){if(_0x1c17b2[_0x6689('0x71')]['id']){delete _0x1c17b2['body']['id'];}return db[_0x6689('0x39')][_0x6689('0x67')]({'where':{'id':_0x1c17b2['params']['id']}})['then'](handleEntityNotFound(_0x2baf5e,null))['then'](saveUpdates(_0x1c17b2['body'],null))[_0x6689('0x2a')](respondWithResult(_0x2baf5e,null))[_0x6689('0x37')](handleError(_0x2baf5e,null));};exports[_0x6689('0x2b')]=function(_0x28570d,_0x56793b){return db[_0x6689('0x39')]['find']({'where':{'id':_0x28570d[_0x6689('0xb1')]['id']}})['then'](handleEntityNotFound(_0x56793b,null))[_0x6689('0x2a')](removeEntity(_0x56793b,null))[_0x6689('0x37')](handleError(_0x56793b,null));};exports['describe']=function(_0xe20595,_0x18b1a4){return db[_0x6689('0x39')][_0x6689('0xb6')]()[_0x6689('0x2a')](respondWithResult(_0x18b1a4,null))[_0x6689('0x37')](handleError(_0x18b1a4,null));};exports[_0x6689('0xb7')]=function(_0x3b6c6e,_0x57e1f6,_0x2abb6e){return db[_0x6689('0xb8')]['find']({'where':{'id':_0x3b6c6e[_0x6689('0xb1')]['id']}})[_0x6689('0x2a')](handleEntityNotFound(_0x57e1f6,null))[_0x6689('0x2a')](function(_0x968395){if(_0x968395){return _0x968395[_0x6689('0xb7')](_0x3b6c6e['body'][_0x6689('0xb9')],_[_0x6689('0xba')](_0x3b6c6e[_0x6689('0x71')],['ids','id'])||{});}})[_0x6689('0x2a')](respondWithResult(_0x57e1f6,null))[_0x6689('0x37')](handleError(_0x57e1f6,null));};exports[_0x6689('0xbb')]=function(_0x27268f,_0x133296,_0x32230a){var _0x13598d={'raw':![],'where':{}};var _0x566703={};var _0x3ef9ca={'count':0x0,'rows':[]};return db[_0x6689('0x39')]['findOne']({'where':{'id':_0x27268f['params']['id']}})[_0x6689('0x2a')](handleEntityNotFound(_0x133296,null))[_0x6689('0x2a')](function(_0x39b190){if(_0x39b190){_0x566703['model']=_[_0x6689('0x3f')](db[_0x6689('0xb8')][_0x6689('0xbc')]);_0x566703[_0x6689('0x41')]=_['keys'](_0x27268f['query']);_0x566703['filters']=_[_0x6689('0x43')](_0x566703[_0x6689('0x3d')],_0x566703[_0x6689('0x41')]);_0x13598d[_0x6689('0x42')]=_[_0x6689('0x43')](_0x566703['model'],qs[_0x6689('0x44')](_0x27268f[_0x6689('0x41')][_0x6689('0x44')]));_0x13598d[_0x6689('0x42')]=_0x13598d[_0x6689('0x42')][_0x6689('0x45')]?_0x13598d[_0x6689('0x42')]:_0x566703[_0x6689('0x3d')];if(!_0x27268f[_0x6689('0x41')][_0x6689('0x46')](_0x6689('0x47'))){_0x13598d['limit']=qs[_0x6689('0x23')](_0x27268f[_0x6689('0x41')][_0x6689('0x23')]);_0x13598d[_0x6689('0x21')]=qs[_0x6689('0x21')](_0x27268f[_0x6689('0x41')][_0x6689('0x21')]);}_0x13598d['order']=qs['sort'](_0x27268f[_0x6689('0x41')][_0x6689('0x48')]);_0x13598d[_0x6689('0x76')]=qs['filters'](_[_0x6689('0xbd')](_0x27268f['query'],_0x566703['filters']));_0x13598d[_0x6689('0x76')][_0x6689('0xae')]=_0x39b190['id'];if(_0x27268f[_0x6689('0x41')][_0x6689('0x84')]){_0x13598d[_0x6689('0x76')]=_['merge'](_0x13598d[_0x6689('0x76')],{'$or':_['map'](_0x13598d['attributes'],function(_0x470305){var _0x2c466a={};_0x2c466a[_0x470305]={'$like':'%'+_0x27268f['query'][_0x6689('0x84')]+'%'};return _0x2c466a;})});}if(_0x27268f[_0x6689('0x41')][_0x6689('0x79')]){var _0x4aba0f=_0x27268f[_0x6689('0x41')][_0x6689('0x79')][_0x6689('0x34')](',');var _0x1f0cf4={};_0x1f0cf4[_0x4aba0f[0x0]]={'$gte':moment(_0x4aba0f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x13598d['where']=_[_0x6689('0xb3')](_0x13598d[_0x6689('0x76')],_0x1f0cf4);}_0x13598d=_['merge']({},_0x13598d,_0x27268f['options']);return db[_0x6689('0xb8')][_0x6689('0x24')]({'where':_0x13598d[_0x6689('0x76')]})[_0x6689('0x2a')](function(_0x1b364e){_0x3ef9ca['count']=_0x1b364e;if(_0x27268f[_0x6689('0x41')][_0x6689('0xb2')]){_0x13598d['include']=[{'all':!![]}];}return db[_0x6689('0xb8')][_0x6689('0xbe')](_0x13598d);})[_0x6689('0x2a')](function(_0x424a3e){_0x3ef9ca[_0x6689('0xb0')]=_0x424a3e;return _0x3ef9ca;});}})['then'](respondWithFilteredResult(_0x133296,_0x13598d))['catch'](handleError(_0x133296,null));};exports[_0x6689('0xbf')]=function(_0x38a3f9,_0x1c033f,_0x2ed9e8){return db[_0x6689('0x39')]['find']({'where':{'id':_0x38a3f9[_0x6689('0xb1')]['id']}})['then'](handleEntityNotFound(_0x1c033f,null))['then'](function(_0x33fe34){if(_0x33fe34){return _0x33fe34['setTags'](_0x38a3f9['body'][_0x6689('0xb9')],_[_0x6689('0xba')](_0x38a3f9['body'],[_0x6689('0xb9'),'id'])||{})[_0x6689('0xc0')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x6689('0x4a')],'where':{'id':_0x38a3f9[_0x6689('0x71')]['ids']}});})[_0x6689('0x2a')](function(_0x1bd373){socket[_0x6689('0xc1')](_0x6689('0xc2'),{'id':Number(_0x38a3f9[_0x6689('0xb1')]['id']),'tags':_0x1bd373||[]});return{'id':Number(_0x38a3f9[_0x6689('0xb1')]['id']),'tags':_0x1bd373||[]};});}})[_0x6689('0x2a')](respondWithResult(_0x1c033f,null))[_0x6689('0x37')](handleError(_0x1c033f,null));};exports[_0x6689('0xc3')]=function(_0x2acfa2,_0x4a2f6a,_0x39925f){return db[_0x6689('0x39')][_0x6689('0x67')]({'where':{'id':_0x2acfa2[_0x6689('0xb1')]['id']}})[_0x6689('0x2a')](handleEntityNotFound(_0x4a2f6a,null))[_0x6689('0x2a')](function(_0x214ead){if(_0x214ead){return _0x214ead[_0x6689('0xc3')](_0x2acfa2[_0x6689('0x41')]['ids']);}})[_0x6689('0x2a')](respondWithStatusCode(_0x4a2f6a,null))['catch'](handleError(_0x4a2f6a,null));};exports[_0x6689('0xc4')]=function(_0x2f57d3,_0x54c46f){var _0x3f6fbd=moment()['unix']()['toString']();var _0xc6d655=path[_0x6689('0xc5')](config[_0x6689('0xc6')],_0x6689('0xc7'),_0x6689('0xc8'),_0x6689('0xc9'));var _0x5887c=path['join'](config[_0x6689('0xc6')],'server',_0x6689('0xc8'),'attachments');var _0x57a57c=path[_0x6689('0xc5')](_0xc6d655,_0x3f6fbd);var _0x4bb7ac=util[_0x6689('0xca')](_0x6689('0xcb'),_0x2f57d3['params']['id'],_0x3f6fbd);var _0x4502e0=path[_0x6689('0xc5')](_0xc6d655,_0x4bb7ac);var _0x1ff496=[];_0x1ff496[_0x6689('0x36')]({'model':db[_0x6689('0x6f')],'as':_0x6689('0x6f'),'attributes':['id',_0x6689('0x31')],'raw':!![]});_0x1ff496[_0x6689('0x36')]({'model':db[_0x6689('0xcc')],'as':_0x6689('0x61'),'attributes':['id',_0x6689('0xcd'),_0x6689('0xce')],'raw':!![]});if(_0x2f57d3[_0x6689('0x41')][_0x6689('0xcf')]){_0x1ff496[_0x6689('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4fff00=[{'model':db[_0x6689('0xb8')],'as':_0x6689('0xd0'),'attributes':['id','body',_0x6689('0xd1'),'direction',_0x6689('0xd2'),_0x6689('0x7f')],'include':_0x1ff496}];_0x4fff00['push']({'model':db[_0x6689('0xd3')],'as':_0x6689('0xd4'),'attributes':['id',_0x6689('0x2e')]});_0x4fff00[_0x6689('0x36')]({'model':db[_0x6689('0x6f')],'as':'Owner','attributes':['id',_0x6689('0x31')]});return db[_0x6689('0x39')][_0x6689('0x67')]({'where':{'id':_0x2f57d3[_0x6689('0xb1')]['id']},'include':_0x4fff00})[_0x6689('0x2a')](handleEntityNotFound(_0x54c46f,null))['then'](function(_0x71741d){if(_0x71741d){var _0x2c46ae=_0x71741d[_0x6689('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x57a57c);var _0x15183b={'channel':_0x6689('0xd6'),'account':_0x2c46ae['Account'][_0x6689('0x2e')],'agent':_0x2c46ae[_0x6689('0xd7')]?_0x2c46ae[_0x6689('0xd7')][_0x6689('0x31')]:_0x6689('0xd8'),'createdAt':moment(_0x2c46ae[_0x6689('0xd1')])[_0x6689('0xca')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2c46ae[_0x6689('0xd9')]?moment(_0x2c46ae[_0x6689('0xda')])[_0x6689('0xca')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6689('0x99')]():'','disposition':_0x2c46ae[_0x6689('0xdb')],'visibility':_0x2c46ae[_0x6689('0xdc')]?_0x6689('0xdd'):_0x6689('0xde'),'messages':_(_0x2c46ae[_0x6689('0xd0')])[_0x6689('0x84')]({'secret':![]})[_0x6689('0x3e')](function(_0x599468){if(_0x599468[_0x6689('0xdf')]){var _0x373a5e=path[_0x6689('0xc5')](_0x5887c,_0x599468[_0x6689('0xdf')][_0x6689('0xe0')]);if(fs[_0x6689('0xe1')](_0x373a5e)){fs['createReadStream'](_0x373a5e)[_0x6689('0xe2')](fs[_0x6689('0xe3')](path[_0x6689('0xc5')](_0x57a57c,_0x599468['Attachment'][_0x6689('0xe0')])));}}return{'date':moment(_0x599468[_0x6689('0xd1')])['format'](_0x6689('0xe4'))['toString'](),'sender':_0x599468[_0x6689('0xe5')]===_0x6689('0xe6')?_0x599468[_0x6689('0x6f')]?_0x599468[_0x6689('0x6f')][_0x6689('0x31')]:_0x6689('0xe7'):_0x599468[_0x6689('0x61')]['firstName']+(_0x599468[_0x6689('0x61')][_0x6689('0xce')]?'\x20'+_0x599468[_0x6689('0x61')]['lastName']:''),'body':_0x599468[_0x6689('0xdf')]?_0x599468[_0x6689('0xdf')][_0x6689('0xe0')]:_0x599468[_0x6689('0x71')],'direction':_0x599468['direction']===_0x6689('0xe6')?'A':'C','secret':_0x599468[_0x6689('0xd2')],'read':_0x599468['read'],'attachment':_0x599468[_0x6689('0xdf')]};})[_0x6689('0x5f')]()};return ejs['renderFile'](path['join'](config['root'],_0x6689('0xc7'),'views','downloadInteraction.ejs'),{'interaction':_0x15183b})['then'](function(_0x52f6e2){var _0x2648f1=path[_0x6689('0xc5')](_0x57a57c,_0x6689('0xe8')+_0x2c46ae['id']+'-'+_0x3f6fbd+'.pdf');var _0x502a66={'path':_0x2648f1,'channel':_0x6689('0xd6'),'interactionId':_0x2c46ae['id']};return pdf[_0x6689('0xe9')](_0x52f6e2,_0x502a66);})[_0x6689('0x2a')](function(){return new BPromise(function(_0x1f7732,_0x192d4d){zipdir(_0x57a57c,{'saveTo':_0x4502e0},function(_0x3e5e41,_0x2224ca){if(_0x3e5e41)return _0x192d4d(_0x3e5e41);return _0x1f7732(_0x2224ca);});})[_0x6689('0x2a')](function(){return new BPromise(function(_0x5358fb,_0x55cf86){rimraf(_0x57a57c,function(_0x1410c4){if(_0x1410c4)_0x55cf86(_0x1410c4);return _0x5358fb();});});})[_0x6689('0x2a')](function(){return _0x54c46f[_0x6689('0xc4')](_0x4502e0,_0x4bb7ac,function(_0x4c0871){if(_0x4c0871){console[_0x6689('0xea')]('err',_0x4c0871);}else{fs[_0x6689('0xeb')](_0x4502e0);}});});});}else{return _0x54c46f[_0x6689('0x1e')](0xc8);}})[_0x6689('0x37')](handleError(_0x54c46f,null));};
\ No newline at end of file
index 96441a5..31b0e7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38f7=['map','findAll','then','setDataValue','unreadMessages','length','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','remove','getUsers','Users'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0x38f7,0x88));var _0x738f=function(_0x1c6e62,_0x477309){_0x1c6e62=_0x1c6e62-0x0;var _0x55aa32=_0x38f7[_0x1c6e62];return _0x55aa32;};'use strict';var EventEmitter=require(_0x738f('0x0'));var OpenchannelInteraction=require(_0x738f('0x1'))['db'][_0x738f('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x738f('0x3')](0x0);var events={'afterCreate':_0x738f('0x4'),'afterUpdate':'update','afterDestroy':_0x738f('0x5')};function emitEvent(_0x2f4514){return function(_0x2ad67e,_0x2596c8,_0x4bd393){_0x2ad67e[_0x738f('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x208ca9){_0x2ad67e['setDataValue'](_0x738f('0x7'),_0x208ca9[_0x738f('0x8')](function(_0x398a99){return{'id':_0x398a99['id']};}));return OpenchannelMessage[_0x738f('0x9')]({'where':{'OpenchannelInteractionId':_0x2ad67e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x738f('0xa')](function(_0x59cf96){_0x2ad67e[_0x738f('0xb')](_0x738f('0xc'),_0x59cf96[_0x738f('0xd')]);OpenchannelInteractionEvents['emit'](_0x2f4514+':'+_0x2ad67e['id'],_0x2ad67e);OpenchannelInteractionEvents['emit'](_0x2f4514,_0x2ad67e);_0x4bd393(null);})['catch'](_0x4bd393(null));};}for(var e in events){if(events[_0x738f('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x738f('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xbf79=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xbf79,0x7a));var _0x9bf7=function(_0x3d8c2a,_0x3ab79e){_0x3d8c2a=_0x3d8c2a-0x0;var _0x7b82ec=_0xbf79[_0x3d8c2a];return _0x7b82ec;};'use strict';var EventEmitter=require(_0x9bf7('0x0'));var OpenchannelInteraction=require(_0x9bf7('0x1'))['db'][_0x9bf7('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x9bf7('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9bf7('0x4')](0x0);var events={'afterCreate':_0x9bf7('0x5'),'afterUpdate':_0x9bf7('0x6'),'afterDestroy':_0x9bf7('0x7')};function emitEvent(_0x33ae59){return function(_0x14d787,_0x331234,_0x215b3a){_0x14d787[_0x9bf7('0x8')]({'attributes':['id'],'raw':!![]})[_0x9bf7('0x9')](function(_0x5d1cfb){_0x14d787[_0x9bf7('0xa')]('Users',_0x5d1cfb[_0x9bf7('0xb')](function(_0x37a92f){return{'id':_0x37a92f['id']};}));return OpenchannelMessage[_0x9bf7('0xc')]({'where':{'OpenchannelInteractionId':_0x14d787['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9bf7('0x9')](function(_0x181eb2){_0x14d787[_0x9bf7('0xa')](_0x9bf7('0xd'),_0x181eb2[_0x9bf7('0xe')]);OpenchannelInteractionEvents['emit'](_0x33ae59+':'+_0x14d787['id'],_0x14d787);OpenchannelInteractionEvents['emit'](_0x33ae59,_0x14d787);_0x215b3a(null);})[_0x9bf7('0xf')](_0x215b3a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x9bf7('0x10')](e,emitEvent(event));}}module[_0x9bf7('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 4081e4f..c14f303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd606=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction'];(function(_0x3a27a5,_0x5378b0){var _0x80b863=function(_0x3050bc){while(--_0x3050bc){_0x3a27a5['push'](_0x3a27a5['shift']());}};_0x80b863(++_0x5378b0);}(_0xd606,0x10e));var _0x6d60=function(_0x37ee4f,_0x1ab30c){_0x37ee4f=_0x37ee4f-0x0;var _0x4e35da=_0xd606[_0x37ee4f];return _0x4e35da;};'use strict';var _=require(_0x6d60('0x0'));var util=require(_0x6d60('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6d60('0x2'));var BPromise=require(_0x6d60('0x3'));var rp=require(_0x6d60('0x4'));var fs=require('fs');var path=require(_0x6d60('0x5'));var rimraf=require(_0x6d60('0x6'));var config=require(_0x6d60('0x7'));var attributes=require(_0x6d60('0x8'));module['exports']=function(_0x49430a,_0x4911c8){return _0x49430a['define'](_0x6d60('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a00fc,_0x189754,_0x5948c9){if(_0x4a00fc[_0x6d60('0xa')](_0x6d60('0xb'))){_0x4a00fc['closedAt']=moment()[_0x6d60('0xc')](_0x6d60('0xd'));}_0x5948c9(null,_0x4a00fc);}}});};
\ No newline at end of file
+var _0x79df=['define','OpenchannelInteraction','openchannel_interactions','changed','closed','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x35e54a,_0x46953a){var _0x35c2b0=function(_0x3c0ab9){while(--_0x3c0ab9){_0x35e54a['push'](_0x35e54a['shift']());}};_0x35c2b0(++_0x46953a);}(_0x79df,0x1e1));var _0xf79d=function(_0x4980d2,_0xa6c0e4){_0x4980d2=_0x4980d2-0x0;var _0x4690d1=_0x79df[_0x4980d2];return _0x4690d1;};'use strict';var _=require(_0xf79d('0x0'));var util=require(_0xf79d('0x1'));var logger=require(_0xf79d('0x2'))(_0xf79d('0x3'));var moment=require(_0xf79d('0x4'));var BPromise=require(_0xf79d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf79d('0x6'));var rimraf=require('rimraf');var config=require(_0xf79d('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xf79d('0x8')]=function(_0x894c7a,_0xec5657){return _0x894c7a[_0xf79d('0x9')](_0xf79d('0xa'),attributes,{'tableName':_0xf79d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35d55e,_0x32a704,_0x4cdab0){if(_0x35d55e[_0xf79d('0xc')](_0xf79d('0xd'))){_0x35d55e['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4cdab0(null,_0x35d55e);}}});};
\ No newline at end of file
index 0290cf4..be2919c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ae5=['error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','debug','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9ae5,0xd0));var _0x59ae=function(_0x32659e,_0x54629a){_0x32659e=_0x32659e-0x0;var _0xc5183b=_0x9ae5[_0x32659e];return _0xc5183b;};'use strict';var _=require(_0x59ae('0x0'));var util=require(_0x59ae('0x1'));var moment=require(_0x59ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x59ae('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59ae('0x4'))['db'];var utils=require(_0x59ae('0x5'));var logger=require('../../config/logger')(_0x59ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x59ae('0x7'));var client=jayson[_0x59ae('0x8')]['http']({'port':0x232a});config[_0x59ae('0x9')]=_[_0x59ae('0xa')](config[_0x59ae('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x59ae('0xb'))(new Redis(config[_0x59ae('0x9')]));require(_0x59ae('0xc'))[_0x59ae('0xd')](socket);function respondWithRpcPromise(_0x44351c,_0x51af52,_0x4d722c){return new BPromise(function(_0x139121,_0x5c96ca){return client[_0x59ae('0xe')](_0x44351c,_0x4d722c)[_0x59ae('0xf')](function(_0x54eae3){logger[_0x59ae('0x10')](_0x59ae('0x11'),_0x51af52,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x51af52,_0x59ae('0x12'),JSON[_0x59ae('0x13')](_0x54eae3));if(_0x54eae3[_0x59ae('0x14')]){if(_0x54eae3[_0x59ae('0x14')][_0x59ae('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x51af52,_0x54eae3[_0x59ae('0x14')][_0x59ae('0x16')]);return _0x5c96ca(_0x54eae3[_0x59ae('0x14')][_0x59ae('0x16')]);}logger[_0x59ae('0x14')](_0x59ae('0x11'),_0x51af52,_0x54eae3[_0x59ae('0x14')][_0x59ae('0x16')]);return _0x139121(_0x54eae3[_0x59ae('0x14')][_0x59ae('0x16')]);}else{logger[_0x59ae('0x10')](_0x59ae('0x11'),_0x51af52,_0x59ae('0x12'));_0x139121(_0x54eae3[_0x59ae('0x17')][_0x59ae('0x16')]);}})[_0x59ae('0x18')](function(_0x42b17f){logger['error'](_0x59ae('0x11'),_0x51af52,_0x42b17f);_0x5c96ca(_0x42b17f);});});}exports[_0x59ae('0x19')]=function(_0x198c11){var _0x429e3d=this;return new Promise(function(_0x45ea36,_0xbf06b8){return db[_0x59ae('0x1a')]['update'](_0x198c11[_0x59ae('0x1b')],{'raw':_0x198c11[_0x59ae('0x1c')]?_0x198c11['options'][_0x59ae('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x198c11[_0x59ae('0x1c')]?_0x198c11[_0x59ae('0x1c')][_0x59ae('0x1e')]||null:null,'attributes':_0x198c11[_0x59ae('0x1c')]?_0x198c11[_0x59ae('0x1c')][_0x59ae('0x1f')]||null:null,'limit':_0x198c11['options']?_0x198c11[_0x59ae('0x1c')]['limit']||null:null})[_0x59ae('0xf')](function(_0x498633){logger[_0x59ae('0x10')](_0x59ae('0x19'),_0x198c11);logger[_0x59ae('0x20')]('UpdateOpenchannelInteraction',_0x198c11,JSON[_0x59ae('0x13')](_0x498633));_0x45ea36(_0x498633);})[_0x59ae('0x18')](function(_0x128204){logger[_0x59ae('0x14')](_0x59ae('0x19'),_0x128204[_0x59ae('0x16')],_0x198c11);_0xbf06b8(_0x429e3d[_0x59ae('0x14')](0x1f4,_0x128204['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x32ca6d){return new Promise(function(_0x115171,_0x7fcd16){return db[_0x59ae('0x1a')]['find']({'where':_0x32ca6d['options']?_0x32ca6d[_0x59ae('0x1c')][_0x59ae('0x1e')]||null:null})[_0x59ae('0xf')](function(_0x1d6904){if(_0x1d6904){return _0x1d6904[_0x59ae('0x21')](_0x32ca6d[_0x59ae('0x1b')][_0x59ae('0x22')],_[_0x59ae('0x23')](_0x32ca6d[_0x59ae('0x1b')],[_0x59ae('0x22'),'id'])||{});}})[_0x59ae('0x24')](function(_0x354bce){logger[_0x59ae('0x10')](_0x59ae('0x25'),_0x32ca6d);logger[_0x59ae('0x20')](_0x59ae('0x25'),_0x32ca6d,JSON[_0x59ae('0x13')](_0x354bce));_0x115171(_0x354bce);})[_0x59ae('0x18')](function(_0x59bad1){logger[_0x59ae('0x14')](_0x59ae('0x25'),_0x59bad1[_0x59ae('0x16')],_0x32ca6d);_0x7fcd16(_this['error'](0x1f4,_0x59bad1[_0x59ae('0x16')]));});});};
\ No newline at end of file
+var _0x5caf=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','limit','debug','OpenchannelInteraction','find','where','addTags','ids','omit','AddTags','util','bluebird','randomstring'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x5caf,0x1c5));var _0xf5ca=function(_0x16bac6,_0x377bca){_0x16bac6=_0x16bac6-0x0;var _0xc08a6d=_0x5caf[_0x16bac6];return _0xc08a6d;};'use strict';var _=require('lodash');var util=require(_0xf5ca('0x0'));var moment=require('moment');var BPromise=require(_0xf5ca('0x1'));var rs=require(_0xf5ca('0x2'));var fs=require('fs');var Redis=require(_0xf5ca('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf5ca('0x4'));var logger=require(_0xf5ca('0x5'))(_0xf5ca('0x6'));var config=require(_0xf5ca('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf5ca('0x8')][_0xf5ca('0x9')]({'port':0x232a});config[_0xf5ca('0xa')]=_[_0xf5ca('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf5ca('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xf5ca('0xd')](socket);function respondWithRpcPromise(_0xff80ce,_0x29c2d7,_0x233411){return new BPromise(function(_0x2600af,_0x579bcc){return client['request'](_0xff80ce,_0x233411)[_0xf5ca('0xe')](function(_0x5da295){logger[_0xf5ca('0xf')](_0xf5ca('0x10'),_0x29c2d7,_0xf5ca('0x11'));logger['debug'](_0xf5ca('0x12'),_0x29c2d7,_0xf5ca('0x11'),JSON[_0xf5ca('0x13')](_0x5da295));if(_0x5da295[_0xf5ca('0x14')]){if(_0x5da295[_0xf5ca('0x14')][_0xf5ca('0x15')]===0x1f4){logger['error'](_0xf5ca('0x10'),_0x29c2d7,_0x5da295['error'][_0xf5ca('0x16')]);return _0x579bcc(_0x5da295[_0xf5ca('0x14')][_0xf5ca('0x16')]);}logger[_0xf5ca('0x14')](_0xf5ca('0x10'),_0x29c2d7,_0x5da295[_0xf5ca('0x14')][_0xf5ca('0x16')]);return _0x2600af(_0x5da295['error'][_0xf5ca('0x16')]);}else{logger[_0xf5ca('0xf')](_0xf5ca('0x10'),_0x29c2d7,_0xf5ca('0x11'));_0x2600af(_0x5da295[_0xf5ca('0x17')]['message']);}})[_0xf5ca('0x18')](function(_0x55f4f3){logger[_0xf5ca('0x14')](_0xf5ca('0x10'),_0x29c2d7,_0x55f4f3);_0x579bcc(_0x55f4f3);});});}exports[_0xf5ca('0x19')]=function(_0x184508){var _0x42b4af=this;return new Promise(function(_0x51862b,_0x3cb120){return db['OpenchannelInteraction'][_0xf5ca('0x1a')](_0x184508[_0xf5ca('0x1b')],{'raw':_0x184508['options']?_0x184508['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x184508[_0xf5ca('0x1c')]?_0x184508[_0xf5ca('0x1c')]['where']||null:null,'attributes':_0x184508[_0xf5ca('0x1c')]?_0x184508[_0xf5ca('0x1c')]['attributes']||null:null,'limit':_0x184508['options']?_0x184508[_0xf5ca('0x1c')][_0xf5ca('0x1d')]||null:null})[_0xf5ca('0xe')](function(_0x349a2b){logger[_0xf5ca('0xf')](_0xf5ca('0x19'),_0x184508);logger[_0xf5ca('0x1e')](_0xf5ca('0x19'),_0x184508,JSON['stringify'](_0x349a2b));_0x51862b(_0x349a2b);})[_0xf5ca('0x18')](function(_0x420e6c){logger['error']('UpdateOpenchannelInteraction',_0x420e6c[_0xf5ca('0x16')],_0x184508);_0x3cb120(_0x42b4af['error'](0x1f4,_0x420e6c[_0xf5ca('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x11fb16){return new Promise(function(_0x18d442,_0x90b272){return db[_0xf5ca('0x1f')][_0xf5ca('0x20')]({'where':_0x11fb16[_0xf5ca('0x1c')]?_0x11fb16[_0xf5ca('0x1c')][_0xf5ca('0x21')]||null:null})['then'](function(_0x34609f){if(_0x34609f){return _0x34609f[_0xf5ca('0x22')](_0x11fb16['body'][_0xf5ca('0x23')],_[_0xf5ca('0x24')](_0x11fb16[_0xf5ca('0x1b')],[_0xf5ca('0x23'),'id'])||{});}})['spread'](function(_0x126f5d){logger['info'](_0xf5ca('0x25'),_0x11fb16);logger[_0xf5ca('0x1e')](_0xf5ca('0x25'),_0x11fb16,JSON['stringify'](_0x126f5d));_0x18d442(_0x126f5d);})['catch'](function(_0x25c7ad){logger[_0xf5ca('0x14')](_0xf5ca('0x25'),_0x25c7ad[_0xf5ca('0x16')],_0x11fb16);_0x90b272(_this[_0xf5ca('0x14')](0x1f4,_0x25c7ad[_0xf5ca('0x16')]));});});};
\ No newline at end of file
index 8a43110..3dd7c56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca92=['length','openchannelInteraction:','./openchannelInteraction.events','emit','removeListener'];(function(_0x5103a3,_0x1faf7b){var _0x16c6d3=function(_0x1d42c9){while(--_0x1d42c9){_0x5103a3['push'](_0x5103a3['shift']());}};_0x16c6d3(++_0x1faf7b);}(_0xca92,0x11f));var _0x2ca9=function(_0x499c7f,_0x2d8184){_0x499c7f=_0x499c7f-0x0;var _0x433bee=_0xca92[_0x499c7f];return _0x433bee;};'use strict';var OpenchannelInteractionEvents=require(_0x2ca9('0x0'));var events=['save','remove','update'];function createListener(_0x76d19f,_0x565410){return function(_0xffb094){_0x565410[_0x2ca9('0x1')](_0x76d19f,_0xffb094);};}function removeListener(_0x24cc93,_0x2b459a){return function(){OpenchannelInteractionEvents[_0x2ca9('0x2')](_0x24cc93,_0x2b459a);};}exports['register']=function(_0x1118dd){for(var _0x2ef860=0x0,_0x567d8b=events[_0x2ca9('0x3')];_0x2ef860<_0x567d8b;_0x2ef860++){var _0x1a3b66=events[_0x2ef860];var _0x19041f=createListener(_0x2ca9('0x4')+_0x1a3b66,_0x1118dd);OpenchannelInteractionEvents['on'](_0x1a3b66,_0x19041f);}};
\ No newline at end of file
+var _0x9ce5=['length','./openchannelInteraction.events','save','remove','removeListener','register'];(function(_0x22fc88,_0xae9f18){var _0x3b2709=function(_0x22f15b){while(--_0x22f15b){_0x22fc88['push'](_0x22fc88['shift']());}};_0x3b2709(++_0xae9f18);}(_0x9ce5,0xc7));var _0x59ce=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x9ce5[_0x5eb22e];return _0x27fed5;};'use strict';var OpenchannelInteractionEvents=require(_0x59ce('0x0'));var events=[_0x59ce('0x1'),_0x59ce('0x2'),'update'];function createListener(_0x2b3ca9,_0x11e43d){return function(_0x485578){_0x11e43d['emit'](_0x2b3ca9,_0x485578);};}function removeListener(_0x3b261c,_0x31a8ad){return function(){OpenchannelInteractionEvents[_0x59ce('0x3')](_0x3b261c,_0x31a8ad);};}exports[_0x59ce('0x4')]=function(_0x37ed18){for(var _0x1df6fa=0x0,_0xae0137=events[_0x59ce('0x5')];_0x1df6fa<_0xae0137;_0x1df6fa++){var _0x25f558=events[_0x1df6fa];var _0x41f31c=createListener('openchannelInteraction:'+_0x25f558,_0x37ed18);OpenchannelInteractionEvents['on'](_0x25f558,_0x41f31c);}};
\ No newline at end of file
index 5a0346d..324f628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x20861d,_0x61e9db){var _0x5cffbb=function(_0x2f3e5d){while(--_0x2f3e5d){_0x20861d['push'](_0x20861d['shift']());}};_0x5cffbb(++_0x61e9db);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x2387c5,_0xfcc74c){var _0x2c414c=function(_0x3d1881){while(--_0x3d1881){_0x2387c5['push'](_0x2387c5['shift']());}};_0x2c414c(++_0xfcc74c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xcb91[_0xc82d1a];return _0x32fad2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router;
\ No newline at end of file
index 87d1e06..9eccfe0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ac=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0xc4a86a,_0x219afb){var _0x25dd10=function(_0x4a0087){while(--_0x4a0087){_0xc4a86a['push'](_0xc4a86a['shift']());}};_0x25dd10(++_0x219afb);}(_0x48ac,0xe0));var _0xc48a=function(_0x33bfae,_0x557d6b){_0x33bfae=_0x33bfae-0x0;var _0x1aa7f3=_0x48ac[_0x33bfae];return _0x1aa7f3;};'use strict';var Sequelize=require('sequelize');module[_0xc48a('0x0')]={'body':{'type':Sequelize['TEXT'](_0xc48a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc48a('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc48a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc48a('0x3')),'defaultValue':_0xc48a('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc48a('0x4')]},'providerName':{'type':Sequelize[_0xc48a('0x5')]},'providerResponse':{'type':Sequelize[_0xc48a('0x6')]}};
\ No newline at end of file
+var _0x26f9=['exports','medium','ENUM','out','DATE','STRING','TEXT','sequelize'];(function(_0x53c389,_0xb8e5d){var _0x37ecf6=function(_0x5b67a5){while(--_0x5b67a5){_0x53c389['push'](_0x53c389['shift']());}};_0x37ecf6(++_0xb8e5d);}(_0x26f9,0x16f));var _0x926f=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0x26f9[_0x4ec520];return _0xed49d7;};'use strict';var Sequelize=require(_0x926f('0x0'));module[_0x926f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x926f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x926f('0x3')]('in',_0x926f('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x926f('0x5')]},'providerName':{'type':Sequelize[_0x926f('0x6')]},'providerResponse':{'type':Sequelize[_0x926f('0x7')]}};
\ No newline at end of file
index 57fb974..6f3b309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0710=['Sequelize','QueryTypes','SELECT','contact','User','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','fullname','internal','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','register','client','http','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','OpenchannelMessage','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows','params','rawAttributes','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','update','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize'];(function(_0x3fcf72,_0x3c133e){var _0x33bdd2=function(_0x105baa){while(--_0x105baa){_0x3fcf72['push'](_0x3fcf72['shift']());}};_0x33bdd2(++_0x3c133e);}(_0x0710,0x19f));var _0x0071=function(_0x9791c4,_0x283c9f){_0x9791c4=_0x9791c4-0x0;var _0x36d7c9=_0x0710[_0x9791c4];return _0x36d7c9;};'use strict';var emlformat=require(_0x0071('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0071('0x1'));var jsonpatch=require(_0x0071('0x2'));var rp=require(_0x0071('0x3'));var moment=require(_0x0071('0x4'));var BPromise=require(_0x0071('0x5'));var Mustache=require('mustache');var util=require(_0x0071('0x6'));var path=require(_0x0071('0x7'));var sox=require('sox');var csv=require(_0x0071('0x8'));var ejs=require(_0x0071('0x9'));var fs=require('fs');var fs_extra=require(_0x0071('0xa'));var _=require(_0x0071('0xb'));var squel=require('squel');var crypto=require(_0x0071('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0071('0xd'));var toCsv=require(_0x0071('0x8'));var querystring=require(_0x0071('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0071('0xf'));var qs=require(_0x0071('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0071('0x11'));var logger=require(_0x0071('0x12'))(_0x0071('0x13'));var utils=require(_0x0071('0x14'));var config=require(_0x0071('0x15'));var licenseUtil=require(_0x0071('0x16'));var db=require(_0x0071('0x17'))['db'];config['redis']=_[_0x0071('0x18')](config['redis'],{'host':_0x0071('0x19'),'port':0x18eb});var socket=require(_0x0071('0x1a'))(new Redis(config[_0x0071('0x1b')]));require(_0x0071('0x1c'))[_0x0071('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0071('0x1e')][_0x0071('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f1ccd,_0x39dc5d,_0x358553,_0x55c524){return new BPromise(function(_0x282de8,_0x2217aa){var _0xb625fc=_0x55c524||client;return _0xb625fc['request'](_0x5f1ccd,_0x358553)[_0x0071('0x20')](function(_0x149dee){logger[_0x0071('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x39dc5d,_0x0071('0x22'));logger[_0x0071('0x23')](_0x0071('0x24'),_0x39dc5d,'request\x20sent',JSON[_0x0071('0x25')](_0x149dee));if(_0x149dee[_0x0071('0x26')]){if(_0x149dee[_0x0071('0x26')][_0x0071('0x27')]===0x1f4){logger['error'](_0x0071('0x28'),_0x39dc5d,_0x149dee[_0x0071('0x26')][_0x0071('0x29')]);return _0x2217aa(_0x149dee[_0x0071('0x26')][_0x0071('0x29')]);}logger[_0x0071('0x26')](_0x0071('0x28'),_0x39dc5d,_0x149dee[_0x0071('0x26')][_0x0071('0x29')]);return _0x282de8(_0x149dee[_0x0071('0x26')][_0x0071('0x29')]);}else{logger[_0x0071('0x21')](_0x0071('0x28'),_0x39dc5d,'request\x20sent');_0x282de8(_0x149dee[_0x0071('0x2a')][_0x0071('0x29')]);}})[_0x0071('0x2b')](function(_0x1c86a7){logger[_0x0071('0x26')](_0x0071('0x28'),_0x39dc5d,_0x1c86a7);_0x2217aa(_0x1c86a7);});});}function respondWithStatusCode(_0xd94e14,_0xad8405){_0xad8405=_0xad8405||0xcc;return function(_0x466c81){if(_0x466c81){return _0xd94e14['sendStatus'](_0xad8405);}return _0xd94e14[_0x0071('0x2c')](_0xad8405)[_0x0071('0x2d')]();};}function respondWithResult(_0xa4fb02,_0x31cf32){_0x31cf32=_0x31cf32||0xc8;return function(_0x5cb76c){if(_0x5cb76c){return _0xa4fb02[_0x0071('0x2c')](_0x31cf32)[_0x0071('0x2e')](_0x5cb76c);}};}function respondWithFilteredResult(_0x4a7db2,_0x56653c){return function(_0x2aa10d){if(_0x2aa10d){var _0x56dad8=typeof _0x56653c[_0x0071('0x2f')]===_0x0071('0x30')&&typeof _0x56653c[_0x0071('0x31')]===_0x0071('0x30');var _0x3ebfff=_0x2aa10d['count'];var _0x4d44fb=_0x56dad8?0x0:_0x56653c[_0x0071('0x2f')];var _0x36e60f=_0x56dad8?_0x2aa10d[_0x0071('0x32')]:_0x56653c[_0x0071('0x2f')]+_0x56653c['limit'];var _0x5b0bbb;if(_0x36e60f>=_0x3ebfff){_0x36e60f=_0x3ebfff;_0x5b0bbb=0xc8;}else{_0x5b0bbb=0xce;}_0x4a7db2[_0x0071('0x2c')](_0x5b0bbb);return _0x4a7db2[_0x0071('0x33')](_0x0071('0x34'),_0x4d44fb+'-'+_0x36e60f+'/'+_0x3ebfff)[_0x0071('0x2e')](_0x2aa10d);}return null;};}function patchUpdates(_0x1fd995){return function(_0xb970b6){try{jsonpatch[_0x0071('0x35')](_0xb970b6,_0x1fd995,!![]);}catch(_0x427e08){return BPromise[_0x0071('0x36')](_0x427e08);}return _0xb970b6[_0x0071('0x37')]();};}function saveUpdates(_0x57ec18,_0xb463ab){return function(_0x702f5){if(_0x702f5){return _0x702f5['update'](_0x57ec18)[_0x0071('0x20')](function(_0x322cc6){return _0x322cc6;});}return null;};}function removeEntity(_0x393599,_0x316636){return function(_0x4d4a44){if(_0x4d4a44){return _0x4d4a44[_0x0071('0x38')]()[_0x0071('0x20')](function(){_0x393599[_0x0071('0x2c')](0xcc)[_0x0071('0x2d')]();});}};}function handleEntityNotFound(_0x2167c9,_0xda9556){return function(_0x38c2f8){if(!_0x38c2f8){_0x2167c9[_0x0071('0x39')](0x194);}return _0x38c2f8;};}function handleError(_0x3b6840,_0x39b8c0){_0x39b8c0=_0x39b8c0||0x1f4;return function(_0x54577f){logger[_0x0071('0x26')](_0x54577f[_0x0071('0x3a')]);if(_0x54577f[_0x0071('0x3b')]){delete _0x54577f['name'];}_0x3b6840['status'](_0x39b8c0)[_0x0071('0x3c')](_0x54577f);};}exports[_0x0071('0x3d')]=function(_0x12065c,_0x5f0283){var _0x42de83={},_0x1aefca={},_0x35b634={'count':0x0,'rows':[]};var _0x42dedc=_['map'](db[_0x0071('0x3e')]['rawAttributes'],function(_0x4e7c7d){return{'name':_0x4e7c7d[_0x0071('0x3f')],'type':_0x4e7c7d['type']['key']};});_0x1aefca[_0x0071('0x40')]=_['map'](_0x42dedc,_0x0071('0x3b'));_0x1aefca[_0x0071('0x41')]=_[_0x0071('0x42')](_0x12065c['query']);_0x1aefca[_0x0071('0x43')]=_[_0x0071('0x44')](_0x1aefca[_0x0071('0x40')],_0x1aefca[_0x0071('0x41')]);_0x42de83['attributes']=_['intersection'](_0x1aefca[_0x0071('0x40')],qs[_0x0071('0x45')](_0x12065c[_0x0071('0x41')]['fields']));_0x42de83[_0x0071('0x46')]=_0x42de83[_0x0071('0x46')][_0x0071('0x47')]?_0x42de83[_0x0071('0x46')]:_0x1aefca['model'];if(!_0x12065c[_0x0071('0x41')][_0x0071('0x48')](_0x0071('0x49'))){_0x42de83['limit']=qs[_0x0071('0x31')](_0x12065c['query']['limit']);_0x42de83[_0x0071('0x2f')]=qs[_0x0071('0x2f')](_0x12065c[_0x0071('0x41')]['offset']);}_0x42de83[_0x0071('0x4a')]=qs['sort'](_0x12065c[_0x0071('0x41')][_0x0071('0x4b')]);_0x42de83[_0x0071('0x4c')]=qs['filters'](_['pick'](_0x12065c[_0x0071('0x41')],_0x1aefca[_0x0071('0x43')]),_0x42dedc);if(_0x12065c[_0x0071('0x41')][_0x0071('0x4d')]){_0x42de83[_0x0071('0x4c')]=_[_0x0071('0x4e')](_0x42de83[_0x0071('0x4c')],{'$or':_['map'](_0x42dedc,function(_0x511f72){if(_0x511f72[_0x0071('0x4f')]!==_0x0071('0x50')){var _0x215411={};_0x215411[_0x511f72['name']]={'$like':'%'+_0x12065c[_0x0071('0x41')][_0x0071('0x4d')]+'%'};return _0x215411;}})});}_0x42de83=_[_0x0071('0x4e')]({},_0x42de83,_0x12065c[_0x0071('0x51')]);var _0x11d4f9={'where':_0x42de83[_0x0071('0x4c')]};return db[_0x0071('0x3e')][_0x0071('0x32')](_0x11d4f9)[_0x0071('0x20')](function(_0x152f16){_0x35b634['count']=_0x152f16;if(_0x12065c[_0x0071('0x41')]['includeAll']){_0x42de83[_0x0071('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x42de83);})[_0x0071('0x20')](function(_0x42ff87){_0x35b634[_0x0071('0x53')]=_0x42ff87;return _0x35b634;})[_0x0071('0x20')](respondWithFilteredResult(_0x5f0283,_0x42de83))[_0x0071('0x2b')](handleError(_0x5f0283,null));};exports['show']=function(_0x430e67,_0x4e82a0){var _0x448b4a={'raw':!![],'where':{'id':_0x430e67[_0x0071('0x54')]['id']}},_0x2d9ba5={};_0x2d9ba5['model']=_[_0x0071('0x42')](db[_0x0071('0x3e')][_0x0071('0x55')]);_0x2d9ba5[_0x0071('0x41')]=_[_0x0071('0x42')](_0x430e67[_0x0071('0x41')]);_0x2d9ba5[_0x0071('0x43')]=_[_0x0071('0x44')](_0x2d9ba5[_0x0071('0x40')],_0x2d9ba5['query']);_0x448b4a['attributes']=_['intersection'](_0x2d9ba5[_0x0071('0x40')],qs[_0x0071('0x45')](_0x430e67['query'][_0x0071('0x45')]));_0x448b4a[_0x0071('0x46')]=_0x448b4a[_0x0071('0x46')][_0x0071('0x47')]?_0x448b4a[_0x0071('0x46')]:_0x2d9ba5[_0x0071('0x40')];if(_0x430e67[_0x0071('0x41')][_0x0071('0x56')]){_0x448b4a[_0x0071('0x52')]=[{'all':!![]}];}_0x448b4a=_['merge']({},_0x448b4a,_0x430e67[_0x0071('0x51')]);return db[_0x0071('0x3e')][_0x0071('0x57')](_0x448b4a)[_0x0071('0x20')](handleEntityNotFound(_0x4e82a0,null))[_0x0071('0x20')](respondWithResult(_0x4e82a0,null))[_0x0071('0x2b')](handleError(_0x4e82a0,null));};exports[_0x0071('0x58')]=function(_0x200b8a,_0x3eb255){return db['OpenchannelMessage']['create'](_0x200b8a[_0x0071('0x59')],{})['then'](respondWithResult(_0x3eb255,0xc9))['catch'](handleError(_0x3eb255,null));};exports['update']=function(_0x47a44b,_0x2b2882){if(_0x47a44b[_0x0071('0x59')]['id']){delete _0x47a44b['body']['id'];}return db[_0x0071('0x3e')]['find']({'where':{'id':_0x47a44b[_0x0071('0x54')]['id']}})[_0x0071('0x20')](handleEntityNotFound(_0x2b2882,null))[_0x0071('0x20')](saveUpdates(_0x47a44b[_0x0071('0x59')],null))[_0x0071('0x20')](respondWithResult(_0x2b2882,null))[_0x0071('0x2b')](handleError(_0x2b2882,null));};exports[_0x0071('0x38')]=function(_0x40f4ad,_0x41fea1){return db[_0x0071('0x3e')][_0x0071('0x57')]({'where':{'id':_0x40f4ad[_0x0071('0x54')]['id']}})[_0x0071('0x20')](handleEntityNotFound(_0x41fea1,null))[_0x0071('0x20')](removeEntity(_0x41fea1,null))['catch'](handleError(_0x41fea1,null));};exports[_0x0071('0x5a')]=function(_0x11c683,_0x364a34){return db[_0x0071('0x3e')][_0x0071('0x5a')]()[_0x0071('0x20')](respondWithResult(_0x364a34,null))[_0x0071('0x2b')](handleError(_0x364a34,null));};var interaction_log=require(_0x0071('0x12'))(_0x0071('0x5b'));exports[_0x0071('0x5c')]=function(_0x97ce7e,_0x291e86,_0x181668){var _0x50a48b={'agent':{},'channel':_0x0071('0x5d')};if(_0x97ce7e['body']['id']){delete _0x97ce7e[_0x0071('0x59')]['id'];}_0x97ce7e['body'][_0x0071('0x5e')]=!![];_0x97ce7e['body'][_0x0071('0x5f')]=moment()[_0x0071('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x97ce7e[_0x0071('0x59')][_0x0071('0x61')]=_0x97ce7e[_0x0071('0x59')][_0x0071('0x61')]||_0x97ce7e[_0x0071('0x62')]['id'];_0x50a48b[_0x0071('0x63')]['id']=_0x97ce7e[_0x0071('0x59')][_0x0071('0x61')];return db['OpenchannelMessage']['find']({'where':{'id':_0x97ce7e[_0x0071('0x54')]['id'],'UserId':null}})[_0x0071('0x20')](handleEntityNotFound(_0x291e86,null))[_0x0071('0x20')](saveUpdates(_0x97ce7e[_0x0071('0x59')],null))[_0x0071('0x20')](function(_0xee0ca9){if(_0xee0ca9){_0x50a48b[_0x0071('0x29')]=_0xee0ca9[_0x0071('0x64')]({'plain':!![]});return db[_0x0071('0x65')]['find']({'where':{'id':_0xee0ca9['OpenchannelInteractionId']}});}return null;})[_0x0071('0x20')](handleEntityNotFound(_0x291e86,null))['then'](function(_0x106069){if(_0x106069){return _0x106069[_0x0071('0x66')]({'UserId':_0x97ce7e[_0x0071('0x59')][_0x0071('0x61')],'read1stAt':_[_0x0071('0x67')](_0x106069['read1stAt'])?moment()[_0x0071('0x60')](_0x0071('0x68')):undefined});}return null;})[_0x0071('0x20')](function(_0x440a51){if(_0x440a51){_0x50a48b[_0x0071('0x69')]=_0x440a51['get']({'plain':!![]});interaction_log[_0x0071('0x21')](_0x0071('0x6a'),_0x97ce7e[_0x0071('0x62')]['id'],_0x97ce7e[_0x0071('0x62')][_0x0071('0x3b')],_0x97ce7e[_0x0071('0x62')][_0x0071('0x6b')],_0x50a48b[_0x0071('0x69')]['id'],_0x97ce7e[_0x0071('0x59')]?JSON['stringify'](_0x97ce7e[_0x0071('0x59')]):_0x0071('0x6c'));return respondWithRpcPromise(_0x0071('0x6d'),_0x0071('0x6e'),_0x50a48b);}return null;})[_0x0071('0x20')](function(_0x252692){var _0x1e3e90=_0x0071('0x6f')+_0x252692[_0x0071('0x29')]['ContactId'];return db[_0x0071('0x70')][_0x0071('0x41')](_0x1e3e90,{'type':db[_0x0071('0x71')][_0x0071('0x72')][_0x0071('0x73')],'raw':!![]})[_0x0071('0x20')](function(_0x5cf0e0){return _0x5cf0e0;});})['then'](function(_0x11661b){if(_0x11661b){_0x50a48b['message'][_0x0071('0x74')]=_0x11661b[0x0];if(!_0x97ce7e[_0x0071('0x59')][_0x0071('0x61')])return;return db[_0x0071('0x75')][_0x0071('0x57')]({'where':{'id':_0x97ce7e[_0x0071('0x59')][_0x0071('0x61')],'role':'agent'},'attributes':['id',_0x0071('0x3b'),'fullname',_0x0071('0x76'),'internal'],'raw':!![]});}return null;})[_0x0071('0x20')](function(_0x2277e4){if(!_0x2277e4)return null;_0x50a48b['message'][_0x0071('0x63')]=_0x2277e4;return _0x50a48b;})[_0x0071('0x20')](function(_0x54bad2){if(_0x54bad2){if(_0x97ce7e[_0x0071('0x59')][_0x0071('0x77')]){_0x50a48b[_0x0071('0x29')][_0x0071('0x78')]=util[_0x0071('0x60')](_0x0071('0x79'),_0x97ce7e[_0x0071('0x62')][_0x0071('0x3b')]);_0x50a48b[_0x0071('0x29')][_0x0071('0x7a')]=_0x50a48b[_0x0071('0x7a')];_0x50a48b[_0x0071('0x29')][_0x0071('0x7b')]=_0x0071('0x5c');return respondWithRpcPromise(_0x0071('0x7c'),_0x0071('0x7c'),{'event':_0x0071('0x7d'),'message':_0x50a48b['message']},client9002)[_0x0071('0x20')](function(){return _0x50a48b;});}return _0x50a48b;}return null;})[_0x0071('0x20')](respondWithResult(_0x291e86,null))[_0x0071('0x2b')](handleError(_0x291e86,null));};var interaction_log=require(_0x0071('0x12'))(_0x0071('0x5b'));exports[_0x0071('0x36')]=function(_0x4f92b6,_0x6c4e8b,_0x41b305){var _0x10d839={'agent':{},'channel':_0x0071('0x5d')};if(_0x4f92b6['body']['id']){delete _0x4f92b6[_0x0071('0x59')]['id'];}_0x4f92b6[_0x0071('0x59')][_0x0071('0x61')]=_0x4f92b6['body'][_0x0071('0x61')]||_0x4f92b6[_0x0071('0x62')]['id'];_0x10d839['agent']['id']=_0x4f92b6[_0x0071('0x59')]['UserId'];return db[_0x0071('0x3e')][_0x0071('0x57')]({'where':{'id':_0x4f92b6[_0x0071('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x6c4e8b,null))[_0x0071('0x20')](function(_0x1d57e3){if(_0x1d57e3){_0x10d839[_0x0071('0x29')]=_0x1d57e3[_0x0071('0x64')]({'plain':!![]});return db[_0x0071('0x65')][_0x0071('0x57')]({'where':{'id':_0x1d57e3['OpenchannelInteractionId']}});}return null;})[_0x0071('0x20')](handleEntityNotFound(_0x6c4e8b,null))['then'](function(_0x193533){if(_0x193533){_0x10d839[_0x0071('0x69')]=_0x193533[_0x0071('0x64')]({'plain':!![]});interaction_log['info'](_0x0071('0x7e'),_0x4f92b6[_0x0071('0x62')]['id'],_0x4f92b6['user'][_0x0071('0x3b')],_0x4f92b6[_0x0071('0x62')][_0x0071('0x6b')],_0x10d839[_0x0071('0x69')]['id'],_0x4f92b6[_0x0071('0x59')]?JSON[_0x0071('0x25')](_0x4f92b6['body']):_0x0071('0x6c'));return respondWithRpcPromise('RejectMessage',_0x0071('0x7f'),_0x10d839);}return null;})[_0x0071('0x20')](function(_0x4e7d59){var _0x67718c=_0x0071('0x6f')+_0x4e7d59[_0x0071('0x29')][_0x0071('0x80')];return db[_0x0071('0x70')][_0x0071('0x41')](_0x67718c,{'type':db[_0x0071('0x71')][_0x0071('0x72')][_0x0071('0x73')],'raw':!![]})['then'](function(_0x5cfa29){return _0x5cfa29;});})['then'](function(_0x352bfb){if(_0x352bfb){_0x10d839[_0x0071('0x29')][_0x0071('0x74')]=_0x352bfb[0x0];if(!_0x4f92b6[_0x0071('0x59')][_0x0071('0x61')])return;return db[_0x0071('0x75')][_0x0071('0x57')]({'where':{'id':_0x4f92b6[_0x0071('0x59')]['UserId'],'role':_0x0071('0x63')},'attributes':['id',_0x0071('0x3b'),_0x0071('0x81'),_0x0071('0x76'),_0x0071('0x82')],'raw':!![]});}return null;})[_0x0071('0x20')](function(_0x28689b){if(!_0x28689b)return null;_0x10d839['message'][_0x0071('0x63')]=_0x28689b;return _0x10d839;})[_0x0071('0x20')](function(_0x5eda04){if(_0x5eda04){_0x5eda04[_0x0071('0x29')][_0x0071('0x78')]=util[_0x0071('0x60')](_0x0071('0x79'),_0x4f92b6[_0x0071('0x62')][_0x0071('0x3b')]);_0x5eda04[_0x0071('0x29')][_0x0071('0x7a')]=_0x10d839['channel'];_0x5eda04[_0x0071('0x29')][_0x0071('0x7b')]=_0x0071('0x36');respondWithRpcPromise('EventManager',_0x0071('0x7c'),{'event':_0x0071('0x83'),'message':_0x5eda04[_0x0071('0x29')]},client9002);return _0x10d839;}return null;})['then'](respondWithResult(_0x6c4e8b,null))[_0x0071('0x2b')](handleError(_0x6c4e8b,null));};
\ No newline at end of file
+var _0x91b1=['findAll','rows','keys','create','body','find','params','describe','../../config/logger','openchannel-interactions','openchannel','read','readAt','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','SIP/%s','channel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','rejectmessage','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','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','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','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x22d655,_0x3941dd){var _0x257739=function(_0x98136e){while(--_0x98136e){_0x22d655['push'](_0x22d655['shift']());}};_0x257739(++_0x3941dd);}(_0x91b1,0x1c4));var _0x191b=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0x91b1[_0x5a636f];return _0x6a8cfb;};'use strict';var emlformat=require(_0x191b('0x0'));var rimraf=require(_0x191b('0x1'));var zipdir=require(_0x191b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x191b('0x3'));var moment=require('moment');var BPromise=require(_0x191b('0x4'));var Mustache=require(_0x191b('0x5'));var util=require(_0x191b('0x6'));var path=require(_0x191b('0x7'));var sox=require(_0x191b('0x8'));var csv=require('to-csv');var ejs=require(_0x191b('0x9'));var fs=require('fs');var fs_extra=require(_0x191b('0xa'));var _=require(_0x191b('0xb'));var squel=require('squel');var crypto=require(_0x191b('0xc'));var jsforce=require(_0x191b('0xd'));var deskjs=require(_0x191b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x191b('0xf'));var Papa=require(_0x191b('0x10'));var Redis=require(_0x191b('0x11'));var authService=require(_0x191b('0x12'));var qs=require(_0x191b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x191b('0x14'));var logger=require('../../config/logger')(_0x191b('0x15'));var utils=require(_0x191b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x191b('0x17'))['db'];config[_0x191b('0x18')]=_[_0x191b('0x19')](config[_0x191b('0x18')],{'host':_0x191b('0x1a'),'port':0x18eb});var socket=require(_0x191b('0x1b'))(new Redis(config[_0x191b('0x18')]));require(_0x191b('0x1c'))[_0x191b('0x1d')](socket);var jayson=require(_0x191b('0x1e'));var client=jayson[_0x191b('0x1f')][_0x191b('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x191b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2a04b6,_0x54be1e,_0x2a9d1b,_0x52945d){return new BPromise(function(_0x2c825e,_0x1be6ac){var _0xcb17e8=_0x52945d||client;return _0xcb17e8['request'](_0x2a04b6,_0x2a9d1b)[_0x191b('0x21')](function(_0x2d6062){logger[_0x191b('0x22')](_0x191b('0x23'),_0x54be1e,_0x191b('0x24'));logger[_0x191b('0x25')](_0x191b('0x26'),_0x54be1e,_0x191b('0x24'),JSON[_0x191b('0x27')](_0x2d6062));if(_0x2d6062['error']){if(_0x2d6062[_0x191b('0x28')][_0x191b('0x29')]===0x1f4){logger['error'](_0x191b('0x23'),_0x54be1e,_0x2d6062['error']['message']);return _0x1be6ac(_0x2d6062[_0x191b('0x28')][_0x191b('0x2a')]);}logger['error'](_0x191b('0x23'),_0x54be1e,_0x2d6062[_0x191b('0x28')][_0x191b('0x2a')]);return _0x2c825e(_0x2d6062[_0x191b('0x28')][_0x191b('0x2a')]);}else{logger[_0x191b('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x54be1e,_0x191b('0x24'));_0x2c825e(_0x2d6062['result'][_0x191b('0x2a')]);}})[_0x191b('0x2b')](function(_0x3ba1b2){logger[_0x191b('0x28')](_0x191b('0x23'),_0x54be1e,_0x3ba1b2);_0x1be6ac(_0x3ba1b2);});});}function respondWithStatusCode(_0x2b1320,_0x20f1ff){_0x20f1ff=_0x20f1ff||0xcc;return function(_0x18d42f){if(_0x18d42f){return _0x2b1320[_0x191b('0x2c')](_0x20f1ff);}return _0x2b1320[_0x191b('0x2d')](_0x20f1ff)[_0x191b('0x2e')]();};}function respondWithResult(_0x59f85b,_0x1d7ce9){_0x1d7ce9=_0x1d7ce9||0xc8;return function(_0x54206d){if(_0x54206d){return _0x59f85b[_0x191b('0x2d')](_0x1d7ce9)[_0x191b('0x2f')](_0x54206d);}};}function respondWithFilteredResult(_0x43a787,_0x3258a3){return function(_0x361b4f){if(_0x361b4f){var _0x575e9f=typeof _0x3258a3[_0x191b('0x30')]===_0x191b('0x31')&&typeof _0x3258a3['limit']===_0x191b('0x31');var _0x539fef=_0x361b4f[_0x191b('0x32')];var _0x9b28c4=_0x575e9f?0x0:_0x3258a3[_0x191b('0x30')];var _0x1cc55b=_0x575e9f?_0x361b4f[_0x191b('0x32')]:_0x3258a3[_0x191b('0x30')]+_0x3258a3[_0x191b('0x33')];var _0x469045;if(_0x1cc55b>=_0x539fef){_0x1cc55b=_0x539fef;_0x469045=0xc8;}else{_0x469045=0xce;}_0x43a787['status'](_0x469045);return _0x43a787[_0x191b('0x34')]('Content-Range',_0x9b28c4+'-'+_0x1cc55b+'/'+_0x539fef)[_0x191b('0x2f')](_0x361b4f);}return null;};}function patchUpdates(_0x1ace9a){return function(_0x5b2645){try{jsonpatch[_0x191b('0x35')](_0x5b2645,_0x1ace9a,!![]);}catch(_0x353edc){return BPromise[_0x191b('0x36')](_0x353edc);}return _0x5b2645[_0x191b('0x37')]();};}function saveUpdates(_0x5616ae,_0x248f06){return function(_0x7d7b2f){if(_0x7d7b2f){return _0x7d7b2f[_0x191b('0x38')](_0x5616ae)[_0x191b('0x21')](function(_0x10bbdb){return _0x10bbdb;});}return null;};}function removeEntity(_0x535a6e,_0xd97037){return function(_0x4434b9){if(_0x4434b9){return _0x4434b9[_0x191b('0x39')]()[_0x191b('0x21')](function(){_0x535a6e[_0x191b('0x2d')](0xcc)[_0x191b('0x2e')]();});}};}function handleEntityNotFound(_0x482bdf,_0x21ba4a){return function(_0x238317){if(!_0x238317){_0x482bdf['sendStatus'](0x194);}return _0x238317;};}function handleError(_0x1297c9,_0x3a2805){_0x3a2805=_0x3a2805||0x1f4;return function(_0x2bd34c){logger[_0x191b('0x28')](_0x2bd34c[_0x191b('0x3a')]);if(_0x2bd34c[_0x191b('0x3b')]){delete _0x2bd34c[_0x191b('0x3b')];}_0x1297c9[_0x191b('0x2d')](_0x3a2805)[_0x191b('0x3c')](_0x2bd34c);};}exports[_0x191b('0x3d')]=function(_0x599060,_0x5d263c){var _0x57997f={},_0x53d863={},_0x437806={'count':0x0,'rows':[]};var _0x1e6363=_['map'](db[_0x191b('0x3e')][_0x191b('0x3f')],function(_0x3a6d5b){return{'name':_0x3a6d5b[_0x191b('0x40')],'type':_0x3a6d5b[_0x191b('0x41')][_0x191b('0x42')]};});_0x53d863['model']=_[_0x191b('0x43')](_0x1e6363,'name');_0x53d863[_0x191b('0x44')]=_['keys'](_0x599060['query']);_0x53d863[_0x191b('0x45')]=_[_0x191b('0x46')](_0x53d863[_0x191b('0x47')],_0x53d863[_0x191b('0x44')]);_0x57997f['attributes']=_['intersection'](_0x53d863[_0x191b('0x47')],qs['fields'](_0x599060[_0x191b('0x44')][_0x191b('0x48')]));_0x57997f[_0x191b('0x49')]=_0x57997f[_0x191b('0x49')][_0x191b('0x4a')]?_0x57997f[_0x191b('0x49')]:_0x53d863['model'];if(!_0x599060[_0x191b('0x44')]['hasOwnProperty'](_0x191b('0x4b'))){_0x57997f[_0x191b('0x33')]=qs[_0x191b('0x33')](_0x599060[_0x191b('0x44')][_0x191b('0x33')]);_0x57997f[_0x191b('0x30')]=qs[_0x191b('0x30')](_0x599060[_0x191b('0x44')][_0x191b('0x30')]);}_0x57997f['order']=qs[_0x191b('0x4c')](_0x599060[_0x191b('0x44')][_0x191b('0x4c')]);_0x57997f[_0x191b('0x4d')]=qs['filters'](_[_0x191b('0x4e')](_0x599060['query'],_0x53d863['filters']),_0x1e6363);if(_0x599060[_0x191b('0x44')][_0x191b('0x4f')]){_0x57997f[_0x191b('0x4d')]=_[_0x191b('0x50')](_0x57997f['where'],{'$or':_['map'](_0x1e6363,function(_0x1aca35){if(_0x1aca35[_0x191b('0x41')]!=='VIRTUAL'){var _0x5eab9e={};_0x5eab9e[_0x1aca35[_0x191b('0x3b')]]={'$like':'%'+_0x599060[_0x191b('0x44')][_0x191b('0x4f')]+'%'};return _0x5eab9e;}})});}_0x57997f=_[_0x191b('0x50')]({},_0x57997f,_0x599060[_0x191b('0x51')]);var _0x3ada48={'where':_0x57997f['where']};return db[_0x191b('0x3e')][_0x191b('0x32')](_0x3ada48)[_0x191b('0x21')](function(_0xf258f9){_0x437806[_0x191b('0x32')]=_0xf258f9;if(_0x599060[_0x191b('0x44')][_0x191b('0x52')]){_0x57997f[_0x191b('0x53')]=[{'all':!![]}];}return db[_0x191b('0x3e')][_0x191b('0x54')](_0x57997f);})['then'](function(_0x6d8e30){_0x437806[_0x191b('0x55')]=_0x6d8e30;return _0x437806;})[_0x191b('0x21')](respondWithFilteredResult(_0x5d263c,_0x57997f))[_0x191b('0x2b')](handleError(_0x5d263c,null));};exports['show']=function(_0xee3db8,_0x34b17d){var _0x5453de={'raw':!![],'where':{'id':_0xee3db8['params']['id']}},_0x23ba87={};_0x23ba87[_0x191b('0x47')]=_[_0x191b('0x56')](db['OpenchannelMessage'][_0x191b('0x3f')]);_0x23ba87['query']=_['keys'](_0xee3db8['query']);_0x23ba87['filters']=_['intersection'](_0x23ba87[_0x191b('0x47')],_0x23ba87[_0x191b('0x44')]);_0x5453de[_0x191b('0x49')]=_[_0x191b('0x46')](_0x23ba87[_0x191b('0x47')],qs['fields'](_0xee3db8[_0x191b('0x44')][_0x191b('0x48')]));_0x5453de[_0x191b('0x49')]=_0x5453de[_0x191b('0x49')]['length']?_0x5453de[_0x191b('0x49')]:_0x23ba87['model'];if(_0xee3db8[_0x191b('0x44')][_0x191b('0x52')]){_0x5453de[_0x191b('0x53')]=[{'all':!![]}];}_0x5453de=_[_0x191b('0x50')]({},_0x5453de,_0xee3db8[_0x191b('0x51')]);return db[_0x191b('0x3e')]['find'](_0x5453de)[_0x191b('0x21')](handleEntityNotFound(_0x34b17d,null))['then'](respondWithResult(_0x34b17d,null))[_0x191b('0x2b')](handleError(_0x34b17d,null));};exports['create']=function(_0x399265,_0x565298){return db[_0x191b('0x3e')][_0x191b('0x57')](_0x399265[_0x191b('0x58')],{})[_0x191b('0x21')](respondWithResult(_0x565298,0xc9))[_0x191b('0x2b')](handleError(_0x565298,null));};exports[_0x191b('0x38')]=function(_0x45ba54,_0x1ebcb9){if(_0x45ba54['body']['id']){delete _0x45ba54['body']['id'];}return db[_0x191b('0x3e')][_0x191b('0x59')]({'where':{'id':_0x45ba54[_0x191b('0x5a')]['id']}})[_0x191b('0x21')](handleEntityNotFound(_0x1ebcb9,null))[_0x191b('0x21')](saveUpdates(_0x45ba54[_0x191b('0x58')],null))[_0x191b('0x21')](respondWithResult(_0x1ebcb9,null))[_0x191b('0x2b')](handleError(_0x1ebcb9,null));};exports[_0x191b('0x39')]=function(_0x2f8d93,_0xc1a5f1){return db[_0x191b('0x3e')][_0x191b('0x59')]({'where':{'id':_0x2f8d93['params']['id']}})[_0x191b('0x21')](handleEntityNotFound(_0xc1a5f1,null))['then'](removeEntity(_0xc1a5f1,null))[_0x191b('0x2b')](handleError(_0xc1a5f1,null));};exports[_0x191b('0x5b')]=function(_0xeb503a,_0x1927d3){return db['OpenchannelMessage'][_0x191b('0x5b')]()['then'](respondWithResult(_0x1927d3,null))['catch'](handleError(_0x1927d3,null));};var interaction_log=require(_0x191b('0x5c'))(_0x191b('0x5d'));exports['accept']=function(_0x5b7991,_0x26636f,_0x127634){var _0x4fff62={'agent':{},'channel':_0x191b('0x5e')};if(_0x5b7991[_0x191b('0x58')]['id']){delete _0x5b7991[_0x191b('0x58')]['id'];}_0x5b7991[_0x191b('0x58')][_0x191b('0x5f')]=!![];_0x5b7991[_0x191b('0x58')][_0x191b('0x60')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5b7991[_0x191b('0x58')][_0x191b('0x61')]=_0x5b7991['body'][_0x191b('0x61')]||_0x5b7991[_0x191b('0x62')]['id'];_0x4fff62['agent']['id']=_0x5b7991[_0x191b('0x58')][_0x191b('0x61')];return db[_0x191b('0x3e')][_0x191b('0x59')]({'where':{'id':_0x5b7991[_0x191b('0x5a')]['id'],'UserId':null}})[_0x191b('0x21')](handleEntityNotFound(_0x26636f,null))[_0x191b('0x21')](saveUpdates(_0x5b7991[_0x191b('0x58')],null))['then'](function(_0x323d23){if(_0x323d23){_0x4fff62[_0x191b('0x2a')]=_0x323d23[_0x191b('0x63')]({'plain':!![]});return db[_0x191b('0x64')][_0x191b('0x59')]({'where':{'id':_0x323d23[_0x191b('0x65')]}});}return null;})[_0x191b('0x21')](handleEntityNotFound(_0x26636f,null))[_0x191b('0x21')](function(_0x27cad5){if(_0x27cad5){return _0x27cad5[_0x191b('0x38')]({'UserId':_0x5b7991['body'][_0x191b('0x61')],'read1stAt':_[_0x191b('0x66')](_0x27cad5[_0x191b('0x67')])?moment()[_0x191b('0x68')](_0x191b('0x69')):undefined});}return null;})['then'](function(_0x2dce71){if(_0x2dce71){_0x4fff62[_0x191b('0x6a')]=_0x2dce71[_0x191b('0x63')]({'plain':!![]});interaction_log[_0x191b('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5b7991[_0x191b('0x62')]['id'],_0x5b7991[_0x191b('0x62')][_0x191b('0x3b')],_0x5b7991[_0x191b('0x62')][_0x191b('0x6b')],_0x4fff62[_0x191b('0x6a')]['id'],_0x5b7991['body']?JSON[_0x191b('0x27')](_0x5b7991[_0x191b('0x58')]):_0x191b('0x6c'));return respondWithRpcPromise(_0x191b('0x6d'),_0x191b('0x6e'),_0x4fff62);}return null;})[_0x191b('0x21')](function(_0x5e3719){var _0x429ca8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e3719[_0x191b('0x2a')][_0x191b('0x6f')];return db[_0x191b('0x70')][_0x191b('0x44')](_0x429ca8,{'type':db[_0x191b('0x71')][_0x191b('0x72')][_0x191b('0x73')],'raw':!![]})['then'](function(_0x444893){return _0x444893;});})[_0x191b('0x21')](function(_0x1c039c){if(_0x1c039c){_0x4fff62[_0x191b('0x2a')][_0x191b('0x74')]=_0x1c039c[0x0];if(!_0x5b7991[_0x191b('0x58')][_0x191b('0x61')])return;return db[_0x191b('0x75')][_0x191b('0x59')]({'where':{'id':_0x5b7991[_0x191b('0x58')][_0x191b('0x61')],'role':_0x191b('0x76')},'attributes':['id','name',_0x191b('0x77'),_0x191b('0x78'),_0x191b('0x79')],'raw':!![]});}return null;})[_0x191b('0x21')](function(_0x105dc0){if(!_0x105dc0)return null;_0x4fff62[_0x191b('0x2a')][_0x191b('0x76')]=_0x105dc0;return _0x4fff62;})[_0x191b('0x21')](function(_0x42c864){if(_0x42c864){if(_0x5b7991['body']['manual']){_0x4fff62[_0x191b('0x2a')]['interface']=util[_0x191b('0x68')](_0x191b('0x7a'),_0x5b7991[_0x191b('0x62')][_0x191b('0x3b')]);_0x4fff62[_0x191b('0x2a')][_0x191b('0x7b')]=_0x4fff62['channel'];_0x4fff62[_0x191b('0x2a')][_0x191b('0x7c')]=_0x191b('0x7d');return respondWithRpcPromise(_0x191b('0x7e'),_0x191b('0x7e'),{'event':_0x191b('0x7f'),'message':_0x4fff62['message']},client9002)[_0x191b('0x21')](function(){return _0x4fff62;});}return _0x4fff62;}return null;})[_0x191b('0x21')](respondWithResult(_0x26636f,null))['catch'](handleError(_0x26636f,null));};var interaction_log=require(_0x191b('0x5c'))(_0x191b('0x5d'));exports[_0x191b('0x36')]=function(_0x3c7c75,_0x2dd345,_0x2858a1){var _0x219e04={'agent':{},'channel':_0x191b('0x5e')};if(_0x3c7c75['body']['id']){delete _0x3c7c75[_0x191b('0x58')]['id'];}_0x3c7c75[_0x191b('0x58')][_0x191b('0x61')]=_0x3c7c75[_0x191b('0x58')][_0x191b('0x61')]||_0x3c7c75['user']['id'];_0x219e04[_0x191b('0x76')]['id']=_0x3c7c75['body'][_0x191b('0x61')];return db['OpenchannelMessage'][_0x191b('0x59')]({'where':{'id':_0x3c7c75['params']['id'],'UserId':null}})[_0x191b('0x21')](handleEntityNotFound(_0x2dd345,null))[_0x191b('0x21')](function(_0x2248df){if(_0x2248df){_0x219e04[_0x191b('0x2a')]=_0x2248df['get']({'plain':!![]});return db[_0x191b('0x64')][_0x191b('0x59')]({'where':{'id':_0x2248df[_0x191b('0x65')]}});}return null;})[_0x191b('0x21')](handleEntityNotFound(_0x2dd345,null))['then'](function(_0x5bdbcb){if(_0x5bdbcb){_0x219e04[_0x191b('0x6a')]=_0x5bdbcb[_0x191b('0x63')]({'plain':!![]});interaction_log[_0x191b('0x22')](_0x191b('0x80'),_0x3c7c75[_0x191b('0x62')]['id'],_0x3c7c75[_0x191b('0x62')][_0x191b('0x3b')],_0x3c7c75[_0x191b('0x62')][_0x191b('0x6b')],_0x219e04[_0x191b('0x6a')]['id'],_0x3c7c75[_0x191b('0x58')]?JSON[_0x191b('0x27')](_0x3c7c75[_0x191b('0x58')]):_0x191b('0x6c'));return respondWithRpcPromise(_0x191b('0x81'),_0x191b('0x82'),_0x219e04);}return null;})[_0x191b('0x21')](function(_0x325f21){var _0x22af94=_0x191b('0x83')+_0x325f21[_0x191b('0x2a')][_0x191b('0x6f')];return db[_0x191b('0x70')][_0x191b('0x44')](_0x22af94,{'type':db[_0x191b('0x71')][_0x191b('0x72')]['SELECT'],'raw':!![]})[_0x191b('0x21')](function(_0x423cc5){return _0x423cc5;});})['then'](function(_0x385c6d){if(_0x385c6d){_0x219e04[_0x191b('0x2a')][_0x191b('0x74')]=_0x385c6d[0x0];if(!_0x3c7c75['body'][_0x191b('0x61')])return;return db[_0x191b('0x75')]['find']({'where':{'id':_0x3c7c75['body'][_0x191b('0x61')],'role':'agent'},'attributes':['id',_0x191b('0x3b'),_0x191b('0x77'),_0x191b('0x78'),'internal'],'raw':!![]});}return null;})[_0x191b('0x21')](function(_0x50a2a7){if(!_0x50a2a7)return null;_0x219e04[_0x191b('0x2a')][_0x191b('0x76')]=_0x50a2a7;return _0x219e04;})['then'](function(_0x5cfd2a){if(_0x5cfd2a){_0x5cfd2a['message'][_0x191b('0x84')]=util[_0x191b('0x68')](_0x191b('0x7a'),_0x3c7c75[_0x191b('0x62')][_0x191b('0x3b')]);_0x5cfd2a[_0x191b('0x2a')]['channel']=_0x219e04[_0x191b('0x7b')];_0x5cfd2a[_0x191b('0x2a')][_0x191b('0x7c')]=_0x191b('0x36');respondWithRpcPromise(_0x191b('0x7e'),_0x191b('0x7e'),{'event':_0x191b('0x85'),'message':_0x5cfd2a[_0x191b('0x2a')]},client9002);return _0x219e04;}return null;})[_0x191b('0x21')](respondWithResult(_0x2dd345,null))[_0x191b('0x2b')](handleError(_0x2dd345,null));};
\ No newline at end of file
index 08f613d..250b938 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e05=['setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x5fd04,_0x5d6fff){var _0x48c27b=function(_0x3fd78b){while(--_0x3fd78b){_0x5fd04['push'](_0x5fd04['shift']());}};_0x48c27b(++_0x5d6fff);}(_0x5e05,0x127));var _0x55e0=function(_0x23ba08,_0x5e1ba1){_0x23ba08=_0x23ba08-0x0;var _0x14a0aa=_0x5e05[_0x23ba08];return _0x14a0aa;};'use strict';var EventEmitter=require(_0x55e0('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x55e0('0x1')](0x0);var events={'afterCreate':_0x55e0('0x2'),'afterUpdate':_0x55e0('0x3'),'afterDestroy':_0x55e0('0x4')};function emitEvent(_0x1c1249){return function(_0x33e377,_0x181cec,_0x375fba){OpenchannelMessageEvents['emit'](_0x1c1249+':'+_0x33e377['id'],_0x33e377);OpenchannelMessageEvents[_0x55e0('0x5')](_0x1c1249,_0x33e377);_0x375fba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x55e0('0x6')](e,emitEvent(event));}}module[_0x55e0('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x5975=['../../mysqldb','OpenchannelMessage','update','remove','emit','hook','exports','events'];(function(_0x95d1c,_0x351792){var _0x396a3d=function(_0x142c96){while(--_0x142c96){_0x95d1c['push'](_0x95d1c['shift']());}};_0x396a3d(++_0x351792);}(_0x5975,0x187));var _0x5597=function(_0x390a83,_0x14d5bc){_0x390a83=_0x390a83-0x0;var _0x1d8140=_0x5975[_0x390a83];return _0x1d8140;};'use strict';var EventEmitter=require(_0x5597('0x0'));var OpenchannelMessage=require(_0x5597('0x1'))['db'][_0x5597('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5597('0x3'),'afterDestroy':_0x5597('0x4')};function emitEvent(_0x3da974){return function(_0x319562,_0x23dfc4,_0x90b142){OpenchannelMessageEvents[_0x5597('0x5')](_0x3da974+':'+_0x319562['id'],_0x319562);OpenchannelMessageEvents[_0x5597('0x5')](_0x3da974,_0x319562);_0x90b142(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x5597('0x6')](e,emitEvent(event));}}module[_0x5597('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index c8ed123..b260926 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b4=['OpenchannelInteractionId','Contact','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','out','secret','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions'];(function(_0xd07f4f,_0x45558a){var _0x2fb318=function(_0x25e0d3){while(--_0x25e0d3){_0xd07f4f['push'](_0xd07f4f['shift']());}};_0x2fb318(++_0x45558a);}(_0xf7b4,0x152));var _0x4f7b=function(_0x26dec5,_0x3f7620){_0x26dec5=_0x26dec5-0x0;var _0xea7c33=_0xf7b4[_0x26dec5];return _0xea7c33;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4f7b('0x1'));var moment=require(_0x4f7b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f7b('0x3'));var rimraf=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var attributes=require(_0x4f7b('0x6'));module[_0x4f7b('0x7')]=function(_0x2637f0,_0x427f8b){return _0x2637f0[_0x4f7b('0x8')](_0x4f7b('0x9'),attributes,{'tableName':_0x4f7b('0xa'),'paranoid':![],'indexes':[{'name':_0x4f7b('0xb'),'fields':[_0x4f7b('0xc')],'type':_0x4f7b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c714d,_0x433563,_0x1016e0){var _0x479208=_0x2637f0[_0x4f7b('0xe')];var _0x3a3d6c=_0x5c714d[_0x4f7b('0xf')]({'plain':!![]});if(_0x3a3d6c[_0x4f7b('0x10')][_0x4f7b('0x11')]()==='in'||_0x3a3d6c['direction'][_0x4f7b('0x11')]()==='out'&&!_0x3a3d6c['secret']&&!_[_0x4f7b('0x12')](_0x3a3d6c[_0x4f7b('0x13')])){_0x479208[_0x4f7b('0x14')][_0x4f7b('0x15')]({'where':{'id':_0x3a3d6c['OpenchannelInteractionId']}})[_0x4f7b('0x16')](function(_0x368091){if(_0x368091){_0x368091[_0x4f7b('0x17')]({'lastMsgAt':_0x3a3d6c[_0x4f7b('0x18')],'lastMsgDirection':_0x3a3d6c[_0x4f7b('0x10')][_0x4f7b('0x11')]()});}})[_0x4f7b('0x19')](function(_0x2437cc){console[_0x4f7b('0x1a')](_0x2437cc);});}if(_0x3a3d6c[_0x4f7b('0x10')]===_0x4f7b('0x1b')&&!_0x3a3d6c[_0x4f7b('0x1c')]){var _0x50a161;_0x479208[_0x4f7b('0x1d')]['describe']()['then'](function(_0x24e5cf){return _0x479208[_0x4f7b('0x1e')]['find']({'where':{'id':_0x3a3d6c[_0x4f7b('0x1f')]},'include':[{'model':_0x479208[_0x4f7b('0x14')],'as':_0x4f7b('0x20'),'where':{'id':_0x3a3d6c[_0x4f7b('0x21')]},'limit':0x1,'include':[{'model':_0x479208['CmContact'],'as':_0x4f7b('0x22'),'attributes':_['keys'](_0x24e5cf)}]}]});})[_0x4f7b('0x16')](function(_0x12374b){_0x50a161=_0x12374b[_0x4f7b('0xf')]({'plain':!![]});if(_0x50a161&&_0x50a161[_0x4f7b('0x23')]){logger[_0x4f7b('0x24')](_0x4f7b('0x25'),_0x4f7b('0x26'),util[_0x4f7b('0x27')](_0x4f7b('0x28'),_0x3a3d6c['id'],_0x50a161['replyUri']));if(_0x50a161[_0x4f7b('0x20')]&&_0x50a161[_0x4f7b('0x20')][_0x4f7b('0x29')]){_0x3a3d6c['Interaction']=_[_0x4f7b('0x2a')](_0x50a161[_0x4f7b('0x20')][0x0],'Contact');_0x3a3d6c[_0x4f7b('0x22')]=_0x50a161['Interactions'][0x0][_0x4f7b('0x22')];}var _0x433563={'method':_0x4f7b('0x2b'),'uri':encodeURI(_0x50a161[_0x4f7b('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x433563[_0x4f7b('0x2c')]){case _0x4f7b('0x2d'):_0x433563['qs']=_0x3a3d6c;break;case _0x4f7b('0x2b'):_0x433563[_0x4f7b('0xc')]=_0x3a3d6c;break;}return rp(_0x433563)['then'](function(_0x6c9626){logger[_0x4f7b('0x24')](_0x4f7b('0x25'),'afterCreate',util[_0x4f7b('0x27')](_0x4f7b('0x2e'),_0x3a3d6c['id'],_0x50a161[_0x4f7b('0x23')]));if(_0x6c9626[_0x4f7b('0xc')][_0x4f7b('0x2f')]&&_0x6c9626['body'][_0x4f7b('0x2f')]!=_0x3a3d6c[_0x4f7b('0x30')][_0x4f7b('0x2f')]){return _0x479208['OpenchannelInteraction'][_0x4f7b('0x17')]({'threadId':_0x6c9626['body']['threadId']},{'logging':!![],'where':{'id':_0x3a3d6c[_0x4f7b('0x30')]['id']}});}else{return;}})['then'](function(){return _0x5c714d[_0x4f7b('0x17')]({'read':!![]});})[_0x4f7b('0x19')](function(_0x22f489){logger[_0x4f7b('0x1a')](_0x4f7b('0x25'),_0x4f7b('0x26'),util[_0x4f7b('0x31')](_0x22f489,{'showHidden':![],'depth':null}));_0x1016e0();});}else{_0x1016e0();}})[_0x4f7b('0x32')](function(){_0x1016e0();});}else{_0x1016e0();}}},'charset':_0x4f7b('0x33'),'collate':_0x4f7b('0x34')});};
\ No newline at end of file
+var _0x13f6=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','omit','Contact','POST','method','GET','info','Interaction','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','body','FULLTEXT','models','direction','toLowerCase','out','secret','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','get','replyUri'];(function(_0x1538a0,_0x12d196){var _0x4b5c71=function(_0x177022){while(--_0x177022){_0x1538a0['push'](_0x1538a0['shift']());}};_0x4b5c71(++_0x12d196);}(_0x13f6,0x124));var _0x613f=function(_0x402f6,_0x145bba){_0x402f6=_0x402f6-0x0;var _0x1c4cb2=_0x13f6[_0x402f6];return _0x1c4cb2;};'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']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x613f('0x8')],'type':_0x613f('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x363736,_0x35b672,_0x4e98ce){var _0x1a8dd0=_0x3f3525[_0x613f('0xa')];var _0xcd514c=_0x363736['get']({'plain':!![]});if(_0xcd514c[_0x613f('0xb')][_0x613f('0xc')]()==='in'||_0xcd514c[_0x613f('0xb')]['toLowerCase']()===_0x613f('0xd')&&!_0xcd514c[_0x613f('0xe')]&&!_['isNil'](_0xcd514c['UserId'])){_0x1a8dd0['OpenchannelInteraction'][_0x613f('0xf')]({'where':{'id':_0xcd514c[_0x613f('0x10')]}})[_0x613f('0x11')](function(_0x375db1){if(_0x375db1){_0x375db1[_0x613f('0x12')]({'lastMsgAt':_0xcd514c[_0x613f('0x13')],'lastMsgDirection':_0xcd514c[_0x613f('0xb')][_0x613f('0xc')]()});}})[_0x613f('0x14')](function(_0x1d68fd){console['error'](_0x1d68fd);});}if(_0xcd514c[_0x613f('0xb')]==='out'&&!_0xcd514c['secret']){var _0x1bc605;_0x1a8dd0[_0x613f('0x15')]['describe']()[_0x613f('0x11')](function(_0x4f9dae){return _0x1a8dd0[_0x613f('0x16')][_0x613f('0x17')]({'where':{'id':_0xcd514c[_0x613f('0x18')]},'include':[{'model':_0x1a8dd0[_0x613f('0x19')],'as':_0x613f('0x1a'),'where':{'id':_0xcd514c[_0x613f('0x10')]},'limit':0x1,'include':[{'model':_0x1a8dd0['CmContact'],'as':'Contact','attributes':_[_0x613f('0x1b')](_0x4f9dae)}]}]});})['then'](function(_0x48493c){_0x1bc605=_0x48493c[_0x613f('0x1c')]({'plain':!![]});if(_0x1bc605&&_0x1bc605[_0x613f('0x1d')]){logger['info'](_0x613f('0x1e'),_0x613f('0x1f'),util[_0x613f('0x20')]('Forwarding\x20message\x20%d\x20to\x20%s',_0xcd514c['id'],_0x1bc605['replyUri']));if(_0x1bc605[_0x613f('0x1a')]&&_0x1bc605[_0x613f('0x1a')][_0x613f('0x21')]){_0xcd514c['Interaction']=_[_0x613f('0x22')](_0x1bc605[_0x613f('0x1a')][0x0],_0x613f('0x23'));_0xcd514c[_0x613f('0x23')]=_0x1bc605[_0x613f('0x1a')][0x0]['Contact'];}var _0x35b672={'method':_0x613f('0x24'),'uri':encodeURI(_0x1bc605['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x35b672[_0x613f('0x25')]){case _0x613f('0x26'):_0x35b672['qs']=_0xcd514c;break;case _0x613f('0x24'):_0x35b672['body']=_0xcd514c;break;}return rp(_0x35b672)['then'](function(_0x5a4a8b){logger[_0x613f('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x613f('0x1f'),util[_0x613f('0x20')]('Message\x20%d\x20forwarded\x20to\x20%s',_0xcd514c['id'],_0x1bc605[_0x613f('0x1d')]));if(_0x5a4a8b[_0x613f('0x8')]['threadId']&&_0x5a4a8b['body']['threadId']!=_0xcd514c[_0x613f('0x28')][_0x613f('0x29')]){return _0x1a8dd0[_0x613f('0x19')]['update']({'threadId':_0x5a4a8b[_0x613f('0x8')][_0x613f('0x29')]},{'logging':!![],'where':{'id':_0xcd514c[_0x613f('0x28')]['id']}});}else{return;}})[_0x613f('0x11')](function(){return _0x363736['update']({'read':!![]});})[_0x613f('0x14')](function(_0x5b2a1f){logger[_0x613f('0x2a')](_0x613f('0x1e'),_0x613f('0x1f'),util[_0x613f('0x2b')](_0x5b2a1f,{'showHidden':![],'depth':null}));_0x4e98ce();});}else{_0x4e98ce();}})['finally'](function(){_0x4e98ce();});}else{_0x4e98ce();}}},'charset':_0x613f('0x2c'),'collate':_0x613f('0x2d')});};
\ No newline at end of file
index a142612..c3f5d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x171178,_0x3d5c4a){var _0x311c2f=function(_0x1fe5e6){while(--_0x1fe5e6){_0x171178['push'](_0x171178['shift']());}};_0x311c2f(++_0x3d5c4a);}(_0x2ef3,0xba));var _0x32ef=function(_0x38552a,_0x13a148){_0x38552a=_0x38552a-0x0;var _0x1203ff=_0x2ef3[_0x38552a];return _0x1203ff;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
+var _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(_0x29bfbe,_0x37060a){var _0x230663=function(_0x3b2a6f){while(--_0x3b2a6f){_0x29bfbe['push'](_0x29bfbe['shift']());}};_0x230663(++_0x37060a);}(_0xdb28,0x106));var _0x8db2=function(_0x586af9,_0x4c5351){_0x586af9=_0x586af9-0x0;var _0x3b9b60=_0xdb28[_0x586af9];return _0x3b9b60;};'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 83a7403..d1d8ced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6be=['emit','removeListener','length','./openchannelMessage.events','remove'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xf6be,0x80));var _0xef6b=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xf6be[_0x215e65];return _0xa85842;};'use strict';var OpenchannelMessageEvents=require(_0xef6b('0x0'));var events=['save',_0xef6b('0x1'),'update'];function createListener(_0x30b20a,_0x25899c){return function(_0x377757){_0x25899c[_0xef6b('0x2')](_0x30b20a,_0x377757);};}function removeListener(_0xde78a8,_0x727c76){return function(){OpenchannelMessageEvents[_0xef6b('0x3')](_0xde78a8,_0x727c76);};}exports['register']=function(_0x9a2067){for(var _0x48d752=0x0,_0x11d0ab=events[_0xef6b('0x4')];_0x48d752<_0x11d0ab;_0x48d752++){var _0x36eac5=events[_0x48d752];var _0x21dca0=createListener('openchannelMessage:'+_0x36eac5,_0x9a2067);OpenchannelMessageEvents['on'](_0x36eac5,_0x21dca0);}};
\ No newline at end of file
+var _0xb280=['emit','removeListener','length','openchannelMessage:','remove','update'];(function(_0xf4666e,_0x571140){var _0x1853f1=function(_0x5160a5){while(--_0x5160a5){_0xf4666e['push'](_0xf4666e['shift']());}};_0x1853f1(++_0x571140);}(_0xb280,0x148));var _0x0b28=function(_0x418ce8,_0x2d9def){_0x418ce8=_0x418ce8-0x0;var _0x4eabcd=_0xb280[_0x418ce8];return _0x4eabcd;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x0b28('0x0'),_0x0b28('0x1')];function createListener(_0x50b6d5,_0x5d79d0){return function(_0x3e5020){_0x5d79d0[_0x0b28('0x2')](_0x50b6d5,_0x3e5020);};}function removeListener(_0x54181d,_0x4b18b9){return function(){OpenchannelMessageEvents[_0x0b28('0x3')](_0x54181d,_0x4b18b9);};}exports['register']=function(_0x26c868){for(var _0x211b85=0x0,_0x27f471=events[_0x0b28('0x4')];_0x211b85<_0x27f471;_0x211b85++){var _0x23d7f3=events[_0x211b85];var _0x1d245d=createListener(_0x0b28('0x5')+_0x23d7f3,_0x26c868);OpenchannelMessageEvents['on'](_0x23d7f3,_0x1d245d);}};
\ No newline at end of file
index f021864..31aed6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x208e=['removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','update','destroy','delete'];(function(_0x377d47,_0x3d5e9a){var _0x289c2f=function(_0xc78e4f){while(--_0xc78e4f){_0x377d47['push'](_0x377d47['shift']());}};_0x289c2f(++_0x3d5e9a);}(_0x208e,0x1ef));var _0xe208=function(_0x3e079f,_0x189e15){_0x3e079f=_0x3e079f-0x0;var _0x296a34=_0x208e[_0x3e079f];return _0x296a34;};'use strict';var multer=require(_0xe208('0x0'));var util=require(_0xe208('0x1'));var path=require('path');var timeout=require(_0xe208('0x2'));var express=require('express');var router=express[_0xe208('0x3')]();var fs_extra=require(_0xe208('0x4'));var auth=require(_0xe208('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe208('0x6'));var controller=require(_0xe208('0x7'));router[_0xe208('0x8')]('/',auth[_0xe208('0x9')](),controller[_0xe208('0xa')]);router[_0xe208('0x8')]('/describe',auth[_0xe208('0x9')](),controller[_0xe208('0xb')]);router[_0xe208('0x8')](_0xe208('0xc'),auth[_0xe208('0x9')](),controller[_0xe208('0xd')]);router['get'](_0xe208('0xe'),auth[_0xe208('0x9')](),controller['getMembers']);router['get'](_0xe208('0xf'),auth[_0xe208('0x9')](),controller[_0xe208('0x10')]);router[_0xe208('0x8')](_0xe208('0x11'),auth[_0xe208('0x9')](),controller['getAgents']);router[_0xe208('0x12')]('/',auth[_0xe208('0x9')](),controller[_0xe208('0x13')]);router[_0xe208('0x12')]('/:id/teams',auth[_0xe208('0x9')](),controller[_0xe208('0x14')]);router[_0xe208('0x12')](_0xe208('0x11'),auth[_0xe208('0x9')](),controller[_0xe208('0x15')]);router['put'](_0xe208('0xc'),auth['isAuthenticated'](),controller[_0xe208('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe208('0x17')]);router[_0xe208('0x18')]('/:id/teams',auth[_0xe208('0x9')](),controller['removeTeams']);router[_0xe208('0x18')](_0xe208('0x11'),auth[_0xe208('0x9')](),controller[_0xe208('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xefd5=['express','fs-extra','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getTeams','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xefd5,0x158));var _0x5efd=function(_0x4b7b66,_0x3ffce7){_0x4b7b66=_0x4b7b66-0x0;var _0x38581d=_0xefd5[_0x4b7b66];return _0x38581d;};'use strict';var multer=require(_0x5efd('0x0'));var util=require(_0x5efd('0x1'));var path=require(_0x5efd('0x2'));var timeout=require(_0x5efd('0x3'));var express=require(_0x5efd('0x4'));var router=express['Router']();var fs_extra=require(_0x5efd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5efd('0x6'));var config=require('../../config/environment');var controller=require(_0x5efd('0x7'));router[_0x5efd('0x8')]('/',auth['isAuthenticated'](),controller[_0x5efd('0x9')]);router['get'](_0x5efd('0xa'),auth[_0x5efd('0xb')](),controller[_0x5efd('0xc')]);router['get'](_0x5efd('0xd'),auth[_0x5efd('0xb')](),controller[_0x5efd('0xe')]);router[_0x5efd('0x8')](_0x5efd('0xf'),auth[_0x5efd('0xb')](),controller['getMembers']);router[_0x5efd('0x8')]('/:id/teams',auth[_0x5efd('0xb')](),controller[_0x5efd('0x10')]);router[_0x5efd('0x8')]('/:id/users',auth[_0x5efd('0xb')](),controller[_0x5efd('0x11')]);router[_0x5efd('0x12')]('/',auth[_0x5efd('0xb')](),controller['create']);router[_0x5efd('0x12')]('/:id/teams',auth[_0x5efd('0xb')](),controller[_0x5efd('0x13')]);router[_0x5efd('0x12')]('/:id/users',auth[_0x5efd('0xb')](),controller[_0x5efd('0x14')]);router[_0x5efd('0x15')](_0x5efd('0xd'),auth[_0x5efd('0xb')](),controller[_0x5efd('0x16')]);router[_0x5efd('0x17')](_0x5efd('0xd'),auth[_0x5efd('0xb')](),controller[_0x5efd('0x18')]);router[_0x5efd('0x17')]('/:id/teams',auth[_0x5efd('0xb')](),controller[_0x5efd('0x19')]);router['delete'](_0x5efd('0x1a'),auth[_0x5efd('0xb')](),controller[_0x5efd('0x1b')]);module[_0x5efd('0x1c')]=router;
\ No newline at end of file
index ef307d8..f3e7d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7900=['exports','STRING','name','INTEGER','ENUM','sequelize'];(function(_0x54f683,_0x3b17c8){var _0x4a9ad4=function(_0xa2f78b){while(--_0xa2f78b){_0x54f683['push'](_0x54f683['shift']());}};_0x4a9ad4(++_0x3b17c8);}(_0x7900,0xa1));var _0x0790=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7900[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0790('0x0'));module[_0x0790('0x1')]={'name':{'type':Sequelize[_0x0790('0x2')],'unique':_0x0790('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0790('0x2')]},'timeout':{'type':Sequelize[_0x0790('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0790('0x5')]('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
+var _0x6ccb=['name','STRING','INTEGER','ENUM','rrmemory','exports'];(function(_0x53146a,_0xf55e73){var _0x1553df=function(_0x1574e5){while(--_0x1574e5){_0x53146a['push'](_0x53146a['shift']());}};_0x1553df(++_0xf55e73);}(_0x6ccb,0xa1));var _0xb6cc=function(_0x2cfa5c,_0x1276c2){_0x2cfa5c=_0x2cfa5c-0x0;var _0x363402=_0x6ccb[_0x2cfa5c];return _0x363402;};'use strict';var Sequelize=require('sequelize');module[_0xb6cc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb6cc('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb6cc('0x2')]},'timeout':{'type':Sequelize[_0xb6cc('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb6cc('0x4')](_0xb6cc('0x5'),'beepall','roundrobin')}};
\ No newline at end of file
index a3c1942..e69583b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8510=['describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','merge','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','Agents','online','interface','flatMap','sequelize','each','forEach','emit','removeTeams','ids','select','field','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','every','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','get','OpenchannelQueues','then','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','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','update','destroy','params'];(function(_0xb7be2b,_0x143d19){var _0x3a2256=function(_0x12fb65){while(--_0x12fb65){_0xb7be2b['push'](_0xb7be2b['shift']());}};_0x3a2256(++_0x143d19);}(_0x8510,0x1e5));var _0x0851=function(_0x471ec4,_0x42c871){_0x471ec4=_0x471ec4-0x0;var _0x43ab60=_0x8510[_0x471ec4];return _0x43ab60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0851('0x0'));var zipdir=require(_0x0851('0x1'));var jsonpatch=require(_0x0851('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0851('0x3'));var Mustache=require(_0x0851('0x4'));var util=require(_0x0851('0x5'));var path=require(_0x0851('0x6'));var sox=require(_0x0851('0x7'));var csv=require(_0x0851('0x8'));var ejs=require(_0x0851('0x9'));var fs=require('fs');var fs_extra=require(_0x0851('0xa'));var _=require(_0x0851('0xb'));var squel=require(_0x0851('0xc'));var crypto=require(_0x0851('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0851('0xe'));var toCsv=require(_0x0851('0x8'));var querystring=require(_0x0851('0xf'));var Papa=require(_0x0851('0x10'));var Redis=require(_0x0851('0x11'));var authService=require(_0x0851('0x12'));var qs=require(_0x0851('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0851('0x14'));var logger=require(_0x0851('0x15'))(_0x0851('0x16'));var utils=require(_0x0851('0x17'));var config=require(_0x0851('0x18'));var licenseUtil=require(_0x0851('0x19'));var db=require(_0x0851('0x1a'))['db'];config[_0x0851('0x1b')]=_[_0x0851('0x1c')](config[_0x0851('0x1b')],{'host':_0x0851('0x1d'),'port':0x18eb});var socket=require(_0x0851('0x1e'))(new Redis(config[_0x0851('0x1b')]));require(_0x0851('0x1f'))[_0x0851('0x20')](socket);function respondWithStatusCode(_0x5f36f0,_0x1067c2){_0x1067c2=_0x1067c2||0xcc;return function(_0x372c61){if(_0x372c61){return _0x5f36f0[_0x0851('0x21')](_0x1067c2);}return _0x5f36f0['status'](_0x1067c2)[_0x0851('0x22')]();};}function respondWithResult(_0x291190,_0x4e24f5){_0x4e24f5=_0x4e24f5||0xc8;return function(_0x29cd0a){if(_0x29cd0a){return _0x291190[_0x0851('0x23')](_0x4e24f5)[_0x0851('0x24')](_0x29cd0a);}};}function respondWithFilteredResult(_0x59731d,_0xbcafb9){return function(_0x3231c5){if(_0x3231c5){var _0x1218bd=typeof _0xbcafb9[_0x0851('0x25')]===_0x0851('0x26')&&typeof _0xbcafb9[_0x0851('0x27')]===_0x0851('0x26');var _0x3c320b=_0x3231c5[_0x0851('0x28')];var _0x190de3=_0x1218bd?0x0:_0xbcafb9[_0x0851('0x25')];var _0xfd29b0=_0x1218bd?_0x3231c5['count']:_0xbcafb9[_0x0851('0x25')]+_0xbcafb9['limit'];var _0x42682e;if(_0xfd29b0>=_0x3c320b){_0xfd29b0=_0x3c320b;_0x42682e=0xc8;}else{_0x42682e=0xce;}_0x59731d[_0x0851('0x23')](_0x42682e);return _0x59731d[_0x0851('0x29')](_0x0851('0x2a'),_0x190de3+'-'+_0xfd29b0+'/'+_0x3c320b)['json'](_0x3231c5);}return null;};}function patchUpdates(_0x350c55){return function(_0x2834c2){try{jsonpatch[_0x0851('0x2b')](_0x2834c2,_0x350c55,!![]);}catch(_0x234cd4){return BPromise[_0x0851('0x2c')](_0x234cd4);}return _0x2834c2[_0x0851('0x2d')]();};}function saveUpdates(_0x1764e3,_0x46ce49){return function(_0x9f4776){if(_0x9f4776){return _0x9f4776['update'](_0x1764e3)['then'](function(_0x369e93){return _0x369e93;});}return null;};}function removeEntity(_0x481105,_0xe474d0){return function(_0x1313cc){if(_0x1313cc){return _0x1313cc['destroy']()['then'](function(){var _0x4a0f2d=_0x1313cc[_0x0851('0x2e')]({'plain':!![]});var _0x17d6de=_0x0851('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x17d6de,'resourceId':_0x4a0f2d['id']}})[_0x0851('0x30')](function(){return _0x1313cc;});})[_0x0851('0x30')](function(){_0x481105[_0x0851('0x23')](0xcc)[_0x0851('0x22')]();});}};}function handleEntityNotFound(_0x47b290,_0x3c8873){return function(_0x1cd969){if(!_0x1cd969){_0x47b290[_0x0851('0x21')](0x194);}return _0x1cd969;};}function handleError(_0x4dbe76,_0x38153e){_0x38153e=_0x38153e||0x1f4;return function(_0x65544e){logger[_0x0851('0x31')](_0x65544e[_0x0851('0x32')]);if(_0x65544e[_0x0851('0x33')]){delete _0x65544e[_0x0851('0x33')];}_0x4dbe76[_0x0851('0x23')](_0x38153e)[_0x0851('0x34')](_0x65544e);};}exports[_0x0851('0x35')]=function(_0xd2e6b4,_0x41f6da){var _0x1000a0={},_0x430839={},_0x1825bf={'count':0x0,'rows':[]};var _0x2ddd09=_[_0x0851('0x36')](db[_0x0851('0x37')][_0x0851('0x38')],function(_0x46e116){return{'name':_0x46e116[_0x0851('0x39')],'type':_0x46e116['type'][_0x0851('0x3a')]};});_0x430839['model']=_[_0x0851('0x36')](_0x2ddd09,_0x0851('0x33'));_0x430839['query']=_[_0x0851('0x3b')](_0xd2e6b4[_0x0851('0x3c')]);_0x430839[_0x0851('0x3d')]=_[_0x0851('0x3e')](_0x430839[_0x0851('0x3f')],_0x430839[_0x0851('0x3c')]);_0x1000a0['attributes']=_[_0x0851('0x3e')](_0x430839[_0x0851('0x3f')],qs[_0x0851('0x40')](_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x40')]));_0x1000a0[_0x0851('0x41')]=_0x1000a0[_0x0851('0x41')][_0x0851('0x42')]?_0x1000a0[_0x0851('0x41')]:_0x430839[_0x0851('0x3f')];if(!_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x43')](_0x0851('0x44'))){_0x1000a0[_0x0851('0x27')]=qs[_0x0851('0x27')](_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x27')]);_0x1000a0[_0x0851('0x25')]=qs[_0x0851('0x25')](_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x25')]);}_0x1000a0[_0x0851('0x45')]=qs['sort'](_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x46')]);_0x1000a0[_0x0851('0x47')]=qs['filters'](_[_0x0851('0x48')](_0xd2e6b4[_0x0851('0x3c')],_0x430839[_0x0851('0x3d')]),_0x2ddd09);if(_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x49')]){_0x1000a0[_0x0851('0x47')]=_['merge'](_0x1000a0[_0x0851('0x47')],{'$or':_['map'](_0x2ddd09,function(_0x30199f){if(_0x30199f[_0x0851('0x4a')]!==_0x0851('0x4b')){var _0x3b0810={};_0x3b0810[_0x30199f[_0x0851('0x33')]]={'$like':'%'+_0xd2e6b4[_0x0851('0x3c')][_0x0851('0x49')]+'%'};return _0x3b0810;}})});}_0x1000a0=_['merge']({},_0x1000a0,_0xd2e6b4[_0x0851('0x4c')]);var _0x345df0={'where':_0x1000a0['where']};return db['OpenchannelQueue'][_0x0851('0x28')](_0x345df0)[_0x0851('0x30')](function(_0x424102){_0x1825bf[_0x0851('0x28')]=_0x424102;if(_0xd2e6b4['query'][_0x0851('0x4d')]){_0x1000a0[_0x0851('0x4e')]=[{'all':!![]}];}return db[_0x0851('0x37')][_0x0851('0x4f')](_0x1000a0);})[_0x0851('0x30')](function(_0x35293a){_0x1825bf[_0x0851('0x50')]=_0x35293a;return _0x1825bf;})[_0x0851('0x30')](respondWithFilteredResult(_0x41f6da,_0x1000a0))['catch'](handleError(_0x41f6da,null));};exports[_0x0851('0x51')]=function(_0x24aa0c,_0x127d0f){var _0x47b0f7={'raw':!![],'where':{'id':_0x24aa0c['params']['id']}},_0x2bb4cb={};_0x2bb4cb['model']=_[_0x0851('0x3b')](db[_0x0851('0x37')][_0x0851('0x38')]);_0x2bb4cb[_0x0851('0x3c')]=_[_0x0851('0x3b')](_0x24aa0c[_0x0851('0x3c')]);_0x2bb4cb[_0x0851('0x3d')]=_[_0x0851('0x3e')](_0x2bb4cb[_0x0851('0x3f')],_0x2bb4cb[_0x0851('0x3c')]);_0x47b0f7[_0x0851('0x41')]=_[_0x0851('0x3e')](_0x2bb4cb['model'],qs['fields'](_0x24aa0c[_0x0851('0x3c')][_0x0851('0x40')]));_0x47b0f7[_0x0851('0x41')]=_0x47b0f7[_0x0851('0x41')][_0x0851('0x42')]?_0x47b0f7[_0x0851('0x41')]:_0x2bb4cb[_0x0851('0x3f')];if(_0x24aa0c['query'][_0x0851('0x4d')]){_0x47b0f7[_0x0851('0x4e')]=[{'all':!![]}];}_0x47b0f7=_['merge']({},_0x47b0f7,_0x24aa0c['options']);return db['OpenchannelQueue'][_0x0851('0x52')](_0x47b0f7)['then'](handleEntityNotFound(_0x127d0f,null))[_0x0851('0x30')](respondWithResult(_0x127d0f,null))[_0x0851('0x53')](handleError(_0x127d0f,null));};exports[_0x0851('0x54')]=function(_0x12167a,_0x166b7e){return db[_0x0851('0x37')][_0x0851('0x54')](_0x12167a[_0x0851('0x55')],{})['then'](function(_0x49b4e0){var _0x2b14e2=_0x12167a[_0x0851('0x56')][_0x0851('0x2e')]({'plain':!![]});if(!_0x2b14e2)throw new Error(_0x0851('0x57'));if(_0x2b14e2[_0x0851('0x58')]===_0x0851('0x56')){var _0x30ea6e=_0x49b4e0[_0x0851('0x2e')]({'plain':!![]});var _0x14e642='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x14e642,'userProfileId':_0x2b14e2[_0x0851('0x59')]},'raw':!![]})[_0x0851('0x30')](function(_0x43a81b){if(_0x43a81b&&_0x43a81b[_0x0851('0x5a')]===0x0){return db['UserProfileResource'][_0x0851('0x54')]({'name':_0x30ea6e['name'],'resourceId':_0x30ea6e['id'],'type':_0x43a81b[_0x0851('0x33')],'sectionId':_0x43a81b['id']},{})[_0x0851('0x30')](function(){return _0x49b4e0;});}else{return _0x49b4e0;}})['catch'](function(_0x8c09d2){logger[_0x0851('0x31')](_0x0851('0x5b'),_0x8c09d2);throw _0x8c09d2;});}return _0x49b4e0;})[_0x0851('0x30')](respondWithResult(_0x166b7e,0xc9))[_0x0851('0x53')](handleError(_0x166b7e,null));};exports[_0x0851('0x5c')]=function(_0x52bdbd,_0x557818){if(_0x52bdbd[_0x0851('0x55')]['id']){delete _0x52bdbd[_0x0851('0x55')]['id'];}return db['OpenchannelQueue'][_0x0851('0x52')]({'where':{'id':_0x52bdbd['params']['id']}})[_0x0851('0x30')](handleEntityNotFound(_0x557818,null))['then'](saveUpdates(_0x52bdbd[_0x0851('0x55')],null))[_0x0851('0x30')](respondWithResult(_0x557818,null))[_0x0851('0x53')](handleError(_0x557818,null));};exports[_0x0851('0x5d')]=function(_0x3b20bc,_0x16efbb){return db[_0x0851('0x37')]['find']({'where':{'id':_0x3b20bc[_0x0851('0x5e')]['id']}})[_0x0851('0x30')](handleEntityNotFound(_0x16efbb,null))['then'](removeEntity(_0x16efbb,null))['catch'](handleError(_0x16efbb,null));};exports[_0x0851('0x5f')]=function(_0x2e6d24,_0x33727b){return db[_0x0851('0x37')]['describe']()[_0x0851('0x30')](respondWithResult(_0x33727b,null))[_0x0851('0x53')](handleError(_0x33727b,null));};exports[_0x0851('0x60')]=function(_0x562153,_0x11ec18,_0x47dcaf){var _0x29883f={'raw':!![],'where':{}},_0x40356c={},_0x30ee6e;return db[_0x0851('0x37')][_0x0851('0x61')]({'where':{'id':_0x562153[_0x0851('0x5e')]['id']}})[_0x0851('0x30')](handleEntityNotFound(_0x11ec18,null))[_0x0851('0x30')](function(_0x172d45){if(_0x172d45){_0x30ee6e=_0x172d45[_0x0851('0x2e')]({'plain':!![]});_0x40356c['model']=_[_0x0851('0x3b')](db[_0x0851('0x62')][_0x0851('0x38')]);_0x40356c[_0x0851('0x3c')]=_[_0x0851('0x3b')](_0x562153[_0x0851('0x3c')]);_0x40356c['filters']=_[_0x0851('0x3e')](_0x40356c[_0x0851('0x3f')],_0x40356c['query']);_0x29883f[_0x0851('0x41')]=_[_0x0851('0x3e')](_0x40356c[_0x0851('0x3f')],qs['fields'](_0x562153['query'][_0x0851('0x40')]));_0x29883f[_0x0851('0x41')]=_0x29883f[_0x0851('0x41')][_0x0851('0x42')]?_0x29883f[_0x0851('0x41')]:_0x40356c[_0x0851('0x3f')];if(!_0x562153[_0x0851('0x3c')][_0x0851('0x43')](_0x0851('0x44'))){_0x29883f[_0x0851('0x27')]=qs[_0x0851('0x27')](_0x562153['query']['limit']);_0x29883f['offset']=qs[_0x0851('0x25')](_0x562153['query'][_0x0851('0x25')]);}_0x29883f[_0x0851('0x45')]=qs[_0x0851('0x46')](_0x562153['query']['sort']);_0x29883f[_0x0851('0x47')]=qs[_0x0851('0x3d')](_[_0x0851('0x48')](_0x562153['query'],_0x40356c[_0x0851('0x3d')]));_0x29883f['where'][_0x0851('0x63')]=_0x172d45['id'];if(_0x562153[_0x0851('0x3c')][_0x0851('0x49')]){_0x29883f[_0x0851('0x47')]=_[_0x0851('0x64')](_0x29883f[_0x0851('0x47')],{'$or':_[_0x0851('0x36')](_0x29883f[_0x0851('0x41')],function(_0x4cf9da){var _0xf7eaec={};_0xf7eaec[_0x4cf9da]={'$like':'%'+_0x562153['query'][_0x0851('0x49')]+'%'};return _0xf7eaec;})});}_0x29883f=_[_0x0851('0x64')]({},_0x29883f,_0x562153['options']);return db[_0x0851('0x62')][_0x0851('0x4f')](_0x29883f);}})['then'](function(_0x327a0d){if(_0x327a0d){return db[_0x0851('0x65')][_0x0851('0x66')]({'where':{'id':_['map'](_0x327a0d,'UserId'),'role':_0x0851('0x67')},'attributes':['id',_0x0851('0x33'),_0x0851('0x68'),_0x0851('0x69'),_0x0851('0x6a')]});}})['then'](function(_0x6456fe){if(_0x6456fe){return{'count':_0x6456fe[_0x0851('0x28')],'rows':_[_0x0851('0x36')](_0x6456fe[_0x0851('0x50')],function(_0x3a09c5){return{'membername':_0x3a09c5[_0x0851('0x33')],'UserId':_0x3a09c5['id'],'queue_name':_0x30ee6e[_0x0851('0x33')],'OpenchannelQueueId':_0x30ee6e['id'],'interface':util[_0x0851('0x6b')](_0x0851('0x6c'),_0x0851('0x6d'),_0x3a09c5[_0x0851('0x33')]),'penalty':0x0,'paused':_0x3a09c5[_0x0851('0x68')],'createdAt':_0x3a09c5[_0x0851('0x6a')],'updatedAt':_0x3a09c5[_0x0851('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0851('0x30')](respondWithFilteredResult(_0x11ec18,_0x29883f))[_0x0851('0x53')](handleError(_0x11ec18,null));};exports[_0x0851('0x6e')]=function(_0x51a409,_0x556171,_0xd5079e){var _0x454a4b={};var _0x19dcc8={};var _0xba3e3a;var _0x314f38;return db[_0x0851('0x37')][_0x0851('0x61')]({'where':{'id':_0x51a409['params']['id']}})['then'](handleEntityNotFound(_0x556171,null))[_0x0851('0x30')](function(_0x164eb4){if(_0x164eb4){_0xba3e3a=_0x164eb4;_0x19dcc8[_0x0851('0x3f')]=_[_0x0851('0x3b')](db[_0x0851('0x6f')][_0x0851('0x38')]);_0x19dcc8['query']=_[_0x0851('0x3b')](_0x51a409[_0x0851('0x3c')]);_0x19dcc8['filters']=_['intersection'](_0x19dcc8[_0x0851('0x3f')],_0x19dcc8[_0x0851('0x3c')]);_0x454a4b[_0x0851('0x41')]=_['intersection'](_0x19dcc8[_0x0851('0x3f')],qs[_0x0851('0x40')](_0x51a409['query'][_0x0851('0x40')]));_0x454a4b[_0x0851('0x41')]=_0x454a4b['attributes'][_0x0851('0x42')]?_0x454a4b[_0x0851('0x41')]:_0x19dcc8['model'];_0x454a4b['order']=qs[_0x0851('0x46')](_0x51a409['query'][_0x0851('0x46')]);_0x454a4b['where']=qs[_0x0851('0x3d')](_[_0x0851('0x48')](_0x51a409[_0x0851('0x3c')],_0x19dcc8[_0x0851('0x3d')]));if(_0x51a409[_0x0851('0x3c')][_0x0851('0x49')]){_0x454a4b[_0x0851('0x47')]=_[_0x0851('0x64')](_0x454a4b[_0x0851('0x47')],{'$or':_[_0x0851('0x36')](_0x454a4b['attributes'],function(_0x14f637){var _0x3ee01d={};_0x3ee01d[_0x14f637]={'$like':'%'+_0x51a409[_0x0851('0x3c')][_0x0851('0x49')]+'%'};return _0x3ee01d;})});}_0x454a4b=_[_0x0851('0x64')]({},_0x454a4b,_0x51a409['options']);return _0xba3e3a[_0x0851('0x6e')](_0x454a4b);}})[_0x0851('0x30')](function(_0x30e2b2){if(_0x30e2b2){_0x314f38=_0x30e2b2[_0x0851('0x42')];if(!_0x51a409['query']['hasOwnProperty'](_0x0851('0x44'))){_0x454a4b[_0x0851('0x27')]=qs[_0x0851('0x27')](_0x51a409[_0x0851('0x3c')][_0x0851('0x27')]);_0x454a4b[_0x0851('0x25')]=qs[_0x0851('0x25')](_0x51a409[_0x0851('0x3c')][_0x0851('0x25')]);}return _0xba3e3a[_0x0851('0x6e')](_0x454a4b);}})[_0x0851('0x30')](function(_0x1a4808){if(_0x1a4808){return _0x1a4808?{'count':_0x314f38,'rows':_0x1a4808}:null;}})[_0x0851('0x30')](respondWithResult(_0x556171,null))['catch'](handleError(_0x556171,null));};exports['addTeams']=function(_0x25d887,_0x2524c2,_0x3cb7a2){var _0xe04260=_0x25d887[_0x0851('0x55')]['ids'];return db[_0x0851('0x6f')][_0x0851('0x4f')]({'where':{'id':_0xe04260},'attributes':['id'],'include':[{'model':db[_0x0851('0x65')],'as':_0x0851('0x70'),'attributes':['id',_0x0851('0x33'),_0x0851('0x71'),'voicePause',_0x0851('0x72')],'raw':!![]}]})[_0x0851('0x30')](function(_0x1880a5){if(_0x1880a5){var _0x428f5a=_[_0x0851('0x73')](_0x1880a5,function(_0x138ea4){var _0xdf0bc4=_0x138ea4['get']({'plain':!![]});return _0xdf0bc4[_0x0851('0x70')];});return db[_0x0851('0x37')][_0x0851('0x52')]({'where':{'id':_0x25d887['params']['id']}})['then'](function(_0x2adbd4){return db[_0x0851('0x74')]['transaction'](function(_0x1e5677){return _0x2adbd4['addTeams'](_0xe04260,{'transaction':_0x1e5677})[_0x0851('0x30')](function(){return BPromise[_0x0851('0x75')](_0x428f5a,function(_0x54cb49){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x54cb49['id'],'OpenchannelQueueId':_0x25d887[_0x0851('0x5e')]['id']},'transaction':_0x1e5677});});})['then'](function(){_0x428f5a[_0x0851('0x76')](function(_0x38ed43){socket[_0x0851('0x77')]('userOpenchannelQueue:save',{'UserId':_0x38ed43['id'],'OpenchannelQueueId':_0x2adbd4['id']});});});});});}})[_0x0851('0x30')](respondWithStatusCode(_0x2524c2,null))[_0x0851('0x53')](handleError(_0x2524c2,null));};exports[_0x0851('0x78')]=function(_0x3355cb,_0x5b95f9,_0x1ae92a){return db[_0x0851('0x6f')][_0x0851('0x4f')]({'where':{'id':_0x3355cb[_0x0851('0x3c')][_0x0851('0x79')]},'attributes':['id'],'include':[{'model':db[_0x0851('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0851('0x30')](handleEntityNotFound(_0x5b95f9,null))[_0x0851('0x30')](function(_0x1e1bba){var _0x474e5e=_[_0x0851('0x36')](_0x1e1bba,'id');var _0xacaf33=[];var _0x365296=[];var _0x5751b2=squel[_0x0851('0x7a')]();_0x5751b2[_0x0851('0x7b')]('tq.TeamId')['from'](_0x0851('0x7c'),'tq')[_0x0851('0x7d')](_0x0851('0x7e'),'ut',_0x0851('0x7f'))[_0x0851('0x47')]('OpenchannelQueueId\x20=\x20?',_0x3355cb[_0x0851('0x5e')]['id']);for(var _0x474932=0x0;_0x474932<_0x1e1bba[_0x0851('0x42')];_0x474932+=0x1){let _0x59af66=_0x1e1bba[_0x474932];for(var _0x2053df=0x0;_0x2053df<_0x59af66[_0x0851('0x70')][_0x0851('0x42')];_0x2053df+=0x1){let _0x4917c3=_0x59af66[_0x0851('0x70')][_0x2053df];var _0x1096f6=_0x5751b2['clone']();_0x1096f6['where']('ut.UserId\x20=\x20?',_0x4917c3['id']);_0x365296[_0x0851('0x80')](db['sequelize'][_0x0851('0x3c')](_0x1096f6[_0x0851('0x81')](),{'type':db[_0x0851('0x74')]['QueryTypes']['SELECT']})[_0x0851('0x30')](function(_0x516e87){if(_0x516e87[_0x0851('0x42')]===0x1){return _0x4917c3['id'];}else{var _0x4bd361=_[_0x0851('0x82')](_['map'](_0x516e87,_0x0851('0x83')),function(_0x383001){return _[_0x0851('0x84')](_0x474e5e,_0x383001);});if(_0x4bd361){return _0x4917c3['id'];}}}));}}return BPromise['all'](_0x365296)[_0x0851('0x30')](function(_0x2a1d1d){_0xacaf33=_(_0xacaf33)[_0x0851('0x85')](_0x2a1d1d)[_0x0851('0x86')]()[_0x0851('0x87')]();return db[_0x0851('0x37')]['find']({'where':{'id':_0x3355cb[_0x0851('0x5e')]['id']}})['then'](function(_0x2131c7){return db['sequelize'][_0x0851('0x88')](function(_0x135238){return _0x2131c7[_0x0851('0x78')](_0x3355cb[_0x0851('0x3c')][_0x0851('0x79')],{'transaction':_0x135238})[_0x0851('0x30')](function(){if(!_[_0x0851('0x89')](_0xacaf33)){return _0x2131c7[_0x0851('0x8a')](_0xacaf33,{'transaction':_0x135238});}})[_0x0851('0x30')](function(){_0xacaf33[_0x0851('0x76')](function(_0x1e5145){socket[_0x0851('0x77')](_0x0851('0x8b'),{'UserId':_0x1e5145,'OpenchannelQueueId':_0x2131c7['id']});});});});});});})['then'](respondWithStatusCode(_0x5b95f9,null))[_0x0851('0x53')](handleError(_0x5b95f9,null));};exports[_0x0851('0x8c')]=function(_0xe3edb6,_0x21e1e4,_0xe353e){return db[_0x0851('0x37')][_0x0851('0x52')]({'where':{'id':_0xe3edb6[_0x0851('0x5e')]['id']}})[_0x0851('0x30')](handleEntityNotFound(_0x21e1e4,null))[_0x0851('0x30')](function(_0x15e8ae){if(_0x15e8ae){return _0x15e8ae['addAgents'](_0xe3edb6['body'][_0x0851('0x79')],_['omit'](_0xe3edb6[_0x0851('0x55')],[_0x0851('0x79'),'id'])||{})[_0x0851('0x8d')](function(_0x1a0d25){for(var _0x1d6f9b=0x0;_0x1d6f9b<_0xe3edb6['body'][_0x0851('0x79')][_0x0851('0x42')];_0x1d6f9b+=0x1){socket['emit'](_0x0851('0x8e'),{'UserId':_0xe3edb6[_0x0851('0x55')][_0x0851('0x79')][_0x1d6f9b],'OpenchannelQueueId':_0xe3edb6[_0x0851('0x5e')]['id']});}return _0x1a0d25;});}})[_0x0851('0x30')](respondWithResult(_0x21e1e4,null))[_0x0851('0x53')](handleError(_0x21e1e4,null));};exports[_0x0851('0x8a')]=function(_0x5aa428,_0x11bcde,_0x3d06cb){return db[_0x0851('0x37')]['find']({'where':{'id':_0x5aa428[_0x0851('0x5e')]['id']}})[_0x0851('0x30')](handleEntityNotFound(_0x11bcde,null))['then'](function(_0x141858){if(_0x141858){return _0x141858['removeAgents'](_0x5aa428[_0x0851('0x3c')][_0x0851('0x79')])[_0x0851('0x30')](function(){if(_[_0x0851('0x8f')](_0x5aa428[_0x0851('0x3c')][_0x0851('0x79')])){for(var _0x47e484=0x0;_0x47e484<_0x5aa428[_0x0851('0x3c')][_0x0851('0x79')][_0x0851('0x42')];_0x47e484+=0x1){socket['emit'](_0x0851('0x8b'),{'UserId':Number(_0x5aa428[_0x0851('0x3c')][_0x0851('0x79')][_0x47e484]),'OpenchannelQueueId':Number(_0x5aa428['params']['id'])});}}else{socket['emit'](_0x0851('0x8b'),{'UserId':Number(_0x5aa428[_0x0851('0x3c')][_0x0851('0x79')]),'OpenchannelQueueId':Number(_0x5aa428[_0x0851('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x11bcde,null))[_0x0851('0x53')](handleError(_0x11bcde,null));};exports[_0x0851('0x90')]=function(_0x2d6b53,_0x335477,_0x32b81d){var _0x38b70b={};var _0x370b78={};var _0x1a1cd6;var _0x206ba3;return db['OpenchannelQueue'][_0x0851('0x61')]({'where':{'id':_0x2d6b53[_0x0851('0x5e')]['id']}})[_0x0851('0x30')](handleEntityNotFound(_0x335477,null))[_0x0851('0x30')](function(_0xf7675){if(_0xf7675){_0x1a1cd6=_0xf7675;_0x370b78[_0x0851('0x3f')]=_[_0x0851('0x3b')](db[_0x0851('0x65')]['rawAttributes']);_0x370b78[_0x0851('0x3c')]=_[_0x0851('0x3b')](_0x2d6b53[_0x0851('0x3c')]);_0x370b78['filters']=_[_0x0851('0x3e')](_0x370b78[_0x0851('0x3f')],_0x370b78['query']);_0x38b70b['attributes']=_[_0x0851('0x3e')](_0x370b78['model'],qs[_0x0851('0x40')](_0x2d6b53[_0x0851('0x3c')]['fields']));_0x38b70b[_0x0851('0x41')]=_0x38b70b[_0x0851('0x41')]['length']?_0x38b70b['attributes']:_0x370b78[_0x0851('0x3f')];_0x38b70b['order']=qs[_0x0851('0x46')](_0x2d6b53[_0x0851('0x3c')][_0x0851('0x46')]);_0x38b70b[_0x0851('0x47')]=qs[_0x0851('0x3d')](_[_0x0851('0x48')](_0x2d6b53[_0x0851('0x3c')],_0x370b78[_0x0851('0x3d')]));if(_0x2d6b53[_0x0851('0x3c')][_0x0851('0x49')]){_0x38b70b[_0x0851('0x47')]=_[_0x0851('0x64')](_0x38b70b[_0x0851('0x47')],{'$or':_[_0x0851('0x36')](_0x38b70b[_0x0851('0x41')],function(_0x1b3236){var _0x3d4b32={};_0x3d4b32[_0x1b3236]={'$like':'%'+_0x2d6b53['query'][_0x0851('0x49')]+'%'};return _0x3d4b32;})});}_0x38b70b=_['merge']({},_0x38b70b,_0x2d6b53['options']);return _0x1a1cd6[_0x0851('0x90')](_0x38b70b);}})[_0x0851('0x30')](function(_0x12371c){if(_0x12371c){_0x206ba3=_0x12371c[_0x0851('0x42')];if(!_0x2d6b53[_0x0851('0x3c')][_0x0851('0x43')](_0x0851('0x44'))){_0x38b70b['limit']=qs[_0x0851('0x27')](_0x2d6b53['query'][_0x0851('0x27')]);_0x38b70b['offset']=qs[_0x0851('0x25')](_0x2d6b53['query'][_0x0851('0x25')]);}return _0x1a1cd6[_0x0851('0x90')](_0x38b70b);}})['then'](function(_0x27a5bc){if(_0x27a5bc){return _0x27a5bc?{'count':_0x206ba3,'rows':_0x27a5bc}:null;}})[_0x0851('0x30')](respondWithResult(_0x335477,null))[_0x0851('0x53')](handleError(_0x335477,null));};
\ No newline at end of file
+var _0x943a=['redis','defaults','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','then','OpenchannelQueues','UserProfileResource','destroy','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','get','UserOpenchannelQueue','OpenchannelQueueId','options','findAll','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','createdAt','findOne','Team','getTeams','hasOwnProperty','body','ids','User','online','voicePause','interface','Agents','sequelize','transaction','addTeams','forEach','userOpenchannelQueue:save','removeTeams','select','field','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x391c12,_0x4665f8){var _0x47e889=function(_0x19ff8e){while(--_0x19ff8e){_0x391c12['push'](_0x391c12['shift']());}};_0x47e889(++_0x4665f8);}(_0x943a,0xfd));var _0xa943=function(_0x51d668,_0x2908c3){_0x51d668=_0x51d668-0x0;var _0x38b15c=_0x943a[_0x51d668];return _0x38b15c;};'use strict';var emlformat=require(_0xa943('0x0'));var rimraf=require(_0xa943('0x1'));var zipdir=require(_0xa943('0x2'));var jsonpatch=require(_0xa943('0x3'));var rp=require(_0xa943('0x4'));var moment=require(_0xa943('0x5'));var BPromise=require(_0xa943('0x6'));var Mustache=require(_0xa943('0x7'));var util=require(_0xa943('0x8'));var path=require(_0xa943('0x9'));var sox=require(_0xa943('0xa'));var csv=require(_0xa943('0xb'));var ejs=require(_0xa943('0xc'));var fs=require('fs');var fs_extra=require(_0xa943('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa943('0xe'));var toCsv=require(_0xa943('0xb'));var querystring=require(_0xa943('0xf'));var Papa=require(_0xa943('0x10'));var Redis=require(_0xa943('0x11'));var authService=require(_0xa943('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa943('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa943('0x14'))(_0xa943('0x15'));var utils=require(_0xa943('0x16'));var config=require(_0xa943('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa943('0x18'))['db'];config[_0xa943('0x19')]=_[_0xa943('0x1a')](config[_0xa943('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa943('0x19')]));require(_0xa943('0x1b'))[_0xa943('0x1c')](socket);function respondWithStatusCode(_0x5a83d2,_0x10622e){_0x10622e=_0x10622e||0xcc;return function(_0x56b54a){if(_0x56b54a){return _0x5a83d2[_0xa943('0x1d')](_0x10622e);}return _0x5a83d2[_0xa943('0x1e')](_0x10622e)[_0xa943('0x1f')]();};}function respondWithResult(_0x5edde1,_0x35ee9c){_0x35ee9c=_0x35ee9c||0xc8;return function(_0x58fc0c){if(_0x58fc0c){return _0x5edde1[_0xa943('0x1e')](_0x35ee9c)['json'](_0x58fc0c);}};}function respondWithFilteredResult(_0x387e7a,_0x2ffe75){return function(_0x5e7137){if(_0x5e7137){var _0x27e3d2=typeof _0x2ffe75[_0xa943('0x20')]===_0xa943('0x21')&&typeof _0x2ffe75['limit']==='undefined';var _0xae86e0=_0x5e7137[_0xa943('0x22')];var _0x200b15=_0x27e3d2?0x0:_0x2ffe75[_0xa943('0x20')];var _0x594353=_0x27e3d2?_0x5e7137['count']:_0x2ffe75[_0xa943('0x20')]+_0x2ffe75[_0xa943('0x23')];var _0xcf2bee;if(_0x594353>=_0xae86e0){_0x594353=_0xae86e0;_0xcf2bee=0xc8;}else{_0xcf2bee=0xce;}_0x387e7a[_0xa943('0x1e')](_0xcf2bee);return _0x387e7a[_0xa943('0x24')](_0xa943('0x25'),_0x200b15+'-'+_0x594353+'/'+_0xae86e0)[_0xa943('0x26')](_0x5e7137);}return null;};}function patchUpdates(_0x346de0){return function(_0x5e0f15){try{jsonpatch['apply'](_0x5e0f15,_0x346de0,!![]);}catch(_0x57b902){return BPromise['reject'](_0x57b902);}return _0x5e0f15[_0xa943('0x27')]();};}function saveUpdates(_0x163909,_0x45dada){return function(_0x4525c2){if(_0x4525c2){return _0x4525c2[_0xa943('0x28')](_0x163909)[_0xa943('0x29')](function(_0x2966b5){return _0x2966b5;});}return null;};}function removeEntity(_0x35547d,_0x47248f){return function(_0x207004){if(_0x207004){return _0x207004['destroy']()[_0xa943('0x29')](function(){var _0x2c288e=_0x207004['get']({'plain':!![]});var _0x39d7b6=_0xa943('0x2a');return db[_0xa943('0x2b')][_0xa943('0x2c')]({'where':{'type':_0x39d7b6,'resourceId':_0x2c288e['id']}})[_0xa943('0x29')](function(){return _0x207004;});})['then'](function(){_0x35547d[_0xa943('0x1e')](0xcc)[_0xa943('0x1f')]();});}};}function handleEntityNotFound(_0x4cf90d,_0x18cd4e){return function(_0x3dee89){if(!_0x3dee89){_0x4cf90d[_0xa943('0x1d')](0x194);}return _0x3dee89;};}function handleError(_0x37cb07,_0x2cad23){_0x2cad23=_0x2cad23||0x1f4;return function(_0xd21666){logger['error'](_0xd21666[_0xa943('0x2d')]);if(_0xd21666[_0xa943('0x2e')]){delete _0xd21666[_0xa943('0x2e')];}_0x37cb07['status'](_0x2cad23)[_0xa943('0x2f')](_0xd21666);};}exports[_0xa943('0x30')]=function(_0x464e8a,_0x45f613){var _0x2de383={},_0xcfc9da={},_0x21424f={'count':0x0,'rows':[]};var _0x4e6ba0=_[_0xa943('0x31')](db[_0xa943('0x32')][_0xa943('0x33')],function(_0x4e9ad7){return{'name':_0x4e9ad7[_0xa943('0x34')],'type':_0x4e9ad7[_0xa943('0x35')]['key']};});_0xcfc9da['model']=_[_0xa943('0x31')](_0x4e6ba0,_0xa943('0x2e'));_0xcfc9da[_0xa943('0x36')]=_[_0xa943('0x37')](_0x464e8a['query']);_0xcfc9da[_0xa943('0x38')]=_[_0xa943('0x39')](_0xcfc9da[_0xa943('0x3a')],_0xcfc9da[_0xa943('0x36')]);_0x2de383[_0xa943('0x3b')]=_[_0xa943('0x39')](_0xcfc9da[_0xa943('0x3a')],qs[_0xa943('0x3c')](_0x464e8a[_0xa943('0x36')][_0xa943('0x3c')]));_0x2de383[_0xa943('0x3b')]=_0x2de383[_0xa943('0x3b')][_0xa943('0x3d')]?_0x2de383[_0xa943('0x3b')]:_0xcfc9da['model'];if(!_0x464e8a[_0xa943('0x36')]['hasOwnProperty'](_0xa943('0x3e'))){_0x2de383['limit']=qs[_0xa943('0x23')](_0x464e8a[_0xa943('0x36')][_0xa943('0x23')]);_0x2de383[_0xa943('0x20')]=qs[_0xa943('0x20')](_0x464e8a['query']['offset']);}_0x2de383[_0xa943('0x3f')]=qs[_0xa943('0x40')](_0x464e8a[_0xa943('0x36')][_0xa943('0x40')]);_0x2de383['where']=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x464e8a['query'],_0xcfc9da[_0xa943('0x38')]),_0x4e6ba0);if(_0x464e8a['query']['filter']){_0x2de383[_0xa943('0x42')]=_[_0xa943('0x43')](_0x2de383['where'],{'$or':_[_0xa943('0x31')](_0x4e6ba0,function(_0x188146){if(_0x188146[_0xa943('0x35')]!==_0xa943('0x44')){var _0x3081c4={};_0x3081c4[_0x188146[_0xa943('0x2e')]]={'$like':'%'+_0x464e8a[_0xa943('0x36')][_0xa943('0x45')]+'%'};return _0x3081c4;}})});}_0x2de383=_[_0xa943('0x43')]({},_0x2de383,_0x464e8a['options']);var _0x54211d={'where':_0x2de383[_0xa943('0x42')]};return db[_0xa943('0x32')][_0xa943('0x22')](_0x54211d)[_0xa943('0x29')](function(_0x311762){_0x21424f[_0xa943('0x22')]=_0x311762;if(_0x464e8a[_0xa943('0x36')][_0xa943('0x46')]){_0x2de383['include']=[{'all':!![]}];}return db[_0xa943('0x32')]['findAll'](_0x2de383);})[_0xa943('0x29')](function(_0x1e38da){_0x21424f['rows']=_0x1e38da;return _0x21424f;})[_0xa943('0x29')](respondWithFilteredResult(_0x45f613,_0x2de383))[_0xa943('0x47')](handleError(_0x45f613,null));};exports['show']=function(_0x54e8f9,_0x1fabff){var _0xe85c33={'raw':!![],'where':{'id':_0x54e8f9[_0xa943('0x48')]['id']}},_0x10fe8e={};_0x10fe8e[_0xa943('0x3a')]=_[_0xa943('0x37')](db['OpenchannelQueue'][_0xa943('0x33')]);_0x10fe8e['query']=_['keys'](_0x54e8f9[_0xa943('0x36')]);_0x10fe8e[_0xa943('0x38')]=_[_0xa943('0x39')](_0x10fe8e[_0xa943('0x3a')],_0x10fe8e['query']);_0xe85c33[_0xa943('0x3b')]=_[_0xa943('0x39')](_0x10fe8e[_0xa943('0x3a')],qs[_0xa943('0x3c')](_0x54e8f9[_0xa943('0x36')][_0xa943('0x3c')]));_0xe85c33[_0xa943('0x3b')]=_0xe85c33[_0xa943('0x3b')]['length']?_0xe85c33[_0xa943('0x3b')]:_0x10fe8e[_0xa943('0x3a')];if(_0x54e8f9[_0xa943('0x36')][_0xa943('0x46')]){_0xe85c33[_0xa943('0x49')]=[{'all':!![]}];}_0xe85c33=_['merge']({},_0xe85c33,_0x54e8f9['options']);return db['OpenchannelQueue'][_0xa943('0x4a')](_0xe85c33)[_0xa943('0x29')](handleEntityNotFound(_0x1fabff,null))[_0xa943('0x29')](respondWithResult(_0x1fabff,null))[_0xa943('0x47')](handleError(_0x1fabff,null));};exports[_0xa943('0x4b')]=function(_0x5a9963,_0xdfab69){return db['OpenchannelQueue'][_0xa943('0x4b')](_0x5a9963['body'],{})['then'](function(_0x364aa7){var _0x58b3d=_0x5a9963[_0xa943('0x4c')]['get']({'plain':!![]});if(!_0x58b3d)throw new Error(_0xa943('0x4d'));if(_0x58b3d[_0xa943('0x4e')]===_0xa943('0x4c')){var _0x3bc414=_0x364aa7['get']({'plain':!![]});var _0x2204e3=_0xa943('0x2a');return db[_0xa943('0x4f')]['find']({'where':{'name':_0x2204e3,'userProfileId':_0x58b3d['userProfileId']},'raw':!![]})[_0xa943('0x29')](function(_0x34f9a8){if(_0x34f9a8&&_0x34f9a8[_0xa943('0x50')]===0x0){return db[_0xa943('0x2b')]['create']({'name':_0x3bc414[_0xa943('0x2e')],'resourceId':_0x3bc414['id'],'type':_0x34f9a8[_0xa943('0x2e')],'sectionId':_0x34f9a8['id']},{})[_0xa943('0x29')](function(){return _0x364aa7;});}else{return _0x364aa7;}})[_0xa943('0x47')](function(_0x2ece02){logger[_0xa943('0x51')](_0xa943('0x52'),_0x2ece02);throw _0x2ece02;});}return _0x364aa7;})[_0xa943('0x29')](respondWithResult(_0xdfab69,0xc9))['catch'](handleError(_0xdfab69,null));};exports[_0xa943('0x28')]=function(_0x1ef5f4,_0x56f03d){if(_0x1ef5f4['body']['id']){delete _0x1ef5f4['body']['id'];}return db[_0xa943('0x32')]['find']({'where':{'id':_0x1ef5f4[_0xa943('0x48')]['id']}})[_0xa943('0x29')](handleEntityNotFound(_0x56f03d,null))['then'](saveUpdates(_0x1ef5f4['body'],null))[_0xa943('0x29')](respondWithResult(_0x56f03d,null))[_0xa943('0x47')](handleError(_0x56f03d,null));};exports[_0xa943('0x2c')]=function(_0x352c91,_0x2e6528){return db[_0xa943('0x32')]['find']({'where':{'id':_0x352c91[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e6528,null))[_0xa943('0x29')](removeEntity(_0x2e6528,null))['catch'](handleError(_0x2e6528,null));};exports[_0xa943('0x53')]=function(_0x1fef61,_0x28110d){return db[_0xa943('0x32')][_0xa943('0x53')]()[_0xa943('0x29')](respondWithResult(_0x28110d,null))[_0xa943('0x47')](handleError(_0x28110d,null));};exports[_0xa943('0x54')]=function(_0x351cde,_0x1d326b,_0x1f2626){var _0x5498d9={'raw':!![],'where':{}},_0x1d16b3={},_0xf54421;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x351cde[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d326b,null))['then'](function(_0x48372b){if(_0x48372b){_0xf54421=_0x48372b[_0xa943('0x55')]({'plain':!![]});_0x1d16b3[_0xa943('0x3a')]=_['keys'](db[_0xa943('0x56')][_0xa943('0x33')]);_0x1d16b3['query']=_[_0xa943('0x37')](_0x351cde['query']);_0x1d16b3['filters']=_[_0xa943('0x39')](_0x1d16b3[_0xa943('0x3a')],_0x1d16b3[_0xa943('0x36')]);_0x5498d9[_0xa943('0x3b')]=_['intersection'](_0x1d16b3[_0xa943('0x3a')],qs['fields'](_0x351cde['query']['fields']));_0x5498d9['attributes']=_0x5498d9[_0xa943('0x3b')][_0xa943('0x3d')]?_0x5498d9[_0xa943('0x3b')]:_0x1d16b3[_0xa943('0x3a')];if(!_0x351cde[_0xa943('0x36')]['hasOwnProperty'](_0xa943('0x3e'))){_0x5498d9[_0xa943('0x23')]=qs[_0xa943('0x23')](_0x351cde[_0xa943('0x36')][_0xa943('0x23')]);_0x5498d9[_0xa943('0x20')]=qs[_0xa943('0x20')](_0x351cde[_0xa943('0x36')]['offset']);}_0x5498d9[_0xa943('0x3f')]=qs[_0xa943('0x40')](_0x351cde['query']['sort']);_0x5498d9[_0xa943('0x42')]=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x351cde['query'],_0x1d16b3[_0xa943('0x38')]));_0x5498d9['where'][_0xa943('0x57')]=_0x48372b['id'];if(_0x351cde[_0xa943('0x36')][_0xa943('0x45')]){_0x5498d9[_0xa943('0x42')]=_[_0xa943('0x43')](_0x5498d9[_0xa943('0x42')],{'$or':_[_0xa943('0x31')](_0x5498d9[_0xa943('0x3b')],function(_0x525e70){var _0x1174a6={};_0x1174a6[_0x525e70]={'$like':'%'+_0x351cde['query'][_0xa943('0x45')]+'%'};return _0x1174a6;})});}_0x5498d9=_[_0xa943('0x43')]({},_0x5498d9,_0x351cde[_0xa943('0x58')]);return db['UserOpenchannelQueue'][_0xa943('0x59')](_0x5498d9);}})[_0xa943('0x29')](function(_0xc5943e){if(_0xc5943e){return db['User'][_0xa943('0x5a')]({'where':{'id':_[_0xa943('0x31')](_0xc5943e,_0xa943('0x5b')),'role':_0xa943('0x5c')},'attributes':['id',_0xa943('0x2e'),_0xa943('0x5d'),_0xa943('0x5e'),'createdAt']});}})[_0xa943('0x29')](function(_0x5efe06){if(_0x5efe06){return{'count':_0x5efe06['count'],'rows':_['map'](_0x5efe06[_0xa943('0x5f')],function(_0x43853b){return{'membername':_0x43853b[_0xa943('0x2e')],'UserId':_0x43853b['id'],'queue_name':_0xf54421['name'],'OpenchannelQueueId':_0xf54421['id'],'interface':util[_0xa943('0x60')](_0xa943('0x61'),'SIP',_0x43853b[_0xa943('0x2e')]),'penalty':0x0,'paused':_0x43853b[_0xa943('0x5d')],'createdAt':_0x43853b[_0xa943('0x62')],'updatedAt':_0x43853b[_0xa943('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d326b,_0x5498d9))[_0xa943('0x47')](handleError(_0x1d326b,null));};exports['getTeams']=function(_0x848b0b,_0x2b0623,_0xf93ae6){var _0x5c3fed={};var _0x377fc6={};var _0x5f0704;var _0xec6df7;return db[_0xa943('0x32')][_0xa943('0x63')]({'where':{'id':_0x848b0b[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b0623,null))[_0xa943('0x29')](function(_0x5484b3){if(_0x5484b3){_0x5f0704=_0x5484b3;_0x377fc6[_0xa943('0x3a')]=_[_0xa943('0x37')](db[_0xa943('0x64')][_0xa943('0x33')]);_0x377fc6['query']=_[_0xa943('0x37')](_0x848b0b['query']);_0x377fc6['filters']=_[_0xa943('0x39')](_0x377fc6[_0xa943('0x3a')],_0x377fc6['query']);_0x5c3fed[_0xa943('0x3b')]=_[_0xa943('0x39')](_0x377fc6[_0xa943('0x3a')],qs['fields'](_0x848b0b['query'][_0xa943('0x3c')]));_0x5c3fed[_0xa943('0x3b')]=_0x5c3fed[_0xa943('0x3b')][_0xa943('0x3d')]?_0x5c3fed[_0xa943('0x3b')]:_0x377fc6['model'];_0x5c3fed['order']=qs[_0xa943('0x40')](_0x848b0b[_0xa943('0x36')][_0xa943('0x40')]);_0x5c3fed['where']=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x848b0b[_0xa943('0x36')],_0x377fc6[_0xa943('0x38')]));if(_0x848b0b[_0xa943('0x36')]['filter']){_0x5c3fed[_0xa943('0x42')]=_[_0xa943('0x43')](_0x5c3fed[_0xa943('0x42')],{'$or':_[_0xa943('0x31')](_0x5c3fed[_0xa943('0x3b')],function(_0x36c0de){var _0x3ba4ac={};_0x3ba4ac[_0x36c0de]={'$like':'%'+_0x848b0b[_0xa943('0x36')][_0xa943('0x45')]+'%'};return _0x3ba4ac;})});}_0x5c3fed=_[_0xa943('0x43')]({},_0x5c3fed,_0x848b0b[_0xa943('0x58')]);return _0x5f0704[_0xa943('0x65')](_0x5c3fed);}})[_0xa943('0x29')](function(_0x4f1356){if(_0x4f1356){_0xec6df7=_0x4f1356[_0xa943('0x3d')];if(!_0x848b0b['query'][_0xa943('0x66')](_0xa943('0x3e'))){_0x5c3fed[_0xa943('0x23')]=qs[_0xa943('0x23')](_0x848b0b[_0xa943('0x36')][_0xa943('0x23')]);_0x5c3fed[_0xa943('0x20')]=qs['offset'](_0x848b0b[_0xa943('0x36')][_0xa943('0x20')]);}return _0x5f0704[_0xa943('0x65')](_0x5c3fed);}})[_0xa943('0x29')](function(_0x1ccaea){if(_0x1ccaea){return _0x1ccaea?{'count':_0xec6df7,'rows':_0x1ccaea}:null;}})[_0xa943('0x29')](respondWithResult(_0x2b0623,null))['catch'](handleError(_0x2b0623,null));};exports['addTeams']=function(_0x371b8b,_0x1a5617,_0x4fc566){var _0x59028a=_0x371b8b[_0xa943('0x67')][_0xa943('0x68')];return db['Team'][_0xa943('0x59')]({'where':{'id':_0x59028a},'attributes':['id'],'include':[{'model':db[_0xa943('0x69')],'as':'Agents','attributes':['id',_0xa943('0x2e'),_0xa943('0x6a'),_0xa943('0x6b'),_0xa943('0x6c')],'raw':!![]}]})[_0xa943('0x29')](function(_0x33578a){if(_0x33578a){var _0x3348e4=_['flatMap'](_0x33578a,function(_0xbd3fea){var _0x3a019b=_0xbd3fea['get']({'plain':!![]});return _0x3a019b[_0xa943('0x6d')];});return db[_0xa943('0x32')]['find']({'where':{'id':_0x371b8b[_0xa943('0x48')]['id']}})[_0xa943('0x29')](function(_0x23e7ae){return db[_0xa943('0x6e')][_0xa943('0x6f')](function(_0x294b4a){return _0x23e7ae[_0xa943('0x70')](_0x59028a,{'transaction':_0x294b4a})[_0xa943('0x29')](function(){return BPromise['each'](_0x3348e4,function(_0x55d634){return db[_0xa943('0x56')]['findOrCreate']({'where':{'UserId':_0x55d634['id'],'OpenchannelQueueId':_0x371b8b[_0xa943('0x48')]['id']},'transaction':_0x294b4a});});})[_0xa943('0x29')](function(){_0x3348e4[_0xa943('0x71')](function(_0x43199e){socket['emit'](_0xa943('0x72'),{'UserId':_0x43199e['id'],'OpenchannelQueueId':_0x23e7ae['id']});});});});});}})[_0xa943('0x29')](respondWithStatusCode(_0x1a5617,null))[_0xa943('0x47')](handleError(_0x1a5617,null));};exports[_0xa943('0x73')]=function(_0x1f4f26,_0x1c0d0a,_0x227ad8){return db[_0xa943('0x64')][_0xa943('0x59')]({'where':{'id':_0x1f4f26[_0xa943('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa943('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa943('0x29')](handleEntityNotFound(_0x1c0d0a,null))[_0xa943('0x29')](function(_0x1456fb){var _0x2ca88a=_['map'](_0x1456fb,'id');var _0x47f0b7=[];var _0x323b49=[];var _0xbe9147=squel[_0xa943('0x74')]();_0xbe9147[_0xa943('0x75')]('tq.TeamId')[_0xa943('0x76')](_0xa943('0x77'),'tq')[_0xa943('0x78')]('user_has_teams','ut',_0xa943('0x79'))[_0xa943('0x42')]('OpenchannelQueueId\x20=\x20?',_0x1f4f26[_0xa943('0x48')]['id']);for(var _0x549016=0x0;_0x549016<_0x1456fb[_0xa943('0x3d')];_0x549016+=0x1){let _0xa9c382=_0x1456fb[_0x549016];for(var _0x3e039e=0x0;_0x3e039e<_0xa9c382[_0xa943('0x6d')][_0xa943('0x3d')];_0x3e039e+=0x1){let _0x233716=_0xa9c382['Agents'][_0x3e039e];var _0x4b23e5=_0xbe9147['clone']();_0x4b23e5[_0xa943('0x42')](_0xa943('0x7a'),_0x233716['id']);_0x323b49[_0xa943('0x7b')](db[_0xa943('0x6e')][_0xa943('0x36')](_0x4b23e5[_0xa943('0x7c')](),{'type':db[_0xa943('0x6e')][_0xa943('0x7d')][_0xa943('0x7e')]})['then'](function(_0x5215da){if(_0x5215da[_0xa943('0x3d')]===0x1){return _0x233716['id'];}else{var _0x5c6a2a=_[_0xa943('0x7f')](_[_0xa943('0x31')](_0x5215da,'TeamId'),function(_0x5cf010){return _[_0xa943('0x80')](_0x2ca88a,_0x5cf010);});if(_0x5c6a2a){return _0x233716['id'];}}}));}}return BPromise[_0xa943('0x81')](_0x323b49)['then'](function(_0x5a8691){_0x47f0b7=_(_0x47f0b7)[_0xa943('0x82')](_0x5a8691)[_0xa943('0x83')]()[_0xa943('0x84')]();return db['OpenchannelQueue'][_0xa943('0x4a')]({'where':{'id':_0x1f4f26[_0xa943('0x48')]['id']}})[_0xa943('0x29')](function(_0x5f566c){return db[_0xa943('0x6e')]['transaction'](function(_0x211a71){return _0x5f566c[_0xa943('0x73')](_0x1f4f26[_0xa943('0x36')]['ids'],{'transaction':_0x211a71})['then'](function(){if(!_[_0xa943('0x85')](_0x47f0b7)){return _0x5f566c[_0xa943('0x86')](_0x47f0b7,{'transaction':_0x211a71});}})['then'](function(){_0x47f0b7['forEach'](function(_0x439ae9){socket[_0xa943('0x87')](_0xa943('0x88'),{'UserId':_0x439ae9,'OpenchannelQueueId':_0x5f566c['id']});});});});});});})[_0xa943('0x29')](respondWithStatusCode(_0x1c0d0a,null))[_0xa943('0x47')](handleError(_0x1c0d0a,null));};exports['addAgents']=function(_0x2d55f9,_0x41e4a0,_0x3f2120){return db[_0xa943('0x32')]['find']({'where':{'id':_0x2d55f9[_0xa943('0x48')]['id']}})[_0xa943('0x29')](handleEntityNotFound(_0x41e4a0,null))[_0xa943('0x29')](function(_0x303867){if(_0x303867){return _0x303867['addAgents'](_0x2d55f9[_0xa943('0x67')][_0xa943('0x68')],_[_0xa943('0x89')](_0x2d55f9[_0xa943('0x67')],[_0xa943('0x68'),'id'])||{})['spread'](function(_0x1ca66b){for(var _0x5cf05c=0x0;_0x5cf05c<_0x2d55f9['body']['ids']['length'];_0x5cf05c+=0x1){socket[_0xa943('0x87')](_0xa943('0x72'),{'UserId':_0x2d55f9[_0xa943('0x67')][_0xa943('0x68')][_0x5cf05c],'OpenchannelQueueId':_0x2d55f9[_0xa943('0x48')]['id']});}return _0x1ca66b;});}})[_0xa943('0x29')](respondWithResult(_0x41e4a0,null))['catch'](handleError(_0x41e4a0,null));};exports[_0xa943('0x86')]=function(_0xe1e771,_0x4bd94b,_0x1c59e6){return db['OpenchannelQueue'][_0xa943('0x4a')]({'where':{'id':_0xe1e771[_0xa943('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bd94b,null))[_0xa943('0x29')](function(_0x7c6caf){if(_0x7c6caf){return _0x7c6caf[_0xa943('0x86')](_0xe1e771[_0xa943('0x36')]['ids'])[_0xa943('0x29')](function(){if(_['isArray'](_0xe1e771['query'][_0xa943('0x68')])){for(var _0x45abcc=0x0;_0x45abcc<_0xe1e771[_0xa943('0x36')][_0xa943('0x68')][_0xa943('0x3d')];_0x45abcc+=0x1){socket[_0xa943('0x87')]('userOpenchannelQueue:remove',{'UserId':Number(_0xe1e771[_0xa943('0x36')][_0xa943('0x68')][_0x45abcc]),'OpenchannelQueueId':Number(_0xe1e771[_0xa943('0x48')]['id'])});}}else{socket[_0xa943('0x87')](_0xa943('0x88'),{'UserId':Number(_0xe1e771[_0xa943('0x36')]['ids']),'OpenchannelQueueId':Number(_0xe1e771[_0xa943('0x48')]['id'])});}});}})[_0xa943('0x29')](respondWithStatusCode(_0x4bd94b,null))[_0xa943('0x47')](handleError(_0x4bd94b,null));};exports[_0xa943('0x8a')]=function(_0x4bfc9a,_0x239957,_0x528b10){var _0x511f45={};var _0x1704db={};var _0x37a877;var _0x4dcb78;return db[_0xa943('0x32')][_0xa943('0x63')]({'where':{'id':_0x4bfc9a['params']['id']}})[_0xa943('0x29')](handleEntityNotFound(_0x239957,null))[_0xa943('0x29')](function(_0x346716){if(_0x346716){_0x37a877=_0x346716;_0x1704db['model']=_['keys'](db['User'][_0xa943('0x33')]);_0x1704db[_0xa943('0x36')]=_[_0xa943('0x37')](_0x4bfc9a[_0xa943('0x36')]);_0x1704db[_0xa943('0x38')]=_[_0xa943('0x39')](_0x1704db[_0xa943('0x3a')],_0x1704db[_0xa943('0x36')]);_0x511f45[_0xa943('0x3b')]=_[_0xa943('0x39')](_0x1704db[_0xa943('0x3a')],qs[_0xa943('0x3c')](_0x4bfc9a['query'][_0xa943('0x3c')]));_0x511f45[_0xa943('0x3b')]=_0x511f45[_0xa943('0x3b')]['length']?_0x511f45[_0xa943('0x3b')]:_0x1704db[_0xa943('0x3a')];_0x511f45['order']=qs[_0xa943('0x40')](_0x4bfc9a[_0xa943('0x36')][_0xa943('0x40')]);_0x511f45[_0xa943('0x42')]=qs[_0xa943('0x38')](_[_0xa943('0x41')](_0x4bfc9a['query'],_0x1704db[_0xa943('0x38')]));if(_0x4bfc9a['query'][_0xa943('0x45')]){_0x511f45['where']=_['merge'](_0x511f45[_0xa943('0x42')],{'$or':_[_0xa943('0x31')](_0x511f45['attributes'],function(_0xdc6ff7){var _0x386822={};_0x386822[_0xdc6ff7]={'$like':'%'+_0x4bfc9a['query'][_0xa943('0x45')]+'%'};return _0x386822;})});}_0x511f45=_[_0xa943('0x43')]({},_0x511f45,_0x4bfc9a[_0xa943('0x58')]);return _0x37a877[_0xa943('0x8a')](_0x511f45);}})['then'](function(_0x4c9c00){if(_0x4c9c00){_0x4dcb78=_0x4c9c00[_0xa943('0x3d')];if(!_0x4bfc9a[_0xa943('0x36')][_0xa943('0x66')](_0xa943('0x3e'))){_0x511f45[_0xa943('0x23')]=qs[_0xa943('0x23')](_0x4bfc9a[_0xa943('0x36')]['limit']);_0x511f45[_0xa943('0x20')]=qs['offset'](_0x4bfc9a['query'][_0xa943('0x20')]);}return _0x37a877[_0xa943('0x8a')](_0x511f45);}})[_0xa943('0x29')](function(_0xadfb94){if(_0xadfb94){return _0xadfb94?{'count':_0x4dcb78,'rows':_0xadfb94}:null;}})[_0xa943('0x29')](respondWithResult(_0x239957,null))[_0xa943('0x47')](handleError(_0x239957,null));};
\ No newline at end of file
index 303454a..e227319 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf25c=['emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0x46396b,_0x1717ef){var _0x545e05=function(_0x7e6710){while(--_0x7e6710){_0x46396b['push'](_0x46396b['shift']());}};_0x545e05(++_0x1717ef);}(_0xf25c,0x12c));var _0xcf25=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0xf25c[_0x53afe9];return _0x396396;};'use strict';var EventEmitter=require(_0xcf25('0x0'));var OpenchannelQueue=require(_0xcf25('0x1'))['db'][_0xcf25('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xcf25('0x3')](0x0);var events={'afterCreate':_0xcf25('0x4'),'afterUpdate':'update','afterDestroy':_0xcf25('0x5')};function emitEvent(_0x5710da){return function(_0x1b86bb,_0x575782,_0xb3c9bf){OpenchannelQueueEvents[_0xcf25('0x6')](_0x5710da+':'+_0x1b86bb['id'],_0x1b86bb);OpenchannelQueueEvents[_0xcf25('0x6')](_0x5710da,_0x1b86bb);_0xb3c9bf(null);};}for(var e in events){if(events[_0xcf25('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xcf25('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x3d26=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x2385fc,_0x4c17b4){var _0x5e7e2e=function(_0x2063e8){while(--_0x2063e8){_0x2385fc['push'](_0x2385fc['shift']());}};_0x5e7e2e(++_0x4c17b4);}(_0x3d26,0x110));var _0x63d2=function(_0x30084b,_0x26b6c8){_0x30084b=_0x30084b-0x0;var _0x52fec7=_0x3d26[_0x30084b];return _0x52fec7;};'use strict';var EventEmitter=require(_0x63d2('0x0'));var OpenchannelQueue=require(_0x63d2('0x1'))['db'][_0x63d2('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x63d2('0x3')](0x0);var events={'afterCreate':_0x63d2('0x4'),'afterUpdate':_0x63d2('0x5'),'afterDestroy':_0x63d2('0x6')};function emitEvent(_0x18681b){return function(_0x1c412c,_0x390756,_0x12d1be){OpenchannelQueueEvents[_0x63d2('0x7')](_0x18681b+':'+_0x1c412c['id'],_0x1c412c);OpenchannelQueueEvents[_0x63d2('0x7')](_0x18681b,_0x1c412c);_0x12d1be(null);};}for(var e in events){if(events[_0x63d2('0x8')](e)){var event=events[e];OpenchannelQueue[_0x63d2('0x9')](e,emitEvent(event));}}module[_0x63d2('0xa')]=OpenchannelQueueEvents;
\ No newline at end of file
index d10d647..fc8bfaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd409=['OpenchannelQueue','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./openchannelQueue.attributes','exports','define'];(function(_0x372da2,_0x4a8268){var _0xac0141=function(_0x41ccbe){while(--_0x41ccbe){_0x372da2['push'](_0x372da2['shift']());}};_0xac0141(++_0x4a8268);}(_0xd409,0x14b));var _0x9d40=function(_0x360739,_0x2ec1b2){_0x360739=_0x360739-0x0;var _0x3e23a1=_0xd409[_0x360739];return _0x3e23a1;};'use strict';var _=require(_0x9d40('0x0'));var util=require(_0x9d40('0x1'));var logger=require(_0x9d40('0x2'))('api');var moment=require(_0x9d40('0x3'));var BPromise=require(_0x9d40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d40('0x5'));var rimraf=require('rimraf');var config=require(_0x9d40('0x6'));var attributes=require(_0x9d40('0x7'));module[_0x9d40('0x8')]=function(_0x370792,_0x4d23ed){return _0x370792[_0x9d40('0x9')](_0x9d40('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5503=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1b3235,_0x14afcd){var _0x4ea3d0=function(_0x30417a){while(--_0x30417a){_0x1b3235['push'](_0x1b3235['shift']());}};_0x4ea3d0(++_0x14afcd);}(_0x5503,0xa2));var _0x3550=function(_0x2da2fa,_0x1f5cc7){_0x2da2fa=_0x2da2fa-0x0;var _0x5e2726=_0x5503[_0x2da2fa];return _0x5e2726;};'use strict';var _=require('lodash');var util=require(_0x3550('0x0'));var logger=require(_0x3550('0x1'))(_0x3550('0x2'));var moment=require(_0x3550('0x3'));var BPromise=require(_0x3550('0x4'));var rp=require(_0x3550('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3550('0x6'));var config=require(_0x3550('0x7'));var attributes=require(_0x3550('0x8'));module[_0x3550('0x9')]=function(_0x1d225e,_0x103198){return _0x1d225e[_0x3550('0xa')]('OpenchannelQueue',attributes,{'tableName':_0x3550('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 58d2dd1..4d3978a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9b3=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelQueue','findAll','options','raw','map','include','model','attributes','then','GetOpenchannelQueue','ShowOpenchannelQueue','find','lodash','bluebird','ioredis','../../config/utils'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0xc9b3,0x1f4));var _0x3c9b=function(_0x28f779,_0x25ee51){_0x28f779=_0x28f779-0x0;var _0x597f0e=_0xc9b3[_0x28f779];return _0x597f0e;};'use strict';var _=require(_0x3c9b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c9b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c9b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c9b('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c9b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x3c9b('0x5')][_0x3c9b('0x6')]({'port':0x232a});config[_0x3c9b('0x7')]=_[_0x3c9b('0x8')](config[_0x3c9b('0x7')],{'host':_0x3c9b('0x9'),'port':0x18eb});var socket=require(_0x3c9b('0xa'))(new Redis(config[_0x3c9b('0x7')]));require(_0x3c9b('0xb'))[_0x3c9b('0xc')](socket);function respondWithRpcPromise(_0x4e861a,_0x5d1626,_0x11ce66){return new BPromise(function(_0x57155c,_0x1d0531){return client[_0x3c9b('0xd')](_0x4e861a,_0x11ce66)['then'](function(_0x5559ae){logger[_0x3c9b('0xe')](_0x3c9b('0xf'),_0x5d1626,_0x3c9b('0x10'));logger[_0x3c9b('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5d1626,_0x3c9b('0x10'),JSON[_0x3c9b('0x12')](_0x5559ae));if(_0x5559ae[_0x3c9b('0x13')]){if(_0x5559ae[_0x3c9b('0x13')][_0x3c9b('0x14')]===0x1f4){logger[_0x3c9b('0x13')](_0x3c9b('0xf'),_0x5d1626,_0x5559ae[_0x3c9b('0x13')][_0x3c9b('0x15')]);return _0x1d0531(_0x5559ae[_0x3c9b('0x13')][_0x3c9b('0x15')]);}logger[_0x3c9b('0x13')](_0x3c9b('0xf'),_0x5d1626,_0x5559ae['error']['message']);return _0x57155c(_0x5559ae[_0x3c9b('0x13')][_0x3c9b('0x15')]);}else{logger[_0x3c9b('0xe')](_0x3c9b('0xf'),_0x5d1626,_0x3c9b('0x10'));_0x57155c(_0x5559ae[_0x3c9b('0x16')]['message']);}})[_0x3c9b('0x17')](function(_0x25cdb6){logger[_0x3c9b('0x13')](_0x3c9b('0xf'),_0x5d1626,_0x25cdb6);_0x1d0531(_0x25cdb6);});});}exports['GetOpenchannelQueue']=function(_0x442653){var _0x3493d4=this;return new Promise(function(_0x93996e,_0x2a7955){return db[_0x3c9b('0x18')][_0x3c9b('0x19')]({'raw':_0x442653[_0x3c9b('0x1a')]?_0x442653[_0x3c9b('0x1a')][_0x3c9b('0x1b')]===undefined?!![]:![]:!![],'where':_0x442653[_0x3c9b('0x1a')]?_0x442653[_0x3c9b('0x1a')]['where']||null:null,'attributes':_0x442653[_0x3c9b('0x1a')]?_0x442653[_0x3c9b('0x1a')]['attributes']||null:null,'limit':_0x442653['options']?_0x442653[_0x3c9b('0x1a')]['limit']||null:null,'include':_0x442653[_0x3c9b('0x1a')]?_0x442653['options']['include']?_[_0x3c9b('0x1c')](_0x442653['options'][_0x3c9b('0x1d')],function(_0x5a043f){return{'model':db[_0x5a043f[_0x3c9b('0x1e')]],'as':_0x5a043f['as'],'attributes':_0x5a043f['attributes'],'include':_0x5a043f['include']?_[_0x3c9b('0x1c')](_0x5a043f[_0x3c9b('0x1d')],function(_0x46e6ed){return{'model':db[_0x46e6ed['model']],'as':_0x46e6ed['as'],'attributes':_0x46e6ed[_0x3c9b('0x1f')],'include':_0x46e6ed[_0x3c9b('0x1d')]?_[_0x3c9b('0x1c')](_0x46e6ed[_0x3c9b('0x1d')],function(_0x1de550){return{'model':db[_0x1de550[_0x3c9b('0x1e')]],'as':_0x1de550['as'],'attributes':_0x1de550['attributes']};}):[]};}):[]};}):[]:[]})[_0x3c9b('0x20')](function(_0x3f26f2){logger[_0x3c9b('0xe')]('GetOpenchannelQueue',_0x442653);logger[_0x3c9b('0x11')](_0x3c9b('0x21'),_0x442653,JSON[_0x3c9b('0x12')](_0x3f26f2));_0x93996e(_0x3f26f2);})[_0x3c9b('0x17')](function(_0x23e53e){logger[_0x3c9b('0x13')](_0x3c9b('0x21'),_0x23e53e[_0x3c9b('0x15')],_0x442653);_0x2a7955(_0x3493d4[_0x3c9b('0x13')](0x1f4,_0x23e53e[_0x3c9b('0x15')]));});});};exports[_0x3c9b('0x22')]=function(_0x1e370d){var _0x572c2f=this;return new Promise(function(_0x13a13e,_0x12361a){return db['OpenchannelQueue'][_0x3c9b('0x23')]({'raw':_0x1e370d[_0x3c9b('0x1a')]?_0x1e370d[_0x3c9b('0x1a')][_0x3c9b('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e370d[_0x3c9b('0x1a')]?_0x1e370d[_0x3c9b('0x1a')]['where']||null:null,'attributes':_0x1e370d[_0x3c9b('0x1a')]?_0x1e370d[_0x3c9b('0x1a')][_0x3c9b('0x1f')]||null:null,'include':_0x1e370d[_0x3c9b('0x1a')]?_0x1e370d[_0x3c9b('0x1a')][_0x3c9b('0x1d')]?_[_0x3c9b('0x1c')](_0x1e370d['options'][_0x3c9b('0x1d')],function(_0x3f1d22){return{'model':db[_0x3f1d22[_0x3c9b('0x1e')]],'as':_0x3f1d22['as'],'attributes':_0x3f1d22[_0x3c9b('0x1f')],'include':_0x3f1d22['include']?_['map'](_0x3f1d22['include'],function(_0x519171){return{'model':db[_0x519171[_0x3c9b('0x1e')]],'as':_0x519171['as'],'attributes':_0x519171[_0x3c9b('0x1f')],'include':_0x519171['include']?_[_0x3c9b('0x1c')](_0x519171[_0x3c9b('0x1d')],function(_0xb2a432){return{'model':db[_0xb2a432['model']],'as':_0xb2a432['as'],'attributes':_0xb2a432[_0x3c9b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3c9b('0x20')](function(_0x2d50d1){logger[_0x3c9b('0xe')]('ShowOpenchannelQueue',_0x1e370d);logger['debug'](_0x3c9b('0x22'),_0x1e370d,JSON[_0x3c9b('0x12')](_0x2d50d1));_0x13a13e(_0x2d50d1);})[_0x3c9b('0x17')](function(_0x2c4904){logger[_0x3c9b('0x13')](_0x3c9b('0x22'),_0x2c4904[_0x3c9b('0x15')],_0x1e370d);_0x12361a(_0x572c2f[_0x3c9b('0x13')](0x1f4,_0x2c4904[_0x3c9b('0x15')]));});});};
\ No newline at end of file
+var _0xe687=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','debug','catch','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2302e5,_0x580382){var _0x254fa0=function(_0x3614cc){while(--_0x3614cc){_0x2302e5['push'](_0x2302e5['shift']());}};_0x254fa0(++_0x580382);}(_0xe687,0x193));var _0x7e68=function(_0x4aeb19,_0x203ac9){_0x4aeb19=_0x4aeb19-0x0;var _0x513693=_0xe687[_0x4aeb19];return _0x513693;};'use strict';var _=require(_0x7e68('0x0'));var util=require(_0x7e68('0x1'));var moment=require(_0x7e68('0x2'));var BPromise=require(_0x7e68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e68('0x4'));var db=require(_0x7e68('0x5'))['db'];var utils=require(_0x7e68('0x6'));var logger=require(_0x7e68('0x7'))(_0x7e68('0x8'));var config=require(_0x7e68('0x9'));var jayson=require(_0x7e68('0xa'));var client=jayson[_0x7e68('0xb')][_0x7e68('0xc')]({'port':0x232a});config[_0x7e68('0xd')]=_[_0x7e68('0xe')](config[_0x7e68('0xd')],{'host':_0x7e68('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e68('0xd')]));require('./openchannelQueue.socket')[_0x7e68('0x10')](socket);function respondWithRpcPromise(_0xec2684,_0x485ccb,_0x5acabd){return new BPromise(function(_0x331429,_0x11841d){return client[_0x7e68('0x11')](_0xec2684,_0x5acabd)[_0x7e68('0x12')](function(_0x31cf30){logger[_0x7e68('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x485ccb,_0x7e68('0x14'));logger['debug'](_0x7e68('0x15'),_0x485ccb,_0x7e68('0x14'),JSON[_0x7e68('0x16')](_0x31cf30));if(_0x31cf30[_0x7e68('0x17')]){if(_0x31cf30[_0x7e68('0x17')][_0x7e68('0x18')]===0x1f4){logger[_0x7e68('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x485ccb,_0x31cf30[_0x7e68('0x17')][_0x7e68('0x19')]);return _0x11841d(_0x31cf30[_0x7e68('0x17')][_0x7e68('0x19')]);}logger[_0x7e68('0x17')](_0x7e68('0x1a'),_0x485ccb,_0x31cf30[_0x7e68('0x17')][_0x7e68('0x19')]);return _0x331429(_0x31cf30['error'][_0x7e68('0x19')]);}else{logger['info'](_0x7e68('0x1a'),_0x485ccb,_0x7e68('0x14'));_0x331429(_0x31cf30[_0x7e68('0x1b')]['message']);}})['catch'](function(_0x3135ee){logger['error'](_0x7e68('0x1a'),_0x485ccb,_0x3135ee);_0x11841d(_0x3135ee);});});}exports[_0x7e68('0x1c')]=function(_0x27a208){var _0x52e9e4=this;return new Promise(function(_0x11b564,_0x4f1168){return db[_0x7e68('0x1d')]['findAll']({'raw':_0x27a208[_0x7e68('0x1e')]?_0x27a208[_0x7e68('0x1e')][_0x7e68('0x1f')]===undefined?!![]:![]:!![],'where':_0x27a208[_0x7e68('0x1e')]?_0x27a208[_0x7e68('0x1e')][_0x7e68('0x20')]||null:null,'attributes':_0x27a208[_0x7e68('0x1e')]?_0x27a208['options'][_0x7e68('0x21')]||null:null,'limit':_0x27a208[_0x7e68('0x1e')]?_0x27a208[_0x7e68('0x1e')][_0x7e68('0x22')]||null:null,'include':_0x27a208[_0x7e68('0x1e')]?_0x27a208['options'][_0x7e68('0x23')]?_[_0x7e68('0x24')](_0x27a208[_0x7e68('0x1e')]['include'],function(_0x168e2f){return{'model':db[_0x168e2f[_0x7e68('0x25')]],'as':_0x168e2f['as'],'attributes':_0x168e2f[_0x7e68('0x21')],'include':_0x168e2f[_0x7e68('0x23')]?_[_0x7e68('0x24')](_0x168e2f[_0x7e68('0x23')],function(_0x2f3691){return{'model':db[_0x2f3691['model']],'as':_0x2f3691['as'],'attributes':_0x2f3691[_0x7e68('0x21')],'include':_0x2f3691['include']?_[_0x7e68('0x24')](_0x2f3691[_0x7e68('0x23')],function(_0x518d5d){return{'model':db[_0x518d5d[_0x7e68('0x25')]],'as':_0x518d5d['as'],'attributes':_0x518d5d[_0x7e68('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e68('0x12')](function(_0x939488){logger[_0x7e68('0x13')]('GetOpenchannelQueue',_0x27a208);logger[_0x7e68('0x26')]('GetOpenchannelQueue',_0x27a208,JSON['stringify'](_0x939488));_0x11b564(_0x939488);})[_0x7e68('0x27')](function(_0x4d1716){logger['error'](_0x7e68('0x1c'),_0x4d1716[_0x7e68('0x19')],_0x27a208);_0x4f1168(_0x52e9e4['error'](0x1f4,_0x4d1716[_0x7e68('0x19')]));});});};exports[_0x7e68('0x28')]=function(_0x8cd359){var _0x29bc9e=this;return new Promise(function(_0xa67037,_0x5bf3c6){return db[_0x7e68('0x1d')]['find']({'raw':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359[_0x7e68('0x1e')][_0x7e68('0x1f')]===undefined?!![]:![]:!![],'where':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359['options'][_0x7e68('0x20')]||null:null,'attributes':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359[_0x7e68('0x1e')]['attributes']||null:null,'include':_0x8cd359[_0x7e68('0x1e')]?_0x8cd359[_0x7e68('0x1e')][_0x7e68('0x23')]?_[_0x7e68('0x24')](_0x8cd359[_0x7e68('0x1e')]['include'],function(_0x25b17c){return{'model':db[_0x25b17c['model']],'as':_0x25b17c['as'],'attributes':_0x25b17c[_0x7e68('0x21')],'include':_0x25b17c['include']?_[_0x7e68('0x24')](_0x25b17c['include'],function(_0x26bfbd){return{'model':db[_0x26bfbd[_0x7e68('0x25')]],'as':_0x26bfbd['as'],'attributes':_0x26bfbd[_0x7e68('0x21')],'include':_0x26bfbd[_0x7e68('0x23')]?_['map'](_0x26bfbd[_0x7e68('0x23')],function(_0x59e807){return{'model':db[_0x59e807[_0x7e68('0x25')]],'as':_0x59e807['as'],'attributes':_0x59e807[_0x7e68('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7e68('0x12')](function(_0x106d9f){logger[_0x7e68('0x13')](_0x7e68('0x28'),_0x8cd359);logger[_0x7e68('0x26')](_0x7e68('0x28'),_0x8cd359,JSON[_0x7e68('0x16')](_0x106d9f));_0xa67037(_0x106d9f);})[_0x7e68('0x27')](function(_0x2d8085){logger[_0x7e68('0x17')]('ShowOpenchannelQueue',_0x2d8085[_0x7e68('0x19')],_0x8cd359);_0x5bf3c6(_0x29bc9e['error'](0x1f4,_0x2d8085[_0x7e68('0x19')]));});});};
\ No newline at end of file
index 08e1ef0..8dba64f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x915b=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x6acd7a,_0x45ffa8){var _0x3d4120=function(_0x2d29ee){while(--_0x2d29ee){_0x6acd7a['push'](_0x6acd7a['shift']());}};_0x3d4120(++_0x45ffa8);}(_0x915b,0x104));var _0xb915=function(_0x4e62a7,_0x25ff89){_0x4e62a7=_0x4e62a7-0x0;var _0x40aca7=_0x915b[_0x4e62a7];return _0x40aca7;};'use strict';var OpenchannelQueueEvents=require(_0xb915('0x0'));var events=[_0xb915('0x1'),_0xb915('0x2'),_0xb915('0x3')];function createListener(_0x5a127c,_0x4fde1b){return function(_0x1ab017){_0x4fde1b[_0xb915('0x4')](_0x5a127c,_0x1ab017);};}function removeListener(_0xa15701,_0x308019){return function(){OpenchannelQueueEvents[_0xb915('0x5')](_0xa15701,_0x308019);};}exports[_0xb915('0x6')]=function(_0x54ef4a){for(var _0x1fdb03=0x0,_0x52c259=events[_0xb915('0x7')];_0x1fdb03<_0x52c259;_0x1fdb03++){var _0x52fac8=events[_0x1fdb03];var _0x53eb2e=createListener(_0xb915('0x8')+_0x52fac8,_0x54ef4a);OpenchannelQueueEvents['on'](_0x52fac8,_0x53eb2e);}};
\ No newline at end of file
+var _0xdd34=['length','./openchannelQueue.events','update','emit','removeListener','register'];(function(_0x204265,_0x313c59){var _0x48940c=function(_0x1ebe10){while(--_0x1ebe10){_0x204265['push'](_0x204265['shift']());}};_0x48940c(++_0x313c59);}(_0xdd34,0x1db));var _0x4dd3=function(_0x1c6c9f,_0x568f61){_0x1c6c9f=_0x1c6c9f-0x0;var _0x18d454=_0xdd34[_0x1c6c9f];return _0x18d454;};'use strict';var OpenchannelQueueEvents=require(_0x4dd3('0x0'));var events=['save','remove',_0x4dd3('0x1')];function createListener(_0x5e6453,_0x1587f0){return function(_0xc97d1f){_0x1587f0[_0x4dd3('0x2')](_0x5e6453,_0xc97d1f);};}function removeListener(_0x5cf725,_0x116bed){return function(){OpenchannelQueueEvents[_0x4dd3('0x3')](_0x5cf725,_0x116bed);};}exports[_0x4dd3('0x4')]=function(_0x21cef0){for(var _0x113885=0x0,_0x30fbab=events[_0x4dd3('0x5')];_0x113885<_0x30fbab;_0x113885++){var _0x27644d=events[_0x113885];var _0x49bd45=createListener('openchannelQueue:'+_0x27644d,_0x21cef0);OpenchannelQueueEvents['on'](_0x27644d,_0x49bd45);}};
\ No newline at end of file
index 906dc32..28bba8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe15a=['./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe2ae2b,_0x48d240){var _0xa5cac5=function(_0x384b82){while(--_0x384b82){_0xe2ae2b['push'](_0xe2ae2b['shift']());}};_0xa5cac5(++_0x48d240);}(_0xe15a,0xff));var _0xae15=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xe15a[_0x2652ef];return _0x2db578;};'use strict';var multer=require(_0xae15('0x0'));var util=require(_0xae15('0x1'));var path=require(_0xae15('0x2'));var timeout=require(_0xae15('0x3'));var express=require(_0xae15('0x4'));var router=express[_0xae15('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xae15('0x6'));var interaction=require(_0xae15('0x7'));var config=require(_0xae15('0x8'));var controller=require(_0xae15('0x9'));router[_0xae15('0xa')]('/',auth[_0xae15('0xb')](),controller[_0xae15('0xc')]);router[_0xae15('0xa')](_0xae15('0xd'),auth[_0xae15('0xb')](),controller[_0xae15('0xe')]);router['get'](_0xae15('0xf'),auth[_0xae15('0xb')](),controller[_0xae15('0x10')]);router[_0xae15('0x11')]('/',auth[_0xae15('0xb')](),controller[_0xae15('0x12')]);router[_0xae15('0x13')](_0xae15('0xf'),auth[_0xae15('0xb')](),controller[_0xae15('0x14')]);router[_0xae15('0x15')](_0xae15('0xf'),auth[_0xae15('0xb')](),controller[_0xae15('0x16')]);module[_0xae15('0x17')]=router;
\ No newline at end of file
+var _0xd64d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','get','describe','/:id','isAuthenticated','show','post','create','put','update','delete','multer','path'];(function(_0x2b303c,_0x109cb8){var _0x4d0403=function(_0x47b8bd){while(--_0x47b8bd){_0x2b303c['push'](_0x2b303c['shift']());}};_0x4d0403(++_0x109cb8);}(_0xd64d,0x12a));var _0xdd64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd64d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdd64('0x0'));var util=require('util');var path=require(_0xdd64('0x1'));var timeout=require(_0xdd64('0x2'));var express=require('express');var router=express[_0xdd64('0x3')]();var fs_extra=require(_0xdd64('0x4'));var auth=require(_0xdd64('0x5'));var interaction=require(_0xdd64('0x6'));var config=require(_0xdd64('0x7'));var controller=require(_0xdd64('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdd64('0x9')]);router[_0xdd64('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xdd64('0xb')]);router['get'](_0xdd64('0xc'),auth[_0xdd64('0xd')](),controller[_0xdd64('0xe')]);router[_0xdd64('0xf')]('/',auth[_0xdd64('0xd')](),controller[_0xdd64('0x10')]);router[_0xdd64('0x11')](_0xdd64('0xc'),auth['isAuthenticated'](),controller[_0xdd64('0x12')]);router[_0xdd64('0x13')]('/:id',auth[_0xdd64('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index b9cbc4a..dad7b75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe33c=['STRING','DATE','sequelize'];(function(_0x7b926e,_0x9aacd3){var _0x2c10bb=function(_0x31081c){while(--_0x31081c){_0x7b926e['push'](_0x7b926e['shift']());}};_0x2c10bb(++_0x9aacd3);}(_0xe33c,0xbc));var _0xce33=function(_0xfcce6,_0x5e1620){_0xfcce6=_0xfcce6-0x0;var _0x3820ba=_0xe33c[_0xfcce6];return _0x3820ba;};'use strict';var moment=require('moment');var Sequelize=require(_0xce33('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xce33('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xce33('0x1')]},'joinAt':{'type':Sequelize[_0xce33('0x2')]},'leaveAt':{'type':Sequelize[_0xce33('0x2')]},'acceptAt':{'type':Sequelize[_0xce33('0x2')]},'exitAt':{'type':Sequelize[_0xce33('0x2')]},'reason':{'type':Sequelize[_0xce33('0x1')]}};
\ No newline at end of file
+var _0xfd8a=['STRING','DATE','moment','sequelize','exports'];(function(_0x52ee93,_0x31a5cb){var _0x311c36=function(_0x5b7073){while(--_0x5b7073){_0x52ee93['push'](_0x52ee93['shift']());}};_0x311c36(++_0x31a5cb);}(_0xfd8a,0xac));var _0xafd8=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xfd8a[_0xd22d95];return _0x15d7a3;};'use strict';var moment=require(_0xafd8('0x0'));var Sequelize=require(_0xafd8('0x1'));module[_0xafd8('0x2')]={'uniqueid':{'type':Sequelize[_0xafd8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xafd8('0x3')]},'joinAt':{'type':Sequelize[_0xafd8('0x4')]},'leaveAt':{'type':Sequelize[_0xafd8('0x4')]},'acceptAt':{'type':Sequelize[_0xafd8('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xafd8('0x3')]}};
\ No newline at end of file
index 64d8a08..7ee0593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4432=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x3e6c63,_0x39e100){var _0x6ef361=function(_0x1f0b19){while(--_0x1f0b19){_0x3e6c63['push'](_0x3e6c63['shift']());}};_0x6ef361(++_0x39e100);}(_0x4432,0xcb));var _0x2443=function(_0x562889,_0x48d2f5){_0x562889=_0x562889-0x0;var _0x2f53e6=_0x4432[_0x562889];return _0x2f53e6;};'use strict';var emlformat=require(_0x2443('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2443('0x1'));var jsonpatch=require(_0x2443('0x2'));var rp=require(_0x2443('0x3'));var moment=require(_0x2443('0x4'));var BPromise=require(_0x2443('0x5'));var Mustache=require(_0x2443('0x6'));var util=require(_0x2443('0x7'));var path=require(_0x2443('0x8'));var sox=require(_0x2443('0x9'));var csv=require(_0x2443('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2443('0xb'));var _=require(_0x2443('0xc'));var squel=require('squel');var crypto=require(_0x2443('0xd'));var jsforce=require(_0x2443('0xe'));var deskjs=require(_0x2443('0xf'));var toCsv=require(_0x2443('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2443('0x10'));var qs=require(_0x2443('0x11'));var as=require(_0x2443('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2443('0x13'))(_0x2443('0x14'));var utils=require(_0x2443('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2443('0x16'));var db=require(_0x2443('0x17'))['db'];function respondWithStatusCode(_0x2a6c58,_0x2cf8e9){_0x2cf8e9=_0x2cf8e9||0xcc;return function(_0x2c91f8){if(_0x2c91f8){return _0x2a6c58[_0x2443('0x18')](_0x2cf8e9);}return _0x2a6c58[_0x2443('0x19')](_0x2cf8e9)['end']();};}function respondWithResult(_0x4da9a3,_0xdac3cd){_0xdac3cd=_0xdac3cd||0xc8;return function(_0x4d9ad4){if(_0x4d9ad4){return _0x4da9a3['status'](_0xdac3cd)[_0x2443('0x1a')](_0x4d9ad4);}};}function respondWithFilteredResult(_0x287e07,_0x483078){return function(_0x2b1d1e){if(_0x2b1d1e){var _0x25bba3=typeof _0x483078[_0x2443('0x1b')]===_0x2443('0x1c')&&typeof _0x483078[_0x2443('0x1d')]==='undefined';var _0x4c458c=_0x2b1d1e[_0x2443('0x1e')];var _0x7f14d7=_0x25bba3?0x0:_0x483078[_0x2443('0x1b')];var _0x44cccf=_0x25bba3?_0x2b1d1e[_0x2443('0x1e')]:_0x483078[_0x2443('0x1b')]+_0x483078[_0x2443('0x1d')];var _0x590583;if(_0x44cccf>=_0x4c458c){_0x44cccf=_0x4c458c;_0x590583=0xc8;}else{_0x590583=0xce;}_0x287e07[_0x2443('0x19')](_0x590583);return _0x287e07['set']('Content-Range',_0x7f14d7+'-'+_0x44cccf+'/'+_0x4c458c)[_0x2443('0x1a')](_0x2b1d1e);}return null;};}function patchUpdates(_0x219dff){return function(_0xcccbfb){try{jsonpatch[_0x2443('0x1f')](_0xcccbfb,_0x219dff,!![]);}catch(_0x413f8c){return BPromise[_0x2443('0x20')](_0x413f8c);}return _0xcccbfb['save']();};}function saveUpdates(_0x526e07,_0x19b1e0){return function(_0x84352e){if(_0x84352e){return _0x84352e[_0x2443('0x21')](_0x526e07)[_0x2443('0x22')](function(_0x58b866){return _0x58b866;});}return null;};}function removeEntity(_0x494a75,_0x515781){return function(_0x35c066){if(_0x35c066){return _0x35c066[_0x2443('0x23')]()[_0x2443('0x22')](function(){_0x494a75[_0x2443('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x173e6a,_0xd6b165){return function(_0x3d8a00){if(!_0x3d8a00){_0x173e6a[_0x2443('0x18')](0x194);}return _0x3d8a00;};}function handleError(_0x53bd1e,_0x5a87b7){_0x5a87b7=_0x5a87b7||0x1f4;return function(_0x5673ab){logger[_0x2443('0x24')](_0x5673ab[_0x2443('0x25')]);if(_0x5673ab['name']){delete _0x5673ab[_0x2443('0x26')];}_0x53bd1e['status'](_0x5a87b7)[_0x2443('0x27')](_0x5673ab);};}exports['index']=function(_0x21e020,_0x54e202){var _0x406455={},_0x4bf996={},_0x1f26f9={'count':0x0,'rows':[]};var _0x1b085d=_[_0x2443('0x28')](db[_0x2443('0x29')][_0x2443('0x2a')],function(_0x1f0710){return{'name':_0x1f0710[_0x2443('0x2b')],'type':_0x1f0710[_0x2443('0x2c')][_0x2443('0x2d')]};});_0x4bf996[_0x2443('0x2e')]=_[_0x2443('0x28')](_0x1b085d,'name');_0x4bf996[_0x2443('0x2f')]=_['keys'](_0x21e020[_0x2443('0x2f')]);_0x4bf996['filters']=_[_0x2443('0x30')](_0x4bf996[_0x2443('0x2e')],_0x4bf996[_0x2443('0x2f')]);_0x406455[_0x2443('0x31')]=_['intersection'](_0x4bf996[_0x2443('0x2e')],qs[_0x2443('0x32')](_0x21e020[_0x2443('0x2f')]['fields']));_0x406455[_0x2443('0x31')]=_0x406455[_0x2443('0x31')][_0x2443('0x33')]?_0x406455[_0x2443('0x31')]:_0x4bf996[_0x2443('0x2e')];if(!_0x21e020[_0x2443('0x2f')][_0x2443('0x34')](_0x2443('0x35'))){_0x406455[_0x2443('0x1d')]=qs['limit'](_0x21e020['query'][_0x2443('0x1d')]);_0x406455['offset']=qs[_0x2443('0x1b')](_0x21e020[_0x2443('0x2f')]['offset']);}_0x406455[_0x2443('0x36')]=qs[_0x2443('0x37')](_0x21e020[_0x2443('0x2f')][_0x2443('0x37')]);_0x406455[_0x2443('0x38')]=qs['filters'](_[_0x2443('0x39')](_0x21e020[_0x2443('0x2f')],_0x4bf996[_0x2443('0x3a')]),_0x1b085d);if(_0x21e020[_0x2443('0x2f')]['filter']){_0x406455[_0x2443('0x38')]=_[_0x2443('0x3b')](_0x406455[_0x2443('0x38')],{'$or':_[_0x2443('0x28')](_0x1b085d,function(_0x3cf1b4){if(_0x3cf1b4[_0x2443('0x2c')]!==_0x2443('0x3c')){var _0x2bb495={};_0x2bb495[_0x3cf1b4[_0x2443('0x26')]]={'$like':'%'+_0x21e020[_0x2443('0x2f')]['filter']+'%'};return _0x2bb495;}})});}_0x406455=_[_0x2443('0x3b')]({},_0x406455,_0x21e020[_0x2443('0x3d')]);var _0x4bfb4e={'where':_0x406455['where']};return db['OpenchannelQueueReport'][_0x2443('0x1e')](_0x4bfb4e)['then'](function(_0x1d419a){_0x1f26f9['count']=_0x1d419a;if(_0x21e020[_0x2443('0x2f')][_0x2443('0x3e')]){_0x406455[_0x2443('0x3f')]=[{'all':!![]}];}return db[_0x2443('0x29')]['findAll'](_0x406455);})[_0x2443('0x22')](function(_0xcc4a4e){_0x1f26f9[_0x2443('0x40')]=_0xcc4a4e;return _0x1f26f9;})[_0x2443('0x22')](respondWithFilteredResult(_0x54e202,_0x406455))['catch'](handleError(_0x54e202,null));};exports[_0x2443('0x41')]=function(_0x89a9e8,_0x293eec){var _0x20b8ac={'raw':!![],'where':{'id':_0x89a9e8[_0x2443('0x42')]['id']}},_0x3900ef={};_0x3900ef[_0x2443('0x2e')]=_[_0x2443('0x43')](db[_0x2443('0x29')]['rawAttributes']);_0x3900ef['query']=_[_0x2443('0x43')](_0x89a9e8[_0x2443('0x2f')]);_0x3900ef[_0x2443('0x3a')]=_[_0x2443('0x30')](_0x3900ef[_0x2443('0x2e')],_0x3900ef['query']);_0x20b8ac[_0x2443('0x31')]=_[_0x2443('0x30')](_0x3900ef[_0x2443('0x2e')],qs[_0x2443('0x32')](_0x89a9e8[_0x2443('0x2f')][_0x2443('0x32')]));_0x20b8ac[_0x2443('0x31')]=_0x20b8ac[_0x2443('0x31')][_0x2443('0x33')]?_0x20b8ac['attributes']:_0x3900ef[_0x2443('0x2e')];if(_0x89a9e8['query'][_0x2443('0x3e')]){_0x20b8ac[_0x2443('0x3f')]=[{'all':!![]}];}_0x20b8ac=_[_0x2443('0x3b')]({},_0x20b8ac,_0x89a9e8[_0x2443('0x3d')]);return db[_0x2443('0x29')]['find'](_0x20b8ac)['then'](handleEntityNotFound(_0x293eec,null))[_0x2443('0x22')](respondWithResult(_0x293eec,null))[_0x2443('0x44')](handleError(_0x293eec,null));};exports['create']=function(_0x4c53e9,_0x561fcd){return db['OpenchannelQueueReport'][_0x2443('0x45')](_0x4c53e9[_0x2443('0x46')],{})[_0x2443('0x22')](respondWithResult(_0x561fcd,0xc9))[_0x2443('0x44')](handleError(_0x561fcd,null));};exports[_0x2443('0x21')]=function(_0x5de0c7,_0x52b7dd){if(_0x5de0c7[_0x2443('0x46')]['id']){delete _0x5de0c7[_0x2443('0x46')]['id'];}return db[_0x2443('0x29')][_0x2443('0x47')]({'where':{'id':_0x5de0c7[_0x2443('0x42')]['id']}})['then'](handleEntityNotFound(_0x52b7dd,null))['then'](saveUpdates(_0x5de0c7['body'],null))[_0x2443('0x22')](respondWithResult(_0x52b7dd,null))[_0x2443('0x44')](handleError(_0x52b7dd,null));};exports['destroy']=function(_0x1606cd,_0x1b21ac){return db['OpenchannelQueueReport'][_0x2443('0x47')]({'where':{'id':_0x1606cd[_0x2443('0x42')]['id']}})[_0x2443('0x22')](handleEntityNotFound(_0x1b21ac,null))[_0x2443('0x22')](removeEntity(_0x1b21ac,null))[_0x2443('0x44')](handleError(_0x1b21ac,null));};exports[_0x2443('0x48')]=function(_0x27f43e,_0x3660f0){return db[_0x2443('0x29')][_0x2443('0x48')]()[_0x2443('0x22')](respondWithResult(_0x3660f0,null))['catch'](handleError(_0x3660f0,null));};
\ No newline at end of file
+var _0xd17e=['type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','update','body','destroy','describe','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','where'];(function(_0x61f919,_0x1472d8){var _0x23d9e7=function(_0x39a9c6){while(--_0x39a9c6){_0x61f919['push'](_0x61f919['shift']());}};_0x23d9e7(++_0x1472d8);}(_0xd17e,0x1c7));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xed17('0x0'));var rimraf=require(_0xed17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xed17('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xed17('0x3'));var util=require(_0xed17('0x4'));var path=require(_0xed17('0x5'));var sox=require(_0xed17('0x6'));var csv=require(_0xed17('0x7'));var ejs=require(_0xed17('0x8'));var fs=require('fs');var fs_extra=require(_0xed17('0x9'));var _=require(_0xed17('0xa'));var squel=require(_0xed17('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed17('0xc'));var toCsv=require(_0xed17('0x7'));var querystring=require('querystring');var Papa=require(_0xed17('0xd'));var Redis=require(_0xed17('0xe'));var authService=require(_0xed17('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed17('0x10'));var logger=require(_0xed17('0x11'))('api');var utils=require(_0xed17('0x12'));var config=require(_0xed17('0x13'));var licenseUtil=require(_0xed17('0x14'));var db=require(_0xed17('0x15'))['db'];function respondWithStatusCode(_0x503f1d,_0x2b8aee){_0x2b8aee=_0x2b8aee||0xcc;return function(_0x4b1436){if(_0x4b1436){return _0x503f1d['sendStatus'](_0x2b8aee);}return _0x503f1d[_0xed17('0x16')](_0x2b8aee)[_0xed17('0x17')]();};}function respondWithResult(_0x558042,_0x265019){_0x265019=_0x265019||0xc8;return function(_0x3b9e3a){if(_0x3b9e3a){return _0x558042[_0xed17('0x16')](_0x265019)['json'](_0x3b9e3a);}};}function respondWithFilteredResult(_0x53720b,_0x2a505a){return function(_0x541e43){if(_0x541e43){var _0x12adaa=typeof _0x2a505a['offset']==='undefined'&&typeof _0x2a505a[_0xed17('0x18')]===_0xed17('0x19');var _0x25e08a=_0x541e43[_0xed17('0x1a')];var _0x3cf373=_0x12adaa?0x0:_0x2a505a[_0xed17('0x1b')];var _0x5af6a4=_0x12adaa?_0x541e43['count']:_0x2a505a[_0xed17('0x1b')]+_0x2a505a[_0xed17('0x18')];var _0x591778;if(_0x5af6a4>=_0x25e08a){_0x5af6a4=_0x25e08a;_0x591778=0xc8;}else{_0x591778=0xce;}_0x53720b[_0xed17('0x16')](_0x591778);return _0x53720b['set'](_0xed17('0x1c'),_0x3cf373+'-'+_0x5af6a4+'/'+_0x25e08a)[_0xed17('0x1d')](_0x541e43);}return null;};}function patchUpdates(_0xe287f1){return function(_0x51aad3){try{jsonpatch[_0xed17('0x1e')](_0x51aad3,_0xe287f1,!![]);}catch(_0x23765b){return BPromise[_0xed17('0x1f')](_0x23765b);}return _0x51aad3[_0xed17('0x20')]();};}function saveUpdates(_0x14256b,_0x50e9c2){return function(_0x5bd634){if(_0x5bd634){return _0x5bd634['update'](_0x14256b)[_0xed17('0x21')](function(_0x26ba4a){return _0x26ba4a;});}return null;};}function removeEntity(_0x2d10ad,_0x522fee){return function(_0x56199c){if(_0x56199c){return _0x56199c['destroy']()[_0xed17('0x21')](function(){_0x2d10ad[_0xed17('0x16')](0xcc)[_0xed17('0x17')]();});}};}function handleEntityNotFound(_0x102669,_0x4e8ac6){return function(_0x55832d){if(!_0x55832d){_0x102669['sendStatus'](0x194);}return _0x55832d;};}function handleError(_0x308c74,_0x2147c4){_0x2147c4=_0x2147c4||0x1f4;return function(_0xef4c6a){logger[_0xed17('0x22')](_0xef4c6a[_0xed17('0x23')]);if(_0xef4c6a[_0xed17('0x24')]){delete _0xef4c6a['name'];}_0x308c74[_0xed17('0x16')](_0x2147c4)[_0xed17('0x25')](_0xef4c6a);};}exports[_0xed17('0x26')]=function(_0x3ac08d,_0x155602){var _0x328887={},_0x5a3ca5={},_0x32ad25={'count':0x0,'rows':[]};var _0x151dea=_[_0xed17('0x27')](db[_0xed17('0x28')][_0xed17('0x29')],function(_0x18a4ec){return{'name':_0x18a4ec[_0xed17('0x2a')],'type':_0x18a4ec['type'][_0xed17('0x2b')]};});_0x5a3ca5[_0xed17('0x2c')]=_[_0xed17('0x27')](_0x151dea,'name');_0x5a3ca5[_0xed17('0x2d')]=_[_0xed17('0x2e')](_0x3ac08d[_0xed17('0x2d')]);_0x5a3ca5[_0xed17('0x2f')]=_[_0xed17('0x30')](_0x5a3ca5[_0xed17('0x2c')],_0x5a3ca5[_0xed17('0x2d')]);_0x328887[_0xed17('0x31')]=_[_0xed17('0x30')](_0x5a3ca5['model'],qs['fields'](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x32')]));_0x328887[_0xed17('0x31')]=_0x328887[_0xed17('0x31')]['length']?_0x328887[_0xed17('0x31')]:_0x5a3ca5[_0xed17('0x2c')];if(!_0x3ac08d[_0xed17('0x2d')][_0xed17('0x33')]('nolimit')){_0x328887[_0xed17('0x18')]=qs[_0xed17('0x18')](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x18')]);_0x328887['offset']=qs[_0xed17('0x1b')](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x1b')]);}_0x328887['order']=qs['sort'](_0x3ac08d[_0xed17('0x2d')][_0xed17('0x34')]);_0x328887['where']=qs[_0xed17('0x2f')](_[_0xed17('0x35')](_0x3ac08d[_0xed17('0x2d')],_0x5a3ca5[_0xed17('0x2f')]),_0x151dea);if(_0x3ac08d[_0xed17('0x2d')][_0xed17('0x36')]){_0x328887[_0xed17('0x37')]=_['merge'](_0x328887['where'],{'$or':_[_0xed17('0x27')](_0x151dea,function(_0x284db8){if(_0x284db8[_0xed17('0x38')]!==_0xed17('0x39')){var _0x1085fa={};_0x1085fa[_0x284db8['name']]={'$like':'%'+_0x3ac08d[_0xed17('0x2d')][_0xed17('0x36')]+'%'};return _0x1085fa;}})});}_0x328887=_['merge']({},_0x328887,_0x3ac08d[_0xed17('0x3a')]);var _0x50c09c={'where':_0x328887[_0xed17('0x37')]};return db[_0xed17('0x28')]['count'](_0x50c09c)['then'](function(_0x38a40d){_0x32ad25[_0xed17('0x1a')]=_0x38a40d;if(_0x3ac08d[_0xed17('0x2d')][_0xed17('0x3b')]){_0x328887[_0xed17('0x3c')]=[{'all':!![]}];}return db[_0xed17('0x28')][_0xed17('0x3d')](_0x328887);})[_0xed17('0x21')](function(_0x5bd202){_0x32ad25[_0xed17('0x3e')]=_0x5bd202;return _0x32ad25;})[_0xed17('0x21')](respondWithFilteredResult(_0x155602,_0x328887))[_0xed17('0x3f')](handleError(_0x155602,null));};exports[_0xed17('0x40')]=function(_0x2d6f68,_0x4a1a01){var _0x26880f={'raw':!![],'where':{'id':_0x2d6f68[_0xed17('0x41')]['id']}},_0x51a8c7={};_0x51a8c7['model']=_['keys'](db[_0xed17('0x28')][_0xed17('0x29')]);_0x51a8c7[_0xed17('0x2d')]=_[_0xed17('0x2e')](_0x2d6f68[_0xed17('0x2d')]);_0x51a8c7[_0xed17('0x2f')]=_[_0xed17('0x30')](_0x51a8c7[_0xed17('0x2c')],_0x51a8c7[_0xed17('0x2d')]);_0x26880f[_0xed17('0x31')]=_[_0xed17('0x30')](_0x51a8c7[_0xed17('0x2c')],qs[_0xed17('0x32')](_0x2d6f68[_0xed17('0x2d')][_0xed17('0x32')]));_0x26880f['attributes']=_0x26880f[_0xed17('0x31')][_0xed17('0x42')]?_0x26880f['attributes']:_0x51a8c7[_0xed17('0x2c')];if(_0x2d6f68[_0xed17('0x2d')]['includeAll']){_0x26880f[_0xed17('0x3c')]=[{'all':!![]}];}_0x26880f=_['merge']({},_0x26880f,_0x2d6f68[_0xed17('0x3a')]);return db[_0xed17('0x28')][_0xed17('0x43')](_0x26880f)[_0xed17('0x21')](handleEntityNotFound(_0x4a1a01,null))[_0xed17('0x21')](respondWithResult(_0x4a1a01,null))[_0xed17('0x3f')](handleError(_0x4a1a01,null));};exports['create']=function(_0x4fba31,_0x1988c7){return db[_0xed17('0x28')][_0xed17('0x44')](_0x4fba31['body'],{})[_0xed17('0x21')](respondWithResult(_0x1988c7,0xc9))['catch'](handleError(_0x1988c7,null));};exports[_0xed17('0x45')]=function(_0x337c0b,_0x457cb2){if(_0x337c0b[_0xed17('0x46')]['id']){delete _0x337c0b['body']['id'];}return db[_0xed17('0x28')][_0xed17('0x43')]({'where':{'id':_0x337c0b['params']['id']}})['then'](handleEntityNotFound(_0x457cb2,null))[_0xed17('0x21')](saveUpdates(_0x337c0b[_0xed17('0x46')],null))[_0xed17('0x21')](respondWithResult(_0x457cb2,null))[_0xed17('0x3f')](handleError(_0x457cb2,null));};exports[_0xed17('0x47')]=function(_0x462f77,_0x41c2d5){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x462f77[_0xed17('0x41')]['id']}})[_0xed17('0x21')](handleEntityNotFound(_0x41c2d5,null))[_0xed17('0x21')](removeEntity(_0x41c2d5,null))['catch'](handleError(_0x41c2d5,null));};exports['describe']=function(_0x375803,_0x445150){return db[_0xed17('0x28')][_0xed17('0x48')]()['then'](respondWithResult(_0x445150,null))[_0xed17('0x3f')](handleError(_0x445150,null));};
\ No newline at end of file
index 2d5e4dd..b2bf85a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x5acbeb,_0x436c9a){var _0x2be17c=function(_0x554a2c){while(--_0x554a2c){_0x5acbeb['push'](_0x5acbeb['shift']());}};_0x2be17c(++_0x436c9a);}(_0x7a54,0x106));var _0x47a5=function(_0x10e67f,_0x30f942){_0x10e67f=_0x10e67f-0x0;var _0x5ef7ed=_0x7a54[_0x10e67f];return _0x5ef7ed;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0xf93440,_0x3a0444){var _0x462df0=function(_0x496471){while(--_0x496471){_0xf93440['push'](_0xf93440['shift']());}};_0x462df0(++_0x3a0444);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index db1b538..ae2de43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2676fb,_0x51f0bf){var _0x342f12=function(_0x22884f){while(--_0x22884f){_0x2676fb['push'](_0x2676fb['shift']());}};_0x342f12(++_0x51f0bf);}(_0x47c5,0x165));var _0x547c=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x47c5[_0x5a1cc9];return _0x471761;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['CreateOpenchannelQueueReport']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5453f9){logger[_0x547c('0xd')](_0x547c('0x1d'),_0x23fa9e);logger['debug'](_0x547c('0x1d'),_0x23fa9e,JSON[_0x547c('0x12')](_0x5453f9));_0xeb059e(_0x5453f9);})['catch'](function(_0x2e317a){logger[_0x547c('0x13')](_0x547c('0x1d'),_0x2e317a['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2e317a[_0x547c('0x15')]));});});};exports[_0x547c('0x1e')]=function(_0x26823c){var _0x1f3581=this;return new Promise(function(_0x2663bc,_0x2ab2cc){return db[_0x547c('0x18')]['update'](_0x26823c[_0x547c('0x1a')],{'raw':_0x26823c['options']?_0x26823c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26823c['options']?_0x26823c[_0x547c('0x1b')]['where']||null:null,'attributes':_0x26823c[_0x547c('0x1b')]?_0x26823c['options'][_0x547c('0x1f')]||null:null,'limit':_0x26823c['options']?_0x26823c[_0x547c('0x1b')][_0x547c('0x20')]||null:null})[_0x547c('0xc')](function(_0x30a96c){logger[_0x547c('0xd')]('UpdateOpenchannelQueueReport',_0x26823c);logger['debug'](_0x547c('0x1e'),_0x26823c,JSON['stringify'](_0x30a96c));_0x2663bc(_0x30a96c);})[_0x547c('0x17')](function(_0xed2d39){logger[_0x547c('0x13')](_0x547c('0x1e'),_0xed2d39[_0x547c('0x15')],_0x26823c);_0x2ab2cc(_0x1f3581[_0x547c('0x13')](0x1f4,_0xed2d39[_0x547c('0x15')]));});});};
\ No newline at end of file
+var _0x777d=['CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','UpdateOpenchannelQueueReport','body','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x489197,_0x32e8ab){var _0x50df6e=function(_0x536ac9){while(--_0x536ac9){_0x489197['push'](_0x489197['shift']());}};_0x50df6e(++_0x32e8ab);}(_0x777d,0xe9));var _0xd777=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0x777d[_0x28d7b5];return _0x1ed035;};'use strict';var _=require('lodash');var util=require(_0xd777('0x0'));var moment=require(_0xd777('0x1'));var BPromise=require(_0xd777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd777('0x3'));var db=require(_0xd777('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd777('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd777('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7c954,_0x5d1a5f,_0x57d67f){return new BPromise(function(_0x49d55d,_0x197296){return client[_0xd777('0x7')](_0xc7c954,_0x57d67f)[_0xd777('0x8')](function(_0x25450d){logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));logger[_0xd777('0xc')](_0xd777('0xd'),_0x5d1a5f,_0xd777('0xb'),JSON[_0xd777('0xe')](_0x25450d));if(_0x25450d[_0xd777('0xf')]){if(_0x25450d[_0xd777('0xf')]['code']===0x1f4){logger['error'](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x197296(_0x25450d[_0xd777('0xf')][_0xd777('0x10')]);}logger[_0xd777('0xf')](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x49d55d(_0x25450d['error'][_0xd777('0x10')]);}else{logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));_0x49d55d(_0x25450d[_0xd777('0x11')]['message']);}})[_0xd777('0x12')](function(_0x4b3d52){logger[_0xd777('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5d1a5f,_0x4b3d52);_0x197296(_0x4b3d52);});});}exports[_0xd777('0x13')]=function(_0x386f1a){var _0x2dd8ec=this;return new Promise(function(_0x13b63b,_0x2c6114){return db[_0xd777('0x14')]['create'](_0x386f1a['body'],{'raw':_0x386f1a[_0xd777('0x15')]?_0x386f1a['options'][_0xd777('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x58a079){logger['info'](_0xd777('0x13'),_0x386f1a);logger['debug']('CreateOpenchannelQueueReport',_0x386f1a,JSON['stringify'](_0x58a079));_0x13b63b(_0x58a079);})['catch'](function(_0x55b975){logger[_0xd777('0xf')](_0xd777('0x13'),_0x55b975[_0xd777('0x10')],_0x386f1a);_0x2c6114(_0x2dd8ec[_0xd777('0xf')](0x1f4,_0x55b975[_0xd777('0x10')]));});});};exports[_0xd777('0x17')]=function(_0x2ff8d3){var _0x87b828=this;return new Promise(function(_0x188a3a,_0x3e637a){return db[_0xd777('0x14')]['update'](_0x2ff8d3[_0xd777('0x18')],{'raw':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3[_0xd777('0x15')][_0xd777('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3['options'][_0xd777('0x19')]||null:null,'attributes':_0x2ff8d3['options']?_0x2ff8d3['options'][_0xd777('0x1a')]||null:null,'limit':_0x2ff8d3[_0xd777('0x15')]?_0x2ff8d3[_0xd777('0x15')][_0xd777('0x1b')]||null:null})['then'](function(_0x453b45){logger[_0xd777('0x9')](_0xd777('0x17'),_0x2ff8d3);logger[_0xd777('0xc')](_0xd777('0x17'),_0x2ff8d3,JSON[_0xd777('0xe')](_0x453b45));_0x188a3a(_0x453b45);})[_0xd777('0x12')](function(_0x3ebb94){logger['error'](_0xd777('0x17'),_0x3ebb94['message'],_0x2ff8d3);_0x3e637a(_0x87b828['error'](0x1f4,_0x3ebb94[_0xd777('0x10')]));});});};
\ No newline at end of file
index 176e197..fc29301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc711=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x2aed33,_0x26112d){var _0x19f2a0=function(_0x1774a1){while(--_0x1774a1){_0x2aed33['push'](_0x2aed33['shift']());}};_0x19f2a0(++_0x26112d);}(_0xc711,0x1ef));var _0x1c71=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0xc711[_0x13c70c];return _0x50f0f2;};'use strict';var multer=require('multer');var util=require(_0x1c71('0x0'));var path=require(_0x1c71('0x1'));var timeout=require(_0x1c71('0x2'));var express=require('express');var router=express[_0x1c71('0x3')]();var fs_extra=require(_0x1c71('0x4'));var auth=require(_0x1c71('0x5'));var interaction=require(_0x1c71('0x6'));var config=require(_0x1c71('0x7'));var controller=require(_0x1c71('0x8'));router[_0x1c71('0x9')]('/',auth[_0x1c71('0xa')](),controller[_0x1c71('0xb')]);router[_0x1c71('0x9')](_0x1c71('0xc'),auth[_0x1c71('0xa')](),controller['describe']);router[_0x1c71('0x9')](_0x1c71('0xd'),auth[_0x1c71('0xa')](),controller['show']);router[_0x1c71('0xe')]('/',auth[_0x1c71('0xa')](),controller[_0x1c71('0xf')]);router[_0x1c71('0x10')](_0x1c71('0xd'),auth[_0x1c71('0xa')](),controller[_0x1c71('0x11')]);router[_0x1c71('0x12')](_0x1c71('0xd'),auth[_0x1c71('0xa')](),controller['destroy']);module[_0x1c71('0x13')]=router;
\ No newline at end of file
+var _0x9d7a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','destroy'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x9d7a,0xbd));var _0xa9d7=function(_0x1c2891,_0x25970c){_0x1c2891=_0x1c2891-0x0;var _0x462583=_0x9d7a[_0x1c2891];return _0x462583;};'use strict';var multer=require(_0xa9d7('0x0'));var util=require(_0xa9d7('0x1'));var path=require(_0xa9d7('0x2'));var timeout=require(_0xa9d7('0x3'));var express=require(_0xa9d7('0x4'));var router=express[_0xa9d7('0x5')]();var fs_extra=require(_0xa9d7('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa9d7('0x7'));var controller=require('./openchannelTransferReport.controller');router[_0xa9d7('0x8')]('/',auth[_0xa9d7('0x9')](),controller[_0xa9d7('0xa')]);router[_0xa9d7('0x8')](_0xa9d7('0xb'),auth[_0xa9d7('0x9')](),controller[_0xa9d7('0xc')]);router[_0xa9d7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xa9d7('0xd')]);router[_0xa9d7('0xe')]('/',auth[_0xa9d7('0x9')](),controller[_0xa9d7('0xf')]);router[_0xa9d7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa9d7('0x11')]);router[_0xa9d7('0x12')](_0xa9d7('0x13'),auth[_0xa9d7('0x9')](),controller[_0xa9d7('0x14')]);module['exports']=router;
\ No newline at end of file
index ed9eb3c..2e52041 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(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4134ab,_0xf28df8){_0x4134ab=_0x4134ab-0x0;var _0x571f4f=_0xb43b[_0x4134ab];return _0x571f4f;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3da144,_0x578cbd){var _0x13fdc7=function(_0x2d2919){while(--_0x2d2919){_0x3da144['push'](_0x3da144['shift']());}};_0x13fdc7(++_0x578cbd);}(_0x34e8,0x12c));var _0x834e=function(_0x323fef,_0x334954){_0x323fef=_0x323fef-0x0;var _0x533f09=_0x34e8[_0x323fef];return _0x533f09;};'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
index 6bc8561..54cdf2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd336=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','update','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x30acd4,_0x6ccf2b){var _0x40eef2=function(_0x3c1241){while(--_0x3c1241){_0x30acd4['push'](_0x30acd4['shift']());}};_0x40eef2(++_0x6ccf2b);}(_0xd336,0xd9));var _0x6d33=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0xd336[_0x3005d5];return _0x547c7e;};'use strict';var emlformat=require(_0x6d33('0x0'));var rimraf=require(_0x6d33('0x1'));var zipdir=require(_0x6d33('0x2'));var jsonpatch=require(_0x6d33('0x3'));var rp=require(_0x6d33('0x4'));var moment=require('moment');var BPromise=require(_0x6d33('0x5'));var Mustache=require(_0x6d33('0x6'));var util=require(_0x6d33('0x7'));var path=require('path');var sox=require(_0x6d33('0x8'));var csv=require(_0x6d33('0x9'));var ejs=require(_0x6d33('0xa'));var fs=require('fs');var fs_extra=require(_0x6d33('0xb'));var _=require(_0x6d33('0xc'));var squel=require(_0x6d33('0xd'));var crypto=require(_0x6d33('0xe'));var jsforce=require(_0x6d33('0xf'));var deskjs=require(_0x6d33('0x10'));var toCsv=require(_0x6d33('0x9'));var querystring=require(_0x6d33('0x11'));var Papa=require('papaparse');var Redis=require(_0x6d33('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6d33('0x13'));var as=require(_0x6d33('0x14'));var hardwareService=require(_0x6d33('0x15'));var logger=require(_0x6d33('0x16'))(_0x6d33('0x17'));var utils=require(_0x6d33('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6d33('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c4d4c,_0x1f62ea){_0x1f62ea=_0x1f62ea||0xcc;return function(_0x5bc816){if(_0x5bc816){return _0x4c4d4c[_0x6d33('0x1a')](_0x1f62ea);}return _0x4c4d4c['status'](_0x1f62ea)['end']();};}function respondWithResult(_0xc329c9,_0x17c2c3){_0x17c2c3=_0x17c2c3||0xc8;return function(_0x3690fb){if(_0x3690fb){return _0xc329c9[_0x6d33('0x1b')](_0x17c2c3)[_0x6d33('0x1c')](_0x3690fb);}};}function respondWithFilteredResult(_0x111872,_0x3633e0){return function(_0x43e7ae){if(_0x43e7ae){var _0x4a8216=typeof _0x3633e0[_0x6d33('0x1d')]===_0x6d33('0x1e')&&typeof _0x3633e0[_0x6d33('0x1f')]===_0x6d33('0x1e');var _0x3ba0b0=_0x43e7ae[_0x6d33('0x20')];var _0xc968a9=_0x4a8216?0x0:_0x3633e0[_0x6d33('0x1d')];var _0x21d7a6=_0x4a8216?_0x43e7ae[_0x6d33('0x20')]:_0x3633e0[_0x6d33('0x1d')]+_0x3633e0[_0x6d33('0x1f')];var _0xa2a198;if(_0x21d7a6>=_0x3ba0b0){_0x21d7a6=_0x3ba0b0;_0xa2a198=0xc8;}else{_0xa2a198=0xce;}_0x111872[_0x6d33('0x1b')](_0xa2a198);return _0x111872[_0x6d33('0x21')](_0x6d33('0x22'),_0xc968a9+'-'+_0x21d7a6+'/'+_0x3ba0b0)['json'](_0x43e7ae);}return null;};}function patchUpdates(_0x8e5fea){return function(_0x4644c0){try{jsonpatch['apply'](_0x4644c0,_0x8e5fea,!![]);}catch(_0x2b2d24){return BPromise[_0x6d33('0x23')](_0x2b2d24);}return _0x4644c0[_0x6d33('0x24')]();};}function saveUpdates(_0x953925,_0x152776){return function(_0x4be6da){if(_0x4be6da){return _0x4be6da['update'](_0x953925)['then'](function(_0x4640ad){return _0x4640ad;});}return null;};}function removeEntity(_0x163d72,_0x1e3dfc){return function(_0x151e81){if(_0x151e81){return _0x151e81[_0x6d33('0x25')]()[_0x6d33('0x26')](function(){_0x163d72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b87ad,_0x3c9489){return function(_0x2fd590){if(!_0x2fd590){_0x3b87ad[_0x6d33('0x1a')](0x194);}return _0x2fd590;};}function handleError(_0x4d0b7f,_0x2cd3b8){_0x2cd3b8=_0x2cd3b8||0x1f4;return function(_0x259552){logger[_0x6d33('0x27')](_0x259552[_0x6d33('0x28')]);if(_0x259552[_0x6d33('0x29')]){delete _0x259552[_0x6d33('0x29')];}_0x4d0b7f[_0x6d33('0x1b')](_0x2cd3b8)[_0x6d33('0x2a')](_0x259552);};}exports[_0x6d33('0x2b')]=function(_0x2fa177,_0x5b873e){var _0x1bf3a2={},_0x1d0bf8={},_0x414d6b={'count':0x0,'rows':[]};var _0x7870fd=_[_0x6d33('0x2c')](db[_0x6d33('0x2d')][_0x6d33('0x2e')],function(_0x439aae){return{'name':_0x439aae[_0x6d33('0x2f')],'type':_0x439aae['type'][_0x6d33('0x30')]};});_0x1d0bf8[_0x6d33('0x31')]=_[_0x6d33('0x2c')](_0x7870fd,_0x6d33('0x29'));_0x1d0bf8[_0x6d33('0x32')]=_[_0x6d33('0x33')](_0x2fa177[_0x6d33('0x32')]);_0x1d0bf8['filters']=_['intersection'](_0x1d0bf8['model'],_0x1d0bf8['query']);_0x1bf3a2['attributes']=_[_0x6d33('0x34')](_0x1d0bf8[_0x6d33('0x31')],qs[_0x6d33('0x35')](_0x2fa177['query'][_0x6d33('0x35')]));_0x1bf3a2[_0x6d33('0x36')]=_0x1bf3a2[_0x6d33('0x36')][_0x6d33('0x37')]?_0x1bf3a2[_0x6d33('0x36')]:_0x1d0bf8[_0x6d33('0x31')];if(!_0x2fa177[_0x6d33('0x32')][_0x6d33('0x38')](_0x6d33('0x39'))){_0x1bf3a2[_0x6d33('0x1f')]=qs[_0x6d33('0x1f')](_0x2fa177[_0x6d33('0x32')]['limit']);_0x1bf3a2[_0x6d33('0x1d')]=qs[_0x6d33('0x1d')](_0x2fa177[_0x6d33('0x32')][_0x6d33('0x1d')]);}_0x1bf3a2[_0x6d33('0x3a')]=qs['sort'](_0x2fa177[_0x6d33('0x32')][_0x6d33('0x3b')]);_0x1bf3a2[_0x6d33('0x3c')]=qs[_0x6d33('0x3d')](_[_0x6d33('0x3e')](_0x2fa177[_0x6d33('0x32')],_0x1d0bf8['filters']),_0x7870fd);if(_0x2fa177[_0x6d33('0x32')][_0x6d33('0x3f')]){_0x1bf3a2[_0x6d33('0x3c')]=_[_0x6d33('0x40')](_0x1bf3a2['where'],{'$or':_['map'](_0x7870fd,function(_0x292b46){if(_0x292b46['type']!==_0x6d33('0x41')){var _0x3ff792={};_0x3ff792[_0x292b46['name']]={'$like':'%'+_0x2fa177[_0x6d33('0x32')][_0x6d33('0x3f')]+'%'};return _0x3ff792;}})});}_0x1bf3a2=_['merge']({},_0x1bf3a2,_0x2fa177[_0x6d33('0x42')]);var _0x2d613c={'where':_0x1bf3a2['where']};return db[_0x6d33('0x2d')][_0x6d33('0x20')](_0x2d613c)[_0x6d33('0x26')](function(_0x89a729){_0x414d6b[_0x6d33('0x20')]=_0x89a729;if(_0x2fa177['query'][_0x6d33('0x43')]){_0x1bf3a2[_0x6d33('0x44')]=[{'all':!![]}];}return db[_0x6d33('0x2d')][_0x6d33('0x45')](_0x1bf3a2);})[_0x6d33('0x26')](function(_0x2f4813){_0x414d6b[_0x6d33('0x46')]=_0x2f4813;return _0x414d6b;})[_0x6d33('0x26')](respondWithFilteredResult(_0x5b873e,_0x1bf3a2))[_0x6d33('0x47')](handleError(_0x5b873e,null));};exports[_0x6d33('0x48')]=function(_0x534d88,_0x282777){var _0x47aa1d={'raw':!![],'where':{'id':_0x534d88[_0x6d33('0x49')]['id']}},_0x59a287={};_0x59a287['model']=_[_0x6d33('0x33')](db[_0x6d33('0x2d')][_0x6d33('0x2e')]);_0x59a287[_0x6d33('0x32')]=_[_0x6d33('0x33')](_0x534d88[_0x6d33('0x32')]);_0x59a287[_0x6d33('0x3d')]=_['intersection'](_0x59a287[_0x6d33('0x31')],_0x59a287[_0x6d33('0x32')]);_0x47aa1d[_0x6d33('0x36')]=_[_0x6d33('0x34')](_0x59a287['model'],qs['fields'](_0x534d88[_0x6d33('0x32')][_0x6d33('0x35')]));_0x47aa1d['attributes']=_0x47aa1d[_0x6d33('0x36')][_0x6d33('0x37')]?_0x47aa1d[_0x6d33('0x36')]:_0x59a287[_0x6d33('0x31')];if(_0x534d88[_0x6d33('0x32')][_0x6d33('0x43')]){_0x47aa1d[_0x6d33('0x44')]=[{'all':!![]}];}_0x47aa1d=_[_0x6d33('0x40')]({},_0x47aa1d,_0x534d88[_0x6d33('0x42')]);return db[_0x6d33('0x2d')]['find'](_0x47aa1d)[_0x6d33('0x26')](handleEntityNotFound(_0x282777,null))[_0x6d33('0x26')](respondWithResult(_0x282777,null))[_0x6d33('0x47')](handleError(_0x282777,null));};exports[_0x6d33('0x4a')]=function(_0x2b469d,_0x14971b){return db[_0x6d33('0x2d')]['create'](_0x2b469d['body'],{})[_0x6d33('0x26')](respondWithResult(_0x14971b,0xc9))['catch'](handleError(_0x14971b,null));};exports[_0x6d33('0x4b')]=function(_0x543d91,_0x1627be){if(_0x543d91['body']['id']){delete _0x543d91[_0x6d33('0x4c')]['id'];}return db['OpenchannelTransferReport'][_0x6d33('0x4d')]({'where':{'id':_0x543d91[_0x6d33('0x49')]['id']}})['then'](handleEntityNotFound(_0x1627be,null))['then'](saveUpdates(_0x543d91[_0x6d33('0x4c')],null))[_0x6d33('0x26')](respondWithResult(_0x1627be,null))['catch'](handleError(_0x1627be,null));};exports[_0x6d33('0x25')]=function(_0x2a0af8,_0x48694c){return db[_0x6d33('0x2d')][_0x6d33('0x4d')]({'where':{'id':_0x2a0af8[_0x6d33('0x49')]['id']}})[_0x6d33('0x26')](handleEntityNotFound(_0x48694c,null))[_0x6d33('0x26')](removeEntity(_0x48694c,null))[_0x6d33('0x47')](handleError(_0x48694c,null));};exports[_0x6d33('0x4e')]=function(_0x32afa8,_0x343d6d){return db[_0x6d33('0x2d')][_0x6d33('0x4e')]()[_0x6d33('0x26')](respondWithResult(_0x343d6d,null))[_0x6d33('0x47')](handleError(_0x343d6d,null));};
\ No newline at end of file
+var _0x71b3=['find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body'];(function(_0x47e448,_0x13fc0c){var _0x2b94da=function(_0x321185){while(--_0x321185){_0x47e448['push'](_0x47e448['shift']());}};_0x2b94da(++_0x13fc0c);}(_0x71b3,0x165));var _0x371b=function(_0x587799,_0x23b2e7){_0x587799=_0x587799-0x0;var _0x5c72b2=_0x71b3[_0x587799];return _0x5c72b2;};'use strict';var emlformat=require(_0x371b('0x0'));var rimraf=require(_0x371b('0x1'));var zipdir=require(_0x371b('0x2'));var jsonpatch=require(_0x371b('0x3'));var rp=require(_0x371b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x371b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x371b('0x6'));var ejs=require(_0x371b('0x7'));var fs=require('fs');var fs_extra=require(_0x371b('0x8'));var _=require(_0x371b('0x9'));var squel=require('squel');var crypto=require(_0x371b('0xa'));var jsforce=require(_0x371b('0xb'));var deskjs=require(_0x371b('0xc'));var toCsv=require(_0x371b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x371b('0xd'));var authService=require(_0x371b('0xe'));var qs=require(_0x371b('0xf'));var as=require(_0x371b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x371b('0x11'));var utils=require(_0x371b('0x12'));var config=require(_0x371b('0x13'));var licenseUtil=require(_0x371b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25f706,_0x4aa502){_0x4aa502=_0x4aa502||0xcc;return function(_0xc19626){if(_0xc19626){return _0x25f706['sendStatus'](_0x4aa502);}return _0x25f706['status'](_0x4aa502)['end']();};}function respondWithResult(_0x13834f,_0x28d55a){_0x28d55a=_0x28d55a||0xc8;return function(_0x48be7f){if(_0x48be7f){return _0x13834f['status'](_0x28d55a)['json'](_0x48be7f);}};}function respondWithFilteredResult(_0x4e0033,_0x184d13){return function(_0x409553){if(_0x409553){var _0x2eb018=typeof _0x184d13[_0x371b('0x15')]===_0x371b('0x16')&&typeof _0x184d13[_0x371b('0x17')]===_0x371b('0x16');var _0x4a3097=_0x409553[_0x371b('0x18')];var _0x58840c=_0x2eb018?0x0:_0x184d13['offset'];var _0xcd3187=_0x2eb018?_0x409553[_0x371b('0x18')]:_0x184d13['offset']+_0x184d13[_0x371b('0x17')];var _0x1a0867;if(_0xcd3187>=_0x4a3097){_0xcd3187=_0x4a3097;_0x1a0867=0xc8;}else{_0x1a0867=0xce;}_0x4e0033[_0x371b('0x19')](_0x1a0867);return _0x4e0033[_0x371b('0x1a')]('Content-Range',_0x58840c+'-'+_0xcd3187+'/'+_0x4a3097)[_0x371b('0x1b')](_0x409553);}return null;};}function patchUpdates(_0x47cdf0){return function(_0x506aa2){try{jsonpatch[_0x371b('0x1c')](_0x506aa2,_0x47cdf0,!![]);}catch(_0x49a697){return BPromise[_0x371b('0x1d')](_0x49a697);}return _0x506aa2[_0x371b('0x1e')]();};}function saveUpdates(_0x599c1a,_0x20b47d){return function(_0x40b58a){if(_0x40b58a){return _0x40b58a[_0x371b('0x1f')](_0x599c1a)[_0x371b('0x20')](function(_0x3ef709){return _0x3ef709;});}return null;};}function removeEntity(_0x6c92d0,_0x4a3dc4){return function(_0x29207a){if(_0x29207a){return _0x29207a[_0x371b('0x21')]()['then'](function(){_0x6c92d0[_0x371b('0x19')](0xcc)[_0x371b('0x22')]();});}};}function handleEntityNotFound(_0x1c503b,_0x4790b1){return function(_0x51ce52){if(!_0x51ce52){_0x1c503b[_0x371b('0x23')](0x194);}return _0x51ce52;};}function handleError(_0x5b9e2f,_0x2af061){_0x2af061=_0x2af061||0x1f4;return function(_0x5ca19b){logger[_0x371b('0x24')](_0x5ca19b['stack']);if(_0x5ca19b[_0x371b('0x25')]){delete _0x5ca19b[_0x371b('0x25')];}_0x5b9e2f['status'](_0x2af061)['send'](_0x5ca19b);};}exports['index']=function(_0x289957,_0x2b729c){var _0x1a2534={},_0x1f1318={},_0x5b50f3={'count':0x0,'rows':[]};var _0xb9adfa=_[_0x371b('0x26')](db[_0x371b('0x27')][_0x371b('0x28')],function(_0x45e5b2){return{'name':_0x45e5b2['fieldName'],'type':_0x45e5b2[_0x371b('0x29')][_0x371b('0x2a')]};});_0x1f1318[_0x371b('0x2b')]=_[_0x371b('0x26')](_0xb9adfa,'name');_0x1f1318[_0x371b('0x2c')]=_[_0x371b('0x2d')](_0x289957[_0x371b('0x2c')]);_0x1f1318[_0x371b('0x2e')]=_[_0x371b('0x2f')](_0x1f1318[_0x371b('0x2b')],_0x1f1318[_0x371b('0x2c')]);_0x1a2534[_0x371b('0x30')]=_[_0x371b('0x2f')](_0x1f1318[_0x371b('0x2b')],qs['fields'](_0x289957[_0x371b('0x2c')][_0x371b('0x31')]));_0x1a2534[_0x371b('0x30')]=_0x1a2534[_0x371b('0x30')][_0x371b('0x32')]?_0x1a2534['attributes']:_0x1f1318[_0x371b('0x2b')];if(!_0x289957['query'][_0x371b('0x33')](_0x371b('0x34'))){_0x1a2534[_0x371b('0x17')]=qs[_0x371b('0x17')](_0x289957['query'][_0x371b('0x17')]);_0x1a2534[_0x371b('0x15')]=qs[_0x371b('0x15')](_0x289957[_0x371b('0x2c')][_0x371b('0x15')]);}_0x1a2534[_0x371b('0x35')]=qs[_0x371b('0x36')](_0x289957['query']['sort']);_0x1a2534[_0x371b('0x37')]=qs['filters'](_[_0x371b('0x38')](_0x289957['query'],_0x1f1318[_0x371b('0x2e')]),_0xb9adfa);if(_0x289957['query'][_0x371b('0x39')]){_0x1a2534['where']=_[_0x371b('0x3a')](_0x1a2534[_0x371b('0x37')],{'$or':_[_0x371b('0x26')](_0xb9adfa,function(_0x24e8ef){if(_0x24e8ef[_0x371b('0x29')]!==_0x371b('0x3b')){var _0x15c1c9={};_0x15c1c9[_0x24e8ef[_0x371b('0x25')]]={'$like':'%'+_0x289957[_0x371b('0x2c')][_0x371b('0x39')]+'%'};return _0x15c1c9;}})});}_0x1a2534=_[_0x371b('0x3a')]({},_0x1a2534,_0x289957[_0x371b('0x3c')]);var _0x5a16b2={'where':_0x1a2534[_0x371b('0x37')]};return db['OpenchannelTransferReport']['count'](_0x5a16b2)[_0x371b('0x20')](function(_0x1c91b4){_0x5b50f3[_0x371b('0x18')]=_0x1c91b4;if(_0x289957[_0x371b('0x2c')][_0x371b('0x3d')]){_0x1a2534[_0x371b('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x371b('0x3f')](_0x1a2534);})[_0x371b('0x20')](function(_0x47c972){_0x5b50f3[_0x371b('0x40')]=_0x47c972;return _0x5b50f3;})[_0x371b('0x20')](respondWithFilteredResult(_0x2b729c,_0x1a2534))[_0x371b('0x41')](handleError(_0x2b729c,null));};exports[_0x371b('0x42')]=function(_0x4fd1ef,_0x969e9c){var _0x3dbf72={'raw':!![],'where':{'id':_0x4fd1ef['params']['id']}},_0x4dd2e6={};_0x4dd2e6[_0x371b('0x2b')]=_[_0x371b('0x2d')](db[_0x371b('0x27')][_0x371b('0x28')]);_0x4dd2e6[_0x371b('0x2c')]=_['keys'](_0x4fd1ef[_0x371b('0x2c')]);_0x4dd2e6[_0x371b('0x2e')]=_[_0x371b('0x2f')](_0x4dd2e6[_0x371b('0x2b')],_0x4dd2e6[_0x371b('0x2c')]);_0x3dbf72[_0x371b('0x30')]=_[_0x371b('0x2f')](_0x4dd2e6[_0x371b('0x2b')],qs[_0x371b('0x31')](_0x4fd1ef[_0x371b('0x2c')]['fields']));_0x3dbf72['attributes']=_0x3dbf72[_0x371b('0x30')][_0x371b('0x32')]?_0x3dbf72[_0x371b('0x30')]:_0x4dd2e6[_0x371b('0x2b')];if(_0x4fd1ef[_0x371b('0x2c')]['includeAll']){_0x3dbf72['include']=[{'all':!![]}];}_0x3dbf72=_[_0x371b('0x3a')]({},_0x3dbf72,_0x4fd1ef['options']);return db[_0x371b('0x27')]['find'](_0x3dbf72)[_0x371b('0x20')](handleEntityNotFound(_0x969e9c,null))[_0x371b('0x20')](respondWithResult(_0x969e9c,null))[_0x371b('0x41')](handleError(_0x969e9c,null));};exports[_0x371b('0x43')]=function(_0x43f550,_0x2fe50d){return db['OpenchannelTransferReport']['create'](_0x43f550['body'],{})[_0x371b('0x20')](respondWithResult(_0x2fe50d,0xc9))['catch'](handleError(_0x2fe50d,null));};exports[_0x371b('0x1f')]=function(_0x394ddb,_0x4dc257){if(_0x394ddb[_0x371b('0x44')]['id']){delete _0x394ddb[_0x371b('0x44')]['id'];}return db[_0x371b('0x27')][_0x371b('0x45')]({'where':{'id':_0x394ddb[_0x371b('0x46')]['id']}})[_0x371b('0x20')](handleEntityNotFound(_0x4dc257,null))[_0x371b('0x20')](saveUpdates(_0x394ddb[_0x371b('0x44')],null))[_0x371b('0x20')](respondWithResult(_0x4dc257,null))['catch'](handleError(_0x4dc257,null));};exports[_0x371b('0x21')]=function(_0x55138b,_0x4b64dd){return db[_0x371b('0x27')][_0x371b('0x45')]({'where':{'id':_0x55138b['params']['id']}})[_0x371b('0x20')](handleEntityNotFound(_0x4b64dd,null))['then'](removeEntity(_0x4b64dd,null))[_0x371b('0x41')](handleError(_0x4b64dd,null));};exports['describe']=function(_0x194c62,_0x2af05f){return db['OpenchannelTransferReport']['describe']()[_0x371b('0x20')](respondWithResult(_0x2af05f,null))[_0x371b('0x41')](handleError(_0x2af05f,null));};
\ No newline at end of file
index 95b3432..e9c823f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fd8=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x535d1a,_0x340d8a){var _0x71c06a=function(_0x54acd9){while(--_0x54acd9){_0x535d1a['push'](_0x535d1a['shift']());}};_0x71c06a(++_0x340d8a);}(_0x5fd8,0x14b));var _0x85fd=function(_0xa07ea6,_0xbb55be){_0xa07ea6=_0xa07ea6-0x0;var _0x4c4d42=_0x5fd8[_0xa07ea6];return _0x4c4d42;};'use strict';var _=require(_0x85fd('0x0'));var util=require(_0x85fd('0x1'));var logger=require(_0x85fd('0x2'))(_0x85fd('0x3'));var moment=require('moment');var BPromise=require(_0x85fd('0x4'));var rp=require(_0x85fd('0x5'));var fs=require('fs');var path=require(_0x85fd('0x6'));var rimraf=require(_0x85fd('0x7'));var config=require(_0x85fd('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x85fd('0x9')]=function(_0x25046a,_0x2374d5){return _0x25046a[_0x85fd('0xa')](_0x85fd('0xb'),attributes,{'tableName':_0x85fd('0xc'),'paranoid':![],'indexes':[{'name':_0x85fd('0xd'),'fields':[_0x85fd('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x25c2=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x25c3bc,_0x34c529){var _0x569223=function(_0x150c08){while(--_0x150c08){_0x25c3bc['push'](_0x25c3bc['shift']());}};_0x569223(++_0x34c529);}(_0x25c2,0xaa));var _0x225c=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x25c2[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x225c('0x0'));var util=require(_0x225c('0x1'));var logger=require(_0x225c('0x2'))(_0x225c('0x3'));var moment=require(_0x225c('0x4'));var BPromise=require(_0x225c('0x5'));var rp=require(_0x225c('0x6'));var fs=require('fs');var path=require(_0x225c('0x7'));var rimraf=require(_0x225c('0x8'));var config=require(_0x225c('0x9'));var attributes=require(_0x225c('0xa'));module[_0x225c('0xb')]=function(_0x18c78a,_0x2b1820){return _0x18c78a[_0x225c('0xc')](_0x225c('0xd'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x225c('0xe'),'fields':[_0x225c('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 2b88826..4084f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3561=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0x3561,0x94));var _0x1356=function(_0x38fcfd,_0x2c370f){_0x38fcfd=_0x38fcfd-0x0;var _0x2e53c0=_0x3561[_0x38fcfd];return _0x2e53c0;};'use strict';var _=require(_0x1356('0x0'));var util=require('util');var moment=require(_0x1356('0x1'));var BPromise=require(_0x1356('0x2'));var rs=require(_0x1356('0x3'));var fs=require('fs');var Redis=require(_0x1356('0x4'));var db=require(_0x1356('0x5'))['db'];var utils=require(_0x1356('0x6'));var logger=require(_0x1356('0x7'))(_0x1356('0x8'));var config=require(_0x1356('0x9'));var jayson=require(_0x1356('0xa'));var client=jayson[_0x1356('0xb')][_0x1356('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x45ac56,_0x4b4527,_0x105aaf){return new BPromise(function(_0x33529f,_0x1e98ae){return client['request'](_0x45ac56,_0x105aaf)['then'](function(_0x4e1adb){logger[_0x1356('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4b4527,_0x1356('0xe'));logger['debug'](_0x1356('0xf'),_0x4b4527,_0x1356('0xe'),JSON['stringify'](_0x4e1adb));if(_0x4e1adb[_0x1356('0x10')]){if(_0x4e1adb[_0x1356('0x10')]['code']===0x1f4){logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);return _0x1e98ae(_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);}logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);return _0x33529f(_0x4e1adb[_0x1356('0x10')][_0x1356('0x12')]);}else{logger[_0x1356('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4b4527,'request\x20sent');_0x33529f(_0x4e1adb[_0x1356('0x13')][_0x1356('0x12')]);}})[_0x1356('0x14')](function(_0x5cecb2){logger[_0x1356('0x10')](_0x1356('0x11'),_0x4b4527,_0x5cecb2);_0x1e98ae(_0x5cecb2);});});}
\ No newline at end of file
+var _0x72a2=['info','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0xaa8588,_0x1d32f7){var _0x46a6c1=function(_0x818dae){while(--_0x818dae){_0xaa8588['push'](_0xaa8588['shift']());}};_0x46a6c1(++_0x1d32f7);}(_0x72a2,0x161));var _0x272a=function(_0xbf2ff6,_0xe695a7){_0xbf2ff6=_0xbf2ff6-0x0;var _0xf9fca9=_0x72a2[_0xbf2ff6];return _0xf9fca9;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var moment=require(_0x272a('0x1'));var BPromise=require(_0x272a('0x2'));var rs=require(_0x272a('0x3'));var fs=require('fs');var Redis=require(_0x272a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x272a('0x5'));var logger=require('../../config/logger')(_0x272a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x272a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43d188,_0x220b90,_0x283070){return new BPromise(function(_0x54dbfb,_0x484f88){return client[_0x272a('0x8')](_0x43d188,_0x283070)['then'](function(_0x830fb6){logger['info'](_0x272a('0x9'),_0x220b90,_0x272a('0xa'));logger[_0x272a('0xb')](_0x272a('0xc'),_0x220b90,'request\x20sent',JSON['stringify'](_0x830fb6));if(_0x830fb6[_0x272a('0xd')]){if(_0x830fb6[_0x272a('0xd')]['code']===0x1f4){logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x484f88(_0x830fb6[_0x272a('0xd')]['message']);}logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x54dbfb(_0x830fb6['error'][_0x272a('0xe')]);}else{logger[_0x272a('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x220b90,'request\x20sent');_0x54dbfb(_0x830fb6['result']['message']);}})['catch'](function(_0x567955){logger[_0x272a('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x220b90,_0x567955);_0x484f88(_0x567955);});});}
\ No newline at end of file
index cbdc723..97d504b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc5c=['put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0xdc5c,0x194));var _0xcdc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc5c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcdc5('0x0'));var util=require(_0xcdc5('0x1'));var path=require(_0xcdc5('0x2'));var timeout=require(_0xcdc5('0x3'));var express=require(_0xcdc5('0x4'));var router=express[_0xcdc5('0x5')]();var fs_extra=require(_0xcdc5('0x6'));var auth=require(_0xcdc5('0x7'));var interaction=require(_0xcdc5('0x8'));var config=require(_0xcdc5('0x9'));var controller=require('./pause.controller');router[_0xcdc5('0xa')]('/',auth[_0xcdc5('0xb')](),controller[_0xcdc5('0xc')]);router[_0xcdc5('0xa')]('/:id',auth[_0xcdc5('0xb')](),controller[_0xcdc5('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xcdc5('0xe')](_0xcdc5('0xf'),auth['isAuthenticated'](),controller[_0xcdc5('0x10')]);router[_0xcdc5('0x11')](_0xcdc5('0xf'),auth[_0xcdc5('0xb')](),controller[_0xcdc5('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x5d4d=['put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','create'];(function(_0x2de522,_0x30337f){var _0xe24362=function(_0x94cc4){while(--_0x94cc4){_0x2de522['push'](_0x2de522['shift']());}};_0xe24362(++_0x30337f);}(_0x5d4d,0x1cf));var _0xd5d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d4d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd5d4('0x0'));var util=require(_0xd5d4('0x1'));var path=require(_0xd5d4('0x2'));var timeout=require(_0xd5d4('0x3'));var express=require(_0xd5d4('0x4'));var router=express[_0xd5d4('0x5')]();var fs_extra=require(_0xd5d4('0x6'));var auth=require(_0xd5d4('0x7'));var interaction=require(_0xd5d4('0x8'));var config=require(_0xd5d4('0x9'));var controller=require(_0xd5d4('0xa'));router[_0xd5d4('0xb')]('/',auth['isAuthenticated'](),controller[_0xd5d4('0xc')]);router[_0xd5d4('0xb')](_0xd5d4('0xd'),auth[_0xd5d4('0xe')](),controller[_0xd5d4('0xf')]);router['post']('/',auth[_0xd5d4('0xe')](),controller[_0xd5d4('0x10')]);router[_0xd5d4('0x11')](_0xd5d4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xd5d4('0x12')](_0xd5d4('0xd'),auth[_0xd5d4('0xe')](),controller['destroy']);module[_0xd5d4('0x13')]=router;
\ No newline at end of file
index da12e84..e7731cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d7c=['sequelize','exports','STRING','name'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0d7c,0x80));var _0xc0d7=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x0d7c[_0x40f9a0];return _0x3e3144;};'use strict';var Sequelize=require(_0xc0d7('0x0'));module[_0xc0d7('0x1')]={'name':{'type':Sequelize[_0xc0d7('0x2')],'unique':_0xc0d7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc0d7('0x2')]}};
\ No newline at end of file
+var _0xea84=['sequelize','name'];(function(_0x2bb747,_0x186a3e){var _0x32c072=function(_0x300b38){while(--_0x300b38){_0x2bb747['push'](_0x2bb747['shift']());}};_0x32c072(++_0x186a3e);}(_0xea84,0x1c4));var _0x4ea8=function(_0x46af42,_0x47dc8c){_0x46af42=_0x46af42-0x0;var _0x3f4ef8=_0xea84[_0x46af42];return _0x3f4ef8;};'use strict';var Sequelize=require(_0x4ea8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4ea8('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 82aab4d..d19b105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f0f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','get','Pauses','destroy','sendStatus','error','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7f0f,0x95));var _0xf7f0=function(_0x5df8a9,_0x46db76){_0x5df8a9=_0x5df8a9-0x0;var _0x3ae14d=_0x7f0f[_0x5df8a9];return _0x3ae14d;};'use strict';var emlformat=require(_0xf7f0('0x0'));var rimraf=require(_0xf7f0('0x1'));var zipdir=require(_0xf7f0('0x2'));var jsonpatch=require(_0xf7f0('0x3'));var rp=require(_0xf7f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf7f0('0x5'));var util=require('util');var path=require(_0xf7f0('0x6'));var sox=require(_0xf7f0('0x7'));var csv=require(_0xf7f0('0x8'));var ejs=require(_0xf7f0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7f0('0xa'));var squel=require('squel');var crypto=require(_0xf7f0('0xb'));var jsforce=require(_0xf7f0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf7f0('0x8'));var querystring=require(_0xf7f0('0xd'));var Papa=require(_0xf7f0('0xe'));var Redis=require(_0xf7f0('0xf'));var authService=require(_0xf7f0('0x10'));var qs=require(_0xf7f0('0x11'));var as=require(_0xf7f0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7f0('0x13'))('api');var utils=require(_0xf7f0('0x14'));var config=require(_0xf7f0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf7f0('0x16'))['db'];function respondWithStatusCode(_0x2a5aab,_0x366fdf){_0x366fdf=_0x366fdf||0xcc;return function(_0x1117dc){if(_0x1117dc){return _0x2a5aab['sendStatus'](_0x366fdf);}return _0x2a5aab[_0xf7f0('0x17')](_0x366fdf)[_0xf7f0('0x18')]();};}function respondWithResult(_0x41a055,_0x2f5d4f){_0x2f5d4f=_0x2f5d4f||0xc8;return function(_0x3319cc){if(_0x3319cc){return _0x41a055['status'](_0x2f5d4f)[_0xf7f0('0x19')](_0x3319cc);}};}function respondWithFilteredResult(_0x13c5ad,_0x1a9285){return function(_0x3427df){if(_0x3427df){var _0x26c10a=typeof _0x1a9285[_0xf7f0('0x1a')]==='undefined'&&typeof _0x1a9285['limit']===_0xf7f0('0x1b');var _0x35387c=_0x3427df['count'];var _0x5894b3=_0x26c10a?0x0:_0x1a9285[_0xf7f0('0x1a')];var _0x47b604=_0x26c10a?_0x3427df[_0xf7f0('0x1c')]:_0x1a9285['offset']+_0x1a9285[_0xf7f0('0x1d')];var _0x29a28b;if(_0x47b604>=_0x35387c){_0x47b604=_0x35387c;_0x29a28b=0xc8;}else{_0x29a28b=0xce;}_0x13c5ad['status'](_0x29a28b);return _0x13c5ad['set']('Content-Range',_0x5894b3+'-'+_0x47b604+'/'+_0x35387c)[_0xf7f0('0x19')](_0x3427df);}return null;};}function patchUpdates(_0x26a0ca){return function(_0x4c436d){try{jsonpatch[_0xf7f0('0x1e')](_0x4c436d,_0x26a0ca,!![]);}catch(_0x4ed87c){return BPromise[_0xf7f0('0x1f')](_0x4ed87c);}return _0x4c436d[_0xf7f0('0x20')]();};}function saveUpdates(_0x5e4e49,_0x2c174e){return function(_0x312646){if(_0x312646){return _0x312646[_0xf7f0('0x21')](_0x5e4e49)[_0xf7f0('0x22')](function(_0x1d44ec){return _0x1d44ec;});}return null;};}function removeEntity(_0x5caa71,_0x55125b){return function(_0x2ccd86){if(_0x2ccd86){return _0x2ccd86['destroy']()[_0xf7f0('0x22')](function(){var _0x472234=_0x2ccd86[_0xf7f0('0x23')]({'plain':!![]});var _0xe966f4=_0xf7f0('0x24');return db['UserProfileResource'][_0xf7f0('0x25')]({'where':{'type':_0xe966f4,'resourceId':_0x472234['id']}})['then'](function(){return _0x2ccd86;});})[_0xf7f0('0x22')](function(){_0x5caa71[_0xf7f0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58e849,_0x275662){return function(_0x52b18d){if(!_0x52b18d){_0x58e849[_0xf7f0('0x26')](0x194);}return _0x52b18d;};}function handleError(_0x31f79a,_0x41c79e){_0x41c79e=_0x41c79e||0x1f4;return function(_0x211eb8){logger[_0xf7f0('0x27')](_0x211eb8['stack']);if(_0x211eb8[_0xf7f0('0x28')]){delete _0x211eb8['name'];}_0x31f79a[_0xf7f0('0x17')](_0x41c79e)[_0xf7f0('0x29')](_0x211eb8);};}exports[_0xf7f0('0x2a')]=function(_0x20ecb0,_0x127c2e){var _0x73214={},_0x23c868={},_0x2d0eab={'count':0x0,'rows':[]};var _0x5f3806=_['map'](db[_0xf7f0('0x2b')][_0xf7f0('0x2c')],function(_0x2a23b7){return{'name':_0x2a23b7[_0xf7f0('0x2d')],'type':_0x2a23b7[_0xf7f0('0x2e')][_0xf7f0('0x2f')]};});_0x23c868[_0xf7f0('0x30')]=_[_0xf7f0('0x31')](_0x5f3806,_0xf7f0('0x28'));_0x23c868[_0xf7f0('0x32')]=_[_0xf7f0('0x33')](_0x20ecb0[_0xf7f0('0x32')]);_0x23c868[_0xf7f0('0x34')]=_['intersection'](_0x23c868[_0xf7f0('0x30')],_0x23c868[_0xf7f0('0x32')]);_0x73214['attributes']=_[_0xf7f0('0x35')](_0x23c868['model'],qs[_0xf7f0('0x36')](_0x20ecb0[_0xf7f0('0x32')][_0xf7f0('0x36')]));_0x73214[_0xf7f0('0x37')]=_0x73214[_0xf7f0('0x37')][_0xf7f0('0x38')]?_0x73214['attributes']:_0x23c868[_0xf7f0('0x30')];if(!_0x20ecb0[_0xf7f0('0x32')][_0xf7f0('0x39')]('nolimit')){_0x73214['limit']=qs['limit'](_0x20ecb0[_0xf7f0('0x32')][_0xf7f0('0x1d')]);_0x73214[_0xf7f0('0x1a')]=qs[_0xf7f0('0x1a')](_0x20ecb0[_0xf7f0('0x32')][_0xf7f0('0x1a')]);}_0x73214[_0xf7f0('0x3a')]=qs[_0xf7f0('0x3b')](_0x20ecb0['query'][_0xf7f0('0x3b')]);_0x73214['where']=qs[_0xf7f0('0x34')](_[_0xf7f0('0x3c')](_0x20ecb0['query'],_0x23c868[_0xf7f0('0x34')]),_0x5f3806);if(_0x20ecb0[_0xf7f0('0x32')][_0xf7f0('0x3d')]){_0x73214['where']=_[_0xf7f0('0x3e')](_0x73214[_0xf7f0('0x3f')],{'$or':_[_0xf7f0('0x31')](_0x5f3806,function(_0x4c999f){if(_0x4c999f[_0xf7f0('0x2e')]!=='VIRTUAL'){var _0xb7c845={};_0xb7c845[_0x4c999f['name']]={'$like':'%'+_0x20ecb0[_0xf7f0('0x32')][_0xf7f0('0x3d')]+'%'};return _0xb7c845;}})});}_0x73214=_['merge']({},_0x73214,_0x20ecb0[_0xf7f0('0x40')]);var _0x10062b={'where':_0x73214[_0xf7f0('0x3f')]};return db[_0xf7f0('0x2b')][_0xf7f0('0x1c')](_0x10062b)['then'](function(_0x1fcbe5){_0x2d0eab['count']=_0x1fcbe5;if(_0x20ecb0['query'][_0xf7f0('0x41')]){_0x73214[_0xf7f0('0x42')]=[{'all':!![]}];}return db['Pause'][_0xf7f0('0x43')](_0x73214);})[_0xf7f0('0x22')](function(_0x1bd11c){_0x2d0eab[_0xf7f0('0x44')]=_0x1bd11c;return _0x2d0eab;})[_0xf7f0('0x22')](respondWithFilteredResult(_0x127c2e,_0x73214))[_0xf7f0('0x45')](handleError(_0x127c2e,null));};exports[_0xf7f0('0x46')]=function(_0x1c5435,_0x5d167f){var _0x5633ac={'raw':!![],'where':{'id':_0x1c5435[_0xf7f0('0x47')]['id']}},_0x36ffc7={};_0x36ffc7[_0xf7f0('0x30')]=_[_0xf7f0('0x33')](db['Pause'][_0xf7f0('0x2c')]);_0x36ffc7[_0xf7f0('0x32')]=_['keys'](_0x1c5435[_0xf7f0('0x32')]);_0x36ffc7[_0xf7f0('0x34')]=_[_0xf7f0('0x35')](_0x36ffc7['model'],_0x36ffc7['query']);_0x5633ac[_0xf7f0('0x37')]=_[_0xf7f0('0x35')](_0x36ffc7[_0xf7f0('0x30')],qs[_0xf7f0('0x36')](_0x1c5435[_0xf7f0('0x32')][_0xf7f0('0x36')]));_0x5633ac[_0xf7f0('0x37')]=_0x5633ac[_0xf7f0('0x37')][_0xf7f0('0x38')]?_0x5633ac[_0xf7f0('0x37')]:_0x36ffc7[_0xf7f0('0x30')];if(_0x1c5435[_0xf7f0('0x32')][_0xf7f0('0x41')]){_0x5633ac[_0xf7f0('0x42')]=[{'all':!![]}];}_0x5633ac=_[_0xf7f0('0x3e')]({},_0x5633ac,_0x1c5435[_0xf7f0('0x40')]);return db[_0xf7f0('0x2b')][_0xf7f0('0x48')](_0x5633ac)[_0xf7f0('0x22')](handleEntityNotFound(_0x5d167f,null))[_0xf7f0('0x22')](respondWithResult(_0x5d167f,null))[_0xf7f0('0x45')](handleError(_0x5d167f,null));};exports[_0xf7f0('0x49')]=function(_0x1597b0,_0x188f57){return db[_0xf7f0('0x2b')][_0xf7f0('0x49')](_0x1597b0[_0xf7f0('0x4a')],{})['then'](function(_0x499df1){var _0x1eb099=_0x1597b0[_0xf7f0('0x4b')][_0xf7f0('0x23')]({'plain':!![]});if(!_0x1eb099)throw new Error(_0xf7f0('0x4c'));if(_0x1eb099[_0xf7f0('0x4d')]===_0xf7f0('0x4b')){var _0x3f1e65=_0x499df1[_0xf7f0('0x23')]({'plain':!![]});var _0x5c94e3=_0xf7f0('0x24');return db[_0xf7f0('0x4e')][_0xf7f0('0x48')]({'where':{'name':_0x5c94e3,'userProfileId':_0x1eb099[_0xf7f0('0x4f')]},'raw':!![]})['then'](function(_0x2f0d6e){if(_0x2f0d6e&&_0x2f0d6e['autoAssociation']===0x0){return db['UserProfileResource'][_0xf7f0('0x49')]({'name':_0x3f1e65[_0xf7f0('0x28')],'resourceId':_0x3f1e65['id'],'type':_0x2f0d6e[_0xf7f0('0x28')],'sectionId':_0x2f0d6e['id']},{})[_0xf7f0('0x22')](function(){return _0x499df1;});}else{return _0x499df1;}})['catch'](function(_0x1fe642){logger[_0xf7f0('0x27')](_0xf7f0('0x50'),_0x1fe642);throw _0x1fe642;});}return _0x499df1;})[_0xf7f0('0x22')](respondWithResult(_0x188f57,0xc9))['catch'](handleError(_0x188f57,null));};exports['update']=function(_0x543413,_0x50a393){if(_0x543413[_0xf7f0('0x4a')]['id']){delete _0x543413[_0xf7f0('0x4a')]['id'];}return db[_0xf7f0('0x2b')]['find']({'where':{'id':_0x543413[_0xf7f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x50a393,null))[_0xf7f0('0x22')](saveUpdates(_0x543413[_0xf7f0('0x4a')],null))[_0xf7f0('0x22')](respondWithResult(_0x50a393,null))[_0xf7f0('0x45')](handleError(_0x50a393,null));};exports[_0xf7f0('0x25')]=function(_0x50a788,_0x55cc44){return db[_0xf7f0('0x2b')]['find']({'where':{'id':_0x50a788[_0xf7f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x55cc44,null))[_0xf7f0('0x22')](removeEntity(_0x55cc44,null))['catch'](handleError(_0x55cc44,null));};
\ No newline at end of file
+var _0xa514=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','Pauses','UserProfileResource','error','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','Pause','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0xa514,0xac));var _0x4a51=function(_0x537b07,_0x3be951){_0x537b07=_0x537b07-0x0;var _0x4ed47c=_0xa514[_0x537b07];return _0x4ed47c;};'use strict';var emlformat=require(_0x4a51('0x0'));var rimraf=require(_0x4a51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a51('0x2'));var moment=require(_0x4a51('0x3'));var BPromise=require(_0x4a51('0x4'));var Mustache=require(_0x4a51('0x5'));var util=require(_0x4a51('0x6'));var path=require(_0x4a51('0x7'));var sox=require(_0x4a51('0x8'));var csv=require(_0x4a51('0x9'));var ejs=require(_0x4a51('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a51('0xb'));var squel=require(_0x4a51('0xc'));var crypto=require(_0x4a51('0xd'));var jsforce=require(_0x4a51('0xe'));var deskjs=require(_0x4a51('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a51('0x10'));var Papa=require(_0x4a51('0x11'));var Redis=require(_0x4a51('0x12'));var authService=require(_0x4a51('0x13'));var qs=require(_0x4a51('0x14'));var as=require(_0x4a51('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a51('0x16'));var utils=require(_0x4a51('0x17'));var config=require(_0x4a51('0x18'));var licenseUtil=require(_0x4a51('0x19'));var db=require(_0x4a51('0x1a'))['db'];function respondWithStatusCode(_0x530f56,_0x2b2c4a){_0x2b2c4a=_0x2b2c4a||0xcc;return function(_0x24bbe5){if(_0x24bbe5){return _0x530f56[_0x4a51('0x1b')](_0x2b2c4a);}return _0x530f56[_0x4a51('0x1c')](_0x2b2c4a)[_0x4a51('0x1d')]();};}function respondWithResult(_0x198cd9,_0x514fe5){_0x514fe5=_0x514fe5||0xc8;return function(_0x5a30ba){if(_0x5a30ba){return _0x198cd9[_0x4a51('0x1c')](_0x514fe5)[_0x4a51('0x1e')](_0x5a30ba);}};}function respondWithFilteredResult(_0x4a8666,_0x55eca3){return function(_0x157e33){if(_0x157e33){var _0x27e5d5=typeof _0x55eca3['offset']===_0x4a51('0x1f')&&typeof _0x55eca3[_0x4a51('0x20')]==='undefined';var _0x517375=_0x157e33[_0x4a51('0x21')];var _0x37efdf=_0x27e5d5?0x0:_0x55eca3[_0x4a51('0x22')];var _0x12f2b4=_0x27e5d5?_0x157e33[_0x4a51('0x21')]:_0x55eca3[_0x4a51('0x22')]+_0x55eca3[_0x4a51('0x20')];var _0x4af7a7;if(_0x12f2b4>=_0x517375){_0x12f2b4=_0x517375;_0x4af7a7=0xc8;}else{_0x4af7a7=0xce;}_0x4a8666[_0x4a51('0x1c')](_0x4af7a7);return _0x4a8666[_0x4a51('0x23')]('Content-Range',_0x37efdf+'-'+_0x12f2b4+'/'+_0x517375)[_0x4a51('0x1e')](_0x157e33);}return null;};}function patchUpdates(_0x1095ff){return function(_0x41228f){try{jsonpatch[_0x4a51('0x24')](_0x41228f,_0x1095ff,!![]);}catch(_0x8d6a99){return BPromise[_0x4a51('0x25')](_0x8d6a99);}return _0x41228f[_0x4a51('0x26')]();};}function saveUpdates(_0x327005,_0x2acc49){return function(_0x353c24){if(_0x353c24){return _0x353c24[_0x4a51('0x27')](_0x327005)[_0x4a51('0x28')](function(_0x31bbc6){return _0x31bbc6;});}return null;};}function removeEntity(_0x5474d2,_0x24c939){return function(_0x5057ef){if(_0x5057ef){return _0x5057ef[_0x4a51('0x29')]()[_0x4a51('0x28')](function(){var _0xd153c6=_0x5057ef['get']({'plain':!![]});var _0xe0d391=_0x4a51('0x2a');return db[_0x4a51('0x2b')][_0x4a51('0x29')]({'where':{'type':_0xe0d391,'resourceId':_0xd153c6['id']}})['then'](function(){return _0x5057ef;});})[_0x4a51('0x28')](function(){_0x5474d2[_0x4a51('0x1c')](0xcc)[_0x4a51('0x1d')]();});}};}function handleEntityNotFound(_0x3cd5dd,_0x20506f){return function(_0x495213){if(!_0x495213){_0x3cd5dd[_0x4a51('0x1b')](0x194);}return _0x495213;};}function handleError(_0x3b5405,_0x50da1e){_0x50da1e=_0x50da1e||0x1f4;return function(_0x3c661d){logger[_0x4a51('0x2c')](_0x3c661d['stack']);if(_0x3c661d[_0x4a51('0x2d')]){delete _0x3c661d[_0x4a51('0x2d')];}_0x3b5405[_0x4a51('0x1c')](_0x50da1e)[_0x4a51('0x2e')](_0x3c661d);};}exports[_0x4a51('0x2f')]=function(_0xbf02e7,_0x221ac1){var _0x1ed0fc={},_0x3cd4aa={},_0x1ee658={'count':0x0,'rows':[]};var _0x5cd56e=_[_0x4a51('0x30')](db['Pause'][_0x4a51('0x31')],function(_0x589b52){return{'name':_0x589b52['fieldName'],'type':_0x589b52['type']['key']};});_0x3cd4aa[_0x4a51('0x32')]=_[_0x4a51('0x30')](_0x5cd56e,_0x4a51('0x2d'));_0x3cd4aa[_0x4a51('0x33')]=_[_0x4a51('0x34')](_0xbf02e7[_0x4a51('0x33')]);_0x3cd4aa[_0x4a51('0x35')]=_[_0x4a51('0x36')](_0x3cd4aa[_0x4a51('0x32')],_0x3cd4aa['query']);_0x1ed0fc['attributes']=_[_0x4a51('0x36')](_0x3cd4aa[_0x4a51('0x32')],qs[_0x4a51('0x37')](_0xbf02e7['query'][_0x4a51('0x37')]));_0x1ed0fc['attributes']=_0x1ed0fc[_0x4a51('0x38')][_0x4a51('0x39')]?_0x1ed0fc['attributes']:_0x3cd4aa[_0x4a51('0x32')];if(!_0xbf02e7[_0x4a51('0x33')]['hasOwnProperty'](_0x4a51('0x3a'))){_0x1ed0fc[_0x4a51('0x20')]=qs[_0x4a51('0x20')](_0xbf02e7[_0x4a51('0x33')]['limit']);_0x1ed0fc[_0x4a51('0x22')]=qs[_0x4a51('0x22')](_0xbf02e7[_0x4a51('0x33')][_0x4a51('0x22')]);}_0x1ed0fc['order']=qs[_0x4a51('0x3b')](_0xbf02e7[_0x4a51('0x33')]['sort']);_0x1ed0fc['where']=qs[_0x4a51('0x35')](_[_0x4a51('0x3c')](_0xbf02e7['query'],_0x3cd4aa[_0x4a51('0x35')]),_0x5cd56e);if(_0xbf02e7[_0x4a51('0x33')][_0x4a51('0x3d')]){_0x1ed0fc[_0x4a51('0x3e')]=_[_0x4a51('0x3f')](_0x1ed0fc['where'],{'$or':_[_0x4a51('0x30')](_0x5cd56e,function(_0x4e2c2b){if(_0x4e2c2b[_0x4a51('0x40')]!==_0x4a51('0x41')){var _0x44914b={};_0x44914b[_0x4e2c2b[_0x4a51('0x2d')]]={'$like':'%'+_0xbf02e7[_0x4a51('0x33')][_0x4a51('0x3d')]+'%'};return _0x44914b;}})});}_0x1ed0fc=_[_0x4a51('0x3f')]({},_0x1ed0fc,_0xbf02e7[_0x4a51('0x42')]);var _0x16ce17={'where':_0x1ed0fc[_0x4a51('0x3e')]};return db['Pause'][_0x4a51('0x21')](_0x16ce17)[_0x4a51('0x28')](function(_0x218fdf){_0x1ee658[_0x4a51('0x21')]=_0x218fdf;if(_0xbf02e7[_0x4a51('0x33')]['includeAll']){_0x1ed0fc[_0x4a51('0x43')]=[{'all':!![]}];}return db['Pause'][_0x4a51('0x44')](_0x1ed0fc);})['then'](function(_0x178a43){_0x1ee658[_0x4a51('0x45')]=_0x178a43;return _0x1ee658;})[_0x4a51('0x28')](respondWithFilteredResult(_0x221ac1,_0x1ed0fc))[_0x4a51('0x46')](handleError(_0x221ac1,null));};exports[_0x4a51('0x47')]=function(_0x102c3e,_0xa91fdf){var _0xe840ba={'raw':!![],'where':{'id':_0x102c3e[_0x4a51('0x48')]['id']}},_0x4fd662={};_0x4fd662[_0x4a51('0x32')]=_[_0x4a51('0x34')](db['Pause'][_0x4a51('0x31')]);_0x4fd662[_0x4a51('0x33')]=_[_0x4a51('0x34')](_0x102c3e['query']);_0x4fd662[_0x4a51('0x35')]=_[_0x4a51('0x36')](_0x4fd662['model'],_0x4fd662[_0x4a51('0x33')]);_0xe840ba['attributes']=_[_0x4a51('0x36')](_0x4fd662['model'],qs[_0x4a51('0x37')](_0x102c3e[_0x4a51('0x33')][_0x4a51('0x37')]));_0xe840ba[_0x4a51('0x38')]=_0xe840ba['attributes'][_0x4a51('0x39')]?_0xe840ba['attributes']:_0x4fd662[_0x4a51('0x32')];if(_0x102c3e['query'][_0x4a51('0x49')]){_0xe840ba['include']=[{'all':!![]}];}_0xe840ba=_[_0x4a51('0x3f')]({},_0xe840ba,_0x102c3e[_0x4a51('0x42')]);return db['Pause']['find'](_0xe840ba)[_0x4a51('0x28')](handleEntityNotFound(_0xa91fdf,null))[_0x4a51('0x28')](respondWithResult(_0xa91fdf,null))['catch'](handleError(_0xa91fdf,null));};exports[_0x4a51('0x4a')]=function(_0x129cd9,_0x2a02fd){return db[_0x4a51('0x4b')][_0x4a51('0x4a')](_0x129cd9['body'],{})['then'](function(_0x355d2b){var _0x145f23=_0x129cd9['user'][_0x4a51('0x4c')]({'plain':!![]});if(!_0x145f23)throw new Error(_0x4a51('0x4d'));if(_0x145f23[_0x4a51('0x4e')]===_0x4a51('0x4f')){var _0x36ef41=_0x355d2b['get']({'plain':!![]});var _0x201703='Pauses';return db[_0x4a51('0x50')][_0x4a51('0x51')]({'where':{'name':_0x201703,'userProfileId':_0x145f23[_0x4a51('0x52')]},'raw':!![]})['then'](function(_0x302699){if(_0x302699&&_0x302699['autoAssociation']===0x0){return db[_0x4a51('0x2b')][_0x4a51('0x4a')]({'name':_0x36ef41[_0x4a51('0x2d')],'resourceId':_0x36ef41['id'],'type':_0x302699['name'],'sectionId':_0x302699['id']},{})['then'](function(){return _0x355d2b;});}else{return _0x355d2b;}})[_0x4a51('0x46')](function(_0x586bb3){logger[_0x4a51('0x2c')](_0x4a51('0x53'),_0x586bb3);throw _0x586bb3;});}return _0x355d2b;})[_0x4a51('0x28')](respondWithResult(_0x2a02fd,0xc9))['catch'](handleError(_0x2a02fd,null));};exports['update']=function(_0xf4fc2f,_0x49be1b){if(_0xf4fc2f[_0x4a51('0x54')]['id']){delete _0xf4fc2f['body']['id'];}return db[_0x4a51('0x4b')][_0x4a51('0x51')]({'where':{'id':_0xf4fc2f[_0x4a51('0x48')]['id']}})['then'](handleEntityNotFound(_0x49be1b,null))[_0x4a51('0x28')](saveUpdates(_0xf4fc2f[_0x4a51('0x54')],null))[_0x4a51('0x28')](respondWithResult(_0x49be1b,null))[_0x4a51('0x46')](handleError(_0x49be1b,null));};exports[_0x4a51('0x29')]=function(_0x3119c1,_0x36af9a){return db[_0x4a51('0x4b')][_0x4a51('0x51')]({'where':{'id':_0x3119c1[_0x4a51('0x48')]['id']}})[_0x4a51('0x28')](handleEntityNotFound(_0x36af9a,null))[_0x4a51('0x28')](removeEntity(_0x36af9a,null))[_0x4a51('0x46')](handleError(_0x36af9a,null));};
\ No newline at end of file
index 7eb3afc..3d56aca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x22e627,_0xc8ed07){var _0x810052=function(_0x7d2d98){while(--_0x7d2d98){_0x22e627['push'](_0x22e627['shift']());}};_0x810052(++_0xc8ed07);}(_0x326f,0xd1));var _0xf326=function(_0x4ea627,_0xe8b00e){_0x4ea627=_0x4ea627-0x0;var _0x597da1=_0x326f[_0x4ea627];return _0x597da1;};'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 62cc541..8319789 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x57db6d,_0x246461){var _0x4ac77e=function(_0x4ce5e4){while(--_0x4ce5e4){_0x57db6d['push'](_0x57db6d['shift']());}};_0x4ac77e(++_0x246461);}(_0x7a54,0x106));var _0x47a5=function(_0x1d8b7c,_0x381689){_0x1d8b7c=_0x1d8b7c-0x0;var _0x41e1f1=_0x7a54[_0x1d8b7c];return _0x41e1f1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x57a6d2,_0x135cec){var _0x9bb458=function(_0x9a34){while(--_0x9a34){_0x57a6d2['push'](_0x57a6d2['shift']());}};_0x9bb458(++_0x135cec);}(_0xb10b,0x12a));var _0xbb10=function(_0x25a233,_0x1402dd){_0x25a233=_0x25a233-0x0;var _0x48ed17=_0xb10b[_0x25a233];return _0x48ed17;};'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 a5298d0..72b4cf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['single','upload','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','post'];(function(_0x5095df,_0x5723b1){var _0x17c915=function(_0x5079bf){while(--_0x5079bf){_0x5095df['push'](_0x5095df['shift']());}};_0x17c915(++_0x5723b1);}(_0x17ba,0xab));var _0xa17b=function(_0xb4c871,_0x37d21b){_0xb4c871=_0xb4c871-0x0;var _0x4fb6bc=_0x17ba[_0xb4c871];return _0x4fb6bc;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0xa')]('/:id/download',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);var upload=multer({'storage':multer[_0xa17b('0x12')]({'destination':function(_0x1e799a,_0x140943,_0x4382df){_0x4382df(null,path[_0xa17b('0x13')](config['root'],_0xa17b('0x14')));},'filename':function(_0x3e92e4,_0x3c3a8a,_0x52b7aa){_0x3c3a8a[_0xa17b('0x15')]=_0x3c3a8a[_0xa17b('0x15')][_0xa17b('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7aa(null,util[_0xa17b('0x17')]('%s-%s%s',path[_0xa17b('0x18')](_0x3c3a8a['originalname'],path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])),Date['now'](),path[_0xa17b('0x19')](_0x3c3a8a[_0xa17b('0x15')])));}})});router[_0xa17b('0x1a')]('/',upload[_0xa17b('0x1b')]('file'),controller[_0xa17b('0x1c')]);router['post']('/webhook',controller['webhookPost']);router[_0xa17b('0x1d')](_0xa17b('0xf'),auth['isAuthenticated'](),controller[_0xa17b('0x1e')]);router[_0xa17b('0x1f')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x1f')]);module[_0xa17b('0x20')]=router;
\ No newline at end of file
+var _0x6737=['diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','upload','webhookPost','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','index','/:id','show','get','download'];(function(_0x2f6414,_0x234c03){var _0x14d158=function(_0x419a02){while(--_0x419a02){_0x2f6414['push'](_0x2f6414['shift']());}};_0x14d158(++_0x234c03);}(_0x6737,0xe2));var _0x7673=function(_0x39595f,_0x55bd3a){_0x39595f=_0x39595f-0x0;var _0x5b190a=_0x6737[_0x39595f];return _0x5b190a;};'use strict';var multer=require('multer');var util=require(_0x7673('0x0'));var path=require(_0x7673('0x1'));var timeout=require('connect-timeout');var express=require(_0x7673('0x2'));var router=express[_0x7673('0x3')]();var fs_extra=require(_0x7673('0x4'));var auth=require(_0x7673('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7673('0x6'));var controller=require(_0x7673('0x7'));router['get']('/',auth[_0x7673('0x8')](),controller[_0x7673('0x9')]);router['get']('/webhook',controller['webhookGet']);router['get'](_0x7673('0xa'),auth['isAuthenticated'](),controller[_0x7673('0xb')]);router[_0x7673('0xc')]('/:id/download',auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);var upload=multer({'storage':multer[_0x7673('0xe')]({'destination':function(_0x4d40ce,_0x49fcb2,_0x3ca258){_0x3ca258(null,path['join'](config[_0x7673('0xf')],_0x7673('0x10')));},'filename':function(_0x38090f,_0x451c87,_0x41d6bd){_0x451c87[_0x7673('0x11')]=_0x451c87[_0x7673('0x11')][_0x7673('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41d6bd(null,util[_0x7673('0x13')](_0x7673('0x14'),path['basename'](_0x451c87[_0x7673('0x11')],path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])),Date[_0x7673('0x16')](),path[_0x7673('0x15')](_0x451c87[_0x7673('0x11')])));}})});router[_0x7673('0x17')]('/',upload['single']('file'),controller[_0x7673('0x18')]);router[_0x7673('0x17')]('/webhook',controller[_0x7673('0x19')]);router[_0x7673('0x1a')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0x1b')]);router[_0x7673('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0x1c')]);module[_0x7673('0x1d')]=router;
\ No newline at end of file
index 15b05e2..e19e415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb89b=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','always'];(function(_0x5b61b9,_0x2d513c){var _0x18b6b1=function(_0x53b601){while(--_0x53b601){_0x5b61b9['push'](_0x5b61b9['shift']());}};_0x18b6b1(++_0x2d513c);}(_0xb89b,0x7a));var _0xbb89=function(_0x13a8cc,_0x45b4fc){_0x13a8cc=_0x13a8cc-0x0;var _0x31b53c=_0xb89b[_0x13a8cc];return _0x31b53c;};'use strict';var Sequelize=require('sequelize');module[_0xbb89('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbb89('0x1')](_0xbb89('0x2'),_0xbb89('0x3'))},'description':{'type':Sequelize[_0xbb89('0x4')]},'version':{'type':Sequelize[_0xbb89('0x4')]},'path':{'type':Sequelize[_0xbb89('0x5')],'comment':_0xbb89('0x6')},'active':{'type':Sequelize[_0xbb89('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xbb89('0x8'),'agentOnly',_0xbb89('0x9'),_0xbb89('0xa')),'defaultValue':_0xbb89('0x9'),'comment':_0xbb89('0xb')},'icon':{'type':Sequelize[_0xbb89('0x5')]},'adminUrl':{'type':Sequelize[_0xbb89('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xbb89('0x5')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x12bd=['html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','sequelize','exports','ENUM'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x12bd,0xcf));var _0xd12b=function(_0x189d12,_0x17aafc){_0x189d12=_0x189d12-0x0;var _0x39b0ad=_0x12bd[_0x189d12];return _0x39b0ad;};'use strict';var Sequelize=require(_0xd12b('0x0'));module[_0xd12b('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd12b('0x2')](_0xd12b('0x3'),_0xd12b('0x4'))},'description':{'type':Sequelize[_0xd12b('0x5')]},'version':{'type':Sequelize[_0xd12b('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0xd12b('0x6')},'active':{'type':Sequelize[_0xd12b('0x7')],'defaultValue':0x0,'comment':_0xd12b('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0xd12b('0x9'),_0xd12b('0xa'),_0xd12b('0xb'),_0xd12b('0xc')),'defaultValue':_0xd12b('0xb'),'comment':_0xd12b('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xd12b('0xe')]},'scriptName':{'type':Sequelize[_0xd12b('0xe')]},'scriptPath':{'type':Sequelize[_0xd12b('0xe')]}};
\ No newline at end of file
index af39ad8..4294f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d4f=['info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','plugins','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','Plugin','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin'];(function(_0x5426e2,_0x5f2968){var _0x920dc=function(_0x3a87c6){while(--_0x3a87c6){_0x5426e2['push'](_0x5426e2['shift']());}};_0x920dc(++_0x5f2968);}(_0x1d4f,0xef));var _0xf1d4=function(_0x577a70,_0x5cf7c0){_0x577a70=_0x577a70-0x0;var _0x1ed230=_0x1d4f[_0x577a70];return _0x1ed230;};'use strict';var emlformat=require(_0xf1d4('0x0'));var rimraf=require(_0xf1d4('0x1'));var zipdir=require(_0xf1d4('0x2'));var jsonpatch=require(_0xf1d4('0x3'));var rp=require(_0xf1d4('0x4'));var moment=require(_0xf1d4('0x5'));var BPromise=require(_0xf1d4('0x6'));var Mustache=require('mustache');var util=require(_0xf1d4('0x7'));var path=require(_0xf1d4('0x8'));var sox=require('sox');var csv=require(_0xf1d4('0x9'));var ejs=require(_0xf1d4('0xa'));var fs=require('fs');var fs_extra=require(_0xf1d4('0xb'));var _=require(_0xf1d4('0xc'));var squel=require(_0xf1d4('0xd'));var crypto=require(_0xf1d4('0xe'));var jsforce=require(_0xf1d4('0xf'));var deskjs=require(_0xf1d4('0x10'));var toCsv=require(_0xf1d4('0x9'));var querystring=require(_0xf1d4('0x11'));var Papa=require(_0xf1d4('0x12'));var extract=require(_0xf1d4('0x13'));var rimraf=require(_0xf1d4('0x1'));var archiver=require(_0xf1d4('0x14'));var Redis=require(_0xf1d4('0x15'));var authService=require(_0xf1d4('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0xf1d4('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d4('0x18'))(_0xf1d4('0x19'));var utils=require('../../config/utils');var config=require(_0xf1d4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1d4('0x1b'))['db'];config[_0xf1d4('0x1c')]=_[_0xf1d4('0x1d')](config[_0xf1d4('0x1c')],{'host':_0xf1d4('0x1e'),'port':0x18eb});var socket=require(_0xf1d4('0x1f'))(new Redis(config[_0xf1d4('0x1c')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x4491a0,_0x30dba6){_0x30dba6=_0x30dba6||0xcc;return function(_0xaa88ad){if(_0xaa88ad){return _0x4491a0['sendStatus'](_0x30dba6);}return _0x4491a0[_0xf1d4('0x20')](_0x30dba6)[_0xf1d4('0x21')]();};}function respondWithResult(_0xca0505,_0x3969d8){_0x3969d8=_0x3969d8||0xc8;return function(_0x355b07){if(_0x355b07){return _0xca0505[_0xf1d4('0x20')](_0x3969d8)[_0xf1d4('0x22')](_0x355b07);}};}function respondWithFilteredResult(_0x55224d,_0x16e8b0){return function(_0x57ab88){if(_0x57ab88){var _0x560a58=typeof _0x16e8b0[_0xf1d4('0x23')]===_0xf1d4('0x24')&&typeof _0x16e8b0[_0xf1d4('0x25')]===_0xf1d4('0x24');var _0x4ff53a=_0x57ab88[_0xf1d4('0x26')];var _0x455c76=_0x560a58?0x0:_0x16e8b0[_0xf1d4('0x23')];var _0xdc76a2=_0x560a58?_0x57ab88[_0xf1d4('0x26')]:_0x16e8b0['offset']+_0x16e8b0[_0xf1d4('0x25')];var _0x33f3ad;if(_0xdc76a2>=_0x4ff53a){_0xdc76a2=_0x4ff53a;_0x33f3ad=0xc8;}else{_0x33f3ad=0xce;}_0x55224d[_0xf1d4('0x20')](_0x33f3ad);return _0x55224d[_0xf1d4('0x27')](_0xf1d4('0x28'),_0x455c76+'-'+_0xdc76a2+'/'+_0x4ff53a)[_0xf1d4('0x22')](_0x57ab88);}return null;};}function patchUpdates(_0x4c99b6){return function(_0x41d3c0){try{jsonpatch[_0xf1d4('0x29')](_0x41d3c0,_0x4c99b6,!![]);}catch(_0x328f50){return BPromise[_0xf1d4('0x2a')](_0x328f50);}return _0x41d3c0[_0xf1d4('0x2b')]();};}function saveUpdates(_0x2e21ca,_0x3d75bd){return function(_0x22a232){if(_0x22a232){return _0x22a232[_0xf1d4('0x2c')](_0x2e21ca)[_0xf1d4('0x2d')](function(_0x498873){return _0x498873;});}return null;};}function removeEntity(_0x1158a2,_0x43c849){return function(_0x1b7bfe){if(_0x1b7bfe){return _0x1b7bfe[_0xf1d4('0x2e')]()[_0xf1d4('0x2d')](function(){var _0x4ca795=_0x1b7bfe[_0xf1d4('0x2f')]({'plain':!![]});var _0x278690=_0xf1d4('0x30');return db[_0xf1d4('0x31')][_0xf1d4('0x2e')]({'where':{'type':_0x278690,'resourceId':_0x4ca795['id']}})[_0xf1d4('0x2d')](function(){return _0x1b7bfe;});})[_0xf1d4('0x2d')](function(){_0x1158a2[_0xf1d4('0x20')](0xcc)[_0xf1d4('0x21')]();});}};}function handleEntityNotFound(_0x588b5c,_0x501c24){return function(_0x1e6b17){if(!_0x1e6b17){_0x588b5c[_0xf1d4('0x32')](0x194);}return _0x1e6b17;};}function handleError(_0xccdb0b,_0x53700c){_0x53700c=_0x53700c||0x1f4;return function(_0x54c6c8){logger[_0xf1d4('0x33')](_0x54c6c8[_0xf1d4('0x34')]);if(_0x54c6c8[_0xf1d4('0x35')]){delete _0x54c6c8[_0xf1d4('0x35')];}_0xccdb0b[_0xf1d4('0x20')](_0x53700c)[_0xf1d4('0x36')](_0x54c6c8);};}exports['index']=function(_0x3700d8,_0x3efdb9){var _0x20724e={},_0x557c15={},_0x3f511a={'count':0x0,'rows':[]};var _0x4b20aa=_['map'](db[_0xf1d4('0x37')][_0xf1d4('0x38')],function(_0x2a4b97){return{'name':_0x2a4b97[_0xf1d4('0x39')],'type':_0x2a4b97[_0xf1d4('0x3a')]['key']};});_0x557c15[_0xf1d4('0x3b')]=_[_0xf1d4('0x3c')](_0x4b20aa,_0xf1d4('0x35'));_0x557c15[_0xf1d4('0x3d')]=_[_0xf1d4('0x3e')](_0x3700d8[_0xf1d4('0x3d')]);_0x557c15['filters']=_[_0xf1d4('0x3f')](_0x557c15['model'],_0x557c15[_0xf1d4('0x3d')]);_0x20724e[_0xf1d4('0x40')]=_[_0xf1d4('0x3f')](_0x557c15[_0xf1d4('0x3b')],qs['fields'](_0x3700d8['query'][_0xf1d4('0x41')]));_0x20724e[_0xf1d4('0x40')]=_0x20724e[_0xf1d4('0x40')][_0xf1d4('0x42')]?_0x20724e[_0xf1d4('0x40')]:_0x557c15[_0xf1d4('0x3b')];if(!_0x3700d8[_0xf1d4('0x3d')][_0xf1d4('0x43')](_0xf1d4('0x44'))){_0x20724e[_0xf1d4('0x25')]=qs['limit'](_0x3700d8[_0xf1d4('0x3d')]['limit']);_0x20724e['offset']=qs[_0xf1d4('0x23')](_0x3700d8['query'][_0xf1d4('0x23')]);}_0x20724e[_0xf1d4('0x45')]=qs['sort'](_0x3700d8[_0xf1d4('0x3d')][_0xf1d4('0x46')]);_0x20724e['where']=qs[_0xf1d4('0x47')](_[_0xf1d4('0x48')](_0x3700d8[_0xf1d4('0x3d')],_0x557c15[_0xf1d4('0x47')]),_0x4b20aa);if(_0x3700d8['query'][_0xf1d4('0x49')]){_0x20724e[_0xf1d4('0x4a')]=_[_0xf1d4('0x4b')](_0x20724e[_0xf1d4('0x4a')],{'$or':_[_0xf1d4('0x3c')](_0x4b20aa,function(_0x193412){if(_0x193412[_0xf1d4('0x3a')]!==_0xf1d4('0x4c')){var _0x2d1c66={};_0x2d1c66[_0x193412[_0xf1d4('0x35')]]={'$like':'%'+_0x3700d8[_0xf1d4('0x3d')][_0xf1d4('0x49')]+'%'};return _0x2d1c66;}})});}_0x20724e=_[_0xf1d4('0x4b')]({},_0x20724e,_0x3700d8['options']);var _0x4bd906={'where':_0x20724e[_0xf1d4('0x4a')]};return db[_0xf1d4('0x37')][_0xf1d4('0x26')](_0x4bd906)[_0xf1d4('0x2d')](function(_0x4ea6de){_0x3f511a[_0xf1d4('0x26')]=_0x4ea6de;if(_0x3700d8[_0xf1d4('0x3d')][_0xf1d4('0x4d')]){_0x20724e['include']=[{'all':!![]}];}return db[_0xf1d4('0x37')][_0xf1d4('0x4e')](_0x20724e);})[_0xf1d4('0x2d')](function(_0x432c68){_0x3f511a['rows']=_0x432c68;return _0x3f511a;})[_0xf1d4('0x2d')](respondWithFilteredResult(_0x3efdb9,_0x20724e))[_0xf1d4('0x4f')](handleError(_0x3efdb9,null));};exports[_0xf1d4('0x50')]=function(_0x1461e2,_0x4f7ebe){var _0x1d0e2e={'raw':!![],'where':{'id':_0x1461e2[_0xf1d4('0x51')]['id']}},_0x7615aa={};_0x7615aa['model']=_[_0xf1d4('0x3e')](db[_0xf1d4('0x37')]['rawAttributes']);_0x7615aa[_0xf1d4('0x3d')]=_['keys'](_0x1461e2['query']);_0x7615aa[_0xf1d4('0x47')]=_['intersection'](_0x7615aa['model'],_0x7615aa[_0xf1d4('0x3d')]);_0x1d0e2e['attributes']=_[_0xf1d4('0x3f')](_0x7615aa['model'],qs[_0xf1d4('0x41')](_0x1461e2[_0xf1d4('0x3d')]['fields']));_0x1d0e2e[_0xf1d4('0x40')]=_0x1d0e2e[_0xf1d4('0x40')][_0xf1d4('0x42')]?_0x1d0e2e[_0xf1d4('0x40')]:_0x7615aa['model'];if(_0x1461e2[_0xf1d4('0x3d')]['includeAll']){_0x1d0e2e[_0xf1d4('0x52')]=[{'all':!![]}];}_0x1d0e2e=_['merge']({},_0x1d0e2e,_0x1461e2[_0xf1d4('0x53')]);return db[_0xf1d4('0x37')][_0xf1d4('0x54')](_0x1d0e2e)[_0xf1d4('0x2d')](handleEntityNotFound(_0x4f7ebe,null))['then'](respondWithResult(_0x4f7ebe,null))[_0xf1d4('0x4f')](handleError(_0x4f7ebe,null));};exports[_0xf1d4('0x55')]=function(_0x4a8812,_0x5aa239,_0x1b7dd3){return db['Plugin'][_0xf1d4('0x54')]({'where':{'id':_0x4a8812[_0xf1d4('0x51')]['id']},'attributes':[_0xf1d4('0x35'),_0xf1d4('0x8')],'raw':!![]})[_0xf1d4('0x2d')](handleEntityNotFound(_0x5aa239,null))['then'](function(_0x16ec81){if(_0x16ec81){var _0x20ee56=path[_0xf1d4('0x56')](config[_0xf1d4('0x57')],_0xf1d4('0x58'),util[_0xf1d4('0x59')](_0xf1d4('0x5a'),path[_0xf1d4('0x5b')](_0x16ec81[_0xf1d4('0x8')])));var _0xebdeee=fs[_0xf1d4('0x5c')](_0x20ee56);var _0x5e359c=archiver(_0xf1d4('0x5d'),{'zlib':{'level':0x9}});_0x5e359c['on'](_0xf1d4('0x5e'),function(_0x19c706){if(_0x19c706[_0xf1d4('0x5f')]===_0xf1d4('0x60')){logger[_0xf1d4('0x33')](_0x19c706);}else{throw new db[(_0xf1d4('0x61'))][(_0xf1d4('0x62'))](_0xf1d4('0x63'));}});_0x5e359c['on']('error',function(_0x30c2a4){throw new db[(_0xf1d4('0x61'))][(_0xf1d4('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5e359c[_0xf1d4('0x64')](_0xebdeee);_0x5e359c[_0xf1d4('0x65')]('**/*',{'cwd':path[_0xf1d4('0x56')](config[_0xf1d4('0x57')],_0xf1d4('0x58'),path[_0xf1d4('0x66')](_0x16ec81[_0xf1d4('0x8')])),'ignore':[path['join'](path[_0xf1d4('0x5b')](_0x16ec81[_0xf1d4('0x8')]),'node_modules/**/*'),path[_0xf1d4('0x56')](path['basename'](_0x16ec81[_0xf1d4('0x8')]),_0xf1d4('0x67'))],'nodir':!![]})[_0xf1d4('0x68')]();_0xebdeee['on'](_0xf1d4('0x69'),function(){if(!fs[_0xf1d4('0x6a')](_0x20ee56)){throw new db[(_0xf1d4('0x61'))]['Error'](_0xf1d4('0x6b'));}return _0x5aa239[_0xf1d4('0x55')](_0x20ee56,util['format']('%s.zip',path[_0xf1d4('0x5b')](_0x16ec81['path'])),function(_0x1ff2cf){if(_0x1ff2cf){throw new db[(_0xf1d4('0x61'))][(_0xf1d4('0x62'))](_0xf1d4('0x6c'));}fs['unlinkSync'](_0x20ee56);logger[_0xf1d4('0x6d')](_0xf1d4('0x6e'));logger['info'](_0xf1d4('0x6f'));});});}return null;})[_0xf1d4('0x4f')](handleError(_0x5aa239,null));};exports[_0xf1d4('0x70')]=function(_0x25ab9b,_0x1d11c4,_0x2dd32c){var _0x232089=path[_0xf1d4('0x5b')](_0x25ab9b[_0xf1d4('0x71')][_0xf1d4('0x72')],path['extname'](_0x25ab9b['file']['filename']));var _0x453d1e=path[_0xf1d4('0x56')](config[_0xf1d4('0x57')],_0xf1d4('0x58'),_0x25ab9b[_0xf1d4('0x71')]['filename']);var _0x58ef97=path[_0xf1d4('0x56')](config[_0xf1d4('0x57')],_0xf1d4('0x58'),_0x232089);logger[_0xf1d4('0x6d')]('Plugin\x20upload\x20filepath:\x20%s',_0x453d1e);logger[_0xf1d4('0x6d')]('Plugin\x20upload\x20destination:\x20%s',_0x58ef97);try{fs['chmodSync'](_0x453d1e,parseInt(_0xf1d4('0x73'),0x8));extract(_0x453d1e,{'dir':_0x58ef97},function(_0x5381bc){if(_0x5381bc){logger[_0xf1d4('0x33')](_0x5381bc);handleError(_0x5381bc,!![]);};var _0x4705bc=fs[_0xf1d4('0x74')](_0x58ef97);if(_0x4705bc[_0xf1d4('0x42')]>0x1){removeReferences(_0x453d1e,_0x58ef97);logger[_0xf1d4('0x33')](_0xf1d4('0x75'));return _0x2dd32c(new Error('Invalid\x20plugin\x20structure'));}var _0x1ab85e=fs[_0xf1d4('0x76')](path[_0xf1d4('0x56')](_0x58ef97,_0x4705bc[0x0]));if(_0x1ab85e[_0xf1d4('0x77')]()){removeReferences(_0x453d1e,_0x58ef97);logger[_0xf1d4('0x33')](_0xf1d4('0x75'));return _0x2dd32c(new Error(_0xf1d4('0x75')));}if(_0x1ab85e[_0xf1d4('0x78')]()){var _0x5789ff=fs[_0xf1d4('0x74')](path['join'](_0x58ef97,_0x4705bc[0x0]));if(_0x5789ff[_0xf1d4('0x42')]===0x0){removeReferences(_0x453d1e,_0x58ef97);logger[_0xf1d4('0x33')](_0xf1d4('0x75'));return _0x2dd32c(new Error(_0xf1d4('0x75')));}var _0x4aa483=_0x5789ff[_0xf1d4('0x79')](function(_0x15d3b8){return _0x15d3b8===_0xf1d4('0x7a');});if(!_0x4aa483){return _0x2dd32c(new Error('Plugin\x20manifest\x20missing'));}var _0x87b84c=fs[_0xf1d4('0x7b')](path['join'](_0x58ef97,_0x4705bc[0x0],_0xf1d4('0x7a')));var _0x5ba62=JSON['parse'](_0x87b84c);if(_0xf1d4('0x24')==typeof _0x5ba62['name']){return _0x2dd32c(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xf1d4('0x24')==typeof _0x5ba62[_0xf1d4('0x3a')]){return _0x2dd32c(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xf1d4('0x24')==typeof _0x5ba62[_0xf1d4('0x7c')]){return _0x2dd32c(new Error(_0xf1d4('0x7d')));}if('undefined'==typeof _0x5ba62['parameters']){return _0x2dd32c(new Error(_0xf1d4('0x7e')));}if(_0x5ba62['type']===_0xf1d4('0x7f')){if(_0xf1d4('0x24')==typeof _0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')]){return _0x2dd32c(new Error(_0xf1d4('0x82')));}if('undefined'==typeof _0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')][_0xf1d4('0x83')]&&_0xf1d4('0x24')==typeof _0x5ba62['parameters'][_0xf1d4('0x81')][_0xf1d4('0x84')]){return _0x2dd32c(new Error(_0xf1d4('0x85')));}}else if(_0x5ba62[_0xf1d4('0x3a')]==='script'){if('undefined'==typeof _0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x86')]){return _0x2dd32c(new Error(_0xf1d4('0x87')));}if('undefined'==typeof _0x5ba62['parameters'][_0xf1d4('0x88')]){return _0x2dd32c(new Error(_0xf1d4('0x89')));}}else{return _0x2dd32c(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x476011=_0x5ba62['name'];var _0x59faa3=_0x5ba62[_0xf1d4('0x8a')];var _0x5a11e9=_0x5ba62[_0xf1d4('0x3a')];var _0x2051d6=_0x5ba62[_0xf1d4('0x8b')]?_0x5ba62[_0xf1d4('0x8b')]:_0xf1d4('0x8c');var _0x1d7719=_0x5ba62[_0xf1d4('0x8d')]?_0x5ba62[_0xf1d4('0x8d')]:_0xf1d4('0x8e');var _0x19ead1='';var _0x14feec='';var _0x12ae34='';var _0x4d3415='';var _0x318aec=_0x5ba62[_0xf1d4('0x7c')];if(_0x5a11e9==='html'){if(_0xf1d4('0x24')!=typeof _0x5ba62['parameters'][_0xf1d4('0x81')][_0xf1d4('0x83')]){var _0x3880ad=_0x5ba62[_0xf1d4('0x80')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0xf1d4('0x8f')](_0x3880ad)){_0x19ead1=path[_0xf1d4('0x56')]('plugins',_0x232089,_0x4705bc[0x0],_0x3880ad);}else{_0x19ead1=_0x3880ad;}}else{logger[_0xf1d4('0x6d')](_0xf1d4('0x90'));}if('undefined'!=typeof _0x5ba62[_0xf1d4('0x80')]['views']['agent']){var _0x1f0bd4=_0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')][_0xf1d4('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xf1d4('0x8f')](_0x1f0bd4)){_0x14feec=path[_0xf1d4('0x56')]('plugins',_0x232089,_0x4705bc[0x0],_0x1f0bd4);}else{_0x14feec=_0x1f0bd4;}}else{logger['info'](_0xf1d4('0x91'));}}else if(_0x5a11e9===_0xf1d4('0x92')){_0x12ae34=_0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x86')];_0x4d3415=_0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x88')];if('undefined'!=typeof _0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')]){if('undefined'!=typeof _0x5ba62[_0xf1d4('0x80')]['views'][_0xf1d4('0x83')]){var _0x3880ad=_0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')][_0xf1d4('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xf1d4('0x8f')](_0x3880ad)){_0x19ead1=path[_0xf1d4('0x56')](_0xf1d4('0x93'),_0x232089,_0x4705bc[0x0],_0x3880ad);}else{_0x19ead1=_0x3880ad;}}if(_0xf1d4('0x24')!=typeof _0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')][_0xf1d4('0x84')]){var _0x1f0bd4=_0x5ba62[_0xf1d4('0x80')][_0xf1d4('0x81')][_0xf1d4('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xf1d4('0x8f')](_0x1f0bd4)){_0x14feec=path[_0xf1d4('0x56')](_0xf1d4('0x93'),_0x232089,_0x4705bc[0x0],_0x1f0bd4);}else{_0x14feec=_0x1f0bd4;}}}}var _0x537dfc={'name':_0x476011,'description':_0x59faa3,'path':path[_0xf1d4('0x56')](_0x232089,_0x4705bc[0x0]),'type':_0x5a11e9,'sidebar':_0x2051d6,'icon':_0x1d7719,'adminUrl':_0x19ead1,'agentUrl':_0x14feec,'scriptName':_0x12ae34,'scriptPath':_0x4d3415,'version':_0x318aec};removeReferences(_0x453d1e,null);return db['Plugin']['create'](_0x537dfc)['then'](function(_0x6a7892){var _0x3d6a9d={'role':_0x25ab9b[_0xf1d4('0x94')][_0xf1d4('0x95')],'userProfileId':_0x25ab9b[_0xf1d4('0x94')][_0xf1d4('0x96')]};if(!_0x3d6a9d)throw new Error(_0xf1d4('0x97'));if(_0x3d6a9d[_0xf1d4('0x95')]==='user'){var _0x684ea9=_0x6a7892[_0xf1d4('0x2f')]({'plain':!![]});return db[_0xf1d4('0x98')][_0xf1d4('0x54')]({'where':{'name':_0xf1d4('0x30'),'userProfileId':_0x3d6a9d[_0xf1d4('0x96')]},'raw':!![]})['then'](function(_0x5676f3){if(_0x5676f3&&_0x5676f3[_0xf1d4('0x99')]===0x0){return db[_0xf1d4('0x31')][_0xf1d4('0x9a')]({'name':_0x684ea9[_0xf1d4('0x35')],'resourceId':_0x684ea9['id'],'type':_0x5676f3[_0xf1d4('0x35')],'sectionId':_0x5676f3['id']},{})[_0xf1d4('0x2d')](function(){return _0x6a7892;});}else{return _0x6a7892;}})[_0xf1d4('0x4f')](function(_0x4fa76a){logger['error'](_0xf1d4('0x9b'),_0x4fa76a);throw _0x4fa76a;});}return _0x6a7892;})[_0xf1d4('0x2d')](respondWithResult(_0x1d11c4,null))[_0xf1d4('0x4f')](handleError(_0x1d11c4,null));}});}catch(_0x2f2687){_0x1d11c4[_0xf1d4('0x20')](0x1f4)[_0xf1d4('0x36')](_0x2f2687);}};function removeReferences(_0x47b91a,_0x39d676){try{if(_0x47b91a){fs[_0xf1d4('0x9c')](_0x47b91a);logger[_0xf1d4('0x6d')]('Zip\x20archive\x20removed');}if(_0x39d676){rimraf(_0x39d676,function(){});logger[_0xf1d4('0x6d')](_0xf1d4('0x9d'));}}catch(_0x5966c3){logger[_0xf1d4('0x33')](_0x5966c3);}}exports['update']=function(_0x1f4244,_0xf3ebd9,_0x34df28){return db[_0xf1d4('0x37')][_0xf1d4('0x54')]({'where':{'id':_0x1f4244['params']['id']}})[_0xf1d4('0x2d')](handleEntityNotFound(_0xf3ebd9,null))[_0xf1d4('0x2d')](saveUpdates(_0x1f4244['body'],null))[_0xf1d4('0x2d')](respondWithResult(_0xf3ebd9,null))[_0xf1d4('0x4f')](handleError(_0xf3ebd9,null));};exports[_0xf1d4('0x9e')]=function(_0xb90f0f,_0xbc1bb,_0x191c3e){return db[_0xf1d4('0x37')][_0xf1d4('0x54')]({'where':{'id':_0xb90f0f['params']['id']}})['then'](function(_0x22b1ca){if(_0x22b1ca){return _0x22b1ca['destroy']();}})[_0xf1d4('0x2d')](function(_0x4ba92f){rimraf(path[_0xf1d4('0x56')](config[_0xf1d4('0x57')],'server/files/plugins',path[_0xf1d4('0x66')](_0x4ba92f[_0xf1d4('0x8')])),function(){});return _0x4ba92f;})[_0xf1d4('0x2d')](handleEntityNotFound(_0xbc1bb,null))[_0xf1d4('0x2d')](respondWithStatusCode(_0xbc1bb,null))[_0xf1d4('0x4f')](handleError(_0xbc1bb,null));};exports[_0xf1d4('0x9f')]=function(_0x1667f3,_0x529868,_0x1f3dfb){return BPromise['resolve']()['then'](function(){if(!_0x1667f3[_0xf1d4('0x3d')][_0xf1d4('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1667f3[_0xf1d4('0x3d')][_0xf1d4('0xa0')]){throw new Error(_0xf1d4('0xa1'));}var _0x19a7a0=_0x1667f3['query'][_0xf1d4('0xa2')]?_0x1667f3['query'][_0xf1d4('0xa2')]+':'+_0x1667f3[_0xf1d4('0x3d')][_0xf1d4('0xa0')]:_0xf1d4('0xa3')+_0x1667f3[_0xf1d4('0x3d')][_0xf1d4('0xa0')];var _0xaa05f4=_0x1667f3[_0xf1d4('0x3d')][_0xf1d4('0x22')]?_0x1667f3['query'][_0xf1d4('0x22')]:!![];var _0x4e8e1c=_0x1667f3['query']['encoding']?_0x1667f3['query'][_0xf1d4('0xa4')]:null;var _0x5998ec={'method':_0x1667f3[_0xf1d4('0xa5')],'uri':util['format'](_0xf1d4('0xa6'),_0x19a7a0,_0x1667f3[_0xf1d4('0x3d')]['path']),'json':_0xaa05f4,'resolveWithFullResponse':!![],'encoding':_0x4e8e1c,'qs':_0x1667f3[_0xf1d4('0x3d')]};if(_0x1667f3[_0xf1d4('0xa7')]){_0x5998ec[_0xf1d4('0xa7')]=_0x1667f3['headers'];if(_0x5998ec[_0xf1d4('0xa7')][_0xf1d4('0xa8')]){delete _0x5998ec[_0xf1d4('0xa7')][_0xf1d4('0xa8')];}}if(_0x5998ec[_0xf1d4('0xa7')][_0xf1d4('0xa9')]){delete _0x5998ec[_0xf1d4('0xa7')][_0xf1d4('0xa9')];}return rp(_0x5998ec);})[_0xf1d4('0x2d')](function(_0x20874c){if(_0x20874c){_0x529868['set'](_0x20874c[_0xf1d4('0xa7')]);logger[_0xf1d4('0x6d')](_0x20874c[_0xf1d4('0x94')]);if(_['endsWith'](_0x1667f3[_0xf1d4('0x3d')][_0xf1d4('0x8')],_0xf1d4('0x55'))&&_0x20874c[_0xf1d4('0xaa')]==0x1f4){return _0x529868[_0xf1d4('0x32')](_0x20874c[_0xf1d4('0xaa')]);}else{return _0x529868[_0xf1d4('0x20')](_0x20874c['statusCode'])[_0xf1d4('0x36')](_0x20874c[_0xf1d4('0x94')]);}}else{return _0x529868[_0xf1d4('0x32')](0xc8);}})['catch'](handleError(_0x529868,null));};exports[_0xf1d4('0xab')]=function(_0x1bcefb,_0x5251b1,_0x2426fa){return BPromise[_0xf1d4('0xac')]()[_0xf1d4('0x2d')](function(){if(!_0x1bcefb['query'][_0xf1d4('0x8')]){throw new Error(_0xf1d4('0xad'));}if(!_0x1bcefb['query']['port']){throw new Error(_0xf1d4('0xa1'));}var _0x3e146e=_0x1bcefb['query'][_0xf1d4('0xa2')]?_0x1bcefb[_0xf1d4('0x3d')][_0xf1d4('0xa2')]+':'+_0x1bcefb[_0xf1d4('0x3d')]['port']:_0xf1d4('0xa3')+_0x1bcefb[_0xf1d4('0x3d')][_0xf1d4('0xa0')];var _0x148b44=_0x1bcefb[_0xf1d4('0x3d')][_0xf1d4('0x22')]?_0x1bcefb[_0xf1d4('0x3d')][_0xf1d4('0x22')]:!![];var _0x4a7fb2=_0x1bcefb[_0xf1d4('0x3d')][_0xf1d4('0xa4')]?_0x1bcefb['query'][_0xf1d4('0xa4')]:null;var _0x35c761={'method':_0x1bcefb[_0xf1d4('0xa5')],'uri':util[_0xf1d4('0x59')]('%s%s',_0x3e146e,_0x1bcefb[_0xf1d4('0x3d')]['path']),'json':_0x148b44,'resolveWithFullResponse':!![],'encoding':_0x4a7fb2,'body':_0x1bcefb[_0xf1d4('0x94')]};if(_0x1bcefb[_0xf1d4('0xa7')]){_0x35c761['headers']=_0x1bcefb[_0xf1d4('0xa7')];if(_0x35c761[_0xf1d4('0xa7')]['content-length']){delete _0x35c761[_0xf1d4('0xa7')]['content-length'];}}if(_0x35c761['headers'][_0xf1d4('0xa9')]){delete _0x35c761[_0xf1d4('0xa7')]['content-type'];}return rp(_0x35c761);})[_0xf1d4('0x2d')](function(_0x5c468a){if(_0x5c468a){_0x5251b1['set'](_0x5c468a['headers']);logger[_0xf1d4('0x6d')](_0x5c468a[_0xf1d4('0x94')]);return _0x5251b1[_0xf1d4('0x20')](_0x5c468a[_0xf1d4('0xaa')])[_0xf1d4('0x36')](_0x5c468a['body']);}else{return _0x5251b1['sendStatus'](0xc8);}})[_0xf1d4('0x4f')](handleError(_0x5251b1,null));};
\ No newline at end of file
+var _0x7a9a=['catch','download','join','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','root','server/files/plugins','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','file','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','html','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','port','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Plugin','findAll','rows','show','params','includeAll','options','find'];(function(_0x1bdfa6,_0x1f39a6){var _0x254110=function(_0x36915e){while(--_0x36915e){_0x1bdfa6['push'](_0x1bdfa6['shift']());}};_0x254110(++_0x1f39a6);}(_0x7a9a,0x1b3));var _0xa7a9=function(_0x4a8009,_0x447787){_0x4a8009=_0x4a8009-0x0;var _0x1c29d7=_0x7a9a[_0x4a8009];return _0x1c29d7;};'use strict';var emlformat=require(_0xa7a9('0x0'));var rimraf=require(_0xa7a9('0x1'));var zipdir=require(_0xa7a9('0x2'));var jsonpatch=require(_0xa7a9('0x3'));var rp=require('request-promise');var moment=require(_0xa7a9('0x4'));var BPromise=require(_0xa7a9('0x5'));var Mustache=require(_0xa7a9('0x6'));var util=require(_0xa7a9('0x7'));var path=require(_0xa7a9('0x8'));var sox=require('sox');var csv=require(_0xa7a9('0x9'));var ejs=require(_0xa7a9('0xa'));var fs=require('fs');var fs_extra=require(_0xa7a9('0xb'));var _=require(_0xa7a9('0xc'));var squel=require(_0xa7a9('0xd'));var crypto=require(_0xa7a9('0xe'));var jsforce=require(_0xa7a9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa7a9('0x9'));var querystring=require(_0xa7a9('0x10'));var Papa=require(_0xa7a9('0x11'));var extract=require(_0xa7a9('0x12'));var rimraf=require(_0xa7a9('0x1'));var archiver=require(_0xa7a9('0x13'));var Redis=require(_0xa7a9('0x14'));var authService=require(_0xa7a9('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xa7a9('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7a9('0x17'))('api');var utils=require(_0xa7a9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa7a9('0x19'));var db=require(_0xa7a9('0x1a'))['db'];config[_0xa7a9('0x1b')]=_[_0xa7a9('0x1c')](config[_0xa7a9('0x1b')],{'host':_0xa7a9('0x1d'),'port':0x18eb});var socket=require(_0xa7a9('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0xa7a9('0x1f')](socket);function respondWithStatusCode(_0x379d78,_0x34c70f){_0x34c70f=_0x34c70f||0xcc;return function(_0x101c02){if(_0x101c02){return _0x379d78[_0xa7a9('0x20')](_0x34c70f);}return _0x379d78[_0xa7a9('0x21')](_0x34c70f)[_0xa7a9('0x22')]();};}function respondWithResult(_0x26910d,_0x3fb09c){_0x3fb09c=_0x3fb09c||0xc8;return function(_0x2e5300){if(_0x2e5300){return _0x26910d[_0xa7a9('0x21')](_0x3fb09c)[_0xa7a9('0x23')](_0x2e5300);}};}function respondWithFilteredResult(_0x56c819,_0x22d90a){return function(_0x3b9d94){if(_0x3b9d94){var _0x4f02e2=typeof _0x22d90a[_0xa7a9('0x24')]===_0xa7a9('0x25')&&typeof _0x22d90a[_0xa7a9('0x26')]===_0xa7a9('0x25');var _0x575c9a=_0x3b9d94['count'];var _0x4cfa7d=_0x4f02e2?0x0:_0x22d90a[_0xa7a9('0x24')];var _0x1e47cf=_0x4f02e2?_0x3b9d94[_0xa7a9('0x27')]:_0x22d90a[_0xa7a9('0x24')]+_0x22d90a[_0xa7a9('0x26')];var _0x3cc4d1;if(_0x1e47cf>=_0x575c9a){_0x1e47cf=_0x575c9a;_0x3cc4d1=0xc8;}else{_0x3cc4d1=0xce;}_0x56c819[_0xa7a9('0x21')](_0x3cc4d1);return _0x56c819[_0xa7a9('0x28')](_0xa7a9('0x29'),_0x4cfa7d+'-'+_0x1e47cf+'/'+_0x575c9a)['json'](_0x3b9d94);}return null;};}function patchUpdates(_0x472e25){return function(_0x33ac7c){try{jsonpatch[_0xa7a9('0x2a')](_0x33ac7c,_0x472e25,!![]);}catch(_0x204c3f){return BPromise[_0xa7a9('0x2b')](_0x204c3f);}return _0x33ac7c[_0xa7a9('0x2c')]();};}function saveUpdates(_0x3c851f,_0x26b88a){return function(_0x1c90b8){if(_0x1c90b8){return _0x1c90b8[_0xa7a9('0x2d')](_0x3c851f)['then'](function(_0x197822){return _0x197822;});}return null;};}function removeEntity(_0x25b425,_0x4c6513){return function(_0x360436){if(_0x360436){return _0x360436[_0xa7a9('0x2e')]()[_0xa7a9('0x2f')](function(){var _0x2027d3=_0x360436[_0xa7a9('0x30')]({'plain':!![]});var _0x286397=_0xa7a9('0x31');return db[_0xa7a9('0x32')][_0xa7a9('0x2e')]({'where':{'type':_0x286397,'resourceId':_0x2027d3['id']}})[_0xa7a9('0x2f')](function(){return _0x360436;});})['then'](function(){_0x25b425[_0xa7a9('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x254743,_0x389ab4){return function(_0x42a766){if(!_0x42a766){_0x254743['sendStatus'](0x194);}return _0x42a766;};}function handleError(_0x39a9d4,_0x431683){_0x431683=_0x431683||0x1f4;return function(_0x2e8fe0){logger[_0xa7a9('0x33')](_0x2e8fe0[_0xa7a9('0x34')]);if(_0x2e8fe0['name']){delete _0x2e8fe0[_0xa7a9('0x35')];}_0x39a9d4[_0xa7a9('0x21')](_0x431683)['send'](_0x2e8fe0);};}exports[_0xa7a9('0x36')]=function(_0x4d48c9,_0x497979){var _0x56cb28={},_0x3643a1={},_0x5f28e9={'count':0x0,'rows':[]};var _0x21c4cf=_[_0xa7a9('0x37')](db['Plugin'][_0xa7a9('0x38')],function(_0x342aed){return{'name':_0x342aed[_0xa7a9('0x39')],'type':_0x342aed[_0xa7a9('0x3a')][_0xa7a9('0x3b')]};});_0x3643a1['model']=_[_0xa7a9('0x37')](_0x21c4cf,_0xa7a9('0x35'));_0x3643a1[_0xa7a9('0x3c')]=_[_0xa7a9('0x3d')](_0x4d48c9['query']);_0x3643a1[_0xa7a9('0x3e')]=_['intersection'](_0x3643a1[_0xa7a9('0x3f')],_0x3643a1[_0xa7a9('0x3c')]);_0x56cb28[_0xa7a9('0x40')]=_['intersection'](_0x3643a1[_0xa7a9('0x3f')],qs[_0xa7a9('0x41')](_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x41')]));_0x56cb28['attributes']=_0x56cb28[_0xa7a9('0x40')][_0xa7a9('0x42')]?_0x56cb28[_0xa7a9('0x40')]:_0x3643a1['model'];if(!_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x43')](_0xa7a9('0x44'))){_0x56cb28[_0xa7a9('0x26')]=qs[_0xa7a9('0x26')](_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x26')]);_0x56cb28[_0xa7a9('0x24')]=qs['offset'](_0x4d48c9[_0xa7a9('0x3c')]['offset']);}_0x56cb28[_0xa7a9('0x45')]=qs[_0xa7a9('0x46')](_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x46')]);_0x56cb28['where']=qs[_0xa7a9('0x3e')](_[_0xa7a9('0x47')](_0x4d48c9[_0xa7a9('0x3c')],_0x3643a1[_0xa7a9('0x3e')]),_0x21c4cf);if(_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x48')]){_0x56cb28[_0xa7a9('0x49')]=_[_0xa7a9('0x4a')](_0x56cb28[_0xa7a9('0x49')],{'$or':_[_0xa7a9('0x37')](_0x21c4cf,function(_0x5860f4){if(_0x5860f4['type']!==_0xa7a9('0x4b')){var _0x5e28e1={};_0x5e28e1[_0x5860f4[_0xa7a9('0x35')]]={'$like':'%'+_0x4d48c9[_0xa7a9('0x3c')][_0xa7a9('0x48')]+'%'};return _0x5e28e1;}})});}_0x56cb28=_['merge']({},_0x56cb28,_0x4d48c9['options']);var _0x24de45={'where':_0x56cb28[_0xa7a9('0x49')]};return db['Plugin']['count'](_0x24de45)['then'](function(_0x4a3fae){_0x5f28e9[_0xa7a9('0x27')]=_0x4a3fae;if(_0x4d48c9[_0xa7a9('0x3c')]['includeAll']){_0x56cb28['include']=[{'all':!![]}];}return db[_0xa7a9('0x4c')][_0xa7a9('0x4d')](_0x56cb28);})[_0xa7a9('0x2f')](function(_0x5e34eb){_0x5f28e9[_0xa7a9('0x4e')]=_0x5e34eb;return _0x5f28e9;})[_0xa7a9('0x2f')](respondWithFilteredResult(_0x497979,_0x56cb28))['catch'](handleError(_0x497979,null));};exports[_0xa7a9('0x4f')]=function(_0x5ae7a2,_0x5ca49c){var _0x9aef71={'raw':!![],'where':{'id':_0x5ae7a2[_0xa7a9('0x50')]['id']}},_0x54bf8f={};_0x54bf8f[_0xa7a9('0x3f')]=_[_0xa7a9('0x3d')](db['Plugin'][_0xa7a9('0x38')]);_0x54bf8f[_0xa7a9('0x3c')]=_[_0xa7a9('0x3d')](_0x5ae7a2['query']);_0x54bf8f['filters']=_['intersection'](_0x54bf8f['model'],_0x54bf8f['query']);_0x9aef71[_0xa7a9('0x40')]=_['intersection'](_0x54bf8f['model'],qs['fields'](_0x5ae7a2[_0xa7a9('0x3c')][_0xa7a9('0x41')]));_0x9aef71[_0xa7a9('0x40')]=_0x9aef71[_0xa7a9('0x40')][_0xa7a9('0x42')]?_0x9aef71['attributes']:_0x54bf8f[_0xa7a9('0x3f')];if(_0x5ae7a2[_0xa7a9('0x3c')][_0xa7a9('0x51')]){_0x9aef71['include']=[{'all':!![]}];}_0x9aef71=_[_0xa7a9('0x4a')]({},_0x9aef71,_0x5ae7a2[_0xa7a9('0x52')]);return db['Plugin'][_0xa7a9('0x53')](_0x9aef71)[_0xa7a9('0x2f')](handleEntityNotFound(_0x5ca49c,null))[_0xa7a9('0x2f')](respondWithResult(_0x5ca49c,null))[_0xa7a9('0x54')](handleError(_0x5ca49c,null));};exports[_0xa7a9('0x55')]=function(_0x2ab3d3,_0x170c80,_0x4684ac){return db[_0xa7a9('0x4c')][_0xa7a9('0x53')]({'where':{'id':_0x2ab3d3[_0xa7a9('0x50')]['id']},'attributes':[_0xa7a9('0x35'),_0xa7a9('0x8')],'raw':!![]})[_0xa7a9('0x2f')](handleEntityNotFound(_0x170c80,null))[_0xa7a9('0x2f')](function(_0x42d77f){if(_0x42d77f){var _0x153a31=path[_0xa7a9('0x56')](config['root'],'server/files/plugins',util[_0xa7a9('0x57')](_0xa7a9('0x58'),path[_0xa7a9('0x59')](_0x42d77f[_0xa7a9('0x8')])));var _0x22b815=fs[_0xa7a9('0x5a')](_0x153a31);var _0x2cbccc=archiver(_0xa7a9('0x5b'),{'zlib':{'level':0x9}});_0x2cbccc['on'](_0xa7a9('0x5c'),function(_0x3dcc99){if(_0x3dcc99[_0xa7a9('0x5d')]===_0xa7a9('0x5e')){logger[_0xa7a9('0x33')](_0x3dcc99);}else{throw new db['Sequelize'][(_0xa7a9('0x5f'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x2cbccc['on'](_0xa7a9('0x33'),function(_0x317099){throw new db[(_0xa7a9('0x60'))]['Error'](_0xa7a9('0x61'));});_0x2cbccc[_0xa7a9('0x62')](_0x22b815);_0x2cbccc[_0xa7a9('0x63')](_0xa7a9('0x64'),{'cwd':path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],_0xa7a9('0x66'),path[_0xa7a9('0x67')](_0x42d77f[_0xa7a9('0x8')])),'ignore':[path[_0xa7a9('0x56')](path['basename'](_0x42d77f[_0xa7a9('0x8')]),_0xa7a9('0x68')),path[_0xa7a9('0x56')](path[_0xa7a9('0x59')](_0x42d77f[_0xa7a9('0x8')]),_0xa7a9('0x69'))],'nodir':!![]})[_0xa7a9('0x6a')]();_0x22b815['on'](_0xa7a9('0x6b'),function(){if(!fs[_0xa7a9('0x6c')](_0x153a31)){throw new db[(_0xa7a9('0x60'))][(_0xa7a9('0x5f'))](_0xa7a9('0x6d'));}return _0x170c80[_0xa7a9('0x55')](_0x153a31,util[_0xa7a9('0x57')]('%s.zip',path[_0xa7a9('0x59')](_0x42d77f[_0xa7a9('0x8')])),function(_0x4d15d8){if(_0x4d15d8){throw new db['Sequelize'][(_0xa7a9('0x5f'))](_0xa7a9('0x6e'));}fs['unlinkSync'](_0x153a31);logger[_0xa7a9('0x6f')](_0xa7a9('0x70'));logger[_0xa7a9('0x6f')]('Temporary\x20file\x20removed');});});}return null;})[_0xa7a9('0x54')](handleError(_0x170c80,null));};exports[_0xa7a9('0x71')]=function(_0x57eb9a,_0x2da7eb,_0x150726){var _0x4e6b22=path[_0xa7a9('0x59')](_0x57eb9a[_0xa7a9('0x72')]['filename'],path['extname'](_0x57eb9a[_0xa7a9('0x72')][_0xa7a9('0x73')]));var _0x13ff0b=path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],'server/files/plugins',_0x57eb9a[_0xa7a9('0x72')][_0xa7a9('0x73')]);var _0x38c76d=path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],_0xa7a9('0x66'),_0x4e6b22);logger[_0xa7a9('0x6f')]('Plugin\x20upload\x20filepath:\x20%s',_0x13ff0b);logger[_0xa7a9('0x6f')](_0xa7a9('0x74'),_0x38c76d);try{fs[_0xa7a9('0x75')](_0x13ff0b,parseInt(_0xa7a9('0x76'),0x8));extract(_0x13ff0b,{'dir':_0x38c76d},function(_0x1b046c){if(_0x1b046c){logger[_0xa7a9('0x33')](_0x1b046c);handleError(_0x1b046c,!![]);};var _0x1b57fb=fs['readdirSync'](_0x38c76d);if(_0x1b57fb[_0xa7a9('0x42')]>0x1){removeReferences(_0x13ff0b,_0x38c76d);logger[_0xa7a9('0x33')](_0xa7a9('0x77'));return _0x150726(new Error(_0xa7a9('0x77')));}var _0x1e1d95=fs[_0xa7a9('0x78')](path['join'](_0x38c76d,_0x1b57fb[0x0]));if(_0x1e1d95[_0xa7a9('0x79')]()){removeReferences(_0x13ff0b,_0x38c76d);logger[_0xa7a9('0x33')](_0xa7a9('0x77'));return _0x150726(new Error('Invalid\x20plugin\x20structure'));}if(_0x1e1d95[_0xa7a9('0x7a')]()){var _0x4a08e3=fs[_0xa7a9('0x7b')](path[_0xa7a9('0x56')](_0x38c76d,_0x1b57fb[0x0]));if(_0x4a08e3[_0xa7a9('0x42')]===0x0){removeReferences(_0x13ff0b,_0x38c76d);logger['error'](_0xa7a9('0x77'));return _0x150726(new Error('Invalid\x20plugin\x20structure'));}var _0x499f96=_0x4a08e3['some'](function(_0x263f32){return _0x263f32===_0xa7a9('0x7c');});if(!_0x499f96){return _0x150726(new Error('Plugin\x20manifest\x20missing'));}var _0x4bc145=fs['readFileSync'](path['join'](_0x38c76d,_0x1b57fb[0x0],_0xa7a9('0x7c')));var _0x34eb35=JSON['parse'](_0x4bc145);if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x35')]){return _0x150726(new Error(_0xa7a9('0x7d')));}if(_0xa7a9('0x25')==typeof _0x34eb35['type']){return _0x150726(new Error(_0xa7a9('0x7e')));}if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x7f')]){return _0x150726(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x80')]){return _0x150726(new Error(_0xa7a9('0x81')));}if(_0x34eb35[_0xa7a9('0x3a')]==='html'){if(_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')]){return _0x150726(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xa7a9('0x25')==typeof _0x34eb35['parameters'][_0xa7a9('0x82')][_0xa7a9('0x83')]&&_0xa7a9('0x25')==typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')]){return _0x150726(new Error(_0xa7a9('0x85')));}}else if(_0x34eb35['type']===_0xa7a9('0x86')){if('undefined'==typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x87')]){return _0x150726(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xa7a9('0x25')==typeof _0x34eb35['parameters'][_0xa7a9('0x88')]){return _0x150726(new Error(_0xa7a9('0x89')));}}else{return _0x150726(new Error(_0xa7a9('0x8a')));}var _0x1bea7e=_0x34eb35[_0xa7a9('0x35')];var _0x318e99=_0x34eb35[_0xa7a9('0x8b')];var _0x90532d=_0x34eb35['type'];var _0x38a216=_0x34eb35[_0xa7a9('0x8c')]?_0x34eb35[_0xa7a9('0x8c')]:'always';var _0x42a7ee=_0x34eb35[_0xa7a9('0x8d')]?_0x34eb35[_0xa7a9('0x8d')]:_0xa7a9('0x8e');var _0x34da84='';var _0x1d9555='';var _0x343988='';var _0xb6fcde='';var _0x4f392e=_0x34eb35[_0xa7a9('0x7f')];if(_0x90532d===_0xa7a9('0x8f')){if(_0xa7a9('0x25')!=typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x83')]){var _0x461a3b=_0x34eb35['parameters'][_0xa7a9('0x82')][_0xa7a9('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x461a3b)){_0x34da84=path['join'](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x461a3b);}else{_0x34da84=_0x461a3b;}}else{logger['info'](_0xa7a9('0x92'));}if(_0xa7a9('0x25')!=typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')]){var _0x5ef82d=_0x34eb35[_0xa7a9('0x80')]['views'][_0xa7a9('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x5ef82d)){_0x1d9555=path[_0xa7a9('0x56')](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x5ef82d);}else{_0x1d9555=_0x5ef82d;}}else{logger[_0xa7a9('0x6f')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x90532d===_0xa7a9('0x86')){_0x343988=_0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x87')];_0xb6fcde=_0x34eb35[_0xa7a9('0x80')]['scriptPath'];if(_0xa7a9('0x25')!=typeof _0x34eb35['parameters'][_0xa7a9('0x82')]){if(_0xa7a9('0x25')!=typeof _0x34eb35['parameters'][_0xa7a9('0x82')][_0xa7a9('0x83')]){var _0x461a3b=_0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x461a3b)){_0x34da84=path['join'](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x461a3b);}else{_0x34da84=_0x461a3b;}}if(_0xa7a9('0x25')!=typeof _0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')]){var _0x5ef82d=_0x34eb35[_0xa7a9('0x80')][_0xa7a9('0x82')][_0xa7a9('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xa7a9('0x90')](_0x5ef82d)){_0x1d9555=path[_0xa7a9('0x56')](_0xa7a9('0x91'),_0x4e6b22,_0x1b57fb[0x0],_0x5ef82d);}else{_0x1d9555=_0x5ef82d;}}}}var _0x347ce4={'name':_0x1bea7e,'description':_0x318e99,'path':path[_0xa7a9('0x56')](_0x4e6b22,_0x1b57fb[0x0]),'type':_0x90532d,'sidebar':_0x38a216,'icon':_0x42a7ee,'adminUrl':_0x34da84,'agentUrl':_0x1d9555,'scriptName':_0x343988,'scriptPath':_0xb6fcde,'version':_0x4f392e};removeReferences(_0x13ff0b,null);return db[_0xa7a9('0x4c')][_0xa7a9('0x93')](_0x347ce4)[_0xa7a9('0x2f')](function(_0x428a3f){var _0x515488={'role':_0x57eb9a[_0xa7a9('0x94')][_0xa7a9('0x95')],'userProfileId':_0x57eb9a[_0xa7a9('0x94')][_0xa7a9('0x96')]};if(!_0x515488)throw new Error(_0xa7a9('0x97'));if(_0x515488[_0xa7a9('0x95')]==='user'){var _0x4d4861=_0x428a3f[_0xa7a9('0x30')]({'plain':!![]});return db[_0xa7a9('0x98')][_0xa7a9('0x53')]({'where':{'name':_0xa7a9('0x31'),'userProfileId':_0x515488[_0xa7a9('0x96')]},'raw':!![]})[_0xa7a9('0x2f')](function(_0x33033c){if(_0x33033c&&_0x33033c[_0xa7a9('0x99')]===0x0){return db[_0xa7a9('0x32')][_0xa7a9('0x93')]({'name':_0x4d4861[_0xa7a9('0x35')],'resourceId':_0x4d4861['id'],'type':_0x33033c[_0xa7a9('0x35')],'sectionId':_0x33033c['id']},{})[_0xa7a9('0x2f')](function(){return _0x428a3f;});}else{return _0x428a3f;}})[_0xa7a9('0x54')](function(_0x70a01){logger[_0xa7a9('0x33')](_0xa7a9('0x9a'),_0x70a01);throw _0x70a01;});}return _0x428a3f;})['then'](respondWithResult(_0x2da7eb,null))[_0xa7a9('0x54')](handleError(_0x2da7eb,null));}});}catch(_0x33d17a){_0x2da7eb[_0xa7a9('0x21')](0x1f4)[_0xa7a9('0x9b')](_0x33d17a);}};function removeReferences(_0x1224af,_0x19cce0){try{if(_0x1224af){fs[_0xa7a9('0x9c')](_0x1224af);logger['info'](_0xa7a9('0x9d'));}if(_0x19cce0){rimraf(_0x19cce0,function(){});logger[_0xa7a9('0x6f')](_0xa7a9('0x9e'));}}catch(_0x2a42c9){logger['error'](_0x2a42c9);}}exports['update']=function(_0x15bcb9,_0x5edb8c,_0x3aefc0){return db[_0xa7a9('0x4c')][_0xa7a9('0x53')]({'where':{'id':_0x15bcb9[_0xa7a9('0x50')]['id']}})['then'](handleEntityNotFound(_0x5edb8c,null))[_0xa7a9('0x2f')](saveUpdates(_0x15bcb9[_0xa7a9('0x94')],null))[_0xa7a9('0x2f')](respondWithResult(_0x5edb8c,null))[_0xa7a9('0x54')](handleError(_0x5edb8c,null));};exports['delete']=function(_0x1e88a4,_0x334306,_0x1003c5){return db[_0xa7a9('0x4c')][_0xa7a9('0x53')]({'where':{'id':_0x1e88a4['params']['id']}})[_0xa7a9('0x2f')](function(_0x542ef8){if(_0x542ef8){return _0x542ef8['destroy']();}})[_0xa7a9('0x2f')](function(_0x1e5b4a){rimraf(path[_0xa7a9('0x56')](config[_0xa7a9('0x65')],_0xa7a9('0x66'),path[_0xa7a9('0x67')](_0x1e5b4a[_0xa7a9('0x8')])),function(){});return _0x1e5b4a;})[_0xa7a9('0x2f')](handleEntityNotFound(_0x334306,null))['then'](respondWithStatusCode(_0x334306,null))[_0xa7a9('0x54')](handleError(_0x334306,null));};exports[_0xa7a9('0x9f')]=function(_0x509aea,_0x51fbb6,_0xe01440){return BPromise[_0xa7a9('0xa0')]()[_0xa7a9('0x2f')](function(){if(!_0x509aea[_0xa7a9('0x3c')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x509aea[_0xa7a9('0x3c')]['port']){throw new Error(_0xa7a9('0xa1'));}var _0x26c266=_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0xa2')]?_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0xa2')]+':'+_0x509aea[_0xa7a9('0x3c')]['port']:'http://localhost:'+_0x509aea[_0xa7a9('0x3c')]['port'];var _0x5e15ce=_0x509aea[_0xa7a9('0x3c')]['json']?_0x509aea['query']['json']:!![];var _0x11aefa=_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0xa3')]?_0x509aea[_0xa7a9('0x3c')]['encoding']:null;var _0x53b562={'method':_0x509aea[_0xa7a9('0xa4')],'uri':util[_0xa7a9('0x57')]('%s%s',_0x26c266,_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0x8')]),'json':_0x5e15ce,'resolveWithFullResponse':!![],'encoding':_0x11aefa,'qs':_0x509aea['query']};if(_0x509aea[_0xa7a9('0xa5')]){_0x53b562[_0xa7a9('0xa5')]=_0x509aea['headers'];if(_0x53b562[_0xa7a9('0xa5')][_0xa7a9('0xa6')]){delete _0x53b562[_0xa7a9('0xa5')]['content-length'];}}if(_0x53b562[_0xa7a9('0xa5')]['content-type']){delete _0x53b562['headers'][_0xa7a9('0xa7')];}return rp(_0x53b562);})['then'](function(_0xfce715){if(_0xfce715){_0x51fbb6[_0xa7a9('0x28')](_0xfce715[_0xa7a9('0xa5')]);logger[_0xa7a9('0x6f')](_0xfce715['body']);if(_['endsWith'](_0x509aea[_0xa7a9('0x3c')][_0xa7a9('0x8')],'download')&&_0xfce715[_0xa7a9('0xa8')]==0x1f4){return _0x51fbb6[_0xa7a9('0x20')](_0xfce715['statusCode']);}else{return _0x51fbb6[_0xa7a9('0x21')](_0xfce715['statusCode'])[_0xa7a9('0x9b')](_0xfce715['body']);}}else{return _0x51fbb6['sendStatus'](0xc8);}})[_0xa7a9('0x54')](handleError(_0x51fbb6,null));};exports[_0xa7a9('0xa9')]=function(_0x4b50c1,_0x3d96aa,_0x470d96){return BPromise[_0xa7a9('0xa0')]()['then'](function(){if(!_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0x8')]){throw new Error(_0xa7a9('0xaa'));}if(!_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xab')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x426ca5=_0x4b50c1[_0xa7a9('0x3c')]['hostname']?_0x4b50c1[_0xa7a9('0x3c')]['hostname']+':'+_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xab')]:'http://localhost:'+_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xab')];var _0x5ca2e0=_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0x23')]?_0x4b50c1[_0xa7a9('0x3c')]['json']:!![];var _0x5ee8e4=_0x4b50c1[_0xa7a9('0x3c')][_0xa7a9('0xa3')]?_0x4b50c1['query'][_0xa7a9('0xa3')]:null;var _0x5277be={'method':_0x4b50c1[_0xa7a9('0xa4')],'uri':util[_0xa7a9('0x57')](_0xa7a9('0xac'),_0x426ca5,_0x4b50c1[_0xa7a9('0x3c')]['path']),'json':_0x5ca2e0,'resolveWithFullResponse':!![],'encoding':_0x5ee8e4,'body':_0x4b50c1[_0xa7a9('0x94')]};if(_0x4b50c1[_0xa7a9('0xa5')]){_0x5277be['headers']=_0x4b50c1['headers'];if(_0x5277be[_0xa7a9('0xa5')][_0xa7a9('0xa6')]){delete _0x5277be[_0xa7a9('0xa5')][_0xa7a9('0xa6')];}}if(_0x5277be['headers'][_0xa7a9('0xa7')]){delete _0x5277be[_0xa7a9('0xa5')][_0xa7a9('0xa7')];}return rp(_0x5277be);})[_0xa7a9('0x2f')](function(_0x5ba90e){if(_0x5ba90e){_0x3d96aa[_0xa7a9('0x28')](_0x5ba90e[_0xa7a9('0xa5')]);logger['info'](_0x5ba90e[_0xa7a9('0x94')]);return _0x3d96aa[_0xa7a9('0x21')](_0x5ba90e[_0xa7a9('0xa8')])[_0xa7a9('0x9b')](_0x5ba90e[_0xa7a9('0x94')]);}else{return _0x3d96aa[_0xa7a9('0x20')](0xc8);}})['catch'](handleError(_0x3d96aa,null));};
\ No newline at end of file
index ae83396..c1a4adc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dcc=['hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','update','emit'];(function(_0x50146a,_0xdd8c5a){var _0x55462e=function(_0x70fec9){while(--_0x70fec9){_0x50146a['push'](_0x50146a['shift']());}};_0x55462e(++_0xdd8c5a);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x1753ff,_0x5ab3ce){_0x1753ff=_0x1753ff-0x0;var _0xbfb177=_0x1dcc[_0x1753ff];return _0xbfb177;};'use strict';var EventEmitter=require(_0xc1dc('0x0'));var Plugin=require(_0xc1dc('0x1'))['db'][_0xc1dc('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xc1dc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1dc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x20abc9){return function(_0x3eb139,_0x2a8ff9,_0x5deaf7){PluginEvents['emit'](_0x20abc9+':'+_0x3eb139['id'],_0x3eb139);PluginEvents[_0xc1dc('0x5')](_0x20abc9,_0x3eb139);_0x5deaf7(null);};}for(var e in events){if(events[_0xc1dc('0x6')](e)){var event=events[e];Plugin[_0xc1dc('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0x0adf=['Plugin','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3b1f58,_0x2aafa9){var _0x43a091=function(_0xb9c5ff){while(--_0xb9c5ff){_0x3b1f58['push'](_0x3b1f58['shift']());}};_0x43a091(++_0x2aafa9);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x290a8d,_0x3a654e){_0x290a8d=_0x290a8d-0x0;var _0x3c0df2=_0x0adf[_0x290a8d];return _0x3c0df2;};'use strict';var EventEmitter=require(_0xf0ad('0x0'));var Plugin=require(_0xf0ad('0x1'))['db'][_0xf0ad('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ad('0x3'),'afterUpdate':_0xf0ad('0x4'),'afterDestroy':_0xf0ad('0x5')};function emitEvent(_0x187aa4){return function(_0x27d666,_0x459e70,_0x719547){PluginEvents['emit'](_0x187aa4+':'+_0x27d666['id'],_0x27d666);PluginEvents[_0xf0ad('0x6')](_0x187aa4,_0x27d666);_0x719547(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xf0ad('0x7')](e,emitEvent(event));}}module[_0xf0ad('0x8')]=PluginEvents;
\ No newline at end of file
index fbd27dd..356246d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0bf=['bluebird','path','../../config/environment','exports','define','Plugin','plugins','util','api','moment'];(function(_0xaa2a9f,_0x502581){var _0x545c9a=function(_0x4e6948){while(--_0x4e6948){_0xaa2a9f['push'](_0xaa2a9f['shift']());}};_0x545c9a(++_0x502581);}(_0xe0bf,0xa7));var _0xfe0b=function(_0x3e2725,_0x29b27a){_0x3e2725=_0x3e2725-0x0;var _0x4f7b51=_0xe0bf[_0x3e2725];return _0x4f7b51;};'use strict';var _=require('lodash');var util=require(_0xfe0b('0x0'));var logger=require('../../config/logger')(_0xfe0b('0x1'));var moment=require(_0xfe0b('0x2'));var BPromise=require(_0xfe0b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe0b('0x4'));var rimraf=require('rimraf');var config=require(_0xfe0b('0x5'));var attributes=require('./plugin.attributes');module[_0xfe0b('0x6')]=function(_0x180407,_0x1d75ee){return _0x180407[_0xfe0b('0x7')](_0xfe0b('0x8'),attributes,{'tableName':_0xfe0b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6bbb=['./plugin.attributes','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x294c08,_0x2f22e6){var _0x3560e4=function(_0x224833){while(--_0x224833){_0x294c08['push'](_0x294c08['shift']());}};_0x3560e4(++_0x2f22e6);}(_0x6bbb,0x18f));var _0xb6bb=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x6bbb[_0x406e46];return _0x4a3742;};'use strict';var _=require(_0xb6bb('0x0'));var util=require(_0xb6bb('0x1'));var logger=require(_0xb6bb('0x2'))(_0xb6bb('0x3'));var moment=require(_0xb6bb('0x4'));var BPromise=require(_0xb6bb('0x5'));var rp=require(_0xb6bb('0x6'));var fs=require('fs');var path=require(_0xb6bb('0x7'));var rimraf=require('rimraf');var config=require(_0xb6bb('0x8'));var attributes=require(_0xb6bb('0x9'));module['exports']=function(_0x364f08,_0x3d51f6){return _0x364f08['define'](_0xb6bb('0xa'),attributes,{'tableName':_0xb6bb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1520ca0..f965cf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fcc=['defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','options','raw','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x2d088c,_0x539a1b){var _0x4b9713=function(_0x32b1f6){while(--_0x32b1f6){_0x2d088c['push'](_0x2d088c['shift']());}};_0x4b9713(++_0x539a1b);}(_0x4fcc,0x80));var _0xc4fc=function(_0x24a09d,_0x214d4a){_0x24a09d=_0x24a09d-0x0;var _0x5c937f=_0x4fcc[_0x24a09d];return _0x5c937f;};'use strict';var _=require('lodash');var util=require(_0xc4fc('0x0'));var moment=require(_0xc4fc('0x1'));var BPromise=require('bluebird');var rs=require(_0xc4fc('0x2'));var fs=require('fs');var Redis=require(_0xc4fc('0x3'));var db=require(_0xc4fc('0x4'))['db'];var utils=require(_0xc4fc('0x5'));var logger=require(_0xc4fc('0x6'))(_0xc4fc('0x7'));var config=require(_0xc4fc('0x8'));var jayson=require(_0xc4fc('0x9'));var client=jayson['client'][_0xc4fc('0xa')]({'port':0x232a});config[_0xc4fc('0xb')]=_[_0xc4fc('0xc')](config[_0xc4fc('0xb')],{'host':_0xc4fc('0xd'),'port':0x18eb});var socket=require(_0xc4fc('0xe'))(new Redis(config[_0xc4fc('0xb')]));require(_0xc4fc('0xf'))[_0xc4fc('0x10')](socket);function respondWithRpcPromise(_0x1e45b,_0x1a0704,_0x361469){return new BPromise(function(_0x4e6a06,_0x180a81){return client[_0xc4fc('0x11')](_0x1e45b,_0x361469)[_0xc4fc('0x12')](function(_0x3f3f9a){logger[_0xc4fc('0x13')](_0xc4fc('0x14'),_0x1a0704,_0xc4fc('0x15'));logger[_0xc4fc('0x16')](_0xc4fc('0x17'),_0x1a0704,_0xc4fc('0x15'),JSON[_0xc4fc('0x18')](_0x3f3f9a));if(_0x3f3f9a[_0xc4fc('0x19')]){if(_0x3f3f9a[_0xc4fc('0x19')][_0xc4fc('0x1a')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x1a0704,_0x3f3f9a['error'][_0xc4fc('0x1b')]);return _0x180a81(_0x3f3f9a['error']['message']);}logger[_0xc4fc('0x19')](_0xc4fc('0x14'),_0x1a0704,_0x3f3f9a[_0xc4fc('0x19')]['message']);return _0x4e6a06(_0x3f3f9a[_0xc4fc('0x19')][_0xc4fc('0x1b')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x1a0704,_0xc4fc('0x15'));_0x4e6a06(_0x3f3f9a[_0xc4fc('0x1c')][_0xc4fc('0x1b')]);}})[_0xc4fc('0x1d')](function(_0x4a070c){logger[_0xc4fc('0x19')]('Plugin,\x20%s,\x20%s',_0x1a0704,_0x4a070c);_0x180a81(_0x4a070c);});});}exports[_0xc4fc('0x1e')]=function(_0x5dbcb2){var _0x442416=this;return new Promise(function(_0x1a1bf7,_0xfedf15){return db[_0xc4fc('0x1f')][_0xc4fc('0x20')](_0x5dbcb2['body'],{'raw':_0x5dbcb2[_0xc4fc('0x21')]?_0x5dbcb2['options'][_0xc4fc('0x22')]===undefined?!![]:![]:!![]})[_0xc4fc('0x12')](function(_0x527750){logger[_0xc4fc('0x13')]('CreatePlugin',_0x5dbcb2);logger['debug'](_0xc4fc('0x1e'),_0x5dbcb2,JSON[_0xc4fc('0x18')](_0x527750));_0x1a1bf7(_0x527750);})['catch'](function(_0x66158c){logger['error'](_0xc4fc('0x1e'),_0x66158c[_0xc4fc('0x1b')],_0x5dbcb2);_0xfedf15(_0x442416[_0xc4fc('0x19')](0x1f4,_0x66158c[_0xc4fc('0x1b')]));});});};
\ No newline at end of file
+var _0x6412=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','Plugin','create','body','options','CreatePlugin','lodash','util'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x6412,0xad));var _0x2641=function(_0x2577e4,_0xfbab11){_0x2577e4=_0x2577e4-0x0;var _0x286db9=_0x6412[_0x2577e4];return _0x286db9;};'use strict';var _=require(_0x2641('0x0'));var util=require(_0x2641('0x1'));var moment=require(_0x2641('0x2'));var BPromise=require(_0x2641('0x3'));var rs=require(_0x2641('0x4'));var fs=require('fs');var Redis=require(_0x2641('0x5'));var db=require(_0x2641('0x6'))['db'];var utils=require(_0x2641('0x7'));var logger=require('../../config/logger')(_0x2641('0x8'));var config=require(_0x2641('0x9'));var jayson=require(_0x2641('0xa'));var client=jayson[_0x2641('0xb')][_0x2641('0xc')]({'port':0x232a});config[_0x2641('0xd')]=_[_0x2641('0xe')](config[_0x2641('0xd')],{'host':_0x2641('0xf'),'port':0x18eb});var socket=require(_0x2641('0x10'))(new Redis(config[_0x2641('0xd')]));require(_0x2641('0x11'))[_0x2641('0x12')](socket);function respondWithRpcPromise(_0x82f8ca,_0x5e1740,_0x3ac646){return new BPromise(function(_0x8b499a,_0x27b1d4){return client[_0x2641('0x13')](_0x82f8ca,_0x3ac646)[_0x2641('0x14')](function(_0x41c267){logger[_0x2641('0x15')](_0x2641('0x16'),_0x5e1740,_0x2641('0x17'));logger[_0x2641('0x18')]('Plugin,\x20%s,\x20%s,\x20%s',_0x5e1740,_0x2641('0x17'),JSON[_0x2641('0x19')](_0x41c267));if(_0x41c267['error']){if(_0x41c267[_0x2641('0x1a')][_0x2641('0x1b')]===0x1f4){logger[_0x2641('0x1a')](_0x2641('0x16'),_0x5e1740,_0x41c267['error'][_0x2641('0x1c')]);return _0x27b1d4(_0x41c267['error'][_0x2641('0x1c')]);}logger['error'](_0x2641('0x16'),_0x5e1740,_0x41c267[_0x2641('0x1a')][_0x2641('0x1c')]);return _0x8b499a(_0x41c267[_0x2641('0x1a')][_0x2641('0x1c')]);}else{logger[_0x2641('0x15')](_0x2641('0x16'),_0x5e1740,_0x2641('0x17'));_0x8b499a(_0x41c267['result'][_0x2641('0x1c')]);}})[_0x2641('0x1d')](function(_0x4c72ee){logger[_0x2641('0x1a')]('Plugin,\x20%s,\x20%s',_0x5e1740,_0x4c72ee);_0x27b1d4(_0x4c72ee);});});}exports['CreatePlugin']=function(_0x50a7e6){var _0x17a02b=this;return new Promise(function(_0x2be4a8,_0x5731d0){return db[_0x2641('0x1e')][_0x2641('0x1f')](_0x50a7e6[_0x2641('0x20')],{'raw':_0x50a7e6[_0x2641('0x21')]?_0x50a7e6[_0x2641('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x2641('0x14')](function(_0x277bd7){logger[_0x2641('0x15')](_0x2641('0x22'),_0x50a7e6);logger[_0x2641('0x18')](_0x2641('0x22'),_0x50a7e6,JSON[_0x2641('0x19')](_0x277bd7));_0x2be4a8(_0x277bd7);})['catch'](function(_0x2c3b8a){logger[_0x2641('0x1a')](_0x2641('0x22'),_0x2c3b8a[_0x2641('0x1c')],_0x50a7e6);_0x5731d0(_0x17a02b['error'](0x1f4,_0x2c3b8a[_0x2641('0x1c')]));});});};
\ No newline at end of file
index 2134c8c..b16902c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cad=['emit','removeListener','register','./plugin.events','save','remove','update'];(function(_0x1c6055,_0x4413b7){var _0x3ef6ef=function(_0x39ff92){while(--_0x39ff92){_0x1c6055['push'](_0x1c6055['shift']());}};_0x3ef6ef(++_0x4413b7);}(_0x5cad,0x1b5));var _0xd5ca=function(_0x373e27,_0x527f8d){_0x373e27=_0x373e27-0x0;var _0x4a336f=_0x5cad[_0x373e27];return _0x4a336f;};'use strict';var PluginEvents=require(_0xd5ca('0x0'));var events=[_0xd5ca('0x1'),_0xd5ca('0x2'),_0xd5ca('0x3')];function createListener(_0x418fe6,_0x43659e){return function(_0x1909b1){_0x43659e[_0xd5ca('0x4')](_0x418fe6,_0x1909b1);};}function removeListener(_0x193f47,_0x5e704e){return function(){PluginEvents[_0xd5ca('0x5')](_0x193f47,_0x5e704e);};}exports[_0xd5ca('0x6')]=function(_0x5ecb88){for(var _0x11aa85=0x0,_0x2bb00e=events['length'];_0x11aa85<_0x2bb00e;_0x11aa85++){var _0x20e0ec=events[_0x11aa85];var _0x22ab5e=createListener('plugin:'+_0x20e0ec,_0x5ecb88);PluginEvents['on'](_0x20e0ec,_0x22ab5e);}};
\ No newline at end of file
+var _0x65b4=['register','length','plugin:','./plugin.events','update','emit','removeListener'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0x65b4,0x96));var _0x465b=function(_0x3f0b2a,_0x486c5f){_0x3f0b2a=_0x3f0b2a-0x0;var _0x2f1d7a=_0x65b4[_0x3f0b2a];return _0x2f1d7a;};'use strict';var PluginEvents=require(_0x465b('0x0'));var events=['save','remove',_0x465b('0x1')];function createListener(_0x4f8fea,_0x1af6cc){return function(_0x2db3ea){_0x1af6cc[_0x465b('0x2')](_0x4f8fea,_0x2db3ea);};}function removeListener(_0x172a3d,_0x50df49){return function(){PluginEvents[_0x465b('0x3')](_0x172a3d,_0x50df49);};}exports[_0x465b('0x4')]=function(_0x1c1f34){for(var _0x64b44=0x0,_0x5d3796=events[_0x465b('0x5')];_0x64b44<_0x5d3796;_0x64b44++){var _0x4f258c=events[_0x64b44];var _0x351ee3=createListener(_0x465b('0x6')+_0x4f258c,_0x1c1f34);PluginEvents['on'](_0x4f258c,_0x351ee3);}};
\ No newline at end of file
index 616c457..682c9b2 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(_0x14ab5b,_0x5a2541){var _0x4231da=function(_0x38657a){while(--_0x38657a){_0x14ab5b['push'](_0x14ab5b['shift']());}};_0x4231da(++_0x5a2541);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x341b96,_0x5e22b4){var _0x54f890=function(_0x174855){while(--_0x174855){_0x341b96['push'](_0x341b96['shift']());}};_0x54f890(++_0x5e22b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 38d4a46..662d364 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878f=['dirname','start','dump','restart','stop','hasOwnProperty','params','send','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','name','info','index','then','express','motion2','length','catch','show','describe','create','body','script','../../files/plugins','cwd','chdir'];(function(_0x89eb,_0x1f1076){var _0x6b534f=function(_0x4428fc){while(--_0x4428fc){_0x89eb['push'](_0x89eb['shift']());}};_0x6b534f(++_0x1f1076);}(_0x878f,0x173));var _0xf878=function(_0x1bf049,_0x3fe8ae){_0x1bf049=_0x1bf049-0x0;var _0x29d52f=_0x878f[_0x1bf049];return _0x29d52f;};'use strict';var _=require('lodash');var pm2=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var path=require(_0xf878('0x3'));var exec=require(_0xf878('0x4'))[_0xf878('0x5')];var BPromise=require(_0xf878('0x6'));function handleEntityNotFound(_0x45a37b,_0x240b48){return function(_0xcf1927){if(!_0xcf1927){_0x45a37b[_0xf878('0x7')](0x194);;}return _0xcf1927;};}function respondWithResult(_0x4bc9aa,_0x4ac8d8){_0x4ac8d8=_0x4ac8d8||0xc8;return function(_0x3c5f5c){if(_0x3c5f5c){return _0x4bc9aa[_0xf878('0x8')](_0x4ac8d8)['json'](_0x3c5f5c);}return null;};}function handleError(_0x52851e,_0x530767){_0x530767=_0x530767||0x1f4;return function(_0x3329df){logger['error'](_0x3329df['stack']);if(_0x3329df[_0xf878('0x9')]){delete _0x3329df[_0xf878('0x9')];}_0x52851e[_0xf878('0x8')](_0x530767)['send'](_0x3329df);};}function execChildProcess(){return new BPromise(function(_0xb2863e,_0x1399a3){exec('npm\x20install',function(_0xdf76,_0x4f7e7f,_0x31d3d2){logger[_0xf878('0xa')](_0x4f7e7f);logger[_0xf878('0xa')](_0x31d3d2);if(_0xdf76){logger['error'](_0xdf76);return _0x1399a3(_0xdf76);}return _0xb2863e(_0x4f7e7f);});});}exports[_0xf878('0xb')]=function(_0x38eddf,_0x39b1bb){return pm2['list']()[_0xf878('0xc')](function(_0x3902f7){if(_0x3902f7){var _0x119e9e=_['reject'](_0x3902f7,function(_0x568a3a){return _0x568a3a[_0xf878('0x9')]===_0xf878('0xd')||_0x568a3a[_0xf878('0x9')]===_0xf878('0xe');});return{'rows':_0x119e9e,'count':_0x119e9e[_0xf878('0xf')]};}return null;})[_0xf878('0xc')](respondWithResult(_0x39b1bb,null))[_0xf878('0x10')](handleError(_0x39b1bb,null));};exports[_0xf878('0x11')]=function(_0x3c5dee,_0x3a55f3){return pm2[_0xf878('0x12')](_0x3c5dee['params']['id'])[_0xf878('0xc')](respondWithResult(_0x3a55f3,null))[_0xf878('0xc')](handleEntityNotFound(_0x3a55f3,null))[_0xf878('0x10')](handleError(_0x3a55f3,null));};exports[_0xf878('0x13')]=function(_0x3714f6,_0x237d15){if(_0x3714f6[_0xf878('0x14')]['name']&&_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]){var _0x250f85=path['join'](__dirname,_0xf878('0x16'),_0x3714f6[_0xf878('0x14')][_0xf878('0x15')]);var _0x392822=process[_0xf878('0x17')]();process[_0xf878('0x18')](path[_0xf878('0x19')](_0x250f85));return execChildProcess()[_0xf878('0xc')](function(_0x212436){process[_0xf878('0x18')](_0x392822);return pm2[_0xf878('0x1a')]({'name':_0x3714f6['body'][_0xf878('0x9')],'script':_0x250f85});})['then'](function(_0xa3d3d3){pm2[_0xf878('0x1b')]();return _0xa3d3d3[0x0];})[_0xf878('0xc')](respondWithResult(_0x237d15,0xc9))[_0xf878('0x10')](handleError(_0x237d15,null));}else{return _0x237d15[_0xf878('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x242926,_0x3baba4){if(_0x242926[_0xf878('0x14')]['id']){delete _0x242926['body']['id'];}var _0xfa3e11={'online':_0xf878('0x1c'),'stopped':_0xf878('0x1d')};if(_0xfa3e11[_0xf878('0x1e')](_0x242926[_0xf878('0x14')]['status'])){return pm2[_0xfa3e11[_0x242926['body'][_0xf878('0x8')]]](_0x242926[_0xf878('0x1f')]['id'])['then'](respondWithResult(_0x3baba4,0xc8))[_0xf878('0x10')](handleError(_0x3baba4,null));}else{return _0x3baba4['status'](0x1f4)[_0xf878('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf878('0x21')]=function(_0x49e66a,_0x2630fb){if(_0x49e66a['body']['id']){delete _0x49e66a[_0xf878('0x14')]['id'];}if(_0x49e66a[_0xf878('0x1f')]['id']){return pm2[_0xf878('0x22')](_0x49e66a[_0xf878('0x1f')]['id'])[_0xf878('0xc')](function(_0x716782){pm2['dump']();return _0x716782[0x0];})[_0xf878('0xc')](respondWithResult(_0x2630fb,null))[_0xf878('0x10')](handleError(_0x2630fb,null));}else{return _0x2630fb[_0xf878('0x8')](0x1f4)[_0xf878('0x20')]({'message':_0xf878('0x23')});}};
\ No newline at end of file
+var _0x6f0d=['../../files/plugins','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','send','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','bluebird','status','json','error','stack','name','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script'];(function(_0x5c0722,_0x45c3e4){var _0x150eea=function(_0x1e5cb2){while(--_0x1e5cb2){_0x5c0722['push'](_0x5c0722['shift']());}};_0x150eea(++_0x45c3e4);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2ad81a,_0x23cdee){_0x2ad81a=_0x2ad81a-0x0;var _0x458665=_0x6f0d[_0x2ad81a];return _0x458665;};'use strict';var _=require('lodash');var pm2=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var path=require(_0xd6f0('0x3'));var exec=require('child_process')[_0xd6f0('0x4')];var BPromise=require(_0xd6f0('0x5'));function handleEntityNotFound(_0x2f78fb,_0x25344b){return function(_0x3a757f){if(!_0x3a757f){_0x2f78fb['sendStatus'](0x194);;}return _0x3a757f;};}function respondWithResult(_0x2d2ce6,_0x4a8b0c){_0x4a8b0c=_0x4a8b0c||0xc8;return function(_0xe21ac4){if(_0xe21ac4){return _0x2d2ce6[_0xd6f0('0x6')](_0x4a8b0c)[_0xd6f0('0x7')](_0xe21ac4);}return null;};}function handleError(_0x1a48a0,_0x4c4916){_0x4c4916=_0x4c4916||0x1f4;return function(_0x507048){logger[_0xd6f0('0x8')](_0x507048[_0xd6f0('0x9')]);if(_0x507048[_0xd6f0('0xa')]){delete _0x507048[_0xd6f0('0xa')];}_0x1a48a0[_0xd6f0('0x6')](_0x4c4916)['send'](_0x507048);};}function execChildProcess(){return new BPromise(function(_0x136eee,_0xee144c){exec(_0xd6f0('0xb'),function(_0x44bba6,_0x4d10a1,_0x1ce8d5){logger[_0xd6f0('0xc')](_0x4d10a1);logger[_0xd6f0('0xc')](_0x1ce8d5);if(_0x44bba6){logger[_0xd6f0('0x8')](_0x44bba6);return _0xee144c(_0x44bba6);}return _0x136eee(_0x4d10a1);});});}exports[_0xd6f0('0xd')]=function(_0x409549,_0x2bf5b8){return pm2[_0xd6f0('0xe')]()[_0xd6f0('0xf')](function(_0x4ab979){if(_0x4ab979){var _0x2b3f32=_[_0xd6f0('0x10')](_0x4ab979,function(_0x4c1559){return _0x4c1559[_0xd6f0('0xa')]==='express'||_0x4c1559[_0xd6f0('0xa')]===_0xd6f0('0x11');});return{'rows':_0x2b3f32,'count':_0x2b3f32[_0xd6f0('0x12')]};}return null;})[_0xd6f0('0xf')](respondWithResult(_0x2bf5b8,null))[_0xd6f0('0x13')](handleError(_0x2bf5b8,null));};exports[_0xd6f0('0x14')]=function(_0x25da0c,_0x29fbb9){return pm2[_0xd6f0('0x15')](_0x25da0c[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x29fbb9,null))[_0xd6f0('0xf')](handleEntityNotFound(_0x29fbb9,null))[_0xd6f0('0x13')](handleError(_0x29fbb9,null));};exports[_0xd6f0('0x17')]=function(_0x1f43d7,_0xde87d4){if(_0x1f43d7['body']['name']&&_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0x19')]){var _0x1158dc=path['join'](__dirname,_0xd6f0('0x1a'),_0x1f43d7[_0xd6f0('0x18')]['script']);var _0x86dde0=process['cwd']();process[_0xd6f0('0x1b')](path[_0xd6f0('0x1c')](_0x1158dc));return execChildProcess()['then'](function(_0xb9e820){process[_0xd6f0('0x1b')](_0x86dde0);return pm2['start']({'name':_0x1f43d7[_0xd6f0('0x18')][_0xd6f0('0xa')],'script':_0x1158dc});})[_0xd6f0('0xf')](function(_0x5b1a62){pm2[_0xd6f0('0x1d')]();return _0x5b1a62[0x0];})[_0xd6f0('0xf')](respondWithResult(_0xde87d4,0xc9))['catch'](handleError(_0xde87d4,null));}else{return _0xde87d4[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x1e')});}};exports[_0xd6f0('0x1f')]=function(_0x1630dc,_0x3c1bff){if(_0x1630dc[_0xd6f0('0x18')]['id']){delete _0x1630dc[_0xd6f0('0x18')]['id'];}var _0x12d6ec={'online':_0xd6f0('0x20'),'stopped':'stop'};if(_0x12d6ec[_0xd6f0('0x21')](_0x1630dc[_0xd6f0('0x18')]['status'])){return pm2[_0x12d6ec[_0x1630dc[_0xd6f0('0x18')][_0xd6f0('0x6')]]](_0x1630dc[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](respondWithResult(_0x3c1bff,0xc8))[_0xd6f0('0x13')](handleError(_0x3c1bff,null));}else{return _0x3c1bff[_0xd6f0('0x6')](0x1f4)[_0xd6f0('0x22')]({'message':_0xd6f0('0x23')});}};exports[_0xd6f0('0x24')]=function(_0x43f72f,_0x1dff9b){if(_0x43f72f[_0xd6f0('0x18')]['id']){delete _0x43f72f[_0xd6f0('0x18')]['id'];}if(_0x43f72f[_0xd6f0('0x16')]['id']){return pm2[_0xd6f0('0x25')](_0x43f72f[_0xd6f0('0x16')]['id'])[_0xd6f0('0xf')](function(_0x376890){pm2[_0xd6f0('0x1d')]();return _0x376890[0x0];})[_0xd6f0('0xf')](respondWithResult(_0x1dff9b,null))[_0xd6f0('0x13')](handleError(_0x1dff9b,null));}else{return _0x1dff9b[_0xd6f0('0x6')](0x1f4)['send']({'message':_0xd6f0('0x26')});}};
\ No newline at end of file
index f7debb3..8bed9da 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(_0x3bcd4d,_0x3c75c1){var _0x37e9b6=function(_0x50e330){while(--_0x50e330){_0x3bcd4d['push'](_0x3bcd4d['shift']());}};_0x37e9b6(++_0x3c75c1);}(_0xedd9,0xfc));var _0x9edd=function(_0x562942,_0x3a3090){_0x562942=_0x562942-0x0;var _0x4434bd=_0xedd9[_0x562942];return _0x4434bd;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1dea34,_0xf92974){var _0x3ac4cc=function(_0x1c8ff1){while(--_0x1c8ff1){_0x1dea34['push'](_0x1dea34['shift']());}};_0x3ac4cc(++_0xf92974);}(_0xe706,0xa3));var _0x6e70=function(_0x5281ce,_0x210279){_0x5281ce=_0x5281ce-0x0;var _0x138d09=_0xe706[_0x5281ce];return _0x138d09;};'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 9169eb1..9c1003c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd206=['STRING','DATE','INTEGER','sequelize','exports'];(function(_0x1afbcb,_0x935cbe){var _0x53b133=function(_0x50f8c1){while(--_0x50f8c1){_0x1afbcb['push'](_0x1afbcb['shift']());}};_0x53b133(++_0x935cbe);}(_0xd206,0x107));var _0x6d20=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd206[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0x6d20('0x0'));module[_0x6d20('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6d20('0x2')]},'scheduledat':{'type':Sequelize[_0x6d20('0x3')]},'uniqueid':{'type':Sequelize[_0x6d20('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6d20('0x3')]},'ringtime':{'type':Sequelize[_0x6d20('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6d20('0x2')]},'campaigntype':{'type':Sequelize[_0x6d20('0x2')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x326f=['INTEGER','sequelize','STRING','DATE'];(function(_0xc150f2,_0x4e7d1e){var _0x1aae52=function(_0x15647e){while(--_0x15647e){_0xc150f2['push'](_0xc150f2['shift']());}};_0x1aae52(++_0x4e7d1e);}(_0x326f,0xd1));var _0xf326=function(_0x5a1639,_0x2d75f4){_0x5a1639=_0x5a1639-0x0;var _0x3b03fa=_0x326f[_0x5a1639];return _0x3b03fa;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf326('0x1')]},'scheduledat':{'type':Sequelize[_0xf326('0x2')]},'uniqueid':{'type':Sequelize[_0xf326('0x1')]},'starttime':{'type':Sequelize[_0xf326('0x2')]},'responsetime':{'type':Sequelize[_0xf326('0x2')]},'ringtime':{'type':Sequelize[_0xf326('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf326('0x1')]},'campaigntype':{'type':Sequelize[_0xf326('0x1')]},'membername':{'type':Sequelize[_0xf326('0x1')]}};
\ No newline at end of file
index d4af350..f3b125e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9af=['rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xa9af,0xae));var _0xfa9a=function(_0x5288db,_0x20e6bb){_0x5288db=_0x5288db-0x0;var _0x4868a2=_0xa9af[_0x5288db];return _0x4868a2;};'use strict';var _=require(_0xfa9a('0x0'));var util=require(_0xfa9a('0x1'));var logger=require(_0xfa9a('0x2'))('api');var moment=require(_0xfa9a('0x3'));var BPromise=require('bluebird');var rp=require(_0xfa9a('0x4'));var fs=require('fs');var path=require(_0xfa9a('0x5'));var rimraf=require(_0xfa9a('0x6'));var config=require('../../config/environment');var attributes=require(_0xfa9a('0x7'));module[_0xfa9a('0x8')]=function(_0x2c40bd,_0x146706){return _0x2c40bd[_0xfa9a('0x9')](_0xfa9a('0xa'),attributes,{'tableName':_0xfa9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3782=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x140b99,_0x7e2f1d){var _0x30a5ea=function(_0x22057c){while(--_0x22057c){_0x140b99['push'](_0x140b99['shift']());}};_0x30a5ea(++_0x7e2f1d);}(_0x3782,0x124));var _0x2378=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3782[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2378('0x0'));var util=require(_0x2378('0x1'));var logger=require(_0x2378('0x2'))(_0x2378('0x3'));var moment=require(_0x2378('0x4'));var BPromise=require(_0x2378('0x5'));var rp=require(_0x2378('0x6'));var fs=require('fs');var path=require(_0x2378('0x7'));var rimraf=require(_0x2378('0x8'));var config=require(_0x2378('0x9'));var attributes=require(_0x2378('0xa'));module[_0x2378('0xb')]=function(_0x3e3e5d,_0x2ece6e){return _0x3e3e5d['define'](_0x2378('0xc'),attributes,{'tableName':_0x2378('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a9d8f1d..80cc98a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa85a=['CreateReportAgentPreview','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ReportAgentPreview','body','options','raw','stringify'];(function(_0x5e5103,_0x5924e0){var _0x16f2be=function(_0x232ca8){while(--_0x232ca8){_0x5e5103['push'](_0x5e5103['shift']());}};_0x16f2be(++_0x5924e0);}(_0xa85a,0x1cc));var _0xaa85=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xa85a[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xaa85('0x0'));var util=require('util');var moment=require(_0xaa85('0x1'));var BPromise=require(_0xaa85('0x2'));var rs=require(_0xaa85('0x3'));var fs=require('fs');var Redis=require(_0xaa85('0x4'));var db=require(_0xaa85('0x5'))['db'];var utils=require(_0xaa85('0x6'));var logger=require(_0xaa85('0x7'))(_0xaa85('0x8'));var config=require(_0xaa85('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa85('0xa')][_0xaa85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fda3d,_0x562962,_0x3a8295){return new BPromise(function(_0x3c6e5d,_0x20d247){return client[_0xaa85('0xc')](_0x1fda3d,_0x3a8295)['then'](function(_0x2152fd){logger[_0xaa85('0xd')](_0xaa85('0xe'),_0x562962,_0xaa85('0xf'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x562962,_0xaa85('0xf'),JSON['stringify'](_0x2152fd));if(_0x2152fd[_0xaa85('0x10')]){if(_0x2152fd['error'][_0xaa85('0x11')]===0x1f4){logger['error'](_0xaa85('0xe'),_0x562962,_0x2152fd['error'][_0xaa85('0x12')]);return _0x20d247(_0x2152fd[_0xaa85('0x10')][_0xaa85('0x12')]);}logger[_0xaa85('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x562962,_0x2152fd['error']['message']);return _0x3c6e5d(_0x2152fd[_0xaa85('0x10')]['message']);}else{logger[_0xaa85('0xd')](_0xaa85('0xe'),_0x562962,'request\x20sent');_0x3c6e5d(_0x2152fd[_0xaa85('0x13')][_0xaa85('0x12')]);}})[_0xaa85('0x14')](function(_0x2a3d74){logger['error'](_0xaa85('0xe'),_0x562962,_0x2a3d74);_0x20d247(_0x2a3d74);});});}exports['CreateReportAgentPreview']=function(_0x2c77e1){var _0x2bbf78=this;return new Promise(function(_0xe5676f,_0x593354){return db[_0xaa85('0x15')]['create'](_0x2c77e1[_0xaa85('0x16')],{'raw':_0x2c77e1[_0xaa85('0x17')]?_0x2c77e1[_0xaa85('0x17')][_0xaa85('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1f0870){logger[_0xaa85('0xd')]('CreateReportAgentPreview',_0x2c77e1);logger['debug']('CreateReportAgentPreview',_0x2c77e1,JSON[_0xaa85('0x19')](_0x1f0870));_0xe5676f(_0x1f0870);})[_0xaa85('0x14')](function(_0x46ef12){logger[_0xaa85('0x10')](_0xaa85('0x1a'),_0x46ef12[_0xaa85('0x12')],_0x2c77e1);_0x593354(_0x2bbf78['error'](0x1f4,_0x46ef12['message']));});});};
\ No newline at end of file
+var _0x9dbd=['raw','then','debug','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','options'];(function(_0x44aec0,_0x4a862c){var _0x8e5ec5=function(_0x4da990){while(--_0x4da990){_0x44aec0['push'](_0x44aec0['shift']());}};_0x8e5ec5(++_0x4a862c);}(_0x9dbd,0xa6));var _0xd9db=function(_0x1a974d,_0x381699){_0x1a974d=_0x1a974d-0x0;var _0x405801=_0x9dbd[_0x1a974d];return _0x405801;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd9db('0x0'));var BPromise=require(_0xd9db('0x1'));var rs=require(_0xd9db('0x2'));var fs=require('fs');var Redis=require(_0xd9db('0x3'));var db=require(_0xd9db('0x4'))['db'];var utils=require(_0xd9db('0x5'));var logger=require('../../config/logger')(_0xd9db('0x6'));var config=require(_0xd9db('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd9db('0x8')][_0xd9db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed51d,_0x1e3d86,_0xdad978){return new BPromise(function(_0x5e3f3a,_0x4ab794){return client[_0xd9db('0xa')](_0x2ed51d,_0xdad978)['then'](function(_0x3e44e4){logger['info'](_0xd9db('0xb'),_0x1e3d86,'request\x20sent');logger['debug'](_0xd9db('0xc'),_0x1e3d86,_0xd9db('0xd'),JSON['stringify'](_0x3e44e4));if(_0x3e44e4[_0xd9db('0xe')]){if(_0x3e44e4[_0xd9db('0xe')][_0xd9db('0xf')]===0x1f4){logger[_0xd9db('0xe')](_0xd9db('0xb'),_0x1e3d86,_0x3e44e4[_0xd9db('0xe')][_0xd9db('0x10')]);return _0x4ab794(_0x3e44e4['error'][_0xd9db('0x10')]);}logger[_0xd9db('0xe')](_0xd9db('0xb'),_0x1e3d86,_0x3e44e4[_0xd9db('0xe')][_0xd9db('0x10')]);return _0x5e3f3a(_0x3e44e4[_0xd9db('0xe')][_0xd9db('0x10')]);}else{logger[_0xd9db('0x11')](_0xd9db('0xb'),_0x1e3d86,_0xd9db('0xd'));_0x5e3f3a(_0x3e44e4[_0xd9db('0x12')]['message']);}})[_0xd9db('0x13')](function(_0x71f62b){logger['error'](_0xd9db('0xb'),_0x1e3d86,_0x71f62b);_0x4ab794(_0x71f62b);});});}exports[_0xd9db('0x14')]=function(_0x405aaa){var _0x47610c=this;return new Promise(function(_0x43fd87,_0x38bc06){return db[_0xd9db('0x15')]['create'](_0x405aaa['body'],{'raw':_0x405aaa[_0xd9db('0x16')]?_0x405aaa[_0xd9db('0x16')][_0xd9db('0x17')]===undefined?!![]:![]:!![]})[_0xd9db('0x18')](function(_0xde8695){logger['info']('CreateReportAgentPreview',_0x405aaa);logger[_0xd9db('0x19')](_0xd9db('0x14'),_0x405aaa,JSON[_0xd9db('0x1a')](_0xde8695));_0x43fd87(_0xde8695);})[_0xd9db('0x13')](function(_0x10eb18){logger[_0xd9db('0xe')](_0xd9db('0x14'),_0x10eb18[_0xd9db('0x10')],_0x405aaa);_0x38bc06(_0x47610c[_0xd9db('0xe')](0x1f4,_0x10eb18['message']));});});};
\ No newline at end of file
index fc470c5..f85bef3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43b7=['/whatsapp/queues/:id','showWhatsappQueues','multer','express','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues'];(function(_0x146892,_0x3b3948){var _0x3e8466=function(_0x6cfe19){while(--_0x6cfe19){_0x146892['push'](_0x146892['shift']());}};_0x3e8466(++_0x3b3948);}(_0x43b7,0x183));var _0x743b=function(_0x173e96,_0x95af46){_0x173e96=_0x173e96-0x0;var _0xdc0a46=_0x43b7[_0x173e96];return _0xdc0a46;};'use strict';var multer=require(_0x743b('0x0'));var util=require('util');var path=require('path');var express=require(_0x743b('0x1'));var router=express['Router']();var auth=require(_0x743b('0x2'));var controller=require(_0x743b('0x3'));router['get']('/voice/channels',auth[_0x743b('0x4')](),controller[_0x743b('0x5')]);router[_0x743b('0x6')](_0x743b('0x7'),auth[_0x743b('0x4')](),controller[_0x743b('0x8')]);router[_0x743b('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router['get']('/voice/queues',auth[_0x743b('0x4')](),controller[_0x743b('0x9')]);router['get'](_0x743b('0xa'),auth['isAuthenticated'](),controller[_0x743b('0xb')]);router[_0x743b('0x6')](_0x743b('0xc'),auth[_0x743b('0x4')](),controller[_0x743b('0xd')]);router[_0x743b('0x6')](_0x743b('0xe'),auth[_0x743b('0x4')](),controller[_0x743b('0xf')]);router[_0x743b('0x6')](_0x743b('0x10'),auth['isAuthenticated'](),controller[_0x743b('0x11')]);router[_0x743b('0x6')](_0x743b('0x12'),auth[_0x743b('0x4')](),controller[_0x743b('0x13')]);router['get'](_0x743b('0x14'),auth[_0x743b('0x4')](),controller[_0x743b('0x15')]);router[_0x743b('0x6')]('/fax/queues',auth['isAuthenticated'](),controller[_0x743b('0x16')]);router['get'](_0x743b('0x17'),auth[_0x743b('0x4')](),controller[_0x743b('0x18')]);router[_0x743b('0x6')](_0x743b('0x19'),auth[_0x743b('0x4')](),controller[_0x743b('0x1a')]);router[_0x743b('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x743b('0x4')](),controller['voiceQueuesChannel']);router[_0x743b('0x6')](_0x743b('0x1b'),auth[_0x743b('0x4')](),controller['voiceQueuesChannelHangup']);router[_0x743b('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x743b('0x4')](),controller[_0x743b('0x1c')]);router['get'](_0x743b('0x1d'),auth[_0x743b('0x4')](),controller[_0x743b('0x1e')]);router[_0x743b('0x1f')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x743b('0x20')]);router[_0x743b('0x6')](_0x743b('0x21'),auth['isAuthenticated'](),controller[_0x743b('0x22')]);router[_0x743b('0x6')](_0x743b('0x23'),auth[_0x743b('0x4')](),controller[_0x743b('0x24')]);router[_0x743b('0x6')](_0x743b('0x25'),auth[_0x743b('0x4')](),controller[_0x743b('0x26')]);router['put'](_0x743b('0x27'),auth[_0x743b('0x4')](),controller[_0x743b('0x28')]);router['get'](_0x743b('0x29'),auth[_0x743b('0x4')](),controller[_0x743b('0x2a')]);router[_0x743b('0x6')]('/trunks',auth['isAuthenticated'](),controller[_0x743b('0x2b')]);router['get'](_0x743b('0x2c'),auth[_0x743b('0x4')](),controller[_0x743b('0x2d')]);router[_0x743b('0x6')](_0x743b('0x2e'),auth[_0x743b('0x4')](),controller[_0x743b('0x2f')]);router['get']('/chat/queues/waitinginteractions',auth[_0x743b('0x4')](),controller['chatQueuesWaitingInteractions']);router['get'](_0x743b('0x30'),auth['isAuthenticated'](),controller[_0x743b('0x31')]);router[_0x743b('0x6')](_0x743b('0x32'),auth[_0x743b('0x4')](),controller[_0x743b('0x33')]);router[_0x743b('0x6')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x743b('0x34')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x743b('0x35')]);router[_0x743b('0x6')](_0x743b('0x36'),auth[_0x743b('0x4')](),controller[_0x743b('0x37')]);router[_0x743b('0x6')]('/fax/queues/waitinginteractions',auth[_0x743b('0x4')](),controller['faxQueuesWaitingInteractions']);router[_0x743b('0x38')]('/mail/queues/:id/notify',auth[_0x743b('0x4')](),controller[_0x743b('0x39')](_0x743b('0x3a')));router[_0x743b('0x6')](_0x743b('0x3b'),auth[_0x743b('0x4')](),controller['showMailQueues']);router[_0x743b('0x38')](_0x743b('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0x743b('0x3d')));router[_0x743b('0x6')](_0x743b('0x3e'),auth[_0x743b('0x4')](),controller['showChatQueues']);router['post'](_0x743b('0x3f'),auth[_0x743b('0x4')](),controller[_0x743b('0x39')]('fax'));router['get'](_0x743b('0x40'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x743b('0x38')](_0x743b('0x41'),auth[_0x743b('0x4')](),controller[_0x743b('0x39')](_0x743b('0x42')));router[_0x743b('0x6')](_0x743b('0x43'),auth[_0x743b('0x4')](),controller[_0x743b('0x44')]);router['post'](_0x743b('0x45'),auth[_0x743b('0x4')](),controller[_0x743b('0x39')](_0x743b('0x46')));router['post'](_0x743b('0x47'),auth[_0x743b('0x4')](),controller[_0x743b('0x39')](_0x743b('0x48')));router[_0x743b('0x6')](_0x743b('0x49'),auth['isAuthenticated'](),controller[_0x743b('0x4a')]);router[_0x743b('0x6')](_0x743b('0x4b'),auth[_0x743b('0x4')](),controller[_0x743b('0x4c')]);router['post']('/agents/:id/notify',auth[_0x743b('0x4')](),controller['agentNotify']);module['exports']=router;
\ No newline at end of file
+var _0xb5a8=['put','/agents/:id/capacity','agentCapacity','telephones','/trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','post','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents'];(function(_0x4e3bf8,_0x1829b1){var _0x37a8be=function(_0x3eecdc){while(--_0x3eecdc){_0x4e3bf8['push'](_0x4e3bf8['shift']());}};_0x37a8be(++_0x1829b1);}(_0xb5a8,0x81));var _0x8b5a=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xb5a8[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x8b5a('0x0'));var util=require(_0x8b5a('0x1'));var path=require(_0x8b5a('0x2'));var express=require(_0x8b5a('0x3'));var router=express[_0x8b5a('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x8b5a('0x5'));router[_0x8b5a('0x6')](_0x8b5a('0x7'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x9')]);router[_0x8b5a('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xa')]);router['get'](_0x8b5a('0xb'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xc')]);router[_0x8b5a('0x6')]('/voice/queues',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xd')]);router[_0x8b5a('0x6')](_0x8b5a('0xe'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0xf')]);router[_0x8b5a('0x6')]('/mail/queues',auth[_0x8b5a('0x8')](),controller['mailQueues']);router[_0x8b5a('0x6')](_0x8b5a('0x10'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x11')]);router['get']('/openchannel/queues',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x12')]);router[_0x8b5a('0x6')](_0x8b5a('0x13'),auth['isAuthenticated'](),controller[_0x8b5a('0x14')]);router[_0x8b5a('0x6')](_0x8b5a('0x15'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x16')]);router[_0x8b5a('0x6')](_0x8b5a('0x17'),auth['isAuthenticated'](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x18')]);router[_0x8b5a('0x6')](_0x8b5a('0x19'),auth[_0x8b5a('0x8')](),controller['voiceQueuesChannels']);router[_0x8b5a('0x6')](_0x8b5a('0x1a'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x1b')]);router[_0x8b5a('0x6')](_0x8b5a('0x1c'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x1d')]);router['get'](_0x8b5a('0x1e'),auth['isAuthenticated'](),controller[_0x8b5a('0x1f')]);router[_0x8b5a('0x6')](_0x8b5a('0x20'),auth[_0x8b5a('0x8')](),controller['showVoiceQueues']);router['put'](_0x8b5a('0x20'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x21')]);router[_0x8b5a('0x6')]('/outbound',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x22')]);router['get'](_0x8b5a('0x23'),auth['isAuthenticated'](),controller[_0x8b5a('0x24')]);router[_0x8b5a('0x6')](_0x8b5a('0x25'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x26')]);router[_0x8b5a('0x27')](_0x8b5a('0x28'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x29')]);router[_0x8b5a('0x6')]('/telephones',auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x2a')]);router[_0x8b5a('0x6')](_0x8b5a('0x2b'),auth[_0x8b5a('0x8')](),controller['trunks']);router[_0x8b5a('0x6')](_0x8b5a('0x2c'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x2d')]);router[_0x8b5a('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x8b5a('0x2e')]);router[_0x8b5a('0x6')](_0x8b5a('0x2f'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x30')]);router[_0x8b5a('0x6')](_0x8b5a('0x31'),auth['isAuthenticated'](),controller[_0x8b5a('0x32')]);router['get'](_0x8b5a('0x33'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x34')]);router[_0x8b5a('0x6')](_0x8b5a('0x35'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x36')]);router[_0x8b5a('0x6')](_0x8b5a('0x37'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x38')]);router[_0x8b5a('0x6')](_0x8b5a('0x39'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3a')]);router['get'](_0x8b5a('0x3b'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3c')]);router['post'](_0x8b5a('0x3d'),auth['isAuthenticated'](),controller[_0x8b5a('0x3e')](_0x8b5a('0x3f')));router[_0x8b5a('0x6')](_0x8b5a('0x40'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x41')]);router['post'](_0x8b5a('0x42'),auth['isAuthenticated'](),controller[_0x8b5a('0x3e')](_0x8b5a('0x43')));router[_0x8b5a('0x6')](_0x8b5a('0x44'),auth[_0x8b5a('0x8')](),controller['showChatQueues']);router[_0x8b5a('0x45')](_0x8b5a('0x46'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3e')]('fax'));router[_0x8b5a('0x6')](_0x8b5a('0x47'),auth['isAuthenticated'](),controller[_0x8b5a('0x48')]);router[_0x8b5a('0x45')](_0x8b5a('0x49'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x3e')]('openchannel'));router[_0x8b5a('0x6')](_0x8b5a('0x4a'),auth[_0x8b5a('0x8')](),controller['showOpenchannelQueues']);router[_0x8b5a('0x45')](_0x8b5a('0x4b'),auth['isAuthenticated'](),controller['queueNotify'](_0x8b5a('0x4c')));router[_0x8b5a('0x45')](_0x8b5a('0x4d'),auth['isAuthenticated'](),controller[_0x8b5a('0x3e')](_0x8b5a('0x4e')));router['get'](_0x8b5a('0x4f'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x50')]);router[_0x8b5a('0x6')](_0x8b5a('0x51'),auth[_0x8b5a('0x8')](),controller[_0x8b5a('0x52')]);router[_0x8b5a('0x45')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x8b5a('0x53')]);module['exports']=router;
\ No newline at end of file
index eabecab..fa940b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['VoiceQueuesChannelHangup','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','agent','AgentCapacity','telephones','Telephones','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','MessageId','From','agentTransferTimeout','bluebird','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup'];(function(_0x1be036,_0x23c85c){var _0x59696e=function(_0x53703e){while(--_0x53703e){_0x1be036['push'](_0x1be036['shift']());}};_0x59696e(++_0x23c85c);}(_0x326f,0xd1));var _0xf326=function(_0x29e4d2,_0x287b00){_0x29e4d2=_0x29e4d2-0x0;var _0x525b73=_0x326f[_0x29e4d2];return _0x525b73;};'use strict';var BPromise=require(_0xf326('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xf326('0x1'));var db=require(_0xf326('0x2'))['db'];var logger=require(_0xf326('0x3'))(_0xf326('0x4'));var jayson=require(_0xf326('0x5'));var amiClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232a});var mailClient=jayson[_0xf326('0x6')][_0xf326('0x7')]({'port':0x232b});var routingClient=jayson[_0xf326('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){var _0x4c206c=_0x165f95?_0x165f95:amiClient;return _0x4c206c['request'](_0x3c254d,_0x3851eb)[_0xf326('0x8')](function(_0x1fc80e){if(_0x1fc80e[_0xf326('0x9')]){if(_0x1fc80e[_0xf326('0x9')][_0xf326('0xa')]===0x1f4){return _0x515bfa(_0x1fc80e['error'][_0xf326('0xb')]);}return _0x1e7b8a(_0x1fc80e['error'][_0xf326('0xb')]);}else{_0x1e7b8a(_0x1fc80e['result']);}})[_0xf326('0xc')](function(_0x518ab5){_0x515bfa(_0x518ab5);});});}function respondWithResult(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xc8;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0xd')](_0x9ed463)[_0xf326('0xe')](_0x4b3966);}return _0x3162f9[_0xf326('0xf')](0x194);};}function handleError(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0x1f4;return function(_0x45c1b6){logger['error'](_0x45c1b6['stack']);if(_0x45c1b6[_0xf326('0x10')]){delete _0x45c1b6[_0xf326('0x10')];}_0x17a098[_0xf326('0xd')](_0x5c8483)[_0xf326('0x11')](_0x45c1b6);};}function findById(_0x292f4b){return function(_0x287a2a){if(!_[_0xf326('0x12')](_0x292f4b)&&!_[_0xf326('0x12')](_0x287a2a)&&!_['isNil'](_0x287a2a[_0xf326('0x13')])){return _[_0xf326('0x14')](_0x287a2a[_0xf326('0x13')],function(_0x31ffb9){return _0x31ffb9['id']==_0x292f4b;});}return null;};}exports[_0xf326('0x15')]=function(_0x311af0,_0x4d3d41){return respondWithRpcPromise('VoiceChannels',_0x311af0['query'])[_0xf326('0x8')](respondWithResult(_0x4d3d41,null))[_0xf326('0xc')](handleError(_0x4d3d41,null));};exports['voiceChannelMixMonitor']=function(_0x4cabce,_0x128c68){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x4cabce[_0xf326('0x16')],_0x4cabce[_0xf326('0x17')]))['then'](respondWithResult(_0x128c68,null))['catch'](handleError(_0x128c68,null));};exports[_0xf326('0x18')]=function(_0xb1efcf,_0x5f21a2){return respondWithRpcPromise(_0xf326('0x19'),_[_0xf326('0x1a')](_0xb1efcf[_0xf326('0x16')],_0xb1efcf[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5f21a2,null))[_0xf326('0xc')](handleError(_0x5f21a2,null));};exports['voiceQueues']=function(_0x55b9f4,_0x4f31f6){return respondWithRpcPromise(_0xf326('0x1b'),_0x55b9f4[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4f31f6,null))[_0xf326('0xc')](handleError(_0x4f31f6,null));};exports[_0xf326('0x1c')]=function(_0x410237,_0x5217d4){return respondWithRpcPromise(_0xf326('0x1b'),_0x410237[_0xf326('0x16')])[_0xf326('0x8')](findById(_0x410237['params']['id']))[_0xf326('0x8')](respondWithResult(_0x5217d4,null))['catch'](handleError(_0x5217d4,null));};exports['updateVoiceQueue']=function(_0x6a8e89,_0x1ae23a){return respondWithRpcPromise(_0xf326('0x1d'),_['merge'](_0x6a8e89[_0xf326('0x1e')],_0x6a8e89[_0xf326('0x17')]))['then'](respondWithResult(_0x1ae23a,null))[_0xf326('0xc')](handleError(_0x1ae23a,null));};exports[_0xf326('0x1f')]=function(_0xd77aba,_0x18d110){return respondWithRpcPromise(_0xf326('0x20'),_[_0xf326('0x1a')](_0xd77aba[_0xf326('0x16')],_0xd77aba[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x18d110,null))[_0xf326('0xc')](handleError(_0x18d110,null));};exports['voiceQueuesChannels']=function(_0x1035ed,_0x424104){return respondWithRpcPromise(_0xf326('0x21'),_0x1035ed['query'])[_0xf326('0x8')](respondWithResult(_0x424104,null))[_0xf326('0xc')](handleError(_0x424104,null));};exports[_0xf326('0x22')]=function(_0x4df451,_0x5b101d){return respondWithRpcPromise(_0xf326('0x23'),_[_0xf326('0x1a')](_0x4df451[_0xf326('0x16')],_0x4df451[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0x5b101d,null))[_0xf326('0xc')](handleError(_0x5b101d,null));};exports[_0xf326('0x24')]=function(_0x2d5f20,_0x580374){return respondWithRpcPromise(_0xf326('0x25'),_[_0xf326('0x1a')](_0x2d5f20['query'],_0x2d5f20[_0xf326('0x17')]))['then'](respondWithResult(_0x580374,null))[_0xf326('0xc')](handleError(_0x580374,null));};exports['voiceQueuesChannelRedirect']=function(_0x51f147,_0xadb020){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xf326('0x1a')](_0x51f147['query'],_0x51f147[_0xf326('0x17')]))[_0xf326('0x8')](respondWithResult(_0xadb020,null))[_0xf326('0xc')](handleError(_0xadb020,null));};exports['outbound']=function(_0x3dcc7e,_0x4095e6){return respondWithRpcPromise('Outbound',_0x3dcc7e[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4095e6,null))[_0xf326('0xc')](handleError(_0x4095e6,null));};exports[_0xf326('0x26')]=function(_0x51076c,_0x2c4416){return respondWithRpcPromise(_0xf326('0x27'),_0x51076c[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x2c4416,null))[_0xf326('0xc')](handleError(_0x2c4416,null));};exports['agents']=function(_0x3e830d,_0x1b7bf6){var _0x5cfb97;return respondWithRpcPromise('Agents',_0x3e830d[_0xf326('0x16')])['then'](function(_0x55dfa8){_0x5cfb97=_0x55dfa8;return respondWithRpcPromise(_0xf326('0x28'),_0x3e830d['query'],routingClient);})[_0xf326('0x8')](function(_0x37a95b){return _[_0xf326('0x1a')]({},_0x37a95b,_0x5cfb97);})[_0xf326('0x8')](respondWithResult(_0x1b7bf6,null))['catch'](handleError(_0x1b7bf6,null));};exports[_0xf326('0x29')]=function(_0x45d344,_0x347e7b){if(_0x45d344[_0xf326('0x1e')]&&_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]&&_0x45d344[_0xf326('0x2b')]&&_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]){for(var _0x1227d3 in _0x45d344[_0xf326('0x1e')][_0xf326('0x2a')]){if(_0x45d344['body'][_0xf326('0x2a')][_0xf326('0x2c')](_0x1227d3)){db[_0xf326('0x2d')][_0xf326('0x2e')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]&&_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')]?{'$notIn':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3]}:{'$ne':null}}})[_0xf326('0x8')](function(_0x55361f){var _0x505344=moment()[_0xf326('0x30')](_0xf326('0x31'));for(var _0x5ed62e=0x0,_0x4bd865=_0x55361f[_0xf326('0x2f')];_0x5ed62e<_0x4bd865;_0x5ed62e+=0x1){_0x55361f[_0x5ed62e][_0xf326('0x32')]({'exitAt':_0x505344});}});for(var _0x21c98e=0x0;_0x21c98e<_0x45d344['body'][_0xf326('0x2a')][_0x1227d3][_0xf326('0x2f')];_0x21c98e+=0x1){db[_0xf326('0x2d')][_0xf326('0x33')]({'where':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'type':_0xf326('0x34'),'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e],'exitAt':null},'defaults':{'channel':_0x1227d3,'membername':_0x45d344[_0xf326('0x2b')][_0xf326('0x10')],'interface':_[_0xf326('0x12')](_0x45d344[_0xf326('0x2b')][_0xf326('0x35')])?util[_0xf326('0x30')]('SIP/%s',_0x45d344[_0xf326('0x2b')][_0xf326('0x10')]):_0x45d344[_0xf326('0x2b')][_0xf326('0x35')],'type':'INTERACTION','enterAt':moment()[_0xf326('0x30')](_0xf326('0x31')),'role':_0xf326('0x36'),'internal':_0x45d344[_0xf326('0x2b')]['internal'],'uniqueid':_0x45d344[_0xf326('0x1e')][_0xf326('0x2a')][_0x1227d3][_0x21c98e]}});}}}}return respondWithRpcPromise(_0xf326('0x37'),{'id':_0x45d344[_0xf326('0x17')]['id'],'capacity':_0x45d344[_0xf326('0x1e')]['capacity']},routingClient)['then'](respondWithResult(_0x347e7b,null))[_0xf326('0xc')](handleError(_0x347e7b,null));};exports[_0xf326('0x38')]=function(_0x2ff126,_0x4cb25b){return respondWithRpcPromise(_0xf326('0x39'),_0x2ff126[_0xf326('0x16')])[_0xf326('0x8')](respondWithResult(_0x4cb25b,null))['catch'](handleError(_0x4cb25b,null));};exports['trunks']=function(_0x36ef89,_0x5b4832){return respondWithRpcPromise(_0xf326('0x3a'),_0x36ef89['query'])[_0xf326('0x8')](respondWithResult(_0x5b4832,null))[_0xf326('0xc')](handleError(_0x5b4832,null));};exports[_0xf326('0x3b')]=function(_0x25e091,_0x212594){return respondWithRpcPromise(_0xf326('0x3c'),_0x25e091[_0xf326('0x16')])['then'](respondWithResult(_0x212594,null))[_0xf326('0xc')](handleError(_0x212594,null));};exports[_0xf326('0x3d')]=function(_0x424d24,_0x4b0d8e){return respondWithRpcPromise(_0xf326('0x3e'),_0x424d24[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4b0d8e,null))[_0xf326('0xc')](handleError(_0x4b0d8e,null));};exports[_0xf326('0x3f')]=function(_0x58fcf0,_0x161fb3){return respondWithRpcPromise(_0xf326('0x3e'),_0x58fcf0[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x58fcf0['params']['id']))[_0xf326('0x8')](respondWithResult(_0x161fb3,null))[_0xf326('0xc')](handleError(_0x161fb3,null));};exports[_0xf326('0x40')]=function(_0x29e52e,_0x4d3b9e){return respondWithRpcPromise('MailQueues',_0x29e52e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x4d3b9e,null))['catch'](handleError(_0x4d3b9e,null));};exports[_0xf326('0x41')]=function(_0x29de71,_0x316609){return respondWithRpcPromise(_0xf326('0x42'),_0x29de71['query'],routingClient)[_0xf326('0x8')](findById(_0x29de71['params']['id']))['then'](respondWithResult(_0x316609,null))[_0xf326('0xc')](handleError(_0x316609,null));};exports['mailAccounts']=function(_0x173760,_0x52fb95){return respondWithRpcPromise(_0xf326('0x43'),_0x173760['query'],mailClient)['then'](respondWithResult(_0x52fb95,null))[_0xf326('0xc')](handleError(_0x52fb95,null));};exports[_0xf326('0x44')]=function(_0x33b259,_0x5d0177){return respondWithRpcPromise(_0xf326('0x45'),_0x33b259['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5d0177,null))[_0xf326('0xc')](handleError(_0x5d0177,null));};exports[_0xf326('0x46')]=function(_0x217897,_0xbd3a01){return respondWithRpcPromise(_0xf326('0x45'),_0x217897[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x217897[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0xbd3a01,null))[_0xf326('0xc')](handleError(_0xbd3a01,null));};exports[_0xf326('0x47')]=function(_0x40f7cb,_0x4ca1b8){return respondWithRpcPromise(_0xf326('0x48'),_0x40f7cb['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x4ca1b8,null))[_0xf326('0xc')](handleError(_0x4ca1b8,null));};exports['showSmsQueues']=function(_0x2b770c,_0x5283da){return respondWithRpcPromise(_0xf326('0x48'),_0x2b770c[_0xf326('0x16')],routingClient)[_0xf326('0x8')](findById(_0x2b770c[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x5283da,null))['catch'](handleError(_0x5283da,null));};exports['whatsappQueues']=function(_0x1209ca,_0x32fe3a){return respondWithRpcPromise(_0xf326('0x49'),_0x1209ca[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x32fe3a,null))['catch'](handleError(_0x32fe3a,null));};exports[_0xf326('0x4a')]=function(_0x471da8,_0x4aadc9){return respondWithRpcPromise('WhatsappQueues',_0x471da8['query'],routingClient)[_0xf326('0x8')](findById(_0x471da8[_0xf326('0x17')]['id']))[_0xf326('0x8')](respondWithResult(_0x4aadc9,null))[_0xf326('0xc')](handleError(_0x4aadc9,null));};exports[_0xf326('0x4b')]=function(_0x23a56e,_0x230aea){return respondWithRpcPromise('FaxQueues',_0x23a56e[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x230aea,null))[_0xf326('0xc')](handleError(_0x230aea,null));};exports[_0xf326('0x4c')]=function(_0x58de1e,_0x3717fe){return respondWithRpcPromise('FaxQueues',_0x58de1e['query'],routingClient)[_0xf326('0x8')](findById(_0x58de1e['params']['id']))[_0xf326('0x8')](respondWithResult(_0x3717fe,null))[_0xf326('0xc')](handleError(_0x3717fe,null));};exports[_0xf326('0x4d')]=function(_0x2ea5a2,_0x17cd36){return respondWithRpcPromise('FaxAccounts',_0x2ea5a2['query'])['then'](respondWithResult(_0x17cd36,null))[_0xf326('0xc')](handleError(_0x17cd36,null));};exports[_0xf326('0x4e')]=function(_0x229a34,_0x180616){return respondWithRpcPromise(_0xf326('0x4f'),_0x229a34['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x180616,null))[_0xf326('0xc')](handleError(_0x180616,null));};exports[_0xf326('0x50')]=function(_0x4f9a6a,_0x567492){return respondWithRpcPromise(_0xf326('0x51'),_0x4f9a6a[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x567492,null))['catch'](handleError(_0x567492,null));};exports[_0xf326('0x52')]=function(_0x5ba28d,_0xc3a897){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ba28d['query'],routingClient)['then'](respondWithResult(_0xc3a897,null))[_0xf326('0xc')](handleError(_0xc3a897,null));};exports[_0xf326('0x53')]=function(_0xd44071,_0x4838d5){return respondWithRpcPromise(_0xf326('0x54'),_0xd44071[_0xf326('0x16')],routingClient)[_0xf326('0x8')](function(_0x457f3d){if(_0xd44071[_0xf326('0x16')][_0xf326('0x55')]!==undefined){var _0x7f6d0e=_(_0x457f3d[_0xf326('0x13')])[_0xf326('0x56')]([_0xd44071['query'][_0xf326('0x55')],_0xd44071['params']['id']])[_0xf326('0x57')](_0xf326('0x58'))[_0xf326('0x59')]()['value']();return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x39c90d){return _0x7f6d0e['indexOf'](_0x39c90d[_0xf326('0x58')])>-0x1;});}else{return _0x457f3d[_0xf326('0x13')][_0xf326('0x56')](function(_0x42c7cf){return _0x42c7cf['queue_id']===parseInt(_0xd44071[_0xf326('0x17')]['id']);});}})['then'](respondWithResult(_0x4838d5,null))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x5a')]=function(_0x2c36d3,_0x5af6b7){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c36d3['query'],routingClient)[_0xf326('0x8')](respondWithResult(_0x5af6b7,null))['catch'](handleError(_0x5af6b7,null));};exports[_0xf326('0x5b')]=function(_0x37a564,_0x3434b2){return respondWithRpcPromise(_0xf326('0x5c'),_0x37a564[_0xf326('0x16')],routingClient)[_0xf326('0x8')](respondWithResult(_0x3434b2,null))['catch'](handleError(_0x3434b2,null));};exports[_0xf326('0x5d')]=function(_0x323926,_0x5f1724){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x323926[_0xf326('0x16')],routingClient)['then'](respondWithResult(_0x5f1724,null))[_0xf326('0xc')](handleError(_0x5f1724,null));};exports[_0xf326('0x5e')]=function(_0x153027){return function(_0x363e64,_0x19d676){var _0x6e662,_0x293600;var _0x8ca46f=_[_0xf326('0x5f')](_0x153027);var _0x499cbd=_0x153027===_0xf326('0x60')?_0xf326('0x61'):'Account';return db[_0x8ca46f+_0xf326('0x62')]['findOne']({'raw':!![],'where':{'id':_0x363e64[_0xf326('0x17')]['id']}})[_0xf326('0x8')](function(_0x14e8c0){if(_['isNil'](_0x14e8c0)){throw new Error(_0x8ca46f+_0xf326('0x63'));}_0x6e662=_0x14e8c0;return db[_0x8ca46f+_0xf326('0x64')][_0xf326('0x65')]({'where':{'id':_0x363e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x8ca46f+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x8ca46f+_0x499cbd],'as':_0xf326('0x68')}]});})[_0xf326('0x8')](function(_0x38b696){if(_[_0xf326('0x12')](_0x38b696)){throw new Error(_0x8ca46f+_0xf326('0x69'));}_0x293600=_0x38b696;return _0x38b696[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x1f990d={'uniqueid':_0x153027+'.'+_0x293600['id']+'.'+_0x293600['Interaction']['id'],'FromUserId':_0x363e64[_0xf326('0x2b')]['id'],'type':_0xf326('0x6b')};_0x1f990d[_0x8ca46f+'MessageId']=_0x293600['id'];_0x1f990d[_0x8ca46f+_0xf326('0x6c')]=_0x293600[_0xf326('0x67')]['id'];_0x1f990d['From'+_0x8ca46f+_0x499cbd+'Id']=_0x293600[_0xf326('0x68')]['id'];_0x1f990d['To'+_0x8ca46f+_0xf326('0x6d')]=_0x6e662['id'];return db[_0x8ca46f+_0xf326('0x6e')][_0xf326('0x6f')](_0x1f990d);})[_0xf326('0x8')](function(){return respondWithRpcPromise(_0xf326('0x70'),{'channel':_0x153027,'interaction':_0x293600[_0xf326('0x67')],'message':_0x293600,'account':_0x293600['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x6b'),'appdata':_0x6e662[_0xf326('0x10')]+','+(_0x293600[_0xf326('0x68')][_0xf326('0x71')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0x19d676,null))[_0xf326('0xc')](handleError(_0x19d676,null));};};exports[_0xf326('0x73')]=function(_0x486e64,_0xa8e05b){var _0x2e2103,_0x49c3da;if(_[_0xf326('0x12')](_0x486e64['body'][_0xf326('0x74')])){throw new Error(_0xf326('0x75'));}var _0x16bc97=_0x486e64[_0xf326('0x1e')][_0xf326('0x74')];var _0x3097cf=_[_0xf326('0x5f')](_0x16bc97);var _0x1eb29d=_0x16bc97===_0xf326('0x60')?_0xf326('0x61'):_0xf326('0x68');return db[_0xf326('0x76')][_0xf326('0x65')]({'raw':!![],'where':{'id':_0x486e64[_0xf326('0x17')]['id'],'role':'agent'}})[_0xf326('0x8')](function(_0xdb6e40){if(_[_0xf326('0x12')](_0xdb6e40)){throw new Error(_0xf326('0x77'));}_0x2e2103=_0xdb6e40;return db[_0x3097cf+_0xf326('0x64')]['findOne']({'where':{'id':_0x486e64[_0xf326('0x1e')][_0xf326('0x66')]},'include':[{'model':db[_0x3097cf+_0xf326('0x67')],'as':_0xf326('0x67')},{'model':db[_0x3097cf+_0x1eb29d],'as':_0xf326('0x68')}]});})['then'](function(_0x4b6ec0){if(_[_0xf326('0x12')](_0x4b6ec0)){throw new Error(_0x3097cf+'\x20Message\x20not\x20found');}_0x49c3da=_0x4b6ec0;return _0x4b6ec0[_0xf326('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xf326('0x8')](function(){var _0x29610a={'uniqueid':_0x16bc97+'.'+_0x49c3da['id']+'.'+_0x49c3da['Interaction']['id'],'FromUserId':_0x486e64['user']['id'],'type':_0xf326('0x6b'),'ToUserId':_0x2e2103['id']};_0x29610a[_0x3097cf+_0xf326('0x78')]=_0x49c3da['id'];_0x29610a[_0x3097cf+_0xf326('0x6c')]=_0x49c3da[_0xf326('0x67')]['id'];_0x29610a[_0xf326('0x79')+_0x3097cf+_0x1eb29d+'Id']=_0x49c3da['Account']['id'];return db[_0x3097cf+_0xf326('0x6e')][_0xf326('0x6f')](_0x29610a);})[_0xf326('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x16bc97,'interaction':_0x49c3da['Interaction'],'message':_0x49c3da,'account':_0x49c3da['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xf326('0x36'),'appdata':_0x2e2103[_0xf326('0x10')]+','+(_0x49c3da[_0xf326('0x68')][_0xf326('0x7a')]||0x12c),'interval':_0xf326('0x72')}]},routingClient);})[_0xf326('0x8')](respondWithResult(_0xa8e05b,null))[_0xf326('0xc')](handleError(_0xa8e05b,null));};
\ No newline at end of file
+var _0x814b=['whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','create','Start','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues'];(function(_0x2fbd6a,_0x1caade){var _0x320995=function(_0x3be6d3){while(--_0x3be6d3){_0x2fbd6a['push'](_0x2fbd6a['shift']());}};_0x320995(++_0x1caade);}(_0x814b,0x1a2));var _0xb814=function(_0x5aa4cc,_0x49d641){_0x5aa4cc=_0x5aa4cc-0x0;var _0x52b505=_0x814b[_0x5aa4cc];return _0x52b505;};'use strict';var BPromise=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var db=require(_0xb814('0x4'))['db'];var logger=require(_0xb814('0x5'))('api');var jayson=require(_0xb814('0x6'));var amiClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232a});var mailClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232b});var routingClient=jayson[_0xb814('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){var _0x186d5a=_0x5c8539?_0x5c8539:amiClient;return _0x186d5a[_0xb814('0x9')](_0x3b0829,_0x2e6272)[_0xb814('0xa')](function(_0x21d4a5){if(_0x21d4a5[_0xb814('0xb')]){if(_0x21d4a5[_0xb814('0xb')][_0xb814('0xc')]===0x1f4){return _0x2913a6(_0x21d4a5[_0xb814('0xb')][_0xb814('0xd')]);}return _0x271af9(_0x21d4a5['error'][_0xb814('0xd')]);}else{_0x271af9(_0x21d4a5['result']);}})[_0xb814('0xe')](function(_0x15d6ef){_0x2913a6(_0x15d6ef);});});}function respondWithResult(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xc8;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0xf')](_0x2cc46b)[_0xb814('0x10')](_0x2ce718);}return _0x35b10d[_0xb814('0x11')](0x194);};}function handleError(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0x1f4;return function(_0x3f4881){logger[_0xb814('0xb')](_0x3f4881[_0xb814('0x12')]);if(_0x3f4881[_0xb814('0x13')]){delete _0x3f4881[_0xb814('0x13')];}_0xa0a2e5[_0xb814('0xf')](_0x2ab627)[_0xb814('0x14')](_0x3f4881);};}function findById(_0x265a83){return function(_0x125ce2){if(!_[_0xb814('0x15')](_0x265a83)&&!_[_0xb814('0x15')](_0x125ce2)&&!_['isNil'](_0x125ce2[_0xb814('0x16')])){return _['find'](_0x125ce2[_0xb814('0x16')],function(_0xfac75b){return _0xfac75b['id']==_0x265a83;});}return null;};}exports['voiceChannels']=function(_0x4b55a7,_0x55d63c){return respondWithRpcPromise(_0xb814('0x17'),_0x4b55a7['query'])['then'](respondWithResult(_0x55d63c,null))[_0xb814('0xe')](handleError(_0x55d63c,null));};exports[_0xb814('0x18')]=function(_0x25b6b6,_0x4e139e){return respondWithRpcPromise(_0xb814('0x19'),_['merge'](_0x25b6b6[_0xb814('0x1a')],_0x25b6b6[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4e139e,null))[_0xb814('0xe')](handleError(_0x4e139e,null));};exports[_0xb814('0x1c')]=function(_0x2bd039,_0x1f5d40){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xb814('0x1d')](_0x2bd039['query'],_0x2bd039[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1f5d40,null))[_0xb814('0xe')](handleError(_0x1f5d40,null));};exports[_0xb814('0x1e')]=function(_0x1c8a2e,_0xb9e57d){return respondWithRpcPromise(_0xb814('0x1f'),_0x1c8a2e['query'])[_0xb814('0xa')](respondWithResult(_0xb9e57d,null))[_0xb814('0xe')](handleError(_0xb9e57d,null));};exports[_0xb814('0x20')]=function(_0x349394,_0x32ed56){return respondWithRpcPromise(_0xb814('0x1f'),_0x349394[_0xb814('0x1a')])[_0xb814('0xa')](findById(_0x349394['params']['id']))[_0xb814('0xa')](respondWithResult(_0x32ed56,null))[_0xb814('0xe')](handleError(_0x32ed56,null));};exports['updateVoiceQueue']=function(_0x9008b2,_0x37d24d){return respondWithRpcPromise(_0xb814('0x21'),_['merge'](_0x9008b2[_0xb814('0x22')],_0x9008b2[_0xb814('0x1b')]))['then'](respondWithResult(_0x37d24d,null))[_0xb814('0xe')](handleError(_0x37d24d,null));};exports['voiceQueuesPreview']=function(_0x6efe9a,_0x5f3e9b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xb814('0x1d')](_0x6efe9a['query'],_0x6efe9a[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x5f3e9b,null))[_0xb814('0xe')](handleError(_0x5f3e9b,null));};exports['voiceQueuesChannels']=function(_0x51d5ae,_0x26d3a9){return respondWithRpcPromise(_0xb814('0x23'),_0x51d5ae['query'])[_0xb814('0xa')](respondWithResult(_0x26d3a9,null))[_0xb814('0xe')](handleError(_0x26d3a9,null));};exports[_0xb814('0x24')]=function(_0x217b7e,_0x1b78de){return respondWithRpcPromise(_0xb814('0x25'),_[_0xb814('0x1d')](_0x217b7e['query'],_0x217b7e[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1b78de,null))[_0xb814('0xe')](handleError(_0x1b78de,null));};exports[_0xb814('0x26')]=function(_0x14100d,_0x4ff31a){return respondWithRpcPromise(_0xb814('0x27'),_['merge'](_0x14100d[_0xb814('0x1a')],_0x14100d[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ff31a,null))['catch'](handleError(_0x4ff31a,null));};exports[_0xb814('0x28')]=function(_0xbdb3e9,_0x4ea6f8){return respondWithRpcPromise(_0xb814('0x29'),_[_0xb814('0x1d')](_0xbdb3e9[_0xb814('0x1a')],_0xbdb3e9[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ea6f8,null))[_0xb814('0xe')](handleError(_0x4ea6f8,null));};exports['outbound']=function(_0xa6ce87,_0x4e4684){return respondWithRpcPromise(_0xb814('0x2a'),_0xa6ce87['query'])[_0xb814('0xa')](respondWithResult(_0x4e4684,null))['catch'](handleError(_0x4e4684,null));};exports[_0xb814('0x2b')]=function(_0x26675a,_0x54a7fb){return respondWithRpcPromise('OutboundChannels',_0x26675a['query'])['then'](respondWithResult(_0x54a7fb,null))[_0xb814('0xe')](handleError(_0x54a7fb,null));};exports[_0xb814('0x2c')]=function(_0x38cdc2,_0x42c2ed){var _0x51cdba;return respondWithRpcPromise('Agents',_0x38cdc2[_0xb814('0x1a')])['then'](function(_0x2a93da){_0x51cdba=_0x2a93da;return respondWithRpcPromise(_0xb814('0x2d'),_0x38cdc2[_0xb814('0x1a')],routingClient);})[_0xb814('0xa')](function(_0x42653f){return _[_0xb814('0x1d')]({},_0x42653f,_0x51cdba);})[_0xb814('0xa')](respondWithResult(_0x42c2ed,null))[_0xb814('0xe')](handleError(_0x42c2ed,null));};exports[_0xb814('0x2e')]=function(_0x4b6ff8,_0x544d36){if(_0x4b6ff8['body']&&_0x4b6ff8[_0xb814('0x22')]['interaction']&&_0x4b6ff8[_0xb814('0x2f')]&&_0x4b6ff8['user'][_0xb814('0x13')]){for(var _0x44ff56 in _0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')]){if(_0x4b6ff8['body'][_0xb814('0x30')][_0xb814('0x31')](_0x44ff56)){db[_0xb814('0x32')][_0xb814('0x33')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]&&_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')]?{'$notIn':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]}:{'$ne':null}}})['then'](function(_0x4a5e84){var _0xe751c3=moment()[_0xb814('0x35')](_0xb814('0x36'));for(var _0x2bf906=0x0,_0x43f1b=_0x4a5e84[_0xb814('0x34')];_0x2bf906<_0x43f1b;_0x2bf906+=0x1){_0x4a5e84[_0x2bf906][_0xb814('0x37')]({'exitAt':_0xe751c3});}});for(var _0x40af85=0x0;_0x40af85<_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')];_0x40af85+=0x1){db['MemberReport'][_0xb814('0x38')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')]['name'],'type':_0xb814('0x39'),'uniqueid':_0x4b6ff8['body'][_0xb814('0x30')][_0x44ff56][_0x40af85],'exitAt':null},'defaults':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'interface':_[_0xb814('0x15')](_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3a')])?util[_0xb814('0x35')](_0xb814('0x3b'),_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')]):_0x4b6ff8['user']['interface'],'type':_0xb814('0x39'),'enterAt':moment()[_0xb814('0x35')](_0xb814('0x36')),'role':_0xb814('0x3c'),'internal':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3d')],'uniqueid':_0x4b6ff8[_0xb814('0x22')]['interaction'][_0x44ff56][_0x40af85]}});}}}}return respondWithRpcPromise(_0xb814('0x3e'),{'id':_0x4b6ff8[_0xb814('0x1b')]['id'],'capacity':_0x4b6ff8[_0xb814('0x22')]['capacity']},routingClient)[_0xb814('0xa')](respondWithResult(_0x544d36,null))['catch'](handleError(_0x544d36,null));};exports[_0xb814('0x3f')]=function(_0x5dc28e,_0x403872){return respondWithRpcPromise(_0xb814('0x40'),_0x5dc28e['query'])[_0xb814('0xa')](respondWithResult(_0x403872,null))[_0xb814('0xe')](handleError(_0x403872,null));};exports[_0xb814('0x41')]=function(_0x5209d1,_0x3da050){return respondWithRpcPromise('Trunks',_0x5209d1[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x3da050,null))['catch'](handleError(_0x3da050,null));};exports[_0xb814('0x42')]=function(_0x4a3f84,_0x539be7){return respondWithRpcPromise(_0xb814('0x43'),_0x4a3f84[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x539be7,null))['catch'](handleError(_0x539be7,null));};exports[_0xb814('0x44')]=function(_0x538b0f,_0xf88d23){return respondWithRpcPromise(_0xb814('0x45'),_0x538b0f['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0xf88d23,null))['catch'](handleError(_0xf88d23,null));};exports[_0xb814('0x46')]=function(_0x1656ed,_0xb2bd82){return respondWithRpcPromise(_0xb814('0x45'),_0x1656ed[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x1656ed[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0xb2bd82,null))['catch'](handleError(_0xb2bd82,null));};exports[_0xb814('0x47')]=function(_0x5441c5,_0x5d71d5){return respondWithRpcPromise(_0xb814('0x48'),_0x5441c5[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x5d71d5,null))[_0xb814('0xe')](handleError(_0x5d71d5,null));};exports['showMailQueues']=function(_0x48362c,_0x2114ca){return respondWithRpcPromise('MailQueues',_0x48362c[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x48362c[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x2114ca,null))[_0xb814('0xe')](handleError(_0x2114ca,null));};exports['mailAccounts']=function(_0x2ef77d,_0x1e9196){return respondWithRpcPromise(_0xb814('0x49'),_0x2ef77d[_0xb814('0x1a')],mailClient)[_0xb814('0xa')](respondWithResult(_0x1e9196,null))[_0xb814('0xe')](handleError(_0x1e9196,null));};exports[_0xb814('0x4a')]=function(_0x113350,_0x46014f){return respondWithRpcPromise('OpenchannelQueues',_0x113350[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x46014f,null))[_0xb814('0xe')](handleError(_0x46014f,null));};exports[_0xb814('0x4b')]=function(_0x3b35a8,_0x3d4843){return respondWithRpcPromise('OpenchannelQueues',_0x3b35a8[_0xb814('0x1a')],routingClient)['then'](findById(_0x3b35a8[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x3d4843,null))[_0xb814('0xe')](handleError(_0x3d4843,null));};exports['smsQueues']=function(_0x150e73,_0x579351){return respondWithRpcPromise(_0xb814('0x4c'),_0x150e73['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x579351,null))[_0xb814('0xe')](handleError(_0x579351,null));};exports[_0xb814('0x4d')]=function(_0x1b024f,_0x3377d4){return respondWithRpcPromise(_0xb814('0x4c'),_0x1b024f[_0xb814('0x1a')],routingClient)['then'](findById(_0x1b024f[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3377d4,null))[_0xb814('0xe')](handleError(_0x3377d4,null));};exports[_0xb814('0x4e')]=function(_0x1b989d,_0x3dcaeb){return respondWithRpcPromise(_0xb814('0x4f'),_0x1b989d[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x3dcaeb,null))[_0xb814('0xe')](handleError(_0x3dcaeb,null));};exports[_0xb814('0x50')]=function(_0x4a49ba,_0x3bb2b4){return respondWithRpcPromise(_0xb814('0x4f'),_0x4a49ba[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x4a49ba[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3bb2b4,null))[_0xb814('0xe')](handleError(_0x3bb2b4,null));};exports['faxQueues']=function(_0x24594a,_0x16f8f2){return respondWithRpcPromise(_0xb814('0x51'),_0x24594a[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x16f8f2,null))[_0xb814('0xe')](handleError(_0x16f8f2,null));};exports['showFaxQueues']=function(_0x506bf2,_0x5d064b){return respondWithRpcPromise(_0xb814('0x51'),_0x506bf2['query'],routingClient)[_0xb814('0xa')](findById(_0x506bf2[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x5d064b,null))['catch'](handleError(_0x5d064b,null));};exports[_0xb814('0x52')]=function(_0x3e5ce8,_0xee204){return respondWithRpcPromise('FaxAccounts',_0x3e5ce8[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0xee204,null))[_0xb814('0xe')](handleError(_0xee204,null));};exports[_0xb814('0x53')]=function(_0x555be0,_0x5dedd7){return respondWithRpcPromise(_0xb814('0x54'),_0x555be0[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5dedd7,null))[_0xb814('0xe')](handleError(_0x5dedd7,null));};exports[_0xb814('0x55')]=function(_0xe5fc12,_0x34a0b3){return respondWithRpcPromise(_0xb814('0x56'),_0xe5fc12[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x34a0b3,null))[_0xb814('0xe')](handleError(_0x34a0b3,null));};exports[_0xb814('0x57')]=function(_0x3ef474,_0x21fc41){return respondWithRpcPromise(_0xb814('0x58'),_0x3ef474['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x21fc41,null))[_0xb814('0xe')](handleError(_0x21fc41,null));};exports[_0xb814('0x59')]=function(_0x357b90,_0xec821a){return respondWithRpcPromise(_0xb814('0x58'),_0x357b90['query'],routingClient)[_0xb814('0xa')](function(_0x52e1fc){if(_0x357b90[_0xb814('0x1a')][_0xb814('0x5a')]!==undefined){var _0x3c5a58=_(_0x52e1fc[_0xb814('0x16')])[_0xb814('0x5b')]([_0x357b90['query']['type'],_0x357b90[_0xb814('0x1b')]['id']])[_0xb814('0x5c')](_0xb814('0x5d'))[_0xb814('0x5e')]()['value']();return _0x52e1fc[_0xb814('0x16')]['filter'](function(_0x39073c){return _0x3c5a58[_0xb814('0x5f')](_0x39073c['queue_id'])>-0x1;});}else{return _0x52e1fc['rows'][_0xb814('0x5b')](function(_0x52e17a){return _0x52e17a[_0xb814('0x5d')]===parseInt(_0x357b90[_0xb814('0x1b')]['id']);});}})[_0xb814('0xa')](respondWithResult(_0xec821a,null))[_0xb814('0xe')](handleError(_0xec821a,null));};exports[_0xb814('0x60')]=function(_0x420bde,_0x40fe4a){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x420bde[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x40fe4a,null))[_0xb814('0xe')](handleError(_0x40fe4a,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2838cb,_0x43ee60){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2838cb[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x43ee60,null))[_0xb814('0xe')](handleError(_0x43ee60,null));};exports[_0xb814('0x61')]=function(_0x4e15c2,_0x5a0c4a){return respondWithRpcPromise(_0xb814('0x62'),_0x4e15c2[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5a0c4a,null))[_0xb814('0xe')](handleError(_0x5a0c4a,null));};exports[_0xb814('0x63')]=function(_0x4394da){return function(_0x2b12a9,_0x314600){var _0x8cb107,_0x34f49c;var _0x53e705=_['capitalize'](_0x4394da);var _0x5bee4d=_0x4394da==='chat'?'Website':_0xb814('0x64');return db[_0x53e705+_0xb814('0x65')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x2b12a9['params']['id']}})[_0xb814('0xa')](function(_0x1fb1ea){if(_[_0xb814('0x15')](_0x1fb1ea)){throw new Error(_0x53e705+_0xb814('0x67'));}_0x8cb107=_0x1fb1ea;return db[_0x53e705+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x2b12a9[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x53e705+'Interaction'],'as':_0xb814('0x6a')},{'model':db[_0x53e705+_0x5bee4d],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x30faa0){if(_['isNil'](_0x30faa0)){throw new Error(_0x53e705+_0xb814('0x6b'));}_0x34f49c=_0x30faa0;return _0x30faa0[_0xb814('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3037f2={'uniqueid':_0x4394da+'.'+_0x34f49c['id']+'.'+_0x34f49c[_0xb814('0x6a')]['id'],'FromUserId':_0x2b12a9['user']['id'],'type':'queue'};_0x3037f2[_0x53e705+_0xb814('0x6d')]=_0x34f49c['id'];_0x3037f2[_0x53e705+'InteractionId']=_0x34f49c[_0xb814('0x6a')]['id'];_0x3037f2[_0xb814('0x6e')+_0x53e705+_0x5bee4d+'Id']=_0x34f49c['Account']['id'];_0x3037f2['To'+_0x53e705+_0xb814('0x6f')]=_0x8cb107['id'];return db[_0x53e705+'TransferReport'][_0xb814('0x70')](_0x3037f2);})['then'](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x4394da,'interaction':_0x34f49c[_0xb814('0x6a')],'message':_0x34f49c,'account':_0x34f49c[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x72'),'appdata':_0x8cb107[_0xb814('0x13')]+','+(_0x34f49c[_0xb814('0x64')][_0xb814('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x314600,null))[_0xb814('0xe')](handleError(_0x314600,null));};};exports['agentNotify']=function(_0x511e03,_0x2d0061){var _0x8fbda1,_0x25d42d;if(_['isNil'](_0x511e03[_0xb814('0x22')]['channel'])){throw new Error(_0xb814('0x74'));}var _0x19d508=_0x511e03[_0xb814('0x22')][_0xb814('0x75')];var _0x4c8a00=_[_0xb814('0x76')](_0x19d508);var _0xc0ff3c=_0x19d508===_0xb814('0x77')?'Website':_0xb814('0x64');return db[_0xb814('0x78')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x511e03['params']['id'],'role':_0xb814('0x3c')}})[_0xb814('0xa')](function(_0x9dc06b){if(_[_0xb814('0x15')](_0x9dc06b)){throw new Error(_0xb814('0x79'));}_0x8fbda1=_0x9dc06b;return db[_0x4c8a00+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x511e03[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x4c8a00+_0xb814('0x6a')],'as':_0xb814('0x6a')},{'model':db[_0x4c8a00+_0xc0ff3c],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x5b8d2e){if(_['isNil'](_0x5b8d2e)){throw new Error(_0x4c8a00+_0xb814('0x6b'));}_0x25d42d=_0x5b8d2e;return _0x5b8d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3949fd={'uniqueid':_0x19d508+'.'+_0x25d42d['id']+'.'+_0x25d42d[_0xb814('0x6a')]['id'],'FromUserId':_0x511e03[_0xb814('0x2f')]['id'],'type':_0xb814('0x72'),'ToUserId':_0x8fbda1['id']};_0x3949fd[_0x4c8a00+_0xb814('0x6d')]=_0x25d42d['id'];_0x3949fd[_0x4c8a00+_0xb814('0x7a')]=_0x25d42d['Interaction']['id'];_0x3949fd['From'+_0x4c8a00+_0xc0ff3c+'Id']=_0x25d42d[_0xb814('0x64')]['id'];return db[_0x4c8a00+'TransferReport'][_0xb814('0x70')](_0x3949fd);})[_0xb814('0xa')](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x19d508,'interaction':_0x25d42d['Interaction'],'message':_0x25d42d,'account':_0x25d42d[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x3c'),'appdata':_0x8fbda1[_0xb814('0x13')]+','+(_0x25d42d[_0xb814('0x64')][_0xb814('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb814('0xa')](respondWithResult(_0x2d0061,null))[_0xb814('0xe')](handleError(_0x2d0061,null));};
\ No newline at end of file
index eebe7db..11ed7cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0684=['get','show','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x5c9bdb,_0x9127a6){var _0x1cb371=function(_0x3ef526){while(--_0x3ef526){_0x5c9bdb['push'](_0x5c9bdb['shift']());}};_0x1cb371(++_0x9127a6);}(_0x0684,0x1b9));var _0x4068=function(_0x227398,_0x2e35bc){_0x227398=_0x227398-0x0;var _0x2095cb=_0x0684[_0x227398];return _0x2095cb;};'use strict';var multer=require(_0x4068('0x0'));var util=require('util');var path=require(_0x4068('0x1'));var timeout=require(_0x4068('0x2'));var express=require(_0x4068('0x3'));var router=express['Router']();var fs_extra=require(_0x4068('0x4'));var auth=require(_0x4068('0x5'));var interaction=require(_0x4068('0x6'));var config=require(_0x4068('0x7'));var controller=require('./schedule.controller');router['get']('/',auth[_0x4068('0x8')](),controller['index']);router[_0x4068('0x9')]('/:id',auth[_0x4068('0x8')](),controller[_0x4068('0xa')]);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x4068('0xb')]('/',auth[_0x4068('0x8')](),controller[_0x4068('0xc')]);router[_0x4068('0xd')](_0x4068('0xe'),auth[_0x4068('0x8')](),controller['update']);router[_0x4068('0xf')](_0x4068('0xe'),auth[_0x4068('0x8')](),controller[_0x4068('0x10')]);module[_0x4068('0x11')]=router;
\ No newline at end of file
+var _0x4289=['./schedule.controller','isAuthenticated','index','/:id','show','get','run','post','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x18a1a6,_0x49d08f){var _0x2bf094=function(_0x1d4f58){while(--_0x1d4f58){_0x18a1a6['push'](_0x18a1a6['shift']());}};_0x2bf094(++_0x49d08f);}(_0x4289,0x1c2));var _0x9428=function(_0x3eaf26,_0x3956bd){_0x3eaf26=_0x3eaf26-0x0;var _0x427c0c=_0x4289[_0x3eaf26];return _0x427c0c;};'use strict';var multer=require(_0x9428('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9428('0x1')]();var fs_extra=require(_0x9428('0x2'));var auth=require(_0x9428('0x3'));var interaction=require(_0x9428('0x4'));var config=require(_0x9428('0x5'));var controller=require(_0x9428('0x6'));router['get']('/',auth[_0x9428('0x7')](),controller[_0x9428('0x8')]);router['get'](_0x9428('0x9'),auth[_0x9428('0x7')](),controller[_0x9428('0xa')]);router[_0x9428('0xb')]('/:id/run',auth['isAuthenticated'](),controller[_0x9428('0xc')]);router[_0x9428('0xd')]('/',auth[_0x9428('0x7')](),controller['create']);router[_0x9428('0xe')](_0x9428('0x9'),auth[_0x9428('0x7')](),controller[_0x9428('0xf')]);router[_0x9428('0x10')]('/:id',auth[_0x9428('0x7')](),controller[_0x9428('0x11')]);module[_0x9428('0x12')]=router;
\ No newline at end of file
index bfbbe4c..d2a9300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc326=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','csv','pdf','xlsx'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc326,0x133));var _0x6c32=function(_0x3e064b,_0x256015){_0x3e064b=_0x3e064b-0x0;var _0x23647e=_0xc326[_0x3e064b];return _0x23647e;};'use strict';var Sequelize=require(_0x6c32('0x0'));module[_0x6c32('0x1')]={'name':{'type':Sequelize[_0x6c32('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6c32('0x2')]},'active':{'type':Sequelize[_0x6c32('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6c32('0x2')],'allowNull':![],'defaultValue':_0x6c32('0x4')},'startAt':{'type':Sequelize[_0x6c32('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6c32('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6c32('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6c32('0x7')]('years',_0x6c32('0x8'),_0x6c32('0x9'),_0x6c32('0xa'),_0x6c32('0xb'),_0x6c32('0xc'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x6c32('0x7')](_0x6c32('0xd'),_0x6c32('0xe'),_0x6c32('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x6c32('0x7')](_0x6c32('0x10'),_0x6c32('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x6c32('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6c32('0x2')]},'cc':{'type':Sequelize[_0x6c32('0x12')]},'bcc':{'type':Sequelize[_0x6c32('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x6c32('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2058=['pdf','xlsx','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','months','weeks','days','hours','minutes','ENUM','csv'];(function(_0x5a594d,_0x5cd018){var _0x45a07e=function(_0x3a63de){while(--_0x3a63de){_0x5a594d['push'](_0x5a594d['shift']());}};_0x45a07e(++_0x5cd018);}(_0x2058,0xb4));var _0x8205=function(_0x3f042c,_0x3d2cfe){_0x3f042c=_0x3f042c-0x0;var _0x280d2e=_0x2058[_0x3f042c];return _0x280d2e;};'use strict';var Sequelize=require('sequelize');module[_0x8205('0x0')]={'name':{'type':Sequelize[_0x8205('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8205('0x1')]},'active':{'type':Sequelize[_0x8205('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8205('0x1')],'allowNull':![],'defaultValue':_0x8205('0x3')},'startAt':{'type':Sequelize[_0x8205('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8205('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters',_0x8205('0x5'),_0x8205('0x6'),_0x8205('0x7'),_0x8205('0x8'),_0x8205('0x9')),'allowNull':![],'defaultValue':_0x8205('0x7')},'output':{'type':Sequelize[_0x8205('0xa')](_0x8205('0xb'),_0x8205('0xc'),_0x8205('0xd')),'allowNull':![],'defaultValue':_0x8205('0xb')},'type':{'type':Sequelize[_0x8205('0xa')](_0x8205('0xe'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8205('0x1')]},'cc':{'type':Sequelize[_0x8205('0xf')]},'bcc':{'type':Sequelize[_0x8205('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x8205('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 39a54fd..5950eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbcc=['type','key','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','Schedule','includeAll','findAll','rows','catch','show','keys','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','../../config/schedule','run','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName'];(function(_0x224ee1,_0x3361bc){var _0xa84cef=function(_0x35b854){while(--_0x35b854){_0x224ee1['push'](_0x224ee1['shift']());}};_0xa84cef(++_0x3361bc);}(_0xfbcc,0x78));var _0xcfbc=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0xfbcc[_0x1f7201];return _0x289fd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcfbc('0x0'));var zipdir=require(_0xcfbc('0x1'));var jsonpatch=require(_0xcfbc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfbc('0x3'));var Mustache=require('mustache');var util=require(_0xcfbc('0x4'));var path=require(_0xcfbc('0x5'));var sox=require(_0xcfbc('0x6'));var csv=require(_0xcfbc('0x7'));var ejs=require(_0xcfbc('0x8'));var fs=require('fs');var fs_extra=require(_0xcfbc('0x9'));var _=require('lodash');var squel=require(_0xcfbc('0xa'));var crypto=require(_0xcfbc('0xb'));var jsforce=require(_0xcfbc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcfbc('0x7'));var querystring=require('querystring');var Papa=require(_0xcfbc('0xd'));var Redis=require(_0xcfbc('0xe'));var authService=require(_0xcfbc('0xf'));var qs=require(_0xcfbc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcfbc('0x11'));var logger=require(_0xcfbc('0x12'))(_0xcfbc('0x13'));var utils=require(_0xcfbc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcfbc('0x15'))['db'];function respondWithStatusCode(_0x93a07b,_0x56373c){_0x56373c=_0x56373c||0xcc;return function(_0x4b2f2c){if(_0x4b2f2c){return _0x93a07b[_0xcfbc('0x16')](_0x56373c);}return _0x93a07b[_0xcfbc('0x17')](_0x56373c)['end']();};}function respondWithResult(_0x47eb79,_0x4a712e){_0x4a712e=_0x4a712e||0xc8;return function(_0x2c7d00){if(_0x2c7d00){return _0x47eb79[_0xcfbc('0x17')](_0x4a712e)['json'](_0x2c7d00);}};}function respondWithFilteredResult(_0x253187,_0x1449ce){return function(_0x5bc981){if(_0x5bc981){var _0x5eaa87=typeof _0x1449ce[_0xcfbc('0x18')]===_0xcfbc('0x19')&&typeof _0x1449ce[_0xcfbc('0x1a')]==='undefined';var _0x4f79be=_0x5bc981['count'];var _0x4c0487=_0x5eaa87?0x0:_0x1449ce[_0xcfbc('0x18')];var _0x3b0eae=_0x5eaa87?_0x5bc981[_0xcfbc('0x1b')]:_0x1449ce[_0xcfbc('0x18')]+_0x1449ce[_0xcfbc('0x1a')];var _0x4c64fd;if(_0x3b0eae>=_0x4f79be){_0x3b0eae=_0x4f79be;_0x4c64fd=0xc8;}else{_0x4c64fd=0xce;}_0x253187[_0xcfbc('0x17')](_0x4c64fd);return _0x253187[_0xcfbc('0x1c')](_0xcfbc('0x1d'),_0x4c0487+'-'+_0x3b0eae+'/'+_0x4f79be)[_0xcfbc('0x1e')](_0x5bc981);}return null;};}function patchUpdates(_0x18926e){return function(_0x24c89a){try{jsonpatch[_0xcfbc('0x1f')](_0x24c89a,_0x18926e,!![]);}catch(_0x465c3c){return BPromise[_0xcfbc('0x20')](_0x465c3c);}return _0x24c89a[_0xcfbc('0x21')]();};}function saveUpdates(_0x523161,_0x4a0c42){return function(_0x159a28){if(_0x159a28){return _0x159a28[_0xcfbc('0x22')](_0x523161)[_0xcfbc('0x23')](function(_0xb7f2d0){return _0xb7f2d0;});}return null;};}function removeEntity(_0x26fff3,_0x59a7ff){return function(_0x4da5b4){if(_0x4da5b4){return _0x4da5b4[_0xcfbc('0x24')]()['then'](function(){var _0x4cd443=_0x4da5b4[_0xcfbc('0x25')]({'plain':!![]});var _0x1e110b=_0xcfbc('0x26');return db[_0xcfbc('0x27')][_0xcfbc('0x24')]({'where':{'type':_0x1e110b,'resourceId':_0x4cd443['id']}})['then'](function(){return _0x4da5b4;});})[_0xcfbc('0x23')](function(){_0x26fff3[_0xcfbc('0x17')](0xcc)[_0xcfbc('0x28')]();});}};}function handleEntityNotFound(_0x3c7ba6,_0x1366d3){return function(_0x18c925){if(!_0x18c925){_0x3c7ba6['sendStatus'](0x194);}return _0x18c925;};}function handleError(_0x57c141,_0x544db3){_0x544db3=_0x544db3||0x1f4;return function(_0xc65ee2){logger[_0xcfbc('0x29')](_0xc65ee2[_0xcfbc('0x2a')]);if(_0xc65ee2[_0xcfbc('0x2b')]){delete _0xc65ee2['name'];}_0x57c141[_0xcfbc('0x17')](_0x544db3)['send'](_0xc65ee2);};}exports[_0xcfbc('0x2c')]=function(_0x1b2b58,_0x1e1276){var _0x3398a5={},_0x4bf601={},_0x374a08={'count':0x0,'rows':[]};var _0x4a7454=_[_0xcfbc('0x2d')](db['Schedule'][_0xcfbc('0x2e')],function(_0x553500){return{'name':_0x553500[_0xcfbc('0x2f')],'type':_0x553500[_0xcfbc('0x30')][_0xcfbc('0x31')]};});_0x4bf601[_0xcfbc('0x32')]=_['map'](_0x4a7454,_0xcfbc('0x2b'));_0x4bf601[_0xcfbc('0x33')]=_['keys'](_0x1b2b58[_0xcfbc('0x33')]);_0x4bf601[_0xcfbc('0x34')]=_['intersection'](_0x4bf601[_0xcfbc('0x32')],_0x4bf601[_0xcfbc('0x33')]);_0x3398a5[_0xcfbc('0x35')]=_['intersection'](_0x4bf601[_0xcfbc('0x32')],qs[_0xcfbc('0x36')](_0x1b2b58[_0xcfbc('0x33')][_0xcfbc('0x36')]));_0x3398a5[_0xcfbc('0x35')]=_0x3398a5['attributes'][_0xcfbc('0x37')]?_0x3398a5[_0xcfbc('0x35')]:_0x4bf601[_0xcfbc('0x32')];if(!_0x1b2b58[_0xcfbc('0x33')]['hasOwnProperty'](_0xcfbc('0x38'))){_0x3398a5[_0xcfbc('0x1a')]=qs['limit'](_0x1b2b58[_0xcfbc('0x33')][_0xcfbc('0x1a')]);_0x3398a5['offset']=qs[_0xcfbc('0x18')](_0x1b2b58[_0xcfbc('0x33')][_0xcfbc('0x18')]);}_0x3398a5[_0xcfbc('0x39')]=qs[_0xcfbc('0x3a')](_0x1b2b58[_0xcfbc('0x33')][_0xcfbc('0x3a')]);_0x3398a5[_0xcfbc('0x3b')]=qs[_0xcfbc('0x34')](_[_0xcfbc('0x3c')](_0x1b2b58['query'],_0x4bf601[_0xcfbc('0x34')]),_0x4a7454);if(_0x1b2b58['query'][_0xcfbc('0x3d')]){_0x3398a5[_0xcfbc('0x3b')]=_[_0xcfbc('0x3e')](_0x3398a5['where'],{'$or':_[_0xcfbc('0x2d')](_0x4a7454,function(_0x18ccc0){if(_0x18ccc0[_0xcfbc('0x30')]!=='VIRTUAL'){var _0x36e5a1={};_0x36e5a1[_0x18ccc0[_0xcfbc('0x2b')]]={'$like':'%'+_0x1b2b58['query'][_0xcfbc('0x3d')]+'%'};return _0x36e5a1;}})});}_0x3398a5=_['merge']({},_0x3398a5,_0x1b2b58[_0xcfbc('0x3f')]);var _0xb3cb48={'where':_0x3398a5[_0xcfbc('0x3b')]};return db[_0xcfbc('0x40')][_0xcfbc('0x1b')](_0xb3cb48)[_0xcfbc('0x23')](function(_0x1aa638){_0x374a08[_0xcfbc('0x1b')]=_0x1aa638;if(_0x1b2b58[_0xcfbc('0x33')][_0xcfbc('0x41')]){_0x3398a5['include']=[{'all':!![]}];}return db[_0xcfbc('0x40')][_0xcfbc('0x42')](_0x3398a5);})[_0xcfbc('0x23')](function(_0x5296a1){_0x374a08[_0xcfbc('0x43')]=_0x5296a1;return _0x374a08;})['then'](respondWithFilteredResult(_0x1e1276,_0x3398a5))[_0xcfbc('0x44')](handleError(_0x1e1276,null));};exports[_0xcfbc('0x45')]=function(_0x5eff69,_0x489909){var _0x108e79={'raw':![],'where':{'id':_0x5eff69['params']['id']}},_0x22bbd3={};_0x22bbd3[_0xcfbc('0x32')]=_[_0xcfbc('0x46')](db[_0xcfbc('0x40')][_0xcfbc('0x2e')]);_0x22bbd3[_0xcfbc('0x33')]=_[_0xcfbc('0x46')](_0x5eff69['query']);_0x22bbd3[_0xcfbc('0x34')]=_[_0xcfbc('0x47')](_0x22bbd3[_0xcfbc('0x32')],_0x22bbd3[_0xcfbc('0x33')]);_0x108e79[_0xcfbc('0x35')]=_['intersection'](_0x22bbd3[_0xcfbc('0x32')],qs[_0xcfbc('0x36')](_0x5eff69[_0xcfbc('0x33')][_0xcfbc('0x36')]));_0x108e79[_0xcfbc('0x35')]=_0x108e79[_0xcfbc('0x35')]['length']?_0x108e79[_0xcfbc('0x35')]:_0x22bbd3[_0xcfbc('0x32')];if(_0x5eff69[_0xcfbc('0x33')][_0xcfbc('0x41')]){_0x108e79['include']=[{'all':!![]}];}_0x108e79=_[_0xcfbc('0x3e')]({},_0x108e79,_0x5eff69[_0xcfbc('0x3f')]);return db[_0xcfbc('0x40')]['find'](_0x108e79)[_0xcfbc('0x23')](handleEntityNotFound(_0x489909,null))[_0xcfbc('0x23')](respondWithResult(_0x489909,null))[_0xcfbc('0x44')](handleError(_0x489909,null));};exports[_0xcfbc('0x48')]=function(_0x5846d0,_0x480193){return db['Schedule'][_0xcfbc('0x48')](_0x5846d0[_0xcfbc('0x49')],{})[_0xcfbc('0x23')](function(_0x534399){var _0xd3001f=_0x5846d0[_0xcfbc('0x4a')]['get']({'plain':!![]});if(!_0xd3001f)throw new Error(_0xcfbc('0x4b'));if(_0xd3001f['role']===_0xcfbc('0x4a')){var _0x2cab1e=_0x534399[_0xcfbc('0x25')]({'plain':!![]});var _0x459b5e='Scheduler';return db[_0xcfbc('0x4c')][_0xcfbc('0x4d')]({'where':{'name':_0x459b5e,'userProfileId':_0xd3001f[_0xcfbc('0x4e')]},'raw':!![]})['then'](function(_0x1da72c){if(_0x1da72c&&_0x1da72c[_0xcfbc('0x4f')]===0x0){return db['UserProfileResource'][_0xcfbc('0x48')]({'name':_0x2cab1e[_0xcfbc('0x2b')],'resourceId':_0x2cab1e['id'],'type':_0x1da72c[_0xcfbc('0x2b')],'sectionId':_0x1da72c['id']},{})[_0xcfbc('0x23')](function(){return _0x534399;});}else{return _0x534399;}})[_0xcfbc('0x44')](function(_0x587e7d){logger[_0xcfbc('0x29')](_0xcfbc('0x50'),_0x587e7d);throw _0x587e7d;});}return _0x534399;})[_0xcfbc('0x23')](respondWithResult(_0x480193,0xc9))[_0xcfbc('0x44')](handleError(_0x480193,null));};exports[_0xcfbc('0x22')]=function(_0x259570,_0x1c27f6){if(_0x259570['body']['id']){delete _0x259570[_0xcfbc('0x49')]['id'];}return db['Schedule']['find']({'where':{'id':_0x259570[_0xcfbc('0x51')]['id']}})[_0xcfbc('0x23')](handleEntityNotFound(_0x1c27f6,null))[_0xcfbc('0x23')](saveUpdates(_0x259570[_0xcfbc('0x49')],null))['then'](respondWithResult(_0x1c27f6,null))[_0xcfbc('0x44')](handleError(_0x1c27f6,null));};exports[_0xcfbc('0x24')]=function(_0x129862,_0x547cb0){return db['Schedule'][_0xcfbc('0x4d')]({'where':{'id':_0x129862['params']['id']}})[_0xcfbc('0x23')](handleEntityNotFound(_0x547cb0,null))[_0xcfbc('0x23')](removeEntity(_0x547cb0,null))['catch'](handleError(_0x547cb0,null));};exports['run']=function(_0x17200a,_0x3b0672,_0x572928){var _0x4fd3d3=require(_0xcfbc('0x52'));return db[_0xcfbc('0x40')][_0xcfbc('0x4d')]({'where':{'id':_0x17200a[_0xcfbc('0x51')]['id']},'raw':!![]})[_0xcfbc('0x23')](handleEntityNotFound(_0x3b0672,null))[_0xcfbc('0x23')](function(){_0x4fd3d3[_0xcfbc('0x53')](_0x17200a[_0xcfbc('0x51')]['id']);})[_0xcfbc('0x23')](respondWithStatusCode(_0x3b0672,null))['catch'](handleError(_0x3b0672,null));};
\ No newline at end of file
+var _0xaa7e=['model','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','keys','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','index','map','Schedule','rawAttributes','type','key'];(function(_0x2ce709,_0x41ab1e){var _0x908e80=function(_0x1a6675){while(--_0x1a6675){_0x2ce709['push'](_0x2ce709['shift']());}};_0x908e80(++_0x41ab1e);}(_0xaa7e,0x113));var _0xeaa7=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0xaa7e[_0x4314d7];return _0x5c599b;};'use strict';var emlformat=require(_0xeaa7('0x0'));var rimraf=require(_0xeaa7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeaa7('0x2'));var rp=require(_0xeaa7('0x3'));var moment=require(_0xeaa7('0x4'));var BPromise=require(_0xeaa7('0x5'));var Mustache=require(_0xeaa7('0x6'));var util=require(_0xeaa7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeaa7('0x8'));var ejs=require(_0xeaa7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeaa7('0xa'));var squel=require('squel');var crypto=require(_0xeaa7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xeaa7('0xc'));var toCsv=require(_0xeaa7('0x8'));var querystring=require(_0xeaa7('0xd'));var Papa=require(_0xeaa7('0xe'));var Redis=require(_0xeaa7('0xf'));var authService=require(_0xeaa7('0x10'));var qs=require(_0xeaa7('0x11'));var as=require(_0xeaa7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaa7('0x13'))(_0xeaa7('0x14'));var utils=require(_0xeaa7('0x15'));var config=require(_0xeaa7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c3dc,_0x2051d8){_0x2051d8=_0x2051d8||0xcc;return function(_0x4790e6){if(_0x4790e6){return _0x51c3dc['sendStatus'](_0x2051d8);}return _0x51c3dc[_0xeaa7('0x17')](_0x2051d8)['end']();};}function respondWithResult(_0x6b5cfe,_0x265c0a){_0x265c0a=_0x265c0a||0xc8;return function(_0xd64a26){if(_0xd64a26){return _0x6b5cfe[_0xeaa7('0x17')](_0x265c0a)[_0xeaa7('0x18')](_0xd64a26);}};}function respondWithFilteredResult(_0x4d0f23,_0x16f6ac){return function(_0x30edc5){if(_0x30edc5){var _0x38eafb=typeof _0x16f6ac[_0xeaa7('0x19')]===_0xeaa7('0x1a')&&typeof _0x16f6ac[_0xeaa7('0x1b')]===_0xeaa7('0x1a');var _0x4f8e60=_0x30edc5['count'];var _0x1a37ba=_0x38eafb?0x0:_0x16f6ac[_0xeaa7('0x19')];var _0x323e08=_0x38eafb?_0x30edc5['count']:_0x16f6ac['offset']+_0x16f6ac[_0xeaa7('0x1b')];var _0x4a8ea3;if(_0x323e08>=_0x4f8e60){_0x323e08=_0x4f8e60;_0x4a8ea3=0xc8;}else{_0x4a8ea3=0xce;}_0x4d0f23[_0xeaa7('0x17')](_0x4a8ea3);return _0x4d0f23[_0xeaa7('0x1c')](_0xeaa7('0x1d'),_0x1a37ba+'-'+_0x323e08+'/'+_0x4f8e60)[_0xeaa7('0x18')](_0x30edc5);}return null;};}function patchUpdates(_0x3a9c1f){return function(_0x292b90){try{jsonpatch[_0xeaa7('0x1e')](_0x292b90,_0x3a9c1f,!![]);}catch(_0x431d91){return BPromise[_0xeaa7('0x1f')](_0x431d91);}return _0x292b90[_0xeaa7('0x20')]();};}function saveUpdates(_0x27388f,_0x5062db){return function(_0x26c452){if(_0x26c452){return _0x26c452[_0xeaa7('0x21')](_0x27388f)['then'](function(_0x290e16){return _0x290e16;});}return null;};}function removeEntity(_0x517d7c,_0x52f590){return function(_0x4fa59f){if(_0x4fa59f){return _0x4fa59f[_0xeaa7('0x22')]()[_0xeaa7('0x23')](function(){var _0x6eb8b8=_0x4fa59f['get']({'plain':!![]});var _0x408843=_0xeaa7('0x24');return db[_0xeaa7('0x25')][_0xeaa7('0x22')]({'where':{'type':_0x408843,'resourceId':_0x6eb8b8['id']}})['then'](function(){return _0x4fa59f;});})[_0xeaa7('0x23')](function(){_0x517d7c[_0xeaa7('0x17')](0xcc)[_0xeaa7('0x26')]();});}};}function handleEntityNotFound(_0x20394b,_0x2b1abc){return function(_0x9f00c6){if(!_0x9f00c6){_0x20394b[_0xeaa7('0x27')](0x194);}return _0x9f00c6;};}function handleError(_0x1f051f,_0x246bae){_0x246bae=_0x246bae||0x1f4;return function(_0xddcbac){logger[_0xeaa7('0x28')](_0xddcbac[_0xeaa7('0x29')]);if(_0xddcbac[_0xeaa7('0x2a')]){delete _0xddcbac['name'];}_0x1f051f[_0xeaa7('0x17')](_0x246bae)['send'](_0xddcbac);};}exports[_0xeaa7('0x2b')]=function(_0x4a339d,_0x16c733){var _0x455090={},_0x24b9d2={},_0xc24d3d={'count':0x0,'rows':[]};var _0x4b180d=_[_0xeaa7('0x2c')](db[_0xeaa7('0x2d')][_0xeaa7('0x2e')],function(_0x72e863){return{'name':_0x72e863['fieldName'],'type':_0x72e863[_0xeaa7('0x2f')][_0xeaa7('0x30')]};});_0x24b9d2[_0xeaa7('0x31')]=_[_0xeaa7('0x2c')](_0x4b180d,_0xeaa7('0x2a'));_0x24b9d2[_0xeaa7('0x32')]=_['keys'](_0x4a339d[_0xeaa7('0x32')]);_0x24b9d2[_0xeaa7('0x33')]=_['intersection'](_0x24b9d2[_0xeaa7('0x31')],_0x24b9d2[_0xeaa7('0x32')]);_0x455090[_0xeaa7('0x34')]=_[_0xeaa7('0x35')](_0x24b9d2[_0xeaa7('0x31')],qs[_0xeaa7('0x36')](_0x4a339d['query'][_0xeaa7('0x36')]));_0x455090[_0xeaa7('0x34')]=_0x455090['attributes']['length']?_0x455090['attributes']:_0x24b9d2[_0xeaa7('0x31')];if(!_0x4a339d[_0xeaa7('0x32')]['hasOwnProperty'](_0xeaa7('0x37'))){_0x455090['limit']=qs[_0xeaa7('0x1b')](_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x1b')]);_0x455090[_0xeaa7('0x19')]=qs[_0xeaa7('0x19')](_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x19')]);}_0x455090['order']=qs[_0xeaa7('0x38')](_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x38')]);_0x455090[_0xeaa7('0x39')]=qs[_0xeaa7('0x33')](_[_0xeaa7('0x3a')](_0x4a339d['query'],_0x24b9d2[_0xeaa7('0x33')]),_0x4b180d);if(_0x4a339d[_0xeaa7('0x32')][_0xeaa7('0x3b')]){_0x455090['where']=_[_0xeaa7('0x3c')](_0x455090[_0xeaa7('0x39')],{'$or':_[_0xeaa7('0x2c')](_0x4b180d,function(_0x571b11){if(_0x571b11[_0xeaa7('0x2f')]!==_0xeaa7('0x3d')){var _0x41504c={};_0x41504c[_0x571b11[_0xeaa7('0x2a')]]={'$like':'%'+_0x4a339d[_0xeaa7('0x32')]['filter']+'%'};return _0x41504c;}})});}_0x455090=_[_0xeaa7('0x3c')]({},_0x455090,_0x4a339d['options']);var _0x1f7e6c={'where':_0x455090[_0xeaa7('0x39')]};return db['Schedule']['count'](_0x1f7e6c)[_0xeaa7('0x23')](function(_0x7bc269){_0xc24d3d['count']=_0x7bc269;if(_0x4a339d['query'][_0xeaa7('0x3e')]){_0x455090['include']=[{'all':!![]}];}return db[_0xeaa7('0x2d')][_0xeaa7('0x3f')](_0x455090);})[_0xeaa7('0x23')](function(_0x1c1fac){_0xc24d3d['rows']=_0x1c1fac;return _0xc24d3d;})[_0xeaa7('0x23')](respondWithFilteredResult(_0x16c733,_0x455090))[_0xeaa7('0x40')](handleError(_0x16c733,null));};exports['show']=function(_0x5625b4,_0x5d9c6a){var _0x317fd9={'raw':![],'where':{'id':_0x5625b4['params']['id']}},_0x44a1ff={};_0x44a1ff[_0xeaa7('0x31')]=_[_0xeaa7('0x41')](db['Schedule'][_0xeaa7('0x2e')]);_0x44a1ff[_0xeaa7('0x32')]=_[_0xeaa7('0x41')](_0x5625b4['query']);_0x44a1ff[_0xeaa7('0x33')]=_[_0xeaa7('0x35')](_0x44a1ff[_0xeaa7('0x31')],_0x44a1ff[_0xeaa7('0x32')]);_0x317fd9['attributes']=_[_0xeaa7('0x35')](_0x44a1ff[_0xeaa7('0x31')],qs[_0xeaa7('0x36')](_0x5625b4[_0xeaa7('0x32')]['fields']));_0x317fd9[_0xeaa7('0x34')]=_0x317fd9[_0xeaa7('0x34')][_0xeaa7('0x42')]?_0x317fd9[_0xeaa7('0x34')]:_0x44a1ff[_0xeaa7('0x31')];if(_0x5625b4['query'][_0xeaa7('0x3e')]){_0x317fd9[_0xeaa7('0x43')]=[{'all':!![]}];}_0x317fd9=_[_0xeaa7('0x3c')]({},_0x317fd9,_0x5625b4['options']);return db[_0xeaa7('0x2d')]['find'](_0x317fd9)[_0xeaa7('0x23')](handleEntityNotFound(_0x5d9c6a,null))[_0xeaa7('0x23')](respondWithResult(_0x5d9c6a,null))[_0xeaa7('0x40')](handleError(_0x5d9c6a,null));};exports[_0xeaa7('0x44')]=function(_0x3362c3,_0x42883e){return db['Schedule'][_0xeaa7('0x44')](_0x3362c3[_0xeaa7('0x45')],{})[_0xeaa7('0x23')](function(_0x327f13){var _0x1eb8ac=_0x3362c3['user']['get']({'plain':!![]});if(!_0x1eb8ac)throw new Error(_0xeaa7('0x46'));if(_0x1eb8ac[_0xeaa7('0x47')]===_0xeaa7('0x48')){var _0xc6c9a2=_0x327f13[_0xeaa7('0x49')]({'plain':!![]});var _0x1affe6=_0xeaa7('0x24');return db['UserProfileSection'][_0xeaa7('0x4a')]({'where':{'name':_0x1affe6,'userProfileId':_0x1eb8ac[_0xeaa7('0x4b')]},'raw':!![]})[_0xeaa7('0x23')](function(_0x51344b){if(_0x51344b&&_0x51344b[_0xeaa7('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0xc6c9a2[_0xeaa7('0x2a')],'resourceId':_0xc6c9a2['id'],'type':_0x51344b[_0xeaa7('0x2a')],'sectionId':_0x51344b['id']},{})[_0xeaa7('0x23')](function(){return _0x327f13;});}else{return _0x327f13;}})[_0xeaa7('0x40')](function(_0x51abf2){logger[_0xeaa7('0x28')](_0xeaa7('0x4d'),_0x51abf2);throw _0x51abf2;});}return _0x327f13;})[_0xeaa7('0x23')](respondWithResult(_0x42883e,0xc9))[_0xeaa7('0x40')](handleError(_0x42883e,null));};exports[_0xeaa7('0x21')]=function(_0xcd6af6,_0x457c8e){if(_0xcd6af6[_0xeaa7('0x45')]['id']){delete _0xcd6af6['body']['id'];}return db[_0xeaa7('0x2d')][_0xeaa7('0x4a')]({'where':{'id':_0xcd6af6[_0xeaa7('0x4e')]['id']}})[_0xeaa7('0x23')](handleEntityNotFound(_0x457c8e,null))[_0xeaa7('0x23')](saveUpdates(_0xcd6af6[_0xeaa7('0x45')],null))[_0xeaa7('0x23')](respondWithResult(_0x457c8e,null))[_0xeaa7('0x40')](handleError(_0x457c8e,null));};exports[_0xeaa7('0x22')]=function(_0x1d04ee,_0x3de828){return db[_0xeaa7('0x2d')][_0xeaa7('0x4a')]({'where':{'id':_0x1d04ee[_0xeaa7('0x4e')]['id']}})[_0xeaa7('0x23')](handleEntityNotFound(_0x3de828,null))['then'](removeEntity(_0x3de828,null))[_0xeaa7('0x40')](handleError(_0x3de828,null));};exports[_0xeaa7('0x4f')]=function(_0x719e9c,_0x147865,_0xe3ca32){var _0x46ce68=require(_0xeaa7('0x50'));return db['Schedule'][_0xeaa7('0x4a')]({'where':{'id':_0x719e9c[_0xeaa7('0x4e')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x147865,null))[_0xeaa7('0x23')](function(){_0x46ce68[_0xeaa7('0x4f')](_0x719e9c['params']['id']);})[_0xeaa7('0x23')](respondWithStatusCode(_0x147865,null))[_0xeaa7('0x40')](handleError(_0x147865,null));};
\ No newline at end of file
index 6f10689..38cfb49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ee7=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','api','moment'];(function(_0x212588,_0x2e76d8){var _0x365f74=function(_0x50d669){while(--_0x50d669){_0x212588['push'](_0x212588['shift']());}};_0x365f74(++_0x2e76d8);}(_0x0ee7,0xdf));var _0x70ee=function(_0x176b14,_0x338622){_0x176b14=_0x176b14-0x0;var _0x22edd6=_0x0ee7[_0x176b14];return _0x22edd6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x70ee('0x0'));var moment=require(_0x70ee('0x1'));var BPromise=require('bluebird');var rp=require(_0x70ee('0x2'));var fs=require('fs');var path=require(_0x70ee('0x3'));var rimraf=require(_0x70ee('0x4'));var config=require(_0x70ee('0x5'));var attributes=require(_0x70ee('0x6'));module[_0x70ee('0x7')]=function(_0x394006,_0x18bf81){return _0x394006[_0x70ee('0x8')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1101=['exports','define','tools_schedules','lodash','util','api','moment','bluebird','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x1101,0x1e0));var _0x1110=function(_0xfa3da6,_0x2cbdb2){_0xfa3da6=_0xfa3da6-0x0;var _0x259910=_0x1101[_0xfa3da6];return _0x259910;};'use strict';var _=require(_0x1110('0x0'));var util=require(_0x1110('0x1'));var logger=require('../../config/logger')(_0x1110('0x2'));var moment=require(_0x1110('0x3'));var BPromise=require(_0x1110('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1110('0x5'));var attributes=require('./schedule.attributes');module[_0x1110('0x6')]=function(_0x3aee13,_0x191a20){return _0x3aee13[_0x1110('0x7')]('Schedule',attributes,{'tableName':_0x1110('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 10c308d..4efcf0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295b=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x10e696,_0x4b330b){var _0x54af32=function(_0x204519){while(--_0x204519){_0x10e696['push'](_0x10e696['shift']());}};_0x54af32(++_0x4b330b);}(_0x295b,0x6a));var _0xb295=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x295b[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xb295('0x0'));var util=require('util');var moment=require(_0xb295('0x1'));var BPromise=require('bluebird');var rs=require(_0xb295('0x2'));var fs=require('fs');var Redis=require(_0xb295('0x3'));var db=require(_0xb295('0x4'))['db'];var utils=require(_0xb295('0x5'));var logger=require('../../config/logger')(_0xb295('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb295('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ae7ba,_0x59a8b8,_0x4ed5c8){return new BPromise(function(_0x1b219b,_0x1d609b){return client['request'](_0x2ae7ba,_0x4ed5c8)['then'](function(_0x241a58){logger[_0xb295('0x8')](_0xb295('0x9'),_0x59a8b8,'request\x20sent');logger[_0xb295('0xa')]('Schedule,\x20%s,\x20%s,\x20%s',_0x59a8b8,_0xb295('0xb'),JSON[_0xb295('0xc')](_0x241a58));if(_0x241a58['error']){if(_0x241a58[_0xb295('0xd')][_0xb295('0xe')]===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x59a8b8,_0x241a58[_0xb295('0xd')]['message']);return _0x1d609b(_0x241a58['error'][_0xb295('0xf')]);}logger[_0xb295('0xd')](_0xb295('0x9'),_0x59a8b8,_0x241a58[_0xb295('0xd')][_0xb295('0xf')]);return _0x1b219b(_0x241a58[_0xb295('0xd')][_0xb295('0xf')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x59a8b8,_0xb295('0xb'));_0x1b219b(_0x241a58[_0xb295('0x10')][_0xb295('0xf')]);}})[_0xb295('0x11')](function(_0x387600){logger[_0xb295('0xd')](_0xb295('0x9'),_0x59a8b8,_0x387600);_0x1d609b(_0x387600);});});}
\ No newline at end of file
+var _0x6b18=['../../config/environment','client','request','then','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3f5b04,_0xd3c4cb){var _0xb357b7=function(_0x244988){while(--_0x244988){_0x3f5b04['push'](_0x3f5b04['shift']());}};_0xb357b7(++_0xd3c4cb);}(_0x6b18,0x1cf));var _0x86b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b18[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x86b1('0x0'));var BPromise=require(_0x86b1('0x1'));var rs=require(_0x86b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86b1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86b1('0x4'))('rpc');var config=require(_0x86b1('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x86b1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x74cf52,_0x139222,_0x3303c0){return new BPromise(function(_0xcb1808,_0x1890be){return client[_0x86b1('0x7')](_0x74cf52,_0x3303c0)[_0x86b1('0x8')](function(_0x5effe7){logger['info'](_0x86b1('0x9'),_0x139222,_0x86b1('0xa'));logger['debug'](_0x86b1('0xb'),_0x139222,_0x86b1('0xa'),JSON['stringify'](_0x5effe7));if(_0x5effe7[_0x86b1('0xc')]){if(_0x5effe7[_0x86b1('0xc')][_0x86b1('0xd')]===0x1f4){logger[_0x86b1('0xc')](_0x86b1('0x9'),_0x139222,_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);return _0x1890be(_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);}logger[_0x86b1('0xc')]('Schedule,\x20%s,\x20%s',_0x139222,_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);return _0xcb1808(_0x5effe7[_0x86b1('0xc')][_0x86b1('0xe')]);}else{logger[_0x86b1('0xf')](_0x86b1('0x9'),_0x139222,_0x86b1('0xa'));_0xcb1808(_0x5effe7[_0x86b1('0x10')]['message']);}})[_0x86b1('0x11')](function(_0x360fee){logger['error'](_0x86b1('0x9'),_0x139222,_0x360fee);_0x1890be(_0x360fee);});});}
\ No newline at end of file
index 368a65b..42decc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593f=['../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','create','put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x593f,0xb7));var _0xf593=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x593f[_0x14a0a0];return _0x56b651;};'use strict';var multer=require('multer');var util=require(_0xf593('0x0'));var path=require(_0xf593('0x1'));var timeout=require(_0xf593('0x2'));var express=require(_0xf593('0x3'));var router=express['Router']();var fs_extra=require(_0xf593('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf593('0x5'));var config=require(_0xf593('0x6'));var controller=require(_0xf593('0x7'));router[_0xf593('0x8')]('/',auth[_0xf593('0x9')](),controller[_0xf593('0xa')]);router[_0xf593('0x8')](_0xf593('0xb'),auth[_0xf593('0x9')](),controller[_0xf593('0xc')]);router[_0xf593('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf593('0xd')]);router[_0xf593('0x8')](_0xf593('0xe'),auth[_0xf593('0x9')](),controller[_0xf593('0xf')]);router[_0xf593('0x10')]('/',auth[_0xf593('0x9')](),controller[_0xf593('0x11')]);router[_0xf593('0x12')]('/:id',auth[_0xf593('0x9')](),controller['update']);router['delete']('/:id',auth[_0xf593('0x9')](),controller[_0xf593('0x13')]);module[_0xf593('0x14')]=router;
\ No newline at end of file
+var _0xd813=['../../config/environment','./screenRecording.controller','isAuthenticated','get','/describe','show','post','create','put','/:id','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x26d64e,_0x37dcf5){var _0x4b08ce=function(_0x246d19){while(--_0x246d19){_0x26d64e['push'](_0x26d64e['shift']());}};_0x4b08ce(++_0x37dcf5);}(_0xd813,0xdd));var _0x3d81=function(_0x20c3c2,_0x1b45e1){_0x20c3c2=_0x20c3c2-0x0;var _0x527149=_0xd813[_0x20c3c2];return _0x527149;};'use strict';var multer=require(_0x3d81('0x0'));var util=require('util');var path=require(_0x3d81('0x1'));var timeout=require(_0x3d81('0x2'));var express=require(_0x3d81('0x3'));var router=express[_0x3d81('0x4')]();var fs_extra=require(_0x3d81('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d81('0x6'));var config=require(_0x3d81('0x7'));var controller=require(_0x3d81('0x8'));router['get']('/',auth[_0x3d81('0x9')](),controller['index']);router[_0x3d81('0xa')](_0x3d81('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3d81('0xa')]('/:id',auth[_0x3d81('0x9')](),controller[_0x3d81('0xc')]);router[_0x3d81('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x3d81('0xd')]('/',auth[_0x3d81('0x9')](),controller[_0x3d81('0xe')]);router[_0x3d81('0xf')](_0x3d81('0x10'),auth[_0x3d81('0x9')](),controller['update']);router[_0x3d81('0x11')](_0x3d81('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3d81('0x12')]=router;
\ No newline at end of file
index b4c273a..b4d2b84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe9d=['extname','STRING','replace','INTEGER','startedAt','subtract','setDataValue','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','format','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value'];(function(_0x2c9f33,_0x2499c2){var _0x432955=function(_0x26935b){while(--_0x26935b){_0x2c9f33['push'](_0x2c9f33['shift']());}};_0x432955(++_0x2499c2);}(_0xbe9d,0x99));var _0xdbe9=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xbe9d[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0xdbe9('0x0'));var moment=require(_0xdbe9('0x1'));var path=require(_0xdbe9('0x2'));var config=require(_0xdbe9('0x3'));module[_0xdbe9('0x4')]={'format':{'type':Sequelize[_0xdbe9('0x5')],'get':function(){return this[_0xdbe9('0x6')](_0xdbe9('0x7'))?path[_0xdbe9('0x8')](this[_0xdbe9('0x6')](_0xdbe9('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xdbe9('0x9')]},'channel':{'type':Sequelize[_0xdbe9('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x56e9be){var _0x3d5165=_0x56e9be[_0xdbe9('0xa')](/\\/g,'/');this['setDataValue'](_0xdbe9('0x7'),_0x3d5165);}},'rating':{'type':Sequelize[_0xdbe9('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdbe9('0xb')],'set':function(_0x56470c){this['setDataValue'](_0xdbe9('0xc'),moment()[_0xdbe9('0xd')](_0x56470c,'ms'));this[_0xdbe9('0xe')](_0xdbe9('0xf'),moment());this['setDataValue'](_0xdbe9('0x10'),_0x56470c);}},'startedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this[_0xdbe9('0x6')](_0xdbe9('0xc')))['format'](_0xdbe9('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this[_0xdbe9('0x6')](_0xdbe9('0xf')))['format'](_0xdbe9('0x12'))[_0xdbe9('0x13')]();}},'createdAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this['getDataValue'](_0xdbe9('0x14')))['format'](_0xdbe9('0x12'))[_0xdbe9('0x13')]();}},'updatedAt':{'type':Sequelize[_0xdbe9('0x11')],'get':function(){return moment(this['getDataValue'](_0xdbe9('0x15')))[_0xdbe9('0x16')](_0xdbe9('0x12'))['toString']();}}};
\ No newline at end of file
+var _0x3cd0=['STRING','setDataValue','INTEGER','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','../../config/environment','VIRTUAL','getDataValue','value','extname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cd0,0x8a));var _0x03cd=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x3cd0[_0x2b9b7f];return _0x4ed19a;};'use strict';var Sequelize=require(_0x03cd('0x0'));var moment=require('moment');var path=require('path');var config=require(_0x03cd('0x1'));module['exports']={'format':{'type':Sequelize[_0x03cd('0x2')],'get':function(){return this[_0x03cd('0x3')](_0x03cd('0x4'))?path[_0x03cd('0x5')](this[_0x03cd('0x3')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x03cd('0x6')]},'channel':{'type':Sequelize[_0x03cd('0x6')]},'value':{'type':Sequelize[_0x03cd('0x6')],'set':function(_0x1ff934){var _0x606150=_0x1ff934['replace'](/\\/g,'/');this[_0x03cd('0x7')]('value',_0x606150);}},'rating':{'type':Sequelize[_0x03cd('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x03cd('0x8')],'set':function(_0x152209){this[_0x03cd('0x7')]('startedAt',moment()[_0x03cd('0x9')](_0x152209,'ms'));this[_0x03cd('0x7')](_0x03cd('0xa'),moment());this[_0x03cd('0x7')](_0x03cd('0xb'),_0x152209);}},'startedAt':{'type':Sequelize[_0x03cd('0xc')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0x03cd('0xd')](_0x03cd('0xe'))[_0x03cd('0xf')]();}},'closedAt':{'type':Sequelize[_0x03cd('0xc')],'get':function(){return moment(this['getDataValue'](_0x03cd('0xa')))[_0x03cd('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x03cd('0x3')](_0x03cd('0x10')))[_0x03cd('0xd')](_0x03cd('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x03cd('0xc')],'get':function(){return moment(this[_0x03cd('0x3')](_0x03cd('0x11')))[_0x03cd('0xd')](_0x03cd('0xe'))['toString']();}}};
\ No newline at end of file
index a264b0f..8fda03c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0xb138,0x1dd));var _0x8b13=function(_0x6fbd33,_0xb463e7){_0x6fbd33=_0x6fbd33-0x0;var _0x460f5c=_0xb138[_0x6fbd33];return _0x460f5c;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,null));};
\ No newline at end of file
+var _0x81bd=['Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','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','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','duration','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','root','%s.cypher','existsSync','secrets','recording','join','server/files/screen_recordings'];(function(_0x38015d,_0xf7624b){var _0xa39405=function(_0x33e4fa){while(--_0x33e4fa){_0x38015d['push'](_0x38015d['shift']());}};_0xa39405(++_0xf7624b);}(_0x81bd,0x7c));var _0xd81b=function(_0x5c9967,_0x59304e){_0x5c9967=_0x5c9967-0x0;var _0x319e8c=_0x81bd[_0x5c9967];return _0x319e8c;};'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'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2ccedf,_0x1bf351){return function(_0x596389){if(!_0x596389){_0x2ccedf[_0xd81b('0x1b')](0x194);}return _0x596389;};}function handleError(_0x99dbc9,_0xe3637a){_0xe3637a=_0xe3637a||0x1f4;return function(_0x31b9fd){logger[_0xd81b('0x2a')](_0x31b9fd[_0xd81b('0x2b')]);if(_0x31b9fd[_0xd81b('0x2c')]){delete _0x31b9fd[_0xd81b('0x2c')];}_0x99dbc9[_0xd81b('0x1d')](_0xe3637a)['send'](_0x31b9fd);};}exports[_0xd81b('0x2d')]=function(_0x4e2eff,_0x5c8aee){var _0xb9ff9f={},_0x260310={},_0x5141e6={'count':0x0,'rows':[]};var _0x481454=_[_0xd81b('0x2e')](db[_0xd81b('0x2f')][_0xd81b('0x30')],function(_0x289f54){return{'name':_0x289f54[_0xd81b('0x31')],'type':_0x289f54[_0xd81b('0x32')]['key']};});_0x260310[_0xd81b('0x33')]=_[_0xd81b('0x34')](_['map'](_0x481454,'name'),[_0xd81b('0x35')]);_0x260310[_0xd81b('0x36')]=_['keys'](_0x4e2eff['query']);_0x260310['filters']=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],_0x260310[_0xd81b('0x36')]);_0xb9ff9f[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x260310[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x4e2eff['query'][_0xd81b('0x39')]));_0xb9ff9f['attributes']=_0xb9ff9f[_0xd81b('0x38')][_0xd81b('0x3a')]?_0xb9ff9f[_0xd81b('0x38')]:_0x260310[_0xd81b('0x33')];if(!_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x3b')](_0xd81b('0x3c'))){_0xb9ff9f[_0xd81b('0x20')]=qs[_0xd81b('0x20')](_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x20')]);_0xb9ff9f[_0xd81b('0x22')]=qs[_0xd81b('0x22')](_0x4e2eff['query']['offset']);}_0xb9ff9f[_0xd81b('0x3d')]=qs[_0xd81b('0x3e')](_0x4e2eff[_0xd81b('0x36')]['sort']);_0xb9ff9f[_0xd81b('0x3f')]=qs[_0xd81b('0x40')](_['pick'](_0x4e2eff[_0xd81b('0x36')],_0x260310[_0xd81b('0x40')]),_0x481454);if(_0x4e2eff['query'][_0xd81b('0x41')]){_0xb9ff9f['where']=_[_0xd81b('0x42')](_0xb9ff9f[_0xd81b('0x3f')],{'$or':_[_0xd81b('0x2e')](_0x481454,function(_0x3f6deb){if(_0x3f6deb['type']!==_0xd81b('0x43')){var _0x3444d4={};_0x3444d4[_0x3f6deb[_0xd81b('0x2c')]]={'$like':'%'+_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x41')]+'%'};return _0x3444d4;}})});}_0xb9ff9f=_[_0xd81b('0x42')]({},_0xb9ff9f,_0x4e2eff[_0xd81b('0x44')]);var _0x532ada={'where':_0xb9ff9f[_0xd81b('0x3f')]};return db[_0xd81b('0x2f')][_0xd81b('0x21')](_0x532ada)['then'](function(_0x3bea7d){_0x5141e6[_0xd81b('0x21')]=_0x3bea7d;if(_0x4e2eff[_0xd81b('0x36')][_0xd81b('0x45')]){_0xb9ff9f[_0xd81b('0x46')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd81b('0x47')](_0xb9ff9f);})[_0xd81b('0x28')](function(_0x448e24){_0x5141e6[_0xd81b('0x48')]=_0x448e24;return _0x5141e6;})[_0xd81b('0x28')](respondWithFilteredResult(_0x5c8aee,_0xb9ff9f))[_0xd81b('0x49')](handleError(_0x5c8aee,null));};exports[_0xd81b('0x4a')]=function(_0x486f0d,_0x4405a8){var _0x3ba339={'raw':![],'where':{'id':_0x486f0d['params']['id']}},_0x1e3690={};_0x1e3690[_0xd81b('0x33')]=_[_0xd81b('0x4b')](db[_0xd81b('0x2f')][_0xd81b('0x30')]);_0x1e3690[_0xd81b('0x36')]=_[_0xd81b('0x4b')](_0x486f0d[_0xd81b('0x36')]);_0x1e3690[_0xd81b('0x40')]=_['intersection'](_0x1e3690['model'],_0x1e3690[_0xd81b('0x36')]);_0x3ba339[_0xd81b('0x38')]=_[_0xd81b('0x37')](_0x1e3690[_0xd81b('0x33')],qs[_0xd81b('0x39')](_0x486f0d[_0xd81b('0x36')][_0xd81b('0x39')]));_0x3ba339[_0xd81b('0x38')]=_0x3ba339[_0xd81b('0x38')][_0xd81b('0x3a')]?_0x3ba339[_0xd81b('0x38')]:_0x1e3690[_0xd81b('0x33')];if(_0x486f0d['query'][_0xd81b('0x45')]){_0x3ba339[_0xd81b('0x46')]=[{'all':!![]}];}_0x3ba339=_[_0xd81b('0x42')]({},_0x3ba339,_0x486f0d[_0xd81b('0x44')]);return db[_0xd81b('0x2f')][_0xd81b('0x4c')](_0x3ba339)[_0xd81b('0x28')](handleEntityNotFound(_0x4405a8,null))[_0xd81b('0x28')](respondWithResult(_0x4405a8,null))[_0xd81b('0x49')](handleError(_0x4405a8,null));};exports['create']=function(_0xf401e0,_0x2368dd){return db[_0xd81b('0x2f')][_0xd81b('0x4d')](_0xf401e0['body'],{})[_0xd81b('0x28')](respondWithResult(_0x2368dd,0xc9))[_0xd81b('0x49')](handleError(_0x2368dd,null));};exports[_0xd81b('0x27')]=function(_0xe874b6,_0x2699e6){if(_0xe874b6[_0xd81b('0x4e')]['id']){delete _0xe874b6[_0xd81b('0x4e')]['id'];}delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x4f')];delete _0xe874b6['body']['createdAt'];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x50')];delete _0xe874b6[_0xd81b('0x4e')][_0xd81b('0x51')];return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0xe874b6[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2699e6,null))['then'](saveUpdates(_0xe874b6[_0xd81b('0x4e')],null))[_0xd81b('0x28')](respondWithResult(_0x2699e6,null))[_0xd81b('0x49')](handleError(_0x2699e6,null));};exports[_0xd81b('0x53')]=function(_0x4651d3,_0x59b13b){return db[_0xd81b('0x2f')][_0xd81b('0x53')]()['then'](respondWithResult(_0x59b13b,null))[_0xd81b('0x49')](handleError(_0x59b13b,null));};exports[_0xd81b('0x54')]=function(_0x100319,_0x3b7ed7,_0x21cd71){var _0xa366c8=require(_0xd81b('0x55'));var _0x22f588=![];var _0x3ed626={};if(_0x100319[_0xd81b('0x36')][_0xd81b('0x32')]&&_0x100319['query'][_0xd81b('0x32')]==='uniqueid'){_0x3ed626[_0xd81b('0x56')]=_0x100319[_0xd81b('0x52')]['id'];}else{_0x3ed626['id']=_0x100319[_0xd81b('0x52')]['id'];}return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':_0x3ed626,'attributes':['id',_0xd81b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x3b7ed7,null))[_0xd81b('0x28')](function(_0xe0c9c6){if(_0xe0c9c6){var _0x51f5a1=path['join'](config[_0xd81b('0x57')],'server/files/screen_recordings',_0xe0c9c6[_0xd81b('0x51')]);var _0x51f066=util[_0xd81b('0x35')](_0xd81b('0x58'),_0x51f5a1);if(fs[_0xd81b('0x59')](_0x51f066)){_0x22f588=!![];return _0xa366c8['decryptFile'](_0x51f066,_0x51f5a1,config[_0xd81b('0x5a')][_0xd81b('0x5b')])['then'](function(){return _0xe0c9c6;});}return _0xe0c9c6;}})[_0xd81b('0x28')](function(_0x108aaf){if(_0x108aaf){var _0x5951ec=path[_0xd81b('0x5c')](config['root'],_0xd81b('0x5d'),_0x108aaf[_0xd81b('0x51')]);if(!fs[_0xd81b('0x59')](_0x5951ec)){throw new db[(_0xd81b('0x5e'))][(_0xd81b('0x5f'))](_0xd81b('0x60'));}if(_0x108aaf[_0xd81b('0x61')]){return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,_0x108aaf[_0xd81b('0x61')]+path[_0xd81b('0x62')](_0x5951ec),function(){if(_0x22f588){fs['unlink'](_0x5951ec);}});}else{return _0x3b7ed7[_0xd81b('0x54')](_0x5951ec,function(_0x434434){if(_0x22f588){fs[_0xd81b('0x63')](_0x5951ec);}});}}})[_0xd81b('0x49')](function(_0x1bdf37){if(_0x1bdf37[_0xd81b('0x64')]===_0xd81b('0x60')){_0x3b7ed7['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x3b7ed7,null);}});};exports[_0xd81b('0x29')]=function(_0x12b0bf,_0x37507e){return db[_0xd81b('0x2f')][_0xd81b('0x4c')]({'where':{'id':_0x12b0bf[_0xd81b('0x52')]['id']}})[_0xd81b('0x28')](function(_0x5afecf){if(_[_0xd81b('0x65')](_0x5afecf)){throw new ReferenceError(_0xd81b('0x66'));}return _0x5afecf;})[_0xd81b('0x28')](function(_0x2090e9){var _0x41719b=path[_0xd81b('0x5c')](config[_0xd81b('0x57')],'server/files/screen_recordings',_0x2090e9[_0xd81b('0x51')]);logger[_0xd81b('0x67')](_0xd81b('0x68'),_0x41719b);if(!_[_0xd81b('0x65')](_0x2090e9[_0xd81b('0x51')])&&fs[_0xd81b('0x59')](_0x41719b)){logger[_0xd81b('0x67')](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}_0x41719b=_0x41719b+_0xd81b('0x6c');if(!_[_0xd81b('0x65')](_0x2090e9['value'])&&fs[_0xd81b('0x59')](_0x41719b)){logger['info'](_0xd81b('0x69')+_0x41719b+_0xd81b('0x6a'));fs[_0xd81b('0x6b')](_0x41719b);}return _0x2090e9;})[_0xd81b('0x28')](function(_0xb94a69){if(!_0xb94a69)throw new InternalError();return _0xb94a69[_0xd81b('0x29')]();})[_0xd81b('0x28')](function(){_0x37507e[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();})[_0xd81b('0x49')](handleError(_0x37507e,null));};
\ No newline at end of file
index ab65019..92c695c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07c8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','interactionid','util','../../config/logger'];(function(_0x55a10c,_0x3c35ed){var _0x75438a=function(_0x1669b0){while(--_0x1669b0){_0x55a10c['push'](_0x55a10c['shift']());}};_0x75438a(++_0x3c35ed);}(_0x07c8,0x1d7));var _0x807c=function(_0x280f43,_0x5b1b46){_0x280f43=_0x280f43-0x0;var _0x1ed227=_0x07c8[_0x280f43];return _0x1ed227;};'use strict';var _=require('lodash');var util=require(_0x807c('0x0'));var logger=require(_0x807c('0x1'))(_0x807c('0x2'));var moment=require(_0x807c('0x3'));var BPromise=require(_0x807c('0x4'));var rp=require(_0x807c('0x5'));var fs=require('fs');var path=require(_0x807c('0x6'));var rimraf=require(_0x807c('0x7'));var config=require(_0x807c('0x8'));var attributes=require(_0x807c('0x9'));module['exports']=function(_0x537be8,_0x4d9436){return _0x537be8['define']('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x807c('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x760a=['bluebird','request-promise','path','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api'];(function(_0x45550b,_0x34c169){var _0x2a8274=function(_0x165e74){while(--_0x165e74){_0x45550b['push'](_0x45550b['shift']());}};_0x2a8274(++_0x34c169);}(_0x760a,0xf3));var _0xa760=function(_0x1429db,_0x1e3797){_0x1429db=_0x1429db-0x0;var _0x33a164=_0x760a[_0x1429db];return _0x33a164;};'use strict';var _=require(_0xa760('0x0'));var util=require(_0xa760('0x1'));var logger=require(_0xa760('0x2'))(_0xa760('0x3'));var moment=require('moment');var BPromise=require(_0xa760('0x4'));var rp=require(_0xa760('0x5'));var fs=require('fs');var path=require(_0xa760('0x6'));var rimraf=require('rimraf');var config=require(_0xa760('0x7'));var attributes=require('./screenRecording.attributes');module[_0xa760('0x8')]=function(_0x550ef6,_0x300dab){return _0x550ef6[_0xa760('0x9')](_0xa760('0xa'),attributes,{'tableName':_0xa760('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa760('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0635acf..311d1ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x358c=['../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x358c,0xea));var _0xc358=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x358c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xc358('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc358('0x1'));var db=require(_0xc358('0x2'))['db'];var utils=require(_0xc358('0x3'));var logger=require(_0xc358('0x4'))(_0xc358('0x5'));var config=require(_0xc358('0x6'));var jayson=require(_0xc358('0x7'));var client=jayson[_0xc358('0x8')][_0xc358('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cf3b4,_0x447be2,_0x5d398a){return new BPromise(function(_0x1e4ea9,_0x7797ee){return client['request'](_0x1cf3b4,_0x5d398a)[_0xc358('0xa')](function(_0x366b0a){logger[_0xc358('0xb')](_0xc358('0xc'),_0x447be2,_0xc358('0xd'));logger[_0xc358('0xe')](_0xc358('0xf'),_0x447be2,_0xc358('0xd'),JSON[_0xc358('0x10')](_0x366b0a));if(_0x366b0a[_0xc358('0x11')]){if(_0x366b0a[_0xc358('0x11')][_0xc358('0x12')]===0x1f4){logger[_0xc358('0x11')](_0xc358('0xc'),_0x447be2,_0x366b0a[_0xc358('0x11')][_0xc358('0x13')]);return _0x7797ee(_0x366b0a['error']['message']);}logger[_0xc358('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x447be2,_0x366b0a[_0xc358('0x11')][_0xc358('0x13')]);return _0x1e4ea9(_0x366b0a[_0xc358('0x11')][_0xc358('0x13')]);}else{logger[_0xc358('0xb')](_0xc358('0xc'),_0x447be2,_0xc358('0xd'));_0x1e4ea9(_0x366b0a['result'][_0xc358('0x13')]);}})['catch'](function(_0x2f6ebe){logger[_0xc358('0x11')](_0xc358('0xc'),_0x447be2,_0x2f6ebe);_0x7797ee(_0x2f6ebe);});});}
\ No newline at end of file
+var _0x493f=['rpc','../../config/environment','jayson/promise','client','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2f0c5d,_0x4b67c4){var _0x2bd6db=function(_0x15bc72){while(--_0x15bc72){_0x2f0c5d['push'](_0x2f0c5d['shift']());}};_0x2bd6db(++_0x4b67c4);}(_0x493f,0xa1));var _0xf493=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x493f[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xf493('0x0'));var util=require('util');var moment=require(_0xf493('0x1'));var BPromise=require(_0xf493('0x2'));var rs=require(_0xf493('0x3'));var fs=require('fs');var Redis=require(_0xf493('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf493('0x5'));var logger=require(_0xf493('0x6'))(_0xf493('0x7'));var config=require(_0xf493('0x8'));var jayson=require(_0xf493('0x9'));var client=jayson[_0xf493('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x139601,_0x599153,_0x724d5d){return new BPromise(function(_0xf26dc0,_0x1947c1){return client['request'](_0x139601,_0x724d5d)[_0xf493('0xb')](function(_0x4ee957){logger[_0xf493('0xc')](_0xf493('0xd'),_0x599153,_0xf493('0xe'));logger[_0xf493('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x599153,_0xf493('0xe'),JSON[_0xf493('0x10')](_0x4ee957));if(_0x4ee957[_0xf493('0x11')]){if(_0x4ee957[_0xf493('0x11')]['code']===0x1f4){logger['error'](_0xf493('0xd'),_0x599153,_0x4ee957['error'][_0xf493('0x12')]);return _0x1947c1(_0x4ee957['error'][_0xf493('0x12')]);}logger['error'](_0xf493('0xd'),_0x599153,_0x4ee957['error'][_0xf493('0x12')]);return _0xf26dc0(_0x4ee957[_0xf493('0x11')]['message']);}else{logger['info'](_0xf493('0xd'),_0x599153,'request\x20sent');_0xf26dc0(_0x4ee957[_0xf493('0x13')][_0xf493('0x12')]);}})[_0xf493('0x14')](function(_0x1526e7){logger[_0xf493('0x11')](_0xf493('0xd'),_0x599153,_0x1526e7);_0x1947c1(_0x1526e7);});});}
\ No newline at end of file
index ccc02c8..e519724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad4f=['server/files/images/logos/','logologin','extname','originalname','/:id/logo_login','addLogoLogin','preferred','/:id/preferred','addPreferred','put','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','/:id/logo','getLogo','/:id/gdpr','gdpr','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','post','single','file','addLogo'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xad4f,0xab));var _0xfad4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xad4f[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xfad4('0x0'));var util=require(_0xfad4('0x1'));var path=require('path');var timeout=require(_0xfad4('0x2'));var express=require('express');var router=express[_0xfad4('0x3')]();var fs_extra=require(_0xfad4('0x4'));var auth=require(_0xfad4('0x5'));var interaction=require(_0xfad4('0x6'));var config=require('../../config/environment');var controller=require(_0xfad4('0x7'));router['get']('/',auth[_0xfad4('0x8')](),controller[_0xfad4('0x9')]);router[_0xfad4('0xa')](_0xfad4('0xb'),controller[_0xfad4('0xc')]);router['get'](_0xfad4('0xd'),controller['show']);router['get'](_0xfad4('0xe'),controller[_0xfad4('0xf')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router['get'](_0xfad4('0x10'),controller[_0xfad4('0x11')]);router[_0xfad4('0xa')]('/:id/preferred',controller['getPreferred']);router['get'](_0xfad4('0x12'),controller[_0xfad4('0x13')]);var upload=multer({'storage':multer[_0xfad4('0x14')]({'destination':function(_0x35a33f,_0x5d8e1c,_0x57ec20){_0x57ec20(null,path[_0xfad4('0x15')](config[_0xfad4('0x16')],'server/files/images/logos/'));},'filename':function(_0x3d555b,_0x5dad5b,_0x5f1166){_0x5f1166(null,util[_0xfad4('0x17')](_0xfad4('0x18'),'logo',path['extname'](_0x5dad5b['originalname'])));}})});router[_0xfad4('0x19')](_0xfad4('0xe'),upload[_0xfad4('0x1a')](_0xfad4('0x1b')),controller[_0xfad4('0x1c')]);var upload=multer({'storage':multer[_0xfad4('0x14')]({'destination':function(_0x2acdca,_0x236639,_0x171f16){_0x171f16(null,path[_0xfad4('0x15')](config[_0xfad4('0x16')],_0xfad4('0x1d')));},'filename':function(_0x465f05,_0x44331c,_0x55b15d){_0x55b15d(null,util[_0xfad4('0x17')](_0xfad4('0x18'),_0xfad4('0x1e'),path[_0xfad4('0x1f')](_0x44331c[_0xfad4('0x20')])));}})});router['post'](_0xfad4('0x21'),upload[_0xfad4('0x1a')](_0xfad4('0x1b')),controller[_0xfad4('0x22')]);var upload=multer({'storage':multer[_0xfad4('0x14')]({'destination':function(_0x42df7e,_0x5dd69d,_0x54f46d){_0x54f46d(null,path['join'](config['root'],_0xfad4('0x1d')));},'filename':function(_0x455615,_0x31246a,_0x583bef){_0x583bef(null,util['format'](_0xfad4('0x18'),_0xfad4('0x23'),path[_0xfad4('0x1f')](_0x31246a[_0xfad4('0x20')])));}})});router[_0xfad4('0x19')](_0xfad4('0x24'),upload['single'](_0xfad4('0x1b')),controller[_0xfad4('0x25')]);var upload=multer({'storage':multer[_0xfad4('0x14')]({'destination':function(_0x2bfda6,_0x1b0da2,_0x3a9465){_0x3a9465(null,path[_0xfad4('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x59e024,_0x675191,_0x298ff6){_0x298ff6(null,util[_0xfad4('0x17')]('%s%s','favicon',path[_0xfad4('0x1f')](_0x675191[_0xfad4('0x20')])));}})});router[_0xfad4('0x19')](_0xfad4('0x12'),upload['single']('file'),controller['addFavicon']);router[_0xfad4('0x26')](_0xfad4('0xd'),auth['isAuthenticated'](),controller['update']);module[_0xfad4('0x27')]=router;
\ No newline at end of file
+var _0x6bfe=['/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','addLogo','logologin','extname','/:id/logo_login','file','addLogoLogin','preferred','favicon','single','addFavicon','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/now','/:id','/:id/logo','getLogo','getLogoLogin','/:id/preferred','getPreferred'];(function(_0x344d85,_0x5e08b5){var _0x31179f=function(_0xe59577){while(--_0xe59577){_0x344d85['push'](_0x344d85['shift']());}};_0x31179f(++_0x5e08b5);}(_0x6bfe,0x13f));var _0xe6bf=function(_0x3e23db,_0x4277a0){_0x3e23db=_0x3e23db-0x0;var _0x4287dd=_0x6bfe[_0x3e23db];return _0x4287dd;};'use strict';var multer=require(_0xe6bf('0x0'));var util=require('util');var path=require(_0xe6bf('0x1'));var timeout=require(_0xe6bf('0x2'));var express=require(_0xe6bf('0x3'));var router=express[_0xe6bf('0x4')]();var fs_extra=require(_0xe6bf('0x5'));var auth=require(_0xe6bf('0x6'));var interaction=require(_0xe6bf('0x7'));var config=require(_0xe6bf('0x8'));var controller=require('./setting.controller');router[_0xe6bf('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe6bf('0x9')](_0xe6bf('0xa'),controller['getDate']);router['get'](_0xe6bf('0xb'),controller['show']);router[_0xe6bf('0x9')](_0xe6bf('0xc'),controller[_0xe6bf('0xd')]);router['get']('/:id/logo_login',controller[_0xe6bf('0xe')]);router[_0xe6bf('0x9')]('/:id/gdpr',controller['gdpr']);router['get'](_0xe6bf('0xf'),controller[_0xe6bf('0x10')]);router['get'](_0xe6bf('0x11'),controller[_0xe6bf('0x12')]);var upload=multer({'storage':multer[_0xe6bf('0x13')]({'destination':function(_0x42c389,_0x5f0a41,_0x2702d2){_0x2702d2(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x3390ab,_0x8c1700,_0x4cb395){_0x4cb395(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x19'),path['extname'](_0x8c1700[_0xe6bf('0x1a')])));}})});router[_0xe6bf('0x1b')](_0xe6bf('0xc'),upload['single']('file'),controller[_0xe6bf('0x1c')]);var upload=multer({'storage':multer[_0xe6bf('0x13')]({'destination':function(_0x32dcdd,_0x2d77cb,_0x1e0e47){_0x1e0e47(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x23befa,_0x2e51f0,_0x15fb09){_0x15fb09(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x1d'),path[_0xe6bf('0x1e')](_0x2e51f0[_0xe6bf('0x1a')])));}})});router['post'](_0xe6bf('0x1f'),upload['single'](_0xe6bf('0x20')),controller[_0xe6bf('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e1718,_0x2a9ef2,_0x11a2ef){_0x11a2ef(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x369efd,_0x1adcd3,_0x4b3429){_0x4b3429(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x22'),path[_0xe6bf('0x1e')](_0x1adcd3[_0xe6bf('0x1a')])));}})});router['post']('/:id/preferred',upload['single'](_0xe6bf('0x20')),controller['addPreferred']);var upload=multer({'storage':multer[_0xe6bf('0x13')]({'destination':function(_0x5d60d6,_0x18be34,_0x1bbadf){_0x1bbadf(null,path[_0xe6bf('0x14')](config[_0xe6bf('0x15')],_0xe6bf('0x16')));},'filename':function(_0x2e8d47,_0x192e30,_0x107cc8){_0x107cc8(null,util[_0xe6bf('0x17')](_0xe6bf('0x18'),_0xe6bf('0x23'),path[_0xe6bf('0x1e')](_0x192e30['originalname'])));}})});router[_0xe6bf('0x1b')](_0xe6bf('0x11'),upload[_0xe6bf('0x24')]('file'),controller[_0xe6bf('0x25')]);router[_0xe6bf('0x26')](_0xe6bf('0xb'),auth[_0xe6bf('0x27')](),controller[_0xe6bf('0x28')]);module[_0xe6bf('0x29')]=router;
\ No newline at end of file
index a24b4ea..3587d90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0x331b08,_0x2c5937){var _0x5034d9=function(_0x2c916a){while(--_0x2c916a){_0x331b08['push'](_0x331b08['shift']());}};_0x5034d9(++_0x2c5937);}(_0x1261,0x144));var _0x1126=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0x1261[_0x4653f7];return _0x5454da;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1261=['exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED'];(function(_0xfa0568,_0x1de7ce){var _0x5ec3ca=function(_0x3ae0d4){while(--_0x3ae0d4){_0xfa0568['push'](_0xfa0568['shift']());}};_0x5ec3ca(++_0x1de7ce);}(_0x1261,0x144));var _0x1126=function(_0x3eaea7,_0x9968ff){_0x3eaea7=_0x3eaea7-0x0;var _0xd7cd35=_0x1261[_0x3eaea7];return _0xd7cd35;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'min_internal':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x1126('0x1')](0xb),'unique':_0x1126('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x5')},'logo':{'type':Sequelize[_0x1126('0x4')]},'defaultLogo':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x1126('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x1126('0x4')]},'turnaddr':{'type':Sequelize[_0x1126('0x4')]},'turnusername':{'type':Sequelize[_0x1126('0x4')]},'turnpassword':{'type':Sequelize[_0x1126('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x1126('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x1126('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x1126('0x4')],'defaultValue':_0x1126('0x7')},'chatTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x1126('0x4')]},'defaultPreferred':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x1126('0x4')]},'defaultFavicon':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x1126('0x1')]},'transcribeRegion':{'type':Sequelize[_0x1126('0x4')]},'sentiment':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x1126('0x1')]},'sentimentRegion':{'type':Sequelize[_0x1126('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x1126('0x1')](0x2)[_0x1126('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x1126('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x1126('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x1126('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x1126('0x6')],'defaultValue':![]}};
\ No newline at end of file
index f273784..c0a5fa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf149=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','sendStatus','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Setting','includeAll','findAll','rows','catch','show','params','include','body','find','file','filename','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','upperFirst','getLogoLogin','defaultLoginLogo','default_loginLogo.svg','\x20not\x20found','download','addPreferred','getPreferred','default_preferred.png','ValidationError','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3af7b7,_0x208014){var _0x8408b5=function(_0x22161d){while(--_0x22161d){_0x3af7b7['push'](_0x3af7b7['shift']());}};_0x8408b5(++_0x208014);}(_0xf149,0xe1));var _0x9f14=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0xf149[_0x413b4d];return _0x8b810a;};'use strict';var emlformat=require(_0x9f14('0x0'));var rimraf=require(_0x9f14('0x1'));var zipdir=require(_0x9f14('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f14('0x3'));var moment=require(_0x9f14('0x4'));var BPromise=require(_0x9f14('0x5'));var Mustache=require(_0x9f14('0x6'));var util=require(_0x9f14('0x7'));var path=require(_0x9f14('0x8'));var sox=require(_0x9f14('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f14('0xa'));var _=require(_0x9f14('0xb'));var squel=require(_0x9f14('0xc'));var crypto=require(_0x9f14('0xd'));var jsforce=require(_0x9f14('0xe'));var deskjs=require(_0x9f14('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f14('0x10'));var authService=require(_0x9f14('0x11'));var qs=require(_0x9f14('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f14('0x13'));var logger=require(_0x9f14('0x14'))(_0x9f14('0x15'));var utils=require(_0x9f14('0x16'));var config=require(_0x9f14('0x17'));var licenseUtil=require(_0x9f14('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9f14('0x19'));var client=jayson[_0x9f14('0x1a')][_0x9f14('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x105806,_0x4333f8,_0x187f86,_0x65de1f){return new BPromise(function(_0x42af81,_0xc0371b){var _0x9810d3=_0x65de1f||client;return _0x9810d3[_0x9f14('0x1c')](_0x105806,_0x187f86)[_0x9f14('0x1d')](function(_0x314dd6){logger[_0x9f14('0x1e')](_0x9f14('0x1f'),_0x4333f8,_0x9f14('0x20'));logger['debug'](_0x9f14('0x21'),_0x4333f8,_0x9f14('0x20'),JSON[_0x9f14('0x22')](_0x314dd6));if(_0x314dd6[_0x9f14('0x23')]){if(_0x314dd6[_0x9f14('0x23')]['code']===0x1f4){logger[_0x9f14('0x23')](_0x9f14('0x1f'),_0x4333f8,_0x314dd6[_0x9f14('0x23')][_0x9f14('0x24')]);return _0xc0371b(_0x314dd6[_0x9f14('0x23')][_0x9f14('0x24')]);}logger['error'](_0x9f14('0x1f'),_0x4333f8,_0x314dd6[_0x9f14('0x23')][_0x9f14('0x24')]);return _0x42af81(_0x314dd6[_0x9f14('0x23')]['message']);}else{logger[_0x9f14('0x1e')](_0x9f14('0x1f'),_0x4333f8,_0x9f14('0x20'));_0x42af81(_0x314dd6[_0x9f14('0x25')][_0x9f14('0x24')]);}})['catch'](function(_0x51cc83){logger[_0x9f14('0x23')](_0x9f14('0x1f'),_0x4333f8,_0x51cc83);_0xc0371b(_0x51cc83);});});}function respondWithStatusCode(_0x2a7a19,_0x498ae6){_0x498ae6=_0x498ae6||0xcc;return function(_0x55e56d){if(_0x55e56d){return _0x2a7a19['sendStatus'](_0x498ae6);}return _0x2a7a19[_0x9f14('0x26')](_0x498ae6)[_0x9f14('0x27')]();};}function respondWithResult(_0x1dcca4,_0x2868fb){_0x2868fb=_0x2868fb||0xc8;return function(_0x2a6500){if(_0x2a6500){return _0x1dcca4[_0x9f14('0x26')](_0x2868fb)[_0x9f14('0x28')](_0x2a6500);}};}function respondWithFilteredResult(_0x4aa2ca,_0x57d62c){return function(_0x3fb12a){if(_0x3fb12a){var _0x500eca=typeof _0x57d62c[_0x9f14('0x29')]===_0x9f14('0x2a')&&typeof _0x57d62c[_0x9f14('0x2b')]==='undefined';var _0x55da6c=_0x3fb12a[_0x9f14('0x2c')];var _0x13c0be=_0x500eca?0x0:_0x57d62c[_0x9f14('0x29')];var _0x1e5119=_0x500eca?_0x3fb12a[_0x9f14('0x2c')]:_0x57d62c['offset']+_0x57d62c['limit'];var _0x4fd86d;if(_0x1e5119>=_0x55da6c){_0x1e5119=_0x55da6c;_0x4fd86d=0xc8;}else{_0x4fd86d=0xce;}_0x4aa2ca[_0x9f14('0x26')](_0x4fd86d);return _0x4aa2ca['set'](_0x9f14('0x2d'),_0x13c0be+'-'+_0x1e5119+'/'+_0x55da6c)[_0x9f14('0x28')](_0x3fb12a);}return null;};}function patchUpdates(_0x56cb95){return function(_0x5e000b){try{jsonpatch[_0x9f14('0x2e')](_0x5e000b,_0x56cb95,!![]);}catch(_0x183911){return BPromise[_0x9f14('0x2f')](_0x183911);}return _0x5e000b['save']();};}function saveUpdates(_0x4b624e,_0x505e35){return function(_0x3b068b){if(_0x3b068b){return _0x3b068b[_0x9f14('0x30')](_0x4b624e)[_0x9f14('0x1d')](function(_0x438b09){return _0x438b09;});}return null;};}function removeEntity(_0x8d527d,_0x3ae862){return function(_0x1f2332){if(_0x1f2332){return _0x1f2332['destroy']()['then'](function(){_0x8d527d[_0x9f14('0x26')](0xcc)[_0x9f14('0x27')]();});}};}function handleEntityNotFound(_0x5cd820,_0x23eaac){return function(_0x258e3d){if(!_0x258e3d){_0x5cd820[_0x9f14('0x31')](0x194);}return _0x258e3d;};}function handleError(_0x3ec6f6,_0x1153ab){_0x1153ab=_0x1153ab||0x1f4;return function(_0x5df273){logger[_0x9f14('0x23')](_0x5df273['stack']);if(_0x5df273['name']){delete _0x5df273[_0x9f14('0x32')];}_0x3ec6f6[_0x9f14('0x26')](_0x1153ab)['send'](_0x5df273);};}exports['index']=function(_0x38ba5,_0x42b591){var _0x27a1ee={},_0x589331={},_0x23905b={'count':0x0,'rows':[]};var _0xf934ef=_[_0x9f14('0x33')](db['Setting'][_0x9f14('0x34')],function(_0x180047){return{'name':_0x180047['fieldName'],'type':_0x180047[_0x9f14('0x35')][_0x9f14('0x36')]};});_0x589331[_0x9f14('0x37')]=_[_0x9f14('0x33')](_0xf934ef,_0x9f14('0x32'));_0x589331['query']=_[_0x9f14('0x38')](_0x38ba5[_0x9f14('0x39')]);_0x589331[_0x9f14('0x3a')]=_[_0x9f14('0x3b')](_0x589331['model'],_0x589331[_0x9f14('0x39')]);_0x27a1ee['attributes']=_[_0x9f14('0x3b')](_0x589331[_0x9f14('0x37')],qs[_0x9f14('0x3c')](_0x38ba5[_0x9f14('0x39')][_0x9f14('0x3c')]));_0x27a1ee[_0x9f14('0x3d')]=_0x27a1ee['attributes'][_0x9f14('0x3e')]?_0x27a1ee['attributes']:_0x589331[_0x9f14('0x37')];if(!_0x38ba5[_0x9f14('0x39')][_0x9f14('0x3f')](_0x9f14('0x40'))){_0x27a1ee[_0x9f14('0x2b')]=qs[_0x9f14('0x2b')](_0x38ba5['query']['limit']);_0x27a1ee['offset']=qs[_0x9f14('0x29')](_0x38ba5[_0x9f14('0x39')][_0x9f14('0x29')]);}_0x27a1ee[_0x9f14('0x41')]=qs['sort'](_0x38ba5[_0x9f14('0x39')][_0x9f14('0x42')]);_0x27a1ee[_0x9f14('0x43')]=qs['filters'](_[_0x9f14('0x44')](_0x38ba5[_0x9f14('0x39')],_0x589331[_0x9f14('0x3a')]),_0xf934ef);if(_0x38ba5[_0x9f14('0x39')][_0x9f14('0x45')]){_0x27a1ee['where']=_['merge'](_0x27a1ee[_0x9f14('0x43')],{'$or':_['map'](_0xf934ef,function(_0x545814){if(_0x545814[_0x9f14('0x35')]!==_0x9f14('0x46')){var _0x1848fc={};_0x1848fc[_0x545814['name']]={'$like':'%'+_0x38ba5[_0x9f14('0x39')][_0x9f14('0x45')]+'%'};return _0x1848fc;}})});}_0x27a1ee=_[_0x9f14('0x47')]({},_0x27a1ee,_0x38ba5[_0x9f14('0x48')]);var _0x2b5d2b={'where':_0x27a1ee[_0x9f14('0x43')]};return db[_0x9f14('0x49')][_0x9f14('0x2c')](_0x2b5d2b)['then'](function(_0x21764f){_0x23905b[_0x9f14('0x2c')]=_0x21764f;if(_0x38ba5[_0x9f14('0x39')][_0x9f14('0x4a')]){_0x27a1ee['include']=[{'all':!![]}];}return db[_0x9f14('0x49')][_0x9f14('0x4b')](_0x27a1ee);})[_0x9f14('0x1d')](function(_0x28a8f8){_0x23905b[_0x9f14('0x4c')]=_0x28a8f8;return _0x23905b;})[_0x9f14('0x1d')](respondWithFilteredResult(_0x42b591,_0x27a1ee))[_0x9f14('0x4d')](handleError(_0x42b591,null));};exports[_0x9f14('0x4e')]=function(_0x1492d9,_0x314a0c){var _0x5d394c={'raw':![],'where':{'id':_0x1492d9[_0x9f14('0x4f')]['id']}},_0x1d4df1={};_0x1d4df1[_0x9f14('0x37')]=_[_0x9f14('0x38')](db['Setting']['rawAttributes']);_0x1d4df1[_0x9f14('0x39')]=_[_0x9f14('0x38')](_0x1492d9[_0x9f14('0x39')]);_0x1d4df1['filters']=_[_0x9f14('0x3b')](_0x1d4df1[_0x9f14('0x37')],_0x1d4df1[_0x9f14('0x39')]);_0x5d394c[_0x9f14('0x3d')]=_['intersection'](_0x1d4df1[_0x9f14('0x37')],qs[_0x9f14('0x3c')](_0x1492d9[_0x9f14('0x39')][_0x9f14('0x3c')]));_0x5d394c[_0x9f14('0x3d')]=_0x5d394c[_0x9f14('0x3d')][_0x9f14('0x3e')]?_0x5d394c[_0x9f14('0x3d')]:_0x1d4df1['model'];if(_0x1492d9[_0x9f14('0x39')][_0x9f14('0x4a')]){_0x5d394c[_0x9f14('0x50')]=[{'all':!![]}];}_0x5d394c=_[_0x9f14('0x47')]({},_0x5d394c,_0x1492d9[_0x9f14('0x48')]);return db[_0x9f14('0x49')]['find'](_0x5d394c)[_0x9f14('0x1d')](handleEntityNotFound(_0x314a0c,null))[_0x9f14('0x1d')](respondWithResult(_0x314a0c,null))['catch'](handleError(_0x314a0c,null));};exports[_0x9f14('0x30')]=function(_0x5034c3,_0x3e0670){if(_0x5034c3['body']['id']){delete _0x5034c3[_0x9f14('0x51')]['id'];}return db[_0x9f14('0x49')][_0x9f14('0x52')]({'where':{'id':_0x5034c3[_0x9f14('0x4f')]['id']}})[_0x9f14('0x1d')](handleEntityNotFound(_0x3e0670,null))[_0x9f14('0x1d')](saveUpdates(_0x5034c3[_0x9f14('0x51')],null))[_0x9f14('0x1d')](respondWithResult(_0x3e0670,null))['catch'](handleError(_0x3e0670,null));};exports['addLogo']=function(_0x3bfe91,_0x183534,_0x4c5009){if(_0x3bfe91[_0x9f14('0x53')]&&_0x3bfe91['file'][_0x9f14('0x54')]){_0x3bfe91[_0x9f14('0x51')]['logo']=_0x3bfe91[_0x9f14('0x53')]['filename'];}return db['Setting'][_0x9f14('0x52')]({'where':{'id':_0x3bfe91['params']['id']}})[_0x9f14('0x1d')](handleEntityNotFound(_0x183534,null))[_0x9f14('0x1d')](saveUpdates(_0x3bfe91['body'],null))[_0x9f14('0x1d')](respondWithResult(_0x183534,null))['catch'](handleError(_0x183534,null));};exports['addLogoLogin']=function(_0x563cd4,_0x2b4b2b,_0x2456ca){if(_0x563cd4[_0x9f14('0x53')]&&_0x563cd4['file']['filename']){_0x563cd4[_0x9f14('0x51')][_0x9f14('0x55')]=_0x563cd4[_0x9f14('0x53')][_0x9f14('0x54')];}return db['Setting'][_0x9f14('0x52')]({'where':{'id':_0x563cd4[_0x9f14('0x4f')]['id']}})[_0x9f14('0x1d')](handleEntityNotFound(_0x2b4b2b,null))[_0x9f14('0x1d')](saveUpdates(_0x563cd4[_0x9f14('0x51')],null))[_0x9f14('0x1d')](respondWithResult(_0x2b4b2b,null))[_0x9f14('0x4d')](handleError(_0x2b4b2b,null));};var utilLicense=require(_0x9f14('0x18'));exports['getLogo']=function(_0x11ac32,_0x2c1681,_0x291bf4){var _0x788470=_0x9f14('0x56');var _0x43b604={'custom':![]};return utilLicense[_0x9f14('0x57')]()[_0x9f14('0x1d')](function(_0x32c1f3){if(_0x32c1f3){_0x43b604=_0x32c1f3;}return db['Setting'][_0x9f14('0x52')]({'where':{'id':_0x11ac32[_0x9f14('0x4f')]['id']},'attributes':[_0x9f14('0x58'),_0x9f14('0x55'),_0x9f14('0x59'),_0x9f14('0x5a'),_0x9f14('0x5b'),'defaultLoginLogo',_0x9f14('0x5c'),_0x9f14('0x5d')],'raw':!![]});})[_0x9f14('0x1d')](handleEntityNotFound(_0x2c1681,null))[_0x9f14('0x1d')](function(_0x456317){if(_0x456317){var _0x5d227a=_0x456317['logo']&&fs[_0x9f14('0x5e')](path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x788470,_[_0x9f14('0x61')](_0x456317['logo'])))?path[_0x9f14('0x5f')](config['root'],_0x788470,_['toLower'](_0x456317[_0x9f14('0x58')])):path[_0x9f14('0x5f')](config['root'],_0x788470,_[_0x9f14('0x61')](_0x9f14('0x62')));var _0x5966b8=_0x9f14('0x63')+_['upperFirst'](_0x9f14('0x58'));if(_0x456317[_0x5966b8]||!_0x43b604[_0x9f14('0x64')]){_0x5d227a=path[_0x9f14('0x5f')](config['root'],_0x788470,_[_0x9f14('0x61')](_0x9f14('0x62')));}if(!fs['existsSync'](_0x5d227a)){throw new db[(_0x9f14('0x65'))]['ValidationError'](_[_0x9f14('0x66')](_0x9f14('0x58'))+'\x20not\x20found');}return _0x2c1681['download'](_0x5d227a);}})[_0x9f14('0x4d')](handleError(_0x2c1681,null));};var utilLicense=require(_0x9f14('0x18'));exports[_0x9f14('0x67')]=function(_0x26fa66,_0x376cff,_0x33c755){var _0x111eeb='server/files/images/logos';var _0x47ba39={'custom':![]};return utilLicense[_0x9f14('0x57')]()[_0x9f14('0x1d')](function(_0xd06c25){if(_0xd06c25){_0x47ba39=_0xd06c25;}return db[_0x9f14('0x49')][_0x9f14('0x52')]({'where':{'id':_0x26fa66[_0x9f14('0x4f')]['id']},'attributes':['logo',_0x9f14('0x55'),_0x9f14('0x59'),_0x9f14('0x5a'),_0x9f14('0x5b'),_0x9f14('0x68'),_0x9f14('0x5c'),_0x9f14('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x376cff,null))['then'](function(_0x80a7bc){if(_0x80a7bc){var _0x54ab07=_0x80a7bc[_0x9f14('0x55')]&&fs[_0x9f14('0x5e')](path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x111eeb,_[_0x9f14('0x61')](_0x80a7bc[_0x9f14('0x55')])))?path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x111eeb,_['toLower'](_0x80a7bc['loginLogo'])):path['join'](config[_0x9f14('0x60')],_0x111eeb,_['toLower'](_0x9f14('0x69')));var _0x26d0fa=_0x9f14('0x63')+_[_0x9f14('0x66')]('loginLogo');if(_0x80a7bc[_0x26d0fa]||!_0x47ba39[_0x9f14('0x64')]){_0x54ab07=path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x111eeb,_['toLower'](_0x9f14('0x69')));}if(!fs[_0x9f14('0x5e')](_0x54ab07)){throw new db[(_0x9f14('0x65'))]['ValidationError'](_[_0x9f14('0x66')](_0x9f14('0x55'))+_0x9f14('0x6a'));}return _0x376cff[_0x9f14('0x6b')](_0x54ab07);}})['catch'](handleError(_0x376cff,null));};exports['gdpr']=function(_0x2b57cf,_0x27d48a){return db[_0x9f14('0x49')][_0x9f14('0x52')]({'where':{'id':_0x2b57cf[_0x9f14('0x4f')]['id']},'attributes':['securePassword']})[_0x9f14('0x1d')](respondWithResult(_0x27d48a,null))[_0x9f14('0x4d')](handleError(_0x27d48a,null));};exports[_0x9f14('0x6c')]=function(_0x25c953,_0x322679,_0x2cb246){if(_0x25c953[_0x9f14('0x53')]&&_0x25c953[_0x9f14('0x53')]['filename']){_0x25c953['body'][_0x9f14('0x59')]=_0x25c953[_0x9f14('0x53')][_0x9f14('0x54')];}return db[_0x9f14('0x49')]['find']({'where':{'id':_0x25c953[_0x9f14('0x4f')]['id']}})[_0x9f14('0x1d')](handleEntityNotFound(_0x322679,null))[_0x9f14('0x1d')](saveUpdates(_0x25c953['body'],null))[_0x9f14('0x1d')](respondWithResult(_0x322679,null))[_0x9f14('0x4d')](handleError(_0x322679,null));};var utilLicense=require('../../config/license/util');exports[_0x9f14('0x6d')]=function(_0x3be899,_0x47394b,_0x348ce7){var _0x457ce1=_0x9f14('0x56');var _0x5b4db1={'custom':![]};return utilLicense['getLicense']()[_0x9f14('0x1d')](function(_0x407abc){if(_0x407abc){_0x5b4db1=_0x407abc;}return db[_0x9f14('0x49')][_0x9f14('0x52')]({'where':{'id':_0x3be899[_0x9f14('0x4f')]['id']},'attributes':[_0x9f14('0x58'),_0x9f14('0x55'),_0x9f14('0x59'),_0x9f14('0x5a'),_0x9f14('0x5b'),_0x9f14('0x68'),_0x9f14('0x5c'),'defaultFavicon'],'raw':!![]});})[_0x9f14('0x1d')](handleEntityNotFound(_0x47394b,null))[_0x9f14('0x1d')](function(_0x26c4e8){if(_0x26c4e8){var _0x564dfb=_0x26c4e8[_0x9f14('0x59')]&&fs['existsSync'](path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x457ce1,_[_0x9f14('0x61')](_0x26c4e8[_0x9f14('0x59')])))?path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x457ce1,_[_0x9f14('0x61')](_0x26c4e8['preferred'])):path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x457ce1,_[_0x9f14('0x61')](_0x9f14('0x6e')));var _0xf373ef=_0x9f14('0x63')+_[_0x9f14('0x66')]('preferred');if(_0x26c4e8[_0xf373ef]||!_0x5b4db1[_0x9f14('0x64')]||!_0x5b4db1[_0x9f14('0x59')]){_0x564dfb=path[_0x9f14('0x5f')](config['root'],_0x457ce1,_[_0x9f14('0x61')](_0x9f14('0x6e')));}if(!fs[_0x9f14('0x5e')](_0x564dfb)){throw new db['Sequelize'][(_0x9f14('0x6f'))](_[_0x9f14('0x66')](_0x9f14('0x59'))+_0x9f14('0x6a'));}return _0x47394b[_0x9f14('0x6b')](_0x564dfb);}})[_0x9f14('0x4d')](handleError(_0x47394b,null));};exports['addFavicon']=function(_0x336ca8,_0x615452,_0x2c74e7){if(_0x336ca8['file']&&_0x336ca8[_0x9f14('0x53')][_0x9f14('0x54')]){_0x336ca8[_0x9f14('0x51')][_0x9f14('0x5a')]=_0x336ca8[_0x9f14('0x53')][_0x9f14('0x54')];}return db[_0x9f14('0x49')]['find']({'where':{'id':_0x336ca8['params']['id']}})[_0x9f14('0x1d')](handleEntityNotFound(_0x615452,null))[_0x9f14('0x1d')](saveUpdates(_0x336ca8['body'],null))['then'](respondWithResult(_0x615452,null))['catch'](handleError(_0x615452,null));};var utilLicense=require('../../config/license/util');exports[_0x9f14('0x70')]=function(_0x5442cb,_0x36c424,_0x5b6263){var _0x53fce1=_0x9f14('0x56');var _0x171a01={'custom':![]};return utilLicense[_0x9f14('0x57')]()['then'](function(_0x374466){if(_0x374466){_0x171a01=_0x374466;}return db['Setting'][_0x9f14('0x52')]({'where':{'id':_0x5442cb[_0x9f14('0x4f')]['id']},'attributes':[_0x9f14('0x58'),'loginLogo',_0x9f14('0x59'),_0x9f14('0x5a'),'defaultLogo',_0x9f14('0x68'),_0x9f14('0x5c'),_0x9f14('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x36c424,null))[_0x9f14('0x1d')](function(_0x46e004){if(_0x46e004){var _0x119f28=_0x46e004[_0x9f14('0x5a')]&&fs['existsSync'](path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x53fce1,_['toLower'](_0x46e004[_0x9f14('0x5a')])))?path['join'](config[_0x9f14('0x60')],_0x53fce1,_[_0x9f14('0x61')](_0x46e004[_0x9f14('0x5a')])):path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x53fce1,_[_0x9f14('0x61')](_0x9f14('0x71')));var _0x5890ed=_0x9f14('0x63')+_[_0x9f14('0x66')](_0x9f14('0x5a'));if(_0x46e004[_0x5890ed]||!_0x171a01[_0x9f14('0x64')]){_0x119f28=path[_0x9f14('0x5f')](config[_0x9f14('0x60')],_0x53fce1,_['toLower']('default_favicon.ico'));}if(!fs['existsSync'](_0x119f28)){throw new db[(_0x9f14('0x65'))][(_0x9f14('0x6f'))](_[_0x9f14('0x66')](_0x9f14('0x5a'))+'\x20not\x20found');}return _0x36c424[_0x9f14('0x6b')](_0x119f28);}})[_0x9f14('0x4d')](handleError(_0x36c424,null));};exports[_0x9f14('0x72')]=function(_0x12cbcb,_0x54ba27){var _0xf4bf29={'offset':moment()[_0x9f14('0x73')]()};_0xf4bf29[_0x9f14('0x74')]=moment()[_0x9f14('0x73')](_0xf4bf29[_0x9f14('0x29')])[_0x9f14('0x75')](_0x9f14('0x76'));return _0x54ba27['status'](0xc8)[_0x9f14('0x77')](_0xf4bf29);};
\ No newline at end of file
+var _0xa6b3=['fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','end','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','body','find','params','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','defaultLogo','defaultLoginLogo','defaultPreferred','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','download','getLogoLogin','preferred','favicon','defaultFavicon','default_loginLogo.svg','ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x3d341c,_0x13679){var _0x3ea876=function(_0x1e0b2a){while(--_0x1e0b2a){_0x3d341c['push'](_0x3d341c['shift']());}};_0x3ea876(++_0x13679);}(_0xa6b3,0x72));var _0x3a6b=function(_0x3e093e,_0xbc2ce3){_0x3e093e=_0x3e093e-0x0;var _0x51b5b1=_0xa6b3[_0x3e093e];return _0x51b5b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a6b('0x1'));var rp=require('request-promise');var moment=require(_0x3a6b('0x2'));var BPromise=require(_0x3a6b('0x3'));var Mustache=require('mustache');var util=require(_0x3a6b('0x4'));var path=require(_0x3a6b('0x5'));var sox=require(_0x3a6b('0x6'));var csv=require(_0x3a6b('0x7'));var ejs=require(_0x3a6b('0x8'));var fs=require('fs');var fs_extra=require(_0x3a6b('0x9'));var _=require('lodash');var squel=require(_0x3a6b('0xa'));var crypto=require(_0x3a6b('0xb'));var jsforce=require(_0x3a6b('0xc'));var deskjs=require(_0x3a6b('0xd'));var toCsv=require(_0x3a6b('0x7'));var querystring=require('querystring');var Papa=require(_0x3a6b('0xe'));var Redis=require(_0x3a6b('0xf'));var authService=require(_0x3a6b('0x10'));var qs=require(_0x3a6b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a6b('0x12'));var logger=require('../../config/logger')(_0x3a6b('0x13'));var utils=require(_0x3a6b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3a6b('0x15'));var db=require(_0x3a6b('0x16'))['db'];var jayson=require(_0x3a6b('0x17'));var client=jayson[_0x3a6b('0x18')][_0x3a6b('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x13b2f1,_0x307c07,_0xb784e5,_0x155bb0){return new BPromise(function(_0xa46c39,_0x58e63c){var _0x4edcb3=_0x155bb0||client;return _0x4edcb3[_0x3a6b('0x1a')](_0x13b2f1,_0xb784e5)[_0x3a6b('0x1b')](function(_0x4f8b0c){logger[_0x3a6b('0x1c')](_0x3a6b('0x1d'),_0x307c07,_0x3a6b('0x1e'));logger['debug'](_0x3a6b('0x1f'),_0x307c07,_0x3a6b('0x1e'),JSON['stringify'](_0x4f8b0c));if(_0x4f8b0c[_0x3a6b('0x20')]){if(_0x4f8b0c[_0x3a6b('0x20')][_0x3a6b('0x21')]===0x1f4){logger[_0x3a6b('0x20')]('Setting,\x20%s,\x20%s',_0x307c07,_0x4f8b0c[_0x3a6b('0x20')]['message']);return _0x58e63c(_0x4f8b0c[_0x3a6b('0x20')][_0x3a6b('0x22')]);}logger[_0x3a6b('0x20')](_0x3a6b('0x1d'),_0x307c07,_0x4f8b0c[_0x3a6b('0x20')]['message']);return _0xa46c39(_0x4f8b0c[_0x3a6b('0x20')][_0x3a6b('0x22')]);}else{logger[_0x3a6b('0x1c')](_0x3a6b('0x1d'),_0x307c07,'request\x20sent');_0xa46c39(_0x4f8b0c[_0x3a6b('0x23')][_0x3a6b('0x22')]);}})[_0x3a6b('0x24')](function(_0x4c7066){logger[_0x3a6b('0x20')]('Setting,\x20%s,\x20%s',_0x307c07,_0x4c7066);_0x58e63c(_0x4c7066);});});}function respondWithStatusCode(_0x1e218b,_0x24201d){_0x24201d=_0x24201d||0xcc;return function(_0xcd532e){if(_0xcd532e){return _0x1e218b[_0x3a6b('0x25')](_0x24201d);}return _0x1e218b['status'](_0x24201d)['end']();};}function respondWithResult(_0x1a4aae,_0x175165){_0x175165=_0x175165||0xc8;return function(_0x4d8bd3){if(_0x4d8bd3){return _0x1a4aae[_0x3a6b('0x26')](_0x175165)[_0x3a6b('0x27')](_0x4d8bd3);}};}function respondWithFilteredResult(_0x229cd1,_0x49f0a8){return function(_0x4e100c){if(_0x4e100c){var _0x1ecf6f=typeof _0x49f0a8[_0x3a6b('0x28')]===_0x3a6b('0x29')&&typeof _0x49f0a8['limit']===_0x3a6b('0x29');var _0x549f65=_0x4e100c[_0x3a6b('0x2a')];var _0x38a937=_0x1ecf6f?0x0:_0x49f0a8['offset'];var _0x19537d=_0x1ecf6f?_0x4e100c['count']:_0x49f0a8[_0x3a6b('0x28')]+_0x49f0a8['limit'];var _0x50baf4;if(_0x19537d>=_0x549f65){_0x19537d=_0x549f65;_0x50baf4=0xc8;}else{_0x50baf4=0xce;}_0x229cd1[_0x3a6b('0x26')](_0x50baf4);return _0x229cd1[_0x3a6b('0x2b')](_0x3a6b('0x2c'),_0x38a937+'-'+_0x19537d+'/'+_0x549f65)[_0x3a6b('0x27')](_0x4e100c);}return null;};}function patchUpdates(_0x23e4dd){return function(_0x10aa02){try{jsonpatch[_0x3a6b('0x2d')](_0x10aa02,_0x23e4dd,!![]);}catch(_0x408b1f){return BPromise[_0x3a6b('0x2e')](_0x408b1f);}return _0x10aa02[_0x3a6b('0x2f')]();};}function saveUpdates(_0x3f5cc5,_0x4b9782){return function(_0x2d5a17){if(_0x2d5a17){return _0x2d5a17[_0x3a6b('0x30')](_0x3f5cc5)[_0x3a6b('0x1b')](function(_0xa6b0c0){return _0xa6b0c0;});}return null;};}function removeEntity(_0x1d2ae8,_0x285614){return function(_0xb18cb8){if(_0xb18cb8){return _0xb18cb8['destroy']()[_0x3a6b('0x1b')](function(){_0x1d2ae8['status'](0xcc)[_0x3a6b('0x31')]();});}};}function handleEntityNotFound(_0x4ca004,_0x207a42){return function(_0x478d24){if(!_0x478d24){_0x4ca004[_0x3a6b('0x25')](0x194);}return _0x478d24;};}function handleError(_0x1e6d71,_0x5c8015){_0x5c8015=_0x5c8015||0x1f4;return function(_0x3b1d4c){logger[_0x3a6b('0x20')](_0x3b1d4c[_0x3a6b('0x32')]);if(_0x3b1d4c[_0x3a6b('0x33')]){delete _0x3b1d4c[_0x3a6b('0x33')];}_0x1e6d71[_0x3a6b('0x26')](_0x5c8015)['send'](_0x3b1d4c);};}exports['index']=function(_0xa02ab8,_0x4f3afe){var _0x1cb3ff={},_0x182d7c={},_0xef72e2={'count':0x0,'rows':[]};var _0x129b5e=_[_0x3a6b('0x34')](db[_0x3a6b('0x35')][_0x3a6b('0x36')],function(_0x944759){return{'name':_0x944759[_0x3a6b('0x37')],'type':_0x944759[_0x3a6b('0x38')][_0x3a6b('0x39')]};});_0x182d7c[_0x3a6b('0x3a')]=_[_0x3a6b('0x34')](_0x129b5e,_0x3a6b('0x33'));_0x182d7c[_0x3a6b('0x3b')]=_[_0x3a6b('0x3c')](_0xa02ab8[_0x3a6b('0x3b')]);_0x182d7c[_0x3a6b('0x3d')]=_[_0x3a6b('0x3e')](_0x182d7c[_0x3a6b('0x3a')],_0x182d7c[_0x3a6b('0x3b')]);_0x1cb3ff[_0x3a6b('0x3f')]=_[_0x3a6b('0x3e')](_0x182d7c[_0x3a6b('0x3a')],qs[_0x3a6b('0x40')](_0xa02ab8[_0x3a6b('0x3b')]['fields']));_0x1cb3ff[_0x3a6b('0x3f')]=_0x1cb3ff[_0x3a6b('0x3f')][_0x3a6b('0x41')]?_0x1cb3ff[_0x3a6b('0x3f')]:_0x182d7c['model'];if(!_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x42')](_0x3a6b('0x43'))){_0x1cb3ff[_0x3a6b('0x44')]=qs[_0x3a6b('0x44')](_0xa02ab8[_0x3a6b('0x3b')]['limit']);_0x1cb3ff[_0x3a6b('0x28')]=qs['offset'](_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x28')]);}_0x1cb3ff['order']=qs[_0x3a6b('0x45')](_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x45')]);_0x1cb3ff['where']=qs[_0x3a6b('0x3d')](_[_0x3a6b('0x46')](_0xa02ab8[_0x3a6b('0x3b')],_0x182d7c[_0x3a6b('0x3d')]),_0x129b5e);if(_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x47')]){_0x1cb3ff[_0x3a6b('0x48')]=_[_0x3a6b('0x49')](_0x1cb3ff[_0x3a6b('0x48')],{'$or':_[_0x3a6b('0x34')](_0x129b5e,function(_0x43d6dd){if(_0x43d6dd[_0x3a6b('0x38')]!==_0x3a6b('0x4a')){var _0x4eac0e={};_0x4eac0e[_0x43d6dd['name']]={'$like':'%'+_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x47')]+'%'};return _0x4eac0e;}})});}_0x1cb3ff=_[_0x3a6b('0x49')]({},_0x1cb3ff,_0xa02ab8['options']);var _0x22ae37={'where':_0x1cb3ff['where']};return db[_0x3a6b('0x35')]['count'](_0x22ae37)[_0x3a6b('0x1b')](function(_0x13f94e){_0xef72e2[_0x3a6b('0x2a')]=_0x13f94e;if(_0xa02ab8[_0x3a6b('0x3b')][_0x3a6b('0x4b')]){_0x1cb3ff[_0x3a6b('0x4c')]=[{'all':!![]}];}return db[_0x3a6b('0x35')][_0x3a6b('0x4d')](_0x1cb3ff);})['then'](function(_0x1c3290){_0xef72e2[_0x3a6b('0x4e')]=_0x1c3290;return _0xef72e2;})[_0x3a6b('0x1b')](respondWithFilteredResult(_0x4f3afe,_0x1cb3ff))['catch'](handleError(_0x4f3afe,null));};exports[_0x3a6b('0x4f')]=function(_0x274fa3,_0x2e0994){var _0x15925a={'raw':![],'where':{'id':_0x274fa3['params']['id']}},_0x16a1b2={};_0x16a1b2[_0x3a6b('0x3a')]=_[_0x3a6b('0x3c')](db[_0x3a6b('0x35')][_0x3a6b('0x36')]);_0x16a1b2[_0x3a6b('0x3b')]=_[_0x3a6b('0x3c')](_0x274fa3['query']);_0x16a1b2[_0x3a6b('0x3d')]=_[_0x3a6b('0x3e')](_0x16a1b2[_0x3a6b('0x3a')],_0x16a1b2[_0x3a6b('0x3b')]);_0x15925a[_0x3a6b('0x3f')]=_['intersection'](_0x16a1b2[_0x3a6b('0x3a')],qs[_0x3a6b('0x40')](_0x274fa3['query'][_0x3a6b('0x40')]));_0x15925a[_0x3a6b('0x3f')]=_0x15925a[_0x3a6b('0x3f')][_0x3a6b('0x41')]?_0x15925a['attributes']:_0x16a1b2[_0x3a6b('0x3a')];if(_0x274fa3[_0x3a6b('0x3b')][_0x3a6b('0x4b')]){_0x15925a[_0x3a6b('0x4c')]=[{'all':!![]}];}_0x15925a=_[_0x3a6b('0x49')]({},_0x15925a,_0x274fa3[_0x3a6b('0x50')]);return db[_0x3a6b('0x35')]['find'](_0x15925a)[_0x3a6b('0x1b')](handleEntityNotFound(_0x2e0994,null))[_0x3a6b('0x1b')](respondWithResult(_0x2e0994,null))[_0x3a6b('0x24')](handleError(_0x2e0994,null));};exports[_0x3a6b('0x30')]=function(_0x426ed2,_0x3d5807){if(_0x426ed2[_0x3a6b('0x51')]['id']){delete _0x426ed2[_0x3a6b('0x51')]['id'];}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x426ed2[_0x3a6b('0x53')]['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x3d5807,null))[_0x3a6b('0x1b')](saveUpdates(_0x426ed2['body'],null))[_0x3a6b('0x1b')](respondWithResult(_0x3d5807,null))[_0x3a6b('0x24')](handleError(_0x3d5807,null));};exports[_0x3a6b('0x54')]=function(_0x59f44f,_0x6ab3db,_0x5af627){if(_0x59f44f['file']&&_0x59f44f[_0x3a6b('0x55')][_0x3a6b('0x56')]){_0x59f44f['body'][_0x3a6b('0x57')]=_0x59f44f[_0x3a6b('0x55')]['filename'];}return db['Setting'][_0x3a6b('0x52')]({'where':{'id':_0x59f44f['params']['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x6ab3db,null))[_0x3a6b('0x1b')](saveUpdates(_0x59f44f[_0x3a6b('0x51')],null))['then'](respondWithResult(_0x6ab3db,null))[_0x3a6b('0x24')](handleError(_0x6ab3db,null));};exports[_0x3a6b('0x58')]=function(_0x47c5e2,_0x1ce60f,_0x75b9df){if(_0x47c5e2[_0x3a6b('0x55')]&&_0x47c5e2['file'][_0x3a6b('0x56')]){_0x47c5e2[_0x3a6b('0x51')]['loginLogo']=_0x47c5e2[_0x3a6b('0x55')]['filename'];}return db['Setting']['find']({'where':{'id':_0x47c5e2[_0x3a6b('0x53')]['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x1ce60f,null))[_0x3a6b('0x1b')](saveUpdates(_0x47c5e2[_0x3a6b('0x51')],null))[_0x3a6b('0x1b')](respondWithResult(_0x1ce60f,null))[_0x3a6b('0x24')](handleError(_0x1ce60f,null));};var utilLicense=require(_0x3a6b('0x15'));exports[_0x3a6b('0x59')]=function(_0x342966,_0x15cae3,_0x4e8183){var _0x40b7f1=_0x3a6b('0x5a');var _0x33ca93={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()['then'](function(_0x394228){if(_0x394228){_0x33ca93=_0x394228;}return db['Setting']['find']({'where':{'id':_0x342966['params']['id']},'attributes':[_0x3a6b('0x57'),_0x3a6b('0x5c'),'preferred','favicon',_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x3a6b('0x1b')](handleEntityNotFound(_0x15cae3,null))[_0x3a6b('0x1b')](function(_0x415fea){if(_0x415fea){var _0x31a57f=_0x415fea[_0x3a6b('0x57')]&&fs['existsSync'](path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x40b7f1,_[_0x3a6b('0x62')](_0x415fea[_0x3a6b('0x57')])))?path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x40b7f1,_['toLower'](_0x415fea['logo'])):path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x40b7f1,_['toLower'](_0x3a6b('0x63')));var _0x4ee5de=_0x3a6b('0x64')+_[_0x3a6b('0x65')](_0x3a6b('0x57'));if(_0x415fea[_0x4ee5de]||!_0x33ca93[_0x3a6b('0x66')]){_0x31a57f=path[_0x3a6b('0x60')](config['root'],_0x40b7f1,_[_0x3a6b('0x62')](_0x3a6b('0x63')));}if(!fs[_0x3a6b('0x67')](_0x31a57f)){throw new db[(_0x3a6b('0x68'))]['ValidationError'](_[_0x3a6b('0x65')](_0x3a6b('0x57'))+'\x20not\x20found');}return _0x15cae3[_0x3a6b('0x69')](_0x31a57f);}})[_0x3a6b('0x24')](handleError(_0x15cae3,null));};var utilLicense=require(_0x3a6b('0x15'));exports[_0x3a6b('0x6a')]=function(_0x4033cf,_0x3d8506,_0x1c6dd2){var _0x2989ec=_0x3a6b('0x5a');var _0x48480d={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()[_0x3a6b('0x1b')](function(_0x73e887){if(_0x73e887){_0x48480d=_0x73e887;}return db[_0x3a6b('0x35')]['find']({'where':{'id':_0x4033cf[_0x3a6b('0x53')]['id']},'attributes':['logo',_0x3a6b('0x5c'),_0x3a6b('0x6b'),_0x3a6b('0x6c'),_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),_0x3a6b('0x6d')],'raw':!![]});})[_0x3a6b('0x1b')](handleEntityNotFound(_0x3d8506,null))[_0x3a6b('0x1b')](function(_0xd95577){if(_0xd95577){var _0xda82b9=_0xd95577[_0x3a6b('0x5c')]&&fs[_0x3a6b('0x67')](path['join'](config['root'],_0x2989ec,_[_0x3a6b('0x62')](_0xd95577[_0x3a6b('0x5c')])))?path['join'](config[_0x3a6b('0x61')],_0x2989ec,_[_0x3a6b('0x62')](_0xd95577[_0x3a6b('0x5c')])):path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x2989ec,_['toLower'](_0x3a6b('0x6e')));var _0xa56ab5=_0x3a6b('0x64')+_['upperFirst'](_0x3a6b('0x5c'));if(_0xd95577[_0xa56ab5]||!_0x48480d[_0x3a6b('0x66')]){_0xda82b9=path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x2989ec,_[_0x3a6b('0x62')](_0x3a6b('0x6e')));}if(!fs[_0x3a6b('0x67')](_0xda82b9)){throw new db[(_0x3a6b('0x68'))][(_0x3a6b('0x6f'))](_[_0x3a6b('0x65')]('loginLogo')+_0x3a6b('0x70'));}return _0x3d8506[_0x3a6b('0x69')](_0xda82b9);}})[_0x3a6b('0x24')](handleError(_0x3d8506,null));};exports[_0x3a6b('0x71')]=function(_0x22e16c,_0x1f9334){return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x22e16c['params']['id']},'attributes':[_0x3a6b('0x72')]})[_0x3a6b('0x1b')](respondWithResult(_0x1f9334,null))[_0x3a6b('0x24')](handleError(_0x1f9334,null));};exports[_0x3a6b('0x73')]=function(_0x481297,_0x4dc98f,_0x40d36a){if(_0x481297[_0x3a6b('0x55')]&&_0x481297[_0x3a6b('0x55')][_0x3a6b('0x56')]){_0x481297[_0x3a6b('0x51')]['preferred']=_0x481297[_0x3a6b('0x55')][_0x3a6b('0x56')];}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x481297[_0x3a6b('0x53')]['id']}})['then'](handleEntityNotFound(_0x4dc98f,null))[_0x3a6b('0x1b')](saveUpdates(_0x481297['body'],null))[_0x3a6b('0x1b')](respondWithResult(_0x4dc98f,null))['catch'](handleError(_0x4dc98f,null));};var utilLicense=require(_0x3a6b('0x15'));exports['getPreferred']=function(_0x71d36d,_0x2c94df,_0x7ae210){var _0x2a029a=_0x3a6b('0x5a');var _0x3801a6={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()[_0x3a6b('0x1b')](function(_0x59025f){if(_0x59025f){_0x3801a6=_0x59025f;}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x71d36d[_0x3a6b('0x53')]['id']},'attributes':[_0x3a6b('0x57'),_0x3a6b('0x5c'),'preferred',_0x3a6b('0x6c'),_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x3a6b('0x1b')](handleEntityNotFound(_0x2c94df,null))[_0x3a6b('0x1b')](function(_0x5059a9){if(_0x5059a9){var _0x24e413=_0x5059a9[_0x3a6b('0x6b')]&&fs[_0x3a6b('0x67')](path['join'](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x5059a9[_0x3a6b('0x6b')])))?path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x5059a9[_0x3a6b('0x6b')])):path['join'](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x3a6b('0x74')));var _0x4007de=_0x3a6b('0x64')+_['upperFirst'](_0x3a6b('0x6b'));if(_0x5059a9[_0x4007de]||!_0x3801a6[_0x3a6b('0x66')]||!_0x3801a6[_0x3a6b('0x6b')]){_0x24e413=path['join'](config[_0x3a6b('0x61')],_0x2a029a,_[_0x3a6b('0x62')](_0x3a6b('0x74')));}if(!fs['existsSync'](_0x24e413)){throw new db[(_0x3a6b('0x68'))][(_0x3a6b('0x6f'))](_[_0x3a6b('0x65')](_0x3a6b('0x6b'))+_0x3a6b('0x70'));}return _0x2c94df[_0x3a6b('0x69')](_0x24e413);}})[_0x3a6b('0x24')](handleError(_0x2c94df,null));};exports[_0x3a6b('0x75')]=function(_0x12748b,_0x306c12,_0x3d174e){if(_0x12748b['file']&&_0x12748b[_0x3a6b('0x55')]['filename']){_0x12748b[_0x3a6b('0x51')]['favicon']=_0x12748b['file'][_0x3a6b('0x56')];}return db['Setting'][_0x3a6b('0x52')]({'where':{'id':_0x12748b[_0x3a6b('0x53')]['id']}})[_0x3a6b('0x1b')](handleEntityNotFound(_0x306c12,null))[_0x3a6b('0x1b')](saveUpdates(_0x12748b[_0x3a6b('0x51')],null))[_0x3a6b('0x1b')](respondWithResult(_0x306c12,null))['catch'](handleError(_0x306c12,null));};var utilLicense=require(_0x3a6b('0x15'));exports[_0x3a6b('0x76')]=function(_0x1d6f97,_0x413e7d,_0x5269e8){var _0x5e0f3d=_0x3a6b('0x5a');var _0x37ba63={'custom':![]};return utilLicense[_0x3a6b('0x5b')]()[_0x3a6b('0x1b')](function(_0x77b8e4){if(_0x77b8e4){_0x37ba63=_0x77b8e4;}return db[_0x3a6b('0x35')][_0x3a6b('0x52')]({'where':{'id':_0x1d6f97[_0x3a6b('0x53')]['id']},'attributes':[_0x3a6b('0x57'),'loginLogo','preferred','favicon',_0x3a6b('0x5d'),_0x3a6b('0x5e'),_0x3a6b('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x413e7d,null))['then'](function(_0xf4e06a){if(_0xf4e06a){var _0x3bb246=_0xf4e06a[_0x3a6b('0x6c')]&&fs[_0x3a6b('0x67')](path[_0x3a6b('0x60')](config['root'],_0x5e0f3d,_[_0x3a6b('0x62')](_0xf4e06a[_0x3a6b('0x6c')])))?path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x5e0f3d,_[_0x3a6b('0x62')](_0xf4e06a[_0x3a6b('0x6c')])):path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x5e0f3d,_[_0x3a6b('0x62')]('default_favicon.ico'));var _0x1a287c='default'+_[_0x3a6b('0x65')](_0x3a6b('0x6c'));if(_0xf4e06a[_0x1a287c]||!_0x37ba63[_0x3a6b('0x66')]){_0x3bb246=path[_0x3a6b('0x60')](config[_0x3a6b('0x61')],_0x5e0f3d,_[_0x3a6b('0x62')]('default_favicon.ico'));}if(!fs['existsSync'](_0x3bb246)){throw new db[(_0x3a6b('0x68'))][(_0x3a6b('0x6f'))](_[_0x3a6b('0x65')](_0x3a6b('0x6c'))+'\x20not\x20found');}return _0x413e7d['download'](_0x3bb246);}})[_0x3a6b('0x24')](handleError(_0x413e7d,null));};exports['getDate']=function(_0x10c9f7,_0x1fbb2e){var _0x52f056={'offset':moment()[_0x3a6b('0x77')]()};_0x52f056[_0x3a6b('0x78')]=moment()[_0x3a6b('0x77')](_0x52f056[_0x3a6b('0x28')])[_0x3a6b('0x79')](_0x3a6b('0x7a'));return _0x1fbb2e['status'](0xc8)['send'](_0x52f056);};
\ No newline at end of file
index 6306f8c..bbc18c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x489269,_0x33c55d){var _0x41c76a=function(_0x3d2e3a){while(--_0x3d2e3a){_0x489269['push'](_0x489269['shift']());}};_0x41c76a(++_0x33c55d);}(_0xedd9,0xfc));var _0x9edd=function(_0x264781,_0x27bf68){_0x264781=_0x264781-0x0;var _0x382f5a=_0xedd9[_0x264781];return _0x382f5a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x406115,_0x19f7a1){var _0xbbabdb=function(_0x28554d){while(--_0x28554d){_0x406115['push'](_0x406115['shift']());}};_0xbbabdb(++_0x19f7a1);}(_0x55ca,0x126));var _0xa55c=function(_0x460358,_0x45d45e){_0x460358=_0x460358-0x0;var _0x2e6a60=_0x55ca[_0x460358];return _0x2e6a60;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da85100..6105990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3b3=['then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x23a8a2,_0x4bf422){var _0x4be19e=function(_0x7e7a54){while(--_0x7e7a54){_0x23a8a2['push'](_0x23a8a2['shift']());}};_0x4be19e(++_0x4bf422);}(_0xe3b3,0x135));var _0x3e3b=function(_0x159347,_0x3bea25){_0x159347=_0x159347-0x0;var _0x15a598=_0xe3b3[_0x159347];return _0x15a598;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var moment=require(_0x3e3b('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e3b('0x3'));var fs=require('fs');var Redis=require(_0x3e3b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e3b('0x5'));var logger=require(_0x3e3b('0x6'))('rpc');var config=require(_0x3e3b('0x7'));var jayson=require(_0x3e3b('0x8'));var client=jayson[_0x3e3b('0x9')][_0x3e3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ad6ce,_0x403c02,_0x183e55){return new BPromise(function(_0x70b995,_0x536d1b){return client['request'](_0x2ad6ce,_0x183e55)[_0x3e3b('0xb')](function(_0x103001){logger[_0x3e3b('0xc')](_0x3e3b('0xd'),_0x403c02,_0x3e3b('0xe'));logger[_0x3e3b('0xf')](_0x3e3b('0x10'),_0x403c02,'request\x20sent',JSON[_0x3e3b('0x11')](_0x103001));if(_0x103001['error']){if(_0x103001[_0x3e3b('0x12')][_0x3e3b('0x13')]===0x1f4){logger[_0x3e3b('0x12')](_0x3e3b('0xd'),_0x403c02,_0x103001[_0x3e3b('0x12')][_0x3e3b('0x14')]);return _0x536d1b(_0x103001[_0x3e3b('0x12')][_0x3e3b('0x14')]);}logger[_0x3e3b('0x12')](_0x3e3b('0xd'),_0x403c02,_0x103001[_0x3e3b('0x12')][_0x3e3b('0x14')]);return _0x70b995(_0x103001[_0x3e3b('0x12')][_0x3e3b('0x14')]);}else{logger[_0x3e3b('0xc')](_0x3e3b('0xd'),_0x403c02,_0x3e3b('0xe'));_0x70b995(_0x103001['result']['message']);}})['catch'](function(_0x36268e){logger[_0x3e3b('0x12')](_0x3e3b('0xd'),_0x403c02,_0x36268e);_0x536d1b(_0x36268e);});});}exports[_0x3e3b('0x15')]=function(_0x1084ff){var _0x40a35d=this;return new Promise(function(_0x124102,_0x31f5ad){return db[_0x3e3b('0x16')][_0x3e3b('0x17')]({'raw':_0x1084ff['options']?_0x1084ff[_0x3e3b('0x18')][_0x3e3b('0x19')]===undefined?!![]:![]:!![],'where':_0x1084ff[_0x3e3b('0x18')]?_0x1084ff['options'][_0x3e3b('0x1a')]||null:null,'attributes':_0x1084ff[_0x3e3b('0x18')]?_0x1084ff[_0x3e3b('0x18')][_0x3e3b('0x1b')]||null:null,'include':_0x1084ff[_0x3e3b('0x18')]?_0x1084ff['options'][_0x3e3b('0x1c')]?_['map'](_0x1084ff[_0x3e3b('0x18')][_0x3e3b('0x1c')],function(_0x499351){return{'model':db[_0x499351[_0x3e3b('0x1d')]],'as':_0x499351['as'],'attributes':_0x499351[_0x3e3b('0x1b')],'include':_0x499351['include']?_[_0x3e3b('0x1e')](_0x499351[_0x3e3b('0x1c')],function(_0x525f29){return{'model':db[_0x525f29['model']],'as':_0x525f29['as'],'attributes':_0x525f29['attributes'],'include':_0x525f29[_0x3e3b('0x1c')]?_[_0x3e3b('0x1e')](_0x525f29[_0x3e3b('0x1c')],function(_0x58e795){return{'model':db[_0x58e795['model']],'as':_0x58e795['as'],'attributes':_0x58e795[_0x3e3b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3e3b('0xb')](function(_0x4652f9){logger[_0x3e3b('0xc')](_0x3e3b('0x15'),_0x1084ff);logger[_0x3e3b('0xf')](_0x3e3b('0x15'),_0x1084ff,JSON['stringify'](_0x4652f9));_0x124102(_0x4652f9);})[_0x3e3b('0x1f')](function(_0x4c0178){logger[_0x3e3b('0x12')](_0x3e3b('0x15'),_0x4c0178[_0x3e3b('0x14')],_0x1084ff);_0x31f5ad(_0x40a35d[_0x3e3b('0x12')](0x1f4,_0x4c0178['message']));});});};
\ No newline at end of file
+var _0x3c38=['Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Setting','find','options','where','include','map','model','attributes','ShowSetting','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info'];(function(_0x3e52d7,_0xdc621b){var _0x1b126f=function(_0x57a094){while(--_0x57a094){_0x3e52d7['push'](_0x3e52d7['shift']());}};_0x1b126f(++_0xdc621b);}(_0x3c38,0x15d));var _0x83c3=function(_0x57866f,_0x22cff3){_0x57866f=_0x57866f-0x0;var _0x3de227=_0x3c38[_0x57866f];return _0x3de227;};'use strict';var _=require(_0x83c3('0x0'));var util=require(_0x83c3('0x1'));var moment=require(_0x83c3('0x2'));var BPromise=require(_0x83c3('0x3'));var rs=require(_0x83c3('0x4'));var fs=require('fs');var Redis=require(_0x83c3('0x5'));var db=require(_0x83c3('0x6'))['db'];var utils=require(_0x83c3('0x7'));var logger=require(_0x83c3('0x8'))(_0x83c3('0x9'));var config=require('../../config/environment');var jayson=require(_0x83c3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36572d,_0x279faa,_0x5bdd25){return new BPromise(function(_0x3632d5,_0x325d19){return client[_0x83c3('0xb')](_0x36572d,_0x5bdd25)[_0x83c3('0xc')](function(_0x23f3a2){logger[_0x83c3('0xd')](_0x83c3('0xe'),_0x279faa,_0x83c3('0xf'));logger['debug'](_0x83c3('0x10'),_0x279faa,_0x83c3('0xf'),JSON[_0x83c3('0x11')](_0x23f3a2));if(_0x23f3a2[_0x83c3('0x12')]){if(_0x23f3a2['error'][_0x83c3('0x13')]===0x1f4){logger['error'](_0x83c3('0xe'),_0x279faa,_0x23f3a2[_0x83c3('0x12')][_0x83c3('0x14')]);return _0x325d19(_0x23f3a2[_0x83c3('0x12')]['message']);}logger[_0x83c3('0x12')]('Setting,\x20%s,\x20%s',_0x279faa,_0x23f3a2[_0x83c3('0x12')][_0x83c3('0x14')]);return _0x3632d5(_0x23f3a2[_0x83c3('0x12')][_0x83c3('0x14')]);}else{logger[_0x83c3('0xd')](_0x83c3('0xe'),_0x279faa,_0x83c3('0xf'));_0x3632d5(_0x23f3a2[_0x83c3('0x15')][_0x83c3('0x14')]);}})[_0x83c3('0x16')](function(_0x5d7b54){logger[_0x83c3('0x12')](_0x83c3('0xe'),_0x279faa,_0x5d7b54);_0x325d19(_0x5d7b54);});});}exports['ShowSetting']=function(_0x1b5d4){var _0x2c7ce7=this;return new Promise(function(_0x4036aa,_0x2fba20){return db[_0x83c3('0x17')][_0x83c3('0x18')]({'raw':_0x1b5d4[_0x83c3('0x19')]?_0x1b5d4['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b5d4[_0x83c3('0x19')]?_0x1b5d4['options'][_0x83c3('0x1a')]||null:null,'attributes':_0x1b5d4['options']?_0x1b5d4[_0x83c3('0x19')]['attributes']||null:null,'include':_0x1b5d4[_0x83c3('0x19')]?_0x1b5d4[_0x83c3('0x19')][_0x83c3('0x1b')]?_[_0x83c3('0x1c')](_0x1b5d4[_0x83c3('0x19')]['include'],function(_0x474c4c){return{'model':db[_0x474c4c[_0x83c3('0x1d')]],'as':_0x474c4c['as'],'attributes':_0x474c4c[_0x83c3('0x1e')],'include':_0x474c4c[_0x83c3('0x1b')]?_[_0x83c3('0x1c')](_0x474c4c[_0x83c3('0x1b')],function(_0x38c4ac){return{'model':db[_0x38c4ac[_0x83c3('0x1d')]],'as':_0x38c4ac['as'],'attributes':_0x38c4ac[_0x83c3('0x1e')],'include':_0x38c4ac[_0x83c3('0x1b')]?_[_0x83c3('0x1c')](_0x38c4ac['include'],function(_0x20926c){return{'model':db[_0x20926c[_0x83c3('0x1d')]],'as':_0x20926c['as'],'attributes':_0x20926c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x31905f){logger[_0x83c3('0xd')](_0x83c3('0x1f'),_0x1b5d4);logger[_0x83c3('0x20')](_0x83c3('0x1f'),_0x1b5d4,JSON[_0x83c3('0x11')](_0x31905f));_0x4036aa(_0x31905f);})[_0x83c3('0x16')](function(_0xe7fd4a){logger[_0x83c3('0x12')](_0x83c3('0x1f'),_0xe7fd4a[_0x83c3('0x14')],_0x1b5d4);_0x2fba20(_0x2c7ce7[_0x83c3('0x12')](0x1f4,_0xe7fd4a[_0x83c3('0x14')]));});});};
\ No newline at end of file
index c744f7c..ab6046b 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(_0x3e5cd5,_0x58272b){var _0x1b8d19=function(_0x3e216b){while(--_0x3e216b){_0x3e5cd5['push'](_0x3e5cd5['shift']());}};_0x1b8d19(++_0x58272b);}(_0xe14b,0x93));var _0xbe14=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0xe14b[_0x349148];return _0x2f2b0f;};'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 _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7217,0x19e));var _0x7721=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7217[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index aab1d92..ed0afd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23f4=['INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','intelepeer','BOOLEAN'];(function(_0x5b0ce7,_0x49bb4b){var _0xf26993=function(_0x249303){while(--_0x249303){_0x5b0ce7['push'](_0x5b0ce7['shift']());}};_0xf26993(++_0x49bb4b);}(_0x23f4,0x16c));var _0x423f=function(_0x5585e4,_0xd1f2ae){_0x5585e4=_0x5585e4-0x0;var _0x42c8f6=_0x23f4[_0x5585e4];return _0x42c8f6;};'use strict';var Sequelize=require(_0x423f('0x0'));var rs=require(_0x423f('0x1'));module['exports']={'name':{'type':Sequelize[_0x423f('0x2')],'unique':_0x423f('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x423f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x423f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x423f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x423f('0x2')]},'type':{'type':Sequelize[_0x423f('0x4')](_0x423f('0x5'),_0x423f('0x6'),_0x423f('0x7'),_0x423f('0x8'),'plivo',_0x423f('0x9'),_0x423f('0xa'),_0x423f('0xb'),'infobip',_0x423f('0xc'))},'accountSid':{'type':Sequelize[_0x423f('0x2')]},'authId':{'type':Sequelize[_0x423f('0x2')]},'authToken':{'type':Sequelize[_0x423f('0x2')]},'smsMethod':{'type':Sequelize[_0x423f('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x423f('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x423f('0x2')]},'applicationId':{'type':Sequelize[_0x423f('0x2')]},'accountId':{'type':Sequelize[_0x423f('0x2')]},'senderString':{'type':Sequelize[_0x423f('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x423f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x423f('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x423f('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x423f('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x423f('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x423f('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x423f('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x423f('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x423f('0xe')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x423f('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x35d46b){if(!_0x35d46b)this[_0x423f('0xf')](_0x423f('0x10'),null);this[_0x423f('0xf')](_0x423f('0x11'),_0x35d46b);}}};
\ No newline at end of file
+var _0x5e55=['intelepeer','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','STRING','name','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','infobip'];(function(_0x4d7125,_0x131e4f){var _0x3542f5=function(_0x250281){while(--_0x250281){_0x4d7125['push'](_0x4d7125['shift']());}};_0x3542f5(++_0x131e4f);}(_0x5e55,0xa8));var _0x55e5=function(_0xba0c2,_0x54cc50){_0xba0c2=_0xba0c2-0x0;var _0x5a9fa0=_0x5e55[_0xba0c2];return _0x5a9fa0;};'use strict';var Sequelize=require(_0x55e5('0x0'));var rs=require(_0x55e5('0x1'));module['exports']={'name':{'type':Sequelize[_0x55e5('0x2')],'unique':_0x55e5('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x55e5('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x55e5('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x55e5('0x2')]},'type':{'type':Sequelize[_0x55e5('0x4')](_0x55e5('0x5'),_0x55e5('0x6'),_0x55e5('0x7'),_0x55e5('0x8'),'plivo',_0x55e5('0x9'),_0x55e5('0xa'),'csc',_0x55e5('0xb'),_0x55e5('0xc'))},'accountSid':{'type':Sequelize[_0x55e5('0x2')]},'authId':{'type':Sequelize[_0x55e5('0x2')]},'authToken':{'type':Sequelize[_0x55e5('0x2')]},'smsMethod':{'type':Sequelize[_0x55e5('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x55e5('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x55e5('0x2')]},'applicationId':{'type':Sequelize[_0x55e5('0x2')]},'accountId':{'type':Sequelize[_0x55e5('0x2')]},'senderString':{'type':Sequelize[_0x55e5('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x55e5('0x2')]},'notificationTemplate':{'type':Sequelize[_0x55e5('0xd')],'defaultValue':function(){return _0x55e5('0xe');}},'notificationSound':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x55e5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x55e5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x55e5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x55e5('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x55e5('0xf')],'defaultValue':![],'comment':_0x55e5('0x11'),'set':function(_0x23c981){if(!_0x23c981)this['setDataValue'](_0x55e5('0x12'),null);this[_0x55e5('0x13')]('mandatoryDisposition',_0x23c981);}}};
\ No newline at end of file
index 23578c1..e70bd07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c25=['create','body','user','role','SmsAccounts','UserProfileSection','find','autoAssociation','params','describe','addDisposition','Disposition','hasOwnProperty','nolimit','removeDispositions','SmsAccountId','CannedAnswer','getAnswers','findAll','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','plivo','Text','MessageUUID','infobip','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','ContactId','User','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','findOne','sequelize','bulkCreate','getApplications','getInteractions','Contact','Owner','Tag','Tags','color','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','clicksend','message_id','status_code','results','groupName','DELIVERED','bandwidth','intelepeer','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','get','end','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','keys'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3c25,0x89));var _0x53c2=function(_0x6a8a67,_0x5c33b8){_0x6a8a67=_0x6a8a67-0x0;var _0x1f5260=_0x3c25[_0x6a8a67];return _0x1f5260;};'use strict';var emlformat=require(_0x53c2('0x0'));var rimraf=require(_0x53c2('0x1'));var zipdir=require(_0x53c2('0x2'));var jsonpatch=require(_0x53c2('0x3'));var rp=require(_0x53c2('0x4'));var moment=require(_0x53c2('0x5'));var BPromise=require(_0x53c2('0x6'));var Mustache=require(_0x53c2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x53c2('0x8'));var csv=require('to-csv');var ejs=require(_0x53c2('0x9'));var fs=require('fs');var fs_extra=require(_0x53c2('0xa'));var _=require(_0x53c2('0xb'));var squel=require(_0x53c2('0xc'));var crypto=require(_0x53c2('0xd'));var jsforce=require(_0x53c2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x53c2('0xf'));var querystring=require(_0x53c2('0x10'));var Papa=require(_0x53c2('0x11'));var Redis=require(_0x53c2('0x12'));var authService=require(_0x53c2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x53c2('0x14'));var hardwareService=require(_0x53c2('0x15'));var logger=require(_0x53c2('0x16'))(_0x53c2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x53c2('0x18'))['db'];config[_0x53c2('0x19')]=_[_0x53c2('0x1a')](config[_0x53c2('0x19')],{'host':_0x53c2('0x1b'),'port':0x18eb});var socket=require(_0x53c2('0x1c'))(new Redis(config[_0x53c2('0x19')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x53c2('0x1d'));var client=jayson['client'][_0x53c2('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x4d6cc8,_0x50ed21,_0x5cfd50,_0x4d4cf3){return new BPromise(function(_0x58e9c8,_0x2e9052){var _0x468a89=_0x4d4cf3||client;return _0x468a89[_0x53c2('0x1f')](_0x4d6cc8,_0x5cfd50)[_0x53c2('0x20')](function(_0xe40ba8){logger[_0x53c2('0x21')](_0x53c2('0x22'),_0x50ed21,_0x53c2('0x23'));logger[_0x53c2('0x24')](_0x53c2('0x25'),_0x50ed21,_0x53c2('0x23'),JSON['stringify'](_0xe40ba8));if(_0xe40ba8[_0x53c2('0x26')]){if(_0xe40ba8['error'][_0x53c2('0x27')]===0x1f4){logger[_0x53c2('0x26')]('SmsAccount,\x20%s,\x20%s',_0x50ed21,_0xe40ba8['error']['message']);return _0x2e9052(_0xe40ba8[_0x53c2('0x26')]['message']);}logger[_0x53c2('0x26')](_0x53c2('0x22'),_0x50ed21,_0xe40ba8[_0x53c2('0x26')][_0x53c2('0x28')]);return _0x58e9c8(_0xe40ba8[_0x53c2('0x26')]['message']);}else{logger['info'](_0x53c2('0x22'),_0x50ed21,'request\x20sent');_0x58e9c8(_0xe40ba8[_0x53c2('0x29')][_0x53c2('0x28')]);}})[_0x53c2('0x2a')](function(_0x4b1a18){logger[_0x53c2('0x26')](_0x53c2('0x22'),_0x50ed21,_0x4b1a18);_0x2e9052(_0x4b1a18);});});}function respondWithStatusCode(_0x3997c,_0x18da9a){_0x18da9a=_0x18da9a||0xcc;return function(_0xefe566){if(_0xefe566){return _0x3997c['sendStatus'](_0x18da9a);}return _0x3997c[_0x53c2('0x2b')](_0x18da9a)['end']();};}function respondWithResult(_0x47edca,_0x563e7f){_0x563e7f=_0x563e7f||0xc8;return function(_0x243c72){if(_0x243c72){return _0x47edca[_0x53c2('0x2b')](_0x563e7f)['json'](_0x243c72);}};}function respondWithFilteredResult(_0x18ae68,_0x4fe84a){return function(_0x5b31a9){if(_0x5b31a9){var _0x49e7d1=typeof _0x4fe84a[_0x53c2('0x2c')]===_0x53c2('0x2d')&&typeof _0x4fe84a[_0x53c2('0x2e')]===_0x53c2('0x2d');var _0x363ef2=_0x5b31a9[_0x53c2('0x2f')];var _0x25ec97=_0x49e7d1?0x0:_0x4fe84a['offset'];var _0x31d13c=_0x49e7d1?_0x5b31a9[_0x53c2('0x2f')]:_0x4fe84a[_0x53c2('0x2c')]+_0x4fe84a[_0x53c2('0x2e')];var _0x45c0ca;if(_0x31d13c>=_0x363ef2){_0x31d13c=_0x363ef2;_0x45c0ca=0xc8;}else{_0x45c0ca=0xce;}_0x18ae68[_0x53c2('0x2b')](_0x45c0ca);return _0x18ae68['set'](_0x53c2('0x30'),_0x25ec97+'-'+_0x31d13c+'/'+_0x363ef2)[_0x53c2('0x31')](_0x5b31a9);}return null;};}function patchUpdates(_0x4a1a39){return function(_0x10087d){try{jsonpatch[_0x53c2('0x32')](_0x10087d,_0x4a1a39,!![]);}catch(_0x598e1){return BPromise[_0x53c2('0x33')](_0x598e1);}return _0x10087d[_0x53c2('0x34')]();};}function saveUpdates(_0x36c2d6,_0x582031){return function(_0x5c6018){if(_0x5c6018){return _0x5c6018[_0x53c2('0x35')](_0x36c2d6)[_0x53c2('0x20')](function(_0xe295a4){return _0xe295a4;});}return null;};}function removeEntity(_0x317663,_0x1ed1e8){return function(_0xdf2f67){if(_0xdf2f67){return _0xdf2f67[_0x53c2('0x36')]()[_0x53c2('0x20')](function(){var _0x499adf=_0xdf2f67[_0x53c2('0x37')]({'plain':!![]});var _0x3b4cc6='SmsAccounts';return db['UserProfileResource'][_0x53c2('0x36')]({'where':{'type':_0x3b4cc6,'resourceId':_0x499adf['id']}})[_0x53c2('0x20')](function(){return _0xdf2f67;});})[_0x53c2('0x20')](function(){_0x317663[_0x53c2('0x2b')](0xcc)[_0x53c2('0x38')]();});}};}function handleEntityNotFound(_0x3f2339,_0x2fe370){return function(_0x2ca2ab){if(!_0x2ca2ab){_0x3f2339[_0x53c2('0x39')](0x194);}return _0x2ca2ab;};}function handleError(_0x2b2124,_0x23366d){_0x23366d=_0x23366d||0x1f4;return function(_0x4f4a2e){logger['error'](_0x4f4a2e[_0x53c2('0x3a')]);if(_0x4f4a2e[_0x53c2('0x3b')]){delete _0x4f4a2e[_0x53c2('0x3b')];}_0x2b2124[_0x53c2('0x2b')](_0x23366d)['send'](_0x4f4a2e);};}exports[_0x53c2('0x3c')]=function(_0x639165,_0x5c1740){var _0x2a0c88={'include':[{'model':db[_0x53c2('0x3d')],'as':_0x53c2('0x3e')}]},_0x3dadd6={},_0x7d687b={'count':0x0,'rows':[]};var _0x188bb5=_[_0x53c2('0x3f')](db[_0x53c2('0x40')][_0x53c2('0x41')],function(_0x97bd78){return{'name':_0x97bd78[_0x53c2('0x42')],'type':_0x97bd78[_0x53c2('0x43')][_0x53c2('0x44')]};});_0x3dadd6[_0x53c2('0x45')]=_[_0x53c2('0x3f')](_0x188bb5,_0x53c2('0x3b'));_0x3dadd6[_0x53c2('0x46')]=_['keys'](_0x639165[_0x53c2('0x46')]);_0x3dadd6[_0x53c2('0x47')]=_['intersection'](_0x3dadd6[_0x53c2('0x45')],_0x3dadd6['query']);_0x2a0c88[_0x53c2('0x48')]=_[_0x53c2('0x49')](_0x3dadd6[_0x53c2('0x45')],qs[_0x53c2('0x4a')](_0x639165[_0x53c2('0x46')]['fields']));_0x2a0c88[_0x53c2('0x48')]=_0x2a0c88[_0x53c2('0x48')][_0x53c2('0x4b')]?_0x2a0c88[_0x53c2('0x48')]:_0x3dadd6['model'];if(!_0x639165[_0x53c2('0x46')]['hasOwnProperty']('nolimit')){_0x2a0c88['limit']=qs['limit'](_0x639165[_0x53c2('0x46')]['limit']);_0x2a0c88['offset']=qs[_0x53c2('0x2c')](_0x639165[_0x53c2('0x46')][_0x53c2('0x2c')]);}_0x2a0c88[_0x53c2('0x4c')]=qs[_0x53c2('0x4d')](_0x639165[_0x53c2('0x46')][_0x53c2('0x4d')]);_0x2a0c88['where']=qs[_0x53c2('0x47')](_[_0x53c2('0x4e')](_0x639165['query'],_0x3dadd6['filters']),_0x188bb5);if(_0x639165['query'][_0x53c2('0x4f')]){_0x2a0c88[_0x53c2('0x50')]=_[_0x53c2('0x51')](_0x2a0c88[_0x53c2('0x50')],{'$or':_[_0x53c2('0x3f')](_0x188bb5,function(_0x225334){if(_0x225334['type']!==_0x53c2('0x52')){var _0x25d9ac={};_0x25d9ac[_0x225334['name']]={'$like':'%'+_0x639165[_0x53c2('0x46')]['filter']+'%'};return _0x25d9ac;}})});}_0x2a0c88=_[_0x53c2('0x51')]({},_0x2a0c88,_0x639165[_0x53c2('0x53')]);var _0x1e7581={'where':_0x2a0c88[_0x53c2('0x50')]};return db[_0x53c2('0x40')][_0x53c2('0x2f')](_0x1e7581)[_0x53c2('0x20')](function(_0x210c0b){_0x7d687b[_0x53c2('0x2f')]=_0x210c0b;if(_0x639165[_0x53c2('0x46')][_0x53c2('0x54')]){_0x2a0c88[_0x53c2('0x55')]=[{'all':!![]}];}return db[_0x53c2('0x40')]['findAll'](_0x2a0c88);})[_0x53c2('0x20')](function(_0x24aaf6){_0x7d687b[_0x53c2('0x56')]=_0x24aaf6;return _0x7d687b;})[_0x53c2('0x20')](respondWithFilteredResult(_0x5c1740,_0x2a0c88))['catch'](handleError(_0x5c1740,null));};exports[_0x53c2('0x57')]=function(_0x2b9822,_0x6d832e){var _0x103a0d={'raw':![],'where':{'id':_0x2b9822['params']['id']},'include':[{'model':db[_0x53c2('0x3d')],'as':_0x53c2('0x3e')}]},_0x36ff93={};_0x36ff93[_0x53c2('0x45')]=_[_0x53c2('0x58')](db[_0x53c2('0x40')][_0x53c2('0x41')]);_0x36ff93['query']=_[_0x53c2('0x58')](_0x2b9822[_0x53c2('0x46')]);_0x36ff93['filters']=_[_0x53c2('0x49')](_0x36ff93[_0x53c2('0x45')],_0x36ff93[_0x53c2('0x46')]);_0x103a0d[_0x53c2('0x48')]=_[_0x53c2('0x49')](_0x36ff93[_0x53c2('0x45')],qs[_0x53c2('0x4a')](_0x2b9822['query'][_0x53c2('0x4a')]));_0x103a0d[_0x53c2('0x48')]=_0x103a0d['attributes']['length']?_0x103a0d[_0x53c2('0x48')]:_0x36ff93[_0x53c2('0x45')];if(_0x2b9822[_0x53c2('0x46')][_0x53c2('0x54')]){_0x103a0d[_0x53c2('0x55')]=[{'all':!![]}];}_0x103a0d=_['merge']({},_0x103a0d,_0x2b9822[_0x53c2('0x53')]);return db[_0x53c2('0x40')]['find'](_0x103a0d)['then'](handleEntityNotFound(_0x6d832e,null))[_0x53c2('0x20')](respondWithResult(_0x6d832e,null))[_0x53c2('0x2a')](handleError(_0x6d832e,null));};exports[_0x53c2('0x59')]=function(_0x4fe157,_0x526a91){return db[_0x53c2('0x40')]['create'](_0x4fe157[_0x53c2('0x5a')],{})[_0x53c2('0x20')](function(_0x376f71){var _0x14f850=_0x4fe157[_0x53c2('0x5b')][_0x53c2('0x37')]({'plain':!![]});if(!_0x14f850)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14f850[_0x53c2('0x5c')]===_0x53c2('0x5b')){var _0x196db3=_0x376f71[_0x53c2('0x37')]({'plain':!![]});var _0x60b4fd=_0x53c2('0x5d');return db[_0x53c2('0x5e')][_0x53c2('0x5f')]({'where':{'name':_0x60b4fd,'userProfileId':_0x14f850['userProfileId']},'raw':!![]})[_0x53c2('0x20')](function(_0x5087d8){if(_0x5087d8&&_0x5087d8[_0x53c2('0x60')]===0x0){return db['UserProfileResource'][_0x53c2('0x59')]({'name':_0x196db3[_0x53c2('0x3b')],'resourceId':_0x196db3['id'],'type':_0x5087d8[_0x53c2('0x3b')],'sectionId':_0x5087d8['id']},{})[_0x53c2('0x20')](function(){return _0x376f71;});}else{return _0x376f71;}})[_0x53c2('0x2a')](function(_0xa9fbe0){logger[_0x53c2('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa9fbe0);throw _0xa9fbe0;});}return _0x376f71;})[_0x53c2('0x20')](respondWithResult(_0x526a91,0xc9))[_0x53c2('0x2a')](handleError(_0x526a91,null));};exports[_0x53c2('0x35')]=function(_0x284e72,_0x3f19b9){if(_0x284e72['body']['id']){delete _0x284e72[_0x53c2('0x5a')]['id'];}return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x284e72[_0x53c2('0x61')]['id']},'include':[{'model':db[_0x53c2('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x53c2('0x20')](handleEntityNotFound(_0x3f19b9,null))['then'](saveUpdates(_0x284e72[_0x53c2('0x5a')],null))['then'](respondWithResult(_0x3f19b9,null))[_0x53c2('0x2a')](handleError(_0x3f19b9,null));};exports[_0x53c2('0x36')]=function(_0x19f006,_0x142d71){return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x19f006[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x142d71,null))['then'](removeEntity(_0x142d71,null))[_0x53c2('0x2a')](handleError(_0x142d71,null));};exports[_0x53c2('0x62')]=function(_0x4d37cb,_0x4471fc){return db[_0x53c2('0x40')][_0x53c2('0x62')]()[_0x53c2('0x20')](respondWithResult(_0x4471fc,null))['catch'](handleError(_0x4471fc,null));};exports[_0x53c2('0x63')]=function(_0x947bb2,_0x59ce34,_0x4e06d4){if(_0x947bb2[_0x53c2('0x5a')]['id']){delete _0x947bb2[_0x53c2('0x5a')]['id'];}return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x947bb2[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x59ce34,null))[_0x53c2('0x20')](function(_0x496d9f){if(_0x496d9f){_0x947bb2['body']['SmsAccountId']=_0x496d9f['id'];return db[_0x53c2('0x64')][_0x53c2('0x59')](_0x947bb2[_0x53c2('0x5a')]);}})[_0x53c2('0x20')](respondWithResult(_0x59ce34,null))[_0x53c2('0x2a')](handleError(_0x59ce34,null));};exports['getDispositions']=function(_0x1b9a7b,_0x88d56,_0x55793d){var _0xe0fd2b={'raw':![],'where':{}};var _0x428e6b={};var _0x36932f={'count':0x0,'rows':[]};return db[_0x53c2('0x40')]['findOne']({'where':{'id':_0x1b9a7b['params']['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x88d56,null))[_0x53c2('0x20')](function(_0x449a67){if(_0x449a67){_0x428e6b[_0x53c2('0x45')]=_[_0x53c2('0x58')](db['Disposition'][_0x53c2('0x41')]);_0x428e6b[_0x53c2('0x46')]=_[_0x53c2('0x58')](_0x1b9a7b['query']);_0x428e6b['filters']=_[_0x53c2('0x49')](_0x428e6b['model'],_0x428e6b[_0x53c2('0x46')]);_0xe0fd2b['attributes']=_[_0x53c2('0x49')](_0x428e6b[_0x53c2('0x45')],qs[_0x53c2('0x4a')](_0x1b9a7b['query'][_0x53c2('0x4a')]));_0xe0fd2b[_0x53c2('0x48')]=_0xe0fd2b[_0x53c2('0x48')][_0x53c2('0x4b')]?_0xe0fd2b['attributes']:_0x428e6b[_0x53c2('0x45')];if(!_0x1b9a7b[_0x53c2('0x46')][_0x53c2('0x65')](_0x53c2('0x66'))){_0xe0fd2b[_0x53c2('0x2e')]=qs[_0x53c2('0x2e')](_0x1b9a7b['query'][_0x53c2('0x2e')]);_0xe0fd2b[_0x53c2('0x2c')]=qs[_0x53c2('0x2c')](_0x1b9a7b['query']['offset']);}_0xe0fd2b[_0x53c2('0x4c')]=qs[_0x53c2('0x4d')](_0x1b9a7b[_0x53c2('0x46')][_0x53c2('0x4d')]);_0xe0fd2b[_0x53c2('0x50')]=qs[_0x53c2('0x47')](_[_0x53c2('0x4e')](_0x1b9a7b[_0x53c2('0x46')],_0x428e6b[_0x53c2('0x47')]));_0xe0fd2b['where']['SmsAccountId']=_0x449a67['id'];if(_0x1b9a7b[_0x53c2('0x46')][_0x53c2('0x4f')]){_0xe0fd2b[_0x53c2('0x50')]=_[_0x53c2('0x51')](_0xe0fd2b['where'],{'$or':_[_0x53c2('0x3f')](_0xe0fd2b['attributes'],function(_0x4db730){var _0x2f6511={};_0x2f6511[_0x4db730]={'$like':'%'+_0x1b9a7b['query']['filter']+'%'};return _0x2f6511;})});}_0xe0fd2b=_[_0x53c2('0x51')]({},_0xe0fd2b,_0x1b9a7b[_0x53c2('0x53')]);return db[_0x53c2('0x64')]['count']({'where':_0xe0fd2b[_0x53c2('0x50')]})[_0x53c2('0x20')](function(_0x179305){_0x36932f['count']=_0x179305;if(_0x1b9a7b[_0x53c2('0x46')][_0x53c2('0x54')]){_0xe0fd2b['include']=[{'all':!![]}];}return db[_0x53c2('0x64')]['findAll'](_0xe0fd2b);})[_0x53c2('0x20')](function(_0x565d0d){_0x36932f[_0x53c2('0x56')]=_0x565d0d;return _0x36932f;});}})[_0x53c2('0x20')](respondWithFilteredResult(_0x88d56,_0xe0fd2b))[_0x53c2('0x2a')](handleError(_0x88d56,null));};exports[_0x53c2('0x67')]=function(_0x83bff1,_0x340b68,_0xbc462c){return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x83bff1[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x340b68,null))[_0x53c2('0x20')](function(_0x48ccac){if(_0x48ccac){return _0x48ccac['removeDispositions'](_0x83bff1[_0x53c2('0x46')]['ids']);}})[_0x53c2('0x20')](respondWithStatusCode(_0x340b68,null))[_0x53c2('0x2a')](handleError(_0x340b68,null));};exports['addAnswer']=function(_0x5a7b87,_0x154b67,_0x2a6463){if(_0x5a7b87[_0x53c2('0x5a')]['id']){delete _0x5a7b87['body']['id'];}return db[_0x53c2('0x40')]['find']({'where':{'id':_0x5a7b87['params']['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x154b67,null))[_0x53c2('0x20')](function(_0xfb7ba7){if(_0xfb7ba7){_0x5a7b87[_0x53c2('0x5a')][_0x53c2('0x68')]=_0xfb7ba7['id'];return db[_0x53c2('0x69')][_0x53c2('0x59')](_0x5a7b87[_0x53c2('0x5a')]);}})[_0x53c2('0x20')](respondWithResult(_0x154b67,null))[_0x53c2('0x2a')](handleError(_0x154b67,null));};exports[_0x53c2('0x6a')]=function(_0x5cda0a,_0xb719cc,_0x3d4405){var _0x13f3a1={'raw':![],'where':{}};var _0x38170b={};var _0x8007a4={'count':0x0,'rows':[]};return db[_0x53c2('0x40')]['findOne']({'where':{'id':_0x5cda0a[_0x53c2('0x61')]['id']}})['then'](handleEntityNotFound(_0xb719cc,null))[_0x53c2('0x20')](function(_0x575a45){if(_0x575a45){_0x38170b[_0x53c2('0x45')]=_['keys'](db[_0x53c2('0x69')][_0x53c2('0x41')]);_0x38170b[_0x53c2('0x46')]=_['keys'](_0x5cda0a[_0x53c2('0x46')]);_0x38170b['filters']=_[_0x53c2('0x49')](_0x38170b[_0x53c2('0x45')],_0x38170b[_0x53c2('0x46')]);_0x13f3a1[_0x53c2('0x48')]=_[_0x53c2('0x49')](_0x38170b['model'],qs[_0x53c2('0x4a')](_0x5cda0a[_0x53c2('0x46')]['fields']));_0x13f3a1[_0x53c2('0x48')]=_0x13f3a1['attributes'][_0x53c2('0x4b')]?_0x13f3a1['attributes']:_0x38170b['model'];if(!_0x5cda0a[_0x53c2('0x46')]['hasOwnProperty']('nolimit')){_0x13f3a1[_0x53c2('0x2e')]=qs[_0x53c2('0x2e')](_0x5cda0a[_0x53c2('0x46')][_0x53c2('0x2e')]);_0x13f3a1[_0x53c2('0x2c')]=qs['offset'](_0x5cda0a['query']['offset']);}_0x13f3a1['order']=qs[_0x53c2('0x4d')](_0x5cda0a[_0x53c2('0x46')]['sort']);_0x13f3a1[_0x53c2('0x50')]=qs[_0x53c2('0x47')](_[_0x53c2('0x4e')](_0x5cda0a['query'],_0x38170b['filters']));_0x13f3a1[_0x53c2('0x50')][_0x53c2('0x68')]=_0x575a45['id'];if(_0x5cda0a[_0x53c2('0x46')]['filter']){_0x13f3a1[_0x53c2('0x50')]=_[_0x53c2('0x51')](_0x13f3a1[_0x53c2('0x50')],{'$or':_[_0x53c2('0x3f')](_0x13f3a1[_0x53c2('0x48')],function(_0x22a51f){var _0x73553e={};_0x73553e[_0x22a51f]={'$like':'%'+_0x5cda0a['query'][_0x53c2('0x4f')]+'%'};return _0x73553e;})});}_0x13f3a1=_[_0x53c2('0x51')]({},_0x13f3a1,_0x5cda0a[_0x53c2('0x53')]);return db['CannedAnswer'][_0x53c2('0x2f')]({'where':_0x13f3a1[_0x53c2('0x50')]})['then'](function(_0x3ab0dd){_0x8007a4[_0x53c2('0x2f')]=_0x3ab0dd;if(_0x5cda0a[_0x53c2('0x46')]['includeAll']){_0x13f3a1[_0x53c2('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x53c2('0x6b')](_0x13f3a1);})[_0x53c2('0x20')](function(_0x8eda58){_0x8007a4[_0x53c2('0x56')]=_0x8eda58;return _0x8007a4;});}})[_0x53c2('0x20')](respondWithFilteredResult(_0xb719cc,_0x13f3a1))[_0x53c2('0x2a')](handleError(_0xb719cc,null));};exports[_0x53c2('0x6c')]=function(_0x10903b,_0x2f593e,_0x32afec){return db[_0x53c2('0x40')]['find']({'where':{'id':_0x10903b[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x2f593e,null))[_0x53c2('0x20')](function(_0x4908ab){if(_0x4908ab){return _0x4908ab[_0x53c2('0x6c')](_0x10903b[_0x53c2('0x46')][_0x53c2('0x6d')]);}})[_0x53c2('0x20')](respondWithStatusCode(_0x2f593e,null))[_0x53c2('0x2a')](handleError(_0x2f593e,null));};exports[_0x53c2('0x6e')]=function(_0x5c7ef8,_0x5af508,_0x3cecc5){var _0x3034fa={'channel':_0x53c2('0x6f')};var _0x14a30b=[];var _0x272360=[];var _0x492488={};return db['SmsAccount']['find']({'where':{'id':_0x5c7ef8[_0x53c2('0x61')]['id']},'include':[{'model':db[_0x53c2('0x70')],'as':_0x53c2('0x71')}]})[_0x53c2('0x20')](handleEntityNotFound(_0x5af508,null))[_0x53c2('0x20')](function(_0x2e9b01){_0x3034fa[_0x53c2('0x72')]=_0x2e9b01;_0x3034fa[_0x53c2('0x73')]=_[_0x53c2('0x74')](_0x2e9b01[_0x53c2('0x71')],[_0x53c2('0x75')],['asc']);if(_0x3034fa[_0x53c2('0x72')]['Applications']){delete _0x3034fa[_0x53c2('0x72')][_0x53c2('0x71')];}return db[_0x53c2('0x76')][_0x53c2('0x62')]();})[_0x53c2('0x20')](function(_0x9cc013){if(!_0x9cc013){throw new db[(_0x53c2('0x77'))][(_0x53c2('0x78'))](_0x53c2('0x79'));}_0x14a30b=_[_0x53c2('0x7a')](_[_0x53c2('0x58')](_0x9cc013),['createdAt',_0x53c2('0x7b')]);_0x272360=_[_0x53c2('0x7a')](_[_0x53c2('0x58')](_0x9cc013),[_0x53c2('0x7c'),_0x53c2('0x7b'),_0x53c2('0x7d'),_0x53c2('0x7e')]);_0x3034fa[_0x53c2('0x5a')]={'mapKey':_0x53c2('0x7f')};if(_0x3034fa['account'][_0x53c2('0x43')]){switch(_0x3034fa[_0x53c2('0x72')][_0x53c2('0x43')]){case _0x53c2('0x80'):_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x82')];_0x3034fa['body']['body']=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x83')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x84')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x85')];break;case _0x53c2('0x86'):_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]='+'+_0x5c7ef8[_0x53c2('0x5a')]['sender'];_0x3034fa['body'][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x87')];break;case _0x53c2('0x88'):_0x3034fa['body'][_0x53c2('0x81')]=_0x5c7ef8['body'][_0x53c2('0x81')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x28')];break;case'clicksend':_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]=_0x5c7ef8['body'][_0x53c2('0x81')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x5a')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x84')]=_0x5c7ef8['body']['message_id'];break;case _0x53c2('0x89'):_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]=_0x5c7ef8[_0x53c2('0x5a')]['From'];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x8a')];_0x3034fa['body'][_0x53c2('0x84')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x8b')];break;case _0x53c2('0x8c'):_0x3034fa['body'][_0x53c2('0x81')]='+'+_0x5c7ef8['body']['results'][0x0][_0x53c2('0x81')];_0x3034fa['body'][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')]['results'][0x0][_0x53c2('0x87')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x84')]=_0x5c7ef8[_0x53c2('0x5a')]['results'][0x0][_0x53c2('0x84')];break;case _0x53c2('0x8d'):_0x3034fa['body'][_0x53c2('0x81')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x8e')];_0x3034fa['body'][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x8f')][_0x53c2('0x28')];break;case _0x53c2('0x90'):_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x91')];_0x3034fa['body'][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x87')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x84')]=_0x5c7ef8['body'][_0x53c2('0x92')];break;case'bandwidth':_0x3034fa[_0x53c2('0x5a')]['messageId']=_0x5c7ef8[_0x53c2('0x5a')][0x0]['message']['id'];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]=_0x5c7ef8[_0x53c2('0x5a')][0x0]['message'][_0x53c2('0x81')];_0x3034fa[_0x53c2('0x5a')]['body']=_0x5c7ef8['body'][0x0][_0x53c2('0x28')][_0x53c2('0x87')];break;case'intelepeer':_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')]=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x81')];_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x5a')]=_0x5c7ef8[_0x53c2('0x5a')]['message'];_0x3034fa[_0x53c2('0x5a')]['messageId']=_0x5c7ef8[_0x53c2('0x5a')][_0x53c2('0x93')];break;}}if(_0x3034fa[_0x53c2('0x5a')]['id']){delete _0x3034fa[_0x53c2('0x5a')]['id'];}if(_[_0x53c2('0x94')](_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')])){throw new db['Sequelize'][(_0x53c2('0x78'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x5a')])||_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x5a')]===''){throw new db[(_0x53c2('0x77'))][(_0x53c2('0x78'))](_0x53c2('0x95'));}if(_[_0x53c2('0x94')](_0x3034fa[_0x53c2('0x5a')]['mapKey'])){throw new db[(_0x53c2('0x77'))][(_0x53c2('0x78'))](_0x53c2('0x96')+_0x272360);}if(!_[_0x53c2('0x97')](_0x272360,_0x3034fa[_0x53c2('0x5a')]['mapKey'])){throw new db[(_0x53c2('0x77'))][(_0x53c2('0x78'))](_0x53c2('0x98')+_0x272360);}_0x492488[_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x99')]]=_0x3034fa[_0x53c2('0x5a')]['from'];return db[_0x53c2('0x9a')][_0x53c2('0x5f')]({'where':{'id':_0x3034fa['account'][_0x53c2('0x7e')]},'include':[{'model':db[_0x53c2('0x76')],'as':_0x53c2('0x9b'),'where':_0x492488,'limit':0x1,'order':[[_0x53c2('0x7b'),_0x53c2('0x9c')]]}]});})[_0x53c2('0x20')](handleEntityNotFound(_0x5af508,null))[_0x53c2('0x20')](function(_0x3bfa63){if(_0x3bfa63){_0x3034fa['list']=_[_0x53c2('0x9d')](_0x3bfa63,['Contacts']);if(_0x3bfa63[_0x53c2('0x9b')][_0x53c2('0x4b')]){return _0x3bfa63[_0x53c2('0x9b')][0x0];}var _0x24c403=_[_0x53c2('0x1a')](_0x3034fa[_0x53c2('0x5a')],{'firstName':_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')],'ListId':_0x3bfa63['id']});_0x24c403[_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x99')]]=_0x3034fa['body']['from'];return db[_0x53c2('0x76')][_0x53c2('0x59')](_0x24c403,{'fields':_0x14a30b,'raw':!![]});}})[_0x53c2('0x20')](handleEntityNotFound(_0x5af508,null))['then'](function(_0x3b3980){if(_0x3b3980){_0x3034fa[_0x53c2('0x9e')]=_0x3b3980;var _0x3ce178={'ContactId':_0x3b3980['id'],'phone':_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')],'SmsAccountId':_0x5c7ef8[_0x53c2('0x61')]['id']};var _0xd5ec6e={'ContactId':_0x3b3980['id'],'SmsAccountId':_0x5c7ef8[_0x53c2('0x61')]['id'],'closed':![]};return db[_0x53c2('0x9f')][_0x53c2('0x5f')]({'where':_0xd5ec6e})[_0x53c2('0x20')](function(_0x5d4953){if(_0x5d4953){return[_0x5d4953,![]];}return db[_0x53c2('0x9f')]['create'](_0x3ce178)['then'](function(_0x100da8){return[_0x100da8,!![]];});});}})[_0x53c2('0xa0')](function(_0x492b99,_0x43bb68){_0x3034fa[_0x53c2('0xa1')]=_0x492b99[_0x53c2('0x37')]({'plain':!![]});_0x3034fa['interaction'][_0x53c2('0xa2')]=![];if(_0x43bb68){if(_0x3034fa['account'][_0x53c2('0xa3')]){_0x3034fa[_0x53c2('0x73')]['push']({'id':0x0,'priority':_0x3034fa[_0x53c2('0x73')][_0x53c2('0x4b')]+0x1,'app':_0x53c2('0xa4'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x3034fa[_0x53c2('0xa1')][_0x53c2('0xa2')]=!![];}return db['SmsMessage'][_0x53c2('0x59')]({'phone':_0x3034fa[_0x53c2('0x5a')][_0x53c2('0x81')],'messageId':_0x3034fa['body'][_0x53c2('0x84')],'body':_0x3034fa['body'][_0x53c2('0x5a')],'SmsAccountId':_0x5c7ef8[_0x53c2('0x61')]['id'],'SmsInteractionId':_0x492b99['id'],'direction':'in','ContactId':_0x492b99[_0x53c2('0xa5')],'AttachmentId':_0x3034fa[_0x53c2('0x5a')]['AttachmentId']});})[_0x53c2('0x20')](function(_0x150987){_0x3034fa[_0x53c2('0x28')]=_0x150987;if(_0x3034fa[_0x53c2('0xa1')]['UserId']){return db[_0x53c2('0xa6')][_0x53c2('0x5f')]({'attributes':['id',_0x53c2('0x3b')],'where':{'id':_0x3034fa[_0x53c2('0xa1')][_0x53c2('0xa7')]}})[_0x53c2('0x20')](function(_0x429cad){if(_0x429cad){_0x3034fa[_0x53c2('0x73')]['unshift']({'id':0x0,'priority':0x0,'app':_0x53c2('0xa8'),'appdata':_0x429cad[_0x53c2('0x3b')]+','+(_0x3034fa[_0x53c2('0x72')][_0x53c2('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x53c2('0xaa'),_0x53c2('0xab'),_0x3034fa);});}return respondWithRpcPromise('Start',_0x53c2('0xab'),_0x3034fa);})['then'](function(_0x2964d3){if(_0x2964d3){var _0x1403e0=0xc8;var _0x5b58eb=_0x53c2('0xac');logger[_0x53c2('0x21')](_0x53c2('0x25'),_0x5b58eb,_0x1403e0,'entity\x20found');logger[_0x53c2('0x24')](_0x53c2('0xad'),_0x5b58eb,_0x1403e0,_0x53c2('0xae'),JSON[_0x53c2('0xaf')](_0x2964d3));if(_0x3034fa[_0x53c2('0x72')]['type']===_0x53c2('0x80')){return _0x5af508['status'](_0x1403e0)[_0x53c2('0xb0')](_0x53c2('0xb1'),_0x53c2('0xb2'))[_0x53c2('0xb3')](_0x53c2('0xb4'));}else{return _0x5af508['status'](_0x1403e0)[_0x53c2('0x31')](_0x2964d3);}}})[_0x53c2('0x2a')](handleError(_0x5af508,null));};exports[_0x53c2('0xb5')]=function(_0x5bb387,_0x3395c4,_0x2dc30a){return db['SmsAccount'][_0x53c2('0xb6')]({'where':{'id':_0x5bb387[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x3395c4,null))[_0x53c2('0x20')](function(_0x357578){if(_0x357578){return db[_0x53c2('0xb7')]['transaction'](function(_0x33e74f){return db[_0x53c2('0x70')][_0x53c2('0x36')]({'where':{'SmsAccountId':_0x5bb387[_0x53c2('0x61')]['id']},'transaction':_0x33e74f})[_0x53c2('0x20')](function(_0x3c7d5a){var _0x367e67=_['map'](_0x5bb387[_0x53c2('0x5a')],function(_0x54d2e6){_0x54d2e6[_0x53c2('0x68')]=_0x5bb387[_0x53c2('0x61')]['id'];return _0x54d2e6;});return db[_0x53c2('0x70')][_0x53c2('0xb8')](_0x367e67,{'transaction':_0x33e74f});});})[_0x53c2('0x20')](function(){return db[_0x53c2('0x70')]['findAndCountAll']({'where':{'SmsAccountId':_0x5bb387[_0x53c2('0x61')]['id']},'order':_0x53c2('0x75')});});}})[_0x53c2('0x20')](respondWithResult(_0x3395c4,null))[_0x53c2('0x2a')](handleError(_0x3395c4,null));};exports[_0x53c2('0xb9')]=function(_0x20c661,_0x414671,_0x300bc1){var _0x4371fc={};var _0x106fee={};var _0x34c790;var _0x50d7ef;return db[_0x53c2('0x40')]['findOne']({'where':{'id':_0x20c661[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x414671,null))[_0x53c2('0x20')](function(_0x33b962){if(_0x33b962){_0x34c790=_0x33b962;_0x106fee[_0x53c2('0x45')]=_[_0x53c2('0x58')](db[_0x53c2('0x70')][_0x53c2('0x41')]);_0x106fee[_0x53c2('0x46')]=_[_0x53c2('0x58')](_0x20c661['query']);_0x106fee[_0x53c2('0x47')]=_[_0x53c2('0x49')](_0x106fee['model'],_0x106fee['query']);_0x4371fc[_0x53c2('0x48')]=_[_0x53c2('0x49')](_0x106fee[_0x53c2('0x45')],qs[_0x53c2('0x4a')](_0x20c661[_0x53c2('0x46')]['fields']));_0x4371fc[_0x53c2('0x48')]=_0x4371fc[_0x53c2('0x48')][_0x53c2('0x4b')]?_0x4371fc[_0x53c2('0x48')]:_0x106fee[_0x53c2('0x45')];_0x4371fc[_0x53c2('0x4c')]=qs[_0x53c2('0x4d')](_0x20c661[_0x53c2('0x46')][_0x53c2('0x4d')]);_0x4371fc[_0x53c2('0x50')]=qs['filters'](_[_0x53c2('0x4e')](_0x20c661[_0x53c2('0x46')],_0x106fee['filters']));if(_0x20c661[_0x53c2('0x46')][_0x53c2('0x4f')]){_0x4371fc[_0x53c2('0x50')]=_[_0x53c2('0x51')](_0x4371fc[_0x53c2('0x50')],{'$or':_[_0x53c2('0x3f')](_0x4371fc['attributes'],function(_0x585e27){var _0x2cfe0d={};_0x2cfe0d[_0x585e27]={'$like':'%'+_0x20c661[_0x53c2('0x46')][_0x53c2('0x4f')]+'%'};return _0x2cfe0d;})});}_0x4371fc=_[_0x53c2('0x51')]({},_0x4371fc,_0x20c661[_0x53c2('0x53')]);return _0x34c790['getApplications'](_0x4371fc);}})['then'](function(_0x46742a){if(_0x46742a){_0x50d7ef=_0x46742a[_0x53c2('0x4b')];if(!_0x20c661[_0x53c2('0x46')]['hasOwnProperty'](_0x53c2('0x66'))){_0x4371fc[_0x53c2('0x2e')]=qs[_0x53c2('0x2e')](_0x20c661['query'][_0x53c2('0x2e')]);_0x4371fc['offset']=qs[_0x53c2('0x2c')](_0x20c661[_0x53c2('0x46')][_0x53c2('0x2c')]);}return _0x34c790[_0x53c2('0xb9')](_0x4371fc);}})[_0x53c2('0x20')](function(_0x5e38cb){if(_0x5e38cb){return _0x5e38cb?{'count':_0x50d7ef,'rows':_0x5e38cb}:null;}})[_0x53c2('0x20')](respondWithResult(_0x414671,null))[_0x53c2('0x2a')](handleError(_0x414671,null));};exports[_0x53c2('0xba')]=function(_0x380ddc,_0x6ccd17,_0x50e6f1){var _0x189fc9={'raw':![],'where':{}};var _0x179376={};var _0x562a7d={'count':0x0,'rows':[]};return db[_0x53c2('0x40')][_0x53c2('0xb6')]({'where':{'id':_0x380ddc['params']['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x6ccd17,null))['then'](function(_0x19f5b7){if(_0x19f5b7){_0x179376['model']=_[_0x53c2('0x58')](db[_0x53c2('0x9f')]['rawAttributes']);_0x179376[_0x53c2('0x46')]=_[_0x53c2('0x58')](_0x380ddc[_0x53c2('0x46')]);_0x179376[_0x53c2('0x47')]=_['intersection'](_0x179376[_0x53c2('0x45')],_0x179376[_0x53c2('0x46')]);_0x189fc9[_0x53c2('0x48')]=_[_0x53c2('0x49')](_0x179376[_0x53c2('0x45')],qs[_0x53c2('0x4a')](_0x380ddc[_0x53c2('0x46')][_0x53c2('0x4a')]));_0x189fc9[_0x53c2('0x48')]=_0x189fc9[_0x53c2('0x48')][_0x53c2('0x4b')]?_0x189fc9[_0x53c2('0x48')]:_0x179376[_0x53c2('0x45')];if(!_0x380ddc[_0x53c2('0x46')][_0x53c2('0x65')](_0x53c2('0x66'))){_0x189fc9[_0x53c2('0x2e')]=qs[_0x53c2('0x2e')](_0x380ddc[_0x53c2('0x46')]['limit']);_0x189fc9['offset']=qs['offset'](_0x380ddc['query']['offset']);}_0x189fc9[_0x53c2('0x4c')]=qs[_0x53c2('0x4d')](_0x380ddc[_0x53c2('0x46')]['sort']);_0x189fc9[_0x53c2('0x50')]=qs[_0x53c2('0x47')](_[_0x53c2('0x4e')](_0x380ddc[_0x53c2('0x46')],_0x179376[_0x53c2('0x47')]));_0x189fc9[_0x53c2('0x50')][_0x53c2('0x68')]=_0x19f5b7['id'];if(_0x380ddc[_0x53c2('0x46')][_0x53c2('0x4f')]){_0x189fc9['where']=_[_0x53c2('0x51')](_0x189fc9['where'],{'$or':_['map'](_0x189fc9[_0x53c2('0x48')],function(_0x33c6a1){var _0x4a3c7f={};_0x4a3c7f[_0x33c6a1]={'$like':'%'+_0x380ddc[_0x53c2('0x46')]['filter']+'%'};return _0x4a3c7f;})});}_0x189fc9=_[_0x53c2('0x51')]({},_0x189fc9,_0x380ddc[_0x53c2('0x53')]);return db[_0x53c2('0x9f')][_0x53c2('0x2f')]({'where':_0x189fc9['where']})[_0x53c2('0x20')](function(_0x39cf2b){_0x562a7d['count']=_0x39cf2b;if(_0x380ddc[_0x53c2('0x46')][_0x53c2('0x54')]){_0x189fc9[_0x53c2('0x55')]=[{'model':db['CmContact'],'as':_0x53c2('0xbb'),'required':![]},{'model':db[_0x53c2('0xa6')],'as':_0x53c2('0xbc'),'attributes':[_0x53c2('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0x53c2('0xbd')],'as':_0x53c2('0xbe'),'attributes':['id',_0x53c2('0x3b'),_0x53c2('0xbf')],'where':_0x380ddc['query'][_0x53c2('0xc0')]?{'id':_0x380ddc[_0x53c2('0x46')][_0x53c2('0xc0')]}:undefined,'required':_0x380ddc[_0x53c2('0x46')]['tag']?!![]:![]}];}return db[_0x53c2('0x9f')][_0x53c2('0x6b')](_0x189fc9);})['then'](function(_0x2d3bbb){_0x562a7d[_0x53c2('0x56')]=_0x2d3bbb;return _0x562a7d;});}})[_0x53c2('0x20')](respondWithFilteredResult(_0x6ccd17,_0x189fc9))[_0x53c2('0x2a')](handleError(_0x6ccd17,null));};exports[_0x53c2('0xb3')]=function(_0x16d4a0,_0x1bed24,_0x3cbf89){var _0x5c0526,_0x3a4743,_0x479915;if(_['isNil'](_0x16d4a0[_0x53c2('0x5a')]['body'])||_0x16d4a0[_0x53c2('0x5a')][_0x53c2('0x5a')]===''){throw new db[(_0x53c2('0x77'))]['ValidationError'](_0x53c2('0x95'));}if(_[_0x53c2('0x94')](_0x16d4a0[_0x53c2('0x5a')]['to'])){throw new db[(_0x53c2('0x77'))][(_0x53c2('0x78'))](_0x53c2('0xc1'));}_0x5c0526=_0x16d4a0['body']['to'];return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x16d4a0[_0x53c2('0x61')]['id']},'include':[{'model':db[_0x53c2('0x9a')],'as':_0x53c2('0xc2'),'include':[{'model':db[_0x53c2('0x76')],'as':'Contacts','where':{'mobile':_0x5c0526},'limit':0x1,'order':[['updatedAt',_0x53c2('0x9c')]]}]}]})[_0x53c2('0x20')](handleEntityNotFound(_0x1bed24,null))[_0x53c2('0x20')](function(_0x3176ba){if(_0x3176ba&&_0x3176ba[_0x53c2('0xc2')]){_0x3a4743=_0x3176ba[_0x53c2('0x37')]({'plain':!![]});if(_0x3a4743[_0x53c2('0xc2')]&&_0x3a4743[_0x53c2('0xc2')]['Contacts'][_0x53c2('0x4b')]){return _0x3a4743['List']['Contacts'][0x0];}return db[_0x53c2('0x76')][_0x53c2('0x59')](_[_0x53c2('0x1a')](_0x16d4a0['body'],{'firstName':_0x5c0526,'mobile':_0x5c0526,'phone':_0x5c0526,'ListId':_0x3a4743['ListId']}));}})[_0x53c2('0x20')](handleEntityNotFound(_0x1bed24,null))[_0x53c2('0x20')](function(_0x260d6e){if(_0x260d6e){_0x479915=_0x260d6e;return db[_0x53c2('0x9f')]['find']({'where':{'ContactId':_0x479915['id'],'closed':![],'SmsAccountId':_0x3a4743['id']}})[_0x53c2('0x20')](function(_0x50ba6e){if(_0x50ba6e){return[_0x50ba6e,![]];}return db[_0x53c2('0x9f')][_0x53c2('0x59')]({'UserId':_0x16d4a0['user']['id'],'ContactId':_0x479915['id'],'SmsAccountId':_0x3a4743['id'],'phone':_0x5c0526,'firstMsgDirection':'out','Messages':[_[_0x53c2('0x51')](_0x16d4a0[_0x53c2('0x5a')],{'read':![],'body':_0x16d4a0[_0x53c2('0x5a')][_0x53c2('0x5a')],'phone':_0x5c0526,'SmsAccountId':_0x3a4743['id'],'UserId':_0x16d4a0[_0x53c2('0x5b')]['id'],'ContactId':_0x479915['id']})]},{'include':[{'model':db[_0x53c2('0xc3')],'as':_0x53c2('0xc4')}]})[_0x53c2('0x20')](function(_0x1260dd){return[_0x1260dd,!![]];});});}})[_0x53c2('0xa0')](function(_0x550319,_0x2d0e6a){if(_0x2d0e6a){return _0x550319;}return db[_0x53c2('0xc3')][_0x53c2('0x59')](_[_0x53c2('0x51')](_0x16d4a0[_0x53c2('0x5a')],{'read':![],'body':_0x16d4a0[_0x53c2('0x5a')]['body'],'phone':_0x5c0526,'SmsAccountId':_0x3a4743['id'],'SmsInteractionId':_0x550319['id'],'UserId':_0x16d4a0['user']['id'],'ContactId':_0x479915['id']}))[_0x53c2('0x20')](function(_0x370c80){_0x550319['dataValues'][_0x53c2('0xc4')]=[];_0x550319[_0x53c2('0xc5')][_0x53c2('0xc4')]['push'](_0x370c80[_0x53c2('0xc5')]);return _0x550319;});})[_0x53c2('0x20')](respondWithResult(_0x1bed24,null))['catch'](handleError(_0x1bed24,null));};exports[_0x53c2('0x2b')]=function(_0x458261,_0x13b9de,_0xfe39b6){if(_0x458261[_0x53c2('0x5a')]['id']){delete _0x458261[_0x53c2('0x5a')]['id'];}var _0xa1e018,_0x28a107,_0x129f38;return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x458261[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x13b9de,null))[_0x53c2('0x20')](function(_0xb3b8c){if(_0xb3b8c){_0x129f38=_0xb3b8c;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c2('0x2b'),_0x53c2('0xc6'),_0xb3b8c[_0x53c2('0x43')],util['inspect'](_0x458261[_0x53c2('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb3b8c['type']){case _0x53c2('0x86'):if(_0x458261[_0x53c2('0x5a')][_0x53c2('0xc7')]&&_0x458261[_0x53c2('0x5a')]['status']){_0x28a107=_0x458261[_0x53c2('0x5a')]['status'];return db[_0x53c2('0xc3')][_0x53c2('0x5f')]({'where':{'messageId':_0x458261['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x458261[_0x53c2('0x5a')][_0x53c2('0xc8')]&&_0x458261[_0x53c2('0x5a')][_0x53c2('0xc9')]){_0x28a107=_0x458261[_0x53c2('0x5a')][_0x53c2('0xc9')];return db[_0x53c2('0xc3')][_0x53c2('0x5f')]({'where':{'messageId':_0x458261[_0x53c2('0x5a')][_0x53c2('0xc8')]}});}break;case _0x53c2('0xca'):if(_0x458261[_0x53c2('0x5a')][_0x53c2('0xcb')]&&_0x458261[_0x53c2('0x5a')][_0x53c2('0xcc')]){_0x28a107=_0x458261['body'][_0x53c2('0xcc')];return db[_0x53c2('0xc3')][_0x53c2('0x5f')]({'where':{'messageId':_0x458261[_0x53c2('0x5a')][_0x53c2('0xcb')]}});}break;case _0x53c2('0x8c'):var _0xfb55ac=_0x458261[_0x53c2('0x5a')][_0x53c2('0xcd')][0x0];if(_0xfb55ac[_0x53c2('0x84')]&&_0xfb55ac[_0x53c2('0x2b')][_0x53c2('0xce')]===_0x53c2('0xcf')){_0x28a107=_0xfb55ac[_0x53c2('0x2b')][_0x53c2('0xce')];return db[_0x53c2('0xc3')][_0x53c2('0x5f')]({'where':{'messageId':_0xfb55ac[_0x53c2('0x84')]}});}break;case _0x53c2('0x90'):if(_0x458261['body'][_0x53c2('0x84')]&&_0x458261[_0x53c2('0x5a')][_0x53c2('0x2b')]){_0x28a107=_0x458261[_0x53c2('0x5a')]['status'];return db[_0x53c2('0xc3')][_0x53c2('0x5f')]({'where':{'messageId':_0x458261[_0x53c2('0x5a')][_0x53c2('0x84')]}});}break;case _0x53c2('0xd0'):if(_0x458261[_0x53c2('0x5a')][0x0][_0x53c2('0x28')]['id']){_0x28a107=_0x458261['body'][0x0]['type'];return db[_0x53c2('0xc3')]['find']({'where':{'messageId':_0x458261['body'][0x0][_0x53c2('0x28')]['id']}});}break;case _0x53c2('0xd1'):if(_0x458261[_0x53c2('0x5a')][_0x53c2('0xd2')]&&_0x458261[_0x53c2('0x5a')][_0x53c2('0x2b')]){_0x28a107=_0x458261[_0x53c2('0x5a')][_0x53c2('0x2b')];return db['SmsMessage'][_0x53c2('0x5f')]({'where':{'messageId':_0x458261[_0x53c2('0x5a')][_0x53c2('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x13b9de,null))[_0x53c2('0x20')](function(_0x5c6723){if(_0x5c6723){_0xa1e018=_0x5c6723;switch(_0x129f38[_0x53c2('0x43')]){case'skebby':if(_0x28a107===_0x53c2('0xcf')){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger[_0x53c2('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c2('0x2b'),_0x53c2('0x86'),util[_0x53c2('0xd3')](_0x458261[_0x53c2('0x5a')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x28a107==='1'){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger[_0x53c2('0x26')](_0x53c2('0x25'),_0x53c2('0x2b'),_0x53c2('0x86'),util[_0x53c2('0xd3')](_0x458261['body'],{'showHidden':![],'depth':null}));}break;case _0x53c2('0xca'):if(!_0x458261[_0x53c2('0x5a')][_0x53c2('0xd4')]&&_0x28a107>=0xc8&&_0x28a107<=0xce){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger[_0x53c2('0x26')](_0x53c2('0x25'),'status',_0x53c2('0xca'),util[_0x53c2('0xd3')](_0x458261[_0x53c2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x53c2('0x8c'):var _0x2a8a03=_0x458261[_0x53c2('0x5a')][_0x53c2('0xcd')][0x0];if(_0x2a8a03[_0x53c2('0x2b')]['groupName']===_0x53c2('0xcf')){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x53c2('0x2b'),_0x53c2('0x8c'),util['inspect'](_0x458261[_0x53c2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x53c2('0x90'):if(_0x28a107=='DELIVERED_TO_GATEWAY'||_0x28a107==_0x53c2('0xd5')){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger[_0x53c2('0x26')](_0x53c2('0x25'),_0x53c2('0x2b'),_0x53c2('0x90'),util[_0x53c2('0xd3')](_0x458261['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x28a107==_0x53c2('0xd6')){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger[_0x53c2('0x26')](_0x53c2('0x25'),_0x53c2('0x2b'),_0x53c2('0xd0'),util[_0x53c2('0xd3')](_0x458261[_0x53c2('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x53c2('0xd1'):if(_0x28a107===_0x53c2('0xd7')||_0x28a107===_0x53c2('0xd8')){return _0xa1e018[_0x53c2('0x35')]({'read':!![]});}else{logger[_0x53c2('0x26')](_0x53c2('0x25'),_0x53c2('0x2b'),_0x53c2('0xd1'),util[_0x53c2('0xd3')](_0x458261['body'],{'showHidden':![],'depth':null}));}break;}return _0xa1e018;}})[_0x53c2('0x20')](respondWithResult(_0x13b9de,null))[_0x53c2('0x2a')](handleError(_0x13b9de,null));};exports[_0x53c2('0xd9')]=function(_0x4db63b,_0x3508eb,_0x4e6dbd){var _0x4b64be,_0x126e57,_0x32df0c;return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x4db63b[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x3508eb,null))['then'](function(_0x95a247){if(_0x95a247){_0x32df0c=_0x95a247;logger[_0x53c2('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x95a247[_0x53c2('0x43')],util['inspect'](_0x4db63b[_0x53c2('0x46')],{'showHidden':![],'depth':null}));switch(_0x95a247[_0x53c2('0x43')]){case _0x53c2('0x8d'):if(_0x4db63b[_0x53c2('0x46')][_0x53c2('0xda')]&&_0x4db63b[_0x53c2('0x46')][_0x53c2('0xdb')]){_0x126e57=_0x4db63b[_0x53c2('0x46')]['state'];return db['SmsMessage'][_0x53c2('0x5f')]({'where':{'messageId':_0x4db63b['query'][_0x53c2('0xda')]}});}break;}}})[_0x53c2('0x20')](handleEntityNotFound(_0x3508eb,null))[_0x53c2('0x20')](function(_0x38650a){if(_0x38650a){_0x4b64be=_0x38650a;switch(_0x32df0c[_0x53c2('0x43')]){case _0x53c2('0x8d'):if(_0x126e57==='2'||_0x126e57==='6'){return _0x4b64be['update']({'read':!![]});}else{logger['error'](_0x53c2('0x25'),_0x53c2('0x2b'),_0x53c2('0x8d'),util[_0x53c2('0xd3')](_0x4db63b[_0x53c2('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x4b64be;}})[_0x53c2('0x20')](respondWithResult(_0x3508eb,null))['catch'](handleError(_0x3508eb,null));};exports[_0x53c2('0xdc')]=function(_0x28bc0f,_0x34cb52,_0x5f4cbd){return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x28bc0f[_0x53c2('0x61')]['id']}})['then'](handleEntityNotFound(_0x34cb52,null))['then'](function(_0x21ac15){if(_0x21ac15){return _0x21ac15['addAgents'](_0x28bc0f['body'][_0x53c2('0x6d')],_[_0x53c2('0x9d')](_0x28bc0f[_0x53c2('0x5a')],[_0x53c2('0x6d'),'id'])||{})[_0x53c2('0xa0')](function(_0x25346e){for(var _0x203619=0x0;_0x203619<_0x28bc0f[_0x53c2('0x5a')][_0x53c2('0x6d')][_0x53c2('0x4b')];_0x203619+=0x1){socket[_0x53c2('0xdd')](_0x53c2('0xde'),{'UserId':_0x28bc0f['body'][_0x53c2('0x6d')][_0x203619],'SmsAccountId':_0x28bc0f[_0x53c2('0x61')]['id']});}return _0x25346e;});}})[_0x53c2('0x20')](respondWithResult(_0x34cb52,null))[_0x53c2('0x2a')](handleError(_0x34cb52,null));};exports['removeAgents']=function(_0x332650,_0x2cba7b,_0x35d8ef){return db[_0x53c2('0x40')][_0x53c2('0x5f')]({'where':{'id':_0x332650[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x2cba7b,null))[_0x53c2('0x20')](function(_0x3f8ed5){if(_0x3f8ed5){return _0x3f8ed5['removeAgents'](_0x332650['query']['ids'])[_0x53c2('0x20')](function(){if(_[_0x53c2('0xdf')](_0x332650[_0x53c2('0x46')][_0x53c2('0x6d')])){for(var _0x5ddd6c=0x0;_0x5ddd6c<_0x332650[_0x53c2('0x46')][_0x53c2('0x6d')][_0x53c2('0x4b')];_0x5ddd6c+=0x1){socket[_0x53c2('0xdd')](_0x53c2('0xe0'),{'UserId':Number(_0x332650['query'][_0x53c2('0x6d')][_0x5ddd6c]),'SmsAccountId':Number(_0x332650[_0x53c2('0x61')]['id'])});}}else{socket['emit'](_0x53c2('0xe0'),{'UserId':Number(_0x332650[_0x53c2('0x46')][_0x53c2('0x6d')]),'SmsAccountId':Number(_0x332650['params']['id'])});}});}})[_0x53c2('0x20')](respondWithStatusCode(_0x2cba7b,null))[_0x53c2('0x2a')](handleError(_0x2cba7b,null));};exports['getAgents']=function(_0x71ec0c,_0x4343b9,_0x41cf40){var _0x11feda={};var _0x3ef364={};var _0x43b21f;var _0x197acb;return db[_0x53c2('0x40')][_0x53c2('0xb6')]({'where':{'id':_0x71ec0c[_0x53c2('0x61')]['id']}})[_0x53c2('0x20')](handleEntityNotFound(_0x4343b9,null))['then'](function(_0x57fc01){if(_0x57fc01){_0x43b21f=_0x57fc01;_0x3ef364[_0x53c2('0x45')]=_['keys'](db[_0x53c2('0xa6')][_0x53c2('0x41')]);_0x3ef364['query']=_[_0x53c2('0x58')](_0x71ec0c[_0x53c2('0x46')]);_0x3ef364['filters']=_['intersection'](_0x3ef364[_0x53c2('0x45')],_0x3ef364[_0x53c2('0x46')]);_0x11feda[_0x53c2('0x48')]=_[_0x53c2('0x49')](_0x3ef364[_0x53c2('0x45')],qs['fields'](_0x71ec0c[_0x53c2('0x46')][_0x53c2('0x4a')]));_0x11feda[_0x53c2('0x48')]=_0x11feda[_0x53c2('0x48')][_0x53c2('0x4b')]?_0x11feda[_0x53c2('0x48')]:_0x3ef364[_0x53c2('0x45')];_0x11feda['order']=qs[_0x53c2('0x4d')](_0x71ec0c[_0x53c2('0x46')][_0x53c2('0x4d')]);_0x11feda[_0x53c2('0x50')]=qs[_0x53c2('0x47')](_[_0x53c2('0x4e')](_0x71ec0c['query'],_0x3ef364['filters']));if(_0x71ec0c[_0x53c2('0x46')]['filter']){_0x11feda[_0x53c2('0x50')]=_[_0x53c2('0x51')](_0x11feda['where'],{'$or':_[_0x53c2('0x3f')](_0x11feda[_0x53c2('0x48')],function(_0x1f8f82){var _0x14e55c={};_0x14e55c[_0x1f8f82]={'$like':'%'+_0x71ec0c['query']['filter']+'%'};return _0x14e55c;})});}_0x11feda=_[_0x53c2('0x51')]({},_0x11feda,_0x71ec0c[_0x53c2('0x53')]);return _0x43b21f[_0x53c2('0xe1')](_0x11feda);}})['then'](function(_0x5217ee){if(_0x5217ee){_0x197acb=_0x5217ee[_0x53c2('0x4b')];if(!_0x71ec0c['query'][_0x53c2('0x65')]('nolimit')){_0x11feda[_0x53c2('0x2e')]=qs[_0x53c2('0x2e')](_0x71ec0c[_0x53c2('0x46')][_0x53c2('0x2e')]);_0x11feda['offset']=qs[_0x53c2('0x2c')](_0x71ec0c[_0x53c2('0x46')][_0x53c2('0x2c')]);}return _0x43b21f['getAgents'](_0x11feda);}})[_0x53c2('0x20')](function(_0x2939ba){if(_0x2939ba){return _0x2939ba?{'count':_0x197acb,'rows':_0x2939ba}:null;}})[_0x53c2('0x20')](respondWithResult(_0x4343b9,null))[_0x53c2('0x2a')](handleError(_0x4343b9,null));};
\ No newline at end of file
+var _0xd75c=['ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','autoclose','applications','close','unmanaged','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','send','addApplications','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','SmsMessage','dataValues','push','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','redif','inspect','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','intelepeer','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','SmsAccounts','UserProfileResource','stack','name','Pause','map','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','show','params','intersection','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','find','describe','Disposition','getDispositions','findOne','rawAttributes','length','hasOwnProperty','SmsAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','refid','isNil','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x5a1c0a,_0x3b9c69){var _0x85ba9d=function(_0x24ecc2){while(--_0x24ecc2){_0x5a1c0a['push'](_0x5a1c0a['shift']());}};_0x85ba9d(++_0x3b9c69);}(_0xd75c,0x133));var _0xcd75=function(_0x1e134d,_0x5080cb){_0x1e134d=_0x1e134d-0x0;var _0xfdbf45=_0xd75c[_0x1e134d];return _0xfdbf45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd75('0x0'));var zipdir=require(_0xcd75('0x1'));var jsonpatch=require(_0xcd75('0x2'));var rp=require(_0xcd75('0x3'));var moment=require(_0xcd75('0x4'));var BPromise=require(_0xcd75('0x5'));var Mustache=require(_0xcd75('0x6'));var util=require('util');var path=require(_0xcd75('0x7'));var sox=require(_0xcd75('0x8'));var csv=require(_0xcd75('0x9'));var ejs=require(_0xcd75('0xa'));var fs=require('fs');var fs_extra=require(_0xcd75('0xb'));var _=require('lodash');var squel=require(_0xcd75('0xc'));var crypto=require('crypto');var jsforce=require(_0xcd75('0xd'));var deskjs=require(_0xcd75('0xe'));var toCsv=require(_0xcd75('0x9'));var querystring=require(_0xcd75('0xf'));var Papa=require(_0xcd75('0x10'));var Redis=require(_0xcd75('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcd75('0x12'));var as=require(_0xcd75('0x13'));var hardwareService=require(_0xcd75('0x14'));var logger=require(_0xcd75('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xcd75('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd75('0x17'))['db'];config['redis']=_[_0xcd75('0x18')](config[_0xcd75('0x19')],{'host':_0xcd75('0x1a'),'port':0x18eb});var socket=require(_0xcd75('0x1b'))(new Redis(config[_0xcd75('0x19')]));require(_0xcd75('0x1c'))[_0xcd75('0x1d')](socket);var jayson=require(_0xcd75('0x1e'));var client=jayson[_0xcd75('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x49e7dc,_0x50b96d,_0x21ff06,_0x453027){return new BPromise(function(_0x5bbcd3,_0x3b0473){var _0x471aa2=_0x453027||client;return _0x471aa2['request'](_0x49e7dc,_0x21ff06)['then'](function(_0x466ae3){logger[_0xcd75('0x20')](_0xcd75('0x21'),_0x50b96d,_0xcd75('0x22'));logger['debug'](_0xcd75('0x23'),_0x50b96d,'request\x20sent',JSON['stringify'](_0x466ae3));if(_0x466ae3[_0xcd75('0x24')]){if(_0x466ae3[_0xcd75('0x24')][_0xcd75('0x25')]===0x1f4){logger['error'](_0xcd75('0x21'),_0x50b96d,_0x466ae3[_0xcd75('0x24')]['message']);return _0x3b0473(_0x466ae3['error'][_0xcd75('0x26')]);}logger[_0xcd75('0x24')](_0xcd75('0x21'),_0x50b96d,_0x466ae3[_0xcd75('0x24')][_0xcd75('0x26')]);return _0x5bbcd3(_0x466ae3[_0xcd75('0x24')][_0xcd75('0x26')]);}else{logger[_0xcd75('0x20')]('SmsAccount,\x20%s,\x20%s',_0x50b96d,_0xcd75('0x22'));_0x5bbcd3(_0x466ae3['result']['message']);}})[_0xcd75('0x27')](function(_0x1e666a){logger[_0xcd75('0x24')](_0xcd75('0x21'),_0x50b96d,_0x1e666a);_0x3b0473(_0x1e666a);});});}function respondWithStatusCode(_0x572262,_0x478d05){_0x478d05=_0x478d05||0xcc;return function(_0x333dcf){if(_0x333dcf){return _0x572262[_0xcd75('0x28')](_0x478d05);}return _0x572262[_0xcd75('0x29')](_0x478d05)[_0xcd75('0x2a')]();};}function respondWithResult(_0x1666bb,_0x3e4449){_0x3e4449=_0x3e4449||0xc8;return function(_0x12c570){if(_0x12c570){return _0x1666bb[_0xcd75('0x29')](_0x3e4449)[_0xcd75('0x2b')](_0x12c570);}};}function respondWithFilteredResult(_0x46e598,_0x2ff4b8){return function(_0x5e9392){if(_0x5e9392){var _0x3e3f86=typeof _0x2ff4b8['offset']==='undefined'&&typeof _0x2ff4b8['limit']===_0xcd75('0x2c');var _0x4c6f37=_0x5e9392[_0xcd75('0x2d')];var _0x524a23=_0x3e3f86?0x0:_0x2ff4b8['offset'];var _0x541ddc=_0x3e3f86?_0x5e9392[_0xcd75('0x2d')]:_0x2ff4b8[_0xcd75('0x2e')]+_0x2ff4b8[_0xcd75('0x2f')];var _0x1171ac;if(_0x541ddc>=_0x4c6f37){_0x541ddc=_0x4c6f37;_0x1171ac=0xc8;}else{_0x1171ac=0xce;}_0x46e598[_0xcd75('0x29')](_0x1171ac);return _0x46e598[_0xcd75('0x30')](_0xcd75('0x31'),_0x524a23+'-'+_0x541ddc+'/'+_0x4c6f37)[_0xcd75('0x2b')](_0x5e9392);}return null;};}function patchUpdates(_0x2b1b5b){return function(_0x254ab4){try{jsonpatch[_0xcd75('0x32')](_0x254ab4,_0x2b1b5b,!![]);}catch(_0x4d2417){return BPromise[_0xcd75('0x33')](_0x4d2417);}return _0x254ab4[_0xcd75('0x34')]();};}function saveUpdates(_0x295e29,_0x5f1179){return function(_0x5f4d66){if(_0x5f4d66){return _0x5f4d66['update'](_0x295e29)['then'](function(_0x35e733){return _0x35e733;});}return null;};}function removeEntity(_0x12748a,_0x57b486){return function(_0x3fd862){if(_0x3fd862){return _0x3fd862[_0xcd75('0x35')]()[_0xcd75('0x36')](function(){var _0x35b2a5=_0x3fd862['get']({'plain':!![]});var _0x3a01f2=_0xcd75('0x37');return db[_0xcd75('0x38')][_0xcd75('0x35')]({'where':{'type':_0x3a01f2,'resourceId':_0x35b2a5['id']}})['then'](function(){return _0x3fd862;});})[_0xcd75('0x36')](function(){_0x12748a[_0xcd75('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x322738,_0x154c17){return function(_0x2da5a5){if(!_0x2da5a5){_0x322738[_0xcd75('0x28')](0x194);}return _0x2da5a5;};}function handleError(_0x276f4a,_0x1b8566){_0x1b8566=_0x1b8566||0x1f4;return function(_0x4e2049){logger['error'](_0x4e2049[_0xcd75('0x39')]);if(_0x4e2049[_0xcd75('0x3a')]){delete _0x4e2049[_0xcd75('0x3a')];}_0x276f4a[_0xcd75('0x29')](_0x1b8566)['send'](_0x4e2049);};}exports['index']=function(_0x339b45,_0x605aa5){var _0x3cdc0d={'include':[{'model':db[_0xcd75('0x3b')],'as':'mandatoryDispositionPause'}]},_0x53dae9={},_0x40fa02={'count':0x0,'rows':[]};var _0x5b7a48=_[_0xcd75('0x3c')](db['SmsAccount']['rawAttributes'],function(_0x14c4c6){return{'name':_0x14c4c6[_0xcd75('0x3d')],'type':_0x14c4c6[_0xcd75('0x3e')][_0xcd75('0x3f')]};});_0x53dae9[_0xcd75('0x40')]=_[_0xcd75('0x3c')](_0x5b7a48,_0xcd75('0x3a'));_0x53dae9[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x339b45[_0xcd75('0x41')]);_0x53dae9[_0xcd75('0x43')]=_['intersection'](_0x53dae9[_0xcd75('0x40')],_0x53dae9[_0xcd75('0x41')]);_0x3cdc0d[_0xcd75('0x44')]=_['intersection'](_0x53dae9[_0xcd75('0x40')],qs['fields'](_0x339b45[_0xcd75('0x41')][_0xcd75('0x45')]));_0x3cdc0d[_0xcd75('0x44')]=_0x3cdc0d[_0xcd75('0x44')]['length']?_0x3cdc0d[_0xcd75('0x44')]:_0x53dae9['model'];if(!_0x339b45[_0xcd75('0x41')]['hasOwnProperty'](_0xcd75('0x46'))){_0x3cdc0d['limit']=qs[_0xcd75('0x2f')](_0x339b45[_0xcd75('0x41')][_0xcd75('0x2f')]);_0x3cdc0d['offset']=qs[_0xcd75('0x2e')](_0x339b45[_0xcd75('0x41')][_0xcd75('0x2e')]);}_0x3cdc0d[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x339b45[_0xcd75('0x41')][_0xcd75('0x48')]);_0x3cdc0d[_0xcd75('0x49')]=qs[_0xcd75('0x43')](_[_0xcd75('0x4a')](_0x339b45[_0xcd75('0x41')],_0x53dae9[_0xcd75('0x43')]),_0x5b7a48);if(_0x339b45[_0xcd75('0x41')][_0xcd75('0x4b')]){_0x3cdc0d[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x3cdc0d[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x5b7a48,function(_0x3d9130){if(_0x3d9130['type']!==_0xcd75('0x4d')){var _0x34734c={};_0x34734c[_0x3d9130['name']]={'$like':'%'+_0x339b45[_0xcd75('0x41')][_0xcd75('0x4b')]+'%'};return _0x34734c;}})});}_0x3cdc0d=_[_0xcd75('0x4c')]({},_0x3cdc0d,_0x339b45[_0xcd75('0x4e')]);var _0x277c5d={'where':_0x3cdc0d[_0xcd75('0x49')]};return db[_0xcd75('0x4f')][_0xcd75('0x2d')](_0x277c5d)[_0xcd75('0x36')](function(_0x4d919e){_0x40fa02[_0xcd75('0x2d')]=_0x4d919e;if(_0x339b45[_0xcd75('0x41')][_0xcd75('0x50')]){_0x3cdc0d[_0xcd75('0x51')]=[{'all':!![]}];}return db[_0xcd75('0x4f')][_0xcd75('0x52')](_0x3cdc0d);})['then'](function(_0x47de02){_0x40fa02[_0xcd75('0x53')]=_0x47de02;return _0x40fa02;})[_0xcd75('0x36')](respondWithFilteredResult(_0x605aa5,_0x3cdc0d))[_0xcd75('0x27')](handleError(_0x605aa5,null));};exports[_0xcd75('0x54')]=function(_0x3995a3,_0x32fb8e){var _0x307734={'raw':![],'where':{'id':_0x3995a3[_0xcd75('0x55')]['id']},'include':[{'model':db[_0xcd75('0x3b')],'as':'mandatoryDispositionPause'}]},_0x245017={};_0x245017[_0xcd75('0x40')]=_['keys'](db['SmsAccount']['rawAttributes']);_0x245017[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x3995a3[_0xcd75('0x41')]);_0x245017[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x245017['model'],_0x245017[_0xcd75('0x41')]);_0x307734[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x245017[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x3995a3[_0xcd75('0x41')]['fields']));_0x307734[_0xcd75('0x44')]=_0x307734[_0xcd75('0x44')]['length']?_0x307734[_0xcd75('0x44')]:_0x245017['model'];if(_0x3995a3['query']['includeAll']){_0x307734[_0xcd75('0x51')]=[{'all':!![]}];}_0x307734=_['merge']({},_0x307734,_0x3995a3[_0xcd75('0x4e')]);return db[_0xcd75('0x4f')]['find'](_0x307734)[_0xcd75('0x36')](handleEntityNotFound(_0x32fb8e,null))[_0xcd75('0x36')](respondWithResult(_0x32fb8e,null))['catch'](handleError(_0x32fb8e,null));};exports[_0xcd75('0x57')]=function(_0x2db738,_0x178beb){return db[_0xcd75('0x4f')]['create'](_0x2db738[_0xcd75('0x58')],{})[_0xcd75('0x36')](function(_0x3c3b05){var _0x577df7=_0x2db738[_0xcd75('0x59')][_0xcd75('0x5a')]({'plain':!![]});if(!_0x577df7)throw new Error(_0xcd75('0x5b'));if(_0x577df7[_0xcd75('0x5c')]===_0xcd75('0x59')){var _0x1297e9=_0x3c3b05[_0xcd75('0x5a')]({'plain':!![]});var _0x1c98f3=_0xcd75('0x37');return db[_0xcd75('0x5d')]['find']({'where':{'name':_0x1c98f3,'userProfileId':_0x577df7[_0xcd75('0x5e')]},'raw':!![]})[_0xcd75('0x36')](function(_0x2b02e3){if(_0x2b02e3&&_0x2b02e3['autoAssociation']===0x0){return db[_0xcd75('0x38')][_0xcd75('0x57')]({'name':_0x1297e9['name'],'resourceId':_0x1297e9['id'],'type':_0x2b02e3[_0xcd75('0x3a')],'sectionId':_0x2b02e3['id']},{})[_0xcd75('0x36')](function(){return _0x3c3b05;});}else{return _0x3c3b05;}})[_0xcd75('0x27')](function(_0x46c76e){logger[_0xcd75('0x24')](_0xcd75('0x5f'),_0x46c76e);throw _0x46c76e;});}return _0x3c3b05;})['then'](respondWithResult(_0x178beb,0xc9))['catch'](handleError(_0x178beb,null));};exports[_0xcd75('0x60')]=function(_0x44d998,_0x97a2a9){if(_0x44d998[_0xcd75('0x58')]['id']){delete _0x44d998[_0xcd75('0x58')]['id'];}return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x44d998[_0xcd75('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xcd75('0x61')}]})[_0xcd75('0x36')](handleEntityNotFound(_0x97a2a9,null))[_0xcd75('0x36')](saveUpdates(_0x44d998[_0xcd75('0x58')],null))[_0xcd75('0x36')](respondWithResult(_0x97a2a9,null))['catch'](handleError(_0x97a2a9,null));};exports[_0xcd75('0x35')]=function(_0x520f5e,_0x35dde6){return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x520f5e[_0xcd75('0x55')]['id']}})['then'](handleEntityNotFound(_0x35dde6,null))['then'](removeEntity(_0x35dde6,null))[_0xcd75('0x27')](handleError(_0x35dde6,null));};exports[_0xcd75('0x63')]=function(_0xae3567,_0x29b38f){return db[_0xcd75('0x4f')][_0xcd75('0x63')]()[_0xcd75('0x36')](respondWithResult(_0x29b38f,null))['catch'](handleError(_0x29b38f,null));};exports['addDisposition']=function(_0x339417,_0x25c3b4,_0x1f58f4){if(_0x339417['body']['id']){delete _0x339417[_0xcd75('0x58')]['id'];}return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x339417[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x25c3b4,null))[_0xcd75('0x36')](function(_0x1496ce){if(_0x1496ce){_0x339417[_0xcd75('0x58')]['SmsAccountId']=_0x1496ce['id'];return db[_0xcd75('0x64')]['create'](_0x339417[_0xcd75('0x58')]);}})[_0xcd75('0x36')](respondWithResult(_0x25c3b4,null))[_0xcd75('0x27')](handleError(_0x25c3b4,null));};exports[_0xcd75('0x65')]=function(_0x38b30b,_0x2ce609,_0x5c95b1){var _0x158919={'raw':![],'where':{}};var _0x43487c={};var _0x4f509a={'count':0x0,'rows':[]};return db[_0xcd75('0x4f')][_0xcd75('0x66')]({'where':{'id':_0x38b30b[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x2ce609,null))[_0xcd75('0x36')](function(_0x39bfac){if(_0x39bfac){_0x43487c[_0xcd75('0x40')]=_[_0xcd75('0x42')](db[_0xcd75('0x64')][_0xcd75('0x67')]);_0x43487c['query']=_[_0xcd75('0x42')](_0x38b30b[_0xcd75('0x41')]);_0x43487c[_0xcd75('0x43')]=_['intersection'](_0x43487c[_0xcd75('0x40')],_0x43487c[_0xcd75('0x41')]);_0x158919[_0xcd75('0x44')]=_['intersection'](_0x43487c['model'],qs[_0xcd75('0x45')](_0x38b30b[_0xcd75('0x41')]['fields']));_0x158919[_0xcd75('0x44')]=_0x158919['attributes'][_0xcd75('0x68')]?_0x158919[_0xcd75('0x44')]:_0x43487c[_0xcd75('0x40')];if(!_0x38b30b[_0xcd75('0x41')][_0xcd75('0x69')](_0xcd75('0x46'))){_0x158919['limit']=qs[_0xcd75('0x2f')](_0x38b30b[_0xcd75('0x41')][_0xcd75('0x2f')]);_0x158919[_0xcd75('0x2e')]=qs[_0xcd75('0x2e')](_0x38b30b[_0xcd75('0x41')]['offset']);}_0x158919[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x38b30b['query'][_0xcd75('0x48')]);_0x158919[_0xcd75('0x49')]=qs['filters'](_[_0xcd75('0x4a')](_0x38b30b['query'],_0x43487c[_0xcd75('0x43')]));_0x158919[_0xcd75('0x49')][_0xcd75('0x6a')]=_0x39bfac['id'];if(_0x38b30b[_0xcd75('0x41')]['filter']){_0x158919[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x158919[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x158919['attributes'],function(_0x56b3a7){var _0x428cb9={};_0x428cb9[_0x56b3a7]={'$like':'%'+_0x38b30b['query'][_0xcd75('0x4b')]+'%'};return _0x428cb9;})});}_0x158919=_['merge']({},_0x158919,_0x38b30b['options']);return db[_0xcd75('0x64')]['count']({'where':_0x158919[_0xcd75('0x49')]})[_0xcd75('0x36')](function(_0x139360){_0x4f509a[_0xcd75('0x2d')]=_0x139360;if(_0x38b30b['query'][_0xcd75('0x50')]){_0x158919['include']=[{'all':!![]}];}return db[_0xcd75('0x64')]['findAll'](_0x158919);})['then'](function(_0x3f20ab){_0x4f509a[_0xcd75('0x53')]=_0x3f20ab;return _0x4f509a;});}})['then'](respondWithFilteredResult(_0x2ce609,_0x158919))[_0xcd75('0x27')](handleError(_0x2ce609,null));};exports[_0xcd75('0x6b')]=function(_0x177299,_0x3d456d,_0x17f478){return db['SmsAccount'][_0xcd75('0x62')]({'where':{'id':_0x177299[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x3d456d,null))[_0xcd75('0x36')](function(_0x4e2638){if(_0x4e2638){return _0x4e2638[_0xcd75('0x6b')](_0x177299[_0xcd75('0x41')][_0xcd75('0x6c')]);}})['then'](respondWithStatusCode(_0x3d456d,null))[_0xcd75('0x27')](handleError(_0x3d456d,null));};exports['addAnswer']=function(_0xe18943,_0x37396c,_0x85a266){if(_0xe18943[_0xcd75('0x58')]['id']){delete _0xe18943[_0xcd75('0x58')]['id'];}return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0xe18943[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x37396c,null))[_0xcd75('0x36')](function(_0x38de02){if(_0x38de02){_0xe18943[_0xcd75('0x58')][_0xcd75('0x6a')]=_0x38de02['id'];return db[_0xcd75('0x6d')][_0xcd75('0x57')](_0xe18943['body']);}})['then'](respondWithResult(_0x37396c,null))[_0xcd75('0x27')](handleError(_0x37396c,null));};exports[_0xcd75('0x6e')]=function(_0x5b7b34,_0x200da2,_0x315e6c){var _0x20285d={'raw':![],'where':{}};var _0x46a7d5={};var _0xaff6ce={'count':0x0,'rows':[]};return db['SmsAccount'][_0xcd75('0x66')]({'where':{'id':_0x5b7b34['params']['id']}})['then'](handleEntityNotFound(_0x200da2,null))['then'](function(_0x33d282){if(_0x33d282){_0x46a7d5[_0xcd75('0x40')]=_[_0xcd75('0x42')](db['CannedAnswer'][_0xcd75('0x67')]);_0x46a7d5[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x5b7b34[_0xcd75('0x41')]);_0x46a7d5[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x46a7d5['model'],_0x46a7d5[_0xcd75('0x41')]);_0x20285d[_0xcd75('0x44')]=_['intersection'](_0x46a7d5['model'],qs['fields'](_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x45')]));_0x20285d[_0xcd75('0x44')]=_0x20285d[_0xcd75('0x44')][_0xcd75('0x68')]?_0x20285d[_0xcd75('0x44')]:_0x46a7d5[_0xcd75('0x40')];if(!_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x69')](_0xcd75('0x46'))){_0x20285d['limit']=qs[_0xcd75('0x2f')](_0x5b7b34['query'][_0xcd75('0x2f')]);_0x20285d[_0xcd75('0x2e')]=qs['offset'](_0x5b7b34[_0xcd75('0x41')]['offset']);}_0x20285d['order']=qs['sort'](_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x48')]);_0x20285d[_0xcd75('0x49')]=qs[_0xcd75('0x43')](_['pick'](_0x5b7b34['query'],_0x46a7d5[_0xcd75('0x43')]));_0x20285d['where'][_0xcd75('0x6a')]=_0x33d282['id'];if(_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x4b')]){_0x20285d['where']=_[_0xcd75('0x4c')](_0x20285d[_0xcd75('0x49')],{'$or':_['map'](_0x20285d[_0xcd75('0x44')],function(_0xf2f452){var _0xb7c34f={};_0xb7c34f[_0xf2f452]={'$like':'%'+_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x4b')]+'%'};return _0xb7c34f;})});}_0x20285d=_[_0xcd75('0x4c')]({},_0x20285d,_0x5b7b34[_0xcd75('0x4e')]);return db[_0xcd75('0x6d')]['count']({'where':_0x20285d[_0xcd75('0x49')]})[_0xcd75('0x36')](function(_0x539886){_0xaff6ce[_0xcd75('0x2d')]=_0x539886;if(_0x5b7b34[_0xcd75('0x41')][_0xcd75('0x50')]){_0x20285d['include']=[{'all':!![]}];}return db[_0xcd75('0x6d')][_0xcd75('0x52')](_0x20285d);})[_0xcd75('0x36')](function(_0x31f011){_0xaff6ce[_0xcd75('0x53')]=_0x31f011;return _0xaff6ce;});}})['then'](respondWithFilteredResult(_0x200da2,_0x20285d))[_0xcd75('0x27')](handleError(_0x200da2,null));};exports[_0xcd75('0x6f')]=function(_0x4e27c1,_0x4435b3,_0x4d2316){return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x4e27c1['params']['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x4435b3,null))[_0xcd75('0x36')](function(_0x4b1659){if(_0x4b1659){return _0x4b1659[_0xcd75('0x6f')](_0x4e27c1['query']['ids']);}})[_0xcd75('0x36')](respondWithStatusCode(_0x4435b3,null))[_0xcd75('0x27')](handleError(_0x4435b3,null));};exports[_0xcd75('0x70')]=function(_0x49a7b5,_0x1317ff,_0x3b774a){var _0x3cef17={'channel':_0xcd75('0x71')};var _0x3a43cd=[];var _0x1dabff=[];var _0x434904={};return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x49a7b5['params']['id']},'include':[{'model':db[_0xcd75('0x72')],'as':_0xcd75('0x73')}]})['then'](handleEntityNotFound(_0x1317ff,null))[_0xcd75('0x36')](function(_0x3e4de7){_0x3cef17[_0xcd75('0x74')]=_0x3e4de7;_0x3cef17['applications']=_[_0xcd75('0x75')](_0x3e4de7[_0xcd75('0x73')],['priority'],[_0xcd75('0x76')]);if(_0x3cef17[_0xcd75('0x74')][_0xcd75('0x73')]){delete _0x3cef17[_0xcd75('0x74')]['Applications'];}return db[_0xcd75('0x77')][_0xcd75('0x63')]();})[_0xcd75('0x36')](function(_0x56a93f){if(!_0x56a93f){throw new db[(_0xcd75('0x78'))]['ValidationError'](_0xcd75('0x79'));}_0x3a43cd=_[_0xcd75('0x7a')](_[_0xcd75('0x42')](_0x56a93f),[_0xcd75('0x7b'),_0xcd75('0x7c')]);_0x1dabff=_[_0xcd75('0x7a')](_['keys'](_0x56a93f),[_0xcd75('0x7b'),_0xcd75('0x7c'),_0xcd75('0x7d'),'ListId']);_0x3cef17[_0xcd75('0x58')]={'mapKey':_0xcd75('0x7e')};if(_0x3cef17[_0xcd75('0x74')][_0xcd75('0x3e')]){switch(_0x3cef17[_0xcd75('0x74')]['type']){case _0xcd75('0x7f'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x81')];_0x3cef17['body']['body']=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x82')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x84')];break;case _0xcd75('0x85'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]='+'+_0x49a7b5['body'][_0xcd75('0x86')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x87')];break;case'connectel':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x80')];_0x3cef17['body'][_0xcd75('0x58')]=_0x49a7b5['body'][_0xcd75('0x26')];break;case _0xcd75('0x88'):_0x3cef17[_0xcd75('0x58')]['from']=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x80')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')]['body'];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x89')];break;case _0xcd75('0x8a'):_0x3cef17['body'][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x81')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8b')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8c')];break;case _0xcd75('0x8d'):_0x3cef17[_0xcd75('0x58')]['from']='+'+_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8e')][0x0][_0xcd75('0x80')];_0x3cef17['body']['body']=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x8e')][0x0][_0xcd75('0x87')];_0x3cef17['body']['messageId']=_0x49a7b5['body'][_0xcd75('0x8e')][0x0][_0xcd75('0x83')];break;case _0xcd75('0x8f'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x90')];_0x3cef17['body'][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x91')][_0xcd75('0x26')];break;case _0xcd75('0x92'):_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x93')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x87')];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')]['replyMessageId'];break;case _0xcd75('0x94'):_0x3cef17['body'][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][0x0][_0xcd75('0x26')]['id'];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5[_0xcd75('0x58')][0x0][_0xcd75('0x26')][_0xcd75('0x80')];_0x3cef17['body']['body']=_0x49a7b5[_0xcd75('0x58')][0x0][_0xcd75('0x26')][_0xcd75('0x87')];break;case'intelepeer':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')]=_0x49a7b5['body'][_0xcd75('0x80')];_0x3cef17['body'][_0xcd75('0x58')]=_0x49a7b5[_0xcd75('0x58')]['message'];_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')]=_0x49a7b5[_0xcd75('0x58')][_0xcd75('0x95')];break;}}if(_0x3cef17[_0xcd75('0x58')]['id']){delete _0x3cef17['body']['id'];}if(_[_0xcd75('0x96')](_0x3cef17[_0xcd75('0x58')]['from'])){throw new db[(_0xcd75('0x78'))]['ValidationError'](_0xcd75('0x97'));}if(_[_0xcd75('0x96')](_0x3cef17[_0xcd75('0x58')]['body'])||_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')]===''){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3cef17['body'][_0xcd75('0x99')])){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0x9a')+_0x1dabff);}if(!_[_0xcd75('0x9b')](_0x1dabff,_0x3cef17[_0xcd75('0x58')][_0xcd75('0x99')])){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0x9c')+_0x1dabff);}_0x434904[_0x3cef17['body'][_0xcd75('0x99')]]=_0x3cef17[_0xcd75('0x58')]['from'];return db['CmList'][_0xcd75('0x62')]({'where':{'id':_0x3cef17[_0xcd75('0x74')][_0xcd75('0x9d')]},'include':[{'model':db['CmContact'],'as':_0xcd75('0x9e'),'where':_0x434904,'limit':0x1,'order':[[_0xcd75('0x7c'),_0xcd75('0x9f')]]}]});})[_0xcd75('0x36')](handleEntityNotFound(_0x1317ff,null))[_0xcd75('0x36')](function(_0x59fcff){if(_0x59fcff){_0x3cef17[_0xcd75('0xa0')]=_[_0xcd75('0xa1')](_0x59fcff,[_0xcd75('0x9e')]);if(_0x59fcff[_0xcd75('0x9e')][_0xcd75('0x68')]){return _0x59fcff[_0xcd75('0x9e')][0x0];}var _0x5b1243=_['defaults'](_0x3cef17[_0xcd75('0x58')],{'firstName':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')],'ListId':_0x59fcff['id']});_0x5b1243[_0x3cef17[_0xcd75('0x58')]['mapKey']]=_0x3cef17[_0xcd75('0x58')]['from'];return db[_0xcd75('0x77')]['create'](_0x5b1243,{'fields':_0x3a43cd,'raw':!![]});}})[_0xcd75('0x36')](handleEntityNotFound(_0x1317ff,null))[_0xcd75('0x36')](function(_0x234159){if(_0x234159){_0x3cef17[_0xcd75('0xa2')]=_0x234159;var _0x2c31f3={'ContactId':_0x234159['id'],'phone':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')],'SmsAccountId':_0x49a7b5[_0xcd75('0x55')]['id']};var _0x884b15={'ContactId':_0x234159['id'],'SmsAccountId':_0x49a7b5[_0xcd75('0x55')]['id'],'closed':![]};return db[_0xcd75('0xa3')][_0xcd75('0x62')]({'where':_0x884b15})[_0xcd75('0x36')](function(_0x22af53){if(_0x22af53){return[_0x22af53,![]];}return db[_0xcd75('0xa3')]['create'](_0x2c31f3)[_0xcd75('0x36')](function(_0x35ad45){return[_0x35ad45,!![]];});});}})[_0xcd75('0xa4')](function(_0x4f9d08,_0xd3394c){_0x3cef17['interaction']=_0x4f9d08[_0xcd75('0x5a')]({'plain':!![]});_0x3cef17[_0xcd75('0xa5')]['created']=![];if(_0xd3394c){if(_0x3cef17[_0xcd75('0x74')][_0xcd75('0xa6')]){_0x3cef17[_0xcd75('0xa7')]['push']({'id':0x0,'priority':_0x3cef17[_0xcd75('0xa7')][_0xcd75('0x68')]+0x1,'app':_0xcd75('0xa8'),'appdata':_0xcd75('0xa9'),'interval':_0xcd75('0xaa')});}_0x3cef17['interaction']['created']=!![];}return db['SmsMessage'][_0xcd75('0x57')]({'phone':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x80')],'messageId':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x83')],'body':_0x3cef17[_0xcd75('0x58')][_0xcd75('0x58')],'SmsAccountId':_0x49a7b5[_0xcd75('0x55')]['id'],'SmsInteractionId':_0x4f9d08['id'],'direction':'in','ContactId':_0x4f9d08[_0xcd75('0xab')],'AttachmentId':_0x3cef17[_0xcd75('0x58')]['AttachmentId']});})[_0xcd75('0x36')](function(_0x3dd982){_0x3cef17[_0xcd75('0x26')]=_0x3dd982;if(_0x3cef17['interaction'][_0xcd75('0xac')]){return db[_0xcd75('0xad')][_0xcd75('0x62')]({'attributes':['id',_0xcd75('0x3a')],'where':{'id':_0x3cef17['interaction']['UserId']}})[_0xcd75('0x36')](function(_0x293a08){if(_0x293a08){_0x3cef17[_0xcd75('0xa7')][_0xcd75('0xae')]({'id':0x0,'priority':0x0,'app':_0xcd75('0xaf'),'appdata':_0x293a08[_0xcd75('0x3a')]+','+(_0x3cef17[_0xcd75('0x74')][_0xcd75('0xb0')]||0xa),'interval':_0xcd75('0xaa')});}return respondWithRpcPromise(_0xcd75('0xb1'),_0xcd75('0xb2'),_0x3cef17);});}return respondWithRpcPromise('Start',_0xcd75('0xb2'),_0x3cef17);})[_0xcd75('0x36')](function(_0x4860a7){if(_0x4860a7){var _0x2a9a37=0xc8;var _0xd57b0e=_0xcd75('0xb3');logger['info'](_0xcd75('0x23'),_0xd57b0e,_0x2a9a37,_0xcd75('0xb4'));logger[_0xcd75('0xb5')](_0xcd75('0xb6'),_0xd57b0e,_0x2a9a37,_0xcd75('0xb4'),JSON[_0xcd75('0xb7')](_0x4860a7));if(_0x3cef17['account']['type']===_0xcd75('0x7f')){return _0x1317ff[_0xcd75('0x29')](_0x2a9a37)[_0xcd75('0x30')](_0xcd75('0xb8'),'text/xml')[_0xcd75('0xb9')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x1317ff['status'](_0x2a9a37)[_0xcd75('0x2b')](_0x4860a7);}}})[_0xcd75('0x27')](handleError(_0x1317ff,null));};exports[_0xcd75('0xba')]=function(_0x32a234,_0x2e6734,_0x3c6a10){return db[_0xcd75('0x4f')][_0xcd75('0x66')]({'where':{'id':_0x32a234[_0xcd75('0x55')]['id']}})['then'](handleEntityNotFound(_0x2e6734,null))[_0xcd75('0x36')](function(_0x5acaeb){if(_0x5acaeb){return db['sequelize']['transaction'](function(_0x58145e){return db['SmsApplication'][_0xcd75('0x35')]({'where':{'SmsAccountId':_0x32a234[_0xcd75('0x55')]['id']},'transaction':_0x58145e})[_0xcd75('0x36')](function(_0x46e543){var _0x30aef0=_['map'](_0x32a234[_0xcd75('0x58')],function(_0x192396){_0x192396['SmsAccountId']=_0x32a234['params']['id'];return _0x192396;});return db[_0xcd75('0x72')][_0xcd75('0xbb')](_0x30aef0,{'transaction':_0x58145e});});})[_0xcd75('0x36')](function(){return db[_0xcd75('0x72')][_0xcd75('0xbc')]({'where':{'SmsAccountId':_0x32a234[_0xcd75('0x55')]['id']},'order':_0xcd75('0xbd')});});}})[_0xcd75('0x36')](respondWithResult(_0x2e6734,null))['catch'](handleError(_0x2e6734,null));};exports['getApplications']=function(_0x4cd744,_0x2b102c,_0x2c6745){var _0xfd6900={};var _0x4dad71={};var _0x19abd4;var _0x4f24ff;return db[_0xcd75('0x4f')]['findOne']({'where':{'id':_0x4cd744[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x2b102c,null))['then'](function(_0x3ca75f){if(_0x3ca75f){_0x19abd4=_0x3ca75f;_0x4dad71[_0xcd75('0x40')]=_['keys'](db[_0xcd75('0x72')]['rawAttributes']);_0x4dad71[_0xcd75('0x41')]=_['keys'](_0x4cd744['query']);_0x4dad71[_0xcd75('0x43')]=_['intersection'](_0x4dad71[_0xcd75('0x40')],_0x4dad71[_0xcd75('0x41')]);_0xfd6900[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x4dad71[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x4cd744[_0xcd75('0x41')]['fields']));_0xfd6900['attributes']=_0xfd6900[_0xcd75('0x44')]['length']?_0xfd6900['attributes']:_0x4dad71[_0xcd75('0x40')];_0xfd6900[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x4cd744[_0xcd75('0x41')][_0xcd75('0x48')]);_0xfd6900['where']=qs[_0xcd75('0x43')](_[_0xcd75('0x4a')](_0x4cd744[_0xcd75('0x41')],_0x4dad71[_0xcd75('0x43')]));if(_0x4cd744[_0xcd75('0x41')][_0xcd75('0x4b')]){_0xfd6900[_0xcd75('0x49')]=_['merge'](_0xfd6900['where'],{'$or':_[_0xcd75('0x3c')](_0xfd6900[_0xcd75('0x44')],function(_0x51dbfc){var _0x58197c={};_0x58197c[_0x51dbfc]={'$like':'%'+_0x4cd744['query']['filter']+'%'};return _0x58197c;})});}_0xfd6900=_[_0xcd75('0x4c')]({},_0xfd6900,_0x4cd744[_0xcd75('0x4e')]);return _0x19abd4[_0xcd75('0xbe')](_0xfd6900);}})[_0xcd75('0x36')](function(_0x50457b){if(_0x50457b){_0x4f24ff=_0x50457b[_0xcd75('0x68')];if(!_0x4cd744[_0xcd75('0x41')][_0xcd75('0x69')]('nolimit')){_0xfd6900[_0xcd75('0x2f')]=qs[_0xcd75('0x2f')](_0x4cd744['query'][_0xcd75('0x2f')]);_0xfd6900[_0xcd75('0x2e')]=qs[_0xcd75('0x2e')](_0x4cd744['query'][_0xcd75('0x2e')]);}return _0x19abd4['getApplications'](_0xfd6900);}})[_0xcd75('0x36')](function(_0x1865a4){if(_0x1865a4){return _0x1865a4?{'count':_0x4f24ff,'rows':_0x1865a4}:null;}})[_0xcd75('0x36')](respondWithResult(_0x2b102c,null))['catch'](handleError(_0x2b102c,null));};exports[_0xcd75('0xbf')]=function(_0x4999f9,_0x1200b5,_0x5a39ca){var _0x3440bf={'raw':![],'where':{}};var _0x54bd97={};var _0x219918={'count':0x0,'rows':[]};return db['SmsAccount'][_0xcd75('0x66')]({'where':{'id':_0x4999f9['params']['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x1200b5,null))['then'](function(_0x1a7ff6){if(_0x1a7ff6){_0x54bd97[_0xcd75('0x40')]=_[_0xcd75('0x42')](db[_0xcd75('0xa3')][_0xcd75('0x67')]);_0x54bd97['query']=_[_0xcd75('0x42')](_0x4999f9[_0xcd75('0x41')]);_0x54bd97[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x54bd97['model'],_0x54bd97[_0xcd75('0x41')]);_0x3440bf[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x54bd97[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x4999f9['query'][_0xcd75('0x45')]));_0x3440bf['attributes']=_0x3440bf['attributes'][_0xcd75('0x68')]?_0x3440bf['attributes']:_0x54bd97[_0xcd75('0x40')];if(!_0x4999f9[_0xcd75('0x41')]['hasOwnProperty']('nolimit')){_0x3440bf['limit']=qs[_0xcd75('0x2f')](_0x4999f9[_0xcd75('0x41')]['limit']);_0x3440bf[_0xcd75('0x2e')]=qs[_0xcd75('0x2e')](_0x4999f9[_0xcd75('0x41')][_0xcd75('0x2e')]);}_0x3440bf[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x4999f9[_0xcd75('0x41')][_0xcd75('0x48')]);_0x3440bf[_0xcd75('0x49')]=qs[_0xcd75('0x43')](_[_0xcd75('0x4a')](_0x4999f9['query'],_0x54bd97['filters']));_0x3440bf[_0xcd75('0x49')][_0xcd75('0x6a')]=_0x1a7ff6['id'];if(_0x4999f9[_0xcd75('0x41')][_0xcd75('0x4b')]){_0x3440bf[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x3440bf[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x3440bf[_0xcd75('0x44')],function(_0x45b73e){var _0x47f7c2={};_0x47f7c2[_0x45b73e]={'$like':'%'+_0x4999f9['query']['filter']+'%'};return _0x47f7c2;})});}_0x3440bf=_[_0xcd75('0x4c')]({},_0x3440bf,_0x4999f9['options']);return db[_0xcd75('0xa3')][_0xcd75('0x2d')]({'where':_0x3440bf[_0xcd75('0x49')]})[_0xcd75('0x36')](function(_0x50d6e8){_0x219918['count']=_0x50d6e8;if(_0x4999f9[_0xcd75('0x41')][_0xcd75('0x50')]){_0x3440bf[_0xcd75('0x51')]=[{'model':db[_0xcd75('0x77')],'as':'Contact','required':![]},{'model':db[_0xcd75('0xad')],'as':_0xcd75('0xc0'),'attributes':[_0xcd75('0x3a'),_0xcd75('0xc1'),_0xcd75('0xc2')],'required':![]},{'model':db[_0xcd75('0xc3')],'as':'Tags','attributes':['id',_0xcd75('0x3a'),_0xcd75('0xc4')],'where':_0x4999f9[_0xcd75('0x41')]['tag']?{'id':_0x4999f9[_0xcd75('0x41')][_0xcd75('0xc5')]}:undefined,'required':_0x4999f9[_0xcd75('0x41')][_0xcd75('0xc5')]?!![]:![]}];}return db['SmsInteraction'][_0xcd75('0x52')](_0x3440bf);})[_0xcd75('0x36')](function(_0x351edf){_0x219918['rows']=_0x351edf;return _0x219918;});}})['then'](respondWithFilteredResult(_0x1200b5,_0x3440bf))['catch'](handleError(_0x1200b5,null));};exports[_0xcd75('0xb9')]=function(_0x2addb1,_0x280af7,_0x429141){var _0x131495,_0x5e6683,_0x95e29a;if(_['isNil'](_0x2addb1[_0xcd75('0x58')][_0xcd75('0x58')])||_0x2addb1['body'][_0xcd75('0x58')]===''){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0xc6'));}if(_[_0xcd75('0x96')](_0x2addb1[_0xcd75('0x58')]['to'])){throw new db[(_0xcd75('0x78'))][(_0xcd75('0x98'))](_0xcd75('0xc7'));}_0x131495=_0x2addb1['body']['to'];return db['SmsAccount'][_0xcd75('0x62')]({'where':{'id':_0x2addb1[_0xcd75('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xcd75('0xc8'),'include':[{'model':db[_0xcd75('0x77')],'as':'Contacts','where':{'mobile':_0x131495},'limit':0x1,'order':[[_0xcd75('0x7c'),_0xcd75('0x9f')]]}]}]})['then'](handleEntityNotFound(_0x280af7,null))[_0xcd75('0x36')](function(_0x510d22){if(_0x510d22&&_0x510d22[_0xcd75('0xc8')]){_0x5e6683=_0x510d22['get']({'plain':!![]});if(_0x5e6683[_0xcd75('0xc8')]&&_0x5e6683[_0xcd75('0xc8')][_0xcd75('0x9e')][_0xcd75('0x68')]){return _0x5e6683['List']['Contacts'][0x0];}return db[_0xcd75('0x77')][_0xcd75('0x57')](_[_0xcd75('0x18')](_0x2addb1[_0xcd75('0x58')],{'firstName':_0x131495,'mobile':_0x131495,'phone':_0x131495,'ListId':_0x5e6683[_0xcd75('0x9d')]}));}})[_0xcd75('0x36')](handleEntityNotFound(_0x280af7,null))[_0xcd75('0x36')](function(_0xef24){if(_0xef24){_0x95e29a=_0xef24;return db[_0xcd75('0xa3')]['find']({'where':{'ContactId':_0x95e29a['id'],'closed':![],'SmsAccountId':_0x5e6683['id']}})[_0xcd75('0x36')](function(_0x12ef20){if(_0x12ef20){return[_0x12ef20,![]];}return db[_0xcd75('0xa3')]['create']({'UserId':_0x2addb1[_0xcd75('0x59')]['id'],'ContactId':_0x95e29a['id'],'SmsAccountId':_0x5e6683['id'],'phone':_0x131495,'firstMsgDirection':_0xcd75('0xc9'),'Messages':[_['merge'](_0x2addb1[_0xcd75('0x58')],{'read':![],'body':_0x2addb1[_0xcd75('0x58')][_0xcd75('0x58')],'phone':_0x131495,'SmsAccountId':_0x5e6683['id'],'UserId':_0x2addb1[_0xcd75('0x59')]['id'],'ContactId':_0x95e29a['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xcd75('0xca')}]})['then'](function(_0x5dccaa){return[_0x5dccaa,!![]];});});}})[_0xcd75('0xa4')](function(_0x32101d,_0x664d01){if(_0x664d01){return _0x32101d;}return db[_0xcd75('0xcb')][_0xcd75('0x57')](_[_0xcd75('0x4c')](_0x2addb1['body'],{'read':![],'body':_0x2addb1[_0xcd75('0x58')][_0xcd75('0x58')],'phone':_0x131495,'SmsAccountId':_0x5e6683['id'],'SmsInteractionId':_0x32101d['id'],'UserId':_0x2addb1['user']['id'],'ContactId':_0x95e29a['id']}))[_0xcd75('0x36')](function(_0x4635c9){_0x32101d[_0xcd75('0xcc')][_0xcd75('0xca')]=[];_0x32101d['dataValues'][_0xcd75('0xca')][_0xcd75('0xcd')](_0x4635c9[_0xcd75('0xcc')]);return _0x32101d;});})[_0xcd75('0x36')](respondWithResult(_0x280af7,null))['catch'](handleError(_0x280af7,null));};exports['status']=function(_0x26ce24,_0x456cb8,_0x20b5bf){if(_0x26ce24[_0xcd75('0x58')]['id']){delete _0x26ce24[_0xcd75('0x58')]['id'];}var _0x8c6baf,_0x4c8ad2,_0x59681b;return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x26ce24['params']['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x456cb8,null))['then'](function(_0x27d723){if(_0x27d723){_0x59681b=_0x27d723;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xcd75('0xce'),_0x27d723[_0xcd75('0x3e')],util['inspect'](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));switch(_0x27d723[_0xcd75('0x3e')]){case'skebby':if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0xcf')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')];return db[_0xcd75('0xcb')]['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')]['skebby_dispatch_id']}});}break;case _0xcd75('0xd0'):if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd1')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd2')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd2')];return db[_0xcd75('0xcb')]['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')]['requestid']}});}break;case _0xcd75('0x88'):if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0x89')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd3')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd3')];return db[_0xcd75('0xcb')]['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')]['message_id']}});}break;case _0xcd75('0x8d'):var _0x488893=_0x26ce24['body'][_0xcd75('0x8e')][0x0];if(_0x488893[_0xcd75('0x83')]&&_0x488893[_0xcd75('0x29')][_0xcd75('0xd4')]==='DELIVERED'){_0x4c8ad2=_0x488893[_0xcd75('0x29')]['groupName'];return db[_0xcd75('0xcb')][_0xcd75('0x62')]({'where':{'messageId':_0x488893[_0xcd75('0x83')]}});}break;case _0xcd75('0x92'):if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0x83')]&&_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')];return db[_0xcd75('0xcb')][_0xcd75('0x62')]({'where':{'messageId':_0x26ce24[_0xcd75('0x58')][_0xcd75('0x83')]}});}break;case _0xcd75('0x94'):if(_0x26ce24['body'][0x0]['message']['id']){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][0x0][_0xcd75('0x3e')];return db['SmsMessage'][_0xcd75('0x62')]({'where':{'messageId':_0x26ce24[_0xcd75('0x58')][0x0]['message']['id']}});}break;case'intelepeer':if(_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd5')]&&_0x26ce24['body'][_0xcd75('0x29')]){_0x4c8ad2=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x29')];return db['SmsMessage']['find']({'where':{'messageId':_0x26ce24[_0xcd75('0x58')][_0xcd75('0xd5')]}});}break;}}})[_0xcd75('0x36')](handleEntityNotFound(_0x456cb8,null))[_0xcd75('0x36')](function(_0x5c2a03){if(_0x5c2a03){_0x8c6baf=_0x5c2a03;switch(_0x59681b[_0xcd75('0x3e')]){case'skebby':if(_0x4c8ad2==='DELIVERED'){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger['error'](_0xcd75('0x23'),_0xcd75('0x29'),_0xcd75('0x85'),util['inspect'](_0x26ce24['body'],{'showHidden':![],'depth':null}));}break;case _0xcd75('0xd0'):if(_0x4c8ad2==='1'){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),_0xcd75('0x29'),_0xcd75('0x85'),util['inspect'](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x26ce24[_0xcd75('0x58')]['error_code']&&_0x4c8ad2>=0xc8&&_0x4c8ad2<=0xce){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),'status',_0xcd75('0x88'),util[_0xcd75('0xd6')](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case _0xcd75('0x8d'):var _0x458b5f=_0x26ce24[_0xcd75('0x58')][_0xcd75('0x8e')][0x0];if(_0x458b5f['status'][_0xcd75('0xd4')]===_0xcd75('0xd7')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xcd75('0x29'),_0xcd75('0x8d'),util['inspect'](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c8ad2==_0xcd75('0xd8')||_0x4c8ad2==_0xcd75('0xd9')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),'status',_0xcd75('0x92'),util['inspect'](_0x26ce24['body'],{'showHidden':![],'depth':null}));}break;case _0xcd75('0x94'):if(_0x4c8ad2==_0xcd75('0xda')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),_0xcd75('0x29'),'bandwidth',util[_0xcd75('0xd6')](_0x26ce24[_0xcd75('0x58')],{'showHidden':![],'depth':null}));}break;case _0xcd75('0xdb'):if(_0x4c8ad2===_0xcd75('0xdc')||_0x4c8ad2===_0xcd75('0xdd')){return _0x8c6baf[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),_0xcd75('0x29'),_0xcd75('0xdb'),util[_0xcd75('0xd6')](_0x26ce24['body'],{'showHidden':![],'depth':null}));}break;}return _0x8c6baf;}})['then'](respondWithResult(_0x456cb8,null))[_0xcd75('0x27')](handleError(_0x456cb8,null));};exports[_0xcd75('0xde')]=function(_0x449d6c,_0x3326c6,_0x420737){var _0x1d6aa0,_0x4a5497,_0x7dccec;return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x449d6c[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x3326c6,null))['then'](function(_0x4a0a11){if(_0x4a0a11){_0x7dccec=_0x4a0a11;logger[_0xcd75('0xb5')](_0xcd75('0x23'),'status',_0xcd75('0xce'),_0x4a0a11[_0xcd75('0x3e')],util[_0xcd75('0xd6')](_0x449d6c[_0xcd75('0x41')],{'showHidden':![],'depth':null}));switch(_0x4a0a11[_0xcd75('0x3e')]){case _0xcd75('0x8f'):if(_0x449d6c['query'][_0xcd75('0xdf')]&&_0x449d6c[_0xcd75('0x41')][_0xcd75('0xe0')]){_0x4a5497=_0x449d6c['query'][_0xcd75('0xe0')];return db[_0xcd75('0xcb')][_0xcd75('0x62')]({'where':{'messageId':_0x449d6c['query'][_0xcd75('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x3326c6,null))[_0xcd75('0x36')](function(_0x4c8516){if(_0x4c8516){_0x1d6aa0=_0x4c8516;switch(_0x7dccec[_0xcd75('0x3e')]){case _0xcd75('0x8f'):if(_0x4a5497==='2'||_0x4a5497==='6'){return _0x1d6aa0[_0xcd75('0x60')]({'read':!![]});}else{logger[_0xcd75('0x24')](_0xcd75('0x23'),'status',_0xcd75('0x8f'),util[_0xcd75('0xd6')](_0x449d6c[_0xcd75('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x1d6aa0;}})['then'](respondWithResult(_0x3326c6,null))[_0xcd75('0x27')](handleError(_0x3326c6,null));};exports[_0xcd75('0xe1')]=function(_0x584b98,_0x1fbf30,_0x5c11ea){return db[_0xcd75('0x4f')][_0xcd75('0x62')]({'where':{'id':_0x584b98[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x1fbf30,null))[_0xcd75('0x36')](function(_0x274439){if(_0x274439){return _0x274439[_0xcd75('0xe1')](_0x584b98['body']['ids'],_[_0xcd75('0xa1')](_0x584b98['body'],['ids','id'])||{})[_0xcd75('0xa4')](function(_0x28944f){for(var _0xe5db40=0x0;_0xe5db40<_0x584b98[_0xcd75('0x58')][_0xcd75('0x6c')][_0xcd75('0x68')];_0xe5db40+=0x1){socket[_0xcd75('0xe2')](_0xcd75('0xe3'),{'UserId':_0x584b98[_0xcd75('0x58')][_0xcd75('0x6c')][_0xe5db40],'SmsAccountId':_0x584b98[_0xcd75('0x55')]['id']});}return _0x28944f;});}})[_0xcd75('0x36')](respondWithResult(_0x1fbf30,null))[_0xcd75('0x27')](handleError(_0x1fbf30,null));};exports[_0xcd75('0xe4')]=function(_0x156cef,_0x55226a,_0x3ca078){return db[_0xcd75('0x4f')]['find']({'where':{'id':_0x156cef[_0xcd75('0x55')]['id']}})['then'](handleEntityNotFound(_0x55226a,null))[_0xcd75('0x36')](function(_0xae23b){if(_0xae23b){return _0xae23b['removeAgents'](_0x156cef[_0xcd75('0x41')]['ids'])[_0xcd75('0x36')](function(){if(_[_0xcd75('0xe5')](_0x156cef[_0xcd75('0x41')][_0xcd75('0x6c')])){for(var _0x1c3421=0x0;_0x1c3421<_0x156cef['query'][_0xcd75('0x6c')][_0xcd75('0x68')];_0x1c3421+=0x1){socket[_0xcd75('0xe2')]('userSmsAccount:remove',{'UserId':Number(_0x156cef['query'][_0xcd75('0x6c')][_0x1c3421]),'SmsAccountId':Number(_0x156cef[_0xcd75('0x55')]['id'])});}}else{socket['emit'](_0xcd75('0xe6'),{'UserId':Number(_0x156cef['query'][_0xcd75('0x6c')]),'SmsAccountId':Number(_0x156cef[_0xcd75('0x55')]['id'])});}});}})[_0xcd75('0x36')](respondWithStatusCode(_0x55226a,null))[_0xcd75('0x27')](handleError(_0x55226a,null));};exports[_0xcd75('0xe7')]=function(_0x127757,_0x15d352,_0x524314){var _0x3f3ef7={};var _0x4b371f={};var _0xe2de36;var _0x2fe9a3;return db[_0xcd75('0x4f')][_0xcd75('0x66')]({'where':{'id':_0x127757[_0xcd75('0x55')]['id']}})[_0xcd75('0x36')](handleEntityNotFound(_0x15d352,null))[_0xcd75('0x36')](function(_0x311a6c){if(_0x311a6c){_0xe2de36=_0x311a6c;_0x4b371f[_0xcd75('0x40')]=_[_0xcd75('0x42')](db['User'][_0xcd75('0x67')]);_0x4b371f[_0xcd75('0x41')]=_[_0xcd75('0x42')](_0x127757[_0xcd75('0x41')]);_0x4b371f[_0xcd75('0x43')]=_[_0xcd75('0x56')](_0x4b371f[_0xcd75('0x40')],_0x4b371f[_0xcd75('0x41')]);_0x3f3ef7[_0xcd75('0x44')]=_[_0xcd75('0x56')](_0x4b371f[_0xcd75('0x40')],qs[_0xcd75('0x45')](_0x127757[_0xcd75('0x41')][_0xcd75('0x45')]));_0x3f3ef7[_0xcd75('0x44')]=_0x3f3ef7[_0xcd75('0x44')][_0xcd75('0x68')]?_0x3f3ef7[_0xcd75('0x44')]:_0x4b371f[_0xcd75('0x40')];_0x3f3ef7[_0xcd75('0x47')]=qs[_0xcd75('0x48')](_0x127757[_0xcd75('0x41')]['sort']);_0x3f3ef7[_0xcd75('0x49')]=qs['filters'](_[_0xcd75('0x4a')](_0x127757[_0xcd75('0x41')],_0x4b371f['filters']));if(_0x127757['query']['filter']){_0x3f3ef7[_0xcd75('0x49')]=_[_0xcd75('0x4c')](_0x3f3ef7[_0xcd75('0x49')],{'$or':_[_0xcd75('0x3c')](_0x3f3ef7['attributes'],function(_0x4ef438){var _0x12218f={};_0x12218f[_0x4ef438]={'$like':'%'+_0x127757['query'][_0xcd75('0x4b')]+'%'};return _0x12218f;})});}_0x3f3ef7=_[_0xcd75('0x4c')]({},_0x3f3ef7,_0x127757[_0xcd75('0x4e')]);return _0xe2de36[_0xcd75('0xe7')](_0x3f3ef7);}})[_0xcd75('0x36')](function(_0x21491d){if(_0x21491d){_0x2fe9a3=_0x21491d[_0xcd75('0x68')];if(!_0x127757[_0xcd75('0x41')][_0xcd75('0x69')]('nolimit')){_0x3f3ef7[_0xcd75('0x2f')]=qs[_0xcd75('0x2f')](_0x127757[_0xcd75('0x41')][_0xcd75('0x2f')]);_0x3f3ef7['offset']=qs[_0xcd75('0x2e')](_0x127757[_0xcd75('0x41')][_0xcd75('0x2e')]);}return _0xe2de36['getAgents'](_0x3f3ef7);}})['then'](function(_0x10937e){if(_0x10937e){return _0x10937e?{'count':_0x2fe9a3,'rows':_0x10937e}:null;}})[_0xcd75('0x36')](respondWithResult(_0x15d352,null))[_0xcd75('0x27')](handleError(_0x15d352,null));};
\ No newline at end of file
index e09089b..50bbd81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa349=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x1829e1,_0x59467f){var _0x5547da=function(_0x3b20d1){while(--_0x3b20d1){_0x1829e1['push'](_0x1829e1['shift']());}};_0x5547da(++_0x59467f);}(_0xa349,0x18c));var _0x9a34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa349[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9a34('0x0'));var SmsAccount=require(_0x9a34('0x1'))['db'][_0x9a34('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9a34('0x3')](0x0);var events={'afterCreate':_0x9a34('0x4'),'afterUpdate':'update','afterDestroy':_0x9a34('0x5')};function emitEvent(_0x141a2c){return function(_0x402fc9,_0x4f7f02,_0xb9f5fc){SmsAccountEvents[_0x9a34('0x6')](_0x141a2c+':'+_0x402fc9['id'],_0x402fc9);SmsAccountEvents[_0x9a34('0x6')](_0x141a2c,_0x402fc9);_0xb9f5fc(null);};}for(var e in events){if(events[_0x9a34('0x7')](e)){var event=events[e];SmsAccount[_0x9a34('0x8')](e,emitEvent(event));}}module[_0x9a34('0x9')]=SmsAccountEvents;
\ No newline at end of file
+var _0x2e32=['hasOwnProperty','exports','events','../../mysqldb','SmsAccount','save','update','emit'];(function(_0x2215a4,_0x5bd79e){var _0x11ff69=function(_0x3e2edc){while(--_0x3e2edc){_0x2215a4['push'](_0x2215a4['shift']());}};_0x11ff69(++_0x5bd79e);}(_0x2e32,0x8a));var _0x22e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2e32[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x22e3('0x0'));var SmsAccount=require(_0x22e3('0x1'))['db'][_0x22e3('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x22e3('0x3'),'afterUpdate':_0x22e3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f5cb7){return function(_0x262647,_0x22a87d,_0x1c89aa){SmsAccountEvents[_0x22e3('0x5')](_0x2f5cb7+':'+_0x262647['id'],_0x262647);SmsAccountEvents[_0x22e3('0x5')](_0x2f5cb7,_0x262647);_0x1c89aa(null);};}for(var e in events){if(events[_0x22e3('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x22e3('0x7')]=SmsAccountEvents;
\ No newline at end of file
index b21f0e8..82e9f5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29f5=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','lodash','util'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x29f5,0x169));var _0x529f=function(_0x1ff7c2,_0x3ae717){_0x1ff7c2=_0x1ff7c2-0x0;var _0x203b57=_0x29f5[_0x1ff7c2];return _0x203b57;};'use strict';var _=require(_0x529f('0x0'));var util=require(_0x529f('0x1'));var logger=require(_0x529f('0x2'))('api');var moment=require(_0x529f('0x3'));var BPromise=require(_0x529f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x529f('0x5'));var rimraf=require(_0x529f('0x6'));var config=require(_0x529f('0x7'));var attributes=require(_0x529f('0x8'));module['exports']=function(_0x198569,_0x27b9b1){return _0x198569[_0x529f('0x9')](_0x529f('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf097=['exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ead4e,_0x43a557){var _0x49cc4a=function(_0x13dc5e){while(--_0x13dc5e){_0x3ead4e['push'](_0x3ead4e['shift']());}};_0x49cc4a(++_0x43a557);}(_0xf097,0x66));var _0x7f09=function(_0x44b32b,_0x888499){_0x44b32b=_0x44b32b-0x0;var _0x2a29d7=_0xf097[_0x44b32b];return _0x2a29d7;};'use strict';var _=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var logger=require(_0x7f09('0x2'))(_0x7f09('0x3'));var moment=require(_0x7f09('0x4'));var BPromise=require(_0x7f09('0x5'));var rp=require(_0x7f09('0x6'));var fs=require('fs');var path=require(_0x7f09('0x7'));var rimraf=require(_0x7f09('0x8'));var config=require(_0x7f09('0x9'));var attributes=require('./smsAccount.attributes');module[_0x7f09('0xa')]=function(_0x43a856,_0x4e686a){return _0x43a856[_0x7f09('0xb')](_0x7f09('0xc'),attributes,{'tableName':_0x7f09('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 28d74f2..091f1fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc53=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4bf518,_0x371fc7){var _0xd6e583=function(_0x4e048b){while(--_0x4e048b){_0x4bf518['push'](_0x4bf518['shift']());}};_0xd6e583(++_0x371fc7);}(_0xdc53,0xfd));var _0x3dc5=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xdc53[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x3dc5('0x0'));var util=require(_0x3dc5('0x1'));var moment=require(_0x3dc5('0x2'));var BPromise=require(_0x3dc5('0x3'));var rs=require(_0x3dc5('0x4'));var fs=require('fs');var Redis=require(_0x3dc5('0x5'));var db=require(_0x3dc5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3dc5('0x7'))(_0x3dc5('0x8'));var config=require(_0x3dc5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3dc5('0xa')][_0x3dc5('0xb')]({'port':0x232a});config[_0x3dc5('0xc')]=_['defaults'](config[_0x3dc5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3dc5('0xd'))(new Redis(config['redis']));require(_0x3dc5('0xe'))[_0x3dc5('0xf')](socket);function respondWithRpcPromise(_0x591d2d,_0x132c9c,_0x2ec227){return new BPromise(function(_0x79ee1e,_0x17e118){return client[_0x3dc5('0x10')](_0x591d2d,_0x2ec227)[_0x3dc5('0x11')](function(_0x50bb44){logger[_0x3dc5('0x12')](_0x3dc5('0x13'),_0x132c9c,_0x3dc5('0x14'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x132c9c,_0x3dc5('0x14'),JSON['stringify'](_0x50bb44));if(_0x50bb44[_0x3dc5('0x15')]){if(_0x50bb44[_0x3dc5('0x15')][_0x3dc5('0x16')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x132c9c,_0x50bb44[_0x3dc5('0x15')][_0x3dc5('0x17')]);return _0x17e118(_0x50bb44[_0x3dc5('0x15')][_0x3dc5('0x17')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x132c9c,_0x50bb44[_0x3dc5('0x15')]['message']);return _0x79ee1e(_0x50bb44['error']['message']);}else{logger[_0x3dc5('0x12')](_0x3dc5('0x13'),_0x132c9c,_0x3dc5('0x14'));_0x79ee1e(_0x50bb44[_0x3dc5('0x18')][_0x3dc5('0x17')]);}})[_0x3dc5('0x19')](function(_0x5b59d8){logger[_0x3dc5('0x15')](_0x3dc5('0x13'),_0x132c9c,_0x5b59d8);_0x17e118(_0x5b59d8);});});}exports['ShowSmsAccount']=function(_0x5327db){var _0x48b149=this;return new Promise(function(_0x9e53a9,_0x3a33ee){return db[_0x3dc5('0x1a')][_0x3dc5('0x1b')]({'raw':_0x5327db[_0x3dc5('0x1c')]?_0x5327db[_0x3dc5('0x1c')][_0x3dc5('0x1d')]===undefined?!![]:![]:!![],'where':_0x5327db[_0x3dc5('0x1c')]?_0x5327db[_0x3dc5('0x1c')][_0x3dc5('0x1e')]||null:null,'attributes':_0x5327db[_0x3dc5('0x1c')]?_0x5327db['options'][_0x3dc5('0x1f')]||null:null,'include':_0x5327db[_0x3dc5('0x1c')]?_0x5327db[_0x3dc5('0x1c')][_0x3dc5('0x20')]?_[_0x3dc5('0x21')](_0x5327db[_0x3dc5('0x1c')][_0x3dc5('0x20')],function(_0x48944d){return{'model':db[_0x48944d['model']],'as':_0x48944d['as'],'attributes':_0x48944d[_0x3dc5('0x1f')],'include':_0x48944d['include']?_[_0x3dc5('0x21')](_0x48944d[_0x3dc5('0x20')],function(_0x19fa7d){return{'model':db[_0x19fa7d[_0x3dc5('0x22')]],'as':_0x19fa7d['as'],'attributes':_0x19fa7d[_0x3dc5('0x1f')],'include':_0x19fa7d[_0x3dc5('0x20')]?_['map'](_0x19fa7d[_0x3dc5('0x20')],function(_0x179eb1){return{'model':db[_0x179eb1['model']],'as':_0x179eb1['as'],'attributes':_0x179eb1[_0x3dc5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b437f){logger[_0x3dc5('0x12')](_0x3dc5('0x23'),_0x5327db);logger['debug']('ShowSmsAccount',_0x5327db,JSON[_0x3dc5('0x24')](_0x5b437f));_0x9e53a9(_0x5b437f);})['catch'](function(_0x15cb3e){logger[_0x3dc5('0x15')](_0x3dc5('0x23'),_0x15cb3e[_0x3dc5('0x17')],_0x5327db);_0x3a33ee(_0x48b149['error'](0x1f4,_0x15cb3e['message']));});});};
\ No newline at end of file
+var _0xa944=['error','code','message','result','catch','ShowSmsAccount','find','options','raw','attributes','include','model','map','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xa944,0x103));var _0x4a94=function(_0x210677,_0x4876b7){_0x210677=_0x210677-0x0;var _0x48d4a5=_0xa944[_0x210677];return _0x48d4a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a94('0x0'));var BPromise=require(_0x4a94('0x1'));var rs=require(_0x4a94('0x2'));var fs=require('fs');var Redis=require(_0x4a94('0x3'));var db=require(_0x4a94('0x4'))['db'];var utils=require(_0x4a94('0x5'));var logger=require('../../config/logger')(_0x4a94('0x6'));var config=require(_0x4a94('0x7'));var jayson=require(_0x4a94('0x8'));var client=jayson[_0x4a94('0x9')][_0x4a94('0xa')]({'port':0x232a});config['redis']=_[_0x4a94('0xb')](config[_0x4a94('0xc')],{'host':_0x4a94('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a94('0xc')]));require(_0x4a94('0xe'))['register'](socket);function respondWithRpcPromise(_0x7d9381,_0x467c2f,_0x3e782e){return new BPromise(function(_0x31f8b0,_0x50f89c){return client['request'](_0x7d9381,_0x3e782e)[_0x4a94('0xf')](function(_0x1649ff){logger[_0x4a94('0x10')](_0x4a94('0x11'),_0x467c2f,_0x4a94('0x12'));logger[_0x4a94('0x13')](_0x4a94('0x14'),_0x467c2f,'request\x20sent',JSON['stringify'](_0x1649ff));if(_0x1649ff['error']){if(_0x1649ff[_0x4a94('0x15')][_0x4a94('0x16')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x467c2f,_0x1649ff[_0x4a94('0x15')]['message']);return _0x50f89c(_0x1649ff[_0x4a94('0x15')][_0x4a94('0x17')]);}logger[_0x4a94('0x15')](_0x4a94('0x11'),_0x467c2f,_0x1649ff[_0x4a94('0x15')][_0x4a94('0x17')]);return _0x31f8b0(_0x1649ff[_0x4a94('0x15')]['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x467c2f,_0x4a94('0x12'));_0x31f8b0(_0x1649ff[_0x4a94('0x18')][_0x4a94('0x17')]);}})[_0x4a94('0x19')](function(_0x432232){logger[_0x4a94('0x15')]('SmsAccount,\x20%s,\x20%s',_0x467c2f,_0x432232);_0x50f89c(_0x432232);});});}exports[_0x4a94('0x1a')]=function(_0x45c1e7){var _0xa92739=this;return new Promise(function(_0x29e63a,_0x567fae){return db['SmsAccount'][_0x4a94('0x1b')]({'raw':_0x45c1e7[_0x4a94('0x1c')]?_0x45c1e7[_0x4a94('0x1c')][_0x4a94('0x1d')]===undefined?!![]:![]:!![],'where':_0x45c1e7[_0x4a94('0x1c')]?_0x45c1e7['options']['where']||null:null,'attributes':_0x45c1e7['options']?_0x45c1e7[_0x4a94('0x1c')][_0x4a94('0x1e')]||null:null,'include':_0x45c1e7[_0x4a94('0x1c')]?_0x45c1e7[_0x4a94('0x1c')][_0x4a94('0x1f')]?_['map'](_0x45c1e7[_0x4a94('0x1c')]['include'],function(_0x2f01c9){return{'model':db[_0x2f01c9[_0x4a94('0x20')]],'as':_0x2f01c9['as'],'attributes':_0x2f01c9[_0x4a94('0x1e')],'include':_0x2f01c9[_0x4a94('0x1f')]?_['map'](_0x2f01c9[_0x4a94('0x1f')],function(_0x4a2197){return{'model':db[_0x4a2197[_0x4a94('0x20')]],'as':_0x4a2197['as'],'attributes':_0x4a2197['attributes'],'include':_0x4a2197[_0x4a94('0x1f')]?_[_0x4a94('0x21')](_0x4a2197['include'],function(_0x4133ae){return{'model':db[_0x4133ae[_0x4a94('0x20')]],'as':_0x4133ae['as'],'attributes':_0x4133ae['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a94('0xf')](function(_0x3e7f83){logger[_0x4a94('0x10')](_0x4a94('0x1a'),_0x45c1e7);logger['debug'](_0x4a94('0x1a'),_0x45c1e7,JSON[_0x4a94('0x22')](_0x3e7f83));_0x29e63a(_0x3e7f83);})[_0x4a94('0x19')](function(_0x4f15d1){logger[_0x4a94('0x15')]('ShowSmsAccount',_0x4f15d1['message'],_0x45c1e7);_0x567fae(_0xa92739[_0x4a94('0x15')](0x1f4,_0x4f15d1[_0x4a94('0x17')]));});});};
\ No newline at end of file
index f144aa0..09d97f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 9b9440e..705f2d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x44095,_0x2f5c5b){var _0x596fa7=function(_0x1fc8b7){while(--_0x1fc8b7){_0x44095['push'](_0x44095['shift']());}};_0x596fa7(++_0x2f5c5b);}(_0x008c,0x188));var _0xc008=function(_0xc14e9b,_0x5c3047){_0xc14e9b=_0xc14e9b-0x0;var _0x48f298=_0x008c[_0xc14e9b];return _0x48f298;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router;
\ No newline at end of file
+var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x5da2c5,_0x6306e){var _0x2c0749=function(_0x5cf155){while(--_0x5cf155){_0x5da2c5['push'](_0x5da2c5['shift']());}};_0x2c0749(++_0x6306e);}(_0x3e74,0x175));var _0x43e7=function(_0xdf5667,_0x46590e){_0xdf5667=_0xdf5667-0x0;var _0x289d4e=_0x3e74[_0xdf5667];return _0x289d4e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router;
\ No newline at end of file
index 01f620a..dd7a90a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4135=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0xcfcbaa,_0x369d95){var _0x157ed0=function(_0x3a0b62){while(--_0x3a0b62){_0xcfcbaa['push'](_0xcfcbaa['shift']());}};_0x157ed0(++_0x369d95);}(_0x4135,0x1ae));var _0x5413=function(_0x1059a0,_0x2e8857){_0x1059a0=_0x1059a0-0x0;var _0x38c2f7=_0x4135[_0x1059a0];return _0x38c2f7;};'use strict';var Sequelize=require('sequelize');module[_0x5413('0x0')]={'priority':{'type':Sequelize[_0x5413('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5413('0x2')],'allowNull':![],'defaultValue':_0x5413('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5413('0x2')]},'interval':{'type':Sequelize[_0x5413('0x2')],'defaultValue':_0x5413('0x4')}};
\ No newline at end of file
+var _0x415b=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x53c2fb,_0x37d8b0){var _0x321bf9=function(_0xdf356){while(--_0xdf356){_0x53c2fb['push'](_0x53c2fb['shift']());}};_0x321bf9(++_0x37d8b0);}(_0x415b,0xfb));var _0xb415=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x415b[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xb415('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb415('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb415('0x2')],'allowNull':![],'defaultValue':_0xb415('0x3')},'appdata':{'type':Sequelize[_0xb415('0x4')]()},'description':{'type':Sequelize[_0xb415('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb415('0x5')}};
\ No newline at end of file
index 0c286fc..2457f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee1c=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','keys','query','intersection'];(function(_0x188165,_0x4de657){var _0x2ab64a=function(_0x2ac7d2){while(--_0x2ac7d2){_0x188165['push'](_0x188165['shift']());}};_0x2ab64a(++_0x4de657);}(_0xee1c,0xe3));var _0xcee1=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0xee1c[_0x75267d];return _0x21ccec;};'use strict';var emlformat=require(_0xcee1('0x0'));var rimraf=require(_0xcee1('0x1'));var zipdir=require(_0xcee1('0x2'));var jsonpatch=require(_0xcee1('0x3'));var rp=require(_0xcee1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcee1('0x5'));var path=require(_0xcee1('0x6'));var sox=require('sox');var csv=require(_0xcee1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcee1('0x8'));var _=require('lodash');var squel=require(_0xcee1('0x9'));var crypto=require(_0xcee1('0xa'));var jsforce=require(_0xcee1('0xb'));var deskjs=require(_0xcee1('0xc'));var toCsv=require(_0xcee1('0x7'));var querystring=require(_0xcee1('0xd'));var Papa=require('papaparse');var Redis=require(_0xcee1('0xe'));var authService=require(_0xcee1('0xf'));var qs=require(_0xcee1('0x10'));var as=require(_0xcee1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcee1('0x12'));var utils=require(_0xcee1('0x13'));var config=require(_0xcee1('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x209ca5,_0x592866){_0x592866=_0x592866||0xcc;return function(_0x1094bc){if(_0x1094bc){return _0x209ca5[_0xcee1('0x15')](_0x592866);}return _0x209ca5[_0xcee1('0x16')](_0x592866)[_0xcee1('0x17')]();};}function respondWithResult(_0x56f783,_0x3572ce){_0x3572ce=_0x3572ce||0xc8;return function(_0x56a000){if(_0x56a000){return _0x56f783[_0xcee1('0x16')](_0x3572ce)['json'](_0x56a000);}};}function respondWithFilteredResult(_0x4c0ad2,_0x2af29e){return function(_0xc7af2d){if(_0xc7af2d){var _0x3ff763=typeof _0x2af29e[_0xcee1('0x18')]===_0xcee1('0x19')&&typeof _0x2af29e[_0xcee1('0x1a')]===_0xcee1('0x19');var _0x34355b=_0xc7af2d[_0xcee1('0x1b')];var _0x2b1a4e=_0x3ff763?0x0:_0x2af29e[_0xcee1('0x18')];var _0x4e20e6=_0x3ff763?_0xc7af2d['count']:_0x2af29e['offset']+_0x2af29e[_0xcee1('0x1a')];var _0x28aa28;if(_0x4e20e6>=_0x34355b){_0x4e20e6=_0x34355b;_0x28aa28=0xc8;}else{_0x28aa28=0xce;}_0x4c0ad2[_0xcee1('0x16')](_0x28aa28);return _0x4c0ad2['set'](_0xcee1('0x1c'),_0x2b1a4e+'-'+_0x4e20e6+'/'+_0x34355b)[_0xcee1('0x1d')](_0xc7af2d);}return null;};}function patchUpdates(_0x4271d){return function(_0x1f1f41){try{jsonpatch[_0xcee1('0x1e')](_0x1f1f41,_0x4271d,!![]);}catch(_0x4367ec){return BPromise['reject'](_0x4367ec);}return _0x1f1f41[_0xcee1('0x1f')]();};}function saveUpdates(_0xe3276b,_0x4b0c4c){return function(_0x12f040){if(_0x12f040){return _0x12f040[_0xcee1('0x20')](_0xe3276b)[_0xcee1('0x21')](function(_0x20a9d1){return _0x20a9d1;});}return null;};}function removeEntity(_0x15b4d2,_0x495bea){return function(_0x1fc2fd){if(_0x1fc2fd){return _0x1fc2fd[_0xcee1('0x22')]()[_0xcee1('0x21')](function(){_0x15b4d2[_0xcee1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250a8e,_0x2f7b08){return function(_0x5cb336){if(!_0x5cb336){_0x250a8e['sendStatus'](0x194);}return _0x5cb336;};}function handleError(_0x571fbf,_0x51e9cc){_0x51e9cc=_0x51e9cc||0x1f4;return function(_0x24b2f4){logger[_0xcee1('0x23')](_0x24b2f4['stack']);if(_0x24b2f4[_0xcee1('0x24')]){delete _0x24b2f4['name'];}_0x571fbf[_0xcee1('0x16')](_0x51e9cc)[_0xcee1('0x25')](_0x24b2f4);};}exports[_0xcee1('0x26')]=function(_0x5b3098,_0x573451){var _0x57f865={},_0xdc47e8={},_0x4ccc31={'count':0x0,'rows':[]};var _0x3b9a3e=_[_0xcee1('0x27')](db[_0xcee1('0x28')][_0xcee1('0x29')],function(_0x24ae43){return{'name':_0x24ae43[_0xcee1('0x2a')],'type':_0x24ae43[_0xcee1('0x2b')][_0xcee1('0x2c')]};});_0xdc47e8[_0xcee1('0x2d')]=_[_0xcee1('0x27')](_0x3b9a3e,_0xcee1('0x24'));_0xdc47e8['query']=_[_0xcee1('0x2e')](_0x5b3098[_0xcee1('0x2f')]);_0xdc47e8['filters']=_[_0xcee1('0x30')](_0xdc47e8[_0xcee1('0x2d')],_0xdc47e8[_0xcee1('0x2f')]);_0x57f865[_0xcee1('0x31')]=_[_0xcee1('0x30')](_0xdc47e8['model'],qs[_0xcee1('0x32')](_0x5b3098[_0xcee1('0x2f')][_0xcee1('0x32')]));_0x57f865['attributes']=_0x57f865[_0xcee1('0x31')][_0xcee1('0x33')]?_0x57f865[_0xcee1('0x31')]:_0xdc47e8['model'];if(!_0x5b3098[_0xcee1('0x2f')][_0xcee1('0x34')](_0xcee1('0x35'))){_0x57f865['limit']=qs['limit'](_0x5b3098[_0xcee1('0x2f')][_0xcee1('0x1a')]);_0x57f865[_0xcee1('0x18')]=qs[_0xcee1('0x18')](_0x5b3098[_0xcee1('0x2f')][_0xcee1('0x18')]);}_0x57f865[_0xcee1('0x36')]=qs[_0xcee1('0x37')](_0x5b3098[_0xcee1('0x2f')][_0xcee1('0x37')]);_0x57f865[_0xcee1('0x38')]=qs[_0xcee1('0x39')](_['pick'](_0x5b3098[_0xcee1('0x2f')],_0xdc47e8[_0xcee1('0x39')]),_0x3b9a3e);if(_0x5b3098['query'][_0xcee1('0x3a')]){_0x57f865['where']=_[_0xcee1('0x3b')](_0x57f865[_0xcee1('0x38')],{'$or':_[_0xcee1('0x27')](_0x3b9a3e,function(_0x5d9402){if(_0x5d9402[_0xcee1('0x2b')]!==_0xcee1('0x3c')){var _0x3db347={};_0x3db347[_0x5d9402[_0xcee1('0x24')]]={'$like':'%'+_0x5b3098['query'][_0xcee1('0x3a')]+'%'};return _0x3db347;}})});}_0x57f865=_['merge']({},_0x57f865,_0x5b3098['options']);var _0x209ebf={'where':_0x57f865[_0xcee1('0x38')]};return db[_0xcee1('0x28')][_0xcee1('0x1b')](_0x209ebf)['then'](function(_0x1563b2){_0x4ccc31['count']=_0x1563b2;if(_0x5b3098['query'][_0xcee1('0x3d')]){_0x57f865[_0xcee1('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0xcee1('0x3f')](_0x57f865);})[_0xcee1('0x21')](function(_0x3a2da1){_0x4ccc31['rows']=_0x3a2da1;return _0x4ccc31;})[_0xcee1('0x21')](respondWithFilteredResult(_0x573451,_0x57f865))[_0xcee1('0x40')](handleError(_0x573451,null));};exports['show']=function(_0x5f4d0c,_0x452d42){var _0x4e34ed={'raw':!![],'where':{'id':_0x5f4d0c[_0xcee1('0x41')]['id']}},_0x313760={};_0x313760[_0xcee1('0x2d')]=_[_0xcee1('0x2e')](db[_0xcee1('0x28')][_0xcee1('0x29')]);_0x313760['query']=_['keys'](_0x5f4d0c[_0xcee1('0x2f')]);_0x313760[_0xcee1('0x39')]=_[_0xcee1('0x30')](_0x313760[_0xcee1('0x2d')],_0x313760[_0xcee1('0x2f')]);_0x4e34ed[_0xcee1('0x31')]=_[_0xcee1('0x30')](_0x313760[_0xcee1('0x2d')],qs[_0xcee1('0x32')](_0x5f4d0c['query'][_0xcee1('0x32')]));_0x4e34ed[_0xcee1('0x31')]=_0x4e34ed[_0xcee1('0x31')][_0xcee1('0x33')]?_0x4e34ed[_0xcee1('0x31')]:_0x313760[_0xcee1('0x2d')];if(_0x5f4d0c['query'][_0xcee1('0x3d')]){_0x4e34ed[_0xcee1('0x3e')]=[{'all':!![]}];}_0x4e34ed=_[_0xcee1('0x3b')]({},_0x4e34ed,_0x5f4d0c['options']);return db['SmsApplication']['find'](_0x4e34ed)[_0xcee1('0x21')](handleEntityNotFound(_0x452d42,null))[_0xcee1('0x21')](respondWithResult(_0x452d42,null))['catch'](handleError(_0x452d42,null));};exports[_0xcee1('0x42')]=function(_0x112a79,_0x3926f5){return db['SmsApplication'][_0xcee1('0x42')](_0x112a79[_0xcee1('0x43')],{})[_0xcee1('0x21')](respondWithResult(_0x3926f5,0xc9))[_0xcee1('0x40')](handleError(_0x3926f5,null));};exports[_0xcee1('0x20')]=function(_0x4ef9f9,_0x18e6de){if(_0x4ef9f9[_0xcee1('0x43')]['id']){delete _0x4ef9f9[_0xcee1('0x43')]['id'];}return db[_0xcee1('0x28')]['find']({'where':{'id':_0x4ef9f9['params']['id']}})['then'](handleEntityNotFound(_0x18e6de,null))[_0xcee1('0x21')](saveUpdates(_0x4ef9f9[_0xcee1('0x43')],null))['then'](respondWithResult(_0x18e6de,null))['catch'](handleError(_0x18e6de,null));};exports[_0xcee1('0x22')]=function(_0xf7cd14,_0x43164f){return db['SmsApplication'][_0xcee1('0x44')]({'where':{'id':_0xf7cd14['params']['id']}})[_0xcee1('0x21')](handleEntityNotFound(_0x43164f,null))[_0xcee1('0x21')](removeEntity(_0x43164f,null))[_0xcee1('0x40')](handleError(_0x43164f,null));};
\ No newline at end of file
+var _0x0260=['reject','save','update','then','destroy','sendStatus','error','name','send','index','map','SmsApplication','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','keys','include','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0x0260,0x18a));var _0x0026=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x0260[_0x3e44fa];return _0x2a0aba;};'use strict';var emlformat=require(_0x0026('0x0'));var rimraf=require(_0x0026('0x1'));var zipdir=require(_0x0026('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0026('0x3'));var moment=require(_0x0026('0x4'));var BPromise=require(_0x0026('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0026('0x6'));var sox=require('sox');var csv=require(_0x0026('0x7'));var ejs=require(_0x0026('0x8'));var fs=require('fs');var fs_extra=require(_0x0026('0x9'));var _=require(_0x0026('0xa'));var squel=require(_0x0026('0xb'));var crypto=require(_0x0026('0xc'));var jsforce=require(_0x0026('0xd'));var deskjs=require(_0x0026('0xe'));var toCsv=require(_0x0026('0x7'));var querystring=require('querystring');var Papa=require(_0x0026('0xf'));var Redis=require('ioredis');var authService=require(_0x0026('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0026('0x11'));var hardwareService=require(_0x0026('0x12'));var logger=require('../../config/logger')(_0x0026('0x13'));var utils=require('../../config/utils');var config=require(_0x0026('0x14'));var licenseUtil=require(_0x0026('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2d88,_0x2174e3){_0x2174e3=_0x2174e3||0xcc;return function(_0x47ea4e){if(_0x47ea4e){return _0x2e2d88['sendStatus'](_0x2174e3);}return _0x2e2d88[_0x0026('0x16')](_0x2174e3)[_0x0026('0x17')]();};}function respondWithResult(_0x389a85,_0xb9a50a){_0xb9a50a=_0xb9a50a||0xc8;return function(_0x3150f9){if(_0x3150f9){return _0x389a85[_0x0026('0x16')](_0xb9a50a)[_0x0026('0x18')](_0x3150f9);}};}function respondWithFilteredResult(_0x2a7a05,_0x31bd50){return function(_0x594e34){if(_0x594e34){var _0x2edd86=typeof _0x31bd50[_0x0026('0x19')]===_0x0026('0x1a')&&typeof _0x31bd50[_0x0026('0x1b')]===_0x0026('0x1a');var _0x3aa97a=_0x594e34[_0x0026('0x1c')];var _0x8a452b=_0x2edd86?0x0:_0x31bd50[_0x0026('0x19')];var _0x1a35cf=_0x2edd86?_0x594e34['count']:_0x31bd50[_0x0026('0x19')]+_0x31bd50[_0x0026('0x1b')];var _0x53ea66;if(_0x1a35cf>=_0x3aa97a){_0x1a35cf=_0x3aa97a;_0x53ea66=0xc8;}else{_0x53ea66=0xce;}_0x2a7a05[_0x0026('0x16')](_0x53ea66);return _0x2a7a05[_0x0026('0x1d')](_0x0026('0x1e'),_0x8a452b+'-'+_0x1a35cf+'/'+_0x3aa97a)['json'](_0x594e34);}return null;};}function patchUpdates(_0x15077b){return function(_0x279af0){try{jsonpatch[_0x0026('0x1f')](_0x279af0,_0x15077b,!![]);}catch(_0x8bee5e){return BPromise[_0x0026('0x20')](_0x8bee5e);}return _0x279af0[_0x0026('0x21')]();};}function saveUpdates(_0x4550e9,_0x228e49){return function(_0x124f7e){if(_0x124f7e){return _0x124f7e[_0x0026('0x22')](_0x4550e9)[_0x0026('0x23')](function(_0x1a3971){return _0x1a3971;});}return null;};}function removeEntity(_0x5545c,_0x5425f1){return function(_0x835b94){if(_0x835b94){return _0x835b94[_0x0026('0x24')]()[_0x0026('0x23')](function(){_0x5545c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ea7a3,_0x579032){return function(_0x463ad2){if(!_0x463ad2){_0x1ea7a3[_0x0026('0x25')](0x194);}return _0x463ad2;};}function handleError(_0x7ef299,_0x33871a){_0x33871a=_0x33871a||0x1f4;return function(_0x1e84cd){logger[_0x0026('0x26')](_0x1e84cd['stack']);if(_0x1e84cd[_0x0026('0x27')]){delete _0x1e84cd[_0x0026('0x27')];}_0x7ef299[_0x0026('0x16')](_0x33871a)[_0x0026('0x28')](_0x1e84cd);};}exports[_0x0026('0x29')]=function(_0x96033c,_0x4c37d2){var _0x260385={},_0x1924cd={},_0x166d4c={'count':0x0,'rows':[]};var _0x21d4a1=_[_0x0026('0x2a')](db[_0x0026('0x2b')][_0x0026('0x2c')],function(_0x2dbd51){return{'name':_0x2dbd51['fieldName'],'type':_0x2dbd51[_0x0026('0x2d')]['key']};});_0x1924cd[_0x0026('0x2e')]=_[_0x0026('0x2a')](_0x21d4a1,'name');_0x1924cd[_0x0026('0x2f')]=_['keys'](_0x96033c[_0x0026('0x2f')]);_0x1924cd[_0x0026('0x30')]=_[_0x0026('0x31')](_0x1924cd[_0x0026('0x2e')],_0x1924cd['query']);_0x260385['attributes']=_[_0x0026('0x31')](_0x1924cd['model'],qs[_0x0026('0x32')](_0x96033c[_0x0026('0x2f')][_0x0026('0x32')]));_0x260385['attributes']=_0x260385[_0x0026('0x33')][_0x0026('0x34')]?_0x260385[_0x0026('0x33')]:_0x1924cd['model'];if(!_0x96033c[_0x0026('0x2f')][_0x0026('0x35')](_0x0026('0x36'))){_0x260385[_0x0026('0x1b')]=qs[_0x0026('0x1b')](_0x96033c[_0x0026('0x2f')][_0x0026('0x1b')]);_0x260385[_0x0026('0x19')]=qs[_0x0026('0x19')](_0x96033c[_0x0026('0x2f')][_0x0026('0x19')]);}_0x260385[_0x0026('0x37')]=qs[_0x0026('0x38')](_0x96033c[_0x0026('0x2f')]['sort']);_0x260385[_0x0026('0x39')]=qs['filters'](_[_0x0026('0x3a')](_0x96033c['query'],_0x1924cd['filters']),_0x21d4a1);if(_0x96033c['query'][_0x0026('0x3b')]){_0x260385[_0x0026('0x39')]=_[_0x0026('0x3c')](_0x260385[_0x0026('0x39')],{'$or':_[_0x0026('0x2a')](_0x21d4a1,function(_0x5ada6c){if(_0x5ada6c[_0x0026('0x2d')]!==_0x0026('0x3d')){var _0x25a480={};_0x25a480[_0x5ada6c[_0x0026('0x27')]]={'$like':'%'+_0x96033c[_0x0026('0x2f')][_0x0026('0x3b')]+'%'};return _0x25a480;}})});}_0x260385=_[_0x0026('0x3c')]({},_0x260385,_0x96033c[_0x0026('0x3e')]);var _0x250385={'where':_0x260385[_0x0026('0x39')]};return db[_0x0026('0x2b')]['count'](_0x250385)['then'](function(_0x969d2){_0x166d4c[_0x0026('0x1c')]=_0x969d2;if(_0x96033c[_0x0026('0x2f')]['includeAll']){_0x260385['include']=[{'all':!![]}];}return db[_0x0026('0x2b')][_0x0026('0x3f')](_0x260385);})[_0x0026('0x23')](function(_0x175deb){_0x166d4c[_0x0026('0x40')]=_0x175deb;return _0x166d4c;})[_0x0026('0x23')](respondWithFilteredResult(_0x4c37d2,_0x260385))[_0x0026('0x41')](handleError(_0x4c37d2,null));};exports['show']=function(_0x364df2,_0x33b519){var _0x1969c8={'raw':!![],'where':{'id':_0x364df2[_0x0026('0x42')]['id']}},_0x26e1e4={};_0x26e1e4[_0x0026('0x2e')]=_[_0x0026('0x43')](db[_0x0026('0x2b')][_0x0026('0x2c')]);_0x26e1e4['query']=_[_0x0026('0x43')](_0x364df2[_0x0026('0x2f')]);_0x26e1e4['filters']=_[_0x0026('0x31')](_0x26e1e4[_0x0026('0x2e')],_0x26e1e4['query']);_0x1969c8[_0x0026('0x33')]=_[_0x0026('0x31')](_0x26e1e4['model'],qs['fields'](_0x364df2[_0x0026('0x2f')]['fields']));_0x1969c8[_0x0026('0x33')]=_0x1969c8[_0x0026('0x33')][_0x0026('0x34')]?_0x1969c8[_0x0026('0x33')]:_0x26e1e4[_0x0026('0x2e')];if(_0x364df2['query']['includeAll']){_0x1969c8[_0x0026('0x44')]=[{'all':!![]}];}_0x1969c8=_[_0x0026('0x3c')]({},_0x1969c8,_0x364df2['options']);return db['SmsApplication'][_0x0026('0x45')](_0x1969c8)[_0x0026('0x23')](handleEntityNotFound(_0x33b519,null))[_0x0026('0x23')](respondWithResult(_0x33b519,null))['catch'](handleError(_0x33b519,null));};exports['create']=function(_0x3bd586,_0x70d8d5){return db[_0x0026('0x2b')]['create'](_0x3bd586[_0x0026('0x46')],{})[_0x0026('0x23')](respondWithResult(_0x70d8d5,0xc9))[_0x0026('0x41')](handleError(_0x70d8d5,null));};exports[_0x0026('0x22')]=function(_0x267c76,_0x12c162){if(_0x267c76[_0x0026('0x46')]['id']){delete _0x267c76[_0x0026('0x46')]['id'];}return db['SmsApplication'][_0x0026('0x45')]({'where':{'id':_0x267c76[_0x0026('0x42')]['id']}})[_0x0026('0x23')](handleEntityNotFound(_0x12c162,null))[_0x0026('0x23')](saveUpdates(_0x267c76[_0x0026('0x46')],null))[_0x0026('0x23')](respondWithResult(_0x12c162,null))[_0x0026('0x41')](handleError(_0x12c162,null));};exports[_0x0026('0x24')]=function(_0x1a02b0,_0x3728af){return db['SmsApplication'][_0x0026('0x45')]({'where':{'id':_0x1a02b0[_0x0026('0x42')]['id']}})[_0x0026('0x23')](handleEntityNotFound(_0x3728af,null))[_0x0026('0x23')](removeEntity(_0x3728af,null))['catch'](handleError(_0x3728af,null));};
\ No newline at end of file
index 1405875..2122cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca41=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash'];(function(_0x21e93e,_0x378c55){var _0x13a716=function(_0x1daeea){while(--_0x1daeea){_0x21e93e['push'](_0x21e93e['shift']());}};_0x13a716(++_0x378c55);}(_0xca41,0xb5));var _0x1ca4=function(_0x387e68,_0x22ef3c){_0x387e68=_0x387e68-0x0;var _0x254381=_0xca41[_0x387e68];return _0x254381;};'use strict';var _=require(_0x1ca4('0x0'));var util=require(_0x1ca4('0x1'));var logger=require(_0x1ca4('0x2'))(_0x1ca4('0x3'));var moment=require(_0x1ca4('0x4'));var BPromise=require(_0x1ca4('0x5'));var rp=require(_0x1ca4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ca4('0x7'));var config=require(_0x1ca4('0x8'));var attributes=require(_0x1ca4('0x9'));module['exports']=function(_0x2ad609,_0x5d5b71){return _0x2ad609[_0x1ca4('0xa')](_0x1ca4('0xb'),attributes,{'tableName':_0x1ca4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1ca4('0xd')});};
\ No newline at end of file
+var _0x5732=['define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','exports'];(function(_0x1663f7,_0x17ef75){var _0x283506=function(_0x59b381){while(--_0x59b381){_0x1663f7['push'](_0x1663f7['shift']());}};_0x283506(++_0x17ef75);}(_0x5732,0xfb));var _0x2573=function(_0x4615f9,_0x507e3c){_0x4615f9=_0x4615f9-0x0;var _0x4b4781=_0x5732[_0x4615f9];return _0x4b4781;};'use strict';var _=require(_0x2573('0x0'));var util=require(_0x2573('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2573('0x2'));var BPromise=require(_0x2573('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2573('0x4'));var rimraf=require(_0x2573('0x5'));var config=require(_0x2573('0x6'));var attributes=require(_0x2573('0x7'));module[_0x2573('0x8')]=function(_0x2064cc,_0xcafe30){return _0x2064cc[_0x2573('0x9')](_0x2573('0xa'),attributes,{'tableName':_0x2573('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2573('0xc')});};
\ No newline at end of file
index 32a98bb..2a563f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa701=['rpc','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','ioredis','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa701,0xd4));var _0x1a70=function(_0x5505d6,_0x14de72){_0x5505d6=_0x5505d6-0x0;var _0x4fe345=_0xa701[_0x5505d6];return _0x4fe345;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var moment=require(_0x1a70('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a70('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1a70('0x3'))(_0x1a70('0x4'));var config=require(_0x1a70('0x5'));var jayson=require(_0x1a70('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c700b,_0x191a56,_0x1e5432){return new BPromise(function(_0x85bfd0,_0x1dd89b){return client[_0x1a70('0x7')](_0x1c700b,_0x1e5432)[_0x1a70('0x8')](function(_0x55b5e2){logger[_0x1a70('0x9')](_0x1a70('0xa'),_0x191a56,_0x1a70('0xb'));logger[_0x1a70('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x191a56,_0x1a70('0xb'),JSON[_0x1a70('0xd')](_0x55b5e2));if(_0x55b5e2[_0x1a70('0xe')]){if(_0x55b5e2['error']['code']===0x1f4){logger[_0x1a70('0xe')]('SmsApplication,\x20%s,\x20%s',_0x191a56,_0x55b5e2[_0x1a70('0xe')]['message']);return _0x1dd89b(_0x55b5e2[_0x1a70('0xe')]['message']);}logger[_0x1a70('0xe')]('SmsApplication,\x20%s,\x20%s',_0x191a56,_0x55b5e2[_0x1a70('0xe')][_0x1a70('0xf')]);return _0x85bfd0(_0x55b5e2[_0x1a70('0xe')][_0x1a70('0xf')]);}else{logger[_0x1a70('0x9')]('SmsApplication,\x20%s,\x20%s',_0x191a56,'request\x20sent');_0x85bfd0(_0x55b5e2[_0x1a70('0x10')]['message']);}})[_0x1a70('0x11')](function(_0x3d8745){logger['error'](_0x1a70('0xa'),_0x191a56,_0x3d8745);_0x1dd89b(_0x3d8745);});});}
\ No newline at end of file
+var _0xa3db=['client','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsApplication,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xa3db,0x10c));var _0xba3d=function(_0x442ccd,_0x415d61){_0x442ccd=_0x442ccd-0x0;var _0x1a2c10=_0xa3db[_0x442ccd];return _0x1a2c10;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var moment=require(_0xba3d('0x2'));var BPromise=require(_0xba3d('0x3'));var rs=require(_0xba3d('0x4'));var fs=require('fs');var Redis=require(_0xba3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba3d('0x6'))('rpc');var config=require(_0xba3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3d('0x8')][_0xba3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477583,_0x1bacd7,_0x1bd181){return new BPromise(function(_0x426868,_0x3b69e9){return client[_0xba3d('0xa')](_0x477583,_0x1bd181)[_0xba3d('0xb')](function(_0x102fe6){logger[_0xba3d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x1bacd7,_0xba3d('0xd'));logger[_0xba3d('0xe')](_0xba3d('0xf'),_0x1bacd7,_0xba3d('0xd'),JSON[_0xba3d('0x10')](_0x102fe6));if(_0x102fe6['error']){if(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x12')]===0x1f4){logger[_0xba3d('0x11')]('SmsApplication,\x20%s,\x20%s',_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x3b69e9(_0x102fe6[_0xba3d('0x11')]['message']);}logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x102fe6['error'][_0xba3d('0x13')]);return _0x426868(_0x102fe6[_0xba3d('0x11')][_0xba3d('0x13')]);}else{logger[_0xba3d('0xc')](_0xba3d('0x14'),_0x1bacd7,_0xba3d('0xd'));_0x426868(_0x102fe6[_0xba3d('0x15')][_0xba3d('0x13')]);}})[_0xba3d('0x16')](function(_0x2ce092){logger['error'](_0xba3d('0x14'),_0x1bacd7,_0x2ce092);_0x3b69e9(_0x2ce092);});});}
\ No newline at end of file
index 48329fb..f04ef7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0xe8e113,_0x4f8299){var _0x225f1d=function(_0x484cdc){while(--_0x484cdc){_0xe8e113['push'](_0xe8e113['shift']());}};_0x225f1d(++_0x4f8299);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x5eb8[_0x2543d6];return _0x55213c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router;
\ No newline at end of file
+var _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0x378d05,_0x327da4){var _0x4052be=function(_0x1dbad4){while(--_0x1dbad4){_0x378d05['push'](_0x378d05['shift']());}};_0x4052be(++_0x327da4);}(_0x4fc2,0x111));var _0x24fc=function(_0x14f5c3,_0x1e3047){_0x14f5c3=_0x14f5c3-0x0;var _0x2ea070=_0x4fc2[_0x14f5c3];return _0x2ea070;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router;
\ No newline at end of file
index 52c18fd..1b11410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43fd=['moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x4b38d4,_0x73db7){var _0xe2398d=function(_0xc94472){while(--_0xc94472){_0x4b38d4['push'](_0x4b38d4['shift']());}};_0xe2398d(++_0x73db7);}(_0x43fd,0x1ec));var _0xd43f=function(_0x2240d7,_0x5ca496){_0x2240d7=_0x2240d7-0x0;var _0x292ce6=_0x43fd[_0x2240d7];return _0x292ce6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd43f('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd43f('0x1')]},'disposition':{'type':Sequelize[_0xd43f('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xd43f('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd43f('0x2')]},'read1stAt':{'type':Sequelize[_0xd43f('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xd43f('0x3')]('in',_0xd43f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd43f('0x3')]('in',_0xd43f('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd43f('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfc17=['STRING','DATE','out','ENUM','sequelize','moment','exports','BOOLEAN'];(function(_0x59a850,_0x5ea9f5){var _0x1a6a58=function(_0x4496a2){while(--_0x4496a2){_0x59a850['push'](_0x59a850['shift']());}};_0x1a6a58(++_0x5ea9f5);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x2c6b5a,_0x1dc6bc){_0x2c6b5a=_0x2c6b5a-0x0;var _0x23ca9a=_0xfc17[_0x2c6b5a];return _0x23ca9a;};'use strict';var Sequelize=require(_0x7fc1('0x0'));var moment=require(_0x7fc1('0x1'));module[_0x7fc1('0x2')]={'closed':{'type':Sequelize[_0x7fc1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7fc1('0x4')]},'secondDisposition':{'type':Sequelize[_0x7fc1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x7fc1('0x4')]},'note':{'type':Sequelize[_0x7fc1('0x4')]},'phone':{'type':Sequelize[_0x7fc1('0x4')]},'read1stAt':{'type':Sequelize[_0x7fc1('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7fc1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7fc1('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x7fc1('0x7')]('in',_0x7fc1('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7fc1('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 2661737..dd701ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9967=['DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','rawAttributes','intersection','includeAll','include','merge','options','create','body','destroy','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','pick','format','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','unix','join','server','tmp','root','files','transcript-%d-%s.zip','CmContact','firstName','lastName','Messages','direction','secret','Account','Owner','get','N.A.','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','Users','map','fullname','TagIds','split','Tags','push','catch','SmsInteraction','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','type','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','buildExpression','some','compact','isEmpty','forEach','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName'];(function(_0x254849,_0x321ff6){var _0x4f73d1=function(_0x489d88){while(--_0x489d88){_0x254849['push'](_0x254849['shift']());}};_0x4f73d1(++_0x321ff6);}(_0x9967,0x14c));var _0x7996=function(_0x25e087,_0x31bec4){_0x25e087=_0x25e087-0x0;var _0x44c3f6=_0x9967[_0x25e087];return _0x44c3f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7996('0x0'));var zipdir=require(_0x7996('0x1'));var jsonpatch=require(_0x7996('0x2'));var rp=require(_0x7996('0x3'));var moment=require(_0x7996('0x4'));var BPromise=require(_0x7996('0x5'));var Mustache=require(_0x7996('0x6'));var util=require('util');var path=require(_0x7996('0x7'));var sox=require('sox');var csv=require(_0x7996('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7996('0x9'));var _=require(_0x7996('0xa'));var squel=require(_0x7996('0xb'));var crypto=require(_0x7996('0xc'));var jsforce=require(_0x7996('0xd'));var deskjs=require(_0x7996('0xe'));var toCsv=require(_0x7996('0x8'));var querystring=require('querystring');var Papa=require(_0x7996('0xf'));var Redis=require(_0x7996('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7996('0x11'));var pdf=require(_0x7996('0x12'));var hardwareService=require(_0x7996('0x13'));var logger=require('../../config/logger')(_0x7996('0x14'));var utils=require(_0x7996('0x15'));var config=require(_0x7996('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7996('0x17'))['db'];config[_0x7996('0x18')]=_[_0x7996('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7996('0x1a'))(new Redis(config['redis']));require(_0x7996('0x1b'))[_0x7996('0x1c')](socket);function respondWithStatusCode(_0x242fba,_0xf7b53){_0xf7b53=_0xf7b53||0xcc;return function(_0x3cd338){if(_0x3cd338){return _0x242fba['sendStatus'](_0xf7b53);}return _0x242fba[_0x7996('0x1d')](_0xf7b53)['end']();};}function respondWithResult(_0x17045c,_0x177b1f){_0x177b1f=_0x177b1f||0xc8;return function(_0x135172){if(_0x135172){return _0x17045c['status'](_0x177b1f)[_0x7996('0x1e')](_0x135172);}};}function respondWithFilteredResult(_0x40bda2,_0x248b0f){return function(_0x1db37d){if(_0x1db37d){var _0x1045f8=typeof _0x248b0f[_0x7996('0x1f')]===_0x7996('0x20')&&typeof _0x248b0f[_0x7996('0x21')]===_0x7996('0x20');var _0x283d4d=_0x1db37d['count'];var _0x8c9063=_0x1045f8?0x0:_0x248b0f[_0x7996('0x1f')];var _0x5a07cb=_0x1045f8?_0x1db37d[_0x7996('0x22')]:_0x248b0f['offset']+_0x248b0f[_0x7996('0x21')];var _0x3303c9;if(_0x5a07cb>=_0x283d4d){_0x5a07cb=_0x283d4d;_0x3303c9=0xc8;}else{_0x3303c9=0xce;}_0x40bda2['status'](_0x3303c9);return _0x40bda2[_0x7996('0x23')](_0x7996('0x24'),_0x8c9063+'-'+_0x5a07cb+'/'+_0x283d4d)[_0x7996('0x1e')](_0x1db37d);}return null;};}function patchUpdates(_0x249352){return function(_0x3aa791){try{jsonpatch[_0x7996('0x25')](_0x3aa791,_0x249352,!![]);}catch(_0x3a7de5){return BPromise['reject'](_0x3a7de5);}return _0x3aa791[_0x7996('0x26')]();};}function saveUpdates(_0x1348cc,_0x495a7b){return function(_0x5728c4){if(_0x5728c4){return _0x5728c4[_0x7996('0x27')](_0x1348cc)[_0x7996('0x28')](function(_0xdc5421){return _0xdc5421;});}return null;};}function removeEntity(_0x11a1ef,_0x1a6e87){return function(_0x7e9dc1){if(_0x7e9dc1){return _0x7e9dc1['destroy']()[_0x7996('0x28')](function(){_0x11a1ef[_0x7996('0x1d')](0xcc)[_0x7996('0x29')]();});}};}function handleEntityNotFound(_0x2f21ef,_0xedcc45){return function(_0x3e8adb){if(!_0x3e8adb){_0x2f21ef[_0x7996('0x2a')](0x194);}return _0x3e8adb;};}function handleError(_0x4cd6a1,_0x47708e){_0x47708e=_0x47708e||0x1f4;return function(_0x28ea33){logger['error'](_0x28ea33[_0x7996('0x2b')]);if(_0x28ea33[_0x7996('0x2c')]){delete _0x28ea33[_0x7996('0x2c')];}_0x4cd6a1[_0x7996('0x1d')](_0x47708e)[_0x7996('0x2d')](_0x28ea33);};}function getInteractionUsers(_0x43fe77,_0x1fa285){return new BPromise(function(_0x5d2dbe,_0x509f29){try{if(_0x1fa285[_0x43fe77['id']]){_0x43fe77[_0x7996('0x2e')]=_[_0x7996('0x2f')](_0x1fa285[_0x43fe77['id']],function(_0x3a6803){return{'id':_0x3a6803['id'],'fullname':_0x3a6803[_0x7996('0x30')]};});}}catch(_0x288260){_0x509f29(_0x288260);}_0x5d2dbe(_0x43fe77);});}function getInteractionTags(_0x48f185,_0x38d73e){return new BPromise(function(_0x43dc60,_0x2e97f1){try{if(_0x48f185[_0x7996('0x31')]){_0x48f185['Tags']=[];_0x48f185[_0x7996('0x31')][_0x7996('0x32')](',')['forEach'](function(_0xe275e3){_0x48f185[_0x7996('0x33')][_0x7996('0x34')](_0x38d73e[_0xe275e3]);});}delete _0x48f185[_0x7996('0x31')];}catch(_0x135f96){_0x2e97f1(_0x135f96);}_0x43dc60(_0x48f185);});}function updateSmsInteraction(_0x2f0e09,_0x3ed0d7,_0x19a4b5){return new BPromise(function(_0x5c8ba9,_0x2cdcd9){return getInteractionUsers(_0x2f0e09,_0x19a4b5)[_0x7996('0x28')](function(_0x2b98f3){return getInteractionTags(_0x2b98f3,_0x3ed0d7);})[_0x7996('0x28')](function(_0x561fd1){_0x5c8ba9(_0x561fd1);})[_0x7996('0x35')](function(_0x4d7204){_0x2cdcd9(_0x4d7204);});});}exports['index']=function(_0x262e23,_0x52bd75){var _0x129ae6={},_0x5668fd={},_0x39c1d2={'count':0x0,'rows':[]};var _0x301258=_['map'](db[_0x7996('0x36')]['rawAttributes'],function(_0x4bd0a8){return{'name':_0x4bd0a8[_0x7996('0x37')],'type':_0x4bd0a8['type'][_0x7996('0x38')]};});_0x5668fd[_0x7996('0x39')]=_[_0x7996('0x2f')](_0x301258,_0x7996('0x2c'));_0x5668fd[_0x7996('0x3a')]=_[_0x7996('0x3b')](_0x262e23[_0x7996('0x3a')]);_0x5668fd[_0x7996('0x3c')]=_['intersection'](_0x5668fd[_0x7996('0x39')],_0x5668fd[_0x7996('0x3a')]);_0x129ae6[_0x7996('0x3d')]=_['intersection'](_0x5668fd[_0x7996('0x39')],qs[_0x7996('0x3e')](_0x262e23[_0x7996('0x3a')][_0x7996('0x3e')]));_0x129ae6[_0x7996('0x3d')]=_0x129ae6[_0x7996('0x3d')][_0x7996('0x3f')]?_0x129ae6[_0x7996('0x3d')]:_0x5668fd[_0x7996('0x39')];if(!_0x262e23['query'][_0x7996('0x40')](_0x7996('0x41'))){_0x129ae6[_0x7996('0x21')]=qs[_0x7996('0x21')](_0x262e23['query'][_0x7996('0x21')]);_0x129ae6['offset']=qs[_0x7996('0x1f')](_0x262e23[_0x7996('0x3a')][_0x7996('0x1f')]);}_0x129ae6[_0x7996('0x42')]=qs['sort'](_0x262e23['query']['sort']);_0x129ae6[_0x7996('0x43')]=qs[_0x7996('0x3c')](_['pick'](_0x262e23[_0x7996('0x3a')],_0x5668fd[_0x7996('0x3c')]),_0x301258);var _0x9e29b=[];var _0x5d1f68=squel[_0x7996('0x44')]()[_0x7996('0x45')]('id')[_0x7996('0x45')]('name')[_0x7996('0x45')](_0x7996('0x46'))[_0x7996('0x47')](_0x7996('0x48'));var _0x5c33b3=squel[_0x7996('0x44')]()['field'](_0x7996('0x49'))['field'](_0x7996('0x4a'))[_0x7996('0x45')](_0x7996('0x4b'))['from']('user_has_sms_interactions','ui')[_0x7996('0x4c')](_0x7996('0x4d'),'u',_0x7996('0x4e'));var _0x3ef90d=squel['select']()[_0x7996('0x47')](_0x7996('0x4f'),'i')[_0x7996('0x4c')](_0x7996('0x50'),'c',_0x7996('0x51'))[_0x7996('0x4c')](_0x7996('0x4d'),'o','o.id\x20=\x20i.UserId')[_0x7996('0x4c')]('sms_accounts','a',_0x7996('0x52'))['left_join'](_0x7996('0x53'),'me',_0x7996('0x54'))[_0x7996('0x4c')](_0x7996('0x55'),'it',_0x7996('0x56'))[_0x7996('0x4c')](_0x7996('0x48'),'t','t.id\x20=\x20it.TagId');var _0x32a347=squel[_0x7996('0x57')]();var _0x34966b=[];var _0x295531=squel['expr']();var _0x49a5e0;if(_0x262e23['query'][_0x7996('0x58')]){_0x49a5e0=as[_0x7996('0x59')](_0x262e23[_0x7996('0x3a')]['search']);var _0x581fc7=_0x49a5e0[_0x7996('0x5a')];for(var _0x4b3ca4=0x0;_0x4b3ca4<_0x49a5e0[_0x7996('0x5b')][_0x7996('0x3f')];_0x4b3ca4++){var _0x5d0d51=_0x49a5e0[_0x7996('0x5b')][_0x4b3ca4];var _0xe450c6='i';var _0x4ab67b=_[_0x7996('0x5c')](_0x301258,[_0x7996('0x2c'),_0x5d0d51[_0x7996('0x45')]]);if(!_0x4ab67b){switch(_0x5d0d51[_0x7996('0x45')]){case _0x7996('0x5d'):if(_0x5d0d51[_0x7996('0x5e')]==0x1){_0x3ef90d[_0x7996('0x5f')]('`'+_0x5d0d51['field']+'`\x20=\x200');}else{_0x3ef90d['having']('`'+_0x5d0d51[_0x7996('0x45')]+_0x7996('0x60'));}break;case _0x7996('0x61'):if(_0x5d0d51[_0x7996('0x62')]===_0x7996('0x63')){if(_0x5d0d51['value'][_0x7996('0x32')]('\x20')[_0x7996('0x3f')]>0x1){_0x32a347[_0x581fc7](_0x7996('0x64'),qs[_0x7996('0x65')](_0x5d0d51[_0x7996('0x5e')]),null);}else{var _0x2bbbc4='%'+_0x5d0d51[_0x7996('0x5e')]+'%';_0x32a347[_0x581fc7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2bbbc4,_0x2bbbc4,_0x2bbbc4);}}else{_0x4ab67b=_[_0x7996('0x5c')](_0x301258,[_0x7996('0x2c'),_0x7996('0x66')]);_0x5d0d51[_0x7996('0x45')]=_0x7996('0x66');_0x29c3ad=as['buildExpression'](_0xe450c6,_0x4ab67b[_0x7996('0x67')],_0x5d0d51);_0x32a347[_0x581fc7](_0x29c3ad['text'],_0x29c3ad[_0x7996('0x5e')][_0x7996('0x68')],_0x29c3ad['value']['end']);}break;case'Tag':var _0x44694c=_0x5d0d51['value'][_0x7996('0x32')](',')['map'](function(_0x25a69f){return Number(_0x25a69f);});_0x44694c['forEach'](function(_0x38319c){_0x295531['or'](_0x7996('0x69'),'%,'+_0x38319c+',%');});_0x34966b=_[_0x7996('0x6a')](_0x34966b,_0x44694c);break;case _0x7996('0x6b'):if(_0x5d0d51[_0x7996('0x62')]===_0x7996('0x63')){_0x32a347[_0x581fc7](_0x7996('0x6c'),'%'+_0x5d0d51[_0x7996('0x5e')]+'%',null);}else{_0x4ab67b=_[_0x7996('0x5c')](_0x301258,[_0x7996('0x2c'),_0x7996('0x6d')]);_0x5d0d51[_0x7996('0x45')]='UserId';_0x29c3ad=as['buildExpression'](_0xe450c6,_0x4ab67b[_0x7996('0x67')],_0x5d0d51);_0x32a347[_0x581fc7](_0x29c3ad[_0x7996('0x6e')],_0x29c3ad['value'][_0x7996('0x68')],_0x29c3ad['value']['end']);}break;case'body':_0x29c3ad=as[_0x7996('0x6f')]('me',null,_0x5d0d51);_0x32a347[_0x581fc7](_0x29c3ad[_0x7996('0x6e')],_0x29c3ad['value']['start'],_0x29c3ad[_0x7996('0x5e')]['end']);break;}}else{var _0x29c3ad=as[_0x7996('0x6f')](_0xe450c6,_0x4ab67b[_0x7996('0x67')],_0x5d0d51);_0x32a347[_0x581fc7](_0x29c3ad[_0x7996('0x6e')],_0x29c3ad[_0x7996('0x5e')][_0x7996('0x68')],_0x29c3ad[_0x7996('0x5e')][_0x7996('0x29')]);}}}else{var _0x4cefd7=_(_0x262e23['query'])[_0x7996('0x3b')]()[_0x7996('0x2f')](function(_0x4dec98){return _[_0x7996('0x70')](_0x301258,[_0x7996('0x2c'),_0x4dec98])?_0x4dec98:undefined;})[_0x7996('0x71')]()[_0x7996('0x5e')]();if(!_[_0x7996('0x72')](_0x4cefd7)){_0x4cefd7[_0x7996('0x73')](function(_0x5bc16d){if(_0x5bc16d===_0x7996('0x74')){_0x3ef90d[_0x7996('0x43')](_0x7996('0x75'),[][_0x7996('0x76')](_0x262e23['query'][_0x5bc16d]));}else if(_0x5bc16d===_0x7996('0x77')){var _0x43286c=JSON['parse'](_0x262e23['query'][_0x5bc16d])['$gte'];var _0x5718c1=JSON[_0x7996('0x78')](_0x262e23['query'][_0x5bc16d])[_0x7996('0x79')];_0x3ef90d[_0x7996('0x43')](_0x7996('0x7a'),_0x43286c,_0x5718c1);}else{if(_0x262e23[_0x7996('0x3a')][_0x5bc16d]===_0x7996('0x7b')){_0x3ef90d['where']('i.'+_0x5bc16d+_0x7996('0x7c'));}else{_0x3ef90d[_0x7996('0x43')]('i.'+_0x5bc16d+'\x20=\x20?',_0x262e23[_0x7996('0x3a')][_0x5bc16d]);}}});}if(_0x262e23[_0x7996('0x3a')]['read']){if(_0x262e23[_0x7996('0x3a')][_0x7996('0x7d')]==0x1){_0x3ef90d[_0x7996('0x5f')](_0x7996('0x7e'));}else{_0x3ef90d[_0x7996('0x5f')](_0x7996('0x7f'));}}if(_0x262e23[_0x7996('0x3a')][_0x7996('0x80')]){_0x34966b=_[_0x7996('0x81')](_0x262e23[_0x7996('0x3a')][_0x7996('0x80')])?_0x262e23[_0x7996('0x3a')]['tag']:new Array(_0x262e23[_0x7996('0x3a')][_0x7996('0x80')]);_0x34966b[_0x7996('0x73')](function(_0x230a10){_0x295531['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x230a10+',%');});}if(_0x262e23[_0x7996('0x3a')][_0x7996('0x82')]){var _0x44b013=_0x262e23[_0x7996('0x3a')][_0x7996('0x82')][_0x7996('0x83')]('\x5c','\x5c\x5c')[_0x7996('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x44b013)){_0x32a347['or']('i.id\x20LIKE\x20?',_0x44b013+'%')['or'](_0x7996('0x84'),_0x44b013+'%');}else{_0x32a347['or'](_0x7996('0x85'),qs[_0x7996('0x65')](_0x44b013))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x44b013+'%');}}}_0x3ef90d[_0x7996('0x43')](_0x32a347);_0x3ef90d[_0x7996('0x86')](_0x7996('0x87'));var _0x382630={'type':db[_0x7996('0x88')][_0x7996('0x89')][_0x7996('0x8a')],'raw':!![]};var _0x515432=_0x3ef90d[_0x7996('0x8b')]();_0x515432['field'](_0x7996('0x87'));_0x515432[_0x7996('0x45')](_0x7996('0x8c'),_0x7996('0x5d'));if(_0x129ae6['order']){_0x129ae6[_0x7996('0x42')][_0x7996('0x73')](function(_0x176cf8){var _0x545d42=_0x176cf8[0x0]===_0x7996('0x8d')?_0x176cf8[0x0]:'i.'+_0x176cf8[0x0];_0x3ef90d[_0x7996('0x42')](_0x545d42,_0x176cf8[0x1]===_0x7996('0x8e')?![]:!![]);});}if(!_[_0x7996('0x72')](_0x34966b)){_0x3ef90d[_0x7996('0x5f')](_0x295531);_0x515432[_0x7996('0x43')]('t.id\x20IN\x20?',_0x34966b);}BPromise[_0x7996('0x8f')]()[_0x7996('0x28')](function(){if(!_0x49a5e0){if(_0x262e23['query'][_0x7996('0x74')])return;_0x515432[_0x7996('0x43')](_0x7996('0x90'));_0x3ef90d[_0x7996('0x43')](_0x7996('0x90'));return;}if(_0x262e23[_0x7996('0x91')][_0x7996('0x92')]!==_0x7996('0x93'))return;return _0x262e23[_0x7996('0x91')][_0x7996('0x94')]({'attributes':['id'],'raw':!![]})[_0x7996('0x28')](function(_0x5efaca){if(_[_0x7996('0x72')](_0x5efaca)){_0x515432[_0x7996('0x43')](_0x7996('0x95'));_0x3ef90d[_0x7996('0x43')](_0x7996('0x95'));}else{_0x515432[_0x7996('0x43')](_0x7996('0x75'),_[_0x7996('0x2f')](_0x5efaca,'id'));_0x3ef90d[_0x7996('0x43')](_0x7996('0x75'),_[_0x7996('0x2f')](_0x5efaca,'id'));}});})['then'](function(){if(_0x262e23[_0x7996('0x91')][_0x7996('0x92')]===_0x7996('0x93')&&!_0x49a5e0&&!_0x262e23[_0x7996('0x3a')]['SmsAccountId'])return[];return db[_0x7996('0x96')][_0x7996('0x3a')](_0x515432[_0x7996('0x97')](),_0x382630);})[_0x7996('0x28')](function(_0x422551){_0x39c1d2[_0x7996('0x22')]=_0x422551[_0x7996('0x3f')];if(_0x39c1d2[_0x7996('0x22')]===0x0)return[];return db[_0x7996('0x96')][_0x7996('0x3a')](_0x5d1f68[_0x7996('0x97')](),_0x382630)[_0x7996('0x28')](function(_0x1701c3){_0x9e29b=_[_0x7996('0x98')](_0x1701c3,'id');_0x382630=_['merge'](_0x382630,{'model':db[_0x7996('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x262e23[_0x7996('0x3a')][_0x7996('0x3e')]){_0x129ae6[_0x7996('0x3d')][_0x7996('0x73')](function(_0x4f4c71){_0x3ef90d[_0x7996('0x45')]('i.'+_0x4f4c71);});}else{_0x3ef90d['field'](_0x7996('0x8c'),_0x7996('0x5d'));_0x3ef90d['field']('a.key',_0x7996('0x99'));_0x3ef90d[_0x7996('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x3ef90d['field'](_0x7996('0x9a'),_0x7996('0x8d'));_0x3ef90d[_0x7996('0x45')](_0x7996('0x9b'));_0x3ef90d[_0x7996('0x45')](_0x7996('0x9c'),_0x7996('0x9d'));_0x3ef90d['field'](_0x7996('0x9e'),_0x7996('0x9f'));_0x3ef90d[_0x7996('0x45')](_0x7996('0xa0'),_0x7996('0xa1'));_0x3ef90d[_0x7996('0x45')](_0x7996('0xa2'),_0x7996('0xa3'));_0x3ef90d[_0x7996('0x45')](_0x7996('0xa4'),'Contact.mobile');_0x3ef90d[_0x7996('0x45')](_0x7996('0xa5'),_0x7996('0xa6'));_0x3ef90d[_0x7996('0x45')](_0x7996('0xa7'),_0x7996('0xa8'));_0x3ef90d[_0x7996('0x45')](_0x7996('0xa9'),_0x7996('0xaa'));_0x3ef90d[_0x7996('0x45')](_0x7996('0xab'),'TagIds');}if(_0x129ae6[_0x7996('0x21')])_0x3ef90d[_0x7996('0x21')](_0x129ae6['limit']);if(_0x129ae6['offset'])_0x3ef90d[_0x7996('0x1f')](_0x129ae6[_0x7996('0x1f')]);return db[_0x7996('0x96')][_0x7996('0x3a')](_0x3ef90d['toString'](),_0x382630);})[_0x7996('0x28')](function(_0x162f98){if(_0x162f98[_0x7996('0x3f')]>0x0)_0x5c33b3[_0x7996('0x43')](_0x7996('0xac'),_[_0x7996('0x2f')](_0x162f98,'id'));return db[_0x7996('0x96')][_0x7996('0x3a')](_0x5c33b3[_0x7996('0x97')](),_0x382630)[_0x7996('0x28')](function(_0xbcfffe){var _0x612028=_[_0x7996('0xad')](_0xbcfffe,_0x7996('0xae'));var _0x3b62b6=[];_0x162f98[_0x7996('0x73')](function(_0x3bfc33){_0x3b62b6[_0x7996('0x34')](updateSmsInteraction(_0x3bfc33,_0x9e29b,_0x612028));});return BPromise[_0x7996('0xaf')](_0x3b62b6);});});})['then'](function(_0x1aabd6){_0x39c1d2[_0x7996('0xb0')]=_0x1aabd6;return _0x39c1d2;})[_0x7996('0x28')](respondWithFilteredResult(_0x52bd75,_0x129ae6))[_0x7996('0x35')](handleError(_0x52bd75,null));};exports[_0x7996('0xb1')]=function(_0x464fb2,_0x39bcaa){var _0x2bdcc={'raw':![],'where':{'id':_0x464fb2[_0x7996('0xb2')]['id']}},_0x4008ff={};_0x4008ff[_0x7996('0x39')]=_['keys'](db[_0x7996('0x36')][_0x7996('0xb3')]);_0x4008ff[_0x7996('0x3a')]=_[_0x7996('0x3b')](_0x464fb2[_0x7996('0x3a')]);_0x4008ff[_0x7996('0x3c')]=_['intersection'](_0x4008ff[_0x7996('0x39')],_0x4008ff[_0x7996('0x3a')]);_0x2bdcc[_0x7996('0x3d')]=_[_0x7996('0xb4')](_0x4008ff[_0x7996('0x39')],qs[_0x7996('0x3e')](_0x464fb2[_0x7996('0x3a')][_0x7996('0x3e')]));_0x2bdcc[_0x7996('0x3d')]=_0x2bdcc[_0x7996('0x3d')][_0x7996('0x3f')]?_0x2bdcc['attributes']:_0x4008ff[_0x7996('0x39')];if(_0x464fb2[_0x7996('0x3a')][_0x7996('0xb5')]){_0x2bdcc[_0x7996('0xb6')]=[{'all':!![]}];}_0x2bdcc=_[_0x7996('0xb7')]({},_0x2bdcc,_0x464fb2[_0x7996('0xb8')]);return db[_0x7996('0x36')][_0x7996('0x5c')](_0x2bdcc)[_0x7996('0x28')](handleEntityNotFound(_0x39bcaa,null))[_0x7996('0x28')](respondWithResult(_0x39bcaa,null))[_0x7996('0x35')](handleError(_0x39bcaa,null));};exports[_0x7996('0xb9')]=function(_0x36f14d,_0x5ebc3f){return db[_0x7996('0x36')][_0x7996('0xb9')](_0x36f14d['body'],{})[_0x7996('0x28')](respondWithResult(_0x5ebc3f,0xc9))[_0x7996('0x35')](handleError(_0x5ebc3f,null));};exports[_0x7996('0x27')]=function(_0x3616ea,_0x4cc325){if(_0x3616ea[_0x7996('0xba')]['id']){delete _0x3616ea[_0x7996('0xba')]['id'];}return db['SmsInteraction'][_0x7996('0x5c')]({'where':{'id':_0x3616ea[_0x7996('0xb2')]['id']}})[_0x7996('0x28')](handleEntityNotFound(_0x4cc325,null))[_0x7996('0x28')](saveUpdates(_0x3616ea['body'],null))[_0x7996('0x28')](respondWithResult(_0x4cc325,null))['catch'](handleError(_0x4cc325,null));};exports[_0x7996('0xbb')]=function(_0x527d39,_0x176a37){return db[_0x7996('0x36')]['find']({'where':{'id':_0x527d39[_0x7996('0xb2')]['id']}})[_0x7996('0x28')](handleEntityNotFound(_0x176a37,null))['then'](removeEntity(_0x176a37,null))['catch'](handleError(_0x176a37,null));};exports['describe']=function(_0x40943c,_0x46c7de){return db[_0x7996('0x36')][_0x7996('0xbc')]()[_0x7996('0x28')](respondWithResult(_0x46c7de,null))[_0x7996('0x35')](handleError(_0x46c7de,null));};exports[_0x7996('0xbd')]=function(_0x334d15,_0x5b67ea,_0x115e13){return db[_0x7996('0xbe')][_0x7996('0x5c')]({'where':{'id':_0x334d15[_0x7996('0xb2')]['id']}})[_0x7996('0x28')](handleEntityNotFound(_0x5b67ea,null))[_0x7996('0x28')](function(_0x5bdccd){if(_0x5bdccd){return _0x5bdccd[_0x7996('0xbd')](_0x334d15[_0x7996('0xba')]['ids'],_[_0x7996('0xbf')](_0x334d15[_0x7996('0xba')],[_0x7996('0xc0'),'id'])||{});}})[_0x7996('0x28')](respondWithResult(_0x5b67ea,null))['catch'](handleError(_0x5b67ea,null));};exports[_0x7996('0xc1')]=function(_0x420394,_0x525668,_0x32e24d){var _0x1b17ea={'raw':![],'where':{}};var _0x71c32d={};var _0x288b45={'count':0x0,'rows':[]};return db[_0x7996('0x36')][_0x7996('0xc2')]({'where':{'id':_0x420394[_0x7996('0xb2')]['id']}})['then'](handleEntityNotFound(_0x525668,null))[_0x7996('0x28')](function(_0x3281b3){if(_0x3281b3){_0x71c32d[_0x7996('0x39')]=_[_0x7996('0x3b')](db[_0x7996('0xbe')][_0x7996('0xb3')]);_0x71c32d[_0x7996('0x3a')]=_[_0x7996('0x3b')](_0x420394[_0x7996('0x3a')]);_0x71c32d[_0x7996('0x3c')]=_[_0x7996('0xb4')](_0x71c32d[_0x7996('0x39')],_0x71c32d[_0x7996('0x3a')]);_0x1b17ea[_0x7996('0x3d')]=_[_0x7996('0xb4')](_0x71c32d['model'],qs[_0x7996('0x3e')](_0x420394['query'][_0x7996('0x3e')]));_0x1b17ea[_0x7996('0x3d')]=_0x1b17ea[_0x7996('0x3d')]['length']?_0x1b17ea[_0x7996('0x3d')]:_0x71c32d[_0x7996('0x39')];if(!_0x420394[_0x7996('0x3a')][_0x7996('0x40')](_0x7996('0x41'))){_0x1b17ea[_0x7996('0x21')]=qs[_0x7996('0x21')](_0x420394[_0x7996('0x3a')][_0x7996('0x21')]);_0x1b17ea['offset']=qs[_0x7996('0x1f')](_0x420394[_0x7996('0x3a')][_0x7996('0x1f')]);}_0x1b17ea['order']=qs['sort'](_0x420394['query']['sort']);_0x1b17ea[_0x7996('0x43')]=qs[_0x7996('0x3c')](_[_0x7996('0xc3')](_0x420394['query'],_0x71c32d['filters']));_0x1b17ea[_0x7996('0x43')][_0x7996('0xae')]=_0x3281b3['id'];if(_0x420394[_0x7996('0x3a')][_0x7996('0x82')]){_0x1b17ea[_0x7996('0x43')]=_[_0x7996('0xb7')](_0x1b17ea[_0x7996('0x43')],{'$or':_[_0x7996('0x2f')](_0x1b17ea['attributes'],function(_0x1e8985){var _0x3a8d3b={};_0x3a8d3b[_0x1e8985]={'$like':'%'+_0x420394[_0x7996('0x3a')][_0x7996('0x82')]+'%'};return _0x3a8d3b;})});}if(_0x420394['query']['$gte']){var _0x4b039d=_0x420394['query']['$gte']['split'](',');var _0x32ab0f={};_0x32ab0f[_0x4b039d[0x0]]={'$gte':moment(_0x4b039d[0x1])[_0x7996('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1b17ea['where']=_[_0x7996('0xb7')](_0x1b17ea['where'],_0x32ab0f);}_0x1b17ea=_[_0x7996('0xb7')]({},_0x1b17ea,_0x420394[_0x7996('0xb8')]);return db[_0x7996('0xbe')]['count']({'where':_0x1b17ea[_0x7996('0x43')]})[_0x7996('0x28')](function(_0x4d228f){_0x288b45['count']=_0x4d228f;if(_0x420394[_0x7996('0x3a')][_0x7996('0xb5')]){_0x1b17ea['include']=[{'all':!![]}];}return db[_0x7996('0xbe')]['findAll'](_0x1b17ea);})[_0x7996('0x28')](function(_0x128a75){_0x288b45[_0x7996('0xb0')]=_0x128a75;return _0x288b45;});}})[_0x7996('0x28')](respondWithFilteredResult(_0x525668,_0x1b17ea))['catch'](handleError(_0x525668,null));};exports['addTags']=function(_0x3cd669,_0x3f5236,_0x17477a){return db[_0x7996('0x36')][_0x7996('0x5c')]({'where':{'id':_0x3cd669['params']['id']}})[_0x7996('0x28')](handleEntityNotFound(_0x3f5236,null))[_0x7996('0x28')](function(_0x2e0d45){if(_0x2e0d45){return _0x2e0d45[_0x7996('0xc5')](_0x3cd669[_0x7996('0xba')][_0x7996('0xc0')],_[_0x7996('0xbf')](_0x3cd669[_0x7996('0xba')],[_0x7996('0xc0'),'id'])||{})[_0x7996('0xc6')](function(){return db[_0x7996('0xc7')]['findAll']({'attributes':['id',_0x7996('0x2c'),'color'],'where':{'id':_0x3cd669[_0x7996('0xba')]['ids']}});})['then'](function(_0x22e8ac){socket[_0x7996('0xc8')](_0x7996('0xc9'),{'id':Number(_0x3cd669[_0x7996('0xb2')]['id']),'tags':_0x22e8ac||[]});return{'id':Number(_0x3cd669[_0x7996('0xb2')]['id']),'tags':_0x22e8ac||[]};});}})[_0x7996('0x28')](respondWithResult(_0x3f5236,null))[_0x7996('0x35')](handleError(_0x3f5236,null));};exports['removeTags']=function(_0x28e2e5,_0x1475d9,_0x1d8991){return db[_0x7996('0x36')][_0x7996('0x5c')]({'where':{'id':_0x28e2e5[_0x7996('0xb2')]['id']}})[_0x7996('0x28')](handleEntityNotFound(_0x1475d9,null))[_0x7996('0x28')](function(_0x25b77a){if(_0x25b77a){return _0x25b77a[_0x7996('0xca')](_0x28e2e5[_0x7996('0x3a')][_0x7996('0xc0')]);}})[_0x7996('0x28')](respondWithStatusCode(_0x1475d9,null))[_0x7996('0x35')](handleError(_0x1475d9,null));};exports['download']=function(_0x1113fb,_0xa3e4bc){var _0x10f617=moment()[_0x7996('0xcb')]()['toString']();var _0x57941d=path[_0x7996('0xcc')](config['root'],_0x7996('0xcd'),'files',_0x7996('0xce'));var _0x29d6e1=path['join'](config[_0x7996('0xcf')],'server',_0x7996('0xd0'),'attachments');var _0x2a0065=path[_0x7996('0xcc')](_0x57941d,_0x10f617);var _0x50056a=util[_0x7996('0xc4')](_0x7996('0xd1'),_0x1113fb[_0x7996('0xb2')]['id'],_0x10f617);var _0x5b0860=path['join'](_0x57941d,_0x50056a);var _0x4e7eaa=[];_0x4e7eaa[_0x7996('0x34')]({'model':db[_0x7996('0x6b')],'as':_0x7996('0x6b'),'attributes':['id',_0x7996('0x30')],'raw':!![]});_0x4e7eaa['push']({'model':db[_0x7996('0xd2')],'as':_0x7996('0x61'),'attributes':['id',_0x7996('0xd3'),_0x7996('0xd4')],'raw':!![]});var _0x499742=[{'model':db['SmsMessage'],'as':_0x7996('0xd5'),'attributes':['id',_0x7996('0xba'),_0x7996('0x77'),_0x7996('0xd6'),_0x7996('0xd7'),'read'],'include':_0x4e7eaa}];_0x499742[_0x7996('0x34')]({'model':db['SmsAccount'],'as':_0x7996('0xd8'),'attributes':['id','name']});_0x499742['push']({'model':db[_0x7996('0x6b')],'as':_0x7996('0xd9'),'attributes':['id','fullname']});return db[_0x7996('0x36')]['find']({'where':{'id':_0x1113fb[_0x7996('0xb2')]['id']},'include':_0x499742})[_0x7996('0x28')](handleEntityNotFound(_0xa3e4bc,null))['then'](function(_0x2b27a1){if(_0x2b27a1){var _0x4a8584=_0x2b27a1[_0x7996('0xda')]({'plain':!![]});fs['mkdirSync'](_0x2a0065);var _0x4d9d71={'channel':'Sms','account':_0x4a8584[_0x7996('0xd8')]['name'],'agent':_0x4a8584[_0x7996('0xd9')]?_0x4a8584[_0x7996('0xd9')]['fullname']:_0x7996('0xdb'),'createdAt':moment(_0x4a8584[_0x7996('0x77')])[_0x7996('0xc4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7996('0x97')](),'closedAt':_0x4a8584[_0x7996('0xdc')]?moment(_0x4a8584[_0x7996('0xdd')])[_0x7996('0xc4')](_0x7996('0xde'))[_0x7996('0x97')]():'','disposition':_0x4a8584[_0x7996('0xdf')],'messages':_(_0x4a8584['Messages'])[_0x7996('0x82')]({'secret':![]})[_0x7996('0x2f')](function(_0x396f34){return{'date':moment(_0x396f34[_0x7996('0x77')])[_0x7996('0xc4')](_0x7996('0xde'))['toString'](),'sender':_0x396f34[_0x7996('0xd6')]===_0x7996('0xe0')?_0x396f34[_0x7996('0x6b')]?_0x396f34[_0x7996('0x6b')]['fullname']:_0x7996('0xe1'):_0x396f34['Contact']['firstName']+(_0x396f34[_0x7996('0x61')]['lastName']?'\x20'+_0x396f34['Contact']['lastName']:''),'body':_0x396f34['body'],'direction':_0x396f34[_0x7996('0xd6')]==='out'?'A':'C','secret':_0x396f34['secret'],'read':_0x396f34[_0x7996('0x7d')]};})[_0x7996('0x5e')]()};return ejs[_0x7996('0xe2')](path[_0x7996('0xcc')](config[_0x7996('0xcf')],_0x7996('0xcd'),_0x7996('0xe3'),_0x7996('0xe4')),{'interaction':_0x4d9d71})[_0x7996('0x28')](function(_0x3c0d41){var _0x1360e0=path['join'](_0x2a0065,_0x7996('0xe5')+_0x4a8584['id']+'-'+_0x10f617+_0x7996('0xe6'));var _0x31080d={'path':_0x1360e0,'channel':_0x7996('0xe7'),'interactionId':_0x4a8584['id']};return pdf[_0x7996('0xe8')](_0x3c0d41,_0x31080d);})['then'](function(){return new BPromise(function(_0x160616,_0x4a65aa){zipdir(_0x2a0065,{'saveTo':_0x5b0860},function(_0x34b481,_0xf530c4){if(_0x34b481)return _0x4a65aa(_0x34b481);return _0x160616(_0xf530c4);});})[_0x7996('0x28')](function(){return new BPromise(function(_0x29d992,_0x34c22c){rimraf(_0x2a0065,function(_0x41e53f){if(_0x41e53f)_0x34c22c(_0x41e53f);return _0x29d992();});});})[_0x7996('0x28')](function(){return _0xa3e4bc[_0x7996('0xe9')](_0x5b0860,_0x50056a,function(_0x46029f){if(_0x46029f){console[_0x7996('0xea')](_0x7996('0xeb'),_0x46029f);}else{fs[_0x7996('0xec')](_0x5b0860);}});});});}else{return _0xa3e4bc[_0x7996('0x2a')](0xc8);}})[_0x7996('0x35')](handleError(_0xa3e4bc,null));};
\ No newline at end of file
+var _0xdc9d=['all','show','params','options','create','describe','SmsMessage','addMessage','omit','ids','findOne','filter','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','setTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','System','out','renderFile','views','.pdf','download','log','rimraf','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','catch','index','SmsInteraction','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','from','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','sms_messages','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','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','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push'];(function(_0x20ce7b,_0x33a58d){var _0x244e55=function(_0x54cc57){while(--_0x54cc57){_0x20ce7b['push'](_0x20ce7b['shift']());}};_0x244e55(++_0x33a58d);}(_0xdc9d,0x1eb));var _0xddc9=function(_0x3b337d,_0x135d24){_0x3b337d=_0x3b337d-0x0;var _0x58d76b=_0xdc9d[_0x3b337d];return _0x58d76b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xddc9('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xddc9('0x2'));var util=require(_0xddc9('0x3'));var path=require('path');var sox=require(_0xddc9('0x4'));var csv=require(_0xddc9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddc9('0x6'));var _=require(_0xddc9('0x7'));var squel=require(_0xddc9('0x8'));var crypto=require(_0xddc9('0x9'));var jsforce=require(_0xddc9('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xddc9('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xddc9('0xc'));var qs=require(_0xddc9('0xd'));var as=require(_0xddc9('0xe'));var pdf=require(_0xddc9('0xf'));var hardwareService=require(_0xddc9('0x10'));var logger=require(_0xddc9('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xddc9('0x12'));var db=require(_0xddc9('0x13'))['db'];config['redis']=_[_0xddc9('0x14')](config['redis'],{'host':_0xddc9('0x15'),'port':0x18eb});var socket=require(_0xddc9('0x16'))(new Redis(config[_0xddc9('0x17')]));require(_0xddc9('0x18'))['register'](socket);function respondWithStatusCode(_0x4b13b4,_0x4d0247){_0x4d0247=_0x4d0247||0xcc;return function(_0x2c9026){if(_0x2c9026){return _0x4b13b4['sendStatus'](_0x4d0247);}return _0x4b13b4[_0xddc9('0x19')](_0x4d0247)['end']();};}function respondWithResult(_0x333328,_0x2afae1){_0x2afae1=_0x2afae1||0xc8;return function(_0x16c70f){if(_0x16c70f){return _0x333328[_0xddc9('0x19')](_0x2afae1)['json'](_0x16c70f);}};}function respondWithFilteredResult(_0x35a8c8,_0x24b96e){return function(_0x3d39f9){if(_0x3d39f9){var _0x1608fc=typeof _0x24b96e[_0xddc9('0x1a')]===_0xddc9('0x1b')&&typeof _0x24b96e[_0xddc9('0x1c')]===_0xddc9('0x1b');var _0x19bbe9=_0x3d39f9[_0xddc9('0x1d')];var _0xacc56d=_0x1608fc?0x0:_0x24b96e[_0xddc9('0x1a')];var _0x266e65=_0x1608fc?_0x3d39f9['count']:_0x24b96e[_0xddc9('0x1a')]+_0x24b96e[_0xddc9('0x1c')];var _0x143e01;if(_0x266e65>=_0x19bbe9){_0x266e65=_0x19bbe9;_0x143e01=0xc8;}else{_0x143e01=0xce;}_0x35a8c8['status'](_0x143e01);return _0x35a8c8['set'](_0xddc9('0x1e'),_0xacc56d+'-'+_0x266e65+'/'+_0x19bbe9)[_0xddc9('0x1f')](_0x3d39f9);}return null;};}function patchUpdates(_0x84fda){return function(_0x393310){try{jsonpatch[_0xddc9('0x20')](_0x393310,_0x84fda,!![]);}catch(_0x561b3b){return BPromise[_0xddc9('0x21')](_0x561b3b);}return _0x393310[_0xddc9('0x22')]();};}function saveUpdates(_0x4ee46a,_0x335530){return function(_0x5ebbb0){if(_0x5ebbb0){return _0x5ebbb0[_0xddc9('0x23')](_0x4ee46a)[_0xddc9('0x24')](function(_0x535cfa){return _0x535cfa;});}return null;};}function removeEntity(_0x4a646b,_0x2ead33){return function(_0xde6dd){if(_0xde6dd){return _0xde6dd[_0xddc9('0x25')]()[_0xddc9('0x24')](function(){_0x4a646b[_0xddc9('0x19')](0xcc)[_0xddc9('0x26')]();});}};}function handleEntityNotFound(_0x1ac8c9,_0xba3a0a){return function(_0x1fcdfd){if(!_0x1fcdfd){_0x1ac8c9[_0xddc9('0x27')](0x194);}return _0x1fcdfd;};}function handleError(_0xe49fbf,_0x35e574){_0x35e574=_0x35e574||0x1f4;return function(_0x2a5396){logger[_0xddc9('0x28')](_0x2a5396[_0xddc9('0x29')]);if(_0x2a5396['name']){delete _0x2a5396[_0xddc9('0x2a')];}_0xe49fbf[_0xddc9('0x19')](_0x35e574)[_0xddc9('0x2b')](_0x2a5396);};}function getInteractionUsers(_0x220cf0,_0x1d615d){return new BPromise(function(_0x12586b,_0x4038f1){try{if(_0x1d615d[_0x220cf0['id']]){_0x220cf0[_0xddc9('0x2c')]=_[_0xddc9('0x2d')](_0x1d615d[_0x220cf0['id']],function(_0x3d3565){return{'id':_0x3d3565['id'],'fullname':_0x3d3565[_0xddc9('0x2e')]};});}}catch(_0x847b66){_0x4038f1(_0x847b66);}_0x12586b(_0x220cf0);});}function getInteractionTags(_0x45df9c,_0x5bef3e){return new BPromise(function(_0x1cfaa7,_0x2f0fc3){try{if(_0x45df9c[_0xddc9('0x2f')]){_0x45df9c['Tags']=[];_0x45df9c[_0xddc9('0x2f')][_0xddc9('0x30')](',')[_0xddc9('0x31')](function(_0x5b9a47){_0x45df9c[_0xddc9('0x32')]['push'](_0x5bef3e[_0x5b9a47]);});}delete _0x45df9c[_0xddc9('0x2f')];}catch(_0x125923){_0x2f0fc3(_0x125923);}_0x1cfaa7(_0x45df9c);});}function updateSmsInteraction(_0x142b4e,_0xd7059a,_0x339863){return new BPromise(function(_0x29c093,_0x5348c3){return getInteractionUsers(_0x142b4e,_0x339863)['then'](function(_0x3821ab){return getInteractionTags(_0x3821ab,_0xd7059a);})[_0xddc9('0x24')](function(_0x240d3e){_0x29c093(_0x240d3e);})[_0xddc9('0x33')](function(_0x48d746){_0x5348c3(_0x48d746);});});}exports[_0xddc9('0x34')]=function(_0x3e73ed,_0x118066){var _0x4f82de={},_0x31e1b8={},_0x5ffcaf={'count':0x0,'rows':[]};var _0x568424=_['map'](db[_0xddc9('0x35')][_0xddc9('0x36')],function(_0x33776e){return{'name':_0x33776e[_0xddc9('0x37')],'type':_0x33776e['type']['key']};});_0x31e1b8[_0xddc9('0x38')]=_[_0xddc9('0x2d')](_0x568424,_0xddc9('0x2a'));_0x31e1b8[_0xddc9('0x39')]=_[_0xddc9('0x3a')](_0x3e73ed['query']);_0x31e1b8[_0xddc9('0x3b')]=_['intersection'](_0x31e1b8[_0xddc9('0x38')],_0x31e1b8[_0xddc9('0x39')]);_0x4f82de[_0xddc9('0x3c')]=_[_0xddc9('0x3d')](_0x31e1b8['model'],qs[_0xddc9('0x3e')](_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x3e')]));_0x4f82de['attributes']=_0x4f82de['attributes'][_0xddc9('0x3f')]?_0x4f82de[_0xddc9('0x3c')]:_0x31e1b8[_0xddc9('0x38')];if(!_0x3e73ed['query'][_0xddc9('0x40')](_0xddc9('0x41'))){_0x4f82de['limit']=qs['limit'](_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x1c')]);_0x4f82de[_0xddc9('0x1a')]=qs[_0xddc9('0x1a')](_0x3e73ed['query']['offset']);}_0x4f82de[_0xddc9('0x42')]=qs[_0xddc9('0x43')](_0x3e73ed[_0xddc9('0x39')]['sort']);_0x4f82de['where']=qs[_0xddc9('0x3b')](_[_0xddc9('0x44')](_0x3e73ed['query'],_0x31e1b8['filters']),_0x568424);var _0x5566ab=[];var _0x3f214a=squel['select']()['field']('id')[_0xddc9('0x45')](_0xddc9('0x2a'))[_0xddc9('0x45')]('color')[_0xddc9('0x46')]('tools_tags');var _0x3e7e24=squel[_0xddc9('0x47')]()[_0xddc9('0x45')](_0xddc9('0x48'))['field'](_0xddc9('0x49'))[_0xddc9('0x45')](_0xddc9('0x4a'))[_0xddc9('0x46')](_0xddc9('0x4b'),'ui')[_0xddc9('0x4c')](_0xddc9('0x4d'),'u',_0xddc9('0x4e'));var _0x290514=squel[_0xddc9('0x47')]()[_0xddc9('0x46')]('sms_interactions','i')['left_join'](_0xddc9('0x4f'),'c',_0xddc9('0x50'))[_0xddc9('0x4c')](_0xddc9('0x4d'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xddc9('0x51'),'a','a.id\x20=\x20i.SmsAccountId')[_0xddc9('0x4c')](_0xddc9('0x52'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xddc9('0x4c')]('sms_interaction_has_tags','it',_0xddc9('0x53'))[_0xddc9('0x4c')](_0xddc9('0x54'),'t',_0xddc9('0x55'));var _0x1a9f4f=squel[_0xddc9('0x56')]();var _0x328505=[];var _0x5c4cef=squel[_0xddc9('0x56')]();var _0x50e8c6;if(_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x57')]){_0x50e8c6=as[_0xddc9('0x58')](_0x3e73ed['query']['search']);var _0x20a82a=_0x50e8c6[_0xddc9('0x59')];for(var _0x13035f=0x0;_0x13035f<_0x50e8c6[_0xddc9('0x5a')][_0xddc9('0x3f')];_0x13035f++){var _0x488859=_0x50e8c6[_0xddc9('0x5a')][_0x13035f];var _0x492f53='i';var _0x1a91bd=_[_0xddc9('0x5b')](_0x568424,[_0xddc9('0x2a'),_0x488859[_0xddc9('0x45')]]);if(!_0x1a91bd){switch(_0x488859[_0xddc9('0x45')]){case _0xddc9('0x5c'):if(_0x488859['value']==0x1){_0x290514[_0xddc9('0x5d')]('`'+_0x488859[_0xddc9('0x45')]+_0xddc9('0x5e'));}else{_0x290514[_0xddc9('0x5d')]('`'+_0x488859[_0xddc9('0x45')]+_0xddc9('0x5f'));}break;case _0xddc9('0x60'):if(_0x488859[_0xddc9('0x61')]===_0xddc9('0x62')){if(_0x488859[_0xddc9('0x63')]['split']('\x20')[_0xddc9('0x3f')]>0x1){_0x1a9f4f[_0x20a82a](_0xddc9('0x64'),qs[_0xddc9('0x65')](_0x488859['value']),null);}else{var _0xe66e11='%'+_0x488859[_0xddc9('0x63')]+'%';_0x1a9f4f[_0x20a82a](_0xddc9('0x66'),_0xe66e11,_0xe66e11,_0xe66e11);}}else{_0x1a91bd=_[_0xddc9('0x5b')](_0x568424,[_0xddc9('0x2a'),_0xddc9('0x67')]);_0x488859[_0xddc9('0x45')]=_0xddc9('0x67');_0x4ce5f9=as[_0xddc9('0x68')](_0x492f53,_0x1a91bd[_0xddc9('0x69')],_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9['value'][_0xddc9('0x6b')],_0x4ce5f9[_0xddc9('0x63')]['end']);}break;case _0xddc9('0x6c'):var _0x2b9c67=_0x488859[_0xddc9('0x63')][_0xddc9('0x30')](',')[_0xddc9('0x2d')](function(_0x56f334){return Number(_0x56f334);});_0x2b9c67[_0xddc9('0x31')](function(_0x2ffd4f){_0x5c4cef['or'](_0xddc9('0x6d'),'%,'+_0x2ffd4f+',%');});_0x328505=_[_0xddc9('0x6e')](_0x328505,_0x2b9c67);break;case _0xddc9('0x6f'):if(_0x488859[_0xddc9('0x61')]===_0xddc9('0x62')){_0x1a9f4f[_0x20a82a](_0xddc9('0x70'),'%'+_0x488859[_0xddc9('0x63')]+'%',null);}else{_0x1a91bd=_[_0xddc9('0x5b')](_0x568424,[_0xddc9('0x2a'),_0xddc9('0x71')]);_0x488859[_0xddc9('0x45')]=_0xddc9('0x71');_0x4ce5f9=as[_0xddc9('0x68')](_0x492f53,_0x1a91bd[_0xddc9('0x69')],_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9[_0xddc9('0x63')]['start'],_0x4ce5f9[_0xddc9('0x63')]['end']);}break;case _0xddc9('0x72'):_0x4ce5f9=as['buildExpression']('me',null,_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9[_0xddc9('0x63')][_0xddc9('0x6b')],_0x4ce5f9[_0xddc9('0x63')]['end']);break;}}else{var _0x4ce5f9=as[_0xddc9('0x68')](_0x492f53,_0x1a91bd[_0xddc9('0x69')],_0x488859);_0x1a9f4f[_0x20a82a](_0x4ce5f9[_0xddc9('0x6a')],_0x4ce5f9[_0xddc9('0x63')][_0xddc9('0x6b')],_0x4ce5f9[_0xddc9('0x63')][_0xddc9('0x26')]);}}}else{var _0xabcad3=_(_0x3e73ed[_0xddc9('0x39')])['keys']()[_0xddc9('0x2d')](function(_0x26408b){return _[_0xddc9('0x73')](_0x568424,[_0xddc9('0x2a'),_0x26408b])?_0x26408b:undefined;})[_0xddc9('0x74')]()['value']();if(!_[_0xddc9('0x75')](_0xabcad3)){_0xabcad3[_0xddc9('0x31')](function(_0x5a7100){if(_0x5a7100===_0xddc9('0x76')){_0x290514[_0xddc9('0x77')](_0xddc9('0x78'),[][_0xddc9('0x79')](_0x3e73ed[_0xddc9('0x39')][_0x5a7100]));}else if(_0x5a7100===_0xddc9('0x7a')){var _0x5e4452=JSON[_0xddc9('0x7b')](_0x3e73ed[_0xddc9('0x39')][_0x5a7100])[_0xddc9('0x7c')];var _0x8318e7=JSON[_0xddc9('0x7b')](_0x3e73ed[_0xddc9('0x39')][_0x5a7100])['$lte'];_0x290514[_0xddc9('0x77')](_0xddc9('0x7d'),_0x5e4452,_0x8318e7);}else{if(_0x3e73ed[_0xddc9('0x39')][_0x5a7100]===_0xddc9('0x7e')){_0x290514[_0xddc9('0x77')]('i.'+_0x5a7100+'\x20IS\x20NULL');}else{_0x290514[_0xddc9('0x77')]('i.'+_0x5a7100+_0xddc9('0x7f'),_0x3e73ed[_0xddc9('0x39')][_0x5a7100]);}}});}if(_0x3e73ed[_0xddc9('0x39')]['read']){if(_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x80')]==0x1){_0x290514[_0xddc9('0x5d')](_0xddc9('0x81'));}else{_0x290514[_0xddc9('0x5d')](_0xddc9('0x82'));}}if(_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x83')]){_0x328505=_[_0xddc9('0x84')](_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x83')])?_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x83')]:new Array(_0x3e73ed['query'][_0xddc9('0x83')]);_0x328505[_0xddc9('0x31')](function(_0x931c8c){_0x5c4cef['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x931c8c+',%');});}if(_0x3e73ed['query']['filter']){var _0x3fc2d2=_0x3e73ed[_0xddc9('0x39')]['filter']['replace']('\x5c','\x5c\x5c')[_0xddc9('0x85')](/'/g,'\x27\x27');if(qs[_0xddc9('0x86')](_0x3fc2d2)){_0x1a9f4f['or'](_0xddc9('0x87'),_0x3fc2d2+'%')['or'](_0xddc9('0x88'),_0x3fc2d2+'%');}else{_0x1a9f4f['or'](_0xddc9('0x89'),qs[_0xddc9('0x65')](_0x3fc2d2))['or'](_0xddc9('0x8a'),_0x3fc2d2+'%');}}}_0x290514[_0xddc9('0x77')](_0x1a9f4f);_0x290514['group'](_0xddc9('0x8b'));var _0x2d9730={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x493837=_0x290514[_0xddc9('0x8c')]();_0x493837['field'](_0xddc9('0x8b'));_0x493837[_0xddc9('0x45')](_0xddc9('0x8d'),_0xddc9('0x5c'));if(_0x4f82de[_0xddc9('0x42')]){_0x4f82de[_0xddc9('0x42')][_0xddc9('0x31')](function(_0x1fddfe){var _0x4c6a3a=_0x1fddfe[0x0]===_0xddc9('0x8e')?_0x1fddfe[0x0]:'i.'+_0x1fddfe[0x0];_0x290514['order'](_0x4c6a3a,_0x1fddfe[0x1]===_0xddc9('0x8f')?![]:!![]);});}if(!_[_0xddc9('0x75')](_0x328505)){_0x290514[_0xddc9('0x5d')](_0x5c4cef);_0x493837[_0xddc9('0x77')](_0xddc9('0x90'),_0x328505);}BPromise['resolve']()[_0xddc9('0x24')](function(){if(!_0x50e8c6){if(_0x3e73ed[_0xddc9('0x39')]['SmsAccountId'])return;_0x493837[_0xddc9('0x77')](_0xddc9('0x91'));_0x290514[_0xddc9('0x77')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x3e73ed[_0xddc9('0x92')][_0xddc9('0x93')]!==_0xddc9('0x94'))return;return _0x3e73ed[_0xddc9('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xddc9('0x24')](function(_0x5c57a7){if(_[_0xddc9('0x75')](_0x5c57a7)){_0x493837['where'](_0xddc9('0x95'));_0x290514[_0xddc9('0x77')](_0xddc9('0x95'));}else{_0x493837[_0xddc9('0x77')](_0xddc9('0x78'),_[_0xddc9('0x2d')](_0x5c57a7,'id'));_0x290514[_0xddc9('0x77')]('i.SmsAccountId\x20IN\x20?',_[_0xddc9('0x2d')](_0x5c57a7,'id'));}});})[_0xddc9('0x24')](function(){if(_0x3e73ed['user'][_0xddc9('0x93')]===_0xddc9('0x94')&&!_0x50e8c6&&!_0x3e73ed[_0xddc9('0x39')][_0xddc9('0x76')])return[];return db[_0xddc9('0x96')][_0xddc9('0x39')](_0x493837[_0xddc9('0x97')](),_0x2d9730);})[_0xddc9('0x24')](function(_0x57e7e2){_0x5ffcaf['count']=_0x57e7e2[_0xddc9('0x3f')];if(_0x5ffcaf[_0xddc9('0x1d')]===0x0)return[];return db[_0xddc9('0x96')][_0xddc9('0x39')](_0x3f214a[_0xddc9('0x97')](),_0x2d9730)[_0xddc9('0x24')](function(_0x363ca3){_0x5566ab=_[_0xddc9('0x98')](_0x363ca3,'id');_0x2d9730=_[_0xddc9('0x99')](_0x2d9730,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e73ed[_0xddc9('0x39')]['fields']){_0x4f82de[_0xddc9('0x3c')]['forEach'](function(_0x25b091){_0x290514[_0xddc9('0x45')]('i.'+_0x25b091);});}else{_0x290514[_0xddc9('0x45')](_0xddc9('0x8d'),_0xddc9('0x5c'));_0x290514['field'](_0xddc9('0x9a'),'Account.key');_0x290514[_0xddc9('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x290514[_0xddc9('0x45')](_0xddc9('0x9b'),'contactName');_0x290514['field'](_0xddc9('0x9c'));_0x290514[_0xddc9('0x45')]('c.firstName',_0xddc9('0x9d'));_0x290514[_0xddc9('0x45')](_0xddc9('0x9e'),_0xddc9('0x9f'));_0x290514[_0xddc9('0x45')]('c.email',_0xddc9('0xa0'));_0x290514[_0xddc9('0x45')]('c.phone',_0xddc9('0xa1'));_0x290514[_0xddc9('0x45')](_0xddc9('0xa2'),'Contact.mobile');_0x290514[_0xddc9('0x45')]('c.fax',_0xddc9('0xa3'));_0x290514[_0xddc9('0x45')](_0xddc9('0xa4'),'Owner.fullname');_0x290514[_0xddc9('0x45')](_0xddc9('0xa5'),_0xddc9('0xa6'));_0x290514[_0xddc9('0x45')](_0xddc9('0xa7'),_0xddc9('0x2f'));}if(_0x4f82de[_0xddc9('0x1c')])_0x290514[_0xddc9('0x1c')](_0x4f82de[_0xddc9('0x1c')]);if(_0x4f82de[_0xddc9('0x1a')])_0x290514['offset'](_0x4f82de[_0xddc9('0x1a')]);return db[_0xddc9('0x96')][_0xddc9('0x39')](_0x290514[_0xddc9('0x97')](),_0x2d9730);})[_0xddc9('0x24')](function(_0x3c4c9a){if(_0x3c4c9a['length']>0x0)_0x3e7e24[_0xddc9('0x77')](_0xddc9('0xa8'),_[_0xddc9('0x2d')](_0x3c4c9a,'id'));return db['sequelize']['query'](_0x3e7e24['toString'](),_0x2d9730)['then'](function(_0x136d75){var _0x566f88=_[_0xddc9('0xa9')](_0x136d75,_0xddc9('0xaa'));var _0x177c5e=[];_0x3c4c9a[_0xddc9('0x31')](function(_0x186824){_0x177c5e[_0xddc9('0xab')](updateSmsInteraction(_0x186824,_0x5566ab,_0x566f88));});return BPromise[_0xddc9('0xac')](_0x177c5e);});});})[_0xddc9('0x24')](function(_0x215fd3){_0x5ffcaf['rows']=_0x215fd3;return _0x5ffcaf;})[_0xddc9('0x24')](respondWithFilteredResult(_0x118066,_0x4f82de))[_0xddc9('0x33')](handleError(_0x118066,null));};exports[_0xddc9('0xad')]=function(_0x4484ac,_0x5129c6){var _0x3ef836={'raw':![],'where':{'id':_0x4484ac[_0xddc9('0xae')]['id']}},_0x5b7a55={};_0x5b7a55['model']=_['keys'](db['SmsInteraction'][_0xddc9('0x36')]);_0x5b7a55[_0xddc9('0x39')]=_['keys'](_0x4484ac['query']);_0x5b7a55[_0xddc9('0x3b')]=_['intersection'](_0x5b7a55[_0xddc9('0x38')],_0x5b7a55['query']);_0x3ef836[_0xddc9('0x3c')]=_[_0xddc9('0x3d')](_0x5b7a55[_0xddc9('0x38')],qs[_0xddc9('0x3e')](_0x4484ac[_0xddc9('0x39')][_0xddc9('0x3e')]));_0x3ef836[_0xddc9('0x3c')]=_0x3ef836[_0xddc9('0x3c')][_0xddc9('0x3f')]?_0x3ef836[_0xddc9('0x3c')]:_0x5b7a55[_0xddc9('0x38')];if(_0x4484ac[_0xddc9('0x39')]['includeAll']){_0x3ef836['include']=[{'all':!![]}];}_0x3ef836=_[_0xddc9('0x99')]({},_0x3ef836,_0x4484ac[_0xddc9('0xaf')]);return db['SmsInteraction'][_0xddc9('0x5b')](_0x3ef836)[_0xddc9('0x24')](handleEntityNotFound(_0x5129c6,null))[_0xddc9('0x24')](respondWithResult(_0x5129c6,null))[_0xddc9('0x33')](handleError(_0x5129c6,null));};exports[_0xddc9('0xb0')]=function(_0x52ecbe,_0xf22281){return db[_0xddc9('0x35')][_0xddc9('0xb0')](_0x52ecbe[_0xddc9('0x72')],{})[_0xddc9('0x24')](respondWithResult(_0xf22281,0xc9))[_0xddc9('0x33')](handleError(_0xf22281,null));};exports[_0xddc9('0x23')]=function(_0x32ade1,_0x4458ab){if(_0x32ade1[_0xddc9('0x72')]['id']){delete _0x32ade1['body']['id'];}return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x32ade1[_0xddc9('0xae')]['id']}})['then'](handleEntityNotFound(_0x4458ab,null))[_0xddc9('0x24')](saveUpdates(_0x32ade1['body'],null))[_0xddc9('0x24')](respondWithResult(_0x4458ab,null))[_0xddc9('0x33')](handleError(_0x4458ab,null));};exports[_0xddc9('0x25')]=function(_0x518639,_0x54b990){return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x518639[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x54b990,null))[_0xddc9('0x24')](removeEntity(_0x54b990,null))[_0xddc9('0x33')](handleError(_0x54b990,null));};exports[_0xddc9('0xb1')]=function(_0x3f6d88,_0x2d7a45){return db[_0xddc9('0x35')][_0xddc9('0xb1')]()['then'](respondWithResult(_0x2d7a45,null))['catch'](handleError(_0x2d7a45,null));};exports['addMessage']=function(_0x580f4f,_0x3dca50,_0x23abb6){return db[_0xddc9('0xb2')][_0xddc9('0x5b')]({'where':{'id':_0x580f4f[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x3dca50,null))[_0xddc9('0x24')](function(_0x4df8a8){if(_0x4df8a8){return _0x4df8a8[_0xddc9('0xb3')](_0x580f4f['body']['ids'],_[_0xddc9('0xb4')](_0x580f4f['body'],[_0xddc9('0xb5'),'id'])||{});}})[_0xddc9('0x24')](respondWithResult(_0x3dca50,null))[_0xddc9('0x33')](handleError(_0x3dca50,null));};exports['getMessages']=function(_0x8aede1,_0x2117d9,_0x533eb5){var _0x27f537={'raw':![],'where':{}};var _0x5d4421={};var _0x34558d={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xddc9('0xb6')]({'where':{'id':_0x8aede1[_0xddc9('0xae')]['id']}})['then'](handleEntityNotFound(_0x2117d9,null))[_0xddc9('0x24')](function(_0x4545b4){if(_0x4545b4){_0x5d4421[_0xddc9('0x38')]=_[_0xddc9('0x3a')](db['SmsMessage'][_0xddc9('0x36')]);_0x5d4421['query']=_[_0xddc9('0x3a')](_0x8aede1[_0xddc9('0x39')]);_0x5d4421[_0xddc9('0x3b')]=_[_0xddc9('0x3d')](_0x5d4421[_0xddc9('0x38')],_0x5d4421[_0xddc9('0x39')]);_0x27f537['attributes']=_[_0xddc9('0x3d')](_0x5d4421[_0xddc9('0x38')],qs[_0xddc9('0x3e')](_0x8aede1['query'][_0xddc9('0x3e')]));_0x27f537['attributes']=_0x27f537[_0xddc9('0x3c')]['length']?_0x27f537[_0xddc9('0x3c')]:_0x5d4421[_0xddc9('0x38')];if(!_0x8aede1['query'][_0xddc9('0x40')](_0xddc9('0x41'))){_0x27f537['limit']=qs[_0xddc9('0x1c')](_0x8aede1[_0xddc9('0x39')][_0xddc9('0x1c')]);_0x27f537[_0xddc9('0x1a')]=qs[_0xddc9('0x1a')](_0x8aede1[_0xddc9('0x39')]['offset']);}_0x27f537[_0xddc9('0x42')]=qs[_0xddc9('0x43')](_0x8aede1[_0xddc9('0x39')][_0xddc9('0x43')]);_0x27f537[_0xddc9('0x77')]=qs[_0xddc9('0x3b')](_[_0xddc9('0x44')](_0x8aede1['query'],_0x5d4421[_0xddc9('0x3b')]));_0x27f537[_0xddc9('0x77')]['SmsInteractionId']=_0x4545b4['id'];if(_0x8aede1['query']['filter']){_0x27f537[_0xddc9('0x77')]=_[_0xddc9('0x99')](_0x27f537['where'],{'$or':_[_0xddc9('0x2d')](_0x27f537['attributes'],function(_0x48644f){var _0x2e4a5c={};_0x2e4a5c[_0x48644f]={'$like':'%'+_0x8aede1['query'][_0xddc9('0xb7')]+'%'};return _0x2e4a5c;})});}if(_0x8aede1[_0xddc9('0x39')][_0xddc9('0x7c')]){var _0x1b6b9f=_0x8aede1[_0xddc9('0x39')][_0xddc9('0x7c')][_0xddc9('0x30')](',');var _0x13a689={};_0x13a689[_0x1b6b9f[0x0]]={'$gte':moment(_0x1b6b9f[0x1])[_0xddc9('0xb8')](_0xddc9('0xb9'))};_0x27f537[_0xddc9('0x77')]=_[_0xddc9('0x99')](_0x27f537[_0xddc9('0x77')],_0x13a689);}_0x27f537=_['merge']({},_0x27f537,_0x8aede1[_0xddc9('0xaf')]);return db[_0xddc9('0xb2')][_0xddc9('0x1d')]({'where':_0x27f537[_0xddc9('0x77')]})[_0xddc9('0x24')](function(_0x2b2612){_0x34558d['count']=_0x2b2612;if(_0x8aede1['query'][_0xddc9('0xba')]){_0x27f537['include']=[{'all':!![]}];}return db[_0xddc9('0xb2')]['findAll'](_0x27f537);})[_0xddc9('0x24')](function(_0x200bba){_0x34558d['rows']=_0x200bba;return _0x34558d;});}})[_0xddc9('0x24')](respondWithFilteredResult(_0x2117d9,_0x27f537))[_0xddc9('0x33')](handleError(_0x2117d9,null));};exports['addTags']=function(_0x3f1e15,_0x11241e,_0x1371fb){return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x3f1e15[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x11241e,null))[_0xddc9('0x24')](function(_0x3cdebf){if(_0x3cdebf){return _0x3cdebf[_0xddc9('0xbb')](_0x3f1e15[_0xddc9('0x72')][_0xddc9('0xb5')],_[_0xddc9('0xb4')](_0x3f1e15[_0xddc9('0x72')],[_0xddc9('0xb5'),'id'])||{})[_0xddc9('0xbc')](function(){return db[_0xddc9('0x6c')][_0xddc9('0xbd')]({'attributes':['id','name',_0xddc9('0xbe')],'where':{'id':_0x3f1e15[_0xddc9('0x72')][_0xddc9('0xb5')]}});})['then'](function(_0x1e28d0){socket[_0xddc9('0xbf')](_0xddc9('0xc0'),{'id':Number(_0x3f1e15['params']['id']),'tags':_0x1e28d0||[]});return{'id':Number(_0x3f1e15[_0xddc9('0xae')]['id']),'tags':_0x1e28d0||[]};});}})['then'](respondWithResult(_0x11241e,null))[_0xddc9('0x33')](handleError(_0x11241e,null));};exports[_0xddc9('0xc1')]=function(_0x29b1e4,_0x51d628,_0x1802c6){return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0x29b1e4[_0xddc9('0xae')]['id']}})[_0xddc9('0x24')](handleEntityNotFound(_0x51d628,null))[_0xddc9('0x24')](function(_0x5bf33a){if(_0x5bf33a){return _0x5bf33a[_0xddc9('0xc1')](_0x29b1e4[_0xddc9('0x39')][_0xddc9('0xb5')]);}})[_0xddc9('0x24')](respondWithStatusCode(_0x51d628,null))[_0xddc9('0x33')](handleError(_0x51d628,null));};exports['download']=function(_0xf03c7c,_0x5995bb){var _0x3e7505=moment()[_0xddc9('0xc2')]()['toString']();var _0x2d8196=path[_0xddc9('0xc3')](config[_0xddc9('0xc4')],_0xddc9('0xc5'),_0xddc9('0xc6'),_0xddc9('0xc7'));var _0x52d8b4=path[_0xddc9('0xc3')](config[_0xddc9('0xc4')],'server',_0xddc9('0xc6'),'attachments');var _0x2c3494=path[_0xddc9('0xc3')](_0x2d8196,_0x3e7505);var _0x5dbfa7=util[_0xddc9('0xb8')]('transcript-%d-%s.zip',_0xf03c7c[_0xddc9('0xae')]['id'],_0x3e7505);var _0x12a867=path[_0xddc9('0xc3')](_0x2d8196,_0x5dbfa7);var _0x2ca08e=[];_0x2ca08e[_0xddc9('0xab')]({'model':db[_0xddc9('0x6f')],'as':'User','attributes':['id',_0xddc9('0x2e')],'raw':!![]});_0x2ca08e['push']({'model':db[_0xddc9('0xc8')],'as':'Contact','attributes':['id',_0xddc9('0xc9'),_0xddc9('0xca')],'raw':!![]});var _0x2bac27=[{'model':db[_0xddc9('0xb2')],'as':_0xddc9('0xcb'),'attributes':['id',_0xddc9('0x72'),_0xddc9('0x7a'),_0xddc9('0xcc'),_0xddc9('0xcd'),_0xddc9('0x80')],'include':_0x2ca08e}];_0x2bac27[_0xddc9('0xab')]({'model':db[_0xddc9('0xce')],'as':_0xddc9('0xcf'),'attributes':['id',_0xddc9('0x2a')]});_0x2bac27[_0xddc9('0xab')]({'model':db[_0xddc9('0x6f')],'as':_0xddc9('0xd0'),'attributes':['id',_0xddc9('0x2e')]});return db[_0xddc9('0x35')][_0xddc9('0x5b')]({'where':{'id':_0xf03c7c['params']['id']},'include':_0x2bac27})[_0xddc9('0x24')](handleEntityNotFound(_0x5995bb,null))[_0xddc9('0x24')](function(_0xef1456){if(_0xef1456){var _0x5e8abb=_0xef1456[_0xddc9('0xd1')]({'plain':!![]});fs['mkdirSync'](_0x2c3494);var _0x74c951={'channel':_0xddc9('0xd2'),'account':_0x5e8abb[_0xddc9('0xcf')][_0xddc9('0x2a')],'agent':_0x5e8abb[_0xddc9('0xd0')]?_0x5e8abb['Owner'][_0xddc9('0x2e')]:_0xddc9('0xd3'),'createdAt':moment(_0x5e8abb[_0xddc9('0x7a')])[_0xddc9('0xb8')](_0xddc9('0xb9'))[_0xddc9('0x97')](),'closedAt':_0x5e8abb[_0xddc9('0xd4')]?moment(_0x5e8abb[_0xddc9('0xd5')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xddc9('0x97')]():'','disposition':_0x5e8abb['disposition'],'messages':_(_0x5e8abb['Messages'])[_0xddc9('0xb7')]({'secret':![]})[_0xddc9('0x2d')](function(_0xfd502d){return{'date':moment(_0xfd502d[_0xddc9('0x7a')])['format'](_0xddc9('0xb9'))[_0xddc9('0x97')](),'sender':_0xfd502d['direction']==='out'?_0xfd502d[_0xddc9('0x6f')]?_0xfd502d['User'][_0xddc9('0x2e')]:_0xddc9('0xd6'):_0xfd502d[_0xddc9('0x60')][_0xddc9('0xc9')]+(_0xfd502d[_0xddc9('0x60')][_0xddc9('0xca')]?'\x20'+_0xfd502d['Contact'][_0xddc9('0xca')]:''),'body':_0xfd502d[_0xddc9('0x72')],'direction':_0xfd502d[_0xddc9('0xcc')]===_0xddc9('0xd7')?'A':'C','secret':_0xfd502d['secret'],'read':_0xfd502d[_0xddc9('0x80')]};})['value']()};return ejs[_0xddc9('0xd8')](path[_0xddc9('0xc3')](config['root'],_0xddc9('0xc5'),_0xddc9('0xd9'),'downloadInteraction.ejs'),{'interaction':_0x74c951})['then'](function(_0x104b7e){var _0x8a3203=path[_0xddc9('0xc3')](_0x2c3494,'transcript-'+_0x5e8abb['id']+'-'+_0x3e7505+_0xddc9('0xda'));var _0x67ce6b={'path':_0x8a3203,'channel':'Sms','interactionId':_0x5e8abb['id']};return pdf['createPdfFromHTML'](_0x104b7e,_0x67ce6b);})[_0xddc9('0x24')](function(){return new BPromise(function(_0x1d6225,_0x460f2a){zipdir(_0x2c3494,{'saveTo':_0x12a867},function(_0x398656,_0x261b88){if(_0x398656)return _0x460f2a(_0x398656);return _0x1d6225(_0x261b88);});})[_0xddc9('0x24')](function(){return new BPromise(function(_0x378cf8,_0x5acf12){rimraf(_0x2c3494,function(_0x222774){if(_0x222774)_0x5acf12(_0x222774);return _0x378cf8();});});})['then'](function(){return _0x5995bb[_0xddc9('0xdb')](_0x12a867,_0x5dbfa7,function(_0x528e95){if(_0x528e95){console[_0xddc9('0xdc')]('err',_0x528e95);}else{fs['unlinkSync'](_0x12a867);}});});});}else{return _0x5995bb[_0xddc9('0x27')](0xc8);}})['catch'](handleError(_0x5995bb,null));};
\ No newline at end of file
index 4541d01..bb8f413 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch','hook','events','SmsInteraction','../../mysqldb','SmsMessage','save','update'];(function(_0x287309,_0x5951be){var _0x4dc807=function(_0x128f03){while(--_0x128f03){_0x287309['push'](_0x287309['shift']());}};_0x4dc807(++_0x5951be);}(_0xb10b,0x12a));var _0xbb10=function(_0x25a136,_0x57320e){_0x25a136=_0x25a136-0x0;var _0x5b7159=_0xb10b[_0x25a136];return _0x5b7159;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xbb10('0x1')];var SmsMessage=require(_0xbb10('0x2'))['db'][_0xbb10('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbb10('0x4'),'afterUpdate':_0xbb10('0x5'),'afterDestroy':_0xbb10('0x6')};function emitEvent(_0x22320e){return function(_0x49baf4,_0x312b72,_0x481979){_0x49baf4[_0xbb10('0x7')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x8')](function(_0x513741){_0x49baf4[_0xbb10('0x9')](_0xbb10('0xa'),_0x513741[_0xbb10('0xb')](function(_0x1c3ee5){return{'id':_0x1c3ee5['id']};}));return SmsMessage[_0xbb10('0xc')]({'where':{'SmsInteractionId':_0x49baf4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb10('0x8')](function(_0x229887){_0x49baf4[_0xbb10('0x9')]('unreadMessages',_0x229887['length']);SmsInteractionEvents[_0xbb10('0xd')](_0x22320e+':'+_0x49baf4['id'],_0x49baf4);SmsInteractionEvents[_0xbb10('0xd')](_0x22320e,_0x49baf4);_0x481979(null);})[_0xbb10('0xe')](_0x481979(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xbb10('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
+var _0x1a85=['then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','../../mysqldb','SmsMessage','update','remove','getUsers','setDataValue','map'];(function(_0x59d337,_0x52ada3){var _0x13788c=function(_0x3741f8){while(--_0x3741f8){_0x59d337['push'](_0x59d337['shift']());}};_0x13788c(++_0x52ada3);}(_0x1a85,0x178));var _0x51a8=function(_0x5eb442,_0xe2ae2e){_0x5eb442=_0x5eb442-0x0;var _0x53aad0=_0x1a85[_0x5eb442];return _0x53aad0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x51a8('0x0')];var SmsMessage=require(_0x51a8('0x1'))['db'][_0x51a8('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x51a8('0x3'),'afterDestroy':_0x51a8('0x4')};function emitEvent(_0x99e371){return function(_0x48a21b,_0xaac0bf,_0x4b76a8){_0x48a21b[_0x51a8('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x331117){_0x48a21b[_0x51a8('0x6')]('Users',_0x331117[_0x51a8('0x7')](function(_0x513685){return{'id':_0x513685['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x48a21b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x51a8('0x8')](function(_0x2f276b){_0x48a21b[_0x51a8('0x6')](_0x51a8('0x9'),_0x2f276b[_0x51a8('0xa')]);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371+':'+_0x48a21b['id'],_0x48a21b);SmsInteractionEvents[_0x51a8('0xb')](_0x99e371,_0x48a21b);_0x4b76a8(null);})[_0x51a8('0xc')](_0x4b76a8(null));};}for(var e in events){if(events[_0x51a8('0xd')](e)){var event=events[e];SmsInteraction[_0x51a8('0xe')](e,emitEvent(event));}}module[_0x51a8('0xf')]=SmsInteractionEvents;
\ No newline at end of file
index d6f914b..79ebbee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d29=['changed','closedAt','format','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x6d29,0x17a));var _0x96d2=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0x6d29[_0x1757f2];return _0x5e7212;};'use strict';var _=require(_0x96d2('0x0'));var util=require(_0x96d2('0x1'));var logger=require(_0x96d2('0x2'))('api');var moment=require(_0x96d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x96d2('0x4'));var rimraf=require(_0x96d2('0x5'));var config=require(_0x96d2('0x6'));var attributes=require(_0x96d2('0x7'));module[_0x96d2('0x8')]=function(_0x3a9cbd,_0x313093){return _0x3a9cbd[_0x96d2('0x9')](_0x96d2('0xa'),attributes,{'tableName':_0x96d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4346c5,_0x343372,_0x6b8731){if(_0x4346c5[_0x96d2('0xc')]('closed')){_0x4346c5[_0x96d2('0xd')]=moment()[_0x96d2('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x6b8731(null,_0x4346c5);}}});};
\ No newline at end of file
+var _0x468e=['exports','SmsInteraction','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x3c96bd,_0x2186eb){var _0x2a2031=function(_0x44d993){while(--_0x44d993){_0x3c96bd['push'](_0x3c96bd['shift']());}};_0x2a2031(++_0x2186eb);}(_0x468e,0x192));var _0xe468=function(_0x388968,_0x109483){_0x388968=_0x388968-0x0;var _0x80c874=_0x468e[_0x388968];return _0x80c874;};'use strict';var _=require('lodash');var util=require(_0xe468('0x0'));var logger=require(_0xe468('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe468('0x2'));var fs=require('fs');var path=require(_0xe468('0x3'));var rimraf=require(_0xe468('0x4'));var config=require(_0xe468('0x5'));var attributes=require('./smsInteraction.attributes');module[_0xe468('0x6')]=function(_0xf15b62,_0x347139){return _0xf15b62['define'](_0xe468('0x7'),attributes,{'tableName':_0xe468('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x349493,_0x3cdfcd,_0x53df38){if(_0x349493['changed'](_0xe468('0x9'))){_0x349493['closedAt']=moment()[_0xe468('0xa')](_0xe468('0xb'));}_0x53df38(null,_0x349493);}}});};
\ No newline at end of file
index 1079d3e..8399ba1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde7b=['find','where','ids','omit','spread','AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','limit','catch'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0xde7b,0x1a8));var _0xbde7=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xde7b[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require('lodash');var util=require(_0xbde7('0x0'));var moment=require('moment');var BPromise=require(_0xbde7('0x1'));var rs=require(_0xbde7('0x2'));var fs=require('fs');var Redis=require(_0xbde7('0x3'));var db=require(_0xbde7('0x4'))['db'];var utils=require(_0xbde7('0x5'));var logger=require(_0xbde7('0x6'))(_0xbde7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbde7('0x8')][_0xbde7('0x9')]({'port':0x232a});config['redis']=_[_0xbde7('0xa')](config[_0xbde7('0xb')],{'host':_0xbde7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbde7('0xb')]));require(_0xbde7('0xd'))[_0xbde7('0xe')](socket);function respondWithRpcPromise(_0x5c0c08,_0x22d5f4,_0xbbf4cc){return new BPromise(function(_0x4141b8,_0x5d57c9){return client['request'](_0x5c0c08,_0xbbf4cc)[_0xbde7('0xf')](function(_0x2d1c33){logger[_0xbde7('0x10')](_0xbde7('0x11'),_0x22d5f4,'request\x20sent');logger[_0xbde7('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x22d5f4,'request\x20sent',JSON[_0xbde7('0x13')](_0x2d1c33));if(_0x2d1c33['error']){if(_0x2d1c33['error'][_0xbde7('0x14')]===0x1f4){logger[_0xbde7('0x15')](_0xbde7('0x11'),_0x22d5f4,_0x2d1c33[_0xbde7('0x15')][_0xbde7('0x16')]);return _0x5d57c9(_0x2d1c33[_0xbde7('0x15')]['message']);}logger[_0xbde7('0x15')](_0xbde7('0x11'),_0x22d5f4,_0x2d1c33[_0xbde7('0x15')][_0xbde7('0x16')]);return _0x4141b8(_0x2d1c33['error'][_0xbde7('0x16')]);}else{logger['info'](_0xbde7('0x11'),_0x22d5f4,_0xbde7('0x17'));_0x4141b8(_0x2d1c33['result'][_0xbde7('0x16')]);}})['catch'](function(_0xb63bd){logger[_0xbde7('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x22d5f4,_0xb63bd);_0x5d57c9(_0xb63bd);});});}exports[_0xbde7('0x18')]=function(_0x113c6c){var _0x419d40=this;return new Promise(function(_0x4e6ab6,_0x122984){return db[_0xbde7('0x19')][_0xbde7('0x1a')](_0x113c6c[_0xbde7('0x1b')],{'raw':_0x113c6c[_0xbde7('0x1c')]?_0x113c6c['options'][_0xbde7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x113c6c['options']?_0x113c6c['options']['where']||null:null,'attributes':_0x113c6c[_0xbde7('0x1c')]?_0x113c6c[_0xbde7('0x1c')]['attributes']||null:null,'limit':_0x113c6c[_0xbde7('0x1c')]?_0x113c6c[_0xbde7('0x1c')][_0xbde7('0x1e')]||null:null})['then'](function(_0x423c68){logger[_0xbde7('0x10')](_0xbde7('0x18'),_0x113c6c);logger[_0xbde7('0x12')](_0xbde7('0x18'),_0x113c6c,JSON['stringify'](_0x423c68));_0x4e6ab6(_0x423c68);})[_0xbde7('0x1f')](function(_0x6d2377){logger[_0xbde7('0x15')]('UpdateSmsInteraction',_0x6d2377[_0xbde7('0x16')],_0x113c6c);_0x122984(_0x419d40[_0xbde7('0x15')](0x1f4,_0x6d2377[_0xbde7('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x4b04f8){return new Promise(function(_0x207182,_0xa3b1c9){return db[_0xbde7('0x19')][_0xbde7('0x20')]({'where':_0x4b04f8['options']?_0x4b04f8[_0xbde7('0x1c')][_0xbde7('0x21')]||null:null})[_0xbde7('0xf')](function(_0x31de14){if(_0x31de14){return _0x31de14['addTags'](_0x4b04f8[_0xbde7('0x1b')][_0xbde7('0x22')],_[_0xbde7('0x23')](_0x4b04f8[_0xbde7('0x1b')],[_0xbde7('0x22'),'id'])||{});}})[_0xbde7('0x24')](function(_0x58309e){logger[_0xbde7('0x10')](_0xbde7('0x25'),_0x4b04f8);logger['debug'](_0xbde7('0x25'),_0x4b04f8,JSON[_0xbde7('0x13')](_0x58309e));_0x207182(_0x58309e);})['catch'](function(_0x26c520){logger[_0xbde7('0x15')](_0xbde7('0x25'),_0x26c520['message'],_0x4b04f8);_0xa3b1c9(_this[_0xbde7('0x15')](0x1f4,_0x26c520[_0xbde7('0x16')]));});});};
\ No newline at end of file
+var _0x46e3=['UpdateSmsInteraction','SmsInteraction','update','body','options','raw','limit','then','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','defaults','redis','localhost','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x4f1355,_0x5ac744){var _0x268b56=function(_0x22df19){while(--_0x22df19){_0x4f1355['push'](_0x4f1355['shift']());}};_0x268b56(++_0x5ac744);}(_0x46e3,0xab));var _0x346e=function(_0x3b4ac1,_0x4dd126){_0x3b4ac1=_0x3b4ac1-0x0;var _0x58401d=_0x46e3[_0x3b4ac1];return _0x58401d;};'use strict';var _=require(_0x346e('0x0'));var util=require(_0x346e('0x1'));var moment=require(_0x346e('0x2'));var BPromise=require(_0x346e('0x3'));var rs=require(_0x346e('0x4'));var fs=require('fs');var Redis=require(_0x346e('0x5'));var db=require(_0x346e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x346e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x346e('0x8')]['http']({'port':0x232a});config['redis']=_[_0x346e('0x9')](config[_0x346e('0xa')],{'host':_0x346e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x346e('0xa')]));require(_0x346e('0xc'))[_0x346e('0xd')](socket);function respondWithRpcPromise(_0x55b410,_0x38b633,_0x49d521){return new BPromise(function(_0x4feb0e,_0x704b85){return client[_0x346e('0xe')](_0x55b410,_0x49d521)['then'](function(_0x4faacb){logger[_0x346e('0xf')](_0x346e('0x10'),_0x38b633,_0x346e('0x11'));logger[_0x346e('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x38b633,_0x346e('0x11'),JSON[_0x346e('0x13')](_0x4faacb));if(_0x4faacb[_0x346e('0x14')]){if(_0x4faacb[_0x346e('0x14')][_0x346e('0x15')]===0x1f4){logger[_0x346e('0x14')](_0x346e('0x10'),_0x38b633,_0x4faacb[_0x346e('0x14')][_0x346e('0x16')]);return _0x704b85(_0x4faacb[_0x346e('0x14')][_0x346e('0x16')]);}logger[_0x346e('0x14')](_0x346e('0x10'),_0x38b633,_0x4faacb['error'][_0x346e('0x16')]);return _0x4feb0e(_0x4faacb[_0x346e('0x14')][_0x346e('0x16')]);}else{logger[_0x346e('0xf')](_0x346e('0x10'),_0x38b633,'request\x20sent');_0x4feb0e(_0x4faacb['result'][_0x346e('0x16')]);}})[_0x346e('0x17')](function(_0x591f06){logger[_0x346e('0x14')](_0x346e('0x10'),_0x38b633,_0x591f06);_0x704b85(_0x591f06);});});}exports[_0x346e('0x18')]=function(_0x40189b){var _0x53b0e7=this;return new Promise(function(_0x330dc6,_0x233863){return db[_0x346e('0x19')][_0x346e('0x1a')](_0x40189b[_0x346e('0x1b')],{'raw':_0x40189b[_0x346e('0x1c')]?_0x40189b[_0x346e('0x1c')][_0x346e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40189b[_0x346e('0x1c')]?_0x40189b[_0x346e('0x1c')]['where']||null:null,'attributes':_0x40189b[_0x346e('0x1c')]?_0x40189b['options']['attributes']||null:null,'limit':_0x40189b[_0x346e('0x1c')]?_0x40189b[_0x346e('0x1c')][_0x346e('0x1e')]||null:null})[_0x346e('0x1f')](function(_0x432aa1){logger['info'](_0x346e('0x18'),_0x40189b);logger[_0x346e('0x12')](_0x346e('0x18'),_0x40189b,JSON[_0x346e('0x13')](_0x432aa1));_0x330dc6(_0x432aa1);})[_0x346e('0x17')](function(_0x319295){logger[_0x346e('0x14')]('UpdateSmsInteraction',_0x319295[_0x346e('0x16')],_0x40189b);_0x233863(_0x53b0e7[_0x346e('0x14')](0x1f4,_0x319295['message']));});});};exports['AddTagsToSmsInteraction']=function(_0x256895){return new Promise(function(_0x516dfc,_0xd693c2){return db['SmsInteraction'][_0x346e('0x20')]({'where':_0x256895['options']?_0x256895[_0x346e('0x1c')][_0x346e('0x21')]||null:null})[_0x346e('0x1f')](function(_0x42bbe5){if(_0x42bbe5){return _0x42bbe5[_0x346e('0x22')](_0x256895[_0x346e('0x1b')][_0x346e('0x23')],_[_0x346e('0x24')](_0x256895[_0x346e('0x1b')],['ids','id'])||{});}})[_0x346e('0x25')](function(_0x4e9e03){logger['info']('AddTags',_0x256895);logger[_0x346e('0x12')](_0x346e('0x26'),_0x256895,JSON[_0x346e('0x13')](_0x4e9e03));_0x516dfc(_0x4e9e03);})[_0x346e('0x17')](function(_0x439526){logger[_0x346e('0x14')](_0x346e('0x26'),_0x439526[_0x346e('0x16')],_0x256895);_0xd693c2(_this['error'](0x1f4,_0x439526[_0x346e('0x16')]));});});};
\ No newline at end of file
index 04d5064..ba3d0c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e18=['length','smsInteraction:','save','remove','update','emit'];(function(_0x279ce4,_0x13a3c8){var _0x3e8bcd=function(_0x122463){while(--_0x122463){_0x279ce4['push'](_0x279ce4['shift']());}};_0x3e8bcd(++_0x13a3c8);}(_0x6e18,0x194));var _0x86e1=function(_0x1fb285,_0x35224e){_0x1fb285=_0x1fb285-0x0;var _0x54a868=_0x6e18[_0x1fb285];return _0x54a868;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x86e1('0x0'),_0x86e1('0x1'),_0x86e1('0x2')];function createListener(_0x50c1a2,_0xc50fae){return function(_0x3e9a2c){_0xc50fae[_0x86e1('0x3')](_0x50c1a2,_0x3e9a2c);};}function removeListener(_0x426643,_0x38cdcd){return function(){SmsInteractionEvents['removeListener'](_0x426643,_0x38cdcd);};}exports['register']=function(_0x3dbc08){for(var _0x5d8add=0x0,_0x5f47d1=events[_0x86e1('0x4')];_0x5d8add<_0x5f47d1;_0x5d8add++){var _0x14c144=events[_0x5d8add];var _0x36c434=createListener(_0x86e1('0x5')+_0x14c144,_0x3dbc08);SmsInteractionEvents['on'](_0x14c144,_0x36c434);}};
\ No newline at end of file
+var _0xf3e2=['smsInteraction:','./smsInteraction.events','save','remove','update','removeListener','register'];(function(_0x110a17,_0x26d8e9){var _0x58c4bf=function(_0x36a3ce){while(--_0x36a3ce){_0x110a17['push'](_0x110a17['shift']());}};_0x58c4bf(++_0x26d8e9);}(_0xf3e2,0x16d));var _0x2f3e=function(_0x186861,_0x2311c7){_0x186861=_0x186861-0x0;var _0x5be31f=_0xf3e2[_0x186861];return _0x5be31f;};'use strict';var SmsInteractionEvents=require(_0x2f3e('0x0'));var events=[_0x2f3e('0x1'),_0x2f3e('0x2'),_0x2f3e('0x3')];function createListener(_0x53006d,_0x31f715){return function(_0x2dd6ed){_0x31f715['emit'](_0x53006d,_0x2dd6ed);};}function removeListener(_0x39a9f7,_0x5e23cf){return function(){SmsInteractionEvents[_0x2f3e('0x4')](_0x39a9f7,_0x5e23cf);};}exports[_0x2f3e('0x5')]=function(_0x10640c){for(var _0x21db26=0x0,_0x512895=events['length'];_0x21db26<_0x512895;_0x21db26++){var _0x385248=events[_0x21db26];var _0x9fc7a1=createListener(_0x2f3e('0x6')+_0x385248,_0x10640c);SmsInteractionEvents['on'](_0x385248,_0x9fc7a1);}};
\ No newline at end of file
index 8d2f9b0..1800e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cf5=['show','post','create','/:id/status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/:id'];(function(_0x368806,_0x56fb58){var _0x583624=function(_0x3e07e1){while(--_0x3e07e1){_0x368806['push'](_0x368806['shift']());}};_0x583624(++_0x56fb58);}(_0x3cf5,0xa6));var _0x53cf=function(_0x5f2368,_0x29c539){_0x5f2368=_0x5f2368-0x0;var _0x11d9a3=_0x3cf5[_0x5f2368];return _0x11d9a3;};'use strict';var multer=require(_0x53cf('0x0'));var util=require(_0x53cf('0x1'));var path=require('path');var timeout=require(_0x53cf('0x2'));var express=require(_0x53cf('0x3'));var router=express[_0x53cf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x53cf('0x5'));var config=require('../../config/environment');var controller=require(_0x53cf('0x6'));router[_0x53cf('0x7')]('/',auth[_0x53cf('0x8')](),controller['index']);router['get']('/describe',auth[_0x53cf('0x8')](),controller['describe']);router[_0x53cf('0x7')](_0x53cf('0x9'),auth[_0x53cf('0x8')](),controller[_0x53cf('0xa')]);router[_0x53cf('0xb')]('/',auth[_0x53cf('0x8')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x53cf('0xc')]);router[_0x53cf('0xb')](_0x53cf('0xd'),controller['status']);router[_0x53cf('0xe')](_0x53cf('0x9'),auth[_0x53cf('0x8')](),controller[_0x53cf('0xf')]);router[_0x53cf('0xe')](_0x53cf('0x10'),auth['isAuthenticated'](),controller[_0x53cf('0x11')]);router[_0x53cf('0xe')]('/:id/reject',auth[_0x53cf('0x8')](),controller[_0x53cf('0x12')]);router[_0x53cf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x53cf('0x14')]);module[_0x53cf('0x15')]=router;
\ No newline at end of file
+var _0x5205=['post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2c6d2c,_0x3b8054){var _0x1a69a8=function(_0x308088){while(--_0x308088){_0x2c6d2c['push'](_0x2c6d2c['shift']());}};_0x1a69a8(++_0x3b8054);}(_0x5205,0x1e1));var _0x5520=function(_0xc93377,_0x1252e9){_0xc93377=_0xc93377-0x0;var _0x552e70=_0x5205[_0xc93377];return _0x552e70;};'use strict';var multer=require(_0x5520('0x0'));var util=require(_0x5520('0x1'));var path=require('path');var timeout=require(_0x5520('0x2'));var express=require(_0x5520('0x3'));var router=express['Router']();var fs_extra=require(_0x5520('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5520('0x5'));var config=require(_0x5520('0x6'));var controller=require('./smsMessage.controller');router[_0x5520('0x7')]('/',auth[_0x5520('0x8')](),controller[_0x5520('0x9')]);router[_0x5520('0x7')](_0x5520('0xa'),auth['isAuthenticated'](),controller[_0x5520('0xb')]);router[_0x5520('0x7')](_0x5520('0xc'),auth[_0x5520('0x8')](),controller['show']);router[_0x5520('0xd')]('/',auth[_0x5520('0x8')](),interaction[_0x5520('0xe')](_0x5520('0xf'),_0x5520('0x10')),controller[_0x5520('0x11')]);router[_0x5520('0xd')](_0x5520('0x12'),controller['status']);router[_0x5520('0x13')](_0x5520('0xc'),auth['isAuthenticated'](),controller[_0x5520('0x14')]);router['put'](_0x5520('0x15'),auth[_0x5520('0x8')](),controller[_0x5520('0x16')]);router['put']('/:id/reject',auth[_0x5520('0x8')](),controller[_0x5520('0x17')]);router[_0x5520('0x18')](_0x5520('0xc'),auth[_0x5520('0x8')](),controller[_0x5520('0x19')]);module['exports']=router;
\ No newline at end of file
index 12777c1..e828098 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1979=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x1979,0xa2));var _0x9197=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0x1979[_0x1fa841];return _0x384b67;};'use strict';var Sequelize=require(_0x9197('0x0'));module['exports']={'body':{'type':Sequelize[_0x9197('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9197('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9197('0x3')]('in',_0x9197('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9197('0x5')]},'readAt':{'type':Sequelize[_0x9197('0x6')]},'secret':{'type':Sequelize[_0x9197('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9197('0x1')]}};
\ No newline at end of file
+var _0xcd3a=['out','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd3a,0x8e));var _0xacd3=function(_0x20b0e4,_0x892547){_0x20b0e4=_0x20b0e4-0x0;var _0x286eee=_0xcd3a[_0x20b0e4];return _0x286eee;};'use strict';var Sequelize=require('sequelize');module[_0xacd3('0x0')]={'body':{'type':Sequelize[_0xacd3('0x1')](_0xacd3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xacd3('0x4')]('in',_0xacd3('0x5')),'defaultValue':_0xacd3('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xacd3('0x6')](0xbe)},'phone':{'type':Sequelize[_0xacd3('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xacd3('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xacd3('0x6')]},'providerResponse':{'type':Sequelize[_0xacd3('0x1')]}};
\ No newline at end of file
index 3930979..b880822 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','stack','name','index','SmsMessage','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','length','includeAll','find','create','body','destroy','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','reject','SmsInteractionId','null','RejectMessage','rejectMessage','email','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','MessageUUID','indexOf','delivered','Status','plivio','infobip','results','groupName','DELIVERED','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xb763f9,_0x160cf9){var _0x244376=function(_0x5bd2ca){while(--_0x5bd2ca){_0xb763f9['push'](_0xb763f9['shift']());}};_0x244376(++_0x160cf9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];config['redis']=_['defaults'](config[_0x3071('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x3071('0x1c'))(new Redis(config[_0x3071('0x1b')]));require('./smsMessage.socket')[_0x3071('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3071('0x1e')][_0x3071('0x1f')]({'port':0x232c});var client9002=jayson[_0x3071('0x1e')][_0x3071('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1caa5d,_0x2a6a4b,_0x157a47,_0x11bdc9){return new BPromise(function(_0x21aad3,_0x344ea6){var _0x5f3c22=_0x11bdc9||client;return _0x5f3c22[_0x3071('0x20')](_0x1caa5d,_0x157a47)[_0x3071('0x21')](function(_0x1068d9){logger[_0x3071('0x22')](_0x3071('0x23'),_0x2a6a4b,_0x3071('0x24'));logger[_0x3071('0x25')](_0x3071('0x26'),_0x2a6a4b,'request\x20sent',JSON[_0x3071('0x27')](_0x1068d9));if(_0x1068d9[_0x3071('0x28')]){if(_0x1068d9[_0x3071('0x28')]['code']===0x1f4){logger[_0x3071('0x28')]('SmsMessage,\x20%s,\x20%s',_0x2a6a4b,_0x1068d9[_0x3071('0x28')][_0x3071('0x29')]);return _0x344ea6(_0x1068d9[_0x3071('0x28')][_0x3071('0x29')]);}logger[_0x3071('0x28')](_0x3071('0x23'),_0x2a6a4b,_0x1068d9[_0x3071('0x28')][_0x3071('0x29')]);return _0x21aad3(_0x1068d9['error']['message']);}else{logger[_0x3071('0x22')](_0x3071('0x23'),_0x2a6a4b,_0x3071('0x24'));_0x21aad3(_0x1068d9[_0x3071('0x2a')][_0x3071('0x29')]);}})[_0x3071('0x2b')](function(_0x7a4cb4){logger[_0x3071('0x28')](_0x3071('0x23'),_0x2a6a4b,_0x7a4cb4);_0x344ea6(_0x7a4cb4);});});}function respondWithStatusCode(_0x4c7130,_0x2e5f93){_0x2e5f93=_0x2e5f93||0xcc;return function(_0x3f1e6e){if(_0x3f1e6e){return _0x4c7130[_0x3071('0x2c')](_0x2e5f93);}return _0x4c7130['status'](_0x2e5f93)[_0x3071('0x2d')]();};}function respondWithResult(_0x28792d,_0x163604){_0x163604=_0x163604||0xc8;return function(_0x950fde){if(_0x950fde){return _0x28792d[_0x3071('0x2e')](_0x163604)[_0x3071('0x2f')](_0x950fde);}};}function respondWithFilteredResult(_0x177b5f,_0x3921a1){return function(_0x32f1b4){if(_0x32f1b4){var _0x292205=typeof _0x3921a1[_0x3071('0x30')]==='undefined'&&typeof _0x3921a1['limit']===_0x3071('0x31');var _0x149e0d=_0x32f1b4[_0x3071('0x32')];var _0x40be95=_0x292205?0x0:_0x3921a1[_0x3071('0x30')];var _0x29538c=_0x292205?_0x32f1b4[_0x3071('0x32')]:_0x3921a1[_0x3071('0x30')]+_0x3921a1['limit'];var _0x55d230;if(_0x29538c>=_0x149e0d){_0x29538c=_0x149e0d;_0x55d230=0xc8;}else{_0x55d230=0xce;}_0x177b5f['status'](_0x55d230);return _0x177b5f[_0x3071('0x33')](_0x3071('0x34'),_0x40be95+'-'+_0x29538c+'/'+_0x149e0d)['json'](_0x32f1b4);}return null;};}function patchUpdates(_0x17407a){return function(_0x28747d){try{jsonpatch[_0x3071('0x35')](_0x28747d,_0x17407a,!![]);}catch(_0x13ae2c){return BPromise['reject'](_0x13ae2c);}return _0x28747d[_0x3071('0x36')]();};}function saveUpdates(_0x1525df,_0x602719){return function(_0x240443){if(_0x240443){return _0x240443[_0x3071('0x37')](_0x1525df)[_0x3071('0x21')](function(_0x3c55c){return _0x3c55c;});}return null;};}function removeEntity(_0x148f7a,_0x596cc3){return function(_0x3988eb){if(_0x3988eb){return _0x3988eb['destroy']()['then'](function(){_0x148f7a[_0x3071('0x2e')](0xcc)[_0x3071('0x2d')]();});}};}function handleEntityNotFound(_0x54d9c3,_0x2e85c8){return function(_0x46e94e){if(!_0x46e94e){_0x54d9c3[_0x3071('0x2c')](0x194);}return _0x46e94e;};}function handleError(_0x14ac42,_0xc60572){_0xc60572=_0xc60572||0x1f4;return function(_0x232235){logger['error'](_0x232235[_0x3071('0x38')]);if(_0x232235[_0x3071('0x39')]){delete _0x232235['name'];}_0x14ac42[_0x3071('0x2e')](_0xc60572)['send'](_0x232235);};}exports[_0x3071('0x3a')]=function(_0x43133a,_0x5733e9){var _0x593c99={},_0x283074={},_0x185f63={'count':0x0,'rows':[]};var _0x569171=_['map'](db[_0x3071('0x3b')]['rawAttributes'],function(_0x1ac90a){return{'name':_0x1ac90a['fieldName'],'type':_0x1ac90a[_0x3071('0x3c')][_0x3071('0x3d')]};});_0x283074[_0x3071('0x3e')]=_[_0x3071('0x3f')](_0x569171,_0x3071('0x39'));_0x283074['query']=_['keys'](_0x43133a[_0x3071('0x40')]);_0x283074[_0x3071('0x41')]=_[_0x3071('0x42')](_0x283074[_0x3071('0x3e')],_0x283074['query']);_0x593c99[_0x3071('0x43')]=_[_0x3071('0x42')](_0x283074[_0x3071('0x3e')],qs[_0x3071('0x44')](_0x43133a[_0x3071('0x40')][_0x3071('0x44')]));_0x593c99['attributes']=_0x593c99[_0x3071('0x43')]['length']?_0x593c99['attributes']:_0x283074['model'];if(!_0x43133a['query'][_0x3071('0x45')](_0x3071('0x46'))){_0x593c99[_0x3071('0x47')]=qs[_0x3071('0x47')](_0x43133a[_0x3071('0x40')][_0x3071('0x47')]);_0x593c99[_0x3071('0x30')]=qs[_0x3071('0x30')](_0x43133a['query'][_0x3071('0x30')]);}_0x593c99[_0x3071('0x48')]=qs[_0x3071('0x49')](_0x43133a[_0x3071('0x40')][_0x3071('0x49')]);_0x593c99['where']=qs['filters'](_[_0x3071('0x4a')](_0x43133a[_0x3071('0x40')],_0x283074[_0x3071('0x41')]),_0x569171);if(_0x43133a[_0x3071('0x40')][_0x3071('0x4b')]){_0x593c99['where']=_[_0x3071('0x4c')](_0x593c99['where'],{'$or':_[_0x3071('0x3f')](_0x569171,function(_0x509178){if(_0x509178['type']!==_0x3071('0x4d')){var _0x57979e={};_0x57979e[_0x509178[_0x3071('0x39')]]={'$like':'%'+_0x43133a['query'][_0x3071('0x4b')]+'%'};return _0x57979e;}})});}_0x593c99=_[_0x3071('0x4c')]({},_0x593c99,_0x43133a[_0x3071('0x4e')]);var _0x25d752={'where':_0x593c99['where']};return db[_0x3071('0x3b')]['count'](_0x25d752)[_0x3071('0x21')](function(_0x4b6bbb){_0x185f63[_0x3071('0x32')]=_0x4b6bbb;if(_0x43133a[_0x3071('0x40')]['includeAll']){_0x593c99[_0x3071('0x4f')]=[{'all':!![]}];}return db[_0x3071('0x3b')][_0x3071('0x50')](_0x593c99);})[_0x3071('0x21')](function(_0x349adb){_0x185f63[_0x3071('0x51')]=_0x349adb;return _0x185f63;})[_0x3071('0x21')](respondWithFilteredResult(_0x5733e9,_0x593c99))['catch'](handleError(_0x5733e9,null));};exports[_0x3071('0x52')]=function(_0x486b7a,_0x443b0e){var _0xda07a4={'raw':!![],'where':{'id':_0x486b7a[_0x3071('0x53')]['id']}},_0x4f676e={};_0x4f676e[_0x3071('0x3e')]=_[_0x3071('0x54')](db[_0x3071('0x3b')][_0x3071('0x55')]);_0x4f676e[_0x3071('0x40')]=_[_0x3071('0x54')](_0x486b7a[_0x3071('0x40')]);_0x4f676e[_0x3071('0x41')]=_[_0x3071('0x42')](_0x4f676e[_0x3071('0x3e')],_0x4f676e[_0x3071('0x40')]);_0xda07a4[_0x3071('0x43')]=_[_0x3071('0x42')](_0x4f676e[_0x3071('0x3e')],qs[_0x3071('0x44')](_0x486b7a['query']['fields']));_0xda07a4[_0x3071('0x43')]=_0xda07a4['attributes'][_0x3071('0x56')]?_0xda07a4[_0x3071('0x43')]:_0x4f676e[_0x3071('0x3e')];if(_0x486b7a['query'][_0x3071('0x57')]){_0xda07a4[_0x3071('0x4f')]=[{'all':!![]}];}_0xda07a4=_['merge']({},_0xda07a4,_0x486b7a['options']);return db[_0x3071('0x3b')][_0x3071('0x58')](_0xda07a4)[_0x3071('0x21')](handleEntityNotFound(_0x443b0e,null))[_0x3071('0x21')](respondWithResult(_0x443b0e,null))['catch'](handleError(_0x443b0e,null));};exports[_0x3071('0x59')]=function(_0xeae1f,_0x3f2edc){return db[_0x3071('0x3b')][_0x3071('0x59')](_0xeae1f['body'],{})[_0x3071('0x21')](respondWithResult(_0x3f2edc,0xc9))[_0x3071('0x2b')](handleError(_0x3f2edc,null));};exports[_0x3071('0x37')]=function(_0x27bad1,_0x12d6be){if(_0x27bad1[_0x3071('0x5a')]['id']){delete _0x27bad1[_0x3071('0x5a')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x27bad1[_0x3071('0x53')]['id']}})['then'](handleEntityNotFound(_0x12d6be,null))[_0x3071('0x21')](saveUpdates(_0x27bad1[_0x3071('0x5a')],null))['then'](respondWithResult(_0x12d6be,null))[_0x3071('0x2b')](handleError(_0x12d6be,null));};exports[_0x3071('0x5b')]=function(_0x4d3886,_0x108b14){return db[_0x3071('0x3b')][_0x3071('0x58')]({'where':{'id':_0x4d3886[_0x3071('0x53')]['id']}})[_0x3071('0x21')](handleEntityNotFound(_0x108b14,null))['then'](removeEntity(_0x108b14,null))[_0x3071('0x2b')](handleError(_0x108b14,null));};exports[_0x3071('0x5c')]=function(_0x19252f,_0x48ee42){return db[_0x3071('0x3b')][_0x3071('0x5c')]()[_0x3071('0x21')](respondWithResult(_0x48ee42,null))[_0x3071('0x2b')](handleError(_0x48ee42,null));};var interaction_log=require(_0x3071('0x5d'))(_0x3071('0x5e'));exports[_0x3071('0x5f')]=function(_0x2e39ff,_0x3b47e8,_0x5cb3b3){var _0x5d1316={'agent':{},'channel':_0x3071('0x60')};if(_0x2e39ff[_0x3071('0x5a')]['id']){delete _0x2e39ff[_0x3071('0x5a')]['id'];}_0x2e39ff[_0x3071('0x5a')][_0x3071('0x61')]=!![];_0x2e39ff[_0x3071('0x5a')][_0x3071('0x62')]=moment()[_0x3071('0x63')](_0x3071('0x64'));_0x2e39ff[_0x3071('0x5a')]['UserId']=_0x2e39ff[_0x3071('0x5a')][_0x3071('0x65')]||_0x2e39ff[_0x3071('0x66')]['id'];_0x5d1316[_0x3071('0x67')]['id']=_0x2e39ff[_0x3071('0x5a')][_0x3071('0x65')];return db[_0x3071('0x3b')][_0x3071('0x58')]({'where':{'id':_0x2e39ff['params']['id'],'UserId':null}})[_0x3071('0x21')](handleEntityNotFound(_0x3b47e8,null))[_0x3071('0x21')](saveUpdates(_0x2e39ff['body'],null))['then'](function(_0x147856){if(_0x147856){_0x5d1316[_0x3071('0x29')]=_0x147856[_0x3071('0x68')]({'plain':!![]});return db[_0x3071('0x69')]['find']({'where':{'id':_0x147856['SmsInteractionId']}});}return null;})[_0x3071('0x21')](handleEntityNotFound(_0x3b47e8,null))['then'](function(_0x518bb5){if(_0x518bb5){return _0x518bb5['update']({'UserId':_0x2e39ff['body'][_0x3071('0x65')],'read1stAt':_[_0x3071('0x6a')](_0x518bb5[_0x3071('0x6b')])?moment()['format'](_0x3071('0x64')):undefined});}return null;})[_0x3071('0x21')](function(_0xc5749b){if(_0xc5749b){_0x5d1316[_0x3071('0x6c')]=_0xc5749b['get']({'plain':!![]});interaction_log[_0x3071('0x22')](_0x3071('0x6d'),_0x2e39ff['user']['id'],_0x2e39ff[_0x3071('0x66')][_0x3071('0x39')],_0x2e39ff[_0x3071('0x66')][_0x3071('0x6e')],_0x5d1316[_0x3071('0x6c')]['id'],_0x2e39ff[_0x3071('0x5a')]?JSON[_0x3071('0x27')](_0x2e39ff['body']):'null');return respondWithRpcPromise(_0x3071('0x6f'),_0x3071('0x70'),_0x5d1316);}return null;})[_0x3071('0x21')](function(_0x4bf839){var _0x53ebfe=_0x3071('0x71')+_0x4bf839[_0x3071('0x29')][_0x3071('0x72')];return db[_0x3071('0x73')][_0x3071('0x40')](_0x53ebfe,{'type':db[_0x3071('0x74')][_0x3071('0x75')][_0x3071('0x76')],'raw':!![]})['then'](function(_0x4ce89b){return _0x4ce89b;});})['then'](function(_0x282395){if(_0x282395){_0x5d1316[_0x3071('0x29')][_0x3071('0x77')]=_0x282395[0x0];if(!_0x2e39ff[_0x3071('0x5a')][_0x3071('0x65')])return;return db[_0x3071('0x78')][_0x3071('0x58')]({'where':{'id':_0x2e39ff[_0x3071('0x5a')]['UserId'],'role':_0x3071('0x67')},'attributes':['id',_0x3071('0x39'),_0x3071('0x79'),'email',_0x3071('0x7a')],'raw':!![]});}return null;})[_0x3071('0x21')](function(_0x4625f2){if(!_0x4625f2)return null;_0x5d1316['message']['agent']=_0x4625f2;return _0x5d1316;})[_0x3071('0x21')](function(_0x5cff7f){if(_0x5cff7f){if(_0x2e39ff[_0x3071('0x5a')][_0x3071('0x7b')]){_0x5d1316[_0x3071('0x29')][_0x3071('0x7c')]=util[_0x3071('0x63')](_0x3071('0x7d'),_0x2e39ff[_0x3071('0x66')]['name']);_0x5d1316[_0x3071('0x29')][_0x3071('0x7e')]=_0x5d1316[_0x3071('0x7e')];_0x5d1316[_0x3071('0x29')][_0x3071('0x7f')]=_0x3071('0x5f');return respondWithRpcPromise(_0x3071('0x80'),_0x3071('0x80'),{'event':'acceptmessage','message':_0x5d1316[_0x3071('0x29')]},client9002)['then'](function(){return _0x5d1316;});}return _0x5d1316;}return null;})[_0x3071('0x21')](respondWithResult(_0x3b47e8,null))[_0x3071('0x2b')](handleError(_0x3b47e8,null));};var interaction_log=require(_0x3071('0x5d'))(_0x3071('0x5e'));exports[_0x3071('0x81')]=function(_0xa8e233,_0x795c23,_0x32b961){var _0x77df0={'agent':{},'channel':_0x3071('0x60')};if(_0xa8e233['body']['id']){delete _0xa8e233[_0x3071('0x5a')]['id'];}_0xa8e233[_0x3071('0x5a')]['UserId']=_0xa8e233[_0x3071('0x5a')][_0x3071('0x65')]||_0xa8e233[_0x3071('0x66')]['id'];_0x77df0[_0x3071('0x67')]['id']=_0xa8e233[_0x3071('0x5a')]['UserId'];return db['SmsMessage'][_0x3071('0x58')]({'where':{'id':_0xa8e233['params']['id'],'UserId':null}})[_0x3071('0x21')](handleEntityNotFound(_0x795c23,null))[_0x3071('0x21')](function(_0x4167a7){if(_0x4167a7){_0x77df0[_0x3071('0x29')]=_0x4167a7[_0x3071('0x68')]({'plain':!![]});return db[_0x3071('0x69')]['find']({'where':{'id':_0x4167a7[_0x3071('0x82')]}});}return null;})[_0x3071('0x21')](handleEntityNotFound(_0x795c23,null))[_0x3071('0x21')](function(_0x291bb9){if(_0x291bb9){_0x77df0['interaction']=_0x291bb9[_0x3071('0x68')]({'plain':!![]});interaction_log[_0x3071('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa8e233[_0x3071('0x66')]['id'],_0xa8e233[_0x3071('0x66')][_0x3071('0x39')],_0xa8e233[_0x3071('0x66')][_0x3071('0x6e')],_0x77df0['interaction']['id'],_0xa8e233[_0x3071('0x5a')]?JSON['stringify'](_0xa8e233[_0x3071('0x5a')]):_0x3071('0x83'));return respondWithRpcPromise(_0x3071('0x84'),_0x3071('0x85'),_0x77df0);}return null;})[_0x3071('0x21')](function(_0x247cda){var _0x11d654=_0x3071('0x71')+_0x247cda['message'][_0x3071('0x72')];return db[_0x3071('0x73')][_0x3071('0x40')](_0x11d654,{'type':db['Sequelize'][_0x3071('0x75')]['SELECT'],'raw':!![]})[_0x3071('0x21')](function(_0x5a5861){return _0x5a5861;});})[_0x3071('0x21')](function(_0x5e0cbd){if(_0x5e0cbd){_0x77df0[_0x3071('0x29')][_0x3071('0x77')]=_0x5e0cbd[0x0];if(!_0xa8e233[_0x3071('0x5a')][_0x3071('0x65')])return;return db[_0x3071('0x78')][_0x3071('0x58')]({'where':{'id':_0xa8e233[_0x3071('0x5a')][_0x3071('0x65')],'role':_0x3071('0x67')},'attributes':['id','name',_0x3071('0x79'),_0x3071('0x86'),_0x3071('0x7a')],'raw':!![]});}return null;})['then'](function(_0x561030){if(!_0x561030)return null;_0x77df0['message']['agent']=_0x561030;return _0x77df0;})['then'](function(_0x8c77b7){if(_0x8c77b7){_0x8c77b7[_0x3071('0x29')]['interface']=util[_0x3071('0x63')](_0x3071('0x7d'),_0xa8e233[_0x3071('0x66')]['name']);_0x8c77b7['message'][_0x3071('0x7e')]=_0x77df0[_0x3071('0x7e')];_0x8c77b7[_0x3071('0x29')][_0x3071('0x7f')]=_0x3071('0x81');respondWithRpcPromise(_0x3071('0x80'),_0x3071('0x80'),{'event':'rejectmessage','message':_0x8c77b7['message']},client9002);return _0x77df0;}return null;})[_0x3071('0x21')](respondWithResult(_0x795c23,null))[_0x3071('0x2b')](handleError(_0x795c23,null));};exports[_0x3071('0x2e')]=function(_0x1674cb,_0x5a3b64,_0x2b8380){if(_0x1674cb[_0x3071('0x5a')]['id']){delete _0x1674cb[_0x3071('0x5a')]['id'];}var _0x1102b4;return db[_0x3071('0x3b')][_0x3071('0x58')]({'where':{'id':_0x1674cb[_0x3071('0x53')]['id']}})[_0x3071('0x21')](handleEntityNotFound(_0x5a3b64,null))['then'](function(_0x368a8a){if(_0x368a8a){_0x1102b4=_0x368a8a;return db[_0x3071('0x87')][_0x3071('0x58')]({'where':{'id':_0x368a8a[_0x3071('0x88')]}});}})[_0x3071('0x21')](handleEntityNotFound(_0x5a3b64,null))['then'](function(_0x44f73d){if(_0x44f73d){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2e'),_0x3071('0x89'),_0x44f73d[_0x3071('0x3c')],util['inspect'](_0x1674cb[_0x3071('0x5a')],{'showHidden':![],'depth':null}));switch(_0x44f73d[_0x3071('0x3c')]){case _0x3071('0x8a'):if(_0x1674cb[_0x3071('0x5a')][_0x3071('0x8b')]&&_0x1674cb['body']['MessageSid']===_0x1102b4[_0x3071('0x8c')]){return _0x1102b4[_0x3071('0x37')]({'read':!![]});}else{logger['error'](_0x3071('0x8d'),_0x3071('0x2e'),_0x3071('0x8a'),util[_0x3071('0x8e')](_0x1674cb[_0x3071('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1674cb[_0x3071('0x5a')]['MessageUUID']&&_0x1674cb[_0x3071('0x5a')][_0x3071('0x8f')]===_0x1102b4['messageId']&&_[_0x3071('0x90')](['sent',_0x3071('0x91')],_0x1674cb[_0x3071('0x5a')][_0x3071('0x92')])>=0x0){return _0x1102b4[_0x3071('0x37')]({'read':!![]});}else{logger['error'](_0x3071('0x8d'),'status',_0x3071('0x93'),util['inspect'](_0x1674cb[_0x3071('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x3071('0x94'):var _0x4a1081=_0x1674cb[_0x3071('0x5a')][_0x3071('0x95')][0x0];if(_0x4a1081['status'][_0x3071('0x96')]===_0x3071('0x97')){return _0x1102b4[_0x3071('0x37')]({'read':!![]});}else{logger[_0x3071('0x28')](_0x3071('0x8d'),_0x3071('0x2e'),_0x3071('0x94'),util[_0x3071('0x8e')](_0x1674cb[_0x3071('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x1102b4;}})[_0x3071('0x21')](respondWithResult(_0x5a3b64,null))[_0x3071('0x2b')](handleError(_0x5a3b64,null));};
\ No newline at end of file
+var _0x2032=['name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','includeAll','findAll','rows','params','rawAttributes','length','include','find','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','RejectMessage','rejectMessage','SmsAccountId','received\x20delivery\x20report\x20from','MessageSid','twilio','inspect','plivo','MessageUUID','indexOf','sent','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','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','redis','jayson/promise','client','http','request','info','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','index','map','SmsMessage','type','key','model'];(function(_0x25fded,_0x34216e){var _0x269156=function(_0x190fe0){while(--_0x190fe0){_0x25fded['push'](_0x25fded['shift']());}};_0x269156(++_0x34216e);}(_0x2032,0xd9));var _0x2203=function(_0x53b024,_0x13c6a7){_0x53b024=_0x53b024-0x0;var _0x12b82e=_0x2032[_0x53b024];return _0x12b82e;};'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'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2203('0x18')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x2203('0x19'));var client=jayson[_0x2203('0x1a')][_0x2203('0x1b')]({'port':0x232c});var client9002=jayson[_0x2203('0x1a')][_0x2203('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3fe0a8,_0x2c36e6,_0x2c085c,_0xdf9d0b){return new BPromise(function(_0x3053f3,_0x5129fb){var _0x280eda=_0xdf9d0b||client;return _0x280eda[_0x2203('0x1c')](_0x3fe0a8,_0x2c085c)['then'](function(_0x3f9ef6){logger[_0x2203('0x1d')]('SmsMessage,\x20%s,\x20%s',_0x2c36e6,_0x2203('0x1e'));logger['debug'](_0x2203('0x1f'),_0x2c36e6,_0x2203('0x1e'),JSON[_0x2203('0x20')](_0x3f9ef6));if(_0x3f9ef6[_0x2203('0x21')]){if(_0x3f9ef6[_0x2203('0x21')][_0x2203('0x22')]===0x1f4){logger['error'](_0x2203('0x23'),_0x2c36e6,_0x3f9ef6['error']['message']);return _0x5129fb(_0x3f9ef6[_0x2203('0x21')]['message']);}logger[_0x2203('0x21')](_0x2203('0x23'),_0x2c36e6,_0x3f9ef6['error'][_0x2203('0x24')]);return _0x3053f3(_0x3f9ef6['error']['message']);}else{logger[_0x2203('0x1d')](_0x2203('0x23'),_0x2c36e6,_0x2203('0x1e'));_0x3053f3(_0x3f9ef6[_0x2203('0x25')][_0x2203('0x24')]);}})[_0x2203('0x26')](function(_0x49c12){logger[_0x2203('0x21')]('SmsMessage,\x20%s,\x20%s',_0x2c36e6,_0x49c12);_0x5129fb(_0x49c12);});});}function respondWithStatusCode(_0x143f41,_0x36b958){_0x36b958=_0x36b958||0xcc;return function(_0x39a11a){if(_0x39a11a){return _0x143f41['sendStatus'](_0x36b958);}return _0x143f41[_0x2203('0x27')](_0x36b958)[_0x2203('0x28')]();};}function respondWithResult(_0x5c5fd3,_0xd6e109){_0xd6e109=_0xd6e109||0xc8;return function(_0xd91f5d){if(_0xd91f5d){return _0x5c5fd3[_0x2203('0x27')](_0xd6e109)[_0x2203('0x29')](_0xd91f5d);}};}function respondWithFilteredResult(_0x28ae02,_0x1df508){return function(_0x9c53f){if(_0x9c53f){var _0x5a95c1=typeof _0x1df508[_0x2203('0x2a')]===_0x2203('0x2b')&&typeof _0x1df508[_0x2203('0x2c')]===_0x2203('0x2b');var _0x52a426=_0x9c53f[_0x2203('0x2d')];var _0x21ff0d=_0x5a95c1?0x0:_0x1df508[_0x2203('0x2a')];var _0xf59954=_0x5a95c1?_0x9c53f['count']:_0x1df508[_0x2203('0x2a')]+_0x1df508[_0x2203('0x2c')];var _0x5e6560;if(_0xf59954>=_0x52a426){_0xf59954=_0x52a426;_0x5e6560=0xc8;}else{_0x5e6560=0xce;}_0x28ae02['status'](_0x5e6560);return _0x28ae02[_0x2203('0x2e')]('Content-Range',_0x21ff0d+'-'+_0xf59954+'/'+_0x52a426)['json'](_0x9c53f);}return null;};}function patchUpdates(_0x125dfc){return function(_0x464c88){try{jsonpatch[_0x2203('0x2f')](_0x464c88,_0x125dfc,!![]);}catch(_0x1e0aa9){return BPromise[_0x2203('0x30')](_0x1e0aa9);}return _0x464c88['save']();};}function saveUpdates(_0xb22e28,_0x2324c0){return function(_0x49caec){if(_0x49caec){return _0x49caec[_0x2203('0x31')](_0xb22e28)[_0x2203('0x32')](function(_0x9a335d){return _0x9a335d;});}return null;};}function removeEntity(_0x4187b4,_0x43fee1){return function(_0x24d138){if(_0x24d138){return _0x24d138[_0x2203('0x33')]()[_0x2203('0x32')](function(){_0x4187b4[_0x2203('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15c0ad,_0x347d3e){return function(_0x56f9b2){if(!_0x56f9b2){_0x15c0ad['sendStatus'](0x194);}return _0x56f9b2;};}function handleError(_0x2c58b1,_0x5e9841){_0x5e9841=_0x5e9841||0x1f4;return function(_0x25cc97){logger[_0x2203('0x21')](_0x25cc97[_0x2203('0x34')]);if(_0x25cc97['name']){delete _0x25cc97['name'];}_0x2c58b1[_0x2203('0x27')](_0x5e9841)['send'](_0x25cc97);};}exports[_0x2203('0x35')]=function(_0x5cfe5e,_0x11451e){var _0x4b6fc5={},_0x86097c={},_0x13ed9e={'count':0x0,'rows':[]};var _0x4311d1=_[_0x2203('0x36')](db[_0x2203('0x37')]['rawAttributes'],function(_0x5f1561){return{'name':_0x5f1561['fieldName'],'type':_0x5f1561[_0x2203('0x38')][_0x2203('0x39')]};});_0x86097c[_0x2203('0x3a')]=_[_0x2203('0x36')](_0x4311d1,_0x2203('0x3b'));_0x86097c[_0x2203('0x3c')]=_[_0x2203('0x3d')](_0x5cfe5e['query']);_0x86097c[_0x2203('0x3e')]=_[_0x2203('0x3f')](_0x86097c[_0x2203('0x3a')],_0x86097c[_0x2203('0x3c')]);_0x4b6fc5['attributes']=_['intersection'](_0x86097c[_0x2203('0x3a')],qs['fields'](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x40')]));_0x4b6fc5[_0x2203('0x41')]=_0x4b6fc5['attributes']['length']?_0x4b6fc5[_0x2203('0x41')]:_0x86097c[_0x2203('0x3a')];if(!_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x42')](_0x2203('0x43'))){_0x4b6fc5[_0x2203('0x2c')]=qs['limit'](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x2c')]);_0x4b6fc5[_0x2203('0x2a')]=qs[_0x2203('0x2a')](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x2a')]);}_0x4b6fc5[_0x2203('0x44')]=qs[_0x2203('0x45')](_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x45')]);_0x4b6fc5['where']=qs[_0x2203('0x3e')](_[_0x2203('0x46')](_0x5cfe5e[_0x2203('0x3c')],_0x86097c[_0x2203('0x3e')]),_0x4311d1);if(_0x5cfe5e['query']['filter']){_0x4b6fc5[_0x2203('0x47')]=_['merge'](_0x4b6fc5[_0x2203('0x47')],{'$or':_[_0x2203('0x36')](_0x4311d1,function(_0xc2944f){if(_0xc2944f[_0x2203('0x38')]!=='VIRTUAL'){var _0x289146={};_0x289146[_0xc2944f[_0x2203('0x3b')]]={'$like':'%'+_0x5cfe5e['query'][_0x2203('0x48')]+'%'};return _0x289146;}})});}_0x4b6fc5=_[_0x2203('0x49')]({},_0x4b6fc5,_0x5cfe5e[_0x2203('0x4a')]);var _0x2600a9={'where':_0x4b6fc5['where']};return db['SmsMessage'][_0x2203('0x2d')](_0x2600a9)['then'](function(_0x543fde){_0x13ed9e[_0x2203('0x2d')]=_0x543fde;if(_0x5cfe5e[_0x2203('0x3c')][_0x2203('0x4b')]){_0x4b6fc5['include']=[{'all':!![]}];}return db['SmsMessage'][_0x2203('0x4c')](_0x4b6fc5);})[_0x2203('0x32')](function(_0x12d7fa){_0x13ed9e[_0x2203('0x4d')]=_0x12d7fa;return _0x13ed9e;})[_0x2203('0x32')](respondWithFilteredResult(_0x11451e,_0x4b6fc5))[_0x2203('0x26')](handleError(_0x11451e,null));};exports['show']=function(_0x747dce,_0x557659){var _0x3f7685={'raw':!![],'where':{'id':_0x747dce[_0x2203('0x4e')]['id']}},_0x39ff6f={};_0x39ff6f[_0x2203('0x3a')]=_['keys'](db['SmsMessage'][_0x2203('0x4f')]);_0x39ff6f[_0x2203('0x3c')]=_[_0x2203('0x3d')](_0x747dce[_0x2203('0x3c')]);_0x39ff6f['filters']=_['intersection'](_0x39ff6f['model'],_0x39ff6f[_0x2203('0x3c')]);_0x3f7685[_0x2203('0x41')]=_['intersection'](_0x39ff6f[_0x2203('0x3a')],qs[_0x2203('0x40')](_0x747dce['query'][_0x2203('0x40')]));_0x3f7685[_0x2203('0x41')]=_0x3f7685[_0x2203('0x41')][_0x2203('0x50')]?_0x3f7685['attributes']:_0x39ff6f[_0x2203('0x3a')];if(_0x747dce['query'][_0x2203('0x4b')]){_0x3f7685[_0x2203('0x51')]=[{'all':!![]}];}_0x3f7685=_['merge']({},_0x3f7685,_0x747dce[_0x2203('0x4a')]);return db[_0x2203('0x37')][_0x2203('0x52')](_0x3f7685)[_0x2203('0x32')](handleEntityNotFound(_0x557659,null))[_0x2203('0x32')](respondWithResult(_0x557659,null))[_0x2203('0x26')](handleError(_0x557659,null));};exports['create']=function(_0x562a3d,_0x2f2537){return db['SmsMessage']['create'](_0x562a3d[_0x2203('0x53')],{})[_0x2203('0x32')](respondWithResult(_0x2f2537,0xc9))[_0x2203('0x26')](handleError(_0x2f2537,null));};exports['update']=function(_0x213c24,_0x4b2788){if(_0x213c24['body']['id']){delete _0x213c24[_0x2203('0x53')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x213c24['params']['id']}})[_0x2203('0x32')](handleEntityNotFound(_0x4b2788,null))[_0x2203('0x32')](saveUpdates(_0x213c24[_0x2203('0x53')],null))[_0x2203('0x32')](respondWithResult(_0x4b2788,null))[_0x2203('0x26')](handleError(_0x4b2788,null));};exports[_0x2203('0x33')]=function(_0x2baea2,_0x91f70c){return db[_0x2203('0x37')][_0x2203('0x52')]({'where':{'id':_0x2baea2[_0x2203('0x4e')]['id']}})[_0x2203('0x32')](handleEntityNotFound(_0x91f70c,null))['then'](removeEntity(_0x91f70c,null))['catch'](handleError(_0x91f70c,null));};exports[_0x2203('0x54')]=function(_0x43d8c0,_0x2511bd){return db[_0x2203('0x37')][_0x2203('0x54')]()[_0x2203('0x32')](respondWithResult(_0x2511bd,null))['catch'](handleError(_0x2511bd,null));};var interaction_log=require('../../config/logger')(_0x2203('0x55'));exports[_0x2203('0x56')]=function(_0x21ee59,_0x1e6d21,_0xcab922){var _0x7b0b9c={'agent':{},'channel':_0x2203('0x57')};if(_0x21ee59[_0x2203('0x53')]['id']){delete _0x21ee59[_0x2203('0x53')]['id'];}_0x21ee59[_0x2203('0x53')][_0x2203('0x58')]=!![];_0x21ee59['body'][_0x2203('0x59')]=moment()[_0x2203('0x5a')](_0x2203('0x5b'));_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')]=_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')]||_0x21ee59[_0x2203('0x5d')]['id'];_0x7b0b9c[_0x2203('0x5e')]['id']=_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')];return db[_0x2203('0x37')][_0x2203('0x52')]({'where':{'id':_0x21ee59[_0x2203('0x4e')]['id'],'UserId':null}})[_0x2203('0x32')](handleEntityNotFound(_0x1e6d21,null))[_0x2203('0x32')](saveUpdates(_0x21ee59[_0x2203('0x53')],null))[_0x2203('0x32')](function(_0x8a9282){if(_0x8a9282){_0x7b0b9c[_0x2203('0x24')]=_0x8a9282['get']({'plain':!![]});return db[_0x2203('0x5f')][_0x2203('0x52')]({'where':{'id':_0x8a9282[_0x2203('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x1e6d21,null))[_0x2203('0x32')](function(_0x3f73e1){if(_0x3f73e1){return _0x3f73e1[_0x2203('0x31')]({'UserId':_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')],'read1stAt':_['isNil'](_0x3f73e1[_0x2203('0x61')])?moment()[_0x2203('0x5a')](_0x2203('0x5b')):undefined});}return null;})['then'](function(_0x5507b6){if(_0x5507b6){_0x7b0b9c['interaction']=_0x5507b6['get']({'plain':!![]});interaction_log['info'](_0x2203('0x62'),_0x21ee59[_0x2203('0x5d')]['id'],_0x21ee59[_0x2203('0x5d')][_0x2203('0x3b')],_0x21ee59[_0x2203('0x5d')][_0x2203('0x63')],_0x7b0b9c[_0x2203('0x64')]['id'],_0x21ee59[_0x2203('0x53')]?JSON['stringify'](_0x21ee59['body']):_0x2203('0x65'));return respondWithRpcPromise(_0x2203('0x66'),_0x2203('0x67'),_0x7b0b9c);}return null;})[_0x2203('0x32')](function(_0x1bbd2d){var _0x32a348=_0x2203('0x68')+_0x1bbd2d[_0x2203('0x24')][_0x2203('0x69')];return db[_0x2203('0x6a')][_0x2203('0x3c')](_0x32a348,{'type':db[_0x2203('0x6b')][_0x2203('0x6c')][_0x2203('0x6d')],'raw':!![]})[_0x2203('0x32')](function(_0x10a611){return _0x10a611;});})[_0x2203('0x32')](function(_0x173ac1){if(_0x173ac1){_0x7b0b9c[_0x2203('0x24')]['contact']=_0x173ac1[0x0];if(!_0x21ee59[_0x2203('0x53')]['UserId'])return;return db[_0x2203('0x6e')]['find']({'where':{'id':_0x21ee59[_0x2203('0x53')][_0x2203('0x5c')],'role':_0x2203('0x5e')},'attributes':['id',_0x2203('0x3b'),_0x2203('0x6f'),_0x2203('0x70'),_0x2203('0x71')],'raw':!![]});}return null;})[_0x2203('0x32')](function(_0x4e9a01){if(!_0x4e9a01)return null;_0x7b0b9c['message'][_0x2203('0x5e')]=_0x4e9a01;return _0x7b0b9c;})[_0x2203('0x32')](function(_0x18d583){if(_0x18d583){if(_0x21ee59['body']['manual']){_0x7b0b9c['message'][_0x2203('0x72')]=util[_0x2203('0x5a')](_0x2203('0x73'),_0x21ee59[_0x2203('0x5d')]['name']);_0x7b0b9c[_0x2203('0x24')]['channel']=_0x7b0b9c[_0x2203('0x74')];_0x7b0b9c[_0x2203('0x24')][_0x2203('0x75')]=_0x2203('0x56');return respondWithRpcPromise(_0x2203('0x76'),'EventManager',{'event':_0x2203('0x77'),'message':_0x7b0b9c[_0x2203('0x24')]},client9002)[_0x2203('0x32')](function(){return _0x7b0b9c;});}return _0x7b0b9c;}return null;})['then'](respondWithResult(_0x1e6d21,null))[_0x2203('0x26')](handleError(_0x1e6d21,null));};var interaction_log=require(_0x2203('0x14'))(_0x2203('0x55'));exports[_0x2203('0x30')]=function(_0x1c65f9,_0x4356fe,_0x1a2b7c){var _0x503d7b={'agent':{},'channel':_0x2203('0x57')};if(_0x1c65f9[_0x2203('0x53')]['id']){delete _0x1c65f9[_0x2203('0x53')]['id'];}_0x1c65f9['body'][_0x2203('0x5c')]=_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')]||_0x1c65f9[_0x2203('0x5d')]['id'];_0x503d7b[_0x2203('0x5e')]['id']=_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')];return db[_0x2203('0x37')][_0x2203('0x52')]({'where':{'id':_0x1c65f9[_0x2203('0x4e')]['id'],'UserId':null}})[_0x2203('0x32')](handleEntityNotFound(_0x4356fe,null))[_0x2203('0x32')](function(_0x4c332f){if(_0x4c332f){_0x503d7b['message']=_0x4c332f[_0x2203('0x78')]({'plain':!![]});return db[_0x2203('0x5f')][_0x2203('0x52')]({'where':{'id':_0x4c332f[_0x2203('0x60')]}});}return null;})[_0x2203('0x32')](handleEntityNotFound(_0x4356fe,null))['then'](function(_0x16e518){if(_0x16e518){_0x503d7b[_0x2203('0x64')]=_0x16e518['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c65f9['user']['id'],_0x1c65f9['user'][_0x2203('0x3b')],_0x1c65f9[_0x2203('0x5d')][_0x2203('0x63')],_0x503d7b['interaction']['id'],_0x1c65f9['body']?JSON['stringify'](_0x1c65f9[_0x2203('0x53')]):_0x2203('0x65'));return respondWithRpcPromise(_0x2203('0x79'),_0x2203('0x7a'),_0x503d7b);}return null;})[_0x2203('0x32')](function(_0x32ac75){var _0x3d1797='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32ac75[_0x2203('0x24')][_0x2203('0x69')];return db[_0x2203('0x6a')][_0x2203('0x3c')](_0x3d1797,{'type':db[_0x2203('0x6b')][_0x2203('0x6c')][_0x2203('0x6d')],'raw':!![]})['then'](function(_0x188722){return _0x188722;});})['then'](function(_0x5d0176){if(_0x5d0176){_0x503d7b[_0x2203('0x24')]['contact']=_0x5d0176[0x0];if(!_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')])return;return db['User'][_0x2203('0x52')]({'where':{'id':_0x1c65f9[_0x2203('0x53')][_0x2203('0x5c')],'role':_0x2203('0x5e')},'attributes':['id',_0x2203('0x3b'),_0x2203('0x6f'),'email',_0x2203('0x71')],'raw':!![]});}return null;})[_0x2203('0x32')](function(_0x524b43){if(!_0x524b43)return null;_0x503d7b['message'][_0x2203('0x5e')]=_0x524b43;return _0x503d7b;})[_0x2203('0x32')](function(_0x383d3e){if(_0x383d3e){_0x383d3e[_0x2203('0x24')][_0x2203('0x72')]=util[_0x2203('0x5a')](_0x2203('0x73'),_0x1c65f9[_0x2203('0x5d')][_0x2203('0x3b')]);_0x383d3e[_0x2203('0x24')][_0x2203('0x74')]=_0x503d7b[_0x2203('0x74')];_0x383d3e[_0x2203('0x24')][_0x2203('0x75')]=_0x2203('0x30');respondWithRpcPromise(_0x2203('0x76'),'EventManager',{'event':'rejectmessage','message':_0x383d3e[_0x2203('0x24')]},client9002);return _0x503d7b;}return null;})[_0x2203('0x32')](respondWithResult(_0x4356fe,null))['catch'](handleError(_0x4356fe,null));};exports[_0x2203('0x27')]=function(_0x447a95,_0x5b5e95,_0x54014d){if(_0x447a95[_0x2203('0x53')]['id']){delete _0x447a95['body']['id'];}var _0x21f357;return db[_0x2203('0x37')]['find']({'where':{'id':_0x447a95[_0x2203('0x4e')]['id']}})[_0x2203('0x32')](handleEntityNotFound(_0x5b5e95,null))[_0x2203('0x32')](function(_0x1596f7){if(_0x1596f7){_0x21f357=_0x1596f7;return db['SmsAccount']['find']({'where':{'id':_0x1596f7[_0x2203('0x7b')]}});}})[_0x2203('0x32')](handleEntityNotFound(_0x5b5e95,null))[_0x2203('0x32')](function(_0x4ff77f){if(_0x4ff77f){logger['debug'](_0x2203('0x1f'),_0x2203('0x27'),_0x2203('0x7c'),_0x4ff77f['type'],util['inspect'](_0x447a95[_0x2203('0x53')],{'showHidden':![],'depth':null}));switch(_0x4ff77f[_0x2203('0x38')]){case'twilio':if(_0x447a95[_0x2203('0x53')][_0x2203('0x7d')]&&_0x447a95['body'][_0x2203('0x7d')]===_0x21f357['messageId']){return _0x21f357[_0x2203('0x31')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2203('0x7e'),util[_0x2203('0x7f')](_0x447a95['body'],{'showHidden':![],'depth':null}));}break;case _0x2203('0x80'):if(_0x447a95[_0x2203('0x53')][_0x2203('0x81')]&&_0x447a95['body'][_0x2203('0x81')]===_0x21f357['messageId']&&_[_0x2203('0x82')]([_0x2203('0x83'),'delivered'],_0x447a95[_0x2203('0x53')][_0x2203('0x84')])>=0x0){return _0x21f357['update']({'read':!![]});}else{logger[_0x2203('0x21')](_0x2203('0x85'),_0x2203('0x27'),_0x2203('0x86'),util[_0x2203('0x7f')](_0x447a95['body'],{'showHidden':![],'depth':null}));}break;case _0x2203('0x87'):var _0x1b5185=_0x447a95[_0x2203('0x53')][_0x2203('0x88')][0x0];if(_0x1b5185[_0x2203('0x27')][_0x2203('0x89')]==='DELIVERED'){return _0x21f357[_0x2203('0x31')]({'read':!![]});}else{logger[_0x2203('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2203('0x27'),'infobip',util[_0x2203('0x7f')](_0x447a95[_0x2203('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x21f357;}})[_0x2203('0x32')](respondWithResult(_0x5b5e95,null))['catch'](handleError(_0x5b5e95,null));};
\ No newline at end of file
index 22b7be5..d12e78c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5c5=['emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x524afc,_0x2194b4){var _0x379767=function(_0x16470e){while(--_0x16470e){_0x524afc['push'](_0x524afc['shift']());}};_0x379767(++_0x2194b4);}(_0xc5c5,0xfe));var _0x5c5c=function(_0x5ad2f2,_0x36136d){_0x5ad2f2=_0x5ad2f2-0x0;var _0x19eb05=_0xc5c5[_0x5ad2f2];return _0x19eb05;};'use strict';var EventEmitter=require(_0x5c5c('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x5c5c('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5c5c('0x2')](0x0);var events={'afterCreate':_0x5c5c('0x3'),'afterUpdate':_0x5c5c('0x4'),'afterDestroy':_0x5c5c('0x5')};function emitEvent(_0x1082f7){return function(_0x16ecfb,_0x5b5be5,_0x5ad5d8){SmsMessageEvents[_0x5c5c('0x6')](_0x1082f7+':'+_0x16ecfb['id'],_0x16ecfb);SmsMessageEvents[_0x5c5c('0x6')](_0x1082f7,_0x16ecfb);_0x5ad5d8(null);};}for(var e in events){if(events[_0x5c5c('0x7')](e)){var event=events[e];SmsMessage[_0x5c5c('0x8')](e,emitEvent(event));}}module[_0x5c5c('0x9')]=SmsMessageEvents;
\ No newline at end of file
+var _0xcc9e=['exports','events','../../mysqldb','SmsMessage','save','update','emit','hook'];(function(_0x262a91,_0x52295c){var _0x33f13c=function(_0x207184){while(--_0x207184){_0x262a91['push'](_0x262a91['shift']());}};_0x33f13c(++_0x52295c);}(_0xcc9e,0xe1));var _0xecc9=function(_0x2ebb49,_0x51243c){_0x2ebb49=_0x2ebb49-0x0;var _0x1795a4=_0xcc9e[_0x2ebb49];return _0x1795a4;};'use strict';var EventEmitter=require(_0xecc9('0x0'));var SmsMessage=require(_0xecc9('0x1'))['db'][_0xecc9('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xecc9('0x3'),'afterUpdate':_0xecc9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b3fc6){return function(_0x1dc958,_0x1b8da3,_0x269a4d){SmsMessageEvents[_0xecc9('0x5')](_0x1b3fc6+':'+_0x1dc958['id'],_0x1dc958);SmsMessageEvents[_0xecc9('0x5')](_0x1b3fc6,_0x1dc958);_0x269a4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xecc9('0x6')](e,emitEvent(event));}}module[_0xecc9('0x7')]=SmsMessageEvents;
\ No newline at end of file
index eda1bc3..8eb7d10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['update','toLowerCase','catch','error','out','SmsAccount','find','SmsAccountId','type','twilio','phone','accountSid','messages','body','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','sms','POST','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','authToken','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','FULLTEXT','models','get','direction','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then'];(function(_0x42d9db,_0x2c59b8){var _0x54fa1b=function(_0x8fd05c){while(--_0x8fd05c){_0x42d9db['push'](_0x42d9db['shift']());}};_0x54fa1b(++_0x2c59b8);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4e64('0xd')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x4e64('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43ba47,_0x4323bb,_0x30ed02){var _0x21d454=_0x13fa90[_0x4e64('0xf')];var _0x4ae2b3=_0x43ba47[_0x4e64('0x10')]({'plain':!![]});if(_0x4ae2b3[_0x4e64('0x11')]['toLowerCase']()==='in'||_0x4ae2b3[_0x4e64('0x11')]['toLowerCase']()==='out'&&!_0x4ae2b3[_0x4e64('0x12')]&&!_['isNil'](_0x4ae2b3[_0x4e64('0x13')])){_0x21d454[_0x4e64('0x14')][_0x4e64('0x15')]({'where':{'id':_0x4ae2b3[_0x4e64('0x16')]}})[_0x4e64('0x17')](function(_0xb36502){if(_0xb36502){_0xb36502[_0x4e64('0x18')]({'lastMsgAt':_0x4ae2b3['createdAt'],'lastMsgDirection':_0x4ae2b3[_0x4e64('0x11')][_0x4e64('0x19')]()});}})[_0x4e64('0x1a')](function(_0x5b35b0){console[_0x4e64('0x1b')](_0x5b35b0);});}if(_0x4ae2b3[_0x4e64('0x11')]===_0x4e64('0x1c')&&!_0x4ae2b3[_0x4e64('0x12')]){var _0x2bbaaa;_0x21d454[_0x4e64('0x1d')][_0x4e64('0x1e')]({'where':{'id':_0x4ae2b3[_0x4e64('0x1f')]},'raw':!![]})[_0x4e64('0x17')](function(_0x2df16a){_0x2bbaaa=_0x2df16a;if(_0x2bbaaa&&_0x2bbaaa['type']){switch(_0x2bbaaa[_0x4e64('0x20')]){case _0x4e64('0x21'):var _0x5618bb=require(_0x4e64('0x21'));if(_0x2bbaaa['accountSid']&&_0x2bbaaa['authToken']&&_0x2bbaaa[_0x4e64('0x22')]){var _0x120f14=new _0x5618bb(_0x2bbaaa[_0x4e64('0x23')],_0x2bbaaa['authToken']);_0x120f14[_0x4e64('0x24')]['create']({'body':_0x4ae2b3[_0x4e64('0x25')],'to':_0x4ae2b3[_0x4e64('0x22')],'from':_0x2bbaaa[_0x4e64('0x22')],'statusCallback':_0x2bbaaa['remote']+_0x4e64('0x26')+_0x4ae2b3['id']+_0x4e64('0x27')+_0x2bbaaa[_0x4e64('0x28')]})[_0x4e64('0x17')](function(_0x445864){if(_0x445864[_0x4e64('0x29')]){return _0x43ba47[_0x4e64('0x18')]({'messageId':_0x445864['sid']});}})[_0x4e64('0x1a')](function(_0x29b4f8){logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),_0x4e64('0x21'),util[_0x4e64('0x2b')](_0x29b4f8,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),'afterCreate',_0x4e64('0x21'),_0x4e64('0x2d'));}break;case _0x4e64('0x2e'):var _0x194f33=_0x4e64('0x2f');if(_0x2bbaaa[_0x4e64('0x30')]&&_0x2bbaaa[_0x4e64('0x31')]){var _0x14e389={'recipient':[_0x4ae2b3['phone']],'message':_0x4ae2b3[_0x4e64('0x25')],'message_type':_0x2bbaaa[_0x4e64('0x32')]};if(_0x2bbaaa[_0x4e64('0x32')]&&_0x2bbaaa[_0x4e64('0x32')]!=='SI'){_0x14e389[_0x4e64('0x33')]=_0x2bbaaa[_0x4e64('0x22')];}var _0x2f2cf8={'url':_0x194f33+'login?username='+_0x2bbaaa[_0x4e64('0x30')]+_0x4e64('0x34')+_0x2bbaaa[_0x4e64('0x31')],'method':_0x4e64('0x35')};rp(_0x2f2cf8)[_0x4e64('0x17')](function(_0x3d6cec){var _0x366905=_0x3d6cec['split'](';');var _0x2acf32={'user_key':_0x366905[0x0],'session_key':_0x366905[0x1]};_0x2f2cf8={'url':_0x194f33+_0x4e64('0x36'),'method':_0x4e64('0x37'),'headers':{'user_key':_0x2acf32['user_key'],'Session_key':_0x2acf32[_0x4e64('0x38')]},'json':!![],'body':_0x14e389};return rp(_0x2f2cf8);})['then'](function(_0x49c7e7){if(_0x49c7e7[_0x4e64('0x39')]>=0x1){var _0x5405bb={'messageId':_0x49c7e7['internal_order_id']};if(_0x2bbaaa['smsMethod']!=='GP'||!_0x2bbaaa[_0x4e64('0x3a')]){_0x5405bb['read']=!![];}return _0x43ba47[_0x4e64('0x18')](_0x5405bb);}else{return logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x2e'),util[_0x4e64('0x2b')](_0x49c7e7,{'showHidden':![],'depth':null}));}})[_0x4e64('0x1a')](function(_0x50b8d5){return logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),'skebby',util['inspect'](_0x50b8d5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4e64('0x2c'),'afterCreate','skebby',_0x4e64('0x3b'));}break;case _0x4e64('0x3c'):if(_0x2bbaaa[_0x4e64('0x3d')]){var _0x2d7da8={'recipient':_0x4ae2b3[_0x4e64('0x22')],'message':_0x4ae2b3[_0x4e64('0x25')],'sender':_0x2bbaaa[_0x4e64('0x3e')]||_0x2bbaaa['phone'],'authorization':_0x2bbaaa['authToken']};var _0x4323bb={'method':_0x4e64('0x37'),'uri':_0x4e64('0x3f'),'body':_0x2d7da8,'json':!![]};rp(_0x4323bb)[_0x4e64('0x17')](function(_0x422b81){var _0x5bf847={'messageId':_0x422b81[_0x4e64('0x40')]};if(!_0x2bbaaa[_0x4e64('0x3a')]){_0x5bf847[_0x4e64('0x41')]=!![];}return _0x43ba47[_0x4e64('0x18')](_0x5bf847);})[_0x4e64('0x1a')](function(_0x590572){logger['error'](_0x4e64('0x2c'),'afterCreate',_0x4e64('0x3c'),util[_0x4e64('0x2b')](_0x590572,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x3c'),_0x4e64('0x42'));}break;case'clicksend':if(_0x2bbaaa[_0x4e64('0x30')]&&_0x2bbaaa[_0x4e64('0x31')]){var _0x2d7da8={'messages':[{'source':_0x4e64('0x43'),'to':_0x4ae2b3[_0x4e64('0x22')],'body':_0x4ae2b3[_0x4e64('0x25')],'from':_0x2bbaaa[_0x4e64('0x3e')]||_0x2bbaaa[_0x4e64('0x22')]}]};var _0x5479a4=util[_0x4e64('0x44')](_0x4e64('0x45'),_0x2bbaaa['username'],_0x2bbaaa[_0x4e64('0x31')]);var _0x4323bb={'method':'POST','uri':_0x4e64('0x46'),'body':_0x2d7da8,'headers':{'Authorization':util[_0x4e64('0x44')](_0x4e64('0x47'),new Buffer(_0x5479a4)[_0x4e64('0x48')](_0x4e64('0x49')))},'json':!![]};rp(_0x4323bb)['then'](function(_0x3c3350){if(_0x3c3350[_0x4e64('0x4a')]>=0xc8&&_0x3c3350[_0x4e64('0x4a')]<=0xce){if(_0x3c3350[_0x4e64('0x4b')]&&_0x3c3350[_0x4e64('0x4b')][_0x4e64('0x4c')]>0x0){var _0x39a713=_[_0x4e64('0x4d')](_0x3c3350['data']['messages']);var _0x407f51={'messageId':_0x39a713[_0x4e64('0x4e')]};if(!_0x2bbaaa[_0x4e64('0x3a')]){_0x407f51['read']=!![];}return _0x43ba47[_0x4e64('0x18')](_0x407f51);}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x4f'),util['inspect'](_0x3c3350,{'showHidden':![],'depth':null}));}}else{logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),_0x4e64('0x4f'),util[_0x4e64('0x2b')](_0x3c3350,{'showHidden':![],'depth':null}));}})[_0x4e64('0x1a')](function(_0x4cfac3){logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x4f'),util[_0x4e64('0x2b')](_0x4cfac3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x4f'),_0x4e64('0x3b'));}break;case _0x4e64('0x50'):if(_0x2bbaaa[_0x4e64('0x51')]&&_0x2bbaaa['authToken']){var _0x2d7da8={'dst':_0x4ae2b3[_0x4e64('0x22')],'text':_0x4ae2b3[_0x4e64('0x25')],'src':_0x2bbaaa['senderString']||_0x2bbaaa[_0x4e64('0x22')],'url':_0x2bbaaa[_0x4e64('0x52')]+'/api/sms/messages/'+_0x4ae2b3['id']+_0x4e64('0x27')+_0x2bbaaa['token']};var _0x5479a4=util['format'](_0x4e64('0x45'),_0x2bbaaa['authId'],_0x2bbaaa[_0x4e64('0x3d')]);var _0x4323bb={'method':_0x4e64('0x37'),'uri':util[_0x4e64('0x44')](_0x4e64('0x53'),_0x2bbaaa[_0x4e64('0x51')]),'body':_0x2d7da8,'headers':{'Authorization':util[_0x4e64('0x44')]('Basic\x20%s',new Buffer(_0x5479a4)[_0x4e64('0x48')](_0x4e64('0x49')))},'json':!![]};rp(_0x4323bb)[_0x4e64('0x17')](function(_0x5b0116){var _0x50cd6a={'messageId':_0x5b0116[_0x4e64('0x54')][0x0]};return _0x43ba47['update'](_0x50cd6a);})[_0x4e64('0x1a')](function(_0x1530e5){logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),'plivo',util['inspect'](_0x1530e5,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x50'),_0x4e64('0x55'));}break;case _0x4e64('0x56'):if(_0x2bbaaa[_0x4e64('0x30')]&&_0x2bbaaa[_0x4e64('0x31')]){if(_0x2bbaaa['baseUrl']){var _0x4a56df={'method':_0x4e64('0x37'),'uri':_0x2bbaaa[_0x4e64('0x57')]+'/auth/1/session','body':{'username':_0x2bbaaa[_0x4e64('0x30')],'password':_0x2bbaaa[_0x4e64('0x31')]},'json':!![]};return rp(_0x4a56df)['then'](function(_0x3898ea){var _0xd05dff={'method':_0x4e64('0x37'),'uri':_0x2bbaaa[_0x4e64('0x57')]+_0x4e64('0x58'),'body':{'messages':[{'from':_0x2bbaaa[_0x4e64('0x22')],'destinations':[{'to':_0x4ae2b3['phone']}],'text':_0x4ae2b3[_0x4e64('0x25')],'notifyUrl':_0x2bbaaa[_0x4e64('0x52')]+_0x4e64('0x26')+_0x4ae2b3['id']+'/status?token='+_0x2bbaaa[_0x4e64('0x28')],'notifyContentType':_0x4e64('0x59'),'callbackData':_0x2bbaaa[_0x4e64('0x22')]+';'+_0x4ae2b3[_0x4e64('0x25')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3898ea[_0x4e64('0x28')]},'json':!![]};return rp(_0xd05dff)[_0x4e64('0x17')](function(_0x57b9bf){if(_0x57b9bf[_0x4e64('0x24')]){var _0xafc845={'messageId':_0x57b9bf[_0x4e64('0x24')][0x0][_0x4e64('0xd')]};if(!_0x2bbaaa[_0x4e64('0x3a')]){_0xafc845[_0x4e64('0x41')]=!![];}return _0x43ba47[_0x4e64('0x18')](_0xafc845);}else{return logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),_0x4e64('0x56'),util['inspect'](_0x57b9bf,{'showHidden':![],'depth':null}));}});})[_0x4e64('0x1a')](function(_0x20f6c5){return logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),'infobip',util[_0x4e64('0x2b')](_0x20f6c5,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),_0x4e64('0x56'),_0x4e64('0x5a'));}}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),'infobip',_0x4e64('0x3b'));}break;case _0x4e64('0x5b'):var _0xceff61=require('crypto');if(_0x2bbaaa[_0x4e64('0x5c')]){var _0xbb1aeb={};_0xbb1aeb[_0x4e64('0x5d')]=_0x2bbaaa['username'];_0xbb1aeb[_0x4e64('0x22')]=_0x4ae2b3[_0x4e64('0x22')];_0xbb1aeb['sender']=_0x2bbaaa['phone'];_0xbb1aeb['text']=_0x4ae2b3[_0x4e64('0x25')];_0xbb1aeb[_0x4e64('0x5e')]=+new Date();var _0x1deb6e='';var _0x314e82='';var _0x27db3f=Object[_0x4e64('0x5f')](_0xbb1aeb);_0x27db3f[_0x4e64('0x60')]();for(var _0xc950f9=0x0;_0xc950f9<_0x27db3f[_0x4e64('0x61')];_0xc950f9++){if(_0x1deb6e!=''){_0x1deb6e+='&';}_0x1deb6e+=_0x27db3f[_0xc950f9]+'='+encodeURIComponent(_0xbb1aeb[_0x27db3f[_0xc950f9]]);_0x314e82+=_0xbb1aeb[_0x27db3f[_0xc950f9]];}_0x314e82+=_0x2bbaaa[_0x4e64('0x5c')];_0x314e82=_0xceff61[_0x4e64('0x62')](_0x4e64('0x63'))[_0x4e64('0x18')](_0x314e82)[_0x4e64('0x64')]('hex');if(_0x1deb6e!==''){_0x1deb6e+='&';}_0x1deb6e+='signature='+_0x314e82;var _0x2f2cf8={'method':_0x4e64('0x35'),'uri':_0x2bbaaa[_0x4e64('0x57')]+_0x4e64('0x65')+_0x1deb6e,'json':!![]};return rp(_0x2f2cf8)[_0x4e64('0x17')](function(_0x683467){var _0x563aa8=Object[_0x4e64('0x5f')](_0x683467);if(_0x683467[_0x563aa8[0x0]][_0x4e64('0x1b')]&&parseInt(_0x683467[_0x563aa8[0x0]][_0x4e64('0x1b')])===0x0){var _0x1cd639={'messageId':_0x683467[_0x563aa8[0x0]]['id_sms']};if(!_0x2bbaaa['deliveryReport']){_0x1cd639[_0x4e64('0x41')]=!![];}return _0x43ba47[_0x4e64('0x18')](_0x1cd639);}else{return logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),_0x4e64('0x5b'),util[_0x4e64('0x2b')](_0x683467['error'],{'showHidden':![],'depth':null}));}})[_0x4e64('0x1a')](function(_0x1cd145){return logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x5b'),util[_0x4e64('0x2b')](_0x1cd145,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),'afterCreate',_0x4e64('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x4e64('0x66'):if(_0x2bbaaa[_0x4e64('0x5c')]){var _0x2d8932={'method':_0x4e64('0x37'),'uri':_0x4e64('0x67'),'headers':{'Authorization':_0x2bbaaa[_0x4e64('0x5c')]},'body':{'content':_0x4ae2b3[_0x4e64('0x25')],'to':[_0x4ae2b3[_0x4e64('0x22')]],'from':_0x2bbaaa[_0x4e64('0x22')],'binary':![],'clientMessageId':_0x4e64('0x68'),'charset':_0x4e64('0x69')},'json':!![]};rp(_0x2d8932)['then'](function(_0x1f1cb8){if(!_0x1f1cb8[_0x4e64('0x1b')]){var _0x264e8a={'messageId':_0x1f1cb8[_0x4e64('0x24')][0x0]['apiMessageId']};if(!_0x2bbaaa['deliveryReport']){_0x264e8a[_0x4e64('0x41')]=!![];}return _0x43ba47[_0x4e64('0x18')](_0x264e8a);}else{return logger['error'](_0x4e64('0x2c'),'afterCreate',_0x4e64('0x66'),util[_0x4e64('0x2b')](_0x1f1cb8[_0x4e64('0x1b')],{'showHidden':![],'depth':null}));}})[_0x4e64('0x1a')](function(_0x588927){return logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickatell',util[_0x4e64('0x2b')](_0x588927,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4e64('0x2a'),_0x4e64('0x66'),_0x4e64('0x6a'));}break;case _0x4e64('0x6b'):if(_0x2bbaaa['username']&&_0x2bbaaa[_0x4e64('0x31')]){var _0x5479a4=util[_0x4e64('0x44')]('%s:%s',_0x2bbaaa['username'],_0x2bbaaa[_0x4e64('0x31')]);var _0x4323bb={'method':_0x4e64('0x37'),'uri':_0x4e64('0x6c')+_0x2bbaaa[_0x4e64('0x6d')]+_0x4e64('0x6e'),'body':{'to':[_0x4ae2b3[_0x4e64('0x22')]],'text':_0x4ae2b3[_0x4e64('0x25')],'from':_0x2bbaaa[_0x4e64('0x22')],'applicationId':_0x2bbaaa[_0x4e64('0x6f')]},'headers':{'Authorization':util[_0x4e64('0x44')]('Basic\x20%s',new Buffer(_0x5479a4)[_0x4e64('0x48')](_0x4e64('0x49')))},'json':!![]};rp(_0x4323bb)[_0x4e64('0x17')](function(_0x2b2e64){if(_0x2b2e64['id']){var _0x2dd2df={'messageId':_0x2b2e64['id']};return _0x43ba47['update'](_0x2dd2df);}else{logger[_0x4e64('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4e64('0x6b'),util[_0x4e64('0x2b')](_0x2b2e64,{'showHidden':![],'depth':null}));}})[_0x4e64('0x1a')](function(_0x5263e1){logger[_0x4e64('0x1b')](_0x4e64('0x2c'),'afterCreate','bandwidth',util[_0x4e64('0x2b')](_0x5263e1,{'showHidden':![],'depth':null}));});}else{logger[_0x4e64('0x1b')](_0x4e64('0x2c'),'afterCreate',_0x4e64('0x6b'),_0x4e64('0x3b'));}break;case _0x4e64('0x70'):if(_0x2bbaaa[_0x4e64('0x5c')]){var _0x1c2b11={};var _0x2f2cf8={'method':_0x4e64('0x37'),'uri':_0x4e64('0x71'),'headers':{'Authorization':_0x4e64('0x72')+_0x2bbaaa[_0x4e64('0x5c')],'Content-Type':_0x4e64('0x59')},'body':{'from':_0x2bbaaa[_0x4e64('0x22')],'to':_0x4ae2b3[_0x4e64('0x22')],'text':_0x4ae2b3[_0x4e64('0x25')]},'json':!![]};return rp(_0x2f2cf8)[_0x4e64('0x17')](function(_0x2a6d11){if(_0x2a6d11['code']==0xca){_0x1c2b11[_0x4e64('0x73')]=_0x2a6d11;var _0x2b6a01={'method':_0x4e64('0x37'),'uri':_0x4e64('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x2bbaaa['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x1c2b11['message'][_0x4e64('0x75')]},'json':!![]};return rp(_0x2b6a01)['then'](function(_0x100a1a){_0x1c2b11[_0x4e64('0x76')]=_0x100a1a;var _0x5ae5b0={'messageId':_0x1c2b11['message']['refid'],'read':!![]};return _0x43ba47[_0x4e64('0x18')](_0x5ae5b0);});}else{return logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x70'),util[_0x4e64('0x2b')](_0x2a6d11,{'showHidden':![],'depth':null}));}})[_0x4e64('0x1a')](function(_0x196eb8){return logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),'intelepeer',util[_0x4e64('0x2b')](_0x196eb8,{'showHidden':![],'depth':null}));});}else{return logger[_0x4e64('0x1b')](_0x4e64('0x2c'),_0x4e64('0x2a'),_0x4e64('0x70'),_0x4e64('0x77'));}break;}}})[_0x4e64('0x78')](function(){_0x30ed02();});}else{_0x30ed02();}}},'charset':_0x4e64('0x79'),'collate':_0x4e64('0x7a')});};
\ No newline at end of file
+var _0xfc73=['https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','models','get','direction','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','toLowerCase','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create','remote','/api/sms/messages/','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','phone','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','%s:%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','format','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/status?token=','token','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','length','createHash','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell'];(function(_0x266dab,_0x211142){var _0x2acc69=function(_0x33c40e){while(--_0x33c40e){_0x266dab['push'](_0x266dab['shift']());}};_0x2acc69(++_0x211142);}(_0xfc73,0x8d));var _0x3fc7=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xfc73[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var logger=require('../../config/logger')(_0x3fc7('0x2'));var moment=require(_0x3fc7('0x3'));var BPromise=require(_0x3fc7('0x4'));var rp=require(_0x3fc7('0x5'));var fs=require('fs');var path=require(_0x3fc7('0x6'));var rimraf=require(_0x3fc7('0x7'));var config=require(_0x3fc7('0x8'));var attributes=require(_0x3fc7('0x9'));module[_0x3fc7('0xa')]=function(_0x1039e0,_0x262417){return _0x1039e0[_0x3fc7('0xb')]('SmsMessage',attributes,{'tableName':_0x3fc7('0xc'),'paranoid':![],'indexes':[{'name':_0x3fc7('0xd'),'fields':[_0x3fc7('0xd')]},{'name':_0x3fc7('0xe'),'fields':[_0x3fc7('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a0444,_0x434c84,_0x1dc32b){var _0x1f9da3=_0x1039e0[_0x3fc7('0x10')];var _0x1af753=_0x5a0444[_0x3fc7('0x11')]({'plain':!![]});if(_0x1af753['direction']['toLowerCase']()==='in'||_0x1af753[_0x3fc7('0x12')]['toLowerCase']()===_0x3fc7('0x13')&&!_0x1af753[_0x3fc7('0x14')]&&!_[_0x3fc7('0x15')](_0x1af753[_0x3fc7('0x16')])){_0x1f9da3['SmsInteraction'][_0x3fc7('0x17')]({'where':{'id':_0x1af753[_0x3fc7('0x18')]}})[_0x3fc7('0x19')](function(_0x34db32){if(_0x34db32){_0x34db32[_0x3fc7('0x1a')]({'lastMsgAt':_0x1af753[_0x3fc7('0x1b')],'lastMsgDirection':_0x1af753[_0x3fc7('0x12')][_0x3fc7('0x1c')]()});}})[_0x3fc7('0x1d')](function(_0x1c1f91){console[_0x3fc7('0x1e')](_0x1c1f91);});}if(_0x1af753[_0x3fc7('0x12')]===_0x3fc7('0x13')&&!_0x1af753[_0x3fc7('0x14')]){var _0x1bafae;_0x1f9da3[_0x3fc7('0x1f')][_0x3fc7('0x20')]({'where':{'id':_0x1af753[_0x3fc7('0x21')]},'raw':!![]})[_0x3fc7('0x19')](function(_0x502490){_0x1bafae=_0x502490;if(_0x1bafae&&_0x1bafae['type']){switch(_0x1bafae[_0x3fc7('0x22')]){case'twilio':var _0x4e4997=require(_0x3fc7('0x23'));if(_0x1bafae[_0x3fc7('0x24')]&&_0x1bafae[_0x3fc7('0x25')]&&_0x1bafae['phone']){var _0x4fa736=new _0x4e4997(_0x1bafae[_0x3fc7('0x24')],_0x1bafae[_0x3fc7('0x25')]);_0x4fa736[_0x3fc7('0x26')][_0x3fc7('0x27')]({'body':_0x1af753[_0x3fc7('0xf')],'to':_0x1af753['phone'],'from':_0x1bafae['phone'],'statusCallback':_0x1bafae[_0x3fc7('0x28')]+_0x3fc7('0x29')+_0x1af753['id']+'/status?token='+_0x1bafae['token']})['then'](function(_0x456ddc){if(_0x456ddc[_0x3fc7('0x2a')]){return _0x5a0444['update']({'messageId':_0x456ddc['sid']});}})[_0x3fc7('0x1d')](function(_0x89343e){logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x23'),util[_0x3fc7('0x2d')](_0x89343e,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x23'),_0x3fc7('0x2e'));}break;case _0x3fc7('0x2f'):var _0x32d567='https://api.skebby.it/API/v1.0/REST/';if(_0x1bafae[_0x3fc7('0x30')]&&_0x1bafae[_0x3fc7('0x31')]){var _0x4dcfef={'recipient':[_0x1af753[_0x3fc7('0x32')]],'message':_0x1af753[_0x3fc7('0xf')],'message_type':_0x1bafae[_0x3fc7('0x33')]};if(_0x1bafae[_0x3fc7('0x33')]&&_0x1bafae['smsMethod']!=='SI'){_0x4dcfef[_0x3fc7('0x34')]=_0x1bafae[_0x3fc7('0x32')];}var _0x327a0e={'url':_0x32d567+_0x3fc7('0x35')+_0x1bafae[_0x3fc7('0x30')]+_0x3fc7('0x36')+_0x1bafae[_0x3fc7('0x31')],'method':_0x3fc7('0x37')};rp(_0x327a0e)['then'](function(_0x28efc1){var _0x162bdd=_0x28efc1[_0x3fc7('0x38')](';');var _0x513ca8={'user_key':_0x162bdd[0x0],'session_key':_0x162bdd[0x1]};_0x327a0e={'url':_0x32d567+_0x3fc7('0x39'),'method':_0x3fc7('0x3a'),'headers':{'user_key':_0x513ca8[_0x3fc7('0x3b')],'Session_key':_0x513ca8[_0x3fc7('0x3c')]},'json':!![],'body':_0x4dcfef};return rp(_0x327a0e);})[_0x3fc7('0x19')](function(_0x421a5f){if(_0x421a5f['total_sent']>=0x1){var _0x5d205c={'messageId':_0x421a5f[_0x3fc7('0x3d')]};if(_0x1bafae[_0x3fc7('0x33')]!=='GP'||!_0x1bafae[_0x3fc7('0x3e')]){_0x5d205c[_0x3fc7('0x3f')]=!![];}return _0x5a0444['update'](_0x5d205c);}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'skebby',util[_0x3fc7('0x2d')](_0x421a5f,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x3948af){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),'skebby',util[_0x3fc7('0x2d')](_0x3948af,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x2f'),_0x3fc7('0x40'));}break;case _0x3fc7('0x41'):if(_0x1bafae[_0x3fc7('0x25')]){var _0x1e97eb={'recipient':_0x1af753['phone'],'message':_0x1af753['body'],'sender':_0x1bafae['senderString']||_0x1bafae['phone'],'authorization':_0x1bafae['authToken']};var _0x434c84={'method':_0x3fc7('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1e97eb,'json':!![]};rp(_0x434c84)[_0x3fc7('0x19')](function(_0x178fbc){var _0x2c6942={'messageId':_0x178fbc['requestid']};if(!_0x1bafae['deliveryReport']){_0x2c6942[_0x3fc7('0x3f')]=!![];}return _0x5a0444['update'](_0x2c6942);})[_0x3fc7('0x1d')](function(_0x29c65a){logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x41'),util[_0x3fc7('0x2d')](_0x29c65a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x41'),_0x3fc7('0x42'));}break;case _0x3fc7('0x43'):if(_0x1bafae['username']&&_0x1bafae[_0x3fc7('0x31')]){var _0x1e97eb={'messages':[{'source':_0x3fc7('0x44'),'to':_0x1af753[_0x3fc7('0x32')],'body':_0x1af753[_0x3fc7('0xf')],'from':_0x1bafae[_0x3fc7('0x45')]||_0x1bafae['phone']}]};var _0x2aebd2=util['format'](_0x3fc7('0x46'),_0x1bafae[_0x3fc7('0x30')],_0x1bafae['password']);var _0x434c84={'method':_0x3fc7('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1e97eb,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2aebd2)[_0x3fc7('0x47')](_0x3fc7('0x48')))},'json':!![]};rp(_0x434c84)[_0x3fc7('0x19')](function(_0x46042b){if(_0x46042b[_0x3fc7('0x49')]>=0xc8&&_0x46042b[_0x3fc7('0x49')]<=0xce){if(_0x46042b[_0x3fc7('0x4a')]&&_0x46042b[_0x3fc7('0x4a')][_0x3fc7('0x4b')]>0x0){var _0x7e22a3=_[_0x3fc7('0x4c')](_0x46042b[_0x3fc7('0x4a')]['messages']);var _0x1c2307={'messageId':_0x7e22a3[_0x3fc7('0x4d')]};if(!_0x1bafae[_0x3fc7('0x3e')]){_0x1c2307[_0x3fc7('0x3f')]=!![];}return _0x5a0444[_0x3fc7('0x1a')](_0x1c2307);}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x4e'),util['inspect'](_0x46042b,{'showHidden':![],'depth':null}));}}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x4e'),util[_0x3fc7('0x2d')](_0x46042b,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x36689d){logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),_0x3fc7('0x4e'),util[_0x3fc7('0x2d')](_0x36689d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x4e'),_0x3fc7('0x40'));}break;case _0x3fc7('0x4f'):if(_0x1bafae[_0x3fc7('0x50')]&&_0x1bafae['authToken']){var _0x1e97eb={'dst':_0x1af753[_0x3fc7('0x32')],'text':_0x1af753['body'],'src':_0x1bafae[_0x3fc7('0x45')]||_0x1bafae[_0x3fc7('0x32')],'url':_0x1bafae['remote']+'/api/sms/messages/'+_0x1af753['id']+'/status?token='+_0x1bafae['token']};var _0x2aebd2=util[_0x3fc7('0x51')](_0x3fc7('0x46'),_0x1bafae[_0x3fc7('0x50')],_0x1bafae['authToken']);var _0x434c84={'method':_0x3fc7('0x3a'),'uri':util[_0x3fc7('0x51')]('https://api.plivo.com/v1/Account/%s/Message/',_0x1bafae[_0x3fc7('0x50')]),'body':_0x1e97eb,'headers':{'Authorization':util[_0x3fc7('0x51')](_0x3fc7('0x52'),new Buffer(_0x2aebd2)[_0x3fc7('0x47')](_0x3fc7('0x48')))},'json':!![]};rp(_0x434c84)[_0x3fc7('0x19')](function(_0x4ce49e){var _0x4fe18a={'messageId':_0x4ce49e[_0x3fc7('0x53')][0x0]};return _0x5a0444[_0x3fc7('0x1a')](_0x4fe18a);})['catch'](function(_0x3edea6){logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fc7('0x4f'),util[_0x3fc7('0x2d')](_0x3edea6,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),_0x3fc7('0x4f'),_0x3fc7('0x54'));}break;case _0x3fc7('0x55'):if(_0x1bafae[_0x3fc7('0x30')]&&_0x1bafae[_0x3fc7('0x31')]){if(_0x1bafae[_0x3fc7('0x56')]){var _0x30777b={'method':_0x3fc7('0x3a'),'uri':_0x1bafae['baseUrl']+'/auth/1/session','body':{'username':_0x1bafae[_0x3fc7('0x30')],'password':_0x1bafae[_0x3fc7('0x31')]},'json':!![]};return rp(_0x30777b)[_0x3fc7('0x19')](function(_0x3e037a){var _0xf48f0e={'method':_0x3fc7('0x3a'),'uri':_0x1bafae['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1bafae['phone'],'destinations':[{'to':_0x1af753['phone']}],'text':_0x1af753[_0x3fc7('0xf')],'notifyUrl':_0x1bafae[_0x3fc7('0x28')]+_0x3fc7('0x29')+_0x1af753['id']+_0x3fc7('0x57')+_0x1bafae[_0x3fc7('0x58')],'notifyContentType':_0x3fc7('0x59'),'callbackData':_0x1bafae['phone']+';'+_0x1af753['body']}]},'headers':{'Authorization':_0x3fc7('0x5a')+_0x3e037a[_0x3fc7('0x58')]},'json':!![]};return rp(_0xf48f0e)['then'](function(_0x157dbf){if(_0x157dbf[_0x3fc7('0x26')]){var _0xaeee32={'messageId':_0x157dbf['messages'][0x0][_0x3fc7('0xd')]};if(!_0x1bafae[_0x3fc7('0x3e')]){_0xaeee32[_0x3fc7('0x3f')]=!![];}return _0x5a0444[_0x3fc7('0x1a')](_0xaeee32);}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'infobip',util[_0x3fc7('0x2d')](_0x157dbf,{'showHidden':![],'depth':null}));}});})[_0x3fc7('0x1d')](function(_0x2bdbc8){return logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fc7('0x55'),util[_0x3fc7('0x2d')](_0x2bdbc8,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3fc7('0x55'),_0x3fc7('0x5b'));}}else{logger[_0x3fc7('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),'infobip',_0x3fc7('0x40'));}break;case _0x3fc7('0x5c'):var _0x2b6e35=require(_0x3fc7('0x5d'));if(_0x1bafae[_0x3fc7('0x5e')]){var _0x356e0f={};_0x356e0f['login']=_0x1bafae[_0x3fc7('0x30')];_0x356e0f[_0x3fc7('0x32')]=_0x1af753[_0x3fc7('0x32')];_0x356e0f[_0x3fc7('0x34')]=_0x1bafae[_0x3fc7('0x32')];_0x356e0f[_0x3fc7('0x5f')]=_0x1af753['body'];_0x356e0f[_0x3fc7('0x60')]=+new Date();var _0x5b9b84='';var _0x8da743='';var _0x3e80c5=Object[_0x3fc7('0x61')](_0x356e0f);_0x3e80c5['sort']();for(var _0x3125fe=0x0;_0x3125fe<_0x3e80c5[_0x3fc7('0x62')];_0x3125fe++){if(_0x5b9b84!=''){_0x5b9b84+='&';}_0x5b9b84+=_0x3e80c5[_0x3125fe]+'='+encodeURIComponent(_0x356e0f[_0x3e80c5[_0x3125fe]]);_0x8da743+=_0x356e0f[_0x3e80c5[_0x3125fe]];}_0x8da743+=_0x1bafae[_0x3fc7('0x5e')];_0x8da743=_0x2b6e35[_0x3fc7('0x63')]('md5')[_0x3fc7('0x1a')](_0x8da743)['digest'](_0x3fc7('0x64'));if(_0x5b9b84!==''){_0x5b9b84+='&';}_0x5b9b84+='signature='+_0x8da743;var _0x327a0e={'method':_0x3fc7('0x37'),'uri':_0x1bafae[_0x3fc7('0x56')]+_0x3fc7('0x65')+_0x5b9b84,'json':!![]};return rp(_0x327a0e)['then'](function(_0x7316c7){var _0x449931=Object[_0x3fc7('0x61')](_0x7316c7);if(_0x7316c7[_0x449931[0x0]][_0x3fc7('0x1e')]&&parseInt(_0x7316c7[_0x449931[0x0]][_0x3fc7('0x1e')])===0x0){var _0x15e129={'messageId':_0x7316c7[_0x449931[0x0]][_0x3fc7('0x66')]};if(!_0x1bafae[_0x3fc7('0x3e')]){_0x15e129[_0x3fc7('0x3f')]=!![];}return _0x5a0444['update'](_0x15e129);}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'csc',util[_0x3fc7('0x2d')](_0x7316c7[_0x3fc7('0x1e')],{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x3c2883){return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x5c'),util['inspect'](_0x3c2883,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3fc7('0x2c'),_0x3fc7('0x5c'),_0x3fc7('0x67'));}break;case _0x3fc7('0x68'):if(_0x1bafae['apiKey']){var _0x3e0cde={'method':_0x3fc7('0x3a'),'uri':_0x3fc7('0x69'),'headers':{'Authorization':_0x1bafae[_0x3fc7('0x5e')]},'body':{'content':_0x1af753[_0x3fc7('0xf')],'to':[_0x1af753[_0x3fc7('0x32')]],'from':_0x1bafae[_0x3fc7('0x32')],'binary':![],'clientMessageId':_0x3fc7('0x6a'),'charset':_0x3fc7('0x6b')},'json':!![]};rp(_0x3e0cde)[_0x3fc7('0x19')](function(_0x36c6a9){if(!_0x36c6a9[_0x3fc7('0x1e')]){var _0x546138={'messageId':_0x36c6a9[_0x3fc7('0x26')][0x0]['apiMessageId']};if(!_0x1bafae['deliveryReport']){_0x546138[_0x3fc7('0x3f')]=!![];}return _0x5a0444[_0x3fc7('0x1a')](_0x546138);}else{return logger['error'](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x68'),util[_0x3fc7('0x2d')](_0x36c6a9[_0x3fc7('0x1e')],{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x365a3b){return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),'clickatell',util[_0x3fc7('0x2d')](_0x365a3b,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x68'),_0x3fc7('0x67'));}break;case _0x3fc7('0x6c'):if(_0x1bafae[_0x3fc7('0x30')]&&_0x1bafae[_0x3fc7('0x31')]){var _0x2aebd2=util[_0x3fc7('0x51')](_0x3fc7('0x46'),_0x1bafae[_0x3fc7('0x30')],_0x1bafae[_0x3fc7('0x31')]);var _0x434c84={'method':_0x3fc7('0x3a'),'uri':_0x3fc7('0x6d')+_0x1bafae[_0x3fc7('0x6e')]+'/messages','body':{'to':[_0x1af753[_0x3fc7('0x32')]],'text':_0x1af753[_0x3fc7('0xf')],'from':_0x1bafae[_0x3fc7('0x32')],'applicationId':_0x1bafae[_0x3fc7('0x6f')]},'headers':{'Authorization':util['format'](_0x3fc7('0x52'),new Buffer(_0x2aebd2)[_0x3fc7('0x47')](_0x3fc7('0x48')))},'json':!![]};rp(_0x434c84)['then'](function(_0x12e004){if(_0x12e004['id']){var _0x4c6505={'messageId':_0x12e004['id']};return _0x5a0444[_0x3fc7('0x1a')](_0x4c6505);}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),'afterCreate','bandwidth',util[_0x3fc7('0x2d')](_0x12e004,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x4ab93f){logger['error'](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x6c'),util[_0x3fc7('0x2d')](_0x4ab93f,{'showHidden':![],'depth':null}));});}else{logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x6c'),_0x3fc7('0x40'));}break;case _0x3fc7('0x70'):if(_0x1bafae[_0x3fc7('0x5e')]){var _0xca1fa={};var _0x327a0e={'method':_0x3fc7('0x3a'),'uri':_0x3fc7('0x71'),'headers':{'Authorization':_0x3fc7('0x72')+_0x1bafae[_0x3fc7('0x5e')],'Content-Type':_0x3fc7('0x59')},'body':{'from':_0x1bafae['phone'],'to':_0x1af753[_0x3fc7('0x32')],'text':_0x1af753[_0x3fc7('0xf')]},'json':!![]};return rp(_0x327a0e)[_0x3fc7('0x19')](function(_0x5a05a3){if(_0x5a05a3[_0x3fc7('0x73')]==0xca){_0xca1fa[_0x3fc7('0x74')]=_0x5a05a3;var _0x400c79={'method':'POST','uri':_0x3fc7('0x75'),'headers':{'Authorization':_0x3fc7('0x72')+_0x1bafae['apiKey'],'Content-Type':_0x3fc7('0x59')},'body':{'refid':_0xca1fa[_0x3fc7('0x74')]['refid']},'json':!![]};return rp(_0x400c79)[_0x3fc7('0x19')](function(_0x280363){_0xca1fa[_0x3fc7('0x76')]=_0x280363;var _0x4d6d1e={'messageId':_0xca1fa[_0x3fc7('0x74')]['refid'],'read':!![]};return _0x5a0444['update'](_0x4d6d1e);});}else{return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),'afterCreate',_0x3fc7('0x70'),util[_0x3fc7('0x2d')](_0x5a05a3,{'showHidden':![],'depth':null}));}})[_0x3fc7('0x1d')](function(_0x59ef01){return logger[_0x3fc7('0x1e')](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x70'),util['inspect'](_0x59ef01,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x3fc7('0x2b'),_0x3fc7('0x2c'),_0x3fc7('0x70'),_0x3fc7('0x77'));}break;}}})[_0x3fc7('0x78')](function(){_0x1dc32b();});}else{_0x1dc32b();}}},'charset':_0x3fc7('0x79'),'collate':_0x3fc7('0x7a')});};
\ No newline at end of file
index 81dd944..cb3a9ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe12=['http','defaults','redis','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x50928a,_0x3b7eda){var _0x818fa0=function(_0x1b538f){while(--_0x1b538f){_0x50928a['push'](_0x50928a['shift']());}};_0x818fa0(++_0x3b7eda);}(_0xbe12,0x158));var _0x2be1=function(_0x525e25,_0x47c71f){_0x525e25=_0x525e25-0x0;var _0xceb2f9=_0xbe12[_0x525e25];return _0xceb2f9;};'use strict';var _=require('lodash');var util=require(_0x2be1('0x0'));var moment=require(_0x2be1('0x1'));var BPromise=require(_0x2be1('0x2'));var rs=require(_0x2be1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2be1('0x5'))('rpc');var config=require(_0x2be1('0x6'));var jayson=require(_0x2be1('0x7'));var client=jayson['client'][_0x2be1('0x8')]({'port':0x232a});config['redis']=_[_0x2be1('0x9')](config[_0x2be1('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2be1('0xa')]));require(_0x2be1('0xb'))[_0x2be1('0xc')](socket);function respondWithRpcPromise(_0x2ee642,_0x1f0df0,_0x1b6954){return new BPromise(function(_0x5357f2,_0x10fbb6){return client[_0x2be1('0xd')](_0x2ee642,_0x1b6954)[_0x2be1('0xe')](function(_0x1b6f98){logger[_0x2be1('0xf')]('SmsMessage,\x20%s,\x20%s',_0x1f0df0,_0x2be1('0x10'));logger[_0x2be1('0x11')](_0x2be1('0x12'),_0x1f0df0,_0x2be1('0x10'),JSON[_0x2be1('0x13')](_0x1b6f98));if(_0x1b6f98[_0x2be1('0x14')]){if(_0x1b6f98[_0x2be1('0x14')][_0x2be1('0x15')]===0x1f4){logger[_0x2be1('0x14')]('SmsMessage,\x20%s,\x20%s',_0x1f0df0,_0x1b6f98[_0x2be1('0x14')][_0x2be1('0x16')]);return _0x10fbb6(_0x1b6f98[_0x2be1('0x14')][_0x2be1('0x16')]);}logger[_0x2be1('0x14')](_0x2be1('0x17'),_0x1f0df0,_0x1b6f98[_0x2be1('0x14')][_0x2be1('0x16')]);return _0x5357f2(_0x1b6f98[_0x2be1('0x14')][_0x2be1('0x16')]);}else{logger[_0x2be1('0xf')](_0x2be1('0x17'),_0x1f0df0,_0x2be1('0x10'));_0x5357f2(_0x1b6f98[_0x2be1('0x18')][_0x2be1('0x16')]);}})[_0x2be1('0x19')](function(_0x5e6f89){logger[_0x2be1('0x14')](_0x2be1('0x17'),_0x1f0df0,_0x5e6f89);_0x10fbb6(_0x5e6f89);});});}exports[_0x2be1('0x1a')]=function(_0x298bd9){var _0x64f2a=this;return new Promise(function(_0x5d466d,_0x4cc005){return db[_0x2be1('0x1b')][_0x2be1('0x1c')](_0x298bd9[_0x2be1('0x1d')],{'raw':_0x298bd9[_0x2be1('0x1e')]?_0x298bd9['options'][_0x2be1('0x1f')]===undefined?!![]:![]:!![]})[_0x2be1('0xe')](function(_0x2a268a){logger[_0x2be1('0xf')](_0x2be1('0x1a'),_0x298bd9);logger[_0x2be1('0x11')]('CreateSmsMessage',_0x298bd9,JSON[_0x2be1('0x13')](_0x2a268a));_0x5d466d(_0x2a268a);})['catch'](function(_0x566fbc){logger[_0x2be1('0x14')](_0x2be1('0x1a'),_0x566fbc['message'],_0x298bd9);_0x4cc005(_0x64f2a[_0x2be1('0x14')](0x1f4,_0x566fbc[_0x2be1('0x16')]));});});};
\ No newline at end of file
+var _0x699b=['create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','CreateSmsMessage'];(function(_0x2a7d71,_0x53d1c5){var _0x52a991=function(_0x550881){while(--_0x550881){_0x2a7d71['push'](_0x2a7d71['shift']());}};_0x52a991(++_0x53d1c5);}(_0x699b,0xec));var _0xb699=function(_0x5b1beb,_0x56b8a0){_0x5b1beb=_0x5b1beb-0x0;var _0x27625e=_0x699b[_0x5b1beb];return _0x27625e;};'use strict';var _=require(_0xb699('0x0'));var util=require(_0xb699('0x1'));var moment=require('moment');var BPromise=require(_0xb699('0x2'));var rs=require(_0xb699('0x3'));var fs=require('fs');var Redis=require(_0xb699('0x4'));var db=require(_0xb699('0x5'))['db'];var utils=require(_0xb699('0x6'));var logger=require(_0xb699('0x7'))(_0xb699('0x8'));var config=require('../../config/environment');var jayson=require(_0xb699('0x9'));var client=jayson[_0xb699('0xa')][_0xb699('0xb')]({'port':0x232a});config[_0xb699('0xc')]=_[_0xb699('0xd')](config[_0xb699('0xc')],{'host':_0xb699('0xe'),'port':0x18eb});var socket=require(_0xb699('0xf'))(new Redis(config[_0xb699('0xc')]));require(_0xb699('0x10'))['register'](socket);function respondWithRpcPromise(_0x2ade71,_0x7f0d84,_0x41f47e){return new BPromise(function(_0xbc0b11,_0x576b58){return client[_0xb699('0x11')](_0x2ade71,_0x41f47e)[_0xb699('0x12')](function(_0x46ee0a){logger['info'](_0xb699('0x13'),_0x7f0d84,'request\x20sent');logger['debug'](_0xb699('0x14'),_0x7f0d84,_0xb699('0x15'),JSON[_0xb699('0x16')](_0x46ee0a));if(_0x46ee0a[_0xb699('0x17')]){if(_0x46ee0a[_0xb699('0x17')][_0xb699('0x18')]===0x1f4){logger[_0xb699('0x17')](_0xb699('0x13'),_0x7f0d84,_0x46ee0a['error'][_0xb699('0x19')]);return _0x576b58(_0x46ee0a['error'][_0xb699('0x19')]);}logger['error'](_0xb699('0x13'),_0x7f0d84,_0x46ee0a[_0xb699('0x17')][_0xb699('0x19')]);return _0xbc0b11(_0x46ee0a[_0xb699('0x17')][_0xb699('0x19')]);}else{logger[_0xb699('0x1a')]('SmsMessage,\x20%s,\x20%s',_0x7f0d84,_0xb699('0x15'));_0xbc0b11(_0x46ee0a['result'][_0xb699('0x19')]);}})['catch'](function(_0x546678){logger['error']('SmsMessage,\x20%s,\x20%s',_0x7f0d84,_0x546678);_0x576b58(_0x546678);});});}exports[_0xb699('0x1b')]=function(_0xeb5034){var _0x56651e=this;return new Promise(function(_0xfce68e,_0xb97d04){return db['SmsMessage'][_0xb699('0x1c')](_0xeb5034[_0xb699('0x1d')],{'raw':_0xeb5034[_0xb699('0x1e')]?_0xeb5034[_0xb699('0x1e')][_0xb699('0x1f')]===undefined?!![]:![]:!![]})[_0xb699('0x12')](function(_0x7550f5){logger[_0xb699('0x1a')](_0xb699('0x1b'),_0xeb5034);logger[_0xb699('0x20')](_0xb699('0x1b'),_0xeb5034,JSON[_0xb699('0x16')](_0x7550f5));_0xfce68e(_0x7550f5);})['catch'](function(_0xdbbf6b){logger[_0xb699('0x17')](_0xb699('0x1b'),_0xdbbf6b[_0xb699('0x19')],_0xeb5034);_0xb97d04(_0x56651e['error'](0x1f4,_0xdbbf6b[_0xb699('0x19')]));});});};
\ No newline at end of file
index 4279866..2d39662 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe44a=['length','emit','removeListener'];(function(_0x5bf40,_0x4d18d7){var _0x1b44bd=function(_0x388952){while(--_0x388952){_0x5bf40['push'](_0x5bf40['shift']());}};_0x1b44bd(++_0x4d18d7);}(_0xe44a,0x109));var _0xae44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe44a[_0x14add3];return _0x4a174f;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove','update'];function createListener(_0x4351da,_0x19194e){return function(_0x3fe893){_0x19194e[_0xae44('0x0')](_0x4351da,_0x3fe893);};}function removeListener(_0x47be78,_0x2779d0){return function(){SmsMessageEvents[_0xae44('0x1')](_0x47be78,_0x2779d0);};}exports['register']=function(_0x1628ce){for(var _0x4282eb=0x0,_0x3133aa=events[_0xae44('0x2')];_0x4282eb<_0x3133aa;_0x4282eb++){var _0x58bd3c=events[_0x4282eb];var _0x490abc=createListener('smsMessage:'+_0x58bd3c,_0x1628ce);SmsMessageEvents['on'](_0x58bd3c,_0x490abc);}};
\ No newline at end of file
+var _0x1b5e=['removeListener','register','length','smsMessage:','save','remove'];(function(_0x107e87,_0x20293b){var _0x267b1a=function(_0x34139e){while(--_0x34139e){_0x107e87['push'](_0x107e87['shift']());}};_0x267b1a(++_0x20293b);}(_0x1b5e,0x82));var _0xe1b5=function(_0x8d5683,_0x408708){_0x8d5683=_0x8d5683-0x0;var _0x3bfc8f=_0x1b5e[_0x8d5683];return _0x3bfc8f;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xe1b5('0x0'),_0xe1b5('0x1'),'update'];function createListener(_0x285d18,_0x3f9475){return function(_0x881b00){_0x3f9475['emit'](_0x285d18,_0x881b00);};}function removeListener(_0x187920,_0x5f5237){return function(){SmsMessageEvents[_0xe1b5('0x2')](_0x187920,_0x5f5237);};}exports[_0xe1b5('0x3')]=function(_0x394a4b){for(var _0x2804c3=0x0,_0x365604=events[_0xe1b5('0x4')];_0x2804c3<_0x365604;_0x2804c3++){var _0x470602=events[_0x2804c3];var _0x209df8=createListener(_0xe1b5('0x5')+_0x470602,_0x394a4b);SmsMessageEvents['on'](_0x470602,_0x209df8);}};
\ No newline at end of file
index e7c7d88..9403bb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dae=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','update','destroy','delete','removeTeams','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xcdf809,_0x2881f0){var _0x4d4d70=function(_0x277c61){while(--_0x277c61){_0xcdf809['push'](_0xcdf809['shift']());}};_0x4d4d70(++_0x2881f0);}(_0x4dae,0x1de));var _0xe4da=function(_0x2732c9,_0x556c99){_0x2732c9=_0x2732c9-0x0;var _0xbbb3f=_0x4dae[_0x2732c9];return _0xbbb3f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe4da('0x0'));var timeout=require(_0xe4da('0x1'));var express=require(_0xe4da('0x2'));var router=express[_0xe4da('0x3')]();var fs_extra=require(_0xe4da('0x4'));var auth=require(_0xe4da('0x5'));var interaction=require(_0xe4da('0x6'));var config=require(_0xe4da('0x7'));var controller=require(_0xe4da('0x8'));router[_0xe4da('0x9')]('/',auth[_0xe4da('0xa')](),controller['index']);router['get'](_0xe4da('0xb'),auth['isAuthenticated'](),controller[_0xe4da('0xc')]);router[_0xe4da('0x9')](_0xe4da('0xd'),auth[_0xe4da('0xa')](),controller[_0xe4da('0xe')]);router[_0xe4da('0x9')](_0xe4da('0xf'),auth[_0xe4da('0xa')](),controller[_0xe4da('0x10')]);router[_0xe4da('0x9')](_0xe4da('0x11'),auth[_0xe4da('0xa')](),controller[_0xe4da('0x12')]);router['get'](_0xe4da('0x13'),auth['isAuthenticated'](),controller[_0xe4da('0x14')]);router[_0xe4da('0x15')]('/',auth[_0xe4da('0xa')](),controller['create']);router[_0xe4da('0x15')](_0xe4da('0x11'),auth[_0xe4da('0xa')](),controller[_0xe4da('0x16')]);router[_0xe4da('0x15')]('/:id/users',auth[_0xe4da('0xa')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe4da('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe4da('0x18')]);router[_0xe4da('0x19')](_0xe4da('0x11'),auth[_0xe4da('0xa')](),controller[_0xe4da('0x1a')]);router[_0xe4da('0x19')]('/:id/users',auth[_0xe4da('0xa')](),controller[_0xe4da('0x1b')]);module[_0xe4da('0x1c')]=router;
\ No newline at end of file
+var _0x1259=['put','/:id','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','post','create','addTeams','/:id/users','addAgents'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0x1259,0x11e));var _0x9125=function(_0x1d27b1,_0x582136){_0x1d27b1=_0x1d27b1-0x0;var _0x45198b=_0x1259[_0x1d27b1];return _0x45198b;};'use strict';var multer=require(_0x9125('0x0'));var util=require(_0x9125('0x1'));var path=require(_0x9125('0x2'));var timeout=require(_0x9125('0x3'));var express=require('express');var router=express[_0x9125('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9125('0x5'));var interaction=require(_0x9125('0x6'));var config=require(_0x9125('0x7'));var controller=require(_0x9125('0x8'));router[_0x9125('0x9')]('/',auth[_0x9125('0xa')](),controller[_0x9125('0xb')]);router[_0x9125('0x9')](_0x9125('0xc'),auth['isAuthenticated'](),controller[_0x9125('0xd')]);router[_0x9125('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9125('0x9')](_0x9125('0xe'),auth[_0x9125('0xa')](),controller[_0x9125('0xf')]);router[_0x9125('0x9')](_0x9125('0x10'),auth[_0x9125('0xa')](),controller['getTeams']);router[_0x9125('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x9125('0x11')]('/',auth[_0x9125('0xa')](),controller[_0x9125('0x12')]);router['post'](_0x9125('0x10'),auth['isAuthenticated'](),controller[_0x9125('0x13')]);router[_0x9125('0x11')](_0x9125('0x14'),auth['isAuthenticated'](),controller[_0x9125('0x15')]);router[_0x9125('0x16')](_0x9125('0x17'),auth[_0x9125('0xa')](),controller['update']);router[_0x9125('0x18')](_0x9125('0x17'),auth['isAuthenticated'](),controller[_0x9125('0x19')]);router[_0x9125('0x18')]('/:id/teams',auth[_0x9125('0xa')](),controller['removeTeams']);router[_0x9125('0x18')](_0x9125('0x14'),auth['isAuthenticated'](),controller[_0x9125('0x1a')]);module[_0x9125('0x1b')]=router;
\ No newline at end of file
index c311b0f..f4cef28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f45=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x275293,_0x31bf61){var _0x539b28=function(_0x36e11c){while(--_0x36e11c){_0x275293['push'](_0x275293['shift']());}};_0x539b28(++_0x31bf61);}(_0x5f45,0x127));var _0x55f4=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x5f45[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0x55f4('0x0'));module[_0x55f4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x55f4('0x2')]},'timeout':{'type':Sequelize[_0x55f4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x55f4('0x4'),_0x55f4('0x5'),_0x55f4('0x6'))}};
\ No newline at end of file
+var _0x2240=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5e9240,_0x1e1041){var _0x204057=function(_0x2aeca0){while(--_0x2aeca0){_0x5e9240['push'](_0x5e9240['shift']());}};_0x204057(++_0x1e1041);}(_0x2240,0x16d));var _0x0224=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x2240[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x0224('0x0'));module[_0x0224('0x1')]={'name':{'type':Sequelize[_0x0224('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0224('0x2')]},'timeout':{'type':Sequelize[_0x0224('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0224('0x4')](_0x0224('0x5'),'beepall',_0x0224('0x6'))}};
\ No newline at end of file
index d27bb57..d237bf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5300=['getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','clone','push','toString','SELECT','every','TeamId','includes','all','union','value','transaction','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','limit','offset','count','set','Content-Range','reject','update','then','destroy','SmsQueues','UserProfileResource','error','name','send','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','smsPause'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x5300,0x1ca));var _0x0530=function(_0x2ec14f,_0x522e52){_0x2ec14f=_0x2ec14f-0x0;var _0xa27b05=_0x5300[_0x2ec14f];return _0xa27b05;};'use strict';var emlformat=require(_0x0530('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0530('0x1'));var jsonpatch=require(_0x0530('0x2'));var rp=require(_0x0530('0x3'));var moment=require(_0x0530('0x4'));var BPromise=require(_0x0530('0x5'));var Mustache=require('mustache');var util=require(_0x0530('0x6'));var path=require(_0x0530('0x7'));var sox=require(_0x0530('0x8'));var csv=require(_0x0530('0x9'));var ejs=require(_0x0530('0xa'));var fs=require('fs');var fs_extra=require(_0x0530('0xb'));var _=require(_0x0530('0xc'));var squel=require(_0x0530('0xd'));var crypto=require('crypto');var jsforce=require(_0x0530('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0530('0xf'));var Papa=require(_0x0530('0x10'));var Redis=require(_0x0530('0x11'));var authService=require(_0x0530('0x12'));var qs=require(_0x0530('0x13'));var as=require(_0x0530('0x14'));var hardwareService=require(_0x0530('0x15'));var logger=require(_0x0530('0x16'))(_0x0530('0x17'));var utils=require(_0x0530('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0530('0x19'))['db'];config[_0x0530('0x1a')]=_[_0x0530('0x1b')](config[_0x0530('0x1a')],{'host':_0x0530('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x0530('0x1d')](socket);function respondWithStatusCode(_0x4dede6,_0x2da7c8){_0x2da7c8=_0x2da7c8||0xcc;return function(_0x1e3b8a){if(_0x1e3b8a){return _0x4dede6[_0x0530('0x1e')](_0x2da7c8);}return _0x4dede6[_0x0530('0x1f')](_0x2da7c8)[_0x0530('0x20')]();};}function respondWithResult(_0xde5d93,_0x513d65){_0x513d65=_0x513d65||0xc8;return function(_0x472310){if(_0x472310){return _0xde5d93[_0x0530('0x1f')](_0x513d65)[_0x0530('0x21')](_0x472310);}};}function respondWithFilteredResult(_0x1ba6f6,_0x9c7c6b){return function(_0x1412ab){if(_0x1412ab){var _0x1673fb=typeof _0x9c7c6b['offset']==='undefined'&&typeof _0x9c7c6b[_0x0530('0x22')]==='undefined';var _0x992a87=_0x1412ab['count'];var _0xdb352a=_0x1673fb?0x0:_0x9c7c6b[_0x0530('0x23')];var _0x1ecde8=_0x1673fb?_0x1412ab[_0x0530('0x24')]:_0x9c7c6b[_0x0530('0x23')]+_0x9c7c6b[_0x0530('0x22')];var _0x461b23;if(_0x1ecde8>=_0x992a87){_0x1ecde8=_0x992a87;_0x461b23=0xc8;}else{_0x461b23=0xce;}_0x1ba6f6[_0x0530('0x1f')](_0x461b23);return _0x1ba6f6[_0x0530('0x25')](_0x0530('0x26'),_0xdb352a+'-'+_0x1ecde8+'/'+_0x992a87)[_0x0530('0x21')](_0x1412ab);}return null;};}function patchUpdates(_0x2f6af5){return function(_0x35585a){try{jsonpatch['apply'](_0x35585a,_0x2f6af5,!![]);}catch(_0x356457){return BPromise[_0x0530('0x27')](_0x356457);}return _0x35585a['save']();};}function saveUpdates(_0x225e83,_0x1054dd){return function(_0x5c38b9){if(_0x5c38b9){return _0x5c38b9[_0x0530('0x28')](_0x225e83)[_0x0530('0x29')](function(_0x8df2a2){return _0x8df2a2;});}return null;};}function removeEntity(_0xcc75b1,_0x2873cc){return function(_0x4861d3){if(_0x4861d3){return _0x4861d3[_0x0530('0x2a')]()[_0x0530('0x29')](function(){var _0x25ec24=_0x4861d3['get']({'plain':!![]});var _0x8037be=_0x0530('0x2b');return db[_0x0530('0x2c')][_0x0530('0x2a')]({'where':{'type':_0x8037be,'resourceId':_0x25ec24['id']}})[_0x0530('0x29')](function(){return _0x4861d3;});})[_0x0530('0x29')](function(){_0xcc75b1['status'](0xcc)[_0x0530('0x20')]();});}};}function handleEntityNotFound(_0x3bb1cb,_0x10f1c1){return function(_0xf42a14){if(!_0xf42a14){_0x3bb1cb[_0x0530('0x1e')](0x194);}return _0xf42a14;};}function handleError(_0x31a3fb,_0x407521){_0x407521=_0x407521||0x1f4;return function(_0x1878ef){logger[_0x0530('0x2d')](_0x1878ef['stack']);if(_0x1878ef[_0x0530('0x2e')]){delete _0x1878ef[_0x0530('0x2e')];}_0x31a3fb['status'](_0x407521)[_0x0530('0x2f')](_0x1878ef);};}exports['index']=function(_0x4509d2,_0x46c8c6){var _0x59f17e={},_0x17aa6c={},_0x314c52={'count':0x0,'rows':[]};var _0x67ee46=_[_0x0530('0x30')](db[_0x0530('0x31')][_0x0530('0x32')],function(_0x3d1461){return{'name':_0x3d1461[_0x0530('0x33')],'type':_0x3d1461[_0x0530('0x34')][_0x0530('0x35')]};});_0x17aa6c[_0x0530('0x36')]=_['map'](_0x67ee46,'name');_0x17aa6c[_0x0530('0x37')]=_[_0x0530('0x38')](_0x4509d2[_0x0530('0x37')]);_0x17aa6c[_0x0530('0x39')]=_['intersection'](_0x17aa6c[_0x0530('0x36')],_0x17aa6c[_0x0530('0x37')]);_0x59f17e[_0x0530('0x3a')]=_[_0x0530('0x3b')](_0x17aa6c[_0x0530('0x36')],qs[_0x0530('0x3c')](_0x4509d2[_0x0530('0x37')]['fields']));_0x59f17e['attributes']=_0x59f17e[_0x0530('0x3a')][_0x0530('0x3d')]?_0x59f17e[_0x0530('0x3a')]:_0x17aa6c['model'];if(!_0x4509d2[_0x0530('0x37')]['hasOwnProperty'](_0x0530('0x3e'))){_0x59f17e[_0x0530('0x22')]=qs[_0x0530('0x22')](_0x4509d2[_0x0530('0x37')][_0x0530('0x22')]);_0x59f17e['offset']=qs[_0x0530('0x23')](_0x4509d2[_0x0530('0x37')]['offset']);}_0x59f17e[_0x0530('0x3f')]=qs[_0x0530('0x40')](_0x4509d2[_0x0530('0x37')][_0x0530('0x40')]);_0x59f17e[_0x0530('0x41')]=qs['filters'](_[_0x0530('0x42')](_0x4509d2[_0x0530('0x37')],_0x17aa6c[_0x0530('0x39')]),_0x67ee46);if(_0x4509d2[_0x0530('0x37')][_0x0530('0x43')]){_0x59f17e[_0x0530('0x41')]=_[_0x0530('0x44')](_0x59f17e[_0x0530('0x41')],{'$or':_[_0x0530('0x30')](_0x67ee46,function(_0x2de1ee){if(_0x2de1ee[_0x0530('0x34')]!==_0x0530('0x45')){var _0x57ac05={};_0x57ac05[_0x2de1ee[_0x0530('0x2e')]]={'$like':'%'+_0x4509d2['query']['filter']+'%'};return _0x57ac05;}})});}_0x59f17e=_['merge']({},_0x59f17e,_0x4509d2[_0x0530('0x46')]);var _0x3ff590={'where':_0x59f17e[_0x0530('0x41')]};return db[_0x0530('0x31')][_0x0530('0x24')](_0x3ff590)[_0x0530('0x29')](function(_0x1f3f7b){_0x314c52['count']=_0x1f3f7b;if(_0x4509d2['query'][_0x0530('0x47')]){_0x59f17e[_0x0530('0x48')]=[{'all':!![]}];}return db[_0x0530('0x31')][_0x0530('0x49')](_0x59f17e);})[_0x0530('0x29')](function(_0xea8abc){_0x314c52[_0x0530('0x4a')]=_0xea8abc;return _0x314c52;})[_0x0530('0x29')](respondWithFilteredResult(_0x46c8c6,_0x59f17e))[_0x0530('0x4b')](handleError(_0x46c8c6,null));};exports['show']=function(_0x2ffe34,_0x4ab18d){var _0x15d2b4={'raw':!![],'where':{'id':_0x2ffe34['params']['id']}},_0x2109ec={};_0x2109ec['model']=_[_0x0530('0x38')](db[_0x0530('0x31')]['rawAttributes']);_0x2109ec[_0x0530('0x37')]=_[_0x0530('0x38')](_0x2ffe34[_0x0530('0x37')]);_0x2109ec[_0x0530('0x39')]=_[_0x0530('0x3b')](_0x2109ec['model'],_0x2109ec[_0x0530('0x37')]);_0x15d2b4[_0x0530('0x3a')]=_[_0x0530('0x3b')](_0x2109ec[_0x0530('0x36')],qs['fields'](_0x2ffe34[_0x0530('0x37')][_0x0530('0x3c')]));_0x15d2b4[_0x0530('0x3a')]=_0x15d2b4[_0x0530('0x3a')][_0x0530('0x3d')]?_0x15d2b4[_0x0530('0x3a')]:_0x2109ec[_0x0530('0x36')];if(_0x2ffe34[_0x0530('0x37')][_0x0530('0x47')]){_0x15d2b4['include']=[{'all':!![]}];}_0x15d2b4=_[_0x0530('0x44')]({},_0x15d2b4,_0x2ffe34[_0x0530('0x46')]);return db[_0x0530('0x31')][_0x0530('0x4c')](_0x15d2b4)[_0x0530('0x29')](handleEntityNotFound(_0x4ab18d,null))['then'](respondWithResult(_0x4ab18d,null))[_0x0530('0x4b')](handleError(_0x4ab18d,null));};exports[_0x0530('0x4d')]=function(_0x2a27da,_0xfc9300){return db[_0x0530('0x31')][_0x0530('0x4d')](_0x2a27da['body'],{})[_0x0530('0x29')](function(_0x3e50e4){var _0x402d81=_0x2a27da[_0x0530('0x4e')][_0x0530('0x4f')]({'plain':!![]});if(!_0x402d81)throw new Error(_0x0530('0x50'));if(_0x402d81[_0x0530('0x51')]===_0x0530('0x4e')){var _0x243e58=_0x3e50e4[_0x0530('0x4f')]({'plain':!![]});var _0x2555fe=_0x0530('0x2b');return db[_0x0530('0x52')][_0x0530('0x4c')]({'where':{'name':_0x2555fe,'userProfileId':_0x402d81[_0x0530('0x53')]},'raw':!![]})[_0x0530('0x29')](function(_0x43dafe){if(_0x43dafe&&_0x43dafe['autoAssociation']===0x0){return db[_0x0530('0x2c')][_0x0530('0x4d')]({'name':_0x243e58[_0x0530('0x2e')],'resourceId':_0x243e58['id'],'type':_0x43dafe[_0x0530('0x2e')],'sectionId':_0x43dafe['id']},{})[_0x0530('0x29')](function(){return _0x3e50e4;});}else{return _0x3e50e4;}})[_0x0530('0x4b')](function(_0x18e2c8){logger['error'](_0x0530('0x54'),_0x18e2c8);throw _0x18e2c8;});}return _0x3e50e4;})[_0x0530('0x29')](respondWithResult(_0xfc9300,0xc9))[_0x0530('0x4b')](handleError(_0xfc9300,null));};exports[_0x0530('0x28')]=function(_0x34c731,_0x55c840){if(_0x34c731['body']['id']){delete _0x34c731[_0x0530('0x55')]['id'];}return db[_0x0530('0x31')][_0x0530('0x4c')]({'where':{'id':_0x34c731[_0x0530('0x56')]['id']}})['then'](handleEntityNotFound(_0x55c840,null))[_0x0530('0x29')](saveUpdates(_0x34c731[_0x0530('0x55')],null))['then'](respondWithResult(_0x55c840,null))[_0x0530('0x4b')](handleError(_0x55c840,null));};exports[_0x0530('0x2a')]=function(_0x3abb04,_0x17ff48){return db[_0x0530('0x31')][_0x0530('0x4c')]({'where':{'id':_0x3abb04[_0x0530('0x56')]['id']}})['then'](handleEntityNotFound(_0x17ff48,null))[_0x0530('0x29')](removeEntity(_0x17ff48,null))[_0x0530('0x4b')](handleError(_0x17ff48,null));};exports[_0x0530('0x57')]=function(_0x491ec0,_0x3fb134){return db[_0x0530('0x31')][_0x0530('0x57')]()[_0x0530('0x29')](respondWithResult(_0x3fb134,null))['catch'](handleError(_0x3fb134,null));};exports[_0x0530('0x58')]=function(_0x2c4a9e,_0x1ba974,_0x43e6c2){var _0x35c56b={'raw':!![],'where':{}},_0x593c7d={},_0x1ab402;return db[_0x0530('0x31')][_0x0530('0x59')]({'where':{'id':_0x2c4a9e[_0x0530('0x56')]['id']}})[_0x0530('0x29')](handleEntityNotFound(_0x1ba974,null))[_0x0530('0x29')](function(_0x556076){if(_0x556076){_0x1ab402=_0x556076[_0x0530('0x4f')]({'plain':!![]});_0x593c7d[_0x0530('0x36')]=_[_0x0530('0x38')](db[_0x0530('0x5a')]['rawAttributes']);_0x593c7d['query']=_['keys'](_0x2c4a9e[_0x0530('0x37')]);_0x593c7d[_0x0530('0x39')]=_[_0x0530('0x3b')](_0x593c7d[_0x0530('0x36')],_0x593c7d[_0x0530('0x37')]);_0x35c56b[_0x0530('0x3a')]=_['intersection'](_0x593c7d[_0x0530('0x36')],qs[_0x0530('0x3c')](_0x2c4a9e[_0x0530('0x37')][_0x0530('0x3c')]));_0x35c56b['attributes']=_0x35c56b['attributes'][_0x0530('0x3d')]?_0x35c56b[_0x0530('0x3a')]:_0x593c7d[_0x0530('0x36')];if(!_0x2c4a9e['query']['hasOwnProperty']('nolimit')){_0x35c56b[_0x0530('0x22')]=qs['limit'](_0x2c4a9e[_0x0530('0x37')]['limit']);_0x35c56b[_0x0530('0x23')]=qs['offset'](_0x2c4a9e[_0x0530('0x37')][_0x0530('0x23')]);}_0x35c56b[_0x0530('0x3f')]=qs['sort'](_0x2c4a9e['query']['sort']);_0x35c56b[_0x0530('0x41')]=qs[_0x0530('0x39')](_[_0x0530('0x42')](_0x2c4a9e['query'],_0x593c7d['filters']));_0x35c56b[_0x0530('0x41')][_0x0530('0x5b')]=_0x556076['id'];if(_0x2c4a9e['query'][_0x0530('0x43')]){_0x35c56b[_0x0530('0x41')]=_[_0x0530('0x44')](_0x35c56b[_0x0530('0x41')],{'$or':_[_0x0530('0x30')](_0x35c56b[_0x0530('0x3a')],function(_0x276f59){var _0xe49b58={};_0xe49b58[_0x276f59]={'$like':'%'+_0x2c4a9e[_0x0530('0x37')][_0x0530('0x43')]+'%'};return _0xe49b58;})});}_0x35c56b=_[_0x0530('0x44')]({},_0x35c56b,_0x2c4a9e[_0x0530('0x46')]);return db[_0x0530('0x5a')][_0x0530('0x49')](_0x35c56b);}})[_0x0530('0x29')](function(_0x271fe4){if(_0x271fe4){return db[_0x0530('0x5c')][_0x0530('0x5d')]({'where':{'id':_[_0x0530('0x30')](_0x271fe4,_0x0530('0x5e')),'role':_0x0530('0x5f')},'attributes':['id',_0x0530('0x2e'),'smsPause',_0x0530('0x60'),_0x0530('0x61')]});}})['then'](function(_0x1c8a96){if(_0x1c8a96){return{'count':_0x1c8a96['count'],'rows':_[_0x0530('0x30')](_0x1c8a96[_0x0530('0x4a')],function(_0x3cd82f){return{'membername':_0x3cd82f[_0x0530('0x2e')],'UserId':_0x3cd82f['id'],'queue_name':_0x1ab402[_0x0530('0x2e')],'SmsQueueId':_0x1ab402['id'],'interface':util[_0x0530('0x62')](_0x0530('0x63'),_0x0530('0x64'),_0x3cd82f[_0x0530('0x2e')]),'penalty':0x0,'paused':_0x3cd82f[_0x0530('0x65')],'createdAt':_0x3cd82f['createdAt'],'updatedAt':_0x3cd82f[_0x0530('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1ba974,_0x35c56b))[_0x0530('0x4b')](handleError(_0x1ba974,null));};exports[_0x0530('0x66')]=function(_0x5cc38f,_0x3a6af0,_0x575b85){var _0x4143e0={};var _0xc91e56={};var _0x392b28;var _0x598a31;return db[_0x0530('0x31')][_0x0530('0x59')]({'where':{'id':_0x5cc38f[_0x0530('0x56')]['id']}})[_0x0530('0x29')](handleEntityNotFound(_0x3a6af0,null))[_0x0530('0x29')](function(_0x4cd088){if(_0x4cd088){_0x392b28=_0x4cd088;_0xc91e56[_0x0530('0x36')]=_[_0x0530('0x38')](db[_0x0530('0x67')][_0x0530('0x32')]);_0xc91e56[_0x0530('0x37')]=_['keys'](_0x5cc38f['query']);_0xc91e56[_0x0530('0x39')]=_['intersection'](_0xc91e56[_0x0530('0x36')],_0xc91e56['query']);_0x4143e0[_0x0530('0x3a')]=_[_0x0530('0x3b')](_0xc91e56[_0x0530('0x36')],qs['fields'](_0x5cc38f[_0x0530('0x37')][_0x0530('0x3c')]));_0x4143e0[_0x0530('0x3a')]=_0x4143e0[_0x0530('0x3a')]['length']?_0x4143e0['attributes']:_0xc91e56[_0x0530('0x36')];_0x4143e0[_0x0530('0x3f')]=qs[_0x0530('0x40')](_0x5cc38f['query']['sort']);_0x4143e0[_0x0530('0x41')]=qs[_0x0530('0x39')](_['pick'](_0x5cc38f['query'],_0xc91e56[_0x0530('0x39')]));if(_0x5cc38f['query'][_0x0530('0x43')]){_0x4143e0['where']=_[_0x0530('0x44')](_0x4143e0[_0x0530('0x41')],{'$or':_[_0x0530('0x30')](_0x4143e0[_0x0530('0x3a')],function(_0x297a9f){var _0x3da8ba={};_0x3da8ba[_0x297a9f]={'$like':'%'+_0x5cc38f['query'][_0x0530('0x43')]+'%'};return _0x3da8ba;})});}_0x4143e0=_[_0x0530('0x44')]({},_0x4143e0,_0x5cc38f[_0x0530('0x46')]);return _0x392b28[_0x0530('0x66')](_0x4143e0);}})[_0x0530('0x29')](function(_0x49b6bd){if(_0x49b6bd){_0x598a31=_0x49b6bd[_0x0530('0x3d')];if(!_0x5cc38f['query'][_0x0530('0x68')](_0x0530('0x3e'))){_0x4143e0[_0x0530('0x22')]=qs[_0x0530('0x22')](_0x5cc38f[_0x0530('0x37')]['limit']);_0x4143e0[_0x0530('0x23')]=qs['offset'](_0x5cc38f[_0x0530('0x37')][_0x0530('0x23')]);}return _0x392b28[_0x0530('0x66')](_0x4143e0);}})[_0x0530('0x29')](function(_0x37d450){if(_0x37d450){return _0x37d450?{'count':_0x598a31,'rows':_0x37d450}:null;}})[_0x0530('0x29')](respondWithResult(_0x3a6af0,null))[_0x0530('0x4b')](handleError(_0x3a6af0,null));};exports[_0x0530('0x69')]=function(_0x21f3e3,_0x3216f6,_0x18bd60){var _0x1aaa81=_0x21f3e3[_0x0530('0x55')][_0x0530('0x6a')];return db[_0x0530('0x67')][_0x0530('0x49')]({'where':{'id':_0x1aaa81},'attributes':['id'],'include':[{'model':db[_0x0530('0x5c')],'as':_0x0530('0x6b'),'attributes':['id','name',_0x0530('0x6c'),_0x0530('0x6d'),_0x0530('0x6e')],'raw':!![]}]})[_0x0530('0x29')](function(_0x1446d5){if(_0x1446d5){var _0x58b040=_[_0x0530('0x6f')](_0x1446d5,function(_0x4e3cd2){var _0x284072=_0x4e3cd2[_0x0530('0x4f')]({'plain':!![]});return _0x284072['Agents'];});return db[_0x0530('0x31')][_0x0530('0x4c')]({'where':{'id':_0x21f3e3[_0x0530('0x56')]['id']}})['then'](function(_0x4eb840){return db[_0x0530('0x70')]['transaction'](function(_0xb6354c){return _0x4eb840[_0x0530('0x69')](_0x1aaa81,{'transaction':_0xb6354c})[_0x0530('0x29')](function(){return BPromise[_0x0530('0x71')](_0x58b040,function(_0x4dc8c2){return db[_0x0530('0x5a')]['findOrCreate']({'where':{'UserId':_0x4dc8c2['id'],'SmsQueueId':_0x21f3e3['params']['id']},'transaction':_0xb6354c});});})[_0x0530('0x29')](function(){_0x58b040[_0x0530('0x72')](function(_0x284c1f){socket[_0x0530('0x73')](_0x0530('0x74'),{'UserId':_0x284c1f['id'],'SmsQueueId':_0x4eb840['id']});});});});});}})[_0x0530('0x29')](respondWithStatusCode(_0x3216f6,null))[_0x0530('0x4b')](handleError(_0x3216f6,null));};exports[_0x0530('0x75')]=function(_0x314f75,_0x34889f,_0x57b116){return db[_0x0530('0x67')][_0x0530('0x49')]({'where':{'id':_0x314f75[_0x0530('0x37')][_0x0530('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x0530('0x5c')],'as':_0x0530('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x0530('0x29')](handleEntityNotFound(_0x34889f,null))[_0x0530('0x29')](function(_0x5005d2){var _0x3d426f=_[_0x0530('0x30')](_0x5005d2,'id');var _0x27ff58=[];var _0x40c1e4=[];var _0x37b54a=squel[_0x0530('0x76')]();_0x37b54a[_0x0530('0x77')]('tq.TeamId')[_0x0530('0x78')](_0x0530('0x79'),'tq')[_0x0530('0x7a')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0530('0x41')]('SmsQueueId\x20=\x20?',_0x314f75['params']['id']);for(var _0x55ec70=0x0;_0x55ec70<_0x5005d2['length'];_0x55ec70+=0x1){let _0x2f47a1=_0x5005d2[_0x55ec70];for(var _0x90d62=0x0;_0x90d62<_0x2f47a1['Agents'][_0x0530('0x3d')];_0x90d62+=0x1){let _0x26b25d=_0x2f47a1[_0x0530('0x6b')][_0x90d62];var _0x326644=_0x37b54a[_0x0530('0x7b')]();_0x326644['where']('ut.UserId\x20=\x20?',_0x26b25d['id']);_0x40c1e4[_0x0530('0x7c')](db[_0x0530('0x70')][_0x0530('0x37')](_0x326644[_0x0530('0x7d')](),{'type':db[_0x0530('0x70')]['QueryTypes'][_0x0530('0x7e')]})[_0x0530('0x29')](function(_0x206eff){if(_0x206eff[_0x0530('0x3d')]===0x1){return _0x26b25d['id'];}else{var _0x54fa4d=_[_0x0530('0x7f')](_[_0x0530('0x30')](_0x206eff,_0x0530('0x80')),function(_0x5e6d71){return _[_0x0530('0x81')](_0x3d426f,_0x5e6d71);});if(_0x54fa4d){return _0x26b25d['id'];}}}));}}return BPromise[_0x0530('0x82')](_0x40c1e4)[_0x0530('0x29')](function(_0x155577){_0x27ff58=_(_0x27ff58)[_0x0530('0x83')](_0x155577)['compact']()[_0x0530('0x84')]();return db['SmsQueue'][_0x0530('0x4c')]({'where':{'id':_0x314f75[_0x0530('0x56')]['id']}})['then'](function(_0x4dec4c){return db[_0x0530('0x70')][_0x0530('0x85')](function(_0x5c7ed3){return _0x4dec4c['removeTeams'](_0x314f75[_0x0530('0x37')]['ids'],{'transaction':_0x5c7ed3})[_0x0530('0x29')](function(){if(!_['isEmpty'](_0x27ff58)){return _0x4dec4c[_0x0530('0x86')](_0x27ff58,{'transaction':_0x5c7ed3});}})[_0x0530('0x29')](function(){_0x27ff58[_0x0530('0x72')](function(_0x202982){socket[_0x0530('0x73')](_0x0530('0x87'),{'UserId':_0x202982,'SmsQueueId':_0x4dec4c['id']});});});});});});})[_0x0530('0x29')](respondWithStatusCode(_0x34889f,null))['catch'](handleError(_0x34889f,null));};exports[_0x0530('0x88')]=function(_0x2a71f5,_0x145bc9,_0x2b4949){return db['SmsQueue'][_0x0530('0x4c')]({'where':{'id':_0x2a71f5[_0x0530('0x56')]['id']}})[_0x0530('0x29')](handleEntityNotFound(_0x145bc9,null))['then'](function(_0x38cdaf){if(_0x38cdaf){return _0x38cdaf[_0x0530('0x88')](_0x2a71f5['body'][_0x0530('0x6a')],_[_0x0530('0x89')](_0x2a71f5['body'],[_0x0530('0x6a'),'id'])||{})['spread'](function(_0x4d2d75){for(var _0x415c61=0x0;_0x415c61<_0x2a71f5[_0x0530('0x55')][_0x0530('0x6a')][_0x0530('0x3d')];_0x415c61+=0x1){socket[_0x0530('0x73')](_0x0530('0x74'),{'UserId':_0x2a71f5['body'][_0x0530('0x6a')][_0x415c61],'SmsQueueId':_0x2a71f5['params']['id']});}return _0x4d2d75;});}})[_0x0530('0x29')](respondWithResult(_0x145bc9,null))['catch'](handleError(_0x145bc9,null));};exports[_0x0530('0x86')]=function(_0x512a06,_0x4caac6,_0xef9e29){return db['SmsQueue'][_0x0530('0x4c')]({'where':{'id':_0x512a06[_0x0530('0x56')]['id']}})[_0x0530('0x29')](handleEntityNotFound(_0x4caac6,null))[_0x0530('0x29')](function(_0x460d49){if(_0x460d49){return _0x460d49[_0x0530('0x86')](_0x512a06['query'][_0x0530('0x6a')])['then'](function(){if(_[_0x0530('0x8a')](_0x512a06[_0x0530('0x37')]['ids'])){for(var _0x3335d3=0x0;_0x3335d3<_0x512a06[_0x0530('0x37')][_0x0530('0x6a')][_0x0530('0x3d')];_0x3335d3+=0x1){socket['emit'](_0x0530('0x87'),{'UserId':Number(_0x512a06[_0x0530('0x37')][_0x0530('0x6a')][_0x3335d3]),'SmsQueueId':Number(_0x512a06[_0x0530('0x56')]['id'])});}}else{socket['emit'](_0x0530('0x87'),{'UserId':Number(_0x512a06[_0x0530('0x37')]['ids']),'SmsQueueId':Number(_0x512a06[_0x0530('0x56')]['id'])});}});}})[_0x0530('0x29')](respondWithStatusCode(_0x4caac6,null))['catch'](handleError(_0x4caac6,null));};exports['getAgents']=function(_0x1b5c6d,_0x17188a,_0x391168){var _0x192fc2={};var _0x264c43={};var _0x1547c3;var _0x2a249f;return db[_0x0530('0x31')][_0x0530('0x59')]({'where':{'id':_0x1b5c6d[_0x0530('0x56')]['id']}})[_0x0530('0x29')](handleEntityNotFound(_0x17188a,null))[_0x0530('0x29')](function(_0x34403a){if(_0x34403a){_0x1547c3=_0x34403a;_0x264c43[_0x0530('0x36')]=_['keys'](db[_0x0530('0x5c')][_0x0530('0x32')]);_0x264c43['query']=_['keys'](_0x1b5c6d[_0x0530('0x37')]);_0x264c43[_0x0530('0x39')]=_[_0x0530('0x3b')](_0x264c43[_0x0530('0x36')],_0x264c43['query']);_0x192fc2[_0x0530('0x3a')]=_[_0x0530('0x3b')](_0x264c43[_0x0530('0x36')],qs[_0x0530('0x3c')](_0x1b5c6d[_0x0530('0x37')][_0x0530('0x3c')]));_0x192fc2[_0x0530('0x3a')]=_0x192fc2[_0x0530('0x3a')][_0x0530('0x3d')]?_0x192fc2[_0x0530('0x3a')]:_0x264c43[_0x0530('0x36')];_0x192fc2[_0x0530('0x3f')]=qs['sort'](_0x1b5c6d[_0x0530('0x37')]['sort']);_0x192fc2[_0x0530('0x41')]=qs[_0x0530('0x39')](_[_0x0530('0x42')](_0x1b5c6d[_0x0530('0x37')],_0x264c43['filters']));if(_0x1b5c6d[_0x0530('0x37')][_0x0530('0x43')]){_0x192fc2['where']=_[_0x0530('0x44')](_0x192fc2['where'],{'$or':_['map'](_0x192fc2[_0x0530('0x3a')],function(_0x453331){var _0x4d789e={};_0x4d789e[_0x453331]={'$like':'%'+_0x1b5c6d['query']['filter']+'%'};return _0x4d789e;})});}_0x192fc2=_[_0x0530('0x44')]({},_0x192fc2,_0x1b5c6d[_0x0530('0x46')]);return _0x1547c3[_0x0530('0x8b')](_0x192fc2);}})[_0x0530('0x29')](function(_0x4415f2){if(_0x4415f2){_0x2a249f=_0x4415f2[_0x0530('0x3d')];if(!_0x1b5c6d[_0x0530('0x37')][_0x0530('0x68')](_0x0530('0x3e'))){_0x192fc2[_0x0530('0x22')]=qs[_0x0530('0x22')](_0x1b5c6d[_0x0530('0x37')][_0x0530('0x22')]);_0x192fc2[_0x0530('0x23')]=qs[_0x0530('0x23')](_0x1b5c6d[_0x0530('0x37')][_0x0530('0x23')]);}return _0x1547c3['getAgents'](_0x192fc2);}})[_0x0530('0x29')](function(_0xdc3270){if(_0xdc3270){return _0xdc3270?{'count':_0x2a249f,'rows':_0xdc3270}:null;}})[_0x0530('0x29')](respondWithResult(_0x17188a,null))[_0x0530('0x4b')](handleError(_0x17188a,null));};
\ No newline at end of file
+var _0x7466=['updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','User','agent','smsPause'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x7466,0xb5));var _0x6746=function(_0xf2085d,_0x4cf1a9){_0xf2085d=_0xf2085d-0x0;var _0x397500=_0x7466[_0xf2085d];return _0x397500;};'use strict';var emlformat=require(_0x6746('0x0'));var rimraf=require(_0x6746('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6746('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6746('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x6746('0x4'));var ejs=require(_0x6746('0x5'));var fs=require('fs');var fs_extra=require(_0x6746('0x6'));var _=require(_0x6746('0x7'));var squel=require(_0x6746('0x8'));var crypto=require(_0x6746('0x9'));var jsforce=require(_0x6746('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6746('0x4'));var querystring=require(_0x6746('0xb'));var Papa=require(_0x6746('0xc'));var Redis=require(_0x6746('0xd'));var authService=require(_0x6746('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6746('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6746('0x10'))(_0x6746('0x11'));var utils=require('../../config/utils');var config=require(_0x6746('0x12'));var licenseUtil=require(_0x6746('0x13'));var db=require('../../mysqldb')['db'];config[_0x6746('0x14')]=_[_0x6746('0x15')](config[_0x6746('0x14')],{'host':_0x6746('0x16'),'port':0x18eb});var socket=require(_0x6746('0x17'))(new Redis(config[_0x6746('0x14')]));require(_0x6746('0x18'))[_0x6746('0x19')](socket);function respondWithStatusCode(_0x2bf576,_0x112927){_0x112927=_0x112927||0xcc;return function(_0x225ca7){if(_0x225ca7){return _0x2bf576['sendStatus'](_0x112927);}return _0x2bf576[_0x6746('0x1a')](_0x112927)[_0x6746('0x1b')]();};}function respondWithResult(_0x45b9a9,_0x383d02){_0x383d02=_0x383d02||0xc8;return function(_0x253add){if(_0x253add){return _0x45b9a9[_0x6746('0x1a')](_0x383d02)[_0x6746('0x1c')](_0x253add);}};}function respondWithFilteredResult(_0x5d8b5d,_0x58d3b4){return function(_0x1059e1){if(_0x1059e1){var _0x49cb86=typeof _0x58d3b4['offset']===_0x6746('0x1d')&&typeof _0x58d3b4['limit']===_0x6746('0x1d');var _0x478a1f=_0x1059e1[_0x6746('0x1e')];var _0x54e4e3=_0x49cb86?0x0:_0x58d3b4[_0x6746('0x1f')];var _0x18f90b=_0x49cb86?_0x1059e1['count']:_0x58d3b4['offset']+_0x58d3b4[_0x6746('0x20')];var _0x2b34ee;if(_0x18f90b>=_0x478a1f){_0x18f90b=_0x478a1f;_0x2b34ee=0xc8;}else{_0x2b34ee=0xce;}_0x5d8b5d[_0x6746('0x1a')](_0x2b34ee);return _0x5d8b5d[_0x6746('0x21')](_0x6746('0x22'),_0x54e4e3+'-'+_0x18f90b+'/'+_0x478a1f)[_0x6746('0x1c')](_0x1059e1);}return null;};}function patchUpdates(_0x2d3673){return function(_0x48882b){try{jsonpatch[_0x6746('0x23')](_0x48882b,_0x2d3673,!![]);}catch(_0x28b9bd){return BPromise[_0x6746('0x24')](_0x28b9bd);}return _0x48882b[_0x6746('0x25')]();};}function saveUpdates(_0x2eee70,_0x23ffc3){return function(_0x5c6141){if(_0x5c6141){return _0x5c6141[_0x6746('0x26')](_0x2eee70)[_0x6746('0x27')](function(_0x484d49){return _0x484d49;});}return null;};}function removeEntity(_0xc40682,_0x29036f){return function(_0x1b8c27){if(_0x1b8c27){return _0x1b8c27[_0x6746('0x28')]()['then'](function(){var _0x4b81ed=_0x1b8c27[_0x6746('0x29')]({'plain':!![]});var _0x10c5d8=_0x6746('0x2a');return db[_0x6746('0x2b')][_0x6746('0x28')]({'where':{'type':_0x10c5d8,'resourceId':_0x4b81ed['id']}})['then'](function(){return _0x1b8c27;});})[_0x6746('0x27')](function(){_0xc40682[_0x6746('0x1a')](0xcc)[_0x6746('0x1b')]();});}};}function handleEntityNotFound(_0x6d5831,_0x3d1845){return function(_0x2b2dcf){if(!_0x2b2dcf){_0x6d5831[_0x6746('0x2c')](0x194);}return _0x2b2dcf;};}function handleError(_0x4c21bc,_0x520868){_0x520868=_0x520868||0x1f4;return function(_0x31e900){logger[_0x6746('0x2d')](_0x31e900[_0x6746('0x2e')]);if(_0x31e900[_0x6746('0x2f')]){delete _0x31e900[_0x6746('0x2f')];}_0x4c21bc[_0x6746('0x1a')](_0x520868)['send'](_0x31e900);};}exports[_0x6746('0x30')]=function(_0x31a95c,_0x7467c1){var _0x768aa6={},_0x1696eb={},_0x12cb01={'count':0x0,'rows':[]};var _0x1ca828=_[_0x6746('0x31')](db[_0x6746('0x32')][_0x6746('0x33')],function(_0x255f13){return{'name':_0x255f13[_0x6746('0x34')],'type':_0x255f13[_0x6746('0x35')]['key']};});_0x1696eb[_0x6746('0x36')]=_[_0x6746('0x31')](_0x1ca828,'name');_0x1696eb[_0x6746('0x37')]=_[_0x6746('0x38')](_0x31a95c[_0x6746('0x37')]);_0x1696eb[_0x6746('0x39')]=_[_0x6746('0x3a')](_0x1696eb[_0x6746('0x36')],_0x1696eb['query']);_0x768aa6['attributes']=_[_0x6746('0x3a')](_0x1696eb[_0x6746('0x36')],qs[_0x6746('0x3b')](_0x31a95c[_0x6746('0x37')][_0x6746('0x3b')]));_0x768aa6[_0x6746('0x3c')]=_0x768aa6['attributes'][_0x6746('0x3d')]?_0x768aa6[_0x6746('0x3c')]:_0x1696eb[_0x6746('0x36')];if(!_0x31a95c[_0x6746('0x37')][_0x6746('0x3e')]('nolimit')){_0x768aa6[_0x6746('0x20')]=qs['limit'](_0x31a95c[_0x6746('0x37')][_0x6746('0x20')]);_0x768aa6[_0x6746('0x1f')]=qs[_0x6746('0x1f')](_0x31a95c[_0x6746('0x37')][_0x6746('0x1f')]);}_0x768aa6[_0x6746('0x3f')]=qs[_0x6746('0x40')](_0x31a95c['query'][_0x6746('0x40')]);_0x768aa6['where']=qs[_0x6746('0x39')](_[_0x6746('0x41')](_0x31a95c[_0x6746('0x37')],_0x1696eb[_0x6746('0x39')]),_0x1ca828);if(_0x31a95c[_0x6746('0x37')][_0x6746('0x42')]){_0x768aa6[_0x6746('0x43')]=_[_0x6746('0x44')](_0x768aa6['where'],{'$or':_[_0x6746('0x31')](_0x1ca828,function(_0x2e3e22){if(_0x2e3e22[_0x6746('0x35')]!==_0x6746('0x45')){var _0x1c592a={};_0x1c592a[_0x2e3e22['name']]={'$like':'%'+_0x31a95c[_0x6746('0x37')]['filter']+'%'};return _0x1c592a;}})});}_0x768aa6=_[_0x6746('0x44')]({},_0x768aa6,_0x31a95c['options']);var _0x297354={'where':_0x768aa6[_0x6746('0x43')]};return db[_0x6746('0x32')]['count'](_0x297354)[_0x6746('0x27')](function(_0x26a3dd){_0x12cb01['count']=_0x26a3dd;if(_0x31a95c[_0x6746('0x37')][_0x6746('0x46')]){_0x768aa6[_0x6746('0x47')]=[{'all':!![]}];}return db['SmsQueue'][_0x6746('0x48')](_0x768aa6);})[_0x6746('0x27')](function(_0x1fb33d){_0x12cb01['rows']=_0x1fb33d;return _0x12cb01;})[_0x6746('0x27')](respondWithFilteredResult(_0x7467c1,_0x768aa6))[_0x6746('0x49')](handleError(_0x7467c1,null));};exports[_0x6746('0x4a')]=function(_0x198d3a,_0x3034fe){var _0x15631d={'raw':!![],'where':{'id':_0x198d3a[_0x6746('0x4b')]['id']}},_0xc521f1={};_0xc521f1['model']=_[_0x6746('0x38')](db[_0x6746('0x32')][_0x6746('0x33')]);_0xc521f1[_0x6746('0x37')]=_[_0x6746('0x38')](_0x198d3a[_0x6746('0x37')]);_0xc521f1['filters']=_[_0x6746('0x3a')](_0xc521f1[_0x6746('0x36')],_0xc521f1[_0x6746('0x37')]);_0x15631d[_0x6746('0x3c')]=_['intersection'](_0xc521f1[_0x6746('0x36')],qs[_0x6746('0x3b')](_0x198d3a[_0x6746('0x37')][_0x6746('0x3b')]));_0x15631d[_0x6746('0x3c')]=_0x15631d[_0x6746('0x3c')][_0x6746('0x3d')]?_0x15631d['attributes']:_0xc521f1[_0x6746('0x36')];if(_0x198d3a[_0x6746('0x37')][_0x6746('0x46')]){_0x15631d[_0x6746('0x47')]=[{'all':!![]}];}_0x15631d=_['merge']({},_0x15631d,_0x198d3a[_0x6746('0x4c')]);return db[_0x6746('0x32')][_0x6746('0x4d')](_0x15631d)[_0x6746('0x27')](handleEntityNotFound(_0x3034fe,null))['then'](respondWithResult(_0x3034fe,null))[_0x6746('0x49')](handleError(_0x3034fe,null));};exports['create']=function(_0xd6bba,_0x3db43f){return db[_0x6746('0x32')][_0x6746('0x4e')](_0xd6bba[_0x6746('0x4f')],{})['then'](function(_0x2d3a5c){var _0x1fb038=_0xd6bba['user'][_0x6746('0x29')]({'plain':!![]});if(!_0x1fb038)throw new Error(_0x6746('0x50'));if(_0x1fb038[_0x6746('0x51')]===_0x6746('0x52')){var _0x4e05b6=_0x2d3a5c[_0x6746('0x29')]({'plain':!![]});var _0xea27fe=_0x6746('0x2a');return db['UserProfileSection'][_0x6746('0x4d')]({'where':{'name':_0xea27fe,'userProfileId':_0x1fb038[_0x6746('0x53')]},'raw':!![]})[_0x6746('0x27')](function(_0x2d5b59){if(_0x2d5b59&&_0x2d5b59[_0x6746('0x54')]===0x0){return db[_0x6746('0x2b')][_0x6746('0x4e')]({'name':_0x4e05b6[_0x6746('0x2f')],'resourceId':_0x4e05b6['id'],'type':_0x2d5b59[_0x6746('0x2f')],'sectionId':_0x2d5b59['id']},{})[_0x6746('0x27')](function(){return _0x2d3a5c;});}else{return _0x2d3a5c;}})[_0x6746('0x49')](function(_0x2f95e0){logger[_0x6746('0x2d')](_0x6746('0x55'),_0x2f95e0);throw _0x2f95e0;});}return _0x2d3a5c;})[_0x6746('0x27')](respondWithResult(_0x3db43f,0xc9))[_0x6746('0x49')](handleError(_0x3db43f,null));};exports[_0x6746('0x26')]=function(_0x18fe14,_0x1fa734){if(_0x18fe14['body']['id']){delete _0x18fe14['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x18fe14[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x1fa734,null))[_0x6746('0x27')](saveUpdates(_0x18fe14[_0x6746('0x4f')],null))[_0x6746('0x27')](respondWithResult(_0x1fa734,null))[_0x6746('0x49')](handleError(_0x1fa734,null));};exports[_0x6746('0x28')]=function(_0x45159f,_0x1d16f0){return db[_0x6746('0x32')]['find']({'where':{'id':_0x45159f[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x1d16f0,null))[_0x6746('0x27')](removeEntity(_0x1d16f0,null))['catch'](handleError(_0x1d16f0,null));};exports[_0x6746('0x56')]=function(_0x3d5318,_0x1c4320){return db[_0x6746('0x32')]['describe']()[_0x6746('0x27')](respondWithResult(_0x1c4320,null))[_0x6746('0x49')](handleError(_0x1c4320,null));};exports[_0x6746('0x57')]=function(_0x39b68a,_0x1e11ad,_0x5ca899){var _0x48976f={'raw':!![],'where':{}},_0x3065c8={},_0x2694ad;return db[_0x6746('0x32')][_0x6746('0x58')]({'where':{'id':_0x39b68a[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x1e11ad,null))[_0x6746('0x27')](function(_0x425a0c){if(_0x425a0c){_0x2694ad=_0x425a0c[_0x6746('0x29')]({'plain':!![]});_0x3065c8[_0x6746('0x36')]=_[_0x6746('0x38')](db[_0x6746('0x59')][_0x6746('0x33')]);_0x3065c8[_0x6746('0x37')]=_[_0x6746('0x38')](_0x39b68a['query']);_0x3065c8['filters']=_[_0x6746('0x3a')](_0x3065c8['model'],_0x3065c8[_0x6746('0x37')]);_0x48976f[_0x6746('0x3c')]=_['intersection'](_0x3065c8[_0x6746('0x36')],qs[_0x6746('0x3b')](_0x39b68a[_0x6746('0x37')][_0x6746('0x3b')]));_0x48976f[_0x6746('0x3c')]=_0x48976f['attributes'][_0x6746('0x3d')]?_0x48976f['attributes']:_0x3065c8['model'];if(!_0x39b68a[_0x6746('0x37')][_0x6746('0x3e')](_0x6746('0x5a'))){_0x48976f[_0x6746('0x20')]=qs[_0x6746('0x20')](_0x39b68a['query'][_0x6746('0x20')]);_0x48976f['offset']=qs[_0x6746('0x1f')](_0x39b68a[_0x6746('0x37')][_0x6746('0x1f')]);}_0x48976f[_0x6746('0x3f')]=qs[_0x6746('0x40')](_0x39b68a['query'][_0x6746('0x40')]);_0x48976f['where']=qs['filters'](_[_0x6746('0x41')](_0x39b68a[_0x6746('0x37')],_0x3065c8[_0x6746('0x39')]));_0x48976f[_0x6746('0x43')][_0x6746('0x5b')]=_0x425a0c['id'];if(_0x39b68a[_0x6746('0x37')][_0x6746('0x42')]){_0x48976f['where']=_[_0x6746('0x44')](_0x48976f[_0x6746('0x43')],{'$or':_[_0x6746('0x31')](_0x48976f[_0x6746('0x3c')],function(_0x4332ed){var _0x306f72={};_0x306f72[_0x4332ed]={'$like':'%'+_0x39b68a[_0x6746('0x37')][_0x6746('0x42')]+'%'};return _0x306f72;})});}_0x48976f=_[_0x6746('0x44')]({},_0x48976f,_0x39b68a['options']);return db[_0x6746('0x59')][_0x6746('0x48')](_0x48976f);}})[_0x6746('0x27')](function(_0x42e6c4){if(_0x42e6c4){return db[_0x6746('0x5c')]['findAndCountAll']({'where':{'id':_['map'](_0x42e6c4,'UserId'),'role':_0x6746('0x5d')},'attributes':['id',_0x6746('0x2f'),_0x6746('0x5e'),_0x6746('0x5f'),_0x6746('0x60')]});}})[_0x6746('0x27')](function(_0x5ee6b1){if(_0x5ee6b1){return{'count':_0x5ee6b1[_0x6746('0x1e')],'rows':_[_0x6746('0x31')](_0x5ee6b1['rows'],function(_0x11d473){return{'membername':_0x11d473[_0x6746('0x2f')],'UserId':_0x11d473['id'],'queue_name':_0x2694ad[_0x6746('0x2f')],'SmsQueueId':_0x2694ad['id'],'interface':util[_0x6746('0x61')]('%s/%s',_0x6746('0x62'),_0x11d473[_0x6746('0x2f')]),'penalty':0x0,'paused':_0x11d473['smsPause'],'createdAt':_0x11d473[_0x6746('0x60')],'updatedAt':_0x11d473['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6746('0x27')](respondWithFilteredResult(_0x1e11ad,_0x48976f))[_0x6746('0x49')](handleError(_0x1e11ad,null));};exports['getTeams']=function(_0xa2082c,_0x586538,_0x15d6ea){var _0x15ae02={};var _0x4d57b2={};var _0x320323;var _0x19239d;return db['SmsQueue']['findOne']({'where':{'id':_0xa2082c['params']['id']}})['then'](handleEntityNotFound(_0x586538,null))[_0x6746('0x27')](function(_0x499681){if(_0x499681){_0x320323=_0x499681;_0x4d57b2[_0x6746('0x36')]=_[_0x6746('0x38')](db[_0x6746('0x63')]['rawAttributes']);_0x4d57b2[_0x6746('0x37')]=_[_0x6746('0x38')](_0xa2082c[_0x6746('0x37')]);_0x4d57b2[_0x6746('0x39')]=_[_0x6746('0x3a')](_0x4d57b2[_0x6746('0x36')],_0x4d57b2[_0x6746('0x37')]);_0x15ae02[_0x6746('0x3c')]=_[_0x6746('0x3a')](_0x4d57b2[_0x6746('0x36')],qs[_0x6746('0x3b')](_0xa2082c[_0x6746('0x37')][_0x6746('0x3b')]));_0x15ae02[_0x6746('0x3c')]=_0x15ae02[_0x6746('0x3c')]['length']?_0x15ae02[_0x6746('0x3c')]:_0x4d57b2[_0x6746('0x36')];_0x15ae02['order']=qs[_0x6746('0x40')](_0xa2082c[_0x6746('0x37')][_0x6746('0x40')]);_0x15ae02[_0x6746('0x43')]=qs[_0x6746('0x39')](_[_0x6746('0x41')](_0xa2082c[_0x6746('0x37')],_0x4d57b2[_0x6746('0x39')]));if(_0xa2082c['query']['filter']){_0x15ae02['where']=_[_0x6746('0x44')](_0x15ae02[_0x6746('0x43')],{'$or':_['map'](_0x15ae02['attributes'],function(_0x2df2b0){var _0x12615c={};_0x12615c[_0x2df2b0]={'$like':'%'+_0xa2082c[_0x6746('0x37')][_0x6746('0x42')]+'%'};return _0x12615c;})});}_0x15ae02=_[_0x6746('0x44')]({},_0x15ae02,_0xa2082c['options']);return _0x320323[_0x6746('0x64')](_0x15ae02);}})[_0x6746('0x27')](function(_0x2272ed){if(_0x2272ed){_0x19239d=_0x2272ed['length'];if(!_0xa2082c[_0x6746('0x37')][_0x6746('0x3e')](_0x6746('0x5a'))){_0x15ae02['limit']=qs[_0x6746('0x20')](_0xa2082c[_0x6746('0x37')][_0x6746('0x20')]);_0x15ae02['offset']=qs[_0x6746('0x1f')](_0xa2082c[_0x6746('0x37')][_0x6746('0x1f')]);}return _0x320323[_0x6746('0x64')](_0x15ae02);}})['then'](function(_0x327541){if(_0x327541){return _0x327541?{'count':_0x19239d,'rows':_0x327541}:null;}})[_0x6746('0x27')](respondWithResult(_0x586538,null))[_0x6746('0x49')](handleError(_0x586538,null));};exports[_0x6746('0x65')]=function(_0x512492,_0x333404,_0x308d4c){var _0x4d5430=_0x512492[_0x6746('0x4f')][_0x6746('0x66')];return db['Team'][_0x6746('0x48')]({'where':{'id':_0x4d5430},'attributes':['id'],'include':[{'model':db[_0x6746('0x5c')],'as':_0x6746('0x67'),'attributes':['id',_0x6746('0x2f'),_0x6746('0x68'),_0x6746('0x69'),_0x6746('0x6a')],'raw':!![]}]})[_0x6746('0x27')](function(_0x2cffe2){if(_0x2cffe2){var _0x1cc9cc=_[_0x6746('0x6b')](_0x2cffe2,function(_0x2eef69){var _0x588d56=_0x2eef69[_0x6746('0x29')]({'plain':!![]});return _0x588d56[_0x6746('0x67')];});return db[_0x6746('0x32')][_0x6746('0x4d')]({'where':{'id':_0x512492['params']['id']}})['then'](function(_0x2e22a8){return db[_0x6746('0x6c')][_0x6746('0x6d')](function(_0x3749db){return _0x2e22a8[_0x6746('0x65')](_0x4d5430,{'transaction':_0x3749db})[_0x6746('0x27')](function(){return BPromise['each'](_0x1cc9cc,function(_0x3789db){return db[_0x6746('0x59')][_0x6746('0x6e')]({'where':{'UserId':_0x3789db['id'],'SmsQueueId':_0x512492[_0x6746('0x4b')]['id']},'transaction':_0x3749db});});})['then'](function(){_0x1cc9cc[_0x6746('0x6f')](function(_0x16e373){socket[_0x6746('0x70')](_0x6746('0x71'),{'UserId':_0x16e373['id'],'SmsQueueId':_0x2e22a8['id']});});});});});}})['then'](respondWithStatusCode(_0x333404,null))[_0x6746('0x49')](handleError(_0x333404,null));};exports['removeTeams']=function(_0x8ee18a,_0x2154ed,_0x35ea53){return db['Team']['findAll']({'where':{'id':_0x8ee18a[_0x6746('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6746('0x5c')],'as':_0x6746('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6746('0x27')](handleEntityNotFound(_0x2154ed,null))[_0x6746('0x27')](function(_0x267c35){var _0x22e410=_[_0x6746('0x31')](_0x267c35,'id');var _0x225627=[];var _0x41cc93=[];var _0x4dac04=squel[_0x6746('0x72')]();_0x4dac04[_0x6746('0x73')](_0x6746('0x74'))[_0x6746('0x75')]('team_has_sms_queues','tq')[_0x6746('0x76')]('user_has_teams','ut',_0x6746('0x77'))[_0x6746('0x43')](_0x6746('0x78'),_0x8ee18a[_0x6746('0x4b')]['id']);for(var _0xaead1c=0x0;_0xaead1c<_0x267c35['length'];_0xaead1c+=0x1){let _0x3dccb6=_0x267c35[_0xaead1c];for(var _0x41ce0b=0x0;_0x41ce0b<_0x3dccb6[_0x6746('0x67')][_0x6746('0x3d')];_0x41ce0b+=0x1){let _0xdc6879=_0x3dccb6[_0x6746('0x67')][_0x41ce0b];var _0x417926=_0x4dac04[_0x6746('0x79')]();_0x417926['where'](_0x6746('0x7a'),_0xdc6879['id']);_0x41cc93[_0x6746('0x7b')](db[_0x6746('0x6c')]['query'](_0x417926[_0x6746('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0x6746('0x7d')]})[_0x6746('0x27')](function(_0x48745b){if(_0x48745b[_0x6746('0x3d')]===0x1){return _0xdc6879['id'];}else{var _0x3d88f7=_[_0x6746('0x7e')](_[_0x6746('0x31')](_0x48745b,_0x6746('0x7f')),function(_0x515763){return _[_0x6746('0x80')](_0x22e410,_0x515763);});if(_0x3d88f7){return _0xdc6879['id'];}}}));}}return BPromise[_0x6746('0x81')](_0x41cc93)[_0x6746('0x27')](function(_0x300e53){_0x225627=_(_0x225627)[_0x6746('0x82')](_0x300e53)[_0x6746('0x83')]()[_0x6746('0x84')]();return db['SmsQueue']['find']({'where':{'id':_0x8ee18a[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](function(_0x23c9b2){return db[_0x6746('0x6c')][_0x6746('0x6d')](function(_0x52eb04){return _0x23c9b2['removeTeams'](_0x8ee18a[_0x6746('0x37')][_0x6746('0x66')],{'transaction':_0x52eb04})[_0x6746('0x27')](function(){if(!_['isEmpty'](_0x225627)){return _0x23c9b2[_0x6746('0x85')](_0x225627,{'transaction':_0x52eb04});}})[_0x6746('0x27')](function(){_0x225627['forEach'](function(_0x216615){socket['emit'](_0x6746('0x86'),{'UserId':_0x216615,'SmsQueueId':_0x23c9b2['id']});});});});});});})[_0x6746('0x27')](respondWithStatusCode(_0x2154ed,null))['catch'](handleError(_0x2154ed,null));};exports[_0x6746('0x87')]=function(_0x3c09ca,_0x441fb9,_0xdd4d33){return db[_0x6746('0x32')][_0x6746('0x4d')]({'where':{'id':_0x3c09ca[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x441fb9,null))[_0x6746('0x27')](function(_0x226016){if(_0x226016){return _0x226016[_0x6746('0x87')](_0x3c09ca['body'][_0x6746('0x66')],_['omit'](_0x3c09ca[_0x6746('0x4f')],['ids','id'])||{})['spread'](function(_0x1a2ac7){for(var _0x229f9d=0x0;_0x229f9d<_0x3c09ca['body']['ids'][_0x6746('0x3d')];_0x229f9d+=0x1){socket[_0x6746('0x70')](_0x6746('0x71'),{'UserId':_0x3c09ca['body']['ids'][_0x229f9d],'SmsQueueId':_0x3c09ca['params']['id']});}return _0x1a2ac7;});}})[_0x6746('0x27')](respondWithResult(_0x441fb9,null))[_0x6746('0x49')](handleError(_0x441fb9,null));};exports['removeAgents']=function(_0x1139ed,_0x2f751c,_0x2e0bef){return db[_0x6746('0x32')][_0x6746('0x4d')]({'where':{'id':_0x1139ed[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x2f751c,null))[_0x6746('0x27')](function(_0x2d47a6){if(_0x2d47a6){return _0x2d47a6[_0x6746('0x85')](_0x1139ed[_0x6746('0x37')][_0x6746('0x66')])[_0x6746('0x27')](function(){if(_[_0x6746('0x88')](_0x1139ed[_0x6746('0x37')][_0x6746('0x66')])){for(var _0x549103=0x0;_0x549103<_0x1139ed[_0x6746('0x37')][_0x6746('0x66')][_0x6746('0x3d')];_0x549103+=0x1){socket[_0x6746('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x1139ed['query'][_0x6746('0x66')][_0x549103]),'SmsQueueId':Number(_0x1139ed[_0x6746('0x4b')]['id'])});}}else{socket['emit'](_0x6746('0x86'),{'UserId':Number(_0x1139ed[_0x6746('0x37')][_0x6746('0x66')]),'SmsQueueId':Number(_0x1139ed[_0x6746('0x4b')]['id'])});}});}})[_0x6746('0x27')](respondWithStatusCode(_0x2f751c,null))['catch'](handleError(_0x2f751c,null));};exports[_0x6746('0x89')]=function(_0xbdd53a,_0x179165,_0x308e0b){var _0x486cb8={};var _0x4ee422={};var _0x348399;var _0x4c13d5;return db['SmsQueue']['findOne']({'where':{'id':_0xbdd53a[_0x6746('0x4b')]['id']}})[_0x6746('0x27')](handleEntityNotFound(_0x179165,null))[_0x6746('0x27')](function(_0x356ed9){if(_0x356ed9){_0x348399=_0x356ed9;_0x4ee422[_0x6746('0x36')]=_['keys'](db[_0x6746('0x5c')][_0x6746('0x33')]);_0x4ee422[_0x6746('0x37')]=_[_0x6746('0x38')](_0xbdd53a[_0x6746('0x37')]);_0x4ee422['filters']=_[_0x6746('0x3a')](_0x4ee422['model'],_0x4ee422[_0x6746('0x37')]);_0x486cb8['attributes']=_[_0x6746('0x3a')](_0x4ee422[_0x6746('0x36')],qs[_0x6746('0x3b')](_0xbdd53a[_0x6746('0x37')]['fields']));_0x486cb8[_0x6746('0x3c')]=_0x486cb8[_0x6746('0x3c')][_0x6746('0x3d')]?_0x486cb8['attributes']:_0x4ee422[_0x6746('0x36')];_0x486cb8[_0x6746('0x3f')]=qs[_0x6746('0x40')](_0xbdd53a[_0x6746('0x37')][_0x6746('0x40')]);_0x486cb8[_0x6746('0x43')]=qs[_0x6746('0x39')](_[_0x6746('0x41')](_0xbdd53a['query'],_0x4ee422[_0x6746('0x39')]));if(_0xbdd53a[_0x6746('0x37')][_0x6746('0x42')]){_0x486cb8[_0x6746('0x43')]=_[_0x6746('0x44')](_0x486cb8[_0x6746('0x43')],{'$or':_[_0x6746('0x31')](_0x486cb8['attributes'],function(_0x153e38){var _0x4239b8={};_0x4239b8[_0x153e38]={'$like':'%'+_0xbdd53a[_0x6746('0x37')]['filter']+'%'};return _0x4239b8;})});}_0x486cb8=_[_0x6746('0x44')]({},_0x486cb8,_0xbdd53a[_0x6746('0x4c')]);return _0x348399['getAgents'](_0x486cb8);}})['then'](function(_0x30dcca){if(_0x30dcca){_0x4c13d5=_0x30dcca[_0x6746('0x3d')];if(!_0xbdd53a[_0x6746('0x37')][_0x6746('0x3e')](_0x6746('0x5a'))){_0x486cb8[_0x6746('0x20')]=qs[_0x6746('0x20')](_0xbdd53a[_0x6746('0x37')][_0x6746('0x20')]);_0x486cb8['offset']=qs[_0x6746('0x1f')](_0xbdd53a[_0x6746('0x37')][_0x6746('0x1f')]);}return _0x348399[_0x6746('0x89')](_0x486cb8);}})[_0x6746('0x27')](function(_0x517e88){if(_0x517e88){return _0x517e88?{'count':_0x4c13d5,'rows':_0x517e88}:null;}})[_0x6746('0x27')](respondWithResult(_0x179165,null))[_0x6746('0x49')](handleError(_0x179165,null));};
\ No newline at end of file
index 44dc59d..ef77f70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4af=['hook','events','../../mysqldb','SmsQueue','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x58512d,_0x2ac165){var _0x5a2b3d=function(_0x16ad84){while(--_0x16ad84){_0x58512d['push'](_0x58512d['shift']());}};_0x5a2b3d(++_0x2ac165);}(_0xa4af,0x139));var _0xfa4a=function(_0x5d0493,_0x25f99c){_0x5d0493=_0x5d0493-0x0;var _0x120007=_0xa4af[_0x5d0493];return _0x120007;};'use strict';var EventEmitter=require(_0xfa4a('0x0'));var SmsQueue=require(_0xfa4a('0x1'))['db'][_0xfa4a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfa4a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa4a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x181480){return function(_0x50f9a2,_0x59c61f,_0x495379){SmsQueueEvents[_0xfa4a('0x5')](_0x181480+':'+_0x50f9a2['id'],_0x50f9a2);SmsQueueEvents[_0xfa4a('0x5')](_0x181480,_0x50f9a2);_0x495379(null);};}for(var e in events){if(events[_0xfa4a('0x6')](e)){var event=events[e];SmsQueue[_0xfa4a('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0x66c4=['update','remove','emit','hook','events','../../mysqldb','SmsQueue'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x66c4,0x1bd));var _0x466c=function(_0x17af40,_0x2a55d2){_0x17af40=_0x17af40-0x0;var _0xf35dc3=_0x66c4[_0x17af40];return _0xf35dc3;};'use strict';var EventEmitter=require(_0x466c('0x0'));var SmsQueue=require(_0x466c('0x1'))['db'][_0x466c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x466c('0x3'),'afterDestroy':_0x466c('0x4')};function emitEvent(_0x258654){return function(_0x5f2f58,_0x3f7e91,_0x1812bf){SmsQueueEvents[_0x466c('0x5')](_0x258654+':'+_0x5f2f58['id'],_0x5f2f58);SmsQueueEvents[_0x466c('0x5')](_0x258654,_0x5f2f58);_0x1812bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x466c('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 858f086..2a43f64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7050=['sms_queues','lodash','util','../../config/logger','bluebird','request-promise','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x16c253,_0x54baa6){var _0x505b3a=function(_0x3654aa){while(--_0x3654aa){_0x16c253['push'](_0x16c253['shift']());}};_0x505b3a(++_0x54baa6);}(_0x7050,0x65));var _0x0705=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x7050[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x0705('0x0'));var util=require(_0x0705('0x1'));var logger=require(_0x0705('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0705('0x3'));var rp=require(_0x0705('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0705('0x5'));module[_0x0705('0x6')]=function(_0x11a88d,_0x461d08){return _0x11a88d[_0x0705('0x7')](_0x0705('0x8'),attributes,{'tableName':_0x0705('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5b7=['define','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb5b7,0x1f0));var _0x7b5b=function(_0x3d2763,_0x2ec071){_0x3d2763=_0x3d2763-0x0;var _0x40ad02=_0xb5b7[_0x3d2763];return _0x40ad02;};'use strict';var _=require(_0x7b5b('0x0'));var util=require(_0x7b5b('0x1'));var logger=require(_0x7b5b('0x2'))(_0x7b5b('0x3'));var moment=require(_0x7b5b('0x4'));var BPromise=require(_0x7b5b('0x5'));var rp=require(_0x7b5b('0x6'));var fs=require('fs');var path=require(_0x7b5b('0x7'));var rimraf=require(_0x7b5b('0x8'));var config=require(_0x7b5b('0x9'));var attributes=require(_0x7b5b('0xa'));module['exports']=function(_0x42a5f9,_0x2f899a){return _0x42a5f9[_0x7b5b('0xb')](_0x7b5b('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 436fe20..03e1e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e7c=['code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','find','ShowSmsQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./smsQueue.socket','request','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x44b506,_0x1c8933){var _0x50c6e8=function(_0x55c1a9){while(--_0x55c1a9){_0x44b506['push'](_0x44b506['shift']());}};_0x50c6e8(++_0x1c8933);}(_0x8e7c,0xb8));var _0xc8e7=function(_0x23882a,_0x46b6fd){_0x23882a=_0x23882a-0x0;var _0xbb046a=_0x8e7c[_0x23882a];return _0xbb046a;};'use strict';var _=require(_0xc8e7('0x0'));var util=require(_0xc8e7('0x1'));var moment=require(_0xc8e7('0x2'));var BPromise=require(_0xc8e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8e7('0x4'));var db=require(_0xc8e7('0x5'))['db'];var utils=require(_0xc8e7('0x6'));var logger=require(_0xc8e7('0x7'))(_0xc8e7('0x8'));var config=require(_0xc8e7('0x9'));var jayson=require(_0xc8e7('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xc8e7('0xb')]=_[_0xc8e7('0xc')](config[_0xc8e7('0xb')],{'host':_0xc8e7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc8e7('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e96d8,_0x12119d,_0x868c31){return new BPromise(function(_0x4bd542,_0x473e2b){return client[_0xc8e7('0xf')](_0x2e96d8,_0x868c31)['then'](function(_0x1ea7f1){logger['info']('SmsQueue,\x20%s,\x20%s',_0x12119d,_0xc8e7('0x10'));logger[_0xc8e7('0x11')](_0xc8e7('0x12'),_0x12119d,'request\x20sent',JSON[_0xc8e7('0x13')](_0x1ea7f1));if(_0x1ea7f1['error']){if(_0x1ea7f1[_0xc8e7('0x14')][_0xc8e7('0x15')]===0x1f4){logger['error'](_0xc8e7('0x16'),_0x12119d,_0x1ea7f1[_0xc8e7('0x14')][_0xc8e7('0x17')]);return _0x473e2b(_0x1ea7f1[_0xc8e7('0x14')][_0xc8e7('0x17')]);}logger[_0xc8e7('0x14')](_0xc8e7('0x16'),_0x12119d,_0x1ea7f1[_0xc8e7('0x14')]['message']);return _0x4bd542(_0x1ea7f1[_0xc8e7('0x14')]['message']);}else{logger[_0xc8e7('0x18')](_0xc8e7('0x16'),_0x12119d,_0xc8e7('0x10'));_0x4bd542(_0x1ea7f1[_0xc8e7('0x19')][_0xc8e7('0x17')]);}})[_0xc8e7('0x1a')](function(_0x40b1d3){logger[_0xc8e7('0x14')](_0xc8e7('0x16'),_0x12119d,_0x40b1d3);_0x473e2b(_0x40b1d3);});});}exports[_0xc8e7('0x1b')]=function(_0x49b1dd){var _0x3ab285=this;return new Promise(function(_0x126995,_0x25b6d2){return db[_0xc8e7('0x1c')][_0xc8e7('0x1d')]({'raw':_0x49b1dd[_0xc8e7('0x1e')]?_0x49b1dd[_0xc8e7('0x1e')][_0xc8e7('0x1f')]===undefined?!![]:![]:!![],'where':_0x49b1dd[_0xc8e7('0x1e')]?_0x49b1dd[_0xc8e7('0x1e')][_0xc8e7('0x20')]||null:null,'attributes':_0x49b1dd['options']?_0x49b1dd[_0xc8e7('0x1e')][_0xc8e7('0x21')]||null:null,'limit':_0x49b1dd['options']?_0x49b1dd[_0xc8e7('0x1e')][_0xc8e7('0x22')]||null:null,'include':_0x49b1dd['options']?_0x49b1dd[_0xc8e7('0x1e')]['include']?_[_0xc8e7('0x23')](_0x49b1dd[_0xc8e7('0x1e')][_0xc8e7('0x24')],function(_0x18cb61){return{'model':db[_0x18cb61[_0xc8e7('0x25')]],'as':_0x18cb61['as'],'attributes':_0x18cb61[_0xc8e7('0x21')],'include':_0x18cb61[_0xc8e7('0x24')]?_[_0xc8e7('0x23')](_0x18cb61['include'],function(_0x3e17f2){return{'model':db[_0x3e17f2[_0xc8e7('0x25')]],'as':_0x3e17f2['as'],'attributes':_0x3e17f2[_0xc8e7('0x21')],'include':_0x3e17f2[_0xc8e7('0x24')]?_[_0xc8e7('0x23')](_0x3e17f2['include'],function(_0x1a9061){return{'model':db[_0x1a9061[_0xc8e7('0x25')]],'as':_0x1a9061['as'],'attributes':_0x1a9061[_0xc8e7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc8e7('0x26')](function(_0x514467){logger[_0xc8e7('0x18')](_0xc8e7('0x1b'),_0x49b1dd);logger[_0xc8e7('0x11')](_0xc8e7('0x1b'),_0x49b1dd,JSON[_0xc8e7('0x13')](_0x514467));_0x126995(_0x514467);})[_0xc8e7('0x1a')](function(_0x42ba00){logger[_0xc8e7('0x14')](_0xc8e7('0x1b'),_0x42ba00['message'],_0x49b1dd);_0x25b6d2(_0x3ab285['error'](0x1f4,_0x42ba00[_0xc8e7('0x17')]));});});};exports['ShowSmsQueue']=function(_0x184830){var _0x4c0245=this;return new Promise(function(_0x2ccc8b,_0x5f26b6){return db[_0xc8e7('0x1c')][_0xc8e7('0x27')]({'raw':_0x184830[_0xc8e7('0x1e')]?_0x184830[_0xc8e7('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x184830['options']?_0x184830[_0xc8e7('0x1e')][_0xc8e7('0x20')]||null:null,'attributes':_0x184830['options']?_0x184830[_0xc8e7('0x1e')][_0xc8e7('0x21')]||null:null,'include':_0x184830[_0xc8e7('0x1e')]?_0x184830[_0xc8e7('0x1e')][_0xc8e7('0x24')]?_[_0xc8e7('0x23')](_0x184830[_0xc8e7('0x1e')][_0xc8e7('0x24')],function(_0x63bd01){return{'model':db[_0x63bd01[_0xc8e7('0x25')]],'as':_0x63bd01['as'],'attributes':_0x63bd01[_0xc8e7('0x21')],'include':_0x63bd01[_0xc8e7('0x24')]?_[_0xc8e7('0x23')](_0x63bd01[_0xc8e7('0x24')],function(_0x39d4fa){return{'model':db[_0x39d4fa[_0xc8e7('0x25')]],'as':_0x39d4fa['as'],'attributes':_0x39d4fa[_0xc8e7('0x21')],'include':_0x39d4fa[_0xc8e7('0x24')]?_['map'](_0x39d4fa[_0xc8e7('0x24')],function(_0x1ae013){return{'model':db[_0x1ae013[_0xc8e7('0x25')]],'as':_0x1ae013['as'],'attributes':_0x1ae013[_0xc8e7('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52eb81){logger[_0xc8e7('0x18')](_0xc8e7('0x28'),_0x184830);logger['debug']('ShowSmsQueue',_0x184830,JSON[_0xc8e7('0x13')](_0x52eb81));_0x2ccc8b(_0x52eb81);})[_0xc8e7('0x1a')](function(_0x40bff6){logger[_0xc8e7('0x14')]('ShowSmsQueue',_0x40bff6[_0xc8e7('0x17')],_0x184830);_0x5f26b6(_0x4c0245[_0xc8e7('0x14')](0x1f4,_0x40bff6[_0xc8e7('0x17')]));});});};
\ No newline at end of file
+var _0x145e=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSmsQueue','SmsQueue','findAll','options','where','limit','include','map','model','attributes','then','debug','stringify','ShowSmsQueue','raw','util'];(function(_0x49ba49,_0x3861d9){var _0x14921e=function(_0xb49336){while(--_0xb49336){_0x49ba49['push'](_0x49ba49['shift']());}};_0x14921e(++_0x3861d9);}(_0x145e,0x1ac));var _0xe145=function(_0x36de4f,_0x350d30){_0x36de4f=_0x36de4f-0x0;var _0x1a91c2=_0x145e[_0x36de4f];return _0x1a91c2;};'use strict';var _=require('lodash');var util=require(_0xe145('0x0'));var moment=require(_0xe145('0x1'));var BPromise=require(_0xe145('0x2'));var rs=require(_0xe145('0x3'));var fs=require('fs');var Redis=require(_0xe145('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe145('0x5'));var logger=require(_0xe145('0x6'))(_0xe145('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe145('0x8')]['http']({'port':0x232a});config[_0xe145('0x9')]=_[_0xe145('0xa')](config[_0xe145('0x9')],{'host':_0xe145('0xb'),'port':0x18eb});var socket=require(_0xe145('0xc'))(new Redis(config['redis']));require(_0xe145('0xd'))[_0xe145('0xe')](socket);function respondWithRpcPromise(_0x4cbcee,_0x17b176,_0x18173a){return new BPromise(function(_0x2ec946,_0x53572d){return client[_0xe145('0xf')](_0x4cbcee,_0x18173a)['then'](function(_0x172f45){logger[_0xe145('0x10')](_0xe145('0x11'),_0x17b176,_0xe145('0x12'));logger['debug'](_0xe145('0x13'),_0x17b176,_0xe145('0x12'),JSON['stringify'](_0x172f45));if(_0x172f45['error']){if(_0x172f45[_0xe145('0x14')][_0xe145('0x15')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x17b176,_0x172f45[_0xe145('0x14')]['message']);return _0x53572d(_0x172f45[_0xe145('0x14')][_0xe145('0x16')]);}logger['error'](_0xe145('0x11'),_0x17b176,_0x172f45['error'][_0xe145('0x16')]);return _0x2ec946(_0x172f45[_0xe145('0x14')][_0xe145('0x16')]);}else{logger[_0xe145('0x10')](_0xe145('0x11'),_0x17b176,'request\x20sent');_0x2ec946(_0x172f45['result'][_0xe145('0x16')]);}})[_0xe145('0x17')](function(_0x1f54ab){logger[_0xe145('0x14')](_0xe145('0x11'),_0x17b176,_0x1f54ab);_0x53572d(_0x1f54ab);});});}exports[_0xe145('0x18')]=function(_0x63bb2f){var _0x336eb0=this;return new Promise(function(_0x5585fe,_0x2e8f62){return db[_0xe145('0x19')][_0xe145('0x1a')]({'raw':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1c')]||null:null,'attributes':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')]['attributes']||null:null,'limit':_0x63bb2f['options']?_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1d')]||null:null,'include':_0x63bb2f[_0xe145('0x1b')]?_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x63bb2f[_0xe145('0x1b')][_0xe145('0x1e')],function(_0x10b718){return{'model':db[_0x10b718[_0xe145('0x20')]],'as':_0x10b718['as'],'attributes':_0x10b718[_0xe145('0x21')],'include':_0x10b718['include']?_[_0xe145('0x1f')](_0x10b718['include'],function(_0x123d40){return{'model':db[_0x123d40[_0xe145('0x20')]],'as':_0x123d40['as'],'attributes':_0x123d40[_0xe145('0x21')],'include':_0x123d40[_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x123d40[_0xe145('0x1e')],function(_0x5325f6){return{'model':db[_0x5325f6[_0xe145('0x20')]],'as':_0x5325f6['as'],'attributes':_0x5325f6[_0xe145('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe145('0x22')](function(_0xb78c30){logger[_0xe145('0x10')](_0xe145('0x18'),_0x63bb2f);logger[_0xe145('0x23')](_0xe145('0x18'),_0x63bb2f,JSON[_0xe145('0x24')](_0xb78c30));_0x5585fe(_0xb78c30);})[_0xe145('0x17')](function(_0x5df922){logger[_0xe145('0x14')](_0xe145('0x18'),_0x5df922['message'],_0x63bb2f);_0x2e8f62(_0x336eb0['error'](0x1f4,_0x5df922[_0xe145('0x16')]));});});};exports[_0xe145('0x25')]=function(_0x25adf3){var _0x8ae506=this;return new Promise(function(_0x4158a1,_0x2d35fd){return db[_0xe145('0x19')]['find']({'raw':_0x25adf3[_0xe145('0x1b')]?_0x25adf3['options'][_0xe145('0x26')]===undefined?!![]:![]:!![],'where':_0x25adf3[_0xe145('0x1b')]?_0x25adf3[_0xe145('0x1b')][_0xe145('0x1c')]||null:null,'attributes':_0x25adf3[_0xe145('0x1b')]?_0x25adf3['options']['attributes']||null:null,'include':_0x25adf3['options']?_0x25adf3[_0xe145('0x1b')][_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x25adf3[_0xe145('0x1b')]['include'],function(_0x22985){return{'model':db[_0x22985[_0xe145('0x20')]],'as':_0x22985['as'],'attributes':_0x22985[_0xe145('0x21')],'include':_0x22985['include']?_[_0xe145('0x1f')](_0x22985[_0xe145('0x1e')],function(_0x4f2444){return{'model':db[_0x4f2444[_0xe145('0x20')]],'as':_0x4f2444['as'],'attributes':_0x4f2444['attributes'],'include':_0x4f2444[_0xe145('0x1e')]?_[_0xe145('0x1f')](_0x4f2444[_0xe145('0x1e')],function(_0x2bf272){return{'model':db[_0x2bf272[_0xe145('0x20')]],'as':_0x2bf272['as'],'attributes':_0x2bf272[_0xe145('0x21')]};}):[]};}):[]};}):[]:[]})[_0xe145('0x22')](function(_0x335414){logger['info'](_0xe145('0x25'),_0x25adf3);logger['debug'](_0xe145('0x25'),_0x25adf3,JSON[_0xe145('0x24')](_0x335414));_0x4158a1(_0x335414);})[_0xe145('0x17')](function(_0x398f6c){logger[_0xe145('0x14')]('ShowSmsQueue',_0x398f6c[_0xe145('0x16')],_0x25adf3);_0x2d35fd(_0x8ae506['error'](0x1f4,_0x398f6c[_0xe145('0x16')]));});});};
\ No newline at end of file
index 151b0e1..62d82b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea64=['register','smsQueue:','./smsQueue.events','update','emit'];(function(_0x48e612,_0x1f04a8){var _0x40681f=function(_0x27d926){while(--_0x27d926){_0x48e612['push'](_0x48e612['shift']());}};_0x40681f(++_0x1f04a8);}(_0xea64,0xe8));var _0x4ea6=function(_0x29374a,_0x5788c7){_0x29374a=_0x29374a-0x0;var _0x2bed8f=_0xea64[_0x29374a];return _0x2bed8f;};'use strict';var SmsQueueEvents=require(_0x4ea6('0x0'));var events=['save','remove',_0x4ea6('0x1')];function createListener(_0x3c76cd,_0x4e1e7a){return function(_0xa5471b){_0x4e1e7a[_0x4ea6('0x2')](_0x3c76cd,_0xa5471b);};}function removeListener(_0x3ad971,_0xbb3e63){return function(){SmsQueueEvents['removeListener'](_0x3ad971,_0xbb3e63);};}exports[_0x4ea6('0x3')]=function(_0x5b4759){for(var _0x8dfe8=0x0,_0x59dcc9=events['length'];_0x8dfe8<_0x59dcc9;_0x8dfe8++){var _0x16c8fc=events[_0x8dfe8];var _0x5e8930=createListener(_0x4ea6('0x4')+_0x16c8fc,_0x5b4759);SmsQueueEvents['on'](_0x16c8fc,_0x5e8930);}};
\ No newline at end of file
+var _0xc9f8=['smsQueue:','./smsQueue.events','save','remove','update','length'];(function(_0x3c546f,_0x277f67){var _0x505714=function(_0x162ee6){while(--_0x162ee6){_0x3c546f['push'](_0x3c546f['shift']());}};_0x505714(++_0x277f67);}(_0xc9f8,0x1db));var _0x8c9f=function(_0x4e79f8,_0x466259){_0x4e79f8=_0x4e79f8-0x0;var _0xa96f27=_0xc9f8[_0x4e79f8];return _0xa96f27;};'use strict';var SmsQueueEvents=require(_0x8c9f('0x0'));var events=[_0x8c9f('0x1'),_0x8c9f('0x2'),_0x8c9f('0x3')];function createListener(_0x22be8a,_0x1652e0){return function(_0x21c21a){_0x1652e0['emit'](_0x22be8a,_0x21c21a);};}function removeListener(_0x5d7f01,_0x4d4731){return function(){SmsQueueEvents['removeListener'](_0x5d7f01,_0x4d4731);};}exports['register']=function(_0x1c1812){for(var _0x23a6f3=0x0,_0x145b2d=events[_0x8c9f('0x4')];_0x23a6f3<_0x145b2d;_0x23a6f3++){var _0x211caf=events[_0x23a6f3];var _0x2e1bbb=createListener(_0x8c9f('0x5')+_0x211caf,_0x1c1812);SmsQueueEvents['on'](_0x211caf,_0x2e1bbb);}};
\ No newline at end of file
index 248edfd..9a54c02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4c2=['./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','multer','path','express','Router','../../components/interaction/service'];(function(_0x879aa2,_0x4a0348){var _0xc1aa8e=function(_0x465f09){while(--_0x465f09){_0x879aa2['push'](_0x879aa2['shift']());}};_0xc1aa8e(++_0x4a0348);}(_0xa4c2,0xc1));var _0x2a4c=function(_0x4b4a84,_0x2ee035){_0x4b4a84=_0x4b4a84-0x0;var _0x2751f8=_0xa4c2[_0x4b4a84];return _0x2751f8;};'use strict';var multer=require(_0x2a4c('0x0'));var util=require('util');var path=require(_0x2a4c('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a4c('0x2'));var router=express[_0x2a4c('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a4c('0x4'));var config=require('../../config/environment');var controller=require(_0x2a4c('0x5'));router[_0x2a4c('0x6')]('/',auth['isAuthenticated'](),controller[_0x2a4c('0x7')]);router[_0x2a4c('0x6')](_0x2a4c('0x8'),auth[_0x2a4c('0x9')](),controller[_0x2a4c('0xa')]);router[_0x2a4c('0x6')]('/:id',auth[_0x2a4c('0x9')](),controller[_0x2a4c('0xb')]);router[_0x2a4c('0xc')]('/',auth[_0x2a4c('0x9')](),controller[_0x2a4c('0xd')]);router[_0x2a4c('0xe')](_0x2a4c('0xf'),auth['isAuthenticated'](),controller[_0x2a4c('0x10')]);router['delete']('/:id',auth[_0x2a4c('0x9')](),controller[_0x2a4c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x5fde=['delete','/:id','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','show','post','update'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x5fde,0x80));var _0xe5fd=function(_0xadb3a0,_0x18afc8){_0xadb3a0=_0xadb3a0-0x0;var _0x6dd86c=_0x5fde[_0xadb3a0];return _0x6dd86c;};'use strict';var multer=require(_0xe5fd('0x0'));var util=require(_0xe5fd('0x1'));var path=require('path');var timeout=require(_0xe5fd('0x2'));var express=require(_0xe5fd('0x3'));var router=express[_0xe5fd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe5fd('0x5'));var interaction=require(_0xe5fd('0x6'));var config=require(_0xe5fd('0x7'));var controller=require(_0xe5fd('0x8'));router['get']('/',auth[_0xe5fd('0x9')](),controller['index']);router[_0xe5fd('0xa')](_0xe5fd('0xb'),auth[_0xe5fd('0x9')](),controller[_0xe5fd('0xc')]);router[_0xe5fd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe5fd('0xd')]);router[_0xe5fd('0xe')]('/',auth[_0xe5fd('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe5fd('0xf')]);router[_0xe5fd('0x10')](_0xe5fd('0x11'),auth[_0xe5fd('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6714852..0c8c7d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ae8=['DATE','sequelize','STRING'];(function(_0xff3100,_0xb0bebd){var _0x1029ec=function(_0x5d6a14){while(--_0x5d6a14){_0xff3100['push'](_0xff3100['shift']());}};_0x1029ec(++_0xb0bebd);}(_0x7ae8,0x142));var _0x87ae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ae8[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x87ae('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x87ae('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x87ae('0x1')]},'joinAt':{'type':Sequelize[_0x87ae('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x87ae('0x2')]},'exitAt':{'type':Sequelize[_0x87ae('0x2')]},'reason':{'type':Sequelize[_0x87ae('0x1')]}};
\ No newline at end of file
+var _0x685f=['sequelize','exports','STRING','DATE'];(function(_0x378b44,_0x5f2fe6){var _0x34d2da=function(_0x34fad3){while(--_0x34fad3){_0x378b44['push'](_0x378b44['shift']());}};_0x34d2da(++_0x5f2fe6);}(_0x685f,0x180));var _0xf685=function(_0x31acd2,_0x3c0a9f){_0x31acd2=_0x31acd2-0x0;var _0xc8118=_0x685f[_0x31acd2];return _0xc8118;};'use strict';var moment=require('moment');var Sequelize=require(_0xf685('0x0'));module[_0xf685('0x1')]={'uniqueid':{'type':Sequelize[_0xf685('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf685('0x3')]},'leaveAt':{'type':Sequelize[_0xf685('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf685('0x3')]},'reason':{'type':Sequelize[_0xf685('0x2')]}};
\ No newline at end of file
index ff1ffcb..c16c791 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7c7=['sort','pick','where','merge','type','VIRTUAL','filter','options','findAll','rows','catch','keys','SmsQueueReport','includeAll','include','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x17ecdb,_0x385456){var _0x231a02=function(_0x1be057){while(--_0x1be057){_0x17ecdb['push'](_0x17ecdb['shift']());}};_0x231a02(++_0x385456);}(_0xb7c7,0x18b));var _0x7b7c=function(_0x810025,_0x34bb04){_0x810025=_0x810025-0x0;var _0x4dbc81=_0xb7c7[_0x810025];return _0x4dbc81;};'use strict';var emlformat=require(_0x7b7c('0x0'));var rimraf=require(_0x7b7c('0x1'));var zipdir=require(_0x7b7c('0x2'));var jsonpatch=require(_0x7b7c('0x3'));var rp=require(_0x7b7c('0x4'));var moment=require(_0x7b7c('0x5'));var BPromise=require(_0x7b7c('0x6'));var Mustache=require(_0x7b7c('0x7'));var util=require(_0x7b7c('0x8'));var path=require('path');var sox=require(_0x7b7c('0x9'));var csv=require(_0x7b7c('0xa'));var ejs=require(_0x7b7c('0xb'));var fs=require('fs');var fs_extra=require(_0x7b7c('0xc'));var _=require(_0x7b7c('0xd'));var squel=require('squel');var crypto=require(_0x7b7c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7b7c('0xa'));var querystring=require('querystring');var Papa=require(_0x7b7c('0xf'));var Redis=require(_0x7b7c('0x10'));var authService=require(_0x7b7c('0x11'));var qs=require(_0x7b7c('0x12'));var as=require(_0x7b7c('0x13'));var hardwareService=require(_0x7b7c('0x14'));var logger=require(_0x7b7c('0x15'))('api');var utils=require(_0x7b7c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b7c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf1b090,_0x6cbb25){_0x6cbb25=_0x6cbb25||0xcc;return function(_0x3dcf23){if(_0x3dcf23){return _0xf1b090[_0x7b7c('0x18')](_0x6cbb25);}return _0xf1b090['status'](_0x6cbb25)[_0x7b7c('0x19')]();};}function respondWithResult(_0xce86e7,_0x551e03){_0x551e03=_0x551e03||0xc8;return function(_0xba30ec){if(_0xba30ec){return _0xce86e7[_0x7b7c('0x1a')](_0x551e03)['json'](_0xba30ec);}};}function respondWithFilteredResult(_0x16d758,_0x5b4204){return function(_0x390b21){if(_0x390b21){var _0x3cbf60=typeof _0x5b4204[_0x7b7c('0x1b')]===_0x7b7c('0x1c')&&typeof _0x5b4204[_0x7b7c('0x1d')]===_0x7b7c('0x1c');var _0x34e607=_0x390b21[_0x7b7c('0x1e')];var _0x3e8453=_0x3cbf60?0x0:_0x5b4204[_0x7b7c('0x1b')];var _0x3d806e=_0x3cbf60?_0x390b21[_0x7b7c('0x1e')]:_0x5b4204[_0x7b7c('0x1b')]+_0x5b4204[_0x7b7c('0x1d')];var _0x218414;if(_0x3d806e>=_0x34e607){_0x3d806e=_0x34e607;_0x218414=0xc8;}else{_0x218414=0xce;}_0x16d758['status'](_0x218414);return _0x16d758[_0x7b7c('0x1f')](_0x7b7c('0x20'),_0x3e8453+'-'+_0x3d806e+'/'+_0x34e607)[_0x7b7c('0x21')](_0x390b21);}return null;};}function patchUpdates(_0x2e124a){return function(_0x4eb7e7){try{jsonpatch[_0x7b7c('0x22')](_0x4eb7e7,_0x2e124a,!![]);}catch(_0xe57a2a){return BPromise[_0x7b7c('0x23')](_0xe57a2a);}return _0x4eb7e7[_0x7b7c('0x24')]();};}function saveUpdates(_0x1d8982,_0x4e3df1){return function(_0x3d9b97){if(_0x3d9b97){return _0x3d9b97[_0x7b7c('0x25')](_0x1d8982)[_0x7b7c('0x26')](function(_0x3fff3f){return _0x3fff3f;});}return null;};}function removeEntity(_0x966a6d,_0x222dbf){return function(_0x764e2a){if(_0x764e2a){return _0x764e2a['destroy']()[_0x7b7c('0x26')](function(){_0x966a6d['status'](0xcc)[_0x7b7c('0x19')]();});}};}function handleEntityNotFound(_0x7e4918,_0x4b6d8c){return function(_0x257d55){if(!_0x257d55){_0x7e4918[_0x7b7c('0x18')](0x194);}return _0x257d55;};}function handleError(_0x34b139,_0x477336){_0x477336=_0x477336||0x1f4;return function(_0x3fd7e2){logger[_0x7b7c('0x27')](_0x3fd7e2['stack']);if(_0x3fd7e2[_0x7b7c('0x28')]){delete _0x3fd7e2['name'];}_0x34b139[_0x7b7c('0x1a')](_0x477336)[_0x7b7c('0x29')](_0x3fd7e2);};}exports[_0x7b7c('0x2a')]=function(_0x2a9120,_0x8d31f0){var _0x75b286={},_0x164af2={},_0xf9c350={'count':0x0,'rows':[]};var _0x1662f2=_[_0x7b7c('0x2b')](db['SmsQueueReport'][_0x7b7c('0x2c')],function(_0x3ffcc3){return{'name':_0x3ffcc3[_0x7b7c('0x2d')],'type':_0x3ffcc3['type']['key']};});_0x164af2[_0x7b7c('0x2e')]=_[_0x7b7c('0x2b')](_0x1662f2,_0x7b7c('0x28'));_0x164af2['query']=_['keys'](_0x2a9120[_0x7b7c('0x2f')]);_0x164af2[_0x7b7c('0x30')]=_[_0x7b7c('0x31')](_0x164af2[_0x7b7c('0x2e')],_0x164af2[_0x7b7c('0x2f')]);_0x75b286[_0x7b7c('0x32')]=_[_0x7b7c('0x31')](_0x164af2['model'],qs[_0x7b7c('0x33')](_0x2a9120[_0x7b7c('0x2f')][_0x7b7c('0x33')]));_0x75b286[_0x7b7c('0x32')]=_0x75b286[_0x7b7c('0x32')][_0x7b7c('0x34')]?_0x75b286[_0x7b7c('0x32')]:_0x164af2[_0x7b7c('0x2e')];if(!_0x2a9120[_0x7b7c('0x2f')]['hasOwnProperty'](_0x7b7c('0x35'))){_0x75b286[_0x7b7c('0x1d')]=qs[_0x7b7c('0x1d')](_0x2a9120[_0x7b7c('0x2f')][_0x7b7c('0x1d')]);_0x75b286[_0x7b7c('0x1b')]=qs[_0x7b7c('0x1b')](_0x2a9120[_0x7b7c('0x2f')][_0x7b7c('0x1b')]);}_0x75b286[_0x7b7c('0x36')]=qs[_0x7b7c('0x37')](_0x2a9120[_0x7b7c('0x2f')][_0x7b7c('0x37')]);_0x75b286['where']=qs['filters'](_[_0x7b7c('0x38')](_0x2a9120[_0x7b7c('0x2f')],_0x164af2[_0x7b7c('0x30')]),_0x1662f2);if(_0x2a9120[_0x7b7c('0x2f')]['filter']){_0x75b286[_0x7b7c('0x39')]=_[_0x7b7c('0x3a')](_0x75b286[_0x7b7c('0x39')],{'$or':_['map'](_0x1662f2,function(_0x2a9e1d){if(_0x2a9e1d[_0x7b7c('0x3b')]!==_0x7b7c('0x3c')){var _0x406ae7={};_0x406ae7[_0x2a9e1d[_0x7b7c('0x28')]]={'$like':'%'+_0x2a9120[_0x7b7c('0x2f')][_0x7b7c('0x3d')]+'%'};return _0x406ae7;}})});}_0x75b286=_[_0x7b7c('0x3a')]({},_0x75b286,_0x2a9120[_0x7b7c('0x3e')]);var _0x2daa18={'where':_0x75b286[_0x7b7c('0x39')]};return db['SmsQueueReport'][_0x7b7c('0x1e')](_0x2daa18)['then'](function(_0x5eec92){_0xf9c350['count']=_0x5eec92;if(_0x2a9120[_0x7b7c('0x2f')]['includeAll']){_0x75b286['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x7b7c('0x3f')](_0x75b286);})['then'](function(_0x27f067){_0xf9c350[_0x7b7c('0x40')]=_0x27f067;return _0xf9c350;})[_0x7b7c('0x26')](respondWithFilteredResult(_0x8d31f0,_0x75b286))[_0x7b7c('0x41')](handleError(_0x8d31f0,null));};exports['show']=function(_0x54a1ad,_0x1ea6b9){var _0x19c1c6={'raw':!![],'where':{'id':_0x54a1ad['params']['id']}},_0x1108d6={};_0x1108d6[_0x7b7c('0x2e')]=_[_0x7b7c('0x42')](db[_0x7b7c('0x43')][_0x7b7c('0x2c')]);_0x1108d6[_0x7b7c('0x2f')]=_[_0x7b7c('0x42')](_0x54a1ad['query']);_0x1108d6[_0x7b7c('0x30')]=_[_0x7b7c('0x31')](_0x1108d6[_0x7b7c('0x2e')],_0x1108d6[_0x7b7c('0x2f')]);_0x19c1c6[_0x7b7c('0x32')]=_[_0x7b7c('0x31')](_0x1108d6[_0x7b7c('0x2e')],qs[_0x7b7c('0x33')](_0x54a1ad[_0x7b7c('0x2f')][_0x7b7c('0x33')]));_0x19c1c6[_0x7b7c('0x32')]=_0x19c1c6['attributes'][_0x7b7c('0x34')]?_0x19c1c6['attributes']:_0x1108d6[_0x7b7c('0x2e')];if(_0x54a1ad['query'][_0x7b7c('0x44')]){_0x19c1c6[_0x7b7c('0x45')]=[{'all':!![]}];}_0x19c1c6=_[_0x7b7c('0x3a')]({},_0x19c1c6,_0x54a1ad['options']);return db[_0x7b7c('0x43')][_0x7b7c('0x46')](_0x19c1c6)[_0x7b7c('0x26')](handleEntityNotFound(_0x1ea6b9,null))['then'](respondWithResult(_0x1ea6b9,null))['catch'](handleError(_0x1ea6b9,null));};exports['create']=function(_0x5c1633,_0x2ed4db){return db['SmsQueueReport']['create'](_0x5c1633[_0x7b7c('0x47')],{})[_0x7b7c('0x26')](respondWithResult(_0x2ed4db,0xc9))[_0x7b7c('0x41')](handleError(_0x2ed4db,null));};exports[_0x7b7c('0x25')]=function(_0x10686b,_0x3b3ff4){if(_0x10686b[_0x7b7c('0x47')]['id']){delete _0x10686b['body']['id'];}return db['SmsQueueReport'][_0x7b7c('0x46')]({'where':{'id':_0x10686b[_0x7b7c('0x48')]['id']}})[_0x7b7c('0x26')](handleEntityNotFound(_0x3b3ff4,null))[_0x7b7c('0x26')](saveUpdates(_0x10686b[_0x7b7c('0x47')],null))[_0x7b7c('0x26')](respondWithResult(_0x3b3ff4,null))[_0x7b7c('0x41')](handleError(_0x3b3ff4,null));};exports[_0x7b7c('0x49')]=function(_0x21c8dd,_0x3f17ce){return db[_0x7b7c('0x43')][_0x7b7c('0x46')]({'where':{'id':_0x21c8dd[_0x7b7c('0x48')]['id']}})[_0x7b7c('0x26')](handleEntityNotFound(_0x3f17ce,null))[_0x7b7c('0x26')](removeEntity(_0x3f17ce,null))[_0x7b7c('0x41')](handleError(_0x3f17ce,null));};exports[_0x7b7c('0x4a')]=function(_0x4b9882,_0x2dee22){return db[_0x7b7c('0x43')]['describe']()[_0x7b7c('0x26')](respondWithResult(_0x2dee22,null))[_0x7b7c('0x41')](handleError(_0x2dee22,null));};
\ No newline at end of file
+var _0xc0f4=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1be6fd,_0x352ce2){var _0x4fce15=function(_0x3b514f){while(--_0x3b514f){_0x1be6fd['push'](_0x1be6fd['shift']());}};_0x4fce15(++_0x352ce2);}(_0xc0f4,0x1c0));var _0x4c0f=function(_0x11582b,_0x363a7){_0x11582b=_0x11582b-0x0;var _0x44a232=_0xc0f4[_0x11582b];return _0x44a232;};'use strict';var emlformat=require(_0x4c0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4c0f('0x1'));var jsonpatch=require(_0x4c0f('0x2'));var rp=require(_0x4c0f('0x3'));var moment=require(_0x4c0f('0x4'));var BPromise=require(_0x4c0f('0x5'));var Mustache=require(_0x4c0f('0x6'));var util=require(_0x4c0f('0x7'));var path=require('path');var sox=require(_0x4c0f('0x8'));var csv=require(_0x4c0f('0x9'));var ejs=require(_0x4c0f('0xa'));var fs=require('fs');var fs_extra=require(_0x4c0f('0xb'));var _=require(_0x4c0f('0xc'));var squel=require(_0x4c0f('0xd'));var crypto=require(_0x4c0f('0xe'));var jsforce=require(_0x4c0f('0xf'));var deskjs=require(_0x4c0f('0x10'));var toCsv=require(_0x4c0f('0x9'));var querystring=require(_0x4c0f('0x11'));var Papa=require(_0x4c0f('0x12'));var Redis=require('ioredis');var authService=require(_0x4c0f('0x13'));var qs=require(_0x4c0f('0x14'));var as=require(_0x4c0f('0x15'));var hardwareService=require(_0x4c0f('0x16'));var logger=require(_0x4c0f('0x17'))(_0x4c0f('0x18'));var utils=require(_0x4c0f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4c0f('0x1a'))['db'];function respondWithStatusCode(_0x1f9c85,_0xae51ff){_0xae51ff=_0xae51ff||0xcc;return function(_0x395a28){if(_0x395a28){return _0x1f9c85[_0x4c0f('0x1b')](_0xae51ff);}return _0x1f9c85[_0x4c0f('0x1c')](_0xae51ff)[_0x4c0f('0x1d')]();};}function respondWithResult(_0x17625c,_0x57587d){_0x57587d=_0x57587d||0xc8;return function(_0x5f1711){if(_0x5f1711){return _0x17625c[_0x4c0f('0x1c')](_0x57587d)[_0x4c0f('0x1e')](_0x5f1711);}};}function respondWithFilteredResult(_0x2fd6ae,_0x2a18a9){return function(_0x1a335e){if(_0x1a335e){var _0x5a8961=typeof _0x2a18a9[_0x4c0f('0x1f')]===_0x4c0f('0x20')&&typeof _0x2a18a9[_0x4c0f('0x21')]==='undefined';var _0x5c3480=_0x1a335e['count'];var _0x4459b7=_0x5a8961?0x0:_0x2a18a9[_0x4c0f('0x1f')];var _0x559d14=_0x5a8961?_0x1a335e[_0x4c0f('0x22')]:_0x2a18a9[_0x4c0f('0x1f')]+_0x2a18a9[_0x4c0f('0x21')];var _0x1d82a4;if(_0x559d14>=_0x5c3480){_0x559d14=_0x5c3480;_0x1d82a4=0xc8;}else{_0x1d82a4=0xce;}_0x2fd6ae[_0x4c0f('0x1c')](_0x1d82a4);return _0x2fd6ae['set']('Content-Range',_0x4459b7+'-'+_0x559d14+'/'+_0x5c3480)[_0x4c0f('0x1e')](_0x1a335e);}return null;};}function patchUpdates(_0x4ca0aa){return function(_0x1b4cdd){try{jsonpatch[_0x4c0f('0x23')](_0x1b4cdd,_0x4ca0aa,!![]);}catch(_0x331aa3){return BPromise[_0x4c0f('0x24')](_0x331aa3);}return _0x1b4cdd[_0x4c0f('0x25')]();};}function saveUpdates(_0x43b6c3,_0x32c140){return function(_0x150099){if(_0x150099){return _0x150099[_0x4c0f('0x26')](_0x43b6c3)[_0x4c0f('0x27')](function(_0x531066){return _0x531066;});}return null;};}function removeEntity(_0x23c022,_0x404678){return function(_0x1d3cfe){if(_0x1d3cfe){return _0x1d3cfe[_0x4c0f('0x28')]()[_0x4c0f('0x27')](function(){_0x23c022[_0x4c0f('0x1c')](0xcc)[_0x4c0f('0x1d')]();});}};}function handleEntityNotFound(_0x299501,_0x2bbf51){return function(_0x3c7a45){if(!_0x3c7a45){_0x299501[_0x4c0f('0x1b')](0x194);}return _0x3c7a45;};}function handleError(_0x4879dc,_0x404283){_0x404283=_0x404283||0x1f4;return function(_0xa39eee){logger[_0x4c0f('0x29')](_0xa39eee[_0x4c0f('0x2a')]);if(_0xa39eee[_0x4c0f('0x2b')]){delete _0xa39eee[_0x4c0f('0x2b')];}_0x4879dc[_0x4c0f('0x1c')](_0x404283)[_0x4c0f('0x2c')](_0xa39eee);};}exports[_0x4c0f('0x2d')]=function(_0x143635,_0x2c9617){var _0x328a36={},_0x57f5bc={},_0x3dd9fb={'count':0x0,'rows':[]};var _0x182189=_[_0x4c0f('0x2e')](db[_0x4c0f('0x2f')]['rawAttributes'],function(_0x5da8d8){return{'name':_0x5da8d8[_0x4c0f('0x30')],'type':_0x5da8d8[_0x4c0f('0x31')][_0x4c0f('0x32')]};});_0x57f5bc[_0x4c0f('0x33')]=_['map'](_0x182189,_0x4c0f('0x2b'));_0x57f5bc['query']=_[_0x4c0f('0x34')](_0x143635[_0x4c0f('0x35')]);_0x57f5bc['filters']=_[_0x4c0f('0x36')](_0x57f5bc[_0x4c0f('0x33')],_0x57f5bc[_0x4c0f('0x35')]);_0x328a36[_0x4c0f('0x37')]=_['intersection'](_0x57f5bc[_0x4c0f('0x33')],qs[_0x4c0f('0x38')](_0x143635[_0x4c0f('0x35')][_0x4c0f('0x38')]));_0x328a36[_0x4c0f('0x37')]=_0x328a36[_0x4c0f('0x37')][_0x4c0f('0x39')]?_0x328a36[_0x4c0f('0x37')]:_0x57f5bc[_0x4c0f('0x33')];if(!_0x143635['query'][_0x4c0f('0x3a')](_0x4c0f('0x3b'))){_0x328a36[_0x4c0f('0x21')]=qs['limit'](_0x143635[_0x4c0f('0x35')]['limit']);_0x328a36['offset']=qs[_0x4c0f('0x1f')](_0x143635[_0x4c0f('0x35')]['offset']);}_0x328a36[_0x4c0f('0x3c')]=qs[_0x4c0f('0x3d')](_0x143635[_0x4c0f('0x35')][_0x4c0f('0x3d')]);_0x328a36[_0x4c0f('0x3e')]=qs[_0x4c0f('0x3f')](_[_0x4c0f('0x40')](_0x143635[_0x4c0f('0x35')],_0x57f5bc[_0x4c0f('0x3f')]),_0x182189);if(_0x143635[_0x4c0f('0x35')][_0x4c0f('0x41')]){_0x328a36[_0x4c0f('0x3e')]=_['merge'](_0x328a36[_0x4c0f('0x3e')],{'$or':_[_0x4c0f('0x2e')](_0x182189,function(_0x4b8de1){if(_0x4b8de1['type']!==_0x4c0f('0x42')){var _0x2cc7ea={};_0x2cc7ea[_0x4b8de1[_0x4c0f('0x2b')]]={'$like':'%'+_0x143635['query']['filter']+'%'};return _0x2cc7ea;}})});}_0x328a36=_[_0x4c0f('0x43')]({},_0x328a36,_0x143635[_0x4c0f('0x44')]);var _0x580670={'where':_0x328a36[_0x4c0f('0x3e')]};return db[_0x4c0f('0x2f')][_0x4c0f('0x22')](_0x580670)[_0x4c0f('0x27')](function(_0x5d8286){_0x3dd9fb[_0x4c0f('0x22')]=_0x5d8286;if(_0x143635[_0x4c0f('0x35')][_0x4c0f('0x45')]){_0x328a36['include']=[{'all':!![]}];}return db[_0x4c0f('0x2f')]['findAll'](_0x328a36);})['then'](function(_0x450b6c){_0x3dd9fb[_0x4c0f('0x46')]=_0x450b6c;return _0x3dd9fb;})['then'](respondWithFilteredResult(_0x2c9617,_0x328a36))[_0x4c0f('0x47')](handleError(_0x2c9617,null));};exports['show']=function(_0x5cbca0,_0x5aabb8){var _0x9104e5={'raw':!![],'where':{'id':_0x5cbca0[_0x4c0f('0x48')]['id']}},_0x458b44={};_0x458b44[_0x4c0f('0x33')]=_[_0x4c0f('0x34')](db[_0x4c0f('0x2f')][_0x4c0f('0x49')]);_0x458b44['query']=_['keys'](_0x5cbca0[_0x4c0f('0x35')]);_0x458b44[_0x4c0f('0x3f')]=_[_0x4c0f('0x36')](_0x458b44[_0x4c0f('0x33')],_0x458b44[_0x4c0f('0x35')]);_0x9104e5['attributes']=_['intersection'](_0x458b44[_0x4c0f('0x33')],qs[_0x4c0f('0x38')](_0x5cbca0['query']['fields']));_0x9104e5['attributes']=_0x9104e5['attributes'][_0x4c0f('0x39')]?_0x9104e5[_0x4c0f('0x37')]:_0x458b44[_0x4c0f('0x33')];if(_0x5cbca0[_0x4c0f('0x35')][_0x4c0f('0x45')]){_0x9104e5[_0x4c0f('0x4a')]=[{'all':!![]}];}_0x9104e5=_[_0x4c0f('0x43')]({},_0x9104e5,_0x5cbca0[_0x4c0f('0x44')]);return db[_0x4c0f('0x2f')][_0x4c0f('0x4b')](_0x9104e5)[_0x4c0f('0x27')](handleEntityNotFound(_0x5aabb8,null))[_0x4c0f('0x27')](respondWithResult(_0x5aabb8,null))[_0x4c0f('0x47')](handleError(_0x5aabb8,null));};exports[_0x4c0f('0x4c')]=function(_0x10b479,_0x3fb9b3){return db[_0x4c0f('0x2f')]['create'](_0x10b479[_0x4c0f('0x4d')],{})[_0x4c0f('0x27')](respondWithResult(_0x3fb9b3,0xc9))[_0x4c0f('0x47')](handleError(_0x3fb9b3,null));};exports['update']=function(_0x33ccb9,_0x126680){if(_0x33ccb9['body']['id']){delete _0x33ccb9[_0x4c0f('0x4d')]['id'];}return db[_0x4c0f('0x2f')][_0x4c0f('0x4b')]({'where':{'id':_0x33ccb9['params']['id']}})['then'](handleEntityNotFound(_0x126680,null))['then'](saveUpdates(_0x33ccb9[_0x4c0f('0x4d')],null))[_0x4c0f('0x27')](respondWithResult(_0x126680,null))[_0x4c0f('0x47')](handleError(_0x126680,null));};exports['destroy']=function(_0x5a243c,_0x416961){return db[_0x4c0f('0x2f')][_0x4c0f('0x4b')]({'where':{'id':_0x5a243c[_0x4c0f('0x48')]['id']}})['then'](handleEntityNotFound(_0x416961,null))[_0x4c0f('0x27')](removeEntity(_0x416961,null))[_0x4c0f('0x47')](handleError(_0x416961,null));};exports['describe']=function(_0x1154d1,_0x16ece8){return db[_0x4c0f('0x2f')][_0x4c0f('0x4e')]()[_0x4c0f('0x27')](respondWithResult(_0x16ece8,null))['catch'](handleError(_0x16ece8,null));};
\ No newline at end of file
index 1fe9d96..af86a65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_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
+var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x145176,_0xc838b5){var _0x425129=function(_0x47f6c8){while(--_0x47f6c8){_0x145176['push'](_0x145176['shift']());}};_0x425129(++_0xc838b5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0xcb91[_0x3725ee];return _0x399c71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 3fdc773..40fc2e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc491=['http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','CreateSmsQueueReport','create','body','options','raw','info','SmsQueueReport','update','attributes','limit','UpdateSmsQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x42003f,_0x1ac84a){var _0x371c69=function(_0x358814){while(--_0x358814){_0x42003f['push'](_0x42003f['shift']());}};_0x371c69(++_0x1ac84a);}(_0xc491,0x19c));var _0x1c49=function(_0x15cae3,_0x458cb9){_0x15cae3=_0x15cae3-0x0;var _0x20596f=_0xc491[_0x15cae3];return _0x20596f;};'use strict';var _=require(_0x1c49('0x0'));var util=require(_0x1c49('0x1'));var moment=require('moment');var BPromise=require(_0x1c49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c49('0x3'));var db=require(_0x1c49('0x4'))['db'];var utils=require(_0x1c49('0x5'));var logger=require(_0x1c49('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1c49('0x7'));var client=jayson['client'][_0x1c49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b9031,_0x40b6b3,_0x528e31){return new BPromise(function(_0x21fe96,_0x8705e9){return client[_0x1c49('0x9')](_0x3b9031,_0x528e31)[_0x1c49('0xa')](function(_0x9f6458){logger['info'](_0x1c49('0xb'),_0x40b6b3,'request\x20sent');logger[_0x1c49('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x40b6b3,_0x1c49('0xd'),JSON[_0x1c49('0xe')](_0x9f6458));if(_0x9f6458[_0x1c49('0xf')]){if(_0x9f6458[_0x1c49('0xf')][_0x1c49('0x10')]===0x1f4){logger['error'](_0x1c49('0xb'),_0x40b6b3,_0x9f6458['error']['message']);return _0x8705e9(_0x9f6458['error'][_0x1c49('0x11')]);}logger[_0x1c49('0xf')](_0x1c49('0xb'),_0x40b6b3,_0x9f6458[_0x1c49('0xf')]['message']);return _0x21fe96(_0x9f6458['error']['message']);}else{logger['info'](_0x1c49('0xb'),_0x40b6b3,_0x1c49('0xd'));_0x21fe96(_0x9f6458['result'][_0x1c49('0x11')]);}})[_0x1c49('0x12')](function(_0x5ae73d){logger[_0x1c49('0xf')](_0x1c49('0xb'),_0x40b6b3,_0x5ae73d);_0x8705e9(_0x5ae73d);});});}exports[_0x1c49('0x13')]=function(_0x328c29){var _0x1275fb=this;return new Promise(function(_0x326385,_0x225de0){return db['SmsQueueReport'][_0x1c49('0x14')](_0x328c29[_0x1c49('0x15')],{'raw':_0x328c29[_0x1c49('0x16')]?_0x328c29['options'][_0x1c49('0x17')]===undefined?!![]:![]:!![]})[_0x1c49('0xa')](function(_0x490f3f){logger[_0x1c49('0x18')](_0x1c49('0x13'),_0x328c29);logger[_0x1c49('0xc')]('CreateSmsQueueReport',_0x328c29,JSON[_0x1c49('0xe')](_0x490f3f));_0x326385(_0x490f3f);})['catch'](function(_0x52baaf){logger[_0x1c49('0xf')](_0x1c49('0x13'),_0x52baaf[_0x1c49('0x11')],_0x328c29);_0x225de0(_0x1275fb[_0x1c49('0xf')](0x1f4,_0x52baaf[_0x1c49('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0xbb717a){var _0x5e5711=this;return new Promise(function(_0x217521,_0x4006b5){return db[_0x1c49('0x19')][_0x1c49('0x1a')](_0xbb717a[_0x1c49('0x15')],{'raw':_0xbb717a['options']?_0xbb717a[_0x1c49('0x16')][_0x1c49('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb717a[_0x1c49('0x16')]?_0xbb717a[_0x1c49('0x16')]['where']||null:null,'attributes':_0xbb717a['options']?_0xbb717a[_0x1c49('0x16')][_0x1c49('0x1b')]||null:null,'limit':_0xbb717a[_0x1c49('0x16')]?_0xbb717a['options'][_0x1c49('0x1c')]||null:null})[_0x1c49('0xa')](function(_0x5053af){logger['info']('UpdateSmsQueueReport',_0xbb717a);logger[_0x1c49('0xc')](_0x1c49('0x1d'),_0xbb717a,JSON[_0x1c49('0xe')](_0x5053af));_0x217521(_0x5053af);})['catch'](function(_0x4c5614){logger['error'](_0x1c49('0x1d'),_0x4c5614[_0x1c49('0x11')],_0xbb717a);_0x4006b5(_0x5e5711[_0x1c49('0xf')](0x1f4,_0x4c5614[_0x1c49('0x11')]));});});};
\ No newline at end of file
+var _0x8e46=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','SmsQueueReport','create','body','raw','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','options','where'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8e46,0x8e));var _0x68e4=function(_0x23a8ba,_0xab5848){_0x23a8ba=_0x23a8ba-0x0;var _0x468389=_0x8e46[_0x23a8ba];return _0x468389;};'use strict';var _=require(_0x68e4('0x0'));var util=require(_0x68e4('0x1'));var moment=require(_0x68e4('0x2'));var BPromise=require(_0x68e4('0x3'));var rs=require(_0x68e4('0x4'));var fs=require('fs');var Redis=require(_0x68e4('0x5'));var db=require(_0x68e4('0x6'))['db'];var utils=require(_0x68e4('0x7'));var logger=require(_0x68e4('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x68e4('0x9'));var client=jayson[_0x68e4('0xa')][_0x68e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1746ac,_0x41fa3d,_0x2fadfc){return new BPromise(function(_0x10db8d,_0xcdac83){return client[_0x68e4('0xc')](_0x1746ac,_0x2fadfc)[_0x68e4('0xd')](function(_0x171ff0){logger[_0x68e4('0xe')](_0x68e4('0xf'),_0x41fa3d,_0x68e4('0x10'));logger[_0x68e4('0x11')](_0x68e4('0x12'),_0x41fa3d,_0x68e4('0x10'),JSON['stringify'](_0x171ff0));if(_0x171ff0[_0x68e4('0x13')]){if(_0x171ff0['error']['code']===0x1f4){logger['error'](_0x68e4('0xf'),_0x41fa3d,_0x171ff0[_0x68e4('0x13')][_0x68e4('0x14')]);return _0xcdac83(_0x171ff0[_0x68e4('0x13')][_0x68e4('0x14')]);}logger[_0x68e4('0x13')](_0x68e4('0xf'),_0x41fa3d,_0x171ff0['error'][_0x68e4('0x14')]);return _0x10db8d(_0x171ff0[_0x68e4('0x13')]['message']);}else{logger[_0x68e4('0xe')](_0x68e4('0xf'),_0x41fa3d,_0x68e4('0x10'));_0x10db8d(_0x171ff0[_0x68e4('0x15')]['message']);}})[_0x68e4('0x16')](function(_0x50d6c8){logger['error'](_0x68e4('0xf'),_0x41fa3d,_0x50d6c8);_0xcdac83(_0x50d6c8);});});}exports['CreateSmsQueueReport']=function(_0x494a99){var _0x544ba2=this;return new Promise(function(_0x5e9a4a,_0xc46b44){return db[_0x68e4('0x17')][_0x68e4('0x18')](_0x494a99[_0x68e4('0x19')],{'raw':_0x494a99['options']?_0x494a99['options'][_0x68e4('0x1a')]===undefined?!![]:![]:!![]})[_0x68e4('0xd')](function(_0x4d6a19){logger['info'](_0x68e4('0x1b'),_0x494a99);logger[_0x68e4('0x11')]('CreateSmsQueueReport',_0x494a99,JSON[_0x68e4('0x1c')](_0x4d6a19));_0x5e9a4a(_0x4d6a19);})['catch'](function(_0x5362a4){logger[_0x68e4('0x13')](_0x68e4('0x1b'),_0x5362a4['message'],_0x494a99);_0xc46b44(_0x544ba2[_0x68e4('0x13')](0x1f4,_0x5362a4[_0x68e4('0x14')]));});});};exports[_0x68e4('0x1d')]=function(_0x1afc71){var _0x3f3a5f=this;return new Promise(function(_0x5e461b,_0x2d4e8c){return db[_0x68e4('0x17')][_0x68e4('0x1e')](_0x1afc71[_0x68e4('0x19')],{'raw':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x20')]||null:null,'attributes':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x21')]||null:null,'limit':_0x1afc71[_0x68e4('0x1f')]?_0x1afc71[_0x68e4('0x1f')][_0x68e4('0x22')]||null:null})[_0x68e4('0xd')](function(_0x505a21){logger[_0x68e4('0xe')](_0x68e4('0x1d'),_0x1afc71);logger[_0x68e4('0x11')](_0x68e4('0x1d'),_0x1afc71,JSON[_0x68e4('0x1c')](_0x505a21));_0x5e461b(_0x505a21);})[_0x68e4('0x16')](function(_0x23e071){logger['error'](_0x68e4('0x1d'),_0x23e071[_0x68e4('0x14')],_0x1afc71);_0x2d4e8c(_0x3f3a5f[_0x68e4('0x13')](0x1f4,_0x23e071['message']));});});};
\ No newline at end of file
index 1bdc893..70d5f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b1=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','/describe','isAuthenticated','describe','get','show','create','/:id','update','delete','destroy'];(function(_0x4ede04,_0x58132b){var _0x49ccfc=function(_0x51a704){while(--_0x51a704){_0x4ede04['push'](_0x4ede04['shift']());}};_0x49ccfc(++_0x58132b);}(_0xd8b1,0x105));var _0x1d8b=function(_0x10386a,_0x19cdf4){_0x10386a=_0x10386a-0x0;var _0x4a6105=_0xd8b1[_0x10386a];return _0x4a6105;};'use strict';var multer=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var path=require(_0x1d8b('0x2'));var timeout=require(_0x1d8b('0x3'));var express=require(_0x1d8b('0x4'));var router=express['Router']();var fs_extra=require(_0x1d8b('0x5'));var auth=require(_0x1d8b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d8b('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1d8b('0x8')]);router['get'](_0x1d8b('0x9'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0xb')]);router[_0x1d8b('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x1d8b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d8b('0xe')]);router['put'](_0x1d8b('0xf'),auth['isAuthenticated'](),controller[_0x1d8b('0x10')]);router[_0x1d8b('0x11')](_0x1d8b('0xf'),auth[_0x1d8b('0xa')](),controller[_0x1d8b('0x12')]);module[_0x1d8b('0x13')]=router;
\ No newline at end of file
+var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x1f25b3,_0x4e17a5){var _0x527093=function(_0x1ba28b){while(--_0x1ba28b){_0x1f25b3['push'](_0x1f25b3['shift']());}};_0x527093(++_0x4e17a5);}(_0x1cb9,0x14e));var _0x91cb=function(_0x56dcb9,_0x4a01cb){_0x56dcb9=_0x56dcb9-0x0;var _0x4d105e=_0x1cb9[_0x56dcb9];return _0x4d105e;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router;
\ No newline at end of file
index c1bb7be..889090b 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(_0x34986b,_0x56fb4a){var _0x28a0d1=function(_0x2c1e2a){while(--_0x2c1e2a){_0x34986b['push'](_0x34986b['shift']());}};_0x28a0d1(++_0x56fb4a);}(_0x008c,0x188));var _0xc008=function(_0x1ed791,_0x3c86aa){_0x1ed791=_0x1ed791-0x0;var _0xea6482=_0x008c[_0x1ed791];return _0xea6482;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x47c758,_0x10a261){var _0xe0b1e0=function(_0x33bef5){while(--_0x33bef5){_0x47c758['push'](_0x47c758['shift']());}};_0xe0b1e0(++_0x10a261);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 ae55fc5..b5ecb9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f36=['undefined','limit','count','offset','set','Content-Range','reject','update','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','keys','filters','intersection','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x7f36,0x7f));var _0x67f3=function(_0x166f66,_0x215e38){_0x166f66=_0x166f66-0x0;var _0x179df3=_0x7f36[_0x166f66];return _0x179df3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67f3('0x0'));var zipdir=require(_0x67f3('0x1'));var jsonpatch=require(_0x67f3('0x2'));var rp=require(_0x67f3('0x3'));var moment=require(_0x67f3('0x4'));var BPromise=require(_0x67f3('0x5'));var Mustache=require(_0x67f3('0x6'));var util=require(_0x67f3('0x7'));var path=require('path');var sox=require(_0x67f3('0x8'));var csv=require(_0x67f3('0x9'));var ejs=require(_0x67f3('0xa'));var fs=require('fs');var fs_extra=require(_0x67f3('0xb'));var _=require(_0x67f3('0xc'));var squel=require(_0x67f3('0xd'));var crypto=require(_0x67f3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x67f3('0xf'));var toCsv=require(_0x67f3('0x9'));var querystring=require(_0x67f3('0x10'));var Papa=require(_0x67f3('0x11'));var Redis=require(_0x67f3('0x12'));var authService=require(_0x67f3('0x13'));var qs=require(_0x67f3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67f3('0x15'));var logger=require(_0x67f3('0x16'))(_0x67f3('0x17'));var utils=require(_0x67f3('0x18'));var config=require(_0x67f3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x67f3('0x1a'))['db'];function respondWithStatusCode(_0x203ba1,_0xa90a59){_0xa90a59=_0xa90a59||0xcc;return function(_0x30bad7){if(_0x30bad7){return _0x203ba1[_0x67f3('0x1b')](_0xa90a59);}return _0x203ba1['status'](_0xa90a59)[_0x67f3('0x1c')]();};}function respondWithResult(_0x26d7c2,_0x33f7e6){_0x33f7e6=_0x33f7e6||0xc8;return function(_0x4a68e4){if(_0x4a68e4){return _0x26d7c2[_0x67f3('0x1d')](_0x33f7e6)[_0x67f3('0x1e')](_0x4a68e4);}};}function respondWithFilteredResult(_0x491f27,_0xba5904){return function(_0x1bd332){if(_0x1bd332){var _0x19fab3=typeof _0xba5904['offset']===_0x67f3('0x1f')&&typeof _0xba5904[_0x67f3('0x20')]==='undefined';var _0x3d0569=_0x1bd332[_0x67f3('0x21')];var _0x3e6c06=_0x19fab3?0x0:_0xba5904[_0x67f3('0x22')];var _0x40cab9=_0x19fab3?_0x1bd332[_0x67f3('0x21')]:_0xba5904[_0x67f3('0x22')]+_0xba5904[_0x67f3('0x20')];var _0x1422d2;if(_0x40cab9>=_0x3d0569){_0x40cab9=_0x3d0569;_0x1422d2=0xc8;}else{_0x1422d2=0xce;}_0x491f27[_0x67f3('0x1d')](_0x1422d2);return _0x491f27[_0x67f3('0x23')](_0x67f3('0x24'),_0x3e6c06+'-'+_0x40cab9+'/'+_0x3d0569)[_0x67f3('0x1e')](_0x1bd332);}return null;};}function patchUpdates(_0x18522b){return function(_0x44f3bc){try{jsonpatch['apply'](_0x44f3bc,_0x18522b,!![]);}catch(_0x1e0cb2){return BPromise[_0x67f3('0x25')](_0x1e0cb2);}return _0x44f3bc['save']();};}function saveUpdates(_0x257684,_0x58044d){return function(_0x368ad2){if(_0x368ad2){return _0x368ad2[_0x67f3('0x26')](_0x257684)[_0x67f3('0x27')](function(_0xdd0a4a){return _0xdd0a4a;});}return null;};}function removeEntity(_0x34a75b,_0x497661){return function(_0x528316){if(_0x528316){return _0x528316['destroy']()[_0x67f3('0x27')](function(){_0x34a75b['status'](0xcc)[_0x67f3('0x1c')]();});}};}function handleEntityNotFound(_0x54dab1,_0xe831f5){return function(_0x8aa9d4){if(!_0x8aa9d4){_0x54dab1[_0x67f3('0x1b')](0x194);}return _0x8aa9d4;};}function handleError(_0x31e444,_0x48afd9){_0x48afd9=_0x48afd9||0x1f4;return function(_0x18a695){logger[_0x67f3('0x28')](_0x18a695[_0x67f3('0x29')]);if(_0x18a695[_0x67f3('0x2a')]){delete _0x18a695[_0x67f3('0x2a')];}_0x31e444[_0x67f3('0x1d')](_0x48afd9)[_0x67f3('0x2b')](_0x18a695);};}exports[_0x67f3('0x2c')]=function(_0x3c9a27,_0x1881c5){var _0x18eb30={},_0x541321={},_0x4970c5={'count':0x0,'rows':[]};var _0x3f006b=_[_0x67f3('0x2d')](db[_0x67f3('0x2e')][_0x67f3('0x2f')],function(_0x546f7a){return{'name':_0x546f7a[_0x67f3('0x30')],'type':_0x546f7a[_0x67f3('0x31')]['key']};});_0x541321['model']=_['map'](_0x3f006b,'name');_0x541321['query']=_[_0x67f3('0x32')](_0x3c9a27['query']);_0x541321[_0x67f3('0x33')]=_[_0x67f3('0x34')](_0x541321[_0x67f3('0x35')],_0x541321[_0x67f3('0x36')]);_0x18eb30['attributes']=_['intersection'](_0x541321['model'],qs['fields'](_0x3c9a27[_0x67f3('0x36')][_0x67f3('0x37')]));_0x18eb30['attributes']=_0x18eb30['attributes']['length']?_0x18eb30[_0x67f3('0x38')]:_0x541321['model'];if(!_0x3c9a27[_0x67f3('0x36')][_0x67f3('0x39')](_0x67f3('0x3a'))){_0x18eb30[_0x67f3('0x20')]=qs[_0x67f3('0x20')](_0x3c9a27['query'][_0x67f3('0x20')]);_0x18eb30[_0x67f3('0x22')]=qs['offset'](_0x3c9a27[_0x67f3('0x36')][_0x67f3('0x22')]);}_0x18eb30[_0x67f3('0x3b')]=qs['sort'](_0x3c9a27[_0x67f3('0x36')][_0x67f3('0x3c')]);_0x18eb30[_0x67f3('0x3d')]=qs[_0x67f3('0x33')](_['pick'](_0x3c9a27[_0x67f3('0x36')],_0x541321[_0x67f3('0x33')]),_0x3f006b);if(_0x3c9a27[_0x67f3('0x36')][_0x67f3('0x3e')]){_0x18eb30['where']=_['merge'](_0x18eb30[_0x67f3('0x3d')],{'$or':_[_0x67f3('0x2d')](_0x3f006b,function(_0x5a48fe){if(_0x5a48fe[_0x67f3('0x31')]!==_0x67f3('0x3f')){var _0x4acd8f={};_0x4acd8f[_0x5a48fe['name']]={'$like':'%'+_0x3c9a27[_0x67f3('0x36')][_0x67f3('0x3e')]+'%'};return _0x4acd8f;}})});}_0x18eb30=_[_0x67f3('0x40')]({},_0x18eb30,_0x3c9a27[_0x67f3('0x41')]);var _0x22bfb7={'where':_0x18eb30[_0x67f3('0x3d')]};return db[_0x67f3('0x2e')]['count'](_0x22bfb7)['then'](function(_0xe840da){_0x4970c5[_0x67f3('0x21')]=_0xe840da;if(_0x3c9a27['query'][_0x67f3('0x42')]){_0x18eb30[_0x67f3('0x43')]=[{'all':!![]}];}return db[_0x67f3('0x2e')][_0x67f3('0x44')](_0x18eb30);})[_0x67f3('0x27')](function(_0x401d76){_0x4970c5[_0x67f3('0x45')]=_0x401d76;return _0x4970c5;})[_0x67f3('0x27')](respondWithFilteredResult(_0x1881c5,_0x18eb30))[_0x67f3('0x46')](handleError(_0x1881c5,null));};exports[_0x67f3('0x47')]=function(_0x1801c8,_0x423057){var _0x2e8901={'raw':!![],'where':{'id':_0x1801c8[_0x67f3('0x48')]['id']}},_0x467567={};_0x467567[_0x67f3('0x35')]=_[_0x67f3('0x32')](db[_0x67f3('0x2e')][_0x67f3('0x2f')]);_0x467567['query']=_['keys'](_0x1801c8['query']);_0x467567[_0x67f3('0x33')]=_['intersection'](_0x467567[_0x67f3('0x35')],_0x467567['query']);_0x2e8901[_0x67f3('0x38')]=_[_0x67f3('0x34')](_0x467567[_0x67f3('0x35')],qs['fields'](_0x1801c8['query'][_0x67f3('0x37')]));_0x2e8901[_0x67f3('0x38')]=_0x2e8901[_0x67f3('0x38')][_0x67f3('0x49')]?_0x2e8901[_0x67f3('0x38')]:_0x467567[_0x67f3('0x35')];if(_0x1801c8[_0x67f3('0x36')][_0x67f3('0x42')]){_0x2e8901[_0x67f3('0x43')]=[{'all':!![]}];}_0x2e8901=_['merge']({},_0x2e8901,_0x1801c8['options']);return db['SmsTransferReport']['find'](_0x2e8901)[_0x67f3('0x27')](handleEntityNotFound(_0x423057,null))['then'](respondWithResult(_0x423057,null))['catch'](handleError(_0x423057,null));};exports[_0x67f3('0x4a')]=function(_0x1a29d1,_0x4425b5){return db[_0x67f3('0x2e')][_0x67f3('0x4a')](_0x1a29d1[_0x67f3('0x4b')],{})[_0x67f3('0x27')](respondWithResult(_0x4425b5,0xc9))[_0x67f3('0x46')](handleError(_0x4425b5,null));};exports[_0x67f3('0x26')]=function(_0x3f29ad,_0x3cfec0){if(_0x3f29ad[_0x67f3('0x4b')]['id']){delete _0x3f29ad[_0x67f3('0x4b')]['id'];}return db[_0x67f3('0x2e')][_0x67f3('0x4c')]({'where':{'id':_0x3f29ad[_0x67f3('0x48')]['id']}})[_0x67f3('0x27')](handleEntityNotFound(_0x3cfec0,null))[_0x67f3('0x27')](saveUpdates(_0x3f29ad[_0x67f3('0x4b')],null))[_0x67f3('0x27')](respondWithResult(_0x3cfec0,null))[_0x67f3('0x46')](handleError(_0x3cfec0,null));};exports[_0x67f3('0x4d')]=function(_0x3f92d5,_0x45f2dc){return db['SmsTransferReport'][_0x67f3('0x4c')]({'where':{'id':_0x3f92d5[_0x67f3('0x48')]['id']}})[_0x67f3('0x27')](handleEntityNotFound(_0x45f2dc,null))['then'](removeEntity(_0x45f2dc,null))[_0x67f3('0x46')](handleError(_0x45f2dc,null));};exports[_0x67f3('0x4e')]=function(_0x10603d,_0x91f5fd){return db[_0x67f3('0x2e')][_0x67f3('0x4e')]()[_0x67f3('0x27')](respondWithResult(_0x91f5fd,null))[_0x67f3('0x46')](handleError(_0x91f5fd,null));};
\ No newline at end of file
+var _0x0c20=['../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','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','SmsTransferReport','includeAll','include','findAll','rows','catch','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x10b6ae,_0x56a559){var _0x1321e9=function(_0x9b0eb2){while(--_0x9b0eb2){_0x10b6ae['push'](_0x10b6ae['shift']());}};_0x1321e9(++_0x56a559);}(_0x0c20,0x173));var _0x00c2=function(_0x1804d2,_0x5f596b){_0x1804d2=_0x1804d2-0x0;var _0xa96140=_0x0c20[_0x1804d2];return _0xa96140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x00c2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00c2('0x1'));var rp=require(_0x00c2('0x2'));var moment=require(_0x00c2('0x3'));var BPromise=require(_0x00c2('0x4'));var Mustache=require(_0x00c2('0x5'));var util=require(_0x00c2('0x6'));var path=require(_0x00c2('0x7'));var sox=require(_0x00c2('0x8'));var csv=require(_0x00c2('0x9'));var ejs=require(_0x00c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00c2('0xb'));var squel=require(_0x00c2('0xc'));var crypto=require(_0x00c2('0xd'));var jsforce=require(_0x00c2('0xe'));var deskjs=require(_0x00c2('0xf'));var toCsv=require(_0x00c2('0x9'));var querystring=require(_0x00c2('0x10'));var Papa=require(_0x00c2('0x11'));var Redis=require('ioredis');var authService=require(_0x00c2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x00c2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00c2('0x14'))(_0x00c2('0x15'));var utils=require(_0x00c2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x00c2('0x17'));var db=require(_0x00c2('0x18'))['db'];function respondWithStatusCode(_0x42d01b,_0x57468d){_0x57468d=_0x57468d||0xcc;return function(_0x3cb7fa){if(_0x3cb7fa){return _0x42d01b[_0x00c2('0x19')](_0x57468d);}return _0x42d01b[_0x00c2('0x1a')](_0x57468d)[_0x00c2('0x1b')]();};}function respondWithResult(_0x51cce9,_0x199bb3){_0x199bb3=_0x199bb3||0xc8;return function(_0x361710){if(_0x361710){return _0x51cce9[_0x00c2('0x1a')](_0x199bb3)['json'](_0x361710);}};}function respondWithFilteredResult(_0x37cfa1,_0x23965e){return function(_0x346013){if(_0x346013){var _0x82d40d=typeof _0x23965e['offset']===_0x00c2('0x1c')&&typeof _0x23965e[_0x00c2('0x1d')]===_0x00c2('0x1c');var _0x516b16=_0x346013[_0x00c2('0x1e')];var _0x4ef3af=_0x82d40d?0x0:_0x23965e[_0x00c2('0x1f')];var _0x165961=_0x82d40d?_0x346013[_0x00c2('0x1e')]:_0x23965e['offset']+_0x23965e[_0x00c2('0x1d')];var _0x1dcec6;if(_0x165961>=_0x516b16){_0x165961=_0x516b16;_0x1dcec6=0xc8;}else{_0x1dcec6=0xce;}_0x37cfa1[_0x00c2('0x1a')](_0x1dcec6);return _0x37cfa1['set'](_0x00c2('0x20'),_0x4ef3af+'-'+_0x165961+'/'+_0x516b16)[_0x00c2('0x21')](_0x346013);}return null;};}function patchUpdates(_0x53f84c){return function(_0xeb4ceb){try{jsonpatch[_0x00c2('0x22')](_0xeb4ceb,_0x53f84c,!![]);}catch(_0x26801a){return BPromise[_0x00c2('0x23')](_0x26801a);}return _0xeb4ceb[_0x00c2('0x24')]();};}function saveUpdates(_0x27c37a,_0x17b6a0){return function(_0x5489ca){if(_0x5489ca){return _0x5489ca[_0x00c2('0x25')](_0x27c37a)[_0x00c2('0x26')](function(_0x4ae99a){return _0x4ae99a;});}return null;};}function removeEntity(_0x2a3110,_0x2c5e9c){return function(_0x979a72){if(_0x979a72){return _0x979a72[_0x00c2('0x27')]()[_0x00c2('0x26')](function(){_0x2a3110['status'](0xcc)[_0x00c2('0x1b')]();});}};}function handleEntityNotFound(_0x4bac4a,_0x17cb3c){return function(_0x4dd990){if(!_0x4dd990){_0x4bac4a[_0x00c2('0x19')](0x194);}return _0x4dd990;};}function handleError(_0x5f9391,_0x544ba3){_0x544ba3=_0x544ba3||0x1f4;return function(_0x594684){logger[_0x00c2('0x28')](_0x594684[_0x00c2('0x29')]);if(_0x594684[_0x00c2('0x2a')]){delete _0x594684[_0x00c2('0x2a')];}_0x5f9391[_0x00c2('0x1a')](_0x544ba3)[_0x00c2('0x2b')](_0x594684);};}exports[_0x00c2('0x2c')]=function(_0x52d9c1,_0x339309){var _0x3e61fb={},_0x49ef7a={},_0x464e1c={'count':0x0,'rows':[]};var _0x3bb938=_['map'](db['SmsTransferReport'][_0x00c2('0x2d')],function(_0x6ce1ef){return{'name':_0x6ce1ef[_0x00c2('0x2e')],'type':_0x6ce1ef[_0x00c2('0x2f')][_0x00c2('0x30')]};});_0x49ef7a['model']=_[_0x00c2('0x31')](_0x3bb938,_0x00c2('0x2a'));_0x49ef7a[_0x00c2('0x32')]=_[_0x00c2('0x33')](_0x52d9c1[_0x00c2('0x32')]);_0x49ef7a[_0x00c2('0x34')]=_[_0x00c2('0x35')](_0x49ef7a[_0x00c2('0x36')],_0x49ef7a[_0x00c2('0x32')]);_0x3e61fb[_0x00c2('0x37')]=_[_0x00c2('0x35')](_0x49ef7a[_0x00c2('0x36')],qs[_0x00c2('0x38')](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x38')]));_0x3e61fb[_0x00c2('0x37')]=_0x3e61fb[_0x00c2('0x37')][_0x00c2('0x39')]?_0x3e61fb[_0x00c2('0x37')]:_0x49ef7a[_0x00c2('0x36')];if(!_0x52d9c1['query'][_0x00c2('0x3a')](_0x00c2('0x3b'))){_0x3e61fb[_0x00c2('0x1d')]=qs[_0x00c2('0x1d')](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x1d')]);_0x3e61fb[_0x00c2('0x1f')]=qs[_0x00c2('0x1f')](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x1f')]);}_0x3e61fb[_0x00c2('0x3c')]=qs['sort'](_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x3d')]);_0x3e61fb[_0x00c2('0x3e')]=qs[_0x00c2('0x34')](_[_0x00c2('0x3f')](_0x52d9c1[_0x00c2('0x32')],_0x49ef7a[_0x00c2('0x34')]),_0x3bb938);if(_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x40')]){_0x3e61fb[_0x00c2('0x3e')]=_['merge'](_0x3e61fb[_0x00c2('0x3e')],{'$or':_['map'](_0x3bb938,function(_0x1e09a0){if(_0x1e09a0[_0x00c2('0x2f')]!==_0x00c2('0x41')){var _0x584e00={};_0x584e00[_0x1e09a0[_0x00c2('0x2a')]]={'$like':'%'+_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x40')]+'%'};return _0x584e00;}})});}_0x3e61fb=_[_0x00c2('0x42')]({},_0x3e61fb,_0x52d9c1[_0x00c2('0x43')]);var _0x10e366={'where':_0x3e61fb[_0x00c2('0x3e')]};return db[_0x00c2('0x44')][_0x00c2('0x1e')](_0x10e366)[_0x00c2('0x26')](function(_0x418833){_0x464e1c[_0x00c2('0x1e')]=_0x418833;if(_0x52d9c1[_0x00c2('0x32')][_0x00c2('0x45')]){_0x3e61fb[_0x00c2('0x46')]=[{'all':!![]}];}return db[_0x00c2('0x44')][_0x00c2('0x47')](_0x3e61fb);})[_0x00c2('0x26')](function(_0x14f776){_0x464e1c[_0x00c2('0x48')]=_0x14f776;return _0x464e1c;})['then'](respondWithFilteredResult(_0x339309,_0x3e61fb))[_0x00c2('0x49')](handleError(_0x339309,null));};exports['show']=function(_0x1e0e7b,_0x49233a){var _0x2666e9={'raw':!![],'where':{'id':_0x1e0e7b['params']['id']}},_0x29de0b={};_0x29de0b['model']=_['keys'](db['SmsTransferReport'][_0x00c2('0x2d')]);_0x29de0b[_0x00c2('0x32')]=_[_0x00c2('0x33')](_0x1e0e7b[_0x00c2('0x32')]);_0x29de0b['filters']=_[_0x00c2('0x35')](_0x29de0b[_0x00c2('0x36')],_0x29de0b['query']);_0x2666e9['attributes']=_['intersection'](_0x29de0b['model'],qs[_0x00c2('0x38')](_0x1e0e7b[_0x00c2('0x32')][_0x00c2('0x38')]));_0x2666e9[_0x00c2('0x37')]=_0x2666e9[_0x00c2('0x37')][_0x00c2('0x39')]?_0x2666e9['attributes']:_0x29de0b[_0x00c2('0x36')];if(_0x1e0e7b[_0x00c2('0x32')][_0x00c2('0x45')]){_0x2666e9[_0x00c2('0x46')]=[{'all':!![]}];}_0x2666e9=_[_0x00c2('0x42')]({},_0x2666e9,_0x1e0e7b[_0x00c2('0x43')]);return db[_0x00c2('0x44')][_0x00c2('0x4a')](_0x2666e9)[_0x00c2('0x26')](handleEntityNotFound(_0x49233a,null))[_0x00c2('0x26')](respondWithResult(_0x49233a,null))[_0x00c2('0x49')](handleError(_0x49233a,null));};exports[_0x00c2('0x4b')]=function(_0xa60ff5,_0xbd0d3f){return db[_0x00c2('0x44')][_0x00c2('0x4b')](_0xa60ff5['body'],{})[_0x00c2('0x26')](respondWithResult(_0xbd0d3f,0xc9))['catch'](handleError(_0xbd0d3f,null));};exports['update']=function(_0x36fea6,_0x4e6216){if(_0x36fea6[_0x00c2('0x4c')]['id']){delete _0x36fea6['body']['id'];}return db[_0x00c2('0x44')][_0x00c2('0x4a')]({'where':{'id':_0x36fea6['params']['id']}})[_0x00c2('0x26')](handleEntityNotFound(_0x4e6216,null))[_0x00c2('0x26')](saveUpdates(_0x36fea6[_0x00c2('0x4c')],null))[_0x00c2('0x26')](respondWithResult(_0x4e6216,null))[_0x00c2('0x49')](handleError(_0x4e6216,null));};exports[_0x00c2('0x27')]=function(_0x5d38cb,_0x2cc393){return db[_0x00c2('0x44')]['find']({'where':{'id':_0x5d38cb[_0x00c2('0x4d')]['id']}})[_0x00c2('0x26')](handleEntityNotFound(_0x2cc393,null))[_0x00c2('0x26')](removeEntity(_0x2cc393,null))['catch'](handleError(_0x2cc393,null));};exports['describe']=function(_0xaf9708,_0x37cd06){return db[_0x00c2('0x44')][_0x00c2('0x4e')]()['then'](respondWithResult(_0x37cd06,null))[_0x00c2('0x49')](handleError(_0x37cd06,null));};
\ No newline at end of file
index 6f0cdff..d4c9665 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f4b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x9f4b,0xfc));var _0xb9f4=function(_0x2a06bf,_0x3a97f2){_0x2a06bf=_0x2a06bf-0x0;var _0x2e218f=_0x9f4b[_0x2a06bf];return _0x2e218f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9f4('0x0'))(_0xb9f4('0x1'));var moment=require(_0xb9f4('0x2'));var BPromise=require(_0xb9f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9f4('0x4'));var rimraf=require(_0xb9f4('0x5'));var config=require(_0xb9f4('0x6'));var attributes=require(_0xb9f4('0x7'));module['exports']=function(_0x4ea31c,_0x1a74e5){return _0x4ea31c[_0xb9f4('0x8')](_0xb9f4('0x9'),attributes,{'tableName':_0xb9f4('0xa'),'paranoid':![],'indexes':[{'name':_0xb9f4('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf03=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer'];(function(_0x58d9e8,_0x1994bf){var _0x5a0ed2=function(_0x11a58e){while(--_0x11a58e){_0x58d9e8['push'](_0x58d9e8['shift']());}};_0x5a0ed2(++_0x1994bf);}(_0xbf03,0x1e1));var _0x3bf0=function(_0x5ad50a,_0x5cef5c){_0x5ad50a=_0x5ad50a-0x0;var _0x236cd6=_0xbf03[_0x5ad50a];return _0x236cd6;};'use strict';var _=require(_0x3bf0('0x0'));var util=require('util');var logger=require(_0x3bf0('0x1'))(_0x3bf0('0x2'));var moment=require(_0x3bf0('0x3'));var BPromise=require(_0x3bf0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bf0('0x5'));var rimraf=require(_0x3bf0('0x6'));var config=require('../../config/environment');var attributes=require(_0x3bf0('0x7'));module['exports']=function(_0x375bdd,_0x1ae97d){return _0x375bdd[_0x3bf0('0x8')](_0x3bf0('0x9'),attributes,{'tableName':_0x3bf0('0xa'),'paranoid':![],'indexes':[{'name':_0x3bf0('0xb'),'fields':[_0x3bf0('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 493c1eb..b33d419 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a7=['http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x98a7,0x9e));var _0x798a=function(_0x330c57,_0x4a0415){_0x330c57=_0x330c57-0x0;var _0x5ebfa8=_0x98a7[_0x330c57];return _0x5ebfa8;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var moment=require(_0x798a('0x2'));var BPromise=require(_0x798a('0x3'));var rs=require(_0x798a('0x4'));var fs=require('fs');var Redis=require(_0x798a('0x5'));var db=require(_0x798a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x798a('0x7'))(_0x798a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x798a('0x9')][_0x798a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9645e3,_0x3f17e2,_0x2a5393){return new BPromise(function(_0x8e1e29,_0x3be3d4){return client[_0x798a('0xb')](_0x9645e3,_0x2a5393)['then'](function(_0x1d2225){logger[_0x798a('0xc')](_0x798a('0xd'),_0x3f17e2,_0x798a('0xe'));logger['debug'](_0x798a('0xf'),_0x3f17e2,_0x798a('0xe'),JSON[_0x798a('0x10')](_0x1d2225));if(_0x1d2225[_0x798a('0x11')]){if(_0x1d2225[_0x798a('0x11')][_0x798a('0x12')]===0x1f4){logger['error'](_0x798a('0xd'),_0x3f17e2,_0x1d2225[_0x798a('0x11')][_0x798a('0x13')]);return _0x3be3d4(_0x1d2225[_0x798a('0x11')]['message']);}logger[_0x798a('0x11')](_0x798a('0xd'),_0x3f17e2,_0x1d2225['error'][_0x798a('0x13')]);return _0x8e1e29(_0x1d2225['error'][_0x798a('0x13')]);}else{logger[_0x798a('0xc')](_0x798a('0xd'),_0x3f17e2,_0x798a('0xe'));_0x8e1e29(_0x1d2225['result'][_0x798a('0x13')]);}})[_0x798a('0x14')](function(_0x536617){logger[_0x798a('0x11')](_0x798a('0xd'),_0x3f17e2,_0x536617);_0x3be3d4(_0x536617);});});}
\ No newline at end of file
+var _0x455d=['request\x20sent','debug','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x50809a,_0x13735f){var _0x2a3e33=function(_0x4b8d23){while(--_0x4b8d23){_0x50809a['push'](_0x50809a['shift']());}};_0x2a3e33(++_0x13735f);}(_0x455d,0x190));var _0xd455=function(_0x5621ab,_0x20c9e0){_0x5621ab=_0x5621ab-0x0;var _0x57dd45=_0x455d[_0x5621ab];return _0x57dd45;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd455('0x0'));var BPromise=require(_0xd455('0x1'));var rs=require(_0xd455('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd455('0x3'))['db'];var utils=require(_0xd455('0x4'));var logger=require(_0xd455('0x5'))(_0xd455('0x6'));var config=require(_0xd455('0x7'));var jayson=require(_0xd455('0x8'));var client=jayson[_0xd455('0x9')][_0xd455('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b373c,_0x5a5ed7,_0x2bbebf){return new BPromise(function(_0x2e530a,_0x4ef696){return client[_0xd455('0xb')](_0x3b373c,_0x2bbebf)[_0xd455('0xc')](function(_0xed6c5f){logger[_0xd455('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x5a5ed7,_0xd455('0xe'));logger[_0xd455('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5a5ed7,_0xd455('0xe'),JSON[_0xd455('0x10')](_0xed6c5f));if(_0xed6c5f[_0xd455('0x11')]){if(_0xed6c5f[_0xd455('0x11')][_0xd455('0x12')]===0x1f4){logger[_0xd455('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x5a5ed7,_0xed6c5f['error'][_0xd455('0x13')]);return _0x4ef696(_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);}logger['error'](_0xd455('0x14'),_0x5a5ed7,_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);return _0x2e530a(_0xed6c5f[_0xd455('0x11')][_0xd455('0x13')]);}else{logger[_0xd455('0xd')](_0xd455('0x14'),_0x5a5ed7,_0xd455('0xe'));_0x2e530a(_0xed6c5f[_0xd455('0x15')]['message']);}})[_0xd455('0x16')](function(_0x35a9fc){logger[_0xd455('0x11')](_0xd455('0x14'),_0x5a5ed7,_0x35a9fc);_0x4ef696(_0x35a9fc);});});}
\ No newline at end of file
index ae824ab..1c2f4a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x252a=['create','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','now','post','file'];(function(_0x1084b6,_0x28b2ae){var _0x1230ae=function(_0x2826d9){while(--_0x2826d9){_0x1084b6['push'](_0x1084b6['shift']());}};_0x1230ae(++_0x28b2ae);}(_0x252a,0xcf));var _0xa252=function(_0x154e9e,_0x6debaf){_0x154e9e=_0x154e9e-0x0;var _0x1f5357=_0x252a[_0x154e9e];return _0x1f5357;};'use strict';var multer=require(_0xa252('0x0'));var util=require(_0xa252('0x1'));var path=require(_0xa252('0x2'));var timeout=require(_0xa252('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa252('0x4'));var auth=require(_0xa252('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa252('0x6'));var controller=require(_0xa252('0x7'));router[_0xa252('0x8')]('/',auth[_0xa252('0x9')](),controller[_0xa252('0xa')]);router[_0xa252('0x8')](_0xa252('0xb'),auth[_0xa252('0x9')](),controller['show']);router[_0xa252('0x8')](_0xa252('0xc'),auth[_0xa252('0x9')](),controller[_0xa252('0xd')]);var upload=multer({'storage':multer[_0xa252('0xe')]({'destination':function(_0x4d511f,_0x1b3d9b,_0x13e631){_0x13e631(null,path[_0xa252('0xf')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x7f47f5,_0x471eaa,_0x218e34){_0x471eaa['originalname']=_0x471eaa[_0xa252('0x10')][_0xa252('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x218e34(null,util[_0xa252('0x12')](_0xa252('0x13'),path[_0xa252('0x14')](_0x471eaa[_0xa252('0x10')],path[_0xa252('0x15')](_0x471eaa[_0xa252('0x10')])),Date[_0xa252('0x16')](),path['extname'](_0x471eaa[_0xa252('0x10')])));}})});router[_0xa252('0x17')]('/',upload['single'](_0xa252('0x18')),controller[_0xa252('0x19')]);router['put'](_0xa252('0xb'),auth['isAuthenticated'](),controller[_0xa252('0x1a')]);router[_0xa252('0x1b')]('/:id',auth[_0xa252('0x9')](),controller[_0xa252('0x1b')]);module[_0xa252('0x1c')]=router;
\ No newline at end of file
+var _0x6c64=['/:id','show','get','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','single','file','create','put','update','delete','multer','util','connect-timeout','../../config/environment','./sound.controller','isAuthenticated','index'];(function(_0x31229e,_0x1138dd){var _0x56f14f=function(_0x401bfb){while(--_0x401bfb){_0x31229e['push'](_0x31229e['shift']());}};_0x56f14f(++_0x1138dd);}(_0x6c64,0x8f));var _0x46c6=function(_0x21cdde,_0x371b44){_0x21cdde=_0x21cdde-0x0;var _0x21302b=_0x6c64[_0x21cdde];return _0x21302b;};'use strict';var multer=require(_0x46c6('0x0'));var util=require(_0x46c6('0x1'));var path=require('path');var timeout=require(_0x46c6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46c6('0x3'));var controller=require(_0x46c6('0x4'));router['get']('/',auth[_0x46c6('0x5')](),controller[_0x46c6('0x6')]);router['get'](_0x46c6('0x7'),auth[_0x46c6('0x5')](),controller[_0x46c6('0x8')]);router[_0x46c6('0x9')]('/:id/download',auth[_0x46c6('0x5')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x44c74e,_0x2d4ce6,_0x60e1c8){_0x60e1c8(null,path[_0x46c6('0xa')](config[_0x46c6('0xb')],_0x46c6('0xc')));},'filename':function(_0x3b72f7,_0x56f4aa,_0xccf8ad){_0x56f4aa[_0x46c6('0xd')]=_0x56f4aa[_0x46c6('0xd')][_0x46c6('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xccf8ad(null,util['format'](_0x46c6('0xf'),path[_0x46c6('0x10')](_0x56f4aa[_0x46c6('0xd')],path[_0x46c6('0x11')](_0x56f4aa['originalname'])),Date[_0x46c6('0x12')](),path['extname'](_0x56f4aa[_0x46c6('0xd')])));}})});router['post']('/',upload[_0x46c6('0x13')](_0x46c6('0x14')),controller[_0x46c6('0x15')]);router[_0x46c6('0x16')](_0x46c6('0x7'),auth[_0x46c6('0x5')](),controller[_0x46c6('0x17')]);router[_0x46c6('0x18')](_0x46c6('0x7'),auth[_0x46c6('0x5')](),controller[_0x46c6('0x18')]);module['exports']=router;
\ No newline at end of file
index 7f4e15d..2c7bb47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbab=['BIGINT','sequelize','exports','STRING','name','FLOAT','INTEGER'];(function(_0x123c19,_0x1d8b65){var _0x27ad6f=function(_0x4bc20f){while(--_0x4bc20f){_0x123c19['push'](_0x123c19['shift']());}};_0x27ad6f(++_0x1d8b65);}(_0xfbab,0x86));var _0xbfba=function(_0x3c7259,_0x3717a4){_0x3c7259=_0x3c7259-0x0;var _0xfb2034=_0xfbab[_0x3c7259];return _0xfb2034;};'use strict';var Sequelize=require(_0xbfba('0x0'));module[_0xbfba('0x1')]={'name':{'type':Sequelize[_0xbfba('0x2')],'unique':_0xbfba('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xbfba('0x2')]},'display_name':{'type':Sequelize[_0xbfba('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xbfba('0x2')]},'original_duration':{'type':Sequelize[_0xbfba('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xbfba('0x5')]},'original_bitRate':{'type':Sequelize[_0xbfba('0x6')]},'original_sampleRate':{'type':Sequelize[_0xbfba('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xbfba('0x6')]},'converted_channelCount':{'type':Sequelize[_0xbfba('0x5')]},'converted_bitRate':{'type':Sequelize[_0xbfba('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9682=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x2557bc,_0x28a23b){var _0x404363=function(_0x41af20){while(--_0x41af20){_0x2557bc['push'](_0x2557bc['shift']());}};_0x404363(++_0x28a23b);}(_0x9682,0x13d));var _0x2968=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9682[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x2968('0x0'));module['exports']={'name':{'type':Sequelize[_0x2968('0x1')],'unique':_0x2968('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x2968('0x1')]},'original_format':{'type':Sequelize[_0x2968('0x1')]},'original_duration':{'type':Sequelize[_0x2968('0x3')]},'original_sampleCount':{'type':Sequelize[_0x2968('0x4')]},'original_channelCount':{'type':Sequelize[_0x2968('0x5')]},'original_bitRate':{'type':Sequelize[_0x2968('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x2968('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x2968('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 6465daf..00ee4ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1792=['includeAll','include','findAll','show','keys','find','params','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','basename','file','extname','originalname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','error','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','0777','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','UserProfileResource','create','catch','start','pick','description','original_format','server/files/sounds/converted','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','order','sort','where','filter','VIRTUAL','merge','options','Sound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1792,0xb5));var _0x2179=function(_0x3d3e50,_0x67882c){_0x3d3e50=_0x3d3e50-0x0;var _0x4273cb=_0x1792[_0x3d3e50];return _0x4273cb;};'use strict';var emlformat=require(_0x2179('0x0'));var rimraf=require(_0x2179('0x1'));var zipdir=require(_0x2179('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2179('0x3'));var moment=require(_0x2179('0x4'));var BPromise=require(_0x2179('0x5'));var Mustache=require(_0x2179('0x6'));var util=require(_0x2179('0x7'));var path=require(_0x2179('0x8'));var sox=require(_0x2179('0x9'));var csv=require(_0x2179('0xa'));var ejs=require(_0x2179('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2179('0xc'));var squel=require('squel');var crypto=require(_0x2179('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2179('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2179('0xf'));var Papa=require('papaparse');var Redis=require(_0x2179('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2179('0x11'));var as=require(_0x2179('0x12'));var hardwareService=require(_0x2179('0x13'));var logger=require(_0x2179('0x14'))('api');var utils=require(_0x2179('0x15'));var config=require(_0x2179('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2179('0x17'))['db'];function respondWithStatusCode(_0x367c0d,_0x2059dc){_0x2059dc=_0x2059dc||0xcc;return function(_0x14c5b4){if(_0x14c5b4){return _0x367c0d[_0x2179('0x18')](_0x2059dc);}return _0x367c0d[_0x2179('0x19')](_0x2059dc)[_0x2179('0x1a')]();};}function respondWithResult(_0x2a338f,_0x5b5b3a){_0x5b5b3a=_0x5b5b3a||0xc8;return function(_0x23118d){if(_0x23118d){return _0x2a338f[_0x2179('0x19')](_0x5b5b3a)[_0x2179('0x1b')](_0x23118d);}};}function respondWithFilteredResult(_0x13e459,_0x30afea){return function(_0x58b62d){if(_0x58b62d){var _0x2b0729=typeof _0x30afea['offset']==='undefined'&&typeof _0x30afea[_0x2179('0x1c')]==='undefined';var _0x599ecb=_0x58b62d[_0x2179('0x1d')];var _0x1806a9=_0x2b0729?0x0:_0x30afea[_0x2179('0x1e')];var _0xebc991=_0x2b0729?_0x58b62d[_0x2179('0x1d')]:_0x30afea[_0x2179('0x1e')]+_0x30afea['limit'];var _0x252da9;if(_0xebc991>=_0x599ecb){_0xebc991=_0x599ecb;_0x252da9=0xc8;}else{_0x252da9=0xce;}_0x13e459[_0x2179('0x19')](_0x252da9);return _0x13e459[_0x2179('0x1f')](_0x2179('0x20'),_0x1806a9+'-'+_0xebc991+'/'+_0x599ecb)['json'](_0x58b62d);}return null;};}function patchUpdates(_0x1465f4){return function(_0x2771f5){try{jsonpatch[_0x2179('0x21')](_0x2771f5,_0x1465f4,!![]);}catch(_0x89c03c){return BPromise[_0x2179('0x22')](_0x89c03c);}return _0x2771f5[_0x2179('0x23')]();};}function saveUpdates(_0x409bc6,_0x287db7){return function(_0x3f0a4d){if(_0x3f0a4d){return _0x3f0a4d[_0x2179('0x24')](_0x409bc6)[_0x2179('0x25')](function(_0x47666d){return _0x47666d;});}return null;};}function removeEntity(_0x59f9d4,_0x4557a9){return function(_0x465cff){if(_0x465cff){return _0x465cff[_0x2179('0x26')]()['then'](function(){var _0x4db5b5=_0x465cff[_0x2179('0x27')]({'plain':!![]});var _0x5b80f2=_0x2179('0x28');return db['UserProfileResource'][_0x2179('0x26')]({'where':{'type':_0x5b80f2,'resourceId':_0x4db5b5['id']}})[_0x2179('0x25')](function(){return _0x465cff;});})[_0x2179('0x25')](function(){_0x59f9d4[_0x2179('0x19')](0xcc)[_0x2179('0x1a')]();});}};}function handleEntityNotFound(_0x5254d7,_0x1f6eac){return function(_0x4f798f){if(!_0x4f798f){_0x5254d7[_0x2179('0x18')](0x194);}return _0x4f798f;};}function handleError(_0x1ecd13,_0x4809f5){_0x4809f5=_0x4809f5||0x1f4;return function(_0x5b5fde){logger['error'](_0x5b5fde['stack']);if(_0x5b5fde[_0x2179('0x29')]){delete _0x5b5fde[_0x2179('0x29')];}_0x1ecd13[_0x2179('0x19')](_0x4809f5)[_0x2179('0x2a')](_0x5b5fde);};}exports[_0x2179('0x2b')]=function(_0x538266,_0x483669){var _0x4f399d={},_0x1a6e1f={},_0x5e4766={'count':0x0,'rows':[]};var _0xbddbcd=_['map'](db['Sound'][_0x2179('0x2c')],function(_0x3f00d1){return{'name':_0x3f00d1['fieldName'],'type':_0x3f00d1[_0x2179('0x2d')][_0x2179('0x2e')]};});_0x1a6e1f[_0x2179('0x2f')]=_[_0x2179('0x30')](_0xbddbcd,_0x2179('0x29'));_0x1a6e1f[_0x2179('0x31')]=_['keys'](_0x538266[_0x2179('0x31')]);_0x1a6e1f[_0x2179('0x32')]=_[_0x2179('0x33')](_0x1a6e1f[_0x2179('0x2f')],_0x1a6e1f[_0x2179('0x31')]);_0x4f399d['attributes']=_[_0x2179('0x33')](_0x1a6e1f[_0x2179('0x2f')],qs['fields'](_0x538266[_0x2179('0x31')][_0x2179('0x34')]));_0x4f399d[_0x2179('0x35')]=_0x4f399d[_0x2179('0x35')][_0x2179('0x36')]?_0x4f399d[_0x2179('0x35')]:_0x1a6e1f['model'];if(!_0x538266[_0x2179('0x31')]['hasOwnProperty']('nolimit')){_0x4f399d['limit']=qs[_0x2179('0x1c')](_0x538266[_0x2179('0x31')][_0x2179('0x1c')]);_0x4f399d[_0x2179('0x1e')]=qs['offset'](_0x538266['query'][_0x2179('0x1e')]);}_0x4f399d[_0x2179('0x37')]=qs[_0x2179('0x38')](_0x538266['query']['sort']);_0x4f399d[_0x2179('0x39')]=qs[_0x2179('0x32')](_['pick'](_0x538266['query'],_0x1a6e1f[_0x2179('0x32')]),_0xbddbcd);if(_0x538266['query'][_0x2179('0x3a')]){_0x4f399d[_0x2179('0x39')]=_['merge'](_0x4f399d['where'],{'$or':_['map'](_0xbddbcd,function(_0x9a219d){if(_0x9a219d[_0x2179('0x2d')]!==_0x2179('0x3b')){var _0x5c3dc5={};_0x5c3dc5[_0x9a219d[_0x2179('0x29')]]={'$like':'%'+_0x538266[_0x2179('0x31')]['filter']+'%'};return _0x5c3dc5;}})});}_0x4f399d=_[_0x2179('0x3c')]({},_0x4f399d,_0x538266[_0x2179('0x3d')]);var _0x81773a={'where':_0x4f399d[_0x2179('0x39')]};return db[_0x2179('0x3e')]['count'](_0x81773a)['then'](function(_0x7e8170){_0x5e4766[_0x2179('0x1d')]=_0x7e8170;if(_0x538266[_0x2179('0x31')][_0x2179('0x3f')]){_0x4f399d[_0x2179('0x40')]=[{'all':!![]}];}return db[_0x2179('0x3e')][_0x2179('0x41')](_0x4f399d);})['then'](function(_0xb7fed4){_0x5e4766['rows']=_0xb7fed4;return _0x5e4766;})[_0x2179('0x25')](respondWithFilteredResult(_0x483669,_0x4f399d))['catch'](handleError(_0x483669,null));};exports[_0x2179('0x42')]=function(_0x4276ea,_0x42b220){var _0xb52eb0={'raw':!![],'where':{'id':_0x4276ea['params']['id']}},_0xdc320e={};_0xdc320e[_0x2179('0x2f')]=_['keys'](db[_0x2179('0x3e')][_0x2179('0x2c')]);_0xdc320e[_0x2179('0x31')]=_[_0x2179('0x43')](_0x4276ea['query']);_0xdc320e['filters']=_[_0x2179('0x33')](_0xdc320e['model'],_0xdc320e[_0x2179('0x31')]);_0xb52eb0['attributes']=_[_0x2179('0x33')](_0xdc320e[_0x2179('0x2f')],qs['fields'](_0x4276ea['query'][_0x2179('0x34')]));_0xb52eb0[_0x2179('0x35')]=_0xb52eb0['attributes'][_0x2179('0x36')]?_0xb52eb0[_0x2179('0x35')]:_0xdc320e[_0x2179('0x2f')];if(_0x4276ea['query'][_0x2179('0x3f')]){_0xb52eb0[_0x2179('0x40')]=[{'all':!![]}];}_0xb52eb0=_[_0x2179('0x3c')]({},_0xb52eb0,_0x4276ea[_0x2179('0x3d')]);return db[_0x2179('0x3e')][_0x2179('0x44')](_0xb52eb0)[_0x2179('0x25')](handleEntityNotFound(_0x42b220,null))[_0x2179('0x25')](respondWithResult(_0x42b220,null))['catch'](handleError(_0x42b220,null));};exports['download']=function(_0x4b1386,_0x14c9e2,_0x5f58b3){return db[_0x2179('0x3e')][_0x2179('0x44')]({'where':{'id':_0x4b1386[_0x2179('0x45')]['id']},'attributes':[_0x2179('0x29'),_0x2179('0x46'),_0x2179('0x47')],'raw':!![]})[_0x2179('0x25')](handleEntityNotFound(_0x14c9e2,null))['then'](function(_0x438795){if(_0x438795){if(!fs[_0x2179('0x48')](path[_0x2179('0x49')](config[_0x2179('0x4a')],'server/files/sounds/converted',_0x438795[_0x2179('0x46')]+'.'+_0x438795[_0x2179('0x47')]))){throw new db[(_0x2179('0x4b'))][(_0x2179('0x4c'))](_0x2179('0x4d'));}return _0x14c9e2[_0x2179('0x4e')](path['join'](config[_0x2179('0x4a')],'server/files/sounds/converted',util[_0x2179('0x4f')](_0x2179('0x50'),_0x438795[_0x2179('0x46')],_0x438795[_0x2179('0x47')])),util['format'](_0x2179('0x50'),_0x438795[_0x2179('0x29')],_0x438795['converted_format']));}return null;})['catch'](handleError(_0x14c9e2,null));};exports['create']=function(_0x1dde0b,_0x67bceb,_0x516e7f){var _0x3a6426={'name':path[_0x2179('0x51')](_0x1dde0b[_0x2179('0x52')]['originalname'],path[_0x2179('0x53')](_0x1dde0b[_0x2179('0x52')][_0x2179('0x54')])),'save_name':path['basename'](_0x1dde0b[_0x2179('0x52')][_0x2179('0x55')],path[_0x2179('0x53')](_0x1dde0b[_0x2179('0x52')]['filename'])),'original_format':path['extname'](_0x1dde0b[_0x2179('0x52')][_0x2179('0x54')])[_0x2179('0x56')](0x1),'converted_format':'wav'};var _0x24778c=path[_0x2179('0x49')](config[_0x2179('0x4a')],_0x2179('0x57'),_0x1dde0b[_0x2179('0x52')][_0x2179('0x55')]);var _0x5d29d7=path[_0x2179('0x49')](config['root'],'server/files/sounds/converted',util['format'](_0x2179('0x50'),path[_0x2179('0x51')](_0x1dde0b['file']['filename'],path['extname'](_0x1dde0b[_0x2179('0x52')][_0x2179('0x55')])),_0x3a6426['converted_format']));logger[_0x2179('0x58')](_0x2179('0x59'),_0x24778c);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x5d29d7);try{fs[_0x2179('0x5a')](_0x24778c,parseInt('0777',0x8));var _0x4e3513=sox[_0x2179('0x5b')](_0x24778c,_0x5d29d7,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4e3513['on'](_0x2179('0x5c'),function(_0x3cd99e){fs[_0x2179('0x5d')](_0x24778c);_0x67bceb[_0x2179('0x19')](0x1f4)[_0x2179('0x2a')](_0x3cd99e);});_0x4e3513['on'](_0x2179('0x5e'),function(_0x49b33f){_0x3a6426[_0x2179('0x5f')]=isNaN(_0x49b33f[_0x2179('0x60')])?null:_0x49b33f[_0x2179('0x60')]*0x3e8;_0x3a6426['original_sampleCount']=isNaN(_0x49b33f[_0x2179('0x61')])?null:_0x49b33f['sampleCount'];_0x3a6426[_0x2179('0x62')]=isNaN(_0x49b33f[_0x2179('0x63')])?null:_0x49b33f[_0x2179('0x63')];_0x3a6426[_0x2179('0x64')]=isNaN(_0x49b33f['bitRate'])?null:_0x49b33f[_0x2179('0x65')];_0x3a6426[_0x2179('0x66')]=isNaN(_0x49b33f[_0x2179('0x67')])?null:_0x49b33f[_0x2179('0x67')];});_0x4e3513['on'](_0x2179('0x68'),function(_0x35cf99){_0x3a6426[_0x2179('0x69')]=isNaN(_0x35cf99[_0x2179('0x60')])?null:_0x35cf99['duration']*0x3e8;_0x3a6426['converted_sampleCount']=isNaN(_0x35cf99[_0x2179('0x61')])?null:_0x35cf99[_0x2179('0x61')];_0x3a6426[_0x2179('0x6a')]=isNaN(_0x35cf99[_0x2179('0x63')])?null:_0x35cf99[_0x2179('0x63')];_0x3a6426['converted_bitRate']=isNaN(_0x35cf99['bitRate'])?null:_0x35cf99[_0x2179('0x65')];_0x3a6426['converted_sampleRate']=isNaN(_0x35cf99['sampleRate'])?null:_0x35cf99[_0x2179('0x67')];});_0x4e3513['on'](_0x2179('0x1a'),function(){fs['chmodSync'](_0x5d29d7,parseInt(_0x2179('0x6b'),0x8));return db['Sound']['create'](_0x3a6426)[_0x2179('0x25')](function(_0x58f458){var _0x4d92ef={'role':_0x1dde0b['body'][_0x2179('0x6c')],'userProfileId':_0x1dde0b[_0x2179('0x6d')][_0x2179('0x6e')]};if(!_0x4d92ef)throw new Error(_0x2179('0x6f'));if(_0x4d92ef[_0x2179('0x6c')]===_0x2179('0x70')){var _0x4ac26e=_0x58f458['get']({'plain':!![]});return db[_0x2179('0x71')]['find']({'where':{'name':'Sounds','userProfileId':_0x4d92ef[_0x2179('0x6e')]},'raw':!![]})['then'](function(_0x3d95fb){if(_0x3d95fb&&_0x3d95fb['autoAssociation']===0x0){return db[_0x2179('0x72')][_0x2179('0x73')]({'name':_0x4ac26e[_0x2179('0x29')],'resourceId':_0x4ac26e['id'],'type':_0x3d95fb[_0x2179('0x29')],'sectionId':_0x3d95fb['id']},{})[_0x2179('0x25')](function(){return _0x58f458;});}else{return _0x58f458;}})[_0x2179('0x74')](function(_0xcf5e55){logger[_0x2179('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcf5e55);throw _0xcf5e55;});}return _0x58f458;})[_0x2179('0x25')](respondWithResult(_0x67bceb,null))['catch'](handleError(_0x67bceb,null));});_0x4e3513[_0x2179('0x75')]();}catch(_0x47688d){_0x67bceb['status'](0x1f4)['send'](_0x47688d);}};exports[_0x2179('0x24')]=function(_0x38fdda,_0x45762f,_0x5b9bc4){return db[_0x2179('0x3e')]['find']({'where':{'id':_0x38fdda['params']['id']}})[_0x2179('0x25')](handleEntityNotFound(_0x45762f,null))[_0x2179('0x25')](saveUpdates(_[_0x2179('0x76')](_0x38fdda[_0x2179('0x6d')],['name',_0x2179('0x77')]),null))[_0x2179('0x25')](respondWithResult(_0x45762f,null))['catch'](handleError(_0x45762f,null));};exports['delete']=function(_0x354fca,_0x507938,_0x3bcd57){return db[_0x2179('0x3e')][_0x2179('0x44')]({'where':{'id':_0x354fca[_0x2179('0x45')]['id']}})['then'](function(_0x4bedbc){if(_0x4bedbc){return _0x4bedbc[_0x2179('0x26')]();}})[_0x2179('0x25')](function(_0x20bc34){var _0x517352=path[_0x2179('0x49')](config[_0x2179('0x4a')],_0x2179('0x57'),util[_0x2179('0x4f')](_0x2179('0x50'),_0x20bc34[_0x2179('0x46')],_0x20bc34[_0x2179('0x78')]));var _0x23e86a=path[_0x2179('0x49')](config[_0x2179('0x4a')],_0x2179('0x79'),util['format'](_0x2179('0x50'),_0x20bc34[_0x2179('0x46')],_0x20bc34[_0x2179('0x47')]));fs[_0x2179('0x5d')](_0x517352);fs[_0x2179('0x5d')](_0x23e86a);return _0x20bc34;})[_0x2179('0x25')](function(_0x2b58a3){if(_0x2b58a3){return _0x507938[_0x2179('0x19')](0xcc)['end']();}})[_0x2179('0x25')](handleEntityNotFound(_0x507938,null))[_0x2179('0x74')](handleError(_0x507938,null));};
\ No newline at end of file
+var _0xac7b=['query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','Sound','includeAll','include','findAll','rows','show','params','intersection','find','catch','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sound\x20not\x20found','download','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','error','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','user','UserProfileSection','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','original_format','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','map','rawAttributes','type','keys'];(function(_0x531947,_0x3bea44){var _0x4caf2f=function(_0x4cb996){while(--_0x4cb996){_0x531947['push'](_0x531947['shift']());}};_0x4caf2f(++_0x3bea44);}(_0xac7b,0x1cc));var _0xbac7=function(_0x2f5dd6,_0x1711ea){_0x2f5dd6=_0x2f5dd6-0x0;var _0x23d90c=_0xac7b[_0x2f5dd6];return _0x23d90c;};'use strict';var emlformat=require(_0xbac7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbac7('0x1'));var rp=require('request-promise');var moment=require(_0xbac7('0x2'));var BPromise=require(_0xbac7('0x3'));var Mustache=require(_0xbac7('0x4'));var util=require(_0xbac7('0x5'));var path=require(_0xbac7('0x6'));var sox=require(_0xbac7('0x7'));var csv=require(_0xbac7('0x8'));var ejs=require(_0xbac7('0x9'));var fs=require('fs');var fs_extra=require(_0xbac7('0xa'));var _=require(_0xbac7('0xb'));var squel=require(_0xbac7('0xc'));var crypto=require(_0xbac7('0xd'));var jsforce=require(_0xbac7('0xe'));var deskjs=require(_0xbac7('0xf'));var toCsv=require(_0xbac7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbac7('0x10'));var authService=require(_0xbac7('0x11'));var qs=require(_0xbac7('0x12'));var as=require(_0xbac7('0x13'));var hardwareService=require(_0xbac7('0x14'));var logger=require(_0xbac7('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbac7('0x16'));var licenseUtil=require(_0xbac7('0x17'));var db=require(_0xbac7('0x18'))['db'];function respondWithStatusCode(_0x5d7c93,_0x13b5df){_0x13b5df=_0x13b5df||0xcc;return function(_0x429c47){if(_0x429c47){return _0x5d7c93[_0xbac7('0x19')](_0x13b5df);}return _0x5d7c93['status'](_0x13b5df)[_0xbac7('0x1a')]();};}function respondWithResult(_0x71eac0,_0x5a7b0c){_0x5a7b0c=_0x5a7b0c||0xc8;return function(_0x5aff2e){if(_0x5aff2e){return _0x71eac0[_0xbac7('0x1b')](_0x5a7b0c)[_0xbac7('0x1c')](_0x5aff2e);}};}function respondWithFilteredResult(_0x157b65,_0x23bcac){return function(_0x2ad06c){if(_0x2ad06c){var _0x5dc10a=typeof _0x23bcac[_0xbac7('0x1d')]===_0xbac7('0x1e')&&typeof _0x23bcac['limit']===_0xbac7('0x1e');var _0x2b2bfb=_0x2ad06c[_0xbac7('0x1f')];var _0x6cb66=_0x5dc10a?0x0:_0x23bcac[_0xbac7('0x1d')];var _0x5d8fd8=_0x5dc10a?_0x2ad06c[_0xbac7('0x1f')]:_0x23bcac[_0xbac7('0x1d')]+_0x23bcac[_0xbac7('0x20')];var _0x23b8e5;if(_0x5d8fd8>=_0x2b2bfb){_0x5d8fd8=_0x2b2bfb;_0x23b8e5=0xc8;}else{_0x23b8e5=0xce;}_0x157b65['status'](_0x23b8e5);return _0x157b65[_0xbac7('0x21')](_0xbac7('0x22'),_0x6cb66+'-'+_0x5d8fd8+'/'+_0x2b2bfb)['json'](_0x2ad06c);}return null;};}function patchUpdates(_0x12af58){return function(_0x281895){try{jsonpatch[_0xbac7('0x23')](_0x281895,_0x12af58,!![]);}catch(_0x5b55cd){return BPromise[_0xbac7('0x24')](_0x5b55cd);}return _0x281895[_0xbac7('0x25')]();};}function saveUpdates(_0x3967c0,_0x555fdc){return function(_0x44fa93){if(_0x44fa93){return _0x44fa93['update'](_0x3967c0)[_0xbac7('0x26')](function(_0xb09d4c){return _0xb09d4c;});}return null;};}function removeEntity(_0x202524,_0x326528){return function(_0x513fb3){if(_0x513fb3){return _0x513fb3[_0xbac7('0x27')]()[_0xbac7('0x26')](function(){var _0x16d3c8=_0x513fb3[_0xbac7('0x28')]({'plain':!![]});var _0x5bd7b8='Sounds';return db[_0xbac7('0x29')]['destroy']({'where':{'type':_0x5bd7b8,'resourceId':_0x16d3c8['id']}})[_0xbac7('0x26')](function(){return _0x513fb3;});})[_0xbac7('0x26')](function(){_0x202524[_0xbac7('0x1b')](0xcc)[_0xbac7('0x1a')]();});}};}function handleEntityNotFound(_0x168e19,_0x41a666){return function(_0x4d2867){if(!_0x4d2867){_0x168e19[_0xbac7('0x19')](0x194);}return _0x4d2867;};}function handleError(_0xd7f519,_0x1a0db6){_0x1a0db6=_0x1a0db6||0x1f4;return function(_0x4a1d8a){logger['error'](_0x4a1d8a[_0xbac7('0x2a')]);if(_0x4a1d8a[_0xbac7('0x2b')]){delete _0x4a1d8a[_0xbac7('0x2b')];}_0xd7f519[_0xbac7('0x1b')](_0x1a0db6)['send'](_0x4a1d8a);};}exports['index']=function(_0x41a25d,_0x3928a1){var _0x48448f={},_0x33870a={},_0x170f04={'count':0x0,'rows':[]};var _0x1187f2=_[_0xbac7('0x2c')](db['Sound'][_0xbac7('0x2d')],function(_0x447b1a){return{'name':_0x447b1a['fieldName'],'type':_0x447b1a[_0xbac7('0x2e')]['key']};});_0x33870a['model']=_[_0xbac7('0x2c')](_0x1187f2,_0xbac7('0x2b'));_0x33870a['query']=_[_0xbac7('0x2f')](_0x41a25d[_0xbac7('0x30')]);_0x33870a[_0xbac7('0x31')]=_['intersection'](_0x33870a['model'],_0x33870a[_0xbac7('0x30')]);_0x48448f['attributes']=_['intersection'](_0x33870a[_0xbac7('0x32')],qs['fields'](_0x41a25d[_0xbac7('0x30')][_0xbac7('0x33')]));_0x48448f[_0xbac7('0x34')]=_0x48448f[_0xbac7('0x34')][_0xbac7('0x35')]?_0x48448f[_0xbac7('0x34')]:_0x33870a[_0xbac7('0x32')];if(!_0x41a25d['query'][_0xbac7('0x36')](_0xbac7('0x37'))){_0x48448f[_0xbac7('0x20')]=qs['limit'](_0x41a25d[_0xbac7('0x30')][_0xbac7('0x20')]);_0x48448f[_0xbac7('0x1d')]=qs['offset'](_0x41a25d[_0xbac7('0x30')]['offset']);}_0x48448f[_0xbac7('0x38')]=qs[_0xbac7('0x39')](_0x41a25d[_0xbac7('0x30')][_0xbac7('0x39')]);_0x48448f['where']=qs['filters'](_[_0xbac7('0x3a')](_0x41a25d['query'],_0x33870a['filters']),_0x1187f2);if(_0x41a25d['query']['filter']){_0x48448f[_0xbac7('0x3b')]=_[_0xbac7('0x3c')](_0x48448f['where'],{'$or':_[_0xbac7('0x2c')](_0x1187f2,function(_0x1de148){if(_0x1de148[_0xbac7('0x2e')]!==_0xbac7('0x3d')){var _0x1825b5={};_0x1825b5[_0x1de148[_0xbac7('0x2b')]]={'$like':'%'+_0x41a25d[_0xbac7('0x30')][_0xbac7('0x3e')]+'%'};return _0x1825b5;}})});}_0x48448f=_[_0xbac7('0x3c')]({},_0x48448f,_0x41a25d[_0xbac7('0x3f')]);var _0x155bc6={'where':_0x48448f[_0xbac7('0x3b')]};return db[_0xbac7('0x40')][_0xbac7('0x1f')](_0x155bc6)['then'](function(_0x2f0ad2){_0x170f04[_0xbac7('0x1f')]=_0x2f0ad2;if(_0x41a25d[_0xbac7('0x30')][_0xbac7('0x41')]){_0x48448f[_0xbac7('0x42')]=[{'all':!![]}];}return db[_0xbac7('0x40')][_0xbac7('0x43')](_0x48448f);})['then'](function(_0x74696b){_0x170f04[_0xbac7('0x44')]=_0x74696b;return _0x170f04;})[_0xbac7('0x26')](respondWithFilteredResult(_0x3928a1,_0x48448f))['catch'](handleError(_0x3928a1,null));};exports[_0xbac7('0x45')]=function(_0x275cfb,_0x28e660){var _0x3fbc92={'raw':!![],'where':{'id':_0x275cfb[_0xbac7('0x46')]['id']}},_0x117781={};_0x117781[_0xbac7('0x32')]=_['keys'](db[_0xbac7('0x40')][_0xbac7('0x2d')]);_0x117781[_0xbac7('0x30')]=_[_0xbac7('0x2f')](_0x275cfb[_0xbac7('0x30')]);_0x117781['filters']=_[_0xbac7('0x47')](_0x117781['model'],_0x117781['query']);_0x3fbc92[_0xbac7('0x34')]=_[_0xbac7('0x47')](_0x117781[_0xbac7('0x32')],qs['fields'](_0x275cfb[_0xbac7('0x30')][_0xbac7('0x33')]));_0x3fbc92['attributes']=_0x3fbc92[_0xbac7('0x34')][_0xbac7('0x35')]?_0x3fbc92[_0xbac7('0x34')]:_0x117781['model'];if(_0x275cfb[_0xbac7('0x30')][_0xbac7('0x41')]){_0x3fbc92[_0xbac7('0x42')]=[{'all':!![]}];}_0x3fbc92=_[_0xbac7('0x3c')]({},_0x3fbc92,_0x275cfb[_0xbac7('0x3f')]);return db['Sound'][_0xbac7('0x48')](_0x3fbc92)[_0xbac7('0x26')](handleEntityNotFound(_0x28e660,null))[_0xbac7('0x26')](respondWithResult(_0x28e660,null))[_0xbac7('0x49')](handleError(_0x28e660,null));};exports['download']=function(_0x1f4bca,_0x218243,_0x538e32){return db[_0xbac7('0x40')]['find']({'where':{'id':_0x1f4bca['params']['id']},'attributes':[_0xbac7('0x2b'),_0xbac7('0x4a'),_0xbac7('0x4b')],'raw':!![]})[_0xbac7('0x26')](handleEntityNotFound(_0x218243,null))[_0xbac7('0x26')](function(_0x329800){if(_0x329800){if(!fs[_0xbac7('0x4c')](path['join'](config[_0xbac7('0x4d')],_0xbac7('0x4e'),_0x329800[_0xbac7('0x4a')]+'.'+_0x329800[_0xbac7('0x4b')]))){throw new db['Sequelize']['ValidationError'](_0xbac7('0x4f'));}return _0x218243[_0xbac7('0x50')](path[_0xbac7('0x51')](config['root'],'server/files/sounds/converted',util[_0xbac7('0x52')]('%s.%s',_0x329800[_0xbac7('0x4a')],_0x329800[_0xbac7('0x4b')])),util[_0xbac7('0x52')](_0xbac7('0x53'),_0x329800[_0xbac7('0x2b')],_0x329800[_0xbac7('0x4b')]));}return null;})[_0xbac7('0x49')](handleError(_0x218243,null));};exports[_0xbac7('0x54')]=function(_0x281bf6,_0x33bcfb,_0x49d122){var _0x87ce7e={'name':path[_0xbac7('0x55')](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x57')],path[_0xbac7('0x58')](_0x281bf6[_0xbac7('0x56')]['originalname'])),'save_name':path[_0xbac7('0x55')](_0x281bf6['file']['filename'],path[_0xbac7('0x58')](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')])),'original_format':path[_0xbac7('0x58')](_0x281bf6[_0xbac7('0x56')]['originalname'])[_0xbac7('0x5a')](0x1),'converted_format':_0xbac7('0x5b')};var _0x17f77c=path[_0xbac7('0x51')](config[_0xbac7('0x4d')],_0xbac7('0x5c'),_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')]);var _0x2ab044=path[_0xbac7('0x51')](config[_0xbac7('0x4d')],_0xbac7('0x4e'),util[_0xbac7('0x52')]('%s.%s',path[_0xbac7('0x55')](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')],path['extname'](_0x281bf6[_0xbac7('0x56')][_0xbac7('0x59')])),_0x87ce7e[_0xbac7('0x4b')]));logger[_0xbac7('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x17f77c);logger[_0xbac7('0x5d')](_0xbac7('0x5e'),_0x2ab044);try{fs[_0xbac7('0x5f')](_0x17f77c,parseInt(_0xbac7('0x60'),0x8));var _0xb81c7f=sox[_0xbac7('0x61')](_0x17f77c,_0x2ab044,{'sampleRate':0x1f40,'format':_0xbac7('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb81c7f['on'](_0xbac7('0x62'),function(_0x4a4d9e){fs[_0xbac7('0x63')](_0x17f77c);_0x33bcfb[_0xbac7('0x1b')](0x1f4)[_0xbac7('0x64')](_0x4a4d9e);});_0xb81c7f['on'](_0xbac7('0x65'),function(_0x2ee7cc){_0x87ce7e[_0xbac7('0x66')]=isNaN(_0x2ee7cc['duration'])?null:_0x2ee7cc[_0xbac7('0x67')]*0x3e8;_0x87ce7e['original_sampleCount']=isNaN(_0x2ee7cc[_0xbac7('0x68')])?null:_0x2ee7cc[_0xbac7('0x68')];_0x87ce7e[_0xbac7('0x69')]=isNaN(_0x2ee7cc[_0xbac7('0x6a')])?null:_0x2ee7cc['channelCount'];_0x87ce7e[_0xbac7('0x6b')]=isNaN(_0x2ee7cc[_0xbac7('0x6c')])?null:_0x2ee7cc['bitRate'];_0x87ce7e['original_sampleRate']=isNaN(_0x2ee7cc[_0xbac7('0x6d')])?null:_0x2ee7cc[_0xbac7('0x6d')];});_0xb81c7f['on']('dest',function(_0x596777){_0x87ce7e[_0xbac7('0x6e')]=isNaN(_0x596777['duration'])?null:_0x596777[_0xbac7('0x67')]*0x3e8;_0x87ce7e[_0xbac7('0x6f')]=isNaN(_0x596777[_0xbac7('0x68')])?null:_0x596777['sampleCount'];_0x87ce7e[_0xbac7('0x70')]=isNaN(_0x596777['channelCount'])?null:_0x596777[_0xbac7('0x6a')];_0x87ce7e[_0xbac7('0x71')]=isNaN(_0x596777['bitRate'])?null:_0x596777[_0xbac7('0x6c')];_0x87ce7e[_0xbac7('0x72')]=isNaN(_0x596777[_0xbac7('0x6d')])?null:_0x596777[_0xbac7('0x6d')];});_0xb81c7f['on']('end',function(){fs[_0xbac7('0x5f')](_0x2ab044,parseInt(_0xbac7('0x60'),0x8));return db[_0xbac7('0x40')][_0xbac7('0x54')](_0x87ce7e)['then'](function(_0x36f6c6){var _0x5aa9c5={'role':_0x281bf6[_0xbac7('0x73')][_0xbac7('0x74')],'userProfileId':_0x281bf6['body'][_0xbac7('0x75')]};if(!_0x5aa9c5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aa9c5['role']===_0xbac7('0x76')){var _0x3c6085=_0x36f6c6[_0xbac7('0x28')]({'plain':!![]});return db[_0xbac7('0x77')][_0xbac7('0x48')]({'where':{'name':_0xbac7('0x78'),'userProfileId':_0x5aa9c5['userProfileId']},'raw':!![]})[_0xbac7('0x26')](function(_0x3f3bd8){if(_0x3f3bd8&&_0x3f3bd8['autoAssociation']===0x0){return db[_0xbac7('0x29')][_0xbac7('0x54')]({'name':_0x3c6085[_0xbac7('0x2b')],'resourceId':_0x3c6085['id'],'type':_0x3f3bd8['name'],'sectionId':_0x3f3bd8['id']},{})[_0xbac7('0x26')](function(){return _0x36f6c6;});}else{return _0x36f6c6;}})[_0xbac7('0x49')](function(_0x5c75ef){logger['error'](_0xbac7('0x79'),_0x5c75ef);throw _0x5c75ef;});}return _0x36f6c6;})[_0xbac7('0x26')](respondWithResult(_0x33bcfb,null))[_0xbac7('0x49')](handleError(_0x33bcfb,null));});_0xb81c7f[_0xbac7('0x7a')]();}catch(_0x25f739){_0x33bcfb[_0xbac7('0x1b')](0x1f4)[_0xbac7('0x64')](_0x25f739);}};exports[_0xbac7('0x7b')]=function(_0x512779,_0x226f57,_0x3f5bcb){return db['Sound'][_0xbac7('0x48')]({'where':{'id':_0x512779[_0xbac7('0x46')]['id']}})[_0xbac7('0x26')](handleEntityNotFound(_0x226f57,null))[_0xbac7('0x26')](saveUpdates(_[_0xbac7('0x3a')](_0x512779[_0xbac7('0x73')],['name',_0xbac7('0x7c')]),null))['then'](respondWithResult(_0x226f57,null))[_0xbac7('0x49')](handleError(_0x226f57,null));};exports[_0xbac7('0x7d')]=function(_0x57ebff,_0xaa5cb6,_0x221b10){return db['Sound'][_0xbac7('0x48')]({'where':{'id':_0x57ebff[_0xbac7('0x46')]['id']}})['then'](function(_0x3a0cba){if(_0x3a0cba){return _0x3a0cba[_0xbac7('0x27')]();}})[_0xbac7('0x26')](function(_0x53ea43){var _0x3c954f=path[_0xbac7('0x51')](config['root'],'server/files/sounds/original',util[_0xbac7('0x52')](_0xbac7('0x53'),_0x53ea43[_0xbac7('0x4a')],_0x53ea43[_0xbac7('0x7e')]));var _0x3ae5b8=path[_0xbac7('0x51')](config['root'],'server/files/sounds/converted',util['format'](_0xbac7('0x53'),_0x53ea43[_0xbac7('0x4a')],_0x53ea43[_0xbac7('0x4b')]));fs['unlinkSync'](_0x3c954f);fs['unlinkSync'](_0x3ae5b8);return _0x53ea43;})[_0xbac7('0x26')](function(_0x84fbab){if(_0x84fbab){return _0xaa5cb6['status'](0xcc)[_0xbac7('0x1a')]();}})[_0xbac7('0x26')](handleEntityNotFound(_0xaa5cb6,null))['catch'](handleError(_0xaa5cb6,null));};
\ No newline at end of file
index 7c7d60d..db50efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc884=['util','../../config/logger','moment','bluebird','path','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0xaf784b,_0x202f9c){var _0x2ab854=function(_0x3ae209){while(--_0x3ae209){_0xaf784b['push'](_0xaf784b['shift']());}};_0x2ab854(++_0x202f9c);}(_0xc884,0xa7));var _0x4c88=function(_0x56167e,_0x588214){_0x56167e=_0x56167e-0x0;var _0x4080ac=_0xc884[_0x56167e];return _0x4080ac;};'use strict';var _=require(_0x4c88('0x0'));var util=require(_0x4c88('0x1'));var logger=require(_0x4c88('0x2'))('api');var moment=require(_0x4c88('0x3'));var BPromise=require(_0x4c88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c88('0x5'));var rimraf=require('rimraf');var config=require(_0x4c88('0x6'));var attributes=require(_0x4c88('0x7'));module[_0x4c88('0x8')]=function(_0x147a69,_0x347000){return _0x147a69[_0x4c88('0x9')](_0x4c88('0xa'),attributes,{'tableName':_0x4c88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b9b=['exports','Sound','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x35f2d6,_0x1eacc1){var _0x33a492=function(_0x3dccc5){while(--_0x3dccc5){_0x35f2d6['push'](_0x35f2d6['shift']());}};_0x33a492(++_0x1eacc1);}(_0x1b9b,0x1ee));var _0xb1b9=function(_0x589fde,_0x392dd4){_0x589fde=_0x589fde-0x0;var _0x3ebe58=_0x1b9b[_0x589fde];return _0x3ebe58;};'use strict';var _=require(_0xb1b9('0x0'));var util=require('util');var logger=require(_0xb1b9('0x1'))(_0xb1b9('0x2'));var moment=require(_0xb1b9('0x3'));var BPromise=require(_0xb1b9('0x4'));var rp=require(_0xb1b9('0x5'));var fs=require('fs');var path=require(_0xb1b9('0x6'));var rimraf=require(_0xb1b9('0x7'));var config=require(_0xb1b9('0x8'));var attributes=require(_0xb1b9('0x9'));module[_0xb1b9('0xa')]=function(_0x4c724b,_0x3cffd4){return _0x4c724b['define'](_0xb1b9('0xb'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b6199fa..dba0b2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x771a=['lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSound','Sound','find','options','raw','attributes','model','include','map','stringify','catch'];(function(_0x5f46c2,_0x9bfb5){var _0x34f458=function(_0x7ce18c){while(--_0x7ce18c){_0x5f46c2['push'](_0x5f46c2['shift']());}};_0x34f458(++_0x9bfb5);}(_0x771a,0x155));var _0xa771=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x771a[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xa771('0x0'));var util=require(_0xa771('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa771('0x2'));var fs=require('fs');var Redis=require(_0xa771('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa771('0x4'));var logger=require('../../config/logger')(_0xa771('0x5'));var config=require(_0xa771('0x6'));var jayson=require(_0xa771('0x7'));var client=jayson[_0xa771('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a4cae,_0x1054e0,_0x14168b){return new BPromise(function(_0x3c0a90,_0x3d1f5d){return client[_0xa771('0x9')](_0x5a4cae,_0x14168b)[_0xa771('0xa')](function(_0x1e02c9){logger[_0xa771('0xb')](_0xa771('0xc'),_0x1054e0,_0xa771('0xd'));logger[_0xa771('0xe')](_0xa771('0xf'),_0x1054e0,_0xa771('0xd'),JSON['stringify'](_0x1e02c9));if(_0x1e02c9[_0xa771('0x10')]){if(_0x1e02c9[_0xa771('0x10')][_0xa771('0x11')]===0x1f4){logger[_0xa771('0x10')](_0xa771('0xc'),_0x1054e0,_0x1e02c9['error'][_0xa771('0x12')]);return _0x3d1f5d(_0x1e02c9['error']['message']);}logger[_0xa771('0x10')](_0xa771('0xc'),_0x1054e0,_0x1e02c9[_0xa771('0x10')][_0xa771('0x12')]);return _0x3c0a90(_0x1e02c9[_0xa771('0x10')]['message']);}else{logger['info'](_0xa771('0xc'),_0x1054e0,_0xa771('0xd'));_0x3c0a90(_0x1e02c9[_0xa771('0x13')][_0xa771('0x12')]);}})['catch'](function(_0x333bc4){logger[_0xa771('0x10')](_0xa771('0xc'),_0x1054e0,_0x333bc4);_0x3d1f5d(_0x333bc4);});});}exports[_0xa771('0x14')]=function(_0x5a5753){var _0x271d72=this;return new Promise(function(_0x5b3290,_0x4921f2){return db[_0xa771('0x15')][_0xa771('0x16')]({'raw':_0x5a5753['options']?_0x5a5753[_0xa771('0x17')][_0xa771('0x18')]===undefined?!![]:![]:!![],'where':_0x5a5753[_0xa771('0x17')]?_0x5a5753[_0xa771('0x17')]['where']||null:null,'attributes':_0x5a5753[_0xa771('0x17')]?_0x5a5753[_0xa771('0x17')][_0xa771('0x19')]||null:null,'include':_0x5a5753['options']?_0x5a5753['options']['include']?_['map'](_0x5a5753['options']['include'],function(_0x1b9c47){return{'model':db[_0x1b9c47[_0xa771('0x1a')]],'as':_0x1b9c47['as'],'attributes':_0x1b9c47[_0xa771('0x19')],'include':_0x1b9c47[_0xa771('0x1b')]?_[_0xa771('0x1c')](_0x1b9c47['include'],function(_0x3371c9){return{'model':db[_0x3371c9[_0xa771('0x1a')]],'as':_0x3371c9['as'],'attributes':_0x3371c9[_0xa771('0x19')],'include':_0x3371c9[_0xa771('0x1b')]?_[_0xa771('0x1c')](_0x3371c9[_0xa771('0x1b')],function(_0x492108){return{'model':db[_0x492108[_0xa771('0x1a')]],'as':_0x492108['as'],'attributes':_0x492108[_0xa771('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa771('0xa')](function(_0x290b31){logger['info'](_0xa771('0x14'),_0x5a5753);logger[_0xa771('0xe')](_0xa771('0x14'),_0x5a5753,JSON[_0xa771('0x1d')](_0x290b31));_0x5b3290(_0x290b31);})[_0xa771('0x1e')](function(_0x4ee9ac){logger[_0xa771('0x10')](_0xa771('0x14'),_0x4ee9ac[_0xa771('0x12')],_0x5a5753);_0x4921f2(_0x271d72[_0xa771('0x10')](0x1f4,_0x4ee9ac['message']));});});};
\ No newline at end of file
+var _0x3d17=['raw','where','attributes','include','map','model','then','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','Sound,\x20%s,\x20%s','error','message','result','ShowSound','Sound','options'];(function(_0x1d99c7,_0x3db474){var _0x3244d6=function(_0xc62ce7){while(--_0xc62ce7){_0x1d99c7['push'](_0x1d99c7['shift']());}};_0x3244d6(++_0x3db474);}(_0x3d17,0x100));var _0x73d1=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x3d17[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x73d1('0x0'));var util=require(_0x73d1('0x1'));var moment=require(_0x73d1('0x2'));var BPromise=require(_0x73d1('0x3'));var rs=require(_0x73d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73d1('0x5'))['db'];var utils=require(_0x73d1('0x6'));var logger=require(_0x73d1('0x7'))('rpc');var config=require(_0x73d1('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x73d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaf17fa,_0x40f4ba,_0x5129c7){return new BPromise(function(_0x2c8be9,_0x68fce0){return client[_0x73d1('0xa')](_0xaf17fa,_0x5129c7)['then'](function(_0x1a76cf){logger[_0x73d1('0xb')]('Sound,\x20%s,\x20%s',_0x40f4ba,_0x73d1('0xc'));logger[_0x73d1('0xd')](_0x73d1('0xe'),_0x40f4ba,_0x73d1('0xc'),JSON[_0x73d1('0xf')](_0x1a76cf));if(_0x1a76cf['error']){if(_0x1a76cf['error']['code']===0x1f4){logger['error'](_0x73d1('0x10'),_0x40f4ba,_0x1a76cf[_0x73d1('0x11')][_0x73d1('0x12')]);return _0x68fce0(_0x1a76cf['error']['message']);}logger['error'](_0x73d1('0x10'),_0x40f4ba,_0x1a76cf[_0x73d1('0x11')][_0x73d1('0x12')]);return _0x2c8be9(_0x1a76cf[_0x73d1('0x11')][_0x73d1('0x12')]);}else{logger['info'](_0x73d1('0x10'),_0x40f4ba,_0x73d1('0xc'));_0x2c8be9(_0x1a76cf[_0x73d1('0x13')][_0x73d1('0x12')]);}})['catch'](function(_0x184c6f){logger['error'](_0x73d1('0x10'),_0x40f4ba,_0x184c6f);_0x68fce0(_0x184c6f);});});}exports[_0x73d1('0x14')]=function(_0x28dc50){var _0x368a6b=this;return new Promise(function(_0x402b4e,_0x3bcd9a){return db[_0x73d1('0x15')]['find']({'raw':_0x28dc50[_0x73d1('0x16')]?_0x28dc50[_0x73d1('0x16')][_0x73d1('0x17')]===undefined?!![]:![]:!![],'where':_0x28dc50['options']?_0x28dc50['options'][_0x73d1('0x18')]||null:null,'attributes':_0x28dc50['options']?_0x28dc50['options'][_0x73d1('0x19')]||null:null,'include':_0x28dc50[_0x73d1('0x16')]?_0x28dc50[_0x73d1('0x16')][_0x73d1('0x1a')]?_[_0x73d1('0x1b')](_0x28dc50['options'][_0x73d1('0x1a')],function(_0x1dd27e){return{'model':db[_0x1dd27e[_0x73d1('0x1c')]],'as':_0x1dd27e['as'],'attributes':_0x1dd27e[_0x73d1('0x19')],'include':_0x1dd27e[_0x73d1('0x1a')]?_[_0x73d1('0x1b')](_0x1dd27e[_0x73d1('0x1a')],function(_0x87090f){return{'model':db[_0x87090f[_0x73d1('0x1c')]],'as':_0x87090f['as'],'attributes':_0x87090f[_0x73d1('0x19')],'include':_0x87090f[_0x73d1('0x1a')]?_['map'](_0x87090f[_0x73d1('0x1a')],function(_0x4e107e){return{'model':db[_0x4e107e['model']],'as':_0x4e107e['as'],'attributes':_0x4e107e[_0x73d1('0x19')]};}):[]};}):[]};}):[]:[]})[_0x73d1('0x1d')](function(_0x46bbfb){logger['info'](_0x73d1('0x14'),_0x28dc50);logger['debug'](_0x73d1('0x14'),_0x28dc50,JSON[_0x73d1('0xf')](_0x46bbfb));_0x402b4e(_0x46bbfb);})[_0x73d1('0x1e')](function(_0xd91b69){logger[_0x73d1('0x11')](_0x73d1('0x14'),_0xd91b69[_0x73d1('0x12')],_0x28dc50);_0x3bcd9a(_0x368a6b['error'](0x1f4,_0xd91b69[_0x73d1('0x12')]));});});};
\ No newline at end of file
index 9228e6a..85b0b5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0x5012e0,_0x47a186){var _0x72706d=function(_0x13d02e){while(--_0x13d02e){_0x5012e0['push'](_0x5012e0['shift']());}};_0x72706d(++_0x47a186);}(_0xda2d,0x102));var _0xdda2=function(_0x4393c8,_0x28abc8){_0x4393c8=_0x4393c8-0x0;var _0x34913a=_0xda2d[_0x4393c8];return _0x34913a;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
+var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xcb837a,_0x2fc04d){_0xcb837a=_0xcb837a-0x0;var _0xc30584=_0x9ffd[_0xcb837a];return _0xc30584;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router;
\ No newline at end of file
index 710f76b..0e645ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38c9=['TEXT','medium','ENUM','out','STRING'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x38c9,0x96));var _0x938c=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x38c9[_0x34325b];return _0x3da348;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x938c('0x0')](_0x938c('0x1')),'allowNull':![]},'direction':{'type':Sequelize[_0x938c('0x2')]('in',_0x938c('0x3')),'defaultValue':_0x938c('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x938c('0x4')]},'providerResponse':{'type':Sequelize[_0x938c('0x0')]}};
\ No newline at end of file
+var _0xf989=['ENUM','out','sequelize','exports','STRING','medium'];(function(_0x10a283,_0x4ba943){var _0x188d40=function(_0x3e6d30){while(--_0x3e6d30){_0x10a283['push'](_0x10a283['shift']());}};_0x188d40(++_0x4ba943);}(_0xf989,0x10a));var _0x9f98=function(_0x375126,_0x514a8e){_0x375126=_0x375126-0x0;var _0x1f76bb=_0xf989[_0x375126];return _0x1f76bb;};'use strict';var Sequelize=require(_0x9f98('0x0'));module[_0x9f98('0x1')]={'uniqueid':{'type':Sequelize[_0x9f98('0x2')]},'body':{'type':Sequelize['TEXT'](_0x9f98('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9f98('0x4')]('in',_0x9f98('0x5')),'defaultValue':_0x9f98('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9f98('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index db5cc64..2628f5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eae=['then','stack','index','SquareMessage','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','length','body','find','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x2071cc,_0x5d728e){var _0x31aa5d=function(_0x2febbd){while(--_0x2febbd){_0x2071cc['push'](_0x2071cc['shift']());}};_0x31aa5d(++_0x5d728e);}(_0x3eae,0x66));var _0xe3ea=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x3eae[_0x15ca1a];return _0x507626;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe3ea('0x0'));var jsonpatch=require(_0xe3ea('0x1'));var rp=require('request-promise');var moment=require(_0xe3ea('0x2'));var BPromise=require(_0xe3ea('0x3'));var Mustache=require(_0xe3ea('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe3ea('0x5'));var csv=require(_0xe3ea('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe3ea('0x7'));var _=require(_0xe3ea('0x8'));var squel=require('squel');var crypto=require(_0xe3ea('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xe3ea('0xa'));var toCsv=require(_0xe3ea('0x6'));var querystring=require(_0xe3ea('0xb'));var Papa=require('papaparse');var Redis=require(_0xe3ea('0xc'));var authService=require(_0xe3ea('0xd'));var qs=require(_0xe3ea('0xe'));var as=require(_0xe3ea('0xf'));var hardwareService=require(_0xe3ea('0x10'));var logger=require(_0xe3ea('0x11'))(_0xe3ea('0x12'));var utils=require(_0xe3ea('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe3ea('0x14'))['db'];function respondWithStatusCode(_0x6a9294,_0x36c2dd){_0x36c2dd=_0x36c2dd||0xcc;return function(_0x247139){if(_0x247139){return _0x6a9294[_0xe3ea('0x15')](_0x36c2dd);}return _0x6a9294[_0xe3ea('0x16')](_0x36c2dd)[_0xe3ea('0x17')]();};}function respondWithResult(_0x2b36ec,_0x31357a){_0x31357a=_0x31357a||0xc8;return function(_0x11f560){if(_0x11f560){return _0x2b36ec[_0xe3ea('0x16')](_0x31357a)[_0xe3ea('0x18')](_0x11f560);}};}function respondWithFilteredResult(_0x445775,_0x492c29){return function(_0x3c3700){if(_0x3c3700){var _0x2a086a=typeof _0x492c29[_0xe3ea('0x19')]===_0xe3ea('0x1a')&&typeof _0x492c29[_0xe3ea('0x1b')]===_0xe3ea('0x1a');var _0x466d2d=_0x3c3700[_0xe3ea('0x1c')];var _0x33f6f8=_0x2a086a?0x0:_0x492c29[_0xe3ea('0x19')];var _0x3575be=_0x2a086a?_0x3c3700[_0xe3ea('0x1c')]:_0x492c29[_0xe3ea('0x19')]+_0x492c29[_0xe3ea('0x1b')];var _0x2a397b;if(_0x3575be>=_0x466d2d){_0x3575be=_0x466d2d;_0x2a397b=0xc8;}else{_0x2a397b=0xce;}_0x445775[_0xe3ea('0x16')](_0x2a397b);return _0x445775[_0xe3ea('0x1d')](_0xe3ea('0x1e'),_0x33f6f8+'-'+_0x3575be+'/'+_0x466d2d)[_0xe3ea('0x18')](_0x3c3700);}return null;};}function patchUpdates(_0x29e32e){return function(_0xd61c1c){try{jsonpatch[_0xe3ea('0x1f')](_0xd61c1c,_0x29e32e,!![]);}catch(_0xca5a4f){return BPromise[_0xe3ea('0x20')](_0xca5a4f);}return _0xd61c1c[_0xe3ea('0x21')]();};}function saveUpdates(_0x4a537d,_0x5ed42a){return function(_0x4f0e9e){if(_0x4f0e9e){return _0x4f0e9e[_0xe3ea('0x22')](_0x4a537d)['then'](function(_0x5050eb){return _0x5050eb;});}return null;};}function removeEntity(_0x350d8e,_0x19dd53){return function(_0x4cda82){if(_0x4cda82){return _0x4cda82[_0xe3ea('0x23')]()[_0xe3ea('0x24')](function(){_0x350d8e['status'](0xcc)[_0xe3ea('0x17')]();});}};}function handleEntityNotFound(_0x4bb839,_0x4e9ed1){return function(_0x3255ad){if(!_0x3255ad){_0x4bb839[_0xe3ea('0x15')](0x194);}return _0x3255ad;};}function handleError(_0x577e56,_0x197466){_0x197466=_0x197466||0x1f4;return function(_0x3491d7){logger['error'](_0x3491d7[_0xe3ea('0x25')]);if(_0x3491d7['name']){delete _0x3491d7['name'];}_0x577e56['status'](_0x197466)['send'](_0x3491d7);};}exports[_0xe3ea('0x26')]=function(_0x3e7c9f,_0x42d889){var _0x26704f={},_0x5395fa={},_0x48a6a1={'count':0x0,'rows':[]};var _0x30f148=_['map'](db[_0xe3ea('0x27')][_0xe3ea('0x28')],function(_0x73a56e){return{'name':_0x73a56e['fieldName'],'type':_0x73a56e['type'][_0xe3ea('0x29')]};});_0x5395fa[_0xe3ea('0x2a')]=_['map'](_0x30f148,_0xe3ea('0x2b'));_0x5395fa[_0xe3ea('0x2c')]=_[_0xe3ea('0x2d')](_0x3e7c9f['query']);_0x5395fa[_0xe3ea('0x2e')]=_[_0xe3ea('0x2f')](_0x5395fa['model'],_0x5395fa[_0xe3ea('0x2c')]);_0x26704f[_0xe3ea('0x30')]=_[_0xe3ea('0x2f')](_0x5395fa[_0xe3ea('0x2a')],qs[_0xe3ea('0x31')](_0x3e7c9f[_0xe3ea('0x2c')][_0xe3ea('0x31')]));_0x26704f[_0xe3ea('0x30')]=_0x26704f[_0xe3ea('0x30')]['length']?_0x26704f['attributes']:_0x5395fa[_0xe3ea('0x2a')];if(!_0x3e7c9f[_0xe3ea('0x2c')][_0xe3ea('0x32')](_0xe3ea('0x33'))){_0x26704f[_0xe3ea('0x1b')]=qs[_0xe3ea('0x1b')](_0x3e7c9f['query']['limit']);_0x26704f[_0xe3ea('0x19')]=qs[_0xe3ea('0x19')](_0x3e7c9f[_0xe3ea('0x2c')][_0xe3ea('0x19')]);}_0x26704f[_0xe3ea('0x34')]=qs[_0xe3ea('0x35')](_0x3e7c9f[_0xe3ea('0x2c')][_0xe3ea('0x35')]);_0x26704f[_0xe3ea('0x36')]=qs[_0xe3ea('0x2e')](_['pick'](_0x3e7c9f[_0xe3ea('0x2c')],_0x5395fa[_0xe3ea('0x2e')]),_0x30f148);if(_0x3e7c9f[_0xe3ea('0x2c')]['filter']){_0x26704f['where']=_['merge'](_0x26704f[_0xe3ea('0x36')],{'$or':_[_0xe3ea('0x37')](_0x30f148,function(_0x5e2376){if(_0x5e2376[_0xe3ea('0x38')]!==_0xe3ea('0x39')){var _0x1823d5={};_0x1823d5[_0x5e2376['name']]={'$like':'%'+_0x3e7c9f[_0xe3ea('0x2c')][_0xe3ea('0x3a')]+'%'};return _0x1823d5;}})});}_0x26704f=_[_0xe3ea('0x3b')]({},_0x26704f,_0x3e7c9f[_0xe3ea('0x3c')]);var _0x55bf41={'where':_0x26704f[_0xe3ea('0x36')]};return db[_0xe3ea('0x27')][_0xe3ea('0x1c')](_0x55bf41)['then'](function(_0x349b19){_0x48a6a1[_0xe3ea('0x1c')]=_0x349b19;if(_0x3e7c9f[_0xe3ea('0x2c')][_0xe3ea('0x3d')]){_0x26704f[_0xe3ea('0x3e')]=[{'all':!![]}];}return db[_0xe3ea('0x27')]['findAll'](_0x26704f);})[_0xe3ea('0x24')](function(_0x50bc87){_0x48a6a1[_0xe3ea('0x3f')]=_0x50bc87;return _0x48a6a1;})[_0xe3ea('0x24')](respondWithFilteredResult(_0x42d889,_0x26704f))[_0xe3ea('0x40')](handleError(_0x42d889,null));};exports['show']=function(_0xaeb6d9,_0x4eba6c){var _0x14c1aa={'raw':!![],'where':{'id':_0xaeb6d9[_0xe3ea('0x41')]['id']}},_0x142057={};_0x142057['model']=_['keys'](db[_0xe3ea('0x27')]['rawAttributes']);_0x142057[_0xe3ea('0x2c')]=_['keys'](_0xaeb6d9[_0xe3ea('0x2c')]);_0x142057[_0xe3ea('0x2e')]=_[_0xe3ea('0x2f')](_0x142057[_0xe3ea('0x2a')],_0x142057[_0xe3ea('0x2c')]);_0x14c1aa[_0xe3ea('0x30')]=_['intersection'](_0x142057[_0xe3ea('0x2a')],qs[_0xe3ea('0x31')](_0xaeb6d9[_0xe3ea('0x2c')][_0xe3ea('0x31')]));_0x14c1aa[_0xe3ea('0x30')]=_0x14c1aa['attributes'][_0xe3ea('0x42')]?_0x14c1aa[_0xe3ea('0x30')]:_0x142057[_0xe3ea('0x2a')];if(_0xaeb6d9[_0xe3ea('0x2c')][_0xe3ea('0x3d')]){_0x14c1aa['include']=[{'all':!![]}];}_0x14c1aa=_[_0xe3ea('0x3b')]({},_0x14c1aa,_0xaeb6d9['options']);return db[_0xe3ea('0x27')]['find'](_0x14c1aa)[_0xe3ea('0x24')](handleEntityNotFound(_0x4eba6c,null))[_0xe3ea('0x24')](respondWithResult(_0x4eba6c,null))['catch'](handleError(_0x4eba6c,null));};exports['create']=function(_0x267065,_0x4ee682){return db['SquareMessage']['create'](_0x267065[_0xe3ea('0x43')],{})[_0xe3ea('0x24')](respondWithResult(_0x4ee682,0xc9))[_0xe3ea('0x40')](handleError(_0x4ee682,null));};exports['update']=function(_0x7b894,_0x134f3f){if(_0x7b894[_0xe3ea('0x43')]['id']){delete _0x7b894['body']['id'];}return db[_0xe3ea('0x27')]['find']({'where':{'id':_0x7b894[_0xe3ea('0x41')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x134f3f,null))[_0xe3ea('0x24')](saveUpdates(_0x7b894[_0xe3ea('0x43')],null))['then'](respondWithResult(_0x134f3f,null))[_0xe3ea('0x40')](handleError(_0x134f3f,null));};exports[_0xe3ea('0x23')]=function(_0x38cbbe,_0x141a9d){return db['SquareMessage'][_0xe3ea('0x44')]({'where':{'id':_0x38cbbe[_0xe3ea('0x41')]['id']}})[_0xe3ea('0x24')](handleEntityNotFound(_0x141a9d,null))[_0xe3ea('0x24')](removeEntity(_0x141a9d,null))[_0xe3ea('0x40')](handleError(_0x141a9d,null));};
\ No newline at end of file
+var _0xeda7=['name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','SquareMessage','includeAll','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xeda7,0x196));var _0x7eda=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xeda7[_0x53abe5];return _0xc1c37e;};'use strict';var emlformat=require(_0x7eda('0x0'));var rimraf=require(_0x7eda('0x1'));var zipdir=require(_0x7eda('0x2'));var jsonpatch=require(_0x7eda('0x3'));var rp=require(_0x7eda('0x4'));var moment=require(_0x7eda('0x5'));var BPromise=require(_0x7eda('0x6'));var Mustache=require(_0x7eda('0x7'));var util=require(_0x7eda('0x8'));var path=require(_0x7eda('0x9'));var sox=require(_0x7eda('0xa'));var csv=require(_0x7eda('0xb'));var ejs=require(_0x7eda('0xc'));var fs=require('fs');var fs_extra=require(_0x7eda('0xd'));var _=require(_0x7eda('0xe'));var squel=require(_0x7eda('0xf'));var crypto=require(_0x7eda('0x10'));var jsforce=require(_0x7eda('0x11'));var deskjs=require(_0x7eda('0x12'));var toCsv=require(_0x7eda('0xb'));var querystring=require('querystring');var Papa=require(_0x7eda('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7eda('0x14'));var as=require(_0x7eda('0x15'));var hardwareService=require(_0x7eda('0x16'));var logger=require(_0x7eda('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x7eda('0x18'));var licenseUtil=require(_0x7eda('0x19'));var db=require(_0x7eda('0x1a'))['db'];function respondWithStatusCode(_0x165fce,_0x5cd373){_0x5cd373=_0x5cd373||0xcc;return function(_0x1e7404){if(_0x1e7404){return _0x165fce['sendStatus'](_0x5cd373);}return _0x165fce[_0x7eda('0x1b')](_0x5cd373)[_0x7eda('0x1c')]();};}function respondWithResult(_0x1353e7,_0x145c81){_0x145c81=_0x145c81||0xc8;return function(_0x3de1be){if(_0x3de1be){return _0x1353e7[_0x7eda('0x1b')](_0x145c81)[_0x7eda('0x1d')](_0x3de1be);}};}function respondWithFilteredResult(_0x237d47,_0x6eaeeb){return function(_0x4a8fa2){if(_0x4a8fa2){var _0x4d13db=typeof _0x6eaeeb[_0x7eda('0x1e')]==='undefined'&&typeof _0x6eaeeb['limit']===_0x7eda('0x1f');var _0x44c83e=_0x4a8fa2[_0x7eda('0x20')];var _0x8a1a07=_0x4d13db?0x0:_0x6eaeeb[_0x7eda('0x1e')];var _0x4c8420=_0x4d13db?_0x4a8fa2['count']:_0x6eaeeb['offset']+_0x6eaeeb[_0x7eda('0x21')];var _0x558ecb;if(_0x4c8420>=_0x44c83e){_0x4c8420=_0x44c83e;_0x558ecb=0xc8;}else{_0x558ecb=0xce;}_0x237d47[_0x7eda('0x1b')](_0x558ecb);return _0x237d47[_0x7eda('0x22')](_0x7eda('0x23'),_0x8a1a07+'-'+_0x4c8420+'/'+_0x44c83e)[_0x7eda('0x1d')](_0x4a8fa2);}return null;};}function patchUpdates(_0x51443d){return function(_0x11158){try{jsonpatch[_0x7eda('0x24')](_0x11158,_0x51443d,!![]);}catch(_0x3d73ce){return BPromise[_0x7eda('0x25')](_0x3d73ce);}return _0x11158['save']();};}function saveUpdates(_0x5f0965,_0x1dddc1){return function(_0x58c409){if(_0x58c409){return _0x58c409[_0x7eda('0x26')](_0x5f0965)[_0x7eda('0x27')](function(_0x557fec){return _0x557fec;});}return null;};}function removeEntity(_0x2a62e7,_0x1519ee){return function(_0x1c064d){if(_0x1c064d){return _0x1c064d[_0x7eda('0x28')]()[_0x7eda('0x27')](function(){_0x2a62e7['status'](0xcc)[_0x7eda('0x1c')]();});}};}function handleEntityNotFound(_0x2ca61d,_0x1a4950){return function(_0x5ae8ff){if(!_0x5ae8ff){_0x2ca61d[_0x7eda('0x29')](0x194);}return _0x5ae8ff;};}function handleError(_0xd23184,_0xefbea1){_0xefbea1=_0xefbea1||0x1f4;return function(_0x76f1b2){logger[_0x7eda('0x2a')](_0x76f1b2[_0x7eda('0x2b')]);if(_0x76f1b2[_0x7eda('0x2c')]){delete _0x76f1b2[_0x7eda('0x2c')];}_0xd23184[_0x7eda('0x1b')](_0xefbea1)[_0x7eda('0x2d')](_0x76f1b2);};}exports['index']=function(_0x3a77f6,_0x3e1a08){var _0x300e20={},_0x2c5af0={},_0x5661fe={'count':0x0,'rows':[]};var _0x28aa9f=_[_0x7eda('0x2e')](db['SquareMessage'][_0x7eda('0x2f')],function(_0x4655a9){return{'name':_0x4655a9['fieldName'],'type':_0x4655a9[_0x7eda('0x30')][_0x7eda('0x31')]};});_0x2c5af0[_0x7eda('0x32')]=_[_0x7eda('0x2e')](_0x28aa9f,_0x7eda('0x2c'));_0x2c5af0[_0x7eda('0x33')]=_[_0x7eda('0x34')](_0x3a77f6[_0x7eda('0x33')]);_0x2c5af0[_0x7eda('0x35')]=_[_0x7eda('0x36')](_0x2c5af0['model'],_0x2c5af0[_0x7eda('0x33')]);_0x300e20['attributes']=_[_0x7eda('0x36')](_0x2c5af0[_0x7eda('0x32')],qs[_0x7eda('0x37')](_0x3a77f6[_0x7eda('0x33')]['fields']));_0x300e20[_0x7eda('0x38')]=_0x300e20[_0x7eda('0x38')][_0x7eda('0x39')]?_0x300e20['attributes']:_0x2c5af0[_0x7eda('0x32')];if(!_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3a')]('nolimit')){_0x300e20[_0x7eda('0x21')]=qs[_0x7eda('0x21')](_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x21')]);_0x300e20['offset']=qs[_0x7eda('0x1e')](_0x3a77f6[_0x7eda('0x33')]['offset']);}_0x300e20[_0x7eda('0x3b')]=qs[_0x7eda('0x3c')](_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3c')]);_0x300e20['where']=qs[_0x7eda('0x35')](_[_0x7eda('0x3d')](_0x3a77f6['query'],_0x2c5af0['filters']),_0x28aa9f);if(_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3e')]){_0x300e20['where']=_[_0x7eda('0x3f')](_0x300e20[_0x7eda('0x40')],{'$or':_[_0x7eda('0x2e')](_0x28aa9f,function(_0x1f879c){if(_0x1f879c['type']!=='VIRTUAL'){var _0x3b78d7={};_0x3b78d7[_0x1f879c[_0x7eda('0x2c')]]={'$like':'%'+_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x3e')]+'%'};return _0x3b78d7;}})});}_0x300e20=_['merge']({},_0x300e20,_0x3a77f6[_0x7eda('0x41')]);var _0xcf604d={'where':_0x300e20[_0x7eda('0x40')]};return db[_0x7eda('0x42')][_0x7eda('0x20')](_0xcf604d)[_0x7eda('0x27')](function(_0x478a92){_0x5661fe[_0x7eda('0x20')]=_0x478a92;if(_0x3a77f6[_0x7eda('0x33')][_0x7eda('0x43')]){_0x300e20['include']=[{'all':!![]}];}return db[_0x7eda('0x42')][_0x7eda('0x44')](_0x300e20);})[_0x7eda('0x27')](function(_0x317d94){_0x5661fe[_0x7eda('0x45')]=_0x317d94;return _0x5661fe;})[_0x7eda('0x27')](respondWithFilteredResult(_0x3e1a08,_0x300e20))[_0x7eda('0x46')](handleError(_0x3e1a08,null));};exports['show']=function(_0x4b4d37,_0x85f223){var _0xa45a33={'raw':!![],'where':{'id':_0x4b4d37[_0x7eda('0x47')]['id']}},_0x425a16={};_0x425a16[_0x7eda('0x32')]=_[_0x7eda('0x34')](db[_0x7eda('0x42')][_0x7eda('0x2f')]);_0x425a16[_0x7eda('0x33')]=_[_0x7eda('0x34')](_0x4b4d37[_0x7eda('0x33')]);_0x425a16[_0x7eda('0x35')]=_[_0x7eda('0x36')](_0x425a16[_0x7eda('0x32')],_0x425a16['query']);_0xa45a33[_0x7eda('0x38')]=_[_0x7eda('0x36')](_0x425a16[_0x7eda('0x32')],qs['fields'](_0x4b4d37[_0x7eda('0x33')]['fields']));_0xa45a33[_0x7eda('0x38')]=_0xa45a33[_0x7eda('0x38')][_0x7eda('0x39')]?_0xa45a33[_0x7eda('0x38')]:_0x425a16['model'];if(_0x4b4d37[_0x7eda('0x33')][_0x7eda('0x43')]){_0xa45a33['include']=[{'all':!![]}];}_0xa45a33=_[_0x7eda('0x3f')]({},_0xa45a33,_0x4b4d37['options']);return db[_0x7eda('0x42')][_0x7eda('0x48')](_0xa45a33)[_0x7eda('0x27')](handleEntityNotFound(_0x85f223,null))[_0x7eda('0x27')](respondWithResult(_0x85f223,null))['catch'](handleError(_0x85f223,null));};exports['create']=function(_0x306fc5,_0x250287){return db[_0x7eda('0x42')][_0x7eda('0x49')](_0x306fc5[_0x7eda('0x4a')],{})[_0x7eda('0x27')](respondWithResult(_0x250287,0xc9))[_0x7eda('0x46')](handleError(_0x250287,null));};exports[_0x7eda('0x26')]=function(_0x18d08d,_0x1d2145){if(_0x18d08d[_0x7eda('0x4a')]['id']){delete _0x18d08d['body']['id'];}return db[_0x7eda('0x42')][_0x7eda('0x48')]({'where':{'id':_0x18d08d[_0x7eda('0x47')]['id']}})[_0x7eda('0x27')](handleEntityNotFound(_0x1d2145,null))[_0x7eda('0x27')](saveUpdates(_0x18d08d[_0x7eda('0x4a')],null))['then'](respondWithResult(_0x1d2145,null))[_0x7eda('0x46')](handleError(_0x1d2145,null));};exports[_0x7eda('0x28')]=function(_0x5bdab6,_0x47530d){return db[_0x7eda('0x42')][_0x7eda('0x48')]({'where':{'id':_0x5bdab6['params']['id']}})[_0x7eda('0x27')](handleEntityNotFound(_0x47530d,null))['then'](removeEntity(_0x47530d,null))[_0x7eda('0x46')](handleError(_0x47530d,null));};
\ No newline at end of file
index 23ccabd..7a28c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3afc=['lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','square_messages'];(function(_0x5595e1,_0x21ddd8){var _0x47764a=function(_0x19c982){while(--_0x19c982){_0x5595e1['push'](_0x5595e1['shift']());}};_0x47764a(++_0x21ddd8);}(_0x3afc,0x12c));var _0xc3af=function(_0x356db4,_0x36dbfe){_0x356db4=_0x356db4-0x0;var _0x2a9100=_0x3afc[_0x356db4];return _0x2a9100;};'use strict';var _=require(_0xc3af('0x0'));var util=require(_0xc3af('0x1'));var logger=require(_0xc3af('0x2'))(_0xc3af('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3af('0x4'));var rimraf=require(_0xc3af('0x5'));var config=require(_0xc3af('0x6'));var attributes=require('./squareMessage.attributes');module[_0xc3af('0x7')]=function(_0x25acc1,_0x31bca0){return _0x25acc1[_0xc3af('0x8')]('SquareMessage',attributes,{'tableName':_0xc3af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa992=['exports','define','SquareMessage','square_messages','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x52677a,_0x49afea){var _0x578e13=function(_0x5074b0){while(--_0x5074b0){_0x52677a['push'](_0x52677a['shift']());}};_0x578e13(++_0x49afea);}(_0xa992,0x12d));var _0x2a99=function(_0x53cdb5,_0x2997f3){_0x53cdb5=_0x53cdb5-0x0;var _0x5b83ea=_0xa992[_0x53cdb5];return _0x5b83ea;};'use strict';var _=require('lodash');var util=require(_0x2a99('0x0'));var logger=require(_0x2a99('0x1'))(_0x2a99('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2a99('0x3'));var fs=require('fs');var path=require(_0x2a99('0x4'));var rimraf=require(_0x2a99('0x5'));var config=require(_0x2a99('0x6'));var attributes=require('./squareMessage.attributes');module[_0x2a99('0x7')]=function(_0x296550,_0x5d689a){return _0x296550[_0x2a99('0x8')](_0x2a99('0x9'),attributes,{'tableName':_0x2a99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5ad3085..91c18c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf971=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','create','options','raw'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xf971,0x122));var _0x1f97=function(_0x10b695,_0x2d950f){_0x10b695=_0x10b695-0x0;var _0x4b0a26=_0xf971[_0x10b695];return _0x4b0a26;};'use strict';var _=require(_0x1f97('0x0'));var util=require(_0x1f97('0x1'));var moment=require('moment');var BPromise=require(_0x1f97('0x2'));var rs=require(_0x1f97('0x3'));var fs=require('fs');var Redis=require(_0x1f97('0x4'));var db=require(_0x1f97('0x5'))['db'];var utils=require(_0x1f97('0x6'));var logger=require('../../config/logger')(_0x1f97('0x7'));var config=require(_0x1f97('0x8'));var jayson=require(_0x1f97('0x9'));var client=jayson[_0x1f97('0xa')][_0x1f97('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cb8f0,_0xf882e4,_0x29fc54){return new BPromise(function(_0x1fd264,_0x98044b){return client[_0x1f97('0xc')](_0x5cb8f0,_0x29fc54)[_0x1f97('0xd')](function(_0x359ec7){logger[_0x1f97('0xe')](_0x1f97('0xf'),_0xf882e4,_0x1f97('0x10'));logger[_0x1f97('0x11')](_0x1f97('0x12'),_0xf882e4,_0x1f97('0x10'),JSON[_0x1f97('0x13')](_0x359ec7));if(_0x359ec7[_0x1f97('0x14')]){if(_0x359ec7[_0x1f97('0x14')][_0x1f97('0x15')]===0x1f4){logger[_0x1f97('0x14')](_0x1f97('0xf'),_0xf882e4,_0x359ec7[_0x1f97('0x14')][_0x1f97('0x16')]);return _0x98044b(_0x359ec7[_0x1f97('0x14')][_0x1f97('0x16')]);}logger[_0x1f97('0x14')](_0x1f97('0xf'),_0xf882e4,_0x359ec7['error']['message']);return _0x1fd264(_0x359ec7[_0x1f97('0x14')][_0x1f97('0x16')]);}else{logger['info'](_0x1f97('0xf'),_0xf882e4,'request\x20sent');_0x1fd264(_0x359ec7[_0x1f97('0x17')][_0x1f97('0x16')]);}})[_0x1f97('0x18')](function(_0x36ba12){logger[_0x1f97('0x14')](_0x1f97('0xf'),_0xf882e4,_0x36ba12);_0x98044b(_0x36ba12);});});}exports[_0x1f97('0x19')]=function(_0xfc7f6f){var _0x257453=this;return new Promise(function(_0x2ef5f4,_0x4d46d5){return db['SquareMessage'][_0x1f97('0x1a')](_0xfc7f6f['body'],{'raw':_0xfc7f6f[_0x1f97('0x1b')]?_0xfc7f6f[_0x1f97('0x1b')][_0x1f97('0x1c')]===undefined?!![]:![]:!![]})[_0x1f97('0xd')](function(_0xc90b29){logger[_0x1f97('0xe')](_0x1f97('0x19'),_0xfc7f6f);logger['debug'](_0x1f97('0x19'),_0xfc7f6f,JSON[_0x1f97('0x13')](_0xc90b29));_0x2ef5f4(_0xc90b29);})[_0x1f97('0x18')](function(_0x7c2e92){logger[_0x1f97('0x14')](_0x1f97('0x19'),_0x7c2e92['message'],_0xfc7f6f);_0x4d46d5(_0x257453['error'](0x1f4,_0x7c2e92[_0x1f97('0x16')]));});});};
\ No newline at end of file
+var _0xba40=['result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','ioredis','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1cb594,_0x261ecf){var _0x51e013=function(_0x6d95d2){while(--_0x6d95d2){_0x1cb594['push'](_0x1cb594['shift']());}};_0x51e013(++_0x261ecf);}(_0xba40,0xc0));var _0x0ba4=function(_0x1d5411,_0x30966f){_0x1d5411=_0x1d5411-0x0;var _0x452932=_0xba40[_0x1d5411];return _0x452932;};'use strict';var _=require(_0x0ba4('0x0'));var util=require(_0x0ba4('0x1'));var moment=require(_0x0ba4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ba4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0ba4('0x4'));var client=jayson[_0x0ba4('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x451290,_0x19045d,_0x2cef37){return new BPromise(function(_0x5bd8bc,_0x4d225d){return client['request'](_0x451290,_0x2cef37)[_0x0ba4('0x6')](function(_0x378cb8){logger[_0x0ba4('0x7')](_0x0ba4('0x8'),_0x19045d,_0x0ba4('0x9'));logger[_0x0ba4('0xa')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x19045d,_0x0ba4('0x9'),JSON[_0x0ba4('0xb')](_0x378cb8));if(_0x378cb8['error']){if(_0x378cb8[_0x0ba4('0xc')][_0x0ba4('0xd')]===0x1f4){logger[_0x0ba4('0xc')](_0x0ba4('0x8'),_0x19045d,_0x378cb8[_0x0ba4('0xc')][_0x0ba4('0xe')]);return _0x4d225d(_0x378cb8['error'][_0x0ba4('0xe')]);}logger[_0x0ba4('0xc')](_0x0ba4('0x8'),_0x19045d,_0x378cb8[_0x0ba4('0xc')][_0x0ba4('0xe')]);return _0x5bd8bc(_0x378cb8[_0x0ba4('0xc')]['message']);}else{logger[_0x0ba4('0x7')]('SquareMessage,\x20%s,\x20%s',_0x19045d,_0x0ba4('0x9'));_0x5bd8bc(_0x378cb8[_0x0ba4('0xf')][_0x0ba4('0xe')]);}})[_0x0ba4('0x10')](function(_0x1de70a){logger[_0x0ba4('0xc')](_0x0ba4('0x8'),_0x19045d,_0x1de70a);_0x4d225d(_0x1de70a);});});}exports[_0x0ba4('0x11')]=function(_0x46730d){var _0x383609=this;return new Promise(function(_0x2b9d2c,_0x494abd){return db[_0x0ba4('0x12')][_0x0ba4('0x13')](_0x46730d[_0x0ba4('0x14')],{'raw':_0x46730d[_0x0ba4('0x15')]?_0x46730d[_0x0ba4('0x15')][_0x0ba4('0x16')]===undefined?!![]:![]:!![]})[_0x0ba4('0x6')](function(_0x5aa600){logger[_0x0ba4('0x7')]('CreateSquareMessage',_0x46730d);logger[_0x0ba4('0xa')](_0x0ba4('0x11'),_0x46730d,JSON['stringify'](_0x5aa600));_0x2b9d2c(_0x5aa600);})[_0x0ba4('0x10')](function(_0x5c8ca7){logger[_0x0ba4('0xc')](_0x0ba4('0x11'),_0x5c8ca7['message'],_0x46730d);_0x494abd(_0x383609[_0x0ba4('0xc')](0x1f4,_0x5c8ca7['message']));});});};
\ No newline at end of file
index 78cb858..86fc13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacb9=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','index','get','/:id','isAuthenticated','15s','post','create','update','delete','destroy','exports'];(function(_0x15240c,_0x4ee9fa){var _0x537282=function(_0x330bd8){while(--_0x330bd8){_0x15240c['push'](_0x15240c['shift']());}};_0x537282(++_0x4ee9fa);}(_0xacb9,0xd8));var _0x9acb=function(_0x54ab1f,_0x1585d6){_0x54ab1f=_0x54ab1f-0x0;var _0x24c869=_0xacb9[_0x54ab1f];return _0x24c869;};'use strict';var multer=require(_0x9acb('0x0'));var util=require('util');var path=require(_0x9acb('0x1'));var timeout=require(_0x9acb('0x2'));var express=require('express');var router=express[_0x9acb('0x3')]();var fs_extra=require(_0x9acb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9acb('0x5'));var config=require('../../config/environment');var controller=require(_0x9acb('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9acb('0x7')]);router[_0x9acb('0x8')](_0x9acb('0x9'),auth[_0x9acb('0xa')](),controller['show']);router[_0x9acb('0x8')]('/:id/test',auth[_0x9acb('0xa')](),timeout(_0x9acb('0xb')),controller['test']);router[_0x9acb('0xc')]('/',auth[_0x9acb('0xa')](),controller[_0x9acb('0xd')]);router['put'](_0x9acb('0x9'),auth[_0x9acb('0xa')](),controller[_0x9acb('0xe')]);router[_0x9acb('0xf')](_0x9acb('0x9'),auth[_0x9acb('0xa')](),controller[_0x9acb('0x10')]);module[_0x9acb('0x11')]=router;
\ No newline at end of file
+var _0xe222=['/:id','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xe222,0xd1));var _0x2e22=function(_0x22ccc0,_0x914457){_0x22ccc0=_0x22ccc0-0x0;var _0xe2af6a=_0xe222[_0x22ccc0];return _0xe2af6a;};'use strict';var multer=require(_0x2e22('0x0'));var util=require(_0x2e22('0x1'));var path=require(_0x2e22('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e22('0x3'));var router=express['Router']();var fs_extra=require(_0x2e22('0x4'));var auth=require(_0x2e22('0x5'));var interaction=require(_0x2e22('0x6'));var config=require(_0x2e22('0x7'));var controller=require('./squareOdbc.controller');router[_0x2e22('0x8')]('/',auth[_0x2e22('0x9')](),controller[_0x2e22('0xa')]);router[_0x2e22('0x8')](_0x2e22('0xb'),auth[_0x2e22('0x9')](),controller['show']);router[_0x2e22('0x8')](_0x2e22('0xc'),auth[_0x2e22('0x9')](),timeout(_0x2e22('0xd')),controller[_0x2e22('0xe')]);router[_0x2e22('0xf')]('/',auth['isAuthenticated'](),controller[_0x2e22('0x10')]);router[_0x2e22('0x11')]('/:id',auth[_0x2e22('0x9')](),controller[_0x2e22('0x12')]);router[_0x2e22('0x13')](_0x2e22('0xb'),auth[_0x2e22('0x9')](),controller[_0x2e22('0x14')]);module[_0x2e22('0x15')]=router;
\ No newline at end of file
index c707056..f0a1b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f5f=['exports','STRING','name','sequelize'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5f5f,0xa3));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf5f5('0x0'));module[_0xf5f5('0x1')]={'name':{'type':Sequelize[_0xf5f5('0x2')],'unique':_0xf5f5('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x79e8=['name','sequelize','exports','STRING'];(function(_0x3b762c,_0x35e9f3){var _0x248699=function(_0x146e76){while(--_0x146e76){_0x3b762c['push'](_0x3b762c['shift']());}};_0x248699(++_0x35e9f3);}(_0x79e8,0x145));var _0x879e=function(_0x5df6a1,_0x119f5b){_0x5df6a1=_0x5df6a1-0x0;var _0x4088d4=_0x79e8[_0x5df6a1];return _0x4088d4;};'use strict';var Sequelize=require(_0x879e('0x0'));module[_0x879e('0x1')]={'name':{'type':Sequelize[_0x879e('0x2')],'unique':_0x879e('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x879e('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d38e4c4..54ae49a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e1=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','odbc','openSync','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','Content-Range','apply','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x70e1,0x10a));var _0x170e=function(_0x124d12,_0x2351a1){_0x124d12=_0x124d12-0x0;var _0x54180f=_0x70e1[_0x124d12];return _0x54180f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x170e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x170e('0x1'));var moment=require(_0x170e('0x2'));var BPromise=require(_0x170e('0x3'));var Mustache=require(_0x170e('0x4'));var util=require('util');var path=require(_0x170e('0x5'));var sox=require('sox');var csv=require(_0x170e('0x6'));var ejs=require(_0x170e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x170e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x170e('0x9'));var deskjs=require(_0x170e('0xa'));var toCsv=require(_0x170e('0x6'));var querystring=require(_0x170e('0xb'));var Papa=require(_0x170e('0xc'));var Redis=require('ioredis');var authService=require(_0x170e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x170e('0xe'));var hardwareService=require(_0x170e('0xf'));var logger=require(_0x170e('0x10'))('api');var utils=require(_0x170e('0x11'));var config=require(_0x170e('0x12'));var licenseUtil=require(_0x170e('0x13'));var db=require(_0x170e('0x14'))['db'];function respondWithStatusCode(_0x54bc58,_0x13e7d9){_0x13e7d9=_0x13e7d9||0xcc;return function(_0x63b948){if(_0x63b948){return _0x54bc58[_0x170e('0x15')](_0x13e7d9);}return _0x54bc58[_0x170e('0x16')](_0x13e7d9)['end']();};}function respondWithResult(_0x3e7e28,_0x1d7165){_0x1d7165=_0x1d7165||0xc8;return function(_0x49ea6a){if(_0x49ea6a){return _0x3e7e28['status'](_0x1d7165)[_0x170e('0x17')](_0x49ea6a);}};}function respondWithFilteredResult(_0x3f4da3,_0x488531){return function(_0x391e38){if(_0x391e38){var _0x21fb46=typeof _0x488531['offset']==='undefined'&&typeof _0x488531['limit']==='undefined';var _0x577c39=_0x391e38['count'];var _0x20c364=_0x21fb46?0x0:_0x488531[_0x170e('0x18')];var _0x3728e4=_0x21fb46?_0x391e38[_0x170e('0x19')]:_0x488531[_0x170e('0x18')]+_0x488531[_0x170e('0x1a')];var _0xbfd4aa;if(_0x3728e4>=_0x577c39){_0x3728e4=_0x577c39;_0xbfd4aa=0xc8;}else{_0xbfd4aa=0xce;}_0x3f4da3['status'](_0xbfd4aa);return _0x3f4da3['set'](_0x170e('0x1b'),_0x20c364+'-'+_0x3728e4+'/'+_0x577c39)[_0x170e('0x17')](_0x391e38);}return null;};}function patchUpdates(_0x35be9c){return function(_0xee43ce){try{jsonpatch[_0x170e('0x1c')](_0xee43ce,_0x35be9c,!![]);}catch(_0x2f3623){return BPromise['reject'](_0x2f3623);}return _0xee43ce[_0x170e('0x1d')]();};}function saveUpdates(_0x2ebef1,_0x1d5202){return function(_0x171c56){if(_0x171c56){return _0x171c56[_0x170e('0x1e')](_0x2ebef1)[_0x170e('0x1f')](function(_0x56eb51){return _0x56eb51;});}return null;};}function removeEntity(_0x12d0be,_0x682f0f){return function(_0x2e3775){if(_0x2e3775){return _0x2e3775[_0x170e('0x20')]()[_0x170e('0x1f')](function(){var _0x708abc=_0x2e3775[_0x170e('0x21')]({'plain':!![]});var _0x571e85=_0x170e('0x22');return db[_0x170e('0x23')][_0x170e('0x20')]({'where':{'type':_0x571e85,'resourceId':_0x708abc['id']}})[_0x170e('0x1f')](function(){return _0x2e3775;});})[_0x170e('0x1f')](function(){_0x12d0be[_0x170e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e9a85,_0x645392){return function(_0x2c6688){if(!_0x2c6688){_0x5e9a85[_0x170e('0x15')](0x194);}return _0x2c6688;};}function handleError(_0x178e20,_0x1944b4){_0x1944b4=_0x1944b4||0x1f4;return function(_0x299dbd){logger[_0x170e('0x24')](_0x299dbd[_0x170e('0x25')]);if(_0x299dbd[_0x170e('0x26')]){delete _0x299dbd[_0x170e('0x26')];}_0x178e20[_0x170e('0x16')](_0x1944b4)[_0x170e('0x27')](_0x299dbd);};}exports[_0x170e('0x28')]=function(_0x276862,_0x445967){var _0x3702c1={},_0x220338={},_0x417eb2={'count':0x0,'rows':[]};var _0x4aed58=_[_0x170e('0x29')](db[_0x170e('0x2a')][_0x170e('0x2b')],function(_0x4226b6){return{'name':_0x4226b6['fieldName'],'type':_0x4226b6[_0x170e('0x2c')][_0x170e('0x2d')]};});_0x220338[_0x170e('0x2e')]=_['map'](_0x4aed58,_0x170e('0x26'));_0x220338[_0x170e('0x2f')]=_[_0x170e('0x30')](_0x276862[_0x170e('0x2f')]);_0x220338[_0x170e('0x31')]=_[_0x170e('0x32')](_0x220338[_0x170e('0x2e')],_0x220338['query']);_0x3702c1['attributes']=_[_0x170e('0x32')](_0x220338[_0x170e('0x2e')],qs[_0x170e('0x33')](_0x276862[_0x170e('0x2f')][_0x170e('0x33')]));_0x3702c1[_0x170e('0x34')]=_0x3702c1['attributes'][_0x170e('0x35')]?_0x3702c1[_0x170e('0x34')]:_0x220338[_0x170e('0x2e')];if(!_0x276862[_0x170e('0x2f')]['hasOwnProperty'](_0x170e('0x36'))){_0x3702c1[_0x170e('0x1a')]=qs[_0x170e('0x1a')](_0x276862[_0x170e('0x2f')][_0x170e('0x1a')]);_0x3702c1[_0x170e('0x18')]=qs['offset'](_0x276862['query'][_0x170e('0x18')]);}_0x3702c1[_0x170e('0x37')]=qs[_0x170e('0x38')](_0x276862[_0x170e('0x2f')][_0x170e('0x38')]);_0x3702c1[_0x170e('0x39')]=qs[_0x170e('0x31')](_[_0x170e('0x3a')](_0x276862['query'],_0x220338[_0x170e('0x31')]),_0x4aed58);if(_0x276862[_0x170e('0x2f')][_0x170e('0x3b')]){_0x3702c1[_0x170e('0x39')]=_[_0x170e('0x3c')](_0x3702c1[_0x170e('0x39')],{'$or':_[_0x170e('0x29')](_0x4aed58,function(_0x1ac775){if(_0x1ac775[_0x170e('0x2c')]!==_0x170e('0x3d')){var _0x418d98={};_0x418d98[_0x1ac775[_0x170e('0x26')]]={'$like':'%'+_0x276862[_0x170e('0x2f')][_0x170e('0x3b')]+'%'};return _0x418d98;}})});}_0x3702c1=_[_0x170e('0x3c')]({},_0x3702c1,_0x276862['options']);var _0x300ee9={'where':_0x3702c1['where']};return db[_0x170e('0x2a')][_0x170e('0x19')](_0x300ee9)['then'](function(_0x535c67){_0x417eb2[_0x170e('0x19')]=_0x535c67;if(_0x276862[_0x170e('0x2f')][_0x170e('0x3e')]){_0x3702c1[_0x170e('0x3f')]=[{'all':!![]}];}return db[_0x170e('0x2a')][_0x170e('0x40')](_0x3702c1);})['then'](function(_0x1882fe){_0x417eb2[_0x170e('0x41')]=_0x1882fe;return _0x417eb2;})[_0x170e('0x1f')](respondWithFilteredResult(_0x445967,_0x3702c1))[_0x170e('0x42')](handleError(_0x445967,null));};exports[_0x170e('0x43')]=function(_0x45d1da,_0x28f9bd){var _0x1e5e19={'raw':!![],'where':{'id':_0x45d1da[_0x170e('0x44')]['id']}},_0x27b82d={};_0x27b82d[_0x170e('0x2e')]=_['keys'](db[_0x170e('0x2a')]['rawAttributes']);_0x27b82d[_0x170e('0x2f')]=_[_0x170e('0x30')](_0x45d1da['query']);_0x27b82d[_0x170e('0x31')]=_[_0x170e('0x32')](_0x27b82d[_0x170e('0x2e')],_0x27b82d[_0x170e('0x2f')]);_0x1e5e19[_0x170e('0x34')]=_[_0x170e('0x32')](_0x27b82d[_0x170e('0x2e')],qs[_0x170e('0x33')](_0x45d1da[_0x170e('0x2f')]['fields']));_0x1e5e19['attributes']=_0x1e5e19['attributes'][_0x170e('0x35')]?_0x1e5e19[_0x170e('0x34')]:_0x27b82d['model'];if(_0x45d1da[_0x170e('0x2f')][_0x170e('0x3e')]){_0x1e5e19[_0x170e('0x3f')]=[{'all':!![]}];}_0x1e5e19=_[_0x170e('0x3c')]({},_0x1e5e19,_0x45d1da['options']);return db[_0x170e('0x2a')][_0x170e('0x45')](_0x1e5e19)['then'](handleEntityNotFound(_0x28f9bd,null))[_0x170e('0x1f')](respondWithResult(_0x28f9bd,null))[_0x170e('0x42')](handleError(_0x28f9bd,null));};exports[_0x170e('0x46')]=function(_0x201331,_0x234001){return db[_0x170e('0x2a')][_0x170e('0x46')](_0x201331[_0x170e('0x47')],{})[_0x170e('0x1f')](function(_0x2261b1){var _0xddbefb=_0x201331[_0x170e('0x48')][_0x170e('0x21')]({'plain':!![]});if(!_0xddbefb)throw new Error(_0x170e('0x49'));if(_0xddbefb[_0x170e('0x4a')]===_0x170e('0x48')){var _0x476916=_0x2261b1[_0x170e('0x21')]({'plain':!![]});var _0x1436a1=_0x170e('0x22');return db[_0x170e('0x4b')][_0x170e('0x45')]({'where':{'name':_0x1436a1,'userProfileId':_0xddbefb['userProfileId']},'raw':!![]})['then'](function(_0x3f8f66){if(_0x3f8f66&&_0x3f8f66[_0x170e('0x4c')]===0x0){return db[_0x170e('0x23')][_0x170e('0x46')]({'name':_0x476916[_0x170e('0x26')],'resourceId':_0x476916['id'],'type':_0x3f8f66[_0x170e('0x26')],'sectionId':_0x3f8f66['id']},{})['then'](function(){return _0x2261b1;});}else{return _0x2261b1;}})['catch'](function(_0x29cf67){logger['error'](_0x170e('0x4d'),_0x29cf67);throw _0x29cf67;});}return _0x2261b1;})[_0x170e('0x1f')](respondWithResult(_0x234001,0xc9))[_0x170e('0x42')](handleError(_0x234001,null));};exports[_0x170e('0x1e')]=function(_0x402779,_0xfc756a){if(_0x402779[_0x170e('0x47')]['id']){delete _0x402779['body']['id'];}return db[_0x170e('0x2a')]['find']({'where':{'id':_0x402779[_0x170e('0x44')]['id']}})['then'](handleEntityNotFound(_0xfc756a,null))['then'](saveUpdates(_0x402779[_0x170e('0x47')],null))[_0x170e('0x1f')](respondWithResult(_0xfc756a,null))[_0x170e('0x42')](handleError(_0xfc756a,null));};exports[_0x170e('0x20')]=function(_0x1d9889,_0x33ecd4){return db[_0x170e('0x2a')][_0x170e('0x45')]({'where':{'id':_0x1d9889[_0x170e('0x44')]['id']}})[_0x170e('0x1f')](handleEntityNotFound(_0x33ecd4,null))[_0x170e('0x1f')](removeEntity(_0x33ecd4,null))['catch'](handleError(_0x33ecd4,null));};exports['test']=function(_0xb686ba,_0x396ccc,_0x32ac68){var _0x567048;return db[_0x170e('0x2a')][_0x170e('0x45')]({'where':{'id':_0xb686ba['params']['id']},'attributes':['id','dsn']})[_0x170e('0x1f')](handleEntityNotFound(_0x396ccc,null))[_0x170e('0x1f')](function(_0x370718){if(_0x370718){var _0x40fed7=require(_0x170e('0x4e'))();_0x40fed7[_0x170e('0x4f')](_0x370718['dsn']);_0x40fed7['closeSync']();return _0x370718;}})[_0x170e('0x1f')](respondWithResult(_0x396ccc,null))[_0x170e('0x42')](handleError(_0x396ccc,null));};
\ No newline at end of file
+var _0x9a01=['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','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','end','error','stack','name','send','index','SquareOdbc','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','role','user','ODBC','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','eml-format','rimraf','zip-dir','moment','util','path','sox'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x9a01,0x14d));var _0x19a0=function(_0x129db6,_0xb7341c){_0x129db6=_0x129db6-0x0;var _0x1bb919=_0x9a01[_0x129db6];return _0x1bb919;};'use strict';var emlformat=require(_0x19a0('0x0'));var rimraf=require(_0x19a0('0x1'));var zipdir=require(_0x19a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x19a0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x19a0('0x4'));var path=require(_0x19a0('0x5'));var sox=require(_0x19a0('0x6'));var csv=require('to-csv');var ejs=require(_0x19a0('0x7'));var fs=require('fs');var fs_extra=require(_0x19a0('0x8'));var _=require(_0x19a0('0x9'));var squel=require(_0x19a0('0xa'));var crypto=require(_0x19a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x19a0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x19a0('0xd'));var Papa=require(_0x19a0('0xe'));var Redis=require(_0x19a0('0xf'));var authService=require(_0x19a0('0x10'));var qs=require(_0x19a0('0x11'));var as=require(_0x19a0('0x12'));var hardwareService=require(_0x19a0('0x13'));var logger=require(_0x19a0('0x14'))(_0x19a0('0x15'));var utils=require('../../config/utils');var config=require(_0x19a0('0x16'));var licenseUtil=require(_0x19a0('0x17'));var db=require(_0x19a0('0x18'))['db'];function respondWithStatusCode(_0x1794b5,_0x49e07c){_0x49e07c=_0x49e07c||0xcc;return function(_0x4e7c14){if(_0x4e7c14){return _0x1794b5[_0x19a0('0x19')](_0x49e07c);}return _0x1794b5[_0x19a0('0x1a')](_0x49e07c)['end']();};}function respondWithResult(_0x47f470,_0x302c65){_0x302c65=_0x302c65||0xc8;return function(_0x4b85fb){if(_0x4b85fb){return _0x47f470[_0x19a0('0x1a')](_0x302c65)[_0x19a0('0x1b')](_0x4b85fb);}};}function respondWithFilteredResult(_0x30282b,_0x55823a){return function(_0x180cb8){if(_0x180cb8){var _0x14752f=typeof _0x55823a[_0x19a0('0x1c')]===_0x19a0('0x1d')&&typeof _0x55823a[_0x19a0('0x1e')]===_0x19a0('0x1d');var _0x503337=_0x180cb8[_0x19a0('0x1f')];var _0x29ae84=_0x14752f?0x0:_0x55823a[_0x19a0('0x1c')];var _0x595d51=_0x14752f?_0x180cb8['count']:_0x55823a['offset']+_0x55823a['limit'];var _0x5243b4;if(_0x595d51>=_0x503337){_0x595d51=_0x503337;_0x5243b4=0xc8;}else{_0x5243b4=0xce;}_0x30282b[_0x19a0('0x1a')](_0x5243b4);return _0x30282b[_0x19a0('0x20')](_0x19a0('0x21'),_0x29ae84+'-'+_0x595d51+'/'+_0x503337)[_0x19a0('0x1b')](_0x180cb8);}return null;};}function patchUpdates(_0x3307e9){return function(_0x517c1f){try{jsonpatch['apply'](_0x517c1f,_0x3307e9,!![]);}catch(_0x28d9fc){return BPromise['reject'](_0x28d9fc);}return _0x517c1f[_0x19a0('0x22')]();};}function saveUpdates(_0xff8d1d,_0x1489c7){return function(_0x51600f){if(_0x51600f){return _0x51600f[_0x19a0('0x23')](_0xff8d1d)['then'](function(_0x2c0960){return _0x2c0960;});}return null;};}function removeEntity(_0x3e2db7,_0x36383d){return function(_0x467fa8){if(_0x467fa8){return _0x467fa8[_0x19a0('0x24')]()[_0x19a0('0x25')](function(){var _0x258a3f=_0x467fa8['get']({'plain':!![]});var _0x4e4cb='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x4e4cb,'resourceId':_0x258a3f['id']}})[_0x19a0('0x25')](function(){return _0x467fa8;});})[_0x19a0('0x25')](function(){_0x3e2db7[_0x19a0('0x1a')](0xcc)[_0x19a0('0x26')]();});}};}function handleEntityNotFound(_0x3047ad,_0x89343){return function(_0x81f65c){if(!_0x81f65c){_0x3047ad[_0x19a0('0x19')](0x194);}return _0x81f65c;};}function handleError(_0x2832ca,_0x1d1dc5){_0x1d1dc5=_0x1d1dc5||0x1f4;return function(_0x8fa035){logger[_0x19a0('0x27')](_0x8fa035[_0x19a0('0x28')]);if(_0x8fa035['name']){delete _0x8fa035[_0x19a0('0x29')];}_0x2832ca['status'](_0x1d1dc5)[_0x19a0('0x2a')](_0x8fa035);};}exports[_0x19a0('0x2b')]=function(_0x84447b,_0x36fbb1){var _0x31bde2={},_0x5a6ac1={},_0x51dfbc={'count':0x0,'rows':[]};var _0x4c70ec=_['map'](db[_0x19a0('0x2c')]['rawAttributes'],function(_0x3879bb){return{'name':_0x3879bb[_0x19a0('0x2d')],'type':_0x3879bb[_0x19a0('0x2e')][_0x19a0('0x2f')]};});_0x5a6ac1[_0x19a0('0x30')]=_[_0x19a0('0x31')](_0x4c70ec,'name');_0x5a6ac1[_0x19a0('0x32')]=_[_0x19a0('0x33')](_0x84447b[_0x19a0('0x32')]);_0x5a6ac1[_0x19a0('0x34')]=_[_0x19a0('0x35')](_0x5a6ac1[_0x19a0('0x30')],_0x5a6ac1[_0x19a0('0x32')]);_0x31bde2['attributes']=_[_0x19a0('0x35')](_0x5a6ac1[_0x19a0('0x30')],qs['fields'](_0x84447b[_0x19a0('0x32')][_0x19a0('0x36')]));_0x31bde2[_0x19a0('0x37')]=_0x31bde2['attributes'][_0x19a0('0x38')]?_0x31bde2[_0x19a0('0x37')]:_0x5a6ac1[_0x19a0('0x30')];if(!_0x84447b[_0x19a0('0x32')][_0x19a0('0x39')](_0x19a0('0x3a'))){_0x31bde2[_0x19a0('0x1e')]=qs[_0x19a0('0x1e')](_0x84447b[_0x19a0('0x32')]['limit']);_0x31bde2[_0x19a0('0x1c')]=qs[_0x19a0('0x1c')](_0x84447b[_0x19a0('0x32')]['offset']);}_0x31bde2[_0x19a0('0x3b')]=qs['sort'](_0x84447b[_0x19a0('0x32')]['sort']);_0x31bde2[_0x19a0('0x3c')]=qs['filters'](_[_0x19a0('0x3d')](_0x84447b[_0x19a0('0x32')],_0x5a6ac1[_0x19a0('0x34')]),_0x4c70ec);if(_0x84447b[_0x19a0('0x32')][_0x19a0('0x3e')]){_0x31bde2['where']=_[_0x19a0('0x3f')](_0x31bde2[_0x19a0('0x3c')],{'$or':_[_0x19a0('0x31')](_0x4c70ec,function(_0x24c535){if(_0x24c535[_0x19a0('0x2e')]!==_0x19a0('0x40')){var _0x20731f={};_0x20731f[_0x24c535['name']]={'$like':'%'+_0x84447b['query'][_0x19a0('0x3e')]+'%'};return _0x20731f;}})});}_0x31bde2=_[_0x19a0('0x3f')]({},_0x31bde2,_0x84447b[_0x19a0('0x41')]);var _0x3c1a69={'where':_0x31bde2[_0x19a0('0x3c')]};return db[_0x19a0('0x2c')][_0x19a0('0x1f')](_0x3c1a69)[_0x19a0('0x25')](function(_0x280135){_0x51dfbc[_0x19a0('0x1f')]=_0x280135;if(_0x84447b['query'][_0x19a0('0x42')]){_0x31bde2[_0x19a0('0x43')]=[{'all':!![]}];}return db[_0x19a0('0x2c')]['findAll'](_0x31bde2);})[_0x19a0('0x25')](function(_0x56eadc){_0x51dfbc[_0x19a0('0x44')]=_0x56eadc;return _0x51dfbc;})[_0x19a0('0x25')](respondWithFilteredResult(_0x36fbb1,_0x31bde2))[_0x19a0('0x45')](handleError(_0x36fbb1,null));};exports[_0x19a0('0x46')]=function(_0x31bd38,_0x347fad){var _0x1cb7de={'raw':!![],'where':{'id':_0x31bd38[_0x19a0('0x47')]['id']}},_0x34cb69={};_0x34cb69[_0x19a0('0x30')]=_['keys'](db['SquareOdbc'][_0x19a0('0x48')]);_0x34cb69[_0x19a0('0x32')]=_[_0x19a0('0x33')](_0x31bd38[_0x19a0('0x32')]);_0x34cb69[_0x19a0('0x34')]=_['intersection'](_0x34cb69[_0x19a0('0x30')],_0x34cb69[_0x19a0('0x32')]);_0x1cb7de[_0x19a0('0x37')]=_[_0x19a0('0x35')](_0x34cb69['model'],qs['fields'](_0x31bd38[_0x19a0('0x32')]['fields']));_0x1cb7de['attributes']=_0x1cb7de[_0x19a0('0x37')][_0x19a0('0x38')]?_0x1cb7de[_0x19a0('0x37')]:_0x34cb69['model'];if(_0x31bd38['query'][_0x19a0('0x42')]){_0x1cb7de[_0x19a0('0x43')]=[{'all':!![]}];}_0x1cb7de=_[_0x19a0('0x3f')]({},_0x1cb7de,_0x31bd38[_0x19a0('0x41')]);return db[_0x19a0('0x2c')]['find'](_0x1cb7de)[_0x19a0('0x25')](handleEntityNotFound(_0x347fad,null))[_0x19a0('0x25')](respondWithResult(_0x347fad,null))[_0x19a0('0x45')](handleError(_0x347fad,null));};exports[_0x19a0('0x49')]=function(_0x5635b,_0x131f7c){return db[_0x19a0('0x2c')][_0x19a0('0x49')](_0x5635b[_0x19a0('0x4a')],{})[_0x19a0('0x25')](function(_0x54411e){var _0x6abcab=_0x5635b['user']['get']({'plain':!![]});if(!_0x6abcab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6abcab[_0x19a0('0x4b')]===_0x19a0('0x4c')){var _0x5e0395=_0x54411e['get']({'plain':!![]});var _0x21cb35=_0x19a0('0x4d');return db[_0x19a0('0x4e')][_0x19a0('0x4f')]({'where':{'name':_0x21cb35,'userProfileId':_0x6abcab['userProfileId']},'raw':!![]})[_0x19a0('0x25')](function(_0x4d8fb4){if(_0x4d8fb4&&_0x4d8fb4['autoAssociation']===0x0){return db[_0x19a0('0x50')][_0x19a0('0x49')]({'name':_0x5e0395[_0x19a0('0x29')],'resourceId':_0x5e0395['id'],'type':_0x4d8fb4['name'],'sectionId':_0x4d8fb4['id']},{})[_0x19a0('0x25')](function(){return _0x54411e;});}else{return _0x54411e;}})[_0x19a0('0x45')](function(_0x389826){logger['error'](_0x19a0('0x51'),_0x389826);throw _0x389826;});}return _0x54411e;})['then'](respondWithResult(_0x131f7c,0xc9))[_0x19a0('0x45')](handleError(_0x131f7c,null));};exports[_0x19a0('0x23')]=function(_0x73024f,_0x49c36e){if(_0x73024f[_0x19a0('0x4a')]['id']){delete _0x73024f[_0x19a0('0x4a')]['id'];}return db[_0x19a0('0x2c')][_0x19a0('0x4f')]({'where':{'id':_0x73024f[_0x19a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x49c36e,null))['then'](saveUpdates(_0x73024f['body'],null))[_0x19a0('0x25')](respondWithResult(_0x49c36e,null))['catch'](handleError(_0x49c36e,null));};exports[_0x19a0('0x24')]=function(_0x5d56e1,_0x1b477f){return db[_0x19a0('0x2c')]['find']({'where':{'id':_0x5d56e1[_0x19a0('0x47')]['id']}})[_0x19a0('0x25')](handleEntityNotFound(_0x1b477f,null))['then'](removeEntity(_0x1b477f,null))[_0x19a0('0x45')](handleError(_0x1b477f,null));};exports['test']=function(_0x3bf105,_0x396070,_0x92d38c){var _0x260ee7;return db[_0x19a0('0x2c')][_0x19a0('0x4f')]({'where':{'id':_0x3bf105[_0x19a0('0x47')]['id']},'attributes':['id',_0x19a0('0x52')]})[_0x19a0('0x25')](handleEntityNotFound(_0x396070,null))[_0x19a0('0x25')](function(_0x2eb1bd){if(_0x2eb1bd){var _0x2a44a6=require(_0x19a0('0x53'))();_0x2a44a6[_0x19a0('0x54')](_0x2eb1bd['dsn']);_0x2a44a6['closeSync']();return _0x2eb1bd;}})[_0x19a0('0x25')](respondWithResult(_0x396070,null))[_0x19a0('0x45')](handleError(_0x396070,null));};
\ No newline at end of file
index 4c55736..bdd4875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0bb=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./squareOdbc.attributes','exports','define'];(function(_0x4e61bc,_0x1cff51){var _0x4e0fb1=function(_0x587f0d){while(--_0x587f0d){_0x4e61bc['push'](_0x4e61bc['shift']());}};_0x4e0fb1(++_0x1cff51);}(_0xe0bb,0x15e));var _0xbe0b=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0xe0bb[_0xdf3db6];return _0x4b7a65;};'use strict';var _=require(_0xbe0b('0x0'));var util=require('util');var logger=require(_0xbe0b('0x1'))(_0xbe0b('0x2'));var moment=require(_0xbe0b('0x3'));var BPromise=require(_0xbe0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe0b('0x5'));var rimraf=require(_0xbe0b('0x6'));var config=require('../../config/environment');var attributes=require(_0xbe0b('0x7'));module[_0xbe0b('0x8')]=function(_0xc01a65,_0x2ed64c){return _0xc01a65[_0xbe0b('0x9')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1822=['exports','define','util','../../config/logger','path','rimraf','./squareOdbc.attributes'];(function(_0xa46cc9,_0x327f7d){var _0x5683ed=function(_0x3432d4){while(--_0x3432d4){_0xa46cc9['push'](_0xa46cc9['shift']());}};_0x5683ed(++_0x327f7d);}(_0x1822,0x144));var _0x2182=function(_0x4aceac,_0x2c1c6c){_0x4aceac=_0x4aceac-0x0;var _0x4fc661=_0x1822[_0x4aceac];return _0x4fc661;};'use strict';var _=require('lodash');var util=require(_0x2182('0x0'));var logger=require(_0x2182('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2182('0x2'));var rimraf=require(_0x2182('0x3'));var config=require('../../config/environment');var attributes=require(_0x2182('0x4'));module[_0x2182('0x5')]=function(_0x578828,_0x7d763c){return _0x578828[_0x2182('0x6')]('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7304092..9bdbbf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2bc=['where','include','model','map','attributes','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','code','error','message','SquareOdbc,\x20%s,\x20%s','request\x20sent','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw'];(function(_0x897be6,_0x574c2e){var _0x21a12f=function(_0x5243f7){while(--_0x5243f7){_0x897be6['push'](_0x897be6['shift']());}};_0x21a12f(++_0x574c2e);}(_0xe2bc,0xe5));var _0xce2b=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xe2bc[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0xce2b('0x0'));var util=require(_0xce2b('0x1'));var moment=require(_0xce2b('0x2'));var BPromise=require(_0xce2b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce2b('0x5'))('rpc');var config=require(_0xce2b('0x6'));var jayson=require(_0xce2b('0x7'));var client=jayson['client'][_0xce2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23d8ef,_0x408d5f,_0x47dc6d){return new BPromise(function(_0x29ea5c,_0x2d358b){return client[_0xce2b('0x9')](_0x23d8ef,_0x47dc6d)[_0xce2b('0xa')](function(_0x1baff0){logger[_0xce2b('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x408d5f,'request\x20sent');logger[_0xce2b('0xc')](_0xce2b('0xd'),_0x408d5f,'request\x20sent',JSON[_0xce2b('0xe')](_0x1baff0));if(_0x1baff0['error']){if(_0x1baff0['error'][_0xce2b('0xf')]===0x1f4){logger[_0xce2b('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x408d5f,_0x1baff0['error'][_0xce2b('0x11')]);return _0x2d358b(_0x1baff0[_0xce2b('0x10')][_0xce2b('0x11')]);}logger[_0xce2b('0x10')](_0xce2b('0x12'),_0x408d5f,_0x1baff0[_0xce2b('0x10')]['message']);return _0x29ea5c(_0x1baff0[_0xce2b('0x10')][_0xce2b('0x11')]);}else{logger[_0xce2b('0xb')](_0xce2b('0x12'),_0x408d5f,_0xce2b('0x13'));_0x29ea5c(_0x1baff0[_0xce2b('0x14')][_0xce2b('0x11')]);}})[_0xce2b('0x15')](function(_0x5f3f75){logger[_0xce2b('0x10')](_0xce2b('0x12'),_0x408d5f,_0x5f3f75);_0x2d358b(_0x5f3f75);});});}exports[_0xce2b('0x16')]=function(_0x1dc42c){var _0x34529a=this;return new Promise(function(_0x3baa2e,_0x476b3c){return db[_0xce2b('0x17')][_0xce2b('0x18')]({'raw':_0x1dc42c['options']?_0x1dc42c[_0xce2b('0x19')][_0xce2b('0x1a')]===undefined?!![]:![]:!![],'where':_0x1dc42c['options']?_0x1dc42c[_0xce2b('0x19')][_0xce2b('0x1b')]||null:null,'attributes':_0x1dc42c[_0xce2b('0x19')]?_0x1dc42c[_0xce2b('0x19')]['attributes']||null:null,'include':_0x1dc42c[_0xce2b('0x19')]?_0x1dc42c[_0xce2b('0x19')][_0xce2b('0x1c')]?_['map'](_0x1dc42c[_0xce2b('0x19')]['include'],function(_0x5d844d){return{'model':db[_0x5d844d[_0xce2b('0x1d')]],'as':_0x5d844d['as'],'attributes':_0x5d844d['attributes'],'include':_0x5d844d['include']?_[_0xce2b('0x1e')](_0x5d844d[_0xce2b('0x1c')],function(_0x5004cc){return{'model':db[_0x5004cc['model']],'as':_0x5004cc['as'],'attributes':_0x5004cc[_0xce2b('0x1f')],'include':_0x5004cc[_0xce2b('0x1c')]?_[_0xce2b('0x1e')](_0x5004cc[_0xce2b('0x1c')],function(_0x11d4cf){return{'model':db[_0x11d4cf['model']],'as':_0x11d4cf['as'],'attributes':_0x11d4cf[_0xce2b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d4167){logger[_0xce2b('0xb')](_0xce2b('0x16'),_0x1dc42c);logger[_0xce2b('0xc')](_0xce2b('0x16'),_0x1dc42c,JSON[_0xce2b('0xe')](_0x2d4167));_0x3baa2e(_0x2d4167);})['catch'](function(_0x5e08a2){logger[_0xce2b('0x10')](_0xce2b('0x16'),_0x5e08a2[_0xce2b('0x11')],_0x1dc42c);_0x476b3c(_0x34529a[_0xce2b('0x10')](0x1f4,_0x5e08a2[_0xce2b('0x11')]));});});};
\ No newline at end of file
+var _0xf2ff=['stringify','error','code','message','result','SquareOdbc','find','options','raw','where','include','model','map','attributes','ShowSquareOdbc','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x440df0,_0x235152){var _0x3d60df=function(_0xc18a91){while(--_0xc18a91){_0x440df0['push'](_0x440df0['shift']());}};_0x3d60df(++_0x235152);}(_0xf2ff,0xb5));var _0xff2f=function(_0x1cd252,_0x128f04){_0x1cd252=_0x1cd252-0x0;var _0x1f33ac=_0xf2ff[_0x1cd252];return _0x1f33ac;};'use strict';var _=require(_0xff2f('0x0'));var util=require('util');var moment=require(_0xff2f('0x1'));var BPromise=require(_0xff2f('0x2'));var rs=require(_0xff2f('0x3'));var fs=require('fs');var Redis=require(_0xff2f('0x4'));var db=require(_0xff2f('0x5'))['db'];var utils=require(_0xff2f('0x6'));var logger=require(_0xff2f('0x7'))('rpc');var config=require(_0xff2f('0x8'));var jayson=require(_0xff2f('0x9'));var client=jayson[_0xff2f('0xa')][_0xff2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd17d9,_0x36be1a,_0x4d1e50){return new BPromise(function(_0x1b133e,_0x294f39){return client['request'](_0xd17d9,_0x4d1e50)[_0xff2f('0xc')](function(_0x58d177){logger[_0xff2f('0xd')](_0xff2f('0xe'),_0x36be1a,'request\x20sent');logger['debug'](_0xff2f('0xf'),_0x36be1a,_0xff2f('0x10'),JSON[_0xff2f('0x11')](_0x58d177));if(_0x58d177[_0xff2f('0x12')]){if(_0x58d177[_0xff2f('0x12')][_0xff2f('0x13')]===0x1f4){logger[_0xff2f('0x12')](_0xff2f('0xe'),_0x36be1a,_0x58d177[_0xff2f('0x12')]['message']);return _0x294f39(_0x58d177[_0xff2f('0x12')][_0xff2f('0x14')]);}logger[_0xff2f('0x12')](_0xff2f('0xe'),_0x36be1a,_0x58d177['error'][_0xff2f('0x14')]);return _0x1b133e(_0x58d177[_0xff2f('0x12')][_0xff2f('0x14')]);}else{logger[_0xff2f('0xd')](_0xff2f('0xe'),_0x36be1a,_0xff2f('0x10'));_0x1b133e(_0x58d177[_0xff2f('0x15')][_0xff2f('0x14')]);}})['catch'](function(_0x17e4c7){logger[_0xff2f('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x36be1a,_0x17e4c7);_0x294f39(_0x17e4c7);});});}exports['ShowSquareOdbc']=function(_0x228dff){var _0x12f545=this;return new Promise(function(_0x37e58c,_0x209d0a){return db[_0xff2f('0x16')][_0xff2f('0x17')]({'raw':_0x228dff['options']?_0x228dff[_0xff2f('0x18')][_0xff2f('0x19')]===undefined?!![]:![]:!![],'where':_0x228dff[_0xff2f('0x18')]?_0x228dff['options'][_0xff2f('0x1a')]||null:null,'attributes':_0x228dff[_0xff2f('0x18')]?_0x228dff[_0xff2f('0x18')]['attributes']||null:null,'include':_0x228dff[_0xff2f('0x18')]?_0x228dff[_0xff2f('0x18')][_0xff2f('0x1b')]?_['map'](_0x228dff['options']['include'],function(_0x52edf6){return{'model':db[_0x52edf6[_0xff2f('0x1c')]],'as':_0x52edf6['as'],'attributes':_0x52edf6['attributes'],'include':_0x52edf6[_0xff2f('0x1b')]?_[_0xff2f('0x1d')](_0x52edf6[_0xff2f('0x1b')],function(_0x98ee10){return{'model':db[_0x98ee10[_0xff2f('0x1c')]],'as':_0x98ee10['as'],'attributes':_0x98ee10[_0xff2f('0x1e')],'include':_0x98ee10[_0xff2f('0x1b')]?_['map'](_0x98ee10[_0xff2f('0x1b')],function(_0x2df828){return{'model':db[_0x2df828[_0xff2f('0x1c')]],'as':_0x2df828['as'],'attributes':_0x2df828[_0xff2f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xff2f('0xc')](function(_0x9af61){logger['info'](_0xff2f('0x1f'),_0x228dff);logger['debug'](_0xff2f('0x1f'),_0x228dff,JSON[_0xff2f('0x11')](_0x9af61));_0x37e58c(_0x9af61);})[_0xff2f('0x20')](function(_0x344368){logger[_0xff2f('0x12')]('ShowSquareOdbc',_0x344368[_0xff2f('0x14')],_0x228dff);_0x209d0a(_0x12f545['error'](0x1f4,_0x344368[_0xff2f('0x14')]));});});};
\ No newline at end of file
index 4f7d9e7..babd86f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1485=['delete','destroy','removeUsers','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','index','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','create','put','update'];(function(_0x29f013,_0x2b13f3){var _0x5001bb=function(_0x4ddba5){while(--_0x4ddba5){_0x29f013['push'](_0x29f013['shift']());}};_0x5001bb(++_0x2b13f3);}(_0x1485,0x77));var _0x5148=function(_0x3947e7,_0x1112f2){_0x3947e7=_0x3947e7-0x0;var _0x20b885=_0x1485[_0x3947e7];return _0x20b885;};'use strict';var multer=require('multer');var util=require(_0x5148('0x0'));var path=require(_0x5148('0x1'));var timeout=require(_0x5148('0x2'));var express=require('express');var router=express[_0x5148('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5148('0x4'));var interaction=require(_0x5148('0x5'));var config=require(_0x5148('0x6'));var controller=require(_0x5148('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5148('0x8')]);router[_0x5148('0x9')](_0x5148('0xa'),auth[_0x5148('0xb')](),controller[_0x5148('0xc')]);router['get'](_0x5148('0xd'),auth[_0x5148('0xb')](),controller[_0x5148('0xe')]);router[_0x5148('0xf')]('/',auth['isAuthenticated'](),controller[_0x5148('0x10')]);router[_0x5148('0xf')](_0x5148('0xd'),auth[_0x5148('0xb')](),controller['addUsers']);router[_0x5148('0x11')](_0x5148('0xa'),auth[_0x5148('0xb')](),controller[_0x5148('0x12')]);router[_0x5148('0x13')](_0x5148('0xa'),auth[_0x5148('0xb')](),controller[_0x5148('0x14')]);router['delete']('/:id/users',auth[_0x5148('0xb')](),controller[_0x5148('0x15')]);module[_0x5148('0x16')]=router;
\ No newline at end of file
+var _0x605a=['destroy','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','addUsers','put','/:id','update','delete'];(function(_0x3b9b6f,_0x182921){var _0xe7346c=function(_0x38c54e){while(--_0x38c54e){_0x3b9b6f['push'](_0x3b9b6f['shift']());}};_0xe7346c(++_0x182921);}(_0x605a,0x1d7));var _0xa605=function(_0x4dceb7,_0x58315a){_0x4dceb7=_0x4dceb7-0x0;var _0x3423ae=_0x605a[_0x4dceb7];return _0x3423ae;};'use strict';var multer=require(_0xa605('0x0'));var util=require('util');var path=require(_0xa605('0x1'));var timeout=require(_0xa605('0x2'));var express=require(_0xa605('0x3'));var router=express[_0xa605('0x4')]();var fs_extra=require(_0xa605('0x5'));var auth=require(_0xa605('0x6'));var interaction=require(_0xa605('0x7'));var config=require(_0xa605('0x8'));var controller=require(_0xa605('0x9'));router[_0xa605('0xa')]('/',auth[_0xa605('0xb')](),controller[_0xa605('0xc')]);router['get']('/:id',auth[_0xa605('0xb')](),controller[_0xa605('0xd')]);router[_0xa605('0xa')](_0xa605('0xe'),auth[_0xa605('0xb')](),controller[_0xa605('0xf')]);router[_0xa605('0x10')]('/',auth[_0xa605('0xb')](),controller[_0xa605('0x11')]);router[_0xa605('0x10')](_0xa605('0xe'),auth[_0xa605('0xb')](),controller[_0xa605('0x12')]);router[_0xa605('0x13')](_0xa605('0x14'),auth[_0xa605('0xb')](),controller[_0xa605('0x15')]);router[_0xa605('0x16')](_0xa605('0x14'),auth['isAuthenticated'](),controller[_0xa605('0x17')]);router[_0xa605('0x16')]('/:id/users',auth[_0xa605('0xb')](),controller[_0xa605('0x18')]);module[_0xa605('0x19')]=router;
\ No newline at end of file
index 7aeb3e8..e3d1578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff39=['exports','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8','DATE','sequelize'];(function(_0x354155,_0x5eae65){var _0x4217be=function(_0x2d1a55){while(--_0x2d1a55){_0x354155['push'](_0x354155['shift']());}};_0x4217be(++_0x5eae65);}(_0xff39,0x173));var _0x9ff3=function(_0x530191,_0x52edef){_0x530191=_0x530191-0x0;var _0x212d5d=_0xff39[_0x530191];return _0x212d5d;};'use strict';var Sequelize=require(_0x9ff3('0x0'));module[_0x9ff3('0x1')]={'name':{'type':Sequelize[_0x9ff3('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9ff3('0x2')]},'notes':{'type':Sequelize[_0x9ff3('0x3')]},'preproduction':{'type':Sequelize[_0x9ff3('0x4')](_0x9ff3('0x5')),'get':function(){if(this[_0x9ff3('0x6')](_0x9ff3('0x7'))){return this[_0x9ff3('0x6')]('preproduction')[_0x9ff3('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x9ff3('0x4')](_0x9ff3('0x5')),'get':function(){if(this[_0x9ff3('0x6')](_0x9ff3('0x9'))){return this[_0x9ff3('0x6')](_0x9ff3('0x9'))['toString'](_0x9ff3('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x9ff3('0xb')]}};
\ No newline at end of file
+var _0xf122=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long'];(function(_0x287415,_0x56477c){var _0x32d1a0=function(_0x24af33){while(--_0x24af33){_0x287415['push'](_0x287415['shift']());}};_0x32d1a0(++_0x56477c);}(_0xf122,0x17f));var _0x2f12=function(_0x502116,_0x242439){_0x502116=_0x502116-0x0;var _0x414095=_0xf122[_0x502116];return _0x414095;};'use strict';var Sequelize=require(_0x2f12('0x0'));module[_0x2f12('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2f12('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x2f12('0x3')]},'notes':{'type':Sequelize[_0x2f12('0x4')]},'preproduction':{'type':Sequelize[_0x2f12('0x5')](_0x2f12('0x6')),'get':function(){if(this[_0x2f12('0x7')](_0x2f12('0x8'))){return this[_0x2f12('0x7')]('preproduction')[_0x2f12('0x9')](_0x2f12('0xa'));}}},'production':{'type':Sequelize[_0x2f12('0x5')](_0x2f12('0x6')),'get':function(){if(this[_0x2f12('0x7')](_0x2f12('0xb'))){return this[_0x2f12('0x7')]('production')[_0x2f12('0x9')](_0x2f12('0xa'));}}},'savedAt':{'type':Sequelize[_0x2f12('0xc')]},'publishedAt':{'type':Sequelize[_0x2f12('0xc')]}};
\ No newline at end of file
index e015bff..2eef41c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fc4=['squel','jsforce','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./squareProject.socket','sendStatus','end','json','offset','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','error','stack','name','send','index','map','SquareProject','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','create','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','rawAttributes','pick','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash'];(function(_0x5f2e2c,_0x110a16){var _0x5acf22=function(_0x33bcec){while(--_0x33bcec){_0x5f2e2c['push'](_0x5f2e2c['shift']());}};_0x5acf22(++_0x110a16);}(_0x2fc4,0xa8));var _0x42fc=function(_0x4a2324,_0x29b899){_0x4a2324=_0x4a2324-0x0;var _0x1b86b6=_0x2fc4[_0x4a2324];return _0x1b86b6;};'use strict';var emlformat=require(_0x42fc('0x0'));var rimraf=require(_0x42fc('0x1'));var zipdir=require(_0x42fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42fc('0x3'));var moment=require(_0x42fc('0x4'));var BPromise=require(_0x42fc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x42fc('0x6'));var ejs=require(_0x42fc('0x7'));var fs=require('fs');var fs_extra=require(_0x42fc('0x8'));var _=require(_0x42fc('0x9'));var squel=require(_0x42fc('0xa'));var crypto=require('crypto');var jsforce=require(_0x42fc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x42fc('0xc'));var hardwareService=require(_0x42fc('0xd'));var logger=require(_0x42fc('0xe'))(_0x42fc('0xf'));var utils=require(_0x42fc('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x42fc('0x11'));var db=require(_0x42fc('0x12'))['db'];config[_0x42fc('0x13')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42fc('0x13')]));require(_0x42fc('0x14'))['register'](socket);function respondWithStatusCode(_0x596930,_0xc7fc73){_0xc7fc73=_0xc7fc73||0xcc;return function(_0x3d7c83){if(_0x3d7c83){return _0x596930[_0x42fc('0x15')](_0xc7fc73);}return _0x596930['status'](_0xc7fc73)[_0x42fc('0x16')]();};}function respondWithResult(_0x381c10,_0x481623){_0x481623=_0x481623||0xc8;return function(_0x2b5c20){if(_0x2b5c20){return _0x381c10['status'](_0x481623)[_0x42fc('0x17')](_0x2b5c20);}};}function respondWithFilteredResult(_0x589c02,_0x4a8d19){return function(_0x40c389){if(_0x40c389){var _0x166b44=typeof _0x4a8d19[_0x42fc('0x18')]==='undefined'&&typeof _0x4a8d19['limit']==='undefined';var _0x20e69f=_0x40c389[_0x42fc('0x19')];var _0x4e01ce=_0x166b44?0x0:_0x4a8d19[_0x42fc('0x18')];var _0x4c51c6=_0x166b44?_0x40c389[_0x42fc('0x19')]:_0x4a8d19[_0x42fc('0x18')]+_0x4a8d19['limit'];var _0x364704;if(_0x4c51c6>=_0x20e69f){_0x4c51c6=_0x20e69f;_0x364704=0xc8;}else{_0x364704=0xce;}_0x589c02[_0x42fc('0x1a')](_0x364704);return _0x589c02[_0x42fc('0x1b')](_0x42fc('0x1c'),_0x4e01ce+'-'+_0x4c51c6+'/'+_0x20e69f)[_0x42fc('0x17')](_0x40c389);}return null;};}function patchUpdates(_0x28a5aa){return function(_0x6f6731){try{jsonpatch[_0x42fc('0x1d')](_0x6f6731,_0x28a5aa,!![]);}catch(_0x2582e9){return BPromise[_0x42fc('0x1e')](_0x2582e9);}return _0x6f6731[_0x42fc('0x1f')]();};}function saveUpdates(_0x5a9289,_0x55e596){return function(_0x9ba48f){if(_0x9ba48f){return _0x9ba48f[_0x42fc('0x20')](_0x5a9289)[_0x42fc('0x21')](function(_0x3b9bee){return _0x3b9bee;});}return null;};}function removeEntity(_0x552e15,_0x45e935){return function(_0x703114){if(_0x703114){return _0x703114[_0x42fc('0x22')]()[_0x42fc('0x21')](function(){var _0x7575b9=_0x703114[_0x42fc('0x23')]({'plain':!![]});var _0x1dbb89=_0x42fc('0x24');return db['UserProfileResource'][_0x42fc('0x22')]({'where':{'type':_0x1dbb89,'resourceId':_0x7575b9['id']}})[_0x42fc('0x21')](function(){return _0x703114;});})[_0x42fc('0x21')](function(){_0x552e15[_0x42fc('0x1a')](0xcc)[_0x42fc('0x16')]();});}};}function handleEntityNotFound(_0x3b1164,_0x50bc1c){return function(_0x4a0d80){if(!_0x4a0d80){_0x3b1164[_0x42fc('0x15')](0x194);}return _0x4a0d80;};}function handleError(_0x3f3763,_0x38609e){_0x38609e=_0x38609e||0x1f4;return function(_0x2b7f4e){logger[_0x42fc('0x25')](_0x2b7f4e[_0x42fc('0x26')]);if(_0x2b7f4e[_0x42fc('0x27')]){delete _0x2b7f4e[_0x42fc('0x27')];}_0x3f3763[_0x42fc('0x1a')](_0x38609e)[_0x42fc('0x28')](_0x2b7f4e);};}exports[_0x42fc('0x29')]=function(_0x3a226d,_0x29bcc8){var _0x1165b2={},_0x5186c4={},_0x165a96={'count':0x0,'rows':[]};var _0x499265=_[_0x42fc('0x2a')](db[_0x42fc('0x2b')]['rawAttributes'],function(_0x371350){return{'name':_0x371350['fieldName'],'type':_0x371350[_0x42fc('0x2c')]['key']};});_0x5186c4[_0x42fc('0x2d')]=_['map'](_0x499265,_0x42fc('0x27'));_0x5186c4[_0x42fc('0x2e')]=_[_0x42fc('0x2f')](_0x3a226d[_0x42fc('0x2e')]);_0x5186c4[_0x42fc('0x30')]=_['intersection'](_0x5186c4[_0x42fc('0x2d')],_0x5186c4['query']);_0x1165b2[_0x42fc('0x31')]=_[_0x42fc('0x32')](_0x5186c4[_0x42fc('0x2d')],qs[_0x42fc('0x33')](_0x3a226d[_0x42fc('0x2e')][_0x42fc('0x33')]));_0x1165b2[_0x42fc('0x31')]=_0x1165b2[_0x42fc('0x31')][_0x42fc('0x34')]?_0x1165b2[_0x42fc('0x31')]:_0x5186c4[_0x42fc('0x2d')];if(!_0x3a226d[_0x42fc('0x2e')][_0x42fc('0x35')]('nolimit')){_0x1165b2['limit']=qs['limit'](_0x3a226d['query'][_0x42fc('0x36')]);_0x1165b2['offset']=qs[_0x42fc('0x18')](_0x3a226d[_0x42fc('0x2e')][_0x42fc('0x18')]);}_0x1165b2[_0x42fc('0x37')]=qs[_0x42fc('0x38')](_0x3a226d[_0x42fc('0x2e')]['sort']);_0x1165b2['where']=qs['filters'](_['pick'](_0x3a226d[_0x42fc('0x2e')],_0x5186c4[_0x42fc('0x30')]),_0x499265);if(_0x3a226d['query'][_0x42fc('0x39')]){_0x1165b2[_0x42fc('0x3a')]=_[_0x42fc('0x3b')](_0x1165b2[_0x42fc('0x3a')],{'$or':_[_0x42fc('0x2a')](_0x499265,function(_0x4b0a1b){if(_0x4b0a1b['type']!==_0x42fc('0x3c')){var _0x4dfb5c={};_0x4dfb5c[_0x4b0a1b[_0x42fc('0x27')]]={'$like':'%'+_0x3a226d['query'][_0x42fc('0x39')]+'%'};return _0x4dfb5c;}})});}_0x1165b2=_[_0x42fc('0x3b')]({},_0x1165b2,_0x3a226d[_0x42fc('0x3d')]);var _0x55a1fe={'where':_0x1165b2[_0x42fc('0x3a')]};return db['SquareProject'][_0x42fc('0x19')](_0x55a1fe)[_0x42fc('0x21')](function(_0x1a6e42){_0x165a96[_0x42fc('0x19')]=_0x1a6e42;if(_0x3a226d[_0x42fc('0x2e')][_0x42fc('0x3e')]){_0x1165b2['include']=[{'all':!![]}];}return db['SquareProject'][_0x42fc('0x3f')](_0x1165b2);})['then'](function(_0x443bbe){_0x165a96[_0x42fc('0x40')]=_0x443bbe;return _0x165a96;})[_0x42fc('0x21')](respondWithFilteredResult(_0x29bcc8,_0x1165b2))[_0x42fc('0x41')](handleError(_0x29bcc8,null));};exports[_0x42fc('0x42')]=function(_0x263ee4,_0x46d8cb){var _0x2dbc9d={'raw':![],'where':{'id':_0x263ee4[_0x42fc('0x43')]['id']}},_0x47aa97={};_0x47aa97[_0x42fc('0x2d')]=_['keys'](db[_0x42fc('0x2b')]['rawAttributes']);_0x47aa97[_0x42fc('0x2e')]=_[_0x42fc('0x2f')](_0x263ee4[_0x42fc('0x2e')]);_0x47aa97[_0x42fc('0x30')]=_['intersection'](_0x47aa97[_0x42fc('0x2d')],_0x47aa97[_0x42fc('0x2e')]);_0x2dbc9d[_0x42fc('0x31')]=_['intersection'](_0x47aa97[_0x42fc('0x2d')],qs['fields'](_0x263ee4[_0x42fc('0x2e')]['fields']));_0x2dbc9d[_0x42fc('0x31')]=_0x2dbc9d[_0x42fc('0x31')][_0x42fc('0x34')]?_0x2dbc9d[_0x42fc('0x31')]:_0x47aa97[_0x42fc('0x2d')];if(_0x263ee4[_0x42fc('0x2e')][_0x42fc('0x3e')]){_0x2dbc9d[_0x42fc('0x44')]=[{'all':!![]}];}_0x2dbc9d=_['merge']({},_0x2dbc9d,_0x263ee4[_0x42fc('0x3d')]);return db['SquareProject'][_0x42fc('0x45')](_0x2dbc9d)[_0x42fc('0x21')](handleEntityNotFound(_0x46d8cb,null))['then'](respondWithResult(_0x46d8cb,null))[_0x42fc('0x41')](handleError(_0x46d8cb,null));};exports['create']=function(_0x251761,_0x1bc2a6){return db[_0x42fc('0x2b')]['create'](_0x251761[_0x42fc('0x46')],{})[_0x42fc('0x21')](function(_0x397443){var _0x4f7d4e=_0x251761[_0x42fc('0x47')][_0x42fc('0x23')]({'plain':!![]});if(!_0x4f7d4e)throw new Error(_0x42fc('0x48'));if(_0x4f7d4e['role']===_0x42fc('0x47')){var _0x6d55ab=_0x397443[_0x42fc('0x23')]({'plain':!![]});var _0x577929=_0x42fc('0x24');return db[_0x42fc('0x49')][_0x42fc('0x45')]({'where':{'name':_0x577929,'userProfileId':_0x4f7d4e[_0x42fc('0x4a')]},'raw':!![]})[_0x42fc('0x21')](function(_0x57a416){if(_0x57a416&&_0x57a416['autoAssociation']===0x0){return db[_0x42fc('0x4b')][_0x42fc('0x4c')]({'name':_0x6d55ab[_0x42fc('0x27')],'resourceId':_0x6d55ab['id'],'type':_0x57a416[_0x42fc('0x27')],'sectionId':_0x57a416['id']},{})[_0x42fc('0x21')](function(){return _0x397443;});}else{return _0x397443;}})['catch'](function(_0xb7b462){logger[_0x42fc('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb7b462);throw _0xb7b462;});}return _0x397443;})[_0x42fc('0x21')](respondWithResult(_0x1bc2a6,0xc9))[_0x42fc('0x41')](handleError(_0x1bc2a6,null));};exports[_0x42fc('0x20')]=function(_0x2c4658,_0x1d433a){if(_0x2c4658[_0x42fc('0x46')]['id']){delete _0x2c4658[_0x42fc('0x46')]['id'];}return db['SquareProject']['find']({'where':{'id':_0x2c4658['params']['id']}})['then'](handleEntityNotFound(_0x1d433a,null))[_0x42fc('0x21')](saveUpdates(_0x2c4658[_0x42fc('0x46')],null))[_0x42fc('0x21')](respondWithResult(_0x1d433a,null))[_0x42fc('0x41')](handleError(_0x1d433a,null));};exports[_0x42fc('0x22')]=function(_0x54ca93,_0x55834d){return db[_0x42fc('0x2b')]['find']({'where':{'id':_0x54ca93[_0x42fc('0x43')]['id']}})['then'](handleEntityNotFound(_0x55834d,null))[_0x42fc('0x21')](removeEntity(_0x55834d,null))[_0x42fc('0x41')](handleError(_0x55834d,null));};exports[_0x42fc('0x4d')]=function(_0x91ca6d,_0x5417f2,_0x3a94de){return db['SquareProject'][_0x42fc('0x45')]({'where':{'id':_0x91ca6d[_0x42fc('0x43')]['id']}})[_0x42fc('0x21')](handleEntityNotFound(_0x5417f2,null))[_0x42fc('0x21')](function(_0x28f935){if(_0x28f935){return _0x28f935[_0x42fc('0x4d')](_0x91ca6d[_0x42fc('0x46')][_0x42fc('0x4e')],_[_0x42fc('0x4f')](_0x91ca6d['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5417f2,null))['catch'](handleError(_0x5417f2,null));};exports[_0x42fc('0x50')]=function(_0x1017ce,_0x9bff23,_0x12edcb){return db['SquareProject']['find']({'where':{'id':_0x1017ce[_0x42fc('0x43')]['id']}})['then'](handleEntityNotFound(_0x9bff23,null))[_0x42fc('0x21')](function(_0x224360){if(_0x224360){return _0x224360[_0x42fc('0x50')](_0x1017ce[_0x42fc('0x2e')]['ids'])[_0x42fc('0x21')](function(){if(_['isArray'](_0x1017ce['query'][_0x42fc('0x4e')])){for(var _0x4bdc7a=0x0;_0x4bdc7a<_0x1017ce[_0x42fc('0x2e')][_0x42fc('0x4e')][_0x42fc('0x34')];_0x4bdc7a+=0x1){socket[_0x42fc('0x51')](_0x42fc('0x52'),{'UserId':Number(_0x1017ce[_0x42fc('0x2e')][_0x42fc('0x4e')][_0x4bdc7a]),'SquareProjectId':Number(_0x1017ce['params']['id'])});}}else{socket[_0x42fc('0x51')](_0x42fc('0x52'),{'UserId':Number(_0x1017ce[_0x42fc('0x2e')][_0x42fc('0x4e')]),'SquareProjectId':Number(_0x1017ce[_0x42fc('0x43')]['id'])});}});}})[_0x42fc('0x21')](respondWithStatusCode(_0x9bff23,null))['catch'](handleError(_0x9bff23,null));};exports[_0x42fc('0x53')]=function(_0x502092,_0x55adec,_0x565144){var _0x43e72e={};var _0xe41be0={};var _0x4a86c0;var _0x2c894e;return db[_0x42fc('0x2b')][_0x42fc('0x54')]({'where':{'id':_0x502092[_0x42fc('0x43')]['id']}})[_0x42fc('0x21')](handleEntityNotFound(_0x55adec,null))[_0x42fc('0x21')](function(_0x2cba47){if(_0x2cba47){_0x4a86c0=_0x2cba47;_0xe41be0['model']=_[_0x42fc('0x2f')](db[_0x42fc('0x55')][_0x42fc('0x56')]);_0xe41be0[_0x42fc('0x2e')]=_[_0x42fc('0x2f')](_0x502092['query']);_0xe41be0[_0x42fc('0x30')]=_[_0x42fc('0x32')](_0xe41be0['model'],_0xe41be0[_0x42fc('0x2e')]);_0x43e72e[_0x42fc('0x31')]=_[_0x42fc('0x32')](_0xe41be0[_0x42fc('0x2d')],qs[_0x42fc('0x33')](_0x502092[_0x42fc('0x2e')][_0x42fc('0x33')]));_0x43e72e[_0x42fc('0x31')]=_0x43e72e[_0x42fc('0x31')]['length']?_0x43e72e[_0x42fc('0x31')]:_0xe41be0[_0x42fc('0x2d')];_0x43e72e['order']=qs[_0x42fc('0x38')](_0x502092[_0x42fc('0x2e')][_0x42fc('0x38')]);_0x43e72e[_0x42fc('0x3a')]=qs[_0x42fc('0x30')](_[_0x42fc('0x57')](_0x502092[_0x42fc('0x2e')],_0xe41be0[_0x42fc('0x30')]));if(_0x502092['query'][_0x42fc('0x39')]){_0x43e72e[_0x42fc('0x3a')]=_[_0x42fc('0x3b')](_0x43e72e[_0x42fc('0x3a')],{'$or':_['map'](_0x43e72e['attributes'],function(_0x35a95f){var _0x22c94b={};_0x22c94b[_0x35a95f]={'$like':'%'+_0x502092['query'][_0x42fc('0x39')]+'%'};return _0x22c94b;})});}_0x43e72e=_['merge']({},_0x43e72e,_0x502092[_0x42fc('0x3d')]);return _0x4a86c0[_0x42fc('0x53')](_0x43e72e);}})['then'](function(_0x17b66f){if(_0x17b66f){_0x2c894e=_0x17b66f[_0x42fc('0x34')];if(!_0x502092[_0x42fc('0x2e')][_0x42fc('0x35')](_0x42fc('0x58'))){_0x43e72e[_0x42fc('0x36')]=qs[_0x42fc('0x36')](_0x502092[_0x42fc('0x2e')][_0x42fc('0x36')]);_0x43e72e[_0x42fc('0x18')]=qs[_0x42fc('0x18')](_0x502092[_0x42fc('0x2e')][_0x42fc('0x18')]);}return _0x4a86c0[_0x42fc('0x53')](_0x43e72e);}})['then'](function(_0x15dc66){if(_0x15dc66){return _0x15dc66?{'count':_0x2c894e,'rows':_0x15dc66}:null;}})[_0x42fc('0x21')](respondWithResult(_0x55adec,null))[_0x42fc('0x41')](handleError(_0x55adec,null));};
\ No newline at end of file
+var _0x3c44=['params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','getUsers','findOne','User','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','SquareProjects','UserProfileResource','end','name','send','map','SquareProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3c44,0x1e2));var _0x43c4=function(_0x3b7ba3,_0x4b6a83){_0x3b7ba3=_0x3b7ba3-0x0;var _0x2d126c=_0x3c44[_0x3b7ba3];return _0x2d126c;};'use strict';var emlformat=require(_0x43c4('0x0'));var rimraf=require(_0x43c4('0x1'));var zipdir=require(_0x43c4('0x2'));var jsonpatch=require(_0x43c4('0x3'));var rp=require(_0x43c4('0x4'));var moment=require(_0x43c4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x43c4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x43c4('0x7'));var csv=require(_0x43c4('0x8'));var ejs=require(_0x43c4('0x9'));var fs=require('fs');var fs_extra=require(_0x43c4('0xa'));var _=require(_0x43c4('0xb'));var squel=require(_0x43c4('0xc'));var crypto=require(_0x43c4('0xd'));var jsforce=require(_0x43c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x43c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x43c4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x43c4('0x10'));var as=require(_0x43c4('0x11'));var hardwareService=require(_0x43c4('0x12'));var logger=require('../../config/logger')(_0x43c4('0x13'));var utils=require('../../config/utils');var config=require(_0x43c4('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43c4('0x15'))['db'];config[_0x43c4('0x16')]=_[_0x43c4('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x43c4('0x18'))(new Redis(config[_0x43c4('0x16')]));require(_0x43c4('0x19'))['register'](socket);function respondWithStatusCode(_0x18fc8e,_0x400b1c){_0x400b1c=_0x400b1c||0xcc;return function(_0x2350f8){if(_0x2350f8){return _0x18fc8e[_0x43c4('0x1a')](_0x400b1c);}return _0x18fc8e['status'](_0x400b1c)['end']();};}function respondWithResult(_0x17cbe2,_0x1888d4){_0x1888d4=_0x1888d4||0xc8;return function(_0x37fa23){if(_0x37fa23){return _0x17cbe2[_0x43c4('0x1b')](_0x1888d4)[_0x43c4('0x1c')](_0x37fa23);}};}function respondWithFilteredResult(_0x32e9b2,_0x20aede){return function(_0x2845f8){if(_0x2845f8){var _0x51d5b5=typeof _0x20aede[_0x43c4('0x1d')]===_0x43c4('0x1e')&&typeof _0x20aede[_0x43c4('0x1f')]===_0x43c4('0x1e');var _0x4491e8=_0x2845f8[_0x43c4('0x20')];var _0x182e75=_0x51d5b5?0x0:_0x20aede['offset'];var _0x3fff76=_0x51d5b5?_0x2845f8['count']:_0x20aede[_0x43c4('0x1d')]+_0x20aede['limit'];var _0x599975;if(_0x3fff76>=_0x4491e8){_0x3fff76=_0x4491e8;_0x599975=0xc8;}else{_0x599975=0xce;}_0x32e9b2['status'](_0x599975);return _0x32e9b2['set'](_0x43c4('0x21'),_0x182e75+'-'+_0x3fff76+'/'+_0x4491e8)[_0x43c4('0x1c')](_0x2845f8);}return null;};}function patchUpdates(_0x4f9b26){return function(_0x1af9e6){try{jsonpatch[_0x43c4('0x22')](_0x1af9e6,_0x4f9b26,!![]);}catch(_0x2e1084){return BPromise['reject'](_0x2e1084);}return _0x1af9e6[_0x43c4('0x23')]();};}function saveUpdates(_0x3dcb59,_0x43fd0e){return function(_0x1158b3){if(_0x1158b3){return _0x1158b3[_0x43c4('0x24')](_0x3dcb59)[_0x43c4('0x25')](function(_0x324d11){return _0x324d11;});}return null;};}function removeEntity(_0x2f0f9f,_0x38f110){return function(_0x594580){if(_0x594580){return _0x594580[_0x43c4('0x26')]()[_0x43c4('0x25')](function(){var _0x153664=_0x594580['get']({'plain':!![]});var _0x296900=_0x43c4('0x27');return db[_0x43c4('0x28')]['destroy']({'where':{'type':_0x296900,'resourceId':_0x153664['id']}})['then'](function(){return _0x594580;});})[_0x43c4('0x25')](function(){_0x2f0f9f[_0x43c4('0x1b')](0xcc)[_0x43c4('0x29')]();});}};}function handleEntityNotFound(_0x3a4577,_0x34a500){return function(_0xc4283a){if(!_0xc4283a){_0x3a4577[_0x43c4('0x1a')](0x194);}return _0xc4283a;};}function handleError(_0x30e1ce,_0x33dca9){_0x33dca9=_0x33dca9||0x1f4;return function(_0x38ad2e){logger['error'](_0x38ad2e['stack']);if(_0x38ad2e[_0x43c4('0x2a')]){delete _0x38ad2e[_0x43c4('0x2a')];}_0x30e1ce['status'](_0x33dca9)[_0x43c4('0x2b')](_0x38ad2e);};}exports['index']=function(_0x570e30,_0x2924ae){var _0x3a7f04={},_0x5bbffc={},_0x4a40aa={'count':0x0,'rows':[]};var _0x3a20a2=_[_0x43c4('0x2c')](db[_0x43c4('0x2d')][_0x43c4('0x2e')],function(_0x3ad8b7){return{'name':_0x3ad8b7[_0x43c4('0x2f')],'type':_0x3ad8b7[_0x43c4('0x30')][_0x43c4('0x31')]};});_0x5bbffc[_0x43c4('0x32')]=_[_0x43c4('0x2c')](_0x3a20a2,_0x43c4('0x2a'));_0x5bbffc[_0x43c4('0x33')]=_[_0x43c4('0x34')](_0x570e30[_0x43c4('0x33')]);_0x5bbffc[_0x43c4('0x35')]=_[_0x43c4('0x36')](_0x5bbffc[_0x43c4('0x32')],_0x5bbffc['query']);_0x3a7f04[_0x43c4('0x37')]=_[_0x43c4('0x36')](_0x5bbffc[_0x43c4('0x32')],qs[_0x43c4('0x38')](_0x570e30[_0x43c4('0x33')]['fields']));_0x3a7f04[_0x43c4('0x37')]=_0x3a7f04['attributes'][_0x43c4('0x39')]?_0x3a7f04[_0x43c4('0x37')]:_0x5bbffc[_0x43c4('0x32')];if(!_0x570e30[_0x43c4('0x33')]['hasOwnProperty'](_0x43c4('0x3a'))){_0x3a7f04[_0x43c4('0x1f')]=qs['limit'](_0x570e30[_0x43c4('0x33')]['limit']);_0x3a7f04['offset']=qs[_0x43c4('0x1d')](_0x570e30['query'][_0x43c4('0x1d')]);}_0x3a7f04['order']=qs[_0x43c4('0x3b')](_0x570e30['query'][_0x43c4('0x3b')]);_0x3a7f04['where']=qs[_0x43c4('0x35')](_['pick'](_0x570e30[_0x43c4('0x33')],_0x5bbffc[_0x43c4('0x35')]),_0x3a20a2);if(_0x570e30[_0x43c4('0x33')][_0x43c4('0x3c')]){_0x3a7f04[_0x43c4('0x3d')]=_[_0x43c4('0x3e')](_0x3a7f04[_0x43c4('0x3d')],{'$or':_[_0x43c4('0x2c')](_0x3a20a2,function(_0x17355a){if(_0x17355a[_0x43c4('0x30')]!==_0x43c4('0x3f')){var _0x2d0c07={};_0x2d0c07[_0x17355a[_0x43c4('0x2a')]]={'$like':'%'+_0x570e30['query'][_0x43c4('0x3c')]+'%'};return _0x2d0c07;}})});}_0x3a7f04=_[_0x43c4('0x3e')]({},_0x3a7f04,_0x570e30[_0x43c4('0x40')]);var _0x5a24dd={'where':_0x3a7f04[_0x43c4('0x3d')]};return db[_0x43c4('0x2d')][_0x43c4('0x20')](_0x5a24dd)[_0x43c4('0x25')](function(_0x5f4549){_0x4a40aa['count']=_0x5f4549;if(_0x570e30[_0x43c4('0x33')][_0x43c4('0x41')]){_0x3a7f04[_0x43c4('0x42')]=[{'all':!![]}];}return db['SquareProject'][_0x43c4('0x43')](_0x3a7f04);})[_0x43c4('0x25')](function(_0x3d9b12){_0x4a40aa[_0x43c4('0x44')]=_0x3d9b12;return _0x4a40aa;})[_0x43c4('0x25')](respondWithFilteredResult(_0x2924ae,_0x3a7f04))[_0x43c4('0x45')](handleError(_0x2924ae,null));};exports['show']=function(_0x150bda,_0x23f30c){var _0xa23b70={'raw':![],'where':{'id':_0x150bda[_0x43c4('0x46')]['id']}},_0xfd9c06={};_0xfd9c06[_0x43c4('0x32')]=_[_0x43c4('0x34')](db[_0x43c4('0x2d')][_0x43c4('0x2e')]);_0xfd9c06['query']=_[_0x43c4('0x34')](_0x150bda[_0x43c4('0x33')]);_0xfd9c06[_0x43c4('0x35')]=_[_0x43c4('0x36')](_0xfd9c06[_0x43c4('0x32')],_0xfd9c06[_0x43c4('0x33')]);_0xa23b70['attributes']=_[_0x43c4('0x36')](_0xfd9c06[_0x43c4('0x32')],qs['fields'](_0x150bda[_0x43c4('0x33')]['fields']));_0xa23b70['attributes']=_0xa23b70[_0x43c4('0x37')]['length']?_0xa23b70['attributes']:_0xfd9c06[_0x43c4('0x32')];if(_0x150bda[_0x43c4('0x33')]['includeAll']){_0xa23b70[_0x43c4('0x42')]=[{'all':!![]}];}_0xa23b70=_[_0x43c4('0x3e')]({},_0xa23b70,_0x150bda[_0x43c4('0x40')]);return db[_0x43c4('0x2d')][_0x43c4('0x47')](_0xa23b70)['then'](handleEntityNotFound(_0x23f30c,null))[_0x43c4('0x25')](respondWithResult(_0x23f30c,null))['catch'](handleError(_0x23f30c,null));};exports[_0x43c4('0x48')]=function(_0x44b25e,_0x286597){return db['SquareProject'][_0x43c4('0x48')](_0x44b25e[_0x43c4('0x49')],{})['then'](function(_0x1016b4){var _0x465ae5=_0x44b25e[_0x43c4('0x4a')][_0x43c4('0x4b')]({'plain':!![]});if(!_0x465ae5)throw new Error(_0x43c4('0x4c'));if(_0x465ae5[_0x43c4('0x4d')]===_0x43c4('0x4a')){var _0xac2d62=_0x1016b4[_0x43c4('0x4b')]({'plain':!![]});var _0x5d31e5=_0x43c4('0x27');return db[_0x43c4('0x4e')][_0x43c4('0x47')]({'where':{'name':_0x5d31e5,'userProfileId':_0x465ae5['userProfileId']},'raw':!![]})['then'](function(_0x1c9e39){if(_0x1c9e39&&_0x1c9e39['autoAssociation']===0x0){return db[_0x43c4('0x28')][_0x43c4('0x48')]({'name':_0xac2d62[_0x43c4('0x2a')],'resourceId':_0xac2d62['id'],'type':_0x1c9e39['name'],'sectionId':_0x1c9e39['id']},{})[_0x43c4('0x25')](function(){return _0x1016b4;});}else{return _0x1016b4;}})[_0x43c4('0x45')](function(_0x4818d3){logger[_0x43c4('0x4f')](_0x43c4('0x50'),_0x4818d3);throw _0x4818d3;});}return _0x1016b4;})['then'](respondWithResult(_0x286597,0xc9))[_0x43c4('0x45')](handleError(_0x286597,null));};exports['update']=function(_0x2a5ef2,_0x556b1d){if(_0x2a5ef2[_0x43c4('0x49')]['id']){delete _0x2a5ef2[_0x43c4('0x49')]['id'];}return db[_0x43c4('0x2d')][_0x43c4('0x47')]({'where':{'id':_0x2a5ef2['params']['id']}})['then'](handleEntityNotFound(_0x556b1d,null))[_0x43c4('0x25')](saveUpdates(_0x2a5ef2[_0x43c4('0x49')],null))[_0x43c4('0x25')](respondWithResult(_0x556b1d,null))[_0x43c4('0x45')](handleError(_0x556b1d,null));};exports[_0x43c4('0x26')]=function(_0x22d882,_0x1fd154){return db[_0x43c4('0x2d')]['find']({'where':{'id':_0x22d882['params']['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0x1fd154,null))[_0x43c4('0x25')](removeEntity(_0x1fd154,null))[_0x43c4('0x45')](handleError(_0x1fd154,null));};exports[_0x43c4('0x51')]=function(_0x4e4794,_0x2e9e0e,_0x3a2d52){return db[_0x43c4('0x2d')][_0x43c4('0x47')]({'where':{'id':_0x4e4794[_0x43c4('0x46')]['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0x2e9e0e,null))[_0x43c4('0x25')](function(_0x596168){if(_0x596168){return _0x596168[_0x43c4('0x51')](_0x4e4794[_0x43c4('0x49')][_0x43c4('0x52')],_[_0x43c4('0x53')](_0x4e4794[_0x43c4('0x49')],[_0x43c4('0x52'),'id'])||{});}})[_0x43c4('0x25')](respondWithResult(_0x2e9e0e,null))['catch'](handleError(_0x2e9e0e,null));};exports['removeUsers']=function(_0x22fd52,_0xc876a0,_0x3bc435){return db[_0x43c4('0x2d')][_0x43c4('0x47')]({'where':{'id':_0x22fd52[_0x43c4('0x46')]['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0xc876a0,null))[_0x43c4('0x25')](function(_0x29399d){if(_0x29399d){return _0x29399d[_0x43c4('0x54')](_0x22fd52[_0x43c4('0x33')]['ids'])['then'](function(){if(_[_0x43c4('0x55')](_0x22fd52[_0x43c4('0x33')]['ids'])){for(var _0x2479df=0x0;_0x2479df<_0x22fd52[_0x43c4('0x33')][_0x43c4('0x52')][_0x43c4('0x39')];_0x2479df+=0x1){socket['emit'](_0x43c4('0x56'),{'UserId':Number(_0x22fd52[_0x43c4('0x33')][_0x43c4('0x52')][_0x2479df]),'SquareProjectId':Number(_0x22fd52['params']['id'])});}}else{socket['emit'](_0x43c4('0x56'),{'UserId':Number(_0x22fd52[_0x43c4('0x33')][_0x43c4('0x52')]),'SquareProjectId':Number(_0x22fd52[_0x43c4('0x46')]['id'])});}});}})[_0x43c4('0x25')](respondWithStatusCode(_0xc876a0,null))[_0x43c4('0x45')](handleError(_0xc876a0,null));};exports[_0x43c4('0x57')]=function(_0x2f5ad3,_0x355ffa,_0x283f1f){var _0x2edf97={};var _0x83570f={};var _0x3f7cf6;var _0x2b9901;return db[_0x43c4('0x2d')][_0x43c4('0x58')]({'where':{'id':_0x2f5ad3['params']['id']}})[_0x43c4('0x25')](handleEntityNotFound(_0x355ffa,null))[_0x43c4('0x25')](function(_0x3b570c){if(_0x3b570c){_0x3f7cf6=_0x3b570c;_0x83570f[_0x43c4('0x32')]=_[_0x43c4('0x34')](db[_0x43c4('0x59')][_0x43c4('0x2e')]);_0x83570f[_0x43c4('0x33')]=_[_0x43c4('0x34')](_0x2f5ad3[_0x43c4('0x33')]);_0x83570f[_0x43c4('0x35')]=_[_0x43c4('0x36')](_0x83570f[_0x43c4('0x32')],_0x83570f[_0x43c4('0x33')]);_0x2edf97[_0x43c4('0x37')]=_['intersection'](_0x83570f[_0x43c4('0x32')],qs[_0x43c4('0x38')](_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x38')]));_0x2edf97[_0x43c4('0x37')]=_0x2edf97[_0x43c4('0x37')][_0x43c4('0x39')]?_0x2edf97[_0x43c4('0x37')]:_0x83570f[_0x43c4('0x32')];_0x2edf97['order']=qs[_0x43c4('0x3b')](_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x3b')]);_0x2edf97['where']=qs[_0x43c4('0x35')](_[_0x43c4('0x5a')](_0x2f5ad3[_0x43c4('0x33')],_0x83570f[_0x43c4('0x35')]));if(_0x2f5ad3[_0x43c4('0x33')]['filter']){_0x2edf97[_0x43c4('0x3d')]=_[_0x43c4('0x3e')](_0x2edf97[_0x43c4('0x3d')],{'$or':_[_0x43c4('0x2c')](_0x2edf97[_0x43c4('0x37')],function(_0x20454a){var _0x5ed800={};_0x5ed800[_0x20454a]={'$like':'%'+_0x2f5ad3['query'][_0x43c4('0x3c')]+'%'};return _0x5ed800;})});}_0x2edf97=_[_0x43c4('0x3e')]({},_0x2edf97,_0x2f5ad3['options']);return _0x3f7cf6[_0x43c4('0x57')](_0x2edf97);}})['then'](function(_0x3c256c){if(_0x3c256c){_0x2b9901=_0x3c256c[_0x43c4('0x39')];if(!_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x5b')](_0x43c4('0x3a'))){_0x2edf97[_0x43c4('0x1f')]=qs['limit'](_0x2f5ad3['query']['limit']);_0x2edf97[_0x43c4('0x1d')]=qs['offset'](_0x2f5ad3[_0x43c4('0x33')][_0x43c4('0x1d')]);}return _0x3f7cf6[_0x43c4('0x57')](_0x2edf97);}})[_0x43c4('0x25')](function(_0x49f320){if(_0x49f320){return _0x49f320?{'count':_0x2b9901,'rows':_0x49f320}:null;}})[_0x43c4('0x25')](respondWithResult(_0x355ffa,null))[_0x43c4('0x45')](handleError(_0x355ffa,null));};
\ No newline at end of file
index 62cfa8a..2c79e7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e4d=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e4d,0x14d));var _0xd6e4=function(_0x10ad02,_0x57676d){_0x10ad02=_0x10ad02-0x0;var _0x4581b8=_0x6e4d[_0x10ad02];return _0x4581b8;};'use strict';var EventEmitter=require(_0xd6e4('0x0'));var SquareProject=require(_0xd6e4('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd6e4('0x2')](0x0);var events={'afterCreate':_0xd6e4('0x3'),'afterUpdate':_0xd6e4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x485ff2){return function(_0x4b48d7,_0x42150f,_0x4da017){SquareProjectEvents[_0xd6e4('0x5')](_0x485ff2+':'+_0x4b48d7['id'],_0x4b48d7);SquareProjectEvents['emit'](_0x485ff2,_0x4b48d7);_0x4da017(null);};}for(var e in events){if(events[_0xd6e4('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xd6e4('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0x9921=['SquareProject','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x9921,0xd6));var _0x1992=function(_0x5138e2,_0x53f9cf){_0x5138e2=_0x5138e2-0x0;var _0x3d0c0a=_0x9921[_0x5138e2];return _0x3d0c0a;};'use strict';var EventEmitter=require(_0x1992('0x0'));var SquareProject=require(_0x1992('0x1'))['db'][_0x1992('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1992('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1992('0x4'),'afterDestroy':_0x1992('0x5')};function emitEvent(_0x2c4111){return function(_0x1d6a02,_0x42d7de,_0x31c0f3){SquareProjectEvents[_0x1992('0x6')](_0x2c4111+':'+_0x1d6a02['id'],_0x1d6a02);SquareProjectEvents['emit'](_0x2c4111,_0x1d6a02);_0x31c0f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x1992('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
index 0e0334c..6312abf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf23b=['define','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','api','moment','request-promise','path','rimraf','./squareProject.attributes','exports'];(function(_0x1c1709,_0x51806b){var _0x4e9693=function(_0x5483c9){while(--_0x5483c9){_0x1c1709['push'](_0x1c1709['shift']());}};_0x4e9693(++_0x51806b);}(_0xf23b,0x1d9));var _0xbf23=function(_0xdbda53,_0x12908c){_0xdbda53=_0xdbda53-0x0;var _0x23c8bd=_0xf23b[_0xdbda53];return _0x23c8bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbf23('0x0'));var moment=require(_0xbf23('0x1'));var BPromise=require('bluebird');var rp=require(_0xbf23('0x2'));var fs=require('fs');var path=require(_0xbf23('0x3'));var rimraf=require(_0xbf23('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf23('0x5'));module[_0xbf23('0x6')]=function(_0x222c87,_0x376346){return _0x222c87[_0xbf23('0x7')]('SquareProject',attributes,{'tableName':_0xbf23('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20f87a,_0xa2b3ce,_0x39ba6d){if(_0x20f87a[_0xbf23('0x9')](_0xbf23('0xa'))){_0x20f87a['savedAt']=moment()[_0xbf23('0xb')](_0xbf23('0xc'));}if(_0x20f87a[_0xbf23('0x9')](_0xbf23('0xd'))){_0x20f87a[_0xbf23('0xe')]=moment()[_0xbf23('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x39ba6d(null,_0x20f87a);}}});};
\ No newline at end of file
+var _0xe7f0=['format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','preproduction','savedAt'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xe7f0,0x183));var _0x0e7f=function(_0x885eff,_0x555809){_0x885eff=_0x885eff-0x0;var _0x17819f=_0xe7f0[_0x885eff];return _0x17819f;};'use strict';var _=require(_0x0e7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0e7f('0x1'));var moment=require(_0x0e7f('0x2'));var BPromise=require(_0x0e7f('0x3'));var rp=require(_0x0e7f('0x4'));var fs=require('fs');var path=require(_0x0e7f('0x5'));var rimraf=require(_0x0e7f('0x6'));var config=require(_0x0e7f('0x7'));var attributes=require(_0x0e7f('0x8'));module['exports']=function(_0x56e3f1,_0x47200b){return _0x56e3f1[_0x0e7f('0x9')](_0x0e7f('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23424a,_0x2a1d3b,_0x2b9a5c){if(_0x23424a['changed'](_0x0e7f('0xb'))){_0x23424a[_0x0e7f('0xc')]=moment()[_0x0e7f('0xd')](_0x0e7f('0xe'));}if(_0x23424a['changed']('production')){_0x23424a[_0x0e7f('0xf')]=moment()[_0x0e7f('0xd')](_0x0e7f('0xe'));}_0x2b9a5c(null,_0x23424a);}}});};
\ No newline at end of file
index 274fa83..2b9e66d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2502=['register','request','then','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','debug','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0xd63e2d,_0x37884c){var _0x384239=function(_0x4ee532){while(--_0x4ee532){_0xd63e2d['push'](_0xd63e2d['shift']());}};_0x384239(++_0x37884c);}(_0x2502,0x1df));var _0x2250=function(_0x1b0275,_0x3ecc02){_0x1b0275=_0x1b0275-0x0;var _0x43d2db=_0x2502[_0x1b0275];return _0x43d2db;};'use strict';var _=require(_0x2250('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2250('0x1'));var rs=require(_0x2250('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2250('0x3'));var logger=require(_0x2250('0x4'))(_0x2250('0x5'));var config=require('../../config/environment');var jayson=require(_0x2250('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x2250('0x7')]=_[_0x2250('0x8')](config[_0x2250('0x7')],{'host':_0x2250('0x9'),'port':0x18eb});var socket=require(_0x2250('0xa'))(new Redis(config['redis']));require('./squareProject.socket')[_0x2250('0xb')](socket);function respondWithRpcPromise(_0x1a4ba6,_0x272288,_0x2b835d){return new BPromise(function(_0x307ad5,_0x55eb17){return client[_0x2250('0xc')](_0x1a4ba6,_0x2b835d)[_0x2250('0xd')](function(_0x2c2baa){logger[_0x2250('0xe')](_0x2250('0xf'),_0x272288,'request\x20sent');logger['debug'](_0x2250('0x10'),_0x272288,'request\x20sent',JSON[_0x2250('0x11')](_0x2c2baa));if(_0x2c2baa[_0x2250('0x12')]){if(_0x2c2baa[_0x2250('0x12')][_0x2250('0x13')]===0x1f4){logger[_0x2250('0x12')](_0x2250('0xf'),_0x272288,_0x2c2baa[_0x2250('0x12')][_0x2250('0x14')]);return _0x55eb17(_0x2c2baa['error'][_0x2250('0x14')]);}logger['error'](_0x2250('0xf'),_0x272288,_0x2c2baa[_0x2250('0x12')]['message']);return _0x307ad5(_0x2c2baa[_0x2250('0x12')][_0x2250('0x14')]);}else{logger[_0x2250('0xe')](_0x2250('0xf'),_0x272288,_0x2250('0x15'));_0x307ad5(_0x2c2baa[_0x2250('0x16')][_0x2250('0x14')]);}})[_0x2250('0x17')](function(_0x2338ce){logger[_0x2250('0x12')](_0x2250('0xf'),_0x272288,_0x2338ce);_0x55eb17(_0x2338ce);});});}exports[_0x2250('0x18')]=function(_0x14b7c6){var _0x2a8557=this;return new Promise(function(_0x541984,_0x514c2f){return db[_0x2250('0x19')][_0x2250('0x1a')]({'raw':_0x14b7c6[_0x2250('0x1b')]?_0x14b7c6[_0x2250('0x1b')][_0x2250('0x1c')]===undefined?!![]:![]:!![],'where':_0x14b7c6[_0x2250('0x1b')]?_0x14b7c6[_0x2250('0x1b')][_0x2250('0x1d')]||null:null,'attributes':_0x14b7c6['options']?_0x14b7c6[_0x2250('0x1b')][_0x2250('0x1e')]||null:null,'include':_0x14b7c6[_0x2250('0x1b')]?_0x14b7c6[_0x2250('0x1b')][_0x2250('0x1f')]?_[_0x2250('0x20')](_0x14b7c6['options'][_0x2250('0x1f')],function(_0x5406dd){return{'model':db[_0x5406dd[_0x2250('0x21')]],'as':_0x5406dd['as'],'attributes':_0x5406dd[_0x2250('0x1e')],'include':_0x5406dd['include']?_[_0x2250('0x20')](_0x5406dd[_0x2250('0x1f')],function(_0x1b31c1){return{'model':db[_0x1b31c1[_0x2250('0x21')]],'as':_0x1b31c1['as'],'attributes':_0x1b31c1[_0x2250('0x1e')],'include':_0x1b31c1[_0x2250('0x1f')]?_['map'](_0x1b31c1[_0x2250('0x1f')],function(_0x7aebae){return{'model':db[_0x7aebae[_0x2250('0x21')]],'as':_0x7aebae['as'],'attributes':_0x7aebae[_0x2250('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4780b7){logger['info'](_0x2250('0x18'),_0x14b7c6);logger[_0x2250('0x22')](_0x2250('0x18'),_0x14b7c6,JSON[_0x2250('0x11')](_0x4780b7));_0x541984(_0x4780b7);})[_0x2250('0x17')](function(_0x2466a6){logger['error'](_0x2250('0x18'),_0x2466a6[_0x2250('0x14')],_0x14b7c6);_0x514c2f(_0x2a8557['error'](0x1f4,_0x2466a6[_0x2250('0x14')]));});});};
\ No newline at end of file
+var _0x2e41=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','SquareProject,\x20%s,\x20%s','message','catch','ShowSquareProject','SquareProject','options','raw','attributes','include','model','map','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5109a6,_0x305507){var _0x4b9cd5=function(_0x47d104){while(--_0x47d104){_0x5109a6['push'](_0x5109a6['shift']());}};_0x4b9cd5(++_0x305507);}(_0x2e41,0xa4));var _0x12e4=function(_0x21ba22,_0x38908f){_0x21ba22=_0x21ba22-0x0;var _0x997b34=_0x2e41[_0x21ba22];return _0x997b34;};'use strict';var _=require(_0x12e4('0x0'));var util=require(_0x12e4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12e4('0x2'));var fs=require('fs');var Redis=require(_0x12e4('0x3'));var db=require(_0x12e4('0x4'))['db'];var utils=require(_0x12e4('0x5'));var logger=require(_0x12e4('0x6'))(_0x12e4('0x7'));var config=require(_0x12e4('0x8'));var jayson=require(_0x12e4('0x9'));var client=jayson[_0x12e4('0xa')][_0x12e4('0xb')]({'port':0x232a});config['redis']=_[_0x12e4('0xc')](config[_0x12e4('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12e4('0xd')]));require('./squareProject.socket')[_0x12e4('0xe')](socket);function respondWithRpcPromise(_0x39f724,_0x3114e1,_0x36ceee){return new BPromise(function(_0x24773c,_0x32d913){return client[_0x12e4('0xf')](_0x39f724,_0x36ceee)[_0x12e4('0x10')](function(_0xdb9707){logger[_0x12e4('0x11')]('SquareProject,\x20%s,\x20%s',_0x3114e1,_0x12e4('0x12'));logger[_0x12e4('0x13')](_0x12e4('0x14'),_0x3114e1,_0x12e4('0x12'),JSON[_0x12e4('0x15')](_0xdb9707));if(_0xdb9707['error']){if(_0xdb9707[_0x12e4('0x16')]['code']===0x1f4){logger[_0x12e4('0x16')](_0x12e4('0x17'),_0x3114e1,_0xdb9707[_0x12e4('0x16')]['message']);return _0x32d913(_0xdb9707[_0x12e4('0x16')]['message']);}logger[_0x12e4('0x16')](_0x12e4('0x17'),_0x3114e1,_0xdb9707['error'][_0x12e4('0x18')]);return _0x24773c(_0xdb9707[_0x12e4('0x16')][_0x12e4('0x18')]);}else{logger['info'](_0x12e4('0x17'),_0x3114e1,_0x12e4('0x12'));_0x24773c(_0xdb9707['result'][_0x12e4('0x18')]);}})[_0x12e4('0x19')](function(_0x5e1221){logger[_0x12e4('0x16')]('SquareProject,\x20%s,\x20%s',_0x3114e1,_0x5e1221);_0x32d913(_0x5e1221);});});}exports[_0x12e4('0x1a')]=function(_0x3529be){var _0x1df21e=this;return new Promise(function(_0x3d092a,_0x2e05e8){return db[_0x12e4('0x1b')]['find']({'raw':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1d')]===undefined?!![]:![]:!![],'where':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')]['where']||null:null,'attributes':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1e')]||null:null,'include':_0x3529be[_0x12e4('0x1c')]?_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1f')]?_['map'](_0x3529be[_0x12e4('0x1c')][_0x12e4('0x1f')],function(_0xca6409){return{'model':db[_0xca6409[_0x12e4('0x20')]],'as':_0xca6409['as'],'attributes':_0xca6409['attributes'],'include':_0xca6409['include']?_[_0x12e4('0x21')](_0xca6409[_0x12e4('0x1f')],function(_0x10daa7){return{'model':db[_0x10daa7['model']],'as':_0x10daa7['as'],'attributes':_0x10daa7[_0x12e4('0x1e')],'include':_0x10daa7['include']?_[_0x12e4('0x21')](_0x10daa7['include'],function(_0x7c48be){return{'model':db[_0x7c48be[_0x12e4('0x20')]],'as':_0x7c48be['as'],'attributes':_0x7c48be[_0x12e4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x12e4('0x10')](function(_0x2ab7d4){logger[_0x12e4('0x11')]('ShowSquareProject',_0x3529be);logger[_0x12e4('0x13')](_0x12e4('0x1a'),_0x3529be,JSON[_0x12e4('0x15')](_0x2ab7d4));_0x3d092a(_0x2ab7d4);})[_0x12e4('0x19')](function(_0x49e647){logger[_0x12e4('0x16')](_0x12e4('0x1a'),_0x49e647[_0x12e4('0x18')],_0x3529be);_0x2e05e8(_0x1df21e[_0x12e4('0x16')](0x1f4,_0x49e647[_0x12e4('0x18')]));});});};
\ No newline at end of file
index 7cf8d34..20eaa2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207b=['update','emit','removeListener','register','./squareProject.events','remove'];(function(_0x5025b9,_0x40f20c){var _0x349c16=function(_0x5dcac4){while(--_0x5dcac4){_0x5025b9['push'](_0x5025b9['shift']());}};_0x349c16(++_0x40f20c);}(_0x207b,0x16c));var _0xb207=function(_0x6d9e0c,_0x2373bb){_0x6d9e0c=_0x6d9e0c-0x0;var _0x485a1b=_0x207b[_0x6d9e0c];return _0x485a1b;};'use strict';var SquareProjectEvents=require(_0xb207('0x0'));var events=['save',_0xb207('0x1'),_0xb207('0x2')];function createListener(_0x30164e,_0xf7f69f){return function(_0x1694a7){_0xf7f69f[_0xb207('0x3')](_0x30164e,_0x1694a7);};}function removeListener(_0x289110,_0x322783){return function(){SquareProjectEvents[_0xb207('0x4')](_0x289110,_0x322783);};}exports[_0xb207('0x5')]=function(_0x10f372){for(var _0x110afc=0x0,_0x379e13=events['length'];_0x110afc<_0x379e13;_0x110afc++){var _0x1007aa=events[_0x110afc];var _0x3335aa=createListener('squareProject:'+_0x1007aa,_0x10f372);SquareProjectEvents['on'](_0x1007aa,_0x3335aa);}};
\ No newline at end of file
+var _0x92d2=['register','squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0xce4767,_0x1207af){var _0x10f033=function(_0x1c0071){while(--_0x1c0071){_0xce4767['push'](_0xce4767['shift']());}};_0x10f033(++_0x1207af);}(_0x92d2,0xb2));var _0x292d=function(_0x4b8daa,_0x5e911f){_0x4b8daa=_0x4b8daa-0x0;var _0x333ada=_0x92d2[_0x4b8daa];return _0x333ada;};'use strict';var SquareProjectEvents=require(_0x292d('0x0'));var events=[_0x292d('0x1'),_0x292d('0x2'),_0x292d('0x3')];function createListener(_0x319c87,_0x1479d6){return function(_0x4da890){_0x1479d6[_0x292d('0x4')](_0x319c87,_0x4da890);};}function removeListener(_0x467888,_0x3502ca){return function(){SquareProjectEvents[_0x292d('0x5')](_0x467888,_0x3502ca);};}exports[_0x292d('0x6')]=function(_0x565cc0){for(var _0x882574=0x0,_0xbaf91e=events['length'];_0x882574<_0xbaf91e;_0x882574++){var _0x212ab1=events[_0x882574];var _0xd724fe=createListener(_0x292d('0x7')+_0x212ab1,_0x565cc0);SquareProjectEvents['on'](_0x212ab1,_0xd724fe);}};
\ No newline at end of file
index 516f364..e28ed7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x4452a2,_0x4f6464){var _0x274b10=function(_0x32f339){while(--_0x32f339){_0x4452a2['push'](_0x4452a2['shift']());}};_0x274b10(++_0x4f6464);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router;
\ No newline at end of file
+var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x48b3db,_0x365325){var _0x386f4c=function(_0x10044b){while(--_0x10044b){_0x48b3db['push'](_0x48b3db['shift']());}};_0x386f4c(++_0x365325);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router;
\ No newline at end of file
index 3ac1332..b17f82d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x1e14ff,_0x28c782){var _0x10de44=function(_0x21d9aa){while(--_0x21d9aa){_0x1e14ff['push'](_0x1e14ff['shift']());}};_0x10de44(++_0x28c782);}(_0x814b,0x1a2));var _0xb814=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x814b[_0x4a095e];return _0x10ef73;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'callerid':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize[_0xb814('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb814('0x2')]},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'dnid':{'type':Sequelize[_0xb814('0x2')]},'projectName':{'type':Sequelize[_0xb814('0x2')]},'saveName':{'type':Sequelize[_0xb814('0x2')]},'filename':{'type':Sequelize[_0xb814('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb814('0x3')],'get':function(){var _0x2e6272='';var _0x5c8539=this[_0xb814('0x4')](_0xb814('0x5'));if(_0x5c8539){_0x2e6272=_0x5c8539[_0xb814('0x6')](_0x5c8539[_0xb814('0x7')]('.'));}return _0x2e6272;}}};
\ No newline at end of file
+var _0x2675=['getDataValue','savePath','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x392890,_0xb8d3dd){var _0x2b2e30=function(_0x4b355f){while(--_0x4b355f){_0x392890['push'](_0x392890['shift']());}};_0x2b2e30(++_0xb8d3dd);}(_0x2675,0x75));var _0x5267=function(_0x24a55a,_0x2772f2){_0x24a55a=_0x24a55a-0x0;var _0x53c78b=_0x2675[_0x24a55a];return _0x53c78b;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5267('0x1')]},'context':{'type':Sequelize[_0x5267('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5267('0x1')]},'accountcode':{'type':Sequelize[_0x5267('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x5267('0x1')]},'saveName':{'type':Sequelize[_0x5267('0x1')]},'filename':{'type':Sequelize[_0x5267('0x1')]},'savePath':{'type':Sequelize[_0x5267('0x1')]},'format':{'type':Sequelize[_0x5267('0x2')],'get':function(){var _0xc56cd5='';var _0x527c16=this[_0x5267('0x3')](_0x5267('0x4'));if(_0x527c16){_0xc56cd5=_0x527c16['substring'](_0x527c16[_0x5267('0x5')]('.'));}return _0xc56cd5;}}};
\ No newline at end of file
index 7ff3a6a..d5c4215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7647=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','name','send','index','SquareRecording','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','update','uniqueid','filename','savePath','%s.cypher','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','end','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','fs-extra','squel','crypto'];(function(_0x4cc20a,_0x5e6ac0){var _0x249381=function(_0x3a3d01){while(--_0x3a3d01){_0x4cc20a['push'](_0x4cc20a['shift']());}};_0x249381(++_0x5e6ac0);}(_0x7647,0x162));var _0x7764=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7647[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7764('0x0'));var zipdir=require(_0x7764('0x1'));var jsonpatch=require(_0x7764('0x2'));var rp=require(_0x7764('0x3'));var moment=require(_0x7764('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7764('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7764('0x6'));var fs=require('fs');var fs_extra=require(_0x7764('0x7'));var _=require('lodash');var squel=require(_0x7764('0x8'));var crypto=require(_0x7764('0x9'));var jsforce=require(_0x7764('0xa'));var deskjs=require(_0x7764('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7764('0xc'));var Papa=require(_0x7764('0xd'));var Redis=require(_0x7764('0xe'));var authService=require(_0x7764('0xf'));var qs=require(_0x7764('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7764('0x11'));var utils=require(_0x7764('0x12'));var config=require(_0x7764('0x13'));var licenseUtil=require(_0x7764('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b2709,_0x2df181){_0x2df181=_0x2df181||0xcc;return function(_0x4495e9){if(_0x4495e9){return _0x1b2709[_0x7764('0x15')](_0x2df181);}return _0x1b2709[_0x7764('0x16')](_0x2df181)['end']();};}function respondWithResult(_0xfe3947,_0x56acb1){_0x56acb1=_0x56acb1||0xc8;return function(_0x2ccebb){if(_0x2ccebb){return _0xfe3947['status'](_0x56acb1)[_0x7764('0x17')](_0x2ccebb);}};}function respondWithFilteredResult(_0x41d0b5,_0x3b47c1){return function(_0x15d947){if(_0x15d947){var _0x29c57c=typeof _0x3b47c1[_0x7764('0x18')]===_0x7764('0x19')&&typeof _0x3b47c1[_0x7764('0x1a')]===_0x7764('0x19');var _0x4b9d94=_0x15d947[_0x7764('0x1b')];var _0x4d8cdc=_0x29c57c?0x0:_0x3b47c1[_0x7764('0x18')];var _0x58dc90=_0x29c57c?_0x15d947[_0x7764('0x1b')]:_0x3b47c1[_0x7764('0x18')]+_0x3b47c1[_0x7764('0x1a')];var _0x394049;if(_0x58dc90>=_0x4b9d94){_0x58dc90=_0x4b9d94;_0x394049=0xc8;}else{_0x394049=0xce;}_0x41d0b5[_0x7764('0x16')](_0x394049);return _0x41d0b5[_0x7764('0x1c')]('Content-Range',_0x4d8cdc+'-'+_0x58dc90+'/'+_0x4b9d94)['json'](_0x15d947);}return null;};}function patchUpdates(_0xfe053d){return function(_0x23fb20){try{jsonpatch[_0x7764('0x1d')](_0x23fb20,_0xfe053d,!![]);}catch(_0x59c0f5){return BPromise[_0x7764('0x1e')](_0x59c0f5);}return _0x23fb20[_0x7764('0x1f')]();};}function saveUpdates(_0x2bd66e,_0x41798c){return function(_0x33aad6){if(_0x33aad6){return _0x33aad6['update'](_0x2bd66e)[_0x7764('0x20')](function(_0x196b0d){return _0x196b0d;});}return null;};}function removeEntity(_0x29b645,_0x103831){return function(_0x32f043){if(_0x32f043){return _0x32f043[_0x7764('0x21')]()['then'](function(){_0x29b645['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19fcfe,_0x5645f7){return function(_0x5029dd){if(!_0x5029dd){_0x19fcfe['sendStatus'](0x194);}return _0x5029dd;};}function handleError(_0x669404,_0x2c2c42){_0x2c2c42=_0x2c2c42||0x1f4;return function(_0x37968e){logger[_0x7764('0x22')](_0x37968e['stack']);if(_0x37968e['name']){delete _0x37968e[_0x7764('0x23')];}_0x669404[_0x7764('0x16')](_0x2c2c42)[_0x7764('0x24')](_0x37968e);};}exports[_0x7764('0x25')]=function(_0x516554,_0x4d8885){var _0x44562f={},_0x15f326={},_0x3ea598={'count':0x0,'rows':[]};var _0x39db64=_['map'](db[_0x7764('0x26')]['rawAttributes'],function(_0x335044){return{'name':_0x335044['fieldName'],'type':_0x335044['type']['key']};});_0x15f326[_0x7764('0x27')]=_['map'](_0x39db64,_0x7764('0x23'));_0x15f326[_0x7764('0x28')]=_[_0x7764('0x29')](_0x516554[_0x7764('0x28')]);_0x15f326['filters']=_['intersection'](_0x15f326[_0x7764('0x27')],_0x15f326[_0x7764('0x28')]);_0x44562f[_0x7764('0x2a')]=_[_0x7764('0x2b')](_0x15f326[_0x7764('0x27')],qs[_0x7764('0x2c')](_0x516554[_0x7764('0x28')]['fields']));_0x44562f[_0x7764('0x2a')]=_0x44562f[_0x7764('0x2a')][_0x7764('0x2d')]?_0x44562f[_0x7764('0x2a')]:_0x15f326[_0x7764('0x27')];if(!_0x516554[_0x7764('0x28')][_0x7764('0x2e')](_0x7764('0x2f'))){_0x44562f[_0x7764('0x1a')]=qs[_0x7764('0x1a')](_0x516554[_0x7764('0x28')][_0x7764('0x1a')]);_0x44562f[_0x7764('0x18')]=qs[_0x7764('0x18')](_0x516554[_0x7764('0x28')][_0x7764('0x18')]);}_0x44562f[_0x7764('0x30')]=qs[_0x7764('0x31')](_0x516554['query'][_0x7764('0x31')]);_0x44562f[_0x7764('0x32')]=qs['filters'](_[_0x7764('0x33')](_0x516554['query'],_0x15f326[_0x7764('0x34')]),_0x39db64);if(_0x516554['query'][_0x7764('0x35')]){_0x44562f[_0x7764('0x32')]=_[_0x7764('0x36')](_0x44562f[_0x7764('0x32')],{'$or':_[_0x7764('0x37')](_0x39db64,function(_0x1a90e9){if(_0x1a90e9[_0x7764('0x38')]!==_0x7764('0x39')){var _0x26a854={};_0x26a854[_0x1a90e9[_0x7764('0x23')]]={'$like':'%'+_0x516554['query']['filter']+'%'};return _0x26a854;}})});}_0x44562f=_[_0x7764('0x36')]({},_0x44562f,_0x516554[_0x7764('0x3a')]);var _0x5f4e17={'where':_0x44562f[_0x7764('0x32')]};return db[_0x7764('0x26')]['count'](_0x5f4e17)[_0x7764('0x20')](function(_0xedeb46){_0x3ea598[_0x7764('0x1b')]=_0xedeb46;if(_0x516554[_0x7764('0x28')][_0x7764('0x3b')]){_0x44562f[_0x7764('0x3c')]=[{'all':!![]}];}return db['SquareRecording'][_0x7764('0x3d')](_0x44562f);})[_0x7764('0x20')](function(_0x22334f){_0x3ea598[_0x7764('0x3e')]=_0x22334f;return _0x3ea598;})['then'](respondWithFilteredResult(_0x4d8885,_0x44562f))[_0x7764('0x3f')](handleError(_0x4d8885,null));};exports[_0x7764('0x40')]=function(_0xa8b60e,_0x302433){var _0x3b1e75={'raw':!![],'where':{'id':_0xa8b60e[_0x7764('0x41')]['id']}},_0x5df25c={};_0x5df25c[_0x7764('0x27')]=_['keys'](db[_0x7764('0x26')][_0x7764('0x42')]);_0x5df25c['query']=_[_0x7764('0x29')](_0xa8b60e[_0x7764('0x28')]);_0x5df25c['filters']=_[_0x7764('0x2b')](_0x5df25c['model'],_0x5df25c[_0x7764('0x28')]);_0x3b1e75[_0x7764('0x2a')]=_[_0x7764('0x2b')](_0x5df25c['model'],qs['fields'](_0xa8b60e[_0x7764('0x28')]['fields']));_0x3b1e75['attributes']=_0x3b1e75[_0x7764('0x2a')][_0x7764('0x2d')]?_0x3b1e75[_0x7764('0x2a')]:_0x5df25c[_0x7764('0x27')];if(_0xa8b60e['query'][_0x7764('0x3b')]){_0x3b1e75[_0x7764('0x3c')]=[{'all':!![]}];}_0x3b1e75=_[_0x7764('0x36')]({},_0x3b1e75,_0xa8b60e[_0x7764('0x3a')]);return db['SquareRecording'][_0x7764('0x43')](_0x3b1e75)[_0x7764('0x20')](handleEntityNotFound(_0x302433,null))[_0x7764('0x20')](respondWithResult(_0x302433,null))[_0x7764('0x3f')](handleError(_0x302433,null));};exports['create']=function(_0x2f7d78,_0x5b6334){return db[_0x7764('0x26')]['create'](_0x2f7d78[_0x7764('0x44')],{})[_0x7764('0x20')](respondWithResult(_0x5b6334,0xc9))[_0x7764('0x3f')](handleError(_0x5b6334,null));};exports[_0x7764('0x45')]=function(_0x5ec4be,_0x1f66a5){if(_0x5ec4be['body']['id']){delete _0x5ec4be[_0x7764('0x44')]['id'];}return db[_0x7764('0x26')][_0x7764('0x43')]({'where':{'id':_0x5ec4be['params']['id']}})[_0x7764('0x20')](handleEntityNotFound(_0x1f66a5,null))[_0x7764('0x20')](saveUpdates(_0x5ec4be[_0x7764('0x44')],null))[_0x7764('0x20')](respondWithResult(_0x1f66a5,null))[_0x7764('0x3f')](handleError(_0x1f66a5,null));};exports['download']=function(_0x302a9a,_0x3e218c,_0x4b867b){var _0x8696bf=require('../../components/encryptor');var _0x33e2e7=![];var _0x319655={};if(_0x302a9a[_0x7764('0x28')]['type']&&_0x302a9a[_0x7764('0x28')][_0x7764('0x38')]==='uniqueid'){_0x319655[_0x7764('0x46')]=_0x302a9a[_0x7764('0x41')]['id'];}else{_0x319655['id']=_0x302a9a[_0x7764('0x41')]['id'];}return db[_0x7764('0x26')][_0x7764('0x43')]({'where':_0x319655,'attributes':['id','savePath',_0x7764('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x3e218c,null))[_0x7764('0x20')](function(_0x195089){if(_0x195089){var _0x5028ff=_0x195089[_0x7764('0x48')];var _0x5b6865=util['format'](_0x7764('0x49'),_0x5028ff);if(fs[_0x7764('0x4a')](_0x5b6865)){_0x33e2e7=!![];return _0x8696bf['decryptFile'](_0x5b6865,_0x5028ff,config[_0x7764('0x4b')][_0x7764('0x4c')])[_0x7764('0x20')](function(){return _0x195089;});}return _0x195089;}})[_0x7764('0x20')](function(_0x45e3b2){if(_0x45e3b2){var _0x1fbd3c=_0x45e3b2[_0x7764('0x48')];if(!fs[_0x7764('0x4a')](_0x1fbd3c)){throw new db[(_0x7764('0x4d'))]['ValidationError'](_0x7764('0x4e'));}if(_0x45e3b2[_0x7764('0x47')]){return _0x3e218c[_0x7764('0x4f')](_0x1fbd3c,_0x45e3b2['filename']+path[_0x7764('0x50')](_0x1fbd3c),function(){if(_0x33e2e7){fs[_0x7764('0x51')](_0x1fbd3c);}});}else{return _0x3e218c[_0x7764('0x4f')](_0x1fbd3c,function(_0x4c9df8){if(_0x33e2e7){fs[_0x7764('0x51')](_0x1fbd3c);}});}}})['catch'](function(_0x456d65){if(_0x456d65[_0x7764('0x52')]===_0x7764('0x4e')){_0x3e218c[_0x7764('0x16')](0x194)['send'](_0x7764('0x53'));}else{return handleError(_0x3e218c,null);}});};exports['destroy']=function(_0x4a0895,_0x104f63){return db[_0x7764('0x26')][_0x7764('0x43')]({'where':{'id':_0x4a0895[_0x7764('0x41')]['id']}})['then'](function(_0x5877a8){if(_['isNil'](_0x5877a8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5877a8;})[_0x7764('0x20')](function(_0x27cf51){var _0x2a9b3c=_0x27cf51['savePath'];logger['info'](_0x7764('0x54'),_0x2a9b3c);if(!_['isNil'](_0x27cf51['savePath'])&&fs['existsSync'](_0x2a9b3c)){logger['info'](_0x7764('0x55')+_0x2a9b3c+_0x7764('0x56'));fs[_0x7764('0x57')](_0x2a9b3c);}_0x2a9b3c=_0x2a9b3c+_0x7764('0x58');if(!_['isNil'](_0x27cf51['savePath'])&&fs[_0x7764('0x4a')](_0x2a9b3c)){logger[_0x7764('0x59')](_0x7764('0x55')+_0x2a9b3c+_0x7764('0x56'));fs[_0x7764('0x57')](_0x2a9b3c);}return _0x27cf51;})['then'](function(_0x3fd806){if(!_0x3fd806)throw new InternalError();return _0x3fd806['destroy']();})[_0x7764('0x20')](function(){_0x104f63[_0x7764('0x16')](0xcc)[_0x7764('0x5a')]();})[_0x7764('0x3f')](handleError(_0x104f63,null));};
\ No newline at end of file
+var _0x1b25=['stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','create','body','download','../../components/encryptor','uniqueid','find','savePath','%s.cypher','decryptFile','recording','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error'];(function(_0x27f323,_0x2d6212){var _0x557b7b=function(_0x51f28c){while(--_0x51f28c){_0x27f323['push'](_0x27f323['shift']());}};_0x557b7b(++_0x2d6212);}(_0x1b25,0x142));var _0x51b2=function(_0x353f52,_0xe40124){_0x353f52=_0x353f52-0x0;var _0x44e3ec=_0x1b25[_0x353f52];return _0x44e3ec;};'use strict';var emlformat=require(_0x51b2('0x0'));var rimraf=require(_0x51b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x51b2('0x2'));var rp=require(_0x51b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51b2('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x51b2('0x5'));var ejs=require(_0x51b2('0x6'));var fs=require('fs');var fs_extra=require(_0x51b2('0x7'));var _=require(_0x51b2('0x8'));var squel=require(_0x51b2('0x9'));var crypto=require(_0x51b2('0xa'));var jsforce=require(_0x51b2('0xb'));var deskjs=require(_0x51b2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x51b2('0xd'));var Papa=require(_0x51b2('0xe'));var Redis=require(_0x51b2('0xf'));var authService=require(_0x51b2('0x10'));var qs=require(_0x51b2('0x11'));var as=require(_0x51b2('0x12'));var hardwareService=require(_0x51b2('0x13'));var logger=require(_0x51b2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x51b2('0x15'));var licenseUtil=require(_0x51b2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13cbb3,_0x1a32ae){_0x1a32ae=_0x1a32ae||0xcc;return function(_0x3d5ed1){if(_0x3d5ed1){return _0x13cbb3[_0x51b2('0x17')](_0x1a32ae);}return _0x13cbb3[_0x51b2('0x18')](_0x1a32ae)[_0x51b2('0x19')]();};}function respondWithResult(_0x4ff00e,_0x4fa509){_0x4fa509=_0x4fa509||0xc8;return function(_0x4a0d2f){if(_0x4a0d2f){return _0x4ff00e[_0x51b2('0x18')](_0x4fa509)[_0x51b2('0x1a')](_0x4a0d2f);}};}function respondWithFilteredResult(_0x25ff5c,_0x3cefc5){return function(_0x5b3aeb){if(_0x5b3aeb){var _0x59cc8a=typeof _0x3cefc5[_0x51b2('0x1b')]===_0x51b2('0x1c')&&typeof _0x3cefc5[_0x51b2('0x1d')]===_0x51b2('0x1c');var _0x11912c=_0x5b3aeb[_0x51b2('0x1e')];var _0x60a3a6=_0x59cc8a?0x0:_0x3cefc5[_0x51b2('0x1b')];var _0x1ebffa=_0x59cc8a?_0x5b3aeb[_0x51b2('0x1e')]:_0x3cefc5[_0x51b2('0x1b')]+_0x3cefc5[_0x51b2('0x1d')];var _0x3a43ac;if(_0x1ebffa>=_0x11912c){_0x1ebffa=_0x11912c;_0x3a43ac=0xc8;}else{_0x3a43ac=0xce;}_0x25ff5c[_0x51b2('0x18')](_0x3a43ac);return _0x25ff5c[_0x51b2('0x1f')](_0x51b2('0x20'),_0x60a3a6+'-'+_0x1ebffa+'/'+_0x11912c)[_0x51b2('0x1a')](_0x5b3aeb);}return null;};}function patchUpdates(_0x52d126){return function(_0x284764){try{jsonpatch['apply'](_0x284764,_0x52d126,!![]);}catch(_0xdb54da){return BPromise['reject'](_0xdb54da);}return _0x284764[_0x51b2('0x21')]();};}function saveUpdates(_0x54b03b,_0x5b9268){return function(_0x4dd0a8){if(_0x4dd0a8){return _0x4dd0a8[_0x51b2('0x22')](_0x54b03b)[_0x51b2('0x23')](function(_0x52bc7e){return _0x52bc7e;});}return null;};}function removeEntity(_0x1e50d6,_0x57ee98){return function(_0x29778e){if(_0x29778e){return _0x29778e[_0x51b2('0x24')]()['then'](function(){_0x1e50d6[_0x51b2('0x18')](0xcc)[_0x51b2('0x19')]();});}};}function handleEntityNotFound(_0x1dcd9d,_0x165bdd){return function(_0x4d0276){if(!_0x4d0276){_0x1dcd9d[_0x51b2('0x17')](0x194);}return _0x4d0276;};}function handleError(_0xf18587,_0x629c32){_0x629c32=_0x629c32||0x1f4;return function(_0x5833db){logger[_0x51b2('0x25')](_0x5833db[_0x51b2('0x26')]);if(_0x5833db[_0x51b2('0x27')]){delete _0x5833db[_0x51b2('0x27')];}_0xf18587[_0x51b2('0x18')](_0x629c32)[_0x51b2('0x28')](_0x5833db);};}exports['index']=function(_0x2305cd,_0x2afae4){var _0xa75a8={},_0x1a6c48={},_0x139393={'count':0x0,'rows':[]};var _0xd68fc7=_[_0x51b2('0x29')](db[_0x51b2('0x2a')][_0x51b2('0x2b')],function(_0x2a533a){return{'name':_0x2a533a[_0x51b2('0x2c')],'type':_0x2a533a[_0x51b2('0x2d')]['key']};});_0x1a6c48[_0x51b2('0x2e')]=_[_0x51b2('0x29')](_0xd68fc7,'name');_0x1a6c48[_0x51b2('0x2f')]=_[_0x51b2('0x30')](_0x2305cd[_0x51b2('0x2f')]);_0x1a6c48[_0x51b2('0x31')]=_[_0x51b2('0x32')](_0x1a6c48[_0x51b2('0x2e')],_0x1a6c48['query']);_0xa75a8[_0x51b2('0x33')]=_['intersection'](_0x1a6c48[_0x51b2('0x2e')],qs[_0x51b2('0x34')](_0x2305cd[_0x51b2('0x2f')]['fields']));_0xa75a8[_0x51b2('0x33')]=_0xa75a8['attributes'][_0x51b2('0x35')]?_0xa75a8[_0x51b2('0x33')]:_0x1a6c48[_0x51b2('0x2e')];if(!_0x2305cd[_0x51b2('0x2f')][_0x51b2('0x36')]('nolimit')){_0xa75a8[_0x51b2('0x1d')]=qs['limit'](_0x2305cd[_0x51b2('0x2f')][_0x51b2('0x1d')]);_0xa75a8[_0x51b2('0x1b')]=qs[_0x51b2('0x1b')](_0x2305cd['query'][_0x51b2('0x1b')]);}_0xa75a8['order']=qs[_0x51b2('0x37')](_0x2305cd[_0x51b2('0x2f')]['sort']);_0xa75a8[_0x51b2('0x38')]=qs['filters'](_['pick'](_0x2305cd[_0x51b2('0x2f')],_0x1a6c48['filters']),_0xd68fc7);if(_0x2305cd[_0x51b2('0x2f')]['filter']){_0xa75a8[_0x51b2('0x38')]=_[_0x51b2('0x39')](_0xa75a8[_0x51b2('0x38')],{'$or':_[_0x51b2('0x29')](_0xd68fc7,function(_0x4d25fa){if(_0x4d25fa[_0x51b2('0x2d')]!==_0x51b2('0x3a')){var _0x835c12={};_0x835c12[_0x4d25fa[_0x51b2('0x27')]]={'$like':'%'+_0x2305cd['query'][_0x51b2('0x3b')]+'%'};return _0x835c12;}})});}_0xa75a8=_[_0x51b2('0x39')]({},_0xa75a8,_0x2305cd['options']);var _0x50eb32={'where':_0xa75a8[_0x51b2('0x38')]};return db[_0x51b2('0x2a')]['count'](_0x50eb32)[_0x51b2('0x23')](function(_0x4df5d3){_0x139393[_0x51b2('0x1e')]=_0x4df5d3;if(_0x2305cd[_0x51b2('0x2f')][_0x51b2('0x3c')]){_0xa75a8[_0x51b2('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0x51b2('0x3e')](_0xa75a8);})[_0x51b2('0x23')](function(_0xad3907){_0x139393[_0x51b2('0x3f')]=_0xad3907;return _0x139393;})[_0x51b2('0x23')](respondWithFilteredResult(_0x2afae4,_0xa75a8))[_0x51b2('0x40')](handleError(_0x2afae4,null));};exports[_0x51b2('0x41')]=function(_0x4dedf0,_0x35d71b){var _0x461b9e={'raw':!![],'where':{'id':_0x4dedf0[_0x51b2('0x42')]['id']}},_0x315fc3={};_0x315fc3[_0x51b2('0x2e')]=_[_0x51b2('0x30')](db[_0x51b2('0x2a')]['rawAttributes']);_0x315fc3[_0x51b2('0x2f')]=_[_0x51b2('0x30')](_0x4dedf0[_0x51b2('0x2f')]);_0x315fc3[_0x51b2('0x31')]=_[_0x51b2('0x32')](_0x315fc3[_0x51b2('0x2e')],_0x315fc3[_0x51b2('0x2f')]);_0x461b9e[_0x51b2('0x33')]=_[_0x51b2('0x32')](_0x315fc3[_0x51b2('0x2e')],qs[_0x51b2('0x34')](_0x4dedf0['query'][_0x51b2('0x34')]));_0x461b9e[_0x51b2('0x33')]=_0x461b9e[_0x51b2('0x33')][_0x51b2('0x35')]?_0x461b9e[_0x51b2('0x33')]:_0x315fc3[_0x51b2('0x2e')];if(_0x4dedf0[_0x51b2('0x2f')]['includeAll']){_0x461b9e[_0x51b2('0x3d')]=[{'all':!![]}];}_0x461b9e=_['merge']({},_0x461b9e,_0x4dedf0['options']);return db[_0x51b2('0x2a')]['find'](_0x461b9e)[_0x51b2('0x23')](handleEntityNotFound(_0x35d71b,null))[_0x51b2('0x23')](respondWithResult(_0x35d71b,null))[_0x51b2('0x40')](handleError(_0x35d71b,null));};exports[_0x51b2('0x43')]=function(_0x24a662,_0xb64234){return db['SquareRecording']['create'](_0x24a662[_0x51b2('0x44')],{})[_0x51b2('0x23')](respondWithResult(_0xb64234,0xc9))[_0x51b2('0x40')](handleError(_0xb64234,null));};exports[_0x51b2('0x22')]=function(_0xc3abf,_0x25d23d){if(_0xc3abf[_0x51b2('0x44')]['id']){delete _0xc3abf[_0x51b2('0x44')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0xc3abf['params']['id']}})['then'](handleEntityNotFound(_0x25d23d,null))['then'](saveUpdates(_0xc3abf['body'],null))[_0x51b2('0x23')](respondWithResult(_0x25d23d,null))[_0x51b2('0x40')](handleError(_0x25d23d,null));};exports[_0x51b2('0x45')]=function(_0x5dcecb,_0x1ea6b5,_0xf6a43b){var _0x10bff2=require(_0x51b2('0x46'));var _0x29e821=![];var _0x558d13={};if(_0x5dcecb[_0x51b2('0x2f')][_0x51b2('0x2d')]&&_0x5dcecb[_0x51b2('0x2f')]['type']===_0x51b2('0x47')){_0x558d13['uniqueid']=_0x5dcecb[_0x51b2('0x42')]['id'];}else{_0x558d13['id']=_0x5dcecb[_0x51b2('0x42')]['id'];}return db['SquareRecording'][_0x51b2('0x48')]({'where':_0x558d13,'attributes':['id',_0x51b2('0x49'),'filename'],'raw':!![]})[_0x51b2('0x23')](handleEntityNotFound(_0x1ea6b5,null))['then'](function(_0x460b73){if(_0x460b73){var _0x4bae44=_0x460b73['savePath'];var _0x1b9092=util['format'](_0x51b2('0x4a'),_0x4bae44);if(fs['existsSync'](_0x1b9092)){_0x29e821=!![];return _0x10bff2[_0x51b2('0x4b')](_0x1b9092,_0x4bae44,config['secrets'][_0x51b2('0x4c')])[_0x51b2('0x23')](function(){return _0x460b73;});}return _0x460b73;}})[_0x51b2('0x23')](function(_0x99ceb8){if(_0x99ceb8){var _0x92de07=_0x99ceb8[_0x51b2('0x49')];if(!fs['existsSync'](_0x92de07)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x99ceb8[_0x51b2('0x4d')]){return _0x1ea6b5['download'](_0x92de07,_0x99ceb8[_0x51b2('0x4d')]+path[_0x51b2('0x4e')](_0x92de07),function(){if(_0x29e821){fs[_0x51b2('0x4f')](_0x92de07);}});}else{return _0x1ea6b5[_0x51b2('0x45')](_0x92de07,function(_0x12700b){if(_0x29e821){fs['unlink'](_0x92de07);}});}}})[_0x51b2('0x40')](function(_0x313443){if(_0x313443[_0x51b2('0x50')]==='SquareRecording\x20not\x20found'){_0x1ea6b5['status'](0x194)[_0x51b2('0x28')](_0x51b2('0x51'));}else{return handleError(_0x1ea6b5,null);}});};exports['destroy']=function(_0x229663,_0x305a6c){return db['SquareRecording'][_0x51b2('0x48')]({'where':{'id':_0x229663[_0x51b2('0x42')]['id']}})['then'](function(_0x3764bd){if(_[_0x51b2('0x52')](_0x3764bd)){throw new ReferenceError(_0x51b2('0x53'));}return _0x3764bd;})[_0x51b2('0x23')](function(_0x7e0310){var _0x2c0b93=_0x7e0310[_0x51b2('0x49')];logger[_0x51b2('0x54')](_0x51b2('0x55'),_0x2c0b93);if(!_['isNil'](_0x7e0310[_0x51b2('0x49')])&&fs[_0x51b2('0x56')](_0x2c0b93)){logger[_0x51b2('0x54')]('File:\x20\x22'+_0x2c0b93+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x51b2('0x57')](_0x2c0b93);}_0x2c0b93=_0x2c0b93+_0x51b2('0x58');if(!_[_0x51b2('0x52')](_0x7e0310[_0x51b2('0x49')])&&fs[_0x51b2('0x56')](_0x2c0b93)){logger[_0x51b2('0x54')]('File:\x20\x22'+_0x2c0b93+_0x51b2('0x59'));fs[_0x51b2('0x57')](_0x2c0b93);}return _0x7e0310;})[_0x51b2('0x23')](function(_0x306c42){if(!_0x306c42)throw new InternalError();return _0x306c42['destroy']();})[_0x51b2('0x23')](function(){_0x305a6c['status'](0xcc)[_0x51b2('0x19')]();})[_0x51b2('0x40')](handleError(_0x305a6c,null));};
\ No newline at end of file
index cb7d036..d5d5078 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x631c=['api','moment','request-promise','path','rimraf','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util'];(function(_0x415ece,_0x4d71ff){var _0x5f0744=function(_0x2a0f0a){while(--_0x2a0f0a){_0x415ece['push'](_0x415ece['shift']());}};_0x5f0744(++_0x4d71ff);}(_0x631c,0x1b6));var _0xc631=function(_0x1ddfb4,_0x294a1b){_0x1ddfb4=_0x1ddfb4-0x0;var _0x2fd972=_0x631c[_0x1ddfb4];return _0x2fd972;};'use strict';var _=require(_0xc631('0x0'));var util=require(_0xc631('0x1'));var logger=require('../../config/logger')(_0xc631('0x2'));var moment=require(_0xc631('0x3'));var BPromise=require('bluebird');var rp=require(_0xc631('0x4'));var fs=require('fs');var path=require(_0xc631('0x5'));var rimraf=require(_0xc631('0x6'));var config=require('../../config/environment');var attributes=require(_0xc631('0x7'));module[_0xc631('0x8')]=function(_0x5221e6,_0x278ad2){return _0x5221e6['define'](_0xc631('0x9'),attributes,{'tableName':_0xc631('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x29eb=['define','SquareRecording','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./squareRecording.attributes','exports'];(function(_0x2e79b4,_0x76a87a){var _0x54db59=function(_0x357864){while(--_0x357864){_0x2e79b4['push'](_0x2e79b4['shift']());}};_0x54db59(++_0x76a87a);}(_0x29eb,0x1c5));var _0xb29e=function(_0x1db653,_0x3a9940){_0x1db653=_0x1db653-0x0;var _0x156348=_0x29eb[_0x1db653];return _0x156348;};'use strict';var _=require(_0xb29e('0x0'));var util=require(_0xb29e('0x1'));var logger=require(_0xb29e('0x2'))('api');var moment=require(_0xb29e('0x3'));var BPromise=require(_0xb29e('0x4'));var rp=require(_0xb29e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb29e('0x6'));var config=require('../../config/environment');var attributes=require(_0xb29e('0x7'));module[_0xb29e('0x8')]=function(_0x3426f3,_0x2e216f){return _0x3426f3[_0xb29e('0x9')](_0xb29e('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 44d80c4..0e14189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb7=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x6cb7,0x1bf));var _0x76cb=function(_0x19459b,_0x417b0e){_0x19459b=_0x19459b-0x0;var _0x5c3b3a=_0x6cb7[_0x19459b];return _0x5c3b3a;};'use strict';var _=require(_0x76cb('0x0'));var util=require(_0x76cb('0x1'));var moment=require('moment');var BPromise=require(_0x76cb('0x2'));var rs=require(_0x76cb('0x3'));var fs=require('fs');var Redis=require(_0x76cb('0x4'));var db=require(_0x76cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x76cb('0x6'))(_0x76cb('0x7'));var config=require(_0x76cb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x76cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a3ce0,_0x345531,_0x292ba3){return new BPromise(function(_0x4a1d01,_0x13cb23){return client[_0x76cb('0xa')](_0x4a3ce0,_0x292ba3)[_0x76cb('0xb')](function(_0x4dbcff){logger['info'](_0x76cb('0xc'),_0x345531,_0x76cb('0xd'));logger[_0x76cb('0xe')](_0x76cb('0xf'),_0x345531,_0x76cb('0xd'),JSON[_0x76cb('0x10')](_0x4dbcff));if(_0x4dbcff[_0x76cb('0x11')]){if(_0x4dbcff['error'][_0x76cb('0x12')]===0x1f4){logger[_0x76cb('0x11')](_0x76cb('0xc'),_0x345531,_0x4dbcff[_0x76cb('0x11')][_0x76cb('0x13')]);return _0x13cb23(_0x4dbcff['error'][_0x76cb('0x13')]);}logger['error'](_0x76cb('0xc'),_0x345531,_0x4dbcff[_0x76cb('0x11')][_0x76cb('0x13')]);return _0x4a1d01(_0x4dbcff[_0x76cb('0x11')][_0x76cb('0x13')]);}else{logger[_0x76cb('0x14')]('SquareRecording,\x20%s,\x20%s',_0x345531,_0x76cb('0xd'));_0x4a1d01(_0x4dbcff[_0x76cb('0x15')][_0x76cb('0x13')]);}})[_0x76cb('0x16')](function(_0x49ed88){logger['error'](_0x76cb('0xc'),_0x345531,_0x49ed88);_0x13cb23(_0x49ed88);});});}exports[_0x76cb('0x17')]=function(_0x49b068){var _0x43051e=this;return new Promise(function(_0x3ffea5,_0x393a77){return db[_0x76cb('0x18')]['create'](_0x49b068[_0x76cb('0x19')],{'raw':_0x49b068[_0x76cb('0x1a')]?_0x49b068[_0x76cb('0x1a')][_0x76cb('0x1b')]===undefined?!![]:![]:!![]})[_0x76cb('0xb')](function(_0x37bba8){logger[_0x76cb('0x14')](_0x76cb('0x17'),_0x49b068);logger[_0x76cb('0xe')](_0x76cb('0x17'),_0x49b068,JSON[_0x76cb('0x10')](_0x37bba8));_0x3ffea5(_0x37bba8);})['catch'](function(_0x220727){logger[_0x76cb('0x11')](_0x76cb('0x17'),_0x220727[_0x76cb('0x13')],_0x49b068);_0x393a77(_0x43051e[_0x76cb('0x11')](0x1f4,_0x220727[_0x76cb('0x13')]));});});};
\ No newline at end of file
+var _0x734c=['stringify','error','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','body','options','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0x734c,0xc9));var _0xc734=function(_0x26eea5,_0x38ef17){_0x26eea5=_0x26eea5-0x0;var _0x533bde=_0x734c[_0x26eea5];return _0x533bde;};'use strict';var _=require(_0xc734('0x0'));var util=require('util');var moment=require(_0xc734('0x1'));var BPromise=require('bluebird');var rs=require(_0xc734('0x2'));var fs=require('fs');var Redis=require(_0xc734('0x3'));var db=require(_0xc734('0x4'))['db'];var utils=require(_0xc734('0x5'));var logger=require(_0xc734('0x6'))('rpc');var config=require(_0xc734('0x7'));var jayson=require(_0xc734('0x8'));var client=jayson[_0xc734('0x9')][_0xc734('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65fba6,_0x51ecaf,_0x42bcda){return new BPromise(function(_0x3f659c,_0x22ba62){return client['request'](_0x65fba6,_0x42bcda)[_0xc734('0xb')](function(_0x14bd4d){logger[_0xc734('0xc')]('SquareRecording,\x20%s,\x20%s',_0x51ecaf,'request\x20sent');logger[_0xc734('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x51ecaf,_0xc734('0xe'),JSON[_0xc734('0xf')](_0x14bd4d));if(_0x14bd4d[_0xc734('0x10')]){if(_0x14bd4d[_0xc734('0x10')]['code']===0x1f4){logger[_0xc734('0x10')](_0xc734('0x11'),_0x51ecaf,_0x14bd4d[_0xc734('0x10')][_0xc734('0x12')]);return _0x22ba62(_0x14bd4d[_0xc734('0x10')][_0xc734('0x12')]);}logger[_0xc734('0x10')](_0xc734('0x11'),_0x51ecaf,_0x14bd4d[_0xc734('0x10')][_0xc734('0x12')]);return _0x3f659c(_0x14bd4d[_0xc734('0x10')]['message']);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x51ecaf,_0xc734('0xe'));_0x3f659c(_0x14bd4d[_0xc734('0x13')][_0xc734('0x12')]);}})['catch'](function(_0x27235e){logger[_0xc734('0x10')](_0xc734('0x11'),_0x51ecaf,_0x27235e);_0x22ba62(_0x27235e);});});}exports[_0xc734('0x14')]=function(_0x5c8f86){var _0x41576c=this;return new Promise(function(_0x3ac955,_0x16c876){return db[_0xc734('0x15')]['create'](_0x5c8f86[_0xc734('0x16')],{'raw':_0x5c8f86[_0xc734('0x17')]?_0x5c8f86['options']['raw']===undefined?!![]:![]:!![]})[_0xc734('0xb')](function(_0xcaaacb){logger[_0xc734('0xc')](_0xc734('0x14'),_0x5c8f86);logger[_0xc734('0xd')](_0xc734('0x14'),_0x5c8f86,JSON['stringify'](_0xcaaacb));_0x3ac955(_0xcaaacb);})['catch'](function(_0x2ab2b5){logger['error'](_0xc734('0x14'),_0x2ab2b5[_0xc734('0x12')],_0x5c8f86);_0x16c876(_0x41576c['error'](0x1f4,_0x2ab2b5[_0xc734('0x12')]));});});};
\ No newline at end of file
index 6130c8b..b27d341 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x473764,_0x103f7a){var _0x249461=function(_0x1f19a8){while(--_0x1f19a8){_0x473764['push'](_0x473764['shift']());}};_0x249461(++_0x103f7a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 06c739d..b7a2484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e93=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x424c8e,_0xe4d6b1){var _0x2639fc=function(_0x5d05e7){while(--_0x5d05e7){_0x424c8e['push'](_0x424c8e['shift']());}};_0x2639fc(++_0xe4d6b1);}(_0x5e93,0x1d2));var _0x35e9=function(_0x31a782,_0x4297cb){_0x31a782=_0x31a782-0x0;var _0x9df378=_0x5e93[_0x31a782];return _0x9df378;};'use strict';var Sequelize=require(_0x35e9('0x0'));module[_0x35e9('0x1')]={'network':{'type':Sequelize[_0x35e9('0x2')]},'network_script':{'type':Sequelize[_0x35e9('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x35e9('0x2')]},'language':{'type':Sequelize[_0x35e9('0x2')]},'type':{'type':Sequelize[_0x35e9('0x2')]},'uniqueid':{'type':Sequelize[_0x35e9('0x2')]},'version':{'type':Sequelize[_0x35e9('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x35e9('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x35e9('0x2')]},'callington':{'type':Sequelize[_0x35e9('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x35e9('0x2')]},'rdnis':{'type':Sequelize[_0x35e9('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x35e9('0x2')]},'accountcode':{'type':Sequelize[_0x35e9('0x2')]},'threadid':{'type':Sequelize[_0x35e9('0x2')]},'project_name':{'type':Sequelize[_0x35e9('0x2')]},'joinAt':{'type':Sequelize[_0x35e9('0x3')]},'leaveAt':{'type':Sequelize[_0x35e9('0x3')]},'bot':{'type':Sequelize[_0x35e9('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x098b=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x098b,0x6c));var _0xb098=function(_0x56659e,_0x54cb86){_0x56659e=_0x56659e-0x0;var _0x59c59e=_0x098b[_0x56659e];return _0x59c59e;};'use strict';var Sequelize=require(_0xb098('0x0'));module[_0xb098('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xb098('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb098('0x2')]},'uniqueid':{'type':Sequelize[_0xb098('0x2')]},'version':{'type':Sequelize[_0xb098('0x2')]},'callerid':{'type':Sequelize[_0xb098('0x2')]},'calleridname':{'type':Sequelize[_0xb098('0x2')]},'callingpres':{'type':Sequelize[_0xb098('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xb098('0x2')]},'callingtns':{'type':Sequelize[_0xb098('0x2')]},'dnid':{'type':Sequelize[_0xb098('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb098('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb098('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xb098('0x2')]},'project_name':{'type':Sequelize[_0xb098('0x2')]},'joinAt':{'type':Sequelize[_0xb098('0x3')]},'leaveAt':{'type':Sequelize[_0xb098('0x3')]},'bot':{'type':Sequelize[_0xb098('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 3fc984e..a7fb57f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f0=['lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra'];(function(_0x5eb874,_0x3d849f){var _0x5bbbd0=function(_0x54c86a){while(--_0x54c86a){_0x5eb874['push'](_0x5eb874['shift']());}};_0x5bbbd0(++_0x3d849f);}(_0xc4f0,0x1cf));var _0x0c4f=function(_0x21165c,_0xfcba18){_0x21165c=_0x21165c-0x0;var _0x4db2db=_0xc4f0[_0x21165c];return _0x4db2db;};'use strict';var emlformat=require(_0x0c4f('0x0'));var rimraf=require(_0x0c4f('0x1'));var zipdir=require(_0x0c4f('0x2'));var jsonpatch=require(_0x0c4f('0x3'));var rp=require(_0x0c4f('0x4'));var moment=require(_0x0c4f('0x5'));var BPromise=require(_0x0c4f('0x6'));var Mustache=require(_0x0c4f('0x7'));var util=require('util');var path=require(_0x0c4f('0x8'));var sox=require(_0x0c4f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c4f('0xa'));var _=require(_0x0c4f('0xb'));var squel=require(_0x0c4f('0xc'));var crypto=require(_0x0c4f('0xd'));var jsforce=require(_0x0c4f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0c4f('0xf'));var querystring=require(_0x0c4f('0x10'));var Papa=require(_0x0c4f('0x11'));var Redis=require('ioredis');var authService=require(_0x0c4f('0x12'));var qs=require(_0x0c4f('0x13'));var as=require(_0x0c4f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0c4f('0x15'));var utils=require(_0x0c4f('0x16'));var config=require(_0x0c4f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c4f('0x18'))['db'];function respondWithStatusCode(_0x2fa700,_0x198f03){_0x198f03=_0x198f03||0xcc;return function(_0x12f946){if(_0x12f946){return _0x2fa700[_0x0c4f('0x19')](_0x198f03);}return _0x2fa700['status'](_0x198f03)[_0x0c4f('0x1a')]();};}function respondWithResult(_0x1f2433,_0x20171b){_0x20171b=_0x20171b||0xc8;return function(_0x51487c){if(_0x51487c){return _0x1f2433[_0x0c4f('0x1b')](_0x20171b)[_0x0c4f('0x1c')](_0x51487c);}};}function respondWithFilteredResult(_0x104eb3,_0x502a15){return function(_0x38468d){if(_0x38468d){var _0x387181=typeof _0x502a15[_0x0c4f('0x1d')]===_0x0c4f('0x1e')&&typeof _0x502a15[_0x0c4f('0x1f')]===_0x0c4f('0x1e');var _0x2fa71c=_0x38468d[_0x0c4f('0x20')];var _0x4d6dae=_0x387181?0x0:_0x502a15[_0x0c4f('0x1d')];var _0x1353f1=_0x387181?_0x38468d[_0x0c4f('0x20')]:_0x502a15['offset']+_0x502a15[_0x0c4f('0x1f')];var _0x125ec4;if(_0x1353f1>=_0x2fa71c){_0x1353f1=_0x2fa71c;_0x125ec4=0xc8;}else{_0x125ec4=0xce;}_0x104eb3[_0x0c4f('0x1b')](_0x125ec4);return _0x104eb3[_0x0c4f('0x21')](_0x0c4f('0x22'),_0x4d6dae+'-'+_0x1353f1+'/'+_0x2fa71c)[_0x0c4f('0x1c')](_0x38468d);}return null;};}function patchUpdates(_0x269519){return function(_0x3ee0c7){try{jsonpatch[_0x0c4f('0x23')](_0x3ee0c7,_0x269519,!![]);}catch(_0x558584){return BPromise[_0x0c4f('0x24')](_0x558584);}return _0x3ee0c7['save']();};}function saveUpdates(_0x5733e0,_0x5c57e3){return function(_0x220b91){if(_0x220b91){return _0x220b91[_0x0c4f('0x25')](_0x5733e0)[_0x0c4f('0x26')](function(_0x3e71c7){return _0x3e71c7;});}return null;};}function removeEntity(_0x4a2c35,_0x2da0dc){return function(_0x12f9fe){if(_0x12f9fe){return _0x12f9fe[_0x0c4f('0x27')]()['then'](function(){_0x4a2c35[_0x0c4f('0x1b')](0xcc)[_0x0c4f('0x1a')]();});}};}function handleEntityNotFound(_0x5d20a6,_0x403ffe){return function(_0x5beaa9){if(!_0x5beaa9){_0x5d20a6[_0x0c4f('0x19')](0x194);}return _0x5beaa9;};}function handleError(_0x367596,_0x33c2a5){_0x33c2a5=_0x33c2a5||0x1f4;return function(_0x55ef0a){logger[_0x0c4f('0x28')](_0x55ef0a[_0x0c4f('0x29')]);if(_0x55ef0a[_0x0c4f('0x2a')]){delete _0x55ef0a[_0x0c4f('0x2a')];}_0x367596[_0x0c4f('0x1b')](_0x33c2a5)[_0x0c4f('0x2b')](_0x55ef0a);};}exports[_0x0c4f('0x2c')]=function(_0x192e77,_0x196670){var _0x53a6ea={},_0x29cf99={},_0x7168dd={'count':0x0,'rows':[]};var _0x222f6e=_['map'](db[_0x0c4f('0x2d')][_0x0c4f('0x2e')],function(_0x524304){return{'name':_0x524304[_0x0c4f('0x2f')],'type':_0x524304[_0x0c4f('0x30')][_0x0c4f('0x31')]};});_0x29cf99['model']=_[_0x0c4f('0x32')](_0x222f6e,_0x0c4f('0x2a'));_0x29cf99[_0x0c4f('0x33')]=_[_0x0c4f('0x34')](_0x192e77[_0x0c4f('0x33')]);_0x29cf99[_0x0c4f('0x35')]=_[_0x0c4f('0x36')](_0x29cf99[_0x0c4f('0x37')],_0x29cf99[_0x0c4f('0x33')]);_0x53a6ea[_0x0c4f('0x38')]=_[_0x0c4f('0x36')](_0x29cf99[_0x0c4f('0x37')],qs[_0x0c4f('0x39')](_0x192e77[_0x0c4f('0x33')][_0x0c4f('0x39')]));_0x53a6ea[_0x0c4f('0x38')]=_0x53a6ea[_0x0c4f('0x38')][_0x0c4f('0x3a')]?_0x53a6ea['attributes']:_0x29cf99[_0x0c4f('0x37')];if(!_0x192e77['query'][_0x0c4f('0x3b')](_0x0c4f('0x3c'))){_0x53a6ea[_0x0c4f('0x1f')]=qs[_0x0c4f('0x1f')](_0x192e77['query'][_0x0c4f('0x1f')]);_0x53a6ea[_0x0c4f('0x1d')]=qs['offset'](_0x192e77[_0x0c4f('0x33')][_0x0c4f('0x1d')]);}_0x53a6ea[_0x0c4f('0x3d')]=qs[_0x0c4f('0x3e')](_0x192e77['query'][_0x0c4f('0x3e')]);_0x53a6ea[_0x0c4f('0x3f')]=qs[_0x0c4f('0x35')](_[_0x0c4f('0x40')](_0x192e77['query'],_0x29cf99[_0x0c4f('0x35')]),_0x222f6e);if(_0x192e77[_0x0c4f('0x33')][_0x0c4f('0x41')]){_0x53a6ea[_0x0c4f('0x3f')]=_[_0x0c4f('0x42')](_0x53a6ea['where'],{'$or':_[_0x0c4f('0x32')](_0x222f6e,function(_0x101c25){if(_0x101c25[_0x0c4f('0x30')]!==_0x0c4f('0x43')){var _0x59b146={};_0x59b146[_0x101c25[_0x0c4f('0x2a')]]={'$like':'%'+_0x192e77[_0x0c4f('0x33')][_0x0c4f('0x41')]+'%'};return _0x59b146;}})});}_0x53a6ea=_['merge']({},_0x53a6ea,_0x192e77[_0x0c4f('0x44')]);var _0x59fcc7={'where':_0x53a6ea[_0x0c4f('0x3f')]};return db[_0x0c4f('0x2d')][_0x0c4f('0x20')](_0x59fcc7)[_0x0c4f('0x26')](function(_0x236905){_0x7168dd[_0x0c4f('0x20')]=_0x236905;if(_0x192e77[_0x0c4f('0x33')][_0x0c4f('0x45')]){_0x53a6ea[_0x0c4f('0x46')]=[{'all':!![]}];}return db['SquareReport'][_0x0c4f('0x47')](_0x53a6ea);})[_0x0c4f('0x26')](function(_0x1f0178){_0x7168dd[_0x0c4f('0x48')]=_0x1f0178;return _0x7168dd;})[_0x0c4f('0x26')](respondWithFilteredResult(_0x196670,_0x53a6ea))[_0x0c4f('0x49')](handleError(_0x196670,null));};exports['show']=function(_0x51559a,_0xe247d4){var _0x2e18cc={'raw':!![],'where':{'id':_0x51559a[_0x0c4f('0x4a')]['id']}},_0x59b714={};_0x59b714[_0x0c4f('0x37')]=_[_0x0c4f('0x34')](db['SquareReport'][_0x0c4f('0x2e')]);_0x59b714[_0x0c4f('0x33')]=_[_0x0c4f('0x34')](_0x51559a['query']);_0x59b714[_0x0c4f('0x35')]=_['intersection'](_0x59b714['model'],_0x59b714[_0x0c4f('0x33')]);_0x2e18cc['attributes']=_['intersection'](_0x59b714[_0x0c4f('0x37')],qs[_0x0c4f('0x39')](_0x51559a[_0x0c4f('0x33')][_0x0c4f('0x39')]));_0x2e18cc[_0x0c4f('0x38')]=_0x2e18cc['attributes'][_0x0c4f('0x3a')]?_0x2e18cc[_0x0c4f('0x38')]:_0x59b714['model'];if(_0x51559a[_0x0c4f('0x33')][_0x0c4f('0x45')]){_0x2e18cc[_0x0c4f('0x46')]=[{'all':!![]}];}_0x2e18cc=_['merge']({},_0x2e18cc,_0x51559a[_0x0c4f('0x44')]);return db['SquareReport'][_0x0c4f('0x4b')](_0x2e18cc)[_0x0c4f('0x26')](handleEntityNotFound(_0xe247d4,null))[_0x0c4f('0x26')](respondWithResult(_0xe247d4,null))[_0x0c4f('0x49')](handleError(_0xe247d4,null));};exports[_0x0c4f('0x4c')]=function(_0x5c3f63,_0x12b3bb){return db[_0x0c4f('0x2d')][_0x0c4f('0x4c')](_0x5c3f63[_0x0c4f('0x4d')],{})[_0x0c4f('0x26')](respondWithResult(_0x12b3bb,0xc9))[_0x0c4f('0x49')](handleError(_0x12b3bb,null));};exports[_0x0c4f('0x25')]=function(_0x3f77ee,_0x26020d){if(_0x3f77ee[_0x0c4f('0x4d')]['id']){delete _0x3f77ee[_0x0c4f('0x4d')]['id'];}return db[_0x0c4f('0x2d')]['find']({'where':{'id':_0x3f77ee[_0x0c4f('0x4a')]['id']}})[_0x0c4f('0x26')](handleEntityNotFound(_0x26020d,null))[_0x0c4f('0x26')](saveUpdates(_0x3f77ee['body'],null))[_0x0c4f('0x26')](respondWithResult(_0x26020d,null))[_0x0c4f('0x49')](handleError(_0x26020d,null));};exports[_0x0c4f('0x27')]=function(_0x3f32dc,_0x45aa7e){return db[_0x0c4f('0x2d')]['find']({'where':{'id':_0x3f32dc['params']['id']}})[_0x0c4f('0x26')](handleEntityNotFound(_0x45aa7e,null))['then'](removeEntity(_0x45aa7e,null))['catch'](handleError(_0x45aa7e,null));};exports[_0x0c4f('0x4e')]=function(_0xbf9ff9,_0x1c7675){return db['SquareReport'][_0x0c4f('0x4e')]()[_0x0c4f('0x26')](respondWithResult(_0x1c7675,null))['catch'](handleError(_0x1c7675,null));};
\ No newline at end of file
+var _0x4c31=['rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','catch','create','body','find','describe','eml-format'];(function(_0x54330b,_0x2d4af9){var _0x53625d=function(_0x43d761){while(--_0x43d761){_0x54330b['push'](_0x54330b['shift']());}};_0x53625d(++_0x2d4af9);}(_0x4c31,0x9d));var _0x14c3=function(_0x4dbf64,_0x46f981){_0x4dbf64=_0x4dbf64-0x0;var _0x5257e0=_0x4c31[_0x4dbf64];return _0x5257e0;};'use strict';var emlformat=require(_0x14c3('0x0'));var rimraf=require(_0x14c3('0x1'));var zipdir=require(_0x14c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x14c3('0x3'));var moment=require('moment');var BPromise=require(_0x14c3('0x4'));var Mustache=require(_0x14c3('0x5'));var util=require('util');var path=require(_0x14c3('0x6'));var sox=require(_0x14c3('0x7'));var csv=require(_0x14c3('0x8'));var ejs=require(_0x14c3('0x9'));var fs=require('fs');var fs_extra=require(_0x14c3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x14c3('0xb'));var jsforce=require(_0x14c3('0xc'));var deskjs=require(_0x14c3('0xd'));var toCsv=require(_0x14c3('0x8'));var querystring=require(_0x14c3('0xe'));var Papa=require(_0x14c3('0xf'));var Redis=require(_0x14c3('0x10'));var authService=require(_0x14c3('0x11'));var qs=require(_0x14c3('0x12'));var as=require(_0x14c3('0x13'));var hardwareService=require(_0x14c3('0x14'));var logger=require(_0x14c3('0x15'))(_0x14c3('0x16'));var utils=require(_0x14c3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x14c3('0x18'));var db=require(_0x14c3('0x19'))['db'];function respondWithStatusCode(_0x2f68ce,_0x285d21){_0x285d21=_0x285d21||0xcc;return function(_0x475efc){if(_0x475efc){return _0x2f68ce['sendStatus'](_0x285d21);}return _0x2f68ce[_0x14c3('0x1a')](_0x285d21)[_0x14c3('0x1b')]();};}function respondWithResult(_0x426224,_0xc37d9d){_0xc37d9d=_0xc37d9d||0xc8;return function(_0x51e745){if(_0x51e745){return _0x426224[_0x14c3('0x1a')](_0xc37d9d)[_0x14c3('0x1c')](_0x51e745);}};}function respondWithFilteredResult(_0x237607,_0x534384){return function(_0x4c0769){if(_0x4c0769){var _0x4686bf=typeof _0x534384[_0x14c3('0x1d')]===_0x14c3('0x1e')&&typeof _0x534384['limit']===_0x14c3('0x1e');var _0x16c474=_0x4c0769[_0x14c3('0x1f')];var _0x24115e=_0x4686bf?0x0:_0x534384[_0x14c3('0x1d')];var _0x2c282e=_0x4686bf?_0x4c0769[_0x14c3('0x1f')]:_0x534384[_0x14c3('0x1d')]+_0x534384[_0x14c3('0x20')];var _0x2498ee;if(_0x2c282e>=_0x16c474){_0x2c282e=_0x16c474;_0x2498ee=0xc8;}else{_0x2498ee=0xce;}_0x237607['status'](_0x2498ee);return _0x237607[_0x14c3('0x21')](_0x14c3('0x22'),_0x24115e+'-'+_0x2c282e+'/'+_0x16c474)[_0x14c3('0x1c')](_0x4c0769);}return null;};}function patchUpdates(_0x3579ad){return function(_0x49f738){try{jsonpatch[_0x14c3('0x23')](_0x49f738,_0x3579ad,!![]);}catch(_0x4e37b8){return BPromise[_0x14c3('0x24')](_0x4e37b8);}return _0x49f738[_0x14c3('0x25')]();};}function saveUpdates(_0x99ef1e,_0x2a1178){return function(_0x4c1bef){if(_0x4c1bef){return _0x4c1bef[_0x14c3('0x26')](_0x99ef1e)[_0x14c3('0x27')](function(_0x438e8d){return _0x438e8d;});}return null;};}function removeEntity(_0x4a31a0,_0x56d2c6){return function(_0x347f99){if(_0x347f99){return _0x347f99[_0x14c3('0x28')]()[_0x14c3('0x27')](function(){_0x4a31a0['status'](0xcc)[_0x14c3('0x1b')]();});}};}function handleEntityNotFound(_0x51b271,_0x558b44){return function(_0x57127a){if(!_0x57127a){_0x51b271[_0x14c3('0x29')](0x194);}return _0x57127a;};}function handleError(_0x48cb9a,_0x10c19f){_0x10c19f=_0x10c19f||0x1f4;return function(_0xc48d37){logger[_0x14c3('0x2a')](_0xc48d37['stack']);if(_0xc48d37[_0x14c3('0x2b')]){delete _0xc48d37[_0x14c3('0x2b')];}_0x48cb9a['status'](_0x10c19f)[_0x14c3('0x2c')](_0xc48d37);};}exports[_0x14c3('0x2d')]=function(_0x8766b8,_0x457590){var _0x457768={},_0x2e401d={},_0x263486={'count':0x0,'rows':[]};var _0x1ae607=_[_0x14c3('0x2e')](db[_0x14c3('0x2f')][_0x14c3('0x30')],function(_0x496897){return{'name':_0x496897[_0x14c3('0x31')],'type':_0x496897[_0x14c3('0x32')][_0x14c3('0x33')]};});_0x2e401d[_0x14c3('0x34')]=_[_0x14c3('0x2e')](_0x1ae607,_0x14c3('0x2b'));_0x2e401d[_0x14c3('0x35')]=_[_0x14c3('0x36')](_0x8766b8[_0x14c3('0x35')]);_0x2e401d[_0x14c3('0x37')]=_[_0x14c3('0x38')](_0x2e401d[_0x14c3('0x34')],_0x2e401d[_0x14c3('0x35')]);_0x457768[_0x14c3('0x39')]=_[_0x14c3('0x38')](_0x2e401d[_0x14c3('0x34')],qs[_0x14c3('0x3a')](_0x8766b8[_0x14c3('0x35')][_0x14c3('0x3a')]));_0x457768[_0x14c3('0x39')]=_0x457768[_0x14c3('0x39')][_0x14c3('0x3b')]?_0x457768[_0x14c3('0x39')]:_0x2e401d[_0x14c3('0x34')];if(!_0x8766b8[_0x14c3('0x35')]['hasOwnProperty'](_0x14c3('0x3c'))){_0x457768[_0x14c3('0x20')]=qs[_0x14c3('0x20')](_0x8766b8[_0x14c3('0x35')][_0x14c3('0x20')]);_0x457768[_0x14c3('0x1d')]=qs[_0x14c3('0x1d')](_0x8766b8['query']['offset']);}_0x457768[_0x14c3('0x3d')]=qs[_0x14c3('0x3e')](_0x8766b8[_0x14c3('0x35')]['sort']);_0x457768[_0x14c3('0x3f')]=qs[_0x14c3('0x37')](_[_0x14c3('0x40')](_0x8766b8[_0x14c3('0x35')],_0x2e401d['filters']),_0x1ae607);if(_0x8766b8[_0x14c3('0x35')]['filter']){_0x457768['where']=_['merge'](_0x457768[_0x14c3('0x3f')],{'$or':_['map'](_0x1ae607,function(_0x39c3cb){if(_0x39c3cb[_0x14c3('0x32')]!==_0x14c3('0x41')){var _0x35e923={};_0x35e923[_0x39c3cb[_0x14c3('0x2b')]]={'$like':'%'+_0x8766b8[_0x14c3('0x35')][_0x14c3('0x42')]+'%'};return _0x35e923;}})});}_0x457768=_['merge']({},_0x457768,_0x8766b8[_0x14c3('0x43')]);var _0x120713={'where':_0x457768[_0x14c3('0x3f')]};return db['SquareReport'][_0x14c3('0x1f')](_0x120713)[_0x14c3('0x27')](function(_0x1a9ef7){_0x263486[_0x14c3('0x1f')]=_0x1a9ef7;if(_0x8766b8[_0x14c3('0x35')][_0x14c3('0x44')]){_0x457768[_0x14c3('0x45')]=[{'all':!![]}];}return db[_0x14c3('0x2f')][_0x14c3('0x46')](_0x457768);})[_0x14c3('0x27')](function(_0x1a5920){_0x263486['rows']=_0x1a5920;return _0x263486;})['then'](respondWithFilteredResult(_0x457590,_0x457768))['catch'](handleError(_0x457590,null));};exports[_0x14c3('0x47')]=function(_0x1e2a3c,_0x381dab){var _0x57672d={'raw':!![],'where':{'id':_0x1e2a3c[_0x14c3('0x48')]['id']}},_0x1c1b69={};_0x1c1b69[_0x14c3('0x34')]=_[_0x14c3('0x36')](db['SquareReport'][_0x14c3('0x30')]);_0x1c1b69[_0x14c3('0x35')]=_['keys'](_0x1e2a3c[_0x14c3('0x35')]);_0x1c1b69[_0x14c3('0x37')]=_[_0x14c3('0x38')](_0x1c1b69['model'],_0x1c1b69[_0x14c3('0x35')]);_0x57672d[_0x14c3('0x39')]=_[_0x14c3('0x38')](_0x1c1b69[_0x14c3('0x34')],qs[_0x14c3('0x3a')](_0x1e2a3c[_0x14c3('0x35')][_0x14c3('0x3a')]));_0x57672d[_0x14c3('0x39')]=_0x57672d['attributes']['length']?_0x57672d['attributes']:_0x1c1b69[_0x14c3('0x34')];if(_0x1e2a3c[_0x14c3('0x35')][_0x14c3('0x44')]){_0x57672d[_0x14c3('0x45')]=[{'all':!![]}];}_0x57672d=_[_0x14c3('0x49')]({},_0x57672d,_0x1e2a3c[_0x14c3('0x43')]);return db[_0x14c3('0x2f')]['find'](_0x57672d)['then'](handleEntityNotFound(_0x381dab,null))['then'](respondWithResult(_0x381dab,null))[_0x14c3('0x4a')](handleError(_0x381dab,null));};exports['create']=function(_0x12255f,_0x6d7f6b){return db['SquareReport'][_0x14c3('0x4b')](_0x12255f[_0x14c3('0x4c')],{})[_0x14c3('0x27')](respondWithResult(_0x6d7f6b,0xc9))[_0x14c3('0x4a')](handleError(_0x6d7f6b,null));};exports[_0x14c3('0x26')]=function(_0x15800a,_0x4bc2e6){if(_0x15800a[_0x14c3('0x4c')]['id']){delete _0x15800a[_0x14c3('0x4c')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x15800a['params']['id']}})[_0x14c3('0x27')](handleEntityNotFound(_0x4bc2e6,null))['then'](saveUpdates(_0x15800a[_0x14c3('0x4c')],null))['then'](respondWithResult(_0x4bc2e6,null))['catch'](handleError(_0x4bc2e6,null));};exports[_0x14c3('0x28')]=function(_0x2ed6b0,_0xdf1032){return db[_0x14c3('0x2f')][_0x14c3('0x4d')]({'where':{'id':_0x2ed6b0[_0x14c3('0x48')]['id']}})['then'](handleEntityNotFound(_0xdf1032,null))[_0x14c3('0x27')](removeEntity(_0xdf1032,null))[_0x14c3('0x4a')](handleError(_0xdf1032,null));};exports['describe']=function(_0x410318,_0x2807e3){return db[_0x14c3('0x2f')][_0x14c3('0x4e')]()[_0x14c3('0x27')](respondWithResult(_0x2807e3,null))[_0x14c3('0x4a')](handleError(_0x2807e3,null));};
\ No newline at end of file
index 102679d..05b162b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15fc=['uniqueid','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','SquareReport','uid_pname'];(function(_0x33752b,_0x3b8e98){var _0x161990=function(_0x106e7f){while(--_0x106e7f){_0x33752b['push'](_0x33752b['shift']());}};_0x161990(++_0x3b8e98);}(_0x15fc,0x177));var _0xc15f=function(_0x3e9bc3,_0x5deaa1){_0x3e9bc3=_0x3e9bc3-0x0;var _0x4141a5=_0x15fc[_0x3e9bc3];return _0x4141a5;};'use strict';var _=require(_0xc15f('0x0'));var util=require('util');var logger=require(_0xc15f('0x1'))(_0xc15f('0x2'));var moment=require(_0xc15f('0x3'));var BPromise=require(_0xc15f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc15f('0x5'));var rimraf=require('rimraf');var config=require(_0xc15f('0x6'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x5d5511,_0x355ff5){return _0x5d5511['define'](_0xc15f('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xc15f('0x8'),'fields':[_0xc15f('0x9'),_0xc15f('0xa')]},{'name':_0xc15f('0xb'),'fields':[_0xc15f('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x279a=['bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x3a33e7,_0x41609d){var _0x1b5e7f=function(_0x47a8cd){while(--_0x47a8cd){_0x3a33e7['push'](_0x3a33e7['shift']());}};_0x1b5e7f(++_0x41609d);}(_0x279a,0x84));var _0xa279=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x279a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa279('0x0'));var util=require(_0xa279('0x1'));var logger=require(_0xa279('0x2'))(_0xa279('0x3'));var moment=require('moment');var BPromise=require(_0xa279('0x4'));var rp=require(_0xa279('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa279('0x6'));var config=require(_0xa279('0x7'));var attributes=require(_0xa279('0x8'));module[_0xa279('0x9')]=function(_0x13f7c5,_0x31edd3){return _0x13f7c5[_0xa279('0xa')](_0xa279('0xb'),attributes,{'tableName':_0xa279('0xc'),'paranoid':![],'indexes':[{'name':_0xa279('0xd'),'fields':[_0xa279('0xe'),_0xa279('0xf')]},{'name':_0xa279('0x10'),'fields':[_0xa279('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index c9226aa..d9e9b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91fa=['where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSquareReport','SquareReport','create','options','raw','stringify','UpdateSquareReport','update'];(function(_0x562440,_0x2d73a6){var _0x374133=function(_0x4bc334){while(--_0x4bc334){_0x562440['push'](_0x562440['shift']());}};_0x374133(++_0x2d73a6);}(_0x91fa,0x162));var _0xa91f=function(_0x1d2ef2,_0x1a7599){_0x1d2ef2=_0x1d2ef2-0x0;var _0x345183=_0x91fa[_0x1d2ef2];return _0x345183;};'use strict';var _=require(_0xa91f('0x0'));var util=require(_0xa91f('0x1'));var moment=require(_0xa91f('0x2'));var BPromise=require(_0xa91f('0x3'));var rs=require(_0xa91f('0x4'));var fs=require('fs');var Redis=require(_0xa91f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa91f('0x6'));var logger=require(_0xa91f('0x7'))(_0xa91f('0x8'));var config=require(_0xa91f('0x9'));var jayson=require(_0xa91f('0xa'));var client=jayson['client'][_0xa91f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x511f6f,_0x542d35,_0x580bd8){return new BPromise(function(_0x20ebb6,_0x4e760d){return client['request'](_0x511f6f,_0x580bd8)[_0xa91f('0xc')](function(_0x13f65c){logger[_0xa91f('0xd')](_0xa91f('0xe'),_0x542d35,'request\x20sent');logger[_0xa91f('0xf')](_0xa91f('0x10'),_0x542d35,_0xa91f('0x11'),JSON['stringify'](_0x13f65c));if(_0x13f65c[_0xa91f('0x12')]){if(_0x13f65c[_0xa91f('0x12')][_0xa91f('0x13')]===0x1f4){logger[_0xa91f('0x12')](_0xa91f('0xe'),_0x542d35,_0x13f65c['error'][_0xa91f('0x14')]);return _0x4e760d(_0x13f65c[_0xa91f('0x12')][_0xa91f('0x14')]);}logger['error'](_0xa91f('0xe'),_0x542d35,_0x13f65c['error'][_0xa91f('0x14')]);return _0x20ebb6(_0x13f65c['error'][_0xa91f('0x14')]);}else{logger[_0xa91f('0xd')](_0xa91f('0xe'),_0x542d35,_0xa91f('0x11'));_0x20ebb6(_0x13f65c['result']['message']);}})[_0xa91f('0x15')](function(_0x247e37){logger['error'](_0xa91f('0xe'),_0x542d35,_0x247e37);_0x4e760d(_0x247e37);});});}exports[_0xa91f('0x16')]=function(_0x2f02a4){var _0x350a39=this;return new Promise(function(_0x30f8b2,_0x3dab7e){return db[_0xa91f('0x17')][_0xa91f('0x18')](_0x2f02a4['body'],{'raw':_0x2f02a4[_0xa91f('0x19')]?_0x2f02a4['options'][_0xa91f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3abbb5){logger[_0xa91f('0xd')]('CreateSquareReport',_0x2f02a4);logger[_0xa91f('0xf')](_0xa91f('0x16'),_0x2f02a4,JSON[_0xa91f('0x1b')](_0x3abbb5));_0x30f8b2(_0x3abbb5);})[_0xa91f('0x15')](function(_0x453c86){logger[_0xa91f('0x12')]('CreateSquareReport',_0x453c86[_0xa91f('0x14')],_0x2f02a4);_0x3dab7e(_0x350a39[_0xa91f('0x12')](0x1f4,_0x453c86[_0xa91f('0x14')]));});});};exports[_0xa91f('0x1c')]=function(_0x184170){var _0x448f94=this;return new Promise(function(_0x501ce1,_0x1e9c9f){return db[_0xa91f('0x17')][_0xa91f('0x1d')](_0x184170['body'],{'raw':_0x184170[_0xa91f('0x19')]?_0x184170[_0xa91f('0x19')][_0xa91f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x184170[_0xa91f('0x19')]?_0x184170[_0xa91f('0x19')][_0xa91f('0x1e')]||null:null,'attributes':_0x184170[_0xa91f('0x19')]?_0x184170[_0xa91f('0x19')][_0xa91f('0x1f')]||null:null,'limit':_0x184170['options']?_0x184170['options']['limit']||null:null})[_0xa91f('0xc')](function(_0x11fd32){logger[_0xa91f('0xd')](_0xa91f('0x1c'),_0x184170);logger[_0xa91f('0xf')](_0xa91f('0x1c'),_0x184170,JSON[_0xa91f('0x1b')](_0x11fd32));_0x501ce1(_0x11fd32);})[_0xa91f('0x15')](function(_0x21370a){logger[_0xa91f('0x12')](_0xa91f('0x1c'),_0x21370a[_0xa91f('0x14')],_0x184170);_0x1e9c9f(_0x448f94[_0xa91f('0x12')](0x1f4,_0x21370a[_0xa91f('0x14')]));});});};
\ No newline at end of file
+var _0x3b0f=['request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SquareReport','create','options','raw','CreateSquareReport','UpdateSquareReport','update','where','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x26d559,_0x3ac894){var _0x183920=function(_0x43cd4c){while(--_0x43cd4c){_0x26d559['push'](_0x26d559['shift']());}};_0x183920(++_0x3ac894);}(_0x3b0f,0x1c8));var _0xf3b0=function(_0x21f2c0,_0x10f8d7){_0x21f2c0=_0x21f2c0-0x0;var _0x1cc9d8=_0x3b0f[_0x21f2c0];return _0x1cc9d8;};'use strict';var _=require('lodash');var util=require(_0xf3b0('0x0'));var moment=require(_0xf3b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3b0('0x2'));var fs=require('fs');var Redis=require(_0xf3b0('0x3'));var db=require(_0xf3b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3b0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf3b0('0x6'));var client=jayson[_0xf3b0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x556e1d,_0x5307e4,_0x48f7b6){return new BPromise(function(_0x3cf90f,_0x284017){return client[_0xf3b0('0x8')](_0x556e1d,_0x48f7b6)[_0xf3b0('0x9')](function(_0x40a7e6){logger['info'](_0xf3b0('0xa'),_0x5307e4,_0xf3b0('0xb'));logger[_0xf3b0('0xc')](_0xf3b0('0xd'),_0x5307e4,_0xf3b0('0xb'),JSON[_0xf3b0('0xe')](_0x40a7e6));if(_0x40a7e6['error']){if(_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x10')]===0x1f4){logger[_0xf3b0('0xf')](_0xf3b0('0xa'),_0x5307e4,_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x11')]);return _0x284017(_0x40a7e6[_0xf3b0('0xf')]['message']);}logger[_0xf3b0('0xf')](_0xf3b0('0xa'),_0x5307e4,_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x11')]);return _0x3cf90f(_0x40a7e6[_0xf3b0('0xf')][_0xf3b0('0x11')]);}else{logger[_0xf3b0('0x12')](_0xf3b0('0xa'),_0x5307e4,_0xf3b0('0xb'));_0x3cf90f(_0x40a7e6[_0xf3b0('0x13')][_0xf3b0('0x11')]);}})['catch'](function(_0x36539a){logger[_0xf3b0('0xf')](_0xf3b0('0xa'),_0x5307e4,_0x36539a);_0x284017(_0x36539a);});});}exports['CreateSquareReport']=function(_0x49528b){var _0x5597a5=this;return new Promise(function(_0x2c41be,_0x3a9933){return db[_0xf3b0('0x14')][_0xf3b0('0x15')](_0x49528b['body'],{'raw':_0x49528b['options']?_0x49528b[_0xf3b0('0x16')][_0xf3b0('0x17')]===undefined?!![]:![]:!![]})[_0xf3b0('0x9')](function(_0x26be5c){logger[_0xf3b0('0x12')](_0xf3b0('0x18'),_0x49528b);logger[_0xf3b0('0xc')]('CreateSquareReport',_0x49528b,JSON[_0xf3b0('0xe')](_0x26be5c));_0x2c41be(_0x26be5c);})['catch'](function(_0x419dda){logger[_0xf3b0('0xf')](_0xf3b0('0x18'),_0x419dda[_0xf3b0('0x11')],_0x49528b);_0x3a9933(_0x5597a5['error'](0x1f4,_0x419dda[_0xf3b0('0x11')]));});});};exports[_0xf3b0('0x19')]=function(_0x42a072){var _0x518302=this;return new Promise(function(_0x5825f1,_0x4ec248){return db[_0xf3b0('0x14')][_0xf3b0('0x1a')](_0x42a072['body'],{'raw':_0x42a072[_0xf3b0('0x16')]?_0x42a072[_0xf3b0('0x16')][_0xf3b0('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a072[_0xf3b0('0x16')]?_0x42a072['options'][_0xf3b0('0x1b')]||null:null,'attributes':_0x42a072['options']?_0x42a072['options']['attributes']||null:null,'limit':_0x42a072[_0xf3b0('0x16')]?_0x42a072['options'][_0xf3b0('0x1c')]||null:null})[_0xf3b0('0x9')](function(_0x3ab293){logger[_0xf3b0('0x12')](_0xf3b0('0x19'),_0x42a072);logger[_0xf3b0('0xc')]('UpdateSquareReport',_0x42a072,JSON[_0xf3b0('0xe')](_0x3ab293));_0x5825f1(_0x3ab293);})['catch'](function(_0xaeb223){logger[_0xf3b0('0xf')](_0xf3b0('0x19'),_0xaeb223[_0xf3b0('0x11')],_0x42a072);_0x4ec248(_0x518302[_0xf3b0('0xf')](0x1f4,_0xaeb223[_0xf3b0('0x11')]));});});};
\ No newline at end of file
index 73d185b..4fa2985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a2=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x16be20,_0xb9ac1a){var _0x467768=function(_0x507fca){while(--_0x507fca){_0x16be20['push'](_0x16be20['shift']());}};_0x467768(++_0xb9ac1a);}(_0x91a2,0x1d2));var _0x291a=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0x91a2[_0x9edfd5];return _0x330738;};'use strict';var multer=require(_0x291a('0x0'));var util=require(_0x291a('0x1'));var path=require(_0x291a('0x2'));var timeout=require(_0x291a('0x3'));var express=require(_0x291a('0x4'));var router=express['Router']();var fs_extra=require(_0x291a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x291a('0x6'));var controller=require(_0x291a('0x7'));router[_0x291a('0x8')]('/',auth['isAuthenticated'](),controller[_0x291a('0x9')]);router[_0x291a('0x8')](_0x291a('0xa'),auth[_0x291a('0xb')](),controller[_0x291a('0xc')]);router[_0x291a('0x8')](_0x291a('0xd'),auth[_0x291a('0xb')](),controller[_0x291a('0xe')]);router['post']('/',auth[_0x291a('0xb')](),controller['create']);router[_0x291a('0xf')](_0x291a('0xd'),auth['isAuthenticated'](),controller[_0x291a('0x10')]);router[_0x291a('0x11')](_0x291a('0xd'),auth[_0x291a('0xb')](),controller[_0x291a('0x12')]);module[_0x291a('0x13')]=router;
\ No newline at end of file
+var _0xec8b=['/:id','show','post','put','update','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x19fa00,_0x2218c3){var _0x5639fe=function(_0x2ca3b4){while(--_0x2ca3b4){_0x19fa00['push'](_0x19fa00['shift']());}};_0x5639fe(++_0x2218c3);}(_0xec8b,0x7f));var _0xbec8=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xec8b[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbec8('0x0'));var timeout=require(_0xbec8('0x1'));var express=require('express');var router=express[_0xbec8('0x2')]();var fs_extra=require(_0xbec8('0x3'));var auth=require(_0xbec8('0x4'));var interaction=require(_0xbec8('0x5'));var config=require(_0xbec8('0x6'));var controller=require(_0xbec8('0x7'));router['get']('/',auth[_0xbec8('0x8')](),controller[_0xbec8('0x9')]);router[_0xbec8('0xa')](_0xbec8('0xb'),auth[_0xbec8('0x8')](),controller[_0xbec8('0xc')]);router[_0xbec8('0xa')](_0xbec8('0xd'),auth[_0xbec8('0x8')](),controller[_0xbec8('0xe')]);router[_0xbec8('0xf')]('/',auth[_0xbec8('0x8')](),controller['create']);router[_0xbec8('0x10')]('/:id',auth[_0xbec8('0x8')](),controller[_0xbec8('0x11')]);router['delete'](_0xbec8('0xd'),auth[_0xbec8('0x8')](),controller[_0xbec8('0x12')]);module[_0xbec8('0x13')]=router;
\ No newline at end of file
index b64792b..3acba85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb43=['TEXT','sequelize','exports','STRING'];(function(_0x4fe496,_0x1d8673){var _0x422b24=function(_0x27a644){while(--_0x27a644){_0x4fe496['push'](_0x4fe496['shift']());}};_0x422b24(++_0x1d8673);}(_0xfb43,0x195));var _0x3fb4=function(_0x51832f,_0x3d8323){_0x51832f=_0x51832f-0x0;var _0x38abdb=_0xfb43[_0x51832f];return _0x38abdb;};'use strict';var Sequelize=require(_0x3fb4('0x0'));module[_0x3fb4('0x1')]={'uniqueid':{'type':Sequelize[_0x3fb4('0x2')]},'node':{'type':Sequelize[_0x3fb4('0x2')]},'application':{'type':Sequelize[_0x3fb4('0x2')]},'data':{'type':Sequelize[_0x3fb4('0x3')]},'project_name':{'type':Sequelize[_0x3fb4('0x2')]},'callerid':{'type':Sequelize[_0x3fb4('0x2')]}};
\ No newline at end of file
+var _0x4343=['STRING','sequelize','exports'];(function(_0x37c548,_0x2d9a05){var _0x10f4fd=function(_0x4382d1){while(--_0x4382d1){_0x37c548['push'](_0x37c548['shift']());}};_0x10f4fd(++_0x2d9a05);}(_0x4343,0xa6));var _0x3434=function(_0x59d3c3,_0x50bef2){_0x59d3c3=_0x59d3c3-0x0;var _0x33cc65=_0x4343[_0x59d3c3];return _0x33cc65;};'use strict';var Sequelize=require(_0x3434('0x0'));module[_0x3434('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x3434('0x2')]},'application':{'type':Sequelize[_0x3434('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x3434('0x2')]},'callerid':{'type':Sequelize[_0x3434('0x2')]}};
\ No newline at end of file
index c7dcf6c..8b7b3fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cd6=['save','update','then','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x416316,_0x3feebb){var _0x4db4da=function(_0x5a221e){while(--_0x5a221e){_0x416316['push'](_0x416316['shift']());}};_0x4db4da(++_0x3feebb);}(_0x3cd6,0x19f));var _0x63cd=function(_0xdf5a7e,_0x157dd9){_0xdf5a7e=_0xdf5a7e-0x0;var _0x4b0303=_0x3cd6[_0xdf5a7e];return _0x4b0303;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63cd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x63cd('0x1'));var rp=require(_0x63cd('0x2'));var moment=require(_0x63cd('0x3'));var BPromise=require(_0x63cd('0x4'));var Mustache=require(_0x63cd('0x5'));var util=require(_0x63cd('0x6'));var path=require(_0x63cd('0x7'));var sox=require(_0x63cd('0x8'));var csv=require(_0x63cd('0x9'));var ejs=require(_0x63cd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x63cd('0xb'));var crypto=require(_0x63cd('0xc'));var jsforce=require(_0x63cd('0xd'));var deskjs=require(_0x63cd('0xe'));var toCsv=require(_0x63cd('0x9'));var querystring=require(_0x63cd('0xf'));var Papa=require(_0x63cd('0x10'));var Redis=require('ioredis');var authService=require(_0x63cd('0x11'));var qs=require(_0x63cd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63cd('0x13'));var logger=require(_0x63cd('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x63cd('0x15'));var licenseUtil=require(_0x63cd('0x16'));var db=require(_0x63cd('0x17'))['db'];function respondWithStatusCode(_0x439cfc,_0x319a05){_0x319a05=_0x319a05||0xcc;return function(_0x1876c9){if(_0x1876c9){return _0x439cfc[_0x63cd('0x18')](_0x319a05);}return _0x439cfc['status'](_0x319a05)[_0x63cd('0x19')]();};}function respondWithResult(_0x31a14a,_0x2bab92){_0x2bab92=_0x2bab92||0xc8;return function(_0x2c3336){if(_0x2c3336){return _0x31a14a[_0x63cd('0x1a')](_0x2bab92)[_0x63cd('0x1b')](_0x2c3336);}};}function respondWithFilteredResult(_0x371a6c,_0x2d6f2b){return function(_0x29054f){if(_0x29054f){var _0x47e30a=typeof _0x2d6f2b[_0x63cd('0x1c')]===_0x63cd('0x1d')&&typeof _0x2d6f2b[_0x63cd('0x1e')]===_0x63cd('0x1d');var _0x11d086=_0x29054f[_0x63cd('0x1f')];var _0x28c82d=_0x47e30a?0x0:_0x2d6f2b['offset'];var _0x4ce00d=_0x47e30a?_0x29054f[_0x63cd('0x1f')]:_0x2d6f2b[_0x63cd('0x1c')]+_0x2d6f2b[_0x63cd('0x1e')];var _0x3482bd;if(_0x4ce00d>=_0x11d086){_0x4ce00d=_0x11d086;_0x3482bd=0xc8;}else{_0x3482bd=0xce;}_0x371a6c[_0x63cd('0x1a')](_0x3482bd);return _0x371a6c['set'](_0x63cd('0x20'),_0x28c82d+'-'+_0x4ce00d+'/'+_0x11d086)[_0x63cd('0x1b')](_0x29054f);}return null;};}function patchUpdates(_0x37774b){return function(_0x5de217){try{jsonpatch[_0x63cd('0x21')](_0x5de217,_0x37774b,!![]);}catch(_0xe735ed){return BPromise[_0x63cd('0x22')](_0xe735ed);}return _0x5de217[_0x63cd('0x23')]();};}function saveUpdates(_0x93ddbd,_0x44e3e2){return function(_0x12f04e){if(_0x12f04e){return _0x12f04e[_0x63cd('0x24')](_0x93ddbd)['then'](function(_0x1705f8){return _0x1705f8;});}return null;};}function removeEntity(_0x2f612d,_0x2e7248){return function(_0x5648b1){if(_0x5648b1){return _0x5648b1['destroy']()[_0x63cd('0x25')](function(){_0x2f612d['status'](0xcc)[_0x63cd('0x19')]();});}};}function handleEntityNotFound(_0x1f69d5,_0xb59e1d){return function(_0x3c48aa){if(!_0x3c48aa){_0x1f69d5['sendStatus'](0x194);}return _0x3c48aa;};}function handleError(_0x57b6c0,_0x233858){_0x233858=_0x233858||0x1f4;return function(_0xc7f990){logger[_0x63cd('0x26')](_0xc7f990['stack']);if(_0xc7f990[_0x63cd('0x27')]){delete _0xc7f990[_0x63cd('0x27')];}_0x57b6c0['status'](_0x233858)[_0x63cd('0x28')](_0xc7f990);};}exports['index']=function(_0x56ce14,_0x4fe45a){var _0x4498c3={},_0x13a330={},_0x30af9b={'count':0x0,'rows':[]};var _0x5887d1=_[_0x63cd('0x29')](db[_0x63cd('0x2a')][_0x63cd('0x2b')],function(_0x390381){return{'name':_0x390381[_0x63cd('0x2c')],'type':_0x390381['type'][_0x63cd('0x2d')]};});_0x13a330[_0x63cd('0x2e')]=_[_0x63cd('0x29')](_0x5887d1,_0x63cd('0x27'));_0x13a330['query']=_[_0x63cd('0x2f')](_0x56ce14[_0x63cd('0x30')]);_0x13a330[_0x63cd('0x31')]=_['intersection'](_0x13a330[_0x63cd('0x2e')],_0x13a330[_0x63cd('0x30')]);_0x4498c3[_0x63cd('0x32')]=_[_0x63cd('0x33')](_0x13a330[_0x63cd('0x2e')],qs[_0x63cd('0x34')](_0x56ce14[_0x63cd('0x30')][_0x63cd('0x34')]));_0x4498c3['attributes']=_0x4498c3['attributes'][_0x63cd('0x35')]?_0x4498c3['attributes']:_0x13a330['model'];if(!_0x56ce14[_0x63cd('0x30')][_0x63cd('0x36')](_0x63cd('0x37'))){_0x4498c3[_0x63cd('0x1e')]=qs[_0x63cd('0x1e')](_0x56ce14['query'][_0x63cd('0x1e')]);_0x4498c3[_0x63cd('0x1c')]=qs[_0x63cd('0x1c')](_0x56ce14[_0x63cd('0x30')][_0x63cd('0x1c')]);}_0x4498c3[_0x63cd('0x38')]=qs['sort'](_0x56ce14[_0x63cd('0x30')][_0x63cd('0x39')]);_0x4498c3[_0x63cd('0x3a')]=qs[_0x63cd('0x31')](_[_0x63cd('0x3b')](_0x56ce14[_0x63cd('0x30')],_0x13a330[_0x63cd('0x31')]),_0x5887d1);if(_0x56ce14[_0x63cd('0x30')]['filter']){_0x4498c3[_0x63cd('0x3a')]=_[_0x63cd('0x3c')](_0x4498c3[_0x63cd('0x3a')],{'$or':_[_0x63cd('0x29')](_0x5887d1,function(_0x25b03c){if(_0x25b03c[_0x63cd('0x3d')]!=='VIRTUAL'){var _0x2f4973={};_0x2f4973[_0x25b03c[_0x63cd('0x27')]]={'$like':'%'+_0x56ce14[_0x63cd('0x30')]['filter']+'%'};return _0x2f4973;}})});}_0x4498c3=_[_0x63cd('0x3c')]({},_0x4498c3,_0x56ce14[_0x63cd('0x3e')]);var _0x1a9be8={'where':_0x4498c3['where']};return db[_0x63cd('0x2a')]['count'](_0x1a9be8)[_0x63cd('0x25')](function(_0x1eba08){_0x30af9b[_0x63cd('0x1f')]=_0x1eba08;if(_0x56ce14[_0x63cd('0x30')][_0x63cd('0x3f')]){_0x4498c3[_0x63cd('0x40')]=[{'all':!![]}];}return db[_0x63cd('0x2a')][_0x63cd('0x41')](_0x4498c3);})['then'](function(_0x3127c1){_0x30af9b[_0x63cd('0x42')]=_0x3127c1;return _0x30af9b;})[_0x63cd('0x25')](respondWithFilteredResult(_0x4fe45a,_0x4498c3))['catch'](handleError(_0x4fe45a,null));};exports[_0x63cd('0x43')]=function(_0x4c7fdd,_0x4dd767){var _0x5dab29={'raw':!![],'where':{'id':_0x4c7fdd['params']['id']}},_0x54fe3c={};_0x54fe3c[_0x63cd('0x2e')]=_['keys'](db[_0x63cd('0x2a')][_0x63cd('0x2b')]);_0x54fe3c[_0x63cd('0x30')]=_['keys'](_0x4c7fdd[_0x63cd('0x30')]);_0x54fe3c[_0x63cd('0x31')]=_[_0x63cd('0x33')](_0x54fe3c[_0x63cd('0x2e')],_0x54fe3c['query']);_0x5dab29['attributes']=_[_0x63cd('0x33')](_0x54fe3c['model'],qs[_0x63cd('0x34')](_0x4c7fdd[_0x63cd('0x30')][_0x63cd('0x34')]));_0x5dab29[_0x63cd('0x32')]=_0x5dab29[_0x63cd('0x32')][_0x63cd('0x35')]?_0x5dab29[_0x63cd('0x32')]:_0x54fe3c[_0x63cd('0x2e')];if(_0x4c7fdd[_0x63cd('0x30')][_0x63cd('0x3f')]){_0x5dab29['include']=[{'all':!![]}];}_0x5dab29=_[_0x63cd('0x3c')]({},_0x5dab29,_0x4c7fdd[_0x63cd('0x3e')]);return db[_0x63cd('0x2a')][_0x63cd('0x44')](_0x5dab29)[_0x63cd('0x25')](handleEntityNotFound(_0x4dd767,null))['then'](respondWithResult(_0x4dd767,null))[_0x63cd('0x45')](handleError(_0x4dd767,null));};exports[_0x63cd('0x46')]=function(_0x36942a,_0x4b71ac){return db[_0x63cd('0x2a')]['create'](_0x36942a[_0x63cd('0x47')],{})[_0x63cd('0x25')](respondWithResult(_0x4b71ac,0xc9))[_0x63cd('0x45')](handleError(_0x4b71ac,null));};exports[_0x63cd('0x24')]=function(_0x4cf3d4,_0x3bac8c){if(_0x4cf3d4[_0x63cd('0x47')]['id']){delete _0x4cf3d4[_0x63cd('0x47')]['id'];}return db[_0x63cd('0x2a')][_0x63cd('0x44')]({'where':{'id':_0x4cf3d4[_0x63cd('0x48')]['id']}})[_0x63cd('0x25')](handleEntityNotFound(_0x3bac8c,null))[_0x63cd('0x25')](saveUpdates(_0x4cf3d4[_0x63cd('0x47')],null))[_0x63cd('0x25')](respondWithResult(_0x3bac8c,null))[_0x63cd('0x45')](handleError(_0x3bac8c,null));};exports[_0x63cd('0x49')]=function(_0x24d50a,_0x10e8cf){return db['SquareDetailsReport'][_0x63cd('0x44')]({'where':{'id':_0x24d50a[_0x63cd('0x48')]['id']}})[_0x63cd('0x25')](handleEntityNotFound(_0x10e8cf,null))[_0x63cd('0x25')](removeEntity(_0x10e8cf,null))[_0x63cd('0x45')](handleError(_0x10e8cf,null));};exports[_0x63cd('0x4a')]=function(_0xfa8805,_0x550537){return db[_0x63cd('0x2a')][_0x63cd('0x4a')]()[_0x63cd('0x25')](respondWithResult(_0x550537,null))[_0x63cd('0x45')](handleError(_0x550537,null));};
\ No newline at end of file
+var _0xe2d3=['body','describe','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SquareDetailsReport','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','params','rawAttributes','length','find','catch','create'];(function(_0x29b6d1,_0x30af94){var _0x12a33f=function(_0x394717){while(--_0x394717){_0x29b6d1['push'](_0x29b6d1['shift']());}};_0x12a33f(++_0x30af94);}(_0xe2d3,0x1e5));var _0x3e2d=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xe2d3[_0x4687df];return _0x32eaef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e2d('0x0'));var jsonpatch=require(_0x3e2d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e2d('0x2'));var util=require(_0x3e2d('0x3'));var path=require(_0x3e2d('0x4'));var sox=require(_0x3e2d('0x5'));var csv=require(_0x3e2d('0x6'));var ejs=require(_0x3e2d('0x7'));var fs=require('fs');var fs_extra=require(_0x3e2d('0x8'));var _=require(_0x3e2d('0x9'));var squel=require(_0x3e2d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3e2d('0xb'));var toCsv=require(_0x3e2d('0x6'));var querystring=require(_0x3e2d('0xc'));var Papa=require(_0x3e2d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e2d('0xe'));var as=require(_0x3e2d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e2d('0x10'))('api');var utils=require(_0x3e2d('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3e2d('0x12'))['db'];function respondWithStatusCode(_0x7a7902,_0x10a17b){_0x10a17b=_0x10a17b||0xcc;return function(_0xa50d73){if(_0xa50d73){return _0x7a7902['sendStatus'](_0x10a17b);}return _0x7a7902[_0x3e2d('0x13')](_0x10a17b)[_0x3e2d('0x14')]();};}function respondWithResult(_0x56b63d,_0x384f5f){_0x384f5f=_0x384f5f||0xc8;return function(_0x463667){if(_0x463667){return _0x56b63d[_0x3e2d('0x13')](_0x384f5f)['json'](_0x463667);}};}function respondWithFilteredResult(_0x405d62,_0x439d49){return function(_0x168f66){if(_0x168f66){var _0x4bb74a=typeof _0x439d49['offset']===_0x3e2d('0x15')&&typeof _0x439d49[_0x3e2d('0x16')]===_0x3e2d('0x15');var _0x548e73=_0x168f66[_0x3e2d('0x17')];var _0x1b4165=_0x4bb74a?0x0:_0x439d49[_0x3e2d('0x18')];var _0x21d6bf=_0x4bb74a?_0x168f66[_0x3e2d('0x17')]:_0x439d49['offset']+_0x439d49[_0x3e2d('0x16')];var _0x56eb67;if(_0x21d6bf>=_0x548e73){_0x21d6bf=_0x548e73;_0x56eb67=0xc8;}else{_0x56eb67=0xce;}_0x405d62['status'](_0x56eb67);return _0x405d62[_0x3e2d('0x19')](_0x3e2d('0x1a'),_0x1b4165+'-'+_0x21d6bf+'/'+_0x548e73)[_0x3e2d('0x1b')](_0x168f66);}return null;};}function patchUpdates(_0x5de70f){return function(_0x35b7b9){try{jsonpatch[_0x3e2d('0x1c')](_0x35b7b9,_0x5de70f,!![]);}catch(_0x1a2ad3){return BPromise['reject'](_0x1a2ad3);}return _0x35b7b9[_0x3e2d('0x1d')]();};}function saveUpdates(_0x464d24,_0x249ee8){return function(_0x2baa22){if(_0x2baa22){return _0x2baa22[_0x3e2d('0x1e')](_0x464d24)['then'](function(_0x23136f){return _0x23136f;});}return null;};}function removeEntity(_0x48515c,_0x3f32b8){return function(_0x57cc72){if(_0x57cc72){return _0x57cc72[_0x3e2d('0x1f')]()[_0x3e2d('0x20')](function(){_0x48515c['status'](0xcc)[_0x3e2d('0x14')]();});}};}function handleEntityNotFound(_0x5ef988,_0x491616){return function(_0x3b257b){if(!_0x3b257b){_0x5ef988[_0x3e2d('0x21')](0x194);}return _0x3b257b;};}function handleError(_0xeb738d,_0x44fd27){_0x44fd27=_0x44fd27||0x1f4;return function(_0x5edd2c){logger[_0x3e2d('0x22')](_0x5edd2c[_0x3e2d('0x23')]);if(_0x5edd2c[_0x3e2d('0x24')]){delete _0x5edd2c[_0x3e2d('0x24')];}_0xeb738d['status'](_0x44fd27)[_0x3e2d('0x25')](_0x5edd2c);};}exports[_0x3e2d('0x26')]=function(_0x4a2879,_0x5cda96){var _0xc8e169={},_0x501b76={},_0xd48503={'count':0x0,'rows':[]};var _0x5bca32=_[_0x3e2d('0x27')](db[_0x3e2d('0x28')]['rawAttributes'],function(_0xbd8d35){return{'name':_0xbd8d35[_0x3e2d('0x29')],'type':_0xbd8d35[_0x3e2d('0x2a')][_0x3e2d('0x2b')]};});_0x501b76['model']=_['map'](_0x5bca32,'name');_0x501b76['query']=_[_0x3e2d('0x2c')](_0x4a2879[_0x3e2d('0x2d')]);_0x501b76[_0x3e2d('0x2e')]=_[_0x3e2d('0x2f')](_0x501b76[_0x3e2d('0x30')],_0x501b76['query']);_0xc8e169[_0x3e2d('0x31')]=_['intersection'](_0x501b76[_0x3e2d('0x30')],qs[_0x3e2d('0x32')](_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x32')]));_0xc8e169[_0x3e2d('0x31')]=_0xc8e169[_0x3e2d('0x31')]['length']?_0xc8e169['attributes']:_0x501b76['model'];if(!_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x33')](_0x3e2d('0x34'))){_0xc8e169[_0x3e2d('0x16')]=qs[_0x3e2d('0x16')](_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x16')]);_0xc8e169['offset']=qs[_0x3e2d('0x18')](_0x4a2879[_0x3e2d('0x2d')]['offset']);}_0xc8e169['order']=qs['sort'](_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x35')]);_0xc8e169['where']=qs[_0x3e2d('0x2e')](_[_0x3e2d('0x36')](_0x4a2879[_0x3e2d('0x2d')],_0x501b76['filters']),_0x5bca32);if(_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x37')]){_0xc8e169[_0x3e2d('0x38')]=_[_0x3e2d('0x39')](_0xc8e169[_0x3e2d('0x38')],{'$or':_[_0x3e2d('0x27')](_0x5bca32,function(_0x5f5b43){if(_0x5f5b43[_0x3e2d('0x2a')]!=='VIRTUAL'){var _0x1f5c89={};_0x1f5c89[_0x5f5b43[_0x3e2d('0x24')]]={'$like':'%'+_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x37')]+'%'};return _0x1f5c89;}})});}_0xc8e169=_[_0x3e2d('0x39')]({},_0xc8e169,_0x4a2879[_0x3e2d('0x3a')]);var _0x430101={'where':_0xc8e169['where']};return db[_0x3e2d('0x28')][_0x3e2d('0x17')](_0x430101)[_0x3e2d('0x20')](function(_0x4964e9){_0xd48503[_0x3e2d('0x17')]=_0x4964e9;if(_0x4a2879[_0x3e2d('0x2d')][_0x3e2d('0x3b')]){_0xc8e169['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x3e2d('0x3c')](_0xc8e169);})[_0x3e2d('0x20')](function(_0x45ac4d){_0xd48503['rows']=_0x45ac4d;return _0xd48503;})[_0x3e2d('0x20')](respondWithFilteredResult(_0x5cda96,_0xc8e169))['catch'](handleError(_0x5cda96,null));};exports['show']=function(_0x4ba91d,_0x8dab9d){var _0x39ee75={'raw':!![],'where':{'id':_0x4ba91d[_0x3e2d('0x3d')]['id']}},_0x59a1c0={};_0x59a1c0['model']=_[_0x3e2d('0x2c')](db['SquareDetailsReport'][_0x3e2d('0x3e')]);_0x59a1c0[_0x3e2d('0x2d')]=_[_0x3e2d('0x2c')](_0x4ba91d[_0x3e2d('0x2d')]);_0x59a1c0[_0x3e2d('0x2e')]=_[_0x3e2d('0x2f')](_0x59a1c0[_0x3e2d('0x30')],_0x59a1c0[_0x3e2d('0x2d')]);_0x39ee75['attributes']=_[_0x3e2d('0x2f')](_0x59a1c0[_0x3e2d('0x30')],qs[_0x3e2d('0x32')](_0x4ba91d[_0x3e2d('0x2d')][_0x3e2d('0x32')]));_0x39ee75[_0x3e2d('0x31')]=_0x39ee75[_0x3e2d('0x31')][_0x3e2d('0x3f')]?_0x39ee75[_0x3e2d('0x31')]:_0x59a1c0[_0x3e2d('0x30')];if(_0x4ba91d[_0x3e2d('0x2d')][_0x3e2d('0x3b')]){_0x39ee75['include']=[{'all':!![]}];}_0x39ee75=_[_0x3e2d('0x39')]({},_0x39ee75,_0x4ba91d[_0x3e2d('0x3a')]);return db[_0x3e2d('0x28')][_0x3e2d('0x40')](_0x39ee75)[_0x3e2d('0x20')](handleEntityNotFound(_0x8dab9d,null))[_0x3e2d('0x20')](respondWithResult(_0x8dab9d,null))[_0x3e2d('0x41')](handleError(_0x8dab9d,null));};exports[_0x3e2d('0x42')]=function(_0x3765f7,_0x339dea){return db[_0x3e2d('0x28')]['create'](_0x3765f7[_0x3e2d('0x43')],{})[_0x3e2d('0x20')](respondWithResult(_0x339dea,0xc9))[_0x3e2d('0x41')](handleError(_0x339dea,null));};exports[_0x3e2d('0x1e')]=function(_0x3d8b4d,_0xf5b6bd){if(_0x3d8b4d[_0x3e2d('0x43')]['id']){delete _0x3d8b4d[_0x3e2d('0x43')]['id'];}return db[_0x3e2d('0x28')][_0x3e2d('0x40')]({'where':{'id':_0x3d8b4d['params']['id']}})['then'](handleEntityNotFound(_0xf5b6bd,null))[_0x3e2d('0x20')](saveUpdates(_0x3d8b4d['body'],null))[_0x3e2d('0x20')](respondWithResult(_0xf5b6bd,null))[_0x3e2d('0x41')](handleError(_0xf5b6bd,null));};exports[_0x3e2d('0x1f')]=function(_0x30d8b4,_0xb0003b){return db['SquareDetailsReport'][_0x3e2d('0x40')]({'where':{'id':_0x30d8b4['params']['id']}})['then'](handleEntityNotFound(_0xb0003b,null))[_0x3e2d('0x20')](removeEntity(_0xb0003b,null))[_0x3e2d('0x41')](handleError(_0xb0003b,null));};exports[_0x3e2d('0x44')]=function(_0x5a1cf8,_0x143db2){return db['SquareDetailsReport'][_0x3e2d('0x44')]()['then'](respondWithResult(_0x143db2,null))['catch'](handleError(_0x143db2,null));};
\ No newline at end of file
index afb906d..a65e1fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e5=['util','api','moment','request-promise','path','../../config/environment','exports','define','report_square_details'];(function(_0x1cec85,_0x2d41b7){var _0x45e0bc=function(_0x453b3a){while(--_0x453b3a){_0x1cec85['push'](_0x1cec85['shift']());}};_0x45e0bc(++_0x2d41b7);}(_0x46e5,0xc6));var _0x546e=function(_0x14fa3f,_0x200ceb){_0x14fa3f=_0x14fa3f-0x0;var _0x2c7155=_0x46e5[_0x14fa3f];return _0x2c7155;};'use strict';var _=require('lodash');var util=require(_0x546e('0x0'));var logger=require('../../config/logger')(_0x546e('0x1'));var moment=require(_0x546e('0x2'));var BPromise=require('bluebird');var rp=require(_0x546e('0x3'));var fs=require('fs');var path=require(_0x546e('0x4'));var rimraf=require('rimraf');var config=require(_0x546e('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0x546e('0x6')]=function(_0x56b1d8,_0x23392c){return _0x56b1d8[_0x546e('0x7')]('SquareDetailsReport',attributes,{'tableName':_0x546e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd92=['bluebird','request-promise','path','../../config/environment','define','report_square_details','lodash','util','../../config/logger','api','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xdd92,0x1be));var _0x2dd9=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xdd92[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x2dd9('0x0'));var util=require(_0x2dd9('0x1'));var logger=require(_0x2dd9('0x2'))(_0x2dd9('0x3'));var moment=require(_0x2dd9('0x4'));var BPromise=require(_0x2dd9('0x5'));var rp=require(_0x2dd9('0x6'));var fs=require('fs');var path=require(_0x2dd9('0x7'));var rimraf=require('rimraf');var config=require(_0x2dd9('0x8'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x3639a9,_0x2c0357){return _0x3639a9[_0x2dd9('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x2dd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a90ca7..980f6b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa866=['client','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x82175b,_0x55c173){var _0x5c688b=function(_0x54f732){while(--_0x54f732){_0x82175b['push'](_0x82175b['shift']());}};_0x5c688b(++_0x55c173);}(_0xa866,0x6a));var _0x6a86=function(_0x110b97,_0x52a743){_0x110b97=_0x110b97-0x0;var _0x159e27=_0xa866[_0x110b97];return _0x159e27;};'use strict';var _=require(_0x6a86('0x0'));var util=require(_0x6a86('0x1'));var moment=require(_0x6a86('0x2'));var BPromise=require(_0x6a86('0x3'));var rs=require(_0x6a86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a86('0x5'))['db'];var utils=require(_0x6a86('0x6'));var logger=require(_0x6a86('0x7'))('rpc');var config=require(_0x6a86('0x8'));var jayson=require(_0x6a86('0x9'));var client=jayson[_0x6a86('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x183997,_0x288910,_0x3ed589){return new BPromise(function(_0x1330e1,_0x37e3ee){return client[_0x6a86('0xb')](_0x183997,_0x3ed589)[_0x6a86('0xc')](function(_0x4a83c9){logger[_0x6a86('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x288910,_0x6a86('0xe'));logger[_0x6a86('0xf')](_0x6a86('0x10'),_0x288910,'request\x20sent',JSON[_0x6a86('0x11')](_0x4a83c9));if(_0x4a83c9[_0x6a86('0x12')]){if(_0x4a83c9['error']['code']===0x1f4){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);return _0x37e3ee(_0x4a83c9[_0x6a86('0x12')][_0x6a86('0x14')]);}logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x4a83c9['error'][_0x6a86('0x14')]);return _0x1330e1(_0x4a83c9[_0x6a86('0x12')]['message']);}else{logger[_0x6a86('0xd')](_0x6a86('0x13'),_0x288910,_0x6a86('0xe'));_0x1330e1(_0x4a83c9[_0x6a86('0x15')][_0x6a86('0x14')]);}})[_0x6a86('0x16')](function(_0x500b59){logger[_0x6a86('0x12')](_0x6a86('0x13'),_0x288910,_0x500b59);_0x37e3ee(_0x500b59);});});}exports['CreateSquareDetailsReport']=function(_0x50024d){var _0x11fe3b=this;return new Promise(function(_0x535fd9,_0x588a2f){return db[_0x6a86('0x17')][_0x6a86('0x18')](_0x50024d[_0x6a86('0x19')],{'raw':_0x50024d['options']?_0x50024d[_0x6a86('0x1a')][_0x6a86('0x1b')]===undefined?!![]:![]:!![]})[_0x6a86('0xc')](function(_0x262bf5){logger[_0x6a86('0xd')](_0x6a86('0x1c'),_0x50024d);logger['debug']('CreateSquareDetailsReport',_0x50024d,JSON['stringify'](_0x262bf5));_0x535fd9(_0x262bf5);})[_0x6a86('0x16')](function(_0x2007c7){logger[_0x6a86('0x12')](_0x6a86('0x1c'),_0x2007c7['message'],_0x50024d);_0x588a2f(_0x11fe3b[_0x6a86('0x12')](0x1f4,_0x2007c7[_0x6a86('0x14')]));});});};
\ No newline at end of file
+var _0x3423=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','catch'];(function(_0x31e67b,_0xadf177){var _0x13e802=function(_0x2b5888){while(--_0x2b5888){_0x31e67b['push'](_0x31e67b['shift']());}};_0x13e802(++_0xadf177);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateSquareDetailsReport',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});};
\ No newline at end of file
index f52bac0..5d8cc50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x784a=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','./system.controller','get','index'];(function(_0x1eb786,_0x1b5f72){var _0x460cad=function(_0x3ec7a6){while(--_0x3ec7a6){_0x1eb786['push'](_0x1eb786['shift']());}};_0x460cad(++_0x1b5f72);}(_0x784a,0x11c));var _0xa784=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0x784a[_0x18e52b];return _0x3d3062;};'use strict';var express=require(_0xa784('0x0'));var router=express[_0xa784('0x1')]();var auth=require(_0xa784('0x2'));var controller=require(_0xa784('0x3'));router[_0xa784('0x4')]('/',auth['isAuthenticated'](),controller[_0xa784('0x5')]);router['get'](_0xa784('0x6'),auth[_0xa784('0x7')](),controller[_0xa784('0x8')]);module[_0xa784('0x9')]=router;
\ No newline at end of file
+var _0x02fe=['index','/process/:pid/kill','isAuthenticated','killProcess','exports','express','./system.controller','get'];(function(_0x55c066,_0x580eca){var _0x453857=function(_0x57478d){while(--_0x57478d){_0x55c066['push'](_0x55c066['shift']());}};_0x453857(++_0x580eca);}(_0x02fe,0x115));var _0xe02f=function(_0x61f1d,_0x24581b){_0x61f1d=_0x61f1d-0x0;var _0x2006a6=_0x02fe[_0x61f1d];return _0x2006a6;};'use strict';var express=require(_0xe02f('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe02f('0x1'));router[_0xe02f('0x2')]('/',auth['isAuthenticated'](),controller[_0xe02f('0x3')]);router['get'](_0xe02f('0x4'),auth[_0xe02f('0x5')](),controller[_0xe02f('0x6')]);module[_0xe02f('0x7')]=router;
\ No newline at end of file
index 0734aa6..419f48d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5638=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','split','Process\x20with\x20pid\x20%s\x20not\x20found!','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec'];(function(_0xe1dbe4,_0x470e9d){var _0x547d48=function(_0x1799e2){while(--_0x1799e2){_0xe1dbe4['push'](_0xe1dbe4['shift']());}};_0x547d48(++_0x470e9d);}(_0x5638,0xb3));var _0x8563=function(_0x574ce6,_0xc0c9d4){_0x574ce6=_0x574ce6-0x0;var _0x4298fa=_0x5638[_0x574ce6];return _0x4298fa;};'use strict';var info=require(_0x8563('0x0'));var exec=require(_0x8563('0x1'))[_0x8563('0x2')];var logger=require('../../config/logger')(_0x8563('0x3'));var util=require(_0x8563('0x4'));var BPromise=require(_0x8563('0x5'));var _=require(_0x8563('0x6'));function handleError(_0x54ae42,_0x400a59,_0x7cf7bc){_0x400a59=_0x400a59||0x1f4;return function(_0x4f68f8){logger[_0x8563('0x7')](_0x8563('0x8'),_0x7cf7bc,_0x400a59,util[_0x8563('0x9')](_0x4f68f8,{'showHidden':![],'depth':null}));delete _0x4f68f8[_0x8563('0xa')];_0x54ae42[_0x8563('0xb')](_0x400a59)[_0x8563('0xc')](_0x4f68f8);};}exports[_0x8563('0xd')]=function(_0x751c63,_0x402979){return info[_0x8563('0xe')]()[_0x8563('0xf')](function(_0x114a3f){return _0x402979['status'](0xc8)[_0x8563('0x10')](_0x114a3f);})[_0x8563('0x11')](function(_0x35dd38){return _0x402979['status'](0x1f4)['json'](_0x35dd38);});};exports[_0x8563('0x12')]=function(_0x4a615c,_0x365261){var _0x57c7f0=[_0x8563('0x13')];return new BPromise(function(_0x2b4018,_0x98deef){return exec(util[_0x8563('0x14')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x4a615c[_0x8563('0x15')][_0x8563('0x16')]),function(_0x895fbb,_0x24c901,_0x231022){if(_0x895fbb){return _0x98deef(_0x895fbb);}return _0x2b4018(_0x24c901);});})['then'](function(_0x4b962e){var _0x1add8b=![];var _0x4c4989=_0x4b962e[_0x8563('0x17')](/\n/);for(var _0x42512d=0x0,_0x4d199a=_0x57c7f0['length'];_0x42512d<_0x4d199a,_0x1add8b===![];_0x42512d+=0x1){if(_0x4b962e['indexOf'](_0x57c7f0[_0x42512d])>=0x0){_0x1add8b=!![];}}if(!_0x1add8b){throw new Error(util['format'](_0x8563('0x18'),_0x4a615c[_0x8563('0x15')][_0x8563('0x16')]));}process['kill'](_0x4a615c['params'][_0x8563('0x16')],'SIGINT');return _0x365261[_0x8563('0xb')](0xc8)[_0x8563('0x10')]({'message':util[_0x8563('0x14')](_0x8563('0x19'),_0x4a615c['params']['pid'])});})[_0x8563('0x11')](handleError(_0x365261,null,_0x8563('0x12')));};
\ No newline at end of file
+var _0xeca2=['params','pid','split','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','index','then','json','catch','killProcess','components/import/cm'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0xeca2,0x1a5));var _0x2eca=function(_0x35774f,_0x9338be){_0x35774f=_0x35774f-0x0;var _0x39c0cf=_0xeca2[_0x35774f];return _0x39c0cf;};'use strict';var info=require(_0x2eca('0x0'));var exec=require(_0x2eca('0x1'))[_0x2eca('0x2')];var logger=require(_0x2eca('0x3'))(_0x2eca('0x4'));var util=require('util');var BPromise=require(_0x2eca('0x5'));var _=require(_0x2eca('0x6'));function handleError(_0x4a581f,_0x5de45d,_0x69c823){_0x5de45d=_0x5de45d||0x1f4;return function(_0x1f159e){logger['error'](_0x2eca('0x7'),_0x69c823,_0x5de45d,util[_0x2eca('0x8')](_0x1f159e,{'showHidden':![],'depth':null}));delete _0x1f159e['name'];_0x4a581f[_0x2eca('0x9')](_0x5de45d)['send'](_0x1f159e);};}exports[_0x2eca('0xa')]=function(_0x2477fd,_0x3bb90a){return info['getAllData']()[_0x2eca('0xb')](function(_0x1c4f10){return _0x3bb90a[_0x2eca('0x9')](0xc8)[_0x2eca('0xc')](_0x1c4f10);})[_0x2eca('0xd')](function(_0x570ced){return _0x3bb90a[_0x2eca('0x9')](0x1f4)['json'](_0x570ced);});};exports[_0x2eca('0xe')]=function(_0x2dd975,_0x224d45){var _0x39352e=[_0x2eca('0xf')];return new BPromise(function(_0x18f1d9,_0x579fc8){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x2dd975[_0x2eca('0x10')][_0x2eca('0x11')]),function(_0x2a5def,_0x5adb71,_0xaa79f4){if(_0x2a5def){return _0x579fc8(_0x2a5def);}return _0x18f1d9(_0x5adb71);});})[_0x2eca('0xb')](function(_0xa72ba1){var _0x39fccd=![];var _0xa27339=_0xa72ba1[_0x2eca('0x12')](/\n/);for(var _0x48d0c8=0x0,_0x16ca76=_0x39352e['length'];_0x48d0c8<_0x16ca76,_0x39fccd===![];_0x48d0c8+=0x1){if(_0xa72ba1['indexOf'](_0x39352e[_0x48d0c8])>=0x0){_0x39fccd=!![];}}if(!_0x39fccd){throw new Error(util[_0x2eca('0x13')](_0x2eca('0x14'),_0x2dd975[_0x2eca('0x10')][_0x2eca('0x11')]));}process[_0x2eca('0x15')](_0x2dd975[_0x2eca('0x10')][_0x2eca('0x11')],'SIGINT');return _0x224d45[_0x2eca('0x9')](0xc8)[_0x2eca('0xc')]({'message':util['format'](_0x2eca('0x16'),_0x2dd975['params']['pid'])});})[_0x2eca('0xd')](handleError(_0x224d45,null,_0x2eca('0xe')));};
\ No newline at end of file
index df430e7..f756b84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf2=['put','update','delete','destroy','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3bf2,0x169));var _0x23bf=function(_0x4e65cd,_0x13674b){_0x4e65cd=_0x4e65cd-0x0;var _0x524a1c=_0x3bf2[_0x4e65cd];return _0x524a1c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x23bf('0x0'));var timeout=require('connect-timeout');var express=require(_0x23bf('0x1'));var router=express[_0x23bf('0x2')]();var fs_extra=require(_0x23bf('0x3'));var auth=require(_0x23bf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x23bf('0x5'));var controller=require(_0x23bf('0x6'));router[_0x23bf('0x7')]('/',auth[_0x23bf('0x8')](),controller[_0x23bf('0x9')]);router[_0x23bf('0x7')](_0x23bf('0xa'),auth[_0x23bf('0x8')](),controller[_0x23bf('0xb')]);router['post']('/',auth[_0x23bf('0x8')](),controller[_0x23bf('0xc')]);router[_0x23bf('0xd')]('/:id',auth[_0x23bf('0x8')](),controller[_0x23bf('0xe')]);router[_0x23bf('0xf')](_0x23bf('0xa'),auth[_0x23bf('0x8')](),controller[_0x23bf('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xfd0c=['../../config/environment','./tag.controller','get','isAuthenticated','/:id','post','create','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20b8bc,_0xb0d38f){var _0x24a130=function(_0x7f41c0){while(--_0x7f41c0){_0x20b8bc['push'](_0x20b8bc['shift']());}};_0x24a130(++_0xb0d38f);}(_0xfd0c,0x139));var _0xcfd0=function(_0x4459b8,_0x3271b8){_0x4459b8=_0x4459b8-0x0;var _0x4a4b07=_0xfd0c[_0x4459b8];return _0x4a4b07;};'use strict';var multer=require(_0xcfd0('0x0'));var util=require('util');var path=require(_0xcfd0('0x1'));var timeout=require(_0xcfd0('0x2'));var express=require(_0xcfd0('0x3'));var router=express[_0xcfd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcfd0('0x5'));var interaction=require(_0xcfd0('0x6'));var config=require(_0xcfd0('0x7'));var controller=require(_0xcfd0('0x8'));router[_0xcfd0('0x9')]('/',auth[_0xcfd0('0xa')](),controller['index']);router[_0xcfd0('0x9')](_0xcfd0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xcfd0('0xc')]('/',auth[_0xcfd0('0xa')](),controller[_0xcfd0('0xd')]);router['put']('/:id',auth[_0xcfd0('0xa')](),controller['update']);router['delete'](_0xcfd0('0xb'),auth[_0xcfd0('0xa')](),controller[_0xcfd0('0xe')]);module[_0xcfd0('0xf')]=router;
\ No newline at end of file
index 33c6612..d5c3107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7948=['exports','STRING','name','#0091EA','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7948,0x185));var _0x8794=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x7948[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x8794('0x0'));module[_0x8794('0x1')]={'name':{'type':Sequelize[_0x8794('0x2')],'unique':_0x8794('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8794('0x2')],'defaultValue':_0x8794('0x4')},'description':{'type':Sequelize[_0x8794('0x2')]}};
\ No newline at end of file
+var _0x5a1c=['exports','STRING','sequelize'];(function(_0x57b0af,_0x45a8ae){var _0x1487e2=function(_0x8dd353){while(--_0x8dd353){_0x57b0af['push'](_0x57b0af['shift']());}};_0x1487e2(++_0x45a8ae);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0xce8484,_0x3c7af1){_0xce8484=_0xce8484-0x0;var _0x2d027c=_0x5a1c[_0xce8484];return _0x2d027c;};'use strict';var Sequelize=require(_0xc5a1('0x0'));module[_0xc5a1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc5a1('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xc5a1('0x2')]}};
\ No newline at end of file
index ce3f6aa..50296dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe57=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','get','Tags','UserProfileResource','destroy','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL','options','rows','show','includeAll','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x3146da,_0x277a70){var _0x1070de=function(_0x43a1b1){while(--_0x43a1b1){_0x3146da['push'](_0x3146da['shift']());}};_0x1070de(++_0x277a70);}(_0xfe57,0x195));var _0x7fe5=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xfe57[_0xf48cce];return _0x2a5c38;};'use strict';var emlformat=require(_0x7fe5('0x0'));var rimraf=require(_0x7fe5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7fe5('0x2'));var moment=require(_0x7fe5('0x3'));var BPromise=require(_0x7fe5('0x4'));var Mustache=require(_0x7fe5('0x5'));var util=require(_0x7fe5('0x6'));var path=require(_0x7fe5('0x7'));var sox=require(_0x7fe5('0x8'));var csv=require(_0x7fe5('0x9'));var ejs=require(_0x7fe5('0xa'));var fs=require('fs');var fs_extra=require(_0x7fe5('0xb'));var _=require(_0x7fe5('0xc'));var squel=require(_0x7fe5('0xd'));var crypto=require(_0x7fe5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fe5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7fe5('0x10'));var Papa=require(_0x7fe5('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7fe5('0x12'));var as=require(_0x7fe5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fe5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7fe5('0x15'));var licenseUtil=require(_0x7fe5('0x16'));var db=require(_0x7fe5('0x17'))['db'];function respondWithStatusCode(_0x225fc3,_0x53f76c){_0x53f76c=_0x53f76c||0xcc;return function(_0x329c95){if(_0x329c95){return _0x225fc3[_0x7fe5('0x18')](_0x53f76c);}return _0x225fc3['status'](_0x53f76c)[_0x7fe5('0x19')]();};}function respondWithResult(_0x54cfb2,_0x1f84b5){_0x1f84b5=_0x1f84b5||0xc8;return function(_0x2d297b){if(_0x2d297b){return _0x54cfb2['status'](_0x1f84b5)[_0x7fe5('0x1a')](_0x2d297b);}};}function respondWithFilteredResult(_0x56e76f,_0x39f175){return function(_0x221ab2){if(_0x221ab2){var _0xbdf0a4=typeof _0x39f175[_0x7fe5('0x1b')]===_0x7fe5('0x1c')&&typeof _0x39f175[_0x7fe5('0x1d')]==='undefined';var _0x166e23=_0x221ab2[_0x7fe5('0x1e')];var _0x340d5e=_0xbdf0a4?0x0:_0x39f175[_0x7fe5('0x1b')];var _0x2533db=_0xbdf0a4?_0x221ab2[_0x7fe5('0x1e')]:_0x39f175[_0x7fe5('0x1b')]+_0x39f175[_0x7fe5('0x1d')];var _0x478523;if(_0x2533db>=_0x166e23){_0x2533db=_0x166e23;_0x478523=0xc8;}else{_0x478523=0xce;}_0x56e76f[_0x7fe5('0x1f')](_0x478523);return _0x56e76f['set']('Content-Range',_0x340d5e+'-'+_0x2533db+'/'+_0x166e23)[_0x7fe5('0x1a')](_0x221ab2);}return null;};}function patchUpdates(_0x459c2d){return function(_0x2f6592){try{jsonpatch[_0x7fe5('0x20')](_0x2f6592,_0x459c2d,!![]);}catch(_0x39c560){return BPromise[_0x7fe5('0x21')](_0x39c560);}return _0x2f6592[_0x7fe5('0x22')]();};}function saveUpdates(_0xdd9df7,_0x1b271c){return function(_0x28a7fd){if(_0x28a7fd){return _0x28a7fd[_0x7fe5('0x23')](_0xdd9df7)[_0x7fe5('0x24')](function(_0x54ee98){return _0x54ee98;});}return null;};}function removeEntity(_0x3e7340,_0x2f39e0){return function(_0x43e547){if(_0x43e547){return _0x43e547['destroy']()[_0x7fe5('0x24')](function(){var _0x48ee56=_0x43e547[_0x7fe5('0x25')]({'plain':!![]});var _0x53f522=_0x7fe5('0x26');return db[_0x7fe5('0x27')][_0x7fe5('0x28')]({'where':{'type':_0x53f522,'resourceId':_0x48ee56['id']}})[_0x7fe5('0x24')](function(){return _0x43e547;});})[_0x7fe5('0x24')](function(){_0x3e7340[_0x7fe5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f2d25,_0x417a56){return function(_0x450759){if(!_0x450759){_0x5f2d25[_0x7fe5('0x18')](0x194);}return _0x450759;};}function handleError(_0x13c96b,_0x51407b){_0x51407b=_0x51407b||0x1f4;return function(_0x46f816){logger['error'](_0x46f816[_0x7fe5('0x29')]);if(_0x46f816[_0x7fe5('0x2a')]){delete _0x46f816[_0x7fe5('0x2a')];}_0x13c96b[_0x7fe5('0x1f')](_0x51407b)[_0x7fe5('0x2b')](_0x46f816);};}exports[_0x7fe5('0x2c')]=function(_0x5c07f0,_0xe521c6){var _0x423da8={},_0x5ec0b4={},_0xfc1189={'count':0x0,'rows':[]};var _0x246b70=_[_0x7fe5('0x2d')](db[_0x7fe5('0x2e')][_0x7fe5('0x2f')],function(_0x53ef16){return{'name':_0x53ef16['fieldName'],'type':_0x53ef16[_0x7fe5('0x30')][_0x7fe5('0x31')]};});_0x5ec0b4[_0x7fe5('0x32')]=_[_0x7fe5('0x2d')](_0x246b70,'name');_0x5ec0b4[_0x7fe5('0x33')]=_[_0x7fe5('0x34')](_0x5c07f0[_0x7fe5('0x33')]);_0x5ec0b4[_0x7fe5('0x35')]=_[_0x7fe5('0x36')](_0x5ec0b4[_0x7fe5('0x32')],_0x5ec0b4['query']);_0x423da8[_0x7fe5('0x37')]=_[_0x7fe5('0x36')](_0x5ec0b4[_0x7fe5('0x32')],qs[_0x7fe5('0x38')](_0x5c07f0['query']['fields']));_0x423da8[_0x7fe5('0x37')]=_0x423da8['attributes'][_0x7fe5('0x39')]?_0x423da8['attributes']:_0x5ec0b4[_0x7fe5('0x32')];if(!_0x5c07f0['query']['hasOwnProperty']('nolimit')){_0x423da8['limit']=qs[_0x7fe5('0x1d')](_0x5c07f0[_0x7fe5('0x33')]['limit']);_0x423da8[_0x7fe5('0x1b')]=qs[_0x7fe5('0x1b')](_0x5c07f0['query'][_0x7fe5('0x1b')]);}_0x423da8['order']=qs['sort'](_0x5c07f0[_0x7fe5('0x33')][_0x7fe5('0x3a')]);_0x423da8[_0x7fe5('0x3b')]=qs[_0x7fe5('0x35')](_[_0x7fe5('0x3c')](_0x5c07f0['query'],_0x5ec0b4[_0x7fe5('0x35')]),_0x246b70);if(_0x5c07f0[_0x7fe5('0x33')]['filter']){_0x423da8[_0x7fe5('0x3b')]=_[_0x7fe5('0x3d')](_0x423da8[_0x7fe5('0x3b')],{'$or':_[_0x7fe5('0x2d')](_0x246b70,function(_0x21c6d0){if(_0x21c6d0[_0x7fe5('0x30')]!==_0x7fe5('0x3e')){var _0x50cfa5={};_0x50cfa5[_0x21c6d0['name']]={'$like':'%'+_0x5c07f0[_0x7fe5('0x33')]['filter']+'%'};return _0x50cfa5;}})});}_0x423da8=_[_0x7fe5('0x3d')]({},_0x423da8,_0x5c07f0[_0x7fe5('0x3f')]);var _0x5df71d={'where':_0x423da8[_0x7fe5('0x3b')]};return db[_0x7fe5('0x2e')][_0x7fe5('0x1e')](_0x5df71d)[_0x7fe5('0x24')](function(_0x2fd004){_0xfc1189[_0x7fe5('0x1e')]=_0x2fd004;if(_0x5c07f0[_0x7fe5('0x33')]['includeAll']){_0x423da8['include']=[{'all':!![]}];}return db[_0x7fe5('0x2e')]['findAll'](_0x423da8);})[_0x7fe5('0x24')](function(_0x1a3e0d){_0xfc1189[_0x7fe5('0x40')]=_0x1a3e0d;return _0xfc1189;})[_0x7fe5('0x24')](respondWithFilteredResult(_0xe521c6,_0x423da8))['catch'](handleError(_0xe521c6,null));};exports[_0x7fe5('0x41')]=function(_0x5439bc,_0x498312){var _0x14a570={'raw':!![],'where':{'id':_0x5439bc['params']['id']}},_0x585f27={};_0x585f27[_0x7fe5('0x32')]=_[_0x7fe5('0x34')](db[_0x7fe5('0x2e')][_0x7fe5('0x2f')]);_0x585f27[_0x7fe5('0x33')]=_['keys'](_0x5439bc[_0x7fe5('0x33')]);_0x585f27[_0x7fe5('0x35')]=_['intersection'](_0x585f27[_0x7fe5('0x32')],_0x585f27[_0x7fe5('0x33')]);_0x14a570[_0x7fe5('0x37')]=_[_0x7fe5('0x36')](_0x585f27['model'],qs[_0x7fe5('0x38')](_0x5439bc[_0x7fe5('0x33')][_0x7fe5('0x38')]));_0x14a570['attributes']=_0x14a570[_0x7fe5('0x37')][_0x7fe5('0x39')]?_0x14a570[_0x7fe5('0x37')]:_0x585f27['model'];if(_0x5439bc[_0x7fe5('0x33')][_0x7fe5('0x42')]){_0x14a570[_0x7fe5('0x43')]=[{'all':!![]}];}_0x14a570=_['merge']({},_0x14a570,_0x5439bc[_0x7fe5('0x3f')]);return db[_0x7fe5('0x2e')][_0x7fe5('0x44')](_0x14a570)[_0x7fe5('0x24')](handleEntityNotFound(_0x498312,null))[_0x7fe5('0x24')](respondWithResult(_0x498312,null))[_0x7fe5('0x45')](handleError(_0x498312,null));};exports[_0x7fe5('0x46')]=function(_0x447b57,_0x446f01){return db[_0x7fe5('0x2e')][_0x7fe5('0x46')](_0x447b57['body'],{})['then'](function(_0x54dbb9){var _0x5f2232=_0x447b57[_0x7fe5('0x47')]['get']({'plain':!![]});if(!_0x5f2232)throw new Error(_0x7fe5('0x48'));if(_0x5f2232[_0x7fe5('0x49')]===_0x7fe5('0x47')){var _0x1d9ca8=_0x54dbb9[_0x7fe5('0x25')]({'plain':!![]});var _0x5b24a4=_0x7fe5('0x26');return db[_0x7fe5('0x4a')][_0x7fe5('0x44')]({'where':{'name':_0x5b24a4,'userProfileId':_0x5f2232[_0x7fe5('0x4b')]},'raw':!![]})[_0x7fe5('0x24')](function(_0x259f7e){if(_0x259f7e&&_0x259f7e[_0x7fe5('0x4c')]===0x0){return db[_0x7fe5('0x27')][_0x7fe5('0x46')]({'name':_0x1d9ca8[_0x7fe5('0x2a')],'resourceId':_0x1d9ca8['id'],'type':_0x259f7e['name'],'sectionId':_0x259f7e['id']},{})[_0x7fe5('0x24')](function(){return _0x54dbb9;});}else{return _0x54dbb9;}})[_0x7fe5('0x45')](function(_0x2aa38d){logger[_0x7fe5('0x4d')](_0x7fe5('0x4e'),_0x2aa38d);throw _0x2aa38d;});}return _0x54dbb9;})[_0x7fe5('0x24')](respondWithResult(_0x446f01,0xc9))['catch'](handleError(_0x446f01,null));};exports[_0x7fe5('0x23')]=function(_0x1a44d3,_0x3d83fd){if(_0x1a44d3[_0x7fe5('0x4f')]['id']){delete _0x1a44d3[_0x7fe5('0x4f')]['id'];}return db[_0x7fe5('0x2e')][_0x7fe5('0x44')]({'where':{'id':_0x1a44d3['params']['id']}})[_0x7fe5('0x24')](handleEntityNotFound(_0x3d83fd,null))[_0x7fe5('0x24')](saveUpdates(_0x1a44d3[_0x7fe5('0x4f')],null))[_0x7fe5('0x24')](respondWithResult(_0x3d83fd,null))[_0x7fe5('0x45')](handleError(_0x3d83fd,null));};exports['destroy']=function(_0x2ddf6b,_0x34a430){return db[_0x7fe5('0x2e')][_0x7fe5('0x44')]({'where':{'id':_0x2ddf6b['params']['id']}})[_0x7fe5('0x24')](handleEntityNotFound(_0x34a430,null))[_0x7fe5('0x24')](removeEntity(_0x34a430,null))[_0x7fe5('0x45')](handleError(_0x34a430,null));};
\ No newline at end of file
+var _0xc788=['where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Tags','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter'];(function(_0xca931c,_0x4e722e){var _0x48fca5=function(_0x47c1fe){while(--_0x47c1fe){_0xca931c['push'](_0xca931c['shift']());}};_0x48fca5(++_0x4e722e);}(_0xc788,0xc4));var _0x8c78=function(_0x38b3cb,_0x4ad7b3){_0x38b3cb=_0x38b3cb-0x0;var _0x5a9a84=_0xc788[_0x38b3cb];return _0x5a9a84;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){var _0x4a7d20=_0xbfdf6f[_0x8c78('0x26')]({'plain':!![]});var _0x458763=_0x8c78('0x27');return db['UserProfileResource'][_0x8c78('0x25')]({'where':{'type':_0x458763,'resourceId':_0x4a7d20['id']}})['then'](function(){return _0xbfdf6f;});})[_0x8c78('0x24')](function(){_0x215940[_0x8c78('0x19')](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x496c51,_0x583a74){return function(_0x2568d5){if(!_0x2568d5){_0x496c51['sendStatus'](0x194);}return _0x2568d5;};}function handleError(_0x20b128,_0x4376da){_0x4376da=_0x4376da||0x1f4;return function(_0x394c1d){logger[_0x8c78('0x28')](_0x394c1d[_0x8c78('0x29')]);if(_0x394c1d[_0x8c78('0x2a')]){delete _0x394c1d['name'];}_0x20b128[_0x8c78('0x19')](_0x4376da)['send'](_0x394c1d);};}exports[_0x8c78('0x2b')]=function(_0x17f4c8,_0xb69c52){var _0x4e764f={},_0x1f1a0c={},_0x3816d2={'count':0x0,'rows':[]};var _0x4f0005=_[_0x8c78('0x2c')](db[_0x8c78('0x2d')][_0x8c78('0x2e')],function(_0x487a4c){return{'name':_0x487a4c[_0x8c78('0x2f')],'type':_0x487a4c[_0x8c78('0x30')][_0x8c78('0x31')]};});_0x1f1a0c['model']=_[_0x8c78('0x2c')](_0x4f0005,_0x8c78('0x2a'));_0x1f1a0c['query']=_[_0x8c78('0x32')](_0x17f4c8[_0x8c78('0x33')]);_0x1f1a0c[_0x8c78('0x34')]=_[_0x8c78('0x35')](_0x1f1a0c[_0x8c78('0x36')],_0x1f1a0c[_0x8c78('0x33')]);_0x4e764f[_0x8c78('0x37')]=_[_0x8c78('0x35')](_0x1f1a0c[_0x8c78('0x36')],qs[_0x8c78('0x38')](_0x17f4c8['query'][_0x8c78('0x38')]));_0x4e764f[_0x8c78('0x37')]=_0x4e764f[_0x8c78('0x37')][_0x8c78('0x39')]?_0x4e764f[_0x8c78('0x37')]:_0x1f1a0c['model'];if(!_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x3a')](_0x8c78('0x3b'))){_0x4e764f['limit']=qs[_0x8c78('0x1d')](_0x17f4c8[_0x8c78('0x33')]['limit']);_0x4e764f[_0x8c78('0x3c')]=qs['offset'](_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x3c')]);}_0x4e764f[_0x8c78('0x3d')]=qs[_0x8c78('0x3e')](_0x17f4c8['query'][_0x8c78('0x3e')]);_0x4e764f['where']=qs[_0x8c78('0x34')](_[_0x8c78('0x3f')](_0x17f4c8[_0x8c78('0x33')],_0x1f1a0c['filters']),_0x4f0005);if(_0x17f4c8['query'][_0x8c78('0x40')]){_0x4e764f[_0x8c78('0x41')]=_[_0x8c78('0x42')](_0x4e764f[_0x8c78('0x41')],{'$or':_[_0x8c78('0x2c')](_0x4f0005,function(_0x484931){if(_0x484931[_0x8c78('0x30')]!==_0x8c78('0x43')){var _0x1f0a2b={};_0x1f0a2b[_0x484931[_0x8c78('0x2a')]]={'$like':'%'+_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x40')]+'%'};return _0x1f0a2b;}})});}_0x4e764f=_[_0x8c78('0x42')]({},_0x4e764f,_0x17f4c8['options']);var _0x3995f4={'where':_0x4e764f[_0x8c78('0x41')]};return db['Tag']['count'](_0x3995f4)[_0x8c78('0x24')](function(_0x1612d5){_0x3816d2['count']=_0x1612d5;if(_0x17f4c8[_0x8c78('0x33')][_0x8c78('0x44')]){_0x4e764f['include']=[{'all':!![]}];}return db[_0x8c78('0x2d')][_0x8c78('0x45')](_0x4e764f);})['then'](function(_0x10d521){_0x3816d2[_0x8c78('0x46')]=_0x10d521;return _0x3816d2;})[_0x8c78('0x24')](respondWithFilteredResult(_0xb69c52,_0x4e764f))[_0x8c78('0x47')](handleError(_0xb69c52,null));};exports[_0x8c78('0x48')]=function(_0x4e4880,_0x545d90){var _0x2841c2={'raw':!![],'where':{'id':_0x4e4880[_0x8c78('0x49')]['id']}},_0x2f6a6b={};_0x2f6a6b[_0x8c78('0x36')]=_[_0x8c78('0x32')](db[_0x8c78('0x2d')][_0x8c78('0x2e')]);_0x2f6a6b[_0x8c78('0x33')]=_[_0x8c78('0x32')](_0x4e4880[_0x8c78('0x33')]);_0x2f6a6b[_0x8c78('0x34')]=_['intersection'](_0x2f6a6b[_0x8c78('0x36')],_0x2f6a6b[_0x8c78('0x33')]);_0x2841c2[_0x8c78('0x37')]=_[_0x8c78('0x35')](_0x2f6a6b[_0x8c78('0x36')],qs['fields'](_0x4e4880[_0x8c78('0x33')][_0x8c78('0x38')]));_0x2841c2[_0x8c78('0x37')]=_0x2841c2[_0x8c78('0x37')][_0x8c78('0x39')]?_0x2841c2['attributes']:_0x2f6a6b[_0x8c78('0x36')];if(_0x4e4880['query']['includeAll']){_0x2841c2[_0x8c78('0x4a')]=[{'all':!![]}];}_0x2841c2=_[_0x8c78('0x42')]({},_0x2841c2,_0x4e4880[_0x8c78('0x4b')]);return db['Tag'][_0x8c78('0x4c')](_0x2841c2)[_0x8c78('0x24')](handleEntityNotFound(_0x545d90,null))[_0x8c78('0x24')](respondWithResult(_0x545d90,null))[_0x8c78('0x47')](handleError(_0x545d90,null));};exports[_0x8c78('0x4d')]=function(_0x38083e,_0x26103c){return db[_0x8c78('0x2d')][_0x8c78('0x4d')](_0x38083e['body'],{})[_0x8c78('0x24')](function(_0x1fcf97){var _0xba0de6=_0x38083e[_0x8c78('0x4e')]['get']({'plain':!![]});if(!_0xba0de6)throw new Error(_0x8c78('0x4f'));if(_0xba0de6[_0x8c78('0x50')]===_0x8c78('0x4e')){var _0x431125=_0x1fcf97['get']({'plain':!![]});var _0x336b95=_0x8c78('0x27');return db[_0x8c78('0x51')]['find']({'where':{'name':_0x336b95,'userProfileId':_0xba0de6[_0x8c78('0x52')]},'raw':!![]})['then'](function(_0xae80d){if(_0xae80d&&_0xae80d[_0x8c78('0x53')]===0x0){return db[_0x8c78('0x54')][_0x8c78('0x4d')]({'name':_0x431125[_0x8c78('0x2a')],'resourceId':_0x431125['id'],'type':_0xae80d[_0x8c78('0x2a')],'sectionId':_0xae80d['id']},{})[_0x8c78('0x24')](function(){return _0x1fcf97;});}else{return _0x1fcf97;}})[_0x8c78('0x47')](function(_0x19d807){logger[_0x8c78('0x28')](_0x8c78('0x55'),_0x19d807);throw _0x19d807;});}return _0x1fcf97;})[_0x8c78('0x24')](respondWithResult(_0x26103c,0xc9))[_0x8c78('0x47')](handleError(_0x26103c,null));};exports[_0x8c78('0x23')]=function(_0x54b40d,_0x22fe6c){if(_0x54b40d[_0x8c78('0x56')]['id']){delete _0x54b40d[_0x8c78('0x56')]['id'];}return db[_0x8c78('0x2d')]['find']({'where':{'id':_0x54b40d[_0x8c78('0x49')]['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x22fe6c,null))[_0x8c78('0x24')](saveUpdates(_0x54b40d[_0x8c78('0x56')],null))[_0x8c78('0x24')](respondWithResult(_0x22fe6c,null))[_0x8c78('0x47')](handleError(_0x22fe6c,null));};exports['destroy']=function(_0x1e616c,_0x42a34e){return db['Tag'][_0x8c78('0x4c')]({'where':{'id':_0x1e616c['params']['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x42a34e,null))[_0x8c78('0x24')](removeEntity(_0x42a34e,null))[_0x8c78('0x47')](handleError(_0x42a34e,null));};
\ No newline at end of file
index 2f8b765..baf7fcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee9a=['util','moment','bluebird','request-promise','path','../../config/environment','./tag.attributes','exports','Tag'];(function(_0x40f8bf,_0x510aae){var _0x3f699d=function(_0x329570){while(--_0x329570){_0x40f8bf['push'](_0x40f8bf['shift']());}};_0x3f699d(++_0x510aae);}(_0xee9a,0x1b9));var _0xaee9=function(_0x3d43a0,_0x356012){_0x3d43a0=_0x3d43a0-0x0;var _0x2cdc9e=_0xee9a[_0x3d43a0];return _0x2cdc9e;};'use strict';var _=require('lodash');var util=require(_0xaee9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xaee9('0x1'));var BPromise=require(_0xaee9('0x2'));var rp=require(_0xaee9('0x3'));var fs=require('fs');var path=require(_0xaee9('0x4'));var rimraf=require('rimraf');var config=require(_0xaee9('0x5'));var attributes=require(_0xaee9('0x6'));module[_0xaee9('0x7')]=function(_0x471210,_0x8a6b40){return _0x471210['define'](_0xaee9('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc006=['api','moment','bluebird','path','../../config/environment','./tag.attributes','Tag','tools_tags','lodash'];(function(_0x23cf05,_0x452a9c){var _0x5f6985=function(_0x371eb0){while(--_0x371eb0){_0x23cf05['push'](_0x23cf05['shift']());}};_0x5f6985(++_0x452a9c);}(_0xc006,0x1e5));var _0x6c00=function(_0x16438a,_0x3544be){_0x16438a=_0x16438a-0x0;var _0x9d2e74=_0xc006[_0x16438a];return _0x9d2e74;};'use strict';var _=require(_0x6c00('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6c00('0x1'));var moment=require(_0x6c00('0x2'));var BPromise=require(_0x6c00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c00('0x4'));var rimraf=require('rimraf');var config=require(_0x6c00('0x5'));var attributes=require(_0x6c00('0x6'));module['exports']=function(_0x3c0e2c,_0x581c8f){return _0x3c0e2c['define'](_0x6c00('0x7'),attributes,{'tableName':_0x6c00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3cb4cba..7420f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fef=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2de139,_0x23f202){var _0x3c1948=function(_0x5a4dc2){while(--_0x5a4dc2){_0x2de139['push'](_0x2de139['shift']());}};_0x3c1948(++_0x23f202);}(_0x4fef,0x10f));var _0xf4fe=function(_0x2555e7,_0x361cf4){_0x2555e7=_0x2555e7-0x0;var _0xaa6169=_0x4fef[_0x2555e7];return _0xaa6169;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var moment=require('moment');var BPromise=require(_0xf4fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4fe('0x3'));var db=require(_0xf4fe('0x4'))['db'];var utils=require(_0xf4fe('0x5'));var logger=require(_0xf4fe('0x6'))(_0xf4fe('0x7'));var config=require(_0xf4fe('0x8'));var jayson=require(_0xf4fe('0x9'));var client=jayson[_0xf4fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x363096,_0x3e844d,_0x4805b0){return new BPromise(function(_0x23b761,_0x1e858f){return client[_0xf4fe('0xb')](_0x363096,_0x4805b0)[_0xf4fe('0xc')](function(_0xdec534){logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,_0xf4fe('0xf'));logger['debug'](_0xf4fe('0x10'),_0x3e844d,'request\x20sent',JSON[_0xf4fe('0x11')](_0xdec534));if(_0xdec534[_0xf4fe('0x12')]){if(_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x13')]===0x1f4){logger[_0xf4fe('0x12')]('Tag,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x1e858f(_0xdec534[_0xf4fe('0x12')]['message']);}logger[_0xf4fe('0x12')]('Tag,\x20%s,\x20%s',_0x3e844d,_0xdec534[_0xf4fe('0x12')][_0xf4fe('0x14')]);return _0x23b761(_0xdec534[_0xf4fe('0x12')]['message']);}else{logger[_0xf4fe('0xd')](_0xf4fe('0xe'),_0x3e844d,'request\x20sent');_0x23b761(_0xdec534[_0xf4fe('0x15')][_0xf4fe('0x14')]);}})[_0xf4fe('0x16')](function(_0x565dc6){logger['error'](_0xf4fe('0xe'),_0x3e844d,_0x565dc6);_0x1e858f(_0x565dc6);});});}
\ No newline at end of file
+var _0x9b67=['code','message','Tag,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error'];(function(_0x18ae72,_0x1d05d9){var _0x34f4ef=function(_0x4fce13){while(--_0x4fce13){_0x18ae72['push'](_0x18ae72['shift']());}};_0x34f4ef(++_0x1d05d9);}(_0x9b67,0xf6));var _0x79b6=function(_0x5bf448,_0x393118){_0x5bf448=_0x5bf448-0x0;var _0x1889d5=_0x9b67[_0x5bf448];return _0x1889d5;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));var BPromise=require(_0x79b6('0x3'));var rs=require(_0x79b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x79b6('0x5'))['db'];var utils=require(_0x79b6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x79b6('0x7'));var jayson=require(_0x79b6('0x8'));var client=jayson[_0x79b6('0x9')][_0x79b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa6a05,_0x128543,_0x34adbe){return new BPromise(function(_0x58ae2d,_0x1270a7){return client[_0x79b6('0xb')](_0xfa6a05,_0x34adbe)[_0x79b6('0xc')](function(_0x3d28cd){logger[_0x79b6('0xd')]('Tag,\x20%s,\x20%s',_0x128543,_0x79b6('0xe'));logger[_0x79b6('0xf')](_0x79b6('0x10'),_0x128543,_0x79b6('0xe'),JSON['stringify'](_0x3d28cd));if(_0x3d28cd['error']){if(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x12')]===0x1f4){logger[_0x79b6('0x11')]('Tag,\x20%s,\x20%s',_0x128543,_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);return _0x1270a7(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);}logger[_0x79b6('0x11')](_0x79b6('0x14'),_0x128543,_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);return _0x58ae2d(_0x3d28cd[_0x79b6('0x11')][_0x79b6('0x13')]);}else{logger[_0x79b6('0xd')](_0x79b6('0x14'),_0x128543,_0x79b6('0xe'));_0x58ae2d(_0x3d28cd['result'][_0x79b6('0x13')]);}})[_0x79b6('0x15')](function(_0xc36fd3){logger[_0x79b6('0x11')](_0x79b6('0x14'),_0x128543,_0xc36fd3);_0x1270a7(_0xc36fd3);});});}
\ No newline at end of file
index 45d48a3..d9f9e45 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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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 20db359..d50ffd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x48065d,_0x428376){var _0x3f1947=function(_0x46083e){while(--_0x46083e){_0x48065d['push'](_0x48065d['shift']());}};_0x3f1947(++_0x428376);}(_0xb10b,0x12a));var _0xbb10=function(_0xc28702,_0x145b87){_0xc28702=_0xc28702-0x0;var _0x3b6e9e=_0xb10b[_0xc28702];return _0x3b6e9e;};'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(_0x16dded,_0x48a20f){var _0x5837e4=function(_0x2e1897){while(--_0x2e1897){_0x16dded['push'](_0x16dded['shift']());}};_0x5837e4(++_0x48a20f);}(_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 16c1233..1c33fbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabd6=['isValidChannel','ids','removeQueues','addAgents','Voice','Chat','Fax','Openchannel','Whatsapp','sequelize','transaction','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','interface','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','all','spread','removeAgents','Mail','Sms','parse','Queue:remove','getAgents','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','get','Teams','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getQueues','findOne','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues'];(function(_0x3907bc,_0x51fdcd){var _0x3398f3=function(_0x4db6f2){while(--_0x4db6f2){_0x3907bc['push'](_0x3907bc['shift']());}};_0x3398f3(++_0x51fdcd);}(_0xabd6,0x19d));var _0x6abd=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0xabd6[_0x4ee9cd];return _0x328a5b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6abd('0x0'));var jsonpatch=require(_0x6abd('0x1'));var rp=require(_0x6abd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6abd('0x3'));var util=require('util');var path=require(_0x6abd('0x4'));var sox=require('sox');var csv=require(_0x6abd('0x5'));var ejs=require(_0x6abd('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6abd('0x7'));var crypto=require(_0x6abd('0x8'));var jsforce=require(_0x6abd('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6abd('0x5'));var querystring=require(_0x6abd('0xa'));var Papa=require(_0x6abd('0xb'));var Redis=require('ioredis');var authService=require(_0x6abd('0xc'));var qs=require(_0x6abd('0xd'));var as=require(_0x6abd('0xe'));var hardwareService=require(_0x6abd('0xf'));var logger=require(_0x6abd('0x10'))('api');var utils=require(_0x6abd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6abd('0x12'));var db=require(_0x6abd('0x13'))['db'];config[_0x6abd('0x14')]=_[_0x6abd('0x15')](config[_0x6abd('0x14')],{'host':_0x6abd('0x16'),'port':0x18eb});var socket=require(_0x6abd('0x17'))(new Redis(config[_0x6abd('0x14')]));require('./team.socket')[_0x6abd('0x18')](socket);function respondWithStatusCode(_0x150fd3,_0x26970f){_0x26970f=_0x26970f||0xcc;return function(_0x40dd40){if(_0x40dd40){return _0x150fd3[_0x6abd('0x19')](_0x26970f);}return _0x150fd3['status'](_0x26970f)[_0x6abd('0x1a')]();};}function respondWithResult(_0x189a3e,_0x3e7c84){_0x3e7c84=_0x3e7c84||0xc8;return function(_0xdffadd){if(_0xdffadd){return _0x189a3e[_0x6abd('0x1b')](_0x3e7c84)[_0x6abd('0x1c')](_0xdffadd);}};}function respondWithFilteredResult(_0x2ee543,_0x589c6b){return function(_0x1ba40f){if(_0x1ba40f){var _0x5deca8=typeof _0x589c6b[_0x6abd('0x1d')]===_0x6abd('0x1e')&&typeof _0x589c6b['limit']===_0x6abd('0x1e');var _0x4309f2=_0x1ba40f['count'];var _0x48b02f=_0x5deca8?0x0:_0x589c6b['offset'];var _0x11750f=_0x5deca8?_0x1ba40f[_0x6abd('0x1f')]:_0x589c6b[_0x6abd('0x1d')]+_0x589c6b['limit'];var _0x849651;if(_0x11750f>=_0x4309f2){_0x11750f=_0x4309f2;_0x849651=0xc8;}else{_0x849651=0xce;}_0x2ee543[_0x6abd('0x1b')](_0x849651);return _0x2ee543[_0x6abd('0x20')](_0x6abd('0x21'),_0x48b02f+'-'+_0x11750f+'/'+_0x4309f2)['json'](_0x1ba40f);}return null;};}function patchUpdates(_0x2910b0){return function(_0x245c36){try{jsonpatch[_0x6abd('0x22')](_0x245c36,_0x2910b0,!![]);}catch(_0x434e18){return BPromise['reject'](_0x434e18);}return _0x245c36[_0x6abd('0x23')]();};}function saveUpdates(_0x556a21,_0x26287d){return function(_0xa8fcd0){if(_0xa8fcd0){return _0xa8fcd0[_0x6abd('0x24')](_0x556a21)['then'](function(_0x218f4e){return _0x218f4e;});}return null;};}function removeEntity(_0x405924,_0x178f5f){return function(_0x54ea50){if(_0x54ea50){return _0x54ea50['destroy']()[_0x6abd('0x25')](function(){var _0x53c26d=_0x54ea50[_0x6abd('0x26')]({'plain':!![]});var _0x1a0dc3=_0x6abd('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a0dc3,'resourceId':_0x53c26d['id']}})[_0x6abd('0x25')](function(){return _0x54ea50;});})[_0x6abd('0x25')](function(){_0x405924[_0x6abd('0x1b')](0xcc)[_0x6abd('0x1a')]();});}};}function handleEntityNotFound(_0x57f065,_0x3ad89b){return function(_0x57a7f5){if(!_0x57a7f5){_0x57f065[_0x6abd('0x19')](0x194);}return _0x57a7f5;};}function handleError(_0xb7bb26,_0x194434){_0x194434=_0x194434||0x1f4;return function(_0x13f0ab){logger[_0x6abd('0x28')](_0x13f0ab[_0x6abd('0x29')]);if(_0x13f0ab[_0x6abd('0x2a')]){delete _0x13f0ab[_0x6abd('0x2a')];}_0xb7bb26[_0x6abd('0x1b')](_0x194434)[_0x6abd('0x2b')](_0x13f0ab);};}exports[_0x6abd('0x2c')]=function(_0x415b67,_0x445bd1){var _0x3d2f2c={},_0x3f6b7b={},_0x4e903e={'count':0x0,'rows':[]};var _0x4c8260=_[_0x6abd('0x2d')](db[_0x6abd('0x2e')][_0x6abd('0x2f')],function(_0x5a26a0){return{'name':_0x5a26a0[_0x6abd('0x30')],'type':_0x5a26a0[_0x6abd('0x31')]['key']};});_0x3f6b7b[_0x6abd('0x32')]=_[_0x6abd('0x2d')](_0x4c8260,_0x6abd('0x2a'));_0x3f6b7b[_0x6abd('0x33')]=_[_0x6abd('0x34')](_0x415b67['query']);_0x3f6b7b[_0x6abd('0x35')]=_['intersection'](_0x3f6b7b['model'],_0x3f6b7b['query']);_0x3d2f2c[_0x6abd('0x36')]=_[_0x6abd('0x37')](_0x3f6b7b[_0x6abd('0x32')],qs['fields'](_0x415b67[_0x6abd('0x33')][_0x6abd('0x38')]));_0x3d2f2c[_0x6abd('0x36')]=_0x3d2f2c[_0x6abd('0x36')][_0x6abd('0x39')]?_0x3d2f2c[_0x6abd('0x36')]:_0x3f6b7b['model'];if(!_0x415b67[_0x6abd('0x33')]['hasOwnProperty'](_0x6abd('0x3a'))){_0x3d2f2c['limit']=qs['limit'](_0x415b67['query'][_0x6abd('0x3b')]);_0x3d2f2c[_0x6abd('0x1d')]=qs['offset'](_0x415b67[_0x6abd('0x33')][_0x6abd('0x1d')]);}_0x3d2f2c[_0x6abd('0x3c')]=qs[_0x6abd('0x3d')](_0x415b67[_0x6abd('0x33')]['sort']);_0x3d2f2c[_0x6abd('0x3e')]=qs[_0x6abd('0x35')](_['pick'](_0x415b67[_0x6abd('0x33')],_0x3f6b7b[_0x6abd('0x35')]),_0x4c8260);if(_0x415b67[_0x6abd('0x33')][_0x6abd('0x3f')]){_0x3d2f2c[_0x6abd('0x3e')]=_[_0x6abd('0x40')](_0x3d2f2c[_0x6abd('0x3e')],{'$or':_[_0x6abd('0x2d')](_0x4c8260,function(_0x187f81){if(_0x187f81[_0x6abd('0x31')]!==_0x6abd('0x41')){var _0x31ef7f={};_0x31ef7f[_0x187f81[_0x6abd('0x2a')]]={'$like':'%'+_0x415b67[_0x6abd('0x33')][_0x6abd('0x3f')]+'%'};return _0x31ef7f;}})});}_0x3d2f2c=_[_0x6abd('0x40')]({},_0x3d2f2c,_0x415b67['options']);var _0x47077a={'where':_0x3d2f2c[_0x6abd('0x3e')]};return db[_0x6abd('0x2e')]['count'](_0x47077a)['then'](function(_0x3b1aca){_0x4e903e[_0x6abd('0x1f')]=_0x3b1aca;if(_0x415b67[_0x6abd('0x33')][_0x6abd('0x42')]){_0x3d2f2c[_0x6abd('0x43')]=[{'all':!![]}];}return db[_0x6abd('0x2e')][_0x6abd('0x44')](_0x3d2f2c);})[_0x6abd('0x25')](function(_0x461b84){_0x4e903e[_0x6abd('0x45')]=_0x461b84;return _0x4e903e;})[_0x6abd('0x25')](respondWithFilteredResult(_0x445bd1,_0x3d2f2c))[_0x6abd('0x46')](handleError(_0x445bd1,null));};exports[_0x6abd('0x47')]=function(_0x2610f2,_0x540889){var _0x202349={'raw':![],'where':{'id':_0x2610f2[_0x6abd('0x48')]['id']}},_0x129847={};_0x129847[_0x6abd('0x32')]=_[_0x6abd('0x34')](db['Team'][_0x6abd('0x2f')]);_0x129847[_0x6abd('0x33')]=_[_0x6abd('0x34')](_0x2610f2[_0x6abd('0x33')]);_0x129847[_0x6abd('0x35')]=_[_0x6abd('0x37')](_0x129847['model'],_0x129847[_0x6abd('0x33')]);_0x202349[_0x6abd('0x36')]=_[_0x6abd('0x37')](_0x129847['model'],qs[_0x6abd('0x38')](_0x2610f2['query'][_0x6abd('0x38')]));_0x202349[_0x6abd('0x36')]=_0x202349[_0x6abd('0x36')][_0x6abd('0x39')]?_0x202349[_0x6abd('0x36')]:_0x129847[_0x6abd('0x32')];if(_0x2610f2['query'][_0x6abd('0x42')]){_0x202349['include']=[{'all':!![]}];}_0x202349=_[_0x6abd('0x40')]({},_0x202349,_0x2610f2[_0x6abd('0x49')]);return db[_0x6abd('0x2e')][_0x6abd('0x4a')](_0x202349)[_0x6abd('0x25')](handleEntityNotFound(_0x540889,null))[_0x6abd('0x25')](respondWithResult(_0x540889,null))[_0x6abd('0x46')](handleError(_0x540889,null));};exports[_0x6abd('0x4b')]=function(_0x290754,_0x2195a3){return db[_0x6abd('0x2e')][_0x6abd('0x4b')](_0x290754[_0x6abd('0x4c')],{})[_0x6abd('0x25')](function(_0x7cb5dd){var _0x5cc35f=_0x290754[_0x6abd('0x4d')][_0x6abd('0x26')]({'plain':!![]});if(!_0x5cc35f)throw new Error(_0x6abd('0x4e'));if(_0x5cc35f['role']===_0x6abd('0x4d')){var _0x9f56b0=_0x7cb5dd['get']({'plain':!![]});var _0x288adf=_0x6abd('0x27');return db[_0x6abd('0x4f')][_0x6abd('0x4a')]({'where':{'name':_0x288adf,'userProfileId':_0x5cc35f[_0x6abd('0x50')]},'raw':!![]})[_0x6abd('0x25')](function(_0x144db5){if(_0x144db5&&_0x144db5[_0x6abd('0x51')]===0x0){return db['UserProfileResource'][_0x6abd('0x4b')]({'name':_0x9f56b0['name'],'resourceId':_0x9f56b0['id'],'type':_0x144db5[_0x6abd('0x2a')],'sectionId':_0x144db5['id']},{})[_0x6abd('0x25')](function(){return _0x7cb5dd;});}else{return _0x7cb5dd;}})[_0x6abd('0x46')](function(_0x6369b6){logger['error'](_0x6abd('0x52'),_0x6369b6);throw _0x6369b6;});}return _0x7cb5dd;})[_0x6abd('0x25')](respondWithResult(_0x2195a3,0xc9))[_0x6abd('0x46')](handleError(_0x2195a3,null));};exports['update']=function(_0x369c53,_0x1878e0){if(_0x369c53[_0x6abd('0x4c')]['id']){delete _0x369c53[_0x6abd('0x4c')]['id'];}return db[_0x6abd('0x2e')]['find']({'where':{'id':_0x369c53[_0x6abd('0x48')]['id']}})[_0x6abd('0x25')](handleEntityNotFound(_0x1878e0,null))[_0x6abd('0x25')](saveUpdates(_0x369c53[_0x6abd('0x4c')],null))[_0x6abd('0x25')](respondWithResult(_0x1878e0,null))[_0x6abd('0x46')](handleError(_0x1878e0,null));};exports[_0x6abd('0x53')]=function(_0x510ea9,_0x1126f2){return db[_0x6abd('0x2e')][_0x6abd('0x4a')]({'where':{'id':_0x510ea9[_0x6abd('0x48')]['id']}})[_0x6abd('0x25')](handleEntityNotFound(_0x1126f2,null))[_0x6abd('0x25')](removeEntity(_0x1126f2,null))[_0x6abd('0x46')](handleError(_0x1126f2,null));};exports[_0x6abd('0x54')]=function(_0x4ac5f0,_0x80dde1,_0x599742){return db[_0x6abd('0x2e')][_0x6abd('0x55')]({'where':{'id':_0x4ac5f0[_0x6abd('0x48')]['id']}})[_0x6abd('0x25')](handleEntityNotFound(_0x80dde1,null))[_0x6abd('0x25')](function(_0x3719f8){if(!_0x4ac5f0[_0x6abd('0x33')][_0x6abd('0x56')]||!utils['isValidChannel'](_0x4ac5f0['query'][_0x6abd('0x56')])){throw new db[(_0x6abd('0x57'))][(_0x6abd('0x58'))](_0x6abd('0x59'));}var _0x51086f={};var _0x2c7bc5={};_0x2c7bc5[_0x6abd('0x32')]=_[_0x6abd('0x34')](db[_[_0x6abd('0x5a')](_0x4ac5f0[_0x6abd('0x33')][_0x6abd('0x56')][_0x6abd('0x5b')]())+_0x6abd('0x5c')][_0x6abd('0x2f')]);_0x2c7bc5['query']=_['keys'](_0x4ac5f0[_0x6abd('0x33')]);_0x2c7bc5[_0x6abd('0x35')]=_[_0x6abd('0x37')](_0x2c7bc5[_0x6abd('0x32')],_0x2c7bc5[_0x6abd('0x33')]);_0x51086f[_0x6abd('0x36')]=_[_0x6abd('0x37')](_0x2c7bc5[_0x6abd('0x32')],qs[_0x6abd('0x38')](_0x4ac5f0[_0x6abd('0x33')][_0x6abd('0x38')]));_0x51086f[_0x6abd('0x36')]=_0x51086f[_0x6abd('0x36')][_0x6abd('0x39')]?_0x51086f[_0x6abd('0x36')]:_0x2c7bc5[_0x6abd('0x32')];_0x51086f[_0x6abd('0x3b')]=qs['limit'](_0x4ac5f0[_0x6abd('0x33')][_0x6abd('0x3b')]);_0x51086f[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x4ac5f0[_0x6abd('0x33')][_0x6abd('0x1d')]);_0x51086f['order']=qs[_0x6abd('0x3d')](_0x4ac5f0[_0x6abd('0x33')][_0x6abd('0x3d')]);_0x51086f['where']=qs[_0x6abd('0x35')](_[_0x6abd('0x5d')](_0x4ac5f0[_0x6abd('0x33')],_0x2c7bc5[_0x6abd('0x35')]));_0x51086f=_[_0x6abd('0x40')]({},_0x51086f,_0x4ac5f0[_0x6abd('0x49')]);return _0x3719f8[_0x6abd('0x26')+_['capitalize'](_0x4ac5f0[_0x6abd('0x33')]['channel'][_0x6abd('0x5b')]())+_0x6abd('0x5e')](_0x51086f);})[_0x6abd('0x25')](respondWithResult(_0x80dde1,null))[_0x6abd('0x46')](handleError(_0x80dde1,null));};exports['addQueues']=function(_0x5e8363,_0x47a2b4,_0x3cb2c9){return db[_0x6abd('0x2e')][_0x6abd('0x55')]({'where':{'id':_0x5e8363[_0x6abd('0x48')]['id']}})[_0x6abd('0x25')](function(_0x305be5){if(_0x305be5){if(!_0x5e8363['body'][_0x6abd('0x56')]||!utils[_0x6abd('0x5f')](_0x5e8363['body'][_0x6abd('0x56')])){throw new db[(_0x6abd('0x57'))][(_0x6abd('0x58'))](_0x6abd('0x59'));}return _0x305be5['add'+_[_0x6abd('0x5a')](_0x5e8363['body'][_0x6abd('0x56')][_0x6abd('0x5b')]())+_0x6abd('0x5e')](_0x5e8363['body'][_0x6abd('0x60')]);}return null;})[_0x6abd('0x25')](handleEntityNotFound(_0x47a2b4,null))[_0x6abd('0x25')](respondWithStatusCode(_0x47a2b4,null))[_0x6abd('0x46')](handleError(_0x47a2b4,null));};exports[_0x6abd('0x61')]=function(_0x931752,_0x5ac01a,_0x4fd9c6){return db[_0x6abd('0x2e')][_0x6abd('0x55')]({'where':{'id':_0x931752[_0x6abd('0x48')]['id']}})[_0x6abd('0x25')](function(_0x42c82f){if(_0x42c82f){if(!_0x931752['query'][_0x6abd('0x56')]||!utils[_0x6abd('0x5f')](_0x931752[_0x6abd('0x33')][_0x6abd('0x56')])){throw new db[(_0x6abd('0x57'))][(_0x6abd('0x58'))](_0x6abd('0x59'));}return _0x42c82f['remove'+_[_0x6abd('0x5a')](_0x931752[_0x6abd('0x33')][_0x6abd('0x56')][_0x6abd('0x5b')]())+_0x6abd('0x5e')](_0x931752[_0x6abd('0x33')][_0x6abd('0x60')]);}return null;})[_0x6abd('0x25')](handleEntityNotFound(_0x5ac01a,null))['then'](respondWithStatusCode(_0x5ac01a,null))[_0x6abd('0x46')](handleError(_0x5ac01a,null));};exports[_0x6abd('0x62')]=function(_0x49c11b,_0x50d950){return db[_0x6abd('0x2e')][_0x6abd('0x4a')]({'where':{'id':_0x49c11b[_0x6abd('0x48')]['id']}})[_0x6abd('0x25')](handleEntityNotFound(_0x50d950,null))[_0x6abd('0x25')](function(_0x119113){if(_0x119113){var _0x4324ae=[_0x6abd('0x63'),_0x6abd('0x64'),'Mail','Sms',_0x6abd('0x65'),_0x6abd('0x66'),_0x6abd('0x67')];return db[_0x6abd('0x68')][_0x6abd('0x69')](function(_0x370ad2){var _0x45aebf=_[_0x6abd('0x2d')](_0x4324ae,function(_0xbfd338){var _0x2bb5ec={'attributes':['id',_0x6abd('0x2a')]};if(_0xbfd338===_0x6abd('0x63')){_0x2bb5ec['through']={'attributes':[_0x6abd('0x6a')]};}return _0x119113[_0x6abd('0x26')+_0xbfd338+_0x6abd('0x5e')](_0x2bb5ec)[_0x6abd('0x25')](function(_0x1d0eed){var _0x5bb9fa=_[_0x6abd('0x2d')](_0x1d0eed,function(_0x4b9bff){var _0x3d7618=_[_0x6abd('0x2d')](_0x49c11b[_0x6abd('0x4c')]['ids'],function(_0x140240){var _0x5ec630={'where':{'UserId':_0x140240,[_0xbfd338+_0x6abd('0x6b')]:_0x4b9bff['id']},'transaction':_0x370ad2};if(_0xbfd338==='Voice'){_0x5ec630[_0x6abd('0x15')]={'penalty':_0x4b9bff['TeamVoiceQueue']['penalty']};}return db[_0x6abd('0x6c')+_0xbfd338+'Queue'][_0x6abd('0x6d')](_0x5ec630)[_0x6abd('0x25')](function(){socket[_0x6abd('0x6e')]('user'+_0xbfd338+_0x6abd('0x6f'),{'UserId':_0x140240,[_0xbfd338+_0x6abd('0x6b')]:_0x4b9bff['id']});if(_0xbfd338!==_0x6abd('0x63'))return;return db['User'][_0x6abd('0x44')]({'where':{'id':_0x49c11b['body'][_0x6abd('0x60')],'online':0x1},'attributes':['id',_0x6abd('0x2a'),_0x6abd('0x70'),'voicePause',_0x6abd('0x71')],'raw':!![]})[_0x6abd('0x25')](function(_0x3489fb){var _0x2cecc3=_[_0x6abd('0x2d')](_0x3489fb,function(_0x161e3c){return db[_0x6abd('0x72')]['upsert']({'membername':_0x161e3c[_0x6abd('0x2a')],'UserId':_0x161e3c['id'],'queue_name':_0x4b9bff[_0x6abd('0x2a')],'VoiceQueueId':_0x4b9bff['id'],'interface':_[_0x6abd('0x73')](_0x161e3c[_0x6abd('0x71')])?util[_0x6abd('0x74')](_0x6abd('0x75'),_0x161e3c[_0x6abd('0x2a')]):_0x161e3c[_0x6abd('0x71')],'paused':_0x161e3c[_0x6abd('0x76')]||![],'penalty':_0x4b9bff['TeamVoiceQueue'][_0x6abd('0x6a')]},{'transaction':_0x370ad2});});return Promise[_0x6abd('0x77')](_0x2cecc3);});});});return Promise['all'](_0x3d7618);});return Promise[_0x6abd('0x77')](_0x5bb9fa);});});return Promise[_0x6abd('0x77')](_0x45aebf)[_0x6abd('0x25')](function(){return _0x119113[_0x6abd('0x62')](_0x49c11b[_0x6abd('0x4c')][_0x6abd('0x60')],{'transaction':_0x370ad2})[_0x6abd('0x78')](function(_0xbbad8c){return _0xbbad8c;});});});}})[_0x6abd('0x25')](respondWithResult(_0x50d950,null))['catch'](handleError(_0x50d950,null));};exports[_0x6abd('0x79')]=function(_0x5c0fc4,_0x2add0c){return db['Team']['find']({'where':{'id':_0x5c0fc4['params']['id']}})[_0x6abd('0x25')](handleEntityNotFound(_0x2add0c,null))['then'](function(_0x57910a){if(_0x57910a){var _0x81106b=[_0x6abd('0x63'),'Chat',_0x6abd('0x7a'),_0x6abd('0x7b'),_0x6abd('0x65'),_0x6abd('0x66'),_0x6abd('0x67')];return db['sequelize'][_0x6abd('0x69')](function(_0x11e8e0){var _0x37c097=_['map'](_0x81106b,function(_0xf36118){var _0x3f4a4f={'attributes':['id',_0x6abd('0x2a')]};return _0x57910a[_0x6abd('0x26')+_0xf36118+_0x6abd('0x5e')](_0x3f4a4f)[_0x6abd('0x25')](function(_0x490209){var _0x274d18=_[_0x6abd('0x2d')](_0x490209,function(_0x51d5e6){return _0x51d5e6[_0x6abd('0x79')](_0x5c0fc4[_0x6abd('0x33')]['ids'],{'transaction':_0x11e8e0})[_0x6abd('0x25')](function(){var _0x7e6d4=JSON[_0x6abd('0x7c')]('['+_0x5c0fc4['query']['ids']+']');var _0x50a685=_[_0x6abd('0x2d')](_0x7e6d4,function(_0x3698c5){socket[_0x6abd('0x6e')](_0x6abd('0x4d')+_0xf36118+_0x6abd('0x7d'),{'UserId':Number(_0x3698c5),[_0xf36118+_0x6abd('0x6b')]:_0x51d5e6['id']});if(_0xf36118!==_0x6abd('0x63'))return;return db[_0x6abd('0x72')][_0x6abd('0x53')]({'where':{'VoiceQueueId':_0x51d5e6['id'],'UserId':_0x3698c5},'transaction':_0x11e8e0});});return Promise[_0x6abd('0x77')](_0x50a685);});});return Promise[_0x6abd('0x77')](_0x274d18);});});return Promise[_0x6abd('0x77')](_0x37c097)[_0x6abd('0x25')](function(){return _0x57910a[_0x6abd('0x79')](_0x5c0fc4['query'][_0x6abd('0x60')],{'transaction':_0x11e8e0});});});}})[_0x6abd('0x25')](respondWithStatusCode(_0x2add0c,null))[_0x6abd('0x46')](handleError(_0x2add0c,null));};exports[_0x6abd('0x7e')]=function(_0x110489,_0x46d983,_0x27eb13){var _0x4be982={};var _0x3aff25={};var _0x4648c1;var _0x5392f6;return db['Team'][_0x6abd('0x55')]({'where':{'id':_0x110489['params']['id']}})[_0x6abd('0x25')](handleEntityNotFound(_0x46d983,null))[_0x6abd('0x25')](function(_0x405409){if(_0x405409){_0x4648c1=_0x405409;_0x3aff25[_0x6abd('0x32')]=_['keys'](db[_0x6abd('0x6c')]['rawAttributes']);_0x3aff25['query']=_['keys'](_0x110489['query']);_0x3aff25[_0x6abd('0x35')]=_[_0x6abd('0x37')](_0x3aff25['model'],_0x3aff25[_0x6abd('0x33')]);_0x4be982[_0x6abd('0x36')]=_['intersection'](_0x3aff25['model'],qs[_0x6abd('0x38')](_0x110489['query']['fields']));_0x4be982[_0x6abd('0x36')]=_0x4be982[_0x6abd('0x36')][_0x6abd('0x39')]?_0x4be982[_0x6abd('0x36')]:_0x3aff25[_0x6abd('0x32')];_0x4be982[_0x6abd('0x3c')]=qs[_0x6abd('0x3d')](_0x110489[_0x6abd('0x33')][_0x6abd('0x3d')]);_0x4be982['where']=qs[_0x6abd('0x35')](_[_0x6abd('0x5d')](_0x110489[_0x6abd('0x33')],_0x3aff25[_0x6abd('0x35')]));if(_0x110489[_0x6abd('0x33')]['filter']){_0x4be982[_0x6abd('0x3e')]=_[_0x6abd('0x40')](_0x4be982[_0x6abd('0x3e')],{'$or':_[_0x6abd('0x2d')](_0x4be982['attributes'],function(_0xaad448){var _0x1c3b61={};_0x1c3b61[_0xaad448]={'$like':'%'+_0x110489[_0x6abd('0x33')][_0x6abd('0x3f')]+'%'};return _0x1c3b61;})});}_0x4be982=_[_0x6abd('0x40')]({},_0x4be982,_0x110489[_0x6abd('0x49')]);return _0x4648c1[_0x6abd('0x7e')](_0x4be982);}})['then'](function(_0x2ed17c){if(_0x2ed17c){_0x5392f6=_0x2ed17c['length'];if(!_0x110489['query']['hasOwnProperty'](_0x6abd('0x3a'))){_0x4be982[_0x6abd('0x3b')]=qs[_0x6abd('0x3b')](_0x110489[_0x6abd('0x33')][_0x6abd('0x3b')]);_0x4be982[_0x6abd('0x1d')]=qs[_0x6abd('0x1d')](_0x110489[_0x6abd('0x33')][_0x6abd('0x1d')]);}return _0x4648c1[_0x6abd('0x7e')](_0x4be982);}})[_0x6abd('0x25')](function(_0x400880){if(_0x400880){return _0x400880?{'count':_0x5392f6,'rows':_0x400880}:null;}})['then'](respondWithResult(_0x46d983,null))[_0x6abd('0x46')](handleError(_0x46d983,null));};
\ No newline at end of file
+var _0x2a19=['request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','Teams','sendStatus','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','sort','Queues','addQueues','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','penalty','QueueId','Queue','findOrCreate','emit','Queue:save','User','online','voicePause','UserVoiceQueueRt','upsert','interface','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','parse','Queue:remove','getAgents','eml-format','rimraf'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x2a19,0x199));var _0x92a1=function(_0x224b8c,_0x2b93e1){_0x224b8c=_0x224b8c-0x0;var _0x551d30=_0x2a19[_0x224b8c];return _0x551d30;};'use strict';var emlformat=require(_0x92a1('0x0'));var rimraf=require(_0x92a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x92a1('0x2'));var moment=require(_0x92a1('0x3'));var BPromise=require(_0x92a1('0x4'));var Mustache=require(_0x92a1('0x5'));var util=require(_0x92a1('0x6'));var path=require(_0x92a1('0x7'));var sox=require('sox');var csv=require(_0x92a1('0x8'));var ejs=require(_0x92a1('0x9'));var fs=require('fs');var fs_extra=require(_0x92a1('0xa'));var _=require(_0x92a1('0xb'));var squel=require(_0x92a1('0xc'));var crypto=require(_0x92a1('0xd'));var jsforce=require(_0x92a1('0xe'));var deskjs=require(_0x92a1('0xf'));var toCsv=require(_0x92a1('0x8'));var querystring=require(_0x92a1('0x10'));var Papa=require(_0x92a1('0x11'));var Redis=require(_0x92a1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x92a1('0x13'));var as=require(_0x92a1('0x14'));var hardwareService=require(_0x92a1('0x15'));var logger=require(_0x92a1('0x16'))('api');var utils=require(_0x92a1('0x17'));var config=require(_0x92a1('0x18'));var licenseUtil=require(_0x92a1('0x19'));var db=require(_0x92a1('0x1a'))['db'];config[_0x92a1('0x1b')]=_[_0x92a1('0x1c')](config['redis'],{'host':_0x92a1('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x92a1('0x1e'))[_0x92a1('0x1f')](socket);function respondWithStatusCode(_0x38ed36,_0x5ed067){_0x5ed067=_0x5ed067||0xcc;return function(_0x30d835){if(_0x30d835){return _0x38ed36['sendStatus'](_0x5ed067);}return _0x38ed36['status'](_0x5ed067)['end']();};}function respondWithResult(_0xf0957e,_0x341618){_0x341618=_0x341618||0xc8;return function(_0x472d6f){if(_0x472d6f){return _0xf0957e[_0x92a1('0x20')](_0x341618)[_0x92a1('0x21')](_0x472d6f);}};}function respondWithFilteredResult(_0x5b1b6a,_0x278de2){return function(_0x3eca19){if(_0x3eca19){var _0x1837d8=typeof _0x278de2['offset']===_0x92a1('0x22')&&typeof _0x278de2[_0x92a1('0x23')]===_0x92a1('0x22');var _0x1e2025=_0x3eca19[_0x92a1('0x24')];var _0x5af519=_0x1837d8?0x0:_0x278de2[_0x92a1('0x25')];var _0x3c680b=_0x1837d8?_0x3eca19[_0x92a1('0x24')]:_0x278de2[_0x92a1('0x25')]+_0x278de2[_0x92a1('0x23')];var _0x11531b;if(_0x3c680b>=_0x1e2025){_0x3c680b=_0x1e2025;_0x11531b=0xc8;}else{_0x11531b=0xce;}_0x5b1b6a[_0x92a1('0x20')](_0x11531b);return _0x5b1b6a[_0x92a1('0x26')](_0x92a1('0x27'),_0x5af519+'-'+_0x3c680b+'/'+_0x1e2025)[_0x92a1('0x21')](_0x3eca19);}return null;};}function patchUpdates(_0x13790f){return function(_0x55f448){try{jsonpatch[_0x92a1('0x28')](_0x55f448,_0x13790f,!![]);}catch(_0x4f5b4e){return BPromise['reject'](_0x4f5b4e);}return _0x55f448['save']();};}function saveUpdates(_0x5392fc,_0x5c6a01){return function(_0x5d092e){if(_0x5d092e){return _0x5d092e[_0x92a1('0x29')](_0x5392fc)[_0x92a1('0x2a')](function(_0x55f4d1){return _0x55f4d1;});}return null;};}function removeEntity(_0x18bf20,_0x1e818a){return function(_0x3130a4){if(_0x3130a4){return _0x3130a4[_0x92a1('0x2b')]()[_0x92a1('0x2a')](function(){var _0x35fcf5=_0x3130a4[_0x92a1('0x2c')]({'plain':!![]});var _0x1244a7=_0x92a1('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x1244a7,'resourceId':_0x35fcf5['id']}})[_0x92a1('0x2a')](function(){return _0x3130a4;});})[_0x92a1('0x2a')](function(){_0x18bf20[_0x92a1('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x871d93,_0xa54a22){return function(_0x4b6d45){if(!_0x4b6d45){_0x871d93[_0x92a1('0x2e')](0x194);}return _0x4b6d45;};}function handleError(_0x5b8326,_0x5bf40b){_0x5bf40b=_0x5bf40b||0x1f4;return function(_0x404772){logger[_0x92a1('0x2f')](_0x404772[_0x92a1('0x30')]);if(_0x404772[_0x92a1('0x31')]){delete _0x404772[_0x92a1('0x31')];}_0x5b8326[_0x92a1('0x20')](_0x5bf40b)[_0x92a1('0x32')](_0x404772);};}exports[_0x92a1('0x33')]=function(_0x5cec1e,_0x323abe){var _0x84955e={},_0xc2d462={},_0x376577={'count':0x0,'rows':[]};var _0xd11440=_[_0x92a1('0x34')](db[_0x92a1('0x35')][_0x92a1('0x36')],function(_0x49c9cc){return{'name':_0x49c9cc[_0x92a1('0x37')],'type':_0x49c9cc[_0x92a1('0x38')][_0x92a1('0x39')]};});_0xc2d462[_0x92a1('0x3a')]=_['map'](_0xd11440,_0x92a1('0x31'));_0xc2d462[_0x92a1('0x3b')]=_[_0x92a1('0x3c')](_0x5cec1e['query']);_0xc2d462[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0xc2d462[_0x92a1('0x3a')],_0xc2d462[_0x92a1('0x3b')]);_0x84955e['attributes']=_[_0x92a1('0x3e')](_0xc2d462['model'],qs[_0x92a1('0x3f')](_0x5cec1e[_0x92a1('0x3b')]['fields']));_0x84955e[_0x92a1('0x40')]=_0x84955e[_0x92a1('0x40')][_0x92a1('0x41')]?_0x84955e[_0x92a1('0x40')]:_0xc2d462[_0x92a1('0x3a')];if(!_0x5cec1e['query'][_0x92a1('0x42')](_0x92a1('0x43'))){_0x84955e['limit']=qs[_0x92a1('0x23')](_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x23')]);_0x84955e[_0x92a1('0x25')]=qs[_0x92a1('0x25')](_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x25')]);}_0x84955e[_0x92a1('0x44')]=qs['sort'](_0x5cec1e[_0x92a1('0x3b')]['sort']);_0x84955e[_0x92a1('0x45')]=qs[_0x92a1('0x3d')](_[_0x92a1('0x46')](_0x5cec1e['query'],_0xc2d462[_0x92a1('0x3d')]),_0xd11440);if(_0x5cec1e[_0x92a1('0x3b')]['filter']){_0x84955e[_0x92a1('0x45')]=_[_0x92a1('0x47')](_0x84955e[_0x92a1('0x45')],{'$or':_['map'](_0xd11440,function(_0x4cd81e){if(_0x4cd81e[_0x92a1('0x38')]!==_0x92a1('0x48')){var _0x334d46={};_0x334d46[_0x4cd81e['name']]={'$like':'%'+_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x49')]+'%'};return _0x334d46;}})});}_0x84955e=_[_0x92a1('0x47')]({},_0x84955e,_0x5cec1e[_0x92a1('0x4a')]);var _0x325e31={'where':_0x84955e[_0x92a1('0x45')]};return db[_0x92a1('0x35')][_0x92a1('0x24')](_0x325e31)[_0x92a1('0x2a')](function(_0x3f1e48){_0x376577['count']=_0x3f1e48;if(_0x5cec1e[_0x92a1('0x3b')][_0x92a1('0x4b')]){_0x84955e[_0x92a1('0x4c')]=[{'all':!![]}];}return db['Team'][_0x92a1('0x4d')](_0x84955e);})['then'](function(_0xf456cb){_0x376577[_0x92a1('0x4e')]=_0xf456cb;return _0x376577;})[_0x92a1('0x2a')](respondWithFilteredResult(_0x323abe,_0x84955e))[_0x92a1('0x4f')](handleError(_0x323abe,null));};exports[_0x92a1('0x50')]=function(_0x5c93c6,_0x4959f3){var _0x49e52f={'raw':![],'where':{'id':_0x5c93c6[_0x92a1('0x51')]['id']}},_0x23e472={};_0x23e472[_0x92a1('0x3a')]=_['keys'](db['Team'][_0x92a1('0x36')]);_0x23e472[_0x92a1('0x3b')]=_[_0x92a1('0x3c')](_0x5c93c6[_0x92a1('0x3b')]);_0x23e472[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0x23e472[_0x92a1('0x3a')],_0x23e472[_0x92a1('0x3b')]);_0x49e52f[_0x92a1('0x40')]=_[_0x92a1('0x3e')](_0x23e472[_0x92a1('0x3a')],qs['fields'](_0x5c93c6['query'][_0x92a1('0x3f')]));_0x49e52f[_0x92a1('0x40')]=_0x49e52f[_0x92a1('0x40')][_0x92a1('0x41')]?_0x49e52f['attributes']:_0x23e472[_0x92a1('0x3a')];if(_0x5c93c6[_0x92a1('0x3b')][_0x92a1('0x4b')]){_0x49e52f[_0x92a1('0x4c')]=[{'all':!![]}];}_0x49e52f=_[_0x92a1('0x47')]({},_0x49e52f,_0x5c93c6[_0x92a1('0x4a')]);return db[_0x92a1('0x35')][_0x92a1('0x52')](_0x49e52f)[_0x92a1('0x2a')](handleEntityNotFound(_0x4959f3,null))[_0x92a1('0x2a')](respondWithResult(_0x4959f3,null))[_0x92a1('0x4f')](handleError(_0x4959f3,null));};exports[_0x92a1('0x53')]=function(_0x27dac7,_0x6e52b6){return db[_0x92a1('0x35')][_0x92a1('0x53')](_0x27dac7[_0x92a1('0x54')],{})[_0x92a1('0x2a')](function(_0x63bba6){var _0x5e2735=_0x27dac7[_0x92a1('0x55')][_0x92a1('0x2c')]({'plain':!![]});if(!_0x5e2735)throw new Error(_0x92a1('0x56'));if(_0x5e2735[_0x92a1('0x57')]===_0x92a1('0x55')){var _0x723a5e=_0x63bba6[_0x92a1('0x2c')]({'plain':!![]});var _0x15ae04=_0x92a1('0x2d');return db[_0x92a1('0x58')]['find']({'where':{'name':_0x15ae04,'userProfileId':_0x5e2735['userProfileId']},'raw':!![]})['then'](function(_0x52686d){if(_0x52686d&&_0x52686d[_0x92a1('0x59')]===0x0){return db[_0x92a1('0x5a')][_0x92a1('0x53')]({'name':_0x723a5e[_0x92a1('0x31')],'resourceId':_0x723a5e['id'],'type':_0x52686d[_0x92a1('0x31')],'sectionId':_0x52686d['id']},{})[_0x92a1('0x2a')](function(){return _0x63bba6;});}else{return _0x63bba6;}})['catch'](function(_0x3bb045){logger[_0x92a1('0x2f')](_0x92a1('0x5b'),_0x3bb045);throw _0x3bb045;});}return _0x63bba6;})['then'](respondWithResult(_0x6e52b6,0xc9))['catch'](handleError(_0x6e52b6,null));};exports[_0x92a1('0x29')]=function(_0x4cd1f4,_0x4baf50){if(_0x4cd1f4[_0x92a1('0x54')]['id']){delete _0x4cd1f4[_0x92a1('0x54')]['id'];}return db[_0x92a1('0x35')]['find']({'where':{'id':_0x4cd1f4[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x4baf50,null))['then'](saveUpdates(_0x4cd1f4['body'],null))[_0x92a1('0x2a')](respondWithResult(_0x4baf50,null))[_0x92a1('0x4f')](handleError(_0x4baf50,null));};exports[_0x92a1('0x2b')]=function(_0x35487c,_0x234d34){return db[_0x92a1('0x35')][_0x92a1('0x52')]({'where':{'id':_0x35487c[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x234d34,null))['then'](removeEntity(_0x234d34,null))[_0x92a1('0x4f')](handleError(_0x234d34,null));};exports[_0x92a1('0x5c')]=function(_0xbf6c6c,_0x31f2ad,_0x50ba87){return db['Team'][_0x92a1('0x5d')]({'where':{'id':_0xbf6c6c['params']['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x31f2ad,null))[_0x92a1('0x2a')](function(_0x2d3aed){if(!_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')]||!utils[_0x92a1('0x5f')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')])){throw new db[(_0x92a1('0x60'))][(_0x92a1('0x61'))](_0x92a1('0x62'));}var _0x5c450c={};var _0x4c1d03={};_0x4c1d03[_0x92a1('0x3a')]=_['keys'](db[_[_0x92a1('0x63')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')][_0x92a1('0x64')]())+'Queue'][_0x92a1('0x36')]);_0x4c1d03[_0x92a1('0x3b')]=_['keys'](_0xbf6c6c[_0x92a1('0x3b')]);_0x4c1d03[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0x4c1d03[_0x92a1('0x3a')],_0x4c1d03['query']);_0x5c450c[_0x92a1('0x40')]=_[_0x92a1('0x3e')](_0x4c1d03[_0x92a1('0x3a')],qs['fields'](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x3f')]));_0x5c450c['attributes']=_0x5c450c[_0x92a1('0x40')][_0x92a1('0x41')]?_0x5c450c[_0x92a1('0x40')]:_0x4c1d03['model'];_0x5c450c[_0x92a1('0x23')]=qs[_0x92a1('0x23')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x23')]);_0x5c450c[_0x92a1('0x25')]=qs[_0x92a1('0x25')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x25')]);_0x5c450c[_0x92a1('0x44')]=qs[_0x92a1('0x65')](_0xbf6c6c[_0x92a1('0x3b')]['sort']);_0x5c450c[_0x92a1('0x45')]=qs[_0x92a1('0x3d')](_[_0x92a1('0x46')](_0xbf6c6c[_0x92a1('0x3b')],_0x4c1d03['filters']));_0x5c450c=_[_0x92a1('0x47')]({},_0x5c450c,_0xbf6c6c[_0x92a1('0x4a')]);return _0x2d3aed[_0x92a1('0x2c')+_[_0x92a1('0x63')](_0xbf6c6c[_0x92a1('0x3b')][_0x92a1('0x5e')][_0x92a1('0x64')]())+_0x92a1('0x66')](_0x5c450c);})[_0x92a1('0x2a')](respondWithResult(_0x31f2ad,null))[_0x92a1('0x4f')](handleError(_0x31f2ad,null));};exports[_0x92a1('0x67')]=function(_0xf41866,_0x3380ff,_0x5bb17a){return db[_0x92a1('0x35')][_0x92a1('0x5d')]({'where':{'id':_0xf41866[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](function(_0x3bfa6a){if(_0x3bfa6a){if(!_0xf41866[_0x92a1('0x54')][_0x92a1('0x5e')]||!utils[_0x92a1('0x5f')](_0xf41866[_0x92a1('0x54')][_0x92a1('0x5e')])){throw new db['Sequelize'][(_0x92a1('0x61'))](_0x92a1('0x62'));}return _0x3bfa6a['add'+_[_0x92a1('0x63')](_0xf41866[_0x92a1('0x54')][_0x92a1('0x5e')]['toLowerCase']())+_0x92a1('0x66')](_0xf41866['body'][_0x92a1('0x68')]);}return null;})['then'](handleEntityNotFound(_0x3380ff,null))[_0x92a1('0x2a')](respondWithStatusCode(_0x3380ff,null))['catch'](handleError(_0x3380ff,null));};exports[_0x92a1('0x69')]=function(_0x41f6eb,_0x4f074b,_0x1e7da0){return db['Team'][_0x92a1('0x5d')]({'where':{'id':_0x41f6eb[_0x92a1('0x51')]['id']}})['then'](function(_0x41e60d){if(_0x41e60d){if(!_0x41f6eb[_0x92a1('0x3b')][_0x92a1('0x5e')]||!utils[_0x92a1('0x5f')](_0x41f6eb['query'][_0x92a1('0x5e')])){throw new db['Sequelize'][(_0x92a1('0x61'))](_0x92a1('0x62'));}return _0x41e60d['remove'+_[_0x92a1('0x63')](_0x41f6eb[_0x92a1('0x3b')][_0x92a1('0x5e')][_0x92a1('0x64')]())+_0x92a1('0x66')](_0x41f6eb['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x4f074b,null))['then'](respondWithStatusCode(_0x4f074b,null))[_0x92a1('0x4f')](handleError(_0x4f074b,null));};exports[_0x92a1('0x6a')]=function(_0x3cd7f8,_0x59601e){return db['Team'][_0x92a1('0x52')]({'where':{'id':_0x3cd7f8[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x59601e,null))['then'](function(_0xa2f097){if(_0xa2f097){var _0x55ba5f=[_0x92a1('0x6b'),_0x92a1('0x6c'),_0x92a1('0x6d'),_0x92a1('0x6e'),_0x92a1('0x6f'),_0x92a1('0x70'),_0x92a1('0x71')];return db[_0x92a1('0x72')][_0x92a1('0x73')](function(_0x18fff4){var _0x5807a0=_[_0x92a1('0x34')](_0x55ba5f,function(_0x41b11b){var _0x454860={'attributes':['id',_0x92a1('0x31')]};if(_0x41b11b==='Voice'){_0x454860['through']={'attributes':[_0x92a1('0x74')]};}return _0xa2f097['get'+_0x41b11b+'Queues'](_0x454860)[_0x92a1('0x2a')](function(_0x2bd5fc){var _0x25ff62=_['map'](_0x2bd5fc,function(_0x416fee){var _0x459fad=_[_0x92a1('0x34')](_0x3cd7f8['body'][_0x92a1('0x68')],function(_0x529725){var _0x26a4d6={'where':{'UserId':_0x529725,[_0x41b11b+_0x92a1('0x75')]:_0x416fee['id']},'transaction':_0x18fff4};if(_0x41b11b===_0x92a1('0x6b')){_0x26a4d6[_0x92a1('0x1c')]={'penalty':_0x416fee['TeamVoiceQueue'][_0x92a1('0x74')]};}return db['User'+_0x41b11b+_0x92a1('0x76')][_0x92a1('0x77')](_0x26a4d6)[_0x92a1('0x2a')](function(){socket[_0x92a1('0x78')](_0x92a1('0x55')+_0x41b11b+_0x92a1('0x79'),{'UserId':_0x529725,[_0x41b11b+'QueueId']:_0x416fee['id']});if(_0x41b11b!==_0x92a1('0x6b'))return;return db[_0x92a1('0x7a')][_0x92a1('0x4d')]({'where':{'id':_0x3cd7f8[_0x92a1('0x54')][_0x92a1('0x68')],'online':0x1},'attributes':['id',_0x92a1('0x31'),_0x92a1('0x7b'),_0x92a1('0x7c'),'interface'],'raw':!![]})[_0x92a1('0x2a')](function(_0x54a6e9){var _0x22e9e3=_[_0x92a1('0x34')](_0x54a6e9,function(_0x32f0b5){return db[_0x92a1('0x7d')][_0x92a1('0x7e')]({'membername':_0x32f0b5['name'],'UserId':_0x32f0b5['id'],'queue_name':_0x416fee[_0x92a1('0x31')],'VoiceQueueId':_0x416fee['id'],'interface':_['isNil'](_0x32f0b5[_0x92a1('0x7f')])?util[_0x92a1('0x80')](_0x92a1('0x81'),_0x32f0b5[_0x92a1('0x31')]):_0x32f0b5[_0x92a1('0x7f')],'paused':_0x32f0b5[_0x92a1('0x7c')]||![],'penalty':_0x416fee[_0x92a1('0x82')][_0x92a1('0x74')]},{'transaction':_0x18fff4});});return Promise[_0x92a1('0x83')](_0x22e9e3);});});});return Promise['all'](_0x459fad);});return Promise[_0x92a1('0x83')](_0x25ff62);});});return Promise['all'](_0x5807a0)[_0x92a1('0x2a')](function(){return _0xa2f097[_0x92a1('0x6a')](_0x3cd7f8[_0x92a1('0x54')][_0x92a1('0x68')],{'transaction':_0x18fff4})[_0x92a1('0x84')](function(_0x23d292){return _0x23d292;});});});}})[_0x92a1('0x2a')](respondWithResult(_0x59601e,null))[_0x92a1('0x4f')](handleError(_0x59601e,null));};exports[_0x92a1('0x85')]=function(_0x1833c0,_0x109bd8){return db[_0x92a1('0x35')][_0x92a1('0x52')]({'where':{'id':_0x1833c0[_0x92a1('0x51')]['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x109bd8,null))[_0x92a1('0x2a')](function(_0x29e689){if(_0x29e689){var _0x48d1b0=[_0x92a1('0x6b'),_0x92a1('0x6c'),_0x92a1('0x6d'),'Sms','Fax',_0x92a1('0x70'),_0x92a1('0x71')];return db[_0x92a1('0x72')]['transaction'](function(_0x25859e){var _0x41197b=_[_0x92a1('0x34')](_0x48d1b0,function(_0x2f2c2b){var _0x25bd3a={'attributes':['id','name']};return _0x29e689[_0x92a1('0x2c')+_0x2f2c2b+_0x92a1('0x66')](_0x25bd3a)['then'](function(_0x3ab526){var _0x43f03b=_[_0x92a1('0x34')](_0x3ab526,function(_0x3d1874){return _0x3d1874[_0x92a1('0x85')](_0x1833c0[_0x92a1('0x3b')][_0x92a1('0x68')],{'transaction':_0x25859e})[_0x92a1('0x2a')](function(){var _0x43837c=JSON[_0x92a1('0x86')]('['+_0x1833c0[_0x92a1('0x3b')]['ids']+']');var _0x63a39e=_[_0x92a1('0x34')](_0x43837c,function(_0x37fbf9){socket[_0x92a1('0x78')](_0x92a1('0x55')+_0x2f2c2b+_0x92a1('0x87'),{'UserId':Number(_0x37fbf9),[_0x2f2c2b+_0x92a1('0x75')]:_0x3d1874['id']});if(_0x2f2c2b!==_0x92a1('0x6b'))return;return db[_0x92a1('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x3d1874['id'],'UserId':_0x37fbf9},'transaction':_0x25859e});});return Promise[_0x92a1('0x83')](_0x63a39e);});});return Promise[_0x92a1('0x83')](_0x43f03b);});});return Promise[_0x92a1('0x83')](_0x41197b)[_0x92a1('0x2a')](function(){return _0x29e689[_0x92a1('0x85')](_0x1833c0[_0x92a1('0x3b')][_0x92a1('0x68')],{'transaction':_0x25859e});});});}})[_0x92a1('0x2a')](respondWithStatusCode(_0x109bd8,null))['catch'](handleError(_0x109bd8,null));};exports[_0x92a1('0x88')]=function(_0x5b56ae,_0x36914e,_0x537031){var _0x2bea75={};var _0x2125c1={};var _0x41b8eb;var _0x243eff;return db[_0x92a1('0x35')][_0x92a1('0x5d')]({'where':{'id':_0x5b56ae['params']['id']}})[_0x92a1('0x2a')](handleEntityNotFound(_0x36914e,null))['then'](function(_0x3408c2){if(_0x3408c2){_0x41b8eb=_0x3408c2;_0x2125c1[_0x92a1('0x3a')]=_['keys'](db[_0x92a1('0x7a')][_0x92a1('0x36')]);_0x2125c1[_0x92a1('0x3b')]=_['keys'](_0x5b56ae[_0x92a1('0x3b')]);_0x2125c1[_0x92a1('0x3d')]=_[_0x92a1('0x3e')](_0x2125c1[_0x92a1('0x3a')],_0x2125c1[_0x92a1('0x3b')]);_0x2bea75[_0x92a1('0x40')]=_[_0x92a1('0x3e')](_0x2125c1[_0x92a1('0x3a')],qs[_0x92a1('0x3f')](_0x5b56ae['query'][_0x92a1('0x3f')]));_0x2bea75[_0x92a1('0x40')]=_0x2bea75[_0x92a1('0x40')][_0x92a1('0x41')]?_0x2bea75['attributes']:_0x2125c1[_0x92a1('0x3a')];_0x2bea75[_0x92a1('0x44')]=qs['sort'](_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x65')]);_0x2bea75[_0x92a1('0x45')]=qs[_0x92a1('0x3d')](_['pick'](_0x5b56ae[_0x92a1('0x3b')],_0x2125c1[_0x92a1('0x3d')]));if(_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x49')]){_0x2bea75[_0x92a1('0x45')]=_[_0x92a1('0x47')](_0x2bea75[_0x92a1('0x45')],{'$or':_[_0x92a1('0x34')](_0x2bea75['attributes'],function(_0x5170a8){var _0x34a7f1={};_0x34a7f1[_0x5170a8]={'$like':'%'+_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x49')]+'%'};return _0x34a7f1;})});}_0x2bea75=_[_0x92a1('0x47')]({},_0x2bea75,_0x5b56ae[_0x92a1('0x4a')]);return _0x41b8eb[_0x92a1('0x88')](_0x2bea75);}})['then'](function(_0x2f9ca){if(_0x2f9ca){_0x243eff=_0x2f9ca[_0x92a1('0x41')];if(!_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x42')](_0x92a1('0x43'))){_0x2bea75[_0x92a1('0x23')]=qs[_0x92a1('0x23')](_0x5b56ae[_0x92a1('0x3b')][_0x92a1('0x23')]);_0x2bea75[_0x92a1('0x25')]=qs['offset'](_0x5b56ae['query'][_0x92a1('0x25')]);}return _0x41b8eb['getAgents'](_0x2bea75);}})[_0x92a1('0x2a')](function(_0x237054){if(_0x237054){return _0x237054?{'count':_0x243eff,'rows':_0x237054}:null;}})[_0x92a1('0x2a')](respondWithResult(_0x36914e,null))[_0x92a1('0x4f')](handleError(_0x36914e,null));};
\ No newline at end of file
index 22b0a08..c2e2e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e0e=['events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x8e0e,0x1b8));var _0xe8e0=function(_0x333734,_0x412291){_0x333734=_0x333734-0x0;var _0x4e91e7=_0x8e0e[_0x333734];return _0x4e91e7;};'use strict';var EventEmitter=require(_0xe8e0('0x0'));var Team=require(_0xe8e0('0x1'))['db'][_0xe8e0('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe8e0('0x3')](0x0);var events={'afterCreate':_0xe8e0('0x4'),'afterUpdate':_0xe8e0('0x5'),'afterDestroy':_0xe8e0('0x6')};function emitEvent(_0x4b7a94){return function(_0x40669a,_0x279a14,_0x3e070d){TeamEvents[_0xe8e0('0x7')](_0x4b7a94+':'+_0x40669a['id'],_0x40669a);TeamEvents['emit'](_0x4b7a94,_0x40669a);_0x3e070d(null);};}for(var e in events){if(events[_0xe8e0('0x8')](e)){var event=events[e];Team[_0xe8e0('0x9')](e,emitEvent(event));}}module[_0xe8e0('0xa')]=TeamEvents;
\ No newline at end of file
+var _0x2483=['exports','events','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x440b3b,_0x2de495){var _0x3018cb=function(_0x8772d5){while(--_0x8772d5){_0x440b3b['push'](_0x440b3b['shift']());}};_0x3018cb(++_0x2de495);}(_0x2483,0xac));var _0x3248=function(_0x1e8c5b,_0x37ea41){_0x1e8c5b=_0x1e8c5b-0x0;var _0x372092=_0x2483[_0x1e8c5b];return _0x372092;};'use strict';var EventEmitter=require(_0x3248('0x0'));var Team=require(_0x3248('0x1'))['db'][_0x3248('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3248('0x3')](0x0);var events={'afterCreate':_0x3248('0x4'),'afterUpdate':_0x3248('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5daf94){return function(_0xab5ccc,_0x26c6ae,_0x434b7f){TeamEvents[_0x3248('0x6')](_0x5daf94+':'+_0xab5ccc['id'],_0xab5ccc);TeamEvents[_0x3248('0x6')](_0x5daf94,_0xab5ccc);_0x434b7f(null);};}for(var e in events){if(events[_0x3248('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x3248('0x8')]=TeamEvents;
\ No newline at end of file
index 680918f..5f284a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d7f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','lodash','util','api'];(function(_0x5ed024,_0x20fcac){var _0x529b32=function(_0x373b27){while(--_0x373b27){_0x5ed024['push'](_0x5ed024['shift']());}};_0x529b32(++_0x20fcac);}(_0x2d7f,0x8d));var _0xf2d7=function(_0x1ce037,_0x18c6aa){_0x1ce037=_0x1ce037-0x0;var _0x4266b7=_0x2d7f[_0x1ce037];return _0x4266b7;};'use strict';var _=require(_0xf2d7('0x0'));var util=require(_0xf2d7('0x1'));var logger=require('../../config/logger')(_0xf2d7('0x2'));var moment=require(_0xf2d7('0x3'));var BPromise=require(_0xf2d7('0x4'));var rp=require(_0xf2d7('0x5'));var fs=require('fs');var path=require(_0xf2d7('0x6'));var rimraf=require(_0xf2d7('0x7'));var config=require(_0xf2d7('0x8'));var attributes=require(_0xf2d7('0x9'));module[_0xf2d7('0xa')]=function(_0x37fd26,_0x1c2d67){return _0x37fd26[_0xf2d7('0xb')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeefe=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Team','teams','lodash','util'];(function(_0x4ec3e9,_0x5b4535){var _0x242e0e=function(_0x339dd1){while(--_0x339dd1){_0x4ec3e9['push'](_0x4ec3e9['shift']());}};_0x242e0e(++_0x5b4535);}(_0xeefe,0x73));var _0xeeef=function(_0x3600f3,_0x3d36ea){_0x3600f3=_0x3600f3-0x0;var _0x37cdea=_0xeefe[_0x3600f3];return _0x37cdea;};'use strict';var _=require(_0xeeef('0x0'));var util=require(_0xeeef('0x1'));var logger=require(_0xeeef('0x2'))(_0xeeef('0x3'));var moment=require(_0xeeef('0x4'));var BPromise=require(_0xeeef('0x5'));var rp=require(_0xeeef('0x6'));var fs=require('fs');var path=require(_0xeeef('0x7'));var rimraf=require('rimraf');var config=require(_0xeeef('0x8'));var attributes=require('./team.attributes');module[_0xeeef('0x9')]=function(_0x57f750,_0x2cac76){return _0x57f750[_0xeeef('0xa')](_0xeeef('0xb'),attributes,{'tableName':_0xeeef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee1d9b2..5777c9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc792=['localhost','socket.io-emitter','request','then','info','request\x20sent','debug','stringify','error','code','Team,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x59dd91,_0x354deb){var _0x43dcd1=function(_0x57e7a2){while(--_0x57e7a2){_0x59dd91['push'](_0x59dd91['shift']());}};_0x43dcd1(++_0x354deb);}(_0xc792,0x1e9));var _0x2c79=function(_0x390632,_0x8f77d6){_0x390632=_0x390632-0x0;var _0x59fc7c=_0xc792[_0x390632];return _0x59fc7c;};'use strict';var _=require(_0x2c79('0x0'));var util=require(_0x2c79('0x1'));var moment=require(_0x2c79('0x2'));var BPromise=require(_0x2c79('0x3'));var rs=require(_0x2c79('0x4'));var fs=require('fs');var Redis=require(_0x2c79('0x5'));var db=require(_0x2c79('0x6'))['db'];var utils=require(_0x2c79('0x7'));var logger=require(_0x2c79('0x8'))(_0x2c79('0x9'));var config=require(_0x2c79('0xa'));var jayson=require(_0x2c79('0xb'));var client=jayson[_0x2c79('0xc')][_0x2c79('0xd')]({'port':0x232a});config['redis']=_[_0x2c79('0xe')](config['redis'],{'host':_0x2c79('0xf'),'port':0x18eb});var socket=require(_0x2c79('0x10'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x17cf64,_0x833d79,_0x4eb007){return new BPromise(function(_0xb2fbea,_0x5914ec){return client[_0x2c79('0x11')](_0x17cf64,_0x4eb007)[_0x2c79('0x12')](function(_0x7a9a2e){logger[_0x2c79('0x13')]('Team,\x20%s,\x20%s',_0x833d79,_0x2c79('0x14'));logger[_0x2c79('0x15')]('Team,\x20%s,\x20%s,\x20%s',_0x833d79,'request\x20sent',JSON[_0x2c79('0x16')](_0x7a9a2e));if(_0x7a9a2e[_0x2c79('0x17')]){if(_0x7a9a2e[_0x2c79('0x17')][_0x2c79('0x18')]===0x1f4){logger[_0x2c79('0x17')](_0x2c79('0x19'),_0x833d79,_0x7a9a2e['error'][_0x2c79('0x1a')]);return _0x5914ec(_0x7a9a2e[_0x2c79('0x17')][_0x2c79('0x1a')]);}logger['error'](_0x2c79('0x19'),_0x833d79,_0x7a9a2e[_0x2c79('0x17')][_0x2c79('0x1a')]);return _0xb2fbea(_0x7a9a2e[_0x2c79('0x17')][_0x2c79('0x1a')]);}else{logger['info'](_0x2c79('0x19'),_0x833d79,_0x2c79('0x14'));_0xb2fbea(_0x7a9a2e[_0x2c79('0x1b')]['message']);}})['catch'](function(_0x3306b3){logger[_0x2c79('0x17')](_0x2c79('0x19'),_0x833d79,_0x3306b3);_0x5914ec(_0x3306b3);});});}
\ No newline at end of file
+var _0x1c9f=['then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x28877c,_0x5dfdfb){var _0x5852fe=function(_0xe14aed){while(--_0xe14aed){_0x28877c['push'](_0x28877c['shift']());}};_0x5852fe(++_0x5dfdfb);}(_0x1c9f,0x14f));var _0xf1c9=function(_0x245993,_0x44cf21){_0x245993=_0x245993-0x0;var _0x4d2d33=_0x1c9f[_0x245993];return _0x4d2d33;};'use strict';var _=require(_0xf1c9('0x0'));var util=require(_0xf1c9('0x1'));var moment=require(_0xf1c9('0x2'));var BPromise=require(_0xf1c9('0x3'));var rs=require(_0xf1c9('0x4'));var fs=require('fs');var Redis=require(_0xf1c9('0x5'));var db=require(_0xf1c9('0x6'))['db'];var utils=require(_0xf1c9('0x7'));var logger=require(_0xf1c9('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf1c9('0x9'));var client=jayson['client'][_0xf1c9('0xa')]({'port':0x232a});config[_0xf1c9('0xb')]=_['defaults'](config['redis'],{'host':_0xf1c9('0xc'),'port':0x18eb});var socket=require(_0xf1c9('0xd'))(new Redis(config[_0xf1c9('0xb')]));require('./team.socket')[_0xf1c9('0xe')](socket);function respondWithRpcPromise(_0x57e26f,_0x16ac70,_0xc8a30d){return new BPromise(function(_0x5d9e7f,_0x4a497a){return client[_0xf1c9('0xf')](_0x57e26f,_0xc8a30d)[_0xf1c9('0x10')](function(_0x1eeb3a){logger[_0xf1c9('0x11')](_0xf1c9('0x12'),_0x16ac70,_0xf1c9('0x13'));logger[_0xf1c9('0x14')](_0xf1c9('0x15'),_0x16ac70,'request\x20sent',JSON['stringify'](_0x1eeb3a));if(_0x1eeb3a[_0xf1c9('0x16')]){if(_0x1eeb3a[_0xf1c9('0x16')][_0xf1c9('0x17')]===0x1f4){logger[_0xf1c9('0x16')](_0xf1c9('0x12'),_0x16ac70,_0x1eeb3a['error']['message']);return _0x4a497a(_0x1eeb3a['error']['message']);}logger[_0xf1c9('0x16')](_0xf1c9('0x12'),_0x16ac70,_0x1eeb3a['error']['message']);return _0x5d9e7f(_0x1eeb3a[_0xf1c9('0x16')]['message']);}else{logger[_0xf1c9('0x11')]('Team,\x20%s,\x20%s',_0x16ac70,'request\x20sent');_0x5d9e7f(_0x1eeb3a[_0xf1c9('0x18')][_0xf1c9('0x19')]);}})[_0xf1c9('0x1a')](function(_0xad180c){logger[_0xf1c9('0x16')]('Team,\x20%s,\x20%s',_0x16ac70,_0xad180c);_0x4a497a(_0xad180c);});});}
\ No newline at end of file
index 8192652..4a213a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x795a=['register','team:','./team.events','save','update','emit','removeListener'];(function(_0x2f8cc7,_0x191d30){var _0x23f5a0=function(_0x1d21a9){while(--_0x1d21a9){_0x2f8cc7['push'](_0x2f8cc7['shift']());}};_0x23f5a0(++_0x191d30);}(_0x795a,0x79));var _0xa795=function(_0x9fe687,_0x2a5324){_0x9fe687=_0x9fe687-0x0;var _0x28e187=_0x795a[_0x9fe687];return _0x28e187;};'use strict';var TeamEvents=require(_0xa795('0x0'));var events=[_0xa795('0x1'),'remove',_0xa795('0x2')];function createListener(_0x1f22c9,_0x5c612e){return function(_0x20cdb4){_0x5c612e[_0xa795('0x3')](_0x1f22c9,_0x20cdb4);};}function removeListener(_0x28bbdc,_0x50fedd){return function(){TeamEvents[_0xa795('0x4')](_0x28bbdc,_0x50fedd);};}exports[_0xa795('0x5')]=function(_0x53c75f){for(var _0x243b17=0x0,_0x1ed37b=events['length'];_0x243b17<_0x1ed37b;_0x243b17++){var _0x448c8d=events[_0x243b17];var _0x2115e1=createListener(_0xa795('0x6')+_0x448c8d,_0x53c75f);TeamEvents['on'](_0x448c8d,_0x2115e1);}};
\ No newline at end of file
+var _0xe9e8=['length','team:','./team.events','save','remove','update','removeListener'];(function(_0x43e4a3,_0x520302){var _0x40df67=function(_0x26048b){while(--_0x26048b){_0x43e4a3['push'](_0x43e4a3['shift']());}};_0x40df67(++_0x520302);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x32f351,_0x307ecc){_0x32f351=_0x32f351-0x0;var _0x5160fd=_0xe9e8[_0x32f351];return _0x5160fd;};'use strict';var TeamEvents=require(_0x8e9e('0x0'));var events=[_0x8e9e('0x1'),_0x8e9e('0x2'),_0x8e9e('0x3')];function createListener(_0x40b66d,_0x2358cc){return function(_0x10ee84){_0x2358cc['emit'](_0x40b66d,_0x10ee84);};}function removeListener(_0x103d8b,_0x2a1d41){return function(){TeamEvents[_0x8e9e('0x4')](_0x103d8b,_0x2a1d41);};}exports['register']=function(_0x5c10ad){for(var _0x39983a=0x0,_0x204f5c=events[_0x8e9e('0x5')];_0x39983a<_0x204f5c;_0x39983a++){var _0x58f822=events[_0x39983a];var _0x3b5d21=createListener(_0x8e9e('0x6')+_0x58f822,_0x5c10ad);TeamEvents['on'](_0x58f822,_0x3b5d21);}};
\ No newline at end of file
index c9dcb57..e68fe63 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(_0xd8e52c,_0x3c575a){var _0x381714=function(_0x458f5a){while(--_0x458f5a){_0xd8e52c['push'](_0xd8e52c['shift']());}};_0x381714(++_0x3c575a);}(_0xedd9,0xfc));var _0x9edd=function(_0xfcdf1b,_0x15d076){_0xfcdf1b=_0xfcdf1b-0x0;var _0x4ec01a=_0xedd9[_0xfcdf1b];return _0x4ec01a;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c9b2f,_0x35c101){var _0x445c52=function(_0xe148e5){while(--_0xe148e5){_0x2c9b2f['push'](_0x2c9b2f['shift']());}};_0x445c52(++_0x35c101);}(_0xe706,0xa3));var _0x6e70=function(_0x40c120,_0x945e7a){_0x40c120=_0x40c120-0x0;var _0xe9f0d=_0xe706[_0x40c120];return _0xe9f0d;};'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 f0f0d0c..a913539 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6d8=['INTEGER','sequelize','exports'];(function(_0x36ae94,_0x3a3e58){var _0x2c21da=function(_0x361895){while(--_0x361895){_0x36ae94['push'](_0x36ae94['shift']());}};_0x2c21da(++_0x3a3e58);}(_0xa6d8,0x6a));var _0x8a6d=function(_0x3a6c6d,_0x2dda5c){_0x3a6c6d=_0x3a6c6d-0x0;var _0x4868ed=_0xa6d8[_0x3a6c6d];return _0x4868ed;};'use strict';var Sequelize=require(_0x8a6d('0x0'));module[_0x8a6d('0x1')]={'penalty':{'type':Sequelize[_0x8a6d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7f79=['sequelize','exports','INTEGER'];(function(_0x235ea9,_0x579aa6){var _0x30ff96=function(_0x525bb4){while(--_0x525bb4){_0x235ea9['push'](_0x235ea9['shift']());}};_0x30ff96(++_0x579aa6);}(_0x7f79,0x8a));var _0x97f7=function(_0x2ac972,_0x4e94d5){_0x2ac972=_0x2ac972-0x0;var _0x2cd16d=_0x7f79[_0x2ac972];return _0x2cd16d;};'use strict';var Sequelize=require(_0x97f7('0x0'));module[_0x97f7('0x1')]={'penalty':{'type':Sequelize[_0x97f7('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 8099fd9..2859f07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3299=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment'];(function(_0x39ee15,_0x4b7157){var _0x44b898=function(_0x37aca9){while(--_0x37aca9){_0x39ee15['push'](_0x39ee15['shift']());}};_0x44b898(++_0x4b7157);}(_0x3299,0x1bc));var _0x9329=function(_0x22801d,_0x4fdb7d){_0x22801d=_0x22801d-0x0;var _0x26ad95=_0x3299[_0x22801d];return _0x26ad95;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var logger=require(_0x9329('0x1'))(_0x9329('0x2'));var moment=require(_0x9329('0x3'));var BPromise=require(_0x9329('0x4'));var rp=require(_0x9329('0x5'));var fs=require('fs');var path=require(_0x9329('0x6'));var rimraf=require(_0x9329('0x7'));var config=require(_0x9329('0x8'));var attributes=require(_0x9329('0x9'));module[_0x9329('0xa')]=function(_0x3ec016,_0x2238fc){return _0x3ec016[_0x9329('0xb')](_0x9329('0xc'),attributes,{'tableName':_0x9329('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6f1=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb6f1,0x118));var _0x1b6f=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xb6f1[_0x25bca6];return _0x3f8d02;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var logger=require(_0x1b6f('0x1'))('api');var moment=require(_0x1b6f('0x2'));var BPromise=require(_0x1b6f('0x3'));var rp=require(_0x1b6f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b6f('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b6f('0x6'));module[_0x1b6f('0x7')]=function(_0xd4703b,_0x493c91){return _0xd4703b['define'](_0x1b6f('0x8'),attributes,{'tableName':_0x1b6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c972428..0fefa0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14e0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x45e35a,_0x3199c4){var _0x177588=function(_0x8e2aa4){while(--_0x8e2aa4){_0x45e35a['push'](_0x45e35a['shift']());}};_0x177588(++_0x3199c4);}(_0x14e0,0x11d));var _0x014e=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0x14e0[_0x369a98];return _0x29565c;};'use strict';var _=require(_0x014e('0x0'));var util=require(_0x014e('0x1'));var moment=require(_0x014e('0x2'));var BPromise=require(_0x014e('0x3'));var rs=require(_0x014e('0x4'));var fs=require('fs');var Redis=require(_0x014e('0x5'));var db=require(_0x014e('0x6'))['db'];var utils=require(_0x014e('0x7'));var logger=require('../../config/logger')(_0x014e('0x8'));var config=require(_0x014e('0x9'));var jayson=require(_0x014e('0xa'));var client=jayson[_0x014e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x500b55,_0x5f56c2,_0x2600e8){return new BPromise(function(_0x115cd0,_0x18bc18){return client[_0x014e('0xc')](_0x500b55,_0x2600e8)[_0x014e('0xd')](function(_0x2e0510){logger[_0x014e('0xe')](_0x014e('0xf'),_0x5f56c2,_0x014e('0x10'));logger[_0x014e('0x11')](_0x014e('0x12'),_0x5f56c2,_0x014e('0x10'),JSON['stringify'](_0x2e0510));if(_0x2e0510[_0x014e('0x13')]){if(_0x2e0510[_0x014e('0x13')][_0x014e('0x14')]===0x1f4){logger[_0x014e('0x13')](_0x014e('0xf'),_0x5f56c2,_0x2e0510[_0x014e('0x13')][_0x014e('0x15')]);return _0x18bc18(_0x2e0510[_0x014e('0x13')]['message']);}logger['error'](_0x014e('0xf'),_0x5f56c2,_0x2e0510[_0x014e('0x13')][_0x014e('0x15')]);return _0x115cd0(_0x2e0510[_0x014e('0x13')][_0x014e('0x15')]);}else{logger[_0x014e('0xe')](_0x014e('0xf'),_0x5f56c2,_0x014e('0x10'));_0x115cd0(_0x2e0510[_0x014e('0x16')]['message']);}})[_0x014e('0x17')](function(_0x5ac249){logger[_0x014e('0x13')](_0x014e('0xf'),_0x5f56c2,_0x5ac249);_0x18bc18(_0x5ac249);});});}
\ No newline at end of file
+var _0xbfca=['info','request\x20sent','debug','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x3b1ecd,_0x38f712){var _0x2c6890=function(_0xad6b70){while(--_0xad6b70){_0x3b1ecd['push'](_0x3b1ecd['shift']());}};_0x2c6890(++_0x38f712);}(_0xbfca,0x112));var _0xabfc=function(_0x27118f,_0xad384f){_0x27118f=_0x27118f-0x0;var _0x5b9bf8=_0xbfca[_0x27118f];return _0x5b9bf8;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var moment=require(_0xabfc('0x2'));var BPromise=require(_0xabfc('0x3'));var rs=require(_0xabfc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabfc('0x5'))['db'];var utils=require(_0xabfc('0x6'));var logger=require(_0xabfc('0x7'))('rpc');var config=require(_0xabfc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabfc('0x9')][_0xabfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16abc7,_0x1df101,_0x531e51){return new BPromise(function(_0x254b5e,_0x43d753){return client['request'](_0x16abc7,_0x531e51)[_0xabfc('0xb')](function(_0x372ab5){logger[_0xabfc('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1df101,_0xabfc('0xd'));logger[_0xabfc('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1df101,_0xabfc('0xd'),JSON[_0xabfc('0xf')](_0x372ab5));if(_0x372ab5[_0xabfc('0x10')]){if(_0x372ab5[_0xabfc('0x10')][_0xabfc('0x11')]===0x1f4){logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x1df101,_0x372ab5[_0xabfc('0x10')]['message']);return _0x43d753(_0x372ab5[_0xabfc('0x10')][_0xabfc('0x13')]);}logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x1df101,_0x372ab5[_0xabfc('0x10')][_0xabfc('0x13')]);return _0x254b5e(_0x372ab5[_0xabfc('0x10')][_0xabfc('0x13')]);}else{logger[_0xabfc('0xc')](_0xabfc('0x12'),_0x1df101,_0xabfc('0xd'));_0x254b5e(_0x372ab5[_0xabfc('0x14')][_0xabfc('0x13')]);}})[_0xabfc('0x15')](function(_0x1047aa){logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x1df101,_0x1047aa);_0x43d753(_0x1047aa);});});}
\ No newline at end of file
index b1a840c..6aa334a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca8=['../../components/auth/service','../../config/environment','./template.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4a19c5,_0x3831a7){var _0x3b1a7c=function(_0x27bbbc){while(--_0x27bbbc){_0x4a19c5['push'](_0x4a19c5['shift']());}};_0x3b1a7c(++_0x3831a7);}(_0xeca8,0x1f2));var _0x8eca=function(_0x311510,_0x5ae23e){_0x311510=_0x311510-0x0;var _0x52bb34=_0xeca8[_0x311510];return _0x52bb34;};'use strict';var multer=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var path=require(_0x8eca('0x2'));var timeout=require(_0x8eca('0x3'));var express=require(_0x8eca('0x4'));var router=express[_0x8eca('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8eca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8eca('0x7'));var controller=require(_0x8eca('0x8'));router[_0x8eca('0x9')]('/',auth['isAuthenticated'](),controller[_0x8eca('0xa')]);router[_0x8eca('0x9')](_0x8eca('0xb'),auth[_0x8eca('0xc')](),controller[_0x8eca('0xd')]);router[_0x8eca('0xe')]('/',auth['isAuthenticated'](),controller[_0x8eca('0xf')]);router[_0x8eca('0x10')](_0x8eca('0xb'),auth[_0x8eca('0xc')](),controller[_0x8eca('0x11')]);router[_0x8eca('0x12')](_0x8eca('0xb'),auth[_0x8eca('0xc')](),controller[_0x8eca('0x13')]);module[_0x8eca('0x14')]=router;
\ No newline at end of file
+var _0x5324=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','multer','util'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x5324,0x154));var _0x4532=function(_0xaddabb,_0x88995a){_0xaddabb=_0xaddabb-0x0;var _0x3b7ad3=_0x5324[_0xaddabb];return _0x3b7ad3;};'use strict';var multer=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var path=require(_0x4532('0x2'));var timeout=require(_0x4532('0x3'));var express=require('express');var router=express[_0x4532('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4532('0x5'));var interaction=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var controller=require(_0x4532('0x8'));router[_0x4532('0x9')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xb')]);router[_0x4532('0x9')]('/:id',auth[_0x4532('0xa')](),controller[_0x4532('0xc')]);router[_0x4532('0xd')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xe')]);router[_0x4532('0xf')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller[_0x4532('0x11')]);router[_0x4532('0x12')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 7fe618d..79a1e71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3c6=['exports','STRING','TEXT','sequelize'];(function(_0x27602c,_0x44d01c){var _0x16593e=function(_0x57737b){while(--_0x57737b){_0x27602c['push'](_0x27602c['shift']());}};_0x16593e(++_0x44d01c);}(_0xe3c6,0x12f));var _0x6e3c=function(_0x1e52bf,_0x4cfa32){_0x1e52bf=_0x1e52bf-0x0;var _0x2fdc63=_0xe3c6[_0x1e52bf];return _0x2fdc63;};'use strict';var Sequelize=require(_0x6e3c('0x0'));module[_0x6e3c('0x1')]={'name':{'type':Sequelize[_0x6e3c('0x2')]},'description':{'type':Sequelize[_0x6e3c('0x2')]},'html':{'type':Sequelize[_0x6e3c('0x3')]}};
\ No newline at end of file
+var _0x05ab=['STRING','sequelize'];(function(_0x26fae4,_0x54095e){var _0x2c876d=function(_0x30027f){while(--_0x30027f){_0x26fae4['push'](_0x26fae4['shift']());}};_0x2c876d(++_0x54095e);}(_0x05ab,0x77));var _0xb05a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x05ab[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0xb05a('0x0'));module['exports']={'name':{'type':Sequelize[_0xb05a('0x1')]},'description':{'type':Sequelize[_0xb05a('0x1')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 5b0d1ca..6a12dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd09=['findAll','rows','catch','show','params','keys','Template','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','Templates','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xbd09,0x15b));var _0x9bd0=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xbd09[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x9bd0('0x0'));var rimraf=require(_0x9bd0('0x1'));var zipdir=require(_0x9bd0('0x2'));var jsonpatch=require(_0x9bd0('0x3'));var rp=require(_0x9bd0('0x4'));var moment=require(_0x9bd0('0x5'));var BPromise=require(_0x9bd0('0x6'));var Mustache=require(_0x9bd0('0x7'));var util=require('util');var path=require(_0x9bd0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9bd0('0x9'));var fs=require('fs');var fs_extra=require(_0x9bd0('0xa'));var _=require(_0x9bd0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9bd0('0xc'));var deskjs=require(_0x9bd0('0xd'));var toCsv=require(_0x9bd0('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9bd0('0xf'));var authService=require(_0x9bd0('0x10'));var qs=require(_0x9bd0('0x11'));var as=require(_0x9bd0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bd0('0x13'))('api');var utils=require(_0x9bd0('0x14'));var config=require(_0x9bd0('0x15'));var licenseUtil=require(_0x9bd0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b562,_0x4acef1){_0x4acef1=_0x4acef1||0xcc;return function(_0x4f4132){if(_0x4f4132){return _0x53b562['sendStatus'](_0x4acef1);}return _0x53b562[_0x9bd0('0x17')](_0x4acef1)[_0x9bd0('0x18')]();};}function respondWithResult(_0x45a1c4,_0x4ba847){_0x4ba847=_0x4ba847||0xc8;return function(_0x2e04d9){if(_0x2e04d9){return _0x45a1c4['status'](_0x4ba847)[_0x9bd0('0x19')](_0x2e04d9);}};}function respondWithFilteredResult(_0x2b50df,_0xa0d685){return function(_0x35590d){if(_0x35590d){var _0x32783b=typeof _0xa0d685[_0x9bd0('0x1a')]==='undefined'&&typeof _0xa0d685['limit']===_0x9bd0('0x1b');var _0xe60c41=_0x35590d[_0x9bd0('0x1c')];var _0x464773=_0x32783b?0x0:_0xa0d685[_0x9bd0('0x1a')];var _0x4da872=_0x32783b?_0x35590d[_0x9bd0('0x1c')]:_0xa0d685[_0x9bd0('0x1a')]+_0xa0d685[_0x9bd0('0x1d')];var _0x380d5d;if(_0x4da872>=_0xe60c41){_0x4da872=_0xe60c41;_0x380d5d=0xc8;}else{_0x380d5d=0xce;}_0x2b50df[_0x9bd0('0x17')](_0x380d5d);return _0x2b50df['set']('Content-Range',_0x464773+'-'+_0x4da872+'/'+_0xe60c41)['json'](_0x35590d);}return null;};}function patchUpdates(_0x9264cc){return function(_0x573ab1){try{jsonpatch[_0x9bd0('0x1e')](_0x573ab1,_0x9264cc,!![]);}catch(_0x51c0f4){return BPromise[_0x9bd0('0x1f')](_0x51c0f4);}return _0x573ab1['save']();};}function saveUpdates(_0xef390b,_0x517955){return function(_0x219215){if(_0x219215){return _0x219215[_0x9bd0('0x20')](_0xef390b)[_0x9bd0('0x21')](function(_0x54312f){return _0x54312f;});}return null;};}function removeEntity(_0x32e459,_0x26c57f){return function(_0x2b1697){if(_0x2b1697){return _0x2b1697[_0x9bd0('0x22')]()[_0x9bd0('0x21')](function(){var _0xc57725=_0x2b1697['get']({'plain':!![]});var _0x35c9c4=_0x9bd0('0x23');return db['UserProfileResource'][_0x9bd0('0x22')]({'where':{'type':_0x35c9c4,'resourceId':_0xc57725['id']}})['then'](function(){return _0x2b1697;});})[_0x9bd0('0x21')](function(){_0x32e459[_0x9bd0('0x17')](0xcc)[_0x9bd0('0x18')]();});}};}function handleEntityNotFound(_0x19ea01,_0x4d08f6){return function(_0x2d1078){if(!_0x2d1078){_0x19ea01[_0x9bd0('0x24')](0x194);}return _0x2d1078;};}function handleError(_0xe04f98,_0x3e5b70){_0x3e5b70=_0x3e5b70||0x1f4;return function(_0x1e5aa9){logger[_0x9bd0('0x25')](_0x1e5aa9[_0x9bd0('0x26')]);if(_0x1e5aa9[_0x9bd0('0x27')]){delete _0x1e5aa9['name'];}_0xe04f98['status'](_0x3e5b70)[_0x9bd0('0x28')](_0x1e5aa9);};}exports[_0x9bd0('0x29')]=function(_0x31a63d,_0x178f4){var _0x3705e4={},_0xf5ab83={},_0x3b2545={'count':0x0,'rows':[]};var _0xc20e81=_[_0x9bd0('0x2a')](db['Template'][_0x9bd0('0x2b')],function(_0x5b8175){return{'name':_0x5b8175[_0x9bd0('0x2c')],'type':_0x5b8175[_0x9bd0('0x2d')][_0x9bd0('0x2e')]};});_0xf5ab83[_0x9bd0('0x2f')]=_[_0x9bd0('0x2a')](_0xc20e81,_0x9bd0('0x27'));_0xf5ab83[_0x9bd0('0x30')]=_['keys'](_0x31a63d[_0x9bd0('0x30')]);_0xf5ab83[_0x9bd0('0x31')]=_[_0x9bd0('0x32')](_0xf5ab83['model'],_0xf5ab83[_0x9bd0('0x30')]);_0x3705e4[_0x9bd0('0x33')]=_[_0x9bd0('0x32')](_0xf5ab83[_0x9bd0('0x2f')],qs[_0x9bd0('0x34')](_0x31a63d[_0x9bd0('0x30')][_0x9bd0('0x34')]));_0x3705e4['attributes']=_0x3705e4[_0x9bd0('0x33')][_0x9bd0('0x35')]?_0x3705e4['attributes']:_0xf5ab83['model'];if(!_0x31a63d['query'][_0x9bd0('0x36')](_0x9bd0('0x37'))){_0x3705e4['limit']=qs[_0x9bd0('0x1d')](_0x31a63d[_0x9bd0('0x30')]['limit']);_0x3705e4[_0x9bd0('0x1a')]=qs[_0x9bd0('0x1a')](_0x31a63d[_0x9bd0('0x30')][_0x9bd0('0x1a')]);}_0x3705e4[_0x9bd0('0x38')]=qs[_0x9bd0('0x39')](_0x31a63d[_0x9bd0('0x30')][_0x9bd0('0x39')]);_0x3705e4[_0x9bd0('0x3a')]=qs[_0x9bd0('0x31')](_[_0x9bd0('0x3b')](_0x31a63d[_0x9bd0('0x30')],_0xf5ab83[_0x9bd0('0x31')]),_0xc20e81);if(_0x31a63d['query']['filter']){_0x3705e4['where']=_['merge'](_0x3705e4[_0x9bd0('0x3a')],{'$or':_[_0x9bd0('0x2a')](_0xc20e81,function(_0x25970b){if(_0x25970b[_0x9bd0('0x2d')]!=='VIRTUAL'){var _0x35a6ce={};_0x35a6ce[_0x25970b['name']]={'$like':'%'+_0x31a63d[_0x9bd0('0x30')]['filter']+'%'};return _0x35a6ce;}})});}_0x3705e4=_[_0x9bd0('0x3c')]({},_0x3705e4,_0x31a63d['options']);var _0x4629ad={'where':_0x3705e4[_0x9bd0('0x3a')]};return db['Template'][_0x9bd0('0x1c')](_0x4629ad)[_0x9bd0('0x21')](function(_0x13f0e2){_0x3b2545['count']=_0x13f0e2;if(_0x31a63d[_0x9bd0('0x30')][_0x9bd0('0x3d')]){_0x3705e4[_0x9bd0('0x3e')]=[{'all':!![]}];}return db['Template'][_0x9bd0('0x3f')](_0x3705e4);})[_0x9bd0('0x21')](function(_0x1a80ef){_0x3b2545[_0x9bd0('0x40')]=_0x1a80ef;return _0x3b2545;})[_0x9bd0('0x21')](respondWithFilteredResult(_0x178f4,_0x3705e4))[_0x9bd0('0x41')](handleError(_0x178f4,null));};exports[_0x9bd0('0x42')]=function(_0x3d9650,_0x3cc93c){var _0x2d480f={'raw':!![],'where':{'id':_0x3d9650[_0x9bd0('0x43')]['id']}},_0x3133ac={};_0x3133ac[_0x9bd0('0x2f')]=_[_0x9bd0('0x44')](db[_0x9bd0('0x45')]['rawAttributes']);_0x3133ac[_0x9bd0('0x30')]=_[_0x9bd0('0x44')](_0x3d9650[_0x9bd0('0x30')]);_0x3133ac[_0x9bd0('0x31')]=_[_0x9bd0('0x32')](_0x3133ac[_0x9bd0('0x2f')],_0x3133ac[_0x9bd0('0x30')]);_0x2d480f[_0x9bd0('0x33')]=_[_0x9bd0('0x32')](_0x3133ac[_0x9bd0('0x2f')],qs['fields'](_0x3d9650[_0x9bd0('0x30')][_0x9bd0('0x34')]));_0x2d480f[_0x9bd0('0x33')]=_0x2d480f[_0x9bd0('0x33')][_0x9bd0('0x35')]?_0x2d480f['attributes']:_0x3133ac['model'];if(_0x3d9650[_0x9bd0('0x30')][_0x9bd0('0x3d')]){_0x2d480f[_0x9bd0('0x3e')]=[{'all':!![]}];}_0x2d480f=_['merge']({},_0x2d480f,_0x3d9650[_0x9bd0('0x46')]);return db[_0x9bd0('0x45')]['find'](_0x2d480f)[_0x9bd0('0x21')](handleEntityNotFound(_0x3cc93c,null))[_0x9bd0('0x21')](respondWithResult(_0x3cc93c,null))[_0x9bd0('0x41')](handleError(_0x3cc93c,null));};exports[_0x9bd0('0x47')]=function(_0x591f3a,_0xd39cc3){return db['Template'][_0x9bd0('0x47')](_0x591f3a[_0x9bd0('0x48')],{})[_0x9bd0('0x21')](function(_0x12ef48){var _0x25a930=_0x591f3a[_0x9bd0('0x49')]['get']({'plain':!![]});if(!_0x25a930)throw new Error(_0x9bd0('0x4a'));if(_0x25a930[_0x9bd0('0x4b')]==='user'){var _0x5cb180=_0x12ef48[_0x9bd0('0x4c')]({'plain':!![]});var _0x3524e9=_0x9bd0('0x23');return db[_0x9bd0('0x4d')]['find']({'where':{'name':_0x3524e9,'userProfileId':_0x25a930[_0x9bd0('0x4e')]},'raw':!![]})['then'](function(_0x4afc9e){if(_0x4afc9e&&_0x4afc9e[_0x9bd0('0x4f')]===0x0){return db[_0x9bd0('0x50')][_0x9bd0('0x47')]({'name':_0x5cb180[_0x9bd0('0x27')],'resourceId':_0x5cb180['id'],'type':_0x4afc9e[_0x9bd0('0x27')],'sectionId':_0x4afc9e['id']},{})[_0x9bd0('0x21')](function(){return _0x12ef48;});}else{return _0x12ef48;}})[_0x9bd0('0x41')](function(_0x186d39){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x186d39);throw _0x186d39;});}return _0x12ef48;})['then'](respondWithResult(_0xd39cc3,0xc9))[_0x9bd0('0x41')](handleError(_0xd39cc3,null));};exports['update']=function(_0x432bfa,_0x108905){if(_0x432bfa[_0x9bd0('0x48')]['id']){delete _0x432bfa[_0x9bd0('0x48')]['id'];}return db[_0x9bd0('0x45')][_0x9bd0('0x51')]({'where':{'id':_0x432bfa['params']['id']}})['then'](handleEntityNotFound(_0x108905,null))[_0x9bd0('0x21')](saveUpdates(_0x432bfa[_0x9bd0('0x48')],null))[_0x9bd0('0x21')](respondWithResult(_0x108905,null))[_0x9bd0('0x41')](handleError(_0x108905,null));};exports[_0x9bd0('0x22')]=function(_0x207ec6,_0x4043b7){return db[_0x9bd0('0x45')]['find']({'where':{'id':_0x207ec6[_0x9bd0('0x43')]['id']}})[_0x9bd0('0x21')](handleEntityNotFound(_0x4043b7,null))['then'](removeEntity(_0x4043b7,null))[_0x9bd0('0x41')](handleError(_0x4043b7,null));};
\ No newline at end of file
+var _0x2cdb=['intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','Template','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes'];(function(_0x4aa624,_0x29da27){var _0x531842=function(_0xed0ff2){while(--_0xed0ff2){_0x4aa624['push'](_0x4aa624['shift']());}};_0x531842(++_0x29da27);}(_0x2cdb,0x110));var _0xb2cd=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2cdb[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xb2cd('0x0'));var rimraf=require(_0xb2cd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb2cd('0x2'));var rp=require(_0xb2cd('0x3'));var moment=require(_0xb2cd('0x4'));var BPromise=require(_0xb2cd('0x5'));var Mustache=require(_0xb2cd('0x6'));var util=require(_0xb2cd('0x7'));var path=require(_0xb2cd('0x8'));var sox=require('sox');var csv=require(_0xb2cd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb2cd('0xa'));var crypto=require('crypto');var jsforce=require(_0xb2cd('0xb'));var deskjs=require(_0xb2cd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb2cd('0xd'));var Papa=require(_0xb2cd('0xe'));var Redis=require(_0xb2cd('0xf'));var authService=require(_0xb2cd('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2cd('0x11'))(_0xb2cd('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb2cd('0x13'));var db=require(_0xb2cd('0x14'))['db'];function respondWithStatusCode(_0x2d26d7,_0x2e0154){_0x2e0154=_0x2e0154||0xcc;return function(_0x445c95){if(_0x445c95){return _0x2d26d7['sendStatus'](_0x2e0154);}return _0x2d26d7[_0xb2cd('0x15')](_0x2e0154)[_0xb2cd('0x16')]();};}function respondWithResult(_0x1fef2a,_0x2908a6){_0x2908a6=_0x2908a6||0xc8;return function(_0x4bf006){if(_0x4bf006){return _0x1fef2a[_0xb2cd('0x15')](_0x2908a6)[_0xb2cd('0x17')](_0x4bf006);}};}function respondWithFilteredResult(_0x13ec35,_0x416f4f){return function(_0xed988a){if(_0xed988a){var _0x2ca25d=typeof _0x416f4f[_0xb2cd('0x18')]===_0xb2cd('0x19')&&typeof _0x416f4f['limit']===_0xb2cd('0x19');var _0x4cf195=_0xed988a['count'];var _0x41da8b=_0x2ca25d?0x0:_0x416f4f['offset'];var _0x3a93e5=_0x2ca25d?_0xed988a[_0xb2cd('0x1a')]:_0x416f4f['offset']+_0x416f4f['limit'];var _0x42788d;if(_0x3a93e5>=_0x4cf195){_0x3a93e5=_0x4cf195;_0x42788d=0xc8;}else{_0x42788d=0xce;}_0x13ec35[_0xb2cd('0x15')](_0x42788d);return _0x13ec35[_0xb2cd('0x1b')](_0xb2cd('0x1c'),_0x41da8b+'-'+_0x3a93e5+'/'+_0x4cf195)[_0xb2cd('0x17')](_0xed988a);}return null;};}function patchUpdates(_0x9d03d2){return function(_0x1d7084){try{jsonpatch[_0xb2cd('0x1d')](_0x1d7084,_0x9d03d2,!![]);}catch(_0x4b3ee0){return BPromise[_0xb2cd('0x1e')](_0x4b3ee0);}return _0x1d7084[_0xb2cd('0x1f')]();};}function saveUpdates(_0x146a57,_0x2f2917){return function(_0x1cc754){if(_0x1cc754){return _0x1cc754[_0xb2cd('0x20')](_0x146a57)[_0xb2cd('0x21')](function(_0x209343){return _0x209343;});}return null;};}function removeEntity(_0x1bb249,_0x3917dc){return function(_0x5c3821){if(_0x5c3821){return _0x5c3821[_0xb2cd('0x22')]()[_0xb2cd('0x21')](function(){var _0x20b470=_0x5c3821[_0xb2cd('0x23')]({'plain':!![]});var _0x188777=_0xb2cd('0x24');return db[_0xb2cd('0x25')]['destroy']({'where':{'type':_0x188777,'resourceId':_0x20b470['id']}})['then'](function(){return _0x5c3821;});})[_0xb2cd('0x21')](function(){_0x1bb249[_0xb2cd('0x15')](0xcc)[_0xb2cd('0x16')]();});}};}function handleEntityNotFound(_0x5ab930,_0x461f06){return function(_0xf07ea){if(!_0xf07ea){_0x5ab930['sendStatus'](0x194);}return _0xf07ea;};}function handleError(_0x159b04,_0x403fd6){_0x403fd6=_0x403fd6||0x1f4;return function(_0x12fbdc){logger[_0xb2cd('0x26')](_0x12fbdc[_0xb2cd('0x27')]);if(_0x12fbdc[_0xb2cd('0x28')]){delete _0x12fbdc['name'];}_0x159b04[_0xb2cd('0x15')](_0x403fd6)['send'](_0x12fbdc);};}exports['index']=function(_0x431a77,_0x428553){var _0x5848e8={},_0x5e2a10={},_0x1f7817={'count':0x0,'rows':[]};var _0x52218d=_['map'](db[_0xb2cd('0x29')][_0xb2cd('0x2a')],function(_0x19b48c){return{'name':_0x19b48c[_0xb2cd('0x2b')],'type':_0x19b48c[_0xb2cd('0x2c')][_0xb2cd('0x2d')]};});_0x5e2a10['model']=_[_0xb2cd('0x2e')](_0x52218d,_0xb2cd('0x28'));_0x5e2a10[_0xb2cd('0x2f')]=_[_0xb2cd('0x30')](_0x431a77['query']);_0x5e2a10[_0xb2cd('0x31')]=_['intersection'](_0x5e2a10[_0xb2cd('0x32')],_0x5e2a10[_0xb2cd('0x2f')]);_0x5848e8[_0xb2cd('0x33')]=_[_0xb2cd('0x34')](_0x5e2a10[_0xb2cd('0x32')],qs[_0xb2cd('0x35')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x35')]));_0x5848e8[_0xb2cd('0x33')]=_0x5848e8[_0xb2cd('0x33')][_0xb2cd('0x36')]?_0x5848e8['attributes']:_0x5e2a10['model'];if(!_0x431a77['query'][_0xb2cd('0x37')](_0xb2cd('0x38'))){_0x5848e8[_0xb2cd('0x39')]=qs[_0xb2cd('0x39')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x39')]);_0x5848e8[_0xb2cd('0x18')]=qs[_0xb2cd('0x18')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x18')]);}_0x5848e8[_0xb2cd('0x3a')]=qs[_0xb2cd('0x3b')](_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x3b')]);_0x5848e8[_0xb2cd('0x3c')]=qs['filters'](_[_0xb2cd('0x3d')](_0x431a77[_0xb2cd('0x2f')],_0x5e2a10[_0xb2cd('0x31')]),_0x52218d);if(_0x431a77[_0xb2cd('0x2f')]['filter']){_0x5848e8[_0xb2cd('0x3c')]=_[_0xb2cd('0x3e')](_0x5848e8['where'],{'$or':_['map'](_0x52218d,function(_0x5a7603){if(_0x5a7603[_0xb2cd('0x2c')]!==_0xb2cd('0x3f')){var _0x2d43aa={};_0x2d43aa[_0x5a7603[_0xb2cd('0x28')]]={'$like':'%'+_0x431a77[_0xb2cd('0x2f')]['filter']+'%'};return _0x2d43aa;}})});}_0x5848e8=_['merge']({},_0x5848e8,_0x431a77[_0xb2cd('0x40')]);var _0x34c7a9={'where':_0x5848e8[_0xb2cd('0x3c')]};return db[_0xb2cd('0x29')][_0xb2cd('0x1a')](_0x34c7a9)[_0xb2cd('0x21')](function(_0x4f5ae0){_0x1f7817[_0xb2cd('0x1a')]=_0x4f5ae0;if(_0x431a77[_0xb2cd('0x2f')][_0xb2cd('0x41')]){_0x5848e8[_0xb2cd('0x42')]=[{'all':!![]}];}return db[_0xb2cd('0x29')][_0xb2cd('0x43')](_0x5848e8);})[_0xb2cd('0x21')](function(_0x4fa4cd){_0x1f7817[_0xb2cd('0x44')]=_0x4fa4cd;return _0x1f7817;})['then'](respondWithFilteredResult(_0x428553,_0x5848e8))[_0xb2cd('0x45')](handleError(_0x428553,null));};exports[_0xb2cd('0x46')]=function(_0x1c519b,_0x23d9bb){var _0x193437={'raw':!![],'where':{'id':_0x1c519b[_0xb2cd('0x47')]['id']}},_0x5530d6={};_0x5530d6[_0xb2cd('0x32')]=_['keys'](db[_0xb2cd('0x29')]['rawAttributes']);_0x5530d6['query']=_[_0xb2cd('0x30')](_0x1c519b[_0xb2cd('0x2f')]);_0x5530d6['filters']=_[_0xb2cd('0x34')](_0x5530d6['model'],_0x5530d6[_0xb2cd('0x2f')]);_0x193437[_0xb2cd('0x33')]=_[_0xb2cd('0x34')](_0x5530d6['model'],qs[_0xb2cd('0x35')](_0x1c519b[_0xb2cd('0x2f')][_0xb2cd('0x35')]));_0x193437[_0xb2cd('0x33')]=_0x193437[_0xb2cd('0x33')][_0xb2cd('0x36')]?_0x193437[_0xb2cd('0x33')]:_0x5530d6[_0xb2cd('0x32')];if(_0x1c519b[_0xb2cd('0x2f')][_0xb2cd('0x41')]){_0x193437[_0xb2cd('0x42')]=[{'all':!![]}];}_0x193437=_['merge']({},_0x193437,_0x1c519b['options']);return db[_0xb2cd('0x29')][_0xb2cd('0x48')](_0x193437)[_0xb2cd('0x21')](handleEntityNotFound(_0x23d9bb,null))[_0xb2cd('0x21')](respondWithResult(_0x23d9bb,null))[_0xb2cd('0x45')](handleError(_0x23d9bb,null));};exports[_0xb2cd('0x49')]=function(_0x16a705,_0x2fa90b){return db['Template'][_0xb2cd('0x49')](_0x16a705[_0xb2cd('0x4a')],{})['then'](function(_0x45d0c4){var _0x227c98=_0x16a705[_0xb2cd('0x4b')]['get']({'plain':!![]});if(!_0x227c98)throw new Error(_0xb2cd('0x4c'));if(_0x227c98[_0xb2cd('0x4d')]===_0xb2cd('0x4b')){var _0x120ab2=_0x45d0c4[_0xb2cd('0x23')]({'plain':!![]});var _0xf2ee66=_0xb2cd('0x24');return db[_0xb2cd('0x4e')][_0xb2cd('0x48')]({'where':{'name':_0xf2ee66,'userProfileId':_0x227c98[_0xb2cd('0x4f')]},'raw':!![]})['then'](function(_0x16a3ec){if(_0x16a3ec&&_0x16a3ec[_0xb2cd('0x50')]===0x0){return db[_0xb2cd('0x25')]['create']({'name':_0x120ab2['name'],'resourceId':_0x120ab2['id'],'type':_0x16a3ec['name'],'sectionId':_0x16a3ec['id']},{})['then'](function(){return _0x45d0c4;});}else{return _0x45d0c4;}})[_0xb2cd('0x45')](function(_0x1f6e56){logger[_0xb2cd('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6e56);throw _0x1f6e56;});}return _0x45d0c4;})[_0xb2cd('0x21')](respondWithResult(_0x2fa90b,0xc9))[_0xb2cd('0x45')](handleError(_0x2fa90b,null));};exports['update']=function(_0x2a1dfe,_0x4a639a){if(_0x2a1dfe[_0xb2cd('0x4a')]['id']){delete _0x2a1dfe[_0xb2cd('0x4a')]['id'];}return db[_0xb2cd('0x29')]['find']({'where':{'id':_0x2a1dfe['params']['id']}})['then'](handleEntityNotFound(_0x4a639a,null))[_0xb2cd('0x21')](saveUpdates(_0x2a1dfe['body'],null))[_0xb2cd('0x21')](respondWithResult(_0x4a639a,null))[_0xb2cd('0x45')](handleError(_0x4a639a,null));};exports[_0xb2cd('0x22')]=function(_0x110036,_0x549912){return db[_0xb2cd('0x29')]['find']({'where':{'id':_0x110036['params']['id']}})[_0xb2cd('0x21')](handleEntityNotFound(_0x549912,null))[_0xb2cd('0x21')](removeEntity(_0x549912,null))[_0xb2cd('0x45')](handleError(_0x549912,null));};
\ No newline at end of file
index e34f849..3dbd6cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd89c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./template.attributes','exports','Template','tools_templates'];(function(_0x4a2872,_0x3c6919){var _0x129cb9=function(_0x29f687){while(--_0x29f687){_0x4a2872['push'](_0x4a2872['shift']());}};_0x129cb9(++_0x3c6919);}(_0xd89c,0x1ec));var _0xcd89=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xd89c[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0xcd89('0x0'));var util=require(_0xcd89('0x1'));var logger=require(_0xcd89('0x2'))(_0xcd89('0x3'));var moment=require(_0xcd89('0x4'));var BPromise=require(_0xcd89('0x5'));var rp=require(_0xcd89('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcd89('0x7'));var attributes=require(_0xcd89('0x8'));module[_0xcd89('0x9')]=function(_0x58ed4b,_0x44ecaa){return _0x58ed4b['define'](_0xcd89('0xa'),attributes,{'tableName':_0xcd89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc944=['bluebird','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','moment'];(function(_0x530086,_0x382014){var _0x4e29c2=function(_0x2bc473){while(--_0x2bc473){_0x530086['push'](_0x530086['shift']());}};_0x4e29c2(++_0x382014);}(_0xc944,0xec));var _0x4c94=function(_0x1c3cfd,_0x46b2f7){_0x1c3cfd=_0x1c3cfd-0x0;var _0x12fa72=_0xc944[_0x1c3cfd];return _0x12fa72;};'use strict';var _=require('lodash');var util=require(_0x4c94('0x0'));var logger=require(_0x4c94('0x1'))(_0x4c94('0x2'));var moment=require(_0x4c94('0x3'));var BPromise=require(_0x4c94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4c94('0x5'));module[_0x4c94('0x6')]=function(_0x415398,_0x96d623){return _0x415398[_0x4c94('0x7')](_0x4c94('0x8'),attributes,{'tableName':_0x4c94('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0c09676..5cb2f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d75=['options','where','attributes','limit','include','map','model','GetTemplate','lodash','util','bluebird','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6d75,0x126));var _0x56d7=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x6d75[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x56d7('0x0'));var util=require(_0x56d7('0x1'));var moment=require('moment');var BPromise=require(_0x56d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x56d7('0x3'));var jayson=require(_0x56d7('0x4'));var client=jayson[_0x56d7('0x5')][_0x56d7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1daafc,_0x2b8cd6,_0x204246){return new BPromise(function(_0x53d4b5,_0x178fa8){return client['request'](_0x1daafc,_0x204246)[_0x56d7('0x7')](function(_0x1256cb){logger[_0x56d7('0x8')](_0x56d7('0x9'),_0x2b8cd6,_0x56d7('0xa'));logger[_0x56d7('0xb')]('Template,\x20%s,\x20%s,\x20%s',_0x2b8cd6,_0x56d7('0xa'),JSON[_0x56d7('0xc')](_0x1256cb));if(_0x1256cb[_0x56d7('0xd')]){if(_0x1256cb[_0x56d7('0xd')][_0x56d7('0xe')]===0x1f4){logger[_0x56d7('0xd')](_0x56d7('0x9'),_0x2b8cd6,_0x1256cb['error']['message']);return _0x178fa8(_0x1256cb[_0x56d7('0xd')]['message']);}logger['error']('Template,\x20%s,\x20%s',_0x2b8cd6,_0x1256cb[_0x56d7('0xd')][_0x56d7('0xf')]);return _0x53d4b5(_0x1256cb[_0x56d7('0xd')][_0x56d7('0xf')]);}else{logger[_0x56d7('0x8')]('Template,\x20%s,\x20%s',_0x2b8cd6,'request\x20sent');_0x53d4b5(_0x1256cb[_0x56d7('0x10')]['message']);}})[_0x56d7('0x11')](function(_0x445ff5){logger['error'](_0x56d7('0x9'),_0x2b8cd6,_0x445ff5);_0x178fa8(_0x445ff5);});});}exports['GetTemplate']=function(_0x2f764f){var _0xa7a21e=this;return new Promise(function(_0x52dba2,_0x3c35d6){return db['Template']['findAll']({'raw':_0x2f764f[_0x56d7('0x12')]?_0x2f764f[_0x56d7('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x2f764f[_0x56d7('0x12')]?_0x2f764f[_0x56d7('0x12')][_0x56d7('0x13')]||null:null,'attributes':_0x2f764f['options']?_0x2f764f[_0x56d7('0x12')][_0x56d7('0x14')]||null:null,'limit':_0x2f764f[_0x56d7('0x12')]?_0x2f764f[_0x56d7('0x12')][_0x56d7('0x15')]||null:null,'include':_0x2f764f['options']?_0x2f764f[_0x56d7('0x12')][_0x56d7('0x16')]?_[_0x56d7('0x17')](_0x2f764f['options'][_0x56d7('0x16')],function(_0xa395d4){return{'model':db[_0xa395d4[_0x56d7('0x18')]],'as':_0xa395d4['as'],'attributes':_0xa395d4[_0x56d7('0x14')],'include':_0xa395d4[_0x56d7('0x16')]?_[_0x56d7('0x17')](_0xa395d4[_0x56d7('0x16')],function(_0x1cb6c4){return{'model':db[_0x1cb6c4[_0x56d7('0x18')]],'as':_0x1cb6c4['as'],'attributes':_0x1cb6c4['attributes'],'include':_0x1cb6c4[_0x56d7('0x16')]?_[_0x56d7('0x17')](_0x1cb6c4[_0x56d7('0x16')],function(_0x15bd37){return{'model':db[_0x15bd37['model']],'as':_0x15bd37['as'],'attributes':_0x15bd37[_0x56d7('0x14')]};}):[]};}):[]};}):[]:[]})[_0x56d7('0x7')](function(_0x2e5979){logger[_0x56d7('0x8')]('GetTemplate',_0x2f764f);logger[_0x56d7('0xb')]('GetTemplate',_0x2f764f,JSON[_0x56d7('0xc')](_0x2e5979));_0x52dba2(_0x2e5979);})[_0x56d7('0x11')](function(_0x1a5f8a){logger[_0x56d7('0xd')](_0x56d7('0x19'),_0x1a5f8a[_0x56d7('0xf')],_0x2f764f);_0x3c35d6(_0xa7a21e[_0x56d7('0xd')](0x1f4,_0x1a5f8a[_0x56d7('0xf')]));});});};
\ No newline at end of file
+var _0xfe1b=['map','GetTemplate','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Template','options','raw','where','attributes','limit','include','model'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0xfe1b,0x1e2));var _0xbfe1=function(_0x35102f,_0xe58b54){_0x35102f=_0x35102f-0x0;var _0x526ec1=_0xfe1b[_0x35102f];return _0x526ec1;};'use strict';var _=require(_0xbfe1('0x0'));var util=require(_0xbfe1('0x1'));var moment=require(_0xbfe1('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfe1('0x3'));var fs=require('fs');var Redis=require(_0xbfe1('0x4'));var db=require(_0xbfe1('0x5'))['db'];var utils=require(_0xbfe1('0x6'));var logger=require(_0xbfe1('0x7'))(_0xbfe1('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfe1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7be560,_0x50f1fe,_0x39f131){return new BPromise(function(_0x2bffd9,_0x53f5db){return client[_0xbfe1('0xa')](_0x7be560,_0x39f131)[_0xbfe1('0xb')](function(_0x3abfb4){logger[_0xbfe1('0xc')](_0xbfe1('0xd'),_0x50f1fe,_0xbfe1('0xe'));logger[_0xbfe1('0xf')](_0xbfe1('0x10'),_0x50f1fe,_0xbfe1('0xe'),JSON[_0xbfe1('0x11')](_0x3abfb4));if(_0x3abfb4[_0xbfe1('0x12')]){if(_0x3abfb4['error']['code']===0x1f4){logger[_0xbfe1('0x12')](_0xbfe1('0xd'),_0x50f1fe,_0x3abfb4['error'][_0xbfe1('0x13')]);return _0x53f5db(_0x3abfb4[_0xbfe1('0x12')]['message']);}logger[_0xbfe1('0x12')](_0xbfe1('0xd'),_0x50f1fe,_0x3abfb4[_0xbfe1('0x12')][_0xbfe1('0x13')]);return _0x2bffd9(_0x3abfb4[_0xbfe1('0x12')][_0xbfe1('0x13')]);}else{logger['info'](_0xbfe1('0xd'),_0x50f1fe,_0xbfe1('0xe'));_0x2bffd9(_0x3abfb4[_0xbfe1('0x14')]['message']);}})[_0xbfe1('0x15')](function(_0x3e6770){logger[_0xbfe1('0x12')](_0xbfe1('0xd'),_0x50f1fe,_0x3e6770);_0x53f5db(_0x3e6770);});});}exports['GetTemplate']=function(_0x443b80){var _0x4f2792=this;return new Promise(function(_0x4f3431,_0x54f632){return db[_0xbfe1('0x16')]['findAll']({'raw':_0x443b80[_0xbfe1('0x17')]?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x18')]===undefined?!![]:![]:!![],'where':_0x443b80[_0xbfe1('0x17')]?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x19')]||null:null,'attributes':_0x443b80[_0xbfe1('0x17')]?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x1a')]||null:null,'limit':_0x443b80[_0xbfe1('0x17')]?_0x443b80['options'][_0xbfe1('0x1b')]||null:null,'include':_0x443b80['options']?_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x1c')]?_['map'](_0x443b80[_0xbfe1('0x17')][_0xbfe1('0x1c')],function(_0x30b3a3){return{'model':db[_0x30b3a3[_0xbfe1('0x1d')]],'as':_0x30b3a3['as'],'attributes':_0x30b3a3[_0xbfe1('0x1a')],'include':_0x30b3a3[_0xbfe1('0x1c')]?_[_0xbfe1('0x1e')](_0x30b3a3[_0xbfe1('0x1c')],function(_0xd15e8d){return{'model':db[_0xd15e8d[_0xbfe1('0x1d')]],'as':_0xd15e8d['as'],'attributes':_0xd15e8d['attributes'],'include':_0xd15e8d[_0xbfe1('0x1c')]?_[_0xbfe1('0x1e')](_0xd15e8d['include'],function(_0x5c65a1){return{'model':db[_0x5c65a1[_0xbfe1('0x1d')]],'as':_0x5c65a1['as'],'attributes':_0x5c65a1[_0xbfe1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59eb99){logger[_0xbfe1('0xc')](_0xbfe1('0x1f'),_0x443b80);logger['debug'](_0xbfe1('0x1f'),_0x443b80,JSON[_0xbfe1('0x11')](_0x59eb99));_0x4f3431(_0x59eb99);})[_0xbfe1('0x15')](function(_0x4900f0){logger[_0xbfe1('0x12')]('GetTemplate',_0x4900f0['message'],_0x443b80);_0x54f632(_0x4f2792[_0xbfe1('0x12')](0x1f4,_0x4900f0[_0xbfe1('0x13')]));});});};
\ No newline at end of file
index ccfdfb5..ec62d79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x882c=['put','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition'];(function(_0x17de54,_0x29b4fd){var _0xa83267=function(_0x3a20f4){while(--_0x3a20f4){_0x17de54['push'](_0x17de54['shift']());}};_0xa83267(++_0x29b4fd);}(_0x882c,0x6c));var _0xc882=function(_0x4068a3,_0x1c2cd3){_0x4068a3=_0x4068a3-0x0;var _0xcdea1=_0x882c[_0x4068a3];return _0xcdea1;};'use strict';var multer=require(_0xc882('0x0'));var util=require(_0xc882('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc882('0x2'));var router=express['Router']();var fs_extra=require(_0xc882('0x3'));var auth=require(_0xc882('0x4'));var interaction=require(_0xc882('0x5'));var config=require(_0xc882('0x6'));var controller=require('./trigger.controller');router[_0xc882('0x7')]('/',auth[_0xc882('0x8')](),controller['index']);router[_0xc882('0x7')](_0xc882('0x9'),auth[_0xc882('0x8')](),controller['show']);router['get'](_0xc882('0xa'),auth[_0xc882('0x8')](),controller[_0xc882('0xb')]);router['get']('/:id/any_conditions',auth[_0xc882('0x8')](),controller[_0xc882('0xc')]);router[_0xc882('0x7')](_0xc882('0xd'),auth['isAuthenticated'](),controller[_0xc882('0xe')]);router[_0xc882('0xf')]('/',auth[_0xc882('0x8')](),controller[_0xc882('0x10')]);router[_0xc882('0xf')](_0xc882('0xa'),auth[_0xc882('0x8')](),controller['addAllCondition']);router[_0xc882('0xf')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xc882('0x11')]);router['post'](_0xc882('0xd'),auth[_0xc882('0x8')](),controller['addAction']);router[_0xc882('0x12')](_0xc882('0x9'),auth[_0xc882('0x8')](),controller['update']);router[_0xc882('0x13')](_0xc882('0x9'),auth['isAuthenticated'](),controller[_0xc882('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x3308=['addAllCondition','/:id/actions','addAction','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','post'];(function(_0x579155,_0x26d4e5){var _0x1bab6d=function(_0x51def4){while(--_0x51def4){_0x579155['push'](_0x579155['shift']());}};_0x1bab6d(++_0x26d4e5);}(_0x3308,0x160));var _0x8330=function(_0x71a356,_0x421707){_0x71a356=_0x71a356-0x0;var _0x5f58c5=_0x3308[_0x71a356];return _0x5f58c5;};'use strict';var multer=require(_0x8330('0x0'));var util=require(_0x8330('0x1'));var path=require(_0x8330('0x2'));var timeout=require(_0x8330('0x3'));var express=require(_0x8330('0x4'));var router=express[_0x8330('0x5')]();var fs_extra=require(_0x8330('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8330('0x7'));var controller=require('./trigger.controller');router[_0x8330('0x8')]('/',auth[_0x8330('0x9')](),controller[_0x8330('0xa')]);router['get'](_0x8330('0xb'),auth[_0x8330('0x9')](),controller[_0x8330('0xc')]);router[_0x8330('0x8')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller['getAllConditions']);router[_0x8330('0x8')](_0x8330('0xe'),auth[_0x8330('0x9')](),controller['getAnyConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x8330('0x9')](),controller['create']);router[_0x8330('0xf')](_0x8330('0xd'),auth[_0x8330('0x9')](),controller[_0x8330('0x10')]);router[_0x8330('0xf')]('/:id/any_conditions',auth[_0x8330('0x9')](),controller['addAnyCondition']);router[_0x8330('0xf')](_0x8330('0x11'),auth[_0x8330('0x9')](),controller[_0x8330('0x12')]);router[_0x8330('0x13')](_0x8330('0xb'),auth[_0x8330('0x9')](),controller[_0x8330('0x14')]);router[_0x8330('0x15')]('/:id',auth[_0x8330('0x9')](),controller[_0x8330('0x16')]);module['exports']=router;
\ No newline at end of file
index b85587c..97f08f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85ac=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4af43,_0x55c721){var _0x29fac6=function(_0x7fc6fe){while(--_0x7fc6fe){_0x4af43['push'](_0x4af43['shift']());}};_0x29fac6(++_0x55c721);}(_0x85ac,0x194));var _0xc85a=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x85ac[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require(_0xc85a('0x0'));module[_0xc85a('0x1')]={'name':{'type':Sequelize[_0xc85a('0x2')]},'channel':{'type':Sequelize[_0xc85a('0x2')]},'description':{'type':Sequelize[_0xc85a('0x2')]},'status':{'type':Sequelize[_0xc85a('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfcec=['sequelize','exports','STRING','BOOLEAN'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0xfcec,0xa0));var _0xcfce=function(_0x203b5c,_0x2384f1){_0x203b5c=_0x203b5c-0x0;var _0x20a057=_0xfcec[_0x203b5c];return _0x20a057;};'use strict';var Sequelize=require(_0xcfce('0x0'));module[_0xcfce('0x1')]={'name':{'type':Sequelize[_0xcfce('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcfce('0x2')]},'status':{'type':Sequelize[_0xcfce('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 82cc637..26a97a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d5=['order','sort','where','pick','filter','type','VIRTUAL','options','Trigger','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Triggers','UserProfileResource','then','end','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit'];(function(_0x3a04c6,_0x12a482){var _0xf4131a=function(_0x413ea2){while(--_0x413ea2){_0x3a04c6['push'](_0x3a04c6['shift']());}};_0xf4131a(++_0x12a482);}(_0x29d5,0x8e));var _0x529d=function(_0x40d9aa,_0x2d157d){_0x40d9aa=_0x40d9aa-0x0;var _0x34a058=_0x29d5[_0x40d9aa];return _0x34a058;};'use strict';var emlformat=require(_0x529d('0x0'));var rimraf=require(_0x529d('0x1'));var zipdir=require(_0x529d('0x2'));var jsonpatch=require(_0x529d('0x3'));var rp=require(_0x529d('0x4'));var moment=require(_0x529d('0x5'));var BPromise=require(_0x529d('0x6'));var Mustache=require(_0x529d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x529d('0x8'));var csv=require(_0x529d('0x9'));var ejs=require(_0x529d('0xa'));var fs=require('fs');var fs_extra=require(_0x529d('0xb'));var _=require(_0x529d('0xc'));var squel=require(_0x529d('0xd'));var crypto=require(_0x529d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x529d('0x9'));var querystring=require(_0x529d('0xf'));var Papa=require(_0x529d('0x10'));var Redis=require('ioredis');var authService=require(_0x529d('0x11'));var qs=require(_0x529d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x529d('0x13'));var logger=require('../../config/logger')(_0x529d('0x14'));var utils=require(_0x529d('0x15'));var config=require(_0x529d('0x16'));var licenseUtil=require(_0x529d('0x17'));var db=require(_0x529d('0x18'))['db'];function respondWithStatusCode(_0x96eedd,_0x2ddffd){_0x2ddffd=_0x2ddffd||0xcc;return function(_0x4c1b43){if(_0x4c1b43){return _0x96eedd[_0x529d('0x19')](_0x2ddffd);}return _0x96eedd[_0x529d('0x1a')](_0x2ddffd)['end']();};}function respondWithResult(_0x9822ea,_0x176216){_0x176216=_0x176216||0xc8;return function(_0x2de1cc){if(_0x2de1cc){return _0x9822ea['status'](_0x176216)[_0x529d('0x1b')](_0x2de1cc);}};}function respondWithFilteredResult(_0x2a35dc,_0xf07955){return function(_0x32f8f2){if(_0x32f8f2){var _0x169862=typeof _0xf07955[_0x529d('0x1c')]===_0x529d('0x1d')&&typeof _0xf07955[_0x529d('0x1e')]==='undefined';var _0x5ef38b=_0x32f8f2[_0x529d('0x1f')];var _0x2effd2=_0x169862?0x0:_0xf07955[_0x529d('0x1c')];var _0x560520=_0x169862?_0x32f8f2['count']:_0xf07955[_0x529d('0x1c')]+_0xf07955[_0x529d('0x1e')];var _0x185bfd;if(_0x560520>=_0x5ef38b){_0x560520=_0x5ef38b;_0x185bfd=0xc8;}else{_0x185bfd=0xce;}_0x2a35dc[_0x529d('0x1a')](_0x185bfd);return _0x2a35dc['set'](_0x529d('0x20'),_0x2effd2+'-'+_0x560520+'/'+_0x5ef38b)['json'](_0x32f8f2);}return null;};}function patchUpdates(_0x5373bb){return function(_0x4439ce){try{jsonpatch[_0x529d('0x21')](_0x4439ce,_0x5373bb,!![]);}catch(_0x15423f){return BPromise[_0x529d('0x22')](_0x15423f);}return _0x4439ce[_0x529d('0x23')]();};}function saveUpdates(_0x465cd8,_0x28c404){return function(_0x3f0320){if(_0x3f0320){return _0x3f0320['update'](_0x465cd8)['then'](function(_0x5e4a6c){return _0x5e4a6c;});}return null;};}function removeEntity(_0x374156,_0x1d0033){return function(_0x201e96){if(_0x201e96){return _0x201e96[_0x529d('0x24')]()['then'](function(){var _0x425362=_0x201e96[_0x529d('0x25')]({'plain':!![]});var _0xe1cfa6=_0x529d('0x26');return db[_0x529d('0x27')]['destroy']({'where':{'type':_0xe1cfa6,'resourceId':_0x425362['id']}})[_0x529d('0x28')](function(){return _0x201e96;});})['then'](function(){_0x374156['status'](0xcc)[_0x529d('0x29')]();});}};}function handleEntityNotFound(_0x134ce2,_0x26ee4e){return function(_0xc57506){if(!_0xc57506){_0x134ce2[_0x529d('0x19')](0x194);}return _0xc57506;};}function handleError(_0x51414d,_0x2a6d7c){_0x2a6d7c=_0x2a6d7c||0x1f4;return function(_0x1008ef){logger[_0x529d('0x2a')](_0x1008ef[_0x529d('0x2b')]);if(_0x1008ef['name']){delete _0x1008ef[_0x529d('0x2c')];}_0x51414d[_0x529d('0x1a')](_0x2a6d7c)[_0x529d('0x2d')](_0x1008ef);};}exports[_0x529d('0x2e')]=function(_0x4bd5aa,_0x21e2db){var _0x5334a7={},_0x78f808={},_0x40f34a={'count':0x0,'rows':[]};var _0x38b09a=_[_0x529d('0x2f')](db['Trigger']['rawAttributes'],function(_0x3767e1){return{'name':_0x3767e1[_0x529d('0x30')],'type':_0x3767e1['type'][_0x529d('0x31')]};});_0x78f808[_0x529d('0x32')]=_[_0x529d('0x2f')](_0x38b09a,_0x529d('0x2c'));_0x78f808[_0x529d('0x33')]=_['keys'](_0x4bd5aa[_0x529d('0x33')]);_0x78f808[_0x529d('0x34')]=_[_0x529d('0x35')](_0x78f808['model'],_0x78f808['query']);_0x5334a7['attributes']=_[_0x529d('0x35')](_0x78f808[_0x529d('0x32')],qs[_0x529d('0x36')](_0x4bd5aa['query'][_0x529d('0x36')]));_0x5334a7[_0x529d('0x37')]=_0x5334a7['attributes'][_0x529d('0x38')]?_0x5334a7['attributes']:_0x78f808[_0x529d('0x32')];if(!_0x4bd5aa[_0x529d('0x33')]['hasOwnProperty'](_0x529d('0x39'))){_0x5334a7[_0x529d('0x1e')]=qs[_0x529d('0x1e')](_0x4bd5aa[_0x529d('0x33')][_0x529d('0x1e')]);_0x5334a7[_0x529d('0x1c')]=qs[_0x529d('0x1c')](_0x4bd5aa[_0x529d('0x33')][_0x529d('0x1c')]);}_0x5334a7[_0x529d('0x3a')]=qs[_0x529d('0x3b')](_0x4bd5aa[_0x529d('0x33')][_0x529d('0x3b')]);_0x5334a7[_0x529d('0x3c')]=qs[_0x529d('0x34')](_[_0x529d('0x3d')](_0x4bd5aa[_0x529d('0x33')],_0x78f808[_0x529d('0x34')]),_0x38b09a);if(_0x4bd5aa[_0x529d('0x33')][_0x529d('0x3e')]){_0x5334a7[_0x529d('0x3c')]=_['merge'](_0x5334a7[_0x529d('0x3c')],{'$or':_[_0x529d('0x2f')](_0x38b09a,function(_0x523b13){if(_0x523b13[_0x529d('0x3f')]!==_0x529d('0x40')){var _0xe91e20={};_0xe91e20[_0x523b13[_0x529d('0x2c')]]={'$like':'%'+_0x4bd5aa[_0x529d('0x33')][_0x529d('0x3e')]+'%'};return _0xe91e20;}})});}_0x5334a7=_['merge']({},_0x5334a7,_0x4bd5aa[_0x529d('0x41')]);var _0x56bef2={'where':_0x5334a7[_0x529d('0x3c')]};return db[_0x529d('0x42')][_0x529d('0x1f')](_0x56bef2)[_0x529d('0x28')](function(_0x4c2092){_0x40f34a[_0x529d('0x1f')]=_0x4c2092;if(_0x4bd5aa['query']['includeAll']){_0x5334a7[_0x529d('0x43')]=[{'all':!![]}];}return db[_0x529d('0x42')][_0x529d('0x44')](_0x5334a7);})[_0x529d('0x28')](function(_0x5ad331){_0x40f34a[_0x529d('0x45')]=_0x5ad331;return _0x40f34a;})['then'](respondWithFilteredResult(_0x21e2db,_0x5334a7))[_0x529d('0x46')](handleError(_0x21e2db,null));};exports[_0x529d('0x47')]=function(_0x5d31c3,_0x9374ef){var _0x1c63de={'raw':![],'where':{'id':_0x5d31c3[_0x529d('0x48')]['id']}},_0xe1ce09={};_0xe1ce09[_0x529d('0x32')]=_[_0x529d('0x49')](db[_0x529d('0x42')][_0x529d('0x4a')]);_0xe1ce09[_0x529d('0x33')]=_[_0x529d('0x49')](_0x5d31c3[_0x529d('0x33')]);_0xe1ce09[_0x529d('0x34')]=_[_0x529d('0x35')](_0xe1ce09[_0x529d('0x32')],_0xe1ce09[_0x529d('0x33')]);_0x1c63de[_0x529d('0x37')]=_[_0x529d('0x35')](_0xe1ce09['model'],qs[_0x529d('0x36')](_0x5d31c3[_0x529d('0x33')]['fields']));_0x1c63de[_0x529d('0x37')]=_0x1c63de['attributes']['length']?_0x1c63de[_0x529d('0x37')]:_0xe1ce09['model'];if(_0x5d31c3[_0x529d('0x33')][_0x529d('0x4b')]){_0x1c63de[_0x529d('0x43')]=[{'all':!![]}];}_0x1c63de=_[_0x529d('0x4c')]({},_0x1c63de,_0x5d31c3['options']);return db['Trigger'][_0x529d('0x4d')](_0x1c63de)[_0x529d('0x28')](handleEntityNotFound(_0x9374ef,null))[_0x529d('0x28')](respondWithResult(_0x9374ef,null))[_0x529d('0x46')](handleError(_0x9374ef,null));};exports[_0x529d('0x4e')]=function(_0x2b01f2,_0x5f0f01){return db[_0x529d('0x42')]['create'](_0x2b01f2['body'],{})[_0x529d('0x28')](function(_0x26fa8c){var _0x54063a=_0x2b01f2[_0x529d('0x4f')]['get']({'plain':!![]});if(!_0x54063a)throw new Error(_0x529d('0x50'));if(_0x54063a[_0x529d('0x51')]===_0x529d('0x4f')){var _0x4764e9=_0x26fa8c[_0x529d('0x25')]({'plain':!![]});var _0x2944f8=_0x529d('0x26');return db[_0x529d('0x52')]['find']({'where':{'name':_0x2944f8,'userProfileId':_0x54063a[_0x529d('0x53')]},'raw':!![]})['then'](function(_0x1ffc07){if(_0x1ffc07&&_0x1ffc07[_0x529d('0x54')]===0x0){return db[_0x529d('0x27')][_0x529d('0x4e')]({'name':_0x4764e9[_0x529d('0x2c')],'resourceId':_0x4764e9['id'],'type':_0x1ffc07[_0x529d('0x2c')],'sectionId':_0x1ffc07['id']},{})[_0x529d('0x28')](function(){return _0x26fa8c;});}else{return _0x26fa8c;}})[_0x529d('0x46')](function(_0x54b875){logger[_0x529d('0x2a')](_0x529d('0x55'),_0x54b875);throw _0x54b875;});}return _0x26fa8c;})[_0x529d('0x28')](respondWithResult(_0x5f0f01,0xc9))[_0x529d('0x46')](handleError(_0x5f0f01,null));};exports[_0x529d('0x56')]=function(_0x4774e2,_0xbf4034){if(_0x4774e2[_0x529d('0x57')]['id']){delete _0x4774e2['body']['id'];}return db[_0x529d('0x42')][_0x529d('0x4d')]({'where':{'id':_0x4774e2[_0x529d('0x48')]['id']}})[_0x529d('0x28')](handleEntityNotFound(_0xbf4034,null))[_0x529d('0x28')](saveUpdates(_0x4774e2[_0x529d('0x57')],null))[_0x529d('0x28')](respondWithResult(_0xbf4034,null))[_0x529d('0x46')](handleError(_0xbf4034,null));};exports['destroy']=function(_0x11d1c5,_0x41816b){return db['Trigger'][_0x529d('0x4d')]({'where':{'id':_0x11d1c5[_0x529d('0x48')]['id']}})[_0x529d('0x28')](handleEntityNotFound(_0x41816b,null))[_0x529d('0x28')](removeEntity(_0x41816b,null))[_0x529d('0x46')](handleError(_0x41816b,null));};exports['addAllCondition']=function(_0x3ef8de,_0x34d72a,_0x4d2f6b){if(_0x3ef8de[_0x529d('0x57')]['id']){delete _0x3ef8de[_0x529d('0x57')]['id'];}return db[_0x529d('0x42')][_0x529d('0x4d')]({'where':{'id':_0x3ef8de[_0x529d('0x48')]['id']}})[_0x529d('0x28')](handleEntityNotFound(_0x34d72a,null))[_0x529d('0x28')](function(_0x32af90){if(_0x32af90){_0x3ef8de[_0x529d('0x57')][_0x529d('0x58')]=_0x32af90['id'];return db[_0x529d('0x59')]['create'](_0x3ef8de[_0x529d('0x57')]);}})[_0x529d('0x28')](respondWithResult(_0x34d72a,null))['catch'](handleError(_0x34d72a,null));};exports[_0x529d('0x5a')]=function(_0x33c385,_0x23e472,_0x1aa6e1){if(_0x33c385['body']['id']){delete _0x33c385[_0x529d('0x57')]['id'];}return db[_0x529d('0x42')][_0x529d('0x4d')]({'where':{'id':_0x33c385['params']['id']}})['then'](handleEntityNotFound(_0x23e472,null))[_0x529d('0x28')](function(_0x180f53){if(_0x180f53){_0x33c385[_0x529d('0x57')][_0x529d('0x5b')]=_0x180f53['id'];return db[_0x529d('0x59')]['create'](_0x33c385['body']);}})[_0x529d('0x28')](respondWithResult(_0x23e472,null))['catch'](handleError(_0x23e472,null));};exports[_0x529d('0x5c')]=function(_0x53837b,_0x192f30,_0x49520d){var _0x51d673={};var _0xf51121={};var _0x23976e;var _0x551447;return db['Trigger'][_0x529d('0x5d')]({'where':{'id':_0x53837b[_0x529d('0x48')]['id']}})[_0x529d('0x28')](handleEntityNotFound(_0x192f30,null))[_0x529d('0x28')](function(_0x5a621f){if(_0x5a621f){_0x23976e=_0x5a621f;_0xf51121[_0x529d('0x32')]=_[_0x529d('0x49')](db[_0x529d('0x59')][_0x529d('0x4a')]);_0xf51121[_0x529d('0x33')]=_[_0x529d('0x49')](_0x53837b[_0x529d('0x33')]);_0xf51121[_0x529d('0x34')]=_['intersection'](_0xf51121[_0x529d('0x32')],_0xf51121[_0x529d('0x33')]);_0x51d673[_0x529d('0x37')]=_[_0x529d('0x35')](_0xf51121[_0x529d('0x32')],qs[_0x529d('0x36')](_0x53837b[_0x529d('0x33')]['fields']));_0x51d673[_0x529d('0x37')]=_0x51d673[_0x529d('0x37')][_0x529d('0x38')]?_0x51d673[_0x529d('0x37')]:_0xf51121[_0x529d('0x32')];_0x51d673[_0x529d('0x3a')]=qs['sort'](_0x53837b['query'][_0x529d('0x3b')]);_0x51d673[_0x529d('0x3c')]=qs[_0x529d('0x34')](_[_0x529d('0x3d')](_0x53837b[_0x529d('0x33')],_0xf51121[_0x529d('0x34')]));if(_0x53837b[_0x529d('0x33')][_0x529d('0x3e')]){_0x51d673[_0x529d('0x3c')]=_['merge'](_0x51d673['where'],{'$or':_[_0x529d('0x2f')](_0x51d673[_0x529d('0x37')],function(_0x6d2a4){var _0x816f90={};_0x816f90[_0x6d2a4]={'$like':'%'+_0x53837b['query'][_0x529d('0x3e')]+'%'};return _0x816f90;})});}_0x51d673=_[_0x529d('0x4c')]({},_0x51d673,_0x53837b['options']);return _0x23976e[_0x529d('0x5c')](_0x51d673);}})[_0x529d('0x28')](function(_0x2cf377){if(_0x2cf377){_0x551447=_0x2cf377[_0x529d('0x38')];if(!_0x53837b[_0x529d('0x33')][_0x529d('0x5e')]('nolimit')){_0x51d673[_0x529d('0x1e')]=qs['limit'](_0x53837b[_0x529d('0x33')][_0x529d('0x1e')]);_0x51d673[_0x529d('0x1c')]=qs['offset'](_0x53837b['query'][_0x529d('0x1c')]);}return _0x23976e[_0x529d('0x5c')](_0x51d673);}})[_0x529d('0x28')](function(_0x5933df){if(_0x5933df){return _0x5933df?{'count':_0x551447,'rows':_0x5933df}:null;}})[_0x529d('0x28')](respondWithResult(_0x192f30,null))[_0x529d('0x46')](handleError(_0x192f30,null));};exports['getAnyConditions']=function(_0x30d125,_0x3eef50,_0x23c59b){var _0x4db08f={};var _0xf9cb7b={};var _0x14a770;var _0x937475;return db[_0x529d('0x42')][_0x529d('0x5d')]({'where':{'id':_0x30d125[_0x529d('0x48')]['id']}})[_0x529d('0x28')](handleEntityNotFound(_0x3eef50,null))[_0x529d('0x28')](function(_0x239e72){if(_0x239e72){_0x14a770=_0x239e72;_0xf9cb7b[_0x529d('0x32')]=_[_0x529d('0x49')](db[_0x529d('0x59')][_0x529d('0x4a')]);_0xf9cb7b[_0x529d('0x33')]=_[_0x529d('0x49')](_0x30d125[_0x529d('0x33')]);_0xf9cb7b[_0x529d('0x34')]=_[_0x529d('0x35')](_0xf9cb7b[_0x529d('0x32')],_0xf9cb7b[_0x529d('0x33')]);_0x4db08f[_0x529d('0x37')]=_[_0x529d('0x35')](_0xf9cb7b[_0x529d('0x32')],qs['fields'](_0x30d125[_0x529d('0x33')][_0x529d('0x36')]));_0x4db08f[_0x529d('0x37')]=_0x4db08f['attributes']['length']?_0x4db08f['attributes']:_0xf9cb7b['model'];_0x4db08f[_0x529d('0x3a')]=qs[_0x529d('0x3b')](_0x30d125[_0x529d('0x33')][_0x529d('0x3b')]);_0x4db08f[_0x529d('0x3c')]=qs[_0x529d('0x34')](_[_0x529d('0x3d')](_0x30d125[_0x529d('0x33')],_0xf9cb7b[_0x529d('0x34')]));if(_0x30d125['query'][_0x529d('0x3e')]){_0x4db08f['where']=_[_0x529d('0x4c')](_0x4db08f['where'],{'$or':_[_0x529d('0x2f')](_0x4db08f[_0x529d('0x37')],function(_0x5c2428){var _0x583cee={};_0x583cee[_0x5c2428]={'$like':'%'+_0x30d125['query']['filter']+'%'};return _0x583cee;})});}_0x4db08f=_[_0x529d('0x4c')]({},_0x4db08f,_0x30d125['options']);return _0x14a770[_0x529d('0x5f')](_0x4db08f);}})[_0x529d('0x28')](function(_0x168d4a){if(_0x168d4a){_0x937475=_0x168d4a[_0x529d('0x38')];if(!_0x30d125[_0x529d('0x33')][_0x529d('0x5e')]('nolimit')){_0x4db08f[_0x529d('0x1e')]=qs[_0x529d('0x1e')](_0x30d125[_0x529d('0x33')]['limit']);_0x4db08f[_0x529d('0x1c')]=qs['offset'](_0x30d125[_0x529d('0x33')][_0x529d('0x1c')]);}return _0x14a770[_0x529d('0x5f')](_0x4db08f);}})['then'](function(_0x251292){if(_0x251292){return _0x251292?{'count':_0x937475,'rows':_0x251292}:null;}})[_0x529d('0x28')](respondWithResult(_0x3eef50,null))['catch'](handleError(_0x3eef50,null));};exports[_0x529d('0x60')]=function(_0x84c51e,_0x503aab,_0x342d4d){if(_0x84c51e[_0x529d('0x57')]['id']){delete _0x84c51e[_0x529d('0x57')]['id'];}return db[_0x529d('0x42')][_0x529d('0x4d')]({'where':{'id':_0x84c51e[_0x529d('0x48')]['id']}})[_0x529d('0x28')](handleEntityNotFound(_0x503aab,null))[_0x529d('0x28')](function(_0x23f76c){if(_0x23f76c){_0x84c51e['body'][_0x529d('0x61')]=_0x23f76c['id'];return db[_0x529d('0x62')][_0x529d('0x4e')](_0x84c51e[_0x529d('0x57')]);}})[_0x529d('0x28')](respondWithResult(_0x503aab,null))[_0x529d('0x46')](handleError(_0x503aab,null));};exports[_0x529d('0x63')]=function(_0x2a023f,_0x2378b4,_0x1edd31){var _0x4ca4ae={};var _0x53b399={};var _0x2ab4eb;var _0xef1fd4;return db[_0x529d('0x42')][_0x529d('0x5d')]({'where':{'id':_0x2a023f[_0x529d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2378b4,null))[_0x529d('0x28')](function(_0x3545dd){if(_0x3545dd){_0x2ab4eb=_0x3545dd;_0x53b399[_0x529d('0x32')]=_[_0x529d('0x49')](db['Action']['rawAttributes']);_0x53b399['query']=_[_0x529d('0x49')](_0x2a023f['query']);_0x53b399['filters']=_[_0x529d('0x35')](_0x53b399[_0x529d('0x32')],_0x53b399[_0x529d('0x33')]);_0x4ca4ae[_0x529d('0x37')]=_[_0x529d('0x35')](_0x53b399['model'],qs[_0x529d('0x36')](_0x2a023f[_0x529d('0x33')]['fields']));_0x4ca4ae[_0x529d('0x37')]=_0x4ca4ae['attributes'][_0x529d('0x38')]?_0x4ca4ae[_0x529d('0x37')]:_0x53b399[_0x529d('0x32')];_0x4ca4ae['order']=qs[_0x529d('0x3b')](_0x2a023f[_0x529d('0x33')][_0x529d('0x3b')]);_0x4ca4ae[_0x529d('0x3c')]=qs['filters'](_[_0x529d('0x3d')](_0x2a023f[_0x529d('0x33')],_0x53b399['filters']));if(_0x2a023f[_0x529d('0x33')][_0x529d('0x3e')]){_0x4ca4ae[_0x529d('0x3c')]=_[_0x529d('0x4c')](_0x4ca4ae[_0x529d('0x3c')],{'$or':_[_0x529d('0x2f')](_0x4ca4ae[_0x529d('0x37')],function(_0x50b323){var _0x2e9929={};_0x2e9929[_0x50b323]={'$like':'%'+_0x2a023f['query'][_0x529d('0x3e')]+'%'};return _0x2e9929;})});}_0x4ca4ae=_['merge']({},_0x4ca4ae,_0x2a023f[_0x529d('0x41')]);return _0x2ab4eb[_0x529d('0x63')](_0x4ca4ae);}})[_0x529d('0x28')](function(_0x445218){if(_0x445218){_0xef1fd4=_0x445218[_0x529d('0x38')];if(!_0x2a023f[_0x529d('0x33')][_0x529d('0x5e')](_0x529d('0x39'))){_0x4ca4ae[_0x529d('0x1e')]=qs['limit'](_0x2a023f[_0x529d('0x33')][_0x529d('0x1e')]);_0x4ca4ae[_0x529d('0x1c')]=qs[_0x529d('0x1c')](_0x2a023f[_0x529d('0x33')][_0x529d('0x1c')]);}return _0x2ab4eb[_0x529d('0x63')](_0x4ca4ae);}})[_0x529d('0x28')](function(_0x2fbc6f){if(_0x2fbc6f){return _0x2fbc6f?{'count':_0xef1fd4,'rows':_0x2fbc6f}:null;}})[_0x529d('0x28')](respondWithResult(_0x2378b4,null))[_0x529d('0x46')](handleError(_0x2378b4,null));};
\ No newline at end of file
+var _0x7bdb=['intersection','model','attributes','fields','length','nolimit','sort','where','type','VIRTUAL','merge','options','include','Trigger','findAll','catch','show','params','includeAll','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','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','filter','order','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','get','Triggers','UserProfileResource','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters'];(function(_0x3b9f6a,_0x133730){var _0xfe40b1=function(_0x4513eb){while(--_0x4513eb){_0x3b9f6a['push'](_0x3b9f6a['shift']());}};_0xfe40b1(++_0x133730);}(_0x7bdb,0x8f));var _0xb7bd=function(_0x51ef40,_0x48a870){_0x51ef40=_0x51ef40-0x0;var _0x3ff060=_0x7bdb[_0x51ef40];return _0x3ff060;};'use strict';var emlformat=require(_0xb7bd('0x0'));var rimraf=require(_0xb7bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb7bd('0x2'));var moment=require(_0xb7bd('0x3'));var BPromise=require(_0xb7bd('0x4'));var Mustache=require(_0xb7bd('0x5'));var util=require(_0xb7bd('0x6'));var path=require(_0xb7bd('0x7'));var sox=require(_0xb7bd('0x8'));var csv=require(_0xb7bd('0x9'));var ejs=require(_0xb7bd('0xa'));var fs=require('fs');var fs_extra=require(_0xb7bd('0xb'));var _=require(_0xb7bd('0xc'));var squel=require(_0xb7bd('0xd'));var crypto=require(_0xb7bd('0xe'));var jsforce=require(_0xb7bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb7bd('0x9'));var querystring=require(_0xb7bd('0x10'));var Papa=require(_0xb7bd('0x11'));var Redis=require(_0xb7bd('0x12'));var authService=require(_0xb7bd('0x13'));var qs=require(_0xb7bd('0x14'));var as=require(_0xb7bd('0x15'));var hardwareService=require(_0xb7bd('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb7bd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb7bd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c838d,_0x391ae5){_0x391ae5=_0x391ae5||0xcc;return function(_0x14210a){if(_0x14210a){return _0x2c838d[_0xb7bd('0x19')](_0x391ae5);}return _0x2c838d[_0xb7bd('0x1a')](_0x391ae5)['end']();};}function respondWithResult(_0x4704c5,_0x4ec8fd){_0x4ec8fd=_0x4ec8fd||0xc8;return function(_0x1c6cfa){if(_0x1c6cfa){return _0x4704c5['status'](_0x4ec8fd)[_0xb7bd('0x1b')](_0x1c6cfa);}};}function respondWithFilteredResult(_0x4190ed,_0x1e0adf){return function(_0x18a556){if(_0x18a556){var _0x3e8372=typeof _0x1e0adf[_0xb7bd('0x1c')]===_0xb7bd('0x1d')&&typeof _0x1e0adf[_0xb7bd('0x1e')]==='undefined';var _0x342d0e=_0x18a556[_0xb7bd('0x1f')];var _0x39763a=_0x3e8372?0x0:_0x1e0adf[_0xb7bd('0x1c')];var _0x5118e5=_0x3e8372?_0x18a556[_0xb7bd('0x1f')]:_0x1e0adf[_0xb7bd('0x1c')]+_0x1e0adf[_0xb7bd('0x1e')];var _0x795942;if(_0x5118e5>=_0x342d0e){_0x5118e5=_0x342d0e;_0x795942=0xc8;}else{_0x795942=0xce;}_0x4190ed[_0xb7bd('0x1a')](_0x795942);return _0x4190ed['set'](_0xb7bd('0x20'),_0x39763a+'-'+_0x5118e5+'/'+_0x342d0e)[_0xb7bd('0x1b')](_0x18a556);}return null;};}function patchUpdates(_0x4a0ebf){return function(_0x18f203){try{jsonpatch['apply'](_0x18f203,_0x4a0ebf,!![]);}catch(_0x12e5bf){return BPromise['reject'](_0x12e5bf);}return _0x18f203[_0xb7bd('0x21')]();};}function saveUpdates(_0x5751ee,_0x116c99){return function(_0x5a51aa){if(_0x5a51aa){return _0x5a51aa[_0xb7bd('0x22')](_0x5751ee)['then'](function(_0x299f3c){return _0x299f3c;});}return null;};}function removeEntity(_0x5aad1e,_0x33be6b){return function(_0x2f255b){if(_0x2f255b){return _0x2f255b[_0xb7bd('0x23')]()['then'](function(){var _0x1935ba=_0x2f255b[_0xb7bd('0x24')]({'plain':!![]});var _0x3af6dc=_0xb7bd('0x25');return db[_0xb7bd('0x26')][_0xb7bd('0x23')]({'where':{'type':_0x3af6dc,'resourceId':_0x1935ba['id']}})[_0xb7bd('0x27')](function(){return _0x2f255b;});})[_0xb7bd('0x27')](function(){_0x5aad1e[_0xb7bd('0x1a')](0xcc)[_0xb7bd('0x28')]();});}};}function handleEntityNotFound(_0x51bafb,_0x3e2a15){return function(_0x1fd64d){if(!_0x1fd64d){_0x51bafb[_0xb7bd('0x19')](0x194);}return _0x1fd64d;};}function handleError(_0x4ebc73,_0x58469f){_0x58469f=_0x58469f||0x1f4;return function(_0x296bfa){logger[_0xb7bd('0x29')](_0x296bfa[_0xb7bd('0x2a')]);if(_0x296bfa[_0xb7bd('0x2b')]){delete _0x296bfa[_0xb7bd('0x2b')];}_0x4ebc73[_0xb7bd('0x1a')](_0x58469f)[_0xb7bd('0x2c')](_0x296bfa);};}exports[_0xb7bd('0x2d')]=function(_0x40567e,_0x3087f7){var _0x4c2def={},_0xaaf2cf={},_0x3c2773={'count':0x0,'rows':[]};var _0x26c81e=_[_0xb7bd('0x2e')](db['Trigger'][_0xb7bd('0x2f')],function(_0x5ec617){return{'name':_0x5ec617[_0xb7bd('0x30')],'type':_0x5ec617['type'][_0xb7bd('0x31')]};});_0xaaf2cf['model']=_[_0xb7bd('0x2e')](_0x26c81e,_0xb7bd('0x2b'));_0xaaf2cf[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x40567e[_0xb7bd('0x32')]);_0xaaf2cf[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0xaaf2cf[_0xb7bd('0x36')],_0xaaf2cf[_0xb7bd('0x32')]);_0x4c2def[_0xb7bd('0x37')]=_['intersection'](_0xaaf2cf[_0xb7bd('0x36')],qs['fields'](_0x40567e['query'][_0xb7bd('0x38')]));_0x4c2def[_0xb7bd('0x37')]=_0x4c2def[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0x4c2def[_0xb7bd('0x37')]:_0xaaf2cf[_0xb7bd('0x36')];if(!_0x40567e[_0xb7bd('0x32')]['hasOwnProperty'](_0xb7bd('0x3a'))){_0x4c2def[_0xb7bd('0x1e')]=qs['limit'](_0x40567e[_0xb7bd('0x32')][_0xb7bd('0x1e')]);_0x4c2def[_0xb7bd('0x1c')]=qs[_0xb7bd('0x1c')](_0x40567e[_0xb7bd('0x32')]['offset']);}_0x4c2def['order']=qs['sort'](_0x40567e[_0xb7bd('0x32')][_0xb7bd('0x3b')]);_0x4c2def[_0xb7bd('0x3c')]=qs['filters'](_['pick'](_0x40567e['query'],_0xaaf2cf[_0xb7bd('0x34')]),_0x26c81e);if(_0x40567e[_0xb7bd('0x32')]['filter']){_0x4c2def[_0xb7bd('0x3c')]=_['merge'](_0x4c2def['where'],{'$or':_[_0xb7bd('0x2e')](_0x26c81e,function(_0xfd0109){if(_0xfd0109[_0xb7bd('0x3d')]!==_0xb7bd('0x3e')){var _0xbb4ed0={};_0xbb4ed0[_0xfd0109['name']]={'$like':'%'+_0x40567e[_0xb7bd('0x32')]['filter']+'%'};return _0xbb4ed0;}})});}_0x4c2def=_[_0xb7bd('0x3f')]({},_0x4c2def,_0x40567e[_0xb7bd('0x40')]);var _0x2b47fb={'where':_0x4c2def['where']};return db['Trigger'][_0xb7bd('0x1f')](_0x2b47fb)[_0xb7bd('0x27')](function(_0x2d70b2){_0x3c2773[_0xb7bd('0x1f')]=_0x2d70b2;if(_0x40567e['query']['includeAll']){_0x4c2def[_0xb7bd('0x41')]=[{'all':!![]}];}return db[_0xb7bd('0x42')][_0xb7bd('0x43')](_0x4c2def);})[_0xb7bd('0x27')](function(_0xa5730c){_0x3c2773['rows']=_0xa5730c;return _0x3c2773;})[_0xb7bd('0x27')](respondWithFilteredResult(_0x3087f7,_0x4c2def))[_0xb7bd('0x44')](handleError(_0x3087f7,null));};exports[_0xb7bd('0x45')]=function(_0x23b82b,_0x386272){var _0x448ea1={'raw':![],'where':{'id':_0x23b82b[_0xb7bd('0x46')]['id']}},_0x51ed7f={};_0x51ed7f['model']=_[_0xb7bd('0x33')](db[_0xb7bd('0x42')]['rawAttributes']);_0x51ed7f[_0xb7bd('0x32')]=_['keys'](_0x23b82b[_0xb7bd('0x32')]);_0x51ed7f[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x51ed7f[_0xb7bd('0x36')],_0x51ed7f[_0xb7bd('0x32')]);_0x448ea1['attributes']=_[_0xb7bd('0x35')](_0x51ed7f[_0xb7bd('0x36')],qs[_0xb7bd('0x38')](_0x23b82b['query'][_0xb7bd('0x38')]));_0x448ea1[_0xb7bd('0x37')]=_0x448ea1['attributes']['length']?_0x448ea1['attributes']:_0x51ed7f[_0xb7bd('0x36')];if(_0x23b82b[_0xb7bd('0x32')][_0xb7bd('0x47')]){_0x448ea1[_0xb7bd('0x41')]=[{'all':!![]}];}_0x448ea1=_[_0xb7bd('0x3f')]({},_0x448ea1,_0x23b82b[_0xb7bd('0x40')]);return db[_0xb7bd('0x42')][_0xb7bd('0x48')](_0x448ea1)['then'](handleEntityNotFound(_0x386272,null))['then'](respondWithResult(_0x386272,null))['catch'](handleError(_0x386272,null));};exports[_0xb7bd('0x49')]=function(_0x355131,_0x86ac21){return db[_0xb7bd('0x42')][_0xb7bd('0x49')](_0x355131[_0xb7bd('0x4a')],{})['then'](function(_0x37c952){var _0x236ef2=_0x355131[_0xb7bd('0x4b')]['get']({'plain':!![]});if(!_0x236ef2)throw new Error(_0xb7bd('0x4c'));if(_0x236ef2[_0xb7bd('0x4d')]===_0xb7bd('0x4b')){var _0x40d0dd=_0x37c952[_0xb7bd('0x24')]({'plain':!![]});var _0x1de45f='Triggers';return db[_0xb7bd('0x4e')][_0xb7bd('0x48')]({'where':{'name':_0x1de45f,'userProfileId':_0x236ef2[_0xb7bd('0x4f')]},'raw':!![]})[_0xb7bd('0x27')](function(_0x43b961){if(_0x43b961&&_0x43b961[_0xb7bd('0x50')]===0x0){return db[_0xb7bd('0x26')]['create']({'name':_0x40d0dd[_0xb7bd('0x2b')],'resourceId':_0x40d0dd['id'],'type':_0x43b961[_0xb7bd('0x2b')],'sectionId':_0x43b961['id']},{})[_0xb7bd('0x27')](function(){return _0x37c952;});}else{return _0x37c952;}})[_0xb7bd('0x44')](function(_0x45725d){logger[_0xb7bd('0x29')](_0xb7bd('0x51'),_0x45725d);throw _0x45725d;});}return _0x37c952;})[_0xb7bd('0x27')](respondWithResult(_0x86ac21,0xc9))[_0xb7bd('0x44')](handleError(_0x86ac21,null));};exports[_0xb7bd('0x22')]=function(_0x4d7fe0,_0x24d81b){if(_0x4d7fe0[_0xb7bd('0x4a')]['id']){delete _0x4d7fe0['body']['id'];}return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x4d7fe0[_0xb7bd('0x46')]['id']}})['then'](handleEntityNotFound(_0x24d81b,null))[_0xb7bd('0x27')](saveUpdates(_0x4d7fe0[_0xb7bd('0x4a')],null))[_0xb7bd('0x27')](respondWithResult(_0x24d81b,null))[_0xb7bd('0x44')](handleError(_0x24d81b,null));};exports[_0xb7bd('0x23')]=function(_0x128e8d,_0x59c5d4){return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x128e8d[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x59c5d4,null))[_0xb7bd('0x27')](removeEntity(_0x59c5d4,null))[_0xb7bd('0x44')](handleError(_0x59c5d4,null));};exports[_0xb7bd('0x52')]=function(_0x581e96,_0x2f2b51,_0x3ea3e1){if(_0x581e96['body']['id']){delete _0x581e96[_0xb7bd('0x4a')]['id'];}return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x581e96[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x2f2b51,null))[_0xb7bd('0x27')](function(_0x3593c5){if(_0x3593c5){_0x581e96[_0xb7bd('0x4a')][_0xb7bd('0x53')]=_0x3593c5['id'];return db[_0xb7bd('0x54')]['create'](_0x581e96[_0xb7bd('0x4a')]);}})[_0xb7bd('0x27')](respondWithResult(_0x2f2b51,null))['catch'](handleError(_0x2f2b51,null));};exports[_0xb7bd('0x55')]=function(_0x201d4a,_0x416b9d,_0x46d06f){if(_0x201d4a[_0xb7bd('0x4a')]['id']){delete _0x201d4a[_0xb7bd('0x4a')]['id'];}return db['Trigger']['find']({'where':{'id':_0x201d4a[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x416b9d,null))[_0xb7bd('0x27')](function(_0x59ab61){if(_0x59ab61){_0x201d4a[_0xb7bd('0x4a')][_0xb7bd('0x56')]=_0x59ab61['id'];return db[_0xb7bd('0x54')][_0xb7bd('0x49')](_0x201d4a['body']);}})[_0xb7bd('0x27')](respondWithResult(_0x416b9d,null))[_0xb7bd('0x44')](handleError(_0x416b9d,null));};exports[_0xb7bd('0x57')]=function(_0x31f801,_0x4d1359,_0x104acc){var _0x259f41={};var _0x316fd0={};var _0x45799b;var _0x5dc16a;return db['Trigger'][_0xb7bd('0x58')]({'where':{'id':_0x31f801['params']['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x4d1359,null))['then'](function(_0x2c0050){if(_0x2c0050){_0x45799b=_0x2c0050;_0x316fd0[_0xb7bd('0x36')]=_[_0xb7bd('0x33')](db[_0xb7bd('0x54')][_0xb7bd('0x2f')]);_0x316fd0[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x31f801['query']);_0x316fd0[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x316fd0[_0xb7bd('0x36')],_0x316fd0['query']);_0x259f41['attributes']=_[_0xb7bd('0x35')](_0x316fd0[_0xb7bd('0x36')],qs[_0xb7bd('0x38')](_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x38')]));_0x259f41[_0xb7bd('0x37')]=_0x259f41[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0x259f41[_0xb7bd('0x37')]:_0x316fd0[_0xb7bd('0x36')];_0x259f41['order']=qs[_0xb7bd('0x3b')](_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x3b')]);_0x259f41[_0xb7bd('0x3c')]=qs['filters'](_[_0xb7bd('0x59')](_0x31f801[_0xb7bd('0x32')],_0x316fd0[_0xb7bd('0x34')]));if(_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x5a')]){_0x259f41[_0xb7bd('0x3c')]=_['merge'](_0x259f41['where'],{'$or':_['map'](_0x259f41['attributes'],function(_0x1cefb1){var _0x39725c={};_0x39725c[_0x1cefb1]={'$like':'%'+_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x5a')]+'%'};return _0x39725c;})});}_0x259f41=_[_0xb7bd('0x3f')]({},_0x259f41,_0x31f801[_0xb7bd('0x40')]);return _0x45799b['getAllConditions'](_0x259f41);}})[_0xb7bd('0x27')](function(_0x9305d9){if(_0x9305d9){_0x5dc16a=_0x9305d9[_0xb7bd('0x39')];if(!_0x31f801[_0xb7bd('0x32')]['hasOwnProperty'](_0xb7bd('0x3a'))){_0x259f41[_0xb7bd('0x1e')]=qs[_0xb7bd('0x1e')](_0x31f801[_0xb7bd('0x32')]['limit']);_0x259f41['offset']=qs[_0xb7bd('0x1c')](_0x31f801[_0xb7bd('0x32')][_0xb7bd('0x1c')]);}return _0x45799b[_0xb7bd('0x57')](_0x259f41);}})[_0xb7bd('0x27')](function(_0x50b6fa){if(_0x50b6fa){return _0x50b6fa?{'count':_0x5dc16a,'rows':_0x50b6fa}:null;}})[_0xb7bd('0x27')](respondWithResult(_0x4d1359,null))['catch'](handleError(_0x4d1359,null));};exports['getAnyConditions']=function(_0x51daff,_0x36ddce,_0x2229ce){var _0xfe0919={};var _0x211853={};var _0x2dd560;var _0x3e8de5;return db[_0xb7bd('0x42')][_0xb7bd('0x58')]({'where':{'id':_0x51daff[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x36ddce,null))[_0xb7bd('0x27')](function(_0x2c37bd){if(_0x2c37bd){_0x2dd560=_0x2c37bd;_0x211853[_0xb7bd('0x36')]=_['keys'](db[_0xb7bd('0x54')]['rawAttributes']);_0x211853[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x51daff[_0xb7bd('0x32')]);_0x211853[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x211853[_0xb7bd('0x36')],_0x211853['query']);_0xfe0919[_0xb7bd('0x37')]=_[_0xb7bd('0x35')](_0x211853[_0xb7bd('0x36')],qs[_0xb7bd('0x38')](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x38')]));_0xfe0919[_0xb7bd('0x37')]=_0xfe0919[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0xfe0919['attributes']:_0x211853[_0xb7bd('0x36')];_0xfe0919[_0xb7bd('0x5b')]=qs['sort'](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x3b')]);_0xfe0919[_0xb7bd('0x3c')]=qs[_0xb7bd('0x34')](_[_0xb7bd('0x59')](_0x51daff[_0xb7bd('0x32')],_0x211853[_0xb7bd('0x34')]));if(_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x5a')]){_0xfe0919[_0xb7bd('0x3c')]=_[_0xb7bd('0x3f')](_0xfe0919[_0xb7bd('0x3c')],{'$or':_[_0xb7bd('0x2e')](_0xfe0919['attributes'],function(_0x45248b){var _0x4c29d3={};_0x4c29d3[_0x45248b]={'$like':'%'+_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x5a')]+'%'};return _0x4c29d3;})});}_0xfe0919=_[_0xb7bd('0x3f')]({},_0xfe0919,_0x51daff[_0xb7bd('0x40')]);return _0x2dd560['getAnyConditions'](_0xfe0919);}})[_0xb7bd('0x27')](function(_0x2b9ebc){if(_0x2b9ebc){_0x3e8de5=_0x2b9ebc[_0xb7bd('0x39')];if(!_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x5c')]('nolimit')){_0xfe0919['limit']=qs[_0xb7bd('0x1e')](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x1e')]);_0xfe0919[_0xb7bd('0x1c')]=qs[_0xb7bd('0x1c')](_0x51daff[_0xb7bd('0x32')][_0xb7bd('0x1c')]);}return _0x2dd560[_0xb7bd('0x5d')](_0xfe0919);}})[_0xb7bd('0x27')](function(_0x2f9bb0){if(_0x2f9bb0){return _0x2f9bb0?{'count':_0x3e8de5,'rows':_0x2f9bb0}:null;}})['then'](respondWithResult(_0x36ddce,null))[_0xb7bd('0x44')](handleError(_0x36ddce,null));};exports[_0xb7bd('0x5e')]=function(_0x4d777c,_0x493c27,_0x127afb){if(_0x4d777c[_0xb7bd('0x4a')]['id']){delete _0x4d777c[_0xb7bd('0x4a')]['id'];}return db['Trigger'][_0xb7bd('0x48')]({'where':{'id':_0x4d777c[_0xb7bd('0x46')]['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0x493c27,null))[_0xb7bd('0x27')](function(_0xcef060){if(_0xcef060){_0x4d777c[_0xb7bd('0x4a')][_0xb7bd('0x5f')]=_0xcef060['id'];return db[_0xb7bd('0x60')][_0xb7bd('0x49')](_0x4d777c[_0xb7bd('0x4a')]);}})[_0xb7bd('0x27')](respondWithResult(_0x493c27,null))[_0xb7bd('0x44')](handleError(_0x493c27,null));};exports['getActions']=function(_0x1b43d8,_0xc5a0fc,_0x105d8a){var _0x580dee={};var _0x3aa137={};var _0x2891a4;var _0xd4bc73;return db['Trigger'][_0xb7bd('0x58')]({'where':{'id':_0x1b43d8['params']['id']}})[_0xb7bd('0x27')](handleEntityNotFound(_0xc5a0fc,null))[_0xb7bd('0x27')](function(_0x22cbec){if(_0x22cbec){_0x2891a4=_0x22cbec;_0x3aa137['model']=_[_0xb7bd('0x33')](db[_0xb7bd('0x60')][_0xb7bd('0x2f')]);_0x3aa137[_0xb7bd('0x32')]=_[_0xb7bd('0x33')](_0x1b43d8[_0xb7bd('0x32')]);_0x3aa137[_0xb7bd('0x34')]=_[_0xb7bd('0x35')](_0x3aa137['model'],_0x3aa137[_0xb7bd('0x32')]);_0x580dee[_0xb7bd('0x37')]=_[_0xb7bd('0x35')](_0x3aa137[_0xb7bd('0x36')],qs['fields'](_0x1b43d8[_0xb7bd('0x32')]['fields']));_0x580dee[_0xb7bd('0x37')]=_0x580dee[_0xb7bd('0x37')][_0xb7bd('0x39')]?_0x580dee[_0xb7bd('0x37')]:_0x3aa137[_0xb7bd('0x36')];_0x580dee[_0xb7bd('0x5b')]=qs[_0xb7bd('0x3b')](_0x1b43d8[_0xb7bd('0x32')]['sort']);_0x580dee[_0xb7bd('0x3c')]=qs[_0xb7bd('0x34')](_['pick'](_0x1b43d8[_0xb7bd('0x32')],_0x3aa137[_0xb7bd('0x34')]));if(_0x1b43d8[_0xb7bd('0x32')][_0xb7bd('0x5a')]){_0x580dee['where']=_[_0xb7bd('0x3f')](_0x580dee['where'],{'$or':_[_0xb7bd('0x2e')](_0x580dee[_0xb7bd('0x37')],function(_0x5c5227){var _0x2a5b1e={};_0x2a5b1e[_0x5c5227]={'$like':'%'+_0x1b43d8[_0xb7bd('0x32')][_0xb7bd('0x5a')]+'%'};return _0x2a5b1e;})});}_0x580dee=_[_0xb7bd('0x3f')]({},_0x580dee,_0x1b43d8['options']);return _0x2891a4[_0xb7bd('0x61')](_0x580dee);}})['then'](function(_0x9b22fb){if(_0x9b22fb){_0xd4bc73=_0x9b22fb['length'];if(!_0x1b43d8[_0xb7bd('0x32')][_0xb7bd('0x5c')](_0xb7bd('0x3a'))){_0x580dee[_0xb7bd('0x1e')]=qs[_0xb7bd('0x1e')](_0x1b43d8[_0xb7bd('0x32')]['limit']);_0x580dee[_0xb7bd('0x1c')]=qs[_0xb7bd('0x1c')](_0x1b43d8['query']['offset']);}return _0x2891a4[_0xb7bd('0x61')](_0x580dee);}})[_0xb7bd('0x27')](function(_0x295604){if(_0x295604){return _0x295604?{'count':_0xd4bc73,'rows':_0x295604}:null;}})['then'](respondWithResult(_0xc5a0fc,null))[_0xb7bd('0x44')](handleError(_0xc5a0fc,null));};
\ No newline at end of file
index 44f4e5b..6644acd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1928=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0x1928,0x138));var _0x8192=function(_0x486321,_0x124fda){_0x486321=_0x486321-0x0;var _0x32c0aa=_0x1928[_0x486321];return _0x32c0aa;};'use strict';var _=require(_0x8192('0x0'));var util=require(_0x8192('0x1'));var logger=require(_0x8192('0x2'))('api');var moment=require(_0x8192('0x3'));var BPromise=require(_0x8192('0x4'));var rp=require(_0x8192('0x5'));var fs=require('fs');var path=require(_0x8192('0x6'));var rimraf=require(_0x8192('0x7'));var config=require(_0x8192('0x8'));var attributes=require(_0x8192('0x9'));module[_0x8192('0xa')]=function(_0x426163,_0x25f90e){return _0x426163[_0x8192('0xb')](_0x8192('0xc'),attributes,{'tableName':_0x8192('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb18e=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','tools_triggers','../../config/logger','moment'];(function(_0x548ae0,_0x1a3722){var _0x582fad=function(_0x495eae){while(--_0x495eae){_0x548ae0['push'](_0x548ae0['shift']());}};_0x582fad(++_0x1a3722);}(_0xb18e,0x181));var _0xeb18=function(_0x56b138,_0x2396d6){_0x56b138=_0x56b138-0x0;var _0x3df878=_0xb18e[_0x56b138];return _0x3df878;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeb18('0x0'))('api');var moment=require(_0xeb18('0x1'));var BPromise=require('bluebird');var rp=require(_0xeb18('0x2'));var fs=require('fs');var path=require(_0xeb18('0x3'));var rimraf=require('rimraf');var config=require(_0xeb18('0x4'));var attributes=require(_0xeb18('0x5'));module[_0xeb18('0x6')]=function(_0x409efb,_0x46d281){return _0x409efb[_0xeb18('0x7')]('Trigger',attributes,{'tableName':_0xeb18('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 84aea49..6c78e84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2fc=['include','map','model','attributes','ShowTrigger','Trigger','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','options','raw','where'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xf2fc,0x15c));var _0xcf2f=function(_0x413b37,_0x171b29){_0x413b37=_0x413b37-0x0;var _0x515881=_0xf2fc[_0x413b37];return _0x515881;};'use strict';var _=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var moment=require(_0xcf2f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf2f('0x3'));var db=require(_0xcf2f('0x4'))['db'];var utils=require(_0xcf2f('0x5'));var logger=require(_0xcf2f('0x6'))('rpc');var config=require(_0xcf2f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x397e0b,_0xcc0d4b,_0x532280){return new BPromise(function(_0x2d0ece,_0x30b5bf){return client[_0xcf2f('0x8')](_0x397e0b,_0x532280)[_0xcf2f('0x9')](function(_0x31b198){logger[_0xcf2f('0xa')]('Trigger,\x20%s,\x20%s',_0xcc0d4b,_0xcf2f('0xb'));logger[_0xcf2f('0xc')](_0xcf2f('0xd'),_0xcc0d4b,_0xcf2f('0xb'),JSON[_0xcf2f('0xe')](_0x31b198));if(_0x31b198[_0xcf2f('0xf')]){if(_0x31b198[_0xcf2f('0xf')]['code']===0x1f4){logger[_0xcf2f('0xf')](_0xcf2f('0x10'),_0xcc0d4b,_0x31b198['error']['message']);return _0x30b5bf(_0x31b198[_0xcf2f('0xf')][_0xcf2f('0x11')]);}logger['error'](_0xcf2f('0x10'),_0xcc0d4b,_0x31b198['error'][_0xcf2f('0x11')]);return _0x2d0ece(_0x31b198[_0xcf2f('0xf')][_0xcf2f('0x11')]);}else{logger[_0xcf2f('0xa')](_0xcf2f('0x10'),_0xcc0d4b,_0xcf2f('0xb'));_0x2d0ece(_0x31b198[_0xcf2f('0x12')]['message']);}})[_0xcf2f('0x13')](function(_0x813e6d){logger[_0xcf2f('0xf')](_0xcf2f('0x10'),_0xcc0d4b,_0x813e6d);_0x30b5bf(_0x813e6d);});});}exports[_0xcf2f('0x14')]=function(_0x3d5728){var _0x25778c=this;return new Promise(function(_0x5f4d13,_0x4f824a){return db['Trigger']['findAll']({'raw':_0x3d5728[_0xcf2f('0x15')]?_0x3d5728[_0xcf2f('0x15')][_0xcf2f('0x16')]===undefined?!![]:![]:!![],'where':_0x3d5728[_0xcf2f('0x15')]?_0x3d5728[_0xcf2f('0x15')][_0xcf2f('0x17')]||null:null,'attributes':_0x3d5728[_0xcf2f('0x15')]?_0x3d5728['options']['attributes']||null:null,'limit':_0x3d5728['options']?_0x3d5728[_0xcf2f('0x15')]['limit']||null:null,'include':_0x3d5728[_0xcf2f('0x15')]?_0x3d5728[_0xcf2f('0x15')][_0xcf2f('0x18')]?_[_0xcf2f('0x19')](_0x3d5728['options'][_0xcf2f('0x18')],function(_0x16c273){return{'model':db[_0x16c273[_0xcf2f('0x1a')]],'as':_0x16c273['as'],'attributes':_0x16c273[_0xcf2f('0x1b')],'include':_0x16c273[_0xcf2f('0x18')]?_['map'](_0x16c273[_0xcf2f('0x18')],function(_0x689e8f){return{'model':db[_0x689e8f[_0xcf2f('0x1a')]],'as':_0x689e8f['as'],'attributes':_0x689e8f[_0xcf2f('0x1b')],'include':_0x689e8f['include']?_['map'](_0x689e8f[_0xcf2f('0x18')],function(_0x403519){return{'model':db[_0x403519[_0xcf2f('0x1a')]],'as':_0x403519['as'],'attributes':_0x403519[_0xcf2f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf2f('0x9')](function(_0x1be1e2){logger[_0xcf2f('0xa')]('GetTrigger',_0x3d5728);logger[_0xcf2f('0xc')](_0xcf2f('0x14'),_0x3d5728,JSON['stringify'](_0x1be1e2));_0x5f4d13(_0x1be1e2);})['catch'](function(_0x5ca900){logger[_0xcf2f('0xf')](_0xcf2f('0x14'),_0x5ca900[_0xcf2f('0x11')],_0x3d5728);_0x4f824a(_0x25778c[_0xcf2f('0xf')](0x1f4,_0x5ca900[_0xcf2f('0x11')]));});});};exports[_0xcf2f('0x1c')]=function(_0x1d5719){var _0x33edae=this;return new Promise(function(_0x12c541,_0x43cc32){return db[_0xcf2f('0x1d')][_0xcf2f('0x1e')]({'raw':_0x1d5719['options']?_0x1d5719[_0xcf2f('0x15')][_0xcf2f('0x16')]===undefined?!![]:![]:!![],'where':_0x1d5719[_0xcf2f('0x15')]?_0x1d5719[_0xcf2f('0x15')][_0xcf2f('0x17')]||null:null,'attributes':_0x1d5719[_0xcf2f('0x15')]?_0x1d5719[_0xcf2f('0x15')][_0xcf2f('0x1b')]||null:null,'include':_0x1d5719['options']?_0x1d5719[_0xcf2f('0x15')][_0xcf2f('0x18')]?_[_0xcf2f('0x19')](_0x1d5719['options']['include'],function(_0x1e301f){return{'model':db[_0x1e301f[_0xcf2f('0x1a')]],'as':_0x1e301f['as'],'attributes':_0x1e301f[_0xcf2f('0x1b')],'include':_0x1e301f['include']?_[_0xcf2f('0x19')](_0x1e301f[_0xcf2f('0x18')],function(_0x3617f3){return{'model':db[_0x3617f3[_0xcf2f('0x1a')]],'as':_0x3617f3['as'],'attributes':_0x3617f3[_0xcf2f('0x1b')],'include':_0x3617f3[_0xcf2f('0x18')]?_[_0xcf2f('0x19')](_0x3617f3['include'],function(_0x1c0ffc){return{'model':db[_0x1c0ffc['model']],'as':_0x1c0ffc['as'],'attributes':_0x1c0ffc[_0xcf2f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf2f('0x9')](function(_0x23e4af){logger[_0xcf2f('0xa')](_0xcf2f('0x1c'),_0x1d5719);logger[_0xcf2f('0xc')]('ShowTrigger',_0x1d5719,JSON[_0xcf2f('0xe')](_0x23e4af));_0x12c541(_0x23e4af);})[_0xcf2f('0x13')](function(_0x2c7112){logger[_0xcf2f('0xf')](_0xcf2f('0x1c'),_0x2c7112[_0xcf2f('0x11')],_0x1d5719);_0x43cc32(_0x33edae[_0xcf2f('0xf')](0x1f4,_0x2c7112[_0xcf2f('0x11')]));});});};
\ No newline at end of file
+var _0x709a=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','Trigger','find','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x709a,0x83));var _0xa709=function(_0x231a5c,_0x2e0ef0){_0x231a5c=_0x231a5c-0x0;var _0xa476c6=_0x709a[_0x231a5c];return _0xa476c6;};'use strict';var _=require(_0xa709('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa709('0x1'));var rs=require(_0xa709('0x2'));var fs=require('fs');var Redis=require(_0xa709('0x3'));var db=require(_0xa709('0x4'))['db'];var utils=require(_0xa709('0x5'));var logger=require(_0xa709('0x6'))(_0xa709('0x7'));var config=require(_0xa709('0x8'));var jayson=require(_0xa709('0x9'));var client=jayson[_0xa709('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd5c9,_0x3f7526,_0xb2eccc){return new BPromise(function(_0x6e35b0,_0x38dea3){return client[_0xa709('0xb')](_0x5cd5c9,_0xb2eccc)['then'](function(_0xce705e){logger[_0xa709('0xc')]('Trigger,\x20%s,\x20%s',_0x3f7526,_0xa709('0xd'));logger[_0xa709('0xe')](_0xa709('0xf'),_0x3f7526,_0xa709('0xd'),JSON[_0xa709('0x10')](_0xce705e));if(_0xce705e[_0xa709('0x11')]){if(_0xce705e[_0xa709('0x11')][_0xa709('0x12')]===0x1f4){logger[_0xa709('0x11')](_0xa709('0x13'),_0x3f7526,_0xce705e[_0xa709('0x11')]['message']);return _0x38dea3(_0xce705e[_0xa709('0x11')][_0xa709('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x3f7526,_0xce705e['error'][_0xa709('0x14')]);return _0x6e35b0(_0xce705e['error'][_0xa709('0x14')]);}else{logger[_0xa709('0xc')]('Trigger,\x20%s,\x20%s',_0x3f7526,_0xa709('0xd'));_0x6e35b0(_0xce705e['result']['message']);}})[_0xa709('0x15')](function(_0x2b7cd3){logger[_0xa709('0x11')](_0xa709('0x13'),_0x3f7526,_0x2b7cd3);_0x38dea3(_0x2b7cd3);});});}exports['GetTrigger']=function(_0xfa50a7){var _0x21df1d=this;return new Promise(function(_0x12c8cc,_0x276111){return db['Trigger'][_0xa709('0x16')]({'raw':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7['options'][_0xa709('0x18')]===undefined?!![]:![]:!![],'where':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7[_0xa709('0x17')][_0xa709('0x19')]||null:null,'attributes':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7[_0xa709('0x17')][_0xa709('0x1a')]||null:null,'limit':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7['options'][_0xa709('0x1b')]||null:null,'include':_0xfa50a7[_0xa709('0x17')]?_0xfa50a7[_0xa709('0x17')][_0xa709('0x1c')]?_[_0xa709('0x1d')](_0xfa50a7['options'][_0xa709('0x1c')],function(_0x50902e){return{'model':db[_0x50902e[_0xa709('0x1e')]],'as':_0x50902e['as'],'attributes':_0x50902e[_0xa709('0x1a')],'include':_0x50902e[_0xa709('0x1c')]?_['map'](_0x50902e[_0xa709('0x1c')],function(_0x527a45){return{'model':db[_0x527a45[_0xa709('0x1e')]],'as':_0x527a45['as'],'attributes':_0x527a45[_0xa709('0x1a')],'include':_0x527a45[_0xa709('0x1c')]?_[_0xa709('0x1d')](_0x527a45['include'],function(_0xe6067f){return{'model':db[_0xe6067f['model']],'as':_0xe6067f['as'],'attributes':_0xe6067f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33ed97){logger[_0xa709('0xc')](_0xa709('0x1f'),_0xfa50a7);logger[_0xa709('0xe')]('GetTrigger',_0xfa50a7,JSON[_0xa709('0x10')](_0x33ed97));_0x12c8cc(_0x33ed97);})[_0xa709('0x15')](function(_0x4b0519){logger[_0xa709('0x11')](_0xa709('0x1f'),_0x4b0519[_0xa709('0x14')],_0xfa50a7);_0x276111(_0x21df1d[_0xa709('0x11')](0x1f4,_0x4b0519[_0xa709('0x14')]));});});};exports[_0xa709('0x20')]=function(_0x558eb8){var _0x469088=this;return new Promise(function(_0x2d4fc6,_0x28e7f1){return db[_0xa709('0x21')][_0xa709('0x22')]({'raw':_0x558eb8[_0xa709('0x17')]?_0x558eb8[_0xa709('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x558eb8[_0xa709('0x17')]?_0x558eb8[_0xa709('0x17')][_0xa709('0x19')]||null:null,'attributes':_0x558eb8[_0xa709('0x17')]?_0x558eb8[_0xa709('0x17')]['attributes']||null:null,'include':_0x558eb8['options']?_0x558eb8['options'][_0xa709('0x1c')]?_[_0xa709('0x1d')](_0x558eb8['options']['include'],function(_0x27210a){return{'model':db[_0x27210a[_0xa709('0x1e')]],'as':_0x27210a['as'],'attributes':_0x27210a[_0xa709('0x1a')],'include':_0x27210a[_0xa709('0x1c')]?_[_0xa709('0x1d')](_0x27210a[_0xa709('0x1c')],function(_0xf9c75b){return{'model':db[_0xf9c75b['model']],'as':_0xf9c75b['as'],'attributes':_0xf9c75b[_0xa709('0x1a')],'include':_0xf9c75b[_0xa709('0x1c')]?_[_0xa709('0x1d')](_0xf9c75b[_0xa709('0x1c')],function(_0x157bf8){return{'model':db[_0x157bf8['model']],'as':_0x157bf8['as'],'attributes':_0x157bf8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa709('0x23')](function(_0x4c3d5c){logger['info']('ShowTrigger',_0x558eb8);logger[_0xa709('0xe')](_0xa709('0x20'),_0x558eb8,JSON['stringify'](_0x4c3d5c));_0x2d4fc6(_0x4c3d5c);})['catch'](function(_0x316f55){logger[_0xa709('0x11')](_0xa709('0x20'),_0x316f55[_0xa709('0x14')],_0x558eb8);_0x28e7f1(_0x469088[_0xa709('0x11')](0x1f4,_0x316f55[_0xa709('0x14')]));});});};
\ No newline at end of file
index 70b3c47..4388ec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a9c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','post','/:id/clone','clone','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x73029b,_0x3df32d){var _0x4ef368=function(_0x106423){while(--_0x106423){_0x73029b['push'](_0x73029b['shift']());}};_0x4ef368(++_0x3df32d);}(_0x3a9c,0x103));var _0xc3a9=function(_0x3158f5,_0x147440){_0x3158f5=_0x3158f5-0x0;var _0x3e23c0=_0x3a9c[_0x3158f5];return _0x3e23c0;};'use strict';var multer=require(_0xc3a9('0x0'));var util=require(_0xc3a9('0x1'));var path=require(_0xc3a9('0x2'));var timeout=require(_0xc3a9('0x3'));var express=require(_0xc3a9('0x4'));var router=express[_0xc3a9('0x5')]();var fs_extra=require(_0xc3a9('0x6'));var auth=require(_0xc3a9('0x7'));var interaction=require(_0xc3a9('0x8'));var config=require(_0xc3a9('0x9'));var controller=require(_0xc3a9('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xc3a9('0xb')]);router[_0xc3a9('0xc')](_0xc3a9('0xd'),auth[_0xc3a9('0xe')](),controller[_0xc3a9('0xf')]);router[_0xc3a9('0x10')](_0xc3a9('0x11'),auth[_0xc3a9('0xe')](),controller[_0xc3a9('0x12')]);router[_0xc3a9('0x10')]('/',auth['isAuthenticated'](),controller[_0xc3a9('0x13')]);router[_0xc3a9('0x14')](_0xc3a9('0xd'),auth[_0xc3a9('0xe')](),controller['update']);router[_0xc3a9('0x15')](_0xc3a9('0xd'),auth['isAuthenticated'](),controller[_0xc3a9('0x16')]);module[_0xc3a9('0x17')]=router;
\ No newline at end of file
+var _0xecd0=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','post','/:id/clone','create'];(function(_0x5eaa17,_0x363a94){var _0x54fd9a=function(_0x34f9a2){while(--_0x34f9a2){_0x5eaa17['push'](_0x5eaa17['shift']());}};_0x54fd9a(++_0x363a94);}(_0xecd0,0x67));var _0x0ecd=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0xecd0[_0x3f8759];return _0x2d33ca;};'use strict';var multer=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var path=require(_0x0ecd('0x2'));var timeout=require(_0x0ecd('0x3'));var express=require(_0x0ecd('0x4'));var router=express[_0x0ecd('0x5')]();var fs_extra=require(_0x0ecd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var controller=require(_0x0ecd('0x9'));router[_0x0ecd('0xa')]('/',auth[_0x0ecd('0xb')](),controller[_0x0ecd('0xc')]);router[_0x0ecd('0xa')](_0x0ecd('0xd'),auth[_0x0ecd('0xb')](),controller['show']);router[_0x0ecd('0xe')](_0x0ecd('0xf'),auth[_0x0ecd('0xb')](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller[_0x0ecd('0x10')]);router['put'](_0x0ecd('0xd'),auth[_0x0ecd('0xb')](),controller[_0x0ecd('0x11')]);router[_0x0ecd('0x12')](_0x0ecd('0xd'),auth[_0x0ecd('0xb')](),controller[_0x0ecd('0x13')]);module['exports']=router;
\ No newline at end of file
index e312a78..b4d0c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8e5=['friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','update,nonat','sequelize','STRING','ENUM'];(function(_0x26e853,_0x436079){var _0x2101de=function(_0x6198ea){while(--_0x6198ea){_0x26e853['push'](_0x26e853['shift']());}};_0x2101de(++_0x436079);}(_0xd8e5,0x170));var _0x5d8e=function(_0xffd831,_0x37202f){_0xffd831=_0xffd831-0x0;var _0x6ada63=_0xd8e5[_0xffd831];return _0x6ada63;};'use strict';var Sequelize=require(_0x5d8e('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d8e('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x3'),_0x5d8e('0x4'),'peer'),'allowNull':![],'defaultValue':_0x5d8e('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5d8e('0x5')},'callingpres':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x6'),_0x5d8e('0x7'),'ALLOWED_FAILED_SCREEN',_0x5d8e('0x8'),_0x5d8e('0x9'),_0x5d8e('0xa'),'PROHIB_FAILED_SCREEN',_0x5d8e('0xb'))},'deny':{'type':Sequelize[_0x5d8e('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x5d8e('0x1')]},'md5secret':{'type':Sequelize[_0x5d8e('0x1')]},'remotesecret':{'type':Sequelize[_0x5d8e('0x1')]},'transport':{'type':Sequelize[_0x5d8e('0x1')],'defaultValue':_0x5d8e('0xc'),'set':function(_0x122582){this[_0x5d8e('0xd')]('transport',_0x122582?_0x122582[_0x5d8e('0xe')](','):null);},'get':function(){return this[_0x5d8e('0xf')](_0x5d8e('0x10'))?this[_0x5d8e('0xf')](_0x5d8e('0x10'))['split'](','):null;},'comment':_0x5d8e('0x11')},'dtmfmode':{'type':Sequelize['ENUM'](_0x5d8e('0x12'),_0x5d8e('0x13'),_0x5d8e('0x14'),_0x5d8e('0x15'),_0x5d8e('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no',_0x5d8e('0x18'),_0x5d8e('0x19'),_0x5d8e('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x5d8e('0x1')]},'nat':{'type':Sequelize[_0x5d8e('0x1')],'defaultValue':_0x5d8e('0x1b'),'set':function(_0x26313d){this[_0x5d8e('0xd')](_0x5d8e('0x1c'),_0x26313d?_0x26313d['join'](','):null);},'get':function(){return this[_0x5d8e('0xf')]('nat')?this[_0x5d8e('0xf')](_0x5d8e('0x1c'))[_0x5d8e('0x1d')](','):null;},'comment':_0x5d8e('0x1e')},'callgroup':{'type':Sequelize[_0x5d8e('0x1')]},'namedcallgroup':{'type':Sequelize[_0x5d8e('0x1')]},'pickupgroup':{'type':Sequelize[_0x5d8e('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x5d8e('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5d8e('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5d8e('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x5d8e('0x1')],'allowNull':![],'defaultValue':_0x5d8e('0x1f'),'set':function(_0x3111f7){this['setDataValue'](_0x5d8e('0x20'),_0x3111f7?_0x3111f7[_0x5d8e('0xe')](';'):_0x5d8e('0x1f'));},'get':function(){return this['getDataValue'](_0x5d8e('0x20'))?this[_0x5d8e('0xf')](_0x5d8e('0x20'))[_0x5d8e('0x1d')](';'):null;},'comment':_0x5d8e('0x21')},'autoframing':{'type':Sequelize[_0x5d8e('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0x5d8e('0x1')],'defaultValue':_0x5d8e('0x22'),'set':function(_0x5d8593){this[_0x5d8e('0xd')](_0x5d8e('0x23'),_0x5d8593?_0x5d8593[_0x5d8e('0xe')](','):null);},'get':function(){return this[_0x5d8e('0xf')](_0x5d8e('0x23'))?this[_0x5d8e('0xf')](_0x5d8e('0x23'))[_0x5d8e('0x1d')](','):null;},'comment':_0x5d8e('0x24')},'trustrpid':{'type':Sequelize['ENUM'](_0x5d8e('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x5d8e('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x5d8e('0x17'),'no',_0x5d8e('0x25'))},'promiscredir':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x5d8e('0x17'),'no')},'accountcode':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'setvar':{'type':Sequelize[_0x5d8e('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x5d8e('0x27')},'amaflags':{'type':Sequelize[_0x5d8e('0x1')]},'callcounter':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no'),'defaultValue':_0x5d8e('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x5d8e('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x5d8e('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x5d8e('0x1')]},'template':{'type':Sequelize[_0x5d8e('0x1')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x5d8e('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5d8e('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x5d8e('0x1')]},'session_timers':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x29'),_0x5d8e('0x2a'),_0x5d8e('0x2b'))},'session_expires':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x2c'),_0x5d8e('0x2d')),'defaultValue':_0x5d8e('0x2d')},'t38pt_usertpsource':{'type':Sequelize[_0x5d8e('0x1')]},'regexten':{'type':Sequelize[_0x5d8e('0x1')]},'fromdomain':{'type':Sequelize[_0x5d8e('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5d8e('0x17')},'keepalive':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x5d8e('0x1')]},'rtptimeout':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no',_0x5d8e('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x5d8e('0x1')]},'timert1':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'timerb':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x5d8e('0x1')]},'contactdeny':{'type':Sequelize[_0x5d8e('0x1')]},'contactacl':{'type':Sequelize[_0x5d8e('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x5d8e('0x1')]},'use_q850_reason':{'type':Sequelize[_0x5d8e('0x1')]},'maxforwards':{'type':Sequelize[_0x5d8e('0x26')](0xb)},'encryption':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5d8e('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x5d8e('0x17'),'no')},'icesupport':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no',_0x5d8e('0x2f'),_0x5d8e('0x30'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x5d8e('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x5d8e('0x1')]},'dtlscapath':{'type':Sequelize[_0x5d8e('0x1')]},'dtlssetup':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x31'),_0x5d8e('0x32'),_0x5d8e('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5d8e('0x1')]},'usereqphone':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x5d8e('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x5d8e('0x2')](_0x5d8e('0x17'),'no')},'vmexten':{'type':Sequelize[_0x5d8e('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x5d8e('0x1')]},'parkinglot':{'type':Sequelize[_0x5d8e('0x1')]},'description':{'type':Sequelize[_0x5d8e('0x1')]},'host':{'type':Sequelize[_0x5d8e('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x5d8e('0x2')]('yes','no','nonat',_0x5d8e('0x19'),_0x5d8e('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5d8e('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x5d8e('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xa36c=['never','INTEGER','always','refuse','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','user','peer','friend','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','getDataValue','info','shortinfo','inband','auto','rfc2833','update','outgoing','yes','force_rport,comedia','setDataValue','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0x41b60a,_0x35f35b){var _0x18968f=function(_0x40f721){while(--_0x40f721){_0x41b60a['push'](_0x41b60a['shift']());}};_0x18968f(++_0x35f35b);}(_0xa36c,0x74));var _0xca36=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa36c[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xca36('0x0'));module[_0xca36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xca36('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xca36('0x3')]('friend',_0xca36('0x4'),_0xca36('0x5')),'allowNull':![],'defaultValue':_0xca36('0x6')},'context':{'type':Sequelize[_0xca36('0x7')],'allowNull':![],'defaultValue':_0xca36('0x8')},'callingpres':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x9'),_0xca36('0xa'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0xca36('0xb'),_0xca36('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0xca36('0x7')]},'permit':{'type':Sequelize[_0xca36('0x7')]},'secret':{'type':Sequelize[_0xca36('0x7')]},'md5secret':{'type':Sequelize[_0xca36('0x7')]},'remotesecret':{'type':Sequelize[_0xca36('0x7')]},'transport':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'udp','set':function(_0x573fdd){this['setDataValue'](_0xca36('0xd'),_0x573fdd?_0x573fdd['join'](','):null);},'get':function(){return this[_0xca36('0xe')](_0xca36('0xd'))?this[_0xca36('0xe')](_0xca36('0xd'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xca36('0xf'),_0xca36('0x10'),_0xca36('0x11'),_0xca36('0x12')),'defaultValue':_0xca36('0x13')},'directmedia':{'type':Sequelize[_0xca36('0x3')]('yes','no','nonat',_0xca36('0x14'),_0xca36('0x15')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xca36('0x7')],'defaultValue':_0xca36('0x17'),'set':function(_0x1301db){this[_0xca36('0x18')]('nat',_0x1301db?_0x1301db[_0xca36('0x19')](','):null);},'get':function(){return this['getDataValue'](_0xca36('0x1a'))?this[_0xca36('0xe')]('nat')['split'](','):null;},'comment':_0xca36('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xca36('0x7')]},'pickupgroup':{'type':Sequelize[_0xca36('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xca36('0x7')]},'language':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xca36('0x7')],'defaultValue':_0xca36('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xd2accb){this[_0xca36('0x18')](_0xca36('0x1d'),_0xd2accb?_0xd2accb[_0xca36('0x19')](';'):_0xca36('0x1e'));},'get':function(){return this[_0xca36('0xe')](_0xca36('0x1d'))?this[_0xca36('0xe')]('allow')[_0xca36('0x1f')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'insecure':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'port,invite','set':function(_0x2be4d0){this[_0xca36('0x18')](_0xca36('0x20'),_0x2be4d0?_0x2be4d0['join'](','):null);},'get':function(){return this['getDataValue'](_0xca36('0x20'))?this[_0xca36('0xe')](_0xca36('0x20'))['split'](','):null;},'comment':_0xca36('0x21')},'trustrpid':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no',_0xca36('0x22'))},'promiscredir':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'useclientcode':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'accountcode':{'type':Sequelize[_0xca36('0x23')](0xb)},'setvar':{'type':Sequelize[_0xca36('0x7')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xca36('0x7')]},'callcounter':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no'),'defaultValue':_0xca36('0x16')},'busylevel':{'type':Sequelize[_0xca36('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0xca36('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xca36('0x7')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xca36('0x3')]('yes','no',_0xca36('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no')},'mailbox':{'type':Sequelize[_0xca36('0x7')]},'session_timers':{'type':Sequelize[_0xca36('0x3')]('accept',_0xca36('0x25'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xca36('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xca36('0x26'),_0xca36('0x27')),'defaultValue':_0xca36('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xca36('0x7')]},'regexten':{'type':Sequelize[_0xca36('0x7')]},'fromdomain':{'type':Sequelize[_0xca36('0x7')]},'fromuser':{'type':Sequelize[_0xca36('0x7')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xca36('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xca36('0x7')]},'defaultuser':{'type':Sequelize[_0xca36('0x7')]},'rtptimeout':{'type':Sequelize[_0xca36('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xca36('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no',_0xca36('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xca36('0x7')]},'callbackextension':{'type':Sequelize[_0xca36('0x7')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xca36('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xca36('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xca36('0x7')]},'contactdeny':{'type':Sequelize[_0xca36('0x7')]},'contactacl':{'type':Sequelize[_0xca36('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xca36('0x7')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xca36('0x23')](0xb)},'encryption':{'type':Sequelize[_0xca36('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xca36('0x16'),'no')},'force_avp':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'icesupport':{'type':Sequelize[_0xca36('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'dtlsverify':{'type':Sequelize[_0xca36('0x3')]('yes','no',_0xca36('0x29'),_0xca36('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xca36('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xca36('0x7')]},'dtlscipher':{'type':Sequelize[_0xca36('0x7')]},'dtlscafile':{'type':Sequelize[_0xca36('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x2b'),_0xca36('0x2c'),_0xca36('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xca36('0x7')]},'usereqphone':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xca36('0x7')]},'call_limit':{'type':Sequelize[_0xca36('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0xca36('0x7')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xca36('0x7')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xca36('0x2e')},'canreinvite':{'type':Sequelize[_0xca36('0x3')](_0xca36('0x16'),'no',_0xca36('0x2f'),_0xca36('0x14'),_0xca36('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xca36('0x7')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xca36('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xca36('0x7')],'defaultValue':'no'}};
\ No newline at end of file
index 46e624b..ee593e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x17a57d,_0x264371){var _0x406793=function(_0x10148b){while(--_0x10148b){_0x17a57d['push'](_0x17a57d['shift']());}};_0x406793(++_0x264371);}(_0x3e74,0x175));var _0x43e7=function(_0x5248b5,_0x30c055){_0x5248b5=_0x5248b5-0x0;var _0x2498af=_0x3e74[_0x5248b5];return _0x2498af;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));};
\ No newline at end of file
+var _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x4529b3,_0x390ebb){var _0x21e907=function(_0x1c19dc){while(--_0x1c19dc){_0x4529b3['push'](_0x4529b3['shift']());}};_0x21e907(++_0x390ebb);}(_0x9f62,0x154));var _0x29f6=function(_0x440be0,_0x473cce){_0x440be0=_0x440be0-0x0;var _0xf36e2d=_0x9f62[_0x440be0];return _0xf36e2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));};
\ No newline at end of file
index f0cfdd3..ce74032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe63c=['api','moment','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger'];(function(_0x3274fe,_0x314841){var _0x353ffd=function(_0x360561){while(--_0x360561){_0x3274fe['push'](_0x3274fe['shift']());}};_0x353ffd(++_0x314841);}(_0xe63c,0xe2));var _0xce63=function(_0x254842,_0x159c1f){_0x254842=_0x254842-0x0;var _0x364fad=_0xe63c[_0x254842];return _0x364fad;};'use strict';var _=require('lodash');var util=require(_0xce63('0x0'));var logger=require(_0xce63('0x1'))(_0xce63('0x2'));var moment=require(_0xce63('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xce63('0x4'));var rimraf=require(_0xce63('0x5'));var config=require(_0xce63('0x6'));var attributes=require(_0xce63('0x7'));module[_0xce63('0x8')]=function(_0x5baf0c,_0x82b6ef){return _0x5baf0c[_0xce63('0x9')](_0xce63('0xa'),attributes,{'tableName':_0xce63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde35=['Trunk','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define'];(function(_0x393b27,_0xa99d03){var _0x549454=function(_0x1d5449){while(--_0x1d5449){_0x393b27['push'](_0x393b27['shift']());}};_0x549454(++_0xa99d03);}(_0xde35,0xfd));var _0x5de3=function(_0x572480,_0x30876e){_0x572480=_0x572480-0x0;var _0xc2b581=_0xde35[_0x572480];return _0xc2b581;};'use strict';var _=require('lodash');var util=require(_0x5de3('0x0'));var logger=require('../../config/logger')(_0x5de3('0x1'));var moment=require(_0x5de3('0x2'));var BPromise=require(_0x5de3('0x3'));var rp=require(_0x5de3('0x4'));var fs=require('fs');var path=require(_0x5de3('0x5'));var rimraf=require(_0x5de3('0x6'));var config=require(_0x5de3('0x7'));var attributes=require(_0x5de3('0x8'));module[_0x5de3('0x9')]=function(_0x1241e0,_0x1c223f){return _0x1241e0[_0x5de3('0xa')](_0x5de3('0xb'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b7c103d..d3b36ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52db=['attributes','limit','include','model','map','catch','ShowTrunk','find','where','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','GetTrunk','Trunk','options'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x52db,0x73));var _0xb52d=function(_0x2c961d,_0x106e3a){_0x2c961d=_0x2c961d-0x0;var _0xb29a42=_0x52db[_0x2c961d];return _0xb29a42;};'use strict';var _=require('lodash');var util=require(_0xb52d('0x0'));var moment=require(_0xb52d('0x1'));var BPromise=require(_0xb52d('0x2'));var rs=require(_0xb52d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb52d('0x4'))['db'];var utils=require(_0xb52d('0x5'));var logger=require(_0xb52d('0x6'))(_0xb52d('0x7'));var config=require(_0xb52d('0x8'));var jayson=require(_0xb52d('0x9'));var client=jayson[_0xb52d('0xa')][_0xb52d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50b6d4,_0x57da02,_0x4b1736){return new BPromise(function(_0x44c4dc,_0x1507a7){return client['request'](_0x50b6d4,_0x4b1736)[_0xb52d('0xc')](function(_0x29cccb){logger[_0xb52d('0xd')]('Trunk,\x20%s,\x20%s',_0x57da02,'request\x20sent');logger[_0xb52d('0xe')](_0xb52d('0xf'),_0x57da02,_0xb52d('0x10'),JSON['stringify'](_0x29cccb));if(_0x29cccb['error']){if(_0x29cccb[_0xb52d('0x11')][_0xb52d('0x12')]===0x1f4){logger[_0xb52d('0x11')](_0xb52d('0x13'),_0x57da02,_0x29cccb[_0xb52d('0x11')][_0xb52d('0x14')]);return _0x1507a7(_0x29cccb[_0xb52d('0x11')][_0xb52d('0x14')]);}logger[_0xb52d('0x11')]('Trunk,\x20%s,\x20%s',_0x57da02,_0x29cccb['error'][_0xb52d('0x14')]);return _0x44c4dc(_0x29cccb['error'][_0xb52d('0x14')]);}else{logger[_0xb52d('0xd')](_0xb52d('0x13'),_0x57da02,_0xb52d('0x10'));_0x44c4dc(_0x29cccb[_0xb52d('0x15')][_0xb52d('0x14')]);}})['catch'](function(_0x2dad3b){logger[_0xb52d('0x11')](_0xb52d('0x13'),_0x57da02,_0x2dad3b);_0x1507a7(_0x2dad3b);});});}exports[_0xb52d('0x16')]=function(_0x4cf3cb){var _0x39620a=this;return new Promise(function(_0x69d138,_0x182200){return db[_0xb52d('0x17')]['findAll']({'raw':_0x4cf3cb[_0xb52d('0x18')]?_0x4cf3cb[_0xb52d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4cf3cb['options']?_0x4cf3cb[_0xb52d('0x18')]['where']||null:null,'attributes':_0x4cf3cb[_0xb52d('0x18')]?_0x4cf3cb[_0xb52d('0x18')][_0xb52d('0x19')]||null:null,'limit':_0x4cf3cb[_0xb52d('0x18')]?_0x4cf3cb['options'][_0xb52d('0x1a')]||null:null,'include':_0x4cf3cb[_0xb52d('0x18')]?_0x4cf3cb[_0xb52d('0x18')][_0xb52d('0x1b')]?_['map'](_0x4cf3cb[_0xb52d('0x18')][_0xb52d('0x1b')],function(_0x57d16d){return{'model':db[_0x57d16d[_0xb52d('0x1c')]],'as':_0x57d16d['as'],'attributes':_0x57d16d['attributes'],'include':_0x57d16d[_0xb52d('0x1b')]?_[_0xb52d('0x1d')](_0x57d16d[_0xb52d('0x1b')],function(_0x129b9d){return{'model':db[_0x129b9d['model']],'as':_0x129b9d['as'],'attributes':_0x129b9d[_0xb52d('0x19')],'include':_0x129b9d[_0xb52d('0x1b')]?_[_0xb52d('0x1d')](_0x129b9d[_0xb52d('0x1b')],function(_0x11ce8f){return{'model':db[_0x11ce8f['model']],'as':_0x11ce8f['as'],'attributes':_0x11ce8f[_0xb52d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb52d('0xc')](function(_0x44fd1f){logger[_0xb52d('0xd')](_0xb52d('0x16'),_0x4cf3cb);logger['debug'](_0xb52d('0x16'),_0x4cf3cb,JSON['stringify'](_0x44fd1f));_0x69d138(_0x44fd1f);})[_0xb52d('0x1e')](function(_0x92c01b){logger['error'](_0xb52d('0x16'),_0x92c01b[_0xb52d('0x14')],_0x4cf3cb);_0x182200(_0x39620a[_0xb52d('0x11')](0x1f4,_0x92c01b[_0xb52d('0x14')]));});});};exports[_0xb52d('0x1f')]=function(_0xfba2e8){var _0x4c978c=this;return new Promise(function(_0x46e9e8,_0x370abb){return db[_0xb52d('0x17')][_0xb52d('0x20')]({'raw':_0xfba2e8[_0xb52d('0x18')]?_0xfba2e8[_0xb52d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xfba2e8[_0xb52d('0x18')]?_0xfba2e8[_0xb52d('0x18')][_0xb52d('0x21')]||null:null,'attributes':_0xfba2e8[_0xb52d('0x18')]?_0xfba2e8[_0xb52d('0x18')]['attributes']||null:null,'include':_0xfba2e8[_0xb52d('0x18')]?_0xfba2e8[_0xb52d('0x18')][_0xb52d('0x1b')]?_[_0xb52d('0x1d')](_0xfba2e8[_0xb52d('0x18')][_0xb52d('0x1b')],function(_0x30566f){return{'model':db[_0x30566f[_0xb52d('0x1c')]],'as':_0x30566f['as'],'attributes':_0x30566f[_0xb52d('0x19')],'include':_0x30566f[_0xb52d('0x1b')]?_['map'](_0x30566f[_0xb52d('0x1b')],function(_0xb940ec){return{'model':db[_0xb940ec[_0xb52d('0x1c')]],'as':_0xb940ec['as'],'attributes':_0xb940ec[_0xb52d('0x19')],'include':_0xb940ec[_0xb52d('0x1b')]?_[_0xb52d('0x1d')](_0xb940ec[_0xb52d('0x1b')],function(_0x4cb3b0){return{'model':db[_0x4cb3b0[_0xb52d('0x1c')]],'as':_0x4cb3b0['as'],'attributes':_0x4cb3b0[_0xb52d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb52d('0xc')](function(_0x8659ce){logger[_0xb52d('0xd')](_0xb52d('0x1f'),_0xfba2e8);logger[_0xb52d('0xe')]('ShowTrunk',_0xfba2e8,JSON[_0xb52d('0x22')](_0x8659ce));_0x46e9e8(_0x8659ce);})[_0xb52d('0x1e')](function(_0x555474){logger[_0xb52d('0x11')](_0xb52d('0x1f'),_0x555474[_0xb52d('0x14')],_0xfba2e8);_0x370abb(_0x4c978c['error'](0x1f4,_0x555474[_0xb52d('0x14')]));});});};
\ No newline at end of file
+var _0xc7ee=['options','where','attributes','include','model','map','GetTrunk','ShowTrunk','raw','lodash','moment','ioredis','../../config/environment','jayson/promise','client','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','Trunk','findAll'];(function(_0x2d3882,_0x3a4f85){var _0x3b51ad=function(_0x49409f){while(--_0x49409f){_0x2d3882['push'](_0x2d3882['shift']());}};_0x3b51ad(++_0x3a4f85);}(_0xc7ee,0xd4));var _0xec7e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc7ee[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xec7e('0x0'));var util=require('util');var moment=require(_0xec7e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec7e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xec7e('0x3'));var jayson=require(_0xec7e('0x4'));var client=jayson[_0xec7e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x438438,_0x1600f8,_0x26bd6b){return new BPromise(function(_0x25b41c,_0x4875b1){return client[_0xec7e('0x6')](_0x438438,_0x26bd6b)[_0xec7e('0x7')](function(_0x476208){logger['info'](_0xec7e('0x8'),_0x1600f8,_0xec7e('0x9'));logger[_0xec7e('0xa')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1600f8,_0xec7e('0x9'),JSON[_0xec7e('0xb')](_0x476208));if(_0x476208[_0xec7e('0xc')]){if(_0x476208[_0xec7e('0xc')][_0xec7e('0xd')]===0x1f4){logger[_0xec7e('0xc')](_0xec7e('0x8'),_0x1600f8,_0x476208[_0xec7e('0xc')][_0xec7e('0xe')]);return _0x4875b1(_0x476208[_0xec7e('0xc')][_0xec7e('0xe')]);}logger[_0xec7e('0xc')](_0xec7e('0x8'),_0x1600f8,_0x476208[_0xec7e('0xc')][_0xec7e('0xe')]);return _0x25b41c(_0x476208['error'][_0xec7e('0xe')]);}else{logger[_0xec7e('0xf')]('Trunk,\x20%s,\x20%s',_0x1600f8,_0xec7e('0x9'));_0x25b41c(_0x476208[_0xec7e('0x10')]['message']);}})[_0xec7e('0x11')](function(_0x203c5d){logger['error'](_0xec7e('0x8'),_0x1600f8,_0x203c5d);_0x4875b1(_0x203c5d);});});}exports['GetTrunk']=function(_0x2ea28e){var _0x2b6d5d=this;return new Promise(function(_0xf9921e,_0x4c3b8c){return db[_0xec7e('0x12')][_0xec7e('0x13')]({'raw':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')][_0xec7e('0x15')]||null:null,'attributes':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')][_0xec7e('0x16')]||null:null,'limit':_0x2ea28e[_0xec7e('0x14')]?_0x2ea28e[_0xec7e('0x14')]['limit']||null:null,'include':_0x2ea28e['options']?_0x2ea28e[_0xec7e('0x14')][_0xec7e('0x17')]?_['map'](_0x2ea28e['options'][_0xec7e('0x17')],function(_0x152626){return{'model':db[_0x152626[_0xec7e('0x18')]],'as':_0x152626['as'],'attributes':_0x152626['attributes'],'include':_0x152626[_0xec7e('0x17')]?_['map'](_0x152626['include'],function(_0x4678f5){return{'model':db[_0x4678f5['model']],'as':_0x4678f5['as'],'attributes':_0x4678f5[_0xec7e('0x16')],'include':_0x4678f5[_0xec7e('0x17')]?_[_0xec7e('0x19')](_0x4678f5['include'],function(_0x594375){return{'model':db[_0x594375[_0xec7e('0x18')]],'as':_0x594375['as'],'attributes':_0x594375[_0xec7e('0x16')]};}):[]};}):[]};}):[]:[]})[_0xec7e('0x7')](function(_0x4fa912){logger[_0xec7e('0xf')](_0xec7e('0x1a'),_0x2ea28e);logger[_0xec7e('0xa')]('GetTrunk',_0x2ea28e,JSON[_0xec7e('0xb')](_0x4fa912));_0xf9921e(_0x4fa912);})[_0xec7e('0x11')](function(_0x35e966){logger[_0xec7e('0xc')](_0xec7e('0x1a'),_0x35e966[_0xec7e('0xe')],_0x2ea28e);_0x4c3b8c(_0x2b6d5d[_0xec7e('0xc')](0x1f4,_0x35e966[_0xec7e('0xe')]));});});};exports[_0xec7e('0x1b')]=function(_0x4382f9){var _0x1e9aa2=this;return new Promise(function(_0x44feec,_0x9a995d){return db[_0xec7e('0x12')]['find']({'raw':_0x4382f9[_0xec7e('0x14')]?_0x4382f9[_0xec7e('0x14')][_0xec7e('0x1c')]===undefined?!![]:![]:!![],'where':_0x4382f9[_0xec7e('0x14')]?_0x4382f9['options'][_0xec7e('0x15')]||null:null,'attributes':_0x4382f9[_0xec7e('0x14')]?_0x4382f9[_0xec7e('0x14')]['attributes']||null:null,'include':_0x4382f9[_0xec7e('0x14')]?_0x4382f9[_0xec7e('0x14')][_0xec7e('0x17')]?_[_0xec7e('0x19')](_0x4382f9[_0xec7e('0x14')][_0xec7e('0x17')],function(_0x606eee){return{'model':db[_0x606eee[_0xec7e('0x18')]],'as':_0x606eee['as'],'attributes':_0x606eee[_0xec7e('0x16')],'include':_0x606eee[_0xec7e('0x17')]?_[_0xec7e('0x19')](_0x606eee['include'],function(_0x1966b0){return{'model':db[_0x1966b0[_0xec7e('0x18')]],'as':_0x1966b0['as'],'attributes':_0x1966b0[_0xec7e('0x16')],'include':_0x1966b0['include']?_[_0xec7e('0x19')](_0x1966b0[_0xec7e('0x17')],function(_0x4a9b34){return{'model':db[_0x4a9b34[_0xec7e('0x18')]],'as':_0x4a9b34['as'],'attributes':_0x4a9b34[_0xec7e('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa0745e){logger[_0xec7e('0xf')]('ShowTrunk',_0x4382f9);logger['debug']('ShowTrunk',_0x4382f9,JSON[_0xec7e('0xb')](_0xa0745e));_0x44feec(_0xa0745e);})['catch'](function(_0x152266){logger[_0xec7e('0xc')](_0xec7e('0x1b'),_0x152266[_0xec7e('0xe')],_0x4382f9);_0x9a995d(_0x1e9aa2[_0xec7e('0xc')](0x1f4,_0x152266[_0xec7e('0xe')]));});});};
\ No newline at end of file
index da5953f..8db7722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69cf=['/:id/teams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeSquareProjects','removeApiKey','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','/:id/groups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions'];(function(_0x3c4f53,_0x4ed32f){var _0x552e18=function(_0x140119){while(--_0x140119){_0x3c4f53['push'](_0x3c4f53['shift']());}};_0x552e18(++_0x4ed32f);}(_0x69cf,0x1b7));var _0xf69c=function(_0x3d78d7,_0x44acea){_0x3d78d7=_0x3d78d7-0x0;var _0x4b6784=_0x69cf[_0x3d78d7];return _0x4b6784;};'use strict';var multer=require(_0xf69c('0x0'));var util=require(_0xf69c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf69c('0x2'));var router=express[_0xf69c('0x3')]();var fs_extra=require(_0xf69c('0x4'));var auth=require(_0xf69c('0x5'));var interaction=require(_0xf69c('0x6'));var config=require('../../config/environment');var controller=require(_0xf69c('0x7'));router[_0xf69c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf69c('0x9')]);router['get'](_0xf69c('0xa'),auth[_0xf69c('0xb')](),controller[_0xf69c('0xc')]);router[_0xf69c('0x8')](_0xf69c('0xd'),auth['isAuthenticated'](),controller[_0xf69c('0xe')]);router[_0xf69c('0x8')](_0xf69c('0xf'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x10')]);router['get'](_0xf69c('0x11'),auth[_0xf69c('0xb')](),controller['show']);router[_0xf69c('0x8')](_0xf69c('0x12'),controller[_0xf69c('0x13')]);router[_0xf69c('0x8')](_0xf69c('0x14'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x15')]);router[_0xf69c('0x8')](_0xf69c('0x16'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x17')]);router[_0xf69c('0x8')]('/:id/queues',auth[_0xf69c('0xb')](),controller[_0xf69c('0x18')]);router[_0xf69c('0x8')](_0xf69c('0x19'),auth[_0xf69c('0xb')](),controller['getVoiceQueuesRt']);router[_0xf69c('0x8')](_0xf69c('0x1a'),auth[_0xf69c('0xb')](),controller['getGroups']);router[_0xf69c('0x8')]('/:id/recordings',auth[_0xf69c('0xb')](),controller[_0xf69c('0x1b')]);router[_0xf69c('0x8')](_0xf69c('0x1c'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x1d')]);router[_0xf69c('0x8')]('/:id/chat/interactions',auth[_0xf69c('0xb')](),controller[_0xf69c('0x1e')]);router[_0xf69c('0x8')](_0xf69c('0x1f'),auth['isAuthenticated'](),controller[_0xf69c('0x20')]);router[_0xf69c('0x8')](_0xf69c('0x21'),auth['isAuthenticated'](),controller[_0xf69c('0x22')]);router[_0xf69c('0x8')](_0xf69c('0x23'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x24')]);router[_0xf69c('0x8')](_0xf69c('0x25'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x26')]);router[_0xf69c('0x8')](_0xf69c('0x27'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x28')]);router[_0xf69c('0x8')](_0xf69c('0x29'),auth[_0xf69c('0xb')](),controller['getTeams']);router[_0xf69c('0x8')](_0xf69c('0x2a'),auth[_0xf69c('0xb')](),controller['getLists']);router['get'](_0xf69c('0x2b'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0xf69c('0x2c'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x2d')]);router[_0xf69c('0x8')]('/:id/fax_accounts',auth[_0xf69c('0xb')](),controller[_0xf69c('0x2e')]);router['get'](_0xf69c('0x2f'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x30')]);router[_0xf69c('0x8')](_0xf69c('0x31'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x32')]);router[_0xf69c('0x8')]('/:id/sms_accounts',auth[_0xf69c('0xb')](),controller[_0xf69c('0x33')]);router[_0xf69c('0x8')](_0xf69c('0x34'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x35')]);router[_0xf69c('0x8')]('/:id/whatsapp_accounts',auth[_0xf69c('0xb')](),controller[_0xf69c('0x36')]);router[_0xf69c('0x8')](_0xf69c('0x37'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xf69c('0x8')](_0xf69c('0x38'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x39')]);router['get'](_0xf69c('0x3a'),auth['isAuthenticated'](),controller[_0xf69c('0x3b')]);router[_0xf69c('0x3c')](_0xf69c('0x16'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x3d')]);router[_0xf69c('0x3c')]('/',auth[_0xf69c('0xb')](),controller[_0xf69c('0x3e')]);router[_0xf69c('0x3c')]('/create_many',auth[_0xf69c('0xb')](),controller[_0xf69c('0x3f')]);router['post'](_0xf69c('0x40'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x41')]);var upload=multer({'storage':multer[_0xf69c('0x42')]({'destination':function(_0xf5fc72,_0x40cad,_0x1670bf){_0x1670bf(null,path[_0xf69c('0x43')](config[_0xf69c('0x44')],_0xf69c('0x45')));},'filename':function(_0x585e40,_0x2cbed2,_0x4f4469){_0x4f4469(null,util[_0xf69c('0x46')](_0xf69c('0x47'),Date[_0xf69c('0x48')](),_0x2cbed2[_0xf69c('0x49')]));}})});router['post'](_0xf69c('0x12'),upload['single']('file'),controller[_0xf69c('0x4a')]);router[_0xf69c('0x3c')](_0xf69c('0x4b'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x4c')]);router[_0xf69c('0x3c')](_0xf69c('0x4d'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x4e')]);router[_0xf69c('0x3c')](_0xf69c('0x4f'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x50')]);router['post'](_0xf69c('0x51'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x52')]);router[_0xf69c('0x3c')]('/:id/teams',auth[_0xf69c('0xb')](),controller[_0xf69c('0x53')]);router[_0xf69c('0x3c')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router[_0xf69c('0x3c')](_0xf69c('0x54'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x55')]);router[_0xf69c('0x3c')](_0xf69c('0x56'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x57')]);router[_0xf69c('0x3c')](_0xf69c('0x58'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0xf69c('0x3c')]('/:id/openchannel_interactions',auth[_0xf69c('0xb')](),controller[_0xf69c('0x59')]);router['post'](_0xf69c('0x5a'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xf69c('0x3c')](_0xf69c('0x5b'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x5c')]);router[_0xf69c('0x3c')](_0xf69c('0x2f'),auth[_0xf69c('0xb')](),controller['addMailAccounts']);router[_0xf69c('0x3c')](_0xf69c('0x31'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x5d')]);router[_0xf69c('0x3c')](_0xf69c('0x5e'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x5f')]);router[_0xf69c('0x3c')](_0xf69c('0x34'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x60')]);router[_0xf69c('0x3c')]('/:id/whatsapp_accounts',auth[_0xf69c('0xb')](),controller[_0xf69c('0x61')]);router[_0xf69c('0x3c')]('/:id/square_projects',auth[_0xf69c('0xb')](),controller[_0xf69c('0x62')]);router[_0xf69c('0x3c')](_0xf69c('0x3a'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x63')]);router[_0xf69c('0x64')](_0xf69c('0x11'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x65')]);router[_0xf69c('0x64')](_0xf69c('0x66'),auth['isAuthenticated'](),controller[_0xf69c('0x67')]);router[_0xf69c('0x68')](_0xf69c('0x40'),auth[_0xf69c('0xb')](),controller['removeQueues']);router[_0xf69c('0x68')](_0xf69c('0x29'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x69')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xf69c('0x68')](_0xf69c('0x6a'),auth[_0xf69c('0xb')](),controller['removeChatInteractions']);router['delete']('/:id/mail_interactions',auth[_0xf69c('0xb')](),controller[_0xf69c('0x6b')]);router['delete']('/:id/fax_interactions',auth[_0xf69c('0xb')](),controller[_0xf69c('0x6c')]);router[_0xf69c('0x68')]('/:id/sms_interactions',auth[_0xf69c('0xb')](),controller[_0xf69c('0x6d')]);router[_0xf69c('0x68')](_0xf69c('0x6e'),auth[_0xf69c('0xb')](),controller['removeOpenchannelInteractions']);router[_0xf69c('0x68')]('/:id/whatsapp_interactions',auth[_0xf69c('0xb')](),controller[_0xf69c('0x6f')]);router[_0xf69c('0x68')](_0xf69c('0x5b'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x70')]);router[_0xf69c('0x68')]('/:id/mail_accounts',auth[_0xf69c('0xb')](),controller[_0xf69c('0x71')]);router[_0xf69c('0x68')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0xf69c('0x68')]('/:id/sms_accounts',auth[_0xf69c('0xb')](),controller[_0xf69c('0x72')]);router[_0xf69c('0x68')]('/:id/chat_websites',auth[_0xf69c('0xb')](),controller[_0xf69c('0x73')]);router[_0xf69c('0x68')](_0xf69c('0x74'),auth[_0xf69c('0xb')](),controller['removeWhatsappAccounts']);router[_0xf69c('0x68')](_0xf69c('0x37'),auth['isAuthenticated'](),controller[_0xf69c('0x75')]);router[_0xf69c('0x68')](_0xf69c('0x3a'),auth[_0xf69c('0xb')](),controller[_0xf69c('0x76')]);module[_0xf69c('0x77')]=router;
\ No newline at end of file
+var _0x4fb7=['/:id/api_key','removeApiKey','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','index','/describe','describe','/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/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','bulkCreate','join','root','%s-%s','originalname','single','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0x4fb7,0x1d7));var _0x74fb=function(_0x180b34,_0x3042a1){_0x180b34=_0x180b34-0x0;var _0x887de5=_0x4fb7[_0x180b34];return _0x887de5;};'use strict';var multer=require('multer');var util=require(_0x74fb('0x0'));var path=require(_0x74fb('0x1'));var timeout=require(_0x74fb('0x2'));var express=require(_0x74fb('0x3'));var router=express[_0x74fb('0x4')]();var fs_extra=require(_0x74fb('0x5'));var auth=require(_0x74fb('0x6'));var interaction=require(_0x74fb('0x7'));var config=require('../../config/environment');var controller=require(_0x74fb('0x8'));router[_0x74fb('0x9')]('/',auth[_0x74fb('0xa')](),controller[_0x74fb('0xb')]);router[_0x74fb('0x9')](_0x74fb('0xc'),auth[_0x74fb('0xa')](),controller[_0x74fb('0xd')]);router['get'](_0x74fb('0xe'),auth[_0x74fb('0xa')](),controller['whoami']);router['get']('/presence',auth[_0x74fb('0xa')](),controller[_0x74fb('0xf')]);router[_0x74fb('0x9')](_0x74fb('0x10'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x11')]);router[_0x74fb('0x9')](_0x74fb('0x12'),controller[_0x74fb('0x13')]);router['get'](_0x74fb('0x14'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x15')]);router[_0x74fb('0x9')](_0x74fb('0x16'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x17')]);router['get'](_0x74fb('0x18'),auth['isAuthenticated'](),controller[_0x74fb('0x19')]);router[_0x74fb('0x9')](_0x74fb('0x1a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x1b')]);router[_0x74fb('0x9')](_0x74fb('0x1c'),auth['isAuthenticated'](),controller[_0x74fb('0x1d')]);router[_0x74fb('0x9')](_0x74fb('0x1e'),auth['isAuthenticated'](),controller[_0x74fb('0x1f')]);router[_0x74fb('0x9')]('/:id/screen_recordings',auth[_0x74fb('0xa')](),controller['getScreenRecordings']);router['get'](_0x74fb('0x20'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x21')]);router['get'](_0x74fb('0x22'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x23')]);router['get'](_0x74fb('0x24'),auth['isAuthenticated'](),controller[_0x74fb('0x25')]);router['get'](_0x74fb('0x26'),auth['isAuthenticated'](),controller[_0x74fb('0x27')]);router[_0x74fb('0x9')]('/:id/fax/interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x28')]);router[_0x74fb('0x9')](_0x74fb('0x29'),auth[_0x74fb('0xa')](),controller['getWhatsappInteractions']);router['get'](_0x74fb('0x2a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x2b')]);router[_0x74fb('0x9')]('/:id/lists',auth[_0x74fb('0xa')](),controller['getLists']);router[_0x74fb('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0x74fb('0x2c')]);router['get'](_0x74fb('0x2d'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x2e')]);router[_0x74fb('0x9')](_0x74fb('0x2f'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x30')]);router[_0x74fb('0x9')](_0x74fb('0x31'),auth['isAuthenticated'](),controller[_0x74fb('0x32')]);router[_0x74fb('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x74fb('0x33')]);router['get'](_0x74fb('0x34'),auth['isAuthenticated'](),controller[_0x74fb('0x35')]);router[_0x74fb('0x9')](_0x74fb('0x36'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x37')]);router[_0x74fb('0x9')](_0x74fb('0x38'),auth[_0x74fb('0xa')](),controller['getWhatsappAccounts']);router[_0x74fb('0x9')](_0x74fb('0x39'),auth['isAuthenticated'](),controller[_0x74fb('0x3a')]);router[_0x74fb('0x9')](_0x74fb('0x3b'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x3c')]);router[_0x74fb('0x9')]('/:id/api_key',auth[_0x74fb('0xa')](),controller[_0x74fb('0x3d')]);router[_0x74fb('0x3e')](_0x74fb('0x16'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x3f')]);router['post']('/',auth['isAuthenticated'](),controller[_0x74fb('0x40')]);router[_0x74fb('0x3e')](_0x74fb('0x41'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x42')]);router[_0x74fb('0x3e')]('/:id/queues',auth[_0x74fb('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c5bb6,_0x5d7b62,_0x38811b){_0x38811b(null,path[_0x74fb('0x43')](config[_0x74fb('0x44')],'server/files/images/'));},'filename':function(_0x32f59a,_0x230f8e,_0x3e3169){_0x3e3169(null,util['format'](_0x74fb('0x45'),Date['now'](),_0x230f8e[_0x74fb('0x46')]));}})});router[_0x74fb('0x3e')](_0x74fb('0x12'),upload[_0x74fb('0x47')]('file'),controller[_0x74fb('0x48')]);router[_0x74fb('0x3e')](_0x74fb('0x49'),auth[_0x74fb('0xa')](),controller['login']);router['post'](_0x74fb('0x4a'),auth['isAuthenticated'](),controller['logout']);router[_0x74fb('0x3e')](_0x74fb('0x4b'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x4c')]);router['post'](_0x74fb('0x4d'),auth['isAuthenticated'](),controller[_0x74fb('0x4e')]);router[_0x74fb('0x3e')](_0x74fb('0x2a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x4f')]);router[_0x74fb('0x3e')](_0x74fb('0x50'),auth['isAuthenticated'](),controller[_0x74fb('0x51')]);router['post']('/:id/mail_interactions',auth[_0x74fb('0xa')](),controller['addMailInteractions']);router[_0x74fb('0x3e')](_0x74fb('0x52'),auth['isAuthenticated'](),controller[_0x74fb('0x53')]);router[_0x74fb('0x3e')](_0x74fb('0x54'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x55')]);router[_0x74fb('0x3e')](_0x74fb('0x56'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x57')]);router[_0x74fb('0x3e')](_0x74fb('0x58'),auth['isAuthenticated'](),controller[_0x74fb('0x59')]);router['post'](_0x74fb('0x2f'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5a')]);router[_0x74fb('0x3e')](_0x74fb('0x31'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5b')]);router[_0x74fb('0x3e')](_0x74fb('0x5c'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5d')]);router[_0x74fb('0x3e')](_0x74fb('0x34'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5e')]);router[_0x74fb('0x3e')](_0x74fb('0x36'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x74fb('0x3e')](_0x74fb('0x38'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x5f')]);router[_0x74fb('0x3e')](_0x74fb('0x39'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x60')]);router['post']('/:id/api_key',auth[_0x74fb('0xa')](),controller['createApiKey']);router[_0x74fb('0x61')](_0x74fb('0x10'),auth['isAuthenticated'](),controller[_0x74fb('0x62')]);router[_0x74fb('0x61')](_0x74fb('0x63'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x64')]);router[_0x74fb('0x65')](_0x74fb('0x18'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x66')]);router[_0x74fb('0x65')](_0x74fb('0x2a'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x67')]);router[_0x74fb('0x65')](_0x74fb('0x10'),auth[_0x74fb('0xa')](),controller['destroy']);router[_0x74fb('0x65')](_0x74fb('0x50'),auth[_0x74fb('0xa')](),controller['removeChatInteractions']);router[_0x74fb('0x65')]('/:id/mail_interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x68')]);router[_0x74fb('0x65')](_0x74fb('0x52'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x69')]);router[_0x74fb('0x65')]('/:id/sms_interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x6a')]);router[_0x74fb('0x65')]('/:id/openchannel_interactions',auth[_0x74fb('0xa')](),controller[_0x74fb('0x6b')]);router[_0x74fb('0x65')](_0x74fb('0x58'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x6c')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x74fb('0x65')](_0x74fb('0x31'),auth['isAuthenticated'](),controller[_0x74fb('0x6d')]);router[_0x74fb('0x65')](_0x74fb('0x5c'),auth[_0x74fb('0xa')](),controller['removeOpenchannelAccounts']);router[_0x74fb('0x65')](_0x74fb('0x34'),auth['isAuthenticated'](),controller[_0x74fb('0x6e')]);router[_0x74fb('0x65')](_0x74fb('0x36'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x6f')]);router[_0x74fb('0x65')]('/:id/whatsapp_accounts',auth[_0x74fb('0xa')](),controller[_0x74fb('0x70')]);router[_0x74fb('0x65')](_0x74fb('0x39'),auth['isAuthenticated'](),controller[_0x74fb('0x71')]);router[_0x74fb('0x65')](_0x74fb('0x72'),auth[_0x74fb('0xa')](),controller[_0x74fb('0x73')]);module[_0x74fb('0x74')]=router;
\ No newline at end of file
index 31a48fc..f5b4352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcedf=['dtlsprivatekey','dtlscertfile','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','STRING','name','defaultuser','setDataValue','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','agent','local','INTEGER','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','rfc2833','info','shortinfo','inband','yes','nonat','update','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','refuse','uas','fingerprint','active','passive','actpass','update,nonat','TEXT','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup'];(function(_0x29a25a,_0x3ea3a8){var _0x28c076=function(_0x27ee03){while(--_0x27ee03){_0x29a25a['push'](_0x29a25a['shift']());}};_0x28c076(++_0x3ea3a8);}(_0xcedf,0x1b6));var _0xfced=function(_0x17c083,_0x515c7e){_0x17c083=_0x17c083-0x0;var _0x46c670=_0xcedf[_0x17c083];return _0x46c670;};'use strict';var Sequelize=require(_0xfced('0x0'));var moment=require(_0xfced('0x1'));var util=require(_0xfced('0x2'));var _=require(_0xfced('0x3'));module['exports']={'name':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'unique':_0xfced('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4c426b){this['setDataValue'](_0xfced('0x5'),_0x4c426b);this['setDataValue'](_0xfced('0x6'),_0x4c426b);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'set':function(_0x571725){this[_0xfced('0x7')]('fullname',_0x571725);this['setDataValue'](_0xfced('0x8'),util[_0xfced('0x9')](_0xfced('0xa'),_0x571725,this[_0xfced('0xb')]('internal')));}},'alias':{'type':Sequelize[_0xfced('0x4')]},'email':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'unique':_0xfced('0xc'),'validate':{'isEmail':!![]},'set':function(_0x472717){if(_0x472717){this[_0xfced('0x7')](_0xfced('0xc'),_0x472717[_0xfced('0xd')]());}}},'role':{'type':Sequelize[_0xfced('0xe')](_0xfced('0xf'),'user',_0xfced('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xfced('0x4')],'defaultValue':_0xfced('0x11')},'internal':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x11d034){this[_0xfced('0x7')](_0xfced('0x13'),_0x11d034);this[_0xfced('0x7')](_0xfced('0x14'),_0x11d034);this[_0xfced('0x7')](_0xfced('0x8'),util[_0xfced('0x9')]('\x22%s\x22\x20<%s>',this[_0xfced('0xb')]('fullname'),_0x11d034));}},'salt':{'type':Sequelize[_0xfced('0x4')]},'phone':{'type':Sequelize[_0xfced('0x4')]},'mobile':{'type':Sequelize[_0xfced('0x4')]},'address':{'type':Sequelize[_0xfced('0x4')]},'zipcode':{'type':Sequelize[_0xfced('0x4')]},'userpic':{'type':Sequelize[_0xfced('0x4')]},'city':{'type':Sequelize[_0xfced('0x4')]},'country':{'type':Sequelize[_0xfced('0x4')]},'online':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfced('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xfced('0x17')},'lastPauseAt':{'type':Sequelize[_0xfced('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfced('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfced('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![],'defaultValue':_0xfced('0x18')},'ipaddr':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xfced('0x19'),'user',_0xfced('0x1a')),'allowNull':!![],'defaultValue':_0xfced('0x19')},'context':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![],'defaultValue':_0xfced('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0xfced('0x1c'),_0xfced('0x1d'),_0xfced('0x1e'),_0xfced('0x1f'),'PROHIB_NOT_SCREENED',_0xfced('0x20'),_0xfced('0x21'),_0xfced('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![],'defaultValue':_0xfced('0x23'),'set':function(_0x249692){this[_0xfced('0x7')](_0xfced('0x24'),_0x249692?_0x249692[_0xfced('0x25')](','):null);},'get':function(){return this[_0xfced('0xb')](_0xfced('0x24'))?this[_0xfced('0xb')]('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x26'),_0xfced('0x27'),_0xfced('0x28'),_0xfced('0x29'),'auto'),'allowNull':!![],'defaultValue':_0xfced('0x26')},'directmedia':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no',_0xfced('0x2b'),_0xfced('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xfced('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x32966c){this['setDataValue'](_0xfced('0x2d'),_0x32966c?_0x32966c[_0xfced('0x25')](','):null);},'get':function(){return this[_0xfced('0xb')](_0xfced('0x2d'))?this[_0xfced('0xb')](_0xfced('0x2d'))[_0xfced('0x2e')](','):null;},'comment':_0xfced('0x2f')},'callgroup':{'type':Sequelize[_0xfced('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfced('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xfced('0x4')]},'language':{'type':Sequelize[_0xfced('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfced('0x4')]},'disallow':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'defaultValue':_0xfced('0x30')},'allow':{'type':Sequelize[_0xfced('0x4')],'allowNull':![],'defaultValue':_0xfced('0x31'),'set':function(_0xa6e40f){this[_0xfced('0x7')](_0xfced('0x32'),_0xa6e40f?_0xa6e40f[_0xfced('0x25')](';'):_0xfced('0x31'));},'get':function(){return this[_0xfced('0xb')](_0xfced('0x32'))?this[_0xfced('0xb')](_0xfced('0x32'))[_0xfced('0x2e')](';'):null;},'comment':_0xfced('0x33')},'autoframing':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![],'set':function(_0x228f9e){this[_0xfced('0x7')](_0xfced('0x34'),_0x228f9e?_0x228f9e[_0xfced('0x25')](','):null);},'get':function(){return this[_0xfced('0xb')](_0xfced('0x34'))?this[_0xfced('0xb')](_0xfced('0x34'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfced('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfced('0xe')]('yes','no',_0xfced('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfced('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![],'defaultValue':_0xfced('0x36')},'amaflags':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfced('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfced('0xe')]('accept',_0xfced('0x37'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfced('0xe')]('uac',_0xfced('0x38')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xfced('0x2a')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfced('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xfced('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xfced('0x2a'),'no',_0xfced('0x39'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x3a'),_0xfced('0x3b'),_0xfced('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfced('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xfced('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no',_0xfced('0x2b'),_0xfced('0x2c'),_0xfced('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfced('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfced('0x16')]},'passwordResetAt':{'type':Sequelize[_0xfced('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfced('0x3e')]},'showWebBar':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0,'set':function(_0x44119b){this[_0xfced('0x7')]('showWebBar',_0x44119b);var _0x109e2f=this[_0xfced('0x3f')]({'plain':!![]});switch(_0x44119b){case 0x0:case 0x1:var _0x2b48a0=_0x109e2f[_0xfced('0x24')]?_[_0xfced('0x40')](_0x109e2f[_0xfced('0x24')])?_0x109e2f[_0xfced('0x24')][_0xfced('0x25')]():_0x109e2f[_0xfced('0x24')]:_0xfced('0x23');if(_0x2b48a0===_0xfced('0x41')){_0x2b48a0='udp';}this[_0xfced('0x7')](_0xfced('0x24'),_0x2b48a0);this[_0xfced('0x7')](_0xfced('0x42'),'no');this['setDataValue'](_0xfced('0x43'),null);this[_0xfced('0x7')](_0xfced('0x44'),null);this['setDataValue']('icesupport',null);this[_0xfced('0x7')](_0xfced('0x45'),null);this[_0xfced('0x7')](_0xfced('0x46'),null);this[_0xfced('0x7')](_0xfced('0x47'),null);this[_0xfced('0x7')]('dtlscertfile',null);this[_0xfced('0x7')](_0xfced('0x48'),null);this[_0xfced('0x7')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xfced('0x24'),_0xfced('0x41'));this[_0xfced('0x7')](_0xfced('0x42'),'yes');this['setDataValue']('avpf',_0xfced('0x2a'));this[_0xfced('0x7')](_0xfced('0x44'),'yes');this['setDataValue']('icesupport','yes');this[_0xfced('0x7')]('dtlsenable',_0xfced('0x2a'));this[_0xfced('0x7')](_0xfced('0x46'),'no');this[_0xfced('0x7')](_0xfced('0x47'),_0xfced('0x3c'));this[_0xfced('0x7')]('dtlscertfile',_0x109e2f[_0xfced('0x49')]||'/etc/pki/tls/certs/motion.crt');this[_0xfced('0x7')]('dtlsprivatekey',_0x109e2f[_0xfced('0x48')]||'/etc/pki/tls/private/motion.key');this[_0xfced('0x7')](_0xfced('0x4a'),_0xfced('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xfced('0x3e')],'set':function(_0x3e48c7){this[_0xfced('0x7')](_0xfced('0x4b'),_0x3e48c7?_0x3e48c7['join'](','):[]);},'get':function(){return this[_0xfced('0xb')](_0xfced('0x4b'))?_[_0xfced('0x4c')](this[_0xfced('0xb')](_0xfced('0x4b'))[_0xfced('0x2e')](','),function(_0x3c6c9e){return parseInt(_0x3c6c9e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfced('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfced('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfced('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfced('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfced('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfced('0xe')](_0xfced('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfced('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xfced('0x4d')],'get':function(){return this[_0xfced('0xb')](_0xfced('0x4e'))?this['getDataValue'](_0xfced('0x4e')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfced('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfced('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfced('0x15')],'defaultValue':![],'set':function(_0x181a85){if(typeof _0x181a85===_0xfced('0x4f')){var _0xe44344=_0x181a85==='1'?!![]:_0x181a85==='0'?![]:_0x181a85==='true'?!![]:_0x181a85===_0xfced('0x50')?![]:![];this[_0xfced('0x7')](_0xfced('0x51'),_0xe44344);}else{this[_0xfced('0x7')]('screenrecording',_0x181a85);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x277abf){this[_0xfced('0x7')](_0xfced('0x52'),_0x277abf);if(_0x277abf===!![]){this[_0xfced('0x7')](_0xfced('0x53'),moment());this[_0xfced('0x7')](_0xfced('0x54'),0x0);}else{this[_0xfced('0x7')](_0xfced('0x53'),null);}}},'blockedAt':{'type':Sequelize[_0xfced('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfced('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfced('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfced('0x12')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfced('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xaf1b=['force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','permissions','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','format','\x22%s\x22\x20<%s>','getDataValue','email','toLowerCase','ENUM','admin','user','agent','local','INTEGER','internal','accountcode','callerid','fullname','DATE','BOOLEAN','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','split','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','actpass','update,nonat','TEXT','showWebBar','get','udp','encryption','avpf'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x132a22,_0x5afe84){_0x132a22=_0x132a22-0x0;var _0xe9bbb=_0xaf1b[_0x132a22];return _0xe9bbb;};'use strict';var Sequelize=require(_0xbaf1('0x0'));var moment=require(_0xbaf1('0x1'));var util=require(_0xbaf1('0x2'));var _=require(_0xbaf1('0x3'));module[_0xbaf1('0x4')]={'name':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'unique':_0xbaf1('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xdf4a1b){this[_0xbaf1('0x7')](_0xbaf1('0x6'),_0xdf4a1b);this[_0xbaf1('0x7')](_0xbaf1('0x8'),_0xdf4a1b);},'comment':_0xbaf1('0x9')},'fullname':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'set':function(_0x548a29){this[_0xbaf1('0x7')]('fullname',_0x548a29);this[_0xbaf1('0x7')]('callerid',util[_0xbaf1('0xa')](_0xbaf1('0xb'),_0x548a29,this[_0xbaf1('0xc')]('internal')));}},'alias':{'type':Sequelize[_0xbaf1('0x5')]},'email':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x6e9e3){if(_0x6e9e3){this['setDataValue'](_0xbaf1('0xd'),_0x6e9e3[_0xbaf1('0xe')]());}}},'role':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x10'),_0xbaf1('0x11'),_0xbaf1('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':_0xbaf1('0x13')},'internal':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':![],'unique':_0xbaf1('0x15'),'set':function(_0x1d94da){this[_0xbaf1('0x7')](_0xbaf1('0x15'),_0x1d94da);this['setDataValue'](_0xbaf1('0x16'),_0x1d94da);this[_0xbaf1('0x7')](_0xbaf1('0x17'),util[_0xbaf1('0xa')](_0xbaf1('0xb'),this[_0xbaf1('0xc')](_0xbaf1('0x18')),_0x1d94da));}},'salt':{'type':Sequelize[_0xbaf1('0x5')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xbaf1('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xbaf1('0x5')]},'userpic':{'type':Sequelize[_0xbaf1('0x5')]},'city':{'type':Sequelize[_0xbaf1('0x5')]},'country':{'type':Sequelize[_0xbaf1('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xbaf1('0x19')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':_0xbaf1('0x1b')},'lastPauseAt':{'type':Sequelize[_0xbaf1('0x19')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbaf1('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'description':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xbaf1('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xbaf1('0x1c'),_0xbaf1('0x11'),_0xbaf1('0x1d')),'allowNull':!![],'defaultValue':_0xbaf1('0x1c')},'context':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'defaultValue':_0xbaf1('0x1e')},'callingpres':{'type':Sequelize[_0xbaf1('0xf')]('ALLOWED_NOT_SCREENED',_0xbaf1('0x1f'),_0xbaf1('0x20'),_0xbaf1('0x21'),_0xbaf1('0x22'),_0xbaf1('0x23'),_0xbaf1('0x24'),_0xbaf1('0x25')),'allowNull':!![]},'deny':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x19976c){this['setDataValue'](_0xbaf1('0x26'),_0x19976c?_0x19976c['join'](','):null);},'get':function(){return this[_0xbaf1('0xc')](_0xbaf1('0x26'))?this[_0xbaf1('0xc')](_0xbaf1('0x26'))['split'](','):null;},'comment':_0xbaf1('0x27')},'dtmfmode':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x28'),_0xbaf1('0x29'),_0xbaf1('0x2a'),_0xbaf1('0x2b'),_0xbaf1('0x2c')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no',_0xbaf1('0x2e'),_0xbaf1('0x2f'),_0xbaf1('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbaf1('0x31'),'set':function(_0xcd28ce){this[_0xbaf1('0x7')](_0xbaf1('0x32'),_0xcd28ce?_0xcd28ce[_0xbaf1('0x33')](','):null);},'get':function(){return this[_0xbaf1('0xc')](_0xbaf1('0x32'))?this[_0xbaf1('0xc')](_0xbaf1('0x32'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xbaf1('0x5')]},'pickupgroup':{'type':Sequelize[_0xbaf1('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbaf1('0x5')]},'disallow':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':![],'defaultValue':_0xbaf1('0x34'),'set':function(_0x3d2302){this['setDataValue'](_0xbaf1('0x35'),_0x3d2302?_0x3d2302[_0xbaf1('0x33')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xbaf1('0x35'))?this['getDataValue']('allow')['split'](';'):null;},'comment':_0xbaf1('0x36')},'autoframing':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![],'set':function(_0x9d38ba){this[_0xbaf1('0x7')](_0xbaf1('0x37'),_0x9d38ba?_0x9d38ba[_0xbaf1('0x33')](','):null);},'get':function(){return this['getDataValue'](_0xbaf1('0x37'))?this[_0xbaf1('0xc')](_0xbaf1('0x37'))[_0xbaf1('0x38')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbaf1('0xf')]('yes','no',_0xbaf1('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xbaf1('0x3a')},'amaflags':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xbaf1('0x2d')},'busylevel':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no',_0xbaf1('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xbaf1('0xf')]('accept',_0xbaf1('0x3c'),_0xbaf1('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x3e'),_0xbaf1('0x3f')),'allowNull':!![],'defaultValue':_0xbaf1('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xbaf1('0x2d')},'keepalive':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbaf1('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no',_0xbaf1('0x40'),_0xbaf1('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xbaf1('0xf')]('active','passive',_0xbaf1('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xbaf1('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xbaf1('0xf')](_0xbaf1('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xbaf1('0x2d'),'no','nonat',_0xbaf1('0x2f'),_0xbaf1('0x43')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbaf1('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xbaf1('0x19')]},'passwordResetAt':{'type':Sequelize[_0xbaf1('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xbaf1('0x44')]},'showWebBar':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0,'set':function(_0x1f1449){this[_0xbaf1('0x7')](_0xbaf1('0x45'),_0x1f1449);var _0x58ba4e=this[_0xbaf1('0x46')]({'plain':!![]});switch(_0x1f1449){case 0x0:case 0x1:var _0x4e42b0=_0x58ba4e[_0xbaf1('0x26')]?_['isArray'](_0x58ba4e[_0xbaf1('0x26')])?_0x58ba4e[_0xbaf1('0x26')][_0xbaf1('0x33')]():_0x58ba4e[_0xbaf1('0x26')]:_0xbaf1('0x47');if(_0x4e42b0==='wss'){_0x4e42b0=_0xbaf1('0x47');}this[_0xbaf1('0x7')](_0xbaf1('0x26'),_0x4e42b0);this['setDataValue'](_0xbaf1('0x48'),'no');this[_0xbaf1('0x7')](_0xbaf1('0x49'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4a'),null);this[_0xbaf1('0x7')]('icesupport',null);this[_0xbaf1('0x7')](_0xbaf1('0x4b'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4c'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4d'),null);this['setDataValue'](_0xbaf1('0x4e'),null);this[_0xbaf1('0x7')](_0xbaf1('0x4f'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xbaf1('0x7')](_0xbaf1('0x26'),_0xbaf1('0x50'));this['setDataValue'](_0xbaf1('0x48'),_0xbaf1('0x2d'));this[_0xbaf1('0x7')](_0xbaf1('0x49'),_0xbaf1('0x2d'));this['setDataValue'](_0xbaf1('0x4a'),_0xbaf1('0x2d'));this[_0xbaf1('0x7')]('icesupport','yes');this[_0xbaf1('0x7')](_0xbaf1('0x4b'),_0xbaf1('0x2d'));this['setDataValue'](_0xbaf1('0x4c'),'no');this[_0xbaf1('0x7')](_0xbaf1('0x4d'),'actpass');this[_0xbaf1('0x7')](_0xbaf1('0x4e'),_0x58ba4e['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this[_0xbaf1('0x7')](_0xbaf1('0x4f'),_0x58ba4e['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xbaf1('0x7')]('rtcp_mux',_0xbaf1('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0xbaf1('0x44')],'set':function(_0x1d12da){this[_0xbaf1('0x7')](_0xbaf1('0x51'),_0x1d12da?_0x1d12da[_0xbaf1('0x33')](','):[]);},'get':function(){return this[_0xbaf1('0xc')]('permissions')?_['map'](this['getDataValue'](_0xbaf1('0x51'))[_0xbaf1('0x38')](','),function(_0x1e8486){return parseInt(_0x1e8486,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xbaf1('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0xbaf1('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbaf1('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xbaf1('0xc')]('phoneBarEnableScreenRecordingByAgent')?this[_0xbaf1('0xc')](_0xbaf1('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'interface':{'type':Sequelize[_0xbaf1('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xbaf1('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![],'set':function(_0x292ec0){if(typeof _0x292ec0==='string'){var _0x369e80=_0x292ec0==='1'?!![]:_0x292ec0==='0'?![]:_0x292ec0===_0xbaf1('0x53')?!![]:_0x292ec0==='false'?![]:![];this[_0xbaf1('0x7')](_0xbaf1('0x54'),_0x369e80);}else{this[_0xbaf1('0x7')](_0xbaf1('0x54'),_0x292ec0);}}},'blocked':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![],'set':function(_0xf389f){this[_0xbaf1('0x7')](_0xbaf1('0x55'),_0xf389f);if(_0xf389f===!![]){this[_0xbaf1('0x7')](_0xbaf1('0x56'),moment());this[_0xbaf1('0x7')](_0xbaf1('0x57'),0x0);}else{this['setDataValue'](_0xbaf1('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xbaf1('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xbaf1('0x14')](0x5)[_0xbaf1('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbaf1('0x1a')],'defaultValue':!![]}};
\ No newline at end of file
index 177854d..26664a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$iLike','$notILike','$like','$overlap','$contains','$contained','firstName','Contact','dialActive','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','getPresence','teams','queues','inbound','col','toString','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','pause','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','field','user_has_','_interactions','OpenTabs','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','http','request','info','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','User,\x20%s,\x20%s','result','catch','status','end','undefined','limit','count','offset','json','apply','save','update','destroy','then','get','role','admin','Users','user','Agents','agent','filter','ignore','map','value','includes','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','salt','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','sequelize','lower','options','includeAll','include','findAll','rows','openTabs','true','push','chat','dataValues','sms','fax','mail','openchannel','whatsapp','params','User','find','all','body','describe','addContacts','ids','omit','Setting','findById','securePassword','validatePasswordPattern','password','max','internal','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','from','voicemail','VoiceMail','fullname','email','permissions','102','103','113','110','104','105','106','107','108','109','100','111','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','UserProfileSection','Telephones','bulkCreate','some','checkUserLimits','each','telephone','isEmpty','autoAssociation','compact','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','format','UserVoiceQueueRt','upsert','remove','Queue:remove','addAvatar','userpic','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','CmList','List','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','concat','LOGININPAUSE','resolve','logout','QueuePause','DEFAULT\x20PAUSE','unpause','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','manual','set','Team','getTeams','addTeams','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','SIP/%s','removeTeams','Whatsapp','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions'];(function(_0x2a9c9a,_0x2f13c6){var _0x49f693=function(_0x481e00){while(--_0x481e00){_0x2a9c9a['push'](_0x2a9c9a['shift']());}};_0x49f693(++_0x2f13c6);}(_0xed1f,0x6a));var _0xfed1=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xed1f[_0x5ddaac];return _0x2a9c58;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var values;var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];config['redis']=_[_0xfed1('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfed1('0x1b'))(new Redis(config[_0xfed1('0x1c')]));require('./user.socket')[_0xfed1('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xfed1('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x39aa0c,_0x1fbb7a,_0x123c46,_0x582e67){return new BPromise(function(_0x1a00f6,_0x4af928){var _0x36ff34=_0x582e67||client;return _0x36ff34[_0xfed1('0x1f')](_0x39aa0c,_0x123c46)['then'](function(_0x3d0517){logger[_0xfed1('0x20')]('User,\x20%s,\x20%s',_0x1fbb7a,'request\x20sent');logger['debug'](_0xfed1('0x21'),_0x1fbb7a,'request\x20sent',JSON[_0xfed1('0x22')](_0x3d0517));if(_0x3d0517[_0xfed1('0x23')]){if(_0x3d0517['error'][_0xfed1('0x24')]===0x1f4){logger[_0xfed1('0x23')]('User,\x20%s,\x20%s',_0x1fbb7a,_0x3d0517[_0xfed1('0x23')][_0xfed1('0x25')]);return _0x4af928(_0x3d0517[_0xfed1('0x23')][_0xfed1('0x25')]);}logger['error'](_0xfed1('0x26'),_0x1fbb7a,_0x3d0517['error'][_0xfed1('0x25')]);return _0x1a00f6(_0x3d0517[_0xfed1('0x23')][_0xfed1('0x25')]);}else{logger['info'](_0xfed1('0x26'),_0x1fbb7a,'request\x20sent');_0x1a00f6(_0x3d0517[_0xfed1('0x27')][_0xfed1('0x25')]);}})[_0xfed1('0x28')](function(_0x365bae){logger[_0xfed1('0x23')](_0xfed1('0x26'),_0x1fbb7a,_0x365bae);_0x4af928(_0x365bae);});});}function respondWithStatusCode(_0x527fc7,_0x465ce6){_0x465ce6=_0x465ce6||0xcc;return function(_0xcb1cdc){if(_0xcb1cdc){return _0x527fc7['sendStatus'](_0x465ce6);}return _0x527fc7[_0xfed1('0x29')](_0x465ce6)[_0xfed1('0x2a')]();};}function respondWithResult(_0x1b871a,_0x1d62c5){_0x1d62c5=_0x1d62c5||0xc8;return function(_0x3b9122){if(_0x3b9122){return _0x1b871a[_0xfed1('0x29')](_0x1d62c5)['json'](_0x3b9122);}};}function respondWithFilteredResult(_0x4607e9,_0x5a4451){return function(_0x3106ee){if(_0x3106ee){var _0x4e5249=typeof _0x5a4451['offset']===_0xfed1('0x2b')&&typeof _0x5a4451[_0xfed1('0x2c')]===_0xfed1('0x2b');var _0x599c23=_0x3106ee[_0xfed1('0x2d')];var _0x437a25=_0x4e5249?0x0:_0x5a4451[_0xfed1('0x2e')];var _0x383955=_0x4e5249?_0x3106ee[_0xfed1('0x2d')]:_0x5a4451[_0xfed1('0x2e')]+_0x5a4451['limit'];var _0x17e1e7;if(_0x383955>=_0x599c23){_0x383955=_0x599c23;_0x17e1e7=0xc8;}else{_0x17e1e7=0xce;}_0x4607e9[_0xfed1('0x29')](_0x17e1e7);return _0x4607e9['set']('Content-Range',_0x437a25+'-'+_0x383955+'/'+_0x599c23)[_0xfed1('0x2f')](_0x3106ee);}return null;};}function patchUpdates(_0x2d10f5){return function(_0x2def09){try{jsonpatch[_0xfed1('0x30')](_0x2def09,_0x2d10f5,!![]);}catch(_0x44c24a){return BPromise['reject'](_0x44c24a);}return _0x2def09[_0xfed1('0x31')]();};}function saveUpdates(_0x21b292,_0x10143b){return function(_0x349de1){if(_0x349de1){return _0x349de1[_0xfed1('0x32')](_0x21b292)['then'](function(_0x1da4b7){return _0x1da4b7;});}return null;};}function removeEntity(_0x4a81be,_0x11c5bd){return function(_0x2bea11){if(_0x2bea11){return _0x2bea11[_0xfed1('0x33')]()[_0xfed1('0x34')](function(){var _0x1c0523=_0x2bea11[_0xfed1('0x35')]({'plain':!![]});if(_0x1c0523[_0xfed1('0x36')]===_0xfed1('0x37'))return;var _0x4d6aa3=[{'name':_0xfed1('0x38'),'value':_0xfed1('0x39'),'ignore':!![]},{'name':_0xfed1('0x3a'),'value':_0xfed1('0x3b'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x42d5df=_(_0x4d6aa3)[_0xfed1('0x3c')](_0xfed1('0x3d'))[_0xfed1('0x3e')](_0xfed1('0x3f'))[_0xfed1('0x3f')]();if(_[_0xfed1('0x40')](_0x42d5df,_0x1c0523[_0xfed1('0x36')])){return;}var _0x5793a4=_['find'](_0x4d6aa3,[_0xfed1('0x3f'),_0x1c0523[_0xfed1('0x36')]])['name'];return db[_0xfed1('0x41')][_0xfed1('0x33')]({'where':{'type':_0x5793a4,'resourceId':_0x1c0523['id']}})[_0xfed1('0x34')](function(){return _0x2bea11;});})[_0xfed1('0x34')](function(){_0x4a81be[_0xfed1('0x29')](0xcc)[_0xfed1('0x2a')]();});}};}function handleEntityNotFound(_0xe55b5,_0x4118d4){return function(_0x3c27de){if(!_0x3c27de){_0xe55b5['sendStatus'](0x194);}return _0x3c27de;};}function handleError(_0x4eec55,_0x5598dc){_0x5598dc=_0x5598dc||0x1f4;return function(_0x9e11){logger[_0xfed1('0x23')](_0x9e11[_0xfed1('0x42')]);if(_0x9e11['name']){delete _0x9e11[_0xfed1('0x43')];}_0x4eec55['status'](_0x5598dc)[_0xfed1('0x44')](_0x9e11);};}exports[_0xfed1('0x45')]=function(_0x2f4e0f,_0x4f042a){var _0x20bdae={},_0x6f1647={},_0x422433={'count':0x0,'rows':[]};var _0x4b4115=_[_0xfed1('0x3e')](db['User'][_0xfed1('0x46')],function(_0xf1f739){return{'name':_0xf1f739[_0xfed1('0x47')],'type':_0xf1f739[_0xfed1('0x48')][_0xfed1('0x49')]};});_0x6f1647[_0xfed1('0x4a')]=_[_0xfed1('0x4b')](_[_0xfed1('0x3e')](_0x4b4115,_0xfed1('0x43')),['password',_0xfed1('0x4c')]);_0x6f1647[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x2f4e0f['query']);_0x6f1647['filters']=_[_0xfed1('0x4f')](_0x6f1647[_0xfed1('0x4a')],_0x6f1647[_0xfed1('0x4d')]);_0x20bdae[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x6f1647[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x2f4e0f[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x20bdae[_0xfed1('0x50')]=_0x20bdae[_0xfed1('0x50')][_0xfed1('0x52')]?_0x20bdae['attributes']:_0x6f1647[_0xfed1('0x4a')];if(!_0x2f4e0f[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x20bdae[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x2f4e0f['query'][_0xfed1('0x2c')]);_0x20bdae[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x2f4e0f['query'][_0xfed1('0x2e')]);}_0x20bdae[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x2f4e0f[_0xfed1('0x4d')]['sort']);_0x20bdae[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x2f4e0f[_0xfed1('0x4d')],_0x6f1647[_0xfed1('0x58')]),_0x4b4115);if(_0x2f4e0f[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x20bdae[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x20bdae[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x4b4115,function(_0xb3a534){if(_0xb3a534[_0xfed1('0x48')]!==_0xfed1('0x5b')){return db[_0xfed1('0x5c')][_0xfed1('0x57')](db[_0xfed1('0x5c')]['fn'](_0xfed1('0x5d'),db['sequelize']['col'](_0xb3a534[_0xfed1('0x43')])),{'$like':db[_0xfed1('0x5c')]['fn'](_0xfed1('0x5d'),'%'+_0x2f4e0f[_0xfed1('0x4d')]['filter']+'%')});}})});}_0x20bdae=_[_0xfed1('0x5a')]({},_0x20bdae,_0x2f4e0f[_0xfed1('0x5e')]);var _0x55e7d9={'where':_0x20bdae['where']};return db['User'][_0xfed1('0x2d')](_0x55e7d9)[_0xfed1('0x34')](function(_0x15e90f){_0x422433[_0xfed1('0x2d')]=_0x15e90f;if(_0x2f4e0f[_0xfed1('0x4d')][_0xfed1('0x5f')]){_0x20bdae[_0xfed1('0x60')]=[{'all':!![]}];}if(!_[_0xfed1('0x40')](_0x20bdae[_0xfed1('0x50')],'id')){_0x20bdae[_0xfed1('0x50')]['push']('id');}return db['User'][_0xfed1('0x61')](_0x20bdae);})[_0xfed1('0x34')](function(_0x3f4db7){_0x422433[_0xfed1('0x62')]=_0x3f4db7;if(_0x2f4e0f[_0xfed1('0x4d')][_0xfed1('0x63')]===_0xfed1('0x64')){var _0x3754df=[];for(var _0x117e25=0x0;_0x117e25<_0x422433[_0xfed1('0x62')][_0xfed1('0x52')];_0x117e25++){_0x3754df[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x66'),_0x422433[_0xfed1('0x62')][_0x117e25][_0xfed1('0x67')]));_0x3754df[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x68'),_0x422433['rows'][_0x117e25]['dataValues']));_0x3754df[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x69'),_0x422433[_0xfed1('0x62')][_0x117e25][_0xfed1('0x67')]));_0x3754df[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x6a'),_0x422433[_0xfed1('0x62')][_0x117e25][_0xfed1('0x67')]));_0x3754df[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x6b'),_0x422433[_0xfed1('0x62')][_0x117e25][_0xfed1('0x67')]));_0x3754df[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x6c'),_0x422433['rows'][_0x117e25][_0xfed1('0x67')]));}return BPromise['all'](_0x3754df)['then'](function(_0x3a118c){return _0x422433;});}else{return _0x422433;}})['then'](respondWithFilteredResult(_0x4f042a,_0x20bdae))[_0xfed1('0x28')](handleError(_0x4f042a,null));};exports['show']=function(_0x390fc0,_0x8e29d1){var _0x53f0ab={'raw':![],'where':{'id':_0x390fc0[_0xfed1('0x6d')]['id']}},_0x373214={};_0x373214['model']=_[_0xfed1('0x4b')](_[_0xfed1('0x4e')](db[_0xfed1('0x6e')][_0xfed1('0x46')]),['password',_0xfed1('0x4c')]);_0x373214[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x390fc0[_0xfed1('0x4d')]);_0x373214[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x373214[_0xfed1('0x4a')],_0x373214[_0xfed1('0x4d')]);_0x53f0ab['attributes']=_[_0xfed1('0x4f')](_0x373214[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x390fc0[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x53f0ab[_0xfed1('0x50')]=_0x53f0ab['attributes']['length']?_0x53f0ab['attributes']:_0x373214[_0xfed1('0x4a')];if(_0x390fc0[_0xfed1('0x4d')][_0xfed1('0x5f')]){_0x53f0ab[_0xfed1('0x60')]=[{'all':!![]}];}_0x53f0ab=_['merge']({},_0x53f0ab,_0x390fc0[_0xfed1('0x5e')]);if(!_['includes'](_0x53f0ab[_0xfed1('0x50')],'id')){_0x53f0ab[_0xfed1('0x50')][_0xfed1('0x65')]('id');}return db[_0xfed1('0x6e')][_0xfed1('0x6f')](_0x53f0ab)['then'](handleEntityNotFound(_0x8e29d1,null))[_0xfed1('0x34')](function(_0x6b74cb){var _0x20c31f=[];values=_0x6b74cb;if(_0x390fc0['query'][_0xfed1('0x63')]===_0xfed1('0x64')){_0x20c31f[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x66'),_0x6b74cb['dataValues']));_0x20c31f[_0xfed1('0x65')](get_open_tabs('sms',_0x6b74cb[_0xfed1('0x67')]));_0x20c31f[_0xfed1('0x65')](get_open_tabs('openchannel',_0x6b74cb['dataValues']));_0x20c31f[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x6c'),_0x6b74cb[_0xfed1('0x67')]));_0x20c31f[_0xfed1('0x65')](get_open_tabs('fax',_0x6b74cb[_0xfed1('0x67')]));_0x20c31f[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x6a'),_0x6b74cb[_0xfed1('0x67')]));return BPromise[_0xfed1('0x70')](_0x20c31f);}else{return values;}})[_0xfed1('0x34')](function(_0x4961a4){return values;})[_0xfed1('0x34')](respondWithResult(_0x8e29d1,null))[_0xfed1('0x28')](handleError(_0x8e29d1,null));};exports['update']=function(_0x3a4072,_0x260292){if(_0x3a4072[_0xfed1('0x71')]['id']){delete _0x3a4072[_0xfed1('0x71')]['id'];}delete _0x3a4072[_0xfed1('0x71')][_0xfed1('0x36')];return db['User']['find']({'where':{'id':_0x3a4072[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x260292,null))[_0xfed1('0x34')](saveUpdates(_0x3a4072[_0xfed1('0x71')],null))[_0xfed1('0x34')](respondWithResult(_0x260292,null))[_0xfed1('0x28')](handleError(_0x260292,null));};exports[_0xfed1('0x72')]=function(_0x179f85,_0xd9176a){return db[_0xfed1('0x6e')][_0xfed1('0x72')]()[_0xfed1('0x34')](respondWithResult(_0xd9176a,null))['catch'](handleError(_0xd9176a,null));};exports[_0xfed1('0x73')]=function(_0xef7276,_0x56421e,_0x544605){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0xef7276[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x56421e,null))[_0xfed1('0x34')](function(_0x54aed0){if(_0x54aed0){return _0x54aed0[_0xfed1('0x73')](_0xef7276[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0xef7276[_0xfed1('0x71')],['ids','id'])||{});}})[_0xfed1('0x34')](respondWithResult(_0x56421e,null))[_0xfed1('0x28')](handleError(_0x56421e,null));};function validateUser(_0x45348d){return new BPromise(function(_0xccf9e,_0xf921fa){if(_0x45348d['internal'])return _0xccf9e(_0x45348d);return db[_0xfed1('0x76')][_0xfed1('0x77')](0x1)[_0xfed1('0x34')](function(_0x413c53){if(_0x413c53[_0xfed1('0x78')])authService[_0xfed1('0x79')](_0x45348d[_0xfed1('0x7a')]);db[_0xfed1('0x6e')][_0xfed1('0x7b')](_0xfed1('0x7c'))['then'](function(_0x22b99a){if(_[_0xfed1('0x7d')](_0x22b99a)){_0x45348d[_0xfed1('0x7c')]=_0x413c53[_0xfed1('0x7e')]||0x1;return;}if(_[_0xfed1('0x7d')](_0x413c53['min_internal'])||_0x413c53[_0xfed1('0x7e')]===_0x22b99a){_0x45348d[_0xfed1('0x7c')]=_0x22b99a+0x1;return;}if(_0x413c53[_0xfed1('0x7e')]>_0x22b99a){_0x45348d[_0xfed1('0x7c')]=_0x413c53[_0xfed1('0x7e')];return;}return db[_0xfed1('0x5c')][_0xfed1('0x4d')](_0xfed1('0x7f'),{'type':db[_0xfed1('0x5c')]['QueryTypes']['SELECT']})[_0xfed1('0x34')](function(_0x547d9c){if(_0x547d9c&&_0x547d9c[_0xfed1('0x52')]){for(var _0x3ab92e=0x0,_0x483b16=_0x547d9c['length'];_0x3ab92e<_0x483b16&&_['isNil'](_0x45348d[_0xfed1('0x7c')]);_0x3ab92e++){if(_0x413c53['min_internal']<=_0x547d9c[_0x3ab92e][_0xfed1('0x80')]){_0x45348d['internal']=_0x547d9c[_0x3ab92e][_0xfed1('0x80')];}else if(_0x413c53[_0xfed1('0x7e')]>_0x547d9c[_0x3ab92e][_0xfed1('0x80')]&&_0x413c53[_0xfed1('0x7e')]<=_0x547d9c[_0x3ab92e]['to']){_0x45348d[_0xfed1('0x7c')]=_0x413c53['min_internal'];}}}if(_[_0xfed1('0x7d')](_0x45348d[_0xfed1('0x7c')])){_0x45348d['internal']=_0x22b99a+0x1;}return _0xccf9e(_0x45348d);});});})[_0xfed1('0x28')](function(_0x130b1f){_0xf921fa(_0x130b1f);});});}function updateUser(_0x4f879d){return new BPromise(function(_0x12ce90,_0x34e38e){try{if(_0x4f879d[_0xfed1('0x81')]){_0x4f879d['mailbox']=_0x4f879d[_0xfed1('0x7c')];_0x4f879d[_0xfed1('0x82')]={'mailbox':_0x4f879d['internal'],'password':_0x4f879d[_0xfed1('0x7a')],'fullname':_0x4f879d[_0xfed1('0x83')],'email':_0x4f879d[_0xfed1('0x84')]};}if(_0x4f879d['role']===_0xfed1('0x3b')){if(!_0x4f879d[_0xfed1('0x85')])_0x4f879d['permissions']=['101',_0xfed1('0x86'),_0xfed1('0x87'),_0xfed1('0x88'),_0xfed1('0x89'),_0xfed1('0x8a'),_0xfed1('0x8b'),_0xfed1('0x8c'),_0xfed1('0x8d'),_0xfed1('0x8e'),_0xfed1('0x8f'),_0xfed1('0x90'),_0xfed1('0x91'),'114',_0xfed1('0x92')];}_0x12ce90(_0x4f879d);}catch(_0x3cac55){_0x34e38e(_0x3cac55);}});}exports['create']=function(_0x1d7bfc,_0x1f721d){if(_0x1d7bfc['user'][_0xfed1('0x36')]===_0xfed1('0x3b'))throw new Error(_0xfed1('0x93'));if(_0x1d7bfc[_0xfed1('0x71')]['role']===_0xfed1('0x39')&&_0x1d7bfc[_0xfed1('0x39')][_0xfed1('0x36')]!==_0xfed1('0x37')){throw new Error(_0xfed1('0x94'));}if(_0x1d7bfc[_0xfed1('0x71')][_0xfed1('0x36')]===_0xfed1('0x37')&&_0x1d7bfc['user'][_0xfed1('0x36')]!==_0xfed1('0x37')){throw new Error(_0xfed1('0x95'));}return licenseUtil['checkUserLimits']([_0x1d7bfc[_0xfed1('0x71')]])[_0xfed1('0x34')](function(){return validateUser(_0x1d7bfc[_0xfed1('0x71')]);})['then'](function(_0x53cec6){return updateUser(_0x53cec6)[_0xfed1('0x34')](function(_0x45a0fc){if(_0x45a0fc[_0xfed1('0x36')]===_0xfed1('0x37')){_0x45a0fc[_0xfed1('0x96')]=_0x1d7bfc[_0xfed1('0x39')][_0xfed1('0x96')];delete _0x45a0fc[_0xfed1('0x97')];}return _0x45a0fc;});})[_0xfed1('0x34')](function(_0x3588d2){return db[_0xfed1('0x6e')][_0xfed1('0x98')](_0x3588d2,{'include':[{'model':db[_0xfed1('0x82')],'as':_0xfed1('0x82')}]});})[_0xfed1('0x34')](function(_0x5bcc5f){if(_0x1d7bfc[_0xfed1('0x71')][_0xfed1('0x36')]===_0xfed1('0x39'))return _0x5bcc5f;if(_0x1d7bfc[_0xfed1('0x39')]['role']!==_0xfed1('0x39'))return _0x5bcc5f;return db[_0xfed1('0x99')][_0xfed1('0x6f')]({'where':{'name':_0x5bcc5f['role']===_0xfed1('0x3b')?_0xfed1('0x3a'):_0xfed1('0x9a'),'userProfileId':_0x1d7bfc[_0xfed1('0x39')][_0xfed1('0x97')]},'raw':!![]})[_0xfed1('0x34')](function(_0x575eee){if(!_0x575eee||_0x575eee['autoAssociation']!=0x0)return _0x5bcc5f;return db['UserProfileResource'][_0xfed1('0x98')]({'name':_0x5bcc5f[_0xfed1('0x43')],'resourceId':_0x5bcc5f['id'],'type':_0x575eee[_0xfed1('0x43')],'sectionId':_0x575eee['id']},{})['then'](function(){return _0x5bcc5f;});})[_0xfed1('0x28')](function(_0x2f14e8){logger[_0xfed1('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f14e8);throw _0x2f14e8;});})[_0xfed1('0x34')](respondWithResult(_0x1f721d,0xc9))[_0xfed1('0x28')](handleError(_0x1f721d,null));};exports[_0xfed1('0x9b')]=function(_0xb6c7d1,_0x3b5381){var _0x4a17d5=_0xb6c7d1['body'];var _0x473564=[];if(_0xb6c7d1[_0xfed1('0x39')]['role']==='agent')throw new Error(_0xfed1('0x93'));if(_[_0xfed1('0x9c')](_0x4a17d5,[_0xfed1('0x36'),_0xfed1('0x39')])&&_0xb6c7d1[_0xfed1('0x39')][_0xfed1('0x36')]!=='admin'){throw new Error(_0xfed1('0x94'));}if(_[_0xfed1('0x9c')](_0x4a17d5,[_0xfed1('0x36'),_0xfed1('0x37')])&&_0xb6c7d1[_0xfed1('0x39')]['role']!==_0xfed1('0x37')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xfed1('0x9d')](_0x4a17d5)['then'](function(){return validateUser(_0x4a17d5[0x0]);})['then'](function(){for(var _0x5d6b5a=0x1;_0x5d6b5a<_0x4a17d5['length'];_0x5d6b5a++){var _0x98b720=_0x4a17d5[_0x5d6b5a-0x1][_0xfed1('0x7c')];if(!_0x4a17d5[_0x5d6b5a][_0xfed1('0x7c')])_0x4a17d5[_0x5d6b5a]['internal']=_0x98b720+0x1;_0x473564[_0xfed1('0x65')](validateUser(_0x4a17d5[_0x5d6b5a]));}return BPromise[_0xfed1('0x70')](_0x473564);})[_0xfed1('0x34')](function(){_0x473564=[];for(var _0x29e2c8=0x0;_0x29e2c8<_0x4a17d5[_0xfed1('0x52')];_0x29e2c8++){_0x473564[_0xfed1('0x65')](updateUser(_0x4a17d5[_0x29e2c8]));}return BPromise['all'](_0x473564);})[_0xfed1('0x34')](function(){return BPromise[_0xfed1('0x9e')](_0x4a17d5,function(_0x2872ed){return db[_0xfed1('0x6e')][_0xfed1('0x98')](_0x2872ed,{'include':[{'model':db[_0xfed1('0x82')],'as':_0xfed1('0x82')}]})['then'](function(_0xbe692a){_0x2872ed['id']=_0xbe692a['id'];return _0x2872ed;});});})[_0xfed1('0x34')](function(_0x1aebcf){if(_0xb6c7d1[_0xfed1('0x71')][_0xfed1('0x36')]==='user')return _0x1aebcf;if(_0xb6c7d1[_0xfed1('0x39')][_0xfed1('0x36')]!==_0xfed1('0x39'))return _0x1aebcf;var _0xebaf74=_[_0xfed1('0x9c')](_0x1aebcf,function(_0x4f4682){return _0x4f4682[_0xfed1('0x36')]===_0xfed1('0x3b')||_0x4f4682['role']===_0xfed1('0x9f');});if(!_0xebaf74)return _0x1aebcf;return db[_0xfed1('0x99')][_0xfed1('0x61')]({'where':{'name':{'$or':[_0xfed1('0x3a'),_0xfed1('0x9a')]},'userProfileId':_0xb6c7d1['user'][_0xfed1('0x97')]},'raw':!![]})[_0xfed1('0x34')](function(_0x939669){if(_[_0xfed1('0xa0')](_0x939669)||!_[_0xfed1('0x9c')](_0x939669,[_0xfed1('0xa1'),0x0]))return _0x1aebcf;_0x473564=[];var _0xd6e3aa=_(_0x939669)[_0xfed1('0x3e')](function(_0x5a2549){if(_0x5a2549[_0xfed1('0xa1')]===0x1)return;return _0x5a2549[_0xfed1('0x43')]===_0xfed1('0x3a')?'agent':_0xfed1('0x9f');})[_0xfed1('0xa2')]()[_0xfed1('0x3f')]();for(var _0x3506ad=0x0;_0x3506ad<_0x1aebcf[_0xfed1('0x52')];_0x3506ad++){if(!_[_0xfed1('0x40')](_0xd6e3aa,_0x1aebcf[_0x3506ad]['role']))return;var _0x2eaed8=_0x1aebcf[_0x3506ad][_0xfed1('0x36')]===_0xfed1('0x3b')?_0xfed1('0x3a'):_0xfed1('0x9a');_0x473564[_0xfed1('0x65')](db['UserProfileResource'][_0xfed1('0x98')]({'name':_0x1aebcf[_0x3506ad][_0xfed1('0x43')],'resourceId':_0x1aebcf[_0x3506ad]['id'],'type':_0x2eaed8,'sectionId':_['find'](_0x939669,[_0xfed1('0x43'),_0x2eaed8])['id']},{}));}return BPromise[_0xfed1('0x70')](_0x473564);});})[_0xfed1('0x34')](respondWithResult(_0x3b5381,0xc9))[_0xfed1('0x28')](handleError(_0x3b5381,null));};exports['changePassword']=function(_0x404a28,_0x1719b5,_0x279ef7){if(_0x404a28[_0xfed1('0x71')]['id']){delete _0x404a28[_0xfed1('0x71')]['id'];}return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x404a28['params']['id']}})['then'](function(_0x60dc68){if(!_0x60dc68)return null;if(_0x60dc68['id']===_0x404a28[_0xfed1('0x39')]['id']){if(!_0x404a28[_0xfed1('0x71')]['oldPassword']||!_0x404a28[_0xfed1('0x71')]['newPassword']){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))](_0xfed1('0xa5'));}if(!_0x60dc68[_0xfed1('0xa6')](_0x404a28[_0xfed1('0x71')]['oldPassword'])){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))](_0xfed1('0xa7'));}if(_0x404a28[_0xfed1('0x71')][_0xfed1('0xa8')]===_0x404a28[_0xfed1('0x71')][_0xfed1('0xa9')]){throw new db['Sequelize'][(_0xfed1('0xa4'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x404a28[_0xfed1('0x39')]['role']===_0xfed1('0x37')){if(!_0x404a28['body'][_0xfed1('0xa9')]){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))](_0xfed1('0xaa'));}}else if(_0x404a28['user'][_0xfed1('0x36')]===_0xfed1('0x39')){if(!_0x404a28['body']['newPassword']){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x60dc68[_0xfed1('0x36')]!==_0xfed1('0x3b')){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))](_0xfed1('0x93'));}}else{throw new db[(_0xfed1('0xa3'))]['ValidationError'](_0xfed1('0x93'));}return _0x60dc68;})[_0xfed1('0x34')](handleEntityNotFound(_0x1719b5,null))['then'](function(_0xabce04){return db['Setting'][_0xfed1('0xab')]({'attributes':['id',_0xfed1('0x78'),_0xfed1('0xac'),_0xfed1('0xad')]})[_0xfed1('0x34')](function(_0x31a881){if(_0x31a881[_0xfed1('0x78')])authService[_0xfed1('0x79')](_0x404a28[_0xfed1('0x71')][_0xfed1('0xa9')]);if(!_0x31a881[_0xfed1('0xac')]||!_0xabce04[_0xfed1('0xae')])return _0xabce04;authService['validatePasswordHistory'](_0x404a28[_0xfed1('0x71')][_0xfed1('0xa9')],_0xabce04[_0xfed1('0xae')],_0x31a881[_0xfed1('0xad')]);return _0xabce04;})[_0xfed1('0x34')](saveUpdates({'password':_0x404a28[_0xfed1('0x71')][_0xfed1('0xa9')],'passwordResetAt':_0x404a28['user']['id']==_0x404a28[_0xfed1('0x6d')]['id']?moment():null,'previousPasswords':authService[_0xfed1('0xaf')](_0x404a28[_0xfed1('0x71')][_0xfed1('0xa9')],_0xabce04[_0xfed1('0xae')])},null));})[_0xfed1('0x34')](respondWithResult(_0x1719b5,null))['catch'](handleError(_0x1719b5,null));};exports[_0xfed1('0xb0')]=function(_0x579e1f,_0x22bdb4,_0x1fd5ea){var _0x2036cf=_0x579e1f[_0xfed1('0x71')][_0xfed1('0xb1')];return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x579e1f[_0xfed1('0x6d')]['id']},'attributes':['id',_0xfed1('0x43'),_0xfed1('0x36'),_0xfed1('0xb2'),_0xfed1('0xb3'),'voicePause',_0xfed1('0xb4')]})[_0xfed1('0x34')](handleEntityNotFound(_0x22bdb4,null))[_0xfed1('0x34')](function(_0x573dec){if(_0x573dec){if(!utils[_0xfed1('0xb5')](_0x2036cf)){throw new db['Sequelize'][(_0xfed1('0xa4'))](_0xfed1('0xb6'));}return _0x573dec[_0xfed1('0xb7')+_['capitalize'](_0x2036cf[_0xfed1('0xb8')]())+_0xfed1('0xb9')](_0x579e1f[_0xfed1('0x71')][_0xfed1('0x74')],{'penalty':_0x579e1f[_0xfed1('0x71')][_0xfed1('0xba')]||0x0})[_0xfed1('0xbb')](function(_0x246205){for(var _0x3980dd=0x0;_0x3980dd<_0x579e1f[_0xfed1('0x71')][_0xfed1('0x74')][_0xfed1('0x52')];_0x3980dd+=0x1){var _0x582163={'UserId':_0x579e1f[_0xfed1('0x6d')]['id']};_0x582163[_[_0xfed1('0xbc')](_0x2036cf[_0xfed1('0xb8')]())+_0xfed1('0xbd')]=_0x579e1f[_0xfed1('0x71')][_0xfed1('0x74')][_0x3980dd];socket[_0xfed1('0xbe')](_0xfed1('0x39')+_[_0xfed1('0xbc')](_0x2036cf[_0xfed1('0xb8')]())+_0xfed1('0xbf'),_0x582163);}return _0x246205;})['then'](function(){if(_0x2036cf===_0xfed1('0xc0')){return db[_0xfed1('0xc1')][_0xfed1('0x61')]({'where':{'id':_0x579e1f[_0xfed1('0x71')]['ids']||[]},'raw':!![],'attributes':['id',_0xfed1('0x43')]});}})['then'](function(_0x1a232c){var _0x48e093=_0x573dec[_0xfed1('0x35')]({'plain':!![]});var _0x13a097=[];if(_0x2036cf==='voice'&&_0x48e093[_0xfed1('0x36')]==='agent'&&_0x48e093[_0xfed1('0xb2')]){for(var _0x231b03=0x0;_0x231b03<_0x1a232c[_0xfed1('0x52')];_0x231b03+=0x1){_0x13a097[_0xfed1('0x65')]({'membername':_0x48e093[_0xfed1('0x43')],'UserId':_0x48e093['id'],'queue_name':_0x1a232c[_0x231b03][_0xfed1('0x43')],'VoiceQueueId':_0x1a232c[_0x231b03]['id'],'interface':_[_0xfed1('0x7d')](_0x48e093[_0xfed1('0xb4')])?util[_0xfed1('0xc2')]('SIP/%s',_0x48e093[_0xfed1('0x43')]):_0x48e093[_0xfed1('0xb4')],'paused':_0x48e093['voicePause']||![],'penalty':_0x579e1f[_0xfed1('0x71')][_0xfed1('0xba')]||0x0});}return BPromise[_0xfed1('0x9e')](_0x13a097,function(_0x2d3394){return db[_0xfed1('0xc3')][_0xfed1('0xc4')](_0x2d3394);});}return _0x573dec;});}})['then'](respondWithStatusCode(_0x22bdb4,null))['catch'](handleError(_0x22bdb4,null));};exports['removeQueues']=function(_0x396a89,_0x3050cd,_0x739008){var _0x316e79;return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x396a89[_0xfed1('0x6d')]['id']},'attributes':['id','name',_0xfed1('0x36')]})[_0xfed1('0x34')](handleEntityNotFound(_0x3050cd,null))['then'](function(_0x5be472){if(_0x5be472){_0x316e79=_0x5be472;if(!_0x396a89[_0xfed1('0x4d')][_0xfed1('0xb1')]||!utils[_0xfed1('0xb5')](_0x396a89[_0xfed1('0x4d')][_0xfed1('0xb1')])){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))]('Unknown\x20channel');}return _0x5be472[_0xfed1('0xc5')+_[_0xfed1('0xbc')](_0x396a89[_0xfed1('0x4d')][_0xfed1('0xb1')]['toLowerCase']())+_0xfed1('0xb9')](_0x396a89[_0xfed1('0x4d')][_0xfed1('0x74')]);}})[_0xfed1('0x34')](function(_0x287c37){for(var _0x3bcfff=0x0;_0x3bcfff<_0x396a89[_0xfed1('0x4d')]['ids'][_0xfed1('0x52')];_0x3bcfff+=0x1){var _0x92e5b1={'UserId':_0x396a89[_0xfed1('0x6d')]['id']};_0x92e5b1[_[_0xfed1('0xbc')](_0x396a89[_0xfed1('0x4d')]['channel'][_0xfed1('0xb8')]())+_0xfed1('0xbd')]=_0x396a89['query'][_0xfed1('0x74')][_0x3bcfff];socket['emit'](_0xfed1('0x39')+_[_0xfed1('0xbc')](_0x396a89[_0xfed1('0x4d')][_0xfed1('0xb1')]['toLowerCase']())+_0xfed1('0xc6'),_0x92e5b1);}return _0x287c37;})[_0xfed1('0x34')](function(){if(_0x396a89[_0xfed1('0x4d')][_0xfed1('0xb1')]===_0xfed1('0xc0')){return db['UserVoiceQueueRt'][_0xfed1('0x33')]({'where':{'UserId':_0x396a89[_0xfed1('0x6d')]['id'],'VoiceQueueId':_0x396a89[_0xfed1('0x4d')][_0xfed1('0x74')]},'individualHooks':!![]})[_0xfed1('0x34')](function(){return _0x316e79;});}return _0x316e79;})[_0xfed1('0x34')](respondWithStatusCode(_0x3050cd,null))['catch'](handleError(_0x3050cd,null));};exports[_0xfed1('0xc7')]=function(_0x150457,_0x35e4eb,_0x4da7b5){_0x150457['body'][_0xfed1('0xc8')]=_0x150457['file']['filename'];return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x150457[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x35e4eb,null))[_0xfed1('0x34')](saveUpdates(_0x150457['body'],null))[_0xfed1('0x34')](respondWithResult(_0x35e4eb,null))[_0xfed1('0x28')](handleError(_0x35e4eb,null));};exports[_0xfed1('0xc9')]=function(_0x4017e7,_0x145ce2,_0x2e7610){var _0x459173=path[_0xfed1('0xca')](config[_0xfed1('0xcb')],_0xfed1('0xcc'));return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x4017e7[_0xfed1('0x6d')]['id']},'attributes':['id',_0xfed1('0xc8')],'raw':!![]})[_0xfed1('0x34')](handleEntityNotFound(_0x145ce2,null))[_0xfed1('0x34')](function(_0x15b305){if(_0x15b305){if(_[_0xfed1('0x7d')](_0x15b305[_0xfed1('0xc8')])){return _0x145ce2['download'](_0x459173);}else{if(!fs[_0xfed1('0xcd')](path['join'](config['root'],_0xfed1('0xce'),_0x15b305[_0xfed1('0xc8')]))){return _0x145ce2['download'](_0x459173);}return _0x145ce2[_0xfed1('0xcf')](path['join'](config['root'],_0xfed1('0xce'),_0x15b305[_0xfed1('0xc8')]));}}})[_0xfed1('0x28')](handleError(_0x145ce2,null));};exports['getOpenTabs']=function(_0x5a168e,_0x5df375,_0x381f0d){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x5a168e[_0xfed1('0x6d')]['id']},'attributes':['id']})[_0xfed1('0x34')](handleEntityNotFound(_0x5df375,null))['then'](function(_0x531fcc){var _0xb0da38=[];values=_0x531fcc['dataValues'];_0xb0da38['push'](get_open_tabs(_0xfed1('0x66'),_0x531fcc[_0xfed1('0x67')]));_0xb0da38[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x68'),_0x531fcc['dataValues']));_0xb0da38[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x6b'),_0x531fcc[_0xfed1('0x67')]));_0xb0da38['push'](get_open_tabs(_0xfed1('0x6c'),_0x531fcc[_0xfed1('0x67')]));_0xb0da38[_0xfed1('0x65')](get_open_tabs(_0xfed1('0x69'),_0x531fcc[_0xfed1('0x67')]));_0xb0da38['push'](get_open_tabs(_0xfed1('0x6a'),_0x531fcc[_0xfed1('0x67')]));return BPromise['all'](_0xb0da38);})[_0xfed1('0x34')](function(_0x3302eb){var _0x44fa50=[];if(_0x3302eb){for(var _0x3092bd=0x0;_0x3092bd<values[_0xfed1('0xd0')][_0xfed1('0x52')];_0x3092bd++){var _0x3cdfeb=values[_0xfed1('0xd0')][_0x3092bd];_0x44fa50['push']({'channel':_0xfed1('0xd1'),'id':_0x3cdfeb['id'],'createdAt':_0x3cdfeb[_0xfed1('0xd2')]});}for(var _0x3092bd=0x0;_0x3092bd<values[_0xfed1('0xd3')][_0xfed1('0x52')];_0x3092bd++){var _0x3cdfeb=values['FaxOpenTabs'][_0x3092bd];_0x44fa50[_0xfed1('0x65')]({'channel':'FAX','id':_0x3cdfeb['id'],'createdAt':_0x3cdfeb[_0xfed1('0xd2')]});}for(var _0x3092bd=0x0;_0x3092bd<values[_0xfed1('0xd4')]['length'];_0x3092bd++){var _0x3cdfeb=values[_0xfed1('0xd4')][_0x3092bd];_0x44fa50[_0xfed1('0x65')]({'channel':_0xfed1('0xd5'),'id':_0x3cdfeb['id'],'createdAt':_0x3cdfeb[_0xfed1('0xd2')]});}for(var _0x3092bd=0x0;_0x3092bd<values['MailOpenTabs']['length'];_0x3092bd++){var _0x3cdfeb=values[_0xfed1('0xd6')][_0x3092bd];_0x44fa50[_0xfed1('0x65')]({'channel':'MAIL','id':_0x3cdfeb['id'],'createdAt':_0x3cdfeb[_0xfed1('0xd2')]});}for(var _0x3092bd=0x0;_0x3092bd<values[_0xfed1('0xd7')][_0xfed1('0x52')];_0x3092bd++){var _0x3cdfeb=values[_0xfed1('0xd7')][_0x3092bd];_0x44fa50[_0xfed1('0x65')]({'channel':_0xfed1('0xd8'),'id':_0x3cdfeb['id'],'createdAt':_0x3cdfeb[_0xfed1('0xd2')]});}for(var _0x3092bd=0x0;_0x3092bd<values[_0xfed1('0xd9')][_0xfed1('0x52')];_0x3092bd++){var _0x3cdfeb=values[_0xfed1('0xd9')][_0x3092bd];_0x44fa50['push']({'channel':_0xfed1('0xda'),'id':_0x3cdfeb['id'],'createdAt':_0x3cdfeb[_0xfed1('0xd2')]});}var _0x2f7b78={'count':_0x44fa50['length'],'rows':_0x44fa50};return _0x2f7b78;}else return null;})[_0xfed1('0x34')](respondWithResult(_0x5df375,null))[_0xfed1('0x28')](handleError(_0x5df375,null));};exports[_0xfed1('0xdb')]=function(_0x580f69,_0x2756b9,_0x334150){var _0x5b70a0={};var _0x52b4ef={};var _0xe3e602;var _0x3648b7;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x580f69[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x2756b9,null))[_0xfed1('0x34')](function(_0x2ad483){if(_0x2ad483){_0xe3e602=_0x2ad483;_0x52b4ef[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0xdc')][_0xfed1('0x46')]);_0x52b4ef['query']=_[_0xfed1('0x4e')](_0x580f69[_0xfed1('0x4d')]);_0x52b4ef[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x52b4ef[_0xfed1('0x4a')],_0x52b4ef[_0xfed1('0x4d')]);_0x5b70a0['attributes']=_['intersection'](_0x52b4ef[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x580f69[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x5b70a0[_0xfed1('0x50')]=_0x5b70a0['attributes'][_0xfed1('0x52')]?_0x5b70a0[_0xfed1('0x50')]:_0x52b4ef[_0xfed1('0x4a')];_0x5b70a0[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x580f69['query'][_0xfed1('0x56')]);_0x5b70a0[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x580f69[_0xfed1('0x4d')],_0x52b4ef['filters']));if(_0x580f69[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x5b70a0[_0xfed1('0x57')]=_['merge'](_0x5b70a0['where'],{'$or':_[_0xfed1('0x3e')](_0x5b70a0[_0xfed1('0x50')],function(_0x57997d){var _0x2171f6={};_0x2171f6[_0x57997d]={'$like':'%'+_0x580f69[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x2171f6;})});}_0x5b70a0=_[_0xfed1('0x5a')]({},_0x5b70a0,_0x580f69[_0xfed1('0x5e')]);return _0xe3e602['getContacts'](_0x5b70a0);}})['then'](function(_0x5e8b1b){if(_0x5e8b1b){_0x3648b7=_0x5e8b1b['length'];if(_0x580f69[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x5f'))){_0x5b70a0[_0xfed1('0x60')]=[{'model':db[_0xfed1('0xdd')],'as':_0xfed1('0xde'),'required':![]},{'model':db[_0xfed1('0xdf')],'as':_0xfed1('0xe0'),'attributes':['id',_0xfed1('0x43'),_0xfed1('0xe1')],'where':_0x580f69[_0xfed1('0x4d')][_0xfed1('0xe2')]?{'id':_0x580f69[_0xfed1('0x4d')][_0xfed1('0xe2')]}:undefined,'required':_0x580f69[_0xfed1('0x4d')][_0xfed1('0xe2')]?!![]:![]}];}if(!_0x580f69[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x5b70a0[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x580f69[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x5b70a0[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x580f69[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0xe3e602[_0xfed1('0xdb')](_0x5b70a0);}})[_0xfed1('0x34')](function(_0x5aa6ab){if(_0x5aa6ab){return _0x5aa6ab?{'count':_0x3648b7,'rows':_0x5aa6ab}:null;}})[_0xfed1('0x34')](respondWithResult(_0x2756b9,null))[_0xfed1('0x28')](handleError(_0x2756b9,null));};exports[_0xfed1('0xe3')]=function(_0x198199,_0x1dda4a,_0x3cf713){var _0x2198f1;var _0x25c351;var _0x198c56={};var _0xfa2f82;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x198199[_0xfed1('0x6d')]['id']},'attributes':['id','name',_0xfed1('0x36')]})[_0xfed1('0x34')](handleEntityNotFound(_0x1dda4a,null))['then'](function(_0x5a27dd){if(!utils['isValidChannel'](_0x198199[_0xfed1('0x4d')]['channel'])){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))](_0xfed1('0xb6'));}_0x2198f1=_0x5a27dd;var _0x50807b={};_0x50807b[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_[_0xfed1('0xbc')](_0x198199['query']['channel'])+_0xfed1('0xe4')][_0xfed1('0x46')]);_0x50807b['query']=_['keys'](_0x198199[_0xfed1('0x4d')]);_0x50807b[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x50807b[_0xfed1('0x4a')],_0x50807b[_0xfed1('0x4d')]);_0x198c56[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x50807b['model'],qs[_0xfed1('0x51')](_0x198199[_0xfed1('0x4d')]['fields']));_0x198c56['attributes']=_0x198c56['attributes'][_0xfed1('0x52')]?_0x198c56['attributes']:_0x50807b['model'];_0x198c56[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x198199[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x198c56['where']=qs['filters'](_[_0xfed1('0x59')](_0x198199['query'],_0x50807b[_0xfed1('0x58')]));if(_0x198199['query']['filter']){_0x198c56[_0xfed1('0x57')]=_['merge'](_0x198c56[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x198c56[_0xfed1('0x50')],function(_0x2e9f2b){var _0x2c1321={};_0x2c1321[_0x2e9f2b]={'$like':'%'+_0x198199[_0xfed1('0x4d')]['filter']+'%'};return _0x2c1321;})});}_0x198c56=_[_0xfed1('0x5a')]({},_0x198c56,_0x198199[_0xfed1('0x5e')]);switch(_0x2198f1[_0xfed1('0x36')]){case _0xfed1('0x37'):return db[_[_0xfed1('0xbc')](_0x198199[_0xfed1('0x4d')][_0xfed1('0xb1')])+_0xfed1('0xe4')][_0xfed1('0x61')](_0x198c56);case'user':case _0xfed1('0x3b'):return _0x2198f1[_0xfed1('0x35')+_[_0xfed1('0xbc')](_0x198199[_0xfed1('0x4d')][_0xfed1('0xb1')])+'Queues'](_0x198c56);default:throw new db['Sequelize']['ValidationError'](_0xfed1('0xe5'));}})['then'](function(_0x46767b){_0xfa2f82=_0x46767b['length'];if(!_0x198199[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x198c56['limit']=qs[_0xfed1('0x2c')](_0x198199['query']['limit']);_0x198c56[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x198199['query'][_0xfed1('0x2e')]);}switch(_0x2198f1[_0xfed1('0x36')]){case _0xfed1('0x37'):return db[_['capitalize'](_0x198199[_0xfed1('0x4d')][_0xfed1('0xb1')])+_0xfed1('0xe4')][_0xfed1('0x61')](_0x198c56);case _0xfed1('0x39'):case _0xfed1('0x3b'):return _0x2198f1['get'+_[_0xfed1('0xbc')](_0x198199[_0xfed1('0x4d')][_0xfed1('0xb1')])+_0xfed1('0xb9')](_0x198c56);}})[_0xfed1('0x34')](function(_0x445cd0){return{'count':_0xfa2f82,'rows':_0x445cd0};})[_0xfed1('0x34')](respondWithResult(_0x1dda4a,null))['catch'](handleError(_0x1dda4a,null));};exports[_0xfed1('0xe6')]=function(_0x46ab2d,_0x545781,_0x42674b){var _0x1decb8={};var _0x253654={};var _0x5546ed;var _0x27b97c;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x46ab2d['params']['id']}})['then'](handleEntityNotFound(_0x545781,null))['then'](function(_0x2cef4a){if(_0x2cef4a){_0x5546ed=_0x2cef4a;_0x253654[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0xc3')][_0xfed1('0x46')]);_0x253654[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x46ab2d[_0xfed1('0x4d')]);_0x253654[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x253654[_0xfed1('0x4a')],_0x253654['query']);_0x1decb8[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x253654[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x46ab2d[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x1decb8['attributes']=_0x1decb8['attributes'][_0xfed1('0x52')]?_0x1decb8[_0xfed1('0x50')]:_0x253654[_0xfed1('0x4a')];_0x1decb8[_0xfed1('0x55')]=qs['sort'](_0x46ab2d[_0xfed1('0x4d')]['sort']);_0x1decb8[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x46ab2d[_0xfed1('0x4d')],_0x253654[_0xfed1('0x58')]));if(_0x46ab2d[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x1decb8[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x1decb8[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x1decb8[_0xfed1('0x50')],function(_0x134129){var _0x1e9651={};_0x1e9651[_0x134129]={'$like':'%'+_0x46ab2d[_0xfed1('0x4d')]['filter']+'%'};return _0x1e9651;})});}_0x1decb8=_['merge']({},_0x1decb8,_0x46ab2d['options']);return _0x5546ed['getVoiceQueuesRt'](_0x1decb8);}})[_0xfed1('0x34')](function(_0x324e5f){if(_0x324e5f){_0x27b97c=_0x324e5f['length'];if(!_0x46ab2d[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x1decb8['limit']=qs[_0xfed1('0x2c')](_0x46ab2d[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x1decb8[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x46ab2d[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x5546ed[_0xfed1('0xe6')](_0x1decb8);}})[_0xfed1('0x34')](function(_0x46c1b8){if(_0x46c1b8){return _0x46c1b8?{'count':_0x27b97c,'rows':_0x46c1b8}:null;}})['then'](respondWithResult(_0x545781,null))[_0xfed1('0x28')](handleError(_0x545781,null));};exports[_0xfed1('0xe7')]=function(_0x36d3c5,_0x5eeb1f,_0x586c4c){var _0xfc3eee={};var _0xf3410c={};var _0x47b811;var _0x4a906c;return db[_0xfed1('0x6e')]['findOne']({'where':{'id':_0x36d3c5[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x5eeb1f,null))['then'](function(_0x575b45){if(_0x575b45){_0x47b811=_0x575b45;_0xf3410c['model']=_[_0xfed1('0x4e')](db[_0xfed1('0xe8')]['rawAttributes']);_0xf3410c['query']=_[_0xfed1('0x4e')](_0x36d3c5[_0xfed1('0x4d')]);_0xf3410c[_0xfed1('0x58')]=_['intersection'](_0xf3410c[_0xfed1('0x4a')],_0xf3410c[_0xfed1('0x4d')]);_0xfc3eee[_0xfed1('0x50')]=_['intersection'](_0xf3410c['model'],qs[_0xfed1('0x51')](_0x36d3c5[_0xfed1('0x4d')][_0xfed1('0x51')]));_0xfc3eee['attributes']=_0xfc3eee['attributes'][_0xfed1('0x52')]?_0xfc3eee['attributes']:_0xf3410c[_0xfed1('0x4a')];_0xfc3eee['order']=qs[_0xfed1('0x56')](_0x36d3c5[_0xfed1('0x4d')]['sort']);_0xfc3eee[_0xfed1('0x57')]=qs['filters'](_[_0xfed1('0x59')](_0x36d3c5[_0xfed1('0x4d')],_0xf3410c[_0xfed1('0x58')]));if(_0x36d3c5['query'][_0xfed1('0x3c')]){_0xfc3eee[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0xfc3eee[_0xfed1('0x57')],{'$or':_['map'](_0xfc3eee[_0xfed1('0x50')],function(_0x1b1f79){var _0x2a5b21={};_0x2a5b21[_0x1b1f79]={'$like':'%'+_0x36d3c5[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x2a5b21;})});}_0xfc3eee=_[_0xfed1('0x5a')]({},_0xfc3eee,_0x36d3c5[_0xfed1('0x5e')]);return _0x47b811[_0xfed1('0xe7')](_0xfc3eee);}})[_0xfed1('0x34')](function(_0x15d2f0){if(_0x15d2f0){_0x4a906c=_0x15d2f0['length'];if(!_0x36d3c5[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0xfc3eee[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x36d3c5[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0xfc3eee[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x36d3c5[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x47b811['getGroups'](_0xfc3eee);}})[_0xfed1('0x34')](function(_0x582a28){if(_0x582a28){return _0x582a28?{'count':_0x4a906c,'rows':_0x582a28}:null;}})['then'](respondWithResult(_0x5eeb1f,null))[_0xfed1('0x28')](handleError(_0x5eeb1f,null));};exports[_0xfed1('0xe9')]=function(_0x3db76b,_0x55353e,_0x8bfa5){var _0x2b6300={'raw':!![],'where':{}};var _0x4b474c={};var _0x2e1e93={'count':0x0,'rows':[]};return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x3db76b[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x55353e,null))[_0xfed1('0x34')](function(_0x59c7d5){if(_0x59c7d5){_0x4b474c[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db['VoiceRecording'][_0xfed1('0x46')]);_0x4b474c['query']=_[_0xfed1('0x4e')](_0x3db76b[_0xfed1('0x4d')]);_0x4b474c[_0xfed1('0x58')]=_['intersection'](_0x4b474c['model'],_0x4b474c[_0xfed1('0x4d')]);_0x2b6300['attributes']=_['intersection'](_0x4b474c['model'],qs['fields'](_0x3db76b[_0xfed1('0x4d')]['fields']));_0x2b6300[_0xfed1('0x50')]=_0x2b6300['attributes'][_0xfed1('0x52')]?_0x2b6300[_0xfed1('0x50')]:_0x4b474c['model'];if(!_0x3db76b['query'][_0xfed1('0x53')]('nolimit')){_0x2b6300[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x3db76b[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x2b6300[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x3db76b[_0xfed1('0x4d')][_0xfed1('0x2e')]);}_0x2b6300['order']=qs[_0xfed1('0x56')](_0x3db76b[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x2b6300[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x3db76b['query'],_0x4b474c['filters']));_0x2b6300[_0xfed1('0x57')][_0xfed1('0xea')]=_0x59c7d5['id'];if(_0x3db76b[_0xfed1('0x4d')]['filter']){_0x2b6300[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x2b6300['where'],{'$or':_[_0xfed1('0x3e')](_0x2b6300['attributes'],function(_0x4f8d79){var _0x2e3fa6={};_0x2e3fa6[_0x4f8d79]={'$like':'%'+_0x3db76b[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x2e3fa6;})});}_0x2b6300=_[_0xfed1('0x5a')]({},_0x2b6300,_0x3db76b[_0xfed1('0x5e')]);return db[_0xfed1('0xeb')]['count']({'where':_0x2b6300[_0xfed1('0x57')]})[_0xfed1('0x34')](function(_0x4fcbb1){_0x2e1e93[_0xfed1('0x2d')]=_0x4fcbb1;if(_0x3db76b[_0xfed1('0x4d')][_0xfed1('0x5f')]){_0x2b6300[_0xfed1('0x60')]=[{'all':!![]}];}return db[_0xfed1('0xeb')][_0xfed1('0x61')](_0x2b6300);})[_0xfed1('0x34')](function(_0x207ab6){_0x2e1e93[_0xfed1('0x62')]=_0x207ab6;return _0x2e1e93;});}})['then'](respondWithFilteredResult(_0x55353e,_0x2b6300))[_0xfed1('0x28')](handleError(_0x55353e,null));};exports['getScreenRecordings']=function(_0x52b310,_0x1ff6aa,_0x50cf10){var _0x566d3d={'raw':!![],'where':{}};var _0x1aec29={};var _0x2ce5ca={'count':0x0,'rows':[]};return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x52b310['params']['id']}})['then'](handleEntityNotFound(_0x1ff6aa,null))['then'](function(_0x47110b){if(_0x47110b){_0x1aec29[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db['ScreenRecording']['rawAttributes']);_0x1aec29[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x52b310[_0xfed1('0x4d')]);_0x1aec29[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x1aec29[_0xfed1('0x4a')],_0x1aec29[_0xfed1('0x4d')]);_0x566d3d[_0xfed1('0x50')]=_['intersection'](_0x1aec29['model'],qs[_0xfed1('0x51')](_0x52b310['query'][_0xfed1('0x51')]));_0x566d3d['attributes']=_0x566d3d[_0xfed1('0x50')][_0xfed1('0x52')]?_0x566d3d[_0xfed1('0x50')]:_0x1aec29[_0xfed1('0x4a')];if(!_0x52b310[_0xfed1('0x4d')]['hasOwnProperty'](_0xfed1('0x54'))){_0x566d3d['limit']=qs[_0xfed1('0x2c')](_0x52b310[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x566d3d['offset']=qs[_0xfed1('0x2e')](_0x52b310[_0xfed1('0x4d')][_0xfed1('0x2e')]);}_0x566d3d['order']=qs['sort'](_0x52b310[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x566d3d[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x52b310[_0xfed1('0x4d')],_0x1aec29[_0xfed1('0x58')]));_0x566d3d[_0xfed1('0x57')]['UserId']=_0x47110b['id'];if(_0x52b310[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x566d3d[_0xfed1('0x57')]=_['merge'](_0x566d3d[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x566d3d['attributes'],function(_0xcfc3fe){var _0x16bbbc={};_0x16bbbc[_0xcfc3fe]={'$like':'%'+_0x52b310['query'][_0xfed1('0x3c')]+'%'};return _0x16bbbc;})});}_0x566d3d=_[_0xfed1('0x5a')]({},_0x566d3d,_0x52b310['options']);return db['ScreenRecording'][_0xfed1('0x2d')]({'where':_0x566d3d['where']})['then'](function(_0x235191){_0x2ce5ca[_0xfed1('0x2d')]=_0x235191;if(_0x52b310[_0xfed1('0x4d')][_0xfed1('0x5f')]){_0x566d3d['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x61')](_0x566d3d);})[_0xfed1('0x34')](function(_0x1a6012){_0x2ce5ca[_0xfed1('0x62')]=_0x1a6012;return _0x2ce5ca;});}})[_0xfed1('0x34')](respondWithFilteredResult(_0x1ff6aa,_0x566d3d))[_0xfed1('0x28')](handleError(_0x1ff6aa,null));};exports[_0xfed1('0xec')]=function(_0x2af0c6,_0x7c3197,_0x3899a9){var _0x82529d={};var _0x2f0692={};var _0xce7078;var _0x463fed;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x2af0c6[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x7c3197,null))['then'](function(_0x1b2836){if(_0x1b2836){_0xce7078=_0x1b2836;_0x2f0692['model']=_['keys'](db['ChatInteraction'][_0xfed1('0x46')]);_0x2f0692['query']=_['keys'](_0x2af0c6[_0xfed1('0x4d')]);_0x2f0692[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x2f0692[_0xfed1('0x4a')],_0x2f0692['query']);_0x82529d[_0xfed1('0x50')]=_['intersection'](_0x2f0692[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x2af0c6[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x82529d[_0xfed1('0x50')]=_0x82529d['attributes'][_0xfed1('0x52')]?_0x82529d[_0xfed1('0x50')]:_0x2f0692[_0xfed1('0x4a')];_0x82529d['order']=qs['sort'](_0x2af0c6[_0xfed1('0x4d')]['sort']);_0x82529d[_0xfed1('0x57')]=qs['filters'](_[_0xfed1('0x59')](_0x2af0c6[_0xfed1('0x4d')],_0x2f0692[_0xfed1('0x58')]));if(_0x2af0c6[_0xfed1('0x4d')]['filter']){_0x82529d[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x82529d['where'],{'$or':_[_0xfed1('0x3e')](_0x82529d['attributes'],function(_0x2d6ecf){var _0x3f9edf={};_0x3f9edf[_0x2d6ecf]={'$like':'%'+_0x2af0c6[_0xfed1('0x4d')]['filter']+'%'};return _0x3f9edf;})});}_0x82529d=_[_0xfed1('0x5a')]({},_0x82529d,_0x2af0c6['options']);return _0xce7078[_0xfed1('0xec')](_0x82529d);}})['then'](function(_0x28d48c){if(_0x28d48c){_0x463fed=_0x28d48c[_0xfed1('0x52')];if(!_0x2af0c6[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x82529d['limit']=qs[_0xfed1('0x2c')](_0x2af0c6[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x82529d[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x2af0c6[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0xce7078[_0xfed1('0xec')](_0x82529d);}})[_0xfed1('0x34')](function(_0x3d6e66){if(_0x3d6e66){return _0x3d6e66?{'count':_0x463fed,'rows':_0x3d6e66}:null;}})[_0xfed1('0x34')](respondWithResult(_0x7c3197,null))[_0xfed1('0x28')](handleError(_0x7c3197,null));};exports['getOpenchannelInteractions']=function(_0x4379e7,_0x54848d,_0x307511){var _0x43c00b={};var _0x4008b1={};var _0x22f8ea;var _0x5b326a;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x4379e7[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x54848d,null))['then'](function(_0x4d31fd){if(_0x4d31fd){_0x22f8ea=_0x4d31fd;_0x4008b1[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0xed')][_0xfed1('0x46')]);_0x4008b1[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x4379e7[_0xfed1('0x4d')]);_0x4008b1[_0xfed1('0x58')]=_['intersection'](_0x4008b1[_0xfed1('0x4a')],_0x4008b1[_0xfed1('0x4d')]);_0x43c00b[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x4008b1[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x4379e7[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x43c00b[_0xfed1('0x50')]=_0x43c00b[_0xfed1('0x50')][_0xfed1('0x52')]?_0x43c00b[_0xfed1('0x50')]:_0x4008b1['model'];_0x43c00b['order']=qs[_0xfed1('0x56')](_0x4379e7['query'][_0xfed1('0x56')]);_0x43c00b[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x4379e7['query'],_0x4008b1[_0xfed1('0x58')]));if(_0x4379e7[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x43c00b['where']=_[_0xfed1('0x5a')](_0x43c00b['where'],{'$or':_[_0xfed1('0x3e')](_0x43c00b[_0xfed1('0x50')],function(_0x104430){var _0x37dde5={};_0x37dde5[_0x104430]={'$like':'%'+_0x4379e7[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x37dde5;})});}_0x43c00b=_[_0xfed1('0x5a')]({},_0x43c00b,_0x4379e7[_0xfed1('0x5e')]);return _0x22f8ea[_0xfed1('0xee')](_0x43c00b);}})[_0xfed1('0x34')](function(_0x29480a){if(_0x29480a){_0x5b326a=_0x29480a[_0xfed1('0x52')];if(!_0x4379e7['query'][_0xfed1('0x53')](_0xfed1('0x54'))){_0x43c00b[_0xfed1('0x2c')]=qs['limit'](_0x4379e7[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x43c00b[_0xfed1('0x2e')]=qs['offset'](_0x4379e7[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x22f8ea[_0xfed1('0xee')](_0x43c00b);}})['then'](function(_0x7feb8b){if(_0x7feb8b){return _0x7feb8b?{'count':_0x5b326a,'rows':_0x7feb8b}:null;}})[_0xfed1('0x34')](respondWithResult(_0x54848d,null))[_0xfed1('0x28')](handleError(_0x54848d,null));};exports[_0xfed1('0xef')]=function(_0x21dc27,_0x383253,_0x7ccad9){var _0x5d45e3={'raw':!![],'where':{}};var _0x1e04ea={};var _0x984d56={'count':0x0,'rows':[]};return db[_0xfed1('0x6e')]['findOne']({'where':{'id':_0x21dc27[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x383253,null))[_0xfed1('0x34')](function(_0x85cb9e){if(_0x85cb9e){_0x1e04ea['model']=_['keys'](db[_0xfed1('0xf0')][_0xfed1('0x46')]);_0x1e04ea['query']=_[_0xfed1('0x4e')](_0x21dc27['query']);_0x1e04ea[_0xfed1('0x58')]=_['intersection'](_0x1e04ea['model'],_0x1e04ea[_0xfed1('0x4d')]);_0x5d45e3[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x1e04ea['model'],qs['fields'](_0x21dc27[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x5d45e3[_0xfed1('0x50')]=_0x5d45e3[_0xfed1('0x50')][_0xfed1('0x52')]?_0x5d45e3['attributes']:_0x1e04ea[_0xfed1('0x4a')];if(!_0x21dc27['query']['hasOwnProperty'](_0xfed1('0x54'))){_0x5d45e3['limit']=qs[_0xfed1('0x2c')](_0x21dc27['query'][_0xfed1('0x2c')]);_0x5d45e3[_0xfed1('0x2e')]=qs['offset'](_0x21dc27[_0xfed1('0x4d')][_0xfed1('0x2e')]);}_0x5d45e3['order']=qs[_0xfed1('0x56')](_0x21dc27[_0xfed1('0x4d')]['sort']);_0x5d45e3['where']=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x21dc27[_0xfed1('0x4d')],_0x1e04ea[_0xfed1('0x58')]));_0x5d45e3[_0xfed1('0x57')]['UserId']=_0x85cb9e['id'];if(_0x21dc27[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x5d45e3[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x5d45e3[_0xfed1('0x57')],{'$or':_['map'](_0x5d45e3['attributes'],function(_0x35ab48){var _0x2770b2={};_0x2770b2[_0x35ab48]={'$like':'%'+_0x21dc27['query'][_0xfed1('0x3c')]+'%'};return _0x2770b2;})});}_0x5d45e3=_['merge']({},_0x5d45e3,_0x21dc27[_0xfed1('0x5e')]);return db[_0xfed1('0xf0')][_0xfed1('0x2d')]({'where':_0x5d45e3[_0xfed1('0x57')]})[_0xfed1('0x34')](function(_0x2ce971){_0x984d56['count']=_0x2ce971;if(_0x21dc27[_0xfed1('0x4d')][_0xfed1('0x5f')]){_0x5d45e3['include']=[{'all':!![]}];}return db[_0xfed1('0xf0')]['findAll'](_0x5d45e3);})[_0xfed1('0x34')](function(_0x54594e){_0x984d56[_0xfed1('0x62')]=_0x54594e;return _0x984d56;});}})[_0xfed1('0x34')](respondWithFilteredResult(_0x383253,_0x5d45e3))[_0xfed1('0x28')](handleError(_0x383253,null));};exports[_0xfed1('0xf1')]=function(_0x220965,_0xdc8040,_0xb3b81f){var _0x2b4745={};var _0x10cd5e={};var _0x1e2024;var _0x2945c9;return db['User'][_0xfed1('0xab')]({'where':{'id':_0x220965['params']['id']}})['then'](handleEntityNotFound(_0xdc8040,null))['then'](function(_0x363f33){if(_0x363f33){_0x1e2024=_0x363f33;_0x10cd5e[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db['SmsInteraction']['rawAttributes']);_0x10cd5e[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x220965[_0xfed1('0x4d')]);_0x10cd5e[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x10cd5e[_0xfed1('0x4a')],_0x10cd5e[_0xfed1('0x4d')]);_0x2b4745[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x10cd5e[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x220965[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x2b4745['attributes']=_0x2b4745[_0xfed1('0x50')][_0xfed1('0x52')]?_0x2b4745[_0xfed1('0x50')]:_0x10cd5e[_0xfed1('0x4a')];_0x2b4745[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x220965[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x2b4745['where']=qs['filters'](_[_0xfed1('0x59')](_0x220965[_0xfed1('0x4d')],_0x10cd5e[_0xfed1('0x58')]));if(_0x220965[_0xfed1('0x4d')]['filter']){_0x2b4745['where']=_[_0xfed1('0x5a')](_0x2b4745[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x2b4745[_0xfed1('0x50')],function(_0x47fead){var _0x38e4fb={};_0x38e4fb[_0x47fead]={'$like':'%'+_0x220965['query'][_0xfed1('0x3c')]+'%'};return _0x38e4fb;})});}_0x2b4745=_['merge']({},_0x2b4745,_0x220965[_0xfed1('0x5e')]);return _0x1e2024[_0xfed1('0xf1')](_0x2b4745);}})[_0xfed1('0x34')](function(_0x53bd3f){if(_0x53bd3f){_0x2945c9=_0x53bd3f[_0xfed1('0x52')];if(!_0x220965['query'][_0xfed1('0x53')]('nolimit')){_0x2b4745[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x220965[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x2b4745[_0xfed1('0x2e')]=qs['offset'](_0x220965[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x1e2024[_0xfed1('0xf1')](_0x2b4745);}})[_0xfed1('0x34')](function(_0x4027b3){if(_0x4027b3){return _0x4027b3?{'count':_0x2945c9,'rows':_0x4027b3}:null;}})[_0xfed1('0x34')](respondWithResult(_0xdc8040,null))[_0xfed1('0x28')](handleError(_0xdc8040,null));};exports['getFaxInteractions']=function(_0x800797,_0x59de49,_0x143770){var _0x4527f1={};var _0x467f03={};var _0x51855f;var _0x38ff7d;return db['User']['findOne']({'where':{'id':_0x800797['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x59de49,null))[_0xfed1('0x34')](function(_0x1ceda4){if(_0x1ceda4){_0x51855f=_0x1ceda4;_0x467f03[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0xf2')][_0xfed1('0x46')]);_0x467f03[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x800797['query']);_0x467f03[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x467f03['model'],_0x467f03[_0xfed1('0x4d')]);_0x4527f1[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x467f03['model'],qs['fields'](_0x800797['query'][_0xfed1('0x51')]));_0x4527f1[_0xfed1('0x50')]=_0x4527f1[_0xfed1('0x50')]['length']?_0x4527f1[_0xfed1('0x50')]:_0x467f03[_0xfed1('0x4a')];_0x4527f1[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x800797[_0xfed1('0x4d')]['sort']);_0x4527f1[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x800797[_0xfed1('0x4d')],_0x467f03[_0xfed1('0x58')]));if(_0x800797[_0xfed1('0x4d')]['filter']){_0x4527f1[_0xfed1('0x57')]=_['merge'](_0x4527f1['where'],{'$or':_[_0xfed1('0x3e')](_0x4527f1[_0xfed1('0x50')],function(_0x258d61){var _0x54962b={};_0x54962b[_0x258d61]={'$like':'%'+_0x800797['query'][_0xfed1('0x3c')]+'%'};return _0x54962b;})});}_0x4527f1=_['merge']({},_0x4527f1,_0x800797[_0xfed1('0x5e')]);return _0x51855f['getFaxInteractions'](_0x4527f1);}})['then'](function(_0xe10e40){if(_0xe10e40){_0x38ff7d=_0xe10e40[_0xfed1('0x52')];if(!_0x800797[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x4527f1[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x800797[_0xfed1('0x4d')]['limit']);_0x4527f1[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x800797[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x51855f['getFaxInteractions'](_0x4527f1);}})[_0xfed1('0x34')](function(_0x248815){if(_0x248815){return _0x248815?{'count':_0x38ff7d,'rows':_0x248815}:null;}})[_0xfed1('0x34')](respondWithResult(_0x59de49,null))['catch'](handleError(_0x59de49,null));};exports[_0xfed1('0xf3')]=function(_0x5d2572,_0x4a5464,_0x5a9d61){var _0x4fdec1={};var _0x11ffd2={};var _0x47ed6f;var _0x188af8;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x5d2572[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x4a5464,null))['then'](function(_0x3277cc){if(_0x3277cc){_0x47ed6f=_0x3277cc;_0x11ffd2[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db['WhatsappInteraction'][_0xfed1('0x46')]);_0x11ffd2['query']=_[_0xfed1('0x4e')](_0x5d2572[_0xfed1('0x4d')]);_0x11ffd2['filters']=_[_0xfed1('0x4f')](_0x11ffd2['model'],_0x11ffd2[_0xfed1('0x4d')]);_0x4fdec1[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x11ffd2[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x5d2572['query'][_0xfed1('0x51')]));_0x4fdec1[_0xfed1('0x50')]=_0x4fdec1[_0xfed1('0x50')]['length']?_0x4fdec1[_0xfed1('0x50')]:_0x11ffd2[_0xfed1('0x4a')];_0x4fdec1[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x5d2572[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x4fdec1[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x5d2572[_0xfed1('0x4d')],_0x11ffd2[_0xfed1('0x58')]));if(_0x5d2572[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x4fdec1[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x4fdec1[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x4fdec1[_0xfed1('0x50')],function(_0x12466b){var _0x1afd29={};_0x1afd29[_0x12466b]={'$like':'%'+_0x5d2572[_0xfed1('0x4d')]['filter']+'%'};return _0x1afd29;})});}_0x4fdec1=_[_0xfed1('0x5a')]({},_0x4fdec1,_0x5d2572[_0xfed1('0x5e')]);return _0x47ed6f['getWhatsappInteractions'](_0x4fdec1);}})[_0xfed1('0x34')](function(_0x4535da){if(_0x4535da){_0x188af8=_0x4535da[_0xfed1('0x52')];if(!_0x5d2572[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x4fdec1['limit']=qs[_0xfed1('0x2c')](_0x5d2572[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x4fdec1['offset']=qs[_0xfed1('0x2e')](_0x5d2572[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x47ed6f[_0xfed1('0xf3')](_0x4fdec1);}})['then'](function(_0x5a9556){if(_0x5a9556){return _0x5a9556?{'count':_0x188af8,'rows':_0x5a9556}:null;}})[_0xfed1('0x34')](respondWithResult(_0x4a5464,null))[_0xfed1('0x28')](handleError(_0x4a5464,null));};exports[_0xfed1('0xf4')]=function(_0x19e05c,_0x445a82,_0x36e7c7){var _0x55bf61;var _0x962271;var _0x23d3b5;var _0xb911e=!_[_0xfed1('0x7d')](_0x19e05c[_0xfed1('0x6d')]['id'])?_0x19e05c[_0xfed1('0x6d')]['id']:!_[_0xfed1('0x7d')](_0x19e05c[_0xfed1('0x39')]['id'])?_0x19e05c['user']['id']:null;return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0xb911e,'role':{'$or':[_0xfed1('0x37'),_0xfed1('0x39'),_0xfed1('0x3b')]}},'attributes':['id',_0xfed1('0x43'),_0xfed1('0xf5'),'mobile',_0xfed1('0x36'),_0xfed1('0x7c'),_0xfed1('0xb3')]})['then'](function(_0x2f3c57){if(_0x2f3c57){if(_0x2f3c57[_0xfed1('0x36')]===_0xfed1('0x3b')){_0x55bf61=_0x2f3c57;if(_0x19e05c[_0xfed1('0x71')]['interface']){_0x23d3b5=util[_0xfed1('0xc2')](_0xfed1('0xf6'),_0x55bf61[_0x19e05c[_0xfed1('0x71')][_0xfed1('0xb4')]]);}else if(_0x19e05c[_0xfed1('0x71')][_0xfed1('0xf7')]){_0x23d3b5=util[_0xfed1('0xc2')]('SIP/%s',_0x19e05c[_0xfed1('0x71')][_0xfed1('0xf7')]);}else{_0x23d3b5=util['format']('SIP/%s',_0x55bf61[_0xfed1('0x43')]);}socket['to'](util[_0xfed1('0xc2')](_0xfed1('0xf8'),_0x55bf61[_0xfed1('0x43')]))[_0xfed1('0xbe')](_0xfed1('0xf9'),{'user':{'id':_0x55bf61['id'],'name':_0x55bf61[_0xfed1('0x43')]},'ip':_0x19e05c[_0xfed1('0xfa')][_0xfed1('0xfb')]||_0x19e05c[_0xfed1('0xfc')][_0xfed1('0xfd')]||_0x19e05c[_0xfed1('0xfe')][_0xfed1('0xfd')]||_0x19e05c['connection'][_0xfed1('0xfe')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x55bf61['name']},'individualHooks':!![]});}}else{throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xfed1('0x34')](function(){if(_0x55bf61){return _0x55bf61[_0xfed1('0xff')]({'raw':!![]});}})[_0xfed1('0x34')](function(_0x29e1c4){if(_0x55bf61){var _0x2e5383=[];if(_0x29e1c4){_0x962271=_0x29e1c4;if(_0x962271['length']){for(var _0x4bc2ed=0x0;_0x4bc2ed<_0x962271[_0xfed1('0x52')];_0x4bc2ed++){_0x2e5383[_0xfed1('0x65')]({'membername':_0x55bf61[_0xfed1('0x43')],'UserId':_0x55bf61['id'],'queue_name':_0x962271[_0x4bc2ed][_0xfed1('0x43')],'VoiceQueueId':_0x962271[_0x4bc2ed]['id'],'interface':_0x23d3b5,'paused':_0x55bf61[_0xfed1('0xb3')]||![],'penalty':_0x962271[_0x4bc2ed][_0xfed1('0x100')]||0x0});}return BPromise[_0xfed1('0x9e')](_0x2e5383,function(_0x26244f){return db['UserVoiceQueueRt'][_0xfed1('0xc4')](_0x26244f);});}}}})['then'](function(){if(_0x55bf61){return db[_0xfed1('0x101')][_0xfed1('0x61')]({'where':{'membername':_0x55bf61[_0xfed1('0x43')],'exitAt':null}});}})[_0xfed1('0x34')](function(_0x34c762){if(_0x55bf61){var _0x185b12=[];_0x34c762[_0xfed1('0x102')](function(_0x1481d1){_0x185b12[_0xfed1('0x65')](_0x1481d1['update']({'exitAt':moment()[_0xfed1('0xc2')](_0xfed1('0x103'))}));});return BPromise[_0xfed1('0x70')](_0x185b12);}})['then'](function(){if(_0x55bf61){var _0x2981eb=[];var _0x507295=[];var _0x4e489b=utils['getChannels']();var _0x48ac4c={'membername':_0x55bf61['name'],'interface':_0x23d3b5,'enterAt':moment()['format'](_0xfed1('0x103')),'role':_0x55bf61['role'],'internal':_0x55bf61[_0xfed1('0x7c')]};_0x4e489b[_0xfed1('0x102')](function(_0x296420){_0x2981eb[_0xfed1('0x65')](_[_0xfed1('0x5a')]({'channel':_0x296420,'type':_0xfed1('0x104'),'data1':_0x19e05c[_0xfed1('0x71')][_0xfed1('0x105')],'data2':_0x23d3b5},_0x48ac4c));if(_0x55bf61['loginInPause']){_0x507295['push'](_[_0xfed1('0x5a')]({'channel':_0x296420,'type':_0xfed1('0x106'),'data1':'LOGININPAUSE'},_0x48ac4c));}});return db[_0xfed1('0x101')][_0xfed1('0x9b')](_0x2981eb[_0xfed1('0x107')](_0x507295),{'individualHooks':!![]});}})[_0xfed1('0x34')](function(){if(_0x55bf61){return _0x55bf61[_0xfed1('0x32')]({'online':!![],'lastLoginAt':moment()[_0xfed1('0xc2')](_0xfed1('0x103')),'voicePause':_0x55bf61['loginInPause']||![],'mailPause':_0x55bf61[_0xfed1('0xb3')]||![],'chatPause':_0x55bf61[_0xfed1('0xb3')]||![],'faxPause':_0x55bf61['loginInPause']||![],'smsPause':_0x55bf61[_0xfed1('0xb3')]||![],'openchannelPause':_0x55bf61[_0xfed1('0xb3')]||![],'whatsappPause':_0x55bf61['loginInPause']||![],'pauseType':_0x55bf61[_0xfed1('0xb3')]?_0xfed1('0x108'):null,'interface':_0x23d3b5,'lastPauseAt':moment()[_0xfed1('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xfed1('0x34')](function(_0x27fcd7){if(_0x19e05c['isMiddleware']){return _0x36e7c7();}else{return BPromise[_0xfed1('0x109')](_0x27fcd7)['then'](respondWithResult(_0x445a82,null));}})[_0xfed1('0x28')](handleError(_0x445a82,null));};exports[_0xfed1('0x10a')]=function(_0x2442de,_0x6691c,_0x2b6cfd){var _0xbde7d7;return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x2442de[_0xfed1('0x6d')]['id'],'role':'agent'},'attributes':['id','name',_0xfed1('0x36')]})[_0xfed1('0x34')](handleEntityNotFound(_0x6691c,null))[_0xfed1('0x34')](function(_0x1652fa){if(_0x1652fa){_0xbde7d7=_0x1652fa;return db[_0xfed1('0xc3')]['destroy']({'where':{'membername':_0xbde7d7[_0xfed1('0x43')]},'individualHooks':!![]});}})[_0xfed1('0x34')](function(){return db['MemberReport'][_0xfed1('0x61')]({'where':{'membername':_0xbde7d7[_0xfed1('0x43')],'exitAt':null}});})[_0xfed1('0x34')](function(_0x226af7){var _0xc3084c=[];_0x226af7['forEach'](function(_0x5d960a){_0xc3084c[_0xfed1('0x65')](_0x5d960a[_0xfed1('0x32')]({'exitAt':moment()[_0xfed1('0xc2')](_0xfed1('0x103'))}));});return BPromise[_0xfed1('0x70')](_0xc3084c);})[_0xfed1('0x34')](function(){return _0xbde7d7['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xfed1('0x34')](respondWithResult(_0x6691c,null))['catch'](handleError(_0x6691c,null));};exports['pause']=function(_0x1f5f6d,_0x39f664,_0x53a13f){var _0x525b72;return db[_0xfed1('0xc3')][_0xfed1('0x32')]({'paused':0x1},{'where':{'UserId':_0x1f5f6d[_0xfed1('0x6d')]['id']},'individualHooks':!![]})[_0xfed1('0x34')](function(){return db['User'][_0xfed1('0x6f')]({'where':{'id':_0x1f5f6d[_0xfed1('0x6d')]['id'],'role':'agent'},'attributes':['id',_0xfed1('0x43'),'role',_0xfed1('0x7c'),_0xfed1('0xb4')]});})['then'](handleEntityNotFound(_0x39f664,null))[_0xfed1('0x34')](function(_0x23915b){if(_0x23915b){_0x525b72=_0x23915b;return respondWithRpcPromise(_0xfed1('0x10b'),'pause',{'id':_0x525b72['id'],'name':_0x525b72[_0xfed1('0x43')],'pause':!![]});}})[_0xfed1('0x34')](function(){if(_0x525b72){return db['MemberReport'][_0xfed1('0x61')]({'where':{'membername':_0x525b72['name'],'type':'PAUSE','exitAt':null}});}})[_0xfed1('0x34')](function(_0x5013ef){if(_0x5013ef[_0xfed1('0x52')]){var _0x4ba7e8=moment()[_0xfed1('0xc2')](_0xfed1('0x103'));for(var _0x44ed01=0x0,_0x18881a=_0x5013ef[_0xfed1('0x52')];_0x44ed01<_0x18881a;_0x44ed01++){_0x5013ef[_0x44ed01]['updateAttributes']({'exitAt':_0x4ba7e8});}}})['then'](function(){var _0x3eb204=[];var _0x28f11e=utils['getChannels']();_0x28f11e[_0xfed1('0x102')](function(_0x1098cf){_0x3eb204[_0xfed1('0x65')]({'channel':_0x1098cf,'membername':_0x525b72['name'],'interface':_[_0xfed1('0x7d')](_0x525b72[_0xfed1('0xb4')])?util[_0xfed1('0xc2')]('SIP/%s',_0x525b72['name']):_0x525b72[_0xfed1('0xb4')],'type':_0xfed1('0x106'),'enterAt':moment()['format'](_0xfed1('0x103')),'data1':_0x1f5f6d['body'][_0xfed1('0x48')]||_0xfed1('0x10c'),'role':_0x525b72[_0xfed1('0x36')],'internal':_0x525b72[_0xfed1('0x7c')]});});return db[_0xfed1('0x101')][_0xfed1('0x9b')](_0x3eb204,{'individualHooks':!![]});})[_0xfed1('0x34')](function(){return _0x525b72[_0xfed1('0x32')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1f5f6d[_0xfed1('0x71')][_0xfed1('0x48')]||_0xfed1('0x10c'),'lastPauseAt':moment()[_0xfed1('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xfed1('0x34')](respondWithResult(_0x39f664,null))['catch'](handleError(_0x39f664,null));};exports[_0xfed1('0x10d')]=function(_0x106fba,_0x24642e,_0x4b0e9a){var _0x478396;return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x106fba[_0xfed1('0x6d')]['id']},'attributes':['id',_0xfed1('0x43'),'role',_0xfed1('0x10e'),_0xfed1('0x10f'),_0xfed1('0x110'),_0xfed1('0x111'),_0xfed1('0x112'),_0xfed1('0x113'),_0xfed1('0x114'),_0xfed1('0x115'),'lastPauseAt']})[_0xfed1('0x34')](handleEntityNotFound(_0x24642e,null))[_0xfed1('0x34')](function(_0x2523fc){if(_0x2523fc){_0x478396=_0x2523fc;if(_0x106fba[_0xfed1('0x71')][_0xfed1('0xb1')]&&!utils['isValidChannel'](_0x106fba[_0xfed1('0x71')][_0xfed1('0xb1')])){throw new db[(_0xfed1('0xa3'))][(_0xfed1('0xa4'))]('Unknown\x20channel');}switch(_0x106fba[_0xfed1('0x71')]['channel']){case _0xfed1('0xc0'):return respondWithRpcPromise('QueuePause',_0xfed1('0x10d'),{'id':_0x478396['id'],'name':_0x478396[_0xfed1('0x43')],'pause':![]})[_0xfed1('0x34')](function(){return db[_0xfed1('0xc3')]['update']({'paused':0x0},{'where':{'UserId':_0x478396['id']},'individualHooks':!![]});})[_0xfed1('0x34')](function(){return db['MemberReport'][_0xfed1('0x6f')]({'where':{'channel':_0x106fba['body']['channel'],'membername':_0x478396[_0xfed1('0x43')],'type':_0xfed1('0x106'),'exitAt':null}});})['then'](function(_0x4ab81c){if(_0x4ab81c){return _0x4ab81c[_0xfed1('0x32')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xfed1('0x116')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x478396['update']({'voicePause':![]});});case'mail':case _0xfed1('0x66'):case'fax':case _0xfed1('0x68'):case _0xfed1('0x6c'):case _0xfed1('0x6b'):return db[_0xfed1('0x101')][_0xfed1('0x6f')]({'where':{'channel':_0x106fba[_0xfed1('0x71')][_0xfed1('0xb1')],'membername':_0x478396[_0xfed1('0x43')],'type':_0xfed1('0x106'),'exitAt':null}})['then'](function(_0xe37041){if(_0xe37041){return _0xe37041[_0xfed1('0x32')]({'exitAt':moment()[_0xfed1('0xc2')](_0xfed1('0x103')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xfed1('0x34')](function(){var _0x218e3c={};_[_0xfed1('0x117')](_0x218e3c,util[_0xfed1('0xc2')]('%s%s',_0x106fba[_0xfed1('0x71')]['channel'],'Pause'),![]);return _0x478396[_0xfed1('0x32')](_0x218e3c);});default:return respondWithRpcPromise(_0xfed1('0x10b'),'unpause',{'id':_0x478396['id'],'name':_0x478396[_0xfed1('0x43')],'pause':![]})['then'](function(){return db[_0xfed1('0xc3')][_0xfed1('0x32')]({'paused':0x0},{'where':{'UserId':_0x478396['id']}});})[_0xfed1('0x34')](function(){return db[_0xfed1('0x101')][_0xfed1('0x61')]({'where':{'membername':_0x478396[_0xfed1('0x43')],'type':'PAUSE','exitAt':null}});})[_0xfed1('0x34')](function(_0x41ce91){var _0x1a9848=[];_0x41ce91[_0xfed1('0x102')](function(_0x135f47){_0x1a9848[_0xfed1('0x65')](_0x135f47[_0xfed1('0x32')]({'exitAt':moment()['format'](_0xfed1('0x103')),'data2':_0xfed1('0x116')}));});return BPromise['all'](_0x1a9848);})[_0xfed1('0x34')](function(){return _0x478396[_0xfed1('0x32')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xfed1('0x34')](respondWithResult(_0x24642e,null))['catch'](handleError(_0x24642e,null));};exports['getTeams']=function(_0x5980fe,_0x1b824d,_0x256638){var _0x2f75c6={};var _0x38d9e8={};var _0x106b38;var _0x2e4c2a;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x5980fe[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x1b824d,null))[_0xfed1('0x34')](function(_0x870fd5){if(_0x870fd5){_0x106b38=_0x870fd5;_0x38d9e8[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0x118')][_0xfed1('0x46')]);_0x38d9e8[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x5980fe[_0xfed1('0x4d')]);_0x38d9e8[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x38d9e8[_0xfed1('0x4a')],_0x38d9e8[_0xfed1('0x4d')]);_0x2f75c6[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x38d9e8['model'],qs['fields'](_0x5980fe[_0xfed1('0x4d')]['fields']));_0x2f75c6[_0xfed1('0x50')]=_0x2f75c6[_0xfed1('0x50')][_0xfed1('0x52')]?_0x2f75c6[_0xfed1('0x50')]:_0x38d9e8[_0xfed1('0x4a')];_0x2f75c6['order']=qs['sort'](_0x5980fe['query'][_0xfed1('0x56')]);_0x2f75c6['where']=qs['filters'](_[_0xfed1('0x59')](_0x5980fe[_0xfed1('0x4d')],_0x38d9e8[_0xfed1('0x58')]));if(_0x5980fe[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x2f75c6[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x2f75c6[_0xfed1('0x57')],{'$or':_['map'](_0x2f75c6[_0xfed1('0x50')],function(_0x3129b5){var _0x4e01dd={};_0x4e01dd[_0x3129b5]={'$like':'%'+_0x5980fe['query']['filter']+'%'};return _0x4e01dd;})});}_0x2f75c6=_[_0xfed1('0x5a')]({},_0x2f75c6,_0x5980fe[_0xfed1('0x5e')]);return _0x106b38[_0xfed1('0x119')](_0x2f75c6);}})[_0xfed1('0x34')](function(_0x5abbd2){if(_0x5abbd2){_0x2e4c2a=_0x5abbd2[_0xfed1('0x52')];if(!_0x5980fe[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x2f75c6[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x5980fe[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x2f75c6[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x5980fe[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x106b38[_0xfed1('0x119')](_0x2f75c6);}})[_0xfed1('0x34')](function(_0x2180eb){if(_0x2180eb){return _0x2180eb?{'count':_0x2e4c2a,'rows':_0x2180eb}:null;}})[_0xfed1('0x34')](respondWithResult(_0x1b824d,null))['catch'](handleError(_0x1b824d,null));};exports[_0xfed1('0x11a')]=function(_0x56423b,_0x4290d7){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x56423b[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x4290d7,null))[_0xfed1('0x34')](function(_0x3e4766){if(_0x3e4766){var _0x199d1d=_0x3e4766[_0xfed1('0x35')]({'plain':!![]});return _0x3e4766[_0xfed1('0x11a')](_0x56423b['body'][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x56423b[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{})[_0xfed1('0x34')](function(){for(var _0x40fbd0=0x0;_0x40fbd0<_0x56423b[_0xfed1('0x71')][_0xfed1('0x74')][_0xfed1('0x52')];_0x40fbd0++){var _0x408128=[];db['Team'][_0xfed1('0xab')]({'where':{'id':_0x56423b[_0xfed1('0x71')]['ids'][_0x40fbd0]}})[_0xfed1('0x34')](function(_0x112b61){_0x408128['push'](_0x112b61[_0xfed1('0xff')]()['then'](function(_0x13afe6){for(var _0x109974=0x0;_0x109974<_0x13afe6[_0xfed1('0x52')];_0x109974++){_0x13afe6[_0x109974][_0xfed1('0x11b')](_0xfed1('0xb1'),'Voice');}return _0x13afe6;}));_0x408128[_0xfed1('0x65')](_0x112b61[_0xfed1('0x11c')]()[_0xfed1('0x34')](function(_0x450d1f){for(var _0x33f8a9=0x0;_0x33f8a9<_0x450d1f[_0xfed1('0x52')];_0x33f8a9++){_0x450d1f[_0x33f8a9][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x11d'));}return _0x450d1f;}));_0x408128['push'](_0x112b61[_0xfed1('0x11e')]()[_0xfed1('0x34')](function(_0x185f16){for(var _0x2aa2e4=0x0;_0x2aa2e4<_0x185f16[_0xfed1('0x52')];_0x2aa2e4++){_0x185f16[_0x2aa2e4]['setDataValue'](_0xfed1('0xb1'),_0xfed1('0x11f'));}return _0x185f16;}));_0x408128[_0xfed1('0x65')](_0x112b61[_0xfed1('0x120')]()['then'](function(_0x29f0a6){for(var _0x4fade6=0x0;_0x4fade6<_0x29f0a6['length'];_0x4fade6++){_0x29f0a6[_0x4fade6][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x121'));}return _0x29f0a6;}));_0x408128['push'](_0x112b61[_0xfed1('0x122')]()[_0xfed1('0x34')](function(_0x330f66){for(var _0x41f7bb=0x0;_0x41f7bb<_0x330f66['length'];_0x41f7bb++){_0x330f66[_0x41f7bb]['setDataValue']('channel','Whatsapp');}return _0x330f66;}));_0x408128[_0xfed1('0x65')](_0x112b61[_0xfed1('0x123')]()['then'](function(_0x2d36d6){for(var _0x4a5a3d=0x0;_0x4a5a3d<_0x2d36d6[_0xfed1('0x52')];_0x4a5a3d++){_0x2d36d6[_0x4a5a3d][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x124'));}return _0x2d36d6;}));_0x408128['push'](_0x112b61[_0xfed1('0x125')]()[_0xfed1('0x34')](function(_0x468b3d){for(var _0x17547c=0x0;_0x17547c<_0x468b3d['length'];_0x17547c++){_0x468b3d[_0x17547c][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x126'));}return _0x468b3d;}));return BPromise[_0xfed1('0x70')](_0x408128);})[_0xfed1('0x34')](function(_0x5c1a82){var _0x391458=_[_0xfed1('0x127')](_0x5c1a82);_0x408128=[];return db['sequelize'][_0xfed1('0x128')](function(_0xc4e49){for(var _0x2eff4e=0x0;_0x2eff4e<_0x391458[_0xfed1('0x52')];_0x2eff4e++){_0x408128[_0xfed1('0x65')](_0x391458[_0x2eff4e][_0xfed1('0x129')](_0x199d1d['id']),{'transaction':_0xc4e49});}return BPromise[_0xfed1('0x70')](_0x408128)['then'](function(){if(_0x199d1d[_0xfed1('0xb2')]){return BPromise['each'](_['filter'](_0x391458,function(_0x475b2e){return _0x475b2e[_0xfed1('0x12a')]('channel')===_0xfed1('0x12b');}),function(_0x2a1b3f){return db[_0xfed1('0xc3')]['upsert']({'membername':_0x199d1d['name'],'UserId':_0x199d1d['id'],'queue_name':_0x2a1b3f[_0xfed1('0x43')],'VoiceQueueId':_0x2a1b3f['id'],'interface':_['isNil'](_0x199d1d[_0xfed1('0xb4')])?util['format'](_0xfed1('0x12c'),_0x199d1d[_0xfed1('0x43')]):_0x199d1d[_0xfed1('0xb4')],'paused':_0x199d1d[_0xfed1('0x10e')]||![],'penalty':_0x199d1d['penalty']},{'transaction':_0xc4e49});});}else{return;}})[_0xfed1('0x34')](function(){for(var _0x431136=0x0;_0x431136<_0x391458[_0xfed1('0x52')];_0x431136++){var _0x3badc6=_0x391458[_0x431136][_0xfed1('0x12a')](_0xfed1('0xb1'));var _0x5030b8=_0x3badc6+_0xfed1('0xbd');socket[_0xfed1('0xbe')]('user'+_0x3badc6+_0xfed1('0xbf'),{'UserId':_0x199d1d['id'],['queueField']:_0x391458[_0x431136]['id']});}});});});}});}})[_0xfed1('0x34')](respondWithStatusCode(_0x4290d7,null))[_0xfed1('0x28')](handleError(_0x4290d7,null));};exports[_0xfed1('0x12d')]=function(_0x3ffa7c,_0x10f578){return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x3ffa7c['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x10f578,null))[_0xfed1('0x34')](function(_0x2a83f5){if(_0x2a83f5){var _0x3f68b2=_0x2a83f5[_0xfed1('0x35')]({'plain':!![]});var _0x2787e2=_0x3ffa7c[_0xfed1('0x4d')][_0xfed1('0x74')];return _0x2a83f5[_0xfed1('0x12d')](_0x2787e2)[_0xfed1('0x34')](function(){for(var _0x26b718=0x0;_0x26b718<_0x2787e2['length'];_0x26b718++){var _0x39ae0d=[];db['Team']['findOne']({'where':{'id':_0x2787e2[_0x26b718]}})[_0xfed1('0x34')](function(_0x568f20){_0x39ae0d[_0xfed1('0x65')](_0x568f20['getVoiceQueues']()[_0xfed1('0x34')](function(_0xe3c499){for(var _0x86dd22=0x0;_0x86dd22<_0xe3c499[_0xfed1('0x52')];_0x86dd22++){_0xe3c499[_0x86dd22][_0xfed1('0x11b')](_0xfed1('0xb1'),'Voice');}return _0xe3c499;}));_0x39ae0d[_0xfed1('0x65')](_0x568f20[_0xfed1('0x11c')]()[_0xfed1('0x34')](function(_0x466f53){for(var _0x4aa330=0x0;_0x4aa330<_0x466f53[_0xfed1('0x52')];_0x4aa330++){_0x466f53[_0x4aa330][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x11d'));}return _0x466f53;}));_0x39ae0d[_0xfed1('0x65')](_0x568f20[_0xfed1('0x11e')]()['then'](function(_0x7f5286){for(var _0x46e4ba=0x0;_0x46e4ba<_0x7f5286[_0xfed1('0x52')];_0x46e4ba++){_0x7f5286[_0x46e4ba][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x11f'));}return _0x7f5286;}));_0x39ae0d[_0xfed1('0x65')](_0x568f20[_0xfed1('0x120')]()[_0xfed1('0x34')](function(_0x35c6c3){for(var _0x50f3ab=0x0;_0x50f3ab<_0x35c6c3[_0xfed1('0x52')];_0x50f3ab++){_0x35c6c3[_0x50f3ab][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x121'));}return _0x35c6c3;}));_0x39ae0d[_0xfed1('0x65')](_0x568f20['getWhatsappQueues']()[_0xfed1('0x34')](function(_0x1c2ea3){for(var _0x155b7b=0x0;_0x155b7b<_0x1c2ea3['length'];_0x155b7b++){_0x1c2ea3[_0x155b7b]['setDataValue'](_0xfed1('0xb1'),_0xfed1('0x12e'));}return _0x1c2ea3;}));_0x39ae0d[_0xfed1('0x65')](_0x568f20['getFaxQueues']()[_0xfed1('0x34')](function(_0x180eb7){for(var _0x344169=0x0;_0x344169<_0x180eb7[_0xfed1('0x52')];_0x344169++){_0x180eb7[_0x344169][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x124'));}return _0x180eb7;}));_0x39ae0d[_0xfed1('0x65')](_0x568f20[_0xfed1('0x125')]()[_0xfed1('0x34')](function(_0x4c5beb){for(var _0xb49485=0x0;_0xb49485<_0x4c5beb[_0xfed1('0x52')];_0xb49485++){_0x4c5beb[_0xb49485][_0xfed1('0x11b')](_0xfed1('0xb1'),_0xfed1('0x126'));}return _0x4c5beb;}));return BPromise['all'](_0x39ae0d);})['then'](function(_0x17764e){var _0x51627b=_[_0xfed1('0x127')](_0x17764e);_0x39ae0d=[];return db[_0xfed1('0x5c')][_0xfed1('0x128')](function(_0xe67ce8){for(var _0x343bc2=0x0;_0x343bc2<_0x51627b[_0xfed1('0x52')];_0x343bc2++){_0x39ae0d[_0xfed1('0x65')](_0x51627b[_0x343bc2][_0xfed1('0x12f')](_0x3f68b2['id']),{'transaction':_0xe67ce8});}return BPromise[_0xfed1('0x70')](_0x39ae0d)[_0xfed1('0x34')](function(){if(_0x3f68b2[_0xfed1('0xb2')]){return BPromise[_0xfed1('0x9e')](_[_0xfed1('0x3c')](_0x51627b,function(_0x5318fb){return _0x5318fb[_0xfed1('0x12a')](_0xfed1('0xb1'))===_0xfed1('0x12b');}),function(_0x3d9f3b){return db[_0xfed1('0xc3')][_0xfed1('0x33')]({'where':{'VoiceQueueId':_0x3d9f3b['id'],'UserId':_0x3f68b2['id']},'transaction':_0xe67ce8});});}else{return;}})['then'](function(){for(var _0xebbc42=0x0;_0xebbc42<_0x51627b[_0xfed1('0x52')];_0xebbc42++){var _0x36f734=_0x51627b[_0xebbc42][_0xfed1('0x12a')]('channel');var _0x45e0e3=_0x36f734+'QueueId';socket[_0xfed1('0xbe')]('user'+_0x36f734+_0xfed1('0xc6'),{'UserId':_0x3f68b2['id'],['queueField']:_0x51627b[_0xebbc42]['id']});}});});});}});}})[_0xfed1('0x34')](respondWithStatusCode(_0x10f578,null))[_0xfed1('0x28')](handleError(_0x10f578,null));};exports[_0xfed1('0x130')]=function(_0x4c1db1,_0x48e77e,_0xcd543){var _0x28dfe0={};var _0x3a2dc7={};var _0x4a8310;var _0x27370a;return db['User'][_0xfed1('0xab')]({'where':{'id':_0x4c1db1[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x48e77e,null))['then'](function(_0x20fabb){if(_0x20fabb){_0x4a8310=_0x20fabb;_0x3a2dc7[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0xdd')][_0xfed1('0x46')]);_0x3a2dc7['query']=_[_0xfed1('0x4e')](_0x4c1db1[_0xfed1('0x4d')]);_0x3a2dc7[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x3a2dc7['model'],_0x3a2dc7[_0xfed1('0x4d')]);_0x28dfe0[_0xfed1('0x50')]=_['intersection'](_0x3a2dc7[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x4c1db1[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x28dfe0[_0xfed1('0x50')]=_0x28dfe0['attributes'][_0xfed1('0x52')]?_0x28dfe0[_0xfed1('0x50')]:_0x3a2dc7['model'];_0x28dfe0[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x4c1db1['query'][_0xfed1('0x56')]);_0x28dfe0[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x4c1db1[_0xfed1('0x4d')],_0x3a2dc7['filters']));if(_0x4c1db1[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x28dfe0['where']=_[_0xfed1('0x5a')](_0x28dfe0[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x28dfe0[_0xfed1('0x50')],function(_0x5017f2){var _0x2d966c={};_0x2d966c[_0x5017f2]={'$like':'%'+_0x4c1db1[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x2d966c;})});}_0x28dfe0=_[_0xfed1('0x5a')]({},_0x28dfe0,_0x4c1db1[_0xfed1('0x5e')]);return _0x4a8310['getLists'](_0x28dfe0);}})[_0xfed1('0x34')](function(_0x33245c){if(_0x33245c){_0x27370a=_0x33245c[_0xfed1('0x52')];if(!_0x4c1db1[_0xfed1('0x4d')][_0xfed1('0x53')]('nolimit')){_0x28dfe0[_0xfed1('0x2c')]=qs['limit'](_0x4c1db1[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x28dfe0[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x4c1db1['query'][_0xfed1('0x2e')]);}return _0x4a8310[_0xfed1('0x130')](_0x28dfe0);}})[_0xfed1('0x34')](function(_0x1ecf62){if(_0x1ecf62){return _0x1ecf62?{'count':_0x27370a,'rows':_0x1ecf62}:null;}})[_0xfed1('0x34')](respondWithResult(_0x48e77e,null))[_0xfed1('0x28')](handleError(_0x48e77e,null));};exports[_0xfed1('0x131')]=function(_0x4fd360,_0x5539d8,_0x57e6c7){var _0x2d9492={};var _0x450ffa={};var _0x293e03;var _0x2319e2;return db['User']['findOne']({'where':{'id':_0x4fd360[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x5539d8,null))[_0xfed1('0x34')](function(_0x270a4b){if(_0x270a4b){_0x293e03=_0x270a4b;_0x450ffa['model']=_['keys'](db[_0xfed1('0x6e')][_0xfed1('0x46')]);_0x450ffa[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x4fd360['query']);_0x450ffa[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x450ffa[_0xfed1('0x4a')],_0x450ffa['query']);_0x2d9492[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x450ffa['model'],qs[_0xfed1('0x51')](_0x4fd360[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x2d9492[_0xfed1('0x50')]=_0x2d9492[_0xfed1('0x50')][_0xfed1('0x52')]?_0x2d9492[_0xfed1('0x50')]:_0x450ffa[_0xfed1('0x4a')];_0x2d9492[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x4fd360[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x2d9492[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_['pick'](_0x4fd360[_0xfed1('0x4d')],_0x450ffa[_0xfed1('0x58')]));if(_0x4fd360['query'][_0xfed1('0x3c')]){_0x2d9492[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x2d9492['where'],{'$or':_[_0xfed1('0x3e')](_0x2d9492['attributes'],function(_0xe13702){var _0x3ffabf={};_0x3ffabf[_0xe13702]={'$like':'%'+_0x4fd360['query'][_0xfed1('0x3c')]+'%'};return _0x3ffabf;})});}_0x2d9492[_0xfed1('0x4a')]=db['User'];_0x2d9492['as']='Agents';_0x2d9492=_[_0xfed1('0x5a')]({},_0x2d9492,_0x4fd360[_0xfed1('0x5e')]);return _0x293e03[_0xfed1('0xff')]({'include':[_0x2d9492]});}})[_0xfed1('0x34')](function(_0x249591){if(_0x249591){var _0x389576={},_0x45b4a3=[],_0x50d0a0=0x0;for(var _0x20dd62=0x0;_0x20dd62<_0x249591[_0xfed1('0x52')];_0x20dd62+=0x1){for(var _0x3e600a=0x0,_0x424e39;_0x3e600a<_0x249591[_0x20dd62][_0xfed1('0x3a')][_0xfed1('0x52')];_0x3e600a+=0x1){_0x424e39=_0x249591[_0x20dd62][_0xfed1('0x3a')][_0x3e600a][_0xfed1('0x35')]({'plain':!![]});_0x389576[_0x424e39['id']]=_0x424e39;}}_0x389576=_['values'](_0x389576);for(var _0x539352=qs[_0xfed1('0x2e')](_0x4fd360['query'][_0xfed1('0x2e')]);_0x539352<_0x389576[_0xfed1('0x52')]&&_0x45b4a3['length']<qs['limit'](_0x4fd360['query'][_0xfed1('0x2c')]);_0x539352+=0x1){if(_0x389576[_0x539352]){_0x45b4a3[_0xfed1('0x65')](_0x389576[_0x539352]);}}return{'count':_0x389576['length'],'rows':_0x45b4a3};}})[_0xfed1('0x34')](respondWithResult(_0x5539d8,null))[_0xfed1('0x28')](handleError(_0x5539d8,null));};exports['destroy']=function(_0x5360f5,_0x2ff708){if(_0x5360f5[_0xfed1('0x39')]['id']==_0x5360f5['params']['id']){return _0x2ff708[_0xfed1('0x29')](0x1f4)[_0xfed1('0x44')]({'message':_0xfed1('0x132')});}return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x5360f5['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x2ff708,null))[_0xfed1('0x34')](removeEntity(_0x2ff708,null))['catch'](handleError(_0x2ff708,null));};exports[_0xfed1('0x133')]=function(_0x132732,_0x117fdd,_0x5ddd70){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x132732[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x117fdd,null))[_0xfed1('0x34')](function(_0x15165c){if(_0x15165c){return _0x15165c[_0xfed1('0x133')](_0x132732[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x132732[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{})[_0xfed1('0xbb')](function(){for(var _0x1abfe4=0x0;_0x1abfe4<_0x132732['body']['ids'][_0xfed1('0x52')];_0x1abfe4+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x134'),{'ChatInteractionId':Number(_0x132732[_0xfed1('0x71')]['ids'][_0x1abfe4]),'UserId':Number(_0x132732[_0xfed1('0x6d')]['id'])});}return _0x132732[_0xfed1('0x71')]['ids'];});}})[_0xfed1('0x34')](respondWithResult(_0x117fdd,null))[_0xfed1('0x28')](handleError(_0x117fdd,null));};exports[_0xfed1('0x135')]=function(_0x4f9335,_0x59e9ed,_0x4572ae){return db['User'][_0xfed1('0x6f')]({'where':{'id':_0x4f9335[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x59e9ed,null))['then'](function(_0x30d1ef){if(_0x30d1ef){return _0x30d1ef[_0xfed1('0x135')](_0x4f9335[_0xfed1('0x4d')][_0xfed1('0x74')])['then'](function(){if(_['isArray'](_0x4f9335[_0xfed1('0x4d')][_0xfed1('0x74')])){for(var _0x437771=0x0;_0x437771<_0x4f9335[_0xfed1('0x4d')][_0xfed1('0x74')]['length'];_0x437771+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x136'),{'ChatInteractionId':Number(_0x4f9335['query'][_0xfed1('0x74')][_0x437771]),'UserId':Number(_0x4f9335[_0xfed1('0x6d')]['id'])});}}else{socket[_0xfed1('0xbe')](_0xfed1('0x136'),{'ChatInteractionId':Number(_0x4f9335['query']['ids']),'UserId':Number(_0x4f9335[_0xfed1('0x6d')]['id'])});}});}})[_0xfed1('0x34')](respondWithStatusCode(_0x59e9ed,null))[_0xfed1('0x28')](handleError(_0x59e9ed,null));};exports[_0xfed1('0x137')]=function(_0x37c791,_0x31e7cc,_0x59c006){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x37c791[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x31e7cc,null))[_0xfed1('0x34')](function(_0x32d158){if(_0x32d158){return _0x32d158[_0xfed1('0x137')](_0x37c791[_0xfed1('0x71')][_0xfed1('0x74')],_['omit'](_0x37c791[_0xfed1('0x71')],['ids','id'])||{})[_0xfed1('0xbb')](function(){for(var _0x5b2a01=0x0;_0x5b2a01<_0x37c791['body'][_0xfed1('0x74')]['length'];_0x5b2a01+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x138'),{'MailInteractionId':Number(_0x37c791[_0xfed1('0x71')][_0xfed1('0x74')][_0x5b2a01]),'UserId':Number(_0x37c791[_0xfed1('0x6d')]['id'])});}return _0x37c791[_0xfed1('0x71')][_0xfed1('0x74')];});}})[_0xfed1('0x34')](respondWithResult(_0x31e7cc,null))['catch'](handleError(_0x31e7cc,null));};exports[_0xfed1('0x139')]=function(_0xc8848e,_0x446eb1,_0x304e4f){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0xc8848e[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x446eb1,null))['then'](function(_0x2c3252){if(_0x2c3252){return _0x2c3252[_0xfed1('0x139')](_0xc8848e[_0xfed1('0x4d')][_0xfed1('0x74')])[_0xfed1('0x34')](function(){if(_[_0xfed1('0x13a')](_0xc8848e['query'][_0xfed1('0x74')])){for(var _0xca65a=0x0;_0xca65a<_0xc8848e[_0xfed1('0x4d')]['ids']['length'];_0xca65a+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x13b'),{'MailInteractionId':Number(_0xc8848e['query'][_0xfed1('0x74')][_0xca65a]),'UserId':Number(_0xc8848e[_0xfed1('0x6d')]['id'])});}}else{socket['emit'](_0xfed1('0x13b'),{'MailInteractionId':Number(_0xc8848e[_0xfed1('0x4d')][_0xfed1('0x74')]),'UserId':Number(_0xc8848e['params']['id'])});}});}})['then'](respondWithStatusCode(_0x446eb1,null))[_0xfed1('0x28')](handleError(_0x446eb1,null));};exports[_0xfed1('0x13c')]=function(_0x801860,_0x1c2554,_0x2d3ec7){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x801860[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x1c2554,null))[_0xfed1('0x34')](function(_0x30fcd4){if(_0x30fcd4){return _0x30fcd4[_0xfed1('0x13c')](_0x801860[_0xfed1('0x71')]['ids'],_[_0xfed1('0x75')](_0x801860[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{})['spread'](function(){for(var _0x25a82f=0x0;_0x25a82f<_0x801860[_0xfed1('0x71')][_0xfed1('0x74')]['length'];_0x25a82f+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x13d'),{'FaxInteractionId':Number(_0x801860[_0xfed1('0x71')][_0xfed1('0x74')][_0x25a82f]),'UserId':Number(_0x801860[_0xfed1('0x6d')]['id'])});}return _0x801860['body']['ids'];});}})[_0xfed1('0x34')](respondWithResult(_0x1c2554,null))[_0xfed1('0x28')](handleError(_0x1c2554,null));};exports[_0xfed1('0x13e')]=function(_0x2088f6,_0x3345eb,_0x390b43){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x2088f6[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x3345eb,null))[_0xfed1('0x34')](function(_0x38fc7f){if(_0x38fc7f){return _0x38fc7f[_0xfed1('0x13e')](_0x2088f6[_0xfed1('0x4d')][_0xfed1('0x74')])[_0xfed1('0x34')](function(){if(_[_0xfed1('0x13a')](_0x2088f6[_0xfed1('0x4d')]['ids'])){for(var _0x10ab22=0x0;_0x10ab22<_0x2088f6[_0xfed1('0x4d')][_0xfed1('0x74')][_0xfed1('0x52')];_0x10ab22+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x13f'),{'FaxInteractionId':Number(_0x2088f6[_0xfed1('0x4d')][_0xfed1('0x74')][_0x10ab22]),'UserId':Number(_0x2088f6[_0xfed1('0x6d')]['id'])});}}else{socket[_0xfed1('0xbe')](_0xfed1('0x13f'),{'FaxInteractionId':Number(_0x2088f6[_0xfed1('0x4d')]['ids']),'UserId':Number(_0x2088f6['params']['id'])});}});}})[_0xfed1('0x34')](respondWithStatusCode(_0x3345eb,null))['catch'](handleError(_0x3345eb,null));};exports[_0xfed1('0x140')]=function(_0x31c51f,_0x5747e7,_0x6e7d2f){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x31c51f[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x5747e7,null))[_0xfed1('0x34')](function(_0x23ec52){if(_0x23ec52){return _0x23ec52[_0xfed1('0x140')](_0x31c51f[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x31c51f[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{})[_0xfed1('0xbb')](function(){for(var _0x375af2=0x0;_0x375af2<_0x31c51f[_0xfed1('0x71')][_0xfed1('0x74')][_0xfed1('0x52')];_0x375af2+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x141'),{'SmsInteractionId':Number(_0x31c51f[_0xfed1('0x71')][_0xfed1('0x74')][_0x375af2]),'UserId':Number(_0x31c51f[_0xfed1('0x6d')]['id'])});}return _0x31c51f[_0xfed1('0x71')][_0xfed1('0x74')];});}})[_0xfed1('0x34')](respondWithResult(_0x5747e7,null))[_0xfed1('0x28')](handleError(_0x5747e7,null));};exports[_0xfed1('0x142')]=function(_0x3f0fb8,_0x256d04,_0x5aa8cf){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x3f0fb8[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x256d04,null))[_0xfed1('0x34')](function(_0x5d276a){if(_0x5d276a){return _0x5d276a['removeSmsInteractions'](_0x3f0fb8[_0xfed1('0x4d')]['ids'])[_0xfed1('0x34')](function(){if(_['isArray'](_0x3f0fb8[_0xfed1('0x4d')]['ids'])){for(var _0xfd84d6=0x0;_0xfd84d6<_0x3f0fb8['query'][_0xfed1('0x74')][_0xfed1('0x52')];_0xfd84d6+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x143'),{'SmsInteractionId':Number(_0x3f0fb8[_0xfed1('0x4d')][_0xfed1('0x74')][_0xfd84d6]),'UserId':Number(_0x3f0fb8['params']['id'])});}}else{socket[_0xfed1('0xbe')](_0xfed1('0x143'),{'SmsInteractionId':Number(_0x3f0fb8['query'][_0xfed1('0x74')]),'UserId':Number(_0x3f0fb8[_0xfed1('0x6d')]['id'])});}});}})[_0xfed1('0x34')](respondWithStatusCode(_0x256d04,null))[_0xfed1('0x28')](handleError(_0x256d04,null));};exports['addOpenchannelInteractions']=function(_0x4a1c5a,_0x356c22,_0xb0819e){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x4a1c5a[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x356c22,null))[_0xfed1('0x34')](function(_0x5a412a){if(_0x5a412a){return _0x5a412a['addOpenchannelInteractions'](_0x4a1c5a[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x4a1c5a['body'],[_0xfed1('0x74'),'id'])||{})[_0xfed1('0xbb')](function(){for(var _0x6f525=0x0;_0x6f525<_0x4a1c5a['body'][_0xfed1('0x74')][_0xfed1('0x52')];_0x6f525+=0x1){socket['emit'](_0xfed1('0x144'),{'OpenchannelInteractionId':Number(_0x4a1c5a['body'][_0xfed1('0x74')][_0x6f525]),'UserId':Number(_0x4a1c5a[_0xfed1('0x6d')]['id'])});}return _0x4a1c5a['body'][_0xfed1('0x74')];});}})[_0xfed1('0x34')](respondWithResult(_0x356c22,null))[_0xfed1('0x28')](handleError(_0x356c22,null));};exports[_0xfed1('0x145')]=function(_0x62004d,_0x58e55f,_0x5d38b7){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x62004d[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x58e55f,null))[_0xfed1('0x34')](function(_0x58d7e2){if(_0x58d7e2){return _0x58d7e2[_0xfed1('0x145')](_0x62004d[_0xfed1('0x4d')][_0xfed1('0x74')])[_0xfed1('0x34')](function(){if(_[_0xfed1('0x13a')](_0x62004d[_0xfed1('0x4d')][_0xfed1('0x74')])){for(var _0x1c5f61=0x0;_0x1c5f61<_0x62004d[_0xfed1('0x4d')][_0xfed1('0x74')][_0xfed1('0x52')];_0x1c5f61+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x146'),{'OpenchannelInteractionId':Number(_0x62004d[_0xfed1('0x4d')][_0xfed1('0x74')][_0x1c5f61]),'UserId':Number(_0x62004d[_0xfed1('0x6d')]['id'])});}}else{socket[_0xfed1('0xbe')](_0xfed1('0x146'),{'OpenchannelInteractionId':Number(_0x62004d['query'][_0xfed1('0x74')]),'UserId':Number(_0x62004d['params']['id'])});}});}})[_0xfed1('0x34')](respondWithStatusCode(_0x58e55f,null))['catch'](handleError(_0x58e55f,null));};exports[_0xfed1('0x147')]=function(_0x205414,_0x26d609,_0x5edbac){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x205414[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x26d609,null))[_0xfed1('0x34')](function(_0x49651a){if(_0x49651a){return _0x49651a[_0xfed1('0x147')](_0x205414[_0xfed1('0x71')]['ids'],_[_0xfed1('0x75')](_0x205414[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{})[_0xfed1('0xbb')](function(){for(var _0xc11718=0x0;_0xc11718<_0x205414[_0xfed1('0x71')][_0xfed1('0x74')][_0xfed1('0x52')];_0xc11718+=0x1){socket[_0xfed1('0xbe')](_0xfed1('0x148'),{'WhatsappInteractionId':Number(_0x205414[_0xfed1('0x71')][_0xfed1('0x74')][_0xc11718]),'UserId':Number(_0x205414[_0xfed1('0x6d')]['id'])});}return _0x205414[_0xfed1('0x71')][_0xfed1('0x74')];});}})[_0xfed1('0x34')](respondWithResult(_0x26d609,null))[_0xfed1('0x28')](handleError(_0x26d609,null));};exports['removeWhatsappInteractions']=function(_0x35f638,_0x1de082,_0x8d1fff){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x35f638['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x1de082,null))['then'](function(_0x31138e){if(_0x31138e){return _0x31138e['removeWhatsappInteractions'](_0x35f638['query'][_0xfed1('0x74')]);}})[_0xfed1('0x34')](respondWithStatusCode(_0x1de082,null))[_0xfed1('0x28')](handleError(_0x1de082,null));};exports[_0xfed1('0x149')]=function(_0x394c76,_0x6eee5a,_0x39666f){var _0xc1eaf4={};var _0xf57230={};var _0x193a00;var _0x184d84;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x394c76[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x6eee5a,null))['then'](function(_0x1df69f){if(_0x1df69f){_0x193a00=_0x1df69f;_0xf57230[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0x14a')]['rawAttributes']);_0xf57230[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x394c76[_0xfed1('0x4d')]);_0xf57230[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0xf57230[_0xfed1('0x4a')],_0xf57230[_0xfed1('0x4d')]);_0xc1eaf4[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0xf57230[_0xfed1('0x4a')],qs['fields'](_0x394c76[_0xfed1('0x4d')][_0xfed1('0x51')]));_0xc1eaf4['attributes']=_0xc1eaf4[_0xfed1('0x50')][_0xfed1('0x52')]?_0xc1eaf4['attributes']:_0xf57230[_0xfed1('0x4a')];_0xc1eaf4[_0xfed1('0x55')]=qs['sort'](_0x394c76[_0xfed1('0x4d')][_0xfed1('0x56')]);_0xc1eaf4[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x394c76[_0xfed1('0x4d')],_0xf57230['filters']));if(_0x394c76['query'][_0xfed1('0x3c')]){_0xc1eaf4[_0xfed1('0x57')]=_['merge'](_0xc1eaf4[_0xfed1('0x57')],{'$or':_['map'](_0xc1eaf4['attributes'],function(_0x1840d9){var _0x33d21b={};_0x33d21b[_0x1840d9]={'$like':'%'+_0x394c76[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x33d21b;})});}_0xc1eaf4=_[_0xfed1('0x5a')]({},_0xc1eaf4,_0x394c76[_0xfed1('0x5e')]);return _0x193a00['getVoicePrefixes'](_0xc1eaf4);}})['then'](function(_0x5d1fa2){if(_0x5d1fa2){_0x184d84=_0x5d1fa2['length'];if(!_0x394c76['query'][_0xfed1('0x53')](_0xfed1('0x54'))){_0xc1eaf4['limit']=qs[_0xfed1('0x2c')](_0x394c76[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0xc1eaf4[_0xfed1('0x2e')]=qs['offset'](_0x394c76['query'][_0xfed1('0x2e')]);}return _0x193a00[_0xfed1('0x149')](_0xc1eaf4);}})[_0xfed1('0x34')](function(_0x49463c){if(_0x49463c){return _0x49463c?{'count':_0x184d84,'rows':_0x49463c}:null;}})[_0xfed1('0x34')](respondWithResult(_0x6eee5a,null))[_0xfed1('0x28')](handleError(_0x6eee5a,null));};exports['getFaxAccounts']=function(_0x45da91,_0x171aed,_0x12a870){var _0x1b2764={};var _0x5d8bff={};var _0x3fd75c;var _0x5ae28c;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x45da91[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x171aed,null))[_0xfed1('0x34')](function(_0x1310fb){if(_0x1310fb){_0x3fd75c=_0x1310fb;_0x5d8bff['model']=_[_0xfed1('0x4e')](db[_0xfed1('0x14b')]['rawAttributes']);_0x5d8bff[_0xfed1('0x4d')]=_['keys'](_0x45da91['query']);_0x5d8bff[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x5d8bff[_0xfed1('0x4a')],_0x5d8bff[_0xfed1('0x4d')]);_0x1b2764['attributes']=_[_0xfed1('0x4f')](_0x5d8bff['model'],qs[_0xfed1('0x51')](_0x45da91[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x1b2764[_0xfed1('0x50')]=_0x1b2764['attributes']['length']?_0x1b2764['attributes']:_0x5d8bff[_0xfed1('0x4a')];_0x1b2764[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x45da91[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x1b2764[_0xfed1('0x57')]=qs['filters'](_[_0xfed1('0x59')](_0x45da91[_0xfed1('0x4d')],_0x5d8bff[_0xfed1('0x58')]));if(_0x45da91['query'][_0xfed1('0x3c')]){_0x1b2764[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x1b2764[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x1b2764[_0xfed1('0x50')],function(_0x38342f){var _0x5709f9={};_0x5709f9[_0x38342f]={'$like':'%'+_0x45da91['query'][_0xfed1('0x3c')]+'%'};return _0x5709f9;})});}_0x1b2764=_[_0xfed1('0x5a')]({},_0x1b2764,_0x45da91[_0xfed1('0x5e')]);return _0x3fd75c[_0xfed1('0x14c')](_0x1b2764);}})[_0xfed1('0x34')](function(_0x1e991b){if(_0x1e991b){_0x5ae28c=_0x1e991b['length'];if(!_0x45da91['query'][_0xfed1('0x53')]('nolimit')){_0x1b2764[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x45da91[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x1b2764['offset']=qs[_0xfed1('0x2e')](_0x45da91['query'][_0xfed1('0x2e')]);}return _0x3fd75c['getFaxAccounts'](_0x1b2764);}})[_0xfed1('0x34')](function(_0x3aaba1){if(_0x3aaba1){return _0x3aaba1?{'count':_0x5ae28c,'rows':_0x3aaba1}:null;}})['then'](respondWithResult(_0x171aed,null))[_0xfed1('0x28')](handleError(_0x171aed,null));};exports[_0xfed1('0x14d')]=function(_0x4b04d8,_0x290182,_0x59828b){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x4b04d8[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x290182,null))['then'](function(_0x3b5e88){if(_0x3b5e88){return _0x3b5e88['addFaxAccounts'](_0x4b04d8['body']['ids'],_['omit'](_0x4b04d8['body'],[_0xfed1('0x74'),'id'])||{});}})['then'](respondWithResult(_0x290182,null))['catch'](handleError(_0x290182,null));};exports[_0xfed1('0x14e')]=function(_0xf98115,_0x4cbc43,_0x4bcc62){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0xf98115[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x4cbc43,null))[_0xfed1('0x34')](function(_0x1063e1){if(_0x1063e1){return _0x1063e1['removeFaxAccounts'](_0xf98115['query']['ids']);}})[_0xfed1('0x34')](respondWithStatusCode(_0x4cbc43,null))[_0xfed1('0x28')](handleError(_0x4cbc43,null));};exports[_0xfed1('0x14f')]=function(_0x1f8fd1,_0x67b2a3,_0x5e423d){var _0x5cba85={};var _0x21346a={};var _0x3b7c4c;var _0x32d7d7;return db['User'][_0xfed1('0xab')]({'where':{'id':_0x1f8fd1[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x67b2a3,null))['then'](function(_0x57a798){if(_0x57a798){_0x3b7c4c=_0x57a798;_0x21346a[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0x150')][_0xfed1('0x46')]);_0x21346a[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x1f8fd1['query']);_0x21346a[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x21346a[_0xfed1('0x4a')],_0x21346a['query']);_0x5cba85[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x21346a[_0xfed1('0x4a')],qs['fields'](_0x1f8fd1['query'][_0xfed1('0x51')]));_0x5cba85[_0xfed1('0x50')]=_0x5cba85[_0xfed1('0x50')]['length']?_0x5cba85[_0xfed1('0x50')]:_0x21346a[_0xfed1('0x4a')];_0x5cba85[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x1f8fd1[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x5cba85['where']=qs[_0xfed1('0x58')](_['pick'](_0x1f8fd1[_0xfed1('0x4d')],_0x21346a[_0xfed1('0x58')]));if(_0x1f8fd1[_0xfed1('0x4d')]['filter']){_0x5cba85[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x5cba85[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x5cba85[_0xfed1('0x50')],function(_0x56315f){var _0x533fe0={};_0x533fe0[_0x56315f]={'$like':'%'+_0x1f8fd1['query'][_0xfed1('0x3c')]+'%'};return _0x533fe0;})});}_0x5cba85=_[_0xfed1('0x5a')]({},_0x5cba85,_0x1f8fd1[_0xfed1('0x5e')]);return _0x3b7c4c[_0xfed1('0x14f')](_0x5cba85);}})[_0xfed1('0x34')](function(_0xd86942){if(_0xd86942){_0x32d7d7=_0xd86942[_0xfed1('0x52')];if(!_0x1f8fd1[_0xfed1('0x4d')]['hasOwnProperty'](_0xfed1('0x54'))){_0x5cba85[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x1f8fd1[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x5cba85['offset']=qs['offset'](_0x1f8fd1['query']['offset']);}return _0x3b7c4c['getMailAccounts'](_0x5cba85);}})[_0xfed1('0x34')](function(_0x255e41){if(_0x255e41){return _0x255e41?{'count':_0x32d7d7,'rows':_0x255e41}:null;}})[_0xfed1('0x34')](respondWithResult(_0x67b2a3,null))[_0xfed1('0x28')](handleError(_0x67b2a3,null));};exports[_0xfed1('0x151')]=function(_0x32595c,_0x5c90d3,_0x233379){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x32595c[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x5c90d3,null))['then'](function(_0x1513a2){if(_0x1513a2){return _0x1513a2['addMailAccounts'](_0x32595c[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x32595c[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{});}})[_0xfed1('0x34')](respondWithResult(_0x5c90d3,null))[_0xfed1('0x28')](handleError(_0x5c90d3,null));};exports[_0xfed1('0x152')]=function(_0x1cb03e,_0x4223b6,_0x1d0aac){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x1cb03e[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x4223b6,null))[_0xfed1('0x34')](function(_0x56d548){if(_0x56d548){return _0x56d548[_0xfed1('0x152')](_0x1cb03e['query']['ids']);}})['then'](respondWithStatusCode(_0x4223b6,null))[_0xfed1('0x28')](handleError(_0x4223b6,null));};exports[_0xfed1('0x153')]=function(_0x100e23,_0x3b1581,_0x2c8c6d){var _0x312d04={};var _0x28b91d={};var _0x2387b5;var _0x3ee56f;return db['User']['findOne']({'where':{'id':_0x100e23['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x3b1581,null))['then'](function(_0x453dd5){if(_0x453dd5){_0x2387b5=_0x453dd5;_0x28b91d[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0x154')][_0xfed1('0x46')]);_0x28b91d[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x100e23[_0xfed1('0x4d')]);_0x28b91d[_0xfed1('0x58')]=_['intersection'](_0x28b91d[_0xfed1('0x4a')],_0x28b91d['query']);_0x312d04['attributes']=_[_0xfed1('0x4f')](_0x28b91d[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x100e23['query'][_0xfed1('0x51')]));_0x312d04[_0xfed1('0x50')]=_0x312d04[_0xfed1('0x50')]['length']?_0x312d04['attributes']:_0x28b91d['model'];_0x312d04[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x100e23['query']['sort']);_0x312d04[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_['pick'](_0x100e23[_0xfed1('0x4d')],_0x28b91d[_0xfed1('0x58')]));if(_0x100e23[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x312d04[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x312d04['where'],{'$or':_[_0xfed1('0x3e')](_0x312d04[_0xfed1('0x50')],function(_0x3686ec){var _0x215b1a={};_0x215b1a[_0x3686ec]={'$like':'%'+_0x100e23[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x215b1a;})});}_0x312d04=_[_0xfed1('0x5a')]({},_0x312d04,_0x100e23['options']);return _0x2387b5[_0xfed1('0x153')](_0x312d04);}})[_0xfed1('0x34')](function(_0x23e91f){if(_0x23e91f){_0x3ee56f=_0x23e91f[_0xfed1('0x52')];if(!_0x100e23[_0xfed1('0x4d')]['hasOwnProperty'](_0xfed1('0x54'))){_0x312d04[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x100e23[_0xfed1('0x4d')]['limit']);_0x312d04[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x100e23[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x2387b5[_0xfed1('0x153')](_0x312d04);}})['then'](function(_0x1fdb6b){if(_0x1fdb6b){return _0x1fdb6b?{'count':_0x3ee56f,'rows':_0x1fdb6b}:null;}})[_0xfed1('0x34')](respondWithResult(_0x3b1581,null))[_0xfed1('0x28')](handleError(_0x3b1581,null));};exports[_0xfed1('0x155')]=function(_0x7c61d6,_0x8c198,_0x254edc){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x7c61d6[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x8c198,null))[_0xfed1('0x34')](function(_0x4dfbab){if(_0x4dfbab){return _0x4dfbab[_0xfed1('0x155')](_0x7c61d6['body'][_0xfed1('0x74')],_['omit'](_0x7c61d6[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{});}})[_0xfed1('0x34')](respondWithResult(_0x8c198,null))[_0xfed1('0x28')](handleError(_0x8c198,null));};exports[_0xfed1('0x156')]=function(_0xc29faa,_0x4ffca,_0x38f3d0){return db['User'][_0xfed1('0x6f')]({'where':{'id':_0xc29faa[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4ffca,null))['then'](function(_0xf24150){if(_0xf24150){return _0xf24150[_0xfed1('0x156')](_0xc29faa[_0xfed1('0x4d')][_0xfed1('0x74')]);}})[_0xfed1('0x34')](respondWithStatusCode(_0x4ffca,null))[_0xfed1('0x28')](handleError(_0x4ffca,null));};exports[_0xfed1('0x157')]=function(_0xe74fe3,_0x238127,_0x3ae61b){var _0xae367={};var _0x4fd168={};var _0x231fb4;var _0x1e6c27;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0xe74fe3[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x238127,null))['then'](function(_0x4bc3fe){if(_0x4bc3fe){_0x231fb4=_0x4bc3fe;_0x4fd168[_0xfed1('0x4a')]=_['keys'](db['SmsAccount'][_0xfed1('0x46')]);_0x4fd168['query']=_[_0xfed1('0x4e')](_0xe74fe3['query']);_0x4fd168[_0xfed1('0x58')]=_['intersection'](_0x4fd168['model'],_0x4fd168[_0xfed1('0x4d')]);_0xae367['attributes']=_[_0xfed1('0x4f')](_0x4fd168[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0xe74fe3[_0xfed1('0x4d')][_0xfed1('0x51')]));_0xae367[_0xfed1('0x50')]=_0xae367[_0xfed1('0x50')]['length']?_0xae367[_0xfed1('0x50')]:_0x4fd168[_0xfed1('0x4a')];_0xae367[_0xfed1('0x55')]=qs['sort'](_0xe74fe3[_0xfed1('0x4d')]['sort']);_0xae367[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_['pick'](_0xe74fe3[_0xfed1('0x4d')],_0x4fd168[_0xfed1('0x58')]));if(_0xe74fe3[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0xae367[_0xfed1('0x57')]=_['merge'](_0xae367[_0xfed1('0x57')],{'$or':_['map'](_0xae367[_0xfed1('0x50')],function(_0x4e4948){var _0x96e386={};_0x96e386[_0x4e4948]={'$like':'%'+_0xe74fe3['query']['filter']+'%'};return _0x96e386;})});}_0xae367=_[_0xfed1('0x5a')]({},_0xae367,_0xe74fe3[_0xfed1('0x5e')]);return _0x231fb4[_0xfed1('0x157')](_0xae367);}})[_0xfed1('0x34')](function(_0x219e08){if(_0x219e08){_0x1e6c27=_0x219e08[_0xfed1('0x52')];if(!_0xe74fe3[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0xae367[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0xe74fe3[_0xfed1('0x4d')]['limit']);_0xae367[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0xe74fe3[_0xfed1('0x4d')]['offset']);}return _0x231fb4['getSmsAccounts'](_0xae367);}})[_0xfed1('0x34')](function(_0x9576f8){if(_0x9576f8){return _0x9576f8?{'count':_0x1e6c27,'rows':_0x9576f8}:null;}})[_0xfed1('0x34')](respondWithResult(_0x238127,null))[_0xfed1('0x28')](handleError(_0x238127,null));};exports['addSmsAccounts']=function(_0x4e2ed7,_0xb539a2,_0x2aed2b){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x4e2ed7[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0xb539a2,null))[_0xfed1('0x34')](function(_0x5cd099){if(_0x5cd099){return _0x5cd099[_0xfed1('0x158')](_0x4e2ed7[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x4e2ed7['body'],[_0xfed1('0x74'),'id'])||{});}})[_0xfed1('0x34')](respondWithResult(_0xb539a2,null))[_0xfed1('0x28')](handleError(_0xb539a2,null));};exports[_0xfed1('0x159')]=function(_0x370850,_0x56b892,_0x375e42){return db['User'][_0xfed1('0x6f')]({'where':{'id':_0x370850['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x56b892,null))[_0xfed1('0x34')](function(_0x3959f3){if(_0x3959f3){return _0x3959f3[_0xfed1('0x159')](_0x370850[_0xfed1('0x4d')]['ids']);}})[_0xfed1('0x34')](respondWithStatusCode(_0x56b892,null))[_0xfed1('0x28')](handleError(_0x56b892,null));};exports[_0xfed1('0x15a')]=function(_0x19df2c,_0x30e44d,_0x381e93){var _0x55ec4c={};var _0x4185f5={};var _0x2e91a1;var _0xadf2ce;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x19df2c[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x30e44d,null))[_0xfed1('0x34')](function(_0x35168c){if(_0x35168c){_0x2e91a1=_0x35168c;_0x4185f5['model']=_[_0xfed1('0x4e')](db[_0xfed1('0x15b')]['rawAttributes']);_0x4185f5[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x19df2c['query']);_0x4185f5[_0xfed1('0x58')]=_['intersection'](_0x4185f5[_0xfed1('0x4a')],_0x4185f5[_0xfed1('0x4d')]);_0x55ec4c['attributes']=_['intersection'](_0x4185f5[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x19df2c[_0xfed1('0x4d')][_0xfed1('0x51')]));_0x55ec4c[_0xfed1('0x50')]=_0x55ec4c[_0xfed1('0x50')][_0xfed1('0x52')]?_0x55ec4c[_0xfed1('0x50')]:_0x4185f5['model'];_0x55ec4c[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x19df2c['query'][_0xfed1('0x56')]);_0x55ec4c[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x19df2c[_0xfed1('0x4d')],_0x4185f5[_0xfed1('0x58')]));if(_0x19df2c[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x55ec4c[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x55ec4c['where'],{'$or':_[_0xfed1('0x3e')](_0x55ec4c[_0xfed1('0x50')],function(_0x24e83a){var _0x5a00f5={};_0x5a00f5[_0x24e83a]={'$like':'%'+_0x19df2c[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x5a00f5;})});}_0x55ec4c=_['merge']({},_0x55ec4c,_0x19df2c[_0xfed1('0x5e')]);return _0x2e91a1[_0xfed1('0x15a')](_0x55ec4c);}})['then'](function(_0x269114){if(_0x269114){_0xadf2ce=_0x269114['length'];if(!_0x19df2c[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x55ec4c[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x19df2c[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x55ec4c[_0xfed1('0x2e')]=qs['offset'](_0x19df2c['query'][_0xfed1('0x2e')]);}return _0x2e91a1[_0xfed1('0x15a')](_0x55ec4c);}})[_0xfed1('0x34')](function(_0x44a28e){if(_0x44a28e){return _0x44a28e?{'count':_0xadf2ce,'rows':_0x44a28e}:null;}})['then'](respondWithResult(_0x30e44d,null))[_0xfed1('0x28')](handleError(_0x30e44d,null));};exports[_0xfed1('0x15c')]=function(_0xcd1516,_0x592623,_0x27f1c1){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0xcd1516[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x592623,null))[_0xfed1('0x34')](function(_0x252698){if(_0x252698){return _0x252698[_0xfed1('0x15c')](_0xcd1516[_0xfed1('0x71')][_0xfed1('0x74')],_['omit'](_0xcd1516['body'],[_0xfed1('0x74'),'id'])||{});}})['then'](respondWithResult(_0x592623,null))['catch'](handleError(_0x592623,null));};exports[_0xfed1('0x15d')]=function(_0x186401,_0x817bc4,_0xb2a5a6){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x186401['params']['id']}})['then'](handleEntityNotFound(_0x817bc4,null))['then'](function(_0x41f832){if(_0x41f832){return _0x41f832[_0xfed1('0x15d')](_0x186401['query'][_0xfed1('0x74')]);}})[_0xfed1('0x34')](respondWithStatusCode(_0x817bc4,null))[_0xfed1('0x28')](handleError(_0x817bc4,null));};exports['getWhatsappAccounts']=function(_0x3ace8c,_0x1a5531,_0x4ca59b){var _0x53ad6e={};var _0x59e84a={};var _0x23c027;var _0x26bd96;return db[_0xfed1('0x6e')][_0xfed1('0xab')]({'where':{'id':_0x3ace8c[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x1a5531,null))[_0xfed1('0x34')](function(_0x113eb9){if(_0x113eb9){_0x23c027=_0x113eb9;_0x59e84a[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0x15e')][_0xfed1('0x46')]);_0x59e84a['query']=_[_0xfed1('0x4e')](_0x3ace8c[_0xfed1('0x4d')]);_0x59e84a['filters']=_['intersection'](_0x59e84a['model'],_0x59e84a['query']);_0x53ad6e[_0xfed1('0x50')]=_['intersection'](_0x59e84a[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x3ace8c['query'][_0xfed1('0x51')]));_0x53ad6e[_0xfed1('0x50')]=_0x53ad6e[_0xfed1('0x50')][_0xfed1('0x52')]?_0x53ad6e['attributes']:_0x59e84a['model'];_0x53ad6e[_0xfed1('0x55')]=qs['sort'](_0x3ace8c[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x53ad6e[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x3ace8c['query'],_0x59e84a['filters']));if(_0x3ace8c[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x53ad6e[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x53ad6e[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x53ad6e[_0xfed1('0x50')],function(_0x301bc8){var _0x319012={};_0x319012[_0x301bc8]={'$like':'%'+_0x3ace8c[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x319012;})});}_0x53ad6e=_[_0xfed1('0x5a')]({},_0x53ad6e,_0x3ace8c['options']);return _0x23c027[_0xfed1('0x15f')](_0x53ad6e);}})[_0xfed1('0x34')](function(_0x55a4ae){if(_0x55a4ae){_0x26bd96=_0x55a4ae['length'];if(!_0x3ace8c[_0xfed1('0x4d')][_0xfed1('0x53')]('nolimit')){_0x53ad6e[_0xfed1('0x2c')]=qs['limit'](_0x3ace8c[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x53ad6e[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x3ace8c[_0xfed1('0x4d')]['offset']);}return _0x23c027[_0xfed1('0x15f')](_0x53ad6e);}})[_0xfed1('0x34')](function(_0x27d3e1){if(_0x27d3e1){return _0x27d3e1?{'count':_0x26bd96,'rows':_0x27d3e1}:null;}})[_0xfed1('0x34')](respondWithResult(_0x1a5531,null))[_0xfed1('0x28')](handleError(_0x1a5531,null));};exports['addWhatsappAccounts']=function(_0x5e0b88,_0xcbba13,_0x29ffba){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x5e0b88[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0xcbba13,null))[_0xfed1('0x34')](function(_0x9fbb78){if(_0x9fbb78){return _0x9fbb78[_0xfed1('0x160')](_0x5e0b88[_0xfed1('0x71')][_0xfed1('0x74')],_['omit'](_0x5e0b88[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{});}})[_0xfed1('0x34')](respondWithResult(_0xcbba13,null))[_0xfed1('0x28')](handleError(_0xcbba13,null));};exports[_0xfed1('0x161')]=function(_0x49cd51,_0x44a787,_0x3bf187){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x49cd51[_0xfed1('0x6d')]['id']}})['then'](handleEntityNotFound(_0x44a787,null))[_0xfed1('0x34')](function(_0x20f614){if(_0x20f614){return _0x20f614[_0xfed1('0x161')](_0x49cd51['query'][_0xfed1('0x74')]);}})['then'](respondWithStatusCode(_0x44a787,null))[_0xfed1('0x28')](handleError(_0x44a787,null));};exports[_0xfed1('0x162')]=function(_0x259adf,_0x771094,_0x2a7e39){var _0x4a2d48={};var _0x5f1991={};var _0x326897;var _0x1bcb4e;return db[_0xfed1('0x6e')]['findOne']({'where':{'id':_0x259adf[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x771094,null))[_0xfed1('0x34')](function(_0x21d577){if(_0x21d577){_0x326897=_0x21d577;_0x5f1991[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](db[_0xfed1('0x163')][_0xfed1('0x46')]);_0x5f1991[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x259adf[_0xfed1('0x4d')]);_0x5f1991[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x5f1991['model'],_0x5f1991['query']);_0x4a2d48['attributes']=_[_0xfed1('0x4f')](_0x5f1991[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x259adf['query'][_0xfed1('0x51')]));_0x4a2d48[_0xfed1('0x50')]=_0x4a2d48['attributes'][_0xfed1('0x52')]?_0x4a2d48['attributes']:_0x5f1991['model'];_0x4a2d48[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x259adf[_0xfed1('0x4d')][_0xfed1('0x56')]);_0x4a2d48['where']=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x259adf[_0xfed1('0x4d')],_0x5f1991[_0xfed1('0x58')]));if(_0x259adf[_0xfed1('0x4d')][_0xfed1('0x3c')]){_0x4a2d48[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x4a2d48[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x4a2d48[_0xfed1('0x50')],function(_0x17daf1){var _0x2f82d2={};_0x2f82d2[_0x17daf1]={'$like':'%'+_0x259adf[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x2f82d2;})});}_0x4a2d48=_['merge']({},_0x4a2d48,_0x259adf[_0xfed1('0x5e')]);return _0x326897[_0xfed1('0x162')](_0x4a2d48);}})[_0xfed1('0x34')](function(_0x410ab6){if(_0x410ab6){_0x1bcb4e=_0x410ab6[_0xfed1('0x52')];if(!_0x259adf[_0xfed1('0x4d')]['hasOwnProperty']('nolimit')){_0x4a2d48[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x259adf[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x4a2d48[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x259adf[_0xfed1('0x4d')][_0xfed1('0x2e')]);}return _0x326897['getSquareProjects'](_0x4a2d48);}})[_0xfed1('0x34')](function(_0x1a9aa8){if(_0x1a9aa8){return _0x1a9aa8?{'count':_0x1bcb4e,'rows':_0x1a9aa8}:null;}})[_0xfed1('0x34')](respondWithResult(_0x771094,null))[_0xfed1('0x28')](handleError(_0x771094,null));};exports[_0xfed1('0x164')]=function(_0x900e86,_0x2943c6,_0x5ac644){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x900e86['params']['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x2943c6,null))[_0xfed1('0x34')](function(_0x400f7f){if(_0x400f7f){return _0x400f7f[_0xfed1('0x164')](_0x900e86[_0xfed1('0x71')][_0xfed1('0x74')],_[_0xfed1('0x75')](_0x900e86[_0xfed1('0x71')],[_0xfed1('0x74'),'id'])||{});}})[_0xfed1('0x34')](respondWithResult(_0x2943c6,null))[_0xfed1('0x28')](handleError(_0x2943c6,null));};exports[_0xfed1('0x165')]=function(_0x34e231,_0x2e61de,_0x579b4f){return db[_0xfed1('0x6e')]['find']({'where':{'id':_0x34e231['params']['id']}})['then'](handleEntityNotFound(_0x2e61de,null))[_0xfed1('0x34')](function(_0x358bcc){if(_0x358bcc){return _0x358bcc[_0xfed1('0x165')](_0x34e231[_0xfed1('0x4d')][_0xfed1('0x74')]);}})[_0xfed1('0x34')](respondWithStatusCode(_0x2e61de,null))[_0xfed1('0x28')](handleError(_0x2e61de,null));};exports['getScheduledCalls']=function(_0x243105,_0x117661){var _0x38b2e3={},_0x12060e={},_0x23977a={'count':0x0,'rows':[]};var _0x3e4bae=db[_0xfed1('0x166')][_0xfed1('0x46')];_0x12060e[_0xfed1('0x4a')]=_[_0xfed1('0x4e')](_0x3e4bae);_0x12060e[_0xfed1('0x4d')]=_[_0xfed1('0x4e')](_0x243105['query']);_0x12060e[_0xfed1('0x58')]=_[_0xfed1('0x4f')](_0x12060e[_0xfed1('0x4a')],_0x12060e[_0xfed1('0x4d')]);_0x12060e[_0xfed1('0x58')]=_['concat'](_0x12060e[_0xfed1('0x58')],['$and',_0xfed1('0x167'),_0xfed1('0x168'),'$gte',_0xfed1('0x169'),_0xfed1('0x16a'),_0xfed1('0x16b'),_0xfed1('0x16c'),'$not',_0xfed1('0x16d'),_0xfed1('0x16e'),_0xfed1('0x16f'),_0xfed1('0x170'),'$like','$notLike',_0xfed1('0x171'),_0xfed1('0x172'),_0xfed1('0x173'),_0xfed1('0x174'),_0xfed1('0x175'),_0xfed1('0x176'),'$any']);_0x38b2e3[_0xfed1('0x50')]=_[_0xfed1('0x4f')](_0x12060e[_0xfed1('0x4a')],qs[_0xfed1('0x51')](_0x243105['query'][_0xfed1('0x51')]));_0x38b2e3[_0xfed1('0x50')]=_0x38b2e3[_0xfed1('0x50')]['length']?_0x38b2e3['attributes']:_0x12060e[_0xfed1('0x4a')];if(!_0x243105[_0xfed1('0x4d')][_0xfed1('0x53')](_0xfed1('0x54'))){_0x38b2e3[_0xfed1('0x2c')]=qs['limit'](_0x243105[_0xfed1('0x4d')][_0xfed1('0x2c')]);_0x38b2e3[_0xfed1('0x2e')]=qs[_0xfed1('0x2e')](_0x243105[_0xfed1('0x4d')][_0xfed1('0x2e')]);}_0x38b2e3[_0xfed1('0x55')]=qs[_0xfed1('0x56')](_0x243105['query'][_0xfed1('0x56')]);_0x38b2e3[_0xfed1('0x57')]=qs[_0xfed1('0x58')](_[_0xfed1('0x59')](_0x243105[_0xfed1('0x4d')],_0x12060e[_0xfed1('0x58')]));if(_0x243105['query'][_0xfed1('0x3c')]){_0x38b2e3[_0xfed1('0x57')]=_[_0xfed1('0x5a')](_0x38b2e3[_0xfed1('0x57')],{'$or':_[_0xfed1('0x3e')](_0x38b2e3['attributes'],function(_0x412e85){var _0x53f3b8={};_0x53f3b8[_0x412e85]={'$like':'%'+_0x243105[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'};return _0x53f3b8;})});}_0x38b2e3[_0xfed1('0x57')]={'$and':[_0x38b2e3[_0xfed1('0x57')],{'$or':[{'UserId':_0x243105[_0xfed1('0x6d')]['id']},{'OwnerId':_0x243105[_0xfed1('0x6d')]['id']}]}]};_0x38b2e3=_['merge']({},_0x38b2e3,_0x243105['options']);var _0x1e49bf={'where':_0x38b2e3[_0xfed1('0x57')]};return db[_0xfed1('0x166')]['count'](_0x1e49bf)['then'](function(_0x496f76){_0x23977a['count']=_0x496f76;if(_0x243105['query'][_0xfed1('0x5f')]){_0x38b2e3[_0xfed1('0x60')]=[{'attributes':['id',_0xfed1('0x177'),'lastName','phone'],'model':db['CmContact'],'as':_0xfed1('0x178')},{'attributes':['id','name',_0xfed1('0x179')],'model':db[_0xfed1('0xc1')],'as':_0xfed1('0xe4')}];}return db[_0xfed1('0x166')][_0xfed1('0x61')](_0x38b2e3);})[_0xfed1('0x34')](function(_0x187913){_0x23977a[_0xfed1('0x62')]=_0x187913;return _0x23977a;})[_0xfed1('0x34')](respondWithFilteredResult(_0x117661,_0x38b2e3))[_0xfed1('0x28')](handleError(_0x117661,null));};exports[_0xfed1('0x17a')]=function(_0x2bcad0,_0x21a3d6,_0x3b47e0){if(!_['isNil'](_0x2bcad0[_0xfed1('0x39')]['id'])&&(_0x2bcad0[_0xfed1('0x39')][_0xfed1('0x36')]=='admin'||_0x2bcad0[_0xfed1('0x39')]['role']=='user')){return db['User'][_0xfed1('0xab')]({'where':{'id':_0x2bcad0[_0xfed1('0x6d')]['id']},'raw':!![]})[_0xfed1('0x34')](function(_0x36fb58){return authService['retrieveApiKey'](_0x36fb58);})['then'](function(_0x2af1fb){if(_0x2af1fb){return _0x21a3d6[_0xfed1('0x29')](0xc8)['json']({'api_key':_0x2af1fb['token']});}else{return _0x21a3d6[_0xfed1('0x29')](0xcc)[_0xfed1('0x2f')]({'message':_0xfed1('0x17b')});}})[_0xfed1('0x28')](handleError(_0x21a3d6,0x193));}else{return _0x21a3d6['status'](0x191)['json']({'message':_0xfed1('0x17c')});}};exports[_0xfed1('0x17d')]=function(_0x4be7d5,_0x60d52e,_0x27b1ab){if(!_[_0xfed1('0x7d')](_0x4be7d5['user']['id'])&&(_0x4be7d5[_0xfed1('0x39')][_0xfed1('0x36')]=='admin'||_0x4be7d5[_0xfed1('0x39')][_0xfed1('0x36')]==_0xfed1('0x39'))){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x4be7d5[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](function(_0x166088){return authService[_0xfed1('0x17e')](_0x166088);})['then'](function(_0x5d4820){return db[_0xfed1('0x6e')]['update']({'apiKeyIat':_0x5d4820[_0xfed1('0x17f')],'apiKeyNonce':_0x5d4820[_0xfed1('0x180')]},{'where':{'id':_0x4be7d5[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](function(){return _0x60d52e[_0xfed1('0x29')](0xc8)[_0xfed1('0x2f')]({'api_key':_0x5d4820['token']});});})['catch'](handleError(_0x60d52e,0x193));}else{return _0x60d52e[_0xfed1('0x29')](0x191)[_0xfed1('0x2f')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xfed1('0x181')]=function(_0x284061,_0x3b8313,_0x4157ee){if(!_['isNil'](_0x284061['user']['id'])&&(_0x284061[_0xfed1('0x39')]['role']==_0xfed1('0x37')||_0x284061[_0xfed1('0x39')][_0xfed1('0x36')]==_0xfed1('0x39'))){return db[_0xfed1('0x6e')][_0xfed1('0x6f')]({'where':{'id':_0x284061[_0xfed1('0x6d')]['id']}})[_0xfed1('0x34')](handleEntityNotFound(_0x3b8313,null))[_0xfed1('0x34')](function(_0x3683e2){if(_0x3683e2&&_0x3683e2[_0xfed1('0x182')]&&_0x3683e2[_0xfed1('0x183')])return _0x3683e2;else throw{'message':'API\x20key\x20not\x20available'};})['then'](function(_0x23aee8){return db['User'][_0xfed1('0x32')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x284061[_0xfed1('0x6d')]['id']}});})['then'](respondWithStatusCode(_0x3b8313,0xc8))[_0xfed1('0x28')](handleError(_0x3b8313,0x193));}else{return _0x3b8313[_0xfed1('0x29')](0x191)[_0xfed1('0x2f')]({'message':_0xfed1('0x17c')});}};exports['whoami']=function(_0x192725,_0x5c0733){var _0x1990a3=_0x192725[_0xfed1('0x39')][_0xfed1('0x35')]({'plain':!![]});if(!_0x1990a3){return _0x5c0733[_0xfed1('0x29')](0x191)[_0xfed1('0x44')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{return _0x5c0733[_0xfed1('0x29')](0xc8)['json'](_0x1990a3);}};exports[_0xfed1('0x184')]=function(_0x21363a,_0x2b030a){var _0x3385a1={'offset':0x0},_0x240179={'count':0x0,'rows':[]};Promise[_0xfed1('0x109')]()[_0xfed1('0x34')](function(){if(!_0x21363a[_0xfed1('0x4d')][_0xfed1('0x3c')]&&!_0x21363a[_0xfed1('0x4d')][_0xfed1('0x185')]&&!_0x21363a[_0xfed1('0x4d')][_0xfed1('0x186')])return[];return Promise['resolve']()[_0xfed1('0x34')](function(){var _0x591965=[];if(!_[_0xfed1('0xa0')](_0x21363a[_0xfed1('0x4d')]['teams'])){_0x591965[_0xfed1('0x65')](db[_0xfed1('0x118')][_0xfed1('0x61')]({'attributes':['id',_0xfed1('0x43')],'where':{'id':_0x21363a[_0xfed1('0x4d')][_0xfed1('0x185')]}}));}if(!_[_0xfed1('0xa0')](_0x21363a[_0xfed1('0x4d')][_0xfed1('0x186')])){_0x591965['push'](db[_0xfed1('0xc1')][_0xfed1('0x61')]({'attributes':['id',_0xfed1('0x43')],'type':_0xfed1('0x187'),'where':{'id':_0x21363a[_0xfed1('0x4d')][_0xfed1('0x186')]}}));}return Promise[_0xfed1('0x70')](_0x591965);})['then'](function(_0x8f22d6){var _0x4a7b36=_[_0xfed1('0x127')](_0x8f22d6)['map'](function(_0x3dc6f4){return _0x3dc6f4[_0xfed1('0x131')]({'attributes':['id',_0xfed1('0x43'),_0xfed1('0x7c'),_0xfed1('0xb2')],'raw':!![]});});return Promise[_0xfed1('0x70')](_0x4a7b36);})[_0xfed1('0x34')](function(_0x4a5c03){var _0x39b410=_[_0xfed1('0x127')](_0x4a5c03);if(!_0x21363a['query'][_0xfed1('0x3c')])return _0x39b410;if(_[_0xfed1('0xa0')](_0x39b410)){return db['User'][_0xfed1('0x61')]({'attributes':['id',_0xfed1('0x43'),_0xfed1('0x7c'),_0xfed1('0xb2')],'where':{'role':'agent','$or':[db[_0xfed1('0x5c')]['where'](db[_0xfed1('0x5c')]['fn'](_0xfed1('0x5d'),db[_0xfed1('0x5c')][_0xfed1('0x188')](_0xfed1('0x43'))),{'$like':'%'+_0x21363a[_0xfed1('0x4d')]['filter']['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x21363a[_0xfed1('0x4d')][_0xfed1('0x3c')]+'%'}}]},'raw':!![]});}else{return _(_0x39b410)[_0xfed1('0x127')]()[_0xfed1('0x3c')](function(_0x29394e){return _0x29394e[_0xfed1('0x43')][_0xfed1('0xb8')]()[_0xfed1('0x40')](_0x21363a[_0xfed1('0x4d')][_0xfed1('0x3c')][_0xfed1('0xb8')]())||_0x29394e[_0xfed1('0x7c')][_0xfed1('0x189')]()['includes'](_0x21363a[_0xfed1('0x4d')][_0xfed1('0x3c')]);})[_0xfed1('0x3f')]();}})['then'](function(_0x4c12a0){var _0x584cdb=_0xfed1('0x43');var _0x2b7b12=_0xfed1('0x18a');if(_0x21363a[_0xfed1('0x4d')][_0xfed1('0x56')]){var _0x2b7b12=_0x21363a[_0xfed1('0x4d')][_0xfed1('0x56')][0x0]==='-'?_0xfed1('0x18b'):_0xfed1('0x18a');var _0x584cdb=_0x2b7b12===_0xfed1('0x18a')?_0x21363a[_0xfed1('0x4d')][_0xfed1('0x56')]:_0x21363a['query']['sort'][_0xfed1('0x18c')](0x1);}return _(_0x4c12a0)[_0xfed1('0x18d')]('id')['orderBy']([function(_0x141dd6){return _0x584cdb===_0xfed1('0x43')?_0x141dd6[_0x584cdb][_0xfed1('0xb8')]():_0x141dd6[_0x584cdb];}],[_0x2b7b12])[_0xfed1('0x3e')](function(_0x1a8c8d){return _['pick'](_0x1a8c8d,['id','name',_0xfed1('0x7c'),_0xfed1('0xb2')]);})[_0xfed1('0x3f')]();})[_0xfed1('0x34')](function(_0x1ef1a8){return client[_0xfed1('0x1f')](_0xfed1('0x3a'),_0x21363a)[_0xfed1('0x34')](function(_0x4dc078){if(_0x4dc078[_0xfed1('0x23')])throw new Error(_0xfed1('0x18e'));var _0x1e2b18=_0x4dc078[_0xfed1('0x27')];var _0x46b444=jayson[_0xfed1('0x18f')][_0xfed1('0x1e')]({'port':0x232c});return _0x46b444[_0xfed1('0x1f')](_0xfed1('0x3a'),_0x21363a)[_0xfed1('0x34')](function(_0x46d894){if(_0x46d894['error'])throw new Error(_0xfed1('0x190'));var _0x46a542=_0x46d894[_0xfed1('0x27')];return _[_0xfed1('0x5a')]({},_0x46a542,_0x1e2b18);});})[_0xfed1('0x34')](function(_0x3b095e){return _[_0xfed1('0x3e')](_0x1ef1a8,function(_0xf975b2){var _0x4fbc4c=_['find'](_0x3b095e[_0xfed1('0x62')],['id',_0xf975b2['id']]);if(!_0x4fbc4c||!_0xf975b2[_0xfed1('0xb2')]){_0xf975b2[_0xfed1('0x29')]=_0xfed1('0x191');}else if(_0x4fbc4c[_0xfed1('0x10e')]){_0xf975b2['status']=_0xfed1('0x192');}else{_0xf975b2[_0xfed1('0x29')]=_[_0xfed1('0x40')]([_0xfed1('0x193'),_0xfed1('0x194'),_0xfed1('0x195'),_0xfed1('0x196'),null,undefined],_0x4fbc4c[_0xfed1('0x197')])?_0xfed1('0xb2'):'busy';}return _0xf975b2;});});});})[_0xfed1('0x34')](function(_0x28796d){if(!_0x21363a[_0xfed1('0x4d')][_0xfed1('0x53')]('nolimit')){_0x3385a1[_0xfed1('0x2c')]=qs[_0xfed1('0x2c')](_0x21363a['query']['limit']||0xa);_0x3385a1[_0xfed1('0x2e')]=qs['offset'](_0x21363a[_0xfed1('0x4d')]['offset']);}_0x240179['count']=_0x28796d[_0xfed1('0x52')];_0x240179[_0xfed1('0x62')]=_0x3385a1[_0xfed1('0x2c')]?_0x28796d[_0xfed1('0x198')](_0x3385a1[_0xfed1('0x2e')],_0x3385a1[_0xfed1('0x2e')]+_0x3385a1[_0xfed1('0x2c')]):_0x28796d;return _0x240179;})[_0xfed1('0x34')](respondWithFilteredResult(_0x2b030a,_0x3385a1))[_0xfed1('0x28')](handleError(_0x2b030a,null));};function get_open_tabs(_0x51c03e,_0x5b9104){var _0x3ca040=_0x51c03e[_0xfed1('0x199')](0x0)[_0xfed1('0x19a')]()+_0x51c03e[_0xfed1('0x198')](0x1);var _0x25cefb={'type':db[_0xfed1('0xa3')][_0xfed1('0x19b')][_0xfed1('0x19c')],'raw':!![]};return new BPromise(function(_0x11ef52,_0x5c748f){var _0x2e7afe=squel[_0xfed1('0x19d')]()['field'](_0xfed1('0x19e')+_0x3ca040+_0xfed1('0x19f'),'id')[_0xfed1('0x1a0')]('ui.createdAt')[_0xfed1('0x80')](_0xfed1('0x1a1')+_0x51c03e+_0xfed1('0x1a2'),'ui')[_0xfed1('0x57')]('ui.UserId\x20=\x20?',_0x5b9104['id']);return db['sequelize'][_0xfed1('0x4d')](_0x2e7afe[_0xfed1('0x189')](),_0x25cefb)[_0xfed1('0x34')](function(_0x59f9aa){_0x5b9104[_0x3ca040+_0xfed1('0x1a3')]=_0x59f9aa;_0x11ef52(_0x59f9aa);})[_0xfed1('0x28')](function(_0x50def4){_0x5c748f(_0x50def4);});});};
\ No newline at end of file
+var _0x54ef=['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','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','interface','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','upsert','removeQueues','Unknown\x20channel','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmList','Tag','color','tag','getQueues','isValidChannel','Queue','get','Unknown\x20role','getVoiceQueuesRt','UserVoiceQueueRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','LOGININPAUSE','MemberReport','bulkCreate','concat','isMiddleware','resolve','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','whatsapp','%s%s','Pause','Team','getTeams','addTeams','setDataValue','Voice','Chat','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','addAgent','getDataValue','removeTeams','getChatQueues','getMailQueues','Openchannel','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','addFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$gte','$lt','$eq','$not','$between','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','col','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','slice','charAt','select','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','admin','Agents','agent','Telephones','filter','map','value','includes','role','name','UserProfileResource','stack','User','rawAttributes','fieldName','type','key','model','differenceBy','password','salt','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','sequelize','lower','options','includeAll','include','findAll','rows','openTabs','true','push','chat','dataValues','openchannel','show','params','intersection','sms','fax','mail','all','update','body','describe','addContacts','find','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','isNil','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','fullname','email','101','102','103','113','110','104','105','106','107','108','100','111','create','user','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation'];(function(_0x54e4ec,_0x183144){var _0x44ef91=function(_0x34fe75){while(--_0x34fe75){_0x54e4ec['push'](_0x54e4ec['shift']());}};_0x44ef91(++_0x183144);}(_0x54ef,0x112));var _0xf54e=function(_0x3717d8,_0x12d72c){_0x3717d8=_0x3717d8-0x0;var _0x334377=_0x54ef[_0x3717d8];return _0x334377;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var values;var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];config['redis']=_['defaults'](config[_0xf54e('0x19')],{'host':_0xf54e('0x1a'),'port':0x18eb});var socket=require(_0xf54e('0x1b'))(new Redis(config[_0xf54e('0x19')]));require('./user.socket')[_0xf54e('0x1c')](socket);var jayson=require(_0xf54e('0x1d'));var client=jayson[_0xf54e('0x1e')][_0xf54e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x56828e,_0x2366ee,_0x389abc,_0x3eb415){return new BPromise(function(_0x5c5d00,_0x4af633){var _0xd87020=_0x3eb415||client;return _0xd87020[_0xf54e('0x20')](_0x56828e,_0x389abc)[_0xf54e('0x21')](function(_0x9647f){logger[_0xf54e('0x22')](_0xf54e('0x23'),_0x2366ee,_0xf54e('0x24'));logger[_0xf54e('0x25')](_0xf54e('0x26'),_0x2366ee,_0xf54e('0x24'),JSON[_0xf54e('0x27')](_0x9647f));if(_0x9647f['error']){if(_0x9647f['error'][_0xf54e('0x28')]===0x1f4){logger['error'](_0xf54e('0x23'),_0x2366ee,_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);return _0x4af633(_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);}logger[_0xf54e('0x29')](_0xf54e('0x23'),_0x2366ee,_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);return _0x5c5d00(_0x9647f[_0xf54e('0x29')][_0xf54e('0x2a')]);}else{logger['info'](_0xf54e('0x23'),_0x2366ee,'request\x20sent');_0x5c5d00(_0x9647f[_0xf54e('0x2b')][_0xf54e('0x2a')]);}})[_0xf54e('0x2c')](function(_0x474b61){logger[_0xf54e('0x29')](_0xf54e('0x23'),_0x2366ee,_0x474b61);_0x4af633(_0x474b61);});});}function respondWithStatusCode(_0x1e08d1,_0x43488d){_0x43488d=_0x43488d||0xcc;return function(_0x2342a9){if(_0x2342a9){return _0x1e08d1[_0xf54e('0x2d')](_0x43488d);}return _0x1e08d1[_0xf54e('0x2e')](_0x43488d)[_0xf54e('0x2f')]();};}function respondWithResult(_0x2ea001,_0x5390b8){_0x5390b8=_0x5390b8||0xc8;return function(_0xb3706e){if(_0xb3706e){return _0x2ea001['status'](_0x5390b8)[_0xf54e('0x30')](_0xb3706e);}};}function respondWithFilteredResult(_0x5e63f4,_0x15b888){return function(_0x269f47){if(_0x269f47){var _0x21ba00=typeof _0x15b888[_0xf54e('0x31')]===_0xf54e('0x32')&&typeof _0x15b888[_0xf54e('0x33')]===_0xf54e('0x32');var _0x54bd8f=_0x269f47['count'];var _0x2f96b1=_0x21ba00?0x0:_0x15b888[_0xf54e('0x31')];var _0x2ec92e=_0x21ba00?_0x269f47[_0xf54e('0x34')]:_0x15b888[_0xf54e('0x31')]+_0x15b888[_0xf54e('0x33')];var _0x2b5408;if(_0x2ec92e>=_0x54bd8f){_0x2ec92e=_0x54bd8f;_0x2b5408=0xc8;}else{_0x2b5408=0xce;}_0x5e63f4[_0xf54e('0x2e')](_0x2b5408);return _0x5e63f4[_0xf54e('0x35')](_0xf54e('0x36'),_0x2f96b1+'-'+_0x2ec92e+'/'+_0x54bd8f)['json'](_0x269f47);}return null;};}function patchUpdates(_0x5f29d3){return function(_0x324976){try{jsonpatch[_0xf54e('0x37')](_0x324976,_0x5f29d3,!![]);}catch(_0x4d8fdd){return BPromise[_0xf54e('0x38')](_0x4d8fdd);}return _0x324976[_0xf54e('0x39')]();};}function saveUpdates(_0x379110,_0x52ab49){return function(_0x576b46){if(_0x576b46){return _0x576b46['update'](_0x379110)['then'](function(_0x3c0cca){return _0x3c0cca;});}return null;};}function removeEntity(_0xe7e042,_0x210d6d){return function(_0x399e68){if(_0x399e68){return _0x399e68[_0xf54e('0x3a')]()[_0xf54e('0x21')](function(){var _0x49ba1c=_0x399e68['get']({'plain':!![]});if(_0x49ba1c['role']===_0xf54e('0x3b'))return;var _0x734187=[{'name':'Users','value':'user','ignore':!![]},{'name':_0xf54e('0x3c'),'value':_0xf54e('0x3d'),'ignore':![]},{'name':_0xf54e('0x3e'),'value':'telephone','ignore':![]}];var _0x14ecc8=_(_0x734187)[_0xf54e('0x3f')]('ignore')[_0xf54e('0x40')](_0xf54e('0x41'))[_0xf54e('0x41')]();if(_[_0xf54e('0x42')](_0x14ecc8,_0x49ba1c[_0xf54e('0x43')])){return;}var _0x199056=_['find'](_0x734187,['value',_0x49ba1c[_0xf54e('0x43')]])[_0xf54e('0x44')];return db[_0xf54e('0x45')]['destroy']({'where':{'type':_0x199056,'resourceId':_0x49ba1c['id']}})[_0xf54e('0x21')](function(){return _0x399e68;});})[_0xf54e('0x21')](function(){_0xe7e042[_0xf54e('0x2e')](0xcc)[_0xf54e('0x2f')]();});}};}function handleEntityNotFound(_0x361e4c,_0x23f297){return function(_0x17c7ec){if(!_0x17c7ec){_0x361e4c[_0xf54e('0x2d')](0x194);}return _0x17c7ec;};}function handleError(_0x8b4c,_0x2087b3){_0x2087b3=_0x2087b3||0x1f4;return function(_0x1c1f0d){logger[_0xf54e('0x29')](_0x1c1f0d[_0xf54e('0x46')]);if(_0x1c1f0d[_0xf54e('0x44')]){delete _0x1c1f0d[_0xf54e('0x44')];}_0x8b4c['status'](_0x2087b3)['send'](_0x1c1f0d);};}exports['index']=function(_0x29cbad,_0x644c6e){var _0x5398b2={},_0x3dae9b={},_0x311ce1={'count':0x0,'rows':[]};var _0x381c03=_['map'](db[_0xf54e('0x47')][_0xf54e('0x48')],function(_0x1e016e){return{'name':_0x1e016e[_0xf54e('0x49')],'type':_0x1e016e[_0xf54e('0x4a')][_0xf54e('0x4b')]};});_0x3dae9b[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_[_0xf54e('0x40')](_0x381c03,'name'),[_0xf54e('0x4e'),_0xf54e('0x4f')]);_0x3dae9b[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x29cbad[_0xf54e('0x50')]);_0x3dae9b[_0xf54e('0x52')]=_['intersection'](_0x3dae9b[_0xf54e('0x4c')],_0x3dae9b['query']);_0x5398b2[_0xf54e('0x53')]=_['intersection'](_0x3dae9b[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x29cbad[_0xf54e('0x50')]['fields']));_0x5398b2[_0xf54e('0x53')]=_0x5398b2[_0xf54e('0x53')][_0xf54e('0x55')]?_0x5398b2[_0xf54e('0x53')]:_0x3dae9b[_0xf54e('0x4c')];if(!_0x29cbad['query'][_0xf54e('0x56')](_0xf54e('0x57'))){_0x5398b2[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x29cbad['query'][_0xf54e('0x33')]);_0x5398b2[_0xf54e('0x31')]=qs['offset'](_0x29cbad[_0xf54e('0x50')][_0xf54e('0x31')]);}_0x5398b2[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x29cbad['query'][_0xf54e('0x59')]);_0x5398b2[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x29cbad[_0xf54e('0x50')],_0x3dae9b[_0xf54e('0x52')]),_0x381c03);if(_0x29cbad[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x5398b2[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x5398b2[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x381c03,function(_0x2deb0c){if(_0x2deb0c[_0xf54e('0x4a')]!==_0xf54e('0x5d')){return db[_0xf54e('0x5e')][_0xf54e('0x5a')](db[_0xf54e('0x5e')]['fn'](_0xf54e('0x5f'),db[_0xf54e('0x5e')]['col'](_0x2deb0c['name'])),{'$like':db[_0xf54e('0x5e')]['fn'](_0xf54e('0x5f'),'%'+_0x29cbad[_0xf54e('0x50')][_0xf54e('0x3f')]+'%')});}})});}_0x5398b2=_[_0xf54e('0x5c')]({},_0x5398b2,_0x29cbad[_0xf54e('0x60')]);var _0x22763f={'where':_0x5398b2[_0xf54e('0x5a')]};return db[_0xf54e('0x47')][_0xf54e('0x34')](_0x22763f)[_0xf54e('0x21')](function(_0x59c313){_0x311ce1[_0xf54e('0x34')]=_0x59c313;if(_0x29cbad[_0xf54e('0x50')][_0xf54e('0x61')]){_0x5398b2[_0xf54e('0x62')]=[{'all':!![]}];}if(!_[_0xf54e('0x42')](_0x5398b2[_0xf54e('0x53')],'id')){_0x5398b2[_0xf54e('0x53')]['push']('id');}return db[_0xf54e('0x47')][_0xf54e('0x63')](_0x5398b2);})[_0xf54e('0x21')](function(_0x48a5c8){_0x311ce1[_0xf54e('0x64')]=_0x48a5c8;if(_0x29cbad['query'][_0xf54e('0x65')]===_0xf54e('0x66')){var _0x3e2fd1=[];for(var _0x5b882f=0x0;_0x5b882f<_0x311ce1[_0xf54e('0x64')][_0xf54e('0x55')];_0x5b882f++){_0x3e2fd1[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x68'),_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs('sms',_0x311ce1['rows'][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs('fax',_0x311ce1[_0xf54e('0x64')][_0x5b882f]['dataValues']));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs('mail',_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x6a'),_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));_0x3e2fd1['push'](get_open_tabs('whatsapp',_0x311ce1[_0xf54e('0x64')][_0x5b882f][_0xf54e('0x69')]));}return BPromise['all'](_0x3e2fd1)['then'](function(_0x2a5e54){return _0x311ce1;});}else{return _0x311ce1;}})['then'](respondWithFilteredResult(_0x644c6e,_0x5398b2))[_0xf54e('0x2c')](handleError(_0x644c6e,null));};exports[_0xf54e('0x6b')]=function(_0x47596c,_0x2b11f8){var _0x1d7c52={'raw':![],'where':{'id':_0x47596c[_0xf54e('0x6c')]['id']}},_0x20c90d={};_0x20c90d[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_[_0xf54e('0x51')](db[_0xf54e('0x47')][_0xf54e('0x48')]),[_0xf54e('0x4e'),_0xf54e('0x4f')]);_0x20c90d['query']=_[_0xf54e('0x51')](_0x47596c[_0xf54e('0x50')]);_0x20c90d[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x20c90d[_0xf54e('0x4c')],_0x20c90d['query']);_0x1d7c52[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x20c90d['model'],qs['fields'](_0x47596c[_0xf54e('0x50')]['fields']));_0x1d7c52[_0xf54e('0x53')]=_0x1d7c52[_0xf54e('0x53')][_0xf54e('0x55')]?_0x1d7c52[_0xf54e('0x53')]:_0x20c90d['model'];if(_0x47596c[_0xf54e('0x50')]['includeAll']){_0x1d7c52[_0xf54e('0x62')]=[{'all':!![]}];}_0x1d7c52=_[_0xf54e('0x5c')]({},_0x1d7c52,_0x47596c[_0xf54e('0x60')]);if(!_['includes'](_0x1d7c52[_0xf54e('0x53')],'id')){_0x1d7c52['attributes'][_0xf54e('0x67')]('id');}return db[_0xf54e('0x47')]['find'](_0x1d7c52)[_0xf54e('0x21')](handleEntityNotFound(_0x2b11f8,null))['then'](function(_0x3aa7e5){var _0x2df028=[];values=_0x3aa7e5;if(_0x47596c[_0xf54e('0x50')][_0xf54e('0x65')]===_0xf54e('0x66')){_0x2df028['push'](get_open_tabs(_0xf54e('0x68'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x6e'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x6a'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028[_0xf54e('0x67')](get_open_tabs('whatsapp',_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x6f'),_0x3aa7e5[_0xf54e('0x69')]));_0x2df028['push'](get_open_tabs(_0xf54e('0x70'),_0x3aa7e5[_0xf54e('0x69')]));return BPromise[_0xf54e('0x71')](_0x2df028);}else{return values;}})[_0xf54e('0x21')](function(_0x38bf71){return values;})[_0xf54e('0x21')](respondWithResult(_0x2b11f8,null))[_0xf54e('0x2c')](handleError(_0x2b11f8,null));};exports[_0xf54e('0x72')]=function(_0x451a1c,_0x10f6bb){if(_0x451a1c[_0xf54e('0x73')]['id']){delete _0x451a1c['body']['id'];}delete _0x451a1c[_0xf54e('0x73')][_0xf54e('0x43')];return db[_0xf54e('0x47')]['find']({'where':{'id':_0x451a1c[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x10f6bb,null))[_0xf54e('0x21')](saveUpdates(_0x451a1c[_0xf54e('0x73')],null))[_0xf54e('0x21')](respondWithResult(_0x10f6bb,null))[_0xf54e('0x2c')](handleError(_0x10f6bb,null));};exports[_0xf54e('0x74')]=function(_0x487895,_0x1eb3c1){return db[_0xf54e('0x47')][_0xf54e('0x74')]()['then'](respondWithResult(_0x1eb3c1,null))[_0xf54e('0x2c')](handleError(_0x1eb3c1,null));};exports[_0xf54e('0x75')]=function(_0x57601f,_0x247e50,_0x4f584a){return db['User'][_0xf54e('0x76')]({'where':{'id':_0x57601f[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x247e50,null))[_0xf54e('0x21')](function(_0x1c49cb){if(_0x1c49cb){return _0x1c49cb[_0xf54e('0x75')](_0x57601f[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x57601f[_0xf54e('0x73')],['ids','id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x247e50,null))[_0xf54e('0x2c')](handleError(_0x247e50,null));};function validateUser(_0x2b026a){return new BPromise(function(_0x42af1c,_0x56223a){if(_0x2b026a[_0xf54e('0x79')])return _0x42af1c(_0x2b026a);return db[_0xf54e('0x7a')][_0xf54e('0x7b')](0x1)[_0xf54e('0x21')](function(_0x5dd28e){if(_0x5dd28e[_0xf54e('0x7c')])authService[_0xf54e('0x7d')](_0x2b026a[_0xf54e('0x4e')]);db['User']['max'](_0xf54e('0x79'))[_0xf54e('0x21')](function(_0x1e2834){if(_[_0xf54e('0x7e')](_0x1e2834)){_0x2b026a[_0xf54e('0x79')]=_0x5dd28e[_0xf54e('0x7f')]||0x1;return;}if(_[_0xf54e('0x7e')](_0x5dd28e[_0xf54e('0x7f')])||_0x5dd28e[_0xf54e('0x7f')]===_0x1e2834){_0x2b026a['internal']=_0x1e2834+0x1;return;}if(_0x5dd28e[_0xf54e('0x7f')]>_0x1e2834){_0x2b026a[_0xf54e('0x79')]=_0x5dd28e[_0xf54e('0x7f')];return;}return db[_0xf54e('0x5e')][_0xf54e('0x50')](_0xf54e('0x80'),{'type':db[_0xf54e('0x5e')][_0xf54e('0x81')][_0xf54e('0x82')]})[_0xf54e('0x21')](function(_0x11dec2){if(_0x11dec2&&_0x11dec2[_0xf54e('0x55')]){for(var _0x5b9ff2=0x0,_0x151f58=_0x11dec2[_0xf54e('0x55')];_0x5b9ff2<_0x151f58&&_['isNil'](_0x2b026a['internal']);_0x5b9ff2++){if(_0x5dd28e[_0xf54e('0x7f')]<=_0x11dec2[_0x5b9ff2][_0xf54e('0x83')]){_0x2b026a[_0xf54e('0x79')]=_0x11dec2[_0x5b9ff2][_0xf54e('0x83')];}else if(_0x5dd28e[_0xf54e('0x7f')]>_0x11dec2[_0x5b9ff2][_0xf54e('0x83')]&&_0x5dd28e[_0xf54e('0x7f')]<=_0x11dec2[_0x5b9ff2]['to']){_0x2b026a[_0xf54e('0x79')]=_0x5dd28e[_0xf54e('0x7f')];}}}if(_['isNil'](_0x2b026a[_0xf54e('0x79')])){_0x2b026a[_0xf54e('0x79')]=_0x1e2834+0x1;}return _0x42af1c(_0x2b026a);});});})[_0xf54e('0x2c')](function(_0x5c8b6c){_0x56223a(_0x5c8b6c);});});}function updateUser(_0x40f135){return new BPromise(function(_0x4c5072,_0x3830e7){try{if(_0x40f135['voicemail']){_0x40f135[_0xf54e('0x84')]=_0x40f135[_0xf54e('0x79')];_0x40f135['VoiceMail']={'mailbox':_0x40f135['internal'],'password':_0x40f135[_0xf54e('0x4e')],'fullname':_0x40f135[_0xf54e('0x85')],'email':_0x40f135[_0xf54e('0x86')]};}if(_0x40f135[_0xf54e('0x43')]===_0xf54e('0x3d')){if(!_0x40f135['permissions'])_0x40f135['permissions']=[_0xf54e('0x87'),_0xf54e('0x88'),_0xf54e('0x89'),_0xf54e('0x8a'),_0xf54e('0x8b'),_0xf54e('0x8c'),_0xf54e('0x8d'),_0xf54e('0x8e'),_0xf54e('0x8f'),_0xf54e('0x90'),'109',_0xf54e('0x91'),_0xf54e('0x92'),'114','115'];}_0x4c5072(_0x40f135);}catch(_0x20345b){_0x3830e7(_0x20345b);}});}exports[_0xf54e('0x93')]=function(_0xdc25ce,_0x183867){if(_0xdc25ce[_0xf54e('0x94')]['role']===_0xf54e('0x3d'))throw new Error(_0xf54e('0x95'));if(_0xdc25ce[_0xf54e('0x73')][_0xf54e('0x43')]==='user'&&_0xdc25ce[_0xf54e('0x94')][_0xf54e('0x43')]!==_0xf54e('0x3b')){throw new Error(_0xf54e('0x96'));}if(_0xdc25ce['body'][_0xf54e('0x43')]===_0xf54e('0x3b')&&_0xdc25ce[_0xf54e('0x94')][_0xf54e('0x43')]!==_0xf54e('0x3b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xf54e('0x97')]([_0xdc25ce['body']])['then'](function(){return validateUser(_0xdc25ce[_0xf54e('0x73')]);})[_0xf54e('0x21')](function(_0x242f5c){return updateUser(_0x242f5c)[_0xf54e('0x21')](function(_0x300cbe){if(_0x300cbe[_0xf54e('0x43')]===_0xf54e('0x3b')){_0x300cbe[_0xf54e('0x98')]=_0xdc25ce[_0xf54e('0x94')]['settingsEnabled'];delete _0x300cbe[_0xf54e('0x99')];}return _0x300cbe;});})[_0xf54e('0x21')](function(_0x259a3e){return db[_0xf54e('0x47')][_0xf54e('0x93')](_0x259a3e,{'include':[{'model':db[_0xf54e('0x9a')],'as':'VoiceMail'}]});})[_0xf54e('0x21')](function(_0x978fe2){if(_0xdc25ce[_0xf54e('0x73')][_0xf54e('0x43')]===_0xf54e('0x94'))return _0x978fe2;if(_0xdc25ce[_0xf54e('0x94')]['role']!==_0xf54e('0x94'))return _0x978fe2;return db[_0xf54e('0x9b')][_0xf54e('0x76')]({'where':{'name':_0x978fe2[_0xf54e('0x43')]==='agent'?'Agents':_0xf54e('0x3e'),'userProfileId':_0xdc25ce[_0xf54e('0x94')][_0xf54e('0x99')]},'raw':!![]})[_0xf54e('0x21')](function(_0x3005f0){if(!_0x3005f0||_0x3005f0[_0xf54e('0x9c')]!=0x0)return _0x978fe2;return db['UserProfileResource'][_0xf54e('0x93')]({'name':_0x978fe2[_0xf54e('0x44')],'resourceId':_0x978fe2['id'],'type':_0x3005f0[_0xf54e('0x44')],'sectionId':_0x3005f0['id']},{})[_0xf54e('0x21')](function(){return _0x978fe2;});})[_0xf54e('0x2c')](function(_0xa386cc){logger['error'](_0xf54e('0x9d'),_0xa386cc);throw _0xa386cc;});})['then'](respondWithResult(_0x183867,0xc9))[_0xf54e('0x2c')](handleError(_0x183867,null));};exports['bulkCreate']=function(_0x21d974,_0x27c584){var _0x1ffad1=_0x21d974[_0xf54e('0x73')];var _0x19796f=[];if(_0x21d974['user'][_0xf54e('0x43')]===_0xf54e('0x3d'))throw new Error('Unauthorized');if(_[_0xf54e('0x9e')](_0x1ffad1,[_0xf54e('0x43'),_0xf54e('0x94')])&&_0x21d974[_0xf54e('0x94')]['role']!==_0xf54e('0x3b')){throw new Error(_0xf54e('0x96'));}if(_['some'](_0x1ffad1,[_0xf54e('0x43'),'admin'])&&_0x21d974['user'][_0xf54e('0x43')]!=='admin'){throw new Error(_0xf54e('0x9f'));}return licenseUtil[_0xf54e('0x97')](_0x1ffad1)[_0xf54e('0x21')](function(){return validateUser(_0x1ffad1[0x0]);})[_0xf54e('0x21')](function(){for(var _0x235124=0x1;_0x235124<_0x1ffad1['length'];_0x235124++){var _0x824d0b=_0x1ffad1[_0x235124-0x1][_0xf54e('0x79')];if(!_0x1ffad1[_0x235124][_0xf54e('0x79')])_0x1ffad1[_0x235124][_0xf54e('0x79')]=_0x824d0b+0x1;_0x19796f['push'](validateUser(_0x1ffad1[_0x235124]));}return BPromise[_0xf54e('0x71')](_0x19796f);})['then'](function(){_0x19796f=[];for(var _0x1da57f=0x0;_0x1da57f<_0x1ffad1[_0xf54e('0x55')];_0x1da57f++){_0x19796f['push'](updateUser(_0x1ffad1[_0x1da57f]));}return BPromise[_0xf54e('0x71')](_0x19796f);})[_0xf54e('0x21')](function(){return BPromise[_0xf54e('0xa0')](_0x1ffad1,function(_0x23a151){return db['User'][_0xf54e('0x93')](_0x23a151,{'include':[{'model':db[_0xf54e('0x9a')],'as':_0xf54e('0x9a')}]})['then'](function(_0x4a133a){_0x23a151['id']=_0x4a133a['id'];return _0x23a151;});});})[_0xf54e('0x21')](function(_0x5e33bc){if(_0x21d974['body']['role']===_0xf54e('0x94'))return _0x5e33bc;if(_0x21d974[_0xf54e('0x94')][_0xf54e('0x43')]!==_0xf54e('0x94'))return _0x5e33bc;var _0x34dc81=_[_0xf54e('0x9e')](_0x5e33bc,function(_0x427124){return _0x427124[_0xf54e('0x43')]===_0xf54e('0x3d')||_0x427124['role']===_0xf54e('0xa1');});if(!_0x34dc81)return _0x5e33bc;return db['UserProfileSection'][_0xf54e('0x63')]({'where':{'name':{'$or':[_0xf54e('0x3c'),'Telephones']},'userProfileId':_0x21d974[_0xf54e('0x94')]['userProfileId']},'raw':!![]})[_0xf54e('0x21')](function(_0x406e28){if(_[_0xf54e('0xa2')](_0x406e28)||!_[_0xf54e('0x9e')](_0x406e28,[_0xf54e('0x9c'),0x0]))return _0x5e33bc;_0x19796f=[];var _0x3c499e=_(_0x406e28)['map'](function(_0x4d0131){if(_0x4d0131['autoAssociation']===0x1)return;return _0x4d0131[_0xf54e('0x44')]==='Agents'?_0xf54e('0x3d'):_0xf54e('0xa1');})[_0xf54e('0xa3')]()[_0xf54e('0x41')]();for(var _0xf92db2=0x0;_0xf92db2<_0x5e33bc['length'];_0xf92db2++){if(!_[_0xf54e('0x42')](_0x3c499e,_0x5e33bc[_0xf92db2][_0xf54e('0x43')]))return;var _0x134074=_0x5e33bc[_0xf92db2][_0xf54e('0x43')]===_0xf54e('0x3d')?_0xf54e('0x3c'):'Telephones';_0x19796f[_0xf54e('0x67')](db[_0xf54e('0x45')][_0xf54e('0x93')]({'name':_0x5e33bc[_0xf92db2][_0xf54e('0x44')],'resourceId':_0x5e33bc[_0xf92db2]['id'],'type':_0x134074,'sectionId':_[_0xf54e('0x76')](_0x406e28,['name',_0x134074])['id']},{}));}return BPromise[_0xf54e('0x71')](_0x19796f);});})[_0xf54e('0x21')](respondWithResult(_0x27c584,0xc9))[_0xf54e('0x2c')](handleError(_0x27c584,null));};exports[_0xf54e('0xa4')]=function(_0x2c1984,_0xea4112,_0x285405){if(_0x2c1984[_0xf54e('0x73')]['id']){delete _0x2c1984[_0xf54e('0x73')]['id'];}return db['User'][_0xf54e('0x76')]({'where':{'id':_0x2c1984[_0xf54e('0x6c')]['id']}})['then'](function(_0x47a1d2){if(!_0x47a1d2)return null;if(_0x47a1d2['id']===_0x2c1984[_0xf54e('0x94')]['id']){if(!_0x2c1984['body'][_0xf54e('0xa5')]||!_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]){throw new db[(_0xf54e('0xa7'))]['ValidationError'](_0xf54e('0xa8'));}if(!_0x47a1d2[_0xf54e('0xa9')](_0x2c1984['body'][_0xf54e('0xa5')])){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xab'));}if(_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa5')]===_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xac'));}}else if(_0x2c1984['user']['role']===_0xf54e('0x3b')){if(!_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2c1984[_0xf54e('0x94')][_0xf54e('0x43')]===_0xf54e('0x94')){if(!_0x2c1984[_0xf54e('0x73')]['newPassword']){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xad'));}if(_0x47a1d2[_0xf54e('0x43')]!==_0xf54e('0x3d')){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0x95'));}}else{throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0x95'));}return _0x47a1d2;})[_0xf54e('0x21')](handleEntityNotFound(_0xea4112,null))[_0xf54e('0x21')](function(_0x11d536){return db['Setting'][_0xf54e('0xae')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xf54e('0xaf')]})[_0xf54e('0x21')](function(_0x304cd1){if(_0x304cd1[_0xf54e('0x7c')])authService[_0xf54e('0x7d')](_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')]);if(!_0x304cd1[_0xf54e('0xb0')]||!_0x11d536[_0xf54e('0xb1')])return _0x11d536;authService[_0xf54e('0xb2')](_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')],_0x11d536[_0xf54e('0xb1')],_0x304cd1['passwordHistoryLimit']);return _0x11d536;})[_0xf54e('0x21')](saveUpdates({'password':_0x2c1984[_0xf54e('0x73')][_0xf54e('0xa6')],'passwordResetAt':_0x2c1984[_0xf54e('0x94')]['id']==_0x2c1984[_0xf54e('0x6c')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2c1984['body'][_0xf54e('0xa6')],_0x11d536[_0xf54e('0xb1')])},null));})['then'](respondWithResult(_0xea4112,null))['catch'](handleError(_0xea4112,null));};exports[_0xf54e('0xb3')]=function(_0x5d5347,_0x391401,_0x275863){var _0x6e09bf=_0x5d5347[_0xf54e('0x73')][_0xf54e('0xb4')];return db[_0xf54e('0x47')]['find']({'where':{'id':_0x5d5347[_0xf54e('0x6c')]['id']},'attributes':['id',_0xf54e('0x44'),'role',_0xf54e('0xb5'),_0xf54e('0xb6'),'voicePause',_0xf54e('0xb7')]})[_0xf54e('0x21')](handleEntityNotFound(_0x391401,null))[_0xf54e('0x21')](function(_0x54efa9){if(_0x54efa9){if(!utils['isValidChannel'](_0x6e09bf)){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))]('Unknown\x20channel');}return _0x54efa9['add'+_['capitalize'](_0x6e09bf[_0xf54e('0xb8')]())+_0xf54e('0xb9')](_0x5d5347[_0xf54e('0x73')]['ids'],{'penalty':_0x5d5347[_0xf54e('0x73')][_0xf54e('0xba')]||0x0})[_0xf54e('0xbb')](function(_0x3da354){for(var _0x34b978=0x0;_0x34b978<_0x5d5347['body']['ids']['length'];_0x34b978+=0x1){var _0x484acd={'UserId':_0x5d5347['params']['id']};_0x484acd[_[_0xf54e('0xbc')](_0x6e09bf['toLowerCase']())+_0xf54e('0xbd')]=_0x5d5347[_0xf54e('0x73')]['ids'][_0x34b978];socket[_0xf54e('0xbe')]('user'+_[_0xf54e('0xbc')](_0x6e09bf[_0xf54e('0xb8')]())+_0xf54e('0xbf'),_0x484acd);}return _0x3da354;})[_0xf54e('0x21')](function(){if(_0x6e09bf===_0xf54e('0xc0')){return db[_0xf54e('0xc1')][_0xf54e('0x63')]({'where':{'id':_0x5d5347['body'][_0xf54e('0x77')]||[]},'raw':!![],'attributes':['id',_0xf54e('0x44')]});}})[_0xf54e('0x21')](function(_0x6d7a6b){var _0x3733f5=_0x54efa9['get']({'plain':!![]});var _0x41bb0e=[];if(_0x6e09bf===_0xf54e('0xc0')&&_0x3733f5[_0xf54e('0x43')]===_0xf54e('0x3d')&&_0x3733f5[_0xf54e('0xb5')]){for(var _0x2753fb=0x0;_0x2753fb<_0x6d7a6b['length'];_0x2753fb+=0x1){_0x41bb0e['push']({'membername':_0x3733f5['name'],'UserId':_0x3733f5['id'],'queue_name':_0x6d7a6b[_0x2753fb][_0xf54e('0x44')],'VoiceQueueId':_0x6d7a6b[_0x2753fb]['id'],'interface':_[_0xf54e('0x7e')](_0x3733f5[_0xf54e('0xb7')])?util[_0xf54e('0xc2')](_0xf54e('0xc3'),_0x3733f5['name']):_0x3733f5[_0xf54e('0xb7')],'paused':_0x3733f5[_0xf54e('0xc4')]||![],'penalty':_0x5d5347['body'][_0xf54e('0xba')]||0x0});}return BPromise[_0xf54e('0xa0')](_0x41bb0e,function(_0x3476cf){return db['UserVoiceQueueRt'][_0xf54e('0xc5')](_0x3476cf);});}return _0x54efa9;});}})[_0xf54e('0x21')](respondWithStatusCode(_0x391401,null))[_0xf54e('0x2c')](handleError(_0x391401,null));};exports[_0xf54e('0xc6')]=function(_0x711b1,_0xb217f2,_0x9936ea){var _0x370e59;return db['User'][_0xf54e('0x76')]({'where':{'id':_0x711b1['params']['id']},'attributes':['id',_0xf54e('0x44'),_0xf54e('0x43')]})[_0xf54e('0x21')](handleEntityNotFound(_0xb217f2,null))[_0xf54e('0x21')](function(_0x10086b){if(_0x10086b){_0x370e59=_0x10086b;if(!_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')]||!utils['isValidChannel'](_0x711b1['query']['channel'])){throw new db[(_0xf54e('0xa7'))]['ValidationError'](_0xf54e('0xc7'));}return _0x10086b['remove'+_[_0xf54e('0xbc')](_0x711b1[_0xf54e('0x50')]['channel'][_0xf54e('0xb8')]())+_0xf54e('0xb9')](_0x711b1[_0xf54e('0x50')][_0xf54e('0x77')]);}})[_0xf54e('0x21')](function(_0xfa9739){for(var _0x18ea44=0x0;_0x18ea44<_0x711b1[_0xf54e('0x50')][_0xf54e('0x77')][_0xf54e('0x55')];_0x18ea44+=0x1){var _0x3351a3={'UserId':_0x711b1['params']['id']};_0x3351a3[_[_0xf54e('0xbc')](_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')]['toLowerCase']())+_0xf54e('0xbd')]=_0x711b1['query'][_0xf54e('0x77')][_0x18ea44];socket[_0xf54e('0xbe')](_0xf54e('0x94')+_[_0xf54e('0xbc')](_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')][_0xf54e('0xb8')]())+_0xf54e('0xc8'),_0x3351a3);}return _0xfa9739;})[_0xf54e('0x21')](function(){if(_0x711b1[_0xf54e('0x50')][_0xf54e('0xb4')]==='voice'){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x711b1[_0xf54e('0x6c')]['id'],'VoiceQueueId':_0x711b1[_0xf54e('0x50')][_0xf54e('0x77')]},'individualHooks':!![]})['then'](function(){return _0x370e59;});}return _0x370e59;})[_0xf54e('0x21')](respondWithStatusCode(_0xb217f2,null))[_0xf54e('0x2c')](handleError(_0xb217f2,null));};exports['addAvatar']=function(_0x405254,_0xc74621,_0x37aeab){_0x405254[_0xf54e('0x73')][_0xf54e('0xc9')]=_0x405254[_0xf54e('0xca')][_0xf54e('0xcb')];return db['User']['find']({'where':{'id':_0x405254[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xc74621,null))[_0xf54e('0x21')](saveUpdates(_0x405254[_0xf54e('0x73')],null))['then'](respondWithResult(_0xc74621,null))[_0xf54e('0x2c')](handleError(_0xc74621,null));};exports[_0xf54e('0xcc')]=function(_0x55d029,_0x2cf6c0,_0x5b02f5){var _0x38f94e=path[_0xf54e('0xcd')](config[_0xf54e('0xce')],_0xf54e('0xcf'));return db['User'][_0xf54e('0x76')]({'where':{'id':_0x55d029['params']['id']},'attributes':['id',_0xf54e('0xc9')],'raw':!![]})[_0xf54e('0x21')](handleEntityNotFound(_0x2cf6c0,null))[_0xf54e('0x21')](function(_0xd6cf23){if(_0xd6cf23){if(_['isNil'](_0xd6cf23['userpic'])){return _0x2cf6c0[_0xf54e('0xd0')](_0x38f94e);}else{if(!fs[_0xf54e('0xd1')](path[_0xf54e('0xcd')](config['root'],_0xf54e('0xd2'),_0xd6cf23[_0xf54e('0xc9')]))){return _0x2cf6c0['download'](_0x38f94e);}return _0x2cf6c0[_0xf54e('0xd0')](path[_0xf54e('0xcd')](config[_0xf54e('0xce')],_0xf54e('0xd2'),_0xd6cf23[_0xf54e('0xc9')]));}}})[_0xf54e('0x2c')](handleError(_0x2cf6c0,null));};exports['getOpenTabs']=function(_0x1bf4d5,_0x4479b8,_0x1674a4){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x1bf4d5[_0xf54e('0x6c')]['id']},'attributes':['id']})[_0xf54e('0x21')](handleEntityNotFound(_0x4479b8,null))[_0xf54e('0x21')](function(_0x22b526){var _0x37746a=[];values=_0x22b526[_0xf54e('0x69')];_0x37746a[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x68'),_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x6e'),_0x22b526[_0xf54e('0x69')]));_0x37746a['push'](get_open_tabs(_0xf54e('0x6a'),_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs('whatsapp',_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs(_0xf54e('0x6f'),_0x22b526[_0xf54e('0x69')]));_0x37746a[_0xf54e('0x67')](get_open_tabs('mail',_0x22b526[_0xf54e('0x69')]));return BPromise['all'](_0x37746a);})[_0xf54e('0x21')](function(_0xa70512){var _0x505c0f=[];if(_0xa70512){for(var _0x560e97=0x0;_0x560e97<values[_0xf54e('0xd3')][_0xf54e('0x55')];_0x560e97++){var _0x4cb711=values[_0xf54e('0xd3')][_0x560e97];_0x505c0f[_0xf54e('0x67')]({'channel':_0xf54e('0xd4'),'id':_0x4cb711['id'],'createdAt':_0x4cb711[_0xf54e('0xd5')]});}for(var _0x560e97=0x0;_0x560e97<values['FaxOpenTabs'][_0xf54e('0x55')];_0x560e97++){var _0x4cb711=values[_0xf54e('0xd6')][_0x560e97];_0x505c0f[_0xf54e('0x67')]({'channel':'FAX','id':_0x4cb711['id'],'createdAt':_0x4cb711[_0xf54e('0xd5')]});}for(var _0x560e97=0x0;_0x560e97<values[_0xf54e('0xd7')][_0xf54e('0x55')];_0x560e97++){var _0x4cb711=values[_0xf54e('0xd7')][_0x560e97];_0x505c0f[_0xf54e('0x67')]({'channel':'OPENCHANNEL','id':_0x4cb711['id'],'createdAt':_0x4cb711['createdAt']});}for(var _0x560e97=0x0;_0x560e97<values[_0xf54e('0xd8')][_0xf54e('0x55')];_0x560e97++){var _0x4cb711=values[_0xf54e('0xd8')][_0x560e97];_0x505c0f[_0xf54e('0x67')]({'channel':_0xf54e('0xd9'),'id':_0x4cb711['id'],'createdAt':_0x4cb711[_0xf54e('0xd5')]});}for(var _0x560e97=0x0;_0x560e97<values['SmsOpenTabs']['length'];_0x560e97++){var _0x4cb711=values[_0xf54e('0xda')][_0x560e97];_0x505c0f[_0xf54e('0x67')]({'channel':_0xf54e('0xdb'),'id':_0x4cb711['id'],'createdAt':_0x4cb711[_0xf54e('0xd5')]});}for(var _0x560e97=0x0;_0x560e97<values[_0xf54e('0xdc')]['length'];_0x560e97++){var _0x4cb711=values[_0xf54e('0xdc')][_0x560e97];_0x505c0f[_0xf54e('0x67')]({'channel':_0xf54e('0xdd'),'id':_0x4cb711['id'],'createdAt':_0x4cb711[_0xf54e('0xd5')]});}var _0x41842c={'count':_0x505c0f[_0xf54e('0x55')],'rows':_0x505c0f};return _0x41842c;}else return null;})[_0xf54e('0x21')](respondWithResult(_0x4479b8,null))['catch'](handleError(_0x4479b8,null));};exports[_0xf54e('0xde')]=function(_0x428fea,_0x3b2bc1,_0x2c5e20){var _0xf884fe={};var _0x547a00={};var _0x1b2d02;var _0x4215dd;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x428fea[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3b2bc1,null))['then'](function(_0x395bbc){if(_0x395bbc){_0x1b2d02=_0x395bbc;_0x547a00[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db['CmContact'][_0xf54e('0x48')]);_0x547a00[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x428fea[_0xf54e('0x50')]);_0x547a00['filters']=_[_0xf54e('0x6d')](_0x547a00[_0xf54e('0x4c')],_0x547a00[_0xf54e('0x50')]);_0xf884fe['attributes']=_[_0xf54e('0x6d')](_0x547a00[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x428fea[_0xf54e('0x50')][_0xf54e('0x54')]));_0xf884fe[_0xf54e('0x53')]=_0xf884fe[_0xf54e('0x53')][_0xf54e('0x55')]?_0xf884fe['attributes']:_0x547a00[_0xf54e('0x4c')];_0xf884fe[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x428fea[_0xf54e('0x50')]['sort']);_0xf884fe['where']=qs['filters'](_['pick'](_0x428fea[_0xf54e('0x50')],_0x547a00[_0xf54e('0x52')]));if(_0x428fea[_0xf54e('0x50')]['filter']){_0xf884fe['where']=_[_0xf54e('0x5c')](_0xf884fe['where'],{'$or':_[_0xf54e('0x40')](_0xf884fe['attributes'],function(_0x54d936){var _0x176113={};_0x176113[_0x54d936]={'$like':'%'+_0x428fea[_0xf54e('0x50')]['filter']+'%'};return _0x176113;})});}_0xf884fe=_[_0xf54e('0x5c')]({},_0xf884fe,_0x428fea[_0xf54e('0x60')]);return _0x1b2d02[_0xf54e('0xde')](_0xf884fe);}})[_0xf54e('0x21')](function(_0x4d0e0c){if(_0x4d0e0c){_0x4215dd=_0x4d0e0c[_0xf54e('0x55')];if(_0x428fea[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x61'))){_0xf884fe[_0xf54e('0x62')]=[{'model':db[_0xf54e('0xdf')],'as':'List','required':![]},{'model':db[_0xf54e('0xe0')],'as':'Tags','attributes':['id','name',_0xf54e('0xe1')],'where':_0x428fea['query'][_0xf54e('0xe2')]?{'id':_0x428fea[_0xf54e('0x50')]['tag']}:undefined,'required':_0x428fea['query'][_0xf54e('0xe2')]?!![]:![]}];}if(!_0x428fea['query'][_0xf54e('0x56')](_0xf54e('0x57'))){_0xf884fe['limit']=qs[_0xf54e('0x33')](_0x428fea['query'][_0xf54e('0x33')]);_0xf884fe[_0xf54e('0x31')]=qs['offset'](_0x428fea[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x1b2d02[_0xf54e('0xde')](_0xf884fe);}})[_0xf54e('0x21')](function(_0x793480){if(_0x793480){return _0x793480?{'count':_0x4215dd,'rows':_0x793480}:null;}})[_0xf54e('0x21')](respondWithResult(_0x3b2bc1,null))[_0xf54e('0x2c')](handleError(_0x3b2bc1,null));};exports[_0xf54e('0xe3')]=function(_0x35e30b,_0x47f38d,_0x4d6974){var _0x29e737;var _0xa565f2;var _0x280cb5={};var _0x12e63f;return db['User'][_0xf54e('0xae')]({'where':{'id':_0x35e30b[_0xf54e('0x6c')]['id']},'attributes':['id','name',_0xf54e('0x43')]})[_0xf54e('0x21')](handleEntityNotFound(_0x47f38d,null))[_0xf54e('0x21')](function(_0x46480b){if(!utils[_0xf54e('0xe4')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0xb4')])){throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xc7'));}_0x29e737=_0x46480b;var _0x2c60ec={};_0x2c60ec['model']=_['keys'](db[_[_0xf54e('0xbc')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0xb4')])+_0xf54e('0xe5')][_0xf54e('0x48')]);_0x2c60ec[_0xf54e('0x50')]=_['keys'](_0x35e30b[_0xf54e('0x50')]);_0x2c60ec[_0xf54e('0x52')]=_['intersection'](_0x2c60ec[_0xf54e('0x4c')],_0x2c60ec[_0xf54e('0x50')]);_0x280cb5[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x2c60ec['model'],qs['fields'](_0x35e30b[_0xf54e('0x50')][_0xf54e('0x54')]));_0x280cb5[_0xf54e('0x53')]=_0x280cb5[_0xf54e('0x53')]['length']?_0x280cb5['attributes']:_0x2c60ec[_0xf54e('0x4c')];_0x280cb5[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x35e30b['query'][_0xf54e('0x59')]);_0x280cb5[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x35e30b['query'],_0x2c60ec[_0xf54e('0x52')]));if(_0x35e30b['query'][_0xf54e('0x3f')]){_0x280cb5[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x280cb5[_0xf54e('0x5a')],{'$or':_['map'](_0x280cb5[_0xf54e('0x53')],function(_0x42713d){var _0x1a4071={};_0x1a4071[_0x42713d]={'$like':'%'+_0x35e30b['query'][_0xf54e('0x3f')]+'%'};return _0x1a4071;})});}_0x280cb5=_[_0xf54e('0x5c')]({},_0x280cb5,_0x35e30b[_0xf54e('0x60')]);switch(_0x29e737['role']){case _0xf54e('0x3b'):return db[_[_0xf54e('0xbc')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0xb4')])+_0xf54e('0xe5')][_0xf54e('0x63')](_0x280cb5);case _0xf54e('0x94'):case _0xf54e('0x3d'):return _0x29e737[_0xf54e('0xe6')+_[_0xf54e('0xbc')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0xb4')])+_0xf54e('0xb9')](_0x280cb5);default:throw new db[(_0xf54e('0xa7'))][(_0xf54e('0xaa'))](_0xf54e('0xe7'));}})[_0xf54e('0x21')](function(_0x2f1f00){_0x12e63f=_0x2f1f00['length'];if(!_0x35e30b[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x280cb5[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0x33')]);_0x280cb5[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0x31')]);}switch(_0x29e737[_0xf54e('0x43')]){case _0xf54e('0x3b'):return db[_[_0xf54e('0xbc')](_0x35e30b[_0xf54e('0x50')][_0xf54e('0xb4')])+'Queue'][_0xf54e('0x63')](_0x280cb5);case _0xf54e('0x94'):case _0xf54e('0x3d'):return _0x29e737[_0xf54e('0xe6')+_['capitalize'](_0x35e30b[_0xf54e('0x50')][_0xf54e('0xb4')])+'Queues'](_0x280cb5);}})[_0xf54e('0x21')](function(_0x41da36){return{'count':_0x12e63f,'rows':_0x41da36};})[_0xf54e('0x21')](respondWithResult(_0x47f38d,null))[_0xf54e('0x2c')](handleError(_0x47f38d,null));};exports[_0xf54e('0xe8')]=function(_0x3f3f21,_0x3c259b,_0x22f8ad){var _0x269670={};var _0x17801c={};var _0x534b14;var _0x386d7c;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x3f3f21[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3c259b,null))[_0xf54e('0x21')](function(_0xa8842){if(_0xa8842){_0x534b14=_0xa8842;_0x17801c['model']=_[_0xf54e('0x51')](db[_0xf54e('0xe9')][_0xf54e('0x48')]);_0x17801c[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x3f3f21[_0xf54e('0x50')]);_0x17801c[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x17801c[_0xf54e('0x4c')],_0x17801c[_0xf54e('0x50')]);_0x269670['attributes']=_[_0xf54e('0x6d')](_0x17801c[_0xf54e('0x4c')],qs['fields'](_0x3f3f21['query'][_0xf54e('0x54')]));_0x269670[_0xf54e('0x53')]=_0x269670[_0xf54e('0x53')][_0xf54e('0x55')]?_0x269670[_0xf54e('0x53')]:_0x17801c[_0xf54e('0x4c')];_0x269670[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x3f3f21[_0xf54e('0x50')][_0xf54e('0x59')]);_0x269670['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x3f3f21['query'],_0x17801c['filters']));if(_0x3f3f21[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x269670['where']=_[_0xf54e('0x5c')](_0x269670[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x269670['attributes'],function(_0x4befd9){var _0x2f2241={};_0x2f2241[_0x4befd9]={'$like':'%'+_0x3f3f21['query'][_0xf54e('0x3f')]+'%'};return _0x2f2241;})});}_0x269670=_[_0xf54e('0x5c')]({},_0x269670,_0x3f3f21[_0xf54e('0x60')]);return _0x534b14[_0xf54e('0xe8')](_0x269670);}})[_0xf54e('0x21')](function(_0x4cb277){if(_0x4cb277){_0x386d7c=_0x4cb277['length'];if(!_0x3f3f21[_0xf54e('0x50')][_0xf54e('0x56')]('nolimit')){_0x269670[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x3f3f21[_0xf54e('0x50')][_0xf54e('0x33')]);_0x269670[_0xf54e('0x31')]=qs['offset'](_0x3f3f21['query'][_0xf54e('0x31')]);}return _0x534b14[_0xf54e('0xe8')](_0x269670);}})[_0xf54e('0x21')](function(_0xeaf7b1){if(_0xeaf7b1){return _0xeaf7b1?{'count':_0x386d7c,'rows':_0xeaf7b1}:null;}})[_0xf54e('0x21')](respondWithResult(_0x3c259b,null))['catch'](handleError(_0x3c259b,null));};exports[_0xf54e('0xea')]=function(_0x336f8b,_0x21c6c4,_0x4969bc){var _0x4ff18a={};var _0x4e4e9f={};var _0x4bdb12;var _0x591c61;return db['User'][_0xf54e('0xae')]({'where':{'id':_0x336f8b[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x21c6c4,null))[_0xf54e('0x21')](function(_0x31d12d){if(_0x31d12d){_0x4bdb12=_0x31d12d;_0x4e4e9f[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0xeb')][_0xf54e('0x48')]);_0x4e4e9f[_0xf54e('0x50')]=_['keys'](_0x336f8b['query']);_0x4e4e9f['filters']=_[_0xf54e('0x6d')](_0x4e4e9f[_0xf54e('0x4c')],_0x4e4e9f['query']);_0x4ff18a[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x4e4e9f[_0xf54e('0x4c')],qs['fields'](_0x336f8b[_0xf54e('0x50')][_0xf54e('0x54')]));_0x4ff18a[_0xf54e('0x53')]=_0x4ff18a['attributes'][_0xf54e('0x55')]?_0x4ff18a['attributes']:_0x4e4e9f[_0xf54e('0x4c')];_0x4ff18a[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x336f8b[_0xf54e('0x50')][_0xf54e('0x59')]);_0x4ff18a['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x336f8b[_0xf54e('0x50')],_0x4e4e9f[_0xf54e('0x52')]));if(_0x336f8b[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x4ff18a['where']=_[_0xf54e('0x5c')](_0x4ff18a[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x4ff18a[_0xf54e('0x53')],function(_0x216db2){var _0x3f9d4f={};_0x3f9d4f[_0x216db2]={'$like':'%'+_0x336f8b[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x3f9d4f;})});}_0x4ff18a=_['merge']({},_0x4ff18a,_0x336f8b[_0xf54e('0x60')]);return _0x4bdb12[_0xf54e('0xea')](_0x4ff18a);}})[_0xf54e('0x21')](function(_0x28da4c){if(_0x28da4c){_0x591c61=_0x28da4c[_0xf54e('0x55')];if(!_0x336f8b[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x4ff18a[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x336f8b[_0xf54e('0x50')][_0xf54e('0x33')]);_0x4ff18a[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x336f8b[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x4bdb12[_0xf54e('0xea')](_0x4ff18a);}})['then'](function(_0x2310f0){if(_0x2310f0){return _0x2310f0?{'count':_0x591c61,'rows':_0x2310f0}:null;}})[_0xf54e('0x21')](respondWithResult(_0x21c6c4,null))[_0xf54e('0x2c')](handleError(_0x21c6c4,null));};exports[_0xf54e('0xec')]=function(_0x1eb3c7,_0x12663d,_0x3c4862){var _0x24b5f7={'raw':!![],'where':{}};var _0x45d567={};var _0x3e4955={'count':0x0,'rows':[]};return db['User'][_0xf54e('0xae')]({'where':{'id':_0x1eb3c7[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x12663d,null))[_0xf54e('0x21')](function(_0x4e1f44){if(_0x4e1f44){_0x45d567[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0xed')][_0xf54e('0x48')]);_0x45d567[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x1eb3c7[_0xf54e('0x50')]);_0x45d567['filters']=_[_0xf54e('0x6d')](_0x45d567[_0xf54e('0x4c')],_0x45d567['query']);_0x24b5f7[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x45d567[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x1eb3c7[_0xf54e('0x50')]['fields']));_0x24b5f7[_0xf54e('0x53')]=_0x24b5f7[_0xf54e('0x53')][_0xf54e('0x55')]?_0x24b5f7['attributes']:_0x45d567[_0xf54e('0x4c')];if(!_0x1eb3c7['query'][_0xf54e('0x56')]('nolimit')){_0x24b5f7[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x1eb3c7[_0xf54e('0x50')]['limit']);_0x24b5f7['offset']=qs['offset'](_0x1eb3c7[_0xf54e('0x50')][_0xf54e('0x31')]);}_0x24b5f7[_0xf54e('0x58')]=qs['sort'](_0x1eb3c7['query'][_0xf54e('0x59')]);_0x24b5f7['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x1eb3c7[_0xf54e('0x50')],_0x45d567[_0xf54e('0x52')]));_0x24b5f7[_0xf54e('0x5a')][_0xf54e('0xee')]=_0x4e1f44['id'];if(_0x1eb3c7['query'][_0xf54e('0x3f')]){_0x24b5f7['where']=_[_0xf54e('0x5c')](_0x24b5f7[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x24b5f7[_0xf54e('0x53')],function(_0x2e2257){var _0x5148af={};_0x5148af[_0x2e2257]={'$like':'%'+_0x1eb3c7[_0xf54e('0x50')]['filter']+'%'};return _0x5148af;})});}_0x24b5f7=_[_0xf54e('0x5c')]({},_0x24b5f7,_0x1eb3c7[_0xf54e('0x60')]);return db[_0xf54e('0xed')][_0xf54e('0x34')]({'where':_0x24b5f7['where']})[_0xf54e('0x21')](function(_0x39779e){_0x3e4955[_0xf54e('0x34')]=_0x39779e;if(_0x1eb3c7[_0xf54e('0x50')][_0xf54e('0x61')]){_0x24b5f7[_0xf54e('0x62')]=[{'all':!![]}];}return db[_0xf54e('0xed')][_0xf54e('0x63')](_0x24b5f7);})[_0xf54e('0x21')](function(_0x4e537d){_0x3e4955[_0xf54e('0x64')]=_0x4e537d;return _0x3e4955;});}})[_0xf54e('0x21')](respondWithFilteredResult(_0x12663d,_0x24b5f7))['catch'](handleError(_0x12663d,null));};exports[_0xf54e('0xef')]=function(_0xea94a,_0x4bf18e,_0x8a0b0f){var _0x354c1e={'raw':!![],'where':{}};var _0x30b341={};var _0x1c6978={'count':0x0,'rows':[]};return db['User'][_0xf54e('0xae')]({'where':{'id':_0xea94a[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x4bf18e,null))[_0xf54e('0x21')](function(_0xb95361){if(_0xb95361){_0x30b341[_0xf54e('0x4c')]=_['keys'](db[_0xf54e('0xf0')][_0xf54e('0x48')]);_0x30b341[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0xea94a[_0xf54e('0x50')]);_0x30b341[_0xf54e('0x52')]=_['intersection'](_0x30b341[_0xf54e('0x4c')],_0x30b341['query']);_0x354c1e[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x30b341['model'],qs[_0xf54e('0x54')](_0xea94a['query'][_0xf54e('0x54')]));_0x354c1e[_0xf54e('0x53')]=_0x354c1e[_0xf54e('0x53')]['length']?_0x354c1e[_0xf54e('0x53')]:_0x30b341['model'];if(!_0xea94a[_0xf54e('0x50')]['hasOwnProperty'](_0xf54e('0x57'))){_0x354c1e[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0xea94a[_0xf54e('0x50')][_0xf54e('0x33')]);_0x354c1e[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0xea94a['query'][_0xf54e('0x31')]);}_0x354c1e[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0xea94a[_0xf54e('0x50')]['sort']);_0x354c1e[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_['pick'](_0xea94a[_0xf54e('0x50')],_0x30b341['filters']));_0x354c1e[_0xf54e('0x5a')][_0xf54e('0xee')]=_0xb95361['id'];if(_0xea94a['query'][_0xf54e('0x3f')]){_0x354c1e['where']=_[_0xf54e('0x5c')](_0x354c1e[_0xf54e('0x5a')],{'$or':_['map'](_0x354c1e[_0xf54e('0x53')],function(_0x2aeffa){var _0x3d4b3e={};_0x3d4b3e[_0x2aeffa]={'$like':'%'+_0xea94a[_0xf54e('0x50')]['filter']+'%'};return _0x3d4b3e;})});}_0x354c1e=_[_0xf54e('0x5c')]({},_0x354c1e,_0xea94a['options']);return db['ScreenRecording']['count']({'where':_0x354c1e[_0xf54e('0x5a')]})[_0xf54e('0x21')](function(_0x3d092d){_0x1c6978[_0xf54e('0x34')]=_0x3d092d;if(_0xea94a[_0xf54e('0x50')][_0xf54e('0x61')]){_0x354c1e[_0xf54e('0x62')]=[{'all':!![]}];}return db[_0xf54e('0xf0')][_0xf54e('0x63')](_0x354c1e);})['then'](function(_0x3a15dc){_0x1c6978[_0xf54e('0x64')]=_0x3a15dc;return _0x1c6978;});}})[_0xf54e('0x21')](respondWithFilteredResult(_0x4bf18e,_0x354c1e))[_0xf54e('0x2c')](handleError(_0x4bf18e,null));};exports[_0xf54e('0xf1')]=function(_0x53016b,_0x37c319,_0x50cfe6){var _0x142f01={};var _0x5d4db4={};var _0x2a39e1;var _0x4cb0cc;return db[_0xf54e('0x47')]['findOne']({'where':{'id':_0x53016b[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x37c319,null))[_0xf54e('0x21')](function(_0x11bf48){if(_0x11bf48){_0x2a39e1=_0x11bf48;_0x5d4db4[_0xf54e('0x4c')]=_['keys'](db[_0xf54e('0xf2')][_0xf54e('0x48')]);_0x5d4db4['query']=_[_0xf54e('0x51')](_0x53016b[_0xf54e('0x50')]);_0x5d4db4[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x5d4db4['model'],_0x5d4db4[_0xf54e('0x50')]);_0x142f01[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x5d4db4[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x53016b[_0xf54e('0x50')][_0xf54e('0x54')]));_0x142f01[_0xf54e('0x53')]=_0x142f01[_0xf54e('0x53')][_0xf54e('0x55')]?_0x142f01[_0xf54e('0x53')]:_0x5d4db4['model'];_0x142f01[_0xf54e('0x58')]=qs['sort'](_0x53016b['query'][_0xf54e('0x59')]);_0x142f01['where']=qs[_0xf54e('0x52')](_['pick'](_0x53016b[_0xf54e('0x50')],_0x5d4db4['filters']));if(_0x53016b['query'][_0xf54e('0x3f')]){_0x142f01[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x142f01[_0xf54e('0x5a')],{'$or':_['map'](_0x142f01[_0xf54e('0x53')],function(_0x55d337){var _0x479c8a={};_0x479c8a[_0x55d337]={'$like':'%'+_0x53016b[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x479c8a;})});}_0x142f01=_[_0xf54e('0x5c')]({},_0x142f01,_0x53016b['options']);return _0x2a39e1[_0xf54e('0xf1')](_0x142f01);}})[_0xf54e('0x21')](function(_0x3bcdd4){if(_0x3bcdd4){_0x4cb0cc=_0x3bcdd4[_0xf54e('0x55')];if(!_0x53016b[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x142f01[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x53016b[_0xf54e('0x50')][_0xf54e('0x33')]);_0x142f01['offset']=qs[_0xf54e('0x31')](_0x53016b[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x2a39e1[_0xf54e('0xf1')](_0x142f01);}})['then'](function(_0x5cee7d){if(_0x5cee7d){return _0x5cee7d?{'count':_0x4cb0cc,'rows':_0x5cee7d}:null;}})[_0xf54e('0x21')](respondWithResult(_0x37c319,null))[_0xf54e('0x2c')](handleError(_0x37c319,null));};exports[_0xf54e('0xf3')]=function(_0x42cc39,_0x3a3b50,_0x145fda){var _0x38f44e={};var _0x32c9fd={};var _0x1ab239;var _0x22e491;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x42cc39[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3a3b50,null))[_0xf54e('0x21')](function(_0x15107a){if(_0x15107a){_0x1ab239=_0x15107a;_0x32c9fd[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0xf4')][_0xf54e('0x48')]);_0x32c9fd[_0xf54e('0x50')]=_['keys'](_0x42cc39[_0xf54e('0x50')]);_0x32c9fd['filters']=_[_0xf54e('0x6d')](_0x32c9fd[_0xf54e('0x4c')],_0x32c9fd[_0xf54e('0x50')]);_0x38f44e[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x32c9fd['model'],qs['fields'](_0x42cc39[_0xf54e('0x50')][_0xf54e('0x54')]));_0x38f44e[_0xf54e('0x53')]=_0x38f44e[_0xf54e('0x53')][_0xf54e('0x55')]?_0x38f44e[_0xf54e('0x53')]:_0x32c9fd[_0xf54e('0x4c')];_0x38f44e['order']=qs[_0xf54e('0x59')](_0x42cc39[_0xf54e('0x50')][_0xf54e('0x59')]);_0x38f44e[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_['pick'](_0x42cc39[_0xf54e('0x50')],_0x32c9fd[_0xf54e('0x52')]));if(_0x42cc39[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x38f44e['where']=_['merge'](_0x38f44e[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x38f44e['attributes'],function(_0x488526){var _0x3c04d4={};_0x3c04d4[_0x488526]={'$like':'%'+_0x42cc39['query'][_0xf54e('0x3f')]+'%'};return _0x3c04d4;})});}_0x38f44e=_[_0xf54e('0x5c')]({},_0x38f44e,_0x42cc39[_0xf54e('0x60')]);return _0x1ab239[_0xf54e('0xf3')](_0x38f44e);}})[_0xf54e('0x21')](function(_0xb53162){if(_0xb53162){_0x22e491=_0xb53162[_0xf54e('0x55')];if(!_0x42cc39[_0xf54e('0x50')][_0xf54e('0x56')]('nolimit')){_0x38f44e[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x42cc39[_0xf54e('0x50')][_0xf54e('0x33')]);_0x38f44e[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x42cc39[_0xf54e('0x50')]['offset']);}return _0x1ab239[_0xf54e('0xf3')](_0x38f44e);}})['then'](function(_0x1c759f){if(_0x1c759f){return _0x1c759f?{'count':_0x22e491,'rows':_0x1c759f}:null;}})[_0xf54e('0x21')](respondWithResult(_0x3a3b50,null))[_0xf54e('0x2c')](handleError(_0x3a3b50,null));};exports[_0xf54e('0xf5')]=function(_0x4707fd,_0x3c4292,_0x4b5e38){var _0x217dfe={'raw':!![],'where':{}};var _0x1ee8c4={};var _0x4370ec={'count':0x0,'rows':[]};return db[_0xf54e('0x47')]['findOne']({'where':{'id':_0x4707fd['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3c4292,null))[_0xf54e('0x21')](function(_0x197ff4){if(_0x197ff4){_0x1ee8c4['model']=_['keys'](db[_0xf54e('0xf6')][_0xf54e('0x48')]);_0x1ee8c4['query']=_['keys'](_0x4707fd[_0xf54e('0x50')]);_0x1ee8c4['filters']=_['intersection'](_0x1ee8c4[_0xf54e('0x4c')],_0x1ee8c4[_0xf54e('0x50')]);_0x217dfe[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x1ee8c4['model'],qs['fields'](_0x4707fd['query']['fields']));_0x217dfe[_0xf54e('0x53')]=_0x217dfe[_0xf54e('0x53')][_0xf54e('0x55')]?_0x217dfe['attributes']:_0x1ee8c4[_0xf54e('0x4c')];if(!_0x4707fd[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x217dfe[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x4707fd['query']['limit']);_0x217dfe['offset']=qs['offset'](_0x4707fd[_0xf54e('0x50')][_0xf54e('0x31')]);}_0x217dfe[_0xf54e('0x58')]=qs['sort'](_0x4707fd['query'][_0xf54e('0x59')]);_0x217dfe['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x4707fd[_0xf54e('0x50')],_0x1ee8c4[_0xf54e('0x52')]));_0x217dfe['where']['UserId']=_0x197ff4['id'];if(_0x4707fd[_0xf54e('0x50')]['filter']){_0x217dfe['where']=_['merge'](_0x217dfe[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x217dfe[_0xf54e('0x53')],function(_0x3e2c26){var _0x36bbbf={};_0x36bbbf[_0x3e2c26]={'$like':'%'+_0x4707fd['query'][_0xf54e('0x3f')]+'%'};return _0x36bbbf;})});}_0x217dfe=_[_0xf54e('0x5c')]({},_0x217dfe,_0x4707fd[_0xf54e('0x60')]);return db[_0xf54e('0xf6')][_0xf54e('0x34')]({'where':_0x217dfe[_0xf54e('0x5a')]})[_0xf54e('0x21')](function(_0x2905dd){_0x4370ec['count']=_0x2905dd;if(_0x4707fd[_0xf54e('0x50')][_0xf54e('0x61')]){_0x217dfe[_0xf54e('0x62')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x217dfe);})[_0xf54e('0x21')](function(_0x487951){_0x4370ec['rows']=_0x487951;return _0x4370ec;});}})['then'](respondWithFilteredResult(_0x3c4292,_0x217dfe))[_0xf54e('0x2c')](handleError(_0x3c4292,null));};exports['getSmsInteractions']=function(_0xf32eba,_0x19147c,_0x12a333){var _0x3248b5={};var _0x2cb627={};var _0x2340a7;var _0x3fd7d4;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0xf32eba[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x19147c,null))[_0xf54e('0x21')](function(_0x5bffd6){if(_0x5bffd6){_0x2340a7=_0x5bffd6;_0x2cb627['model']=_['keys'](db[_0xf54e('0xf7')][_0xf54e('0x48')]);_0x2cb627['query']=_[_0xf54e('0x51')](_0xf32eba[_0xf54e('0x50')]);_0x2cb627[_0xf54e('0x52')]=_['intersection'](_0x2cb627[_0xf54e('0x4c')],_0x2cb627[_0xf54e('0x50')]);_0x3248b5[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x2cb627['model'],qs[_0xf54e('0x54')](_0xf32eba[_0xf54e('0x50')][_0xf54e('0x54')]));_0x3248b5['attributes']=_0x3248b5[_0xf54e('0x53')][_0xf54e('0x55')]?_0x3248b5['attributes']:_0x2cb627[_0xf54e('0x4c')];_0x3248b5[_0xf54e('0x58')]=qs['sort'](_0xf32eba[_0xf54e('0x50')]['sort']);_0x3248b5[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_['pick'](_0xf32eba[_0xf54e('0x50')],_0x2cb627[_0xf54e('0x52')]));if(_0xf32eba[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x3248b5[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x3248b5['where'],{'$or':_[_0xf54e('0x40')](_0x3248b5['attributes'],function(_0x1908e5){var _0x41ca23={};_0x41ca23[_0x1908e5]={'$like':'%'+_0xf32eba['query'][_0xf54e('0x3f')]+'%'};return _0x41ca23;})});}_0x3248b5=_[_0xf54e('0x5c')]({},_0x3248b5,_0xf32eba[_0xf54e('0x60')]);return _0x2340a7['getSmsInteractions'](_0x3248b5);}})[_0xf54e('0x21')](function(_0x116698){if(_0x116698){_0x3fd7d4=_0x116698[_0xf54e('0x55')];if(!_0xf32eba['query']['hasOwnProperty'](_0xf54e('0x57'))){_0x3248b5[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0xf32eba['query'][_0xf54e('0x33')]);_0x3248b5[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0xf32eba[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x2340a7[_0xf54e('0xf8')](_0x3248b5);}})[_0xf54e('0x21')](function(_0x36acb5){if(_0x36acb5){return _0x36acb5?{'count':_0x3fd7d4,'rows':_0x36acb5}:null;}})['then'](respondWithResult(_0x19147c,null))[_0xf54e('0x2c')](handleError(_0x19147c,null));};exports[_0xf54e('0xf9')]=function(_0x86468e,_0x5440a7,_0x5c28fc){var _0x5d5460={};var _0x46460b={};var _0x2e48f7;var _0x564f9b;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x86468e['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x5440a7,null))['then'](function(_0x2bd5cf){if(_0x2bd5cf){_0x2e48f7=_0x2bd5cf;_0x46460b[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0xfa')]['rawAttributes']);_0x46460b['query']=_[_0xf54e('0x51')](_0x86468e[_0xf54e('0x50')]);_0x46460b[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x46460b[_0xf54e('0x4c')],_0x46460b['query']);_0x5d5460[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x46460b['model'],qs[_0xf54e('0x54')](_0x86468e['query'][_0xf54e('0x54')]));_0x5d5460[_0xf54e('0x53')]=_0x5d5460[_0xf54e('0x53')][_0xf54e('0x55')]?_0x5d5460[_0xf54e('0x53')]:_0x46460b[_0xf54e('0x4c')];_0x5d5460[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x86468e[_0xf54e('0x50')][_0xf54e('0x59')]);_0x5d5460[_0xf54e('0x5a')]=qs['filters'](_[_0xf54e('0x5b')](_0x86468e[_0xf54e('0x50')],_0x46460b['filters']));if(_0x86468e[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x5d5460['where']=_[_0xf54e('0x5c')](_0x5d5460[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x5d5460[_0xf54e('0x53')],function(_0x544e6a){var _0x411d56={};_0x411d56[_0x544e6a]={'$like':'%'+_0x86468e[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x411d56;})});}_0x5d5460=_[_0xf54e('0x5c')]({},_0x5d5460,_0x86468e[_0xf54e('0x60')]);return _0x2e48f7[_0xf54e('0xf9')](_0x5d5460);}})[_0xf54e('0x21')](function(_0x3d9eef){if(_0x3d9eef){_0x564f9b=_0x3d9eef[_0xf54e('0x55')];if(!_0x86468e[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x5d5460['limit']=qs[_0xf54e('0x33')](_0x86468e[_0xf54e('0x50')]['limit']);_0x5d5460[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x86468e[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x2e48f7[_0xf54e('0xf9')](_0x5d5460);}})[_0xf54e('0x21')](function(_0xf5f3e6){if(_0xf5f3e6){return _0xf5f3e6?{'count':_0x564f9b,'rows':_0xf5f3e6}:null;}})['then'](respondWithResult(_0x5440a7,null))[_0xf54e('0x2c')](handleError(_0x5440a7,null));};exports[_0xf54e('0xfb')]=function(_0x1f8304,_0x43632e,_0x170307){var _0x335f7e={};var _0x39f92c={};var _0x3363b0;var _0x1eaf41;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x1f8304[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x43632e,null))[_0xf54e('0x21')](function(_0x143e09){if(_0x143e09){_0x3363b0=_0x143e09;_0x39f92c['model']=_['keys'](db[_0xf54e('0xfc')][_0xf54e('0x48')]);_0x39f92c['query']=_[_0xf54e('0x51')](_0x1f8304[_0xf54e('0x50')]);_0x39f92c['filters']=_[_0xf54e('0x6d')](_0x39f92c[_0xf54e('0x4c')],_0x39f92c[_0xf54e('0x50')]);_0x335f7e['attributes']=_['intersection'](_0x39f92c[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x1f8304[_0xf54e('0x50')][_0xf54e('0x54')]));_0x335f7e[_0xf54e('0x53')]=_0x335f7e[_0xf54e('0x53')]['length']?_0x335f7e['attributes']:_0x39f92c[_0xf54e('0x4c')];_0x335f7e[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x1f8304[_0xf54e('0x50')][_0xf54e('0x59')]);_0x335f7e[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x1f8304['query'],_0x39f92c['filters']));if(_0x1f8304[_0xf54e('0x50')]['filter']){_0x335f7e[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x335f7e['where'],{'$or':_['map'](_0x335f7e[_0xf54e('0x53')],function(_0x28888e){var _0x388208={};_0x388208[_0x28888e]={'$like':'%'+_0x1f8304[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x388208;})});}_0x335f7e=_[_0xf54e('0x5c')]({},_0x335f7e,_0x1f8304[_0xf54e('0x60')]);return _0x3363b0[_0xf54e('0xfb')](_0x335f7e);}})['then'](function(_0x199e88){if(_0x199e88){_0x1eaf41=_0x199e88[_0xf54e('0x55')];if(!_0x1f8304['query'][_0xf54e('0x56')](_0xf54e('0x57'))){_0x335f7e[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x1f8304['query']['limit']);_0x335f7e[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x1f8304['query'][_0xf54e('0x31')]);}return _0x3363b0[_0xf54e('0xfb')](_0x335f7e);}})[_0xf54e('0x21')](function(_0xc5def){if(_0xc5def){return _0xc5def?{'count':_0x1eaf41,'rows':_0xc5def}:null;}})['then'](respondWithResult(_0x43632e,null))['catch'](handleError(_0x43632e,null));};exports['login']=function(_0x4ba90e,_0x58d999,_0x27114a){var _0x481cb9;var _0x283f3b;var _0x1e837d;var _0x2175a1=!_[_0xf54e('0x7e')](_0x4ba90e[_0xf54e('0x6c')]['id'])?_0x4ba90e[_0xf54e('0x6c')]['id']:!_[_0xf54e('0x7e')](_0x4ba90e[_0xf54e('0x94')]['id'])?_0x4ba90e['user']['id']:null;return db[_0xf54e('0x47')]['find']({'where':{'id':_0x2175a1,'role':{'$or':[_0xf54e('0x3b'),_0xf54e('0x94'),'agent']}},'attributes':['id',_0xf54e('0x44'),_0xf54e('0xfd'),_0xf54e('0xfe'),_0xf54e('0x43'),'internal',_0xf54e('0xb6')]})['then'](function(_0x46ab57){if(_0x46ab57){if(_0x46ab57['role']==='agent'){_0x481cb9=_0x46ab57;if(_0x4ba90e[_0xf54e('0x73')]['interface']){_0x1e837d=util['format'](_0xf54e('0xff'),_0x481cb9[_0x4ba90e[_0xf54e('0x73')][_0xf54e('0xb7')]]);}else if(_0x4ba90e[_0xf54e('0x73')][_0xf54e('0x100')]){_0x1e837d=util[_0xf54e('0xc2')](_0xf54e('0xc3'),_0x4ba90e[_0xf54e('0x73')][_0xf54e('0x100')]);}else{_0x1e837d=util[_0xf54e('0xc2')]('SIP/%s',_0x481cb9[_0xf54e('0x44')]);}socket['to'](util[_0xf54e('0xc2')]('user:%s',_0x481cb9['name']))['emit'](_0xf54e('0x101'),{'user':{'id':_0x481cb9['id'],'name':_0x481cb9[_0xf54e('0x44')]},'ip':_0x4ba90e[_0xf54e('0x102')][_0xf54e('0x103')]||_0x4ba90e[_0xf54e('0x104')][_0xf54e('0x105')]||_0x4ba90e[_0xf54e('0x106')][_0xf54e('0x105')]||_0x4ba90e[_0xf54e('0x104')][_0xf54e('0x106')]['remoteAddress']});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x481cb9[_0xf54e('0x44')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xf54e('0xaa'))](_0xf54e('0x107'));}})[_0xf54e('0x21')](function(){if(_0x481cb9){return _0x481cb9[_0xf54e('0x108')]({'raw':!![]});}})[_0xf54e('0x21')](function(_0x43c4e6){if(_0x481cb9){var _0x39cfcf=[];if(_0x43c4e6){_0x283f3b=_0x43c4e6;if(_0x283f3b[_0xf54e('0x55')]){for(var _0x34f8c3=0x0;_0x34f8c3<_0x283f3b[_0xf54e('0x55')];_0x34f8c3++){_0x39cfcf[_0xf54e('0x67')]({'membername':_0x481cb9[_0xf54e('0x44')],'UserId':_0x481cb9['id'],'queue_name':_0x283f3b[_0x34f8c3][_0xf54e('0x44')],'VoiceQueueId':_0x283f3b[_0x34f8c3]['id'],'interface':_0x1e837d,'paused':_0x481cb9[_0xf54e('0xb6')]||![],'penalty':_0x283f3b[_0x34f8c3][_0xf54e('0x109')]||0x0});}return BPromise[_0xf54e('0xa0')](_0x39cfcf,function(_0xa802ca){return db[_0xf54e('0xe9')][_0xf54e('0xc5')](_0xa802ca);});}}}})[_0xf54e('0x21')](function(){if(_0x481cb9){return db['MemberReport'][_0xf54e('0x63')]({'where':{'membername':_0x481cb9['name'],'exitAt':null}});}})[_0xf54e('0x21')](function(_0x4ad4e2){if(_0x481cb9){var _0x4ece40=[];_0x4ad4e2[_0xf54e('0x10a')](function(_0x48ff8d){_0x4ece40[_0xf54e('0x67')](_0x48ff8d['update']({'exitAt':moment()[_0xf54e('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf54e('0x71')](_0x4ece40);}})[_0xf54e('0x21')](function(){if(_0x481cb9){var _0x4a49f7=[];var _0x2ae9f6=[];var _0x112b10=utils[_0xf54e('0x10b')]();var _0x3c8b5f={'membername':_0x481cb9[_0xf54e('0x44')],'interface':_0x1e837d,'enterAt':moment()[_0xf54e('0xc2')](_0xf54e('0x10c')),'role':_0x481cb9[_0xf54e('0x43')],'internal':_0x481cb9[_0xf54e('0x79')]};_0x112b10['forEach'](function(_0x8f8f6e){_0x4a49f7['push'](_[_0xf54e('0x5c')]({'channel':_0x8f8f6e,'type':'LOGIN','data1':_0x4ba90e['body'][_0xf54e('0x10d')],'data2':_0x1e837d},_0x3c8b5f));if(_0x481cb9['loginInPause']){_0x2ae9f6[_0xf54e('0x67')](_[_0xf54e('0x5c')]({'channel':_0x8f8f6e,'type':'PAUSE','data1':_0xf54e('0x10e')},_0x3c8b5f));}});return db[_0xf54e('0x10f')][_0xf54e('0x110')](_0x4a49f7[_0xf54e('0x111')](_0x2ae9f6),{'individualHooks':!![]});}})[_0xf54e('0x21')](function(){if(_0x481cb9){return _0x481cb9[_0xf54e('0x72')]({'online':!![],'lastLoginAt':moment()[_0xf54e('0xc2')](_0xf54e('0x10c')),'voicePause':_0x481cb9[_0xf54e('0xb6')]||![],'mailPause':_0x481cb9['loginInPause']||![],'chatPause':_0x481cb9['loginInPause']||![],'faxPause':_0x481cb9['loginInPause']||![],'smsPause':_0x481cb9['loginInPause']||![],'openchannelPause':_0x481cb9['loginInPause']||![],'whatsappPause':_0x481cb9[_0xf54e('0xb6')]||![],'pauseType':_0x481cb9[_0xf54e('0xb6')]?_0xf54e('0x10e'):null,'interface':_0x1e837d,'lastPauseAt':moment()['format'](_0xf54e('0x10c'))});}})['then'](function(_0x8d14c5){if(_0x4ba90e[_0xf54e('0x112')]){return _0x27114a();}else{return BPromise[_0xf54e('0x113')](_0x8d14c5)[_0xf54e('0x21')](respondWithResult(_0x58d999,null));}})[_0xf54e('0x2c')](handleError(_0x58d999,null));};exports['logout']=function(_0x204f3b,_0x2adead,_0x397997){var _0x165eb8;return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x204f3b[_0xf54e('0x6c')]['id'],'role':_0xf54e('0x3d')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x2adead,null))[_0xf54e('0x21')](function(_0x491064){if(_0x491064){_0x165eb8=_0x491064;return db[_0xf54e('0xe9')][_0xf54e('0x3a')]({'where':{'membername':_0x165eb8[_0xf54e('0x44')]},'individualHooks':!![]});}})[_0xf54e('0x21')](function(){return db[_0xf54e('0x10f')]['findAll']({'where':{'membername':_0x165eb8[_0xf54e('0x44')],'exitAt':null}});})[_0xf54e('0x21')](function(_0x3445ca){var _0x58f292=[];_0x3445ca[_0xf54e('0x10a')](function(_0x1ae4b1){_0x58f292[_0xf54e('0x67')](_0x1ae4b1[_0xf54e('0x72')]({'exitAt':moment()[_0xf54e('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf54e('0x71')](_0x58f292);})[_0xf54e('0x21')](function(){return _0x165eb8[_0xf54e('0x72')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x2adead,null))[_0xf54e('0x2c')](handleError(_0x2adead,null));};exports[_0xf54e('0x114')]=function(_0x46e9e3,_0x4d8a9d,_0x23bf53){var _0x1cf774;return db['UserVoiceQueueRt'][_0xf54e('0x72')]({'paused':0x1},{'where':{'UserId':_0x46e9e3[_0xf54e('0x6c')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x46e9e3['params']['id'],'role':_0xf54e('0x3d')},'attributes':['id',_0xf54e('0x44'),'role',_0xf54e('0x79'),'interface']});})[_0xf54e('0x21')](handleEntityNotFound(_0x4d8a9d,null))[_0xf54e('0x21')](function(_0x1b60ba){if(_0x1b60ba){_0x1cf774=_0x1b60ba;return respondWithRpcPromise(_0xf54e('0x115'),_0xf54e('0x114'),{'id':_0x1cf774['id'],'name':_0x1cf774[_0xf54e('0x44')],'pause':!![]});}})[_0xf54e('0x21')](function(){if(_0x1cf774){return db[_0xf54e('0x10f')][_0xf54e('0x63')]({'where':{'membername':_0x1cf774[_0xf54e('0x44')],'type':_0xf54e('0x116'),'exitAt':null}});}})['then'](function(_0x3e2fb1){if(_0x3e2fb1['length']){var _0x73d8b7=moment()[_0xf54e('0xc2')](_0xf54e('0x10c'));for(var _0x4e649b=0x0,_0x5c9032=_0x3e2fb1[_0xf54e('0x55')];_0x4e649b<_0x5c9032;_0x4e649b++){_0x3e2fb1[_0x4e649b][_0xf54e('0x117')]({'exitAt':_0x73d8b7});}}})[_0xf54e('0x21')](function(){var _0x56e123=[];var _0x3a4999=utils['getChannels']();_0x3a4999[_0xf54e('0x10a')](function(_0x1e117a){_0x56e123[_0xf54e('0x67')]({'channel':_0x1e117a,'membername':_0x1cf774['name'],'interface':_[_0xf54e('0x7e')](_0x1cf774[_0xf54e('0xb7')])?util[_0xf54e('0xc2')](_0xf54e('0xc3'),_0x1cf774[_0xf54e('0x44')]):_0x1cf774[_0xf54e('0xb7')],'type':_0xf54e('0x116'),'enterAt':moment()[_0xf54e('0xc2')](_0xf54e('0x10c')),'data1':_0x46e9e3[_0xf54e('0x73')]['type']||_0xf54e('0x118'),'role':_0x1cf774[_0xf54e('0x43')],'internal':_0x1cf774[_0xf54e('0x79')]});});return db[_0xf54e('0x10f')][_0xf54e('0x110')](_0x56e123,{'individualHooks':!![]});})[_0xf54e('0x21')](function(){return _0x1cf774[_0xf54e('0x72')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x46e9e3[_0xf54e('0x73')]['type']||_0xf54e('0x118'),'lastPauseAt':moment()[_0xf54e('0xc2')](_0xf54e('0x10c'))});})['then'](respondWithResult(_0x4d8a9d,null))['catch'](handleError(_0x4d8a9d,null));};exports[_0xf54e('0x119')]=function(_0x4374e6,_0x525953,_0x5bfb87){var _0x5fda33;return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x4374e6[_0xf54e('0x6c')]['id']},'attributes':['id',_0xf54e('0x44'),_0xf54e('0x43'),_0xf54e('0xc4'),_0xf54e('0x11a'),_0xf54e('0x11b'),_0xf54e('0x11c'),_0xf54e('0x11d'),_0xf54e('0x11e'),_0xf54e('0x11f'),_0xf54e('0x120'),_0xf54e('0x121')]})[_0xf54e('0x21')](handleEntityNotFound(_0x525953,null))['then'](function(_0x3f3d0e){if(_0x3f3d0e){_0x5fda33=_0x3f3d0e;if(_0x4374e6[_0xf54e('0x73')][_0xf54e('0xb4')]&&!utils[_0xf54e('0xe4')](_0x4374e6[_0xf54e('0x73')][_0xf54e('0xb4')])){throw new db['Sequelize']['ValidationError'](_0xf54e('0xc7'));}switch(_0x4374e6['body']['channel']){case _0xf54e('0xc0'):return respondWithRpcPromise(_0xf54e('0x115'),_0xf54e('0x119'),{'id':_0x5fda33['id'],'name':_0x5fda33['name'],'pause':![]})[_0xf54e('0x21')](function(){return db[_0xf54e('0xe9')]['update']({'paused':0x0},{'where':{'UserId':_0x5fda33['id']},'individualHooks':!![]});})[_0xf54e('0x21')](function(){return db[_0xf54e('0x10f')]['find']({'where':{'channel':_0x4374e6[_0xf54e('0x73')]['channel'],'membername':_0x5fda33['name'],'type':_0xf54e('0x116'),'exitAt':null}});})[_0xf54e('0x21')](function(_0x1e33b8){if(_0x1e33b8){return _0x1e33b8[_0xf54e('0x72')]({'exitAt':moment()['format'](_0xf54e('0x10c')),'data2':_0xf54e('0x122')},{'individualHooks':!![]});}return null;})[_0xf54e('0x21')](function(){return _0x5fda33['update']({'voicePause':![]});});case'mail':case _0xf54e('0x68'):case _0xf54e('0x6f'):case _0xf54e('0x6e'):case _0xf54e('0x123'):case _0xf54e('0x6a'):return db[_0xf54e('0x10f')][_0xf54e('0x76')]({'where':{'channel':_0x4374e6[_0xf54e('0x73')]['channel'],'membername':_0x5fda33[_0xf54e('0x44')],'type':_0xf54e('0x116'),'exitAt':null}})['then'](function(_0x48ed42){if(_0x48ed42){return _0x48ed42[_0xf54e('0x72')]({'exitAt':moment()['format'](_0xf54e('0x10c')),'data2':_0xf54e('0x122')},{'individualHooks':!![]});}return null;})[_0xf54e('0x21')](function(){var _0x142ba5={};_['set'](_0x142ba5,util['format'](_0xf54e('0x124'),_0x4374e6[_0xf54e('0x73')]['channel'],_0xf54e('0x125')),![]);return _0x5fda33[_0xf54e('0x72')](_0x142ba5);});default:return respondWithRpcPromise(_0xf54e('0x115'),'unpause',{'id':_0x5fda33['id'],'name':_0x5fda33[_0xf54e('0x44')],'pause':![]})[_0xf54e('0x21')](function(){return db[_0xf54e('0xe9')]['update']({'paused':0x0},{'where':{'UserId':_0x5fda33['id']}});})[_0xf54e('0x21')](function(){return db[_0xf54e('0x10f')]['findAll']({'where':{'membername':_0x5fda33['name'],'type':_0xf54e('0x116'),'exitAt':null}});})[_0xf54e('0x21')](function(_0x111b2a){var _0x396e89=[];_0x111b2a[_0xf54e('0x10a')](function(_0x115602){_0x396e89[_0xf54e('0x67')](_0x115602[_0xf54e('0x72')]({'exitAt':moment()[_0xf54e('0xc2')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xf54e('0x122')}));});return BPromise[_0xf54e('0x71')](_0x396e89);})['then'](function(){return _0x5fda33[_0xf54e('0x72')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xf54e('0x21')](respondWithResult(_0x525953,null))[_0xf54e('0x2c')](handleError(_0x525953,null));};exports['getTeams']=function(_0x134388,_0x3ef99d,_0x1b00dd){var _0x426336={};var _0x33cde2={};var _0x4030c2;var _0x485755;return db['User']['findOne']({'where':{'id':_0x134388[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3ef99d,null))[_0xf54e('0x21')](function(_0x5d22f5){if(_0x5d22f5){_0x4030c2=_0x5d22f5;_0x33cde2[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0x126')]['rawAttributes']);_0x33cde2[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x134388[_0xf54e('0x50')]);_0x33cde2[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x33cde2[_0xf54e('0x4c')],_0x33cde2[_0xf54e('0x50')]);_0x426336['attributes']=_[_0xf54e('0x6d')](_0x33cde2['model'],qs[_0xf54e('0x54')](_0x134388[_0xf54e('0x50')][_0xf54e('0x54')]));_0x426336['attributes']=_0x426336[_0xf54e('0x53')][_0xf54e('0x55')]?_0x426336[_0xf54e('0x53')]:_0x33cde2[_0xf54e('0x4c')];_0x426336['order']=qs['sort'](_0x134388['query'][_0xf54e('0x59')]);_0x426336['where']=qs['filters'](_['pick'](_0x134388['query'],_0x33cde2[_0xf54e('0x52')]));if(_0x134388[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x426336['where']=_[_0xf54e('0x5c')](_0x426336['where'],{'$or':_[_0xf54e('0x40')](_0x426336[_0xf54e('0x53')],function(_0x423d72){var _0x396bf5={};_0x396bf5[_0x423d72]={'$like':'%'+_0x134388[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x396bf5;})});}_0x426336=_[_0xf54e('0x5c')]({},_0x426336,_0x134388[_0xf54e('0x60')]);return _0x4030c2[_0xf54e('0x127')](_0x426336);}})[_0xf54e('0x21')](function(_0x191831){if(_0x191831){_0x485755=_0x191831[_0xf54e('0x55')];if(!_0x134388['query'][_0xf54e('0x56')]('nolimit')){_0x426336['limit']=qs[_0xf54e('0x33')](_0x134388[_0xf54e('0x50')][_0xf54e('0x33')]);_0x426336[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x134388[_0xf54e('0x50')]['offset']);}return _0x4030c2[_0xf54e('0x127')](_0x426336);}})[_0xf54e('0x21')](function(_0x13f7ba){if(_0x13f7ba){return _0x13f7ba?{'count':_0x485755,'rows':_0x13f7ba}:null;}})[_0xf54e('0x21')](respondWithResult(_0x3ef99d,null))[_0xf54e('0x2c')](handleError(_0x3ef99d,null));};exports[_0xf54e('0x128')]=function(_0x4ae0c6,_0x4cc4e0){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x4ae0c6[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x4cc4e0,null))[_0xf54e('0x21')](function(_0x25c29c){if(_0x25c29c){var _0x14d76a=_0x25c29c[_0xf54e('0xe6')]({'plain':!![]});return _0x25c29c['addTeams'](_0x4ae0c6[_0xf54e('0x73')]['ids'],_[_0xf54e('0x78')](_0x4ae0c6['body'],['ids','id'])||{})[_0xf54e('0x21')](function(){for(var _0x5916f6=0x0;_0x5916f6<_0x4ae0c6[_0xf54e('0x73')]['ids'][_0xf54e('0x55')];_0x5916f6++){var _0x8212ed=[];db[_0xf54e('0x126')][_0xf54e('0xae')]({'where':{'id':_0x4ae0c6['body'][_0xf54e('0x77')][_0x5916f6]}})[_0xf54e('0x21')](function(_0x476ac0){_0x8212ed['push'](_0x476ac0[_0xf54e('0x108')]()[_0xf54e('0x21')](function(_0x44bf28){for(var _0x506eaf=0x0;_0x506eaf<_0x44bf28[_0xf54e('0x55')];_0x506eaf++){_0x44bf28[_0x506eaf][_0xf54e('0x129')](_0xf54e('0xb4'),_0xf54e('0x12a'));}return _0x44bf28;}));_0x8212ed[_0xf54e('0x67')](_0x476ac0['getChatQueues']()[_0xf54e('0x21')](function(_0x3517f7){for(var _0x500d22=0x0;_0x500d22<_0x3517f7[_0xf54e('0x55')];_0x500d22++){_0x3517f7[_0x500d22][_0xf54e('0x129')](_0xf54e('0xb4'),_0xf54e('0x12b'));}return _0x3517f7;}));_0x8212ed['push'](_0x476ac0['getMailQueues']()[_0xf54e('0x21')](function(_0x320c2c){for(var _0x4f99f2=0x0;_0x4f99f2<_0x320c2c[_0xf54e('0x55')];_0x4f99f2++){_0x320c2c[_0x4f99f2]['setDataValue'](_0xf54e('0xb4'),_0xf54e('0x12c'));}return _0x320c2c;}));_0x8212ed[_0xf54e('0x67')](_0x476ac0[_0xf54e('0x12d')]()[_0xf54e('0x21')](function(_0x4cb146){for(var _0x20bc10=0x0;_0x20bc10<_0x4cb146[_0xf54e('0x55')];_0x20bc10++){_0x4cb146[_0x20bc10][_0xf54e('0x129')](_0xf54e('0xb4'),_0xf54e('0x12e'));}return _0x4cb146;}));_0x8212ed[_0xf54e('0x67')](_0x476ac0[_0xf54e('0x12f')]()[_0xf54e('0x21')](function(_0x575728){for(var _0x4b2a02=0x0;_0x4b2a02<_0x575728[_0xf54e('0x55')];_0x4b2a02++){_0x575728[_0x4b2a02][_0xf54e('0x129')]('channel',_0xf54e('0x130'));}return _0x575728;}));_0x8212ed['push'](_0x476ac0[_0xf54e('0x131')]()['then'](function(_0x357fa4){for(var _0x3052db=0x0;_0x3052db<_0x357fa4['length'];_0x3052db++){_0x357fa4[_0x3052db][_0xf54e('0x129')](_0xf54e('0xb4'),_0xf54e('0x132'));}return _0x357fa4;}));_0x8212ed[_0xf54e('0x67')](_0x476ac0[_0xf54e('0x133')]()[_0xf54e('0x21')](function(_0x1bc3ee){for(var _0x379275=0x0;_0x379275<_0x1bc3ee[_0xf54e('0x55')];_0x379275++){_0x1bc3ee[_0x379275][_0xf54e('0x129')](_0xf54e('0xb4'),'Openchannel');}return _0x1bc3ee;}));return BPromise[_0xf54e('0x71')](_0x8212ed);})['then'](function(_0x58288e){var _0x10664a=_[_0xf54e('0x134')](_0x58288e);_0x8212ed=[];return db['sequelize'][_0xf54e('0x135')](function(_0x350163){for(var _0x1366f3=0x0;_0x1366f3<_0x10664a[_0xf54e('0x55')];_0x1366f3++){_0x8212ed[_0xf54e('0x67')](_0x10664a[_0x1366f3][_0xf54e('0x136')](_0x14d76a['id']),{'transaction':_0x350163});}return BPromise['all'](_0x8212ed)['then'](function(){if(_0x14d76a[_0xf54e('0xb5')]){return BPromise[_0xf54e('0xa0')](_['filter'](_0x10664a,function(_0x1c2842){return _0x1c2842[_0xf54e('0x137')](_0xf54e('0xb4'))===_0xf54e('0x12a');}),function(_0x47e5ea){return db[_0xf54e('0xe9')][_0xf54e('0xc5')]({'membername':_0x14d76a['name'],'UserId':_0x14d76a['id'],'queue_name':_0x47e5ea['name'],'VoiceQueueId':_0x47e5ea['id'],'interface':_[_0xf54e('0x7e')](_0x14d76a['interface'])?util['format'](_0xf54e('0xc3'),_0x14d76a[_0xf54e('0x44')]):_0x14d76a['interface'],'paused':_0x14d76a[_0xf54e('0xc4')]||![],'penalty':_0x14d76a['penalty']},{'transaction':_0x350163});});}else{return;}})[_0xf54e('0x21')](function(){for(var _0x4086ac=0x0;_0x4086ac<_0x10664a[_0xf54e('0x55')];_0x4086ac++){var _0x18e121=_0x10664a[_0x4086ac][_0xf54e('0x137')](_0xf54e('0xb4'));var _0x39b31e=_0x18e121+_0xf54e('0xbd');socket[_0xf54e('0xbe')](_0xf54e('0x94')+_0x18e121+_0xf54e('0xbf'),{'UserId':_0x14d76a['id'],['queueField']:_0x10664a[_0x4086ac]['id']});}});});});}});}})[_0xf54e('0x21')](respondWithStatusCode(_0x4cc4e0,null))['catch'](handleError(_0x4cc4e0,null));};exports[_0xf54e('0x138')]=function(_0x74c06,_0x952580){return db[_0xf54e('0x47')]['findOne']({'where':{'id':_0x74c06[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x952580,null))[_0xf54e('0x21')](function(_0x42be75){if(_0x42be75){var _0x10a46e=_0x42be75[_0xf54e('0xe6')]({'plain':!![]});var _0x177cab=_0x74c06['query'][_0xf54e('0x77')];return _0x42be75['removeTeams'](_0x177cab)[_0xf54e('0x21')](function(){for(var _0xbdb57f=0x0;_0xbdb57f<_0x177cab['length'];_0xbdb57f++){var _0x3c8e45=[];db[_0xf54e('0x126')][_0xf54e('0xae')]({'where':{'id':_0x177cab[_0xbdb57f]}})['then'](function(_0x5ada57){_0x3c8e45[_0xf54e('0x67')](_0x5ada57[_0xf54e('0x108')]()[_0xf54e('0x21')](function(_0x56d958){for(var _0x127f30=0x0;_0x127f30<_0x56d958[_0xf54e('0x55')];_0x127f30++){_0x56d958[_0x127f30][_0xf54e('0x129')](_0xf54e('0xb4'),'Voice');}return _0x56d958;}));_0x3c8e45['push'](_0x5ada57[_0xf54e('0x139')]()[_0xf54e('0x21')](function(_0x56398c){for(var _0x47b551=0x0;_0x47b551<_0x56398c[_0xf54e('0x55')];_0x47b551++){_0x56398c[_0x47b551]['setDataValue'](_0xf54e('0xb4'),_0xf54e('0x12b'));}return _0x56398c;}));_0x3c8e45[_0xf54e('0x67')](_0x5ada57[_0xf54e('0x13a')]()[_0xf54e('0x21')](function(_0x514adb){for(var _0x16773c=0x0;_0x16773c<_0x514adb['length'];_0x16773c++){_0x514adb[_0x16773c][_0xf54e('0x129')](_0xf54e('0xb4'),_0xf54e('0x12c'));}return _0x514adb;}));_0x3c8e45['push'](_0x5ada57['getSmsQueues']()[_0xf54e('0x21')](function(_0x342862){for(var _0x5ea232=0x0;_0x5ea232<_0x342862[_0xf54e('0x55')];_0x5ea232++){_0x342862[_0x5ea232][_0xf54e('0x129')]('channel',_0xf54e('0x12e'));}return _0x342862;}));_0x3c8e45[_0xf54e('0x67')](_0x5ada57['getWhatsappQueues']()[_0xf54e('0x21')](function(_0x21aa89){for(var _0x431e48=0x0;_0x431e48<_0x21aa89[_0xf54e('0x55')];_0x431e48++){_0x21aa89[_0x431e48]['setDataValue'](_0xf54e('0xb4'),_0xf54e('0x130'));}return _0x21aa89;}));_0x3c8e45[_0xf54e('0x67')](_0x5ada57[_0xf54e('0x131')]()['then'](function(_0x4c2623){for(var _0x4ddd51=0x0;_0x4ddd51<_0x4c2623[_0xf54e('0x55')];_0x4ddd51++){_0x4c2623[_0x4ddd51][_0xf54e('0x129')](_0xf54e('0xb4'),'Fax');}return _0x4c2623;}));_0x3c8e45[_0xf54e('0x67')](_0x5ada57[_0xf54e('0x133')]()[_0xf54e('0x21')](function(_0x4ca79a){for(var _0x22caaa=0x0;_0x22caaa<_0x4ca79a[_0xf54e('0x55')];_0x22caaa++){_0x4ca79a[_0x22caaa][_0xf54e('0x129')]('channel',_0xf54e('0x13b'));}return _0x4ca79a;}));return BPromise['all'](_0x3c8e45);})[_0xf54e('0x21')](function(_0x55eb9){var _0x464f08=_[_0xf54e('0x134')](_0x55eb9);_0x3c8e45=[];return db[_0xf54e('0x5e')][_0xf54e('0x135')](function(_0x28bda1){for(var _0x387a3c=0x0;_0x387a3c<_0x464f08[_0xf54e('0x55')];_0x387a3c++){_0x3c8e45[_0xf54e('0x67')](_0x464f08[_0x387a3c][_0xf54e('0x13c')](_0x10a46e['id']),{'transaction':_0x28bda1});}return BPromise[_0xf54e('0x71')](_0x3c8e45)[_0xf54e('0x21')](function(){if(_0x10a46e[_0xf54e('0xb5')]){return BPromise[_0xf54e('0xa0')](_['filter'](_0x464f08,function(_0x1cee75){return _0x1cee75[_0xf54e('0x137')]('channel')===_0xf54e('0x12a');}),function(_0x13950e){return db['UserVoiceQueueRt'][_0xf54e('0x3a')]({'where':{'VoiceQueueId':_0x13950e['id'],'UserId':_0x10a46e['id']},'transaction':_0x28bda1});});}else{return;}})[_0xf54e('0x21')](function(){for(var _0x2fe6ec=0x0;_0x2fe6ec<_0x464f08[_0xf54e('0x55')];_0x2fe6ec++){var _0x404f37=_0x464f08[_0x2fe6ec][_0xf54e('0x137')](_0xf54e('0xb4'));var _0x530be6=_0x404f37+_0xf54e('0xbd');socket[_0xf54e('0xbe')](_0xf54e('0x94')+_0x404f37+'Queue:remove',{'UserId':_0x10a46e['id'],['queueField']:_0x464f08[_0x2fe6ec]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x952580,null))[_0xf54e('0x2c')](handleError(_0x952580,null));};exports[_0xf54e('0x13d')]=function(_0x10946f,_0xeece25,_0x40fb4c){var _0x4b1db7={};var _0x322a31={};var _0xd6be66;var _0x22b979;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x10946f[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xeece25,null))[_0xf54e('0x21')](function(_0x26ebd2){if(_0x26ebd2){_0xd6be66=_0x26ebd2;_0x322a31[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0xdf')][_0xf54e('0x48')]);_0x322a31[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x10946f['query']);_0x322a31['filters']=_['intersection'](_0x322a31['model'],_0x322a31[_0xf54e('0x50')]);_0x4b1db7['attributes']=_[_0xf54e('0x6d')](_0x322a31[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x10946f[_0xf54e('0x50')]['fields']));_0x4b1db7[_0xf54e('0x53')]=_0x4b1db7[_0xf54e('0x53')]['length']?_0x4b1db7[_0xf54e('0x53')]:_0x322a31['model'];_0x4b1db7[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x10946f['query'][_0xf54e('0x59')]);_0x4b1db7[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x10946f[_0xf54e('0x50')],_0x322a31[_0xf54e('0x52')]));if(_0x10946f[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x4b1db7[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x4b1db7[_0xf54e('0x5a')],{'$or':_['map'](_0x4b1db7['attributes'],function(_0x4af436){var _0x28d2c9={};_0x28d2c9[_0x4af436]={'$like':'%'+_0x10946f[_0xf54e('0x50')]['filter']+'%'};return _0x28d2c9;})});}_0x4b1db7=_[_0xf54e('0x5c')]({},_0x4b1db7,_0x10946f[_0xf54e('0x60')]);return _0xd6be66[_0xf54e('0x13d')](_0x4b1db7);}})['then'](function(_0x44b23c){if(_0x44b23c){_0x22b979=_0x44b23c[_0xf54e('0x55')];if(!_0x10946f['query'][_0xf54e('0x56')](_0xf54e('0x57'))){_0x4b1db7[_0xf54e('0x33')]=qs['limit'](_0x10946f[_0xf54e('0x50')][_0xf54e('0x33')]);_0x4b1db7[_0xf54e('0x31')]=qs['offset'](_0x10946f[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0xd6be66['getLists'](_0x4b1db7);}})[_0xf54e('0x21')](function(_0x1b1c68){if(_0x1b1c68){return _0x1b1c68?{'count':_0x22b979,'rows':_0x1b1c68}:null;}})[_0xf54e('0x21')](respondWithResult(_0xeece25,null))['catch'](handleError(_0xeece25,null));};exports[_0xf54e('0x13e')]=function(_0x255b08,_0x2a631a,_0x16c0d8){var _0x5c35fb={};var _0x40d4a1={};var _0x1e928c;var _0x75f7bc;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x255b08[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x2a631a,null))[_0xf54e('0x21')](function(_0x49f3fe){if(_0x49f3fe){_0x1e928c=_0x49f3fe;_0x40d4a1[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0x47')][_0xf54e('0x48')]);_0x40d4a1['query']=_['keys'](_0x255b08[_0xf54e('0x50')]);_0x40d4a1[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x40d4a1[_0xf54e('0x4c')],_0x40d4a1[_0xf54e('0x50')]);_0x5c35fb[_0xf54e('0x53')]=_['intersection'](_0x40d4a1[_0xf54e('0x4c')],qs['fields'](_0x255b08['query'][_0xf54e('0x54')]));_0x5c35fb[_0xf54e('0x53')]=_0x5c35fb[_0xf54e('0x53')][_0xf54e('0x55')]?_0x5c35fb[_0xf54e('0x53')]:_0x40d4a1['model'];_0x5c35fb[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x255b08['query'][_0xf54e('0x59')]);_0x5c35fb['where']=qs[_0xf54e('0x52')](_['pick'](_0x255b08[_0xf54e('0x50')],_0x40d4a1[_0xf54e('0x52')]));if(_0x255b08[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x5c35fb['where']=_['merge'](_0x5c35fb['where'],{'$or':_['map'](_0x5c35fb['attributes'],function(_0x49cd90){var _0x24338b={};_0x24338b[_0x49cd90]={'$like':'%'+_0x255b08[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x24338b;})});}_0x5c35fb[_0xf54e('0x4c')]=db[_0xf54e('0x47')];_0x5c35fb['as']=_0xf54e('0x3c');_0x5c35fb=_[_0xf54e('0x5c')]({},_0x5c35fb,_0x255b08[_0xf54e('0x60')]);return _0x1e928c[_0xf54e('0x108')]({'include':[_0x5c35fb]});}})['then'](function(_0x1b6680){if(_0x1b6680){var _0x2eda57={},_0x493da7=[],_0x89fdd6=0x0;for(var _0x125f5c=0x0;_0x125f5c<_0x1b6680['length'];_0x125f5c+=0x1){for(var _0x122c52=0x0,_0x49cc42;_0x122c52<_0x1b6680[_0x125f5c][_0xf54e('0x3c')][_0xf54e('0x55')];_0x122c52+=0x1){_0x49cc42=_0x1b6680[_0x125f5c][_0xf54e('0x3c')][_0x122c52][_0xf54e('0xe6')]({'plain':!![]});_0x2eda57[_0x49cc42['id']]=_0x49cc42;}}_0x2eda57=_[_0xf54e('0x13f')](_0x2eda57);for(var _0x3f8069=qs[_0xf54e('0x31')](_0x255b08[_0xf54e('0x50')][_0xf54e('0x31')]);_0x3f8069<_0x2eda57[_0xf54e('0x55')]&&_0x493da7[_0xf54e('0x55')]<qs[_0xf54e('0x33')](_0x255b08[_0xf54e('0x50')][_0xf54e('0x33')]);_0x3f8069+=0x1){if(_0x2eda57[_0x3f8069]){_0x493da7[_0xf54e('0x67')](_0x2eda57[_0x3f8069]);}}return{'count':_0x2eda57[_0xf54e('0x55')],'rows':_0x493da7};}})['then'](respondWithResult(_0x2a631a,null))[_0xf54e('0x2c')](handleError(_0x2a631a,null));};exports[_0xf54e('0x3a')]=function(_0x138e47,_0xd18c48){if(_0x138e47[_0xf54e('0x94')]['id']==_0x138e47['params']['id']){return _0xd18c48[_0xf54e('0x2e')](0x1f4)['send']({'message':_0xf54e('0x140')});}return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x138e47[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xd18c48,null))[_0xf54e('0x21')](removeEntity(_0xd18c48,null))[_0xf54e('0x2c')](handleError(_0xd18c48,null));};exports[_0xf54e('0x141')]=function(_0x258afc,_0x4fb852,_0x3e9255){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x258afc[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x4fb852,null))[_0xf54e('0x21')](function(_0x5ebd65){if(_0x5ebd65){return _0x5ebd65['addChatInteractions'](_0x258afc[_0xf54e('0x73')][_0xf54e('0x77')],_['omit'](_0x258afc['body'],[_0xf54e('0x77'),'id'])||{})[_0xf54e('0xbb')](function(){for(var _0x58cb07=0x0;_0x58cb07<_0x258afc['body'][_0xf54e('0x77')][_0xf54e('0x55')];_0x58cb07+=0x1){socket['emit'](_0xf54e('0x142'),{'ChatInteractionId':Number(_0x258afc[_0xf54e('0x73')]['ids'][_0x58cb07]),'UserId':Number(_0x258afc[_0xf54e('0x6c')]['id'])});}return _0x258afc[_0xf54e('0x73')][_0xf54e('0x77')];});}})[_0xf54e('0x21')](respondWithResult(_0x4fb852,null))[_0xf54e('0x2c')](handleError(_0x4fb852,null));};exports['removeChatInteractions']=function(_0x206229,_0x480f04,_0x452a19){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x206229[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x480f04,null))[_0xf54e('0x21')](function(_0x309731){if(_0x309731){return _0x309731['removeChatInteractions'](_0x206229[_0xf54e('0x50')][_0xf54e('0x77')])[_0xf54e('0x21')](function(){if(_[_0xf54e('0x143')](_0x206229[_0xf54e('0x50')][_0xf54e('0x77')])){for(var _0x465c7b=0x0;_0x465c7b<_0x206229['query'][_0xf54e('0x77')][_0xf54e('0x55')];_0x465c7b+=0x1){socket[_0xf54e('0xbe')](_0xf54e('0x144'),{'ChatInteractionId':Number(_0x206229[_0xf54e('0x50')][_0xf54e('0x77')][_0x465c7b]),'UserId':Number(_0x206229[_0xf54e('0x6c')]['id'])});}}else{socket['emit'](_0xf54e('0x144'),{'ChatInteractionId':Number(_0x206229['query']['ids']),'UserId':Number(_0x206229['params']['id'])});}});}})[_0xf54e('0x21')](respondWithStatusCode(_0x480f04,null))['catch'](handleError(_0x480f04,null));};exports[_0xf54e('0x145')]=function(_0x27ccdf,_0xbbbf6d,_0x590b05){return db[_0xf54e('0x47')]['find']({'where':{'id':_0x27ccdf[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xbbbf6d,null))[_0xf54e('0x21')](function(_0x162942){if(_0x162942){return _0x162942['addMailInteractions'](_0x27ccdf[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x27ccdf[_0xf54e('0x73')],[_0xf54e('0x77'),'id'])||{})[_0xf54e('0xbb')](function(){for(var _0x16514d=0x0;_0x16514d<_0x27ccdf[_0xf54e('0x73')][_0xf54e('0x77')][_0xf54e('0x55')];_0x16514d+=0x1){socket['emit'](_0xf54e('0x146'),{'MailInteractionId':Number(_0x27ccdf[_0xf54e('0x73')][_0xf54e('0x77')][_0x16514d]),'UserId':Number(_0x27ccdf[_0xf54e('0x6c')]['id'])});}return _0x27ccdf[_0xf54e('0x73')][_0xf54e('0x77')];});}})['then'](respondWithResult(_0xbbbf6d,null))[_0xf54e('0x2c')](handleError(_0xbbbf6d,null));};exports[_0xf54e('0x147')]=function(_0x25f226,_0x7a1497,_0x1c5073){return db[_0xf54e('0x47')]['find']({'where':{'id':_0x25f226['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x7a1497,null))[_0xf54e('0x21')](function(_0x477bfe){if(_0x477bfe){return _0x477bfe['removeMailInteractions'](_0x25f226[_0xf54e('0x50')][_0xf54e('0x77')])[_0xf54e('0x21')](function(){if(_[_0xf54e('0x143')](_0x25f226[_0xf54e('0x50')][_0xf54e('0x77')])){for(var _0x1f02ce=0x0;_0x1f02ce<_0x25f226[_0xf54e('0x50')][_0xf54e('0x77')]['length'];_0x1f02ce+=0x1){socket['emit'](_0xf54e('0x148'),{'MailInteractionId':Number(_0x25f226[_0xf54e('0x50')][_0xf54e('0x77')][_0x1f02ce]),'UserId':Number(_0x25f226['params']['id'])});}}else{socket[_0xf54e('0xbe')](_0xf54e('0x148'),{'MailInteractionId':Number(_0x25f226[_0xf54e('0x50')][_0xf54e('0x77')]),'UserId':Number(_0x25f226[_0xf54e('0x6c')]['id'])});}});}})[_0xf54e('0x21')](respondWithStatusCode(_0x7a1497,null))['catch'](handleError(_0x7a1497,null));};exports['addFaxInteractions']=function(_0x4cadda,_0x5c7ead,_0x482449){return db['User']['find']({'where':{'id':_0x4cadda[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x5c7ead,null))[_0xf54e('0x21')](function(_0x46421d){if(_0x46421d){return _0x46421d[_0xf54e('0x149')](_0x4cadda[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x4cadda['body'],['ids','id'])||{})[_0xf54e('0xbb')](function(){for(var _0x445542=0x0;_0x445542<_0x4cadda['body']['ids']['length'];_0x445542+=0x1){socket['emit'](_0xf54e('0x14a'),{'FaxInteractionId':Number(_0x4cadda[_0xf54e('0x73')]['ids'][_0x445542]),'UserId':Number(_0x4cadda[_0xf54e('0x6c')]['id'])});}return _0x4cadda['body'][_0xf54e('0x77')];});}})['then'](respondWithResult(_0x5c7ead,null))[_0xf54e('0x2c')](handleError(_0x5c7ead,null));};exports['removeFaxInteractions']=function(_0x565172,_0x2cf2ea,_0x37d5ed){return db[_0xf54e('0x47')]['find']({'where':{'id':_0x565172[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x2cf2ea,null))[_0xf54e('0x21')](function(_0x3d3cd1){if(_0x3d3cd1){return _0x3d3cd1[_0xf54e('0x14b')](_0x565172[_0xf54e('0x50')][_0xf54e('0x77')])[_0xf54e('0x21')](function(){if(_[_0xf54e('0x143')](_0x565172[_0xf54e('0x50')]['ids'])){for(var _0x17c0a8=0x0;_0x17c0a8<_0x565172[_0xf54e('0x50')]['ids'][_0xf54e('0x55')];_0x17c0a8+=0x1){socket['emit'](_0xf54e('0x14c'),{'FaxInteractionId':Number(_0x565172[_0xf54e('0x50')][_0xf54e('0x77')][_0x17c0a8]),'UserId':Number(_0x565172['params']['id'])});}}else{socket['emit'](_0xf54e('0x14c'),{'FaxInteractionId':Number(_0x565172[_0xf54e('0x50')][_0xf54e('0x77')]),'UserId':Number(_0x565172[_0xf54e('0x6c')]['id'])});}});}})[_0xf54e('0x21')](respondWithStatusCode(_0x2cf2ea,null))[_0xf54e('0x2c')](handleError(_0x2cf2ea,null));};exports[_0xf54e('0x14d')]=function(_0x13a634,_0x3b1b59,_0x43e004){return db['User'][_0xf54e('0x76')]({'where':{'id':_0x13a634[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3b1b59,null))['then'](function(_0x30faca){if(_0x30faca){return _0x30faca['addSmsInteractions'](_0x13a634[_0xf54e('0x73')]['ids'],_[_0xf54e('0x78')](_0x13a634[_0xf54e('0x73')],['ids','id'])||{})['spread'](function(){for(var _0x24c201=0x0;_0x24c201<_0x13a634[_0xf54e('0x73')][_0xf54e('0x77')][_0xf54e('0x55')];_0x24c201+=0x1){socket[_0xf54e('0xbe')](_0xf54e('0x14e'),{'SmsInteractionId':Number(_0x13a634['body']['ids'][_0x24c201]),'UserId':Number(_0x13a634[_0xf54e('0x6c')]['id'])});}return _0x13a634['body'][_0xf54e('0x77')];});}})['then'](respondWithResult(_0x3b1b59,null))['catch'](handleError(_0x3b1b59,null));};exports[_0xf54e('0x14f')]=function(_0x2c7cbb,_0x47c301,_0x1df218){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x2c7cbb['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x47c301,null))['then'](function(_0x1a5efd){if(_0x1a5efd){return _0x1a5efd[_0xf54e('0x14f')](_0x2c7cbb[_0xf54e('0x50')][_0xf54e('0x77')])['then'](function(){if(_[_0xf54e('0x143')](_0x2c7cbb[_0xf54e('0x50')][_0xf54e('0x77')])){for(var _0x4557c4=0x0;_0x4557c4<_0x2c7cbb[_0xf54e('0x50')][_0xf54e('0x77')][_0xf54e('0x55')];_0x4557c4+=0x1){socket['emit'](_0xf54e('0x150'),{'SmsInteractionId':Number(_0x2c7cbb[_0xf54e('0x50')]['ids'][_0x4557c4]),'UserId':Number(_0x2c7cbb[_0xf54e('0x6c')]['id'])});}}else{socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2c7cbb[_0xf54e('0x50')][_0xf54e('0x77')]),'UserId':Number(_0x2c7cbb['params']['id'])});}});}})[_0xf54e('0x21')](respondWithStatusCode(_0x47c301,null))['catch'](handleError(_0x47c301,null));};exports[_0xf54e('0x151')]=function(_0x25e0c6,_0x16e37e,_0x255dfb){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x25e0c6[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x16e37e,null))[_0xf54e('0x21')](function(_0x24ecd3){if(_0x24ecd3){return _0x24ecd3[_0xf54e('0x151')](_0x25e0c6[_0xf54e('0x73')]['ids'],_[_0xf54e('0x78')](_0x25e0c6[_0xf54e('0x73')],[_0xf54e('0x77'),'id'])||{})['spread'](function(){for(var _0x451ac5=0x0;_0x451ac5<_0x25e0c6[_0xf54e('0x73')]['ids'][_0xf54e('0x55')];_0x451ac5+=0x1){socket[_0xf54e('0xbe')](_0xf54e('0x152'),{'OpenchannelInteractionId':Number(_0x25e0c6['body'][_0xf54e('0x77')][_0x451ac5]),'UserId':Number(_0x25e0c6['params']['id'])});}return _0x25e0c6[_0xf54e('0x73')][_0xf54e('0x77')];});}})[_0xf54e('0x21')](respondWithResult(_0x16e37e,null))['catch'](handleError(_0x16e37e,null));};exports[_0xf54e('0x153')]=function(_0x4a8c4b,_0x21ed63,_0x5d370b){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x4a8c4b[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x21ed63,null))[_0xf54e('0x21')](function(_0x160ea0){if(_0x160ea0){return _0x160ea0['removeOpenchannelInteractions'](_0x4a8c4b['query'][_0xf54e('0x77')])[_0xf54e('0x21')](function(){if(_[_0xf54e('0x143')](_0x4a8c4b[_0xf54e('0x50')][_0xf54e('0x77')])){for(var _0x2e2165=0x0;_0x2e2165<_0x4a8c4b[_0xf54e('0x50')][_0xf54e('0x77')][_0xf54e('0x55')];_0x2e2165+=0x1){socket['emit'](_0xf54e('0x154'),{'OpenchannelInteractionId':Number(_0x4a8c4b[_0xf54e('0x50')]['ids'][_0x2e2165]),'UserId':Number(_0x4a8c4b['params']['id'])});}}else{socket['emit'](_0xf54e('0x154'),{'OpenchannelInteractionId':Number(_0x4a8c4b['query']['ids']),'UserId':Number(_0x4a8c4b['params']['id'])});}});}})[_0xf54e('0x21')](respondWithStatusCode(_0x21ed63,null))[_0xf54e('0x2c')](handleError(_0x21ed63,null));};exports[_0xf54e('0x155')]=function(_0x1e32ec,_0x399e41,_0x422eab){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x1e32ec[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x399e41,null))[_0xf54e('0x21')](function(_0x490541){if(_0x490541){return _0x490541[_0xf54e('0x155')](_0x1e32ec[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x1e32ec['body'],[_0xf54e('0x77'),'id'])||{})[_0xf54e('0xbb')](function(){for(var _0x35f055=0x0;_0x35f055<_0x1e32ec[_0xf54e('0x73')][_0xf54e('0x77')][_0xf54e('0x55')];_0x35f055+=0x1){socket[_0xf54e('0xbe')](_0xf54e('0x156'),{'WhatsappInteractionId':Number(_0x1e32ec[_0xf54e('0x73')][_0xf54e('0x77')][_0x35f055]),'UserId':Number(_0x1e32ec['params']['id'])});}return _0x1e32ec[_0xf54e('0x73')][_0xf54e('0x77')];});}})[_0xf54e('0x21')](respondWithResult(_0x399e41,null))[_0xf54e('0x2c')](handleError(_0x399e41,null));};exports[_0xf54e('0x157')]=function(_0xf2d3b2,_0x13b271,_0x45d18e){return db['User'][_0xf54e('0x76')]({'where':{'id':_0xf2d3b2['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x13b271,null))['then'](function(_0x323310){if(_0x323310){return _0x323310[_0xf54e('0x157')](_0xf2d3b2['query'][_0xf54e('0x77')]);}})[_0xf54e('0x21')](respondWithStatusCode(_0x13b271,null))['catch'](handleError(_0x13b271,null));};exports['getVoicePrefixes']=function(_0x233a1a,_0x20ea30,_0x255f73){var _0xc598a8={};var _0x3338e3={};var _0x1fa09b;var _0x59414b;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x233a1a[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x20ea30,null))[_0xf54e('0x21')](function(_0x2d2948){if(_0x2d2948){_0x1fa09b=_0x2d2948;_0x3338e3['model']=_[_0xf54e('0x51')](db[_0xf54e('0x158')][_0xf54e('0x48')]);_0x3338e3[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x233a1a[_0xf54e('0x50')]);_0x3338e3[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x3338e3[_0xf54e('0x4c')],_0x3338e3['query']);_0xc598a8[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x3338e3['model'],qs['fields'](_0x233a1a[_0xf54e('0x50')][_0xf54e('0x54')]));_0xc598a8['attributes']=_0xc598a8[_0xf54e('0x53')]['length']?_0xc598a8['attributes']:_0x3338e3[_0xf54e('0x4c')];_0xc598a8[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x233a1a['query'][_0xf54e('0x59')]);_0xc598a8['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x233a1a[_0xf54e('0x50')],_0x3338e3[_0xf54e('0x52')]));if(_0x233a1a[_0xf54e('0x50')][_0xf54e('0x3f')]){_0xc598a8['where']=_[_0xf54e('0x5c')](_0xc598a8[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0xc598a8[_0xf54e('0x53')],function(_0x31e0df){var _0x52e049={};_0x52e049[_0x31e0df]={'$like':'%'+_0x233a1a['query'][_0xf54e('0x3f')]+'%'};return _0x52e049;})});}_0xc598a8=_[_0xf54e('0x5c')]({},_0xc598a8,_0x233a1a['options']);return _0x1fa09b['getVoicePrefixes'](_0xc598a8);}})['then'](function(_0x37d5b1){if(_0x37d5b1){_0x59414b=_0x37d5b1['length'];if(!_0x233a1a[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0xc598a8[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x233a1a[_0xf54e('0x50')][_0xf54e('0x33')]);_0xc598a8['offset']=qs[_0xf54e('0x31')](_0x233a1a[_0xf54e('0x50')]['offset']);}return _0x1fa09b[_0xf54e('0x159')](_0xc598a8);}})[_0xf54e('0x21')](function(_0x589fdb){if(_0x589fdb){return _0x589fdb?{'count':_0x59414b,'rows':_0x589fdb}:null;}})[_0xf54e('0x21')](respondWithResult(_0x20ea30,null))['catch'](handleError(_0x20ea30,null));};exports['getFaxAccounts']=function(_0x4bbfc0,_0x175d2f,_0x3b2efe){var _0x102b0d={};var _0x5bae43={};var _0x174f9d;var _0x7d36ff;return db['User'][_0xf54e('0xae')]({'where':{'id':_0x4bbfc0['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x175d2f,null))[_0xf54e('0x21')](function(_0x47dbe0){if(_0x47dbe0){_0x174f9d=_0x47dbe0;_0x5bae43[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db['FaxAccount'][_0xf54e('0x48')]);_0x5bae43[_0xf54e('0x50')]=_['keys'](_0x4bbfc0[_0xf54e('0x50')]);_0x5bae43[_0xf54e('0x52')]=_['intersection'](_0x5bae43[_0xf54e('0x4c')],_0x5bae43[_0xf54e('0x50')]);_0x102b0d['attributes']=_['intersection'](_0x5bae43[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x4bbfc0[_0xf54e('0x50')]['fields']));_0x102b0d[_0xf54e('0x53')]=_0x102b0d[_0xf54e('0x53')][_0xf54e('0x55')]?_0x102b0d['attributes']:_0x5bae43['model'];_0x102b0d[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x4bbfc0[_0xf54e('0x50')][_0xf54e('0x59')]);_0x102b0d['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x4bbfc0[_0xf54e('0x50')],_0x5bae43['filters']));if(_0x4bbfc0[_0xf54e('0x50')]['filter']){_0x102b0d[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x102b0d[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x102b0d[_0xf54e('0x53')],function(_0x4857ee){var _0x17b076={};_0x17b076[_0x4857ee]={'$like':'%'+_0x4bbfc0[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x17b076;})});}_0x102b0d=_[_0xf54e('0x5c')]({},_0x102b0d,_0x4bbfc0[_0xf54e('0x60')]);return _0x174f9d[_0xf54e('0x15a')](_0x102b0d);}})[_0xf54e('0x21')](function(_0x5d0c5e){if(_0x5d0c5e){_0x7d36ff=_0x5d0c5e[_0xf54e('0x55')];if(!_0x4bbfc0['query']['hasOwnProperty']('nolimit')){_0x102b0d['limit']=qs[_0xf54e('0x33')](_0x4bbfc0[_0xf54e('0x50')][_0xf54e('0x33')]);_0x102b0d[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x4bbfc0['query'][_0xf54e('0x31')]);}return _0x174f9d[_0xf54e('0x15a')](_0x102b0d);}})[_0xf54e('0x21')](function(_0x1f5da8){if(_0x1f5da8){return _0x1f5da8?{'count':_0x7d36ff,'rows':_0x1f5da8}:null;}})['then'](respondWithResult(_0x175d2f,null))[_0xf54e('0x2c')](handleError(_0x175d2f,null));};exports[_0xf54e('0x15b')]=function(_0x35c8e7,_0x65345d,_0x4759b4){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x35c8e7[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x65345d,null))[_0xf54e('0x21')](function(_0x51fdaa){if(_0x51fdaa){return _0x51fdaa[_0xf54e('0x15b')](_0x35c8e7[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x35c8e7['body'],[_0xf54e('0x77'),'id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x65345d,null))[_0xf54e('0x2c')](handleError(_0x65345d,null));};exports['removeFaxAccounts']=function(_0x1b49ae,_0x4c7658,_0x1fffc6){return db[_0xf54e('0x47')]['find']({'where':{'id':_0x1b49ae[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x4c7658,null))['then'](function(_0x58ce14){if(_0x58ce14){return _0x58ce14['removeFaxAccounts'](_0x1b49ae[_0xf54e('0x50')][_0xf54e('0x77')]);}})[_0xf54e('0x21')](respondWithStatusCode(_0x4c7658,null))[_0xf54e('0x2c')](handleError(_0x4c7658,null));};exports['getMailAccounts']=function(_0x3a4067,_0x2a7437,_0x234939){var _0x460d0d={};var _0x25adeb={};var _0x2a0658;var _0x39c61e;return db['User'][_0xf54e('0xae')]({'where':{'id':_0x3a4067[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x2a7437,null))[_0xf54e('0x21')](function(_0x15bcef){if(_0x15bcef){_0x2a0658=_0x15bcef;_0x25adeb[_0xf54e('0x4c')]=_['keys'](db[_0xf54e('0x15c')][_0xf54e('0x48')]);_0x25adeb[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x3a4067[_0xf54e('0x50')]);_0x25adeb[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x25adeb[_0xf54e('0x4c')],_0x25adeb[_0xf54e('0x50')]);_0x460d0d[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x25adeb[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x3a4067[_0xf54e('0x50')]['fields']));_0x460d0d[_0xf54e('0x53')]=_0x460d0d[_0xf54e('0x53')][_0xf54e('0x55')]?_0x460d0d[_0xf54e('0x53')]:_0x25adeb['model'];_0x460d0d[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x3a4067[_0xf54e('0x50')][_0xf54e('0x59')]);_0x460d0d[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x3a4067[_0xf54e('0x50')],_0x25adeb[_0xf54e('0x52')]));if(_0x3a4067[_0xf54e('0x50')]['filter']){_0x460d0d[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x460d0d[_0xf54e('0x5a')],{'$or':_['map'](_0x460d0d['attributes'],function(_0x56c866){var _0x2bef33={};_0x2bef33[_0x56c866]={'$like':'%'+_0x3a4067[_0xf54e('0x50')]['filter']+'%'};return _0x2bef33;})});}_0x460d0d=_[_0xf54e('0x5c')]({},_0x460d0d,_0x3a4067['options']);return _0x2a0658[_0xf54e('0x15d')](_0x460d0d);}})[_0xf54e('0x21')](function(_0x12e863){if(_0x12e863){_0x39c61e=_0x12e863[_0xf54e('0x55')];if(!_0x3a4067[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x460d0d['limit']=qs[_0xf54e('0x33')](_0x3a4067[_0xf54e('0x50')]['limit']);_0x460d0d[_0xf54e('0x31')]=qs['offset'](_0x3a4067[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x2a0658['getMailAccounts'](_0x460d0d);}})[_0xf54e('0x21')](function(_0x280f84){if(_0x280f84){return _0x280f84?{'count':_0x39c61e,'rows':_0x280f84}:null;}})[_0xf54e('0x21')](respondWithResult(_0x2a7437,null))[_0xf54e('0x2c')](handleError(_0x2a7437,null));};exports['addMailAccounts']=function(_0x55e7ed,_0x2d687d,_0x365f95){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x55e7ed[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x2d687d,null))['then'](function(_0x1f4bd9){if(_0x1f4bd9){return _0x1f4bd9[_0xf54e('0x15e')](_0x55e7ed[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x55e7ed[_0xf54e('0x73')],[_0xf54e('0x77'),'id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x2d687d,null))[_0xf54e('0x2c')](handleError(_0x2d687d,null));};exports[_0xf54e('0x15f')]=function(_0x5cd54a,_0x53d853,_0xe72762){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x5cd54a[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x53d853,null))[_0xf54e('0x21')](function(_0x5ce164){if(_0x5ce164){return _0x5ce164[_0xf54e('0x15f')](_0x5cd54a[_0xf54e('0x50')][_0xf54e('0x77')]);}})[_0xf54e('0x21')](respondWithStatusCode(_0x53d853,null))[_0xf54e('0x2c')](handleError(_0x53d853,null));};exports[_0xf54e('0x160')]=function(_0x34612e,_0x432513,_0x1734c5){var _0x37e805={};var _0xc88845={};var _0x186677;var _0x910704;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x34612e['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x432513,null))[_0xf54e('0x21')](function(_0x566bd3){if(_0x566bd3){_0x186677=_0x566bd3;_0xc88845[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0x161')][_0xf54e('0x48')]);_0xc88845[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x34612e[_0xf54e('0x50')]);_0xc88845['filters']=_[_0xf54e('0x6d')](_0xc88845[_0xf54e('0x4c')],_0xc88845[_0xf54e('0x50')]);_0x37e805[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0xc88845['model'],qs[_0xf54e('0x54')](_0x34612e[_0xf54e('0x50')][_0xf54e('0x54')]));_0x37e805['attributes']=_0x37e805[_0xf54e('0x53')][_0xf54e('0x55')]?_0x37e805['attributes']:_0xc88845[_0xf54e('0x4c')];_0x37e805[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x34612e['query'][_0xf54e('0x59')]);_0x37e805[_0xf54e('0x5a')]=qs['filters'](_[_0xf54e('0x5b')](_0x34612e[_0xf54e('0x50')],_0xc88845['filters']));if(_0x34612e[_0xf54e('0x50')]['filter']){_0x37e805[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x37e805[_0xf54e('0x5a')],{'$or':_['map'](_0x37e805[_0xf54e('0x53')],function(_0x1231bd){var _0xdeb17c={};_0xdeb17c[_0x1231bd]={'$like':'%'+_0x34612e[_0xf54e('0x50')]['filter']+'%'};return _0xdeb17c;})});}_0x37e805=_[_0xf54e('0x5c')]({},_0x37e805,_0x34612e[_0xf54e('0x60')]);return _0x186677[_0xf54e('0x160')](_0x37e805);}})[_0xf54e('0x21')](function(_0x491a48){if(_0x491a48){_0x910704=_0x491a48[_0xf54e('0x55')];if(!_0x34612e[_0xf54e('0x50')][_0xf54e('0x56')]('nolimit')){_0x37e805[_0xf54e('0x33')]=qs['limit'](_0x34612e['query']['limit']);_0x37e805['offset']=qs[_0xf54e('0x31')](_0x34612e[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x186677[_0xf54e('0x160')](_0x37e805);}})['then'](function(_0x5da561){if(_0x5da561){return _0x5da561?{'count':_0x910704,'rows':_0x5da561}:null;}})[_0xf54e('0x21')](respondWithResult(_0x432513,null))[_0xf54e('0x2c')](handleError(_0x432513,null));};exports[_0xf54e('0x162')]=function(_0x53c5c1,_0x19a05f,_0xd4d6e8){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x53c5c1['params']['id']}})['then'](handleEntityNotFound(_0x19a05f,null))[_0xf54e('0x21')](function(_0x1a8cda){if(_0x1a8cda){return _0x1a8cda['addOpenchannelAccounts'](_0x53c5c1[_0xf54e('0x73')]['ids'],_[_0xf54e('0x78')](_0x53c5c1['body'],[_0xf54e('0x77'),'id'])||{});}})['then'](respondWithResult(_0x19a05f,null))[_0xf54e('0x2c')](handleError(_0x19a05f,null));};exports['removeOpenchannelAccounts']=function(_0x1bd490,_0x55e7fe,_0x4a1a84){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x1bd490[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x55e7fe,null))[_0xf54e('0x21')](function(_0x21ac9d){if(_0x21ac9d){return _0x21ac9d[_0xf54e('0x163')](_0x1bd490[_0xf54e('0x50')][_0xf54e('0x77')]);}})[_0xf54e('0x21')](respondWithStatusCode(_0x55e7fe,null))[_0xf54e('0x2c')](handleError(_0x55e7fe,null));};exports[_0xf54e('0x164')]=function(_0x1019c2,_0x51b774,_0x3d788a){var _0x339f16={};var _0x89d1f2={};var _0x2e1363;var _0x2bc7d0;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x1019c2[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x51b774,null))[_0xf54e('0x21')](function(_0x29cfb2){if(_0x29cfb2){_0x2e1363=_0x29cfb2;_0x89d1f2[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db[_0xf54e('0x165')][_0xf54e('0x48')]);_0x89d1f2['query']=_['keys'](_0x1019c2[_0xf54e('0x50')]);_0x89d1f2[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x89d1f2[_0xf54e('0x4c')],_0x89d1f2[_0xf54e('0x50')]);_0x339f16['attributes']=_[_0xf54e('0x6d')](_0x89d1f2[_0xf54e('0x4c')],qs['fields'](_0x1019c2['query'][_0xf54e('0x54')]));_0x339f16[_0xf54e('0x53')]=_0x339f16[_0xf54e('0x53')][_0xf54e('0x55')]?_0x339f16[_0xf54e('0x53')]:_0x89d1f2[_0xf54e('0x4c')];_0x339f16[_0xf54e('0x58')]=qs['sort'](_0x1019c2['query'][_0xf54e('0x59')]);_0x339f16[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x1019c2['query'],_0x89d1f2[_0xf54e('0x52')]));if(_0x1019c2[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x339f16[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x339f16[_0xf54e('0x5a')],{'$or':_['map'](_0x339f16[_0xf54e('0x53')],function(_0x108ca6){var _0x41e656={};_0x41e656[_0x108ca6]={'$like':'%'+_0x1019c2['query'][_0xf54e('0x3f')]+'%'};return _0x41e656;})});}_0x339f16=_[_0xf54e('0x5c')]({},_0x339f16,_0x1019c2[_0xf54e('0x60')]);return _0x2e1363[_0xf54e('0x164')](_0x339f16);}})[_0xf54e('0x21')](function(_0x556797){if(_0x556797){_0x2bc7d0=_0x556797[_0xf54e('0x55')];if(!_0x1019c2[_0xf54e('0x50')][_0xf54e('0x56')]('nolimit')){_0x339f16[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x1019c2[_0xf54e('0x50')][_0xf54e('0x33')]);_0x339f16[_0xf54e('0x31')]=qs['offset'](_0x1019c2[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x2e1363[_0xf54e('0x164')](_0x339f16);}})[_0xf54e('0x21')](function(_0x14e69a){if(_0x14e69a){return _0x14e69a?{'count':_0x2bc7d0,'rows':_0x14e69a}:null;}})['then'](respondWithResult(_0x51b774,null))[_0xf54e('0x2c')](handleError(_0x51b774,null));};exports[_0xf54e('0x166')]=function(_0x15a939,_0x57f1e8,_0x43abaa){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x15a939[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x57f1e8,null))[_0xf54e('0x21')](function(_0x478b78){if(_0x478b78){return _0x478b78['addSmsAccounts'](_0x15a939['body']['ids'],_[_0xf54e('0x78')](_0x15a939[_0xf54e('0x73')],[_0xf54e('0x77'),'id'])||{});}})['then'](respondWithResult(_0x57f1e8,null))[_0xf54e('0x2c')](handleError(_0x57f1e8,null));};exports[_0xf54e('0x167')]=function(_0x4b0844,_0x3c4f26,_0x2524d2){return db['User']['find']({'where':{'id':_0x4b0844[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3c4f26,null))[_0xf54e('0x21')](function(_0x3c8012){if(_0x3c8012){return _0x3c8012['removeSmsAccounts'](_0x4b0844[_0xf54e('0x50')][_0xf54e('0x77')]);}})['then'](respondWithStatusCode(_0x3c4f26,null))[_0xf54e('0x2c')](handleError(_0x3c4f26,null));};exports[_0xf54e('0x168')]=function(_0x306106,_0xa9c9be,_0x1950d7){var _0x4d6870={};var _0x4d2b8d={};var _0x42ecf0;var _0x8ac1b9;return db[_0xf54e('0x47')][_0xf54e('0xae')]({'where':{'id':_0x306106[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xa9c9be,null))[_0xf54e('0x21')](function(_0x4d0e7a){if(_0x4d0e7a){_0x42ecf0=_0x4d0e7a;_0x4d2b8d[_0xf54e('0x4c')]=_[_0xf54e('0x51')](db['ChatWebsite'][_0xf54e('0x48')]);_0x4d2b8d[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x306106[_0xf54e('0x50')]);_0x4d2b8d[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x4d2b8d['model'],_0x4d2b8d[_0xf54e('0x50')]);_0x4d6870[_0xf54e('0x53')]=_[_0xf54e('0x6d')](_0x4d2b8d['model'],qs[_0xf54e('0x54')](_0x306106['query'][_0xf54e('0x54')]));_0x4d6870[_0xf54e('0x53')]=_0x4d6870[_0xf54e('0x53')][_0xf54e('0x55')]?_0x4d6870[_0xf54e('0x53')]:_0x4d2b8d[_0xf54e('0x4c')];_0x4d6870[_0xf54e('0x58')]=qs['sort'](_0x306106[_0xf54e('0x50')][_0xf54e('0x59')]);_0x4d6870[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x306106[_0xf54e('0x50')],_0x4d2b8d['filters']));if(_0x306106[_0xf54e('0x50')]['filter']){_0x4d6870['where']=_[_0xf54e('0x5c')](_0x4d6870[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x4d6870[_0xf54e('0x53')],function(_0x2e2780){var _0x23d1b7={};_0x23d1b7[_0x2e2780]={'$like':'%'+_0x306106[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x23d1b7;})});}_0x4d6870=_['merge']({},_0x4d6870,_0x306106[_0xf54e('0x60')]);return _0x42ecf0['getChatWebsites'](_0x4d6870);}})[_0xf54e('0x21')](function(_0x15520d){if(_0x15520d){_0x8ac1b9=_0x15520d['length'];if(!_0x306106[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x4d6870[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x306106[_0xf54e('0x50')][_0xf54e('0x33')]);_0x4d6870[_0xf54e('0x31')]=qs['offset'](_0x306106['query'][_0xf54e('0x31')]);}return _0x42ecf0[_0xf54e('0x168')](_0x4d6870);}})[_0xf54e('0x21')](function(_0x56f9dc){if(_0x56f9dc){return _0x56f9dc?{'count':_0x8ac1b9,'rows':_0x56f9dc}:null;}})[_0xf54e('0x21')](respondWithResult(_0xa9c9be,null))[_0xf54e('0x2c')](handleError(_0xa9c9be,null));};exports[_0xf54e('0x169')]=function(_0xfe65ca,_0x5803c2,_0xa31569){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0xfe65ca['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x5803c2,null))[_0xf54e('0x21')](function(_0x4c175b){if(_0x4c175b){return _0x4c175b[_0xf54e('0x169')](_0xfe65ca[_0xf54e('0x73')][_0xf54e('0x77')],_['omit'](_0xfe65ca[_0xf54e('0x73')],[_0xf54e('0x77'),'id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x5803c2,null))[_0xf54e('0x2c')](handleError(_0x5803c2,null));};exports[_0xf54e('0x16a')]=function(_0x5ef358,_0x427f70,_0x45bc26){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x5ef358[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x427f70,null))[_0xf54e('0x21')](function(_0x45c3bf){if(_0x45c3bf){return _0x45c3bf[_0xf54e('0x16a')](_0x5ef358[_0xf54e('0x50')][_0xf54e('0x77')]);}})['then'](respondWithStatusCode(_0x427f70,null))[_0xf54e('0x2c')](handleError(_0x427f70,null));};exports['getWhatsappAccounts']=function(_0x182faf,_0x3a18b4,_0x278937){var _0x39853b={};var _0x59362f={};var _0x30e300;var _0x2fb0fc;return db['User'][_0xf54e('0xae')]({'where':{'id':_0x182faf[_0xf54e('0x6c')]['id']}})['then'](handleEntityNotFound(_0x3a18b4,null))['then'](function(_0x3b6bc1){if(_0x3b6bc1){_0x30e300=_0x3b6bc1;_0x59362f['model']=_['keys'](db[_0xf54e('0x16b')][_0xf54e('0x48')]);_0x59362f['query']=_[_0xf54e('0x51')](_0x182faf[_0xf54e('0x50')]);_0x59362f[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x59362f[_0xf54e('0x4c')],_0x59362f[_0xf54e('0x50')]);_0x39853b['attributes']=_[_0xf54e('0x6d')](_0x59362f[_0xf54e('0x4c')],qs[_0xf54e('0x54')](_0x182faf['query'][_0xf54e('0x54')]));_0x39853b[_0xf54e('0x53')]=_0x39853b[_0xf54e('0x53')][_0xf54e('0x55')]?_0x39853b['attributes']:_0x59362f['model'];_0x39853b[_0xf54e('0x58')]=qs[_0xf54e('0x59')](_0x182faf[_0xf54e('0x50')][_0xf54e('0x59')]);_0x39853b[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x182faf['query'],_0x59362f[_0xf54e('0x52')]));if(_0x182faf[_0xf54e('0x50')][_0xf54e('0x3f')]){_0x39853b[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x39853b[_0xf54e('0x5a')],{'$or':_[_0xf54e('0x40')](_0x39853b[_0xf54e('0x53')],function(_0x49c4a7){var _0x2df82c={};_0x2df82c[_0x49c4a7]={'$like':'%'+_0x182faf['query'][_0xf54e('0x3f')]+'%'};return _0x2df82c;})});}_0x39853b=_['merge']({},_0x39853b,_0x182faf[_0xf54e('0x60')]);return _0x30e300[_0xf54e('0x16c')](_0x39853b);}})[_0xf54e('0x21')](function(_0x5d2956){if(_0x5d2956){_0x2fb0fc=_0x5d2956[_0xf54e('0x55')];if(!_0x182faf[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x39853b[_0xf54e('0x33')]=qs['limit'](_0x182faf[_0xf54e('0x50')][_0xf54e('0x33')]);_0x39853b[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x182faf[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x30e300['getWhatsappAccounts'](_0x39853b);}})['then'](function(_0xb15c84){if(_0xb15c84){return _0xb15c84?{'count':_0x2fb0fc,'rows':_0xb15c84}:null;}})[_0xf54e('0x21')](respondWithResult(_0x3a18b4,null))['catch'](handleError(_0x3a18b4,null));};exports['addWhatsappAccounts']=function(_0x27c743,_0x3bcd92,_0x20d7da){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x27c743[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3bcd92,null))[_0xf54e('0x21')](function(_0x14cc63){if(_0x14cc63){return _0x14cc63[_0xf54e('0x16d')](_0x27c743[_0xf54e('0x73')][_0xf54e('0x77')],_[_0xf54e('0x78')](_0x27c743[_0xf54e('0x73')],[_0xf54e('0x77'),'id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x3bcd92,null))[_0xf54e('0x2c')](handleError(_0x3bcd92,null));};exports['removeWhatsappAccounts']=function(_0x10d262,_0x3474a8,_0xbbc6bb){return db[_0xf54e('0x47')]['find']({'where':{'id':_0x10d262['params']['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3474a8,null))['then'](function(_0x317470){if(_0x317470){return _0x317470[_0xf54e('0x16e')](_0x10d262[_0xf54e('0x50')]['ids']);}})[_0xf54e('0x21')](respondWithStatusCode(_0x3474a8,null))[_0xf54e('0x2c')](handleError(_0x3474a8,null));};exports[_0xf54e('0x16f')]=function(_0x1922c9,_0x5885c9,_0x29f2b2){var _0x456d13={};var _0x1df70c={};var _0x20422a;var _0x4912ab;return db[_0xf54e('0x47')]['findOne']({'where':{'id':_0x1922c9[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x5885c9,null))[_0xf54e('0x21')](function(_0x558978){if(_0x558978){_0x20422a=_0x558978;_0x1df70c[_0xf54e('0x4c')]=_['keys'](db[_0xf54e('0x170')][_0xf54e('0x48')]);_0x1df70c[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x1922c9[_0xf54e('0x50')]);_0x1df70c[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x1df70c[_0xf54e('0x4c')],_0x1df70c[_0xf54e('0x50')]);_0x456d13[_0xf54e('0x53')]=_['intersection'](_0x1df70c['model'],qs[_0xf54e('0x54')](_0x1922c9['query'][_0xf54e('0x54')]));_0x456d13[_0xf54e('0x53')]=_0x456d13[_0xf54e('0x53')][_0xf54e('0x55')]?_0x456d13[_0xf54e('0x53')]:_0x1df70c[_0xf54e('0x4c')];_0x456d13['order']=qs[_0xf54e('0x59')](_0x1922c9[_0xf54e('0x50')]['sort']);_0x456d13['where']=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x1922c9[_0xf54e('0x50')],_0x1df70c[_0xf54e('0x52')]));if(_0x1922c9[_0xf54e('0x50')]['filter']){_0x456d13[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x456d13['where'],{'$or':_['map'](_0x456d13[_0xf54e('0x53')],function(_0x3cd8aa){var _0x3eaad2={};_0x3eaad2[_0x3cd8aa]={'$like':'%'+_0x1922c9[_0xf54e('0x50')]['filter']+'%'};return _0x3eaad2;})});}_0x456d13=_[_0xf54e('0x5c')]({},_0x456d13,_0x1922c9['options']);return _0x20422a[_0xf54e('0x16f')](_0x456d13);}})[_0xf54e('0x21')](function(_0x3442b1){if(_0x3442b1){_0x4912ab=_0x3442b1['length'];if(!_0x1922c9[_0xf54e('0x50')][_0xf54e('0x56')](_0xf54e('0x57'))){_0x456d13['limit']=qs['limit'](_0x1922c9[_0xf54e('0x50')][_0xf54e('0x33')]);_0x456d13[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x1922c9[_0xf54e('0x50')][_0xf54e('0x31')]);}return _0x20422a[_0xf54e('0x16f')](_0x456d13);}})[_0xf54e('0x21')](function(_0x5ac01){if(_0x5ac01){return _0x5ac01?{'count':_0x4912ab,'rows':_0x5ac01}:null;}})[_0xf54e('0x21')](respondWithResult(_0x5885c9,null))[_0xf54e('0x2c')](handleError(_0x5885c9,null));};exports['addSquareProjects']=function(_0x401d83,_0x44d992,_0x2b431c){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x401d83[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x44d992,null))[_0xf54e('0x21')](function(_0x9eb634){if(_0x9eb634){return _0x9eb634[_0xf54e('0x171')](_0x401d83[_0xf54e('0x73')]['ids'],_[_0xf54e('0x78')](_0x401d83['body'],[_0xf54e('0x77'),'id'])||{});}})[_0xf54e('0x21')](respondWithResult(_0x44d992,null))['catch'](handleError(_0x44d992,null));};exports[_0xf54e('0x172')]=function(_0x106760,_0x3d7079,_0x1b0816){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x106760[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x3d7079,null))[_0xf54e('0x21')](function(_0x16fbec){if(_0x16fbec){return _0x16fbec[_0xf54e('0x172')](_0x106760['query'][_0xf54e('0x77')]);}})[_0xf54e('0x21')](respondWithStatusCode(_0x3d7079,null))['catch'](handleError(_0x3d7079,null));};exports['getScheduledCalls']=function(_0x4ed20f,_0x41906e){var _0x45f80e={},_0x10cb00={},_0x6b2cba={'count':0x0,'rows':[]};var _0x31e8a4=db[_0xf54e('0x173')][_0xf54e('0x48')];_0x10cb00['model']=_[_0xf54e('0x51')](_0x31e8a4);_0x10cb00[_0xf54e('0x50')]=_[_0xf54e('0x51')](_0x4ed20f[_0xf54e('0x50')]);_0x10cb00[_0xf54e('0x52')]=_[_0xf54e('0x6d')](_0x10cb00[_0xf54e('0x4c')],_0x10cb00[_0xf54e('0x50')]);_0x10cb00[_0xf54e('0x52')]=_[_0xf54e('0x111')](_0x10cb00[_0xf54e('0x52')],[_0xf54e('0x174'),_0xf54e('0x175'),_0xf54e('0x176'),_0xf54e('0x177'),_0xf54e('0x178'),'$lte','$ne',_0xf54e('0x179'),_0xf54e('0x17a'),_0xf54e('0x17b'),'$notBetween',_0xf54e('0x17c'),_0xf54e('0x17d'),_0xf54e('0x17e'),_0xf54e('0x17f'),'$iLike',_0xf54e('0x180'),_0xf54e('0x17e'),_0xf54e('0x181'),_0xf54e('0x182'),'$contained','$any']);_0x45f80e['attributes']=_[_0xf54e('0x6d')](_0x10cb00[_0xf54e('0x4c')],qs['fields'](_0x4ed20f[_0xf54e('0x50')]['fields']));_0x45f80e['attributes']=_0x45f80e['attributes'][_0xf54e('0x55')]?_0x45f80e[_0xf54e('0x53')]:_0x10cb00[_0xf54e('0x4c')];if(!_0x4ed20f[_0xf54e('0x50')]['hasOwnProperty'](_0xf54e('0x57'))){_0x45f80e[_0xf54e('0x33')]=qs[_0xf54e('0x33')](_0x4ed20f[_0xf54e('0x50')][_0xf54e('0x33')]);_0x45f80e[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x4ed20f[_0xf54e('0x50')][_0xf54e('0x31')]);}_0x45f80e['order']=qs['sort'](_0x4ed20f['query'][_0xf54e('0x59')]);_0x45f80e[_0xf54e('0x5a')]=qs[_0xf54e('0x52')](_[_0xf54e('0x5b')](_0x4ed20f['query'],_0x10cb00[_0xf54e('0x52')]));if(_0x4ed20f['query']['filter']){_0x45f80e[_0xf54e('0x5a')]=_[_0xf54e('0x5c')](_0x45f80e[_0xf54e('0x5a')],{'$or':_['map'](_0x45f80e[_0xf54e('0x53')],function(_0x32e77e){var _0x4e110d={};_0x4e110d[_0x32e77e]={'$like':'%'+_0x4ed20f[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'};return _0x4e110d;})});}_0x45f80e['where']={'$and':[_0x45f80e[_0xf54e('0x5a')],{'$or':[{'UserId':_0x4ed20f[_0xf54e('0x6c')]['id']},{'OwnerId':_0x4ed20f[_0xf54e('0x6c')]['id']}]}]};_0x45f80e=_['merge']({},_0x45f80e,_0x4ed20f[_0xf54e('0x60')]);var _0x3e7de9={'where':_0x45f80e['where']};return db[_0xf54e('0x173')][_0xf54e('0x34')](_0x3e7de9)[_0xf54e('0x21')](function(_0x4d2b72){_0x6b2cba[_0xf54e('0x34')]=_0x4d2b72;if(_0x4ed20f['query'][_0xf54e('0x61')]){_0x45f80e[_0xf54e('0x62')]=[{'attributes':['id','firstName',_0xf54e('0x183'),_0xf54e('0xfd')],'model':db[_0xf54e('0x184')],'as':_0xf54e('0x185')},{'attributes':['id','name',_0xf54e('0x186')],'model':db[_0xf54e('0xc1')],'as':_0xf54e('0xe5')}];}return db[_0xf54e('0x173')][_0xf54e('0x63')](_0x45f80e);})[_0xf54e('0x21')](function(_0x1606b0){_0x6b2cba[_0xf54e('0x64')]=_0x1606b0;return _0x6b2cba;})[_0xf54e('0x21')](respondWithFilteredResult(_0x41906e,_0x45f80e))[_0xf54e('0x2c')](handleError(_0x41906e,null));};exports[_0xf54e('0x187')]=function(_0x2b5ecd,_0x2d79f6,_0x2c372f){if(!_[_0xf54e('0x7e')](_0x2b5ecd['user']['id'])&&(_0x2b5ecd[_0xf54e('0x94')][_0xf54e('0x43')]==_0xf54e('0x3b')||_0x2b5ecd['user'][_0xf54e('0x43')]==_0xf54e('0x94'))){return db[_0xf54e('0x47')]['findOne']({'where':{'id':_0x2b5ecd[_0xf54e('0x6c')]['id']},'raw':!![]})[_0xf54e('0x21')](function(_0x54da95){return authService[_0xf54e('0x188')](_0x54da95);})[_0xf54e('0x21')](function(_0x3c38ec){if(_0x3c38ec){return _0x2d79f6[_0xf54e('0x2e')](0xc8)['json']({'api_key':_0x3c38ec[_0xf54e('0x189')]});}else{return _0x2d79f6[_0xf54e('0x2e')](0xcc)[_0xf54e('0x30')]({'message':_0xf54e('0x18a')});}})[_0xf54e('0x2c')](handleError(_0x2d79f6,0x193));}else{return _0x2d79f6['status'](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xf54e('0x18b')]=function(_0x1e44d9,_0x2a0883,_0x58ae7f){if(!_['isNil'](_0x1e44d9['user']['id'])&&(_0x1e44d9['user'][_0xf54e('0x43')]==_0xf54e('0x3b')||_0x1e44d9[_0xf54e('0x94')][_0xf54e('0x43')]==_0xf54e('0x94'))){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x1e44d9['params']['id']}})[_0xf54e('0x21')](function(_0x57c488){return authService[_0xf54e('0x18c')](_0x57c488);})[_0xf54e('0x21')](function(_0x5788f0){return db['User'][_0xf54e('0x72')]({'apiKeyIat':_0x5788f0[_0xf54e('0x18d')],'apiKeyNonce':_0x5788f0[_0xf54e('0x18e')]},{'where':{'id':_0x1e44d9[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](function(){return _0x2a0883[_0xf54e('0x2e')](0xc8)[_0xf54e('0x30')]({'api_key':_0x5788f0[_0xf54e('0x189')]});});})['catch'](handleError(_0x2a0883,0x193));}else{return _0x2a0883['status'](0x191)[_0xf54e('0x30')]({'message':_0xf54e('0x18f')});}};exports[_0xf54e('0x190')]=function(_0x35412f,_0x10636a,_0x21b8a7){if(!_['isNil'](_0x35412f[_0xf54e('0x94')]['id'])&&(_0x35412f[_0xf54e('0x94')][_0xf54e('0x43')]=='admin'||_0x35412f[_0xf54e('0x94')][_0xf54e('0x43')]==_0xf54e('0x94'))){return db[_0xf54e('0x47')][_0xf54e('0x76')]({'where':{'id':_0x35412f[_0xf54e('0x6c')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x10636a,null))[_0xf54e('0x21')](function(_0x3ca4ce){if(_0x3ca4ce&&_0x3ca4ce[_0xf54e('0x191')]&&_0x3ca4ce[_0xf54e('0x192')])return _0x3ca4ce;else throw{'message':_0xf54e('0x193')};})[_0xf54e('0x21')](function(_0x2de13c){return db[_0xf54e('0x47')][_0xf54e('0x72')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x35412f[_0xf54e('0x6c')]['id']}});})['then'](respondWithStatusCode(_0x10636a,0xc8))['catch'](handleError(_0x10636a,0x193));}else{return _0x10636a[_0xf54e('0x2e')](0x191)[_0xf54e('0x30')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['whoami']=function(_0x2de8ce,_0x275ddf){var _0x5941ad=_0x2de8ce['user'][_0xf54e('0xe6')]({'plain':!![]});if(!_0x5941ad){return _0x275ddf[_0xf54e('0x2e')](0x191)['send'](_0xf54e('0x194'));}else{return _0x275ddf[_0xf54e('0x2e')](0xc8)[_0xf54e('0x30')](_0x5941ad);}};exports[_0xf54e('0x195')]=function(_0x83770b,_0x193952){var _0x1a495b={'offset':0x0},_0x50cee9={'count':0x0,'rows':[]};Promise[_0xf54e('0x113')]()[_0xf54e('0x21')](function(){if(!_0x83770b[_0xf54e('0x50')][_0xf54e('0x3f')]&&!_0x83770b[_0xf54e('0x50')][_0xf54e('0x196')]&&!_0x83770b[_0xf54e('0x50')][_0xf54e('0x197')])return[];return Promise[_0xf54e('0x113')]()[_0xf54e('0x21')](function(){var _0x298891=[];if(!_[_0xf54e('0xa2')](_0x83770b[_0xf54e('0x50')][_0xf54e('0x196')])){_0x298891[_0xf54e('0x67')](db[_0xf54e('0x126')][_0xf54e('0x63')]({'attributes':['id',_0xf54e('0x44')],'where':{'id':_0x83770b[_0xf54e('0x50')][_0xf54e('0x196')]}}));}if(!_[_0xf54e('0xa2')](_0x83770b['query'][_0xf54e('0x197')])){_0x298891['push'](db[_0xf54e('0xc1')][_0xf54e('0x63')]({'attributes':['id','name'],'type':_0xf54e('0x198'),'where':{'id':_0x83770b[_0xf54e('0x50')][_0xf54e('0x197')]}}));}return Promise['all'](_0x298891);})[_0xf54e('0x21')](function(_0x3dbe56){var _0xa59822=_[_0xf54e('0x134')](_0x3dbe56)[_0xf54e('0x40')](function(_0xa48089){return _0xa48089[_0xf54e('0x13e')]({'attributes':['id','name',_0xf54e('0x79'),_0xf54e('0xb5')],'raw':!![]});});return Promise[_0xf54e('0x71')](_0xa59822);})['then'](function(_0x4a5044){var _0x5704e4=_[_0xf54e('0x134')](_0x4a5044);if(!_0x83770b[_0xf54e('0x50')]['filter'])return _0x5704e4;if(_[_0xf54e('0xa2')](_0x5704e4)){return db['User']['findAll']({'attributes':['id',_0xf54e('0x44'),_0xf54e('0x79'),'online'],'where':{'role':_0xf54e('0x3d'),'$or':[db['sequelize']['where'](db['sequelize']['fn'](_0xf54e('0x5f'),db[_0xf54e('0x5e')][_0xf54e('0x199')](_0xf54e('0x44'))),{'$like':'%'+_0x83770b['query'][_0xf54e('0x3f')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x83770b[_0xf54e('0x50')][_0xf54e('0x3f')]+'%'}}]},'raw':!![]});}else{return _(_0x5704e4)[_0xf54e('0x134')]()[_0xf54e('0x3f')](function(_0x25cd1b){return _0x25cd1b[_0xf54e('0x44')][_0xf54e('0xb8')]()[_0xf54e('0x42')](_0x83770b[_0xf54e('0x50')]['filter']['toLowerCase']())||_0x25cd1b[_0xf54e('0x79')]['toString']()[_0xf54e('0x42')](_0x83770b[_0xf54e('0x50')]['filter']);})[_0xf54e('0x41')]();}})['then'](function(_0x1b301b){var _0x15e435=_0xf54e('0x44');var _0x6c11d8=_0xf54e('0x19a');if(_0x83770b[_0xf54e('0x50')][_0xf54e('0x59')]){var _0x6c11d8=_0x83770b[_0xf54e('0x50')][_0xf54e('0x59')][0x0]==='-'?_0xf54e('0x19b'):_0xf54e('0x19a');var _0x15e435=_0x6c11d8==='asc'?_0x83770b[_0xf54e('0x50')][_0xf54e('0x59')]:_0x83770b[_0xf54e('0x50')][_0xf54e('0x59')][_0xf54e('0x19c')](0x1);}return _(_0x1b301b)[_0xf54e('0x19d')]('id')['orderBy']([function(_0x28a530){return _0x15e435==='name'?_0x28a530[_0x15e435]['toLowerCase']():_0x28a530[_0x15e435];}],[_0x6c11d8])['map'](function(_0x4667c6){return _['pick'](_0x4667c6,['id','name','internal','online']);})[_0xf54e('0x41')]();})['then'](function(_0x36cf83){return client[_0xf54e('0x20')](_0xf54e('0x3c'),_0x83770b)[_0xf54e('0x21')](function(_0x332d47){if(_0x332d47[_0xf54e('0x29')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x5a459b=_0x332d47[_0xf54e('0x2b')];var _0x473d26=jayson[_0xf54e('0x1e')][_0xf54e('0x1f')]({'port':0x232c});return _0x473d26[_0xf54e('0x20')](_0xf54e('0x3c'),_0x83770b)[_0xf54e('0x21')](function(_0x126144){if(_0x126144[_0xf54e('0x29')])throw new Error(_0xf54e('0x19e'));var _0x12164f=_0x126144[_0xf54e('0x2b')];return _[_0xf54e('0x5c')]({},_0x12164f,_0x5a459b);});})[_0xf54e('0x21')](function(_0x55f8a8){return _['map'](_0x36cf83,function(_0x189a29){var _0x40f707=_[_0xf54e('0x76')](_0x55f8a8[_0xf54e('0x64')],['id',_0x189a29['id']]);if(!_0x40f707||!_0x189a29[_0xf54e('0xb5')]){_0x189a29[_0xf54e('0x2e')]=_0xf54e('0x19f');}else if(_0x40f707[_0xf54e('0xc4')]){_0x189a29[_0xf54e('0x2e')]=_0xf54e('0x114');}else{_0x189a29['status']=_[_0xf54e('0x42')]([_0xf54e('0x1a0'),_0xf54e('0x1a1'),_0xf54e('0x1a2'),_0xf54e('0x1a3'),null,undefined],_0x40f707[_0xf54e('0x1a4')])?_0xf54e('0xb5'):'busy';}return _0x189a29;});});});})[_0xf54e('0x21')](function(_0x4e6831){if(!_0x83770b['query'][_0xf54e('0x56')]('nolimit')){_0x1a495b['limit']=qs[_0xf54e('0x33')](_0x83770b['query'][_0xf54e('0x33')]||0xa);_0x1a495b[_0xf54e('0x31')]=qs[_0xf54e('0x31')](_0x83770b[_0xf54e('0x50')]['offset']);}_0x50cee9['count']=_0x4e6831[_0xf54e('0x55')];_0x50cee9['rows']=_0x1a495b[_0xf54e('0x33')]?_0x4e6831[_0xf54e('0x1a5')](_0x1a495b[_0xf54e('0x31')],_0x1a495b[_0xf54e('0x31')]+_0x1a495b[_0xf54e('0x33')]):_0x4e6831;return _0x50cee9;})[_0xf54e('0x21')](respondWithFilteredResult(_0x193952,_0x1a495b))[_0xf54e('0x2c')](handleError(_0x193952,null));};function get_open_tabs(_0x5ce783,_0xcac170){var _0x1099ae=_0x5ce783[_0xf54e('0x1a6')](0x0)['toUpperCase']()+_0x5ce783[_0xf54e('0x1a5')](0x1);var _0x44a99a={'type':db['Sequelize'][_0xf54e('0x81')][_0xf54e('0x82')],'raw':!![]};return new BPromise(function(_0x1cc40e,_0x20e18c){var _0xccfe01=squel[_0xf54e('0x1a7')]()['field'](_0xf54e('0x1a8')+_0x1099ae+'InteractionId','id')['field'](_0xf54e('0x1a9'))[_0xf54e('0x83')](_0xf54e('0x1aa')+_0x5ce783+_0xf54e('0x1ab'),'ui')[_0xf54e('0x5a')](_0xf54e('0x1ac'),_0xcac170['id']);return db['sequelize'][_0xf54e('0x50')](_0xccfe01[_0xf54e('0x1ad')](),_0x44a99a)['then'](function(_0x149057){_0xcac170[_0x1099ae+_0xf54e('0x1ae')]=_0x149057;_0x1cc40e(_0x149057);})[_0xf54e('0x2c')](function(_0x46e08e){_0x20e18c(_0x46e08e);});});};
\ No newline at end of file
index 1230c1f..37448fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0182=['setMaxListeners','save','update','remove','emit','exports','events','User'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0182,0x1de));var _0x2018=function(_0x5d6238,_0xe6992b){_0x5d6238=_0x5d6238-0x0;var _0x46ac6b=_0x0182[_0x5d6238];return _0x46ac6b;};'use strict';var EventEmitter=require(_0x2018('0x0'));var User=require('../../mysqldb')['db'][_0x2018('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x2018('0x2')](0x0);var events={'afterCreate':_0x2018('0x3'),'afterUpdate':_0x2018('0x4'),'afterDestroy':_0x2018('0x5')};function emitEvent(_0x4da8f7){return function(_0xa921fd,_0x44ddce,_0x542fc1){UserEvents[_0x2018('0x6')](_0x4da8f7+':'+_0xa921fd['id'],_0xa921fd);UserEvents['emit'](_0x4da8f7,_0xa921fd);_0x542fc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x2018('0x7')]=UserEvents;
\ No newline at end of file
+var _0x9d9a=['hook','exports','User','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x55d9d1,_0x5cac39){var _0x325c13=function(_0x5074b7){while(--_0x5074b7){_0x55d9d1['push'](_0x55d9d1['shift']());}};_0x325c13(++_0x5cac39);}(_0x9d9a,0xad));var _0xa9d9=function(_0x4d4596,_0x5e413b){_0x4d4596=_0x4d4596-0x0;var _0x157881=_0x9d9a[_0x4d4596];return _0x157881;};'use strict';var EventEmitter=require('events');var User=require('../../mysqldb')['db'][_0xa9d9('0x0')];var UserEvents=new EventEmitter();UserEvents[_0xa9d9('0x1')](0x0);var events={'afterCreate':_0xa9d9('0x2'),'afterUpdate':_0xa9d9('0x3'),'afterDestroy':_0xa9d9('0x4')};function emitEvent(_0x3bb671){return function(_0x4429a4,_0x45d234,_0x3345d6){UserEvents['emit'](_0x3bb671+':'+_0x4429a4['id'],_0x4429a4);UserEvents[_0xa9d9('0x5')](_0x3bb671,_0x4429a4);_0x3345d6(null);};}for(var e in events){if(events[_0xa9d9('0x6')](e)){var event=events[e];User[_0xa9d9('0x7')](e,emitEvent(event));}}module[_0xa9d9('0x8')]=UserEvents;
\ No newline at end of file
index 8455abd..354770d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8888=['Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','internal','concat','models','define','User','users','utf8','utf8_bin','userProfileId','undefined','UserProfile','find','then','privacyEnabled','updateMd5Password','updatePassword','catch','resolve','changed','VoiceExtension','bulkCreate','chanspy','destroy','encryptPassword','function','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','provider','Invalid\x20password','md5secret',':asterisk:','bluebird','util','google','length','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','record','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','WAV','gsm','context','from-sip','system','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','extensionMonitor'];(function(_0x267629,_0x9e5aa9){var _0x2f0b67=function(_0x49c046){while(--_0x49c046){_0x267629['push'](_0x267629['shift']());}};_0x2f0b67(++_0x9e5aa9);}(_0x8888,0xbb));var _0x8888=function(_0x2f3e31,_0x5a4913){_0x2f3e31=_0x2f3e31-0x0;var _0x4fc1c5=_0x8888[_0x2f3e31];return _0x4fc1c5;};'use strict';var BPromise=require(_0x8888('0x0'));var crypto=require('crypto');var util=require(_0x8888('0x1'));var md5=require('md5');var _=require('lodash');var attributes=require('./user.attributes');var authTypes=[_0x8888('0x2')];var validatePresenceOf=function(_0xef659e){return _0xef659e&&_0xef659e[_0x8888('0x3')];};var getChanSpyApplications=function(_0xa23d72,_0x1a5368,_0x77f6e9){var _0x38a58={'context':_0xa23d72['context']||'from-sip','type':'system','isApp':![],'UserId':_0xa23d72['id']};var _0x3a183d=[];for(var _0x2abbd1=0x0,_0x17330d=0x1;_0x2abbd1<_0x77f6e9[_0x8888('0x3')];_0x2abbd1++,_0x17330d=0x1){var _0x3e5b99={'exten':util['format'](_0x8888('0x4'),_0x77f6e9[_0x2abbd1][_0x8888('0x5')],_0x1a5368),'ChanSpyId':_0x77f6e9[_0x2abbd1]['id']};_0x3a183d[_0x8888('0x6')](_[_0x8888('0x7')]({'app':_0x8888('0x8'),'appdata':util[_0x8888('0x9')](_0x8888('0xa'),'chanspy'),'priority':_0x17330d++},_0x38a58,_0x3e5b99));if(_0x77f6e9[_0x2abbd1][_0x8888('0xb')]){_0x3a183d['push'](_[_0x8888('0x7')]({'app':'MixMonitor','appdata':util[_0x8888('0x9')](_0x8888('0xc'),_0x77f6e9[_0x2abbd1]['recordingFormat']),'priority':_0x17330d++},_0x38a58,_0x3e5b99));}if(_0x77f6e9[_0x2abbd1][_0x8888('0xd')]){_0x3a183d[_0x8888('0x6')](_[_0x8888('0x7')]({'app':_0x8888('0xe'),'appdata':_0x77f6e9[_0x2abbd1][_0x8888('0xf')],'priority':_0x17330d++},_0x38a58,_0x3e5b99));}_0x3a183d[_0x8888('0x6')](_['merge']({'app':_0x8888('0x10'),'appdata':util[_0x8888('0x9')](_0x8888('0x11'),_0xa23d72[_0x8888('0x12')],_0x77f6e9[_0x2abbd1][_0x8888('0x13')]?_0x77f6e9[_0x2abbd1]['options']['join'](''):''),'priority':_0x17330d++},_0x38a58,_0x3e5b99));if(_0x77f6e9[_0x2abbd1][_0x8888('0xb')]){_0x3a183d[_0x8888('0x6')](_[_0x8888('0x7')]({'app':_0x8888('0x14'),'priority':_0x17330d++},_0x38a58,_0x3e5b99));}}return _0x3a183d;};var getUserApplications=function(_0x2da772,_0x49ea63){var _0x4d86e1=['wav',_0x8888('0x15'),_0x8888('0x16')];var _0x4d5b13={'context':_0x2da772[_0x8888('0x17')]||_0x8888('0x18'),'exten':_0x49ea63,'type':_0x8888('0x19'),'isApp':![],'UserId':_0x2da772['id']};var _0x14eea8=[{'app':'Set','appdata':'CDR(type)=internal'}];if(_0x2da772['extensionMonitor']&&_[_0x8888('0x1a')](_0x4d86e1,_0x2da772['extensionMonitor'])){_0x14eea8['push']({'app':'Set','appdata':_0x8888('0x1b')});_0x14eea8[_0x8888('0x6')]({'app':_0x8888('0x8'),'appdata':util['format']('_XCALLY_MIXMONITOR_FORMAT=%s',_0x2da772[_0x8888('0x1c')])});_0x14eea8[_0x8888('0x6')]({'app':_0x8888('0x1d'),'appdata':util[_0x8888('0x9')](_0x8888('0x1e'),_0x2da772[_0x8888('0x12')])});}else{_0x14eea8['push']({'app':'Dial','appdata':util[_0x8888('0x9')](_0x8888('0x1f'),_0x2da772[_0x8888('0x12')])});}_0x14eea8['push']({'app':_0x8888('0x20')});for(var _0x3b59c0=0x0;_0x3b59c0<_0x14eea8['length'];_0x3b59c0++){_0x14eea8[_0x3b59c0][_0x8888('0x21')]=_0x3b59c0+0x1;_0x14eea8[_0x3b59c0]=_[_0x8888('0x22')](_0x14eea8[_0x3b59c0],_0x4d5b13);}return _0x14eea8;};var getChanSpyPromise=function(_0x5658de,_0x5bc450){return new BPromise(function(_0xceea02,_0x49ae61){return _0x5658de[_0x8888('0x23')]['findAll']()['then'](function(_0x14148e){if(_0x14148e){var _0x25d765=getChanSpyApplications(_0x5bc450,_0x5bc450[_0x8888('0x24')],_0x14148e);if(_0x5bc450['internal']!=_0x5bc450['name']){_0x25d765=_0x25d765[_0x8888('0x25')](getChanSpyApplications(_0x5bc450,_0x5bc450[_0x8888('0x12')],_0x14148e));}return _0xceea02(_0x25d765);}return _0xceea02([]);})['catch'](function(_0x576c4f){_0x49ae61(_0x576c4f);});});};module['exports']=function(_0x30c494,_0x22e6ad){var _0xda673d=_0x30c494[_0x8888('0x26')];return _0x30c494[_0x8888('0x27')](_0x8888('0x28'),attributes,{'tableName':_0x8888('0x29'),'charset':_0x8888('0x2a'),'collate':_0x8888('0x2b'),'hooks':{'beforeCreate':function(_0x28610a,_0x28cb5f,_0x29dbe7){var _0x3dab65=typeof _0x28610a[_0x8888('0x2c')]===_0x8888('0x2d')?BPromise['resolve'](null):_0xda673d[_0x8888('0x2e')][_0x8888('0x2f')]({'where':{'id':_0x28610a[_0x8888('0x2c')]}});_0x3dab65[_0x8888('0x30')](function(_0x244ce3){if(_0x244ce3){_0x28610a[_0x8888('0x31')]=_0x244ce3[_0x8888('0x31')];}})['then'](function(){_0x28610a[_0x8888('0x32')]();_0x28610a[_0x8888('0x33')](_0x29dbe7);})[_0x8888('0x34')](function(_0x371a70){_0x29dbe7(_0x371a70);});},'beforeUpdate':function(_0x1d3ac6,_0x3010fe,_0x19bb48){Promise[_0x8888('0x35')]()['then'](function(){if(_0x1d3ac6[_0x8888('0x36')](_0x8888('0x2c'))===![])return;return _0xda673d[_0x8888('0x2e')][_0x8888('0x2f')]({'where':{'id':_0x1d3ac6[_0x8888('0x2c')]}})[_0x8888('0x30')](function(_0x1d7402){if(_0x1d7402)_0x1d3ac6['privacyEnabled']=_0x1d7402[_0x8888('0x31')];return;});})[_0x8888('0x30')](function(){if(_0x1d3ac6[_0x8888('0x36')](_0x8888('0xf'))){_0x1d3ac6['updateMd5Password']();return _0x1d3ac6[_0x8888('0x33')](_0x19bb48);}_0x19bb48();})[_0x8888('0x34')](function(_0x38d4d6){_0x19bb48(_0x38d4d6);});},'afterCreate':function(_0x15c93b,_0x5d0c28,_0x4e719f){var _0x3dd6c3=getUserApplications(_0x15c93b,_0x15c93b[_0x8888('0x24')]);if(_0x15c93b['internal']!=_0x15c93b[_0x8888('0x12')]){_0x3dd6c3=_0x3dd6c3[_0x8888('0x25')](getUserApplications(_0x15c93b,_0x15c93b[_0x8888('0x12')]));}return _0xda673d[_0x8888('0x37')][_0x8888('0x38')](_0x3dd6c3)['then'](function(){if(_0x15c93b['chanspy']){return getChanSpyPromise(_0xda673d,_0x15c93b);}})['then'](function(_0x2fd89b){if(_0x2fd89b&&_0x2fd89b[_0x8888('0x3')]){return _0xda673d['VoiceExtension'][_0x8888('0x38')](_0x2fd89b);}})[_0x8888('0x30')](function(){_0x4e719f();})['catch'](function(_0x201461){_0x4e719f(_0x201461);});},'afterUpdate':function(_0x8564d8,_0x5781b9,_0x2f8136){return BPromise['resolve']()[_0x8888('0x30')](function(){if(_0x8564d8['changed'](_0x8888('0x39'))||_0x8564d8[_0x8888('0x36')]('context')){return _0xda673d['VoiceExtension']['destroy']({'where':{'UserId':_0x8564d8['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0x8888('0x30')](function(){if(_0x8564d8[_0x8888('0x39')]){return getChanSpyPromise(_0xda673d,_0x8564d8)[_0x8888('0x30')](function(_0x30e56a){if(_0x30e56a&&_0x30e56a[_0x8888('0x3')]){return _0xda673d[_0x8888('0x37')][_0x8888('0x38')](_0x30e56a);}});}});}})[_0x8888('0x30')](function(){if(_0x8564d8[_0x8888('0x36')](_0x8888('0x1c'))||_0x8564d8[_0x8888('0x36')]('context')){return _0xda673d[_0x8888('0x37')][_0x8888('0x3a')]({'where':{'UserId':_0x8564d8['id'],'type':_0x8888('0x19'),'ChanSpyId':null}})[_0x8888('0x30')](function(){var _0x59c4ff=getUserApplications(_0x8564d8,_0x8564d8[_0x8888('0x24')]);if(_0x8564d8[_0x8888('0x24')]!=_0x8564d8[_0x8888('0x12')]){_0x59c4ff=_0x59c4ff[_0x8888('0x25')](getUserApplications(_0x8564d8,_0x8564d8[_0x8888('0x12')]));}return _0xda673d[_0x8888('0x37')]['bulkCreate'](_0x59c4ff);});}})[_0x8888('0x30')](function(){_0x2f8136();})[_0x8888('0x34')](function(_0x3b9d80){_0x2f8136(_0x3b9d80);});},'afterDestroy':function(_0x356dbe,_0x19e782){return _0xda673d['VoiceExtension'][_0x8888('0x3a')]({'where':{'UserId':_0x356dbe['id'],'type':_0x8888('0x19')}});}},'instanceMethods':{'authenticate':function(_0x48f7f2,_0x56f59f){if(!_0x56f59f){return this[_0x8888('0xf')]===this[_0x8888('0x3b')](_0x48f7f2);}var _0x1b0fce=this;this[_0x8888('0x3b')](_0x48f7f2,function(_0x5d57a7,_0x15db9b){if(_0x5d57a7){_0x56f59f(_0x5d57a7);}if(_0x1b0fce[_0x8888('0xf')]===_0x15db9b){_0x56f59f(null,!![]);}else{_0x56f59f(null,![]);}});},'makeSalt':function(_0x37fe61,_0x5360b8){var _0x5dbec4=0x10;if(typeof arguments[0x0]===_0x8888('0x3c')){_0x5360b8=arguments[0x0];_0x37fe61=_0x5dbec4;}else if(typeof arguments[0x1]==='function'){_0x5360b8=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x37fe61){_0x37fe61=_0x5dbec4;}return crypto[_0x8888('0x3d')](_0x37fe61,function(_0x402966,_0x463570){if(_0x402966){_0x5360b8(_0x402966);}return _0x5360b8(null,_0x463570[_0x8888('0x3e')](_0x8888('0x3f')));});},'encryptPassword':function(_0x4fe7d4,_0x1d1190){if(!_0x4fe7d4||!this[_0x8888('0x40')]){return _0x1d1190?_0x1d1190(null):null;}var _0x131ca7=0x2710;var _0x3e1de9=0x40;var _0x2f7fea=new Buffer(this[_0x8888('0x40')],'base64');if(!_0x1d1190){return crypto[_0x8888('0x41')](_0x4fe7d4,_0x2f7fea,_0x131ca7,_0x3e1de9,_0x8888('0x42'))['toString'](_0x8888('0x3f'));}return crypto[_0x8888('0x43')](_0x4fe7d4,_0x2f7fea,_0x131ca7,_0x3e1de9,_0x8888('0x42'),function(_0x597bf2,_0x51c274){if(_0x597bf2){_0x1d1190(_0x597bf2);}return _0x1d1190(null,_0x51c274[_0x8888('0x3e')](_0x8888('0x3f')));});},'updatePassword':function(_0x5bd177){if(!this['password']){return _0x5bd177(null);}if(!validatePresenceOf(this[_0x8888('0xf')])&&authTypes['indexOf'](this[_0x8888('0x44')])===-0x1){_0x5bd177(new Error(_0x8888('0x45')));}var _0x47f3fa=this;this['makeSalt'](function(_0x169823,_0x3d77e7){if(_0x169823){return _0x5bd177(_0x169823);}_0x47f3fa['salt']=_0x3d77e7;_0x47f3fa[_0x8888('0x3b')](_0x47f3fa[_0x8888('0xf')],function(_0x20c307,_0x4a5974){if(_0x20c307){_0x5bd177(_0x20c307);}_0x47f3fa[_0x8888('0xf')]=_0x4a5974;_0x5bd177(null);});});},'updateMd5Password':function(){this[_0x8888('0x46')]=md5(this['name']+_0x8888('0x47')+this[_0x8888('0xf')]);return this[_0x8888('0x46')];}}});};
\ No newline at end of file
+var _0x9e6b=['find','VoiceExtension','bulkCreate','destroy','concat','encryptPassword','function','Missing\x20Callback','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','crypto','util','md5','lodash','./user.attributes','google','length','context','from-sip','system','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','wav','WAV','gsm','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','catch','exports','models','define','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','privacyEnabled','updateMd5Password','updatePassword','changed'];(function(_0x4fbb86,_0x374ed0){var _0xb141fe=function(_0x382195){while(--_0x382195){_0x4fbb86['push'](_0x4fbb86['shift']());}};_0xb141fe(++_0x374ed0);}(_0x9e6b,0xb8));var _0xb9e6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9e6b[_0x19950b];return _0x3c6b41;};'use strict';var BPromise=require('bluebird');var crypto=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var md5=require(_0xb9e6('0x2'));var _=require(_0xb9e6('0x3'));var attributes=require(_0xb9e6('0x4'));var authTypes=[_0xb9e6('0x5')];var validatePresenceOf=function(_0x4585f1){return _0x4585f1&&_0x4585f1[_0xb9e6('0x6')];};var getChanSpyApplications=function(_0x47abb6,_0x14f373,_0x49af7e){var _0x286b5d={'context':_0x47abb6[_0xb9e6('0x7')]||_0xb9e6('0x8'),'type':_0xb9e6('0x9'),'isApp':![],'UserId':_0x47abb6['id']};var _0x343a89=[];for(var _0x335009=0x0,_0x25f6c3=0x1;_0x335009<_0x49af7e['length'];_0x335009++,_0x25f6c3=0x1){var _0x3f8bd4={'exten':util['format'](_0xb9e6('0xa'),_0x49af7e[_0x335009][_0xb9e6('0xb')],_0x14f373),'ChanSpyId':_0x49af7e[_0x335009]['id']};_0x343a89[_0xb9e6('0xc')](_[_0xb9e6('0xd')]({'app':_0xb9e6('0xe'),'appdata':util[_0xb9e6('0xf')](_0xb9e6('0x10'),_0xb9e6('0x11')),'priority':_0x25f6c3++},_0x286b5d,_0x3f8bd4));if(_0x49af7e[_0x335009]['record']){_0x343a89[_0xb9e6('0xc')](_[_0xb9e6('0xd')]({'app':_0xb9e6('0x12'),'appdata':util[_0xb9e6('0xf')](_0xb9e6('0x13'),_0x49af7e[_0x335009][_0xb9e6('0x14')]),'priority':_0x25f6c3++},_0x286b5d,_0x3f8bd4));}if(_0x49af7e[_0x335009][_0xb9e6('0x15')]){_0x343a89[_0xb9e6('0xc')](_[_0xb9e6('0xd')]({'app':'Authenticate','appdata':_0x49af7e[_0x335009][_0xb9e6('0x16')],'priority':_0x25f6c3++},_0x286b5d,_0x3f8bd4));}_0x343a89['push'](_[_0xb9e6('0xd')]({'app':_0xb9e6('0x17'),'appdata':util[_0xb9e6('0xf')](_0xb9e6('0x18'),_0x47abb6[_0xb9e6('0x19')],_0x49af7e[_0x335009][_0xb9e6('0x1a')]?_0x49af7e[_0x335009]['options'][_0xb9e6('0x1b')](''):''),'priority':_0x25f6c3++},_0x286b5d,_0x3f8bd4));if(_0x49af7e[_0x335009][_0xb9e6('0x1c')]){_0x343a89[_0xb9e6('0xc')](_[_0xb9e6('0xd')]({'app':_0xb9e6('0x1d'),'priority':_0x25f6c3++},_0x286b5d,_0x3f8bd4));}}return _0x343a89;};var getUserApplications=function(_0x2df5d5,_0x206215){var _0x32dc44=[_0xb9e6('0x1e'),_0xb9e6('0x1f'),_0xb9e6('0x20')];var _0x386a4f={'context':_0x2df5d5[_0xb9e6('0x7')]||'from-sip','exten':_0x206215,'type':_0xb9e6('0x9'),'isApp':![],'UserId':_0x2df5d5['id']};var _0x40bcf4=[{'app':_0xb9e6('0xe'),'appdata':_0xb9e6('0x21')}];if(_0x2df5d5['extensionMonitor']&&_[_0xb9e6('0x22')](_0x32dc44,_0x2df5d5[_0xb9e6('0x23')])){_0x40bcf4[_0xb9e6('0xc')]({'app':'Set','appdata':_0xb9e6('0x24')});_0x40bcf4[_0xb9e6('0xc')]({'app':_0xb9e6('0xe'),'appdata':util[_0xb9e6('0xf')](_0xb9e6('0x25'),_0x2df5d5[_0xb9e6('0x23')])});_0x40bcf4[_0xb9e6('0xc')]({'app':'Dial','appdata':util[_0xb9e6('0xf')](_0xb9e6('0x26'),_0x2df5d5[_0xb9e6('0x19')])});}else{_0x40bcf4[_0xb9e6('0xc')]({'app':'Dial','appdata':util['format']('SIP/%s,,tTxX',_0x2df5d5[_0xb9e6('0x19')])});}_0x40bcf4[_0xb9e6('0xc')]({'app':_0xb9e6('0x27')});for(var _0x263856=0x0;_0x263856<_0x40bcf4[_0xb9e6('0x6')];_0x263856++){_0x40bcf4[_0x263856][_0xb9e6('0x28')]=_0x263856+0x1;_0x40bcf4[_0x263856]=_[_0xb9e6('0x29')](_0x40bcf4[_0x263856],_0x386a4f);}return _0x40bcf4;};var getChanSpyPromise=function(_0x4f9e9f,_0x1c020c){return new BPromise(function(_0x3a649f,_0x45db1a){return _0x4f9e9f[_0xb9e6('0x2a')][_0xb9e6('0x2b')]()[_0xb9e6('0x2c')](function(_0x1dbd27){if(_0x1dbd27){var _0x512648=getChanSpyApplications(_0x1c020c,_0x1c020c[_0xb9e6('0x2d')],_0x1dbd27);if(_0x1c020c[_0xb9e6('0x2d')]!=_0x1c020c[_0xb9e6('0x19')]){_0x512648=_0x512648['concat'](getChanSpyApplications(_0x1c020c,_0x1c020c[_0xb9e6('0x19')],_0x1dbd27));}return _0x3a649f(_0x512648);}return _0x3a649f([]);})[_0xb9e6('0x2e')](function(_0x5c1465){_0x45db1a(_0x5c1465);});});};module[_0xb9e6('0x2f')]=function(_0x11144e,_0x2d09a3){var _0x3bfe5e=_0x11144e[_0xb9e6('0x30')];return _0x11144e[_0xb9e6('0x31')](_0xb9e6('0x32'),attributes,{'tableName':_0xb9e6('0x33'),'charset':_0xb9e6('0x34'),'collate':_0xb9e6('0x35'),'hooks':{'beforeCreate':function(_0x2002c5,_0x118f0c,_0x2b490f){var _0x5af918=typeof _0x2002c5[_0xb9e6('0x36')]===_0xb9e6('0x37')?BPromise[_0xb9e6('0x38')](null):_0x3bfe5e[_0xb9e6('0x39')]['find']({'where':{'id':_0x2002c5[_0xb9e6('0x36')]}});_0x5af918[_0xb9e6('0x2c')](function(_0x54df61){if(_0x54df61){_0x2002c5[_0xb9e6('0x3a')]=_0x54df61[_0xb9e6('0x3a')];}})[_0xb9e6('0x2c')](function(){_0x2002c5[_0xb9e6('0x3b')]();_0x2002c5[_0xb9e6('0x3c')](_0x2b490f);})[_0xb9e6('0x2e')](function(_0x15175c){_0x2b490f(_0x15175c);});},'beforeUpdate':function(_0x140c39,_0x190459,_0x160caa){Promise[_0xb9e6('0x38')]()['then'](function(){if(_0x140c39[_0xb9e6('0x3d')](_0xb9e6('0x36'))===![])return;return _0x3bfe5e[_0xb9e6('0x39')][_0xb9e6('0x3e')]({'where':{'id':_0x140c39[_0xb9e6('0x36')]}})['then'](function(_0x551d6c){if(_0x551d6c)_0x140c39['privacyEnabled']=_0x551d6c[_0xb9e6('0x3a')];return;});})[_0xb9e6('0x2c')](function(){if(_0x140c39[_0xb9e6('0x3d')](_0xb9e6('0x16'))){_0x140c39[_0xb9e6('0x3b')]();return _0x140c39['updatePassword'](_0x160caa);}_0x160caa();})[_0xb9e6('0x2e')](function(_0x3d7246){_0x160caa(_0x3d7246);});},'afterCreate':function(_0x1029cd,_0x2a7ea5,_0x2a2d22){var _0x17a0f1=getUserApplications(_0x1029cd,_0x1029cd[_0xb9e6('0x2d')]);if(_0x1029cd[_0xb9e6('0x2d')]!=_0x1029cd[_0xb9e6('0x19')]){_0x17a0f1=_0x17a0f1['concat'](getUserApplications(_0x1029cd,_0x1029cd[_0xb9e6('0x19')]));}return _0x3bfe5e[_0xb9e6('0x3f')]['bulkCreate'](_0x17a0f1)[_0xb9e6('0x2c')](function(){if(_0x1029cd[_0xb9e6('0x11')]){return getChanSpyPromise(_0x3bfe5e,_0x1029cd);}})[_0xb9e6('0x2c')](function(_0x215361){if(_0x215361&&_0x215361['length']){return _0x3bfe5e[_0xb9e6('0x3f')][_0xb9e6('0x40')](_0x215361);}})['then'](function(){_0x2a2d22();})[_0xb9e6('0x2e')](function(_0x345bee){_0x2a2d22(_0x345bee);});},'afterUpdate':function(_0x3c8ca3,_0x509075,_0x2e1736){return BPromise[_0xb9e6('0x38')]()[_0xb9e6('0x2c')](function(){if(_0x3c8ca3[_0xb9e6('0x3d')](_0xb9e6('0x11'))||_0x3c8ca3[_0xb9e6('0x3d')]('context')){return _0x3bfe5e[_0xb9e6('0x3f')][_0xb9e6('0x41')]({'where':{'UserId':_0x3c8ca3['id'],'type':_0xb9e6('0x9'),'ChanSpyId':{'$ne':null}}})[_0xb9e6('0x2c')](function(){if(_0x3c8ca3[_0xb9e6('0x11')]){return getChanSpyPromise(_0x3bfe5e,_0x3c8ca3)[_0xb9e6('0x2c')](function(_0xd5f125){if(_0xd5f125&&_0xd5f125[_0xb9e6('0x6')]){return _0x3bfe5e['VoiceExtension']['bulkCreate'](_0xd5f125);}});}});}})['then'](function(){if(_0x3c8ca3[_0xb9e6('0x3d')](_0xb9e6('0x23'))||_0x3c8ca3[_0xb9e6('0x3d')](_0xb9e6('0x7'))){return _0x3bfe5e[_0xb9e6('0x3f')][_0xb9e6('0x41')]({'where':{'UserId':_0x3c8ca3['id'],'type':'system','ChanSpyId':null}})[_0xb9e6('0x2c')](function(){var _0x1dde8b=getUserApplications(_0x3c8ca3,_0x3c8ca3['internal']);if(_0x3c8ca3['internal']!=_0x3c8ca3[_0xb9e6('0x19')]){_0x1dde8b=_0x1dde8b[_0xb9e6('0x42')](getUserApplications(_0x3c8ca3,_0x3c8ca3[_0xb9e6('0x19')]));}return _0x3bfe5e['VoiceExtension'][_0xb9e6('0x40')](_0x1dde8b);});}})['then'](function(){_0x2e1736();})[_0xb9e6('0x2e')](function(_0x401a8e){_0x2e1736(_0x401a8e);});},'afterDestroy':function(_0x3e9694,_0x3ee313){return _0x3bfe5e[_0xb9e6('0x3f')]['destroy']({'where':{'UserId':_0x3e9694['id'],'type':_0xb9e6('0x9')}});}},'instanceMethods':{'authenticate':function(_0x3e76bb,_0x4a4deb){if(!_0x4a4deb){return this[_0xb9e6('0x16')]===this[_0xb9e6('0x43')](_0x3e76bb);}var _0x5b7c3e=this;this[_0xb9e6('0x43')](_0x3e76bb,function(_0x4ff029,_0x2dfd72){if(_0x4ff029){_0x4a4deb(_0x4ff029);}if(_0x5b7c3e[_0xb9e6('0x16')]===_0x2dfd72){_0x4a4deb(null,!![]);}else{_0x4a4deb(null,![]);}});},'makeSalt':function(_0x2eb37c,_0xe8c9ce){var _0x9ac425=0x10;if(typeof arguments[0x0]===_0xb9e6('0x44')){_0xe8c9ce=arguments[0x0];_0x2eb37c=_0x9ac425;}else if(typeof arguments[0x1]==='function'){_0xe8c9ce=arguments[0x1];}else{throw new Error(_0xb9e6('0x45'));}if(!_0x2eb37c){_0x2eb37c=_0x9ac425;}return crypto['randomBytes'](_0x2eb37c,function(_0x11f04e,_0x27b8a2){if(_0x11f04e){_0xe8c9ce(_0x11f04e);}return _0xe8c9ce(null,_0x27b8a2[_0xb9e6('0x46')](_0xb9e6('0x47')));});},'encryptPassword':function(_0x47780e,_0x57b5de){if(!_0x47780e||!this[_0xb9e6('0x48')]){return _0x57b5de?_0x57b5de(null):null;}var _0x5a1765=0x2710;var _0x5dd0a8=0x40;var _0x5b0829=new Buffer(this['salt'],_0xb9e6('0x47'));if(!_0x57b5de){return crypto[_0xb9e6('0x49')](_0x47780e,_0x5b0829,_0x5a1765,_0x5dd0a8,_0xb9e6('0x4a'))[_0xb9e6('0x46')]('base64');}return crypto[_0xb9e6('0x4b')](_0x47780e,_0x5b0829,_0x5a1765,_0x5dd0a8,_0xb9e6('0x4a'),function(_0x3eec09,_0x2ead2f){if(_0x3eec09){_0x57b5de(_0x3eec09);}return _0x57b5de(null,_0x2ead2f[_0xb9e6('0x46')](_0xb9e6('0x47')));});},'updatePassword':function(_0x4c094a){if(!this[_0xb9e6('0x16')]){return _0x4c094a(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0xb9e6('0x4c')](this[_0xb9e6('0x4d')])===-0x1){_0x4c094a(new Error(_0xb9e6('0x4e')));}var _0x51398c=this;this[_0xb9e6('0x4f')](function(_0x4fdb42,_0x2c5491){if(_0x4fdb42){return _0x4c094a(_0x4fdb42);}_0x51398c[_0xb9e6('0x48')]=_0x2c5491;_0x51398c['encryptPassword'](_0x51398c[_0xb9e6('0x16')],function(_0x536e1e,_0x33b6f0){if(_0x536e1e){_0x4c094a(_0x536e1e);}_0x51398c[_0xb9e6('0x16')]=_0x33b6f0;_0x4c094a(null);});});},'updateMd5Password':function(){this[_0xb9e6('0x50')]=md5(this[_0xb9e6('0x19')]+_0xb9e6('0x51')+this[_0xb9e6('0x16')]);return this['md5secret'];}}});};
\ No newline at end of file
index 1d33f17..d4a9796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a42=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetUser','User','findAll','options','raw','where','limit','include','map','model','attributes','ShowUser','find','PauseUser','role','internal','interface','UserVoiceQueueRt','update','MemberReport','name','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','system','chat','fax','sms','openchannel','whatsapp','%s%s','LogoutUser','destroy','all','LoginUser','SIP/%s','count','agent','../../config/license/util','agents','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','loginInPause','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x233d00,_0x41a7bb){var _0x4296f7=function(_0x255991){while(--_0x255991){_0x233d00['push'](_0x233d00['shift']());}};_0x4296f7(++_0x41a7bb);}(_0x4a42,0x15d));var _0x24a4=function(_0x3d6003,_0x1f79bc){_0x3d6003=_0x3d6003-0x0;var _0x17d2cd=_0x4a42[_0x3d6003];return _0x17d2cd;};'use strict';var _=require(_0x24a4('0x0'));var util=require('util');var moment=require(_0x24a4('0x1'));var BPromise=require(_0x24a4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24a4('0x3'));var db=require(_0x24a4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x24a4('0x5'))('rpc');var config=require(_0x24a4('0x6'));var jayson=require(_0x24a4('0x7'));var client=jayson[_0x24a4('0x8')][_0x24a4('0x9')]({'port':0x232a});config[_0x24a4('0xa')]=_['defaults'](config[_0x24a4('0xa')],{'host':_0x24a4('0xb'),'port':0x18eb});var socket=require(_0x24a4('0xc'))(new Redis(config[_0x24a4('0xa')]));require(_0x24a4('0xd'))[_0x24a4('0xe')](socket);function respondWithRpcPromise(_0x234822,_0x9d8012,_0x576897){return new BPromise(function(_0x363a18,_0x3c66aa){return client[_0x24a4('0xf')](_0x234822,_0x576897)[_0x24a4('0x10')](function(_0x131810){logger[_0x24a4('0x11')](_0x24a4('0x12'),_0x9d8012,_0x24a4('0x13'));logger[_0x24a4('0x14')](_0x24a4('0x15'),_0x9d8012,'request\x20sent',JSON[_0x24a4('0x16')](_0x131810));if(_0x131810[_0x24a4('0x17')]){if(_0x131810[_0x24a4('0x17')]['code']===0x1f4){logger['error'](_0x24a4('0x12'),_0x9d8012,_0x131810[_0x24a4('0x17')]['message']);return _0x3c66aa(_0x131810[_0x24a4('0x17')]['message']);}logger[_0x24a4('0x17')](_0x24a4('0x12'),_0x9d8012,_0x131810[_0x24a4('0x17')][_0x24a4('0x18')]);return _0x363a18(_0x131810[_0x24a4('0x17')][_0x24a4('0x18')]);}else{logger['info'](_0x24a4('0x12'),_0x9d8012,'request\x20sent');_0x363a18(_0x131810[_0x24a4('0x19')][_0x24a4('0x18')]);}})[_0x24a4('0x1a')](function(_0x45fc4c){logger[_0x24a4('0x17')]('User,\x20%s,\x20%s',_0x9d8012,_0x45fc4c);_0x3c66aa(_0x45fc4c);});});}exports[_0x24a4('0x1b')]=function(_0xf8a68){var _0xd798c4=this;return new Promise(function(_0x4feaf2,_0x50dbab){return db[_0x24a4('0x1c')][_0x24a4('0x1d')]({'raw':_0xf8a68[_0x24a4('0x1e')]?_0xf8a68[_0x24a4('0x1e')][_0x24a4('0x1f')]===undefined?!![]:![]:!![],'where':_0xf8a68[_0x24a4('0x1e')]?_0xf8a68[_0x24a4('0x1e')][_0x24a4('0x20')]||null:null,'attributes':_0xf8a68[_0x24a4('0x1e')]?_0xf8a68[_0x24a4('0x1e')]['attributes']||null:null,'limit':_0xf8a68[_0x24a4('0x1e')]?_0xf8a68[_0x24a4('0x1e')][_0x24a4('0x21')]||null:null,'include':_0xf8a68[_0x24a4('0x1e')]?_0xf8a68['options'][_0x24a4('0x22')]?_[_0x24a4('0x23')](_0xf8a68[_0x24a4('0x1e')]['include'],function(_0x360e12){return{'model':db[_0x360e12['model']],'as':_0x360e12['as'],'attributes':_0x360e12['attributes'],'include':_0x360e12['include']?_['map'](_0x360e12[_0x24a4('0x22')],function(_0x20bef8){return{'model':db[_0x20bef8[_0x24a4('0x24')]],'as':_0x20bef8['as'],'attributes':_0x20bef8[_0x24a4('0x25')],'include':_0x20bef8[_0x24a4('0x22')]?_[_0x24a4('0x23')](_0x20bef8['include'],function(_0x59ca05){return{'model':db[_0x59ca05[_0x24a4('0x24')]],'as':_0x59ca05['as'],'attributes':_0x59ca05[_0x24a4('0x25')]};}):[]};}):[]};}):[]:[]})[_0x24a4('0x10')](function(_0x287207){logger[_0x24a4('0x11')]('GetUser',_0xf8a68);logger['debug'](_0x24a4('0x1b'),_0xf8a68,JSON['stringify'](_0x287207));_0x4feaf2(_0x287207);})[_0x24a4('0x1a')](function(_0x52d532){logger['error'](_0x24a4('0x1b'),_0x52d532['message'],_0xf8a68);_0x50dbab(_0xd798c4[_0x24a4('0x17')](0x1f4,_0x52d532['message']));});});};exports[_0x24a4('0x26')]=function(_0x510d43){var _0xaaf72e=this;return new Promise(function(_0x5965f8,_0x3bbe25){return db[_0x24a4('0x1c')][_0x24a4('0x27')]({'raw':_0x510d43[_0x24a4('0x1e')]?_0x510d43[_0x24a4('0x1e')][_0x24a4('0x1f')]===undefined?!![]:![]:!![],'where':_0x510d43[_0x24a4('0x1e')]?_0x510d43[_0x24a4('0x1e')]['where']||null:null,'attributes':_0x510d43['options']?_0x510d43[_0x24a4('0x1e')][_0x24a4('0x25')]||null:null,'include':_0x510d43[_0x24a4('0x1e')]?_0x510d43[_0x24a4('0x1e')][_0x24a4('0x22')]?_[_0x24a4('0x23')](_0x510d43[_0x24a4('0x1e')][_0x24a4('0x22')],function(_0x709fd2){return{'model':db[_0x709fd2[_0x24a4('0x24')]],'as':_0x709fd2['as'],'attributes':_0x709fd2[_0x24a4('0x25')],'include':_0x709fd2[_0x24a4('0x22')]?_[_0x24a4('0x23')](_0x709fd2[_0x24a4('0x22')],function(_0x22fd6e){return{'model':db[_0x22fd6e[_0x24a4('0x24')]],'as':_0x22fd6e['as'],'attributes':_0x22fd6e[_0x24a4('0x25')],'include':_0x22fd6e[_0x24a4('0x22')]?_[_0x24a4('0x23')](_0x22fd6e[_0x24a4('0x22')],function(_0x2f5d75){return{'model':db[_0x2f5d75[_0x24a4('0x24')]],'as':_0x2f5d75['as'],'attributes':_0x2f5d75['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x242ca1){logger[_0x24a4('0x11')](_0x24a4('0x26'),_0x510d43);logger['debug']('ShowUser',_0x510d43,JSON[_0x24a4('0x16')](_0x242ca1));_0x5965f8(_0x242ca1);})[_0x24a4('0x1a')](function(_0x18cc0b){logger[_0x24a4('0x17')](_0x24a4('0x26'),_0x18cc0b[_0x24a4('0x18')],_0x510d43);_0x3bbe25(_0xaaf72e['error'](0x1f4,_0x18cc0b[_0x24a4('0x18')]));});});};exports[_0x24a4('0x28')]=function(_0x133e7b){var _0x4a72e1=this;return new Promise(function(_0x4ec3d6,_0x33b2bf){var _0x4715be;return db[_0x24a4('0x1c')]['find']({'where':_0x133e7b['options'][_0x24a4('0x20')]||{},'attributes':['id','name',_0x24a4('0x29'),_0x24a4('0x2a'),_0x24a4('0x2b')]})[_0x24a4('0x10')](function(_0x533466){if(_0x533466){_0x4715be=_0x533466;return db[_0x24a4('0x2c')][_0x24a4('0x2d')]({'paused':0x1},{'where':{'UserId':_0x4715be['id']},'individualHooks':!![]});}})[_0x24a4('0x10')](function(){if(_0x4715be){return db[_0x24a4('0x2e')][_0x24a4('0x1d')]({'where':{'membername':_0x4715be[_0x24a4('0x2f')],'type':_0x24a4('0x30'),'exitAt':null}});}})['then'](function(_0x67f2f6){if(_0x4715be){if(_0x67f2f6&&_0x67f2f6['length']){var _0x3a0eac=moment()[_0x24a4('0x31')](_0x24a4('0x32'));for(var _0x313a30=0x0,_0x2d80d6=_0x67f2f6[_0x24a4('0x33')];_0x313a30<_0x2d80d6;_0x313a30++){_0x67f2f6[_0x313a30][_0x24a4('0x34')]({'exitAt':_0x3a0eac});}}}})[_0x24a4('0x10')](function(){if(_0x4715be){var _0xa51b05=[];var _0x1a57c4=utils[_0x24a4('0x35')]();_0x1a57c4[_0x24a4('0x36')](function(_0x432491){_0xa51b05[_0x24a4('0x37')]({'channel':_0x432491,'membername':_0x4715be[_0x24a4('0x2f')],'interface':_[_0x24a4('0x38')](_0x4715be[_0x24a4('0x2b')])?util[_0x24a4('0x31')]('SIP/%s',_0x4715be[_0x24a4('0x2f')]):_0x4715be[_0x24a4('0x2b')],'type':_0x24a4('0x30'),'enterAt':moment()[_0x24a4('0x31')](_0x24a4('0x32')),'data1':_0x133e7b[_0x24a4('0x39')]['type']||_0x24a4('0x3a'),'role':_0x4715be[_0x24a4('0x29')],'internal':_0x4715be['internal'],'uniqueid':_0x133e7b[_0x24a4('0x39')][_0x24a4('0x3b')]||null});});return db[_0x24a4('0x2e')][_0x24a4('0x3c')](_0xa51b05,{'individualHooks':!![]});}})[_0x24a4('0x10')](function(){if(_0x4715be){return _0x4715be[_0x24a4('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x133e7b[_0x24a4('0x39')]['type']||_0x24a4('0x3a'),'lastPauseAt':moment()[_0x24a4('0x31')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x24a4('0x10')](function(_0x2b026c){_0x4ec3d6(_0x2b026c);})[_0x24a4('0x1a')](function(_0xf7f16a){_0x33b2bf(_0x4a72e1['error'](0x1f4,_0xf7f16a[_0x24a4('0x18')]));});});};exports[_0x24a4('0x3d')]=function(_0x6fd7dc){var _0x12f168=this;return new Promise(function(_0x30a1ef,_0xaceef4){var _0x25c68d;return db[_0x24a4('0x1c')][_0x24a4('0x3e')]({'where':_0x6fd7dc[_0x24a4('0x1e')]['where']||{},'attributes':['id',_0x24a4('0x2f')]})[_0x24a4('0x10')](function(_0x3550db){if(_0x3550db){_0x25c68d=_0x3550db;if(_0x6fd7dc[_0x24a4('0x39')][_0x24a4('0x3f')]&&!utils[_0x24a4('0x40')](_0x6fd7dc[_0x24a4('0x39')][_0x24a4('0x3f')])){throw new Error('Unknown\x20channel');}switch(_0x6fd7dc[_0x24a4('0x39')][_0x24a4('0x3f')]){case'voice':return db[_0x24a4('0x2c')][_0x24a4('0x2d')]({'paused':0x0},{'where':{'UserId':_0x25c68d['id']}})[_0x24a4('0x10')](function(){return db['MemberReport'][_0x24a4('0x27')]({'where':{'channel':_0x6fd7dc[_0x24a4('0x39')][_0x24a4('0x3f')],'membername':_0x25c68d[_0x24a4('0x2f')],'type':_0x24a4('0x30'),'exitAt':null}});})['then'](function(_0x34092f){if(_0x34092f){return _0x34092f['update']({'exitAt':moment()[_0x24a4('0x31')](_0x24a4('0x32')),'data2':_0x24a4('0x41')},{'individualHooks':!![]});}return null;})[_0x24a4('0x10')](function(){return _0x25c68d[_0x24a4('0x2d')]({'voicePause':![]});});case'mail':case _0x24a4('0x42'):case _0x24a4('0x43'):case _0x24a4('0x44'):case _0x24a4('0x45'):case _0x24a4('0x46'):return db[_0x24a4('0x2e')][_0x24a4('0x27')]({'where':{'channel':_0x6fd7dc[_0x24a4('0x39')][_0x24a4('0x3f')],'membername':_0x25c68d[_0x24a4('0x2f')],'type':'PAUSE','exitAt':null}})[_0x24a4('0x10')](function(_0x3901d7){return _0x3901d7['update']({'exitAt':moment()[_0x24a4('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0x24a4('0x10')](function(){var _0x45b84d={};_['set'](_0x45b84d,util[_0x24a4('0x31')](_0x24a4('0x47'),_0x6fd7dc[_0x24a4('0x39')]['channel'],'Pause'),![]);return _0x25c68d[_0x24a4('0x2d')](_0x45b84d);});default:return db['UserVoiceQueueRt'][_0x24a4('0x2d')]({'paused':0x0},{'where':{'UserId':_0x25c68d['id']}})[_0x24a4('0x10')](function(){return db['MemberReport'][_0x24a4('0x1d')]({'where':{'membername':_0x25c68d[_0x24a4('0x2f')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x492ab4){var _0x26959d=[];_0x492ab4[_0x24a4('0x36')](function(_0x297b7b){_0x26959d[_0x24a4('0x37')](_0x297b7b[_0x24a4('0x2d')]({'exitAt':moment()[_0x24a4('0x31')](_0x24a4('0x32')),'data2':_0x24a4('0x41')}));});return BPromise['all'](_0x26959d);})[_0x24a4('0x10')](function(){return _0x25c68d[_0x24a4('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x24a4('0x10')](function(_0x2eaf00){_0x30a1ef(_0x2eaf00);})[_0x24a4('0x1a')](function(_0x5db276){_0xaceef4(_0x12f168[_0x24a4('0x17')](0x1f4,_0x5db276[_0x24a4('0x18')]));});});};exports[_0x24a4('0x48')]=function(_0x54a1bb){var _0x5d0a4d=this;return new Promise(function(_0x339527,_0x3d00b0){var _0x5a86fa;return db[_0x24a4('0x1c')][_0x24a4('0x3e')]({'where':_0x54a1bb[_0x24a4('0x1e')][_0x24a4('0x20')]||{},'attributes':['id',_0x24a4('0x2f')]})[_0x24a4('0x10')](function(_0x5eecaf){if(_0x5eecaf){_0x5a86fa=_0x5eecaf;return db[_0x24a4('0x2c')][_0x24a4('0x49')]({'where':{'membername':_0x5a86fa[_0x24a4('0x2f')]},'individualHooks':!![]});}})[_0x24a4('0x10')](function(){if(_0x5a86fa){return db['MemberReport'][_0x24a4('0x1d')]({'where':{'membername':_0x5a86fa['name'],'exitAt':null}});}})[_0x24a4('0x10')](function(_0x42dc5a){if(_0x5a86fa){if(_0x42dc5a&&_0x42dc5a[_0x24a4('0x33')]){var _0x2b93ac=[];_0x42dc5a[_0x24a4('0x36')](function(_0x508207){_0x2b93ac['push'](_0x508207[_0x24a4('0x2d')]({'exitAt':moment()['format'](_0x24a4('0x32'))}));});return BPromise[_0x24a4('0x4a')](_0x2b93ac);}}})[_0x24a4('0x10')](function(){if(_0x5a86fa){return _0x5a86fa[_0x24a4('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x24a4('0x10')](function(_0x23df9f){_0x339527(_0x23df9f);})[_0x24a4('0x1a')](function(_0x119ed6){_0x3d00b0(_0x5d0a4d[_0x24a4('0x17')](0x1f4,_0x119ed6[_0x24a4('0x18')]));});});};exports[_0x24a4('0x4b')]=function(_0x382cd9){var _0x319b1d=this;return new Promise(function(_0x72e14f,_0xe94f37){var _0x18402e;var _0x5c6bb9;var _0x248677;var _0x3ba113;return db[_0x24a4('0x1c')]['findOne']({'where':_0x382cd9[_0x24a4('0x1e')][_0x24a4('0x20')]||{},'attributes':['id','name',_0x24a4('0x29'),'mobile','phone','internal','loginInPause',_0x24a4('0x2b')]})['then'](function(_0x5b5c9b){if(_0x5b5c9b){_0x18402e=_0x5b5c9b;_0x3ba113=_0x382cd9['body']['interface']?_0x382cd9[_0x24a4('0x39')]['interface']:util['format'](_0x24a4('0x4c'),_0x18402e[_0x24a4('0x2f')]);return db[_0x24a4('0x1c')][_0x24a4('0x4d')]({'where':{'role':_0x24a4('0x4e'),'online':!![],'id':{'$ne':_0x18402e['id']}}});}})[_0x24a4('0x10')](function(_0x428800){if(_0x428800){_0x248677=_0x428800;return require(_0x24a4('0x4f'))['getLicense']();}})[_0x24a4('0x10')](function(_0x2e0464){if(_0x2e0464&&_0x2e0464[_0x24a4('0x50')]&&_0x248677>=_0x2e0464['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x24a4('0x10')](function(){if(_0x18402e){return db[_0x24a4('0x2c')][_0x24a4('0x49')]({'where':{'membername':_0x18402e[_0x24a4('0x2f')]},'individualHooks':!![]});}})[_0x24a4('0x10')](function(){if(_0x18402e){return _0x18402e['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x5ea50e){if(_0x18402e){if(_0x5ea50e){var _0x909516=[];_0x5c6bb9=_0x5ea50e;if(_0x5c6bb9['length']){for(var _0x12df7d=0x0;_0x12df7d<_0x5c6bb9[_0x24a4('0x33')];_0x12df7d++){_0x909516[_0x24a4('0x37')](db[_0x24a4('0x2c')][_0x24a4('0x51')]({'membername':_0x18402e[_0x24a4('0x2f')],'UserId':_0x18402e['id'],'queue_name':_0x5c6bb9[_0x12df7d]['name'],'VoiceQueueId':_0x5c6bb9[_0x12df7d]['id'],'interface':_0x3ba113,'paused':_0x18402e['loginInPause']||![],'penalty':_0x5c6bb9[_0x12df7d][_0x24a4('0x52')]||0x0}));}return BPromise['all'](_0x909516);}}}})[_0x24a4('0x10')](function(){if(_0x18402e){return db[_0x24a4('0x2e')][_0x24a4('0x1d')]({'where':{'membername':_0x18402e[_0x24a4('0x2f')],'exitAt':null}});}})[_0x24a4('0x10')](function(_0x1fe16f){if(_0x18402e){if(_0x1fe16f&&_0x1fe16f[_0x24a4('0x33')]){var _0x18a2cc=[];_0x1fe16f['forEach'](function(_0x44a3e7){_0x18a2cc['push'](_0x44a3e7[_0x24a4('0x2d')]({'exitAt':moment()[_0x24a4('0x31')](_0x24a4('0x32'))}));});return BPromise['all'](_0x18a2cc);}}})['then'](function(_0x34927b){if(_0x18402e){var _0x3cdcab=[];var _0x48ac0b=[];var _0x30b3b0=utils[_0x24a4('0x35')]();var _0x20e133={'membername':_0x18402e[_0x24a4('0x2f')],'interface':_0x3ba113,'enterAt':moment()[_0x24a4('0x31')](_0x24a4('0x32')),'role':_0x18402e[_0x24a4('0x29')],'internal':_0x18402e['internal']};_0x30b3b0[_0x24a4('0x36')](function(_0x418f04){_0x3cdcab[_0x24a4('0x37')](_[_0x24a4('0x53')]({'channel':_0x418f04,'type':_0x24a4('0x54'),'data1':_0x24a4('0x55'),'data2':_0x3ba113},_0x20e133));if(_0x18402e['loginInPause']){_0x48ac0b[_0x24a4('0x37')](_[_0x24a4('0x53')]({'channel':_0x418f04,'type':'PAUSE','data1':_0x24a4('0x56')},_0x20e133));}});return db[_0x24a4('0x2e')][_0x24a4('0x3c')](_0x3cdcab[_0x24a4('0x57')](_0x48ac0b),{'individualHooks':!![]});}})[_0x24a4('0x10')](function(){if(_0x18402e){return _0x18402e[_0x24a4('0x2d')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x18402e['loginInPause']||![],'mailPause':_0x18402e[_0x24a4('0x58')]||![],'chatPause':_0x18402e[_0x24a4('0x58')]||![],'faxPause':_0x18402e['loginInPause']||![],'smsPause':_0x18402e['loginInPause']||![],'openchannelPause':_0x18402e[_0x24a4('0x58')]||![],'pauseType':_0x18402e[_0x24a4('0x58')]?_0x24a4('0x56'):null,'lastPauseAt':moment()[_0x24a4('0x31')](_0x24a4('0x32')),'interface':_0x3ba113});}})[_0x24a4('0x10')](function(_0x414682){_0x72e14f(_0x414682);})[_0x24a4('0x1a')](function(_0x69fffa){_0xe94f37(_0x319b1d['error'](0x1f4,_0x69fffa['message']));});});};
\ No newline at end of file
+var _0xdcf9=['YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','update','system','chat','sms','set','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./user.socket','register','request','then','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','findAll','raw','options','where','limit','include','map','attributes','model','GetUser','ShowUser','User','find','PauseUser','role','internal','interface','MemberReport','name','PAUSE','length','format'];(function(_0x44a6ca,_0x1b1583){var _0x40d836=function(_0x297014){while(--_0x297014){_0x44a6ca['push'](_0x44a6ca['shift']());}};_0x40d836(++_0x1b1583);}(_0xdcf9,0x194));var _0x9dcf=function(_0x4d9db5,_0x5ecd4c){_0x4d9db5=_0x4d9db5-0x0;var _0x306318=_0xdcf9[_0x4d9db5];return _0x306318;};'use strict';var _=require(_0x9dcf('0x0'));var util=require(_0x9dcf('0x1'));var moment=require(_0x9dcf('0x2'));var BPromise=require(_0x9dcf('0x3'));var rs=require(_0x9dcf('0x4'));var fs=require('fs');var Redis=require(_0x9dcf('0x5'));var db=require(_0x9dcf('0x6'))['db'];var utils=require(_0x9dcf('0x7'));var logger=require(_0x9dcf('0x8'))('rpc');var config=require(_0x9dcf('0x9'));var jayson=require(_0x9dcf('0xa'));var client=jayson[_0x9dcf('0xb')][_0x9dcf('0xc')]({'port':0x232a});config[_0x9dcf('0xd')]=_[_0x9dcf('0xe')](config[_0x9dcf('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x9dcf('0xf'))(new Redis(config[_0x9dcf('0xd')]));require(_0x9dcf('0x10'))[_0x9dcf('0x11')](socket);function respondWithRpcPromise(_0x5796dd,_0x221ce9,_0x42cb2f){return new BPromise(function(_0x843e89,_0x39e09f){return client[_0x9dcf('0x12')](_0x5796dd,_0x42cb2f)[_0x9dcf('0x13')](function(_0x4f2f30){logger['info'](_0x9dcf('0x14'),_0x221ce9,_0x9dcf('0x15'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x221ce9,'request\x20sent',JSON[_0x9dcf('0x16')](_0x4f2f30));if(_0x4f2f30[_0x9dcf('0x17')]){if(_0x4f2f30[_0x9dcf('0x17')][_0x9dcf('0x18')]===0x1f4){logger[_0x9dcf('0x17')](_0x9dcf('0x14'),_0x221ce9,_0x4f2f30[_0x9dcf('0x17')][_0x9dcf('0x19')]);return _0x39e09f(_0x4f2f30['error'][_0x9dcf('0x19')]);}logger[_0x9dcf('0x17')]('User,\x20%s,\x20%s',_0x221ce9,_0x4f2f30[_0x9dcf('0x17')][_0x9dcf('0x19')]);return _0x843e89(_0x4f2f30[_0x9dcf('0x17')][_0x9dcf('0x19')]);}else{logger[_0x9dcf('0x1a')](_0x9dcf('0x14'),_0x221ce9,_0x9dcf('0x15'));_0x843e89(_0x4f2f30[_0x9dcf('0x1b')][_0x9dcf('0x19')]);}})[_0x9dcf('0x1c')](function(_0x32d413){logger[_0x9dcf('0x17')]('User,\x20%s,\x20%s',_0x221ce9,_0x32d413);_0x39e09f(_0x32d413);});});}exports['GetUser']=function(_0x1c2cd2){var _0x1192d7=this;return new Promise(function(_0x676051,_0x470503){return db['User'][_0x9dcf('0x1d')]({'raw':_0x1c2cd2['options']?_0x1c2cd2['options'][_0x9dcf('0x1e')]===undefined?!![]:![]:!![],'where':_0x1c2cd2['options']?_0x1c2cd2[_0x9dcf('0x1f')][_0x9dcf('0x20')]||null:null,'attributes':_0x1c2cd2[_0x9dcf('0x1f')]?_0x1c2cd2['options']['attributes']||null:null,'limit':_0x1c2cd2[_0x9dcf('0x1f')]?_0x1c2cd2[_0x9dcf('0x1f')][_0x9dcf('0x21')]||null:null,'include':_0x1c2cd2[_0x9dcf('0x1f')]?_0x1c2cd2[_0x9dcf('0x1f')][_0x9dcf('0x22')]?_[_0x9dcf('0x23')](_0x1c2cd2['options'][_0x9dcf('0x22')],function(_0x598dc5){return{'model':db[_0x598dc5['model']],'as':_0x598dc5['as'],'attributes':_0x598dc5[_0x9dcf('0x24')],'include':_0x598dc5['include']?_['map'](_0x598dc5[_0x9dcf('0x22')],function(_0x567cd8){return{'model':db[_0x567cd8[_0x9dcf('0x25')]],'as':_0x567cd8['as'],'attributes':_0x567cd8[_0x9dcf('0x24')],'include':_0x567cd8[_0x9dcf('0x22')]?_[_0x9dcf('0x23')](_0x567cd8[_0x9dcf('0x22')],function(_0x27856d){return{'model':db[_0x27856d[_0x9dcf('0x25')]],'as':_0x27856d['as'],'attributes':_0x27856d[_0x9dcf('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a2cc0){logger['info'](_0x9dcf('0x26'),_0x1c2cd2);logger['debug'](_0x9dcf('0x26'),_0x1c2cd2,JSON[_0x9dcf('0x16')](_0x5a2cc0));_0x676051(_0x5a2cc0);})[_0x9dcf('0x1c')](function(_0x469749){logger['error'](_0x9dcf('0x26'),_0x469749[_0x9dcf('0x19')],_0x1c2cd2);_0x470503(_0x1192d7['error'](0x1f4,_0x469749[_0x9dcf('0x19')]));});});};exports[_0x9dcf('0x27')]=function(_0x4a5eaa){var _0x5c2af7=this;return new Promise(function(_0x592406,_0x39310a){return db[_0x9dcf('0x28')][_0x9dcf('0x29')]({'raw':_0x4a5eaa[_0x9dcf('0x1f')]?_0x4a5eaa[_0x9dcf('0x1f')][_0x9dcf('0x1e')]===undefined?!![]:![]:!![],'where':_0x4a5eaa[_0x9dcf('0x1f')]?_0x4a5eaa['options'][_0x9dcf('0x20')]||null:null,'attributes':_0x4a5eaa[_0x9dcf('0x1f')]?_0x4a5eaa[_0x9dcf('0x1f')]['attributes']||null:null,'include':_0x4a5eaa[_0x9dcf('0x1f')]?_0x4a5eaa[_0x9dcf('0x1f')][_0x9dcf('0x22')]?_[_0x9dcf('0x23')](_0x4a5eaa[_0x9dcf('0x1f')]['include'],function(_0x494e66){return{'model':db[_0x494e66[_0x9dcf('0x25')]],'as':_0x494e66['as'],'attributes':_0x494e66[_0x9dcf('0x24')],'include':_0x494e66[_0x9dcf('0x22')]?_[_0x9dcf('0x23')](_0x494e66['include'],function(_0x26f93d){return{'model':db[_0x26f93d[_0x9dcf('0x25')]],'as':_0x26f93d['as'],'attributes':_0x26f93d['attributes'],'include':_0x26f93d[_0x9dcf('0x22')]?_[_0x9dcf('0x23')](_0x26f93d[_0x9dcf('0x22')],function(_0x444b38){return{'model':db[_0x444b38[_0x9dcf('0x25')]],'as':_0x444b38['as'],'attributes':_0x444b38['attributes']};}):[]};}):[]};}):[]:[]})[_0x9dcf('0x13')](function(_0x440d6c){logger[_0x9dcf('0x1a')]('ShowUser',_0x4a5eaa);logger['debug'](_0x9dcf('0x27'),_0x4a5eaa,JSON[_0x9dcf('0x16')](_0x440d6c));_0x592406(_0x440d6c);})['catch'](function(_0x5d4bc4){logger[_0x9dcf('0x17')]('ShowUser',_0x5d4bc4[_0x9dcf('0x19')],_0x4a5eaa);_0x39310a(_0x5c2af7['error'](0x1f4,_0x5d4bc4[_0x9dcf('0x19')]));});});};exports[_0x9dcf('0x2a')]=function(_0x22a2f7){var _0x136613=this;return new Promise(function(_0x9ae723,_0x5dcc44){var _0x4e92bc;return db[_0x9dcf('0x28')][_0x9dcf('0x29')]({'where':_0x22a2f7[_0x9dcf('0x1f')][_0x9dcf('0x20')]||{},'attributes':['id','name',_0x9dcf('0x2b'),_0x9dcf('0x2c'),_0x9dcf('0x2d')]})[_0x9dcf('0x13')](function(_0x21f97d){if(_0x21f97d){_0x4e92bc=_0x21f97d;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x4e92bc['id']},'individualHooks':!![]});}})['then'](function(){if(_0x4e92bc){return db[_0x9dcf('0x2e')][_0x9dcf('0x1d')]({'where':{'membername':_0x4e92bc[_0x9dcf('0x2f')],'type':_0x9dcf('0x30'),'exitAt':null}});}})[_0x9dcf('0x13')](function(_0x1e2d59){if(_0x4e92bc){if(_0x1e2d59&&_0x1e2d59[_0x9dcf('0x31')]){var _0x5343b2=moment()[_0x9dcf('0x32')](_0x9dcf('0x33'));for(var _0x28b1b2=0x0,_0x4ed446=_0x1e2d59[_0x9dcf('0x31')];_0x28b1b2<_0x4ed446;_0x28b1b2++){_0x1e2d59[_0x28b1b2]['updateAttributes']({'exitAt':_0x5343b2});}}}})['then'](function(){if(_0x4e92bc){var _0xcd6cad=[];var _0x1cca85=utils[_0x9dcf('0x34')]();_0x1cca85[_0x9dcf('0x35')](function(_0x31bbd8){_0xcd6cad[_0x9dcf('0x36')]({'channel':_0x31bbd8,'membername':_0x4e92bc[_0x9dcf('0x2f')],'interface':_[_0x9dcf('0x37')](_0x4e92bc[_0x9dcf('0x2d')])?util[_0x9dcf('0x32')]('SIP/%s',_0x4e92bc[_0x9dcf('0x2f')]):_0x4e92bc[_0x9dcf('0x2d')],'type':_0x9dcf('0x30'),'enterAt':moment()['format'](_0x9dcf('0x33')),'data1':_0x22a2f7[_0x9dcf('0x38')]['type']||_0x9dcf('0x39'),'role':_0x4e92bc['role'],'internal':_0x4e92bc['internal'],'uniqueid':_0x22a2f7[_0x9dcf('0x38')][_0x9dcf('0x3a')]||null});});return db[_0x9dcf('0x2e')][_0x9dcf('0x3b')](_0xcd6cad,{'individualHooks':!![]});}})[_0x9dcf('0x13')](function(){if(_0x4e92bc){return _0x4e92bc['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x22a2f7['body']['type']||_0x9dcf('0x39'),'lastPauseAt':moment()[_0x9dcf('0x32')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9dcf('0x13')](function(_0x1f71de){_0x9ae723(_0x1f71de);})['catch'](function(_0x3f7740){_0x5dcc44(_0x136613[_0x9dcf('0x17')](0x1f4,_0x3f7740['message']));});});};exports[_0x9dcf('0x3c')]=function(_0x380ffa){var _0x123703=this;return new Promise(function(_0x47c03f,_0x9e624b){var _0x33282c;return db[_0x9dcf('0x28')][_0x9dcf('0x3d')]({'where':_0x380ffa[_0x9dcf('0x1f')]['where']||{},'attributes':['id',_0x9dcf('0x2f')]})['then'](function(_0x1891c8){if(_0x1891c8){_0x33282c=_0x1891c8;if(_0x380ffa[_0x9dcf('0x38')][_0x9dcf('0x3e')]&&!utils[_0x9dcf('0x3f')](_0x380ffa[_0x9dcf('0x38')][_0x9dcf('0x3e')])){throw new Error(_0x9dcf('0x40'));}switch(_0x380ffa[_0x9dcf('0x38')][_0x9dcf('0x3e')]){case _0x9dcf('0x41'):return db[_0x9dcf('0x42')][_0x9dcf('0x43')]({'paused':0x0},{'where':{'UserId':_0x33282c['id']}})['then'](function(){return db['MemberReport']['find']({'where':{'channel':_0x380ffa[_0x9dcf('0x38')]['channel'],'membername':_0x33282c[_0x9dcf('0x2f')],'type':_0x9dcf('0x30'),'exitAt':null}});})[_0x9dcf('0x13')](function(_0x1db7c1){if(_0x1db7c1){return _0x1db7c1['update']({'exitAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'data2':_0x9dcf('0x44')},{'individualHooks':!![]});}return null;})[_0x9dcf('0x13')](function(){return _0x33282c['update']({'voicePause':![]});});case'mail':case _0x9dcf('0x45'):case'fax':case _0x9dcf('0x46'):case'openchannel':case'whatsapp':return db[_0x9dcf('0x2e')][_0x9dcf('0x29')]({'where':{'channel':_0x380ffa[_0x9dcf('0x38')][_0x9dcf('0x3e')],'membername':_0x33282c['name'],'type':_0x9dcf('0x30'),'exitAt':null}})[_0x9dcf('0x13')](function(_0x3af365){return _0x3af365[_0x9dcf('0x43')]({'exitAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'data2':_0x9dcf('0x44')},{'individualHooks':!![]});})[_0x9dcf('0x13')](function(){var _0x4df75f={};_[_0x9dcf('0x47')](_0x4df75f,util['format']('%s%s',_0x380ffa['body'][_0x9dcf('0x3e')],_0x9dcf('0x48')),![]);return _0x33282c['update'](_0x4df75f);});default:return db[_0x9dcf('0x42')][_0x9dcf('0x43')]({'paused':0x0},{'where':{'UserId':_0x33282c['id']}})['then'](function(){return db[_0x9dcf('0x2e')][_0x9dcf('0x1d')]({'where':{'membername':_0x33282c[_0x9dcf('0x2f')],'type':'PAUSE','exitAt':null}});})[_0x9dcf('0x13')](function(_0x541d6f){var _0x39b933=[];_0x541d6f['forEach'](function(_0x39c798){_0x39b933[_0x9dcf('0x36')](_0x39c798[_0x9dcf('0x43')]({'exitAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'data2':_0x9dcf('0x44')}));});return BPromise[_0x9dcf('0x49')](_0x39b933);})[_0x9dcf('0x13')](function(){return _0x33282c[_0x9dcf('0x43')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x9dcf('0x13')](function(_0x59e290){_0x47c03f(_0x59e290);})['catch'](function(_0x4f0955){_0x9e624b(_0x123703[_0x9dcf('0x17')](0x1f4,_0x4f0955[_0x9dcf('0x19')]));});});};exports[_0x9dcf('0x4a')]=function(_0x3365ee){var _0xf54764=this;return new Promise(function(_0x25c432,_0x151218){var _0x4573c1;return db[_0x9dcf('0x28')][_0x9dcf('0x3d')]({'where':_0x3365ee[_0x9dcf('0x1f')]['where']||{},'attributes':['id',_0x9dcf('0x2f')]})['then'](function(_0x110ab5){if(_0x110ab5){_0x4573c1=_0x110ab5;return db[_0x9dcf('0x42')][_0x9dcf('0x4b')]({'where':{'membername':_0x4573c1[_0x9dcf('0x2f')]},'individualHooks':!![]});}})[_0x9dcf('0x13')](function(){if(_0x4573c1){return db[_0x9dcf('0x2e')][_0x9dcf('0x1d')]({'where':{'membername':_0x4573c1[_0x9dcf('0x2f')],'exitAt':null}});}})[_0x9dcf('0x13')](function(_0x4971f1){if(_0x4573c1){if(_0x4971f1&&_0x4971f1[_0x9dcf('0x31')]){var _0x318f63=[];_0x4971f1[_0x9dcf('0x35')](function(_0x5176fc){_0x318f63[_0x9dcf('0x36')](_0x5176fc[_0x9dcf('0x43')]({'exitAt':moment()['format'](_0x9dcf('0x33'))}));});return BPromise[_0x9dcf('0x49')](_0x318f63);}}})['then'](function(){if(_0x4573c1){return _0x4573c1[_0x9dcf('0x43')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x52213f){_0x25c432(_0x52213f);})['catch'](function(_0x3a286e){_0x151218(_0xf54764[_0x9dcf('0x17')](0x1f4,_0x3a286e[_0x9dcf('0x19')]));});});};exports[_0x9dcf('0x4c')]=function(_0x50296f){var _0x170a73=this;return new Promise(function(_0x56ff38,_0x34f4b5){var _0x103355;var _0x5cfaef;var _0x2d1dbb;var _0xdce94f;return db[_0x9dcf('0x28')][_0x9dcf('0x3d')]({'where':_0x50296f[_0x9dcf('0x1f')]['where']||{},'attributes':['id',_0x9dcf('0x2f'),_0x9dcf('0x2b'),_0x9dcf('0x4d'),_0x9dcf('0x4e'),_0x9dcf('0x2c'),_0x9dcf('0x4f'),_0x9dcf('0x2d')]})[_0x9dcf('0x13')](function(_0xbaf133){if(_0xbaf133){_0x103355=_0xbaf133;_0xdce94f=_0x50296f[_0x9dcf('0x38')][_0x9dcf('0x2d')]?_0x50296f['body'][_0x9dcf('0x2d')]:util['format']('SIP/%s',_0x103355[_0x9dcf('0x2f')]);return db['User'][_0x9dcf('0x50')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x103355['id']}}});}})[_0x9dcf('0x13')](function(_0x9c2024){if(_0x9c2024){_0x2d1dbb=_0x9c2024;return require(_0x9dcf('0x51'))[_0x9dcf('0x52')]();}})['then'](function(_0x48c784){if(_0x48c784&&_0x48c784[_0x9dcf('0x53')]&&_0x2d1dbb>=_0x48c784[_0x9dcf('0x53')]){throw new Error(_0x9dcf('0x54'));}})[_0x9dcf('0x13')](function(){if(_0x103355){return db[_0x9dcf('0x42')][_0x9dcf('0x4b')]({'where':{'membername':_0x103355['name']},'individualHooks':!![]});}})[_0x9dcf('0x13')](function(){if(_0x103355){return _0x103355['getVoiceQueues']({'raw':!![]});}})[_0x9dcf('0x13')](function(_0x439f4d){if(_0x103355){if(_0x439f4d){var _0x81a118=[];_0x5cfaef=_0x439f4d;if(_0x5cfaef[_0x9dcf('0x31')]){for(var _0xd5152e=0x0;_0xd5152e<_0x5cfaef[_0x9dcf('0x31')];_0xd5152e++){_0x81a118[_0x9dcf('0x36')](db[_0x9dcf('0x42')]['upsert']({'membername':_0x103355[_0x9dcf('0x2f')],'UserId':_0x103355['id'],'queue_name':_0x5cfaef[_0xd5152e][_0x9dcf('0x2f')],'VoiceQueueId':_0x5cfaef[_0xd5152e]['id'],'interface':_0xdce94f,'paused':_0x103355['loginInPause']||![],'penalty':_0x5cfaef[_0xd5152e][_0x9dcf('0x55')]||0x0}));}return BPromise[_0x9dcf('0x49')](_0x81a118);}}}})[_0x9dcf('0x13')](function(){if(_0x103355){return db[_0x9dcf('0x2e')]['findAll']({'where':{'membername':_0x103355[_0x9dcf('0x2f')],'exitAt':null}});}})[_0x9dcf('0x13')](function(_0xbd07d1){if(_0x103355){if(_0xbd07d1&&_0xbd07d1[_0x9dcf('0x31')]){var _0x333f8d=[];_0xbd07d1['forEach'](function(_0xdcfba9){_0x333f8d['push'](_0xdcfba9['update']({'exitAt':moment()['format'](_0x9dcf('0x33'))}));});return BPromise[_0x9dcf('0x49')](_0x333f8d);}}})[_0x9dcf('0x13')](function(_0x3921a7){if(_0x103355){var _0x3bb99c=[];var _0x32efe3=[];var _0x145e0d=utils[_0x9dcf('0x34')]();var _0x323f0a={'membername':_0x103355[_0x9dcf('0x2f')],'interface':_0xdce94f,'enterAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'role':_0x103355[_0x9dcf('0x2b')],'internal':_0x103355['internal']};_0x145e0d[_0x9dcf('0x35')](function(_0x3518e8){_0x3bb99c[_0x9dcf('0x36')](_[_0x9dcf('0x56')]({'channel':_0x3518e8,'type':_0x9dcf('0x57'),'data1':_0x9dcf('0x58'),'data2':_0xdce94f},_0x323f0a));if(_0x103355[_0x9dcf('0x4f')]){_0x32efe3['push'](_[_0x9dcf('0x56')]({'channel':_0x3518e8,'type':'PAUSE','data1':'LOGININPAUSE'},_0x323f0a));}});return db[_0x9dcf('0x2e')][_0x9dcf('0x3b')](_0x3bb99c[_0x9dcf('0x59')](_0x32efe3),{'individualHooks':!![]});}})['then'](function(){if(_0x103355){return _0x103355[_0x9dcf('0x43')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x103355[_0x9dcf('0x4f')]||![],'mailPause':_0x103355[_0x9dcf('0x4f')]||![],'chatPause':_0x103355[_0x9dcf('0x4f')]||![],'faxPause':_0x103355[_0x9dcf('0x4f')]||![],'smsPause':_0x103355[_0x9dcf('0x4f')]||![],'openchannelPause':_0x103355['loginInPause']||![],'pauseType':_0x103355[_0x9dcf('0x4f')]?_0x9dcf('0x5a'):null,'lastPauseAt':moment()[_0x9dcf('0x32')](_0x9dcf('0x33')),'interface':_0xdce94f});}})[_0x9dcf('0x13')](function(_0x56bc41){_0x56ff38(_0x56bc41);})[_0x9dcf('0x1c')](function(_0x30dacb){_0x34f4b5(_0x170a73[_0x9dcf('0x17')](0x1f4,_0x30dacb[_0x9dcf('0x19')]));});});};
\ No newline at end of file
index 7476c3e..2bb4a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4813=['update','removeListener','register','length','user:','./user.events','save','remove'];(function(_0x39c82d,_0xb77094){var _0x5011dc=function(_0x5cc753){while(--_0x5cc753){_0x39c82d['push'](_0x39c82d['shift']());}};_0x5011dc(++_0xb77094);}(_0x4813,0xb5));var _0x3481=function(_0x51368f,_0x6f176b){_0x51368f=_0x51368f-0x0;var _0x502399=_0x4813[_0x51368f];return _0x502399;};'use strict';var UserEvents=require(_0x3481('0x0'));var events=[_0x3481('0x1'),_0x3481('0x2'),_0x3481('0x3')];function createListener(_0x204733,_0x7b72bb){return function(_0xd67f1){_0x7b72bb['emit'](_0x204733,_0xd67f1);};}function removeListener(_0x38846e,_0x3bbdc4){return function(){UserEvents[_0x3481('0x4')](_0x38846e,_0x3bbdc4);};}exports[_0x3481('0x5')]=function(_0x3d5675){for(var _0x431f5d=0x0,_0x378ae1=events[_0x3481('0x6')];_0x431f5d<_0x378ae1;_0x431f5d++){var _0x4f82d2=events[_0x431f5d];var _0x323b0f=createListener(_0x3481('0x7')+_0x4f82d2,_0x3d5675);UserEvents['on'](_0x4f82d2,_0x323b0f);}};
\ No newline at end of file
+var _0x3467=['update','removeListener','register','length','./user.events'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0x3467,0x1d0));var _0x7346=function(_0x50b37b,_0x206585){_0x50b37b=_0x50b37b-0x0;var _0x2421ab=_0x3467[_0x50b37b];return _0x2421ab;};'use strict';var UserEvents=require(_0x7346('0x0'));var events=['save','remove',_0x7346('0x1')];function createListener(_0xc041b,_0x236616){return function(_0x36bbf8){_0x236616['emit'](_0xc041b,_0x36bbf8);};}function removeListener(_0x34b923,_0x41cb3a){return function(){UserEvents[_0x7346('0x2')](_0x34b923,_0x41cb3a);};}exports[_0x7346('0x3')]=function(_0x80240f){for(var _0x4ac369=0x0,_0x3f3c74=events[_0x7346('0x4')];_0x4ac369<_0x3f3c74;_0x4ac369++){var _0x8c4f68=events[_0x4ac369];var _0xd3b27b=createListener('user:'+_0x8c4f68,_0x80240f);UserEvents['on'](_0x8c4f68,_0xd3b27b);}};
\ No newline at end of file
index b98891d..954693e 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(_0x464c66,_0x50c4ed){var _0x51a69f=function(_0x4ddbf9){while(--_0x4ddbf9){_0x464c66['push'](_0x464c66['shift']());}};_0x51a69f(++_0x50c4ed);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b613e,_0x22efee){var _0x166d9d=function(_0x1b2dbb){while(--_0x1b2dbb){_0x5b613e['push'](_0x5b613e['shift']());}};_0x166d9d(++_0x22efee);}(_0xe706,0xa3));var _0x6e70=function(_0xbd4254,_0x31c08b){_0xbd4254=_0xbd4254-0x0;var _0x46c0f3=_0xe706[_0xbd4254];return _0x46c0f3;};'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 13bdf27..7c3c334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x343e=['sequelize','INTEGER'];(function(_0x429d68,_0x1aa5a2){var _0x172ef0=function(_0x3b7d7d){while(--_0x3b7d7d){_0x429d68['push'](_0x429d68['shift']());}};_0x172ef0(++_0x1aa5a2);}(_0x343e,0x9a));var _0xe343=function(_0x5bab5f,_0x1538c7){_0x5bab5f=_0x5bab5f-0x0;var _0x3be0cc=_0x343e[_0x5bab5f];return _0x3be0cc;};'use strict';var Sequelize=require(_0xe343('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe343('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe84a=['INTEGER','sequelize','exports'];(function(_0x13c208,_0x364230){var _0x14137e=function(_0x115400){while(--_0x115400){_0x13c208['push'](_0x13c208['shift']());}};_0x14137e(++_0x364230);}(_0xe84a,0x97));var _0xae84=function(_0x10b7e4,_0x584183){_0x10b7e4=_0x10b7e4-0x0;var _0x54e873=_0xe84a[_0x10b7e4];return _0x54e873;};'use strict';var Sequelize=require(_0xae84('0x0'));module[_0xae84('0x1')]={'penalty':{'type':Sequelize[_0xae84('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 0c00d90..02e5903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd05b=['request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0xd05b,0xcb));var _0xbd05=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd05b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbd05('0x0'));var util=require(_0xbd05('0x1'));var logger=require(_0xbd05('0x2'))('api');var moment=require(_0xbd05('0x3'));var BPromise=require(_0xbd05('0x4'));var rp=require(_0xbd05('0x5'));var fs=require('fs');var path=require(_0xbd05('0x6'));var rimraf=require(_0xbd05('0x7'));var config=require(_0xbd05('0x8'));var attributes=require(_0xbd05('0x9'));module['exports']=function(_0x510a86,_0x307b5c){return _0x510a86[_0xbd05('0xa')](_0xbd05('0xb'),attributes,{'tableName':_0xbd05('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c9f=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x16629d,_0x492375){var _0x56ccee=function(_0xa982b7){while(--_0xa982b7){_0x16629d['push'](_0x16629d['shift']());}};_0x56ccee(++_0x492375);}(_0x7c9f,0x9e));var _0xf7c9=function(_0x390039,_0x4415c6){_0x390039=_0x390039-0x0;var _0x2e7850=_0x7c9f[_0x390039];return _0x2e7850;};'use strict';var _=require(_0xf7c9('0x0'));var util=require(_0xf7c9('0x1'));var logger=require(_0xf7c9('0x2'))(_0xf7c9('0x3'));var moment=require(_0xf7c9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7c9('0x5'));var fs=require('fs');var path=require(_0xf7c9('0x6'));var rimraf=require(_0xf7c9('0x7'));var config=require(_0xf7c9('0x8'));var attributes=require(_0xf7c9('0x9'));module[_0xf7c9('0xa')]=function(_0xadd214,_0x4f82b5){return _0xadd214[_0xf7c9('0xb')](_0xf7c9('0xc'),attributes,{'tableName':_0xf7c9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 85e4a33..a545bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcd2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x52ddf2,_0x2ff25f){var _0x2dce61=function(_0x2d1831){while(--_0x2d1831){_0x52ddf2['push'](_0x52ddf2['shift']());}};_0x2dce61(++_0x2ff25f);}(_0xbcd2,0x19f));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2bcd('0x0'));var moment=require(_0x2bcd('0x1'));var BPromise=require(_0x2bcd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2bcd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bcd('0x4'))(_0x2bcd('0x5'));var config=require(_0x2bcd('0x6'));var jayson=require(_0x2bcd('0x7'));var client=jayson[_0x2bcd('0x8')][_0x2bcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x273adc,_0x5881df,_0x51f0df){return new BPromise(function(_0x544117,_0x1884ba){return client[_0x2bcd('0xa')](_0x273adc,_0x51f0df)[_0x2bcd('0xb')](function(_0x2e08e8){logger[_0x2bcd('0xc')](_0x2bcd('0xd'),_0x5881df,_0x2bcd('0xe'));logger[_0x2bcd('0xf')](_0x2bcd('0x10'),_0x5881df,_0x2bcd('0xe'),JSON['stringify'](_0x2e08e8));if(_0x2e08e8[_0x2bcd('0x11')]){if(_0x2e08e8[_0x2bcd('0x11')][_0x2bcd('0x12')]===0x1f4){logger[_0x2bcd('0x11')](_0x2bcd('0xd'),_0x5881df,_0x2e08e8['error'][_0x2bcd('0x13')]);return _0x1884ba(_0x2e08e8[_0x2bcd('0x11')][_0x2bcd('0x13')]);}logger[_0x2bcd('0x11')](_0x2bcd('0xd'),_0x5881df,_0x2e08e8[_0x2bcd('0x11')][_0x2bcd('0x13')]);return _0x544117(_0x2e08e8[_0x2bcd('0x11')][_0x2bcd('0x13')]);}else{logger[_0x2bcd('0xc')](_0x2bcd('0xd'),_0x5881df,_0x2bcd('0xe'));_0x544117(_0x2e08e8[_0x2bcd('0x14')]['message']);}})['catch'](function(_0x3c68fe){logger[_0x2bcd('0x11')](_0x2bcd('0xd'),_0x5881df,_0x3c68fe);_0x1884ba(_0x3c68fe);});});}
\ No newline at end of file
+var _0x472b=['../../config/utils','../../config/logger','rpc','../../config/environment','client','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x472b,0xe9));var _0xb472=function(_0x14a509,_0x5e9857){_0x14a509=_0x14a509-0x0;var _0x227776=_0x472b[_0x14a509];return _0x227776;};'use strict';var _=require(_0xb472('0x0'));var util=require(_0xb472('0x1'));var moment=require(_0xb472('0x2'));var BPromise=require(_0xb472('0x3'));var rs=require(_0xb472('0x4'));var fs=require('fs');var Redis=require(_0xb472('0x5'));var db=require(_0xb472('0x6'))['db'];var utils=require(_0xb472('0x7'));var logger=require(_0xb472('0x8'))(_0xb472('0x9'));var config=require(_0xb472('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb472('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f4e1d,_0x904f9e,_0xdb0c06){return new BPromise(function(_0x374613,_0x2606dd){return client['request'](_0x4f4e1d,_0xdb0c06)[_0xb472('0xc')](function(_0xf6747f){logger['info'](_0xb472('0xd'),_0x904f9e,_0xb472('0xe'));logger[_0xb472('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x904f9e,_0xb472('0xe'),JSON['stringify'](_0xf6747f));if(_0xf6747f[_0xb472('0x10')]){if(_0xf6747f['error'][_0xb472('0x11')]===0x1f4){logger[_0xb472('0x10')](_0xb472('0xd'),_0x904f9e,_0xf6747f[_0xb472('0x10')][_0xb472('0x12')]);return _0x2606dd(_0xf6747f[_0xb472('0x10')][_0xb472('0x12')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x904f9e,_0xf6747f['error'][_0xb472('0x12')]);return _0x374613(_0xf6747f['error']['message']);}else{logger[_0xb472('0x13')](_0xb472('0xd'),_0x904f9e,_0xb472('0xe'));_0x374613(_0xf6747f['result']['message']);}})['catch'](function(_0x1b4cd0){logger['error'](_0xb472('0xd'),_0x904f9e,_0x1b4cd0);_0x2606dd(_0x1b4cd0);});});}
\ No newline at end of file
index 39fcc82..3d61b44 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(_0x418353,_0x2b7b3e){var _0x484564=function(_0x5ea683){while(--_0x5ea683){_0x418353['push'](_0x418353['shift']());}};_0x484564(++_0x2b7b3e);}(_0xe706,0xa3));var _0x6e70=function(_0x3a7650,_0x458946){_0x3a7650=_0x3a7650-0x0;var _0x136de7=_0xe706[_0x3a7650];return _0x136de7;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9388c8,_0x2cdf84){var _0x6f1d3a=function(_0x6a3073){while(--_0x6a3073){_0x9388c8['push'](_0x9388c8['shift']());}};_0x6f1d3a(++_0x2cdf84);}(_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'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index dbf44ed..8c623ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eca=['exports','STRING'];(function(_0x427a3d,_0x509fe1){var _0x2966e8=function(_0x48bef2){while(--_0x48bef2){_0x427a3d['push'](_0x427a3d['shift']());}};_0x2966e8(++_0x509fe1);}(_0x8eca,0x106));var _0xa8ec=function(_0x3afb25,_0x5be96c){_0x3afb25=_0x3afb25-0x0;var _0x108fa4=_0x8eca[_0x3afb25];return _0x108fa4;};'use strict';var Sequelize=require('sequelize');module[_0xa8ec('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa8ec('0x1')]}};
\ No newline at end of file
+var _0x1cd5=['STRING','sequelize','INTEGER'];(function(_0x3aa09a,_0x378b2f){var _0x30350c=function(_0xffe2ac){while(--_0xffe2ac){_0x3aa09a['push'](_0x3aa09a['shift']());}};_0x30350c(++_0x378b2f);}(_0x1cd5,0xa9));var _0x51cd=function(_0x426df1,_0xa8b2e3){_0x426df1=_0x426df1-0x0;var _0x5cc55c=_0x1cd5[_0x426df1];return _0x5cc55c;};'use strict';var Sequelize=require(_0x51cd('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x51cd('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x51cd('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x51cd('0x2')]}};
\ No newline at end of file
index 311cf3e..6ff9828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1695=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues'];(function(_0x22bf40,_0x4be85e){var _0x23138a=function(_0x145be9){while(--_0x145be9){_0x22bf40['push'](_0x22bf40['shift']());}};_0x23138a(++_0x4be85e);}(_0x1695,0xa9));var _0x5169=function(_0x1a58ac,_0x22d855){_0x1a58ac=_0x1a58ac-0x0;var _0x724afb=_0x1695[_0x1a58ac];return _0x724afb;};'use strict';var _=require('lodash');var util=require(_0x5169('0x0'));var logger=require(_0x5169('0x1'))('api');var moment=require(_0x5169('0x2'));var BPromise=require(_0x5169('0x3'));var rp=require(_0x5169('0x4'));var fs=require('fs');var path=require(_0x5169('0x5'));var rimraf=require(_0x5169('0x6'));var config=require(_0x5169('0x7'));var attributes=require(_0x5169('0x8'));module[_0x5169('0x9')]=function(_0xeaf552,_0x396e49){return _0xeaf552[_0x5169('0xa')](_0x5169('0xb'),attributes,{'tableName':_0x5169('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x185d=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash'];(function(_0x1df2da,_0x1d0401){var _0x4ad330=function(_0x2d4f15){while(--_0x2d4f15){_0x1df2da['push'](_0x1df2da['shift']());}};_0x4ad330(++_0x1d0401);}(_0x185d,0x197));var _0xd185=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x185d[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0xd185('0x0'));var util=require(_0xd185('0x1'));var logger=require(_0xd185('0x2'))('api');var moment=require(_0xd185('0x3'));var BPromise=require(_0xd185('0x4'));var rp=require(_0xd185('0x5'));var fs=require('fs');var path=require(_0xd185('0x6'));var rimraf=require('rimraf');var config=require(_0xd185('0x7'));var attributes=require(_0xd185('0x8'));module[_0xd185('0x9')]=function(_0x5bad7c,_0x1456a8){return _0x5bad7c[_0xd185('0xa')]('UserFaxQueue',attributes,{'tableName':_0xd185('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35b59d5..d00ebd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c79=['http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','UserFaxQueue,\x20%s,\x20%s','message','result','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x1c79,0xd1));var _0x91c7=function(_0x302bc2,_0x309757){_0x302bc2=_0x302bc2-0x0;var _0x2818d2=_0x1c79[_0x302bc2];return _0x2818d2;};'use strict';var _=require(_0x91c7('0x0'));var util=require(_0x91c7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91c7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x91c7('0x3'));var logger=require(_0x91c7('0x4'))(_0x91c7('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x91c7('0x6')][_0x91c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x432c07,_0x15cefd,_0x4b773a){return new BPromise(function(_0x422be5,_0xd8e99e){return client[_0x91c7('0x8')](_0x432c07,_0x4b773a)[_0x91c7('0x9')](function(_0x5c94f8){logger[_0x91c7('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x15cefd,_0x91c7('0xb'));logger[_0x91c7('0xc')](_0x91c7('0xd'),_0x15cefd,'request\x20sent',JSON['stringify'](_0x5c94f8));if(_0x5c94f8[_0x91c7('0xe')]){if(_0x5c94f8[_0x91c7('0xe')]['code']===0x1f4){logger[_0x91c7('0xe')](_0x91c7('0xf'),_0x15cefd,_0x5c94f8[_0x91c7('0xe')][_0x91c7('0x10')]);return _0xd8e99e(_0x5c94f8[_0x91c7('0xe')][_0x91c7('0x10')]);}logger[_0x91c7('0xe')](_0x91c7('0xf'),_0x15cefd,_0x5c94f8[_0x91c7('0xe')][_0x91c7('0x10')]);return _0x422be5(_0x5c94f8[_0x91c7('0xe')][_0x91c7('0x10')]);}else{logger[_0x91c7('0xa')](_0x91c7('0xf'),_0x15cefd,_0x91c7('0xb'));_0x422be5(_0x5c94f8[_0x91c7('0x11')][_0x91c7('0x10')]);}})['catch'](function(_0x52b024){logger[_0x91c7('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x15cefd,_0x52b024);_0xd8e99e(_0x52b024);});});}
\ No newline at end of file
+var _0x39c4=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e202e,_0x20da26){var _0x337771=function(_0x22d462){while(--_0x22d462){_0x2e202e['push'](_0x2e202e['shift']());}};_0x337771(++_0x20da26);}(_0x39c4,0xbe));var _0x439c=function(_0xfed662,_0x212740){_0xfed662=_0xfed662-0x0;var _0x2ea545=_0x39c4[_0xfed662];return _0x2ea545;};'use strict';var _=require(_0x439c('0x0'));var util=require(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require(_0x439c('0x3'));var rs=require(_0x439c('0x4'));var fs=require('fs');var Redis=require(_0x439c('0x5'));var db=require(_0x439c('0x6'))['db'];var utils=require(_0x439c('0x7'));var logger=require(_0x439c('0x8'))(_0x439c('0x9'));var config=require(_0x439c('0xa'));var jayson=require(_0x439c('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56d5c9,_0x43cae5,_0x43d9a0){return new BPromise(function(_0x3a309d,_0x3271cc){return client[_0x439c('0xc')](_0x56d5c9,_0x43d9a0)[_0x439c('0xd')](function(_0x345487){logger['info'](_0x439c('0xe'),_0x43cae5,_0x439c('0xf'));logger[_0x439c('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x43cae5,_0x439c('0xf'),JSON[_0x439c('0x11')](_0x345487));if(_0x345487['error']){if(_0x345487[_0x439c('0x12')][_0x439c('0x13')]===0x1f4){logger[_0x439c('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x43cae5,_0x345487['error']['message']);return _0x3271cc(_0x345487['error'][_0x439c('0x14')]);}logger[_0x439c('0x12')](_0x439c('0xe'),_0x43cae5,_0x345487[_0x439c('0x12')][_0x439c('0x14')]);return _0x3a309d(_0x345487['error'][_0x439c('0x14')]);}else{logger['info'](_0x439c('0xe'),_0x43cae5,_0x439c('0xf'));_0x3a309d(_0x345487[_0x439c('0x15')][_0x439c('0x14')]);}})[_0x439c('0x16')](function(_0x19e6c0){logger[_0x439c('0x12')](_0x439c('0xe'),_0x43cae5,_0x19e6c0);_0x3271cc(_0x19e6c0);});});}
\ No newline at end of file
index 63eb1f3..283f39e 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(_0x27c8c7,_0x3f85ae){var _0x27351b=function(_0x541338){while(--_0x541338){_0x27c8c7['push'](_0x27c8c7['shift']());}};_0x27351b(++_0x3f85ae);}(_0xe706,0xa3));var _0x6e70=function(_0x28019c,_0x67743){_0x28019c=_0x28019c-0x0;var _0x48ca39=_0xe706[_0x28019c];return _0x48ca39;};'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(_0x2f8725,_0x199104){var _0x1800af=function(_0x28f28b){while(--_0x28f28b){_0x2f8725['push'](_0x2f8725['shift']());}};_0x1800af(++_0x199104);}(_0xedd9,0xfc));var _0x9edd=function(_0x2422ab,_0x10726d){_0x2422ab=_0x2422ab-0x0;var _0x346d71=_0xedd9[_0x2422ab];return _0x346d71;};'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 43e21ac..50b10b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ee=['exports','INTEGER'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x42ee,0x19a));var _0xe42e=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x42ee[_0x46efd7];return _0x5637e4;};'use strict';var Sequelize=require('sequelize');module[_0xe42e('0x0')]={'penalty':{'type':Sequelize[_0xe42e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xfcf0=['sequelize','exports','INTEGER'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xfcf0,0xe4));var _0x0fcf=function(_0x34933a,_0x327378){_0x34933a=_0x34933a-0x0;var _0x36abb4=_0xfcf0[_0x34933a];return _0x36abb4;};'use strict';var Sequelize=require(_0x0fcf('0x0'));module[_0x0fcf('0x1')]={'penalty':{'type':Sequelize[_0x0fcf('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a6370c9..c45ecee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb036=['UserMailQueue','util','api','bluebird','rimraf','./userMailQueue.attributes','exports','define'];(function(_0x5f02ba,_0x5c4427){var _0x45b6d9=function(_0x5b35b8){while(--_0x5b35b8){_0x5f02ba['push'](_0x5f02ba['shift']());}};_0x45b6d9(++_0x5c4427);}(_0xb036,0x161));var _0x6b03=function(_0x35089b,_0x178bda){_0x35089b=_0x35089b-0x0;var _0x1b388b=_0xb036[_0x35089b];return _0x1b388b;};'use strict';var _=require('lodash');var util=require(_0x6b03('0x0'));var logger=require('../../config/logger')(_0x6b03('0x1'));var moment=require('moment');var BPromise=require(_0x6b03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6b03('0x3'));var config=require('../../config/environment');var attributes=require(_0x6b03('0x4'));module[_0x6b03('0x5')]=function(_0x4f3e53,_0x404a92){return _0x4f3e53[_0x6b03('0x6')](_0x6b03('0x7'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6fa3=['moment','path','../../config/environment','exports','UserMailQueue','lodash'];(function(_0x3ddde9,_0x1a6a2b){var _0xdfb693=function(_0x1c1c20){while(--_0x1c1c20){_0x3ddde9['push'](_0x3ddde9['shift']());}};_0xdfb693(++_0x1a6a2b);}(_0x6fa3,0x197));var _0x36fa=function(_0xfff265,_0x41f693){_0xfff265=_0xfff265-0x0;var _0x55442d=_0x6fa3[_0xfff265];return _0x55442d;};'use strict';var _=require(_0x36fa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x36fa('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36fa('0x2'));var rimraf=require('rimraf');var config=require(_0x36fa('0x3'));var attributes=require('./userMailQueue.attributes');module[_0x36fa('0x4')]=function(_0x12c737,_0x464dab){return _0x12c737['define'](_0x36fa('0x5'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ea6cbc..0a0452a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x53f12e,_0x2bafb5){var _0x11b40f=function(_0x58276f){while(--_0x58276f){_0x53f12e['push'](_0x53f12e['shift']());}};_0x11b40f(++_0x2bafb5);}(_0x55ca,0x126));var _0xa55c=function(_0xdf5fc5,_0x37255b){_0xdf5fc5=_0xdf5fc5-0x0;var _0x52f5a5=_0x55ca[_0xdf5fc5];return _0x52f5a5;};'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
+var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x9ab669,_0x47e7d3){var _0x44f075=function(_0x3c753a){while(--_0x3c753a){_0x9ab669['push'](_0x9ab669['shift']());}};_0x44f075(++_0x47e7d3);}(_0x6aa7,0x178));var _0x76aa=function(_0x535702,_0x4b8b7c){_0x535702=_0x535702-0x0;var _0x59d2f0=_0x6aa7[_0x535702];return _0x59d2f0;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}
\ No newline at end of file
index 3163fa8..74263e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x378a=['fs-extra','../../components/auth/service','./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','Router'];(function(_0x3136ef,_0x35ee49){var _0x14a69e=function(_0x465867){while(--_0x465867){_0x3136ef['push'](_0x3136ef['shift']());}};_0x14a69e(++_0x35ee49);}(_0x378a,0x69));var _0xa378=function(_0x13351c,_0x571a1d){_0x13351c=_0x13351c-0x0;var _0x224d08=_0x378a[_0x13351c];return _0x224d08;};'use strict';var multer=require(_0xa378('0x0'));var util=require(_0xa378('0x1'));var path=require(_0xa378('0x2'));var timeout=require(_0xa378('0x3'));var express=require('express');var router=express[_0xa378('0x4')]();var fs_extra=require(_0xa378('0x5'));var auth=require(_0xa378('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa378('0x7'));router['post']('/',auth[_0xa378('0x8')](),controller[_0xa378('0x9')]);module[_0xa378('0xa')]=router;
\ No newline at end of file
+var _0xd5f5=['../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3c7a97,_0x280f06){var _0x737bcc=function(_0x1c06e4){while(--_0x1c06e4){_0x3c7a97['push'](_0x3c7a97['shift']());}};_0x737bcc(++_0x280f06);}(_0xd5f5,0x7c));var _0x5d5f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd5f5[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x5d5f('0x0'));var util=require(_0x5d5f('0x1'));var path=require('path');var timeout=require(_0x5d5f('0x2'));var express=require(_0x5d5f('0x3'));var router=express[_0x5d5f('0x4')]();var fs_extra=require(_0x5d5f('0x5'));var auth=require(_0x5d5f('0x6'));var interaction=require(_0x5d5f('0x7'));var config=require(_0x5d5f('0x8'));var controller=require('./userNotification.controller');router[_0x5d5f('0x9')]('/',auth[_0x5d5f('0xa')](),controller[_0x5d5f('0xb')]);module[_0x5d5f('0xc')]=router;
\ No newline at end of file
index 3d8a6fd..762457e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d96=['exports','TEXT','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d96,0x1bf));var _0x68d9=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0x8d96[_0x574617];return _0x29de90;};'use strict';var Sequelize=require(_0x68d9('0x0'));module[_0x68d9('0x1')]={'body':{'type':Sequelize[_0x68d9('0x2')]},'senderName':{'type':Sequelize[_0x68d9('0x3')]},'recipientsId':{'type':Sequelize[_0x68d9('0x2')]},'recipientsDescription':{'type':Sequelize[_0x68d9('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
+var _0x484c=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x484c,0x1e2));var _0xc484=function(_0x13d44c,_0x5cb531){_0x13d44c=_0x13d44c-0x0;var _0x4a710a=_0x484c[_0x13d44c];return _0x4a710a;};'use strict';var Sequelize=require(_0xc484('0x0'));module[_0xc484('0x1')]={'body':{'type':Sequelize[_0xc484('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xc484('0x3')]},'beep':{'type':Sequelize[_0xc484('0x4')]}};
\ No newline at end of file
index 4d63543..5407c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5634=['../../config/license/util','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','chatqueue','smsqueue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','replace','queue','Queue','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x24325b,_0x28fe0f){var _0x1cf842=function(_0x1a8743){while(--_0x1a8743){_0x24325b['push'](_0x24325b['shift']());}};_0x1cf842(++_0x28fe0f);}(_0x5634,0x183));var _0x4563=function(_0x52e2f9,_0x5f4f9c){_0x52e2f9=_0x52e2f9-0x0;var _0x2ce1b8=_0x5634[_0x52e2f9];return _0x2ce1b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4563('0x0'));var zipdir=require(_0x4563('0x1'));var jsonpatch=require(_0x4563('0x2'));var rp=require(_0x4563('0x3'));var moment=require(_0x4563('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4563('0x5'));var util=require('util');var path=require(_0x4563('0x6'));var sox=require(_0x4563('0x7'));var csv=require(_0x4563('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4563('0x9'));var squel=require(_0x4563('0xa'));var crypto=require('crypto');var jsforce=require(_0x4563('0xb'));var deskjs=require(_0x4563('0xc'));var toCsv=require(_0x4563('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4563('0xd'));var authService=require(_0x4563('0xe'));var qs=require(_0x4563('0xf'));var as=require(_0x4563('0x10'));var hardwareService=require(_0x4563('0x11'));var logger=require(_0x4563('0x12'))(_0x4563('0x13'));var utils=require(_0x4563('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4563('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4563('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4563('0x17'))(new Redis(config['redis']));require(_0x4563('0x18'))[_0x4563('0x19')](socket);function respondWithStatusCode(_0x4c3f21,_0x5edcc9){_0x5edcc9=_0x5edcc9||0xcc;return function(_0x1530b6){if(_0x1530b6){return _0x4c3f21[_0x4563('0x1a')](_0x5edcc9);}return _0x4c3f21[_0x4563('0x1b')](_0x5edcc9)[_0x4563('0x1c')]();};}function respondWithResult(_0x4b5d53,_0x46c15e){_0x46c15e=_0x46c15e||0xc8;return function(_0xa1702c){if(_0xa1702c){return _0x4b5d53[_0x4563('0x1b')](_0x46c15e)[_0x4563('0x1d')](_0xa1702c);}};}function respondWithFilteredResult(_0x257993,_0x2160f3){return function(_0x544602){if(_0x544602){var _0x24083f=typeof _0x2160f3[_0x4563('0x1e')]==='undefined'&&typeof _0x2160f3[_0x4563('0x1f')]===_0x4563('0x20');var _0x53642e=_0x544602[_0x4563('0x21')];var _0x8470fd=_0x24083f?0x0:_0x2160f3[_0x4563('0x1e')];var _0x747df6=_0x24083f?_0x544602[_0x4563('0x21')]:_0x2160f3[_0x4563('0x1e')]+_0x2160f3[_0x4563('0x1f')];var _0x4b126f;if(_0x747df6>=_0x53642e){_0x747df6=_0x53642e;_0x4b126f=0xc8;}else{_0x4b126f=0xce;}_0x257993['status'](_0x4b126f);return _0x257993[_0x4563('0x22')](_0x4563('0x23'),_0x8470fd+'-'+_0x747df6+'/'+_0x53642e)[_0x4563('0x1d')](_0x544602);}return null;};}function patchUpdates(_0x2237ac){return function(_0x3fe154){try{jsonpatch[_0x4563('0x24')](_0x3fe154,_0x2237ac,!![]);}catch(_0x414f08){return BPromise[_0x4563('0x25')](_0x414f08);}return _0x3fe154[_0x4563('0x26')]();};}function saveUpdates(_0x181f1e,_0x4bc2dc){return function(_0x1386e2){if(_0x1386e2){return _0x1386e2[_0x4563('0x27')](_0x181f1e)[_0x4563('0x28')](function(_0x4609a3){return _0x4609a3;});}return null;};}function removeEntity(_0x365116,_0x130470){return function(_0x414549){if(_0x414549){return _0x414549[_0x4563('0x29')]()[_0x4563('0x28')](function(){_0x365116[_0x4563('0x1b')](0xcc)[_0x4563('0x1c')]();});}};}function handleEntityNotFound(_0x1e77f4,_0x37d68c){return function(_0x208b8b){if(!_0x208b8b){_0x1e77f4['sendStatus'](0x194);}return _0x208b8b;};}function handleError(_0x1bf42d,_0x1712bd){_0x1712bd=_0x1712bd||0x1f4;return function(_0x22f09d){logger[_0x4563('0x2a')](_0x22f09d[_0x4563('0x2b')]);if(_0x22f09d[_0x4563('0x2c')]){delete _0x22f09d[_0x4563('0x2c')];}_0x1bf42d[_0x4563('0x1b')](_0x1712bd)[_0x4563('0x2d')](_0x22f09d);};}exports[_0x4563('0x2e')]=function(_0x442c76,_0x5d7568,_0x478a12){if(!_0x442c76[_0x4563('0x2f')]['hasOwnProperty'](_0x4563('0x30'))&&!_0x442c76['body'][_0x4563('0x31')](_0x4563('0x32'))){throw new db[(_0x4563('0x33'))][(_0x4563('0x34'))](_0x4563('0x35'));}else{if(_0x442c76[_0x4563('0x2f')][_0x4563('0x31')](_0x4563('0x32'))&&!_0x442c76[_0x4563('0x2f')]['hasOwnProperty'](_0x4563('0x36'))){throw new db[(_0x4563('0x33'))]['ValidationError'](_0x4563('0x37'));}if(!_0x442c76[_0x4563('0x2f')][_0x4563('0x31')](_0x4563('0x38'))){throw new db[(_0x4563('0x33'))][(_0x4563('0x34'))](_0x4563('0x39'));}else{try{var _0xd0cad7=JSON['parse'](_0x442c76[_0x4563('0x2f')][_0x4563('0x38')]);}catch(_0x4c2240){logger['error'](_0x4c2240);throw new db[(_0x4563('0x33'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x28d529=[_0x4563('0x3a'),'faxqueue','mailqueue','openchannelqueue',_0x4563('0x3b'),'voicequeue',_0x4563('0x3c'),_0x4563('0x3d'),'user'];if(_[_0x4563('0x3e')](_0xd0cad7,function(_0x559ebf){return!_[_0x4563('0x3f')](_0x28d529,_0x559ebf[_0x4563('0x40')][_0x4563('0x41')]());})){throw new db[(_0x4563('0x33'))][(_0x4563('0x34'))](_0x4563('0x42'));}}}var _0x309da9={};_0x309da9[_0x4563('0x43')]=_0x442c76[_0x4563('0x2f')][_0x4563('0x31')](_0x4563('0x43'))?_0x442c76[_0x4563('0x2f')]['senderName']:_0x442c76[_0x4563('0x44')][_0x4563('0x45')];_0x309da9[_0x4563('0x46')]=_[_0x4563('0x47')](_0x442c76[_0x4563('0x2f')]['recipientsDescription'])?null:_0x442c76[_0x4563('0x2f')][_0x4563('0x46')];_0x309da9[_0x4563('0x48')]=_0x442c76['body']['beep']||![];_0x309da9[_0x4563('0x49')]=_0x442c76['user']['id'];return getContent(_0x442c76[_0x4563('0x2f')])[_0x4563('0x28')](function(_0x2f7bf5){_0x309da9['body']=_0x2f7bf5;return getRecipients(_0xd0cad7);})[_0x4563('0x28')](function(_0x17fed6){_0x309da9[_0x4563('0x4a')]=_[_0x4563('0x4b')](_0x17fed6)[_0x4563('0x4c')](',');return db['sequelize'][_0x4563('0x4d')](function(_0x561abc){return db[_0x4563('0x4e')][_0x4563('0x4f')](_0x309da9,{'raw':!![],'transaction':_0x561abc})[_0x4563('0x28')](function(_0xe8c5ff){var _0x4d9610={'sender':_0x309da9[_0x4563('0x43')],'description':_0x309da9[_0x4563('0x46')],'content':_0x309da9['body'],'beep':_0x309da9[_0x4563('0x48')]};_0x17fed6[_0x4563('0x50')](function(_0x8aab7d){_0x4d9610[_0x4563('0x51')]=_0x8aab7d;socket[_0x4563('0x52')](_0x4563('0x53'),_0x4d9610);});return _0xe8c5ff;});});})[_0x4563('0x28')](respondWithResult(_0x5d7568,0xc9))[_0x4563('0x54')](handleError(_0x5d7568,null));};function getContent(_0x2206ea){return new BPromise(function(_0x2d2066,_0x54afdc){if(_0x2206ea[_0x4563('0x30')]){_0x2d2066(_0x2206ea[_0x4563('0x30')]);return;}return db[_0x4563('0x55')][_0x4563('0x56')]({'attributes':[_0x4563('0x57')],'where':{'id':_0x2206ea[_0x4563('0x32')]},'raw':!![]})['then'](function(_0x2a8532){if(!_0x2a8532)throw new db[(_0x4563('0x33'))][(_0x4563('0x34'))](_0x4563('0x58'));var _0xac62d1=Mustache[_0x4563('0x59')](_0x2a8532[_0x4563('0x57')],_0x2206ea[_0x4563('0x36')]);_0x2d2066(_0xac62d1);})['catch'](function(_0x3b72e1){_0x54afdc(_0x3b72e1);});});}function getRecipients(_0x1ff621){return new BPromise(function(_0x576107,_0x175e3d){var _0x4e5324=[];var _0x4ee014=[];_0x1ff621['forEach'](function(_0x4f9afc){var _0x52691d=_[_0x4563('0x5a')](_0x4f9afc[_0x4563('0x40')][_0x4563('0x41')]());if(_0x52691d===_0x4563('0x5b')){_0x4e5324=_[_0x4563('0x5c')](_0x4e5324,_0x4f9afc[_0x4563('0x5d')]);}else{if(_[_0x4563('0x3f')](_0x52691d,'queue'))_0x52691d=_0x52691d[_0x4563('0x5e')](_0x4563('0x5f'),_0x4563('0x60'));_0x4f9afc[_0x4563('0x5d')][_0x4563('0x50')](function(_0x380d7e){_0x4ee014[_0x4563('0x61')](getAgents(_0x52691d,_0x380d7e));});}});return BPromise[_0x4563('0x62')](_0x4ee014)['then'](function(_0x2127da){_0x4e5324=_[_0x4563('0x5c')](_0x4e5324,_[_0x4563('0x63')](_0x2127da));_0x576107(_0x4e5324);})['catch'](function(_0x54319d){_0x175e3d(_0x54319d);});});}function getAgents(_0x157830,_0x233007){return new BPromise(function(_0x1572a3,_0x20ed7e){return db[_0x157830][_0x4563('0x56')]({'where':{'id':_0x233007}})[_0x4563('0x28')](function(_0x1befaa){return _0x1befaa[_0x4563('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8365a6){var _0x29cd57=_[_0x4563('0x65')](_0x8365a6,'id');_0x1572a3(_0x29cd57);});})[_0x4563('0x54')](function(_0x288fd3){_0x20ed7e(_0x288fd3);});});}
\ No newline at end of file
+var _0xadc9=['findOne','render','User','queue','replace','Queue','ids','forEach','push','all','union','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','UserNotification','create','recipient','emit','catch','text','Template'];(function(_0x3221cd,_0x4a4a4a){var _0x21a689=function(_0x375599){while(--_0x375599){_0x3221cd['push'](_0x3221cd['shift']());}};_0x21a689(++_0x4a4a4a);}(_0xadc9,0x72));var _0x9adc=function(_0x1c0a08,_0x3057a0){_0x1c0a08=_0x1c0a08-0x0;var _0x1e1882=_0xadc9[_0x1c0a08];return _0x1e1882;};'use strict';var emlformat=require(_0x9adc('0x0'));var rimraf=require(_0x9adc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9adc('0x2'));var rp=require(_0x9adc('0x3'));var moment=require(_0x9adc('0x4'));var BPromise=require(_0x9adc('0x5'));var Mustache=require(_0x9adc('0x6'));var util=require(_0x9adc('0x7'));var path=require(_0x9adc('0x8'));var sox=require(_0x9adc('0x9'));var csv=require(_0x9adc('0xa'));var ejs=require(_0x9adc('0xb'));var fs=require('fs');var fs_extra=require(_0x9adc('0xc'));var _=require(_0x9adc('0xd'));var squel=require(_0x9adc('0xe'));var crypto=require(_0x9adc('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9adc('0xa'));var querystring=require(_0x9adc('0x10'));var Papa=require(_0x9adc('0x11'));var Redis=require('ioredis');var authService=require(_0x9adc('0x12'));var qs=require(_0x9adc('0x13'));var as=require(_0x9adc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9adc('0x15'));var utils=require(_0x9adc('0x16'));var config=require(_0x9adc('0x17'));var licenseUtil=require(_0x9adc('0x18'));var db=require(_0x9adc('0x19'))['db'];config[_0x9adc('0x1a')]=_[_0x9adc('0x1b')](config[_0x9adc('0x1a')],{'host':_0x9adc('0x1c'),'port':0x18eb});var socket=require(_0x9adc('0x1d'))(new Redis(config[_0x9adc('0x1a')]));require(_0x9adc('0x1e'))['register'](socket);function respondWithStatusCode(_0x71cbf5,_0x2239fc){_0x2239fc=_0x2239fc||0xcc;return function(_0x30db1f){if(_0x30db1f){return _0x71cbf5[_0x9adc('0x1f')](_0x2239fc);}return _0x71cbf5[_0x9adc('0x20')](_0x2239fc)[_0x9adc('0x21')]();};}function respondWithResult(_0x20dfae,_0x3b188f){_0x3b188f=_0x3b188f||0xc8;return function(_0x252e0d){if(_0x252e0d){return _0x20dfae['status'](_0x3b188f)[_0x9adc('0x22')](_0x252e0d);}};}function respondWithFilteredResult(_0x1a62ca,_0x1edfb7){return function(_0x364e1e){if(_0x364e1e){var _0xdf9ca=typeof _0x1edfb7[_0x9adc('0x23')]===_0x9adc('0x24')&&typeof _0x1edfb7[_0x9adc('0x25')]===_0x9adc('0x24');var _0x6cbaf2=_0x364e1e[_0x9adc('0x26')];var _0x31564b=_0xdf9ca?0x0:_0x1edfb7[_0x9adc('0x23')];var _0x1be2f2=_0xdf9ca?_0x364e1e[_0x9adc('0x26')]:_0x1edfb7['offset']+_0x1edfb7[_0x9adc('0x25')];var _0x2b6af4;if(_0x1be2f2>=_0x6cbaf2){_0x1be2f2=_0x6cbaf2;_0x2b6af4=0xc8;}else{_0x2b6af4=0xce;}_0x1a62ca[_0x9adc('0x20')](_0x2b6af4);return _0x1a62ca['set']('Content-Range',_0x31564b+'-'+_0x1be2f2+'/'+_0x6cbaf2)['json'](_0x364e1e);}return null;};}function patchUpdates(_0x3fa61d){return function(_0x26c474){try{jsonpatch[_0x9adc('0x27')](_0x26c474,_0x3fa61d,!![]);}catch(_0x2a3468){return BPromise[_0x9adc('0x28')](_0x2a3468);}return _0x26c474[_0x9adc('0x29')]();};}function saveUpdates(_0x59b672,_0x2dfc68){return function(_0x23864a){if(_0x23864a){return _0x23864a[_0x9adc('0x2a')](_0x59b672)[_0x9adc('0x2b')](function(_0x164787){return _0x164787;});}return null;};}function removeEntity(_0x2f2d6a,_0x30bf2c){return function(_0x4703fb){if(_0x4703fb){return _0x4703fb[_0x9adc('0x2c')]()[_0x9adc('0x2b')](function(){_0x2f2d6a[_0x9adc('0x20')](0xcc)[_0x9adc('0x21')]();});}};}function handleEntityNotFound(_0x5d6eb2,_0x4921f5){return function(_0x210ca5){if(!_0x210ca5){_0x5d6eb2[_0x9adc('0x1f')](0x194);}return _0x210ca5;};}function handleError(_0x375ab3,_0x44b916){_0x44b916=_0x44b916||0x1f4;return function(_0x559a3c){logger[_0x9adc('0x2d')](_0x559a3c[_0x9adc('0x2e')]);if(_0x559a3c[_0x9adc('0x2f')]){delete _0x559a3c['name'];}_0x375ab3[_0x9adc('0x20')](_0x44b916)['send'](_0x559a3c);};}exports['sendUserNotification']=function(_0x368997,_0x1c14b2,_0x5570b2){if(!_0x368997[_0x9adc('0x30')]['hasOwnProperty']('text')&&!_0x368997['body'][_0x9adc('0x31')](_0x9adc('0x32'))){throw new db[(_0x9adc('0x33'))][(_0x9adc('0x34'))](_0x9adc('0x35'));}else{if(_0x368997[_0x9adc('0x30')][_0x9adc('0x31')](_0x9adc('0x32'))&&!_0x368997[_0x9adc('0x30')]['hasOwnProperty'](_0x9adc('0x36'))){throw new db['Sequelize'][(_0x9adc('0x34'))](_0x9adc('0x37'));}if(!_0x368997['body'][_0x9adc('0x31')](_0x9adc('0x38'))){throw new db[(_0x9adc('0x33'))]['ValidationError'](_0x9adc('0x39'));}else{try{var _0x4b4aba=JSON['parse'](_0x368997['body'][_0x9adc('0x38')]);}catch(_0x449ffc){logger[_0x9adc('0x2d')](_0x449ffc);throw new db[(_0x9adc('0x33'))][(_0x9adc('0x34'))](_0x9adc('0x3a'));}var _0x27ff15=[_0x9adc('0x3b'),'faxqueue',_0x9adc('0x3c'),'openchannelqueue',_0x9adc('0x3d'),_0x9adc('0x3e'),_0x9adc('0x3f'),'team',_0x9adc('0x40')];if(_[_0x9adc('0x41')](_0x4b4aba,function(_0xa1a8aa){return!_[_0x9adc('0x42')](_0x27ff15,_0xa1a8aa[_0x9adc('0x43')][_0x9adc('0x44')]());})){throw new db['Sequelize'][(_0x9adc('0x34'))](_0x9adc('0x45'));}}}var _0xc6c119={};_0xc6c119[_0x9adc('0x46')]=_0x368997[_0x9adc('0x30')][_0x9adc('0x31')]('senderName')?_0x368997[_0x9adc('0x30')][_0x9adc('0x46')]:_0x368997['user'][_0x9adc('0x47')];_0xc6c119['recipientsDescription']=_[_0x9adc('0x48')](_0x368997[_0x9adc('0x30')][_0x9adc('0x49')])?null:_0x368997[_0x9adc('0x30')][_0x9adc('0x49')];_0xc6c119[_0x9adc('0x4a')]=_0x368997[_0x9adc('0x30')][_0x9adc('0x4a')]||![];_0xc6c119[_0x9adc('0x4b')]=_0x368997['user']['id'];return getContent(_0x368997[_0x9adc('0x30')])[_0x9adc('0x2b')](function(_0x59346b){_0xc6c119[_0x9adc('0x30')]=_0x59346b;return getRecipients(_0x4b4aba);})[_0x9adc('0x2b')](function(_0x2631fa){_0xc6c119['recipientsId']=_[_0x9adc('0x4c')](_0x2631fa)[_0x9adc('0x4d')](',');return db[_0x9adc('0x4e')]['transaction'](function(_0x3bfdf8){return db[_0x9adc('0x4f')][_0x9adc('0x50')](_0xc6c119,{'raw':!![],'transaction':_0x3bfdf8})['then'](function(_0x17d97d){var _0x47da59={'sender':_0xc6c119['senderName'],'description':_0xc6c119[_0x9adc('0x49')],'content':_0xc6c119['body'],'beep':_0xc6c119[_0x9adc('0x4a')]};_0x2631fa['forEach'](function(_0x31e374){_0x47da59[_0x9adc('0x51')]=_0x31e374;socket[_0x9adc('0x52')]('userNotification:send',_0x47da59);});return _0x17d97d;});});})[_0x9adc('0x2b')](respondWithResult(_0x1c14b2,0xc9))[_0x9adc('0x53')](handleError(_0x1c14b2,null));};function getContent(_0x404749){return new BPromise(function(_0x475c8c,_0x2a57cb){if(_0x404749[_0x9adc('0x54')]){_0x475c8c(_0x404749['text']);return;}return db[_0x9adc('0x55')][_0x9adc('0x56')]({'attributes':['html'],'where':{'id':_0x404749[_0x9adc('0x32')]},'raw':!![]})[_0x9adc('0x2b')](function(_0x1f9448){if(!_0x1f9448)throw new db[(_0x9adc('0x33'))][(_0x9adc('0x34'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x5e257b=Mustache[_0x9adc('0x57')](_0x1f9448['html'],_0x404749[_0x9adc('0x36')]);_0x475c8c(_0x5e257b);})[_0x9adc('0x53')](function(_0x417830){_0x2a57cb(_0x417830);});});}function getRecipients(_0x2e81c9){return new BPromise(function(_0x108816,_0x420f08){var _0x11d3c9=[];var _0x4d7d55=[];_0x2e81c9['forEach'](function(_0x3103db){var _0x575046=_['startCase'](_0x3103db[_0x9adc('0x43')][_0x9adc('0x44')]());if(_0x575046===_0x9adc('0x58')){_0x11d3c9=_['union'](_0x11d3c9,_0x3103db['ids']);}else{if(_['includes'](_0x575046,_0x9adc('0x59')))_0x575046=_0x575046[_0x9adc('0x5a')](_0x9adc('0x59'),_0x9adc('0x5b'));_0x3103db[_0x9adc('0x5c')][_0x9adc('0x5d')](function(_0x10c099){_0x4d7d55[_0x9adc('0x5e')](getAgents(_0x575046,_0x10c099));});}});return BPromise[_0x9adc('0x5f')](_0x4d7d55)[_0x9adc('0x2b')](function(_0x22e7d4){_0x11d3c9=_[_0x9adc('0x60')](_0x11d3c9,_[_0x9adc('0x61')](_0x22e7d4));_0x108816(_0x11d3c9);})[_0x9adc('0x53')](function(_0x59f9e5){_0x420f08(_0x59f9e5);});});}function getAgents(_0x49ba79,_0x734565){return new BPromise(function(_0x5459b0,_0x489524){return db[_0x49ba79][_0x9adc('0x56')]({'where':{'id':_0x734565}})[_0x9adc('0x2b')](function(_0x5a2b97){return _0x5a2b97[_0x9adc('0x62')]({'attributes':['id'],'raw':!![]})[_0x9adc('0x2b')](function(_0x54f238){var _0x1918b9=_[_0x9adc('0x63')](_0x54f238,'id');_0x5459b0(_0x1918b9);});})['catch'](function(_0x18ace3){_0x489524(_0x18ace3);});});}
\ No newline at end of file
index b2981d6..f6658b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9cc=['../../mysqldb','UserNotification','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x38a462,_0x2effa7){var _0x339661=function(_0x486b20){while(--_0x486b20){_0x38a462['push'](_0x38a462['shift']());}};_0x339661(++_0x2effa7);}(_0xf9cc,0xee));var _0xcf9c=function(_0x385ed5,_0x449f76){_0x385ed5=_0x385ed5-0x0;var _0x27f199=_0xf9cc[_0x385ed5];return _0x27f199;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xcf9c('0x0'))['db'][_0xcf9c('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xcf9c('0x2')](0x0);var events={'afterCreate':_0xcf9c('0x3'),'afterUpdate':'update','afterDestroy':_0xcf9c('0x4')};function emitEvent(_0x440c77){return function(_0x421265,_0x2e1b0b,_0x1d7885){UserNotificationEvents[_0xcf9c('0x5')](_0x440c77+':'+_0x421265['id'],_0x421265);UserNotificationEvents[_0xcf9c('0x5')](_0x440c77,_0x421265);_0x1d7885(null);};}for(var e in events){if(events[_0xcf9c('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0x6b2c=['events','../../mysqldb','UserNotification','setMaxListeners','remove','emit','hook','exports'];(function(_0x5707d2,_0x280c70){var _0x4e358d=function(_0x4a741e){while(--_0x4a741e){_0x5707d2['push'](_0x5707d2['shift']());}};_0x4e358d(++_0x280c70);}(_0x6b2c,0x180));var _0xc6b2=function(_0x487057,_0x14304c){_0x487057=_0x487057-0x0;var _0x104558=_0x6b2c[_0x487057];return _0x104558;};'use strict';var EventEmitter=require(_0xc6b2('0x0'));var UserNotification=require(_0xc6b2('0x1'))['db'][_0xc6b2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc6b2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc6b2('0x4')};function emitEvent(_0x5749f5){return function(_0x10f75f,_0x46c798,_0x5693f3){UserNotificationEvents[_0xc6b2('0x5')](_0x5749f5+':'+_0x10f75f['id'],_0x10f75f);UserNotificationEvents['emit'](_0x5749f5,_0x10f75f);_0x5693f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xc6b2('0x6')](e,emitEvent(event));}}module[_0xc6b2('0x7')]=UserNotificationEvents;
\ No newline at end of file
index 7b92bda..31e9b03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbe5=['UserNotification','userNotifications','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./userNotification.attributes','exports'];(function(_0x40fbc0,_0x217504){var _0x3f7012=function(_0x652edd){while(--_0x652edd){_0x40fbc0['push'](_0x40fbc0['shift']());}};_0x3f7012(++_0x217504);}(_0xfbe5,0xd3));var _0x5fbe=function(_0xa42c21,_0x1b973f){_0xa42c21=_0xa42c21-0x0;var _0x2fd817=_0xfbe5[_0xa42c21];return _0x2fd817;};'use strict';var _=require(_0x5fbe('0x0'));var util=require(_0x5fbe('0x1'));var logger=require(_0x5fbe('0x2'))('api');var moment=require(_0x5fbe('0x3'));var BPromise=require(_0x5fbe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5fbe('0x5'));var config=require(_0x5fbe('0x6'));var attributes=require(_0x5fbe('0x7'));module[_0x5fbe('0x8')]=function(_0x49b6e3,_0x4e67a2){return _0x49b6e3['define'](_0x5fbe('0x9'),attributes,{'tableName':_0x5fbe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x52e8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util'];(function(_0x2a6ab4,_0x361cb5){var _0x41ebd9=function(_0x5af136){while(--_0x5af136){_0x2a6ab4['push'](_0x2a6ab4['shift']());}};_0x41ebd9(++_0x361cb5);}(_0x52e8,0x16a));var _0x852e=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x52e8[_0x29a29f];return _0x443ea3;};'use strict';var _=require(_0x852e('0x0'));var util=require(_0x852e('0x1'));var logger=require(_0x852e('0x2'))('api');var moment=require(_0x852e('0x3'));var BPromise=require('bluebird');var rp=require(_0x852e('0x4'));var fs=require('fs');var path=require(_0x852e('0x5'));var rimraf=require(_0x852e('0x6'));var config=require(_0x852e('0x7'));var attributes=require(_0x852e('0x8'));module[_0x852e('0x9')]=function(_0x422593,_0x253b45){return _0x422593['define'](_0x852e('0xa'),attributes,{'tableName':_0x852e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x852e('0xc')});};
\ No newline at end of file
index 6b7fa2f..1a9b696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe08c=['debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','then','info','request\x20sent'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe08c,0x78));var _0xce08=function(_0x3ef629,_0x1fcd65){_0x3ef629=_0x3ef629-0x0;var _0x21d0ed=_0xe08c[_0x3ef629];return _0x21d0ed;};'use strict';var _=require('lodash');var util=require(_0xce08('0x0'));var moment=require(_0xce08('0x1'));var BPromise=require(_0xce08('0x2'));var rs=require(_0xce08('0x3'));var fs=require('fs');var Redis=require(_0xce08('0x4'));var db=require(_0xce08('0x5'))['db'];var utils=require(_0xce08('0x6'));var logger=require(_0xce08('0x7'))(_0xce08('0x8'));var config=require('../../config/environment');var jayson=require(_0xce08('0x9'));var client=jayson[_0xce08('0xa')][_0xce08('0xb')]({'port':0x232a});config[_0xce08('0xc')]=_[_0xce08('0xd')](config[_0xce08('0xc')],{'host':_0xce08('0xe'),'port':0x18eb});var socket=require(_0xce08('0xf'))(new Redis(config[_0xce08('0xc')]));require(_0xce08('0x10'))['register'](socket);function respondWithRpcPromise(_0x573bf0,_0x403819,_0x4b01ec){return new BPromise(function(_0x486b82,_0x2fd88a){return client['request'](_0x573bf0,_0x4b01ec)[_0xce08('0x11')](function(_0x1a30dd){logger[_0xce08('0x12')]('UserNotification,\x20%s,\x20%s',_0x403819,_0xce08('0x13'));logger[_0xce08('0x14')](_0xce08('0x15'),_0x403819,_0xce08('0x13'),JSON[_0xce08('0x16')](_0x1a30dd));if(_0x1a30dd['error']){if(_0x1a30dd[_0xce08('0x17')][_0xce08('0x18')]===0x1f4){logger[_0xce08('0x17')](_0xce08('0x19'),_0x403819,_0x1a30dd[_0xce08('0x17')][_0xce08('0x1a')]);return _0x2fd88a(_0x1a30dd[_0xce08('0x17')]['message']);}logger[_0xce08('0x17')](_0xce08('0x19'),_0x403819,_0x1a30dd[_0xce08('0x17')][_0xce08('0x1a')]);return _0x486b82(_0x1a30dd['error'][_0xce08('0x1a')]);}else{logger[_0xce08('0x12')]('UserNotification,\x20%s,\x20%s',_0x403819,_0xce08('0x13'));_0x486b82(_0x1a30dd[_0xce08('0x1b')][_0xce08('0x1a')]);}})['catch'](function(_0x4637b){logger[_0xce08('0x17')](_0xce08('0x19'),_0x403819,_0x4637b);_0x2fd88a(_0x4637b);});});}
\ No newline at end of file
+var _0x0f17=['jayson/promise','client','http','redis','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5959eb,_0x5865b7){var _0x365e19=function(_0x358e95){while(--_0x358e95){_0x5959eb['push'](_0x5959eb['shift']());}};_0x365e19(++_0x5865b7);}(_0x0f17,0x1b3));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var moment=require(_0x70f1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70f1('0x3'))['db'];var utils=require(_0x70f1('0x4'));var logger=require(_0x70f1('0x5'))(_0x70f1('0x6'));var config=require('../../config/environment');var jayson=require(_0x70f1('0x7'));var client=jayson[_0x70f1('0x8')][_0x70f1('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x70f1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x70f1('0xb'))(new Redis(config['redis']));require(_0x70f1('0xc'))[_0x70f1('0xd')](socket);function respondWithRpcPromise(_0x5c8b78,_0x56aa2c,_0x1e8661){return new BPromise(function(_0xb5368,_0x5854ac){return client[_0x70f1('0xe')](_0x5c8b78,_0x1e8661)[_0x70f1('0xf')](function(_0x1c6dc2){logger[_0x70f1('0x10')](_0x70f1('0x11'),_0x56aa2c,_0x70f1('0x12'));logger[_0x70f1('0x13')](_0x70f1('0x14'),_0x56aa2c,_0x70f1('0x12'),JSON[_0x70f1('0x15')](_0x1c6dc2));if(_0x1c6dc2['error']){if(_0x1c6dc2[_0x70f1('0x16')]['code']===0x1f4){logger['error'](_0x70f1('0x11'),_0x56aa2c,_0x1c6dc2[_0x70f1('0x16')]['message']);return _0x5854ac(_0x1c6dc2['error'][_0x70f1('0x17')]);}logger[_0x70f1('0x16')]('UserNotification,\x20%s,\x20%s',_0x56aa2c,_0x1c6dc2[_0x70f1('0x16')][_0x70f1('0x17')]);return _0xb5368(_0x1c6dc2[_0x70f1('0x16')][_0x70f1('0x17')]);}else{logger[_0x70f1('0x10')](_0x70f1('0x11'),_0x56aa2c,'request\x20sent');_0xb5368(_0x1c6dc2[_0x70f1('0x18')][_0x70f1('0x17')]);}})[_0x70f1('0x19')](function(_0x3c8499){logger[_0x70f1('0x16')](_0x70f1('0x11'),_0x56aa2c,_0x3c8499);_0x5854ac(_0x3c8499);});});}
\ No newline at end of file
index a44e727..3aa656f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b83=['register','length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x5b83,0x150));var _0x35b8=function(_0x5ab2af,_0xfa980a){_0x5ab2af=_0x5ab2af-0x0;var _0x1807f1=_0x5b83[_0x5ab2af];return _0x1807f1;};'use strict';var UserNotificationEvents=require(_0x35b8('0x0'));var events=[_0x35b8('0x1'),_0x35b8('0x2'),_0x35b8('0x3')];function createListener(_0x525842,_0x34aaa0){return function(_0x3369f8){_0x34aaa0[_0x35b8('0x4')](_0x525842,_0x3369f8);};}function removeListener(_0x40891e,_0x2ccb02){return function(){UserNotificationEvents[_0x35b8('0x5')](_0x40891e,_0x2ccb02);};}exports[_0x35b8('0x6')]=function(_0x5c295c){for(var _0x29a9a5=0x0,_0x59cc4e=events[_0x35b8('0x7')];_0x29a9a5<_0x59cc4e;_0x29a9a5++){var _0x2363b2=events[_0x29a9a5];var _0x583b1d=createListener(_0x35b8('0x8')+_0x2363b2,_0x5c295c);UserNotificationEvents['on'](_0x2363b2,_0x583b1d);}};
\ No newline at end of file
+var _0xdbf1=['removeListener','save','remove','update','emit'];(function(_0x35938e,_0xb6b9de){var _0x39f8c7=function(_0x1ed918){while(--_0x1ed918){_0x35938e['push'](_0x35938e['shift']());}};_0x39f8c7(++_0xb6b9de);}(_0xdbf1,0xa1));var _0x1dbf=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xdbf1[_0x432fca];return _0x3adba4;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x1dbf('0x0'),_0x1dbf('0x1'),_0x1dbf('0x2')];function createListener(_0x42454d,_0x9cb563){return function(_0x2315ef){_0x9cb563[_0x1dbf('0x3')](_0x42454d,_0x2315ef);};}function removeListener(_0x3d09d1,_0x17e45a){return function(){UserNotificationEvents[_0x1dbf('0x4')](_0x3d09d1,_0x17e45a);};}exports['register']=function(_0x153dbb){for(var _0x33ba3b=0x0,_0x5c0430=events['length'];_0x33ba3b<_0x5c0430;_0x33ba3b++){var _0x44980e=events[_0x33ba3b];var _0x5c5292=createListener('userNotification:'+_0x44980e,_0x153dbb);UserNotificationEvents['on'](_0x44980e,_0x5c5292);}};
\ No newline at end of file
index 57de53f..92b544b 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(_0x14d233,_0x4289f7){var _0x2d4c76=function(_0x29ef14){while(--_0x29ef14){_0x14d233['push'](_0x14d233['shift']());}};_0x2d4c76(++_0x4289f7);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5c4924,_0x1b50d0){var _0x4ad0ad=function(_0x5372d0){while(--_0x5372d0){_0x5c4924['push'](_0x5c4924['shift']());}};_0x4ad0ad(++_0x1b50d0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcb91[_0x5d2803];return _0xdcad2c;};'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 b63973d..e951feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x490c=['sequelize','INTEGER'];(function(_0x509b8f,_0x514ade){var _0x230014=function(_0xa261f6){while(--_0xa261f6){_0x509b8f['push'](_0x509b8f['shift']());}};_0x230014(++_0x514ade);}(_0x490c,0x186));var _0xc490=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x490c[_0x382c73];return _0x1dd0bf;};'use strict';var Sequelize=require(_0xc490('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc490('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x799b=['exports','INTEGER','sequelize'];(function(_0x3521a4,_0x130479){var _0x544301=function(_0x7c8606){while(--_0x7c8606){_0x3521a4['push'](_0x3521a4['shift']());}};_0x544301(++_0x130479);}(_0x799b,0xcb));var _0xb799=function(_0xbaf00f,_0x29358c){_0xbaf00f=_0xbaf00f-0x0;var _0x3b4415=_0x799b[_0xbaf00f];return _0x3b4415;};'use strict';var Sequelize=require(_0xb799('0x0'));module[_0xb799('0x1')]={'penalty':{'type':Sequelize[_0xb799('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index ac974a0..3248463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5487=['request-promise','path','../../config/environment','./userOpenchannelQueue.attributes','define','user_has_openchannel_queues','api','moment','bluebird'];(function(_0x43823e,_0x4eb079){var _0x2d350b=function(_0x5e20da){while(--_0x5e20da){_0x43823e['push'](_0x43823e['shift']());}};_0x2d350b(++_0x4eb079);}(_0x5487,0x69));var _0x7548=function(_0x4005fa,_0x3e1b03){_0x4005fa=_0x4005fa-0x0;var _0x48672d=_0x5487[_0x4005fa];return _0x48672d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7548('0x0'));var moment=require(_0x7548('0x1'));var BPromise=require(_0x7548('0x2'));var rp=require(_0x7548('0x3'));var fs=require('fs');var path=require(_0x7548('0x4'));var rimraf=require('rimraf');var config=require(_0x7548('0x5'));var attributes=require(_0x7548('0x6'));module['exports']=function(_0x2a9ecc,_0x282439){return _0x2a9ecc[_0x7548('0x7')]('UserOpenchannelQueue',attributes,{'tableName':_0x7548('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1637=['exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x1afb84,_0x50a83b){var _0x32bfe8=function(_0x138afe){while(--_0x138afe){_0x1afb84['push'](_0x1afb84['shift']());}};_0x32bfe8(++_0x50a83b);}(_0x1637,0x1dc));var _0x7163=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x1637[_0x1e3671];return _0x48d5f5;};'use strict';var _=require(_0x7163('0x0'));var util=require('util');var logger=require(_0x7163('0x1'))('api');var moment=require(_0x7163('0x2'));var BPromise=require(_0x7163('0x3'));var rp=require(_0x7163('0x4'));var fs=require('fs');var path=require(_0x7163('0x5'));var rimraf=require('rimraf');var config=require(_0x7163('0x6'));var attributes=require(_0x7163('0x7'));module[_0x7163('0x8')]=function(_0x5922d3,_0x43bb74){return _0x5922d3['define'](_0x7163('0x9'),attributes,{'tableName':_0x7163('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e52c3f..a8663c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a28=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3a28,0x15f));var _0x83a2=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3a28[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x83a2('0x0'));var util=require(_0x83a2('0x1'));var moment=require(_0x83a2('0x2'));var BPromise=require('bluebird');var rs=require(_0x83a2('0x3'));var fs=require('fs');var Redis=require(_0x83a2('0x4'));var db=require(_0x83a2('0x5'))['db'];var utils=require(_0x83a2('0x6'));var logger=require(_0x83a2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x83a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf38c,_0xffcee9,_0x222511){return new BPromise(function(_0x13afb6,_0x1ad994){return client[_0x83a2('0x9')](_0x1bf38c,_0x222511)[_0x83a2('0xa')](function(_0xee06f5){logger[_0x83a2('0xb')](_0x83a2('0xc'),_0xffcee9,_0x83a2('0xd'));logger[_0x83a2('0xe')](_0x83a2('0xf'),_0xffcee9,_0x83a2('0xd'),JSON['stringify'](_0xee06f5));if(_0xee06f5[_0x83a2('0x10')]){if(_0xee06f5[_0x83a2('0x10')][_0x83a2('0x11')]===0x1f4){logger[_0x83a2('0x10')](_0x83a2('0xc'),_0xffcee9,_0xee06f5[_0x83a2('0x10')]['message']);return _0x1ad994(_0xee06f5['error']['message']);}logger[_0x83a2('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xffcee9,_0xee06f5[_0x83a2('0x10')][_0x83a2('0x12')]);return _0x13afb6(_0xee06f5[_0x83a2('0x10')][_0x83a2('0x12')]);}else{logger[_0x83a2('0xb')](_0x83a2('0xc'),_0xffcee9,_0x83a2('0xd'));_0x13afb6(_0xee06f5['result']['message']);}})['catch'](function(_0x5ca550){logger[_0x83a2('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xffcee9,_0x5ca550);_0x1ad994(_0x5ca550);});});}
\ No newline at end of file
+var _0x57e9=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x57e9,0xb8));var _0x957e=function(_0x429031,_0x21b146){_0x429031=_0x429031-0x0;var _0x2c8da5=_0x57e9[_0x429031];return _0x2c8da5;};'use strict';var _=require(_0x957e('0x0'));var util=require(_0x957e('0x1'));var moment=require('moment');var BPromise=require(_0x957e('0x2'));var rs=require(_0x957e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x957e('0x4'))['db'];var utils=require(_0x957e('0x5'));var logger=require(_0x957e('0x6'))(_0x957e('0x7'));var config=require('../../config/environment');var jayson=require(_0x957e('0x8'));var client=jayson[_0x957e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x88db2c,_0x14dfd6,_0x8071fe){return new BPromise(function(_0x594ee4,_0x30e79a){return client[_0x957e('0xa')](_0x88db2c,_0x8071fe)[_0x957e('0xb')](function(_0x428f43){logger[_0x957e('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14dfd6,_0x957e('0xd'));logger[_0x957e('0xe')](_0x957e('0xf'),_0x14dfd6,_0x957e('0xd'),JSON[_0x957e('0x10')](_0x428f43));if(_0x428f43['error']){if(_0x428f43[_0x957e('0x11')][_0x957e('0x12')]===0x1f4){logger['error'](_0x957e('0x13'),_0x14dfd6,_0x428f43[_0x957e('0x11')][_0x957e('0x14')]);return _0x30e79a(_0x428f43[_0x957e('0x11')][_0x957e('0x14')]);}logger[_0x957e('0x11')](_0x957e('0x13'),_0x14dfd6,_0x428f43[_0x957e('0x11')]['message']);return _0x594ee4(_0x428f43[_0x957e('0x11')][_0x957e('0x14')]);}else{logger[_0x957e('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14dfd6,_0x957e('0xd'));_0x594ee4(_0x428f43[_0x957e('0x15')]['message']);}})[_0x957e('0x16')](function(_0x165a7a){logger[_0x957e('0x11')](_0x957e('0x13'),_0x14dfd6,_0x165a7a);_0x30e79a(_0x165a7a);});});}
\ No newline at end of file
index 075b50e..a95fd8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ef0=['/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','destroy','removeSections','delete','removeResources','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3ef0,0xf0));var _0x03ef=function(_0x515750,_0x450cb1){_0x515750=_0x515750-0x0;var _0x578fa8=_0x3ef0[_0x515750];return _0x578fa8;};'use strict';var multer=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var path=require(_0x03ef('0x2'));var timeout=require(_0x03ef('0x3'));var express=require('express');var router=express[_0x03ef('0x4')]();var fs_extra=require(_0x03ef('0x5'));var auth=require(_0x03ef('0x6'));var interaction=require(_0x03ef('0x7'));var config=require(_0x03ef('0x8'));var controller=require('./userProfile.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x03ef('0x9')]);router[_0x03ef('0xa')](_0x03ef('0xb'),auth[_0x03ef('0xc')](),controller[_0x03ef('0xd')]);router[_0x03ef('0xa')](_0x03ef('0xe'),auth[_0x03ef('0xc')](),controller[_0x03ef('0xf')]);router[_0x03ef('0xa')](_0x03ef('0x10'),auth[_0x03ef('0xc')](),controller[_0x03ef('0x11')]);router[_0x03ef('0xa')](_0x03ef('0x12'),auth[_0x03ef('0xc')](),controller[_0x03ef('0x13')]);router[_0x03ef('0x14')]('/',auth['isAuthenticated'](),controller[_0x03ef('0x15')]);router[_0x03ef('0x14')](_0x03ef('0x16'),auth[_0x03ef('0xc')](),controller[_0x03ef('0x17')]);router[_0x03ef('0x14')]('/:id/sections',auth[_0x03ef('0xc')](),controller[_0x03ef('0x18')]);router[_0x03ef('0x14')]('/:id/resources',auth[_0x03ef('0xc')](),controller[_0x03ef('0x19')]);router[_0x03ef('0x1a')](_0x03ef('0xe'),auth[_0x03ef('0xc')](),controller[_0x03ef('0x1b')]);router['delete'](_0x03ef('0xe'),auth['isAuthenticated'](),controller[_0x03ef('0x1c')]);router['delete'](_0x03ef('0x10'),auth[_0x03ef('0xc')](),controller[_0x03ef('0x1d')]);router[_0x03ef('0x1e')](_0x03ef('0x12'),auth[_0x03ef('0xc')](),controller[_0x03ef('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x1dbc=['post','create','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','getResources'];(function(_0x5714b2,_0x3939ec){var _0x4f2b65=function(_0x348d67){while(--_0x348d67){_0x5714b2['push'](_0x5714b2['shift']());}};_0x4f2b65(++_0x3939ec);}(_0x1dbc,0x1ab));var _0xc1db=function(_0x3ad2e5,_0x94d414){_0x3ad2e5=_0x3ad2e5-0x0;var _0xc4e565=_0x1dbc[_0x3ad2e5];return _0xc4e565;};'use strict';var multer=require(_0xc1db('0x0'));var util=require(_0xc1db('0x1'));var path=require(_0xc1db('0x2'));var timeout=require(_0xc1db('0x3'));var express=require(_0xc1db('0x4'));var router=express[_0xc1db('0x5')]();var fs_extra=require(_0xc1db('0x6'));var auth=require(_0xc1db('0x7'));var interaction=require(_0xc1db('0x8'));var config=require(_0xc1db('0x9'));var controller=require(_0xc1db('0xa'));router[_0xc1db('0xb')]('/',auth[_0xc1db('0xc')](),controller[_0xc1db('0xd')]);router['get'](_0xc1db('0xe'),auth[_0xc1db('0xc')](),controller[_0xc1db('0xf')]);router[_0xc1db('0xb')](_0xc1db('0x10'),auth[_0xc1db('0xc')](),controller['show']);router[_0xc1db('0xb')](_0xc1db('0x11'),auth['isAuthenticated'](),controller[_0xc1db('0x12')]);router[_0xc1db('0xb')](_0xc1db('0x13'),auth[_0xc1db('0xc')](),controller[_0xc1db('0x14')]);router[_0xc1db('0x15')]('/',auth['isAuthenticated'](),controller[_0xc1db('0x16')]);router[_0xc1db('0x15')]('/:id/clone',auth[_0xc1db('0xc')](),controller['clone']);router[_0xc1db('0x15')](_0xc1db('0x11'),auth[_0xc1db('0xc')](),controller[_0xc1db('0x17')]);router[_0xc1db('0x15')]('/:id/resources',auth[_0xc1db('0xc')](),controller[_0xc1db('0x18')]);router[_0xc1db('0x19')](_0xc1db('0x10'),auth['isAuthenticated'](),controller[_0xc1db('0x1a')]);router[_0xc1db('0x1b')](_0xc1db('0x10'),auth[_0xc1db('0xc')](),controller[_0xc1db('0x1c')]);router[_0xc1db('0x1b')]('/:id/sections',auth[_0xc1db('0xc')](),controller[_0xc1db('0x1d')]);router[_0xc1db('0x1b')]('/:id/resources',auth['isAuthenticated'](),controller[_0xc1db('0x1e')]);module[_0xc1db('0x1f')]=router;
\ No newline at end of file
index 67b7dda..c63286c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bd2=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x43330e,_0x3ddaae){var _0x9fedf4=function(_0x3b0708){while(--_0x3b0708){_0x43330e['push'](_0x43330e['shift']());}};_0x9fedf4(++_0x3ddaae);}(_0x7bd2,0x1ce));var _0x27bd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7bd2[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x27bd('0x0'));module[_0x27bd('0x1')]={'name':{'type':Sequelize[_0x27bd('0x2')],'allowNull':![],'unique':_0x27bd('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x12d557){this[_0x27bd('0x4')](_0x27bd('0x5'),_0x12d557?_0x12d557[_0x27bd('0x6')](''):[]);},'get':function(){return this[_0x27bd('0x7')](_0x27bd('0x5'))?this[_0x27bd('0x7')](_0x27bd('0x5'))[_0x27bd('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x27bd('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x27bd('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x27bd('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x27bd('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1a16=['split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions','join','getDataValue'];(function(_0x46914a,_0x16fe5f){var _0x520c41=function(_0x3c6142){while(--_0x3c6142){_0x46914a['push'](_0x46914a['shift']());}};_0x520c41(++_0x16fe5f);}(_0x1a16,0x1bb));var _0x61a1=function(_0x4179fc,_0x26e737){_0x4179fc=_0x4179fc-0x0;var _0x39959b=_0x1a16[_0x4179fc];return _0x39959b;};'use strict';var Sequelize=require(_0x61a1('0x0'));module[_0x61a1('0x1')]={'name':{'type':Sequelize[_0x61a1('0x2')],'allowNull':![],'unique':_0x61a1('0x3')},'crudPermissions':{'type':Sequelize[_0x61a1('0x2')],'set':function(_0x314929){this['setDataValue'](_0x61a1('0x4'),_0x314929?_0x314929[_0x61a1('0x5')](''):[]);},'get':function(){return this[_0x61a1('0x6')](_0x61a1('0x4'))?this[_0x61a1('0x6')](_0x61a1('0x4'))[_0x61a1('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x61a1('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x61a1('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index 4dfb259..d95d18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f3=['SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','value','resourceId','toLowerCase','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','lists','CmList','companies','CmCompany','CmCustomField','ChatQueue','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','contexts','voicemails','voicerecordings','membername','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','Team','voicequeues','queuecampaigns','users','telephones','Users','role','admin','user','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','templates','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','AnalyticMetric','whatsappaccounts','screenrecordings','ScreenRecording','UserId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','UserProfile','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','clone','get','omit','createdAt','crudPermissions','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','transaction','push','removeSections','enabled','includes','subsections','Dashboard','forEach','Plugin','addResources','ids','Sequelize','mergeResources','ValidationError','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','union','ignore','childModel','field','AnalyticExtractedReport','associatedResources','foreignKey','reportType','default','reportId','DefaultReports','custom','CustomReports','Tag','Tags','color','tag','ThroughTags','Agents','openTabs','true','chat','dataValues','sms','fax','whatsapp','charAt','toUpperCase','slice','QueryTypes'];(function(_0xa5fdcf,_0x409e2e){var _0x942891=function(_0x1961e9){while(--_0x1961e9){_0xa5fdcf['push'](_0xa5fdcf['shift']());}};_0x942891(++_0x409e2e);}(_0xe9f3,0x164));var _0x3e9f=function(_0x3ed2c2,_0x3bfb5b){_0x3ed2c2=_0x3ed2c2-0x0;var _0x3efecf=_0xe9f3[_0x3ed2c2];return _0x3efecf;};'use strict';var emlformat=require(_0x3e9f('0x0'));var rimraf=require(_0x3e9f('0x1'));var zipdir=require(_0x3e9f('0x2'));var jsonpatch=require(_0x3e9f('0x3'));var rp=require(_0x3e9f('0x4'));var moment=require(_0x3e9f('0x5'));var BPromise=require(_0x3e9f('0x6'));var Mustache=require(_0x3e9f('0x7'));var util=require('util');var path=require(_0x3e9f('0x8'));var sox=require('sox');var csv=require(_0x3e9f('0x9'));var ejs=require(_0x3e9f('0xa'));var fs=require('fs');var fs_extra=require(_0x3e9f('0xb'));var _=require(_0x3e9f('0xc'));var squel=require(_0x3e9f('0xd'));var crypto=require(_0x3e9f('0xe'));var jsforce=require(_0x3e9f('0xf'));var deskjs=require(_0x3e9f('0x10'));var toCsv=require(_0x3e9f('0x9'));var querystring=require(_0x3e9f('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3e9f('0x12'));var qs=require(_0x3e9f('0x13'));var as=require(_0x3e9f('0x14'));var hardwareService=require(_0x3e9f('0x15'));var logger=require(_0x3e9f('0x16'))(_0x3e9f('0x17'));var utils=require('../../config/utils');var config=require(_0x3e9f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e9f('0x19'))['db'];config[_0x3e9f('0x1a')]=_[_0x3e9f('0x1b')](config[_0x3e9f('0x1a')],{'host':_0x3e9f('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e9f('0x1a')]));require('./userProfile.socket')[_0x3e9f('0x1d')](socket);function respondWithStatusCode(_0x55fae1,_0x4d3312){_0x4d3312=_0x4d3312||0xcc;return function(_0x1e84ed){if(_0x1e84ed){return _0x55fae1[_0x3e9f('0x1e')](_0x4d3312);}return _0x55fae1[_0x3e9f('0x1f')](_0x4d3312)[_0x3e9f('0x20')]();};}function respondWithResult(_0x244ee4,_0xb32d35){_0xb32d35=_0xb32d35||0xc8;return function(_0x1589a2){if(_0x1589a2){return _0x244ee4[_0x3e9f('0x1f')](_0xb32d35)[_0x3e9f('0x21')](_0x1589a2);}};}function respondWithFilteredResult(_0x22bc22,_0x1652a5){return function(_0x2dcaaf){if(_0x2dcaaf){var _0x7409f4=typeof _0x1652a5[_0x3e9f('0x22')]===_0x3e9f('0x23')&&typeof _0x1652a5[_0x3e9f('0x24')]===_0x3e9f('0x23');var _0x373fbc=_0x2dcaaf[_0x3e9f('0x25')];var _0x3e746a=_0x7409f4?0x0:_0x1652a5[_0x3e9f('0x22')];var _0x223806=_0x7409f4?_0x2dcaaf[_0x3e9f('0x25')]:_0x1652a5[_0x3e9f('0x22')]+_0x1652a5[_0x3e9f('0x24')];var _0x412549;if(_0x223806>=_0x373fbc){_0x223806=_0x373fbc;_0x412549=0xc8;}else{_0x412549=0xce;}_0x22bc22[_0x3e9f('0x1f')](_0x412549);return _0x22bc22[_0x3e9f('0x26')](_0x3e9f('0x27'),_0x3e746a+'-'+_0x223806+'/'+_0x373fbc)[_0x3e9f('0x21')](_0x2dcaaf);}return null;};}function patchUpdates(_0x5c40e8){return function(_0x32de64){try{jsonpatch[_0x3e9f('0x28')](_0x32de64,_0x5c40e8,!![]);}catch(_0x4c2966){return BPromise['reject'](_0x4c2966);}return _0x32de64[_0x3e9f('0x29')]();};}function saveUpdates(_0x9eff43,_0x337aba){return function(_0x37ca24){if(_0x37ca24){return _0x37ca24[_0x3e9f('0x2a')](_0x9eff43)[_0x3e9f('0x2b')](function(_0xe072b5){return _0xe072b5;});}return null;};}function removeEntity(_0x33f184,_0x309d2f){return function(_0x50246c){if(_0x50246c){return _0x50246c[_0x3e9f('0x2c')]()[_0x3e9f('0x2b')](function(){_0x33f184[_0x3e9f('0x1f')](0xcc)[_0x3e9f('0x20')]();});}};}function handleEntityNotFound(_0x1b31a1,_0x1236e4){return function(_0x1ed95c){if(!_0x1ed95c){_0x1b31a1[_0x3e9f('0x1e')](0x194);}return _0x1ed95c;};}function handleError(_0x1d2a86,_0x5797b4){_0x5797b4=_0x5797b4||0x1f4;return function(_0x2e8035){logger['error'](_0x2e8035[_0x3e9f('0x2d')]);if(_0x2e8035[_0x3e9f('0x2e')]){delete _0x2e8035[_0x3e9f('0x2e')];}_0x1d2a86[_0x3e9f('0x1f')](_0x5797b4)[_0x3e9f('0x2f')](_0x2e8035);};}exports[_0x3e9f('0x30')]=function(_0x191bae,_0x17e637){var _0x4d81df={},_0x2ed634={},_0x1b5a4a={'count':0x0,'rows':[]};var _0x523aea=_[_0x3e9f('0x31')](db[_0x3e9f('0x32')][_0x3e9f('0x33')],function(_0x53a73b){return{'name':_0x53a73b['fieldName'],'type':_0x53a73b['type'][_0x3e9f('0x34')]};});_0x2ed634[_0x3e9f('0x35')]=_[_0x3e9f('0x31')](_0x523aea,_0x3e9f('0x2e'));_0x2ed634[_0x3e9f('0x36')]=_[_0x3e9f('0x37')](_0x191bae['query']);_0x2ed634[_0x3e9f('0x38')]=_['intersection'](_0x2ed634[_0x3e9f('0x35')],_0x2ed634[_0x3e9f('0x36')]);_0x4d81df[_0x3e9f('0x39')]=_[_0x3e9f('0x3a')](_0x2ed634[_0x3e9f('0x35')],qs['fields'](_0x191bae['query'][_0x3e9f('0x3b')]));_0x4d81df[_0x3e9f('0x39')]=_0x4d81df[_0x3e9f('0x39')]['length']?_0x4d81df[_0x3e9f('0x39')]:_0x2ed634[_0x3e9f('0x35')];if(!_0x191bae[_0x3e9f('0x36')][_0x3e9f('0x3c')](_0x3e9f('0x3d'))){_0x4d81df['limit']=qs[_0x3e9f('0x24')](_0x191bae[_0x3e9f('0x36')][_0x3e9f('0x24')]);_0x4d81df['offset']=qs['offset'](_0x191bae[_0x3e9f('0x36')][_0x3e9f('0x22')]);}_0x4d81df[_0x3e9f('0x3e')]=qs[_0x3e9f('0x3f')](_0x191bae['query'][_0x3e9f('0x3f')]);_0x4d81df[_0x3e9f('0x40')]=qs[_0x3e9f('0x38')](_[_0x3e9f('0x41')](_0x191bae[_0x3e9f('0x36')],_0x2ed634[_0x3e9f('0x38')]),_0x523aea);if(_0x191bae[_0x3e9f('0x36')][_0x3e9f('0x42')]){_0x4d81df[_0x3e9f('0x40')]=_[_0x3e9f('0x43')](_0x4d81df['where'],{'$or':_[_0x3e9f('0x31')](_0x523aea,function(_0x5049b8){if(_0x5049b8[_0x3e9f('0x44')]!==_0x3e9f('0x45')){var _0x20ff7d={};_0x20ff7d[_0x5049b8[_0x3e9f('0x2e')]]={'$like':'%'+_0x191bae[_0x3e9f('0x36')][_0x3e9f('0x42')]+'%'};return _0x20ff7d;}})});}_0x4d81df=_['merge']({},_0x4d81df,_0x191bae[_0x3e9f('0x46')]);var _0x30db25={'where':_0x4d81df[_0x3e9f('0x40')]};return db[_0x3e9f('0x32')][_0x3e9f('0x25')](_0x30db25)[_0x3e9f('0x2b')](function(_0x5b7087){_0x1b5a4a[_0x3e9f('0x25')]=_0x5b7087;if(_0x191bae['query'][_0x3e9f('0x47')]){_0x4d81df[_0x3e9f('0x48')]=[{'all':!![]}];}return db['UserProfile'][_0x3e9f('0x49')](_0x4d81df);})[_0x3e9f('0x2b')](function(_0x3f07f6){_0x1b5a4a[_0x3e9f('0x4a')]=_0x3f07f6;return _0x1b5a4a;})['then'](respondWithFilteredResult(_0x17e637,_0x4d81df))[_0x3e9f('0x4b')](handleError(_0x17e637,null));};exports['show']=function(_0x37748f,_0x2a93ca){var _0x146758={'raw':![],'where':{'id':_0x37748f[_0x3e9f('0x4c')]['id']}},_0x3e6dcb={};_0x3e6dcb[_0x3e9f('0x35')]=_[_0x3e9f('0x37')](db[_0x3e9f('0x32')][_0x3e9f('0x33')]);_0x3e6dcb[_0x3e9f('0x36')]=_[_0x3e9f('0x37')](_0x37748f[_0x3e9f('0x36')]);_0x3e6dcb[_0x3e9f('0x38')]=_[_0x3e9f('0x3a')](_0x3e6dcb[_0x3e9f('0x35')],_0x3e6dcb[_0x3e9f('0x36')]);_0x146758[_0x3e9f('0x39')]=_['intersection'](_0x3e6dcb[_0x3e9f('0x35')],qs[_0x3e9f('0x3b')](_0x37748f[_0x3e9f('0x36')][_0x3e9f('0x3b')]));_0x146758[_0x3e9f('0x39')]=_0x146758['attributes'][_0x3e9f('0x4d')]?_0x146758[_0x3e9f('0x39')]:_0x3e6dcb[_0x3e9f('0x35')];if(_0x37748f[_0x3e9f('0x36')][_0x3e9f('0x47')]){_0x146758[_0x3e9f('0x48')]=[{'all':!![]}];}_0x146758=_[_0x3e9f('0x43')]({},_0x146758,_0x37748f[_0x3e9f('0x46')]);return db[_0x3e9f('0x32')][_0x3e9f('0x4e')](_0x146758)[_0x3e9f('0x2b')](handleEntityNotFound(_0x2a93ca,null))[_0x3e9f('0x2b')](respondWithResult(_0x2a93ca,null))['catch'](handleError(_0x2a93ca,null));};exports[_0x3e9f('0x4f')]=function(_0x5176ec,_0x2e22b8){return db[_0x3e9f('0x32')][_0x3e9f('0x4f')](_0x5176ec[_0x3e9f('0x50')],{})[_0x3e9f('0x2b')](respondWithResult(_0x2e22b8,0xc9))[_0x3e9f('0x4b')](handleError(_0x2e22b8,null));};exports[_0x3e9f('0x51')]=function(_0x6b4e0,_0x55b4b9){var _0x2609a3={'where':{'id':_0x6b4e0[_0x3e9f('0x4c')]['id']}},_0x4e5495={};_0x4e5495['model']=_[_0x3e9f('0x37')](db['UserProfile'][_0x3e9f('0x33')]);_0x2609a3[_0x3e9f('0x39')]=_[_0x3e9f('0x3a')](_0x4e5495[_0x3e9f('0x35')],qs[_0x3e9f('0x3b')](_0x6b4e0[_0x3e9f('0x36')][_0x3e9f('0x3b')]));_0x2609a3['attributes']=_0x2609a3[_0x3e9f('0x39')][_0x3e9f('0x4d')]?_0x2609a3[_0x3e9f('0x39')]:_0x4e5495['model'];if(_0x6b4e0['query'][_0x3e9f('0x47')]){_0x2609a3['include']=[{'all':!![]}];}_0x2609a3=_[_0x3e9f('0x43')]({},_0x2609a3,_0x6b4e0[_0x3e9f('0x46')]);return db[_0x3e9f('0x32')][_0x3e9f('0x4e')](_0x2609a3)[_0x3e9f('0x2b')](handleEntityNotFound(_0x55b4b9,null))[_0x3e9f('0x2b')](function(_0x2a7ac1){if(_0x2a7ac1){var _0x582156=_0x2a7ac1[_0x3e9f('0x52')]({'plain':!![]});_0x582156=qs[_0x3e9f('0x53')](_0x582156,['id',_0x3e9f('0x54'),'updatedAt',_0x3e9f('0x55')]);_0x6b4e0[_0x3e9f('0x50')]=_['omit'](_0x6b4e0[_0x3e9f('0x50')],['id',_0x3e9f('0x54'),_0x3e9f('0x56')]);return db[_0x3e9f('0x57')]['transaction'](function(_0x2a7a03){return db[_0x3e9f('0x32')][_0x3e9f('0x4f')](_['merge'](_0x582156,_0x6b4e0['body']),{'include':_0x6b4e0[_0x3e9f('0x36')][_0x3e9f('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x2a7a03})[_0x3e9f('0x2b')](function(_0x1a9dd5){var _0x18a140=_0x1a9dd5[_0x3e9f('0x52')]({'plain':!![]});return db[_0x3e9f('0x58')][_0x3e9f('0x49')]({'where':{'userProfileId':_0x6b4e0['params']['id']},'raw':!![]})[_0x3e9f('0x2b')](function(_0x35d1e1){if(_0x35d1e1){return BPromise[_0x3e9f('0x59')](_0x35d1e1,function(_0x4c18e4){return new BPromise(function(_0x365835,_0x375dfe){if(_0x4c18e4[_0x3e9f('0x5a')]===null||_0x4c18e4[_0x3e9f('0x5a')]===0x1)_0x365835(null);return db[_0x3e9f('0x5b')][_0x3e9f('0x49')]({'where':{'sectionId':_0x4c18e4['id']},'raw':!![]})[_0x3e9f('0x2b')](function(_0x127f8a){var _0x3e4cfb=_['map'](_0x127f8a,function(_0x538311){return qs['omit'](_0x538311,['id',_0x3e9f('0x54'),_0x3e9f('0x56'),_0x3e9f('0x5c')]);});_0x365835(_0x3e4cfb);})[_0x3e9f('0x4b')](function(_0x568b42){_0x375dfe(_0x568b42);});})['then'](function(_0x243eef){var _0x1c4916=qs[_0x3e9f('0x53')](_0x4c18e4,['id','createdAt',_0x3e9f('0x56')]);_0x1c4916[_0x3e9f('0x5d')]=_0x18a140['id'];if(_0x243eef)_0x1c4916[_0x3e9f('0x5e')]=_0x243eef;return _0x1c4916;})[_0x3e9f('0x2b')](function(_0x5afd39){return db['UserProfileSection'][_0x3e9f('0x4f')](_0x5afd39,{'include':[{'model':db[_0x3e9f('0x5b')],'as':_0x3e9f('0x5e')}],'raw':!![],'transaction':_0x2a7a03});});})['then'](function(){return _0x18a140;});}});});});}})[_0x3e9f('0x2b')](respondWithResult(_0x55b4b9,0xc9))[_0x3e9f('0x4b')](handleError(_0x55b4b9,null));};exports[_0x3e9f('0x2a')]=function(_0x47c90c,_0x10cee7){if(_0x47c90c[_0x3e9f('0x50')]['id']){delete _0x47c90c['body']['id'];}return db[_0x3e9f('0x32')][_0x3e9f('0x4e')]({'where':{'id':_0x47c90c[_0x3e9f('0x4c')]['id']}})[_0x3e9f('0x2b')](handleEntityNotFound(_0x10cee7,null))['then'](saveUpdates(_0x47c90c[_0x3e9f('0x50')],null))[_0x3e9f('0x2b')](respondWithResult(_0x10cee7,null))['catch'](handleError(_0x10cee7,null));};exports['destroy']=function(_0x365b6d,_0x519e61){return db['UserProfile'][_0x3e9f('0x4e')]({'where':{'id':_0x365b6d[_0x3e9f('0x4c')]['id']}})[_0x3e9f('0x2b')](handleEntityNotFound(_0x519e61,null))[_0x3e9f('0x2b')](removeEntity(_0x519e61,null))[_0x3e9f('0x4b')](handleError(_0x519e61,null));};exports[_0x3e9f('0x5f')]=function(_0x3bb585,_0x2e5b40){return db['UserProfile'][_0x3e9f('0x5f')]()[_0x3e9f('0x2b')](respondWithResult(_0x2e5b40,null))[_0x3e9f('0x4b')](handleError(_0x2e5b40,null));};exports[_0x3e9f('0x60')]=function(_0x2729b3,_0x3d61dc){var _0x409574=_0x2729b3[_0x3e9f('0x50')];return db['UserProfile']['find']({'where':{'id':_0x2729b3[_0x3e9f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d61dc,null))[_0x3e9f('0x2b')](function(_0x70b937){if(_0x70b937){return db['sequelize'][_0x3e9f('0x61')](function(_0x33f235){return db[_0x3e9f('0x58')][_0x3e9f('0x2c')]({'where':{'userProfileId':_0x2729b3[_0x3e9f('0x4c')]['id'],'sectionId':_['map'](_0x409574,function(_0x21f8e9){return _0x21f8e9[_0x3e9f('0x5c')];})},'transaction':_0x33f235})[_0x3e9f('0x2b')](function(){var _0x1c894e=_[_0x3e9f('0x31')](_0x409574,function(_0x4b4af9){_0x4b4af9['userProfileId']=_0x2729b3['params']['id'];return _0x4b4af9;});var _0x4f1d53=[];return BPromise[_0x3e9f('0x59')](_0x1c894e,function(_0x47dc54){return db[_0x3e9f('0x58')][_0x3e9f('0x4f')](_0x47dc54,{'include':[{'model':db[_0x3e9f('0x5b')],'as':_0x3e9f('0x5e')}],'raw':!![],'transaction':_0x33f235})[_0x3e9f('0x2b')](function(_0x2a5e1d){_0x4f1d53[_0x3e9f('0x62')](_0x2a5e1d[_0x3e9f('0x52')]({'plain':!![]}));});})[_0x3e9f('0x2b')](function(){return _0x4f1d53;});});});}})[_0x3e9f('0x2b')](function(_0x3d35f0){return _0x3d35f0;})['then'](respondWithResult(_0x3d61dc,null))['catch'](handleError(_0x3d61dc,null));};exports[_0x3e9f('0x63')]=function(_0x1c5c75,_0x27ff25){var _0x21d399;return db['UserProfile']['find']({'where':{'id':_0x1c5c75['params']['id']},'attributes':['id',_0x3e9f('0x2e')]})[_0x3e9f('0x2b')](handleEntityNotFound(_0x27ff25,null))['then'](function(_0x112c4c){if(_0x112c4c){_0x21d399=_0x112c4c;return db[_0x3e9f('0x58')][_0x3e9f('0x2c')]({'where':{'userProfileId':_0x1c5c75[_0x3e9f('0x4c')]['id'],'sectionId':_0x1c5c75[_0x3e9f('0x36')]['ids']}});}})[_0x3e9f('0x2b')](function(){return _0x21d399;})[_0x3e9f('0x2b')](respondWithStatusCode(_0x27ff25,null))['catch'](handleError(_0x27ff25,null));};exports['getSections']=function(_0x31e8d4,_0x2cc477){var _0x288d78=[];var _0x38bd2a=[];return db[_0x3e9f('0x58')][_0x3e9f('0x49')]({'where':{'userProfileId':_0x31e8d4['params']['id']},'raw':!![]})[_0x3e9f('0x2b')](function(_0x52ddaa){_0x288d78=_['filter'](_0x52ddaa,function(_0x55dbf9){return _0x55dbf9[_0x3e9f('0x64')]===0x1||_[_0x3e9f('0x65')]([0x3eb,0x709],_0x55dbf9[_0x3e9f('0x5c')]);});if(!_['isEmpty'](_0x288d78)){return _['map'](_0x288d78,function(_0x36a7a6){return _0x36a7a6['sectionId'];});}else{return;}})[_0x3e9f('0x2b')](function(_0x300ab2){if(_0x300ab2)_0x38bd2a=_0x300ab2;if(_['includes'](_0x38bd2a,0x64)){var _0x1ba00f=_[_0x3e9f('0x4e')](_0x288d78,{'sectionId':0x64});return hasDefaultDashboard(_0x1ba00f)[_0x3e9f('0x2b')](function(_0x26b73f){return _[_0x3e9f('0x31')](_0x288d78,function(_0x1a6407){if(_0x1a6407[_0x3e9f('0x5c')]===0x64){_0x1a6407[_0x3e9f('0x66')]=_0x26b73f;}return _0x1a6407;});});}else{return;}})['then'](function(_0x307f9b){if(_0x307f9b)_0x288d78=_0x307f9b;if(_[_0x3e9f('0x65')](_0x38bd2a,0x3eb)){var _0x49755c=_['find'](_0x288d78,{'sectionId':0x3eb});return getCustomDashboards(_0x49755c)['then'](function(_0x19f1ef){return _[_0x3e9f('0x31')](_0x288d78,function(_0x1802d5){if(_0x49755c['enabled']){if(_0x1802d5[_0x3e9f('0x5c')]===0x3eb){_0x1802d5[_0x3e9f('0x66')]=_0x19f1ef;}}else{if(_0x1802d5['sectionId']===0x64){_0x1802d5[_0x3e9f('0x66')]=_0x19f1ef;}}return _0x1802d5;});});}else{return;}})[_0x3e9f('0x2b')](function(_0x38f4cd){if(_0x38f4cd)_0x288d78=_0x38f4cd;if(_[_0x3e9f('0x65')](_0x38bd2a,0x709)){var _0x22fab0=_['find'](_0x288d78,{'sectionId':0x709});return getPlugins(_0x22fab0)[_0x3e9f('0x2b')](function(_0x23ec90){if(_0x22fab0[_0x3e9f('0x64')]){return _[_0x3e9f('0x31')](_0x288d78,function(_0x1434b8){if(_0x1434b8[_0x3e9f('0x5c')]===0x709){_0x1434b8['subsections']=_0x23ec90;}return _0x1434b8;});}else{var _0x38c22a={'sectionId':0x76c,'enabled':0x1,'subsections':_0x23ec90};var _0x457c09=_['map'](_0x288d78);_0x457c09[_0x3e9f('0x62')](_0x38c22a);return _0x457c09;}});}else{return;}})[_0x3e9f('0x2b')](function(_0x5330ad){if(_0x5330ad)_0x288d78=_0x5330ad;return _['filter'](_0x288d78,['enabled',0x1]);})[_0x3e9f('0x2b')](respondWithResult(_0x2cc477,null))['catch'](handleError(_0x2cc477,null));};function hasDefaultDashboard(_0x4187a3){var _0x4a7f68=[0x65];return new BPromise(function(_0x3ca973,_0x51c087){try{if(_0x4187a3[_0x3e9f('0x5a')]){_0x3ca973(_0x4a7f68);}else{return db[_0x3e9f('0x5b')]['findOne']({'where':{'sectionId':_0x4187a3['id']},'raw':!![]})[_0x3e9f('0x2b')](function(_0x145507){_0x145507?_0x3ca973(_0x4a7f68):_0x3ca973();});}}catch(_0xfe77ad){_0x51c087(_0xfe77ad);}});}function getCustomDashboards(_0x344c02){var _0x5d54b6=[];return new BPromise(function(_0x2de7cd,_0x161b7c){try{if(_0x344c02[_0x3e9f('0x5a')]){return db[_0x3e9f('0x67')][_0x3e9f('0x49')]({'raw':!![]})[_0x3e9f('0x2b')](function(_0x5b4ba2){_0x5b4ba2[_0x3e9f('0x68')](function(_0x461144){_0x5d54b6[_0x3e9f('0x62')](_0x461144['id']+0x1869f);});_0x2de7cd(_0x5d54b6);});}else{return db[_0x3e9f('0x5b')][_0x3e9f('0x49')]({'where':{'sectionId':_0x344c02['id']},'raw':!![]})[_0x3e9f('0x2b')](function(_0x5c4709){_0x5c4709[_0x3e9f('0x68')](function(_0x36d97){_0x5d54b6[_0x3e9f('0x62')](_0x36d97['resourceId']+0x1869f);});_0x2de7cd(_0x5d54b6);});}}catch(_0x1e42c6){_0x161b7c(_0x1e42c6);}});}function getPlugins(_0x3a242e){var _0x5c286c=[];return new BPromise(function(_0x7ed91,_0x1ad122){try{if(_0x3a242e[_0x3e9f('0x5a')]){return db[_0x3e9f('0x69')][_0x3e9f('0x49')]({'raw':!![]})[_0x3e9f('0x2b')](function(_0x36dd28){_0x36dd28['forEach'](function(_0x925b6e){_0x5c286c[_0x3e9f('0x62')](_0x925b6e['id']+0x15b38);});_0x7ed91(_0x5c286c);});}else{return db[_0x3e9f('0x5b')]['findAll']({'where':{'sectionId':_0x3a242e['id']},'raw':!![]})[_0x3e9f('0x2b')](function(_0x27ab95){_0x27ab95[_0x3e9f('0x68')](function(_0x2a4f7a){_0x5c286c[_0x3e9f('0x62')](_0x2a4f7a['resourceId']+0x15b38);});_0x7ed91(_0x5c286c);});}}catch(_0x64aac8){_0x1ad122(_0x64aac8);}});}exports[_0x3e9f('0x6a')]=function(_0x4f3425,_0xada4ba){return db['UserProfile'][_0x3e9f('0x4e')]({'where':{'id':_0x4f3425['params']['id']}})[_0x3e9f('0x2b')](handleEntityNotFound(_0xada4ba,null))['then'](function(_0x495752){if(_0x495752){return db[_0x3e9f('0x57')][_0x3e9f('0x61')](function(_0x3b7e68){return db[_0x3e9f('0x58')][_0x3e9f('0x49')]({'where':{'userProfileId':_0x4f3425[_0x3e9f('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0x3e9f('0x2b')](function(_0x1cee53){if(_0x1cee53){return db[_0x3e9f('0x58')][_0x3e9f('0x2c')]({'where':{'userProfileId':_0x4f3425['params']['id'],'id':_['map'](_0x1cee53,function(_0x2216fb){return _0x2216fb['id'];})},'transaction':_0x3b7e68});}})[_0x3e9f('0x2b')](function(_0x50d12a){var _0x23b4a5=_['map'](_0x4f3425['body'],function(_0x2d1e7f){_0x2d1e7f[_0x3e9f('0x5d')]=_0x4f3425[_0x3e9f('0x4c')]['id'];return _0x2d1e7f;});return db[_0x3e9f('0x58')]['bulkCreate'](_0x23b4a5,{'raw':!![],'transaction':_0x3b7e68});})[_0x3e9f('0x2b')](function(_0x34c00c){var _0x1ffa8d=_[_0x3e9f('0x42')](_['map'](_0x34c00c,function(_0x1112cc){return _0x1112cc[_0x3e9f('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x1ffa8d){return db[_0x3e9f('0x58')]['findAll']({'where':{'userProfileId':_0x4f3425[_0x3e9f('0x4c')]['id'],'sectionId':_[_0x3e9f('0x31')](_0x1ffa8d,function(_0x221249){return _0x221249[_0x3e9f('0x5c')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x3e9f('0x2b')](function(_0x4d8355){var _0x5c0538=_[_0x3e9f('0x31')](_0x4f3425[_0x3e9f('0x50')],function(_0x374397){_0x374397[_0x3e9f('0x5d')]=_0x4f3425[_0x3e9f('0x4c')]['id'];return _0x374397;});return db[_0x3e9f('0x5b')]['bulkCreate'](_0x5c0538,{'raw':!![],'transaction':_0x3b7e68});});}})[_0x3e9f('0x4b')](handleError(_0xada4ba,null));});}})[_0x3e9f('0x2b')](function(_0x1c4694){var _0x114a6b=_[_0x3e9f('0x31')](_0x1c4694,function(_0x17a32f){return _0x17a32f[_0x3e9f('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0xada4ba,null))[_0x3e9f('0x4b')](handleError(_0xada4ba,null));};exports['removeResources']=function(_0x34af41,_0x24bf25,_0x433299){return db[_0x3e9f('0x32')][_0x3e9f('0x4e')]({'where':{'id':_0x34af41['params']['id']}})['then'](handleEntityNotFound(_0x24bf25,null))[_0x3e9f('0x2b')](function(_0x20a335){if(_0x20a335){return _0x20a335['removeResources'](_0x34af41[_0x3e9f('0x36')][_0x3e9f('0x6b')]);}})[_0x3e9f('0x2b')](respondWithStatusCode(_0x24bf25,null))[_0x3e9f('0x4b')](handleError(_0x24bf25,null));};exports['getResources']=function(_0x230b84,_0x5f550a){var _0x4439c9={'raw':![],'where':{}};var _0x2b270d={};var _0x53d3d7={'count':0x0,'rows':[]};var _0x153594=_0x230b84[_0x3e9f('0x36')]['section'];if(typeof _0x153594===_0x3e9f('0x23')){throw new db[(_0x3e9f('0x6c'))]['ValidationError']('Unknown\x20section');}var _0x31ad73=_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x6d')]||![];var _0x449ad3=getQueryModels(_0x153594,_0x31ad73);if(typeof _0x449ad3['childModel']===_0x3e9f('0x23')){throw new db[(_0x3e9f('0x6c'))][(_0x3e9f('0x6e'))](_0x3e9f('0x6f')+_0x153594+'\x27');}var _0x11985f=[];if(!_[_0x3e9f('0x70')](_0x449ad3[_0x3e9f('0x71')])){_0x11985f=_0x449ad3['parentSections'];}else{_0x11985f=[{'name':_0x153594}];}return db['UserProfile'][_0x3e9f('0x72')]({'where':{'id':_0x230b84[_0x3e9f('0x4c')]['id']}})[_0x3e9f('0x2b')](handleEntityNotFound(_0x5f550a,null))['then'](function(_0x3d4fd2){if(_0x3d4fd2){var _0x392546=[];for(var _0x5609dc=0x0;_0x5609dc<_0x11985f[_0x3e9f('0x4d')];_0x5609dc++){_0x392546[_0x3e9f('0x62')](db[_0x3e9f('0x58')]['findOne']({'where':{'userProfileId':_0x3d4fd2['id'],'name':_0x11985f[_0x5609dc][_0x3e9f('0x2e')]},'raw':!![]}));}return BPromise[_0x3e9f('0x73')](_0x392546);}})[_0x3e9f('0x2b')](function(_0x1997a0){var _0xe136fa=_[_0x3e9f('0x42')](_0x1997a0,function(_0x3706b2){return _0x3706b2?_0x3706b2:undefined;});var _0x324467=_[_0x3e9f('0x42')](_0x11985f,['ignore',!![]]);var _0x35b557=_[_0x3e9f('0x70')](_0xe136fa)&&_[_0x3e9f('0x70')](_0x324467)?null:_[_0x3e9f('0x74')](_0x324467,_0xe136fa);if(_0x35b557){var _0x3302c2=[];for(var _0x42c98f=0x0;_0x42c98f<_0x35b557['length'];_0x42c98f++){var _0x5a1427=_[_0x3e9f('0x4e')](_0x11985f,function(_0x35a2c6){return _0x35b557[_0x42c98f]?_0x35a2c6['name']===_0x35b557[_0x42c98f][_0x3e9f('0x2e')]:null;});if(_0x5a1427){if(_0x35b557[_0x42c98f][_0x3e9f('0x75')]){_0x3302c2['push'](getAllResources(_0x449ad3[_0x3e9f('0x76')],_0x35b557[_0x42c98f]));}else{if(!_0x35b557[_0x42c98f][_0x3e9f('0x5a')]){_0x3302c2[_0x3e9f('0x62')](getAllowedResources(_0x5a1427,_0x35b557[_0x42c98f],_0x449ad3[_0x3e9f('0x76')]));}else{if(_0x5a1427[_0x3e9f('0x35')]){_0x3302c2[_0x3e9f('0x62')](getAllFilteredResources(_0x5a1427,_0x35b557[_0x42c98f]));}}}}}return BPromise[_0x3e9f('0x73')](_0x3302c2);}else{return null;}})[_0x3e9f('0x2b')](function(_0x3ad39d){var _0xa8e488=_0x3ad39d;var _0x2c3440=null;if(_0xa8e488){_0x2c3440=_0xa8e488['length']===0x1?_0xa8e488[0x0]:null;}if(_0x2c3440||_0xa8e488){var _0x13d556=db[_0x449ad3['childModel']][_0x3e9f('0x33')];_0x2b270d['model']=_['keys'](_0x13d556);_0x2b270d['query']=_['keys'](_0x230b84['query']);_0x2b270d[_0x3e9f('0x38')]=_[_0x3e9f('0x3a')](_0x2b270d[_0x3e9f('0x35')],_0x2b270d[_0x3e9f('0x36')]);_0x4439c9[_0x3e9f('0x39')]=_[_0x3e9f('0x3a')](_0x2b270d[_0x3e9f('0x35')],qs[_0x3e9f('0x3b')](_0x230b84['query'][_0x3e9f('0x3b')]));_0x4439c9[_0x3e9f('0x39')]=_0x4439c9[_0x3e9f('0x39')][_0x3e9f('0x4d')]?_0x4439c9['attributes']:_0x2b270d[_0x3e9f('0x35')];if(!_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x3c')](_0x3e9f('0x3d'))){_0x4439c9['limit']=qs[_0x3e9f('0x24')](_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x24')]);_0x4439c9['offset']=qs[_0x3e9f('0x22')](_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x22')]);}_0x4439c9[_0x3e9f('0x3e')]=qs[_0x3e9f('0x3f')](_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x3f')]);_0x4439c9[_0x3e9f('0x40')]=qs[_0x3e9f('0x38')](_['pick'](_0x230b84['query'],_0x2b270d[_0x3e9f('0x38')]));if(_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x42')]){_0x4439c9['where']=_[_0x3e9f('0x43')](_0x4439c9[_0x3e9f('0x40')],{'$or':_['map'](_0x13d556,function(_0x29ffd5){if(_0x29ffd5[_0x3e9f('0x44')][_0x3e9f('0x34')]!==_0x3e9f('0x45')){var _0xf6de78={};_0xf6de78[_0x29ffd5['field']]={'$like':'%'+_0x230b84['query'][_0x3e9f('0x42')]+'%'};return _0xf6de78;}})});}var _0x365af9=[];if(_0x2c3440){var _0x87f35e=_[_0x3e9f('0x4e')](_0x11985f,[_0x3e9f('0x2e'),_0x2c3440['name']]);if(_0x87f35e[_0x3e9f('0x77')]){var _0x594ee3={};if(_0x449ad3['childModel']===_0x3e9f('0x78')){_0x594ee3[_0x87f35e['foreignKey']]=_[_0x3e9f('0x31')](_0x2c3440[_0x3e9f('0x79')],'id');}else{_0x594ee3[_0x87f35e['foreignKey']]=_0x2c3440['associatedResources'];}_0x365af9[_0x3e9f('0x62')](_0x594ee3);}else{_0x4439c9[_0x3e9f('0x40')]['id']=_0x2c3440[_0x3e9f('0x79')];}}else{for(var _0x2bf16f=0x0;_0x2bf16f<_0xa8e488[_0x3e9f('0x4d')];_0x2bf16f++){var _0x87f35e=_['find'](_0x11985f,[_0x3e9f('0x2e'),_0xa8e488[_0x2bf16f]['name']]);if(_0x87f35e['field']){var _0x594ee3={};_0x594ee3[_0x87f35e[_0x3e9f('0x7a')]]=_0xa8e488[_0x2bf16f][_0x3e9f('0x79')];_0x365af9[_0x3e9f('0x62')](_0x594ee3);}else{if(!_0x4439c9[_0x3e9f('0x40')]['id'])_0x4439c9['where']['id']=[];_0xa8e488[_0x2bf16f][_0x3e9f('0x79')][_0x3e9f('0x68')](function(_0x767a03){_0x4439c9[_0x3e9f('0x40')]['id'][_0x3e9f('0x62')](_0x767a03);});}}}if(!_[_0x3e9f('0x70')](_0x365af9)){_0x4439c9[_0x3e9f('0x40')]=_[_0x3e9f('0x43')](_0x4439c9['where'],{'$and':{'$or':_0x365af9}});}_0x4439c9=_[_0x3e9f('0x43')]({},_0x4439c9,_0x230b84[_0x3e9f('0x46')]);if(_0x2c3440&&!_0x2c3440['autoAssociation']&&_0x449ad3[_0x3e9f('0x76')]===_0x3e9f('0x78')){if(_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x47')]){_0x4439c9[_0x3e9f('0x48')]=[{'all':!![]}];}return db[_0x449ad3[_0x3e9f('0x76')]][_0x3e9f('0x49')](_0x4439c9)[_0x3e9f('0x2b')](function(_0x40e0f3){var _0x28e560=[];_0x40e0f3[_0x3e9f('0x68')](function(_0x5df09c){var _0x5a2741;switch(_0x5df09c[_0x3e9f('0x7b')]){case _0x3e9f('0x7c'):_0x5a2741=_[_0x3e9f('0x4e')](_0x2c3440[_0x3e9f('0x79')],function(_0x50d705){return _0x50d705['id']===_0x5df09c[_0x3e9f('0x7d')]&&_0x50d705[_0x3e9f('0x44')]===_0x3e9f('0x7e');});break;case _0x3e9f('0x7f'):_0x5a2741=_[_0x3e9f('0x4e')](_0x2c3440[_0x3e9f('0x79')],function(_0x14e2fa){return _0x14e2fa['id']===_0x5df09c[_0x3e9f('0x7d')]&&_0x14e2fa['type']===_0x3e9f('0x80');});break;}if(_0x5a2741)_0x28e560['push'](_0x5df09c);});_0x53d3d7['count']=_0x28e560[_0x3e9f('0x4d')];_0x53d3d7['rows']=_0x28e560;return _0x53d3d7;});}else{return db[_0x449ad3[_0x3e9f('0x76')]][_0x3e9f('0x25')]({'where':_0x4439c9[_0x3e9f('0x40')]})[_0x3e9f('0x2b')](function(_0x228f9b){_0x53d3d7[_0x3e9f('0x25')]=_0x228f9b;if(_0x230b84['query'][_0x3e9f('0x47')]){if(_0x449ad3[_0x3e9f('0x76')]==='CmContact'){_0x4439c9[_0x3e9f('0x48')]=[{'model':db[_0x3e9f('0x81')],'as':_0x3e9f('0x82'),'attributes':['id',_0x3e9f('0x2e'),_0x3e9f('0x83')],'required':_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x84')]?!![]:![]},{'model':db['Tag'],'as':_0x3e9f('0x85'),'attributes':['id','name',_0x3e9f('0x83')],'through':_0x230b84[_0x3e9f('0x36')]['tag']?{'attributes':[],'where':{'TagId':_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x84')]||undefined}}:{},'required':_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x84')]?!![]:![]}];}else{_0x4439c9[_0x3e9f('0x48')]=[{'all':!![]}];}}return db[_0x449ad3[_0x3e9f('0x76')]][_0x3e9f('0x49')](_0x4439c9);})[_0x3e9f('0x2b')](function(_0x12b574){_0x53d3d7[_0x3e9f('0x4a')]=_0x12b574;if(_0x153594===_0x3e9f('0x86')&&_0x230b84[_0x3e9f('0x36')][_0x3e9f('0x87')]===_0x3e9f('0x88')){var _0x1c4612=[];for(var _0x50d222=0x0;_0x50d222<_0x53d3d7[_0x3e9f('0x4a')][_0x3e9f('0x4d')];_0x50d222++){_0x1c4612['push'](getOpenTabs(_0x3e9f('0x89'),_0x53d3d7[_0x3e9f('0x4a')][_0x50d222][_0x3e9f('0x8a')]));_0x1c4612[_0x3e9f('0x62')](getOpenTabs(_0x3e9f('0x8b'),_0x53d3d7[_0x3e9f('0x4a')][_0x50d222][_0x3e9f('0x8a')]));_0x1c4612[_0x3e9f('0x62')](getOpenTabs(_0x3e9f('0x8c'),_0x53d3d7[_0x3e9f('0x4a')][_0x50d222][_0x3e9f('0x8a')]));_0x1c4612['push'](getOpenTabs('mail',_0x53d3d7[_0x3e9f('0x4a')][_0x50d222][_0x3e9f('0x8a')]));_0x1c4612[_0x3e9f('0x62')](getOpenTabs('openchannel',_0x53d3d7[_0x3e9f('0x4a')][_0x50d222][_0x3e9f('0x8a')]));_0x1c4612[_0x3e9f('0x62')](getOpenTabs(_0x3e9f('0x8d'),_0x53d3d7[_0x3e9f('0x4a')][_0x50d222][_0x3e9f('0x8a')]));}return Promise[_0x3e9f('0x73')](_0x1c4612)[_0x3e9f('0x2b')](function(){return _0x53d3d7;});}return _0x53d3d7;});}}else{return _0x53d3d7;}})[_0x3e9f('0x2b')](respondWithFilteredResult(_0x5f550a,_0x4439c9))[_0x3e9f('0x4b')](handleError(_0x5f550a,null));};function getOpenTabs(_0xa96775,_0x3f741f){var _0x297a1e=_0xa96775[_0x3e9f('0x8e')](0x0)[_0x3e9f('0x8f')]()+_0xa96775[_0x3e9f('0x90')](0x1);var _0x5137f6={'type':db[_0x3e9f('0x6c')][_0x3e9f('0x91')][_0x3e9f('0x92')],'raw':!![]};return new BPromise(function(_0x173168,_0xece7d6){var _0x207013=squel['select']()[_0x3e9f('0x77')](_0x3e9f('0x93')+_0x297a1e+_0x3e9f('0x94'),'id')[_0x3e9f('0x77')](_0x3e9f('0x95'))['from'](_0x3e9f('0x96')+_0xa96775+_0x3e9f('0x97'),'ui')[_0x3e9f('0x40')](_0x3e9f('0x98'),_0x3f741f['id']);return db[_0x3e9f('0x57')][_0x3e9f('0x36')](_0x207013[_0x3e9f('0x99')](),_0x5137f6)['then'](function(_0x2368b6){_0x3f741f[_0x297a1e+_0x3e9f('0x9a')]=_0x2368b6;_0x173168(_0x2368b6);})['catch'](function(_0x173cea){_0xece7d6(_0x173cea);});});}function getAllResources(_0x38effc,_0x1682a7){return new BPromise(function(_0x1b4c82,_0x4043be){if(_0x1682a7){var _0x59b525=_0x1682a7[_0x3e9f('0x42')]?{[_0x1682a7[_0x3e9f('0x42')][_0x3e9f('0x77')]]:_0x1682a7['filter'][_0x3e9f('0x9b')]}:undefined;return db[_0x38effc][_0x3e9f('0x49')]({'where':_0x59b525,'raw':!![]})[_0x3e9f('0x2b')](function(_0x1e41f8){_0x1682a7[_0x3e9f('0x79')]=_['map'](_0x1e41f8,'id');_0x1b4c82(_0x1682a7);})[_0x3e9f('0x4b')](function(_0x1f8004){_0x4043be(_0x1f8004);});}else{_0x1b4c82(null);}});}function getAllFilteredResources(_0x2f467a,_0x781a2f){return new BPromise(function(_0x34d1ee,_0x5c90b3){var _0x3f5e96=_0x2f467a[_0x3e9f('0x42')]?{[_0x2f467a['filter'][_0x3e9f('0x77')]]:_0x2f467a[_0x3e9f('0x42')][_0x3e9f('0x9b')]}:undefined;return db[_0x2f467a[_0x3e9f('0x35')]][_0x3e9f('0x49')]({'where':_0x3f5e96,'raw':!![]})[_0x3e9f('0x2b')](function(_0x5442f9){_0x781a2f[_0x3e9f('0x79')]=_[_0x3e9f('0x31')](_0x5442f9,function(_0x4edabf){return _0x2f467a[_0x3e9f('0x77')]?_0x4edabf[_0x2f467a[_0x3e9f('0x77')]]:_0x4edabf['name'];});_0x34d1ee(_0x781a2f);})[_0x3e9f('0x4b')](function(_0x281f3){_0x5c90b3(_0x281f3);});});}function getAllowedResources(_0x595915,_0x2b8a04,_0x20a6a9){return new BPromise(function(_0x10aefa,_0x3f22d0){if(_0x2b8a04){return db[_0x3e9f('0x5b')][_0x3e9f('0x49')]({'where':{'sectionId':_0x2b8a04['id']},'raw':!![]})['then'](function(_0x4eca15){if(_0x595915[_0x3e9f('0x77')]&&_0x595915[_0x3e9f('0x77')]!=='id'){_0x2b8a04[_0x3e9f('0x79')]=_[_0x3e9f('0x31')](_0x4eca15,function(_0x1c7a96){return _0x1c7a96[_0x595915[_0x3e9f('0x77')]];});}else{if(_0x20a6a9===_0x3e9f('0x78')){_0x2b8a04['associatedResources']=_[_0x3e9f('0x31')](_0x4eca15,function(_0x300821){return{'id':_0x300821[_0x3e9f('0x9c')],'type':_0x300821[_0x3e9f('0x44')]};});}else{_0x2b8a04[_0x3e9f('0x79')]=_['map'](_0x4eca15,function(_0x40177c){return _0x40177c[_0x3e9f('0x9c')];});}}_0x10aefa(_0x2b8a04);})['catch'](function(_0x144216){_0x3f22d0(_0x144216);});}else{_0x10aefa(null);}});}function getQueryModels(_0x435716,_0x710a8){var _0x3a8477=_0x435716[_0x3e9f('0x9d')]();var _0x1923d1={'childModel':undefined,'parentSections':[]};switch(_0x3a8477){case'squareprojects':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0x9e');break;case'odbc':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0x9f');break;case _0x3e9f('0xa0'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xa1');_0x1923d1[_0x3e9f('0x71')]=[{'name':_0x3e9f('0xa2'),'field':_0x3e9f('0x2e'),'foreignKey':_0x3e9f('0xa3')}];break;case _0x3e9f('0xa4'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xa5');break;case'contacts':_0x1923d1[_0x3e9f('0x76')]='CmContact';_0x1923d1[_0x3e9f('0x71')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x3e9f('0xa6'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xa7');break;case _0x3e9f('0xa8'):_0x1923d1['childModel']=_0x3e9f('0xa9');break;case'globalcustomfields':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xaa');break;case'chatqueues':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xab');break;case'chatwebsites':_0x1923d1[_0x3e9f('0x76')]='ChatWebsite';break;case _0x3e9f('0xac'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xad');break;case _0x3e9f('0xae'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xaf');break;case _0x3e9f('0xb0'):case _0x3e9f('0xb1'):case'outboundroutes':_0x1923d1['childModel']='VoiceExtension';break;case _0x3e9f('0xb2'):_0x1923d1[_0x3e9f('0x76')]='VoiceContext';break;case _0x3e9f('0xb3'):_0x1923d1[_0x3e9f('0x76')]='VoiceMail';break;case _0x3e9f('0xb4'):_0x1923d1[_0x3e9f('0x76')]='VoiceRecording';_0x1923d1['parentSections']=[{'name':_0x3e9f('0x86'),'field':_0x3e9f('0x2e'),'foreignKey':_0x3e9f('0xb5'),'model':_0x3e9f('0xb6'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0x3e9f('0x2e'),'foreignKey':'membername','model':_0x3e9f('0xb6'),'filter':{'field':'role','value':[_0x3e9f('0xb7')]}},{'name':_0x3e9f('0xb8'),'field':_0x3e9f('0x2e'),'foreignKey':_0x3e9f('0xb9'),'model':_0x3e9f('0xba'),'filter':{'field':'type','value':[_0x3e9f('0xbb')]}},{'name':_0x3e9f('0xbc'),'field':_0x3e9f('0x2e'),'foreignKey':'queue','model':_0x3e9f('0xba'),'filter':{'field':_0x3e9f('0x44'),'value':[_0x3e9f('0xbd')]}}];break;case _0x3e9f('0xbe'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xbf');break;case _0x3e9f('0xc0'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xc1');break;case _0x3e9f('0xc2'):_0x1923d1[_0x3e9f('0x76')]='VoicePrefix';break;case'ivrcampaigns':_0x1923d1['childModel']='Campaign';break;case'mailqueues':_0x1923d1[_0x3e9f('0x76')]='MailQueue';break;case'mailaccounts':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xc3');break;case _0x3e9f('0xc4'):_0x1923d1['childModel']=_0x3e9f('0xc5');break;case _0x3e9f('0xc6'):_0x1923d1[_0x3e9f('0x76')]='OpenchannelQueue';break;case _0x3e9f('0xc7'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xc8');break;case _0x3e9f('0xc9'):_0x1923d1[_0x3e9f('0x76')]='SmsQueue';break;case _0x3e9f('0xca'):_0x1923d1['childModel']=_0x3e9f('0xcb');break;case _0x3e9f('0xcc'):_0x1923d1[_0x3e9f('0x76')]='WhatsappQueue';break;case'teams':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xcd');break;case _0x3e9f('0xce'):case _0x3e9f('0xcf'):_0x1923d1['childModel']='VoiceQueue';if(_0x710a8){_0x1923d1[_0x3e9f('0x71')]=[{'name':_0x3e9f('0xb8')},{'name':_0x3e9f('0xbc')}];}break;case _0x3e9f('0xd0'):case'agents':case _0x3e9f('0xd1'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xb6');if(_0x710a8){_0x1923d1['parentSections']=[{'name':_0x3e9f('0xd2'),'filter':{'field':_0x3e9f('0xd3'),'value':[_0x3e9f('0xd4'),_0x3e9f('0xd5')]},'ignore':!![]},{'name':_0x3e9f('0x86')},{'name':_0x3e9f('0xd6')}];}break;case _0x3e9f('0xd7'):_0x1923d1['childModel']=_0x3e9f('0xd8');break;case _0x3e9f('0xd9'):_0x1923d1['childModel']='SalesforceAccount';break;case _0x3e9f('0xda'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xdb');break;case _0x3e9f('0xdc'):_0x1923d1[_0x3e9f('0x76')]='SugarcrmAccount';break;case _0x3e9f('0xdd'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xde');break;case _0x3e9f('0xdf'):_0x1923d1['childModel']=_0x3e9f('0xe0');break;case'vtigeraccounts':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xb6');break;case _0x3e9f('0xe1'):_0x1923d1['childModel']=_0x3e9f('0xe2');break;case _0x3e9f('0xe3'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xe4');break;case _0x3e9f('0xe5'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0x67');break;case _0x3e9f('0xe6'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xe7');break;case _0x3e9f('0xe8'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xe9');break;case _0x3e9f('0xea'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xeb');break;case _0x3e9f('0xec'):_0x1923d1[_0x3e9f('0x76')]='Sound';break;case'tags':_0x1923d1['childModel']=_0x3e9f('0x81');break;case _0x3e9f('0xed'):_0x1923d1[_0x3e9f('0x76')]='Template';break;case _0x3e9f('0xee'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xef');break;case _0x3e9f('0xf0'):_0x1923d1['childModel']=_0x3e9f('0xf1');break;case _0x3e9f('0xf2'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xf3');break;case _0x3e9f('0xf4'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0x69');break;case _0x3e9f('0xf5'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0x78');_0x1923d1[_0x3e9f('0x71')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case'metrics':_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xf6');break;case _0x3e9f('0xf7'):_0x1923d1[_0x3e9f('0x76')]='WhatsappAccount';break;case _0x3e9f('0xf8'):_0x1923d1[_0x3e9f('0x76')]=_0x3e9f('0xf9');_0x1923d1[_0x3e9f('0x71')]=[{'name':_0x3e9f('0x86'),'field':'id','foreignKey':_0x3e9f('0xfa'),'model':'User','filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':'id','foreignKey':'UserId','model':_0x3e9f('0xb6'),'filter':{'field':'role','value':['telephone']}}];break;default:return _0x1923d1;}return _0x1923d1;}
\ No newline at end of file
+var _0x29b3=['all','ignore','nolimit','order','field','foreignKey','associatedResources','AnalyticExtractedReport','reportType','default','reportId','custom','CmContact','Tag','color','ThroughTags','tag','Agents','openTabs','true','dataValues','sms','openchannel','whatsapp','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','value','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','parentSections','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','Telephones','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','WhatsappQueue','teams','Team','voicequeues','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','SugarcrmAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Interval','pauses','scheduler','Schedule','Sound','tags','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','WhatsappAccount','screenrecordings','ScreenRecording','UserId','rimraf','zip-dir','request-promise','moment','bluebird','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','redis','defaults','localhost','./userProfile.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','sendStatus','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','merge','where','VIRTUAL','filter','include','findAll','rows','catch','params','length','options','find','create','body','clone','includeAll','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','destroy','describe','addSections','removeSections','ids','getSections','includes','isEmpty','subsections','push','enabled','findOne','Dashboard','forEach','UserProfileResource','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27'];(function(_0x392279,_0x306deb){var _0x14ce48=function(_0x4c8f1e){while(--_0x4c8f1e){_0x392279['push'](_0x392279['shift']());}};_0x14ce48(++_0x306deb);}(_0x29b3,0x18a));var _0x329b=function(_0x12863d,_0x2d6969){_0x12863d=_0x12863d-0x0;var _0x53f74e=_0x29b3[_0x12863d];return _0x53f74e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x329b('0x0'));var zipdir=require(_0x329b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x329b('0x2'));var moment=require(_0x329b('0x3'));var BPromise=require(_0x329b('0x4'));var Mustache=require('mustache');var util=require(_0x329b('0x5'));var path=require(_0x329b('0x6'));var sox=require(_0x329b('0x7'));var csv=require(_0x329b('0x8'));var ejs=require(_0x329b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x329b('0xa'));var squel=require(_0x329b('0xb'));var crypto=require('crypto');var jsforce=require(_0x329b('0xc'));var deskjs=require(_0x329b('0xd'));var toCsv=require(_0x329b('0x8'));var querystring=require(_0x329b('0xe'));var Papa=require(_0x329b('0xf'));var Redis=require(_0x329b('0x10'));var authService=require(_0x329b('0x11'));var qs=require(_0x329b('0x12'));var as=require(_0x329b('0x13'));var hardwareService=require(_0x329b('0x14'));var logger=require(_0x329b('0x15'))('api');var utils=require(_0x329b('0x16'));var config=require(_0x329b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x329b('0x18')]=_[_0x329b('0x19')](config[_0x329b('0x18')],{'host':_0x329b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x329b('0x18')]));require(_0x329b('0x1b'))[_0x329b('0x1c')](socket);function respondWithStatusCode(_0x4ca67c,_0x4c6ed5){_0x4c6ed5=_0x4c6ed5||0xcc;return function(_0x3ae65d){if(_0x3ae65d){return _0x4ca67c['sendStatus'](_0x4c6ed5);}return _0x4ca67c[_0x329b('0x1d')](_0x4c6ed5)['end']();};}function respondWithResult(_0x5daef4,_0x32ed22){_0x32ed22=_0x32ed22||0xc8;return function(_0x2f3b67){if(_0x2f3b67){return _0x5daef4[_0x329b('0x1d')](_0x32ed22)[_0x329b('0x1e')](_0x2f3b67);}};}function respondWithFilteredResult(_0x78707c,_0x32fede){return function(_0x27cb5e){if(_0x27cb5e){var _0x58db48=typeof _0x32fede[_0x329b('0x1f')]===_0x329b('0x20')&&typeof _0x32fede[_0x329b('0x21')]===_0x329b('0x20');var _0x4a7c3a=_0x27cb5e['count'];var _0x21fbb9=_0x58db48?0x0:_0x32fede[_0x329b('0x1f')];var _0x45d2c2=_0x58db48?_0x27cb5e[_0x329b('0x22')]:_0x32fede[_0x329b('0x1f')]+_0x32fede[_0x329b('0x21')];var _0xadce8b;if(_0x45d2c2>=_0x4a7c3a){_0x45d2c2=_0x4a7c3a;_0xadce8b=0xc8;}else{_0xadce8b=0xce;}_0x78707c['status'](_0xadce8b);return _0x78707c[_0x329b('0x23')](_0x329b('0x24'),_0x21fbb9+'-'+_0x45d2c2+'/'+_0x4a7c3a)[_0x329b('0x1e')](_0x27cb5e);}return null;};}function patchUpdates(_0x16624f){return function(_0x5393bc){try{jsonpatch[_0x329b('0x25')](_0x5393bc,_0x16624f,!![]);}catch(_0xcb2995){return BPromise['reject'](_0xcb2995);}return _0x5393bc[_0x329b('0x26')]();};}function saveUpdates(_0x153c76,_0x6f8c49){return function(_0x4e890a){if(_0x4e890a){return _0x4e890a[_0x329b('0x27')](_0x153c76)[_0x329b('0x28')](function(_0x36ee48){return _0x36ee48;});}return null;};}function removeEntity(_0x2d93e2,_0x8a422a){return function(_0x2f1d89){if(_0x2f1d89){return _0x2f1d89['destroy']()['then'](function(){_0x2d93e2[_0x329b('0x1d')](0xcc)[_0x329b('0x29')]();});}};}function handleEntityNotFound(_0x5f22a4,_0x4de671){return function(_0x170a99){if(!_0x170a99){_0x5f22a4[_0x329b('0x2a')](0x194);}return _0x170a99;};}function handleError(_0x208389,_0x4f1b5b){_0x4f1b5b=_0x4f1b5b||0x1f4;return function(_0x4a4704){logger[_0x329b('0x2b')](_0x4a4704[_0x329b('0x2c')]);if(_0x4a4704[_0x329b('0x2d')]){delete _0x4a4704['name'];}_0x208389[_0x329b('0x1d')](_0x4f1b5b)[_0x329b('0x2e')](_0x4a4704);};}exports['index']=function(_0x55346c,_0x346498){var _0x3b4364={},_0x5016a7={},_0x1667f7={'count':0x0,'rows':[]};var _0x2afd01=_[_0x329b('0x2f')](db[_0x329b('0x30')][_0x329b('0x31')],function(_0x3261c4){return{'name':_0x3261c4[_0x329b('0x32')],'type':_0x3261c4[_0x329b('0x33')][_0x329b('0x34')]};});_0x5016a7[_0x329b('0x35')]=_[_0x329b('0x2f')](_0x2afd01,'name');_0x5016a7[_0x329b('0x36')]=_[_0x329b('0x37')](_0x55346c[_0x329b('0x36')]);_0x5016a7[_0x329b('0x38')]=_['intersection'](_0x5016a7[_0x329b('0x35')],_0x5016a7[_0x329b('0x36')]);_0x3b4364[_0x329b('0x39')]=_[_0x329b('0x3a')](_0x5016a7[_0x329b('0x35')],qs[_0x329b('0x3b')](_0x55346c['query'][_0x329b('0x3b')]));_0x3b4364[_0x329b('0x39')]=_0x3b4364['attributes']['length']?_0x3b4364[_0x329b('0x39')]:_0x5016a7['model'];if(!_0x55346c[_0x329b('0x36')][_0x329b('0x3c')]('nolimit')){_0x3b4364[_0x329b('0x21')]=qs[_0x329b('0x21')](_0x55346c['query']['limit']);_0x3b4364[_0x329b('0x1f')]=qs[_0x329b('0x1f')](_0x55346c[_0x329b('0x36')][_0x329b('0x1f')]);}_0x3b4364['order']=qs['sort'](_0x55346c[_0x329b('0x36')][_0x329b('0x3d')]);_0x3b4364['where']=qs[_0x329b('0x38')](_[_0x329b('0x3e')](_0x55346c[_0x329b('0x36')],_0x5016a7[_0x329b('0x38')]),_0x2afd01);if(_0x55346c[_0x329b('0x36')]['filter']){_0x3b4364['where']=_[_0x329b('0x3f')](_0x3b4364[_0x329b('0x40')],{'$or':_[_0x329b('0x2f')](_0x2afd01,function(_0x3b09d4){if(_0x3b09d4[_0x329b('0x33')]!==_0x329b('0x41')){var _0x3e8706={};_0x3e8706[_0x3b09d4[_0x329b('0x2d')]]={'$like':'%'+_0x55346c[_0x329b('0x36')][_0x329b('0x42')]+'%'};return _0x3e8706;}})});}_0x3b4364=_[_0x329b('0x3f')]({},_0x3b4364,_0x55346c['options']);var _0x55de9d={'where':_0x3b4364[_0x329b('0x40')]};return db[_0x329b('0x30')][_0x329b('0x22')](_0x55de9d)[_0x329b('0x28')](function(_0x5137a7){_0x1667f7[_0x329b('0x22')]=_0x5137a7;if(_0x55346c[_0x329b('0x36')]['includeAll']){_0x3b4364[_0x329b('0x43')]=[{'all':!![]}];}return db[_0x329b('0x30')][_0x329b('0x44')](_0x3b4364);})[_0x329b('0x28')](function(_0x40729d){_0x1667f7[_0x329b('0x45')]=_0x40729d;return _0x1667f7;})[_0x329b('0x28')](respondWithFilteredResult(_0x346498,_0x3b4364))[_0x329b('0x46')](handleError(_0x346498,null));};exports['show']=function(_0x3e3507,_0x193f69){var _0x54df29={'raw':![],'where':{'id':_0x3e3507[_0x329b('0x47')]['id']}},_0x34e65a={};_0x34e65a[_0x329b('0x35')]=_[_0x329b('0x37')](db[_0x329b('0x30')]['rawAttributes']);_0x34e65a[_0x329b('0x36')]=_['keys'](_0x3e3507['query']);_0x34e65a['filters']=_['intersection'](_0x34e65a[_0x329b('0x35')],_0x34e65a[_0x329b('0x36')]);_0x54df29['attributes']=_[_0x329b('0x3a')](_0x34e65a[_0x329b('0x35')],qs['fields'](_0x3e3507['query'][_0x329b('0x3b')]));_0x54df29[_0x329b('0x39')]=_0x54df29[_0x329b('0x39')][_0x329b('0x48')]?_0x54df29[_0x329b('0x39')]:_0x34e65a[_0x329b('0x35')];if(_0x3e3507['query']['includeAll']){_0x54df29[_0x329b('0x43')]=[{'all':!![]}];}_0x54df29=_['merge']({},_0x54df29,_0x3e3507[_0x329b('0x49')]);return db[_0x329b('0x30')][_0x329b('0x4a')](_0x54df29)[_0x329b('0x28')](handleEntityNotFound(_0x193f69,null))[_0x329b('0x28')](respondWithResult(_0x193f69,null))['catch'](handleError(_0x193f69,null));};exports['create']=function(_0x40f72d,_0x3f0168){return db['UserProfile'][_0x329b('0x4b')](_0x40f72d[_0x329b('0x4c')],{})[_0x329b('0x28')](respondWithResult(_0x3f0168,0xc9))[_0x329b('0x46')](handleError(_0x3f0168,null));};exports[_0x329b('0x4d')]=function(_0x164c82,_0x1d9ed5){var _0x5491b1={'where':{'id':_0x164c82['params']['id']}},_0x172899={};_0x172899[_0x329b('0x35')]=_[_0x329b('0x37')](db[_0x329b('0x30')][_0x329b('0x31')]);_0x5491b1[_0x329b('0x39')]=_[_0x329b('0x3a')](_0x172899[_0x329b('0x35')],qs['fields'](_0x164c82[_0x329b('0x36')][_0x329b('0x3b')]));_0x5491b1[_0x329b('0x39')]=_0x5491b1[_0x329b('0x39')]['length']?_0x5491b1[_0x329b('0x39')]:_0x172899['model'];if(_0x164c82[_0x329b('0x36')][_0x329b('0x4e')]){_0x5491b1[_0x329b('0x43')]=[{'all':!![]}];}_0x5491b1=_[_0x329b('0x3f')]({},_0x5491b1,_0x164c82[_0x329b('0x49')]);return db[_0x329b('0x30')][_0x329b('0x4a')](_0x5491b1)['then'](handleEntityNotFound(_0x1d9ed5,null))[_0x329b('0x28')](function(_0x33bd0c){if(_0x33bd0c){var _0x5de8a2=_0x33bd0c[_0x329b('0x4f')]({'plain':!![]});_0x5de8a2=qs[_0x329b('0x50')](_0x5de8a2,['id',_0x329b('0x51'),'updatedAt',_0x329b('0x52')]);_0x164c82[_0x329b('0x4c')]=_[_0x329b('0x50')](_0x164c82[_0x329b('0x4c')],['id',_0x329b('0x51'),_0x329b('0x53')]);return db[_0x329b('0x54')][_0x329b('0x55')](function(_0x149947){return db[_0x329b('0x30')][_0x329b('0x4b')](_[_0x329b('0x3f')](_0x5de8a2,_0x164c82[_0x329b('0x4c')]),{'include':_0x164c82[_0x329b('0x36')][_0x329b('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x149947})['then'](function(_0x4f6425){var _0x34ccaf=_0x4f6425['get']({'plain':!![]});return db[_0x329b('0x56')][_0x329b('0x44')]({'where':{'userProfileId':_0x164c82[_0x329b('0x47')]['id']},'raw':!![]})[_0x329b('0x28')](function(_0x486cfc){if(_0x486cfc){return BPromise[_0x329b('0x57')](_0x486cfc,function(_0x18d238){return new BPromise(function(_0x8259d6,_0x5a41a3){if(_0x18d238[_0x329b('0x58')]===null||_0x18d238[_0x329b('0x58')]===0x1)_0x8259d6(null);return db['UserProfileResource'][_0x329b('0x44')]({'where':{'sectionId':_0x18d238['id']},'raw':!![]})['then'](function(_0x5c24cf){var _0x4c1de6=_['map'](_0x5c24cf,function(_0x30fbe9){return qs[_0x329b('0x50')](_0x30fbe9,['id',_0x329b('0x51'),_0x329b('0x53'),_0x329b('0x59')]);});_0x8259d6(_0x4c1de6);})[_0x329b('0x46')](function(_0x41bac1){_0x5a41a3(_0x41bac1);});})[_0x329b('0x28')](function(_0x2bc582){var _0x25e5d0=qs['omit'](_0x18d238,['id',_0x329b('0x51'),'updatedAt']);_0x25e5d0[_0x329b('0x5a')]=_0x34ccaf['id'];if(_0x2bc582)_0x25e5d0[_0x329b('0x5b')]=_0x2bc582;return _0x25e5d0;})[_0x329b('0x28')](function(_0x5ec027){return db[_0x329b('0x56')][_0x329b('0x4b')](_0x5ec027,{'include':[{'model':db['UserProfileResource'],'as':_0x329b('0x5b')}],'raw':!![],'transaction':_0x149947});});})['then'](function(){return _0x34ccaf;});}});});});}})['then'](respondWithResult(_0x1d9ed5,0xc9))[_0x329b('0x46')](handleError(_0x1d9ed5,null));};exports[_0x329b('0x27')]=function(_0x2d7d6d,_0x5b524c){if(_0x2d7d6d['body']['id']){delete _0x2d7d6d[_0x329b('0x4c')]['id'];}return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x2d7d6d['params']['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x5b524c,null))[_0x329b('0x28')](saveUpdates(_0x2d7d6d[_0x329b('0x4c')],null))[_0x329b('0x28')](respondWithResult(_0x5b524c,null))['catch'](handleError(_0x5b524c,null));};exports[_0x329b('0x5c')]=function(_0x3f25f0,_0x1c915a){return db['UserProfile'][_0x329b('0x4a')]({'where':{'id':_0x3f25f0[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x1c915a,null))['then'](removeEntity(_0x1c915a,null))['catch'](handleError(_0x1c915a,null));};exports['describe']=function(_0x49cd26,_0x235938){return db[_0x329b('0x30')][_0x329b('0x5d')]()[_0x329b('0x28')](respondWithResult(_0x235938,null))[_0x329b('0x46')](handleError(_0x235938,null));};exports[_0x329b('0x5e')]=function(_0x5bf714,_0x192e2a){var _0x3a3eae=_0x5bf714['body'];return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x5bf714[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x192e2a,null))['then'](function(_0x467769){if(_0x467769){return db[_0x329b('0x54')][_0x329b('0x55')](function(_0xafeb16){return db[_0x329b('0x56')]['destroy']({'where':{'userProfileId':_0x5bf714[_0x329b('0x47')]['id'],'sectionId':_[_0x329b('0x2f')](_0x3a3eae,function(_0x5187e5){return _0x5187e5[_0x329b('0x59')];})},'transaction':_0xafeb16})[_0x329b('0x28')](function(){var _0x2061f4=_[_0x329b('0x2f')](_0x3a3eae,function(_0x50a697){_0x50a697[_0x329b('0x5a')]=_0x5bf714['params']['id'];return _0x50a697;});var _0x5b686a=[];return BPromise[_0x329b('0x57')](_0x2061f4,function(_0x3f904e){return db[_0x329b('0x56')]['create'](_0x3f904e,{'include':[{'model':db['UserProfileResource'],'as':_0x329b('0x5b')}],'raw':!![],'transaction':_0xafeb16})[_0x329b('0x28')](function(_0x7d692c){_0x5b686a['push'](_0x7d692c[_0x329b('0x4f')]({'plain':!![]}));});})[_0x329b('0x28')](function(){return _0x5b686a;});});});}})[_0x329b('0x28')](function(_0x43d433){return _0x43d433;})['then'](respondWithResult(_0x192e2a,null))['catch'](handleError(_0x192e2a,null));};exports[_0x329b('0x5f')]=function(_0xfc7649,_0x30e8c6){var _0x536598;return db['UserProfile']['find']({'where':{'id':_0xfc7649['params']['id']},'attributes':['id',_0x329b('0x2d')]})[_0x329b('0x28')](handleEntityNotFound(_0x30e8c6,null))[_0x329b('0x28')](function(_0x32ab0b){if(_0x32ab0b){_0x536598=_0x32ab0b;return db[_0x329b('0x56')][_0x329b('0x5c')]({'where':{'userProfileId':_0xfc7649[_0x329b('0x47')]['id'],'sectionId':_0xfc7649[_0x329b('0x36')][_0x329b('0x60')]}});}})[_0x329b('0x28')](function(){return _0x536598;})[_0x329b('0x28')](respondWithStatusCode(_0x30e8c6,null))['catch'](handleError(_0x30e8c6,null));};exports[_0x329b('0x61')]=function(_0x3bd494,_0x39e0ea){var _0x2d4f56=[];var _0x230b11=[];return db[_0x329b('0x56')][_0x329b('0x44')]({'where':{'userProfileId':_0x3bd494[_0x329b('0x47')]['id']},'raw':!![]})[_0x329b('0x28')](function(_0x56bdb5){_0x2d4f56=_[_0x329b('0x42')](_0x56bdb5,function(_0x8501f7){return _0x8501f7['enabled']===0x1||_[_0x329b('0x62')]([0x3eb,0x709],_0x8501f7[_0x329b('0x59')]);});if(!_[_0x329b('0x63')](_0x2d4f56)){return _[_0x329b('0x2f')](_0x2d4f56,function(_0x39b31c){return _0x39b31c['sectionId'];});}else{return;}})[_0x329b('0x28')](function(_0x4e32a3){if(_0x4e32a3)_0x230b11=_0x4e32a3;if(_[_0x329b('0x62')](_0x230b11,0x64)){var _0x304f79=_['find'](_0x2d4f56,{'sectionId':0x64});return hasDefaultDashboard(_0x304f79)[_0x329b('0x28')](function(_0x28ba97){return _[_0x329b('0x2f')](_0x2d4f56,function(_0x43ce47){if(_0x43ce47['sectionId']===0x64){_0x43ce47[_0x329b('0x64')]=_0x28ba97;}return _0x43ce47;});});}else{return;}})[_0x329b('0x28')](function(_0x3efd72){if(_0x3efd72)_0x2d4f56=_0x3efd72;if(_[_0x329b('0x62')](_0x230b11,0x3eb)){var _0x476e5f=_['find'](_0x2d4f56,{'sectionId':0x3eb});return getCustomDashboards(_0x476e5f)[_0x329b('0x28')](function(_0x5bf0f9){return _['map'](_0x2d4f56,function(_0x1b12b2){if(_0x476e5f['enabled']){if(_0x1b12b2[_0x329b('0x59')]===0x3eb){_0x1b12b2[_0x329b('0x64')]=_0x5bf0f9;}}else{if(_0x1b12b2[_0x329b('0x59')]===0x64){_0x1b12b2[_0x329b('0x64')]=_0x5bf0f9;}}return _0x1b12b2;});});}else{return;}})[_0x329b('0x28')](function(_0x28f1a6){if(_0x28f1a6)_0x2d4f56=_0x28f1a6;if(_[_0x329b('0x62')](_0x230b11,0x709)){var _0x2a90ca=_['find'](_0x2d4f56,{'sectionId':0x709});return getPlugins(_0x2a90ca)[_0x329b('0x28')](function(_0x304fe0){if(_0x2a90ca['enabled']){return _['map'](_0x2d4f56,function(_0x31593c){if(_0x31593c[_0x329b('0x59')]===0x709){_0x31593c[_0x329b('0x64')]=_0x304fe0;}return _0x31593c;});}else{var _0x274f9f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x304fe0};var _0xa5b6b7=_[_0x329b('0x2f')](_0x2d4f56);_0xa5b6b7[_0x329b('0x65')](_0x274f9f);return _0xa5b6b7;}});}else{return;}})[_0x329b('0x28')](function(_0x71a507){if(_0x71a507)_0x2d4f56=_0x71a507;return _[_0x329b('0x42')](_0x2d4f56,[_0x329b('0x66'),0x1]);})[_0x329b('0x28')](respondWithResult(_0x39e0ea,null))[_0x329b('0x46')](handleError(_0x39e0ea,null));};function hasDefaultDashboard(_0x5bf668){var _0x5ac09c=[0x65];return new BPromise(function(_0x34fd66,_0x1b9bb5){try{if(_0x5bf668[_0x329b('0x58')]){_0x34fd66(_0x5ac09c);}else{return db['UserProfileResource'][_0x329b('0x67')]({'where':{'sectionId':_0x5bf668['id']},'raw':!![]})[_0x329b('0x28')](function(_0x97bce7){_0x97bce7?_0x34fd66(_0x5ac09c):_0x34fd66();});}}catch(_0x2dfbca){_0x1b9bb5(_0x2dfbca);}});}function getCustomDashboards(_0xad1e50){var _0x520f76=[];return new BPromise(function(_0x45b977,_0xf7bbe8){try{if(_0xad1e50[_0x329b('0x58')]){return db[_0x329b('0x68')][_0x329b('0x44')]({'raw':!![]})[_0x329b('0x28')](function(_0x36d4ba){_0x36d4ba[_0x329b('0x69')](function(_0x43a3e7){_0x520f76['push'](_0x43a3e7['id']+0x1869f);});_0x45b977(_0x520f76);});}else{return db[_0x329b('0x6a')][_0x329b('0x44')]({'where':{'sectionId':_0xad1e50['id']},'raw':!![]})[_0x329b('0x28')](function(_0x18577e){_0x18577e[_0x329b('0x69')](function(_0x3d4740){_0x520f76[_0x329b('0x65')](_0x3d4740[_0x329b('0x6b')]+0x1869f);});_0x45b977(_0x520f76);});}}catch(_0x794037){_0xf7bbe8(_0x794037);}});}function getPlugins(_0x4ad765){var _0x2415f7=[];return new BPromise(function(_0xa41445,_0x102e03){try{if(_0x4ad765[_0x329b('0x58')]){return db[_0x329b('0x6c')]['findAll']({'raw':!![]})['then'](function(_0x3062d0){_0x3062d0[_0x329b('0x69')](function(_0x239890){_0x2415f7[_0x329b('0x65')](_0x239890['id']+0x15b38);});_0xa41445(_0x2415f7);});}else{return db['UserProfileResource'][_0x329b('0x44')]({'where':{'sectionId':_0x4ad765['id']},'raw':!![]})[_0x329b('0x28')](function(_0x161c2d){_0x161c2d[_0x329b('0x69')](function(_0x217907){_0x2415f7['push'](_0x217907[_0x329b('0x6b')]+0x15b38);});_0xa41445(_0x2415f7);});}}catch(_0x2bc7d7){_0x102e03(_0x2bc7d7);}});}exports[_0x329b('0x6d')]=function(_0x5d1472,_0x508337){return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x5d1472['params']['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x508337,null))['then'](function(_0x44c39c){if(_0x44c39c){return db[_0x329b('0x54')][_0x329b('0x55')](function(_0x352e0e){return db[_0x329b('0x56')][_0x329b('0x44')]({'where':{'userProfileId':_0x5d1472[_0x329b('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x329b('0x28')](function(_0x17ad92){if(_0x17ad92){return db[_0x329b('0x56')][_0x329b('0x5c')]({'where':{'userProfileId':_0x5d1472[_0x329b('0x47')]['id'],'id':_['map'](_0x17ad92,function(_0x3dd483){return _0x3dd483['id'];})},'transaction':_0x352e0e});}})[_0x329b('0x28')](function(_0x40d2e2){var _0x200577=_[_0x329b('0x2f')](_0x5d1472['body'],function(_0xc6cfe1){_0xc6cfe1['userProfileId']=_0x5d1472[_0x329b('0x47')]['id'];return _0xc6cfe1;});return db['UserProfileSection']['bulkCreate'](_0x200577,{'raw':!![],'transaction':_0x352e0e});})[_0x329b('0x28')](function(_0x4cc0e5){var _0x4b0df8=_[_0x329b('0x42')](_[_0x329b('0x2f')](_0x4cc0e5,function(_0x29249d){return _0x29249d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4b0df8){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5d1472[_0x329b('0x47')]['id'],'sectionId':_[_0x329b('0x2f')](_0x4b0df8,function(_0x2620ba){return _0x2620ba[_0x329b('0x59')];})},'attributes':['id',_0x329b('0x59')],'raw':!![]})[_0x329b('0x28')](function(_0x2f1fd9){var _0x3cb01e=_['map'](_0x5d1472[_0x329b('0x4c')],function(_0x2cc08a){_0x2cc08a[_0x329b('0x5a')]=_0x5d1472[_0x329b('0x47')]['id'];return _0x2cc08a;});return db[_0x329b('0x6a')][_0x329b('0x6e')](_0x3cb01e,{'raw':!![],'transaction':_0x352e0e});});}})[_0x329b('0x46')](handleError(_0x508337,null));});}})[_0x329b('0x28')](function(_0x5437d6){var _0x361e3e=_[_0x329b('0x2f')](_0x5437d6,function(_0x56109e){return _0x56109e[_0x329b('0x4f')]({'plain':!![]});});})[_0x329b('0x28')](respondWithResult(_0x508337,null))[_0x329b('0x46')](handleError(_0x508337,null));};exports['removeResources']=function(_0x274d70,_0x561fac,_0x23982a){return db[_0x329b('0x30')][_0x329b('0x4a')]({'where':{'id':_0x274d70[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x561fac,null))[_0x329b('0x28')](function(_0x498bcb){if(_0x498bcb){return _0x498bcb[_0x329b('0x6f')](_0x274d70[_0x329b('0x36')][_0x329b('0x60')]);}})[_0x329b('0x28')](respondWithStatusCode(_0x561fac,null))[_0x329b('0x46')](handleError(_0x561fac,null));};exports[_0x329b('0x70')]=function(_0x4f707d,_0x44f9c2){var _0x49efbb={'raw':![],'where':{}};var _0x5aa8f4={};var _0x1bc416={'count':0x0,'rows':[]};var _0x52bcda=_0x4f707d[_0x329b('0x36')]['section'];if(typeof _0x52bcda===_0x329b('0x20')){throw new db['Sequelize'][(_0x329b('0x71'))](_0x329b('0x72'));}var _0x5658dc=_0x4f707d[_0x329b('0x36')][_0x329b('0x73')]||![];var _0x44cc7b=getQueryModels(_0x52bcda,_0x5658dc);if(typeof _0x44cc7b[_0x329b('0x74')]==='undefined'){throw new db['Sequelize']['ValidationError'](_0x329b('0x75')+_0x52bcda+'\x27');}var _0x439d31=[];if(!_[_0x329b('0x63')](_0x44cc7b['parentSections'])){_0x439d31=_0x44cc7b['parentSections'];}else{_0x439d31=[{'name':_0x52bcda}];}return db[_0x329b('0x30')][_0x329b('0x67')]({'where':{'id':_0x4f707d[_0x329b('0x47')]['id']}})[_0x329b('0x28')](handleEntityNotFound(_0x44f9c2,null))[_0x329b('0x28')](function(_0x157e4b){if(_0x157e4b){var _0x46e7b9=[];for(var _0xa393a7=0x0;_0xa393a7<_0x439d31['length'];_0xa393a7++){_0x46e7b9['push'](db[_0x329b('0x56')][_0x329b('0x67')]({'where':{'userProfileId':_0x157e4b['id'],'name':_0x439d31[_0xa393a7][_0x329b('0x2d')]},'raw':!![]}));}return BPromise[_0x329b('0x76')](_0x46e7b9);}})[_0x329b('0x28')](function(_0x460759){var _0x545b7f=_['filter'](_0x460759,function(_0x5a4df3){return _0x5a4df3?_0x5a4df3:undefined;});var _0x455768=_[_0x329b('0x42')](_0x439d31,[_0x329b('0x77'),!![]]);var _0x576e81=_[_0x329b('0x63')](_0x545b7f)&&_[_0x329b('0x63')](_0x455768)?null:_['union'](_0x455768,_0x545b7f);if(_0x576e81){var _0x4ab8a4=[];for(var _0x13ba32=0x0;_0x13ba32<_0x576e81[_0x329b('0x48')];_0x13ba32++){var _0x2b2433=_[_0x329b('0x4a')](_0x439d31,function(_0x4ae60b){return _0x576e81[_0x13ba32]?_0x4ae60b[_0x329b('0x2d')]===_0x576e81[_0x13ba32][_0x329b('0x2d')]:null;});if(_0x2b2433){if(_0x576e81[_0x13ba32][_0x329b('0x77')]){_0x4ab8a4[_0x329b('0x65')](getAllResources(_0x44cc7b[_0x329b('0x74')],_0x576e81[_0x13ba32]));}else{if(!_0x576e81[_0x13ba32][_0x329b('0x58')]){_0x4ab8a4[_0x329b('0x65')](getAllowedResources(_0x2b2433,_0x576e81[_0x13ba32],_0x44cc7b[_0x329b('0x74')]));}else{if(_0x2b2433[_0x329b('0x35')]){_0x4ab8a4['push'](getAllFilteredResources(_0x2b2433,_0x576e81[_0x13ba32]));}}}}}return BPromise[_0x329b('0x76')](_0x4ab8a4);}else{return null;}})[_0x329b('0x28')](function(_0x4fae2e){var _0xb16de3=_0x4fae2e;var _0x482806=null;if(_0xb16de3){_0x482806=_0xb16de3[_0x329b('0x48')]===0x1?_0xb16de3[0x0]:null;}if(_0x482806||_0xb16de3){var _0x5e7d16=db[_0x44cc7b['childModel']]['rawAttributes'];_0x5aa8f4['model']=_[_0x329b('0x37')](_0x5e7d16);_0x5aa8f4[_0x329b('0x36')]=_['keys'](_0x4f707d[_0x329b('0x36')]);_0x5aa8f4[_0x329b('0x38')]=_[_0x329b('0x3a')](_0x5aa8f4[_0x329b('0x35')],_0x5aa8f4[_0x329b('0x36')]);_0x49efbb[_0x329b('0x39')]=_[_0x329b('0x3a')](_0x5aa8f4[_0x329b('0x35')],qs[_0x329b('0x3b')](_0x4f707d[_0x329b('0x36')][_0x329b('0x3b')]));_0x49efbb[_0x329b('0x39')]=_0x49efbb[_0x329b('0x39')][_0x329b('0x48')]?_0x49efbb[_0x329b('0x39')]:_0x5aa8f4[_0x329b('0x35')];if(!_0x4f707d[_0x329b('0x36')][_0x329b('0x3c')](_0x329b('0x78'))){_0x49efbb[_0x329b('0x21')]=qs[_0x329b('0x21')](_0x4f707d[_0x329b('0x36')][_0x329b('0x21')]);_0x49efbb[_0x329b('0x1f')]=qs[_0x329b('0x1f')](_0x4f707d['query'][_0x329b('0x1f')]);}_0x49efbb[_0x329b('0x79')]=qs[_0x329b('0x3d')](_0x4f707d[_0x329b('0x36')][_0x329b('0x3d')]);_0x49efbb['where']=qs[_0x329b('0x38')](_['pick'](_0x4f707d[_0x329b('0x36')],_0x5aa8f4[_0x329b('0x38')]));if(_0x4f707d[_0x329b('0x36')][_0x329b('0x42')]){_0x49efbb[_0x329b('0x40')]=_['merge'](_0x49efbb[_0x329b('0x40')],{'$or':_['map'](_0x5e7d16,function(_0xa3177c){if(_0xa3177c[_0x329b('0x33')]['key']!==_0x329b('0x41')){var _0x904a14={};_0x904a14[_0xa3177c[_0x329b('0x7a')]]={'$like':'%'+_0x4f707d['query'][_0x329b('0x42')]+'%'};return _0x904a14;}})});}var _0x3ba693=[];if(_0x482806){var _0x3328ae=_[_0x329b('0x4a')](_0x439d31,[_0x329b('0x2d'),_0x482806[_0x329b('0x2d')]]);if(_0x3328ae[_0x329b('0x7a')]){var _0x58cace={};if(_0x44cc7b[_0x329b('0x74')]==='AnalyticExtractedReport'){_0x58cace[_0x3328ae[_0x329b('0x7b')]]=_[_0x329b('0x2f')](_0x482806[_0x329b('0x7c')],'id');}else{_0x58cace[_0x3328ae[_0x329b('0x7b')]]=_0x482806[_0x329b('0x7c')];}_0x3ba693[_0x329b('0x65')](_0x58cace);}else{_0x49efbb[_0x329b('0x40')]['id']=_0x482806['associatedResources'];}}else{for(var _0x3a7d10=0x0;_0x3a7d10<_0xb16de3[_0x329b('0x48')];_0x3a7d10++){var _0x3328ae=_[_0x329b('0x4a')](_0x439d31,[_0x329b('0x2d'),_0xb16de3[_0x3a7d10][_0x329b('0x2d')]]);if(_0x3328ae[_0x329b('0x7a')]){var _0x58cace={};_0x58cace[_0x3328ae[_0x329b('0x7b')]]=_0xb16de3[_0x3a7d10][_0x329b('0x7c')];_0x3ba693['push'](_0x58cace);}else{if(!_0x49efbb[_0x329b('0x40')]['id'])_0x49efbb[_0x329b('0x40')]['id']=[];_0xb16de3[_0x3a7d10][_0x329b('0x7c')][_0x329b('0x69')](function(_0x453c5a){_0x49efbb[_0x329b('0x40')]['id'][_0x329b('0x65')](_0x453c5a);});}}}if(!_[_0x329b('0x63')](_0x3ba693)){_0x49efbb[_0x329b('0x40')]=_[_0x329b('0x3f')](_0x49efbb['where'],{'$and':{'$or':_0x3ba693}});}_0x49efbb=_[_0x329b('0x3f')]({},_0x49efbb,_0x4f707d['options']);if(_0x482806&&!_0x482806['autoAssociation']&&_0x44cc7b[_0x329b('0x74')]===_0x329b('0x7d')){if(_0x4f707d['query']['includeAll']){_0x49efbb[_0x329b('0x43')]=[{'all':!![]}];}return db[_0x44cc7b[_0x329b('0x74')]]['findAll'](_0x49efbb)['then'](function(_0x1088bc){var _0x18f99e=[];_0x1088bc[_0x329b('0x69')](function(_0x55a377){var _0x97eee9;switch(_0x55a377[_0x329b('0x7e')]){case _0x329b('0x7f'):_0x97eee9=_[_0x329b('0x4a')](_0x482806['associatedResources'],function(_0x1aacbb){return _0x1aacbb['id']===_0x55a377[_0x329b('0x80')]&&_0x1aacbb['type']==='DefaultReports';});break;case _0x329b('0x81'):_0x97eee9=_['find'](_0x482806['associatedResources'],function(_0x466599){return _0x466599['id']===_0x55a377[_0x329b('0x80')]&&_0x466599[_0x329b('0x33')]==='CustomReports';});break;}if(_0x97eee9)_0x18f99e[_0x329b('0x65')](_0x55a377);});_0x1bc416[_0x329b('0x22')]=_0x18f99e[_0x329b('0x48')];_0x1bc416['rows']=_0x18f99e;return _0x1bc416;});}else{return db[_0x44cc7b[_0x329b('0x74')]][_0x329b('0x22')]({'where':_0x49efbb[_0x329b('0x40')]})[_0x329b('0x28')](function(_0x2bb131){_0x1bc416[_0x329b('0x22')]=_0x2bb131;if(_0x4f707d[_0x329b('0x36')]['includeAll']){if(_0x44cc7b[_0x329b('0x74')]===_0x329b('0x82')){_0x49efbb[_0x329b('0x43')]=[{'model':db[_0x329b('0x83')],'as':'Tags','attributes':['id',_0x329b('0x2d'),_0x329b('0x84')],'required':_0x4f707d['query']['tag']?!![]:![]},{'model':db[_0x329b('0x83')],'as':_0x329b('0x85'),'attributes':['id',_0x329b('0x2d'),_0x329b('0x84')],'through':_0x4f707d[_0x329b('0x36')][_0x329b('0x86')]?{'attributes':[],'where':{'TagId':_0x4f707d['query']['tag']||undefined}}:{},'required':_0x4f707d['query'][_0x329b('0x86')]?!![]:![]}];}else{_0x49efbb[_0x329b('0x43')]=[{'all':!![]}];}}return db[_0x44cc7b['childModel']][_0x329b('0x44')](_0x49efbb);})[_0x329b('0x28')](function(_0x4de1fc){_0x1bc416['rows']=_0x4de1fc;if(_0x52bcda===_0x329b('0x87')&&_0x4f707d[_0x329b('0x36')][_0x329b('0x88')]===_0x329b('0x89')){var _0x8ea6e6=[];for(var _0x28b449=0x0;_0x28b449<_0x1bc416[_0x329b('0x45')]['length'];_0x28b449++){_0x8ea6e6['push'](getOpenTabs('chat',_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs(_0x329b('0x8b'),_0x1bc416[_0x329b('0x45')][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs('fax',_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs('mail',_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs(_0x329b('0x8c'),_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));_0x8ea6e6[_0x329b('0x65')](getOpenTabs(_0x329b('0x8d'),_0x1bc416['rows'][_0x28b449][_0x329b('0x8a')]));}return Promise[_0x329b('0x76')](_0x8ea6e6)[_0x329b('0x28')](function(){return _0x1bc416;});}return _0x1bc416;});}}else{return _0x1bc416;}})[_0x329b('0x28')](respondWithFilteredResult(_0x44f9c2,_0x49efbb))[_0x329b('0x46')](handleError(_0x44f9c2,null));};function getOpenTabs(_0x3075a7,_0x49f70e){var _0x134289=_0x3075a7[_0x329b('0x8e')](0x0)[_0x329b('0x8f')]()+_0x3075a7[_0x329b('0x90')](0x1);var _0xc48158={'type':db[_0x329b('0x91')][_0x329b('0x92')][_0x329b('0x93')],'raw':!![]};return new BPromise(function(_0x25388f,_0x3aca4d){var _0x26fde9=squel[_0x329b('0x94')]()[_0x329b('0x7a')](_0x329b('0x95')+_0x134289+_0x329b('0x96'),'id')['field'](_0x329b('0x97'))[_0x329b('0x98')]('user_has_'+_0x3075a7+_0x329b('0x99'),'ui')[_0x329b('0x40')](_0x329b('0x9a'),_0x49f70e['id']);return db[_0x329b('0x54')]['query'](_0x26fde9[_0x329b('0x9b')](),_0xc48158)['then'](function(_0x10789b){_0x49f70e[_0x134289+_0x329b('0x9c')]=_0x10789b;_0x25388f(_0x10789b);})[_0x329b('0x46')](function(_0x58d006){_0x3aca4d(_0x58d006);});});}function getAllResources(_0x23c488,_0x107e07){return new BPromise(function(_0x44b830,_0x3bc7b4){if(_0x107e07){var _0x53ca02=_0x107e07['filter']?{[_0x107e07[_0x329b('0x42')][_0x329b('0x7a')]]:_0x107e07['filter']['value']}:undefined;return db[_0x23c488][_0x329b('0x44')]({'where':_0x53ca02,'raw':!![]})[_0x329b('0x28')](function(_0x5737d0){_0x107e07['associatedResources']=_[_0x329b('0x2f')](_0x5737d0,'id');_0x44b830(_0x107e07);})['catch'](function(_0x4b62f0){_0x3bc7b4(_0x4b62f0);});}else{_0x44b830(null);}});}function getAllFilteredResources(_0x440dc5,_0xdac82a){return new BPromise(function(_0x47f553,_0x16db25){var _0x4d97da=_0x440dc5[_0x329b('0x42')]?{[_0x440dc5[_0x329b('0x42')][_0x329b('0x7a')]]:_0x440dc5[_0x329b('0x42')][_0x329b('0x9d')]}:undefined;return db[_0x440dc5['model']]['findAll']({'where':_0x4d97da,'raw':!![]})[_0x329b('0x28')](function(_0x55f87c){_0xdac82a['associatedResources']=_[_0x329b('0x2f')](_0x55f87c,function(_0x185cb5){return _0x440dc5[_0x329b('0x7a')]?_0x185cb5[_0x440dc5[_0x329b('0x7a')]]:_0x185cb5[_0x329b('0x2d')];});_0x47f553(_0xdac82a);})[_0x329b('0x46')](function(_0xdc1f06){_0x16db25(_0xdc1f06);});});}function getAllowedResources(_0x523c18,_0x531f96,_0x288901){return new BPromise(function(_0x1dbec6,_0x1afcd4){if(_0x531f96){return db[_0x329b('0x6a')]['findAll']({'where':{'sectionId':_0x531f96['id']},'raw':!![]})[_0x329b('0x28')](function(_0x4988f7){if(_0x523c18[_0x329b('0x7a')]&&_0x523c18[_0x329b('0x7a')]!=='id'){_0x531f96[_0x329b('0x7c')]=_[_0x329b('0x2f')](_0x4988f7,function(_0x24208e){return _0x24208e[_0x523c18['field']];});}else{if(_0x288901===_0x329b('0x7d')){_0x531f96[_0x329b('0x7c')]=_[_0x329b('0x2f')](_0x4988f7,function(_0x1a635d){return{'id':_0x1a635d[_0x329b('0x6b')],'type':_0x1a635d['type']};});}else{_0x531f96[_0x329b('0x7c')]=_[_0x329b('0x2f')](_0x4988f7,function(_0x108ddb){return _0x108ddb[_0x329b('0x6b')];});}}_0x1dbec6(_0x531f96);})[_0x329b('0x46')](function(_0x5f02bf){_0x1afcd4(_0x5f02bf);});}else{_0x1dbec6(null);}});}function getQueryModels(_0x55ed19,_0x361e6d){var _0x425c03=_0x55ed19[_0x329b('0x9e')]();var _0xd3157={'childModel':undefined,'parentSections':[]};switch(_0x425c03){case'squareprojects':_0xd3157['childModel']=_0x329b('0x9f');break;case _0x329b('0xa0'):_0xd3157[_0x329b('0x74')]=_0x329b('0xa1');break;case _0x329b('0xa2'):_0xd3157[_0x329b('0x74')]=_0x329b('0xa3');_0xd3157['parentSections']=[{'name':_0x329b('0xa4'),'field':_0x329b('0x2d'),'foreignKey':_0x329b('0xa5')}];break;case _0x329b('0xa6'):_0xd3157[_0x329b('0x74')]=_0x329b('0xa7');break;case'contacts':_0xd3157[_0x329b('0x74')]=_0x329b('0x82');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0xa9'),'field':'id','foreignKey':'ListId'}];break;case _0x329b('0xaa'):_0xd3157[_0x329b('0x74')]=_0x329b('0xab');break;case _0x329b('0xac'):_0xd3157[_0x329b('0x74')]=_0x329b('0xad');break;case _0x329b('0xae'):_0xd3157[_0x329b('0x74')]=_0x329b('0xaf');break;case _0x329b('0xb0'):_0xd3157['childModel']=_0x329b('0xb1');break;case _0x329b('0xb2'):_0xd3157[_0x329b('0x74')]=_0x329b('0xb3');break;case'faxqueues':_0xd3157['childModel']=_0x329b('0xb4');break;case _0x329b('0xb5'):_0xd3157[_0x329b('0x74')]='FaxAccount';break;case'inboundroutes':case _0x329b('0xb6'):case _0x329b('0xb7'):_0xd3157[_0x329b('0x74')]=_0x329b('0xb8');break;case'contexts':_0xd3157['childModel']=_0x329b('0xb9');break;case _0x329b('0xba'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbb');break;case _0x329b('0xbc'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbd');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0x87'),'field':'name','foreignKey':_0x329b('0xbe'),'model':_0x329b('0xbf'),'filter':{'field':_0x329b('0xc0'),'value':['agent']}},{'name':_0x329b('0xc1'),'field':_0x329b('0x2d'),'foreignKey':_0x329b('0xbe'),'model':_0x329b('0xbf'),'filter':{'field':_0x329b('0xc0'),'value':[_0x329b('0xc2')]}},{'name':_0x329b('0xc3'),'field':'name','foreignKey':_0x329b('0xc4'),'model':'VoiceQueue','filter':{'field':_0x329b('0x33'),'value':[_0x329b('0xc5')]}},{'name':_0x329b('0xc6'),'field':_0x329b('0x2d'),'foreignKey':_0x329b('0xc4'),'model':_0x329b('0xc7'),'filter':{'field':'type','value':[_0x329b('0xc8')]}}];break;case _0x329b('0xc9'):_0xd3157[_0x329b('0x74')]='VoiceMusicOnHold';break;case'chanspies':_0xd3157[_0x329b('0x74')]=_0x329b('0xca');break;case'voiceprefixes':_0xd3157[_0x329b('0x74')]=_0x329b('0xcb');break;case _0x329b('0xcc'):_0xd3157[_0x329b('0x74')]=_0x329b('0xcd');break;case _0x329b('0xce'):_0xd3157[_0x329b('0x74')]=_0x329b('0xcf');break;case _0x329b('0xd0'):_0xd3157['childModel']=_0x329b('0xd1');break;case _0x329b('0xd2'):_0xd3157[_0x329b('0x74')]='MailSubstatus';break;case'openchannelqueues':_0xd3157[_0x329b('0x74')]=_0x329b('0xd3');break;case _0x329b('0xd4'):_0xd3157[_0x329b('0x74')]=_0x329b('0xd5');break;case'smsqueues':_0xd3157[_0x329b('0x74')]=_0x329b('0xd6');break;case'smsaccounts':_0xd3157[_0x329b('0x74')]='SmsAccount';break;case'whatsappqueues':_0xd3157[_0x329b('0x74')]=_0x329b('0xd7');break;case _0x329b('0xd8'):_0xd3157['childModel']=_0x329b('0xd9');break;case _0x329b('0xda'):case'queuecampaigns':_0xd3157['childModel']=_0x329b('0xc7');if(_0x361e6d){_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0xc3')},{'name':_0x329b('0xc6')}];}break;case _0x329b('0xdb'):case'agents':case _0x329b('0xdc'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbf');if(_0x361e6d){_0xd3157['parentSections']=[{'name':_0x329b('0xdd'),'filter':{'field':_0x329b('0xc0'),'value':[_0x329b('0xde'),_0x329b('0xdf')]},'ignore':!![]},{'name':_0x329b('0x87')},{'name':'Telephones'}];}break;case _0x329b('0xe0'):_0xd3157['childModel']=_0x329b('0xe1');break;case _0x329b('0xe2'):_0xd3157['childModel']=_0x329b('0xe3');break;case'freshdeskaccounts':_0xd3157['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0xd3157[_0x329b('0x74')]=_0x329b('0xe4');break;case'deskaccounts':_0xd3157['childModel']='DeskAccount';break;case'zohoaccounts':_0xd3157[_0x329b('0x74')]=_0x329b('0xe5');break;case _0x329b('0xe6'):_0xd3157[_0x329b('0x74')]=_0x329b('0xbf');break;case _0x329b('0xe7'):_0xd3157[_0x329b('0x74')]=_0x329b('0xe8');break;case'dispositions':_0xd3157[_0x329b('0x74')]=_0x329b('0xe9');break;case _0x329b('0xea'):_0xd3157[_0x329b('0x74')]=_0x329b('0x68');break;case'intervals':_0xd3157['childModel']=_0x329b('0xeb');break;case _0x329b('0xec'):_0xd3157[_0x329b('0x74')]='Pause';break;case _0x329b('0xed'):_0xd3157[_0x329b('0x74')]=_0x329b('0xee');break;case'sounds':_0xd3157[_0x329b('0x74')]=_0x329b('0xef');break;case _0x329b('0xf0'):_0xd3157[_0x329b('0x74')]=_0x329b('0x83');break;case'templates':_0xd3157['childModel']=_0x329b('0xf1');break;case _0x329b('0xf2'):_0xd3157[_0x329b('0x74')]=_0x329b('0xf3');break;case'trunks':_0xd3157[_0x329b('0x74')]=_0x329b('0xf4');break;case _0x329b('0xf5'):_0xd3157[_0x329b('0x74')]=_0x329b('0xf6');break;case _0x329b('0xf7'):_0xd3157['childModel']=_0x329b('0x6c');break;case _0x329b('0xf8'):_0xd3157[_0x329b('0x74')]=_0x329b('0x7d');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0xf9'),'field':'id','foreignKey':_0x329b('0x80')}];break;case _0x329b('0xfa'):_0xd3157[_0x329b('0x74')]=_0x329b('0xfb');break;case'whatsappaccounts':_0xd3157['childModel']=_0x329b('0xfc');break;case _0x329b('0xfd'):_0xd3157[_0x329b('0x74')]=_0x329b('0xfe');_0xd3157[_0x329b('0xa8')]=[{'name':_0x329b('0x87'),'field':'id','foreignKey':_0x329b('0xff'),'model':_0x329b('0xbf'),'filter':{'field':'role','value':['agent']}},{'name':_0x329b('0xc1'),'field':'id','foreignKey':'UserId','model':_0x329b('0xbf'),'filter':{'field':_0x329b('0xc0'),'value':[_0x329b('0xc2')]}}];break;default:return _0xd3157;}return _0xd3157;}
\ No newline at end of file
index 7e74056..34ce6a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0650=['update','emit','exports','events','UserProfile','setMaxListeners'];(function(_0x5e1efa,_0x5ea321){var _0x276a77=function(_0x23746d){while(--_0x23746d){_0x5e1efa['push'](_0x5e1efa['shift']());}};_0x276a77(++_0x5ea321);}(_0x0650,0xed));var _0x0065=function(_0x3700a5,_0x4097c6){_0x3700a5=_0x3700a5-0x0;var _0x2d740b=_0x0650[_0x3700a5];return _0x2d740b;};'use strict';var EventEmitter=require(_0x0065('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x0065('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0065('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0065('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2e05a4){return function(_0x8260ba,_0x3dd8c6,_0x4b15b1){UserProfileEvents[_0x0065('0x4')](_0x2e05a4+':'+_0x8260ba['id'],_0x8260ba);UserProfileEvents['emit'](_0x2e05a4,_0x8260ba);_0x4b15b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x0065('0x5')]=UserProfileEvents;
\ No newline at end of file
+var _0x6691=['hook','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x13caf0,_0x20968f){var _0xec2b52=function(_0x894df5){while(--_0x894df5){_0x13caf0['push'](_0x13caf0['shift']());}};_0xec2b52(++_0x20968f);}(_0x6691,0x12d));var _0x1669=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x6691[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x1669('0x0'));var UserProfile=require(_0x1669('0x1'))['db'][_0x1669('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x1669('0x3')](0x0);var events={'afterCreate':_0x1669('0x4'),'afterUpdate':_0x1669('0x5'),'afterDestroy':_0x1669('0x6')};function emitEvent(_0x455cbd){return function(_0x19a3f5,_0x2ad807,_0x4b41a5){UserProfileEvents[_0x1669('0x7')](_0x455cbd+':'+_0x19a3f5['id'],_0x19a3f5);UserProfileEvents[_0x1669('0x7')](_0x455cbd,_0x19a3f5);_0x4b41a5(null);};}for(var e in events){if(events[_0x1669('0x8')](e)){var event=events[e];UserProfile[_0x1669('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 24a3340..7e68a59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['user_profiles','models','User','update','then','catch','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userProfile.attributes','exports','define','UserProfile'];(function(_0x533f0c,_0xd40d98){var _0x19b86c=function(_0x1dccc5){while(--_0x1dccc5){_0x533f0c['push'](_0x533f0c['shift']());}};_0x19b86c(++_0xd40d98);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'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':!![],'hooks':{'afterUpdate':function(_0x225610,_0x2f99ed,_0x3e6368){var _0x2a66cb=_0x3fe47c[_0x7721('0xc')];_0x2a66cb[_0x7721('0xd')][_0x7721('0xe')]({'privacyEnabled':_0x225610['privacyEnabled']},{'where':{'UserProfileId':_0x225610['id']}})[_0x7721('0xf')](function(){_0x3e6368();})[_0x7721('0x10')](function(_0x8729a6){_0x3e6368(_0x8729a6);});}}});};
\ No newline at end of file
+var _0x34e8=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','UserProfile','user_profiles','models','User','update','privacyEnabled','then','catch','lodash','util','../../config/logger','api'];(function(_0x32277d,_0x33f58b){var _0x318418=function(_0x5a4dff){while(--_0x5a4dff){_0x32277d['push'](_0x32277d['shift']());}};_0x318418(++_0x33f58b);}(_0x34e8,0x12c));var _0x834e=function(_0x3f65b2,_0x1b2e39){_0x3f65b2=_0x3f65b2-0x0;var _0x2a6ef7=_0x34e8[_0x3f65b2];return _0x2a6ef7;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3a3ef6,_0x2e69e2,_0x33ea05){var _0x23501c=_0x4a2018[_0x834e('0xd')];_0x23501c[_0x834e('0xe')][_0x834e('0xf')]({'privacyEnabled':_0x3a3ef6[_0x834e('0x10')]},{'where':{'UserProfileId':_0x3a3ef6['id']}})[_0x834e('0x11')](function(){_0x33ea05();})[_0x834e('0x12')](function(_0x14038b){_0x33ea05(_0x14038b);});}}});};
\ No newline at end of file
index 4dbd9b3..623c839 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd6=['../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x363f05,_0x4b6f15){var _0x2f86d3=function(_0x49acc8){while(--_0x49acc8){_0x363f05['push'](_0x363f05['shift']());}};_0x2f86d3(++_0x4b6f15);}(_0xffd6,0x97));var _0x6ffd=function(_0x2bcddb,_0x3eaf37){_0x2bcddb=_0x2bcddb-0x0;var _0x12a9e8=_0xffd6[_0x2bcddb];return _0x12a9e8;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});config[_0x6ffd('0xa')]=_[_0x6ffd('0xb')](config[_0x6ffd('0xa')],{'host':_0x6ffd('0xc'),'port':0x18eb});var socket=require(_0x6ffd('0xd'))(new Redis(config['redis']));require(_0x6ffd('0xe'))[_0x6ffd('0xf')](socket);function respondWithRpcPromise(_0x4e57f5,_0x469d0d,_0x38fc68){return new BPromise(function(_0x23f7f2,_0x3dda1e){return client[_0x6ffd('0x10')](_0x4e57f5,_0x38fc68)[_0x6ffd('0x11')](function(_0x836501){logger['info'](_0x6ffd('0x12'),_0x469d0d,_0x6ffd('0x13'));logger['debug'](_0x6ffd('0x14'),_0x469d0d,_0x6ffd('0x13'),JSON[_0x6ffd('0x15')](_0x836501));if(_0x836501[_0x6ffd('0x16')]){if(_0x836501['error'][_0x6ffd('0x17')]===0x1f4){logger['error'](_0x6ffd('0x12'),_0x469d0d,_0x836501['error'][_0x6ffd('0x18')]);return _0x3dda1e(_0x836501[_0x6ffd('0x16')][_0x6ffd('0x18')]);}logger['error'](_0x6ffd('0x12'),_0x469d0d,_0x836501[_0x6ffd('0x16')][_0x6ffd('0x18')]);return _0x23f7f2(_0x836501[_0x6ffd('0x16')][_0x6ffd('0x18')]);}else{logger[_0x6ffd('0x19')](_0x6ffd('0x12'),_0x469d0d,_0x6ffd('0x13'));_0x23f7f2(_0x836501['result'][_0x6ffd('0x18')]);}})['catch'](function(_0x587d0b){logger[_0x6ffd('0x16')](_0x6ffd('0x12'),_0x469d0d,_0x587d0b);_0x3dda1e(_0x587d0b);});});}
\ No newline at end of file
+var _0xa329=['request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','then'];(function(_0x2c6ac4,_0x306af6){var _0x425a34=function(_0x1f3640){while(--_0x1f3640){_0x2c6ac4['push'](_0x2c6ac4['shift']());}};_0x425a34(++_0x306af6);}(_0xa329,0x162));var _0x9a32=function(_0x43fa75,_0x419220){_0x43fa75=_0x43fa75-0x0;var _0x40e9b2=_0xa329[_0x43fa75];return _0x40e9b2;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var moment=require('moment');var BPromise=require(_0x9a32('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a32('0x3'));var db=require(_0x9a32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a32('0x5'));var config=require(_0x9a32('0x6'));var jayson=require(_0x9a32('0x7'));var client=jayson[_0x9a32('0x8')][_0x9a32('0x9')]({'port':0x232a});config[_0x9a32('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9a32('0xb'))(new Redis(config[_0x9a32('0xa')]));require('./userProfile.socket')[_0x9a32('0xc')](socket);function respondWithRpcPromise(_0x184a41,_0x231d97,_0x452146){return new BPromise(function(_0x3e5cda,_0x16d821){return client['request'](_0x184a41,_0x452146)[_0x9a32('0xd')](function(_0x25c5b8){logger['info']('UserProfile,\x20%s,\x20%s',_0x231d97,_0x9a32('0xe'));logger[_0x9a32('0xf')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x231d97,'request\x20sent',JSON[_0x9a32('0x10')](_0x25c5b8));if(_0x25c5b8[_0x9a32('0x11')]){if(_0x25c5b8[_0x9a32('0x11')][_0x9a32('0x12')]===0x1f4){logger['error'](_0x9a32('0x13'),_0x231d97,_0x25c5b8[_0x9a32('0x11')]['message']);return _0x16d821(_0x25c5b8[_0x9a32('0x11')][_0x9a32('0x14')]);}logger[_0x9a32('0x11')](_0x9a32('0x13'),_0x231d97,_0x25c5b8[_0x9a32('0x11')][_0x9a32('0x14')]);return _0x3e5cda(_0x25c5b8['error'][_0x9a32('0x14')]);}else{logger[_0x9a32('0x15')](_0x9a32('0x13'),_0x231d97,'request\x20sent');_0x3e5cda(_0x25c5b8[_0x9a32('0x16')][_0x9a32('0x14')]);}})['catch'](function(_0x598592){logger[_0x9a32('0x11')](_0x9a32('0x13'),_0x231d97,_0x598592);_0x16d821(_0x598592);});});}
\ No newline at end of file
index 5db4e66..71da430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb20=['userProfile:','./userProfile.events','remove','update','removeListener','register','length'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xeb20,0x143));var _0x0eb2=function(_0x7086d1,_0x16fbdd){_0x7086d1=_0x7086d1-0x0;var _0x300ce7=_0xeb20[_0x7086d1];return _0x300ce7;};'use strict';var UserProfileEvents=require(_0x0eb2('0x0'));var events=['save',_0x0eb2('0x1'),_0x0eb2('0x2')];function createListener(_0x31670a,_0x51a531){return function(_0xa2c38d){_0x51a531['emit'](_0x31670a,_0xa2c38d);};}function removeListener(_0x5b5a59,_0x3623f4){return function(){UserProfileEvents[_0x0eb2('0x3')](_0x5b5a59,_0x3623f4);};}exports[_0x0eb2('0x4')]=function(_0x2f35ba){for(var _0x379f4f=0x0,_0x198d7e=events[_0x0eb2('0x5')];_0x379f4f<_0x198d7e;_0x379f4f++){var _0x1b16ca=events[_0x379f4f];var _0x2caea3=createListener(_0x0eb2('0x6')+_0x1b16ca,_0x2f35ba);UserProfileEvents['on'](_0x1b16ca,_0x2caea3);}};
\ No newline at end of file
+var _0xcab0=['remove','update','emit','register','userProfile:','./userProfile.events','save'];(function(_0x4dba7a,_0x3bb6e2){var _0x5c1b51=function(_0x4c5e00){while(--_0x4c5e00){_0x4dba7a['push'](_0x4dba7a['shift']());}};_0x5c1b51(++_0x3bb6e2);}(_0xcab0,0xec));var _0x0cab=function(_0x1ce382,_0x5b5e65){_0x1ce382=_0x1ce382-0x0;var _0x527ac6=_0xcab0[_0x1ce382];return _0x527ac6;};'use strict';var UserProfileEvents=require(_0x0cab('0x0'));var events=[_0x0cab('0x1'),_0x0cab('0x2'),_0x0cab('0x3')];function createListener(_0x3b91cb,_0x54e2f5){return function(_0x343744){_0x54e2f5[_0x0cab('0x4')](_0x3b91cb,_0x343744);};}function removeListener(_0x17555c,_0x4bf44e){return function(){UserProfileEvents['removeListener'](_0x17555c,_0x4bf44e);};}exports[_0x0cab('0x5')]=function(_0x2bf769){for(var _0x350a62=0x0,_0x580857=events['length'];_0x350a62<_0x580857;_0x350a62++){var _0x19753b=events[_0x350a62];var _0x4f17e5=createListener(_0x0cab('0x6')+_0x19753b,_0x2bf769);UserProfileEvents['on'](_0x19753b,_0x4f17e5);}};
\ No newline at end of file
index e495e7b..d743f2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0990=['./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0xd58928,_0x34d753){var _0xb2e1c1=function(_0x55dc3f){while(--_0x55dc3f){_0xd58928['push'](_0xd58928['shift']());}};_0xb2e1c1(++_0x34d753);}(_0x0990,0x1c5));var _0x0099=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x0990[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0099('0x0'));var util=require(_0x0099('0x1'));var path=require(_0x0099('0x2'));var timeout=require(_0x0099('0x3'));var express=require(_0x0099('0x4'));var router=express[_0x0099('0x5')]();var fs_extra=require(_0x0099('0x6'));var auth=require(_0x0099('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0099('0x8'));var controller=require(_0x0099('0x9'));router[_0x0099('0xa')]('/',auth['isAuthenticated'](),controller[_0x0099('0xb')]);router[_0x0099('0xa')](_0x0099('0xc'),auth[_0x0099('0xd')](),controller[_0x0099('0xe')]);router[_0x0099('0xa')](_0x0099('0xf'),auth[_0x0099('0xd')](),controller[_0x0099('0x10')]);router['post']('/',auth[_0x0099('0xd')](),controller[_0x0099('0x11')]);router[_0x0099('0x12')]('/:id',auth[_0x0099('0xd')](),controller[_0x0099('0x13')]);router[_0x0099('0x14')](_0x0099('0xf'),auth[_0x0099('0xd')](),controller[_0x0099('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x4c1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x418c43,_0x404dc4){var _0x2efb1c=function(_0x94ba5b){while(--_0x94ba5b){_0x418c43['push'](_0x418c43['shift']());}};_0x2efb1c(++_0x404dc4);}(_0x4c1b,0x1c8));var _0xb4c1=function(_0x13446a,_0x28a1a6){_0x13446a=_0x13446a-0x0;var _0x202947=_0x4c1b[_0x13446a];return _0x202947;};'use strict';var multer=require(_0xb4c1('0x0'));var util=require(_0xb4c1('0x1'));var path=require(_0xb4c1('0x2'));var timeout=require(_0xb4c1('0x3'));var express=require(_0xb4c1('0x4'));var router=express[_0xb4c1('0x5')]();var fs_extra=require(_0xb4c1('0x6'));var auth=require(_0xb4c1('0x7'));var interaction=require(_0xb4c1('0x8'));var config=require(_0xb4c1('0x9'));var controller=require(_0xb4c1('0xa'));router['get']('/',auth[_0xb4c1('0xb')](),controller[_0xb4c1('0xc')]);router['get'](_0xb4c1('0xd'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0xe')]);router[_0xb4c1('0xf')](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x11')]);router['post']('/',auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x12')]);router['put'](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x13')]);router['delete'](_0xb4c1('0x10'),auth[_0xb4c1('0xb')](),controller[_0xb4c1('0x14')]);module[_0xb4c1('0x15')]=router;
\ No newline at end of file
index 5ca9758..5d269e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x791e=['exports','STRING','INTEGER'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x791e,0x195));var _0xe791=function(_0x117068,_0x59a2c8){_0x117068=_0x117068-0x0;var _0x2ebacc=_0x791e[_0x117068];return _0x2ebacc;};'use strict';var Sequelize=require('sequelize');module[_0xe791('0x0')]={'name':{'type':Sequelize[_0xe791('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe791('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe791('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x47ce=['INTEGER','STRING','sequelize','exports'];(function(_0x273b1a,_0x2d12d7){var _0x3d3e9a=function(_0x3808a9){while(--_0x3808a9){_0x273b1a['push'](_0x273b1a['shift']());}};_0x3d3e9a(++_0x2d12d7);}(_0x47ce,0xe6));var _0xe47c=function(_0x562525,_0x5a5e52){_0x562525=_0x562525-0x0;var _0x4ec0bd=_0x47ce[_0x562525];return _0x4ec0bd;};'use strict';var Sequelize=require(_0xe47c('0x0'));module[_0xe47c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe47c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe47c('0x3')],'allowNull':![]}};
\ No newline at end of file
index 031ca60..09ccfef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','UserProfileResource','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','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2ed501,_0x17636a){var _0x293b1a=function(_0x51d262){while(--_0x51d262){_0x2ed501['push'](_0x2ed501['shift']());}};_0x293b1a(++_0x17636a);}(_0x1261,0x144));var _0x1126=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x1261[_0xcc26d2];return _0x3841e2;};'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['UserProfileResource'][_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['UserProfileResource']['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));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));};
\ No newline at end of file
+var _0x33af=['findAll','rows','catch','show','params','length','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','merge','VIRTUAL','filter','includeAll'];(function(_0x15b76f,_0x1f686f){var _0x572d0c=function(_0x7a17cd){while(--_0x7a17cd){_0x15b76f['push'](_0x15b76f['shift']());}};_0x572d0c(++_0x1f686f);}(_0x33af,0xec));var _0xf33a=function(_0x4a3554,_0x14f2fd){_0x4a3554=_0x4a3554-0x0;var _0x12e4cb=_0x33af[_0x4a3554];return _0x12e4cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['UserProfileResource'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};exports[_0xf33a('0x4a')]=function(_0xd40707,_0x36cba8){return db['UserProfileResource'][_0xf33a('0x4a')]()[_0xf33a('0x26')](respondWithResult(_0x36cba8,null))[_0xf33a('0x42')](handleError(_0x36cba8,null));};
\ No newline at end of file
index 7044583..a0d0f40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98ef=['user_profile_has_resources','compositeIndex','resourceId','lodash','util','moment','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource'];(function(_0x744520,_0x5c9622){var _0x3c4fd7=function(_0x1e13b9){while(--_0x1e13b9){_0x744520['push'](_0x744520['shift']());}};_0x3c4fd7(++_0x5c9622);}(_0x98ef,0x16b));var _0xf98e=function(_0x2eb26d,_0x5d9b72){_0x2eb26d=_0x2eb26d-0x0;var _0x3b2066=_0x98ef[_0x2eb26d];return _0x3b2066;};'use strict';var _=require(_0xf98e('0x0'));var util=require(_0xf98e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf98e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf98e('0x3'));var config=require(_0xf98e('0x4'));var attributes=require(_0xf98e('0x5'));module['exports']=function(_0x35d3ff,_0x41eaf2){return _0x35d3ff['define'](_0xf98e('0x6'),attributes,{'tableName':_0xf98e('0x7'),'paranoid':![],'indexes':[{'name':_0xf98e('0x8'),'fields':[_0xf98e('0x9'),'sectionId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47b1=['define','UserProfileResource','user_profile_has_resources','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5a9716,_0x1c6a6b){var _0x3f5e33=function(_0x4ac761){while(--_0x4ac761){_0x5a9716['push'](_0x5a9716['shift']());}};_0x3f5e33(++_0x1c6a6b);}(_0x47b1,0xab));var _0x147b=function(_0x342c39,_0x17c253){_0x342c39=_0x342c39-0x0;var _0x229347=_0x47b1[_0x342c39];return _0x229347;};'use strict';var _=require('lodash');var util=require(_0x147b('0x0'));var logger=require('../../config/logger')(_0x147b('0x1'));var moment=require(_0x147b('0x2'));var BPromise=require(_0x147b('0x3'));var rp=require(_0x147b('0x4'));var fs=require('fs');var path=require(_0x147b('0x5'));var rimraf=require(_0x147b('0x6'));var config=require(_0x147b('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x147b('0x8')]=function(_0x574abd,_0x3e6bcc){return _0x574abd[_0x147b('0x9')](_0x147b('0xa'),attributes,{'tableName':_0x147b('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});};
\ No newline at end of file
index 9807f75..0e1beb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd391=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xd391,0x1a5));var _0x1d39=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xd391[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x1d39('0x0'));var util=require(_0x1d39('0x1'));var moment=require(_0x1d39('0x2'));var BPromise=require(_0x1d39('0x3'));var rs=require(_0x1d39('0x4'));var fs=require('fs');var Redis=require(_0x1d39('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d39('0x6'));var logger=require(_0x1d39('0x7'))(_0x1d39('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d39('0x9'));var client=jayson[_0x1d39('0xa')][_0x1d39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46b160,_0x9173ad,_0x2566fa){return new BPromise(function(_0x232ef4,_0x56b94d){return client[_0x1d39('0xc')](_0x46b160,_0x2566fa)[_0x1d39('0xd')](function(_0x23d928){logger[_0x1d39('0xe')](_0x1d39('0xf'),_0x9173ad,_0x1d39('0x10'));logger[_0x1d39('0x11')](_0x1d39('0x12'),_0x9173ad,_0x1d39('0x10'),JSON[_0x1d39('0x13')](_0x23d928));if(_0x23d928[_0x1d39('0x14')]){if(_0x23d928[_0x1d39('0x14')][_0x1d39('0x15')]===0x1f4){logger[_0x1d39('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x9173ad,_0x23d928[_0x1d39('0x14')][_0x1d39('0x16')]);return _0x56b94d(_0x23d928[_0x1d39('0x14')]['message']);}logger[_0x1d39('0x14')](_0x1d39('0xf'),_0x9173ad,_0x23d928[_0x1d39('0x14')]['message']);return _0x232ef4(_0x23d928[_0x1d39('0x14')]['message']);}else{logger[_0x1d39('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x9173ad,'request\x20sent');_0x232ef4(_0x23d928['result'][_0x1d39('0x16')]);}})['catch'](function(_0x26c119){logger[_0x1d39('0x14')](_0x1d39('0xf'),_0x9173ad,_0x26c119);_0x56b94d(_0x26c119);});});}
\ No newline at end of file
+var _0x9d37=['client','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x9d37,0xf3));var _0x79d3=function(_0x478397,_0x55e0a1){_0x478397=_0x478397-0x0;var _0x260167=_0x9d37[_0x478397];return _0x260167;};'use strict';var _=require(_0x79d3('0x0'));var util=require(_0x79d3('0x1'));var moment=require('moment');var BPromise=require(_0x79d3('0x2'));var rs=require(_0x79d3('0x3'));var fs=require('fs');var Redis=require(_0x79d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79d3('0x5'));var logger=require(_0x79d3('0x6'))(_0x79d3('0x7'));var config=require(_0x79d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x79d3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x214166,_0x4741b4,_0x5a0a6f){return new BPromise(function(_0x5a7894,_0x518973){return client[_0x79d3('0xa')](_0x214166,_0x5a0a6f)['then'](function(_0x2a6a9b){logger[_0x79d3('0xb')](_0x79d3('0xc'),_0x4741b4,_0x79d3('0xd'));logger[_0x79d3('0xe')](_0x79d3('0xf'),_0x4741b4,_0x79d3('0xd'),JSON[_0x79d3('0x10')](_0x2a6a9b));if(_0x2a6a9b['error']){if(_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x12')]===0x1f4){logger[_0x79d3('0x11')](_0x79d3('0xc'),_0x4741b4,_0x2a6a9b[_0x79d3('0x11')]['message']);return _0x518973(_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x13')]);}logger[_0x79d3('0x11')](_0x79d3('0xc'),_0x4741b4,_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x13')]);return _0x5a7894(_0x2a6a9b[_0x79d3('0x11')][_0x79d3('0x13')]);}else{logger[_0x79d3('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x4741b4,_0x79d3('0xd'));_0x5a7894(_0x2a6a9b['result'][_0x79d3('0x13')]);}})[_0x79d3('0x14')](function(_0x13c482){logger[_0x79d3('0x11')](_0x79d3('0xc'),_0x4741b4,_0x13c482);_0x518973(_0x13c482);});});}
\ No newline at end of file
index 7b133eb..d80b678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7742=['get','/describe','describe','/:id','post','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0x7742,0x13b));var _0x2774=function(_0x482049,_0x1623c1){_0x482049=_0x482049-0x0;var _0x3563d1=_0x7742[_0x482049];return _0x3563d1;};'use strict';var multer=require(_0x2774('0x0'));var util=require(_0x2774('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2774('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2774('0x3'));var interaction=require(_0x2774('0x4'));var config=require(_0x2774('0x5'));var controller=require(_0x2774('0x6'));router['get']('/',auth[_0x2774('0x7')](),controller[_0x2774('0x8')]);router[_0x2774('0x9')](_0x2774('0xa'),auth[_0x2774('0x7')](),controller[_0x2774('0xb')]);router[_0x2774('0x9')](_0x2774('0xc'),auth[_0x2774('0x7')](),controller['show']);router[_0x2774('0xd')]('/',auth[_0x2774('0x7')](),controller['create']);router['put'](_0x2774('0xc'),auth[_0x2774('0x7')](),controller[_0x2774('0xe')]);router[_0x2774('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2774('0x10')]);module[_0x2774('0x11')]=router;
\ No newline at end of file
+var _0x0ee1=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/describe','isAuthenticated','/:id','show','post','put','delete','destroy','exports'];(function(_0x51d6a0,_0x136f65){var _0x1194ce=function(_0x27a3b8){while(--_0x27a3b8){_0x51d6a0['push'](_0x51d6a0['shift']());}};_0x1194ce(++_0x136f65);}(_0x0ee1,0x10a));var _0x10ee=function(_0x451f88,_0x5c061a){_0x451f88=_0x451f88-0x0;var _0x2cc2b7=_0x0ee1[_0x451f88];return _0x2cc2b7;};'use strict';var multer=require(_0x10ee('0x0'));var util=require(_0x10ee('0x1'));var path=require(_0x10ee('0x2'));var timeout=require(_0x10ee('0x3'));var express=require(_0x10ee('0x4'));var router=express[_0x10ee('0x5')]();var fs_extra=require(_0x10ee('0x6'));var auth=require(_0x10ee('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x10ee('0x8')]('/',auth['isAuthenticated'](),controller[_0x10ee('0x9')]);router['get'](_0x10ee('0xa'),auth[_0x10ee('0xb')](),controller['describe']);router[_0x10ee('0x8')](_0x10ee('0xc'),auth[_0x10ee('0xb')](),controller[_0x10ee('0xd')]);router[_0x10ee('0xe')]('/',auth[_0x10ee('0xb')](),controller['create']);router[_0x10ee('0xf')](_0x10ee('0xc'),auth[_0x10ee('0xb')](),controller['update']);router[_0x10ee('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x10ee('0x11')]);module[_0x10ee('0x12')]=router;
\ No newline at end of file
index 0309474..742fa3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb4=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split','sequelize'];(function(_0x285789,_0x133a5b){var _0x5d397d=function(_0x384959){while(--_0x384959){_0x285789['push'](_0x285789['shift']());}};_0x5d397d(++_0x133a5b);}(_0x6cb4,0xff));var _0x46cb=function(_0x5ef25a,_0x5913c3){_0x5ef25a=_0x5ef25a-0x0;var _0x4fcecf=_0x6cb4[_0x5ef25a];return _0x4fcecf;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'name':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x46cb('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x46cb('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x46cb('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x46cb('0x2')],'set':function(_0x2efd19){this['setDataValue'](_0x46cb('0x5'),_0x2efd19?_0x2efd19['join'](''):[]);},'get':function(){return this[_0x46cb('0x6')]('crudPermissions')?this[_0x46cb('0x6')](_0x46cb('0x5'))[_0x46cb('0x7')](''):[];}}};
\ No newline at end of file
+var _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x3e5fce,_0x15b2ef){var _0x3c7786=function(_0x2b18aa){while(--_0x2b18aa){_0x3e5fce['push'](_0x3e5fce['shift']());}};_0x3c7786(++_0x15b2ef);}(_0xe511,0x16f));var _0x1e51=function(_0x10fe9e,_0x5514b4){_0x10fe9e=_0x10fe9e-0x0;var _0x29ef86=_0xe511[_0x10fe9e];return _0x29ef86;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x1e51('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x1e51('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x42e242){this[_0x1e51('0x4')](_0x1e51('0x5'),_0x42e242?_0x42e242[_0x1e51('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x1e51('0x5'))?this[_0x1e51('0x7')]('crudPermissions')['split'](''):[];}}};
\ No newline at end of file
index 7c9c338..d132cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0fa=['VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','merge','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter'];(function(_0x3c177d,_0x319367){var _0x4e0c82=function(_0x4a04e1){while(--_0x4a04e1){_0x3c177d['push'](_0x3c177d['shift']());}};_0x4e0c82(++_0x319367);}(_0xd0fa,0x19f));var _0xad0f=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xd0fa[_0x20589d];return _0x422de9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad0f('0x1'));var rp=require(_0xad0f('0x2'));var moment=require(_0xad0f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad0f('0x4'));var util=require('util');var path=require(_0xad0f('0x5'));var sox=require(_0xad0f('0x6'));var csv=require(_0xad0f('0x7'));var ejs=require(_0xad0f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad0f('0x9'));var squel=require(_0xad0f('0xa'));var crypto=require(_0xad0f('0xb'));var jsforce=require(_0xad0f('0xc'));var deskjs=require(_0xad0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xad0f('0xe'));var Papa=require(_0xad0f('0xf'));var Redis=require(_0xad0f('0x10'));var authService=require(_0xad0f('0x11'));var qs=require(_0xad0f('0x12'));var as=require(_0xad0f('0x13'));var hardwareService=require(_0xad0f('0x14'));var logger=require(_0xad0f('0x15'))(_0xad0f('0x16'));var utils=require(_0xad0f('0x17'));var config=require(_0xad0f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x266d28,_0x139231){_0x139231=_0x139231||0xcc;return function(_0x30aecc){if(_0x30aecc){return _0x266d28[_0xad0f('0x19')](_0x139231);}return _0x266d28[_0xad0f('0x1a')](_0x139231)[_0xad0f('0x1b')]();};}function respondWithResult(_0x250c67,_0xa11b4e){_0xa11b4e=_0xa11b4e||0xc8;return function(_0x1318bd){if(_0x1318bd){return _0x250c67[_0xad0f('0x1a')](_0xa11b4e)['json'](_0x1318bd);}};}function respondWithFilteredResult(_0x4181da,_0x2eda72){return function(_0xeba7e){if(_0xeba7e){var _0x53b130=typeof _0x2eda72['offset']===_0xad0f('0x1c')&&typeof _0x2eda72['limit']===_0xad0f('0x1c');var _0x2c5e7e=_0xeba7e[_0xad0f('0x1d')];var _0x3d5488=_0x53b130?0x0:_0x2eda72[_0xad0f('0x1e')];var _0x139d7d=_0x53b130?_0xeba7e[_0xad0f('0x1d')]:_0x2eda72[_0xad0f('0x1e')]+_0x2eda72[_0xad0f('0x1f')];var _0x4bb642;if(_0x139d7d>=_0x2c5e7e){_0x139d7d=_0x2c5e7e;_0x4bb642=0xc8;}else{_0x4bb642=0xce;}_0x4181da['status'](_0x4bb642);return _0x4181da[_0xad0f('0x20')](_0xad0f('0x21'),_0x3d5488+'-'+_0x139d7d+'/'+_0x2c5e7e)[_0xad0f('0x22')](_0xeba7e);}return null;};}function patchUpdates(_0x39c2fd){return function(_0x393bf6){try{jsonpatch[_0xad0f('0x23')](_0x393bf6,_0x39c2fd,!![]);}catch(_0xf75360){return BPromise['reject'](_0xf75360);}return _0x393bf6[_0xad0f('0x24')]();};}function saveUpdates(_0x1e4dbc,_0x36b6d8){return function(_0x4c70c1){if(_0x4c70c1){return _0x4c70c1[_0xad0f('0x25')](_0x1e4dbc)[_0xad0f('0x26')](function(_0x19ddd9){return _0x19ddd9;});}return null;};}function removeEntity(_0xe82cfe,_0x27b13b){return function(_0x595e42){if(_0x595e42){return _0x595e42[_0xad0f('0x27')]()[_0xad0f('0x26')](function(){_0xe82cfe[_0xad0f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cca6d,_0x2cd829){return function(_0x571910){if(!_0x571910){_0x4cca6d[_0xad0f('0x19')](0x194);}return _0x571910;};}function handleError(_0x599cf9,_0x13f4c0){_0x13f4c0=_0x13f4c0||0x1f4;return function(_0x35e22c){logger[_0xad0f('0x28')](_0x35e22c[_0xad0f('0x29')]);if(_0x35e22c['name']){delete _0x35e22c[_0xad0f('0x2a')];}_0x599cf9[_0xad0f('0x1a')](_0x13f4c0)[_0xad0f('0x2b')](_0x35e22c);};}exports[_0xad0f('0x2c')]=function(_0x32b491,_0x3d8802){var _0x3f762d={},_0x4065d2={},_0x556076={'count':0x0,'rows':[]};var _0x337569=_[_0xad0f('0x2d')](db[_0xad0f('0x2e')][_0xad0f('0x2f')],function(_0x549277){return{'name':_0x549277[_0xad0f('0x30')],'type':_0x549277[_0xad0f('0x31')][_0xad0f('0x32')]};});_0x4065d2[_0xad0f('0x33')]=_[_0xad0f('0x2d')](_0x337569,_0xad0f('0x2a'));_0x4065d2[_0xad0f('0x34')]=_['keys'](_0x32b491[_0xad0f('0x34')]);_0x4065d2['filters']=_[_0xad0f('0x35')](_0x4065d2[_0xad0f('0x33')],_0x4065d2[_0xad0f('0x34')]);_0x3f762d['attributes']=_[_0xad0f('0x35')](_0x4065d2[_0xad0f('0x33')],qs[_0xad0f('0x36')](_0x32b491[_0xad0f('0x34')][_0xad0f('0x36')]));_0x3f762d[_0xad0f('0x37')]=_0x3f762d[_0xad0f('0x37')][_0xad0f('0x38')]?_0x3f762d[_0xad0f('0x37')]:_0x4065d2['model'];if(!_0x32b491[_0xad0f('0x34')][_0xad0f('0x39')](_0xad0f('0x3a'))){_0x3f762d[_0xad0f('0x1f')]=qs[_0xad0f('0x1f')](_0x32b491['query']['limit']);_0x3f762d['offset']=qs['offset'](_0x32b491['query'][_0xad0f('0x1e')]);}_0x3f762d[_0xad0f('0x3b')]=qs['sort'](_0x32b491['query'][_0xad0f('0x3c')]);_0x3f762d[_0xad0f('0x3d')]=qs['filters'](_[_0xad0f('0x3e')](_0x32b491['query'],_0x4065d2[_0xad0f('0x3f')]),_0x337569);if(_0x32b491['query'][_0xad0f('0x40')]){_0x3f762d['where']=_['merge'](_0x3f762d[_0xad0f('0x3d')],{'$or':_[_0xad0f('0x2d')](_0x337569,function(_0x1a3f32){if(_0x1a3f32[_0xad0f('0x31')]!==_0xad0f('0x41')){var _0x24bfac={};_0x24bfac[_0x1a3f32['name']]={'$like':'%'+_0x32b491['query'][_0xad0f('0x40')]+'%'};return _0x24bfac;}})});}_0x3f762d=_['merge']({},_0x3f762d,_0x32b491[_0xad0f('0x42')]);var _0x4488ef={'where':_0x3f762d[_0xad0f('0x3d')]};return db[_0xad0f('0x2e')]['count'](_0x4488ef)[_0xad0f('0x26')](function(_0x597574){_0x556076[_0xad0f('0x1d')]=_0x597574;if(_0x32b491[_0xad0f('0x34')][_0xad0f('0x43')]){_0x3f762d['include']=[{'all':!![]}];}return db[_0xad0f('0x2e')][_0xad0f('0x44')](_0x3f762d);})[_0xad0f('0x26')](function(_0x2ab09c){_0x556076[_0xad0f('0x45')]=_0x2ab09c;return _0x556076;})[_0xad0f('0x26')](respondWithFilteredResult(_0x3d8802,_0x3f762d))[_0xad0f('0x46')](handleError(_0x3d8802,null));};exports[_0xad0f('0x47')]=function(_0x2697f5,_0x13272f){var _0x50b386={'raw':![],'where':{'id':_0x2697f5[_0xad0f('0x48')]['id']}},_0x31ec23={};_0x31ec23[_0xad0f('0x33')]=_[_0xad0f('0x49')](db[_0xad0f('0x2e')]['rawAttributes']);_0x31ec23[_0xad0f('0x34')]=_[_0xad0f('0x49')](_0x2697f5[_0xad0f('0x34')]);_0x31ec23[_0xad0f('0x3f')]=_[_0xad0f('0x35')](_0x31ec23[_0xad0f('0x33')],_0x31ec23[_0xad0f('0x34')]);_0x50b386[_0xad0f('0x37')]=_[_0xad0f('0x35')](_0x31ec23[_0xad0f('0x33')],qs[_0xad0f('0x36')](_0x2697f5['query'][_0xad0f('0x36')]));_0x50b386[_0xad0f('0x37')]=_0x50b386[_0xad0f('0x37')][_0xad0f('0x38')]?_0x50b386[_0xad0f('0x37')]:_0x31ec23[_0xad0f('0x33')];if(_0x2697f5[_0xad0f('0x34')][_0xad0f('0x43')]){_0x50b386[_0xad0f('0x4a')]=[{'all':!![]}];}_0x50b386=_[_0xad0f('0x4b')]({},_0x50b386,_0x2697f5['options']);return db['UserProfileSection'][_0xad0f('0x4c')](_0x50b386)[_0xad0f('0x26')](handleEntityNotFound(_0x13272f,null))[_0xad0f('0x26')](respondWithResult(_0x13272f,null))[_0xad0f('0x46')](handleError(_0x13272f,null));};exports[_0xad0f('0x4d')]=function(_0x357ac9,_0x93d75b){return db[_0xad0f('0x2e')][_0xad0f('0x4d')](_0x357ac9[_0xad0f('0x4e')],{})[_0xad0f('0x26')](respondWithResult(_0x93d75b,0xc9))[_0xad0f('0x46')](handleError(_0x93d75b,null));};exports[_0xad0f('0x25')]=function(_0x2f86e1,_0x7f64c4){if(_0x2f86e1['body']['id']){delete _0x2f86e1['body']['id'];}return db[_0xad0f('0x2e')][_0xad0f('0x4c')]({'where':{'id':_0x2f86e1['params']['id']}})[_0xad0f('0x26')](handleEntityNotFound(_0x7f64c4,null))['then'](saveUpdates(_0x2f86e1['body'],null))[_0xad0f('0x26')](respondWithResult(_0x7f64c4,null))[_0xad0f('0x46')](handleError(_0x7f64c4,null));};exports['destroy']=function(_0x1bbeb9,_0x235be7){return db[_0xad0f('0x2e')][_0xad0f('0x4c')]({'where':{'id':_0x1bbeb9[_0xad0f('0x48')]['id']}})[_0xad0f('0x26')](handleEntityNotFound(_0x235be7,null))[_0xad0f('0x26')](removeEntity(_0x235be7,null))['catch'](handleError(_0x235be7,null));};exports['describe']=function(_0x5c7c3c,_0x11572f){return db[_0xad0f('0x2e')][_0xad0f('0x4f')]()[_0xad0f('0x26')](respondWithResult(_0x11572f,null))[_0xad0f('0x46')](handleError(_0x11572f,null));};
\ No newline at end of file
+var _0x2480=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','send','index','UserProfileSection','fieldName','type','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0x2480,0x138));var _0x0248=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2480[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x0248('0x0'));var rimraf=require(_0x0248('0x1'));var zipdir=require(_0x0248('0x2'));var jsonpatch=require(_0x0248('0x3'));var rp=require(_0x0248('0x4'));var moment=require(_0x0248('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0248('0x6'));var util=require(_0x0248('0x7'));var path=require('path');var sox=require(_0x0248('0x8'));var csv=require('to-csv');var ejs=require(_0x0248('0x9'));var fs=require('fs');var fs_extra=require(_0x0248('0xa'));var _=require('lodash');var squel=require(_0x0248('0xb'));var crypto=require(_0x0248('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0248('0xd'));var toCsv=require(_0x0248('0xe'));var querystring=require(_0x0248('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0248('0x10'));var as=require(_0x0248('0x11'));var hardwareService=require(_0x0248('0x12'));var logger=require(_0x0248('0x13'))(_0x0248('0x14'));var utils=require(_0x0248('0x15'));var config=require(_0x0248('0x16'));var licenseUtil=require(_0x0248('0x17'));var db=require(_0x0248('0x18'))['db'];function respondWithStatusCode(_0x108a73,_0x3da1ce){_0x3da1ce=_0x3da1ce||0xcc;return function(_0x4993e5){if(_0x4993e5){return _0x108a73[_0x0248('0x19')](_0x3da1ce);}return _0x108a73[_0x0248('0x1a')](_0x3da1ce)[_0x0248('0x1b')]();};}function respondWithResult(_0x4431c3,_0x4af04e){_0x4af04e=_0x4af04e||0xc8;return function(_0x786878){if(_0x786878){return _0x4431c3[_0x0248('0x1a')](_0x4af04e)['json'](_0x786878);}};}function respondWithFilteredResult(_0x122a57,_0x3424c2){return function(_0x17ce7e){if(_0x17ce7e){var _0x250d21=typeof _0x3424c2[_0x0248('0x1c')]===_0x0248('0x1d')&&typeof _0x3424c2[_0x0248('0x1e')]===_0x0248('0x1d');var _0x1829b1=_0x17ce7e[_0x0248('0x1f')];var _0x322dfe=_0x250d21?0x0:_0x3424c2[_0x0248('0x1c')];var _0x4bd6ea=_0x250d21?_0x17ce7e['count']:_0x3424c2[_0x0248('0x1c')]+_0x3424c2[_0x0248('0x1e')];var _0x15710a;if(_0x4bd6ea>=_0x1829b1){_0x4bd6ea=_0x1829b1;_0x15710a=0xc8;}else{_0x15710a=0xce;}_0x122a57[_0x0248('0x1a')](_0x15710a);return _0x122a57['set'](_0x0248('0x20'),_0x322dfe+'-'+_0x4bd6ea+'/'+_0x1829b1)['json'](_0x17ce7e);}return null;};}function patchUpdates(_0x1bfd55){return function(_0x5bd1d9){try{jsonpatch[_0x0248('0x21')](_0x5bd1d9,_0x1bfd55,!![]);}catch(_0x81bc6a){return BPromise[_0x0248('0x22')](_0x81bc6a);}return _0x5bd1d9['save']();};}function saveUpdates(_0x20463d,_0x1d3ede){return function(_0x15c47c){if(_0x15c47c){return _0x15c47c['update'](_0x20463d)[_0x0248('0x23')](function(_0x13d01f){return _0x13d01f;});}return null;};}function removeEntity(_0xcbd4b3,_0x511067){return function(_0x49bd34){if(_0x49bd34){return _0x49bd34[_0x0248('0x24')]()['then'](function(){_0xcbd4b3[_0x0248('0x1a')](0xcc)[_0x0248('0x1b')]();});}};}function handleEntityNotFound(_0x16fa95,_0x16dc12){return function(_0x21238b){if(!_0x21238b){_0x16fa95[_0x0248('0x19')](0x194);}return _0x21238b;};}function handleError(_0x3707bd,_0x510b74){_0x510b74=_0x510b74||0x1f4;return function(_0x36c411){logger['error'](_0x36c411['stack']);if(_0x36c411['name']){delete _0x36c411['name'];}_0x3707bd['status'](_0x510b74)[_0x0248('0x25')](_0x36c411);};}exports[_0x0248('0x26')]=function(_0x2de55e,_0x388a77){var _0x26ccd8={},_0x1b8749={},_0x362fbb={'count':0x0,'rows':[]};var _0x3cdb61=_['map'](db[_0x0248('0x27')]['rawAttributes'],function(_0x3c93ee){return{'name':_0x3c93ee[_0x0248('0x28')],'type':_0x3c93ee[_0x0248('0x29')]['key']};});_0x1b8749['model']=_[_0x0248('0x2a')](_0x3cdb61,_0x0248('0x2b'));_0x1b8749[_0x0248('0x2c')]=_[_0x0248('0x2d')](_0x2de55e[_0x0248('0x2c')]);_0x1b8749[_0x0248('0x2e')]=_[_0x0248('0x2f')](_0x1b8749[_0x0248('0x30')],_0x1b8749[_0x0248('0x2c')]);_0x26ccd8[_0x0248('0x31')]=_[_0x0248('0x2f')](_0x1b8749[_0x0248('0x30')],qs[_0x0248('0x32')](_0x2de55e[_0x0248('0x2c')][_0x0248('0x32')]));_0x26ccd8['attributes']=_0x26ccd8[_0x0248('0x31')][_0x0248('0x33')]?_0x26ccd8[_0x0248('0x31')]:_0x1b8749[_0x0248('0x30')];if(!_0x2de55e[_0x0248('0x2c')][_0x0248('0x34')](_0x0248('0x35'))){_0x26ccd8[_0x0248('0x1e')]=qs['limit'](_0x2de55e[_0x0248('0x2c')][_0x0248('0x1e')]);_0x26ccd8[_0x0248('0x1c')]=qs['offset'](_0x2de55e[_0x0248('0x2c')][_0x0248('0x1c')]);}_0x26ccd8[_0x0248('0x36')]=qs[_0x0248('0x37')](_0x2de55e[_0x0248('0x2c')]['sort']);_0x26ccd8['where']=qs['filters'](_['pick'](_0x2de55e[_0x0248('0x2c')],_0x1b8749[_0x0248('0x2e')]),_0x3cdb61);if(_0x2de55e['query'][_0x0248('0x38')]){_0x26ccd8[_0x0248('0x39')]=_['merge'](_0x26ccd8['where'],{'$or':_[_0x0248('0x2a')](_0x3cdb61,function(_0x598fd3){if(_0x598fd3[_0x0248('0x29')]!==_0x0248('0x3a')){var _0x5a565e={};_0x5a565e[_0x598fd3['name']]={'$like':'%'+_0x2de55e[_0x0248('0x2c')][_0x0248('0x38')]+'%'};return _0x5a565e;}})});}_0x26ccd8=_[_0x0248('0x3b')]({},_0x26ccd8,_0x2de55e[_0x0248('0x3c')]);var _0x531bc2={'where':_0x26ccd8[_0x0248('0x39')]};return db[_0x0248('0x27')]['count'](_0x531bc2)[_0x0248('0x23')](function(_0x1922bc){_0x362fbb[_0x0248('0x1f')]=_0x1922bc;if(_0x2de55e[_0x0248('0x2c')][_0x0248('0x3d')]){_0x26ccd8[_0x0248('0x3e')]=[{'all':!![]}];}return db[_0x0248('0x27')][_0x0248('0x3f')](_0x26ccd8);})[_0x0248('0x23')](function(_0x47a7ca){_0x362fbb[_0x0248('0x40')]=_0x47a7ca;return _0x362fbb;})[_0x0248('0x23')](respondWithFilteredResult(_0x388a77,_0x26ccd8))[_0x0248('0x41')](handleError(_0x388a77,null));};exports[_0x0248('0x42')]=function(_0xd9c14f,_0x254149){var _0x1e38b2={'raw':![],'where':{'id':_0xd9c14f[_0x0248('0x43')]['id']}},_0x145d6b={};_0x145d6b[_0x0248('0x30')]=_[_0x0248('0x2d')](db[_0x0248('0x27')][_0x0248('0x44')]);_0x145d6b[_0x0248('0x2c')]=_[_0x0248('0x2d')](_0xd9c14f['query']);_0x145d6b[_0x0248('0x2e')]=_['intersection'](_0x145d6b['model'],_0x145d6b['query']);_0x1e38b2[_0x0248('0x31')]=_[_0x0248('0x2f')](_0x145d6b['model'],qs[_0x0248('0x32')](_0xd9c14f[_0x0248('0x2c')][_0x0248('0x32')]));_0x1e38b2[_0x0248('0x31')]=_0x1e38b2[_0x0248('0x31')][_0x0248('0x33')]?_0x1e38b2[_0x0248('0x31')]:_0x145d6b['model'];if(_0xd9c14f[_0x0248('0x2c')][_0x0248('0x3d')]){_0x1e38b2[_0x0248('0x3e')]=[{'all':!![]}];}_0x1e38b2=_[_0x0248('0x3b')]({},_0x1e38b2,_0xd9c14f[_0x0248('0x3c')]);return db[_0x0248('0x27')][_0x0248('0x45')](_0x1e38b2)[_0x0248('0x23')](handleEntityNotFound(_0x254149,null))['then'](respondWithResult(_0x254149,null))[_0x0248('0x41')](handleError(_0x254149,null));};exports['create']=function(_0x17631d,_0x1d84cf){return db[_0x0248('0x27')][_0x0248('0x46')](_0x17631d[_0x0248('0x47')],{})[_0x0248('0x23')](respondWithResult(_0x1d84cf,0xc9))['catch'](handleError(_0x1d84cf,null));};exports[_0x0248('0x48')]=function(_0x2cdbdb,_0x2d19d7){if(_0x2cdbdb[_0x0248('0x47')]['id']){delete _0x2cdbdb[_0x0248('0x47')]['id'];}return db[_0x0248('0x27')][_0x0248('0x45')]({'where':{'id':_0x2cdbdb['params']['id']}})['then'](handleEntityNotFound(_0x2d19d7,null))[_0x0248('0x23')](saveUpdates(_0x2cdbdb['body'],null))[_0x0248('0x23')](respondWithResult(_0x2d19d7,null))[_0x0248('0x41')](handleError(_0x2d19d7,null));};exports['destroy']=function(_0x3f7cd1,_0x1843b1){return db[_0x0248('0x27')][_0x0248('0x45')]({'where':{'id':_0x3f7cd1[_0x0248('0x43')]['id']}})['then'](handleEntityNotFound(_0x1843b1,null))[_0x0248('0x23')](removeEntity(_0x1843b1,null))[_0x0248('0x41')](handleError(_0x1843b1,null));};exports['describe']=function(_0x4ebddb,_0x4bfcb0){return db['UserProfileSection'][_0x0248('0x49')]()['then'](respondWithResult(_0x4bfcb0,null))[_0x0248('0x41')](handleError(_0x4bfcb0,null));};
\ No newline at end of file
index 85e12e3..5b4206f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e74=['compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define'];(function(_0x4e0359,_0x205155){var _0x450f0a=function(_0x2056c6){while(--_0x2056c6){_0x4e0359['push'](_0x4e0359['shift']());}};_0x450f0a(++_0x205155);}(_0x6e74,0xe0));var _0x46e7=function(_0x27e4ba,_0x19179a){_0x27e4ba=_0x27e4ba-0x0;var _0x26c979=_0x6e74[_0x27e4ba];return _0x26c979;};'use strict';var _=require(_0x46e7('0x0'));var util=require(_0x46e7('0x1'));var logger=require(_0x46e7('0x2'))(_0x46e7('0x3'));var moment=require(_0x46e7('0x4'));var BPromise=require(_0x46e7('0x5'));var rp=require(_0x46e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46e7('0x7'));var config=require(_0x46e7('0x8'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0xc0e2a,_0x457b86){return _0xc0e2a[_0x46e7('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x46e7('0xa'),'fields':[_0x46e7('0xb'),_0x46e7('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x59a6=['./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x59a6,0xac));var _0x659a=function(_0x29ddde,_0xd7b680){_0x29ddde=_0x29ddde-0x0;var _0x5132d0=_0x59a6[_0x29ddde];return _0x5132d0;};'use strict';var _=require(_0x659a('0x0'));var util=require(_0x659a('0x1'));var logger=require('../../config/logger')(_0x659a('0x2'));var moment=require(_0x659a('0x3'));var BPromise=require(_0x659a('0x4'));var rp=require(_0x659a('0x5'));var fs=require('fs');var path=require(_0x659a('0x6'));var rimraf=require(_0x659a('0x7'));var config=require('../../config/environment');var attributes=require(_0x659a('0x8'));module['exports']=function(_0x1e8d96,_0x19356e){return _0x1e8d96['define'](_0x659a('0x9'),attributes,{'tableName':_0x659a('0xa'),'paranoid':![],'indexes':[{'name':_0x659a('0xb'),'fields':['sectionId','userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
index cdb90c6..17ba5a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d5b=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3f1e47,_0x5a4223){var _0x212eb3=function(_0x1fddfb){while(--_0x1fddfb){_0x3f1e47['push'](_0x3f1e47['shift']());}};_0x212eb3(++_0x5a4223);}(_0x8d5b,0x102));var _0xb8d5=function(_0x314085,_0x4235c6){_0x314085=_0x314085-0x0;var _0x26190a=_0x8d5b[_0x314085];return _0x26190a;};'use strict';var _=require(_0xb8d5('0x0'));var util=require(_0xb8d5('0x1'));var moment=require(_0xb8d5('0x2'));var BPromise=require(_0xb8d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8d5('0x4'))['db'];var utils=require(_0xb8d5('0x5'));var logger=require(_0xb8d5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb8d5('0x7'));var client=jayson['client'][_0xb8d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x404d88,_0x1c2ab0,_0x546a68){return new BPromise(function(_0x3900f8,_0x287a98){return client[_0xb8d5('0x9')](_0x404d88,_0x546a68)[_0xb8d5('0xa')](function(_0x219f21){logger['info'](_0xb8d5('0xb'),_0x1c2ab0,'request\x20sent');logger[_0xb8d5('0xc')](_0xb8d5('0xd'),_0x1c2ab0,_0xb8d5('0xe'),JSON[_0xb8d5('0xf')](_0x219f21));if(_0x219f21[_0xb8d5('0x10')]){if(_0x219f21[_0xb8d5('0x10')][_0xb8d5('0x11')]===0x1f4){logger['error'](_0xb8d5('0xb'),_0x1c2ab0,_0x219f21[_0xb8d5('0x10')][_0xb8d5('0x12')]);return _0x287a98(_0x219f21[_0xb8d5('0x10')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1c2ab0,_0x219f21[_0xb8d5('0x10')][_0xb8d5('0x12')]);return _0x3900f8(_0x219f21['error'][_0xb8d5('0x12')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x1c2ab0,_0xb8d5('0xe'));_0x3900f8(_0x219f21[_0xb8d5('0x13')][_0xb8d5('0x12')]);}})[_0xb8d5('0x14')](function(_0x138c3c){logger[_0xb8d5('0x10')](_0xb8d5('0xb'),_0x1c2ab0,_0x138c3c);_0x287a98(_0x138c3c);});});}
\ No newline at end of file
+var _0x01ef=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x01ef,0x1dd));var _0xf01e=function(_0x585357,_0xc9b935){_0x585357=_0x585357-0x0;var _0x2feb8f=_0x01ef[_0x585357];return _0x2feb8f;};'use strict';var _=require(_0xf01e('0x0'));var util=require('util');var moment=require(_0xf01e('0x1'));var BPromise=require(_0xf01e('0x2'));var rs=require(_0xf01e('0x3'));var fs=require('fs');var Redis=require(_0xf01e('0x4'));var db=require(_0xf01e('0x5'))['db'];var utils=require(_0xf01e('0x6'));var logger=require('../../config/logger')(_0xf01e('0x7'));var config=require(_0xf01e('0x8'));var jayson=require(_0xf01e('0x9'));var client=jayson[_0xf01e('0xa')][_0xf01e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d4ee7,_0x3fc8ec,_0x7bfea8){return new BPromise(function(_0x23290c,_0x2a7b61){return client[_0xf01e('0xc')](_0x5d4ee7,_0x7bfea8)[_0xf01e('0xd')](function(_0x340051){logger[_0xf01e('0xe')](_0xf01e('0xf'),_0x3fc8ec,'request\x20sent');logger[_0xf01e('0x10')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3fc8ec,'request\x20sent',JSON['stringify'](_0x340051));if(_0x340051[_0xf01e('0x11')]){if(_0x340051[_0xf01e('0x11')][_0xf01e('0x12')]===0x1f4){logger[_0xf01e('0x11')](_0xf01e('0xf'),_0x3fc8ec,_0x340051[_0xf01e('0x11')][_0xf01e('0x13')]);return _0x2a7b61(_0x340051[_0xf01e('0x11')][_0xf01e('0x13')]);}logger[_0xf01e('0x11')](_0xf01e('0xf'),_0x3fc8ec,_0x340051[_0xf01e('0x11')]['message']);return _0x23290c(_0x340051[_0xf01e('0x11')][_0xf01e('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3fc8ec,'request\x20sent');_0x23290c(_0x340051[_0xf01e('0x14')][_0xf01e('0x13')]);}})[_0xf01e('0x15')](function(_0x3d4e33){logger[_0xf01e('0x11')](_0xf01e('0xf'),_0x3fc8ec,_0x3d4e33);_0x2a7b61(_0x3d4e33);});});}
\ No newline at end of file
index 1af379e..dcb4cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x37afd5,_0x35ca76){var _0x1437c0=function(_0x2b13e4){while(--_0x2b13e4){_0x37afd5['push'](_0x37afd5['shift']());}};_0x1437c0(++_0x35ca76);}(_0x70e0,0x17b));var _0x070e=function(_0x27d53e,_0x4633b2){_0x27d53e=_0x27d53e-0x0;var _0x522261=_0x70e0[_0x27d53e];return _0x522261;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x269ca8,_0x282e11){var _0x5788e8=function(_0x2b6b2c){while(--_0x2b6b2c){_0x269ca8['push'](_0x269ca8['shift']());}};_0x5788e8(++_0x282e11);}(_0x70e0,0x17b));var _0x070e=function(_0x2a79cc,_0x13dbbd){_0x2a79cc=_0x2a79cc-0x0;var _0x4fb645=_0x70e0[_0x2a79cc];return _0x4fb645;};'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 8e16c07..8f0e334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8be3=['exports'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x8be3,0xe3));var _0x38be=function(_0x533406,_0x8b122){_0x533406=_0x533406-0x0;var _0x879e63=_0x8be3[_0x533406];return _0x879e63;};'use strict';var Sequelize=require('sequelize');module[_0x38be('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf938=['INTEGER','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf938,0x106));var _0x8f93=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0xf938[_0x5b734b];return _0x2a15a3;};'use strict';var Sequelize=require(_0x8f93('0x0'));module[_0x8f93('0x1')]={'penalty':{'type':Sequelize[_0x8f93('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 791cfb9..50be816 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f37=['lodash','util','api','request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x20e1fd,_0x506bf0){var _0x3be635=function(_0x530079){while(--_0x530079){_0x20e1fd['push'](_0x20e1fd['shift']());}};_0x3be635(++_0x506bf0);}(_0x9f37,0xd1));var _0x79f3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x9f37[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require('../../config/logger')(_0x79f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79f3('0x3'));var fs=require('fs');var path=require(_0x79f3('0x4'));var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x594d87,_0x5db84b){return _0x594d87[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e4b=['./userSmsQueue.attributes','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment','../../config/environment'];(function(_0x2110c2,_0x2db269){var _0x51f751=function(_0x395d32){while(--_0x395d32){_0x2110c2['push'](_0x2110c2['shift']());}};_0x51f751(++_0x2db269);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x270835,_0x5f0b18){_0x270835=_0x270835-0x0;var _0x268d4f=_0x0e4b[_0x270835];return _0x268d4f;};'use strict';var _=require(_0xb0e4('0x0'));var util=require(_0xb0e4('0x1'));var logger=require(_0xb0e4('0x2'))('api');var moment=require(_0xb0e4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb0e4('0x4'));var attributes=require(_0xb0e4('0x5'));module['exports']=function(_0x45bdf2,_0x3b56c3){return _0x45bdf2[_0xb0e4('0x6')](_0xb0e4('0x7'),attributes,{'tableName':_0xb0e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a7f5c89..0c8d2e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c5=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result'];(function(_0x1d8760,_0x24b360){var _0x384387=function(_0x51170f){while(--_0x51170f){_0x1d8760['push'](_0x1d8760['shift']());}};_0x384387(++_0x24b360);}(_0xd3c5,0xc7));var _0x5d3c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd3c5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5d3c('0x0'));var util=require('util');var moment=require(_0x5d3c('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d3c('0x2'));var fs=require('fs');var Redis=require(_0x5d3c('0x3'));var db=require(_0x5d3c('0x4'))['db'];var utils=require(_0x5d3c('0x5'));var logger=require('../../config/logger')(_0x5d3c('0x6'));var config=require(_0x5d3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d3c('0x8')][_0x5d3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x585950,_0x6e90db,_0x5e0c27){return new BPromise(function(_0x350b64,_0x2e0369){return client[_0x5d3c('0xa')](_0x585950,_0x5e0c27)['then'](function(_0x3915b2){logger[_0x5d3c('0xb')](_0x5d3c('0xc'),_0x6e90db,'request\x20sent');logger[_0x5d3c('0xd')](_0x5d3c('0xe'),_0x6e90db,'request\x20sent',JSON[_0x5d3c('0xf')](_0x3915b2));if(_0x3915b2['error']){if(_0x3915b2['error'][_0x5d3c('0x10')]===0x1f4){logger[_0x5d3c('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x6e90db,_0x3915b2[_0x5d3c('0x11')][_0x5d3c('0x12')]);return _0x2e0369(_0x3915b2[_0x5d3c('0x11')][_0x5d3c('0x12')]);}logger[_0x5d3c('0x11')](_0x5d3c('0xc'),_0x6e90db,_0x3915b2[_0x5d3c('0x11')][_0x5d3c('0x12')]);return _0x350b64(_0x3915b2[_0x5d3c('0x11')][_0x5d3c('0x12')]);}else{logger[_0x5d3c('0xb')](_0x5d3c('0xc'),_0x6e90db,_0x5d3c('0x13'));_0x350b64(_0x3915b2[_0x5d3c('0x14')][_0x5d3c('0x12')]);}})[_0x5d3c('0x15')](function(_0x3655f5){logger[_0x5d3c('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x6e90db,_0x3655f5);_0x2e0369(_0x3655f5);});});}
\ No newline at end of file
+var _0x28ec=['code','UserSmsQueue,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x215fdd,_0x25b009){var _0x4efe47=function(_0x39c829){while(--_0x39c829){_0x215fdd['push'](_0x215fdd['shift']());}};_0x4efe47(++_0x25b009);}(_0x28ec,0x195));var _0xc28e=function(_0xda0b05,_0x166e3c){_0xda0b05=_0xda0b05-0x0;var _0x5a2701=_0x28ec[_0xda0b05];return _0x5a2701;};'use strict';var _=require('lodash');var util=require(_0xc28e('0x0'));var moment=require(_0xc28e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc28e('0x2'));var fs=require('fs');var Redis=require(_0xc28e('0x3'));var db=require(_0xc28e('0x4'))['db'];var utils=require(_0xc28e('0x5'));var logger=require(_0xc28e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc28e('0x7'));var client=jayson[_0xc28e('0x8')][_0xc28e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bc197,_0xf254f,_0x5e7f9e){return new BPromise(function(_0x57107a,_0x90d76d){return client['request'](_0x2bc197,_0x5e7f9e)[_0xc28e('0xa')](function(_0xf5384a){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0xf254f,_0xc28e('0xb'));logger[_0xc28e('0xc')](_0xc28e('0xd'),_0xf254f,'request\x20sent',JSON['stringify'](_0xf5384a));if(_0xf5384a['error']){if(_0xf5384a[_0xc28e('0xe')][_0xc28e('0xf')]===0x1f4){logger[_0xc28e('0xe')](_0xc28e('0x10'),_0xf254f,_0xf5384a[_0xc28e('0xe')][_0xc28e('0x11')]);return _0x90d76d(_0xf5384a[_0xc28e('0xe')][_0xc28e('0x11')]);}logger[_0xc28e('0xe')](_0xc28e('0x10'),_0xf254f,_0xf5384a[_0xc28e('0xe')][_0xc28e('0x11')]);return _0x57107a(_0xf5384a[_0xc28e('0xe')]['message']);}else{logger[_0xc28e('0x12')](_0xc28e('0x10'),_0xf254f,_0xc28e('0xb'));_0x57107a(_0xf5384a[_0xc28e('0x13')][_0xc28e('0x11')]);}})[_0xc28e('0x14')](function(_0x25c8b1){logger[_0xc28e('0xe')](_0xc28e('0x10'),_0xf254f,_0x25c8b1);_0x90d76d(_0x25c8b1);});});}
\ No newline at end of file
index bab0b19..9f70e8a 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(_0x370732,_0x304cac){var _0x3226d8=function(_0xafef58){while(--_0xafef58){_0x370732['push'](_0x370732['shift']());}};_0x3226d8(++_0x304cac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2a94c3,_0x1b9eb5){var _0x4c9f4b=function(_0x59b66a){while(--_0x59b66a){_0x2a94c3['push'](_0x2a94c3['shift']());}};_0x4c9f4b(++_0x1b9eb5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index d85886b..ed6a2fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d53=['exports','INTEGER','sequelize'];(function(_0x54882f,_0x41d7e9){var _0x37f30f=function(_0x16fd63){while(--_0x16fd63){_0x54882f['push'](_0x54882f['shift']());}};_0x37f30f(++_0x41d7e9);}(_0x7d53,0x1ca));var _0x37d5=function(_0x4023cd,_0x1df0e7){_0x4023cd=_0x4023cd-0x0;var _0x425259=_0x7d53[_0x4023cd];return _0x425259;};'use strict';var Sequelize=require(_0x37d5('0x0'));module[_0x37d5('0x1')]={'penalty':{'type':Sequelize[_0x37d5('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x345e=['exports','INTEGER','sequelize'];(function(_0xa0be31,_0x45b568){var _0x3f5341=function(_0x497d41){while(--_0x497d41){_0xa0be31['push'](_0xa0be31['shift']());}};_0x3f5341(++_0x45b568);}(_0x345e,0x12e));var _0xe345=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x345e[_0x83420c];return _0x1057d7;};'use strict';var Sequelize=require(_0xe345('0x0'));module[_0xe345('0x1')]={'penalty':{'type':Sequelize[_0xe345('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 6ceea57..7c84acc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b8=['bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','api','moment'];(function(_0x5e7392,_0x2261e8){var _0x593d8e=function(_0x8de1b7){while(--_0x8de1b7){_0x5e7392['push'](_0x5e7392['shift']());}};_0x593d8e(++_0x2261e8);}(_0xd3b8,0xd6));var _0x8d3b=function(_0x27c7b7,_0x3ac29c){_0x27c7b7=_0x27c7b7-0x0;var _0x22e7d5=_0xd3b8[_0x27c7b7];return _0x22e7d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8d3b('0x0'));var moment=require(_0x8d3b('0x1'));var BPromise=require(_0x8d3b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d3b('0x3'));var rimraf=require(_0x8d3b('0x4'));var config=require(_0x8d3b('0x5'));var attributes=require(_0x8d3b('0x6'));module[_0x8d3b('0x7')]=function(_0xc59475,_0x180b7f){return _0xc59475['define'](_0x8d3b('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd757=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api'];(function(_0x5bb920,_0x3a7a91){var _0xbc26f8=function(_0x577432){while(--_0x577432){_0x5bb920['push'](_0x5bb920['shift']());}};_0xbc26f8(++_0x3a7a91);}(_0xd757,0x1dd));var _0x7d75=function(_0x4192f3,_0x1cbdf2){_0x4192f3=_0x4192f3-0x0;var _0x34b879=_0xd757[_0x4192f3];return _0x34b879;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require('../../config/logger')(_0x7d75('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x3'));var fs=require('fs');var path=require(_0x7d75('0x4'));var rimraf=require(_0x7d75('0x5'));var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x13747e,_0x489922){return _0x13747e[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ebe559..6431f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28eb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird'];(function(_0x48ecb5,_0x5176f5){var _0x53df1d=function(_0x5aface){while(--_0x5aface){_0x48ecb5['push'](_0x48ecb5['shift']());}};_0x53df1d(++_0x5176f5);}(_0x28eb,0x1b2));var _0xb28e=function(_0x495c67,_0x51e1c5){_0x495c67=_0x495c67-0x0;var _0x1b3e32=_0x28eb[_0x495c67];return _0x1b3e32;};'use strict';var _=require('lodash');var util=require(_0xb28e('0x0'));var moment=require(_0xb28e('0x1'));var BPromise=require(_0xb28e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb28e('0x3'));var db=require(_0xb28e('0x4'))['db'];var utils=require(_0xb28e('0x5'));var logger=require(_0xb28e('0x6'))('rpc');var config=require(_0xb28e('0x7'));var jayson=require(_0xb28e('0x8'));var client=jayson[_0xb28e('0x9')][_0xb28e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8802d,_0x13764b,_0x1a4a02){return new BPromise(function(_0x2576e9,_0x8b5a64){return client[_0xb28e('0xb')](_0x8802d,_0x1a4a02)[_0xb28e('0xc')](function(_0x4250e8){logger[_0xb28e('0xd')](_0xb28e('0xe'),_0x13764b,'request\x20sent');logger[_0xb28e('0xf')](_0xb28e('0x10'),_0x13764b,'request\x20sent',JSON[_0xb28e('0x11')](_0x4250e8));if(_0x4250e8[_0xb28e('0x12')]){if(_0x4250e8[_0xb28e('0x12')]['code']===0x1f4){logger[_0xb28e('0x12')](_0xb28e('0xe'),_0x13764b,_0x4250e8[_0xb28e('0x12')][_0xb28e('0x13')]);return _0x8b5a64(_0x4250e8[_0xb28e('0x12')][_0xb28e('0x13')]);}logger[_0xb28e('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x13764b,_0x4250e8[_0xb28e('0x12')][_0xb28e('0x13')]);return _0x2576e9(_0x4250e8[_0xb28e('0x12')][_0xb28e('0x13')]);}else{logger['info'](_0xb28e('0xe'),_0x13764b,_0xb28e('0x14'));_0x2576e9(_0x4250e8[_0xb28e('0x15')][_0xb28e('0x13')]);}})[_0xb28e('0x16')](function(_0x49b057){logger[_0xb28e('0x12')](_0xb28e('0xe'),_0x13764b,_0x49b057);_0x8b5a64(_0x49b057);});});}
\ No newline at end of file
+var _0x9aa6=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x6890ac,_0x1471fe){var _0xb737a5=function(_0x2ba9c6){while(--_0x2ba9c6){_0x6890ac['push'](_0x6890ac['shift']());}};_0xb737a5(++_0x1471fe);}(_0x9aa6,0xea));var _0x69aa=function(_0x41427e,_0x17c55a){_0x41427e=_0x41427e-0x0;var _0x107309=_0x9aa6[_0x41427e];return _0x107309;};'use strict';var _=require(_0x69aa('0x0'));var util=require(_0x69aa('0x1'));var moment=require(_0x69aa('0x2'));var BPromise=require(_0x69aa('0x3'));var rs=require(_0x69aa('0x4'));var fs=require('fs');var Redis=require(_0x69aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69aa('0x6'));var logger=require('../../config/logger')(_0x69aa('0x7'));var config=require(_0x69aa('0x8'));var jayson=require(_0x69aa('0x9'));var client=jayson['client'][_0x69aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41b41,_0x23cfa4,_0x14a564){return new BPromise(function(_0x2ce490,_0x41ea5f){return client[_0x69aa('0xb')](_0x41b41,_0x14a564)[_0x69aa('0xc')](function(_0x275b82){logger[_0x69aa('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x23cfa4,_0x69aa('0xe'));logger[_0x69aa('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x23cfa4,_0x69aa('0xe'),JSON['stringify'](_0x275b82));if(_0x275b82[_0x69aa('0x10')]){if(_0x275b82[_0x69aa('0x10')][_0x69aa('0x11')]===0x1f4){logger[_0x69aa('0x10')](_0x69aa('0x12'),_0x23cfa4,_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);return _0x41ea5f(_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);}logger[_0x69aa('0x10')](_0x69aa('0x12'),_0x23cfa4,_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);return _0x2ce490(_0x275b82[_0x69aa('0x10')][_0x69aa('0x13')]);}else{logger[_0x69aa('0xd')](_0x69aa('0x12'),_0x23cfa4,'request\x20sent');_0x2ce490(_0x275b82[_0x69aa('0x14')][_0x69aa('0x13')]);}})[_0x69aa('0x15')](function(_0x134d89){logger[_0x69aa('0x10')](_0x69aa('0x12'),_0x23cfa4,_0x134d89);_0x41ea5f(_0x134d89);});});}
\ No newline at end of file
index 0064757..274e17e 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(_0x54cf27,_0x43ecd7){var _0x2c1f7a=function(_0x155f51){while(--_0x155f51){_0x54cf27['push'](_0x54cf27['shift']());}};_0x2c1f7a(++_0x43ecd7);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4495b6,_0x1660d5){var _0x2ff893=function(_0x381027){while(--_0x381027){_0x4495b6['push'](_0x4495b6['shift']());}};_0x2ff893(++_0x1660d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index bfa1ec0..220e9ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc93d=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER','sequelize','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc93d,0x64));var _0xdc93=function(_0x3513e2,_0x26f645){_0x3513e2=_0x3513e2-0x0;var _0x186e8f=_0xc93d[_0x3513e2];return _0x186e8f;};'use strict';var Sequelize=require(_0xdc93('0x0'));module[_0xdc93('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xdc93('0x2')},'membername':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'comment':_0xdc93('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'unique':_0xdc93('0x4'),'comment':_0xdc93('0x2')},'VoiceQueueId':{'type':Sequelize[_0xdc93('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xdc93('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xdc93('0x2')},'paused':{'type':Sequelize[_0xdc93('0x5')](0xb),'defaultValue':0x0,'comment':_0xdc93('0x2')}};
\ No newline at end of file
+var _0x3bdb=['INTEGER','STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x2e0c7f,_0x594ed8){var _0x49d09c=function(_0x5e840a){while(--_0x5e840a){_0x2e0c7f['push'](_0x2e0c7f['shift']());}};_0x49d09c(++_0x594ed8);}(_0x3bdb,0xf9));var _0xb3bd=function(_0x557517,_0x5cf701){_0x557517=_0x557517-0x0;var _0xbd8752=_0x3bdb[_0x557517];return _0xbd8752;};'use strict';var Sequelize=require(_0xb3bd('0x0'));module[_0xb3bd('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb3bd('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xb3bd('0x2')},'UserId':{'type':Sequelize[_0xb3bd('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb3bd('0x4')],'allowNull':![],'unique':_0xb3bd('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xb3bd('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0xb3bd('0x4')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xb3bd('0x3')](0xb),'defaultValue':0x0,'comment':_0xb3bd('0x2')},'paused':{'type':Sequelize[_0xb3bd('0x3')](0xb),'defaultValue':0x0,'comment':_0xb3bd('0x2')}};
\ No newline at end of file
index 6bc183c..88aab30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb4=['remove','emit','hasOwnProperty','exports','events','setMaxListeners','save'];(function(_0x5a8db9,_0x2f7cfa){var _0x412378=function(_0x4d6ade){while(--_0x4d6ade){_0x5a8db9['push'](_0x5a8db9['shift']());}};_0x412378(++_0x2f7cfa);}(_0xaeb4,0x138));var _0x4aeb=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xaeb4[_0x3b5049];return _0x12454e;};'use strict';var EventEmitter=require(_0x4aeb('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4aeb('0x1')](0x0);var events={'afterCreate':_0x4aeb('0x2'),'afterUpdate':'update','afterDestroy':_0x4aeb('0x3')};function emitEvent(_0x314d65){return function(_0x36b860,_0x1c1bab,_0x1f2cb9){UserVoiceQueueRtEvents[_0x4aeb('0x4')](_0x314d65+':'+_0x36b860['id'],_0x36b860);UserVoiceQueueRtEvents[_0x4aeb('0x4')](_0x314d65,_0x36b860);_0x1f2cb9(null);};}for(var e in events){if(events[_0x4aeb('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x4aeb('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x5722=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x3b5c31,_0x2892a7){var _0x20a04b=function(_0x1dc22f){while(--_0x1dc22f){_0x3b5c31['push'](_0x3b5c31['shift']());}};_0x20a04b(++_0x2892a7);}(_0x5722,0x164));var _0x2572=function(_0x246925,_0x1c7496){_0x246925=_0x246925-0x0;var _0x2aea39=_0x5722[_0x246925];return _0x2aea39;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x2572('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2572('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2572('0x2'),'afterDestroy':_0x2572('0x3')};function emitEvent(_0x2a1580){return function(_0x233973,_0x530365,_0x5bc622){UserVoiceQueueRtEvents[_0x2572('0x4')](_0x2a1580+':'+_0x233973['id'],_0x233973);UserVoiceQueueRtEvents[_0x2572('0x4')](_0x2a1580,_0x233973);_0x5bc622(null);};}for(var e in events){if(events[_0x2572('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x2572('0x6')](e,emitEvent(event));}}module[_0x2572('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 5a2ed84..d1ff639 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4458=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x31aeab,_0x14572a){var _0x23e3e9=function(_0x198668){while(--_0x198668){_0x31aeab['push'](_0x31aeab['shift']());}};_0x23e3e9(++_0x14572a);}(_0x4458,0x87));var _0x8445=function(_0x2cd2cc,_0x2ae574){_0x2cd2cc=_0x2cd2cc-0x0;var _0x2ba06d=_0x4458[_0x2cd2cc];return _0x2ba06d;};'use strict';var _=require(_0x8445('0x0'));var util=require(_0x8445('0x1'));var logger=require(_0x8445('0x2'))(_0x8445('0x3'));var moment=require(_0x8445('0x4'));var BPromise=require(_0x8445('0x5'));var rp=require(_0x8445('0x6'));var fs=require('fs');var path=require(_0x8445('0x7'));var rimraf=require(_0x8445('0x8'));var config=require(_0x8445('0x9'));var attributes=require(_0x8445('0xa'));module[_0x8445('0xb')]=function(_0x2c5d4c,_0x3a44c4){return _0x2c5d4c['define']('UserVoiceQueueRt',attributes,{'tableName':_0x8445('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc91c=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x52b8ad,_0x425b4b){var _0x4deb5a=function(_0x53f2bf){while(--_0x53f2bf){_0x52b8ad['push'](_0x52b8ad['shift']());}};_0x4deb5a(++_0x425b4b);}(_0xc91c,0x146));var _0xcc91=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xc91c[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xcc91('0x0'));var util=require(_0xcc91('0x1'));var logger=require('../../config/logger')(_0xcc91('0x2'));var moment=require(_0xcc91('0x3'));var BPromise=require(_0xcc91('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc91('0x5'));var rimraf=require(_0xcc91('0x6'));var config=require(_0xcc91('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xcc91('0x8')]=function(_0x3c7722,_0x28fa67){return _0x3c7722[_0xcc91('0x9')](_0xcc91('0xa'),attributes,{'tableName':_0xcc91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12df1af..8da70e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cab=['jayson/promise','client','http','redis','socket.io-emitter','request','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x579cb1,_0x49ff29){var _0x4cc5ab=function(_0x552e32){while(--_0x552e32){_0x579cb1['push'](_0x579cb1['shift']());}};_0x4cc5ab(++_0x49ff29);}(_0x4cab,0x199));var _0xb4ca=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x4cab[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xb4ca('0x0'));var util=require(_0xb4ca('0x1'));var moment=require(_0xb4ca('0x2'));var BPromise=require(_0xb4ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4ca('0x4'));var db=require(_0xb4ca('0x5'))['db'];var utils=require(_0xb4ca('0x6'));var logger=require('../../config/logger')(_0xb4ca('0x7'));var config=require(_0xb4ca('0x8'));var jayson=require(_0xb4ca('0x9'));var client=jayson[_0xb4ca('0xa')][_0xb4ca('0xb')]({'port':0x232a});config[_0xb4ca('0xc')]=_['defaults'](config[_0xb4ca('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4ca('0xd'))(new Redis(config[_0xb4ca('0xc')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x80043d,_0x2ac7ef,_0x15467a){return new BPromise(function(_0x5556b1,_0x363c5a){return client[_0xb4ca('0xe')](_0x80043d,_0x15467a)[_0xb4ca('0xf')](function(_0x1279f9){logger[_0xb4ca('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2ac7ef,_0xb4ca('0x11'));logger['debug'](_0xb4ca('0x12'),_0x2ac7ef,_0xb4ca('0x11'),JSON[_0xb4ca('0x13')](_0x1279f9));if(_0x1279f9[_0xb4ca('0x14')]){if(_0x1279f9['error'][_0xb4ca('0x15')]===0x1f4){logger[_0xb4ca('0x14')](_0xb4ca('0x16'),_0x2ac7ef,_0x1279f9[_0xb4ca('0x14')]['message']);return _0x363c5a(_0x1279f9[_0xb4ca('0x14')][_0xb4ca('0x17')]);}logger[_0xb4ca('0x14')](_0xb4ca('0x16'),_0x2ac7ef,_0x1279f9[_0xb4ca('0x14')][_0xb4ca('0x17')]);return _0x5556b1(_0x1279f9[_0xb4ca('0x14')]['message']);}else{logger[_0xb4ca('0x10')](_0xb4ca('0x16'),_0x2ac7ef,'request\x20sent');_0x5556b1(_0x1279f9[_0xb4ca('0x18')][_0xb4ca('0x17')]);}})[_0xb4ca('0x19')](function(_0x56c749){logger[_0xb4ca('0x14')](_0xb4ca('0x16'),_0x2ac7ef,_0x56c749);_0x363c5a(_0x56c749);});});}exports[_0xb4ca('0x1a')]=function(_0x6c1c5b){var _0x5d17eb=this;return new Promise(function(_0x328ed1,_0x235132){return db[_0xb4ca('0x1b')][_0xb4ca('0x1c')]({'raw':_0x6c1c5b[_0xb4ca('0x1d')]?_0x6c1c5b['options'][_0xb4ca('0x1e')]===undefined?!![]:![]:!![],'where':_0x6c1c5b[_0xb4ca('0x1d')]?_0x6c1c5b[_0xb4ca('0x1d')][_0xb4ca('0x1f')]||null:null,'attributes':[[db[_0xb4ca('0x20')]['fn'](_0xb4ca('0x21'),db[_0xb4ca('0x20')]['fn']('IF',db['sequelize'][_0xb4ca('0x22')](_0xb4ca('0x23')))),_0xb4ca('0x24')]]})[_0xb4ca('0xf')](function(_0x484891){logger['info'](_0xb4ca('0x1a'),_0x6c1c5b);logger[_0xb4ca('0x25')](_0xb4ca('0x1a'),_0x6c1c5b,JSON[_0xb4ca('0x13')](_0x484891));_0x328ed1(_0x484891);})[_0xb4ca('0x19')](function(_0x43f81b){logger[_0xb4ca('0x14')](_0xb4ca('0x1a'),_0x43f81b[_0xb4ca('0x17')],_0x6c1c5b);_0x235132(_0x5d17eb[_0xb4ca('0x14')](0x1f4,_0x43f81b[_0xb4ca('0x17')]));});});};
\ No newline at end of file
+var _0xa927=['literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0xa927,0x1d7));var _0x7a92=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa927[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7a92('0x0'));var util=require('util');var moment=require(_0x7a92('0x1'));var BPromise=require(_0x7a92('0x2'));var rs=require(_0x7a92('0x3'));var fs=require('fs');var Redis=require(_0x7a92('0x4'));var db=require(_0x7a92('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7a92('0x6'));var client=jayson[_0x7a92('0x7')]['http']({'port':0x232a});config['redis']=_[_0x7a92('0x8')](config[_0x7a92('0x9')],{'host':_0x7a92('0xa'),'port':0x18eb});var socket=require(_0x7a92('0xb'))(new Redis(config[_0x7a92('0x9')]));require(_0x7a92('0xc'))[_0x7a92('0xd')](socket);function respondWithRpcPromise(_0xa1d209,_0x21a37d,_0x4c03bb){return new BPromise(function(_0x449813,_0x3b8531){return client[_0x7a92('0xe')](_0xa1d209,_0x4c03bb)[_0x7a92('0xf')](function(_0x4caee3){logger['info'](_0x7a92('0x10'),_0x21a37d,'request\x20sent');logger[_0x7a92('0x11')](_0x7a92('0x12'),_0x21a37d,_0x7a92('0x13'),JSON[_0x7a92('0x14')](_0x4caee3));if(_0x4caee3[_0x7a92('0x15')]){if(_0x4caee3[_0x7a92('0x15')][_0x7a92('0x16')]===0x1f4){logger[_0x7a92('0x15')](_0x7a92('0x10'),_0x21a37d,_0x4caee3['error']['message']);return _0x3b8531(_0x4caee3[_0x7a92('0x15')][_0x7a92('0x17')]);}logger[_0x7a92('0x15')](_0x7a92('0x10'),_0x21a37d,_0x4caee3[_0x7a92('0x15')][_0x7a92('0x17')]);return _0x449813(_0x4caee3[_0x7a92('0x15')][_0x7a92('0x17')]);}else{logger[_0x7a92('0x18')](_0x7a92('0x10'),_0x21a37d,_0x7a92('0x13'));_0x449813(_0x4caee3[_0x7a92('0x19')][_0x7a92('0x17')]);}})[_0x7a92('0x1a')](function(_0x40ba0d){logger[_0x7a92('0x15')](_0x7a92('0x10'),_0x21a37d,_0x40ba0d);_0x3b8531(_0x40ba0d);});});}exports[_0x7a92('0x1b')]=function(_0x726b37){var _0x7901d7=this;return new Promise(function(_0x5c6469,_0x4ede86){return db['UserVoiceQueueRt'][_0x7a92('0x1c')]({'raw':_0x726b37['options']?_0x726b37[_0x7a92('0x1d')][_0x7a92('0x1e')]===undefined?!![]:![]:!![],'where':_0x726b37[_0x7a92('0x1d')]?_0x726b37[_0x7a92('0x1d')][_0x7a92('0x1f')]||null:null,'attributes':[[db[_0x7a92('0x20')]['fn']('COUNT',db[_0x7a92('0x20')]['fn']('IF',db['sequelize'][_0x7a92('0x21')](_0x7a92('0x22')))),_0x7a92('0x23')]]})['then'](function(_0x5bb34e){logger['info'](_0x7a92('0x1b'),_0x726b37);logger[_0x7a92('0x11')](_0x7a92('0x1b'),_0x726b37,JSON[_0x7a92('0x14')](_0x5bb34e));_0x5c6469(_0x5bb34e);})[_0x7a92('0x1a')](function(_0x388dc1){logger[_0x7a92('0x15')](_0x7a92('0x1b'),_0x388dc1[_0x7a92('0x17')],_0x726b37);_0x4ede86(_0x7901d7[_0x7a92('0x15')](0x1f4,_0x388dc1[_0x7a92('0x17')]));});});};
\ No newline at end of file
index 31e4410..36bf885 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02a7=['length','userVoiceQueueRt:','save','emit','removeListener'];(function(_0x389030,_0x63494f){var _0x3de31a=function(_0x27b957){while(--_0x27b957){_0x389030['push'](_0x389030['shift']());}};_0x3de31a(++_0x63494f);}(_0x02a7,0x7a));var _0x702a=function(_0x2d9dad,_0x4c5340){_0x2d9dad=_0x2d9dad-0x0;var _0x4514bc=_0x02a7[_0x2d9dad];return _0x4514bc;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x702a('0x0'),'remove','update'];function createListener(_0x30b64d,_0x30573e){return function(_0x325874){_0x30573e[_0x702a('0x1')](_0x30b64d,_0x325874);};}function removeListener(_0x4612ca,_0x1fc26b){return function(){UserVoiceQueueRtEvents[_0x702a('0x2')](_0x4612ca,_0x1fc26b);};}exports['register']=function(_0x1bcfe5){for(var _0x5b7d8c=0x0,_0x26b25e=events[_0x702a('0x3')];_0x5b7d8c<_0x26b25e;_0x5b7d8c++){var _0x3f2954=events[_0x5b7d8c];var _0x161dee=createListener(_0x702a('0x4')+_0x3f2954,_0x1bcfe5);UserVoiceQueueRtEvents['on'](_0x3f2954,_0x161dee);}};
\ No newline at end of file
+var _0x5294=['./userVoiceQueueRt.events','save','remove','update','emit','register','userVoiceQueueRt:'];(function(_0x2d1784,_0x3a2c48){var _0x1b044a=function(_0x4b5f0a){while(--_0x4b5f0a){_0x2d1784['push'](_0x2d1784['shift']());}};_0x1b044a(++_0x3a2c48);}(_0x5294,0x111));var _0x4529=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5294[_0x5ddb1c];return _0x354adc;};'use strict';var UserVoiceQueueRtEvents=require(_0x4529('0x0'));var events=[_0x4529('0x1'),_0x4529('0x2'),_0x4529('0x3')];function createListener(_0x3966bb,_0xae7bd5){return function(_0x545d4a){_0xae7bd5[_0x4529('0x4')](_0x3966bb,_0x545d4a);};}function removeListener(_0x12d02e,_0xb3fbab){return function(){UserVoiceQueueRtEvents['removeListener'](_0x12d02e,_0xb3fbab);};}exports[_0x4529('0x5')]=function(_0x2c78e9){for(var _0x10192d=0x0,_0x38a095=events['length'];_0x10192d<_0x38a095;_0x10192d++){var _0xd3adaa=events[_0x10192d];var _0x3737de=createListener(_0x4529('0x6')+_0xd3adaa,_0x2c78e9);UserVoiceQueueRtEvents['on'](_0xd3adaa,_0x3737de);}};
\ No newline at end of file
index 3882585..3acf7ea 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(_0x3f9133,_0x401baa){var _0x4c3fc1=function(_0x41782b){while(--_0x41782b){_0x3f9133['push'](_0x3f9133['shift']());}};_0x4c3fc1(++_0x401baa);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b1c4d,_0x5a3381){_0x2b1c4d=_0x2b1c4d-0x0;var _0x10f474=_0xedd9[_0x2b1c4d];return _0x10f474;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'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 4f320b4..6712e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd60b=['exports'];(function(_0x11f5f8,_0x56b48a){var _0x1e6051=function(_0x2d7764){while(--_0x2d7764){_0x11f5f8['push'](_0x11f5f8['shift']());}};_0x1e6051(++_0x56b48a);}(_0xd60b,0x198));var _0xbd60=function(_0x300c19,_0xd16ed6){_0x300c19=_0x300c19-0x0;var _0x3ec3c0=_0xd60b[_0x300c19];return _0x3ec3c0;};'use strict';var Sequelize=require('sequelize');module[_0xbd60('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2649=['exports','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2649,0x16a));var _0x9264=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x2649[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require('sequelize');module[_0x9264('0x0')]={'penalty':{'type':Sequelize[_0x9264('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index df8f114..831e2db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f35=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x50bc15,_0x1c914c){var _0x53c18b=function(_0x1e515a){while(--_0x1e515a){_0x50bc15['push'](_0x50bc15['shift']());}};_0x53c18b(++_0x1c914c);}(_0x5f35,0x1ec));var _0x55f3=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x5f35[_0x56e4e7];return _0x383618;};'use strict';var _=require(_0x55f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55f3('0x1'));var moment=require(_0x55f3('0x2'));var BPromise=require(_0x55f3('0x3'));var rp=require(_0x55f3('0x4'));var fs=require('fs');var path=require(_0x55f3('0x5'));var rimraf=require(_0x55f3('0x6'));var config=require(_0x55f3('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x55f3('0x8')]=function(_0x4f0de6,_0x134b14){return _0x4f0de6[_0x55f3('0x9')](_0x55f3('0xa'),attributes,{'tableName':_0x55f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7e6c=['UserWhatsappQueue','user_has_whatsapp_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x7e6c,0x116));var _0xc7e6=function(_0x1876c7,_0x379202){_0x1876c7=_0x1876c7-0x0;var _0x2b9572=_0x7e6c[_0x1876c7];return _0x2b9572;};'use strict';var _=require('lodash');var util=require(_0xc7e6('0x0'));var logger=require('../../config/logger')(_0xc7e6('0x1'));var moment=require(_0xc7e6('0x2'));var BPromise=require(_0xc7e6('0x3'));var rp=require(_0xc7e6('0x4'));var fs=require('fs');var path=require(_0xc7e6('0x5'));var rimraf=require(_0xc7e6('0x6'));var config=require(_0xc7e6('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc7e6('0x8')]=function(_0x154a14,_0x4f8032){return _0x154a14[_0xc7e6('0x9')](_0xc7e6('0xa'),attributes,{'tableName':_0xc7e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1e03f29..db12dc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35d9=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','then','debug'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x35d9,0x15e));var _0x935d=function(_0x5582eb,_0x1bd06c){_0x5582eb=_0x5582eb-0x0;var _0x3a34f1=_0x35d9[_0x5582eb];return _0x3a34f1;};'use strict';var _=require(_0x935d('0x0'));var util=require(_0x935d('0x1'));var moment=require(_0x935d('0x2'));var BPromise=require('bluebird');var rs=require(_0x935d('0x3'));var fs=require('fs');var Redis=require(_0x935d('0x4'));var db=require(_0x935d('0x5'))['db'];var utils=require(_0x935d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x935d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x935d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41f751,_0x36d2d4,_0x3f47b6){return new BPromise(function(_0xd18ecb,_0x5cd45e){return client['request'](_0x41f751,_0x3f47b6)[_0x935d('0x9')](function(_0x3e6288){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x36d2d4,'request\x20sent');logger[_0x935d('0xa')](_0x935d('0xb'),_0x36d2d4,_0x935d('0xc'),JSON[_0x935d('0xd')](_0x3e6288));if(_0x3e6288['error']){if(_0x3e6288['error']['code']===0x1f4){logger[_0x935d('0xe')](_0x935d('0xf'),_0x36d2d4,_0x3e6288[_0x935d('0xe')][_0x935d('0x10')]);return _0x5cd45e(_0x3e6288['error'][_0x935d('0x10')]);}logger[_0x935d('0xe')](_0x935d('0xf'),_0x36d2d4,_0x3e6288[_0x935d('0xe')][_0x935d('0x10')]);return _0xd18ecb(_0x3e6288[_0x935d('0xe')][_0x935d('0x10')]);}else{logger[_0x935d('0x11')](_0x935d('0xf'),_0x36d2d4,'request\x20sent');_0xd18ecb(_0x3e6288['result'][_0x935d('0x10')]);}})[_0x935d('0x12')](function(_0x24db12){logger[_0x935d('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x36d2d4,_0x24db12);_0x5cd45e(_0x24db12);});});}
\ No newline at end of file
+var _0x739d=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1db341,_0x4b939f){var _0x586b89=function(_0x271fba){while(--_0x271fba){_0x1db341['push'](_0x1db341['shift']());}};_0x586b89(++_0x4b939f);}(_0x739d,0x120));var _0xd739=function(_0x3c7f43,_0x538110){_0x3c7f43=_0x3c7f43-0x0;var _0x4e2e94=_0x739d[_0x3c7f43];return _0x4e2e94;};'use strict';var _=require(_0xd739('0x0'));var util=require(_0xd739('0x1'));var moment=require(_0xd739('0x2'));var BPromise=require(_0xd739('0x3'));var rs=require(_0xd739('0x4'));var fs=require('fs');var Redis=require(_0xd739('0x5'));var db=require(_0xd739('0x6'))['db'];var utils=require(_0xd739('0x7'));var logger=require(_0xd739('0x8'))(_0xd739('0x9'));var config=require(_0xd739('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33ae0d,_0xcb7049,_0x3cf59f){return new BPromise(function(_0x14a9d9,_0x3d2b08){return client[_0xd739('0xb')](_0x33ae0d,_0x3cf59f)[_0xd739('0xc')](function(_0x5c15eb){logger['info'](_0xd739('0xd'),_0xcb7049,_0xd739('0xe'));logger[_0xd739('0xf')](_0xd739('0x10'),_0xcb7049,_0xd739('0xe'),JSON['stringify'](_0x5c15eb));if(_0x5c15eb[_0xd739('0x11')]){if(_0x5c15eb['error']['code']===0x1f4){logger[_0xd739('0x11')](_0xd739('0xd'),_0xcb7049,_0x5c15eb[_0xd739('0x11')][_0xd739('0x12')]);return _0x3d2b08(_0x5c15eb['error'][_0xd739('0x12')]);}logger[_0xd739('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0xcb7049,_0x5c15eb[_0xd739('0x11')][_0xd739('0x12')]);return _0x14a9d9(_0x5c15eb[_0xd739('0x11')][_0xd739('0x12')]);}else{logger['info'](_0xd739('0xd'),_0xcb7049,_0xd739('0xe'));_0x14a9d9(_0x5c15eb['result'][_0xd739('0x12')]);}})['catch'](function(_0x199e7f){logger['error'](_0xd739('0xd'),_0xcb7049,_0x199e7f);_0x3d2b08(_0x199e7f);});});}
\ No newline at end of file
index 0a31a7e..8ca05b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fb7=['./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4f09af,_0x186fb9){var _0x4226e9=function(_0x33d41b){while(--_0x33d41b){_0x4f09af['push'](_0x4f09af['shift']());}};_0x4226e9(++_0x186fb9);}(_0x3fb7,0x189));var _0x73fb=function(_0x1e6049,_0x424904){_0x1e6049=_0x1e6049-0x0;var _0x3ac5fd=_0x3fb7[_0x1e6049];return _0x3ac5fd;};'use strict';var multer=require('multer');var util=require(_0x73fb('0x0'));var path=require('path');var timeout=require(_0x73fb('0x1'));var express=require(_0x73fb('0x2'));var router=express['Router']();var fs_extra=require(_0x73fb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x73fb('0x4'));var config=require(_0x73fb('0x5'));var controller=require(_0x73fb('0x6'));router[_0x73fb('0x7')]('/',auth[_0x73fb('0x8')](),controller[_0x73fb('0x9')]);router[_0x73fb('0x7')](_0x73fb('0xa'),auth[_0x73fb('0x8')](),controller[_0x73fb('0xb')]);router[_0x73fb('0xc')]('/',auth[_0x73fb('0x8')](),controller[_0x73fb('0xd')]);router[_0x73fb('0xe')](_0x73fb('0xa'),auth[_0x73fb('0x8')](),controller[_0x73fb('0xf')]);router[_0x73fb('0x10')](_0x73fb('0xa'),auth[_0x73fb('0x8')](),controller[_0x73fb('0x11')]);module[_0x73fb('0x12')]=router;
\ No newline at end of file
+var _0x48d0=['../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x22a4b5,_0xea5c2e){var _0x11f6e6=function(_0x4d30aa){while(--_0x4d30aa){_0x22a4b5['push'](_0x22a4b5['shift']());}};_0x11f6e6(++_0xea5c2e);}(_0x48d0,0xd3));var _0x048d=function(_0x136f96,_0x2d8f6a){_0x136f96=_0x136f96-0x0;var _0x5a30d5=_0x48d0[_0x136f96];return _0x5a30d5;};'use strict';var multer=require(_0x048d('0x0'));var util=require(_0x048d('0x1'));var path=require('path');var timeout=require(_0x048d('0x2'));var express=require(_0x048d('0x3'));var router=express[_0x048d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x048d('0x5'));var interaction=require(_0x048d('0x6'));var config=require('../../config/environment');var controller=require(_0x048d('0x7'));router[_0x048d('0x8')]('/',auth[_0x048d('0x9')](),controller['index']);router[_0x048d('0x8')](_0x048d('0xa'),auth['isAuthenticated'](),controller[_0x048d('0xb')]);router[_0x048d('0xc')]('/',auth[_0x048d('0x9')](),controller[_0x048d('0xd')]);router[_0x048d('0xe')](_0x048d('0xa'),auth[_0x048d('0x9')](),controller[_0x048d('0xf')]);router[_0x048d('0x10')](_0x048d('0xa'),auth[_0x048d('0x9')](),controller[_0x048d('0x11')]);module['exports']=router;
\ No newline at end of file
index ddf015a..c1c6466 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d7e=['sequelize','STRING'];(function(_0x26a810,_0x247776){var _0x4758a3=function(_0xa1fbb9){while(--_0xa1fbb9){_0x26a810['push'](_0x26a810['shift']());}};_0x4758a3(++_0x247776);}(_0x3d7e,0x1ae));var _0xe3d7=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x3d7e[_0x43a37c];return _0x5d1d40;};'use strict';var Sequelize=require(_0xe3d7('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3d7('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe3d7('0x1')]}};
\ No newline at end of file
+var _0x4d85=['sequelize','STRING','name'];(function(_0x322e45,_0x5c01c4){var _0x39ffd7=function(_0x53df5c){while(--_0x53df5c){_0x322e45['push'](_0x322e45['shift']());}};_0x39ffd7(++_0x5c01c4);}(_0x4d85,0x99));var _0x54d8=function(_0x49deb7,_0x1c43f4){_0x49deb7=_0x49deb7-0x0;var _0x2c2aa6=_0x4d85[_0x49deb7];return _0x2c2aa6;};'use strict';var Sequelize=require(_0x54d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x54d8('0x1')],'unique':_0x54d8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x54d8('0x1')]}};
\ No newline at end of file
index d329632..e4f0393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x257e=['include','findAll','rows','show','params','includeAll','options','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','Variable'];(function(_0x343e73,_0x38533c){var _0x409515=function(_0x29548f){while(--_0x29548f){_0x343e73['push'](_0x343e73['shift']());}};_0x409515(++_0x38533c);}(_0x257e,0x16a));var _0xe257=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x257e[_0x568a61];return _0x334c3b;};'use strict';var emlformat=require(_0xe257('0x0'));var rimraf=require(_0xe257('0x1'));var zipdir=require(_0xe257('0x2'));var jsonpatch=require(_0xe257('0x3'));var rp=require(_0xe257('0x4'));var moment=require(_0xe257('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe257('0x6'));var util=require(_0xe257('0x7'));var path=require(_0xe257('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe257('0x9'));var fs=require('fs');var fs_extra=require(_0xe257('0xa'));var _=require(_0xe257('0xb'));var squel=require(_0xe257('0xc'));var crypto=require(_0xe257('0xd'));var jsforce=require(_0xe257('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe257('0xf'));var querystring=require(_0xe257('0x10'));var Papa=require('papaparse');var Redis=require(_0xe257('0x11'));var authService=require(_0xe257('0x12'));var qs=require(_0xe257('0x13'));var as=require(_0xe257('0x14'));var hardwareService=require(_0xe257('0x15'));var logger=require(_0xe257('0x16'))(_0xe257('0x17'));var utils=require(_0xe257('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe257('0x19'));var db=require(_0xe257('0x1a'))['db'];function respondWithStatusCode(_0x127305,_0x130e17){_0x130e17=_0x130e17||0xcc;return function(_0x773c13){if(_0x773c13){return _0x127305[_0xe257('0x1b')](_0x130e17);}return _0x127305[_0xe257('0x1c')](_0x130e17)[_0xe257('0x1d')]();};}function respondWithResult(_0x1e4006,_0x4a4f59){_0x4a4f59=_0x4a4f59||0xc8;return function(_0x580811){if(_0x580811){return _0x1e4006['status'](_0x4a4f59)[_0xe257('0x1e')](_0x580811);}};}function respondWithFilteredResult(_0x4bff1f,_0x248307){return function(_0x4c0165){if(_0x4c0165){var _0xd1079=typeof _0x248307[_0xe257('0x1f')]==='undefined'&&typeof _0x248307[_0xe257('0x20')]===_0xe257('0x21');var _0x1ade0d=_0x4c0165['count'];var _0x598e5e=_0xd1079?0x0:_0x248307[_0xe257('0x1f')];var _0x4f3830=_0xd1079?_0x4c0165[_0xe257('0x22')]:_0x248307['offset']+_0x248307[_0xe257('0x20')];var _0x1e86d2;if(_0x4f3830>=_0x1ade0d){_0x4f3830=_0x1ade0d;_0x1e86d2=0xc8;}else{_0x1e86d2=0xce;}_0x4bff1f[_0xe257('0x1c')](_0x1e86d2);return _0x4bff1f['set'](_0xe257('0x23'),_0x598e5e+'-'+_0x4f3830+'/'+_0x1ade0d)[_0xe257('0x1e')](_0x4c0165);}return null;};}function patchUpdates(_0x2ef9af){return function(_0x4c0be8){try{jsonpatch[_0xe257('0x24')](_0x4c0be8,_0x2ef9af,!![]);}catch(_0x4e9dc0){return BPromise[_0xe257('0x25')](_0x4e9dc0);}return _0x4c0be8[_0xe257('0x26')]();};}function saveUpdates(_0x67b3c4,_0x272ebb){return function(_0x4b4dcc){if(_0x4b4dcc){return _0x4b4dcc[_0xe257('0x27')](_0x67b3c4)[_0xe257('0x28')](function(_0x4b824c){return _0x4b824c;});}return null;};}function removeEntity(_0x4621aa,_0x491850){return function(_0x37bac7){if(_0x37bac7){return _0x37bac7[_0xe257('0x29')]()[_0xe257('0x28')](function(){var _0x4bd3a=_0x37bac7[_0xe257('0x2a')]({'plain':!![]});var _0x41b51d=_0xe257('0x2b');return db[_0xe257('0x2c')][_0xe257('0x29')]({'where':{'type':_0x41b51d,'resourceId':_0x4bd3a['id']}})['then'](function(){return _0x37bac7;});})['then'](function(){_0x4621aa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x135e31,_0x329d6e){return function(_0x17ec88){if(!_0x17ec88){_0x135e31[_0xe257('0x1b')](0x194);}return _0x17ec88;};}function handleError(_0x513b82,_0x2fa07e){_0x2fa07e=_0x2fa07e||0x1f4;return function(_0x1ce878){logger[_0xe257('0x2d')](_0x1ce878[_0xe257('0x2e')]);if(_0x1ce878[_0xe257('0x2f')]){delete _0x1ce878[_0xe257('0x2f')];}_0x513b82[_0xe257('0x1c')](_0x2fa07e)['send'](_0x1ce878);};}exports['index']=function(_0x5b02a1,_0x9b2b76){var _0x3aca07={},_0x551a69={},_0x1893c5={'count':0x0,'rows':[]};var _0x3d945f=_['map'](db['Variable'][_0xe257('0x30')],function(_0x48aa57){return{'name':_0x48aa57['fieldName'],'type':_0x48aa57[_0xe257('0x31')][_0xe257('0x32')]};});_0x551a69[_0xe257('0x33')]=_[_0xe257('0x34')](_0x3d945f,_0xe257('0x2f'));_0x551a69[_0xe257('0x35')]=_[_0xe257('0x36')](_0x5b02a1[_0xe257('0x35')]);_0x551a69[_0xe257('0x37')]=_['intersection'](_0x551a69[_0xe257('0x33')],_0x551a69[_0xe257('0x35')]);_0x3aca07[_0xe257('0x38')]=_[_0xe257('0x39')](_0x551a69['model'],qs['fields'](_0x5b02a1[_0xe257('0x35')][_0xe257('0x3a')]));_0x3aca07[_0xe257('0x38')]=_0x3aca07[_0xe257('0x38')][_0xe257('0x3b')]?_0x3aca07[_0xe257('0x38')]:_0x551a69[_0xe257('0x33')];if(!_0x5b02a1[_0xe257('0x35')][_0xe257('0x3c')]('nolimit')){_0x3aca07[_0xe257('0x20')]=qs[_0xe257('0x20')](_0x5b02a1[_0xe257('0x35')]['limit']);_0x3aca07[_0xe257('0x1f')]=qs[_0xe257('0x1f')](_0x5b02a1['query'][_0xe257('0x1f')]);}_0x3aca07[_0xe257('0x3d')]=qs[_0xe257('0x3e')](_0x5b02a1['query'][_0xe257('0x3e')]);_0x3aca07['where']=qs[_0xe257('0x37')](_['pick'](_0x5b02a1['query'],_0x551a69[_0xe257('0x37')]),_0x3d945f);if(_0x5b02a1[_0xe257('0x35')][_0xe257('0x3f')]){_0x3aca07['where']=_[_0xe257('0x40')](_0x3aca07[_0xe257('0x41')],{'$or':_['map'](_0x3d945f,function(_0x580699){if(_0x580699[_0xe257('0x31')]!==_0xe257('0x42')){var _0x33e10d={};_0x33e10d[_0x580699[_0xe257('0x2f')]]={'$like':'%'+_0x5b02a1[_0xe257('0x35')]['filter']+'%'};return _0x33e10d;}})});}_0x3aca07=_[_0xe257('0x40')]({},_0x3aca07,_0x5b02a1['options']);var _0x1ac313={'where':_0x3aca07[_0xe257('0x41')]};return db[_0xe257('0x43')][_0xe257('0x22')](_0x1ac313)[_0xe257('0x28')](function(_0x2be7fd){_0x1893c5[_0xe257('0x22')]=_0x2be7fd;if(_0x5b02a1[_0xe257('0x35')]['includeAll']){_0x3aca07[_0xe257('0x44')]=[{'all':!![]}];}return db[_0xe257('0x43')][_0xe257('0x45')](_0x3aca07);})[_0xe257('0x28')](function(_0x45d620){_0x1893c5[_0xe257('0x46')]=_0x45d620;return _0x1893c5;})[_0xe257('0x28')](respondWithFilteredResult(_0x9b2b76,_0x3aca07))['catch'](handleError(_0x9b2b76,null));};exports[_0xe257('0x47')]=function(_0x497b52,_0x3c2962){var _0x3112e4={'raw':!![],'where':{'id':_0x497b52[_0xe257('0x48')]['id']}},_0xade59b={};_0xade59b[_0xe257('0x33')]=_[_0xe257('0x36')](db[_0xe257('0x43')]['rawAttributes']);_0xade59b['query']=_[_0xe257('0x36')](_0x497b52['query']);_0xade59b[_0xe257('0x37')]=_['intersection'](_0xade59b[_0xe257('0x33')],_0xade59b[_0xe257('0x35')]);_0x3112e4[_0xe257('0x38')]=_[_0xe257('0x39')](_0xade59b[_0xe257('0x33')],qs['fields'](_0x497b52[_0xe257('0x35')][_0xe257('0x3a')]));_0x3112e4[_0xe257('0x38')]=_0x3112e4[_0xe257('0x38')][_0xe257('0x3b')]?_0x3112e4[_0xe257('0x38')]:_0xade59b['model'];if(_0x497b52['query'][_0xe257('0x49')]){_0x3112e4['include']=[{'all':!![]}];}_0x3112e4=_['merge']({},_0x3112e4,_0x497b52[_0xe257('0x4a')]);return db[_0xe257('0x43')][_0xe257('0x4b')](_0x3112e4)['then'](handleEntityNotFound(_0x3c2962,null))[_0xe257('0x28')](respondWithResult(_0x3c2962,null))['catch'](handleError(_0x3c2962,null));};exports[_0xe257('0x4c')]=function(_0x396499,_0x232a33){return db['Variable']['create'](_0x396499[_0xe257('0x4d')],{})[_0xe257('0x28')](function(_0xa16589){var _0xd72450=_0x396499[_0xe257('0x4e')]['get']({'plain':!![]});if(!_0xd72450)throw new Error(_0xe257('0x4f'));if(_0xd72450[_0xe257('0x50')]===_0xe257('0x4e')){var _0x182d74=_0xa16589['get']({'plain':!![]});var _0x32cf70=_0xe257('0x2b');return db[_0xe257('0x51')][_0xe257('0x4b')]({'where':{'name':_0x32cf70,'userProfileId':_0xd72450[_0xe257('0x52')]},'raw':!![]})[_0xe257('0x28')](function(_0x488aac){if(_0x488aac&&_0x488aac[_0xe257('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x182d74[_0xe257('0x2f')],'resourceId':_0x182d74['id'],'type':_0x488aac['name'],'sectionId':_0x488aac['id']},{})[_0xe257('0x28')](function(){return _0xa16589;});}else{return _0xa16589;}})[_0xe257('0x54')](function(_0x2f346e){logger[_0xe257('0x2d')](_0xe257('0x55'),_0x2f346e);throw _0x2f346e;});}return _0xa16589;})[_0xe257('0x28')](respondWithResult(_0x232a33,0xc9))[_0xe257('0x54')](handleError(_0x232a33,null));};exports[_0xe257('0x27')]=function(_0x4c5138,_0x59c1c0){if(_0x4c5138[_0xe257('0x4d')]['id']){delete _0x4c5138[_0xe257('0x4d')]['id'];}return db[_0xe257('0x43')][_0xe257('0x4b')]({'where':{'id':_0x4c5138[_0xe257('0x48')]['id']}})[_0xe257('0x28')](handleEntityNotFound(_0x59c1c0,null))[_0xe257('0x28')](saveUpdates(_0x4c5138[_0xe257('0x4d')],null))[_0xe257('0x28')](respondWithResult(_0x59c1c0,null))[_0xe257('0x54')](handleError(_0x59c1c0,null));};exports[_0xe257('0x29')]=function(_0x37d888,_0x408923){return db['Variable'][_0xe257('0x4b')]({'where':{'id':_0x37d888['params']['id']}})[_0xe257('0x28')](handleEntityNotFound(_0x408923,null))[_0xe257('0x28')](removeEntity(_0x408923,null))[_0xe257('0x54')](handleError(_0x408923,null));};
\ No newline at end of file
+var _0xcd17=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','get','Variables','UserProfileResource','name','Variable','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x1deefa,_0x862114){var _0x4fbdb6=function(_0x1f6ef5){while(--_0x1f6ef5){_0x1deefa['push'](_0x1deefa['shift']());}};_0x4fbdb6(++_0x862114);}(_0xcd17,0x96));var _0x7cd1=function(_0x2bf36e,_0x137e92){_0x2bf36e=_0x2bf36e-0x0;var _0x12352d=_0xcd17[_0x2bf36e];return _0x12352d;};'use strict';var emlformat=require(_0x7cd1('0x0'));var rimraf=require(_0x7cd1('0x1'));var zipdir=require(_0x7cd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cd1('0x3'));var moment=require('moment');var BPromise=require(_0x7cd1('0x4'));var Mustache=require(_0x7cd1('0x5'));var util=require(_0x7cd1('0x6'));var path=require(_0x7cd1('0x7'));var sox=require('sox');var csv=require(_0x7cd1('0x8'));var ejs=require(_0x7cd1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cd1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7cd1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7cd1('0xc'));var Papa=require(_0x7cd1('0xd'));var Redis=require(_0x7cd1('0xe'));var authService=require(_0x7cd1('0xf'));var qs=require(_0x7cd1('0x10'));var as=require(_0x7cd1('0x11'));var hardwareService=require(_0x7cd1('0x12'));var logger=require(_0x7cd1('0x13'))(_0x7cd1('0x14'));var utils=require(_0x7cd1('0x15'));var config=require(_0x7cd1('0x16'));var licenseUtil=require(_0x7cd1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554fdf,_0x22c074){_0x22c074=_0x22c074||0xcc;return function(_0x3e84fd){if(_0x3e84fd){return _0x554fdf[_0x7cd1('0x18')](_0x22c074);}return _0x554fdf[_0x7cd1('0x19')](_0x22c074)[_0x7cd1('0x1a')]();};}function respondWithResult(_0x131bf9,_0x513c9d){_0x513c9d=_0x513c9d||0xc8;return function(_0x3af87f){if(_0x3af87f){return _0x131bf9[_0x7cd1('0x19')](_0x513c9d)[_0x7cd1('0x1b')](_0x3af87f);}};}function respondWithFilteredResult(_0x2cddb4,_0x3cc4a5){return function(_0x41ce50){if(_0x41ce50){var _0x48c542=typeof _0x3cc4a5[_0x7cd1('0x1c')]===_0x7cd1('0x1d')&&typeof _0x3cc4a5[_0x7cd1('0x1e')]===_0x7cd1('0x1d');var _0x4329b8=_0x41ce50[_0x7cd1('0x1f')];var _0x5477ac=_0x48c542?0x0:_0x3cc4a5['offset'];var _0x252b17=_0x48c542?_0x41ce50[_0x7cd1('0x1f')]:_0x3cc4a5[_0x7cd1('0x1c')]+_0x3cc4a5[_0x7cd1('0x1e')];var _0x2e00eb;if(_0x252b17>=_0x4329b8){_0x252b17=_0x4329b8;_0x2e00eb=0xc8;}else{_0x2e00eb=0xce;}_0x2cddb4['status'](_0x2e00eb);return _0x2cddb4[_0x7cd1('0x20')](_0x7cd1('0x21'),_0x5477ac+'-'+_0x252b17+'/'+_0x4329b8)[_0x7cd1('0x1b')](_0x41ce50);}return null;};}function patchUpdates(_0x38c093){return function(_0x24568b){try{jsonpatch[_0x7cd1('0x22')](_0x24568b,_0x38c093,!![]);}catch(_0x60bb54){return BPromise['reject'](_0x60bb54);}return _0x24568b[_0x7cd1('0x23')]();};}function saveUpdates(_0x1811b6,_0x29132c){return function(_0x535129){if(_0x535129){return _0x535129['update'](_0x1811b6)['then'](function(_0x52efed){return _0x52efed;});}return null;};}function removeEntity(_0x1c3c66,_0x13f3cf){return function(_0x316d68){if(_0x316d68){return _0x316d68[_0x7cd1('0x24')]()[_0x7cd1('0x25')](function(){var _0x5e28d6=_0x316d68[_0x7cd1('0x26')]({'plain':!![]});var _0x3f2596=_0x7cd1('0x27');return db[_0x7cd1('0x28')][_0x7cd1('0x24')]({'where':{'type':_0x3f2596,'resourceId':_0x5e28d6['id']}})[_0x7cd1('0x25')](function(){return _0x316d68;});})[_0x7cd1('0x25')](function(){_0x1c3c66['status'](0xcc)[_0x7cd1('0x1a')]();});}};}function handleEntityNotFound(_0x5e7a43,_0x5f3cd5){return function(_0x5c0acf){if(!_0x5c0acf){_0x5e7a43['sendStatus'](0x194);}return _0x5c0acf;};}function handleError(_0x1c7dbe,_0x3648b8){_0x3648b8=_0x3648b8||0x1f4;return function(_0x4b2735){logger['error'](_0x4b2735['stack']);if(_0x4b2735['name']){delete _0x4b2735[_0x7cd1('0x29')];}_0x1c7dbe[_0x7cd1('0x19')](_0x3648b8)['send'](_0x4b2735);};}exports['index']=function(_0x35986b,_0x5388a9){var _0x46e19a={},_0x94a4ff={},_0x32aab0={'count':0x0,'rows':[]};var _0x4d5e91=_['map'](db[_0x7cd1('0x2a')][_0x7cd1('0x2b')],function(_0x59e254){return{'name':_0x59e254['fieldName'],'type':_0x59e254[_0x7cd1('0x2c')][_0x7cd1('0x2d')]};});_0x94a4ff[_0x7cd1('0x2e')]=_[_0x7cd1('0x2f')](_0x4d5e91,_0x7cd1('0x29'));_0x94a4ff['query']=_[_0x7cd1('0x30')](_0x35986b[_0x7cd1('0x31')]);_0x94a4ff[_0x7cd1('0x32')]=_[_0x7cd1('0x33')](_0x94a4ff['model'],_0x94a4ff['query']);_0x46e19a[_0x7cd1('0x34')]=_[_0x7cd1('0x33')](_0x94a4ff[_0x7cd1('0x2e')],qs[_0x7cd1('0x35')](_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x35')]));_0x46e19a[_0x7cd1('0x34')]=_0x46e19a[_0x7cd1('0x34')][_0x7cd1('0x36')]?_0x46e19a[_0x7cd1('0x34')]:_0x94a4ff['model'];if(!_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x37')](_0x7cd1('0x38'))){_0x46e19a['limit']=qs['limit'](_0x35986b['query'][_0x7cd1('0x1e')]);_0x46e19a[_0x7cd1('0x1c')]=qs[_0x7cd1('0x1c')](_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x1c')]);}_0x46e19a[_0x7cd1('0x39')]=qs[_0x7cd1('0x3a')](_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x3a')]);_0x46e19a[_0x7cd1('0x3b')]=qs['filters'](_['pick'](_0x35986b['query'],_0x94a4ff['filters']),_0x4d5e91);if(_0x35986b[_0x7cd1('0x31')][_0x7cd1('0x3c')]){_0x46e19a[_0x7cd1('0x3b')]=_[_0x7cd1('0x3d')](_0x46e19a['where'],{'$or':_[_0x7cd1('0x2f')](_0x4d5e91,function(_0x5b0874){if(_0x5b0874[_0x7cd1('0x2c')]!==_0x7cd1('0x3e')){var _0xbc2320={};_0xbc2320[_0x5b0874['name']]={'$like':'%'+_0x35986b[_0x7cd1('0x31')]['filter']+'%'};return _0xbc2320;}})});}_0x46e19a=_[_0x7cd1('0x3d')]({},_0x46e19a,_0x35986b[_0x7cd1('0x3f')]);var _0xa5df2c={'where':_0x46e19a[_0x7cd1('0x3b')]};return db[_0x7cd1('0x2a')][_0x7cd1('0x1f')](_0xa5df2c)[_0x7cd1('0x25')](function(_0x48c4ae){_0x32aab0['count']=_0x48c4ae;if(_0x35986b['query'][_0x7cd1('0x40')]){_0x46e19a[_0x7cd1('0x41')]=[{'all':!![]}];}return db[_0x7cd1('0x2a')][_0x7cd1('0x42')](_0x46e19a);})[_0x7cd1('0x25')](function(_0x5e60f9){_0x32aab0[_0x7cd1('0x43')]=_0x5e60f9;return _0x32aab0;})[_0x7cd1('0x25')](respondWithFilteredResult(_0x5388a9,_0x46e19a))['catch'](handleError(_0x5388a9,null));};exports[_0x7cd1('0x44')]=function(_0x51c966,_0x6076c3){var _0x4b8a70={'raw':!![],'where':{'id':_0x51c966[_0x7cd1('0x45')]['id']}},_0x44eee4={};_0x44eee4[_0x7cd1('0x2e')]=_[_0x7cd1('0x30')](db[_0x7cd1('0x2a')][_0x7cd1('0x2b')]);_0x44eee4['query']=_[_0x7cd1('0x30')](_0x51c966['query']);_0x44eee4[_0x7cd1('0x32')]=_[_0x7cd1('0x33')](_0x44eee4['model'],_0x44eee4[_0x7cd1('0x31')]);_0x4b8a70[_0x7cd1('0x34')]=_[_0x7cd1('0x33')](_0x44eee4[_0x7cd1('0x2e')],qs['fields'](_0x51c966[_0x7cd1('0x31')][_0x7cd1('0x35')]));_0x4b8a70[_0x7cd1('0x34')]=_0x4b8a70[_0x7cd1('0x34')][_0x7cd1('0x36')]?_0x4b8a70[_0x7cd1('0x34')]:_0x44eee4[_0x7cd1('0x2e')];if(_0x51c966[_0x7cd1('0x31')][_0x7cd1('0x40')]){_0x4b8a70[_0x7cd1('0x41')]=[{'all':!![]}];}_0x4b8a70=_[_0x7cd1('0x3d')]({},_0x4b8a70,_0x51c966[_0x7cd1('0x3f')]);return db[_0x7cd1('0x2a')]['find'](_0x4b8a70)[_0x7cd1('0x25')](handleEntityNotFound(_0x6076c3,null))[_0x7cd1('0x25')](respondWithResult(_0x6076c3,null))[_0x7cd1('0x46')](handleError(_0x6076c3,null));};exports[_0x7cd1('0x47')]=function(_0x1798c8,_0x4f05cb){return db[_0x7cd1('0x2a')][_0x7cd1('0x47')](_0x1798c8[_0x7cd1('0x48')],{})['then'](function(_0x5986d4){var _0x445ed5=_0x1798c8[_0x7cd1('0x49')]['get']({'plain':!![]});if(!_0x445ed5)throw new Error(_0x7cd1('0x4a'));if(_0x445ed5[_0x7cd1('0x4b')]===_0x7cd1('0x49')){var _0x18aeef=_0x5986d4['get']({'plain':!![]});var _0x271903=_0x7cd1('0x27');return db[_0x7cd1('0x4c')]['find']({'where':{'name':_0x271903,'userProfileId':_0x445ed5['userProfileId']},'raw':!![]})[_0x7cd1('0x25')](function(_0x1c8b4c){if(_0x1c8b4c&&_0x1c8b4c['autoAssociation']===0x0){return db[_0x7cd1('0x28')]['create']({'name':_0x18aeef[_0x7cd1('0x29')],'resourceId':_0x18aeef['id'],'type':_0x1c8b4c['name'],'sectionId':_0x1c8b4c['id']},{})[_0x7cd1('0x25')](function(){return _0x5986d4;});}else{return _0x5986d4;}})[_0x7cd1('0x46')](function(_0x2f340e){logger['error'](_0x7cd1('0x4d'),_0x2f340e);throw _0x2f340e;});}return _0x5986d4;})['then'](respondWithResult(_0x4f05cb,0xc9))[_0x7cd1('0x46')](handleError(_0x4f05cb,null));};exports[_0x7cd1('0x4e')]=function(_0x45327b,_0x52b7eb){if(_0x45327b[_0x7cd1('0x48')]['id']){delete _0x45327b[_0x7cd1('0x48')]['id'];}return db[_0x7cd1('0x2a')][_0x7cd1('0x4f')]({'where':{'id':_0x45327b['params']['id']}})[_0x7cd1('0x25')](handleEntityNotFound(_0x52b7eb,null))[_0x7cd1('0x25')](saveUpdates(_0x45327b[_0x7cd1('0x48')],null))[_0x7cd1('0x25')](respondWithResult(_0x52b7eb,null))[_0x7cd1('0x46')](handleError(_0x52b7eb,null));};exports[_0x7cd1('0x24')]=function(_0x2023a8,_0x39360b){return db['Variable']['find']({'where':{'id':_0x2023a8[_0x7cd1('0x45')]['id']}})['then'](handleEntityNotFound(_0x39360b,null))[_0x7cd1('0x25')](removeEntity(_0x39360b,null))[_0x7cd1('0x46')](handleError(_0x39360b,null));};
\ No newline at end of file
index e12a26d..8d71b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xede9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./variable.attributes','exports'];(function(_0x29cffb,_0x3bf4db){var _0x4985c3=function(_0x2bdf35){while(--_0x2bdf35){_0x29cffb['push'](_0x29cffb['shift']());}};_0x4985c3(++_0x3bf4db);}(_0xede9,0xc8));var _0x9ede=function(_0x15469e,_0x599212){_0x15469e=_0x15469e-0x0;var _0x49a40b=_0xede9[_0x15469e];return _0x49a40b;};'use strict';var _=require(_0x9ede('0x0'));var util=require(_0x9ede('0x1'));var logger=require(_0x9ede('0x2'))(_0x9ede('0x3'));var moment=require(_0x9ede('0x4'));var BPromise=require(_0x9ede('0x5'));var rp=require(_0x9ede('0x6'));var fs=require('fs');var path=require(_0x9ede('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9ede('0x8'));module[_0x9ede('0x9')]=function(_0x50f2f1,_0x56d02a){return _0x50f2f1['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41d3=['rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1eea05,_0x5cd9f0){var _0x22fe7f=function(_0x109b5c){while(--_0x109b5c){_0x1eea05['push'](_0x1eea05['shift']());}};_0x22fe7f(++_0x5cd9f0);}(_0x41d3,0x165));var _0x341d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x41d3[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x341d('0x0'));var util=require(_0x341d('0x1'));var logger=require(_0x341d('0x2'))('api');var moment=require(_0x341d('0x3'));var BPromise=require(_0x341d('0x4'));var rp=require(_0x341d('0x5'));var fs=require('fs');var path=require(_0x341d('0x6'));var rimraf=require(_0x341d('0x7'));var config=require(_0x341d('0x8'));var attributes=require(_0x341d('0x9'));module[_0x341d('0xa')]=function(_0x58fec7,_0x1bced4){return _0x58fec7[_0x341d('0xb')](_0x341d('0xc'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d7743ac..5f3bd12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x366913,_0x1eb63e){var _0x4d3ed5=function(_0x3b1dda){while(--_0x3b1dda){_0x366913['push'](_0x366913['shift']());}};_0x4d3ed5(++_0x1eb63e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x587beb,_0xbfaebc){_0x587beb=_0x587beb-0x0;var _0x381fd6=_0x1cb9[_0x587beb];return _0x381fd6;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});};
\ No newline at end of file
+var _0x8ef6=['result','catch','Variable','find','options','raw','include','model','attributes','map','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x44c742,_0x5d69a4){var _0x40fcf0=function(_0x453d3c){while(--_0x453d3c){_0x44c742['push'](_0x44c742['shift']());}};_0x40fcf0(++_0x5d69a4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4da062,_0x422420){_0x4da062=_0x4da062-0x0;var _0x3f6ebb=_0x8ef6[_0x4da062];return _0x3f6ebb;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('Variable,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}exports['ShowVariable']=function(_0x2633c1){var _0x404870=this;return new Promise(function(_0x4ade0d,_0x527870){return db[_0x68ef('0x18')][_0x68ef('0x19')]({'raw':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1['options'][_0x68ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['where']||null:null,'attributes':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')]['attributes']||null:null,'include':_0x2633c1[_0x68ef('0x1a')]?_0x2633c1[_0x68ef('0x1a')][_0x68ef('0x1c')]?_['map'](_0x2633c1['options']['include'],function(_0x26018d){return{'model':db[_0x26018d[_0x68ef('0x1d')]],'as':_0x26018d['as'],'attributes':_0x26018d[_0x68ef('0x1e')],'include':_0x26018d[_0x68ef('0x1c')]?_[_0x68ef('0x1f')](_0x26018d[_0x68ef('0x1c')],function(_0x258cd5){return{'model':db[_0x258cd5[_0x68ef('0x1d')]],'as':_0x258cd5['as'],'attributes':_0x258cd5[_0x68ef('0x1e')],'include':_0x258cd5[_0x68ef('0x1c')]?_['map'](_0x258cd5[_0x68ef('0x1c')],function(_0x57f9ee){return{'model':db[_0x57f9ee['model']],'as':_0x57f9ee['as'],'attributes':_0x57f9ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x68ef('0xc')](function(_0x268f32){logger[_0x68ef('0xd')](_0x68ef('0x20'),_0x2633c1);logger['debug']('ShowVariable',_0x2633c1,JSON[_0x68ef('0x12')](_0x268f32));_0x4ade0d(_0x268f32);})[_0x68ef('0x17')](function(_0x7bf96){logger[_0x68ef('0x13')](_0x68ef('0x20'),_0x7bf96[_0x68ef('0x15')],_0x2633c1);_0x527870(_0x404870[_0x68ef('0x13')](0x1f4,_0x7bf96[_0x68ef('0x15')]));});});};
\ No newline at end of file
index 97521f0..ea2679c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8578=['/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','/restart'];(function(_0x27e922,_0x46ae00){var _0x815f6=function(_0x24f755){while(--_0x24f755){_0x27e922['push'](_0x27e922['shift']());}};_0x815f6(++_0x46ae00);}(_0x8578,0x13e));var _0x8857=function(_0x5d934b,_0x20e020){_0x5d934b=_0x5d934b-0x0;var _0xf1a2fe=_0x8578[_0x5d934b];return _0xf1a2fe;};'use strict';var express=require(_0x8857('0x0'));var router=express['Router']();var auth=require(_0x8857('0x1'));var controller=require(_0x8857('0x2'));router[_0x8857('0x3')]('/',controller[_0x8857('0x4')]);router['get'](_0x8857('0x5'),auth[_0x8857('0x6')](),auth[_0x8857('0x7')](),controller[_0x8857('0x8')]);router[_0x8857('0x3')](_0x8857('0x9'),auth[_0x8857('0x6')](),auth[_0x8857('0x7')](),controller['reset']);router[_0x8857('0x3')](_0x8857('0xa'),auth[_0x8857('0x6')](),auth[_0x8857('0x7')](),controller['pull']);router['get'](_0x8857('0xb'),auth[_0x8857('0x6')](),controller['restart']);router[_0x8857('0x3')](_0x8857('0xc'),controller[_0x8857('0xd')]);module[_0x8857('0xe')]=router;
\ No newline at end of file
+var _0x4d41=['./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','reset','pull','restart','/migrations','migrations','exports','Router','../../components/auth/service'];(function(_0x413f3a,_0xe869e7){var _0x1ae166=function(_0xb4f46c){while(--_0xb4f46c){_0x413f3a['push'](_0x413f3a['shift']());}};_0x1ae166(++_0xe869e7);}(_0x4d41,0x1be));var _0x14d4=function(_0x37222f,_0x25a5ab){_0x37222f=_0x37222f-0x0;var _0x5c5a6d=_0x4d41[_0x37222f];return _0x5c5a6d;};'use strict';var express=require('express');var router=express[_0x14d4('0x0')]();var auth=require(_0x14d4('0x1'));var controller=require(_0x14d4('0x2'));router[_0x14d4('0x3')]('/',controller['index']);router[_0x14d4('0x3')](_0x14d4('0x4'),auth[_0x14d4('0x5')](),auth[_0x14d4('0x6')](),controller[_0x14d4('0x7')]);router[_0x14d4('0x3')]('/reset',auth[_0x14d4('0x5')](),auth[_0x14d4('0x6')](),controller[_0x14d4('0x8')]);router[_0x14d4('0x3')]('/pull',auth['isAuthenticated'](),auth[_0x14d4('0x6')](),controller[_0x14d4('0x9')]);router[_0x14d4('0x3')]('/restart',auth[_0x14d4('0x5')](),controller[_0x14d4('0xa')]);router[_0x14d4('0x3')](_0x14d4('0xb'),controller[_0x14d4('0xc')]);module[_0x14d4('0xd')]=router;
\ No newline at end of file
index 718f36a..72513fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac0=['pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','root','server','length','.js','push','sort','sequelize','Migration','constructor','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then'];(function(_0x5591e1,_0x2d0d49){var _0x27a2e4=function(_0xfcc4){while(--_0xfcc4){_0x5591e1['push'](_0x5591e1['shift']());}};_0x27a2e4(++_0x2d0d49);}(_0xdac0,0xeb));var _0x0dac=function(_0xa5da3f,_0x5b2b0a){_0xa5da3f=_0xa5da3f-0x0;var _0x3b4916=_0xdac0[_0xa5da3f];return _0x3b4916;};'use strict';var Umzug=require(_0x0dac('0x0'));var path=require(_0x0dac('0x1'));var fs=require('fs');var _=require(_0x0dac('0x2'));var pkginfo=require(_0x0dac('0x3'))(module,_0x0dac('0x4'));var compareVersions=require(_0x0dac('0x5'));var exec=require('child_process')[_0x0dac('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x0dac('0x7'));var pm2=require(_0x0dac('0x8'));var logger=require(_0x0dac('0x9'))(_0x0dac('0xa'));var git=require(_0x0dac('0xb'))(config['root']);exports['index']=function(_0x13044b,_0xe6a80f){var _0x57b26e={'current':module[_0x0dac('0xc')]['version'],'phonebar':0x2};if(_0x13044b[_0x0dac('0xd')]&&_0x13044b[_0x0dac('0xd')]['latest']){return git[_0x0dac('0xe')]()[_0x0dac('0xf')](function(_0x4a8236,_0x56bd52){_0x57b26e[_0x0dac('0x10')]=(_0x4a8236?module[_0x0dac('0xc')][_0x0dac('0x4')]:_0x56bd52[_0x0dac('0x10')])||_0x0dac('0x11');return _0xe6a80f[_0x0dac('0x12')](0xc8)[_0x0dac('0x13')](_0x57b26e);});}else{return _0xe6a80f['status'](0xc8)[_0x0dac('0x13')](_0x57b26e);}};exports['fetch']=function(_0x395c1f,_0x32feaf){return git[_0x0dac('0xe')]([_0x0dac('0x14'),_0x0dac('0x15')],function(_0x2803cd){if(_0x2803cd){logger[_0x0dac('0x16')](_0x2803cd);return _0x32feaf[_0x0dac('0x12')](0x1f4)[_0x0dac('0x13')](_0x2803cd);}logger[_0x0dac('0x17')](_0x0dac('0x18'));return _0x32feaf[_0x0dac('0x12')](0xc8)['json']({'output':_0x0dac('0x19')});});};exports[_0x0dac('0x1a')]=function(_0x3c594a,_0x84fd61){return git[_0x0dac('0x1a')]([_0x0dac('0x1b'),_0x0dac('0x1c')],function(_0x16eb6a){if(_0x16eb6a){logger['error'](_0x16eb6a);return _0x84fd61[_0x0dac('0x12')](0x1f4)['json'](_0x16eb6a);}logger[_0x0dac('0x17')](_0x0dac('0x1d'));return _0x84fd61['status'](0xc8)[_0x0dac('0x13')]({'output':_0x0dac('0x1e')});});};exports['pull']=function(_0x8e0c29,_0x164f0e){exec(_0x0dac('0x1f'),function(_0x599a39,_0x9f6526,_0x1852ce){logger[_0x0dac('0x17')](_0x9f6526);logger[_0x0dac('0x17')](_0x1852ce);if(_0x599a39){logger[_0x0dac('0x16')](_0x599a39);return _0x164f0e[_0x0dac('0x12')](0x1f4)['json'](_0x599a39);}return _0x164f0e[_0x0dac('0x12')](0xc8)[_0x0dac('0x13')]({'output':_0x9f6526});});};exports['restart']=function(_0x5b7b11,_0x482d7b){return pm2[_0x0dac('0x20')](_0x0dac('0x21'))[_0x0dac('0x22')](function(_0x34347c){logger['info'](_0x0dac('0x23'),_0x34347c);return _0x482d7b[_0x0dac('0x12')](0xc8)[_0x0dac('0x13')]({'output':_0x0dac('0x24')});})['catch'](function(_0x3742e5){logger['error'](_0x3742e5);return _0x482d7b[_0x0dac('0x12')](0x1f4)[_0x0dac('0x13')](_0x3742e5);});};exports[_0x0dac('0x25')]=function(_0x45c442,_0x5cd170){var _0x10a175=fs['readdirSync'](path[_0x0dac('0x26')](config[_0x0dac('0x27')],_0x0dac('0x28'),'migrations'));var _0x4ba883=[];for(var _0x484786=0x0;_0x484786<_0x10a175[_0x0dac('0x29')];_0x484786++){var _0x2679bc=_0x10a175[_0x484786]['replace'](_0x0dac('0x2a'),'');if(compareVersions(module['exports'][_0x0dac('0x4')],_0x2679bc)===-0x1){_0x4ba883[_0x0dac('0x2b')](_0x2679bc);}}if(_0x4ba883[_0x0dac('0x29')]){var _0x300614=_0x4ba883[_0x0dac('0x2c')](compareVersions);var _0x51b097=new Umzug({'storage':_0x0dac('0x2d'),'storageOptions':{'model':db[_0x0dac('0x2e')],'modelName':_0x0dac('0x2e'),'columnName':_0x0dac('0x4')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db['sequelize'][_0x0dac('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0x0dac('0x27')],_0x0dac('0x28'),_0x0dac('0x25')),'pattern':/\.js$/}});_0x51b097['up']({'migrations':_['map'](_0x300614,function(_0x18fcab){return _0x18fcab+'.js';})})[_0x0dac('0x22')](function(){return _0x5cd170[_0x0dac('0x12')](0xc8)['json']({'output':_0x0dac('0x30')+module[_0x0dac('0xc')][_0x0dac('0x4')]+_0x0dac('0x31')+_[_0x0dac('0x32')](_0x300614),'migrations':_['join'](_0x300614)});})[_0x0dac('0x33')](function(_0x1cda8f){if(_0x1cda8f instanceof db[_0x0dac('0x2d')][_0x0dac('0x34')]){return _0x5cd170['status'](0xc8)[_0x0dac('0x13')]({'output':_0x0dac('0x35')});}else{return _0x5cd170['status'](0x1f4)['json'](_0x1cda8f);}});}else{return _0x5cd170['status'](0xc8)[_0x0dac('0x13')]({'output':_0x0dac('0x35')});}};
\ No newline at end of file
+var _0x6ad5=['migrations','then','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','version','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','length','.js','push','sort','Migration','sequelize','getQueryInterface'];(function(_0x2a5b3b,_0x4ebe31){var _0xae665a=function(_0x59e86a){while(--_0x59e86a){_0x2a5b3b['push'](_0x2a5b3b['shift']());}};_0xae665a(++_0x4ebe31);}(_0x6ad5,0x16b));var _0x56ad=function(_0x3839a7,_0x5af8b0){_0x3839a7=_0x3839a7-0x0;var _0x3309cd=_0x6ad5[_0x3839a7];return _0x3309cd;};'use strict';var Umzug=require(_0x56ad('0x0'));var path=require(_0x56ad('0x1'));var fs=require('fs');var _=require(_0x56ad('0x2'));var pkginfo=require(_0x56ad('0x3'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x56ad('0x4'))[_0x56ad('0x5')];var db=require(_0x56ad('0x6'))['db'];var config=require(_0x56ad('0x7'));var pm2=require(_0x56ad('0x8'));var logger=require(_0x56ad('0x9'))(_0x56ad('0xa'));var git=require('simple-git')(config[_0x56ad('0xb')]);exports[_0x56ad('0xc')]=function(_0x1cedd2,_0x49aa30){var _0x52cd7b={'current':module[_0x56ad('0xd')][_0x56ad('0xe')],'phonebar':0x2};if(_0x1cedd2[_0x56ad('0xf')]&&_0x1cedd2[_0x56ad('0xf')][_0x56ad('0x10')]){return git[_0x56ad('0x11')]()[_0x56ad('0x12')](function(_0x5c57f9,_0x2ce7a1){_0x52cd7b[_0x56ad('0x10')]=(_0x5c57f9?module['exports'][_0x56ad('0xe')]:_0x2ce7a1['latest'])||_0x56ad('0x13');return _0x49aa30[_0x56ad('0x14')](0xc8)['json'](_0x52cd7b);});}else{return _0x49aa30[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')](_0x52cd7b);}};exports['fetch']=function(_0x4c7c21,_0x43e182){return git['fetch']([_0x56ad('0x16'),_0x56ad('0x17')],function(_0x5c8175){if(_0x5c8175){logger[_0x56ad('0x18')](_0x5c8175);return _0x43e182[_0x56ad('0x14')](0x1f4)[_0x56ad('0x15')](_0x5c8175);}logger['info']('git\x20fetch');return _0x43e182[_0x56ad('0x14')](0xc8)['json']({'output':_0x56ad('0x19')});});};exports[_0x56ad('0x1a')]=function(_0x4d1b6c,_0x55fbc1){return git[_0x56ad('0x1a')]([_0x56ad('0x1b'),'FETCH_HEAD'],function(_0x59b1ba){if(_0x59b1ba){logger['error'](_0x59b1ba);return _0x55fbc1['status'](0x1f4)[_0x56ad('0x15')](_0x59b1ba);}logger['info'](_0x56ad('0x1c'));return _0x55fbc1[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')]({'output':_0x56ad('0x1d')});});};exports['pull']=function(_0x2a8956,_0x36f488){exec('npm\x20install\x20--production',function(_0x2c7f33,_0x4bbe6d,_0x4223a2){logger['info'](_0x4bbe6d);logger['info'](_0x4223a2);if(_0x2c7f33){logger[_0x56ad('0x18')](_0x2c7f33);return _0x36f488[_0x56ad('0x14')](0x1f4)[_0x56ad('0x15')](_0x2c7f33);}return _0x36f488[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')]({'output':_0x4bbe6d});});};exports[_0x56ad('0x1e')]=function(_0xaa969e,_0x1b63a3){return pm2[_0x56ad('0x1e')](_0x56ad('0x1f'))['then'](function(_0x245092){logger['info'](_0x56ad('0x20'),_0x245092);return _0x1b63a3['status'](0xc8)[_0x56ad('0x15')]({'output':_0x56ad('0x21')});})[_0x56ad('0x22')](function(_0x476c71){logger[_0x56ad('0x18')](_0x476c71);return _0x1b63a3['status'](0x1f4)[_0x56ad('0x15')](_0x476c71);});};exports['migrations']=function(_0x4b438c,_0x12ed2c){var _0xa0398d=fs[_0x56ad('0x23')](path[_0x56ad('0x24')](config[_0x56ad('0xb')],_0x56ad('0x25'),'migrations'));var _0x4a2cd4=[];for(var _0x128824=0x0;_0x128824<_0xa0398d[_0x56ad('0x26')];_0x128824++){var _0x33046b=_0xa0398d[_0x128824]['replace'](_0x56ad('0x27'),'');if(compareVersions(module[_0x56ad('0xd')][_0x56ad('0xe')],_0x33046b)===-0x1){_0x4a2cd4[_0x56ad('0x28')](_0x33046b);}}if(_0x4a2cd4[_0x56ad('0x26')]){var _0x41552c=_0x4a2cd4[_0x56ad('0x29')](compareVersions);var _0x2448ad=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x56ad('0x2a')],'modelName':_0x56ad('0x2a'),'columnName':_0x56ad('0xe')},'migrations':{'params':[db[_0x56ad('0x2b')][_0x56ad('0x2c')](),db['sequelize']['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x56ad('0x24')](config[_0x56ad('0xb')],_0x56ad('0x25'),_0x56ad('0x2d')),'pattern':/\.js$/}});_0x2448ad['up']({'migrations':_['map'](_0x41552c,function(_0x33a1fa){return _0x33a1fa+_0x56ad('0x27');})})[_0x56ad('0x2e')](function(){return _0x12ed2c['status'](0xc8)[_0x56ad('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x56ad('0xd')][_0x56ad('0xe')]+_0x56ad('0x2f')+_[_0x56ad('0x30')](_0x41552c),'migrations':_['join'](_0x41552c)});})['catch'](function(_0x51bcd4){if(_0x51bcd4 instanceof db['sequelize'][_0x56ad('0x31')]){return _0x12ed2c[_0x56ad('0x14')](0xc8)[_0x56ad('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x12ed2c[_0x56ad('0x14')](0x1f4)['json'](_0x51bcd4);}});}else{return _0x12ed2c['status'](0xc8)[_0x56ad('0x15')]({'output':_0x56ad('0x32')});}};
\ No newline at end of file
index 446dae2..7eb1607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f23=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','put','delete','multer','util','path','connect-timeout','express'];(function(_0x561960,_0x2f22e2){var _0x5802be=function(_0xac13e6){while(--_0xac13e6){_0x561960['push'](_0x561960['shift']());}};_0x5802be(++_0x2f22e2);}(_0x4f23,0x172));var _0x34f2=function(_0x149dd4,_0x24a386){_0x149dd4=_0x149dd4-0x0;var _0x44e91c=_0x4f23[_0x149dd4];return _0x44e91c;};'use strict';var multer=require(_0x34f2('0x0'));var util=require(_0x34f2('0x1'));var path=require(_0x34f2('0x2'));var timeout=require(_0x34f2('0x3'));var express=require(_0x34f2('0x4'));var router=express[_0x34f2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x34f2('0x6'));var config=require(_0x34f2('0x7'));var controller=require('./voiceAgentReport.controller');router[_0x34f2('0x8')]('/',auth[_0x34f2('0x9')](),controller[_0x34f2('0xa')]);router[_0x34f2('0x8')]('/describe',auth[_0x34f2('0x9')](),controller['describe']);router[_0x34f2('0x8')](_0x34f2('0xb'),auth[_0x34f2('0x9')](),controller['show']);router['post']('/',auth[_0x34f2('0x9')](),controller[_0x34f2('0xc')]);router[_0x34f2('0xd')](_0x34f2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x34f2('0xe')](_0x34f2('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe108=['create','put','/:id','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xe108,0xd9));var _0x8e10=function(_0x44c026,_0x31d7ab){_0x44c026=_0x44c026-0x0;var _0x53e051=_0xe108[_0x44c026];return _0x53e051;};'use strict';var multer=require(_0x8e10('0x0'));var util=require(_0x8e10('0x1'));var path=require(_0x8e10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8e10('0x3'));var auth=require(_0x8e10('0x4'));var interaction=require(_0x8e10('0x5'));var config=require(_0x8e10('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x8e10('0x7')]('/',auth[_0x8e10('0x8')](),controller[_0x8e10('0x9')]);router[_0x8e10('0x7')](_0x8e10('0xa'),auth[_0x8e10('0x8')](),controller[_0x8e10('0xb')]);router[_0x8e10('0x7')]('/:id',auth[_0x8e10('0x8')](),controller[_0x8e10('0xc')]);router[_0x8e10('0xd')]('/',auth['isAuthenticated'](),controller[_0x8e10('0xe')]);router[_0x8e10('0xf')](_0x8e10('0x10'),auth[_0x8e10('0x8')](),controller[_0x8e10('0x11')]);router[_0x8e10('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8e10('0x13')]);module[_0x8e10('0x14')]=router;
\ No newline at end of file
index 978be59..8da87d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84a0=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x42375a,_0x551aac){var _0x2d5f43=function(_0x10ef11){while(--_0x10ef11){_0x42375a['push'](_0x42375a['shift']());}};_0x2d5f43(++_0x551aac);}(_0x84a0,0x66));var _0x084a=function(_0x1d32b8,_0x324164){_0x1d32b8=_0x1d32b8-0x0;var _0x1d1d56=_0x84a0[_0x1d32b8];return _0x1d1d56;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'type':{'type':Sequelize[_0x084a('0x2')]},'uniqueid':{'type':Sequelize[_0x084a('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x084a('0x2')]},'queue':{'type':Sequelize[_0x084a('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x084a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x084a('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x084a('0x3')]},'agentdumpAt':{'type':Sequelize[_0x084a('0x3')]},'holdtime':{'type':Sequelize[_0x084a('0x4')]},'agentcomplete':{'type':Sequelize[_0x084a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x084a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x084a('0x4')]},'agentacw':{'type':Sequelize[_0x084a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x084a('0x4')]},'reason':{'type':Sequelize[_0x084a('0x2')]},'lastevent':{'type':Sequelize[_0x084a('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x084a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x084a('0x2')]},'connectedlinename':{'type':Sequelize[_0x084a('0x2')]},'language':{'type':Sequelize[_0x084a('0x2')]},'accountcode':{'type':Sequelize[_0x084a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x084a('0x2')]},'destchannel':{'type':Sequelize[_0x084a('0x2')]},'destchannelstate':{'type':Sequelize[_0x084a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x084a('0x2')]},'destcalleridnum':{'type':Sequelize[_0x084a('0x2')]},'destcalleridname':{'type':Sequelize[_0x084a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x084a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x084a('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x084a('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x084a('0x2')]},'destpriority':{'type':Sequelize[_0x084a('0x2')]},'destuniqueid':{'type':Sequelize[_0x084a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x084a('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x084a('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x084a('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x084a('0x2')]},'transferuniqueid':{'type':Sequelize[_0x084a('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x253d=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x37ad47,_0x59b943){var _0x20dd41=function(_0x58afc4){while(--_0x58afc4){_0x37ad47['push'](_0x37ad47['shift']());}};_0x20dd41(++_0x59b943);}(_0x253d,0x1b3));var _0xd253=function(_0x1192c7,_0x403d79){_0x1192c7=_0x1192c7-0x0;var _0x50ae76=_0x253d[_0x1192c7];return _0x50ae76;};'use strict';var Sequelize=require(_0xd253('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd253('0x1')]},'queue':{'type':Sequelize[_0xd253('0x1')]},'interface':{'type':Sequelize[_0xd253('0x1')]},'membername':{'type':Sequelize[_0xd253('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd253('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xd253('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd253('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd253('0x2')]},'holdtime':{'type':Sequelize[_0xd253('0x3')]},'agentcomplete':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd253('0x3')]},'agentacw':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd253('0x3')]},'reason':{'type':Sequelize[_0xd253('0x1')]},'lastevent':{'type':Sequelize[_0xd253('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd253('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd253('0x1')]},'language':{'type':Sequelize[_0xd253('0x1')]},'accountcode':{'type':Sequelize[_0xd253('0x1')]},'context':{'type':Sequelize[_0xd253('0x1')]},'exten':{'type':Sequelize[_0xd253('0x1')]},'priority':{'type':Sequelize[_0xd253('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd253('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd253('0x1')]},'destcalleridname':{'type':Sequelize[_0xd253('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd253('0x1')]},'destaccountcode':{'type':Sequelize[_0xd253('0x1')]},'destcontext':{'type':Sequelize[_0xd253('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xd253('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd253('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd253('0x1')]},'transfer':{'type':Sequelize[_0xd253('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xd253('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xd253('0x1')]},'agententerreason':{'type':Sequelize[_0xd253('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index dc63328..5aa7f51 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(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 65d7c9a..8d4136c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd7=['util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','report_agent','uniqueid','lodash'];(function(_0x13236f,_0x1a8c23){var _0x26e959=function(_0x4cc108){while(--_0x4cc108){_0x13236f['push'](_0x13236f['shift']());}};_0x26e959(++_0x1a8c23);}(_0x4fd7,0xe6));var _0x74fd=function(_0x1c0363,_0x54b237){_0x1c0363=_0x1c0363-0x0;var _0x1da319=_0x4fd7[_0x1c0363];return _0x1da319;};'use strict';var _=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var logger=require(_0x74fd('0x2'))(_0x74fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x74fd('0x4'));var fs=require('fs');var path=require(_0x74fd('0x5'));var rimraf=require('rimraf');var config=require(_0x74fd('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0x74fd('0x7')]=function(_0x480ec2,_0x1959e1){return _0x480ec2[_0x74fd('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x74fd('0x9'),'paranoid':![],'indexes':[{'fields':[_0x74fd('0xa'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c8e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger'];(function(_0x4ca907,_0x1429c0){var _0x5a8f62=function(_0x792e8d){while(--_0x792e8d){_0x4ca907['push'](_0x4ca907['shift']());}};_0x5a8f62(++_0x1429c0);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x950c48,_0x3acdaf){_0x950c48=_0x950c48-0x0;var _0x20398c=_0x7c8e[_0x950c48];return _0x20398c;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var logger=require(_0xe7c8('0x1'))(_0xe7c8('0x2'));var moment=require(_0xe7c8('0x3'));var BPromise=require(_0xe7c8('0x4'));var rp=require(_0xe7c8('0x5'));var fs=require('fs');var path=require(_0xe7c8('0x6'));var rimraf=require(_0xe7c8('0x7'));var config=require(_0xe7c8('0x8'));var attributes=require(_0xe7c8('0x9'));module[_0xe7c8('0xa')]=function(_0x1f0a65,_0x293383){return _0x1f0a65[_0xe7c8('0xb')](_0xe7c8('0xc'),attributes,{'tableName':_0xe7c8('0xd'),'paranoid':![],'indexes':[{'fields':[_0xe7c8('0xe'),_0xe7c8('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 0b9f552..aab9962 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab8=['../../config/environment','jayson/promise','http','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','CreateVoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ab8,0x6a));var _0x84ab=function(_0x46ba51,_0x55d1b0){_0x46ba51=_0x46ba51-0x0;var _0x2f0612=_0x4ab8[_0x46ba51];return _0x2f0612;};'use strict';var _=require('lodash');var util=require(_0x84ab('0x0'));var moment=require('moment');var BPromise=require(_0x84ab('0x1'));var rs=require(_0x84ab('0x2'));var fs=require('fs');var Redis=require(_0x84ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84ab('0x4'))(_0x84ab('0x5'));var config=require(_0x84ab('0x6'));var jayson=require(_0x84ab('0x7'));var client=jayson['client'][_0x84ab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x347d6d,_0x2220e0,_0x66c3a7){return new BPromise(function(_0x8d1ef3,_0x23075d){return client['request'](_0x347d6d,_0x66c3a7)[_0x84ab('0x9')](function(_0x64f61){logger['info'](_0x84ab('0xa'),_0x2220e0,'request\x20sent');logger[_0x84ab('0xb')](_0x84ab('0xc'),_0x2220e0,'request\x20sent',JSON[_0x84ab('0xd')](_0x64f61));if(_0x64f61[_0x84ab('0xe')]){if(_0x64f61[_0x84ab('0xe')]['code']===0x1f4){logger[_0x84ab('0xe')](_0x84ab('0xa'),_0x2220e0,_0x64f61[_0x84ab('0xe')]['message']);return _0x23075d(_0x64f61[_0x84ab('0xe')][_0x84ab('0xf')]);}logger[_0x84ab('0xe')](_0x84ab('0xa'),_0x2220e0,_0x64f61[_0x84ab('0xe')]['message']);return _0x8d1ef3(_0x64f61[_0x84ab('0xe')]['message']);}else{logger[_0x84ab('0x10')](_0x84ab('0xa'),_0x2220e0,_0x84ab('0x11'));_0x8d1ef3(_0x64f61[_0x84ab('0x12')][_0x84ab('0xf')]);}})[_0x84ab('0x13')](function(_0x22453f){logger[_0x84ab('0xe')](_0x84ab('0xa'),_0x2220e0,_0x22453f);_0x23075d(_0x22453f);});});}exports[_0x84ab('0x14')]=function(_0x4dfd65){var _0x1796b7=this;return new Promise(function(_0x454452,_0x2d8599){return db['VoiceAgentReport'][_0x84ab('0x15')](_0x4dfd65[_0x84ab('0x16')],{'raw':_0x4dfd65[_0x84ab('0x17')]?_0x4dfd65[_0x84ab('0x17')][_0x84ab('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1cde8a){logger[_0x84ab('0x10')](_0x84ab('0x14'),_0x4dfd65);logger[_0x84ab('0xb')](_0x84ab('0x14'),_0x4dfd65,JSON['stringify'](_0x1cde8a));_0x454452(_0x1cde8a);})['catch'](function(_0x2b2039){logger[_0x84ab('0xe')](_0x84ab('0x14'),_0x2b2039[_0x84ab('0xf')],_0x4dfd65);_0x2d8599(_0x1796b7[_0x84ab('0xe')](0x1f4,_0x2b2039[_0x84ab('0xf')]));});});};exports[_0x84ab('0x19')]=function(_0x417a3){var _0x466278=this;return new Promise(function(_0x42e2a0,_0x325f66){return db['VoiceAgentReport'][_0x84ab('0x1a')](_0x417a3['body'],{'raw':_0x417a3[_0x84ab('0x17')]?_0x417a3['options'][_0x84ab('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417a3['options']?_0x417a3[_0x84ab('0x17')][_0x84ab('0x1b')]||null:null,'attributes':_0x417a3[_0x84ab('0x17')]?_0x417a3['options']['attributes']||null:null,'limit':_0x417a3['options']?_0x417a3[_0x84ab('0x17')]['limit']||null:null})[_0x84ab('0x9')](function(_0x3768f8){logger[_0x84ab('0x10')](_0x84ab('0x19'),_0x417a3);logger[_0x84ab('0xb')]('UpdateVoiceAgentReport',_0x417a3,JSON[_0x84ab('0xd')](_0x3768f8));_0x42e2a0(_0x3768f8);})[_0x84ab('0x13')](function(_0x18836a){logger['error']('UpdateVoiceAgentReport',_0x18836a[_0x84ab('0xf')],_0x417a3);_0x325f66(_0x466278[_0x84ab('0xe')](0x1f4,_0x18836a[_0x84ab('0xf')]));});});};
\ No newline at end of file
+var _0x76bd=['http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x76bd,0xbc));var _0xd76b=function(_0x4fd76d,_0x179501){_0x4fd76d=_0x4fd76d-0x0;var _0x5f1d6f=_0x76bd[_0x4fd76d];return _0x5f1d6f;};'use strict';var _=require(_0xd76b('0x0'));var util=require('util');var moment=require(_0xd76b('0x1'));var BPromise=require('bluebird');var rs=require(_0xd76b('0x2'));var fs=require('fs');var Redis=require(_0xd76b('0x3'));var db=require(_0xd76b('0x4'))['db'];var utils=require(_0xd76b('0x5'));var logger=require(_0xd76b('0x6'))(_0xd76b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd76b('0x8'));var client=jayson[_0xd76b('0x9')][_0xd76b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe0aff7,_0x414e98,_0x73c02f){return new BPromise(function(_0x2332cb,_0x32623b){return client[_0xd76b('0xb')](_0xe0aff7,_0x73c02f)[_0xd76b('0xc')](function(_0x3002fe){logger['info'](_0xd76b('0xd'),_0x414e98,_0xd76b('0xe'));logger['debug'](_0xd76b('0xf'),_0x414e98,'request\x20sent',JSON[_0xd76b('0x10')](_0x3002fe));if(_0x3002fe[_0xd76b('0x11')]){if(_0x3002fe['error'][_0xd76b('0x12')]===0x1f4){logger[_0xd76b('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x414e98,_0x3002fe[_0xd76b('0x11')]['message']);return _0x32623b(_0x3002fe[_0xd76b('0x11')][_0xd76b('0x13')]);}logger[_0xd76b('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x414e98,_0x3002fe['error'][_0xd76b('0x13')]);return _0x2332cb(_0x3002fe[_0xd76b('0x11')][_0xd76b('0x13')]);}else{logger[_0xd76b('0x14')](_0xd76b('0xd'),_0x414e98,_0xd76b('0xe'));_0x2332cb(_0x3002fe[_0xd76b('0x15')]['message']);}})[_0xd76b('0x16')](function(_0x24c7c2){logger[_0xd76b('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x414e98,_0x24c7c2);_0x32623b(_0x24c7c2);});});}exports[_0xd76b('0x17')]=function(_0xbe963e){var _0x811924=this;return new Promise(function(_0x29785f,_0x4d8bfb){return db[_0xd76b('0x18')][_0xd76b('0x19')](_0xbe963e[_0xd76b('0x1a')],{'raw':_0xbe963e['options']?_0xbe963e[_0xd76b('0x1b')][_0xd76b('0x1c')]===undefined?!![]:![]:!![]})[_0xd76b('0xc')](function(_0x51ebbb){logger[_0xd76b('0x14')]('CreateVoiceAgentReport',_0xbe963e);logger['debug'](_0xd76b('0x17'),_0xbe963e,JSON[_0xd76b('0x10')](_0x51ebbb));_0x29785f(_0x51ebbb);})[_0xd76b('0x16')](function(_0x43eaa2){logger[_0xd76b('0x11')](_0xd76b('0x17'),_0x43eaa2[_0xd76b('0x13')],_0xbe963e);_0x4d8bfb(_0x811924[_0xd76b('0x11')](0x1f4,_0x43eaa2[_0xd76b('0x13')]));});});};exports[_0xd76b('0x1d')]=function(_0x579be6){var _0x22d398=this;return new Promise(function(_0x16fa14,_0x54cf12){return db[_0xd76b('0x18')]['update'](_0x579be6[_0xd76b('0x1a')],{'raw':_0x579be6[_0xd76b('0x1b')]?_0x579be6[_0xd76b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579be6[_0xd76b('0x1b')]?_0x579be6[_0xd76b('0x1b')][_0xd76b('0x1e')]||null:null,'attributes':_0x579be6[_0xd76b('0x1b')]?_0x579be6['options'][_0xd76b('0x1f')]||null:null,'limit':_0x579be6[_0xd76b('0x1b')]?_0x579be6[_0xd76b('0x1b')][_0xd76b('0x20')]||null:null})[_0xd76b('0xc')](function(_0x2744a6){logger[_0xd76b('0x14')](_0xd76b('0x1d'),_0x579be6);logger['debug'](_0xd76b('0x1d'),_0x579be6,JSON[_0xd76b('0x10')](_0x2744a6));_0x16fa14(_0x2744a6);})[_0xd76b('0x16')](function(_0x59e38d){logger[_0xd76b('0x11')]('UpdateVoiceAgentReport',_0x59e38d[_0xd76b('0x13')],_0x579be6);_0x54cf12(_0x22d398[_0xd76b('0x11')](0x1f4,_0x59e38d[_0xd76b('0x13')]));});});};
\ No newline at end of file
index 311f82b..c2368d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','util','path','express','Router'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x20c0('0x0'));var path=require(_0x20c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x20c0('0x2'));var router=express[_0x20c0('0x3')]();var fs_extra=require(_0x20c0('0x4'));var auth=require(_0x20c0('0x5'));var interaction=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var controller=require(_0x20c0('0x8'));router[_0x20c0('0x9')]('/',auth[_0x20c0('0xa')](),controller[_0x20c0('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x20c0('0x9')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0xd')]);router[_0x20c0('0xe')]('/',auth[_0x20c0('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x20c0('0xf')](_0x20c0('0xc'),auth[_0x20c0('0xa')](),controller[_0x20c0('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x6aa7=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','post','create','put','update','delete','exports','multer','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6aa7,0x178));var _0x76aa=function(_0x3de6ff,_0x47c6fd){_0x3de6ff=_0x3de6ff-0x0;var _0x588efd=_0x6aa7[_0x3de6ff];return _0x588efd;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0xc')]('/',auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0xe')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x10')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['destroy']);module[_0x76aa('0x11')]=router;
\ No newline at end of file
index b75042a..ad17426 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd99=['outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xdd99,0x146));var _0x9dd9=function(_0x3c46b7,_0x4531e1){_0x3c46b7=_0x3c46b7-0x0;var _0x212d37=_0xdd99[_0x3c46b7];return _0x212d37;};'use strict';var Sequelize=require(_0x9dd9('0x0'));module[_0x9dd9('0x1')]={'uniqueid':{'type':Sequelize[_0x9dd9('0x2')]},'type':{'type':Sequelize['ENUM'](_0x9dd9('0x3'),'internal',_0x9dd9('0x4'),_0x9dd9('0x5'),'outbound-fax',_0x9dd9('0x6'))},'tag':{'type':Sequelize[_0x9dd9('0x2')]},'accountcode':{'type':Sequelize[_0x9dd9('0x2')]},'source':{'type':Sequelize[_0x9dd9('0x2')]},'destination':{'type':Sequelize[_0x9dd9('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9dd9('0x2')]},'destinationchannel':{'type':Sequelize[_0x9dd9('0x2')]},'lastapplication':{'type':Sequelize[_0x9dd9('0x2')]},'lastdata':{'type':Sequelize[_0x9dd9('0x7')]},'starttime':{'type':Sequelize[_0x9dd9('0x8')]},'systemanswertime':{'type':Sequelize[_0x9dd9('0x8')]},'answertime':{'type':Sequelize[_0x9dd9('0x8')]},'endtime':{'type':Sequelize[_0x9dd9('0x8')]},'duration':{'type':Sequelize[_0x9dd9('0x9')]},'billableseconds':{'type':Sequelize[_0x9dd9('0x9')]},'mohtime':{'type':Sequelize[_0x9dd9('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9dd9('0x2')]},'amaflags':{'type':Sequelize[_0x9dd9('0x2')]},'userfield':{'type':Sequelize[_0x9dd9('0x2')]},'userDisposition':{'type':Sequelize[_0x9dd9('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x9dd9('0x2')]},'note':{'type':Sequelize[_0x9dd9('0x2')]},'prefix':{'type':Sequelize[_0x9dd9('0x2')]},'routeid':{'type':Sequelize[_0x9dd9('0x9')]},'sipcallid':{'type':Sequelize[_0x9dd9('0x2')]}};
\ No newline at end of file
+var _0x91bc=['sequelize','exports','inbound','internal','outbound','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER'];(function(_0x4fefea,_0x13d2ec){var _0x106105=function(_0x536863){while(--_0x536863){_0x4fefea['push'](_0x4fefea['shift']());}};_0x106105(++_0x13d2ec);}(_0x91bc,0x181));var _0xc91b=function(_0x15025f,_0x375738){_0x15025f=_0x15025f-0x0;var _0x1aa205=_0x91bc[_0x15025f];return _0x1aa205;};'use strict';var Sequelize=require(_0xc91b('0x0'));module[_0xc91b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xc91b('0x2'),_0xc91b('0x3'),_0xc91b('0x4'),'inbound-fax',_0xc91b('0x5'),_0xc91b('0x6'))},'tag':{'type':Sequelize[_0xc91b('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xc91b('0x7')]},'destination':{'type':Sequelize[_0xc91b('0x7')]},'destinationcontext':{'type':Sequelize[_0xc91b('0x7')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc91b('0x7')]},'destinationchannel':{'type':Sequelize[_0xc91b('0x7')]},'lastapplication':{'type':Sequelize[_0xc91b('0x7')]},'lastdata':{'type':Sequelize[_0xc91b('0x8')]},'starttime':{'type':Sequelize[_0xc91b('0x9')]},'systemanswertime':{'type':Sequelize[_0xc91b('0x9')]},'answertime':{'type':Sequelize[_0xc91b('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xc91b('0xa')]},'billableseconds':{'type':Sequelize[_0xc91b('0xa')]},'mohtime':{'type':Sequelize[_0xc91b('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc91b('0x7')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xc91b('0x7')]},'userSecondDisposition':{'type':Sequelize[_0xc91b('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc91b('0x7')]},'prefix':{'type':Sequelize[_0xc91b('0x7')]},'routeid':{'type':Sequelize[_0xc91b('0xa')]},'sipcallid':{'type':Sequelize[_0xc91b('0x7')]}};
\ No newline at end of file
index 580eb41..c4bbcb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0xadb5,0xad));var _0x5adb=function(_0x46f528,_0x79268b){_0x46f528=_0x46f528-0x0;var _0x2051f7=_0xadb5[_0x46f528];return _0x2051f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));};
\ No newline at end of file
+var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x225eee,_0x362879){_0x225eee=_0x225eee-0x0;var _0x2659d6=_0x2032[_0x225eee];return _0x2659d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));};
\ No newline at end of file
index 5a6695d..58464be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9436=['define','VoiceCallReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x243ea9,_0x1c5092){var _0x2dd3f0=function(_0x34a781){while(--_0x34a781){_0x243ea9['push'](_0x243ea9['shift']());}};_0x2dd3f0(++_0x1c5092);}(_0x9436,0x1ca));var _0x6943=function(_0x15cc37,_0x3154e0){_0x15cc37=_0x15cc37-0x0;var _0x9196d8=_0x9436[_0x15cc37];return _0x9196d8;};'use strict';var _=require('lodash');var util=require(_0x6943('0x0'));var logger=require(_0x6943('0x1'))(_0x6943('0x2'));var moment=require(_0x6943('0x3'));var BPromise=require(_0x6943('0x4'));var rp=require(_0x6943('0x5'));var fs=require('fs');var path=require(_0x6943('0x6'));var rimraf=require(_0x6943('0x7'));var config=require(_0x6943('0x8'));var attributes=require(_0x6943('0x9'));module['exports']=function(_0x597997,_0x56251b){return _0x597997[_0x6943('0xa')](_0x6943('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x6943('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4410=['define','report_call','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4410,0x136));var _0x0441=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0x4410[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0x0441('0x0'));var util=require(_0x0441('0x1'));var logger=require(_0x0441('0x2'))(_0x0441('0x3'));var moment=require(_0x0441('0x4'));var BPromise=require(_0x0441('0x5'));var rp=require(_0x0441('0x6'));var fs=require('fs');var path=require(_0x0441('0x7'));var rimraf=require(_0x0441('0x8'));var config=require(_0x0441('0x9'));var attributes=require(_0x0441('0xa'));module[_0x0441('0xb')]=function(_0x3cab34,_0x240a1f){return _0x3cab34[_0x0441('0xc')]('VoiceCallReport',attributes,{'tableName':_0x0441('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 13347c1..d627a56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f4=['../../config/logger','../../config/environment','jayson/promise','client','http','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include','attributes','map','model','then','info','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x68f4,0x6b));var _0x468f=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x68f4[_0x25701b];return _0x3a8a2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x468f('0x0'));var BPromise=require('bluebird');var rs=require(_0x468f('0x1'));var fs=require('fs');var Redis=require(_0x468f('0x2'));var db=require(_0x468f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x468f('0x4'))('rpc');var config=require(_0x468f('0x5'));var jayson=require(_0x468f('0x6'));var client=jayson[_0x468f('0x7')][_0x468f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x123b41,_0xe6bda0,_0x2c7bd0){return new BPromise(function(_0x3c9c96,_0x26cd0a){return client[_0x468f('0x9')](_0x123b41,_0x2c7bd0)['then'](function(_0x53f2b1){logger['info'](_0x468f('0xa'),_0xe6bda0,_0x468f('0xb'));logger['debug'](_0x468f('0xc'),_0xe6bda0,'request\x20sent',JSON[_0x468f('0xd')](_0x53f2b1));if(_0x53f2b1['error']){if(_0x53f2b1[_0x468f('0xe')]['code']===0x1f4){logger['error'](_0x468f('0xa'),_0xe6bda0,_0x53f2b1[_0x468f('0xe')][_0x468f('0xf')]);return _0x26cd0a(_0x53f2b1['error']['message']);}logger[_0x468f('0xe')](_0x468f('0xa'),_0xe6bda0,_0x53f2b1['error']['message']);return _0x3c9c96(_0x53f2b1[_0x468f('0xe')][_0x468f('0xf')]);}else{logger['info'](_0x468f('0xa'),_0xe6bda0,_0x468f('0xb'));_0x3c9c96(_0x53f2b1[_0x468f('0x10')][_0x468f('0xf')]);}})[_0x468f('0x11')](function(_0x9593bf){logger[_0x468f('0xe')](_0x468f('0xa'),_0xe6bda0,_0x9593bf);_0x26cd0a(_0x9593bf);});});}exports[_0x468f('0x12')]=function(_0x1ec6b2){var _0x4afdeb=this;return new Promise(function(_0x2d77fa,_0x24b17a){return db[_0x468f('0x13')][_0x468f('0x14')]({'raw':_0x1ec6b2[_0x468f('0x15')]?_0x1ec6b2['options'][_0x468f('0x16')]===undefined?!![]:![]:!![],'where':_0x1ec6b2[_0x468f('0x15')]?_0x1ec6b2[_0x468f('0x15')][_0x468f('0x17')]||null:null,'attributes':_0x1ec6b2[_0x468f('0x15')]?_0x1ec6b2['options']['attributes']||null:null,'limit':_0x1ec6b2['options']?_0x1ec6b2[_0x468f('0x15')][_0x468f('0x18')]||null:null,'include':_0x1ec6b2[_0x468f('0x15')]?_0x1ec6b2[_0x468f('0x15')]['include']?_['map'](_0x1ec6b2['options'][_0x468f('0x19')],function(_0x23dd61){return{'model':db[_0x23dd61['model']],'as':_0x23dd61['as'],'attributes':_0x23dd61[_0x468f('0x1a')],'include':_0x23dd61[_0x468f('0x19')]?_[_0x468f('0x1b')](_0x23dd61[_0x468f('0x19')],function(_0x12203e){return{'model':db[_0x12203e[_0x468f('0x1c')]],'as':_0x12203e['as'],'attributes':_0x12203e[_0x468f('0x1a')],'include':_0x12203e[_0x468f('0x19')]?_['map'](_0x12203e['include'],function(_0x209551){return{'model':db[_0x209551[_0x468f('0x1c')]],'as':_0x209551['as'],'attributes':_0x209551[_0x468f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x468f('0x1d')](function(_0x578ef7){logger[_0x468f('0x1e')](_0x468f('0x12'),_0x1ec6b2);logger[_0x468f('0x1f')]('GetVoiceCallReport',_0x1ec6b2,JSON[_0x468f('0xd')](_0x578ef7));_0x2d77fa(_0x578ef7);})[_0x468f('0x11')](function(_0x295216){logger[_0x468f('0xe')](_0x468f('0x12'),_0x295216[_0x468f('0xf')],_0x1ec6b2);_0x24b17a(_0x4afdeb[_0x468f('0xe')](0x1f4,_0x295216[_0x468f('0xf')]));});});};exports[_0x468f('0x20')]=function(_0x4874b7){var _0x343f8c=this;return new Promise(function(_0x466255,_0x23eb1c){return db[_0x468f('0x13')][_0x468f('0x21')](_0x4874b7[_0x468f('0x22')],{'raw':_0x4874b7['options']?_0x4874b7['options'][_0x468f('0x16')]===undefined?!![]:![]:!![]})[_0x468f('0x1d')](function(_0x5830a3){logger['info']('CreateVoiceCallReport',_0x4874b7);logger[_0x468f('0x1f')](_0x468f('0x20'),_0x4874b7,JSON['stringify'](_0x5830a3));_0x466255(_0x5830a3);})[_0x468f('0x11')](function(_0x204583){logger['error'](_0x468f('0x20'),_0x204583[_0x468f('0xf')],_0x4874b7);_0x23eb1c(_0x343f8c['error'](0x1f4,_0x204583[_0x468f('0xf')]));});});};exports[_0x468f('0x23')]=function(_0x533f34){var _0x56e6be=this;return new Promise(function(_0x289beb,_0x387cf2){return db[_0x468f('0x13')][_0x468f('0x24')](_0x533f34[_0x468f('0x22')],{'raw':_0x533f34[_0x468f('0x15')]?_0x533f34[_0x468f('0x15')][_0x468f('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533f34[_0x468f('0x15')]?_0x533f34['options'][_0x468f('0x17')]||null:null,'attributes':_0x533f34['options']?_0x533f34[_0x468f('0x15')][_0x468f('0x1a')]||null:null,'limit':_0x533f34[_0x468f('0x15')]?_0x533f34[_0x468f('0x15')]['limit']||null:null})[_0x468f('0x1d')](function(_0x396a6a){logger[_0x468f('0x1e')](_0x468f('0x23'),_0x533f34);logger[_0x468f('0x1f')](_0x468f('0x23'),_0x533f34,JSON[_0x468f('0xd')](_0x396a6a));_0x289beb(_0x396a6a);})['catch'](function(_0x187efc){logger['error'](_0x468f('0x23'),_0x187efc[_0x468f('0xf')],_0x533f34);_0x387cf2(_0x56e6be[_0x468f('0xe')](0x1f4,_0x187efc[_0x468f('0xf')]));});});};
\ No newline at end of file
+var _0x26e7=['model','then','CreateVoiceCallReport','create','body','update','raw','limit','UpdateVoiceCallReport','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map'];(function(_0x89d532,_0x355031){var _0x4870f3=function(_0x5b5f06){while(--_0x5b5f06){_0x89d532['push'](_0x89d532['shift']());}};_0x4870f3(++_0x355031);}(_0x26e7,0xe1));var _0x726e=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x26e7[_0x585d81];return _0x1aca0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x726e('0x0'));var rs=require(_0x726e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x726e('0x2'))['db'];var utils=require(_0x726e('0x3'));var logger=require(_0x726e('0x4'))(_0x726e('0x5'));var config=require(_0x726e('0x6'));var jayson=require(_0x726e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c380c,_0x2c8a4f,_0x164f93){return new BPromise(function(_0x2bf7de,_0x26d878){return client[_0x726e('0x8')](_0x2c380c,_0x164f93)['then'](function(_0x103f62){logger['info'](_0x726e('0x9'),_0x2c8a4f,_0x726e('0xa'));logger[_0x726e('0xb')](_0x726e('0xc'),_0x2c8a4f,_0x726e('0xa'),JSON[_0x726e('0xd')](_0x103f62));if(_0x103f62[_0x726e('0xe')]){if(_0x103f62[_0x726e('0xe')]['code']===0x1f4){logger[_0x726e('0xe')](_0x726e('0x9'),_0x2c8a4f,_0x103f62[_0x726e('0xe')][_0x726e('0xf')]);return _0x26d878(_0x103f62[_0x726e('0xe')][_0x726e('0xf')]);}logger[_0x726e('0xe')](_0x726e('0x9'),_0x2c8a4f,_0x103f62[_0x726e('0xe')][_0x726e('0xf')]);return _0x2bf7de(_0x103f62['error'][_0x726e('0xf')]);}else{logger[_0x726e('0x10')](_0x726e('0x9'),_0x2c8a4f,'request\x20sent');_0x2bf7de(_0x103f62[_0x726e('0x11')][_0x726e('0xf')]);}})[_0x726e('0x12')](function(_0x460e08){logger[_0x726e('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x2c8a4f,_0x460e08);_0x26d878(_0x460e08);});});}exports[_0x726e('0x13')]=function(_0x46309d){var _0x1e944c=this;return new Promise(function(_0x4f082c,_0x1cb849){return db[_0x726e('0x14')][_0x726e('0x15')]({'raw':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x46309d['options']?_0x46309d[_0x726e('0x16')][_0x726e('0x17')]||null:null,'attributes':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')][_0x726e('0x18')]||null:null,'limit':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')]['limit']||null:null,'include':_0x46309d[_0x726e('0x16')]?_0x46309d[_0x726e('0x16')][_0x726e('0x19')]?_[_0x726e('0x1a')](_0x46309d['options'][_0x726e('0x19')],function(_0x42acb4){return{'model':db[_0x42acb4['model']],'as':_0x42acb4['as'],'attributes':_0x42acb4[_0x726e('0x18')],'include':_0x42acb4['include']?_[_0x726e('0x1a')](_0x42acb4[_0x726e('0x19')],function(_0x3ca378){return{'model':db[_0x3ca378[_0x726e('0x1b')]],'as':_0x3ca378['as'],'attributes':_0x3ca378[_0x726e('0x18')],'include':_0x3ca378[_0x726e('0x19')]?_[_0x726e('0x1a')](_0x3ca378[_0x726e('0x19')],function(_0x1aded0){return{'model':db[_0x1aded0['model']],'as':_0x1aded0['as'],'attributes':_0x1aded0['attributes']};}):[]};}):[]};}):[]:[]})[_0x726e('0x1c')](function(_0x58919b){logger['info'](_0x726e('0x13'),_0x46309d);logger[_0x726e('0xb')](_0x726e('0x13'),_0x46309d,JSON[_0x726e('0xd')](_0x58919b));_0x4f082c(_0x58919b);})[_0x726e('0x12')](function(_0x36b9b1){logger[_0x726e('0xe')](_0x726e('0x13'),_0x36b9b1['message'],_0x46309d);_0x1cb849(_0x1e944c[_0x726e('0xe')](0x1f4,_0x36b9b1['message']));});});};exports[_0x726e('0x1d')]=function(_0x738ba8){var _0x561b21=this;return new Promise(function(_0x313428,_0x5a6e86){return db['VoiceCallReport'][_0x726e('0x1e')](_0x738ba8[_0x726e('0x1f')],{'raw':_0x738ba8[_0x726e('0x16')]?_0x738ba8[_0x726e('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x726e('0x1c')](function(_0x52787e){logger[_0x726e('0x10')](_0x726e('0x1d'),_0x738ba8);logger[_0x726e('0xb')](_0x726e('0x1d'),_0x738ba8,JSON[_0x726e('0xd')](_0x52787e));_0x313428(_0x52787e);})['catch'](function(_0x3977dc){logger[_0x726e('0xe')](_0x726e('0x1d'),_0x3977dc[_0x726e('0xf')],_0x738ba8);_0x5a6e86(_0x561b21[_0x726e('0xe')](0x1f4,_0x3977dc[_0x726e('0xf')]));});});};exports['UpdateVoiceCallReport']=function(_0x49160e){var _0x581e17=this;return new Promise(function(_0x41a7ec,_0x48550d){return db[_0x726e('0x14')][_0x726e('0x20')](_0x49160e['body'],{'raw':_0x49160e[_0x726e('0x16')]?_0x49160e[_0x726e('0x16')][_0x726e('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49160e[_0x726e('0x16')]?_0x49160e['options'][_0x726e('0x17')]||null:null,'attributes':_0x49160e[_0x726e('0x16')]?_0x49160e[_0x726e('0x16')]['attributes']||null:null,'limit':_0x49160e['options']?_0x49160e[_0x726e('0x16')][_0x726e('0x22')]||null:null})[_0x726e('0x1c')](function(_0x58507b){logger[_0x726e('0x10')]('UpdateVoiceCallReport',_0x49160e);logger['debug']('UpdateVoiceCallReport',_0x49160e,JSON[_0x726e('0xd')](_0x58507b));_0x41a7ec(_0x58507b);})[_0x726e('0x12')](function(_0x358b0){logger[_0x726e('0xe')](_0x726e('0x23'),_0x358b0[_0x726e('0xf')],_0x49160e);_0x48550d(_0x581e17[_0x726e('0xe')](0x1f4,_0x358b0[_0x726e('0xf')]));});});};
\ No newline at end of file
index 775837c..49523ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5ba=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x46d91e,_0x5ad714){var _0x2a2359=function(_0x1c2e66){while(--_0x1c2e66){_0x46d91e['push'](_0x46d91e['shift']());}};_0x2a2359(++_0x5ad714);}(_0xe5ba,0x140));var _0xae5b=function(_0x5debb5,_0x6384ea){_0x5debb5=_0x5debb5-0x0;var _0x23d14f=_0xe5ba[_0x5debb5];return _0x23d14f;};'use strict';var multer=require(_0xae5b('0x0'));var util=require(_0xae5b('0x1'));var path=require(_0xae5b('0x2'));var timeout=require(_0xae5b('0x3'));var express=require(_0xae5b('0x4'));var router=express['Router']();var fs_extra=require(_0xae5b('0x5'));var auth=require(_0xae5b('0x6'));var interaction=require(_0xae5b('0x7'));var config=require(_0xae5b('0x8'));var controller=require('./voiceChanSpy.controller');router[_0xae5b('0x9')]('/',auth[_0xae5b('0xa')](),controller[_0xae5b('0xb')]);router['get'](_0xae5b('0xc'),auth[_0xae5b('0xa')](),controller['show']);router[_0xae5b('0xd')]('/',auth['isAuthenticated'](),controller[_0xae5b('0xe')]);router['put']('/:id',auth[_0xae5b('0xa')](),controller[_0xae5b('0xf')]);router[_0xae5b('0x10')]('/:id',auth[_0xae5b('0xa')](),controller[_0xae5b('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x926f=['/:id','post','isAuthenticated','create','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get','index'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x926f,0xcd));var _0xf926=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x926f[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0xf926('0x0'));var path=require(_0xf926('0x1'));var timeout=require(_0xf926('0x2'));var express=require(_0xf926('0x3'));var router=express[_0xf926('0x4')]();var fs_extra=require(_0xf926('0x5'));var auth=require(_0xf926('0x6'));var interaction=require(_0xf926('0x7'));var config=require('../../config/environment');var controller=require(_0xf926('0x8'));router[_0xf926('0x9')]('/',auth['isAuthenticated'](),controller[_0xf926('0xa')]);router[_0xf926('0x9')](_0xf926('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf926('0xc')]('/',auth[_0xf926('0xd')](),controller[_0xf926('0xe')]);router[_0xf926('0xf')](_0xf926('0xb'),auth[_0xf926('0xd')](),controller[_0xf926('0x10')]);router['delete'](_0xf926('0xb'),auth[_0xf926('0xd')](),controller[_0xf926('0x11')]);module['exports']=router;
\ No newline at end of file
index 0551b04..76bcfb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb14e=['sequelize','exports','STRING','name','options','join','getDataValue','split','BOOLEAN'];(function(_0x5d1caa,_0x2a5ec6){var _0x50557c=function(_0x307996){while(--_0x307996){_0x5d1caa['push'](_0x5d1caa['shift']());}};_0x50557c(++_0x2a5ec6);}(_0xb14e,0xbd));var _0xeb14=function(_0x47c846,_0x57e631){_0x47c846=_0x47c846-0x0;var _0x522400=_0xb14e[_0x47c846];return _0x522400;};'use strict';var Sequelize=require(_0xeb14('0x0'));module[_0xeb14('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xeb14('0x2')],'unique':_0xeb14('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xeb14('0x2')],'set':function(_0xf3d4d6){this['setDataValue'](_0xeb14('0x4'),_0xf3d4d6?_0xf3d4d6[_0xeb14('0x5')](''):[]);},'get':function(){return this[_0xeb14('0x6')](_0xeb14('0x4'))?this['getDataValue'](_0xeb14('0x4'))[_0xeb14('0x7')](''):[];}},'auth':{'type':Sequelize[_0xeb14('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xeb14('0x2')]},'record':{'type':Sequelize[_0xeb14('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xeb14('0x2')]},'description':{'type':Sequelize[_0xeb14('0x2')]}};
\ No newline at end of file
+var _0x5f27=['split','BOOLEAN','sequelize','exports','STRING','name','options','getDataValue'];(function(_0x282218,_0x505300){var _0x172a45=function(_0x2b7c6d){while(--_0x2b7c6d){_0x282218['push'](_0x282218['shift']());}};_0x172a45(++_0x505300);}(_0x5f27,0xea));var _0x75f2=function(_0x4462cb,_0x1675fd){_0x4462cb=_0x4462cb-0x0;var _0x3e2617=_0x5f27[_0x4462cb];return _0x3e2617;};'use strict';var Sequelize=require(_0x75f2('0x0'));module[_0x75f2('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x75f2('0x2')],'unique':_0x75f2('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x75f2('0x2')],'set':function(_0x117f1c){this['setDataValue'](_0x75f2('0x4'),_0x117f1c?_0x117f1c['join'](''):[]);},'get':function(){return this[_0x75f2('0x5')](_0x75f2('0x4'))?this['getDataValue'](_0x75f2('0x4'))[_0x75f2('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x75f2('0x2')]},'record':{'type':Sequelize[_0x75f2('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x75f2('0x2')]},'description':{'type':Sequelize[_0x75f2('0x2')]}};
\ No newline at end of file
index 90a7d03..943723e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2621=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','then','ChanSpies','destroy','error','stack','name','send','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','type','includeAll','include','findAll','length','merge','options','catch','create','body','user','get','role','userProfileId','autoAssociation'];(function(_0x3567df,_0x1aa2c5){var _0x227082=function(_0x2030c6){while(--_0x2030c6){_0x3567df['push'](_0x3567df['shift']());}};_0x227082(++_0x1aa2c5);}(_0x2621,0x1d2));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x1262('0x0'));var rimraf=require(_0x1262('0x1'));var zipdir=require(_0x1262('0x2'));var jsonpatch=require(_0x1262('0x3'));var rp=require(_0x1262('0x4'));var moment=require(_0x1262('0x5'));var BPromise=require(_0x1262('0x6'));var Mustache=require(_0x1262('0x7'));var util=require(_0x1262('0x8'));var path=require(_0x1262('0x9'));var sox=require(_0x1262('0xa'));var csv=require(_0x1262('0xb'));var ejs=require(_0x1262('0xc'));var fs=require('fs');var fs_extra=require(_0x1262('0xd'));var _=require('lodash');var squel=require(_0x1262('0xe'));var crypto=require('crypto');var jsforce=require(_0x1262('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1262('0xb'));var querystring=require(_0x1262('0x10'));var Papa=require(_0x1262('0x11'));var Redis=require('ioredis');var authService=require(_0x1262('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1262('0x13'));var hardwareService=require(_0x1262('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1262('0x15'));var config=require(_0x1262('0x16'));var licenseUtil=require(_0x1262('0x17'));var db=require(_0x1262('0x18'))['db'];function respondWithStatusCode(_0x2fe558,_0x278fdb){_0x278fdb=_0x278fdb||0xcc;return function(_0x4d90df){if(_0x4d90df){return _0x2fe558[_0x1262('0x19')](_0x278fdb);}return _0x2fe558[_0x1262('0x1a')](_0x278fdb)[_0x1262('0x1b')]();};}function respondWithResult(_0x566bb2,_0x36b4ee){_0x36b4ee=_0x36b4ee||0xc8;return function(_0x3a66b0){if(_0x3a66b0){return _0x566bb2['status'](_0x36b4ee)['json'](_0x3a66b0);}};}function respondWithFilteredResult(_0x2d93a2,_0x4435c7){return function(_0x5a91b7){if(_0x5a91b7){var _0x66e634=typeof _0x4435c7['offset']===_0x1262('0x1c')&&typeof _0x4435c7[_0x1262('0x1d')]===_0x1262('0x1c');var _0x3ebd19=_0x5a91b7[_0x1262('0x1e')];var _0x347901=_0x66e634?0x0:_0x4435c7[_0x1262('0x1f')];var _0x548764=_0x66e634?_0x5a91b7['count']:_0x4435c7['offset']+_0x4435c7[_0x1262('0x1d')];var _0x5b25e4;if(_0x548764>=_0x3ebd19){_0x548764=_0x3ebd19;_0x5b25e4=0xc8;}else{_0x5b25e4=0xce;}_0x2d93a2['status'](_0x5b25e4);return _0x2d93a2['set'](_0x1262('0x20'),_0x347901+'-'+_0x548764+'/'+_0x3ebd19)[_0x1262('0x21')](_0x5a91b7);}return null;};}function patchUpdates(_0x51010a){return function(_0x2e7e16){try{jsonpatch[_0x1262('0x22')](_0x2e7e16,_0x51010a,!![]);}catch(_0x3120fb){return BPromise['reject'](_0x3120fb);}return _0x2e7e16['save']();};}function saveUpdates(_0x2162c1,_0x5b3e00){return function(_0x4db04d){if(_0x4db04d){return _0x4db04d['update'](_0x2162c1)[_0x1262('0x23')](function(_0x58cf78){return _0x58cf78;});}return null;};}function removeEntity(_0x5a8279,_0x2aa124){return function(_0x386b91){if(_0x386b91){return _0x386b91['destroy']()['then'](function(){var _0x3c4a9e=_0x386b91['get']({'plain':!![]});var _0x4e8b70=_0x1262('0x24');return db['UserProfileResource'][_0x1262('0x25')]({'where':{'type':_0x4e8b70,'resourceId':_0x3c4a9e['id']}})[_0x1262('0x23')](function(){return _0x386b91;});})[_0x1262('0x23')](function(){_0x5a8279[_0x1262('0x1a')](0xcc)[_0x1262('0x1b')]();});}};}function handleEntityNotFound(_0x3b6533,_0x3044f6){return function(_0x1229da){if(!_0x1229da){_0x3b6533[_0x1262('0x19')](0x194);}return _0x1229da;};}function handleError(_0x144086,_0x2ffd00){_0x2ffd00=_0x2ffd00||0x1f4;return function(_0x10034a){logger[_0x1262('0x26')](_0x10034a[_0x1262('0x27')]);if(_0x10034a[_0x1262('0x28')]){delete _0x10034a['name'];}_0x144086[_0x1262('0x1a')](_0x2ffd00)[_0x1262('0x29')](_0x10034a);};}exports['index']=function(_0x28d936,_0x53c596){var _0x17f972={},_0x214491={},_0x37e5a0={'count':0x0,'rows':[]};var _0x2fe4ba=_[_0x1262('0x2a')](db[_0x1262('0x2b')][_0x1262('0x2c')],function(_0x331bc7){return{'name':_0x331bc7[_0x1262('0x2d')],'type':_0x331bc7['type'][_0x1262('0x2e')]};});_0x214491[_0x1262('0x2f')]=_['map'](_0x2fe4ba,_0x1262('0x28'));_0x214491[_0x1262('0x30')]=_[_0x1262('0x31')](_0x28d936[_0x1262('0x30')]);_0x214491['filters']=_[_0x1262('0x32')](_0x214491[_0x1262('0x2f')],_0x214491[_0x1262('0x30')]);_0x17f972['attributes']=_[_0x1262('0x32')](_0x214491['model'],qs['fields'](_0x28d936['query'][_0x1262('0x33')]));_0x17f972[_0x1262('0x34')]=_0x17f972[_0x1262('0x34')]['length']?_0x17f972['attributes']:_0x214491[_0x1262('0x2f')];if(!_0x28d936[_0x1262('0x30')][_0x1262('0x35')](_0x1262('0x36'))){_0x17f972[_0x1262('0x1d')]=qs[_0x1262('0x1d')](_0x28d936[_0x1262('0x30')][_0x1262('0x1d')]);_0x17f972['offset']=qs['offset'](_0x28d936[_0x1262('0x30')][_0x1262('0x1f')]);}_0x17f972[_0x1262('0x37')]=qs['sort'](_0x28d936[_0x1262('0x30')]['sort']);_0x17f972[_0x1262('0x38')]=qs['filters'](_['pick'](_0x28d936['query'],_0x214491[_0x1262('0x39')]),_0x2fe4ba);if(_0x28d936[_0x1262('0x30')]['filter']){_0x17f972[_0x1262('0x38')]=_['merge'](_0x17f972[_0x1262('0x38')],{'$or':_[_0x1262('0x2a')](_0x2fe4ba,function(_0x49bcc2){if(_0x49bcc2[_0x1262('0x3a')]!=='VIRTUAL'){var _0x13cd38={};_0x13cd38[_0x49bcc2[_0x1262('0x28')]]={'$like':'%'+_0x28d936[_0x1262('0x30')]['filter']+'%'};return _0x13cd38;}})});}_0x17f972=_['merge']({},_0x17f972,_0x28d936['options']);var _0x205a98={'where':_0x17f972[_0x1262('0x38')]};return db[_0x1262('0x2b')][_0x1262('0x1e')](_0x205a98)[_0x1262('0x23')](function(_0x3aed24){_0x37e5a0[_0x1262('0x1e')]=_0x3aed24;if(_0x28d936[_0x1262('0x30')][_0x1262('0x3b')]){_0x17f972[_0x1262('0x3c')]=[{'all':!![]}];}return db[_0x1262('0x2b')][_0x1262('0x3d')](_0x17f972);})[_0x1262('0x23')](function(_0x541e56){_0x37e5a0['rows']=_0x541e56;return _0x37e5a0;})['then'](respondWithFilteredResult(_0x53c596,_0x17f972))['catch'](handleError(_0x53c596,null));};exports['show']=function(_0x5a784b,_0x240aa3){var _0x2da92a={'raw':![],'where':{'id':_0x5a784b['params']['id']}},_0x48a3b9={};_0x48a3b9[_0x1262('0x2f')]=_[_0x1262('0x31')](db[_0x1262('0x2b')]['rawAttributes']);_0x48a3b9[_0x1262('0x30')]=_[_0x1262('0x31')](_0x5a784b[_0x1262('0x30')]);_0x48a3b9[_0x1262('0x39')]=_[_0x1262('0x32')](_0x48a3b9[_0x1262('0x2f')],_0x48a3b9[_0x1262('0x30')]);_0x2da92a['attributes']=_[_0x1262('0x32')](_0x48a3b9[_0x1262('0x2f')],qs[_0x1262('0x33')](_0x5a784b[_0x1262('0x30')][_0x1262('0x33')]));_0x2da92a[_0x1262('0x34')]=_0x2da92a[_0x1262('0x34')][_0x1262('0x3e')]?_0x2da92a[_0x1262('0x34')]:_0x48a3b9['model'];if(_0x5a784b[_0x1262('0x30')][_0x1262('0x3b')]){_0x2da92a[_0x1262('0x3c')]=[{'all':!![]}];}_0x2da92a=_[_0x1262('0x3f')]({},_0x2da92a,_0x5a784b[_0x1262('0x40')]);return db[_0x1262('0x2b')]['find'](_0x2da92a)['then'](handleEntityNotFound(_0x240aa3,null))['then'](respondWithResult(_0x240aa3,null))[_0x1262('0x41')](handleError(_0x240aa3,null));};exports[_0x1262('0x42')]=function(_0x27269b,_0x61deec){return db[_0x1262('0x2b')][_0x1262('0x42')](_0x27269b[_0x1262('0x43')],{})[_0x1262('0x23')](function(_0x7d5ca0){var _0x57fbec=_0x27269b[_0x1262('0x44')][_0x1262('0x45')]({'plain':!![]});if(!_0x57fbec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57fbec[_0x1262('0x46')]===_0x1262('0x44')){var _0x46fd55=_0x7d5ca0[_0x1262('0x45')]({'plain':!![]});var _0xa819c6=_0x1262('0x24');return db['UserProfileSection']['find']({'where':{'name':_0xa819c6,'userProfileId':_0x57fbec[_0x1262('0x47')]},'raw':!![]})['then'](function(_0x2b19b2){if(_0x2b19b2&&_0x2b19b2[_0x1262('0x48')]===0x0){return db['UserProfileResource'][_0x1262('0x42')]({'name':_0x46fd55[_0x1262('0x28')],'resourceId':_0x46fd55['id'],'type':_0x2b19b2[_0x1262('0x28')],'sectionId':_0x2b19b2['id']},{})[_0x1262('0x23')](function(){return _0x7d5ca0;});}else{return _0x7d5ca0;}})[_0x1262('0x41')](function(_0x166cd0){logger[_0x1262('0x26')](_0x1262('0x49'),_0x166cd0);throw _0x166cd0;});}return _0x7d5ca0;})[_0x1262('0x23')](respondWithResult(_0x61deec,0xc9))[_0x1262('0x41')](handleError(_0x61deec,null));};exports[_0x1262('0x4a')]=function(_0x871365,_0x18c338){if(_0x871365[_0x1262('0x43')]['id']){delete _0x871365[_0x1262('0x43')]['id'];}return db['VoiceChanSpy'][_0x1262('0x4b')]({'where':{'id':_0x871365['params']['id']}})['then'](handleEntityNotFound(_0x18c338,null))[_0x1262('0x23')](saveUpdates(_0x871365[_0x1262('0x43')],null))[_0x1262('0x23')](respondWithResult(_0x18c338,null))[_0x1262('0x41')](handleError(_0x18c338,null));};exports['destroy']=function(_0x5a2cc4,_0x1599ab){return db[_0x1262('0x2b')][_0x1262('0x4b')]({'where':{'id':_0x5a2cc4[_0x1262('0x4c')]['id']}})[_0x1262('0x23')](handleEntityNotFound(_0x1599ab,null))['then'](removeEntity(_0x1599ab,null))[_0x1262('0x41')](handleError(_0x1599ab,null));};
\ No newline at end of file
+var _0x37f8=['end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','map','VoiceChanSpy','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xfbc3bf,_0x1a0a0b){var _0x500a4c=function(_0x579023){while(--_0x579023){_0xfbc3bf['push'](_0xfbc3bf['shift']());}};_0x500a4c(++_0x1a0a0b);}(_0x37f8,0xd2));var _0x837f=function(_0x5ef21b,_0x35992d){_0x5ef21b=_0x5ef21b-0x0;var _0x1e90a6=_0x37f8[_0x5ef21b];return _0x1e90a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require(_0x837f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x837f('0x5'));var fs=require('fs');var fs_extra=require(_0x837f('0x6'));var _=require(_0x837f('0x7'));var squel=require(_0x837f('0x8'));var crypto=require(_0x837f('0x9'));var jsforce=require(_0x837f('0xa'));var deskjs=require(_0x837f('0xb'));var toCsv=require(_0x837f('0xc'));var querystring=require(_0x837f('0xd'));var Papa=require(_0x837f('0xe'));var Redis=require(_0x837f('0xf'));var authService=require(_0x837f('0x10'));var qs=require(_0x837f('0x11'));var as=require(_0x837f('0x12'));var hardwareService=require(_0x837f('0x13'));var logger=require('../../config/logger')(_0x837f('0x14'));var utils=require(_0x837f('0x15'));var config=require(_0x837f('0x16'));var licenseUtil=require(_0x837f('0x17'));var db=require(_0x837f('0x18'))['db'];function respondWithStatusCode(_0x4a8c00,_0x53045e){_0x53045e=_0x53045e||0xcc;return function(_0x14ff6d){if(_0x14ff6d){return _0x4a8c00[_0x837f('0x19')](_0x53045e);}return _0x4a8c00[_0x837f('0x1a')](_0x53045e)[_0x837f('0x1b')]();};}function respondWithResult(_0x2b3cd6,_0x483267){_0x483267=_0x483267||0xc8;return function(_0x18d8aa){if(_0x18d8aa){return _0x2b3cd6[_0x837f('0x1a')](_0x483267)[_0x837f('0x1c')](_0x18d8aa);}};}function respondWithFilteredResult(_0x1664e7,_0x2e4257){return function(_0x29369d){if(_0x29369d){var _0x546352=typeof _0x2e4257[_0x837f('0x1d')]===_0x837f('0x1e')&&typeof _0x2e4257['limit']===_0x837f('0x1e');var _0x2745f6=_0x29369d[_0x837f('0x1f')];var _0x1d17b3=_0x546352?0x0:_0x2e4257['offset'];var _0x1d974f=_0x546352?_0x29369d[_0x837f('0x1f')]:_0x2e4257[_0x837f('0x1d')]+_0x2e4257[_0x837f('0x20')];var _0x14b3da;if(_0x1d974f>=_0x2745f6){_0x1d974f=_0x2745f6;_0x14b3da=0xc8;}else{_0x14b3da=0xce;}_0x1664e7['status'](_0x14b3da);return _0x1664e7[_0x837f('0x21')](_0x837f('0x22'),_0x1d17b3+'-'+_0x1d974f+'/'+_0x2745f6)[_0x837f('0x1c')](_0x29369d);}return null;};}function patchUpdates(_0x33c7cb){return function(_0x3540f3){try{jsonpatch['apply'](_0x3540f3,_0x33c7cb,!![]);}catch(_0x2e9603){return BPromise[_0x837f('0x23')](_0x2e9603);}return _0x3540f3[_0x837f('0x24')]();};}function saveUpdates(_0xe68eb1,_0xa0af78){return function(_0x237656){if(_0x237656){return _0x237656[_0x837f('0x25')](_0xe68eb1)[_0x837f('0x26')](function(_0x11a9b3){return _0x11a9b3;});}return null;};}function removeEntity(_0x168455,_0x3fa18e){return function(_0xfb4df0){if(_0xfb4df0){return _0xfb4df0[_0x837f('0x27')]()[_0x837f('0x26')](function(){var _0x68af0d=_0xfb4df0[_0x837f('0x28')]({'plain':!![]});var _0x43ca7d=_0x837f('0x29');return db[_0x837f('0x2a')][_0x837f('0x27')]({'where':{'type':_0x43ca7d,'resourceId':_0x68af0d['id']}})[_0x837f('0x26')](function(){return _0xfb4df0;});})[_0x837f('0x26')](function(){_0x168455[_0x837f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f467d,_0x2df32d){return function(_0x4290e6){if(!_0x4290e6){_0x3f467d['sendStatus'](0x194);}return _0x4290e6;};}function handleError(_0x530f6d,_0x2aa4c0){_0x2aa4c0=_0x2aa4c0||0x1f4;return function(_0x1ab2e4){logger[_0x837f('0x2b')](_0x1ab2e4[_0x837f('0x2c')]);if(_0x1ab2e4[_0x837f('0x2d')]){delete _0x1ab2e4[_0x837f('0x2d')];}_0x530f6d[_0x837f('0x1a')](_0x2aa4c0)['send'](_0x1ab2e4);};}exports[_0x837f('0x2e')]=function(_0x13a2e1,_0x266871){var _0x2dd495={},_0x5d53c6={},_0x4e4528={'count':0x0,'rows':[]};var _0x501a80=_[_0x837f('0x2f')](db[_0x837f('0x30')][_0x837f('0x31')],function(_0x422498){return{'name':_0x422498['fieldName'],'type':_0x422498[_0x837f('0x32')]['key']};});_0x5d53c6[_0x837f('0x33')]=_['map'](_0x501a80,'name');_0x5d53c6[_0x837f('0x34')]=_[_0x837f('0x35')](_0x13a2e1[_0x837f('0x34')]);_0x5d53c6[_0x837f('0x36')]=_[_0x837f('0x37')](_0x5d53c6['model'],_0x5d53c6['query']);_0x2dd495[_0x837f('0x38')]=_['intersection'](_0x5d53c6[_0x837f('0x33')],qs[_0x837f('0x39')](_0x13a2e1['query'][_0x837f('0x39')]));_0x2dd495[_0x837f('0x38')]=_0x2dd495[_0x837f('0x38')][_0x837f('0x3a')]?_0x2dd495[_0x837f('0x38')]:_0x5d53c6['model'];if(!_0x13a2e1[_0x837f('0x34')][_0x837f('0x3b')](_0x837f('0x3c'))){_0x2dd495[_0x837f('0x20')]=qs[_0x837f('0x20')](_0x13a2e1['query']['limit']);_0x2dd495[_0x837f('0x1d')]=qs['offset'](_0x13a2e1['query'][_0x837f('0x1d')]);}_0x2dd495[_0x837f('0x3d')]=qs['sort'](_0x13a2e1['query'][_0x837f('0x3e')]);_0x2dd495[_0x837f('0x3f')]=qs[_0x837f('0x36')](_['pick'](_0x13a2e1[_0x837f('0x34')],_0x5d53c6[_0x837f('0x36')]),_0x501a80);if(_0x13a2e1[_0x837f('0x34')][_0x837f('0x40')]){_0x2dd495[_0x837f('0x3f')]=_['merge'](_0x2dd495['where'],{'$or':_[_0x837f('0x2f')](_0x501a80,function(_0x211af0){if(_0x211af0[_0x837f('0x32')]!=='VIRTUAL'){var _0x5e001c={};_0x5e001c[_0x211af0[_0x837f('0x2d')]]={'$like':'%'+_0x13a2e1[_0x837f('0x34')][_0x837f('0x40')]+'%'};return _0x5e001c;}})});}_0x2dd495=_['merge']({},_0x2dd495,_0x13a2e1[_0x837f('0x41')]);var _0x29fb2b={'where':_0x2dd495['where']};return db['VoiceChanSpy']['count'](_0x29fb2b)[_0x837f('0x26')](function(_0x3509b6){_0x4e4528[_0x837f('0x1f')]=_0x3509b6;if(_0x13a2e1[_0x837f('0x34')][_0x837f('0x42')]){_0x2dd495[_0x837f('0x43')]=[{'all':!![]}];}return db[_0x837f('0x30')][_0x837f('0x44')](_0x2dd495);})[_0x837f('0x26')](function(_0xb06317){_0x4e4528['rows']=_0xb06317;return _0x4e4528;})[_0x837f('0x26')](respondWithFilteredResult(_0x266871,_0x2dd495))[_0x837f('0x45')](handleError(_0x266871,null));};exports['show']=function(_0xc2e307,_0x252886){var _0x303223={'raw':![],'where':{'id':_0xc2e307[_0x837f('0x46')]['id']}},_0x443e7c={};_0x443e7c[_0x837f('0x33')]=_['keys'](db[_0x837f('0x30')][_0x837f('0x31')]);_0x443e7c[_0x837f('0x34')]=_[_0x837f('0x35')](_0xc2e307[_0x837f('0x34')]);_0x443e7c[_0x837f('0x36')]=_[_0x837f('0x37')](_0x443e7c[_0x837f('0x33')],_0x443e7c['query']);_0x303223[_0x837f('0x38')]=_[_0x837f('0x37')](_0x443e7c['model'],qs[_0x837f('0x39')](_0xc2e307[_0x837f('0x34')]['fields']));_0x303223[_0x837f('0x38')]=_0x303223[_0x837f('0x38')][_0x837f('0x3a')]?_0x303223[_0x837f('0x38')]:_0x443e7c[_0x837f('0x33')];if(_0xc2e307[_0x837f('0x34')]['includeAll']){_0x303223[_0x837f('0x43')]=[{'all':!![]}];}_0x303223=_['merge']({},_0x303223,_0xc2e307[_0x837f('0x41')]);return db[_0x837f('0x30')][_0x837f('0x47')](_0x303223)[_0x837f('0x26')](handleEntityNotFound(_0x252886,null))[_0x837f('0x26')](respondWithResult(_0x252886,null))[_0x837f('0x45')](handleError(_0x252886,null));};exports['create']=function(_0x554f74,_0x5edfcc){return db[_0x837f('0x30')][_0x837f('0x48')](_0x554f74['body'],{})[_0x837f('0x26')](function(_0x58184b){var _0x288995=_0x554f74[_0x837f('0x49')][_0x837f('0x28')]({'plain':!![]});if(!_0x288995)throw new Error(_0x837f('0x4a'));if(_0x288995[_0x837f('0x4b')]===_0x837f('0x49')){var _0x4d9156=_0x58184b[_0x837f('0x28')]({'plain':!![]});var _0x49ce77=_0x837f('0x29');return db[_0x837f('0x4c')][_0x837f('0x47')]({'where':{'name':_0x49ce77,'userProfileId':_0x288995['userProfileId']},'raw':!![]})[_0x837f('0x26')](function(_0x3f27ca){if(_0x3f27ca&&_0x3f27ca[_0x837f('0x4d')]===0x0){return db[_0x837f('0x2a')][_0x837f('0x48')]({'name':_0x4d9156[_0x837f('0x2d')],'resourceId':_0x4d9156['id'],'type':_0x3f27ca['name'],'sectionId':_0x3f27ca['id']},{})[_0x837f('0x26')](function(){return _0x58184b;});}else{return _0x58184b;}})[_0x837f('0x45')](function(_0x3a65b5){logger[_0x837f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a65b5);throw _0x3a65b5;});}return _0x58184b;})[_0x837f('0x26')](respondWithResult(_0x5edfcc,0xc9))['catch'](handleError(_0x5edfcc,null));};exports[_0x837f('0x25')]=function(_0x576365,_0x23d555){if(_0x576365[_0x837f('0x4e')]['id']){delete _0x576365[_0x837f('0x4e')]['id'];}return db[_0x837f('0x30')][_0x837f('0x47')]({'where':{'id':_0x576365[_0x837f('0x46')]['id']}})[_0x837f('0x26')](handleEntityNotFound(_0x23d555,null))[_0x837f('0x26')](saveUpdates(_0x576365[_0x837f('0x4e')],null))[_0x837f('0x26')](respondWithResult(_0x23d555,null))[_0x837f('0x45')](handleError(_0x23d555,null));};exports[_0x837f('0x27')]=function(_0x4f2730,_0x4ade1b){return db[_0x837f('0x30')]['find']({'where':{'id':_0x4f2730[_0x837f('0x46')]['id']}})[_0x837f('0x26')](handleEntityNotFound(_0x4ade1b,null))[_0x837f('0x26')](removeEntity(_0x4ade1b,null))[_0x837f('0x45')](handleError(_0x4ade1b,null));};
\ No newline at end of file
index 81bb2d0..0b15bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed75=['internal','User','findAll','then','catch','exports','models','define','voice_chanspy','bulkCreate','destroy','VoiceExtension','lodash','util','bluebird','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','SIP/%s,%s','name','options','join','concat'];(function(_0x22ed5f,_0xea3472){var _0xaaad21=function(_0x4b9dd6){while(--_0x4b9dd6){_0x22ed5f['push'](_0x22ed5f['shift']());}};_0xaaad21(++_0xea3472);}(_0xed75,0xbb));var _0x5ed7=function(_0x220fb2,_0x43d88f){_0x220fb2=_0x220fb2-0x0;var _0x2e9724=_0xed75[_0x220fb2];return _0x2e9724;};'use strict';var _=require(_0x5ed7('0x0'));var util=require(_0x5ed7('0x1'));var BPromise=require(_0x5ed7('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0xb78724,_0x34f845,_0x37f644){var _0x375e4c=0x1;var _0x1d3a52=[];var _0x5aa001={'context':_0x34f845['context']||_0x5ed7('0x3'),'exten':util[_0x5ed7('0x4')](_0x5ed7('0x5'),_0xb78724[_0x5ed7('0x6')],_0x37f644),'type':_0x5ed7('0x7'),'isApp':![],'ChanSpyId':_0xb78724['id'],'UserId':_0x34f845['id']};_0x1d3a52[_0x5ed7('0x8')](_[_0x5ed7('0x9')]({'app':_0x5ed7('0xa'),'appdata':util[_0x5ed7('0x4')](_0x5ed7('0xb'),_0x5ed7('0xc')),'priority':_0x375e4c++},_0x5aa001));if(_0xb78724[_0x5ed7('0xd')]){_0x1d3a52['push'](_[_0x5ed7('0x9')]({'app':_0x5ed7('0xe'),'appdata':util[_0x5ed7('0x4')](_0x5ed7('0xf'),_0xb78724[_0x5ed7('0x10')]),'priority':_0x375e4c++},_0x5aa001));}if(_0xb78724['auth']){_0x1d3a52[_0x5ed7('0x8')](_[_0x5ed7('0x9')]({'app':_0x5ed7('0x11'),'appdata':_0xb78724['password'],'priority':_0x375e4c++},_0x5aa001));}_0x1d3a52[_0x5ed7('0x8')](_[_0x5ed7('0x9')]({'app':'ChanSpy','appdata':util[_0x5ed7('0x4')](_0x5ed7('0x12'),_0x34f845[_0x5ed7('0x13')],_0xb78724[_0x5ed7('0x14')]?_0xb78724['options'][_0x5ed7('0x15')](''):''),'priority':_0x375e4c++},_0x5aa001));if(_0xb78724[_0x5ed7('0xd')]){_0x1d3a52[_0x5ed7('0x8')](_[_0x5ed7('0x9')]({'app':'StopMixMonitor','priority':_0x375e4c++},_0x5aa001));}return _0x1d3a52;};var getChanSpyApplications=function(_0x15f375,_0x173a38){var _0x4148f4=[];for(var _0x3af738=0x0,_0x5d68bc=0x1;_0x3af738<_0x173a38['length'];_0x3af738++,_0x5d68bc=0x1){_0x4148f4=_0x4148f4[_0x5ed7('0x16')](getUserApplications(_0x15f375,_0x173a38[_0x3af738],_0x173a38[_0x3af738]['internal']));if(_0x173a38[_0x3af738][_0x5ed7('0x17')]!=_0x173a38[_0x3af738]['name']){_0x4148f4=_0x4148f4[_0x5ed7('0x16')](getUserApplications(_0x15f375,_0x173a38[_0x3af738],_0x173a38[_0x3af738]['name']));}}return _0x4148f4;};var getChanSpyPromise=function(_0x378009,_0x199294){return new BPromise(function(_0x2a16e2,_0x3f06cc){return _0x378009[_0x5ed7('0x18')][_0x5ed7('0x19')]({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x5ed7('0x1a')](function(_0x4f4f41){if(_0x4f4f41){return _0x2a16e2(getChanSpyApplications(_0x199294,_0x4f4f41));}return _0x2a16e2([]);})[_0x5ed7('0x1b')](function(_0x5dbbb9){_0x3f06cc(_0x5dbbb9);});});};module[_0x5ed7('0x1c')]=function(_0x25f426,_0x48263e){var _0x4c70b6=_0x25f426[_0x5ed7('0x1d')];return _0x25f426[_0x5ed7('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0x5ed7('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e834c,_0xee9ec6,_0x9f6605){return getChanSpyPromise(_0x4c70b6,_0x4e834c)[_0x5ed7('0x1a')](function(_0x325ee9){if(_0x325ee9&&_0x325ee9['length']){return _0x4c70b6['VoiceExtension'][_0x5ed7('0x20')](_0x325ee9);}})[_0x5ed7('0x1a')](function(){_0x9f6605();})[_0x5ed7('0x1b')](function(_0x1b93c5){_0x9f6605(_0x1b93c5);});},'afterUpdate':function(_0x2b3846,_0x3fa83c,_0x49c37d){return _0x4c70b6['VoiceExtension'][_0x5ed7('0x21')]({'where':{'ChanSpyId':_0x2b3846['id']}})['then'](function(){return getChanSpyPromise(_0x4c70b6,_0x2b3846);})[_0x5ed7('0x1a')](function(_0x38ac15){if(_0x38ac15&&_0x38ac15['length']){return _0x4c70b6[_0x5ed7('0x22')]['bulkCreate'](_0x38ac15);}})[_0x5ed7('0x1a')](function(){_0x49c37d();})[_0x5ed7('0x1b')](function(_0x76c0af){_0x49c37d(_0x76c0af);});},'afterDestroy':function(_0xdf14c1,_0xb6ab64,_0x5d686a){return _0x4c70b6[_0x5ed7('0x22')][_0x5ed7('0x21')]({'where':{'ChanSpyId':_0xdf14c1['id']}})[_0x5ed7('0x1a')](function(){_0x5d686a();})[_0x5ed7('0x1b')](function(_0x4e6329){_0x5d686a(_0x4e6329);});}}});};
\ No newline at end of file
+var _0x879c=['${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','name','options','StopMixMonitor','concat','internal','User','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','length','bulkCreate','VoiceExtension','destroy','util','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor'];(function(_0x31c17b,_0x3a9f5a){var _0x3159cc=function(_0xd4fffb){while(--_0xd4fffb){_0x31c17b['push'](_0x31c17b['shift']());}};_0x3159cc(++_0x3a9f5a);}(_0x879c,0x148));var _0xc879=function(_0x372a92,_0x5f50be){_0x372a92=_0x372a92-0x0;var _0x27ea6d=_0x879c[_0x372a92];return _0x27ea6d;};'use strict';var _=require('lodash');var util=require(_0xc879('0x0'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2461c3,_0x2df74e,_0x59af72){var _0x407e66=0x1;var _0x32559b=[];var _0x4d9b89={'context':_0x2df74e[_0xc879('0x1')]||_0xc879('0x2'),'exten':util[_0xc879('0x3')](_0xc879('0x4'),_0x2461c3[_0xc879('0x5')],_0x59af72),'type':_0xc879('0x6'),'isApp':![],'ChanSpyId':_0x2461c3['id'],'UserId':_0x2df74e['id']};_0x32559b[_0xc879('0x7')](_[_0xc879('0x8')]({'app':_0xc879('0x9'),'appdata':util[_0xc879('0x3')](_0xc879('0xa'),_0xc879('0xb')),'priority':_0x407e66++},_0x4d9b89));if(_0x2461c3[_0xc879('0xc')]){_0x32559b[_0xc879('0x7')](_['merge']({'app':_0xc879('0xd'),'appdata':util[_0xc879('0x3')](_0xc879('0xe'),_0x2461c3[_0xc879('0xf')]),'priority':_0x407e66++},_0x4d9b89));}if(_0x2461c3[_0xc879('0x10')]){_0x32559b[_0xc879('0x7')](_['merge']({'app':_0xc879('0x11'),'appdata':_0x2461c3[_0xc879('0x12')],'priority':_0x407e66++},_0x4d9b89));}_0x32559b[_0xc879('0x7')](_[_0xc879('0x8')]({'app':_0xc879('0x13'),'appdata':util[_0xc879('0x3')]('SIP/%s,%s',_0x2df74e[_0xc879('0x14')],_0x2461c3[_0xc879('0x15')]?_0x2461c3['options']['join'](''):''),'priority':_0x407e66++},_0x4d9b89));if(_0x2461c3[_0xc879('0xc')]){_0x32559b['push'](_[_0xc879('0x8')]({'app':_0xc879('0x16'),'priority':_0x407e66++},_0x4d9b89));}return _0x32559b;};var getChanSpyApplications=function(_0x2f628e,_0x477286){var _0x46ccee=[];for(var _0x7da1d0=0x0,_0x518c65=0x1;_0x7da1d0<_0x477286['length'];_0x7da1d0++,_0x518c65=0x1){_0x46ccee=_0x46ccee[_0xc879('0x17')](getUserApplications(_0x2f628e,_0x477286[_0x7da1d0],_0x477286[_0x7da1d0][_0xc879('0x18')]));if(_0x477286[_0x7da1d0]['internal']!=_0x477286[_0x7da1d0][_0xc879('0x14')]){_0x46ccee=_0x46ccee[_0xc879('0x17')](getUserApplications(_0x2f628e,_0x477286[_0x7da1d0],_0x477286[_0x7da1d0][_0xc879('0x14')]));}}return _0x46ccee;};var getChanSpyPromise=function(_0x414747,_0x307338){return new BPromise(function(_0xe3f69d,_0x544bae){return _0x414747[_0xc879('0x19')]['findAll']({'attributes':['id','name',_0xc879('0x18')],'where':{'role':_0xc879('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x400dc7){if(_0x400dc7){return _0xe3f69d(getChanSpyApplications(_0x307338,_0x400dc7));}return _0xe3f69d([]);})[_0xc879('0x1b')](function(_0x3606f3){_0x544bae(_0x3606f3);});});};module[_0xc879('0x1c')]=function(_0x3e904c,_0x762cba){var _0x492e2f=_0x3e904c[_0xc879('0x1d')];return _0x3e904c[_0xc879('0x1e')](_0xc879('0x1f'),attributes,{'tableName':_0xc879('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48c5b0,_0x489e8e,_0x32ba55){return getChanSpyPromise(_0x492e2f,_0x48c5b0)[_0xc879('0x21')](function(_0x570334){if(_0x570334&&_0x570334[_0xc879('0x22')]){return _0x492e2f['VoiceExtension'][_0xc879('0x23')](_0x570334);}})['then'](function(){_0x32ba55();})[_0xc879('0x1b')](function(_0x560a0c){_0x32ba55(_0x560a0c);});},'afterUpdate':function(_0x256b6b,_0x1312bc,_0x1501d9){return _0x492e2f[_0xc879('0x24')][_0xc879('0x25')]({'where':{'ChanSpyId':_0x256b6b['id']}})[_0xc879('0x21')](function(){return getChanSpyPromise(_0x492e2f,_0x256b6b);})[_0xc879('0x21')](function(_0x55b355){if(_0x55b355&&_0x55b355[_0xc879('0x22')]){return _0x492e2f[_0xc879('0x24')][_0xc879('0x23')](_0x55b355);}})[_0xc879('0x21')](function(){_0x1501d9();})[_0xc879('0x1b')](function(_0xaf1e99){_0x1501d9(_0xaf1e99);});},'afterDestroy':function(_0x3b4bb9,_0x50adcc,_0x11cd7f){return _0x492e2f[_0xc879('0x24')][_0xc879('0x25')]({'where':{'ChanSpyId':_0x3b4bb9['id']}})[_0xc879('0x21')](function(){_0x11cd7f();})['catch'](function(_0x9fdb89){_0x11cd7f(_0x9fdb89);});}}});};
\ No newline at end of file
index d37e1f7..a90bd71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe739=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../config/logger'];(function(_0x57ab1f,_0x43680c){var _0x4b8691=function(_0x32cfd9){while(--_0x32cfd9){_0x57ab1f['push'](_0x57ab1f['shift']());}};_0x4b8691(++_0x43680c);}(_0xe739,0x105));var _0x9e73=function(_0x407ff3,_0x22c0ea){_0x407ff3=_0x407ff3-0x0;var _0x68c37f=_0xe739[_0x407ff3];return _0x68c37f;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});}
\ No newline at end of file
+var _0xee5b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2431ac,_0x551ea6){_0x2431ac=_0x2431ac-0x0;var _0x336591=_0xee5b[_0x2431ac];return _0x336591;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});}
\ No newline at end of file
index f679946..184afa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x659b=['../../components/auth/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','exports','multer','util','path','Router','fs-extra'];(function(_0x41a10f,_0x2c1891){var _0x181cca=function(_0x30efa8){while(--_0x30efa8){_0x41a10f['push'](_0x41a10f['shift']());}};_0x181cca(++_0x2c1891);}(_0x659b,0xcc));var _0xb659=function(_0xdb093e,_0x52834d){_0xdb093e=_0xdb093e-0x0;var _0x4f2069=_0x659b[_0xdb093e];return _0x4f2069;};'use strict';var multer=require(_0xb659('0x0'));var util=require(_0xb659('0x1'));var path=require(_0xb659('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb659('0x3')]();var fs_extra=require(_0xb659('0x4'));var auth=require(_0xb659('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb659('0x6'));var controller=require(_0xb659('0x7'));router[_0xb659('0x8')]('/',auth['isAuthenticated'](),controller[_0xb659('0x9')]);router[_0xb659('0x8')]('/:id',auth[_0xb659('0xa')](),controller[_0xb659('0xb')]);router[_0xb659('0xc')]('/',auth['isAuthenticated'](),controller[_0xb659('0xd')]);router[_0xb659('0xe')]('/:id',auth[_0xb659('0xa')](),controller[_0xb659('0xf')]);router[_0xb659('0x10')](_0xb659('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xb659('0x12')]=router;
\ No newline at end of file
+var _0xcd92=['../../config/environment','get','isAuthenticated','/:id','create','put','update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0xcd92,0x108));var _0x2cd9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xcd92[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x2cd9('0x0'));var path=require('path');var timeout=require(_0x2cd9('0x1'));var express=require(_0x2cd9('0x2'));var router=express[_0x2cd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2cd9('0x4'));var interaction=require(_0x2cd9('0x5'));var config=require(_0x2cd9('0x6'));var controller=require('./voiceContext.controller');router[_0x2cd9('0x7')]('/',auth[_0x2cd9('0x8')](),controller['index']);router[_0x2cd9('0x7')](_0x2cd9('0x9'),auth[_0x2cd9('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2cd9('0xa')]);router[_0x2cd9('0xb')](_0x2cd9('0x9'),auth[_0x2cd9('0x8')](),controller[_0x2cd9('0xc')]);router['delete'](_0x2cd9('0x9'),auth[_0x2cd9('0x8')](),controller[_0x2cd9('0xd')]);module[_0x2cd9('0xe')]=router;
\ No newline at end of file
index 9f29e5c..75a4bd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeb6=['sequelize','STRING','name','BOOLEAN'];(function(_0x1aa9d5,_0x1b4b3e){var _0x3945bf=function(_0x5a05b4){while(--_0x5a05b4){_0x1aa9d5['push'](_0x1aa9d5['shift']());}};_0x3945bf(++_0x1b4b3e);}(_0xfeb6,0x104));var _0x6feb=function(_0x45c4c8,_0x522e7f){_0x45c4c8=_0x45c4c8-0x0;var _0x5ed9a1=_0xfeb6[_0x45c4c8];return _0x5ed9a1;};'use strict';var Sequelize=require(_0x6feb('0x0'));module['exports']={'name':{'type':Sequelize[_0x6feb('0x1')],'unique':_0x6feb('0x2')},'description':{'type':Sequelize[_0x6feb('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6feb('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x934a=['STRING','BOOLEAN','exports'];(function(_0x4bd950,_0x184ed5){var _0x5dc59a=function(_0x6ff30f){while(--_0x6ff30f){_0x4bd950['push'](_0x4bd950['shift']());}};_0x5dc59a(++_0x184ed5);}(_0x934a,0x110));var _0xa934=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x934a[_0x5c14f6];return _0x4949b3;};'use strict';var Sequelize=require('sequelize');module[_0xa934('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xa934('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa934('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a853a3b..fea8da9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d28=['end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','keys','intersection','length','include','find','create','body','findAll','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','root','params','rimraf','fast-json-patch','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','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status'];(function(_0x2938c1,_0x39849f){var _0x18faaa=function(_0xf6ace7){while(--_0xf6ace7){_0x2938c1['push'](_0x2938c1['shift']());}};_0x18faaa(++_0x39849f);}(_0x2d28,0xab));var _0x82d2=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x2d28[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82d2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82d2('0x1'));var rp=require('request-promise');var moment=require(_0x82d2('0x2'));var BPromise=require(_0x82d2('0x3'));var Mustache=require(_0x82d2('0x4'));var util=require(_0x82d2('0x5'));var path=require(_0x82d2('0x6'));var sox=require(_0x82d2('0x7'));var csv=require(_0x82d2('0x8'));var ejs=require(_0x82d2('0x9'));var fs=require('fs');var fs_extra=require(_0x82d2('0xa'));var _=require(_0x82d2('0xb'));var squel=require(_0x82d2('0xc'));var crypto=require(_0x82d2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x82d2('0xe'));var toCsv=require(_0x82d2('0x8'));var querystring=require(_0x82d2('0xf'));var Papa=require('papaparse');var Redis=require(_0x82d2('0x10'));var authService=require(_0x82d2('0x11'));var qs=require(_0x82d2('0x12'));var as=require(_0x82d2('0x13'));var hardwareService=require(_0x82d2('0x14'));var logger=require('../../config/logger')(_0x82d2('0x15'));var utils=require(_0x82d2('0x16'));var config=require(_0x82d2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x82d2('0x18'))['db'];var jayson=require(_0x82d2('0x19'));var client=jayson[_0x82d2('0x1a')][_0x82d2('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x32d426,_0xf0e79f,_0x24d975,_0x43ad7c){return new BPromise(function(_0x5e0a59,_0x3ff4fb){var _0x3453ff=_0x43ad7c||client;return _0x3453ff[_0x82d2('0x1c')](_0x32d426,_0x24d975)[_0x82d2('0x1d')](function(_0x44e0e9){logger[_0x82d2('0x1e')](_0x82d2('0x1f'),_0xf0e79f,_0x82d2('0x20'));logger[_0x82d2('0x21')](_0x82d2('0x22'),_0xf0e79f,'request\x20sent',JSON[_0x82d2('0x23')](_0x44e0e9));if(_0x44e0e9['error']){if(_0x44e0e9[_0x82d2('0x24')][_0x82d2('0x25')]===0x1f4){logger['error'](_0x82d2('0x1f'),_0xf0e79f,_0x44e0e9[_0x82d2('0x24')]['message']);return _0x3ff4fb(_0x44e0e9['error'][_0x82d2('0x26')]);}logger[_0x82d2('0x24')](_0x82d2('0x1f'),_0xf0e79f,_0x44e0e9[_0x82d2('0x24')][_0x82d2('0x26')]);return _0x5e0a59(_0x44e0e9['error'][_0x82d2('0x26')]);}else{logger[_0x82d2('0x1e')](_0x82d2('0x1f'),_0xf0e79f,_0x82d2('0x20'));_0x5e0a59(_0x44e0e9[_0x82d2('0x27')]['message']);}})['catch'](function(_0x1f7b86){logger['error'](_0x82d2('0x1f'),_0xf0e79f,_0x1f7b86);_0x3ff4fb(_0x1f7b86);});});}function respondWithStatusCode(_0x5aff96,_0xc064aa){_0xc064aa=_0xc064aa||0xcc;return function(_0x45cb48){if(_0x45cb48){return _0x5aff96['sendStatus'](_0xc064aa);}return _0x5aff96[_0x82d2('0x28')](_0xc064aa)[_0x82d2('0x29')]();};}function respondWithResult(_0x8d6864,_0x519b92){_0x519b92=_0x519b92||0xc8;return function(_0x13a1d6){if(_0x13a1d6){return _0x8d6864[_0x82d2('0x28')](_0x519b92)[_0x82d2('0x2a')](_0x13a1d6);}};}function respondWithFilteredResult(_0x5cf75e,_0xb61ce9){return function(_0x410b19){if(_0x410b19){var _0x5e519e=typeof _0xb61ce9[_0x82d2('0x2b')]==='undefined'&&typeof _0xb61ce9[_0x82d2('0x2c')]===_0x82d2('0x2d');var _0x5e1b82=_0x410b19[_0x82d2('0x2e')];var _0x1cc595=_0x5e519e?0x0:_0xb61ce9[_0x82d2('0x2b')];var _0x3f24ba=_0x5e519e?_0x410b19[_0x82d2('0x2e')]:_0xb61ce9[_0x82d2('0x2b')]+_0xb61ce9[_0x82d2('0x2c')];var _0x21cbd6;if(_0x3f24ba>=_0x5e1b82){_0x3f24ba=_0x5e1b82;_0x21cbd6=0xc8;}else{_0x21cbd6=0xce;}_0x5cf75e[_0x82d2('0x28')](_0x21cbd6);return _0x5cf75e[_0x82d2('0x2f')]('Content-Range',_0x1cc595+'-'+_0x3f24ba+'/'+_0x5e1b82)['json'](_0x410b19);}return null;};}function patchUpdates(_0x5542c9){return function(_0x59ff6b){try{jsonpatch[_0x82d2('0x30')](_0x59ff6b,_0x5542c9,!![]);}catch(_0x1674b4){return BPromise[_0x82d2('0x31')](_0x1674b4);}return _0x59ff6b[_0x82d2('0x32')]();};}function saveUpdates(_0xc1652f,_0x5b7b5f){return function(_0x1864ef){if(_0x1864ef){return _0x1864ef[_0x82d2('0x33')](_0xc1652f)[_0x82d2('0x1d')](function(_0x2b83bc){return _0x2b83bc;});}return null;};}function removeEntity(_0x2a60d4,_0x4537c9){return function(_0x311381){if(_0x311381){return _0x311381[_0x82d2('0x34')]()['then'](function(){var _0x1dac60=_0x311381[_0x82d2('0x35')]({'plain':!![]});var _0x218d51='Contexts';return db[_0x82d2('0x36')][_0x82d2('0x34')]({'where':{'type':_0x218d51,'resourceId':_0x1dac60['id']}})[_0x82d2('0x1d')](function(){return _0x311381;});})[_0x82d2('0x1d')](function(){_0x2a60d4[_0x82d2('0x28')](0xcc)[_0x82d2('0x29')]();});}};}function handleEntityNotFound(_0x4b9fef,_0xd50f5){return function(_0x23dc91){if(!_0x23dc91){_0x4b9fef[_0x82d2('0x37')](0x194);}return _0x23dc91;};}function handleError(_0x5cd061,_0x54447f){_0x54447f=_0x54447f||0x1f4;return function(_0x17cddc){logger['error'](_0x17cddc['stack']);if(_0x17cddc[_0x82d2('0x38')]){delete _0x17cddc[_0x82d2('0x38')];}_0x5cd061['status'](_0x54447f)[_0x82d2('0x39')](_0x17cddc);};}exports[_0x82d2('0x3a')]=function(_0x3cbed9,_0x4ec002){var _0x57f070={},_0x57c3a7={},_0x347625={'count':0x0,'rows':[]};var _0x452749=_[_0x82d2('0x3b')](db[_0x82d2('0x3c')][_0x82d2('0x3d')],function(_0x108fed){return{'name':_0x108fed[_0x82d2('0x3e')],'type':_0x108fed[_0x82d2('0x3f')][_0x82d2('0x40')]};});_0x57c3a7['model']=_['map'](_0x452749,_0x82d2('0x38'));_0x57c3a7[_0x82d2('0x41')]=_['keys'](_0x3cbed9[_0x82d2('0x41')]);_0x57c3a7[_0x82d2('0x42')]=_['intersection'](_0x57c3a7[_0x82d2('0x43')],_0x57c3a7[_0x82d2('0x41')]);_0x57f070[_0x82d2('0x44')]=_['intersection'](_0x57c3a7['model'],qs[_0x82d2('0x45')](_0x3cbed9[_0x82d2('0x41')][_0x82d2('0x45')]));_0x57f070['attributes']=_0x57f070[_0x82d2('0x44')]['length']?_0x57f070[_0x82d2('0x44')]:_0x57c3a7[_0x82d2('0x43')];if(!_0x3cbed9[_0x82d2('0x41')]['hasOwnProperty']('nolimit')){_0x57f070[_0x82d2('0x2c')]=qs[_0x82d2('0x2c')](_0x3cbed9[_0x82d2('0x41')][_0x82d2('0x2c')]);_0x57f070[_0x82d2('0x2b')]=qs[_0x82d2('0x2b')](_0x3cbed9[_0x82d2('0x41')][_0x82d2('0x2b')]);}_0x57f070[_0x82d2('0x46')]=qs[_0x82d2('0x47')](_0x3cbed9['query']['sort']);_0x57f070[_0x82d2('0x48')]=qs[_0x82d2('0x42')](_[_0x82d2('0x49')](_0x3cbed9[_0x82d2('0x41')],_0x57c3a7['filters']),_0x452749);if(_0x3cbed9['query']['filter']){_0x57f070['where']=_[_0x82d2('0x4a')](_0x57f070['where'],{'$or':_[_0x82d2('0x3b')](_0x452749,function(_0x304e00){if(_0x304e00[_0x82d2('0x3f')]!==_0x82d2('0x4b')){var _0x59a933={};_0x59a933[_0x304e00[_0x82d2('0x38')]]={'$like':'%'+_0x3cbed9[_0x82d2('0x41')][_0x82d2('0x4c')]+'%'};return _0x59a933;}})});}_0x57f070=_['merge']({},_0x57f070,_0x3cbed9[_0x82d2('0x4d')]);var _0x32fcdc={'where':_0x57f070['where']};return db[_0x82d2('0x3c')]['count'](_0x32fcdc)[_0x82d2('0x1d')](function(_0x2acbc0){_0x347625[_0x82d2('0x2e')]=_0x2acbc0;if(_0x3cbed9[_0x82d2('0x41')][_0x82d2('0x4e')]){_0x57f070['include']=[{'all':!![]}];}return db[_0x82d2('0x3c')]['findAll'](_0x57f070);})[_0x82d2('0x1d')](function(_0x129b68){_0x347625['rows']=_0x129b68;return _0x347625;})[_0x82d2('0x1d')](respondWithFilteredResult(_0x4ec002,_0x57f070))[_0x82d2('0x4f')](handleError(_0x4ec002,null));};exports[_0x82d2('0x50')]=function(_0x3ff38d,_0x416dc9){var _0x40fab2={'raw':![],'where':{'id':_0x3ff38d['params']['id']}},_0x5d3d7d={};_0x5d3d7d[_0x82d2('0x43')]=_['keys'](db[_0x82d2('0x3c')][_0x82d2('0x3d')]);_0x5d3d7d[_0x82d2('0x41')]=_[_0x82d2('0x51')](_0x3ff38d[_0x82d2('0x41')]);_0x5d3d7d[_0x82d2('0x42')]=_[_0x82d2('0x52')](_0x5d3d7d['model'],_0x5d3d7d[_0x82d2('0x41')]);_0x40fab2[_0x82d2('0x44')]=_[_0x82d2('0x52')](_0x5d3d7d[_0x82d2('0x43')],qs[_0x82d2('0x45')](_0x3ff38d[_0x82d2('0x41')][_0x82d2('0x45')]));_0x40fab2[_0x82d2('0x44')]=_0x40fab2[_0x82d2('0x44')][_0x82d2('0x53')]?_0x40fab2[_0x82d2('0x44')]:_0x5d3d7d[_0x82d2('0x43')];if(_0x3ff38d[_0x82d2('0x41')][_0x82d2('0x4e')]){_0x40fab2[_0x82d2('0x54')]=[{'all':!![]}];}_0x40fab2=_[_0x82d2('0x4a')]({},_0x40fab2,_0x3ff38d[_0x82d2('0x4d')]);return db['VoiceContext'][_0x82d2('0x55')](_0x40fab2)[_0x82d2('0x1d')](handleEntityNotFound(_0x416dc9,null))[_0x82d2('0x1d')](respondWithResult(_0x416dc9,null))['catch'](handleError(_0x416dc9,null));};exports[_0x82d2('0x56')]=function(_0x6fa012,_0x1ac473,_0x299e1c){var _0x434262;return db['VoiceContext'][_0x82d2('0x56')](_0x6fa012[_0x82d2('0x57')],{'raw':!![]})['then'](function(_0x5106bd){_0x434262=_0x5106bd;return db[_0x82d2('0x3c')][_0x82d2('0x58')]({'raw':!![]});})[_0x82d2('0x1d')](function(_0x595069){var _0x53fec2=fs[_0x82d2('0x59')](path[_0x82d2('0x5a')](config['root'],_0x82d2('0x5b')),_0x82d2('0x5c'));var _0xda2e83=ejs[_0x82d2('0x5d')](_0x53fec2,{'contexts':_0x595069||[]});fs[_0x82d2('0x5e')](_0x82d2('0x5f'),_0xda2e83);})[_0x82d2('0x1d')](function(){return respondWithRpcPromise(_0x82d2('0x60'),'create',{'module':_0x82d2('0x61')});})[_0x82d2('0x1d')](function(){var _0x2561e1=_0x6fa012[_0x82d2('0x62')][_0x82d2('0x35')]({'plain':!![]});if(!_0x2561e1)throw new Error(_0x82d2('0x63'));if(_0x2561e1[_0x82d2('0x64')]===_0x82d2('0x62')){var _0x3145a6=_0x434262[_0x82d2('0x35')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x82d2('0x65'),'userProfileId':_0x2561e1[_0x82d2('0x66')]},'raw':!![]})['then'](function(_0xf94918){if(_0xf94918&&_0xf94918[_0x82d2('0x67')]===0x0){return db['UserProfileResource'][_0x82d2('0x56')]({'name':_0x3145a6[_0x82d2('0x38')],'resourceId':_0x3145a6['id'],'type':_0xf94918[_0x82d2('0x38')],'sectionId':_0xf94918['id']},{})[_0x82d2('0x1d')](function(){return _0x434262;});}else{return _0x434262;}})[_0x82d2('0x4f')](function(_0xdd75a1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdd75a1);throw _0xdd75a1;});}return _0x434262;})[_0x82d2('0x1d')](respondWithResult(_0x1ac473,0xc9))['catch'](handleError(_0x1ac473,null));};exports[_0x82d2('0x33')]=function(_0x259a03,_0x897743,_0x5ea6af){var _0x29d6ee;return db[_0x82d2('0x3c')][_0x82d2('0x55')]({'where':{'id':_0x259a03['params']['id']}})[_0x82d2('0x1d')](handleEntityNotFound(_0x897743,null))[_0x82d2('0x1d')](saveUpdates(_0x259a03[_0x82d2('0x57')],null))[_0x82d2('0x1d')](function(_0x120e18){if(_0x120e18){_0x29d6ee=_0x120e18;return db['VoiceContext'][_0x82d2('0x58')]({'raw':!![]});}})['then'](function(_0x104357){var _0x1aacd8=fs['readFileSync'](path[_0x82d2('0x5a')](config[_0x82d2('0x68')],_0x82d2('0x5b')),_0x82d2('0x5c'));var _0x5746bf=ejs[_0x82d2('0x5d')](_0x1aacd8,{'contexts':_0x104357||[]});fs[_0x82d2('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5746bf);})[_0x82d2('0x1d')](function(){return respondWithRpcPromise(_0x82d2('0x60'),_0x82d2('0x33'),{'module':_0x82d2('0x61')});})[_0x82d2('0x1d')](function(){return _0x29d6ee;})['then'](respondWithResult(_0x897743,null))[_0x82d2('0x4f')](handleError(_0x897743,null));};exports[_0x82d2('0x34')]=function(_0x2a7d47,_0x3d76d1,_0x5c2a2f){var _0x45e94f;return db[_0x82d2('0x3c')][_0x82d2('0x55')]({'where':{'id':_0x2a7d47[_0x82d2('0x69')]['id']}})[_0x82d2('0x1d')](handleEntityNotFound(_0x3d76d1,null))[_0x82d2('0x1d')](removeEntity(_0x3d76d1,null))[_0x82d2('0x1d')](function(){return db[_0x82d2('0x3c')][_0x82d2('0x58')]({'raw':!![]});})[_0x82d2('0x1d')](function(_0x233389){var _0x140596=fs['readFileSync'](path[_0x82d2('0x5a')](config[_0x82d2('0x68')],_0x82d2('0x5b')),_0x82d2('0x5c'));var _0x889341=ejs[_0x82d2('0x5d')](_0x140596,{'contexts':_0x233389});fs[_0x82d2('0x5e')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x889341);return respondWithRpcPromise(_0x82d2('0x60'),'destroy',{'module':_0x82d2('0x61')});})[_0x82d2('0x4f')](handleError(_0x3d76d1,null));};
\ No newline at end of file
+var _0x8ce7=['error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','get','Contexts','UserProfileResource','destroy','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceContext','count','includeAll','include','findAll','rows','show','params','keys','length','options','find','create','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','utf8','server/files/templates/context.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x273305,_0x57815f){var _0x12cf22=function(_0x308154){while(--_0x308154){_0x273305['push'](_0x273305['shift']());}};_0x12cf22(++_0x57815f);}(_0x8ce7,0xbb));var _0x78ce=function(_0x39323c,_0x9ac777){_0x39323c=_0x39323c-0x0;var _0x2b8bf0=_0x8ce7[_0x39323c];return _0x2b8bf0;};'use strict';var emlformat=require(_0x78ce('0x0'));var rimraf=require(_0x78ce('0x1'));var zipdir=require(_0x78ce('0x2'));var jsonpatch=require(_0x78ce('0x3'));var rp=require(_0x78ce('0x4'));var moment=require(_0x78ce('0x5'));var BPromise=require(_0x78ce('0x6'));var Mustache=require(_0x78ce('0x7'));var util=require(_0x78ce('0x8'));var path=require('path');var sox=require(_0x78ce('0x9'));var csv=require(_0x78ce('0xa'));var ejs=require(_0x78ce('0xb'));var fs=require('fs');var fs_extra=require(_0x78ce('0xc'));var _=require(_0x78ce('0xd'));var squel=require(_0x78ce('0xe'));var crypto=require(_0x78ce('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x78ce('0x10'));var toCsv=require(_0x78ce('0xa'));var querystring=require('querystring');var Papa=require(_0x78ce('0x11'));var Redis=require('ioredis');var authService=require(_0x78ce('0x12'));var qs=require(_0x78ce('0x13'));var as=require(_0x78ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78ce('0x15'))(_0x78ce('0x16'));var utils=require(_0x78ce('0x17'));var config=require(_0x78ce('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x78ce('0x19'))['db'];var jayson=require(_0x78ce('0x1a'));var client=jayson[_0x78ce('0x1b')][_0x78ce('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4fb897,_0x4b1371,_0x5c99b2,_0x57f4af){return new BPromise(function(_0x3a6a64,_0x1c7b60){var _0x3eb7d5=_0x57f4af||client;return _0x3eb7d5[_0x78ce('0x1d')](_0x4fb897,_0x5c99b2)['then'](function(_0x5e3e74){logger[_0x78ce('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x4b1371,_0x78ce('0x1f'));logger[_0x78ce('0x20')](_0x78ce('0x21'),_0x4b1371,'request\x20sent',JSON[_0x78ce('0x22')](_0x5e3e74));if(_0x5e3e74[_0x78ce('0x23')]){if(_0x5e3e74['error'][_0x78ce('0x24')]===0x1f4){logger[_0x78ce('0x23')](_0x78ce('0x25'),_0x4b1371,_0x5e3e74['error'][_0x78ce('0x26')]);return _0x1c7b60(_0x5e3e74[_0x78ce('0x23')][_0x78ce('0x26')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x4b1371,_0x5e3e74[_0x78ce('0x23')][_0x78ce('0x26')]);return _0x3a6a64(_0x5e3e74[_0x78ce('0x23')][_0x78ce('0x26')]);}else{logger[_0x78ce('0x1e')](_0x78ce('0x25'),_0x4b1371,'request\x20sent');_0x3a6a64(_0x5e3e74[_0x78ce('0x27')]['message']);}})[_0x78ce('0x28')](function(_0x284c1f){logger[_0x78ce('0x23')]('VoiceContext,\x20%s,\x20%s',_0x4b1371,_0x284c1f);_0x1c7b60(_0x284c1f);});});}function respondWithStatusCode(_0x172df5,_0x5904b5){_0x5904b5=_0x5904b5||0xcc;return function(_0x4e21fb){if(_0x4e21fb){return _0x172df5[_0x78ce('0x29')](_0x5904b5);}return _0x172df5[_0x78ce('0x2a')](_0x5904b5)[_0x78ce('0x2b')]();};}function respondWithResult(_0x1b0a7e,_0x506729){_0x506729=_0x506729||0xc8;return function(_0x2cdcb0){if(_0x2cdcb0){return _0x1b0a7e[_0x78ce('0x2a')](_0x506729)['json'](_0x2cdcb0);}};}function respondWithFilteredResult(_0x4d4d5e,_0x3f8e61){return function(_0x50b75b){if(_0x50b75b){var _0x2bbe4f=typeof _0x3f8e61[_0x78ce('0x2c')]===_0x78ce('0x2d')&&typeof _0x3f8e61[_0x78ce('0x2e')]===_0x78ce('0x2d');var _0x1ec2c5=_0x50b75b['count'];var _0x21101d=_0x2bbe4f?0x0:_0x3f8e61[_0x78ce('0x2c')];var _0x1e694a=_0x2bbe4f?_0x50b75b['count']:_0x3f8e61[_0x78ce('0x2c')]+_0x3f8e61[_0x78ce('0x2e')];var _0x841889;if(_0x1e694a>=_0x1ec2c5){_0x1e694a=_0x1ec2c5;_0x841889=0xc8;}else{_0x841889=0xce;}_0x4d4d5e[_0x78ce('0x2a')](_0x841889);return _0x4d4d5e[_0x78ce('0x2f')](_0x78ce('0x30'),_0x21101d+'-'+_0x1e694a+'/'+_0x1ec2c5)[_0x78ce('0x31')](_0x50b75b);}return null;};}function patchUpdates(_0x273321){return function(_0x43e447){try{jsonpatch[_0x78ce('0x32')](_0x43e447,_0x273321,!![]);}catch(_0x129824){return BPromise[_0x78ce('0x33')](_0x129824);}return _0x43e447[_0x78ce('0x34')]();};}function saveUpdates(_0xac17cb,_0x38c512){return function(_0x27bf2d){if(_0x27bf2d){return _0x27bf2d[_0x78ce('0x35')](_0xac17cb)[_0x78ce('0x36')](function(_0x331522){return _0x331522;});}return null;};}function removeEntity(_0x33999e,_0x2078f8){return function(_0x4605e0){if(_0x4605e0){return _0x4605e0['destroy']()[_0x78ce('0x36')](function(){var _0x5247ba=_0x4605e0[_0x78ce('0x37')]({'plain':!![]});var _0x196e08=_0x78ce('0x38');return db[_0x78ce('0x39')][_0x78ce('0x3a')]({'where':{'type':_0x196e08,'resourceId':_0x5247ba['id']}})[_0x78ce('0x36')](function(){return _0x4605e0;});})[_0x78ce('0x36')](function(){_0x33999e['status'](0xcc)[_0x78ce('0x2b')]();});}};}function handleEntityNotFound(_0x1be188,_0x2c4cac){return function(_0x8bd8d4){if(!_0x8bd8d4){_0x1be188[_0x78ce('0x29')](0x194);}return _0x8bd8d4;};}function handleError(_0xa8e787,_0x329e8e){_0x329e8e=_0x329e8e||0x1f4;return function(_0x476356){logger[_0x78ce('0x23')](_0x476356[_0x78ce('0x3b')]);if(_0x476356['name']){delete _0x476356['name'];}_0xa8e787[_0x78ce('0x2a')](_0x329e8e)['send'](_0x476356);};}exports[_0x78ce('0x3c')]=function(_0x5d996a,_0x535c45){var _0x5324d8={},_0x147bb6={},_0x11805d={'count':0x0,'rows':[]};var _0x50cf2c=_[_0x78ce('0x3d')](db['VoiceContext'][_0x78ce('0x3e')],function(_0x2ac2d7){return{'name':_0x2ac2d7[_0x78ce('0x3f')],'type':_0x2ac2d7[_0x78ce('0x40')][_0x78ce('0x41')]};});_0x147bb6[_0x78ce('0x42')]=_[_0x78ce('0x3d')](_0x50cf2c,_0x78ce('0x43'));_0x147bb6[_0x78ce('0x44')]=_['keys'](_0x5d996a[_0x78ce('0x44')]);_0x147bb6[_0x78ce('0x45')]=_[_0x78ce('0x46')](_0x147bb6[_0x78ce('0x42')],_0x147bb6[_0x78ce('0x44')]);_0x5324d8['attributes']=_[_0x78ce('0x46')](_0x147bb6[_0x78ce('0x42')],qs[_0x78ce('0x47')](_0x5d996a[_0x78ce('0x44')][_0x78ce('0x47')]));_0x5324d8[_0x78ce('0x48')]=_0x5324d8[_0x78ce('0x48')]['length']?_0x5324d8[_0x78ce('0x48')]:_0x147bb6[_0x78ce('0x42')];if(!_0x5d996a[_0x78ce('0x44')][_0x78ce('0x49')](_0x78ce('0x4a'))){_0x5324d8['limit']=qs[_0x78ce('0x2e')](_0x5d996a[_0x78ce('0x44')][_0x78ce('0x2e')]);_0x5324d8[_0x78ce('0x2c')]=qs[_0x78ce('0x2c')](_0x5d996a[_0x78ce('0x44')][_0x78ce('0x2c')]);}_0x5324d8[_0x78ce('0x4b')]=qs[_0x78ce('0x4c')](_0x5d996a[_0x78ce('0x44')]['sort']);_0x5324d8[_0x78ce('0x4d')]=qs['filters'](_['pick'](_0x5d996a['query'],_0x147bb6[_0x78ce('0x45')]),_0x50cf2c);if(_0x5d996a[_0x78ce('0x44')][_0x78ce('0x4e')]){_0x5324d8[_0x78ce('0x4d')]=_[_0x78ce('0x4f')](_0x5324d8['where'],{'$or':_[_0x78ce('0x3d')](_0x50cf2c,function(_0x1787ce){if(_0x1787ce['type']!==_0x78ce('0x50')){var _0x3f05cd={};_0x3f05cd[_0x1787ce[_0x78ce('0x43')]]={'$like':'%'+_0x5d996a['query'][_0x78ce('0x4e')]+'%'};return _0x3f05cd;}})});}_0x5324d8=_['merge']({},_0x5324d8,_0x5d996a['options']);var _0x28cf3d={'where':_0x5324d8[_0x78ce('0x4d')]};return db[_0x78ce('0x51')][_0x78ce('0x52')](_0x28cf3d)['then'](function(_0x2718f7){_0x11805d[_0x78ce('0x52')]=_0x2718f7;if(_0x5d996a[_0x78ce('0x44')][_0x78ce('0x53')]){_0x5324d8[_0x78ce('0x54')]=[{'all':!![]}];}return db[_0x78ce('0x51')][_0x78ce('0x55')](_0x5324d8);})[_0x78ce('0x36')](function(_0x1535d7){_0x11805d[_0x78ce('0x56')]=_0x1535d7;return _0x11805d;})[_0x78ce('0x36')](respondWithFilteredResult(_0x535c45,_0x5324d8))[_0x78ce('0x28')](handleError(_0x535c45,null));};exports[_0x78ce('0x57')]=function(_0x2721cd,_0x11f7e8){var _0x332b93={'raw':![],'where':{'id':_0x2721cd[_0x78ce('0x58')]['id']}},_0xf5dda8={};_0xf5dda8['model']=_[_0x78ce('0x59')](db[_0x78ce('0x51')][_0x78ce('0x3e')]);_0xf5dda8[_0x78ce('0x44')]=_[_0x78ce('0x59')](_0x2721cd['query']);_0xf5dda8[_0x78ce('0x45')]=_[_0x78ce('0x46')](_0xf5dda8[_0x78ce('0x42')],_0xf5dda8[_0x78ce('0x44')]);_0x332b93[_0x78ce('0x48')]=_['intersection'](_0xf5dda8[_0x78ce('0x42')],qs[_0x78ce('0x47')](_0x2721cd[_0x78ce('0x44')]['fields']));_0x332b93[_0x78ce('0x48')]=_0x332b93[_0x78ce('0x48')][_0x78ce('0x5a')]?_0x332b93['attributes']:_0xf5dda8['model'];if(_0x2721cd[_0x78ce('0x44')][_0x78ce('0x53')]){_0x332b93[_0x78ce('0x54')]=[{'all':!![]}];}_0x332b93=_[_0x78ce('0x4f')]({},_0x332b93,_0x2721cd[_0x78ce('0x5b')]);return db[_0x78ce('0x51')][_0x78ce('0x5c')](_0x332b93)[_0x78ce('0x36')](handleEntityNotFound(_0x11f7e8,null))[_0x78ce('0x36')](respondWithResult(_0x11f7e8,null))[_0x78ce('0x28')](handleError(_0x11f7e8,null));};exports['create']=function(_0x235bc9,_0x569f5d,_0x11db76){var _0x131043;return db[_0x78ce('0x51')][_0x78ce('0x5d')](_0x235bc9['body'],{'raw':!![]})[_0x78ce('0x36')](function(_0x101621){_0x131043=_0x101621;return db[_0x78ce('0x51')][_0x78ce('0x55')]({'raw':!![]});})[_0x78ce('0x36')](function(_0x2fd904){var _0x38da99=fs[_0x78ce('0x5e')](path[_0x78ce('0x5f')](config[_0x78ce('0x60')],'server/files/templates/context.ejs'),'utf8');var _0x235e37=ejs[_0x78ce('0x61')](_0x38da99,{'contexts':_0x2fd904||[]});fs[_0x78ce('0x62')](_0x78ce('0x63'),_0x235e37);})[_0x78ce('0x36')](function(){return respondWithRpcPromise('Reload',_0x78ce('0x5d'),{'module':_0x78ce('0x64')});})[_0x78ce('0x36')](function(){var _0x1ea03e=_0x235bc9[_0x78ce('0x65')][_0x78ce('0x37')]({'plain':!![]});if(!_0x1ea03e)throw new Error(_0x78ce('0x66'));if(_0x1ea03e[_0x78ce('0x67')]==='user'){var _0x31159b=_0x131043['get']({'plain':!![]});return db[_0x78ce('0x68')][_0x78ce('0x5c')]({'where':{'name':_0x78ce('0x38'),'userProfileId':_0x1ea03e[_0x78ce('0x69')]},'raw':!![]})[_0x78ce('0x36')](function(_0x2cc827){if(_0x2cc827&&_0x2cc827[_0x78ce('0x6a')]===0x0){return db[_0x78ce('0x39')][_0x78ce('0x5d')]({'name':_0x31159b[_0x78ce('0x43')],'resourceId':_0x31159b['id'],'type':_0x2cc827[_0x78ce('0x43')],'sectionId':_0x2cc827['id']},{})[_0x78ce('0x36')](function(){return _0x131043;});}else{return _0x131043;}})['catch'](function(_0x1a8b6c){logger['error'](_0x78ce('0x6b'),_0x1a8b6c);throw _0x1a8b6c;});}return _0x131043;})['then'](respondWithResult(_0x569f5d,0xc9))[_0x78ce('0x28')](handleError(_0x569f5d,null));};exports[_0x78ce('0x35')]=function(_0x43c281,_0x1eac5b,_0x31f829){var _0x1826a6;return db[_0x78ce('0x51')][_0x78ce('0x5c')]({'where':{'id':_0x43c281['params']['id']}})['then'](handleEntityNotFound(_0x1eac5b,null))[_0x78ce('0x36')](saveUpdates(_0x43c281[_0x78ce('0x6c')],null))[_0x78ce('0x36')](function(_0x3bac92){if(_0x3bac92){_0x1826a6=_0x3bac92;return db[_0x78ce('0x51')][_0x78ce('0x55')]({'raw':!![]});}})[_0x78ce('0x36')](function(_0x569a57){var _0x344c05=fs[_0x78ce('0x5e')](path[_0x78ce('0x5f')](config['root'],'server/files/templates/context.ejs'),_0x78ce('0x6d'));var _0x3bdca9=ejs[_0x78ce('0x61')](_0x344c05,{'contexts':_0x569a57||[]});fs[_0x78ce('0x62')](_0x78ce('0x63'),_0x3bdca9);})[_0x78ce('0x36')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x78ce('0x64')});})[_0x78ce('0x36')](function(){return _0x1826a6;})['then'](respondWithResult(_0x1eac5b,null))[_0x78ce('0x28')](handleError(_0x1eac5b,null));};exports[_0x78ce('0x3a')]=function(_0xae5096,_0x527196,_0x1df263){var _0x44015d;return db[_0x78ce('0x51')][_0x78ce('0x5c')]({'where':{'id':_0xae5096[_0x78ce('0x58')]['id']}})[_0x78ce('0x36')](handleEntityNotFound(_0x527196,null))[_0x78ce('0x36')](removeEntity(_0x527196,null))[_0x78ce('0x36')](function(){return db[_0x78ce('0x51')][_0x78ce('0x55')]({'raw':!![]});})[_0x78ce('0x36')](function(_0x489191){var _0xde6e1d=fs[_0x78ce('0x5e')](path[_0x78ce('0x5f')](config['root'],_0x78ce('0x6e')),_0x78ce('0x6d'));var _0x230c29=ejs[_0x78ce('0x61')](_0xde6e1d,{'contexts':_0x489191});fs[_0x78ce('0x62')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x230c29);return respondWithRpcPromise('Reload','destroy',{'module':_0x78ce('0x64')});})['catch'](handleError(_0x527196,null));};
\ No newline at end of file
index f27b06b..1d8997a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb199=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util'];(function(_0x39db81,_0xedb738){var _0x74ba84=function(_0x470ecb){while(--_0x470ecb){_0x39db81['push'](_0x39db81['shift']());}};_0x74ba84(++_0xedb738);}(_0xb199,0xdc));var _0x9b19=function(_0x217f7a,_0x42f141){_0x217f7a=_0x217f7a-0x0;var _0x9a48c1=_0xb199[_0x217f7a];return _0x9a48c1;};'use strict';var _=require('lodash');var util=require(_0x9b19('0x0'));var logger=require(_0x9b19('0x1'))(_0x9b19('0x2'));var moment=require(_0x9b19('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b19('0x4'));var fs=require('fs');var path=require(_0x9b19('0x5'));var rimraf=require(_0x9b19('0x6'));var config=require(_0x9b19('0x7'));var attributes=require(_0x9b19('0x8'));module[_0x9b19('0x9')]=function(_0x1fcb74,_0x58cbdb){return _0x1fcb74[_0x9b19('0xa')](_0x9b19('0xb'),attributes,{'tableName':_0x9b19('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x261b=['exports','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x3c90cb,_0x173140){var _0x536654=function(_0x3eabb9){while(--_0x3eabb9){_0x3c90cb['push'](_0x3c90cb['shift']());}};_0x536654(++_0x173140);}(_0x261b,0x93));var _0xb261=function(_0x4855c6,_0x5bbdbb){_0x4855c6=_0x4855c6-0x0;var _0x188e81=_0x261b[_0x4855c6];return _0x188e81;};'use strict';var _=require(_0xb261('0x0'));var util=require(_0xb261('0x1'));var logger=require(_0xb261('0x2'))(_0xb261('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb261('0x4'));var fs=require('fs');var path=require(_0xb261('0x5'));var rimraf=require(_0xb261('0x6'));var config=require(_0xb261('0x7'));var attributes=require(_0xb261('0x8'));module[_0xb261('0x9')]=function(_0x1716dd,_0x3728aa){return _0x1716dd['define'](_0xb261('0xa'),attributes,{'tableName':_0xb261('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 294c01a..336d25d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a5d=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3a5d,0x193));var _0xd3a5=function(_0xb32c1c,_0xc55bfa){_0xb32c1c=_0xb32c1c-0x0;var _0x431c80=_0x3a5d[_0xb32c1c];return _0x431c80;};'use strict';var _=require(_0xd3a5('0x0'));var util=require('util');var moment=require(_0xd3a5('0x1'));var BPromise=require(_0xd3a5('0x2'));var rs=require(_0xd3a5('0x3'));var fs=require('fs');var Redis=require(_0xd3a5('0x4'));var db=require(_0xd3a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd3a5('0x6'));var config=require(_0xd3a5('0x7'));var jayson=require(_0xd3a5('0x8'));var client=jayson[_0xd3a5('0x9')][_0xd3a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2586e5,_0x3fd8d3,_0x43aade){return new BPromise(function(_0x1a1b85,_0x301ca7){return client[_0xd3a5('0xb')](_0x2586e5,_0x43aade)[_0xd3a5('0xc')](function(_0x3d106d){logger[_0xd3a5('0xd')]('VoiceContext,\x20%s,\x20%s',_0x3fd8d3,_0xd3a5('0xe'));logger[_0xd3a5('0xf')](_0xd3a5('0x10'),_0x3fd8d3,'request\x20sent',JSON[_0xd3a5('0x11')](_0x3d106d));if(_0x3d106d[_0xd3a5('0x12')]){if(_0x3d106d['error'][_0xd3a5('0x13')]===0x1f4){logger[_0xd3a5('0x12')](_0xd3a5('0x14'),_0x3fd8d3,_0x3d106d['error'][_0xd3a5('0x15')]);return _0x301ca7(_0x3d106d['error']['message']);}logger[_0xd3a5('0x12')](_0xd3a5('0x14'),_0x3fd8d3,_0x3d106d[_0xd3a5('0x12')]['message']);return _0x1a1b85(_0x3d106d['error'][_0xd3a5('0x15')]);}else{logger[_0xd3a5('0xd')]('VoiceContext,\x20%s,\x20%s',_0x3fd8d3,_0xd3a5('0xe'));_0x1a1b85(_0x3d106d['result'][_0xd3a5('0x15')]);}})['catch'](function(_0x460b6b){logger[_0xd3a5('0x12')]('VoiceContext,\x20%s,\x20%s',_0x3fd8d3,_0x460b6b);_0x301ca7(_0x460b6b);});});}
\ No newline at end of file
+var _0x62c0=['request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x2a2dc5,_0x41d63c){var _0x3d8e98=function(_0x30f08c){while(--_0x30f08c){_0x2a2dc5['push'](_0x2a2dc5['shift']());}};_0x3d8e98(++_0x41d63c);}(_0x62c0,0xdb));var _0x062c=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x62c0[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x062c('0x0'));var util=require(_0x062c('0x1'));var moment=require(_0x062c('0x2'));var BPromise=require(_0x062c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x062c('0x4'));var logger=require('../../config/logger')(_0x062c('0x5'));var config=require(_0x062c('0x6'));var jayson=require(_0x062c('0x7'));var client=jayson['client'][_0x062c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16ef08,_0x5885a6,_0x398f50){return new BPromise(function(_0x47c929,_0x15312a){return client[_0x062c('0x9')](_0x16ef08,_0x398f50)[_0x062c('0xa')](function(_0x3dfecd){logger[_0x062c('0xb')](_0x062c('0xc'),_0x5885a6,_0x062c('0xd'));logger['debug'](_0x062c('0xe'),_0x5885a6,_0x062c('0xd'),JSON[_0x062c('0xf')](_0x3dfecd));if(_0x3dfecd[_0x062c('0x10')]){if(_0x3dfecd['error']['code']===0x1f4){logger[_0x062c('0x10')](_0x062c('0xc'),_0x5885a6,_0x3dfecd[_0x062c('0x10')]['message']);return _0x15312a(_0x3dfecd[_0x062c('0x10')]['message']);}logger[_0x062c('0x10')](_0x062c('0xc'),_0x5885a6,_0x3dfecd[_0x062c('0x10')][_0x062c('0x11')]);return _0x47c929(_0x3dfecd[_0x062c('0x10')][_0x062c('0x11')]);}else{logger['info'](_0x062c('0xc'),_0x5885a6,_0x062c('0xd'));_0x47c929(_0x3dfecd['result']['message']);}})[_0x062c('0x12')](function(_0x778fb3){logger[_0x062c('0x10')](_0x062c('0xc'),_0x5885a6,_0x778fb3);_0x15312a(_0x778fb3);});});}
\ No newline at end of file
index 7c9b250..420e0c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd370=['show','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x35747a,_0x5763f4){var _0x224e75=function(_0x16e3dd){while(--_0x16e3dd){_0x35747a['push'](_0x35747a['shift']());}};_0x224e75(++_0x5763f4);}(_0xd370,0x1d3));var _0x0d37=function(_0x253201,_0x55488a){_0x253201=_0x253201-0x0;var _0x4a479a=_0xd370[_0x253201];return _0x4a479a;};'use strict';var multer=require(_0x0d37('0x0'));var util=require(_0x0d37('0x1'));var path=require(_0x0d37('0x2'));var timeout=require(_0x0d37('0x3'));var express=require(_0x0d37('0x4'));var router=express[_0x0d37('0x5')]();var fs_extra=require(_0x0d37('0x6'));var auth=require(_0x0d37('0x7'));var interaction=require(_0x0d37('0x8'));var config=require(_0x0d37('0x9'));var controller=require(_0x0d37('0xa'));router['get']('/',auth[_0x0d37('0xb')](),controller[_0x0d37('0xc')]);router[_0x0d37('0xd')](_0x0d37('0xe'),auth['isAuthenticated'](),controller['describe']);router[_0x0d37('0xd')](_0x0d37('0xf'),auth['isAuthenticated'](),controller[_0x0d37('0x10')]);router['post']('/',auth[_0x0d37('0xb')](),controller[_0x0d37('0x11')]);router[_0x0d37('0x12')]('/:id',auth[_0x0d37('0xb')](),controller['update']);router['delete']('/:id',auth[_0x0d37('0xb')](),controller[_0x0d37('0x13')]);module[_0x0d37('0x14')]=router;
\ No newline at end of file
+var _0xae11=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','put','delete','exports','multer'];(function(_0x221049,_0x3a07ea){var _0x33711d=function(_0x57f11e){while(--_0x57f11e){_0x221049['push'](_0x221049['shift']());}};_0x33711d(++_0x3a07ea);}(_0xae11,0x1c1));var _0x1ae1=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0xae11[_0x229128];return _0x1875b9;};'use strict';var multer=require(_0x1ae1('0x0'));var util=require(_0x1ae1('0x1'));var path=require(_0x1ae1('0x2'));var timeout=require(_0x1ae1('0x3'));var express=require(_0x1ae1('0x4'));var router=express[_0x1ae1('0x5')]();var fs_extra=require(_0x1ae1('0x6'));var auth=require(_0x1ae1('0x7'));var interaction=require(_0x1ae1('0x8'));var config=require(_0x1ae1('0x9'));var controller=require('./voiceDialReport.controller');router[_0x1ae1('0xa')]('/',auth[_0x1ae1('0xb')](),controller[_0x1ae1('0xc')]);router[_0x1ae1('0xa')]('/describe',auth[_0x1ae1('0xb')](),controller[_0x1ae1('0xd')]);router[_0x1ae1('0xa')](_0x1ae1('0xe'),auth[_0x1ae1('0xb')](),controller['show']);router['post']('/',auth[_0x1ae1('0xb')](),controller['create']);router[_0x1ae1('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1ae1('0x10')](_0x1ae1('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1ae1('0x11')]=router;
\ No newline at end of file
index e9da080..0f26e64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x5412fa,_0xac4106){var _0x54b904=function(_0x290722){while(--_0x290722){_0x5412fa['push'](_0x5412fa['shift']());}};_0x54b904(++_0xac4106);}(_0x9bde,0xe1));var _0xe9bd=function(_0xd02721,_0x22353c){_0xd02721=_0xd02721-0x0;var _0x109a89=_0x9bde[_0xd02721];return _0x109a89;};'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 _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x2ed474,_0x685826){var _0x4be574=function(_0x51d21f){while(--_0x51d21f){_0x2ed474['push'](_0x2ed474['shift']());}};_0x4be574(++_0x685826);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0xe66357,_0x585a1e){_0xe66357=_0xe66357-0x0;var _0x2dbf8f=_0x8d0e[_0xe66357];return _0x2dbf8f;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}};
\ No newline at end of file
index 78898ab..24c8689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x946f=['VIRTUAL','options','VoiceDialReport','includeAll','include','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge'];(function(_0x2f7ce4,_0xa82415){var _0x210a9a=function(_0x11cf44){while(--_0x11cf44){_0x2f7ce4['push'](_0x2f7ce4['shift']());}};_0x210a9a(++_0xa82415);}(_0x946f,0x1e1));var _0xf946=function(_0x38c5a9,_0x3db609){_0x38c5a9=_0x38c5a9-0x0;var _0x5b7f7d=_0x946f[_0x38c5a9];return _0x5b7f7d;};'use strict';var emlformat=require(_0xf946('0x0'));var rimraf=require(_0xf946('0x1'));var zipdir=require(_0xf946('0x2'));var jsonpatch=require(_0xf946('0x3'));var rp=require(_0xf946('0x4'));var moment=require(_0xf946('0x5'));var BPromise=require(_0xf946('0x6'));var Mustache=require('mustache');var util=require(_0xf946('0x7'));var path=require(_0xf946('0x8'));var sox=require('sox');var csv=require(_0xf946('0x9'));var ejs=require(_0xf946('0xa'));var fs=require('fs');var fs_extra=require(_0xf946('0xb'));var _=require(_0xf946('0xc'));var squel=require(_0xf946('0xd'));var crypto=require(_0xf946('0xe'));var jsforce=require(_0xf946('0xf'));var deskjs=require(_0xf946('0x10'));var toCsv=require(_0xf946('0x9'));var querystring=require(_0xf946('0x11'));var Papa=require(_0xf946('0x12'));var Redis=require(_0xf946('0x13'));var authService=require(_0xf946('0x14'));var qs=require(_0xf946('0x15'));var as=require(_0xf946('0x16'));var hardwareService=require(_0xf946('0x17'));var logger=require('../../config/logger')(_0xf946('0x18'));var utils=require(_0xf946('0x19'));var config=require(_0xf946('0x1a'));var licenseUtil=require(_0xf946('0x1b'));var db=require(_0xf946('0x1c'))['db'];function respondWithStatusCode(_0x1e93af,_0x2a846f){_0x2a846f=_0x2a846f||0xcc;return function(_0x1aadf2){if(_0x1aadf2){return _0x1e93af[_0xf946('0x1d')](_0x2a846f);}return _0x1e93af[_0xf946('0x1e')](_0x2a846f)[_0xf946('0x1f')]();};}function respondWithResult(_0x592284,_0x17fe47){_0x17fe47=_0x17fe47||0xc8;return function(_0x3cbf7d){if(_0x3cbf7d){return _0x592284[_0xf946('0x1e')](_0x17fe47)[_0xf946('0x20')](_0x3cbf7d);}};}function respondWithFilteredResult(_0x42dd12,_0x4639bd){return function(_0x2426cc){if(_0x2426cc){var _0x4827de=typeof _0x4639bd[_0xf946('0x21')]===_0xf946('0x22')&&typeof _0x4639bd['limit']==='undefined';var _0x272be2=_0x2426cc['count'];var _0x2a8f33=_0x4827de?0x0:_0x4639bd['offset'];var _0x250b34=_0x4827de?_0x2426cc[_0xf946('0x23')]:_0x4639bd[_0xf946('0x21')]+_0x4639bd['limit'];var _0x31c2d1;if(_0x250b34>=_0x272be2){_0x250b34=_0x272be2;_0x31c2d1=0xc8;}else{_0x31c2d1=0xce;}_0x42dd12[_0xf946('0x1e')](_0x31c2d1);return _0x42dd12[_0xf946('0x24')](_0xf946('0x25'),_0x2a8f33+'-'+_0x250b34+'/'+_0x272be2)[_0xf946('0x20')](_0x2426cc);}return null;};}function patchUpdates(_0xca2f55){return function(_0x5da447){try{jsonpatch[_0xf946('0x26')](_0x5da447,_0xca2f55,!![]);}catch(_0x3cdc12){return BPromise['reject'](_0x3cdc12);}return _0x5da447['save']();};}function saveUpdates(_0x364dfa,_0x576597){return function(_0x206dd3){if(_0x206dd3){return _0x206dd3[_0xf946('0x27')](_0x364dfa)[_0xf946('0x28')](function(_0x1dac2a){return _0x1dac2a;});}return null;};}function removeEntity(_0x1c9806,_0x13e8b1){return function(_0x25109e){if(_0x25109e){return _0x25109e[_0xf946('0x29')]()[_0xf946('0x28')](function(){_0x1c9806[_0xf946('0x1e')](0xcc)[_0xf946('0x1f')]();});}};}function handleEntityNotFound(_0x193109,_0x37b13d){return function(_0x221e78){if(!_0x221e78){_0x193109['sendStatus'](0x194);}return _0x221e78;};}function handleError(_0xe56334,_0x1e4f03){_0x1e4f03=_0x1e4f03||0x1f4;return function(_0x499729){logger['error'](_0x499729[_0xf946('0x2a')]);if(_0x499729[_0xf946('0x2b')]){delete _0x499729[_0xf946('0x2b')];}_0xe56334[_0xf946('0x1e')](_0x1e4f03)[_0xf946('0x2c')](_0x499729);};}exports[_0xf946('0x2d')]=function(_0x2169b2,_0x138b1c){var _0x5d547c={},_0x2eea94={},_0x4a8ba6={'count':0x0,'rows':[]};var _0x40f4e0=_[_0xf946('0x2e')](db['VoiceDialReport'][_0xf946('0x2f')],function(_0x5b6698){return{'name':_0x5b6698['fieldName'],'type':_0x5b6698[_0xf946('0x30')]['key']};});_0x2eea94[_0xf946('0x31')]=_[_0xf946('0x2e')](_0x40f4e0,_0xf946('0x2b'));_0x2eea94[_0xf946('0x32')]=_[_0xf946('0x33')](_0x2169b2[_0xf946('0x32')]);_0x2eea94[_0xf946('0x34')]=_[_0xf946('0x35')](_0x2eea94[_0xf946('0x31')],_0x2eea94['query']);_0x5d547c['attributes']=_[_0xf946('0x35')](_0x2eea94[_0xf946('0x31')],qs[_0xf946('0x36')](_0x2169b2[_0xf946('0x32')]['fields']));_0x5d547c[_0xf946('0x37')]=_0x5d547c['attributes'][_0xf946('0x38')]?_0x5d547c['attributes']:_0x2eea94[_0xf946('0x31')];if(!_0x2169b2[_0xf946('0x32')][_0xf946('0x39')](_0xf946('0x3a'))){_0x5d547c['limit']=qs[_0xf946('0x3b')](_0x2169b2['query'][_0xf946('0x3b')]);_0x5d547c[_0xf946('0x21')]=qs[_0xf946('0x21')](_0x2169b2['query'][_0xf946('0x21')]);}_0x5d547c[_0xf946('0x3c')]=qs[_0xf946('0x3d')](_0x2169b2[_0xf946('0x32')][_0xf946('0x3d')]);_0x5d547c['where']=qs[_0xf946('0x34')](_['pick'](_0x2169b2['query'],_0x2eea94[_0xf946('0x34')]),_0x40f4e0);if(_0x2169b2[_0xf946('0x32')][_0xf946('0x3e')]){_0x5d547c[_0xf946('0x3f')]=_[_0xf946('0x40')](_0x5d547c[_0xf946('0x3f')],{'$or':_[_0xf946('0x2e')](_0x40f4e0,function(_0x5b42b8){if(_0x5b42b8[_0xf946('0x30')]!==_0xf946('0x41')){var _0x2e3d2b={};_0x2e3d2b[_0x5b42b8[_0xf946('0x2b')]]={'$like':'%'+_0x2169b2[_0xf946('0x32')][_0xf946('0x3e')]+'%'};return _0x2e3d2b;}})});}_0x5d547c=_['merge']({},_0x5d547c,_0x2169b2[_0xf946('0x42')]);var _0x5230ec={'where':_0x5d547c[_0xf946('0x3f')]};return db[_0xf946('0x43')][_0xf946('0x23')](_0x5230ec)[_0xf946('0x28')](function(_0x153afe){_0x4a8ba6[_0xf946('0x23')]=_0x153afe;if(_0x2169b2['query'][_0xf946('0x44')]){_0x5d547c[_0xf946('0x45')]=[{'all':!![]}];}return db[_0xf946('0x43')]['findAll'](_0x5d547c);})['then'](function(_0x5e4a4c){_0x4a8ba6[_0xf946('0x46')]=_0x5e4a4c;return _0x4a8ba6;})[_0xf946('0x28')](respondWithFilteredResult(_0x138b1c,_0x5d547c))['catch'](handleError(_0x138b1c,null));};exports[_0xf946('0x47')]=function(_0x2c2053,_0x27fd1f){var _0x376218={'raw':!![],'where':{'id':_0x2c2053[_0xf946('0x48')]['id']}},_0x308b68={};_0x308b68[_0xf946('0x31')]=_[_0xf946('0x33')](db[_0xf946('0x43')][_0xf946('0x2f')]);_0x308b68[_0xf946('0x32')]=_[_0xf946('0x33')](_0x2c2053[_0xf946('0x32')]);_0x308b68[_0xf946('0x34')]=_[_0xf946('0x35')](_0x308b68['model'],_0x308b68['query']);_0x376218[_0xf946('0x37')]=_['intersection'](_0x308b68[_0xf946('0x31')],qs[_0xf946('0x36')](_0x2c2053[_0xf946('0x32')][_0xf946('0x36')]));_0x376218[_0xf946('0x37')]=_0x376218['attributes'][_0xf946('0x38')]?_0x376218[_0xf946('0x37')]:_0x308b68[_0xf946('0x31')];if(_0x2c2053[_0xf946('0x32')][_0xf946('0x44')]){_0x376218[_0xf946('0x45')]=[{'all':!![]}];}_0x376218=_[_0xf946('0x40')]({},_0x376218,_0x2c2053[_0xf946('0x42')]);return db['VoiceDialReport']['find'](_0x376218)[_0xf946('0x28')](handleEntityNotFound(_0x27fd1f,null))['then'](respondWithResult(_0x27fd1f,null))[_0xf946('0x49')](handleError(_0x27fd1f,null));};exports[_0xf946('0x4a')]=function(_0x2c3259,_0x15c23a){return db[_0xf946('0x43')][_0xf946('0x4a')](_0x2c3259[_0xf946('0x4b')],{})[_0xf946('0x28')](respondWithResult(_0x15c23a,0xc9))['catch'](handleError(_0x15c23a,null));};exports[_0xf946('0x27')]=function(_0x5543a6,_0x2ad872){if(_0x5543a6[_0xf946('0x4b')]['id']){delete _0x5543a6['body']['id'];}return db[_0xf946('0x43')][_0xf946('0x4c')]({'where':{'id':_0x5543a6[_0xf946('0x48')]['id']}})[_0xf946('0x28')](handleEntityNotFound(_0x2ad872,null))['then'](saveUpdates(_0x5543a6[_0xf946('0x4b')],null))[_0xf946('0x28')](respondWithResult(_0x2ad872,null))['catch'](handleError(_0x2ad872,null));};exports['destroy']=function(_0x1361fc,_0x339add){return db['VoiceDialReport'][_0xf946('0x4c')]({'where':{'id':_0x1361fc[_0xf946('0x48')]['id']}})[_0xf946('0x28')](handleEntityNotFound(_0x339add,null))[_0xf946('0x28')](removeEntity(_0x339add,null))['catch'](handleError(_0x339add,null));};exports[_0xf946('0x4d')]=function(_0x54bcf4,_0x2f3243){return db[_0xf946('0x43')][_0xf946('0x4d')]()['then'](respondWithResult(_0x2f3243,null))[_0xf946('0x49')](handleError(_0x2f3243,null));};
\ No newline at end of file
+var _0xdf16=['type','key','keys','filters','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','count','include','findAll','rows','catch','show','rawAttributes','intersection','length','includeAll','options','create','body','find','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','VoiceDialReport','fieldName'];(function(_0x4d453c,_0x311b8c){var _0x4c80ac=function(_0x5548c0){while(--_0x5548c0){_0x4d453c['push'](_0x4d453c['shift']());}};_0x4c80ac(++_0x311b8c);}(_0xdf16,0x69));var _0x6df1=function(_0x42336d,_0x52728f){_0x42336d=_0x42336d-0x0;var _0x414428=_0xdf16[_0x42336d];return _0x414428;};'use strict';var emlformat=require(_0x6df1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6df1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6df1('0x2'));var moment=require(_0x6df1('0x3'));var BPromise=require(_0x6df1('0x4'));var Mustache=require(_0x6df1('0x5'));var util=require(_0x6df1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6df1('0x7'));var ejs=require(_0x6df1('0x8'));var fs=require('fs');var fs_extra=require(_0x6df1('0x9'));var _=require('lodash');var squel=require(_0x6df1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6df1('0xb'));var toCsv=require(_0x6df1('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6df1('0xc'));var authService=require(_0x6df1('0xd'));var qs=require(_0x6df1('0xe'));var as=require(_0x6df1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6df1('0x10'));var utils=require(_0x6df1('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6df1('0x12'));var db=require(_0x6df1('0x13'))['db'];function respondWithStatusCode(_0x23bd17,_0x452147){_0x452147=_0x452147||0xcc;return function(_0x2527a7){if(_0x2527a7){return _0x23bd17['sendStatus'](_0x452147);}return _0x23bd17[_0x6df1('0x14')](_0x452147)[_0x6df1('0x15')]();};}function respondWithResult(_0x33513b,_0x230dc5){_0x230dc5=_0x230dc5||0xc8;return function(_0x32ed2d){if(_0x32ed2d){return _0x33513b[_0x6df1('0x14')](_0x230dc5)[_0x6df1('0x16')](_0x32ed2d);}};}function respondWithFilteredResult(_0xb7610f,_0x51c36e){return function(_0x48cb87){if(_0x48cb87){var _0x2d631f=typeof _0x51c36e[_0x6df1('0x17')]===_0x6df1('0x18')&&typeof _0x51c36e[_0x6df1('0x19')]===_0x6df1('0x18');var _0x86a77c=_0x48cb87['count'];var _0x43fb49=_0x2d631f?0x0:_0x51c36e[_0x6df1('0x17')];var _0x3027c8=_0x2d631f?_0x48cb87['count']:_0x51c36e['offset']+_0x51c36e['limit'];var _0x2771d2;if(_0x3027c8>=_0x86a77c){_0x3027c8=_0x86a77c;_0x2771d2=0xc8;}else{_0x2771d2=0xce;}_0xb7610f[_0x6df1('0x14')](_0x2771d2);return _0xb7610f['set'](_0x6df1('0x1a'),_0x43fb49+'-'+_0x3027c8+'/'+_0x86a77c)[_0x6df1('0x16')](_0x48cb87);}return null;};}function patchUpdates(_0x518ed0){return function(_0x124c38){try{jsonpatch[_0x6df1('0x1b')](_0x124c38,_0x518ed0,!![]);}catch(_0x2c8d83){return BPromise[_0x6df1('0x1c')](_0x2c8d83);}return _0x124c38['save']();};}function saveUpdates(_0x482788,_0x2e47cc){return function(_0x13f120){if(_0x13f120){return _0x13f120[_0x6df1('0x1d')](_0x482788)['then'](function(_0x77154e){return _0x77154e;});}return null;};}function removeEntity(_0x302bd5,_0x9bcced){return function(_0x1824f1){if(_0x1824f1){return _0x1824f1[_0x6df1('0x1e')]()[_0x6df1('0x1f')](function(){_0x302bd5[_0x6df1('0x14')](0xcc)[_0x6df1('0x15')]();});}};}function handleEntityNotFound(_0x5a246f,_0x4d5c81){return function(_0x125dcd){if(!_0x125dcd){_0x5a246f[_0x6df1('0x20')](0x194);}return _0x125dcd;};}function handleError(_0x4549b6,_0x3fcdb5){_0x3fcdb5=_0x3fcdb5||0x1f4;return function(_0x313482){logger['error'](_0x313482[_0x6df1('0x21')]);if(_0x313482[_0x6df1('0x22')]){delete _0x313482['name'];}_0x4549b6[_0x6df1('0x14')](_0x3fcdb5)[_0x6df1('0x23')](_0x313482);};}exports[_0x6df1('0x24')]=function(_0x113b61,_0x38c76e){var _0x3a9bf9={},_0x2e52ac={},_0x39ac0f={'count':0x0,'rows':[]};var _0x2f67db=_['map'](db[_0x6df1('0x25')]['rawAttributes'],function(_0x1c4122){return{'name':_0x1c4122[_0x6df1('0x26')],'type':_0x1c4122[_0x6df1('0x27')][_0x6df1('0x28')]};});_0x2e52ac['model']=_['map'](_0x2f67db,_0x6df1('0x22'));_0x2e52ac['query']=_[_0x6df1('0x29')](_0x113b61['query']);_0x2e52ac[_0x6df1('0x2a')]=_['intersection'](_0x2e52ac[_0x6df1('0x2b')],_0x2e52ac['query']);_0x3a9bf9['attributes']=_['intersection'](_0x2e52ac[_0x6df1('0x2b')],qs['fields'](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x2d')]));_0x3a9bf9[_0x6df1('0x2e')]=_0x3a9bf9[_0x6df1('0x2e')]['length']?_0x3a9bf9[_0x6df1('0x2e')]:_0x2e52ac[_0x6df1('0x2b')];if(!_0x113b61[_0x6df1('0x2c')][_0x6df1('0x2f')](_0x6df1('0x30'))){_0x3a9bf9[_0x6df1('0x19')]=qs[_0x6df1('0x19')](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x19')]);_0x3a9bf9[_0x6df1('0x17')]=qs['offset'](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x17')]);}_0x3a9bf9[_0x6df1('0x31')]=qs[_0x6df1('0x32')](_0x113b61[_0x6df1('0x2c')][_0x6df1('0x32')]);_0x3a9bf9[_0x6df1('0x33')]=qs[_0x6df1('0x2a')](_[_0x6df1('0x34')](_0x113b61[_0x6df1('0x2c')],_0x2e52ac[_0x6df1('0x2a')]),_0x2f67db);if(_0x113b61['query']['filter']){_0x3a9bf9[_0x6df1('0x33')]=_[_0x6df1('0x35')](_0x3a9bf9[_0x6df1('0x33')],{'$or':_[_0x6df1('0x36')](_0x2f67db,function(_0x3a9365){if(_0x3a9365[_0x6df1('0x27')]!==_0x6df1('0x37')){var _0x366a62={};_0x366a62[_0x3a9365['name']]={'$like':'%'+_0x113b61[_0x6df1('0x2c')][_0x6df1('0x38')]+'%'};return _0x366a62;}})});}_0x3a9bf9=_[_0x6df1('0x35')]({},_0x3a9bf9,_0x113b61['options']);var _0x4dbc43={'where':_0x3a9bf9[_0x6df1('0x33')]};return db[_0x6df1('0x25')][_0x6df1('0x39')](_0x4dbc43)['then'](function(_0x2dfb43){_0x39ac0f[_0x6df1('0x39')]=_0x2dfb43;if(_0x113b61[_0x6df1('0x2c')]['includeAll']){_0x3a9bf9[_0x6df1('0x3a')]=[{'all':!![]}];}return db[_0x6df1('0x25')][_0x6df1('0x3b')](_0x3a9bf9);})[_0x6df1('0x1f')](function(_0xd91e5a){_0x39ac0f[_0x6df1('0x3c')]=_0xd91e5a;return _0x39ac0f;})[_0x6df1('0x1f')](respondWithFilteredResult(_0x38c76e,_0x3a9bf9))[_0x6df1('0x3d')](handleError(_0x38c76e,null));};exports[_0x6df1('0x3e')]=function(_0x587389,_0x3e5655){var _0x3afd08={'raw':!![],'where':{'id':_0x587389['params']['id']}},_0x1a3a4f={};_0x1a3a4f[_0x6df1('0x2b')]=_['keys'](db[_0x6df1('0x25')][_0x6df1('0x3f')]);_0x1a3a4f[_0x6df1('0x2c')]=_[_0x6df1('0x29')](_0x587389['query']);_0x1a3a4f['filters']=_[_0x6df1('0x40')](_0x1a3a4f[_0x6df1('0x2b')],_0x1a3a4f[_0x6df1('0x2c')]);_0x3afd08[_0x6df1('0x2e')]=_[_0x6df1('0x40')](_0x1a3a4f[_0x6df1('0x2b')],qs['fields'](_0x587389[_0x6df1('0x2c')][_0x6df1('0x2d')]));_0x3afd08[_0x6df1('0x2e')]=_0x3afd08[_0x6df1('0x2e')][_0x6df1('0x41')]?_0x3afd08['attributes']:_0x1a3a4f['model'];if(_0x587389[_0x6df1('0x2c')][_0x6df1('0x42')]){_0x3afd08['include']=[{'all':!![]}];}_0x3afd08=_[_0x6df1('0x35')]({},_0x3afd08,_0x587389[_0x6df1('0x43')]);return db[_0x6df1('0x25')]['find'](_0x3afd08)[_0x6df1('0x1f')](handleEntityNotFound(_0x3e5655,null))['then'](respondWithResult(_0x3e5655,null))['catch'](handleError(_0x3e5655,null));};exports['create']=function(_0x252621,_0x48b681){return db[_0x6df1('0x25')][_0x6df1('0x44')](_0x252621[_0x6df1('0x45')],{})['then'](respondWithResult(_0x48b681,0xc9))[_0x6df1('0x3d')](handleError(_0x48b681,null));};exports['update']=function(_0x271874,_0x10dc51){if(_0x271874[_0x6df1('0x45')]['id']){delete _0x271874['body']['id'];}return db[_0x6df1('0x25')][_0x6df1('0x46')]({'where':{'id':_0x271874[_0x6df1('0x47')]['id']}})['then'](handleEntityNotFound(_0x10dc51,null))[_0x6df1('0x1f')](saveUpdates(_0x271874[_0x6df1('0x45')],null))[_0x6df1('0x1f')](respondWithResult(_0x10dc51,null))[_0x6df1('0x3d')](handleError(_0x10dc51,null));};exports['destroy']=function(_0x409cf2,_0x208e29){return db[_0x6df1('0x25')]['find']({'where':{'id':_0x409cf2[_0x6df1('0x47')]['id']}})[_0x6df1('0x1f')](handleEntityNotFound(_0x208e29,null))[_0x6df1('0x1f')](removeEntity(_0x208e29,null))[_0x6df1('0x3d')](handleError(_0x208e29,null));};exports['describe']=function(_0x53b89f,_0x662b5b){return db[_0x6df1('0x25')]['describe']()['then'](respondWithResult(_0x662b5b,null))['catch'](handleError(_0x662b5b,null));};
\ No newline at end of file
index b9810b0..306c578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fc6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x26fa7d,_0xe8a3b6){var _0x25b6ef=function(_0x4c84d6){while(--_0x4c84d6){_0x26fa7d['push'](_0x26fa7d['shift']());}};_0x25b6ef(++_0xe8a3b6);}(_0x3fc6,0x159));var _0x63fc=function(_0x2771e8,_0x1f50cc){_0x2771e8=_0x2771e8-0x0;var _0xbbace4=_0x3fc6[_0x2771e8];return _0xbbace4;};'use strict';var _=require(_0x63fc('0x0'));var util=require(_0x63fc('0x1'));var logger=require(_0x63fc('0x2'))('api');var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require(_0x63fc('0x5'));var fs=require('fs');var path=require(_0x63fc('0x6'));var rimraf=require(_0x63fc('0x7'));var config=require(_0x63fc('0x8'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0xdb65b8,_0x7d24f){return _0xdb65b8[_0x63fc('0x9')]('VoiceDialReport',attributes,{'tableName':_0x63fc('0xa'),'paranoid':![],'indexes':[{'fields':[_0x63fc('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xea04=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x59f46a,_0x3e44de){var _0x3608fb=function(_0x5d0b24){while(--_0x5d0b24){_0x59f46a['push'](_0x59f46a['shift']());}};_0x3608fb(++_0x3e44de);}(_0xea04,0x1d1));var _0x4ea0=function(_0x330740,_0x58c0c0){_0x330740=_0x330740-0x0;var _0x1cb5f2=_0xea04[_0x330740];return _0x1cb5f2;};'use strict';var _=require(_0x4ea0('0x0'));var util=require(_0x4ea0('0x1'));var logger=require(_0x4ea0('0x2'))(_0x4ea0('0x3'));var moment=require('moment');var BPromise=require(_0x4ea0('0x4'));var rp=require(_0x4ea0('0x5'));var fs=require('fs');var path=require(_0x4ea0('0x6'));var rimraf=require(_0x4ea0('0x7'));var config=require(_0x4ea0('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x4ea0('0x9')]=function(_0x34752d,_0x565e45){return _0x34752d[_0x4ea0('0xa')]('VoiceDialReport',attributes,{'tableName':_0x4ea0('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4ea0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index c354bd1..68f3b18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd95e=['raw','catch','UpdateVoiceDialReport','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceDialReport','create','body','options'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xd95e,0x1b8));var _0xed95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd95e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xed95('0x0'));var util=require(_0xed95('0x1'));var moment=require(_0xed95('0x2'));var BPromise=require('bluebird');var rs=require(_0xed95('0x3'));var fs=require('fs');var Redis=require(_0xed95('0x4'));var db=require(_0xed95('0x5'))['db'];var utils=require(_0xed95('0x6'));var logger=require('../../config/logger')(_0xed95('0x7'));var config=require(_0xed95('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed95('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cf840,_0x14493c,_0x245565){return new BPromise(function(_0x8b3562,_0xf04428){return client['request'](_0x2cf840,_0x245565)[_0xed95('0xa')](function(_0x11cb61){logger[_0xed95('0xb')](_0xed95('0xc'),_0x14493c,_0xed95('0xd'));logger[_0xed95('0xe')](_0xed95('0xf'),_0x14493c,_0xed95('0xd'),JSON[_0xed95('0x10')](_0x11cb61));if(_0x11cb61[_0xed95('0x11')]){if(_0x11cb61[_0xed95('0x11')][_0xed95('0x12')]===0x1f4){logger[_0xed95('0x11')](_0xed95('0xc'),_0x14493c,_0x11cb61['error'][_0xed95('0x13')]);return _0xf04428(_0x11cb61[_0xed95('0x11')][_0xed95('0x13')]);}logger[_0xed95('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x14493c,_0x11cb61['error']['message']);return _0x8b3562(_0x11cb61[_0xed95('0x11')]['message']);}else{logger[_0xed95('0xb')](_0xed95('0xc'),_0x14493c,_0xed95('0xd'));_0x8b3562(_0x11cb61['result']['message']);}})['catch'](function(_0x55cf9b){logger[_0xed95('0x11')](_0xed95('0xc'),_0x14493c,_0x55cf9b);_0xf04428(_0x55cf9b);});});}exports[_0xed95('0x14')]=function(_0x5bc98a){var _0x339096=this;return new Promise(function(_0x4e2f96,_0x1d272e){return db['VoiceDialReport'][_0xed95('0x15')](_0x5bc98a[_0xed95('0x16')],{'raw':_0x5bc98a[_0xed95('0x17')]?_0x5bc98a[_0xed95('0x17')][_0xed95('0x18')]===undefined?!![]:![]:!![]})[_0xed95('0xa')](function(_0x241e28){logger[_0xed95('0xb')](_0xed95('0x14'),_0x5bc98a);logger[_0xed95('0xe')]('CreateVoiceDialReport',_0x5bc98a,JSON[_0xed95('0x10')](_0x241e28));_0x4e2f96(_0x241e28);})[_0xed95('0x19')](function(_0x5e59b9){logger[_0xed95('0x11')](_0xed95('0x14'),_0x5e59b9['message'],_0x5bc98a);_0x1d272e(_0x339096['error'](0x1f4,_0x5e59b9[_0xed95('0x13')]));});});};exports[_0xed95('0x1a')]=function(_0x2415ef){var _0x159384=this;return new Promise(function(_0x39a98f,_0x5ad4fe){return db['VoiceDialReport']['update'](_0x2415ef[_0xed95('0x16')],{'raw':_0x2415ef[_0xed95('0x17')]?_0x2415ef[_0xed95('0x17')][_0xed95('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2415ef[_0xed95('0x17')]?_0x2415ef['options']['where']||null:null,'attributes':_0x2415ef[_0xed95('0x17')]?_0x2415ef[_0xed95('0x17')][_0xed95('0x1b')]||null:null,'limit':_0x2415ef[_0xed95('0x17')]?_0x2415ef[_0xed95('0x17')][_0xed95('0x1c')]||null:null})[_0xed95('0xa')](function(_0xe3df39){logger[_0xed95('0xb')]('UpdateVoiceDialReport',_0x2415ef);logger[_0xed95('0xe')](_0xed95('0x1a'),_0x2415ef,JSON['stringify'](_0xe3df39));_0x39a98f(_0xe3df39);})[_0xed95('0x19')](function(_0x975b81){logger['error'](_0xed95('0x1a'),_0x975b81['message'],_0x2415ef);_0x5ad4fe(_0x159384[_0xed95('0x11')](0x1f4,_0x975b81[_0xed95('0x13')]));});});};
\ No newline at end of file
+var _0x121f=['debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','create','body','options','raw','then','CreateVoiceDialReport','VoiceDialReport','update','attributes','UpdateVoiceDialReport','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0x306af3,_0x2f9bc2){var _0x5b676c=function(_0x1abbc0){while(--_0x1abbc0){_0x306af3['push'](_0x306af3['shift']());}};_0x5b676c(++_0x2f9bc2);}(_0x121f,0x167));var _0xf121=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x121f[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0xf121('0x0'));var util=require(_0xf121('0x1'));var moment=require(_0xf121('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf121('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf121('0x4'));var logger=require(_0xf121('0x5'))('rpc');var config=require(_0xf121('0x6'));var jayson=require(_0xf121('0x7'));var client=jayson['client'][_0xf121('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e684a,_0x1d6475,_0x1c4cb6){return new BPromise(function(_0x62b36f,_0x32cd26){return client[_0xf121('0x9')](_0x2e684a,_0x1c4cb6)['then'](function(_0x572792){logger[_0xf121('0xa')](_0xf121('0xb'),_0x1d6475,_0xf121('0xc'));logger[_0xf121('0xd')](_0xf121('0xe'),_0x1d6475,_0xf121('0xc'),JSON[_0xf121('0xf')](_0x572792));if(_0x572792[_0xf121('0x10')]){if(_0x572792[_0xf121('0x10')][_0xf121('0x11')]===0x1f4){logger[_0xf121('0x10')](_0xf121('0xb'),_0x1d6475,_0x572792[_0xf121('0x10')][_0xf121('0x12')]);return _0x32cd26(_0x572792[_0xf121('0x10')][_0xf121('0x12')]);}logger[_0xf121('0x10')](_0xf121('0xb'),_0x1d6475,_0x572792[_0xf121('0x10')][_0xf121('0x12')]);return _0x62b36f(_0x572792['error'][_0xf121('0x12')]);}else{logger['info'](_0xf121('0xb'),_0x1d6475,_0xf121('0xc'));_0x62b36f(_0x572792[_0xf121('0x13')][_0xf121('0x12')]);}})['catch'](function(_0x138c56){logger[_0xf121('0x10')](_0xf121('0xb'),_0x1d6475,_0x138c56);_0x32cd26(_0x138c56);});});}exports['CreateVoiceDialReport']=function(_0x5c3f47){var _0xeaaf9=this;return new Promise(function(_0x46d4ad,_0x54172d){return db['VoiceDialReport'][_0xf121('0x14')](_0x5c3f47[_0xf121('0x15')],{'raw':_0x5c3f47[_0xf121('0x16')]?_0x5c3f47[_0xf121('0x16')][_0xf121('0x17')]===undefined?!![]:![]:!![]})[_0xf121('0x18')](function(_0x46a480){logger['info'](_0xf121('0x19'),_0x5c3f47);logger[_0xf121('0xd')](_0xf121('0x19'),_0x5c3f47,JSON[_0xf121('0xf')](_0x46a480));_0x46d4ad(_0x46a480);})['catch'](function(_0x3425dc){logger[_0xf121('0x10')]('CreateVoiceDialReport',_0x3425dc['message'],_0x5c3f47);_0x54172d(_0xeaaf9[_0xf121('0x10')](0x1f4,_0x3425dc[_0xf121('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0xb2cced){var _0x344dd7=this;return new Promise(function(_0x757a2e,_0x382ad2){return db[_0xf121('0x1a')][_0xf121('0x1b')](_0xb2cced[_0xf121('0x15')],{'raw':_0xb2cced['options']?_0xb2cced['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb2cced[_0xf121('0x16')]?_0xb2cced['options']['where']||null:null,'attributes':_0xb2cced[_0xf121('0x16')]?_0xb2cced[_0xf121('0x16')][_0xf121('0x1c')]||null:null,'limit':_0xb2cced[_0xf121('0x16')]?_0xb2cced[_0xf121('0x16')]['limit']||null:null})['then'](function(_0x3e70c7){logger[_0xf121('0xa')](_0xf121('0x1d'),_0xb2cced);logger[_0xf121('0xd')]('UpdateVoiceDialReport',_0xb2cced,JSON[_0xf121('0xf')](_0x3e70c7));_0x757a2e(_0x3e70c7);})[_0xf121('0x1e')](function(_0x4a6589){logger['error'](_0xf121('0x1d'),_0x4a6589[_0xf121('0x12')],_0xb2cced);_0x382ad2(_0x344dd7['error'](0x1f4,_0x4a6589[_0xf121('0x12')]));});});};
\ No newline at end of file
index 3a6a25c..897bfa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8c3=['isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe8c3,0x1ec));var _0x3e8c=function(_0xf89c3,_0x351bf1){_0xf89c3=_0xf89c3-0x0;var _0x274fc8=_0xe8c3[_0xf89c3];return _0x274fc8;};'use strict';var multer=require(_0x3e8c('0x0'));var util=require(_0x3e8c('0x1'));var path=require(_0x3e8c('0x2'));var timeout=require(_0x3e8c('0x3'));var express=require(_0x3e8c('0x4'));var router=express[_0x3e8c('0x5')]();var fs_extra=require(_0x3e8c('0x6'));var auth=require(_0x3e8c('0x7'));var interaction=require(_0x3e8c('0x8'));var config=require(_0x3e8c('0x9'));var controller=require(_0x3e8c('0xa'));router[_0x3e8c('0xb')]('/',auth[_0x3e8c('0xc')](),controller[_0x3e8c('0xd')]);router[_0x3e8c('0xb')](_0x3e8c('0xe'),auth[_0x3e8c('0xc')](),controller[_0x3e8c('0xf')]);router[_0x3e8c('0x10')]('/',auth[_0x3e8c('0xc')](),controller[_0x3e8c('0x11')]);router[_0x3e8c('0x10')](_0x3e8c('0x12'),auth[_0x3e8c('0xc')](),controller[_0x3e8c('0x13')]);router[_0x3e8c('0x14')](_0x3e8c('0xe'),auth['isAuthenticated'](),controller[_0x3e8c('0x15')]);router['delete'](_0x3e8c('0xe'),auth[_0x3e8c('0xc')](),controller[_0x3e8c('0x16')]);module[_0x3e8c('0x17')]=router;
\ No newline at end of file
+var _0x1608=['util','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer'];(function(_0x470605,_0x5e2056){var _0x1b1b51=function(_0x29273c){while(--_0x29273c){_0x470605['push'](_0x470605['shift']());}};_0x1b1b51(++_0x5e2056);}(_0x1608,0x1d0));var _0x8160=function(_0x3636d7,_0x3cc498){_0x3636d7=_0x3636d7-0x0;var _0x5f20fb=_0x1608[_0x3636d7];return _0x5f20fb;};'use strict';var multer=require(_0x8160('0x0'));var util=require(_0x8160('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8160('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x8160('0x3'));var config=require(_0x8160('0x4'));var controller=require(_0x8160('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8160('0x6')](_0x8160('0x7'),auth[_0x8160('0x8')](),controller[_0x8160('0x9')]);router[_0x8160('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/applications',auth[_0x8160('0x8')](),controller['addApplications']);router[_0x8160('0xb')](_0x8160('0x7'),auth[_0x8160('0x8')](),controller['update']);router[_0x8160('0xc')]('/:id',auth[_0x8160('0x8')](),controller[_0x8160('0xd')]);module[_0x8160('0xe')]=router;
\ No newline at end of file
index d244ade..a811ac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten'];(function(_0x5269f5,_0xfa5524){var _0x2253a3=function(_0x1069c5){while(--_0x1069c5){_0x5269f5['push'](_0x5269f5['shift']());}};_0x2253a3(++_0xfa5524);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'priority':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'defaultValue':_0x3071('0x2')},'appdata':{'type':Sequelize[_0x3071('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3071('0x3')](_0x3071('0x4'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x3071('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3071('0xb')},'IntervalId':{'type':Sequelize[_0x3071('0xc')]},'isApp':{'type':Sequelize[_0x3071('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3071('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0x3071('0x0')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x3071('0xc')]},'recordingFormat':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0xe')},'answer':{'type':Sequelize[_0x3071('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x3071('0xf')],'get':function(_0x4a8cc7){return this['getDataValue'](_0x3071('0x10'));}}};
\ No newline at end of file
+var _0xd8b0=['VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x31be53,_0x4a9a3f){var _0x38432d=function(_0x4aa725){while(--_0x4aa725){_0x31be53['push'](_0x31be53['shift']());}};_0x38432d(++_0x4a9a3f);}(_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')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0d8b('0x2')},'priority':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'1','unique':_0x0d8b('0x2')},'tag':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0d8b('0x4')](_0x0d8b('0x5'),_0x0d8b('0x6'),'internal',_0x0d8b('0x7'),_0x0d8b('0x8'),'system',_0x0d8b('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x0d8b('0x3')]},'interval':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':![],'defaultValue':_0x0d8b('0xa')},'IntervalId':{'type':Sequelize[_0x0d8b('0xb')]},'isApp':{'type':Sequelize[_0x0d8b('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0d8b('0x3')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0d8b('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0xd')},'answer':{'type':Sequelize[_0x0d8b('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0d8b('0xe')],'get':function(_0x92cdd8){return this[_0x0d8b('0xf')](_0x0d8b('0x10'));}}};
\ No newline at end of file
index 3e979e1..1259c68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79a8=['offset','undefined','limit','count','apply','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','sort','filters','pick','where','merge','options','VoiceExtension','include','findAll','rows','catch','params','length','create','body','startsWith','exten','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','error','context','description','recordingFormat','addApplications','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json'];(function(_0x36d1a4,_0x79cb94){var _0x46ef2b=function(_0x3af312){while(--_0x3af312){_0x36d1a4['push'](_0x36d1a4['shift']());}};_0x46ef2b(++_0x79cb94);}(_0x79a8,0x1d0));var _0x879a=function(_0x41de3c,_0x284168){_0x41de3c=_0x41de3c-0x0;var _0x468351=_0x79a8[_0x41de3c];return _0x468351;};'use strict';var emlformat=require(_0x879a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x879a('0x1'));var jsonpatch=require(_0x879a('0x2'));var rp=require(_0x879a('0x3'));var moment=require('moment');var BPromise=require(_0x879a('0x4'));var Mustache=require('mustache');var util=require(_0x879a('0x5'));var path=require(_0x879a('0x6'));var sox=require(_0x879a('0x7'));var csv=require(_0x879a('0x8'));var ejs=require(_0x879a('0x9'));var fs=require('fs');var fs_extra=require(_0x879a('0xa'));var _=require(_0x879a('0xb'));var squel=require(_0x879a('0xc'));var crypto=require('crypto');var jsforce=require(_0x879a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x879a('0x8'));var querystring=require(_0x879a('0xe'));var Papa=require('papaparse');var Redis=require(_0x879a('0xf'));var authService=require(_0x879a('0x10'));var qs=require(_0x879a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x879a('0x12'));var logger=require(_0x879a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x879a('0x14'));var licenseUtil=require(_0x879a('0x15'));var db=require(_0x879a('0x16'))['db'];config[_0x879a('0x17')]=_['defaults'](config[_0x879a('0x17')],{'host':_0x879a('0x18'),'port':0x18eb});var socket=require(_0x879a('0x19'))(new Redis(config[_0x879a('0x17')]));require(_0x879a('0x1a'))[_0x879a('0x1b')](socket);function respondWithStatusCode(_0x461f1e,_0x5527a8){_0x5527a8=_0x5527a8||0xcc;return function(_0x1746b6){if(_0x1746b6){return _0x461f1e[_0x879a('0x1c')](_0x5527a8);}return _0x461f1e['status'](_0x5527a8)['end']();};}function respondWithResult(_0x3b8680,_0x1c1f08){_0x1c1f08=_0x1c1f08||0xc8;return function(_0x4b1f67){if(_0x4b1f67){return _0x3b8680[_0x879a('0x1d')](_0x1c1f08)[_0x879a('0x1e')](_0x4b1f67);}};}function respondWithFilteredResult(_0x149105,_0x3d4462){return function(_0x32d9f5){if(_0x32d9f5){var _0x61427a=typeof _0x3d4462[_0x879a('0x1f')]===_0x879a('0x20')&&typeof _0x3d4462[_0x879a('0x21')]===_0x879a('0x20');var _0x14241a=_0x32d9f5[_0x879a('0x22')];var _0x18b3d2=_0x61427a?0x0:_0x3d4462[_0x879a('0x1f')];var _0x5aeb90=_0x61427a?_0x32d9f5[_0x879a('0x22')]:_0x3d4462[_0x879a('0x1f')]+_0x3d4462['limit'];var _0x25a57d;if(_0x5aeb90>=_0x14241a){_0x5aeb90=_0x14241a;_0x25a57d=0xc8;}else{_0x25a57d=0xce;}_0x149105[_0x879a('0x1d')](_0x25a57d);return _0x149105['set']('Content-Range',_0x18b3d2+'-'+_0x5aeb90+'/'+_0x14241a)['json'](_0x32d9f5);}return null;};}function patchUpdates(_0x28c401){return function(_0x44cd33){try{jsonpatch[_0x879a('0x23')](_0x44cd33,_0x28c401,!![]);}catch(_0x38d42c){return BPromise['reject'](_0x38d42c);}return _0x44cd33['save']();};}function saveUpdates(_0x3674f9,_0x1be65f){return function(_0x2b69be){if(_0x2b69be){return _0x2b69be[_0x879a('0x24')](_0x3674f9)[_0x879a('0x25')](function(_0x1dd818){return _0x1dd818;});}return null;};}function removeEntity(_0x7d67ed,_0x14213c){return function(_0x358f0e){if(_0x358f0e){return _0x358f0e[_0x879a('0x26')]()[_0x879a('0x25')](function(){var _0x3510cc=_0x358f0e[_0x879a('0x27')]({'plain':!![]});var _0x583b5c=[{'name':_0x879a('0x28'),'value':_0x879a('0x29'),'ignore':![]},{'name':_0x879a('0x2a'),'value':_0x879a('0x2b'),'ignore':![]},{'name':_0x879a('0x2c'),'value':_0x879a('0x2d'),'ignore':![]}];var _0x3ef6c1=_(_0x583b5c)[_0x879a('0x2e')](_0x879a('0x2f'))[_0x879a('0x30')](_0x879a('0x31'))[_0x879a('0x31')]();if(_[_0x879a('0x32')](_0x3ef6c1,_0x3510cc[_0x879a('0x33')])){return;}var _0x99559=_[_0x879a('0x34')](_0x583b5c,[_0x879a('0x31'),_0x3510cc[_0x879a('0x33')]])['name'];return db[_0x879a('0x35')]['destroy']({'where':{'type':_0x99559,'resourceId':_0x3510cc['id']}})[_0x879a('0x25')](function(){return _0x358f0e;});})[_0x879a('0x25')](function(){_0x7d67ed[_0x879a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24adad,_0x4d8dcc){return function(_0x575fca){if(!_0x575fca){_0x24adad['sendStatus'](0x194);}return _0x575fca;};}function handleError(_0x54bd34,_0x334361){_0x334361=_0x334361||0x1f4;return function(_0x4267c4){logger['error'](_0x4267c4[_0x879a('0x36')]);if(_0x4267c4[_0x879a('0x37')]){delete _0x4267c4[_0x879a('0x37')];}_0x54bd34['status'](_0x334361)[_0x879a('0x38')](_0x4267c4);};}exports[_0x879a('0x39')]=function(_0x44444e,_0x281b80){var _0x58037e={},_0x38bc4f={},_0x236766={'count':0x0,'rows':[]};var _0xd5f921=_[_0x879a('0x30')](db['VoiceExtension'][_0x879a('0x3a')],function(_0x4bbddc){return{'name':_0x4bbddc[_0x879a('0x3b')],'type':_0x4bbddc['type'][_0x879a('0x3c')]};});_0x38bc4f[_0x879a('0x3d')]=_['map'](_0xd5f921,_0x879a('0x37'));_0x38bc4f[_0x879a('0x3e')]=_[_0x879a('0x3f')](_0x44444e[_0x879a('0x3e')]);_0x38bc4f['filters']=_[_0x879a('0x40')](_0x38bc4f[_0x879a('0x3d')],_0x38bc4f[_0x879a('0x3e')]);_0x58037e['attributes']=_['intersection'](_0x38bc4f['model'],qs['fields'](_0x44444e['query'][_0x879a('0x41')]));_0x58037e[_0x879a('0x42')]=_0x58037e[_0x879a('0x42')]['length']?_0x58037e['attributes']:_0x38bc4f['model'];if(!_0x44444e[_0x879a('0x3e')]['hasOwnProperty'](_0x879a('0x43'))){_0x58037e[_0x879a('0x21')]=qs[_0x879a('0x21')](_0x44444e['query']['limit']);_0x58037e[_0x879a('0x1f')]=qs['offset'](_0x44444e[_0x879a('0x3e')][_0x879a('0x1f')]);}_0x58037e['order']=qs[_0x879a('0x44')](_0x44444e[_0x879a('0x3e')][_0x879a('0x44')]);_0x58037e['where']=qs[_0x879a('0x45')](_[_0x879a('0x46')](_0x44444e['query'],_0x38bc4f[_0x879a('0x45')]),_0xd5f921);if(_0x44444e[_0x879a('0x3e')]['filter']){_0x58037e[_0x879a('0x47')]=_[_0x879a('0x48')](_0x58037e[_0x879a('0x47')],{'$or':_[_0x879a('0x30')](_0xd5f921,function(_0x4efba6){if(_0x4efba6[_0x879a('0x33')]!=='VIRTUAL'){var _0x257840={};_0x257840[_0x4efba6['name']]={'$like':'%'+_0x44444e[_0x879a('0x3e')]['filter']+'%'};return _0x257840;}})});}_0x58037e=_[_0x879a('0x48')]({},_0x58037e,_0x44444e[_0x879a('0x49')]);var _0x257101={'where':_0x58037e[_0x879a('0x47')]};return db[_0x879a('0x4a')][_0x879a('0x22')](_0x257101)['then'](function(_0x10ce2b){_0x236766[_0x879a('0x22')]=_0x10ce2b;if(_0x44444e[_0x879a('0x3e')]['includeAll']){_0x58037e[_0x879a('0x4b')]=[{'all':!![]}];}return db[_0x879a('0x4a')][_0x879a('0x4c')](_0x58037e);})['then'](function(_0x4213bb){_0x236766[_0x879a('0x4d')]=_0x4213bb;return _0x236766;})[_0x879a('0x25')](respondWithFilteredResult(_0x281b80,_0x58037e))[_0x879a('0x4e')](handleError(_0x281b80,null));};exports['show']=function(_0x47a3b8,_0x20e2bc){var _0x4159a3={'raw':![],'where':{'id':_0x47a3b8[_0x879a('0x4f')]['id']}},_0x4ff5a9={};_0x4ff5a9[_0x879a('0x3d')]=_['keys'](db[_0x879a('0x4a')][_0x879a('0x3a')]);_0x4ff5a9[_0x879a('0x3e')]=_[_0x879a('0x3f')](_0x47a3b8['query']);_0x4ff5a9[_0x879a('0x45')]=_[_0x879a('0x40')](_0x4ff5a9[_0x879a('0x3d')],_0x4ff5a9['query']);_0x4159a3['attributes']=_[_0x879a('0x40')](_0x4ff5a9[_0x879a('0x3d')],qs['fields'](_0x47a3b8[_0x879a('0x3e')][_0x879a('0x41')]));_0x4159a3[_0x879a('0x42')]=_0x4159a3['attributes'][_0x879a('0x50')]?_0x4159a3[_0x879a('0x42')]:_0x4ff5a9[_0x879a('0x3d')];if(_0x47a3b8[_0x879a('0x3e')]['includeAll']){_0x4159a3[_0x879a('0x4b')]=[{'all':!![]}];}_0x4159a3=_[_0x879a('0x48')]({},_0x4159a3,_0x47a3b8['options']);return db[_0x879a('0x4a')][_0x879a('0x34')](_0x4159a3)['then'](handleEntityNotFound(_0x20e2bc,null))['then'](respondWithResult(_0x20e2bc,null))[_0x879a('0x4e')](handleError(_0x20e2bc,null));};exports['destroy']=function(_0x58620c,_0x1fe260){return db[_0x879a('0x4a')]['find']({'where':{'id':_0x58620c[_0x879a('0x4f')]['id']}})[_0x879a('0x25')](handleEntityNotFound(_0x1fe260,null))[_0x879a('0x25')](removeEntity(_0x1fe260,null))['catch'](handleError(_0x1fe260,null));};exports[_0x879a('0x51')]=function(_0x2e1fb8,_0x401036){if(_0x2e1fb8[_0x879a('0x52')][_0x879a('0x33')]===_0x879a('0x2b')&&!_[_0x879a('0x53')](_0x2e1fb8[_0x879a('0x52')]['exten'],'_')){_0x2e1fb8[_0x879a('0x52')][_0x879a('0x54')]='_'['concat'](_0x2e1fb8['body'][_0x879a('0x54')]);}return db['VoiceExtension'][_0x879a('0x51')](_0x2e1fb8[_0x879a('0x52')],{'raw':![]})[_0x879a('0x25')](function(_0x19ab9c){var _0x5ec2f0=_0x2e1fb8['user'][_0x879a('0x27')]({'plain':!![]});if(!_0x5ec2f0)throw new Error(_0x879a('0x55'));if(_0x5ec2f0['role']===_0x879a('0x56')){var _0x324f4e=_0x19ab9c[_0x879a('0x27')]({'plain':!![]});var _0x46ab86=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':_0x879a('0x2b')},{'name':_0x879a('0x2c'),'value':'internal'}];var _0x50552a=_[_0x879a('0x34')](_0x46ab86,[_0x879a('0x31'),_0x324f4e[_0x879a('0x33')]])[_0x879a('0x37')];return db['UserProfileSection'][_0x879a('0x34')]({'where':{'name':_0x50552a,'userProfileId':_0x5ec2f0[_0x879a('0x57')]},'raw':!![]})['then'](function(_0x5469b7){if(_0x5469b7&&_0x5469b7[_0x879a('0x58')]===0x0){return db[_0x879a('0x35')]['create']({'name':_0x324f4e[_0x879a('0x37')],'resourceId':_0x324f4e['id'],'type':_0x5469b7[_0x879a('0x37')],'sectionId':_0x5469b7['id']},{})['then'](function(){return _0x19ab9c;});}else{return _0x19ab9c;}})[_0x879a('0x4e')](function(_0x278dd1){logger[_0x879a('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x278dd1);throw _0x278dd1;});}return _0x19ab9c;})[_0x879a('0x25')](respondWithResult(_0x401036,0xc9))[_0x879a('0x4e')](handleError(_0x401036,null));};exports[_0x879a('0x24')]=function(_0x182ea5,_0xeaac31){if(_0x182ea5[_0x879a('0x52')]['id']){delete _0x182ea5[_0x879a('0x52')]['id'];}return db[_0x879a('0x4a')]['find']({'where':{'id':_0x182ea5[_0x879a('0x4f')]['id']}})[_0x879a('0x25')](handleEntityNotFound(_0xeaac31,null))[_0x879a('0x25')](function(_0x53c383){if(_0x53c383){return db['VoiceExtension'][_0x879a('0x24')](_[_0x879a('0x46')](_0x182ea5[_0x879a('0x52')],['exten',_0x879a('0x5a'),_0x879a('0x5b'),_0x879a('0x5c'),'cutdigits','mandatoryDisposition']),{'where':{'context':_0x53c383[_0x879a('0x5a')],'exten':_0x53c383['exten']},'individualHooks':!![]})['then'](function(_0x46a2ac){return _0x46a2ac;});}return null;})[_0x879a('0x25')](respondWithStatusCode(_0xeaac31,null))[_0x879a('0x4e')](handleError(_0xeaac31,null));};exports[_0x879a('0x5d')]=function(_0x53d172,_0x143a1f,_0x235ab5){return db[_0x879a('0x4a')]['findOne']({'where':{'id':_0x53d172[_0x879a('0x4f')]['id']}})[_0x879a('0x25')](handleEntityNotFound(_0x143a1f,null))['then'](function(_0x54e484){if(_0x54e484){return db[_0x879a('0x5e')][_0x879a('0x5f')](function(_0x2bc21c){return db[_0x879a('0x4a')]['destroy']({'where':{'VoiceExtensionId':_0x53d172[_0x879a('0x4f')]['id']},'transaction':_0x2bc21c})[_0x879a('0x25')](function(_0x529675){var _0x24b326=_[_0x879a('0x30')](_0x53d172[_0x879a('0x52')],function(_0x47806a){_0x47806a[_0x879a('0x60')]=_0x53d172[_0x879a('0x4f')]['id'];return _0x47806a;});return db[_0x879a('0x4a')]['bulkCreate'](_0x24b326,{'transaction':_0x2bc21c});});})[_0x879a('0x25')](function(){return db['VoiceExtension'][_0x879a('0x61')]({'where':{'isApp':!![],'VoiceExtensionId':_0x53d172[_0x879a('0x4f')]['id']},'order':_0x879a('0x62')});});}})[_0x879a('0x25')](respondWithResult(_0x143a1f,null))[_0x879a('0x4e')](handleError(_0x143a1f,null));};
\ No newline at end of file
+var _0xaced=['redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','undefined','count','offset','limit','apply','then','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','merge','VIRTUAL','options','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','create','body','startsWith','exten','concat','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x3e3d3c,_0x18a556){var _0x580889=function(_0xa53e17){while(--_0xa53e17){_0x3e3d3c['push'](_0x3e3d3c['shift']());}};_0x580889(++_0x18a556);}(_0xaced,0x18c));var _0xdace=function(_0x20c99b,_0x48ab6e){_0x20c99b=_0x20c99b-0x0;var _0x50a46d=_0xaced[_0x20c99b];return _0x50a46d;};'use strict';var emlformat=require(_0xdace('0x0'));var rimraf=require(_0xdace('0x1'));var zipdir=require(_0xdace('0x2'));var jsonpatch=require(_0xdace('0x3'));var rp=require(_0xdace('0x4'));var moment=require('moment');var BPromise=require(_0xdace('0x5'));var Mustache=require(_0xdace('0x6'));var util=require(_0xdace('0x7'));var path=require(_0xdace('0x8'));var sox=require('sox');var csv=require(_0xdace('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdace('0xa'));var squel=require(_0xdace('0xb'));var crypto=require(_0xdace('0xc'));var jsforce=require(_0xdace('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdace('0xe'));var Papa=require(_0xdace('0xf'));var Redis=require(_0xdace('0x10'));var authService=require(_0xdace('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdace('0x12'));var hardwareService=require(_0xdace('0x13'));var logger=require(_0xdace('0x14'))(_0xdace('0x15'));var utils=require('../../config/utils');var config=require(_0xdace('0x16'));var licenseUtil=require(_0xdace('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdace('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdace('0x19'))(new Redis(config[_0xdace('0x18')]));require(_0xdace('0x1a'))[_0xdace('0x1b')](socket);function respondWithStatusCode(_0x2b09c2,_0x30d290){_0x30d290=_0x30d290||0xcc;return function(_0x4d0622){if(_0x4d0622){return _0x2b09c2[_0xdace('0x1c')](_0x30d290);}return _0x2b09c2['status'](_0x30d290)[_0xdace('0x1d')]();};}function respondWithResult(_0x2d9a02,_0xebb470){_0xebb470=_0xebb470||0xc8;return function(_0x30ea26){if(_0x30ea26){return _0x2d9a02[_0xdace('0x1e')](_0xebb470)[_0xdace('0x1f')](_0x30ea26);}};}function respondWithFilteredResult(_0xa3594e,_0xf7ca18){return function(_0x4d00c1){if(_0x4d00c1){var _0x4fb9e3=typeof _0xf7ca18['offset']===_0xdace('0x20')&&typeof _0xf7ca18['limit']===_0xdace('0x20');var _0x17b6ab=_0x4d00c1[_0xdace('0x21')];var _0xa7e4d3=_0x4fb9e3?0x0:_0xf7ca18[_0xdace('0x22')];var _0x56dbc9=_0x4fb9e3?_0x4d00c1['count']:_0xf7ca18[_0xdace('0x22')]+_0xf7ca18[_0xdace('0x23')];var _0x54f13e;if(_0x56dbc9>=_0x17b6ab){_0x56dbc9=_0x17b6ab;_0x54f13e=0xc8;}else{_0x54f13e=0xce;}_0xa3594e[_0xdace('0x1e')](_0x54f13e);return _0xa3594e['set']('Content-Range',_0xa7e4d3+'-'+_0x56dbc9+'/'+_0x17b6ab)[_0xdace('0x1f')](_0x4d00c1);}return null;};}function patchUpdates(_0x423941){return function(_0x3209f0){try{jsonpatch[_0xdace('0x24')](_0x3209f0,_0x423941,!![]);}catch(_0x14a47e){return BPromise['reject'](_0x14a47e);}return _0x3209f0['save']();};}function saveUpdates(_0x314256,_0x4a2974){return function(_0x12dc7f){if(_0x12dc7f){return _0x12dc7f['update'](_0x314256)[_0xdace('0x25')](function(_0x1a7e2b){return _0x1a7e2b;});}return null;};}function removeEntity(_0x3dc23a,_0x5737d3){return function(_0x46dee){if(_0x46dee){return _0x46dee[_0xdace('0x26')]()[_0xdace('0x25')](function(){var _0x2747e4=_0x46dee[_0xdace('0x27')]({'plain':!![]});var _0x439579=[{'name':_0xdace('0x28'),'value':'inbound','ignore':![]},{'name':_0xdace('0x29'),'value':_0xdace('0x2a'),'ignore':![]},{'name':_0xdace('0x2b'),'value':_0xdace('0x2c'),'ignore':![]}];var _0x3269ad=_(_0x439579)[_0xdace('0x2d')](_0xdace('0x2e'))[_0xdace('0x2f')]('value')[_0xdace('0x30')]();if(_[_0xdace('0x31')](_0x3269ad,_0x2747e4['type'])){return;}var _0x5ab405=_[_0xdace('0x32')](_0x439579,[_0xdace('0x30'),_0x2747e4['type']])['name'];return db[_0xdace('0x33')][_0xdace('0x26')]({'where':{'type':_0x5ab405,'resourceId':_0x2747e4['id']}})['then'](function(){return _0x46dee;});})[_0xdace('0x25')](function(){_0x3dc23a[_0xdace('0x1e')](0xcc)[_0xdace('0x1d')]();});}};}function handleEntityNotFound(_0xc4b414,_0x3ac83c){return function(_0x41be24){if(!_0x41be24){_0xc4b414[_0xdace('0x1c')](0x194);}return _0x41be24;};}function handleError(_0x59eef7,_0x4cf63c){_0x4cf63c=_0x4cf63c||0x1f4;return function(_0x1ede5e){logger[_0xdace('0x34')](_0x1ede5e[_0xdace('0x35')]);if(_0x1ede5e['name']){delete _0x1ede5e[_0xdace('0x36')];}_0x59eef7['status'](_0x4cf63c)[_0xdace('0x37')](_0x1ede5e);};}exports[_0xdace('0x38')]=function(_0x36670b,_0x264296){var _0x760c9d={},_0x4ef630={},_0x34522d={'count':0x0,'rows':[]};var _0x20d14c=_[_0xdace('0x2f')](db['VoiceExtension'][_0xdace('0x39')],function(_0x5d6543){return{'name':_0x5d6543[_0xdace('0x3a')],'type':_0x5d6543[_0xdace('0x3b')]['key']};});_0x4ef630[_0xdace('0x3c')]=_[_0xdace('0x2f')](_0x20d14c,_0xdace('0x36'));_0x4ef630[_0xdace('0x3d')]=_[_0xdace('0x3e')](_0x36670b[_0xdace('0x3d')]);_0x4ef630[_0xdace('0x3f')]=_[_0xdace('0x40')](_0x4ef630[_0xdace('0x3c')],_0x4ef630[_0xdace('0x3d')]);_0x760c9d[_0xdace('0x41')]=_[_0xdace('0x40')](_0x4ef630[_0xdace('0x3c')],qs[_0xdace('0x42')](_0x36670b[_0xdace('0x3d')][_0xdace('0x42')]));_0x760c9d[_0xdace('0x41')]=_0x760c9d[_0xdace('0x41')][_0xdace('0x43')]?_0x760c9d['attributes']:_0x4ef630[_0xdace('0x3c')];if(!_0x36670b[_0xdace('0x3d')]['hasOwnProperty'](_0xdace('0x44'))){_0x760c9d['limit']=qs[_0xdace('0x23')](_0x36670b['query'][_0xdace('0x23')]);_0x760c9d[_0xdace('0x22')]=qs[_0xdace('0x22')](_0x36670b[_0xdace('0x3d')]['offset']);}_0x760c9d[_0xdace('0x45')]=qs['sort'](_0x36670b[_0xdace('0x3d')]['sort']);_0x760c9d[_0xdace('0x46')]=qs[_0xdace('0x3f')](_['pick'](_0x36670b[_0xdace('0x3d')],_0x4ef630['filters']),_0x20d14c);if(_0x36670b[_0xdace('0x3d')][_0xdace('0x2d')]){_0x760c9d[_0xdace('0x46')]=_[_0xdace('0x47')](_0x760c9d['where'],{'$or':_[_0xdace('0x2f')](_0x20d14c,function(_0x5d0055){if(_0x5d0055[_0xdace('0x3b')]!==_0xdace('0x48')){var _0xd3db40={};_0xd3db40[_0x5d0055[_0xdace('0x36')]]={'$like':'%'+_0x36670b[_0xdace('0x3d')][_0xdace('0x2d')]+'%'};return _0xd3db40;}})});}_0x760c9d=_[_0xdace('0x47')]({},_0x760c9d,_0x36670b[_0xdace('0x49')]);var _0x448723={'where':_0x760c9d['where']};return db[_0xdace('0x4a')]['count'](_0x448723)[_0xdace('0x25')](function(_0x493394){_0x34522d['count']=_0x493394;if(_0x36670b[_0xdace('0x3d')][_0xdace('0x4b')]){_0x760c9d[_0xdace('0x4c')]=[{'all':!![]}];}return db[_0xdace('0x4a')][_0xdace('0x4d')](_0x760c9d);})[_0xdace('0x25')](function(_0x11a1fe){_0x34522d[_0xdace('0x4e')]=_0x11a1fe;return _0x34522d;})[_0xdace('0x25')](respondWithFilteredResult(_0x264296,_0x760c9d))[_0xdace('0x4f')](handleError(_0x264296,null));};exports[_0xdace('0x50')]=function(_0x845dd1,_0x2a358c){var _0x490566={'raw':![],'where':{'id':_0x845dd1[_0xdace('0x51')]['id']}},_0x36966e={};_0x36966e[_0xdace('0x3c')]=_[_0xdace('0x3e')](db[_0xdace('0x4a')][_0xdace('0x39')]);_0x36966e[_0xdace('0x3d')]=_[_0xdace('0x3e')](_0x845dd1[_0xdace('0x3d')]);_0x36966e[_0xdace('0x3f')]=_[_0xdace('0x40')](_0x36966e[_0xdace('0x3c')],_0x36966e['query']);_0x490566[_0xdace('0x41')]=_['intersection'](_0x36966e[_0xdace('0x3c')],qs[_0xdace('0x42')](_0x845dd1['query']['fields']));_0x490566[_0xdace('0x41')]=_0x490566[_0xdace('0x41')][_0xdace('0x43')]?_0x490566[_0xdace('0x41')]:_0x36966e[_0xdace('0x3c')];if(_0x845dd1[_0xdace('0x3d')][_0xdace('0x4b')]){_0x490566[_0xdace('0x4c')]=[{'all':!![]}];}_0x490566=_['merge']({},_0x490566,_0x845dd1[_0xdace('0x49')]);return db[_0xdace('0x4a')][_0xdace('0x32')](_0x490566)[_0xdace('0x25')](handleEntityNotFound(_0x2a358c,null))[_0xdace('0x25')](respondWithResult(_0x2a358c,null))['catch'](handleError(_0x2a358c,null));};exports['destroy']=function(_0x2567f2,_0x4c4ec8){return db[_0xdace('0x4a')]['find']({'where':{'id':_0x2567f2[_0xdace('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c4ec8,null))[_0xdace('0x25')](removeEntity(_0x4c4ec8,null))[_0xdace('0x4f')](handleError(_0x4c4ec8,null));};exports[_0xdace('0x52')]=function(_0x19e4a9,_0x1a08c3){if(_0x19e4a9[_0xdace('0x53')][_0xdace('0x3b')]===_0xdace('0x2a')&&!_[_0xdace('0x54')](_0x19e4a9[_0xdace('0x53')][_0xdace('0x55')],'_')){_0x19e4a9[_0xdace('0x53')][_0xdace('0x55')]='_'[_0xdace('0x56')](_0x19e4a9[_0xdace('0x53')][_0xdace('0x55')]);}return db['VoiceExtension']['create'](_0x19e4a9['body'],{'raw':![]})[_0xdace('0x25')](function(_0x1bc65d){var _0x4aca0e=_0x19e4a9[_0xdace('0x57')]['get']({'plain':!![]});if(!_0x4aca0e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aca0e[_0xdace('0x58')]===_0xdace('0x57')){var _0x93a7b4=_0x1bc65d['get']({'plain':!![]});var _0x1aa047=[{'name':_0xdace('0x28'),'value':'inbound'},{'name':_0xdace('0x29'),'value':_0xdace('0x2a')},{'name':_0xdace('0x2b'),'value':'internal'}];var _0x51c380=_[_0xdace('0x32')](_0x1aa047,[_0xdace('0x30'),_0x93a7b4[_0xdace('0x3b')]])[_0xdace('0x36')];return db[_0xdace('0x59')]['find']({'where':{'name':_0x51c380,'userProfileId':_0x4aca0e[_0xdace('0x5a')]},'raw':!![]})['then'](function(_0x489274){if(_0x489274&&_0x489274[_0xdace('0x5b')]===0x0){return db['UserProfileResource'][_0xdace('0x52')]({'name':_0x93a7b4[_0xdace('0x36')],'resourceId':_0x93a7b4['id'],'type':_0x489274['name'],'sectionId':_0x489274['id']},{})[_0xdace('0x25')](function(){return _0x1bc65d;});}else{return _0x1bc65d;}})[_0xdace('0x4f')](function(_0x4921ed){logger[_0xdace('0x34')](_0xdace('0x5c'),_0x4921ed);throw _0x4921ed;});}return _0x1bc65d;})[_0xdace('0x25')](respondWithResult(_0x1a08c3,0xc9))[_0xdace('0x4f')](handleError(_0x1a08c3,null));};exports[_0xdace('0x5d')]=function(_0x220012,_0x2af931){if(_0x220012['body']['id']){delete _0x220012[_0xdace('0x53')]['id'];}return db[_0xdace('0x4a')][_0xdace('0x32')]({'where':{'id':_0x220012[_0xdace('0x51')]['id']}})['then'](handleEntityNotFound(_0x2af931,null))['then'](function(_0x19890f){if(_0x19890f){return db[_0xdace('0x4a')][_0xdace('0x5d')](_[_0xdace('0x5e')](_0x220012[_0xdace('0x53')],[_0xdace('0x55'),_0xdace('0x5f'),_0xdace('0x60'),_0xdace('0x61'),_0xdace('0x62'),_0xdace('0x63')]),{'where':{'context':_0x19890f[_0xdace('0x5f')],'exten':_0x19890f[_0xdace('0x55')]},'individualHooks':!![]})[_0xdace('0x25')](function(_0xdb672d){return _0xdb672d;});}return null;})[_0xdace('0x25')](respondWithStatusCode(_0x2af931,null))[_0xdace('0x4f')](handleError(_0x2af931,null));};exports['addApplications']=function(_0x371986,_0x5db6e5,_0x168d64){return db[_0xdace('0x4a')][_0xdace('0x64')]({'where':{'id':_0x371986[_0xdace('0x51')]['id']}})['then'](handleEntityNotFound(_0x5db6e5,null))[_0xdace('0x25')](function(_0x769533){if(_0x769533){return db['sequelize']['transaction'](function(_0x4f4da1){return db[_0xdace('0x4a')][_0xdace('0x26')]({'where':{'VoiceExtensionId':_0x371986[_0xdace('0x51')]['id']},'transaction':_0x4f4da1})[_0xdace('0x25')](function(_0x153544){var _0x40b200=_[_0xdace('0x2f')](_0x371986['body'],function(_0x23753a){_0x23753a[_0xdace('0x65')]=_0x371986[_0xdace('0x51')]['id'];return _0x23753a;});return db[_0xdace('0x4a')][_0xdace('0x66')](_0x40b200,{'transaction':_0x4f4da1});});})[_0xdace('0x25')](function(){return db[_0xdace('0x4a')][_0xdace('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x371986[_0xdace('0x51')]['id']},'order':_0xdace('0x68')});});}})[_0xdace('0x25')](respondWithResult(_0x5db6e5,null))[_0xdace('0x4f')](handleError(_0x5db6e5,null));};
\ No newline at end of file
index 7325886..4810386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17bf=['exports','events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x409251,_0x40f525){var _0x216f47=function(_0x517895){while(--_0x517895){_0x409251['push'](_0x409251['shift']());}};_0x216f47(++_0x40f525);}(_0x17bf,0x14b));var _0xf17b=function(_0x1d03ec,_0x27fb7f){_0x1d03ec=_0x1d03ec-0x0;var _0x56bcb9=_0x17bf[_0x1d03ec];return _0x56bcb9;};'use strict';var EventEmitter=require(_0xf17b('0x0'));var VoiceExtension=require(_0xf17b('0x1'))['db'][_0xf17b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf17b('0x3'),'afterUpdate':_0xf17b('0x4'),'afterDestroy':_0xf17b('0x5')};function emitEvent(_0x4c72c1){return function(_0x453623,_0x7f7208,_0x2539b4){VoiceExtensionEvents[_0xf17b('0x6')](_0x4c72c1+':'+_0x453623['id'],_0x453623);VoiceExtensionEvents[_0xf17b('0x6')](_0x4c72c1,_0x453623);_0x2539b4(null);};}for(var e in events){if(events[_0xf17b('0x7')](e)){var event=events[e];VoiceExtension[_0xf17b('0x8')](e,emitEvent(event));}}module[_0xf17b('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xc353=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','save'];(function(_0x2342f5,_0x12f646){var _0x27dbcb=function(_0x3e1fb2){while(--_0x3e1fb2){_0x2342f5['push'](_0x2342f5['shift']());}};_0x27dbcb(++_0x12f646);}(_0xc353,0xec));var _0x3c35=function(_0x5c37d2,_0x301a1e){_0x5c37d2=_0x5c37d2-0x0;var _0xfa4211=_0xc353[_0x5c37d2];return _0xfa4211;};'use strict';var EventEmitter=require(_0x3c35('0x0'));var VoiceExtension=require(_0x3c35('0x1'))['db'][_0x3c35('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c35('0x3'),'afterUpdate':'update','afterDestroy':_0x3c35('0x4')};function emitEvent(_0x2c158e){return function(_0x29ac62,_0x4b3812,_0x33653f){VoiceExtensionEvents['emit'](_0x2c158e+':'+_0x29ac62['id'],_0x29ac62);VoiceExtensionEvents[_0x3c35('0x5')](_0x2c158e,_0x29ac62);_0x33653f(null);};}for(var e in events){if(events[_0x3c35('0x6')](e)){var event=events[e];VoiceExtension[_0x3c35('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index c214161..a6d15fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaa6=['./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcaa6,0xf5));var _0x6caa=function(_0x4a066b,_0x540987){_0x4a066b=_0x4a066b-0x0;var _0x39d94e=_0xcaa6[_0x4a066b];return _0x39d94e;};'use strict';var _=require(_0x6caa('0x0'));var util=require('util');var logger=require(_0x6caa('0x1'))(_0x6caa('0x2'));var moment=require(_0x6caa('0x3'));var BPromise=require('bluebird');var rp=require(_0x6caa('0x4'));var fs=require('fs');var path=require(_0x6caa('0x5'));var rimraf=require('rimraf');var config=require(_0x6caa('0x6'));var attributes=require(_0x6caa('0x7'));module[_0x6caa('0x8')]=function(_0x3e5250,_0x4f0e2f){return _0x3e5250[_0x6caa('0x9')](_0x6caa('0xa'),attributes,{'tableName':_0x6caa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x772c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','lodash'];(function(_0x58b119,_0x527956){var _0x1c4e9b=function(_0x4acef5){while(--_0x4acef5){_0x58b119['push'](_0x58b119['shift']());}};_0x1c4e9b(++_0x527956);}(_0x772c,0xcf));var _0xc772=function(_0x5b3bf0,_0xe5e437){_0x5b3bf0=_0x5b3bf0-0x0;var _0x512cf1=_0x772c[_0x5b3bf0];return _0x512cf1;};'use strict';var _=require(_0xc772('0x0'));var util=require(_0xc772('0x1'));var logger=require(_0xc772('0x2'))(_0xc772('0x3'));var moment=require(_0xc772('0x4'));var BPromise=require(_0xc772('0x5'));var rp=require(_0xc772('0x6'));var fs=require('fs');var path=require(_0xc772('0x7'));var rimraf=require('rimraf');var config=require(_0xc772('0x8'));var attributes=require(_0xc772('0x9'));module[_0xc772('0xa')]=function(_0x3f7be9,_0x2fe25b){return _0x3f7be9[_0xc772('0xb')](_0xc772('0xc'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e8a8dd8..c8bb84e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7163=['model','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x417a23,_0x2a228d){var _0x3aeb3f=function(_0x38d60a){while(--_0x38d60a){_0x417a23['push'](_0x417a23['shift']());}};_0x3aeb3f(++_0x2a228d);}(_0x7163,0x1ef));var _0x3716=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x7163[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x3716('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3716('0x1'));var rs=require(_0x3716('0x2'));var fs=require('fs');var Redis=require(_0x3716('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3716('0x4'));var logger=require(_0x3716('0x5'))(_0x3716('0x6'));var config=require(_0x3716('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3716('0x8')]({'port':0x232a});config[_0x3716('0x9')]=_[_0x3716('0xa')](config[_0x3716('0x9')],{'host':_0x3716('0xb'),'port':0x18eb});var socket=require(_0x3716('0xc'))(new Redis(config[_0x3716('0x9')]));require(_0x3716('0xd'))[_0x3716('0xe')](socket);function respondWithRpcPromise(_0xf12099,_0xe9c8f3,_0x3d20f4){return new BPromise(function(_0x1a3302,_0x217039){return client[_0x3716('0xf')](_0xf12099,_0x3d20f4)[_0x3716('0x10')](function(_0x26a78d){logger[_0x3716('0x11')](_0x3716('0x12'),_0xe9c8f3,_0x3716('0x13'));logger[_0x3716('0x14')](_0x3716('0x15'),_0xe9c8f3,_0x3716('0x13'),JSON[_0x3716('0x16')](_0x26a78d));if(_0x26a78d[_0x3716('0x17')]){if(_0x26a78d[_0x3716('0x17')][_0x3716('0x18')]===0x1f4){logger[_0x3716('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xe9c8f3,_0x26a78d['error']['message']);return _0x217039(_0x26a78d['error'][_0x3716('0x19')]);}logger['error'](_0x3716('0x12'),_0xe9c8f3,_0x26a78d[_0x3716('0x17')][_0x3716('0x19')]);return _0x1a3302(_0x26a78d['error']['message']);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0xe9c8f3,_0x3716('0x13'));_0x1a3302(_0x26a78d[_0x3716('0x1a')]['message']);}})[_0x3716('0x1b')](function(_0x331b57){logger[_0x3716('0x17')](_0x3716('0x12'),_0xe9c8f3,_0x331b57);_0x217039(_0x331b57);});});}exports[_0x3716('0x1c')]=function(_0x1ac0eb){var _0x950473=this;return new Promise(function(_0x564d5c,_0x4cd0a6){return db['VoiceExtension'][_0x3716('0x1d')]({'raw':_0x1ac0eb['options']?_0x1ac0eb[_0x3716('0x1e')][_0x3716('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ac0eb[_0x3716('0x1e')]?_0x1ac0eb[_0x3716('0x1e')][_0x3716('0x20')]||null:null,'attributes':_0x1ac0eb[_0x3716('0x1e')]?_0x1ac0eb[_0x3716('0x1e')][_0x3716('0x21')]||null:null,'limit':_0x1ac0eb[_0x3716('0x1e')]?_0x1ac0eb['options'][_0x3716('0x22')]||null:null,'include':_0x1ac0eb[_0x3716('0x1e')]?_0x1ac0eb[_0x3716('0x1e')]['include']?_[_0x3716('0x23')](_0x1ac0eb[_0x3716('0x1e')]['include'],function(_0x3fd2bf){return{'model':db[_0x3fd2bf['model']],'as':_0x3fd2bf['as'],'attributes':_0x3fd2bf[_0x3716('0x21')],'include':_0x3fd2bf[_0x3716('0x24')]?_[_0x3716('0x23')](_0x3fd2bf['include'],function(_0x150324){return{'model':db[_0x150324['model']],'as':_0x150324['as'],'attributes':_0x150324[_0x3716('0x21')],'include':_0x150324[_0x3716('0x24')]?_['map'](_0x150324[_0x3716('0x24')],function(_0x3dcf6b){return{'model':db[_0x3dcf6b[_0x3716('0x25')]],'as':_0x3dcf6b['as'],'attributes':_0x3dcf6b[_0x3716('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3716('0x10')](function(_0x4f76dc){logger[_0x3716('0x11')](_0x3716('0x1c'),_0x1ac0eb);logger[_0x3716('0x14')](_0x3716('0x1c'),_0x1ac0eb,JSON['stringify'](_0x4f76dc));_0x564d5c(_0x4f76dc);})[_0x3716('0x1b')](function(_0x27553a){logger[_0x3716('0x17')](_0x3716('0x1c'),_0x27553a[_0x3716('0x19')],_0x1ac0eb);_0x4cd0a6(_0x950473['error'](0x1f4,_0x27553a[_0x3716('0x19')]));});});};
\ No newline at end of file
+var _0x5f6f=['stringify','error','message','result','catch','VoiceExtension','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3b9bf5,_0x28c84a){var _0x9da1e=function(_0x33f79a){while(--_0x33f79a){_0x3b9bf5['push'](_0x3b9bf5['shift']());}};_0x9da1e(++_0x28c84a);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x2023e1,_0xeca985){_0x2023e1=_0x2023e1-0x0;var _0x1fe133=_0x5f6f[_0x2023e1];return _0x1fe133;};'use strict';var _=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var moment=require(_0xf5f6('0x2'));var BPromise=require(_0xf5f6('0x3'));var rs=require(_0xf5f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f6('0x5'))['db'];var utils=require(_0xf5f6('0x6'));var logger=require(_0xf5f6('0x7'))('rpc');var config=require(_0xf5f6('0x8'));var jayson=require(_0xf5f6('0x9'));var client=jayson[_0xf5f6('0xa')][_0xf5f6('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf5f6('0xc')],{'host':_0xf5f6('0xd'),'port':0x18eb});var socket=require(_0xf5f6('0xe'))(new Redis(config[_0xf5f6('0xc')]));require(_0xf5f6('0xf'))[_0xf5f6('0x10')](socket);function respondWithRpcPromise(_0x57fc19,_0x5ba0f5,_0x988c4a){return new BPromise(function(_0x369b18,_0x491c14){return client[_0xf5f6('0x11')](_0x57fc19,_0x988c4a)[_0xf5f6('0x12')](function(_0xeb94fb){logger[_0xf5f6('0x13')](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');logger[_0xf5f6('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x5ba0f5,_0xf5f6('0x16'),JSON[_0xf5f6('0x17')](_0xeb94fb));if(_0xeb94fb[_0xf5f6('0x18')]){if(_0xeb94fb[_0xf5f6('0x18')]['code']===0x1f4){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')][_0xf5f6('0x19')]);return _0x491c14(_0xeb94fb['error'][_0xf5f6('0x19')]);}logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0xeb94fb[_0xf5f6('0x18')]['message']);return _0x369b18(_0xeb94fb['error'][_0xf5f6('0x19')]);}else{logger['info'](_0xf5f6('0x14'),_0x5ba0f5,'request\x20sent');_0x369b18(_0xeb94fb[_0xf5f6('0x1a')][_0xf5f6('0x19')]);}})[_0xf5f6('0x1b')](function(_0x301e2a){logger[_0xf5f6('0x18')](_0xf5f6('0x14'),_0x5ba0f5,_0x301e2a);_0x491c14(_0x301e2a);});});}exports['GetVoiceExtension']=function(_0x594162){var _0x3ada74=this;return new Promise(function(_0x332761,_0x261015){return db[_0xf5f6('0x1c')]['findAll']({'raw':_0x594162[_0xf5f6('0x1d')]?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x1e')]===undefined?!![]:![]:!![],'where':_0x594162['options']?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x1f')]||null:null,'attributes':_0x594162[_0xf5f6('0x1d')]?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x20')]||null:null,'limit':_0x594162['options']?_0x594162[_0xf5f6('0x1d')][_0xf5f6('0x21')]||null:null,'include':_0x594162[_0xf5f6('0x1d')]?_0x594162['options'][_0xf5f6('0x22')]?_[_0xf5f6('0x23')](_0x594162[_0xf5f6('0x1d')]['include'],function(_0x537a81){return{'model':db[_0x537a81[_0xf5f6('0x24')]],'as':_0x537a81['as'],'attributes':_0x537a81[_0xf5f6('0x20')],'include':_0x537a81[_0xf5f6('0x22')]?_[_0xf5f6('0x23')](_0x537a81['include'],function(_0xb2fab7){return{'model':db[_0xb2fab7[_0xf5f6('0x24')]],'as':_0xb2fab7['as'],'attributes':_0xb2fab7['attributes'],'include':_0xb2fab7[_0xf5f6('0x22')]?_['map'](_0xb2fab7[_0xf5f6('0x22')],function(_0x8867ac){return{'model':db[_0x8867ac['model']],'as':_0x8867ac['as'],'attributes':_0x8867ac[_0xf5f6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f6('0x12')](function(_0x19d7f0){logger[_0xf5f6('0x13')]('GetVoiceExtension',_0x594162);logger[_0xf5f6('0x15')]('GetVoiceExtension',_0x594162,JSON[_0xf5f6('0x17')](_0x19d7f0));_0x332761(_0x19d7f0);})[_0xf5f6('0x1b')](function(_0x202565){logger[_0xf5f6('0x18')]('GetVoiceExtension',_0x202565[_0xf5f6('0x19')],_0x594162);_0x261015(_0x3ada74['error'](0x1f4,_0x202565[_0xf5f6('0x19')]));});});};
\ No newline at end of file
index 8ec181d..9299a8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x4a0db0,_0x1ad004){var _0x1398e1=function(_0x196e9e){while(--_0x196e9e){_0x4a0db0['push'](_0x4a0db0['shift']());}};_0x1398e1(++_0x1ad004);}(_0x5fc3,0xa8));var _0x35fc=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x5fc3[_0x59dccc];return _0xc97bcb;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}};
\ No newline at end of file
+var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2d34f7,_0xca8267){var _0x4269c7=function(_0x55a019){while(--_0x55a019){_0x2d34f7['push'](_0x2d34f7['shift']());}};_0x4269c7(++_0xca8267);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'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 b4015ac..82bcbb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1893=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update'];(function(_0x180e1a,_0x4140ab){var _0x1bdfb1=function(_0x1fad85){while(--_0x1fad85){_0x180e1a['push'](_0x180e1a['shift']());}};_0x1bdfb1(++_0x4140ab);}(_0x1893,0xa2));var _0x3189=function(_0xeab168,_0x30d561){_0xeab168=_0xeab168-0x0;var _0xbbf818=_0x1893[_0xeab168];return _0xbbf818;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['get'](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0xe')]);router['post']('/',auth[_0x3189('0x9')](),controller[_0x3189('0xf')]);router[_0x3189('0x10')](_0x3189('0xb'),auth['isAuthenticated'](),controller[_0x3189('0x11')]);router[_0x3189('0x12')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xf61e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','show','getMessages','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c4a11,_0x9bf23b){var _0x18d605=function(_0x307176){while(--_0x307176){_0x4c4a11['push'](_0x4c4a11['shift']());}};_0x18d605(++_0x9bf23b);}(_0xf61e,0x191));var _0xef61=function(_0xf8dcde,_0x3d9e32){_0xf8dcde=_0xf8dcde-0x0;var _0x4508c5=_0xf61e[_0xf8dcde];return _0x4508c5;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/:id',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0x10')]('/',auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0x12')](_0xef61('0x13'),auth[_0xef61('0xd')](),controller[_0xef61('0x14')]);router[_0xef61('0x15')](_0xef61('0x13'),auth[_0xef61('0xd')](),controller[_0xef61('0x16')]);module[_0xef61('0x17')]=router;
\ No newline at end of file
index 27cb382..5525550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc155=['\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname'];(function(_0x102826,_0x35f7b9){var _0x57556e=function(_0x469edd){while(--_0x469edd){_0x102826['push'](_0x102826['shift']());}};_0x57556e(++_0x35f7b9);}(_0xc155,0x1b2));var _0x5c15=function(_0x3ff15e,_0xc96290){_0x3ff15e=_0x3ff15e-0x0;var _0x667cd6=_0xc155[_0x3ff15e];return _0x667cd6;};'use strict';var Sequelize=require(_0x5c15('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5c15('0x1')],'defaultValue':_0x5c15('0x2'),'unique':_0x5c15('0x3')},'mailbox':{'type':Sequelize[_0x5c15('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5c15('0x3')},'password':{'type':Sequelize[_0x5c15('0x1')]},'fullname':{'type':Sequelize[_0x5c15('0x1')]},'email':{'type':Sequelize[_0x5c15('0x1')],'validate':{'isEmail':!![]},'set':function(_0x199329){this[_0x5c15('0x4')](_0x5c15('0x5'),typeof _0x199329===_0x5c15('0x6')&&_0x199329['trim']()?_0x199329[_0x5c15('0x7')]():null);}},'pager':{'type':Sequelize[_0x5c15('0x1')]},'tz':{'type':Sequelize[_0x5c15('0x1')],'defaultValue':_0x5c15('0x8')},'attach':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':_0x5c15('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5c15('0x9')](_0x5c15('0xa'),'no'),'defaultValue':_0x5c15('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5c15('0x1')]},'callback':{'type':Sequelize[_0x5c15('0x1')]},'review':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':_0x5c15('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5c15('0x9')](_0x5c15('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5c15('0x9')](_0x5c15('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5c15('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x5c15('0xb')},'emailsubject':{'type':Sequelize[_0x5c15('0x1')]},'emailbody':{'type':Sequelize[_0x5c15('0x1')]},'maxsecs':{'type':Sequelize[_0x5c15('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5c15('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5c15('0xd')],'get':function(){return this[_0x5c15('0xe')](_0x5c15('0xf'))+_0x5c15('0x10')+this[_0x5c15('0xe')](_0x5c15('0x11'));}}};
\ No newline at end of file
+var _0xd660=['trim','central','ENUM','yes','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xd660,0xdb));var _0x0d66=function(_0x22a866,_0xfe7c94){_0x22a866=_0x22a866-0x0;var _0xd1545a=_0xd660[_0x22a866];return _0xd1545a;};'use strict';var Sequelize=require(_0x0d66('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x0d66('0x1')]},'context':{'type':Sequelize[_0x0d66('0x1')],'defaultValue':'from-voicemail','unique':_0x0d66('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x0d66('0x2')},'password':{'type':Sequelize[_0x0d66('0x1')]},'fullname':{'type':Sequelize[_0x0d66('0x1')]},'email':{'type':Sequelize[_0x0d66('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2e452b){this[_0x0d66('0x3')](_0x0d66('0x4'),typeof _0x2e452b==='string'&&_0x2e452b[_0x0d66('0x5')]()?_0x2e452b[_0x0d66('0x5')]():null);}},'pager':{'type':Sequelize[_0x0d66('0x1')]},'tz':{'type':Sequelize[_0x0d66('0x1')],'defaultValue':_0x0d66('0x6')},'attach':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0d66('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0d66('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0d66('0x7')]('yes','no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0d66('0x7')](_0x0d66('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x0d66('0x8'),'no'),'defaultValue':_0x0d66('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x0d66('0x1')]},'emailbody':{'type':Sequelize[_0x0d66('0x1')]},'maxsecs':{'type':Sequelize[_0x0d66('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0d66('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0d66('0xb')],'get':function(){return this['getDataValue']('fullname')+'\x20-\x20'+this[_0x0d66('0xc')](_0x0d66('0xd'));}}};
\ No newline at end of file
index b549082..bcaa358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc900=['body','params','findOne','VoiceMailMessage','findAndCountAll','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceMail','includeAll','include','findAll','catch','show','rawAttributes','keys','find','user','get','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xc900,0xb3));var _0x0c90=function(_0x23c9ba,_0x440b49){_0x23c9ba=_0x23c9ba-0x0;var _0x13df63=_0xc900[_0x23c9ba];return _0x13df63;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];function respondWithStatusCode(_0x50e7db,_0x459cdb){_0x459cdb=_0x459cdb||0xcc;return function(_0x26fc46){if(_0x26fc46){return _0x50e7db[_0x0c90('0x19')](_0x459cdb);}return _0x50e7db[_0x0c90('0x1a')](_0x459cdb)[_0x0c90('0x1b')]();};}function respondWithResult(_0x59ea8e,_0x467b32){_0x467b32=_0x467b32||0xc8;return function(_0x4451e0){if(_0x4451e0){return _0x59ea8e['status'](_0x467b32)[_0x0c90('0x1c')](_0x4451e0);}};}function respondWithFilteredResult(_0x3a492d,_0x3bd5e8){return function(_0x5bef7d){if(_0x5bef7d){var _0x5daeb7=typeof _0x3bd5e8[_0x0c90('0x1d')]===_0x0c90('0x1e')&&typeof _0x3bd5e8[_0x0c90('0x1f')]===_0x0c90('0x1e');var _0x276b92=_0x5bef7d[_0x0c90('0x20')];var _0x42321a=_0x5daeb7?0x0:_0x3bd5e8['offset'];var _0xc3bb47=_0x5daeb7?_0x5bef7d[_0x0c90('0x20')]:_0x3bd5e8[_0x0c90('0x1d')]+_0x3bd5e8[_0x0c90('0x1f')];var _0x594267;if(_0xc3bb47>=_0x276b92){_0xc3bb47=_0x276b92;_0x594267=0xc8;}else{_0x594267=0xce;}_0x3a492d[_0x0c90('0x1a')](_0x594267);return _0x3a492d[_0x0c90('0x21')](_0x0c90('0x22'),_0x42321a+'-'+_0xc3bb47+'/'+_0x276b92)[_0x0c90('0x1c')](_0x5bef7d);}return null;};}function patchUpdates(_0x315932){return function(_0xc08f54){try{jsonpatch['apply'](_0xc08f54,_0x315932,!![]);}catch(_0x365a42){return BPromise['reject'](_0x365a42);}return _0xc08f54[_0x0c90('0x23')]();};}function saveUpdates(_0x1a021e,_0x47b13c){return function(_0x2a053a){if(_0x2a053a){return _0x2a053a[_0x0c90('0x24')](_0x1a021e)[_0x0c90('0x25')](function(_0x86dee){return _0x86dee;});}return null;};}function removeEntity(_0x212164,_0x3b287c){return function(_0x4dfbc3){if(_0x4dfbc3){return _0x4dfbc3[_0x0c90('0x26')]()[_0x0c90('0x25')](function(){var _0x5695a2=_0x4dfbc3['get']({'plain':!![]});var _0x28d005=_0x0c90('0x27');return db[_0x0c90('0x28')][_0x0c90('0x26')]({'where':{'type':_0x28d005,'resourceId':_0x5695a2['id']}})['then'](function(){return _0x4dfbc3;});})[_0x0c90('0x25')](function(){_0x212164[_0x0c90('0x1a')](0xcc)[_0x0c90('0x1b')]();});}};}function handleEntityNotFound(_0x277d4a,_0x427c2b){return function(_0x114589){if(!_0x114589){_0x277d4a['sendStatus'](0x194);}return _0x114589;};}function handleError(_0x15de68,_0x22a47d){_0x22a47d=_0x22a47d||0x1f4;return function(_0x39f1b2){logger[_0x0c90('0x29')](_0x39f1b2['stack']);if(_0x39f1b2['name']){delete _0x39f1b2[_0x0c90('0x2a')];}_0x15de68[_0x0c90('0x1a')](_0x22a47d)[_0x0c90('0x2b')](_0x39f1b2);};}exports[_0x0c90('0x2c')]=function(_0x119e09,_0x562664){var _0x120136={},_0x50b156={},_0x478002={'count':0x0,'rows':[]};var _0x47a935=_[_0x0c90('0x2d')](db['VoiceMail']['rawAttributes'],function(_0x886634){return{'name':_0x886634[_0x0c90('0x2e')],'type':_0x886634[_0x0c90('0x2f')][_0x0c90('0x30')]};});_0x50b156['model']=_[_0x0c90('0x2d')](_0x47a935,'name');_0x50b156[_0x0c90('0x31')]=_['keys'](_0x119e09[_0x0c90('0x31')]);_0x50b156[_0x0c90('0x32')]=_['intersection'](_0x50b156[_0x0c90('0x33')],_0x50b156[_0x0c90('0x31')]);_0x120136[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x50b156[_0x0c90('0x33')],qs[_0x0c90('0x36')](_0x119e09[_0x0c90('0x31')][_0x0c90('0x36')]));_0x120136['attributes']=_0x120136[_0x0c90('0x34')][_0x0c90('0x37')]?_0x120136[_0x0c90('0x34')]:_0x50b156[_0x0c90('0x33')];if(!_0x119e09['query'][_0x0c90('0x38')](_0x0c90('0x39'))){_0x120136[_0x0c90('0x1f')]=qs[_0x0c90('0x1f')](_0x119e09[_0x0c90('0x31')][_0x0c90('0x1f')]);_0x120136[_0x0c90('0x1d')]=qs[_0x0c90('0x1d')](_0x119e09['query'][_0x0c90('0x1d')]);}_0x120136[_0x0c90('0x3a')]=qs['sort'](_0x119e09[_0x0c90('0x31')][_0x0c90('0x3b')]);_0x120136[_0x0c90('0x3c')]=qs[_0x0c90('0x32')](_[_0x0c90('0x3d')](_0x119e09['query'],_0x50b156[_0x0c90('0x32')]),_0x47a935);if(_0x119e09[_0x0c90('0x31')][_0x0c90('0x3e')]){_0x120136[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x120136[_0x0c90('0x3c')],{'$or':_[_0x0c90('0x2d')](_0x47a935,function(_0x1695dd){if(_0x1695dd[_0x0c90('0x2f')]!=='VIRTUAL'){var _0x2cd2c2={};_0x2cd2c2[_0x1695dd['name']]={'$like':'%'+_0x119e09[_0x0c90('0x31')]['filter']+'%'};return _0x2cd2c2;}})});}_0x120136=_[_0x0c90('0x3f')]({},_0x120136,_0x119e09[_0x0c90('0x40')]);var _0x49f8b4={'where':_0x120136['where']};return db[_0x0c90('0x41')]['count'](_0x49f8b4)[_0x0c90('0x25')](function(_0x4545bb){_0x478002[_0x0c90('0x20')]=_0x4545bb;if(_0x119e09['query'][_0x0c90('0x42')]){_0x120136[_0x0c90('0x43')]=[{'all':!![]}];}return db[_0x0c90('0x41')][_0x0c90('0x44')](_0x120136);})[_0x0c90('0x25')](function(_0x1184c4){_0x478002['rows']=_0x1184c4;return _0x478002;})[_0x0c90('0x25')](respondWithFilteredResult(_0x562664,_0x120136))[_0x0c90('0x45')](handleError(_0x562664,null));};exports[_0x0c90('0x46')]=function(_0x399115,_0x3c47c9){var _0x15d040={'raw':!![],'where':{'id':_0x399115['params']['id']}},_0x30b9df={};_0x30b9df[_0x0c90('0x33')]=_['keys'](db[_0x0c90('0x41')][_0x0c90('0x47')]);_0x30b9df[_0x0c90('0x31')]=_[_0x0c90('0x48')](_0x399115[_0x0c90('0x31')]);_0x30b9df[_0x0c90('0x32')]=_[_0x0c90('0x35')](_0x30b9df[_0x0c90('0x33')],_0x30b9df[_0x0c90('0x31')]);_0x15d040[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x30b9df[_0x0c90('0x33')],qs[_0x0c90('0x36')](_0x399115[_0x0c90('0x31')][_0x0c90('0x36')]));_0x15d040['attributes']=_0x15d040[_0x0c90('0x34')][_0x0c90('0x37')]?_0x15d040[_0x0c90('0x34')]:_0x30b9df[_0x0c90('0x33')];if(_0x399115[_0x0c90('0x31')][_0x0c90('0x42')]){_0x15d040[_0x0c90('0x43')]=[{'all':!![]}];}_0x15d040=_[_0x0c90('0x3f')]({},_0x15d040,_0x399115[_0x0c90('0x40')]);return db[_0x0c90('0x41')][_0x0c90('0x49')](_0x15d040)[_0x0c90('0x25')](handleEntityNotFound(_0x3c47c9,null))[_0x0c90('0x25')](respondWithResult(_0x3c47c9,null))[_0x0c90('0x45')](handleError(_0x3c47c9,null));};exports['create']=function(_0x1b4aac,_0x38f492){return db['VoiceMail']['create'](_0x1b4aac['body'],{})[_0x0c90('0x25')](function(_0x1205d0){var _0x460cf9=_0x1b4aac[_0x0c90('0x4a')][_0x0c90('0x4b')]({'plain':!![]});if(!_0x460cf9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460cf9[_0x0c90('0x4c')]===_0x0c90('0x4a')){var _0x2b756d=_0x1205d0['get']({'plain':!![]});var _0x119776=_0x0c90('0x27');return db[_0x0c90('0x4d')][_0x0c90('0x49')]({'where':{'name':_0x119776,'userProfileId':_0x460cf9[_0x0c90('0x4e')]},'raw':!![]})[_0x0c90('0x25')](function(_0x42c121){if(_0x42c121&&_0x42c121[_0x0c90('0x4f')]===0x0){return db[_0x0c90('0x28')][_0x0c90('0x50')]({'name':_0x2b756d['name'],'resourceId':_0x2b756d['id'],'type':_0x42c121[_0x0c90('0x2a')],'sectionId':_0x42c121['id']},{})['then'](function(){return _0x1205d0;});}else{return _0x1205d0;}})[_0x0c90('0x45')](function(_0x67539d){logger[_0x0c90('0x29')](_0x0c90('0x51'),_0x67539d);throw _0x67539d;});}return _0x1205d0;})[_0x0c90('0x25')](respondWithResult(_0x38f492,0xc9))[_0x0c90('0x45')](handleError(_0x38f492,null));};exports['update']=function(_0x4930fc,_0x5382d9){if(_0x4930fc['body']['id']){delete _0x4930fc[_0x0c90('0x52')]['id'];}return db[_0x0c90('0x41')][_0x0c90('0x49')]({'where':{'id':_0x4930fc['params']['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x5382d9,null))[_0x0c90('0x25')](saveUpdates(_0x4930fc['body'],null))[_0x0c90('0x25')](respondWithResult(_0x5382d9,null))['catch'](handleError(_0x5382d9,null));};exports[_0x0c90('0x26')]=function(_0x8951f2,_0x42398b){return db[_0x0c90('0x41')]['find']({'where':{'id':_0x8951f2[_0x0c90('0x53')]['id']}})['then'](handleEntityNotFound(_0x42398b,null))[_0x0c90('0x25')](removeEntity(_0x42398b,null))[_0x0c90('0x45')](handleError(_0x42398b,null));};exports['getMessages']=function(_0x52b437,_0x51c356,_0x221fba){return db[_0x0c90('0x41')][_0x0c90('0x54')]({'where':{'id':_0x52b437[_0x0c90('0x53')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x51c356,null))['then'](function(_0x3bfd01){var _0x25ab13;var _0x5ee971={},_0x3eb725={};_0x3eb725['model']=_[_0x0c90('0x48')](db[_0x0c90('0x55')]['rawAttributes']);_0x3eb725[_0x0c90('0x31')]=_['keys'](_0x52b437['query']);_0x3eb725['filters']=_[_0x0c90('0x35')](_0x3eb725[_0x0c90('0x33')],_0x3eb725[_0x0c90('0x31')]);_0x5ee971[_0x0c90('0x34')]=_['intersection'](_0x3eb725['model'],qs[_0x0c90('0x36')](_0x52b437[_0x0c90('0x31')][_0x0c90('0x36')]));_0x5ee971['attributes']=_0x5ee971[_0x0c90('0x34')][_0x0c90('0x37')]?_0x5ee971[_0x0c90('0x34')]:_0x3eb725['model'];if(!_0x52b437[_0x0c90('0x31')][_0x0c90('0x38')](_0x0c90('0x39'))){_0x5ee971['limit']=qs[_0x0c90('0x1f')](_0x52b437[_0x0c90('0x31')][_0x0c90('0x1f')]);_0x5ee971[_0x0c90('0x1d')]=qs[_0x0c90('0x1d')](_0x52b437[_0x0c90('0x31')][_0x0c90('0x1d')]);}_0x5ee971[_0x0c90('0x3a')]=qs[_0x0c90('0x3b')](_0x52b437['query']['sort']);_0x5ee971[_0x0c90('0x3c')]=qs[_0x0c90('0x32')](_[_0x0c90('0x3d')](_0x52b437[_0x0c90('0x31')],_0x3eb725[_0x0c90('0x32')]));if(_0x52b437[_0x0c90('0x31')][_0x0c90('0x3e')]){_0x5ee971[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x5ee971[_0x0c90('0x3c')],{'$or':_[_0x0c90('0x2d')](_0x5ee971[_0x0c90('0x34')],function(_0x309152){var _0x164d4d={};_0x164d4d[_0x309152]={'$like':'%'+_0x52b437[_0x0c90('0x31')]['filter']+'%'};return _0x164d4d;})});}_0x5ee971[_0x0c90('0x3c')]=_[_0x0c90('0x3f')](_0x5ee971[_0x0c90('0x3c')],{'mailboxuser':_0x3bfd01['mailbox']});_0x5ee971=_['merge']({},_0x5ee971,_0x52b437[_0x0c90('0x40')]);return db['VoiceMailMessage'][_0x0c90('0x56')](_0x5ee971)[_0x0c90('0x25')](respondWithFilteredResult(_0x51c356,_0x5ee971));})['catch'](handleError(_0x51c356,null));};
\ No newline at end of file
+var _0x4cf8=['UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceMail','include','findAll','catch','find','create','body','user','UserProfileSection','userProfileId','params','getMessages','findOne','VoiceMailMessage','mailbox','options','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x4cf8,0x1e1));var _0x84cf=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0x4cf8[_0xc87d08];return _0x30a714;};'use strict';var emlformat=require(_0x84cf('0x0'));var rimraf=require(_0x84cf('0x1'));var zipdir=require(_0x84cf('0x2'));var jsonpatch=require(_0x84cf('0x3'));var rp=require(_0x84cf('0x4'));var moment=require(_0x84cf('0x5'));var BPromise=require(_0x84cf('0x6'));var Mustache=require(_0x84cf('0x7'));var util=require(_0x84cf('0x8'));var path=require(_0x84cf('0x9'));var sox=require(_0x84cf('0xa'));var csv=require(_0x84cf('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x84cf('0xc'));var squel=require('squel');var crypto=require(_0x84cf('0xd'));var jsforce=require(_0x84cf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84cf('0xb'));var querystring=require(_0x84cf('0xf'));var Papa=require('papaparse');var Redis=require(_0x84cf('0x10'));var authService=require(_0x84cf('0x11'));var qs=require(_0x84cf('0x12'));var as=require(_0x84cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84cf('0x14'))(_0x84cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x84cf('0x16'));var db=require(_0x84cf('0x17'))['db'];function respondWithStatusCode(_0x35f852,_0x33f83e){_0x33f83e=_0x33f83e||0xcc;return function(_0x172d04){if(_0x172d04){return _0x35f852[_0x84cf('0x18')](_0x33f83e);}return _0x35f852[_0x84cf('0x19')](_0x33f83e)[_0x84cf('0x1a')]();};}function respondWithResult(_0xced48,_0x250a19){_0x250a19=_0x250a19||0xc8;return function(_0x2fc41f){if(_0x2fc41f){return _0xced48[_0x84cf('0x19')](_0x250a19)[_0x84cf('0x1b')](_0x2fc41f);}};}function respondWithFilteredResult(_0x20e79c,_0x27261b){return function(_0x167c3e){if(_0x167c3e){var _0x464e70=typeof _0x27261b[_0x84cf('0x1c')]===_0x84cf('0x1d')&&typeof _0x27261b['limit']===_0x84cf('0x1d');var _0x5d6a93=_0x167c3e[_0x84cf('0x1e')];var _0x1abe2d=_0x464e70?0x0:_0x27261b[_0x84cf('0x1c')];var _0x13ba16=_0x464e70?_0x167c3e[_0x84cf('0x1e')]:_0x27261b['offset']+_0x27261b['limit'];var _0x42d6d4;if(_0x13ba16>=_0x5d6a93){_0x13ba16=_0x5d6a93;_0x42d6d4=0xc8;}else{_0x42d6d4=0xce;}_0x20e79c[_0x84cf('0x19')](_0x42d6d4);return _0x20e79c[_0x84cf('0x1f')](_0x84cf('0x20'),_0x1abe2d+'-'+_0x13ba16+'/'+_0x5d6a93)[_0x84cf('0x1b')](_0x167c3e);}return null;};}function patchUpdates(_0x5dda3f){return function(_0x39a37b){try{jsonpatch[_0x84cf('0x21')](_0x39a37b,_0x5dda3f,!![]);}catch(_0x3ca1be){return BPromise[_0x84cf('0x22')](_0x3ca1be);}return _0x39a37b[_0x84cf('0x23')]();};}function saveUpdates(_0x54405a,_0x42fa45){return function(_0x160f86){if(_0x160f86){return _0x160f86[_0x84cf('0x24')](_0x54405a)[_0x84cf('0x25')](function(_0x3e5e94){return _0x3e5e94;});}return null;};}function removeEntity(_0x29e9e1,_0x7feb4){return function(_0x4c9d1c){if(_0x4c9d1c){return _0x4c9d1c[_0x84cf('0x26')]()[_0x84cf('0x25')](function(){var _0x1c7747=_0x4c9d1c[_0x84cf('0x27')]({'plain':!![]});var _0x1d220a=_0x84cf('0x28');return db[_0x84cf('0x29')][_0x84cf('0x26')]({'where':{'type':_0x1d220a,'resourceId':_0x1c7747['id']}})[_0x84cf('0x25')](function(){return _0x4c9d1c;});})[_0x84cf('0x25')](function(){_0x29e9e1['status'](0xcc)[_0x84cf('0x1a')]();});}};}function handleEntityNotFound(_0x17bc92,_0x2a4973){return function(_0x41a5db){if(!_0x41a5db){_0x17bc92['sendStatus'](0x194);}return _0x41a5db;};}function handleError(_0x1595dd,_0x5a428c){_0x5a428c=_0x5a428c||0x1f4;return function(_0x29455e){logger[_0x84cf('0x2a')](_0x29455e[_0x84cf('0x2b')]);if(_0x29455e[_0x84cf('0x2c')]){delete _0x29455e[_0x84cf('0x2c')];}_0x1595dd[_0x84cf('0x19')](_0x5a428c)[_0x84cf('0x2d')](_0x29455e);};}exports[_0x84cf('0x2e')]=function(_0x1bfa56,_0xb4fc5a){var _0x31dbf5={},_0x308f8f={},_0x18243d={'count':0x0,'rows':[]};var _0x44f16e=_['map'](db['VoiceMail'][_0x84cf('0x2f')],function(_0x25de3a){return{'name':_0x25de3a[_0x84cf('0x30')],'type':_0x25de3a[_0x84cf('0x31')][_0x84cf('0x32')]};});_0x308f8f[_0x84cf('0x33')]=_[_0x84cf('0x34')](_0x44f16e,_0x84cf('0x2c'));_0x308f8f['query']=_[_0x84cf('0x35')](_0x1bfa56[_0x84cf('0x36')]);_0x308f8f['filters']=_[_0x84cf('0x37')](_0x308f8f['model'],_0x308f8f[_0x84cf('0x36')]);_0x31dbf5[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x308f8f[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x1bfa56['query'][_0x84cf('0x39')]));_0x31dbf5['attributes']=_0x31dbf5['attributes'][_0x84cf('0x3a')]?_0x31dbf5[_0x84cf('0x38')]:_0x308f8f['model'];if(!_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x3b')](_0x84cf('0x3c'))){_0x31dbf5[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x1bfa56[_0x84cf('0x36')]['limit']);_0x31dbf5[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x1c')]);}_0x31dbf5[_0x84cf('0x3e')]=qs[_0x84cf('0x3f')](_0x1bfa56['query'][_0x84cf('0x3f')]);_0x31dbf5['where']=qs[_0x84cf('0x40')](_[_0x84cf('0x41')](_0x1bfa56[_0x84cf('0x36')],_0x308f8f[_0x84cf('0x40')]),_0x44f16e);if(_0x1bfa56[_0x84cf('0x36')][_0x84cf('0x42')]){_0x31dbf5[_0x84cf('0x43')]=_[_0x84cf('0x44')](_0x31dbf5[_0x84cf('0x43')],{'$or':_['map'](_0x44f16e,function(_0x44e6f0){if(_0x44e6f0['type']!==_0x84cf('0x45')){var _0xc75386={};_0xc75386[_0x44e6f0['name']]={'$like':'%'+_0x1bfa56[_0x84cf('0x36')]['filter']+'%'};return _0xc75386;}})});}_0x31dbf5=_[_0x84cf('0x44')]({},_0x31dbf5,_0x1bfa56['options']);var _0x3fc160={'where':_0x31dbf5['where']};return db[_0x84cf('0x46')][_0x84cf('0x1e')](_0x3fc160)['then'](function(_0x847ce9){_0x18243d[_0x84cf('0x1e')]=_0x847ce9;if(_0x1bfa56[_0x84cf('0x36')]['includeAll']){_0x31dbf5[_0x84cf('0x47')]=[{'all':!![]}];}return db['VoiceMail'][_0x84cf('0x48')](_0x31dbf5);})['then'](function(_0x56b0e5){_0x18243d['rows']=_0x56b0e5;return _0x18243d;})[_0x84cf('0x25')](respondWithFilteredResult(_0xb4fc5a,_0x31dbf5))[_0x84cf('0x49')](handleError(_0xb4fc5a,null));};exports['show']=function(_0x2b737e,_0x56b623){var _0x191ad8={'raw':!![],'where':{'id':_0x2b737e['params']['id']}},_0x3fe8c1={};_0x3fe8c1[_0x84cf('0x33')]=_['keys'](db[_0x84cf('0x46')]['rawAttributes']);_0x3fe8c1['query']=_['keys'](_0x2b737e['query']);_0x3fe8c1['filters']=_['intersection'](_0x3fe8c1['model'],_0x3fe8c1[_0x84cf('0x36')]);_0x191ad8[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x3fe8c1[_0x84cf('0x33')],qs['fields'](_0x2b737e[_0x84cf('0x36')]['fields']));_0x191ad8[_0x84cf('0x38')]=_0x191ad8[_0x84cf('0x38')][_0x84cf('0x3a')]?_0x191ad8[_0x84cf('0x38')]:_0x3fe8c1[_0x84cf('0x33')];if(_0x2b737e[_0x84cf('0x36')]['includeAll']){_0x191ad8[_0x84cf('0x47')]=[{'all':!![]}];}_0x191ad8=_[_0x84cf('0x44')]({},_0x191ad8,_0x2b737e['options']);return db[_0x84cf('0x46')][_0x84cf('0x4a')](_0x191ad8)[_0x84cf('0x25')](handleEntityNotFound(_0x56b623,null))['then'](respondWithResult(_0x56b623,null))['catch'](handleError(_0x56b623,null));};exports['create']=function(_0x1cf3f6,_0x104421){return db[_0x84cf('0x46')][_0x84cf('0x4b')](_0x1cf3f6[_0x84cf('0x4c')],{})[_0x84cf('0x25')](function(_0x51d725){var _0x350985=_0x1cf3f6['user'][_0x84cf('0x27')]({'plain':!![]});if(!_0x350985)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x350985['role']===_0x84cf('0x4d')){var _0xb1c3a8=_0x51d725[_0x84cf('0x27')]({'plain':!![]});var _0x55e24e='Voicemails';return db[_0x84cf('0x4e')][_0x84cf('0x4a')]({'where':{'name':_0x55e24e,'userProfileId':_0x350985[_0x84cf('0x4f')]},'raw':!![]})[_0x84cf('0x25')](function(_0x401ced){if(_0x401ced&&_0x401ced['autoAssociation']===0x0){return db[_0x84cf('0x29')][_0x84cf('0x4b')]({'name':_0xb1c3a8['name'],'resourceId':_0xb1c3a8['id'],'type':_0x401ced[_0x84cf('0x2c')],'sectionId':_0x401ced['id']},{})['then'](function(){return _0x51d725;});}else{return _0x51d725;}})['catch'](function(_0x147194){logger[_0x84cf('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x147194);throw _0x147194;});}return _0x51d725;})['then'](respondWithResult(_0x104421,0xc9))[_0x84cf('0x49')](handleError(_0x104421,null));};exports[_0x84cf('0x24')]=function(_0x2f739a,_0x1e2676){if(_0x2f739a[_0x84cf('0x4c')]['id']){delete _0x2f739a[_0x84cf('0x4c')]['id'];}return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x2f739a['params']['id']}})[_0x84cf('0x25')](handleEntityNotFound(_0x1e2676,null))[_0x84cf('0x25')](saveUpdates(_0x2f739a['body'],null))['then'](respondWithResult(_0x1e2676,null))[_0x84cf('0x49')](handleError(_0x1e2676,null));};exports[_0x84cf('0x26')]=function(_0x3912cb,_0x2a4f20){return db[_0x84cf('0x46')][_0x84cf('0x4a')]({'where':{'id':_0x3912cb[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a4f20,null))[_0x84cf('0x25')](removeEntity(_0x2a4f20,null))['catch'](handleError(_0x2a4f20,null));};exports[_0x84cf('0x51')]=function(_0x5c0122,_0x2a60bc,_0x1c2f1b){return db['VoiceMail'][_0x84cf('0x52')]({'where':{'id':_0x5c0122[_0x84cf('0x50')]['id']}})['then'](handleEntityNotFound(_0x2a60bc,null))[_0x84cf('0x25')](function(_0x53bfb8){var _0x577d55;var _0x5cc371={},_0x50cde2={};_0x50cde2[_0x84cf('0x33')]=_[_0x84cf('0x35')](db[_0x84cf('0x53')][_0x84cf('0x2f')]);_0x50cde2['query']=_[_0x84cf('0x35')](_0x5c0122[_0x84cf('0x36')]);_0x50cde2['filters']=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],_0x50cde2[_0x84cf('0x36')]);_0x5cc371[_0x84cf('0x38')]=_[_0x84cf('0x37')](_0x50cde2[_0x84cf('0x33')],qs[_0x84cf('0x39')](_0x5c0122[_0x84cf('0x36')]['fields']));_0x5cc371[_0x84cf('0x38')]=_0x5cc371['attributes'][_0x84cf('0x3a')]?_0x5cc371[_0x84cf('0x38')]:_0x50cde2[_0x84cf('0x33')];if(!_0x5c0122[_0x84cf('0x36')][_0x84cf('0x3b')]('nolimit')){_0x5cc371[_0x84cf('0x3d')]=qs[_0x84cf('0x3d')](_0x5c0122[_0x84cf('0x36')]['limit']);_0x5cc371[_0x84cf('0x1c')]=qs[_0x84cf('0x1c')](_0x5c0122['query'][_0x84cf('0x1c')]);}_0x5cc371['order']=qs[_0x84cf('0x3f')](_0x5c0122[_0x84cf('0x36')]['sort']);_0x5cc371[_0x84cf('0x43')]=qs[_0x84cf('0x40')](_['pick'](_0x5c0122[_0x84cf('0x36')],_0x50cde2[_0x84cf('0x40')]));if(_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]){_0x5cc371['where']=_[_0x84cf('0x44')](_0x5cc371[_0x84cf('0x43')],{'$or':_['map'](_0x5cc371['attributes'],function(_0x4d40e2){var _0x1b000c={};_0x1b000c[_0x4d40e2]={'$like':'%'+_0x5c0122[_0x84cf('0x36')][_0x84cf('0x42')]+'%'};return _0x1b000c;})});}_0x5cc371['where']=_['merge'](_0x5cc371[_0x84cf('0x43')],{'mailboxuser':_0x53bfb8[_0x84cf('0x54')]});_0x5cc371=_[_0x84cf('0x44')]({},_0x5cc371,_0x5c0122[_0x84cf('0x55')]);return db[_0x84cf('0x53')][_0x84cf('0x56')](_0x5cc371)[_0x84cf('0x25')](respondWithFilteredResult(_0x2a60bc,_0x5cc371));})[_0x84cf('0x49')](handleError(_0x2a60bc,null));};
\ No newline at end of file
index 14a3661..097e83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f7c=['util','../../config/logger','api','moment','bluebird','request-promise','path','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x5a7d6c,_0x3cfefb){var _0x1dfbfa=function(_0x5d7ae3){while(--_0x5d7ae3){_0x5a7d6c['push'](_0x5a7d6c['shift']());}};_0x1dfbfa(++_0x3cfefb);}(_0x8f7c,0x1cd));var _0xc8f7=function(_0x48e86f,_0x43b892){_0x48e86f=_0x48e86f-0x0;var _0x182f88=_0x8f7c[_0x48e86f];return _0x182f88;};'use strict';var _=require(_0xc8f7('0x0'));var util=require(_0xc8f7('0x1'));var logger=require(_0xc8f7('0x2'))(_0xc8f7('0x3'));var moment=require(_0xc8f7('0x4'));var BPromise=require(_0xc8f7('0x5'));var rp=require(_0xc8f7('0x6'));var fs=require('fs');var path=require(_0xc8f7('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module['exports']=function(_0xf0ed34,_0xdb990d){return _0xf0ed34[_0xc8f7('0x8')](_0xc8f7('0x9'),attributes,{'tableName':_0xc8f7('0xa'),'paranoid':![],'indexes':[{'name':_0xc8f7('0xb'),'fields':[_0xc8f7('0xc'),_0xc8f7('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf8a=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','moment','bluebird','path'];(function(_0x312f97,_0x1abd76){var _0x3e134e=function(_0xd9f87d){while(--_0xd9f87d){_0x312f97['push'](_0x312f97['shift']());}};_0x3e134e(++_0x1abd76);}(_0xaf8a,0xcd));var _0xaaf8=function(_0x378fbb,_0x59d4d5){_0x378fbb=_0x378fbb-0x0;var _0x2d91d3=_0xaf8a[_0x378fbb];return _0x2d91d3;};'use strict';var _=require(_0xaaf8('0x0'));var util=require('util');var logger=require(_0xaaf8('0x1'))('api');var moment=require(_0xaaf8('0x2'));var BPromise=require(_0xaaf8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaaf8('0x4'));var rimraf=require(_0xaaf8('0x5'));var config=require(_0xaaf8('0x6'));var attributes=require(_0xaaf8('0x7'));module[_0xaaf8('0x8')]=function(_0x148df1,_0x21ee6f){return _0x148df1[_0xaaf8('0x9')]('VoiceMail',attributes,{'tableName':_0xaaf8('0xa'),'paranoid':![],'indexes':[{'name':_0xaaf8('0xb'),'fields':[_0xaaf8('0xc'),_0xaaf8('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index eaaa40b..1d23ba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe051=['rpc','../../config/environment','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3cc341,_0x52d978){var _0x3b2736=function(_0x4ed51f){while(--_0x4ed51f){_0x3cc341['push'](_0x3cc341['shift']());}};_0x3b2736(++_0x52d978);}(_0xe051,0x8c));var _0x1e05=function(_0x1d6a0e,_0x351ad3){_0x1d6a0e=_0x1d6a0e-0x0;var _0x5260a4=_0xe051[_0x1d6a0e];return _0x5260a4;};'use strict';var _=require(_0x1e05('0x0'));var util=require(_0x1e05('0x1'));var moment=require(_0x1e05('0x2'));var BPromise=require(_0x1e05('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e05('0x4'))['db'];var utils=require(_0x1e05('0x5'));var logger=require(_0x1e05('0x6'))(_0x1e05('0x7'));var config=require(_0x1e05('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1e05('0x9')][_0x1e05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12f276,_0x1d5edc,_0x195bae){return new BPromise(function(_0x49bc23,_0x50e805){return client[_0x1e05('0xb')](_0x12f276,_0x195bae)['then'](function(_0x5054f3){logger[_0x1e05('0xc')](_0x1e05('0xd'),_0x1d5edc,_0x1e05('0xe'));logger[_0x1e05('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1d5edc,_0x1e05('0xe'),JSON[_0x1e05('0x10')](_0x5054f3));if(_0x5054f3['error']){if(_0x5054f3['error']['code']===0x1f4){logger[_0x1e05('0x11')](_0x1e05('0xd'),_0x1d5edc,_0x5054f3[_0x1e05('0x11')][_0x1e05('0x12')]);return _0x50e805(_0x5054f3['error'][_0x1e05('0x12')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x1d5edc,_0x5054f3[_0x1e05('0x11')]['message']);return _0x49bc23(_0x5054f3[_0x1e05('0x11')]['message']);}else{logger[_0x1e05('0xc')](_0x1e05('0xd'),_0x1d5edc,_0x1e05('0xe'));_0x49bc23(_0x5054f3[_0x1e05('0x13')]['message']);}})[_0x1e05('0x14')](function(_0x5a6279){logger[_0x1e05('0x11')](_0x1e05('0xd'),_0x1d5edc,_0x5a6279);_0x50e805(_0x5a6279);});});}
\ No newline at end of file
+var _0x1770=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa4f54b,_0x219d67){var _0x29f24c=function(_0x1b7ca7){while(--_0x1b7ca7){_0xa4f54b['push'](_0xa4f54b['shift']());}};_0x29f24c(++_0x219d67);}(_0x1770,0x194));var _0x0177=function(_0xb04224,_0x3877f7){_0xb04224=_0xb04224-0x0;var _0xe09de9=_0x1770[_0xb04224];return _0xe09de9;};'use strict';var _=require(_0x0177('0x0'));var util=require('util');var moment=require(_0x0177('0x1'));var BPromise=require('bluebird');var rs=require(_0x0177('0x2'));var fs=require('fs');var Redis=require(_0x0177('0x3'));var db=require(_0x0177('0x4'))['db'];var utils=require(_0x0177('0x5'));var logger=require('../../config/logger')(_0x0177('0x6'));var config=require('../../config/environment');var jayson=require(_0x0177('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c76de,_0x37cf16,_0x208227){return new BPromise(function(_0x3dfb59,_0x4111f2){return client['request'](_0x1c76de,_0x208227)[_0x0177('0x8')](function(_0x3342b1){logger[_0x0177('0x9')](_0x0177('0xa'),_0x37cf16,_0x0177('0xb'));logger[_0x0177('0xc')](_0x0177('0xd'),_0x37cf16,_0x0177('0xb'),JSON[_0x0177('0xe')](_0x3342b1));if(_0x3342b1[_0x0177('0xf')]){if(_0x3342b1[_0x0177('0xf')][_0x0177('0x10')]===0x1f4){logger['error'](_0x0177('0xa'),_0x37cf16,_0x3342b1[_0x0177('0xf')][_0x0177('0x11')]);return _0x4111f2(_0x3342b1[_0x0177('0xf')]['message']);}logger[_0x0177('0xf')](_0x0177('0xa'),_0x37cf16,_0x3342b1[_0x0177('0xf')][_0x0177('0x11')]);return _0x3dfb59(_0x3342b1[_0x0177('0xf')][_0x0177('0x11')]);}else{logger[_0x0177('0x9')](_0x0177('0xa'),_0x37cf16,_0x0177('0xb'));_0x3dfb59(_0x3342b1[_0x0177('0x12')][_0x0177('0x11')]);}})[_0x0177('0x13')](function(_0x4fe525){logger[_0x0177('0xf')](_0x0177('0xa'),_0x37cf16,_0x4fe525);_0x4111f2(_0x4fe525);});});}
\ No newline at end of file
index 5d4b0d1..81d67a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb443=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','post','create','put','/:id','update','delete'];(function(_0x421263,_0x18187d){var _0x34e4b5=function(_0x4e7978){while(--_0x4e7978){_0x421263['push'](_0x421263['shift']());}};_0x34e4b5(++_0x18187d);}(_0xb443,0x10a));var _0x3b44=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xb443[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0x3b44('0x0'));var util=require(_0x3b44('0x1'));var path=require('path');var timeout=require(_0x3b44('0x2'));var express=require(_0x3b44('0x3'));var router=express[_0x3b44('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b44('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b44('0x6'));var controller=require(_0x3b44('0x7'));router[_0x3b44('0x8')]('/',auth[_0x3b44('0x9')](),controller[_0x3b44('0xa')]);router[_0x3b44('0x8')]('/:id',auth[_0x3b44('0x9')](),controller[_0x3b44('0xb')]);router[_0x3b44('0x8')](_0x3b44('0xc'),auth[_0x3b44('0x9')](),controller['download']);router[_0x3b44('0xd')]('/',auth[_0x3b44('0x9')](),controller[_0x3b44('0xe')]);router[_0x3b44('0xf')](_0x3b44('0x10'),auth['isAuthenticated'](),controller[_0x3b44('0x11')]);router[_0x3b44('0x12')]('/:id',auth[_0x3b44('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbfc6=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../config/environment','./voiceMailMessage.controller'];(function(_0x5c1eeb,_0x17058d){var _0x20d161=function(_0x5653a4){while(--_0x5653a4){_0x5c1eeb['push'](_0x5c1eeb['shift']());}};_0x20d161(++_0x17058d);}(_0xbfc6,0x161));var _0x6bfc=function(_0x200ba0,_0x2e8299){_0x200ba0=_0x200ba0-0x0;var _0xa997d8=_0xbfc6[_0x200ba0];return _0xa997d8;};'use strict';var multer=require('multer');var util=require(_0x6bfc('0x0'));var path=require(_0x6bfc('0x1'));var timeout=require('connect-timeout');var express=require(_0x6bfc('0x2'));var router=express[_0x6bfc('0x3')]();var fs_extra=require(_0x6bfc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6bfc('0x5'));var controller=require(_0x6bfc('0x6'));router[_0x6bfc('0x7')]('/',auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x9')]);router[_0x6bfc('0x7')](_0x6bfc('0xa'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xb')]);router[_0x6bfc('0x7')](_0x6bfc('0xc'),auth['isAuthenticated'](),controller[_0x6bfc('0xd')]);router[_0x6bfc('0xe')]('/',auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xf')]);router[_0x6bfc('0x10')](_0x6bfc('0xa'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x11')]);router[_0x6bfc('0x12')](_0x6bfc('0xa'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x13')]);module['exports']=router;
\ No newline at end of file
index 58c0a5f..ff2dcc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8322=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8322,0x145));var _0x2832=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x8322[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require('sequelize');module[_0x2832('0x0')]={'name':{'type':Sequelize[_0x2832('0x1')],'get':function(_0x5c9405){return this[_0x2832('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x2832('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2832('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x2832('0x5')](_0x2832('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x2832('0x7'),'defaultValue':Sequelize[_0x2832('0x8')](_0x2832('0x9'))}};
\ No newline at end of file
+var _0xcf34=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xcf34,0x13f));var _0x4cf3=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xcf34[_0x15cbce];return _0x257f29;};'use strict';var Sequelize=require(_0x4cf3('0x0'));module[_0x4cf3('0x1')]={'name':{'type':Sequelize[_0x4cf3('0x2')],'get':function(_0x425fbc){return this[_0x4cf3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x4cf3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x4cf3('0x6')](_0x4cf3('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x4cf3('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x4cf3('0x8'),'defaultValue':Sequelize[_0x4cf3('0x9')](_0x4cf3('0xa'))}};
\ No newline at end of file
index 2fcf4a0..fd53ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbe4=['length','include','find','catch','create','body','params','download','recording','msg_id','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','end','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','differenceBy','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','model'];(function(_0x36633f,_0x26e83d){var _0x480eb0=function(_0x2e4919){while(--_0x2e4919){_0x36633f['push'](_0x36633f['shift']());}};_0x480eb0(++_0x26e83d);}(_0xfbe4,0x160));var _0x4fbe=function(_0x3d23ed,_0xaeeba6){_0x3d23ed=_0x3d23ed-0x0;var _0x17a1d6=_0xfbe4[_0x3d23ed];return _0x17a1d6;};'use strict';var emlformat=require(_0x4fbe('0x0'));var rimraf=require(_0x4fbe('0x1'));var zipdir=require(_0x4fbe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4fbe('0x3'));var Mustache=require(_0x4fbe('0x4'));var util=require(_0x4fbe('0x5'));var path=require(_0x4fbe('0x6'));var sox=require(_0x4fbe('0x7'));var csv=require(_0x4fbe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4fbe('0x9'));var _=require(_0x4fbe('0xa'));var squel=require(_0x4fbe('0xb'));var crypto=require('crypto');var jsforce=require(_0x4fbe('0xc'));var deskjs=require(_0x4fbe('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4fbe('0xe'));var Papa=require(_0x4fbe('0xf'));var Redis=require(_0x4fbe('0x10'));var authService=require(_0x4fbe('0x11'));var qs=require(_0x4fbe('0x12'));var as=require(_0x4fbe('0x13'));var hardwareService=require(_0x4fbe('0x14'));var logger=require(_0x4fbe('0x15'))(_0x4fbe('0x16'));var utils=require(_0x4fbe('0x17'));var config=require(_0x4fbe('0x18'));var licenseUtil=require(_0x4fbe('0x19'));var db=require(_0x4fbe('0x1a'))['db'];function respondWithStatusCode(_0x4d03ce,_0xeb7551){_0xeb7551=_0xeb7551||0xcc;return function(_0x26bfbf){if(_0x26bfbf){return _0x4d03ce[_0x4fbe('0x1b')](_0xeb7551);}return _0x4d03ce[_0x4fbe('0x1c')](_0xeb7551)['end']();};}function respondWithResult(_0x2a91a2,_0x13a181){_0x13a181=_0x13a181||0xc8;return function(_0x1b1605){if(_0x1b1605){return _0x2a91a2['status'](_0x13a181)[_0x4fbe('0x1d')](_0x1b1605);}};}function respondWithFilteredResult(_0x52a437,_0x2fc9b8){return function(_0x100b43){if(_0x100b43){var _0x544e28=typeof _0x2fc9b8[_0x4fbe('0x1e')]===_0x4fbe('0x1f')&&typeof _0x2fc9b8['limit']==='undefined';var _0x4db298=_0x100b43[_0x4fbe('0x20')];var _0x56fb82=_0x544e28?0x0:_0x2fc9b8[_0x4fbe('0x1e')];var _0x38e799=_0x544e28?_0x100b43[_0x4fbe('0x20')]:_0x2fc9b8[_0x4fbe('0x1e')]+_0x2fc9b8[_0x4fbe('0x21')];var _0x125cd2;if(_0x38e799>=_0x4db298){_0x38e799=_0x4db298;_0x125cd2=0xc8;}else{_0x125cd2=0xce;}_0x52a437[_0x4fbe('0x1c')](_0x125cd2);return _0x52a437[_0x4fbe('0x22')](_0x4fbe('0x23'),_0x56fb82+'-'+_0x38e799+'/'+_0x4db298)[_0x4fbe('0x1d')](_0x100b43);}return null;};}function patchUpdates(_0x40b826){return function(_0x366b39){try{jsonpatch[_0x4fbe('0x24')](_0x366b39,_0x40b826,!![]);}catch(_0x15b73b){return BPromise['reject'](_0x15b73b);}return _0x366b39[_0x4fbe('0x25')]();};}function saveUpdates(_0x5b2c29,_0x4960f7){return function(_0x17fb9e){if(_0x17fb9e){return _0x17fb9e['update'](_0x5b2c29)[_0x4fbe('0x26')](function(_0x3297b3){return _0x3297b3;});}return null;};}function removeEntity(_0x114b03,_0x10e488){return function(_0x1b0009){if(_0x1b0009){return _0x1b0009[_0x4fbe('0x27')]()[_0x4fbe('0x26')](function(){_0x114b03[_0x4fbe('0x1c')](0xcc)[_0x4fbe('0x28')]();});}};}function handleEntityNotFound(_0x2e82c5,_0x32e470){return function(_0x2b7d79){if(!_0x2b7d79){_0x2e82c5[_0x4fbe('0x1b')](0x194);}return _0x2b7d79;};}function handleError(_0x5ffbe5,_0xe42e8){_0xe42e8=_0xe42e8||0x1f4;return function(_0x89e9b5){logger['error'](_0x89e9b5[_0x4fbe('0x29')]);if(_0x89e9b5[_0x4fbe('0x2a')]){delete _0x89e9b5[_0x4fbe('0x2a')];}_0x5ffbe5[_0x4fbe('0x1c')](_0xe42e8)[_0x4fbe('0x2b')](_0x89e9b5);};}exports[_0x4fbe('0x2c')]=function(_0x588d6c,_0x15dfe2){var _0x3355c0={},_0x371c5d={},_0x2b183a={'count':0x0,'rows':[]};var _0x957119=_[_0x4fbe('0x2d')](db[_0x4fbe('0x2e')][_0x4fbe('0x2f')],function(_0x4a2b65){return{'name':_0x4a2b65[_0x4fbe('0x30')],'type':_0x4a2b65[_0x4fbe('0x31')]['key']};});_0x371c5d['model']=_[_0x4fbe('0x32')](_[_0x4fbe('0x2d')](_0x957119,_0x4fbe('0x2a')),[_0x4fbe('0x2a')]);_0x371c5d['query']=_[_0x4fbe('0x33')](_0x588d6c['query']);_0x371c5d['filters']=_[_0x4fbe('0x34')](_0x371c5d['model'],_0x371c5d[_0x4fbe('0x35')]);_0x3355c0[_0x4fbe('0x36')]=_[_0x4fbe('0x34')](_0x371c5d['model'],qs['fields'](_0x588d6c['query'][_0x4fbe('0x37')]));_0x3355c0[_0x4fbe('0x36')]=_0x3355c0[_0x4fbe('0x36')]['length']?_0x3355c0['attributes']:_0x371c5d['model'];if(!_0x588d6c[_0x4fbe('0x35')][_0x4fbe('0x38')](_0x4fbe('0x39'))){_0x3355c0[_0x4fbe('0x21')]=qs[_0x4fbe('0x21')](_0x588d6c[_0x4fbe('0x35')][_0x4fbe('0x21')]);_0x3355c0['offset']=qs['offset'](_0x588d6c['query'][_0x4fbe('0x1e')]);}_0x3355c0[_0x4fbe('0x3a')]=qs['sort'](_0x588d6c['query'][_0x4fbe('0x3b')]);_0x3355c0[_0x4fbe('0x3c')]=qs[_0x4fbe('0x3d')](_['pick'](_0x588d6c['query'],_0x371c5d['filters']),_0x957119);if(_0x588d6c[_0x4fbe('0x35')][_0x4fbe('0x3e')]){_0x3355c0['where']=_[_0x4fbe('0x3f')](_0x3355c0[_0x4fbe('0x3c')],{'$or':_[_0x4fbe('0x2d')](_0x957119,function(_0x226586){if(_0x226586['type']!==_0x4fbe('0x40')){var _0x5cd8d0={};_0x5cd8d0[_0x226586[_0x4fbe('0x2a')]]={'$like':'%'+_0x588d6c[_0x4fbe('0x35')][_0x4fbe('0x3e')]+'%'};return _0x5cd8d0;}})});}_0x3355c0=_[_0x4fbe('0x3f')]({},_0x3355c0,_0x588d6c['options']);var _0x561820={'where':_0x3355c0[_0x4fbe('0x3c')]};return db[_0x4fbe('0x2e')][_0x4fbe('0x20')](_0x561820)[_0x4fbe('0x26')](function(_0x95beef){_0x2b183a['count']=_0x95beef;if(_0x588d6c[_0x4fbe('0x35')][_0x4fbe('0x41')]){_0x3355c0['include']=[{'all':!![]}];}return db[_0x4fbe('0x2e')]['findAll'](_0x3355c0);})[_0x4fbe('0x26')](function(_0x2d827f){_0x2b183a[_0x4fbe('0x42')]=_0x2d827f;return _0x2b183a;})[_0x4fbe('0x26')](respondWithFilteredResult(_0x15dfe2,_0x3355c0))['catch'](handleError(_0x15dfe2,null));};exports['show']=function(_0x1fa2d5,_0x7abca){var _0x9f8202={'raw':!![],'where':{'id':_0x1fa2d5['params']['id']}},_0x5cef19={};_0x5cef19[_0x4fbe('0x43')]=_[_0x4fbe('0x33')](db[_0x4fbe('0x2e')][_0x4fbe('0x2f')]);_0x5cef19[_0x4fbe('0x35')]=_['keys'](_0x1fa2d5[_0x4fbe('0x35')]);_0x5cef19[_0x4fbe('0x3d')]=_[_0x4fbe('0x34')](_0x5cef19[_0x4fbe('0x43')],_0x5cef19[_0x4fbe('0x35')]);_0x9f8202[_0x4fbe('0x36')]=_[_0x4fbe('0x34')](_0x5cef19[_0x4fbe('0x43')],qs[_0x4fbe('0x37')](_0x1fa2d5[_0x4fbe('0x35')][_0x4fbe('0x37')]));_0x9f8202[_0x4fbe('0x36')]=_0x9f8202[_0x4fbe('0x36')][_0x4fbe('0x44')]?_0x9f8202['attributes']:_0x5cef19[_0x4fbe('0x43')];if(_0x1fa2d5[_0x4fbe('0x35')][_0x4fbe('0x41')]){_0x9f8202[_0x4fbe('0x45')]=[{'all':!![]}];}_0x9f8202=_[_0x4fbe('0x3f')]({},_0x9f8202,_0x1fa2d5['options']);return db[_0x4fbe('0x2e')][_0x4fbe('0x46')](_0x9f8202)[_0x4fbe('0x26')](handleEntityNotFound(_0x7abca,null))['then'](respondWithResult(_0x7abca,null))[_0x4fbe('0x47')](handleError(_0x7abca,null));};exports[_0x4fbe('0x48')]=function(_0x5ad137,_0xfa008e){return db['VoiceMailMessage']['create'](_0x5ad137[_0x4fbe('0x49')],{})['then'](respondWithResult(_0xfa008e,0xc9))['catch'](handleError(_0xfa008e,null));};exports['update']=function(_0x1817c8,_0x157a20){if(_0x1817c8['body']['id']){delete _0x1817c8[_0x4fbe('0x49')]['id'];}return db[_0x4fbe('0x2e')][_0x4fbe('0x46')]({'where':{'id':_0x1817c8[_0x4fbe('0x4a')]['id']}})[_0x4fbe('0x26')](handleEntityNotFound(_0x157a20,null))[_0x4fbe('0x26')](saveUpdates(_0x1817c8[_0x4fbe('0x49')],null))[_0x4fbe('0x26')](respondWithResult(_0x157a20,null))['catch'](handleError(_0x157a20,null));};exports['destroy']=function(_0x550af6,_0x2be6c2){return db[_0x4fbe('0x2e')][_0x4fbe('0x46')]({'where':{'id':_0x550af6['params']['id']}})[_0x4fbe('0x26')](handleEntityNotFound(_0x2be6c2,null))['then'](removeEntity(_0x2be6c2,null))[_0x4fbe('0x47')](handleError(_0x2be6c2,null));};exports[_0x4fbe('0x4b')]=function(_0x49beb3,_0x3e057a,_0x2c9171){return db[_0x4fbe('0x2e')][_0x4fbe('0x46')]({'where':{'id':_0x49beb3[_0x4fbe('0x4a')]['id']},'attributes':['id',_0x4fbe('0x4c'),_0x4fbe('0x4d')]})[_0x4fbe('0x26')](handleEntityNotFound(_0x3e057a,null))[_0x4fbe('0x26')](function(_0x5486fc){if(_0x5486fc){if(!_0x5486fc[_0x4fbe('0x4c')]){throw new db[(_0x4fbe('0x4e'))][(_0x4fbe('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0xfb445d={'Content-Type':_0x4fbe('0x50'),'Content-Disposition':_0x4fbe('0x51')};if(_0x5486fc[_0x4fbe('0x4d')]){_0xfb445d[_0x4fbe('0x52')]=_0x4fbe('0x53')+_0x5486fc[_0x4fbe('0x4d')]+'.wav\x22';}_0x3e057a[_0x4fbe('0x22')](_0xfb445d);return _0x3e057a[_0x4fbe('0x2b')](new Buffer(_0x5486fc[_0x4fbe('0x4c')]));}})[_0x4fbe('0x47')](handleError(_0x3e057a,null));};
\ No newline at end of file
+var _0xf3b9=['Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','update','body','download','recording','msg_id','Sequelize','ValidationError','attachment'];(function(_0x4e9ca1,_0x743d97){var _0x7bbccf=function(_0x2b40e1){while(--_0x2b40e1){_0x4e9ca1['push'](_0x4e9ca1['shift']());}};_0x7bbccf(++_0x743d97);}(_0xf3b9,0xfc));var _0x9f3b=function(_0x24062c,_0x4f2170){_0x24062c=_0x24062c-0x0;var _0x358274=_0xf3b9[_0x24062c];return _0x358274;};'use strict';var emlformat=require(_0x9f3b('0x0'));var rimraf=require(_0x9f3b('0x1'));var zipdir=require(_0x9f3b('0x2'));var jsonpatch=require(_0x9f3b('0x3'));var rp=require(_0x9f3b('0x4'));var moment=require('moment');var BPromise=require(_0x9f3b('0x5'));var Mustache=require(_0x9f3b('0x6'));var util=require(_0x9f3b('0x7'));var path=require(_0x9f3b('0x8'));var sox=require(_0x9f3b('0x9'));var csv=require(_0x9f3b('0xa'));var ejs=require(_0x9f3b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f3b('0xc'));var squel=require(_0x9f3b('0xd'));var crypto=require(_0x9f3b('0xe'));var jsforce=require(_0x9f3b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9f3b('0xa'));var querystring=require('querystring');var Papa=require(_0x9f3b('0x10'));var Redis=require(_0x9f3b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f3b('0x12'));var as=require(_0x9f3b('0x13'));var hardwareService=require(_0x9f3b('0x14'));var logger=require(_0x9f3b('0x15'))(_0x9f3b('0x16'));var utils=require(_0x9f3b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9f3b('0x18'))['db'];function respondWithStatusCode(_0x91361c,_0x4d03eb){_0x4d03eb=_0x4d03eb||0xcc;return function(_0x2bbeae){if(_0x2bbeae){return _0x91361c[_0x9f3b('0x19')](_0x4d03eb);}return _0x91361c['status'](_0x4d03eb)[_0x9f3b('0x1a')]();};}function respondWithResult(_0x283fa9,_0x470b15){_0x470b15=_0x470b15||0xc8;return function(_0x28439b){if(_0x28439b){return _0x283fa9[_0x9f3b('0x1b')](_0x470b15)[_0x9f3b('0x1c')](_0x28439b);}};}function respondWithFilteredResult(_0x4043f6,_0x5189f3){return function(_0x2f653e){if(_0x2f653e){var _0x4fe5ae=typeof _0x5189f3[_0x9f3b('0x1d')]===_0x9f3b('0x1e')&&typeof _0x5189f3[_0x9f3b('0x1f')]===_0x9f3b('0x1e');var _0x5cb341=_0x2f653e[_0x9f3b('0x20')];var _0x128d8b=_0x4fe5ae?0x0:_0x5189f3['offset'];var _0x186a89=_0x4fe5ae?_0x2f653e['count']:_0x5189f3[_0x9f3b('0x1d')]+_0x5189f3[_0x9f3b('0x1f')];var _0x20d6f5;if(_0x186a89>=_0x5cb341){_0x186a89=_0x5cb341;_0x20d6f5=0xc8;}else{_0x20d6f5=0xce;}_0x4043f6[_0x9f3b('0x1b')](_0x20d6f5);return _0x4043f6[_0x9f3b('0x21')]('Content-Range',_0x128d8b+'-'+_0x186a89+'/'+_0x5cb341)[_0x9f3b('0x1c')](_0x2f653e);}return null;};}function patchUpdates(_0x117c54){return function(_0x1e48a9){try{jsonpatch['apply'](_0x1e48a9,_0x117c54,!![]);}catch(_0x22d012){return BPromise[_0x9f3b('0x22')](_0x22d012);}return _0x1e48a9[_0x9f3b('0x23')]();};}function saveUpdates(_0xf7a8cb,_0x1bc766){return function(_0x131044){if(_0x131044){return _0x131044['update'](_0xf7a8cb)[_0x9f3b('0x24')](function(_0x392ccc){return _0x392ccc;});}return null;};}function removeEntity(_0x38c1bf,_0x47c95f){return function(_0x495f0c){if(_0x495f0c){return _0x495f0c[_0x9f3b('0x25')]()[_0x9f3b('0x24')](function(){_0x38c1bf[_0x9f3b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b736f,_0x5a0a79){return function(_0x42877a){if(!_0x42877a){_0x4b736f[_0x9f3b('0x19')](0x194);}return _0x42877a;};}function handleError(_0x522a56,_0x38d5ce){_0x38d5ce=_0x38d5ce||0x1f4;return function(_0x335d2a){logger[_0x9f3b('0x26')](_0x335d2a[_0x9f3b('0x27')]);if(_0x335d2a[_0x9f3b('0x28')]){delete _0x335d2a[_0x9f3b('0x28')];}_0x522a56[_0x9f3b('0x1b')](_0x38d5ce)[_0x9f3b('0x29')](_0x335d2a);};}exports[_0x9f3b('0x2a')]=function(_0x35f95a,_0x3e6f3c){var _0x294f37={},_0x1d101b={},_0x600c5b={'count':0x0,'rows':[]};var _0x4a0c04=_[_0x9f3b('0x2b')](db[_0x9f3b('0x2c')][_0x9f3b('0x2d')],function(_0x4faf5e){return{'name':_0x4faf5e[_0x9f3b('0x2e')],'type':_0x4faf5e['type']['key']};});_0x1d101b['model']=_['differenceBy'](_[_0x9f3b('0x2b')](_0x4a0c04,'name'),[_0x9f3b('0x28')]);_0x1d101b[_0x9f3b('0x2f')]=_[_0x9f3b('0x30')](_0x35f95a['query']);_0x1d101b['filters']=_['intersection'](_0x1d101b[_0x9f3b('0x31')],_0x1d101b[_0x9f3b('0x2f')]);_0x294f37[_0x9f3b('0x32')]=_[_0x9f3b('0x33')](_0x1d101b[_0x9f3b('0x31')],qs[_0x9f3b('0x34')](_0x35f95a['query'][_0x9f3b('0x34')]));_0x294f37[_0x9f3b('0x32')]=_0x294f37[_0x9f3b('0x32')]['length']?_0x294f37['attributes']:_0x1d101b['model'];if(!_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x35')](_0x9f3b('0x36'))){_0x294f37['limit']=qs[_0x9f3b('0x1f')](_0x35f95a['query']['limit']);_0x294f37[_0x9f3b('0x1d')]=qs['offset'](_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x1d')]);}_0x294f37[_0x9f3b('0x37')]=qs['sort'](_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x38')]);_0x294f37[_0x9f3b('0x39')]=qs['filters'](_['pick'](_0x35f95a[_0x9f3b('0x2f')],_0x1d101b['filters']),_0x4a0c04);if(_0x35f95a[_0x9f3b('0x2f')]['filter']){_0x294f37[_0x9f3b('0x39')]=_[_0x9f3b('0x3a')](_0x294f37[_0x9f3b('0x39')],{'$or':_['map'](_0x4a0c04,function(_0x21d297){if(_0x21d297['type']!==_0x9f3b('0x3b')){var _0x4e3c20={};_0x4e3c20[_0x21d297[_0x9f3b('0x28')]]={'$like':'%'+_0x35f95a[_0x9f3b('0x2f')][_0x9f3b('0x3c')]+'%'};return _0x4e3c20;}})});}_0x294f37=_['merge']({},_0x294f37,_0x35f95a[_0x9f3b('0x3d')]);var _0x3d057f={'where':_0x294f37[_0x9f3b('0x39')]};return db[_0x9f3b('0x2c')]['count'](_0x3d057f)[_0x9f3b('0x24')](function(_0x2cb06b){_0x600c5b[_0x9f3b('0x20')]=_0x2cb06b;if(_0x35f95a[_0x9f3b('0x2f')]['includeAll']){_0x294f37[_0x9f3b('0x3e')]=[{'all':!![]}];}return db[_0x9f3b('0x2c')][_0x9f3b('0x3f')](_0x294f37);})['then'](function(_0x506c66){_0x600c5b[_0x9f3b('0x40')]=_0x506c66;return _0x600c5b;})[_0x9f3b('0x24')](respondWithFilteredResult(_0x3e6f3c,_0x294f37))[_0x9f3b('0x41')](handleError(_0x3e6f3c,null));};exports[_0x9f3b('0x42')]=function(_0x1789a8,_0x27f56b){var _0x15120c={'raw':!![],'where':{'id':_0x1789a8[_0x9f3b('0x43')]['id']}},_0x566a30={};_0x566a30[_0x9f3b('0x31')]=_['keys'](db[_0x9f3b('0x2c')][_0x9f3b('0x2d')]);_0x566a30['query']=_['keys'](_0x1789a8['query']);_0x566a30['filters']=_[_0x9f3b('0x33')](_0x566a30[_0x9f3b('0x31')],_0x566a30[_0x9f3b('0x2f')]);_0x15120c[_0x9f3b('0x32')]=_['intersection'](_0x566a30[_0x9f3b('0x31')],qs[_0x9f3b('0x34')](_0x1789a8[_0x9f3b('0x2f')][_0x9f3b('0x34')]));_0x15120c[_0x9f3b('0x32')]=_0x15120c[_0x9f3b('0x32')][_0x9f3b('0x44')]?_0x15120c['attributes']:_0x566a30[_0x9f3b('0x31')];if(_0x1789a8[_0x9f3b('0x2f')][_0x9f3b('0x45')]){_0x15120c['include']=[{'all':!![]}];}_0x15120c=_[_0x9f3b('0x3a')]({},_0x15120c,_0x1789a8[_0x9f3b('0x3d')]);return db[_0x9f3b('0x2c')][_0x9f3b('0x46')](_0x15120c)[_0x9f3b('0x24')](handleEntityNotFound(_0x27f56b,null))['then'](respondWithResult(_0x27f56b,null))[_0x9f3b('0x41')](handleError(_0x27f56b,null));};exports[_0x9f3b('0x47')]=function(_0xbdcc80,_0x3613c7){return db[_0x9f3b('0x2c')][_0x9f3b('0x47')](_0xbdcc80['body'],{})[_0x9f3b('0x24')](respondWithResult(_0x3613c7,0xc9))['catch'](handleError(_0x3613c7,null));};exports[_0x9f3b('0x48')]=function(_0x5685c3,_0x2f80b3){if(_0x5685c3['body']['id']){delete _0x5685c3[_0x9f3b('0x49')]['id'];}return db[_0x9f3b('0x2c')][_0x9f3b('0x46')]({'where':{'id':_0x5685c3[_0x9f3b('0x43')]['id']}})[_0x9f3b('0x24')](handleEntityNotFound(_0x2f80b3,null))['then'](saveUpdates(_0x5685c3[_0x9f3b('0x49')],null))[_0x9f3b('0x24')](respondWithResult(_0x2f80b3,null))[_0x9f3b('0x41')](handleError(_0x2f80b3,null));};exports['destroy']=function(_0x32f51f,_0x3eab80){return db[_0x9f3b('0x2c')][_0x9f3b('0x46')]({'where':{'id':_0x32f51f[_0x9f3b('0x43')]['id']}})[_0x9f3b('0x24')](handleEntityNotFound(_0x3eab80,null))[_0x9f3b('0x24')](removeEntity(_0x3eab80,null))[_0x9f3b('0x41')](handleError(_0x3eab80,null));};exports[_0x9f3b('0x4a')]=function(_0x3d0612,_0xaab74c,_0x59a4c2){return db[_0x9f3b('0x2c')]['find']({'where':{'id':_0x3d0612[_0x9f3b('0x43')]['id']},'attributes':['id',_0x9f3b('0x4b'),_0x9f3b('0x4c')]})[_0x9f3b('0x24')](handleEntityNotFound(_0xaab74c,null))[_0x9f3b('0x24')](function(_0x3b94c4){if(_0x3b94c4){if(!_0x3b94c4[_0x9f3b('0x4b')]){throw new db[(_0x9f3b('0x4d'))][(_0x9f3b('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x405b76={'Content-Type':'audio/wav','Content-Disposition':_0x9f3b('0x4f')};if(_0x3b94c4[_0x9f3b('0x4c')]){_0x405b76[_0x9f3b('0x50')]=_0x9f3b('0x51')+_0x3b94c4['msg_id']+_0x9f3b('0x52');}_0xaab74c[_0x9f3b('0x21')](_0x405b76);return _0xaab74c[_0x9f3b('0x29')](new Buffer(_0x3b94c4['recording']));}})[_0x9f3b('0x41')](handleError(_0xaab74c,null));};
\ No newline at end of file
index 39b0ba3..4c8f28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad1d=['voice_voicemail_messages','dir','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x41c3c9,_0x4c196f){var _0x390bb5=function(_0x253846){while(--_0x253846){_0x41c3c9['push'](_0x41c3c9['shift']());}};_0x390bb5(++_0x4c196f);}(_0xad1d,0x1af));var _0xdad1=function(_0x67f95e,_0x3ca797){_0x67f95e=_0x67f95e-0x0;var _0x538f5a=_0xad1d[_0x67f95e];return _0x538f5a;};'use strict';var _=require('lodash');var util=require(_0xdad1('0x0'));var logger=require(_0xdad1('0x1'))(_0xdad1('0x2'));var moment=require('moment');var BPromise=require(_0xdad1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdad1('0x4'));var config=require(_0xdad1('0x5'));var attributes=require(_0xdad1('0x6'));module['exports']=function(_0x1fa2ac,_0x227234){return _0x1fa2ac[_0xdad1('0x7')](_0xdad1('0x8'),attributes,{'tableName':_0xdad1('0x9'),'paranoid':![],'indexes':[{'name':_0xdad1('0xa'),'fields':[_0xdad1('0xa')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x21e2=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x21e2,0x1e6));var _0x221e=function(_0x3fc8c2,_0x1f3bb1){_0x3fc8c2=_0x3fc8c2-0x0;var _0x23da6f=_0x21e2[_0x3fc8c2];return _0x23da6f;};'use strict';var _=require('lodash');var util=require(_0x221e('0x0'));var logger=require(_0x221e('0x1'))(_0x221e('0x2'));var moment=require('moment');var BPromise=require(_0x221e('0x3'));var rp=require(_0x221e('0x4'));var fs=require('fs');var path=require(_0x221e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x221e('0x6'));module[_0x221e('0x7')]=function(_0xbe0d1a,_0x48fb9d){return _0xbe0d1a[_0x221e('0x8')](_0x221e('0x9'),attributes,{'tableName':_0x221e('0xa'),'paranoid':![],'indexes':[{'name':_0x221e('0xb'),'fields':[_0x221e('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 9f95cf9..fca5831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19be=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x19be,0xe6));var _0xe19b=function(_0x386dc3,_0x55748f){_0x386dc3=_0x386dc3-0x0;var _0x418830=_0x19be[_0x386dc3];return _0x418830;};'use strict';var _=require(_0xe19b('0x0'));var util=require(_0xe19b('0x1'));var moment=require(_0xe19b('0x2'));var BPromise=require(_0xe19b('0x3'));var rs=require(_0xe19b('0x4'));var fs=require('fs');var Redis=require(_0xe19b('0x5'));var db=require(_0xe19b('0x6'))['db'];var utils=require(_0xe19b('0x7'));var logger=require(_0xe19b('0x8'))(_0xe19b('0x9'));var config=require(_0xe19b('0xa'));var jayson=require(_0xe19b('0xb'));var client=jayson['client'][_0xe19b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50e500,_0x1a5063,_0x29f7ca){return new BPromise(function(_0x405f,_0x476b2b){return client[_0xe19b('0xd')](_0x50e500,_0x29f7ca)[_0xe19b('0xe')](function(_0x478e4a){logger[_0xe19b('0xf')](_0xe19b('0x10'),_0x1a5063,_0xe19b('0x11'));logger[_0xe19b('0x12')](_0xe19b('0x13'),_0x1a5063,_0xe19b('0x11'),JSON[_0xe19b('0x14')](_0x478e4a));if(_0x478e4a[_0xe19b('0x15')]){if(_0x478e4a[_0xe19b('0x15')][_0xe19b('0x16')]===0x1f4){logger[_0xe19b('0x15')](_0xe19b('0x10'),_0x1a5063,_0x478e4a[_0xe19b('0x15')][_0xe19b('0x17')]);return _0x476b2b(_0x478e4a['error'][_0xe19b('0x17')]);}logger[_0xe19b('0x15')](_0xe19b('0x10'),_0x1a5063,_0x478e4a[_0xe19b('0x15')][_0xe19b('0x17')]);return _0x405f(_0x478e4a[_0xe19b('0x15')]['message']);}else{logger[_0xe19b('0xf')](_0xe19b('0x10'),_0x1a5063,_0xe19b('0x11'));_0x405f(_0x478e4a[_0xe19b('0x18')][_0xe19b('0x17')]);}})[_0xe19b('0x19')](function(_0x1f8bec){logger[_0xe19b('0x15')]('VoiceMailMessage,\x20%s,\x20%s',_0x1a5063,_0x1f8bec);_0x476b2b(_0x1f8bec);});});}
\ No newline at end of file
+var _0xc02f=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x22ed26,_0x3e6127){var _0x3e9dbe=function(_0x37a2ec){while(--_0x37a2ec){_0x22ed26['push'](_0x22ed26['shift']());}};_0x3e9dbe(++_0x3e6127);}(_0xc02f,0x177));var _0xfc02=function(_0x63cb4a,_0x4b7c1a){_0x63cb4a=_0x63cb4a-0x0;var _0x38ac49=_0xc02f[_0x63cb4a];return _0x38ac49;};'use strict';var _=require(_0xfc02('0x0'));var util=require('util');var moment=require(_0xfc02('0x1'));var BPromise=require(_0xfc02('0x2'));var rs=require(_0xfc02('0x3'));var fs=require('fs');var Redis=require(_0xfc02('0x4'));var db=require(_0xfc02('0x5'))['db'];var utils=require(_0xfc02('0x6'));var logger=require(_0xfc02('0x7'))(_0xfc02('0x8'));var config=require(_0xfc02('0x9'));var jayson=require(_0xfc02('0xa'));var client=jayson[_0xfc02('0xb')][_0xfc02('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x543c92,_0x8a10d1,_0x2ff68f){return new BPromise(function(_0x37196d,_0x515310){return client[_0xfc02('0xd')](_0x543c92,_0x2ff68f)[_0xfc02('0xe')](function(_0x3c4780){logger[_0xfc02('0xf')](_0xfc02('0x10'),_0x8a10d1,_0xfc02('0x11'));logger[_0xfc02('0x12')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x8a10d1,_0xfc02('0x11'),JSON[_0xfc02('0x13')](_0x3c4780));if(_0x3c4780[_0xfc02('0x14')]){if(_0x3c4780[_0xfc02('0x14')][_0xfc02('0x15')]===0x1f4){logger[_0xfc02('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x8a10d1,_0x3c4780[_0xfc02('0x14')][_0xfc02('0x16')]);return _0x515310(_0x3c4780[_0xfc02('0x14')][_0xfc02('0x16')]);}logger[_0xfc02('0x14')](_0xfc02('0x10'),_0x8a10d1,_0x3c4780[_0xfc02('0x14')][_0xfc02('0x16')]);return _0x37196d(_0x3c4780[_0xfc02('0x14')]['message']);}else{logger[_0xfc02('0xf')](_0xfc02('0x10'),_0x8a10d1,_0xfc02('0x11'));_0x37196d(_0x3c4780['result'][_0xfc02('0x16')]);}})['catch'](function(_0x22b742){logger['error'](_0xfc02('0x10'),_0x8a10d1,_0x22b742);_0x515310(_0x22b742);});});}
\ No newline at end of file
index 96b6506..9f7f462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf012=['/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','getSounds','create','/:id/sounds','addSound','put','update','delete','destroy'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf012,0x1bd));var _0x2f01=function(_0x12f7d1,_0xea85b3){_0x12f7d1=_0x12f7d1-0x0;var _0x17a408=_0xf012[_0x12f7d1];return _0x17a408;};'use strict';var multer=require(_0x2f01('0x0'));var util=require('util');var path=require(_0x2f01('0x1'));var timeout=require(_0x2f01('0x2'));var express=require(_0x2f01('0x3'));var router=express[_0x2f01('0x4')]();var fs_extra=require(_0x2f01('0x5'));var auth=require(_0x2f01('0x6'));var interaction=require(_0x2f01('0x7'));var config=require(_0x2f01('0x8'));var controller=require(_0x2f01('0x9'));router['get']('/',auth[_0x2f01('0xa')](),controller[_0x2f01('0xb')]);router[_0x2f01('0xc')](_0x2f01('0xd'),auth[_0x2f01('0xa')](),controller[_0x2f01('0xe')]);router['get']('/:id/sounds',auth['isAuthenticated'](),controller[_0x2f01('0xf')]);router['post']('/',auth[_0x2f01('0xa')](),controller[_0x2f01('0x10')]);router['post'](_0x2f01('0x11'),auth[_0x2f01('0xa')](),controller[_0x2f01('0x12')]);router[_0x2f01('0x13')](_0x2f01('0xd'),auth['isAuthenticated'](),controller[_0x2f01('0x14')]);router[_0x2f01('0x15')](_0x2f01('0xd'),auth[_0x2f01('0xa')](),controller[_0x2f01('0x16')]);router['delete'](_0x2f01('0x17'),auth[_0x2f01('0xa')](),controller[_0x2f01('0x18')]);module[_0x2f01('0x19')]=router;
\ No newline at end of file
+var _0x2c1a=['Router','fs-extra','../../components/auth/service','isAuthenticated','get','/:id','show','/:id/sounds','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','multer','path','express'];(function(_0x495919,_0xae6861){var _0x3bcfad=function(_0x4387c1){while(--_0x4387c1){_0x495919['push'](_0x495919['shift']());}};_0x3bcfad(++_0xae6861);}(_0x2c1a,0x12d));var _0xa2c1=function(_0x344f62,_0x4bd138){_0x344f62=_0x344f62-0x0;var _0x191372=_0x2c1a[_0x344f62];return _0x191372;};'use strict';var multer=require(_0xa2c1('0x0'));var util=require('util');var path=require(_0xa2c1('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2c1('0x2'));var router=express[_0xa2c1('0x3')]();var fs_extra=require(_0xa2c1('0x4'));var auth=require(_0xa2c1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router['get']('/',auth[_0xa2c1('0x6')](),controller['index']);router[_0xa2c1('0x7')](_0xa2c1('0x8'),auth[_0xa2c1('0x6')](),controller[_0xa2c1('0x9')]);router[_0xa2c1('0x7')](_0xa2c1('0xa'),auth[_0xa2c1('0x6')](),controller['getSounds']);router[_0xa2c1('0xb')]('/',auth[_0xa2c1('0x6')](),controller['create']);router['post'](_0xa2c1('0xa'),auth[_0xa2c1('0x6')](),controller[_0xa2c1('0xc')]);router[_0xa2c1('0xd')](_0xa2c1('0x8'),auth['isAuthenticated'](),controller[_0xa2c1('0xe')]);router[_0xa2c1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa2c1('0x10')]);router['delete'](_0xa2c1('0x11'),auth[_0xa2c1('0x6')](),controller['removeSound']);module[_0xa2c1('0x12')]=router;
\ No newline at end of file
index f9bcf70..4ebf1de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f04=['sequelize','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','BOOLEAN'];(function(_0x40d22e,_0x1d6001){var _0x52587d=function(_0x3f48b6){while(--_0x3f48b6){_0x40d22e['push'](_0x40d22e['shift']());}};_0x52587d(++_0x1d6001);}(_0x4f04,0x138));var _0x44f0=function(_0x14d117,_0x1b8399){_0x14d117=_0x14d117-0x0;var _0x28a0d3=_0x4f04[_0x14d117];return _0x28a0d3;};'use strict';var Sequelize=require(_0x44f0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x44f0('0x1')},'mode':{'type':Sequelize[_0x44f0('0x2')](_0x44f0('0x3'),_0x44f0('0x4'),_0x44f0('0x5'),_0x44f0('0x6'),_0x44f0('0x7'),_0x44f0('0x8')),'allowNull':!![],'defaultValue':_0x44f0('0x4')},'directory':{'type':Sequelize[_0x44f0('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x44f0('0x9')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x44f0('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x44f0('0xa')},'defaultEntry':{'type':Sequelize[_0x44f0('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe08a=['exports','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','STRING','TIMESTAMP','sequelize'];(function(_0x52af16,_0x59cb6f){var _0x7e642c=function(_0x2c0ccc){while(--_0x2c0ccc){_0x52af16['push'](_0x52af16['shift']());}};_0x7e642c(++_0x59cb6f);}(_0xe08a,0xba));var _0xae08=function(_0x3eb421,_0x424022){_0x3eb421=_0x3eb421-0x0;var _0x3cb848=_0xe08a[_0x3eb421];return _0x3cb848;};'use strict';var Sequelize=require(_0xae08('0x0'));module[_0xae08('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xae08('0x2')},'mode':{'type':Sequelize[_0xae08('0x3')](_0xae08('0x4'),_0xae08('0x5'),'mp3nb',_0xae08('0x6'),_0xae08('0x7'),_0xae08('0x8')),'allowNull':!![],'defaultValue':_0xae08('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xae08('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xae08('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xae08('0x9')],'allowNull':!![]},'stamp':{'type':_0xae08('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index 068246d..2cb0251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdad9=['pick','filter','merge','type','VIRTUAL','options','rows','show','params','length','include','find','catch','update','body','create','sequelize','transaction','mode','files','root','mkdirSync','directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','readdirSync','forEach','join','rmdirSync','ValidationError','addSound','save_name','converted_format','createdAt','format','%s.%s','basename','extname','server/files/moh','symlinkSync','Sequelize','message','removeSound','findOne','id2','unlinkSync','getSounds','Sound','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x435982,_0x517d82){var _0x2889fe=function(_0x343fa5){while(--_0x343fa5){_0x435982['push'](_0x435982['shift']());}};_0x2889fe(++_0x517d82);}(_0xdad9,0x118));var _0x9dad=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdad9[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x9dad('0x0'));var rimraf=require(_0x9dad('0x1'));var zipdir=require(_0x9dad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9dad('0x3'));var util=require(_0x9dad('0x4'));var path=require(_0x9dad('0x5'));var sox=require(_0x9dad('0x6'));var csv=require(_0x9dad('0x7'));var ejs=require(_0x9dad('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dad('0x9'));var crypto=require(_0x9dad('0xa'));var jsforce=require(_0x9dad('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9dad('0x7'));var querystring=require(_0x9dad('0xc'));var Papa=require(_0x9dad('0xd'));var Redis=require('ioredis');var authService=require(_0x9dad('0xe'));var qs=require(_0x9dad('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9dad('0x10'))(_0x9dad('0x11'));var utils=require(_0x9dad('0x12'));var config=require(_0x9dad('0x13'));var licenseUtil=require(_0x9dad('0x14'));var db=require(_0x9dad('0x15'))['db'];function respondWithStatusCode(_0x137845,_0x2574d5){_0x2574d5=_0x2574d5||0xcc;return function(_0x2b3de8){if(_0x2b3de8){return _0x137845[_0x9dad('0x16')](_0x2574d5);}return _0x137845['status'](_0x2574d5)[_0x9dad('0x17')]();};}function respondWithResult(_0x544f11,_0x1cc2c2){_0x1cc2c2=_0x1cc2c2||0xc8;return function(_0x1293ac){if(_0x1293ac){return _0x544f11['status'](_0x1cc2c2)[_0x9dad('0x18')](_0x1293ac);}};}function respondWithFilteredResult(_0x180854,_0x867185){return function(_0x2f61a9){if(_0x2f61a9){var _0x1c9eca=typeof _0x867185[_0x9dad('0x19')]===_0x9dad('0x1a')&&typeof _0x867185['limit']===_0x9dad('0x1a');var _0x3578f6=_0x2f61a9[_0x9dad('0x1b')];var _0x559fb1=_0x1c9eca?0x0:_0x867185[_0x9dad('0x19')];var _0x1eab26=_0x1c9eca?_0x2f61a9[_0x9dad('0x1b')]:_0x867185[_0x9dad('0x19')]+_0x867185[_0x9dad('0x1c')];var _0x587727;if(_0x1eab26>=_0x3578f6){_0x1eab26=_0x3578f6;_0x587727=0xc8;}else{_0x587727=0xce;}_0x180854[_0x9dad('0x1d')](_0x587727);return _0x180854[_0x9dad('0x1e')](_0x9dad('0x1f'),_0x559fb1+'-'+_0x1eab26+'/'+_0x3578f6)[_0x9dad('0x18')](_0x2f61a9);}return null;};}function patchUpdates(_0xcfc986){return function(_0x3fa144){try{jsonpatch[_0x9dad('0x20')](_0x3fa144,_0xcfc986,!![]);}catch(_0x5783d9){return BPromise[_0x9dad('0x21')](_0x5783d9);}return _0x3fa144['save']();};}function saveUpdates(_0x2527ad,_0xaa1d75){return function(_0x292c40){if(_0x292c40){return _0x292c40['update'](_0x2527ad)[_0x9dad('0x22')](function(_0x162dcf){return _0x162dcf;});}return null;};}function removeEntity(_0x4ec4cd,_0x1743e4){return function(_0x244aad){if(_0x244aad){return _0x244aad['destroy']()[_0x9dad('0x22')](function(){var _0x109093=_0x244aad[_0x9dad('0x23')]({'plain':!![]});var _0x1f809a='MusicOnHolds';return db[_0x9dad('0x24')][_0x9dad('0x25')]({'where':{'type':_0x1f809a,'resourceId':_0x109093['id']}})['then'](function(){return _0x244aad;});})['then'](function(){_0x4ec4cd['status'](0xcc)[_0x9dad('0x17')]();});}};}function handleEntityNotFound(_0x202d9f,_0x14e171){return function(_0xec654a){if(!_0xec654a){_0x202d9f['sendStatus'](0x194);}return _0xec654a;};}function handleError(_0x56d73e,_0x13bb65){_0x13bb65=_0x13bb65||0x1f4;return function(_0x19b75f){logger[_0x9dad('0x26')](_0x19b75f[_0x9dad('0x27')]);if(_0x19b75f['name']){delete _0x19b75f[_0x9dad('0x28')];}_0x56d73e['status'](_0x13bb65)[_0x9dad('0x29')](_0x19b75f);};}exports['index']=function(_0x3c4550,_0x4575e0){var _0x410e80={},_0x3f42b4={},_0x53e29a={'count':0x0,'rows':[]};var _0x8cfaef=_[_0x9dad('0x2a')](db[_0x9dad('0x2b')][_0x9dad('0x2c')],function(_0x16bc5a){return{'name':_0x16bc5a[_0x9dad('0x2d')],'type':_0x16bc5a['type'][_0x9dad('0x2e')]};});_0x3f42b4[_0x9dad('0x2f')]=_[_0x9dad('0x2a')](_0x8cfaef,_0x9dad('0x28'));_0x3f42b4[_0x9dad('0x30')]=_[_0x9dad('0x31')](_0x3c4550[_0x9dad('0x30')]);_0x3f42b4[_0x9dad('0x32')]=_[_0x9dad('0x33')](_0x3f42b4[_0x9dad('0x2f')],_0x3f42b4[_0x9dad('0x30')]);_0x410e80[_0x9dad('0x34')]=_['intersection'](_0x3f42b4[_0x9dad('0x2f')],qs[_0x9dad('0x35')](_0x3c4550[_0x9dad('0x30')]['fields']));_0x410e80[_0x9dad('0x34')]=_0x410e80['attributes']['length']?_0x410e80['attributes']:_0x3f42b4[_0x9dad('0x2f')];if(!_0x3c4550[_0x9dad('0x30')][_0x9dad('0x36')](_0x9dad('0x37'))){_0x410e80['limit']=qs['limit'](_0x3c4550[_0x9dad('0x30')][_0x9dad('0x1c')]);_0x410e80[_0x9dad('0x19')]=qs[_0x9dad('0x19')](_0x3c4550['query'][_0x9dad('0x19')]);}_0x410e80[_0x9dad('0x38')]=qs['sort'](_0x3c4550[_0x9dad('0x30')][_0x9dad('0x39')]);delete _0x3c4550[_0x9dad('0x30')][_0x9dad('0x39')];_0x410e80[_0x9dad('0x3a')]=qs[_0x9dad('0x32')](_[_0x9dad('0x3b')](_0x3c4550[_0x9dad('0x30')],_0x3f42b4[_0x9dad('0x32')]),_0x8cfaef);if(_0x3c4550[_0x9dad('0x30')][_0x9dad('0x3c')]){_0x410e80[_0x9dad('0x3a')]=_[_0x9dad('0x3d')](_0x410e80[_0x9dad('0x3a')],{'$or':_['map'](_0x8cfaef,function(_0x59f7af){if(_0x59f7af[_0x9dad('0x3e')]!==_0x9dad('0x3f')){var _0x134d9d={};_0x134d9d[_0x59f7af[_0x9dad('0x28')]]={'$like':'%'+_0x3c4550[_0x9dad('0x30')][_0x9dad('0x3c')]+'%'};return _0x134d9d;}})});}_0x410e80=_[_0x9dad('0x3d')]({},_0x410e80,_0x3c4550[_0x9dad('0x40')]);var _0x5ddaae={'where':_0x410e80[_0x9dad('0x3a')]};return db[_0x9dad('0x2b')][_0x9dad('0x1b')](_0x5ddaae)[_0x9dad('0x22')](function(_0x1b12de){_0x53e29a['count']=_0x1b12de;if(_0x3c4550[_0x9dad('0x30')]['includeAll']){_0x410e80['include']=[{'all':!![]}];}return db[_0x9dad('0x2b')]['findAll'](_0x410e80);})['then'](function(_0x22c4b4){_0x53e29a[_0x9dad('0x41')]=_0x22c4b4;return _0x53e29a;})['then'](respondWithFilteredResult(_0x4575e0,_0x410e80))['catch'](handleError(_0x4575e0,null));};exports[_0x9dad('0x42')]=function(_0x2545f2,_0x5bf552){var _0x4b28d5={'raw':![],'where':{'id':_0x2545f2[_0x9dad('0x43')]['id']}},_0x1439c3={};_0x1439c3[_0x9dad('0x2f')]=_[_0x9dad('0x31')](db[_0x9dad('0x2b')][_0x9dad('0x2c')]);_0x1439c3[_0x9dad('0x30')]=_[_0x9dad('0x31')](_0x2545f2[_0x9dad('0x30')]);_0x1439c3[_0x9dad('0x32')]=_['intersection'](_0x1439c3[_0x9dad('0x2f')],_0x1439c3['query']);_0x4b28d5['attributes']=_[_0x9dad('0x33')](_0x1439c3[_0x9dad('0x2f')],qs[_0x9dad('0x35')](_0x2545f2['query'][_0x9dad('0x35')]));_0x4b28d5[_0x9dad('0x34')]=_0x4b28d5[_0x9dad('0x34')][_0x9dad('0x44')]?_0x4b28d5['attributes']:_0x1439c3[_0x9dad('0x2f')];if(_0x2545f2['query']['includeAll']){_0x4b28d5[_0x9dad('0x45')]=[{'all':!![]}];}_0x4b28d5=_[_0x9dad('0x3d')]({},_0x4b28d5,_0x2545f2[_0x9dad('0x40')]);return db[_0x9dad('0x2b')][_0x9dad('0x46')](_0x4b28d5)[_0x9dad('0x22')](handleEntityNotFound(_0x5bf552,null))['then'](respondWithResult(_0x5bf552,null))[_0x9dad('0x47')](handleError(_0x5bf552,null));};exports[_0x9dad('0x48')]=function(_0x4908f9,_0x200cce){if(_0x4908f9[_0x9dad('0x49')]['id']){delete _0x4908f9[_0x9dad('0x49')]['id'];}return db[_0x9dad('0x2b')]['find']({'where':{'id':_0x4908f9[_0x9dad('0x43')]['id']}})[_0x9dad('0x22')](handleEntityNotFound(_0x200cce,null))[_0x9dad('0x22')](saveUpdates(_0x4908f9[_0x9dad('0x49')],null))[_0x9dad('0x22')](respondWithResult(_0x200cce,null))[_0x9dad('0x47')](handleError(_0x200cce,null));};exports[_0x9dad('0x4a')]=function(_0x5066c7,_0x506768,_0x31e4c8){return db[_0x9dad('0x4b')][_0x9dad('0x4c')](function(_0x73c6c){if(_0x5066c7[_0x9dad('0x49')][_0x9dad('0x4d')]===_0x9dad('0x4e')){_0x5066c7[_0x9dad('0x49')]['directory']=path['join'](config[_0x9dad('0x4f')],'server/files/moh',_0x5066c7[_0x9dad('0x49')]['name']);}return db[_0x9dad('0x2b')]['create'](_0x5066c7[_0x9dad('0x49')],{'transaction':_0x73c6c})[_0x9dad('0x22')](function(_0xd78e43){if(_0x5066c7[_0x9dad('0x49')]['mode']===_0x9dad('0x4e')){fs[_0x9dad('0x50')](_0xd78e43[_0x9dad('0x51')],parseInt(_0x9dad('0x52'),0x8));}var _0x18fbe2=_0x5066c7['user']['get']({'plain':!![]});if(!_0x18fbe2)throw new Error(_0x9dad('0x53'));if(_0x18fbe2[_0x9dad('0x54')]===_0x9dad('0x55')){var _0x37c2db=_0xd78e43['get']({'plain':!![]});return db[_0x9dad('0x56')][_0x9dad('0x46')]({'where':{'name':_0x9dad('0x57'),'userProfileId':_0x18fbe2[_0x9dad('0x58')]},'raw':!![]})['then'](function(_0x310678){if(_0x310678&&_0x310678[_0x9dad('0x59')]===0x0){return db[_0x9dad('0x24')][_0x9dad('0x4a')]({'name':_0x37c2db[_0x9dad('0x28')],'resourceId':_0x37c2db['id'],'type':_0x310678[_0x9dad('0x28')],'sectionId':_0x310678['id']},{})[_0x9dad('0x22')](function(){return _0xd78e43;});}else{return _0xd78e43;}})[_0x9dad('0x47')](function(_0x167e8c){logger[_0x9dad('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x167e8c);});}return _0xd78e43;});})[_0x9dad('0x22')](respondWithResult(_0x506768,0xc9))[_0x9dad('0x47')](handleError(_0x506768,null));};exports[_0x9dad('0x25')]=function(_0xd718aa,_0x149bce,_0xb68642){var _0x103454;return db['VoiceMusicOnHold'][_0x9dad('0x46')]({'where':{'id':_0xd718aa['params']['id']}})[_0x9dad('0x22')](function(_0x49ad45){if(_0x49ad45){return db[_0x9dad('0x4b')][_0x9dad('0x4c')](function(_0x1adc2){return _0x49ad45['destroy']({'transaction':_0x1adc2,'raw':!![]})[_0x9dad('0x22')](function(_0x69f702){if(_0x69f702[_0x9dad('0x51')]){fs[_0x9dad('0x5a')](_0x69f702['directory'])[_0x9dad('0x5b')](function(_0x3b9988){fs['unlinkSync'](path[_0x9dad('0x5c')](_0x69f702[_0x9dad('0x51')],_0x3b9988));});fs[_0x9dad('0x5d')](_0x69f702[_0x9dad('0x51')]);}return _0x69f702;});})[_0x9dad('0x47')](function(_0x35e11b){throw new db['Sequelize'][(_0x9dad('0x5e'))](_0x35e11b['message']);});}})['then'](handleEntityNotFound(_0x149bce,null))[_0x9dad('0x22')](removeEntity(_0x149bce,null))[_0x9dad('0x47')](handleError(_0x149bce,null));};exports[_0x9dad('0x5f')]=function(_0x432964,_0x37573b,_0x4bd477){return db[_0x9dad('0x4b')][_0x9dad('0x4c')](function(_0x2ba225){var _0x5db477;return db[_0x9dad('0x2b')][_0x9dad('0x46')]({'where':{'id':_0x432964[_0x9dad('0x43')]['id']}})[_0x9dad('0x22')](function(_0x15bd6a){if(_0x15bd6a){_0x5db477=_0x15bd6a;return _0x15bd6a[_0x9dad('0x5f')](_0x432964[_0x9dad('0x49')]['id'],{'transaction':_0x2ba225});}})[_0x9dad('0x22')](function(_0x48d94b){if(_0x48d94b){return db['Sound']['findOne']({'where':{'id':_0x432964['body']['id']},'attributes':['id','name',_0x9dad('0x60'),_0x9dad('0x61'),_0x9dad('0x62')],'raw':!![]});}})[_0x9dad('0x22')](function(_0x45cce2){if(_0x45cce2){var _0x4b230a=path[_0x9dad('0x5c')](config[_0x9dad('0x4f')],'server/files/sounds/converted',util[_0x9dad('0x63')](_0x9dad('0x64'),path[_0x9dad('0x65')](_0x45cce2[_0x9dad('0x60')],path[_0x9dad('0x66')](_0x45cce2['save_name'])),_0x45cce2[_0x9dad('0x61')]));var _0xbf94bc=path[_0x9dad('0x5c')](config['root'],_0x9dad('0x67'),_0x5db477[_0x9dad('0x28')],util[_0x9dad('0x63')](_0x9dad('0x64'),_0x45cce2[_0x9dad('0x28')],_0x45cce2['converted_format']));fs[_0x9dad('0x68')](_0x4b230a,_0xbf94bc);return _0x45cce2;}})['catch'](function(_0xce6e2d){throw new db[(_0x9dad('0x69'))][(_0x9dad('0x5e'))](_0xce6e2d[_0x9dad('0x6a')]);});})[_0x9dad('0x22')](handleEntityNotFound(_0x37573b,null))[_0x9dad('0x22')](respondWithResult(_0x37573b,0xc9))[_0x9dad('0x47')](handleError(_0x37573b,null));};exports[_0x9dad('0x6b')]=function(_0x46a583,_0x2f7e15,_0x58bfc5){return db['sequelize'][_0x9dad('0x4c')](function(_0x42377e){var _0x1ffa83;return db[_0x9dad('0x2b')][_0x9dad('0x6c')]({'where':{'id':_0x46a583[_0x9dad('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f7e15,null))[_0x9dad('0x22')](function(_0x34fe14){if(_0x34fe14){_0x1ffa83=_0x34fe14;return _0x34fe14[_0x9dad('0x6b')](_0x46a583[_0x9dad('0x43')][_0x9dad('0x6d')]);}})[_0x9dad('0x22')](function(_0x2e4af7){if(_0x2e4af7){return db['Sound'][_0x9dad('0x6c')]({'where':{'id':_0x46a583[_0x9dad('0x43')]['id2']},'attributes':['id','name','save_name',_0x9dad('0x61'),_0x9dad('0x62')],'raw':!![]});}})[_0x9dad('0x22')](function(_0x3be5e4){if(_0x3be5e4){fs[_0x9dad('0x6e')](path[_0x9dad('0x5c')](_0x1ffa83[_0x9dad('0x51')],util['format'](_0x9dad('0x64'),_0x3be5e4[_0x9dad('0x28')],_0x3be5e4[_0x9dad('0x61')])));return _0x3be5e4;}})[_0x9dad('0x47')](function(_0x573b23){throw new db['Sequelize'][(_0x9dad('0x5e'))](_0x573b23[_0x9dad('0x6a')]);});})[_0x9dad('0x22')](handleEntityNotFound(_0x2f7e15,null))[_0x9dad('0x22')](respondWithStatusCode(_0x2f7e15,0xcc))[_0x9dad('0x47')](handleError(_0x2f7e15,null));};exports[_0x9dad('0x6f')]=function(_0x515722,_0x31fd42,_0x483ef9){var _0x31a6e5={};var _0x34541b={};var _0x1c6b5a;var _0x111821;return db[_0x9dad('0x2b')]['findOne']({'where':{'id':_0x515722['params']['id']}})[_0x9dad('0x22')](handleEntityNotFound(_0x31fd42,null))[_0x9dad('0x22')](function(_0x31097a){if(_0x31097a){_0x1c6b5a=_0x31097a;_0x34541b['model']=_[_0x9dad('0x31')](db[_0x9dad('0x70')][_0x9dad('0x2c')]);_0x34541b[_0x9dad('0x30')]=_[_0x9dad('0x31')](_0x515722[_0x9dad('0x30')]);_0x34541b[_0x9dad('0x32')]=_[_0x9dad('0x33')](_0x34541b['model'],_0x34541b[_0x9dad('0x30')]);_0x31a6e5['attributes']=_[_0x9dad('0x33')](_0x34541b[_0x9dad('0x2f')],qs[_0x9dad('0x35')](_0x515722[_0x9dad('0x30')][_0x9dad('0x35')]));_0x31a6e5[_0x9dad('0x34')]=_0x31a6e5[_0x9dad('0x34')][_0x9dad('0x44')]?_0x31a6e5[_0x9dad('0x34')]:_0x34541b['model'];_0x31a6e5[_0x9dad('0x38')]=qs['sort'](_0x515722[_0x9dad('0x30')]['sort']);_0x31a6e5[_0x9dad('0x3a')]=qs['filters'](_['pick'](_0x515722['query'],_0x34541b[_0x9dad('0x32')]));if(_0x515722[_0x9dad('0x30')][_0x9dad('0x3c')]){_0x31a6e5[_0x9dad('0x3a')]=_['merge'](_0x31a6e5[_0x9dad('0x3a')],{'$or':_[_0x9dad('0x2a')](_0x31a6e5[_0x9dad('0x34')],function(_0x506a6a){var _0xe46a73={};_0xe46a73[_0x506a6a]={'$like':'%'+_0x515722[_0x9dad('0x30')]['filter']+'%'};return _0xe46a73;})});}_0x31a6e5=_['merge']({},_0x31a6e5,_0x515722[_0x9dad('0x40')]);return _0x1c6b5a[_0x9dad('0x6f')](_0x31a6e5);}})[_0x9dad('0x22')](function(_0x231b8f){if(_0x231b8f){_0x111821=_0x231b8f[_0x9dad('0x44')];if(!_0x515722[_0x9dad('0x30')][_0x9dad('0x36')](_0x9dad('0x37'))){_0x31a6e5[_0x9dad('0x1c')]=qs[_0x9dad('0x1c')](_0x515722['query']['limit']);_0x31a6e5[_0x9dad('0x19')]=qs[_0x9dad('0x19')](_0x515722[_0x9dad('0x30')][_0x9dad('0x19')]);}return _0x1c6b5a[_0x9dad('0x6f')](_0x31a6e5);}})[_0x9dad('0x22')](function(_0x50a9a8){if(_0x50a9a8){return _0x50a9a8?{'count':_0x111821,'rows':_0x50a9a8}:null;}})[_0x9dad('0x22')](respondWithResult(_0x31fd42,null))[_0x9dad('0x47')](handleError(_0x31fd42,null));};
\ No newline at end of file
+var _0x3db4=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','unlinkSync','join','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','getSounds','pick','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','set','Content-Range','apply','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','keys','model','attributes','query','fields','length','nolimit','offset','order','sort','filters','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','catch','params','intersection','find','update','body','create','sequelize','transaction','files','root','server/files/moh','mode','mkdirSync','0777','user'];(function(_0x1ea13d,_0x413305){var _0x3a21ba=function(_0x2f521c){while(--_0x2f521c){_0x1ea13d['push'](_0x1ea13d['shift']());}};_0x3a21ba(++_0x413305);}(_0x3db4,0x175));var _0x43db=function(_0x7690c4,_0x3e959b){_0x7690c4=_0x7690c4-0x0;var _0x236fd4=_0x3db4[_0x7690c4];return _0x236fd4;};'use strict';var emlformat=require(_0x43db('0x0'));var rimraf=require(_0x43db('0x1'));var zipdir=require(_0x43db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43db('0x3'));var moment=require(_0x43db('0x4'));var BPromise=require(_0x43db('0x5'));var Mustache=require(_0x43db('0x6'));var util=require(_0x43db('0x7'));var path=require('path');var sox=require(_0x43db('0x8'));var csv=require(_0x43db('0x9'));var ejs=require(_0x43db('0xa'));var fs=require('fs');var fs_extra=require(_0x43db('0xb'));var _=require(_0x43db('0xc'));var squel=require('squel');var crypto=require(_0x43db('0xd'));var jsforce=require(_0x43db('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x43db('0x9'));var querystring=require(_0x43db('0xf'));var Papa=require(_0x43db('0x10'));var Redis=require(_0x43db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x43db('0x12'));var as=require(_0x43db('0x13'));var hardwareService=require(_0x43db('0x14'));var logger=require(_0x43db('0x15'))(_0x43db('0x16'));var utils=require(_0x43db('0x17'));var config=require(_0x43db('0x18'));var licenseUtil=require(_0x43db('0x19'));var db=require(_0x43db('0x1a'))['db'];function respondWithStatusCode(_0xb7d48e,_0x389b13){_0x389b13=_0x389b13||0xcc;return function(_0x14b769){if(_0x14b769){return _0xb7d48e[_0x43db('0x1b')](_0x389b13);}return _0xb7d48e['status'](_0x389b13)['end']();};}function respondWithResult(_0x2b7afe,_0x4fb3dc){_0x4fb3dc=_0x4fb3dc||0xc8;return function(_0xe74deb){if(_0xe74deb){return _0x2b7afe[_0x43db('0x1c')](_0x4fb3dc)[_0x43db('0x1d')](_0xe74deb);}};}function respondWithFilteredResult(_0x4cd12b,_0x163476){return function(_0xb1d53c){if(_0xb1d53c){var _0x5c7f15=typeof _0x163476['offset']==='undefined'&&typeof _0x163476[_0x43db('0x1e')]===_0x43db('0x1f');var _0x576d60=_0xb1d53c['count'];var _0x564bb8=_0x5c7f15?0x0:_0x163476['offset'];var _0x9d53f3=_0x5c7f15?_0xb1d53c[_0x43db('0x20')]:_0x163476['offset']+_0x163476[_0x43db('0x1e')];var _0x37754b;if(_0x9d53f3>=_0x576d60){_0x9d53f3=_0x576d60;_0x37754b=0xc8;}else{_0x37754b=0xce;}_0x4cd12b[_0x43db('0x1c')](_0x37754b);return _0x4cd12b[_0x43db('0x21')](_0x43db('0x22'),_0x564bb8+'-'+_0x9d53f3+'/'+_0x576d60)[_0x43db('0x1d')](_0xb1d53c);}return null;};}function patchUpdates(_0x533706){return function(_0x1ea991){try{jsonpatch[_0x43db('0x23')](_0x1ea991,_0x533706,!![]);}catch(_0x466b03){return BPromise['reject'](_0x466b03);}return _0x1ea991['save']();};}function saveUpdates(_0x337a1d,_0x5b9803){return function(_0x4d1262){if(_0x4d1262){return _0x4d1262['update'](_0x337a1d)[_0x43db('0x24')](function(_0x43fbb1){return _0x43fbb1;});}return null;};}function removeEntity(_0x5a83e4,_0x5ca68d){return function(_0x11e63a){if(_0x11e63a){return _0x11e63a['destroy']()[_0x43db('0x24')](function(){var _0x14c518=_0x11e63a[_0x43db('0x25')]({'plain':!![]});var _0xe49a69='MusicOnHolds';return db[_0x43db('0x26')][_0x43db('0x27')]({'where':{'type':_0xe49a69,'resourceId':_0x14c518['id']}})['then'](function(){return _0x11e63a;});})[_0x43db('0x24')](function(){_0x5a83e4[_0x43db('0x1c')](0xcc)[_0x43db('0x28')]();});}};}function handleEntityNotFound(_0x30b9cb,_0x56218b){return function(_0x5d78c3){if(!_0x5d78c3){_0x30b9cb[_0x43db('0x1b')](0x194);}return _0x5d78c3;};}function handleError(_0x5b6cea,_0x3fc3c4){_0x3fc3c4=_0x3fc3c4||0x1f4;return function(_0x1370ef){logger[_0x43db('0x29')](_0x1370ef[_0x43db('0x2a')]);if(_0x1370ef[_0x43db('0x2b')]){delete _0x1370ef['name'];}_0x5b6cea[_0x43db('0x1c')](_0x3fc3c4)[_0x43db('0x2c')](_0x1370ef);};}exports[_0x43db('0x2d')]=function(_0x2771e9,_0x388780){var _0x30ade5={},_0x234984={},_0xa21803={'count':0x0,'rows':[]};var _0x44550c=_[_0x43db('0x2e')](db[_0x43db('0x2f')][_0x43db('0x30')],function(_0x8b1c28){return{'name':_0x8b1c28[_0x43db('0x31')],'type':_0x8b1c28['type'][_0x43db('0x32')]};});_0x234984['model']=_[_0x43db('0x2e')](_0x44550c,_0x43db('0x2b'));_0x234984['query']=_[_0x43db('0x33')](_0x2771e9['query']);_0x234984['filters']=_['intersection'](_0x234984[_0x43db('0x34')],_0x234984['query']);_0x30ade5[_0x43db('0x35')]=_['intersection'](_0x234984['model'],qs['fields'](_0x2771e9[_0x43db('0x36')][_0x43db('0x37')]));_0x30ade5[_0x43db('0x35')]=_0x30ade5['attributes'][_0x43db('0x38')]?_0x30ade5[_0x43db('0x35')]:_0x234984[_0x43db('0x34')];if(!_0x2771e9[_0x43db('0x36')]['hasOwnProperty'](_0x43db('0x39'))){_0x30ade5[_0x43db('0x1e')]=qs[_0x43db('0x1e')](_0x2771e9[_0x43db('0x36')]['limit']);_0x30ade5['offset']=qs[_0x43db('0x3a')](_0x2771e9['query']['offset']);}_0x30ade5[_0x43db('0x3b')]=qs[_0x43db('0x3c')](_0x2771e9[_0x43db('0x36')][_0x43db('0x3c')]);delete _0x2771e9[_0x43db('0x36')]['sort'];_0x30ade5['where']=qs['filters'](_['pick'](_0x2771e9[_0x43db('0x36')],_0x234984[_0x43db('0x3d')]),_0x44550c);if(_0x2771e9[_0x43db('0x36')][_0x43db('0x3e')]){_0x30ade5['where']=_['merge'](_0x30ade5['where'],{'$or':_[_0x43db('0x2e')](_0x44550c,function(_0x192fad){if(_0x192fad['type']!==_0x43db('0x3f')){var _0x410ddb={};_0x410ddb[_0x192fad['name']]={'$like':'%'+_0x2771e9[_0x43db('0x36')][_0x43db('0x3e')]+'%'};return _0x410ddb;}})});}_0x30ade5=_[_0x43db('0x40')]({},_0x30ade5,_0x2771e9[_0x43db('0x41')]);var _0x1efd4f={'where':_0x30ade5[_0x43db('0x42')]};return db[_0x43db('0x2f')][_0x43db('0x20')](_0x1efd4f)[_0x43db('0x24')](function(_0x369940){_0xa21803[_0x43db('0x20')]=_0x369940;if(_0x2771e9['query'][_0x43db('0x43')]){_0x30ade5[_0x43db('0x44')]=[{'all':!![]}];}return db[_0x43db('0x2f')][_0x43db('0x45')](_0x30ade5);})[_0x43db('0x24')](function(_0x27a31d){_0xa21803[_0x43db('0x46')]=_0x27a31d;return _0xa21803;})[_0x43db('0x24')](respondWithFilteredResult(_0x388780,_0x30ade5))[_0x43db('0x47')](handleError(_0x388780,null));};exports['show']=function(_0x3ce6a7,_0x58805a){var _0x236776={'raw':![],'where':{'id':_0x3ce6a7[_0x43db('0x48')]['id']}},_0x28722d={};_0x28722d[_0x43db('0x34')]=_[_0x43db('0x33')](db[_0x43db('0x2f')]['rawAttributes']);_0x28722d[_0x43db('0x36')]=_[_0x43db('0x33')](_0x3ce6a7[_0x43db('0x36')]);_0x28722d[_0x43db('0x3d')]=_[_0x43db('0x49')](_0x28722d[_0x43db('0x34')],_0x28722d[_0x43db('0x36')]);_0x236776[_0x43db('0x35')]=_[_0x43db('0x49')](_0x28722d[_0x43db('0x34')],qs[_0x43db('0x37')](_0x3ce6a7[_0x43db('0x36')][_0x43db('0x37')]));_0x236776['attributes']=_0x236776['attributes'][_0x43db('0x38')]?_0x236776[_0x43db('0x35')]:_0x28722d[_0x43db('0x34')];if(_0x3ce6a7[_0x43db('0x36')][_0x43db('0x43')]){_0x236776['include']=[{'all':!![]}];}_0x236776=_[_0x43db('0x40')]({},_0x236776,_0x3ce6a7[_0x43db('0x41')]);return db[_0x43db('0x2f')][_0x43db('0x4a')](_0x236776)[_0x43db('0x24')](handleEntityNotFound(_0x58805a,null))['then'](respondWithResult(_0x58805a,null))[_0x43db('0x47')](handleError(_0x58805a,null));};exports[_0x43db('0x4b')]=function(_0x22012e,_0x332cc2){if(_0x22012e['body']['id']){delete _0x22012e[_0x43db('0x4c')]['id'];}return db[_0x43db('0x2f')][_0x43db('0x4a')]({'where':{'id':_0x22012e['params']['id']}})[_0x43db('0x24')](handleEntityNotFound(_0x332cc2,null))['then'](saveUpdates(_0x22012e[_0x43db('0x4c')],null))['then'](respondWithResult(_0x332cc2,null))[_0x43db('0x47')](handleError(_0x332cc2,null));};exports[_0x43db('0x4d')]=function(_0x3d0116,_0x2e4ac4,_0x26530a){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x139804){if(_0x3d0116[_0x43db('0x4c')]['mode']===_0x43db('0x50')){_0x3d0116[_0x43db('0x4c')]['directory']=path['join'](config[_0x43db('0x51')],_0x43db('0x52'),_0x3d0116[_0x43db('0x4c')][_0x43db('0x2b')]);}return db[_0x43db('0x2f')][_0x43db('0x4d')](_0x3d0116[_0x43db('0x4c')],{'transaction':_0x139804})[_0x43db('0x24')](function(_0x1641fa){if(_0x3d0116[_0x43db('0x4c')][_0x43db('0x53')]===_0x43db('0x50')){fs[_0x43db('0x54')](_0x1641fa['directory'],parseInt(_0x43db('0x55'),0x8));}var _0x2f791c=_0x3d0116[_0x43db('0x56')][_0x43db('0x25')]({'plain':!![]});if(!_0x2f791c)throw new Error(_0x43db('0x57'));if(_0x2f791c['role']==='user'){var _0x4253e9=_0x1641fa['get']({'plain':!![]});return db[_0x43db('0x58')]['find']({'where':{'name':_0x43db('0x59'),'userProfileId':_0x2f791c['userProfileId']},'raw':!![]})['then'](function(_0x4fae65){if(_0x4fae65&&_0x4fae65[_0x43db('0x5a')]===0x0){return db[_0x43db('0x26')][_0x43db('0x4d')]({'name':_0x4253e9[_0x43db('0x2b')],'resourceId':_0x4253e9['id'],'type':_0x4fae65['name'],'sectionId':_0x4fae65['id']},{})[_0x43db('0x24')](function(){return _0x1641fa;});}else{return _0x1641fa;}})[_0x43db('0x47')](function(_0x168562){logger[_0x43db('0x29')](_0x43db('0x5b'),_0x168562);});}return _0x1641fa;});})['then'](respondWithResult(_0x2e4ac4,0xc9))['catch'](handleError(_0x2e4ac4,null));};exports[_0x43db('0x27')]=function(_0xc12452,_0x585c4a,_0x2011fe){var _0xd83a6a;return db['VoiceMusicOnHold'][_0x43db('0x4a')]({'where':{'id':_0xc12452[_0x43db('0x48')]['id']}})[_0x43db('0x24')](function(_0x27c378){if(_0x27c378){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x352ec4){return _0x27c378['destroy']({'transaction':_0x352ec4,'raw':!![]})['then'](function(_0x278e61){if(_0x278e61[_0x43db('0x5c')]){fs['readdirSync'](_0x278e61['directory'])['forEach'](function(_0x41356b){fs[_0x43db('0x5d')](path[_0x43db('0x5e')](_0x278e61[_0x43db('0x5c')],_0x41356b));});fs[_0x43db('0x5f')](_0x278e61['directory']);}return _0x278e61;});})['catch'](function(_0x46d426){throw new db[(_0x43db('0x60'))][(_0x43db('0x61'))](_0x46d426[_0x43db('0x62')]);});}})['then'](handleEntityNotFound(_0x585c4a,null))[_0x43db('0x24')](removeEntity(_0x585c4a,null))[_0x43db('0x47')](handleError(_0x585c4a,null));};exports[_0x43db('0x63')]=function(_0x3ab57a,_0x3b66e3,_0x2daae8){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x189fd6){var _0x5acdfc;return db[_0x43db('0x2f')]['find']({'where':{'id':_0x3ab57a[_0x43db('0x48')]['id']}})[_0x43db('0x24')](function(_0x5d3376){if(_0x5d3376){_0x5acdfc=_0x5d3376;return _0x5d3376[_0x43db('0x63')](_0x3ab57a['body']['id'],{'transaction':_0x189fd6});}})['then'](function(_0x799fa2){if(_0x799fa2){return db[_0x43db('0x64')][_0x43db('0x65')]({'where':{'id':_0x3ab57a[_0x43db('0x4c')]['id']},'attributes':['id','name',_0x43db('0x66'),_0x43db('0x67'),_0x43db('0x68')],'raw':!![]});}})[_0x43db('0x24')](function(_0x28ef1a){if(_0x28ef1a){var _0x2ad082=path[_0x43db('0x5e')](config['root'],_0x43db('0x69'),util[_0x43db('0x6a')](_0x43db('0x6b'),path[_0x43db('0x6c')](_0x28ef1a[_0x43db('0x66')],path[_0x43db('0x6d')](_0x28ef1a['save_name'])),_0x28ef1a[_0x43db('0x67')]));var _0x24bae6=path[_0x43db('0x5e')](config['root'],'server/files/moh',_0x5acdfc['name'],util[_0x43db('0x6a')](_0x43db('0x6b'),_0x28ef1a[_0x43db('0x2b')],_0x28ef1a[_0x43db('0x67')]));fs[_0x43db('0x6e')](_0x2ad082,_0x24bae6);return _0x28ef1a;}})[_0x43db('0x47')](function(_0xd105ec){throw new db['Sequelize'][(_0x43db('0x61'))](_0xd105ec[_0x43db('0x62')]);});})[_0x43db('0x24')](handleEntityNotFound(_0x3b66e3,null))['then'](respondWithResult(_0x3b66e3,0xc9))[_0x43db('0x47')](handleError(_0x3b66e3,null));};exports[_0x43db('0x6f')]=function(_0x5a62f1,_0x532a70,_0x7da8b3){return db[_0x43db('0x4e')][_0x43db('0x4f')](function(_0x50c874){var _0x201cc7;return db[_0x43db('0x2f')][_0x43db('0x65')]({'where':{'id':_0x5a62f1[_0x43db('0x48')]['id']}})[_0x43db('0x24')](handleEntityNotFound(_0x532a70,null))[_0x43db('0x24')](function(_0x532b4d){if(_0x532b4d){_0x201cc7=_0x532b4d;return _0x532b4d[_0x43db('0x6f')](_0x5a62f1['params']['id2']);}})[_0x43db('0x24')](function(_0x31b44b){if(_0x31b44b){return db[_0x43db('0x64')][_0x43db('0x65')]({'where':{'id':_0x5a62f1[_0x43db('0x48')]['id2']},'attributes':['id',_0x43db('0x2b'),'save_name',_0x43db('0x67'),_0x43db('0x68')],'raw':!![]});}})[_0x43db('0x24')](function(_0x235ba1){if(_0x235ba1){fs[_0x43db('0x5d')](path[_0x43db('0x5e')](_0x201cc7[_0x43db('0x5c')],util[_0x43db('0x6a')]('%s.%s',_0x235ba1['name'],_0x235ba1['converted_format'])));return _0x235ba1;}})[_0x43db('0x47')](function(_0x337efd){throw new db['Sequelize'][(_0x43db('0x61'))](_0x337efd[_0x43db('0x62')]);});})[_0x43db('0x24')](handleEntityNotFound(_0x532a70,null))[_0x43db('0x24')](respondWithStatusCode(_0x532a70,0xcc))['catch'](handleError(_0x532a70,null));};exports[_0x43db('0x70')]=function(_0xb6feef,_0x5e4a36,_0x52c98b){var _0x60a261={};var _0x1eae8b={};var _0x73cfa9;var _0x5ee556;return db[_0x43db('0x2f')][_0x43db('0x65')]({'where':{'id':_0xb6feef[_0x43db('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e4a36,null))[_0x43db('0x24')](function(_0x5eb8ea){if(_0x5eb8ea){_0x73cfa9=_0x5eb8ea;_0x1eae8b[_0x43db('0x34')]=_[_0x43db('0x33')](db['Sound'][_0x43db('0x30')]);_0x1eae8b['query']=_[_0x43db('0x33')](_0xb6feef[_0x43db('0x36')]);_0x1eae8b[_0x43db('0x3d')]=_['intersection'](_0x1eae8b['model'],_0x1eae8b[_0x43db('0x36')]);_0x60a261[_0x43db('0x35')]=_[_0x43db('0x49')](_0x1eae8b[_0x43db('0x34')],qs[_0x43db('0x37')](_0xb6feef[_0x43db('0x36')][_0x43db('0x37')]));_0x60a261['attributes']=_0x60a261['attributes']['length']?_0x60a261[_0x43db('0x35')]:_0x1eae8b[_0x43db('0x34')];_0x60a261[_0x43db('0x3b')]=qs[_0x43db('0x3c')](_0xb6feef['query'][_0x43db('0x3c')]);_0x60a261[_0x43db('0x42')]=qs[_0x43db('0x3d')](_[_0x43db('0x71')](_0xb6feef[_0x43db('0x36')],_0x1eae8b['filters']));if(_0xb6feef[_0x43db('0x36')][_0x43db('0x3e')]){_0x60a261['where']=_[_0x43db('0x40')](_0x60a261['where'],{'$or':_[_0x43db('0x2e')](_0x60a261['attributes'],function(_0x28db8a){var _0x16357f={};_0x16357f[_0x28db8a]={'$like':'%'+_0xb6feef[_0x43db('0x36')][_0x43db('0x3e')]+'%'};return _0x16357f;})});}_0x60a261=_[_0x43db('0x40')]({},_0x60a261,_0xb6feef[_0x43db('0x41')]);return _0x73cfa9[_0x43db('0x70')](_0x60a261);}})['then'](function(_0x2badfa){if(_0x2badfa){_0x5ee556=_0x2badfa['length'];if(!_0xb6feef[_0x43db('0x36')][_0x43db('0x72')](_0x43db('0x39'))){_0x60a261[_0x43db('0x1e')]=qs[_0x43db('0x1e')](_0xb6feef[_0x43db('0x36')][_0x43db('0x1e')]);_0x60a261[_0x43db('0x3a')]=qs['offset'](_0xb6feef[_0x43db('0x36')]['offset']);}return _0x73cfa9[_0x43db('0x70')](_0x60a261);}})['then'](function(_0x27d8e3){if(_0x27d8e3){return _0x27d8e3?{'count':_0x5ee556,'rows':_0x27d8e3}:null;}})[_0x43db('0x24')](respondWithResult(_0x5e4a36,null))[_0x43db('0x47')](handleError(_0x5e4a36,null));};
\ No newline at end of file
index 6812ab9..8ca430e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eed=['rimraf','../../config/environment','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2bcb70,_0xda7180){var _0x463350=function(_0x4f14c6){while(--_0x4f14c6){_0x2bcb70['push'](_0x2bcb70['shift']());}};_0x463350(++_0xda7180);}(_0x1eed,0xb9));var _0xd1ee=function(_0x5f1567,_0x3d9ce4){_0x5f1567=_0x5f1567-0x0;var _0x2025ec=_0x1eed[_0x5f1567];return _0x2025ec;};'use strict';var _=require(_0xd1ee('0x0'));var util=require(_0xd1ee('0x1'));var logger=require(_0xd1ee('0x2'))('api');var moment=require(_0xd1ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xd1ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1ee('0x5'));var config=require(_0xd1ee('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x1e8e92,_0x1b8d8e){return _0x1e8e92[_0xd1ee('0x7')](_0xd1ee('0x8'),attributes,{'tableName':_0xd1ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa61=['moment','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger'];(function(_0x4be4b4,_0x3a107e){var _0xcb88dd=function(_0x25cc6a){while(--_0x25cc6a){_0x4be4b4['push'](_0x4be4b4['shift']());}};_0xcb88dd(++_0x3a107e);}(_0xfa61,0x12a));var _0x1fa6=function(_0xab22ae,_0x327bd1){_0xab22ae=_0xab22ae-0x0;var _0x10e9e8=_0xfa61[_0xab22ae];return _0x10e9e8;};'use strict';var _=require(_0x1fa6('0x0'));var util=require('util');var logger=require(_0x1fa6('0x1'))('api');var moment=require(_0x1fa6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fa6('0x3'));var rimraf=require(_0x1fa6('0x4'));var config=require(_0x1fa6('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x1fa6('0x6')]=function(_0x57a79c,_0x3c6df6){return _0x57a79c[_0x1fa6('0x7')](_0x1fa6('0x8'),attributes,{'tableName':_0x1fa6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aafdd80..5ab8475 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2f345f,_0x1ee95c){var _0x5a37b0=function(_0x26389c){while(--_0x26389c){_0x2f345f['push'](_0x2f345f['shift']());}};_0x5a37b0(++_0x1ee95c);}(_0xe706,0xa3));var _0x6e70=function(_0x5ee507,_0x59e998){_0x5ee507=_0x5ee507-0x0;var _0x223caf=_0xe706[_0x5ee507];return _0x223caf;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x320f33,_0x1db212){var _0x217d1e=function(_0x3c068){while(--_0x3c068){_0x320f33['push'](_0x320f33['shift']());}};_0x217d1e(++_0x1db212);}(_0xe706,0xa3));var _0x6e70=function(_0x1856e8,_0x4532d6){_0x1856e8=_0x1856e8-0x0;var _0x4ad341=_0xe706[_0x1856e8];return _0x4ad341;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index caac334..4e07c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe851=['put','update','delete','destroy','removeAgents','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','/describe','/:id','isAuthenticated','post','/:id/users','addAgents'];(function(_0x59f584,_0x3cd044){var _0x33bfd7=function(_0xc24d7a){while(--_0xc24d7a){_0x59f584['push'](_0x59f584['shift']());}};_0x33bfd7(++_0x3cd044);}(_0xe851,0x181));var _0x1e85=function(_0xc58474,_0x399ed4){_0xc58474=_0xc58474-0x0;var _0x98d033=_0xe851[_0xc58474];return _0x98d033;};'use strict';var multer=require(_0x1e85('0x0'));var util=require(_0x1e85('0x1'));var path=require('path');var timeout=require(_0x1e85('0x2'));var express=require(_0x1e85('0x3'));var router=express['Router']();var fs_extra=require(_0x1e85('0x4'));var auth=require(_0x1e85('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1e85('0x6'));var controller=require(_0x1e85('0x7'));router[_0x1e85('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e85('0x8')](_0x1e85('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1e85('0x8')](_0x1e85('0xa'),auth[_0x1e85('0xb')](),controller['show']);router[_0x1e85('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x1e85('0xc')]('/',auth[_0x1e85('0xb')](),controller['create']);router[_0x1e85('0xc')](_0x1e85('0xd'),auth[_0x1e85('0xb')](),controller[_0x1e85('0xe')]);router[_0x1e85('0xf')](_0x1e85('0xa'),auth[_0x1e85('0xb')](),controller[_0x1e85('0x10')]);router[_0x1e85('0x11')]('/:id',auth[_0x1e85('0xb')](),controller[_0x1e85('0x12')]);router[_0x1e85('0x11')](_0x1e85('0xd'),auth['isAuthenticated'](),controller[_0x1e85('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xf21d=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id/users','getAgents','post','addAgents','/:id','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x33a5e4,_0xd1014){var _0x56b74a=function(_0x5addd5){while(--_0x5addd5){_0x33a5e4['push'](_0x33a5e4['shift']());}};_0x56b74a(++_0xd1014);}(_0xf21d,0x1a8));var _0xdf21=function(_0x59e979,_0x1b941a){_0x59e979=_0x59e979-0x0;var _0x492d=_0xf21d[_0x59e979];return _0x492d;};'use strict';var multer=require(_0xdf21('0x0'));var util=require(_0xdf21('0x1'));var path=require(_0xdf21('0x2'));var timeout=require(_0xdf21('0x3'));var express=require(_0xdf21('0x4'));var router=express[_0xdf21('0x5')]();var fs_extra=require(_0xdf21('0x6'));var auth=require(_0xdf21('0x7'));var interaction=require(_0xdf21('0x8'));var config=require(_0xdf21('0x9'));var controller=require(_0xdf21('0xa'));router[_0xdf21('0xb')]('/',auth[_0xdf21('0xc')](),controller[_0xdf21('0xd')]);router['get'](_0xdf21('0xe'),auth['isAuthenticated'](),controller[_0xdf21('0xf')]);router['get']('/:id',auth[_0xdf21('0xc')](),controller['show']);router[_0xdf21('0xb')](_0xdf21('0x10'),auth[_0xdf21('0xc')](),controller[_0xdf21('0x11')]);router[_0xdf21('0x12')]('/',auth[_0xdf21('0xc')](),controller['create']);router['post'](_0xdf21('0x10'),auth[_0xdf21('0xc')](),controller[_0xdf21('0x13')]);router['put']('/:id',auth[_0xdf21('0xc')](),controller['update']);router['delete'](_0xdf21('0x14'),auth[_0xdf21('0xc')](),controller[_0xdf21('0x15')]);router[_0xdf21('0x16')](_0xdf21('0x10'),auth['isAuthenticated'](),controller[_0xdf21('0x17')]);module['exports']=router;
\ No newline at end of file
index 942b6b0..0455eda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40c4=['exports','name','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x21eaf4,_0x3c2a36){var _0x1c4c83=function(_0x20529d){while(--_0x20529d){_0x21eaf4['push'](_0x21eaf4['shift']());}};_0x1c4c83(++_0x3c2a36);}(_0x40c4,0x7d));var _0x440c=function(_0x5a243a,_0x36d07f){_0x5a243a=_0x5a243a-0x0;var _0x210c5a=_0x40c4[_0x5a243a];return _0x210c5a;};'use strict';var Sequelize=require(_0x440c('0x0'));module[_0x440c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x440c('0x2')},'prefix':{'type':Sequelize[_0x440c('0x3')],'get':function(_0x2f30f8){return _0x440c('0x4')+this[_0x440c('0x5')](_0x440c('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x440c('0x6')]}};
\ No newline at end of file
+var _0x8c47=['STRING','system-','name','sequelize','exports'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x8c47,0xc6));var _0x78c4=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x8c47[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0x78c4('0x0'));module[_0x78c4('0x1')]={'name':{'type':Sequelize[_0x78c4('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x406c35){return _0x78c4('0x3')+this['getDataValue'](_0x78c4('0x4'))+'-';}},'description':{'type':Sequelize[_0x78c4('0x2')]},'callerIdAll':{'type':Sequelize[_0x78c4('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 4864d7d..ac020fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['VoicePrefix','includeAll','include','findAll','catch','show','params','find','describe','create','body','get','VoiceExtensionId','user','role','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','sequelize','findById','addAgents','ids','spread','emit','removeAgents','isArray','getAgents','findOne','User','pick','hasOwnProperty','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','redis','defaults','localhost','./voicePrefix.socket','register','status','offset','undefined','limit','count','set','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x33161b=_0x197ec0['get']({'plain':!![]});var _0x384319='VoicePrefixes';return db[_0x0a9e('0x25')]['destroy']({'where':{'type':_0x384319,'resourceId':_0x33161b['id']}})[_0x0a9e('0x23')](function(){return _0x197ec0;});})[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)[_0x0a9e('0x26')]();});}};}function handleEntityNotFound(_0x140511,_0x1538a4){return function(_0x11c3b6){if(!_0x11c3b6){_0x140511[_0x0a9e('0x27')](0x194);}return _0x11c3b6;};}function handleError(_0x5a101a,_0x3652a7){_0x3652a7=_0x3652a7||0x1f4;return function(_0x468813){logger[_0x0a9e('0x28')](_0x468813[_0x0a9e('0x29')]);if(_0x468813['name']){delete _0x468813[_0x0a9e('0x2a')];}_0x5a101a[_0x0a9e('0x1a')](_0x3652a7)[_0x0a9e('0x2b')](_0x468813);};}exports[_0x0a9e('0x2c')]=function(_0x58b06f,_0x563b45){var _0x296f41={},_0x2e8759={},_0x1dbde2={'count':0x0,'rows':[]};var _0x540530=_[_0x0a9e('0x2d')](db['VoicePrefix'][_0x0a9e('0x2e')],function(_0x3ae878){return{'name':_0x3ae878[_0x0a9e('0x2f')],'type':_0x3ae878[_0x0a9e('0x30')][_0x0a9e('0x31')]};});_0x2e8759['model']=_[_0x0a9e('0x2d')](_0x540530,_0x0a9e('0x2a'));_0x2e8759[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x58b06f[_0x0a9e('0x32')]);_0x2e8759[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2e8759[_0x0a9e('0x36')],_0x2e8759['query']);_0x296f41[_0x0a9e('0x37')]=_['intersection'](_0x2e8759[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x296f41['attributes']=_0x296f41[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x296f41[_0x0a9e('0x37')]:_0x2e8759[_0x0a9e('0x36')];if(!_0x58b06f['query']['hasOwnProperty'](_0x0a9e('0x3a'))){_0x296f41['limit']=qs[_0x0a9e('0x1d')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x296f41[_0x0a9e('0x1b')]=qs['offset'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x296f41[_0x0a9e('0x3b')]=qs['sort'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x296f41[_0x0a9e('0x3d')]=qs['filters'](_['pick'](_0x58b06f[_0x0a9e('0x32')],_0x2e8759[_0x0a9e('0x34')]),_0x540530);if(_0x58b06f['query'][_0x0a9e('0x3e')]){_0x296f41[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x296f41[_0x0a9e('0x3d')],{'$or':_['map'](_0x540530,function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x30')]!==_0x0a9e('0x40')){var _0x53f3ee={};_0x53f3ee[_0x5a594b[_0x0a9e('0x2a')]]={'$like':'%'+_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x53f3ee;}})});}_0x296f41=_['merge']({},_0x296f41,_0x58b06f[_0x0a9e('0x41')]);var _0x2cfea9={'where':_0x296f41[_0x0a9e('0x3d')]};return db[_0x0a9e('0x42')][_0x0a9e('0x1e')](_0x2cfea9)[_0x0a9e('0x23')](function(_0x2881b3){_0x1dbde2[_0x0a9e('0x1e')]=_0x2881b3;if(_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x296f41[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x42')][_0x0a9e('0x45')](_0x296f41);})[_0x0a9e('0x23')](function(_0x37f6cc){_0x1dbde2['rows']=_0x37f6cc;return _0x1dbde2;})['then'](respondWithFilteredResult(_0x563b45,_0x296f41))[_0x0a9e('0x46')](handleError(_0x563b45,null));};exports[_0x0a9e('0x47')]=function(_0x405c8f,_0x315881){var _0x1a69dd={'raw':![],'where':{'id':_0x405c8f[_0x0a9e('0x48')]['id']}},_0xc9a702={};_0xc9a702[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0xc9a702[_0x0a9e('0x32')]=_['keys'](_0x405c8f[_0x0a9e('0x32')]);_0xc9a702[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],_0xc9a702[_0x0a9e('0x32')]);_0x1a69dd[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],qs['fields'](_0x405c8f[_0x0a9e('0x32')]['fields']));_0x1a69dd[_0x0a9e('0x37')]=_0x1a69dd[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x1a69dd['attributes']:_0xc9a702[_0x0a9e('0x36')];if(_0x405c8f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x1a69dd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x1a69dd=_[_0x0a9e('0x3f')]({},_0x1a69dd,_0x405c8f[_0x0a9e('0x41')]);return db[_0x0a9e('0x42')]['find'](_0x1a69dd)[_0x0a9e('0x23')](handleEntityNotFound(_0x315881,null))[_0x0a9e('0x23')](respondWithResult(_0x315881,null))[_0x0a9e('0x46')](handleError(_0x315881,null));};exports[_0x0a9e('0x24')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x409789[_0x0a9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x23')](removeEntity(_0x992c77,null))[_0x0a9e('0x46')](handleError(_0x992c77,null));};exports['describe']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x42')][_0x0a9e('0x4a')]()[_0x0a9e('0x23')](respondWithResult(_0x5ddf84,null))[_0x0a9e('0x46')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x4b')]=function(_0x30decb,_0x2e5165){var _0x375c18;return db['sequelize']['transaction'](function(_0x53975a){return db[_0x0a9e('0x42')][_0x0a9e('0x4b')](_0x30decb[_0x0a9e('0x4c')],{'transaction':_0x53975a})['then'](function(_0x2b69d9){_0x375c18=_0x2b69d9[_0x0a9e('0x4d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x375c18[_0x0a9e('0x4e')]},'raw':!![]})['then'](function(_0x443e72){return createVoicePrefixExtensions(_0x375c18,_0x443e72,_0x53975a);});});})['then'](function(){var _0x2e5e62=_0x30decb[_0x0a9e('0x4f')][_0x0a9e('0x4d')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x50')]===_0x0a9e('0x4f')){var _0x508b47=_0x375c18;return db['UserProfileSection'][_0x0a9e('0x49')]({'where':{'name':_0x0a9e('0x51'),'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x5ce9ac){if(_0x5ce9ac&&_0x5ce9ac[_0x0a9e('0x52')]===0x0){return db['UserProfileResource'][_0x0a9e('0x4b')]({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x5ce9ac['name'],'sectionId':_0x5ce9ac['id']},{})['then'](function(){return _0x375c18;});}else{return _0x375c18;}})[_0x0a9e('0x46')](function(_0x47de4c){logger[_0x0a9e('0x28')](_0x0a9e('0x53'),_0x47de4c);throw _0x47de4c;});}return _0x375c18;})[_0x0a9e('0x23')](respondWithResult(_0x2e5165,null))[_0x0a9e('0x46')](handleError(_0x2e5165,null));};function Extension(_0x232830,_0x272738,_0xd10662,_0x28d814){this['context']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x232830;this[_0x0a9e('0x56')]=_0xd10662;this[_0x0a9e('0x30')]=_0x0a9e('0x57');this[_0x0a9e('0x58')]='Voice\x20Prefix\x20Extension';this[_0x0a9e('0x59')]=_0x272738;this[_0x0a9e('0x5a')]=_0x28d814;}function createVoicePrefixExtensions(_0x5239ef,_0x3649cc,_0x5cc8fb){return new BPromise(function(_0x20c668,_0x5ba1f9){var _0x4b3c1a=new Extension(formatPrefixName(_0x5239ef['prefix']),0x1,_0x0a9e('0x5b'),'Voice\x20Prefix');_0x4b3c1a[_0x0a9e('0x5c')]=_0x5239ef['id'];return db[_0x0a9e('0x5d')][_0x0a9e('0x4b')](_0x4b3c1a,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x1cca9f){var _0x26d7db=_0x1cca9f['get']({'plain':!![]});var _0x1627a7=_['map'](addVoicePrefixExtensions(_0x5239ef,_0x3649cc),function(_0xca4ade){_0xca4ade[_0x0a9e('0x4e')]=_0x26d7db['id'];_0xca4ade[_0x0a9e('0x5c')]=_0x5239ef['id'];return _0xca4ade;});return db['VoiceExtension'][_0x0a9e('0x5e')](_0x1627a7,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x119677){if(!_0x119677){return _0x5ba1f9(_0x0a9e('0x5f'));}else{return _0x20c668(_0x119677);}})['catch'](function(_0x1d0dc8){return _0x5ba1f9(_0x1d0dc8);});});;});};function addVoicePrefixExtensions(_0xe05a5a,_0x54327c){var _0x797b45=[];var _0x17e88c=formatPrefixName(_0xe05a5a[_0x0a9e('0x60')]);_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x2,_0x0a9e('0x62'),'CDR(prefix)='+_0xe05a5a[_0x0a9e('0x2a')]));if(_0xe05a5a[_0x0a9e('0x63')]){_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x3,'Set',_0x0a9e('0x64')+_0xe05a5a['callerIdAll']));}else{_0x797b45['push'](new Extension(_0x17e88c,0x3,_0x0a9e('0x5b'),_0x0a9e('0x65')));}_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x4,_0x0a9e('0x66'),_0x54327c[_0x0a9e('0x67')]+','+_0x0a9e('0x68')+(0x8+_0xe05a5a[_0x0a9e('0x2a')][_0x0a9e('0x39')])+'}'+','+0x1));return _0x797b45;}function formatPrefixName(_0x2d7205){var _0x1cc4f3='_';for(var _0x2e89b7=0x0;_0x2e89b7<_0x2d7205[_0x0a9e('0x39')];_0x2e89b7++){if(_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)=='-'){_0x1cc4f3+=_0x2d7205[_0x0a9e('0x69')](_0x2e89b7);}else{_0x1cc4f3+='['+_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)+']';}}_0x1cc4f3+='.';return _0x1cc4f3;}exports[_0x0a9e('0x22')]=function(_0x2a28c0,_0x4257c9,_0x5150a4){var _0x1b0b98=_0x2a28c0[_0x0a9e('0x4c')];_0x1b0b98[_0x0a9e('0x60')]='system-'+_0x1b0b98[_0x0a9e('0x2a')]+'-';return db[_0x0a9e('0x6a')]['transaction'](function(_0x83f0b2){return db[_0x0a9e('0x42')][_0x0a9e('0x22')](_0x1b0b98,{'where':{'id':_0x1b0b98['id']},'transaction':_0x83f0b2})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x5d')]['destroy']({'where':{'VoicePrefixId':_0x1b0b98['id']},'transaction':_0x83f0b2})['then'](function(){return db['VoiceExtension'][_0x0a9e('0x49')]({'where':{'id':_0x1b0b98[_0x0a9e('0x4e')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x23a7d3){return createVoicePrefixExtensions(_0x1b0b98,_0x23a7d3,_0x83f0b2);});});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x42')][_0x0a9e('0x6b')](_0x1b0b98['id']);})[_0x0a9e('0x23')](respondWithResult(_0x4257c9,null))['catch'](handleError(_0x4257c9,null));};exports[_0x0a9e('0x6c')]=function(_0xcbc8b2,_0x12ccdb,_0x4a4fc7){return db[_0x0a9e('0x42')]['find']({'where':{'id':_0xcbc8b2[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x12ccdb,null))['then'](function(_0x2ed01e){if(_0x2ed01e){return _0x2ed01e[_0x0a9e('0x6c')](_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')],_['omit'](_0xcbc8b2[_0x0a9e('0x4c')],[_0x0a9e('0x6d'),'id'])||{})[_0x0a9e('0x6e')](function(_0x278ab4){for(var _0x5b7fc3=0x0;_0x5b7fc3<_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x0a9e('0x39')];_0x5b7fc3+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:save',{'UserId':_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x5b7fc3],'VoicePrefixId':_0xcbc8b2[_0x0a9e('0x48')]['id']});}return _0x278ab4;});}})[_0x0a9e('0x23')](respondWithResult(_0x12ccdb,null))[_0x0a9e('0x46')](handleError(_0x12ccdb,null));};exports[_0x0a9e('0x70')]=function(_0x40fc56,_0x3df0e3,_0x1a7b03){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x40fc56[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x3df0e3,null))[_0x0a9e('0x23')](function(_0x5b35db){if(_0x5b35db){return _0x5b35db[_0x0a9e('0x70')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])['then'](function(){if(_[_0x0a9e('0x71')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])){for(var _0x2b9463=0x0;_0x2b9463<_0x40fc56['query']['ids'][_0x0a9e('0x39')];_0x2b9463+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')]['ids'][_0x2b9463]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}}else{socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x3df0e3,null))[_0x0a9e('0x46')](handleError(_0x3df0e3,null));};exports[_0x0a9e('0x72')]=function(_0x444f1f,_0x482ca2,_0x2973d3){var _0x3ca9b9={};var _0x45c109={};var _0x16e5b9;var _0x492543;return db[_0x0a9e('0x42')][_0x0a9e('0x73')]({'where':{'id':_0x444f1f['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x482ca2,null))['then'](function(_0x163710){if(_0x163710){_0x16e5b9=_0x163710;_0x45c109[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x74')]['rawAttributes']);_0x45c109['query']=_[_0x0a9e('0x33')](_0x444f1f[_0x0a9e('0x32')]);_0x45c109[_0x0a9e('0x34')]=_['intersection'](_0x45c109[_0x0a9e('0x36')],_0x45c109[_0x0a9e('0x32')]);_0x3ca9b9['attributes']=_['intersection'](_0x45c109[_0x0a9e('0x36')],qs['fields'](_0x444f1f['query']['fields']));_0x3ca9b9[_0x0a9e('0x37')]=_0x3ca9b9[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x3ca9b9[_0x0a9e('0x37')]:_0x45c109[_0x0a9e('0x36')];_0x3ca9b9[_0x0a9e('0x3b')]=qs['sort'](_0x444f1f[_0x0a9e('0x32')]['sort']);_0x3ca9b9[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x75')](_0x444f1f[_0x0a9e('0x32')],_0x45c109['filters']));if(_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x3ca9b9[_0x0a9e('0x3d')]=_['merge'](_0x3ca9b9[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x3ca9b9[_0x0a9e('0x37')],function(_0x22063c){var _0x255e49={};_0x255e49[_0x22063c]={'$like':'%'+_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x255e49;})});}_0x3ca9b9=_[_0x0a9e('0x3f')]({},_0x3ca9b9,_0x444f1f['options']);return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){_0x492543=_0x589ff3[_0x0a9e('0x39')];if(!_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x76')]('nolimit')){_0x3ca9b9[_0x0a9e('0x1d')]=qs['limit'](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x3ca9b9[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x501050){if(_0x501050){return _0x501050?{'count':_0x492543,'rows':_0x501050}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x482ca2,null))[_0x0a9e('0x46')](handleError(_0x482ca2,null));};
\ No newline at end of file
+var _0xa9e0=['VoicePrefix','includeAll','include','findAll','catch','show','params','find','describe','create','body','get','VoiceExtensionId','user','role','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','sequelize','findById','addAgents','ids','spread','emit','removeAgents','isArray','getAgents','findOne','User','pick','hasOwnProperty','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','redis','defaults','localhost','./voicePrefix.socket','register','status','offset','undefined','limit','count','set','apply','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=typeof _0x5a0a06[_0x0a9e('0x1b')]===_0x0a9e('0x1c')&&typeof _0x5a0a06[_0x0a9e('0x1d')]===_0x0a9e('0x1c');var _0x530eb7=_0x459eb1[_0x0a9e('0x1e')];var _0x1314ae=_0x478723?0x0:_0x5a0a06[_0x0a9e('0x1b')];var _0x1c696a=_0x478723?_0x459eb1[_0x0a9e('0x1e')]:_0x5a0a06['offset']+_0x5a0a06[_0x0a9e('0x1d')];var _0x155cce;if(_0x1c696a>=_0x530eb7){_0x1c696a=_0x530eb7;_0x155cce=0xc8;}else{_0x155cce=0xce;}_0x225616['status'](_0x155cce);return _0x225616[_0x0a9e('0x1f')]('Content-Range',_0x1314ae+'-'+_0x1c696a+'/'+_0x530eb7)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x3a02e1){return function(_0x432e56){try{jsonpatch[_0x0a9e('0x20')](_0x432e56,_0x3a02e1,!![]);}catch(_0x30bae6){return BPromise['reject'](_0x30bae6);}return _0x432e56[_0x0a9e('0x21')]();};}function saveUpdates(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x22')](_0x2fb0e4)[_0x0a9e('0x23')](function(_0x16b1ca){return _0x16b1ca;});}return null;};}function removeEntity(_0x5ea472,_0x59181e){return function(_0x197ec0){if(_0x197ec0){return _0x197ec0[_0x0a9e('0x24')]()[_0x0a9e('0x23')](function(){var _0x33161b=_0x197ec0['get']({'plain':!![]});var _0x384319='VoicePrefixes';return db[_0x0a9e('0x25')]['destroy']({'where':{'type':_0x384319,'resourceId':_0x33161b['id']}})[_0x0a9e('0x23')](function(){return _0x197ec0;});})[_0x0a9e('0x23')](function(){_0x5ea472[_0x0a9e('0x1a')](0xcc)[_0x0a9e('0x26')]();});}};}function handleEntityNotFound(_0x140511,_0x1538a4){return function(_0x11c3b6){if(!_0x11c3b6){_0x140511[_0x0a9e('0x27')](0x194);}return _0x11c3b6;};}function handleError(_0x5a101a,_0x3652a7){_0x3652a7=_0x3652a7||0x1f4;return function(_0x468813){logger[_0x0a9e('0x28')](_0x468813[_0x0a9e('0x29')]);if(_0x468813['name']){delete _0x468813[_0x0a9e('0x2a')];}_0x5a101a[_0x0a9e('0x1a')](_0x3652a7)[_0x0a9e('0x2b')](_0x468813);};}exports[_0x0a9e('0x2c')]=function(_0x58b06f,_0x563b45){var _0x296f41={},_0x2e8759={},_0x1dbde2={'count':0x0,'rows':[]};var _0x540530=_[_0x0a9e('0x2d')](db['VoicePrefix'][_0x0a9e('0x2e')],function(_0x3ae878){return{'name':_0x3ae878[_0x0a9e('0x2f')],'type':_0x3ae878[_0x0a9e('0x30')][_0x0a9e('0x31')]};});_0x2e8759['model']=_[_0x0a9e('0x2d')](_0x540530,_0x0a9e('0x2a'));_0x2e8759[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x58b06f[_0x0a9e('0x32')]);_0x2e8759[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2e8759[_0x0a9e('0x36')],_0x2e8759['query']);_0x296f41[_0x0a9e('0x37')]=_['intersection'](_0x2e8759[_0x0a9e('0x36')],qs[_0x0a9e('0x38')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x38')]));_0x296f41['attributes']=_0x296f41[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x296f41[_0x0a9e('0x37')]:_0x2e8759[_0x0a9e('0x36')];if(!_0x58b06f['query']['hasOwnProperty'](_0x0a9e('0x3a'))){_0x296f41['limit']=qs[_0x0a9e('0x1d')](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x296f41[_0x0a9e('0x1b')]=qs['offset'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}_0x296f41[_0x0a9e('0x3b')]=qs['sort'](_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3c')]);_0x296f41[_0x0a9e('0x3d')]=qs['filters'](_['pick'](_0x58b06f[_0x0a9e('0x32')],_0x2e8759[_0x0a9e('0x34')]),_0x540530);if(_0x58b06f['query'][_0x0a9e('0x3e')]){_0x296f41[_0x0a9e('0x3d')]=_[_0x0a9e('0x3f')](_0x296f41[_0x0a9e('0x3d')],{'$or':_['map'](_0x540530,function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x30')]!==_0x0a9e('0x40')){var _0x53f3ee={};_0x53f3ee[_0x5a594b[_0x0a9e('0x2a')]]={'$like':'%'+_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x53f3ee;}})});}_0x296f41=_['merge']({},_0x296f41,_0x58b06f[_0x0a9e('0x41')]);var _0x2cfea9={'where':_0x296f41[_0x0a9e('0x3d')]};return db[_0x0a9e('0x42')][_0x0a9e('0x1e')](_0x2cfea9)[_0x0a9e('0x23')](function(_0x2881b3){_0x1dbde2[_0x0a9e('0x1e')]=_0x2881b3;if(_0x58b06f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x296f41[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x42')][_0x0a9e('0x45')](_0x296f41);})[_0x0a9e('0x23')](function(_0x37f6cc){_0x1dbde2['rows']=_0x37f6cc;return _0x1dbde2;})['then'](respondWithFilteredResult(_0x563b45,_0x296f41))[_0x0a9e('0x46')](handleError(_0x563b45,null));};exports[_0x0a9e('0x47')]=function(_0x405c8f,_0x315881){var _0x1a69dd={'raw':![],'where':{'id':_0x405c8f[_0x0a9e('0x48')]['id']}},_0xc9a702={};_0xc9a702[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x42')][_0x0a9e('0x2e')]);_0xc9a702[_0x0a9e('0x32')]=_['keys'](_0x405c8f[_0x0a9e('0x32')]);_0xc9a702[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],_0xc9a702[_0x0a9e('0x32')]);_0x1a69dd[_0x0a9e('0x37')]=_[_0x0a9e('0x35')](_0xc9a702[_0x0a9e('0x36')],qs['fields'](_0x405c8f[_0x0a9e('0x32')]['fields']));_0x1a69dd[_0x0a9e('0x37')]=_0x1a69dd[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x1a69dd['attributes']:_0xc9a702[_0x0a9e('0x36')];if(_0x405c8f[_0x0a9e('0x32')][_0x0a9e('0x43')]){_0x1a69dd[_0x0a9e('0x44')]=[{'all':!![]}];}_0x1a69dd=_[_0x0a9e('0x3f')]({},_0x1a69dd,_0x405c8f[_0x0a9e('0x41')]);return db[_0x0a9e('0x42')]['find'](_0x1a69dd)[_0x0a9e('0x23')](handleEntityNotFound(_0x315881,null))[_0x0a9e('0x23')](respondWithResult(_0x315881,null))[_0x0a9e('0x46')](handleError(_0x315881,null));};exports[_0x0a9e('0x24')]=function(_0x409789,_0x992c77){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x409789[_0x0a9e('0x48')]['id']}})['then'](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x23')](removeEntity(_0x992c77,null))[_0x0a9e('0x46')](handleError(_0x992c77,null));};exports['describe']=function(_0x4ae14b,_0x5ddf84){return db[_0x0a9e('0x42')][_0x0a9e('0x4a')]()[_0x0a9e('0x23')](respondWithResult(_0x5ddf84,null))[_0x0a9e('0x46')](handleError(_0x5ddf84,null));};exports[_0x0a9e('0x4b')]=function(_0x30decb,_0x2e5165){var _0x375c18;return db['sequelize']['transaction'](function(_0x53975a){return db[_0x0a9e('0x42')][_0x0a9e('0x4b')](_0x30decb[_0x0a9e('0x4c')],{'transaction':_0x53975a})['then'](function(_0x2b69d9){_0x375c18=_0x2b69d9[_0x0a9e('0x4d')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x375c18[_0x0a9e('0x4e')]},'raw':!![]})['then'](function(_0x443e72){return createVoicePrefixExtensions(_0x375c18,_0x443e72,_0x53975a);});});})['then'](function(){var _0x2e5e62=_0x30decb[_0x0a9e('0x4f')][_0x0a9e('0x4d')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x50')]===_0x0a9e('0x4f')){var _0x508b47=_0x375c18;return db['UserProfileSection'][_0x0a9e('0x49')]({'where':{'name':_0x0a9e('0x51'),'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x23')](function(_0x5ce9ac){if(_0x5ce9ac&&_0x5ce9ac[_0x0a9e('0x52')]===0x0){return db['UserProfileResource'][_0x0a9e('0x4b')]({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x5ce9ac['name'],'sectionId':_0x5ce9ac['id']},{})['then'](function(){return _0x375c18;});}else{return _0x375c18;}})[_0x0a9e('0x46')](function(_0x47de4c){logger[_0x0a9e('0x28')](_0x0a9e('0x53'),_0x47de4c);throw _0x47de4c;});}return _0x375c18;})[_0x0a9e('0x23')](respondWithResult(_0x2e5165,null))[_0x0a9e('0x46')](handleError(_0x2e5165,null));};function Extension(_0x232830,_0x272738,_0xd10662,_0x28d814){this['context']=_0x0a9e('0x54');this[_0x0a9e('0x55')]=_0x232830;this[_0x0a9e('0x56')]=_0xd10662;this[_0x0a9e('0x30')]=_0x0a9e('0x57');this[_0x0a9e('0x58')]='Voice\x20Prefix\x20Extension';this[_0x0a9e('0x59')]=_0x272738;this[_0x0a9e('0x5a')]=_0x28d814;}function createVoicePrefixExtensions(_0x5239ef,_0x3649cc,_0x5cc8fb){return new BPromise(function(_0x20c668,_0x5ba1f9){var _0x4b3c1a=new Extension(formatPrefixName(_0x5239ef['prefix']),0x1,_0x0a9e('0x5b'),'Voice\x20Prefix');_0x4b3c1a[_0x0a9e('0x5c')]=_0x5239ef['id'];return db[_0x0a9e('0x5d')][_0x0a9e('0x4b')](_0x4b3c1a,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x1cca9f){var _0x26d7db=_0x1cca9f['get']({'plain':!![]});var _0x1627a7=_['map'](addVoicePrefixExtensions(_0x5239ef,_0x3649cc),function(_0xca4ade){_0xca4ade[_0x0a9e('0x4e')]=_0x26d7db['id'];_0xca4ade[_0x0a9e('0x5c')]=_0x5239ef['id'];return _0xca4ade;});return db['VoiceExtension'][_0x0a9e('0x5e')](_0x1627a7,{'transaction':_0x5cc8fb})[_0x0a9e('0x23')](function(_0x119677){if(!_0x119677){return _0x5ba1f9(_0x0a9e('0x5f'));}else{return _0x20c668(_0x119677);}})['catch'](function(_0x1d0dc8){return _0x5ba1f9(_0x1d0dc8);});});;});};function addVoicePrefixExtensions(_0xe05a5a,_0x54327c){var _0x797b45=[];var _0x17e88c=formatPrefixName(_0xe05a5a[_0x0a9e('0x60')]);_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x2,_0x0a9e('0x62'),'CDR(prefix)='+_0xe05a5a[_0x0a9e('0x2a')]));if(_0xe05a5a[_0x0a9e('0x63')]){_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x3,'Set',_0x0a9e('0x64')+_0xe05a5a['callerIdAll']));}else{_0x797b45['push'](new Extension(_0x17e88c,0x3,_0x0a9e('0x5b'),_0x0a9e('0x65')));}_0x797b45[_0x0a9e('0x61')](new Extension(_0x17e88c,0x4,_0x0a9e('0x66'),_0x54327c[_0x0a9e('0x67')]+','+_0x0a9e('0x68')+(0x8+_0xe05a5a[_0x0a9e('0x2a')][_0x0a9e('0x39')])+'}'+','+0x1));return _0x797b45;}function formatPrefixName(_0x2d7205){var _0x1cc4f3='_';for(var _0x2e89b7=0x0;_0x2e89b7<_0x2d7205[_0x0a9e('0x39')];_0x2e89b7++){if(_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)=='-'){_0x1cc4f3+=_0x2d7205[_0x0a9e('0x69')](_0x2e89b7);}else{_0x1cc4f3+='['+_0x2d7205[_0x0a9e('0x69')](_0x2e89b7)+']';}}_0x1cc4f3+='.';return _0x1cc4f3;}exports[_0x0a9e('0x22')]=function(_0x2a28c0,_0x4257c9,_0x5150a4){var _0x1b0b98=_0x2a28c0[_0x0a9e('0x4c')];_0x1b0b98[_0x0a9e('0x60')]='system-'+_0x1b0b98[_0x0a9e('0x2a')]+'-';return db[_0x0a9e('0x6a')]['transaction'](function(_0x83f0b2){return db[_0x0a9e('0x42')][_0x0a9e('0x22')](_0x1b0b98,{'where':{'id':_0x1b0b98['id']},'transaction':_0x83f0b2})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x5d')]['destroy']({'where':{'VoicePrefixId':_0x1b0b98['id']},'transaction':_0x83f0b2})['then'](function(){return db['VoiceExtension'][_0x0a9e('0x49')]({'where':{'id':_0x1b0b98[_0x0a9e('0x4e')]},'raw':!![]})[_0x0a9e('0x23')](function(_0x23a7d3){return createVoicePrefixExtensions(_0x1b0b98,_0x23a7d3,_0x83f0b2);});});});})[_0x0a9e('0x23')](function(){return db[_0x0a9e('0x42')][_0x0a9e('0x6b')](_0x1b0b98['id']);})[_0x0a9e('0x23')](respondWithResult(_0x4257c9,null))['catch'](handleError(_0x4257c9,null));};exports[_0x0a9e('0x6c')]=function(_0xcbc8b2,_0x12ccdb,_0x4a4fc7){return db[_0x0a9e('0x42')]['find']({'where':{'id':_0xcbc8b2[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x12ccdb,null))['then'](function(_0x2ed01e){if(_0x2ed01e){return _0x2ed01e[_0x0a9e('0x6c')](_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')],_['omit'](_0xcbc8b2[_0x0a9e('0x4c')],[_0x0a9e('0x6d'),'id'])||{})[_0x0a9e('0x6e')](function(_0x278ab4){for(var _0x5b7fc3=0x0;_0x5b7fc3<_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x0a9e('0x39')];_0x5b7fc3+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:save',{'UserId':_0xcbc8b2[_0x0a9e('0x4c')][_0x0a9e('0x6d')][_0x5b7fc3],'VoicePrefixId':_0xcbc8b2[_0x0a9e('0x48')]['id']});}return _0x278ab4;});}})[_0x0a9e('0x23')](respondWithResult(_0x12ccdb,null))[_0x0a9e('0x46')](handleError(_0x12ccdb,null));};exports[_0x0a9e('0x70')]=function(_0x40fc56,_0x3df0e3,_0x1a7b03){return db[_0x0a9e('0x42')][_0x0a9e('0x49')]({'where':{'id':_0x40fc56[_0x0a9e('0x48')]['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x3df0e3,null))[_0x0a9e('0x23')](function(_0x5b35db){if(_0x5b35db){return _0x5b35db[_0x0a9e('0x70')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])['then'](function(){if(_[_0x0a9e('0x71')](_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')])){for(var _0x2b9463=0x0;_0x2b9463<_0x40fc56['query']['ids'][_0x0a9e('0x39')];_0x2b9463+=0x1){socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')]['ids'][_0x2b9463]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}}else{socket[_0x0a9e('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x40fc56[_0x0a9e('0x32')][_0x0a9e('0x6d')]),'VoicePrefixId':Number(_0x40fc56[_0x0a9e('0x48')]['id'])});}});}})[_0x0a9e('0x23')](respondWithStatusCode(_0x3df0e3,null))[_0x0a9e('0x46')](handleError(_0x3df0e3,null));};exports[_0x0a9e('0x72')]=function(_0x444f1f,_0x482ca2,_0x2973d3){var _0x3ca9b9={};var _0x45c109={};var _0x16e5b9;var _0x492543;return db[_0x0a9e('0x42')][_0x0a9e('0x73')]({'where':{'id':_0x444f1f['params']['id']}})[_0x0a9e('0x23')](handleEntityNotFound(_0x482ca2,null))['then'](function(_0x163710){if(_0x163710){_0x16e5b9=_0x163710;_0x45c109[_0x0a9e('0x36')]=_[_0x0a9e('0x33')](db[_0x0a9e('0x74')]['rawAttributes']);_0x45c109['query']=_[_0x0a9e('0x33')](_0x444f1f[_0x0a9e('0x32')]);_0x45c109[_0x0a9e('0x34')]=_['intersection'](_0x45c109[_0x0a9e('0x36')],_0x45c109[_0x0a9e('0x32')]);_0x3ca9b9['attributes']=_['intersection'](_0x45c109[_0x0a9e('0x36')],qs['fields'](_0x444f1f['query']['fields']));_0x3ca9b9[_0x0a9e('0x37')]=_0x3ca9b9[_0x0a9e('0x37')][_0x0a9e('0x39')]?_0x3ca9b9[_0x0a9e('0x37')]:_0x45c109[_0x0a9e('0x36')];_0x3ca9b9[_0x0a9e('0x3b')]=qs['sort'](_0x444f1f[_0x0a9e('0x32')]['sort']);_0x3ca9b9[_0x0a9e('0x3d')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x75')](_0x444f1f[_0x0a9e('0x32')],_0x45c109['filters']));if(_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]){_0x3ca9b9[_0x0a9e('0x3d')]=_['merge'](_0x3ca9b9[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x2d')](_0x3ca9b9[_0x0a9e('0x37')],function(_0x22063c){var _0x255e49={};_0x255e49[_0x22063c]={'$like':'%'+_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x3e')]+'%'};return _0x255e49;})});}_0x3ca9b9=_[_0x0a9e('0x3f')]({},_0x3ca9b9,_0x444f1f['options']);return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x589ff3){if(_0x589ff3){_0x492543=_0x589ff3[_0x0a9e('0x39')];if(!_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x76')]('nolimit')){_0x3ca9b9[_0x0a9e('0x1d')]=qs['limit'](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1d')]);_0x3ca9b9[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x444f1f[_0x0a9e('0x32')][_0x0a9e('0x1b')]);}return _0x16e5b9[_0x0a9e('0x72')](_0x3ca9b9);}})[_0x0a9e('0x23')](function(_0x501050){if(_0x501050){return _0x501050?{'count':_0x492543,'rows':_0x501050}:null;}})[_0x0a9e('0x23')](respondWithResult(_0x482ca2,null))[_0x0a9e('0x46')](handleError(_0x482ca2,null));};
\ No newline at end of file
index 4c202a7..6494357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e0=['update','emit','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0xb775ac,_0x4844f7){var _0x3b18f7=function(_0x217dc8){while(--_0x217dc8){_0xb775ac['push'](_0xb775ac['shift']());}};_0x3b18f7(++_0x4844f7);}(_0x50e0,0x164));var _0x050e=function(_0x3ddda3,_0x51d064){_0x3ddda3=_0x3ddda3-0x0;var _0x5db355=_0x50e0[_0x3ddda3];return _0x5db355;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x050e('0x0'))['db'][_0x050e('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x050e('0x2')](0x0);var events={'afterCreate':_0x050e('0x3'),'afterUpdate':_0x050e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x241a85){return function(_0x5d159d,_0x2df593,_0x4287f8){VoicePrefixEvents[_0x050e('0x5')](_0x241a85+':'+_0x5d159d['id'],_0x5d159d);VoicePrefixEvents['emit'](_0x241a85,_0x5d159d);_0x4287f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x050e('0x6')](e,emitEvent(event));}}module[_0x050e('0x7')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x28f5=['update','emit','hook','events','../../mysqldb','VoicePrefix'];(function(_0x5504fc,_0x2e161c){var _0xbad34c=function(_0x1f62de){while(--_0x1f62de){_0x5504fc['push'](_0x5504fc['shift']());}};_0xbad34c(++_0x2e161c);}(_0x28f5,0xf3));var _0x528f=function(_0x3238d7,_0x1601a5){_0x3238d7=_0x3238d7-0x0;var _0x5d5bca=_0x28f5[_0x3238d7];return _0x5d5bca;};'use strict';var EventEmitter=require(_0x528f('0x0'));var VoicePrefix=require(_0x528f('0x1'))['db'][_0x528f('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x528f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x584b1d){return function(_0x37c393,_0x13bb9e,_0x28927e){VoicePrefixEvents[_0x528f('0x4')](_0x584b1d+':'+_0x37c393['id'],_0x37c393);VoicePrefixEvents[_0x528f('0x4')](_0x584b1d,_0x37c393);_0x28927e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x528f('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index d5e8c0e..fbd8c6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1a3=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf1a3,0xc0));var _0x3f1a=function(_0x3c7d53,_0x2826d0){_0x3c7d53=_0x3c7d53-0x0;var _0x2c8387=_0xf1a3[_0x3c7d53];return _0x2c8387;};'use strict';var _=require(_0x3f1a('0x0'));var util=require(_0x3f1a('0x1'));var logger=require(_0x3f1a('0x2'))(_0x3f1a('0x3'));var moment=require(_0x3f1a('0x4'));var BPromise=require(_0x3f1a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3f1a('0x6'));var attributes=require(_0x3f1a('0x7'));module[_0x3f1a('0x8')]=function(_0x577fbb,_0x298fb0){return _0x577fbb[_0x3f1a('0x9')](_0x3f1a('0xa'),attributes,{'tableName':_0x3f1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb66=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0x39a0c4,_0x222bc1){var _0x5b661b=function(_0x404443){while(--_0x404443){_0x39a0c4['push'](_0x39a0c4['shift']());}};_0x5b661b(++_0x222bc1);}(_0xfb66,0x1b2));var _0x6fb6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xfb66[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x6fb6('0x0'));var util=require(_0x6fb6('0x1'));var logger=require(_0x6fb6('0x2'))(_0x6fb6('0x3'));var moment=require(_0x6fb6('0x4'));var BPromise=require(_0x6fb6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fb6('0x6'));var rimraf=require(_0x6fb6('0x7'));var config=require(_0x6fb6('0x8'));var attributes=require(_0x6fb6('0x9'));module[_0x6fb6('0xa')]=function(_0x4efdaa,_0x1dbc55){return _0x4efdaa[_0x6fb6('0xb')](_0x6fb6('0xc'),attributes,{'tableName':_0x6fb6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e6b786..cba0659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34f0=['redis','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x8980,_0x3e943b){var _0x3491a6=function(_0x1acbf3){while(--_0x1acbf3){_0x8980['push'](_0x8980['shift']());}};_0x3491a6(++_0x3e943b);}(_0x34f0,0x13b));var _0x034f=function(_0x295427,_0x7182b){_0x295427=_0x295427-0x0;var _0x3334e2=_0x34f0[_0x295427];return _0x3334e2;};'use strict';var _=require(_0x034f('0x0'));var util=require(_0x034f('0x1'));var moment=require('moment');var BPromise=require(_0x034f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x034f('0x3'));var db=require(_0x034f('0x4'))['db'];var utils=require(_0x034f('0x5'));var logger=require(_0x034f('0x6'))(_0x034f('0x7'));var config=require('../../config/environment');var jayson=require(_0x034f('0x8'));var client=jayson[_0x034f('0x9')]['http']({'port':0x232a});config[_0x034f('0xa')]=_['defaults'](config[_0x034f('0xa')],{'host':_0x034f('0xb'),'port':0x18eb});var socket=require(_0x034f('0xc'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x034f('0xd')](socket);function respondWithRpcPromise(_0x50909e,_0x48ed9b,_0x453bc2){return new BPromise(function(_0x3ec935,_0x8a0835){return client[_0x034f('0xe')](_0x50909e,_0x453bc2)[_0x034f('0xf')](function(_0x4e0888){logger[_0x034f('0x10')](_0x034f('0x11'),_0x48ed9b,_0x034f('0x12'));logger['debug'](_0x034f('0x13'),_0x48ed9b,'request\x20sent',JSON[_0x034f('0x14')](_0x4e0888));if(_0x4e0888[_0x034f('0x15')]){if(_0x4e0888[_0x034f('0x15')][_0x034f('0x16')]===0x1f4){logger[_0x034f('0x15')](_0x034f('0x11'),_0x48ed9b,_0x4e0888[_0x034f('0x15')][_0x034f('0x17')]);return _0x8a0835(_0x4e0888['error']['message']);}logger[_0x034f('0x15')](_0x034f('0x11'),_0x48ed9b,_0x4e0888[_0x034f('0x15')]['message']);return _0x3ec935(_0x4e0888['error'][_0x034f('0x17')]);}else{logger[_0x034f('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x48ed9b,_0x034f('0x12'));_0x3ec935(_0x4e0888['result'][_0x034f('0x17')]);}})[_0x034f('0x18')](function(_0x1ebb01){logger['error'](_0x034f('0x11'),_0x48ed9b,_0x1ebb01);_0x8a0835(_0x1ebb01);});});}
\ No newline at end of file
+var _0x6f44=['socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x2c2d2a,_0x1d9882){var _0x1b1385=function(_0x52e0c1){while(--_0x52e0c1){_0x2c2d2a['push'](_0x2c2d2a['shift']());}};_0x1b1385(++_0x1d9882);}(_0x6f44,0x1ea));var _0x46f4=function(_0x3575e2,_0x2e6294){_0x3575e2=_0x3575e2-0x0;var _0x3f94e6=_0x6f44[_0x3575e2];return _0x3f94e6;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var moment=require('moment');var BPromise=require(_0x46f4('0x2'));var rs=require(_0x46f4('0x3'));var fs=require('fs');var Redis=require(_0x46f4('0x4'));var db=require(_0x46f4('0x5'))['db'];var utils=require(_0x46f4('0x6'));var logger=require(_0x46f4('0x7'))(_0x46f4('0x8'));var config=require(_0x46f4('0x9'));var jayson=require(_0x46f4('0xa'));var client=jayson['client'][_0x46f4('0xb')]({'port':0x232a});config[_0x46f4('0xc')]=_[_0x46f4('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x46f4('0xe'))(new Redis(config[_0x46f4('0xc')]));require('./voicePrefix.socket')[_0x46f4('0xf')](socket);function respondWithRpcPromise(_0x5662a3,_0x2064fd,_0x487ef8){return new BPromise(function(_0x14cc75,_0x1fe1a5){return client[_0x46f4('0x10')](_0x5662a3,_0x487ef8)[_0x46f4('0x11')](function(_0xbc1148){logger[_0x46f4('0x12')](_0x46f4('0x13'),_0x2064fd,_0x46f4('0x14'));logger[_0x46f4('0x15')](_0x46f4('0x16'),_0x2064fd,_0x46f4('0x14'),JSON[_0x46f4('0x17')](_0xbc1148));if(_0xbc1148['error']){if(_0xbc1148[_0x46f4('0x18')][_0x46f4('0x19')]===0x1f4){logger['error'](_0x46f4('0x13'),_0x2064fd,_0xbc1148[_0x46f4('0x18')][_0x46f4('0x1a')]);return _0x1fe1a5(_0xbc1148['error'][_0x46f4('0x1a')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x2064fd,_0xbc1148[_0x46f4('0x18')][_0x46f4('0x1a')]);return _0x14cc75(_0xbc1148[_0x46f4('0x18')]['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x2064fd,'request\x20sent');_0x14cc75(_0xbc1148[_0x46f4('0x1b')][_0x46f4('0x1a')]);}})['catch'](function(_0x22209b){logger[_0x46f4('0x18')](_0x46f4('0x13'),_0x2064fd,_0x22209b);_0x1fe1a5(_0x22209b);});});}
\ No newline at end of file
index 81bfff7..350bb0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x644a=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register','length'];(function(_0x57646a,_0x3b8eaf){var _0x189c6f=function(_0x52a163){while(--_0x52a163){_0x57646a['push'](_0x57646a['shift']());}};_0x189c6f(++_0x3b8eaf);}(_0x644a,0xfd));var _0xa644=function(_0x310da1,_0x390f65){_0x310da1=_0x310da1-0x0;var _0x333d17=_0x644a[_0x310da1];return _0x333d17;};'use strict';var VoicePrefixEvents=require(_0xa644('0x0'));var events=[_0xa644('0x1'),_0xa644('0x2'),_0xa644('0x3')];function createListener(_0x3a3218,_0x48801b){return function(_0x1423b7){_0x48801b[_0xa644('0x4')](_0x3a3218,_0x1423b7);};}function removeListener(_0x526de6,_0x4f6ed9){return function(){VoicePrefixEvents[_0xa644('0x5')](_0x526de6,_0x4f6ed9);};}exports[_0xa644('0x6')]=function(_0x3e1ca6){for(var _0x5d78a7=0x0,_0xa4af13=events[_0xa644('0x7')];_0x5d78a7<_0xa4af13;_0x5d78a7++){var _0x4f8b23=events[_0x5d78a7];var _0x15995f=createListener(_0xa644('0x8')+_0x4f8b23,_0x3e1ca6);VoicePrefixEvents['on'](_0x4f8b23,_0x15995f);}};
\ No newline at end of file
+var _0xd8cc=['removeListener','length','voicePrefix:','./voicePrefix.events','save','emit'];(function(_0x3d9662,_0x22b32c){var _0x302fb9=function(_0xf4a8de){while(--_0xf4a8de){_0x3d9662['push'](_0x3d9662['shift']());}};_0x302fb9(++_0x22b32c);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0xd8cc[_0x1b76e6];return _0x333b53;};'use strict';var VoicePrefixEvents=require(_0xcd8c('0x0'));var events=[_0xcd8c('0x1'),'remove','update'];function createListener(_0x1576d8,_0x7f40a7){return function(_0x1a1e1e){_0x7f40a7[_0xcd8c('0x2')](_0x1576d8,_0x1a1e1e);};}function removeListener(_0x58d2c9,_0x2dad29){return function(){VoicePrefixEvents[_0xcd8c('0x3')](_0x58d2c9,_0x2dad29);};}exports['register']=function(_0x5776fc){for(var _0x233d52=0x0,_0x55c4ed=events[_0xcd8c('0x4')];_0x233d52<_0x55c4ed;_0x233d52++){var _0x5814b4=events[_0x233d52];var _0x4740bf=createListener(_0xcd8c('0x5')+_0x5814b4,_0x5776fc);VoicePrefixEvents['on'](_0x5814b4,_0x4740bf);}};
\ No newline at end of file
index 3ad6328..b24dda6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb746=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','/:id/lists','delete','/:id/blacklists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0xb746,0x1c7));var _0x6b74=function(_0x5ae0da,_0x1cfc0f){_0x5ae0da=_0x5ae0da-0x0;var _0x22c950=_0xb746[_0x5ae0da];return _0x22c950;};'use strict';var multer=require('multer');var util=require(_0x6b74('0x0'));var path=require(_0x6b74('0x1'));var timeout=require(_0x6b74('0x2'));var express=require(_0x6b74('0x3'));var router=express[_0x6b74('0x4')]();var fs_extra=require(_0x6b74('0x5'));var auth=require(_0x6b74('0x6'));var interaction=require(_0x6b74('0x7'));var config=require(_0x6b74('0x8'));var controller=require('./voiceQueue.controller');router[_0x6b74('0x9')]('/',auth[_0x6b74('0xa')](),controller[_0x6b74('0xb')]);router['get'](_0x6b74('0xc'),auth[_0x6b74('0xa')](),controller['show']);router[_0x6b74('0x9')](_0x6b74('0xd'),auth[_0x6b74('0xa')](),controller[_0x6b74('0xe')]);router['get'](_0x6b74('0xf'),auth[_0x6b74('0xa')](),controller[_0x6b74('0x10')]);router[_0x6b74('0x9')](_0x6b74('0x11'),auth[_0x6b74('0xa')](),controller['getHopperFinals']);router[_0x6b74('0x9')](_0x6b74('0x12'),auth[_0x6b74('0xa')](),controller[_0x6b74('0x13')]);router[_0x6b74('0x9')](_0x6b74('0x14'),auth['isAuthenticated'](),controller[_0x6b74('0x15')]);router[_0x6b74('0x9')](_0x6b74('0x16'),auth[_0x6b74('0xa')](),controller[_0x6b74('0x17')]);router['get'](_0x6b74('0x18'),auth[_0x6b74('0xa')](),controller[_0x6b74('0x19')]);router[_0x6b74('0x9')]('/:id/lists',auth[_0x6b74('0xa')](),controller[_0x6b74('0x1a')]);router[_0x6b74('0x9')]('/:id/blacklists',auth[_0x6b74('0xa')](),controller[_0x6b74('0x1b')]);router[_0x6b74('0x1c')]('/',auth['isAuthenticated'](),controller[_0x6b74('0x1d')]);router['post'](_0x6b74('0x1e'),auth['isAuthenticated'](),controller[_0x6b74('0x1f')]);router['post'](_0x6b74('0x14'),auth[_0x6b74('0xa')](),controller[_0x6b74('0x20')]);router['post'](_0x6b74('0x16'),auth[_0x6b74('0xa')](),controller[_0x6b74('0x21')]);router[_0x6b74('0x1c')](_0x6b74('0x22'),auth[_0x6b74('0xa')](),controller['addLists']);router[_0x6b74('0x1c')]('/:id/blacklists',auth[_0x6b74('0xa')](),controller['addBlackLists']);router['put']('/:id',auth[_0x6b74('0xa')](),controller['update']);router[_0x6b74('0x23')](_0x6b74('0xc'),auth[_0x6b74('0xa')](),controller['destroy']);router[_0x6b74('0x23')](_0x6b74('0x14'),auth[_0x6b74('0xa')](),controller['removeTeams']);router[_0x6b74('0x23')](_0x6b74('0x16'),auth[_0x6b74('0xa')](),controller['removeAgents']);router[_0x6b74('0x23')](_0x6b74('0x22'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x6b74('0x24'),auth['isAuthenticated'](),controller[_0x6b74('0x25')]);module[_0x6b74('0x26')]=router;
\ No newline at end of file
+var _0xa842=['path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','update','delete','removeTeams','removeLists','removeBlackLists','exports','util'];(function(_0x326876,_0x4bea84){var _0x44dfef=function(_0x3d6f8a){while(--_0x3d6f8a){_0x326876['push'](_0x326876['shift']());}};_0x44dfef(++_0x4bea84);}(_0xa842,0xb8));var _0x2a84=function(_0x292772,_0x309ee9){_0x292772=_0x292772-0x0;var _0x40f3ff=_0xa842[_0x292772];return _0x40f3ff;};'use strict';var multer=require('multer');var util=require(_0x2a84('0x0'));var path=require(_0x2a84('0x1'));var timeout=require('connect-timeout');var express=require(_0x2a84('0x2'));var router=express[_0x2a84('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2a84('0x4'));var config=require(_0x2a84('0x5'));var controller=require('./voiceQueue.controller');router[_0x2a84('0x6')]('/',auth[_0x2a84('0x7')](),controller[_0x2a84('0x8')]);router[_0x2a84('0x6')](_0x2a84('0x9'),auth[_0x2a84('0x7')](),controller['show']);router[_0x2a84('0x6')]('/:id/hoppers',auth[_0x2a84('0x7')](),controller['getHoppers']);router[_0x2a84('0x6')](_0x2a84('0xa'),auth[_0x2a84('0x7')](),controller[_0x2a84('0xb')]);router[_0x2a84('0x6')](_0x2a84('0xc'),auth[_0x2a84('0x7')](),controller[_0x2a84('0xd')]);router[_0x2a84('0x6')](_0x2a84('0xe'),auth[_0x2a84('0x7')](),controller[_0x2a84('0xf')]);router[_0x2a84('0x6')](_0x2a84('0x10'),auth['isAuthenticated'](),controller[_0x2a84('0x11')]);router[_0x2a84('0x6')](_0x2a84('0x12'),auth[_0x2a84('0x7')](),controller['getAgents']);router[_0x2a84('0x6')](_0x2a84('0x13'),auth[_0x2a84('0x7')](),controller['getMembers']);router[_0x2a84('0x6')](_0x2a84('0x14'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x15')]);router[_0x2a84('0x6')](_0x2a84('0x16'),auth[_0x2a84('0x7')](),controller['getBlackLists']);router[_0x2a84('0x17')]('/',auth[_0x2a84('0x7')](),controller[_0x2a84('0x18')]);router[_0x2a84('0x17')](_0x2a84('0x19'),auth['isAuthenticated'](),controller['clone']);router[_0x2a84('0x17')](_0x2a84('0x10'),auth['isAuthenticated'](),controller[_0x2a84('0x1a')]);router[_0x2a84('0x17')](_0x2a84('0x12'),auth['isAuthenticated'](),controller[_0x2a84('0x1b')]);router[_0x2a84('0x17')](_0x2a84('0x14'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x1c')]);router[_0x2a84('0x17')]('/:id/blacklists',auth[_0x2a84('0x7')](),controller[_0x2a84('0x1d')]);router[_0x2a84('0x1e')](_0x2a84('0x9'),auth['isAuthenticated'](),controller[_0x2a84('0x1f')]);router['delete'](_0x2a84('0x9'),auth[_0x2a84('0x7')](),controller['destroy']);router[_0x2a84('0x20')](_0x2a84('0x10'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x21')]);router[_0x2a84('0x20')](_0x2a84('0x12'),auth[_0x2a84('0x7')](),controller['removeAgents']);router[_0x2a84('0x20')](_0x2a84('0x14'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x22')]);router['delete'](_0x2a84('0x16'),auth[_0x2a84('0x7')](),controller[_0x2a84('0x23')]);module[_0x2a84('0x24')]=router;
\ No newline at end of file
index a154060..88ef365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d61=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x4d61,0x147));var _0x14d6=function(_0x38c908,_0x5b07c4){_0x38c908=_0x38c908-0x0;var _0x4f6ffd=_0x4d61[_0x38c908];return _0x4f6ffd;};'use strict';var Sequelize=require(_0x14d6('0x0'));module[_0x14d6('0x1')]={'name':{'type':Sequelize[_0x14d6('0x2')],'allowNull':![],'unique':_0x14d6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x5'),_0x14d6('0x6')),'allowNull':![],'defaultValue':_0x14d6('0x5')},'musiconhold':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x14d6('0x4')]('rr',_0x14d6('0x7'),_0x14d6('0x8'),_0x14d6('0x9'),_0x14d6('0xa'),_0x14d6('0xb'),'linear',_0x14d6('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x14d6('0x7'),'set':function(_0x590979){this[_0x14d6('0xd')](_0x14d6('0xe'),_0x590979?_0x590979:'rrmemory');},'get':function(){var _0x16db02=this[_0x14d6('0xf')](_0x14d6('0x10'));var _0x1c2baf=this[_0x14d6('0xf')](_0x14d6('0x11'));var _0x36a070=this[_0x14d6('0xf')](_0x14d6('0xe'));if(_0x16db02===_0x14d6('0x5')){return _0x36a070;}if(_0x1c2baf===_0x14d6('0x12')&&_0x36a070==='rrmemory'||_0x1c2baf===_0x14d6('0x12')&&_0x36a070===_0x14d6('0x13')){return _0x36a070;}if(_0x1c2baf===_0x14d6('0x14')||_0x1c2baf===_0x14d6('0x15')||_0x1c2baf===_0x14d6('0x16')){return _0x36a070;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x14d6('0x17')](0xb)},'timeout':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x14d6('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':_0x14d6('0x18')},'autopause':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no',_0x14d6('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x14d6('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':_0x14d6('0x18')},'announce_holdtime':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x14d6('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x14d6('0x2')]},'queue_youarenext':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x14d6('0x2')]},'queue_quantity1':{'type':Sequelize[_0x14d6('0x2')]},'queue_quantity2':{'type':Sequelize[_0x14d6('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x14d6('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x15d098){this[_0x14d6('0xd')](_0x14d6('0x1a'),_0x15d098?_0x15d098[_0x14d6('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x14d6('0x1a'))?this[_0x14d6('0xf')](_0x14d6('0x1a'))[_0x14d6('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'yes','set':function(_0xde044d){this['setDataValue'](_0x14d6('0x1d'),_0xde044d?_0xde044d[_0x14d6('0x1b')](','):undefined);},'get':function(){return this[_0x14d6('0xf')](_0x14d6('0x1d'))?this[_0x14d6('0xf')](_0x14d6('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'no','set':function(_0x1e4a29){this[_0x14d6('0xd')](_0x14d6('0x1e'),_0x1e4a29?_0x1e4a29[_0x14d6('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x14d6('0x1e'))?this[_0x14d6('0xf')](_0x14d6('0x1e'))[_0x14d6('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x14d6('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'set':function(_0xd31054){this['setDataValue']('acw',_0xd31054);if(_0xd31054){if(this[_0x14d6('0xf')]('wrapuptime')<0x2){this[_0x14d6('0xd')](_0x14d6('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x21'),_0x14d6('0x14'),_0x14d6('0x16'),'predictive',_0x14d6('0x12')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x14d6('0x17')](0x4)[_0x14d6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14d6('0x23')},'dialLimitQueue':{'type':Sequelize[_0x14d6('0x17')](0x4)[_0x14d6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14d6('0x24')},'dialPowerLevel':{'type':Sequelize[_0x14d6('0x25')](0x2)[_0x14d6('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x14d6('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x27'),_0x14d6('0x28')),'defaultValue':_0x14d6('0x28'),'comment':_0x14d6('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x14d6('0x25')](0x2)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x14d6('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x14d6('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x14d6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x14d6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':_0x14d6('0x2d'),'comment':_0x14d6('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14d6('0x34')},'dialTimezone':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x14d6('0x35')},'dialPrefix':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x36'),'never',_0x14d6('0x37')),'defaultValue':_0x14d6('0x36')},'dialAMDActive':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':_0x14d6('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x14d6('0x39')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x14d6('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14d6('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14d6('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x14d6('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x14d6('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14d6('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14d6('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x14d6('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':_0x14d6('0x41')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x14d6('0x42'),'ASC'),'defaultValue':_0x14d6('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14d6('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14d6('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x14d6('0x17')],'allowNull':!![],'comment':_0x14d6('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':![],'comment':_0x14d6('0x4f'),'set':function(_0x43bcf3){if(!_0x43bcf3)this[_0x14d6('0xd')](_0x14d6('0x50'),null);this[_0x14d6('0xd')]('mandatoryDisposition',_0x43bcf3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x72d2=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','strategy','booked','progressive','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','wrapuptime','BOOLEAN','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','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2489f0,_0x3b58a8){var _0x3d6f6a=function(_0x23ddb3){while(--_0x23ddb3){_0x2489f0['push'](_0x2489f0['shift']());}};_0x3d6f6a(++_0x3b58a8);}(_0x72d2,0xb9));var _0x272d=function(_0x5ecc63,_0x110d0d){_0x5ecc63=_0x5ecc63-0x0;var _0x56e65f=_0x72d2[_0x5ecc63];return _0x56e65f;};'use strict';var Sequelize=require(_0x272d('0x0'));module[_0x272d('0x1')]={'name':{'type':Sequelize[_0x272d('0x2')],'allowNull':![],'unique':_0x272d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x5'),_0x272d('0x6')),'allowNull':![],'defaultValue':_0x272d('0x5')},'musiconhold':{'type':Sequelize[_0x272d('0x2')],'defaultValue':_0x272d('0x7')},'announce':{'type':Sequelize[_0x272d('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x272d('0x4')]('rr',_0x272d('0x8'),_0x272d('0x9'),_0x272d('0xa'),_0x272d('0xb'),_0x272d('0xc'),_0x272d('0xd'),_0x272d('0xe'),_0x272d('0xf')),'allowNull':![],'defaultValue':_0x272d('0x8'),'set':function(_0x50e181){this[_0x272d('0x10')]('strategy',_0x50e181?_0x50e181:'rrmemory');},'get':function(){var _0x259574=this['getDataValue']('type');var _0x35fe94=this[_0x272d('0x11')]('dialMethod');var _0x24bddd=this[_0x272d('0x11')](_0x272d('0x12'));if(_0x259574===_0x272d('0x5')){return _0x24bddd;}if(_0x35fe94===_0x272d('0x13')&&_0x24bddd===_0x272d('0xc')||_0x35fe94==='booked'&&_0x24bddd==='roundrobin'){return _0x24bddd;}if(_0x35fe94===_0x272d('0x14')||_0x35fe94===_0x272d('0x15')||_0x35fe94===_0x272d('0x16')){return _0x24bddd;}return null;}},'servicelevel':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x272d('0x17')](0xb)},'timeout':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x272d('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':_0x272d('0x18')},'autopause':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x272d('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x272d('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':_0x272d('0x18')},'announce_holdtime':{'type':Sequelize[_0x272d('0x4')]('yes','no',_0x272d('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x272d('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x272d('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x272d('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x272d('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x272d('0x2')]},'queue_youarenext':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x272d('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x272d('0x2')]},'queue_quantity1':{'type':Sequelize[_0x272d('0x2')]},'queue_quantity2':{'type':Sequelize[_0x272d('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x272d('0x2')]},'queue_less_than':{'type':Sequelize[_0x272d('0x2')]},'periodic_announce':{'type':Sequelize[_0x272d('0x1a')],'set':function(_0x3fb2e4){this[_0x272d('0x10')](_0x272d('0x1b'),_0x3fb2e4?_0x3fb2e4[_0x272d('0x1c')](','):[]);},'get':function(){return this[_0x272d('0x11')](_0x272d('0x1b'))?this[_0x272d('0x11')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x272d('0x2')],'defaultValue':_0x272d('0x18'),'set':function(_0x3921e4){this[_0x272d('0x10')](_0x272d('0x1d'),_0x3921e4?_0x3921e4['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x272d('0x1d'))?this[_0x272d('0x11')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x272d('0x2')],'defaultValue':'no','set':function(_0x238838){this[_0x272d('0x10')](_0x272d('0x1e'),_0x238838?_0x238838['join'](','):undefined);},'get':function(){return this[_0x272d('0x11')](_0x272d('0x1e'))?this[_0x272d('0x11')](_0x272d('0x1e'))[_0x272d('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x272d('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x272d('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x590ff6){this[_0x272d('0x10')]('acw',_0x590ff6);if(_0x590ff6){if(this[_0x272d('0x11')](_0x272d('0x20'))<0x2){this[_0x272d('0x10')](_0x272d('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x272d('0x21')],'defaultValue':0x0,'comment':_0x272d('0x22')},'dialMethod':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x23'),'progressive',_0x272d('0x16'),'predictive','booked'),'defaultValue':'progressive','comment':_0x272d('0x24')},'dialLimitChannel':{'type':Sequelize[_0x272d('0x17')](0x4)[_0x272d('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x272d('0x26')},'dialLimitQueue':{'type':Sequelize[_0x272d('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x272d('0x27')},'dialPowerLevel':{'type':Sequelize[_0x272d('0x28')](0x2)[_0x272d('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x272d('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x272d('0x4')](_0x272d('0x2a'),_0x272d('0x2b')),'defaultValue':_0x272d('0x2b'),'comment':_0x272d('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x272d('0x2d')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x272d('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x272d('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x272d('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x272d('0x17')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x272d('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x30')},'dialQueueProject':{'type':Sequelize[_0x272d('0x2')],'comment':_0x272d('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x272d('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x36')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x272d('0x37')},'dialTimezone':{'type':Sequelize[_0x272d('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x272d('0x2')],'defaultValue':_0x272d('0x38')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x272d('0x39'),_0x272d('0x3a'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x272d('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x272d('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x272d('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x272d('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x272d('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x272d('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x272d('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x272d('0x17')](0x9)[_0x272d('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x272d('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x272d('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x272d('0x21')],'defaultValue':0x0,'comment':_0x272d('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x272d('0x4')]('DESC','ASC'),'defaultValue':_0x272d('0x44')},'dialQueueProject2':{'type':Sequelize[_0x272d('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x272d('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x272d('0x45')},'dialCutDigit':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x272d('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x272d('0x17')](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x272d('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x272d('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x272d('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x272d('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x272d('0x17')],'allowNull':!![],'comment':_0x272d('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x272d('0x21')],'defaultValue':![],'comment':_0x272d('0x4d'),'set':function(_0x281fde){if(!_0x281fde)this[_0x272d('0x10')](_0x272d('0x4e'),null);this[_0x272d('0x10')](_0x272d('0x4f'),_0x281fde);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x272d('0x17')](0x3)[_0x272d('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index ea3ac5e..531e7a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc540=['push','toString','sequelize','SELECT','every','TeamId','all','union','removeTeams','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','interface','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','select','NOW()','scheduledAt','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','fromQuery','ListId','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','VoiceQueue','includeAll','include','findAll','rows','catch','show','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','hasOwnProperty','CmHopper','getHopperHistories','VoiceQueueId','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','voicePause','flatMap','forEach','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','format','SIP/%s','emit','ids','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc540,0x198));var _0x0c54=function(_0x2aaf28,_0xdc2dd9){_0x2aaf28=_0x2aaf28-0x0;var _0x6cdb0b=_0xc540[_0x2aaf28];return _0x6cdb0b;};'use strict';var emlformat=require(_0x0c54('0x0'));var rimraf=require(_0x0c54('0x1'));var zipdir=require(_0x0c54('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0c54('0x3'));var Mustache=require(_0x0c54('0x4'));var util=require(_0x0c54('0x5'));var path=require(_0x0c54('0x6'));var sox=require(_0x0c54('0x7'));var csv=require('to-csv');var ejs=require(_0x0c54('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c54('0x9'));var squel=require(_0x0c54('0xa'));var crypto=require(_0x0c54('0xb'));var jsforce=require(_0x0c54('0xc'));var deskjs=require(_0x0c54('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0c54('0xe'));var Papa=require(_0x0c54('0xf'));var Redis=require(_0x0c54('0x10'));var authService=require(_0x0c54('0x11'));var qs=require(_0x0c54('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c54('0x13'))('api');var utils=require(_0x0c54('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0c54('0x15'));var db=require(_0x0c54('0x16'))['db'];config[_0x0c54('0x17')]=_[_0x0c54('0x18')](config[_0x0c54('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c54('0x19'))(new Redis(config[_0x0c54('0x17')]));require(_0x0c54('0x1a'))[_0x0c54('0x1b')](socket);function respondWithStatusCode(_0x3bf220,_0x12592c){_0x12592c=_0x12592c||0xcc;return function(_0x185744){if(_0x185744){return _0x3bf220[_0x0c54('0x1c')](_0x12592c);}return _0x3bf220[_0x0c54('0x1d')](_0x12592c)[_0x0c54('0x1e')]();};}function respondWithResult(_0x30bd88,_0x284ced){_0x284ced=_0x284ced||0xc8;return function(_0x1e44d0){if(_0x1e44d0){return _0x30bd88[_0x0c54('0x1d')](_0x284ced)[_0x0c54('0x1f')](_0x1e44d0);}};}function respondWithFilteredResult(_0x1410e6,_0xb54318){return function(_0x288423){if(_0x288423){var _0x32204d=typeof _0xb54318[_0x0c54('0x20')]===_0x0c54('0x21')&&typeof _0xb54318[_0x0c54('0x22')]===_0x0c54('0x21');var _0x242e6f=_0x288423[_0x0c54('0x23')];var _0x4f144c=_0x32204d?0x0:_0xb54318['offset'];var _0x1ce658=_0x32204d?_0x288423[_0x0c54('0x23')]:_0xb54318[_0x0c54('0x20')]+_0xb54318[_0x0c54('0x22')];var _0x3e3065;if(_0x1ce658>=_0x242e6f){_0x1ce658=_0x242e6f;_0x3e3065=0xc8;}else{_0x3e3065=0xce;}_0x1410e6['status'](_0x3e3065);return _0x1410e6[_0x0c54('0x24')]('Content-Range',_0x4f144c+'-'+_0x1ce658+'/'+_0x242e6f)['json'](_0x288423);}return null;};}function patchUpdates(_0x29eb41){return function(_0x305bab){try{jsonpatch['apply'](_0x305bab,_0x29eb41,!![]);}catch(_0x264d8f){return BPromise['reject'](_0x264d8f);}return _0x305bab[_0x0c54('0x25')]();};}function saveUpdates(_0x44a8e8,_0xaef4f5){return function(_0x1814cc){if(_0x1814cc){return _0x1814cc[_0x0c54('0x26')](_0x44a8e8)[_0x0c54('0x27')](function(_0x167787){return _0x167787;});}return null;};}function removeEntity(_0x2983fa,_0x4826aa){return function(_0xec64fd){if(_0xec64fd){return _0xec64fd[_0x0c54('0x28')]()[_0x0c54('0x27')](function(){var _0x1127df=_0xec64fd[_0x0c54('0x29')]({'plain':!![]});var _0xca7268=[{'name':_0x0c54('0x2a'),'value':_0x0c54('0x2b'),'ignore':![]},{'name':_0x0c54('0x2c'),'value':_0x0c54('0x2d'),'ignore':![]}];var _0x13e9db=_(_0xca7268)[_0x0c54('0x2e')](_0x0c54('0x2f'))['map'](_0x0c54('0x30'))[_0x0c54('0x30')]();if(_[_0x0c54('0x31')](_0x13e9db,_0x1127df['type'])){return;}var _0x3c54f5=_['find'](_0xca7268,['value',_0x1127df['type']])['name'];return db[_0x0c54('0x32')][_0x0c54('0x28')]({'where':{'type':_0x3c54f5,'resourceId':_0x1127df['id']}})[_0x0c54('0x27')](function(){return _0xec64fd;});})[_0x0c54('0x27')](function(){_0x2983fa[_0x0c54('0x1d')](0xcc)[_0x0c54('0x1e')]();});}};}function handleEntityNotFound(_0x10a9cc,_0x269879){return function(_0x56b457){if(!_0x56b457){_0x10a9cc['sendStatus'](0x194);}return _0x56b457;};}function handleError(_0x6216f4,_0x490fd3){_0x490fd3=_0x490fd3||0x1f4;return function(_0x2efada){logger[_0x0c54('0x33')](_0x2efada[_0x0c54('0x34')]);if(_0x2efada[_0x0c54('0x35')]){delete _0x2efada[_0x0c54('0x35')];}_0x6216f4[_0x0c54('0x1d')](_0x490fd3)['send'](_0x2efada);};}exports[_0x0c54('0x36')]=function(_0x5507e1,_0x883830){var _0x561705={},_0x34f0b1={},_0x34461e={'count':0x0,'rows':[]};var _0x34437d=_['map'](db['VoiceQueue'][_0x0c54('0x37')],function(_0x5db7f8){return{'name':_0x5db7f8[_0x0c54('0x38')],'type':_0x5db7f8[_0x0c54('0x39')][_0x0c54('0x3a')]};});_0x34f0b1['model']=_[_0x0c54('0x3b')](_0x34437d,_0x0c54('0x35'));_0x34f0b1[_0x0c54('0x3c')]=_[_0x0c54('0x3d')](_0x5507e1[_0x0c54('0x3c')]);_0x34f0b1['filters']=_[_0x0c54('0x3e')](_0x34f0b1[_0x0c54('0x3f')],_0x34f0b1[_0x0c54('0x3c')]);_0x561705[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x34f0b1['model'],qs['fields'](_0x5507e1['query'][_0x0c54('0x41')]));_0x561705[_0x0c54('0x40')]=_0x561705[_0x0c54('0x40')][_0x0c54('0x42')]?_0x561705[_0x0c54('0x40')]:_0x34f0b1[_0x0c54('0x3f')];if(!_0x5507e1[_0x0c54('0x3c')]['hasOwnProperty'](_0x0c54('0x43'))){_0x561705[_0x0c54('0x22')]=qs[_0x0c54('0x22')](_0x5507e1[_0x0c54('0x3c')]['limit']);_0x561705[_0x0c54('0x20')]=qs['offset'](_0x5507e1[_0x0c54('0x3c')]['offset']);}_0x561705[_0x0c54('0x44')]=qs[_0x0c54('0x45')](_0x5507e1[_0x0c54('0x3c')][_0x0c54('0x45')]);_0x561705['where']=qs[_0x0c54('0x46')](_[_0x0c54('0x47')](_0x5507e1[_0x0c54('0x3c')],_0x34f0b1[_0x0c54('0x46')]),_0x34437d);if(_0x5507e1[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x561705[_0x0c54('0x48')]=_[_0x0c54('0x49')](_0x561705[_0x0c54('0x48')],{'$or':_[_0x0c54('0x3b')](_0x34437d,function(_0x5dcdfb){if(_0x5dcdfb['type']!==_0x0c54('0x4a')){var _0x422f4c={};_0x422f4c[_0x5dcdfb[_0x0c54('0x35')]]={'$like':'%'+_0x5507e1[_0x0c54('0x3c')]['filter']+'%'};return _0x422f4c;}})});}_0x561705=_['merge']({},_0x561705,_0x5507e1['options']);var _0x53d79b={'where':_0x561705[_0x0c54('0x48')]};return db[_0x0c54('0x4b')][_0x0c54('0x23')](_0x53d79b)[_0x0c54('0x27')](function(_0x5b8e2c){_0x34461e[_0x0c54('0x23')]=_0x5b8e2c;if(_0x5507e1[_0x0c54('0x3c')][_0x0c54('0x4c')]){_0x561705[_0x0c54('0x4d')]=[{'all':!![]}];}return db[_0x0c54('0x4b')][_0x0c54('0x4e')](_0x561705);})[_0x0c54('0x27')](function(_0x22fb7b){_0x34461e[_0x0c54('0x4f')]=_0x22fb7b;return _0x34461e;})['then'](respondWithFilteredResult(_0x883830,_0x561705))[_0x0c54('0x50')](handleError(_0x883830,null));};exports[_0x0c54('0x51')]=function(_0x24e80e,_0x2bbd7f){var _0x5984df={'raw':![],'where':{'id':_0x24e80e['params']['id']}},_0x201251={};_0x201251[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db[_0x0c54('0x4b')]['rawAttributes']);_0x201251[_0x0c54('0x3c')]=_[_0x0c54('0x3d')](_0x24e80e[_0x0c54('0x3c')]);_0x201251[_0x0c54('0x46')]=_[_0x0c54('0x3e')](_0x201251[_0x0c54('0x3f')],_0x201251['query']);_0x5984df[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x201251[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x24e80e[_0x0c54('0x3c')][_0x0c54('0x41')]));_0x5984df[_0x0c54('0x40')]=_0x5984df['attributes']['length']?_0x5984df[_0x0c54('0x40')]:_0x201251[_0x0c54('0x3f')];if(_0x24e80e[_0x0c54('0x3c')][_0x0c54('0x4c')]){_0x5984df[_0x0c54('0x4d')]=[{'all':!![]}];}_0x5984df=_['merge']({},_0x5984df,_0x24e80e[_0x0c54('0x52')]);return db['VoiceQueue'][_0x0c54('0x53')](_0x5984df)[_0x0c54('0x27')](handleEntityNotFound(_0x2bbd7f,null))[_0x0c54('0x27')](respondWithResult(_0x2bbd7f,null))['catch'](handleError(_0x2bbd7f,null));};exports[_0x0c54('0x54')]=function(_0x36bb54,_0x2a50a7){return db[_0x0c54('0x4b')]['create'](_0x36bb54['body'],{})[_0x0c54('0x27')](function(_0x591346){var _0x817a0e=_0x36bb54[_0x0c54('0x55')][_0x0c54('0x29')]({'plain':!![]});if(!_0x817a0e)throw new Error(_0x0c54('0x56'));if(_0x817a0e[_0x0c54('0x57')]===_0x0c54('0x55')){var _0x3e21c1=_0x591346[_0x0c54('0x29')]({'plain':!![]});var _0x2cf4d5=[{'name':'VoiceQueues','value':_0x0c54('0x2b')},{'name':_0x0c54('0x2c'),'value':'outbound'}];var _0x1f10be=_[_0x0c54('0x53')](_0x2cf4d5,[_0x0c54('0x30'),_0x3e21c1[_0x0c54('0x39')]])[_0x0c54('0x35')];return db['UserProfileSection'][_0x0c54('0x53')]({'where':{'name':_0x1f10be,'userProfileId':_0x817a0e[_0x0c54('0x58')]},'raw':!![]})[_0x0c54('0x27')](function(_0x38d485){if(_0x38d485&&_0x38d485['autoAssociation']===0x0){return db['UserProfileResource'][_0x0c54('0x54')]({'name':_0x3e21c1[_0x0c54('0x35')],'resourceId':_0x3e21c1['id'],'type':_0x38d485['name'],'sectionId':_0x38d485['id']},{})['then'](function(){return _0x591346;});}else{return _0x591346;}})[_0x0c54('0x50')](function(_0x24715b){logger[_0x0c54('0x33')](_0x0c54('0x59'),_0x24715b);throw _0x24715b;});}return _0x591346;})[_0x0c54('0x27')](respondWithResult(_0x2a50a7,0xc9))[_0x0c54('0x50')](handleError(_0x2a50a7,null));};exports[_0x0c54('0x5a')]=function(_0x4ecb69,_0x129302){var _0x4ed46c={'where':{'id':_0x4ecb69[_0x0c54('0x5b')]['id']}},_0x1e9a1e={};_0x1e9a1e[_0x0c54('0x3f')]=_['keys'](db[_0x0c54('0x4b')]['rawAttributes']);_0x4ed46c[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x1e9a1e[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x4ecb69['query'][_0x0c54('0x41')]));_0x4ed46c[_0x0c54('0x40')]=_0x4ed46c[_0x0c54('0x40')][_0x0c54('0x42')]?_0x4ed46c[_0x0c54('0x40')]:_0x1e9a1e[_0x0c54('0x3f')];if(_0x4ecb69[_0x0c54('0x3c')]['includeAll']){_0x4ed46c[_0x0c54('0x4d')]=[{'all':!![]}];}_0x4ed46c=_[_0x0c54('0x49')]({},_0x4ed46c,_0x4ecb69['options']);return db['VoiceQueue'][_0x0c54('0x53')](_0x4ed46c)['then'](handleEntityNotFound(_0x129302,null))[_0x0c54('0x27')](function(_0x4edb4e){if(_0x4edb4e){var _0x124e09=_0x4edb4e[_0x0c54('0x29')]({'plain':!![]});_0x124e09=qs[_0x0c54('0x5c')](_0x124e09,['id',_0x0c54('0x5d'),_0x0c54('0x5e')]);_0x4ecb69[_0x0c54('0x5f')]=_[_0x0c54('0x5c')](_0x4ecb69[_0x0c54('0x5f')],['id',_0x0c54('0x5d'),_0x0c54('0x5e')]);return db['VoiceQueue'][_0x0c54('0x54')](_[_0x0c54('0x49')](_0x124e09,_0x4ecb69[_0x0c54('0x5f')]),{'include':_0x4ecb69[_0x0c54('0x3c')][_0x0c54('0x4c')]?[{'all':!![]}]:undefined})[_0x0c54('0x27')](function(_0x27c15d){var _0x363ec9=_0x4ecb69[_0x0c54('0x55')]['get']({'plain':!![]});if(!_0x363ec9)throw new Error(_0x0c54('0x56'));if(_0x363ec9[_0x0c54('0x57')]===_0x0c54('0x55')){var _0x527b35=_0x27c15d[_0x0c54('0x29')]({'plain':!![]});var _0x5eac40=[{'name':'VoiceQueues','value':_0x0c54('0x2b')},{'name':_0x0c54('0x2c'),'value':_0x0c54('0x2d')}];var _0x1c7d58=_[_0x0c54('0x53')](_0x5eac40,[_0x0c54('0x30'),_0x527b35[_0x0c54('0x39')]])['name'];return db['UserProfileSection'][_0x0c54('0x53')]({'where':{'name':_0x1c7d58,'userProfileId':_0x363ec9[_0x0c54('0x58')]},'raw':!![]})[_0x0c54('0x27')](function(_0x2879d2){if(_0x2879d2&&_0x2879d2['autoAssociation']===0x0){return db['UserProfileResource'][_0x0c54('0x54')]({'name':_0x527b35[_0x0c54('0x35')],'resourceId':_0x527b35['id'],'type':_0x2879d2[_0x0c54('0x35')],'sectionId':_0x2879d2['id']},{})[_0x0c54('0x27')](function(){return _0x27c15d;});}else{return _0x27c15d;}})['catch'](function(_0x1c7788){logger[_0x0c54('0x33')](_0x0c54('0x59'),_0x1c7788);throw _0x1c7788;});}return _0x27c15d;});}})[_0x0c54('0x27')](respondWithResult(_0x129302,0xc9))['catch'](handleError(_0x129302,null));};exports[_0x0c54('0x26')]=function(_0xd74a48,_0x49e622){if(_0xd74a48[_0x0c54('0x5f')]['id']){delete _0xd74a48[_0x0c54('0x5f')]['id'];}return db[_0x0c54('0x4b')]['find']({'where':{'id':_0xd74a48['params']['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x49e622,null))[_0x0c54('0x27')](saveUpdates(_0xd74a48[_0x0c54('0x5f')],null))[_0x0c54('0x27')](respondWithResult(_0x49e622,null))['catch'](handleError(_0x49e622,null));};exports[_0x0c54('0x28')]=function(_0x5444f1,_0x560bc6){return db['VoiceQueue'][_0x0c54('0x53')]({'where':{'id':_0x5444f1['params']['id']}})['then'](handleEntityNotFound(_0x560bc6,null))[_0x0c54('0x27')](removeEntity(_0x560bc6,null))[_0x0c54('0x50')](handleError(_0x560bc6,null));};exports['getHoppers']=function(_0x1de490,_0x112bcf,_0x389560){var _0x365f2d={'raw':![],'where':{}};var _0x578796={};var _0x9af59a={'count':0x0,'rows':[]};return db[_0x0c54('0x4b')]['findOne']({'where':{'id':_0x1de490[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x112bcf,null))[_0x0c54('0x27')](function(_0x318bca){if(_0x318bca){_0x578796[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db['CmHopper']['rawAttributes']);_0x578796['query']=_[_0x0c54('0x3d')](_0x1de490[_0x0c54('0x3c')]);_0x578796['filters']=_['intersection'](_0x578796[_0x0c54('0x3f')],_0x578796['query']);_0x365f2d[_0x0c54('0x40')]=_['intersection'](_0x578796[_0x0c54('0x3f')],qs['fields'](_0x1de490[_0x0c54('0x3c')][_0x0c54('0x41')]));_0x365f2d[_0x0c54('0x40')]=_0x365f2d[_0x0c54('0x40')]['length']?_0x365f2d[_0x0c54('0x40')]:_0x578796[_0x0c54('0x3f')];if(!_0x1de490[_0x0c54('0x3c')][_0x0c54('0x60')](_0x0c54('0x43'))){_0x365f2d[_0x0c54('0x22')]=qs['limit'](_0x1de490[_0x0c54('0x3c')][_0x0c54('0x22')]);_0x365f2d[_0x0c54('0x20')]=qs['offset'](_0x1de490[_0x0c54('0x3c')][_0x0c54('0x20')]);}_0x365f2d['order']=qs[_0x0c54('0x45')](_0x1de490[_0x0c54('0x3c')][_0x0c54('0x45')]);_0x365f2d[_0x0c54('0x48')]=qs[_0x0c54('0x46')](_['pick'](_0x1de490[_0x0c54('0x3c')],_0x578796[_0x0c54('0x46')]));_0x365f2d['where']['VoiceQueueId']=_0x318bca['id'];if(_0x1de490[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x365f2d[_0x0c54('0x48')]=_[_0x0c54('0x49')](_0x365f2d['where'],{'$or':_[_0x0c54('0x3b')](_0x365f2d['attributes'],function(_0x2f1446){var _0x35c476={};_0x35c476[_0x2f1446]={'$like':'%'+_0x1de490[_0x0c54('0x3c')][_0x0c54('0x2e')]+'%'};return _0x35c476;})});}_0x365f2d=_[_0x0c54('0x49')]({},_0x365f2d,_0x1de490['options']);return db[_0x0c54('0x61')][_0x0c54('0x23')]({'where':_0x365f2d[_0x0c54('0x48')]})['then'](function(_0x1333d4){_0x9af59a['count']=_0x1333d4;if(_0x1de490['query'][_0x0c54('0x4c')]){_0x365f2d[_0x0c54('0x4d')]=[{'all':!![]}];}return db[_0x0c54('0x61')][_0x0c54('0x4e')](_0x365f2d);})['then'](function(_0x324c2f){_0x9af59a[_0x0c54('0x4f')]=_0x324c2f;return _0x9af59a;});}})[_0x0c54('0x27')](respondWithFilteredResult(_0x112bcf,_0x365f2d))[_0x0c54('0x50')](handleError(_0x112bcf,null));};exports[_0x0c54('0x62')]=function(_0x957b8b,_0x3cd6d6,_0x21b2eb){var _0x5736ff={'raw':!![],'where':{}};var _0x4abc6e={};var _0x261058={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x957b8b[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x3cd6d6,null))[_0x0c54('0x27')](function(_0x1ec3ad){if(_0x1ec3ad){_0x4abc6e[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db['CmHopperHistory']['rawAttributes']);_0x4abc6e['query']=_['keys'](_0x957b8b[_0x0c54('0x3c')]);_0x4abc6e[_0x0c54('0x46')]=_[_0x0c54('0x3e')](_0x4abc6e['model'],_0x4abc6e[_0x0c54('0x3c')]);_0x5736ff['attributes']=_[_0x0c54('0x3e')](_0x4abc6e['model'],qs[_0x0c54('0x41')](_0x957b8b[_0x0c54('0x3c')][_0x0c54('0x41')]));_0x5736ff['attributes']=_0x5736ff[_0x0c54('0x40')][_0x0c54('0x42')]?_0x5736ff[_0x0c54('0x40')]:_0x4abc6e[_0x0c54('0x3f')];if(!_0x957b8b['query'][_0x0c54('0x60')](_0x0c54('0x43'))){_0x5736ff['limit']=qs[_0x0c54('0x22')](_0x957b8b[_0x0c54('0x3c')]['limit']);_0x5736ff['offset']=qs['offset'](_0x957b8b[_0x0c54('0x3c')][_0x0c54('0x20')]);}_0x5736ff['order']=qs[_0x0c54('0x45')](_0x957b8b[_0x0c54('0x3c')][_0x0c54('0x45')]);_0x5736ff[_0x0c54('0x48')]=qs['filters'](_[_0x0c54('0x47')](_0x957b8b[_0x0c54('0x3c')],_0x4abc6e[_0x0c54('0x46')]));_0x5736ff[_0x0c54('0x48')][_0x0c54('0x63')]=_0x1ec3ad['id'];if(_0x957b8b[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x5736ff[_0x0c54('0x48')]=_[_0x0c54('0x49')](_0x5736ff['where'],{'$or':_[_0x0c54('0x3b')](_0x5736ff[_0x0c54('0x40')],function(_0x1efcaf){var _0x56fa9a={};_0x56fa9a[_0x1efcaf]={'$like':'%'+_0x957b8b[_0x0c54('0x3c')][_0x0c54('0x2e')]+'%'};return _0x56fa9a;})});}_0x5736ff=_[_0x0c54('0x49')]({},_0x5736ff,_0x957b8b['options']);return db[_0x0c54('0x64')][_0x0c54('0x23')]({'where':_0x5736ff[_0x0c54('0x48')]})[_0x0c54('0x27')](function(_0x5bf257){_0x261058['count']=_0x5bf257;if(_0x957b8b[_0x0c54('0x3c')][_0x0c54('0x4c')]){_0x5736ff['include']=[{'all':!![]}];}return db[_0x0c54('0x64')][_0x0c54('0x4e')](_0x5736ff);})[_0x0c54('0x27')](function(_0x2a5b0a){_0x261058['rows']=_0x2a5b0a;return _0x261058;});}})['then'](respondWithFilteredResult(_0x3cd6d6,_0x5736ff))[_0x0c54('0x50')](handleError(_0x3cd6d6,null));};exports[_0x0c54('0x65')]=function(_0x2e2f45,_0x45aaf2,_0x109505){var _0x1f8cc1={'raw':!![],'where':{}};var _0x2c9494={};var _0x39fa9c={'count':0x0,'rows':[]};return db[_0x0c54('0x4b')][_0x0c54('0x66')]({'where':{'id':_0x2e2f45[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x45aaf2,null))[_0x0c54('0x27')](function(_0x23ab8e){if(_0x23ab8e){_0x2c9494[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db[_0x0c54('0x67')]['rawAttributes']);_0x2c9494[_0x0c54('0x3c')]=_[_0x0c54('0x3d')](_0x2e2f45[_0x0c54('0x3c')]);_0x2c9494[_0x0c54('0x46')]=_['intersection'](_0x2c9494[_0x0c54('0x3f')],_0x2c9494[_0x0c54('0x3c')]);_0x1f8cc1[_0x0c54('0x40')]=_['intersection'](_0x2c9494[_0x0c54('0x3f')],qs['fields'](_0x2e2f45[_0x0c54('0x3c')][_0x0c54('0x41')]));_0x1f8cc1[_0x0c54('0x40')]=_0x1f8cc1[_0x0c54('0x40')][_0x0c54('0x42')]?_0x1f8cc1[_0x0c54('0x40')]:_0x2c9494[_0x0c54('0x3f')];if(!_0x2e2f45[_0x0c54('0x3c')]['hasOwnProperty'](_0x0c54('0x43'))){_0x1f8cc1[_0x0c54('0x22')]=qs[_0x0c54('0x22')](_0x2e2f45[_0x0c54('0x3c')][_0x0c54('0x22')]);_0x1f8cc1[_0x0c54('0x20')]=qs[_0x0c54('0x20')](_0x2e2f45[_0x0c54('0x3c')][_0x0c54('0x20')]);}_0x1f8cc1[_0x0c54('0x44')]=qs[_0x0c54('0x45')](_0x2e2f45[_0x0c54('0x3c')]['sort']);_0x1f8cc1[_0x0c54('0x48')]=qs[_0x0c54('0x46')](_['pick'](_0x2e2f45[_0x0c54('0x3c')],_0x2c9494['filters']));_0x1f8cc1[_0x0c54('0x48')][_0x0c54('0x63')]=_0x23ab8e['id'];if(_0x2e2f45[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x1f8cc1['where']=_['merge'](_0x1f8cc1[_0x0c54('0x48')],{'$or':_['map'](_0x1f8cc1['attributes'],function(_0xf36dc6){var _0x350bcd={};_0x350bcd[_0xf36dc6]={'$like':'%'+_0x2e2f45[_0x0c54('0x3c')]['filter']+'%'};return _0x350bcd;})});}_0x1f8cc1=_['merge']({},_0x1f8cc1,_0x2e2f45[_0x0c54('0x52')]);return db[_0x0c54('0x67')]['count']({'where':_0x1f8cc1[_0x0c54('0x48')]})[_0x0c54('0x27')](function(_0x23e73c){_0x39fa9c['count']=_0x23e73c;if(_0x2e2f45[_0x0c54('0x3c')][_0x0c54('0x4c')]){_0x1f8cc1[_0x0c54('0x4d')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0c54('0x4e')](_0x1f8cc1);})[_0x0c54('0x27')](function(_0x214ac3){_0x39fa9c[_0x0c54('0x4f')]=_0x214ac3;return _0x39fa9c;});}})[_0x0c54('0x27')](respondWithFilteredResult(_0x45aaf2,_0x1f8cc1))['catch'](handleError(_0x45aaf2,null));};exports[_0x0c54('0x68')]=function(_0x45e9e9,_0x42560d,_0x5c4ea4){var _0x50fe97={'raw':!![],'where':{}};var _0x1a5b5b={};var _0x3de235={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0c54('0x66')]({'where':{'id':_0x45e9e9['params']['id']}})['then'](handleEntityNotFound(_0x42560d,null))['then'](function(_0x3047da){if(_0x3047da){_0x1a5b5b[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db['CmHopperBlack']['rawAttributes']);_0x1a5b5b['query']=_['keys'](_0x45e9e9[_0x0c54('0x3c')]);_0x1a5b5b['filters']=_[_0x0c54('0x3e')](_0x1a5b5b[_0x0c54('0x3f')],_0x1a5b5b['query']);_0x50fe97[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x1a5b5b[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x45e9e9['query'][_0x0c54('0x41')]));_0x50fe97[_0x0c54('0x40')]=_0x50fe97[_0x0c54('0x40')][_0x0c54('0x42')]?_0x50fe97[_0x0c54('0x40')]:_0x1a5b5b['model'];if(!_0x45e9e9['query'][_0x0c54('0x60')](_0x0c54('0x43'))){_0x50fe97[_0x0c54('0x22')]=qs['limit'](_0x45e9e9[_0x0c54('0x3c')]['limit']);_0x50fe97[_0x0c54('0x20')]=qs[_0x0c54('0x20')](_0x45e9e9[_0x0c54('0x3c')]['offset']);}_0x50fe97[_0x0c54('0x44')]=qs[_0x0c54('0x45')](_0x45e9e9['query'][_0x0c54('0x45')]);_0x50fe97[_0x0c54('0x48')]=qs[_0x0c54('0x46')](_[_0x0c54('0x47')](_0x45e9e9['query'],_0x1a5b5b[_0x0c54('0x46')]));_0x50fe97[_0x0c54('0x48')][_0x0c54('0x63')]=_0x3047da['id'];if(_0x45e9e9['query']['filter']){_0x50fe97['where']=_[_0x0c54('0x49')](_0x50fe97[_0x0c54('0x48')],{'$or':_[_0x0c54('0x3b')](_0x50fe97[_0x0c54('0x40')],function(_0x449de5){var _0x51cc6d={};_0x51cc6d[_0x449de5]={'$like':'%'+_0x45e9e9['query'][_0x0c54('0x2e')]+'%'};return _0x51cc6d;})});}_0x50fe97=_['merge']({},_0x50fe97,_0x45e9e9[_0x0c54('0x52')]);return db[_0x0c54('0x69')][_0x0c54('0x23')]({'where':_0x50fe97[_0x0c54('0x48')]})['then'](function(_0x331e41){_0x3de235[_0x0c54('0x23')]=_0x331e41;if(_0x45e9e9[_0x0c54('0x3c')][_0x0c54('0x4c')]){_0x50fe97[_0x0c54('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x0c54('0x4e')](_0x50fe97);})[_0x0c54('0x27')](function(_0xd7835f){_0x3de235['rows']=_0xd7835f;return _0x3de235;});}})[_0x0c54('0x27')](respondWithFilteredResult(_0x42560d,_0x50fe97))['catch'](handleError(_0x42560d,null));};exports['getTeams']=function(_0x477fb0,_0x268d87,_0x254a50){var _0xfdb20e={};var _0x451ac2={};var _0x1d2968;var _0x54ba8c;return db[_0x0c54('0x4b')][_0x0c54('0x66')]({'where':{'id':_0x477fb0[_0x0c54('0x5b')]['id']}})['then'](handleEntityNotFound(_0x268d87,null))['then'](function(_0x15b480){if(_0x15b480){_0x1d2968=_0x15b480;_0x451ac2[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db[_0x0c54('0x6a')][_0x0c54('0x37')]);_0x451ac2[_0x0c54('0x3c')]=_[_0x0c54('0x3d')](_0x477fb0[_0x0c54('0x3c')]);_0x451ac2[_0x0c54('0x46')]=_[_0x0c54('0x3e')](_0x451ac2[_0x0c54('0x3f')],_0x451ac2[_0x0c54('0x3c')]);_0xfdb20e[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x451ac2[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x477fb0[_0x0c54('0x3c')][_0x0c54('0x41')]));_0xfdb20e[_0x0c54('0x40')]=_0xfdb20e['attributes'][_0x0c54('0x42')]?_0xfdb20e['attributes']:_0x451ac2[_0x0c54('0x3f')];_0xfdb20e[_0x0c54('0x44')]=qs[_0x0c54('0x45')](_0x477fb0[_0x0c54('0x3c')][_0x0c54('0x45')]);_0xfdb20e[_0x0c54('0x48')]=qs['filters'](_[_0x0c54('0x47')](_0x477fb0[_0x0c54('0x3c')],_0x451ac2['filters']));if(_0x477fb0[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0xfdb20e['where']=_[_0x0c54('0x49')](_0xfdb20e[_0x0c54('0x48')],{'$or':_[_0x0c54('0x3b')](_0xfdb20e['attributes'],function(_0x29bd7c){var _0x145740={};_0x145740[_0x29bd7c]={'$like':'%'+_0x477fb0[_0x0c54('0x3c')][_0x0c54('0x2e')]+'%'};return _0x145740;})});}_0xfdb20e=_[_0x0c54('0x49')]({},_0xfdb20e,_0x477fb0[_0x0c54('0x52')]);return _0x1d2968[_0x0c54('0x6b')](_0xfdb20e);}})[_0x0c54('0x27')](function(_0x13bc3f){if(_0x13bc3f){_0x54ba8c=_0x13bc3f[_0x0c54('0x42')];if(!_0x477fb0['query'][_0x0c54('0x60')](_0x0c54('0x43'))){_0xfdb20e[_0x0c54('0x22')]=qs[_0x0c54('0x22')](_0x477fb0['query'][_0x0c54('0x22')]);_0xfdb20e['offset']=qs[_0x0c54('0x20')](_0x477fb0[_0x0c54('0x3c')][_0x0c54('0x20')]);}return _0x1d2968[_0x0c54('0x6b')](_0xfdb20e);}})[_0x0c54('0x27')](function(_0x896eff){if(_0x896eff){return _0x896eff?{'count':_0x54ba8c,'rows':_0x896eff}:null;}})['then'](respondWithResult(_0x268d87,null))[_0x0c54('0x50')](handleError(_0x268d87,null));};exports[_0x0c54('0x6c')]=function(_0x1ec315,_0x33f0af,_0x1b8420){var _0x3fe4f8=_0x1ec315['body'][_0x0c54('0x6d')];var _0x27e7c4=_[_0x0c54('0x3b')](_0x3fe4f8,'id');return db[_0x0c54('0x6a')]['findAll']({'where':{'id':_0x27e7c4},'attributes':['id'],'include':[{'model':db[_0x0c54('0x6e')],'as':_0x0c54('0x6f'),'attributes':['id',_0x0c54('0x35'),_0x0c54('0x70'),_0x0c54('0x71'),'interface'],'raw':!![]}]})['then'](function(_0x242786){if(_0x242786){var _0x374a68=_[_0x0c54('0x72')](_0x242786,function(_0x1d23b8){var _0x1a2d67=_0x1d23b8[_0x0c54('0x29')]({'plain':!![]});_0x1a2d67[_0x0c54('0x6f')][_0x0c54('0x73')](function(_0x47c02b){_0x47c02b[_0x0c54('0x74')]=_[_0x0c54('0x53')](_0x3fe4f8,{'id':_0x1a2d67['id']})[_0x0c54('0x74')];});return _0x1a2d67['Agents'];});return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x1ec315[_0x0c54('0x5b')]['id']}})['then'](function(_0xe6ff8e){return db['sequelize'][_0x0c54('0x75')](function(_0x354bae){return _0xe6ff8e[_0x0c54('0x6c')](_0x27e7c4,{'transaction':_0x354bae})['then'](function(){return BPromise[_0x0c54('0x76')](_0x3fe4f8,function(_0x5e0713){return db['TeamVoiceQueue'][_0x0c54('0x77')]({'TeamId':_0x5e0713['id'],'VoiceQueueId':_0x1ec315[_0x0c54('0x5b')]['id'],'penalty':_0x5e0713['penalty']},{'transaction':_0x354bae});});})[_0x0c54('0x27')](function(){return BPromise['each'](_0x374a68,function(_0x5de2f1){return db[_0x0c54('0x78')][_0x0c54('0x79')]({'where':{'UserId':_0x5de2f1['id'],'VoiceQueueId':_0x1ec315[_0x0c54('0x5b')]['id']},'defaults':{'penalty':_0x5de2f1[_0x0c54('0x74')]},'transaction':_0x354bae});});})[_0x0c54('0x27')](function(){return BPromise[_0x0c54('0x76')](_[_0x0c54('0x2e')](_0x374a68,{'online':!![]}),function(_0x19bcfa){return db[_0x0c54('0x7a')]['upsert']({'membername':_0x19bcfa['name'],'UserId':_0x19bcfa['id'],'queue_name':_0xe6ff8e['name'],'VoiceQueueId':_0xe6ff8e['id'],'interface':_['isNil'](_0x19bcfa['interface'])?util[_0x0c54('0x7b')](_0x0c54('0x7c'),_0x19bcfa['name']):_0x19bcfa['interface'],'paused':_0x19bcfa[_0x0c54('0x71')]||![],'penalty':_0x19bcfa[_0x0c54('0x74')]},{'transaction':_0x354bae});});})[_0x0c54('0x27')](function(){_0x374a68[_0x0c54('0x73')](function(_0xd71945){socket[_0x0c54('0x7d')]('userVoiceQueue:save',{'UserId':_0xd71945['id'],'VoiceQueueId':_0xe6ff8e['id']});});});});});}})[_0x0c54('0x27')](respondWithStatusCode(_0x33f0af,null))[_0x0c54('0x50')](handleError(_0x33f0af,null));};exports['removeTeams']=function(_0x56d588,_0x30e1b0,_0x576b59){return db[_0x0c54('0x6a')]['findAll']({'where':{'id':_0x56d588[_0x0c54('0x3c')][_0x0c54('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x0c54('0x6e')],'as':_0x0c54('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x0c54('0x27')](handleEntityNotFound(_0x30e1b0,null))[_0x0c54('0x27')](function(_0x4005b7){var _0x1ec071=_['map'](_0x4005b7,'id');var _0x377512=[];var _0x2ba368=[];var _0x3d2348=squel['select']();_0x3d2348[_0x0c54('0x7f')](_0x0c54('0x80'))[_0x0c54('0x81')](_0x0c54('0x82'),'tq')['join'](_0x0c54('0x83'),'ut',_0x0c54('0x84'))[_0x0c54('0x48')](_0x0c54('0x85'),_0x56d588[_0x0c54('0x5b')]['id']);for(var _0xfc31d9=0x0;_0xfc31d9<_0x4005b7[_0x0c54('0x42')];_0xfc31d9+=0x1){let _0x37c649=_0x4005b7[_0xfc31d9];for(var _0x3c9930=0x0;_0x3c9930<_0x37c649[_0x0c54('0x6f')][_0x0c54('0x42')];_0x3c9930+=0x1){let _0x3ea5b1=_0x37c649[_0x0c54('0x6f')][_0x3c9930];var _0x39e593=_0x3d2348[_0x0c54('0x5a')]();_0x39e593['where'](_0x0c54('0x86'),_0x3ea5b1['id']);_0x2ba368[_0x0c54('0x87')](db['sequelize']['query'](_0x39e593[_0x0c54('0x88')](),{'type':db[_0x0c54('0x89')]['QueryTypes'][_0x0c54('0x8a')]})[_0x0c54('0x27')](function(_0x2e3c5d){if(_0x2e3c5d[_0x0c54('0x42')]===0x1){return _0x3ea5b1['id'];}else{var _0x47a39a=_[_0x0c54('0x8b')](_[_0x0c54('0x3b')](_0x2e3c5d,_0x0c54('0x8c')),function(_0x4b95c2){return _[_0x0c54('0x31')](_0x1ec071,_0x4b95c2);});if(_0x47a39a){return _0x3ea5b1['id'];}}}));}}return BPromise[_0x0c54('0x8d')](_0x2ba368)[_0x0c54('0x27')](function(_0x3a09bc){_0x377512=_(_0x377512)[_0x0c54('0x8e')](_0x3a09bc)['compact']()[_0x0c54('0x30')]();return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x56d588['params']['id']}})['then'](function(_0x46c840){return db[_0x0c54('0x89')][_0x0c54('0x75')](function(_0x1249b4){return _0x46c840[_0x0c54('0x8f')](_0x56d588[_0x0c54('0x3c')][_0x0c54('0x7e')],{'transaction':_0x1249b4})[_0x0c54('0x27')](function(){if(!_['isEmpty'](_0x377512)){return _0x46c840['removeAgents'](_0x377512,{'transaction':_0x1249b4})[_0x0c54('0x27')](function(){return db['UserVoiceQueueRt'][_0x0c54('0x28')]({'where':{'VoiceQueueId':_0x56d588['params']['id'],'UserId':_0x377512},'transaction':_0x1249b4});});}})[_0x0c54('0x27')](function(){_0x377512[_0x0c54('0x73')](function(_0x2b558d){socket[_0x0c54('0x7d')](_0x0c54('0x90'),{'UserId':_0x2b558d,'VoiceQueueId':_0x46c840['id']});});});});});});})['then'](respondWithStatusCode(_0x30e1b0,null))['catch'](handleError(_0x30e1b0,null));};exports[_0x0c54('0x91')]=function(_0x342072,_0x29e997,_0x4afcda){var _0x5bb03b,_0x5cb67f;return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x342072['params']['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x29e997,null))[_0x0c54('0x27')](function(_0x3e075b){if(_0x3e075b){_0x5cb67f=_0x3e075b;return _0x3e075b[_0x0c54('0x91')](_0x342072[_0x0c54('0x5f')][_0x0c54('0x7e')],_['omit'](_0x342072[_0x0c54('0x5f')],['ids','id'])||{})[_0x0c54('0x92')](function(_0x1bac7b){for(var _0x415bbc=0x0;_0x415bbc<_0x342072[_0x0c54('0x5f')][_0x0c54('0x7e')][_0x0c54('0x42')];_0x415bbc+=0x1){socket[_0x0c54('0x7d')](_0x0c54('0x93'),{'UserId':_0x342072[_0x0c54('0x5f')][_0x0c54('0x7e')][_0x415bbc],'VoiceQueueId':_0x342072['params']['id']});}return _0x1bac7b;});}})[_0x0c54('0x27')](function(_0x3dfbc4){_0x5bb03b=_0x3dfbc4||[];if(_0x5cb67f){return db['User']['findAll']({'where':{'id':_0x342072[_0x0c54('0x5f')][_0x0c54('0x7e')]},'attributes':['id',_0x0c54('0x35'),_0x0c54('0x70'),_0x0c54('0x71'),'interface'],'raw':!![]});}})[_0x0c54('0x27')](function(_0x367847){if(!_['isEmpty'](_0x367847)){var _0x162d9f=[];for(var _0x2aa9ab=0x0;_0x2aa9ab<_0x367847['length'];_0x2aa9ab++){if(_0x367847[_0x2aa9ab][_0x0c54('0x70')]){_0x162d9f['push'](db[_0x0c54('0x7a')][_0x0c54('0x77')]({'membername':_0x367847[_0x2aa9ab][_0x0c54('0x35')],'UserId':_0x367847[_0x2aa9ab]['id'],'queue_name':_0x5cb67f['name'],'VoiceQueueId':_0x5cb67f['id'],'interface':_['isNil'](_0x367847[_0x2aa9ab][_0x0c54('0x94')])?util[_0x0c54('0x7b')](_0x0c54('0x7c'),_0x367847[_0x2aa9ab]['name']):_0x367847[_0x2aa9ab][_0x0c54('0x94')],'paused':_0x367847[_0x2aa9ab]['voicePause']||![],'penalty':_0x342072[_0x0c54('0x5f')][_0x0c54('0x74')]||0x0}));}}return BPromise[_0x0c54('0x8d')](_0x162d9f);}})[_0x0c54('0x27')](function(){return _0x5bb03b;})[_0x0c54('0x27')](respondWithResult(_0x29e997,null))[_0x0c54('0x50')](handleError(_0x29e997,null));};exports['removeAgents']=function(_0x39b0a0,_0x292f16,_0x23901e){return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x39b0a0['params']['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x292f16,null))[_0x0c54('0x27')](function(_0x39a076){if(_0x39a076){return _0x39a076[_0x0c54('0x95')](_0x39b0a0[_0x0c54('0x3c')][_0x0c54('0x7e')])[_0x0c54('0x27')](function(){if(_[_0x0c54('0x96')](_0x39b0a0['query']['ids'])){for(var _0xf6aea5=0x0;_0xf6aea5<_0x39b0a0['query']['ids'][_0x0c54('0x42')];_0xf6aea5+=0x1){socket[_0x0c54('0x7d')](_0x0c54('0x90'),{'UserId':Number(_0x39b0a0[_0x0c54('0x3c')][_0x0c54('0x7e')][_0xf6aea5]),'VoiceQueueId':Number(_0x39b0a0[_0x0c54('0x5b')]['id'])});}}else{socket[_0x0c54('0x7d')](_0x0c54('0x90'),{'UserId':Number(_0x39b0a0[_0x0c54('0x3c')]['ids']),'VoiceQueueId':Number(_0x39b0a0[_0x0c54('0x5b')]['id'])});}});}})[_0x0c54('0x27')](function(_0x2f9eae){return db['UserVoiceQueueRt'][_0x0c54('0x28')]({'where':{'VoiceQueueId':_0x39b0a0['params']['id'],'UserId':_0x39b0a0['query']['ids']}})[_0x0c54('0x27')](function(){return _0x2f9eae;});})[_0x0c54('0x27')](respondWithStatusCode(_0x292f16,null))['catch'](handleError(_0x292f16,null));};exports[_0x0c54('0x97')]=function(_0x5e0edf,_0x1904de,_0x37b680){var _0x5d426c={};var _0x438ae5={};var _0x4964df;var _0x4bdec1;return db[_0x0c54('0x4b')]['findOne']({'where':{'id':_0x5e0edf[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x1904de,null))[_0x0c54('0x27')](function(_0x81273c){if(_0x81273c){_0x4964df=_0x81273c;_0x438ae5['model']=_[_0x0c54('0x3d')](db[_0x0c54('0x6e')][_0x0c54('0x37')]);_0x438ae5[_0x0c54('0x3c')]=_['keys'](_0x5e0edf[_0x0c54('0x3c')]);_0x438ae5[_0x0c54('0x46')]=_[_0x0c54('0x3e')](_0x438ae5[_0x0c54('0x3f')],_0x438ae5[_0x0c54('0x3c')]);_0x5d426c['attributes']=_[_0x0c54('0x3e')](_0x438ae5[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x5e0edf[_0x0c54('0x3c')][_0x0c54('0x41')]));_0x5d426c[_0x0c54('0x40')]=_0x5d426c['attributes'][_0x0c54('0x42')]?_0x5d426c['attributes']:_0x438ae5['model'];_0x5d426c['order']=qs['sort'](_0x5e0edf[_0x0c54('0x3c')][_0x0c54('0x45')]);_0x5d426c[_0x0c54('0x48')]=qs[_0x0c54('0x46')](_[_0x0c54('0x47')](_0x5e0edf[_0x0c54('0x3c')],_0x438ae5[_0x0c54('0x46')]));if(_0x5e0edf[_0x0c54('0x3c')]['filter']){_0x5d426c[_0x0c54('0x48')]=_[_0x0c54('0x49')](_0x5d426c['where'],{'$or':_[_0x0c54('0x3b')](_0x5d426c[_0x0c54('0x40')],function(_0x29f98b){var _0x219aaa={};_0x219aaa[_0x29f98b]={'$like':'%'+_0x5e0edf[_0x0c54('0x3c')][_0x0c54('0x2e')]+'%'};return _0x219aaa;})});}_0x5d426c=_['merge']({},_0x5d426c,_0x5e0edf[_0x0c54('0x52')]);return _0x4964df['getAgents'](_0x5d426c);}})[_0x0c54('0x27')](function(_0x4e23af){if(_0x4e23af){_0x4bdec1=_0x4e23af['length'];if(!_0x5e0edf['query'][_0x0c54('0x60')]('nolimit')){_0x5d426c[_0x0c54('0x22')]=qs[_0x0c54('0x22')](_0x5e0edf[_0x0c54('0x3c')][_0x0c54('0x22')]);_0x5d426c[_0x0c54('0x20')]=qs[_0x0c54('0x20')](_0x5e0edf[_0x0c54('0x3c')][_0x0c54('0x20')]);}return _0x4964df[_0x0c54('0x97')](_0x5d426c);}})['then'](function(_0x1f16da){if(_0x1f16da){return _0x1f16da?{'count':_0x4bdec1,'rows':_0x1f16da}:null;}})[_0x0c54('0x27')](respondWithResult(_0x1904de,null))[_0x0c54('0x50')](handleError(_0x1904de,null));};exports['getMembers']=function(_0x223cd2,_0x1b7334,_0x4e9c31){var _0x4cb183={};var _0xf3593a={};var _0x4ead6c;var _0x4f284a;return db[_0x0c54('0x4b')][_0x0c54('0x66')]({'where':{'id':_0x223cd2['params']['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x1b7334,null))[_0x0c54('0x27')](function(_0x44e3d1){if(_0x44e3d1){_0x4ead6c=_0x44e3d1;_0xf3593a[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db[_0x0c54('0x7a')][_0x0c54('0x37')]);_0xf3593a[_0x0c54('0x3c')]=_['keys'](_0x223cd2[_0x0c54('0x3c')]);_0xf3593a[_0x0c54('0x46')]=_[_0x0c54('0x3e')](_0xf3593a[_0x0c54('0x3f')],_0xf3593a['query']);_0x4cb183[_0x0c54('0x40')]=_['intersection'](_0xf3593a[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x223cd2[_0x0c54('0x3c')][_0x0c54('0x41')]));_0x4cb183[_0x0c54('0x40')]=_0x4cb183['attributes'][_0x0c54('0x42')]?_0x4cb183['attributes']:_0xf3593a[_0x0c54('0x3f')];_0x4cb183['order']=qs[_0x0c54('0x45')](_0x223cd2[_0x0c54('0x3c')][_0x0c54('0x45')]);_0x4cb183[_0x0c54('0x48')]=qs['filters'](_['pick'](_0x223cd2['query'],_0xf3593a[_0x0c54('0x46')]));if(_0x223cd2[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x4cb183[_0x0c54('0x48')]=_['merge'](_0x4cb183[_0x0c54('0x48')],{'$or':_[_0x0c54('0x3b')](_0x4cb183[_0x0c54('0x40')],function(_0x4c8f6f){var _0x50cbc9={};_0x50cbc9[_0x4c8f6f]={'$like':'%'+_0x223cd2[_0x0c54('0x3c')]['filter']+'%'};return _0x50cbc9;})});}_0x4cb183=_[_0x0c54('0x49')]({},_0x4cb183,_0x223cd2[_0x0c54('0x52')]);return _0x4ead6c[_0x0c54('0x98')](_0x4cb183);}})[_0x0c54('0x27')](function(_0x3d7705){if(_0x3d7705){_0x4f284a=_0x3d7705[_0x0c54('0x42')];if(!_0x223cd2[_0x0c54('0x3c')]['hasOwnProperty'](_0x0c54('0x43'))){_0x4cb183[_0x0c54('0x22')]=qs['limit'](_0x223cd2[_0x0c54('0x3c')][_0x0c54('0x22')]);_0x4cb183[_0x0c54('0x20')]=qs[_0x0c54('0x20')](_0x223cd2[_0x0c54('0x3c')][_0x0c54('0x20')]);}return _0x4ead6c[_0x0c54('0x98')](_0x4cb183);}})[_0x0c54('0x27')](function(_0x17aef3){return _0x17aef3?{'count':_0x4f284a,'rows':_0x17aef3}:null;})['then'](respondWithResult(_0x1b7334,null))[_0x0c54('0x50')](handleError(_0x1b7334,null));};exports[_0x0c54('0x99')]=function(_0x29c684,_0x1db197,_0x1b5cf7){var _0x280af3={};var _0x3b9e97={};var _0x1afdf1;var _0x2ee7f3;return db[_0x0c54('0x4b')]['findOne']({'where':{'id':_0x29c684['params']['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x1db197,null))[_0x0c54('0x27')](function(_0x2b48b4){if(_0x2b48b4){_0x1afdf1=_0x2b48b4;_0x3b9e97[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db[_0x0c54('0x9a')][_0x0c54('0x37')]);_0x3b9e97[_0x0c54('0x3c')]=_[_0x0c54('0x3d')](_0x29c684[_0x0c54('0x3c')]);_0x3b9e97[_0x0c54('0x46')]=_[_0x0c54('0x3e')](_0x3b9e97[_0x0c54('0x3f')],_0x3b9e97[_0x0c54('0x3c')]);_0x280af3[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x3b9e97[_0x0c54('0x3f')],qs[_0x0c54('0x41')](_0x29c684['query'][_0x0c54('0x41')]));_0x280af3[_0x0c54('0x40')]=_0x280af3[_0x0c54('0x40')]['length']?_0x280af3[_0x0c54('0x40')]:_0x3b9e97['model'];_0x280af3[_0x0c54('0x44')]=qs[_0x0c54('0x45')](_0x29c684[_0x0c54('0x3c')][_0x0c54('0x45')]);_0x280af3[_0x0c54('0x48')]=qs[_0x0c54('0x46')](_['pick'](_0x29c684[_0x0c54('0x3c')],_0x3b9e97[_0x0c54('0x46')]));if(_0x29c684[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x280af3[_0x0c54('0x48')]=_[_0x0c54('0x49')](_0x280af3[_0x0c54('0x48')],{'$or':_[_0x0c54('0x3b')](_0x280af3[_0x0c54('0x40')],function(_0xb83e66){var _0x45e837={};_0x45e837[_0xb83e66]={'$like':'%'+_0x29c684[_0x0c54('0x3c')][_0x0c54('0x2e')]+'%'};return _0x45e837;})});}_0x280af3=_[_0x0c54('0x49')]({},_0x280af3,_0x29c684[_0x0c54('0x52')]);return _0x1afdf1[_0x0c54('0x99')](_0x280af3);}})[_0x0c54('0x27')](function(_0x2b4668){if(_0x2b4668){_0x2ee7f3=_0x2b4668['length'];if(!_0x29c684[_0x0c54('0x3c')][_0x0c54('0x60')]('nolimit')){_0x280af3[_0x0c54('0x22')]=qs[_0x0c54('0x22')](_0x29c684[_0x0c54('0x3c')][_0x0c54('0x22')]);_0x280af3['offset']=qs[_0x0c54('0x20')](_0x29c684[_0x0c54('0x3c')][_0x0c54('0x20')]);}return _0x1afdf1[_0x0c54('0x99')](_0x280af3);}})['then'](function(_0x14c951){if(_0x14c951){return _0x14c951?{'count':_0x2ee7f3,'rows':_0x14c951}:null;}})[_0x0c54('0x27')](respondWithResult(_0x1db197,null))[_0x0c54('0x50')](handleError(_0x1db197,null));};exports[_0x0c54('0x9b')]=function(_0xba3aec,_0xb163e8,_0x5c109e){var _0x5946e7,_0x36874b;return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0xba3aec[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0xb163e8,null))[_0x0c54('0x27')](function(_0x9e56fd){if(_0x9e56fd){_0x36874b=_0x9e56fd;return _0x9e56fd['addLists'](_0xba3aec[_0x0c54('0x5f')][_0x0c54('0x7e')],_[_0x0c54('0x5c')](_0xba3aec[_0x0c54('0x5f')],[_0x0c54('0x7e'),'id'])||{});}return null;})[_0x0c54('0x92')](function(_0x58a1f5){var _0x5f3150;_0x5946e7=_0x58a1f5||[];var _0x1be168=[];if(_0x58a1f5){for(var _0x357d27=0x0;_0x357d27<_0x58a1f5[_0x0c54('0x42')];_0x357d27+=0x1){var _0x22b57e=_0x58a1f5[_0x357d27][_0x0c54('0x29')]({'plain':!![]});_0x36874b[_0x0c54('0x9c')]=_0xba3aec[_0x0c54('0x5f')][_0x0c54('0x9c')]?_0xba3aec[_0x0c54('0x5f')]['dialCheckDuplicateType']:_0x36874b['dialCheckDuplicateType'];switch(_0x36874b[_0x0c54('0x9c')]){case _0x0c54('0x9d'):_0x5f3150=squel[_0x0c54('0x9e')]()[_0x0c54('0x9f')](_0x0c54('0xa0'))['fromQuery']([_0x0c54('0xa1'),'scheduledAt',_0x0c54('0xa2'),'ListId','VoiceQueueId',_0x0c54('0x5d'),_0x0c54('0x5e')],squel[_0x0c54('0xa3')]()['field']('phone',_0x0c54('0xa1'))['field'](_0x0c54('0xa4'),_0x0c54('0xa5'))['field']('id','ContactId')[_0x0c54('0x7f')](_0x22b57e[_0x0c54('0xa6')][_0x0c54('0x88')](),'ListId')[_0x0c54('0x7f')](_0xba3aec[_0x0c54('0x5b')]['id']['toString'](),_0x0c54('0x63'))[_0x0c54('0x7f')](_0x0c54('0xa4'),'createdAt')['field'](_0x0c54('0xa4'),_0x0c54('0x5e'))[_0x0c54('0x81')](_0x0c54('0xa7'))[_0x0c54('0x48')](_0x0c54('0xa8'))[_0x0c54('0x48')](_0x0c54('0xa9'),_0x22b57e[_0x0c54('0xa6')][_0x0c54('0x88')]())[_0x0c54('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x0c54('0x48')](_0x0c54('0xaa'),squel[_0x0c54('0xa3')]()['field'](_0x0c54('0xab'))[_0x0c54('0x81')](_0x0c54('0xac'))[_0x0c54('0x48')]('VoiceQueueId\x20=\x20?',_0xba3aec[_0x0c54('0x5b')]['id']['toString']()))['where'](_0x0c54('0xaa'),squel[_0x0c54('0xa3')]()['field']('COALESCE(phone,\x27\x27)')[_0x0c54('0x81')](_0x0c54('0xa0'))['where']('VoiceQueueId\x20=\x20?',_0xba3aec['params']['id'][_0x0c54('0x88')]())))['toString']();break;case _0x0c54('0xad'):_0x5f3150=squel[_0x0c54('0x9e')]()[_0x0c54('0x9f')](_0x0c54('0xa0'))[_0x0c54('0xae')]([_0x0c54('0xa1'),_0x0c54('0xa5'),_0x0c54('0xa2'),_0x0c54('0xaf'),_0x0c54('0x63'),_0x0c54('0x5d'),_0x0c54('0x5e')],squel[_0x0c54('0xa3')]()['field'](_0x0c54('0xa1'),_0x0c54('0xa1'))[_0x0c54('0x7f')]('NOW()',_0x0c54('0xa5'))['field']('id','ContactId')[_0x0c54('0x7f')](_0x22b57e['CmListId']['toString'](),_0x0c54('0xaf'))[_0x0c54('0x7f')](_0xba3aec[_0x0c54('0x5b')]['id'][_0x0c54('0x88')](),_0x0c54('0x63'))['field'](_0x0c54('0xa4'),_0x0c54('0x5d'))[_0x0c54('0x7f')]('NOW()',_0x0c54('0x5e'))[_0x0c54('0x81')](_0x0c54('0xa7'))[_0x0c54('0x48')](_0x0c54('0xa8'))[_0x0c54('0x48')]('ListId\x20=\x20?',_0x22b57e[_0x0c54('0xa6')]['toString']())[_0x0c54('0x48')](_0x0c54('0xb0'))[_0x0c54('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0c54('0xa3')]()[_0x0c54('0x7f')]('COALESCE(phone,\x27\x27)')[_0x0c54('0x81')](_0x0c54('0xa0'))['where']('VoiceQueueId\x20=\x20?',_0xba3aec[_0x0c54('0x5b')]['id'][_0x0c54('0x88')]())))['toString']();break;default:_0x5f3150=squel[_0x0c54('0x9e')]()[_0x0c54('0x9f')]('cm_hopper')[_0x0c54('0xae')](['phone','scheduledAt','ContactId',_0x0c54('0xaf'),_0x0c54('0x63'),_0x0c54('0x5d'),_0x0c54('0x5e')],squel[_0x0c54('0xa3')]()['field'](_0x0c54('0xa1'),_0x0c54('0xa1'))['field'](_0x0c54('0xa4'),_0x0c54('0xa5'))['field']('id',_0x0c54('0xa2'))[_0x0c54('0x7f')](_0x22b57e['CmListId'][_0x0c54('0x88')](),_0x0c54('0xaf'))[_0x0c54('0x7f')](_0xba3aec[_0x0c54('0x5b')]['id'][_0x0c54('0x88')](),_0x0c54('0x63'))[_0x0c54('0x7f')]('NOW()',_0x0c54('0x5d'))[_0x0c54('0x7f')](_0x0c54('0xa4'),_0x0c54('0x5e'))[_0x0c54('0x81')]('cm_contacts')[_0x0c54('0x48')](_0x0c54('0xa8'))[_0x0c54('0x48')](_0x0c54('0xa9'),_0x22b57e[_0x0c54('0xa6')][_0x0c54('0x88')]())[_0x0c54('0x48')](_0x0c54('0xb0')))[_0x0c54('0x88')]();}_0x1be168[_0x0c54('0x87')](db['sequelize'][_0x0c54('0x3c')](_0x5f3150));}return BPromise['all'](_0x1be168);}})[_0x0c54('0x27')](function(){return _0x5946e7;})[_0x0c54('0x27')](respondWithResult(_0xb163e8,null))['catch'](handleError(_0xb163e8,null));};exports['removeLists']=function(_0x5a240c,_0x10b837,_0x5f4869){return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x5a240c[_0x0c54('0x5b')]['id']}})['then'](handleEntityNotFound(_0x10b837,null))[_0x0c54('0x27')](function(_0x4806a7){if(_0x4806a7){return _0x4806a7[_0x0c54('0xb1')](_0x5a240c[_0x0c54('0x3c')][_0x0c54('0x7e')]);}})['then'](function(_0x28141c){if(_0x28141c){return db[_0x0c54('0x61')][_0x0c54('0x28')]({'where':{'ListId':_0x5a240c[_0x0c54('0x3c')][_0x0c54('0x7e')],'VoiceQueueId':_0x5a240c[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](function(){return _0x28141c;});}})[_0x0c54('0x27')](respondWithStatusCode(_0x10b837,null))[_0x0c54('0x50')](handleError(_0x10b837,null));};exports['getBlackLists']=function(_0x591adb,_0x160d41,_0x94bd7d){var _0x2273ef={};var _0x57b90c={};var _0x481559;var _0x5b680e;return db[_0x0c54('0x4b')][_0x0c54('0x66')]({'where':{'id':_0x591adb[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x160d41,null))[_0x0c54('0x27')](function(_0x4984d1){if(_0x4984d1){_0x481559=_0x4984d1;_0x57b90c[_0x0c54('0x3f')]=_[_0x0c54('0x3d')](db[_0x0c54('0x9a')]['rawAttributes']);_0x57b90c[_0x0c54('0x3c')]=_[_0x0c54('0x3d')](_0x591adb[_0x0c54('0x3c')]);_0x57b90c['filters']=_[_0x0c54('0x3e')](_0x57b90c[_0x0c54('0x3f')],_0x57b90c['query']);_0x2273ef[_0x0c54('0x40')]=_[_0x0c54('0x3e')](_0x57b90c[_0x0c54('0x3f')],qs['fields'](_0x591adb['query'][_0x0c54('0x41')]));_0x2273ef[_0x0c54('0x40')]=_0x2273ef[_0x0c54('0x40')][_0x0c54('0x42')]?_0x2273ef[_0x0c54('0x40')]:_0x57b90c[_0x0c54('0x3f')];_0x2273ef[_0x0c54('0x44')]=qs['sort'](_0x591adb[_0x0c54('0x3c')]['sort']);_0x2273ef[_0x0c54('0x48')]=qs[_0x0c54('0x46')](_[_0x0c54('0x47')](_0x591adb['query'],_0x57b90c[_0x0c54('0x46')]));if(_0x591adb[_0x0c54('0x3c')][_0x0c54('0x2e')]){_0x2273ef['where']=_[_0x0c54('0x49')](_0x2273ef[_0x0c54('0x48')],{'$or':_[_0x0c54('0x3b')](_0x2273ef[_0x0c54('0x40')],function(_0x4fca84){var _0x446722={};_0x446722[_0x4fca84]={'$like':'%'+_0x591adb['query'][_0x0c54('0x2e')]+'%'};return _0x446722;})});}_0x2273ef=_[_0x0c54('0x49')]({},_0x2273ef,_0x591adb['options']);return _0x481559[_0x0c54('0xb2')](_0x2273ef);}})[_0x0c54('0x27')](function(_0x55a881){if(_0x55a881){_0x5b680e=_0x55a881['length'];if(!_0x591adb[_0x0c54('0x3c')][_0x0c54('0x60')](_0x0c54('0x43'))){_0x2273ef['limit']=qs[_0x0c54('0x22')](_0x591adb[_0x0c54('0x3c')][_0x0c54('0x22')]);_0x2273ef[_0x0c54('0x20')]=qs[_0x0c54('0x20')](_0x591adb[_0x0c54('0x3c')][_0x0c54('0x20')]);}return _0x481559[_0x0c54('0xb2')](_0x2273ef);}})[_0x0c54('0x27')](function(_0x4c482c){if(_0x4c482c){return _0x4c482c?{'count':_0x5b680e,'rows':_0x4c482c}:null;}})[_0x0c54('0x27')](respondWithResult(_0x160d41,null))[_0x0c54('0x50')](handleError(_0x160d41,null));};exports[_0x0c54('0xb3')]=function(_0x52da8c,_0x106f20,_0x197abf){var _0xbc8b55,_0x16c843;return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x52da8c[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x106f20,null))['then'](function(_0x1af5a9){if(_0x1af5a9){_0x16c843=_0x1af5a9;return _0x1af5a9[_0x0c54('0xb3')](_0x52da8c['body']['ids'],_[_0x0c54('0x5c')](_0x52da8c[_0x0c54('0x5f')],[_0x0c54('0x7e'),'id'])||{});}return null;})[_0x0c54('0x92')](function(_0x28c5a2){var _0x344e6f;_0xbc8b55=_0x28c5a2||[];var _0x104d5b=[];if(_0x28c5a2){for(var _0x55b7f9=0x0;_0x55b7f9<_0x28c5a2[_0x0c54('0x42')];_0x55b7f9+=0x1){var _0x38c2a8=_0x28c5a2[_0x55b7f9][_0x0c54('0x29')]({'plain':!![]});_0x344e6f=squel[_0x0c54('0x9e')]()[_0x0c54('0x9f')](_0x0c54('0xb4'))['fromQuery']([_0x0c54('0xa1'),'ContactId',_0x0c54('0xaf'),_0x0c54('0x63'),'createdAt',_0x0c54('0x5e')],squel[_0x0c54('0xa3')]()[_0x0c54('0x7f')](_0x0c54('0xa1'),_0x0c54('0xa1'))['field']('id','ContactId')[_0x0c54('0x7f')](_0x38c2a8[_0x0c54('0xa6')]['toString'](),_0x0c54('0xaf'))['field'](_0x52da8c['params']['id'][_0x0c54('0x88')](),_0x0c54('0x63'))[_0x0c54('0x7f')](_0x0c54('0xa4'),_0x0c54('0x5d'))['field'](_0x0c54('0xa4'),'updatedAt')['from'](_0x0c54('0xa7'))['where'](_0x0c54('0xa8'))['where'](_0x0c54('0xa9'),_0x38c2a8[_0x0c54('0xa6')][_0x0c54('0x88')]())[_0x0c54('0x48')](_0x0c54('0xb0')))[_0x0c54('0x88')]();_0x104d5b[_0x0c54('0x87')](db['sequelize']['query'](_0x344e6f));}return BPromise[_0x0c54('0x8d')](_0x104d5b);}})['then'](function(){return _0xbc8b55;})[_0x0c54('0x27')](respondWithResult(_0x106f20,null))['catch'](handleError(_0x106f20,null));};exports['removeBlackLists']=function(_0x26cab3,_0x4f9af4,_0x50d348){return db[_0x0c54('0x4b')][_0x0c54('0x53')]({'where':{'id':_0x26cab3[_0x0c54('0x5b')]['id']}})[_0x0c54('0x27')](handleEntityNotFound(_0x4f9af4,null))[_0x0c54('0x27')](function(_0x343b37){if(_0x343b37){return _0x343b37['removeBlackLists'](_0x26cab3[_0x0c54('0x3c')][_0x0c54('0x7e')]);}})[_0x0c54('0x27')](function(_0x1eb695){if(_0x1eb695){return db['CmHopperBlack'][_0x0c54('0x28')]({'where':{'ListId':_0x26cab3[_0x0c54('0x3c')][_0x0c54('0x7e')],'VoiceQueueId':_0x26cab3['params']['id']}})[_0x0c54('0x27')](function(){return _0x1eb695;});}})[_0x0c54('0x27')](respondWithStatusCode(_0x4f9af4,null))[_0x0c54('0x50')](handleError(_0x4f9af4,null));};
\ No newline at end of file
+var _0x738a=['addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','insert','cm_hopper','removeLists','getBlackLists','addBlackLists','cm_hopper_black','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','user','role','outbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','voicePause','interface','forEach','penalty','transaction','each','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','ids','field','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0x738a,0x18b));var _0xa738=function(_0x490e61,_0x7f848e){_0x490e61=_0x490e61-0x0;var _0x169bc6=_0x738a[_0x490e61];return _0x169bc6;};'use strict';var emlformat=require(_0xa738('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa738('0x1'));var rp=require(_0xa738('0x2'));var moment=require(_0xa738('0x3'));var BPromise=require(_0xa738('0x4'));var Mustache=require(_0xa738('0x5'));var util=require(_0xa738('0x6'));var path=require('path');var sox=require(_0xa738('0x7'));var csv=require('to-csv');var ejs=require(_0xa738('0x8'));var fs=require('fs');var fs_extra=require(_0xa738('0x9'));var _=require(_0xa738('0xa'));var squel=require(_0xa738('0xb'));var crypto=require(_0xa738('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa738('0xd'));var toCsv=require(_0xa738('0xe'));var querystring=require(_0xa738('0xf'));var Papa=require(_0xa738('0x10'));var Redis=require(_0xa738('0x11'));var authService=require(_0xa738('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa738('0x13'));var hardwareService=require(_0xa738('0x14'));var logger=require(_0xa738('0x15'))(_0xa738('0x16'));var utils=require(_0xa738('0x17'));var config=require(_0xa738('0x18'));var licenseUtil=require(_0xa738('0x19'));var db=require(_0xa738('0x1a'))['db'];config[_0xa738('0x1b')]=_['defaults'](config[_0xa738('0x1b')],{'host':_0xa738('0x1c'),'port':0x18eb});var socket=require(_0xa738('0x1d'))(new Redis(config[_0xa738('0x1b')]));require(_0xa738('0x1e'))[_0xa738('0x1f')](socket);function respondWithStatusCode(_0xd47666,_0x2c4dd5){_0x2c4dd5=_0x2c4dd5||0xcc;return function(_0x43ad2d){if(_0x43ad2d){return _0xd47666['sendStatus'](_0x2c4dd5);}return _0xd47666[_0xa738('0x20')](_0x2c4dd5)[_0xa738('0x21')]();};}function respondWithResult(_0xd75f96,_0x2acdfe){_0x2acdfe=_0x2acdfe||0xc8;return function(_0x417cb2){if(_0x417cb2){return _0xd75f96[_0xa738('0x20')](_0x2acdfe)[_0xa738('0x22')](_0x417cb2);}};}function respondWithFilteredResult(_0x3d1ad6,_0x109a14){return function(_0x404305){if(_0x404305){var _0x41884d=typeof _0x109a14['offset']===_0xa738('0x23')&&typeof _0x109a14[_0xa738('0x24')]===_0xa738('0x23');var _0x44f07b=_0x404305['count'];var _0x558014=_0x41884d?0x0:_0x109a14[_0xa738('0x25')];var _0x39507b=_0x41884d?_0x404305[_0xa738('0x26')]:_0x109a14['offset']+_0x109a14['limit'];var _0x4a93ed;if(_0x39507b>=_0x44f07b){_0x39507b=_0x44f07b;_0x4a93ed=0xc8;}else{_0x4a93ed=0xce;}_0x3d1ad6[_0xa738('0x20')](_0x4a93ed);return _0x3d1ad6[_0xa738('0x27')](_0xa738('0x28'),_0x558014+'-'+_0x39507b+'/'+_0x44f07b)[_0xa738('0x22')](_0x404305);}return null;};}function patchUpdates(_0x411492){return function(_0x3ca626){try{jsonpatch[_0xa738('0x29')](_0x3ca626,_0x411492,!![]);}catch(_0x5d9156){return BPromise[_0xa738('0x2a')](_0x5d9156);}return _0x3ca626['save']();};}function saveUpdates(_0x135f9c,_0x1cd959){return function(_0x9c0b99){if(_0x9c0b99){return _0x9c0b99[_0xa738('0x2b')](_0x135f9c)[_0xa738('0x2c')](function(_0x563a67){return _0x563a67;});}return null;};}function removeEntity(_0x154a14,_0xf5e552){return function(_0x216916){if(_0x216916){return _0x216916[_0xa738('0x2d')]()[_0xa738('0x2c')](function(){var _0x2fc4e5=_0x216916[_0xa738('0x2e')]({'plain':!![]});var _0x9fc761=[{'name':_0xa738('0x2f'),'value':_0xa738('0x30'),'ignore':![]},{'name':_0xa738('0x31'),'value':'outbound','ignore':![]}];var _0x200dd3=_(_0x9fc761)[_0xa738('0x32')](_0xa738('0x33'))[_0xa738('0x34')]('value')[_0xa738('0x35')]();if(_[_0xa738('0x36')](_0x200dd3,_0x2fc4e5['type'])){return;}var _0x417818=_[_0xa738('0x37')](_0x9fc761,[_0xa738('0x35'),_0x2fc4e5[_0xa738('0x38')]])[_0xa738('0x39')];return db[_0xa738('0x3a')]['destroy']({'where':{'type':_0x417818,'resourceId':_0x2fc4e5['id']}})[_0xa738('0x2c')](function(){return _0x216916;});})[_0xa738('0x2c')](function(){_0x154a14['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c7cf4,_0x495819){return function(_0x1e5f5a){if(!_0x1e5f5a){_0x3c7cf4['sendStatus'](0x194);}return _0x1e5f5a;};}function handleError(_0x360166,_0x375e64){_0x375e64=_0x375e64||0x1f4;return function(_0x3e2c64){logger[_0xa738('0x3b')](_0x3e2c64['stack']);if(_0x3e2c64[_0xa738('0x39')]){delete _0x3e2c64[_0xa738('0x39')];}_0x360166['status'](_0x375e64)[_0xa738('0x3c')](_0x3e2c64);};}exports[_0xa738('0x3d')]=function(_0x30b876,_0x45f24f){var _0x34b31e={},_0x2d60cd={},_0x2f357e={'count':0x0,'rows':[]};var _0x420058=_[_0xa738('0x34')](db[_0xa738('0x3e')][_0xa738('0x3f')],function(_0x41c922){return{'name':_0x41c922[_0xa738('0x40')],'type':_0x41c922[_0xa738('0x38')][_0xa738('0x41')]};});_0x2d60cd[_0xa738('0x42')]=_[_0xa738('0x34')](_0x420058,'name');_0x2d60cd[_0xa738('0x43')]=_[_0xa738('0x44')](_0x30b876[_0xa738('0x43')]);_0x2d60cd[_0xa738('0x45')]=_[_0xa738('0x46')](_0x2d60cd[_0xa738('0x42')],_0x2d60cd[_0xa738('0x43')]);_0x34b31e[_0xa738('0x47')]=_[_0xa738('0x46')](_0x2d60cd[_0xa738('0x42')],qs['fields'](_0x30b876[_0xa738('0x43')][_0xa738('0x48')]));_0x34b31e[_0xa738('0x47')]=_0x34b31e[_0xa738('0x47')][_0xa738('0x49')]?_0x34b31e['attributes']:_0x2d60cd[_0xa738('0x42')];if(!_0x30b876[_0xa738('0x43')][_0xa738('0x4a')]('nolimit')){_0x34b31e[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x30b876[_0xa738('0x43')][_0xa738('0x24')]);_0x34b31e[_0xa738('0x25')]=qs['offset'](_0x30b876['query'][_0xa738('0x25')]);}_0x34b31e[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x30b876[_0xa738('0x43')][_0xa738('0x4c')]);_0x34b31e['where']=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x30b876[_0xa738('0x43')],_0x2d60cd['filters']),_0x420058);if(_0x30b876[_0xa738('0x43')]['filter']){_0x34b31e[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x34b31e[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0x420058,function(_0x28a5af){if(_0x28a5af[_0xa738('0x38')]!==_0xa738('0x50')){var _0x2ce718={};_0x2ce718[_0x28a5af[_0xa738('0x39')]]={'$like':'%'+_0x30b876[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x2ce718;}})});}_0x34b31e=_[_0xa738('0x4f')]({},_0x34b31e,_0x30b876['options']);var _0x414884={'where':_0x34b31e[_0xa738('0x4e')]};return db['VoiceQueue'][_0xa738('0x26')](_0x414884)['then'](function(_0x2ac1a7){_0x2f357e[_0xa738('0x26')]=_0x2ac1a7;if(_0x30b876[_0xa738('0x43')][_0xa738('0x51')]){_0x34b31e[_0xa738('0x52')]=[{'all':!![]}];}return db['VoiceQueue'][_0xa738('0x53')](_0x34b31e);})[_0xa738('0x2c')](function(_0x3fa1c2){_0x2f357e['rows']=_0x3fa1c2;return _0x2f357e;})['then'](respondWithFilteredResult(_0x45f24f,_0x34b31e))[_0xa738('0x54')](handleError(_0x45f24f,null));};exports[_0xa738('0x55')]=function(_0x823770,_0x5e3c08){var _0x22d15e={'raw':![],'where':{'id':_0x823770[_0xa738('0x56')]['id']}},_0x2b2aa2={};_0x2b2aa2[_0xa738('0x42')]=_[_0xa738('0x44')](db['VoiceQueue'][_0xa738('0x3f')]);_0x2b2aa2[_0xa738('0x43')]=_[_0xa738('0x44')](_0x823770[_0xa738('0x43')]);_0x2b2aa2[_0xa738('0x45')]=_['intersection'](_0x2b2aa2[_0xa738('0x42')],_0x2b2aa2[_0xa738('0x43')]);_0x22d15e[_0xa738('0x47')]=_[_0xa738('0x46')](_0x2b2aa2['model'],qs[_0xa738('0x48')](_0x823770[_0xa738('0x43')][_0xa738('0x48')]));_0x22d15e[_0xa738('0x47')]=_0x22d15e[_0xa738('0x47')]['length']?_0x22d15e['attributes']:_0x2b2aa2[_0xa738('0x42')];if(_0x823770[_0xa738('0x43')][_0xa738('0x51')]){_0x22d15e[_0xa738('0x52')]=[{'all':!![]}];}_0x22d15e=_['merge']({},_0x22d15e,_0x823770[_0xa738('0x57')]);return db[_0xa738('0x3e')][_0xa738('0x37')](_0x22d15e)[_0xa738('0x2c')](handleEntityNotFound(_0x5e3c08,null))[_0xa738('0x2c')](respondWithResult(_0x5e3c08,null))[_0xa738('0x54')](handleError(_0x5e3c08,null));};exports[_0xa738('0x58')]=function(_0x1e28ff,_0x44ab30){return db[_0xa738('0x3e')][_0xa738('0x58')](_0x1e28ff[_0xa738('0x59')],{})['then'](function(_0x561bfc){var _0x1da184=_0x1e28ff[_0xa738('0x5a')][_0xa738('0x2e')]({'plain':!![]});if(!_0x1da184)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1da184[_0xa738('0x5b')]===_0xa738('0x5a')){var _0x409f6c=_0x561bfc[_0xa738('0x2e')]({'plain':!![]});var _0x38c00e=[{'name':_0xa738('0x2f'),'value':_0xa738('0x30')},{'name':'QueueCampaigns','value':_0xa738('0x5c')}];var _0x21c80c=_['find'](_0x38c00e,[_0xa738('0x35'),_0x409f6c[_0xa738('0x38')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x21c80c,'userProfileId':_0x1da184['userProfileId']},'raw':!![]})[_0xa738('0x2c')](function(_0x3b4a21){if(_0x3b4a21&&_0x3b4a21[_0xa738('0x5d')]===0x0){return db[_0xa738('0x3a')]['create']({'name':_0x409f6c[_0xa738('0x39')],'resourceId':_0x409f6c['id'],'type':_0x3b4a21['name'],'sectionId':_0x3b4a21['id']},{})[_0xa738('0x2c')](function(){return _0x561bfc;});}else{return _0x561bfc;}})[_0xa738('0x54')](function(_0x1740ff){logger[_0xa738('0x3b')](_0xa738('0x5e'),_0x1740ff);throw _0x1740ff;});}return _0x561bfc;})[_0xa738('0x2c')](respondWithResult(_0x44ab30,0xc9))[_0xa738('0x54')](handleError(_0x44ab30,null));};exports['clone']=function(_0x20a9db,_0x562041){var _0x342d32={'where':{'id':_0x20a9db[_0xa738('0x56')]['id']}},_0xa2c49d={};_0xa2c49d['model']=_['keys'](db[_0xa738('0x3e')][_0xa738('0x3f')]);_0x342d32[_0xa738('0x47')]=_[_0xa738('0x46')](_0xa2c49d[_0xa738('0x42')],qs[_0xa738('0x48')](_0x20a9db['query'][_0xa738('0x48')]));_0x342d32[_0xa738('0x47')]=_0x342d32[_0xa738('0x47')]['length']?_0x342d32[_0xa738('0x47')]:_0xa2c49d[_0xa738('0x42')];if(_0x20a9db[_0xa738('0x43')][_0xa738('0x51')]){_0x342d32[_0xa738('0x52')]=[{'all':!![]}];}_0x342d32=_[_0xa738('0x4f')]({},_0x342d32,_0x20a9db[_0xa738('0x57')]);return db[_0xa738('0x3e')][_0xa738('0x37')](_0x342d32)[_0xa738('0x2c')](handleEntityNotFound(_0x562041,null))[_0xa738('0x2c')](function(_0x23aca6){if(_0x23aca6){var _0x384087=_0x23aca6['get']({'plain':!![]});_0x384087=qs[_0xa738('0x5f')](_0x384087,['id',_0xa738('0x60'),_0xa738('0x61')]);_0x20a9db[_0xa738('0x59')]=_[_0xa738('0x5f')](_0x20a9db[_0xa738('0x59')],['id',_0xa738('0x60'),_0xa738('0x61')]);return db['VoiceQueue'][_0xa738('0x58')](_[_0xa738('0x4f')](_0x384087,_0x20a9db[_0xa738('0x59')]),{'include':_0x20a9db[_0xa738('0x43')][_0xa738('0x51')]?[{'all':!![]}]:undefined})[_0xa738('0x2c')](function(_0x23e154){var _0x565772=_0x20a9db['user'][_0xa738('0x2e')]({'plain':!![]});if(!_0x565772)throw new Error(_0xa738('0x62'));if(_0x565772[_0xa738('0x5b')]==='user'){var _0x33ef3a=_0x23e154[_0xa738('0x2e')]({'plain':!![]});var _0x19faa7=[{'name':_0xa738('0x2f'),'value':_0xa738('0x30')},{'name':_0xa738('0x31'),'value':_0xa738('0x5c')}];var _0x200398=_[_0xa738('0x37')](_0x19faa7,[_0xa738('0x35'),_0x33ef3a[_0xa738('0x38')]])[_0xa738('0x39')];return db[_0xa738('0x63')][_0xa738('0x37')]({'where':{'name':_0x200398,'userProfileId':_0x565772['userProfileId']},'raw':!![]})['then'](function(_0x3a7be8){if(_0x3a7be8&&_0x3a7be8[_0xa738('0x5d')]===0x0){return db[_0xa738('0x3a')][_0xa738('0x58')]({'name':_0x33ef3a[_0xa738('0x39')],'resourceId':_0x33ef3a['id'],'type':_0x3a7be8[_0xa738('0x39')],'sectionId':_0x3a7be8['id']},{})[_0xa738('0x2c')](function(){return _0x23e154;});}else{return _0x23e154;}})['catch'](function(_0x53edc6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53edc6);throw _0x53edc6;});}return _0x23e154;});}})[_0xa738('0x2c')](respondWithResult(_0x562041,0xc9))[_0xa738('0x54')](handleError(_0x562041,null));};exports['update']=function(_0x1eafa5,_0x45057d){if(_0x1eafa5[_0xa738('0x59')]['id']){delete _0x1eafa5[_0xa738('0x59')]['id'];}return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x1eafa5[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x45057d,null))[_0xa738('0x2c')](saveUpdates(_0x1eafa5[_0xa738('0x59')],null))[_0xa738('0x2c')](respondWithResult(_0x45057d,null))[_0xa738('0x54')](handleError(_0x45057d,null));};exports['destroy']=function(_0x18221c,_0x2b145c){return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x18221c[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b145c,null))['then'](removeEntity(_0x2b145c,null))[_0xa738('0x54')](handleError(_0x2b145c,null));};exports[_0xa738('0x64')]=function(_0x2a26f0,_0x31b2ee,_0x378a7b){var _0x113466={'raw':![],'where':{}};var _0x530158={};var _0xc29232={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x2a26f0[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x31b2ee,null))[_0xa738('0x2c')](function(_0x282044){if(_0x282044){_0x530158['model']=_[_0xa738('0x44')](db[_0xa738('0x66')][_0xa738('0x3f')]);_0x530158['query']=_['keys'](_0x2a26f0['query']);_0x530158[_0xa738('0x45')]=_['intersection'](_0x530158[_0xa738('0x42')],_0x530158[_0xa738('0x43')]);_0x113466[_0xa738('0x47')]=_['intersection'](_0x530158[_0xa738('0x42')],qs[_0xa738('0x48')](_0x2a26f0[_0xa738('0x43')][_0xa738('0x48')]));_0x113466['attributes']=_0x113466[_0xa738('0x47')][_0xa738('0x49')]?_0x113466[_0xa738('0x47')]:_0x530158[_0xa738('0x42')];if(!_0x2a26f0[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x113466[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x2a26f0[_0xa738('0x43')][_0xa738('0x24')]);_0x113466[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x2a26f0[_0xa738('0x43')]['offset']);}_0x113466[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x2a26f0[_0xa738('0x43')][_0xa738('0x4c')]);_0x113466[_0xa738('0x4e')]=qs['filters'](_['pick'](_0x2a26f0[_0xa738('0x43')],_0x530158[_0xa738('0x45')]));_0x113466[_0xa738('0x4e')][_0xa738('0x68')]=_0x282044['id'];if(_0x2a26f0[_0xa738('0x43')]['filter']){_0x113466['where']=_[_0xa738('0x4f')](_0x113466['where'],{'$or':_[_0xa738('0x34')](_0x113466['attributes'],function(_0x4cff26){var _0x975927={};_0x975927[_0x4cff26]={'$like':'%'+_0x2a26f0[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x975927;})});}_0x113466=_[_0xa738('0x4f')]({},_0x113466,_0x2a26f0['options']);return db['CmHopper']['count']({'where':_0x113466[_0xa738('0x4e')]})[_0xa738('0x2c')](function(_0x8a8d6c){_0xc29232[_0xa738('0x26')]=_0x8a8d6c;if(_0x2a26f0[_0xa738('0x43')][_0xa738('0x51')]){_0x113466[_0xa738('0x52')]=[{'all':!![]}];}return db[_0xa738('0x66')][_0xa738('0x53')](_0x113466);})[_0xa738('0x2c')](function(_0x4074a1){_0xc29232[_0xa738('0x69')]=_0x4074a1;return _0xc29232;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x31b2ee,_0x113466))[_0xa738('0x54')](handleError(_0x31b2ee,null));};exports[_0xa738('0x6a')]=function(_0x1fa85f,_0x5e56a3,_0x456738){var _0x106526={'raw':!![],'where':{}};var _0x1b267b={};var _0x4bdba7={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x1fa85f['params']['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x5e56a3,null))[_0xa738('0x2c')](function(_0x3b0feb){if(_0x3b0feb){_0x1b267b['model']=_[_0xa738('0x44')](db[_0xa738('0x6b')][_0xa738('0x3f')]);_0x1b267b[_0xa738('0x43')]=_['keys'](_0x1fa85f[_0xa738('0x43')]);_0x1b267b[_0xa738('0x45')]=_[_0xa738('0x46')](_0x1b267b[_0xa738('0x42')],_0x1b267b[_0xa738('0x43')]);_0x106526['attributes']=_['intersection'](_0x1b267b[_0xa738('0x42')],qs[_0xa738('0x48')](_0x1fa85f['query'][_0xa738('0x48')]));_0x106526['attributes']=_0x106526['attributes'][_0xa738('0x49')]?_0x106526[_0xa738('0x47')]:_0x1b267b[_0xa738('0x42')];if(!_0x1fa85f[_0xa738('0x43')]['hasOwnProperty']('nolimit')){_0x106526[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x1fa85f[_0xa738('0x43')][_0xa738('0x24')]);_0x106526['offset']=qs[_0xa738('0x25')](_0x1fa85f['query'][_0xa738('0x25')]);}_0x106526[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x1fa85f[_0xa738('0x43')]['sort']);_0x106526['where']=qs[_0xa738('0x45')](_['pick'](_0x1fa85f[_0xa738('0x43')],_0x1b267b[_0xa738('0x45')]));_0x106526[_0xa738('0x4e')][_0xa738('0x68')]=_0x3b0feb['id'];if(_0x1fa85f[_0xa738('0x43')]['filter']){_0x106526[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x106526[_0xa738('0x4e')],{'$or':_['map'](_0x106526[_0xa738('0x47')],function(_0x41fb14){var _0x1e3722={};_0x1e3722[_0x41fb14]={'$like':'%'+_0x1fa85f[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x1e3722;})});}_0x106526=_['merge']({},_0x106526,_0x1fa85f['options']);return db[_0xa738('0x6b')][_0xa738('0x26')]({'where':_0x106526[_0xa738('0x4e')]})[_0xa738('0x2c')](function(_0x2a2ec3){_0x4bdba7['count']=_0x2a2ec3;if(_0x1fa85f[_0xa738('0x43')][_0xa738('0x51')]){_0x106526[_0xa738('0x52')]=[{'all':!![]}];}return db[_0xa738('0x6b')][_0xa738('0x53')](_0x106526);})[_0xa738('0x2c')](function(_0x412373){_0x4bdba7['rows']=_0x412373;return _0x4bdba7;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x5e56a3,_0x106526))[_0xa738('0x54')](handleError(_0x5e56a3,null));};exports[_0xa738('0x6c')]=function(_0x2ccbcc,_0x1111e6,_0x3b7770){var _0xa9142c={'raw':!![],'where':{}};var _0x2e4b81={};var _0x24fe9a={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x2ccbcc['params']['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x1111e6,null))[_0xa738('0x2c')](function(_0x16e86b){if(_0x16e86b){_0x2e4b81[_0xa738('0x42')]=_['keys'](db[_0xa738('0x6d')][_0xa738('0x3f')]);_0x2e4b81[_0xa738('0x43')]=_['keys'](_0x2ccbcc['query']);_0x2e4b81[_0xa738('0x45')]=_[_0xa738('0x46')](_0x2e4b81['model'],_0x2e4b81[_0xa738('0x43')]);_0xa9142c[_0xa738('0x47')]=_[_0xa738('0x46')](_0x2e4b81[_0xa738('0x42')],qs[_0xa738('0x48')](_0x2ccbcc[_0xa738('0x43')]['fields']));_0xa9142c['attributes']=_0xa9142c[_0xa738('0x47')][_0xa738('0x49')]?_0xa9142c[_0xa738('0x47')]:_0x2e4b81[_0xa738('0x42')];if(!_0x2ccbcc['query'][_0xa738('0x4a')](_0xa738('0x67'))){_0xa9142c['limit']=qs[_0xa738('0x24')](_0x2ccbcc[_0xa738('0x43')]['limit']);_0xa9142c['offset']=qs[_0xa738('0x25')](_0x2ccbcc['query'][_0xa738('0x25')]);}_0xa9142c[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x2ccbcc[_0xa738('0x43')][_0xa738('0x4c')]);_0xa9142c[_0xa738('0x4e')]=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x2ccbcc['query'],_0x2e4b81['filters']));_0xa9142c[_0xa738('0x4e')][_0xa738('0x68')]=_0x16e86b['id'];if(_0x2ccbcc[_0xa738('0x43')][_0xa738('0x32')]){_0xa9142c[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0xa9142c[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0xa9142c[_0xa738('0x47')],function(_0x44a191){var _0x25ff65={};_0x25ff65[_0x44a191]={'$like':'%'+_0x2ccbcc['query'][_0xa738('0x32')]+'%'};return _0x25ff65;})});}_0xa9142c=_[_0xa738('0x4f')]({},_0xa9142c,_0x2ccbcc[_0xa738('0x57')]);return db[_0xa738('0x6d')]['count']({'where':_0xa9142c['where']})[_0xa738('0x2c')](function(_0x3b01c9){_0x24fe9a['count']=_0x3b01c9;if(_0x2ccbcc[_0xa738('0x43')][_0xa738('0x51')]){_0xa9142c[_0xa738('0x52')]=[{'all':!![]}];}return db[_0xa738('0x6d')][_0xa738('0x53')](_0xa9142c);})[_0xa738('0x2c')](function(_0x387629){_0x24fe9a['rows']=_0x387629;return _0x24fe9a;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x1111e6,_0xa9142c))[_0xa738('0x54')](handleError(_0x1111e6,null));};exports['getHopperBlacks']=function(_0x45afa0,_0x136a17,_0x7fa764){var _0x57644e={'raw':!![],'where':{}};var _0x162d39={};var _0x2626a5={'count':0x0,'rows':[]};return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x45afa0[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x136a17,null))[_0xa738('0x2c')](function(_0x3c8aae){if(_0x3c8aae){_0x162d39[_0xa738('0x42')]=_['keys'](db[_0xa738('0x6e')][_0xa738('0x3f')]);_0x162d39['query']=_[_0xa738('0x44')](_0x45afa0[_0xa738('0x43')]);_0x162d39[_0xa738('0x45')]=_['intersection'](_0x162d39['model'],_0x162d39[_0xa738('0x43')]);_0x57644e[_0xa738('0x47')]=_['intersection'](_0x162d39[_0xa738('0x42')],qs[_0xa738('0x48')](_0x45afa0[_0xa738('0x43')][_0xa738('0x48')]));_0x57644e[_0xa738('0x47')]=_0x57644e[_0xa738('0x47')][_0xa738('0x49')]?_0x57644e[_0xa738('0x47')]:_0x162d39[_0xa738('0x42')];if(!_0x45afa0[_0xa738('0x43')]['hasOwnProperty'](_0xa738('0x67'))){_0x57644e['limit']=qs[_0xa738('0x24')](_0x45afa0[_0xa738('0x43')]['limit']);_0x57644e['offset']=qs[_0xa738('0x25')](_0x45afa0[_0xa738('0x43')][_0xa738('0x25')]);}_0x57644e[_0xa738('0x4b')]=qs['sort'](_0x45afa0[_0xa738('0x43')][_0xa738('0x4c')]);_0x57644e[_0xa738('0x4e')]=qs['filters'](_['pick'](_0x45afa0[_0xa738('0x43')],_0x162d39[_0xa738('0x45')]));_0x57644e['where'][_0xa738('0x68')]=_0x3c8aae['id'];if(_0x45afa0['query']['filter']){_0x57644e[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x57644e[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0x57644e[_0xa738('0x47')],function(_0x1cebce){var _0x1764be={};_0x1764be[_0x1cebce]={'$like':'%'+_0x45afa0[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x1764be;})});}_0x57644e=_['merge']({},_0x57644e,_0x45afa0[_0xa738('0x57')]);return db[_0xa738('0x6e')][_0xa738('0x26')]({'where':_0x57644e[_0xa738('0x4e')]})[_0xa738('0x2c')](function(_0x282c1d){_0x2626a5[_0xa738('0x26')]=_0x282c1d;if(_0x45afa0[_0xa738('0x43')]['includeAll']){_0x57644e['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x57644e);})[_0xa738('0x2c')](function(_0x1bbdb4){_0x2626a5[_0xa738('0x69')]=_0x1bbdb4;return _0x2626a5;});}})[_0xa738('0x2c')](respondWithFilteredResult(_0x136a17,_0x57644e))[_0xa738('0x54')](handleError(_0x136a17,null));};exports[_0xa738('0x6f')]=function(_0x5d053a,_0x37960e,_0x4d1817){var _0x1adf5e={};var _0x3b3b05={};var _0x3e5811;var _0x4cb392;return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x5d053a['params']['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x37960e,null))[_0xa738('0x2c')](function(_0xc4f39f){if(_0xc4f39f){_0x3e5811=_0xc4f39f;_0x3b3b05[_0xa738('0x42')]=_[_0xa738('0x44')](db['Team'][_0xa738('0x3f')]);_0x3b3b05['query']=_['keys'](_0x5d053a[_0xa738('0x43')]);_0x3b3b05['filters']=_[_0xa738('0x46')](_0x3b3b05['model'],_0x3b3b05[_0xa738('0x43')]);_0x1adf5e[_0xa738('0x47')]=_[_0xa738('0x46')](_0x3b3b05[_0xa738('0x42')],qs[_0xa738('0x48')](_0x5d053a[_0xa738('0x43')][_0xa738('0x48')]));_0x1adf5e[_0xa738('0x47')]=_0x1adf5e['attributes'][_0xa738('0x49')]?_0x1adf5e['attributes']:_0x3b3b05['model'];_0x1adf5e[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x5d053a[_0xa738('0x43')][_0xa738('0x4c')]);_0x1adf5e[_0xa738('0x4e')]=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x5d053a[_0xa738('0x43')],_0x3b3b05[_0xa738('0x45')]));if(_0x5d053a['query'][_0xa738('0x32')]){_0x1adf5e[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x1adf5e[_0xa738('0x4e')],{'$or':_[_0xa738('0x34')](_0x1adf5e[_0xa738('0x47')],function(_0x5108a3){var _0x2768d0={};_0x2768d0[_0x5108a3]={'$like':'%'+_0x5d053a[_0xa738('0x43')]['filter']+'%'};return _0x2768d0;})});}_0x1adf5e=_[_0xa738('0x4f')]({},_0x1adf5e,_0x5d053a['options']);return _0x3e5811[_0xa738('0x6f')](_0x1adf5e);}})[_0xa738('0x2c')](function(_0x347186){if(_0x347186){_0x4cb392=_0x347186[_0xa738('0x49')];if(!_0x5d053a[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x1adf5e[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x5d053a[_0xa738('0x43')]['limit']);_0x1adf5e[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x5d053a[_0xa738('0x43')]['offset']);}return _0x3e5811[_0xa738('0x6f')](_0x1adf5e);}})[_0xa738('0x2c')](function(_0x1c1631){if(_0x1c1631){return _0x1c1631?{'count':_0x4cb392,'rows':_0x1c1631}:null;}})[_0xa738('0x2c')](respondWithResult(_0x37960e,null))['catch'](handleError(_0x37960e,null));};exports[_0xa738('0x70')]=function(_0x17bfec,_0x3992de,_0x172a38){var _0x281477=_0x17bfec[_0xa738('0x59')][_0xa738('0x71')];var _0x5a2c4f=_[_0xa738('0x34')](_0x281477,'id');return db[_0xa738('0x72')][_0xa738('0x53')]({'where':{'id':_0x5a2c4f},'attributes':['id'],'include':[{'model':db[_0xa738('0x73')],'as':_0xa738('0x74'),'attributes':['id',_0xa738('0x39'),_0xa738('0x75'),_0xa738('0x76'),_0xa738('0x77')],'raw':!![]}]})['then'](function(_0x7cc2f5){if(_0x7cc2f5){var _0x58bb4c=_['flatMap'](_0x7cc2f5,function(_0x38228a){var _0x8b638=_0x38228a[_0xa738('0x2e')]({'plain':!![]});_0x8b638['Agents'][_0xa738('0x78')](function(_0x2063ce){_0x2063ce[_0xa738('0x79')]=_[_0xa738('0x37')](_0x281477,{'id':_0x8b638['id']})[_0xa738('0x79')];});return _0x8b638['Agents'];});return db['VoiceQueue'][_0xa738('0x37')]({'where':{'id':_0x17bfec[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](function(_0x134fe8){return db['sequelize'][_0xa738('0x7a')](function(_0x2c4cdb){return _0x134fe8[_0xa738('0x70')](_0x5a2c4f,{'transaction':_0x2c4cdb})[_0xa738('0x2c')](function(){return BPromise[_0xa738('0x7b')](_0x281477,function(_0x4f39e1){return db['TeamVoiceQueue'][_0xa738('0x7c')]({'TeamId':_0x4f39e1['id'],'VoiceQueueId':_0x17bfec[_0xa738('0x56')]['id'],'penalty':_0x4f39e1[_0xa738('0x79')]},{'transaction':_0x2c4cdb});});})[_0xa738('0x2c')](function(){return BPromise[_0xa738('0x7b')](_0x58bb4c,function(_0x984f47){return db[_0xa738('0x7d')]['findOrCreate']({'where':{'UserId':_0x984f47['id'],'VoiceQueueId':_0x17bfec[_0xa738('0x56')]['id']},'defaults':{'penalty':_0x984f47[_0xa738('0x79')]},'transaction':_0x2c4cdb});});})[_0xa738('0x2c')](function(){return BPromise[_0xa738('0x7b')](_[_0xa738('0x32')](_0x58bb4c,{'online':!![]}),function(_0x4e1fcb){return db[_0xa738('0x7e')][_0xa738('0x7c')]({'membername':_0x4e1fcb[_0xa738('0x39')],'UserId':_0x4e1fcb['id'],'queue_name':_0x134fe8[_0xa738('0x39')],'VoiceQueueId':_0x134fe8['id'],'interface':_[_0xa738('0x7f')](_0x4e1fcb[_0xa738('0x77')])?util[_0xa738('0x80')](_0xa738('0x81'),_0x4e1fcb[_0xa738('0x39')]):_0x4e1fcb[_0xa738('0x77')],'paused':_0x4e1fcb[_0xa738('0x76')]||![],'penalty':_0x4e1fcb[_0xa738('0x79')]},{'transaction':_0x2c4cdb});});})['then'](function(){_0x58bb4c['forEach'](function(_0x57e2c3){socket[_0xa738('0x82')](_0xa738('0x83'),{'UserId':_0x57e2c3['id'],'VoiceQueueId':_0x134fe8['id']});});});});});}})['then'](respondWithStatusCode(_0x3992de,null))[_0xa738('0x54')](handleError(_0x3992de,null));};exports['removeTeams']=function(_0x3a2d73,_0xbd20a1,_0x472f81){return db['Team'][_0xa738('0x53')]({'where':{'id':_0x3a2d73[_0xa738('0x43')][_0xa738('0x84')]},'attributes':['id'],'include':[{'model':db[_0xa738('0x73')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa738('0x2c')](handleEntityNotFound(_0xbd20a1,null))[_0xa738('0x2c')](function(_0x16501b){var _0x4de95a=_[_0xa738('0x34')](_0x16501b,'id');var _0x468d30=[];var _0x4daced=[];var _0xa7d461=squel['select']();_0xa7d461[_0xa738('0x85')]('tq.TeamId')[_0xa738('0x86')](_0xa738('0x87'),'tq')[_0xa738('0x88')](_0xa738('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa738('0x4e')](_0xa738('0x8a'),_0x3a2d73[_0xa738('0x56')]['id']);for(var _0x2bd3b0=0x0;_0x2bd3b0<_0x16501b[_0xa738('0x49')];_0x2bd3b0+=0x1){let _0x4f8e51=_0x16501b[_0x2bd3b0];for(var _0x194ecd=0x0;_0x194ecd<_0x4f8e51[_0xa738('0x74')][_0xa738('0x49')];_0x194ecd+=0x1){let _0x2b3435=_0x4f8e51[_0xa738('0x74')][_0x194ecd];var _0x3e6b1d=_0xa7d461[_0xa738('0x8b')]();_0x3e6b1d[_0xa738('0x4e')]('ut.UserId\x20=\x20?',_0x2b3435['id']);_0x4daced[_0xa738('0x8c')](db[_0xa738('0x8d')]['query'](_0x3e6b1d[_0xa738('0x8e')](),{'type':db[_0xa738('0x8d')][_0xa738('0x8f')][_0xa738('0x90')]})[_0xa738('0x2c')](function(_0x100e18){if(_0x100e18['length']===0x1){return _0x2b3435['id'];}else{var _0x5b76e7=_[_0xa738('0x91')](_[_0xa738('0x34')](_0x100e18,_0xa738('0x92')),function(_0x1ceac9){return _[_0xa738('0x36')](_0x4de95a,_0x1ceac9);});if(_0x5b76e7){return _0x2b3435['id'];}}}));}}return BPromise[_0xa738('0x93')](_0x4daced)[_0xa738('0x2c')](function(_0x14aedc){_0x468d30=_(_0x468d30)['union'](_0x14aedc)[_0xa738('0x94')]()[_0xa738('0x35')]();return db['VoiceQueue'][_0xa738('0x37')]({'where':{'id':_0x3a2d73[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](function(_0x1ea16b){return db['sequelize'][_0xa738('0x7a')](function(_0x59bf83){return _0x1ea16b[_0xa738('0x95')](_0x3a2d73[_0xa738('0x43')][_0xa738('0x84')],{'transaction':_0x59bf83})[_0xa738('0x2c')](function(){if(!_[_0xa738('0x96')](_0x468d30)){return _0x1ea16b[_0xa738('0x97')](_0x468d30,{'transaction':_0x59bf83})[_0xa738('0x2c')](function(){return db['UserVoiceQueueRt'][_0xa738('0x2d')]({'where':{'VoiceQueueId':_0x3a2d73[_0xa738('0x56')]['id'],'UserId':_0x468d30},'transaction':_0x59bf83});});}})[_0xa738('0x2c')](function(){_0x468d30[_0xa738('0x78')](function(_0x71d9d){socket['emit'](_0xa738('0x98'),{'UserId':_0x71d9d,'VoiceQueueId':_0x1ea16b['id']});});});});});});})[_0xa738('0x2c')](respondWithStatusCode(_0xbd20a1,null))[_0xa738('0x54')](handleError(_0xbd20a1,null));};exports[_0xa738('0x99')]=function(_0xb43761,_0x446adb,_0x97e756){var _0x41e0a9,_0x8fbced;return db[_0xa738('0x3e')]['find']({'where':{'id':_0xb43761[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x446adb,null))[_0xa738('0x2c')](function(_0x1c0723){if(_0x1c0723){_0x8fbced=_0x1c0723;return _0x1c0723[_0xa738('0x99')](_0xb43761[_0xa738('0x59')][_0xa738('0x84')],_['omit'](_0xb43761[_0xa738('0x59')],[_0xa738('0x84'),'id'])||{})[_0xa738('0x9a')](function(_0x4fa6b4){for(var _0x30e905=0x0;_0x30e905<_0xb43761[_0xa738('0x59')]['ids']['length'];_0x30e905+=0x1){socket['emit'](_0xa738('0x83'),{'UserId':_0xb43761['body'][_0xa738('0x84')][_0x30e905],'VoiceQueueId':_0xb43761[_0xa738('0x56')]['id']});}return _0x4fa6b4;});}})[_0xa738('0x2c')](function(_0x4e4ecf){_0x41e0a9=_0x4e4ecf||[];if(_0x8fbced){return db[_0xa738('0x73')][_0xa738('0x53')]({'where':{'id':_0xb43761[_0xa738('0x59')][_0xa738('0x84')]},'attributes':['id',_0xa738('0x39'),'online',_0xa738('0x76'),_0xa738('0x77')],'raw':!![]});}})[_0xa738('0x2c')](function(_0x487b41){if(!_[_0xa738('0x96')](_0x487b41)){var _0x32dcbb=[];for(var _0x47db93=0x0;_0x47db93<_0x487b41[_0xa738('0x49')];_0x47db93++){if(_0x487b41[_0x47db93][_0xa738('0x75')]){_0x32dcbb['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x487b41[_0x47db93][_0xa738('0x39')],'UserId':_0x487b41[_0x47db93]['id'],'queue_name':_0x8fbced[_0xa738('0x39')],'VoiceQueueId':_0x8fbced['id'],'interface':_[_0xa738('0x7f')](_0x487b41[_0x47db93][_0xa738('0x77')])?util[_0xa738('0x80')](_0xa738('0x81'),_0x487b41[_0x47db93][_0xa738('0x39')]):_0x487b41[_0x47db93]['interface'],'paused':_0x487b41[_0x47db93][_0xa738('0x76')]||![],'penalty':_0xb43761['body'][_0xa738('0x79')]||0x0}));}}return BPromise['all'](_0x32dcbb);}})[_0xa738('0x2c')](function(){return _0x41e0a9;})[_0xa738('0x2c')](respondWithResult(_0x446adb,null))[_0xa738('0x54')](handleError(_0x446adb,null));};exports[_0xa738('0x97')]=function(_0x353106,_0x108262,_0x9b010b){return db[_0xa738('0x3e')]['find']({'where':{'id':_0x353106[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x108262,null))[_0xa738('0x2c')](function(_0x5b3574){if(_0x5b3574){return _0x5b3574[_0xa738('0x97')](_0x353106['query'][_0xa738('0x84')])[_0xa738('0x2c')](function(){if(_[_0xa738('0x9b')](_0x353106[_0xa738('0x43')]['ids'])){for(var _0x26ba8e=0x0;_0x26ba8e<_0x353106['query'][_0xa738('0x84')][_0xa738('0x49')];_0x26ba8e+=0x1){socket[_0xa738('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x353106[_0xa738('0x43')][_0xa738('0x84')][_0x26ba8e]),'VoiceQueueId':Number(_0x353106['params']['id'])});}}else{socket[_0xa738('0x82')](_0xa738('0x98'),{'UserId':Number(_0x353106[_0xa738('0x43')][_0xa738('0x84')]),'VoiceQueueId':Number(_0x353106[_0xa738('0x56')]['id'])});}});}})[_0xa738('0x2c')](function(_0xd018f9){return db[_0xa738('0x7e')][_0xa738('0x2d')]({'where':{'VoiceQueueId':_0x353106[_0xa738('0x56')]['id'],'UserId':_0x353106[_0xa738('0x43')][_0xa738('0x84')]}})['then'](function(){return _0xd018f9;});})['then'](respondWithStatusCode(_0x108262,null))[_0xa738('0x54')](handleError(_0x108262,null));};exports[_0xa738('0x9c')]=function(_0x57b16e,_0x802a9f,_0x164ce7){var _0x5c00f8={};var _0x86b4ab={};var _0x47fa65;var _0xbe6540;return db['VoiceQueue'][_0xa738('0x65')]({'where':{'id':_0x57b16e[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x802a9f,null))[_0xa738('0x2c')](function(_0x2884d6){if(_0x2884d6){_0x47fa65=_0x2884d6;_0x86b4ab['model']=_[_0xa738('0x44')](db[_0xa738('0x73')][_0xa738('0x3f')]);_0x86b4ab[_0xa738('0x43')]=_['keys'](_0x57b16e[_0xa738('0x43')]);_0x86b4ab[_0xa738('0x45')]=_[_0xa738('0x46')](_0x86b4ab[_0xa738('0x42')],_0x86b4ab['query']);_0x5c00f8[_0xa738('0x47')]=_[_0xa738('0x46')](_0x86b4ab[_0xa738('0x42')],qs['fields'](_0x57b16e[_0xa738('0x43')][_0xa738('0x48')]));_0x5c00f8['attributes']=_0x5c00f8[_0xa738('0x47')][_0xa738('0x49')]?_0x5c00f8[_0xa738('0x47')]:_0x86b4ab[_0xa738('0x42')];_0x5c00f8['order']=qs[_0xa738('0x4c')](_0x57b16e[_0xa738('0x43')][_0xa738('0x4c')]);_0x5c00f8['where']=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x57b16e[_0xa738('0x43')],_0x86b4ab[_0xa738('0x45')]));if(_0x57b16e[_0xa738('0x43')]['filter']){_0x5c00f8[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x5c00f8['where'],{'$or':_[_0xa738('0x34')](_0x5c00f8[_0xa738('0x47')],function(_0x44fc88){var _0x366bd0={};_0x366bd0[_0x44fc88]={'$like':'%'+_0x57b16e[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x366bd0;})});}_0x5c00f8=_[_0xa738('0x4f')]({},_0x5c00f8,_0x57b16e['options']);return _0x47fa65[_0xa738('0x9c')](_0x5c00f8);}})[_0xa738('0x2c')](function(_0x3068ec){if(_0x3068ec){_0xbe6540=_0x3068ec[_0xa738('0x49')];if(!_0x57b16e[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x5c00f8[_0xa738('0x24')]=qs['limit'](_0x57b16e[_0xa738('0x43')][_0xa738('0x24')]);_0x5c00f8[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x57b16e[_0xa738('0x43')][_0xa738('0x25')]);}return _0x47fa65[_0xa738('0x9c')](_0x5c00f8);}})['then'](function(_0x530660){if(_0x530660){return _0x530660?{'count':_0xbe6540,'rows':_0x530660}:null;}})[_0xa738('0x2c')](respondWithResult(_0x802a9f,null))['catch'](handleError(_0x802a9f,null));};exports[_0xa738('0x9d')]=function(_0x1460a3,_0x5bb48f,_0x3c746c){var _0x33e191={};var _0x3120dc={};var _0x20ae19;var _0x19d7d4;return db['VoiceQueue'][_0xa738('0x65')]({'where':{'id':_0x1460a3[_0xa738('0x56')]['id']}})['then'](handleEntityNotFound(_0x5bb48f,null))[_0xa738('0x2c')](function(_0x5e0c17){if(_0x5e0c17){_0x20ae19=_0x5e0c17;_0x3120dc[_0xa738('0x42')]=_['keys'](db[_0xa738('0x7e')][_0xa738('0x3f')]);_0x3120dc[_0xa738('0x43')]=_[_0xa738('0x44')](_0x1460a3[_0xa738('0x43')]);_0x3120dc[_0xa738('0x45')]=_[_0xa738('0x46')](_0x3120dc['model'],_0x3120dc[_0xa738('0x43')]);_0x33e191[_0xa738('0x47')]=_[_0xa738('0x46')](_0x3120dc['model'],qs['fields'](_0x1460a3[_0xa738('0x43')]['fields']));_0x33e191['attributes']=_0x33e191[_0xa738('0x47')][_0xa738('0x49')]?_0x33e191[_0xa738('0x47')]:_0x3120dc[_0xa738('0x42')];_0x33e191[_0xa738('0x4b')]=qs[_0xa738('0x4c')](_0x1460a3['query'][_0xa738('0x4c')]);_0x33e191[_0xa738('0x4e')]=qs[_0xa738('0x45')](_['pick'](_0x1460a3[_0xa738('0x43')],_0x3120dc['filters']));if(_0x1460a3[_0xa738('0x43')]['filter']){_0x33e191[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x33e191['where'],{'$or':_['map'](_0x33e191['attributes'],function(_0x21179f){var _0x4c5e4b={};_0x4c5e4b[_0x21179f]={'$like':'%'+_0x1460a3[_0xa738('0x43')][_0xa738('0x32')]+'%'};return _0x4c5e4b;})});}_0x33e191=_[_0xa738('0x4f')]({},_0x33e191,_0x1460a3[_0xa738('0x57')]);return _0x20ae19['getMembers'](_0x33e191);}})[_0xa738('0x2c')](function(_0x2a3831){if(_0x2a3831){_0x19d7d4=_0x2a3831['length'];if(!_0x1460a3[_0xa738('0x43')][_0xa738('0x4a')](_0xa738('0x67'))){_0x33e191[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x1460a3['query'][_0xa738('0x24')]);_0x33e191['offset']=qs[_0xa738('0x25')](_0x1460a3[_0xa738('0x43')][_0xa738('0x25')]);}return _0x20ae19[_0xa738('0x9d')](_0x33e191);}})[_0xa738('0x2c')](function(_0x560d66){return _0x560d66?{'count':_0x19d7d4,'rows':_0x560d66}:null;})[_0xa738('0x2c')](respondWithResult(_0x5bb48f,null))[_0xa738('0x54')](handleError(_0x5bb48f,null));};exports[_0xa738('0x9e')]=function(_0x2cf343,_0x57961a,_0x3befb9){var _0x45b0c2={};var _0x3f978f={};var _0x35e93a;var _0x5bde6b;return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x2cf343[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x57961a,null))[_0xa738('0x2c')](function(_0x5e35c8){if(_0x5e35c8){_0x35e93a=_0x5e35c8;_0x3f978f['model']=_['keys'](db[_0xa738('0x9f')][_0xa738('0x3f')]);_0x3f978f[_0xa738('0x43')]=_[_0xa738('0x44')](_0x2cf343[_0xa738('0x43')]);_0x3f978f[_0xa738('0x45')]=_[_0xa738('0x46')](_0x3f978f[_0xa738('0x42')],_0x3f978f[_0xa738('0x43')]);_0x45b0c2[_0xa738('0x47')]=_['intersection'](_0x3f978f['model'],qs[_0xa738('0x48')](_0x2cf343[_0xa738('0x43')][_0xa738('0x48')]));_0x45b0c2[_0xa738('0x47')]=_0x45b0c2[_0xa738('0x47')][_0xa738('0x49')]?_0x45b0c2[_0xa738('0x47')]:_0x3f978f[_0xa738('0x42')];_0x45b0c2[_0xa738('0x4b')]=qs['sort'](_0x2cf343['query'][_0xa738('0x4c')]);_0x45b0c2[_0xa738('0x4e')]=qs[_0xa738('0x45')](_[_0xa738('0x4d')](_0x2cf343[_0xa738('0x43')],_0x3f978f[_0xa738('0x45')]));if(_0x2cf343[_0xa738('0x43')][_0xa738('0x32')]){_0x45b0c2[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x45b0c2[_0xa738('0x4e')],{'$or':_['map'](_0x45b0c2[_0xa738('0x47')],function(_0x107858){var _0x1fb597={};_0x1fb597[_0x107858]={'$like':'%'+_0x2cf343['query'][_0xa738('0x32')]+'%'};return _0x1fb597;})});}_0x45b0c2=_['merge']({},_0x45b0c2,_0x2cf343[_0xa738('0x57')]);return _0x35e93a[_0xa738('0x9e')](_0x45b0c2);}})[_0xa738('0x2c')](function(_0x208c28){if(_0x208c28){_0x5bde6b=_0x208c28['length'];if(!_0x2cf343[_0xa738('0x43')]['hasOwnProperty']('nolimit')){_0x45b0c2[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x2cf343['query'][_0xa738('0x24')]);_0x45b0c2[_0xa738('0x25')]=qs[_0xa738('0x25')](_0x2cf343[_0xa738('0x43')][_0xa738('0x25')]);}return _0x35e93a[_0xa738('0x9e')](_0x45b0c2);}})['then'](function(_0x371f5a){if(_0x371f5a){return _0x371f5a?{'count':_0x5bde6b,'rows':_0x371f5a}:null;}})[_0xa738('0x2c')](respondWithResult(_0x57961a,null))[_0xa738('0x54')](handleError(_0x57961a,null));};exports[_0xa738('0xa0')]=function(_0x36ce52,_0x4f124c,_0x33e667){var _0x20a285,_0x5b6548;return db['VoiceQueue']['find']({'where':{'id':_0x36ce52[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x4f124c,null))[_0xa738('0x2c')](function(_0x4d12d2){if(_0x4d12d2){_0x5b6548=_0x4d12d2;return _0x4d12d2[_0xa738('0xa0')](_0x36ce52['body'][_0xa738('0x84')],_['omit'](_0x36ce52[_0xa738('0x59')],['ids','id'])||{});}return null;})['spread'](function(_0x287a34){var _0x5a304f;_0x20a285=_0x287a34||[];var _0x3b4302=[];if(_0x287a34){for(var _0x52d4e7=0x0;_0x52d4e7<_0x287a34[_0xa738('0x49')];_0x52d4e7+=0x1){var _0x58f677=_0x287a34[_0x52d4e7][_0xa738('0x2e')]({'plain':!![]});_0x5b6548['dialCheckDuplicateType']=_0x36ce52[_0xa738('0x59')][_0xa738('0xa1')]?_0x36ce52[_0xa738('0x59')][_0xa738('0xa1')]:_0x5b6548['dialCheckDuplicateType'];switch(_0x5b6548[_0xa738('0xa1')]){case _0xa738('0xa2'):_0x5a304f=squel['insert']()[_0xa738('0xa3')]('cm_hopper')[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa6'),_0xa738('0xa7'),_0xa738('0xa8'),_0xa738('0x68'),'createdAt','updatedAt'],squel[_0xa738('0xa9')]()['field'](_0xa738('0xa5'),_0xa738('0xa5'))[_0xa738('0x85')](_0xa738('0xaa'),'scheduledAt')['field']('id',_0xa738('0xa7'))['field'](_0x58f677[_0xa738('0xab')][_0xa738('0x8e')](),'ListId')[_0xa738('0x85')](_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')](),_0xa738('0x68'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x60'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x61'))[_0xa738('0x86')](_0xa738('0xac'))[_0xa738('0x4e')](_0xa738('0xad'))[_0xa738('0x4e')](_0xa738('0xae'),_0x58f677[_0xa738('0xab')][_0xa738('0x8e')]())['where'](_0xa738('0xaf'))[_0xa738('0x4e')](_0xa738('0xb0'),squel[_0xa738('0xa9')]()[_0xa738('0x85')](_0xa738('0xb1'))[_0xa738('0x86')]('cm_hopper_final')[_0xa738('0x4e')]('VoiceQueueId\x20=\x20?',_0x36ce52[_0xa738('0x56')]['id']['toString']()))[_0xa738('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xa738('0xb2'))[_0xa738('0x86')]('cm_hopper')['where'](_0xa738('0x8a'),_0x36ce52[_0xa738('0x56')]['id']['toString']())))[_0xa738('0x8e')]();break;case'onlyIfOpen':_0x5a304f=squel[_0xa738('0xb3')]()[_0xa738('0xa3')](_0xa738('0xb4'))[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa6'),_0xa738('0xa7'),_0xa738('0xa8'),_0xa738('0x68'),_0xa738('0x60'),_0xa738('0x61')],squel[_0xa738('0xa9')]()['field'](_0xa738('0xa5'),_0xa738('0xa5'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0xa6'))[_0xa738('0x85')]('id','ContactId')[_0xa738('0x85')](_0x58f677[_0xa738('0xab')]['toString'](),_0xa738('0xa8'))[_0xa738('0x85')](_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')](),_0xa738('0x68'))['field'](_0xa738('0xaa'),_0xa738('0x60'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x61'))['from'](_0xa738('0xac'))[_0xa738('0x4e')](_0xa738('0xad'))[_0xa738('0x4e')](_0xa738('0xae'),_0x58f677['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xa738('0xb0'),squel[_0xa738('0xa9')]()[_0xa738('0x85')](_0xa738('0xb2'))[_0xa738('0x86')]('cm_hopper')[_0xa738('0x4e')](_0xa738('0x8a'),_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')]())))[_0xa738('0x8e')]();break;default:_0x5a304f=squel[_0xa738('0xb3')]()[_0xa738('0xa3')](_0xa738('0xb4'))[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa6'),'ContactId','ListId','VoiceQueueId',_0xa738('0x60'),_0xa738('0x61')],squel['select']()['field'](_0xa738('0xa5'),_0xa738('0xa5'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0xa6'))['field']('id','ContactId')['field'](_0x58f677[_0xa738('0xab')][_0xa738('0x8e')](),'ListId')['field'](_0x36ce52[_0xa738('0x56')]['id'][_0xa738('0x8e')](),'VoiceQueueId')['field'](_0xa738('0xaa'),_0xa738('0x60'))['field']('NOW()',_0xa738('0x61'))[_0xa738('0x86')](_0xa738('0xac'))[_0xa738('0x4e')](_0xa738('0xad'))[_0xa738('0x4e')]('ListId\x20=\x20?',_0x58f677[_0xa738('0xab')]['toString']())[_0xa738('0x4e')](_0xa738('0xaf')))[_0xa738('0x8e')]();}_0x3b4302[_0xa738('0x8c')](db[_0xa738('0x8d')][_0xa738('0x43')](_0x5a304f));}return BPromise[_0xa738('0x93')](_0x3b4302);}})['then'](function(){return _0x20a285;})[_0xa738('0x2c')](respondWithResult(_0x4f124c,null))[_0xa738('0x54')](handleError(_0x4f124c,null));};exports[_0xa738('0xb5')]=function(_0xf8cc1b,_0x2ccd0f,_0x32795d){return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0xf8cc1b[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x2ccd0f,null))[_0xa738('0x2c')](function(_0x44c113){if(_0x44c113){return _0x44c113[_0xa738('0xb5')](_0xf8cc1b[_0xa738('0x43')][_0xa738('0x84')]);}})['then'](function(_0x1fb95c){if(_0x1fb95c){return db[_0xa738('0x66')][_0xa738('0x2d')]({'where':{'ListId':_0xf8cc1b['query'][_0xa738('0x84')],'VoiceQueueId':_0xf8cc1b[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](function(){return _0x1fb95c;});}})[_0xa738('0x2c')](respondWithStatusCode(_0x2ccd0f,null))[_0xa738('0x54')](handleError(_0x2ccd0f,null));};exports[_0xa738('0xb6')]=function(_0x4422f0,_0x42192d,_0xcc1791){var _0x57dada={};var _0x518b0b={};var _0x3e5065;var _0x1392f8;return db[_0xa738('0x3e')][_0xa738('0x65')]({'where':{'id':_0x4422f0[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x42192d,null))['then'](function(_0x2ba76d){if(_0x2ba76d){_0x3e5065=_0x2ba76d;_0x518b0b[_0xa738('0x42')]=_['keys'](db[_0xa738('0x9f')]['rawAttributes']);_0x518b0b['query']=_['keys'](_0x4422f0[_0xa738('0x43')]);_0x518b0b[_0xa738('0x45')]=_[_0xa738('0x46')](_0x518b0b[_0xa738('0x42')],_0x518b0b[_0xa738('0x43')]);_0x57dada[_0xa738('0x47')]=_['intersection'](_0x518b0b[_0xa738('0x42')],qs[_0xa738('0x48')](_0x4422f0['query'][_0xa738('0x48')]));_0x57dada[_0xa738('0x47')]=_0x57dada['attributes'][_0xa738('0x49')]?_0x57dada[_0xa738('0x47')]:_0x518b0b[_0xa738('0x42')];_0x57dada['order']=qs['sort'](_0x4422f0['query'][_0xa738('0x4c')]);_0x57dada[_0xa738('0x4e')]=qs['filters'](_['pick'](_0x4422f0['query'],_0x518b0b[_0xa738('0x45')]));if(_0x4422f0['query'][_0xa738('0x32')]){_0x57dada[_0xa738('0x4e')]=_[_0xa738('0x4f')](_0x57dada[_0xa738('0x4e')],{'$or':_['map'](_0x57dada['attributes'],function(_0x3ef8cc){var _0x30361d={};_0x30361d[_0x3ef8cc]={'$like':'%'+_0x4422f0['query'][_0xa738('0x32')]+'%'};return _0x30361d;})});}_0x57dada=_[_0xa738('0x4f')]({},_0x57dada,_0x4422f0[_0xa738('0x57')]);return _0x3e5065['getBlackLists'](_0x57dada);}})[_0xa738('0x2c')](function(_0x3ab29f){if(_0x3ab29f){_0x1392f8=_0x3ab29f[_0xa738('0x49')];if(!_0x4422f0[_0xa738('0x43')]['hasOwnProperty'](_0xa738('0x67'))){_0x57dada[_0xa738('0x24')]=qs[_0xa738('0x24')](_0x4422f0[_0xa738('0x43')]['limit']);_0x57dada['offset']=qs['offset'](_0x4422f0[_0xa738('0x43')][_0xa738('0x25')]);}return _0x3e5065[_0xa738('0xb6')](_0x57dada);}})[_0xa738('0x2c')](function(_0x10b72c){if(_0x10b72c){return _0x10b72c?{'count':_0x1392f8,'rows':_0x10b72c}:null;}})['then'](respondWithResult(_0x42192d,null))[_0xa738('0x54')](handleError(_0x42192d,null));};exports['addBlackLists']=function(_0x2b6988,_0xc3edda,_0x36269d){var _0x5b5f09,_0x1adc1c;return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x2b6988['params']['id']}})['then'](handleEntityNotFound(_0xc3edda,null))['then'](function(_0x583595){if(_0x583595){_0x1adc1c=_0x583595;return _0x583595[_0xa738('0xb7')](_0x2b6988[_0xa738('0x59')][_0xa738('0x84')],_[_0xa738('0x5f')](_0x2b6988[_0xa738('0x59')],[_0xa738('0x84'),'id'])||{});}return null;})[_0xa738('0x9a')](function(_0x5bc63b){var _0x47fb27;_0x5b5f09=_0x5bc63b||[];var _0x2c94d9=[];if(_0x5bc63b){for(var _0x191fc3=0x0;_0x191fc3<_0x5bc63b[_0xa738('0x49')];_0x191fc3+=0x1){var _0x55c087=_0x5bc63b[_0x191fc3][_0xa738('0x2e')]({'plain':!![]});_0x47fb27=squel[_0xa738('0xb3')]()[_0xa738('0xa3')](_0xa738('0xb8'))[_0xa738('0xa4')]([_0xa738('0xa5'),_0xa738('0xa7'),_0xa738('0xa8'),_0xa738('0x68'),_0xa738('0x60'),_0xa738('0x61')],squel[_0xa738('0xa9')]()[_0xa738('0x85')]('phone',_0xa738('0xa5'))[_0xa738('0x85')]('id','ContactId')[_0xa738('0x85')](_0x55c087[_0xa738('0xab')]['toString'](),_0xa738('0xa8'))[_0xa738('0x85')](_0x2b6988[_0xa738('0x56')]['id'][_0xa738('0x8e')](),_0xa738('0x68'))[_0xa738('0x85')](_0xa738('0xaa'),_0xa738('0x60'))[_0xa738('0x85')](_0xa738('0xaa'),'updatedAt')[_0xa738('0x86')](_0xa738('0xac'))[_0xa738('0x4e')]('deletedAt\x20IS\x20NULL')[_0xa738('0x4e')](_0xa738('0xae'),_0x55c087['CmListId'][_0xa738('0x8e')]())['where'](_0xa738('0xaf')))['toString']();_0x2c94d9[_0xa738('0x8c')](db[_0xa738('0x8d')][_0xa738('0x43')](_0x47fb27));}return BPromise['all'](_0x2c94d9);}})[_0xa738('0x2c')](function(){return _0x5b5f09;})[_0xa738('0x2c')](respondWithResult(_0xc3edda,null))[_0xa738('0x54')](handleError(_0xc3edda,null));};exports['removeBlackLists']=function(_0x4def13,_0x581754,_0x294a3e){return db[_0xa738('0x3e')][_0xa738('0x37')]({'where':{'id':_0x4def13[_0xa738('0x56')]['id']}})[_0xa738('0x2c')](handleEntityNotFound(_0x581754,null))[_0xa738('0x2c')](function(_0x1b3abb){if(_0x1b3abb){return _0x1b3abb['removeBlackLists'](_0x4def13[_0xa738('0x43')][_0xa738('0x84')]);}})[_0xa738('0x2c')](function(_0x315951){if(_0x315951){return db['CmHopperBlack'][_0xa738('0x2d')]({'where':{'ListId':_0x4def13['query'][_0xa738('0x84')],'VoiceQueueId':_0x4def13[_0xa738('0x56')]['id']}})['then'](function(){return _0x315951;});}})[_0xa738('0x2c')](respondWithStatusCode(_0x581754,null))[_0xa738('0x54')](handleError(_0x581754,null));};
\ No newline at end of file
index 9e0b157..8efdf8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f83=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x92d580,_0x4928fb){var _0x4ee344=function(_0x55aa0c){while(--_0x55aa0c){_0x92d580['push'](_0x92d580['shift']());}};_0x4ee344(++_0x4928fb);}(_0x9f83,0x19c));var _0x39f8=function(_0x1c2ff8,_0x20cb72){_0x1c2ff8=_0x1c2ff8-0x0;var _0x54dc0a=_0x9f83[_0x1c2ff8];return _0x54dc0a;};'use strict';var EventEmitter=require(_0x39f8('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x39f8('0x1')](0x0);var events={'afterCreate':_0x39f8('0x2'),'afterUpdate':_0x39f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5abf09){return function(_0x93f54a,_0x447f99,_0x1d9359){VoiceQueueEvents[_0x39f8('0x4')](_0x5abf09+':'+_0x93f54a['id'],_0x93f54a);VoiceQueueEvents['emit'](_0x5abf09,_0x93f54a);_0x1d9359(null);};}for(var e in events){if(events[_0x39f8('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x39f8('0x6')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x5df4=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x517b68,_0x7ed57){var _0x5c57a3=function(_0x26a2a6){while(--_0x26a2a6){_0x517b68['push'](_0x517b68['shift']());}};_0x5c57a3(++_0x7ed57);}(_0x5df4,0x197));var _0x45df=function(_0x5adad4,_0x18fce0){_0x5adad4=_0x5adad4-0x0;var _0x47e6be=_0x5df4[_0x5adad4];return _0x47e6be;};'use strict';var EventEmitter=require(_0x45df('0x0'));var VoiceQueue=require(_0x45df('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x45df('0x2'),'afterUpdate':_0x45df('0x3'),'afterDestroy':_0x45df('0x4')};function emitEvent(_0x393efd){return function(_0x3943e8,_0x5698a1,_0x23365c){VoiceQueueEvents[_0x45df('0x5')](_0x393efd+':'+_0x3943e8['id'],_0x3943e8);VoiceQueueEvents[_0x45df('0x5')](_0x393efd,_0x3943e8);_0x23365c(null);};}for(var e in events){if(events[_0x45df('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x45df('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 677a32a..28f7738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3c08ea,_0x419b25){var _0x4b6e51=function(_0x4e53b3){while(--_0x4e53b3){_0x3c08ea['push'](_0x3c08ea['shift']());}};_0x4b6e51(++_0x419b25);}(_0x008c,0x188));var _0xc008=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0x008c[_0x130705];return _0x1fa991;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x50e5a3,_0x27bd2d){var _0x37e6b3=function(_0x1a67ab){while(--_0x1a67ab){_0x50e5a3['push'](_0x50e5a3['shift']());}};_0x37e6b3(++_0x27bd2d);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 22696aa..d66a5f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfce=['localhost','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','ShowVoiceQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults'];(function(_0xbc1231,_0x5b9bb7){var _0x1dbf20=function(_0x173863){while(--_0x173863){_0xbc1231['push'](_0xbc1231['shift']());}};_0x1dbf20(++_0x5b9bb7);}(_0xcfce,0xe5));var _0xecfc=function(_0x224ded,_0x1b2757){_0x224ded=_0x224ded-0x0;var _0x3f2c61=_0xcfce[_0x224ded];return _0x3f2c61;};'use strict';var _=require(_0xecfc('0x0'));var util=require(_0xecfc('0x1'));var moment=require('moment');var BPromise=require(_0xecfc('0x2'));var rs=require(_0xecfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecfc('0x4'))['db'];var utils=require(_0xecfc('0x5'));var logger=require(_0xecfc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xecfc('0x7'));var client=jayson['client'][_0xecfc('0x8')]({'port':0x232a});config[_0xecfc('0x9')]=_[_0xecfc('0xa')](config[_0xecfc('0x9')],{'host':_0xecfc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecfc('0x9')]));require(_0xecfc('0xc'))[_0xecfc('0xd')](socket);function respondWithRpcPromise(_0x3c7f1b,_0x476d9c,_0xd2729b){return new BPromise(function(_0x4da4c9,_0x21a805){return client[_0xecfc('0xe')](_0x3c7f1b,_0xd2729b)['then'](function(_0x1568ad){logger[_0xecfc('0xf')](_0xecfc('0x10'),_0x476d9c,_0xecfc('0x11'));logger['debug'](_0xecfc('0x12'),_0x476d9c,'request\x20sent',JSON[_0xecfc('0x13')](_0x1568ad));if(_0x1568ad[_0xecfc('0x14')]){if(_0x1568ad[_0xecfc('0x14')][_0xecfc('0x15')]===0x1f4){logger[_0xecfc('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x476d9c,_0x1568ad[_0xecfc('0x14')][_0xecfc('0x16')]);return _0x21a805(_0x1568ad[_0xecfc('0x14')][_0xecfc('0x16')]);}logger['error'](_0xecfc('0x10'),_0x476d9c,_0x1568ad[_0xecfc('0x14')][_0xecfc('0x16')]);return _0x4da4c9(_0x1568ad[_0xecfc('0x14')]['message']);}else{logger['info'](_0xecfc('0x10'),_0x476d9c,_0xecfc('0x11'));_0x4da4c9(_0x1568ad[_0xecfc('0x17')][_0xecfc('0x16')]);}})[_0xecfc('0x18')](function(_0x28dc6d){logger[_0xecfc('0x14')](_0xecfc('0x10'),_0x476d9c,_0x28dc6d);_0x21a805(_0x28dc6d);});});}exports[_0xecfc('0x19')]=function(_0xab93ab){var _0x67c5e8=this;return new Promise(function(_0x329488,_0x53d238){return db[_0xecfc('0x1a')][_0xecfc('0x1b')]({'raw':_0xab93ab[_0xecfc('0x1c')]?_0xab93ab[_0xecfc('0x1c')][_0xecfc('0x1d')]===undefined?!![]:![]:!![],'where':_0xab93ab['options']?_0xab93ab[_0xecfc('0x1c')][_0xecfc('0x1e')]||null:null,'attributes':_0xab93ab[_0xecfc('0x1c')]?_0xab93ab[_0xecfc('0x1c')][_0xecfc('0x1f')]||null:null,'limit':_0xab93ab[_0xecfc('0x1c')]?_0xab93ab['options'][_0xecfc('0x20')]||null:null,'include':_0xab93ab['options']?_0xab93ab[_0xecfc('0x1c')]['include']?_['map'](_0xab93ab[_0xecfc('0x1c')][_0xecfc('0x21')],function(_0x743951){return{'model':db[_0x743951[_0xecfc('0x22')]],'as':_0x743951['as'],'attributes':_0x743951['attributes'],'include':_0x743951[_0xecfc('0x21')]?_[_0xecfc('0x23')](_0x743951['include'],function(_0x63e659){return{'model':db[_0x63e659[_0xecfc('0x22')]],'as':_0x63e659['as'],'attributes':_0x63e659['attributes'],'include':_0x63e659[_0xecfc('0x21')]?_[_0xecfc('0x23')](_0x63e659[_0xecfc('0x21')],function(_0x572d86){return{'model':db[_0x572d86[_0xecfc('0x22')]],'as':_0x572d86['as'],'attributes':_0x572d86[_0xecfc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xecfc('0x24')](function(_0x1b95a7){logger['info'](_0xecfc('0x19'),_0xab93ab);logger[_0xecfc('0x25')](_0xecfc('0x19'),_0xab93ab,JSON['stringify'](_0x1b95a7));_0x329488(_0x1b95a7);})[_0xecfc('0x18')](function(_0x1a4d9b){logger[_0xecfc('0x14')](_0xecfc('0x19'),_0x1a4d9b[_0xecfc('0x16')],_0xab93ab);_0x53d238(_0x67c5e8[_0xecfc('0x14')](0x1f4,_0x1a4d9b[_0xecfc('0x16')]));});});};exports[_0xecfc('0x26')]=function(_0x4fbe29){var _0x2a6a08=this;return new Promise(function(_0x50c8ba,_0x55010e){return db[_0xecfc('0x1a')][_0xecfc('0x27')]({'raw':_0x4fbe29[_0xecfc('0x1c')]?_0x4fbe29[_0xecfc('0x1c')][_0xecfc('0x1d')]===undefined?!![]:![]:!![],'where':_0x4fbe29[_0xecfc('0x1c')]?_0x4fbe29[_0xecfc('0x1c')][_0xecfc('0x1e')]||null:null,'attributes':_0x4fbe29[_0xecfc('0x1c')]?_0x4fbe29['options']['attributes']||null:null,'include':_0x4fbe29[_0xecfc('0x1c')]?_0x4fbe29[_0xecfc('0x1c')][_0xecfc('0x21')]?_[_0xecfc('0x23')](_0x4fbe29[_0xecfc('0x1c')][_0xecfc('0x21')],function(_0x585b30){return{'model':db[_0x585b30[_0xecfc('0x22')]],'as':_0x585b30['as'],'attributes':_0x585b30[_0xecfc('0x1f')],'include':_0x585b30[_0xecfc('0x21')]?_[_0xecfc('0x23')](_0x585b30[_0xecfc('0x21')],function(_0x2d2d4a){return{'model':db[_0x2d2d4a['model']],'as':_0x2d2d4a['as'],'attributes':_0x2d2d4a[_0xecfc('0x1f')],'include':_0x2d2d4a[_0xecfc('0x21')]?_[_0xecfc('0x23')](_0x2d2d4a['include'],function(_0x432b97){return{'model':db[_0x432b97[_0xecfc('0x22')]],'as':_0x432b97['as'],'attributes':_0x432b97[_0xecfc('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xecfc('0x24')](function(_0x2b8876){logger['info'](_0xecfc('0x26'),_0x4fbe29);logger[_0xecfc('0x25')](_0xecfc('0x26'),_0x4fbe29,JSON[_0xecfc('0x13')](_0x2b8876));_0x50c8ba(_0x2b8876);})[_0xecfc('0x18')](function(_0x1ad4be){logger[_0xecfc('0x14')](_0xecfc('0x26'),_0x1ad4be[_0xecfc('0x16')],_0x4fbe29);_0x55010e(_0x2a6a08[_0xecfc('0x14')](0x1f4,_0x1ad4be[_0xecfc('0x16')]));});});};
\ No newline at end of file
+var _0x57de=['../../config/logger','jayson/promise','client','redis','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceQueue','options','raw','attributes','include','map','model','GetVoiceQueue','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x26bc36,_0x95e54){var _0x173490=function(_0xc1dacb){while(--_0xc1dacb){_0x26bc36['push'](_0x26bc36['shift']());}};_0x173490(++_0x95e54);}(_0x57de,0x19d));var _0xe57d=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x57de[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0xe57d('0x0'));var util=require(_0xe57d('0x1'));var moment=require(_0xe57d('0x2'));var BPromise=require(_0xe57d('0x3'));var rs=require(_0xe57d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe57d('0x5'))['db'];var utils=require(_0xe57d('0x6'));var logger=require(_0xe57d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe57d('0x8'));var client=jayson[_0xe57d('0x9')]['http']({'port':0x232a});config[_0xe57d('0xa')]=_['defaults'](config[_0xe57d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe57d('0xb'))(new Redis(config[_0xe57d('0xa')]));require(_0xe57d('0xc'))['register'](socket);function respondWithRpcPromise(_0x38e58e,_0x14695b,_0x2d8199){return new BPromise(function(_0x5f063d,_0xd79e77){return client[_0xe57d('0xd')](_0x38e58e,_0x2d8199)[_0xe57d('0xe')](function(_0x5c55bb){logger[_0xe57d('0xf')](_0xe57d('0x10'),_0x14695b,_0xe57d('0x11'));logger[_0xe57d('0x12')](_0xe57d('0x13'),_0x14695b,_0xe57d('0x11'),JSON['stringify'](_0x5c55bb));if(_0x5c55bb['error']){if(_0x5c55bb['error'][_0xe57d('0x14')]===0x1f4){logger[_0xe57d('0x15')](_0xe57d('0x10'),_0x14695b,_0x5c55bb[_0xe57d('0x15')][_0xe57d('0x16')]);return _0xd79e77(_0x5c55bb[_0xe57d('0x15')][_0xe57d('0x16')]);}logger[_0xe57d('0x15')](_0xe57d('0x10'),_0x14695b,_0x5c55bb[_0xe57d('0x15')][_0xe57d('0x16')]);return _0x5f063d(_0x5c55bb['error']['message']);}else{logger['info'](_0xe57d('0x10'),_0x14695b,_0xe57d('0x11'));_0x5f063d(_0x5c55bb[_0xe57d('0x17')]['message']);}})[_0xe57d('0x18')](function(_0x4f1731){logger[_0xe57d('0x15')](_0xe57d('0x10'),_0x14695b,_0x4f1731);_0xd79e77(_0x4f1731);});});}exports['GetVoiceQueue']=function(_0x5c4b55){var _0x33811b=this;return new Promise(function(_0x27dab6,_0x4686ef){return db[_0xe57d('0x19')]['findAll']({'raw':_0x5c4b55[_0xe57d('0x1a')]?_0x5c4b55[_0xe57d('0x1a')][_0xe57d('0x1b')]===undefined?!![]:![]:!![],'where':_0x5c4b55[_0xe57d('0x1a')]?_0x5c4b55[_0xe57d('0x1a')]['where']||null:null,'attributes':_0x5c4b55[_0xe57d('0x1a')]?_0x5c4b55['options'][_0xe57d('0x1c')]||null:null,'limit':_0x5c4b55['options']?_0x5c4b55[_0xe57d('0x1a')]['limit']||null:null,'include':_0x5c4b55['options']?_0x5c4b55[_0xe57d('0x1a')][_0xe57d('0x1d')]?_[_0xe57d('0x1e')](_0x5c4b55[_0xe57d('0x1a')][_0xe57d('0x1d')],function(_0x52a3e8){return{'model':db[_0x52a3e8[_0xe57d('0x1f')]],'as':_0x52a3e8['as'],'attributes':_0x52a3e8['attributes'],'include':_0x52a3e8['include']?_[_0xe57d('0x1e')](_0x52a3e8['include'],function(_0x17bc12){return{'model':db[_0x17bc12[_0xe57d('0x1f')]],'as':_0x17bc12['as'],'attributes':_0x17bc12[_0xe57d('0x1c')],'include':_0x17bc12[_0xe57d('0x1d')]?_[_0xe57d('0x1e')](_0x17bc12[_0xe57d('0x1d')],function(_0x2cb1a4){return{'model':db[_0x2cb1a4[_0xe57d('0x1f')]],'as':_0x2cb1a4['as'],'attributes':_0x2cb1a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xe57d('0xe')](function(_0x3c3241){logger[_0xe57d('0xf')](_0xe57d('0x20'),_0x5c4b55);logger['debug'](_0xe57d('0x20'),_0x5c4b55,JSON['stringify'](_0x3c3241));_0x27dab6(_0x3c3241);})['catch'](function(_0x1f01eb){logger['error'](_0xe57d('0x20'),_0x1f01eb[_0xe57d('0x16')],_0x5c4b55);_0x4686ef(_0x33811b[_0xe57d('0x15')](0x1f4,_0x1f01eb[_0xe57d('0x16')]));});});};exports[_0xe57d('0x21')]=function(_0x4401d9){var _0x443d82=this;return new Promise(function(_0x47a6f3,_0x1e5e5b){return db[_0xe57d('0x19')][_0xe57d('0x22')]({'raw':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9[_0xe57d('0x1a')][_0xe57d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9['options']['where']||null:null,'attributes':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9[_0xe57d('0x1a')]['attributes']||null:null,'include':_0x4401d9[_0xe57d('0x1a')]?_0x4401d9['options'][_0xe57d('0x1d')]?_[_0xe57d('0x1e')](_0x4401d9['options'][_0xe57d('0x1d')],function(_0xdc6a47){return{'model':db[_0xdc6a47[_0xe57d('0x1f')]],'as':_0xdc6a47['as'],'attributes':_0xdc6a47[_0xe57d('0x1c')],'include':_0xdc6a47['include']?_[_0xe57d('0x1e')](_0xdc6a47[_0xe57d('0x1d')],function(_0x9a546d){return{'model':db[_0x9a546d[_0xe57d('0x1f')]],'as':_0x9a546d['as'],'attributes':_0x9a546d[_0xe57d('0x1c')],'include':_0x9a546d['include']?_[_0xe57d('0x1e')](_0x9a546d['include'],function(_0x27f6ae){return{'model':db[_0x27f6ae[_0xe57d('0x1f')]],'as':_0x27f6ae['as'],'attributes':_0x27f6ae[_0xe57d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b1fbb){logger[_0xe57d('0xf')]('ShowVoiceQueue',_0x4401d9);logger['debug'](_0xe57d('0x21'),_0x4401d9,JSON['stringify'](_0x3b1fbb));_0x47a6f3(_0x3b1fbb);})[_0xe57d('0x18')](function(_0x27df1b){logger[_0xe57d('0x15')](_0xe57d('0x21'),_0x27df1b[_0xe57d('0x16')],_0x4401d9);_0x1e5e5b(_0x443d82[_0xe57d('0x15')](0x1f4,_0x27df1b[_0xe57d('0x16')]));});});};
\ No newline at end of file
index b820a05..baf5913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8321=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','register','length'];(function(_0xe70309,_0x4cbd72){var _0x481cdf=function(_0xf9022){while(--_0xf9022){_0xe70309['push'](_0xe70309['shift']());}};_0x481cdf(++_0x4cbd72);}(_0x8321,0x81));var _0x1832=function(_0x404026,_0x3930a7){_0x404026=_0x404026-0x0;var _0x1cc5ae=_0x8321[_0x404026];return _0x1cc5ae;};'use strict';var VoiceQueueEvents=require(_0x1832('0x0'));var events=[_0x1832('0x1'),_0x1832('0x2'),_0x1832('0x3')];function createListener(_0x145037,_0x585d78){return function(_0x1c18aa){_0x585d78[_0x1832('0x4')](_0x145037,_0x1c18aa);};}function removeListener(_0x3d3f6f,_0x533a99){return function(){VoiceQueueEvents['removeListener'](_0x3d3f6f,_0x533a99);};}exports[_0x1832('0x5')]=function(_0xfb5e91){for(var _0x43cb4a=0x0,_0x3ca253=events[_0x1832('0x6')];_0x43cb4a<_0x3ca253;_0x43cb4a++){var _0x3dbf1d=events[_0x43cb4a];var _0x9d991=createListener(_0x1832('0x7')+_0x3dbf1d,_0xfb5e91);VoiceQueueEvents['on'](_0x3dbf1d,_0x9d991);}};
\ No newline at end of file
+var _0x2f79=['./voiceQueue.events','save','remove','update','removeListener','register'];(function(_0x371cbb,_0x3ffcba){var _0x5ea45d=function(_0x370c53){while(--_0x370c53){_0x371cbb['push'](_0x371cbb['shift']());}};_0x5ea45d(++_0x3ffcba);}(_0x2f79,0x186));var _0x92f7=function(_0x187b01,_0x5d27a6){_0x187b01=_0x187b01-0x0;var _0x3f0877=_0x2f79[_0x187b01];return _0x3f0877;};'use strict';var VoiceQueueEvents=require(_0x92f7('0x0'));var events=[_0x92f7('0x1'),_0x92f7('0x2'),_0x92f7('0x3')];function createListener(_0x7ca03e,_0x5ba378){return function(_0x520903){_0x5ba378['emit'](_0x7ca03e,_0x520903);};}function removeListener(_0x403152,_0xc1842f){return function(){VoiceQueueEvents[_0x92f7('0x4')](_0x403152,_0xc1842f);};}exports[_0x92f7('0x5')]=function(_0x191ae3){for(var _0x58385f=0x0,_0x2563ed=events['length'];_0x58385f<_0x2563ed;_0x58385f++){var _0x55ffc6=events[_0x58385f];var _0x3d35a2=createListener('voiceQueue:'+_0x55ffc6,_0x191ae3);VoiceQueueEvents['on'](_0x55ffc6,_0x3d35a2);}};
\ No newline at end of file
index d2a283e..c365e6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cd5=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cd5,0x164));var _0x58cd=function(_0xa3175c,_0x1ffb03){_0xa3175c=_0xa3175c-0x0;var _0xd288c3=_0x8cd5[_0xa3175c];return _0xd288c3;};'use strict';var multer=require(_0x58cd('0x0'));var util=require(_0x58cd('0x1'));var path=require(_0x58cd('0x2'));var timeout=require(_0x58cd('0x3'));var express=require(_0x58cd('0x4'));var router=express[_0x58cd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x58cd('0x6'));var interaction=require(_0x58cd('0x7'));var config=require('../../config/environment');var controller=require(_0x58cd('0x8'));router[_0x58cd('0x9')]('/',auth[_0x58cd('0xa')](),controller[_0x58cd('0xb')]);router[_0x58cd('0x9')](_0x58cd('0xc'),auth[_0x58cd('0xa')](),controller[_0x58cd('0xd')]);router[_0x58cd('0x9')](_0x58cd('0xe'),auth['isAuthenticated'](),controller[_0x58cd('0xf')]);router[_0x58cd('0x9')](_0x58cd('0x10'),auth[_0x58cd('0xa')](),controller[_0x58cd('0x11')]);router['post']('/',auth[_0x58cd('0xa')](),controller[_0x58cd('0x12')]);router[_0x58cd('0x13')](_0x58cd('0x10'),auth[_0x58cd('0xa')](),controller[_0x58cd('0x14')]);router[_0x58cd('0x15')](_0x58cd('0x10'),auth['isAuthenticated'](),controller[_0x58cd('0x16')]);module[_0x58cd('0x17')]=router;
\ No newline at end of file
+var _0xe600=['isAuthenticated','index','/describe','getVoiceQueuesReport','post','create','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xe600,0x160));var _0x0e60=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe600[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0e60('0x0'));var path=require(_0x0e60('0x1'));var timeout=require(_0x0e60('0x2'));var express=require(_0x0e60('0x3'));var router=express[_0x0e60('0x4')]();var fs_extra=require(_0x0e60('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e60('0x6'));var controller=require(_0x0e60('0x7'));router[_0x0e60('0x8')]('/',auth[_0x0e60('0x9')](),controller[_0x0e60('0xa')]);router[_0x0e60('0x8')](_0x0e60('0xb'),auth[_0x0e60('0x9')](),controller['describe']);router[_0x0e60('0x8')]('/index',auth['isAuthenticated'](),controller[_0x0e60('0xc')]);router[_0x0e60('0x8')]('/:id',auth[_0x0e60('0x9')](),controller['show']);router[_0x0e60('0xd')]('/',auth[_0x0e60('0x9')](),controller[_0x0e60('0xe')]);router['put']('/:id',auth[_0x0e60('0x9')](),controller[_0x0e60('0xf')]);router[_0x0e60('0x10')](_0x0e60('0x11'),auth[_0x0e60('0x9')](),controller[_0x0e60('0x12')]);module['exports']=router;
\ No newline at end of file
index 0b3030f..bc03b5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074f=['queuecallerjoinAt','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue'];(function(_0xa1c78e,_0x54bb32){var _0x5a02f0=function(_0x17888e){while(--_0x17888e){_0xa1c78e['push'](_0xa1c78e['shift']());}};_0x5a02f0(++_0x54bb32);}(_0x074f,0xdb));var _0xf074=function(_0x1ba138,_0x58dfb3){_0x1ba138=_0x1ba138-0x0;var _0x132e1b=_0x074f[_0x1ba138];return _0x132e1b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf074('0x0'));module[_0xf074('0x1')]={'type':{'type':Sequelize[_0xf074('0x2')]},'uniqueid':{'type':Sequelize[_0xf074('0x2')]},'calleridnum':{'type':Sequelize[_0xf074('0x2')]},'calleridname':{'type':Sequelize[_0xf074('0x2')]},'queue':{'type':Sequelize[_0xf074('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xf074('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xf074('0x3')],'set':function(_0x31d7d8){var _0x11643b=moment(_0x31d7d8);var _0x2dafa2=moment(this[_0xf074('0x4')](_0xf074('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xda3e34=_0x11643b[_0xf074('0x6')](_0x2dafa2,_0xf074('0x7'));this[_0xf074('0x8')]('queuecallerleaveAt',_0x31d7d8);this['setDataValue'](_0xf074('0x9'),_0xda3e34||null);}},'position':{'type':Sequelize[_0xf074('0xa')]},'count':{'type':Sequelize[_0xf074('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xf074('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xf074('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xf074('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf074('0x3')]},'queuecallerexit':{'type':Sequelize[_0xf074('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf074('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xf074('0x2')],'comment':_0xf074('0xc')},'originalposition':{'type':Sequelize[_0xf074('0xa')]},'channel':{'type':Sequelize[_0xf074('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf074('0x2')]},'connectedlinename':{'type':Sequelize[_0xf074('0x2')]},'accountcode':{'type':Sequelize[_0xf074('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf074('0x2')]},'priority':{'type':Sequelize[_0xf074('0x2')]},'holdtime':{'type':Sequelize[_0xf074('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf074('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf074('0x2')]},'transfer':{'type':Sequelize[_0xf074('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf074('0x2')],'comment':_0xf074('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf074('0x2')]},'disposition':{'type':Sequelize[_0xf074('0x2')]},'secondDisposition':{'type':Sequelize[_0xf074('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf074('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xf074('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x34b8=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','BOOLEAN','DATE'];(function(_0x15b5cc,_0xf678db){var _0x5893c1=function(_0x1e3336){while(--_0x1e3336){_0x15b5cc['push'](_0x15b5cc['shift']());}};_0x5893c1(++_0xf678db);}(_0x34b8,0x179));var _0x834b=function(_0x4d2910,_0xbd72f){_0x4d2910=_0x4d2910-0x0;var _0x2f1e0c=_0x34b8[_0x4d2910];return _0x2f1e0c;};'use strict';var Sequelize=require(_0x834b('0x0'));var moment=require(_0x834b('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x834b('0x2')]},'calleridnum':{'type':Sequelize[_0x834b('0x2')]},'calleridname':{'type':Sequelize[_0x834b('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x57c405){var _0x165cd5=moment(_0x57c405);var _0x4d41c6=moment(this[_0x834b('0x3')](_0x834b('0x4')))[_0x834b('0x5')](_0x834b('0x6'));var _0x39c3d3=_0x165cd5[_0x834b('0x7')](_0x4d41c6,_0x834b('0x8'));this['setDataValue'](_0x834b('0x9'),_0x57c405);this[_0x834b('0xa')](_0x834b('0xb'),_0x39c3d3||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x834b('0xd')]},'queuecallercomplete':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x834b('0xd')]},'queuecallerexitreason':{'type':Sequelize[_0x834b('0x2')],'comment':_0x834b('0xe')},'originalposition':{'type':Sequelize[_0x834b('0xf')]},'channel':{'type':Sequelize[_0x834b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x834b('0x2')]},'accountcode':{'type':Sequelize[_0x834b('0x2')]},'context':{'type':Sequelize[_0x834b('0x2')]},'exten':{'type':Sequelize[_0x834b('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x834b('0xf')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x834b('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x834b('0x2')],'comment':_0x834b('0x10')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x834b('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x834b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x834b('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x834b('0xf')],'defaultValue':0x0}};
\ No newline at end of file
index 8f4a384..c8247fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf84=['VIRTUAL','options','includeAll','rows','show','params','rawAttributes','include','catch','create','body','find','describe','findAll','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','apply','update','then','destroy','error','stack','name','index','map','VoiceQueueReport','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0xcf84,0x17c));var _0x4cf8=function(_0x21bf0d,_0x91bf98){_0x21bf0d=_0x21bf0d-0x0;var _0x561491=_0xcf84[_0x21bf0d];return _0x561491;};'use strict';var emlformat=require(_0x4cf8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4cf8('0x1'));var jsonpatch=require(_0x4cf8('0x2'));var rp=require(_0x4cf8('0x3'));var moment=require(_0x4cf8('0x4'));var BPromise=require(_0x4cf8('0x5'));var Mustache=require(_0x4cf8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4cf8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cf8('0x8'));var squel=require(_0x4cf8('0x9'));var crypto=require('crypto');var jsforce=require(_0x4cf8('0xa'));var deskjs=require(_0x4cf8('0xb'));var toCsv=require(_0x4cf8('0xc'));var querystring=require(_0x4cf8('0xd'));var Papa=require(_0x4cf8('0xe'));var Redis=require('ioredis');var authService=require(_0x4cf8('0xf'));var qs=require(_0x4cf8('0x10'));var as=require(_0x4cf8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cf8('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4cf8('0x13'));var db=require(_0x4cf8('0x14'))['db'];config['redis']=_['defaults'](config[_0x4cf8('0x15')],{'host':_0x4cf8('0x16'),'port':0x18eb});var socket=require(_0x4cf8('0x17'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x374f12,_0x3135d2){_0x3135d2=_0x3135d2||0xcc;return function(_0x4ab6e2){if(_0x4ab6e2){return _0x374f12[_0x4cf8('0x18')](_0x3135d2);}return _0x374f12[_0x4cf8('0x19')](_0x3135d2)[_0x4cf8('0x1a')]();};}function respondWithResult(_0x31e004,_0x13c290){_0x13c290=_0x13c290||0xc8;return function(_0x5a9adc){if(_0x5a9adc){return _0x31e004[_0x4cf8('0x19')](_0x13c290)[_0x4cf8('0x1b')](_0x5a9adc);}};}function respondWithFilteredResult(_0x2633a8,_0x23ce80){return function(_0x398cb9){if(_0x398cb9){var _0x5a59ca=typeof _0x23ce80['offset']===_0x4cf8('0x1c')&&typeof _0x23ce80[_0x4cf8('0x1d')]==='undefined';var _0x4de423=_0x398cb9[_0x4cf8('0x1e')];var _0x5af3bb=_0x5a59ca?0x0:_0x23ce80['offset'];var _0x56f4f5=_0x5a59ca?_0x398cb9[_0x4cf8('0x1e')]:_0x23ce80[_0x4cf8('0x1f')]+_0x23ce80[_0x4cf8('0x1d')];var _0x26efec;if(_0x56f4f5>=_0x4de423){_0x56f4f5=_0x4de423;_0x26efec=0xc8;}else{_0x26efec=0xce;}_0x2633a8[_0x4cf8('0x19')](_0x26efec);return _0x2633a8['set']('Content-Range',_0x5af3bb+'-'+_0x56f4f5+'/'+_0x4de423)[_0x4cf8('0x1b')](_0x398cb9);}return null;};}function patchUpdates(_0x294f26){return function(_0x1dd4c0){try{jsonpatch[_0x4cf8('0x20')](_0x1dd4c0,_0x294f26,!![]);}catch(_0x52055f){return BPromise['reject'](_0x52055f);}return _0x1dd4c0['save']();};}function saveUpdates(_0x4610b0,_0x1b061f){return function(_0x33b81b){if(_0x33b81b){return _0x33b81b[_0x4cf8('0x21')](_0x4610b0)[_0x4cf8('0x22')](function(_0x3100ff){return _0x3100ff;});}return null;};}function removeEntity(_0xfcee53,_0x3a9ae2){return function(_0x56cac5){if(_0x56cac5){return _0x56cac5[_0x4cf8('0x23')]()[_0x4cf8('0x22')](function(){_0xfcee53[_0x4cf8('0x19')](0xcc)[_0x4cf8('0x1a')]();});}};}function handleEntityNotFound(_0x19a5cc,_0x276a9c){return function(_0x52c5ba){if(!_0x52c5ba){_0x19a5cc[_0x4cf8('0x18')](0x194);}return _0x52c5ba;};}function handleError(_0x12f4c1,_0x56a8b0){_0x56a8b0=_0x56a8b0||0x1f4;return function(_0x25f41c){logger[_0x4cf8('0x24')](_0x25f41c[_0x4cf8('0x25')]);if(_0x25f41c[_0x4cf8('0x26')]){delete _0x25f41c[_0x4cf8('0x26')];}_0x12f4c1[_0x4cf8('0x19')](_0x56a8b0)['send'](_0x25f41c);};}exports[_0x4cf8('0x27')]=function(_0x3a9205,_0x5dac3e){var _0x14a150={},_0x2be587={},_0x574816={'count':0x0,'rows':[]};var _0x4447ba=_[_0x4cf8('0x28')](db[_0x4cf8('0x29')]['rawAttributes'],function(_0x2d01f0){return{'name':_0x2d01f0['fieldName'],'type':_0x2d01f0[_0x4cf8('0x2a')]['key']};});_0x2be587['model']=_['map'](_0x4447ba,_0x4cf8('0x26'));_0x2be587[_0x4cf8('0x2b')]=_[_0x4cf8('0x2c')](_0x3a9205['query']);_0x2be587['filters']=_[_0x4cf8('0x2d')](_0x2be587['model'],_0x2be587[_0x4cf8('0x2b')]);_0x14a150['attributes']=_[_0x4cf8('0x2d')](_0x2be587[_0x4cf8('0x2e')],qs['fields'](_0x3a9205[_0x4cf8('0x2b')][_0x4cf8('0x2f')]));_0x14a150['attributes']=_0x14a150[_0x4cf8('0x30')][_0x4cf8('0x31')]?_0x14a150[_0x4cf8('0x30')]:_0x2be587['model'];if(!_0x3a9205[_0x4cf8('0x2b')][_0x4cf8('0x32')](_0x4cf8('0x33'))){_0x14a150[_0x4cf8('0x1d')]=qs['limit'](_0x3a9205['query'][_0x4cf8('0x1d')]);_0x14a150[_0x4cf8('0x1f')]=qs[_0x4cf8('0x1f')](_0x3a9205[_0x4cf8('0x2b')][_0x4cf8('0x1f')]);}_0x14a150[_0x4cf8('0x34')]=qs[_0x4cf8('0x35')](_0x3a9205[_0x4cf8('0x2b')]['sort']);_0x14a150[_0x4cf8('0x36')]=qs[_0x4cf8('0x37')](_['pick'](_0x3a9205[_0x4cf8('0x2b')],_0x2be587[_0x4cf8('0x37')]),_0x4447ba);if(_0x3a9205[_0x4cf8('0x2b')][_0x4cf8('0x38')]){_0x14a150[_0x4cf8('0x36')]=_[_0x4cf8('0x39')](_0x14a150[_0x4cf8('0x36')],{'$or':_[_0x4cf8('0x28')](_0x4447ba,function(_0x4dc3f2){if(_0x4dc3f2[_0x4cf8('0x2a')]!==_0x4cf8('0x3a')){var _0x286e3e={};_0x286e3e[_0x4dc3f2[_0x4cf8('0x26')]]={'$like':'%'+_0x3a9205['query'][_0x4cf8('0x38')]+'%'};return _0x286e3e;}})});}_0x14a150=_[_0x4cf8('0x39')]({},_0x14a150,_0x3a9205[_0x4cf8('0x3b')]);var _0x265581={'where':_0x14a150[_0x4cf8('0x36')]};return db[_0x4cf8('0x29')][_0x4cf8('0x1e')](_0x265581)['then'](function(_0x1766a1){_0x574816[_0x4cf8('0x1e')]=_0x1766a1;if(_0x3a9205[_0x4cf8('0x2b')][_0x4cf8('0x3c')]){_0x14a150['include']=[{'all':!![]}];}return db[_0x4cf8('0x29')]['findAll'](_0x14a150);})[_0x4cf8('0x22')](function(_0x3a130c){_0x574816[_0x4cf8('0x3d')]=_0x3a130c;return _0x574816;})[_0x4cf8('0x22')](respondWithFilteredResult(_0x5dac3e,_0x14a150))['catch'](handleError(_0x5dac3e,null));};exports[_0x4cf8('0x3e')]=function(_0x28b67c,_0x583172){var _0x4ff18a={'raw':![],'where':{'id':_0x28b67c[_0x4cf8('0x3f')]['id']}},_0x48e9cc={};_0x48e9cc[_0x4cf8('0x2e')]=_[_0x4cf8('0x2c')](db[_0x4cf8('0x29')][_0x4cf8('0x40')]);_0x48e9cc['query']=_[_0x4cf8('0x2c')](_0x28b67c[_0x4cf8('0x2b')]);_0x48e9cc['filters']=_[_0x4cf8('0x2d')](_0x48e9cc[_0x4cf8('0x2e')],_0x48e9cc[_0x4cf8('0x2b')]);_0x4ff18a[_0x4cf8('0x30')]=_[_0x4cf8('0x2d')](_0x48e9cc[_0x4cf8('0x2e')],qs[_0x4cf8('0x2f')](_0x28b67c[_0x4cf8('0x2b')][_0x4cf8('0x2f')]));_0x4ff18a[_0x4cf8('0x30')]=_0x4ff18a[_0x4cf8('0x30')][_0x4cf8('0x31')]?_0x4ff18a[_0x4cf8('0x30')]:_0x48e9cc[_0x4cf8('0x2e')];if(_0x28b67c[_0x4cf8('0x2b')][_0x4cf8('0x3c')]){_0x4ff18a[_0x4cf8('0x41')]=[{'all':!![]}];}_0x4ff18a=_['merge']({},_0x4ff18a,_0x28b67c[_0x4cf8('0x3b')]);return db[_0x4cf8('0x29')]['find'](_0x4ff18a)[_0x4cf8('0x22')](handleEntityNotFound(_0x583172,null))['then'](respondWithResult(_0x583172,null))[_0x4cf8('0x42')](handleError(_0x583172,null));};exports[_0x4cf8('0x43')]=function(_0x466632,_0x31e2f0){return db['VoiceQueueReport']['create'](_0x466632[_0x4cf8('0x44')],{})[_0x4cf8('0x22')](respondWithResult(_0x31e2f0,0xc9))[_0x4cf8('0x42')](handleError(_0x31e2f0,null));};exports[_0x4cf8('0x21')]=function(_0x41e55c,_0xacd345){if(_0x41e55c['body']['id']){delete _0x41e55c[_0x4cf8('0x44')]['id'];}return db[_0x4cf8('0x29')][_0x4cf8('0x45')]({'where':{'id':_0x41e55c[_0x4cf8('0x3f')]['id']}})[_0x4cf8('0x22')](handleEntityNotFound(_0xacd345,null))[_0x4cf8('0x22')](saveUpdates(_0x41e55c[_0x4cf8('0x44')],null))[_0x4cf8('0x22')](respondWithResult(_0xacd345,null))[_0x4cf8('0x42')](handleError(_0xacd345,null));};exports[_0x4cf8('0x23')]=function(_0x2d49c3,_0x295193){return db['VoiceQueueReport']['find']({'where':{'id':_0x2d49c3[_0x4cf8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x295193,null))[_0x4cf8('0x22')](removeEntity(_0x295193,null))[_0x4cf8('0x42')](handleError(_0x295193,null));};exports['describe']=function(_0x5e0494,_0x5016d9){return db[_0x4cf8('0x29')][_0x4cf8('0x46')]()[_0x4cf8('0x22')](respondWithResult(_0x5016d9,null))[_0x4cf8('0x42')](handleError(_0x5016d9,null));};exports['getVoiceQueuesReport']=function(_0x100e51,_0xe38c5f){var _0x3ef778={},_0x57b1f1={},_0x18e3a5={'count':0x0,'rows':[]};_0x57b1f1['model']=_[_0x4cf8('0x2c')](db[_0x4cf8('0x29')]['rawAttributes']);_0x57b1f1[_0x4cf8('0x2b')]=_[_0x4cf8('0x2c')](_0x100e51[_0x4cf8('0x2b')]);_0x57b1f1[_0x4cf8('0x37')]=_['intersection'](_0x57b1f1[_0x4cf8('0x2e')],_0x57b1f1['query']);_0x3ef778[_0x4cf8('0x30')]=_[_0x4cf8('0x2d')](_0x57b1f1[_0x4cf8('0x2e')],qs[_0x4cf8('0x2f')](_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x2f')]));_0x3ef778['attributes']=_0x3ef778['attributes'][_0x4cf8('0x31')]?_0x3ef778[_0x4cf8('0x30')]:_0x57b1f1[_0x4cf8('0x2e')];if(!_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x32')](_0x4cf8('0x33'))){_0x3ef778['limit']=qs['limit'](_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x1d')]);_0x3ef778[_0x4cf8('0x1f')]=qs[_0x4cf8('0x1f')](_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x1f')]);}_0x3ef778[_0x4cf8('0x34')]=qs[_0x4cf8('0x35')](_0x100e51['query']['sort']);_0x3ef778['where']=qs['filters'](_['pick'](_0x100e51['query'],_0x57b1f1[_0x4cf8('0x37')]));if(_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x38')]){_0x3ef778[_0x4cf8('0x36')]=_['merge'](_0x3ef778[_0x4cf8('0x36')],{'$or':_[_0x4cf8('0x28')](_0x3ef778[_0x4cf8('0x30')],function(_0xe83a05){var _0x112657={};_0x112657[_0xe83a05]={'$like':'%'+_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x38')]+'%'};return _0x112657;})});}_0x3ef778=_[_0x4cf8('0x39')]({},_0x3ef778,_0x100e51[_0x4cf8('0x3b')]);var _0x3ae3a2={'where':_0x3ef778[_0x4cf8('0x36')]};return db[_0x4cf8('0x29')][_0x4cf8('0x1e')](_0x3ae3a2)[_0x4cf8('0x22')](function(_0x4abb29){_0x18e3a5['count']=_0x4abb29;if(_0x100e51[_0x4cf8('0x2b')][_0x4cf8('0x3c')]){_0x3ef778['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x4cf8('0x47')](_0x3ef778);})[_0x4cf8('0x22')](function(_0x759bc7){_0x18e3a5['rows']=_0x759bc7;return _0x18e3a5;})[_0x4cf8('0x22')](respondWithFilteredResult(_0xe38c5f,_0x3ef778,_0x4cf8('0x48')))[_0x4cf8('0x42')](handleError(_0xe38c5f,null,_0x4cf8('0x48')));};
\ No newline at end of file
+var _0x1e2c=['../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','VoiceQueueReport','findAll','rows','catch','show','params','length','find','create','body','describe','getVoiceQueuesReport','keys','pick','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0x1e2c,0x90));var _0xc1e2=function(_0x20b000,_0x6befba){_0x20b000=_0x20b000-0x0;var _0x3cae2b=_0x1e2c[_0x20b000];return _0x3cae2b;};'use strict';var emlformat=require(_0xc1e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1e2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1e2('0x2'));var moment=require(_0xc1e2('0x3'));var BPromise=require(_0xc1e2('0x4'));var Mustache=require(_0xc1e2('0x5'));var util=require(_0xc1e2('0x6'));var path=require(_0xc1e2('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc1e2('0x8'));var fs=require('fs');var fs_extra=require(_0xc1e2('0x9'));var _=require(_0xc1e2('0xa'));var squel=require(_0xc1e2('0xb'));var crypto=require('crypto');var jsforce=require(_0xc1e2('0xc'));var deskjs=require(_0xc1e2('0xd'));var toCsv=require(_0xc1e2('0xe'));var querystring=require(_0xc1e2('0xf'));var Papa=require(_0xc1e2('0x10'));var Redis=require(_0xc1e2('0x11'));var authService=require(_0xc1e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc1e2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1e2('0x14'))('api');var utils=require(_0xc1e2('0x15'));var config=require(_0xc1e2('0x16'));var licenseUtil=require(_0xc1e2('0x17'));var db=require('../../mysqldb')['db'];config[_0xc1e2('0x18')]=_[_0xc1e2('0x19')](config[_0xc1e2('0x18')],{'host':_0xc1e2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1e2('0x18')]));require(_0xc1e2('0x1b'))[_0xc1e2('0x1c')](socket);function respondWithStatusCode(_0x43aea4,_0x24ebb4){_0x24ebb4=_0x24ebb4||0xcc;return function(_0x40fdd2){if(_0x40fdd2){return _0x43aea4[_0xc1e2('0x1d')](_0x24ebb4);}return _0x43aea4[_0xc1e2('0x1e')](_0x24ebb4)[_0xc1e2('0x1f')]();};}function respondWithResult(_0x2d94e7,_0x230775){_0x230775=_0x230775||0xc8;return function(_0x23106a){if(_0x23106a){return _0x2d94e7[_0xc1e2('0x1e')](_0x230775)[_0xc1e2('0x20')](_0x23106a);}};}function respondWithFilteredResult(_0x47b505,_0x57c2bf){return function(_0x345f89){if(_0x345f89){var _0x10ce85=typeof _0x57c2bf['offset']===_0xc1e2('0x21')&&typeof _0x57c2bf[_0xc1e2('0x22')]===_0xc1e2('0x21');var _0x423551=_0x345f89[_0xc1e2('0x23')];var _0xb44672=_0x10ce85?0x0:_0x57c2bf[_0xc1e2('0x24')];var _0x18bd10=_0x10ce85?_0x345f89[_0xc1e2('0x23')]:_0x57c2bf[_0xc1e2('0x24')]+_0x57c2bf[_0xc1e2('0x22')];var _0x24c0cf;if(_0x18bd10>=_0x423551){_0x18bd10=_0x423551;_0x24c0cf=0xc8;}else{_0x24c0cf=0xce;}_0x47b505[_0xc1e2('0x1e')](_0x24c0cf);return _0x47b505['set'](_0xc1e2('0x25'),_0xb44672+'-'+_0x18bd10+'/'+_0x423551)[_0xc1e2('0x20')](_0x345f89);}return null;};}function patchUpdates(_0x556cb3){return function(_0x4dae18){try{jsonpatch[_0xc1e2('0x26')](_0x4dae18,_0x556cb3,!![]);}catch(_0x3821ad){return BPromise[_0xc1e2('0x27')](_0x3821ad);}return _0x4dae18[_0xc1e2('0x28')]();};}function saveUpdates(_0x16e8e6,_0xfed21c){return function(_0x1f5dce){if(_0x1f5dce){return _0x1f5dce[_0xc1e2('0x29')](_0x16e8e6)[_0xc1e2('0x2a')](function(_0x2ddfcd){return _0x2ddfcd;});}return null;};}function removeEntity(_0x305a0a,_0x7739ed){return function(_0x3f4e88){if(_0x3f4e88){return _0x3f4e88[_0xc1e2('0x2b')]()[_0xc1e2('0x2a')](function(){_0x305a0a[_0xc1e2('0x1e')](0xcc)[_0xc1e2('0x1f')]();});}};}function handleEntityNotFound(_0x536e5a,_0x477939){return function(_0x33da5e){if(!_0x33da5e){_0x536e5a[_0xc1e2('0x1d')](0x194);}return _0x33da5e;};}function handleError(_0x585ac5,_0x53c330){_0x53c330=_0x53c330||0x1f4;return function(_0x356a0f){logger['error'](_0x356a0f[_0xc1e2('0x2c')]);if(_0x356a0f[_0xc1e2('0x2d')]){delete _0x356a0f['name'];}_0x585ac5[_0xc1e2('0x1e')](_0x53c330)[_0xc1e2('0x2e')](_0x356a0f);};}exports[_0xc1e2('0x2f')]=function(_0x2ecd38,_0x619314){var _0x140092={},_0x1063a2={},_0xf15f49={'count':0x0,'rows':[]};var _0xe0a914=_[_0xc1e2('0x30')](db['VoiceQueueReport'][_0xc1e2('0x31')],function(_0x136cb1){return{'name':_0x136cb1[_0xc1e2('0x32')],'type':_0x136cb1['type'][_0xc1e2('0x33')]};});_0x1063a2[_0xc1e2('0x34')]=_[_0xc1e2('0x30')](_0xe0a914,'name');_0x1063a2[_0xc1e2('0x35')]=_['keys'](_0x2ecd38['query']);_0x1063a2[_0xc1e2('0x36')]=_[_0xc1e2('0x37')](_0x1063a2[_0xc1e2('0x34')],_0x1063a2[_0xc1e2('0x35')]);_0x140092[_0xc1e2('0x38')]=_[_0xc1e2('0x37')](_0x1063a2[_0xc1e2('0x34')],qs[_0xc1e2('0x39')](_0x2ecd38[_0xc1e2('0x35')]['fields']));_0x140092['attributes']=_0x140092[_0xc1e2('0x38')]['length']?_0x140092[_0xc1e2('0x38')]:_0x1063a2['model'];if(!_0x2ecd38['query'][_0xc1e2('0x3a')](_0xc1e2('0x3b'))){_0x140092['limit']=qs[_0xc1e2('0x22')](_0x2ecd38['query'][_0xc1e2('0x22')]);_0x140092[_0xc1e2('0x24')]=qs[_0xc1e2('0x24')](_0x2ecd38['query'][_0xc1e2('0x24')]);}_0x140092['order']=qs[_0xc1e2('0x3c')](_0x2ecd38['query'][_0xc1e2('0x3c')]);_0x140092[_0xc1e2('0x3d')]=qs['filters'](_['pick'](_0x2ecd38[_0xc1e2('0x35')],_0x1063a2[_0xc1e2('0x36')]),_0xe0a914);if(_0x2ecd38[_0xc1e2('0x35')][_0xc1e2('0x3e')]){_0x140092[_0xc1e2('0x3d')]=_[_0xc1e2('0x3f')](_0x140092['where'],{'$or':_[_0xc1e2('0x30')](_0xe0a914,function(_0x4f0e7e){if(_0x4f0e7e[_0xc1e2('0x40')]!==_0xc1e2('0x41')){var _0x4256e2={};_0x4256e2[_0x4f0e7e['name']]={'$like':'%'+_0x2ecd38['query']['filter']+'%'};return _0x4256e2;}})});}_0x140092=_['merge']({},_0x140092,_0x2ecd38[_0xc1e2('0x42')]);var _0x52975d={'where':_0x140092[_0xc1e2('0x3d')]};return db['VoiceQueueReport']['count'](_0x52975d)[_0xc1e2('0x2a')](function(_0x436fe2){_0xf15f49[_0xc1e2('0x23')]=_0x436fe2;if(_0x2ecd38[_0xc1e2('0x35')][_0xc1e2('0x43')]){_0x140092[_0xc1e2('0x44')]=[{'all':!![]}];}return db[_0xc1e2('0x45')][_0xc1e2('0x46')](_0x140092);})['then'](function(_0x542937){_0xf15f49[_0xc1e2('0x47')]=_0x542937;return _0xf15f49;})[_0xc1e2('0x2a')](respondWithFilteredResult(_0x619314,_0x140092))[_0xc1e2('0x48')](handleError(_0x619314,null));};exports[_0xc1e2('0x49')]=function(_0x2ed7dc,_0x4e25d1){var _0x2d1752={'raw':![],'where':{'id':_0x2ed7dc[_0xc1e2('0x4a')]['id']}},_0x256482={};_0x256482[_0xc1e2('0x34')]=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x256482[_0xc1e2('0x35')]=_['keys'](_0x2ed7dc[_0xc1e2('0x35')]);_0x256482['filters']=_[_0xc1e2('0x37')](_0x256482[_0xc1e2('0x34')],_0x256482[_0xc1e2('0x35')]);_0x2d1752[_0xc1e2('0x38')]=_[_0xc1e2('0x37')](_0x256482[_0xc1e2('0x34')],qs[_0xc1e2('0x39')](_0x2ed7dc[_0xc1e2('0x35')][_0xc1e2('0x39')]));_0x2d1752[_0xc1e2('0x38')]=_0x2d1752[_0xc1e2('0x38')][_0xc1e2('0x4b')]?_0x2d1752['attributes']:_0x256482['model'];if(_0x2ed7dc[_0xc1e2('0x35')][_0xc1e2('0x43')]){_0x2d1752['include']=[{'all':!![]}];}_0x2d1752=_[_0xc1e2('0x3f')]({},_0x2d1752,_0x2ed7dc['options']);return db[_0xc1e2('0x45')][_0xc1e2('0x4c')](_0x2d1752)[_0xc1e2('0x2a')](handleEntityNotFound(_0x4e25d1,null))['then'](respondWithResult(_0x4e25d1,null))[_0xc1e2('0x48')](handleError(_0x4e25d1,null));};exports[_0xc1e2('0x4d')]=function(_0x393488,_0x33c884){return db[_0xc1e2('0x45')][_0xc1e2('0x4d')](_0x393488[_0xc1e2('0x4e')],{})['then'](respondWithResult(_0x33c884,0xc9))[_0xc1e2('0x48')](handleError(_0x33c884,null));};exports[_0xc1e2('0x29')]=function(_0x344caf,_0x261f34){if(_0x344caf[_0xc1e2('0x4e')]['id']){delete _0x344caf[_0xc1e2('0x4e')]['id'];}return db[_0xc1e2('0x45')][_0xc1e2('0x4c')]({'where':{'id':_0x344caf[_0xc1e2('0x4a')]['id']}})[_0xc1e2('0x2a')](handleEntityNotFound(_0x261f34,null))[_0xc1e2('0x2a')](saveUpdates(_0x344caf[_0xc1e2('0x4e')],null))[_0xc1e2('0x2a')](respondWithResult(_0x261f34,null))[_0xc1e2('0x48')](handleError(_0x261f34,null));};exports[_0xc1e2('0x2b')]=function(_0x2eb5e0,_0x595ae5){return db[_0xc1e2('0x45')]['find']({'where':{'id':_0x2eb5e0[_0xc1e2('0x4a')]['id']}})[_0xc1e2('0x2a')](handleEntityNotFound(_0x595ae5,null))[_0xc1e2('0x2a')](removeEntity(_0x595ae5,null))[_0xc1e2('0x48')](handleError(_0x595ae5,null));};exports[_0xc1e2('0x4f')]=function(_0x193e8a,_0x343788){return db[_0xc1e2('0x45')]['describe']()['then'](respondWithResult(_0x343788,null))['catch'](handleError(_0x343788,null));};exports[_0xc1e2('0x50')]=function(_0x261e1d,_0x307538){var _0x4ce1be={},_0x1f8b5a={},_0x214f04={'count':0x0,'rows':[]};_0x1f8b5a[_0xc1e2('0x34')]=_[_0xc1e2('0x51')](db['VoiceQueueReport']['rawAttributes']);_0x1f8b5a[_0xc1e2('0x35')]=_['keys'](_0x261e1d['query']);_0x1f8b5a['filters']=_['intersection'](_0x1f8b5a[_0xc1e2('0x34')],_0x1f8b5a['query']);_0x4ce1be[_0xc1e2('0x38')]=_['intersection'](_0x1f8b5a['model'],qs[_0xc1e2('0x39')](_0x261e1d['query'][_0xc1e2('0x39')]));_0x4ce1be['attributes']=_0x4ce1be[_0xc1e2('0x38')][_0xc1e2('0x4b')]?_0x4ce1be[_0xc1e2('0x38')]:_0x1f8b5a[_0xc1e2('0x34')];if(!_0x261e1d[_0xc1e2('0x35')]['hasOwnProperty'](_0xc1e2('0x3b'))){_0x4ce1be[_0xc1e2('0x22')]=qs[_0xc1e2('0x22')](_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x22')]);_0x4ce1be['offset']=qs[_0xc1e2('0x24')](_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x24')]);}_0x4ce1be['order']=qs[_0xc1e2('0x3c')](_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x3c')]);_0x4ce1be[_0xc1e2('0x3d')]=qs[_0xc1e2('0x36')](_[_0xc1e2('0x52')](_0x261e1d[_0xc1e2('0x35')],_0x1f8b5a[_0xc1e2('0x36')]));if(_0x261e1d[_0xc1e2('0x35')]['filter']){_0x4ce1be[_0xc1e2('0x3d')]=_[_0xc1e2('0x3f')](_0x4ce1be[_0xc1e2('0x3d')],{'$or':_[_0xc1e2('0x30')](_0x4ce1be['attributes'],function(_0x20b767){var _0x14792d={};_0x14792d[_0x20b767]={'$like':'%'+_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x3e')]+'%'};return _0x14792d;})});}_0x4ce1be=_[_0xc1e2('0x3f')]({},_0x4ce1be,_0x261e1d[_0xc1e2('0x42')]);var _0x515ff8={'where':_0x4ce1be[_0xc1e2('0x3d')]};return db['VoiceQueueReport'][_0xc1e2('0x23')](_0x515ff8)[_0xc1e2('0x2a')](function(_0xd74b71){_0x214f04[_0xc1e2('0x23')]=_0xd74b71;if(_0x261e1d[_0xc1e2('0x35')][_0xc1e2('0x43')]){_0x4ce1be['include']=[{'all':!![]}];}return db[_0xc1e2('0x45')][_0xc1e2('0x46')](_0x4ce1be);})[_0xc1e2('0x2a')](function(_0x4c017e){_0x214f04[_0xc1e2('0x47')]=_0x4c017e;return _0x214f04;})[_0xc1e2('0x2a')](respondWithFilteredResult(_0x307538,_0x4ce1be,_0xc1e2('0x50')))[_0xc1e2('0x48')](handleError(_0x307538,null,_0xc1e2('0x50')));};
\ No newline at end of file
index 7e0a6e3..efd0260 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x929c=['remove','emit','hasOwnProperty','hook','exports','VoiceQueueReport','save'];(function(_0x3a0ea9,_0x13da4f){var _0x45f889=function(_0x2a3346){while(--_0x2a3346){_0x3a0ea9['push'](_0x3a0ea9['shift']());}};_0x45f889(++_0x13da4f);}(_0x929c,0x147));var _0xc929=function(_0x4c770c,_0x41c1a8){_0x4c770c=_0x4c770c-0x0;var _0x1db845=_0x929c[_0x4c770c];return _0x1db845;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xc929('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc929('0x1'),'afterUpdate':'update','afterDestroy':_0xc929('0x2')};function emitEvent(_0x12fb8a){return function(_0x36bdea,_0xfc740f,_0x355305){VoiceQueueReportEvents[_0xc929('0x3')](_0x12fb8a+':'+_0x36bdea['id'],_0x36bdea);VoiceQueueReportEvents[_0xc929('0x3')](_0x12fb8a,_0x36bdea);_0x355305(null);};}for(var e in events){if(events[_0xc929('0x4')](e)){var event=events[e];VoiceQueueReport[_0xc929('0x5')](e,emitEvent(event));}}module[_0xc929('0x6')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xee18=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x17a98a,_0x4a10d6){var _0xc5b705=function(_0x5b83eb){while(--_0x5b83eb){_0x17a98a['push'](_0x17a98a['shift']());}};_0xc5b705(++_0x4a10d6);}(_0xee18,0x1c8));var _0x8ee1=function(_0x333767,_0x220733){_0x333767=_0x333767-0x0;var _0x42a755=_0xee18[_0x333767];return _0x42a755;};'use strict';var EventEmitter=require(_0x8ee1('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8ee1('0x1')](0x0);var events={'afterCreate':_0x8ee1('0x2'),'afterUpdate':_0x8ee1('0x3'),'afterDestroy':_0x8ee1('0x4')};function emitEvent(_0x5e11e7){return function(_0x3d9bdf,_0x2615aa,_0x509964){VoiceQueueReportEvents[_0x8ee1('0x5')](_0x5e11e7+':'+_0x3d9bdf['id'],_0x3d9bdf);VoiceQueueReportEvents['emit'](_0x5e11e7,_0x3d9bdf);_0x509964(null);};}for(var e in events){if(events[_0x8ee1('0x6')](e)){var event=events[e];VoiceQueueReport[_0x8ee1('0x7')](e,emitEvent(event));}}module[_0x8ee1('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
index 0e5653a..0d99180 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3747=['moment','bluebird','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','lodash','util','../../config/logger','api'];(function(_0x45618b,_0x3068df){var _0x20c9f1=function(_0x45d446){while(--_0x45d446){_0x45618b['push'](_0x45618b['shift']());}};_0x20c9f1(++_0x3068df);}(_0x3747,0x11a));var _0x7374=function(_0x2faf73,_0x5a098e){_0x2faf73=_0x2faf73-0x0;var _0x5ab1e6=_0x3747[_0x2faf73];return _0x5ab1e6;};'use strict';var _=require(_0x7374('0x0'));var util=require(_0x7374('0x1'));var logger=require(_0x7374('0x2'))(_0x7374('0x3'));var moment=require(_0x7374('0x4'));var BPromise=require(_0x7374('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7374('0x6'));var config=require(_0x7374('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x7374('0x8')]=function(_0x478d90,_0x487a4b){return _0x478d90['define'](_0x7374('0x9'),attributes,{'tableName':_0x7374('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcf15=['./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40ddca,_0x374da5){var _0x38064b=function(_0x1118e3){while(--_0x1118e3){_0x40ddca['push'](_0x40ddca['shift']());}};_0x38064b(++_0x374da5);}(_0xcf15,0x131));var _0x5cf1=function(_0x53d934,_0x346ce2){_0x53d934=_0x53d934-0x0;var _0x190dfc=_0xcf15[_0x53d934];return _0x190dfc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5cf1('0x0'))(_0x5cf1('0x1'));var moment=require('moment');var BPromise=require(_0x5cf1('0x2'));var rp=require(_0x5cf1('0x3'));var fs=require('fs');var path=require(_0x5cf1('0x4'));var rimraf=require(_0x5cf1('0x5'));var config=require(_0x5cf1('0x6'));var attributes=require(_0x5cf1('0x7'));module[_0x5cf1('0x8')]=function(_0x316663,_0x2111c3){return _0x316663['define'](_0x5cf1('0x9'),attributes,{'tableName':_0x5cf1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x5cf1('0xb')]},{'fields':[_0x5cf1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index e1fdb50..16ad462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5840=['error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','options','raw','where','limit','include','map','model','attributes','GetVoiceQueueReport','debug','VoiceQueueReport','body','CreateVoiceQueueReport','update','UpdateVoiceQueueReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5840,0x67));var _0x0584=function(_0xc6b5ec,_0x1e3170){_0xc6b5ec=_0xc6b5ec-0x0;var _0x10b0bc=_0x5840[_0xc6b5ec];return _0x10b0bc;};'use strict';var _=require(_0x0584('0x0'));var util=require(_0x0584('0x1'));var moment=require('moment');var BPromise=require(_0x0584('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0584('0x3'));var db=require(_0x0584('0x4'))['db'];var utils=require(_0x0584('0x5'));var logger=require('../../config/logger')(_0x0584('0x6'));var config=require(_0x0584('0x7'));var jayson=require(_0x0584('0x8'));var client=jayson['client'][_0x0584('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0584('0xa')],{'host':_0x0584('0xb'),'port':0x18eb});var socket=require(_0x0584('0xc'))(new Redis(config[_0x0584('0xa')]));require('./voiceQueueReport.socket')[_0x0584('0xd')](socket);function respondWithRpcPromise(_0x50a415,_0x10b69c,_0x510295){return new BPromise(function(_0x177b95,_0xf3adf7){return client[_0x0584('0xe')](_0x50a415,_0x510295)[_0x0584('0xf')](function(_0x138f05){logger[_0x0584('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x10b69c,_0x0584('0x11'));logger['debug'](_0x0584('0x12'),_0x10b69c,_0x0584('0x11'),JSON[_0x0584('0x13')](_0x138f05));if(_0x138f05[_0x0584('0x14')]){if(_0x138f05[_0x0584('0x14')][_0x0584('0x15')]===0x1f4){logger['error'](_0x0584('0x16'),_0x10b69c,_0x138f05[_0x0584('0x14')]['message']);return _0xf3adf7(_0x138f05[_0x0584('0x14')][_0x0584('0x17')]);}logger[_0x0584('0x14')](_0x0584('0x16'),_0x10b69c,_0x138f05[_0x0584('0x14')]['message']);return _0x177b95(_0x138f05[_0x0584('0x14')][_0x0584('0x17')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x10b69c,_0x0584('0x11'));_0x177b95(_0x138f05[_0x0584('0x18')][_0x0584('0x17')]);}})[_0x0584('0x19')](function(_0x518395){logger[_0x0584('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x10b69c,_0x518395);_0xf3adf7(_0x518395);});});}exports['GetVoiceQueueReport']=function(_0x52d5db){var _0x477a54=this;return new Promise(function(_0x4b8302,_0x2b562c){return db['VoiceQueueReport']['findAll']({'raw':_0x52d5db[_0x0584('0x1a')]?_0x52d5db['options'][_0x0584('0x1b')]===undefined?!![]:![]:!![],'where':_0x52d5db[_0x0584('0x1a')]?_0x52d5db[_0x0584('0x1a')][_0x0584('0x1c')]||null:null,'attributes':_0x52d5db['options']?_0x52d5db[_0x0584('0x1a')]['attributes']||null:null,'limit':_0x52d5db['options']?_0x52d5db[_0x0584('0x1a')][_0x0584('0x1d')]||null:null,'include':_0x52d5db[_0x0584('0x1a')]?_0x52d5db[_0x0584('0x1a')][_0x0584('0x1e')]?_[_0x0584('0x1f')](_0x52d5db[_0x0584('0x1a')][_0x0584('0x1e')],function(_0x10d54c){return{'model':db[_0x10d54c['model']],'as':_0x10d54c['as'],'attributes':_0x10d54c['attributes'],'include':_0x10d54c[_0x0584('0x1e')]?_[_0x0584('0x1f')](_0x10d54c['include'],function(_0x4c4428){return{'model':db[_0x4c4428[_0x0584('0x20')]],'as':_0x4c4428['as'],'attributes':_0x4c4428[_0x0584('0x21')],'include':_0x4c4428[_0x0584('0x1e')]?_[_0x0584('0x1f')](_0x4c4428[_0x0584('0x1e')],function(_0x39cadc){return{'model':db[_0x39cadc[_0x0584('0x20')]],'as':_0x39cadc['as'],'attributes':_0x39cadc[_0x0584('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27c99d){logger['info'](_0x0584('0x22'),_0x52d5db);logger[_0x0584('0x23')](_0x0584('0x22'),_0x52d5db,JSON[_0x0584('0x13')](_0x27c99d));_0x4b8302(_0x27c99d);})[_0x0584('0x19')](function(_0x58489d){logger[_0x0584('0x14')](_0x0584('0x22'),_0x58489d[_0x0584('0x17')],_0x52d5db);_0x2b562c(_0x477a54[_0x0584('0x14')](0x1f4,_0x58489d[_0x0584('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0x1e6963){var _0x1df2f7=this;return new Promise(function(_0x27e40e,_0xa25b69){return db[_0x0584('0x24')]['create'](_0x1e6963[_0x0584('0x25')],{'raw':_0x1e6963[_0x0584('0x1a')]?_0x1e6963[_0x0584('0x1a')][_0x0584('0x1b')]===undefined?!![]:![]:!![]})[_0x0584('0xf')](function(_0x44bb8c){logger['info'](_0x0584('0x26'),_0x1e6963);logger[_0x0584('0x23')](_0x0584('0x26'),_0x1e6963,JSON[_0x0584('0x13')](_0x44bb8c));_0x27e40e(_0x44bb8c);})[_0x0584('0x19')](function(_0x5af8f6){logger[_0x0584('0x14')]('CreateVoiceQueueReport',_0x5af8f6['message'],_0x1e6963);_0xa25b69(_0x1df2f7[_0x0584('0x14')](0x1f4,_0x5af8f6[_0x0584('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x2f6e8e){var _0x1d8829=this;return new Promise(function(_0x315e95,_0x422eee){return db[_0x0584('0x24')][_0x0584('0x27')](_0x2f6e8e[_0x0584('0x25')],{'raw':_0x2f6e8e[_0x0584('0x1a')]?_0x2f6e8e[_0x0584('0x1a')][_0x0584('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f6e8e[_0x0584('0x1a')]?_0x2f6e8e['options'][_0x0584('0x1c')]||null:null,'attributes':_0x2f6e8e[_0x0584('0x1a')]?_0x2f6e8e[_0x0584('0x1a')]['attributes']||null:null,'limit':_0x2f6e8e[_0x0584('0x1a')]?_0x2f6e8e[_0x0584('0x1a')][_0x0584('0x1d')]||null:null})[_0x0584('0xf')](function(_0xd0ac5e){logger[_0x0584('0x10')](_0x0584('0x28'),_0x2f6e8e);logger['debug'](_0x0584('0x28'),_0x2f6e8e,JSON[_0x0584('0x13')](_0xd0ac5e));_0x315e95(_0xd0ac5e);})['catch'](function(_0x52a96f){logger[_0x0584('0x14')]('UpdateVoiceQueueReport',_0x52a96f[_0x0584('0x17')],_0x2f6e8e);_0x422eee(_0x1d8829[_0x0584('0x14')](0x1f4,_0x52a96f[_0x0584('0x17')]));});});};
\ No newline at end of file
+var _0xf7fc=['options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','update','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf7fc,0x198));var _0xcf7f=function(_0x124e54,_0x5a2811){_0x124e54=_0x124e54-0x0;var _0x117368=_0xf7fc[_0x124e54];return _0x117368;};'use strict';var _=require(_0xcf7f('0x0'));var util=require(_0xcf7f('0x1'));var moment=require(_0xcf7f('0x2'));var BPromise=require(_0xcf7f('0x3'));var rs=require(_0xcf7f('0x4'));var fs=require('fs');var Redis=require(_0xcf7f('0x5'));var db=require(_0xcf7f('0x6'))['db'];var utils=require(_0xcf7f('0x7'));var logger=require(_0xcf7f('0x8'))(_0xcf7f('0x9'));var config=require(_0xcf7f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xcf7f('0xb')][_0xcf7f('0xc')]({'port':0x232a});config[_0xcf7f('0xd')]=_['defaults'](config['redis'],{'host':_0xcf7f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcf7f('0xd')]));require(_0xcf7f('0xf'))[_0xcf7f('0x10')](socket);function respondWithRpcPromise(_0x311491,_0x241380,_0x2e6fa2){return new BPromise(function(_0x37b0f1,_0x1df899){return client[_0xcf7f('0x11')](_0x311491,_0x2e6fa2)[_0xcf7f('0x12')](function(_0x4e7aff){logger[_0xcf7f('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x241380,_0xcf7f('0x14'));logger[_0xcf7f('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x241380,_0xcf7f('0x14'),JSON[_0xcf7f('0x16')](_0x4e7aff));if(_0x4e7aff[_0xcf7f('0x17')]){if(_0x4e7aff['error'][_0xcf7f('0x18')]===0x1f4){logger['error'](_0xcf7f('0x19'),_0x241380,_0x4e7aff[_0xcf7f('0x17')][_0xcf7f('0x1a')]);return _0x1df899(_0x4e7aff['error']['message']);}logger[_0xcf7f('0x17')](_0xcf7f('0x19'),_0x241380,_0x4e7aff[_0xcf7f('0x17')][_0xcf7f('0x1a')]);return _0x37b0f1(_0x4e7aff['error'][_0xcf7f('0x1a')]);}else{logger[_0xcf7f('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x241380,_0xcf7f('0x14'));_0x37b0f1(_0x4e7aff[_0xcf7f('0x1b')][_0xcf7f('0x1a')]);}})[_0xcf7f('0x1c')](function(_0x319a3c){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x241380,_0x319a3c);_0x1df899(_0x319a3c);});});}exports[_0xcf7f('0x1d')]=function(_0x394fd4){var _0x3b3bc8=this;return new Promise(function(_0x4681fe,_0x4ee9bc){return db[_0xcf7f('0x1e')][_0xcf7f('0x1f')]({'raw':_0x394fd4['options']?_0x394fd4[_0xcf7f('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x394fd4[_0xcf7f('0x20')]?_0x394fd4['options'][_0xcf7f('0x21')]||null:null,'attributes':_0x394fd4['options']?_0x394fd4[_0xcf7f('0x20')][_0xcf7f('0x22')]||null:null,'limit':_0x394fd4[_0xcf7f('0x20')]?_0x394fd4[_0xcf7f('0x20')][_0xcf7f('0x23')]||null:null,'include':_0x394fd4[_0xcf7f('0x20')]?_0x394fd4['options'][_0xcf7f('0x24')]?_['map'](_0x394fd4[_0xcf7f('0x20')][_0xcf7f('0x24')],function(_0x193c11){return{'model':db[_0x193c11['model']],'as':_0x193c11['as'],'attributes':_0x193c11[_0xcf7f('0x22')],'include':_0x193c11[_0xcf7f('0x24')]?_[_0xcf7f('0x25')](_0x193c11[_0xcf7f('0x24')],function(_0x12e112){return{'model':db[_0x12e112[_0xcf7f('0x26')]],'as':_0x12e112['as'],'attributes':_0x12e112['attributes'],'include':_0x12e112[_0xcf7f('0x24')]?_[_0xcf7f('0x25')](_0x12e112[_0xcf7f('0x24')],function(_0x4d62d8){return{'model':db[_0x4d62d8['model']],'as':_0x4d62d8['as'],'attributes':_0x4d62d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf7f('0x12')](function(_0x909265){logger[_0xcf7f('0x13')](_0xcf7f('0x1d'),_0x394fd4);logger[_0xcf7f('0x15')]('GetVoiceQueueReport',_0x394fd4,JSON[_0xcf7f('0x16')](_0x909265));_0x4681fe(_0x909265);})[_0xcf7f('0x1c')](function(_0x5a665c){logger['error'](_0xcf7f('0x1d'),_0x5a665c[_0xcf7f('0x1a')],_0x394fd4);_0x4ee9bc(_0x3b3bc8[_0xcf7f('0x17')](0x1f4,_0x5a665c[_0xcf7f('0x1a')]));});});};exports[_0xcf7f('0x27')]=function(_0x4d4e80){var _0x326859=this;return new Promise(function(_0x3ff362,_0x170d2a){return db[_0xcf7f('0x1e')][_0xcf7f('0x28')](_0x4d4e80[_0xcf7f('0x29')],{'raw':_0x4d4e80[_0xcf7f('0x20')]?_0x4d4e80[_0xcf7f('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xcf7f('0x12')](function(_0x30344e){logger[_0xcf7f('0x13')](_0xcf7f('0x27'),_0x4d4e80);logger[_0xcf7f('0x15')]('CreateVoiceQueueReport',_0x4d4e80,JSON[_0xcf7f('0x16')](_0x30344e));_0x3ff362(_0x30344e);})[_0xcf7f('0x1c')](function(_0x44a4e4){logger[_0xcf7f('0x17')](_0xcf7f('0x27'),_0x44a4e4['message'],_0x4d4e80);_0x170d2a(_0x326859['error'](0x1f4,_0x44a4e4['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x2afb93){var _0x9628ba=this;return new Promise(function(_0xd6b393,_0x2157c0){return db[_0xcf7f('0x1e')][_0xcf7f('0x2a')](_0x2afb93[_0xcf7f('0x29')],{'raw':_0x2afb93[_0xcf7f('0x20')]?_0x2afb93[_0xcf7f('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2afb93[_0xcf7f('0x20')]?_0x2afb93[_0xcf7f('0x20')][_0xcf7f('0x21')]||null:null,'attributes':_0x2afb93['options']?_0x2afb93[_0xcf7f('0x20')][_0xcf7f('0x22')]||null:null,'limit':_0x2afb93[_0xcf7f('0x20')]?_0x2afb93[_0xcf7f('0x20')][_0xcf7f('0x23')]||null:null})[_0xcf7f('0x12')](function(_0x4c1b5f){logger[_0xcf7f('0x13')](_0xcf7f('0x2b'),_0x2afb93);logger['debug']('UpdateVoiceQueueReport',_0x2afb93,JSON[_0xcf7f('0x16')](_0x4c1b5f));_0xd6b393(_0x4c1b5f);})['catch'](function(_0x735f53){logger[_0xcf7f('0x17')]('UpdateVoiceQueueReport',_0x735f53[_0xcf7f('0x1a')],_0x2afb93);_0x2157c0(_0x9628ba[_0xcf7f('0x17')](0x1f4,_0x735f53[_0xcf7f('0x1a')]));});});};
\ No newline at end of file
index c0df55e..5bf0d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x607b=['emit','length','voiceQueueReport:','./voiceQueueReport.events','remove','update'];(function(_0x376f50,_0x1b6855){var _0x1c5f2e=function(_0x50adf8){while(--_0x50adf8){_0x376f50['push'](_0x376f50['shift']());}};_0x1c5f2e(++_0x1b6855);}(_0x607b,0x18f));var _0xb607=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x607b[_0x5c351c];return _0x26f3b3;};'use strict';var VoiceQueueReportEvents=require(_0xb607('0x0'));var events=['save',_0xb607('0x1'),_0xb607('0x2')];function createListener(_0x40f2d7,_0x198cae){return function(_0x2ffbc7){_0x198cae[_0xb607('0x3')](_0x40f2d7,_0x2ffbc7);};}function removeListener(_0x2d948b,_0x207bda){return function(){VoiceQueueReportEvents['removeListener'](_0x2d948b,_0x207bda);};}exports['register']=function(_0xc7225a){for(var _0x509054=0x0,_0x513219=events[_0xb607('0x4')];_0x509054<_0x513219;_0x509054++){var _0x2b0afe=events[_0x509054];var _0x4f798b=createListener(_0xb607('0x5')+_0x2b0afe,_0xc7225a);VoiceQueueReportEvents['on'](_0x2b0afe,_0x4f798b);}};
\ No newline at end of file
+var _0x761e=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener','register','length'];(function(_0x581182,_0x4d140b){var _0x27eed2=function(_0x221e8f){while(--_0x221e8f){_0x581182['push'](_0x581182['shift']());}};_0x27eed2(++_0x4d140b);}(_0x761e,0x14e));var _0xe761=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0x761e[_0x3f8a03];return _0x147fb2;};'use strict';var VoiceQueueReportEvents=require(_0xe761('0x0'));var events=[_0xe761('0x1'),_0xe761('0x2'),_0xe761('0x3')];function createListener(_0x160864,_0x427b12){return function(_0x21ac2e){_0x427b12[_0xe761('0x4')](_0x160864,_0x21ac2e);};}function removeListener(_0x56e6c0,_0x47ae65){return function(){VoiceQueueReportEvents[_0xe761('0x5')](_0x56e6c0,_0x47ae65);};}exports[_0xe761('0x6')]=function(_0x4c35b7){for(var _0xbe7b6d=0x0,_0x3e435d=events[_0xe761('0x7')];_0xbe7b6d<_0x3e435d;_0xbe7b6d++){var _0x3b3a62=events[_0xbe7b6d];var _0x2925c2=createListener(_0xe761('0x8')+_0x3b3a62,_0x4c35b7);VoiceQueueReportEvents['on'](_0x3b3a62,_0x2925c2);}};
\ No newline at end of file
index 2c51aae..ef491b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x066a=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','create','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x066a,0x9b));var _0xa066=function(_0xdef27e,_0x38eae4){_0xdef27e=_0xdef27e-0x0;var _0x409f0c=_0x066a[_0xdef27e];return _0x409f0c;};'use strict';var multer=require(_0xa066('0x0'));var util=require(_0xa066('0x1'));var path=require(_0xa066('0x2'));var timeout=require('connect-timeout');var express=require(_0xa066('0x3'));var router=express[_0xa066('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa066('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa066('0x6'));var controller=require(_0xa066('0x7'));router[_0xa066('0x8')]('/',auth['isAuthenticated'](),controller[_0xa066('0x9')]);router[_0xa066('0x8')](_0xa066('0xa'),auth[_0xa066('0xb')](),controller[_0xa066('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa066('0xd')]);router['put'](_0xa066('0xa'),auth[_0xa066('0xb')](),controller[_0xa066('0xe')]);router[_0xa066('0xf')](_0xa066('0xa'),auth[_0xa066('0xb')](),controller[_0xa066('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xa6fa=['util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post','create','update','destroy','exports'];(function(_0x44badf,_0x467490){var _0x2c06a5=function(_0x1b9e90){while(--_0x1b9e90){_0x44badf['push'](_0x44badf['shift']());}};_0x2c06a5(++_0x467490);}(_0xa6fa,0x130));var _0xaa6f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa6fa[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xaa6f('0x0'));var path=require(_0xaa6f('0x1'));var timeout=require(_0xaa6f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xaa6f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xaa6f('0x4'));var config=require(_0xaa6f('0x5'));var controller=require(_0xaa6f('0x6'));router['get']('/',auth[_0xaa6f('0x7')](),controller['index']);router[_0xaa6f('0x8')](_0xaa6f('0x9'),auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xa')]);router[_0xaa6f('0xb')]('/',auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xc')]);router['put'](_0xaa6f('0x9'),auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xd')]);router['delete']('/:id',auth[_0xaa6f('0x7')](),controller[_0xaa6f('0xe')]);module[_0xaa6f('0xf')]=router;
\ No newline at end of file
index f580d68..00ce31f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67e8=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x51b52e,_0x3c2506){var _0x59a011=function(_0x397663){while(--_0x397663){_0x51b52e['push'](_0x51b52e['shift']());}};_0x59a011(++_0x3c2506);}(_0x67e8,0x86));var _0x867e=function(_0x57e0fa,_0x41428c){_0x57e0fa=_0x57e0fa-0x0;var _0xeb1110=_0x67e8[_0x57e0fa];return _0xeb1110;};'use strict';var Sequelize=require(_0x867e('0x0'));var moment=require(_0x867e('0x1'));module[_0x867e('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x867e('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x867e('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x867e('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x867e('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x867e('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x867e('0x4')],'allowNull':![],'defaultValue':moment()[_0x867e('0x5')](_0x867e('0x6'))}};
\ No newline at end of file
+var _0x7f9d=['format','sequelize','exports','STRING'];(function(_0xf8006,_0x3e9310){var _0x55c180=function(_0xcc1db8){while(--_0xcc1db8){_0xf8006['push'](_0xf8006['shift']());}};_0x55c180(++_0x3e9310);}(_0x7f9d,0xb9));var _0xd7f9=function(_0x2309e5,_0x19a137){_0x2309e5=_0x2309e5-0x0;var _0x1b1444=_0x7f9d[_0x2309e5];return _0x1b1444;};'use strict';var Sequelize=require(_0xd7f9('0x0'));var moment=require('moment');module[_0xd7f9('0x1')]={'time':{'type':Sequelize[_0xd7f9('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd7f9('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xd7f9('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index 39a39c0..9e92e91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ac0=['show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x6ac0,0x92));var _0x06ac=function(_0x1e90f8,_0x19d21c){_0x1e90f8=_0x1e90f8-0x0;var _0x42c008=_0x6ac0[_0x1e90f8];return _0x42c008;};'use strict';var emlformat=require(_0x06ac('0x0'));var rimraf=require(_0x06ac('0x1'));var zipdir=require(_0x06ac('0x2'));var jsonpatch=require(_0x06ac('0x3'));var rp=require(_0x06ac('0x4'));var moment=require('moment');var BPromise=require(_0x06ac('0x5'));var Mustache=require('mustache');var util=require(_0x06ac('0x6'));var path=require(_0x06ac('0x7'));var sox=require(_0x06ac('0x8'));var csv=require(_0x06ac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06ac('0xa'));var _=require(_0x06ac('0xb'));var squel=require(_0x06ac('0xc'));var crypto=require('crypto');var jsforce=require(_0x06ac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x06ac('0x9'));var querystring=require(_0x06ac('0xe'));var Papa=require('papaparse');var Redis=require(_0x06ac('0xf'));var authService=require(_0x06ac('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06ac('0x11'));var logger=require(_0x06ac('0x12'))(_0x06ac('0x13'));var utils=require(_0x06ac('0x14'));var config=require(_0x06ac('0x15'));var licenseUtil=require(_0x06ac('0x16'));var db=require(_0x06ac('0x17'))['db'];function respondWithStatusCode(_0x401055,_0x4f99f7){_0x4f99f7=_0x4f99f7||0xcc;return function(_0x3523cf){if(_0x3523cf){return _0x401055[_0x06ac('0x18')](_0x4f99f7);}return _0x401055[_0x06ac('0x19')](_0x4f99f7)[_0x06ac('0x1a')]();};}function respondWithResult(_0x376cdf,_0xfead52){_0xfead52=_0xfead52||0xc8;return function(_0x5efe0a){if(_0x5efe0a){return _0x376cdf[_0x06ac('0x19')](_0xfead52)[_0x06ac('0x1b')](_0x5efe0a);}};}function respondWithFilteredResult(_0x243149,_0x19169f){return function(_0x27b783){if(_0x27b783){var _0x50c7c1=typeof _0x19169f['offset']===_0x06ac('0x1c')&&typeof _0x19169f[_0x06ac('0x1d')]===_0x06ac('0x1c');var _0x2c1ac8=_0x27b783[_0x06ac('0x1e')];var _0x5ca175=_0x50c7c1?0x0:_0x19169f[_0x06ac('0x1f')];var _0x21820e=_0x50c7c1?_0x27b783['count']:_0x19169f[_0x06ac('0x1f')]+_0x19169f[_0x06ac('0x1d')];var _0x55d8bb;if(_0x21820e>=_0x2c1ac8){_0x21820e=_0x2c1ac8;_0x55d8bb=0xc8;}else{_0x55d8bb=0xce;}_0x243149['status'](_0x55d8bb);return _0x243149['set'](_0x06ac('0x20'),_0x5ca175+'-'+_0x21820e+'/'+_0x2c1ac8)['json'](_0x27b783);}return null;};}function patchUpdates(_0x1905f1){return function(_0xc0193e){try{jsonpatch[_0x06ac('0x21')](_0xc0193e,_0x1905f1,!![]);}catch(_0xe63373){return BPromise[_0x06ac('0x22')](_0xe63373);}return _0xc0193e['save']();};}function saveUpdates(_0x2b064f,_0x22abcd){return function(_0x5ed168){if(_0x5ed168){return _0x5ed168['update'](_0x2b064f)[_0x06ac('0x23')](function(_0x3e071f){return _0x3e071f;});}return null;};}function removeEntity(_0x5c713b,_0x28a805){return function(_0x1a8b23){if(_0x1a8b23){return _0x1a8b23[_0x06ac('0x24')]()[_0x06ac('0x23')](function(){_0x5c713b[_0x06ac('0x19')](0xcc)[_0x06ac('0x1a')]();});}};}function handleEntityNotFound(_0x16e82c,_0x586410){return function(_0x4479b1){if(!_0x4479b1){_0x16e82c[_0x06ac('0x18')](0x194);}return _0x4479b1;};}function handleError(_0x229387,_0x180876){_0x180876=_0x180876||0x1f4;return function(_0x355ec1){logger[_0x06ac('0x25')](_0x355ec1[_0x06ac('0x26')]);if(_0x355ec1[_0x06ac('0x27')]){delete _0x355ec1[_0x06ac('0x27')];}_0x229387['status'](_0x180876)[_0x06ac('0x28')](_0x355ec1);};}exports['index']=function(_0xc135c0,_0xff2776){var _0x44041e={},_0x3d1bc7={},_0x5a76f7={'count':0x0,'rows':[]};var _0x245ac7=_[_0x06ac('0x29')](db[_0x06ac('0x2a')]['rawAttributes'],function(_0x23c4bb){return{'name':_0x23c4bb[_0x06ac('0x2b')],'type':_0x23c4bb[_0x06ac('0x2c')][_0x06ac('0x2d')]};});_0x3d1bc7[_0x06ac('0x2e')]=_[_0x06ac('0x29')](_0x245ac7,_0x06ac('0x27'));_0x3d1bc7[_0x06ac('0x2f')]=_['keys'](_0xc135c0[_0x06ac('0x2f')]);_0x3d1bc7[_0x06ac('0x30')]=_[_0x06ac('0x31')](_0x3d1bc7[_0x06ac('0x2e')],_0x3d1bc7[_0x06ac('0x2f')]);_0x44041e[_0x06ac('0x32')]=_[_0x06ac('0x31')](_0x3d1bc7[_0x06ac('0x2e')],qs['fields'](_0xc135c0['query'][_0x06ac('0x33')]));_0x44041e[_0x06ac('0x32')]=_0x44041e[_0x06ac('0x32')][_0x06ac('0x34')]?_0x44041e[_0x06ac('0x32')]:_0x3d1bc7[_0x06ac('0x2e')];if(!_0xc135c0[_0x06ac('0x2f')][_0x06ac('0x35')](_0x06ac('0x36'))){_0x44041e[_0x06ac('0x1d')]=qs['limit'](_0xc135c0[_0x06ac('0x2f')][_0x06ac('0x1d')]);_0x44041e['offset']=qs[_0x06ac('0x1f')](_0xc135c0[_0x06ac('0x2f')][_0x06ac('0x1f')]);}_0x44041e['order']=qs['sort'](_0xc135c0[_0x06ac('0x2f')]['sort']);_0x44041e[_0x06ac('0x37')]=qs[_0x06ac('0x30')](_['pick'](_0xc135c0[_0x06ac('0x2f')],_0x3d1bc7[_0x06ac('0x30')]),_0x245ac7);if(_0xc135c0[_0x06ac('0x2f')][_0x06ac('0x38')]){_0x44041e[_0x06ac('0x37')]=_['merge'](_0x44041e[_0x06ac('0x37')],{'$or':_[_0x06ac('0x29')](_0x245ac7,function(_0x13559c){if(_0x13559c['type']!=='VIRTUAL'){var _0x227b29={};_0x227b29[_0x13559c['name']]={'$like':'%'+_0xc135c0[_0x06ac('0x2f')]['filter']+'%'};return _0x227b29;}})});}_0x44041e=_[_0x06ac('0x39')]({},_0x44041e,_0xc135c0[_0x06ac('0x3a')]);var _0xc67c2f={'where':_0x44041e[_0x06ac('0x37')]};return db[_0x06ac('0x2a')]['count'](_0xc67c2f)['then'](function(_0x5b71cb){_0x5a76f7[_0x06ac('0x1e')]=_0x5b71cb;if(_0xc135c0['query'][_0x06ac('0x3b')]){_0x44041e[_0x06ac('0x3c')]=[{'all':!![]}];}return db[_0x06ac('0x2a')][_0x06ac('0x3d')](_0x44041e);})[_0x06ac('0x23')](function(_0x2f6db9){_0x5a76f7[_0x06ac('0x3e')]=_0x2f6db9;return _0x5a76f7;})[_0x06ac('0x23')](respondWithFilteredResult(_0xff2776,_0x44041e))[_0x06ac('0x3f')](handleError(_0xff2776,null));};exports[_0x06ac('0x40')]=function(_0x2ab8eb,_0x1e7561){var _0x35fe7e={'raw':!![],'where':{'id':_0x2ab8eb[_0x06ac('0x41')]['id']}},_0x5dbca9={};_0x5dbca9[_0x06ac('0x2e')]=_[_0x06ac('0x42')](db['VoiceQueuesLog']['rawAttributes']);_0x5dbca9[_0x06ac('0x2f')]=_[_0x06ac('0x42')](_0x2ab8eb['query']);_0x5dbca9[_0x06ac('0x30')]=_[_0x06ac('0x31')](_0x5dbca9[_0x06ac('0x2e')],_0x5dbca9[_0x06ac('0x2f')]);_0x35fe7e['attributes']=_[_0x06ac('0x31')](_0x5dbca9[_0x06ac('0x2e')],qs[_0x06ac('0x33')](_0x2ab8eb[_0x06ac('0x2f')][_0x06ac('0x33')]));_0x35fe7e[_0x06ac('0x32')]=_0x35fe7e[_0x06ac('0x32')][_0x06ac('0x34')]?_0x35fe7e['attributes']:_0x5dbca9[_0x06ac('0x2e')];if(_0x2ab8eb['query'][_0x06ac('0x3b')]){_0x35fe7e['include']=[{'all':!![]}];}_0x35fe7e=_[_0x06ac('0x39')]({},_0x35fe7e,_0x2ab8eb[_0x06ac('0x3a')]);return db[_0x06ac('0x2a')]['find'](_0x35fe7e)[_0x06ac('0x23')](handleEntityNotFound(_0x1e7561,null))[_0x06ac('0x23')](respondWithResult(_0x1e7561,null))[_0x06ac('0x3f')](handleError(_0x1e7561,null));};exports[_0x06ac('0x43')]=function(_0x28dc9e,_0x5495d6){return db[_0x06ac('0x2a')][_0x06ac('0x43')](_0x28dc9e[_0x06ac('0x44')],{})[_0x06ac('0x23')](respondWithResult(_0x5495d6,0xc9))['catch'](handleError(_0x5495d6,null));};exports['update']=function(_0xca4a83,_0x519a8e){if(_0xca4a83[_0x06ac('0x44')]['id']){delete _0xca4a83['body']['id'];}return db[_0x06ac('0x2a')][_0x06ac('0x45')]({'where':{'id':_0xca4a83[_0x06ac('0x41')]['id']}})[_0x06ac('0x23')](handleEntityNotFound(_0x519a8e,null))[_0x06ac('0x23')](saveUpdates(_0xca4a83[_0x06ac('0x44')],null))[_0x06ac('0x23')](respondWithResult(_0x519a8e,null))['catch'](handleError(_0x519a8e,null));};exports[_0x06ac('0x24')]=function(_0x534d2f,_0x584fb3){return db[_0x06ac('0x2a')][_0x06ac('0x45')]({'where':{'id':_0x534d2f['params']['id']}})[_0x06ac('0x23')](handleEntityNotFound(_0x584fb3,null))[_0x06ac('0x23')](removeEntity(_0x584fb3,null))[_0x06ac('0x3f')](handleError(_0x584fb3,null));};
\ No newline at end of file
+var _0x3c65=['filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x63f885,_0x2bc14d){var _0x579238=function(_0x307387){while(--_0x307387){_0x63f885['push'](_0x63f885['shift']());}};_0x579238(++_0x2bc14d);}(_0x3c65,0xf2));var _0x53c6=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0x3c65[_0x836465];return _0x2150ea;};'use strict';var emlformat=require(_0x53c6('0x0'));var rimraf=require(_0x53c6('0x1'));var zipdir=require(_0x53c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x53c6('0x3'));var moment=require(_0x53c6('0x4'));var BPromise=require(_0x53c6('0x5'));var Mustache=require('mustache');var util=require(_0x53c6('0x6'));var path=require(_0x53c6('0x7'));var sox=require(_0x53c6('0x8'));var csv=require(_0x53c6('0x9'));var ejs=require(_0x53c6('0xa'));var fs=require('fs');var fs_extra=require(_0x53c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53c6('0xc'));var toCsv=require(_0x53c6('0x9'));var querystring=require(_0x53c6('0xd'));var Papa=require(_0x53c6('0xe'));var Redis=require('ioredis');var authService=require(_0x53c6('0xf'));var qs=require(_0x53c6('0x10'));var as=require(_0x53c6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53c6('0x12'))(_0x53c6('0x13'));var utils=require(_0x53c6('0x14'));var config=require(_0x53c6('0x15'));var licenseUtil=require(_0x53c6('0x16'));var db=require(_0x53c6('0x17'))['db'];function respondWithStatusCode(_0x10cbd5,_0x5b9a38){_0x5b9a38=_0x5b9a38||0xcc;return function(_0xff849b){if(_0xff849b){return _0x10cbd5[_0x53c6('0x18')](_0x5b9a38);}return _0x10cbd5[_0x53c6('0x19')](_0x5b9a38)[_0x53c6('0x1a')]();};}function respondWithResult(_0x52508d,_0x2f452e){_0x2f452e=_0x2f452e||0xc8;return function(_0x97987a){if(_0x97987a){return _0x52508d[_0x53c6('0x19')](_0x2f452e)[_0x53c6('0x1b')](_0x97987a);}};}function respondWithFilteredResult(_0x54142d,_0x34f5c6){return function(_0x8e5579){if(_0x8e5579){var _0x1b95bf=typeof _0x34f5c6[_0x53c6('0x1c')]===_0x53c6('0x1d')&&typeof _0x34f5c6['limit']===_0x53c6('0x1d');var _0x25a4a5=_0x8e5579[_0x53c6('0x1e')];var _0x50032e=_0x1b95bf?0x0:_0x34f5c6['offset'];var _0x5d1a6d=_0x1b95bf?_0x8e5579[_0x53c6('0x1e')]:_0x34f5c6['offset']+_0x34f5c6[_0x53c6('0x1f')];var _0x145b67;if(_0x5d1a6d>=_0x25a4a5){_0x5d1a6d=_0x25a4a5;_0x145b67=0xc8;}else{_0x145b67=0xce;}_0x54142d[_0x53c6('0x19')](_0x145b67);return _0x54142d[_0x53c6('0x20')](_0x53c6('0x21'),_0x50032e+'-'+_0x5d1a6d+'/'+_0x25a4a5)[_0x53c6('0x1b')](_0x8e5579);}return null;};}function patchUpdates(_0x1537b1){return function(_0x4d162a){try{jsonpatch[_0x53c6('0x22')](_0x4d162a,_0x1537b1,!![]);}catch(_0x423067){return BPromise[_0x53c6('0x23')](_0x423067);}return _0x4d162a[_0x53c6('0x24')]();};}function saveUpdates(_0x40b34f,_0x125895){return function(_0x8d88f5){if(_0x8d88f5){return _0x8d88f5[_0x53c6('0x25')](_0x40b34f)['then'](function(_0x7f644f){return _0x7f644f;});}return null;};}function removeEntity(_0x161946,_0x5ad447){return function(_0x5d99c7){if(_0x5d99c7){return _0x5d99c7[_0x53c6('0x26')]()[_0x53c6('0x27')](function(){_0x161946['status'](0xcc)[_0x53c6('0x1a')]();});}};}function handleEntityNotFound(_0x13b634,_0x11294d){return function(_0xeb2d3c){if(!_0xeb2d3c){_0x13b634['sendStatus'](0x194);}return _0xeb2d3c;};}function handleError(_0x436dce,_0x252a9e){_0x252a9e=_0x252a9e||0x1f4;return function(_0x2bdceb){logger['error'](_0x2bdceb[_0x53c6('0x28')]);if(_0x2bdceb[_0x53c6('0x29')]){delete _0x2bdceb[_0x53c6('0x29')];}_0x436dce[_0x53c6('0x19')](_0x252a9e)[_0x53c6('0x2a')](_0x2bdceb);};}exports[_0x53c6('0x2b')]=function(_0x4aabc1,_0x649caf){var _0x2b3e09={},_0x5424e3={},_0x222851={'count':0x0,'rows':[]};var _0x555642=_[_0x53c6('0x2c')](db[_0x53c6('0x2d')]['rawAttributes'],function(_0x35ad2f){return{'name':_0x35ad2f[_0x53c6('0x2e')],'type':_0x35ad2f[_0x53c6('0x2f')][_0x53c6('0x30')]};});_0x5424e3[_0x53c6('0x31')]=_[_0x53c6('0x2c')](_0x555642,'name');_0x5424e3[_0x53c6('0x32')]=_[_0x53c6('0x33')](_0x4aabc1['query']);_0x5424e3[_0x53c6('0x34')]=_[_0x53c6('0x35')](_0x5424e3[_0x53c6('0x31')],_0x5424e3[_0x53c6('0x32')]);_0x2b3e09['attributes']=_['intersection'](_0x5424e3[_0x53c6('0x31')],qs['fields'](_0x4aabc1['query'][_0x53c6('0x36')]));_0x2b3e09['attributes']=_0x2b3e09[_0x53c6('0x37')][_0x53c6('0x38')]?_0x2b3e09[_0x53c6('0x37')]:_0x5424e3[_0x53c6('0x31')];if(!_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x39')]('nolimit')){_0x2b3e09[_0x53c6('0x1f')]=qs[_0x53c6('0x1f')](_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x1f')]);_0x2b3e09['offset']=qs[_0x53c6('0x1c')](_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x1c')]);}_0x2b3e09[_0x53c6('0x3a')]=qs[_0x53c6('0x3b')](_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x3b')]);_0x2b3e09[_0x53c6('0x3c')]=qs[_0x53c6('0x34')](_[_0x53c6('0x3d')](_0x4aabc1['query'],_0x5424e3['filters']),_0x555642);if(_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x3e')]){_0x2b3e09[_0x53c6('0x3c')]=_['merge'](_0x2b3e09[_0x53c6('0x3c')],{'$or':_['map'](_0x555642,function(_0x4d9f36){if(_0x4d9f36['type']!==_0x53c6('0x3f')){var _0x431330={};_0x431330[_0x4d9f36[_0x53c6('0x29')]]={'$like':'%'+_0x4aabc1[_0x53c6('0x32')]['filter']+'%'};return _0x431330;}})});}_0x2b3e09=_[_0x53c6('0x40')]({},_0x2b3e09,_0x4aabc1['options']);var _0x106b3b={'where':_0x2b3e09['where']};return db[_0x53c6('0x2d')][_0x53c6('0x1e')](_0x106b3b)['then'](function(_0x480364){_0x222851['count']=_0x480364;if(_0x4aabc1[_0x53c6('0x32')][_0x53c6('0x41')]){_0x2b3e09['include']=[{'all':!![]}];}return db[_0x53c6('0x2d')][_0x53c6('0x42')](_0x2b3e09);})[_0x53c6('0x27')](function(_0x5db02e){_0x222851[_0x53c6('0x43')]=_0x5db02e;return _0x222851;})[_0x53c6('0x27')](respondWithFilteredResult(_0x649caf,_0x2b3e09))[_0x53c6('0x44')](handleError(_0x649caf,null));};exports[_0x53c6('0x45')]=function(_0x269d12,_0x4b09eb){var _0x3456aa={'raw':!![],'where':{'id':_0x269d12[_0x53c6('0x46')]['id']}},_0x204b12={};_0x204b12[_0x53c6('0x31')]=_[_0x53c6('0x33')](db[_0x53c6('0x2d')][_0x53c6('0x47')]);_0x204b12[_0x53c6('0x32')]=_[_0x53c6('0x33')](_0x269d12[_0x53c6('0x32')]);_0x204b12['filters']=_[_0x53c6('0x35')](_0x204b12[_0x53c6('0x31')],_0x204b12[_0x53c6('0x32')]);_0x3456aa['attributes']=_[_0x53c6('0x35')](_0x204b12['model'],qs[_0x53c6('0x36')](_0x269d12[_0x53c6('0x32')]['fields']));_0x3456aa['attributes']=_0x3456aa[_0x53c6('0x37')][_0x53c6('0x38')]?_0x3456aa['attributes']:_0x204b12[_0x53c6('0x31')];if(_0x269d12[_0x53c6('0x32')][_0x53c6('0x41')]){_0x3456aa['include']=[{'all':!![]}];}_0x3456aa=_[_0x53c6('0x40')]({},_0x3456aa,_0x269d12[_0x53c6('0x48')]);return db[_0x53c6('0x2d')][_0x53c6('0x49')](_0x3456aa)['then'](handleEntityNotFound(_0x4b09eb,null))[_0x53c6('0x27')](respondWithResult(_0x4b09eb,null))['catch'](handleError(_0x4b09eb,null));};exports[_0x53c6('0x4a')]=function(_0x328e64,_0x13e17e){return db[_0x53c6('0x2d')]['create'](_0x328e64['body'],{})['then'](respondWithResult(_0x13e17e,0xc9))[_0x53c6('0x44')](handleError(_0x13e17e,null));};exports[_0x53c6('0x25')]=function(_0x4f4fb3,_0x1b2c22){if(_0x4f4fb3[_0x53c6('0x4b')]['id']){delete _0x4f4fb3[_0x53c6('0x4b')]['id'];}return db[_0x53c6('0x2d')][_0x53c6('0x49')]({'where':{'id':_0x4f4fb3[_0x53c6('0x46')]['id']}})[_0x53c6('0x27')](handleEntityNotFound(_0x1b2c22,null))[_0x53c6('0x27')](saveUpdates(_0x4f4fb3['body'],null))[_0x53c6('0x27')](respondWithResult(_0x1b2c22,null))[_0x53c6('0x44')](handleError(_0x1b2c22,null));};exports[_0x53c6('0x26')]=function(_0x29ec15,_0x5ec2cb){return db['VoiceQueuesLog'][_0x53c6('0x49')]({'where':{'id':_0x29ec15[_0x53c6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ec2cb,null))['then'](removeEntity(_0x5ec2cb,null))[_0x53c6('0x44')](handleError(_0x5ec2cb,null));};
\ No newline at end of file
index 9d02142..9834105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9306=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','event_dtm','event','util','api','moment'];(function(_0x564984,_0x2f5353){var _0x2ad51b=function(_0x12baa6){while(--_0x12baa6){_0x564984['push'](_0x564984['shift']());}};_0x2ad51b(++_0x2f5353);}(_0x9306,0x176));var _0x6930=function(_0x10f822,_0x20d5b8){_0x10f822=_0x10f822-0x0;var _0x577e81=_0x9306[_0x10f822];return _0x577e81;};'use strict';var _=require('lodash');var util=require(_0x6930('0x0'));var logger=require('../../config/logger')(_0x6930('0x1'));var moment=require(_0x6930('0x2'));var BPromise=require(_0x6930('0x3'));var rp=require(_0x6930('0x4'));var fs=require('fs');var path=require(_0x6930('0x5'));var rimraf=require(_0x6930('0x6'));var config=require(_0x6930('0x7'));var attributes=require(_0x6930('0x8'));module[_0x6930('0x9')]=function(_0x20ab2a,_0x4d56fd){return _0x20ab2a['define'](_0x6930('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x6930('0xb'),'fields':[_0x6930('0xc'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0x5a1f=['path','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58466c,_0x21a1d4){var _0x19c0f4=function(_0x3230b8){while(--_0x3230b8){_0x58466c['push'](_0x58466c['shift']());}};_0x19c0f4(++_0x21a1d4);}(_0x5a1f,0x1ba));var _0xf5a1=function(_0x4702c4,_0x408c98){_0x4702c4=_0x4702c4-0x0;var _0x4437cd=_0x5a1f[_0x4702c4];return _0x4437cd;};'use strict';var _=require('lodash');var util=require(_0xf5a1('0x0'));var logger=require(_0xf5a1('0x1'))(_0xf5a1('0x2'));var moment=require(_0xf5a1('0x3'));var BPromise=require(_0xf5a1('0x4'));var rp=require(_0xf5a1('0x5'));var fs=require('fs');var path=require(_0xf5a1('0x6'));var rimraf=require('rimraf');var config=require(_0xf5a1('0x7'));var attributes=require(_0xf5a1('0x8'));module['exports']=function(_0x30bc64,_0x5774ba){return _0x30bc64[_0xf5a1('0x9')](_0xf5a1('0xa'),attributes,{'tableName':_0xf5a1('0xb'),'paranoid':![],'indexes':[{'name':_0xf5a1('0xc'),'fields':['event',_0xf5a1('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index e13c247..98a6529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc14d=['client','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xc14d,0x1ea));var _0xdc14=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc14d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdc14('0x0'));var BPromise=require(_0xdc14('0x1'));var rs=require(_0xdc14('0x2'));var fs=require('fs');var Redis=require(_0xdc14('0x3'));var db=require(_0xdc14('0x4'))['db'];var utils=require(_0xdc14('0x5'));var logger=require(_0xdc14('0x6'))(_0xdc14('0x7'));var config=require(_0xdc14('0x8'));var jayson=require(_0xdc14('0x9'));var client=jayson[_0xdc14('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccbeb,_0x5ea03a,_0x640301){return new BPromise(function(_0x17f400,_0xeed4e1){return client['request'](_0x3ccbeb,_0x640301)[_0xdc14('0xb')](function(_0x116341){logger[_0xdc14('0xc')](_0xdc14('0xd'),_0x5ea03a,'request\x20sent');logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5ea03a,_0xdc14('0xe'),JSON[_0xdc14('0xf')](_0x116341));if(_0x116341[_0xdc14('0x10')]){if(_0x116341['error'][_0xdc14('0x11')]===0x1f4){logger[_0xdc14('0x10')](_0xdc14('0xd'),_0x5ea03a,_0x116341['error'][_0xdc14('0x12')]);return _0xeed4e1(_0x116341[_0xdc14('0x10')]['message']);}logger['error'](_0xdc14('0xd'),_0x5ea03a,_0x116341['error']['message']);return _0x17f400(_0x116341[_0xdc14('0x10')]['message']);}else{logger[_0xdc14('0xc')](_0xdc14('0xd'),_0x5ea03a,'request\x20sent');_0x17f400(_0x116341[_0xdc14('0x13')][_0xdc14('0x12')]);}})['catch'](function(_0x329506){logger[_0xdc14('0x10')](_0xdc14('0xd'),_0x5ea03a,_0x329506);_0xeed4e1(_0x329506);});});}
\ No newline at end of file
+var _0xf951=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','util'];(function(_0x564f19,_0x185c9f){var _0x2ffdcb=function(_0x2db9e4){while(--_0x2db9e4){_0x564f19['push'](_0x564f19['shift']());}};_0x2ffdcb(++_0x185c9f);}(_0xf951,0x1f3));var _0x1f95=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0xf951[_0x5f49c0];return _0x5ab653;};'use strict';var _=require('lodash');var util=require(_0x1f95('0x0'));var moment=require('moment');var BPromise=require(_0x1f95('0x1'));var rs=require(_0x1f95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f95('0x3'))['db'];var utils=require(_0x1f95('0x4'));var logger=require(_0x1f95('0x5'))(_0x1f95('0x6'));var config=require('../../config/environment');var jayson=require(_0x1f95('0x7'));var client=jayson[_0x1f95('0x8')][_0x1f95('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28c3fc,_0x38235b,_0x2a0faf){return new BPromise(function(_0x22cd65,_0x239305){return client[_0x1f95('0xa')](_0x28c3fc,_0x2a0faf)[_0x1f95('0xb')](function(_0x5a74c2){logger['info'](_0x1f95('0xc'),_0x38235b,'request\x20sent');logger['debug'](_0x1f95('0xd'),_0x38235b,'request\x20sent',JSON[_0x1f95('0xe')](_0x5a74c2));if(_0x5a74c2[_0x1f95('0xf')]){if(_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x10')]===0x1f4){logger[_0x1f95('0xf')](_0x1f95('0xc'),_0x38235b,_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);return _0x239305(_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);}logger['error'](_0x1f95('0xc'),_0x38235b,_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);return _0x22cd65(_0x5a74c2[_0x1f95('0xf')][_0x1f95('0x11')]);}else{logger['info'](_0x1f95('0xc'),_0x38235b,_0x1f95('0x12'));_0x22cd65(_0x5a74c2['result']['message']);}})[_0x1f95('0x13')](function(_0x2175a6){logger[_0x1f95('0xf')](_0x1f95('0xc'),_0x38235b,_0x2175a6);_0x239305(_0x2175a6);});});}
\ No newline at end of file
index 3809113..5ec2def 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x226f=['post','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x226f,0x10b));var _0xf226=function(_0x28bf79,_0x58c416){_0x28bf79=_0x28bf79-0x0;var _0x1b05fd=_0x226f[_0x28bf79];return _0x1b05fd;};'use strict';var multer=require('multer');var util=require(_0xf226('0x0'));var path=require(_0xf226('0x1'));var timeout=require(_0xf226('0x2'));var express=require(_0xf226('0x3'));var router=express[_0xf226('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf226('0x5'));var interaction=require(_0xf226('0x6'));var config=require(_0xf226('0x7'));var controller=require(_0xf226('0x8'));router['get']('/',auth[_0xf226('0x9')](),controller[_0xf226('0xa')]);router[_0xf226('0xb')](_0xf226('0xc'),auth[_0xf226('0x9')](),controller[_0xf226('0xd')]);router['get'](_0xf226('0xe'),auth[_0xf226('0x9')](),controller[_0xf226('0xf')]);router[_0xf226('0xb')](_0xf226('0x10'),auth[_0xf226('0x9')](),controller[_0xf226('0x11')]);router[_0xf226('0xb')](_0xf226('0x12'),controller[_0xf226('0x13')]);router['get'](_0xf226('0x14'),auth[_0xf226('0x9')](),controller['downloadTranscribe']);router[_0xf226('0x15')]('/',auth[_0xf226('0x9')](),controller['create']);router[_0xf226('0x15')](_0xf226('0x14'),auth['isAuthenticated'](),controller['runTranscribe']);router['put'](_0xf226('0xe'),auth[_0xf226('0x9')](),controller[_0xf226('0x16')]);router['delete'](_0xf226('0xe'),auth[_0xf226('0x9')](),controller[_0xf226('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x58b8=['isAuthenticated','index','/describe','describe','/:id','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x199278,_0x5721f7){var _0x3751bf=function(_0x345842){while(--_0x345842){_0x199278['push'](_0x199278['shift']());}};_0x3751bf(++_0x5721f7);}(_0x58b8,0x153));var _0x858b=function(_0x451402,_0x561cb8){_0x451402=_0x451402-0x0;var _0x4ffb7f=_0x58b8[_0x451402];return _0x4ffb7f;};'use strict';var multer=require(_0x858b('0x0'));var util=require(_0x858b('0x1'));var path=require(_0x858b('0x2'));var timeout=require(_0x858b('0x3'));var express=require(_0x858b('0x4'));var router=express['Router']();var fs_extra=require(_0x858b('0x5'));var auth=require(_0x858b('0x6'));var interaction=require(_0x858b('0x7'));var config=require(_0x858b('0x8'));var controller=require(_0x858b('0x9'));router[_0x858b('0xa')]('/',auth[_0x858b('0xb')](),controller[_0x858b('0xc')]);router[_0x858b('0xa')](_0x858b('0xd'),auth[_0x858b('0xb')](),controller[_0x858b('0xe')]);router[_0x858b('0xa')](_0x858b('0xf'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x858b('0xb')](),controller[_0x858b('0x10')]);router['get'](_0x858b('0x11'),controller[_0x858b('0x12')]);router[_0x858b('0xa')](_0x858b('0x13'),auth[_0x858b('0xb')](),controller[_0x858b('0x14')]);router[_0x858b('0x15')]('/',auth[_0x858b('0xb')](),controller['create']);router['post']('/:id/transcribe',auth[_0x858b('0xb')](),controller['runTranscribe']);router[_0x858b('0x16')](_0x858b('0xf'),auth[_0x858b('0xb')](),controller[_0x858b('0x17')]);router[_0x858b('0x18')](_0x858b('0xf'),auth[_0x858b('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 3571104..0f16469 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 8f619ae..72fc840 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2d8=['destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','downloads','sequelize','MD5','col','$and','push','extname','isNil','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','upload','TranscribeService','basename','readFileSync','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Sequelize','Setting','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf2d8,0x6e));var _0x8f2d=function(_0x2b8f2b,_0x3e41ac){_0x2b8f2b=_0x2b8f2b-0x0;var _0x12b3ff=_0xf2d8[_0x2b8f2b];return _0x12b3ff;};'use strict';var emlformat=require(_0x8f2d('0x0'));var rimraf=require(_0x8f2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8f2d('0x2'));var rp=require(_0x8f2d('0x3'));var moment=require('moment');var BPromise=require(_0x8f2d('0x4'));var Mustache=require(_0x8f2d('0x5'));var util=require(_0x8f2d('0x6'));var path=require(_0x8f2d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f2d('0x8'));var _=require(_0x8f2d('0x9'));var squel=require(_0x8f2d('0xa'));var crypto=require(_0x8f2d('0xb'));var jsforce=require(_0x8f2d('0xc'));var deskjs=require(_0x8f2d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f2d('0xe'));var AWS=require(_0x8f2d('0xf'));var uuidv4=require(_0x8f2d('0x10'));var Redis=require(_0x8f2d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8f2d('0x12'));var as=require(_0x8f2d('0x13'));var hardwareService=require(_0x8f2d('0x14'));var logger=require('../../config/logger')(_0x8f2d('0x15'));var utils=require(_0x8f2d('0x16'));var config=require(_0x8f2d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8f2d('0x18'))['db'];function respondWithStatusCode(_0x212f75,_0xa938f1){_0xa938f1=_0xa938f1||0xcc;return function(_0x3a4e14){if(_0x3a4e14){return _0x212f75[_0x8f2d('0x19')](_0xa938f1);}return _0x212f75[_0x8f2d('0x1a')](_0xa938f1)[_0x8f2d('0x1b')]();};}function respondWithResult(_0x23af84,_0x3dd7bf){_0x3dd7bf=_0x3dd7bf||0xc8;return function(_0x5cf234){if(_0x5cf234){return _0x23af84['status'](_0x3dd7bf)[_0x8f2d('0x1c')](_0x5cf234);}};}function respondWithFilteredResult(_0x448171,_0x107144){return function(_0x3ef435){if(_0x3ef435){var _0x48245f=typeof _0x107144[_0x8f2d('0x1d')]===_0x8f2d('0x1e')&&typeof _0x107144[_0x8f2d('0x1f')]==='undefined';var _0x411229=_0x3ef435[_0x8f2d('0x20')];var _0x3cdd34=_0x48245f?0x0:_0x107144[_0x8f2d('0x1d')];var _0x552122=_0x48245f?_0x3ef435[_0x8f2d('0x20')]:_0x107144[_0x8f2d('0x1d')]+_0x107144[_0x8f2d('0x1f')];var _0x11521f;if(_0x552122>=_0x411229){_0x552122=_0x411229;_0x11521f=0xc8;}else{_0x11521f=0xce;}_0x448171[_0x8f2d('0x1a')](_0x11521f);return _0x448171[_0x8f2d('0x21')]('Content-Range',_0x3cdd34+'-'+_0x552122+'/'+_0x411229)[_0x8f2d('0x1c')](_0x3ef435);}return null;};}function patchUpdates(_0x528c91){return function(_0x257782){try{jsonpatch[_0x8f2d('0x22')](_0x257782,_0x528c91,!![]);}catch(_0x2aa127){return BPromise[_0x8f2d('0x23')](_0x2aa127);}return _0x257782[_0x8f2d('0x24')]();};}function saveUpdates(_0x2ee621,_0x236be0){return function(_0x160328){if(_0x160328){return _0x160328[_0x8f2d('0x25')](_0x2ee621)[_0x8f2d('0x26')](function(_0x3c5841){return _0x3c5841;});}return null;};}function removeEntity(_0x29255c,_0x422cc4){return function(_0x459a72){if(_0x459a72){return _0x459a72[_0x8f2d('0x27')]()['then'](function(){_0x29255c['status'](0xcc)[_0x8f2d('0x1b')]();});}};}function handleEntityNotFound(_0x201e0b,_0x451984){return function(_0x235494){if(!_0x235494){_0x201e0b[_0x8f2d('0x19')](0x194);}return _0x235494;};}function handleError(_0x8308fa,_0x462b68){_0x462b68=_0x462b68||0x1f4;return function(_0x30d58e){logger['error'](_0x30d58e[_0x8f2d('0x28')]);if(_0x30d58e[_0x8f2d('0x29')]){delete _0x30d58e[_0x8f2d('0x29')];}_0x8308fa[_0x8f2d('0x1a')](_0x462b68)[_0x8f2d('0x2a')](_0x30d58e);};}exports[_0x8f2d('0x2b')]=function(_0x299164,_0x2134d1){var _0x46a3d8={},_0x443c29={},_0x3b37c3={'count':0x0,'rows':[]};var _0x1e7ccc=_[_0x8f2d('0x2c')](db[_0x8f2d('0x2d')][_0x8f2d('0x2e')],function(_0x144938){return{'name':_0x144938[_0x8f2d('0x2f')],'type':_0x144938['type'][_0x8f2d('0x30')]};});_0x443c29[_0x8f2d('0x31')]=_[_0x8f2d('0x32')](_['map'](_0x1e7ccc,'name'),['format']);_0x443c29[_0x8f2d('0x33')]=_[_0x8f2d('0x34')](_0x299164[_0x8f2d('0x33')]);_0x443c29[_0x8f2d('0x35')]=_[_0x8f2d('0x36')](_0x443c29[_0x8f2d('0x31')],_0x443c29[_0x8f2d('0x33')]);_0x46a3d8[_0x8f2d('0x37')]=_[_0x8f2d('0x36')](_0x443c29[_0x8f2d('0x31')],qs[_0x8f2d('0x38')](_0x299164[_0x8f2d('0x33')][_0x8f2d('0x38')]));_0x46a3d8['attributes']=_0x46a3d8[_0x8f2d('0x37')]['length']?_0x46a3d8[_0x8f2d('0x37')]:_0x443c29[_0x8f2d('0x31')];if(!_0x299164['query'][_0x8f2d('0x39')](_0x8f2d('0x3a'))){_0x46a3d8['limit']=qs['limit'](_0x299164[_0x8f2d('0x33')]['limit']);_0x46a3d8[_0x8f2d('0x1d')]=qs[_0x8f2d('0x1d')](_0x299164[_0x8f2d('0x33')][_0x8f2d('0x1d')]);}_0x46a3d8['order']=qs[_0x8f2d('0x3b')](_0x299164[_0x8f2d('0x33')][_0x8f2d('0x3b')]);_0x46a3d8['where']=qs['filters'](_['pick'](_0x299164[_0x8f2d('0x33')],_0x443c29['filters']),_0x1e7ccc);if(_0x299164[_0x8f2d('0x33')][_0x8f2d('0x3c')]){_0x46a3d8['where']=_['merge'](_0x46a3d8[_0x8f2d('0x3d')],{'$or':_[_0x8f2d('0x2c')](_0x1e7ccc,function(_0x3ae3e5){if(_0x3ae3e5['type']!==_0x8f2d('0x3e')){var _0x2a198d={};_0x2a198d[_0x3ae3e5[_0x8f2d('0x29')]]={'$like':'%'+_0x299164[_0x8f2d('0x33')][_0x8f2d('0x3c')]+'%'};return _0x2a198d;}})});}_0x46a3d8=_[_0x8f2d('0x3f')]({},_0x46a3d8,_0x299164[_0x8f2d('0x40')]);var _0x2bce2b={'where':_0x46a3d8[_0x8f2d('0x3d')]};return db[_0x8f2d('0x2d')][_0x8f2d('0x20')](_0x2bce2b)[_0x8f2d('0x26')](function(_0x5964da){_0x3b37c3['count']=_0x5964da;if(_0x299164['query'][_0x8f2d('0x41')]){_0x46a3d8[_0x8f2d('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8f2d('0x43')](_0x46a3d8);})[_0x8f2d('0x26')](function(_0x57138b){_0x3b37c3[_0x8f2d('0x44')]=_0x57138b;return _0x3b37c3;})[_0x8f2d('0x26')](respondWithFilteredResult(_0x2134d1,_0x46a3d8))[_0x8f2d('0x45')](handleError(_0x2134d1,null));};exports[_0x8f2d('0x46')]=function(_0x4472c9,_0x389771){var _0x181172={'raw':![],'where':{'id':_0x4472c9[_0x8f2d('0x47')]['id']}},_0x285773={};_0x285773[_0x8f2d('0x31')]=_[_0x8f2d('0x34')](db[_0x8f2d('0x2d')][_0x8f2d('0x2e')]);_0x285773[_0x8f2d('0x33')]=_['keys'](_0x4472c9[_0x8f2d('0x33')]);_0x285773['filters']=_[_0x8f2d('0x36')](_0x285773[_0x8f2d('0x31')],_0x285773[_0x8f2d('0x33')]);_0x181172[_0x8f2d('0x37')]=_[_0x8f2d('0x36')](_0x285773[_0x8f2d('0x31')],qs[_0x8f2d('0x38')](_0x4472c9[_0x8f2d('0x33')]['fields']));_0x181172[_0x8f2d('0x37')]=_0x181172[_0x8f2d('0x37')][_0x8f2d('0x48')]?_0x181172[_0x8f2d('0x37')]:_0x285773[_0x8f2d('0x31')];if(_0x4472c9[_0x8f2d('0x33')][_0x8f2d('0x41')]){_0x181172[_0x8f2d('0x42')]=[{'all':!![]}];}_0x181172=_[_0x8f2d('0x3f')]({},_0x181172,_0x4472c9['options']);return db[_0x8f2d('0x2d')][_0x8f2d('0x49')](_0x181172)[_0x8f2d('0x26')](handleEntityNotFound(_0x389771,null))[_0x8f2d('0x26')](respondWithResult(_0x389771,null))['catch'](handleError(_0x389771,null));};exports['create']=function(_0x1ded49,_0x8e2316){return db['VoiceRecording'][_0x8f2d('0x4a')](_0x1ded49[_0x8f2d('0x4b')],{})['then'](respondWithResult(_0x8e2316,0xc9))[_0x8f2d('0x45')](handleError(_0x8e2316,null));};exports[_0x8f2d('0x25')]=function(_0x2f66ee,_0x4dfe59){if(_0x2f66ee['body']['id']){delete _0x2f66ee[_0x8f2d('0x4b')]['id'];}return db['VoiceRecording'][_0x8f2d('0x49')]({'where':{'id':_0x2f66ee[_0x8f2d('0x47')]['id']}})[_0x8f2d('0x26')](handleEntityNotFound(_0x4dfe59,null))[_0x8f2d('0x26')](saveUpdates(_0x2f66ee[_0x8f2d('0x4b')],null))['then'](respondWithResult(_0x4dfe59,null))[_0x8f2d('0x45')](handleError(_0x4dfe59,null));};exports[_0x8f2d('0x4c')]=function(_0x296e1a,_0x554efb){return db[_0x8f2d('0x2d')][_0x8f2d('0x4c')]()[_0x8f2d('0x26')](respondWithResult(_0x554efb,null))[_0x8f2d('0x45')](handleError(_0x554efb,null));};exports[_0x8f2d('0x4d')]=function(_0x112c92,_0x50927b,_0x53f61b){var _0x543991=require(_0x8f2d('0x4e'));var _0xe33c1d=![];var _0x588b0b={};if(_0x112c92[_0x8f2d('0x33')]['type']&&_0x112c92[_0x8f2d('0x33')]['type']==='uniqueid'){_0x588b0b[_0x8f2d('0x4f')]=_0x112c92[_0x8f2d('0x47')]['id'];}else{_0x588b0b['id']=_0x112c92[_0x8f2d('0x47')]['id'];}return db['VoiceRecording'][_0x8f2d('0x49')]({'where':_0x588b0b,'attributes':['id',_0x8f2d('0x50')],'raw':!![]})[_0x8f2d('0x26')](handleEntityNotFound(_0x50927b,null))[_0x8f2d('0x26')](function(_0x39bbd7){if(_0x39bbd7){var _0x31ed8b=_0x39bbd7[_0x8f2d('0x50')];var _0x454dd7=util[_0x8f2d('0x51')](_0x8f2d('0x52'),_0x31ed8b);if(fs[_0x8f2d('0x53')](_0x454dd7)){_0xe33c1d=!![];return _0x543991[_0x8f2d('0x54')](_0x454dd7,_0x31ed8b,config[_0x8f2d('0x55')][_0x8f2d('0x56')])[_0x8f2d('0x26')](function(){return _0x39bbd7;});}return _0x39bbd7;}})['then'](function(_0x5968a2){if(_0x5968a2){var _0x226f8a=_0x5968a2[_0x8f2d('0x50')];if(!fs[_0x8f2d('0x53')](_0x226f8a)){throw new db['Sequelize'][(_0x8f2d('0x57'))](_0x8f2d('0x58'));}if(_0x5968a2[_0x8f2d('0x59')]){return _0x50927b[_0x8f2d('0x4d')](_0x226f8a,_0x5968a2[_0x8f2d('0x59')]+path['extname'](_0x226f8a),function(){if(_0xe33c1d){fs[_0x8f2d('0x5a')](_0x226f8a);}});}else{return _0x50927b[_0x8f2d('0x4d')](_0x226f8a,function(_0x288dc7){if(_0xe33c1d){fs['unlink'](_0x226f8a);}});}}})['catch'](function(_0x49a1dc){if(_0x49a1dc['message']===_0x8f2d('0x58')){_0x50927b['status'](0x194)[_0x8f2d('0x2a')]('Not\x20found');}else{return handleError(_0x50927b,null);}});};exports[_0x8f2d('0x5b')]=function(_0x1971d6,_0x3a3a28,_0x576765){var _0x32c438=require(_0x8f2d('0x4e'));var _0x21ed5a=![];var _0x4a0ef5={'$and':[db[_0x8f2d('0x5c')][_0x8f2d('0x3d')](db[_0x8f2d('0x5c')]['fn'](_0x8f2d('0x5d'),db[_0x8f2d('0x5c')][_0x8f2d('0x5e')]('uniqueid')),_0x1971d6['query']['token'])]};if(_0x1971d6['query']['type']&&_0x1971d6['query']['type']===_0x8f2d('0x4f')){_0x4a0ef5[_0x8f2d('0x5f')][_0x8f2d('0x60')]({'uniqueid':_0x1971d6[_0x8f2d('0x47')]['id']});}else{_0x4a0ef5[_0x8f2d('0x5f')]['push']({'id':_0x1971d6['params']['id']});}return db[_0x8f2d('0x2d')][_0x8f2d('0x49')]({'where':_0x4a0ef5,'attributes':['id','value'],'raw':!![]})[_0x8f2d('0x26')](handleEntityNotFound(_0x3a3a28,null))['then'](function(_0x30e363){if(_0x30e363){var _0x2131e7=util[_0x8f2d('0x51')]('%s.cypher',_0x30e363[_0x8f2d('0x50')]);if(fs[_0x8f2d('0x53')](_0x2131e7)){_0x21ed5a=!![];return _0x32c438['decryptFile'](_0x2131e7,_0x30e363['value'],config[_0x8f2d('0x55')][_0x8f2d('0x56')])[_0x8f2d('0x26')](function(){return _0x30e363;});}return _0x30e363;}})[_0x8f2d('0x26')](function(_0xdb4ba3){if(_0xdb4ba3){if(!fs[_0x8f2d('0x53')](_0xdb4ba3[_0x8f2d('0x50')])){throw new db['Sequelize'][(_0x8f2d('0x57'))](_0x8f2d('0x58'));}if(_0xdb4ba3[_0x8f2d('0x59')]){return _0x3a3a28[_0x8f2d('0x4d')](_0xdb4ba3[_0x8f2d('0x50')],_0xdb4ba3[_0x8f2d('0x59')]+path[_0x8f2d('0x61')](_0xdb4ba3[_0x8f2d('0x50')]),function(){if(_0x21ed5a){fs[_0x8f2d('0x5a')](_0xdb4ba3[_0x8f2d('0x50')]);}});}else{return _0x3a3a28[_0x8f2d('0x4d')](_0xdb4ba3[_0x8f2d('0x50')],function(_0x3a61b5){if(_0x21ed5a){fs[_0x8f2d('0x5a')](_0xdb4ba3[_0x8f2d('0x50')]);}});}}})[_0x8f2d('0x45')](handleError(_0x3a3a28,null));};exports['destroy']=function(_0x287874,_0xecb90d){return db[_0x8f2d('0x2d')][_0x8f2d('0x49')]({'where':{'id':_0x287874['params']['id']}})['then'](function(_0xbf5a66){if(_[_0x8f2d('0x62')](_0xbf5a66)){throw new ReferenceError(_0x8f2d('0x63'));}return _0xbf5a66;})[_0x8f2d('0x26')](function(_0x2c4025){var _0x582315=_0x2c4025[_0x8f2d('0x50')];logger[_0x8f2d('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x582315);if(!_[_0x8f2d('0x62')](_0x2c4025[_0x8f2d('0x50')])&&fs[_0x8f2d('0x53')](_0x582315)){logger[_0x8f2d('0x64')](_0x8f2d('0x65')+_0x582315+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8f2d('0x66')](_0x582315);}_0x582315=_0x582315+_0x8f2d('0x67');if(!_[_0x8f2d('0x62')](_0x2c4025[_0x8f2d('0x50')])&&fs['existsSync'](_0x582315)){logger[_0x8f2d('0x64')]('File:\x20\x22'+_0x582315+_0x8f2d('0x68'));fs[_0x8f2d('0x66')](_0x582315);}return _0x2c4025;})[_0x8f2d('0x26')](function(_0x43f327){if(!_0x43f327)throw new InternalError();return _0x43f327[_0x8f2d('0x27')]();})['then'](function(){_0xecb90d[_0x8f2d('0x1a')](0xcc)[_0x8f2d('0x1b')]();})['catch'](handleError(_0xecb90d,null));};function getBucketslist(_0x4f3d08,_0x260fe6,_0x4f7535){return new Promise(function(_0x3ff8f3,_0x4cc772){var _0x3ab6b2=new AWS['S3']({'accessKeyId':_0x260fe6,'secretAccessKey':_0x4f3d08,'region':_0x4f7535});_0x3ab6b2[_0x8f2d('0x69')]({},function(_0x380926,_0x486b42){if(_0x380926){return _0x4cc772(_0x380926);}else{return _0x3ff8f3(_0x486b42);}});});}function createBucket(_0x419a2d,_0x4b97e4,_0x91e4fc,_0xc5deb9){return new Promise(function(_0x3798c2,_0x43d38d){var _0x4e6768=new AWS['S3']({'accessKeyId':_0x4b97e4,'secretAccessKey':_0x419a2d,'region':_0x91e4fc});_0x4e6768['createBucket']({'Bucket':_0xc5deb9},function(_0x15eb19,_0x3c97c9){if(_0x15eb19){return _0x43d38d(_0x15eb19);}else{return _0x3798c2(_0x3c97c9);}});});}function uploadFile(_0x2c1a7e,_0x13ae32,_0x45209f,_0x3f2fca,_0x4945b4,_0xcd0e57){return new Promise(function(_0x561a0c,_0x1231fe){var _0x41217e=new AWS['S3']({'accessKeyId':_0x13ae32,'secretAccessKey':_0x2c1a7e,'region':_0x45209f});_0x41217e[_0x8f2d('0x6a')]({'Bucket':_0x3f2fca,'Key':_0x4945b4,'Body':_0xcd0e57},function(_0x4d0426,_0x4e2ae5){if(_0x4d0426){return _0x1231fe(_0x4d0426);}else{return _0x561a0c(_0x4e2ae5);}});});}function startTranscribe(_0x41c73e,_0xbc8034,_0x2a6199,_0x10fb56,_0x18fbf5,_0x5ad553){return new Promise(function(_0x1ac445,_0x44618d){var _0x5e4ede=new AWS[(_0x8f2d('0x6b'))]({'accessKeyId':_0xbc8034,'secretAccessKey':_0x41c73e,'region':_0x2a6199});_0x5e4ede['startTranscriptionJob']({'TranscriptionJobName':_0x10fb56,'LanguageCode':_0x18fbf5,'Media':{'MediaFileUri':_0x5ad553}},function(_0x24115b,_0x21ae67){if(_0x24115b){return _0x44618d(_0x24115b);}else{return _0x1ac445(_0x21ae67);}});});}function transcribe(_0x394882,_0x1dec69,_0x41cd07,_0xd4bc20,_0x42775a,_0x5eed22,_0x5f2411){return new Promise(function(_0x6cb711,_0x417660){var _0x4d144b={};logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x394882,_0x42775a));return uploadFile(_0x1dec69,_0x41cd07,_0xd4bc20,_0x42775a,path[_0x8f2d('0x6c')](_0x5eed22),fs[_0x8f2d('0x6d')](_0x5eed22))[_0x8f2d('0x26')](function(_0x293f99){logger[_0x8f2d('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x394882,_0x42775a,_0x293f99[_0x8f2d('0x6e')]));_0x4d144b[_0x8f2d('0x6f')]=_0x293f99['Bucket'];_0x4d144b[_0x8f2d('0x70')]=_0x293f99[_0x8f2d('0x6e')];logger['info'](util[_0x8f2d('0x51')](_0x8f2d('0x71'),_0x394882));return startTranscribe(_0x1dec69,_0x41cd07,_0xd4bc20,uuidv4(),_0x5f2411,_0x293f99[_0x8f2d('0x6e')]);})[_0x8f2d('0x26')](function(_0x426726){logger['info'](util[_0x8f2d('0x51')](_0x8f2d('0x72'),_0x394882,_0x426726[_0x8f2d('0x73')][_0x8f2d('0x74')]));_0x4d144b[_0x8f2d('0x75')]=_0x426726[_0x8f2d('0x73')][_0x8f2d('0x74')];_0x4d144b[_0x8f2d('0x76')]=_0x426726[_0x8f2d('0x73')][_0x8f2d('0x77')];return _0x6cb711(_0x4d144b);})['catch'](function(_0x12e9a4){return _0x417660(_0x12e9a4);});});}exports[_0x8f2d('0x78')]=function(_0x40dcae,_0x2e3a55,_0x5efc8f){var _0x3363de;var _0x2c31f0;var _0x5c0a70;var _0x18fc26=require(_0x8f2d('0x4e'));return db[_0x8f2d('0x2d')][_0x8f2d('0x79')]({'where':{'id':_0x40dcae[_0x8f2d('0x47')]['id']}})[_0x8f2d('0x26')](function(_0xaedfb2){if(_0xaedfb2){var _0x594fc5=util[_0x8f2d('0x51')](_0x8f2d('0x52'),_0xaedfb2[_0x8f2d('0x50')]);if(fs[_0x8f2d('0x53')](_0x594fc5)){cypher=!![];return _0x18fc26['decryptFile'](_0x594fc5,_0xaedfb2[_0x8f2d('0x50')],config[_0x8f2d('0x55')]['recording'])['then'](function(){return _0xaedfb2;});}return _0xaedfb2;}})[_0x8f2d('0x26')](function(_0x52e8c6){if(!_0x52e8c6){throw new db[(_0x8f2d('0x7a'))][(_0x8f2d('0x57'))]('Voice\x20Recording\x20not\x20found');}_0x2c31f0=_0x52e8c6;return db[_0x8f2d('0x7b')][_0x8f2d('0x79')]({'where':{'id':0x1}});})[_0x8f2d('0x26')](handleEntityNotFound(_0x2e3a55,null))[_0x8f2d('0x26')](function(_0xd7b1be){if(_0xd7b1be){_0x3363de=_0xd7b1be;if(!_0x3363de[_0x8f2d('0x7c')]||!_0x3363de[_0x8f2d('0x7d')]||!_0x3363de[_0x8f2d('0x7e')]||!_0x3363de['language']||!_0x3363de[_0x8f2d('0x6f')]){throw new db[(_0x8f2d('0x7a'))][(_0x8f2d('0x57'))](_0x8f2d('0x7f'));}if(_0x40dcae['body'][_0x8f2d('0x80')]&&(!_0x3363de[_0x8f2d('0x81')]||!_0x3363de[_0x8f2d('0x82')]||!_0x3363de['sentimentRegion']||!_0x3363de[_0x8f2d('0x83')]||!_0x3363de[_0x8f2d('0x6f')])){throw new db[(_0x8f2d('0x7a'))]['ValidationError'](_0x8f2d('0x84'));}return db['CloudProvider']['findOne']({'where':{'id':_0x3363de[_0x8f2d('0x7d')]}});}})[_0x8f2d('0x26')](function(_0x5e6b0a){if(!_0x5e6b0a){throw new db[(_0x8f2d('0x7a'))][(_0x8f2d('0x57'))](_0x8f2d('0x85'));}if(!_0x5e6b0a[_0x8f2d('0x86')]||!_0x5e6b0a['data2']){throw new db[(_0x8f2d('0x7a'))][(_0x8f2d('0x57'))](_0x8f2d('0x87'));}_0x5c0a70=_0x5e6b0a;return getBucketslist(_0x5c0a70[_0x8f2d('0x86')],_0x5c0a70[_0x8f2d('0x88')],_0x3363de['transcribeRegion']);})[_0x8f2d('0x26')](function(_0x9b8ae1){if(_0x9b8ae1&&_0x9b8ae1[_0x8f2d('0x89')]){var _0x441c81=_[_0x8f2d('0x49')](_0x9b8ae1[_0x8f2d('0x89')],function(_0x50a95e){return _0x50a95e[_0x8f2d('0x8a')]===_0x3363de[_0x8f2d('0x6f')];});if(!_0x441c81){logger[_0x8f2d('0x64')](util[_0x8f2d('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x40dcae[_0x8f2d('0x47')]['id'],_0x3363de[_0x8f2d('0x6f')]));return createBucket(_0x5c0a70[_0x8f2d('0x86')],_0x5c0a70[_0x8f2d('0x88')],_0x3363de[_0x8f2d('0x7e')],_0x3363de[_0x8f2d('0x6f')]);}logger[_0x8f2d('0x64')](util[_0x8f2d('0x51')](_0x8f2d('0x8b'),_0x40dcae[_0x8f2d('0x47')]['id'],_0x3363de['bucket']));return;}})[_0x8f2d('0x26')](function(_0x26c6a0){if(_0x2c31f0[_0x8f2d('0x76')]==='NEW'){return transcribe(_0x40dcae[_0x8f2d('0x47')]['id'],_0x5c0a70[_0x8f2d('0x86')],_0x5c0a70[_0x8f2d('0x88')],_0x3363de[_0x8f2d('0x7e')],_0x3363de[_0x8f2d('0x6f')],_0x2c31f0[_0x8f2d('0x50')],_0x3363de[_0x8f2d('0x83')]);}else{logger[_0x8f2d('0x64')](util[_0x8f2d('0x51')](_0x8f2d('0x8c'),_0x40dcae[_0x8f2d('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x8f2d('0x26')](function(_0x85a6b9){if(_0x85a6b9){_0x85a6b9[_0x8f2d('0x8d')]=_0x40dcae[_0x8f2d('0x4b')][_0x8f2d('0x80')];return _0x2c31f0[_0x8f2d('0x8e')](_0x85a6b9);}})[_0x8f2d('0x26')](respondWithResult(_0x2e3a55,null))[_0x8f2d('0x45')](handleError(_0x2e3a55,null));};function writeFile(_0xc9e1a6,_0x5ac93f){return new Promise(function(_0x2ad2fc,_0x2c8007){fs[_0x8f2d('0x8f')](_0x5ac93f,_0xc9e1a6,function(_0x5d0e6f,_0x5c03ee){if(_0x5d0e6f){return _0x2c8007(_0x5d0e6f);}else{return _0x2ad2fc(_0x5c03ee);}});});}exports[_0x8f2d('0x90')]=function(_0x3c07e,_0x5d49fd,_0x2b3b89){return db['VoiceRecording'][_0x8f2d('0x79')]({'where':{'id':_0x3c07e[_0x8f2d('0x47')]['id']}})[_0x8f2d('0x26')](handleEntityNotFound(_0x5d49fd))[_0x8f2d('0x26')](function(_0xedd5d4){if(_0xedd5d4&&_0xedd5d4['fileText']){var _0x1663fa=_0xedd5d4[_0x8f2d('0x91')];var _0x2aa3db=config[_0x8f2d('0x92')]+_0x8f2d('0x93')+_0xedd5d4['id']+_0x8f2d('0x94');if(fs[_0x8f2d('0x53')](_0x2aa3db)){return _0x2aa3db;}return writeFile(_0x1663fa,_0x2aa3db)[_0x8f2d('0x26')](function(){return _0x2aa3db;});}else{throw new db[(_0x8f2d('0x7a'))][(_0x8f2d('0x57'))]('Transcript\x20not\x20available');}})['then'](function(_0x2b76fa){return _0x5d49fd[_0x8f2d('0x4d')](_0x2b76fa);})[_0x8f2d('0x45')](handleError(_0x5d49fd));};
\ No newline at end of file
+var _0xc7ba=['runTranscribe','findOne','%s.cypher','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','map','VoiceRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','params','rawAttributes','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','TranscriptionJob','TranscriptionJobStatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc7ba,0xb3));var _0xac7b=function(_0x34927a,_0x71fd97){_0x34927a=_0x34927a-0x0;var _0xf3d101=_0xc7ba[_0x34927a];return _0xf3d101;};'use strict';var emlformat=require(_0xac7b('0x0'));var rimraf=require(_0xac7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac7b('0x2'));var moment=require(_0xac7b('0x3'));var BPromise=require(_0xac7b('0x4'));var Mustache=require(_0xac7b('0x5'));var util=require(_0xac7b('0x6'));var path=require(_0xac7b('0x7'));var sox=require(_0xac7b('0x8'));var csv=require(_0xac7b('0x9'));var ejs=require(_0xac7b('0xa'));var fs=require('fs');var fs_extra=require(_0xac7b('0xb'));var _=require(_0xac7b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac7b('0xd'));var deskjs=require(_0xac7b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xac7b('0xf'));var Papa=require('papaparse');var AWS=require(_0xac7b('0x10'));var uuidv4=require(_0xac7b('0x11'));var Redis=require(_0xac7b('0x12'));var authService=require(_0xac7b('0x13'));var qs=require(_0xac7b('0x14'));var as=require(_0xac7b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac7b('0x16'))(_0xac7b('0x17'));var utils=require(_0xac7b('0x18'));var config=require(_0xac7b('0x19'));var licenseUtil=require(_0xac7b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49eb26,_0x36d203){_0x36d203=_0x36d203||0xcc;return function(_0x18caeb){if(_0x18caeb){return _0x49eb26[_0xac7b('0x1b')](_0x36d203);}return _0x49eb26[_0xac7b('0x1c')](_0x36d203)[_0xac7b('0x1d')]();};}function respondWithResult(_0x5a123a,_0xbdbef4){_0xbdbef4=_0xbdbef4||0xc8;return function(_0x50bd12){if(_0x50bd12){return _0x5a123a[_0xac7b('0x1c')](_0xbdbef4)[_0xac7b('0x1e')](_0x50bd12);}};}function respondWithFilteredResult(_0x532f8b,_0x2f436a){return function(_0x59d9de){if(_0x59d9de){var _0x59d6ae=typeof _0x2f436a[_0xac7b('0x1f')]===_0xac7b('0x20')&&typeof _0x2f436a[_0xac7b('0x21')]==='undefined';var _0x249590=_0x59d9de[_0xac7b('0x22')];var _0x15e5c6=_0x59d6ae?0x0:_0x2f436a[_0xac7b('0x1f')];var _0x3e7669=_0x59d6ae?_0x59d9de['count']:_0x2f436a[_0xac7b('0x1f')]+_0x2f436a['limit'];var _0x3fb7b7;if(_0x3e7669>=_0x249590){_0x3e7669=_0x249590;_0x3fb7b7=0xc8;}else{_0x3fb7b7=0xce;}_0x532f8b[_0xac7b('0x1c')](_0x3fb7b7);return _0x532f8b[_0xac7b('0x23')](_0xac7b('0x24'),_0x15e5c6+'-'+_0x3e7669+'/'+_0x249590)[_0xac7b('0x1e')](_0x59d9de);}return null;};}function patchUpdates(_0x3f33b2){return function(_0x3d062f){try{jsonpatch[_0xac7b('0x25')](_0x3d062f,_0x3f33b2,!![]);}catch(_0x27c8b9){return BPromise[_0xac7b('0x26')](_0x27c8b9);}return _0x3d062f[_0xac7b('0x27')]();};}function saveUpdates(_0xf1b7b9,_0x122cab){return function(_0x57c6de){if(_0x57c6de){return _0x57c6de[_0xac7b('0x28')](_0xf1b7b9)['then'](function(_0x457b6e){return _0x457b6e;});}return null;};}function removeEntity(_0x3c1023,_0x292956){return function(_0x20820e){if(_0x20820e){return _0x20820e[_0xac7b('0x29')]()['then'](function(){_0x3c1023[_0xac7b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47888a,_0x38bc33){return function(_0x555ec2){if(!_0x555ec2){_0x47888a['sendStatus'](0x194);}return _0x555ec2;};}function handleError(_0xf2ad85,_0x31b7af){_0x31b7af=_0x31b7af||0x1f4;return function(_0x469e32){logger[_0xac7b('0x2a')](_0x469e32[_0xac7b('0x2b')]);if(_0x469e32[_0xac7b('0x2c')]){delete _0x469e32['name'];}_0xf2ad85[_0xac7b('0x1c')](_0x31b7af)['send'](_0x469e32);};}exports['index']=function(_0x52ef69,_0x458702){var _0x1b4d68={},_0x3af1f0={},_0x58cc68={'count':0x0,'rows':[]};var _0x11a6ef=_[_0xac7b('0x2d')](db[_0xac7b('0x2e')]['rawAttributes'],function(_0x4e8f7f){return{'name':_0x4e8f7f['fieldName'],'type':_0x4e8f7f[_0xac7b('0x2f')][_0xac7b('0x30')]};});_0x3af1f0[_0xac7b('0x31')]=_[_0xac7b('0x32')](_[_0xac7b('0x2d')](_0x11a6ef,'name'),[_0xac7b('0x33')]);_0x3af1f0[_0xac7b('0x34')]=_[_0xac7b('0x35')](_0x52ef69[_0xac7b('0x34')]);_0x3af1f0[_0xac7b('0x36')]=_[_0xac7b('0x37')](_0x3af1f0[_0xac7b('0x31')],_0x3af1f0['query']);_0x1b4d68[_0xac7b('0x38')]=_['intersection'](_0x3af1f0[_0xac7b('0x31')],qs[_0xac7b('0x39')](_0x52ef69[_0xac7b('0x34')]['fields']));_0x1b4d68[_0xac7b('0x38')]=_0x1b4d68[_0xac7b('0x38')][_0xac7b('0x3a')]?_0x1b4d68[_0xac7b('0x38')]:_0x3af1f0[_0xac7b('0x31')];if(!_0x52ef69[_0xac7b('0x34')][_0xac7b('0x3b')](_0xac7b('0x3c'))){_0x1b4d68[_0xac7b('0x21')]=qs[_0xac7b('0x21')](_0x52ef69[_0xac7b('0x34')]['limit']);_0x1b4d68[_0xac7b('0x1f')]=qs[_0xac7b('0x1f')](_0x52ef69['query'][_0xac7b('0x1f')]);}_0x1b4d68[_0xac7b('0x3d')]=qs[_0xac7b('0x3e')](_0x52ef69[_0xac7b('0x34')]['sort']);_0x1b4d68[_0xac7b('0x3f')]=qs['filters'](_[_0xac7b('0x40')](_0x52ef69[_0xac7b('0x34')],_0x3af1f0[_0xac7b('0x36')]),_0x11a6ef);if(_0x52ef69[_0xac7b('0x34')][_0xac7b('0x41')]){_0x1b4d68['where']=_[_0xac7b('0x42')](_0x1b4d68[_0xac7b('0x3f')],{'$or':_[_0xac7b('0x2d')](_0x11a6ef,function(_0x2821eb){if(_0x2821eb[_0xac7b('0x2f')]!==_0xac7b('0x43')){var _0x1474c3={};_0x1474c3[_0x2821eb['name']]={'$like':'%'+_0x52ef69['query'][_0xac7b('0x41')]+'%'};return _0x1474c3;}})});}_0x1b4d68=_[_0xac7b('0x42')]({},_0x1b4d68,_0x52ef69['options']);var _0x2522f1={'where':_0x1b4d68['where']};return db['VoiceRecording'][_0xac7b('0x22')](_0x2522f1)[_0xac7b('0x44')](function(_0x42e36e){_0x58cc68[_0xac7b('0x22')]=_0x42e36e;if(_0x52ef69[_0xac7b('0x34')][_0xac7b('0x45')]){_0x1b4d68[_0xac7b('0x46')]=[{'all':!![]}];}return db[_0xac7b('0x2e')]['findAll'](_0x1b4d68);})[_0xac7b('0x44')](function(_0x4a8074){_0x58cc68[_0xac7b('0x47')]=_0x4a8074;return _0x58cc68;})['then'](respondWithFilteredResult(_0x458702,_0x1b4d68))[_0xac7b('0x48')](handleError(_0x458702,null));};exports['show']=function(_0x460edb,_0x29fcd0){var _0x52100a={'raw':![],'where':{'id':_0x460edb[_0xac7b('0x49')]['id']}},_0x2f6e37={};_0x2f6e37[_0xac7b('0x31')]=_[_0xac7b('0x35')](db[_0xac7b('0x2e')][_0xac7b('0x4a')]);_0x2f6e37[_0xac7b('0x34')]=_[_0xac7b('0x35')](_0x460edb[_0xac7b('0x34')]);_0x2f6e37[_0xac7b('0x36')]=_[_0xac7b('0x37')](_0x2f6e37[_0xac7b('0x31')],_0x2f6e37[_0xac7b('0x34')]);_0x52100a['attributes']=_[_0xac7b('0x37')](_0x2f6e37['model'],qs[_0xac7b('0x39')](_0x460edb[_0xac7b('0x34')]['fields']));_0x52100a[_0xac7b('0x38')]=_0x52100a['attributes'][_0xac7b('0x3a')]?_0x52100a[_0xac7b('0x38')]:_0x2f6e37[_0xac7b('0x31')];if(_0x460edb['query'][_0xac7b('0x45')]){_0x52100a[_0xac7b('0x46')]=[{'all':!![]}];}_0x52100a=_[_0xac7b('0x42')]({},_0x52100a,_0x460edb[_0xac7b('0x4b')]);return db[_0xac7b('0x2e')][_0xac7b('0x4c')](_0x52100a)['then'](handleEntityNotFound(_0x29fcd0,null))[_0xac7b('0x44')](respondWithResult(_0x29fcd0,null))[_0xac7b('0x48')](handleError(_0x29fcd0,null));};exports['create']=function(_0x51e0bb,_0x85d2ba){return db[_0xac7b('0x2e')][_0xac7b('0x4d')](_0x51e0bb[_0xac7b('0x4e')],{})[_0xac7b('0x44')](respondWithResult(_0x85d2ba,0xc9))[_0xac7b('0x48')](handleError(_0x85d2ba,null));};exports[_0xac7b('0x28')]=function(_0x1ae1e1,_0xc0f76e){if(_0x1ae1e1['body']['id']){delete _0x1ae1e1[_0xac7b('0x4e')]['id'];}return db[_0xac7b('0x2e')]['find']({'where':{'id':_0x1ae1e1[_0xac7b('0x49')]['id']}})[_0xac7b('0x44')](handleEntityNotFound(_0xc0f76e,null))['then'](saveUpdates(_0x1ae1e1[_0xac7b('0x4e')],null))['then'](respondWithResult(_0xc0f76e,null))[_0xac7b('0x48')](handleError(_0xc0f76e,null));};exports[_0xac7b('0x4f')]=function(_0x2a115c,_0x48ffdf){return db['VoiceRecording']['describe']()['then'](respondWithResult(_0x48ffdf,null))[_0xac7b('0x48')](handleError(_0x48ffdf,null));};exports[_0xac7b('0x50')]=function(_0xc93734,_0x3c4c42,_0x43d578){var _0x5ab993=require(_0xac7b('0x51'));var _0x9d5a93=![];var _0x404bda={};if(_0xc93734[_0xac7b('0x34')][_0xac7b('0x2f')]&&_0xc93734[_0xac7b('0x34')][_0xac7b('0x2f')]==='uniqueid'){_0x404bda[_0xac7b('0x52')]=_0xc93734['params']['id'];}else{_0x404bda['id']=_0xc93734['params']['id'];}return db[_0xac7b('0x2e')][_0xac7b('0x4c')]({'where':_0x404bda,'attributes':['id',_0xac7b('0x53')],'raw':!![]})[_0xac7b('0x44')](handleEntityNotFound(_0x3c4c42,null))[_0xac7b('0x44')](function(_0x5e8290){if(_0x5e8290){var _0x29c2a6=_0x5e8290[_0xac7b('0x53')];var _0xec86fd=util['format']('%s.cypher',_0x29c2a6);if(fs[_0xac7b('0x54')](_0xec86fd)){_0x9d5a93=!![];return _0x5ab993[_0xac7b('0x55')](_0xec86fd,_0x29c2a6,config[_0xac7b('0x56')][_0xac7b('0x57')])['then'](function(){return _0x5e8290;});}return _0x5e8290;}})[_0xac7b('0x44')](function(_0x2cf3fe){if(_0x2cf3fe){var _0x2b2149=_0x2cf3fe[_0xac7b('0x53')];if(!fs[_0xac7b('0x54')](_0x2b2149)){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x5a'));}if(_0x2cf3fe[_0xac7b('0x5b')]){return _0x3c4c42['download'](_0x2b2149,_0x2cf3fe[_0xac7b('0x5b')]+path[_0xac7b('0x5c')](_0x2b2149),function(){if(_0x9d5a93){fs['unlink'](_0x2b2149);}});}else{return _0x3c4c42[_0xac7b('0x50')](_0x2b2149,function(_0x584fdf){if(_0x9d5a93){fs[_0xac7b('0x5d')](_0x2b2149);}});}}})['catch'](function(_0x1e0324){if(_0x1e0324[_0xac7b('0x5e')]===_0xac7b('0x5a')){_0x3c4c42[_0xac7b('0x1c')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c4c42,null);}});};exports['downloads']=function(_0xdf1d9d,_0x5b4534,_0x307103){var _0x4ecb86=require(_0xac7b('0x51'));var _0x132000=![];var _0x58803e={'$and':[db['sequelize'][_0xac7b('0x3f')](db[_0xac7b('0x5f')]['fn'](_0xac7b('0x60'),db[_0xac7b('0x5f')][_0xac7b('0x61')](_0xac7b('0x52'))),_0xdf1d9d[_0xac7b('0x34')][_0xac7b('0x62')])]};if(_0xdf1d9d['query'][_0xac7b('0x2f')]&&_0xdf1d9d[_0xac7b('0x34')][_0xac7b('0x2f')]==='uniqueid'){_0x58803e[_0xac7b('0x63')]['push']({'uniqueid':_0xdf1d9d[_0xac7b('0x49')]['id']});}else{_0x58803e[_0xac7b('0x63')][_0xac7b('0x64')]({'id':_0xdf1d9d[_0xac7b('0x49')]['id']});}return db[_0xac7b('0x2e')][_0xac7b('0x4c')]({'where':_0x58803e,'attributes':['id','value'],'raw':!![]})[_0xac7b('0x44')](handleEntityNotFound(_0x5b4534,null))[_0xac7b('0x44')](function(_0xf2a827){if(_0xf2a827){var _0x2cadfc=util[_0xac7b('0x33')]('%s.cypher',_0xf2a827[_0xac7b('0x53')]);if(fs['existsSync'](_0x2cadfc)){_0x132000=!![];return _0x4ecb86[_0xac7b('0x55')](_0x2cadfc,_0xf2a827[_0xac7b('0x53')],config[_0xac7b('0x56')][_0xac7b('0x57')])[_0xac7b('0x44')](function(){return _0xf2a827;});}return _0xf2a827;}})[_0xac7b('0x44')](function(_0x4443d7){if(_0x4443d7){if(!fs['existsSync'](_0x4443d7[_0xac7b('0x53')])){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x5a'));}if(_0x4443d7[_0xac7b('0x5b')]){return _0x5b4534[_0xac7b('0x50')](_0x4443d7[_0xac7b('0x53')],_0x4443d7[_0xac7b('0x5b')]+path[_0xac7b('0x5c')](_0x4443d7['value']),function(){if(_0x132000){fs['unlink'](_0x4443d7[_0xac7b('0x53')]);}});}else{return _0x5b4534[_0xac7b('0x50')](_0x4443d7[_0xac7b('0x53')],function(_0x4c965f){if(_0x132000){fs['unlink'](_0x4443d7[_0xac7b('0x53')]);}});}}})[_0xac7b('0x48')](handleError(_0x5b4534,null));};exports['destroy']=function(_0x38b7e7,_0x10ed94){return db[_0xac7b('0x2e')]['find']({'where':{'id':_0x38b7e7[_0xac7b('0x49')]['id']}})['then'](function(_0x4ae938){if(_[_0xac7b('0x65')](_0x4ae938)){throw new ReferenceError(_0xac7b('0x66'));}return _0x4ae938;})[_0xac7b('0x44')](function(_0x937d3c){var _0x2a89bf=_0x937d3c[_0xac7b('0x53')];logger[_0xac7b('0x67')](_0xac7b('0x68'),_0x2a89bf);if(!_[_0xac7b('0x65')](_0x937d3c[_0xac7b('0x53')])&&fs[_0xac7b('0x54')](_0x2a89bf)){logger[_0xac7b('0x67')](_0xac7b('0x69')+_0x2a89bf+_0xac7b('0x6a'));fs['unlinkSync'](_0x2a89bf);}_0x2a89bf=_0x2a89bf+_0xac7b('0x6b');if(!_['isNil'](_0x937d3c[_0xac7b('0x53')])&&fs[_0xac7b('0x54')](_0x2a89bf)){logger[_0xac7b('0x67')](_0xac7b('0x69')+_0x2a89bf+_0xac7b('0x6a'));fs[_0xac7b('0x6c')](_0x2a89bf);}return _0x937d3c;})['then'](function(_0x3aaff2){if(!_0x3aaff2)throw new InternalError();return _0x3aaff2[_0xac7b('0x29')]();})['then'](function(){_0x10ed94['status'](0xcc)[_0xac7b('0x1d')]();})[_0xac7b('0x48')](handleError(_0x10ed94,null));};function getBucketslist(_0x2d5592,_0x493075,_0x38273b){return new Promise(function(_0x5f24b0,_0x585f85){var _0x594c43=new AWS['S3']({'accessKeyId':_0x493075,'secretAccessKey':_0x2d5592,'region':_0x38273b});_0x594c43[_0xac7b('0x6d')]({},function(_0x55a88a,_0x1358aa){if(_0x55a88a){return _0x585f85(_0x55a88a);}else{return _0x5f24b0(_0x1358aa);}});});}function createBucket(_0xed7b27,_0xb59937,_0x510750,_0x65741c){return new Promise(function(_0x5e1d66,_0x55afcc){var _0x5ec2c8=new AWS['S3']({'accessKeyId':_0xb59937,'secretAccessKey':_0xed7b27,'region':_0x510750});_0x5ec2c8[_0xac7b('0x6e')]({'Bucket':_0x65741c},function(_0x2203f7,_0x4161b5){if(_0x2203f7){return _0x55afcc(_0x2203f7);}else{return _0x5e1d66(_0x4161b5);}});});}function uploadFile(_0x4e2f18,_0x2341e3,_0x4b93ea,_0x4cdd6f,_0x258113,_0x19440c){return new Promise(function(_0x14df70,_0x43249c){var _0x3e41f5=new AWS['S3']({'accessKeyId':_0x2341e3,'secretAccessKey':_0x4e2f18,'region':_0x4b93ea});_0x3e41f5[_0xac7b('0x6f')]({'Bucket':_0x4cdd6f,'Key':_0x258113,'Body':_0x19440c},function(_0x2be5fd,_0x87765a){if(_0x2be5fd){return _0x43249c(_0x2be5fd);}else{return _0x14df70(_0x87765a);}});});}function startTranscribe(_0x514ba7,_0x14a7da,_0xb4f4f3,_0x472fde,_0x297084,_0x16c9b9){return new Promise(function(_0x493722,_0x2c8446){var _0x4e2ba9=new AWS[(_0xac7b('0x70'))]({'accessKeyId':_0x14a7da,'secretAccessKey':_0x514ba7,'region':_0xb4f4f3});_0x4e2ba9['startTranscriptionJob']({'TranscriptionJobName':_0x472fde,'LanguageCode':_0x297084,'Media':{'MediaFileUri':_0x16c9b9}},function(_0x5daa14,_0x1101f2){if(_0x5daa14){return _0x2c8446(_0x5daa14);}else{return _0x493722(_0x1101f2);}});});}function transcribe(_0x336db9,_0x378d04,_0x985e51,_0x40459e,_0xcee777,_0x5591da,_0x21c854){return new Promise(function(_0x4fe8f4,_0x394cc7){var _0x5d0df8={};logger['info'](util[_0xac7b('0x33')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x336db9,_0xcee777));return uploadFile(_0x378d04,_0x985e51,_0x40459e,_0xcee777,path['basename'](_0x5591da),fs['readFileSync'](_0x5591da))[_0xac7b('0x44')](function(_0x5a952b){logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x71'),_0x336db9,_0xcee777,_0x5a952b[_0xac7b('0x72')]));_0x5d0df8[_0xac7b('0x73')]=_0x5a952b['Bucket'];_0x5d0df8[_0xac7b('0x74')]=_0x5a952b[_0xac7b('0x72')];logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x75'),_0x336db9));return startTranscribe(_0x378d04,_0x985e51,_0x40459e,uuidv4(),_0x21c854,_0x5a952b[_0xac7b('0x72')]);})['then'](function(_0x3a5cd0){logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x336db9,_0x3a5cd0['TranscriptionJob'][_0xac7b('0x76')]));_0x5d0df8['transcribeName']=_0x3a5cd0['TranscriptionJob'][_0xac7b('0x76')];_0x5d0df8['transcribeStatus']=_0x3a5cd0[_0xac7b('0x77')][_0xac7b('0x78')];return _0x4fe8f4(_0x5d0df8);})[_0xac7b('0x48')](function(_0x1a2e82){return _0x394cc7(_0x1a2e82);});});}exports[_0xac7b('0x79')]=function(_0xb8fbb8,_0x2b1721,_0xe97009){var _0x3a7dab;var _0x47dad8;var _0x1e6b73;var _0x5f0b02=require('../../components/encryptor');return db[_0xac7b('0x2e')][_0xac7b('0x7a')]({'where':{'id':_0xb8fbb8[_0xac7b('0x49')]['id']}})[_0xac7b('0x44')](function(_0x5d784b){if(_0x5d784b){var _0x5f7f68=util[_0xac7b('0x33')](_0xac7b('0x7b'),_0x5d784b[_0xac7b('0x53')]);if(fs[_0xac7b('0x54')](_0x5f7f68)){cypher=!![];return _0x5f0b02['decryptFile'](_0x5f7f68,_0x5d784b[_0xac7b('0x53')],config[_0xac7b('0x56')]['recording'])[_0xac7b('0x44')](function(){return _0x5d784b;});}return _0x5d784b;}})[_0xac7b('0x44')](function(_0x26cb5f){if(!_0x26cb5f){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x47dad8=_0x26cb5f;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2b1721,null))['then'](function(_0x374ef9){if(_0x374ef9){_0x3a7dab=_0x374ef9;if(!_0x3a7dab[_0xac7b('0x7c')]||!_0x3a7dab[_0xac7b('0x7d')]||!_0x3a7dab[_0xac7b('0x7e')]||!_0x3a7dab[_0xac7b('0x7f')]||!_0x3a7dab[_0xac7b('0x73')]){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x80'));}if(_0xb8fbb8[_0xac7b('0x4e')]['runSentiment']&&(!_0x3a7dab[_0xac7b('0x81')]||!_0x3a7dab[_0xac7b('0x82')]||!_0x3a7dab['sentimentRegion']||!_0x3a7dab[_0xac7b('0x7f')]||!_0x3a7dab[_0xac7b('0x73')])){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x83'));}return db[_0xac7b('0x84')][_0xac7b('0x7a')]({'where':{'id':_0x3a7dab[_0xac7b('0x7d')]}});}})['then'](function(_0x426710){if(!_0x426710){throw new db[(_0xac7b('0x58'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x426710[_0xac7b('0x85')]||!_0x426710[_0xac7b('0x86')]){throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x87'));}_0x1e6b73=_0x426710;return getBucketslist(_0x1e6b73['data1'],_0x1e6b73[_0xac7b('0x86')],_0x3a7dab[_0xac7b('0x7e')]);})[_0xac7b('0x44')](function(_0x12d047){if(_0x12d047&&_0x12d047[_0xac7b('0x88')]){var _0x518c09=_[_0xac7b('0x4c')](_0x12d047['Buckets'],function(_0x1bc6c0){return _0x1bc6c0['Name']===_0x3a7dab[_0xac7b('0x73')];});if(!_0x518c09){logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x89'),_0xb8fbb8['params']['id'],_0x3a7dab[_0xac7b('0x73')]));return createBucket(_0x1e6b73[_0xac7b('0x85')],_0x1e6b73[_0xac7b('0x86')],_0x3a7dab[_0xac7b('0x7e')],_0x3a7dab[_0xac7b('0x73')]);}logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x8a'),_0xb8fbb8[_0xac7b('0x49')]['id'],_0x3a7dab[_0xac7b('0x73')]));return;}})[_0xac7b('0x44')](function(_0x1f3a95){if(_0x47dad8[_0xac7b('0x8b')]===_0xac7b('0x8c')){return transcribe(_0xb8fbb8[_0xac7b('0x49')]['id'],_0x1e6b73[_0xac7b('0x85')],_0x1e6b73[_0xac7b('0x86')],_0x3a7dab[_0xac7b('0x7e')],_0x3a7dab[_0xac7b('0x73')],_0x47dad8['value'],_0x3a7dab[_0xac7b('0x7f')]);}else{logger[_0xac7b('0x67')](util[_0xac7b('0x33')](_0xac7b('0x8d'),_0xb8fbb8[_0xac7b('0x49')]['id']));return{'transcribeStatus':_0xac7b('0x8e')};}})[_0xac7b('0x44')](function(_0x4a1bb2){if(_0x4a1bb2){_0x4a1bb2[_0xac7b('0x8f')]=_0xb8fbb8['body'][_0xac7b('0x90')];return _0x47dad8['updateAttributes'](_0x4a1bb2);}})[_0xac7b('0x44')](respondWithResult(_0x2b1721,null))[_0xac7b('0x48')](handleError(_0x2b1721,null));};function writeFile(_0x1f83f0,_0x1dd54f){return new Promise(function(_0x4812e4,_0x11230b){fs[_0xac7b('0x91')](_0x1dd54f,_0x1f83f0,function(_0x1bf5f5,_0x4a4222){if(_0x1bf5f5){return _0x11230b(_0x1bf5f5);}else{return _0x4812e4(_0x4a4222);}});});}exports['downloadTranscribe']=function(_0x2c0cc5,_0x2e984f,_0x34f514){return db[_0xac7b('0x2e')]['findOne']({'where':{'id':_0x2c0cc5[_0xac7b('0x49')]['id']}})[_0xac7b('0x44')](handleEntityNotFound(_0x2e984f))[_0xac7b('0x44')](function(_0x2094f3){if(_0x2094f3&&_0x2094f3[_0xac7b('0x92')]){var _0x115e25=_0x2094f3['fileText'];var _0x4fdd62=config['root']+_0xac7b('0x93')+_0x2094f3['id']+_0xac7b('0x94');if(fs[_0xac7b('0x54')](_0x4fdd62)){return _0x4fdd62;}return writeFile(_0x115e25,_0x4fdd62)[_0xac7b('0x44')](function(){return _0x4fdd62;});}else{throw new db[(_0xac7b('0x58'))][(_0xac7b('0x59'))](_0xac7b('0x95'));}})['then'](function(_0x416bf4){return _0x2e984f[_0xac7b('0x50')](_0x416bf4);})['catch'](handleError(_0x2e984f));};
\ No newline at end of file
index ddc7117..9f506bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f82=['voice_recordings','uniqueid','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x436d8c,_0x85fea6){var _0x4bac79=function(_0x3fd339){while(--_0x3fd339){_0x436d8c['push'](_0x436d8c['shift']());}};_0x4bac79(++_0x85fea6);}(_0x5f82,0xde));var _0x25f8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5f82[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require(_0x25f8('0x0'));var logger=require('../../config/logger')(_0x25f8('0x1'));var moment=require(_0x25f8('0x2'));var BPromise=require('bluebird');var rp=require(_0x25f8('0x3'));var fs=require('fs');var path=require(_0x25f8('0x4'));var rimraf=require(_0x25f8('0x5'));var config=require(_0x25f8('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x25f8('0x7')]=function(_0x1511e3,_0x52cc28){return _0x1511e3['define']('VoiceRecording',attributes,{'tableName':_0x25f8('0x8'),'paranoid':![],'indexes':[{'name':_0x25f8('0x9'),'fields':[_0x25f8('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x20cc=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid'];(function(_0x802244,_0x2deac1){var _0x303abf=function(_0x271094){while(--_0x271094){_0x802244['push'](_0x802244['shift']());}};_0x303abf(++_0x2deac1);}(_0x20cc,0x196));var _0xc20c=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x20cc[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var logger=require(_0xc20c('0x2'))('api');var moment=require(_0xc20c('0x3'));var BPromise=require(_0xc20c('0x4'));var rp=require(_0xc20c('0x5'));var fs=require('fs');var path=require(_0xc20c('0x6'));var rimraf=require(_0xc20c('0x7'));var config=require(_0xc20c('0x8'));var attributes=require(_0xc20c('0x9'));module[_0xc20c('0xa')]=function(_0xaa5fce,_0x34f9ac){return _0xaa5fce[_0xc20c('0xb')](_0xc20c('0xc'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xc20c('0xd'),'fields':[_0xc20c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index a158215..17e351a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['attributes','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','then','VoiceRecording','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','UpdateVoiceRecording','update','body','options','where'];(function(_0x107844,_0x41926f){var _0x40c2b5=function(_0x2d0c58){while(--_0x2d0c58){_0x107844['push'](_0x107844['shift']());}};_0x40c2b5(++_0x41926f);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}exports[_0x7413('0x17')]=function(_0x19157f){var _0x12a01e=this;return new Promise(function(_0x2a3417,_0x26dafe){return db['VoiceRecording'][_0x7413('0x18')](_0x19157f[_0x7413('0x19')],{'raw':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')][_0x7413('0x1b')]||null:null,'attributes':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')][_0x7413('0x1c')]||null:null,'limit':_0x19157f[_0x7413('0x1a')]?_0x19157f[_0x7413('0x1a')]['limit']||null:null})['then'](function(_0x138508){logger['info'](_0x7413('0x17'),_0x19157f);logger[_0x7413('0x10')](_0x7413('0x17'),_0x19157f,JSON[_0x7413('0x12')](_0x138508));_0x2a3417(_0x138508);})[_0x7413('0x1d')](function(_0x346ce8){logger[_0x7413('0x13')](_0x7413('0x17'),_0x346ce8[_0x7413('0x16')],_0x19157f);_0x26dafe(_0x12a01e['error'](0x1f4,_0x346ce8['message']));});});};exports[_0x7413('0x1e')]=function(_0x48c2dc){var _0x46c895=this;return new Promise(function(_0x71cbb4,_0x463b21){var _0x4c2e90=require(_0x7413('0x1f'));var _0x896552;return db[_0x7413('0x20')][_0x7413('0x21')]({'attributes':['id',_0x7413('0x22')],'where':{'id':0x1},'raw':!![]})[_0x7413('0x23')](function(_0x5eb4d9){_0x896552=_0x5eb4d9;return db[_0x7413('0x24')]['create'](_0x48c2dc[_0x7413('0x19')]);})[_0x7413('0x23')](function(_0xae2969){if(_0x896552[_0x7413('0x22')]&&fs[_0x7413('0x25')](_0xae2969[_0x7413('0x26')])){var _0x5bb3ea=util[_0x7413('0x27')](_0x7413('0x28'),_0xae2969[_0x7413('0x26')]);return _0x4c2e90[_0x7413('0x29')](_0xae2969[_0x7413('0x26')],_0x5bb3ea,config[_0x7413('0x2a')][_0x7413('0x2b')])['then'](function(){fs[_0x7413('0x2c')](_0xae2969[_0x7413('0x26')]);logger[_0x7413('0xe')](_0x7413('0x2d'));return _0xae2969;});}return _0xae2969;})[_0x7413('0x23')](function(_0x51d676){logger[_0x7413('0xe')]('CreateVoiceRecording',_0x48c2dc);logger[_0x7413('0x10')](_0x7413('0x1e'),_0x48c2dc,JSON[_0x7413('0x12')](_0x51d676));_0x71cbb4(_0x51d676);})['catch'](function(_0xe6b096){logger['error'](_0x7413('0x1e'),_0xe6b096[_0x7413('0x16')],_0x48c2dc);_0x463b21(_0x46c895['error'](0x1f4,_0xe6b096['message']));});});};
\ No newline at end of file
+var _0x4e2e=['error','message','result','VoiceRecording','update','body','options','raw','attributes','limit','UpdateVoiceRecording','debug','catch','../../components/encryptor','findOne','create','callRecordingEncryption','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d08f2,_0x2ce505){var _0xf7b7a9=function(_0xab5ab2){while(--_0xab5ab2){_0x1d08f2['push'](_0x1d08f2['shift']());}};_0xf7b7a9(++_0x2ce505);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x57299f,_0x77ba3e){_0x57299f=_0x57299f-0x0;var _0x1c1266=_0x4e2e[_0x57299f];return _0x1c1266;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['UpdateVoiceRecording']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')](_0x196f16[_0xe4e2('0x17')],{'raw':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')]['where']||null:null,'attributes':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x1a')]||null:null,'limit':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x1b')]||null:null})[_0xe4e2('0xc')](function(_0x51c67e){logger[_0xe4e2('0xd')](_0xe4e2('0x1c'),_0x196f16);logger[_0xe4e2('0x1d')]('UpdateVoiceRecording',_0x196f16,JSON[_0xe4e2('0x11')](_0x51c67e));_0x1d5e9d(_0x51c67e);})[_0xe4e2('0x1e')](function(_0x598fa3){logger[_0xe4e2('0x12')](_0xe4e2('0x1c'),_0x598fa3[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x598fa3[_0xe4e2('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x166610){var _0x357903=this;return new Promise(function(_0x1f6d1f,_0x5120fd){var _0x3a31b8=require(_0xe4e2('0x1f'));var _0x31f651;return db['Setting'][_0xe4e2('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xe4e2('0xc')](function(_0x1e21c0){_0x31f651=_0x1e21c0;return db['VoiceRecording'][_0xe4e2('0x21')](_0x166610[_0xe4e2('0x17')]);})[_0xe4e2('0xc')](function(_0x41500b){if(_0x31f651[_0xe4e2('0x22')]&&fs['existsSync'](_0x41500b['value'])){var _0x2cb235=util[_0xe4e2('0x23')](_0xe4e2('0x24'),_0x41500b[_0xe4e2('0x25')]);return _0x3a31b8[_0xe4e2('0x26')](_0x41500b[_0xe4e2('0x25')],_0x2cb235,config[_0xe4e2('0x27')][_0xe4e2('0x28')])[_0xe4e2('0xc')](function(){fs[_0xe4e2('0x29')](_0x41500b[_0xe4e2('0x25')]);logger[_0xe4e2('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x41500b;});}return _0x41500b;})[_0xe4e2('0xc')](function(_0x8ffc6){logger[_0xe4e2('0xd')](_0xe4e2('0x2a'),_0x166610);logger[_0xe4e2('0x1d')](_0xe4e2('0x2a'),_0x166610,JSON['stringify'](_0x8ffc6));_0x1f6d1f(_0x8ffc6);})[_0xe4e2('0x1e')](function(_0x286714){logger[_0xe4e2('0x12')](_0xe4e2('0x2a'),_0x286714[_0xe4e2('0x13')],_0x166610);_0x5120fd(_0x357903[_0xe4e2('0x12')](0x1f4,_0x286714[_0xe4e2('0x13')]));});});};
\ No newline at end of file
index b88097a..63e3771 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7a7=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xa696dd,_0x5d4fd6){var _0x877dcb=function(_0x54b0e9){while(--_0x54b0e9){_0xa696dd['push'](_0xa696dd['shift']());}};_0x877dcb(++_0x5d4fd6);}(_0xc7a7,0xe4));var _0x7c7a=function(_0x20809b,_0x3a5f10){_0x20809b=_0x20809b-0x0;var _0x23c59d=_0xc7a7[_0x20809b];return _0x23c59d;};'use strict';var multer=require(_0x7c7a('0x0'));var util=require(_0x7c7a('0x1'));var path=require(_0x7c7a('0x2'));var timeout=require(_0x7c7a('0x3'));var express=require('express');var router=express[_0x7c7a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c7a('0x5'));var interaction=require(_0x7c7a('0x6'));var config=require(_0x7c7a('0x7'));var controller=require(_0x7c7a('0x8'));router[_0x7c7a('0x9')]('/',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xb')]);router[_0x7c7a('0x9')](_0x7c7a('0xc'),auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xd')]);router[_0x7c7a('0x9')](_0x7c7a('0xe'),auth[_0x7c7a('0xa')](),controller[_0x7c7a('0xf')]);router[_0x7c7a('0x10')]('/',auth[_0x7c7a('0xa')](),controller[_0x7c7a('0x11')]);router[_0x7c7a('0x12')](_0x7c7a('0xe'),auth['isAuthenticated'](),controller[_0x7c7a('0x13')]);router[_0x7c7a('0x14')](_0x7c7a('0xe'),auth[_0x7c7a('0xa')](),controller[_0x7c7a('0x15')]);module[_0x7c7a('0x16')]=router;
\ No newline at end of file
+var _0x7547=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7547,0x121));var _0x7754=function(_0x167e3a,_0x30f118){_0x167e3a=_0x167e3a-0x0;var _0x15a5aa=_0x7547[_0x167e3a];return _0x15a5aa;};'use strict';var multer=require(_0x7754('0x0'));var util=require(_0x7754('0x1'));var path=require('path');var timeout=require(_0x7754('0x2'));var express=require(_0x7754('0x3'));var router=express[_0x7754('0x4')]();var fs_extra=require(_0x7754('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7754('0x6'));var config=require(_0x7754('0x7'));var controller=require('./voiceTransferReport.controller');router[_0x7754('0x8')]('/',auth[_0x7754('0x9')](),controller[_0x7754('0xa')]);router[_0x7754('0x8')](_0x7754('0xb'),auth[_0x7754('0x9')](),controller['describe']);router[_0x7754('0x8')](_0x7754('0xc'),auth[_0x7754('0x9')](),controller[_0x7754('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7754('0xe')]);router[_0x7754('0xf')](_0x7754('0xc'),auth[_0x7754('0x9')](),controller['update']);router[_0x7754('0x10')](_0x7754('0xc'),auth[_0x7754('0x9')](),controller[_0x7754('0x11')]);module[_0x7754('0x12')]=router;
\ No newline at end of file
index 12e7ef0..d6121f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12d=['blind','attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x39041f,_0x3c7e52){var _0x58b0b8=function(_0x5f10cb){while(--_0x5f10cb){_0x39041f['push'](_0x39041f['shift']());}};_0x58b0b8(++_0x3c7e52);}(_0xc12d,0x15b));var _0xdc12=function(_0x22aeea,_0x2d2889){_0x22aeea=_0x22aeea-0x0;var _0x32e8e4=_0xc12d[_0x22aeea];return _0x32e8e4;};'use strict';var Sequelize=require(_0xdc12('0x0'));var moment=require(_0xdc12('0x1'));module['exports']={'type':{'type':Sequelize[_0xdc12('0x2')](_0xdc12('0x3'),_0xdc12('0x4'))},'result':{'type':Sequelize[_0xdc12('0x5')]},'transfererchannel':{'type':Sequelize[_0xdc12('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xdc12('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xdc12('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xdc12('0x5')]},'transfererexten':{'type':Sequelize[_0xdc12('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xdc12('0x5')]},'transfereechannel':{'type':Sequelize[_0xdc12('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xdc12('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xdc12('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xdc12('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xdc12('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xdc12('0x5')]},'isexternal':{'type':Sequelize[_0xdc12('0x2')](_0xdc12('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xdc12('0x5')]}};
\ No newline at end of file
+var _0xbb4e=['blind','attended','STRING','sequelize','moment','ENUM'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xbb4e,0xbd));var _0xebb4=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xbb4e[_0x28394f];return _0x2618d2;};'use strict';var Sequelize=require(_0xebb4('0x0'));var moment=require(_0xebb4('0x1'));module['exports']={'type':{'type':Sequelize[_0xebb4('0x2')](_0xebb4('0x3'),_0xebb4('0x4'))},'result':{'type':Sequelize[_0xebb4('0x5')]},'transfererchannel':{'type':Sequelize[_0xebb4('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xebb4('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xebb4('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xebb4('0x5')]},'transferercontext':{'type':Sequelize[_0xebb4('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xebb4('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xebb4('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xebb4('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xebb4('0x5')]},'transfereecontext':{'type':Sequelize[_0xebb4('0x5')]},'transfereeexten':{'type':Sequelize[_0xebb4('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xebb4('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xebb4('0x5')]},'extension':{'type':Sequelize[_0xebb4('0x5')]}};
\ No newline at end of file
index 8f22782..301611d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79bb=['include','findAll','rows','show','keys','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','status','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0x79bb,0xff));var _0xb79b=function(_0x3e384b,_0x59a016){_0x3e384b=_0x3e384b-0x0;var _0x33d8ff=_0x79bb[_0x3e384b];return _0x33d8ff;};'use strict';var emlformat=require(_0xb79b('0x0'));var rimraf=require(_0xb79b('0x1'));var zipdir=require(_0xb79b('0x2'));var jsonpatch=require(_0xb79b('0x3'));var rp=require(_0xb79b('0x4'));var moment=require(_0xb79b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb79b('0x6'));var util=require('util');var path=require(_0xb79b('0x7'));var sox=require(_0xb79b('0x8'));var csv=require(_0xb79b('0x9'));var ejs=require(_0xb79b('0xa'));var fs=require('fs');var fs_extra=require(_0xb79b('0xb'));var _=require(_0xb79b('0xc'));var squel=require(_0xb79b('0xd'));var crypto=require(_0xb79b('0xe'));var jsforce=require(_0xb79b('0xf'));var deskjs=require(_0xb79b('0x10'));var toCsv=require(_0xb79b('0x9'));var querystring=require(_0xb79b('0x11'));var Papa=require(_0xb79b('0x12'));var Redis=require(_0xb79b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb79b('0x14'));var as=require(_0xb79b('0x15'));var hardwareService=require(_0xb79b('0x16'));var logger=require(_0xb79b('0x17'))(_0xb79b('0x18'));var utils=require(_0xb79b('0x19'));var config=require(_0xb79b('0x1a'));var licenseUtil=require(_0xb79b('0x1b'));var db=require(_0xb79b('0x1c'))['db'];function respondWithStatusCode(_0x2dbfb6,_0x47e82a){_0x47e82a=_0x47e82a||0xcc;return function(_0x2459f9){if(_0x2459f9){return _0x2dbfb6[_0xb79b('0x1d')](_0x47e82a);}return _0x2dbfb6['status'](_0x47e82a)[_0xb79b('0x1e')]();};}function respondWithResult(_0x53c744,_0x1e1520){_0x1e1520=_0x1e1520||0xc8;return function(_0x3eed91){if(_0x3eed91){return _0x53c744['status'](_0x1e1520)[_0xb79b('0x1f')](_0x3eed91);}};}function respondWithFilteredResult(_0x277a26,_0x4f4de1){return function(_0x154367){if(_0x154367){var _0x5d877a=typeof _0x4f4de1[_0xb79b('0x20')]===_0xb79b('0x21')&&typeof _0x4f4de1[_0xb79b('0x22')]==='undefined';var _0x8f9c18=_0x154367[_0xb79b('0x23')];var _0x473443=_0x5d877a?0x0:_0x4f4de1['offset'];var _0x350252=_0x5d877a?_0x154367[_0xb79b('0x23')]:_0x4f4de1['offset']+_0x4f4de1[_0xb79b('0x22')];var _0x48652;if(_0x350252>=_0x8f9c18){_0x350252=_0x8f9c18;_0x48652=0xc8;}else{_0x48652=0xce;}_0x277a26[_0xb79b('0x24')](_0x48652);return _0x277a26['set'](_0xb79b('0x25'),_0x473443+'-'+_0x350252+'/'+_0x8f9c18)['json'](_0x154367);}return null;};}function patchUpdates(_0x539401){return function(_0xd1c4aa){try{jsonpatch[_0xb79b('0x26')](_0xd1c4aa,_0x539401,!![]);}catch(_0x547937){return BPromise[_0xb79b('0x27')](_0x547937);}return _0xd1c4aa[_0xb79b('0x28')]();};}function saveUpdates(_0xde7b10,_0x399f1a){return function(_0x6d55fe){if(_0x6d55fe){return _0x6d55fe['update'](_0xde7b10)[_0xb79b('0x29')](function(_0x55a4b6){return _0x55a4b6;});}return null;};}function removeEntity(_0x3fa8cb,_0x5ee026){return function(_0x36c5c5){if(_0x36c5c5){return _0x36c5c5[_0xb79b('0x2a')]()['then'](function(){_0x3fa8cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e364d,_0x12c870){return function(_0x4029ce){if(!_0x4029ce){_0x2e364d[_0xb79b('0x1d')](0x194);}return _0x4029ce;};}function handleError(_0x501e29,_0xc1547b){_0xc1547b=_0xc1547b||0x1f4;return function(_0x25a897){logger[_0xb79b('0x2b')](_0x25a897[_0xb79b('0x2c')]);if(_0x25a897[_0xb79b('0x2d')]){delete _0x25a897[_0xb79b('0x2d')];}_0x501e29[_0xb79b('0x24')](_0xc1547b)['send'](_0x25a897);};}exports[_0xb79b('0x2e')]=function(_0x14a91d,_0x18bec7){var _0x195a38={},_0x357694={},_0x3c90c1={'count':0x0,'rows':[]};var _0x2e9f45=_[_0xb79b('0x2f')](db[_0xb79b('0x30')][_0xb79b('0x31')],function(_0x287c01){return{'name':_0x287c01[_0xb79b('0x32')],'type':_0x287c01[_0xb79b('0x33')][_0xb79b('0x34')]};});_0x357694[_0xb79b('0x35')]=_[_0xb79b('0x2f')](_0x2e9f45,_0xb79b('0x2d'));_0x357694['query']=_['keys'](_0x14a91d[_0xb79b('0x36')]);_0x357694[_0xb79b('0x37')]=_[_0xb79b('0x38')](_0x357694[_0xb79b('0x35')],_0x357694['query']);_0x195a38[_0xb79b('0x39')]=_['intersection'](_0x357694[_0xb79b('0x35')],qs[_0xb79b('0x3a')](_0x14a91d[_0xb79b('0x36')]['fields']));_0x195a38[_0xb79b('0x39')]=_0x195a38[_0xb79b('0x39')][_0xb79b('0x3b')]?_0x195a38[_0xb79b('0x39')]:_0x357694[_0xb79b('0x35')];if(!_0x14a91d[_0xb79b('0x36')]['hasOwnProperty'](_0xb79b('0x3c'))){_0x195a38[_0xb79b('0x22')]=qs[_0xb79b('0x22')](_0x14a91d[_0xb79b('0x36')]['limit']);_0x195a38[_0xb79b('0x20')]=qs['offset'](_0x14a91d['query'][_0xb79b('0x20')]);}_0x195a38[_0xb79b('0x3d')]=qs[_0xb79b('0x3e')](_0x14a91d[_0xb79b('0x36')]['sort']);_0x195a38[_0xb79b('0x3f')]=qs['filters'](_['pick'](_0x14a91d['query'],_0x357694[_0xb79b('0x37')]),_0x2e9f45);if(_0x14a91d[_0xb79b('0x36')][_0xb79b('0x40')]){_0x195a38[_0xb79b('0x3f')]=_[_0xb79b('0x41')](_0x195a38[_0xb79b('0x3f')],{'$or':_[_0xb79b('0x2f')](_0x2e9f45,function(_0x3ca4c4){if(_0x3ca4c4['type']!==_0xb79b('0x42')){var _0x27e01e={};_0x27e01e[_0x3ca4c4[_0xb79b('0x2d')]]={'$like':'%'+_0x14a91d[_0xb79b('0x36')][_0xb79b('0x40')]+'%'};return _0x27e01e;}})});}_0x195a38=_['merge']({},_0x195a38,_0x14a91d[_0xb79b('0x43')]);var _0x2fd563={'where':_0x195a38['where']};return db[_0xb79b('0x30')][_0xb79b('0x23')](_0x2fd563)[_0xb79b('0x29')](function(_0x1b6ed1){_0x3c90c1[_0xb79b('0x23')]=_0x1b6ed1;if(_0x14a91d[_0xb79b('0x36')][_0xb79b('0x44')]){_0x195a38[_0xb79b('0x45')]=[{'all':!![]}];}return db[_0xb79b('0x30')][_0xb79b('0x46')](_0x195a38);})[_0xb79b('0x29')](function(_0x12f18d){_0x3c90c1[_0xb79b('0x47')]=_0x12f18d;return _0x3c90c1;})[_0xb79b('0x29')](respondWithFilteredResult(_0x18bec7,_0x195a38))['catch'](handleError(_0x18bec7,null));};exports[_0xb79b('0x48')]=function(_0x153733,_0x314011){var _0xc5e31d={'raw':!![],'where':{'id':_0x153733['params']['id']}},_0x32f1b0={};_0x32f1b0['model']=_[_0xb79b('0x49')](db[_0xb79b('0x30')][_0xb79b('0x31')]);_0x32f1b0[_0xb79b('0x36')]=_[_0xb79b('0x49')](_0x153733[_0xb79b('0x36')]);_0x32f1b0[_0xb79b('0x37')]=_['intersection'](_0x32f1b0['model'],_0x32f1b0[_0xb79b('0x36')]);_0xc5e31d['attributes']=_[_0xb79b('0x38')](_0x32f1b0[_0xb79b('0x35')],qs['fields'](_0x153733['query'][_0xb79b('0x3a')]));_0xc5e31d['attributes']=_0xc5e31d[_0xb79b('0x39')][_0xb79b('0x3b')]?_0xc5e31d[_0xb79b('0x39')]:_0x32f1b0[_0xb79b('0x35')];if(_0x153733[_0xb79b('0x36')][_0xb79b('0x44')]){_0xc5e31d[_0xb79b('0x45')]=[{'all':!![]}];}_0xc5e31d=_[_0xb79b('0x41')]({},_0xc5e31d,_0x153733[_0xb79b('0x43')]);return db['VoiceTransferReport'][_0xb79b('0x4a')](_0xc5e31d)[_0xb79b('0x29')](handleEntityNotFound(_0x314011,null))[_0xb79b('0x29')](respondWithResult(_0x314011,null))[_0xb79b('0x4b')](handleError(_0x314011,null));};exports[_0xb79b('0x4c')]=function(_0x5b87a2,_0x22150e){return db[_0xb79b('0x30')][_0xb79b('0x4c')](_0x5b87a2[_0xb79b('0x4d')],{})[_0xb79b('0x29')](respondWithResult(_0x22150e,0xc9))['catch'](handleError(_0x22150e,null));};exports[_0xb79b('0x4e')]=function(_0x364016,_0x4300af){if(_0x364016[_0xb79b('0x4d')]['id']){delete _0x364016[_0xb79b('0x4d')]['id'];}return db[_0xb79b('0x30')][_0xb79b('0x4a')]({'where':{'id':_0x364016[_0xb79b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4300af,null))[_0xb79b('0x29')](saveUpdates(_0x364016[_0xb79b('0x4d')],null))['then'](respondWithResult(_0x4300af,null))[_0xb79b('0x4b')](handleError(_0x4300af,null));};exports[_0xb79b('0x2a')]=function(_0x4dfab9,_0x4a7083){return db[_0xb79b('0x30')]['find']({'where':{'id':_0x4dfab9['params']['id']}})[_0xb79b('0x29')](handleEntityNotFound(_0x4a7083,null))[_0xb79b('0x29')](removeEntity(_0x4a7083,null))[_0xb79b('0x4b')](handleError(_0x4a7083,null));};exports['describe']=function(_0x4da10a,_0x51e9d0){return db[_0xb79b('0x30')][_0xb79b('0x50')]()[_0xb79b('0x29')](respondWithResult(_0x51e9d0,null))['catch'](handleError(_0x51e9d0,null));};
\ No newline at end of file
+var _0x6396=['include','findAll','rows','catch','show','params','includeAll','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','options'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6396,0x140));var _0x6639=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x6396[_0x20cb20];return _0x2fcf4b;};'use strict';var emlformat=require(_0x6639('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6639('0x1'));var jsonpatch=require(_0x6639('0x2'));var rp=require(_0x6639('0x3'));var moment=require(_0x6639('0x4'));var BPromise=require(_0x6639('0x5'));var Mustache=require('mustache');var util=require(_0x6639('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(_0x6639('0x7'));var _=require(_0x6639('0x8'));var squel=require(_0x6639('0x9'));var crypto=require(_0x6639('0xa'));var jsforce=require(_0x6639('0xb'));var deskjs=require(_0x6639('0xc'));var toCsv=require(_0x6639('0xd'));var querystring=require(_0x6639('0xe'));var Papa=require(_0x6639('0xf'));var Redis=require(_0x6639('0x10'));var authService=require(_0x6639('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6639('0x12'));var hardwareService=require(_0x6639('0x13'));var logger=require(_0x6639('0x14'))(_0x6639('0x15'));var utils=require(_0x6639('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6639('0x17'));var db=require(_0x6639('0x18'))['db'];function respondWithStatusCode(_0x46421c,_0x522f1c){_0x522f1c=_0x522f1c||0xcc;return function(_0x557257){if(_0x557257){return _0x46421c[_0x6639('0x19')](_0x522f1c);}return _0x46421c[_0x6639('0x1a')](_0x522f1c)[_0x6639('0x1b')]();};}function respondWithResult(_0x432218,_0x55a42f){_0x55a42f=_0x55a42f||0xc8;return function(_0x2cd22e){if(_0x2cd22e){return _0x432218['status'](_0x55a42f)[_0x6639('0x1c')](_0x2cd22e);}};}function respondWithFilteredResult(_0x3cc5ce,_0x2d6a12){return function(_0x1b4cb4){if(_0x1b4cb4){var _0x2fc7e2=typeof _0x2d6a12[_0x6639('0x1d')]===_0x6639('0x1e')&&typeof _0x2d6a12[_0x6639('0x1f')]===_0x6639('0x1e');var _0xf17c7f=_0x1b4cb4[_0x6639('0x20')];var _0x11df0a=_0x2fc7e2?0x0:_0x2d6a12['offset'];var _0x2827bc=_0x2fc7e2?_0x1b4cb4[_0x6639('0x20')]:_0x2d6a12[_0x6639('0x1d')]+_0x2d6a12[_0x6639('0x1f')];var _0x45376c;if(_0x2827bc>=_0xf17c7f){_0x2827bc=_0xf17c7f;_0x45376c=0xc8;}else{_0x45376c=0xce;}_0x3cc5ce['status'](_0x45376c);return _0x3cc5ce['set'](_0x6639('0x21'),_0x11df0a+'-'+_0x2827bc+'/'+_0xf17c7f)['json'](_0x1b4cb4);}return null;};}function patchUpdates(_0x209f4e){return function(_0x1a77a9){try{jsonpatch[_0x6639('0x22')](_0x1a77a9,_0x209f4e,!![]);}catch(_0x1b8976){return BPromise[_0x6639('0x23')](_0x1b8976);}return _0x1a77a9[_0x6639('0x24')]();};}function saveUpdates(_0x5ec1e0,_0x5dd316){return function(_0x58bb88){if(_0x58bb88){return _0x58bb88['update'](_0x5ec1e0)[_0x6639('0x25')](function(_0x1465c9){return _0x1465c9;});}return null;};}function removeEntity(_0x5e1ecf,_0x2c6dbf){return function(_0x542b0f){if(_0x542b0f){return _0x542b0f[_0x6639('0x26')]()[_0x6639('0x25')](function(){_0x5e1ecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd6ed42,_0x2a3238){return function(_0xc602fb){if(!_0xc602fb){_0xd6ed42[_0x6639('0x19')](0x194);}return _0xc602fb;};}function handleError(_0x45e004,_0x4339ad){_0x4339ad=_0x4339ad||0x1f4;return function(_0x5e07a0){logger[_0x6639('0x27')](_0x5e07a0[_0x6639('0x28')]);if(_0x5e07a0['name']){delete _0x5e07a0[_0x6639('0x29')];}_0x45e004[_0x6639('0x1a')](_0x4339ad)[_0x6639('0x2a')](_0x5e07a0);};}exports[_0x6639('0x2b')]=function(_0x55f1c4,_0x48579f){var _0x1cb067={},_0xf612a5={},_0x153693={'count':0x0,'rows':[]};var _0x23c124=_['map'](db[_0x6639('0x2c')][_0x6639('0x2d')],function(_0x5621fe){return{'name':_0x5621fe[_0x6639('0x2e')],'type':_0x5621fe[_0x6639('0x2f')][_0x6639('0x30')]};});_0xf612a5[_0x6639('0x31')]=_[_0x6639('0x32')](_0x23c124,_0x6639('0x29'));_0xf612a5[_0x6639('0x33')]=_['keys'](_0x55f1c4[_0x6639('0x33')]);_0xf612a5[_0x6639('0x34')]=_[_0x6639('0x35')](_0xf612a5[_0x6639('0x31')],_0xf612a5[_0x6639('0x33')]);_0x1cb067[_0x6639('0x36')]=_[_0x6639('0x35')](_0xf612a5[_0x6639('0x31')],qs[_0x6639('0x37')](_0x55f1c4[_0x6639('0x33')][_0x6639('0x37')]));_0x1cb067['attributes']=_0x1cb067[_0x6639('0x36')][_0x6639('0x38')]?_0x1cb067[_0x6639('0x36')]:_0xf612a5[_0x6639('0x31')];if(!_0x55f1c4['query'][_0x6639('0x39')](_0x6639('0x3a'))){_0x1cb067['limit']=qs[_0x6639('0x1f')](_0x55f1c4[_0x6639('0x33')][_0x6639('0x1f')]);_0x1cb067[_0x6639('0x1d')]=qs['offset'](_0x55f1c4[_0x6639('0x33')][_0x6639('0x1d')]);}_0x1cb067[_0x6639('0x3b')]=qs['sort'](_0x55f1c4['query']['sort']);_0x1cb067['where']=qs['filters'](_[_0x6639('0x3c')](_0x55f1c4['query'],_0xf612a5[_0x6639('0x34')]),_0x23c124);if(_0x55f1c4[_0x6639('0x33')][_0x6639('0x3d')]){_0x1cb067['where']=_[_0x6639('0x3e')](_0x1cb067[_0x6639('0x3f')],{'$or':_[_0x6639('0x32')](_0x23c124,function(_0x1ff91f){if(_0x1ff91f[_0x6639('0x2f')]!=='VIRTUAL'){var _0xc8fedd={};_0xc8fedd[_0x1ff91f['name']]={'$like':'%'+_0x55f1c4[_0x6639('0x33')][_0x6639('0x3d')]+'%'};return _0xc8fedd;}})});}_0x1cb067=_['merge']({},_0x1cb067,_0x55f1c4[_0x6639('0x40')]);var _0x4eb620={'where':_0x1cb067[_0x6639('0x3f')]};return db[_0x6639('0x2c')][_0x6639('0x20')](_0x4eb620)[_0x6639('0x25')](function(_0x1c31d9){_0x153693['count']=_0x1c31d9;if(_0x55f1c4['query']['includeAll']){_0x1cb067[_0x6639('0x41')]=[{'all':!![]}];}return db[_0x6639('0x2c')][_0x6639('0x42')](_0x1cb067);})[_0x6639('0x25')](function(_0x2ca5bc){_0x153693[_0x6639('0x43')]=_0x2ca5bc;return _0x153693;})['then'](respondWithFilteredResult(_0x48579f,_0x1cb067))[_0x6639('0x44')](handleError(_0x48579f,null));};exports[_0x6639('0x45')]=function(_0x1d189f,_0x2b5198){var _0x11e224={'raw':!![],'where':{'id':_0x1d189f[_0x6639('0x46')]['id']}},_0xef2284={};_0xef2284['model']=_['keys'](db[_0x6639('0x2c')][_0x6639('0x2d')]);_0xef2284[_0x6639('0x33')]=_['keys'](_0x1d189f[_0x6639('0x33')]);_0xef2284['filters']=_['intersection'](_0xef2284[_0x6639('0x31')],_0xef2284['query']);_0x11e224[_0x6639('0x36')]=_[_0x6639('0x35')](_0xef2284[_0x6639('0x31')],qs[_0x6639('0x37')](_0x1d189f[_0x6639('0x33')][_0x6639('0x37')]));_0x11e224[_0x6639('0x36')]=_0x11e224[_0x6639('0x36')]['length']?_0x11e224[_0x6639('0x36')]:_0xef2284[_0x6639('0x31')];if(_0x1d189f['query'][_0x6639('0x47')]){_0x11e224[_0x6639('0x41')]=[{'all':!![]}];}_0x11e224=_[_0x6639('0x3e')]({},_0x11e224,_0x1d189f[_0x6639('0x40')]);return db['VoiceTransferReport']['find'](_0x11e224)[_0x6639('0x25')](handleEntityNotFound(_0x2b5198,null))[_0x6639('0x25')](respondWithResult(_0x2b5198,null))[_0x6639('0x44')](handleError(_0x2b5198,null));};exports[_0x6639('0x48')]=function(_0x5431d0,_0x4821ed){return db[_0x6639('0x2c')][_0x6639('0x48')](_0x5431d0[_0x6639('0x49')],{})[_0x6639('0x25')](respondWithResult(_0x4821ed,0xc9))['catch'](handleError(_0x4821ed,null));};exports[_0x6639('0x4a')]=function(_0xed7b04,_0x524fe4){if(_0xed7b04['body']['id']){delete _0xed7b04[_0x6639('0x49')]['id'];}return db['VoiceTransferReport'][_0x6639('0x4b')]({'where':{'id':_0xed7b04[_0x6639('0x46')]['id']}})[_0x6639('0x25')](handleEntityNotFound(_0x524fe4,null))['then'](saveUpdates(_0xed7b04[_0x6639('0x49')],null))[_0x6639('0x25')](respondWithResult(_0x524fe4,null))['catch'](handleError(_0x524fe4,null));};exports[_0x6639('0x26')]=function(_0x2f27c7,_0xa31255){return db[_0x6639('0x2c')][_0x6639('0x4b')]({'where':{'id':_0x2f27c7[_0x6639('0x46')]['id']}})[_0x6639('0x25')](handleEntityNotFound(_0xa31255,null))[_0x6639('0x25')](removeEntity(_0xa31255,null))[_0x6639('0x44')](handleError(_0xa31255,null));};exports[_0x6639('0x4c')]=function(_0x130b66,_0x27c562){return db[_0x6639('0x2c')][_0x6639('0x4c')]()['then'](respondWithResult(_0x27c562,null))['catch'](handleError(_0x27c562,null));};
\ No newline at end of file
index fc99771..55ab08e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa90=['define','VoiceTransferReport','report_call_transfer','lodash','util','api','request-promise','path','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xaa90,0x9c));var _0x0aa9=function(_0x3cb815,_0x225c17){_0x3cb815=_0x3cb815-0x0;var _0xbeb84f=_0xaa90[_0x3cb815];return _0xbeb84f;};'use strict';var _=require(_0x0aa9('0x0'));var util=require(_0x0aa9('0x1'));var logger=require('../../config/logger')(_0x0aa9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0aa9('0x3'));var fs=require('fs');var path=require(_0x0aa9('0x4'));var rimraf=require('rimraf');var config=require(_0x0aa9('0x5'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0xa60284,_0x39ffb2){return _0xa60284[_0x0aa9('0x6')](_0x0aa9('0x7'),attributes,{'tableName':_0x0aa9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcecd=['bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcecd,0x10c));var _0xdcec=function(_0x622d,_0x51e4bc){_0x622d=_0x622d-0x0;var _0x212a5f=_0xcecd[_0x622d];return _0x212a5f;};'use strict';var _=require(_0xdcec('0x0'));var util=require(_0xdcec('0x1'));var logger=require(_0xdcec('0x2'))(_0xdcec('0x3'));var moment=require(_0xdcec('0x4'));var BPromise=require(_0xdcec('0x5'));var rp=require(_0xdcec('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcec('0x7'));var config=require(_0xdcec('0x8'));var attributes=require(_0xdcec('0x9'));module[_0xdcec('0xa')]=function(_0x56559a,_0x1e9143){return _0x56559a[_0xdcec('0xb')]('VoiceTransferReport',attributes,{'tableName':_0xdcec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 65d4762..ea1676a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa062=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceTransferReport','create','body','options','raw','then','lodash'];(function(_0x322950,_0x5b38dd){var _0x28dd0c=function(_0x1a8d0e){while(--_0x1a8d0e){_0x322950['push'](_0x322950['shift']());}};_0x28dd0c(++_0x5b38dd);}(_0xa062,0xcf));var _0x2a06=function(_0x233966,_0x5b6367){_0x233966=_0x233966-0x0;var _0x4489eb=_0xa062[_0x233966];return _0x4489eb;};'use strict';var _=require(_0x2a06('0x0'));var util=require('util');var moment=require(_0x2a06('0x1'));var BPromise=require(_0x2a06('0x2'));var rs=require(_0x2a06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a06('0x4'));var logger=require(_0x2a06('0x5'))(_0x2a06('0x6'));var config=require(_0x2a06('0x7'));var jayson=require(_0x2a06('0x8'));var client=jayson['client'][_0x2a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cbce1,_0x59e605,_0x581528){return new BPromise(function(_0x382216,_0x5920ea){return client[_0x2a06('0xa')](_0x2cbce1,_0x581528)['then'](function(_0x258e7d){logger[_0x2a06('0xb')](_0x2a06('0xc'),_0x59e605,_0x2a06('0xd'));logger[_0x2a06('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x59e605,_0x2a06('0xd'),JSON[_0x2a06('0xf')](_0x258e7d));if(_0x258e7d[_0x2a06('0x10')]){if(_0x258e7d[_0x2a06('0x10')]['code']===0x1f4){logger['error'](_0x2a06('0xc'),_0x59e605,_0x258e7d[_0x2a06('0x10')][_0x2a06('0x11')]);return _0x5920ea(_0x258e7d[_0x2a06('0x10')][_0x2a06('0x11')]);}logger[_0x2a06('0x10')](_0x2a06('0xc'),_0x59e605,_0x258e7d[_0x2a06('0x10')][_0x2a06('0x11')]);return _0x382216(_0x258e7d[_0x2a06('0x10')][_0x2a06('0x11')]);}else{logger[_0x2a06('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x59e605,'request\x20sent');_0x382216(_0x258e7d[_0x2a06('0x12')][_0x2a06('0x11')]);}})[_0x2a06('0x13')](function(_0x50ba2e){logger[_0x2a06('0x10')](_0x2a06('0xc'),_0x59e605,_0x50ba2e);_0x5920ea(_0x50ba2e);});});}exports[_0x2a06('0x14')]=function(_0x196052){var _0x2ab29e=this;return new Promise(function(_0x27993b,_0x259b58){return db['VoiceTransferReport'][_0x2a06('0x15')](_0x196052[_0x2a06('0x16')],{'raw':_0x196052[_0x2a06('0x17')]?_0x196052[_0x2a06('0x17')][_0x2a06('0x18')]===undefined?!![]:![]:!![]})[_0x2a06('0x19')](function(_0x22a8dc){logger[_0x2a06('0xb')]('CreateVoiceTransferReport',_0x196052);logger[_0x2a06('0xe')](_0x2a06('0x14'),_0x196052,JSON[_0x2a06('0xf')](_0x22a8dc));_0x27993b(_0x22a8dc);})['catch'](function(_0x4ff6d4){logger[_0x2a06('0x10')](_0x2a06('0x14'),_0x4ff6d4[_0x2a06('0x11')],_0x196052);_0x259b58(_0x2ab29e[_0x2a06('0x10')](0x1f4,_0x4ff6d4[_0x2a06('0x11')]));});});};
\ No newline at end of file
+var _0x49c5=['../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','lodash','util','bluebird','randomstring'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x49c5,0x182));var _0x549c=function(_0x181936,_0x4666ea){_0x181936=_0x181936-0x0;var _0xb9e872=_0x49c5[_0x181936];return _0xb9e872;};'use strict';var _=require(_0x549c('0x0'));var util=require(_0x549c('0x1'));var moment=require('moment');var BPromise=require(_0x549c('0x2'));var rs=require(_0x549c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x549c('0x4'));var logger=require(_0x549c('0x5'))('rpc');var config=require(_0x549c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x549c('0x7')][_0x549c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfe5a4,_0x2f28af,_0x4c3daa){return new BPromise(function(_0x302257,_0x30e3c4){return client['request'](_0xfe5a4,_0x4c3daa)[_0x549c('0x9')](function(_0x45bcef){logger['info'](_0x549c('0xa'),_0x2f28af,_0x549c('0xb'));logger[_0x549c('0xc')](_0x549c('0xd'),_0x2f28af,'request\x20sent',JSON[_0x549c('0xe')](_0x45bcef));if(_0x45bcef[_0x549c('0xf')]){if(_0x45bcef[_0x549c('0xf')]['code']===0x1f4){logger['error'](_0x549c('0xa'),_0x2f28af,_0x45bcef[_0x549c('0xf')]['message']);return _0x30e3c4(_0x45bcef[_0x549c('0xf')][_0x549c('0x10')]);}logger['error'](_0x549c('0xa'),_0x2f28af,_0x45bcef[_0x549c('0xf')][_0x549c('0x10')]);return _0x302257(_0x45bcef[_0x549c('0xf')][_0x549c('0x10')]);}else{logger['info'](_0x549c('0xa'),_0x2f28af,_0x549c('0xb'));_0x302257(_0x45bcef[_0x549c('0x11')][_0x549c('0x10')]);}})[_0x549c('0x12')](function(_0x2531e4){logger[_0x549c('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x2f28af,_0x2531e4);_0x30e3c4(_0x2531e4);});});}exports[_0x549c('0x13')]=function(_0x395e2b){var _0x2883aa=this;return new Promise(function(_0x22aa7e,_0x2a0976){return db[_0x549c('0x14')][_0x549c('0x15')](_0x395e2b[_0x549c('0x16')],{'raw':_0x395e2b[_0x549c('0x17')]?_0x395e2b[_0x549c('0x17')][_0x549c('0x18')]===undefined?!![]:![]:!![]})[_0x549c('0x9')](function(_0x219726){logger[_0x549c('0x19')]('CreateVoiceTransferReport',_0x395e2b);logger[_0x549c('0xc')](_0x549c('0x13'),_0x395e2b,JSON[_0x549c('0xe')](_0x219726));_0x22aa7e(_0x219726);})['catch'](function(_0x203748){logger[_0x549c('0xf')](_0x549c('0x13'),_0x203748[_0x549c('0x10')],_0x395e2b);_0x2a0976(_0x2883aa[_0x549c('0xf')](0x1f4,_0x203748[_0x549c('0x10')]));});});};
\ No newline at end of file
index 55bf60c..1118ada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6227=['hold','/unhold','unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup','canUpdate','hangup','/answer','answer','/hold'];(function(_0x2e4fcf,_0xe03ffe){var _0x561790=function(_0x93856){while(--_0x93856){_0x2e4fcf['push'](_0x2e4fcf['shift']());}};_0x561790(++_0xe03ffe);}(_0x6227,0x70));var _0x7622=function(_0x48d595,_0x2c480b){_0x48d595=_0x48d595-0x0;var _0x516f4d=_0x6227[_0x48d595];return _0x516f4d;};'use strict';var express=require(_0x7622('0x0'));var router=express[_0x7622('0x1')]();var auth=require(_0x7622('0x2'));var controller=require(_0x7622('0x3'));router[_0x7622('0x4')](_0x7622('0x5'),auth[_0x7622('0x6')](),auth['canUpdate'](),controller[_0x7622('0x7')]);router['post'](_0x7622('0x8'),auth[_0x7622('0x6')](),auth[_0x7622('0x9')](),controller[_0x7622('0xa')]);router[_0x7622('0x4')](_0x7622('0xb'),auth['isAuthenticated'](),auth[_0x7622('0x9')](),controller[_0x7622('0xc')]);router[_0x7622('0x4')](_0x7622('0xd'),auth['isAuthenticated'](),auth[_0x7622('0x9')](),controller[_0x7622('0xe')]);router['post'](_0x7622('0xf'),auth[_0x7622('0x6')](),auth[_0x7622('0x9')](),controller[_0x7622('0x10')]);router['post'](_0x7622('0x11'),auth[_0x7622('0x6')](),auth['canUpdate'](),controller[_0x7622('0x12')]);router[_0x7622('0x4')](_0x7622('0x13'),auth[_0x7622('0x6')](),auth['canUpdate'](),controller[_0x7622('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xdade=['express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','answer','/hold','hold','/unhold','unhold','/calls','/transfer','exports'];(function(_0x861f5a,_0x1855ce){var _0x18e11b=function(_0x3c2f96){while(--_0x3c2f96){_0x861f5a['push'](_0x861f5a['shift']());}};_0x18e11b(++_0x1855ce);}(_0xdade,0x1a9));var _0xedad=function(_0x259d11,_0x222597){_0x259d11=_0x259d11-0x0;var _0x34f70c=_0xdade[_0x259d11];return _0x34f70c;};'use strict';var express=require(_0xedad('0x0'));var router=express[_0xedad('0x1')]();var auth=require(_0xedad('0x2'));var controller=require('./webbar.controller');router[_0xedad('0x3')](_0xedad('0x4'),auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller[_0xedad('0x7')]);router['post'](_0xedad('0x8'),auth[_0xedad('0x5')](),auth['canUpdate'](),controller['hangup']);router[_0xedad('0x3')]('/answer',auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller[_0xedad('0x9')]);router['post'](_0xedad('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xedad('0xb')]);router[_0xedad('0x3')](_0xedad('0xc'),auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller[_0xedad('0xd')]);router[_0xedad('0x3')](_0xedad('0xe'),auth[_0xedad('0x5')](),auth[_0xedad('0x6')](),controller['calls']);router['post'](_0xedad('0xf'),auth['isAuthenticated'](),auth['canUpdate'](),controller['transfer']);module[_0xedad('0x10')]=router;
\ No newline at end of file
index 0e800c1..6a6d69c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98d3=['transfer\x20executed!','path','lodash','../../config/environment','bluebird','client','http','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','name','status','send','request','error','message','catch','User','findOne','agent','then','VoiceChannels','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','UserId','conference','webbar:conference','transfer\x20fired:','transferNumber'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x98d3,0x173));var _0x398d=function(_0x23c273,_0x533614){_0x23c273=_0x23c273-0x0;var _0x2bca0d=_0x98d3[_0x23c273];return _0x2bca0d;};'use strict';var path=require(_0x398d('0x0'));var fs=require('fs');var _=require(_0x398d('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x398d('0x2'));var util=require('util');var BPromise=require(_0x398d('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x398d('0x4')][_0x398d('0x5')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0x398d('0x6'));config[_0x398d('0x7')]=_[_0x398d('0x8')](config['redis'],{'host':_0x398d('0x9'),'port':0x18eb});var io=require(_0x398d('0xa'))(new Redis(config[_0x398d('0x7')]));var Schema=require(_0x398d('0xb'));var originateValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x398d('0xd'),'required':[!![],_0x398d('0xe')]},'callerId':{'type':_0x398d('0xd')},'callbackUrl':{'type':_0x398d('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],_0x398d('0xf')]},'sessionId':{'type':_0x398d('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x398d('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],_0x398d('0xf')]},'sessionId':{'type':_0x398d('0xd'),'required':[!![],_0x398d('0x10')]},'transferNumber':{'type':_0x398d('0xd'),'required':[!![],_0x398d('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],_0x398d('0xf')]},'sessionId':{'type':_0x398d('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],_0x398d('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x398d('0xc'),'required':[!![],_0x398d('0xf')]}});function emit(_0x278004,_0x4099a5,_0x3ff03c){logger[_0x398d('0x12')](_0x278004,_0x4099a5,JSON['stringify'](_0x3ff03c));io['to'](_0x278004)[_0x398d('0x13')](_0x4099a5,_0x3ff03c);}function handleError(_0x54e717){return function(_0x673840){console[_0x398d('0x14')](_0x398d('0x15'),_0x673840,_0x673840 instanceof RangeError);logger['error'](_0x673840['stack']);if(_0x673840 instanceof RangeError){if(_0x673840['name']){delete _0x673840[_0x398d('0x16')];}_0x54e717[_0x398d('0x17')](0x194)[_0x398d('0x18')](_0x673840);}else{if(_0x673840[_0x398d('0x16')]){delete _0x673840[_0x398d('0x16')];}_0x54e717[_0x398d('0x17')](0x1f4)[_0x398d('0x18')](_0x673840);}};}function checkError(){return function(_0x552411){if(!_0x552411){throw new RangeError('NotFound');}return _0x552411;};}function respondWithRpcPromise(_0x5e667d,_0x16e580){return new BPromise(function(_0x3b275a,_0x1ea5f9){var _0x2affed=amiClient;return _0x2affed[_0x398d('0x19')](_0x5e667d,_0x16e580)['then'](function(_0x5c4c70){if(_0x5c4c70[_0x398d('0x1a')]){if(_0x5c4c70[_0x398d('0x1a')]['code']===0x1f4){return _0x1ea5f9(_0x5c4c70[_0x398d('0x1a')][_0x398d('0x1b')]);}return _0x3b275a(_0x5c4c70['error']['message']);}else{_0x3b275a(_0x5c4c70['result']);}})[_0x398d('0x1c')](function(_0x2cc4ef){_0x1ea5f9(_0x2cc4ef);});});}function getAgent(_0x24fa2c){return db[_0x398d('0x1d')][_0x398d('0x1e')]({'where':{'id':_0x24fa2c,'role':_0x398d('0x1f')}})[_0x398d('0x20')](checkError());}function getAgentCheckSession(_0x17318c,_0x4f4466){return new BPromise(function(_0x35bd19,_0x557dce){var _0x4aa568=respondWithRpcPromise(_0x398d('0x21'));var _0x27bc6e=getAgent(_0x17318c);Promise['all']([_0x4aa568,_0x27bc6e])[_0x398d('0x20')](function(_0x558249){var _0x3ae172=_0x558249[0x0];var _0x8abf30=_0x558249[0x1];var _0x582d16=_['filter'](_0x3ae172[_0x398d('0x22')],function(_0x2ca780){return _0x2ca780['UserId']==_0x8abf30['id']&&_0x2ca780[_0x398d('0x23')]==_0x4f4466;});if(_0x582d16[_0x398d('0x24')]==0x1){_0x35bd19(_0x8abf30);}else{_0x557dce(new RangeError(_0x398d('0x25')+_0x4f4466+_0x398d('0x26')));}});});}exports[_0x398d('0x27')]=function(_0x3bcc5e,_0x490bee){logger['info'](_0x398d('0x28'),_0x3bcc5e[_0x398d('0x29')]);var _0x45f1a3=originateValidation[_0x398d('0xb')](_0x3bcc5e[_0x398d('0x29')]);if(_0x45f1a3[_0x398d('0x24')]>0x0){return _0x490bee[_0x398d('0x17')](0x190)[_0x398d('0x2a')](_0x45f1a3);}var _0x1827be=_0x3bcc5e['body'][_0x398d('0x2b')];var _0x3807f0=_0x3bcc5e[_0x398d('0x29')]['callNumber'];var _0x5be779=_0x3bcc5e[_0x398d('0x29')][_0x398d('0x2c')];var _0x3fb8ff=_0x3bcc5e[_0x398d('0x29')][_0x398d('0x2d')];return getAgent(_0x1827be)[_0x398d('0x20')](function(_0x324d76){logger[_0x398d('0x12')](_0x398d('0x2e'),_0x324d76[_0x398d('0x16')]);emit(util[_0x398d('0x2f')](_0x398d('0x30'),_0x324d76[_0x398d('0x16')]),_0x398d('0x31'),{'callNumber':_0x3807f0,'callerId':_0x5be779,'callbackUrl':_0x3fb8ff});return _0x490bee[_0x398d('0x17')](0xc8)[_0x398d('0x2a')]({'error':![],'message':_0x398d('0x32')});})[_0x398d('0x1c')](handleError(_0x490bee));};exports[_0x398d('0x33')]=function(_0x5ae43b,_0x244512){logger[_0x398d('0x12')](_0x398d('0x34'),_0x5ae43b[_0x398d('0x29')]);var _0x209c2b=hangupValidation[_0x398d('0xb')](_0x5ae43b[_0x398d('0x29')]);if(_0x209c2b['length']>0x0){return _0x244512[_0x398d('0x17')](0x190)[_0x398d('0x2a')](_0x209c2b);}var _0x165d26=_0x5ae43b[_0x398d('0x29')][_0x398d('0x2b')];var _0x219651=_0x5ae43b[_0x398d('0x29')][_0x398d('0x23')];return getAgent(_0x165d26)['then'](function(_0x208eb2){logger[_0x398d('0x12')](_0x398d('0x2e'),_0x208eb2[_0x398d('0x16')]);emit(util[_0x398d('0x2f')]('user:%s',_0x208eb2[_0x398d('0x16')]),_0x398d('0x35'),{'sessionId':_0x219651});return _0x244512['status'](0xc8)[_0x398d('0x2a')]({'error':![],'message':_0x398d('0x36')});})[_0x398d('0x1c')](handleError(_0x244512));};exports[_0x398d('0x37')]=function(_0x217fc0,_0x30ac4d){logger[_0x398d('0x12')](_0x398d('0x38'),_0x217fc0[_0x398d('0x29')]);var _0x5d7d33=answerValidation[_0x398d('0xb')](_0x217fc0[_0x398d('0x29')]);if(_0x5d7d33[_0x398d('0x24')]>0x0){return _0x30ac4d[_0x398d('0x17')](0x190)[_0x398d('0x2a')](_0x5d7d33);}var _0x227984=_0x217fc0['body'][_0x398d('0x2b')];var _0x1a6bdc=_0x217fc0['body'][_0x398d('0x23')];return getAgent(_0x227984)[_0x398d('0x20')](function(_0x2f419f){logger['info'](_0x398d('0x2e'),_0x2f419f[_0x398d('0x16')]);emit(util[_0x398d('0x2f')](_0x398d('0x30'),_0x2f419f[_0x398d('0x16')]),'webbar:answer',{'sessionId':_0x1a6bdc});return _0x30ac4d[_0x398d('0x17')](0xc8)[_0x398d('0x2a')]({'error':![],'message':_0x398d('0x39')});})['catch'](handleError(_0x30ac4d));};exports[_0x398d('0x3a')]=function(_0x3f9fb2,_0x578a0f){logger[_0x398d('0x12')](_0x398d('0x3b'),_0x3f9fb2[_0x398d('0x29')]);var _0x1f67a9=holdValidation[_0x398d('0xb')](_0x3f9fb2[_0x398d('0x29')]);if(_0x1f67a9[_0x398d('0x24')]>0x0){return _0x578a0f[_0x398d('0x17')](0x190)['json'](_0x1f67a9);}var _0x34c0fc=_0x3f9fb2[_0x398d('0x29')]['userId'];var _0x5f4aef=_0x3f9fb2[_0x398d('0x29')][_0x398d('0x23')];return getAgent(_0x34c0fc)[_0x398d('0x20')](function(_0x35d260){logger['info'](_0x398d('0x2e'),_0x35d260['name']);emit(util[_0x398d('0x2f')]('user:%s',_0x35d260[_0x398d('0x16')]),'webbar:hold',{'sessionId':_0x5f4aef});return _0x578a0f['status'](0xc8)['json']({'error':![],'message':_0x398d('0x3c')});})[_0x398d('0x1c')](handleError(_0x578a0f));};exports[_0x398d('0x3d')]=function(_0x3fa030,_0x578784){logger['info'](_0x398d('0x3e'),_0x3fa030[_0x398d('0x29')]);var _0x1615ee=unholdValidation['validate'](_0x3fa030[_0x398d('0x29')]);if(_0x1615ee[_0x398d('0x24')]>0x0){return _0x578784[_0x398d('0x17')](0x190)[_0x398d('0x2a')](_0x1615ee);}var _0x20c488=_0x3fa030[_0x398d('0x29')]['userId'];var _0x158828=_0x3fa030[_0x398d('0x29')][_0x398d('0x23')];return getAgent(_0x20c488)[_0x398d('0x20')](function(_0x499f2e){logger[_0x398d('0x12')](_0x398d('0x2e'),_0x499f2e[_0x398d('0x16')]);emit(util[_0x398d('0x2f')]('user:%s',_0x499f2e['name']),_0x398d('0x3f'),{'sessionId':_0x158828});return _0x578784['status'](0xc8)[_0x398d('0x2a')]({'error':![],'message':_0x398d('0x40')});})['catch'](handleError(_0x578784));};exports[_0x398d('0x41')]=function(_0x5109e7,_0x2eac8c){logger[_0x398d('0x12')](_0x398d('0x42'),_0x2eac8c[_0x398d('0x29')]);var _0x360e67=callsValidation[_0x398d('0xb')](_0x5109e7[_0x398d('0x29')]);if(_0x360e67[_0x398d('0x24')]>0x0){return _0x2eac8c[_0x398d('0x17')](0x190)[_0x398d('0x2a')](_0x360e67);}var _0x179862=_0x5109e7[_0x398d('0x29')][_0x398d('0x2b')];var _0x783c74=respondWithRpcPromise(_0x398d('0x21'));var _0x3f3108=getAgent(_0x179862);return Promise[_0x398d('0x43')]([_0x783c74,_0x3f3108])[_0x398d('0x20')](function(_0x4717cf){var _0xb25709=_0x4717cf[0x0];var _0x7f4acb=_0x4717cf[0x1];var _0xcd2b9d=_['filter'](_0xb25709[_0x398d('0x22')],function(_0x26d6f8){return _0x26d6f8[_0x398d('0x44')]==_0x7f4acb['id'];});return _0x2eac8c[_0x398d('0x17')](0xc8)[_0x398d('0x2a')]({'count':_0xcd2b9d[_0x398d('0x24')],'rows':_0xcd2b9d});})[_0x398d('0x1c')](handleError(_0x2eac8c));};exports[_0x398d('0x45')]=function(_0xe6cf33,_0x9c3971){logger[_0x398d('0x12')]('conference\x20fired:',_0xe6cf33[_0x398d('0x29')]);var _0x207fd6=conferenceValidation['validate'](_0xe6cf33[_0x398d('0x29')]);if(_0x207fd6['length']>0x0){return _0x9c3971['status'](0x190)['json'](_0x207fd6);}var _0x37646f=_0xe6cf33[_0x398d('0x29')]['userId'];return getAgent(_0x37646f)[_0x398d('0x20')](function(_0x278262){logger[_0x398d('0x12')]('entityFound:',_0x278262[_0x398d('0x16')]);emit(util[_0x398d('0x2f')](_0x398d('0x30'),_0x278262['name']),_0x398d('0x46'));return _0x9c3971['status'](0xc8)[_0x398d('0x2a')]({'error':![],'message':'conference\x20executed!'});})[_0x398d('0x1c')](handleError(_0x9c3971));};exports['transfer']=function(_0x35c204,_0x1b5929){logger[_0x398d('0x12')](_0x398d('0x47'),_0x35c204[_0x398d('0x29')]);var _0x56e3f6=transferValidation[_0x398d('0xb')](_0x35c204[_0x398d('0x29')]);if(_0x56e3f6[_0x398d('0x24')]>0x0){return _0x1b5929[_0x398d('0x17')](0x190)[_0x398d('0x2a')](_0x56e3f6);}var _0x12d76f=_0x35c204[_0x398d('0x29')]['userId'];var _0x227661=_0x35c204[_0x398d('0x29')][_0x398d('0x23')];var _0x5085f4=_0x35c204['body'][_0x398d('0x48')];return getAgent(_0x12d76f)[_0x398d('0x20')](function(_0x540121){logger['info'](_0x398d('0x2e'),_0x540121['name']);emit(util[_0x398d('0x2f')]('user:%s',_0x540121[_0x398d('0x16')]),'webbar:transfer',{'sessionId':_0x227661,'transferNumber':_0x5085f4});return _0x1b5929['status'](0xc8)['json']({'error':![],'message':_0x398d('0x49')});})[_0x398d('0x1c')](handleError(_0x1b5929));};
\ No newline at end of file
+var _0x91a7=['sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','info','answer','webbar:answer','answer\x20executed!','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','calls','calls\x20fired:','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','lodash','../../mysqldb','../../config/environment','bluebird','client','webbarapi','ioredis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','stringify','error','name','status','send','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter'];(function(_0x55caf3,_0x416017){var _0x35e565=function(_0x434c80){while(--_0x434c80){_0x55caf3['push'](_0x55caf3['shift']());}};_0x35e565(++_0x416017);}(_0x91a7,0xe7));var _0x791a=function(_0x31294f,_0x1c65da){_0x31294f=_0x31294f-0x0;var _0x9270f2=_0x91a7[_0x31294f];return _0x9270f2;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x791a('0x0'));var db=require(_0x791a('0x1'))['db'];var config=require(_0x791a('0x2'));var util=require('util');var BPromise=require(_0x791a('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x791a('0x4')]['http']({'port':0x232a});var logger=require('../../config/logger')(_0x791a('0x5'));var Redis=require(_0x791a('0x6'));config['redis']=_[_0x791a('0x7')](config['redis'],{'host':_0x791a('0x8'),'port':0x18eb});var io=require(_0x791a('0x9'))(new Redis(config['redis']));var Schema=require(_0x791a('0xa'));var originateValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'callNumber':{'type':_0x791a('0xd'),'required':[!![],_0x791a('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x791a('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x791a('0xd'),'required':[!![],_0x791a('0xf')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]},'sessionId':{'type':_0x791a('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x791a('0xb'),'required':[!![],_0x791a('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x791a('0xc')]}});function emit(_0x575d11,_0x43dea6,_0x355155){logger['info'](_0x575d11,_0x43dea6,JSON[_0x791a('0x10')](_0x355155));io['to'](_0x575d11)['emit'](_0x43dea6,_0x355155);}function handleError(_0x35fe48){return function(_0x52941d){console['log']('handleError:',_0x52941d,_0x52941d instanceof RangeError);logger[_0x791a('0x11')](_0x52941d['stack']);if(_0x52941d instanceof RangeError){if(_0x52941d['name']){delete _0x52941d[_0x791a('0x12')];}_0x35fe48[_0x791a('0x13')](0x194)[_0x791a('0x14')](_0x52941d);}else{if(_0x52941d[_0x791a('0x12')]){delete _0x52941d['name'];}_0x35fe48[_0x791a('0x13')](0x1f4)[_0x791a('0x14')](_0x52941d);}};}function checkError(){return function(_0x234514){if(!_0x234514){throw new RangeError(_0x791a('0x15'));}return _0x234514;};}function respondWithRpcPromise(_0x530e32,_0x448085){return new BPromise(function(_0x2054c6,_0x25bae5){var _0x9e17b5=amiClient;return _0x9e17b5[_0x791a('0x16')](_0x530e32,_0x448085)[_0x791a('0x17')](function(_0x2241a0){if(_0x2241a0[_0x791a('0x11')]){if(_0x2241a0[_0x791a('0x11')][_0x791a('0x18')]===0x1f4){return _0x25bae5(_0x2241a0[_0x791a('0x11')]['message']);}return _0x2054c6(_0x2241a0[_0x791a('0x11')][_0x791a('0x19')]);}else{_0x2054c6(_0x2241a0[_0x791a('0x1a')]);}})[_0x791a('0x1b')](function(_0x4d748a){_0x25bae5(_0x4d748a);});});}function getAgent(_0x456480){return db[_0x791a('0x1c')]['findOne']({'where':{'id':_0x456480,'role':_0x791a('0x1d')}})[_0x791a('0x17')](checkError());}function getAgentCheckSession(_0x16dbaf,_0x4c1626){return new BPromise(function(_0x29194d,_0x2b3327){var _0x2b0784=respondWithRpcPromise(_0x791a('0x1e'));var _0x4f423=getAgent(_0x16dbaf);Promise[_0x791a('0x1f')]([_0x2b0784,_0x4f423])[_0x791a('0x17')](function(_0x889534){var _0x58bbc0=_0x889534[0x0];var _0xbc3436=_0x889534[0x1];var _0x9e9332=_[_0x791a('0x20')](_0x58bbc0['rows'],function(_0x1cdda9){return _0x1cdda9['UserId']==_0xbc3436['id']&&_0x1cdda9[_0x791a('0x21')]==_0x4c1626;});if(_0x9e9332[_0x791a('0x22')]==0x1){_0x29194d(_0xbc3436);}else{_0x2b3327(new RangeError(_0x791a('0x23')+_0x4c1626+_0x791a('0x24')));}});});}exports[_0x791a('0x25')]=function(_0x32c7b2,_0x15ff6e){logger['info'](_0x791a('0x26'),_0x32c7b2[_0x791a('0x27')]);var _0x3fa066=originateValidation[_0x791a('0xa')](_0x32c7b2[_0x791a('0x27')]);if(_0x3fa066['length']>0x0){return _0x15ff6e[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x3fa066);}var _0x423a1e=_0x32c7b2[_0x791a('0x27')][_0x791a('0x29')];var _0x4ef825=_0x32c7b2[_0x791a('0x27')][_0x791a('0x2a')];var _0x33f998=_0x32c7b2[_0x791a('0x27')][_0x791a('0x2b')];var _0x52104d=_0x32c7b2[_0x791a('0x27')]['callbackUrl'];return getAgent(_0x423a1e)[_0x791a('0x17')](function(_0x4cd047){logger['info'](_0x791a('0x2c'),_0x4cd047[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x4cd047[_0x791a('0x12')]),_0x791a('0x2f'),{'callNumber':_0x4ef825,'callerId':_0x33f998,'callbackUrl':_0x52104d});return _0x15ff6e[_0x791a('0x13')](0xc8)['json']({'error':![],'message':_0x791a('0x30')});})['catch'](handleError(_0x15ff6e));};exports[_0x791a('0x31')]=function(_0x496005,_0x25e8cc){logger[_0x791a('0x32')]('hangup\x20fired:',_0x496005[_0x791a('0x27')]);var _0x22fb89=hangupValidation['validate'](_0x496005[_0x791a('0x27')]);if(_0x22fb89[_0x791a('0x22')]>0x0){return _0x25e8cc[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x22fb89);}var _0x29d267=_0x496005[_0x791a('0x27')][_0x791a('0x29')];var _0xf223d8=_0x496005[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x29d267)['then'](function(_0x15f066){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x15f066['name']);emit(util[_0x791a('0x2d')]('user:%s',_0x15f066['name']),'webbar:hangup',{'sessionId':_0xf223d8});return _0x25e8cc[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x791a('0x1b')](handleError(_0x25e8cc));};exports[_0x791a('0x33')]=function(_0x7987fa,_0x288cc5){logger['info']('answer\x20fired:',_0x7987fa['body']);var _0x2f0395=answerValidation[_0x791a('0xa')](_0x7987fa['body']);if(_0x2f0395[_0x791a('0x22')]>0x0){return _0x288cc5[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x2f0395);}var _0x954164=_0x7987fa['body'][_0x791a('0x29')];var _0x5911db=_0x7987fa[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x954164)[_0x791a('0x17')](function(_0xfa245e){logger[_0x791a('0x32')]('entityFound:',_0xfa245e[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0xfa245e[_0x791a('0x12')]),_0x791a('0x34'),{'sessionId':_0x5911db});return _0x288cc5['status'](0xc8)[_0x791a('0x28')]({'error':![],'message':_0x791a('0x35')});})['catch'](handleError(_0x288cc5));};exports['hold']=function(_0x1eb5b1,_0x338e70){logger[_0x791a('0x32')]('hold\x20fired:',_0x1eb5b1['body']);var _0x37ca2e=holdValidation[_0x791a('0xa')](_0x1eb5b1['body']);if(_0x37ca2e[_0x791a('0x22')]>0x0){return _0x338e70[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x37ca2e);}var _0x549980=_0x1eb5b1['body'][_0x791a('0x29')];var _0x17acda=_0x1eb5b1[_0x791a('0x27')][_0x791a('0x21')];return getAgent(_0x549980)['then'](function(_0x2d7c7d){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x2d7c7d[_0x791a('0x12')]);emit(util['format'](_0x791a('0x2e'),_0x2d7c7d[_0x791a('0x12')]),_0x791a('0x36'),{'sessionId':_0x17acda});return _0x338e70[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':_0x791a('0x37')});})[_0x791a('0x1b')](handleError(_0x338e70));};exports['unhold']=function(_0xdcb1b,_0x1fd826){logger['info'](_0x791a('0x38'),_0xdcb1b[_0x791a('0x27')]);var _0x5dff77=unholdValidation[_0x791a('0xa')](_0xdcb1b[_0x791a('0x27')]);if(_0x5dff77[_0x791a('0x22')]>0x0){return _0x1fd826[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x5dff77);}var _0x4d82eb=_0xdcb1b['body']['userId'];var _0x305033=_0xdcb1b['body']['sessionId'];return getAgent(_0x4d82eb)[_0x791a('0x17')](function(_0x548a4b){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x548a4b['name']);emit(util['format'](_0x791a('0x2e'),_0x548a4b['name']),_0x791a('0x39'),{'sessionId':_0x305033});return _0x1fd826[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'unhold\x20executed!'});})[_0x791a('0x1b')](handleError(_0x1fd826));};exports[_0x791a('0x3a')]=function(_0x5159dd,_0x2a2b95){logger[_0x791a('0x32')](_0x791a('0x3b'),_0x2a2b95[_0x791a('0x27')]);var _0x450ad8=callsValidation[_0x791a('0xa')](_0x5159dd['body']);if(_0x450ad8['length']>0x0){return _0x2a2b95[_0x791a('0x13')](0x190)['json'](_0x450ad8);}var _0x45541b=_0x5159dd[_0x791a('0x27')][_0x791a('0x29')];var _0xf11dea=respondWithRpcPromise(_0x791a('0x1e'));var _0x2bd2cc=getAgent(_0x45541b);return Promise[_0x791a('0x1f')]([_0xf11dea,_0x2bd2cc])['then'](function(_0x1ac6e1){var _0x4691d9=_0x1ac6e1[0x0];var _0xc34c5b=_0x1ac6e1[0x1];var _0x1a4376=_[_0x791a('0x20')](_0x4691d9[_0x791a('0x3c')],function(_0x182b3a){return _0x182b3a['UserId']==_0xc34c5b['id'];});return _0x2a2b95[_0x791a('0x13')](0xc8)['json']({'count':_0x1a4376['length'],'rows':_0x1a4376});})[_0x791a('0x1b')](handleError(_0x2a2b95));};exports[_0x791a('0x3d')]=function(_0x216b69,_0x2e3432){logger[_0x791a('0x32')](_0x791a('0x3e'),_0x216b69[_0x791a('0x27')]);var _0x623ce0=conferenceValidation[_0x791a('0xa')](_0x216b69[_0x791a('0x27')]);if(_0x623ce0[_0x791a('0x22')]>0x0){return _0x2e3432[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x623ce0);}var _0x35ea8c=_0x216b69[_0x791a('0x27')][_0x791a('0x29')];return getAgent(_0x35ea8c)[_0x791a('0x17')](function(_0x156d32){logger[_0x791a('0x32')](_0x791a('0x2c'),_0x156d32['name']);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x156d32[_0x791a('0x12')]),_0x791a('0x3f'));return _0x2e3432[_0x791a('0x13')](0xc8)['json']({'error':![],'message':_0x791a('0x40')});})[_0x791a('0x1b')](handleError(_0x2e3432));};exports[_0x791a('0x41')]=function(_0x120122,_0x5468c4){logger[_0x791a('0x32')]('transfer\x20fired:',_0x120122['body']);var _0x482fa6=transferValidation['validate'](_0x120122[_0x791a('0x27')]);if(_0x482fa6[_0x791a('0x22')]>0x0){return _0x5468c4[_0x791a('0x13')](0x190)[_0x791a('0x28')](_0x482fa6);}var _0x1bf9a3=_0x120122[_0x791a('0x27')][_0x791a('0x29')];var _0x5dca78=_0x120122['body'][_0x791a('0x21')];var _0x185620=_0x120122['body']['transferNumber'];return getAgent(_0x1bf9a3)[_0x791a('0x17')](function(_0x2f9753){logger['info'](_0x791a('0x2c'),_0x2f9753[_0x791a('0x12')]);emit(util[_0x791a('0x2d')](_0x791a('0x2e'),_0x2f9753['name']),'webbar:transfer',{'sessionId':_0x5dca78,'transferNumber':_0x185620});return _0x5468c4[_0x791a('0x13')](0xc8)[_0x791a('0x28')]({'error':![],'message':'transfer\x20executed!'});})[_0x791a('0x1b')](handleError(_0x5468c4));};
\ No newline at end of file
index 6b95f94..4804ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6343=['/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeAnswers','removeAgents','exports','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers'];(function(_0x1a1460,_0x539531){var _0x33ab03=function(_0x26a04b){while(--_0x26a04b){_0x1a1460['push'](_0x1a1460['shift']());}};_0x33ab03(++_0x539531);}(_0x6343,0x168));var _0x3634=function(_0x35191d,_0x5dd14a){_0x35191d=_0x35191d-0x0;var _0x4d7094=_0x6343[_0x35191d];return _0x4d7094;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3634('0x0'));var timeout=require(_0x3634('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3634('0x2'));var config=require(_0x3634('0x3'));var controller=require('./whatsappAccount.controller');router[_0x3634('0x4')]('/',auth[_0x3634('0x5')](),controller['index']);router[_0x3634('0x4')](_0x3634('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x3634('0x4')](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x8')]);router[_0x3634('0x4')](_0x3634('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x3634('0x4')](_0x3634('0xa'),auth['isAuthenticated'](),controller[_0x3634('0xb')]);router[_0x3634('0x4')](_0x3634('0xc'),auth[_0x3634('0x5')](),controller[_0x3634('0xd')]);router[_0x3634('0x4')](_0x3634('0xe'),auth[_0x3634('0x5')](),controller[_0x3634('0xf')]);router[_0x3634('0x10')]('/',auth[_0x3634('0x5')](),controller[_0x3634('0x11')]);router[_0x3634('0x10')](_0x3634('0x9'),auth['isAuthenticated'](),controller[_0x3634('0x12')]);router['post'](_0x3634('0xa'),auth[_0x3634('0x5')](),controller[_0x3634('0x13')]);router[_0x3634('0x10')](_0x3634('0xc'),auth['isAuthenticated'](),controller[_0x3634('0x14')]);router['post']('/:id/applications',auth[_0x3634('0x5')](),controller['addApplications']);router[_0x3634('0x10')](_0x3634('0x15'),controller[_0x3634('0x16')]);router['post'](_0x3634('0x17'),auth[_0x3634('0x5')](),controller['send']);router[_0x3634('0x18')]('/:id',auth[_0x3634('0x5')](),controller[_0x3634('0x19')]);router['delete'](_0x3634('0x7'),auth[_0x3634('0x5')](),controller[_0x3634('0x1a')]);router['delete'](_0x3634('0x9'),auth[_0x3634('0x5')](),controller['removeDispositions']);router[_0x3634('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3634('0x1c')]);router[_0x3634('0x1b')]('/:id/users',auth[_0x3634('0x5')](),controller[_0x3634('0x1d')]);module[_0x3634('0x1e')]=router;
\ No newline at end of file
+var _0x4137=['get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','create','/:id/dispositions','post','addAnswer','addAgents','addApplications','notify','/:id/send','put','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller'];(function(_0x4a62ee,_0x575d71){var _0x2ecc13=function(_0x3f91ae){while(--_0x3f91ae){_0x4a62ee['push'](_0x4a62ee['shift']());}};_0x2ecc13(++_0x575d71);}(_0x4137,0xf8));var _0x7413=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4137[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0xb')]('/:id/dispositions',auth[_0x7413('0xe')](),controller[_0x7413('0x11')]);router[_0x7413('0xb')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller['getAnswers']);router[_0x7413('0xb')](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x14')]);router[_0x7413('0xb')](_0x7413('0x15'),auth['isAuthenticated'](),controller['getApplications']);router['post']('/',auth[_0x7413('0xe')](),controller[_0x7413('0x16')]);router['post'](_0x7413('0x17'),auth[_0x7413('0xe')](),controller['addDisposition']);router[_0x7413('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7413('0x19')]);router['post'](_0x7413('0x13'),auth['isAuthenticated'](),controller[_0x7413('0x1a')]);router[_0x7413('0x18')](_0x7413('0x15'),auth[_0x7413('0xe')](),controller[_0x7413('0x1b')]);router[_0x7413('0x18')]('/:id/notify',controller[_0x7413('0x1c')]);router[_0x7413('0x18')](_0x7413('0x1d'),auth[_0x7413('0xe')](),controller['send']);router[_0x7413('0x1e')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x1f')]);router[_0x7413('0x20')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x21')]);router['delete']('/:id/dispositions',auth[_0x7413('0xe')](),controller['removeDispositions']);router[_0x7413('0x20')](_0x7413('0x12'),auth[_0x7413('0xe')](),controller[_0x7413('0x22')]);router[_0x7413('0x20')](_0x7413('0x13'),auth[_0x7413('0xe')](),controller[_0x7413('0x23')]);module[_0x7413('0x24')]=router;
\ No newline at end of file
index 8a86a16..f9b7a90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca74=['sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xca74,0xa5));var _0x4ca7=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xca74[_0x336264];return _0x53cf91;};'use strict';var Sequelize=require(_0x4ca7('0x0'));var rs=require(_0x4ca7('0x1'));module[_0x4ca7('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x4ca7('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x4ca7('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4ca7('0x5')]();}},'phone':{'type':Sequelize[_0x4ca7('0x4')]},'type':{'type':Sequelize[_0x4ca7('0x6')](_0x4ca7('0x7'))},'accountSid':{'type':Sequelize[_0x4ca7('0x4')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4ca7('0x8');}},'notificationSound':{'type':Sequelize[_0x4ca7('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x4ca7('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ca7('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4ca7('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4ca7('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ca7('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4ca7('0xa')],'comment':_0x4ca7('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x4ca7('0x9')],'defaultValue':![],'comment':_0x4ca7('0xc'),'set':function(_0x43ae83){if(!_0x43ae83){this[_0x4ca7('0xd')]('mandatoryDispositionPauseId',null);}this[_0x4ca7('0xd')](_0x4ca7('0xe'),_0x43ae83);}},'description':{'type':Sequelize[_0x4ca7('0x4')]}};
\ No newline at end of file
+var _0x3be3=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','twilio','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x436738,_0x43c328){var _0x578681=function(_0x31e25d){while(--_0x31e25d){_0x436738['push'](_0x436738['shift']());}};_0x578681(++_0x43c328);}(_0x3be3,0x1a2));var _0x33be=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x3be3[_0x2de020];return _0x182b7c;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x33be('0x0'));module[_0x33be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x33be('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x33be('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x33be('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x33be('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x33be('0x3')]},'type':{'type':Sequelize['ENUM'](_0x33be('0x4'))},'accountSid':{'type':Sequelize[_0x33be('0x3')]},'authToken':{'type':Sequelize[_0x33be('0x3')]},'notificationTemplate':{'type':Sequelize[_0x33be('0x5')],'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[_0x33be('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x33be('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x33be('0x7')],'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[_0x33be('0x7')],'comment':_0x33be('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x33be('0x6')],'defaultValue':![],'comment':_0x33be('0x9'),'set':function(_0x280abd){if(!_0x280abd){this[_0x33be('0xa')](_0x33be('0xb'),null);}this[_0x33be('0xa')](_0x33be('0xc'),_0x280abd);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index eb8ee36..e2ff10e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf23=['userWhatsappAccount:save','removeAgents','isArray','getAgents','addApplications','sequelize','bulkCreate','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','asc','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','replace','whatsapp:','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','ListId','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','json','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','findOne','hasOwnProperty','pick','filter','removeDispositions','ids','CannedAnswer','removeAnswers','addAgents','spread','emit'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xbf23,0x1b2));var _0x3bf2=function(_0x1e62b8,_0x5eed4c){_0x1e62b8=_0x1e62b8-0x0;var _0x2ab271=_0xbf23[_0x1e62b8];return _0x2ab271;};'use strict';var emlformat=require(_0x3bf2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bf2('0x1'));var jsonpatch=require(_0x3bf2('0x2'));var rp=require(_0x3bf2('0x3'));var moment=require(_0x3bf2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3bf2('0x5'));var util=require(_0x3bf2('0x6'));var path=require(_0x3bf2('0x7'));var sox=require(_0x3bf2('0x8'));var csv=require(_0x3bf2('0x9'));var ejs=require(_0x3bf2('0xa'));var fs=require('fs');var fs_extra=require(_0x3bf2('0xb'));var _=require(_0x3bf2('0xc'));var squel=require(_0x3bf2('0xd'));var crypto=require(_0x3bf2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3bf2('0xf'));var toCsv=require(_0x3bf2('0x9'));var querystring=require('querystring');var Papa=require(_0x3bf2('0x10'));var Redis=require(_0x3bf2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3bf2('0x12'));var hardwareService=require(_0x3bf2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3bf2('0x14'));var config=require(_0x3bf2('0x15'));var licenseUtil=require(_0x3bf2('0x16'));var db=require(_0x3bf2('0x17'))['db'];config[_0x3bf2('0x18')]=_[_0x3bf2('0x19')](config[_0x3bf2('0x18')],{'host':_0x3bf2('0x1a'),'port':0x18eb});var socket=require(_0x3bf2('0x1b'))(new Redis(config[_0x3bf2('0x18')]));require(_0x3bf2('0x1c'))[_0x3bf2('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3bf2('0x1e')][_0x3bf2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x28556e,_0x5d4ff4,_0x545903,_0x1773de){return new BPromise(function(_0x2fe7a4,_0x66717f){var _0x2efc1a=_0x1773de||client;return _0x2efc1a[_0x3bf2('0x20')](_0x28556e,_0x545903)['then'](function(_0x75c193){logger['info'](_0x3bf2('0x21'),_0x5d4ff4,_0x3bf2('0x22'));logger[_0x3bf2('0x23')](_0x3bf2('0x24'),_0x5d4ff4,'request\x20sent',JSON[_0x3bf2('0x25')](_0x75c193));if(_0x75c193[_0x3bf2('0x26')]){if(_0x75c193[_0x3bf2('0x26')][_0x3bf2('0x27')]===0x1f4){logger[_0x3bf2('0x26')](_0x3bf2('0x21'),_0x5d4ff4,_0x75c193[_0x3bf2('0x26')][_0x3bf2('0x28')]);return _0x66717f(_0x75c193[_0x3bf2('0x26')][_0x3bf2('0x28')]);}logger['error'](_0x3bf2('0x21'),_0x5d4ff4,_0x75c193[_0x3bf2('0x26')][_0x3bf2('0x28')]);return _0x2fe7a4(_0x75c193['error'][_0x3bf2('0x28')]);}else{logger[_0x3bf2('0x29')](_0x3bf2('0x21'),_0x5d4ff4,_0x3bf2('0x22'));_0x2fe7a4(_0x75c193[_0x3bf2('0x2a')]['message']);}})[_0x3bf2('0x2b')](function(_0x5f4cac){logger['error'](_0x3bf2('0x21'),_0x5d4ff4,_0x5f4cac);_0x66717f(_0x5f4cac);});});}function respondWithStatusCode(_0x12c753,_0x35e7a5){_0x35e7a5=_0x35e7a5||0xcc;return function(_0x1105c8){if(_0x1105c8){return _0x12c753[_0x3bf2('0x2c')](_0x35e7a5);}return _0x12c753[_0x3bf2('0x2d')](_0x35e7a5)[_0x3bf2('0x2e')]();};}function respondWithResult(_0x596d3f,_0x38a347){_0x38a347=_0x38a347||0xc8;return function(_0x13c7e0){if(_0x13c7e0){return _0x596d3f['status'](_0x38a347)['json'](_0x13c7e0);}};}function respondWithFilteredResult(_0x554e37,_0x587e75){return function(_0x45d571){if(_0x45d571){var _0x1b6158=typeof _0x587e75[_0x3bf2('0x2f')]==='undefined'&&typeof _0x587e75[_0x3bf2('0x30')]===_0x3bf2('0x31');var _0x27ccfd=_0x45d571[_0x3bf2('0x32')];var _0x48a931=_0x1b6158?0x0:_0x587e75[_0x3bf2('0x2f')];var _0x364050=_0x1b6158?_0x45d571[_0x3bf2('0x32')]:_0x587e75['offset']+_0x587e75['limit'];var _0x27b5df;if(_0x364050>=_0x27ccfd){_0x364050=_0x27ccfd;_0x27b5df=0xc8;}else{_0x27b5df=0xce;}_0x554e37[_0x3bf2('0x2d')](_0x27b5df);return _0x554e37[_0x3bf2('0x33')]('Content-Range',_0x48a931+'-'+_0x364050+'/'+_0x27ccfd)['json'](_0x45d571);}return null;};}function patchUpdates(_0x29cfd0){return function(_0x16f61b){try{jsonpatch[_0x3bf2('0x34')](_0x16f61b,_0x29cfd0,!![]);}catch(_0x369e61){return BPromise[_0x3bf2('0x35')](_0x369e61);}return _0x16f61b[_0x3bf2('0x36')]();};}function saveUpdates(_0x29b275,_0x554404){return function(_0x87066a){if(_0x87066a){return _0x87066a[_0x3bf2('0x37')](_0x29b275)[_0x3bf2('0x38')](function(_0x4bffe0){return _0x4bffe0;});}return null;};}function removeEntity(_0x5250ba,_0x45e421){return function(_0x3e334e){if(_0x3e334e){return _0x3e334e[_0x3bf2('0x39')]()[_0x3bf2('0x38')](function(){var _0x18828c=_0x3e334e[_0x3bf2('0x3a')]({'plain':!![]});var _0x3a6fbe=_0x3bf2('0x3b');return db[_0x3bf2('0x3c')][_0x3bf2('0x39')]({'where':{'type':_0x3a6fbe,'resourceId':_0x18828c['id']}})[_0x3bf2('0x38')](function(){return _0x3e334e;});})['then'](function(){_0x5250ba[_0x3bf2('0x2d')](0xcc)[_0x3bf2('0x2e')]();});}};}function handleEntityNotFound(_0x956f62,_0x1d26fb){return function(_0x44f8e2){if(!_0x44f8e2){_0x956f62[_0x3bf2('0x2c')](0x194);}return _0x44f8e2;};}function handleError(_0x4be053,_0x2d1ff8){_0x2d1ff8=_0x2d1ff8||0x1f4;return function(_0x44d8e9){logger['error'](_0x44d8e9['stack']);if(_0x44d8e9[_0x3bf2('0x3d')]){delete _0x44d8e9[_0x3bf2('0x3d')];}_0x4be053['status'](_0x2d1ff8)[_0x3bf2('0x3e')](_0x44d8e9);};}exports[_0x3bf2('0x3f')]=function(_0x421e56,_0x5855bb){var _0x424cc3={'include':[{'model':db[_0x3bf2('0x40')],'as':_0x3bf2('0x41')}]},_0x15996f={},_0x4cb751={'count':0x0,'rows':[]};var _0x1254b7=_['map'](db[_0x3bf2('0x42')][_0x3bf2('0x43')],function(_0x3996c2){return{'name':_0x3996c2[_0x3bf2('0x44')],'type':_0x3996c2[_0x3bf2('0x45')][_0x3bf2('0x46')]};});_0x15996f['model']=_[_0x3bf2('0x47')](_0x1254b7,_0x3bf2('0x3d'));_0x15996f['query']=_['keys'](_0x421e56[_0x3bf2('0x48')]);_0x15996f[_0x3bf2('0x49')]=_[_0x3bf2('0x4a')](_0x15996f[_0x3bf2('0x4b')],_0x15996f['query']);_0x424cc3[_0x3bf2('0x4c')]=_[_0x3bf2('0x4a')](_0x15996f['model'],qs['fields'](_0x421e56[_0x3bf2('0x48')][_0x3bf2('0x4d')]));_0x424cc3[_0x3bf2('0x4c')]=_0x424cc3[_0x3bf2('0x4c')][_0x3bf2('0x4e')]?_0x424cc3[_0x3bf2('0x4c')]:_0x15996f[_0x3bf2('0x4b')];if(!_0x421e56['query']['hasOwnProperty'](_0x3bf2('0x4f'))){_0x424cc3[_0x3bf2('0x30')]=qs[_0x3bf2('0x30')](_0x421e56[_0x3bf2('0x48')][_0x3bf2('0x30')]);_0x424cc3[_0x3bf2('0x2f')]=qs['offset'](_0x421e56[_0x3bf2('0x48')][_0x3bf2('0x2f')]);}_0x424cc3[_0x3bf2('0x50')]=qs[_0x3bf2('0x51')](_0x421e56[_0x3bf2('0x48')]['sort']);_0x424cc3[_0x3bf2('0x52')]=qs[_0x3bf2('0x49')](_['pick'](_0x421e56['query'],_0x15996f[_0x3bf2('0x49')]),_0x1254b7);if(_0x421e56[_0x3bf2('0x48')]['filter']){_0x424cc3[_0x3bf2('0x52')]=_[_0x3bf2('0x53')](_0x424cc3[_0x3bf2('0x52')],{'$or':_[_0x3bf2('0x47')](_0x1254b7,function(_0x2acb73){if(_0x2acb73[_0x3bf2('0x45')]!==_0x3bf2('0x54')){var _0x5d3c9a={};_0x5d3c9a[_0x2acb73['name']]={'$like':'%'+_0x421e56[_0x3bf2('0x48')]['filter']+'%'};return _0x5d3c9a;}})});}_0x424cc3=_[_0x3bf2('0x53')]({},_0x424cc3,_0x421e56[_0x3bf2('0x55')]);var _0x354585={'where':_0x424cc3[_0x3bf2('0x52')]};return db[_0x3bf2('0x42')][_0x3bf2('0x32')](_0x354585)[_0x3bf2('0x38')](function(_0x4ad8f4){_0x4cb751['count']=_0x4ad8f4;if(_0x421e56[_0x3bf2('0x48')][_0x3bf2('0x56')]){_0x424cc3['include']=[{'all':!![]}];}return db[_0x3bf2('0x42')][_0x3bf2('0x57')](_0x424cc3);})[_0x3bf2('0x38')](function(_0x20f644){_0x4cb751[_0x3bf2('0x58')]=_0x20f644;return _0x4cb751;})[_0x3bf2('0x38')](respondWithFilteredResult(_0x5855bb,_0x424cc3))[_0x3bf2('0x2b')](handleError(_0x5855bb,null));};exports['show']=function(_0x3611cf,_0x511431){var _0x48d811={'raw':![],'where':{'id':_0x3611cf[_0x3bf2('0x59')]['id']},'include':[{'model':db[_0x3bf2('0x40')],'as':_0x3bf2('0x41')}]},_0x1b3b6d={};_0x1b3b6d[_0x3bf2('0x4b')]=_[_0x3bf2('0x5a')](db[_0x3bf2('0x42')][_0x3bf2('0x43')]);_0x1b3b6d[_0x3bf2('0x48')]=_['keys'](_0x3611cf[_0x3bf2('0x48')]);_0x1b3b6d[_0x3bf2('0x49')]=_[_0x3bf2('0x4a')](_0x1b3b6d[_0x3bf2('0x4b')],_0x1b3b6d[_0x3bf2('0x48')]);_0x48d811[_0x3bf2('0x4c')]=_[_0x3bf2('0x4a')](_0x1b3b6d['model'],qs[_0x3bf2('0x4d')](_0x3611cf[_0x3bf2('0x48')]['fields']));_0x48d811[_0x3bf2('0x4c')]=_0x48d811[_0x3bf2('0x4c')][_0x3bf2('0x4e')]?_0x48d811[_0x3bf2('0x4c')]:_0x1b3b6d['model'];if(_0x3611cf[_0x3bf2('0x48')][_0x3bf2('0x56')]){_0x48d811[_0x3bf2('0x5b')]=[{'all':!![]}];}_0x48d811=_[_0x3bf2('0x53')]({},_0x48d811,_0x3611cf[_0x3bf2('0x55')]);return db[_0x3bf2('0x42')][_0x3bf2('0x5c')](_0x48d811)[_0x3bf2('0x38')](handleEntityNotFound(_0x511431,null))['then'](respondWithResult(_0x511431,null))[_0x3bf2('0x2b')](handleError(_0x511431,null));};exports[_0x3bf2('0x5d')]=function(_0xada31e,_0x4e5f21){return db[_0x3bf2('0x42')][_0x3bf2('0x5d')](_0xada31e[_0x3bf2('0x5e')],{})['then'](function(_0x17149f){var _0x3cb906=_0xada31e[_0x3bf2('0x5f')][_0x3bf2('0x3a')]({'plain':!![]});if(!_0x3cb906)throw new Error(_0x3bf2('0x60'));if(_0x3cb906['role']==='user'){var _0x2ff193=_0x17149f[_0x3bf2('0x3a')]({'plain':!![]});var _0x410cf1='WhatsappAccounts';return db[_0x3bf2('0x61')]['find']({'where':{'name':_0x410cf1,'userProfileId':_0x3cb906[_0x3bf2('0x62')]},'raw':!![]})['then'](function(_0x11290b){if(_0x11290b&&_0x11290b['autoAssociation']===0x0){return db['UserProfileResource'][_0x3bf2('0x5d')]({'name':_0x2ff193[_0x3bf2('0x3d')],'resourceId':_0x2ff193['id'],'type':_0x11290b[_0x3bf2('0x3d')],'sectionId':_0x11290b['id']},{})[_0x3bf2('0x38')](function(){return _0x17149f;});}else{return _0x17149f;}})['catch'](function(_0x4f0635){logger[_0x3bf2('0x26')](_0x3bf2('0x63'),_0x4f0635);throw _0x4f0635;});}return _0x17149f;})[_0x3bf2('0x38')](respondWithResult(_0x4e5f21,0xc9))[_0x3bf2('0x2b')](handleError(_0x4e5f21,null));};exports['update']=function(_0x2b7b95,_0x40e8ac){if(_0x2b7b95['body']['id']){delete _0x2b7b95[_0x3bf2('0x5e')]['id'];}return db[_0x3bf2('0x42')][_0x3bf2('0x5c')]({'where':{'id':_0x2b7b95['params']['id']},'include':[{'model':db[_0x3bf2('0x40')],'as':_0x3bf2('0x41')}]})['then'](handleEntityNotFound(_0x40e8ac,null))['then'](saveUpdates(_0x2b7b95[_0x3bf2('0x5e')],null))[_0x3bf2('0x38')](respondWithResult(_0x40e8ac,null))[_0x3bf2('0x2b')](handleError(_0x40e8ac,null));};exports[_0x3bf2('0x39')]=function(_0x36c83e,_0x33988d){return db[_0x3bf2('0x42')]['find']({'where':{'id':_0x36c83e[_0x3bf2('0x59')]['id']}})['then'](handleEntityNotFound(_0x33988d,null))[_0x3bf2('0x38')](removeEntity(_0x33988d,null))[_0x3bf2('0x2b')](handleError(_0x33988d,null));};exports[_0x3bf2('0x64')]=function(_0x74d05,_0x4cfa75){return db[_0x3bf2('0x42')][_0x3bf2('0x64')]()['then'](respondWithResult(_0x4cfa75,null))[_0x3bf2('0x2b')](handleError(_0x4cfa75,null));};exports[_0x3bf2('0x65')]=function(_0x2a3dc1,_0x24c598,_0x17314b){if(_0x2a3dc1['body']['id']){delete _0x2a3dc1[_0x3bf2('0x5e')]['id'];}return db[_0x3bf2('0x42')][_0x3bf2('0x5c')]({'where':{'id':_0x2a3dc1['params']['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x24c598,null))['then'](function(_0x136482){if(_0x136482){_0x2a3dc1['body'][_0x3bf2('0x66')]=_0x136482['id'];return db[_0x3bf2('0x67')][_0x3bf2('0x5d')](_0x2a3dc1['body']);}})['then'](respondWithResult(_0x24c598,null))['catch'](handleError(_0x24c598,null));};exports['getDispositions']=function(_0x4f6049,_0x31fed2,_0x48bd5c){var _0x53244d={'raw':![],'where':{}};var _0x2c1575={};var _0x4c7749={'count':0x0,'rows':[]};return db[_0x3bf2('0x42')][_0x3bf2('0x68')]({'where':{'id':_0x4f6049['params']['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x31fed2,null))['then'](function(_0x41d289){if(_0x41d289){_0x2c1575['model']=_[_0x3bf2('0x5a')](db[_0x3bf2('0x67')]['rawAttributes']);_0x2c1575[_0x3bf2('0x48')]=_['keys'](_0x4f6049[_0x3bf2('0x48')]);_0x2c1575['filters']=_[_0x3bf2('0x4a')](_0x2c1575[_0x3bf2('0x4b')],_0x2c1575['query']);_0x53244d[_0x3bf2('0x4c')]=_[_0x3bf2('0x4a')](_0x2c1575[_0x3bf2('0x4b')],qs['fields'](_0x4f6049['query'][_0x3bf2('0x4d')]));_0x53244d[_0x3bf2('0x4c')]=_0x53244d['attributes'][_0x3bf2('0x4e')]?_0x53244d[_0x3bf2('0x4c')]:_0x2c1575['model'];if(!_0x4f6049[_0x3bf2('0x48')][_0x3bf2('0x69')]('nolimit')){_0x53244d[_0x3bf2('0x30')]=qs[_0x3bf2('0x30')](_0x4f6049[_0x3bf2('0x48')][_0x3bf2('0x30')]);_0x53244d['offset']=qs[_0x3bf2('0x2f')](_0x4f6049[_0x3bf2('0x48')][_0x3bf2('0x2f')]);}_0x53244d[_0x3bf2('0x50')]=qs[_0x3bf2('0x51')](_0x4f6049[_0x3bf2('0x48')][_0x3bf2('0x51')]);_0x53244d[_0x3bf2('0x52')]=qs[_0x3bf2('0x49')](_[_0x3bf2('0x6a')](_0x4f6049[_0x3bf2('0x48')],_0x2c1575[_0x3bf2('0x49')]));_0x53244d[_0x3bf2('0x52')]['WhatsappAccountId']=_0x41d289['id'];if(_0x4f6049['query'][_0x3bf2('0x6b')]){_0x53244d[_0x3bf2('0x52')]=_[_0x3bf2('0x53')](_0x53244d['where'],{'$or':_[_0x3bf2('0x47')](_0x53244d[_0x3bf2('0x4c')],function(_0x245b0e){var _0x266cf1={};_0x266cf1[_0x245b0e]={'$like':'%'+_0x4f6049[_0x3bf2('0x48')]['filter']+'%'};return _0x266cf1;})});}_0x53244d=_[_0x3bf2('0x53')]({},_0x53244d,_0x4f6049['options']);return db[_0x3bf2('0x67')][_0x3bf2('0x32')]({'where':_0x53244d[_0x3bf2('0x52')]})[_0x3bf2('0x38')](function(_0x35488c){_0x4c7749[_0x3bf2('0x32')]=_0x35488c;if(_0x4f6049['query'][_0x3bf2('0x56')]){_0x53244d[_0x3bf2('0x5b')]=[{'all':!![]}];}return db[_0x3bf2('0x67')]['findAll'](_0x53244d);})[_0x3bf2('0x38')](function(_0x34123f){_0x4c7749[_0x3bf2('0x58')]=_0x34123f;return _0x4c7749;});}})['then'](respondWithFilteredResult(_0x31fed2,_0x53244d))['catch'](handleError(_0x31fed2,null));};exports[_0x3bf2('0x6c')]=function(_0x16ccc6,_0x1bad56,_0x21c14d){return db[_0x3bf2('0x42')][_0x3bf2('0x5c')]({'where':{'id':_0x16ccc6['params']['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x1bad56,null))[_0x3bf2('0x38')](function(_0x450985){if(_0x450985){return _0x450985[_0x3bf2('0x6c')](_0x16ccc6[_0x3bf2('0x48')][_0x3bf2('0x6d')]);}})[_0x3bf2('0x38')](respondWithStatusCode(_0x1bad56,null))[_0x3bf2('0x2b')](handleError(_0x1bad56,null));};exports['addAnswer']=function(_0x1c8468,_0x46b9b2,_0x3c8271){if(_0x1c8468[_0x3bf2('0x5e')]['id']){delete _0x1c8468['body']['id'];}return db[_0x3bf2('0x42')]['find']({'where':{'id':_0x1c8468[_0x3bf2('0x59')]['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x46b9b2,null))['then'](function(_0x393944){if(_0x393944){_0x1c8468[_0x3bf2('0x5e')]['WhatsappAccountId']=_0x393944['id'];return db['CannedAnswer'][_0x3bf2('0x5d')](_0x1c8468[_0x3bf2('0x5e')]);}})[_0x3bf2('0x38')](respondWithResult(_0x46b9b2,null))[_0x3bf2('0x2b')](handleError(_0x46b9b2,null));};exports['getAnswers']=function(_0x57b635,_0x465794,_0x506c52){var _0x283822={'raw':![],'where':{}};var _0xb170d9={};var _0x27b68f={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x3bf2('0x68')]({'where':{'id':_0x57b635['params']['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x465794,null))[_0x3bf2('0x38')](function(_0x3222e4){if(_0x3222e4){_0xb170d9[_0x3bf2('0x4b')]=_[_0x3bf2('0x5a')](db['CannedAnswer'][_0x3bf2('0x43')]);_0xb170d9[_0x3bf2('0x48')]=_[_0x3bf2('0x5a')](_0x57b635[_0x3bf2('0x48')]);_0xb170d9[_0x3bf2('0x49')]=_[_0x3bf2('0x4a')](_0xb170d9[_0x3bf2('0x4b')],_0xb170d9[_0x3bf2('0x48')]);_0x283822[_0x3bf2('0x4c')]=_['intersection'](_0xb170d9[_0x3bf2('0x4b')],qs[_0x3bf2('0x4d')](_0x57b635[_0x3bf2('0x48')]['fields']));_0x283822['attributes']=_0x283822[_0x3bf2('0x4c')][_0x3bf2('0x4e')]?_0x283822[_0x3bf2('0x4c')]:_0xb170d9['model'];if(!_0x57b635['query']['hasOwnProperty']('nolimit')){_0x283822['limit']=qs[_0x3bf2('0x30')](_0x57b635[_0x3bf2('0x48')][_0x3bf2('0x30')]);_0x283822['offset']=qs[_0x3bf2('0x2f')](_0x57b635['query'][_0x3bf2('0x2f')]);}_0x283822['order']=qs['sort'](_0x57b635[_0x3bf2('0x48')][_0x3bf2('0x51')]);_0x283822[_0x3bf2('0x52')]=qs['filters'](_[_0x3bf2('0x6a')](_0x57b635[_0x3bf2('0x48')],_0xb170d9[_0x3bf2('0x49')]));_0x283822[_0x3bf2('0x52')][_0x3bf2('0x66')]=_0x3222e4['id'];if(_0x57b635['query'][_0x3bf2('0x6b')]){_0x283822[_0x3bf2('0x52')]=_['merge'](_0x283822['where'],{'$or':_[_0x3bf2('0x47')](_0x283822[_0x3bf2('0x4c')],function(_0x282c0f){var _0x38c69b={};_0x38c69b[_0x282c0f]={'$like':'%'+_0x57b635[_0x3bf2('0x48')][_0x3bf2('0x6b')]+'%'};return _0x38c69b;})});}_0x283822=_['merge']({},_0x283822,_0x57b635[_0x3bf2('0x55')]);return db[_0x3bf2('0x6e')]['count']({'where':_0x283822[_0x3bf2('0x52')]})['then'](function(_0x1d5b34){_0x27b68f[_0x3bf2('0x32')]=_0x1d5b34;if(_0x57b635[_0x3bf2('0x48')][_0x3bf2('0x56')]){_0x283822['include']=[{'all':!![]}];}return db[_0x3bf2('0x6e')][_0x3bf2('0x57')](_0x283822);})[_0x3bf2('0x38')](function(_0x127dc0){_0x27b68f[_0x3bf2('0x58')]=_0x127dc0;return _0x27b68f;});}})['then'](respondWithFilteredResult(_0x465794,_0x283822))['catch'](handleError(_0x465794,null));};exports[_0x3bf2('0x6f')]=function(_0x45e5bf,_0x4a21f5,_0xb02c5e){return db[_0x3bf2('0x42')]['find']({'where':{'id':_0x45e5bf[_0x3bf2('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a21f5,null))[_0x3bf2('0x38')](function(_0xfb7a3b){if(_0xfb7a3b){return _0xfb7a3b[_0x3bf2('0x6f')](_0x45e5bf['query'][_0x3bf2('0x6d')]);}})[_0x3bf2('0x38')](respondWithStatusCode(_0x4a21f5,null))['catch'](handleError(_0x4a21f5,null));};exports[_0x3bf2('0x70')]=function(_0x4ae7d3,_0x359e0a,_0x29d62d){return db[_0x3bf2('0x42')][_0x3bf2('0x5c')]({'where':{'id':_0x4ae7d3[_0x3bf2('0x59')]['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x359e0a,null))[_0x3bf2('0x38')](function(_0x23e03a){if(_0x23e03a){return _0x23e03a[_0x3bf2('0x70')](_0x4ae7d3[_0x3bf2('0x5e')][_0x3bf2('0x6d')],_['omit'](_0x4ae7d3[_0x3bf2('0x5e')],[_0x3bf2('0x6d'),'id'])||{})[_0x3bf2('0x71')](function(_0x4905af){for(var _0x229985=0x0;_0x229985<_0x4ae7d3[_0x3bf2('0x5e')][_0x3bf2('0x6d')]['length'];_0x229985+=0x1){socket[_0x3bf2('0x72')](_0x3bf2('0x73'),{'UserId':_0x4ae7d3[_0x3bf2('0x5e')][_0x3bf2('0x6d')][_0x229985],'WhatsappAccountId':_0x4ae7d3[_0x3bf2('0x59')]['id']});}return _0x4905af;});}})[_0x3bf2('0x38')](respondWithResult(_0x359e0a,null))[_0x3bf2('0x2b')](handleError(_0x359e0a,null));};exports[_0x3bf2('0x74')]=function(_0x7aea38,_0x45c9eb,_0x465dd4){return db[_0x3bf2('0x42')][_0x3bf2('0x5c')]({'where':{'id':_0x7aea38[_0x3bf2('0x59')]['id']}})['then'](handleEntityNotFound(_0x45c9eb,null))[_0x3bf2('0x38')](function(_0x16d596){if(_0x16d596){return _0x16d596[_0x3bf2('0x74')](_0x7aea38[_0x3bf2('0x48')][_0x3bf2('0x6d')])[_0x3bf2('0x38')](function(){if(_[_0x3bf2('0x75')](_0x7aea38['query'][_0x3bf2('0x6d')])){for(var _0x345f7e=0x0;_0x345f7e<_0x7aea38['query']['ids'][_0x3bf2('0x4e')];_0x345f7e+=0x1){socket[_0x3bf2('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x7aea38[_0x3bf2('0x48')]['ids'][_0x345f7e]),'WhatsappAccountId':Number(_0x7aea38[_0x3bf2('0x59')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x7aea38[_0x3bf2('0x48')][_0x3bf2('0x6d')]),'WhatsappAccountId':Number(_0x7aea38['params']['id'])});}});}})[_0x3bf2('0x38')](respondWithStatusCode(_0x45c9eb,null))['catch'](handleError(_0x45c9eb,null));};exports[_0x3bf2('0x76')]=function(_0x58752c,_0x32c18d,_0x8e7631){var _0x153bb5={};var _0x1c20d5={};var _0x46bf73;var _0x3cf276;return db[_0x3bf2('0x42')][_0x3bf2('0x68')]({'where':{'id':_0x58752c['params']['id']}})['then'](handleEntityNotFound(_0x32c18d,null))[_0x3bf2('0x38')](function(_0x3ed95b){if(_0x3ed95b){_0x46bf73=_0x3ed95b;_0x1c20d5[_0x3bf2('0x4b')]=_[_0x3bf2('0x5a')](db['User'][_0x3bf2('0x43')]);_0x1c20d5[_0x3bf2('0x48')]=_['keys'](_0x58752c[_0x3bf2('0x48')]);_0x1c20d5[_0x3bf2('0x49')]=_['intersection'](_0x1c20d5[_0x3bf2('0x4b')],_0x1c20d5[_0x3bf2('0x48')]);_0x153bb5[_0x3bf2('0x4c')]=_[_0x3bf2('0x4a')](_0x1c20d5[_0x3bf2('0x4b')],qs['fields'](_0x58752c['query']['fields']));_0x153bb5[_0x3bf2('0x4c')]=_0x153bb5[_0x3bf2('0x4c')]['length']?_0x153bb5[_0x3bf2('0x4c')]:_0x1c20d5[_0x3bf2('0x4b')];_0x153bb5['order']=qs[_0x3bf2('0x51')](_0x58752c['query']['sort']);_0x153bb5['where']=qs[_0x3bf2('0x49')](_['pick'](_0x58752c[_0x3bf2('0x48')],_0x1c20d5[_0x3bf2('0x49')]));if(_0x58752c[_0x3bf2('0x48')][_0x3bf2('0x6b')]){_0x153bb5[_0x3bf2('0x52')]=_[_0x3bf2('0x53')](_0x153bb5[_0x3bf2('0x52')],{'$or':_[_0x3bf2('0x47')](_0x153bb5[_0x3bf2('0x4c')],function(_0x5878a8){var _0x84443a={};_0x84443a[_0x5878a8]={'$like':'%'+_0x58752c[_0x3bf2('0x48')][_0x3bf2('0x6b')]+'%'};return _0x84443a;})});}_0x153bb5=_[_0x3bf2('0x53')]({},_0x153bb5,_0x58752c[_0x3bf2('0x55')]);return _0x46bf73[_0x3bf2('0x76')](_0x153bb5);}})[_0x3bf2('0x38')](function(_0x4bde76){if(_0x4bde76){_0x3cf276=_0x4bde76['length'];if(!_0x58752c[_0x3bf2('0x48')][_0x3bf2('0x69')](_0x3bf2('0x4f'))){_0x153bb5[_0x3bf2('0x30')]=qs[_0x3bf2('0x30')](_0x58752c[_0x3bf2('0x48')][_0x3bf2('0x30')]);_0x153bb5[_0x3bf2('0x2f')]=qs[_0x3bf2('0x2f')](_0x58752c[_0x3bf2('0x48')]['offset']);}return _0x46bf73[_0x3bf2('0x76')](_0x153bb5);}})[_0x3bf2('0x38')](function(_0x5b0650){if(_0x5b0650){return _0x5b0650?{'count':_0x3cf276,'rows':_0x5b0650}:null;}})[_0x3bf2('0x38')](respondWithResult(_0x32c18d,null))[_0x3bf2('0x2b')](handleError(_0x32c18d,null));};exports[_0x3bf2('0x77')]=function(_0x2d030b,_0x5234d0,_0x56dd49){return db[_0x3bf2('0x42')][_0x3bf2('0x68')]({'where':{'id':_0x2d030b[_0x3bf2('0x59')]['id']}})[_0x3bf2('0x38')](handleEntityNotFound(_0x5234d0,null))[_0x3bf2('0x38')](function(_0x101c24){if(_0x101c24){return db[_0x3bf2('0x78')]['transaction'](function(_0x1ccc99){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x2d030b['params']['id']},'transaction':_0x1ccc99})[_0x3bf2('0x38')](function(_0x21ff3f){var _0x3cab74=_['map'](_0x2d030b['body'],function(_0x5bf5ac){_0x5bf5ac[_0x3bf2('0x66')]=_0x2d030b[_0x3bf2('0x59')]['id'];return _0x5bf5ac;});return db['WhatsappApplication'][_0x3bf2('0x79')](_0x3cab74,{'transaction':_0x1ccc99});});})['then'](function(){return db[_0x3bf2('0x7a')][_0x3bf2('0x7b')]({'where':{'WhatsappAccountId':_0x2d030b[_0x3bf2('0x59')]['id']},'order':_0x3bf2('0x7c')});});}})[_0x3bf2('0x38')](respondWithResult(_0x5234d0,null))[_0x3bf2('0x2b')](handleError(_0x5234d0,null));};exports[_0x3bf2('0x7d')]=function(_0x3bbf24,_0x46b9cc,_0x37ea63){var _0x2ad72b={};var _0x1f9a63={};var _0x24bb7f;var _0xa725d4;return db[_0x3bf2('0x42')]['findOne']({'where':{'id':_0x3bbf24[_0x3bf2('0x59')]['id']}})['then'](handleEntityNotFound(_0x46b9cc,null))[_0x3bf2('0x38')](function(_0x2008cd){if(_0x2008cd){_0x24bb7f=_0x2008cd;_0x1f9a63[_0x3bf2('0x4b')]=_[_0x3bf2('0x5a')](db[_0x3bf2('0x7a')]['rawAttributes']);_0x1f9a63[_0x3bf2('0x48')]=_[_0x3bf2('0x5a')](_0x3bbf24[_0x3bf2('0x48')]);_0x1f9a63[_0x3bf2('0x49')]=_[_0x3bf2('0x4a')](_0x1f9a63[_0x3bf2('0x4b')],_0x1f9a63[_0x3bf2('0x48')]);_0x2ad72b['attributes']=_[_0x3bf2('0x4a')](_0x1f9a63[_0x3bf2('0x4b')],qs[_0x3bf2('0x4d')](_0x3bbf24['query'][_0x3bf2('0x4d')]));_0x2ad72b['attributes']=_0x2ad72b[_0x3bf2('0x4c')][_0x3bf2('0x4e')]?_0x2ad72b[_0x3bf2('0x4c')]:_0x1f9a63[_0x3bf2('0x4b')];_0x2ad72b[_0x3bf2('0x50')]=qs['sort'](_0x3bbf24['query'][_0x3bf2('0x51')]);_0x2ad72b[_0x3bf2('0x52')]=qs[_0x3bf2('0x49')](_['pick'](_0x3bbf24[_0x3bf2('0x48')],_0x1f9a63[_0x3bf2('0x49')]));if(_0x3bbf24['query'][_0x3bf2('0x6b')]){_0x2ad72b[_0x3bf2('0x52')]=_[_0x3bf2('0x53')](_0x2ad72b['where'],{'$or':_[_0x3bf2('0x47')](_0x2ad72b[_0x3bf2('0x4c')],function(_0x6638c){var _0x3c0cf4={};_0x3c0cf4[_0x6638c]={'$like':'%'+_0x3bbf24[_0x3bf2('0x48')][_0x3bf2('0x6b')]+'%'};return _0x3c0cf4;})});}_0x2ad72b=_['merge']({},_0x2ad72b,_0x3bbf24[_0x3bf2('0x55')]);return _0x24bb7f[_0x3bf2('0x7d')](_0x2ad72b);}})['then'](function(_0x52bc01){if(_0x52bc01){_0xa725d4=_0x52bc01[_0x3bf2('0x4e')];if(!_0x3bbf24[_0x3bf2('0x48')]['hasOwnProperty']('nolimit')){_0x2ad72b['limit']=qs[_0x3bf2('0x30')](_0x3bbf24[_0x3bf2('0x48')][_0x3bf2('0x30')]);_0x2ad72b['offset']=qs[_0x3bf2('0x2f')](_0x3bbf24['query']['offset']);}return _0x24bb7f[_0x3bf2('0x7d')](_0x2ad72b);}})[_0x3bf2('0x38')](function(_0x1f1c9e){if(_0x1f1c9e){return _0x1f1c9e?{'count':_0xa725d4,'rows':_0x1f1c9e}:null;}})[_0x3bf2('0x38')](respondWithResult(_0x46b9cc,null))[_0x3bf2('0x2b')](handleError(_0x46b9cc,null));};exports[_0x3bf2('0x7e')]=function(_0x550c16,_0x56325c,_0x17490d){var _0x41b7e3={'channel':_0x3bf2('0x7f')};var _0x170d91=[];var _0x2cbbe6=[];var _0x2476fa={};return db[_0x3bf2('0x42')]['find']({'where':{'id':_0x550c16[_0x3bf2('0x59')]['id']},'include':[{'model':db[_0x3bf2('0x7a')],'as':_0x3bf2('0x80')}]})[_0x3bf2('0x38')](handleEntityNotFound(_0x56325c,null))[_0x3bf2('0x38')](function(_0x160584){_0x41b7e3[_0x3bf2('0x81')]=_0x160584;_0x41b7e3[_0x3bf2('0x82')]=_['orderBy'](_0x160584[_0x3bf2('0x80')],[_0x3bf2('0x7c')],[_0x3bf2('0x83')]);if(_0x41b7e3[_0x3bf2('0x81')]['Applications']){delete _0x41b7e3['account']['Applications'];}return db['CmContact'][_0x3bf2('0x64')]();})['then'](function(_0x7d0fcf){if(!_0x7d0fcf){throw new db[(_0x3bf2('0x84'))][(_0x3bf2('0x85'))]('no\x20available\x20attributes');}_0x170d91=_[_0x3bf2('0x86')](_[_0x3bf2('0x5a')](_0x7d0fcf),['createdAt','updatedAt']);_0x2cbbe6=_[_0x3bf2('0x86')](_[_0x3bf2('0x5a')](_0x7d0fcf),[_0x3bf2('0x87'),_0x3bf2('0x88'),_0x3bf2('0x89'),'ListId']);_0x41b7e3['body']={'mapKey':_0x3bf2('0x8a')};if(_0x41b7e3[_0x3bf2('0x81')][_0x3bf2('0x45')]&&_0x41b7e3[_0x3bf2('0x81')][_0x3bf2('0x45')]===_0x3bf2('0x8b')){_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x8c')]=_0x550c16[_0x3bf2('0x5e')]['From'][_0x3bf2('0x8d')](_0x3bf2('0x8e'),'');_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x5e')]=_0x550c16[_0x3bf2('0x5e')]['Body'];_0x41b7e3[_0x3bf2('0x5e')]['messageId']=_0x550c16[_0x3bf2('0x5e')]['MessageSid'];}if(_0x41b7e3[_0x3bf2('0x5e')]['id']){delete _0x41b7e3[_0x3bf2('0x5e')]['id'];}if(_[_0x3bf2('0x8f')](_0x41b7e3['body'][_0x3bf2('0x8c')])){throw new db['Sequelize'][(_0x3bf2('0x85'))]('from\x20is\x20mandatory');}if(_[_0x3bf2('0x8f')](_0x41b7e3[_0x3bf2('0x5e')]['body'])||_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x5e')]===''){throw new db[(_0x3bf2('0x84'))][(_0x3bf2('0x85'))](_0x3bf2('0x90'));}if(_[_0x3bf2('0x8f')](_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x91')])){throw new db[(_0x3bf2('0x84'))][(_0x3bf2('0x85'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbbe6);}if(!_[_0x3bf2('0x92')](_0x2cbbe6,_0x41b7e3['body'][_0x3bf2('0x91')])){throw new db['Sequelize'][(_0x3bf2('0x85'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbbe6);}_0x2476fa[_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x91')]]=_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x8c')];return db[_0x3bf2('0x93')][_0x3bf2('0x5c')]({'where':{'id':_0x41b7e3['account'][_0x3bf2('0x94')]},'include':[{'model':db[_0x3bf2('0x95')],'as':_0x3bf2('0x96'),'where':_0x2476fa,'limit':0x1,'order':[[_0x3bf2('0x88'),_0x3bf2('0x97')]]}]});})[_0x3bf2('0x38')](handleEntityNotFound(_0x56325c,null))[_0x3bf2('0x38')](function(_0xbe1c21){if(_0xbe1c21){_0x41b7e3[_0x3bf2('0x98')]=_['omit'](_0xbe1c21,[_0x3bf2('0x96')]);if(_0xbe1c21[_0x3bf2('0x96')][_0x3bf2('0x4e')]){return _0xbe1c21[_0x3bf2('0x96')][0x0];}var _0x5ba996=_[_0x3bf2('0x19')](_0x41b7e3[_0x3bf2('0x5e')],{'firstName':_0x41b7e3['body'][_0x3bf2('0x8c')],'ListId':_0xbe1c21['id']});_0x5ba996[_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x91')]]=_0x41b7e3['body'][_0x3bf2('0x8c')];return db[_0x3bf2('0x95')][_0x3bf2('0x5d')](_0x5ba996,{'fields':_0x170d91,'raw':!![]});}})[_0x3bf2('0x38')](handleEntityNotFound(_0x56325c,null))[_0x3bf2('0x38')](function(_0x4cb4ef){if(_0x4cb4ef){_0x41b7e3[_0x3bf2('0x99')]=_0x4cb4ef;var _0x319f6e={'ContactId':_0x4cb4ef['id'],'phone':_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x8c')],'WhatsappAccountId':_0x550c16['params']['id']};var _0x160152={'ContactId':_0x4cb4ef['id'],'WhatsappAccountId':_0x550c16[_0x3bf2('0x59')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x3bf2('0x5c')]({'where':_0x160152})[_0x3bf2('0x38')](function(_0x50fb91){if(_0x50fb91){return[_0x50fb91,![]];}return db[_0x3bf2('0x9a')]['create'](_0x319f6e)['then'](function(_0x55c70e){return[_0x55c70e,!![]];});});}})['spread'](function(_0x5007eb,_0x270e59){_0x41b7e3[_0x3bf2('0x9b')]=_0x5007eb['get']({'plain':!![]});_0x41b7e3[_0x3bf2('0x9b')][_0x3bf2('0x9c')]=![];if(_0x270e59){if(_0x41b7e3[_0x3bf2('0x81')][_0x3bf2('0x9d')]){_0x41b7e3[_0x3bf2('0x82')][_0x3bf2('0x9e')]({'id':0x0,'priority':_0x41b7e3[_0x3bf2('0x82')]['length']+0x1,'app':_0x3bf2('0x9f'),'appdata':'unmanaged','interval':_0x3bf2('0xa0')});}_0x41b7e3[_0x3bf2('0x9b')][_0x3bf2('0x9c')]=!![];}return db[_0x3bf2('0xa1')]['create']({'phone':_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x8c')],'messageId':_0x41b7e3[_0x3bf2('0x5e')]['messageId'],'body':_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0x5e')],'WhatsappAccountId':_0x550c16['params']['id'],'WhatsappInteractionId':_0x5007eb['id'],'direction':'in','ContactId':_0x5007eb[_0x3bf2('0xa2')],'AttachmentId':_0x41b7e3[_0x3bf2('0x5e')][_0x3bf2('0xa3')]});})[_0x3bf2('0x38')](function(_0x39d125){_0x41b7e3[_0x3bf2('0x28')]=_0x39d125;if(_0x41b7e3[_0x3bf2('0x9b')][_0x3bf2('0xa4')]){return db[_0x3bf2('0xa5')][_0x3bf2('0x5c')]({'attributes':['id',_0x3bf2('0x3d')],'where':{'id':_0x41b7e3['interaction'][_0x3bf2('0xa4')]}})[_0x3bf2('0x38')](function(_0x69d856){if(_0x69d856){_0x41b7e3[_0x3bf2('0x82')][_0x3bf2('0xa6')]({'id':0x0,'priority':0x0,'app':_0x3bf2('0xa7'),'appdata':_0x69d856[_0x3bf2('0x3d')]+','+(_0x41b7e3[_0x3bf2('0x81')][_0x3bf2('0xa8')]||0xa),'interval':_0x3bf2('0xa0')});}return respondWithRpcPromise(_0x3bf2('0xa9'),_0x3bf2('0xaa'),_0x41b7e3);});}return respondWithRpcPromise('Start',_0x3bf2('0xaa'),_0x41b7e3);})['then'](function(_0x1fe0d9){if(_0x1fe0d9){var _0x4a785b=0xc8;var _0x32d5e7=_0x3bf2('0xab');logger['info'](_0x3bf2('0x24'),_0x32d5e7,_0x4a785b,_0x3bf2('0xac'));logger[_0x3bf2('0x23')](_0x3bf2('0xad'),_0x32d5e7,_0x4a785b,_0x3bf2('0xac'),JSON['stringify'](_0x1fe0d9));if(_0x41b7e3[_0x3bf2('0x81')][_0x3bf2('0x45')]===_0x3bf2('0x8b')){return _0x56325c['status'](_0x4a785b)[_0x3bf2('0x33')](_0x3bf2('0xae'),_0x3bf2('0xaf'))[_0x3bf2('0x3e')](_0x3bf2('0xb0'));}else{return _0x56325c[_0x3bf2('0x2d')](_0x4a785b)[_0x3bf2('0xb1')](_0x1fe0d9);}}})[_0x3bf2('0x2b')](handleError(_0x56325c,null));};exports[_0x3bf2('0x3e')]=function(_0x40b5a4,_0x3e5f3b,_0x103c99){var _0x3e8244,_0xe03f39,_0x4e0dbe;if(_[_0x3bf2('0x8f')](_0x40b5a4[_0x3bf2('0x5e')]['body'])||_0x40b5a4[_0x3bf2('0x5e')][_0x3bf2('0x5e')]===''){throw new db[(_0x3bf2('0x84'))][(_0x3bf2('0x85'))](_0x3bf2('0x90'));}if(_[_0x3bf2('0x8f')](_0x40b5a4[_0x3bf2('0x5e')]['to'])){throw new db[(_0x3bf2('0x84'))][(_0x3bf2('0x85'))](_0x3bf2('0xb2'));}_0x3e8244=_0x40b5a4[_0x3bf2('0x5e')]['to'];return db[_0x3bf2('0x42')][_0x3bf2('0x5c')]({'where':{'id':_0x40b5a4[_0x3bf2('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3bf2('0x95')],'as':_0x3bf2('0x96'),'where':{'mobile':_0x3e8244},'limit':0x1,'order':[['updatedAt',_0x3bf2('0x97')]]}]}]})[_0x3bf2('0x38')](handleEntityNotFound(_0x3e5f3b,null))[_0x3bf2('0x38')](function(_0x5ca4e9){if(_0x5ca4e9&&_0x5ca4e9[_0x3bf2('0xb3')]){_0xe03f39=_0x5ca4e9[_0x3bf2('0x3a')]({'plain':!![]});if(_0xe03f39[_0x3bf2('0xb3')]&&_0xe03f39[_0x3bf2('0xb3')][_0x3bf2('0x96')][_0x3bf2('0x4e')]){return _0xe03f39[_0x3bf2('0xb3')]['Contacts'][0x0];}return db[_0x3bf2('0x95')][_0x3bf2('0x5d')](_[_0x3bf2('0x19')](_0x40b5a4['body'],{'firstName':_0x3e8244,'mobile':_0x3e8244,'phone':_0x3e8244,'ListId':_0xe03f39[_0x3bf2('0x94')]}));}})['then'](handleEntityNotFound(_0x3e5f3b,null))[_0x3bf2('0x38')](function(_0x2ebda9){if(_0x2ebda9){_0x4e0dbe=_0x2ebda9;return db[_0x3bf2('0x9a')][_0x3bf2('0x5c')]({'where':{'ContactId':_0x4e0dbe['id'],'closed':![],'WhatsappAccountId':_0xe03f39['id']}})[_0x3bf2('0x38')](function(_0x2b736a){if(_0x2b736a){return[_0x2b736a,![]];}return db[_0x3bf2('0x9a')][_0x3bf2('0x5d')]({'UserId':_0x40b5a4[_0x3bf2('0x5f')]['id'],'ContactId':_0x4e0dbe['id'],'WhatsappAccountId':_0xe03f39['id'],'phone':_0x3e8244,'firstMsgDirection':_0x3bf2('0xb4'),'Messages':[_['merge'](_0x40b5a4[_0x3bf2('0x5e')],{'read':![],'body':_0x40b5a4[_0x3bf2('0x5e')][_0x3bf2('0x5e')],'phone':_0x3e8244,'WhatsappAccountId':_0xe03f39['id'],'UserId':_0x40b5a4['user']['id'],'ContactId':_0x4e0dbe['id']})]},{'include':[{'model':db[_0x3bf2('0xa1')],'as':_0x3bf2('0xb5')}]})[_0x3bf2('0x38')](function(_0x40f16b){return[_0x40f16b,!![]];});});}})[_0x3bf2('0x71')](function(_0x34ddf4,_0x41af5d){if(_0x41af5d){return _0x34ddf4;}return db['WhatsappMessage']['create'](_['merge'](_0x40b5a4[_0x3bf2('0x5e')],{'read':![],'body':_0x40b5a4[_0x3bf2('0x5e')][_0x3bf2('0x5e')],'phone':_0x3e8244,'WhatsappAccountId':_0xe03f39['id'],'WhatsappInteractionId':_0x34ddf4['id'],'UserId':_0x40b5a4[_0x3bf2('0x5f')]['id'],'ContactId':_0x4e0dbe['id']}))[_0x3bf2('0x38')](function(_0x1e25d8){_0x34ddf4[_0x3bf2('0xb6')]['Messages']=[];_0x34ddf4[_0x3bf2('0xb6')]['Messages']['push'](_0x1e25d8['dataValues']);return _0x34ddf4;});})[_0x3bf2('0x38')](respondWithResult(_0x3e5f3b,null))[_0x3bf2('0x2b')](handleError(_0x3e5f3b,null));};
\ No newline at end of file
+var _0x994c=['fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','show','mandatoryDispositionPause','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','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','nolimit','addApplications','WhatsappApplication','bulkCreate','priority','getApplications','notify','whatsapp','Applications','applications','orderBy','asc','account','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','whatsapp:','messageId','MessageSid','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','WhatsappInteraction','interaction','created','push','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','stack','name','send','index','Pause','map','rawAttributes','type','model','query','keys','intersection','attributes'];(function(_0x49c452,_0x4d09b6){var _0x5090e2=function(_0x12a893){while(--_0x12a893){_0x49c452['push'](_0x49c452['shift']());}};_0x5090e2(++_0x4d09b6);}(_0x994c,0x128));var _0xc994=function(_0x1e9763,_0x1b53fd){_0x1e9763=_0x1e9763-0x0;var _0x3397c0=_0x994c[_0x1e9763];return _0x3397c0;};'use strict';var emlformat=require(_0xc994('0x0'));var rimraf=require(_0xc994('0x1'));var zipdir=require(_0xc994('0x2'));var jsonpatch=require(_0xc994('0x3'));var rp=require(_0xc994('0x4'));var moment=require(_0xc994('0x5'));var BPromise=require(_0xc994('0x6'));var Mustache=require(_0xc994('0x7'));var util=require(_0xc994('0x8'));var path=require('path');var sox=require(_0xc994('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc994('0xa'));var jsforce=require(_0xc994('0xb'));var deskjs=require(_0xc994('0xc'));var toCsv=require(_0xc994('0xd'));var querystring=require(_0xc994('0xe'));var Papa=require(_0xc994('0xf'));var Redis=require(_0xc994('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc994('0x11'));var logger=require('../../config/logger')(_0xc994('0x12'));var utils=require(_0xc994('0x13'));var config=require(_0xc994('0x14'));var licenseUtil=require(_0xc994('0x15'));var db=require(_0xc994('0x16'))['db'];config[_0xc994('0x17')]=_[_0xc994('0x18')](config[_0xc994('0x17')],{'host':_0xc994('0x19'),'port':0x18eb});var socket=require(_0xc994('0x1a'))(new Redis(config[_0xc994('0x17')]));require(_0xc994('0x1b'))[_0xc994('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc994('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x2dc376,_0x21929f,_0x119360,_0x5c2f6e){return new BPromise(function(_0x8daefb,_0xa475e2){var _0x6864bf=_0x5c2f6e||client;return _0x6864bf[_0xc994('0x1e')](_0x2dc376,_0x119360)[_0xc994('0x1f')](function(_0x2d8699){logger[_0xc994('0x20')](_0xc994('0x21'),_0x21929f,_0xc994('0x22'));logger[_0xc994('0x23')](_0xc994('0x24'),_0x21929f,_0xc994('0x22'),JSON[_0xc994('0x25')](_0x2d8699));if(_0x2d8699[_0xc994('0x26')]){if(_0x2d8699[_0xc994('0x26')]['code']===0x1f4){logger[_0xc994('0x26')](_0xc994('0x21'),_0x21929f,_0x2d8699[_0xc994('0x26')]['message']);return _0xa475e2(_0x2d8699[_0xc994('0x26')][_0xc994('0x27')]);}logger[_0xc994('0x26')](_0xc994('0x21'),_0x21929f,_0x2d8699[_0xc994('0x26')]['message']);return _0x8daefb(_0x2d8699['error']['message']);}else{logger[_0xc994('0x20')](_0xc994('0x21'),_0x21929f,_0xc994('0x22'));_0x8daefb(_0x2d8699['result'][_0xc994('0x27')]);}})[_0xc994('0x28')](function(_0x1e7a11){logger[_0xc994('0x26')](_0xc994('0x21'),_0x21929f,_0x1e7a11);_0xa475e2(_0x1e7a11);});});}function respondWithStatusCode(_0x1899c4,_0xe3c783){_0xe3c783=_0xe3c783||0xcc;return function(_0x281111){if(_0x281111){return _0x1899c4[_0xc994('0x29')](_0xe3c783);}return _0x1899c4[_0xc994('0x2a')](_0xe3c783)[_0xc994('0x2b')]();};}function respondWithResult(_0x18d503,_0x512794){_0x512794=_0x512794||0xc8;return function(_0xca8897){if(_0xca8897){return _0x18d503[_0xc994('0x2a')](_0x512794)[_0xc994('0x2c')](_0xca8897);}};}function respondWithFilteredResult(_0x6ab90c,_0xee6726){return function(_0x4661b7){if(_0x4661b7){var _0x7a2244=typeof _0xee6726[_0xc994('0x2d')]===_0xc994('0x2e')&&typeof _0xee6726[_0xc994('0x2f')]===_0xc994('0x2e');var _0x29ef3b=_0x4661b7[_0xc994('0x30')];var _0x244571=_0x7a2244?0x0:_0xee6726[_0xc994('0x2d')];var _0x5e1272=_0x7a2244?_0x4661b7[_0xc994('0x30')]:_0xee6726[_0xc994('0x2d')]+_0xee6726[_0xc994('0x2f')];var _0x584fbb;if(_0x5e1272>=_0x29ef3b){_0x5e1272=_0x29ef3b;_0x584fbb=0xc8;}else{_0x584fbb=0xce;}_0x6ab90c[_0xc994('0x2a')](_0x584fbb);return _0x6ab90c[_0xc994('0x31')](_0xc994('0x32'),_0x244571+'-'+_0x5e1272+'/'+_0x29ef3b)[_0xc994('0x2c')](_0x4661b7);}return null;};}function patchUpdates(_0xb223f3){return function(_0x302a7b){try{jsonpatch[_0xc994('0x33')](_0x302a7b,_0xb223f3,!![]);}catch(_0x2f3505){return BPromise[_0xc994('0x34')](_0x2f3505);}return _0x302a7b[_0xc994('0x35')]();};}function saveUpdates(_0x51a538,_0x302412){return function(_0x225bff){if(_0x225bff){return _0x225bff[_0xc994('0x36')](_0x51a538)[_0xc994('0x1f')](function(_0x49281d){return _0x49281d;});}return null;};}function removeEntity(_0x973cf1,_0xfd1417){return function(_0x1662b5){if(_0x1662b5){return _0x1662b5[_0xc994('0x37')]()[_0xc994('0x1f')](function(){var _0x11378c=_0x1662b5[_0xc994('0x38')]({'plain':!![]});var _0x5bfe0d='WhatsappAccounts';return db['UserProfileResource'][_0xc994('0x37')]({'where':{'type':_0x5bfe0d,'resourceId':_0x11378c['id']}})[_0xc994('0x1f')](function(){return _0x1662b5;});})[_0xc994('0x1f')](function(){_0x973cf1[_0xc994('0x2a')](0xcc)[_0xc994('0x2b')]();});}};}function handleEntityNotFound(_0x38ba7b,_0x19771e){return function(_0x127f4e){if(!_0x127f4e){_0x38ba7b[_0xc994('0x29')](0x194);}return _0x127f4e;};}function handleError(_0x3b5312,_0x41ded5){_0x41ded5=_0x41ded5||0x1f4;return function(_0x46f0d9){logger['error'](_0x46f0d9[_0xc994('0x39')]);if(_0x46f0d9[_0xc994('0x3a')]){delete _0x46f0d9[_0xc994('0x3a')];}_0x3b5312[_0xc994('0x2a')](_0x41ded5)[_0xc994('0x3b')](_0x46f0d9);};}exports[_0xc994('0x3c')]=function(_0x2d6088,_0x5de762){var _0x1ff5fb={'include':[{'model':db[_0xc994('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1288fd={},_0x2b7879={'count':0x0,'rows':[]};var _0x47f0e3=_[_0xc994('0x3e')](db['WhatsappAccount'][_0xc994('0x3f')],function(_0x52e42d){return{'name':_0x52e42d['fieldName'],'type':_0x52e42d[_0xc994('0x40')]['key']};});_0x1288fd[_0xc994('0x41')]=_['map'](_0x47f0e3,_0xc994('0x3a'));_0x1288fd[_0xc994('0x42')]=_[_0xc994('0x43')](_0x2d6088[_0xc994('0x42')]);_0x1288fd['filters']=_[_0xc994('0x44')](_0x1288fd[_0xc994('0x41')],_0x1288fd[_0xc994('0x42')]);_0x1ff5fb[_0xc994('0x45')]=_[_0xc994('0x44')](_0x1288fd[_0xc994('0x41')],qs[_0xc994('0x46')](_0x2d6088[_0xc994('0x42')]['fields']));_0x1ff5fb[_0xc994('0x45')]=_0x1ff5fb['attributes'][_0xc994('0x47')]?_0x1ff5fb['attributes']:_0x1288fd[_0xc994('0x41')];if(!_0x2d6088['query'][_0xc994('0x48')]('nolimit')){_0x1ff5fb[_0xc994('0x2f')]=qs[_0xc994('0x2f')](_0x2d6088[_0xc994('0x42')]['limit']);_0x1ff5fb[_0xc994('0x2d')]=qs[_0xc994('0x2d')](_0x2d6088['query'][_0xc994('0x2d')]);}_0x1ff5fb[_0xc994('0x49')]=qs['sort'](_0x2d6088[_0xc994('0x42')][_0xc994('0x4a')]);_0x1ff5fb['where']=qs[_0xc994('0x4b')](_[_0xc994('0x4c')](_0x2d6088['query'],_0x1288fd[_0xc994('0x4b')]),_0x47f0e3);if(_0x2d6088[_0xc994('0x42')][_0xc994('0x4d')]){_0x1ff5fb[_0xc994('0x4e')]=_[_0xc994('0x4f')](_0x1ff5fb[_0xc994('0x4e')],{'$or':_['map'](_0x47f0e3,function(_0x3b9fc5){if(_0x3b9fc5['type']!==_0xc994('0x50')){var _0x1522d7={};_0x1522d7[_0x3b9fc5[_0xc994('0x3a')]]={'$like':'%'+_0x2d6088['query'][_0xc994('0x4d')]+'%'};return _0x1522d7;}})});}_0x1ff5fb=_[_0xc994('0x4f')]({},_0x1ff5fb,_0x2d6088[_0xc994('0x51')]);var _0x41fba8={'where':_0x1ff5fb[_0xc994('0x4e')]};return db[_0xc994('0x52')][_0xc994('0x30')](_0x41fba8)['then'](function(_0x2447a0){_0x2b7879[_0xc994('0x30')]=_0x2447a0;if(_0x2d6088[_0xc994('0x42')][_0xc994('0x53')]){_0x1ff5fb[_0xc994('0x54')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xc994('0x55')](_0x1ff5fb);})[_0xc994('0x1f')](function(_0x1ebfb1){_0x2b7879['rows']=_0x1ebfb1;return _0x2b7879;})['then'](respondWithFilteredResult(_0x5de762,_0x1ff5fb))[_0xc994('0x28')](handleError(_0x5de762,null));};exports[_0xc994('0x56')]=function(_0x45cfb3,_0x416fce){var _0xc620fa={'raw':![],'where':{'id':_0x45cfb3['params']['id']},'include':[{'model':db[_0xc994('0x3d')],'as':_0xc994('0x57')}]},_0x43ed2c={};_0x43ed2c[_0xc994('0x41')]=_[_0xc994('0x43')](db['WhatsappAccount'][_0xc994('0x3f')]);_0x43ed2c[_0xc994('0x42')]=_[_0xc994('0x43')](_0x45cfb3[_0xc994('0x42')]);_0x43ed2c[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x43ed2c['model'],_0x43ed2c[_0xc994('0x42')]);_0xc620fa['attributes']=_[_0xc994('0x44')](_0x43ed2c[_0xc994('0x41')],qs['fields'](_0x45cfb3[_0xc994('0x42')]['fields']));_0xc620fa['attributes']=_0xc620fa[_0xc994('0x45')][_0xc994('0x47')]?_0xc620fa[_0xc994('0x45')]:_0x43ed2c[_0xc994('0x41')];if(_0x45cfb3[_0xc994('0x42')][_0xc994('0x53')]){_0xc620fa[_0xc994('0x54')]=[{'all':!![]}];}_0xc620fa=_[_0xc994('0x4f')]({},_0xc620fa,_0x45cfb3[_0xc994('0x51')]);return db[_0xc994('0x52')][_0xc994('0x58')](_0xc620fa)[_0xc994('0x1f')](handleEntityNotFound(_0x416fce,null))[_0xc994('0x1f')](respondWithResult(_0x416fce,null))[_0xc994('0x28')](handleError(_0x416fce,null));};exports['create']=function(_0x550f57,_0x44280d){return db[_0xc994('0x52')][_0xc994('0x59')](_0x550f57[_0xc994('0x5a')],{})[_0xc994('0x1f')](function(_0x374a19){var _0x34d1b1=_0x550f57[_0xc994('0x5b')][_0xc994('0x38')]({'plain':!![]});if(!_0x34d1b1)throw new Error(_0xc994('0x5c'));if(_0x34d1b1[_0xc994('0x5d')]==='user'){var _0xc0b57a=_0x374a19[_0xc994('0x38')]({'plain':!![]});var _0x24ce25=_0xc994('0x5e');return db[_0xc994('0x5f')][_0xc994('0x58')]({'where':{'name':_0x24ce25,'userProfileId':_0x34d1b1[_0xc994('0x60')]},'raw':!![]})[_0xc994('0x1f')](function(_0x198b58){if(_0x198b58&&_0x198b58[_0xc994('0x61')]===0x0){return db[_0xc994('0x62')][_0xc994('0x59')]({'name':_0xc0b57a[_0xc994('0x3a')],'resourceId':_0xc0b57a['id'],'type':_0x198b58[_0xc994('0x3a')],'sectionId':_0x198b58['id']},{})['then'](function(){return _0x374a19;});}else{return _0x374a19;}})['catch'](function(_0x4e1485){logger[_0xc994('0x26')](_0xc994('0x63'),_0x4e1485);throw _0x4e1485;});}return _0x374a19;})[_0xc994('0x1f')](respondWithResult(_0x44280d,0xc9))[_0xc994('0x28')](handleError(_0x44280d,null));};exports[_0xc994('0x36')]=function(_0x3fab60,_0x8ab565){if(_0x3fab60[_0xc994('0x5a')]['id']){delete _0x3fab60['body']['id'];}return db['WhatsappAccount'][_0xc994('0x58')]({'where':{'id':_0x3fab60[_0xc994('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xc994('0x57')}]})['then'](handleEntityNotFound(_0x8ab565,null))['then'](saveUpdates(_0x3fab60[_0xc994('0x5a')],null))[_0xc994('0x1f')](respondWithResult(_0x8ab565,null))[_0xc994('0x28')](handleError(_0x8ab565,null));};exports['destroy']=function(_0x43accd,_0x71bd8c){return db['WhatsappAccount']['find']({'where':{'id':_0x43accd['params']['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x71bd8c,null))[_0xc994('0x1f')](removeEntity(_0x71bd8c,null))[_0xc994('0x28')](handleError(_0x71bd8c,null));};exports[_0xc994('0x65')]=function(_0x7e44bc,_0x3e6e2c){return db[_0xc994('0x52')][_0xc994('0x65')]()[_0xc994('0x1f')](respondWithResult(_0x3e6e2c,null))[_0xc994('0x28')](handleError(_0x3e6e2c,null));};exports[_0xc994('0x66')]=function(_0x120020,_0x4860cb,_0x11d3ff){if(_0x120020[_0xc994('0x5a')]['id']){delete _0x120020[_0xc994('0x5a')]['id'];}return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x120020['params']['id']}})['then'](handleEntityNotFound(_0x4860cb,null))[_0xc994('0x1f')](function(_0x30cc6a){if(_0x30cc6a){_0x120020[_0xc994('0x5a')][_0xc994('0x67')]=_0x30cc6a['id'];return db[_0xc994('0x68')][_0xc994('0x59')](_0x120020[_0xc994('0x5a')]);}})[_0xc994('0x1f')](respondWithResult(_0x4860cb,null))[_0xc994('0x28')](handleError(_0x4860cb,null));};exports[_0xc994('0x69')]=function(_0x9a93de,_0x42a395,_0xde1422){var _0x57760f={'raw':![],'where':{}};var _0xe83148={};var _0x5a3f94={'count':0x0,'rows':[]};return db[_0xc994('0x52')]['findOne']({'where':{'id':_0x9a93de[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x42a395,null))[_0xc994('0x1f')](function(_0x45094d){if(_0x45094d){_0xe83148['model']=_[_0xc994('0x43')](db[_0xc994('0x68')][_0xc994('0x3f')]);_0xe83148[_0xc994('0x42')]=_['keys'](_0x9a93de[_0xc994('0x42')]);_0xe83148[_0xc994('0x4b')]=_[_0xc994('0x44')](_0xe83148[_0xc994('0x41')],_0xe83148[_0xc994('0x42')]);_0x57760f[_0xc994('0x45')]=_[_0xc994('0x44')](_0xe83148[_0xc994('0x41')],qs[_0xc994('0x46')](_0x9a93de[_0xc994('0x42')][_0xc994('0x46')]));_0x57760f[_0xc994('0x45')]=_0x57760f['attributes'][_0xc994('0x47')]?_0x57760f[_0xc994('0x45')]:_0xe83148['model'];if(!_0x9a93de['query'][_0xc994('0x48')]('nolimit')){_0x57760f[_0xc994('0x2f')]=qs[_0xc994('0x2f')](_0x9a93de[_0xc994('0x42')][_0xc994('0x2f')]);_0x57760f['offset']=qs[_0xc994('0x2d')](_0x9a93de['query'][_0xc994('0x2d')]);}_0x57760f[_0xc994('0x49')]=qs[_0xc994('0x4a')](_0x9a93de[_0xc994('0x42')][_0xc994('0x4a')]);_0x57760f[_0xc994('0x4e')]=qs[_0xc994('0x4b')](_['pick'](_0x9a93de[_0xc994('0x42')],_0xe83148['filters']));_0x57760f[_0xc994('0x4e')][_0xc994('0x67')]=_0x45094d['id'];if(_0x9a93de[_0xc994('0x42')][_0xc994('0x4d')]){_0x57760f[_0xc994('0x4e')]=_['merge'](_0x57760f['where'],{'$or':_[_0xc994('0x3e')](_0x57760f[_0xc994('0x45')],function(_0x494458){var _0x88ec05={};_0x88ec05[_0x494458]={'$like':'%'+_0x9a93de[_0xc994('0x42')][_0xc994('0x4d')]+'%'};return _0x88ec05;})});}_0x57760f=_[_0xc994('0x4f')]({},_0x57760f,_0x9a93de[_0xc994('0x51')]);return db[_0xc994('0x68')]['count']({'where':_0x57760f['where']})['then'](function(_0x337b74){_0x5a3f94[_0xc994('0x30')]=_0x337b74;if(_0x9a93de[_0xc994('0x42')][_0xc994('0x53')]){_0x57760f[_0xc994('0x54')]=[{'all':!![]}];}return db[_0xc994('0x68')][_0xc994('0x55')](_0x57760f);})['then'](function(_0x2f0d84){_0x5a3f94[_0xc994('0x6a')]=_0x2f0d84;return _0x5a3f94;});}})[_0xc994('0x1f')](respondWithFilteredResult(_0x42a395,_0x57760f))[_0xc994('0x28')](handleError(_0x42a395,null));};exports[_0xc994('0x6b')]=function(_0x28a616,_0x40a2b1,_0xdfb731){return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x28a616[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x40a2b1,null))[_0xc994('0x1f')](function(_0x3ec2cf){if(_0x3ec2cf){return _0x3ec2cf['removeDispositions'](_0x28a616[_0xc994('0x42')][_0xc994('0x6c')]);}})[_0xc994('0x1f')](respondWithStatusCode(_0x40a2b1,null))['catch'](handleError(_0x40a2b1,null));};exports[_0xc994('0x6d')]=function(_0x166352,_0x3d1ca1,_0x2feb87){if(_0x166352[_0xc994('0x5a')]['id']){delete _0x166352[_0xc994('0x5a')]['id'];}return db[_0xc994('0x52')]['find']({'where':{'id':_0x166352[_0xc994('0x64')]['id']}})['then'](handleEntityNotFound(_0x3d1ca1,null))[_0xc994('0x1f')](function(_0x1baa0f){if(_0x1baa0f){_0x166352[_0xc994('0x5a')][_0xc994('0x67')]=_0x1baa0f['id'];return db['CannedAnswer']['create'](_0x166352[_0xc994('0x5a')]);}})['then'](respondWithResult(_0x3d1ca1,null))[_0xc994('0x28')](handleError(_0x3d1ca1,null));};exports['getAnswers']=function(_0x364f23,_0x424fa8,_0x206f72){var _0x2839db={'raw':![],'where':{}};var _0x4a6173={};var _0x1fbe0d={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xc994('0x6e')]({'where':{'id':_0x364f23[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x424fa8,null))[_0xc994('0x1f')](function(_0x3d6718){if(_0x3d6718){_0x4a6173[_0xc994('0x41')]=_[_0xc994('0x43')](db[_0xc994('0x6f')][_0xc994('0x3f')]);_0x4a6173['query']=_[_0xc994('0x43')](_0x364f23['query']);_0x4a6173[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x4a6173[_0xc994('0x41')],_0x4a6173[_0xc994('0x42')]);_0x2839db[_0xc994('0x45')]=_['intersection'](_0x4a6173[_0xc994('0x41')],qs[_0xc994('0x46')](_0x364f23[_0xc994('0x42')][_0xc994('0x46')]));_0x2839db['attributes']=_0x2839db[_0xc994('0x45')][_0xc994('0x47')]?_0x2839db[_0xc994('0x45')]:_0x4a6173[_0xc994('0x41')];if(!_0x364f23[_0xc994('0x42')][_0xc994('0x48')]('nolimit')){_0x2839db[_0xc994('0x2f')]=qs[_0xc994('0x2f')](_0x364f23['query']['limit']);_0x2839db[_0xc994('0x2d')]=qs['offset'](_0x364f23[_0xc994('0x42')]['offset']);}_0x2839db['order']=qs[_0xc994('0x4a')](_0x364f23[_0xc994('0x42')][_0xc994('0x4a')]);_0x2839db[_0xc994('0x4e')]=qs['filters'](_[_0xc994('0x4c')](_0x364f23[_0xc994('0x42')],_0x4a6173[_0xc994('0x4b')]));_0x2839db[_0xc994('0x4e')][_0xc994('0x67')]=_0x3d6718['id'];if(_0x364f23['query'][_0xc994('0x4d')]){_0x2839db[_0xc994('0x4e')]=_['merge'](_0x2839db['where'],{'$or':_[_0xc994('0x3e')](_0x2839db[_0xc994('0x45')],function(_0x10dd42){var _0x304721={};_0x304721[_0x10dd42]={'$like':'%'+_0x364f23[_0xc994('0x42')][_0xc994('0x4d')]+'%'};return _0x304721;})});}_0x2839db=_[_0xc994('0x4f')]({},_0x2839db,_0x364f23['options']);return db[_0xc994('0x6f')]['count']({'where':_0x2839db[_0xc994('0x4e')]})[_0xc994('0x1f')](function(_0x40c1f8){_0x1fbe0d[_0xc994('0x30')]=_0x40c1f8;if(_0x364f23['query'][_0xc994('0x53')]){_0x2839db['include']=[{'all':!![]}];}return db[_0xc994('0x6f')][_0xc994('0x55')](_0x2839db);})['then'](function(_0x3424c3){_0x1fbe0d[_0xc994('0x6a')]=_0x3424c3;return _0x1fbe0d;});}})[_0xc994('0x1f')](respondWithFilteredResult(_0x424fa8,_0x2839db))['catch'](handleError(_0x424fa8,null));};exports[_0xc994('0x70')]=function(_0x4bf9d4,_0x40a8d1,_0xd8a3c8){return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x4bf9d4[_0xc994('0x64')]['id']}})['then'](handleEntityNotFound(_0x40a8d1,null))['then'](function(_0x2fa3c3){if(_0x2fa3c3){return _0x2fa3c3[_0xc994('0x70')](_0x4bf9d4[_0xc994('0x42')][_0xc994('0x6c')]);}})[_0xc994('0x1f')](respondWithStatusCode(_0x40a8d1,null))[_0xc994('0x28')](handleError(_0x40a8d1,null));};exports[_0xc994('0x71')]=function(_0x134c48,_0xb355ca,_0x1e9614){return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x134c48[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0xb355ca,null))['then'](function(_0x1c0fc3){if(_0x1c0fc3){return _0x1c0fc3['addAgents'](_0x134c48['body'][_0xc994('0x6c')],_[_0xc994('0x72')](_0x134c48['body'],['ids','id'])||{})[_0xc994('0x73')](function(_0x5b93cf){for(var _0x2f1bae=0x0;_0x2f1bae<_0x134c48['body'][_0xc994('0x6c')]['length'];_0x2f1bae+=0x1){socket[_0xc994('0x74')]('userWhatsappAccount:save',{'UserId':_0x134c48[_0xc994('0x5a')][_0xc994('0x6c')][_0x2f1bae],'WhatsappAccountId':_0x134c48[_0xc994('0x64')]['id']});}return _0x5b93cf;});}})[_0xc994('0x1f')](respondWithResult(_0xb355ca,null))['catch'](handleError(_0xb355ca,null));};exports[_0xc994('0x75')]=function(_0x570f28,_0x10573f,_0x1f1173){return db['WhatsappAccount'][_0xc994('0x58')]({'where':{'id':_0x570f28[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x10573f,null))['then'](function(_0x158ebf){if(_0x158ebf){return _0x158ebf[_0xc994('0x75')](_0x570f28[_0xc994('0x42')][_0xc994('0x6c')])[_0xc994('0x1f')](function(){if(_[_0xc994('0x76')](_0x570f28[_0xc994('0x42')][_0xc994('0x6c')])){for(var _0x1fb225=0x0;_0x1fb225<_0x570f28[_0xc994('0x42')][_0xc994('0x6c')][_0xc994('0x47')];_0x1fb225+=0x1){socket['emit'](_0xc994('0x77'),{'UserId':Number(_0x570f28[_0xc994('0x42')][_0xc994('0x6c')][_0x1fb225]),'WhatsappAccountId':Number(_0x570f28[_0xc994('0x64')]['id'])});}}else{socket['emit'](_0xc994('0x77'),{'UserId':Number(_0x570f28[_0xc994('0x42')][_0xc994('0x6c')]),'WhatsappAccountId':Number(_0x570f28[_0xc994('0x64')]['id'])});}});}})[_0xc994('0x1f')](respondWithStatusCode(_0x10573f,null))[_0xc994('0x28')](handleError(_0x10573f,null));};exports[_0xc994('0x78')]=function(_0x1268f0,_0x42c8ca,_0x9f7226){var _0xefebc={};var _0x477408={};var _0x355137;var _0x3f5cb9;return db[_0xc994('0x52')][_0xc994('0x6e')]({'where':{'id':_0x1268f0[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x42c8ca,null))['then'](function(_0x293916){if(_0x293916){_0x355137=_0x293916;_0x477408[_0xc994('0x41')]=_[_0xc994('0x43')](db[_0xc994('0x79')]['rawAttributes']);_0x477408['query']=_['keys'](_0x1268f0[_0xc994('0x42')]);_0x477408[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x477408[_0xc994('0x41')],_0x477408[_0xc994('0x42')]);_0xefebc[_0xc994('0x45')]=_[_0xc994('0x44')](_0x477408[_0xc994('0x41')],qs[_0xc994('0x46')](_0x1268f0['query'][_0xc994('0x46')]));_0xefebc[_0xc994('0x45')]=_0xefebc[_0xc994('0x45')][_0xc994('0x47')]?_0xefebc[_0xc994('0x45')]:_0x477408[_0xc994('0x41')];_0xefebc['order']=qs[_0xc994('0x4a')](_0x1268f0[_0xc994('0x42')][_0xc994('0x4a')]);_0xefebc[_0xc994('0x4e')]=qs[_0xc994('0x4b')](_[_0xc994('0x4c')](_0x1268f0[_0xc994('0x42')],_0x477408[_0xc994('0x4b')]));if(_0x1268f0[_0xc994('0x42')][_0xc994('0x4d')]){_0xefebc[_0xc994('0x4e')]=_[_0xc994('0x4f')](_0xefebc[_0xc994('0x4e')],{'$or':_[_0xc994('0x3e')](_0xefebc[_0xc994('0x45')],function(_0x1491ea){var _0x2a9832={};_0x2a9832[_0x1491ea]={'$like':'%'+_0x1268f0[_0xc994('0x42')][_0xc994('0x4d')]+'%'};return _0x2a9832;})});}_0xefebc=_[_0xc994('0x4f')]({},_0xefebc,_0x1268f0[_0xc994('0x51')]);return _0x355137['getAgents'](_0xefebc);}})[_0xc994('0x1f')](function(_0x355dd0){if(_0x355dd0){_0x3f5cb9=_0x355dd0[_0xc994('0x47')];if(!_0x1268f0[_0xc994('0x42')]['hasOwnProperty'](_0xc994('0x7a'))){_0xefebc['limit']=qs[_0xc994('0x2f')](_0x1268f0[_0xc994('0x42')][_0xc994('0x2f')]);_0xefebc[_0xc994('0x2d')]=qs[_0xc994('0x2d')](_0x1268f0['query'][_0xc994('0x2d')]);}return _0x355137['getAgents'](_0xefebc);}})[_0xc994('0x1f')](function(_0x2edc02){if(_0x2edc02){return _0x2edc02?{'count':_0x3f5cb9,'rows':_0x2edc02}:null;}})[_0xc994('0x1f')](respondWithResult(_0x42c8ca,null))[_0xc994('0x28')](handleError(_0x42c8ca,null));};exports[_0xc994('0x7b')]=function(_0x4d590d,_0x4e60f3,_0x1df500){return db[_0xc994('0x52')][_0xc994('0x6e')]({'where':{'id':_0x4d590d[_0xc994('0x64')]['id']}})[_0xc994('0x1f')](handleEntityNotFound(_0x4e60f3,null))[_0xc994('0x1f')](function(_0x512682){if(_0x512682){return db['sequelize']['transaction'](function(_0x947b9f){return db['WhatsappApplication'][_0xc994('0x37')]({'where':{'WhatsappAccountId':_0x4d590d[_0xc994('0x64')]['id']},'transaction':_0x947b9f})[_0xc994('0x1f')](function(_0x468517){var _0xa2402f=_['map'](_0x4d590d[_0xc994('0x5a')],function(_0x152eef){_0x152eef['WhatsappAccountId']=_0x4d590d['params']['id'];return _0x152eef;});return db[_0xc994('0x7c')][_0xc994('0x7d')](_0xa2402f,{'transaction':_0x947b9f});});})[_0xc994('0x1f')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x4d590d[_0xc994('0x64')]['id']},'order':_0xc994('0x7e')});});}})['then'](respondWithResult(_0x4e60f3,null))['catch'](handleError(_0x4e60f3,null));};exports['getApplications']=function(_0x1b9042,_0x45f65e,_0x3d27f0){var _0x429e07={};var _0x21ae2d={};var _0x145fd0;var _0x6a0e35;return db[_0xc994('0x52')][_0xc994('0x6e')]({'where':{'id':_0x1b9042['params']['id']}})['then'](handleEntityNotFound(_0x45f65e,null))['then'](function(_0x3da51b){if(_0x3da51b){_0x145fd0=_0x3da51b;_0x21ae2d['model']=_[_0xc994('0x43')](db[_0xc994('0x7c')][_0xc994('0x3f')]);_0x21ae2d[_0xc994('0x42')]=_[_0xc994('0x43')](_0x1b9042['query']);_0x21ae2d[_0xc994('0x4b')]=_[_0xc994('0x44')](_0x21ae2d[_0xc994('0x41')],_0x21ae2d[_0xc994('0x42')]);_0x429e07[_0xc994('0x45')]=_[_0xc994('0x44')](_0x21ae2d[_0xc994('0x41')],qs[_0xc994('0x46')](_0x1b9042['query'][_0xc994('0x46')]));_0x429e07[_0xc994('0x45')]=_0x429e07[_0xc994('0x45')][_0xc994('0x47')]?_0x429e07['attributes']:_0x21ae2d[_0xc994('0x41')];_0x429e07[_0xc994('0x49')]=qs['sort'](_0x1b9042[_0xc994('0x42')][_0xc994('0x4a')]);_0x429e07['where']=qs[_0xc994('0x4b')](_['pick'](_0x1b9042['query'],_0x21ae2d[_0xc994('0x4b')]));if(_0x1b9042[_0xc994('0x42')][_0xc994('0x4d')]){_0x429e07[_0xc994('0x4e')]=_[_0xc994('0x4f')](_0x429e07[_0xc994('0x4e')],{'$or':_['map'](_0x429e07[_0xc994('0x45')],function(_0xdfb45c){var _0x43d5d2={};_0x43d5d2[_0xdfb45c]={'$like':'%'+_0x1b9042['query']['filter']+'%'};return _0x43d5d2;})});}_0x429e07=_['merge']({},_0x429e07,_0x1b9042[_0xc994('0x51')]);return _0x145fd0[_0xc994('0x7f')](_0x429e07);}})[_0xc994('0x1f')](function(_0x2d9b0b){if(_0x2d9b0b){_0x6a0e35=_0x2d9b0b['length'];if(!_0x1b9042['query']['hasOwnProperty']('nolimit')){_0x429e07['limit']=qs['limit'](_0x1b9042['query'][_0xc994('0x2f')]);_0x429e07[_0xc994('0x2d')]=qs[_0xc994('0x2d')](_0x1b9042[_0xc994('0x42')][_0xc994('0x2d')]);}return _0x145fd0[_0xc994('0x7f')](_0x429e07);}})['then'](function(_0x2a0ba4){if(_0x2a0ba4){return _0x2a0ba4?{'count':_0x6a0e35,'rows':_0x2a0ba4}:null;}})[_0xc994('0x1f')](respondWithResult(_0x45f65e,null))[_0xc994('0x28')](handleError(_0x45f65e,null));};exports[_0xc994('0x80')]=function(_0x503dbb,_0x64ee8c,_0x66f879){var _0xc753bd={'channel':_0xc994('0x81')};var _0x85263f=[];var _0x153534=[];var _0xfbfa48={};return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x503dbb[_0xc994('0x64')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xc994('0x82')}]})[_0xc994('0x1f')](handleEntityNotFound(_0x64ee8c,null))['then'](function(_0x2a3dca){_0xc753bd['account']=_0x2a3dca;_0xc753bd[_0xc994('0x83')]=_[_0xc994('0x84')](_0x2a3dca[_0xc994('0x82')],['priority'],[_0xc994('0x85')]);if(_0xc753bd['account']['Applications']){delete _0xc753bd[_0xc994('0x86')][_0xc994('0x82')];}return db[_0xc994('0x87')][_0xc994('0x65')]();})['then'](function(_0xc33936){if(!_0xc33936){throw new db['Sequelize']['ValidationError'](_0xc994('0x88'));}_0x85263f=_[_0xc994('0x89')](_[_0xc994('0x43')](_0xc33936),[_0xc994('0x8a'),_0xc994('0x8b')]);_0x153534=_[_0xc994('0x89')](_[_0xc994('0x43')](_0xc33936),[_0xc994('0x8a'),_0xc994('0x8b'),'CompanyId',_0xc994('0x8c')]);_0xc753bd[_0xc994('0x5a')]={'mapKey':_0xc994('0x8d')};if(_0xc753bd[_0xc994('0x86')][_0xc994('0x40')]&&_0xc753bd[_0xc994('0x86')]['type']===_0xc994('0x8e')){_0xc753bd[_0xc994('0x5a')][_0xc994('0x8f')]=_0x503dbb[_0xc994('0x5a')]['From']['replace'](_0xc994('0x90'),'');_0xc753bd[_0xc994('0x5a')][_0xc994('0x5a')]=_0x503dbb['body']['Body'];_0xc753bd[_0xc994('0x5a')][_0xc994('0x91')]=_0x503dbb[_0xc994('0x5a')][_0xc994('0x92')];}if(_0xc753bd[_0xc994('0x5a')]['id']){delete _0xc753bd[_0xc994('0x5a')]['id'];}if(_[_0xc994('0x93')](_0xc753bd[_0xc994('0x5a')][_0xc994('0x8f')])){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))](_0xc994('0x96'));}if(_[_0xc994('0x93')](_0xc753bd['body'][_0xc994('0x5a')])||_0xc753bd[_0xc994('0x5a')]['body']===''){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))](_0xc994('0x97'));}if(_['isNil'](_0xc753bd[_0xc994('0x5a')][_0xc994('0x98')])){throw new db['Sequelize'][(_0xc994('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x153534);}if(!_[_0xc994('0x99')](_0x153534,_0xc753bd[_0xc994('0x5a')][_0xc994('0x98')])){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))](_0xc994('0x9a')+_0x153534);}_0xfbfa48[_0xc753bd[_0xc994('0x5a')]['mapKey']]=_0xc753bd[_0xc994('0x5a')]['from'];return db[_0xc994('0x9b')][_0xc994('0x58')]({'where':{'id':_0xc753bd[_0xc994('0x86')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xc994('0x9c'),'where':_0xfbfa48,'limit':0x1,'order':[[_0xc994('0x8b'),'DESC']]}]});})[_0xc994('0x1f')](handleEntityNotFound(_0x64ee8c,null))[_0xc994('0x1f')](function(_0x5c80a3){if(_0x5c80a3){_0xc753bd[_0xc994('0x9d')]=_['omit'](_0x5c80a3,[_0xc994('0x9c')]);if(_0x5c80a3[_0xc994('0x9c')][_0xc994('0x47')]){return _0x5c80a3['Contacts'][0x0];}var _0x5c256c=_[_0xc994('0x18')](_0xc753bd[_0xc994('0x5a')],{'firstName':_0xc753bd['body'][_0xc994('0x8f')],'ListId':_0x5c80a3['id']});_0x5c256c[_0xc753bd[_0xc994('0x5a')]['mapKey']]=_0xc753bd[_0xc994('0x5a')][_0xc994('0x8f')];return db[_0xc994('0x87')]['create'](_0x5c256c,{'fields':_0x85263f,'raw':!![]});}})['then'](handleEntityNotFound(_0x64ee8c,null))[_0xc994('0x1f')](function(_0x6ea40b){if(_0x6ea40b){_0xc753bd['contact']=_0x6ea40b;var _0x6a3612={'ContactId':_0x6ea40b['id'],'phone':_0xc753bd[_0xc994('0x5a')]['from'],'WhatsappAccountId':_0x503dbb['params']['id']};var _0xde0146={'ContactId':_0x6ea40b['id'],'WhatsappAccountId':_0x503dbb[_0xc994('0x64')]['id'],'closed':![]};return db[_0xc994('0x9e')][_0xc994('0x58')]({'where':_0xde0146})[_0xc994('0x1f')](function(_0x1d4a97){if(_0x1d4a97){return[_0x1d4a97,![]];}return db[_0xc994('0x9e')][_0xc994('0x59')](_0x6a3612)[_0xc994('0x1f')](function(_0x3a6dd1){return[_0x3a6dd1,!![]];});});}})['spread'](function(_0x5dae2d,_0x2a2593){_0xc753bd[_0xc994('0x9f')]=_0x5dae2d[_0xc994('0x38')]({'plain':!![]});_0xc753bd[_0xc994('0x9f')][_0xc994('0xa0')]=![];if(_0x2a2593){if(_0xc753bd[_0xc994('0x86')]['autoclose']){_0xc753bd['applications'][_0xc994('0xa1')]({'id':0x0,'priority':_0xc753bd[_0xc994('0x83')]['length']+0x1,'app':'close','appdata':_0xc994('0xa2'),'interval':'*,*,*,*'});}_0xc753bd['interaction'][_0xc994('0xa0')]=!![];}return db[_0xc994('0xa3')][_0xc994('0x59')]({'phone':_0xc753bd['body']['from'],'messageId':_0xc753bd[_0xc994('0x5a')][_0xc994('0x91')],'body':_0xc753bd['body']['body'],'WhatsappAccountId':_0x503dbb[_0xc994('0x64')]['id'],'WhatsappInteractionId':_0x5dae2d['id'],'direction':'in','ContactId':_0x5dae2d[_0xc994('0xa4')],'AttachmentId':_0xc753bd['body'][_0xc994('0xa5')]});})['then'](function(_0x7cb697){_0xc753bd[_0xc994('0x27')]=_0x7cb697;if(_0xc753bd[_0xc994('0x9f')][_0xc994('0xa6')]){return db[_0xc994('0x79')][_0xc994('0x58')]({'attributes':['id',_0xc994('0x3a')],'where':{'id':_0xc753bd[_0xc994('0x9f')][_0xc994('0xa6')]}})[_0xc994('0x1f')](function(_0x168815){if(_0x168815){_0xc753bd[_0xc994('0x83')][_0xc994('0xa7')]({'id':0x0,'priority':0x0,'app':_0xc994('0xa8'),'appdata':_0x168815[_0xc994('0x3a')]+','+(_0xc753bd[_0xc994('0x86')][_0xc994('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc994('0xaa'),_0xc994('0xab'),_0xc753bd);});}return respondWithRpcPromise(_0xc994('0xaa'),_0xc994('0xab'),_0xc753bd);})[_0xc994('0x1f')](function(_0x4f0d5a){if(_0x4f0d5a){var _0xdb2e7d=0xc8;var _0x4c9672=_0xc994('0xac');logger[_0xc994('0x20')](_0xc994('0x24'),_0x4c9672,_0xdb2e7d,_0xc994('0xad'));logger[_0xc994('0x23')](_0xc994('0xae'),_0x4c9672,_0xdb2e7d,_0xc994('0xad'),JSON[_0xc994('0x25')](_0x4f0d5a));if(_0xc753bd[_0xc994('0x86')][_0xc994('0x40')]===_0xc994('0x8e')){return _0x64ee8c[_0xc994('0x2a')](_0xdb2e7d)[_0xc994('0x31')](_0xc994('0xaf'),_0xc994('0xb0'))[_0xc994('0x3b')](_0xc994('0xb1'));}else{return _0x64ee8c[_0xc994('0x2a')](_0xdb2e7d)[_0xc994('0x2c')](_0x4f0d5a);}}})[_0xc994('0x28')](handleError(_0x64ee8c,null));};exports[_0xc994('0x3b')]=function(_0x56cca3,_0x5f7640,_0x2d8f67){var _0x31ff19,_0xda93a,_0x4a84c5;if(_[_0xc994('0x93')](_0x56cca3[_0xc994('0x5a')][_0xc994('0x5a')])||_0x56cca3[_0xc994('0x5a')][_0xc994('0x5a')]===''){throw new db[(_0xc994('0x94'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc994('0x93')](_0x56cca3[_0xc994('0x5a')]['to'])){throw new db[(_0xc994('0x94'))][(_0xc994('0x95'))]('to\x20is\x20mandatory');}_0x31ff19=_0x56cca3['body']['to'];return db[_0xc994('0x52')][_0xc994('0x58')]({'where':{'id':_0x56cca3['params']['id']},'include':[{'model':db[_0xc994('0x9b')],'as':_0xc994('0xb2'),'include':[{'model':db['CmContact'],'as':_0xc994('0x9c'),'where':{'mobile':_0x31ff19},'limit':0x1,'order':[['updatedAt',_0xc994('0xb3')]]}]}]})[_0xc994('0x1f')](handleEntityNotFound(_0x5f7640,null))[_0xc994('0x1f')](function(_0x4f755b){if(_0x4f755b&&_0x4f755b[_0xc994('0xb2')]){_0xda93a=_0x4f755b[_0xc994('0x38')]({'plain':!![]});if(_0xda93a[_0xc994('0xb2')]&&_0xda93a[_0xc994('0xb2')][_0xc994('0x9c')][_0xc994('0x47')]){return _0xda93a['List'][_0xc994('0x9c')][0x0];}return db[_0xc994('0x87')][_0xc994('0x59')](_[_0xc994('0x18')](_0x56cca3[_0xc994('0x5a')],{'firstName':_0x31ff19,'mobile':_0x31ff19,'phone':_0x31ff19,'ListId':_0xda93a['ListId']}));}})[_0xc994('0x1f')](handleEntityNotFound(_0x5f7640,null))[_0xc994('0x1f')](function(_0x3647d2){if(_0x3647d2){_0x4a84c5=_0x3647d2;return db[_0xc994('0x9e')][_0xc994('0x58')]({'where':{'ContactId':_0x4a84c5['id'],'closed':![],'WhatsappAccountId':_0xda93a['id']}})['then'](function(_0x46d12e){if(_0x46d12e){return[_0x46d12e,![]];}return db[_0xc994('0x9e')][_0xc994('0x59')]({'UserId':_0x56cca3[_0xc994('0x5b')]['id'],'ContactId':_0x4a84c5['id'],'WhatsappAccountId':_0xda93a['id'],'phone':_0x31ff19,'firstMsgDirection':_0xc994('0xb4'),'Messages':[_[_0xc994('0x4f')](_0x56cca3[_0xc994('0x5a')],{'read':![],'body':_0x56cca3['body'][_0xc994('0x5a')],'phone':_0x31ff19,'WhatsappAccountId':_0xda93a['id'],'UserId':_0x56cca3['user']['id'],'ContactId':_0x4a84c5['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xc994('0xb5')}]})[_0xc994('0x1f')](function(_0x1f2048){return[_0x1f2048,!![]];});});}})['spread'](function(_0x3df943,_0x49b413){if(_0x49b413){return _0x3df943;}return db[_0xc994('0xa3')]['create'](_[_0xc994('0x4f')](_0x56cca3['body'],{'read':![],'body':_0x56cca3[_0xc994('0x5a')][_0xc994('0x5a')],'phone':_0x31ff19,'WhatsappAccountId':_0xda93a['id'],'WhatsappInteractionId':_0x3df943['id'],'UserId':_0x56cca3[_0xc994('0x5b')]['id'],'ContactId':_0x4a84c5['id']}))['then'](function(_0x6fa6da){_0x3df943['dataValues'][_0xc994('0xb5')]=[];_0x3df943[_0xc994('0xb6')][_0xc994('0xb5')][_0xc994('0xa1')](_0x6fa6da[_0xc994('0xb6')]);return _0x3df943;});})['then'](respondWithResult(_0x5f7640,null))[_0xc994('0x28')](handleError(_0x5f7640,null));};
\ No newline at end of file
index 47a17b4..54a14ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x810f=['setMaxListeners','update','remove','emit','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x810f,0x1a5));var _0xf810=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x810f[_0x543084];return _0x306a57;};'use strict';var EventEmitter=require(_0xf810('0x0'));var WhatsappAccount=require(_0xf810('0x1'))['db'][_0xf810('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf810('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf810('0x4'),'afterDestroy':_0xf810('0x5')};function emitEvent(_0x30ab0c){return function(_0x193166,_0x153f84,_0x363526){WhatsappAccountEvents[_0xf810('0x6')](_0x30ab0c+':'+_0x193166['id'],_0x193166);WhatsappAccountEvents[_0xf810('0x6')](_0x30ab0c,_0x193166);_0x363526(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xf810('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x9172=['hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update','emit'];(function(_0x1ce9dc,_0x364a4c){var _0x2fdd91=function(_0x5ab26d){while(--_0x5ab26d){_0x1ce9dc['push'](_0x1ce9dc['shift']());}};_0x2fdd91(++_0x364a4c);}(_0x9172,0xc9));var _0x2917=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x9172[_0x1da527];return _0x40fc7c;};'use strict';var EventEmitter=require(_0x2917('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x2917('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x2917('0x2')](0x0);var events={'afterCreate':_0x2917('0x3'),'afterUpdate':_0x2917('0x4'),'afterDestroy':'remove'};function emitEvent(_0x432825){return function(_0x112078,_0x11945a,_0x2e77cd){WhatsappAccountEvents[_0x2917('0x5')](_0x432825+':'+_0x112078['id'],_0x112078);WhatsappAccountEvents[_0x2917('0x5')](_0x432825,_0x112078);_0x2e77cd(null);};}for(var e in events){if(events[_0x2917('0x6')](e)){var event=events[e];WhatsappAccount[_0x2917('0x7')](e,emitEvent(event));}}module[_0x2917('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index 48dcace..15160b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7bc=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x443bdd,_0x517654){var _0x3a1e48=function(_0x3a7e26){while(--_0x3a7e26){_0x443bdd['push'](_0x443bdd['shift']());}};_0x3a1e48(++_0x517654);}(_0xc7bc,0x7f));var _0xcc7b=function(_0x54942b,_0x21e4a3){_0x54942b=_0x54942b-0x0;var _0xa3f376=_0xc7bc[_0x54942b];return _0xa3f376;};'use strict';var _=require(_0xcc7b('0x0'));var util=require(_0xcc7b('0x1'));var logger=require(_0xcc7b('0x2'))(_0xcc7b('0x3'));var moment=require(_0xcc7b('0x4'));var BPromise=require(_0xcc7b('0x5'));var rp=require(_0xcc7b('0x6'));var fs=require('fs');var path=require(_0xcc7b('0x7'));var rimraf=require(_0xcc7b('0x8'));var config=require(_0xcc7b('0x9'));var attributes=require(_0xcc7b('0xa'));module[_0xcc7b('0xb')]=function(_0x5ad67e,_0xe46309){return _0x5ad67e[_0xcc7b('0xc')](_0xcc7b('0xd'),attributes,{'tableName':_0xcc7b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12f9=['./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x12f9,0x194));var _0x912f=function(_0x519a03,_0x2f3ec2){_0x519a03=_0x519a03-0x0;var _0x541b6b=_0x12f9[_0x519a03];return _0x541b6b;};'use strict';var _=require(_0x912f('0x0'));var util=require(_0x912f('0x1'));var logger=require(_0x912f('0x2'))('api');var moment=require(_0x912f('0x3'));var BPromise=require('bluebird');var rp=require(_0x912f('0x4'));var fs=require('fs');var path=require(_0x912f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x912f('0x6'));module[_0x912f('0x7')]=function(_0x291f3e,_0x1cdc69){return _0x291f3e['define'](_0x912f('0x8'),attributes,{'tableName':_0x912f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index efc1179..f36b163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4012=['WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','WhatsappAccount','find','options','raw','where','attributes','include','model','map','ShowWhatsappAccount','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','then','info'];(function(_0x98eefc,_0x59e26d){var _0x4bfc79=function(_0x358670){while(--_0x358670){_0x98eefc['push'](_0x98eefc['shift']());}};_0x4bfc79(++_0x59e26d);}(_0x4012,0x1bf));var _0x2401=function(_0x4f2d1d,_0x13990a){_0x4f2d1d=_0x4f2d1d-0x0;var _0x263196=_0x4012[_0x4f2d1d];return _0x263196;};'use strict';var _=require(_0x2401('0x0'));var util=require(_0x2401('0x1'));var moment=require(_0x2401('0x2'));var BPromise=require(_0x2401('0x3'));var rs=require(_0x2401('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2401('0x5'))['db'];var utils=require(_0x2401('0x6'));var logger=require(_0x2401('0x7'))(_0x2401('0x8'));var config=require(_0x2401('0x9'));var jayson=require(_0x2401('0xa'));var client=jayson[_0x2401('0xb')][_0x2401('0xc')]({'port':0x232a});config[_0x2401('0xd')]=_[_0x2401('0xe')](config[_0x2401('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2401('0xf'))(new Redis(config['redis']));require(_0x2401('0x10'))[_0x2401('0x11')](socket);function respondWithRpcPromise(_0x29f1c5,_0x29119c,_0x2e45ee){return new BPromise(function(_0x158b67,_0x152bb6){return client[_0x2401('0x12')](_0x29f1c5,_0x2e45ee)[_0x2401('0x13')](function(_0x2c5c7c){logger[_0x2401('0x14')](_0x2401('0x15'),_0x29119c,_0x2401('0x16'));logger[_0x2401('0x17')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x29119c,_0x2401('0x16'),JSON['stringify'](_0x2c5c7c));if(_0x2c5c7c[_0x2401('0x18')]){if(_0x2c5c7c[_0x2401('0x18')][_0x2401('0x19')]===0x1f4){logger[_0x2401('0x18')](_0x2401('0x15'),_0x29119c,_0x2c5c7c['error']['message']);return _0x152bb6(_0x2c5c7c[_0x2401('0x18')]['message']);}logger['error'](_0x2401('0x15'),_0x29119c,_0x2c5c7c[_0x2401('0x18')][_0x2401('0x1a')]);return _0x158b67(_0x2c5c7c[_0x2401('0x18')][_0x2401('0x1a')]);}else{logger[_0x2401('0x14')](_0x2401('0x15'),_0x29119c,'request\x20sent');_0x158b67(_0x2c5c7c[_0x2401('0x1b')][_0x2401('0x1a')]);}})['catch'](function(_0x4b5063){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x29119c,_0x4b5063);_0x152bb6(_0x4b5063);});});}exports['ShowWhatsappAccount']=function(_0x1716ef){var _0x531426=this;return new Promise(function(_0x3412e5,_0x58dbd6){return db[_0x2401('0x1c')][_0x2401('0x1d')]({'raw':_0x1716ef[_0x2401('0x1e')]?_0x1716ef['options'][_0x2401('0x1f')]===undefined?!![]:![]:!![],'where':_0x1716ef[_0x2401('0x1e')]?_0x1716ef[_0x2401('0x1e')][_0x2401('0x20')]||null:null,'attributes':_0x1716ef[_0x2401('0x1e')]?_0x1716ef[_0x2401('0x1e')][_0x2401('0x21')]||null:null,'include':_0x1716ef['options']?_0x1716ef[_0x2401('0x1e')][_0x2401('0x22')]?_['map'](_0x1716ef[_0x2401('0x1e')][_0x2401('0x22')],function(_0x21682f){return{'model':db[_0x21682f[_0x2401('0x23')]],'as':_0x21682f['as'],'attributes':_0x21682f[_0x2401('0x21')],'include':_0x21682f[_0x2401('0x22')]?_[_0x2401('0x24')](_0x21682f['include'],function(_0x5505a4){return{'model':db[_0x5505a4[_0x2401('0x23')]],'as':_0x5505a4['as'],'attributes':_0x5505a4[_0x2401('0x21')],'include':_0x5505a4[_0x2401('0x22')]?_['map'](_0x5505a4[_0x2401('0x22')],function(_0x4fa769){return{'model':db[_0x4fa769[_0x2401('0x23')]],'as':_0x4fa769['as'],'attributes':_0x4fa769['attributes']};}):[]};}):[]};}):[]:[]})[_0x2401('0x13')](function(_0x263051){logger[_0x2401('0x14')](_0x2401('0x25'),_0x1716ef);logger[_0x2401('0x17')](_0x2401('0x25'),_0x1716ef,JSON['stringify'](_0x263051));_0x3412e5(_0x263051);})[_0x2401('0x26')](function(_0x38a820){logger[_0x2401('0x18')](_0x2401('0x25'),_0x38a820[_0x2401('0x1a')],_0x1716ef);_0x58dbd6(_0x531426[_0x2401('0x18')](0x1f4,_0x38a820[_0x2401('0x1a')]));});});};
\ No newline at end of file
+var _0x6946=['map','model','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','attributes','include'];(function(_0x5edafc,_0x22002c){var _0x1fa600=function(_0x5dc143){while(--_0x5dc143){_0x5edafc['push'](_0x5edafc['shift']());}};_0x1fa600(++_0x22002c);}(_0x6946,0x1b3));var _0x6694=function(_0x3f3ad8,_0x1dc2a3){_0x3f3ad8=_0x3f3ad8-0x0;var _0x1024ed=_0x6946[_0x3f3ad8];return _0x1024ed;};'use strict';var _=require(_0x6694('0x0'));var util=require(_0x6694('0x1'));var moment=require(_0x6694('0x2'));var BPromise=require(_0x6694('0x3'));var rs=require(_0x6694('0x4'));var fs=require('fs');var Redis=require(_0x6694('0x5'));var db=require(_0x6694('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6694('0x7'));var config=require(_0x6694('0x8'));var jayson=require(_0x6694('0x9'));var client=jayson[_0x6694('0xa')][_0x6694('0xb')]({'port':0x232a});config[_0x6694('0xc')]=_[_0x6694('0xd')](config[_0x6694('0xc')],{'host':_0x6694('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6694('0xf'))[_0x6694('0x10')](socket);function respondWithRpcPromise(_0x32aba8,_0x46f4a0,_0x35c5c7){return new BPromise(function(_0x3890c2,_0x1d9996){return client['request'](_0x32aba8,_0x35c5c7)[_0x6694('0x11')](function(_0x396009){logger[_0x6694('0x12')](_0x6694('0x13'),_0x46f4a0,'request\x20sent');logger[_0x6694('0x14')](_0x6694('0x15'),_0x46f4a0,_0x6694('0x16'),JSON[_0x6694('0x17')](_0x396009));if(_0x396009[_0x6694('0x18')]){if(_0x396009[_0x6694('0x18')][_0x6694('0x19')]===0x1f4){logger['error'](_0x6694('0x13'),_0x46f4a0,_0x396009[_0x6694('0x18')][_0x6694('0x1a')]);return _0x1d9996(_0x396009[_0x6694('0x18')][_0x6694('0x1a')]);}logger[_0x6694('0x18')](_0x6694('0x13'),_0x46f4a0,_0x396009['error'][_0x6694('0x1a')]);return _0x3890c2(_0x396009['error'][_0x6694('0x1a')]);}else{logger[_0x6694('0x12')](_0x6694('0x13'),_0x46f4a0,_0x6694('0x16'));_0x3890c2(_0x396009[_0x6694('0x1b')][_0x6694('0x1a')]);}})[_0x6694('0x1c')](function(_0x4157bc){logger[_0x6694('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x46f4a0,_0x4157bc);_0x1d9996(_0x4157bc);});});}exports['ShowWhatsappAccount']=function(_0x125f1f){var _0x577eb7=this;return new Promise(function(_0x2ceeab,_0xab1d7e){return db['WhatsappAccount']['find']({'raw':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')][_0x6694('0x1e')]===undefined?!![]:![]:!![],'where':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')]['where']||null:null,'attributes':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')][_0x6694('0x1f')]||null:null,'include':_0x125f1f[_0x6694('0x1d')]?_0x125f1f[_0x6694('0x1d')][_0x6694('0x20')]?_[_0x6694('0x21')](_0x125f1f[_0x6694('0x1d')][_0x6694('0x20')],function(_0x9cf925){return{'model':db[_0x9cf925['model']],'as':_0x9cf925['as'],'attributes':_0x9cf925[_0x6694('0x1f')],'include':_0x9cf925['include']?_[_0x6694('0x21')](_0x9cf925[_0x6694('0x20')],function(_0x5542ff){return{'model':db[_0x5542ff[_0x6694('0x22')]],'as':_0x5542ff['as'],'attributes':_0x5542ff[_0x6694('0x1f')],'include':_0x5542ff[_0x6694('0x20')]?_[_0x6694('0x21')](_0x5542ff['include'],function(_0x172a86){return{'model':db[_0x172a86[_0x6694('0x22')]],'as':_0x172a86['as'],'attributes':_0x172a86[_0x6694('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x305ab6){logger[_0x6694('0x12')](_0x6694('0x23'),_0x125f1f);logger[_0x6694('0x14')]('ShowWhatsappAccount',_0x125f1f,JSON['stringify'](_0x305ab6));_0x2ceeab(_0x305ab6);})['catch'](function(_0x5e521b){logger['error'](_0x6694('0x23'),_0x5e521b[_0x6694('0x1a')],_0x125f1f);_0xab1d7e(_0x577eb7[_0x6694('0x18')](0x1f4,_0x5e521b[_0x6694('0x1a')]));});});};
\ No newline at end of file
index f532bef..7ef42b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd98=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','remove'];(function(_0x46387d,_0x2f2283){var _0xdfe8ed=function(_0xb05790){while(--_0xb05790){_0x46387d['push'](_0x46387d['shift']());}};_0xdfe8ed(++_0x2f2283);}(_0xcd98,0x76));var _0x8cd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd98[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x8cd9('0x0'));var events=['save',_0x8cd9('0x1'),'update'];function createListener(_0x52f5ca,_0x43006b){return function(_0x5243c0){_0x43006b['emit'](_0x52f5ca,_0x5243c0);};}function removeListener(_0x368f30,_0x350103){return function(){WhatsappAccountEvents[_0x8cd9('0x2')](_0x368f30,_0x350103);};}exports[_0x8cd9('0x3')]=function(_0x5e2ddd){for(var _0x6735c8=0x0,_0x4135c1=events[_0x8cd9('0x4')];_0x6735c8<_0x4135c1;_0x6735c8++){var _0x24ab25=events[_0x6735c8];var _0x594506=createListener(_0x8cd9('0x5')+_0x24ab25,_0x5e2ddd);WhatsappAccountEvents['on'](_0x24ab25,_0x594506);}};
\ No newline at end of file
+var _0x8461=['save','remove','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x8461,0x109));var _0x1846=function(_0x3bb557,_0x2d4e15){_0x3bb557=_0x3bb557-0x0;var _0x5eebcb=_0x8461[_0x3bb557];return _0x5eebcb;};'use strict';var WhatsappAccountEvents=require(_0x1846('0x0'));var events=[_0x1846('0x1'),_0x1846('0x2'),'update'];function createListener(_0x47e8fc,_0x5e47ed){return function(_0x1ddc73){_0x5e47ed[_0x1846('0x3')](_0x47e8fc,_0x1ddc73);};}function removeListener(_0xdd71f6,_0x5afff2){return function(){WhatsappAccountEvents[_0x1846('0x4')](_0xdd71f6,_0x5afff2);};}exports['register']=function(_0x243c67){for(var _0x519112=0x0,_0x48eec0=events[_0x1846('0x5')];_0x519112<_0x48eec0;_0x519112++){var _0x149676=events[_0x519112];var _0x474651=createListener(_0x1846('0x6')+_0x149676,_0x243c67);WhatsappAccountEvents['on'](_0x149676,_0x474651);}};
\ No newline at end of file
index de55430..f73548d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae30=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xae30,0x1c8));var _0x0ae3=function(_0x3bdd40,_0x414ee6){_0x3bdd40=_0x3bdd40-0x0;var _0x216370=_0xae30[_0x3bdd40];return _0x216370;};'use strict';var multer=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var path=require(_0x0ae3('0x2'));var timeout=require(_0x0ae3('0x3'));var express=require(_0x0ae3('0x4'));var router=express[_0x0ae3('0x5')]();var fs_extra=require(_0x0ae3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var controller=require('./whatsappApplication.controller');router[_0x0ae3('0x9')]('/',auth[_0x0ae3('0xa')](),controller[_0x0ae3('0xb')]);router[_0x0ae3('0x9')](_0x0ae3('0xc'),auth[_0x0ae3('0xa')](),controller[_0x0ae3('0xd')]);router['post']('/',auth[_0x0ae3('0xa')](),controller[_0x0ae3('0xe')]);router[_0x0ae3('0xf')](_0x0ae3('0xc'),auth[_0x0ae3('0xa')](),controller[_0x0ae3('0x10')]);router['delete'](_0x0ae3('0xc'),auth[_0x0ae3('0xa')](),controller[_0x0ae3('0x11')]);module[_0x0ae3('0x12')]=router;
\ No newline at end of file
+var _0xc8d8=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x17862f,_0x2531cb){var _0x2f7c2a=function(_0x17edfc){while(--_0x17edfc){_0x17862f['push'](_0x17862f['shift']());}};_0x2f7c2a(++_0x2531cb);}(_0xc8d8,0x128));var _0x8c8d=function(_0x51b241,_0x187fab){_0x51b241=_0x51b241-0x0;var _0x16a3a7=_0xc8d8[_0x51b241];return _0x16a3a7;};'use strict';var multer=require(_0x8c8d('0x0'));var util=require('util');var path=require(_0x8c8d('0x1'));var timeout=require(_0x8c8d('0x2'));var express=require(_0x8c8d('0x3'));var router=express[_0x8c8d('0x4')]();var fs_extra=require(_0x8c8d('0x5'));var auth=require(_0x8c8d('0x6'));var interaction=require(_0x8c8d('0x7'));var config=require(_0x8c8d('0x8'));var controller=require(_0x8c8d('0x9'));router[_0x8c8d('0xa')]('/',auth[_0x8c8d('0xb')](),controller[_0x8c8d('0xc')]);router[_0x8c8d('0xa')](_0x8c8d('0xd'),auth[_0x8c8d('0xb')](),controller[_0x8c8d('0xe')]);router[_0x8c8d('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c8d('0x10')]);router[_0x8c8d('0x11')](_0x8c8d('0xd'),auth[_0x8c8d('0xb')](),controller[_0x8c8d('0x12')]);router[_0x8c8d('0x13')]('/:id',auth[_0x8c8d('0xb')](),controller[_0x8c8d('0x14')]);module['exports']=router;
\ No newline at end of file
index e0438a7..d2a7c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xada7=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x151b7c,_0x3400c0){var _0x594323=function(_0x571925){while(--_0x571925){_0x151b7c['push'](_0x151b7c['shift']());}};_0x594323(++_0x3400c0);}(_0xada7,0xe0));var _0x7ada=function(_0x733b00,_0x30cc96){_0x733b00=_0x733b00-0x0;var _0x110c13=_0xada7[_0x733b00];return _0x110c13;};'use strict';var Sequelize=require(_0x7ada('0x0'));module[_0x7ada('0x1')]={'priority':{'type':Sequelize[_0x7ada('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7ada('0x3')},'appdata':{'type':Sequelize[_0x7ada('0x4')]()},'description':{'type':Sequelize[_0x7ada('0x5')]},'interval':{'type':Sequelize[_0x7ada('0x5')],'defaultValue':_0x7ada('0x6')}};
\ No newline at end of file
+var _0x9306=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x3a3c3d,_0x3b8542){var _0xf3142f=function(_0x479bb0){while(--_0x479bb0){_0x3a3c3d['push'](_0x3a3c3d['shift']());}};_0xf3142f(++_0x3b8542);}(_0x9306,0xf1));var _0x6930=function(_0x4c6f50,_0x51e971){_0x4c6f50=_0x4c6f50-0x0;var _0xb2d3ba=_0x9306[_0x4c6f50];return _0xb2d3ba;};'use strict';var Sequelize=require(_0x6930('0x0'));module[_0x6930('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6930('0x2')],'allowNull':![],'defaultValue':_0x6930('0x3')},'appdata':{'type':Sequelize[_0x6930('0x4')]()},'description':{'type':Sequelize[_0x6930('0x2')]},'interval':{'type':Sequelize[_0x6930('0x2')],'defaultValue':_0x6930('0x5')}};
\ No newline at end of file
index c131fe4..67fd31a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9666=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0x53da0e,_0x2c4eb0){var _0x3a6ae7=function(_0xbcafb3){while(--_0xbcafb3){_0x53da0e['push'](_0x53da0e['shift']());}};_0x3a6ae7(++_0x2c4eb0);}(_0x9666,0x17a));var _0x6966=function(_0x13f866,_0x2b63be){_0x13f866=_0x13f866-0x0;var _0x12ec12=_0x9666[_0x13f866];return _0x12ec12;};'use strict';var emlformat=require(_0x6966('0x0'));var rimraf=require(_0x6966('0x1'));var zipdir=require(_0x6966('0x2'));var jsonpatch=require(_0x6966('0x3'));var rp=require('request-promise');var moment=require(_0x6966('0x4'));var BPromise=require(_0x6966('0x5'));var Mustache=require(_0x6966('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6966('0x7'));var csv=require(_0x6966('0x8'));var ejs=require(_0x6966('0x9'));var fs=require('fs');var fs_extra=require(_0x6966('0xa'));var _=require(_0x6966('0xb'));var squel=require(_0x6966('0xc'));var crypto=require('crypto');var jsforce=require(_0x6966('0xd'));var deskjs=require(_0x6966('0xe'));var toCsv=require(_0x6966('0x8'));var querystring=require('querystring');var Papa=require(_0x6966('0xf'));var Redis=require(_0x6966('0x10'));var authService=require(_0x6966('0x11'));var qs=require(_0x6966('0x12'));var as=require(_0x6966('0x13'));var hardwareService=require(_0x6966('0x14'));var logger=require(_0x6966('0x15'))(_0x6966('0x16'));var utils=require(_0x6966('0x17'));var config=require(_0x6966('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c5272,_0x154c15){_0x154c15=_0x154c15||0xcc;return function(_0x2ce913){if(_0x2ce913){return _0x4c5272[_0x6966('0x19')](_0x154c15);}return _0x4c5272['status'](_0x154c15)['end']();};}function respondWithResult(_0x584bf2,_0x235ba3){_0x235ba3=_0x235ba3||0xc8;return function(_0xbd4ea2){if(_0xbd4ea2){return _0x584bf2[_0x6966('0x1a')](_0x235ba3)[_0x6966('0x1b')](_0xbd4ea2);}};}function respondWithFilteredResult(_0x19428c,_0x48d414){return function(_0x204200){if(_0x204200){var _0x1bf59d=typeof _0x48d414['offset']===_0x6966('0x1c')&&typeof _0x48d414[_0x6966('0x1d')]===_0x6966('0x1c');var _0x529dbd=_0x204200[_0x6966('0x1e')];var _0x4bf5b8=_0x1bf59d?0x0:_0x48d414[_0x6966('0x1f')];var _0x519049=_0x1bf59d?_0x204200['count']:_0x48d414['offset']+_0x48d414[_0x6966('0x1d')];var _0x5eef44;if(_0x519049>=_0x529dbd){_0x519049=_0x529dbd;_0x5eef44=0xc8;}else{_0x5eef44=0xce;}_0x19428c['status'](_0x5eef44);return _0x19428c['set']('Content-Range',_0x4bf5b8+'-'+_0x519049+'/'+_0x529dbd)['json'](_0x204200);}return null;};}function patchUpdates(_0x197c2c){return function(_0x247570){try{jsonpatch[_0x6966('0x20')](_0x247570,_0x197c2c,!![]);}catch(_0x4e8342){return BPromise[_0x6966('0x21')](_0x4e8342);}return _0x247570[_0x6966('0x22')]();};}function saveUpdates(_0x43349b,_0x8c7833){return function(_0x33fc7f){if(_0x33fc7f){return _0x33fc7f[_0x6966('0x23')](_0x43349b)[_0x6966('0x24')](function(_0x2af0b7){return _0x2af0b7;});}return null;};}function removeEntity(_0x3772d7,_0x509631){return function(_0x24af6a){if(_0x24af6a){return _0x24af6a[_0x6966('0x25')]()[_0x6966('0x24')](function(){_0x3772d7[_0x6966('0x1a')](0xcc)[_0x6966('0x26')]();});}};}function handleEntityNotFound(_0x27db0e,_0x44a5df){return function(_0x4e4c30){if(!_0x4e4c30){_0x27db0e[_0x6966('0x19')](0x194);}return _0x4e4c30;};}function handleError(_0x5a7f85,_0x433601){_0x433601=_0x433601||0x1f4;return function(_0x4f7aa2){logger[_0x6966('0x27')](_0x4f7aa2[_0x6966('0x28')]);if(_0x4f7aa2[_0x6966('0x29')]){delete _0x4f7aa2[_0x6966('0x29')];}_0x5a7f85[_0x6966('0x1a')](_0x433601)[_0x6966('0x2a')](_0x4f7aa2);};}exports[_0x6966('0x2b')]=function(_0x1b86a7,_0x2c9fbb){var _0x4a85c7={},_0x270919={},_0x35fdb4={'count':0x0,'rows':[]};var _0x59a8d6=_[_0x6966('0x2c')](db['WhatsappApplication'][_0x6966('0x2d')],function(_0x297c21){return{'name':_0x297c21[_0x6966('0x2e')],'type':_0x297c21[_0x6966('0x2f')][_0x6966('0x30')]};});_0x270919[_0x6966('0x31')]=_[_0x6966('0x2c')](_0x59a8d6,_0x6966('0x29'));_0x270919[_0x6966('0x32')]=_[_0x6966('0x33')](_0x1b86a7[_0x6966('0x32')]);_0x270919[_0x6966('0x34')]=_[_0x6966('0x35')](_0x270919[_0x6966('0x31')],_0x270919[_0x6966('0x32')]);_0x4a85c7[_0x6966('0x36')]=_['intersection'](_0x270919[_0x6966('0x31')],qs['fields'](_0x1b86a7[_0x6966('0x32')][_0x6966('0x37')]));_0x4a85c7[_0x6966('0x36')]=_0x4a85c7[_0x6966('0x36')][_0x6966('0x38')]?_0x4a85c7[_0x6966('0x36')]:_0x270919[_0x6966('0x31')];if(!_0x1b86a7[_0x6966('0x32')][_0x6966('0x39')](_0x6966('0x3a'))){_0x4a85c7['limit']=qs[_0x6966('0x1d')](_0x1b86a7[_0x6966('0x32')][_0x6966('0x1d')]);_0x4a85c7['offset']=qs['offset'](_0x1b86a7[_0x6966('0x32')][_0x6966('0x1f')]);}_0x4a85c7['order']=qs[_0x6966('0x3b')](_0x1b86a7['query']['sort']);_0x4a85c7[_0x6966('0x3c')]=qs[_0x6966('0x34')](_[_0x6966('0x3d')](_0x1b86a7[_0x6966('0x32')],_0x270919['filters']),_0x59a8d6);if(_0x1b86a7[_0x6966('0x32')][_0x6966('0x3e')]){_0x4a85c7[_0x6966('0x3c')]=_[_0x6966('0x3f')](_0x4a85c7[_0x6966('0x3c')],{'$or':_[_0x6966('0x2c')](_0x59a8d6,function(_0x3cb629){if(_0x3cb629[_0x6966('0x2f')]!==_0x6966('0x40')){var _0x112bff={};_0x112bff[_0x3cb629[_0x6966('0x29')]]={'$like':'%'+_0x1b86a7[_0x6966('0x32')][_0x6966('0x3e')]+'%'};return _0x112bff;}})});}_0x4a85c7=_['merge']({},_0x4a85c7,_0x1b86a7[_0x6966('0x41')]);var _0x5c9590={'where':_0x4a85c7['where']};return db[_0x6966('0x42')][_0x6966('0x1e')](_0x5c9590)['then'](function(_0x57949e){_0x35fdb4[_0x6966('0x1e')]=_0x57949e;if(_0x1b86a7[_0x6966('0x32')][_0x6966('0x43')]){_0x4a85c7['include']=[{'all':!![]}];}return db[_0x6966('0x42')][_0x6966('0x44')](_0x4a85c7);})[_0x6966('0x24')](function(_0x6af6a8){_0x35fdb4[_0x6966('0x45')]=_0x6af6a8;return _0x35fdb4;})[_0x6966('0x24')](respondWithFilteredResult(_0x2c9fbb,_0x4a85c7))[_0x6966('0x46')](handleError(_0x2c9fbb,null));};exports[_0x6966('0x47')]=function(_0x1df2cb,_0x5356fc){var _0x49be81={'raw':!![],'where':{'id':_0x1df2cb[_0x6966('0x48')]['id']}},_0x50ec04={};_0x50ec04['model']=_[_0x6966('0x33')](db[_0x6966('0x42')]['rawAttributes']);_0x50ec04[_0x6966('0x32')]=_['keys'](_0x1df2cb[_0x6966('0x32')]);_0x50ec04[_0x6966('0x34')]=_[_0x6966('0x35')](_0x50ec04[_0x6966('0x31')],_0x50ec04[_0x6966('0x32')]);_0x49be81[_0x6966('0x36')]=_[_0x6966('0x35')](_0x50ec04[_0x6966('0x31')],qs[_0x6966('0x37')](_0x1df2cb[_0x6966('0x32')][_0x6966('0x37')]));_0x49be81['attributes']=_0x49be81[_0x6966('0x36')][_0x6966('0x38')]?_0x49be81[_0x6966('0x36')]:_0x50ec04['model'];if(_0x1df2cb[_0x6966('0x32')][_0x6966('0x43')]){_0x49be81['include']=[{'all':!![]}];}_0x49be81=_[_0x6966('0x3f')]({},_0x49be81,_0x1df2cb[_0x6966('0x41')]);return db[_0x6966('0x42')][_0x6966('0x49')](_0x49be81)[_0x6966('0x24')](handleEntityNotFound(_0x5356fc,null))[_0x6966('0x24')](respondWithResult(_0x5356fc,null))[_0x6966('0x46')](handleError(_0x5356fc,null));};exports[_0x6966('0x4a')]=function(_0x3635b8,_0x154d3e){return db['WhatsappApplication'][_0x6966('0x4a')](_0x3635b8['body'],{})[_0x6966('0x24')](respondWithResult(_0x154d3e,0xc9))[_0x6966('0x46')](handleError(_0x154d3e,null));};exports['update']=function(_0x301555,_0x4955b8){if(_0x301555[_0x6966('0x4b')]['id']){delete _0x301555[_0x6966('0x4b')]['id'];}return db[_0x6966('0x42')]['find']({'where':{'id':_0x301555[_0x6966('0x48')]['id']}})['then'](handleEntityNotFound(_0x4955b8,null))[_0x6966('0x24')](saveUpdates(_0x301555[_0x6966('0x4b')],null))[_0x6966('0x24')](respondWithResult(_0x4955b8,null))['catch'](handleError(_0x4955b8,null));};exports['destroy']=function(_0x3422fe,_0x40175c){return db[_0x6966('0x42')][_0x6966('0x49')]({'where':{'id':_0x3422fe[_0x6966('0x48')]['id']}})['then'](handleEntityNotFound(_0x40175c,null))[_0x6966('0x24')](removeEntity(_0x40175c,null))[_0x6966('0x46')](handleError(_0x40175c,null));};
\ No newline at end of file
+var _0xcd2f=['fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','fieldName','type','key','query','keys','filters','intersection','attributes','model'];(function(_0x1cb381,_0x325815){var _0x4760b1=function(_0x2966e1){while(--_0x2966e1){_0x1cb381['push'](_0x1cb381['shift']());}};_0x4760b1(++_0x325815);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xcd2f[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcd2('0x0'));var rp=require(_0xfcd2('0x1'));var moment=require(_0xfcd2('0x2'));var BPromise=require(_0xfcd2('0x3'));var Mustache=require(_0xfcd2('0x4'));var util=require(_0xfcd2('0x5'));var path=require(_0xfcd2('0x6'));var sox=require(_0xfcd2('0x7'));var csv=require('to-csv');var ejs=require(_0xfcd2('0x8'));var fs=require('fs');var fs_extra=require(_0xfcd2('0x9'));var _=require(_0xfcd2('0xa'));var squel=require(_0xfcd2('0xb'));var crypto=require(_0xfcd2('0xc'));var jsforce=require(_0xfcd2('0xd'));var deskjs=require(_0xfcd2('0xe'));var toCsv=require(_0xfcd2('0xf'));var querystring=require(_0xfcd2('0x10'));var Papa=require(_0xfcd2('0x11'));var Redis=require(_0xfcd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfcd2('0x13'));var as=require(_0xfcd2('0x14'));var hardwareService=require(_0xfcd2('0x15'));var logger=require(_0xfcd2('0x16'))(_0xfcd2('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bff49,_0xdcfde9){_0xdcfde9=_0xdcfde9||0xcc;return function(_0x15aebb){if(_0x15aebb){return _0x5bff49['sendStatus'](_0xdcfde9);}return _0x5bff49[_0xfcd2('0x18')](_0xdcfde9)[_0xfcd2('0x19')]();};}function respondWithResult(_0x5ad180,_0x50f44c){_0x50f44c=_0x50f44c||0xc8;return function(_0x2825df){if(_0x2825df){return _0x5ad180[_0xfcd2('0x18')](_0x50f44c)[_0xfcd2('0x1a')](_0x2825df);}};}function respondWithFilteredResult(_0x4baf2f,_0x428cf3){return function(_0x4a2bcd){if(_0x4a2bcd){var _0x1a9f8f=typeof _0x428cf3[_0xfcd2('0x1b')]===_0xfcd2('0x1c')&&typeof _0x428cf3[_0xfcd2('0x1d')]===_0xfcd2('0x1c');var _0x378484=_0x4a2bcd['count'];var _0xba3186=_0x1a9f8f?0x0:_0x428cf3[_0xfcd2('0x1b')];var _0x32607c=_0x1a9f8f?_0x4a2bcd[_0xfcd2('0x1e')]:_0x428cf3[_0xfcd2('0x1b')]+_0x428cf3[_0xfcd2('0x1d')];var _0x5c8a4d;if(_0x32607c>=_0x378484){_0x32607c=_0x378484;_0x5c8a4d=0xc8;}else{_0x5c8a4d=0xce;}_0x4baf2f[_0xfcd2('0x18')](_0x5c8a4d);return _0x4baf2f[_0xfcd2('0x1f')](_0xfcd2('0x20'),_0xba3186+'-'+_0x32607c+'/'+_0x378484)[_0xfcd2('0x1a')](_0x4a2bcd);}return null;};}function patchUpdates(_0x266c86){return function(_0x55d8b0){try{jsonpatch[_0xfcd2('0x21')](_0x55d8b0,_0x266c86,!![]);}catch(_0x41c503){return BPromise[_0xfcd2('0x22')](_0x41c503);}return _0x55d8b0[_0xfcd2('0x23')]();};}function saveUpdates(_0x2a06d4,_0x37dafa){return function(_0x19ea4a){if(_0x19ea4a){return _0x19ea4a[_0xfcd2('0x24')](_0x2a06d4)[_0xfcd2('0x25')](function(_0x47fa14){return _0x47fa14;});}return null;};}function removeEntity(_0x23104f,_0x50c0cc){return function(_0xedae7a){if(_0xedae7a){return _0xedae7a[_0xfcd2('0x26')]()['then'](function(){_0x23104f['status'](0xcc)[_0xfcd2('0x19')]();});}};}function handleEntityNotFound(_0xe7fde9,_0x193dc3){return function(_0x2b0364){if(!_0x2b0364){_0xe7fde9['sendStatus'](0x194);}return _0x2b0364;};}function handleError(_0x1c4981,_0x2a8557){_0x2a8557=_0x2a8557||0x1f4;return function(_0x13e447){logger[_0xfcd2('0x27')](_0x13e447['stack']);if(_0x13e447[_0xfcd2('0x28')]){delete _0x13e447['name'];}_0x1c4981[_0xfcd2('0x18')](_0x2a8557)[_0xfcd2('0x29')](_0x13e447);};}exports['index']=function(_0x909257,_0x3cb642){var _0x41ecc9={},_0x4bffa9={},_0x15965e={'count':0x0,'rows':[]};var _0x4e79b=_[_0xfcd2('0x2a')](db['WhatsappApplication']['rawAttributes'],function(_0x5192b9){return{'name':_0x5192b9[_0xfcd2('0x2b')],'type':_0x5192b9[_0xfcd2('0x2c')][_0xfcd2('0x2d')]};});_0x4bffa9['model']=_[_0xfcd2('0x2a')](_0x4e79b,_0xfcd2('0x28'));_0x4bffa9[_0xfcd2('0x2e')]=_[_0xfcd2('0x2f')](_0x909257[_0xfcd2('0x2e')]);_0x4bffa9[_0xfcd2('0x30')]=_[_0xfcd2('0x31')](_0x4bffa9['model'],_0x4bffa9['query']);_0x41ecc9[_0xfcd2('0x32')]=_['intersection'](_0x4bffa9[_0xfcd2('0x33')],qs[_0xfcd2('0x34')](_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x34')]));_0x41ecc9[_0xfcd2('0x32')]=_0x41ecc9[_0xfcd2('0x32')][_0xfcd2('0x35')]?_0x41ecc9[_0xfcd2('0x32')]:_0x4bffa9[_0xfcd2('0x33')];if(!_0x909257['query'][_0xfcd2('0x36')](_0xfcd2('0x37'))){_0x41ecc9[_0xfcd2('0x1d')]=qs[_0xfcd2('0x1d')](_0x909257['query']['limit']);_0x41ecc9[_0xfcd2('0x1b')]=qs[_0xfcd2('0x1b')](_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x1b')]);}_0x41ecc9['order']=qs[_0xfcd2('0x38')](_0x909257[_0xfcd2('0x2e')]['sort']);_0x41ecc9[_0xfcd2('0x39')]=qs['filters'](_[_0xfcd2('0x3a')](_0x909257['query'],_0x4bffa9[_0xfcd2('0x30')]),_0x4e79b);if(_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x3b')]){_0x41ecc9['where']=_[_0xfcd2('0x3c')](_0x41ecc9[_0xfcd2('0x39')],{'$or':_[_0xfcd2('0x2a')](_0x4e79b,function(_0x89e532){if(_0x89e532[_0xfcd2('0x2c')]!==_0xfcd2('0x3d')){var _0x10249c={};_0x10249c[_0x89e532[_0xfcd2('0x28')]]={'$like':'%'+_0x909257[_0xfcd2('0x2e')][_0xfcd2('0x3b')]+'%'};return _0x10249c;}})});}_0x41ecc9=_[_0xfcd2('0x3c')]({},_0x41ecc9,_0x909257[_0xfcd2('0x3e')]);var _0x31368e={'where':_0x41ecc9[_0xfcd2('0x39')]};return db[_0xfcd2('0x3f')][_0xfcd2('0x1e')](_0x31368e)[_0xfcd2('0x25')](function(_0x47d6b6){_0x15965e[_0xfcd2('0x1e')]=_0x47d6b6;if(_0x909257['query'][_0xfcd2('0x40')]){_0x41ecc9[_0xfcd2('0x41')]=[{'all':!![]}];}return db[_0xfcd2('0x3f')][_0xfcd2('0x42')](_0x41ecc9);})['then'](function(_0x20f985){_0x15965e[_0xfcd2('0x43')]=_0x20f985;return _0x15965e;})[_0xfcd2('0x25')](respondWithFilteredResult(_0x3cb642,_0x41ecc9))[_0xfcd2('0x44')](handleError(_0x3cb642,null));};exports[_0xfcd2('0x45')]=function(_0x100198,_0x20c15b){var _0x34ffd6={'raw':!![],'where':{'id':_0x100198[_0xfcd2('0x46')]['id']}},_0x4ba64d={};_0x4ba64d[_0xfcd2('0x33')]=_[_0xfcd2('0x2f')](db[_0xfcd2('0x3f')][_0xfcd2('0x47')]);_0x4ba64d['query']=_[_0xfcd2('0x2f')](_0x100198[_0xfcd2('0x2e')]);_0x4ba64d[_0xfcd2('0x30')]=_[_0xfcd2('0x31')](_0x4ba64d['model'],_0x4ba64d[_0xfcd2('0x2e')]);_0x34ffd6[_0xfcd2('0x32')]=_[_0xfcd2('0x31')](_0x4ba64d[_0xfcd2('0x33')],qs[_0xfcd2('0x34')](_0x100198[_0xfcd2('0x2e')][_0xfcd2('0x34')]));_0x34ffd6[_0xfcd2('0x32')]=_0x34ffd6[_0xfcd2('0x32')]['length']?_0x34ffd6['attributes']:_0x4ba64d['model'];if(_0x100198[_0xfcd2('0x2e')][_0xfcd2('0x40')]){_0x34ffd6[_0xfcd2('0x41')]=[{'all':!![]}];}_0x34ffd6=_[_0xfcd2('0x3c')]({},_0x34ffd6,_0x100198['options']);return db[_0xfcd2('0x3f')][_0xfcd2('0x48')](_0x34ffd6)[_0xfcd2('0x25')](handleEntityNotFound(_0x20c15b,null))[_0xfcd2('0x25')](respondWithResult(_0x20c15b,null))['catch'](handleError(_0x20c15b,null));};exports[_0xfcd2('0x49')]=function(_0x26dbe2,_0x36233a){return db['WhatsappApplication'][_0xfcd2('0x49')](_0x26dbe2[_0xfcd2('0x4a')],{})['then'](respondWithResult(_0x36233a,0xc9))[_0xfcd2('0x44')](handleError(_0x36233a,null));};exports['update']=function(_0x559dea,_0x7352bb){if(_0x559dea[_0xfcd2('0x4a')]['id']){delete _0x559dea[_0xfcd2('0x4a')]['id'];}return db[_0xfcd2('0x3f')]['find']({'where':{'id':_0x559dea[_0xfcd2('0x46')]['id']}})[_0xfcd2('0x25')](handleEntityNotFound(_0x7352bb,null))[_0xfcd2('0x25')](saveUpdates(_0x559dea['body'],null))[_0xfcd2('0x25')](respondWithResult(_0x7352bb,null))[_0xfcd2('0x44')](handleError(_0x7352bb,null));};exports[_0xfcd2('0x26')]=function(_0x50f31c,_0x159aec){return db[_0xfcd2('0x3f')][_0xfcd2('0x48')]({'where':{'id':_0x50f31c[_0xfcd2('0x46')]['id']}})[_0xfcd2('0x25')](handleEntityNotFound(_0x159aec,null))[_0xfcd2('0x25')](removeEntity(_0x159aec,null))[_0xfcd2('0x44')](handleError(_0x159aec,null));};
\ No newline at end of file
index 7ca6b4d..c299495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d2=['rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise'];(function(_0x3cb6f0,_0x2aebf4){var _0x31c3d4=function(_0x52dafd){while(--_0x52dafd){_0x3cb6f0['push'](_0x3cb6f0['shift']());}};_0x31c3d4(++_0x2aebf4);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x426d9f,_0x2a3819){_0x426d9f=_0x426d9f-0x0;var _0xb3c607=_0xd6d2[_0x426d9f];return _0xb3c607;};'use strict';var _=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var logger=require('../../config/logger')(_0x2d6d('0x2'));var moment=require(_0x2d6d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d6d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d6d('0x5'));var config=require(_0x2d6d('0x6'));var attributes=require(_0x2d6d('0x7'));module['exports']=function(_0xfcdb1d,_0x132361){return _0xfcdb1d[_0x2d6d('0x8')](_0x2d6d('0x9'),attributes,{'tableName':_0x2d6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2d6d('0xb'),'collate':_0x2d6d('0xc')});};
\ No newline at end of file
+var _0xf25a=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2c84e5,_0x58a7c7){var _0x4990ec=function(_0x5b02b0){while(--_0x5b02b0){_0x2c84e5['push'](_0x2c84e5['shift']());}};_0x4990ec(++_0x58a7c7);}(_0xf25a,0x195));var _0xaf25=function(_0x48cbb3,_0x21b51d){_0x48cbb3=_0x48cbb3-0x0;var _0x125cec=_0xf25a[_0x48cbb3];return _0x125cec;};'use strict';var _=require(_0xaf25('0x0'));var util=require(_0xaf25('0x1'));var logger=require(_0xaf25('0x2'))('api');var moment=require(_0xaf25('0x3'));var BPromise=require(_0xaf25('0x4'));var rp=require(_0xaf25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf25('0x6'));var config=require(_0xaf25('0x7'));var attributes=require(_0xaf25('0x8'));module['exports']=function(_0x49281b,_0x30eaae){return _0x49281b['define']('WhatsappApplication',attributes,{'tableName':_0xaf25('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf25('0xa'),'collate':_0xaf25('0xb')});};
\ No newline at end of file
index ea062dc..c73cee2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});}
\ No newline at end of file
+var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x4e4c51,_0x1679c9){var _0x25d105=function(_0x5f233f){while(--_0x5f233f){_0x4e4c51['push'](_0x4e4c51['shift']());}};_0x25d105(++_0x1679c9);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3a0956,_0x46169e){_0x3a0956=_0x3a0956-0x0;var _0x4b5e18=_0x8d0e[_0x3a0956];return _0x4b5e18;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});}
\ No newline at end of file
index c6bb533..11ebb1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x277c,0x153));var _0xc277=function(_0x3de8f2,_0x22bf21){_0x3de8f2=_0x3de8f2-0x0;var _0x2f62ec=_0x277c[_0x3de8f2];return _0x2f62ec;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xa')](_0xc277('0xe'),auth[_0xc277('0x9')](),controller['getMessages']);router['get'](_0xc277('0xf'),auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')]('/',auth['isAuthenticated'](),controller[_0xc277('0x12')]);router['post'](_0xc277('0xe'),auth[_0xc277('0x9')](),controller[_0xc277('0x13')]);router[_0xc277('0x11')]('/:id/tags',auth[_0xc277('0x9')](),interaction[_0xc277('0x14')](_0xc277('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xc277('0x16')]('/:id',auth[_0xc277('0x9')](),interaction['tracked'](_0xc277('0x15'),_0xc277('0x17')),controller[_0xc277('0x18')]);router['delete']('/:id',auth[_0xc277('0x9')](),interaction['tracked']('whatsapp',_0xc277('0x19')),controller[_0xc277('0x1a')]);router[_0xc277('0x1b')](_0xc277('0x1c'),auth[_0xc277('0x9')](),controller[_0xc277('0x1d')]);module[_0xc277('0x1e')]=router;
\ No newline at end of file
+var _0x3831=['whatsappinteraction:destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete'];(function(_0x5ca7e5,_0x5b5eec){var _0x1a509f=function(_0x437d47){while(--_0x437d47){_0x5ca7e5['push'](_0x5ca7e5['shift']());}};_0x1a509f(++_0x5b5eec);}(_0x3831,0x14c));var _0x1383=function(_0x2bff9c,_0xe5758){_0x2bff9c=_0x2bff9c-0x0;var _0x24ca0b=_0x3831[_0x2bff9c];return _0x24ca0b;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0x8')](_0x1383('0xd'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0x8')](_0x1383('0xf'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);router['post']('/',auth[_0x1383('0x9')](),controller[_0x1383('0x11')]);router[_0x1383('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1383('0x13')]);router[_0x1383('0x12')](_0x1383('0x14'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x17')),controller[_0x1383('0x18')]);router['put'](_0x1383('0xb'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x19')),controller[_0x1383('0x1a')]);router[_0x1383('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x1383('0x15')]('whatsapp',_0x1383('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth[_0x1383('0x9')](),controller['removeTags']);module[_0x1383('0x1d')]=router;
\ No newline at end of file
index 04445eb..fae8768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dac=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x294d2e,_0x192aa7){var _0x3caea9=function(_0x58eea3){while(--_0x58eea3){_0x294d2e['push'](_0x294d2e['shift']());}};_0x3caea9(++_0x192aa7);}(_0x6dac,0x16e));var _0xc6da=function(_0x472bdf,_0x539928){_0x472bdf=_0x472bdf-0x0;var _0x2f4341=_0x6dac[_0x472bdf];return _0x2f4341;};'use strict';var Sequelize=require(_0xc6da('0x0'));var moment=require(_0xc6da('0x1'));module[_0xc6da('0x2')]={'closed':{'type':Sequelize[_0xc6da('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc6da('0x4')]},'disposition':{'type':Sequelize[_0xc6da('0x5')]},'secondDisposition':{'type':Sequelize[_0xc6da('0x5')]},'thirdDisposition':{'type':Sequelize[_0xc6da('0x5')]},'note':{'type':Sequelize[_0xc6da('0x5')]},'phone':{'type':Sequelize[_0xc6da('0x5')]},'read1stAt':{'type':Sequelize[_0xc6da('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xc6da('0x6')]('in',_0xc6da('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc6da('0x6')]('in',_0xc6da('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc6da('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x49fe=['STRING','DATE','out','ENUM','sequelize','moment','exports'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x49fe,0x100));var _0xe49f=function(_0x1a7896,_0x754ccf){_0x1a7896=_0x1a7896-0x0;var _0x56dd5a=_0x49fe[_0x1a7896];return _0x56dd5a;};'use strict';var Sequelize=require(_0xe49f('0x0'));var moment=require(_0xe49f('0x1'));module[_0xe49f('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe49f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe49f('0x3')]},'note':{'type':Sequelize[_0xe49f('0x3')]},'phone':{'type':Sequelize[_0xe49f('0x3')]},'read1stAt':{'type':Sequelize[_0xe49f('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe49f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe49f('0x6')]('in',_0xe49f('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 3084919..b5784df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da1=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','length','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','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','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','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.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?','WhatsappInteractionId','all','rows','show','params','include','options','create','describe','addMessage','WhatsappMessage','omit','ids','sort','pick','merge','format','includeAll','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','createdAt','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','basename','existsSync','createReadStream','createWriteStream','out','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x522e17,_0x1acaff){var _0x8eb31a=function(_0x34e64c){while(--_0x34e64c){_0x522e17['push'](_0x522e17['shift']());}};_0x8eb31a(++_0x1acaff);}(_0x1da1,0x1a4));var _0x11da=function(_0x5e2caf,_0x58f1df){_0x5e2caf=_0x5e2caf-0x0;var _0x3b684b=_0x1da1[_0x5e2caf];return _0x3b684b;};'use strict';var emlformat=require(_0x11da('0x0'));var rimraf=require(_0x11da('0x1'));var zipdir=require(_0x11da('0x2'));var jsonpatch=require(_0x11da('0x3'));var rp=require(_0x11da('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x11da('0x5'));var util=require(_0x11da('0x6'));var path=require(_0x11da('0x7'));var sox=require('sox');var csv=require(_0x11da('0x8'));var ejs=require(_0x11da('0x9'));var fs=require('fs');var fs_extra=require(_0x11da('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x11da('0xb'));var jsforce=require(_0x11da('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x11da('0x8'));var querystring=require(_0x11da('0xd'));var Papa=require('papaparse');var Redis=require(_0x11da('0xe'));var authService=require(_0x11da('0xf'));var qs=require(_0x11da('0x10'));var as=require(_0x11da('0x11'));var pdf=require(_0x11da('0x12'));var hardwareService=require(_0x11da('0x13'));var logger=require(_0x11da('0x14'))(_0x11da('0x15'));var utils=require(_0x11da('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x11da('0x17'));var db=require(_0x11da('0x18'))['db'];config[_0x11da('0x19')]=_[_0x11da('0x1a')](config[_0x11da('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x11da('0x1b'))(new Redis(config[_0x11da('0x19')]));require(_0x11da('0x1c'))[_0x11da('0x1d')](socket);function respondWithStatusCode(_0x3aae0d,_0x58c60d){_0x58c60d=_0x58c60d||0xcc;return function(_0x1a0f47){if(_0x1a0f47){return _0x3aae0d['sendStatus'](_0x58c60d);}return _0x3aae0d[_0x11da('0x1e')](_0x58c60d)[_0x11da('0x1f')]();};}function respondWithResult(_0x278f02,_0xdcd341){_0xdcd341=_0xdcd341||0xc8;return function(_0x9ec352){if(_0x9ec352){return _0x278f02[_0x11da('0x1e')](_0xdcd341)[_0x11da('0x20')](_0x9ec352);}};}function respondWithFilteredResult(_0x2c757e,_0x3c3392){return function(_0x12fb44){if(_0x12fb44){var _0x463c3d=typeof _0x3c3392[_0x11da('0x21')]==='undefined'&&typeof _0x3c3392[_0x11da('0x22')]===_0x11da('0x23');var _0x33de25=_0x12fb44[_0x11da('0x24')];var _0x3e3140=_0x463c3d?0x0:_0x3c3392['offset'];var _0x2c0d4a=_0x463c3d?_0x12fb44[_0x11da('0x24')]:_0x3c3392[_0x11da('0x21')]+_0x3c3392['limit'];var _0x4b0f71;if(_0x2c0d4a>=_0x33de25){_0x2c0d4a=_0x33de25;_0x4b0f71=0xc8;}else{_0x4b0f71=0xce;}_0x2c757e[_0x11da('0x1e')](_0x4b0f71);return _0x2c757e[_0x11da('0x25')](_0x11da('0x26'),_0x3e3140+'-'+_0x2c0d4a+'/'+_0x33de25)['json'](_0x12fb44);}return null;};}function patchUpdates(_0x1294b3){return function(_0x4a7e5d){try{jsonpatch[_0x11da('0x27')](_0x4a7e5d,_0x1294b3,!![]);}catch(_0x3a90db){return BPromise[_0x11da('0x28')](_0x3a90db);}return _0x4a7e5d[_0x11da('0x29')]();};}function saveUpdates(_0x2b03dd,_0x700476){return function(_0x49578b){if(_0x49578b){return _0x49578b['update'](_0x2b03dd)[_0x11da('0x2a')](function(_0x3ad7b7){return _0x3ad7b7;});}return null;};}function removeEntity(_0x48908f,_0x662329){return function(_0x28adc7){if(_0x28adc7){return _0x28adc7['destroy']()[_0x11da('0x2a')](function(){_0x48908f[_0x11da('0x1e')](0xcc)[_0x11da('0x1f')]();});}};}function handleEntityNotFound(_0x1592ab,_0x1f82c7){return function(_0x5e9c07){if(!_0x5e9c07){_0x1592ab[_0x11da('0x2b')](0x194);}return _0x5e9c07;};}function handleError(_0x25b716,_0x219ac0){_0x219ac0=_0x219ac0||0x1f4;return function(_0x47aab1){logger[_0x11da('0x2c')](_0x47aab1['stack']);if(_0x47aab1['name']){delete _0x47aab1[_0x11da('0x2d')];}_0x25b716[_0x11da('0x1e')](_0x219ac0)[_0x11da('0x2e')](_0x47aab1);};}function getInteractionUsers(_0x4c66cd,_0x553814){return new BPromise(function(_0x400e36,_0x279fd1){try{if(_0x553814[_0x4c66cd['id']]){_0x4c66cd[_0x11da('0x2f')]=_[_0x11da('0x30')](_0x553814[_0x4c66cd['id']],function(_0x45d0fa){return{'id':_0x45d0fa['id'],'fullname':_0x45d0fa[_0x11da('0x31')]};});}}catch(_0x56e74d){_0x279fd1(_0x56e74d);}_0x400e36(_0x4c66cd);});}function getInteractionTags(_0x1ccd67,_0x4f58b8){return new BPromise(function(_0x5ecc20,_0x122c23){try{if(_0x1ccd67[_0x11da('0x32')]){_0x1ccd67[_0x11da('0x33')]=[];_0x1ccd67[_0x11da('0x32')][_0x11da('0x34')](',')[_0x11da('0x35')](function(_0xc968e3){_0x1ccd67['Tags'][_0x11da('0x36')](_0x4f58b8[_0xc968e3]);});}delete _0x1ccd67['TagIds'];}catch(_0x3c9fbe){_0x122c23(_0x3c9fbe);}_0x5ecc20(_0x1ccd67);});}function updateWhatsappInteraction(_0x5903d5,_0x3110b5,_0x4b440e){return new BPromise(function(_0x5e49d6,_0xfd1bca){return getInteractionUsers(_0x5903d5,_0x4b440e)[_0x11da('0x2a')](function(_0x39b1fd){return getInteractionTags(_0x39b1fd,_0x3110b5);})[_0x11da('0x2a')](function(_0xd537){_0x5e49d6(_0xd537);})[_0x11da('0x37')](function(_0x56614e){_0xfd1bca(_0x56614e);});});}exports['index']=function(_0x4187be,_0x4314ad){var _0x2bb01e={},_0x5ae0aa={},_0x58c4c9={'count':0x0,'rows':[]};var _0x387dab=_[_0x11da('0x30')](db[_0x11da('0x38')][_0x11da('0x39')],function(_0xf4699b){return{'name':_0xf4699b[_0x11da('0x3a')],'type':_0xf4699b[_0x11da('0x3b')][_0x11da('0x3c')]};});_0x5ae0aa[_0x11da('0x3d')]=_[_0x11da('0x30')](_0x387dab,_0x11da('0x2d'));_0x5ae0aa[_0x11da('0x3e')]=_[_0x11da('0x3f')](_0x4187be[_0x11da('0x3e')]);_0x5ae0aa[_0x11da('0x40')]=_['intersection'](_0x5ae0aa[_0x11da('0x3d')],_0x5ae0aa[_0x11da('0x3e')]);_0x2bb01e['attributes']=_[_0x11da('0x41')](_0x5ae0aa['model'],qs[_0x11da('0x42')](_0x4187be[_0x11da('0x3e')][_0x11da('0x42')]));_0x2bb01e['attributes']=_0x2bb01e[_0x11da('0x43')]['length']?_0x2bb01e[_0x11da('0x43')]:_0x5ae0aa[_0x11da('0x3d')];if(!_0x4187be[_0x11da('0x3e')][_0x11da('0x44')](_0x11da('0x45'))){_0x2bb01e['limit']=qs[_0x11da('0x22')](_0x4187be[_0x11da('0x3e')][_0x11da('0x22')]);_0x2bb01e[_0x11da('0x21')]=qs[_0x11da('0x21')](_0x4187be['query'][_0x11da('0x21')]);}_0x2bb01e[_0x11da('0x46')]=qs['sort'](_0x4187be['query']['sort']);_0x2bb01e[_0x11da('0x47')]=qs[_0x11da('0x40')](_['pick'](_0x4187be[_0x11da('0x3e')],_0x5ae0aa[_0x11da('0x40')]),_0x387dab);var _0x15a079=[];var _0x4ab79b=squel[_0x11da('0x48')]()[_0x11da('0x49')]('id')[_0x11da('0x49')](_0x11da('0x2d'))[_0x11da('0x49')](_0x11da('0x4a'))[_0x11da('0x4b')](_0x11da('0x4c'));var _0xeae90b=squel['select']()[_0x11da('0x49')](_0x11da('0x4d'))[_0x11da('0x49')](_0x11da('0x4e'))[_0x11da('0x49')](_0x11da('0x4f'))[_0x11da('0x4b')](_0x11da('0x50'),'ui')[_0x11da('0x51')](_0x11da('0x52'),'u',_0x11da('0x53'));var _0x5b8723=squel[_0x11da('0x48')]()[_0x11da('0x4b')](_0x11da('0x54'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x11da('0x51')]('users','o','o.id\x20=\x20i.UserId')[_0x11da('0x51')](_0x11da('0x55'),'a',_0x11da('0x56'))['left_join'](_0x11da('0x57'),'me',_0x11da('0x58'))['left_join'](_0x11da('0x59'),'it',_0x11da('0x5a'))['left_join'](_0x11da('0x4c'),'t',_0x11da('0x5b'));var _0x23c632=squel[_0x11da('0x5c')]();var _0x500353=[];var _0x1af615=squel['expr']();var _0x4af8ca;if(_0x4187be['query']['search']){_0x4af8ca=as['parseSearch'](_0x4187be[_0x11da('0x3e')][_0x11da('0x5d')]);var _0x340450=_0x4af8ca['sqlOperator'];for(var _0x105bbe=0x0;_0x105bbe<_0x4af8ca[_0x11da('0x5e')][_0x11da('0x5f')];_0x105bbe++){var _0x4633ef=_0x4af8ca['conditions'][_0x105bbe];var _0x1bfc3e='i';var _0x4254c5=_['find'](_0x387dab,[_0x11da('0x2d'),_0x4633ef[_0x11da('0x49')]]);if(!_0x4254c5){switch(_0x4633ef[_0x11da('0x49')]){case _0x11da('0x60'):if(_0x4633ef[_0x11da('0x61')]==0x1){_0x5b8723[_0x11da('0x62')]('`'+_0x4633ef[_0x11da('0x49')]+_0x11da('0x63'));}else{_0x5b8723[_0x11da('0x62')]('`'+_0x4633ef[_0x11da('0x49')]+_0x11da('0x64'));}break;case _0x11da('0x65'):if(_0x4633ef[_0x11da('0x66')]===_0x11da('0x67')){if(_0x4633ef[_0x11da('0x61')]['split']('\x20')[_0x11da('0x5f')]>0x1){_0x23c632[_0x340450](_0x11da('0x68'),qs[_0x11da('0x69')](_0x4633ef[_0x11da('0x61')]),null);}else{var _0x280962='%'+_0x4633ef[_0x11da('0x61')]+'%';_0x23c632[_0x340450](_0x11da('0x6a'),_0x280962,_0x280962,_0x280962);}}else{_0x4254c5=_['find'](_0x387dab,['name',_0x11da('0x6b')]);_0x4633ef[_0x11da('0x49')]='ContactId';_0x19fc47=as[_0x11da('0x6c')](_0x1bfc3e,_0x4254c5[_0x11da('0x3b')],_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47['value'][_0x11da('0x6e')],_0x19fc47[_0x11da('0x61')][_0x11da('0x1f')]);}break;case'Tag':var _0x225f56=_0x4633ef[_0x11da('0x61')]['split'](',')[_0x11da('0x30')](function(_0x29769e){return Number(_0x29769e);});_0x225f56[_0x11da('0x35')](function(_0x405d65){_0x1af615['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x405d65+',%');});_0x500353=_['union'](_0x500353,_0x225f56);break;case _0x11da('0x6f'):if(_0x4633ef['operator']===_0x11da('0x67')){_0x23c632[_0x340450](_0x11da('0x70'),'%'+_0x4633ef[_0x11da('0x61')]+'%',null);}else{_0x4254c5=_[_0x11da('0x71')](_0x387dab,[_0x11da('0x2d'),_0x11da('0x72')]);_0x4633ef[_0x11da('0x49')]=_0x11da('0x72');_0x19fc47=as[_0x11da('0x6c')](_0x1bfc3e,_0x4254c5[_0x11da('0x3b')],_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47['value']['start'],_0x19fc47['value'][_0x11da('0x1f')]);}break;case _0x11da('0x73'):_0x19fc47=as[_0x11da('0x6c')]('me',null,_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47[_0x11da('0x61')][_0x11da('0x6e')],_0x19fc47['value'][_0x11da('0x1f')]);break;}}else{var _0x19fc47=as[_0x11da('0x6c')](_0x1bfc3e,_0x4254c5[_0x11da('0x3b')],_0x4633ef);_0x23c632[_0x340450](_0x19fc47[_0x11da('0x6d')],_0x19fc47[_0x11da('0x61')]['start'],_0x19fc47['value'][_0x11da('0x1f')]);}}}else{var _0x4a8abb=_(_0x4187be[_0x11da('0x3e')])[_0x11da('0x3f')]()['map'](function(_0x188673){return _['some'](_0x387dab,[_0x11da('0x2d'),_0x188673])?_0x188673:undefined;})[_0x11da('0x74')]()[_0x11da('0x61')]();if(!_[_0x11da('0x75')](_0x4a8abb)){_0x4a8abb[_0x11da('0x35')](function(_0x45c074){if(_0x45c074===_0x11da('0x76')){_0x5b8723[_0x11da('0x47')](_0x11da('0x77'),[][_0x11da('0x78')](_0x4187be['query'][_0x45c074]));}else if(_0x45c074==='createdAt'){var _0x54e0a0=JSON[_0x11da('0x79')](_0x4187be[_0x11da('0x3e')][_0x45c074])[_0x11da('0x7a')];var _0x4467f0=JSON['parse'](_0x4187be[_0x11da('0x3e')][_0x45c074])[_0x11da('0x7b')];_0x5b8723['where'](_0x11da('0x7c'),_0x54e0a0,_0x4467f0);}else{if(_0x4187be[_0x11da('0x3e')][_0x45c074]===_0x11da('0x7d')){_0x5b8723['where']('i.'+_0x45c074+_0x11da('0x7e'));}else{_0x5b8723[_0x11da('0x47')]('i.'+_0x45c074+'\x20=\x20?',_0x4187be[_0x11da('0x3e')][_0x45c074]);}}});}if(_0x4187be[_0x11da('0x3e')][_0x11da('0x7f')]){if(_0x4187be[_0x11da('0x3e')][_0x11da('0x7f')]==0x1){_0x5b8723[_0x11da('0x62')](_0x11da('0x80'));}else{_0x5b8723['having'](_0x11da('0x81'));}}if(_0x4187be[_0x11da('0x3e')]['tag']){_0x500353=_[_0x11da('0x82')](_0x4187be[_0x11da('0x3e')][_0x11da('0x83')])?_0x4187be[_0x11da('0x3e')]['tag']:new Array(_0x4187be[_0x11da('0x3e')][_0x11da('0x83')]);_0x500353['forEach'](function(_0x2689f3){_0x1af615['or'](_0x11da('0x84'),'%,'+_0x2689f3+',%');});}if(_0x4187be[_0x11da('0x3e')]['filter']){var _0x55f83b=_0x4187be['query'][_0x11da('0x85')]['replace']('\x5c','\x5c\x5c')[_0x11da('0x86')](/'/g,'\x27\x27');if(qs[_0x11da('0x87')](_0x55f83b)){_0x23c632['or'](_0x11da('0x88'),_0x55f83b+'%')['or'](_0x11da('0x89'),_0x55f83b+'%');}else{_0x23c632['or'](_0x11da('0x8a'),qs[_0x11da('0x69')](_0x55f83b))['or'](_0x11da('0x8b'),_0x55f83b+'%');}}}_0x5b8723[_0x11da('0x47')](_0x23c632);_0x5b8723['group'](_0x11da('0x8c'));var _0x22554c={'type':db[_0x11da('0x8d')][_0x11da('0x8e')][_0x11da('0x8f')],'raw':!![]};var _0x2c6970=_0x5b8723[_0x11da('0x90')]();_0x2c6970['field'](_0x11da('0x8c'));_0x2c6970[_0x11da('0x49')](_0x11da('0x91'),_0x11da('0x60'));if(_0x2bb01e['order']){_0x2bb01e[_0x11da('0x46')][_0x11da('0x35')](function(_0x4c0872){var _0x1693d7=_0x4c0872[0x0]===_0x11da('0x92')?_0x4c0872[0x0]:'i.'+_0x4c0872[0x0];_0x5b8723[_0x11da('0x46')](_0x1693d7,_0x4c0872[0x1]===_0x11da('0x93')?![]:!![]);});}if(!_[_0x11da('0x75')](_0x500353)){_0x5b8723[_0x11da('0x62')](_0x1af615);_0x2c6970[_0x11da('0x47')](_0x11da('0x94'),_0x500353);}BPromise[_0x11da('0x95')]()[_0x11da('0x2a')](function(){if(!_0x4af8ca){if(_0x4187be['query'][_0x11da('0x76')])return;_0x2c6970[_0x11da('0x47')](_0x11da('0x96'));_0x5b8723[_0x11da('0x47')](_0x11da('0x96'));return;}if(_0x4187be[_0x11da('0x97')][_0x11da('0x98')]!==_0x11da('0x99'))return;return _0x4187be[_0x11da('0x97')][_0x11da('0x9a')]({'attributes':['id'],'raw':!![]})[_0x11da('0x2a')](function(_0x3552f5){if(_[_0x11da('0x75')](_0x3552f5)){_0x2c6970[_0x11da('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');_0x5b8723[_0x11da('0x47')](_0x11da('0x9b'));}else{_0x2c6970['where'](_0x11da('0x77'),_[_0x11da('0x30')](_0x3552f5,'id'));_0x5b8723['where'](_0x11da('0x77'),_['map'](_0x3552f5,'id'));}});})[_0x11da('0x2a')](function(){if(_0x4187be['user']['role']==='agent'&&!_0x4af8ca&&!_0x4187be[_0x11da('0x3e')][_0x11da('0x76')])return[];return db['sequelize'][_0x11da('0x3e')](_0x2c6970[_0x11da('0x9c')](),_0x22554c);})['then'](function(_0x3549ad){_0x58c4c9[_0x11da('0x24')]=_0x3549ad[_0x11da('0x5f')];if(_0x58c4c9[_0x11da('0x24')]===0x0)return[];return db[_0x11da('0x9d')]['query'](_0x4ab79b[_0x11da('0x9c')](),_0x22554c)[_0x11da('0x2a')](function(_0x5924e7){_0x15a079=_[_0x11da('0x9e')](_0x5924e7,'id');_0x22554c=_['merge'](_0x22554c,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4187be[_0x11da('0x3e')][_0x11da('0x42')]){_0x2bb01e[_0x11da('0x43')][_0x11da('0x35')](function(_0x58c179){_0x5b8723[_0x11da('0x49')]('i.'+_0x58c179);});}else{_0x5b8723[_0x11da('0x49')](_0x11da('0x91'),_0x11da('0x60'));_0x5b8723[_0x11da('0x49')](_0x11da('0x9f'),'Account.key');_0x5b8723[_0x11da('0x49')](_0x11da('0xa0'),_0x11da('0xa1'));_0x5b8723[_0x11da('0x49')](_0x11da('0xa2'),_0x11da('0x92'));_0x5b8723['field']('i.*');_0x5b8723[_0x11da('0x49')](_0x11da('0xa3'),'Contact.firstName');_0x5b8723[_0x11da('0x49')](_0x11da('0xa4'),_0x11da('0xa5'));_0x5b8723[_0x11da('0x49')](_0x11da('0xa6'),_0x11da('0xa7'));_0x5b8723[_0x11da('0x49')](_0x11da('0xa8'),'Contact.phone');_0x5b8723[_0x11da('0x49')](_0x11da('0xa9'),_0x11da('0xaa'));_0x5b8723[_0x11da('0x49')](_0x11da('0xab'),_0x11da('0xac'));_0x5b8723[_0x11da('0x49')](_0x11da('0xad'),_0x11da('0xae'));_0x5b8723[_0x11da('0x49')](_0x11da('0xaf'),_0x11da('0xb0'));_0x5b8723[_0x11da('0x49')](_0x11da('0xb1'),'TagIds');}if(_0x2bb01e[_0x11da('0x22')])_0x5b8723[_0x11da('0x22')](_0x2bb01e[_0x11da('0x22')]);if(_0x2bb01e[_0x11da('0x21')])_0x5b8723[_0x11da('0x21')](_0x2bb01e[_0x11da('0x21')]);return db[_0x11da('0x9d')]['query'](_0x5b8723[_0x11da('0x9c')](),_0x22554c);})[_0x11da('0x2a')](function(_0x2d4728){if(_0x2d4728['length']>0x0)_0xeae90b[_0x11da('0x47')](_0x11da('0xb2'),_[_0x11da('0x30')](_0x2d4728,'id'));return db['sequelize']['query'](_0xeae90b[_0x11da('0x9c')](),_0x22554c)[_0x11da('0x2a')](function(_0x389d1b){var _0x15c577=_['groupBy'](_0x389d1b,_0x11da('0xb3'));var _0x2d9f98=[];_0x2d4728[_0x11da('0x35')](function(_0x31e220){_0x2d9f98[_0x11da('0x36')](updateWhatsappInteraction(_0x31e220,_0x15a079,_0x15c577));});return BPromise[_0x11da('0xb4')](_0x2d9f98);});});})[_0x11da('0x2a')](function(_0x5dc264){_0x58c4c9[_0x11da('0xb5')]=_0x5dc264;return _0x58c4c9;})[_0x11da('0x2a')](respondWithFilteredResult(_0x4314ad,_0x2bb01e))[_0x11da('0x37')](handleError(_0x4314ad,null));};exports[_0x11da('0xb6')]=function(_0x82bdfc,_0x51d42b){var _0x4f2513={'raw':![],'where':{'id':_0x82bdfc[_0x11da('0xb7')]['id']}},_0x3009b4={};_0x3009b4['model']=_[_0x11da('0x3f')](db[_0x11da('0x38')]['rawAttributes']);_0x3009b4['query']=_['keys'](_0x82bdfc[_0x11da('0x3e')]);_0x3009b4[_0x11da('0x40')]=_['intersection'](_0x3009b4['model'],_0x3009b4[_0x11da('0x3e')]);_0x4f2513['attributes']=_[_0x11da('0x41')](_0x3009b4[_0x11da('0x3d')],qs[_0x11da('0x42')](_0x82bdfc[_0x11da('0x3e')][_0x11da('0x42')]));_0x4f2513[_0x11da('0x43')]=_0x4f2513[_0x11da('0x43')][_0x11da('0x5f')]?_0x4f2513[_0x11da('0x43')]:_0x3009b4[_0x11da('0x3d')];if(_0x82bdfc['query']['includeAll']){_0x4f2513[_0x11da('0xb8')]=[{'all':!![]}];}_0x4f2513=_['merge']({},_0x4f2513,_0x82bdfc[_0x11da('0xb9')]);return db[_0x11da('0x38')][_0x11da('0x71')](_0x4f2513)[_0x11da('0x2a')](handleEntityNotFound(_0x51d42b,null))[_0x11da('0x2a')](respondWithResult(_0x51d42b,null))['catch'](handleError(_0x51d42b,null));};exports[_0x11da('0xba')]=function(_0x326bae,_0x553519){return db[_0x11da('0x38')][_0x11da('0xba')](_0x326bae['body'],{})['then'](respondWithResult(_0x553519,0xc9))[_0x11da('0x37')](handleError(_0x553519,null));};exports['update']=function(_0x47dafb,_0x2c586b){if(_0x47dafb[_0x11da('0x73')]['id']){delete _0x47dafb[_0x11da('0x73')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x47dafb['params']['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x2c586b,null))['then'](saveUpdates(_0x47dafb[_0x11da('0x73')],null))[_0x11da('0x2a')](respondWithResult(_0x2c586b,null))[_0x11da('0x37')](handleError(_0x2c586b,null));};exports['destroy']=function(_0x9be40f,_0x44c52b){return db[_0x11da('0x38')][_0x11da('0x71')]({'where':{'id':_0x9be40f[_0x11da('0xb7')]['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x44c52b,null))['then'](removeEntity(_0x44c52b,null))[_0x11da('0x37')](handleError(_0x44c52b,null));};exports[_0x11da('0xbb')]=function(_0x34bde7,_0x4d1cd7){return db[_0x11da('0x38')][_0x11da('0xbb')]()[_0x11da('0x2a')](respondWithResult(_0x4d1cd7,null))[_0x11da('0x37')](handleError(_0x4d1cd7,null));};exports[_0x11da('0xbc')]=function(_0xec0a5f,_0xb25edf,_0xb60b48){return db[_0x11da('0xbd')][_0x11da('0x71')]({'where':{'id':_0xec0a5f[_0x11da('0xb7')]['id']}})['then'](handleEntityNotFound(_0xb25edf,null))[_0x11da('0x2a')](function(_0xf27dc3){if(_0xf27dc3){return _0xf27dc3[_0x11da('0xbc')](_0xec0a5f['body']['ids'],_[_0x11da('0xbe')](_0xec0a5f[_0x11da('0x73')],[_0x11da('0xbf'),'id'])||{});}})['then'](respondWithResult(_0xb25edf,null))['catch'](handleError(_0xb25edf,null));};exports['getMessages']=function(_0x3e6fa2,_0x583d1e,_0x3087ac){var _0x1fa988={'raw':![],'where':{}};var _0x99c02e={};var _0x3ee8da={'count':0x0,'rows':[]};return db[_0x11da('0x38')]['findOne']({'where':{'id':_0x3e6fa2[_0x11da('0xb7')]['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x583d1e,null))[_0x11da('0x2a')](function(_0x4b0e01){if(_0x4b0e01){_0x99c02e[_0x11da('0x3d')]=_['keys'](db[_0x11da('0xbd')]['rawAttributes']);_0x99c02e[_0x11da('0x3e')]=_['keys'](_0x3e6fa2[_0x11da('0x3e')]);_0x99c02e[_0x11da('0x40')]=_[_0x11da('0x41')](_0x99c02e[_0x11da('0x3d')],_0x99c02e['query']);_0x1fa988[_0x11da('0x43')]=_[_0x11da('0x41')](_0x99c02e['model'],qs[_0x11da('0x42')](_0x3e6fa2[_0x11da('0x3e')]['fields']));_0x1fa988[_0x11da('0x43')]=_0x1fa988[_0x11da('0x43')]['length']?_0x1fa988[_0x11da('0x43')]:_0x99c02e[_0x11da('0x3d')];if(!_0x3e6fa2[_0x11da('0x3e')][_0x11da('0x44')](_0x11da('0x45'))){_0x1fa988[_0x11da('0x22')]=qs['limit'](_0x3e6fa2[_0x11da('0x3e')][_0x11da('0x22')]);_0x1fa988['offset']=qs[_0x11da('0x21')](_0x3e6fa2[_0x11da('0x3e')]['offset']);}_0x1fa988[_0x11da('0x46')]=qs[_0x11da('0xc0')](_0x3e6fa2[_0x11da('0x3e')][_0x11da('0xc0')]);_0x1fa988[_0x11da('0x47')]=qs[_0x11da('0x40')](_[_0x11da('0xc1')](_0x3e6fa2[_0x11da('0x3e')],_0x99c02e[_0x11da('0x40')]));_0x1fa988['where'][_0x11da('0xb3')]=_0x4b0e01['id'];if(_0x3e6fa2[_0x11da('0x3e')]['filter']){_0x1fa988['where']=_[_0x11da('0xc2')](_0x1fa988[_0x11da('0x47')],{'$or':_['map'](_0x1fa988[_0x11da('0x43')],function(_0x5b6453){var _0x47849c={};_0x47849c[_0x5b6453]={'$like':'%'+_0x3e6fa2['query'][_0x11da('0x85')]+'%'};return _0x47849c;})});}if(_0x3e6fa2[_0x11da('0x3e')][_0x11da('0x7a')]){var _0x578872=_0x3e6fa2['query'][_0x11da('0x7a')][_0x11da('0x34')](',');var _0x5cb2cb={};_0x5cb2cb[_0x578872[0x0]]={'$gte':moment(_0x578872[0x1])[_0x11da('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1fa988[_0x11da('0x47')]=_['merge'](_0x1fa988[_0x11da('0x47')],_0x5cb2cb);}_0x1fa988=_[_0x11da('0xc2')]({},_0x1fa988,_0x3e6fa2[_0x11da('0xb9')]);return db[_0x11da('0xbd')]['count']({'where':_0x1fa988[_0x11da('0x47')]})['then'](function(_0x512d16){_0x3ee8da[_0x11da('0x24')]=_0x512d16;if(_0x3e6fa2['query'][_0x11da('0xc4')]){_0x1fa988[_0x11da('0xb8')]=[{'all':!![]}];}return db[_0x11da('0xbd')]['findAll'](_0x1fa988);})[_0x11da('0x2a')](function(_0x56e381){_0x3ee8da[_0x11da('0xb5')]=_0x56e381;return _0x3ee8da;});}})[_0x11da('0x2a')](respondWithFilteredResult(_0x583d1e,_0x1fa988))[_0x11da('0x37')](handleError(_0x583d1e,null));};exports[_0x11da('0xc5')]=function(_0x2c15e0,_0x3dd8c4,_0xcc6f56){return db[_0x11da('0x38')]['find']({'where':{'id':_0x2c15e0[_0x11da('0xb7')]['id']}})[_0x11da('0x2a')](handleEntityNotFound(_0x3dd8c4,null))[_0x11da('0x2a')](function(_0x16be79){if(_0x16be79){return _0x16be79[_0x11da('0xc6')](_0x2c15e0['body'][_0x11da('0xbf')],_[_0x11da('0xbe')](_0x2c15e0[_0x11da('0x73')],[_0x11da('0xbf'),'id'])||{})[_0x11da('0xc7')](function(){return db['Tag'][_0x11da('0xc8')]({'attributes':['id','name',_0x11da('0x4a')],'where':{'id':_0x2c15e0[_0x11da('0x73')]['ids']}});})[_0x11da('0x2a')](function(_0x2d56bd){socket[_0x11da('0xc9')](_0x11da('0xca'),{'id':Number(_0x2c15e0[_0x11da('0xb7')]['id']),'tags':_0x2d56bd||[]});return{'id':Number(_0x2c15e0[_0x11da('0xb7')]['id']),'tags':_0x2d56bd||[]};});}})[_0x11da('0x2a')](respondWithResult(_0x3dd8c4,null))[_0x11da('0x37')](handleError(_0x3dd8c4,null));};exports[_0x11da('0xcb')]=function(_0x447a7b,_0x187c4e,_0x1f0ae6){return db['WhatsappInteraction']['find']({'where':{'id':_0x447a7b['params']['id']}})['then'](handleEntityNotFound(_0x187c4e,null))[_0x11da('0x2a')](function(_0x15196c){if(_0x15196c){return _0x15196c[_0x11da('0xcb')](_0x447a7b[_0x11da('0x3e')][_0x11da('0xbf')]);}})[_0x11da('0x2a')](respondWithStatusCode(_0x187c4e,null))['catch'](handleError(_0x187c4e,null));};exports[_0x11da('0xcc')]=function(_0x358b3e,_0x17e20e){var _0x8badc3=moment()[_0x11da('0xcd')]()[_0x11da('0x9c')]();var _0x1f92ff=path[_0x11da('0xce')](config[_0x11da('0xcf')],_0x11da('0xd0'),'files',_0x11da('0xd1'));var _0x4be924=path['join'](config[_0x11da('0xcf')],'server','files',_0x11da('0xd2'));var _0x1e7316=path['join'](_0x1f92ff,_0x8badc3);var _0x1a5a8a=util[_0x11da('0xc3')](_0x11da('0xd3'),_0x358b3e[_0x11da('0xb7')]['id'],_0x8badc3);var _0x369b51=path['join'](_0x1f92ff,_0x1a5a8a);var _0x1f42a1=[];_0x1f42a1['push']({'model':db[_0x11da('0x6f')],'as':_0x11da('0x6f'),'attributes':['id',_0x11da('0x31')],'raw':!![]});_0x1f42a1['push']({'model':db[_0x11da('0xd4')],'as':_0x11da('0x65'),'attributes':['id',_0x11da('0xd5'),_0x11da('0xd6')],'raw':!![]});if(_0x358b3e[_0x11da('0x3e')][_0x11da('0xd2')]){_0x1f42a1[_0x11da('0x36')]({'model':db[_0x11da('0xd7')],'as':_0x11da('0xd7'),'raw':!![]});}var _0x543238=[{'model':db[_0x11da('0xbd')],'as':'Messages','attributes':['id',_0x11da('0x73'),_0x11da('0xd8'),_0x11da('0xd9'),_0x11da('0xda'),_0x11da('0x7f')],'include':_0x1f42a1}];_0x543238['push']({'model':db[_0x11da('0xdb')],'as':'Account','attributes':['id',_0x11da('0x2d')]});_0x543238['push']({'model':db[_0x11da('0x6f')],'as':_0x11da('0xdc'),'attributes':['id',_0x11da('0x31')]});return db[_0x11da('0x38')][_0x11da('0x71')]({'where':{'id':_0x358b3e[_0x11da('0xb7')]['id']},'include':_0x543238})[_0x11da('0x2a')](handleEntityNotFound(_0x17e20e,null))[_0x11da('0x2a')](function(_0x58f6fd){if(_0x58f6fd){var _0x5b051c=_0x58f6fd[_0x11da('0xdd')]({'plain':!![]});fs[_0x11da('0xde')](_0x1e7316);var _0x3120b1={'channel':'Whatsapp','account':_0x5b051c[_0x11da('0xdf')][_0x11da('0x2d')],'agent':_0x5b051c[_0x11da('0xdc')]?_0x5b051c[_0x11da('0xdc')]['fullname']:_0x11da('0xe0'),'createdAt':moment(_0x5b051c[_0x11da('0xd8')])[_0x11da('0xc3')](_0x11da('0xe1'))[_0x11da('0x9c')](),'closedAt':_0x5b051c[_0x11da('0xe2')]?moment(_0x5b051c['closedAt'])[_0x11da('0xc3')](_0x11da('0xe1'))[_0x11da('0x9c')]():'','disposition':_0x5b051c[_0x11da('0xe3')],'messages':_(_0x5b051c[_0x11da('0xe4')])[_0x11da('0x85')]({'secret':![]})[_0x11da('0x30')](function(_0x1ca322){if(_0x1ca322[_0x11da('0xd7')]){var _0x22e59e=path[_0x11da('0xce')](_0x4be924,_0x1ca322[_0x11da('0xd7')][_0x11da('0xe5')]);if(fs[_0x11da('0xe6')](_0x22e59e)){fs[_0x11da('0xe7')](_0x22e59e)['pipe'](fs[_0x11da('0xe8')](path['join'](_0x1e7316,_0x1ca322[_0x11da('0xd7')][_0x11da('0xe5')])));}}return{'date':moment(_0x1ca322['createdAt'])[_0x11da('0xc3')](_0x11da('0xe1'))['toString'](),'sender':_0x1ca322['direction']===_0x11da('0xe9')?_0x1ca322[_0x11da('0x6f')]?_0x1ca322[_0x11da('0x6f')][_0x11da('0x31')]:'System':_0x1ca322[_0x11da('0x65')][_0x11da('0xd5')]+(_0x1ca322['Contact'][_0x11da('0xd6')]?'\x20'+_0x1ca322[_0x11da('0x65')]['lastName']:''),'body':_0x1ca322[_0x11da('0xd7')]?_0x1ca322['Attachment'][_0x11da('0xe5')]:_0x1ca322['body'],'direction':_0x1ca322[_0x11da('0xd9')]===_0x11da('0xe9')?'A':'C','secret':_0x1ca322[_0x11da('0xda')],'read':_0x1ca322[_0x11da('0x7f')],'attachment':_0x1ca322[_0x11da('0xd7')]};})[_0x11da('0x61')]()};return ejs['renderFile'](path[_0x11da('0xce')](config[_0x11da('0xcf')],_0x11da('0xd0'),'views',_0x11da('0xea')),{'interaction':_0x3120b1})['then'](function(_0x33e9eb){var _0x15fc84=path[_0x11da('0xce')](_0x1e7316,_0x11da('0xeb')+_0x5b051c['id']+'-'+_0x8badc3+_0x11da('0xec'));var _0xa70d66={'path':_0x15fc84,'channel':_0x11da('0xed'),'interactionId':_0x5b051c['id']};return pdf[_0x11da('0xee')](_0x33e9eb,_0xa70d66);})['then'](function(){return new BPromise(function(_0x3a580c,_0x28a120){zipdir(_0x1e7316,{'saveTo':_0x369b51},function(_0x1a0150,_0x57bca5){if(_0x1a0150)return _0x28a120(_0x1a0150);return _0x3a580c(_0x57bca5);});})[_0x11da('0x2a')](function(){return new BPromise(function(_0x53d6a1,_0x3afaf8){rimraf(_0x1e7316,function(_0x54bdc9){if(_0x54bdc9)_0x3afaf8(_0x54bdc9);return _0x53d6a1();});});})[_0x11da('0x2a')](function(){return _0x17e20e[_0x11da('0xcc')](_0x369b51,_0x1a5a8a,function(_0x584bef){if(_0x584bef){console[_0x11da('0xef')](_0x11da('0xf0'),_0x584bef);}else{fs[_0x11da('0xf1')](_0x369b51);}});});});}else{return _0x17e20e[_0x11da('0x2b')](0xc8);}})['catch'](handleError(_0x17e20e,null));};
\ No newline at end of file
+var _0xc7e9=['root','attachments','CmContact','lastName','Attachment','Messages','direction','WhatsappAccount','Account','Whatsapp','Owner','N.A.','closed','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','secret','renderFile','downloadInteraction.ejs','createPdfFromHTML','download','log','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','Users','map','fullname','TagIds','split','Tags','index','WhatsappInteraction','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','select','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','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','text','start','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\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?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','catch','show','params','rawAttributes','include','create','describe','addMessage','ids','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','addTags','setTags','omit','Tag','color','emit','removeTags','join','server','files','tmp'];(function(_0x43561e,_0x30b35a){var _0x54ab11=function(_0x32d988){while(--_0x32d988){_0x43561e['push'](_0x43561e['shift']());}};_0x54ab11(++_0x30b35a);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xc7e9[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x9c7e('0x0'));var rimraf=require(_0x9c7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c7e('0x2'));var rp=require(_0x9c7e('0x3'));var moment=require(_0x9c7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c7e('0x5'));var util=require(_0x9c7e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9c7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c7e('0x8'));var _=require(_0x9c7e('0x9'));var squel=require(_0x9c7e('0xa'));var crypto=require(_0x9c7e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c7e('0xc'));var toCsv=require(_0x9c7e('0x7'));var querystring=require(_0x9c7e('0xd'));var Papa=require(_0x9c7e('0xe'));var Redis=require('ioredis');var authService=require(_0x9c7e('0xf'));var qs=require(_0x9c7e('0x10'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x9c7e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c7e('0x12'))(_0x9c7e('0x13'));var utils=require('../../config/utils');var config=require(_0x9c7e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c7e('0x15'))['db'];config[_0x9c7e('0x16')]=_[_0x9c7e('0x17')](config[_0x9c7e('0x16')],{'host':_0x9c7e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c7e('0x16')]));require(_0x9c7e('0x19'))[_0x9c7e('0x1a')](socket);function respondWithStatusCode(_0x3a65a6,_0x288f3b){_0x288f3b=_0x288f3b||0xcc;return function(_0x1dc25b){if(_0x1dc25b){return _0x3a65a6['sendStatus'](_0x288f3b);}return _0x3a65a6[_0x9c7e('0x1b')](_0x288f3b)[_0x9c7e('0x1c')]();};}function respondWithResult(_0x346951,_0x3fd3c9){_0x3fd3c9=_0x3fd3c9||0xc8;return function(_0x26871f){if(_0x26871f){return _0x346951['status'](_0x3fd3c9)[_0x9c7e('0x1d')](_0x26871f);}};}function respondWithFilteredResult(_0x412b17,_0x5af216){return function(_0x164412){if(_0x164412){var _0x26dd66=typeof _0x5af216[_0x9c7e('0x1e')]===_0x9c7e('0x1f')&&typeof _0x5af216[_0x9c7e('0x20')]==='undefined';var _0xc8ab00=_0x164412['count'];var _0x23599d=_0x26dd66?0x0:_0x5af216['offset'];var _0x52abd4=_0x26dd66?_0x164412[_0x9c7e('0x21')]:_0x5af216[_0x9c7e('0x1e')]+_0x5af216[_0x9c7e('0x20')];var _0x20e992;if(_0x52abd4>=_0xc8ab00){_0x52abd4=_0xc8ab00;_0x20e992=0xc8;}else{_0x20e992=0xce;}_0x412b17[_0x9c7e('0x1b')](_0x20e992);return _0x412b17['set'](_0x9c7e('0x22'),_0x23599d+'-'+_0x52abd4+'/'+_0xc8ab00)[_0x9c7e('0x1d')](_0x164412);}return null;};}function patchUpdates(_0x5fd78f){return function(_0x1d2e6d){try{jsonpatch[_0x9c7e('0x23')](_0x1d2e6d,_0x5fd78f,!![]);}catch(_0x28f031){return BPromise[_0x9c7e('0x24')](_0x28f031);}return _0x1d2e6d[_0x9c7e('0x25')]();};}function saveUpdates(_0x3567d8,_0x295ddd){return function(_0x1d1a75){if(_0x1d1a75){return _0x1d1a75[_0x9c7e('0x26')](_0x3567d8)['then'](function(_0x9780f8){return _0x9780f8;});}return null;};}function removeEntity(_0x2eaebb,_0x40ad31){return function(_0x467918){if(_0x467918){return _0x467918[_0x9c7e('0x27')]()[_0x9c7e('0x28')](function(){_0x2eaebb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8736,_0x46cfe0){return function(_0x443912){if(!_0x443912){_0x1c8736[_0x9c7e('0x29')](0x194);}return _0x443912;};}function handleError(_0x412a25,_0x33d696){_0x33d696=_0x33d696||0x1f4;return function(_0x324691){logger[_0x9c7e('0x2a')](_0x324691['stack']);if(_0x324691[_0x9c7e('0x2b')]){delete _0x324691['name'];}_0x412a25[_0x9c7e('0x1b')](_0x33d696)['send'](_0x324691);};}function getInteractionUsers(_0x5a33d7,_0x1114d2){return new BPromise(function(_0x2b5084,_0x1ca8bc){try{if(_0x1114d2[_0x5a33d7['id']]){_0x5a33d7[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x1114d2[_0x5a33d7['id']],function(_0x1cf15e){return{'id':_0x1cf15e['id'],'fullname':_0x1cf15e[_0x9c7e('0x2e')]};});}}catch(_0x397824){_0x1ca8bc(_0x397824);}_0x2b5084(_0x5a33d7);});}function getInteractionTags(_0x2bbfe8,_0x3537b4){return new BPromise(function(_0x427015,_0x16fcfc){try{if(_0x2bbfe8[_0x9c7e('0x2f')]){_0x2bbfe8['Tags']=[];_0x2bbfe8[_0x9c7e('0x2f')][_0x9c7e('0x30')](',')['forEach'](function(_0x437aee){_0x2bbfe8[_0x9c7e('0x31')]['push'](_0x3537b4[_0x437aee]);});}delete _0x2bbfe8[_0x9c7e('0x2f')];}catch(_0x194691){_0x16fcfc(_0x194691);}_0x427015(_0x2bbfe8);});}function updateWhatsappInteraction(_0xf5d14f,_0x4a99c1,_0x1d8673){return new BPromise(function(_0x7b9649,_0x199de1){return getInteractionUsers(_0xf5d14f,_0x1d8673)[_0x9c7e('0x28')](function(_0x431073){return getInteractionTags(_0x431073,_0x4a99c1);})[_0x9c7e('0x28')](function(_0x4244bd){_0x7b9649(_0x4244bd);})['catch'](function(_0x22c532){_0x199de1(_0x22c532);});});}exports[_0x9c7e('0x32')]=function(_0x576876,_0x356cc5){var _0x4eb1d1={},_0x207856={},_0x2c02e8={'count':0x0,'rows':[]};var _0x3a52e9=_[_0x9c7e('0x2d')](db[_0x9c7e('0x33')]['rawAttributes'],function(_0x5730e1){return{'name':_0x5730e1[_0x9c7e('0x34')],'type':_0x5730e1[_0x9c7e('0x35')][_0x9c7e('0x36')]};});_0x207856[_0x9c7e('0x37')]=_[_0x9c7e('0x2d')](_0x3a52e9,'name');_0x207856['query']=_[_0x9c7e('0x38')](_0x576876[_0x9c7e('0x39')]);_0x207856[_0x9c7e('0x3a')]=_[_0x9c7e('0x3b')](_0x207856[_0x9c7e('0x37')],_0x207856[_0x9c7e('0x39')]);_0x4eb1d1[_0x9c7e('0x3c')]=_['intersection'](_0x207856['model'],qs[_0x9c7e('0x3d')](_0x576876['query'][_0x9c7e('0x3d')]));_0x4eb1d1[_0x9c7e('0x3c')]=_0x4eb1d1[_0x9c7e('0x3c')][_0x9c7e('0x3e')]?_0x4eb1d1['attributes']:_0x207856[_0x9c7e('0x37')];if(!_0x576876[_0x9c7e('0x39')][_0x9c7e('0x3f')](_0x9c7e('0x40'))){_0x4eb1d1[_0x9c7e('0x20')]=qs[_0x9c7e('0x20')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x20')]);_0x4eb1d1['offset']=qs[_0x9c7e('0x1e')](_0x576876['query'][_0x9c7e('0x1e')]);}_0x4eb1d1[_0x9c7e('0x41')]=qs[_0x9c7e('0x42')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x42')]);_0x4eb1d1[_0x9c7e('0x43')]=qs[_0x9c7e('0x3a')](_[_0x9c7e('0x44')](_0x576876['query'],_0x207856[_0x9c7e('0x3a')]),_0x3a52e9);var _0x58296f=[];var _0x518973=squel['select']()[_0x9c7e('0x45')]('id')['field'](_0x9c7e('0x2b'))[_0x9c7e('0x45')]('color')[_0x9c7e('0x46')](_0x9c7e('0x47'));var _0x548bea=squel['select']()[_0x9c7e('0x45')](_0x9c7e('0x48'))[_0x9c7e('0x45')](_0x9c7e('0x49'))[_0x9c7e('0x45')](_0x9c7e('0x4a'))[_0x9c7e('0x46')](_0x9c7e('0x4b'),'ui')[_0x9c7e('0x4c')](_0x9c7e('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x18d941=squel[_0x9c7e('0x4e')]()[_0x9c7e('0x46')](_0x9c7e('0x4f'),'i')[_0x9c7e('0x4c')](_0x9c7e('0x50'),'c',_0x9c7e('0x51'))['left_join'](_0x9c7e('0x4d'),'o',_0x9c7e('0x52'))[_0x9c7e('0x4c')]('whatsapp_accounts','a',_0x9c7e('0x53'))[_0x9c7e('0x4c')](_0x9c7e('0x54'),'me',_0x9c7e('0x55'))['left_join'](_0x9c7e('0x56'),'it',_0x9c7e('0x57'))[_0x9c7e('0x4c')](_0x9c7e('0x47'),'t',_0x9c7e('0x58'));var _0x5b6cb7=squel['expr']();var _0x4e75a0=[];var _0x2e76e8=squel[_0x9c7e('0x59')]();var _0x44ad2f;if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x5a')]){_0x44ad2f=as[_0x9c7e('0x5b')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x5a')]);var _0x44240d=_0x44ad2f[_0x9c7e('0x5c')];for(var _0x200898=0x0;_0x200898<_0x44ad2f[_0x9c7e('0x5d')][_0x9c7e('0x3e')];_0x200898++){var _0x288b56=_0x44ad2f[_0x9c7e('0x5d')][_0x200898];var _0x51b482='i';var _0x1b56dc=_[_0x9c7e('0x5e')](_0x3a52e9,[_0x9c7e('0x2b'),_0x288b56[_0x9c7e('0x45')]]);if(!_0x1b56dc){switch(_0x288b56[_0x9c7e('0x45')]){case _0x9c7e('0x5f'):if(_0x288b56[_0x9c7e('0x60')]==0x1){_0x18d941[_0x9c7e('0x61')]('`'+_0x288b56[_0x9c7e('0x45')]+'`\x20=\x200');}else{_0x18d941[_0x9c7e('0x61')]('`'+_0x288b56[_0x9c7e('0x45')]+_0x9c7e('0x62'));}break;case _0x9c7e('0x63'):if(_0x288b56[_0x9c7e('0x64')]===_0x9c7e('0x65')){if(_0x288b56[_0x9c7e('0x60')][_0x9c7e('0x30')]('\x20')[_0x9c7e('0x3e')]>0x1){_0x5b6cb7[_0x44240d](_0x9c7e('0x66'),qs[_0x9c7e('0x67')](_0x288b56[_0x9c7e('0x60')]),null);}else{var _0x4692c2='%'+_0x288b56[_0x9c7e('0x60')]+'%';_0x5b6cb7[_0x44240d](_0x9c7e('0x68'),_0x4692c2,_0x4692c2,_0x4692c2);}}else{_0x1b56dc=_['find'](_0x3a52e9,[_0x9c7e('0x2b'),'ContactId']);_0x288b56['field']=_0x9c7e('0x69');_0x15d9c2=as['buildExpression'](_0x51b482,_0x1b56dc[_0x9c7e('0x35')],_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2[_0x9c7e('0x6a')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x6b')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x1c')]);}break;case'Tag':var _0x4f1485=_0x288b56['value']['split'](',')[_0x9c7e('0x2d')](function(_0x2c7aff){return Number(_0x2c7aff);});_0x4f1485[_0x9c7e('0x6c')](function(_0x2c3880){_0x2e76e8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c3880+',%');});_0x4e75a0=_[_0x9c7e('0x6d')](_0x4e75a0,_0x4f1485);break;case _0x9c7e('0x6e'):if(_0x288b56[_0x9c7e('0x64')]===_0x9c7e('0x65')){_0x5b6cb7[_0x44240d](_0x9c7e('0x6f'),'%'+_0x288b56[_0x9c7e('0x60')]+'%',null);}else{_0x1b56dc=_[_0x9c7e('0x5e')](_0x3a52e9,[_0x9c7e('0x2b'),_0x9c7e('0x70')]);_0x288b56[_0x9c7e('0x45')]=_0x9c7e('0x70');_0x15d9c2=as['buildExpression'](_0x51b482,_0x1b56dc[_0x9c7e('0x35')],_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2[_0x9c7e('0x6a')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x6b')],_0x15d9c2[_0x9c7e('0x60')]['end']);}break;case _0x9c7e('0x71'):_0x15d9c2=as[_0x9c7e('0x72')]('me',null,_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2[_0x9c7e('0x6a')],_0x15d9c2[_0x9c7e('0x60')]['start'],_0x15d9c2['value'][_0x9c7e('0x1c')]);break;}}else{var _0x15d9c2=as[_0x9c7e('0x72')](_0x51b482,_0x1b56dc['type'],_0x288b56);_0x5b6cb7[_0x44240d](_0x15d9c2['text'],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x6b')],_0x15d9c2[_0x9c7e('0x60')][_0x9c7e('0x1c')]);}}}else{var _0x3732ca=_(_0x576876[_0x9c7e('0x39')])[_0x9c7e('0x38')]()[_0x9c7e('0x2d')](function(_0x485d86){return _[_0x9c7e('0x73')](_0x3a52e9,[_0x9c7e('0x2b'),_0x485d86])?_0x485d86:undefined;})[_0x9c7e('0x74')]()[_0x9c7e('0x60')]();if(!_[_0x9c7e('0x75')](_0x3732ca)){_0x3732ca[_0x9c7e('0x6c')](function(_0x4e5797){if(_0x4e5797===_0x9c7e('0x76')){_0x18d941[_0x9c7e('0x43')](_0x9c7e('0x77'),[][_0x9c7e('0x78')](_0x576876[_0x9c7e('0x39')][_0x4e5797]));}else if(_0x4e5797===_0x9c7e('0x79')){var _0x46bce6=JSON[_0x9c7e('0x7a')](_0x576876[_0x9c7e('0x39')][_0x4e5797])[_0x9c7e('0x7b')];var _0x4600d2=JSON['parse'](_0x576876[_0x9c7e('0x39')][_0x4e5797])[_0x9c7e('0x7c')];_0x18d941['where'](_0x9c7e('0x7d'),_0x46bce6,_0x4600d2);}else{if(_0x576876[_0x9c7e('0x39')][_0x4e5797]==='null'){_0x18d941[_0x9c7e('0x43')]('i.'+_0x4e5797+'\x20IS\x20NULL');}else{_0x18d941[_0x9c7e('0x43')]('i.'+_0x4e5797+_0x9c7e('0x7e'),_0x576876[_0x9c7e('0x39')][_0x4e5797]);}}});}if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x7f')]){if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x7f')]==0x1){_0x18d941[_0x9c7e('0x61')](_0x9c7e('0x80'));}else{_0x18d941[_0x9c7e('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x81')]){_0x4e75a0=_[_0x9c7e('0x82')](_0x576876[_0x9c7e('0x39')][_0x9c7e('0x81')])?_0x576876[_0x9c7e('0x39')]['tag']:new Array(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x81')]);_0x4e75a0[_0x9c7e('0x6c')](function(_0x7454e){_0x2e76e8['or'](_0x9c7e('0x83'),'%,'+_0x7454e+',%');});}if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x84')]){var _0x57cd1b=_0x576876['query'][_0x9c7e('0x84')][_0x9c7e('0x85')]('\x5c','\x5c\x5c')[_0x9c7e('0x85')](/'/g,'\x27\x27');if(qs[_0x9c7e('0x86')](_0x57cd1b)){_0x5b6cb7['or'](_0x9c7e('0x87'),_0x57cd1b+'%')['or']('i.phone\x20LIKE\x20?',_0x57cd1b+'%');}else{_0x5b6cb7['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9c7e('0x67')](_0x57cd1b))['or'](_0x9c7e('0x88'),_0x57cd1b+'%');}}}_0x18d941[_0x9c7e('0x43')](_0x5b6cb7);_0x18d941[_0x9c7e('0x89')](_0x9c7e('0x8a'));var _0x1b76d0={'type':db[_0x9c7e('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x3228ae=_0x18d941[_0x9c7e('0x8c')]();_0x3228ae[_0x9c7e('0x45')](_0x9c7e('0x8a'));_0x3228ae[_0x9c7e('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9c7e('0x5f'));if(_0x4eb1d1[_0x9c7e('0x41')]){_0x4eb1d1[_0x9c7e('0x41')][_0x9c7e('0x6c')](function(_0x4d0d3a){var _0xf2b131=_0x4d0d3a[0x0]===_0x9c7e('0x8d')?_0x4d0d3a[0x0]:'i.'+_0x4d0d3a[0x0];_0x18d941['order'](_0xf2b131,_0x4d0d3a[0x1]===_0x9c7e('0x8e')?![]:!![]);});}if(!_[_0x9c7e('0x75')](_0x4e75a0)){_0x18d941[_0x9c7e('0x61')](_0x2e76e8);_0x3228ae['where'](_0x9c7e('0x8f'),_0x4e75a0);}BPromise[_0x9c7e('0x90')]()[_0x9c7e('0x28')](function(){if(!_0x44ad2f){if(_0x576876[_0x9c7e('0x39')]['WhatsappAccountId'])return;_0x3228ae[_0x9c7e('0x43')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x18d941[_0x9c7e('0x43')](_0x9c7e('0x91'));return;}if(_0x576876['user'][_0x9c7e('0x92')]!==_0x9c7e('0x93'))return;return _0x576876[_0x9c7e('0x94')][_0x9c7e('0x95')]({'attributes':['id'],'raw':!![]})[_0x9c7e('0x28')](function(_0x5e686a){if(_['isEmpty'](_0x5e686a)){_0x3228ae['where'](_0x9c7e('0x96'));_0x18d941[_0x9c7e('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3228ae['where'](_0x9c7e('0x77'),_[_0x9c7e('0x2d')](_0x5e686a,'id'));_0x18d941[_0x9c7e('0x43')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x5e686a,'id'));}});})[_0x9c7e('0x28')](function(){if(_0x576876[_0x9c7e('0x94')][_0x9c7e('0x92')]===_0x9c7e('0x93')&&!_0x44ad2f&&!_0x576876[_0x9c7e('0x39')]['WhatsappAccountId'])return[];return db[_0x9c7e('0x97')][_0x9c7e('0x39')](_0x3228ae[_0x9c7e('0x98')](),_0x1b76d0);})[_0x9c7e('0x28')](function(_0x3cdffd){_0x2c02e8['count']=_0x3cdffd[_0x9c7e('0x3e')];if(_0x2c02e8[_0x9c7e('0x21')]===0x0)return[];return db['sequelize']['query'](_0x518973['toString'](),_0x1b76d0)[_0x9c7e('0x28')](function(_0x466c05){_0x58296f=_[_0x9c7e('0x99')](_0x466c05,'id');_0x1b76d0=_[_0x9c7e('0x9a')](_0x1b76d0,{'model':db[_0x9c7e('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x576876[_0x9c7e('0x39')][_0x9c7e('0x3d')]){_0x4eb1d1[_0x9c7e('0x3c')][_0x9c7e('0x6c')](function(_0x97a5cb){_0x18d941[_0x9c7e('0x45')]('i.'+_0x97a5cb);});}else{_0x18d941[_0x9c7e('0x45')](_0x9c7e('0x9b'),'unreadMessages');_0x18d941[_0x9c7e('0x45')](_0x9c7e('0x9c'),_0x9c7e('0x9d'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0x9e'),_0x9c7e('0x9f'));_0x18d941[_0x9c7e('0x45')]('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',_0x9c7e('0x8d'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa0'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa1'),_0x9c7e('0xa2'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa3'),_0x9c7e('0xa4'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa5'),_0x9c7e('0xa6'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa7'),_0x9c7e('0xa8'));_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xa9'),'Contact.mobile');_0x18d941[_0x9c7e('0x45')](_0x9c7e('0xaa'),_0x9c7e('0xab'));_0x18d941[_0x9c7e('0x45')]('o.fullname',_0x9c7e('0xac'));_0x18d941['field'](_0x9c7e('0xad'),_0x9c7e('0xae'));_0x18d941['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9c7e('0x2f'));}if(_0x4eb1d1['limit'])_0x18d941[_0x9c7e('0x20')](_0x4eb1d1[_0x9c7e('0x20')]);if(_0x4eb1d1[_0x9c7e('0x1e')])_0x18d941[_0x9c7e('0x1e')](_0x4eb1d1[_0x9c7e('0x1e')]);return db['sequelize'][_0x9c7e('0x39')](_0x18d941[_0x9c7e('0x98')](),_0x1b76d0);})[_0x9c7e('0x28')](function(_0x166115){if(_0x166115[_0x9c7e('0x3e')]>0x0)_0x548bea[_0x9c7e('0x43')](_0x9c7e('0xaf'),_['map'](_0x166115,'id'));return db[_0x9c7e('0x97')]['query'](_0x548bea[_0x9c7e('0x98')](),_0x1b76d0)['then'](function(_0x319d77){var _0x19a8e9=_[_0x9c7e('0xb0')](_0x319d77,_0x9c7e('0xb1'));var _0x536f5b=[];_0x166115[_0x9c7e('0x6c')](function(_0x3cbfc0){_0x536f5b[_0x9c7e('0xb2')](updateWhatsappInteraction(_0x3cbfc0,_0x58296f,_0x19a8e9));});return BPromise[_0x9c7e('0xb3')](_0x536f5b);});});})['then'](function(_0x1cf300){_0x2c02e8[_0x9c7e('0xb4')]=_0x1cf300;return _0x2c02e8;})[_0x9c7e('0x28')](respondWithFilteredResult(_0x356cc5,_0x4eb1d1))[_0x9c7e('0xb5')](handleError(_0x356cc5,null));};exports[_0x9c7e('0xb6')]=function(_0x37171d,_0x53bebd){var _0x4f0a20={'raw':![],'where':{'id':_0x37171d[_0x9c7e('0xb7')]['id']}},_0x2e8909={};_0x2e8909['model']=_[_0x9c7e('0x38')](db[_0x9c7e('0x33')][_0x9c7e('0xb8')]);_0x2e8909[_0x9c7e('0x39')]=_['keys'](_0x37171d['query']);_0x2e8909[_0x9c7e('0x3a')]=_[_0x9c7e('0x3b')](_0x2e8909['model'],_0x2e8909[_0x9c7e('0x39')]);_0x4f0a20[_0x9c7e('0x3c')]=_[_0x9c7e('0x3b')](_0x2e8909[_0x9c7e('0x37')],qs['fields'](_0x37171d[_0x9c7e('0x39')][_0x9c7e('0x3d')]));_0x4f0a20[_0x9c7e('0x3c')]=_0x4f0a20[_0x9c7e('0x3c')][_0x9c7e('0x3e')]?_0x4f0a20[_0x9c7e('0x3c')]:_0x2e8909[_0x9c7e('0x37')];if(_0x37171d[_0x9c7e('0x39')]['includeAll']){_0x4f0a20[_0x9c7e('0xb9')]=[{'all':!![]}];}_0x4f0a20=_[_0x9c7e('0x9a')]({},_0x4f0a20,_0x37171d['options']);return db[_0x9c7e('0x33')][_0x9c7e('0x5e')](_0x4f0a20)['then'](handleEntityNotFound(_0x53bebd,null))['then'](respondWithResult(_0x53bebd,null))['catch'](handleError(_0x53bebd,null));};exports[_0x9c7e('0xba')]=function(_0xaad3fc,_0x3bbaa7){return db['WhatsappInteraction'][_0x9c7e('0xba')](_0xaad3fc[_0x9c7e('0x71')],{})[_0x9c7e('0x28')](respondWithResult(_0x3bbaa7,0xc9))[_0x9c7e('0xb5')](handleError(_0x3bbaa7,null));};exports[_0x9c7e('0x26')]=function(_0x70703c,_0x4e336b){if(_0x70703c[_0x9c7e('0x71')]['id']){delete _0x70703c[_0x9c7e('0x71')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x70703c[_0x9c7e('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4e336b,null))[_0x9c7e('0x28')](saveUpdates(_0x70703c[_0x9c7e('0x71')],null))[_0x9c7e('0x28')](respondWithResult(_0x4e336b,null))[_0x9c7e('0xb5')](handleError(_0x4e336b,null));};exports[_0x9c7e('0x27')]=function(_0x4fa44b,_0x2fe320){return db[_0x9c7e('0x33')]['find']({'where':{'id':_0x4fa44b[_0x9c7e('0xb7')]['id']}})[_0x9c7e('0x28')](handleEntityNotFound(_0x2fe320,null))['then'](removeEntity(_0x2fe320,null))[_0x9c7e('0xb5')](handleError(_0x2fe320,null));};exports[_0x9c7e('0xbb')]=function(_0x305f0c,_0x2308e4){return db['WhatsappInteraction'][_0x9c7e('0xbb')]()[_0x9c7e('0x28')](respondWithResult(_0x2308e4,null))['catch'](handleError(_0x2308e4,null));};exports[_0x9c7e('0xbc')]=function(_0x111e62,_0x4f6ed1,_0x2309ab){return db['WhatsappMessage'][_0x9c7e('0x5e')]({'where':{'id':_0x111e62[_0x9c7e('0xb7')]['id']}})['then'](handleEntityNotFound(_0x4f6ed1,null))['then'](function(_0x37fb2f){if(_0x37fb2f){return _0x37fb2f[_0x9c7e('0xbc')](_0x111e62['body'][_0x9c7e('0xbd')],_['omit'](_0x111e62['body'],[_0x9c7e('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x4f6ed1,null))['catch'](handleError(_0x4f6ed1,null));};exports['getMessages']=function(_0x4afd2f,_0xef0c6c,_0x1c0a37){var _0x49b68b={'raw':![],'where':{}};var _0x36f7e2={};var _0x31f0d0={'count':0x0,'rows':[]};return db[_0x9c7e('0x33')][_0x9c7e('0xbe')]({'where':{'id':_0x4afd2f[_0x9c7e('0xb7')]['id']}})['then'](handleEntityNotFound(_0xef0c6c,null))[_0x9c7e('0x28')](function(_0x12035e){if(_0x12035e){_0x36f7e2[_0x9c7e('0x37')]=_[_0x9c7e('0x38')](db[_0x9c7e('0xbf')][_0x9c7e('0xb8')]);_0x36f7e2[_0x9c7e('0x39')]=_['keys'](_0x4afd2f['query']);_0x36f7e2[_0x9c7e('0x3a')]=_['intersection'](_0x36f7e2[_0x9c7e('0x37')],_0x36f7e2['query']);_0x49b68b['attributes']=_[_0x9c7e('0x3b')](_0x36f7e2['model'],qs[_0x9c7e('0x3d')](_0x4afd2f['query'][_0x9c7e('0x3d')]));_0x49b68b[_0x9c7e('0x3c')]=_0x49b68b[_0x9c7e('0x3c')][_0x9c7e('0x3e')]?_0x49b68b[_0x9c7e('0x3c')]:_0x36f7e2[_0x9c7e('0x37')];if(!_0x4afd2f['query']['hasOwnProperty'](_0x9c7e('0x40'))){_0x49b68b[_0x9c7e('0x20')]=qs['limit'](_0x4afd2f[_0x9c7e('0x39')]['limit']);_0x49b68b[_0x9c7e('0x1e')]=qs['offset'](_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0x1e')]);}_0x49b68b[_0x9c7e('0x41')]=qs['sort'](_0x4afd2f[_0x9c7e('0x39')]['sort']);_0x49b68b[_0x9c7e('0x43')]=qs[_0x9c7e('0x3a')](_[_0x9c7e('0x44')](_0x4afd2f['query'],_0x36f7e2[_0x9c7e('0x3a')]));_0x49b68b[_0x9c7e('0x43')][_0x9c7e('0xb1')]=_0x12035e['id'];if(_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0x84')]){_0x49b68b[_0x9c7e('0x43')]=_[_0x9c7e('0x9a')](_0x49b68b[_0x9c7e('0x43')],{'$or':_[_0x9c7e('0x2d')](_0x49b68b[_0x9c7e('0x3c')],function(_0x158fbf){var _0x3c787f={};_0x3c787f[_0x158fbf]={'$like':'%'+_0x4afd2f['query'][_0x9c7e('0x84')]+'%'};return _0x3c787f;})});}if(_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0x7b')]){var _0x5d0818=_0x4afd2f['query'][_0x9c7e('0x7b')]['split'](',');var _0x546d3b={};_0x546d3b[_0x5d0818[0x0]]={'$gte':moment(_0x5d0818[0x1])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))};_0x49b68b[_0x9c7e('0x43')]=_[_0x9c7e('0x9a')](_0x49b68b['where'],_0x546d3b);}_0x49b68b=_[_0x9c7e('0x9a')]({},_0x49b68b,_0x4afd2f[_0x9c7e('0xc2')]);return db[_0x9c7e('0xbf')][_0x9c7e('0x21')]({'where':_0x49b68b['where']})[_0x9c7e('0x28')](function(_0x30f6c1){_0x31f0d0['count']=_0x30f6c1;if(_0x4afd2f[_0x9c7e('0x39')][_0x9c7e('0xc3')]){_0x49b68b[_0x9c7e('0xb9')]=[{'all':!![]}];}return db[_0x9c7e('0xbf')]['findAll'](_0x49b68b);})[_0x9c7e('0x28')](function(_0x459a4e){_0x31f0d0[_0x9c7e('0xb4')]=_0x459a4e;return _0x31f0d0;});}})[_0x9c7e('0x28')](respondWithFilteredResult(_0xef0c6c,_0x49b68b))[_0x9c7e('0xb5')](handleError(_0xef0c6c,null));};exports[_0x9c7e('0xc4')]=function(_0xd79000,_0x2feb24,_0x264222){return db[_0x9c7e('0x33')][_0x9c7e('0x5e')]({'where':{'id':_0xd79000[_0x9c7e('0xb7')]['id']}})[_0x9c7e('0x28')](handleEntityNotFound(_0x2feb24,null))[_0x9c7e('0x28')](function(_0x2636e2){if(_0x2636e2){return _0x2636e2[_0x9c7e('0xc5')](_0xd79000[_0x9c7e('0x71')][_0x9c7e('0xbd')],_[_0x9c7e('0xc6')](_0xd79000[_0x9c7e('0x71')],['ids','id'])||{})['spread'](function(){return db[_0x9c7e('0xc7')]['findAll']({'attributes':['id',_0x9c7e('0x2b'),_0x9c7e('0xc8')],'where':{'id':_0xd79000['body'][_0x9c7e('0xbd')]}});})[_0x9c7e('0x28')](function(_0x330c91){socket[_0x9c7e('0xc9')]('whatsappInteractionTags:save',{'id':Number(_0xd79000['params']['id']),'tags':_0x330c91||[]});return{'id':Number(_0xd79000[_0x9c7e('0xb7')]['id']),'tags':_0x330c91||[]};});}})[_0x9c7e('0x28')](respondWithResult(_0x2feb24,null))[_0x9c7e('0xb5')](handleError(_0x2feb24,null));};exports[_0x9c7e('0xca')]=function(_0x27c167,_0xb44d48,_0x2cc4b7){return db[_0x9c7e('0x33')][_0x9c7e('0x5e')]({'where':{'id':_0x27c167['params']['id']}})[_0x9c7e('0x28')](handleEntityNotFound(_0xb44d48,null))[_0x9c7e('0x28')](function(_0x19f2d7){if(_0x19f2d7){return _0x19f2d7[_0x9c7e('0xca')](_0x27c167[_0x9c7e('0x39')][_0x9c7e('0xbd')]);}})[_0x9c7e('0x28')](respondWithStatusCode(_0xb44d48,null))['catch'](handleError(_0xb44d48,null));};exports['download']=function(_0x20ff86,_0x59ddfd){var _0x4617ff=moment()['unix']()['toString']();var _0x4b1e53=path[_0x9c7e('0xcb')](config['root'],_0x9c7e('0xcc'),_0x9c7e('0xcd'),_0x9c7e('0xce'));var _0x237ebe=path[_0x9c7e('0xcb')](config[_0x9c7e('0xcf')],_0x9c7e('0xcc'),_0x9c7e('0xcd'),_0x9c7e('0xd0'));var _0x4b2878=path[_0x9c7e('0xcb')](_0x4b1e53,_0x4617ff);var _0xef15f5=util[_0x9c7e('0xc0')]('transcript-%d-%s.zip',_0x20ff86[_0x9c7e('0xb7')]['id'],_0x4617ff);var _0x3e49e6=path['join'](_0x4b1e53,_0xef15f5);var _0x5ea826=[];_0x5ea826[_0x9c7e('0xb2')]({'model':db[_0x9c7e('0x6e')],'as':_0x9c7e('0x6e'),'attributes':['id',_0x9c7e('0x2e')],'raw':!![]});_0x5ea826['push']({'model':db[_0x9c7e('0xd1')],'as':_0x9c7e('0x63'),'attributes':['id','firstName',_0x9c7e('0xd2')],'raw':!![]});if(_0x20ff86['query']['attachments']){_0x5ea826[_0x9c7e('0xb2')]({'model':db[_0x9c7e('0xd3')],'as':_0x9c7e('0xd3'),'raw':!![]});}var _0x374f02=[{'model':db[_0x9c7e('0xbf')],'as':_0x9c7e('0xd4'),'attributes':['id',_0x9c7e('0x71'),_0x9c7e('0x79'),_0x9c7e('0xd5'),'secret',_0x9c7e('0x7f')],'include':_0x5ea826}];_0x374f02[_0x9c7e('0xb2')]({'model':db[_0x9c7e('0xd6')],'as':_0x9c7e('0xd7'),'attributes':['id','name']});_0x374f02['push']({'model':db[_0x9c7e('0x6e')],'as':'Owner','attributes':['id',_0x9c7e('0x2e')]});return db['WhatsappInteraction'][_0x9c7e('0x5e')]({'where':{'id':_0x20ff86['params']['id']},'include':_0x374f02})['then'](handleEntityNotFound(_0x59ddfd,null))[_0x9c7e('0x28')](function(_0x5da1b4){if(_0x5da1b4){var _0x4235c0=_0x5da1b4['get']({'plain':!![]});fs['mkdirSync'](_0x4b2878);var _0x127032={'channel':_0x9c7e('0xd8'),'account':_0x4235c0[_0x9c7e('0xd7')][_0x9c7e('0x2b')],'agent':_0x4235c0[_0x9c7e('0xd9')]?_0x4235c0[_0x9c7e('0xd9')][_0x9c7e('0x2e')]:_0x9c7e('0xda'),'createdAt':moment(_0x4235c0[_0x9c7e('0x79')])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))[_0x9c7e('0x98')](),'closedAt':_0x4235c0[_0x9c7e('0xdb')]?moment(_0x4235c0['closedAt'])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))['toString']():'','disposition':_0x4235c0[_0x9c7e('0xdc')],'messages':_(_0x4235c0[_0x9c7e('0xd4')])['filter']({'secret':![]})['map'](function(_0x51c0a4){if(_0x51c0a4[_0x9c7e('0xd3')]){var _0x3ceab0=path[_0x9c7e('0xcb')](_0x237ebe,_0x51c0a4[_0x9c7e('0xd3')][_0x9c7e('0xdd')]);if(fs[_0x9c7e('0xde')](_0x3ceab0)){fs[_0x9c7e('0xdf')](_0x3ceab0)[_0x9c7e('0xe0')](fs[_0x9c7e('0xe1')](path['join'](_0x4b2878,_0x51c0a4[_0x9c7e('0xd3')]['basename'])));}}return{'date':moment(_0x51c0a4[_0x9c7e('0x79')])[_0x9c7e('0xc0')](_0x9c7e('0xc1'))[_0x9c7e('0x98')](),'sender':_0x51c0a4[_0x9c7e('0xd5')]===_0x9c7e('0xe2')?_0x51c0a4[_0x9c7e('0x6e')]?_0x51c0a4[_0x9c7e('0x6e')][_0x9c7e('0x2e')]:_0x9c7e('0xe3'):_0x51c0a4[_0x9c7e('0x63')]['firstName']+(_0x51c0a4[_0x9c7e('0x63')][_0x9c7e('0xd2')]?'\x20'+_0x51c0a4[_0x9c7e('0x63')]['lastName']:''),'body':_0x51c0a4[_0x9c7e('0xd3')]?_0x51c0a4[_0x9c7e('0xd3')]['basename']:_0x51c0a4[_0x9c7e('0x71')],'direction':_0x51c0a4[_0x9c7e('0xd5')]===_0x9c7e('0xe2')?'A':'C','secret':_0x51c0a4[_0x9c7e('0xe4')],'read':_0x51c0a4[_0x9c7e('0x7f')],'attachment':_0x51c0a4[_0x9c7e('0xd3')]};})[_0x9c7e('0x60')]()};return ejs[_0x9c7e('0xe5')](path['join'](config[_0x9c7e('0xcf')],_0x9c7e('0xcc'),'views',_0x9c7e('0xe6')),{'interaction':_0x127032})[_0x9c7e('0x28')](function(_0x1951f6){var _0x8c91d4=path[_0x9c7e('0xcb')](_0x4b2878,'transcript-'+_0x4235c0['id']+'-'+_0x4617ff+'.pdf');var _0x377cb1={'path':_0x8c91d4,'channel':'Whatsapp','interactionId':_0x4235c0['id']};return pdf[_0x9c7e('0xe7')](_0x1951f6,_0x377cb1);})[_0x9c7e('0x28')](function(){return new BPromise(function(_0x437476,_0x56c0f3){zipdir(_0x4b2878,{'saveTo':_0x3e49e6},function(_0x11a476,_0x43a546){if(_0x11a476)return _0x56c0f3(_0x11a476);return _0x437476(_0x43a546);});})[_0x9c7e('0x28')](function(){return new BPromise(function(_0x5778a6,_0x473c6d){rimraf(_0x4b2878,function(_0x16a730){if(_0x16a730)_0x473c6d(_0x16a730);return _0x5778a6();});});})[_0x9c7e('0x28')](function(){return _0x59ddfd[_0x9c7e('0xe8')](_0x3e49e6,_0xef15f5,function(_0x8fe071){if(_0x8fe071){console[_0x9c7e('0xe9')]('err',_0x8fe071);}else{fs['unlinkSync'](_0x3e49e6);}});});});}else{return _0x59ddfd[_0x9c7e('0x29')](0xc8);}})[_0x9c7e('0xb5')](handleError(_0x59ddfd,null));};
\ No newline at end of file
index 5da0b94..4763e69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x325b=['remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners'];(function(_0x3c9093,_0x480cda){var _0x1007ef=function(_0x5b0ce1){while(--_0x5b0ce1){_0x3c9093['push'](_0x3c9093['shift']());}};_0x1007ef(++_0x480cda);}(_0x325b,0x8b));var _0xb325=function(_0x4845eb,_0x52a593){_0x4845eb=_0x4845eb-0x0;var _0x2fa930=_0x325b[_0x4845eb];return _0x2fa930;};'use strict';var EventEmitter=require(_0xb325('0x0'));var WhatsappInteraction=require(_0xb325('0x1'))['db'][_0xb325('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xb325('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb325('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb325('0x5')};function emitEvent(_0xca6c44){return function(_0x33f59a,_0x4947d6,_0x4a1ea8){_0x33f59a[_0xb325('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22569c){_0x33f59a[_0xb325('0x7')](_0xb325('0x8'),_0x22569c[_0xb325('0x9')](function(_0x8d97d5){return{'id':_0x8d97d5['id']};}));return WhatsappMessage[_0xb325('0xa')]({'where':{'WhatsappInteractionId':_0x33f59a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb325('0xb')](function(_0x237201){_0x33f59a[_0xb325('0x7')](_0xb325('0xc'),_0x237201[_0xb325('0xd')]);WhatsappInteractionEvents[_0xb325('0xe')](_0xca6c44+':'+_0x33f59a['id'],_0x33f59a);WhatsappInteractionEvents[_0xb325('0xe')](_0xca6c44,_0x33f59a);_0x4a1ea8(null);})[_0xb325('0xf')](_0x4a1ea8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xb325('0x10')](e,emitEvent(event));}}module[_0xb325('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x3f19=['emit','catch','hasOwnProperty','hook','exports','events','WhatsappMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length'];(function(_0x421a2e,_0x450fc4){var _0x204e61=function(_0x1f6334){while(--_0x1f6334){_0x421a2e['push'](_0x421a2e['shift']());}};_0x204e61(++_0x450fc4);}(_0x3f19,0xc0));var _0x93f1=function(_0x4bf27a,_0x435cc2){_0x4bf27a=_0x4bf27a-0x0;var _0x22a0ba=_0x3f19[_0x4bf27a];return _0x22a0ba;};'use strict';var EventEmitter=require(_0x93f1('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x93f1('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93f1('0x2'),'afterUpdate':_0x93f1('0x3'),'afterDestroy':_0x93f1('0x4')};function emitEvent(_0x2057aa){return function(_0x5dbfbc,_0x1ca333,_0x522769){_0x5dbfbc[_0x93f1('0x5')]({'attributes':['id'],'raw':!![]})[_0x93f1('0x6')](function(_0x171bf6){_0x5dbfbc[_0x93f1('0x7')]('Users',_0x171bf6[_0x93f1('0x8')](function(_0xf3d309){return{'id':_0xf3d309['id']};}));return WhatsappMessage[_0x93f1('0x9')]({'where':{'WhatsappInteractionId':_0x5dbfbc['id'],'direction':'in','read':![]},'raw':!![]});})[_0x93f1('0x6')](function(_0xfe4f0){_0x5dbfbc['setDataValue'](_0x93f1('0xa'),_0xfe4f0[_0x93f1('0xb')]);WhatsappInteractionEvents[_0x93f1('0xc')](_0x2057aa+':'+_0x5dbfbc['id'],_0x5dbfbc);WhatsappInteractionEvents[_0x93f1('0xc')](_0x2057aa,_0x5dbfbc);_0x522769(null);})[_0x93f1('0xd')](_0x522769(null));};}for(var e in events){if(events[_0x93f1('0xe')](e)){var event=events[e];WhatsappInteraction[_0x93f1('0xf')](e,emitEvent(event));}}module[_0x93f1('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index 04dfb09..232d486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab29=['util','../../config/logger','path','../../config/environment','./whatsappInteraction.attributes','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x289696,_0x585bc6){var _0x28d0ca=function(_0x3fe1cc){while(--_0x3fe1cc){_0x289696['push'](_0x289696['shift']());}};_0x28d0ca(++_0x585bc6);}(_0xab29,0x196));var _0x9ab2=function(_0x2ebe1b,_0x30b6a4){_0x2ebe1b=_0x2ebe1b-0x0;var _0x3802a9=_0xab29[_0x2ebe1b];return _0x3802a9;};'use strict';var _=require(_0x9ab2('0x0'));var util=require(_0x9ab2('0x1'));var logger=require(_0x9ab2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ab2('0x3'));var rimraf=require('rimraf');var config=require(_0x9ab2('0x4'));var attributes=require(_0x9ab2('0x5'));module['exports']=function(_0x1c4633,_0x2fd8b3){return _0x1c4633['define']('WhatsappInteraction',attributes,{'tableName':_0x9ab2('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x80bb22,_0x43873c,_0x26d0dc){if(_0x80bb22['changed'](_0x9ab2('0x7'))){_0x80bb22[_0x9ab2('0x8')]=moment()[_0x9ab2('0x9')](_0x9ab2('0xa'));}_0x26d0dc(null,_0x80bb22);}}});};
\ No newline at end of file
+var _0xa1c9=['request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x161aa7,_0x15506c){var _0x2aa45e=function(_0x5f4e14){while(--_0x5f4e14){_0x161aa7['push'](_0x161aa7['shift']());}};_0x2aa45e(++_0x15506c);}(_0xa1c9,0x135));var _0x9a1c=function(_0x271571,_0x4737a8){_0x271571=_0x271571-0x0;var _0x30fde9=_0xa1c9[_0x271571];return _0x30fde9;};'use strict';var _=require(_0x9a1c('0x0'));var util=require(_0x9a1c('0x1'));var logger=require(_0x9a1c('0x2'))(_0x9a1c('0x3'));var moment=require(_0x9a1c('0x4'));var BPromise=require(_0x9a1c('0x5'));var rp=require(_0x9a1c('0x6'));var fs=require('fs');var path=require(_0x9a1c('0x7'));var rimraf=require(_0x9a1c('0x8'));var config=require('../../config/environment');var attributes=require(_0x9a1c('0x9'));module[_0x9a1c('0xa')]=function(_0x176efb,_0x304592){return _0x176efb[_0x9a1c('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x9a1c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x98387f,_0x586994,_0x564d86){if(_0x98387f['changed']('closed')){_0x98387f[_0x9a1c('0xd')]=moment()[_0x9a1c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x564d86(null,_0x98387f);}}});};
\ No newline at end of file
index dc5da14..bd6bdb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b7e=['catch','WhatsappInteraction','find','addTags','omit','ids','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','stringify'];(function(_0x1d5759,_0x417e09){var _0x51ddcd=function(_0x4e3f43){while(--_0x4e3f43){_0x1d5759['push'](_0x1d5759['shift']());}};_0x51ddcd(++_0x417e09);}(_0x2b7e,0x137));var _0xe2b7=function(_0x3ca29b,_0x19de23){_0x3ca29b=_0x3ca29b-0x0;var _0x12e492=_0x2b7e[_0x3ca29b];return _0x12e492;};'use strict';var _=require('lodash');var util=require(_0xe2b7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe2b7('0x1'));var fs=require('fs');var Redis=require(_0xe2b7('0x2'));var db=require(_0xe2b7('0x3'))['db'];var utils=require(_0xe2b7('0x4'));var logger=require(_0xe2b7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe2b7('0x6')][_0xe2b7('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe2b7('0x8')],{'host':_0xe2b7('0x9'),'port':0x18eb});var socket=require(_0xe2b7('0xa'))(new Redis(config[_0xe2b7('0x8')]));require(_0xe2b7('0xb'))['register'](socket);function respondWithRpcPromise(_0x554226,_0x4cfda0,_0x3ee8ed){return new BPromise(function(_0x260f5e,_0x40ec26){return client['request'](_0x554226,_0x3ee8ed)[_0xe2b7('0xc')](function(_0x2363b5){logger[_0xe2b7('0xd')](_0xe2b7('0xe'),_0x4cfda0,'request\x20sent');logger[_0xe2b7('0xf')](_0xe2b7('0x10'),_0x4cfda0,_0xe2b7('0x11'),JSON['stringify'](_0x2363b5));if(_0x2363b5['error']){if(_0x2363b5[_0xe2b7('0x12')][_0xe2b7('0x13')]===0x1f4){logger[_0xe2b7('0x12')](_0xe2b7('0xe'),_0x4cfda0,_0x2363b5[_0xe2b7('0x12')]['message']);return _0x40ec26(_0x2363b5[_0xe2b7('0x12')][_0xe2b7('0x14')]);}logger[_0xe2b7('0x12')](_0xe2b7('0xe'),_0x4cfda0,_0x2363b5[_0xe2b7('0x12')][_0xe2b7('0x14')]);return _0x260f5e(_0x2363b5[_0xe2b7('0x12')][_0xe2b7('0x14')]);}else{logger['info'](_0xe2b7('0xe'),_0x4cfda0,_0xe2b7('0x11'));_0x260f5e(_0x2363b5[_0xe2b7('0x15')][_0xe2b7('0x14')]);}})['catch'](function(_0x42c138){logger[_0xe2b7('0x12')](_0xe2b7('0xe'),_0x4cfda0,_0x42c138);_0x40ec26(_0x42c138);});});}exports['UpdateWhatsappInteraction']=function(_0x334961){var _0xf56086=this;return new Promise(function(_0x1c2590,_0x52bd59){return db['WhatsappInteraction'][_0xe2b7('0x16')](_0x334961[_0xe2b7('0x17')],{'raw':_0x334961[_0xe2b7('0x18')]?_0x334961[_0xe2b7('0x18')][_0xe2b7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x334961[_0xe2b7('0x18')]?_0x334961[_0xe2b7('0x18')][_0xe2b7('0x1a')]||null:null,'attributes':_0x334961[_0xe2b7('0x18')]?_0x334961['options'][_0xe2b7('0x1b')]||null:null,'limit':_0x334961['options']?_0x334961['options'][_0xe2b7('0x1c')]||null:null})[_0xe2b7('0xc')](function(_0x48108c){logger[_0xe2b7('0xd')](_0xe2b7('0x1d'),_0x334961);logger[_0xe2b7('0xf')](_0xe2b7('0x1d'),_0x334961,JSON[_0xe2b7('0x1e')](_0x48108c));_0x1c2590(_0x48108c);})[_0xe2b7('0x1f')](function(_0x4ff382){logger['error'](_0xe2b7('0x1d'),_0x4ff382[_0xe2b7('0x14')],_0x334961);_0x52bd59(_0xf56086['error'](0x1f4,_0x4ff382[_0xe2b7('0x14')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x653a00){return new Promise(function(_0x71206f,_0xacb53f){return db[_0xe2b7('0x20')][_0xe2b7('0x21')]({'where':_0x653a00[_0xe2b7('0x18')]?_0x653a00[_0xe2b7('0x18')][_0xe2b7('0x1a')]||null:null})[_0xe2b7('0xc')](function(_0x6a323d){if(_0x6a323d){return _0x6a323d[_0xe2b7('0x22')](_0x653a00[_0xe2b7('0x17')]['ids'],_[_0xe2b7('0x23')](_0x653a00['body'],[_0xe2b7('0x24'),'id'])||{});}})['spread'](function(_0x463558){logger[_0xe2b7('0xd')]('AddTags',_0x653a00);logger['debug'](_0xe2b7('0x25'),_0x653a00,JSON[_0xe2b7('0x1e')](_0x463558));_0x71206f(_0x463558);})[_0xe2b7('0x1f')](function(_0x4d6dce){logger[_0xe2b7('0x12')](_0xe2b7('0x25'),_0x4d6dce[_0xe2b7('0x14')],_0x653a00);_0xacb53f(_this['error'](0x1f4,_0x4d6dce['message']));});});};
\ No newline at end of file
+var _0x4249=['request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','WhatsappInteraction','update','body','options','raw','where','limit','UpdateWhatsappInteraction','find','then','addTags','ids','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./whatsappInteraction.socket','register'];(function(_0x478b2e,_0x4ccf6e){var _0x50304c=function(_0x3bdb59){while(--_0x3bdb59){_0x478b2e['push'](_0x478b2e['shift']());}};_0x50304c(++_0x4ccf6e);}(_0x4249,0x159));var _0x9424=function(_0x417b15,_0x2a713d){_0x417b15=_0x417b15-0x0;var _0x475bda=_0x4249[_0x417b15];return _0x475bda;};'use strict';var _=require(_0x9424('0x0'));var util=require(_0x9424('0x1'));var moment=require('moment');var BPromise=require(_0x9424('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9424('0x3'))['db'];var utils=require(_0x9424('0x4'));var logger=require(_0x9424('0x5'))(_0x9424('0x6'));var config=require(_0x9424('0x7'));var jayson=require(_0x9424('0x8'));var client=jayson[_0x9424('0x9')][_0x9424('0xa')]({'port':0x232a});config['redis']=_[_0x9424('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9424('0xc')]));require(_0x9424('0xd'))[_0x9424('0xe')](socket);function respondWithRpcPromise(_0x567f33,_0x5d6044,_0x5c02ba){return new BPromise(function(_0x38b24a,_0x3ae8e0){return client[_0x9424('0xf')](_0x567f33,_0x5c02ba)['then'](function(_0x2782fe){logger[_0x9424('0x10')](_0x9424('0x11'),_0x5d6044,_0x9424('0x12'));logger[_0x9424('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x5d6044,_0x9424('0x12'),JSON[_0x9424('0x14')](_0x2782fe));if(_0x2782fe[_0x9424('0x15')]){if(_0x2782fe[_0x9424('0x15')][_0x9424('0x16')]===0x1f4){logger[_0x9424('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x5d6044,_0x2782fe['error']['message']);return _0x3ae8e0(_0x2782fe[_0x9424('0x15')][_0x9424('0x17')]);}logger[_0x9424('0x15')](_0x9424('0x11'),_0x5d6044,_0x2782fe[_0x9424('0x15')][_0x9424('0x17')]);return _0x38b24a(_0x2782fe[_0x9424('0x15')][_0x9424('0x17')]);}else{logger[_0x9424('0x10')](_0x9424('0x11'),_0x5d6044,_0x9424('0x12'));_0x38b24a(_0x2782fe[_0x9424('0x18')][_0x9424('0x17')]);}})[_0x9424('0x19')](function(_0x51a82b){logger[_0x9424('0x15')](_0x9424('0x11'),_0x5d6044,_0x51a82b);_0x3ae8e0(_0x51a82b);});});}exports['UpdateWhatsappInteraction']=function(_0xd2a54b){var _0x1bd8c6=this;return new Promise(function(_0x418266,_0xd42691){return db[_0x9424('0x1a')][_0x9424('0x1b')](_0xd2a54b[_0x9424('0x1c')],{'raw':_0xd2a54b[_0x9424('0x1d')]?_0xd2a54b['options'][_0x9424('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2a54b['options']?_0xd2a54b[_0x9424('0x1d')][_0x9424('0x1f')]||null:null,'attributes':_0xd2a54b[_0x9424('0x1d')]?_0xd2a54b[_0x9424('0x1d')]['attributes']||null:null,'limit':_0xd2a54b['options']?_0xd2a54b[_0x9424('0x1d')][_0x9424('0x20')]||null:null})['then'](function(_0x1ed8c6){logger[_0x9424('0x10')](_0x9424('0x21'),_0xd2a54b);logger['debug']('UpdateWhatsappInteraction',_0xd2a54b,JSON[_0x9424('0x14')](_0x1ed8c6));_0x418266(_0x1ed8c6);})[_0x9424('0x19')](function(_0x42b6bc){logger[_0x9424('0x15')]('UpdateWhatsappInteraction',_0x42b6bc[_0x9424('0x17')],_0xd2a54b);_0xd42691(_0x1bd8c6[_0x9424('0x15')](0x1f4,_0x42b6bc['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x76aae8){return new Promise(function(_0x39f267,_0x170545){return db['WhatsappInteraction'][_0x9424('0x22')]({'where':_0x76aae8['options']?_0x76aae8[_0x9424('0x1d')][_0x9424('0x1f')]||null:null})[_0x9424('0x23')](function(_0x3bc357){if(_0x3bc357){return _0x3bc357[_0x9424('0x24')](_0x76aae8[_0x9424('0x1c')]['ids'],_['omit'](_0x76aae8['body'],[_0x9424('0x25'),'id'])||{});}})[_0x9424('0x26')](function(_0x203ead){logger[_0x9424('0x10')](_0x9424('0x27'),_0x76aae8);logger[_0x9424('0x13')](_0x9424('0x27'),_0x76aae8,JSON[_0x9424('0x14')](_0x203ead));_0x39f267(_0x203ead);})[_0x9424('0x19')](function(_0x208510){logger[_0x9424('0x15')]('AddTags',_0x208510[_0x9424('0x17')],_0x76aae8);_0x170545(_this[_0x9424('0x15')](0x1f4,_0x208510[_0x9424('0x17')]));});});};
\ No newline at end of file
index 1a97f95..f06d121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5637=['register','save','remove','update','emit'];(function(_0x1311bf,_0x49f7fe){var _0xaf9698=function(_0x79c599){while(--_0x79c599){_0x1311bf['push'](_0x1311bf['shift']());}};_0xaf9698(++_0x49f7fe);}(_0x5637,0x74));var _0x7563=function(_0x308aae,_0x3b03b4){_0x308aae=_0x308aae-0x0;var _0x19efe8=_0x5637[_0x308aae];return _0x19efe8;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x7563('0x0'),_0x7563('0x1'),_0x7563('0x2')];function createListener(_0x153476,_0x5e6d19){return function(_0x1e328e){_0x5e6d19[_0x7563('0x3')](_0x153476,_0x1e328e);};}function removeListener(_0x217fa2,_0x343941){return function(){WhatsappInteractionEvents['removeListener'](_0x217fa2,_0x343941);};}exports[_0x7563('0x4')]=function(_0x4bde71){for(var _0xe1b3be=0x0,_0x4713c1=events['length'];_0xe1b3be<_0x4713c1;_0xe1b3be++){var _0xc9ef8c=events[_0xe1b3be];var _0x1463a3=createListener('whatsappInteraction:'+_0xc9ef8c,_0x4bde71);WhatsappInteractionEvents['on'](_0xc9ef8c,_0x1463a3);}};
\ No newline at end of file
+var _0xd7e6=['emit','removeListener','register','length','update'];(function(_0x21c69c,_0x1b7535){var _0x2acd03=function(_0x4c70f0){while(--_0x4c70f0){_0x21c69c['push'](_0x21c69c['shift']());}};_0x2acd03(++_0x1b7535);}(_0xd7e6,0xae));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=['save','remove',_0x6d7e('0x0')];function createListener(_0x27bfcd,_0x50dda6){return function(_0x20d96d){_0x50dda6[_0x6d7e('0x1')](_0x27bfcd,_0x20d96d);};}function removeListener(_0x242a4c,_0x5a260c){return function(){WhatsappInteractionEvents[_0x6d7e('0x2')](_0x242a4c,_0x5a260c);};}exports[_0x6d7e('0x3')]=function(_0x1bf105){for(var _0x45b029=0x0,_0x4fe389=events[_0x6d7e('0x4')];_0x45b029<_0x4fe389;_0x45b029++){var _0x5a466c=events[_0x45b029];var _0x248bf9=createListener('whatsappInteraction:'+_0x5a466c,_0x1bf105);WhatsappInteractionEvents['on'](_0x5a466c,_0x248bf9);}};
\ No newline at end of file
index 640a75d..f8f4d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc6=['util','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','whatsapp','whatsappmessage:create','post','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports'];(function(_0x107253,_0x45f253){var _0x56325d=function(_0x35d892){while(--_0x35d892){_0x107253['push'](_0x107253['shift']());}};_0x56325d(++_0x45f253);}(_0xedc6,0x165));var _0x6edc=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xedc6[_0x1cfa0d];return _0xe33279;};'use strict';var multer=require('multer');var util=require(_0x6edc('0x0'));var path=require('path');var timeout=require(_0x6edc('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6edc('0x2'));var interaction=require(_0x6edc('0x3'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x6edc('0x4')]('/',auth[_0x6edc('0x5')](),controller[_0x6edc('0x6')]);router[_0x6edc('0x4')](_0x6edc('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x6edc('0x4')](_0x6edc('0x8'),auth['isAuthenticated'](),controller[_0x6edc('0x9')]);router['post']('/',auth[_0x6edc('0x5')](),interaction['tracked'](_0x6edc('0xa'),_0x6edc('0xb')),controller['create']);router[_0x6edc('0xc')]('/:id/status',controller['status']);router[_0x6edc('0xd')](_0x6edc('0x8'),auth['isAuthenticated'](),controller[_0x6edc('0xe')]);router[_0x6edc('0xd')](_0x6edc('0xf'),auth[_0x6edc('0x5')](),controller[_0x6edc('0x10')]);router[_0x6edc('0xd')](_0x6edc('0x11'),auth[_0x6edc('0x5')](),controller['reject']);router[_0x6edc('0x12')](_0x6edc('0x8'),auth[_0x6edc('0x5')](),controller[_0x6edc('0x13')]);module[_0x6edc('0x14')]=router;
\ No newline at end of file
+var _0x6b78=['create','/:id/status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/:id','show','post','whatsappmessage:create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b78,0x144));var _0x86b7=function(_0x3e044e,_0x549364){_0x3e044e=_0x3e044e-0x0;var _0x3acfa3=_0x6b78[_0x3e044e];return _0x3acfa3;};'use strict';var multer=require(_0x86b7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x86b7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x86b7('0x2'));var interaction=require(_0x86b7('0x3'));var config=require('../../config/environment');var controller=require(_0x86b7('0x4'));router[_0x86b7('0x5')]('/',auth[_0x86b7('0x6')](),controller[_0x86b7('0x7')]);router[_0x86b7('0x5')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x86b7('0x5')](_0x86b7('0x8'),auth[_0x86b7('0x6')](),controller[_0x86b7('0x9')]);router[_0x86b7('0xa')]('/',auth[_0x86b7('0x6')](),interaction['tracked']('whatsapp',_0x86b7('0xb')),controller[_0x86b7('0xc')]);router['post'](_0x86b7('0xd'),controller['status']);router[_0x86b7('0xe')](_0x86b7('0x8'),auth['isAuthenticated'](),controller[_0x86b7('0xf')]);router[_0x86b7('0xe')](_0x86b7('0x10'),auth[_0x86b7('0x6')](),controller['accept']);router[_0x86b7('0xe')](_0x86b7('0x11'),auth[_0x86b7('0x6')](),controller[_0x86b7('0x12')]);router[_0x86b7('0x13')]('/:id',auth[_0x86b7('0x6')](),controller[_0x86b7('0x14')]);module['exports']=router;
\ No newline at end of file
index 35d1514..37faf58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2011=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2011,0x73));var _0x1201=function(_0x28710d,_0x2b828d){_0x28710d=_0x28710d-0x0;var _0x2b7fa1=_0x2011[_0x28710d];return _0x2b7fa1;};'use strict';var Sequelize=require(_0x1201('0x0'));module[_0x1201('0x1')]={'body':{'type':Sequelize[_0x1201('0x2')](_0x1201('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1201('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1201('0x5')]('in',_0x1201('0x6')),'defaultValue':_0x1201('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1201('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1201('0x8')]},'secret':{'type':Sequelize[_0x1201('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xc1bf=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x5cb5b1,_0xafc0d6){var _0x22d423=function(_0x1c60c1){while(--_0x1c60c1){_0x5cb5b1['push'](_0x5cb5b1['shift']());}};_0x22d423(++_0xafc0d6);}(_0xc1bf,0x79));var _0xfc1b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc1bf[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xfc1b('0x0'));module[_0xfc1b('0x1')]={'body':{'type':Sequelize[_0xfc1b('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfc1b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfc1b('0x4')]('in',_0xfc1b('0x5')),'defaultValue':_0xfc1b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfc1b('0x6')](0xbe)},'phone':{'type':Sequelize[_0xfc1b('0x6')]},'readAt':{'type':Sequelize[_0xfc1b('0x7')]},'secret':{'type':Sequelize[_0xfc1b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfc1b('0x6')]},'providerResponse':{'type':Sequelize[_0xfc1b('0x2')]}};
\ No newline at end of file
index e1ddb7f..eb994f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2250=['catch','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','WhatsappMessage','includeAll','include','rows','show','params','keys','options','create','body','find','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteraction','isNil','read1stAt','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','agent','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','ContactId','QueryTypes','User','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','MessageSid','messageId','MessageStatus','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','error','code','message','result'];(function(_0x15014b,_0x47a66a){var _0x595d46=function(_0x8fb0d5){while(--_0x8fb0d5){_0x15014b['push'](_0x15014b['shift']());}};_0x595d46(++_0x47a66a);}(_0x2250,0x178));var _0x0225=function(_0x2401e6,_0x2248d7){_0x2401e6=_0x2401e6-0x0;var _0xf06a43=_0x2250[_0x2401e6];return _0xf06a43;};'use strict';var emlformat=require(_0x0225('0x0'));var rimraf=require(_0x0225('0x1'));var zipdir=require(_0x0225('0x2'));var jsonpatch=require(_0x0225('0x3'));var rp=require(_0x0225('0x4'));var moment=require(_0x0225('0x5'));var BPromise=require(_0x0225('0x6'));var Mustache=require('mustache');var util=require(_0x0225('0x7'));var path=require(_0x0225('0x8'));var sox=require(_0x0225('0x9'));var csv=require(_0x0225('0xa'));var ejs=require(_0x0225('0xb'));var fs=require('fs');var fs_extra=require(_0x0225('0xc'));var _=require(_0x0225('0xd'));var squel=require(_0x0225('0xe'));var crypto=require('crypto');var jsforce=require(_0x0225('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0225('0x10'));var Papa=require(_0x0225('0x11'));var Redis=require(_0x0225('0x12'));var authService=require(_0x0225('0x13'));var qs=require(_0x0225('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0225('0x15'));var logger=require(_0x0225('0x16'))(_0x0225('0x17'));var utils=require(_0x0225('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0225('0x19'));var db=require('../../mysqldb')['db'];config[_0x0225('0x1a')]=_[_0x0225('0x1b')](config['redis'],{'host':_0x0225('0x1c'),'port':0x18eb});var socket=require(_0x0225('0x1d'))(new Redis(config[_0x0225('0x1a')]));require(_0x0225('0x1e'))[_0x0225('0x1f')](socket);var jayson=require(_0x0225('0x20'));var client=jayson[_0x0225('0x21')][_0x0225('0x22')]({'port':0x232c});var client9002=jayson[_0x0225('0x21')][_0x0225('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x236a25,_0x494722,_0x2d41d3,_0x8f179c){return new BPromise(function(_0x59e455,_0x60d158){var _0x4e3697=_0x8f179c||client;return _0x4e3697[_0x0225('0x23')](_0x236a25,_0x2d41d3)[_0x0225('0x24')](function(_0x27ab34){logger[_0x0225('0x25')](_0x0225('0x26'),_0x494722,'request\x20sent');logger[_0x0225('0x27')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x494722,'request\x20sent',JSON['stringify'](_0x27ab34));if(_0x27ab34[_0x0225('0x28')]){if(_0x27ab34[_0x0225('0x28')][_0x0225('0x29')]===0x1f4){logger[_0x0225('0x28')](_0x0225('0x26'),_0x494722,_0x27ab34[_0x0225('0x28')][_0x0225('0x2a')]);return _0x60d158(_0x27ab34['error'][_0x0225('0x2a')]);}logger[_0x0225('0x28')](_0x0225('0x26'),_0x494722,_0x27ab34['error']['message']);return _0x59e455(_0x27ab34[_0x0225('0x28')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x494722,'request\x20sent');_0x59e455(_0x27ab34[_0x0225('0x2b')]['message']);}})[_0x0225('0x2c')](function(_0xcb5384){logger[_0x0225('0x28')](_0x0225('0x26'),_0x494722,_0xcb5384);_0x60d158(_0xcb5384);});});}function respondWithStatusCode(_0x340552,_0x406a8f){_0x406a8f=_0x406a8f||0xcc;return function(_0x338f49){if(_0x338f49){return _0x340552['sendStatus'](_0x406a8f);}return _0x340552[_0x0225('0x2d')](_0x406a8f)[_0x0225('0x2e')]();};}function respondWithResult(_0xf52abb,_0x32d45d){_0x32d45d=_0x32d45d||0xc8;return function(_0x58b084){if(_0x58b084){return _0xf52abb['status'](_0x32d45d)['json'](_0x58b084);}};}function respondWithFilteredResult(_0x1c44d5,_0x575a64){return function(_0x4b928b){if(_0x4b928b){var _0x3d205c=typeof _0x575a64['offset']===_0x0225('0x2f')&&typeof _0x575a64['limit']===_0x0225('0x2f');var _0x5f3ae2=_0x4b928b[_0x0225('0x30')];var _0x45ae3=_0x3d205c?0x0:_0x575a64[_0x0225('0x31')];var _0x391aed=_0x3d205c?_0x4b928b[_0x0225('0x30')]:_0x575a64['offset']+_0x575a64[_0x0225('0x32')];var _0x1f4888;if(_0x391aed>=_0x5f3ae2){_0x391aed=_0x5f3ae2;_0x1f4888=0xc8;}else{_0x1f4888=0xce;}_0x1c44d5[_0x0225('0x2d')](_0x1f4888);return _0x1c44d5[_0x0225('0x33')]('Content-Range',_0x45ae3+'-'+_0x391aed+'/'+_0x5f3ae2)[_0x0225('0x34')](_0x4b928b);}return null;};}function patchUpdates(_0x241631){return function(_0x5ac8d5){try{jsonpatch[_0x0225('0x35')](_0x5ac8d5,_0x241631,!![]);}catch(_0x402976){return BPromise[_0x0225('0x36')](_0x402976);}return _0x5ac8d5[_0x0225('0x37')]();};}function saveUpdates(_0x1f27b1,_0x7c5e5d){return function(_0x5ad394){if(_0x5ad394){return _0x5ad394[_0x0225('0x38')](_0x1f27b1)['then'](function(_0x58dbca){return _0x58dbca;});}return null;};}function removeEntity(_0x41eb83,_0x47cadf){return function(_0x4d4e3a){if(_0x4d4e3a){return _0x4d4e3a[_0x0225('0x39')]()['then'](function(){_0x41eb83[_0x0225('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x492ece,_0x346cd6){return function(_0x22e101){if(!_0x22e101){_0x492ece['sendStatus'](0x194);}return _0x22e101;};}function handleError(_0x329c7b,_0x61f1fe){_0x61f1fe=_0x61f1fe||0x1f4;return function(_0x208360){logger[_0x0225('0x28')](_0x208360[_0x0225('0x3a')]);if(_0x208360[_0x0225('0x3b')]){delete _0x208360[_0x0225('0x3b')];}_0x329c7b[_0x0225('0x2d')](_0x61f1fe)['send'](_0x208360);};}exports['index']=function(_0xc267cc,_0x375958){var _0xb365d8={},_0x126b20={},_0x476abc={'count':0x0,'rows':[]};var _0x4444b5=_[_0x0225('0x3c')](db['WhatsappMessage'][_0x0225('0x3d')],function(_0x4b0ca8){return{'name':_0x4b0ca8[_0x0225('0x3e')],'type':_0x4b0ca8[_0x0225('0x3f')][_0x0225('0x40')]};});_0x126b20[_0x0225('0x41')]=_[_0x0225('0x3c')](_0x4444b5,_0x0225('0x3b'));_0x126b20[_0x0225('0x42')]=_['keys'](_0xc267cc[_0x0225('0x42')]);_0x126b20['filters']=_['intersection'](_0x126b20[_0x0225('0x41')],_0x126b20[_0x0225('0x42')]);_0xb365d8[_0x0225('0x43')]=_[_0x0225('0x44')](_0x126b20[_0x0225('0x41')],qs[_0x0225('0x45')](_0xc267cc[_0x0225('0x42')][_0x0225('0x45')]));_0xb365d8[_0x0225('0x43')]=_0xb365d8[_0x0225('0x43')][_0x0225('0x46')]?_0xb365d8[_0x0225('0x43')]:_0x126b20[_0x0225('0x41')];if(!_0xc267cc['query'][_0x0225('0x47')](_0x0225('0x48'))){_0xb365d8[_0x0225('0x32')]=qs[_0x0225('0x32')](_0xc267cc[_0x0225('0x42')]['limit']);_0xb365d8[_0x0225('0x31')]=qs['offset'](_0xc267cc['query'][_0x0225('0x31')]);}_0xb365d8[_0x0225('0x49')]=qs[_0x0225('0x4a')](_0xc267cc[_0x0225('0x42')][_0x0225('0x4a')]);_0xb365d8[_0x0225('0x4b')]=qs[_0x0225('0x4c')](_[_0x0225('0x4d')](_0xc267cc[_0x0225('0x42')],_0x126b20[_0x0225('0x4c')]),_0x4444b5);if(_0xc267cc['query']['filter']){_0xb365d8['where']=_[_0x0225('0x4e')](_0xb365d8[_0x0225('0x4b')],{'$or':_[_0x0225('0x3c')](_0x4444b5,function(_0xf99879){if(_0xf99879[_0x0225('0x3f')]!==_0x0225('0x4f')){var _0xf64e42={};_0xf64e42[_0xf99879[_0x0225('0x3b')]]={'$like':'%'+_0xc267cc[_0x0225('0x42')][_0x0225('0x50')]+'%'};return _0xf64e42;}})});}_0xb365d8=_['merge']({},_0xb365d8,_0xc267cc['options']);var _0x33ddd9={'where':_0xb365d8[_0x0225('0x4b')]};return db[_0x0225('0x51')]['count'](_0x33ddd9)[_0x0225('0x24')](function(_0x3215e0){_0x476abc[_0x0225('0x30')]=_0x3215e0;if(_0xc267cc['query'][_0x0225('0x52')]){_0xb365d8[_0x0225('0x53')]=[{'all':!![]}];}return db[_0x0225('0x51')]['findAll'](_0xb365d8);})[_0x0225('0x24')](function(_0x35fe17){_0x476abc[_0x0225('0x54')]=_0x35fe17;return _0x476abc;})[_0x0225('0x24')](respondWithFilteredResult(_0x375958,_0xb365d8))[_0x0225('0x2c')](handleError(_0x375958,null));};exports[_0x0225('0x55')]=function(_0x4a90d5,_0x1b8d97){var _0x50afa1={'raw':!![],'where':{'id':_0x4a90d5[_0x0225('0x56')]['id']}},_0x522100={};_0x522100[_0x0225('0x41')]=_['keys'](db['WhatsappMessage'][_0x0225('0x3d')]);_0x522100[_0x0225('0x42')]=_[_0x0225('0x57')](_0x4a90d5[_0x0225('0x42')]);_0x522100['filters']=_[_0x0225('0x44')](_0x522100[_0x0225('0x41')],_0x522100[_0x0225('0x42')]);_0x50afa1[_0x0225('0x43')]=_[_0x0225('0x44')](_0x522100[_0x0225('0x41')],qs['fields'](_0x4a90d5[_0x0225('0x42')][_0x0225('0x45')]));_0x50afa1['attributes']=_0x50afa1['attributes'][_0x0225('0x46')]?_0x50afa1[_0x0225('0x43')]:_0x522100[_0x0225('0x41')];if(_0x4a90d5[_0x0225('0x42')][_0x0225('0x52')]){_0x50afa1[_0x0225('0x53')]=[{'all':!![]}];}_0x50afa1=_[_0x0225('0x4e')]({},_0x50afa1,_0x4a90d5[_0x0225('0x58')]);return db[_0x0225('0x51')]['find'](_0x50afa1)[_0x0225('0x24')](handleEntityNotFound(_0x1b8d97,null))[_0x0225('0x24')](respondWithResult(_0x1b8d97,null))[_0x0225('0x2c')](handleError(_0x1b8d97,null));};exports[_0x0225('0x59')]=function(_0x1159fa,_0x225c05){return db['WhatsappMessage'][_0x0225('0x59')](_0x1159fa['body'],{})[_0x0225('0x24')](respondWithResult(_0x225c05,0xc9))['catch'](handleError(_0x225c05,null));};exports[_0x0225('0x38')]=function(_0x135a3c,_0x73edb4){if(_0x135a3c['body']['id']){delete _0x135a3c[_0x0225('0x5a')]['id'];}return db[_0x0225('0x51')][_0x0225('0x5b')]({'where':{'id':_0x135a3c['params']['id']}})[_0x0225('0x24')](handleEntityNotFound(_0x73edb4,null))[_0x0225('0x24')](saveUpdates(_0x135a3c[_0x0225('0x5a')],null))[_0x0225('0x24')](respondWithResult(_0x73edb4,null))[_0x0225('0x2c')](handleError(_0x73edb4,null));};exports[_0x0225('0x39')]=function(_0x413d01,_0x2a7c7f){return db[_0x0225('0x51')][_0x0225('0x5b')]({'where':{'id':_0x413d01[_0x0225('0x56')]['id']}})[_0x0225('0x24')](handleEntityNotFound(_0x2a7c7f,null))[_0x0225('0x24')](removeEntity(_0x2a7c7f,null))['catch'](handleError(_0x2a7c7f,null));};exports['describe']=function(_0x6a743d,_0x9470ce){return db[_0x0225('0x51')]['describe']()[_0x0225('0x24')](respondWithResult(_0x9470ce,null))[_0x0225('0x2c')](handleError(_0x9470ce,null));};var interaction_log=require(_0x0225('0x16'))(_0x0225('0x5c'));exports[_0x0225('0x5d')]=function(_0x46bbd8,_0x4c584e,_0x49a25b){var _0x210d42={'agent':{},'channel':_0x0225('0x5e')};if(_0x46bbd8['body']['id']){delete _0x46bbd8['body']['id'];}_0x46bbd8[_0x0225('0x5a')][_0x0225('0x5f')]=!![];_0x46bbd8['body'][_0x0225('0x60')]=moment()['format'](_0x0225('0x61'));_0x46bbd8[_0x0225('0x5a')][_0x0225('0x62')]=_0x46bbd8[_0x0225('0x5a')][_0x0225('0x62')]||_0x46bbd8['user']['id'];_0x210d42['agent']['id']=_0x46bbd8['body'][_0x0225('0x62')];return db[_0x0225('0x51')]['find']({'where':{'id':_0x46bbd8[_0x0225('0x56')]['id'],'UserId':null}})[_0x0225('0x24')](handleEntityNotFound(_0x4c584e,null))['then'](saveUpdates(_0x46bbd8[_0x0225('0x5a')],null))[_0x0225('0x24')](function(_0x17f06c){if(_0x17f06c){_0x210d42['message']=_0x17f06c['get']({'plain':!![]});return db[_0x0225('0x63')][_0x0225('0x5b')]({'where':{'id':_0x17f06c['WhatsappInteractionId']}});}return null;})[_0x0225('0x24')](handleEntityNotFound(_0x4c584e,null))[_0x0225('0x24')](function(_0x37628a){if(_0x37628a){return _0x37628a[_0x0225('0x38')]({'UserId':_0x46bbd8[_0x0225('0x5a')][_0x0225('0x62')],'read1stAt':_[_0x0225('0x64')](_0x37628a[_0x0225('0x65')])?moment()[_0x0225('0x66')](_0x0225('0x61')):undefined});}return null;})[_0x0225('0x24')](function(_0x440ad4){if(_0x440ad4){_0x210d42[_0x0225('0x67')]=_0x440ad4[_0x0225('0x68')]({'plain':!![]});interaction_log[_0x0225('0x25')](_0x0225('0x69'),_0x46bbd8[_0x0225('0x6a')]['id'],_0x46bbd8[_0x0225('0x6a')]['name'],_0x46bbd8['user'][_0x0225('0x6b')],_0x210d42[_0x0225('0x67')]['id'],_0x46bbd8[_0x0225('0x5a')]?JSON['stringify'](_0x46bbd8[_0x0225('0x5a')]):_0x0225('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x0225('0x6d'),_0x210d42);}return null;})[_0x0225('0x24')](function(_0x3105ca){var _0xd1b926=_0x0225('0x6e')+_0x3105ca[_0x0225('0x2a')]['ContactId'];return db[_0x0225('0x6f')][_0x0225('0x42')](_0xd1b926,{'type':db[_0x0225('0x70')]['QueryTypes'][_0x0225('0x71')],'raw':!![]})[_0x0225('0x24')](function(_0x147721){return _0x147721;});})[_0x0225('0x24')](function(_0x3584a5){if(_0x3584a5){_0x210d42['message'][_0x0225('0x72')]=_0x3584a5[0x0];if(!_0x46bbd8['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x46bbd8[_0x0225('0x5a')][_0x0225('0x62')],'role':_0x0225('0x73')},'attributes':['id','name',_0x0225('0x74'),_0x0225('0x75'),_0x0225('0x76')],'raw':!![]});}return null;})[_0x0225('0x24')](function(_0x52d029){if(!_0x52d029)return null;_0x210d42[_0x0225('0x2a')][_0x0225('0x73')]=_0x52d029;return _0x210d42;})[_0x0225('0x24')](function(_0x3dfad0){if(_0x3dfad0){if(_0x46bbd8[_0x0225('0x5a')][_0x0225('0x77')]){_0x210d42[_0x0225('0x2a')]['interface']=util[_0x0225('0x66')](_0x0225('0x78'),_0x46bbd8[_0x0225('0x6a')][_0x0225('0x3b')]);_0x210d42[_0x0225('0x2a')][_0x0225('0x79')]=_0x210d42['channel'];_0x210d42['message'][_0x0225('0x7a')]=_0x0225('0x5d');return respondWithRpcPromise(_0x0225('0x7b'),_0x0225('0x7b'),{'event':'acceptmessage','message':_0x210d42[_0x0225('0x2a')]},client9002)[_0x0225('0x24')](function(){return _0x210d42;});}return _0x210d42;}return null;})[_0x0225('0x24')](respondWithResult(_0x4c584e,null))[_0x0225('0x2c')](handleError(_0x4c584e,null));};var interaction_log=require(_0x0225('0x16'))(_0x0225('0x5c'));exports[_0x0225('0x36')]=function(_0x2b230f,_0x5330c1,_0x503c8e){var _0x40f39b={'agent':{},'channel':_0x0225('0x5e')};if(_0x2b230f['body']['id']){delete _0x2b230f[_0x0225('0x5a')]['id'];}_0x2b230f[_0x0225('0x5a')]['UserId']=_0x2b230f[_0x0225('0x5a')][_0x0225('0x62')]||_0x2b230f[_0x0225('0x6a')]['id'];_0x40f39b[_0x0225('0x73')]['id']=_0x2b230f[_0x0225('0x5a')][_0x0225('0x62')];return db[_0x0225('0x51')][_0x0225('0x5b')]({'where':{'id':_0x2b230f[_0x0225('0x56')]['id'],'UserId':null}})[_0x0225('0x24')](handleEntityNotFound(_0x5330c1,null))[_0x0225('0x24')](function(_0x41076a){if(_0x41076a){_0x40f39b[_0x0225('0x2a')]=_0x41076a[_0x0225('0x68')]({'plain':!![]});return db[_0x0225('0x63')][_0x0225('0x5b')]({'where':{'id':_0x41076a['WhatsappInteractionId']}});}return null;})[_0x0225('0x24')](handleEntityNotFound(_0x5330c1,null))[_0x0225('0x24')](function(_0x4595bb){if(_0x4595bb){_0x40f39b['interaction']=_0x4595bb[_0x0225('0x68')]({'plain':!![]});interaction_log[_0x0225('0x25')](_0x0225('0x7c'),_0x2b230f[_0x0225('0x6a')]['id'],_0x2b230f[_0x0225('0x6a')]['name'],_0x2b230f[_0x0225('0x6a')][_0x0225('0x6b')],_0x40f39b['interaction']['id'],_0x2b230f[_0x0225('0x5a')]?JSON[_0x0225('0x7d')](_0x2b230f[_0x0225('0x5a')]):_0x0225('0x6c'));return respondWithRpcPromise(_0x0225('0x7e'),'rejectMessage',_0x40f39b);}return null;})[_0x0225('0x24')](function(_0x3a3787){var _0x49fb9d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a3787[_0x0225('0x2a')][_0x0225('0x7f')];return db['sequelize'][_0x0225('0x42')](_0x49fb9d,{'type':db[_0x0225('0x70')][_0x0225('0x80')][_0x0225('0x71')],'raw':!![]})[_0x0225('0x24')](function(_0x56b936){return _0x56b936;});})['then'](function(_0x5b2d02){if(_0x5b2d02){_0x40f39b[_0x0225('0x2a')][_0x0225('0x72')]=_0x5b2d02[0x0];if(!_0x2b230f[_0x0225('0x5a')][_0x0225('0x62')])return;return db[_0x0225('0x81')][_0x0225('0x5b')]({'where':{'id':_0x2b230f[_0x0225('0x5a')][_0x0225('0x62')],'role':_0x0225('0x73')},'attributes':['id',_0x0225('0x3b'),_0x0225('0x74'),_0x0225('0x75'),_0x0225('0x76')],'raw':!![]});}return null;})[_0x0225('0x24')](function(_0x28c8bb){if(!_0x28c8bb)return null;_0x40f39b[_0x0225('0x2a')]['agent']=_0x28c8bb;return _0x40f39b;})[_0x0225('0x24')](function(_0x5f206a){if(_0x5f206a){_0x5f206a[_0x0225('0x2a')][_0x0225('0x82')]=util[_0x0225('0x66')]('SIP/%s',_0x2b230f[_0x0225('0x6a')][_0x0225('0x3b')]);_0x5f206a[_0x0225('0x2a')][_0x0225('0x79')]=_0x40f39b['channel'];_0x5f206a['message'][_0x0225('0x7a')]=_0x0225('0x36');respondWithRpcPromise('EventManager',_0x0225('0x7b'),{'event':_0x0225('0x83'),'message':_0x5f206a[_0x0225('0x2a')]},client9002);return _0x40f39b;}return null;})[_0x0225('0x24')](respondWithResult(_0x5330c1,null))['catch'](handleError(_0x5330c1,null));};exports[_0x0225('0x2d')]=function(_0x27501f,_0x4a3cd0,_0x27296f){if(_0x27501f['body']['id']){delete _0x27501f[_0x0225('0x5a')]['id'];}var _0x39b5a7;return db[_0x0225('0x51')][_0x0225('0x5b')]({'where':{'id':_0x27501f[_0x0225('0x56')]['id']}})[_0x0225('0x24')](handleEntityNotFound(_0x4a3cd0,null))[_0x0225('0x24')](function(_0x3616a1){if(_0x3616a1){_0x39b5a7=_0x3616a1;return db[_0x0225('0x84')][_0x0225('0x5b')]({'where':{'id':_0x3616a1[_0x0225('0x85')]}});}})[_0x0225('0x24')](handleEntityNotFound(_0x4a3cd0,null))[_0x0225('0x24')](function(_0x321e00){if(_0x321e00){logger[_0x0225('0x27')](_0x0225('0x86'),_0x0225('0x2d'),_0x0225('0x87'),_0x321e00[_0x0225('0x3f')],util['inspect'](_0x27501f[_0x0225('0x5a')],{'showHidden':![],'depth':null}));switch(_0x321e00[_0x0225('0x3f')]){case'twilio':if(_0x27501f[_0x0225('0x5a')]['MessageSid']&&_0x27501f[_0x0225('0x5a')][_0x0225('0x88')]===_0x39b5a7[_0x0225('0x89')]&&_0x27501f[_0x0225('0x5a')][_0x0225('0x8a')]&&_0x27501f[_0x0225('0x5a')][_0x0225('0x8a')]===_0x0225('0x5f')){return _0x39b5a7['update']({'read':!![]});}else{logger[_0x0225('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x0225('0x2d'),'twilio',util[_0x0225('0x8b')](_0x27501f['body'],{'showHidden':![],'depth':null}));}break;}return _0x39b5a7;}})[_0x0225('0x24')](respondWithResult(_0x4a3cd0,null))[_0x0225('0x2c')](handleError(_0x4a3cd0,null));};
\ No newline at end of file
+var _0x0db9=['channel','EventManager','acceptmessage','whatsapp','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','inspect','eml-format','request-promise','moment','mustache','path','sox','ejs','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/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','options','WhatsappMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','whatsapp-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','manual','interface','SIP/%s'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x0db9,0xa3));var _0x90db=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0x0db9[_0x623e7];return _0x121131;};'use strict';var emlformat=require(_0x90db('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x90db('0x1'));var moment=require(_0x90db('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x90db('0x3'));var util=require('util');var path=require(_0x90db('0x4'));var sox=require(_0x90db('0x5'));var csv=require('to-csv');var ejs=require(_0x90db('0x6'));var fs=require('fs');var fs_extra=require(_0x90db('0x7'));var _=require(_0x90db('0x8'));var squel=require(_0x90db('0x9'));var crypto=require(_0x90db('0xa'));var jsforce=require(_0x90db('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x90db('0xc'));var querystring=require(_0x90db('0xd'));var Papa=require(_0x90db('0xe'));var Redis=require(_0x90db('0xf'));var authService=require(_0x90db('0x10'));var qs=require(_0x90db('0x11'));var as=require(_0x90db('0x12'));var hardwareService=require(_0x90db('0x13'));var logger=require(_0x90db('0x14'))(_0x90db('0x15'));var utils=require(_0x90db('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x90db('0x17'));var db=require(_0x90db('0x18'))['db'];config[_0x90db('0x19')]=_[_0x90db('0x1a')](config[_0x90db('0x19')],{'host':_0x90db('0x1b'),'port':0x18eb});var socket=require(_0x90db('0x1c'))(new Redis(config[_0x90db('0x19')]));require(_0x90db('0x1d'))[_0x90db('0x1e')](socket);var jayson=require(_0x90db('0x1f'));var client=jayson[_0x90db('0x20')][_0x90db('0x21')]({'port':0x232c});var client9002=jayson[_0x90db('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3124d4,_0x5ef456,_0x101a71,_0x266c19){return new BPromise(function(_0x3de860,_0x1bbb97){var _0x32ff04=_0x266c19||client;return _0x32ff04[_0x90db('0x22')](_0x3124d4,_0x101a71)[_0x90db('0x23')](function(_0x43f40b){logger[_0x90db('0x24')](_0x90db('0x25'),_0x5ef456,'request\x20sent');logger[_0x90db('0x26')](_0x90db('0x27'),_0x5ef456,'request\x20sent',JSON['stringify'](_0x43f40b));if(_0x43f40b[_0x90db('0x28')]){if(_0x43f40b[_0x90db('0x28')][_0x90db('0x29')]===0x1f4){logger[_0x90db('0x28')](_0x90db('0x25'),_0x5ef456,_0x43f40b[_0x90db('0x28')][_0x90db('0x2a')]);return _0x1bbb97(_0x43f40b['error'][_0x90db('0x2a')]);}logger[_0x90db('0x28')](_0x90db('0x25'),_0x5ef456,_0x43f40b[_0x90db('0x28')]['message']);return _0x3de860(_0x43f40b[_0x90db('0x28')]['message']);}else{logger[_0x90db('0x24')](_0x90db('0x25'),_0x5ef456,'request\x20sent');_0x3de860(_0x43f40b[_0x90db('0x2b')][_0x90db('0x2a')]);}})['catch'](function(_0x2f8469){logger[_0x90db('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x5ef456,_0x2f8469);_0x1bbb97(_0x2f8469);});});}function respondWithStatusCode(_0x1f02a6,_0xe026cf){_0xe026cf=_0xe026cf||0xcc;return function(_0x1cc660){if(_0x1cc660){return _0x1f02a6[_0x90db('0x2c')](_0xe026cf);}return _0x1f02a6['status'](_0xe026cf)[_0x90db('0x2d')]();};}function respondWithResult(_0x3e6200,_0x60439d){_0x60439d=_0x60439d||0xc8;return function(_0x27bd58){if(_0x27bd58){return _0x3e6200[_0x90db('0x2e')](_0x60439d)[_0x90db('0x2f')](_0x27bd58);}};}function respondWithFilteredResult(_0x44b5b6,_0x3c7f67){return function(_0x4c6311){if(_0x4c6311){var _0x3489d1=typeof _0x3c7f67['offset']===_0x90db('0x30')&&typeof _0x3c7f67[_0x90db('0x31')]==='undefined';var _0x116635=_0x4c6311[_0x90db('0x32')];var _0x2e9235=_0x3489d1?0x0:_0x3c7f67[_0x90db('0x33')];var _0x4c3dfa=_0x3489d1?_0x4c6311[_0x90db('0x32')]:_0x3c7f67[_0x90db('0x33')]+_0x3c7f67[_0x90db('0x31')];var _0x5ebe85;if(_0x4c3dfa>=_0x116635){_0x4c3dfa=_0x116635;_0x5ebe85=0xc8;}else{_0x5ebe85=0xce;}_0x44b5b6['status'](_0x5ebe85);return _0x44b5b6[_0x90db('0x34')](_0x90db('0x35'),_0x2e9235+'-'+_0x4c3dfa+'/'+_0x116635)[_0x90db('0x2f')](_0x4c6311);}return null;};}function patchUpdates(_0x4b3e47){return function(_0x418df9){try{jsonpatch[_0x90db('0x36')](_0x418df9,_0x4b3e47,!![]);}catch(_0x5322e4){return BPromise[_0x90db('0x37')](_0x5322e4);}return _0x418df9[_0x90db('0x38')]();};}function saveUpdates(_0x53b0a6,_0x21078f){return function(_0x1d94c2){if(_0x1d94c2){return _0x1d94c2[_0x90db('0x39')](_0x53b0a6)[_0x90db('0x23')](function(_0x58cf68){return _0x58cf68;});}return null;};}function removeEntity(_0x4f887b,_0x201eff){return function(_0x5ac04d){if(_0x5ac04d){return _0x5ac04d[_0x90db('0x3a')]()[_0x90db('0x23')](function(){_0x4f887b[_0x90db('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b71d8,_0x50847a){return function(_0x143561){if(!_0x143561){_0x3b71d8[_0x90db('0x2c')](0x194);}return _0x143561;};}function handleError(_0x57f519,_0x695387){_0x695387=_0x695387||0x1f4;return function(_0x2b4794){logger[_0x90db('0x28')](_0x2b4794[_0x90db('0x3b')]);if(_0x2b4794[_0x90db('0x3c')]){delete _0x2b4794[_0x90db('0x3c')];}_0x57f519['status'](_0x695387)[_0x90db('0x3d')](_0x2b4794);};}exports[_0x90db('0x3e')]=function(_0x4d04a1,_0x13be41){var _0x144c48={},_0x4492e0={},_0x58eda8={'count':0x0,'rows':[]};var _0x108833=_[_0x90db('0x3f')](db['WhatsappMessage']['rawAttributes'],function(_0x57c06b){return{'name':_0x57c06b['fieldName'],'type':_0x57c06b[_0x90db('0x40')][_0x90db('0x41')]};});_0x4492e0[_0x90db('0x42')]=_['map'](_0x108833,'name');_0x4492e0[_0x90db('0x43')]=_[_0x90db('0x44')](_0x4d04a1['query']);_0x4492e0[_0x90db('0x45')]=_['intersection'](_0x4492e0[_0x90db('0x42')],_0x4492e0[_0x90db('0x43')]);_0x144c48[_0x90db('0x46')]=_[_0x90db('0x47')](_0x4492e0[_0x90db('0x42')],qs[_0x90db('0x48')](_0x4d04a1[_0x90db('0x43')][_0x90db('0x48')]));_0x144c48[_0x90db('0x46')]=_0x144c48['attributes'][_0x90db('0x49')]?_0x144c48[_0x90db('0x46')]:_0x4492e0[_0x90db('0x42')];if(!_0x4d04a1[_0x90db('0x43')][_0x90db('0x4a')]('nolimit')){_0x144c48['limit']=qs[_0x90db('0x31')](_0x4d04a1['query'][_0x90db('0x31')]);_0x144c48[_0x90db('0x33')]=qs[_0x90db('0x33')](_0x4d04a1[_0x90db('0x43')][_0x90db('0x33')]);}_0x144c48['order']=qs['sort'](_0x4d04a1['query'][_0x90db('0x4b')]);_0x144c48[_0x90db('0x4c')]=qs[_0x90db('0x45')](_['pick'](_0x4d04a1[_0x90db('0x43')],_0x4492e0[_0x90db('0x45')]),_0x108833);if(_0x4d04a1[_0x90db('0x43')][_0x90db('0x4d')]){_0x144c48['where']=_[_0x90db('0x4e')](_0x144c48[_0x90db('0x4c')],{'$or':_[_0x90db('0x3f')](_0x108833,function(_0x5fa064){if(_0x5fa064['type']!=='VIRTUAL'){var _0xf7b4ae={};_0xf7b4ae[_0x5fa064[_0x90db('0x3c')]]={'$like':'%'+_0x4d04a1[_0x90db('0x43')][_0x90db('0x4d')]+'%'};return _0xf7b4ae;}})});}_0x144c48=_['merge']({},_0x144c48,_0x4d04a1[_0x90db('0x4f')]);var _0x5b8124={'where':_0x144c48[_0x90db('0x4c')]};return db[_0x90db('0x50')]['count'](_0x5b8124)[_0x90db('0x23')](function(_0x1adc8c){_0x58eda8[_0x90db('0x32')]=_0x1adc8c;if(_0x4d04a1[_0x90db('0x43')][_0x90db('0x51')]){_0x144c48[_0x90db('0x52')]=[{'all':!![]}];}return db[_0x90db('0x50')][_0x90db('0x53')](_0x144c48);})[_0x90db('0x23')](function(_0x33798f){_0x58eda8[_0x90db('0x54')]=_0x33798f;return _0x58eda8;})['then'](respondWithFilteredResult(_0x13be41,_0x144c48))[_0x90db('0x55')](handleError(_0x13be41,null));};exports[_0x90db('0x56')]=function(_0x40f958,_0x6f5fb3){var _0x128994={'raw':!![],'where':{'id':_0x40f958[_0x90db('0x57')]['id']}},_0x36c5f5={};_0x36c5f5[_0x90db('0x42')]=_[_0x90db('0x44')](db[_0x90db('0x50')][_0x90db('0x58')]);_0x36c5f5[_0x90db('0x43')]=_['keys'](_0x40f958[_0x90db('0x43')]);_0x36c5f5['filters']=_[_0x90db('0x47')](_0x36c5f5[_0x90db('0x42')],_0x36c5f5[_0x90db('0x43')]);_0x128994[_0x90db('0x46')]=_[_0x90db('0x47')](_0x36c5f5['model'],qs[_0x90db('0x48')](_0x40f958[_0x90db('0x43')][_0x90db('0x48')]));_0x128994['attributes']=_0x128994[_0x90db('0x46')]['length']?_0x128994['attributes']:_0x36c5f5[_0x90db('0x42')];if(_0x40f958[_0x90db('0x43')][_0x90db('0x51')]){_0x128994[_0x90db('0x52')]=[{'all':!![]}];}_0x128994=_[_0x90db('0x4e')]({},_0x128994,_0x40f958[_0x90db('0x4f')]);return db['WhatsappMessage']['find'](_0x128994)[_0x90db('0x23')](handleEntityNotFound(_0x6f5fb3,null))[_0x90db('0x23')](respondWithResult(_0x6f5fb3,null))[_0x90db('0x55')](handleError(_0x6f5fb3,null));};exports[_0x90db('0x59')]=function(_0x67010a,_0xf83f99){return db[_0x90db('0x50')][_0x90db('0x59')](_0x67010a[_0x90db('0x5a')],{})[_0x90db('0x23')](respondWithResult(_0xf83f99,0xc9))[_0x90db('0x55')](handleError(_0xf83f99,null));};exports[_0x90db('0x39')]=function(_0x1eb7c8,_0x160d26){if(_0x1eb7c8[_0x90db('0x5a')]['id']){delete _0x1eb7c8[_0x90db('0x5a')]['id'];}return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x1eb7c8[_0x90db('0x57')]['id']}})[_0x90db('0x23')](handleEntityNotFound(_0x160d26,null))[_0x90db('0x23')](saveUpdates(_0x1eb7c8[_0x90db('0x5a')],null))['then'](respondWithResult(_0x160d26,null))[_0x90db('0x55')](handleError(_0x160d26,null));};exports[_0x90db('0x3a')]=function(_0x305d67,_0x4317e2){return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x305d67[_0x90db('0x57')]['id']}})[_0x90db('0x23')](handleEntityNotFound(_0x4317e2,null))[_0x90db('0x23')](removeEntity(_0x4317e2,null))[_0x90db('0x55')](handleError(_0x4317e2,null));};exports[_0x90db('0x5c')]=function(_0x2636f5,_0x22a137){return db[_0x90db('0x50')][_0x90db('0x5c')]()[_0x90db('0x23')](respondWithResult(_0x22a137,null))[_0x90db('0x55')](handleError(_0x22a137,null));};var interaction_log=require(_0x90db('0x14'))(_0x90db('0x5d'));exports[_0x90db('0x5e')]=function(_0x59c99f,_0x6fc0ed,_0x2064f0){var _0x571b0d={'agent':{},'channel':'whatsapp'};if(_0x59c99f[_0x90db('0x5a')]['id']){delete _0x59c99f[_0x90db('0x5a')]['id'];}_0x59c99f['body'][_0x90db('0x5f')]=!![];_0x59c99f['body']['readAt']=moment()[_0x90db('0x60')](_0x90db('0x61'));_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')]=_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')]||_0x59c99f[_0x90db('0x63')]['id'];_0x571b0d[_0x90db('0x64')]['id']=_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')];return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x59c99f['params']['id'],'UserId':null}})[_0x90db('0x23')](handleEntityNotFound(_0x6fc0ed,null))['then'](saveUpdates(_0x59c99f[_0x90db('0x5a')],null))['then'](function(_0x159ac9){if(_0x159ac9){_0x571b0d[_0x90db('0x2a')]=_0x159ac9[_0x90db('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0x90db('0x5b')]({'where':{'id':_0x159ac9['WhatsappInteractionId']}});}return null;})[_0x90db('0x23')](handleEntityNotFound(_0x6fc0ed,null))[_0x90db('0x23')](function(_0x547134){if(_0x547134){return _0x547134[_0x90db('0x39')]({'UserId':_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')],'read1stAt':_['isNil'](_0x547134[_0x90db('0x66')])?moment()[_0x90db('0x60')](_0x90db('0x61')):undefined});}return null;})[_0x90db('0x23')](function(_0x47e743){if(_0x47e743){_0x571b0d['interaction']=_0x47e743['get']({'plain':!![]});interaction_log[_0x90db('0x24')](_0x90db('0x67'),_0x59c99f[_0x90db('0x63')]['id'],_0x59c99f[_0x90db('0x63')][_0x90db('0x3c')],_0x59c99f[_0x90db('0x63')]['role'],_0x571b0d[_0x90db('0x68')]['id'],_0x59c99f[_0x90db('0x5a')]?JSON[_0x90db('0x69')](_0x59c99f[_0x90db('0x5a')]):_0x90db('0x6a'));return respondWithRpcPromise(_0x90db('0x6b'),_0x90db('0x6c'),_0x571b0d);}return null;})[_0x90db('0x23')](function(_0x238c3f){var _0x5e581e=_0x90db('0x6d')+_0x238c3f[_0x90db('0x2a')][_0x90db('0x6e')];return db[_0x90db('0x6f')]['query'](_0x5e581e,{'type':db[_0x90db('0x70')][_0x90db('0x71')][_0x90db('0x72')],'raw':!![]})['then'](function(_0x195a3d){return _0x195a3d;});})['then'](function(_0x35185c){if(_0x35185c){_0x571b0d[_0x90db('0x2a')]['contact']=_0x35185c[0x0];if(!_0x59c99f[_0x90db('0x5a')]['UserId'])return;return db[_0x90db('0x73')][_0x90db('0x5b')]({'where':{'id':_0x59c99f[_0x90db('0x5a')][_0x90db('0x62')],'role':'agent'},'attributes':['id',_0x90db('0x3c'),_0x90db('0x74'),_0x90db('0x75'),'internal'],'raw':!![]});}return null;})[_0x90db('0x23')](function(_0x379ec2){if(!_0x379ec2)return null;_0x571b0d[_0x90db('0x2a')][_0x90db('0x64')]=_0x379ec2;return _0x571b0d;})[_0x90db('0x23')](function(_0x15e2f3){if(_0x15e2f3){if(_0x59c99f[_0x90db('0x5a')][_0x90db('0x76')]){_0x571b0d[_0x90db('0x2a')][_0x90db('0x77')]=util[_0x90db('0x60')](_0x90db('0x78'),_0x59c99f[_0x90db('0x63')][_0x90db('0x3c')]);_0x571b0d[_0x90db('0x2a')]['channel']=_0x571b0d[_0x90db('0x79')];_0x571b0d[_0x90db('0x2a')]['event']=_0x90db('0x5e');return respondWithRpcPromise(_0x90db('0x7a'),'EventManager',{'event':_0x90db('0x7b'),'message':_0x571b0d[_0x90db('0x2a')]},client9002)[_0x90db('0x23')](function(){return _0x571b0d;});}return _0x571b0d;}return null;})[_0x90db('0x23')](respondWithResult(_0x6fc0ed,null))[_0x90db('0x55')](handleError(_0x6fc0ed,null));};var interaction_log=require(_0x90db('0x14'))(_0x90db('0x5d'));exports['reject']=function(_0x235035,_0x46023c,_0xe7b1a7){var _0x437f15={'agent':{},'channel':_0x90db('0x7c')};if(_0x235035[_0x90db('0x5a')]['id']){delete _0x235035[_0x90db('0x5a')]['id'];}_0x235035[_0x90db('0x5a')]['UserId']=_0x235035[_0x90db('0x5a')][_0x90db('0x62')]||_0x235035[_0x90db('0x63')]['id'];_0x437f15[_0x90db('0x64')]['id']=_0x235035[_0x90db('0x5a')][_0x90db('0x62')];return db[_0x90db('0x50')][_0x90db('0x5b')]({'where':{'id':_0x235035[_0x90db('0x57')]['id'],'UserId':null}})[_0x90db('0x23')](handleEntityNotFound(_0x46023c,null))[_0x90db('0x23')](function(_0x90a2a8){if(_0x90a2a8){_0x437f15['message']=_0x90a2a8['get']({'plain':!![]});return db[_0x90db('0x7d')][_0x90db('0x5b')]({'where':{'id':_0x90a2a8[_0x90db('0x7e')]}});}return null;})[_0x90db('0x23')](handleEntityNotFound(_0x46023c,null))['then'](function(_0x3f1afd){if(_0x3f1afd){_0x437f15[_0x90db('0x68')]=_0x3f1afd[_0x90db('0x65')]({'plain':!![]});interaction_log[_0x90db('0x24')](_0x90db('0x7f'),_0x235035['user']['id'],_0x235035[_0x90db('0x63')][_0x90db('0x3c')],_0x235035[_0x90db('0x63')][_0x90db('0x80')],_0x437f15[_0x90db('0x68')]['id'],_0x235035[_0x90db('0x5a')]?JSON[_0x90db('0x69')](_0x235035[_0x90db('0x5a')]):_0x90db('0x6a'));return respondWithRpcPromise(_0x90db('0x81'),_0x90db('0x82'),_0x437f15);}return null;})[_0x90db('0x23')](function(_0x3b6539){var _0x18b51c=_0x90db('0x6d')+_0x3b6539[_0x90db('0x2a')][_0x90db('0x6e')];return db[_0x90db('0x6f')]['query'](_0x18b51c,{'type':db['Sequelize']['QueryTypes'][_0x90db('0x72')],'raw':!![]})[_0x90db('0x23')](function(_0x262d47){return _0x262d47;});})[_0x90db('0x23')](function(_0x169491){if(_0x169491){_0x437f15[_0x90db('0x2a')]['contact']=_0x169491[0x0];if(!_0x235035[_0x90db('0x5a')][_0x90db('0x62')])return;return db[_0x90db('0x73')]['find']({'where':{'id':_0x235035[_0x90db('0x5a')]['UserId'],'role':'agent'},'attributes':['id',_0x90db('0x3c'),_0x90db('0x74'),'email',_0x90db('0x83')],'raw':!![]});}return null;})[_0x90db('0x23')](function(_0x2b46ed){if(!_0x2b46ed)return null;_0x437f15[_0x90db('0x2a')]['agent']=_0x2b46ed;return _0x437f15;})[_0x90db('0x23')](function(_0x1c57fd){if(_0x1c57fd){_0x1c57fd['message'][_0x90db('0x77')]=util[_0x90db('0x60')](_0x90db('0x78'),_0x235035[_0x90db('0x63')][_0x90db('0x3c')]);_0x1c57fd[_0x90db('0x2a')][_0x90db('0x79')]=_0x437f15[_0x90db('0x79')];_0x1c57fd['message']['event']=_0x90db('0x37');respondWithRpcPromise(_0x90db('0x7a'),_0x90db('0x7a'),{'event':_0x90db('0x84'),'message':_0x1c57fd['message']},client9002);return _0x437f15;}return null;})['then'](respondWithResult(_0x46023c,null))['catch'](handleError(_0x46023c,null));};exports[_0x90db('0x2e')]=function(_0x1f7a30,_0x1d41a7,_0x30c4bc){if(_0x1f7a30['body']['id']){delete _0x1f7a30[_0x90db('0x5a')]['id'];}var _0x2df660;return db['WhatsappMessage'][_0x90db('0x5b')]({'where':{'id':_0x1f7a30[_0x90db('0x57')]['id']}})[_0x90db('0x23')](handleEntityNotFound(_0x1d41a7,null))['then'](function(_0x3cf6fc){if(_0x3cf6fc){_0x2df660=_0x3cf6fc;return db[_0x90db('0x85')][_0x90db('0x5b')]({'where':{'id':_0x3cf6fc[_0x90db('0x86')]}});}})[_0x90db('0x23')](handleEntityNotFound(_0x1d41a7,null))[_0x90db('0x23')](function(_0x1d48d2){if(_0x1d48d2){logger[_0x90db('0x26')](_0x90db('0x87'),_0x90db('0x2e'),_0x90db('0x88'),_0x1d48d2['type'],util['inspect'](_0x1f7a30[_0x90db('0x5a')],{'showHidden':![],'depth':null}));switch(_0x1d48d2['type']){case _0x90db('0x89'):if(_0x1f7a30[_0x90db('0x5a')][_0x90db('0x8a')]&&_0x1f7a30['body'][_0x90db('0x8a')]===_0x2df660[_0x90db('0x8b')]&&_0x1f7a30[_0x90db('0x5a')][_0x90db('0x8c')]&&_0x1f7a30['body']['MessageStatus']===_0x90db('0x5f')){return _0x2df660[_0x90db('0x39')]({'read':!![]});}else{logger[_0x90db('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x90db('0x89'),util[_0x90db('0x8d')](_0x1f7a30[_0x90db('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x2df660;}})[_0x90db('0x23')](respondWithResult(_0x1d41a7,null))['catch'](handleError(_0x1d41a7,null));};
\ No newline at end of file
index 9afc53f..79150d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb574=['setMaxListeners','save','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x12eb87,_0x78b4ec){var _0x1310d7=function(_0x12e294){while(--_0x12e294){_0x12eb87['push'](_0x12eb87['shift']());}};_0x1310d7(++_0x78b4ec);}(_0xb574,0x106));var _0x4b57=function(_0x5e12f5,_0x11cab6){_0x5e12f5=_0x5e12f5-0x0;var _0x2d4617=_0xb574[_0x5e12f5];return _0x2d4617;};'use strict';var EventEmitter=require(_0x4b57('0x0'));var WhatsappMessage=require(_0x4b57('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4b57('0x2')](0x0);var events={'afterCreate':_0x4b57('0x3'),'afterUpdate':'update','afterDestroy':_0x4b57('0x4')};function emitEvent(_0x1c9d28){return function(_0x168524,_0x919851,_0xe2ae86){WhatsappMessageEvents['emit'](_0x1c9d28+':'+_0x168524['id'],_0x168524);WhatsappMessageEvents['emit'](_0x1c9d28,_0x168524);_0xe2ae86(null);};}for(var e in events){if(events[_0x4b57('0x5')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xfc03=['emit','hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','update'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0xfc03,0x16f));var _0x3fc0=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xfc03[_0x346737];return _0x1ade2e;};'use strict';var EventEmitter=require(_0x3fc0('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x3fc0('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3fc0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fc0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13c308){return function(_0x1eeb62,_0x390f7e,_0x29d814){WhatsappMessageEvents[_0x3fc0('0x4')](_0x13c308+':'+_0x1eeb62['id'],_0x1eeb62);WhatsappMessageEvents[_0x3fc0('0x4')](_0x13c308,_0x1eeb62);_0x29d814(null);};}for(var e in events){if(events[_0x3fc0('0x5')](e)){var event=events[e];WhatsappMessage[_0x3fc0('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index 91c6304..46954fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa668=['catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','FULLTEXT','direction','toLowerCase','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccount','find','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xa668,0xec));var _0x8a66=function(_0x2617ee,_0xe08c15){_0x2617ee=_0x2617ee-0x0;var _0x3e6a64=_0xa668[_0x2617ee];return _0x3e6a64;};'use strict';var _=require(_0x8a66('0x0'));var util=require(_0x8a66('0x1'));var logger=require(_0x8a66('0x2'))(_0x8a66('0x3'));var moment=require(_0x8a66('0x4'));var BPromise=require(_0x8a66('0x5'));var rp=require(_0x8a66('0x6'));var fs=require('fs');var path=require(_0x8a66('0x7'));var rimraf=require(_0x8a66('0x8'));var config=require('../../config/environment');var attributes=require(_0x8a66('0x9'));module[_0x8a66('0xa')]=function(_0x126864,_0x40a2ed){return _0x126864[_0x8a66('0xb')](_0x8a66('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x8a66('0xd'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x8a66('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b3791,_0x11de22,_0x3c884a){var _0xd9f4ab=_0x126864['models'];var _0x7a36c4=_0x5b3791['get']({'plain':!![]});if(_0x7a36c4[_0x8a66('0xf')]['toLowerCase']()==='in'||_0x7a36c4['direction'][_0x8a66('0x10')]()==='out'&&!_0x7a36c4[_0x8a66('0x11')]&&!_[_0x8a66('0x12')](_0x7a36c4[_0x8a66('0x13')])){_0xd9f4ab['WhatsappInteraction'][_0x8a66('0x14')]({'where':{'id':_0x7a36c4[_0x8a66('0x15')]}})[_0x8a66('0x16')](function(_0x106b6a){if(_0x106b6a){_0x106b6a[_0x8a66('0x17')]({'lastMsgAt':_0x7a36c4[_0x8a66('0x18')],'lastMsgDirection':_0x7a36c4[_0x8a66('0xf')][_0x8a66('0x10')]()});}})['catch'](function(_0x38e846){console[_0x8a66('0x19')](_0x38e846);});}if(_0x7a36c4['direction']==='out'&&!_0x7a36c4[_0x8a66('0x11')]){var _0x1368f1;_0xd9f4ab[_0x8a66('0x1a')][_0x8a66('0x1b')]({'where':{'id':_0x7a36c4['WhatsappAccountId']},'raw':!![]})[_0x8a66('0x16')](function(_0x539834){_0x1368f1=_0x539834;if(_0x1368f1&&_0x1368f1[_0x8a66('0x1c')]){switch(_0x1368f1[_0x8a66('0x1c')]){case _0x8a66('0x1d'):var _0x262401=require(_0x8a66('0x1d'));if(_0x1368f1[_0x8a66('0x1e')]&&_0x1368f1[_0x8a66('0x1f')]&&_0x1368f1[_0x8a66('0x20')]){var _0x315d44=new _0x262401(_0x1368f1[_0x8a66('0x1e')],_0x1368f1[_0x8a66('0x1f')]);_0x315d44[_0x8a66('0x21')]['create']({'body':_0x7a36c4[_0x8a66('0x22')],'to':_0x8a66('0x23')+_0x7a36c4[_0x8a66('0x20')],'from':'whatsapp:'+_0x1368f1['phone'],'statusCallback':_0x1368f1[_0x8a66('0x24')]+_0x8a66('0x25')+_0x7a36c4['id']+'/status?token='+_0x1368f1[_0x8a66('0x26')]})[_0x8a66('0x16')](function(_0x28b6fd){if(_0x28b6fd[_0x8a66('0x27')]){return _0x5b3791[_0x8a66('0x17')]({'messageId':_0x28b6fd[_0x8a66('0x27')]});}})[_0x8a66('0x28')](function(_0x4d6e99){logger['error'](_0x8a66('0x29'),_0x8a66('0x2a'),_0x8a66('0x1d'),util[_0x8a66('0x2b')](_0x4d6e99,{'showHidden':![],'depth':null}));});}else{logger[_0x8a66('0x19')](_0x8a66('0x29'),_0x8a66('0x2a'),_0x8a66('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x8a66('0x2c')](function(){_0x3c884a();});}else{_0x3c884a();}}},'charset':_0x8a66('0x2d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6eb6=['FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','update','createdAt','error','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','body'];(function(_0x1c430a,_0x14b71c){var _0x28e625=function(_0x535c34){while(--_0x535c34){_0x1c430a['push'](_0x1c430a['shift']());}};_0x28e625(++_0x14b71c);}(_0x6eb6,0x1bf));var _0x66eb=function(_0x442fdc,_0x2007d1){_0x442fdc=_0x442fdc-0x0;var _0x20f6ec=_0x6eb6[_0x442fdc];return _0x20f6ec;};'use strict';var _=require(_0x66eb('0x0'));var util=require(_0x66eb('0x1'));var logger=require('../../config/logger')(_0x66eb('0x2'));var moment=require(_0x66eb('0x3'));var BPromise=require(_0x66eb('0x4'));var rp=require(_0x66eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66eb('0x6'));var config=require(_0x66eb('0x7'));var attributes=require(_0x66eb('0x8'));module[_0x66eb('0x9')]=function(_0xb8928e,_0x79eb75){return _0xb8928e['define'](_0x66eb('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x66eb('0xb'),'fields':[_0x66eb('0xb')]},{'name':'fti_whatsapp_messages','fields':[_0x66eb('0xc')],'type':_0x66eb('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e9bf0,_0x344c27,_0x4b792f){var _0x16bff1=_0xb8928e[_0x66eb('0xe')];var _0x123fcd=_0x2e9bf0['get']({'plain':!![]});if(_0x123fcd[_0x66eb('0xf')][_0x66eb('0x10')]()==='in'||_0x123fcd[_0x66eb('0xf')][_0x66eb('0x10')]()===_0x66eb('0x11')&&!_0x123fcd[_0x66eb('0x12')]&&!_[_0x66eb('0x13')](_0x123fcd[_0x66eb('0x14')])){_0x16bff1[_0x66eb('0x15')]['findOne']({'where':{'id':_0x123fcd['WhatsappInteractionId']}})[_0x66eb('0x16')](function(_0x410dee){if(_0x410dee){_0x410dee[_0x66eb('0x17')]({'lastMsgAt':_0x123fcd[_0x66eb('0x18')],'lastMsgDirection':_0x123fcd[_0x66eb('0xf')][_0x66eb('0x10')]()});}})['catch'](function(_0x255584){console[_0x66eb('0x19')](_0x255584);});}if(_0x123fcd[_0x66eb('0xf')]===_0x66eb('0x11')&&!_0x123fcd[_0x66eb('0x12')]){var _0x48a8d8;_0x16bff1['WhatsappAccount']['find']({'where':{'id':_0x123fcd[_0x66eb('0x1a')]},'raw':!![]})['then'](function(_0xb246ce){_0x48a8d8=_0xb246ce;if(_0x48a8d8&&_0x48a8d8[_0x66eb('0x1b')]){switch(_0x48a8d8[_0x66eb('0x1b')]){case _0x66eb('0x1c'):var _0x443bdb=require(_0x66eb('0x1c'));if(_0x48a8d8[_0x66eb('0x1d')]&&_0x48a8d8['authToken']&&_0x48a8d8['phone']){var _0x472f9f=new _0x443bdb(_0x48a8d8[_0x66eb('0x1d')],_0x48a8d8[_0x66eb('0x1e')]);_0x472f9f[_0x66eb('0x1f')][_0x66eb('0x20')]({'body':_0x123fcd[_0x66eb('0xc')],'to':'whatsapp:'+_0x123fcd['phone'],'from':_0x66eb('0x21')+_0x48a8d8[_0x66eb('0x22')],'statusCallback':_0x48a8d8[_0x66eb('0x23')]+_0x66eb('0x24')+_0x123fcd['id']+_0x66eb('0x25')+_0x48a8d8[_0x66eb('0x26')]})[_0x66eb('0x16')](function(_0x369250){if(_0x369250[_0x66eb('0x27')]){return _0x2e9bf0[_0x66eb('0x17')]({'messageId':_0x369250[_0x66eb('0x27')]});}})[_0x66eb('0x28')](function(_0xe6a2d9){logger[_0x66eb('0x19')](_0x66eb('0x29'),_0x66eb('0x2a'),_0x66eb('0x1c'),util[_0x66eb('0x2b')](_0xe6a2d9,{'showHidden':![],'depth':null}));});}else{logger[_0x66eb('0x19')](_0x66eb('0x29'),_0x66eb('0x2a'),_0x66eb('0x1c'),_0x66eb('0x2c'));}break;}}})['finally'](function(){_0x4b792f();});}else{_0x4b792f();}}},'charset':'utf8mb4','collate':_0x66eb('0x2d')});};
\ No newline at end of file
index 7cbada4..2891f73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d64=['WhatsappMessage','create','body','options','raw','CreateWhatsappMessage','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x489ce0,_0x430ed1){var _0x228970=function(_0x25eb69){while(--_0x25eb69){_0x489ce0['push'](_0x489ce0['shift']());}};_0x228970(++_0x430ed1);}(_0x5d64,0x73));var _0x45d6=function(_0x221cc9,_0x153189){_0x221cc9=_0x221cc9-0x0;var _0x4f17d7=_0x5d64[_0x221cc9];return _0x4f17d7;};'use strict';var _=require(_0x45d6('0x0'));var util=require(_0x45d6('0x1'));var moment=require(_0x45d6('0x2'));var BPromise=require(_0x45d6('0x3'));var rs=require(_0x45d6('0x4'));var fs=require('fs');var Redis=require(_0x45d6('0x5'));var db=require(_0x45d6('0x6'))['db'];var utils=require(_0x45d6('0x7'));var logger=require(_0x45d6('0x8'))('rpc');var config=require(_0x45d6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45d6('0xa')][_0x45d6('0xb')]({'port':0x232a});config[_0x45d6('0xc')]=_[_0x45d6('0xd')](config[_0x45d6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x45d6('0xe'))(new Redis(config[_0x45d6('0xc')]));require(_0x45d6('0xf'))[_0x45d6('0x10')](socket);function respondWithRpcPromise(_0x109366,_0x3b9a85,_0x28187f){return new BPromise(function(_0x4f0878,_0x3660ac){return client[_0x45d6('0x11')](_0x109366,_0x28187f)[_0x45d6('0x12')](function(_0xab708b){logger[_0x45d6('0x13')](_0x45d6('0x14'),_0x3b9a85,_0x45d6('0x15'));logger['debug'](_0x45d6('0x16'),_0x3b9a85,_0x45d6('0x15'),JSON[_0x45d6('0x17')](_0xab708b));if(_0xab708b[_0x45d6('0x18')]){if(_0xab708b[_0x45d6('0x18')][_0x45d6('0x19')]===0x1f4){logger['error'](_0x45d6('0x14'),_0x3b9a85,_0xab708b[_0x45d6('0x18')][_0x45d6('0x1a')]);return _0x3660ac(_0xab708b[_0x45d6('0x18')][_0x45d6('0x1a')]);}logger[_0x45d6('0x18')](_0x45d6('0x14'),_0x3b9a85,_0xab708b[_0x45d6('0x18')][_0x45d6('0x1a')]);return _0x4f0878(_0xab708b[_0x45d6('0x18')][_0x45d6('0x1a')]);}else{logger[_0x45d6('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x3b9a85,'request\x20sent');_0x4f0878(_0xab708b[_0x45d6('0x1b')][_0x45d6('0x1a')]);}})[_0x45d6('0x1c')](function(_0x13ead2){logger[_0x45d6('0x18')](_0x45d6('0x14'),_0x3b9a85,_0x13ead2);_0x3660ac(_0x13ead2);});});}exports['CreateWhatsappMessage']=function(_0x86049d){var _0x2c9b2b=this;return new Promise(function(_0x4fdae2,_0x717bfd){return db[_0x45d6('0x1d')][_0x45d6('0x1e')](_0x86049d[_0x45d6('0x1f')],{'raw':_0x86049d[_0x45d6('0x20')]?_0x86049d[_0x45d6('0x20')][_0x45d6('0x21')]===undefined?!![]:![]:!![]})[_0x45d6('0x12')](function(_0x2944b2){logger[_0x45d6('0x13')](_0x45d6('0x22'),_0x86049d);logger[_0x45d6('0x23')](_0x45d6('0x22'),_0x86049d,JSON[_0x45d6('0x17')](_0x2944b2));_0x4fdae2(_0x2944b2);})[_0x45d6('0x1c')](function(_0x59955b){logger['error']('CreateWhatsappMessage',_0x59955b[_0x45d6('0x1a')],_0x86049d);_0x717bfd(_0x2c9b2b[_0x45d6('0x18')](0x1f4,_0x59955b[_0x45d6('0x1a')]));});});};
\ No newline at end of file
+var _0x8662=['catch','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','WhatsappMessage','create','body','options','raw','debug','CreateWhatsappMessage'];(function(_0x22c0e5,_0x21ba80){var _0x4c8935=function(_0x3bb825){while(--_0x3bb825){_0x22c0e5['push'](_0x22c0e5['shift']());}};_0x4c8935(++_0x21ba80);}(_0x8662,0x7d));var _0x2866=function(_0x8b56df,_0x4f8452){_0x8b56df=_0x8b56df-0x0;var _0x33f8d9=_0x8662[_0x8b56df];return _0x33f8d9;};'use strict';var _=require('lodash');var util=require(_0x2866('0x0'));var moment=require('moment');var BPromise=require(_0x2866('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2866('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2866('0x3'));var logger=require('../../config/logger')(_0x2866('0x4'));var config=require(_0x2866('0x5'));var jayson=require(_0x2866('0x6'));var client=jayson['client'][_0x2866('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2866('0x8')],{'host':_0x2866('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2866('0x8')]));require(_0x2866('0xa'))[_0x2866('0xb')](socket);function respondWithRpcPromise(_0xec3a74,_0x1e0ccb,_0x5e60fe){return new BPromise(function(_0x2aa6ff,_0x398bc5){return client[_0x2866('0xc')](_0xec3a74,_0x5e60fe)[_0x2866('0xd')](function(_0x236ec1){logger[_0x2866('0xe')]('WhatsappMessage,\x20%s,\x20%s',_0x1e0ccb,_0x2866('0xf'));logger['debug'](_0x2866('0x10'),_0x1e0ccb,_0x2866('0xf'),JSON[_0x2866('0x11')](_0x236ec1));if(_0x236ec1[_0x2866('0x12')]){if(_0x236ec1[_0x2866('0x12')][_0x2866('0x13')]===0x1f4){logger[_0x2866('0x12')](_0x2866('0x14'),_0x1e0ccb,_0x236ec1[_0x2866('0x12')]['message']);return _0x398bc5(_0x236ec1['error'][_0x2866('0x15')]);}logger[_0x2866('0x12')](_0x2866('0x14'),_0x1e0ccb,_0x236ec1['error'][_0x2866('0x15')]);return _0x2aa6ff(_0x236ec1[_0x2866('0x12')][_0x2866('0x15')]);}else{logger['info'](_0x2866('0x14'),_0x1e0ccb,_0x2866('0xf'));_0x2aa6ff(_0x236ec1[_0x2866('0x16')][_0x2866('0x15')]);}})['catch'](function(_0x28682f){logger[_0x2866('0x12')](_0x2866('0x14'),_0x1e0ccb,_0x28682f);_0x398bc5(_0x28682f);});});}exports['CreateWhatsappMessage']=function(_0x2650f6){var _0x53cecf=this;return new Promise(function(_0x59490a,_0x23bf03){return db[_0x2866('0x17')][_0x2866('0x18')](_0x2650f6[_0x2866('0x19')],{'raw':_0x2650f6[_0x2866('0x1a')]?_0x2650f6[_0x2866('0x1a')][_0x2866('0x1b')]===undefined?!![]:![]:!![]})[_0x2866('0xd')](function(_0x449111){logger['info']('CreateWhatsappMessage',_0x2650f6);logger[_0x2866('0x1c')](_0x2866('0x1d'),_0x2650f6,JSON[_0x2866('0x11')](_0x449111));_0x59490a(_0x449111);})[_0x2866('0x1e')](function(_0x58a6de){logger[_0x2866('0x12')]('CreateWhatsappMessage',_0x58a6de[_0x2866('0x15')],_0x2650f6);_0x23bf03(_0x53cecf['error'](0x1f4,_0x58a6de['message']));});});};
\ No newline at end of file
index e169d58..afdaebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdced=['save','remove','emit','removeListener','register','./whatsappMessage.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdced,0x1eb));var _0xddce=function(_0x162be7,_0x399cd5){_0x162be7=_0x162be7-0x0;var _0x58da4c=_0xdced[_0x162be7];return _0x58da4c;};'use strict';var WhatsappMessageEvents=require(_0xddce('0x0'));var events=[_0xddce('0x1'),_0xddce('0x2'),'update'];function createListener(_0x399ae7,_0x4b6651){return function(_0x2065d0){_0x4b6651[_0xddce('0x3')](_0x399ae7,_0x2065d0);};}function removeListener(_0x5c814e,_0x1d03ff){return function(){WhatsappMessageEvents[_0xddce('0x4')](_0x5c814e,_0x1d03ff);};}exports[_0xddce('0x5')]=function(_0x514c5b){for(var _0x461ca3=0x0,_0x5c2596=events['length'];_0x461ca3<_0x5c2596;_0x461ca3++){var _0x1139ed=events[_0x461ca3];var _0x3dee5d=createListener('whatsappMessage:'+_0x1139ed,_0x514c5b);WhatsappMessageEvents['on'](_0x1139ed,_0x3dee5d);}};
\ No newline at end of file
+var _0xf987=['length','./whatsappMessage.events','save','remove','emit','removeListener','register'];(function(_0x2adf80,_0x3b0644){var _0x3b15b7=function(_0x492243){while(--_0x492243){_0x2adf80['push'](_0x2adf80['shift']());}};_0x3b15b7(++_0x3b0644);}(_0xf987,0x1dd));var _0x7f98=function(_0x10c66e,_0x5b7497){_0x10c66e=_0x10c66e-0x0;var _0x488f6a=_0xf987[_0x10c66e];return _0x488f6a;};'use strict';var WhatsappMessageEvents=require(_0x7f98('0x0'));var events=[_0x7f98('0x1'),_0x7f98('0x2'),'update'];function createListener(_0x553661,_0x41c06e){return function(_0xe56f24){_0x41c06e[_0x7f98('0x3')](_0x553661,_0xe56f24);};}function removeListener(_0x40993d,_0x891400){return function(){WhatsappMessageEvents[_0x7f98('0x4')](_0x40993d,_0x891400);};}exports[_0x7f98('0x5')]=function(_0x8ee805){for(var _0x28c1cf=0x0,_0x365d86=events[_0x7f98('0x6')];_0x28c1cf<_0x365d86;_0x28c1cf++){var _0x2a936=events[_0x28c1cf];var _0x1c25e4=createListener('whatsappMessage:'+_0x2a936,_0x8ee805);WhatsappMessageEvents['on'](_0x2a936,_0x1c25e4);}};
\ No newline at end of file
index 42960bf..a5f9fa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe321=['show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','put','/:id','delete','removeTeams','exports','util','path','connect-timeout','fs-extra','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x55c17a,_0x240715){var _0xcc23e6=function(_0x915592){while(--_0x915592){_0x55c17a['push'](_0x55c17a['shift']());}};_0xcc23e6(++_0x240715);}(_0xe321,0x194));var _0x1e32=function(_0x58d719,_0x44d73d){_0x58d719=_0x58d719-0x0;var _0x206009=_0xe321[_0x58d719];return _0x206009;};'use strict';var multer=require('multer');var util=require(_0x1e32('0x0'));var path=require(_0x1e32('0x1'));var timeout=require(_0x1e32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1e32('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e32('0x4'));var controller=require(_0x1e32('0x5'));router[_0x1e32('0x6')]('/',auth[_0x1e32('0x7')](),controller[_0x1e32('0x8')]);router[_0x1e32('0x6')](_0x1e32('0x9'),auth[_0x1e32('0x7')](),controller['describe']);router[_0x1e32('0x6')]('/:id',auth[_0x1e32('0x7')](),controller[_0x1e32('0xa')]);router['get']('/:id/members',auth[_0x1e32('0x7')](),controller[_0x1e32('0xb')]);router['get'](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0xd')]);router[_0x1e32('0x6')](_0x1e32('0xe'),auth['isAuthenticated'](),controller[_0x1e32('0xf')]);router['post']('/',auth[_0x1e32('0x7')](),controller['create']);router['post'](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0x10')]);router[_0x1e32('0x11')](_0x1e32('0xe'),auth[_0x1e32('0x7')](),controller['addAgents']);router[_0x1e32('0x12')](_0x1e32('0x13'),auth[_0x1e32('0x7')](),controller['update']);router[_0x1e32('0x14')](_0x1e32('0x13'),auth[_0x1e32('0x7')](),controller['destroy']);router[_0x1e32('0x14')](_0x1e32('0xc'),auth[_0x1e32('0x7')](),controller[_0x1e32('0x15')]);router[_0x1e32('0x14')](_0x1e32('0xe'),auth[_0x1e32('0x7')](),controller['removeAgents']);module[_0x1e32('0x16')]=router;
\ No newline at end of file
+var _0xb6dc=['removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','/:id','removeTeams'];(function(_0x1424b1,_0x5129b2){var _0x5dfc38=function(_0x163dca){while(--_0x163dca){_0x1424b1['push'](_0x1424b1['shift']());}};_0x5dfc38(++_0x5129b2);}(_0xb6dc,0xaa));var _0xcb6d=function(_0x58c414,_0x1cf439){_0x58c414=_0x58c414-0x0;var _0x35dd9e=_0xb6dc[_0x58c414];return _0x35dd9e;};'use strict';var multer=require('multer');var util=require(_0xcb6d('0x0'));var path=require(_0xcb6d('0x1'));var timeout=require(_0xcb6d('0x2'));var express=require(_0xcb6d('0x3'));var router=express[_0xcb6d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb6d('0x5'));var interaction=require(_0xcb6d('0x6'));var config=require(_0xcb6d('0x7'));var controller=require('./whatsappQueue.controller');router[_0xcb6d('0x8')]('/',auth[_0xcb6d('0x9')](),controller['index']);router['get'](_0xcb6d('0xa'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0xb')]);router[_0xcb6d('0x8')]('/:id',auth[_0xcb6d('0x9')](),controller[_0xcb6d('0xc')]);router[_0xcb6d('0x8')](_0xcb6d('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0xcb6d('0x8')](_0xcb6d('0xe'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0xf')]);router[_0xcb6d('0x8')](_0xcb6d('0x10'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x11')]);router[_0xcb6d('0x12')]('/',auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x13')]);router[_0xcb6d('0x12')](_0xcb6d('0xe'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x14')]);router[_0xcb6d('0x12')]('/:id/users',auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x15')]);router[_0xcb6d('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xcb6d('0x17')](_0xcb6d('0x18'),auth[_0xcb6d('0x9')](),controller['destroy']);router['delete'](_0xcb6d('0xe'),auth[_0xcb6d('0x9')](),controller[_0xcb6d('0x19')]);router[_0xcb6d('0x17')](_0xcb6d('0x10'),auth['isAuthenticated'](),controller[_0xcb6d('0x1a')]);module[_0xcb6d('0x1b')]=router;
\ No newline at end of file
index 12fdaef..14013ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb07f=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x517cba,_0xf0be72){var _0x4ecca7=function(_0x50e54a){while(--_0x50e54a){_0x517cba['push'](_0x517cba['shift']());}};_0x4ecca7(++_0xf0be72);}(_0xb07f,0x109));var _0xfb07=function(_0x55d576,_0x219496){_0x55d576=_0x55d576-0x0;var _0x25f4ef=_0xb07f[_0x55d576];return _0x25f4ef;};'use strict';var Sequelize=require(_0xfb07('0x0'));module[_0xfb07('0x1')]={'name':{'type':Sequelize[_0xfb07('0x2')],'unique':_0xfb07('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xfb07('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb07('0x5')](_0xfb07('0x6'),_0xfb07('0x7'),_0xfb07('0x8'))},'description':{'type':Sequelize[_0xfb07('0x2')]}};
\ No newline at end of file
+var _0x8d97=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x2525e6,_0x27d74a){var _0x2af02a=function(_0x864f39){while(--_0x864f39){_0x2525e6['push'](_0x2525e6['shift']());}};_0x2af02a(++_0x27d74a);}(_0x8d97,0x82));var _0x78d9=function(_0x1467cc,_0x2cd110){_0x1467cc=_0x1467cc-0x0;var _0x3866e3=_0x8d97[_0x1467cc];return _0x3866e3;};'use strict';var Sequelize=require('sequelize');module[_0x78d9('0x0')]={'name':{'type':Sequelize[_0x78d9('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x78d9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78d9('0x3')](_0x78d9('0x4'),_0x78d9('0x5'),_0x78d9('0x6'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 77ab4fd..12c986f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../mysqldb','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','WhatsappQueue','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5cedd2,_0x152f4a){var _0x6ccb5d=function(_0x191b8d){while(--_0x191b8d){_0x5cedd2['push'](_0x5cedd2['shift']());}};_0x6ccb5d(++_0x152f4a);}(_0x7217,0x19e));var _0x7721=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7217[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];config['redis']=_[_0x7721('0x1c')](config[_0x7721('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0x7721('0x1e'))(new Redis(config[_0x7721('0x1d')]));require(_0x7721('0x1f'))[_0x7721('0x20')](socket);function respondWithStatusCode(_0x5069da,_0x3cbce8){_0x3cbce8=_0x3cbce8||0xcc;return function(_0x25b1c0){if(_0x25b1c0){return _0x5069da['sendStatus'](_0x3cbce8);}return _0x5069da['status'](_0x3cbce8)['end']();};}function respondWithResult(_0x5ed54,_0x25a628){_0x25a628=_0x25a628||0xc8;return function(_0x3cc909){if(_0x3cc909){return _0x5ed54[_0x7721('0x21')](_0x25a628)['json'](_0x3cc909);}};}function respondWithFilteredResult(_0x20f669,_0x54a838){return function(_0x3fc09e){if(_0x3fc09e){var _0x5cb0e6=typeof _0x54a838[_0x7721('0x22')]===_0x7721('0x23')&&typeof _0x54a838[_0x7721('0x24')]===_0x7721('0x23');var _0x2286e5=_0x3fc09e[_0x7721('0x25')];var _0x402820=_0x5cb0e6?0x0:_0x54a838[_0x7721('0x22')];var _0x3b29ac=_0x5cb0e6?_0x3fc09e[_0x7721('0x25')]:_0x54a838['offset']+_0x54a838[_0x7721('0x24')];var _0x2c1583;if(_0x3b29ac>=_0x2286e5){_0x3b29ac=_0x2286e5;_0x2c1583=0xc8;}else{_0x2c1583=0xce;}_0x20f669[_0x7721('0x21')](_0x2c1583);return _0x20f669[_0x7721('0x26')]('Content-Range',_0x402820+'-'+_0x3b29ac+'/'+_0x2286e5)[_0x7721('0x27')](_0x3fc09e);}return null;};}function patchUpdates(_0x512f31){return function(_0xb9e9dd){try{jsonpatch[_0x7721('0x28')](_0xb9e9dd,_0x512f31,!![]);}catch(_0x3e8a4e){return BPromise[_0x7721('0x29')](_0x3e8a4e);}return _0xb9e9dd[_0x7721('0x2a')]();};}function saveUpdates(_0x395b15,_0x2c6b7b){return function(_0x5b4d74){if(_0x5b4d74){return _0x5b4d74[_0x7721('0x2b')](_0x395b15)[_0x7721('0x2c')](function(_0x125564){return _0x125564;});}return null;};}function removeEntity(_0x1f67c7,_0x40d550){return function(_0x16355a){if(_0x16355a){return _0x16355a[_0x7721('0x2d')]()[_0x7721('0x2c')](function(){var _0x40f367=_0x16355a['get']({'plain':!![]});var _0x258ddf='WhatsappQueues';return db['UserProfileResource'][_0x7721('0x2d')]({'where':{'type':_0x258ddf,'resourceId':_0x40f367['id']}})[_0x7721('0x2c')](function(){return _0x16355a;});})[_0x7721('0x2c')](function(){_0x1f67c7[_0x7721('0x21')](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x37b9f0,_0xd7d703){return function(_0x1da2d8){if(!_0x1da2d8){_0x37b9f0['sendStatus'](0x194);}return _0x1da2d8;};}function handleError(_0x471651,_0x2871c5){_0x2871c5=_0x2871c5||0x1f4;return function(_0x497f9f){logger['error'](_0x497f9f[_0x7721('0x2f')]);if(_0x497f9f[_0x7721('0x30')]){delete _0x497f9f['name'];}_0x471651[_0x7721('0x21')](_0x2871c5)[_0x7721('0x31')](_0x497f9f);};}exports[_0x7721('0x32')]=function(_0x58d54b,_0x3d9a32){var _0x1ff31b={},_0x1492d4={},_0x3f15e2={'count':0x0,'rows':[]};var _0xc0f3c4=_['map'](db[_0x7721('0x33')][_0x7721('0x34')],function(_0xb2386d){return{'name':_0xb2386d['fieldName'],'type':_0xb2386d[_0x7721('0x35')][_0x7721('0x36')]};});_0x1492d4['model']=_[_0x7721('0x37')](_0xc0f3c4,'name');_0x1492d4[_0x7721('0x38')]=_[_0x7721('0x39')](_0x58d54b[_0x7721('0x38')]);_0x1492d4[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x1492d4[_0x7721('0x3c')],_0x1492d4[_0x7721('0x38')]);_0x1ff31b[_0x7721('0x3d')]=_[_0x7721('0x3b')](_0x1492d4[_0x7721('0x3c')],qs[_0x7721('0x3e')](_0x58d54b['query'][_0x7721('0x3e')]));_0x1ff31b['attributes']=_0x1ff31b[_0x7721('0x3d')][_0x7721('0x3f')]?_0x1ff31b[_0x7721('0x3d')]:_0x1492d4[_0x7721('0x3c')];if(!_0x58d54b[_0x7721('0x38')][_0x7721('0x40')]('nolimit')){_0x1ff31b['limit']=qs['limit'](_0x58d54b['query'][_0x7721('0x24')]);_0x1ff31b[_0x7721('0x22')]=qs[_0x7721('0x22')](_0x58d54b[_0x7721('0x38')]['offset']);}_0x1ff31b[_0x7721('0x41')]=qs['sort'](_0x58d54b[_0x7721('0x38')][_0x7721('0x42')]);_0x1ff31b['where']=qs[_0x7721('0x3a')](_[_0x7721('0x43')](_0x58d54b['query'],_0x1492d4['filters']),_0xc0f3c4);if(_0x58d54b[_0x7721('0x38')][_0x7721('0x44')]){_0x1ff31b[_0x7721('0x45')]=_[_0x7721('0x46')](_0x1ff31b['where'],{'$or':_[_0x7721('0x37')](_0xc0f3c4,function(_0x120de9){if(_0x120de9[_0x7721('0x35')]!==_0x7721('0x47')){var _0x196051={};_0x196051[_0x120de9['name']]={'$like':'%'+_0x58d54b[_0x7721('0x38')]['filter']+'%'};return _0x196051;}})});}_0x1ff31b=_[_0x7721('0x46')]({},_0x1ff31b,_0x58d54b['options']);var _0x2333b8={'where':_0x1ff31b[_0x7721('0x45')]};return db[_0x7721('0x33')]['count'](_0x2333b8)[_0x7721('0x2c')](function(_0x11d853){_0x3f15e2[_0x7721('0x25')]=_0x11d853;if(_0x58d54b['query'][_0x7721('0x48')]){_0x1ff31b[_0x7721('0x49')]=[{'all':!![]}];}return db[_0x7721('0x33')][_0x7721('0x4a')](_0x1ff31b);})[_0x7721('0x2c')](function(_0x57d09b){_0x3f15e2[_0x7721('0x4b')]=_0x57d09b;return _0x3f15e2;})['then'](respondWithFilteredResult(_0x3d9a32,_0x1ff31b))['catch'](handleError(_0x3d9a32,null));};exports[_0x7721('0x4c')]=function(_0x1fdc79,_0x421aae){var _0x39a3ad={'raw':!![],'where':{'id':_0x1fdc79[_0x7721('0x4d')]['id']}},_0x335145={};_0x335145[_0x7721('0x3c')]=_[_0x7721('0x39')](db[_0x7721('0x33')][_0x7721('0x34')]);_0x335145['query']=_['keys'](_0x1fdc79[_0x7721('0x38')]);_0x335145[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x335145[_0x7721('0x3c')],_0x335145['query']);_0x39a3ad[_0x7721('0x3d')]=_[_0x7721('0x3b')](_0x335145['model'],qs[_0x7721('0x3e')](_0x1fdc79['query'][_0x7721('0x3e')]));_0x39a3ad['attributes']=_0x39a3ad[_0x7721('0x3d')][_0x7721('0x3f')]?_0x39a3ad[_0x7721('0x3d')]:_0x335145['model'];if(_0x1fdc79[_0x7721('0x38')][_0x7721('0x48')]){_0x39a3ad['include']=[{'all':!![]}];}_0x39a3ad=_[_0x7721('0x46')]({},_0x39a3ad,_0x1fdc79[_0x7721('0x4e')]);return db[_0x7721('0x33')]['find'](_0x39a3ad)[_0x7721('0x2c')](handleEntityNotFound(_0x421aae,null))['then'](respondWithResult(_0x421aae,null))[_0x7721('0x4f')](handleError(_0x421aae,null));};exports[_0x7721('0x50')]=function(_0x4738ef,_0x443503){return db[_0x7721('0x33')][_0x7721('0x50')](_0x4738ef[_0x7721('0x51')],{})[_0x7721('0x2c')](function(_0x694d2f){var _0x3386aa=_0x4738ef[_0x7721('0x52')][_0x7721('0x53')]({'plain':!![]});if(!_0x3386aa)throw new Error(_0x7721('0x54'));if(_0x3386aa[_0x7721('0x55')]===_0x7721('0x52')){var _0x5b741d=_0x694d2f[_0x7721('0x53')]({'plain':!![]});var _0x2f6f30=_0x7721('0x56');return db[_0x7721('0x57')][_0x7721('0x58')]({'where':{'name':_0x2f6f30,'userProfileId':_0x3386aa[_0x7721('0x59')]},'raw':!![]})[_0x7721('0x2c')](function(_0x57484c){if(_0x57484c&&_0x57484c[_0x7721('0x5a')]===0x0){return db[_0x7721('0x5b')][_0x7721('0x50')]({'name':_0x5b741d[_0x7721('0x30')],'resourceId':_0x5b741d['id'],'type':_0x57484c[_0x7721('0x30')],'sectionId':_0x57484c['id']},{})[_0x7721('0x2c')](function(){return _0x694d2f;});}else{return _0x694d2f;}})[_0x7721('0x4f')](function(_0x33287d){logger[_0x7721('0x5c')](_0x7721('0x5d'),_0x33287d);throw _0x33287d;});}return _0x694d2f;})[_0x7721('0x2c')](respondWithResult(_0x443503,0xc9))['catch'](handleError(_0x443503,null));};exports[_0x7721('0x2b')]=function(_0xadb365,_0x1234bc){if(_0xadb365[_0x7721('0x51')]['id']){delete _0xadb365[_0x7721('0x51')]['id'];}return db[_0x7721('0x33')][_0x7721('0x58')]({'where':{'id':_0xadb365[_0x7721('0x4d')]['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x1234bc,null))[_0x7721('0x2c')](saveUpdates(_0xadb365[_0x7721('0x51')],null))[_0x7721('0x2c')](respondWithResult(_0x1234bc,null))[_0x7721('0x4f')](handleError(_0x1234bc,null));};exports[_0x7721('0x2d')]=function(_0x300ea4,_0x577f47){return db['WhatsappQueue']['find']({'where':{'id':_0x300ea4[_0x7721('0x4d')]['id']}})['then'](handleEntityNotFound(_0x577f47,null))['then'](removeEntity(_0x577f47,null))['catch'](handleError(_0x577f47,null));};exports['describe']=function(_0x47925a,_0x219181){return db[_0x7721('0x33')]['describe']()[_0x7721('0x2c')](respondWithResult(_0x219181,null))['catch'](handleError(_0x219181,null));};exports['getMembers']=function(_0x484b8e,_0x24d1dc,_0x4f0d38){var _0x48e7e3={'raw':!![],'where':{}},_0x54642a={},_0x160292;return db[_0x7721('0x33')][_0x7721('0x5e')]({'where':{'id':_0x484b8e['params']['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x24d1dc,null))[_0x7721('0x2c')](function(_0x2c95d0){if(_0x2c95d0){_0x160292=_0x2c95d0[_0x7721('0x53')]({'plain':!![]});_0x54642a[_0x7721('0x3c')]=_[_0x7721('0x39')](db[_0x7721('0x5f')][_0x7721('0x34')]);_0x54642a[_0x7721('0x38')]=_[_0x7721('0x39')](_0x484b8e[_0x7721('0x38')]);_0x54642a[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x54642a[_0x7721('0x3c')],_0x54642a[_0x7721('0x38')]);_0x48e7e3['attributes']=_[_0x7721('0x3b')](_0x54642a[_0x7721('0x3c')],qs[_0x7721('0x3e')](_0x484b8e[_0x7721('0x38')]['fields']));_0x48e7e3[_0x7721('0x3d')]=_0x48e7e3[_0x7721('0x3d')]['length']?_0x48e7e3[_0x7721('0x3d')]:_0x54642a['model'];if(!_0x484b8e[_0x7721('0x38')][_0x7721('0x40')](_0x7721('0x60'))){_0x48e7e3[_0x7721('0x24')]=qs[_0x7721('0x24')](_0x484b8e[_0x7721('0x38')][_0x7721('0x24')]);_0x48e7e3[_0x7721('0x22')]=qs[_0x7721('0x22')](_0x484b8e['query'][_0x7721('0x22')]);}_0x48e7e3[_0x7721('0x41')]=qs[_0x7721('0x42')](_0x484b8e[_0x7721('0x38')][_0x7721('0x42')]);_0x48e7e3[_0x7721('0x45')]=qs[_0x7721('0x3a')](_['pick'](_0x484b8e[_0x7721('0x38')],_0x54642a[_0x7721('0x3a')]));_0x48e7e3['where'][_0x7721('0x61')]=_0x2c95d0['id'];if(_0x484b8e['query'][_0x7721('0x44')]){_0x48e7e3[_0x7721('0x45')]=_[_0x7721('0x46')](_0x48e7e3[_0x7721('0x45')],{'$or':_[_0x7721('0x37')](_0x48e7e3[_0x7721('0x3d')],function(_0x258c57){var _0x5dca04={};_0x5dca04[_0x258c57]={'$like':'%'+_0x484b8e[_0x7721('0x38')][_0x7721('0x44')]+'%'};return _0x5dca04;})});}_0x48e7e3=_[_0x7721('0x46')]({},_0x48e7e3,_0x484b8e['options']);return db['UserWhatsappQueue']['findAll'](_0x48e7e3);}})['then'](function(_0x5e966f){if(_0x5e966f){return db[_0x7721('0x62')][_0x7721('0x63')]({'where':{'id':_['map'](_0x5e966f,_0x7721('0x64')),'role':_0x7721('0x65')},'attributes':['id',_0x7721('0x30'),_0x7721('0x66'),'updatedAt',_0x7721('0x67')]});}})[_0x7721('0x2c')](function(_0x322afc){if(_0x322afc){return{'count':_0x322afc[_0x7721('0x25')],'rows':_[_0x7721('0x37')](_0x322afc['rows'],function(_0x29ac64){return{'membername':_0x29ac64[_0x7721('0x30')],'UserId':_0x29ac64['id'],'queue_name':_0x160292[_0x7721('0x30')],'WhatsappQueueId':_0x160292['id'],'interface':util['format']('%s/%s',_0x7721('0x68'),_0x29ac64[_0x7721('0x30')]),'penalty':0x0,'paused':_0x29ac64[_0x7721('0x66')],'createdAt':_0x29ac64[_0x7721('0x67')],'updatedAt':_0x29ac64[_0x7721('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x24d1dc,_0x48e7e3))['catch'](handleError(_0x24d1dc,null));};exports[_0x7721('0x6a')]=function(_0x1bd97e,_0x68de4,_0x3c66b3){var _0x142ec6={};var _0x145a0b={};var _0x34187f;var _0x58f944;return db[_0x7721('0x33')][_0x7721('0x5e')]({'where':{'id':_0x1bd97e[_0x7721('0x4d')]['id']}})['then'](handleEntityNotFound(_0x68de4,null))[_0x7721('0x2c')](function(_0x1a53d6){if(_0x1a53d6){_0x34187f=_0x1a53d6;_0x145a0b[_0x7721('0x3c')]=_[_0x7721('0x39')](db['Team']['rawAttributes']);_0x145a0b[_0x7721('0x38')]=_[_0x7721('0x39')](_0x1bd97e[_0x7721('0x38')]);_0x145a0b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x145a0b[_0x7721('0x3c')],_0x145a0b['query']);_0x142ec6[_0x7721('0x3d')]=_[_0x7721('0x3b')](_0x145a0b[_0x7721('0x3c')],qs['fields'](_0x1bd97e[_0x7721('0x38')][_0x7721('0x3e')]));_0x142ec6[_0x7721('0x3d')]=_0x142ec6[_0x7721('0x3d')][_0x7721('0x3f')]?_0x142ec6['attributes']:_0x145a0b[_0x7721('0x3c')];_0x142ec6['order']=qs[_0x7721('0x42')](_0x1bd97e[_0x7721('0x38')][_0x7721('0x42')]);_0x142ec6[_0x7721('0x45')]=qs[_0x7721('0x3a')](_[_0x7721('0x43')](_0x1bd97e[_0x7721('0x38')],_0x145a0b[_0x7721('0x3a')]));if(_0x1bd97e[_0x7721('0x38')][_0x7721('0x44')]){_0x142ec6[_0x7721('0x45')]=_['merge'](_0x142ec6[_0x7721('0x45')],{'$or':_[_0x7721('0x37')](_0x142ec6[_0x7721('0x3d')],function(_0x5eec29){var _0x94af20={};_0x94af20[_0x5eec29]={'$like':'%'+_0x1bd97e[_0x7721('0x38')][_0x7721('0x44')]+'%'};return _0x94af20;})});}_0x142ec6=_[_0x7721('0x46')]({},_0x142ec6,_0x1bd97e[_0x7721('0x4e')]);return _0x34187f['getTeams'](_0x142ec6);}})[_0x7721('0x2c')](function(_0x22f15a){if(_0x22f15a){_0x58f944=_0x22f15a[_0x7721('0x3f')];if(!_0x1bd97e[_0x7721('0x38')][_0x7721('0x40')](_0x7721('0x60'))){_0x142ec6['limit']=qs[_0x7721('0x24')](_0x1bd97e[_0x7721('0x38')]['limit']);_0x142ec6[_0x7721('0x22')]=qs['offset'](_0x1bd97e[_0x7721('0x38')][_0x7721('0x22')]);}return _0x34187f['getTeams'](_0x142ec6);}})[_0x7721('0x2c')](function(_0x5209e1){if(_0x5209e1){return _0x5209e1?{'count':_0x58f944,'rows':_0x5209e1}:null;}})['then'](respondWithResult(_0x68de4,null))['catch'](handleError(_0x68de4,null));};exports[_0x7721('0x6b')]=function(_0x20f12e,_0x21a686,_0x48b701){var _0x4916c2=_0x20f12e['body'][_0x7721('0x6c')];return db[_0x7721('0x6d')][_0x7721('0x4a')]({'where':{'id':_0x4916c2},'attributes':['id'],'include':[{'model':db[_0x7721('0x62')],'as':_0x7721('0x6e'),'attributes':['id',_0x7721('0x30'),'online',_0x7721('0x6f'),_0x7721('0x70')],'raw':!![]}]})[_0x7721('0x2c')](function(_0xcf5304){if(_0xcf5304){var _0x977255=_[_0x7721('0x71')](_0xcf5304,function(_0x342da2){var _0x6252db=_0x342da2[_0x7721('0x53')]({'plain':!![]});return _0x6252db[_0x7721('0x6e')];});return db[_0x7721('0x33')][_0x7721('0x58')]({'where':{'id':_0x20f12e['params']['id']}})['then'](function(_0x40768f){return db[_0x7721('0x72')]['transaction'](function(_0x167e05){return _0x40768f['addTeams'](_0x4916c2,{'transaction':_0x167e05})['then'](function(){return BPromise[_0x7721('0x73')](_0x977255,function(_0x569dad){return db['UserWhatsappQueue'][_0x7721('0x74')]({'where':{'UserId':_0x569dad['id'],'WhatsappQueueId':_0x20f12e[_0x7721('0x4d')]['id']},'transaction':_0x167e05});});})[_0x7721('0x2c')](function(){_0x977255[_0x7721('0x75')](function(_0x6b611){socket['emit'](_0x7721('0x76'),{'UserId':_0x6b611['id'],'WhatsappQueueId':_0x40768f['id']});});});});});}})[_0x7721('0x2c')](respondWithStatusCode(_0x21a686,null))[_0x7721('0x4f')](handleError(_0x21a686,null));};exports[_0x7721('0x77')]=function(_0x4a1749,_0x52fcc1,_0x66ec15){return db[_0x7721('0x6d')]['findAll']({'where':{'id':_0x4a1749[_0x7721('0x38')][_0x7721('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7721('0x2c')](handleEntityNotFound(_0x52fcc1,null))[_0x7721('0x2c')](function(_0x606b4b){var _0x3c4228=_[_0x7721('0x37')](_0x606b4b,'id');var _0x29053e=[];var _0x996071=[];var _0x2dafa0=squel['select']();_0x2dafa0[_0x7721('0x78')](_0x7721('0x79'))[_0x7721('0x7a')](_0x7721('0x7b'),'tq')[_0x7721('0x7c')](_0x7721('0x7d'),'ut',_0x7721('0x7e'))['where'](_0x7721('0x7f'),_0x4a1749[_0x7721('0x4d')]['id']);for(var _0x479834=0x0;_0x479834<_0x606b4b[_0x7721('0x3f')];_0x479834+=0x1){let _0x1cc8ee=_0x606b4b[_0x479834];for(var _0x12ff9e=0x0;_0x12ff9e<_0x1cc8ee[_0x7721('0x6e')][_0x7721('0x3f')];_0x12ff9e+=0x1){let _0x26c139=_0x1cc8ee[_0x7721('0x6e')][_0x12ff9e];var _0xef8270=_0x2dafa0[_0x7721('0x80')]();_0xef8270[_0x7721('0x45')]('ut.UserId\x20=\x20?',_0x26c139['id']);_0x996071[_0x7721('0x81')](db[_0x7721('0x72')][_0x7721('0x38')](_0xef8270[_0x7721('0x82')](),{'type':db[_0x7721('0x72')][_0x7721('0x83')][_0x7721('0x84')]})[_0x7721('0x2c')](function(_0x425327){if(_0x425327[_0x7721('0x3f')]===0x1){return _0x26c139['id'];}else{var _0x29b576=_[_0x7721('0x85')](_[_0x7721('0x37')](_0x425327,_0x7721('0x86')),function(_0x2291fc){return _[_0x7721('0x87')](_0x3c4228,_0x2291fc);});if(_0x29b576){return _0x26c139['id'];}}}));}}return BPromise[_0x7721('0x88')](_0x996071)[_0x7721('0x2c')](function(_0xfe14f3){_0x29053e=_(_0x29053e)[_0x7721('0x89')](_0xfe14f3)['compact']()[_0x7721('0x8a')]();return db['WhatsappQueue'][_0x7721('0x58')]({'where':{'id':_0x4a1749[_0x7721('0x4d')]['id']}})[_0x7721('0x2c')](function(_0x3760e3){return db[_0x7721('0x72')]['transaction'](function(_0x5ade72){return _0x3760e3['removeTeams'](_0x4a1749['query'][_0x7721('0x6c')],{'transaction':_0x5ade72})[_0x7721('0x2c')](function(){if(!_[_0x7721('0x8b')](_0x29053e)){return _0x3760e3[_0x7721('0x8c')](_0x29053e,{'transaction':_0x5ade72});}})[_0x7721('0x2c')](function(){_0x29053e['forEach'](function(_0x123769){socket['emit'](_0x7721('0x8d'),{'UserId':_0x123769,'WhatsappQueueId':_0x3760e3['id']});});});});});});})[_0x7721('0x2c')](respondWithStatusCode(_0x52fcc1,null))[_0x7721('0x4f')](handleError(_0x52fcc1,null));};exports[_0x7721('0x8e')]=function(_0xf061eb,_0x2b0c22,_0x56b916){return db[_0x7721('0x33')]['find']({'where':{'id':_0xf061eb['params']['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x2b0c22,null))[_0x7721('0x2c')](function(_0x4c7271){if(_0x4c7271){return _0x4c7271[_0x7721('0x8e')](_0xf061eb[_0x7721('0x51')]['ids'],_[_0x7721('0x8f')](_0xf061eb[_0x7721('0x51')],[_0x7721('0x6c'),'id'])||{})[_0x7721('0x90')](function(_0x34ef75){for(var _0x3b79c6=0x0;_0x3b79c6<_0xf061eb[_0x7721('0x51')]['ids'][_0x7721('0x3f')];_0x3b79c6+=0x1){socket[_0x7721('0x91')](_0x7721('0x76'),{'UserId':_0xf061eb[_0x7721('0x51')][_0x7721('0x6c')][_0x3b79c6],'WhatsappQueueId':_0xf061eb['params']['id']});}return _0x34ef75;});}})[_0x7721('0x2c')](respondWithResult(_0x2b0c22,null))[_0x7721('0x4f')](handleError(_0x2b0c22,null));};exports[_0x7721('0x8c')]=function(_0x566a88,_0x250f29,_0x44554b){return db['WhatsappQueue'][_0x7721('0x58')]({'where':{'id':_0x566a88[_0x7721('0x4d')]['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x250f29,null))[_0x7721('0x2c')](function(_0x5b64de){if(_0x5b64de){return _0x5b64de[_0x7721('0x8c')](_0x566a88['query'][_0x7721('0x6c')])[_0x7721('0x2c')](function(){if(_['isArray'](_0x566a88[_0x7721('0x38')][_0x7721('0x6c')])){for(var _0x4ee4d8=0x0;_0x4ee4d8<_0x566a88[_0x7721('0x38')][_0x7721('0x6c')]['length'];_0x4ee4d8+=0x1){socket[_0x7721('0x91')]('userWhatsappQueue:remove',{'UserId':Number(_0x566a88[_0x7721('0x38')][_0x7721('0x6c')][_0x4ee4d8]),'WhatsappQueueId':Number(_0x566a88[_0x7721('0x4d')]['id'])});}}else{socket['emit'](_0x7721('0x8d'),{'UserId':Number(_0x566a88['query']['ids']),'WhatsappQueueId':Number(_0x566a88[_0x7721('0x4d')]['id'])});}});}})[_0x7721('0x2c')](respondWithStatusCode(_0x250f29,null))[_0x7721('0x4f')](handleError(_0x250f29,null));};exports[_0x7721('0x92')]=function(_0x514b93,_0x4d9fec,_0x669fce){var _0x174e20={};var _0x34e147={};var _0x299472;var _0x42cd58;return db['WhatsappQueue'][_0x7721('0x5e')]({'where':{'id':_0x514b93['params']['id']}})[_0x7721('0x2c')](handleEntityNotFound(_0x4d9fec,null))['then'](function(_0x483d68){if(_0x483d68){_0x299472=_0x483d68;_0x34e147[_0x7721('0x3c')]=_['keys'](db['User'][_0x7721('0x34')]);_0x34e147[_0x7721('0x38')]=_[_0x7721('0x39')](_0x514b93['query']);_0x34e147[_0x7721('0x3a')]=_['intersection'](_0x34e147['model'],_0x34e147['query']);_0x174e20[_0x7721('0x3d')]=_[_0x7721('0x3b')](_0x34e147[_0x7721('0x3c')],qs[_0x7721('0x3e')](_0x514b93[_0x7721('0x38')][_0x7721('0x3e')]));_0x174e20[_0x7721('0x3d')]=_0x174e20[_0x7721('0x3d')][_0x7721('0x3f')]?_0x174e20[_0x7721('0x3d')]:_0x34e147[_0x7721('0x3c')];_0x174e20['order']=qs[_0x7721('0x42')](_0x514b93[_0x7721('0x38')][_0x7721('0x42')]);_0x174e20[_0x7721('0x45')]=qs[_0x7721('0x3a')](_[_0x7721('0x43')](_0x514b93[_0x7721('0x38')],_0x34e147['filters']));if(_0x514b93['query'][_0x7721('0x44')]){_0x174e20[_0x7721('0x45')]=_[_0x7721('0x46')](_0x174e20[_0x7721('0x45')],{'$or':_['map'](_0x174e20[_0x7721('0x3d')],function(_0x4db922){var _0x1b5692={};_0x1b5692[_0x4db922]={'$like':'%'+_0x514b93['query'][_0x7721('0x44')]+'%'};return _0x1b5692;})});}_0x174e20=_[_0x7721('0x46')]({},_0x174e20,_0x514b93[_0x7721('0x4e')]);return _0x299472[_0x7721('0x92')](_0x174e20);}})[_0x7721('0x2c')](function(_0x22f3e6){if(_0x22f3e6){_0x42cd58=_0x22f3e6['length'];if(!_0x514b93['query']['hasOwnProperty'](_0x7721('0x60'))){_0x174e20['limit']=qs[_0x7721('0x24')](_0x514b93[_0x7721('0x38')]['limit']);_0x174e20[_0x7721('0x22')]=qs[_0x7721('0x22')](_0x514b93[_0x7721('0x38')]['offset']);}return _0x299472[_0x7721('0x92')](_0x174e20);}})[_0x7721('0x2c')](function(_0x5652f9){if(_0x5652f9){return _0x5652f9?{'count':_0x42cd58,'rows':_0x5652f9}:null;}})['then'](respondWithResult(_0x4d9fec,null))[_0x7721('0x4f')](handleError(_0x4d9fec,null));};
\ No newline at end of file
+var _0x8ef6=['key','keys','filters','model','query','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','find','params','describe','getMembers','UserWhatsappQueue','hasOwnProperty','findAndCountAll','UserId','updatedAt','format','SIP','whatsappPause','createdAt','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','forEach','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','register','sendStatus','end','json','limit','undefined','offset','status','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','error','name','send','map','WhatsappQueue','fieldName'];(function(_0x2bd9c1,_0x26e3ae){var _0x2b44a7=function(_0x415c4e){while(--_0x415c4e){_0x2bd9c1['push'](_0x2bd9c1['shift']());}};_0x2b44a7(++_0x26e3ae);}(_0x8ef6,0xf2));var _0x68ef=function(_0xa78d97,_0x56848b){_0xa78d97=_0xa78d97-0x0;var _0x392e30=_0x8ef6[_0xa78d97];return _0x392e30;};'use strict';var emlformat=require(_0x68ef('0x0'));var rimraf=require(_0x68ef('0x1'));var zipdir=require(_0x68ef('0x2'));var jsonpatch=require(_0x68ef('0x3'));var rp=require(_0x68ef('0x4'));var moment=require(_0x68ef('0x5'));var BPromise=require(_0x68ef('0x6'));var Mustache=require('mustache');var util=require(_0x68ef('0x7'));var path=require(_0x68ef('0x8'));var sox=require(_0x68ef('0x9'));var csv=require(_0x68ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68ef('0xb'));var squel=require(_0x68ef('0xc'));var crypto=require(_0x68ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x68ef('0xe'));var toCsv=require(_0x68ef('0xa'));var querystring=require(_0x68ef('0xf'));var Papa=require(_0x68ef('0x10'));var Redis=require(_0x68ef('0x11'));var authService=require(_0x68ef('0x12'));var qs=require(_0x68ef('0x13'));var as=require(_0x68ef('0x14'));var hardwareService=require(_0x68ef('0x15'));var logger=require(_0x68ef('0x16'))(_0x68ef('0x17'));var utils=require(_0x68ef('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x68ef('0x19'));var db=require(_0x68ef('0x1a'))['db'];config[_0x68ef('0x1b')]=_[_0x68ef('0x1c')](config[_0x68ef('0x1b')],{'host':_0x68ef('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68ef('0x1b')]));require(_0x68ef('0x1e'))[_0x68ef('0x1f')](socket);function respondWithStatusCode(_0x47fbb5,_0x22fe96){_0x22fe96=_0x22fe96||0xcc;return function(_0x1764de){if(_0x1764de){return _0x47fbb5[_0x68ef('0x20')](_0x22fe96);}return _0x47fbb5['status'](_0x22fe96)[_0x68ef('0x21')]();};}function respondWithResult(_0x37c4cc,_0x3d1e90){_0x3d1e90=_0x3d1e90||0xc8;return function(_0x3780a4){if(_0x3780a4){return _0x37c4cc['status'](_0x3d1e90)[_0x68ef('0x22')](_0x3780a4);}};}function respondWithFilteredResult(_0x54139e,_0x5cbb78){return function(_0x2633c1){if(_0x2633c1){var _0x404870=typeof _0x5cbb78['offset']==='undefined'&&typeof _0x5cbb78[_0x68ef('0x23')]===_0x68ef('0x24');var _0x318514=_0x2633c1['count'];var _0x1dc49c=_0x404870?0x0:_0x5cbb78[_0x68ef('0x25')];var _0x183f5f=_0x404870?_0x2633c1['count']:_0x5cbb78[_0x68ef('0x25')]+_0x5cbb78[_0x68ef('0x23')];var _0x5af19f;if(_0x183f5f>=_0x318514){_0x183f5f=_0x318514;_0x5af19f=0xc8;}else{_0x5af19f=0xce;}_0x54139e[_0x68ef('0x26')](_0x5af19f);return _0x54139e[_0x68ef('0x27')](_0x68ef('0x28'),_0x1dc49c+'-'+_0x183f5f+'/'+_0x318514)['json'](_0x2633c1);}return null;};}function patchUpdates(_0x59723c){return function(_0x59bebc){try{jsonpatch[_0x68ef('0x29')](_0x59bebc,_0x59723c,!![]);}catch(_0x2023f2){return BPromise[_0x68ef('0x2a')](_0x2023f2);}return _0x59bebc[_0x68ef('0x2b')]();};}function saveUpdates(_0x438b4c,_0xfe2595){return function(_0x258cd5){if(_0x258cd5){return _0x258cd5[_0x68ef('0x2c')](_0x438b4c)[_0x68ef('0x2d')](function(_0x13280b){return _0x13280b;});}return null;};}function removeEntity(_0x5e4dbe,_0x178460){return function(_0x57f9ee){if(_0x57f9ee){return _0x57f9ee['destroy']()['then'](function(){var _0x1a7ce1=_0x57f9ee[_0x68ef('0x2e')]({'plain':!![]});var _0x123041=_0x68ef('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x123041,'resourceId':_0x1a7ce1['id']}})[_0x68ef('0x2d')](function(){return _0x57f9ee;});})[_0x68ef('0x2d')](function(){_0x5e4dbe[_0x68ef('0x26')](0xcc)[_0x68ef('0x21')]();});}};}function handleEntityNotFound(_0x22ef25,_0x201884){return function(_0x26288a){if(!_0x26288a){_0x22ef25[_0x68ef('0x20')](0x194);}return _0x26288a;};}function handleError(_0x5a6dfd,_0x3d19bf){_0x3d19bf=_0x3d19bf||0x1f4;return function(_0x4314bd){logger[_0x68ef('0x30')](_0x4314bd['stack']);if(_0x4314bd[_0x68ef('0x31')]){delete _0x4314bd['name'];}_0x5a6dfd[_0x68ef('0x26')](_0x3d19bf)[_0x68ef('0x32')](_0x4314bd);};}exports['index']=function(_0x5e1e1b,_0x159395){var _0x5fa72a={},_0x4b8fc8={},_0xf58fa1={'count':0x0,'rows':[]};var _0x8c0a06=_[_0x68ef('0x33')](db[_0x68ef('0x34')]['rawAttributes'],function(_0x2c8bd0){return{'name':_0x2c8bd0[_0x68ef('0x35')],'type':_0x2c8bd0['type'][_0x68ef('0x36')]};});_0x4b8fc8['model']=_[_0x68ef('0x33')](_0x8c0a06,_0x68ef('0x31'));_0x4b8fc8['query']=_[_0x68ef('0x37')](_0x5e1e1b['query']);_0x4b8fc8[_0x68ef('0x38')]=_['intersection'](_0x4b8fc8[_0x68ef('0x39')],_0x4b8fc8[_0x68ef('0x3a')]);_0x5fa72a[_0x68ef('0x3b')]=_['intersection'](_0x4b8fc8[_0x68ef('0x39')],qs['fields'](_0x5e1e1b[_0x68ef('0x3a')]['fields']));_0x5fa72a[_0x68ef('0x3b')]=_0x5fa72a[_0x68ef('0x3b')][_0x68ef('0x3c')]?_0x5fa72a[_0x68ef('0x3b')]:_0x4b8fc8[_0x68ef('0x39')];if(!_0x5e1e1b[_0x68ef('0x3a')]['hasOwnProperty'](_0x68ef('0x3d'))){_0x5fa72a[_0x68ef('0x23')]=qs[_0x68ef('0x23')](_0x5e1e1b['query'][_0x68ef('0x23')]);_0x5fa72a[_0x68ef('0x25')]=qs[_0x68ef('0x25')](_0x5e1e1b['query']['offset']);}_0x5fa72a[_0x68ef('0x3e')]=qs[_0x68ef('0x3f')](_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x3f')]);_0x5fa72a[_0x68ef('0x40')]=qs[_0x68ef('0x38')](_[_0x68ef('0x41')](_0x5e1e1b['query'],_0x4b8fc8[_0x68ef('0x38')]),_0x8c0a06);if(_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x42')]){_0x5fa72a[_0x68ef('0x40')]=_['merge'](_0x5fa72a[_0x68ef('0x40')],{'$or':_[_0x68ef('0x33')](_0x8c0a06,function(_0xcf595d){if(_0xcf595d[_0x68ef('0x43')]!==_0x68ef('0x44')){var _0x3b00ea={};_0x3b00ea[_0xcf595d['name']]={'$like':'%'+_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x42')]+'%'};return _0x3b00ea;}})});}_0x5fa72a=_[_0x68ef('0x45')]({},_0x5fa72a,_0x5e1e1b[_0x68ef('0x46')]);var _0x449f3c={'where':_0x5fa72a[_0x68ef('0x40')]};return db[_0x68ef('0x34')][_0x68ef('0x47')](_0x449f3c)[_0x68ef('0x2d')](function(_0x531096){_0xf58fa1[_0x68ef('0x47')]=_0x531096;if(_0x5e1e1b[_0x68ef('0x3a')][_0x68ef('0x48')]){_0x5fa72a[_0x68ef('0x49')]=[{'all':!![]}];}return db[_0x68ef('0x34')][_0x68ef('0x4a')](_0x5fa72a);})[_0x68ef('0x2d')](function(_0x576767){_0xf58fa1[_0x68ef('0x4b')]=_0x576767;return _0xf58fa1;})['then'](respondWithFilteredResult(_0x159395,_0x5fa72a))[_0x68ef('0x4c')](handleError(_0x159395,null));};exports[_0x68ef('0x4d')]=function(_0x7470b9,_0xfc08d5){var _0x5a1330={'raw':!![],'where':{'id':_0x7470b9['params']['id']}},_0x428456={};_0x428456[_0x68ef('0x39')]=_['keys'](db[_0x68ef('0x34')][_0x68ef('0x4e')]);_0x428456[_0x68ef('0x3a')]=_['keys'](_0x7470b9['query']);_0x428456[_0x68ef('0x38')]=_[_0x68ef('0x4f')](_0x428456['model'],_0x428456['query']);_0x5a1330['attributes']=_[_0x68ef('0x4f')](_0x428456[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0x7470b9[_0x68ef('0x3a')][_0x68ef('0x50')]));_0x5a1330['attributes']=_0x5a1330['attributes'][_0x68ef('0x3c')]?_0x5a1330[_0x68ef('0x3b')]:_0x428456[_0x68ef('0x39')];if(_0x7470b9[_0x68ef('0x3a')]['includeAll']){_0x5a1330[_0x68ef('0x49')]=[{'all':!![]}];}_0x5a1330=_[_0x68ef('0x45')]({},_0x5a1330,_0x7470b9[_0x68ef('0x46')]);return db[_0x68ef('0x34')]['find'](_0x5a1330)['then'](handleEntityNotFound(_0xfc08d5,null))[_0x68ef('0x2d')](respondWithResult(_0xfc08d5,null))[_0x68ef('0x4c')](handleError(_0xfc08d5,null));};exports['create']=function(_0xfc7a74,_0x12fff3){return db[_0x68ef('0x34')][_0x68ef('0x51')](_0xfc7a74[_0x68ef('0x52')],{})['then'](function(_0x35d6bd){var _0x3984ca=_0xfc7a74[_0x68ef('0x53')]['get']({'plain':!![]});if(!_0x3984ca)throw new Error(_0x68ef('0x54'));if(_0x3984ca[_0x68ef('0x55')]===_0x68ef('0x53')){var _0x50ef1f=_0x35d6bd[_0x68ef('0x2e')]({'plain':!![]});var _0x59e8ee='WhatsappQueues';return db[_0x68ef('0x56')]['find']({'where':{'name':_0x59e8ee,'userProfileId':_0x3984ca[_0x68ef('0x57')]},'raw':!![]})[_0x68ef('0x2d')](function(_0x53ebd){if(_0x53ebd&&_0x53ebd[_0x68ef('0x58')]===0x0){return db[_0x68ef('0x59')][_0x68ef('0x51')]({'name':_0x50ef1f[_0x68ef('0x31')],'resourceId':_0x50ef1f['id'],'type':_0x53ebd[_0x68ef('0x31')],'sectionId':_0x53ebd['id']},{})[_0x68ef('0x2d')](function(){return _0x35d6bd;});}else{return _0x35d6bd;}})[_0x68ef('0x4c')](function(_0x538db4){logger['error'](_0x68ef('0x5a'),_0x538db4);throw _0x538db4;});}return _0x35d6bd;})[_0x68ef('0x2d')](respondWithResult(_0x12fff3,0xc9))[_0x68ef('0x4c')](handleError(_0x12fff3,null));};exports[_0x68ef('0x2c')]=function(_0x82df12,_0x1d11d7){if(_0x82df12[_0x68ef('0x52')]['id']){delete _0x82df12[_0x68ef('0x52')]['id'];}return db[_0x68ef('0x34')]['find']({'where':{'id':_0x82df12['params']['id']}})[_0x68ef('0x2d')](handleEntityNotFound(_0x1d11d7,null))['then'](saveUpdates(_0x82df12[_0x68ef('0x52')],null))['then'](respondWithResult(_0x1d11d7,null))[_0x68ef('0x4c')](handleError(_0x1d11d7,null));};exports[_0x68ef('0x5b')]=function(_0x552736,_0xa42737){return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x552736[_0x68ef('0x5d')]['id']}})[_0x68ef('0x2d')](handleEntityNotFound(_0xa42737,null))[_0x68ef('0x2d')](removeEntity(_0xa42737,null))[_0x68ef('0x4c')](handleError(_0xa42737,null));};exports[_0x68ef('0x5e')]=function(_0x5c347c,_0x1cdaef){return db[_0x68ef('0x34')][_0x68ef('0x5e')]()[_0x68ef('0x2d')](respondWithResult(_0x1cdaef,null))[_0x68ef('0x4c')](handleError(_0x1cdaef,null));};exports[_0x68ef('0x5f')]=function(_0x48e15a,_0x9a978f,_0x42d2a3){var _0x4886af={'raw':!![],'where':{}},_0x42fbac={},_0x114d9f;return db[_0x68ef('0x34')]['findOne']({'where':{'id':_0x48e15a[_0x68ef('0x5d')]['id']}})['then'](handleEntityNotFound(_0x9a978f,null))['then'](function(_0x3e5cca){if(_0x3e5cca){_0x114d9f=_0x3e5cca['get']({'plain':!![]});_0x42fbac[_0x68ef('0x39')]=_['keys'](db[_0x68ef('0x60')][_0x68ef('0x4e')]);_0x42fbac[_0x68ef('0x3a')]=_[_0x68ef('0x37')](_0x48e15a[_0x68ef('0x3a')]);_0x42fbac[_0x68ef('0x38')]=_['intersection'](_0x42fbac[_0x68ef('0x39')],_0x42fbac['query']);_0x4886af[_0x68ef('0x3b')]=_['intersection'](_0x42fbac[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0x48e15a[_0x68ef('0x3a')][_0x68ef('0x50')]));_0x4886af[_0x68ef('0x3b')]=_0x4886af[_0x68ef('0x3b')][_0x68ef('0x3c')]?_0x4886af['attributes']:_0x42fbac[_0x68ef('0x39')];if(!_0x48e15a[_0x68ef('0x3a')][_0x68ef('0x61')](_0x68ef('0x3d'))){_0x4886af[_0x68ef('0x23')]=qs['limit'](_0x48e15a[_0x68ef('0x3a')]['limit']);_0x4886af[_0x68ef('0x25')]=qs['offset'](_0x48e15a['query'][_0x68ef('0x25')]);}_0x4886af[_0x68ef('0x3e')]=qs[_0x68ef('0x3f')](_0x48e15a[_0x68ef('0x3a')]['sort']);_0x4886af[_0x68ef('0x40')]=qs['filters'](_[_0x68ef('0x41')](_0x48e15a[_0x68ef('0x3a')],_0x42fbac[_0x68ef('0x38')]));_0x4886af['where']['WhatsappQueueId']=_0x3e5cca['id'];if(_0x48e15a[_0x68ef('0x3a')][_0x68ef('0x42')]){_0x4886af[_0x68ef('0x40')]=_[_0x68ef('0x45')](_0x4886af['where'],{'$or':_[_0x68ef('0x33')](_0x4886af[_0x68ef('0x3b')],function(_0x19c20f){var _0x21b104={};_0x21b104[_0x19c20f]={'$like':'%'+_0x48e15a['query'][_0x68ef('0x42')]+'%'};return _0x21b104;})});}_0x4886af=_['merge']({},_0x4886af,_0x48e15a[_0x68ef('0x46')]);return db[_0x68ef('0x60')][_0x68ef('0x4a')](_0x4886af);}})[_0x68ef('0x2d')](function(_0xed16d1){if(_0xed16d1){return db['User'][_0x68ef('0x62')]({'where':{'id':_[_0x68ef('0x33')](_0xed16d1,_0x68ef('0x63')),'role':'agent'},'attributes':['id',_0x68ef('0x31'),'whatsappPause',_0x68ef('0x64'),'createdAt']});}})['then'](function(_0x100345){if(_0x100345){return{'count':_0x100345[_0x68ef('0x47')],'rows':_[_0x68ef('0x33')](_0x100345[_0x68ef('0x4b')],function(_0x501004){return{'membername':_0x501004[_0x68ef('0x31')],'UserId':_0x501004['id'],'queue_name':_0x114d9f[_0x68ef('0x31')],'WhatsappQueueId':_0x114d9f['id'],'interface':util[_0x68ef('0x65')]('%s/%s',_0x68ef('0x66'),_0x501004[_0x68ef('0x31')]),'penalty':0x0,'paused':_0x501004[_0x68ef('0x67')],'createdAt':_0x501004[_0x68ef('0x68')],'updatedAt':_0x501004[_0x68ef('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x68ef('0x2d')](respondWithFilteredResult(_0x9a978f,_0x4886af))[_0x68ef('0x4c')](handleError(_0x9a978f,null));};exports[_0x68ef('0x69')]=function(_0x156ce3,_0x11feff,_0x454999){var _0x6a48ad={};var _0x50e298={};var _0x15378c;var _0x391a81;return db['WhatsappQueue']['findOne']({'where':{'id':_0x156ce3[_0x68ef('0x5d')]['id']}})['then'](handleEntityNotFound(_0x11feff,null))[_0x68ef('0x2d')](function(_0x253947){if(_0x253947){_0x15378c=_0x253947;_0x50e298['model']=_['keys'](db[_0x68ef('0x6a')]['rawAttributes']);_0x50e298[_0x68ef('0x3a')]=_['keys'](_0x156ce3[_0x68ef('0x3a')]);_0x50e298['filters']=_[_0x68ef('0x4f')](_0x50e298[_0x68ef('0x39')],_0x50e298['query']);_0x6a48ad[_0x68ef('0x3b')]=_[_0x68ef('0x4f')](_0x50e298[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0x156ce3['query'][_0x68ef('0x50')]));_0x6a48ad[_0x68ef('0x3b')]=_0x6a48ad['attributes'][_0x68ef('0x3c')]?_0x6a48ad[_0x68ef('0x3b')]:_0x50e298[_0x68ef('0x39')];_0x6a48ad['order']=qs[_0x68ef('0x3f')](_0x156ce3['query'][_0x68ef('0x3f')]);_0x6a48ad[_0x68ef('0x40')]=qs['filters'](_['pick'](_0x156ce3['query'],_0x50e298['filters']));if(_0x156ce3[_0x68ef('0x3a')][_0x68ef('0x42')]){_0x6a48ad[_0x68ef('0x40')]=_[_0x68ef('0x45')](_0x6a48ad[_0x68ef('0x40')],{'$or':_[_0x68ef('0x33')](_0x6a48ad[_0x68ef('0x3b')],function(_0x285744){var _0x24ba34={};_0x24ba34[_0x285744]={'$like':'%'+_0x156ce3[_0x68ef('0x3a')][_0x68ef('0x42')]+'%'};return _0x24ba34;})});}_0x6a48ad=_[_0x68ef('0x45')]({},_0x6a48ad,_0x156ce3[_0x68ef('0x46')]);return _0x15378c['getTeams'](_0x6a48ad);}})[_0x68ef('0x2d')](function(_0x556dfc){if(_0x556dfc){_0x391a81=_0x556dfc[_0x68ef('0x3c')];if(!_0x156ce3['query']['hasOwnProperty'](_0x68ef('0x3d'))){_0x6a48ad[_0x68ef('0x23')]=qs[_0x68ef('0x23')](_0x156ce3[_0x68ef('0x3a')]['limit']);_0x6a48ad['offset']=qs[_0x68ef('0x25')](_0x156ce3[_0x68ef('0x3a')][_0x68ef('0x25')]);}return _0x15378c['getTeams'](_0x6a48ad);}})[_0x68ef('0x2d')](function(_0x23c69e){if(_0x23c69e){return _0x23c69e?{'count':_0x391a81,'rows':_0x23c69e}:null;}})[_0x68ef('0x2d')](respondWithResult(_0x11feff,null))[_0x68ef('0x4c')](handleError(_0x11feff,null));};exports['addTeams']=function(_0x214e89,_0x1d158f,_0x31550b){var _0x59d7d=_0x214e89[_0x68ef('0x52')][_0x68ef('0x6b')];return db['Team'][_0x68ef('0x4a')]({'where':{'id':_0x59d7d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x6c'),'attributes':['id',_0x68ef('0x31'),_0x68ef('0x6d'),_0x68ef('0x6e'),'interface'],'raw':!![]}]})[_0x68ef('0x2d')](function(_0x4c47ab){if(_0x4c47ab){var _0x3d8d69=_[_0x68ef('0x6f')](_0x4c47ab,function(_0x5d6a31){var _0x55486a=_0x5d6a31[_0x68ef('0x2e')]({'plain':!![]});return _0x55486a['Agents'];});return db[_0x68ef('0x34')]['find']({'where':{'id':_0x214e89[_0x68ef('0x5d')]['id']}})[_0x68ef('0x2d')](function(_0x17385b){return db[_0x68ef('0x70')][_0x68ef('0x71')](function(_0x66a7a8){return _0x17385b['addTeams'](_0x59d7d,{'transaction':_0x66a7a8})[_0x68ef('0x2d')](function(){return BPromise[_0x68ef('0x72')](_0x3d8d69,function(_0x31cf5b){return db[_0x68ef('0x60')][_0x68ef('0x73')]({'where':{'UserId':_0x31cf5b['id'],'WhatsappQueueId':_0x214e89[_0x68ef('0x5d')]['id']},'transaction':_0x66a7a8});});})[_0x68ef('0x2d')](function(){_0x3d8d69['forEach'](function(_0x295c0f){socket[_0x68ef('0x74')](_0x68ef('0x75'),{'UserId':_0x295c0f['id'],'WhatsappQueueId':_0x17385b['id']});});});});});}})[_0x68ef('0x2d')](respondWithStatusCode(_0x1d158f,null))[_0x68ef('0x4c')](handleError(_0x1d158f,null));};exports[_0x68ef('0x76')]=function(_0x3e0d3d,_0x4478de,_0x1bcbbb){return db['Team'][_0x68ef('0x4a')]({'where':{'id':_0x3e0d3d['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x68ef('0x2d')](handleEntityNotFound(_0x4478de,null))[_0x68ef('0x2d')](function(_0x55fc26){var _0x5aa209=_['map'](_0x55fc26,'id');var _0x2197c9=[];var _0x1d2b95=[];var _0x239d05=squel[_0x68ef('0x77')]();_0x239d05[_0x68ef('0x78')](_0x68ef('0x79'))['from'](_0x68ef('0x7a'),'tq')[_0x68ef('0x7b')](_0x68ef('0x7c'),'ut',_0x68ef('0x7d'))['where'](_0x68ef('0x7e'),_0x3e0d3d[_0x68ef('0x5d')]['id']);for(var _0x2e88ba=0x0;_0x2e88ba<_0x55fc26[_0x68ef('0x3c')];_0x2e88ba+=0x1){let _0x311a40=_0x55fc26[_0x2e88ba];for(var _0x254267=0x0;_0x254267<_0x311a40[_0x68ef('0x6c')][_0x68ef('0x3c')];_0x254267+=0x1){let _0x4cdc78=_0x311a40[_0x68ef('0x6c')][_0x254267];var _0x210ba6=_0x239d05['clone']();_0x210ba6[_0x68ef('0x40')](_0x68ef('0x7f'),_0x4cdc78['id']);_0x1d2b95[_0x68ef('0x80')](db[_0x68ef('0x70')][_0x68ef('0x3a')](_0x210ba6[_0x68ef('0x81')](),{'type':db[_0x68ef('0x70')][_0x68ef('0x82')][_0x68ef('0x83')]})[_0x68ef('0x2d')](function(_0x29522c){if(_0x29522c[_0x68ef('0x3c')]===0x1){return _0x4cdc78['id'];}else{var _0x2ce303=_[_0x68ef('0x84')](_[_0x68ef('0x33')](_0x29522c,_0x68ef('0x85')),function(_0x468130){return _[_0x68ef('0x86')](_0x5aa209,_0x468130);});if(_0x2ce303){return _0x4cdc78['id'];}}}));}}return BPromise['all'](_0x1d2b95)[_0x68ef('0x2d')](function(_0x2e815a){_0x2197c9=_(_0x2197c9)[_0x68ef('0x87')](_0x2e815a)[_0x68ef('0x88')]()[_0x68ef('0x89')]();return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x3e0d3d[_0x68ef('0x5d')]['id']}})['then'](function(_0x3d918b){return db['sequelize']['transaction'](function(_0x5a6148){return _0x3d918b['removeTeams'](_0x3e0d3d[_0x68ef('0x3a')]['ids'],{'transaction':_0x5a6148})[_0x68ef('0x2d')](function(){if(!_['isEmpty'](_0x2197c9)){return _0x3d918b['removeAgents'](_0x2197c9,{'transaction':_0x5a6148});}})['then'](function(){_0x2197c9[_0x68ef('0x8a')](function(_0x2e4c71){socket[_0x68ef('0x74')](_0x68ef('0x8b'),{'UserId':_0x2e4c71,'WhatsappQueueId':_0x3d918b['id']});});});});});});})[_0x68ef('0x2d')](respondWithStatusCode(_0x4478de,null))['catch'](handleError(_0x4478de,null));};exports[_0x68ef('0x8c')]=function(_0x263da0,_0x2fcfbe,_0x78f4f8){return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x263da0['params']['id']}})['then'](handleEntityNotFound(_0x2fcfbe,null))['then'](function(_0xbc0be3){if(_0xbc0be3){return _0xbc0be3[_0x68ef('0x8c')](_0x263da0[_0x68ef('0x52')][_0x68ef('0x6b')],_[_0x68ef('0x8d')](_0x263da0[_0x68ef('0x52')],[_0x68ef('0x6b'),'id'])||{})[_0x68ef('0x8e')](function(_0xa4e92){for(var _0x302c38=0x0;_0x302c38<_0x263da0[_0x68ef('0x52')][_0x68ef('0x6b')]['length'];_0x302c38+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':_0x263da0[_0x68ef('0x52')][_0x68ef('0x6b')][_0x302c38],'WhatsappQueueId':_0x263da0[_0x68ef('0x5d')]['id']});}return _0xa4e92;});}})['then'](respondWithResult(_0x2fcfbe,null))[_0x68ef('0x4c')](handleError(_0x2fcfbe,null));};exports['removeAgents']=function(_0x462a47,_0xc07b77,_0x635aa4){return db['WhatsappQueue'][_0x68ef('0x5c')]({'where':{'id':_0x462a47[_0x68ef('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc07b77,null))[_0x68ef('0x2d')](function(_0x1b9bfc){if(_0x1b9bfc){return _0x1b9bfc[_0x68ef('0x8f')](_0x462a47[_0x68ef('0x3a')][_0x68ef('0x6b')])[_0x68ef('0x2d')](function(){if(_[_0x68ef('0x90')](_0x462a47['query'][_0x68ef('0x6b')])){for(var _0x26121d=0x0;_0x26121d<_0x462a47[_0x68ef('0x3a')][_0x68ef('0x6b')][_0x68ef('0x3c')];_0x26121d+=0x1){socket[_0x68ef('0x74')](_0x68ef('0x8b'),{'UserId':Number(_0x462a47[_0x68ef('0x3a')][_0x68ef('0x6b')][_0x26121d]),'WhatsappQueueId':Number(_0x462a47[_0x68ef('0x5d')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x462a47[_0x68ef('0x3a')]['ids']),'WhatsappQueueId':Number(_0x462a47[_0x68ef('0x5d')]['id'])});}});}})[_0x68ef('0x2d')](respondWithStatusCode(_0xc07b77,null))[_0x68ef('0x4c')](handleError(_0xc07b77,null));};exports[_0x68ef('0x91')]=function(_0xd2a5d3,_0x489c26,_0x80fa59){var _0x1c3449={};var _0x1910d2={};var _0x3c862a;var _0x5129e9;return db['WhatsappQueue'][_0x68ef('0x92')]({'where':{'id':_0xd2a5d3[_0x68ef('0x5d')]['id']}})[_0x68ef('0x2d')](handleEntityNotFound(_0x489c26,null))[_0x68ef('0x2d')](function(_0x1914e9){if(_0x1914e9){_0x3c862a=_0x1914e9;_0x1910d2[_0x68ef('0x39')]=_[_0x68ef('0x37')](db[_0x68ef('0x93')][_0x68ef('0x4e')]);_0x1910d2[_0x68ef('0x3a')]=_[_0x68ef('0x37')](_0xd2a5d3['query']);_0x1910d2[_0x68ef('0x38')]=_[_0x68ef('0x4f')](_0x1910d2[_0x68ef('0x39')],_0x1910d2[_0x68ef('0x3a')]);_0x1c3449[_0x68ef('0x3b')]=_[_0x68ef('0x4f')](_0x1910d2[_0x68ef('0x39')],qs[_0x68ef('0x50')](_0xd2a5d3[_0x68ef('0x3a')][_0x68ef('0x50')]));_0x1c3449['attributes']=_0x1c3449['attributes'][_0x68ef('0x3c')]?_0x1c3449[_0x68ef('0x3b')]:_0x1910d2[_0x68ef('0x39')];_0x1c3449[_0x68ef('0x3e')]=qs[_0x68ef('0x3f')](_0xd2a5d3[_0x68ef('0x3a')][_0x68ef('0x3f')]);_0x1c3449['where']=qs[_0x68ef('0x38')](_[_0x68ef('0x41')](_0xd2a5d3[_0x68ef('0x3a')],_0x1910d2[_0x68ef('0x38')]));if(_0xd2a5d3['query'][_0x68ef('0x42')]){_0x1c3449['where']=_[_0x68ef('0x45')](_0x1c3449[_0x68ef('0x40')],{'$or':_[_0x68ef('0x33')](_0x1c3449['attributes'],function(_0x53ff16){var _0xfc06d5={};_0xfc06d5[_0x53ff16]={'$like':'%'+_0xd2a5d3['query'][_0x68ef('0x42')]+'%'};return _0xfc06d5;})});}_0x1c3449=_['merge']({},_0x1c3449,_0xd2a5d3[_0x68ef('0x46')]);return _0x3c862a[_0x68ef('0x91')](_0x1c3449);}})['then'](function(_0x4a172f){if(_0x4a172f){_0x5129e9=_0x4a172f[_0x68ef('0x3c')];if(!_0xd2a5d3[_0x68ef('0x3a')]['hasOwnProperty'](_0x68ef('0x3d'))){_0x1c3449[_0x68ef('0x23')]=qs[_0x68ef('0x23')](_0xd2a5d3['query']['limit']);_0x1c3449[_0x68ef('0x25')]=qs['offset'](_0xd2a5d3[_0x68ef('0x3a')][_0x68ef('0x25')]);}return _0x3c862a[_0x68ef('0x91')](_0x1c3449);}})[_0x68ef('0x2d')](function(_0x15a8f1){if(_0x15a8f1){return _0x15a8f1?{'count':_0x5129e9,'rows':_0x15a8f1}:null;}})[_0x68ef('0x2d')](respondWithResult(_0x489c26,null))['catch'](handleError(_0x489c26,null));};
\ No newline at end of file
index 13e8b55..75d13df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x003a=['events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2cc9e5,_0x3a797f){var _0x589d4c=function(_0x7adde6){while(--_0x7adde6){_0x2cc9e5['push'](_0x2cc9e5['shift']());}};_0x589d4c(++_0x3a797f);}(_0x003a,0x118));var _0xa003=function(_0x387340,_0x30e8bd){_0x387340=_0x387340-0x0;var _0x14b27a=_0x003a[_0x387340];return _0x14b27a;};'use strict';var EventEmitter=require(_0xa003('0x0'));var WhatsappQueue=require(_0xa003('0x1'))['db'][_0xa003('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa003('0x3')](0x0);var events={'afterCreate':_0xa003('0x4'),'afterUpdate':'update','afterDestroy':_0xa003('0x5')};function emitEvent(_0x383a92){return function(_0x6af7fd,_0x45d14e,_0x307b41){WhatsappQueueEvents['emit'](_0x383a92+':'+_0x6af7fd['id'],_0x6af7fd);WhatsappQueueEvents[_0xa003('0x6')](_0x383a92,_0x6af7fd);_0x307b41(null);};}for(var e in events){if(events[_0xa003('0x7')](e)){var event=events[e];WhatsappQueue[_0xa003('0x8')](e,emitEvent(event));}}module[_0xa003('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x678f=['remove','emit','hasOwnProperty','hook','events','WhatsappQueue','setMaxListeners','save','update'];(function(_0xafc3be,_0xf69cd1){var _0x2d8c7c=function(_0x16b7fa){while(--_0x16b7fa){_0xafc3be['push'](_0xafc3be['shift']());}};_0x2d8c7c(++_0xf69cd1);}(_0x678f,0x17e));var _0xf678=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x678f[_0x4bb581];return _0x316bf5;};'use strict';var EventEmitter=require(_0xf678('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xf678('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf678('0x2')](0x0);var events={'afterCreate':_0xf678('0x3'),'afterUpdate':_0xf678('0x4'),'afterDestroy':_0xf678('0x5')};function emitEvent(_0x13968e){return function(_0x3dcf8d,_0x2ece04,_0x91f042){WhatsappQueueEvents[_0xf678('0x6')](_0x13968e+':'+_0x3dcf8d['id'],_0x3dcf8d);WhatsappQueueEvents[_0xf678('0x6')](_0x13968e,_0x3dcf8d);_0x91f042(null);};}for(var e in events){if(events[_0xf678('0x7')](e)){var event=events[e];WhatsappQueue[_0xf678('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
index e90b46c..2d64166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4573=['moment','request-promise','path','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x4e5a29,_0x35e549){var _0x3c1888=function(_0x225a33){while(--_0x225a33){_0x4e5a29['push'](_0x4e5a29['shift']());}};_0x3c1888(++_0x35e549);}(_0x4573,0x18f));var _0x3457=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4573[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3457('0x0'));var util=require(_0x3457('0x1'));var logger=require(_0x3457('0x2'))(_0x3457('0x3'));var moment=require(_0x3457('0x4'));var BPromise=require('bluebird');var rp=require(_0x3457('0x5'));var fs=require('fs');var path=require(_0x3457('0x6'));var rimraf=require('rimraf');var config=require(_0x3457('0x7'));var attributes=require(_0x3457('0x8'));module[_0x3457('0x9')]=function(_0x1183d2,_0x2506c0){return _0x1183d2[_0x3457('0xa')](_0x3457('0xb'),attributes,{'tableName':_0x3457('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb52a=['bluebird','rimraf','../../config/environment','./whatsappQueue.attributes','exports','lodash','../../config/logger','moment'];(function(_0x1bd8b7,_0x2a161f){var _0x2067ec=function(_0x2d9d7d){while(--_0x2d9d7d){_0x1bd8b7['push'](_0x1bd8b7['shift']());}};_0x2067ec(++_0x2a161f);}(_0xb52a,0x14d));var _0xab52=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0xb52a[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xab52('0x0'));var util=require('util');var logger=require(_0xab52('0x1'))('api');var moment=require(_0xab52('0x2'));var BPromise=require(_0xab52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab52('0x4'));var config=require(_0xab52('0x5'));var attributes=require(_0xab52('0x6'));module[_0xab52('0x7')]=function(_0x40f8d3,_0x104e51){return _0x40f8d3['define']('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 957bce6..cec9b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9883=['client','http','defaults','redis','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x9883,0x11b));var _0x3988=function(_0xc417ab,_0x125e01){_0xc417ab=_0xc417ab-0x0;var _0x579952=_0x9883[_0xc417ab];return _0x579952;};'use strict';var _=require(_0x3988('0x0'));var util=require('util');var moment=require(_0x3988('0x1'));var BPromise=require(_0x3988('0x2'));var rs=require(_0x3988('0x3'));var fs=require('fs');var Redis=require(_0x3988('0x4'));var db=require(_0x3988('0x5'))['db'];var utils=require(_0x3988('0x6'));var logger=require(_0x3988('0x7'))(_0x3988('0x8'));var config=require(_0x3988('0x9'));var jayson=require(_0x3988('0xa'));var client=jayson[_0x3988('0xb')][_0x3988('0xc')]({'port':0x232a});config['redis']=_[_0x3988('0xd')](config[_0x3988('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x3988('0xf'))(new Redis(config[_0x3988('0xe')]));require('./whatsappQueue.socket')[_0x3988('0x10')](socket);function respondWithRpcPromise(_0x29d71f,_0x3b96da,_0x440145){return new BPromise(function(_0x1ebd48,_0x4b8ab5){return client[_0x3988('0x11')](_0x29d71f,_0x440145)[_0x3988('0x12')](function(_0x44b091){logger[_0x3988('0x13')](_0x3988('0x14'),_0x3b96da,_0x3988('0x15'));logger[_0x3988('0x16')](_0x3988('0x17'),_0x3b96da,_0x3988('0x15'),JSON[_0x3988('0x18')](_0x44b091));if(_0x44b091[_0x3988('0x19')]){if(_0x44b091[_0x3988('0x19')][_0x3988('0x1a')]===0x1f4){logger[_0x3988('0x19')](_0x3988('0x14'),_0x3b96da,_0x44b091[_0x3988('0x19')][_0x3988('0x1b')]);return _0x4b8ab5(_0x44b091[_0x3988('0x19')]['message']);}logger[_0x3988('0x19')](_0x3988('0x14'),_0x3b96da,_0x44b091[_0x3988('0x19')][_0x3988('0x1b')]);return _0x1ebd48(_0x44b091['error']['message']);}else{logger[_0x3988('0x13')](_0x3988('0x14'),_0x3b96da,_0x3988('0x15'));_0x1ebd48(_0x44b091[_0x3988('0x1c')][_0x3988('0x1b')]);}})[_0x3988('0x1d')](function(_0x48433a){logger[_0x3988('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x3b96da,_0x48433a);_0x4b8ab5(_0x48433a);});});}exports['GetWhatsappQueue']=function(_0x2dcd47){var _0x55416e=this;return new Promise(function(_0x178cb6,_0x593606){return db[_0x3988('0x1e')][_0x3988('0x1f')]({'raw':_0x2dcd47[_0x3988('0x20')]?_0x2dcd47['options'][_0x3988('0x21')]===undefined?!![]:![]:!![],'where':_0x2dcd47[_0x3988('0x20')]?_0x2dcd47[_0x3988('0x20')][_0x3988('0x22')]||null:null,'attributes':_0x2dcd47[_0x3988('0x20')]?_0x2dcd47[_0x3988('0x20')][_0x3988('0x23')]||null:null,'limit':_0x2dcd47['options']?_0x2dcd47[_0x3988('0x20')]['limit']||null:null,'include':_0x2dcd47[_0x3988('0x20')]?_0x2dcd47['options'][_0x3988('0x24')]?_[_0x3988('0x25')](_0x2dcd47[_0x3988('0x20')][_0x3988('0x24')],function(_0x59a1e3){return{'model':db[_0x59a1e3[_0x3988('0x26')]],'as':_0x59a1e3['as'],'attributes':_0x59a1e3[_0x3988('0x23')],'include':_0x59a1e3['include']?_[_0x3988('0x25')](_0x59a1e3[_0x3988('0x24')],function(_0x3a4172){return{'model':db[_0x3a4172[_0x3988('0x26')]],'as':_0x3a4172['as'],'attributes':_0x3a4172[_0x3988('0x23')],'include':_0x3a4172[_0x3988('0x24')]?_[_0x3988('0x25')](_0x3a4172[_0x3988('0x24')],function(_0x382b2c){return{'model':db[_0x382b2c[_0x3988('0x26')]],'as':_0x382b2c['as'],'attributes':_0x382b2c[_0x3988('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3988('0x12')](function(_0xd4f49d){logger[_0x3988('0x13')](_0x3988('0x27'),_0x2dcd47);logger['debug'](_0x3988('0x27'),_0x2dcd47,JSON[_0x3988('0x18')](_0xd4f49d));_0x178cb6(_0xd4f49d);})[_0x3988('0x1d')](function(_0x55b058){logger[_0x3988('0x19')](_0x3988('0x27'),_0x55b058['message'],_0x2dcd47);_0x593606(_0x55416e[_0x3988('0x19')](0x1f4,_0x55b058[_0x3988('0x1b')]));});});};exports[_0x3988('0x28')]=function(_0x19bcab){var _0xc40602=this;return new Promise(function(_0x42191d,_0xd89a4c){return db[_0x3988('0x1e')][_0x3988('0x29')]({'raw':_0x19bcab[_0x3988('0x20')]?_0x19bcab[_0x3988('0x20')][_0x3988('0x21')]===undefined?!![]:![]:!![],'where':_0x19bcab['options']?_0x19bcab[_0x3988('0x20')]['where']||null:null,'attributes':_0x19bcab[_0x3988('0x20')]?_0x19bcab[_0x3988('0x20')][_0x3988('0x23')]||null:null,'include':_0x19bcab[_0x3988('0x20')]?_0x19bcab['options'][_0x3988('0x24')]?_[_0x3988('0x25')](_0x19bcab[_0x3988('0x20')][_0x3988('0x24')],function(_0x2d4653){return{'model':db[_0x2d4653['model']],'as':_0x2d4653['as'],'attributes':_0x2d4653[_0x3988('0x23')],'include':_0x2d4653[_0x3988('0x24')]?_[_0x3988('0x25')](_0x2d4653[_0x3988('0x24')],function(_0x5c9d0d){return{'model':db[_0x5c9d0d['model']],'as':_0x5c9d0d['as'],'attributes':_0x5c9d0d[_0x3988('0x23')],'include':_0x5c9d0d[_0x3988('0x24')]?_['map'](_0x5c9d0d['include'],function(_0x3b97ec){return{'model':db[_0x3b97ec[_0x3988('0x26')]],'as':_0x3b97ec['as'],'attributes':_0x3b97ec[_0x3988('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3988('0x12')](function(_0x28f3fe){logger[_0x3988('0x13')](_0x3988('0x28'),_0x19bcab);logger['debug'](_0x3988('0x28'),_0x19bcab,JSON[_0x3988('0x18')](_0x28f3fe));_0x42191d(_0x28f3fe);})[_0x3988('0x1d')](function(_0x409a7d){logger[_0x3988('0x19')](_0x3988('0x28'),_0x409a7d[_0x3988('0x1b')],_0x19bcab);_0xd89a4c(_0xc40602[_0x3988('0x19')](0x1f4,_0x409a7d['message']));});});};
\ No newline at end of file
+var _0x9de7=['code','message','result','catch','WhatsappQueue','options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2543d7,_0x211f7d){var _0x3acf68=function(_0x24c12b){while(--_0x24c12b){_0x2543d7['push'](_0x2543d7['shift']());}};_0x3acf68(++_0x211f7d);}(_0x9de7,0x88));var _0x79de=function(_0x5f20f0,_0x4cfb6d){_0x5f20f0=_0x5f20f0-0x0;var _0x16b5a2=_0x9de7[_0x5f20f0];return _0x16b5a2;};'use strict';var _=require(_0x79de('0x0'));var util=require(_0x79de('0x1'));var moment=require(_0x79de('0x2'));var BPromise=require(_0x79de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79de('0x4'));var db=require(_0x79de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x79de('0x6'))('rpc');var config=require(_0x79de('0x7'));var jayson=require(_0x79de('0x8'));var client=jayson[_0x79de('0x9')][_0x79de('0xa')]({'port':0x232a});config[_0x79de('0xb')]=_[_0x79de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79de('0xd'))[_0x79de('0xe')](socket);function respondWithRpcPromise(_0x2f3ec7,_0x105f37,_0x327d31){return new BPromise(function(_0x194c44,_0x5edbb4){return client[_0x79de('0xf')](_0x2f3ec7,_0x327d31)[_0x79de('0x10')](function(_0x1bb33c){logger[_0x79de('0x11')](_0x79de('0x12'),_0x105f37,_0x79de('0x13'));logger[_0x79de('0x14')](_0x79de('0x15'),_0x105f37,'request\x20sent',JSON[_0x79de('0x16')](_0x1bb33c));if(_0x1bb33c[_0x79de('0x17')]){if(_0x1bb33c[_0x79de('0x17')][_0x79de('0x18')]===0x1f4){logger[_0x79de('0x17')](_0x79de('0x12'),_0x105f37,_0x1bb33c[_0x79de('0x17')][_0x79de('0x19')]);return _0x5edbb4(_0x1bb33c['error'][_0x79de('0x19')]);}logger[_0x79de('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x105f37,_0x1bb33c[_0x79de('0x17')]['message']);return _0x194c44(_0x1bb33c['error'][_0x79de('0x19')]);}else{logger[_0x79de('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x105f37,_0x79de('0x13'));_0x194c44(_0x1bb33c[_0x79de('0x1a')][_0x79de('0x19')]);}})[_0x79de('0x1b')](function(_0x5c3e07){logger['error'](_0x79de('0x12'),_0x105f37,_0x5c3e07);_0x5edbb4(_0x5c3e07);});});}exports['GetWhatsappQueue']=function(_0x5c411c){var _0x2d94b6=this;return new Promise(function(_0x1e8913,_0x5cfbfd){return db[_0x79de('0x1c')]['findAll']({'raw':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')][_0x79de('0x1e')]||null:null,'attributes':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')][_0x79de('0x1f')]||null:null,'limit':_0x5c411c[_0x79de('0x1d')]?_0x5c411c[_0x79de('0x1d')][_0x79de('0x20')]||null:null,'include':_0x5c411c['options']?_0x5c411c['options'][_0x79de('0x21')]?_[_0x79de('0x22')](_0x5c411c[_0x79de('0x1d')][_0x79de('0x21')],function(_0x292334){return{'model':db[_0x292334[_0x79de('0x23')]],'as':_0x292334['as'],'attributes':_0x292334[_0x79de('0x1f')],'include':_0x292334['include']?_[_0x79de('0x22')](_0x292334['include'],function(_0x108c51){return{'model':db[_0x108c51['model']],'as':_0x108c51['as'],'attributes':_0x108c51[_0x79de('0x1f')],'include':_0x108c51[_0x79de('0x21')]?_[_0x79de('0x22')](_0x108c51[_0x79de('0x21')],function(_0x14da8f){return{'model':db[_0x14da8f[_0x79de('0x23')]],'as':_0x14da8f['as'],'attributes':_0x14da8f[_0x79de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x79de('0x10')](function(_0x557384){logger[_0x79de('0x11')]('GetWhatsappQueue',_0x5c411c);logger[_0x79de('0x14')](_0x79de('0x24'),_0x5c411c,JSON[_0x79de('0x16')](_0x557384));_0x1e8913(_0x557384);})[_0x79de('0x1b')](function(_0x2f3335){logger[_0x79de('0x17')]('GetWhatsappQueue',_0x2f3335[_0x79de('0x19')],_0x5c411c);_0x5cfbfd(_0x2d94b6[_0x79de('0x17')](0x1f4,_0x2f3335[_0x79de('0x19')]));});});};exports[_0x79de('0x25')]=function(_0x5dfeaa){var _0x96650c=this;return new Promise(function(_0x59d28b,_0x534efe){return db[_0x79de('0x1c')][_0x79de('0x26')]({'raw':_0x5dfeaa['options']?_0x5dfeaa[_0x79de('0x1d')][_0x79de('0x27')]===undefined?!![]:![]:!![],'where':_0x5dfeaa['options']?_0x5dfeaa[_0x79de('0x1d')][_0x79de('0x1e')]||null:null,'attributes':_0x5dfeaa['options']?_0x5dfeaa['options'][_0x79de('0x1f')]||null:null,'include':_0x5dfeaa['options']?_0x5dfeaa['options'][_0x79de('0x21')]?_[_0x79de('0x22')](_0x5dfeaa[_0x79de('0x1d')][_0x79de('0x21')],function(_0x12dadb){return{'model':db[_0x12dadb[_0x79de('0x23')]],'as':_0x12dadb['as'],'attributes':_0x12dadb['attributes'],'include':_0x12dadb[_0x79de('0x21')]?_[_0x79de('0x22')](_0x12dadb[_0x79de('0x21')],function(_0x417afe){return{'model':db[_0x417afe[_0x79de('0x23')]],'as':_0x417afe['as'],'attributes':_0x417afe[_0x79de('0x1f')],'include':_0x417afe[_0x79de('0x21')]?_['map'](_0x417afe[_0x79de('0x21')],function(_0x257f9e){return{'model':db[_0x257f9e[_0x79de('0x23')]],'as':_0x257f9e['as'],'attributes':_0x257f9e[_0x79de('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x79de('0x10')](function(_0x3a681e){logger[_0x79de('0x11')](_0x79de('0x25'),_0x5dfeaa);logger[_0x79de('0x14')](_0x79de('0x25'),_0x5dfeaa,JSON['stringify'](_0x3a681e));_0x59d28b(_0x3a681e);})[_0x79de('0x1b')](function(_0x1ae550){logger[_0x79de('0x17')]('ShowWhatsappQueue',_0x1ae550[_0x79de('0x19')],_0x5dfeaa);_0x534efe(_0x96650c[_0x79de('0x17')](0x1f4,_0x1ae550[_0x79de('0x19')]));});});};
\ No newline at end of file
index 8e4c439..a68be46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e06=['register','length','whatsappQueue:','./whatsappQueue.events','remove','update','emit','removeListener'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7e06,0x1c3));var _0x67e0=function(_0x59d4ca,_0x3a340f){_0x59d4ca=_0x59d4ca-0x0;var _0x457c48=_0x7e06[_0x59d4ca];return _0x457c48;};'use strict';var WhatsappQueueEvents=require(_0x67e0('0x0'));var events=['save',_0x67e0('0x1'),_0x67e0('0x2')];function createListener(_0x55e8ec,_0x2d44a9){return function(_0x6707f7){_0x2d44a9[_0x67e0('0x3')](_0x55e8ec,_0x6707f7);};}function removeListener(_0x54cff4,_0x1834cf){return function(){WhatsappQueueEvents[_0x67e0('0x4')](_0x54cff4,_0x1834cf);};}exports[_0x67e0('0x5')]=function(_0x2a1324){for(var _0x3cb685=0x0,_0xfdd373=events[_0x67e0('0x6')];_0x3cb685<_0xfdd373;_0x3cb685++){var _0x29d2e0=events[_0x3cb685];var _0x431686=createListener(_0x67e0('0x7')+_0x29d2e0,_0x2a1324);WhatsappQueueEvents['on'](_0x29d2e0,_0x431686);}};
\ No newline at end of file
+var _0x4e4f=['./whatsappQueue.events','remove','removeListener','register','length','whatsappQueue:'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x4e4f,0x7e));var _0xf4e4=function(_0x3c3cca,_0x5f14ed){_0x3c3cca=_0x3c3cca-0x0;var _0x17e508=_0x4e4f[_0x3c3cca];return _0x17e508;};'use strict';var WhatsappQueueEvents=require(_0xf4e4('0x0'));var events=['save',_0xf4e4('0x1'),'update'];function createListener(_0x5ed846,_0xd39e92){return function(_0x3321b7){_0xd39e92['emit'](_0x5ed846,_0x3321b7);};}function removeListener(_0xd76a4,_0xba6783){return function(){WhatsappQueueEvents[_0xf4e4('0x2')](_0xd76a4,_0xba6783);};}exports[_0xf4e4('0x3')]=function(_0x2fc75e){for(var _0x1b5445=0x0,_0x5d905b=events[_0xf4e4('0x4')];_0x1b5445<_0x5d905b;_0x1b5445++){var _0x218a89=events[_0x1b5445];var _0x2c2023=createListener(_0xf4e4('0x5')+_0x218a89,_0x2fc75e);WhatsappQueueEvents['on'](_0x218a89,_0x2c2023);}};
\ No newline at end of file
index 2a806d3..d1819a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c20=['create','update','delete','/:id','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x291bdd,_0x2ffc53){var _0x3a3ce0=function(_0x5db409){while(--_0x5db409){_0x291bdd['push'](_0x291bdd['shift']());}};_0x3a3ce0(++_0x2ffc53);}(_0x3c20,0x17c));var _0x03c2=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3c20[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x03c2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x03c2('0x1'));var express=require(_0x03c2('0x2'));var router=express[_0x03c2('0x3')]();var fs_extra=require(_0x03c2('0x4'));var auth=require(_0x03c2('0x5'));var interaction=require(_0x03c2('0x6'));var config=require(_0x03c2('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x03c2('0x8')]('/',auth[_0x03c2('0x9')](),controller['index']);router[_0x03c2('0x8')]('/describe',auth[_0x03c2('0x9')](),controller['describe']);router[_0x03c2('0x8')]('/:id',auth[_0x03c2('0x9')](),controller['show']);router['post']('/',auth[_0x03c2('0x9')](),controller[_0x03c2('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x03c2('0xb')]);router[_0x03c2('0xc')](_0x03c2('0xd'),auth[_0x03c2('0x9')](),controller['destroy']);module[_0x03c2('0xe')]=router;
\ No newline at end of file
+var _0x9035=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x9035,0xd3));var _0x5903=function(_0xd0e3d8,_0x2d51d9){_0xd0e3d8=_0xd0e3d8-0x0;var _0x145da9=_0x9035[_0xd0e3d8];return _0x145da9;};'use strict';var multer=require(_0x5903('0x0'));var util=require(_0x5903('0x1'));var path=require(_0x5903('0x2'));var timeout=require(_0x5903('0x3'));var express=require(_0x5903('0x4'));var router=express[_0x5903('0x5')]();var fs_extra=require(_0x5903('0x6'));var auth=require(_0x5903('0x7'));var interaction=require(_0x5903('0x8'));var config=require(_0x5903('0x9'));var controller=require(_0x5903('0xa'));router[_0x5903('0xb')]('/',auth[_0x5903('0xc')](),controller[_0x5903('0xd')]);router[_0x5903('0xb')]('/describe',auth[_0x5903('0xc')](),controller[_0x5903('0xe')]);router[_0x5903('0xb')](_0x5903('0xf'),auth[_0x5903('0xc')](),controller[_0x5903('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5903('0x11')]);router['put'](_0x5903('0xf'),auth[_0x5903('0xc')](),controller[_0x5903('0x12')]);router[_0x5903('0x13')](_0x5903('0xf'),auth[_0x5903('0xc')](),controller[_0x5903('0x14')]);module[_0x5903('0x15')]=router;
\ No newline at end of file
index cf15405..c142a4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x6ffcaa,_0x188fa0){var _0x4803b1=function(_0x7a81fc){while(--_0x7a81fc){_0x6ffcaa['push'](_0x6ffcaa['shift']());}};_0x4803b1(++_0x188fa0);}(_0x7a54,0x106));var _0x47a5=function(_0x3bfda4,_0x2b9d6f){_0x3bfda4=_0x3bfda4-0x0;var _0x386a32=_0x7a54[_0x3bfda4];return _0x386a32;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x55e4b7,_0x5b6806){var _0x57275d=function(_0x113941){while(--_0x113941){_0x55e4b7['push'](_0x55e4b7['shift']());}};_0x57275d(++_0x5b6806);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd65e,_0x5b9bc5){_0x1fd65e=_0x1fd65e-0x0;var _0x3fbbc9=_0x7a54[_0x1fd65e];return _0x3fbbc9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index 1f330e1..9ae9dfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1e3=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status','set','Content-Range','apply','reject','destroy','then','end','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','util'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4380a3,_0x246c65){_0x4380a3=_0x4380a3-0x0;var _0x3732bf=_0xe1e3[_0x4380a3];return _0x3732bf;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)[_0x3e1e('0x1f')]();});}};}function handleEntityNotFound(_0x159212,_0x43d583){return function(_0x21c898){if(!_0x21c898){_0x159212['sendStatus'](0x194);}return _0x21c898;};}function handleError(_0x5d908e,_0x44e419){_0x44e419=_0x44e419||0x1f4;return function(_0x541ef1){logger['error'](_0x541ef1['stack']);if(_0x541ef1['name']){delete _0x541ef1[_0x3e1e('0x20')];}_0x5d908e[_0x3e1e('0x18')](_0x44e419)['send'](_0x541ef1);};}exports[_0x3e1e('0x21')]=function(_0x5ac814,_0xdfcd93){var _0x176bb4={},_0x53a6ff={},_0x43e029={'count':0x0,'rows':[]};var _0x210a84=_[_0x3e1e('0x22')](db['WhatsappQueueReport'][_0x3e1e('0x23')],function(_0x4ec149){return{'name':_0x4ec149['fieldName'],'type':_0x4ec149['type'][_0x3e1e('0x24')]};});_0x53a6ff['model']=_['map'](_0x210a84,_0x3e1e('0x20'));_0x53a6ff[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x5ac814[_0x3e1e('0x25')]);_0x53a6ff[_0x3e1e('0x27')]=_['intersection'](_0x53a6ff['model'],_0x53a6ff['query']);_0x176bb4['attributes']=_[_0x3e1e('0x28')](_0x53a6ff[_0x3e1e('0x29')],qs[_0x3e1e('0x2a')](_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x2a')]));_0x176bb4[_0x3e1e('0x2b')]=_0x176bb4[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x176bb4['attributes']:_0x53a6ff[_0x3e1e('0x29')];if(!_0x5ac814[_0x3e1e('0x25')]['hasOwnProperty'](_0x3e1e('0x2d'))){_0x176bb4[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0x5ac814[_0x3e1e('0x25')]['limit']);_0x176bb4['offset']=qs[_0x3e1e('0x15')](_0x5ac814[_0x3e1e('0x25')]['offset']);}_0x176bb4[_0x3e1e('0x2e')]=qs[_0x3e1e('0x2f')](_0x5ac814['query'][_0x3e1e('0x2f')]);_0x176bb4[_0x3e1e('0x30')]=qs[_0x3e1e('0x27')](_[_0x3e1e('0x31')](_0x5ac814[_0x3e1e('0x25')],_0x53a6ff['filters']),_0x210a84);if(_0x5ac814[_0x3e1e('0x25')][_0x3e1e('0x32')]){_0x176bb4[_0x3e1e('0x30')]=_[_0x3e1e('0x33')](_0x176bb4['where'],{'$or':_[_0x3e1e('0x22')](_0x210a84,function(_0xf973c9){if(_0xf973c9[_0x3e1e('0x34')]!==_0x3e1e('0x35')){var _0x2cc5c7={};_0x2cc5c7[_0xf973c9[_0x3e1e('0x20')]]={'$like':'%'+_0x5ac814[_0x3e1e('0x25')]['filter']+'%'};return _0x2cc5c7;}})});}_0x176bb4=_[_0x3e1e('0x33')]({},_0x176bb4,_0x5ac814['options']);var _0x53bdf5={'where':_0x176bb4[_0x3e1e('0x30')]};return db[_0x3e1e('0x36')][_0x3e1e('0x17')](_0x53bdf5)['then'](function(_0x3dbd2a){_0x43e029[_0x3e1e('0x17')]=_0x3dbd2a;if(_0x5ac814['query'][_0x3e1e('0x37')]){_0x176bb4[_0x3e1e('0x38')]=[{'all':!![]}];}return db['WhatsappQueueReport']['findAll'](_0x176bb4);})[_0x3e1e('0x1e')](function(_0x49e4cb){_0x43e029['rows']=_0x49e4cb;return _0x43e029;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0xdfcd93,_0x176bb4))[_0x3e1e('0x39')](handleError(_0xdfcd93,null));};exports[_0x3e1e('0x3a')]=function(_0x202748,_0x377a06){var _0x55ea1d={'raw':!![],'where':{'id':_0x202748[_0x3e1e('0x3b')]['id']}},_0x5b32ad={};_0x5b32ad[_0x3e1e('0x29')]=_[_0x3e1e('0x26')](db['WhatsappQueueReport'][_0x3e1e('0x23')]);_0x5b32ad[_0x3e1e('0x25')]=_[_0x3e1e('0x26')](_0x202748['query']);_0x5b32ad[_0x3e1e('0x27')]=_['intersection'](_0x5b32ad['model'],_0x5b32ad[_0x3e1e('0x25')]);_0x55ea1d[_0x3e1e('0x2b')]=_[_0x3e1e('0x28')](_0x5b32ad[_0x3e1e('0x29')],qs['fields'](_0x202748['query']['fields']));_0x55ea1d['attributes']=_0x55ea1d[_0x3e1e('0x2b')][_0x3e1e('0x2c')]?_0x55ea1d['attributes']:_0x5b32ad['model'];if(_0x202748[_0x3e1e('0x25')][_0x3e1e('0x37')]){_0x55ea1d[_0x3e1e('0x38')]=[{'all':!![]}];}_0x55ea1d=_['merge']({},_0x55ea1d,_0x202748[_0x3e1e('0x3c')]);return db['WhatsappQueueReport'][_0x3e1e('0x3d')](_0x55ea1d)[_0x3e1e('0x1e')](handleEntityNotFound(_0x377a06,null))[_0x3e1e('0x1e')](respondWithResult(_0x377a06,null))[_0x3e1e('0x39')](handleError(_0x377a06,null));};exports[_0x3e1e('0x3e')]=function(_0x3de309,_0x53d32b){return db[_0x3e1e('0x36')][_0x3e1e('0x3e')](_0x3de309['body'],{})[_0x3e1e('0x1e')](respondWithResult(_0x53d32b,0xc9))[_0x3e1e('0x39')](handleError(_0x53d32b,null));};exports['update']=function(_0x1cc820,_0x347b3f){if(_0x1cc820[_0x3e1e('0x3f')]['id']){delete _0x1cc820[_0x3e1e('0x3f')]['id'];}return db['WhatsappQueueReport'][_0x3e1e('0x3d')]({'where':{'id':_0x1cc820[_0x3e1e('0x3b')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x347b3f,null))[_0x3e1e('0x1e')](saveUpdates(_0x1cc820['body'],null))[_0x3e1e('0x1e')](respondWithResult(_0x347b3f,null))[_0x3e1e('0x39')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x1d')]=function(_0x25ddf7,_0xe2516c){return db[_0x3e1e('0x36')][_0x3e1e('0x3d')]({'where':{'id':_0x25ddf7[_0x3e1e('0x3b')]['id']}})['then'](handleEntityNotFound(_0xe2516c,null))[_0x3e1e('0x1e')](removeEntity(_0xe2516c,null))['catch'](handleError(_0xe2516c,null));};exports['describe']=function(_0x4c8583,_0x1c4269){return db[_0x3e1e('0x36')]['describe']()[_0x3e1e('0x1e')](respondWithResult(_0x1c4269,null))['catch'](handleError(_0x1c4269,null));};
\ No newline at end of file
+var _0xf45e=['Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','index','map','rawAttributes','type','key','model','name','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','update','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set'];(function(_0x1b0357,_0x1bdf14){var _0x164e7f=function(_0x47d36e){while(--_0x47d36e){_0x1b0357['push'](_0x1b0357['shift']());}};_0x164e7f(++_0x1bdf14);}(_0xf45e,0x115));var _0xef45=function(_0x4c1fe7,_0x511780){_0x4c1fe7=_0x4c1fe7-0x0;var _0x40052f=_0xf45e[_0x4c1fe7];return _0x40052f;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b35,_0x5f0593){return function(_0x38b470){if(!_0x38b470){_0x208b35[_0xef45('0x2a')](0x194);}return _0x38b470;};}function handleError(_0x578f03,_0x46e423){_0x46e423=_0x46e423||0x1f4;return function(_0x2c356d){logger['error'](_0x2c356d[_0xef45('0x2b')]);if(_0x2c356d['name']){delete _0x2c356d['name'];}_0x578f03['status'](_0x46e423)['send'](_0x2c356d);};}exports[_0xef45('0x2c')]=function(_0x2f72ef,_0x217e8d){var _0x15ad38={},_0x5782d0={},_0x18f304={'count':0x0,'rows':[]};var _0x4f028c=_[_0xef45('0x2d')](db['WhatsappQueueReport'][_0xef45('0x2e')],function(_0x5bfd2d){return{'name':_0x5bfd2d['fieldName'],'type':_0x5bfd2d[_0xef45('0x2f')][_0xef45('0x30')]};});_0x5782d0[_0xef45('0x31')]=_[_0xef45('0x2d')](_0x4f028c,_0xef45('0x32'));_0x5782d0['query']=_['keys'](_0x2f72ef['query']);_0x5782d0[_0xef45('0x33')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],_0x5782d0[_0xef45('0x35')]);_0x15ad38[_0xef45('0x36')]=_[_0xef45('0x34')](_0x5782d0[_0xef45('0x31')],qs['fields'](_0x2f72ef['query'][_0xef45('0x37')]));_0x15ad38['attributes']=_0x15ad38[_0xef45('0x36')]['length']?_0x15ad38[_0xef45('0x36')]:_0x5782d0[_0xef45('0x31')];if(!_0x2f72ef[_0xef45('0x35')][_0xef45('0x38')](_0xef45('0x39'))){_0x15ad38['limit']=qs[_0xef45('0x20')](_0x2f72ef[_0xef45('0x35')][_0xef45('0x20')]);_0x15ad38['offset']=qs['offset'](_0x2f72ef[_0xef45('0x35')][_0xef45('0x1e')]);}_0x15ad38['order']=qs[_0xef45('0x3a')](_0x2f72ef['query']['sort']);_0x15ad38[_0xef45('0x3b')]=qs[_0xef45('0x33')](_[_0xef45('0x3c')](_0x2f72ef['query'],_0x5782d0[_0xef45('0x33')]),_0x4f028c);if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]){_0x15ad38[_0xef45('0x3b')]=_['merge'](_0x15ad38['where'],{'$or':_[_0xef45('0x2d')](_0x4f028c,function(_0x474be1){if(_0x474be1[_0xef45('0x2f')]!==_0xef45('0x3e')){var _0x269a11={};_0x269a11[_0x474be1[_0xef45('0x32')]]={'$like':'%'+_0x2f72ef[_0xef45('0x35')][_0xef45('0x3d')]+'%'};return _0x269a11;}})});}_0x15ad38=_['merge']({},_0x15ad38,_0x2f72ef['options']);var _0x13f8b2={'where':_0x15ad38[_0xef45('0x3b')]};return db[_0xef45('0x3f')][_0xef45('0x21')](_0x13f8b2)[_0xef45('0x29')](function(_0x3bcada){_0x18f304[_0xef45('0x21')]=_0x3bcada;if(_0x2f72ef[_0xef45('0x35')][_0xef45('0x40')]){_0x15ad38[_0xef45('0x41')]=[{'all':!![]}];}return db[_0xef45('0x3f')][_0xef45('0x42')](_0x15ad38);})[_0xef45('0x29')](function(_0xd7d217){_0x18f304[_0xef45('0x43')]=_0xd7d217;return _0x18f304;})[_0xef45('0x29')](respondWithFilteredResult(_0x217e8d,_0x15ad38))['catch'](handleError(_0x217e8d,null));};exports[_0xef45('0x44')]=function(_0x5bdfad,_0x1b9d45){var _0x82c123={'raw':!![],'where':{'id':_0x5bdfad[_0xef45('0x45')]['id']}},_0x54ccb8={};_0x54ccb8['model']=_[_0xef45('0x46')](db['WhatsappQueueReport'][_0xef45('0x2e')]);_0x54ccb8[_0xef45('0x35')]=_[_0xef45('0x46')](_0x5bdfad[_0xef45('0x35')]);_0x54ccb8[_0xef45('0x33')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],_0x54ccb8['query']);_0x82c123[_0xef45('0x36')]=_[_0xef45('0x34')](_0x54ccb8[_0xef45('0x31')],qs[_0xef45('0x37')](_0x5bdfad[_0xef45('0x35')][_0xef45('0x37')]));_0x82c123[_0xef45('0x36')]=_0x82c123[_0xef45('0x36')][_0xef45('0x47')]?_0x82c123[_0xef45('0x36')]:_0x54ccb8[_0xef45('0x31')];if(_0x5bdfad[_0xef45('0x35')][_0xef45('0x40')]){_0x82c123[_0xef45('0x41')]=[{'all':!![]}];}_0x82c123=_[_0xef45('0x48')]({},_0x82c123,_0x5bdfad['options']);return db[_0xef45('0x3f')][_0xef45('0x49')](_0x82c123)[_0xef45('0x29')](handleEntityNotFound(_0x1b9d45,null))['then'](respondWithResult(_0x1b9d45,null))['catch'](handleError(_0x1b9d45,null));};exports['create']=function(_0x29aeab,_0x18143c){return db[_0xef45('0x3f')][_0xef45('0x4a')](_0x29aeab[_0xef45('0x4b')],{})[_0xef45('0x29')](respondWithResult(_0x18143c,0xc9))['catch'](handleError(_0x18143c,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){if(_0x463796['body']['id']){delete _0x463796['body']['id'];}return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x463796['params']['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x2b2419,null))[_0xef45('0x29')](saveUpdates(_0x463796[_0xef45('0x4b')],null))[_0xef45('0x29')](respondWithResult(_0x2b2419,null))[_0xef45('0x4d')](handleError(_0x2b2419,null));};exports[_0xef45('0x28')]=function(_0x23581f,_0xfa5fdd){return db[_0xef45('0x3f')][_0xef45('0x49')]({'where':{'id':_0x23581f[_0xef45('0x45')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0xfa5fdd,null))[_0xef45('0x29')](removeEntity(_0xfa5fdd,null))[_0xef45('0x4d')](handleError(_0xfa5fdd,null));};exports['describe']=function(_0x22b75e,_0x24aceb){return db[_0xef45('0x3f')]['describe']()[_0xef45('0x29')](respondWithResult(_0x24aceb,null))[_0xef45('0x4d')](handleError(_0x24aceb,null));};
\ No newline at end of file
index 4329988..cc47b0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb861=['../../config/environment','./whatsappQueueReport.attributes','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47da89,_0x280bbb){var _0x453dfc=function(_0x461ce7){while(--_0x461ce7){_0x47da89['push'](_0x47da89['shift']());}};_0x453dfc(++_0x280bbb);}(_0xb861,0xc9));var _0x1b86=function(_0x2cb1bd,_0x42b64c){_0x2cb1bd=_0x2cb1bd-0x0;var _0x393fdf=_0xb861[_0x2cb1bd];return _0x393fdf;};'use strict';var _=require(_0x1b86('0x0'));var util=require(_0x1b86('0x1'));var logger=require(_0x1b86('0x2'))(_0x1b86('0x3'));var moment=require(_0x1b86('0x4'));var BPromise=require(_0x1b86('0x5'));var rp=require(_0x1b86('0x6'));var fs=require('fs');var path=require(_0x1b86('0x7'));var rimraf=require(_0x1b86('0x8'));var config=require(_0x1b86('0x9'));var attributes=require(_0x1b86('0xa'));module['exports']=function(_0x50ad55,_0x5196f3){return _0x50ad55[_0x1b86('0xb')]('WhatsappQueueReport',attributes,{'tableName':_0x1b86('0xc'),'paranoid':![],'indexes':[{'name':_0x1b86('0xd'),'fields':[_0x1b86('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8c6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xc8c6,0x179));var _0x6c8c=function(_0x159670,_0x55aa84){_0x159670=_0x159670-0x0;var _0x3a2519=_0xc8c6[_0x159670];return _0x3a2519;};'use strict';var _=require(_0x6c8c('0x0'));var util=require(_0x6c8c('0x1'));var logger=require(_0x6c8c('0x2'))(_0x6c8c('0x3'));var moment=require(_0x6c8c('0x4'));var BPromise=require(_0x6c8c('0x5'));var rp=require(_0x6c8c('0x6'));var fs=require('fs');var path=require(_0x6c8c('0x7'));var rimraf=require(_0x6c8c('0x8'));var config=require(_0x6c8c('0x9'));var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x5b1f81,_0x3b5d88){return _0x5b1f81['define'](_0x6c8c('0xa'),attributes,{'tableName':_0x6c8c('0xb'),'paranoid':![],'indexes':[{'name':_0x6c8c('0xc'),'fields':[_0x6c8c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4f8889c..729275c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdc4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','then','catch','update','raw','where','limit','UpdateWhatsappQueueReport','lodash'];(function(_0x50fa84,_0x27fb2f){var _0x1faffa=function(_0x27dace){while(--_0x27dace){_0x50fa84['push'](_0x50fa84['shift']());}};_0x1faffa(++_0x27fb2f);}(_0xfdc4,0x1ee));var _0x4fdc=function(_0x50ff51,_0x25fed4){_0x50ff51=_0x50ff51-0x0;var _0x36e44d=_0xfdc4[_0x50ff51];return _0x36e44d;};'use strict';var _=require(_0x4fdc('0x0'));var util=require(_0x4fdc('0x1'));var moment=require(_0x4fdc('0x2'));var BPromise=require(_0x4fdc('0x3'));var rs=require(_0x4fdc('0x4'));var fs=require('fs');var Redis=require(_0x4fdc('0x5'));var db=require(_0x4fdc('0x6'))['db'];var utils=require(_0x4fdc('0x7'));var logger=require(_0x4fdc('0x8'))('rpc');var config=require(_0x4fdc('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4fdc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf4a1b9,_0x350c3c,_0x43524e){return new BPromise(function(_0x4b64b6,_0x20a3d1){return client[_0x4fdc('0xb')](_0xf4a1b9,_0x43524e)['then'](function(_0x38b0ea){logger[_0x4fdc('0xc')](_0x4fdc('0xd'),_0x350c3c,_0x4fdc('0xe'));logger[_0x4fdc('0xf')](_0x4fdc('0x10'),_0x350c3c,_0x4fdc('0xe'),JSON[_0x4fdc('0x11')](_0x38b0ea));if(_0x38b0ea['error']){if(_0x38b0ea['error']['code']===0x1f4){logger[_0x4fdc('0x12')](_0x4fdc('0xd'),_0x350c3c,_0x38b0ea[_0x4fdc('0x12')][_0x4fdc('0x13')]);return _0x20a3d1(_0x38b0ea['error']['message']);}logger['error'](_0x4fdc('0xd'),_0x350c3c,_0x38b0ea[_0x4fdc('0x12')]['message']);return _0x4b64b6(_0x38b0ea[_0x4fdc('0x12')][_0x4fdc('0x13')]);}else{logger[_0x4fdc('0xc')](_0x4fdc('0xd'),_0x350c3c,_0x4fdc('0xe'));_0x4b64b6(_0x38b0ea[_0x4fdc('0x14')]['message']);}})['catch'](function(_0x1cfbc8){logger[_0x4fdc('0x12')](_0x4fdc('0xd'),_0x350c3c,_0x1cfbc8);_0x20a3d1(_0x1cfbc8);});});}exports[_0x4fdc('0x15')]=function(_0x35887a){var _0x23f70b=this;return new Promise(function(_0x2431be,_0x240c90){return db[_0x4fdc('0x16')][_0x4fdc('0x17')](_0x35887a[_0x4fdc('0x18')],{'raw':_0x35887a['options']?_0x35887a[_0x4fdc('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4fdc('0x1a')](function(_0x4b07ec){logger[_0x4fdc('0xc')](_0x4fdc('0x15'),_0x35887a);logger[_0x4fdc('0xf')](_0x4fdc('0x15'),_0x35887a,JSON[_0x4fdc('0x11')](_0x4b07ec));_0x2431be(_0x4b07ec);})[_0x4fdc('0x1b')](function(_0x547a51){logger[_0x4fdc('0x12')](_0x4fdc('0x15'),_0x547a51[_0x4fdc('0x13')],_0x35887a);_0x240c90(_0x23f70b['error'](0x1f4,_0x547a51['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x536a52){var _0x16c75d=this;return new Promise(function(_0x170f4f,_0x43a306){return db[_0x4fdc('0x16')][_0x4fdc('0x1c')](_0x536a52[_0x4fdc('0x18')],{'raw':_0x536a52[_0x4fdc('0x19')]?_0x536a52['options'][_0x4fdc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x536a52[_0x4fdc('0x19')]?_0x536a52[_0x4fdc('0x19')][_0x4fdc('0x1e')]||null:null,'attributes':_0x536a52[_0x4fdc('0x19')]?_0x536a52[_0x4fdc('0x19')]['attributes']||null:null,'limit':_0x536a52[_0x4fdc('0x19')]?_0x536a52[_0x4fdc('0x19')][_0x4fdc('0x1f')]||null:null})[_0x4fdc('0x1a')](function(_0x5975d6){logger[_0x4fdc('0xc')](_0x4fdc('0x20'),_0x536a52);logger[_0x4fdc('0xf')]('UpdateWhatsappQueueReport',_0x536a52,JSON[_0x4fdc('0x11')](_0x5975d6));_0x170f4f(_0x5975d6);})[_0x4fdc('0x1b')](function(_0x2fcac4){logger['error'](_0x4fdc('0x20'),_0x2fcac4['message'],_0x536a52);_0x43a306(_0x16c75d[_0x4fdc('0x12')](0x1f4,_0x2fcac4['message']));});});};
\ No newline at end of file
+var _0x6c78=['../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','debug','stringify','UpdateWhatsappQueueReport','update','attributes','limit','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x55dba4,_0x2713ec){var _0xdf0a05=function(_0x3c24b0){while(--_0x3c24b0){_0x55dba4['push'](_0x55dba4['shift']());}};_0xdf0a05(++_0x2713ec);}(_0x6c78,0x94));var _0x86c7=function(_0x225414,_0x245ff4){_0x225414=_0x225414-0x0;var _0x1d946a=_0x6c78[_0x225414];return _0x1d946a;};'use strict';var _=require(_0x86c7('0x0'));var util=require('util');var moment=require(_0x86c7('0x1'));var BPromise=require(_0x86c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86c7('0x3'));var db=require(_0x86c7('0x4'))['db'];var utils=require(_0x86c7('0x5'));var logger=require('../../config/logger')(_0x86c7('0x6'));var config=require(_0x86c7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x86c7('0x8')][_0x86c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49acc2,_0x35f977,_0x286252){return new BPromise(function(_0x16d05a,_0x43b1b6){return client[_0x86c7('0xa')](_0x49acc2,_0x286252)[_0x86c7('0xb')](function(_0x17e418){logger[_0x86c7('0xc')](_0x86c7('0xd'),_0x35f977,_0x86c7('0xe'));logger['debug'](_0x86c7('0xf'),_0x35f977,_0x86c7('0xe'),JSON['stringify'](_0x17e418));if(_0x17e418[_0x86c7('0x10')]){if(_0x17e418[_0x86c7('0x10')][_0x86c7('0x11')]===0x1f4){logger[_0x86c7('0x10')](_0x86c7('0xd'),_0x35f977,_0x17e418['error'][_0x86c7('0x12')]);return _0x43b1b6(_0x17e418['error'][_0x86c7('0x12')]);}logger[_0x86c7('0x10')](_0x86c7('0xd'),_0x35f977,_0x17e418[_0x86c7('0x10')]['message']);return _0x16d05a(_0x17e418[_0x86c7('0x10')]['message']);}else{logger['info'](_0x86c7('0xd'),_0x35f977,'request\x20sent');_0x16d05a(_0x17e418['result'][_0x86c7('0x12')]);}})['catch'](function(_0x474d2f){logger['error'](_0x86c7('0xd'),_0x35f977,_0x474d2f);_0x43b1b6(_0x474d2f);});});}exports[_0x86c7('0x13')]=function(_0x172328){var _0xc3aba3=this;return new Promise(function(_0x483d65,_0x272db9){return db[_0x86c7('0x14')][_0x86c7('0x15')](_0x172328['body'],{'raw':_0x172328[_0x86c7('0x16')]?_0x172328[_0x86c7('0x16')][_0x86c7('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4d4e9c){logger['info'](_0x86c7('0x13'),_0x172328);logger[_0x86c7('0x18')](_0x86c7('0x13'),_0x172328,JSON[_0x86c7('0x19')](_0x4d4e9c));_0x483d65(_0x4d4e9c);})['catch'](function(_0x3b09a6){logger[_0x86c7('0x10')](_0x86c7('0x13'),_0x3b09a6[_0x86c7('0x12')],_0x172328);_0x272db9(_0xc3aba3[_0x86c7('0x10')](0x1f4,_0x3b09a6['message']));});});};exports[_0x86c7('0x1a')]=function(_0x54a56a){var _0x5763a4=this;return new Promise(function(_0x204397,_0x204766){return db['WhatsappQueueReport'][_0x86c7('0x1b')](_0x54a56a['body'],{'raw':_0x54a56a[_0x86c7('0x16')]?_0x54a56a[_0x86c7('0x16')][_0x86c7('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54a56a['options']?_0x54a56a[_0x86c7('0x16')]['where']||null:null,'attributes':_0x54a56a['options']?_0x54a56a['options'][_0x86c7('0x1c')]||null:null,'limit':_0x54a56a[_0x86c7('0x16')]?_0x54a56a['options'][_0x86c7('0x1d')]||null:null})['then'](function(_0x4e51d2){logger[_0x86c7('0xc')]('UpdateWhatsappQueueReport',_0x54a56a);logger['debug']('UpdateWhatsappQueueReport',_0x54a56a,JSON[_0x86c7('0x19')](_0x4e51d2));_0x204397(_0x4e51d2);})[_0x86c7('0x1e')](function(_0x511bac){logger[_0x86c7('0x10')]('UpdateWhatsappQueueReport',_0x511bac[_0x86c7('0x12')],_0x54a56a);_0x204766(_0x5763a4[_0x86c7('0x10')](0x1f4,_0x511bac[_0x86c7('0x12')]));});});};
\ No newline at end of file
index 6504d68..52cc40c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ef1=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','delete'];(function(_0x382083,_0xb7657e){var _0x4b49aa=function(_0x306771){while(--_0x306771){_0x382083['push'](_0x382083['shift']());}};_0x4b49aa(++_0xb7657e);}(_0x9ef1,0xf9));var _0x19ef=function(_0x5cd212,_0x20381f){_0x5cd212=_0x5cd212-0x0;var _0x4bfbf8=_0x9ef1[_0x5cd212];return _0x4bfbf8;};'use strict';var multer=require(_0x19ef('0x0'));var util=require(_0x19ef('0x1'));var path=require(_0x19ef('0x2'));var timeout=require(_0x19ef('0x3'));var express=require('express');var router=express[_0x19ef('0x4')]();var fs_extra=require(_0x19ef('0x5'));var auth=require(_0x19ef('0x6'));var interaction=require(_0x19ef('0x7'));var config=require('../../config/environment');var controller=require(_0x19ef('0x8'));router[_0x19ef('0x9')]('/',auth[_0x19ef('0xa')](),controller[_0x19ef('0xb')]);router['get'](_0x19ef('0xc'),auth['isAuthenticated'](),controller[_0x19ef('0xd')]);router[_0x19ef('0x9')](_0x19ef('0xe'),auth[_0x19ef('0xa')](),controller['show']);router['post']('/',auth[_0x19ef('0xa')](),controller[_0x19ef('0xf')]);router['put'](_0x19ef('0xe'),auth[_0x19ef('0xa')](),controller['update']);router[_0x19ef('0x10')]('/:id',auth[_0x19ef('0xa')](),controller[_0x19ef('0x11')]);module[_0x19ef('0x12')]=router;
\ No newline at end of file
+var _0x343a=['describe','create','/:id','update','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0x343a,0x17b));var _0xa343=function(_0x366357,_0x3c683a){_0x366357=_0x366357-0x0;var _0x58b913=_0x343a[_0x366357];return _0x58b913;};'use strict';var multer=require(_0xa343('0x0'));var util=require(_0xa343('0x1'));var path=require('path');var timeout=require(_0xa343('0x2'));var express=require(_0xa343('0x3'));var router=express['Router']();var fs_extra=require(_0xa343('0x4'));var auth=require(_0xa343('0x5'));var interaction=require(_0xa343('0x6'));var config=require(_0xa343('0x7'));var controller=require(_0xa343('0x8'));router[_0xa343('0x9')]('/',auth[_0xa343('0xa')](),controller[_0xa343('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa343('0xc')]);router[_0xa343('0x9')]('/:id',auth[_0xa343('0xa')](),controller['show']);router['post']('/',auth[_0xa343('0xa')](),controller[_0xa343('0xd')]);router['put'](_0xa343('0xe'),auth[_0xa343('0xa')](),controller[_0xa343('0xf')]);router['delete'](_0xa343('0xe'),auth[_0xa343('0xa')](),controller[_0xa343('0x10')]);module['exports']=router;
\ No newline at end of file
index 4955fc3..e0d1110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5236=['exports','STRING','ENUM','account','queue','DATE','sequelize'];(function(_0x50eb12,_0x32ac43){var _0x2630d6=function(_0x24f087){while(--_0x24f087){_0x50eb12['push'](_0x50eb12['shift']());}};_0x2630d6(++_0x32ac43);}(_0x5236,0x109));var _0x6523=function(_0x3d9ba7,_0x1c8b5f){_0x3d9ba7=_0x3d9ba7-0x0;var _0x4621ce=_0x5236[_0x3d9ba7];return _0x4621ce;};'use strict';var Sequelize=require(_0x6523('0x0'));module[_0x6523('0x1')]={'uniqueid':{'type':Sequelize[_0x6523('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6523('0x3')](_0x6523('0x4'),'agent',_0x6523('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6523('0x6')]}};
\ No newline at end of file
+var _0xe98f=['account','agent','sequelize','STRING'];(function(_0x3bc8ac,_0x3d59f0){var _0x3a4775=function(_0x4f2161){while(--_0x4f2161){_0x3bc8ac['push'](_0x3bc8ac['shift']());}};_0x3a4775(++_0x3d59f0);}(_0xe98f,0xde));var _0xfe98=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe98f[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xfe98('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfe98('0x2'),_0xfe98('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 4bca2ef..8e95fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x684b=['squel','crypto','jsforce','desk.js','to-csv','../../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','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','filter','where','VIRTUAL','merge','options','WhatsappTransferReport','includeAll','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash'];(function(_0x37edbb,_0xc7b045){var _0x54ec53=function(_0x4220d2){while(--_0x4220d2){_0x37edbb['push'](_0x37edbb['shift']());}};_0x54ec53(++_0xc7b045);}(_0x684b,0x1a5));var _0xb684=function(_0x478f36,_0x286591){_0x478f36=_0x478f36-0x0;var _0xab7736=_0x684b[_0x478f36];return _0xab7736;};'use strict';var emlformat=require(_0xb684('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb684('0x1'));var jsonpatch=require(_0xb684('0x2'));var rp=require('request-promise');var moment=require(_0xb684('0x3'));var BPromise=require(_0xb684('0x4'));var Mustache=require(_0xb684('0x5'));var util=require(_0xb684('0x6'));var path=require('path');var sox=require(_0xb684('0x7'));var csv=require('to-csv');var ejs=require(_0xb684('0x8'));var fs=require('fs');var fs_extra=require(_0xb684('0x9'));var _=require(_0xb684('0xa'));var squel=require(_0xb684('0xb'));var crypto=require(_0xb684('0xc'));var jsforce=require(_0xb684('0xd'));var deskjs=require(_0xb684('0xe'));var toCsv=require(_0xb684('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb684('0x10'));var hardwareService=require(_0xb684('0x11'));var logger=require(_0xb684('0x12'))(_0xb684('0x13'));var utils=require(_0xb684('0x14'));var config=require(_0xb684('0x15'));var licenseUtil=require(_0xb684('0x16'));var db=require(_0xb684('0x17'))['db'];function respondWithStatusCode(_0x507fec,_0x342fba){_0x342fba=_0x342fba||0xcc;return function(_0x59934c){if(_0x59934c){return _0x507fec[_0xb684('0x18')](_0x342fba);}return _0x507fec[_0xb684('0x19')](_0x342fba)[_0xb684('0x1a')]();};}function respondWithResult(_0x52d397,_0x551281){_0x551281=_0x551281||0xc8;return function(_0x2a0bc3){if(_0x2a0bc3){return _0x52d397[_0xb684('0x19')](_0x551281)[_0xb684('0x1b')](_0x2a0bc3);}};}function respondWithFilteredResult(_0x332687,_0x1670c0){return function(_0x2f105c){if(_0x2f105c){var _0x1cd422=typeof _0x1670c0[_0xb684('0x1c')]===_0xb684('0x1d')&&typeof _0x1670c0[_0xb684('0x1e')]==='undefined';var _0x1315b4=_0x2f105c[_0xb684('0x1f')];var _0x4a98b4=_0x1cd422?0x0:_0x1670c0[_0xb684('0x1c')];var _0x5e5fe6=_0x1cd422?_0x2f105c[_0xb684('0x1f')]:_0x1670c0['offset']+_0x1670c0[_0xb684('0x1e')];var _0x42bc87;if(_0x5e5fe6>=_0x1315b4){_0x5e5fe6=_0x1315b4;_0x42bc87=0xc8;}else{_0x42bc87=0xce;}_0x332687[_0xb684('0x19')](_0x42bc87);return _0x332687[_0xb684('0x20')](_0xb684('0x21'),_0x4a98b4+'-'+_0x5e5fe6+'/'+_0x1315b4)[_0xb684('0x1b')](_0x2f105c);}return null;};}function patchUpdates(_0x20e27b){return function(_0x3d17ee){try{jsonpatch[_0xb684('0x22')](_0x3d17ee,_0x20e27b,!![]);}catch(_0x18fa18){return BPromise[_0xb684('0x23')](_0x18fa18);}return _0x3d17ee['save']();};}function saveUpdates(_0x2f6433,_0x544a46){return function(_0x49cc57){if(_0x49cc57){return _0x49cc57[_0xb684('0x24')](_0x2f6433)[_0xb684('0x25')](function(_0x7cb2cc){return _0x7cb2cc;});}return null;};}function removeEntity(_0x3fde39,_0x4fe185){return function(_0xd23ad9){if(_0xd23ad9){return _0xd23ad9[_0xb684('0x26')]()[_0xb684('0x25')](function(){_0x3fde39[_0xb684('0x19')](0xcc)[_0xb684('0x1a')]();});}};}function handleEntityNotFound(_0x160fd5,_0x318590){return function(_0x35c49a){if(!_0x35c49a){_0x160fd5['sendStatus'](0x194);}return _0x35c49a;};}function handleError(_0x2c6ff4,_0x3ea284){_0x3ea284=_0x3ea284||0x1f4;return function(_0x25e4d1){logger[_0xb684('0x27')](_0x25e4d1[_0xb684('0x28')]);if(_0x25e4d1[_0xb684('0x29')]){delete _0x25e4d1['name'];}_0x2c6ff4['status'](_0x3ea284)[_0xb684('0x2a')](_0x25e4d1);};}exports['index']=function(_0x10d4eb,_0x2758ed){var _0xb2451b={},_0x3858ab={},_0x17fc5d={'count':0x0,'rows':[]};var _0x7e6e2b=_[_0xb684('0x2b')](db['WhatsappTransferReport'][_0xb684('0x2c')],function(_0x393bc1){return{'name':_0x393bc1[_0xb684('0x2d')],'type':_0x393bc1[_0xb684('0x2e')]['key']};});_0x3858ab['model']=_[_0xb684('0x2b')](_0x7e6e2b,'name');_0x3858ab['query']=_[_0xb684('0x2f')](_0x10d4eb[_0xb684('0x30')]);_0x3858ab[_0xb684('0x31')]=_[_0xb684('0x32')](_0x3858ab[_0xb684('0x33')],_0x3858ab[_0xb684('0x30')]);_0xb2451b[_0xb684('0x34')]=_[_0xb684('0x32')](_0x3858ab[_0xb684('0x33')],qs[_0xb684('0x35')](_0x10d4eb[_0xb684('0x30')][_0xb684('0x35')]));_0xb2451b[_0xb684('0x34')]=_0xb2451b[_0xb684('0x34')][_0xb684('0x36')]?_0xb2451b[_0xb684('0x34')]:_0x3858ab[_0xb684('0x33')];if(!_0x10d4eb[_0xb684('0x30')]['hasOwnProperty'](_0xb684('0x37'))){_0xb2451b[_0xb684('0x1e')]=qs[_0xb684('0x1e')](_0x10d4eb['query']['limit']);_0xb2451b['offset']=qs[_0xb684('0x1c')](_0x10d4eb[_0xb684('0x30')][_0xb684('0x1c')]);}_0xb2451b['order']=qs[_0xb684('0x38')](_0x10d4eb[_0xb684('0x30')][_0xb684('0x38')]);_0xb2451b['where']=qs[_0xb684('0x31')](_['pick'](_0x10d4eb[_0xb684('0x30')],_0x3858ab[_0xb684('0x31')]),_0x7e6e2b);if(_0x10d4eb['query'][_0xb684('0x39')]){_0xb2451b[_0xb684('0x3a')]=_['merge'](_0xb2451b[_0xb684('0x3a')],{'$or':_[_0xb684('0x2b')](_0x7e6e2b,function(_0x2a85b0){if(_0x2a85b0['type']!==_0xb684('0x3b')){var _0x5d261b={};_0x5d261b[_0x2a85b0[_0xb684('0x29')]]={'$like':'%'+_0x10d4eb[_0xb684('0x30')][_0xb684('0x39')]+'%'};return _0x5d261b;}})});}_0xb2451b=_[_0xb684('0x3c')]({},_0xb2451b,_0x10d4eb[_0xb684('0x3d')]);var _0x2989fe={'where':_0xb2451b[_0xb684('0x3a')]};return db[_0xb684('0x3e')][_0xb684('0x1f')](_0x2989fe)[_0xb684('0x25')](function(_0x388bf9){_0x17fc5d['count']=_0x388bf9;if(_0x10d4eb['query'][_0xb684('0x3f')]){_0xb2451b['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb684('0x40')](_0xb2451b);})[_0xb684('0x25')](function(_0x57e454){_0x17fc5d[_0xb684('0x41')]=_0x57e454;return _0x17fc5d;})['then'](respondWithFilteredResult(_0x2758ed,_0xb2451b))[_0xb684('0x42')](handleError(_0x2758ed,null));};exports['show']=function(_0x1c2cae,_0x561618){var _0x3879f5={'raw':!![],'where':{'id':_0x1c2cae[_0xb684('0x43')]['id']}},_0x4c42aa={};_0x4c42aa[_0xb684('0x33')]=_[_0xb684('0x2f')](db[_0xb684('0x3e')][_0xb684('0x2c')]);_0x4c42aa[_0xb684('0x30')]=_[_0xb684('0x2f')](_0x1c2cae['query']);_0x4c42aa['filters']=_['intersection'](_0x4c42aa[_0xb684('0x33')],_0x4c42aa[_0xb684('0x30')]);_0x3879f5[_0xb684('0x34')]=_[_0xb684('0x32')](_0x4c42aa[_0xb684('0x33')],qs[_0xb684('0x35')](_0x1c2cae[_0xb684('0x30')][_0xb684('0x35')]));_0x3879f5['attributes']=_0x3879f5[_0xb684('0x34')][_0xb684('0x36')]?_0x3879f5[_0xb684('0x34')]:_0x4c42aa[_0xb684('0x33')];if(_0x1c2cae[_0xb684('0x30')][_0xb684('0x3f')]){_0x3879f5['include']=[{'all':!![]}];}_0x3879f5=_[_0xb684('0x3c')]({},_0x3879f5,_0x1c2cae[_0xb684('0x3d')]);return db[_0xb684('0x3e')][_0xb684('0x44')](_0x3879f5)[_0xb684('0x25')](handleEntityNotFound(_0x561618,null))[_0xb684('0x25')](respondWithResult(_0x561618,null))[_0xb684('0x42')](handleError(_0x561618,null));};exports[_0xb684('0x45')]=function(_0xc3ca14,_0x38c327){return db[_0xb684('0x3e')]['create'](_0xc3ca14[_0xb684('0x46')],{})[_0xb684('0x25')](respondWithResult(_0x38c327,0xc9))[_0xb684('0x42')](handleError(_0x38c327,null));};exports[_0xb684('0x24')]=function(_0x5a349b,_0x17381a){if(_0x5a349b[_0xb684('0x46')]['id']){delete _0x5a349b[_0xb684('0x46')]['id'];}return db[_0xb684('0x3e')]['find']({'where':{'id':_0x5a349b[_0xb684('0x43')]['id']}})[_0xb684('0x25')](handleEntityNotFound(_0x17381a,null))[_0xb684('0x25')](saveUpdates(_0x5a349b[_0xb684('0x46')],null))[_0xb684('0x25')](respondWithResult(_0x17381a,null))[_0xb684('0x42')](handleError(_0x17381a,null));};exports[_0xb684('0x26')]=function(_0x3c2f9d,_0x55c933){return db['WhatsappTransferReport'][_0xb684('0x44')]({'where':{'id':_0x3c2f9d[_0xb684('0x43')]['id']}})[_0xb684('0x25')](handleEntityNotFound(_0x55c933,null))['then'](removeEntity(_0x55c933,null))[_0xb684('0x42')](handleError(_0x55c933,null));};exports[_0xb684('0x47')]=function(_0x1f0ae6,_0x5ced78){return db[_0xb684('0x3e')][_0xb684('0x47')]()[_0xb684('0x25')](respondWithResult(_0x5ced78,null))['catch'](handleError(_0x5ced78,null));};
\ No newline at end of file
+var _0x4dfd=['rawAttributes','type','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','merge','where','WhatsappTransferReport','includeAll','findAll','rows','catch','show','params','keys','fields','options','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','error','stack','name','send','index','map'];(function(_0x58ab4c,_0x4091e6){var _0x13e23b=function(_0x6f7aaa){while(--_0x6f7aaa){_0x58ab4c['push'](_0x58ab4c['shift']());}};_0x13e23b(++_0x4091e6);}(_0x4dfd,0x148));var _0xd4df=function(_0x310149,_0x5e04f0){_0x310149=_0x310149-0x0;var _0x3312fb=_0x4dfd[_0x310149];return _0x3312fb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd4df('0x0'));var jsonpatch=require(_0xd4df('0x1'));var rp=require(_0xd4df('0x2'));var moment=require(_0xd4df('0x3'));var BPromise=require(_0xd4df('0x4'));var Mustache=require(_0xd4df('0x5'));var util=require(_0xd4df('0x6'));var path=require(_0xd4df('0x7'));var sox=require(_0xd4df('0x8'));var csv=require(_0xd4df('0x9'));var ejs=require(_0xd4df('0xa'));var fs=require('fs');var fs_extra=require(_0xd4df('0xb'));var _=require('lodash');var squel=require(_0xd4df('0xc'));var crypto=require(_0xd4df('0xd'));var jsforce=require(_0xd4df('0xe'));var deskjs=require(_0xd4df('0xf'));var toCsv=require(_0xd4df('0x9'));var querystring=require(_0xd4df('0x10'));var Papa=require(_0xd4df('0x11'));var Redis=require('ioredis');var authService=require(_0xd4df('0x12'));var qs=require(_0xd4df('0x13'));var as=require(_0xd4df('0x14'));var hardwareService=require(_0xd4df('0x15'));var logger=require(_0xd4df('0x16'))(_0xd4df('0x17'));var utils=require('../../config/utils');var config=require(_0xd4df('0x18'));var licenseUtil=require(_0xd4df('0x19'));var db=require(_0xd4df('0x1a'))['db'];function respondWithStatusCode(_0x2f7d9e,_0x295be4){_0x295be4=_0x295be4||0xcc;return function(_0x30009b){if(_0x30009b){return _0x2f7d9e[_0xd4df('0x1b')](_0x295be4);}return _0x2f7d9e[_0xd4df('0x1c')](_0x295be4)[_0xd4df('0x1d')]();};}function respondWithResult(_0x531aea,_0x433771){_0x433771=_0x433771||0xc8;return function(_0x4e2d80){if(_0x4e2d80){return _0x531aea[_0xd4df('0x1c')](_0x433771)[_0xd4df('0x1e')](_0x4e2d80);}};}function respondWithFilteredResult(_0x2f88de,_0x2e9a83){return function(_0x32daa5){if(_0x32daa5){var _0x15db6d=typeof _0x2e9a83[_0xd4df('0x1f')]===_0xd4df('0x20')&&typeof _0x2e9a83[_0xd4df('0x21')]==='undefined';var _0xa40996=_0x32daa5[_0xd4df('0x22')];var _0x34b0b9=_0x15db6d?0x0:_0x2e9a83[_0xd4df('0x1f')];var _0x9b4ad4=_0x15db6d?_0x32daa5['count']:_0x2e9a83[_0xd4df('0x1f')]+_0x2e9a83[_0xd4df('0x21')];var _0x30edf7;if(_0x9b4ad4>=_0xa40996){_0x9b4ad4=_0xa40996;_0x30edf7=0xc8;}else{_0x30edf7=0xce;}_0x2f88de['status'](_0x30edf7);return _0x2f88de[_0xd4df('0x23')]('Content-Range',_0x34b0b9+'-'+_0x9b4ad4+'/'+_0xa40996)[_0xd4df('0x1e')](_0x32daa5);}return null;};}function patchUpdates(_0x949bd4){return function(_0x2f3f51){try{jsonpatch[_0xd4df('0x24')](_0x2f3f51,_0x949bd4,!![]);}catch(_0x44df46){return BPromise[_0xd4df('0x25')](_0x44df46);}return _0x2f3f51[_0xd4df('0x26')]();};}function saveUpdates(_0x58e2dd,_0x4daa75){return function(_0x544648){if(_0x544648){return _0x544648['update'](_0x58e2dd)[_0xd4df('0x27')](function(_0x3ec72d){return _0x3ec72d;});}return null;};}function removeEntity(_0x22b3a2,_0x3898af){return function(_0xdff551){if(_0xdff551){return _0xdff551[_0xd4df('0x28')]()[_0xd4df('0x27')](function(){_0x22b3a2[_0xd4df('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5030dc,_0x5efc0f){return function(_0x22f6f6){if(!_0x22f6f6){_0x5030dc['sendStatus'](0x194);}return _0x22f6f6;};}function handleError(_0x6ae6f8,_0x3a5883){_0x3a5883=_0x3a5883||0x1f4;return function(_0x65eccb){logger[_0xd4df('0x29')](_0x65eccb[_0xd4df('0x2a')]);if(_0x65eccb[_0xd4df('0x2b')]){delete _0x65eccb[_0xd4df('0x2b')];}_0x6ae6f8[_0xd4df('0x1c')](_0x3a5883)[_0xd4df('0x2c')](_0x65eccb);};}exports[_0xd4df('0x2d')]=function(_0x3db2ba,_0x47edc3){var _0x120577={},_0x2c9e4d={},_0x3e06ed={'count':0x0,'rows':[]};var _0x4bd75b=_[_0xd4df('0x2e')](db['WhatsappTransferReport'][_0xd4df('0x2f')],function(_0x110d42){return{'name':_0x110d42['fieldName'],'type':_0x110d42[_0xd4df('0x30')]['key']};});_0x2c9e4d['model']=_[_0xd4df('0x2e')](_0x4bd75b,_0xd4df('0x2b'));_0x2c9e4d[_0xd4df('0x31')]=_['keys'](_0x3db2ba[_0xd4df('0x31')]);_0x2c9e4d['filters']=_[_0xd4df('0x32')](_0x2c9e4d[_0xd4df('0x33')],_0x2c9e4d['query']);_0x120577[_0xd4df('0x34')]=_['intersection'](_0x2c9e4d[_0xd4df('0x33')],qs['fields'](_0x3db2ba[_0xd4df('0x31')]['fields']));_0x120577['attributes']=_0x120577[_0xd4df('0x34')][_0xd4df('0x35')]?_0x120577['attributes']:_0x2c9e4d[_0xd4df('0x33')];if(!_0x3db2ba[_0xd4df('0x31')][_0xd4df('0x36')](_0xd4df('0x37'))){_0x120577[_0xd4df('0x21')]=qs['limit'](_0x3db2ba['query'][_0xd4df('0x21')]);_0x120577[_0xd4df('0x1f')]=qs[_0xd4df('0x1f')](_0x3db2ba[_0xd4df('0x31')][_0xd4df('0x1f')]);}_0x120577[_0xd4df('0x38')]=qs[_0xd4df('0x39')](_0x3db2ba['query'][_0xd4df('0x39')]);_0x120577['where']=qs['filters'](_['pick'](_0x3db2ba[_0xd4df('0x31')],_0x2c9e4d['filters']),_0x4bd75b);if(_0x3db2ba['query']['filter']){_0x120577['where']=_[_0xd4df('0x3a')](_0x120577[_0xd4df('0x3b')],{'$or':_['map'](_0x4bd75b,function(_0x3e26b6){if(_0x3e26b6[_0xd4df('0x30')]!=='VIRTUAL'){var _0x2344e8={};_0x2344e8[_0x3e26b6[_0xd4df('0x2b')]]={'$like':'%'+_0x3db2ba[_0xd4df('0x31')]['filter']+'%'};return _0x2344e8;}})});}_0x120577=_[_0xd4df('0x3a')]({},_0x120577,_0x3db2ba['options']);var _0x23fe70={'where':_0x120577[_0xd4df('0x3b')]};return db[_0xd4df('0x3c')][_0xd4df('0x22')](_0x23fe70)[_0xd4df('0x27')](function(_0x532e71){_0x3e06ed[_0xd4df('0x22')]=_0x532e71;if(_0x3db2ba[_0xd4df('0x31')][_0xd4df('0x3d')]){_0x120577['include']=[{'all':!![]}];}return db[_0xd4df('0x3c')][_0xd4df('0x3e')](_0x120577);})[_0xd4df('0x27')](function(_0x2caaf5){_0x3e06ed[_0xd4df('0x3f')]=_0x2caaf5;return _0x3e06ed;})[_0xd4df('0x27')](respondWithFilteredResult(_0x47edc3,_0x120577))[_0xd4df('0x40')](handleError(_0x47edc3,null));};exports[_0xd4df('0x41')]=function(_0x27d9ad,_0x570edf){var _0x5b0e45={'raw':!![],'where':{'id':_0x27d9ad[_0xd4df('0x42')]['id']}},_0x3921ca={};_0x3921ca[_0xd4df('0x33')]=_[_0xd4df('0x43')](db[_0xd4df('0x3c')][_0xd4df('0x2f')]);_0x3921ca['query']=_[_0xd4df('0x43')](_0x27d9ad[_0xd4df('0x31')]);_0x3921ca['filters']=_[_0xd4df('0x32')](_0x3921ca[_0xd4df('0x33')],_0x3921ca[_0xd4df('0x31')]);_0x5b0e45[_0xd4df('0x34')]=_[_0xd4df('0x32')](_0x3921ca[_0xd4df('0x33')],qs[_0xd4df('0x44')](_0x27d9ad['query'][_0xd4df('0x44')]));_0x5b0e45[_0xd4df('0x34')]=_0x5b0e45[_0xd4df('0x34')][_0xd4df('0x35')]?_0x5b0e45[_0xd4df('0x34')]:_0x3921ca[_0xd4df('0x33')];if(_0x27d9ad[_0xd4df('0x31')][_0xd4df('0x3d')]){_0x5b0e45['include']=[{'all':!![]}];}_0x5b0e45=_[_0xd4df('0x3a')]({},_0x5b0e45,_0x27d9ad[_0xd4df('0x45')]);return db['WhatsappTransferReport'][_0xd4df('0x46')](_0x5b0e45)[_0xd4df('0x27')](handleEntityNotFound(_0x570edf,null))[_0xd4df('0x27')](respondWithResult(_0x570edf,null))[_0xd4df('0x40')](handleError(_0x570edf,null));};exports[_0xd4df('0x47')]=function(_0x147f52,_0x5f4ace){return db[_0xd4df('0x3c')]['create'](_0x147f52[_0xd4df('0x48')],{})[_0xd4df('0x27')](respondWithResult(_0x5f4ace,0xc9))[_0xd4df('0x40')](handleError(_0x5f4ace,null));};exports[_0xd4df('0x49')]=function(_0x4b716b,_0x181659){if(_0x4b716b[_0xd4df('0x48')]['id']){delete _0x4b716b[_0xd4df('0x48')]['id'];}return db[_0xd4df('0x3c')][_0xd4df('0x46')]({'where':{'id':_0x4b716b[_0xd4df('0x42')]['id']}})[_0xd4df('0x27')](handleEntityNotFound(_0x181659,null))[_0xd4df('0x27')](saveUpdates(_0x4b716b['body'],null))[_0xd4df('0x27')](respondWithResult(_0x181659,null))[_0xd4df('0x40')](handleError(_0x181659,null));};exports[_0xd4df('0x28')]=function(_0x257da8,_0x41aef1){return db[_0xd4df('0x3c')][_0xd4df('0x46')]({'where':{'id':_0x257da8['params']['id']}})[_0xd4df('0x27')](handleEntityNotFound(_0x41aef1,null))['then'](removeEntity(_0x41aef1,null))[_0xd4df('0x40')](handleError(_0x41aef1,null));};exports[_0xd4df('0x4a')]=function(_0x2c019e,_0x459410){return db[_0xd4df('0x3c')][_0xd4df('0x4a')]()['then'](respondWithResult(_0x459410,null))[_0xd4df('0x40')](handleError(_0x459410,null));};
\ No newline at end of file
index cde76a4..a8f6eeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e8f=['moment','request-promise','path','rimraf','../../config/environment','exports','report_whatsapp_transfer','uniqueid','lodash','util','api'];(function(_0x54592b,_0x572a59){var _0x2a6807=function(_0x4a6155){while(--_0x4a6155){_0x54592b['push'](_0x54592b['shift']());}};_0x2a6807(++_0x572a59);}(_0x6e8f,0xef));var _0xf6e8=function(_0x2124e1,_0x33ed8d){_0x2124e1=_0x2124e1-0x0;var _0x54b1e9=_0x6e8f[_0x2124e1];return _0x54b1e9;};'use strict';var _=require(_0xf6e8('0x0'));var util=require(_0xf6e8('0x1'));var logger=require('../../config/logger')(_0xf6e8('0x2'));var moment=require(_0xf6e8('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6e8('0x4'));var fs=require('fs');var path=require(_0xf6e8('0x5'));var rimraf=require(_0xf6e8('0x6'));var config=require(_0xf6e8('0x7'));var attributes=require('./whatsappTransferReport.attributes');module[_0xf6e8('0x8')]=function(_0x57fd0e,_0x58709d){return _0x57fd0e['define']('WhatsappTransferReport',attributes,{'tableName':_0xf6e8('0x9'),'paranoid':![],'indexes':[{'name':_0xf6e8('0xa'),'fields':[_0xf6e8('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x366e=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3495b9,_0x55d53a){var _0x5e453e=function(_0x48624f){while(--_0x48624f){_0x3495b9['push'](_0x3495b9['shift']());}};_0x5e453e(++_0x55d53a);}(_0x366e,0x108));var _0xe366=function(_0x5748e5,_0x44be89){_0x5748e5=_0x5748e5-0x0;var _0xe10ee0=_0x366e[_0x5748e5];return _0xe10ee0;};'use strict';var _=require(_0xe366('0x0'));var util=require(_0xe366('0x1'));var logger=require(_0xe366('0x2'))(_0xe366('0x3'));var moment=require(_0xe366('0x4'));var BPromise=require(_0xe366('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe366('0x6'));var rimraf=require(_0xe366('0x7'));var config=require(_0xe366('0x8'));var attributes=require(_0xe366('0x9'));module[_0xe366('0xa')]=function(_0x2eaf86,_0xb85705){return _0x2eaf86[_0xe366('0xb')](_0xe366('0xc'),attributes,{'tableName':_0xe366('0xd'),'paranoid':![],'indexes':[{'name':_0xe366('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 181bdda..1301d58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeef2=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0xeef2,0x89));var _0x2eef=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xeef2[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2eef('0x0'));var util=require(_0x2eef('0x1'));var moment=require('moment');var BPromise=require(_0x2eef('0x2'));var rs=require(_0x2eef('0x3'));var fs=require('fs');var Redis=require(_0x2eef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2eef('0x5'));var logger=require(_0x2eef('0x6'))(_0x2eef('0x7'));var config=require(_0x2eef('0x8'));var jayson=require(_0x2eef('0x9'));var client=jayson[_0x2eef('0xa')][_0x2eef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16dd6b,_0x13b7dd,_0x4b33fc){return new BPromise(function(_0x5a7d8b,_0x5f55e8){return client['request'](_0x16dd6b,_0x4b33fc)[_0x2eef('0xc')](function(_0x2a55a8){logger[_0x2eef('0xd')](_0x2eef('0xe'),_0x13b7dd,_0x2eef('0xf'));logger['debug'](_0x2eef('0x10'),_0x13b7dd,_0x2eef('0xf'),JSON[_0x2eef('0x11')](_0x2a55a8));if(_0x2a55a8[_0x2eef('0x12')]){if(_0x2a55a8[_0x2eef('0x12')]['code']===0x1f4){logger[_0x2eef('0x12')](_0x2eef('0xe'),_0x13b7dd,_0x2a55a8['error'][_0x2eef('0x13')]);return _0x5f55e8(_0x2a55a8[_0x2eef('0x12')]['message']);}logger[_0x2eef('0x12')](_0x2eef('0xe'),_0x13b7dd,_0x2a55a8['error'][_0x2eef('0x13')]);return _0x5a7d8b(_0x2a55a8[_0x2eef('0x12')][_0x2eef('0x13')]);}else{logger[_0x2eef('0xd')](_0x2eef('0xe'),_0x13b7dd,_0x2eef('0xf'));_0x5a7d8b(_0x2a55a8[_0x2eef('0x14')]['message']);}})[_0x2eef('0x15')](function(_0x551627){logger['error'](_0x2eef('0xe'),_0x13b7dd,_0x551627);_0x5f55e8(_0x551627);});});}
\ No newline at end of file
+var _0xa98b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash'];(function(_0x2c8b7a,_0x483fe0){var _0x1c1cf9=function(_0x464bcf){while(--_0x464bcf){_0x2c8b7a['push'](_0x2c8b7a['shift']());}};_0x1c1cf9(++_0x483fe0);}(_0xa98b,0x158));var _0xba98=function(_0x35e301,_0x156fd6){_0x35e301=_0x35e301-0x0;var _0x16fcd1=_0xa98b[_0x35e301];return _0x16fcd1;};'use strict';var _=require(_0xba98('0x0'));var util=require('util');var moment=require(_0xba98('0x1'));var BPromise=require(_0xba98('0x2'));var rs=require(_0xba98('0x3'));var fs=require('fs');var Redis=require(_0xba98('0x4'));var db=require(_0xba98('0x5'))['db'];var utils=require(_0xba98('0x6'));var logger=require(_0xba98('0x7'))('rpc');var config=require(_0xba98('0x8'));var jayson=require(_0xba98('0x9'));var client=jayson[_0xba98('0xa')][_0xba98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb7c5,_0x2ef83a,_0xa3f8da){return new BPromise(function(_0x32f1fe,_0x2d6fb8){return client[_0xba98('0xc')](_0x1eb7c5,_0xa3f8da)[_0xba98('0xd')](function(_0x2c8cc5){logger['info'](_0xba98('0xe'),_0x2ef83a,_0xba98('0xf'));logger[_0xba98('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2ef83a,'request\x20sent',JSON[_0xba98('0x11')](_0x2c8cc5));if(_0x2c8cc5[_0xba98('0x12')]){if(_0x2c8cc5[_0xba98('0x12')]['code']===0x1f4){logger[_0xba98('0x12')](_0xba98('0xe'),_0x2ef83a,_0x2c8cc5[_0xba98('0x12')]['message']);return _0x2d6fb8(_0x2c8cc5[_0xba98('0x12')][_0xba98('0x13')]);}logger[_0xba98('0x12')](_0xba98('0xe'),_0x2ef83a,_0x2c8cc5[_0xba98('0x12')][_0xba98('0x13')]);return _0x32f1fe(_0x2c8cc5[_0xba98('0x12')][_0xba98('0x13')]);}else{logger[_0xba98('0x14')](_0xba98('0xe'),_0x2ef83a,_0xba98('0xf'));_0x32f1fe(_0x2c8cc5[_0xba98('0x15')][_0xba98('0x13')]);}})[_0xba98('0x16')](function(_0x30243b){logger['error'](_0xba98('0xe'),_0x2ef83a,_0x30243b);_0x2d6fb8(_0x30243b);});});}
\ No newline at end of file
index e025dcd..ecc0f00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2255=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','info','start','Online\x20apps:','filter','join','Offline\x20apps:','map','name','./config/seedDB','default','./config/license','error'];(function(_0x4d62ae,_0x1509f5){var _0x54d4b7=function(_0x492d51){while(--_0x492d51){_0x4d62ae['push'](_0x4d62ae['shift']());}};_0x54d4b7(++_0x1509f5);}(_0x2255,0x1dd));var _0x5225=function(_0x50c2cd,_0x1fbc08){_0x50c2cd=_0x50c2cd-0x0;var _0xbe5919=_0x2255[_0x50c2cd];return _0xbe5919;};'use strict';var _=require(_0x5225('0x0'));var mysqldb=require(_0x5225('0x1'));var rpc=require('./rpc');var config=require(_0x5225('0x2'));var logger=require(_0x5225('0x3'))(_0x5225('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x5225('0x5'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0x5225('0x6'));var transcribe=require(_0x5225('0x7'));function main(){return mysqldb['db'][_0x5225('0x8')][_0x5225('0x9')]()['then'](function(){return rpc['listen']();})[_0x5225('0xa')](function(_0x8bceb5){logger[_0x5225('0xb')](_0x8bceb5);return chat['start']();})[_0x5225('0xa')](function(){return whatsapp[_0x5225('0xc')]();})['then'](function(){return schedule[_0x5225('0xc')]();})[_0x5225('0xa')](function(){return transcribe[_0x5225('0xc')]();})[_0x5225('0xa')](function(_0x448eda){logger[_0x5225('0xb')](_0x448eda);return pm2['start'](pm2Config);})['then'](function(_0x457ee9){logger['info'](_0x5225('0xd'),_['map'](_[_0x5225('0xe')](_0x457ee9,{'status':'online'}),'name')[_0x5225('0xf')]());logger['info'](_0x5225('0x10'),_[_0x5225('0x11')](_['filter'](_0x457ee9,function(_0x133ac9){return _0x133ac9['status']!=='online';}),_0x5225('0x12'))[_0x5225('0xf')]()||'None');config['seedDB']&&require(_0x5225('0x13'))[_0x5225('0x14')]();require(_0x5225('0x15'))[_0x5225('0x14')]();})['catch'](function(_0x4aebce){logger[_0x5225('0x16')](_0x5225('0x17'),_0x4aebce);process[_0x5225('0x18')](0x1);});}main();
\ No newline at end of file
+var _0x42d9=['lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','start','info','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','online','seedDB','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x3a0cb2,_0x17bf0f){var _0x5ef05b=function(_0x35ee33){while(--_0x35ee33){_0x3a0cb2['push'](_0x3a0cb2['shift']());}};_0x5ef05b(++_0x17bf0f);}(_0x42d9,0x13f));var _0x942d=function(_0x21ba39,_0x413046){_0x21ba39=_0x21ba39-0x0;var _0x7a1e4f=_0x42d9[_0x21ba39];return _0x7a1e4f;};'use strict';var _=require(_0x942d('0x0'));var mysqldb=require(_0x942d('0x1'));var rpc=require(_0x942d('0x2'));var config=require(_0x942d('0x3'));var logger=require('./config/logger')(_0x942d('0x4'));var pm2=require(_0x942d('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x942d('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x942d('0x7'));var transcribe=require(_0x942d('0x8'));function main(){return mysqldb['db'][_0x942d('0x9')][_0x942d('0xa')]()[_0x942d('0xb')](function(){return rpc['listen']();})[_0x942d('0xb')](function(_0x4772e1){logger['info'](_0x4772e1);return chat[_0x942d('0xc')]();})[_0x942d('0xb')](function(){return whatsapp['start']();})[_0x942d('0xb')](function(){return schedule[_0x942d('0xc')]();})[_0x942d('0xb')](function(){return transcribe[_0x942d('0xc')]();})[_0x942d('0xb')](function(_0x136742){logger[_0x942d('0xd')](_0x136742);return pm2[_0x942d('0xc')](pm2Config);})[_0x942d('0xb')](function(_0x4d132e){logger['info'](_0x942d('0xe'),_[_0x942d('0xf')](_[_0x942d('0x10')](_0x4d132e,{'status':'online'}),_0x942d('0x11'))[_0x942d('0x12')]());logger['info'](_0x942d('0x13'),_['map'](_[_0x942d('0x10')](_0x4d132e,function(_0x1fceed){return _0x1fceed[_0x942d('0x14')]!==_0x942d('0x15');}),_0x942d('0x11'))[_0x942d('0x12')]()||'None');config[_0x942d('0x16')]&&require(_0x942d('0x17'))[_0x942d('0x18')]();require(_0x942d('0x19'))[_0x942d('0x18')]();})['catch'](function(_0x256634){logger[_0x942d('0x1a')](_0x942d('0x1b'),_0x256634);process[_0x942d('0x1c')](0x1);});}main();
\ No newline at end of file
index 92daaea..77d5f71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c51=['../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','util','secrets','session','role','fullname','internal','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadAttachments','isAuthenticated','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Unmanaged.','headers','authorization','startsWith','Basic','User','name','authenticate','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','minutes','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','unshift','encryptString','promisify','sign','secret','payload','options','verify','randomBytes','hex','floor','toString','HS512'];(function(_0x13cf7a,_0x479809){var _0x5cb678=function(_0x267d4a){while(--_0x267d4a){_0x13cf7a['push'](_0x13cf7a['shift']());}};_0x5cb678(++_0x479809);}(_0x5c51,0x1ec));var _0x15c5=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x5c51[_0x33154d];return _0x3b2f03;};'use strict';var db=require(_0x15c5('0x0'))['db'];var config=require(_0x15c5('0x1'));var hardwareConf=require(_0x15c5('0x2'));var licenseUtil=require(_0x15c5('0x3'));var encryptor=require(_0x15c5('0x4'));var _=require(_0x15c5('0x5'));var jwt=require(_0x15c5('0x6'));var expressJwt=require(_0x15c5('0x7'));var compose=require('composable-middleware');var basicAuth=require(_0x15c5('0x8'));var crypto=require(_0x15c5('0x9'));var BPromise=require('bluebird');var util=require(_0x15c5('0xa'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x15c5('0xb')][_0x15c5('0xc')]});var userAttributes=['id',_0x15c5('0xd'),_0x15c5('0xe'),'name',_0x15c5('0xf'),'email',_0x15c5('0x10'),'permissions',_0x15c5('0x11'),_0x15c5('0x12'),_0x15c5('0x13'),_0x15c5('0x14'),_0x15c5('0x15'),'smsPause',_0x15c5('0x16'),'pauseType',_0x15c5('0x17'),_0x15c5('0x18'),'lastPauseAt',_0x15c5('0x19'),_0x15c5('0x1a'),'passwordResetAt',_0x15c5('0x1b'),_0x15c5('0x1c'),_0x15c5('0x1d'),_0x15c5('0x1e'),_0x15c5('0x1f'),_0x15c5('0x20'),_0x15c5('0x21'),_0x15c5('0x22'),'phoneBarPrefixRequired',_0x15c5('0x23'),'phoneBarRemoteControlPort','hotdesk',_0x15c5('0x24'),_0x15c5('0x25'),_0x15c5('0x26'),_0x15c5('0x27'),_0x15c5('0x28'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0x15c5('0x29')];exports['isChatInteractionAuthorized']=function(){return this[_0x15c5('0x2a')](!![])[_0x15c5('0x2b')](function(_0x5d18c6,_0x126ab4,_0x5b8870){if(_0x5d18c6[_0x15c5('0x2c')]){_0x5b8870();}else{return db[_0x15c5('0x2d')]['findOne']({'where':{'id':_0x5d18c6[_0x15c5('0x2e')]['id']},'attributes':['id',_0x15c5('0x2f'),_0x15c5('0x30')],'raw':!![]})[_0x15c5('0x31')](function(_0x2e5462){if(_0x2e5462&&_0x2e5462[_0x15c5('0x2f')]){return _0x126ab4[_0x15c5('0x32')](_0x2e5462[_0x15c5('0x30')]===_0x15c5('0x33')?0x195:0x193)['json']({'message':_0x2e5462[_0x15c5('0x30')]===_0x15c5('0x33')?_0x15c5('0x34'):'Forbidden.'});}else{_0x5b8870();}})['catch'](function(_0x56c917){_0x5b8870(_0x56c917);});}});};exports[_0x15c5('0x2a')]=function isAuthenticated(_0x13060b){return compose()['use'](function(_0x43ccd2,_0x581000,_0x6fb52f){var _0x772efd;if(_0x43ccd2[_0x15c5('0x35')][_0x15c5('0x36')]){if(_[_0x15c5('0x37')](_0x43ccd2[_0x15c5('0x35')][_0x15c5('0x36')],_0x15c5('0x38'))){var _0x1a8c62=basicAuth(_0x43ccd2);db[_0x15c5('0x39')]['find']({'where':{'name':_0x1a8c62[_0x15c5('0x3a')]}})['then'](function(_0x327109){if(!_0x327109||!_0x327109[_0x15c5('0x3b')](_0x1a8c62[_0x15c5('0x3c')])){return _0x581000[_0x15c5('0x32')](0x191)[_0x15c5('0x3d')]({'message':_0x15c5('0x3e')});}_0x43ccd2['user']={'id':_0x327109['id']};_0x6fb52f();})['catch'](function(_0x5c1cae){_0x6fb52f(_0x5c1cae);});}else if(_[_0x15c5('0x37')](_0x43ccd2[_0x15c5('0x35')]['authorization'],'Bearer')){validateJwt(_0x43ccd2,_0x581000,_0x6fb52f);}else{if(_0x13060b){_0x6fb52f();}else{return _0x581000[_0x15c5('0x32')](0x193)['json']({'message':_0x15c5('0x3f')});}}}else if(_0x43ccd2[_0x15c5('0x40')][_0x15c5('0x41')]){try{var _0x5b8526={'audience':hardwareConf[_0x15c5('0x42')](),'issuer':hardwareConf[_0x15c5('0x42')]()};verifyJwt(_0x43ccd2[_0x15c5('0x40')][_0x15c5('0x41')],_0x5b8526)['then'](function(_0x255605){return db[_0x15c5('0x39')][_0x15c5('0x43')]({'where':{'id':_0x255605[_0x15c5('0x44')]}})[_0x15c5('0x31')](function(_0x7c1e73){_0x772efd=_0x7c1e73;return db[_0x15c5('0x45')][_0x15c5('0x46')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x15c5('0x47')],'raw':!![]});})[_0x15c5('0x31')](function(_0x110d4d){if(!_0x772efd||!_[_0x15c5('0x48')](_0x772efd[_0x15c5('0x49')],_0x255605['nonce'])){return _0x581000[_0x15c5('0x32')](0x191)[_0x15c5('0x3d')]({'message':_0x15c5('0x4a')});}if(_0x772efd['disabled']){return _0x581000[_0x15c5('0x32')](0x191)[_0x15c5('0x3d')]({'message':_0x15c5('0x4b')});}if(_0x772efd['blocked']){if(_0x110d4d[_0x15c5('0x47')]>0x0){if(moment(_0x772efd[_0x15c5('0x4c')])['add'](_0x110d4d[_0x15c5('0x47')],_0x15c5('0x4d'))>moment()){return _0x581000[_0x15c5('0x32')](0x191)[_0x15c5('0x3d')]({'message':_0x15c5('0x4b')});}}else{return _0x581000[_0x15c5('0x32')](0x191)[_0x15c5('0x3d')]({'message':_0x15c5('0x4b')});}}_0x43ccd2['user']={'id':_0x772efd['id']};_0x6fb52f();});})[_0x15c5('0x4e')](function(){return _0x581000[_0x15c5('0x32')](0x191)[_0x15c5('0x3d')]({'message':_0x15c5('0x4b')});});}catch(_0x3ced3c){_0x6fb52f(_0x3ced3c);}}else if(_0x13060b){_0x6fb52f();}else{return _0x581000['status'](0x193)['json']({'message':_0x15c5('0x3f')});}})[_0x15c5('0x2b')](function(_0x41b299,_0x5cbd4c,_0x2fc977){if(_0x41b299[_0x15c5('0x2c')]){db[_0x15c5('0x39')]['find']({'where':{'id':_0x41b299[_0x15c5('0x2c')]['id']},'attributes':userAttributes})[_0x15c5('0x31')](function(_0x5f2d00){if(!_0x5f2d00){return _0x5cbd4c['status'](0x194)[_0x15c5('0x3d')]({'message':_0x15c5('0x4f')});}_0x41b299[_0x15c5('0x2c')]=_0x5f2d00;_0x2fc977();})[_0x15c5('0x4e')](function(_0xc1e4b1){_0x2fc977(_0xc1e4b1);});}else if(_0x13060b){_0x2fc977();}else{return _0x5cbd4c[_0x15c5('0x32')](0x194)['json']({'message':_0x15c5('0x50')});}});};exports[_0x15c5('0x51')]=function canUpdate(){return compose()[_0x15c5('0x2b')](function(_0x183f26,_0x64dcda,_0x3d493a){return licenseUtil[_0x15c5('0x52')]()[_0x15c5('0x31')](function(_0x39bb3d){if(_0x39bb3d[_0x15c5('0x53')]){_0x3d493a();}else{return _0x64dcda['status'](0x193)[_0x15c5('0x3d')]({'message':_0x15c5('0x54')});}})[_0x15c5('0x4e')](function(_0x17eebb){_0x3d493a(_0x17eebb);});});};exports['isMiddleware']=function(_0x1f77e0,_0x5bca37,_0x47355b){_0x1f77e0['isMiddleware']=!![];return _0x47355b();};exports[_0x15c5('0x55')]=function signToken(_0x4ccb40){return signJwt(_0x4ccb40);};exports[_0x15c5('0x56')]=function(_0x54fbc6,_0x24123e){if(!_0x54fbc6[_0x15c5('0x2c')]){return _0x24123e[_0x15c5('0x32')](0x194)[_0x15c5('0x3d')]({'message':_0x15c5('0x57')});}var _0x387a86={'payload':{'id':_0x54fbc6[_0x15c5('0x2c')]['id'],'role':_0x54fbc6['user'][_0x15c5('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x387a86)['then'](function(_0x537a66){_0x24123e[_0x15c5('0x58')](_0x15c5('0x59'),_0x537a66);_0x24123e[_0x15c5('0x5a')](_0x15c5('0x5b'));})[_0x15c5('0x4e')](function(_0x12dd58){return _0x24123e[_0x15c5('0x32')](0x1f4)[_0x15c5('0x5c')](_0x12dd58);});};exports[_0x15c5('0x5d')]=function(_0x4c9c41){if(_[_0x15c5('0x5e')](_0x4c9c41[_0x15c5('0x49')])||_[_0x15c5('0x5e')](_0x4c9c41[_0x15c5('0x5f')])){return null;}else{return createJwt(_0x4c9c41);}};exports[_0x15c5('0x60')]=function(_0xc76186){_0xc76186[_0x15c5('0x49')]=generateNonce();_0xc76186['apiKeyIat']=generateIssuedAt();return createJwt(_0xc76186);};exports[_0x15c5('0x61')]=function(_0x4079a8,_0x36b603){var _0x45f5da=_0x4079a8[_0x15c5('0x40')][_0x15c5('0x41')];if(_0x45f5da){var _0x22fcc0={'nonce':_0x36b603[_0x15c5('0x49')],'iat':_0x36b603[_0x15c5('0x5f')],'audience':hardwareConf[_0x15c5('0x42')](),'issuer':hardwareConf[_0x15c5('0x42')]()};return verifyJwt(_0x45f5da,_0x22fcc0)[_0x15c5('0x31')](function(){return generateApiKey(_0x36b603);});}else{throw{'message':_0x15c5('0x62')};}};exports[_0x15c5('0x63')]=function(_0x278b3b){var _0x5b2a0a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5b2a0a[_0x15c5('0x64')](_0x278b3b))throw new db[(_0x15c5('0x65'))]['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~!@#$%^&-_=+[{]}.');return;};exports[_0x15c5('0x66')]=function(_0x5a5139,_0x4169e1,_0x2d1b56){var _0x8ad62b=encryptor[_0x15c5('0x67')](_0x4169e1)[_0x15c5('0x68')](',');for(var _0x18a9c7=0x0;_0x18a9c7<_0x2d1b56;_0x18a9c7++){if(!_0x8ad62b[_0x18a9c7])break;if(_0x5a5139[_0x15c5('0x69')]()===_0x8ad62b[_0x18a9c7][_0x15c5('0x69')]()){var _0x3e14ab=util[_0x15c5('0x6a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x2d1b56);if(_0x2d1b56===0x1){_0x3e14ab=_0x15c5('0x6b');}throw new db[(_0x15c5('0x65'))][(_0x15c5('0x6c'))](_0x3e14ab);}}return;};exports[_0x15c5('0x6d')]=function(_0x16dd17,_0x11a60f){var _0x1cd7d9=_0x11a60f?encryptor[_0x15c5('0x67')](_0x11a60f)[_0x15c5('0x68')](','):[];if(_0x1cd7d9['length']===0x5){_0x1cd7d9['splice'](-0x1,0x1);}_0x1cd7d9[_0x15c5('0x6e')](_0x16dd17);return encryptor[_0x15c5('0x6f')](_0x1cd7d9['join'](','));};function signJwt(_0x278343){var _0x2bcfd3=BPromise[_0x15c5('0x70')](jwt[_0x15c5('0x71')],{'context':jwt});var _0xf94aa9=_0x278343[_0x15c5('0x72')]||config['secrets'][_0x15c5('0xc')];return new BPromise(function(_0x4395af,_0x4a8c0a){_0x2bcfd3(_0x278343[_0x15c5('0x73')],_0xf94aa9,_0x278343[_0x15c5('0x74')])[_0x15c5('0x31')](function(_0x10fec8){_0x4395af(_0x10fec8);})[_0x15c5('0x4e')](function(_0x4c7349){_0x4a8c0a(_0x4c7349);});});}function verifyJwt(_0x5742e1,_0x1208c6,_0x42d9c0){var _0xb423df=BPromise['promisify'](jwt[_0x15c5('0x75')],{'context':jwt});var _0x22b7f2=_0x42d9c0||config['secrets'][_0x15c5('0xc')];return new BPromise(function(_0x980874,_0x55d5c7){_0xb423df(_0x5742e1,_0x22b7f2,_0x1208c6)[_0x15c5('0x31')](function(_0x2c2c31){_0x980874(_0x2c2c31);})['catch'](function(_0x4a47ea){_0x55d5c7(_0x4a47ea);});});}function generateNonce(){return crypto[_0x15c5('0x76')](0x10)['toString'](_0x15c5('0x77'));}function generateIssuedAt(){return Math[_0x15c5('0x78')](Date['now']()/0x3e8)[_0x15c5('0x79')]();}function createJwt(_0x512307){var _0x191c16={'payload':{'iat':_0x512307['apiKeyIat'],'nonce':_0x512307[_0x15c5('0x49')]},'options':{'algorithm':_0x15c5('0x7a'),'subject':_0x512307['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x15c5('0x42')]()}};return signJwt(_0x191c16)['then'](function(_0x13e052){return{'iat':_0x512307[_0x15c5('0x5f')],'nonce':_0x512307[_0x15c5('0x49')],'token':_0x13e052};});}
\ No newline at end of file
+var _0x466f=['user','ChatInteraction','findOne','params','closed','then','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','headers','authorization','Basic','find','authenticate','pass','status','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','isEqual','nonce','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','use','User\x20object\x20not\x20found.','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','validatePasswordPattern','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','length','splice','unshift','encryptString','join','sign','secret','session','payload','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','composable-middleware','bluebird','util','moment','secrets','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated'];(function(_0x329159,_0x4fef75){var _0x1158fd=function(_0x2132d3){while(--_0x2132d3){_0x329159['push'](_0x329159['shift']());}};_0x1158fd(++_0x4fef75);}(_0x466f,0xcb));var _0xf466=function(_0x4c7743,_0xe40022){_0x4c7743=_0x4c7743-0x0;var _0x2bd359=_0x466f[_0x4c7743];return _0x2bd359;};'use strict';var db=require(_0xf466('0x0'))['db'];var config=require(_0xf466('0x1'));var hardwareConf=require(_0xf466('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xf466('0x3'));var _=require(_0xf466('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0xf466('0x5'));var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0xf466('0x6'));var util=require(_0xf466('0x7'));var moment=require(_0xf466('0x8'));var validateJwt=expressJwt({'secret':config[_0xf466('0x9')]['session']});var userAttributes=['id','role',_0xf466('0xa'),_0xf466('0xb'),_0xf466('0xc'),_0xf466('0xd'),_0xf466('0xe'),_0xf466('0xf'),_0xf466('0x10'),_0xf466('0x11'),_0xf466('0x12'),_0xf466('0x13'),'faxPause',_0xf466('0x14'),_0xf466('0x15'),_0xf466('0x16'),_0xf466('0x17'),'lastLoginAt',_0xf466('0x18'),_0xf466('0x19'),_0xf466('0x1a'),_0xf466('0x1b'),_0xf466('0x1c'),'phoneBarAutoAnswer',_0xf466('0x1d'),'phoneBarDnd',_0xf466('0x1e'),'phoneBarEnableDtmfTone',_0xf466('0x1f'),_0xf466('0x20'),_0xf466('0x21'),_0xf466('0x22'),_0xf466('0x23'),_0xf466('0x24'),_0xf466('0x25'),_0xf466('0x26'),_0xf466('0x27'),'settingsEnabled',_0xf466('0x28'),_0xf466('0x29'),_0xf466('0x2a'),_0xf466('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0xf466('0x2c')](!![])['use'](function(_0x56b28c,_0x592d19,_0x5fcfe){if(_0x56b28c[_0xf466('0x2d')]){_0x5fcfe();}else{return db[_0xf466('0x2e')][_0xf466('0x2f')]({'where':{'id':_0x56b28c[_0xf466('0x30')]['id']},'attributes':['id',_0xf466('0x31'),'disposition'],'raw':!![]})[_0xf466('0x32')](function(_0x494adb){if(_0x494adb&&_0x494adb['closed']){return _0x592d19['status'](_0x494adb['disposition']===_0xf466('0x33')?0x195:0x193)[_0xf466('0x34')]({'message':_0x494adb[_0xf466('0x35')]===_0xf466('0x33')?_0xf466('0x36'):_0xf466('0x37')});}else{_0x5fcfe();}})[_0xf466('0x38')](function(_0x9d7790){_0x5fcfe(_0x9d7790);});}});};exports[_0xf466('0x2c')]=function isAuthenticated(_0x2ef4aa){return compose()['use'](function(_0x5f4f49,_0x3fbaa5,_0x200390){var _0x19fd7d;if(_0x5f4f49[_0xf466('0x39')][_0xf466('0x3a')]){if(_['startsWith'](_0x5f4f49[_0xf466('0x39')]['authorization'],_0xf466('0x3b'))){var _0x2ec491=basicAuth(_0x5f4f49);db['User'][_0xf466('0x3c')]({'where':{'name':_0x2ec491['name']}})[_0xf466('0x32')](function(_0x8d0897){if(!_0x8d0897||!_0x8d0897[_0xf466('0x3d')](_0x2ec491[_0xf466('0x3e')])){return _0x3fbaa5[_0xf466('0x3f')](0x191)[_0xf466('0x34')]({'message':'Wrong\x20credentials.'});}_0x5f4f49['user']={'id':_0x8d0897['id']};_0x200390();})[_0xf466('0x38')](function(_0x1e51d0){_0x200390(_0x1e51d0);});}else if(_[_0xf466('0x40')](_0x5f4f49[_0xf466('0x39')][_0xf466('0x3a')],_0xf466('0x41'))){validateJwt(_0x5f4f49,_0x3fbaa5,_0x200390);}else{if(_0x2ef4aa){_0x200390();}else{return _0x3fbaa5[_0xf466('0x3f')](0x193)[_0xf466('0x34')]({'message':_0xf466('0x42')});}}}else if(_0x5f4f49[_0xf466('0x43')][_0xf466('0x44')]){try{var _0x543e2e={'audience':hardwareConf[_0xf466('0x45')](),'issuer':hardwareConf[_0xf466('0x45')]()};verifyJwt(_0x5f4f49[_0xf466('0x43')]['apikey'],_0x543e2e)['then'](function(_0x21ee92){return db['User'][_0xf466('0x3c')]({'where':{'id':_0x21ee92[_0xf466('0x46')]}})[_0xf466('0x32')](function(_0x3fe9dd){_0x19fd7d=_0x3fe9dd;return db[_0xf466('0x47')][_0xf466('0x2f')]({'where':{'id':0x1},'attributes':[_0xf466('0x48'),'blockDuration'],'raw':!![]});})[_0xf466('0x32')](function(_0xed7a67){if(!_0x19fd7d||!_[_0xf466('0x49')](_0x19fd7d['apiKeyNonce'],_0x21ee92[_0xf466('0x4a')])){return _0x3fbaa5['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x19fd7d['disabled']){return _0x3fbaa5[_0xf466('0x3f')](0x191)['json']({'message':_0xf466('0x4b')});}if(_0x19fd7d[_0xf466('0x4c')]){if(_0xed7a67[_0xf466('0x4d')]>0x0){if(moment(_0x19fd7d[_0xf466('0x4e')])['add'](_0xed7a67[_0xf466('0x4d')],'minutes')>moment()){return _0x3fbaa5[_0xf466('0x3f')](0x191)['json']({'message':_0xf466('0x4b')});}}else{return _0x3fbaa5[_0xf466('0x3f')](0x191)[_0xf466('0x34')]({'message':_0xf466('0x4b')});}}_0x5f4f49[_0xf466('0x2d')]={'id':_0x19fd7d['id']};_0x200390();});})[_0xf466('0x38')](function(){return _0x3fbaa5[_0xf466('0x3f')](0x191)['json']({'message':_0xf466('0x4b')});});}catch(_0x5bab2b){_0x200390(_0x5bab2b);}}else if(_0x2ef4aa){_0x200390();}else{return _0x3fbaa5['status'](0x193)[_0xf466('0x34')]({'message':_0xf466('0x42')});}})[_0xf466('0x4f')](function(_0x2e50bf,_0x43ea1d,_0x313658){if(_0x2e50bf[_0xf466('0x2d')]){db['User'][_0xf466('0x3c')]({'where':{'id':_0x2e50bf[_0xf466('0x2d')]['id']},'attributes':userAttributes})[_0xf466('0x32')](function(_0x2c1904){if(!_0x2c1904){return _0x43ea1d[_0xf466('0x3f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x2e50bf[_0xf466('0x2d')]=_0x2c1904;_0x313658();})[_0xf466('0x38')](function(_0x5ebd1d){_0x313658(_0x5ebd1d);});}else if(_0x2ef4aa){_0x313658();}else{return _0x43ea1d[_0xf466('0x3f')](0x194)[_0xf466('0x34')]({'message':_0xf466('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xf466('0x4f')](function(_0x39e2d1,_0x1b4bbd,_0x33ff02){return licenseUtil[_0xf466('0x51')]()[_0xf466('0x32')](function(_0x400aeb){if(_0x400aeb[_0xf466('0x52')]){_0x33ff02();}else{return _0x1b4bbd['status'](0x193)[_0xf466('0x34')]({'message':_0xf466('0x53')});}})['catch'](function(_0x323295){_0x33ff02(_0x323295);});});};exports[_0xf466('0x54')]=function(_0x1a6f00,_0x1665c3,_0x49a129){_0x1a6f00[_0xf466('0x54')]=!![];return _0x49a129();};exports['signToken']=function signToken(_0x57db8c){return signJwt(_0x57db8c);};exports[_0xf466('0x55')]=function(_0x707e52,_0x49c0f8){if(!_0x707e52['user']){return _0x49c0f8[_0xf466('0x3f')](0x194)['json']({'message':_0xf466('0x56')});}var _0x3f6c13={'payload':{'id':_0x707e52[_0xf466('0x2d')]['id'],'role':_0x707e52['user'][_0xf466('0x57')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3f6c13)['then'](function(_0x5c3176){_0x49c0f8[_0xf466('0x58')](_0xf466('0x59'),_0x5c3176);_0x49c0f8[_0xf466('0x5a')](_0xf466('0x5b'));})['catch'](function(_0x510744){return _0x49c0f8[_0xf466('0x3f')](0x1f4)[_0xf466('0x5c')](_0x510744);});};exports[_0xf466('0x5d')]=function(_0x5a22c0){if(_[_0xf466('0x5e')](_0x5a22c0['apiKeyNonce'])||_[_0xf466('0x5e')](_0x5a22c0[_0xf466('0x5f')])){return null;}else{return createJwt(_0x5a22c0);}};exports[_0xf466('0x60')]=function(_0x4471cc){_0x4471cc[_0xf466('0x61')]=generateNonce();_0x4471cc[_0xf466('0x5f')]=generateIssuedAt();return createJwt(_0x4471cc);};exports['regenerateApiKey']=function(_0x294a9d,_0x41acbc){var _0x15993c=_0x294a9d[_0xf466('0x43')][_0xf466('0x44')];if(_0x15993c){var _0x1f1bb3={'nonce':_0x41acbc[_0xf466('0x61')],'iat':_0x41acbc[_0xf466('0x5f')],'audience':hardwareConf[_0xf466('0x45')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x15993c,_0x1f1bb3)[_0xf466('0x32')](function(){return generateApiKey(_0x41acbc);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xf466('0x62')]=function(_0x3875b3){var _0x4106c1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4106c1['test'](_0x3875b3))throw new db['Sequelize'][(_0xf466('0x63'))](_0xf466('0x64'));return;};exports[_0xf466('0x65')]=function(_0x5ea5f6,_0x5a051f,_0x440cdc){var _0x51e9f6=encryptor[_0xf466('0x66')](_0x5a051f)['split'](',');for(var _0xc2494e=0x0;_0xc2494e<_0x440cdc;_0xc2494e++){if(!_0x51e9f6[_0xc2494e])break;if(_0x5ea5f6[_0xf466('0x67')]()===_0x51e9f6[_0xc2494e][_0xf466('0x67')]()){var _0x90caf7=util[_0xf466('0x68')](_0xf466('0x69'),_0x440cdc);if(_0x440cdc===0x1){_0x90caf7='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xf466('0x6a'))][(_0xf466('0x63'))](_0x90caf7);}}return;};exports['updatePasswordsHistory']=function(_0x496865,_0x53c15e){var _0x429a89=_0x53c15e?encryptor[_0xf466('0x66')](_0x53c15e)['split'](','):[];if(_0x429a89[_0xf466('0x6b')]===0x5){_0x429a89[_0xf466('0x6c')](-0x1,0x1);}_0x429a89[_0xf466('0x6d')](_0x496865);return encryptor[_0xf466('0x6e')](_0x429a89[_0xf466('0x6f')](','));};function signJwt(_0x3a16cd){var _0x4bac4b=BPromise['promisify'](jwt[_0xf466('0x70')],{'context':jwt});var _0x58817d=_0x3a16cd[_0xf466('0x71')]||config[_0xf466('0x9')][_0xf466('0x72')];return new BPromise(function(_0x5a1bed,_0x19e5d5){_0x4bac4b(_0x3a16cd[_0xf466('0x73')],_0x58817d,_0x3a16cd['options'])[_0xf466('0x32')](function(_0x185605){_0x5a1bed(_0x185605);})[_0xf466('0x38')](function(_0x50346a){_0x19e5d5(_0x50346a);});});}function verifyJwt(_0x9b1547,_0x3fdf48,_0x9859af){var _0x22e262=BPromise[_0xf466('0x74')](jwt[_0xf466('0x75')],{'context':jwt});var _0x43bac6=_0x9859af||config[_0xf466('0x9')]['session'];return new BPromise(function(_0x278232,_0x422d41){_0x22e262(_0x9b1547,_0x43bac6,_0x3fdf48)[_0xf466('0x32')](function(_0x13dbf9){_0x278232(_0x13dbf9);})[_0xf466('0x38')](function(_0x420bcf){_0x422d41(_0x420bcf);});});}function generateNonce(){return crypto[_0xf466('0x76')](0x10)[_0xf466('0x77')](_0xf466('0x78'));}function generateIssuedAt(){return Math[_0xf466('0x79')](Date[_0xf466('0x7a')]()/0x3e8)[_0xf466('0x77')]();}function createJwt(_0x3245dd){var _0x376c9a={'payload':{'iat':_0x3245dd[_0xf466('0x5f')],'nonce':_0x3245dd[_0xf466('0x61')]},'options':{'algorithm':_0xf466('0x7b'),'subject':_0x3245dd['id'][_0xf466('0x77')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xf466('0x45')]()}};return signJwt(_0x376c9a)[_0xf466('0x32')](function(_0x1fa645){return{'iat':_0x3245dd[_0xf466('0x5f')],'nonce':_0x3245dd['apiKeyNonce'],'token':_0x1fa645};});}
\ No newline at end of file
index a12a721..4f9545a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be9=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','secrets','session','aes192','encrypt','algorithm','join'];(function(_0x4dbdda,_0x11f07c){var _0x1acbf1=function(_0x1a9fc8){while(--_0x1a9fc8){_0x4dbdda['push'](_0x4dbdda['shift']());}};_0x1acbf1(++_0x11f07c);}(_0x0be9,0x19a));var _0x90be=function(_0x5413de,_0x24355d){_0x5413de=_0x5413de-0x0;var _0x33796f=_0x0be9[_0x5413de];return _0x33796f;};'use strict';var crypto=require(_0x90be('0x0'));var fs=require('fs');var BPromise=require(_0x90be('0x1'));var _=require(_0x90be('0x2'));var config=require(_0x90be('0x3'));var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x90be('0x4')][_0x90be('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x90be('0x6')};if(config['encrypt']&&config[_0x90be('0x7')][_0x90be('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0x90be('0x8')]=config[_0x90be('0x7')][_0x90be('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x90be('0x9')](',\x20');logger[_0x90be('0xa')](config[_0x90be('0x7')][_0x90be('0x8')],_0x90be('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x10e4c7){return AES_SUPPORTED_RX[_0x90be('0xc')](_0x10e4c7);}function getSupportedCiphers(){return crypto[_0x90be('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x159ab7){return getSupportedCiphers()[_0x90be('0xe')](_0x159ab7)>-0x1;}function combineOptions(_0x560680){var _0xb024d={};for(var _0x5ab455 in fileOptions){if(fileOptions[_0x90be('0xf')](_0x5ab455)){_0xb024d[_0x5ab455]=fileOptions[_0x5ab455];}}if(_0x560680){for(var _0x74322a in _0x560680){if(_0x560680['hasOwnProperty'](_0x74322a)){_0xb024d[_0x74322a]=_0x560680[_0x74322a];}}}return _0xb024d;}exports[_0x90be('0x10')]=function(_0x1df0b9,_0x42a261,_0x241b7a,_0x71f66c){return new BPromise(function(_0x2c892e,_0x376b48){_0x71f66c=combineOptions(_0x71f66c);var _0x171940=new Buffer(_0x241b7a);var _0x6e32a4=fs[_0x90be('0x11')](_0x1df0b9);var _0x5f33df=fs[_0x90be('0x12')](_0x42a261);var _0x4ef428=crypto[_0x90be('0x13')](_0x71f66c[_0x90be('0x8')],_0x171940);_0x6e32a4['on'](_0x90be('0x14'),function(_0x237f9){var _0x27fd03=new Buffer(_0x4ef428[_0x90be('0x15')](_0x237f9),_0x90be('0x16'));_0x5f33df[_0x90be('0x17')](_0x27fd03);});_0x6e32a4['on'](_0x90be('0x18'),function(){try{var _0x1bde00=new Buffer(_0x4ef428[_0x90be('0x19')](_0x90be('0x16')),_0x90be('0x16'));_0x5f33df['write'](_0x1bde00);_0x5f33df[_0x90be('0x18')]();_0x5f33df['on'](_0x90be('0x1a'),function(){return _0x2c892e(_0x42a261);});}catch(_0x4e0d27){fs[_0x90be('0x1b')](_0x42a261);return _0x376b48(_0x4e0d27);}});});};exports[_0x90be('0x1c')]=function(_0x515c69,_0x35a456,_0x24a46f,_0x59ce67){return new BPromise(function(_0x4b49bd,_0x226db8){_0x59ce67=combineOptions(_0x59ce67);var _0x57d705=new Buffer(_0x24a46f);var _0x40f8af=fs[_0x90be('0x11')](_0x515c69);var _0x2a3ffe=fs[_0x90be('0x12')](_0x35a456);var _0x56f847=crypto[_0x90be('0x1d')](_0x59ce67[_0x90be('0x8')],_0x57d705);_0x40f8af['on'](_0x90be('0x14'),function(_0x2ea3b9){var _0x1400c2=new Buffer(_0x56f847[_0x90be('0x15')](_0x2ea3b9),_0x90be('0x16'));_0x2a3ffe['write'](_0x1400c2);});_0x40f8af['on']('end',function(){try{var _0x2b83f1=new Buffer(_0x56f847['final'](_0x90be('0x16')),_0x90be('0x16'));_0x2a3ffe[_0x90be('0x17')](_0x2b83f1);_0x2a3ffe['end']();_0x2a3ffe['on'](_0x90be('0x1a'),function(){return _0x4b49bd(_0x35a456);});}catch(_0x2cb936){fs[_0x90be('0x1b')](_0x35a456);return _0x226db8(_0x2cb936);}});});};exports[_0x90be('0x1e')]=function(_0x38c421,_0x3e1917,_0x10d802){var _0xafe394=_0x10d802||stringOptions[_0x90be('0x8')];var _0xad53e2=_0x3e1917||stringOptions[_0x90be('0x1f')];var _0x436fa4=crypto[_0x90be('0x13')](_0xafe394,_0xad53e2);var _0x8ae9c2=_0x436fa4['update'](_0x38c421,_0x90be('0x20'),_0x90be('0x21'));_0x8ae9c2+=_0x436fa4[_0x90be('0x19')](_0x90be('0x21'));return _0x8ae9c2;};exports[_0x90be('0x22')]=function(_0x4d2e66,_0x4b5563,_0x33a8b1){var _0x2d3148=_0x33a8b1||stringOptions[_0x90be('0x8')];var _0xfc1225=_0x4b5563||stringOptions[_0x90be('0x1f')];var _0x3e02ac=crypto[_0x90be('0x1d')](_0x2d3148,_0xfc1225);var _0x240337=_0x3e02ac[_0x90be('0x15')](_0x4d2e66,_0x90be('0x21'),_0x90be('0x20'));_0x240337+=_0x3e02ac['final']('utf8');return _0x240337;};
\ No newline at end of file
+var _0x3aff=['secret','utf8','base64','decryptString','crypto','bluebird','../../config/environment','../../config/logger','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher'];(function(_0x35edc7,_0x3f2e66){var _0x704e97=function(_0x10487f){while(--_0x10487f){_0x35edc7['push'](_0x35edc7['shift']());}};_0x704e97(++_0x3f2e66);}(_0x3aff,0x16f));var _0xf3af=function(_0x26fe14,_0x35db80){_0x26fe14=_0x26fe14-0x0;var _0x128773=_0x3aff[_0x26fe14];return _0x128773;};'use strict';var crypto=require(_0xf3af('0x0'));var fs=require('fs');var BPromise=require(_0xf3af('0x1'));var _=require('lodash');var config=require(_0xf3af('0x2'));var logger=require(_0xf3af('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0xf3af('0x4')],'algorithm':_0xf3af('0x5')};const fileOptions={'algorithm':_0xf3af('0x6')};if(config['encrypt']&&config[_0xf3af('0x7')][_0xf3af('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xf3af('0x8')]);if(isSupported){fileOptions[_0xf3af('0x8')]=config[_0xf3af('0x7')][_0xf3af('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xf3af('0x9')](',\x20');logger[_0xf3af('0xa')](config[_0xf3af('0x7')][_0xf3af('0x8')],_0xf3af('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5436ac){return AES_SUPPORTED_RX[_0xf3af('0xc')](_0x5436ac);}function getSupportedCiphers(){return crypto[_0xf3af('0xd')]()[_0xf3af('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x5094a7){return getSupportedCiphers()['indexOf'](_0x5094a7)>-0x1;}function combineOptions(_0x525dcc){var _0x1f2ace={};for(var _0x538cf2 in fileOptions){if(fileOptions[_0xf3af('0xf')](_0x538cf2)){_0x1f2ace[_0x538cf2]=fileOptions[_0x538cf2];}}if(_0x525dcc){for(var _0x4294f1 in _0x525dcc){if(_0x525dcc['hasOwnProperty'](_0x4294f1)){_0x1f2ace[_0x4294f1]=_0x525dcc[_0x4294f1];}}}return _0x1f2ace;}exports['encryptFile']=function(_0x33e9bd,_0x1c1f56,_0x396231,_0x1d2e45){return new BPromise(function(_0x2ed4f6,_0x528c34){_0x1d2e45=combineOptions(_0x1d2e45);var _0x5d551a=new Buffer(_0x396231);var _0x507fd1=fs['createReadStream'](_0x33e9bd);var _0x46c28b=fs[_0xf3af('0x10')](_0x1c1f56);var _0x5a2b73=crypto[_0xf3af('0x11')](_0x1d2e45['algorithm'],_0x5d551a);_0x507fd1['on'](_0xf3af('0x12'),function(_0x133f3d){var _0x541369=new Buffer(_0x5a2b73[_0xf3af('0x13')](_0x133f3d),_0xf3af('0x14'));_0x46c28b[_0xf3af('0x15')](_0x541369);});_0x507fd1['on'](_0xf3af('0x16'),function(){try{var _0x57156e=new Buffer(_0x5a2b73[_0xf3af('0x17')]('binary'),'binary');_0x46c28b[_0xf3af('0x15')](_0x57156e);_0x46c28b[_0xf3af('0x16')]();_0x46c28b['on'](_0xf3af('0x18'),function(){return _0x2ed4f6(_0x1c1f56);});}catch(_0x328165){fs[_0xf3af('0x19')](_0x1c1f56);return _0x528c34(_0x328165);}});});};exports[_0xf3af('0x1a')]=function(_0x10deb6,_0x3e84e0,_0x40b032,_0x10f413){return new BPromise(function(_0x20e624,_0x39c644){_0x10f413=combineOptions(_0x10f413);var _0x266895=new Buffer(_0x40b032);var _0x3050c9=fs[_0xf3af('0x1b')](_0x10deb6);var _0x4efbdd=fs[_0xf3af('0x10')](_0x3e84e0);var _0x378f1d=crypto[_0xf3af('0x1c')](_0x10f413[_0xf3af('0x8')],_0x266895);_0x3050c9['on'](_0xf3af('0x12'),function(_0x7df83a){var _0x30ec8c=new Buffer(_0x378f1d[_0xf3af('0x13')](_0x7df83a),_0xf3af('0x14'));_0x4efbdd[_0xf3af('0x15')](_0x30ec8c);});_0x3050c9['on'](_0xf3af('0x16'),function(){try{var _0x397066=new Buffer(_0x378f1d[_0xf3af('0x17')](_0xf3af('0x14')),'binary');_0x4efbdd[_0xf3af('0x15')](_0x397066);_0x4efbdd[_0xf3af('0x16')]();_0x4efbdd['on']('close',function(){return _0x20e624(_0x3e84e0);});}catch(_0xa1366e){fs[_0xf3af('0x19')](_0x3e84e0);return _0x39c644(_0xa1366e);}});});};exports['encryptString']=function(_0x468eb7,_0x5506b2,_0x4b678e){var _0x1ad57e=_0x4b678e||stringOptions[_0xf3af('0x8')];var _0x56b676=_0x5506b2||stringOptions[_0xf3af('0x1d')];var _0x3c61cc=crypto[_0xf3af('0x11')](_0x1ad57e,_0x56b676);var _0x4bd82c=_0x3c61cc[_0xf3af('0x13')](_0x468eb7,_0xf3af('0x1e'),_0xf3af('0x1f'));_0x4bd82c+=_0x3c61cc[_0xf3af('0x17')]('base64');return _0x4bd82c;};exports[_0xf3af('0x20')]=function(_0x4b42b1,_0xf965ba,_0x37f66f){var _0x45ed1c=_0x37f66f||stringOptions[_0xf3af('0x8')];var _0x228636=_0xf965ba||stringOptions[_0xf3af('0x1d')];var _0x24a94a=crypto['createDecipher'](_0x45ed1c,_0x228636);var _0x194cbe=_0x24a94a[_0xf3af('0x13')](_0x4b42b1,'base64','utf8');_0x194cbe+=_0x24a94a['final']('utf8');return _0x194cbe;};
\ No newline at end of file
index 8ec4829..d2f8125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b87=['each','%s%d.%s','%s.%s','csv','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','push','SELECT','dirname','.csv','length','join','mkdirSync'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x9b87,0x8e));var _0x79b8=function(_0x1d125c,_0xa89755){_0x1d125c=_0x1d125c-0x0;var _0x10d90c=_0x9b87[_0x1d125c];return _0x10d90c;};'use strict';var util=require(_0x79b8('0x0'));var path=require(_0x79b8('0x1'));var _=require(_0x79b8('0x2'));var csv=require(_0x79b8('0x3'));var fs=require('fs');var BPromise=require(_0x79b8('0x4'));var zipdir=require(_0x79b8('0x5'));var rimraf=require(_0x79b8('0x6'));var db=require(_0x79b8('0x7'))['db'];var dbH=require(_0x79b8('0x7'))[_0x79b8('0x8')];var logger=require(_0x79b8('0x9'))(_0x79b8('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x79b8('0xb')][0x2]);var QUERY=process[_0x79b8('0xb')][0x3];var PATH=process[_0x79b8('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf5e0f2,_0x5e10fe){var _0x4e0dd8={'status':_0xf5e0f2};var _0x5c15d4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e10fe){_0x4e0dd8['savename']=_0x5e10fe;}return db[_0x79b8('0xc')][_0x79b8('0xd')](_0x4e0dd8,_0x5c15d4);}function main(){var _0x2f3453=0x1388;var _0x4bc41f;logger[_0x79b8('0xe')](util[_0x79b8('0xf')](_0x79b8('0x10'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x79b8('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x79b8('0x12'),_0x79b8('0x13')]})[_0x79b8('0x14')](function(_0x21ad20){if(_0x21ad20){_0x4bc41f=_0x21ad20;_0x2f3453=_0x4bc41f[_0x79b8('0x13')]||0x1388;}})[_0x79b8('0x14')](function(){return dbH[_0x79b8('0x15')][_0x79b8('0x16')](util[_0x79b8('0xf')](_0x79b8('0x17'),QUERY),{'type':dbH['sequelize'][_0x79b8('0x18')]['SELECT']});})['then'](function(_0x3142e9){if(!_0x3142e9[0x0][_0x79b8('0x19')]){return analyticExtractedReport(_0x79b8('0x1a'));}var _0x5ddab5=[];var _0x3e3de3=0x0;var _0x49e40b=!![];if(_0x3142e9&&_0x3142e9['length']){var _0x26f2ec=_0x3142e9[0x0][_0x79b8('0x19')]%(_0x3e3de3+_0x2f3453);if(_0x4bc41f[_0x79b8('0x12')]){for(;_0x49e40b;_0x3e3de3+=_0x2f3453,_0x26f2ec=_0x3142e9[0x0][_0x79b8('0x19')]%(_0x3e3de3+_0x2f3453)){if(_0x26f2ec==0x0||_0x26f2ec==_0x3142e9[0x0][_0x79b8('0x19')]){_0x49e40b=![];}_0x5ddab5[_0x79b8('0x1b')](dbH['sequelize'][_0x79b8('0x16')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2f3453,_0x3e3de3),{'type':dbH[_0x79b8('0x15')][_0x79b8('0x18')][_0x79b8('0x1c')]}));}}else{_0x5ddab5[_0x79b8('0x1b')](dbH[_0x79b8('0x15')][_0x79b8('0x16')](QUERY,{'type':dbH[_0x79b8('0x15')][_0x79b8('0x18')][_0x79b8('0x1c')]}));}}var _0x48ba32=path[_0x79b8('0x1d')](PATH);var _0x255207=path['basename'](PATH,_0x79b8('0x1e'));var _0x3c4116=_0x4bc41f['split']&&_0x5ddab5[_0x79b8('0x1f')]>0x1;var _0x4f543f=[];if(!fs['existsSync'](path[_0x79b8('0x20')](_0x48ba32,_0x255207))&&_0x3c4116){fs[_0x79b8('0x21')](path[_0x79b8('0x20')](_0x48ba32,_0x255207));}return BPromise[_0x79b8('0x22')](_0x5ddab5,function(_0x9deb6c){_0x4f543f['push'](_0x9deb6c);})[_0x79b8('0x14')](function(){for(var _0x338a7b=0x0;_0x338a7b<_0x4f543f[_0x79b8('0x1f')];_0x338a7b+=0x1){var _0x3ba5ac;var _0x4bbbf8=_0x4f543f[_0x338a7b];if(_0x3c4116){_0x3ba5ac=path[_0x79b8('0x20')](_0x48ba32,_0x255207,util[_0x79b8('0xf')](_0x79b8('0x23'),_0x255207,_0x338a7b,'csv'));}else{_0x3ba5ac=path[_0x79b8('0x20')](_0x48ba32,util[_0x79b8('0xf')](_0x79b8('0x24'),_0x255207,_0x79b8('0x25')));}fs[_0x79b8('0x26')](_0x3ba5ac,csv(_0x4bbbf8));}})[_0x79b8('0x14')](function(){if(_0x3c4116){zipdir(path['join'](_0x48ba32,_0x255207),{'saveTo':path[_0x79b8('0x20')](_0x48ba32,util['format'](_0x79b8('0x24'),_0x255207,'zip'))},function(_0x3b6a05,_0x1090d2){});rimraf(path[_0x79b8('0x20')](_0x48ba32,_0x255207),function(){});}})['then'](function(){logger[_0x79b8('0xe')](util[_0x79b8('0xf')](_0x79b8('0x27'),EXTRACTED_REPORT_ID,_0x79b8('0x28')));return analyticExtractedReport('Completed',_0x3c4116?util[_0x79b8('0xf')]('%s.%s',_0x255207,_0x3c4116?'zip':_0x79b8('0x25')):null);});})[_0x79b8('0x29')](function(_0x4a038b){logger[_0x79b8('0xe')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x79b8('0x28')),util['inspect'](_0x4a038b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x79b8('0x2a'));})[_0x79b8('0x2b')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xa9e0=['zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','split','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','lodash'];(function(_0x503287,_0x252ead){var _0x3709ef=function(_0x39e5f5){while(--_0x39e5f5){_0x503287['push'](_0x503287['shift']());}};_0x3709ef(++_0x252ead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var util=require(_0x0a9e('0x0'));var path=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x0a9e('0x3'));var rimraf=require('rimraf');var db=require(_0x0a9e('0x4'))['db'];var dbH=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0a9e('0x8')][0x3];var PATH=process[_0x0a9e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2cc193,_0x5f41ea){var _0x503809={'status':_0x2cc193};var _0xe42b77={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5f41ea){_0x503809['savename']=_0x5f41ea;}return db['AnalyticExtractedReport'][_0x0a9e('0x9')](_0x503809,_0xe42b77);}function main(){var _0xf81284=0x1388;var _0x307b3e;logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x0a9e('0xd')]})[_0x0a9e('0xe')](function(_0xd5b662){if(_0xd5b662){_0x307b3e=_0xd5b662;_0xf81284=_0x307b3e[_0x0a9e('0xd')]||0x1388;}})[_0x0a9e('0xe')](function(){return dbH[_0x0a9e('0xf')]['query'](util[_0x0a9e('0xb')](_0x0a9e('0x10'),QUERY),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]});})[_0x0a9e('0xe')](function(_0x52a03d){if(!_0x52a03d[0x0][_0x0a9e('0x13')]){return analyticExtractedReport('Empty');}var _0x1985b6=[];var _0x519dfd=0x0;var _0x16033c=!![];if(_0x52a03d&&_0x52a03d[_0x0a9e('0x14')]){var _0x48f32d=_0x52a03d[0x0][_0x0a9e('0x13')]%(_0x519dfd+_0xf81284);if(_0x307b3e['split']){for(;_0x16033c;_0x519dfd+=_0xf81284,_0x48f32d=_0x52a03d[0x0][_0x0a9e('0x13')]%(_0x519dfd+_0xf81284)){if(_0x48f32d==0x0||_0x48f32d==_0x52a03d[0x0][_0x0a9e('0x13')]){_0x16033c=![];}_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')][_0x0a9e('0x16')](util[_0x0a9e('0xb')](_0x0a9e('0x17'),QUERY,_0xf81284,_0x519dfd),{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')][_0x0a9e('0x12')]}));}}else{_0x1985b6[_0x0a9e('0x15')](dbH[_0x0a9e('0xf')]['query'](QUERY,{'type':dbH[_0x0a9e('0xf')][_0x0a9e('0x11')]['SELECT']}));}}var _0x20f109=path['dirname'](PATH);var _0x588269=path[_0x0a9e('0x18')](PATH,_0x0a9e('0x19'));var _0x38e7c4=_0x307b3e[_0x0a9e('0x1a')]&&_0x1985b6['length']>0x1;var _0xfb6e48=[];if(!fs[_0x0a9e('0x1b')](path[_0x0a9e('0x1c')](_0x20f109,_0x588269))&&_0x38e7c4){fs[_0x0a9e('0x1d')](path[_0x0a9e('0x1c')](_0x20f109,_0x588269));}return BPromise[_0x0a9e('0x1e')](_0x1985b6,function(_0x16b1ca){_0xfb6e48['push'](_0x16b1ca);})['then'](function(){for(var _0x197ec0=0x0;_0x197ec0<_0xfb6e48[_0x0a9e('0x14')];_0x197ec0+=0x1){var _0x40c424;var _0x33161b=_0xfb6e48[_0x197ec0];if(_0x38e7c4){_0x40c424=path['join'](_0x20f109,_0x588269,util[_0x0a9e('0xb')]('%s%d.%s',_0x588269,_0x197ec0,_0x0a9e('0x1f')));}else{_0x40c424=path['join'](_0x20f109,util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x0a9e('0x1f')));}fs[_0x0a9e('0x21')](_0x40c424,csv(_0x33161b));}})[_0x0a9e('0xe')](function(){if(_0x38e7c4){zipdir(path[_0x0a9e('0x1c')](_0x20f109,_0x588269),{'saveTo':path[_0x0a9e('0x1c')](_0x20f109,util[_0x0a9e('0xb')]('%s.%s',_0x588269,_0x0a9e('0x22')))},function(_0x468813,_0x2b1f27){});rimraf(path[_0x0a9e('0x1c')](_0x20f109,_0x588269),function(){});}})['then'](function(){logger[_0x0a9e('0xa')](util[_0x0a9e('0xb')](_0x0a9e('0x23'),EXTRACTED_REPORT_ID,_0x0a9e('0x24')));return analyticExtractedReport(_0x0a9e('0x25'),_0x38e7c4?util[_0x0a9e('0xb')](_0x0a9e('0x20'),_0x588269,_0x38e7c4?_0x0a9e('0x22'):_0x0a9e('0x1f')):null);});})['catch'](function(_0x426950){logger['info'](util[_0x0a9e('0xb')](_0x0a9e('0x26'),EXTRACTED_REPORT_ID,_0x0a9e('0x24')),util[_0x0a9e('0x27')](_0x426950,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0a9e('0x28'));})['finally'](function(){process[_0x0a9e('0x29')](EXIT_CODE);});}main();
\ No newline at end of file
index b6f57c5..7690cbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3080=['argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','toString','value','fill','auto','push','body','concat','chunk','keys','forEach','name','startDate','endDate','format','length','header','pageBreak','before','margin','landscape','footer','right','Empty','dirname','.pdf','join','%s.%s','pdf','Setting','find','split','splitSizePdf','then','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','existsSync','mkdirSync','all','flatten','createPdfKitDocument','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','PDF','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch','util','path','html-to-pdfmake','zip-dir','jsdom','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics'];(function(_0x26eda3,_0x33e524){var _0x2fcf87=function(_0x23b4ec){while(--_0x23b4ec){_0x26eda3['push'](_0x26eda3['shift']());}};_0x2fcf87(++_0x33e524);}(_0x3080,0xf4));var _0x0308=function(_0x586cb9,_0x1bfe64){_0x586cb9=_0x586cb9-0x0;var _0x476ac2=_0x3080[_0x586cb9];return _0x476ac2;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x0308('0x0'));var path=require(_0x0308('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x0308('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x0308('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0x0308('0x4'))[_0x0308('0x5')];var window=new JSDOM('')[_0x0308('0x6')];var db=require(_0x0308('0x7'))['db'];var dbH=require(_0x0308('0x7'))[_0x0308('0x8')];var logger=require(_0x0308('0x9'))(_0x0308('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x0308('0xb')][0x3];var PATH=process[_0x0308('0xb')][0x4];var NAME=process[_0x0308('0xb')][0x5];var FORMAT=_0x0308('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x47e079,_0xb0794b){var _0x554968={'status':_0x47e079};var _0x1b62bb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb0794b){_0x554968[_0x0308('0xd')]=_0xb0794b;}return db[_0x0308('0xe')][_0x0308('0xf')](_0x554968,_0x1b62bb);}function getHeaders(_0x9a8f19){return _[_0x0308('0x10')](_0x9a8f19,function(_0x425530){return{'text':_0x425530,'style':_0x0308('0x11')};});}function getRows(_0x597d14,_0x15b1c9){return _[_0x0308('0x10')](_0x15b1c9,function(_0x149866){return _(_0x149866)['pick'](_0x597d14)[_0x0308('0x10')](function(_0x29fbe4){return _0x29fbe4?_[_0x0308('0x12')](_0x29fbe4):'';})[_0x0308('0x13')]();});}function createTable(_0x4a5227,_0x4eaf6e){var _0x299b2d={'widths':_[_0x0308('0x14')](Array(_0x4a5227['length']),0x91),'heights':function(_0x360612){return _0x360612===0x0?_0x0308('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x193560=getHeaders(_0x4a5227);_0x299b2d['body'][_0x0308('0x16')](_0x193560);var _0x1f1fd5=getRows(_0x4a5227,_0x4eaf6e);_0x299b2d['body']=_0x299b2d[_0x0308('0x17')][_0x0308('0x18')](_0x1f1fd5);return _0x299b2d;}function createTables(_0x55fabb){var _0x1fded4=[];var _0x37f911=_[_0x0308('0x19')](Object[_0x0308('0x1a')](_0x55fabb[0x0]),0x5);_0x37f911[_0x0308('0x1b')](function(_0x2bbc9f){_0x1fded4[_0x0308('0x16')](createTable(_0x2bbc9f,_0x55fabb));});return _0x1fded4;}function getPDFDocDefinition(_0x31f8c9){var _0x5b4da2=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x0308('0x1c')],moment(EXTRACTED_REPORT[_0x0308('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x0308('0x1e')])[_0x0308('0x1f')](FORMAT));var _0x56d8c0=[];for(var _0x24242d=0x0;_0x24242d<_0x31f8c9[_0x0308('0x20')];_0x24242d++){var _0x406743=[];if(_0x24242d===0x0){_0x406743['push']({'text':_0x5b4da2,'style':_0x0308('0x21')});}var _0x112265={'table':_0x31f8c9[_0x24242d]};if(_0x24242d>0x0){_0x112265[_0x0308('0x22')]=_0x0308('0x23');_0x112265[_0x0308('0x24')]=[0x0,0x46,0x0,0x0];}_0x406743[_0x0308('0x16')](_0x112265);_0x56d8c0[_0x0308('0x16')](_0x406743);}return{'pageSize':'A4','pageOrientation':_0x0308('0x25'),'content':_0x56d8c0,'footer':function(_0x53d729,_0x3b45c8){return{'text':_0x53d729['toString']()+'\x20/\x20'+_0x3b45c8,'style':_0x0308('0x26')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x0308('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2cb6fe){var _0x213ce6=0x1388;var _0xb55f1;if(!_0x2cb6fe[0x0]['num']){return analyticExtractedReport(_0x0308('0x28'));}var _0x117a13=[];var _0x2e5532=0x0;var _0x3eb1d2=!![];var _0x1b9b51=path[_0x0308('0x29')](PATH);var _0x4ba4d2=path['basename'](PATH,_0x0308('0x2a'));var _0x42db7b=path[_0x0308('0x2b')](_0x1b9b51,util[_0x0308('0x1f')](_0x0308('0x2c'),_0x4ba4d2,_0x0308('0x2d')));var _0x5be314=![];return db[_0x0308('0x2e')][_0x0308('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0308('0x30'),'splitSizePdf']})['then'](function(_0x34fcd6){if(_0x34fcd6){_0xb55f1=_0x34fcd6;_0x213ce6=_0xb55f1[_0x0308('0x31')]||0x3e8;}})[_0x0308('0x32')](function(){if(_0x2cb6fe&&_0x2cb6fe['length']){var _0xa0de16=_0x2cb6fe[0x0]['num']%(_0x2e5532+_0x213ce6);if(_0xb55f1[_0x0308('0x30')]){for(;_0x3eb1d2;_0x2e5532+=_0x213ce6,_0xa0de16=_0x2cb6fe[0x0][_0x0308('0x33')]%(_0x2e5532+_0x213ce6)){if(_0xa0de16==0x0||_0xa0de16==_0x2cb6fe[0x0][_0x0308('0x33')]){_0x3eb1d2=![];}_0x117a13['push'](dbH['sequelize'][_0x0308('0x34')](util[_0x0308('0x1f')](_0x0308('0x35'),QUERY,_0x213ce6,_0x2e5532),{'type':dbH[_0x0308('0x36')][_0x0308('0x37')]['SELECT']}));}}else{_0x117a13[_0x0308('0x16')](dbH[_0x0308('0x36')][_0x0308('0x34')](QUERY,{'type':dbH[_0x0308('0x36')]['QueryTypes'][_0x0308('0x38')]}));}}_0x5be314=_0xb55f1[_0x0308('0x30')]&&_0x117a13[_0x0308('0x20')]>0x1;if(!fs[_0x0308('0x39')](path[_0x0308('0x2b')](_0x1b9b51,_0x4ba4d2))&&_0x5be314){fs[_0x0308('0x3a')](path[_0x0308('0x2b')](_0x1b9b51,_0x4ba4d2));}return Promise[_0x0308('0x3b')](_0x117a13);})[_0x0308('0x32')](function(_0x3f513a){return createTables(_[_0x0308('0x3c')](_0x3f513a));})['then'](function(_0x460d33){var _0x6fadbe=getPDFDocDefinition(_0x460d33);var _0x239d69=getPDFPrinter();var _0x31903b=_0x239d69[_0x0308('0x3d')](_0x6fadbe);if(_0x5be314)_0x42db7b=path[_0x0308('0x2b')](_0x1b9b51,_0x4ba4d2,util[_0x0308('0x1f')]('%s%d.%s',_0x4ba4d2,index,_0x0308('0x2d')));return writePDFDocument(_0x31903b,_0x42db7b);})[_0x0308('0x32')](function(){if(!_0x5be314)return;zipdir(path[_0x0308('0x2b')](_0x1b9b51,_0x4ba4d2),{'saveTo':path['join'](_0x1b9b51,util['format'](_0x0308('0x2c'),_0x4ba4d2,_0x0308('0x3e')))},function(_0x3f0225){if(_0x3f0225)throw _0x3f0225;return;});})[_0x0308('0x32')](function(){if(!_0x5be314)return;rimraf(path[_0x0308('0x2b')](_0x1b9b51,_0x4ba4d2),function(){});})[_0x0308('0x32')](function(){logger['info'](util[_0x0308('0x1f')](_0x0308('0x3f'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0308('0x40'),_0x5be314?util[_0x0308('0x1f')]('%s.%s',_0x4ba4d2,_0x5be314?'zip':_0x0308('0x2d')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x0308('0x41')](util['format'](_0x0308('0x42'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x0308('0xe')][_0x0308('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0308('0x32')](function(_0x35e92e){EXTRACTED_REPORT=_0x35e92e;return dbH[_0x0308('0x36')]['query'](util[_0x0308('0x1f')](_0x0308('0x44'),QUERY),{'type':dbH[_0x0308('0x36')]['QueryTypes'][_0x0308('0x38')]});})['then'](extractReport)['catch'](function(_0x2d0671){logger[_0x0308('0x41')](util[_0x0308('0x1f')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0308('0x45')),util['inspect'](_0x2d0671,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0308('0x46'));})[_0x0308('0x47')](function(){process[_0x0308('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x50b492=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x0308('0x49'),'italics':__dirname+_0x0308('0x4a'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x50b492;}function getPDFDocDefinitionFromHTML(_0x23bdb2,_0x5f146a){var _0xae9161=util['format']('%s\x20#%d',_0x5f146a['channel'],_0x5f146a['interactionId']);var _0xf2039=moment()[_0x0308('0x1f')](_0x0308('0x4b'))[_0x0308('0x12')]();var _0x30db2c=htmlToPdfmake(_0x23bdb2,{'window':window,'tableAutoSize':!![]});return{'content':[_0x30db2c],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x0308('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0308('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0308('0x4c')}},'header':function(){return[{'text':_0x0308('0x4d'),'style':'header'}];},'footer':function(_0x2de399,_0xad520c){return[{'text':util[_0x0308('0x1f')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0xae9161,_0x2de399,_0xad520c,_0xf2039),'style':_0x0308('0x26')}];}};}function writePDFDocument(_0xbc42c2,_0x498e1a){return new Promise(function(_0x3c6b2c,_0x5c7a11){var _0x187452=_0xbc42c2[_0x0308('0x4e')](fs[_0x0308('0x4f')](_0x498e1a));_0x187452['on'](_0x0308('0x50'),function(){_0x3c6b2c('finish');});_0x187452['on'](_0x0308('0x51'),function(_0x36e62e){_0x5c7a11(_0x36e62e);});_0xbc42c2[_0x0308('0x52')]();});}exports[_0x0308('0x53')]=function(_0x50ec5c,_0x189fe9){var _0xcf82ec=getPDFPrinter();var _0x2ea756=getPDFDocDefinitionFromHTML(_0x50ec5c,_0x189fe9);var _0x502401=_0xcf82ec[_0x0308('0x3d')](_0x2ea756);return writePDFDocument(_0x502401,_0x189fe9[_0x0308('0x1')])[_0x0308('0x54')](function(_0x2d291c){throw _0x2d291c;});};
\ No newline at end of file
+var _0x4983=['right','num','Empty','basename','.pdf','join','pdf','Setting','find','split','splitSizePdf','then','length','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','mkdirSync','flatten','createPdfKitDocument','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','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-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','createPdfFromHTML','util','path','pdfmake/src/printer','rimraf','jsdom','JSDOM','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','value','fill','body','concat','chunk','keys','format','name','startDate','header','pageBreak','before','push','landscape','toString','\x20/\x20','Arial','black'];(function(_0x4381e3,_0x4329ed){var _0x6b9edf=function(_0x562a39){while(--_0x562a39){_0x4381e3['push'](_0x4381e3['shift']());}};_0x6b9edf(++_0x4329ed);}(_0x4983,0x179));var _0x3498=function(_0x34d321,_0x44dc68){_0x34d321=_0x34d321-0x0;var _0x4def8f=_0x4983[_0x34d321];return _0x4def8f;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x3498('0x0'));var path=require(_0x3498('0x1'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x3498('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x3498('0x3'));var JSDOM=require(_0x3498('0x4'))[_0x3498('0x5')];var window=new JSDOM('')['window'];var db=require(_0x3498('0x6'))['db'];var dbH=require(_0x3498('0x6'))[_0x3498('0x7')];var logger=require('../../config/logger')(_0x3498('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3498('0x9')][0x3];var PATH=process[_0x3498('0x9')][0x4];var NAME=process[_0x3498('0x9')][0x5];var FORMAT=_0x3498('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2556b8,_0x1be185){var _0x588ab1={'status':_0x2556b8};var _0x21dd09={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1be185){_0x588ab1[_0x3498('0xb')]=_0x1be185;}return db['AnalyticExtractedReport'][_0x3498('0xc')](_0x588ab1,_0x21dd09);}function getHeaders(_0x2339e5){return _[_0x3498('0xd')](_0x2339e5,function(_0x47ecec){return{'text':_0x47ecec,'style':_0x3498('0xe')};});}function getRows(_0x5c57d8,_0x1a405b){return _['map'](_0x1a405b,function(_0x4c0f40){return _(_0x4c0f40)['pick'](_0x5c57d8)[_0x3498('0xd')](function(_0x3258ac){return _0x3258ac?_['toString'](_0x3258ac):'';})[_0x3498('0xf')]();});}function createTable(_0x4f0390,_0x4ae8fe){var _0x1fe3b8={'widths':_[_0x3498('0x10')](Array(_0x4f0390['length']),0x91),'heights':function(_0x23bf29){return _0x23bf29===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1fa702=getHeaders(_0x4f0390);_0x1fe3b8[_0x3498('0x11')]['push'](_0x1fa702);var _0x20cc1e=getRows(_0x4f0390,_0x4ae8fe);_0x1fe3b8[_0x3498('0x11')]=_0x1fe3b8[_0x3498('0x11')][_0x3498('0x12')](_0x20cc1e);return _0x1fe3b8;}function createTables(_0x2c8195){var _0x54fdd9=[];var _0x38e980=_[_0x3498('0x13')](Object[_0x3498('0x14')](_0x2c8195[0x0]),0x5);_0x38e980['forEach'](function(_0x10a503){_0x54fdd9['push'](createTable(_0x10a503,_0x2c8195));});return _0x54fdd9;}function getPDFDocDefinition(_0x5d166d){var _0x24e108=util[_0x3498('0x15')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x3498('0x16')],moment(EXTRACTED_REPORT[_0x3498('0x17')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x3498('0x15')](FORMAT));var _0x29a89e=[];for(var _0x387758=0x0;_0x387758<_0x5d166d['length'];_0x387758++){var _0x526431=[];if(_0x387758===0x0){_0x526431['push']({'text':_0x24e108,'style':_0x3498('0x18')});}var _0x59c150={'table':_0x5d166d[_0x387758]};if(_0x387758>0x0){_0x59c150[_0x3498('0x19')]=_0x3498('0x1a');_0x59c150['margin']=[0x0,0x46,0x0,0x0];}_0x526431[_0x3498('0x1b')](_0x59c150);_0x29a89e[_0x3498('0x1b')](_0x526431);}return{'pageSize':'A4','pageOrientation':_0x3498('0x1c'),'content':_0x29a89e,'footer':function(_0x35d11e,_0x46cdb0){return{'text':_0x35d11e[_0x3498('0x1d')]()+_0x3498('0x1e')+_0x46cdb0,'style':'footer'};},'defaultStyle':{'font':_0x3498('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3498('0x20')},'footer':{'alignment':_0x3498('0x21'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2c6556){var _0x39c873=0x1388;var _0x341681;if(!_0x2c6556[0x0][_0x3498('0x22')]){return analyticExtractedReport(_0x3498('0x23'));}var _0x16c9bd=[];var _0x23ea8a=0x0;var _0x42e349=!![];var _0x2d19c1=path['dirname'](PATH);var _0x2febe7=path[_0x3498('0x24')](PATH,_0x3498('0x25'));var _0x54766a=path[_0x3498('0x26')](_0x2d19c1,util[_0x3498('0x15')]('%s.%s',_0x2febe7,_0x3498('0x27')));var _0x37a9b9=![];return db[_0x3498('0x28')][_0x3498('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3498('0x2a'),_0x3498('0x2b')]})[_0x3498('0x2c')](function(_0x3f829c){if(_0x3f829c){_0x341681=_0x3f829c;_0x39c873=_0x341681[_0x3498('0x2b')]||0x3e8;}})[_0x3498('0x2c')](function(){if(_0x2c6556&&_0x2c6556[_0x3498('0x2d')]){var _0xd2eecf=_0x2c6556[0x0][_0x3498('0x22')]%(_0x23ea8a+_0x39c873);if(_0x341681[_0x3498('0x2a')]){for(;_0x42e349;_0x23ea8a+=_0x39c873,_0xd2eecf=_0x2c6556[0x0][_0x3498('0x22')]%(_0x23ea8a+_0x39c873)){if(_0xd2eecf==0x0||_0xd2eecf==_0x2c6556[0x0][_0x3498('0x22')]){_0x42e349=![];}_0x16c9bd[_0x3498('0x1b')](dbH[_0x3498('0x2e')]['query'](util[_0x3498('0x15')](_0x3498('0x2f'),QUERY,_0x39c873,_0x23ea8a),{'type':dbH[_0x3498('0x2e')][_0x3498('0x30')][_0x3498('0x31')]}));}}else{_0x16c9bd['push'](dbH[_0x3498('0x2e')][_0x3498('0x32')](QUERY,{'type':dbH[_0x3498('0x2e')]['QueryTypes'][_0x3498('0x31')]}));}}_0x37a9b9=_0x341681[_0x3498('0x2a')]&&_0x16c9bd[_0x3498('0x2d')]>0x1;if(!fs['existsSync'](path['join'](_0x2d19c1,_0x2febe7))&&_0x37a9b9){fs[_0x3498('0x33')](path[_0x3498('0x26')](_0x2d19c1,_0x2febe7));}return Promise['all'](_0x16c9bd);})[_0x3498('0x2c')](function(_0x439615){return createTables(_[_0x3498('0x34')](_0x439615));})[_0x3498('0x2c')](function(_0x594517){var _0x548a8f=getPDFDocDefinition(_0x594517);var _0x1e7134=getPDFPrinter();var _0x34edd4=_0x1e7134[_0x3498('0x35')](_0x548a8f);if(_0x37a9b9)_0x54766a=path[_0x3498('0x26')](_0x2d19c1,_0x2febe7,util['format']('%s%d.%s',_0x2febe7,index,'pdf'));return writePDFDocument(_0x34edd4,_0x54766a);})[_0x3498('0x2c')](function(){if(!_0x37a9b9)return;zipdir(path[_0x3498('0x26')](_0x2d19c1,_0x2febe7),{'saveTo':path['join'](_0x2d19c1,util[_0x3498('0x15')](_0x3498('0x36'),_0x2febe7,_0x3498('0x37')))},function(_0x3b1aee){if(_0x3b1aee)throw _0x3b1aee;return;});})['then'](function(){if(!_0x37a9b9)return;rimraf(path[_0x3498('0x26')](_0x2d19c1,_0x2febe7),function(){});})[_0x3498('0x2c')](function(){logger[_0x3498('0x38')](util[_0x3498('0x15')](_0x3498('0x39'),EXTRACTED_REPORT_ID,_0x3498('0x3a')));return analyticExtractedReport(_0x3498('0x3b'),_0x37a9b9?util[_0x3498('0x15')](_0x3498('0x36'),_0x2febe7,_0x37a9b9?_0x3498('0x37'):_0x3498('0x27')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3498('0x38')](util['format'](_0x3498('0x3c'),EXTRACTED_REPORT_ID,_0x3498('0x3d')));return db[_0x3498('0x3e')][_0x3498('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x50b018){EXTRACTED_REPORT=_0x50b018;return dbH['sequelize'][_0x3498('0x32')](util[_0x3498('0x15')](_0x3498('0x40'),QUERY),{'type':dbH[_0x3498('0x2e')]['QueryTypes'][_0x3498('0x31')]});})[_0x3498('0x2c')](extractReport)[_0x3498('0x41')](function(_0x579c0a){logger[_0x3498('0x38')](util[_0x3498('0x15')](_0x3498('0x42'),EXTRACTED_REPORT_ID,_0x3498('0x3d')),util['inspect'](_0x579c0a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3498('0x43'));})['finally'](function(){process[_0x3498('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x524fe6=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x3498('0x45'),'italics':__dirname+_0x3498('0x46'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x524fe6;}function getPDFDocDefinitionFromHTML(_0x3d65b7,_0x2e532c){var _0x270e12=util[_0x3498('0x15')](_0x3498('0x47'),_0x2e532c['channel'],_0x2e532c[_0x3498('0x48')]);var _0x18d73d=moment()['format'](_0x3498('0x49'))[_0x3498('0x1d')]();var _0x1ecee4=htmlToPdfmake(_0x3d65b7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1ecee4],'defaultStyle':{'font':_0x3498('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3498('0x4a'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3498('0x4a'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3498('0x4a')}},'header':function(){return[{'text':_0x3498('0x4b'),'style':_0x3498('0x18')}];},'footer':function(_0x16da07,_0x5b3715){return[{'text':util[_0x3498('0x15')](_0x3498('0x4c'),_0x270e12,_0x16da07,_0x5b3715,_0x18d73d),'style':_0x3498('0x4d')}];}};}function writePDFDocument(_0x42b5c9,_0x5bb731){return new Promise(function(_0x1b0132,_0x5c709b){var _0x4989d6=_0x42b5c9[_0x3498('0x4e')](fs[_0x3498('0x4f')](_0x5bb731));_0x4989d6['on'](_0x3498('0x50'),function(){_0x1b0132(_0x3498('0x50'));});_0x4989d6['on']('error',function(_0x542f4b){_0x5c709b(_0x542f4b);});_0x42b5c9['end']();});}exports[_0x3498('0x51')]=function(_0x35d868,_0x4f9642){var _0x18197e=getPDFPrinter();var _0x3998dc=getPDFDocDefinitionFromHTML(_0x35d868,_0x4f9642);var _0x49f919=_0x18197e[_0x3498('0x35')](_0x3998dc);return writePDFDocument(_0x49f919,_0x4f9642['path'])[_0x3498('0x41')](function(_0x411537){throw _0x411537;});};
\ No newline at end of file
index a02334e..20967cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c5e=['SELECT','dirname','.xlsx','existsSync','join','mkdirSync','xlsx','%s.%s','Completed','catch','Failed','finally','util','path','lodash','json2xls','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','split','length','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push'];(function(_0x158a3a,_0x35c0f5){var _0xf8acd2=function(_0xf57a73){while(--_0xf57a73){_0x158a3a['push'](_0x158a3a['shift']());}};_0xf8acd2(++_0x35c0f5);}(_0x4c5e,0x124));var _0xe4c5=function(_0x17db66,_0x5de7db){_0x17db66=_0x17db66-0x0;var _0x3f3ad5=_0x4c5e[_0x17db66];return _0x3f3ad5;};'use strict';var util=require(_0xe4c5('0x0'));var path=require(_0xe4c5('0x1'));var _=require(_0xe4c5('0x2'));var fs=require('fs');var json2xls=require(_0xe4c5('0x3'));var BPromise=require(_0xe4c5('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xe4c5('0x5'))[_0xe4c5('0x6')];var logger=require(_0xe4c5('0x7'))(_0xe4c5('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xe4c5('0x9')][0x3];var PATH=process[_0xe4c5('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x263227,_0x3df4ab){var _0x23776f={'status':_0x263227};var _0x4db6c0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3df4ab){_0x23776f['savename']=_0x3df4ab;}return db[_0xe4c5('0xa')][_0xe4c5('0xb')](_0x23776f,_0x4db6c0);}function main(){var _0x56d60b=0x1388;var _0x40168b;logger[_0xe4c5('0xc')](util[_0xe4c5('0xd')](_0xe4c5('0xe'),EXTRACTED_REPORT_ID,_0xe4c5('0xf')));return db[_0xe4c5('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xe4c5('0x11')]})[_0xe4c5('0x12')](function(_0x3e0d3d){if(_0x3e0d3d){_0x40168b=_0x3e0d3d;_0x56d60b=_0x40168b['splitSizeXlsx']||0x1388;}})[_0xe4c5('0x12')](function(){return dbH[_0xe4c5('0x13')]['query'](util['format'](_0xe4c5('0x14'),QUERY),{'type':dbH['sequelize'][_0xe4c5('0x15')]['SELECT']});})[_0xe4c5('0x12')](function(_0x1ef5d3){if(!_0x1ef5d3[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4d4303=[];var _0x27f917=0x0;var _0x389026=!![];if(_0x40168b[_0xe4c5('0x16')]){if(_0x1ef5d3&&_0x1ef5d3[_0xe4c5('0x17')]){var _0xcb315d=_0x1ef5d3[0x0][_0xe4c5('0x18')]%(_0x27f917+_0x56d60b);for(;_0x389026;_0x27f917+=_0x56d60b,_0xcb315d=_0x1ef5d3[0x0]['num']%(_0x27f917+_0x56d60b)){if(_0xcb315d==0x0||_0xcb315d==_0x1ef5d3[0x0][_0xe4c5('0x18')]){_0x389026=![];}_0x4d4303['push'](dbH[_0xe4c5('0x13')][_0xe4c5('0x19')](util[_0xe4c5('0xd')](_0xe4c5('0x1a'),QUERY,_0x56d60b,_0x27f917),{'type':dbH['sequelize'][_0xe4c5('0x15')]['SELECT']}));}}}else{_0x4d4303[_0xe4c5('0x1b')](dbH[_0xe4c5('0x13')][_0xe4c5('0x19')](QUERY,{'type':dbH[_0xe4c5('0x13')]['QueryTypes'][_0xe4c5('0x1c')]}));}var _0x3f171e=path[_0xe4c5('0x1d')](PATH);var _0x55674a=path['basename'](PATH,_0xe4c5('0x1e'));var _0x2136dc=_0x40168b['split']&&_0x4d4303[_0xe4c5('0x17')]>0x1;var _0x15d7d3=[];if(!fs[_0xe4c5('0x1f')](path[_0xe4c5('0x20')](_0x3f171e,_0x55674a))&&_0x2136dc){fs[_0xe4c5('0x21')](path[_0xe4c5('0x20')](_0x3f171e,_0x55674a));}return BPromise['each'](_0x4d4303,function(_0xaa2980){_0x15d7d3['push'](_0xaa2980);})[_0xe4c5('0x12')](function(){for(var _0xe5ba75=0x0;_0xe5ba75<_0x15d7d3[_0xe4c5('0x17')];_0xe5ba75+=0x1){var _0xfa7a5;var _0x31b213=_0x15d7d3[_0xe5ba75];if(_0x2136dc){_0xfa7a5=path[_0xe4c5('0x20')](_0x3f171e,_0x55674a,util[_0xe4c5('0xd')]('%s%d.%s',_0x55674a,_0xe5ba75,_0xe4c5('0x22')));}else{_0xfa7a5=path['join'](_0x3f171e,util[_0xe4c5('0xd')](_0xe4c5('0x23'),_0x55674a,'xlsx'));}fs['writeFileSync'](_0xfa7a5,json2xls(_0x31b213),'binary');}})[_0xe4c5('0x12')](function(){if(_0x2136dc){zipdir(path['join'](_0x3f171e,_0x55674a),{'saveTo':path[_0xe4c5('0x20')](_0x3f171e,util[_0xe4c5('0xd')](_0xe4c5('0x23'),_0x55674a,'zip'))},function(_0x5039e9,_0x372437){});rimraf(path[_0xe4c5('0x20')](_0x3f171e,_0x55674a),function(){});}})[_0xe4c5('0x12')](function(){logger[_0xe4c5('0xc')](util[_0xe4c5('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe4c5('0xf')));return analyticExtractedReport(_0xe4c5('0x24'),_0x2136dc?util[_0xe4c5('0xd')](_0xe4c5('0x23'),_0x55674a,_0x2136dc?'zip':'xlsx'):null);});})[_0xe4c5('0x25')](function(_0x1b951c){logger['info'](util[_0xe4c5('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x1b951c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe4c5('0x26'));})[_0xe4c5('0x27')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x8b0f=['zip','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','path','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','push','SELECT','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s'];(function(_0x36dcde,_0x1e92cb){var _0x24c3b9=function(_0x44697e){while(--_0x44697e){_0x36dcde['push'](_0x36dcde['shift']());}};_0x24c3b9(++_0x1e92cb);}(_0x8b0f,0xcd));var _0xf8b0=function(_0x9a5fd5,_0x1e2c7a){_0x9a5fd5=_0x9a5fd5-0x0;var _0x2bba88=_0x8b0f[_0x9a5fd5];return _0x2bba88;};'use strict';var util=require('util');var path=require(_0xf8b0('0x0'));var _=require(_0xf8b0('0x1'));var fs=require('fs');var json2xls=require(_0xf8b0('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xf8b0('0x3'));var db=require(_0xf8b0('0x4'))['db'];var dbH=require('../../mysqldb')[_0xf8b0('0x5')];var logger=require(_0xf8b0('0x6'))(_0xf8b0('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf8b0('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x43e60b,_0x490f55){var _0x178b82={'status':_0x43e60b};var _0x574fbe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x490f55){_0x178b82['savename']=_0x490f55;}return db[_0xf8b0('0x9')]['update'](_0x178b82,_0x574fbe);}function main(){var _0x5eee33=0x1388;var _0x1b4a11;logger[_0xf8b0('0xa')](util[_0xf8b0('0xb')](_0xf8b0('0xc'),EXTRACTED_REPORT_ID,_0xf8b0('0xd')));return db[_0xf8b0('0xe')][_0xf8b0('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf8b0('0x10'),_0xf8b0('0x11')]})[_0xf8b0('0x12')](function(_0x540c83){if(_0x540c83){_0x1b4a11=_0x540c83;_0x5eee33=_0x1b4a11[_0xf8b0('0x11')]||0x1388;}})[_0xf8b0('0x12')](function(){return dbH[_0xf8b0('0x13')][_0xf8b0('0x14')](util[_0xf8b0('0xb')](_0xf8b0('0x15'),QUERY),{'type':dbH[_0xf8b0('0x13')][_0xf8b0('0x16')]['SELECT']});})[_0xf8b0('0x12')](function(_0xc26787){if(!_0xc26787[0x0]['num']){return analyticExtractedReport(_0xf8b0('0x17'));}var _0x245065=[];var _0xbb3e33=0x0;var _0x30341e=!![];if(_0x1b4a11[_0xf8b0('0x10')]){if(_0xc26787&&_0xc26787[_0xf8b0('0x18')]){var _0x252435=_0xc26787[0x0]['num']%(_0xbb3e33+_0x5eee33);for(;_0x30341e;_0xbb3e33+=_0x5eee33,_0x252435=_0xc26787[0x0][_0xf8b0('0x19')]%(_0xbb3e33+_0x5eee33)){if(_0x252435==0x0||_0x252435==_0xc26787[0x0][_0xf8b0('0x19')]){_0x30341e=![];}_0x245065['push'](dbH[_0xf8b0('0x13')][_0xf8b0('0x14')](util[_0xf8b0('0xb')](_0xf8b0('0x1a'),QUERY,_0x5eee33,_0xbb3e33),{'type':dbH[_0xf8b0('0x13')][_0xf8b0('0x16')]['SELECT']}));}}}else{_0x245065[_0xf8b0('0x1b')](dbH[_0xf8b0('0x13')][_0xf8b0('0x14')](QUERY,{'type':dbH['sequelize'][_0xf8b0('0x16')][_0xf8b0('0x1c')]}));}var _0x5b274f=path[_0xf8b0('0x1d')](PATH);var _0x5ae90f=path[_0xf8b0('0x1e')](PATH,_0xf8b0('0x1f'));var _0x1c5a35=_0x1b4a11[_0xf8b0('0x10')]&&_0x245065[_0xf8b0('0x18')]>0x1;var _0xb3e304=[];if(!fs[_0xf8b0('0x20')](path['join'](_0x5b274f,_0x5ae90f))&&_0x1c5a35){fs['mkdirSync'](path[_0xf8b0('0x21')](_0x5b274f,_0x5ae90f));}return BPromise[_0xf8b0('0x22')](_0x245065,function(_0x5a3046){_0xb3e304['push'](_0x5a3046);})[_0xf8b0('0x12')](function(){for(var _0x183543=0x0;_0x183543<_0xb3e304[_0xf8b0('0x18')];_0x183543+=0x1){var _0x303423;var _0x47fb4f=_0xb3e304[_0x183543];if(_0x1c5a35){_0x303423=path['join'](_0x5b274f,_0x5ae90f,util['format'](_0xf8b0('0x23'),_0x5ae90f,_0x183543,_0xf8b0('0x24')));}else{_0x303423=path[_0xf8b0('0x21')](_0x5b274f,util[_0xf8b0('0xb')]('%s.%s',_0x5ae90f,_0xf8b0('0x24')));}fs[_0xf8b0('0x25')](_0x303423,json2xls(_0x47fb4f),_0xf8b0('0x26'));}})[_0xf8b0('0x12')](function(){if(_0x1c5a35){zipdir(path[_0xf8b0('0x21')](_0x5b274f,_0x5ae90f),{'saveTo':path[_0xf8b0('0x21')](_0x5b274f,util[_0xf8b0('0xb')](_0xf8b0('0x27'),_0x5ae90f,_0xf8b0('0x28')))},function(_0x5951a9,_0x4ff3da){});rimraf(path[_0xf8b0('0x21')](_0x5b274f,_0x5ae90f),function(){});}})['then'](function(){logger['info'](util[_0xf8b0('0xb')](_0xf8b0('0x29'),EXTRACTED_REPORT_ID,_0xf8b0('0xd')));return analyticExtractedReport(_0xf8b0('0x2a'),_0x1c5a35?util['format'](_0xf8b0('0x27'),_0x5ae90f,_0x1c5a35?_0xf8b0('0x28'):_0xf8b0('0x24')):null);});})[_0xf8b0('0x2b')](function(_0x3f77c){logger[_0xf8b0('0xa')](util[_0xf8b0('0xb')](_0xf8b0('0x2c'),EXTRACTED_REPORT_ID,_0xf8b0('0xd')),util[_0xf8b0('0x2d')](_0x3f77c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf8b0('0x2e'));})[_0xf8b0('0x2f')](function(){process[_0xf8b0('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
index 9bc39fb..91a8b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02de=[',${EXTEN},','last','concat','Hangup','destroy','sortBy','lodash','models','findAll','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','queue','playback','hasOwnProperty','extensions','find','push','type','Set','format','context','priority','VoiceExtensionId','extension','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','map','intervals','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice'];(function(_0x1ba9bd,_0x3299e8){var _0x19aae2=function(_0x1ebe8f){while(--_0x1ebe8f){_0x1ba9bd['push'](_0x1ba9bd['shift']());}};_0x19aae2(++_0x3299e8);}(_0x02de,0x1db));var _0xe02d=function(_0x537200,_0x59b9ba){_0x537200=_0x537200-0x0;var _0x3062bd=_0x02de[_0x537200];return _0x3062bd;};'use strict';var _=require(_0xe02d('0x0'));var util=require('util');function rewrite(_0x4fd8db,_0x5c6315){var _0x5823aa=this;return _0x4fd8db[_0xe02d('0x1')]['Interval'][_0xe02d('0x2')]({'raw':!![]})['then'](function(_0x59921){_0x5823aa['intervals']=_0x59921;return _0x4fd8db[_0xe02d('0x1')][_0xe02d('0x3')][_0xe02d('0x2')]({'where':{'IntervalId':_0x5c6315[_0xe02d('0x4')]},'raw':!![]});})['then'](function(_0xad6238){return _0x4fd8db[_0xe02d('0x1')]['VoiceExtension'][_0xe02d('0x2')]({'where':{'exten':{'$in':_[_0xe02d('0x5')](_['map'](_0xad6238,_0xe02d('0x6')))}},'order':[{'raw':_0xe02d('0x7')}],'raw':!![]});})[_0xe02d('0x8')](function(_0x2b6b2d){var _0x45c48f=_[_0xe02d('0x9')](_0x2b6b2d,{'priority':'1'});var _0xde6323=_[_0xe02d('0x9')](_0x2b6b2d,{'isApp':0x1});var _0x1477da=_['groupBy'](_0xde6323,_0xe02d('0x6'));var _0x2b12d2=[_0xe02d('0xa'),_0xe02d('0xb')];var _0x55b559=[];var _0x5d0ad7=[];for(var _0x41995f in _0x1477da){if(_0x1477da[_0xe02d('0xc')](_0x41995f)){_0x5823aa['priority']=0x2;_0x5823aa[_0xe02d('0xd')]=[];_0x5823aa['extension']=_[_0xe02d('0xe')](_0x45c48f,{'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')]});_0x5823aa[_0xe02d('0xd')][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':util[_0xe02d('0x12')]('CDR(type)=%s',_0x1477da[_0x41995f][0x0][_0xe02d('0x10')]),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});if(_0x1477da[_0x41995f][0x0][_0xe02d('0x10')]==='outbound'){if(_0x5823aa[_0xe02d('0x16')]){_0x5823aa['extensions'][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x17')+(_0x5823aa[_0xe02d('0x16')][_0xe02d('0x18')]?'${EXTEN:'+_0x5823aa[_0xe02d('0x16')]['cutdigits']+'}':_0xe02d('0x19')),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0]['exten'],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});}_0x5823aa[_0xe02d('0xd')]['push']({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x1a')+_0x1477da[_0x41995f][0x0][_0xe02d('0x15')],'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});var _0x205b40=_0x5823aa['priority']++;_0x5823aa['extensions'][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x1b'),'appdata':_0xe02d('0x1c')+(_0x205b40+0x2)+_0xe02d('0x1d')+(_0x205b40+0x1)+')','context':_0x1477da[_0x41995f][0x0]['context'],'exten':_0x1477da[_0x41995f][0x0]['exten'],'priority':_0x205b40,'VoiceExtensionId':_0x1477da[_0x41995f][0x0]['VoiceExtensionId']});if(_0x5823aa[_0xe02d('0x16')]){_0x5823aa[_0xe02d('0xd')][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0x5823aa['extension'][_0xe02d('0x18')]?_0xe02d('0x1e')+_0x5823aa[_0xe02d('0x16')][_0xe02d('0x18')]+'}':_0xe02d('0x1f'),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});}_0x5823aa['extensions'][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x20')+_0x1477da[_0x41995f][0x0]['VoiceExtensionId'],'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});if(_0x5823aa[_0xe02d('0x16')]&&_0x5823aa[_0xe02d('0x16')][_0xe02d('0xc')](_0xe02d('0x21'))&&_0x5823aa[_0xe02d('0x16')][_0xe02d('0x21')]!==_0xe02d('0x22')){_0x5823aa[_0xe02d('0xd')]['push']({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x23'),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0]['exten'],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0]['VoiceExtensionId']});_0x5823aa['extensions'][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x24')+_0x5823aa[_0xe02d('0x16')][_0xe02d('0x21')]||_0xe02d('0x25'),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0]['exten'],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});}}_0x5823aa[_0xe02d('0xd')][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x26'),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});_0x5823aa[_0xe02d('0xd')][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x27'),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0]['exten'],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});_0x5823aa[_0xe02d('0xd')][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':'Set','appdata':_0xe02d('0x28'),'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'priority':_0x5823aa[_0xe02d('0x14')]++,'VoiceExtensionId':_0x1477da[_0x41995f][0x0]['VoiceExtensionId']});for(var _0x487242=0x0,_0x25c7b9=0x0;_0x487242<_0x1477da[_0x41995f][_0xe02d('0x29')];_0x487242+=0x1,_0x25c7b9=0x0){var _0x1dfa3d=_0x1477da[_0x41995f][_0x487242];if(_0x1dfa3d[_0xe02d('0x10')]){_0x1dfa3d['type']=_0x1dfa3d['type'][_0xe02d('0x2a')]();}var _0x1d14b1=[];var _0x1c6f7f=[];delete _0x1dfa3d['id'];delete _0x1dfa3d[_0xe02d('0x2b')];delete _0x1dfa3d[_0xe02d('0x2c')];var _0x3ae08d=_0x1dfa3d[_0xe02d('0x2d')]!=='*,*,*,*'?[_0x1dfa3d[_0xe02d('0x2d')]]:_0x1dfa3d[_0xe02d('0x4')]?_[_0xe02d('0x2e')](_['filter'](_0x5823aa[_0xe02d('0x2f')],{'IntervalId':_0x1dfa3d[_0xe02d('0x4')]}),_0xe02d('0x2d')):[];if(_0x1dfa3d[_0xe02d('0xc')](_0xe02d('0x30'))){if(_0x1dfa3d['tag']&&_0x1dfa3d[_0xe02d('0x30')]!=='--'){_0x1d14b1[_0xe02d('0xf')]({'type':_0x1dfa3d[_0xe02d('0x10')],'app':'Set','appdata':_0xe02d('0x31')+_0x1dfa3d[_0xe02d('0x30')],'context':_0x1dfa3d[_0xe02d('0x13')],'exten':_0x1dfa3d[_0xe02d('0x6')],'priority':_0x3ae08d[_0xe02d('0x29')]+_0x5823aa[_0xe02d('0x14')]+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d['VoiceExtensionId']});}}if(_0x1dfa3d[_0xe02d('0x10')]===_0xe02d('0x32')&&_0x1dfa3d[_0xe02d('0xc')](_0xe02d('0x33'))){if(_0x1dfa3d[_0xe02d('0x33')]){_0x1d14b1[_0xe02d('0xf')]({'type':_0x1dfa3d['type'],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1dfa3d['callerID']+')','context':_0x1dfa3d[_0xe02d('0x13')],'exten':_0x1dfa3d[_0xe02d('0x6')],'priority':_0x3ae08d[_0xe02d('0x29')]+_0x5823aa[_0xe02d('0x14')]+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d['VoiceExtensionId']});}else{_0x1d14b1[_0xe02d('0xf')]({'type':_0x1dfa3d['type'],'app':_0xe02d('0x1b'),'appdata':_0xe02d('0x34'),'context':_0x1dfa3d[_0xe02d('0x13')],'exten':_0x1dfa3d['exten'],'priority':_0x3ae08d[_0xe02d('0x29')]+_0x5823aa['priority']+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d[_0xe02d('0x15')]});}}if(_0x1dfa3d['hasOwnProperty'](_0xe02d('0x35'))){if(_0x2b12d2[_0xe02d('0x36')](_0x1dfa3d[_0xe02d('0x37')][_0xe02d('0x2a')]())>=0x0&&_0x1dfa3d[_0xe02d('0x38')]!==_0xe02d('0x39')){if(_0x1dfa3d[_0xe02d('0x35')]){_0x1d14b1[_0xe02d('0xf')]({'type':_0x1dfa3d[_0xe02d('0x10')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1dfa3d[_0xe02d('0x13')],'exten':_0x1dfa3d[_0xe02d('0x6')],'priority':_0x3ae08d['length']+_0x5823aa['priority']+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d[_0xe02d('0x15')]});_0x1d14b1['push']({'type':_0x1dfa3d['type'],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x3a'),'context':_0x1dfa3d['context'],'exten':_0x1dfa3d[_0xe02d('0x6')],'priority':_0x3ae08d[_0xe02d('0x29')]+_0x5823aa[_0xe02d('0x14')]+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d[_0xe02d('0x15')]});}else{_0x1d14b1[_0xe02d('0xf')]({'type':_0x1dfa3d[_0xe02d('0x10')],'app':_0xe02d('0x1b'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1dfa3d[_0xe02d('0x13')],'exten':_0x1dfa3d[_0xe02d('0x6')],'priority':_0x3ae08d[_0xe02d('0x29')]+_0x5823aa['priority']+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d[_0xe02d('0x15')]});_0x1d14b1['push']({'type':_0x1dfa3d[_0xe02d('0x10')],'app':_0xe02d('0x11'),'appdata':_0xe02d('0x3b'),'context':_0x1dfa3d[_0xe02d('0x13')],'exten':_0x1dfa3d[_0xe02d('0x6')],'priority':_0x3ae08d[_0xe02d('0x29')]+_0x5823aa['priority']+_0x25c7b9++,'VoiceExtensionId':_0x1dfa3d['VoiceExtensionId']});}}}for(var _0x4fbcd7=0x0;_0x4fbcd7<_0x3ae08d['length'];_0x4fbcd7+=0x1){var _0x10c0c6=_0x5823aa['priority']+_0x3ae08d[_0xe02d('0x29')];var _0x24714f=_0x4fbcd7===_0x3ae08d['length']-0x1?_0x5823aa[_0xe02d('0x14')]+_0x1d14b1[_0xe02d('0x29')]+_0x1c6f7f[_0xe02d('0x29')]+0x2:_0x5823aa['priority']+_0x4fbcd7+0x1;_0x1d14b1[_0xe02d('0x3c')](_0x4fbcd7,0x0,{'type':_0x1dfa3d['type'],'app':'GotoIfTime','appdata':_0x3ae08d[_0x4fbcd7]+'?'+_0x1dfa3d['context']+_0xe02d('0x3d')+_0x10c0c6+':'+_0x1dfa3d[_0xe02d('0x13')]+_0xe02d('0x3d')+_0x24714f,'exten':_0x1dfa3d[_0xe02d('0x6')],'context':_0x1dfa3d[_0xe02d('0x13')],'priority':_0x5823aa['priority']+_0x4fbcd7,'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});}_0x1dfa3d[_0xe02d('0x14')]=_0x1d14b1[_0xe02d('0x29')]?_[_0xe02d('0x3e')](_0x1d14b1)[_0xe02d('0x14')]+0x1:_0x5823aa[_0xe02d('0x14')];_0x5823aa['priority']=(_0x1c6f7f[_0xe02d('0x29')]?_[_0xe02d('0x3e')](_0x1c6f7f)['priority']:_0x1dfa3d[_0xe02d('0x14')])+0x1;_0x5823aa[_0xe02d('0xd')]=_[_0xe02d('0x3f')](_0x5823aa[_0xe02d('0xd')],_0x1d14b1,[_0x1dfa3d],_0x1c6f7f);}_0x5823aa['extensions'][_0xe02d('0xf')]({'type':_0x1477da[_0x41995f][0x0][_0xe02d('0x10')],'app':_0xe02d('0x40'),'exten':_0x1477da[_0x41995f][0x0][_0xe02d('0x6')],'context':_0x1477da[_0x41995f][0x0][_0xe02d('0x13')],'priority':_0x5823aa['priority'],'VoiceExtensionId':_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]});_0x55b559[_0xe02d('0xf')](_0x1477da[_0x41995f][0x0][_0xe02d('0x15')]);_0x5d0ad7=_['concat'](_0x5d0ad7,_0x5823aa['extensions']);}}return _0x4fd8db['transaction'](function(_0x3bc2bc){return _0x4fd8db[_0xe02d('0x1')]['VoiceExtension'][_0xe02d('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x55b559}},'transaction':_0x3bc2bc})[_0xe02d('0x8')](function(_0x5578b4){return _0x4fd8db[_0xe02d('0x1')][_0xe02d('0x3')]['bulkCreate'](_[_0xe02d('0x42')](_0x5d0ad7,_0xe02d('0x14')),{'transaction':_0x3bc2bc});});});})['catch'](function(_0x1367d8){console['error'](_0x1367d8);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0x2107=['VoiceExtension','filter','groupBy','exten','queue','hasOwnProperty','priority','extensions','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','tag','CDR(tag)=','callerID','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy','sortBy','catch','error','util','models','Interval','findAll','intervals','IntervalId','then'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2107,0x7b));var _0x7210=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x2107[_0xbeb808];return _0x5d6909;};'use strict';var _=require('lodash');var util=require(_0x7210('0x0'));function rewrite(_0x550b4f,_0x2ce526){var _0x142588=this;return _0x550b4f[_0x7210('0x1')][_0x7210('0x2')][_0x7210('0x3')]({'raw':!![]})['then'](function(_0x3fdda7){_0x142588[_0x7210('0x4')]=_0x3fdda7;return _0x550b4f[_0x7210('0x1')]['VoiceExtension'][_0x7210('0x3')]({'where':{'IntervalId':_0x2ce526[_0x7210('0x5')]},'raw':!![]});})[_0x7210('0x6')](function(_0x79589e){return _0x550b4f[_0x7210('0x1')][_0x7210('0x7')][_0x7210('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x79589e,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7210('0x6')](function(_0x166bd4){var _0x1be17a=_[_0x7210('0x8')](_0x166bd4,{'priority':'1'});var _0x3ec2d6=_[_0x7210('0x8')](_0x166bd4,{'isApp':0x1});var _0x31e443=_[_0x7210('0x9')](_0x3ec2d6,_0x7210('0xa'));var _0x2ce0f4=[_0x7210('0xb'),'playback'];var _0x4b0259=[];var _0x1fbcfe=[];for(var _0x1219b3 in _0x31e443){if(_0x31e443[_0x7210('0xc')](_0x1219b3)){_0x142588[_0x7210('0xd')]=0x2;_0x142588[_0x7210('0xe')]=[];_0x142588['extension']=_[_0x7210('0xf')](_0x1be17a,{'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')]});_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':_0x7210('0x11'),'appdata':util[_0x7210('0x12')](_0x7210('0x13'),_0x31e443[_0x1219b3][0x0][_0x7210('0x14')]),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});if(_0x31e443[_0x1219b3][0x0][_0x7210('0x14')]===_0x7210('0x17')){if(_0x142588[_0x7210('0x18')]){_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x19')+(_0x142588['extension'][_0x7210('0x1a')]?_0x7210('0x1b')+_0x142588[_0x7210('0x18')]['cutdigits']+'}':_0x7210('0x1c')),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});}_0x142588['extensions'][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':'CDR(routeid)='+_0x31e443[_0x1219b3][0x0]['VoiceExtensionId'],'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});var _0x100f97=_0x142588[_0x7210('0xd')]++;_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':_0x7210('0x1e')+(_0x100f97+0x2)+'):Goto('+(_0x100f97+0x1)+')','context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x100f97,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});if(_0x142588['extension']){_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x142588[_0x7210('0x18')][_0x7210('0x1a')]?'CDR(prefix)=${EXTEN:0:'+_0x142588[_0x7210('0x18')][_0x7210('0x1a')]+'}':_0x7210('0x1f'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});}_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':_0x7210('0x11'),'appdata':'outboundrouteid='+_0x31e443[_0x1219b3][0x0][_0x7210('0x16')],'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});if(_0x142588[_0x7210('0x18')]&&_0x142588[_0x7210('0x18')][_0x7210('0xc')](_0x7210('0x20'))&&_0x142588['extension'][_0x7210('0x20')]!==_0x7210('0x21')){_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':'Set','appdata':_0x7210('0x22'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x142588[_0x7210('0xe')]['push']({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':_0x7210('0x11'),'appdata':_0x7210('0x23')+_0x142588[_0x7210('0x18')][_0x7210('0x20')]||_0x7210('0x24'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588['priority']++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});}}_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x25'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588['priority']++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x142588[_0x7210('0xe')]['push']({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x31e443[_0x1219b3][0x0]['context'],'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'priority':_0x142588[_0x7210('0xd')]++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x142588[_0x7210('0xe')]['push']({'type':_0x31e443[_0x1219b3][0x0]['type'],'app':'Set','appdata':_0x7210('0x26'),'context':_0x31e443[_0x1219b3][0x0][_0x7210('0x15')],'exten':_0x31e443[_0x1219b3][0x0]['exten'],'priority':_0x142588['priority']++,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});for(var _0x311400=0x0,_0x36d5a2=0x0;_0x311400<_0x31e443[_0x1219b3][_0x7210('0x27')];_0x311400+=0x1,_0x36d5a2=0x0){var _0x558c30=_0x31e443[_0x1219b3][_0x311400];if(_0x558c30['type']){_0x558c30[_0x7210('0x14')]=_0x558c30[_0x7210('0x14')][_0x7210('0x28')]();}var _0x53836e=[];var _0x3bd31d=[];delete _0x558c30['id'];delete _0x558c30[_0x7210('0x29')];delete _0x558c30[_0x7210('0x2a')];var _0x3e6a98=_0x558c30['interval']!==_0x7210('0x2b')?[_0x558c30['interval']]:_0x558c30[_0x7210('0x5')]?_['map'](_[_0x7210('0x8')](_0x142588[_0x7210('0x4')],{'IntervalId':_0x558c30[_0x7210('0x5')]}),'interval'):[];if(_0x558c30['hasOwnProperty'](_0x7210('0x2c'))){if(_0x558c30['tag']&&_0x558c30[_0x7210('0x2c')]!=='--'){_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x2d')+_0x558c30[_0x7210('0x2c')],'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30['exten'],'priority':_0x3e6a98['length']+_0x142588[_0x7210('0xd')]+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}}if(_0x558c30[_0x7210('0x14')]===_0x7210('0x17')&&_0x558c30[_0x7210('0xc')]('callerID')){if(_0x558c30['callerID']){_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x558c30[_0x7210('0x2e')]+')','context':_0x558c30['context'],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}else{_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30['exten'],'priority':_0x3e6a98['length']+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}}if(_0x558c30[_0x7210('0xc')](_0x7210('0x2f'))){if(_0x2ce0f4[_0x7210('0x30')](_0x558c30[_0x7210('0x31')]['toLowerCase']())>=0x0&&_0x558c30['appType']!==_0x7210('0x32')){if(_0x558c30[_0x7210('0x2f')]){_0x53836e['push']({'type':_0x558c30['type'],'app':'ExecIf','appdata':_0x7210('0x33'),'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x34'),'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588[_0x7210('0xd')]+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});}else{_0x53836e['push']({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x1d'),'appdata':_0x7210('0x35'),'context':_0x558c30[_0x7210('0x15')],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98[_0x7210('0x27')]+_0x142588[_0x7210('0xd')]+_0x36d5a2++,'VoiceExtensionId':_0x558c30[_0x7210('0x16')]});_0x53836e[_0x7210('0x10')]({'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x11'),'appdata':_0x7210('0x36'),'context':_0x558c30['context'],'exten':_0x558c30[_0x7210('0xa')],'priority':_0x3e6a98['length']+_0x142588['priority']+_0x36d5a2++,'VoiceExtensionId':_0x558c30['VoiceExtensionId']});}}}for(var _0x2fb998=0x0;_0x2fb998<_0x3e6a98['length'];_0x2fb998+=0x1){var _0x4af69c=_0x142588[_0x7210('0xd')]+_0x3e6a98[_0x7210('0x27')];var _0x5123c1=_0x2fb998===_0x3e6a98['length']-0x1?_0x142588[_0x7210('0xd')]+_0x53836e[_0x7210('0x27')]+_0x3bd31d[_0x7210('0x27')]+0x2:_0x142588[_0x7210('0xd')]+_0x2fb998+0x1;_0x53836e[_0x7210('0x37')](_0x2fb998,0x0,{'type':_0x558c30[_0x7210('0x14')],'app':_0x7210('0x38'),'appdata':_0x3e6a98[_0x2fb998]+'?'+_0x558c30[_0x7210('0x15')]+_0x7210('0x39')+_0x4af69c+':'+_0x558c30['context']+_0x7210('0x39')+_0x5123c1,'exten':_0x558c30[_0x7210('0xa')],'context':_0x558c30[_0x7210('0x15')],'priority':_0x142588[_0x7210('0xd')]+_0x2fb998,'VoiceExtensionId':_0x31e443[_0x1219b3][0x0]['VoiceExtensionId']});}_0x558c30[_0x7210('0xd')]=_0x53836e[_0x7210('0x27')]?_['last'](_0x53836e)['priority']+0x1:_0x142588['priority'];_0x142588['priority']=(_0x3bd31d[_0x7210('0x27')]?_['last'](_0x3bd31d)[_0x7210('0xd')]:_0x558c30[_0x7210('0xd')])+0x1;_0x142588[_0x7210('0xe')]=_[_0x7210('0x3a')](_0x142588['extensions'],_0x53836e,[_0x558c30],_0x3bd31d);}_0x142588[_0x7210('0xe')][_0x7210('0x10')]({'type':_0x31e443[_0x1219b3][0x0][_0x7210('0x14')],'app':_0x7210('0x3b'),'exten':_0x31e443[_0x1219b3][0x0][_0x7210('0xa')],'context':_0x31e443[_0x1219b3][0x0]['context'],'priority':_0x142588[_0x7210('0xd')],'VoiceExtensionId':_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]});_0x4b0259[_0x7210('0x10')](_0x31e443[_0x1219b3][0x0][_0x7210('0x16')]);_0x1fbcfe=_['concat'](_0x1fbcfe,_0x142588['extensions']);}}return _0x550b4f[_0x7210('0x3c')](function(_0x17382c){return _0x550b4f[_0x7210('0x1')][_0x7210('0x7')][_0x7210('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x4b0259}},'transaction':_0x17382c})['then'](function(_0x38e305){return _0x550b4f[_0x7210('0x1')][_0x7210('0x7')]['bulkCreate'](_[_0x7210('0x3e')](_0x1fbcfe,_0x7210('0xd')),{'transaction':_0x17382c});});});})[_0x7210('0x3f')](function(_0x28961e){console[_0x7210('0x40')](_0x28961e);});}exports['rewrite']=rewrite;
\ No newline at end of file
index baab002..d587fa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfce7=['length','find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','phone','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','insert','cm_hopper_black','outbound','dialCheckDuplicateType','Lists','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','CmList','BlackLists','get','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','defaults','redis','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId'];(function(_0x1b12d2,_0xc6988e){var _0x40ae1f=function(_0x5e2267){while(--_0x5e2267){_0x1b12d2['push'](_0x1b12d2['shift']());}};_0x40ae1f(++_0xc6988e);}(_0xfce7,0x195));var _0x7fce=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xfce7[_0x1762b4];return _0x29beda;};'use strict';var BPromise=require(_0x7fce('0x0'));var util=require(_0x7fce('0x1'));var _=require(_0x7fce('0x2'));var fs=require('fs');var squel=require(_0x7fce('0x3'));var Papa=require(_0x7fce('0x4'));var Redis=require(_0x7fce('0x5'));var db=require(_0x7fce('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x7fce('0x7'))(_0x7fce('0x8'));config['redis']=_[_0x7fce('0x9')](config[_0x7fce('0xa')],{'host':_0x7fce('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fce('0xa')]));require(_0x7fce('0xc'))[_0x7fce('0xd')](socket);try{if(!process[_0x7fce('0xe')][0x2]||process['argv'][0x2]===_0x7fce('0xf')||process['argv'][0x2]===_0x7fce('0x10')){throw new Error(_0x7fce('0x11'));}var FILEPATH=process[_0x7fce('0xe')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]==='undefined'||process['argv'][0x3]===_0x7fce('0x10')||!process[_0x7fce('0xe')][0x4]||process['argv'][0x4]===_0x7fce('0xf')||process['argv'][0x4]===_0x7fce('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x7fce('0x12')](process[_0x7fce('0xe')][0x3][_0x7fce('0x13')](','),process[_0x7fce('0xe')][0x4][_0x7fce('0x13')](','));if(!process[_0x7fce('0xe')][0x5]||process[_0x7fce('0xe')][0x5]===_0x7fce('0xf')||process[_0x7fce('0xe')][0x5]===_0x7fce('0x10')){throw new Error(_0x7fce('0x14'));}var LISTID=process[_0x7fce('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x7fce('0xf')&&process[_0x7fce('0xe')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process[_0x7fce('0xe')][0x7]&&process[_0x7fce('0xe')][0x7]!==_0x7fce('0xf')&&process[_0x7fce('0xe')][0x7]!==_0x7fce('0x10')?process[_0x7fce('0xe')][0x7]:null;if(!process[_0x7fce('0xe')][0x8]||process[_0x7fce('0xe')][0x8]==='undefined'||process[_0x7fce('0xe')][0x8]===_0x7fce('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x7fce('0xe')][0x8];}catch(_0x44cbe9){logger[_0x7fce('0x15')](_0x44cbe9);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(_0x515f4d,_0x1209db,_0x3c25b4,_0x452f4a){var _0x1012be={'message':_0x1209db};_0x1012be[_0x515f4d]=!![];if(_0x3c25b4){_0x1012be['contact']=_0x3c25b4;}if(_0x452f4a){_0x1012be[_0x7fce('0x16')]=_0x452f4a;}return _0x1012be;}function isEmail(_0xf37e52){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))*$/[_0x7fce('0x17')](_0xf37e52);}function checkRow(_0x48dcb6,_0x252acd,_0x5a5fcd){return new BPromise(function(_0x58b6c1,_0x3363e4){if(_[_0x7fce('0x18')](_0x48dcb6)){return _0x3363e4(handleCheckRowError(_0x7fce('0x15'),_0x7fce('0x19'),null,_0x5a5fcd));}if(_0x48dcb6[_0x7fce('0x1a')]&&_0x48dcb6['errors']['length']){var _0x10e7ca=_[_0x7fce('0x1b')](_0x48dcb6['errors'],_0x7fce('0x1c'))['join'](';');return _0x3363e4(handleCheckRowError('error',_0x10e7ca,null,_0x5a5fcd));}var _0xd155ea={};for(var _0x37650a in FIELDS){if(FIELDS['hasOwnProperty'](_0x37650a)&&FIELDS[_0x37650a]){_0xd155ea[_0x37650a]=_0x48dcb6[_0x7fce('0x1d')][0x0][FIELDS[_0x37650a]]||_0x48dcb6[_0x7fce('0x1d')][0x0]['\ufeff'+FIELDS[_0x37650a]];}}if(!_0xd155ea[_0x7fce('0x1e')]){return _0x3363e4(handleCheckRowError(_0x7fce('0x15'),_0x7fce('0x1f'),null,_0x5a5fcd));}if(!_0xd155ea['phone']){return _0x3363e4(handleCheckRowError(_0x7fce('0x15'),_0x7fce('0x20'),null,_0x5a5fcd));}if(_0xd155ea['birthDate']){var _0x3206b6=moment(_0xd155ea[_0x7fce('0x21')],_0x7fce('0x22'));if(!_0x3206b6[_0x7fce('0x23')]()){return _0x3363e4(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5a5fcd));}}if(_0xd155ea[_0x7fce('0x24')]){if(!isEmail(_0xd155ea[_0x7fce('0x24')])){return _0x3363e4(handleCheckRowError(_0x7fce('0x15'),_0x7fce('0x25'),null,_0x5a5fcd));}}_0xd155ea[_0x7fce('0x26')]=LISTID;_0xd155ea['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x252acd){var _0xf4deac={};for(var _0xdc8251=0x0,_0x547547=DUPLICATES[_0x7fce('0x27')];_0xdc8251<_0x547547;_0xdc8251+=0x1){_0xf4deac[DUPLICATES[_0xdc8251]]=_0xd155ea[DUPLICATES[_0xdc8251]];}var _0x51e769=_[_0x7fce('0x28')](_0x252acd,_0xf4deac);if(_0x51e769){return _0x3363e4(handleCheckRowError('duplicate',_0x7fce('0x29'),_0x51e769,_0x5a5fcd));}}return db[_0x7fce('0x2a')]['create'](_0xd155ea,{'raw':!![],'hooks':![],'fields':_[_0x7fce('0x2b')](_0xd155ea)})[_0x7fce('0x2c')](function(_0x4aba08){if(DUPLICATES&&DUPLICATES['length']&&_0x252acd){_0x252acd[_0x7fce('0x2d')](_[_0x7fce('0x2e')](_0xd155ea,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4aba08['id'];return _0x58b6c1();})[_0x7fce('0x2f')](function(_0x63bd97){return _0x3363e4(handleCheckRowError(_0x7fce('0x15'),_0x7fce('0x30')+(_0x63bd97['message']||JSON[_0x7fce('0x31')](_0x63bd97)),null,_0x5a5fcd));});});}function checkHopper(){function _0xe46fbf(){return function(_0x22ed7c){logger[_0x7fce('0x15')](_0x7fce('0x32'),_0x7fce('0x33'),util[_0x7fce('0x34')](_0x22ed7c,{'showHidden':![],'depth':null}));};}var _0xfb55fd=function(_0x7a3af6,_0x2df24f){var _0x2f06f6=squel['insert']()[_0x7fce('0x35')]('cm_hopper')[_0x7fce('0x36')](['phone',_0x7fce('0x37'),_0x7fce('0x38'),_0x7fce('0x26'),_0x2df24f,_0x7fce('0x39'),_0x7fce('0x3a')],squel[_0x7fce('0x3b')]()[_0x7fce('0x3c')]('phone',_0x7fce('0x3d'))[_0x7fce('0x3c')]('NOW()','scheduledAt')[_0x7fce('0x3c')]('id',_0x7fce('0x38'))[_0x7fce('0x3c')](LISTID[_0x7fce('0x3e')](),_0x7fce('0x26'))[_0x7fce('0x3c')](_0x7a3af6['id'][_0x7fce('0x3e')](),_0x2df24f)[_0x7fce('0x3c')]('NOW()',_0x7fce('0x39'))[_0x7fce('0x3c')](_0x7fce('0x3f'),_0x7fce('0x3a'))[_0x7fce('0x40')](_0x7fce('0x41'))[_0x7fce('0x42')](_0x7fce('0x43'))[_0x7fce('0x42')](_0x7fce('0x44'),LISTID['toString']())[_0x7fce('0x42')](_0x7fce('0x45'))[_0x7fce('0x42')](_0x7fce('0x46'),squel['select']()['field'](_0x7fce('0x3d'))[_0x7fce('0x40')](_0x7fce('0x47'))[_0x7fce('0x42')](_0x2df24f+_0x7fce('0x48'),_0x7a3af6['id'][_0x7fce('0x3e')]())))[_0x7fce('0x3e')]();return _0x2f06f6;};var _0x43b3e6=function(_0x1338c1,_0x3a647c){var _0x576503=squel['insert']()[_0x7fce('0x35')](_0x7fce('0x47'))[_0x7fce('0x36')]([_0x7fce('0x3d'),_0x7fce('0x37'),'ContactId',_0x7fce('0x26'),_0x3a647c,'createdAt','updatedAt'],squel['select']()['field']('phone','phone')[_0x7fce('0x3c')]('NOW()',_0x7fce('0x37'))[_0x7fce('0x3c')]('id',_0x7fce('0x38'))[_0x7fce('0x3c')](LISTID[_0x7fce('0x3e')](),_0x7fce('0x26'))[_0x7fce('0x3c')](_0x1338c1['id'][_0x7fce('0x3e')](),_0x3a647c)['field'](_0x7fce('0x3f'),'createdAt')[_0x7fce('0x3c')](_0x7fce('0x3f'),_0x7fce('0x3a'))['from'](_0x7fce('0x41'))[_0x7fce('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x7fce('0x44'),LISTID['toString']())[_0x7fce('0x42')](_0x7fce('0x49'),squel[_0x7fce('0x4a')](hopperContacts))[_0x7fce('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x7fce('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7fce('0x3c')](_0x7fce('0x4b'))[_0x7fce('0x40')](_0x7fce('0x4c'))[_0x7fce('0x42')](_0x3a647c+_0x7fce('0x48'),_0x1338c1['id'][_0x7fce('0x3e')]()))[_0x7fce('0x42')](_0x7fce('0x46'),squel[_0x7fce('0x3b')]()[_0x7fce('0x3c')](_0x7fce('0x3d'))[_0x7fce('0x40')]('cm_hopper')['where'](_0x3a647c+_0x7fce('0x48'),_0x1338c1['id'][_0x7fce('0x3e')]())))[_0x7fce('0x3e')]();return _0x576503;};function _0x3e167a(_0x38581d,_0xec10f7){var _0x51e756=squel[_0x7fce('0x4d')]()[_0x7fce('0x35')](_0x7fce('0x47'))['fromQuery']([_0x7fce('0x3d'),_0x7fce('0x37'),'ContactId',_0x7fce('0x26'),_0xec10f7,'createdAt',_0x7fce('0x3a')],squel[_0x7fce('0x3b')]()[_0x7fce('0x3c')](_0x7fce('0x3d'),'phone')[_0x7fce('0x3c')]('NOW()',_0x7fce('0x37'))[_0x7fce('0x3c')]('id','ContactId')['field'](LISTID[_0x7fce('0x3e')](),_0x7fce('0x26'))[_0x7fce('0x3c')](_0x38581d['id'][_0x7fce('0x3e')](),_0xec10f7)[_0x7fce('0x3c')](_0x7fce('0x3f'),_0x7fce('0x39'))['field'](_0x7fce('0x3f'),'updatedAt')[_0x7fce('0x40')](_0x7fce('0x41'))[_0x7fce('0x42')](_0x7fce('0x43'))[_0x7fce('0x42')]('ListId\x20=\x20?',LISTID[_0x7fce('0x3e')]())[_0x7fce('0x42')]('id\x20IN\x20?',squel[_0x7fce('0x4a')](hopperContacts))[_0x7fce('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x7fce('0x3e')]();return _0x51e756;}function _0x2b19d5(_0x470e3e,_0x38ab8f){var _0x57887d=squel['insert']()[_0x7fce('0x35')](_0x7fce('0x4e'))[_0x7fce('0x36')]([_0x7fce('0x3d'),_0x7fce('0x38'),_0x7fce('0x26'),_0x38ab8f,'createdAt',_0x7fce('0x3a')],squel['select']()[_0x7fce('0x3c')]('phone',_0x7fce('0x3d'))[_0x7fce('0x3c')]('id',_0x7fce('0x38'))['field'](LISTID[_0x7fce('0x3e')](),'ListId')[_0x7fce('0x3c')](_0x470e3e['id'][_0x7fce('0x3e')](),_0x38ab8f)['field'](_0x7fce('0x3f'),_0x7fce('0x39'))[_0x7fce('0x3c')](_0x7fce('0x3f'),_0x7fce('0x3a'))[_0x7fce('0x40')]('cm_contacts')[_0x7fce('0x42')](_0x7fce('0x43'))[_0x7fce('0x42')](_0x7fce('0x44'),LISTID[_0x7fce('0x3e')]())['where'](_0x7fce('0x49'),squel[_0x7fce('0x4a')](hopperContacts))[_0x7fce('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x7fce('0x3e')]();return _0x57887d;}return db['VoiceQueue']['findAll']({'where':{'type':_0x7fce('0x4f')},'attributes':['id',_0x7fce('0x50')],'include':[{'model':db['CmList'],'as':_0x7fce('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x137bfb){var _0x49c3c8=[];if(_0x137bfb){var _0x1e3b69;for(var _0x502365=0x0,_0x50ccfd;_0x502365<_0x137bfb[_0x7fce('0x27')];_0x502365+=0x1){_0x50ccfd=_0x137bfb[_0x502365]['get']({'plain':!![]});switch(_0x50ccfd[_0x7fce('0x50')]){case'always':_0x49c3c8[_0x7fce('0x2d')](db[_0x7fce('0x52')][_0x7fce('0x53')](_0x43b3e6(_0x50ccfd,_0x7fce('0x54')))[_0x7fce('0x2c')](function(){})[_0x7fce('0x2f')](_0xe46fbf()));break;case _0x7fce('0x55'):_0x49c3c8[_0x7fce('0x2d')](db['sequelize'][_0x7fce('0x53')](_0xfb55fd(_0x50ccfd,_0x7fce('0x54')))[_0x7fce('0x2c')](function(){})['catch'](_0xe46fbf()));break;default:_0x49c3c8[_0x7fce('0x2d')](db['sequelize'][_0x7fce('0x53')](_0x3e167a(_0x50ccfd,_0x7fce('0x54')))[_0x7fce('0x2c')](function(){})[_0x7fce('0x2f')](_0xe46fbf()));}}}return _0x49c3c8;})[_0x7fce('0x56')]()[_0x7fce('0x2c')](function(){return db['VoiceQueue'][_0x7fce('0x57')]({'where':{'type':_0x7fce('0x4f')},'attributes':['id'],'include':[{'model':db[_0x7fce('0x58')],'as':_0x7fce('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x548994){var _0x296e6a=[];if(_0x548994){var _0x4b0ad4;for(var _0x206746=0x0,_0x2684bb;_0x206746<_0x548994[_0x7fce('0x27')];_0x206746+=0x1){_0x2684bb=_0x548994[_0x206746][_0x7fce('0x5a')]({'plain':!![]});_0x296e6a['push'](db[_0x7fce('0x52')][_0x7fce('0x53')](_0x2b19d5(_0x2684bb,_0x7fce('0x54')))[_0x7fce('0x2c')](function(){})[_0x7fce('0x2f')](_0xe46fbf()));}}return _0x296e6a;})[_0x7fce('0x56')]();})[_0x7fce('0x2c')](function(){return db[_0x7fce('0x5b')][_0x7fce('0x57')]({'attributes':['id',_0x7fce('0x50')],'include':[{'model':db[_0x7fce('0x58')],'as':'Lists','where':{'id':LISTID}}]})[_0x7fce('0x2c')](function(_0xe5dbfe){var _0x4fee78=[];if(_0xe5dbfe){for(var _0x53f690=0x0,_0x96a930;_0x53f690<_0xe5dbfe[_0x7fce('0x27')];_0x53f690+=0x1){_0x96a930=_0xe5dbfe[_0x53f690][_0x7fce('0x5a')]({'plain':!![]});switch(_0x96a930[_0x7fce('0x50')]){case'always':_0x4fee78[_0x7fce('0x2d')](db[_0x7fce('0x52')][_0x7fce('0x53')](_0x43b3e6(_0x96a930,_0x7fce('0x5c')))[_0x7fce('0x2c')](function(){})[_0x7fce('0x2f')](_0xe46fbf()));break;case _0x7fce('0x55'):_0x4fee78['push'](db[_0x7fce('0x52')][_0x7fce('0x53')](_0xfb55fd(_0x96a930,_0x7fce('0x5c')))[_0x7fce('0x2c')](function(){})['catch'](_0xe46fbf()));break;default:_0x4fee78[_0x7fce('0x2d')](db[_0x7fce('0x52')][_0x7fce('0x53')](_0x3e167a(_0x96a930,_0x7fce('0x5c')))['then'](function(){})[_0x7fce('0x2f')](_0xe46fbf()));}}}return _0x4fee78;})[_0x7fce('0x56')]();})[_0x7fce('0x2c')](function(){return db[_0x7fce('0x5b')][_0x7fce('0x57')]({'attributes':['id'],'include':[{'model':db[_0x7fce('0x58')],'as':_0x7fce('0x59'),'where':{'id':LISTID}}]})[_0x7fce('0x2c')](function(_0x2a1f11){var _0x3f0051=[];if(_0x2a1f11){for(var _0xa50aa2=0x0,_0x95edc5;_0xa50aa2<_0x2a1f11[_0x7fce('0x27')];_0xa50aa2+=0x1){_0x95edc5=_0x2a1f11[_0xa50aa2][_0x7fce('0x5a')]({'plain':!![]});_0x3f0051[_0x7fce('0x2d')](db[_0x7fce('0x52')][_0x7fce('0x53')](_0x2b19d5(_0x95edc5,_0x7fce('0x5c')))[_0x7fce('0x2c')](function(){})[_0x7fce('0x2f')](_0xe46fbf()));}}return _0x3f0051;})[_0x7fce('0x56')]();})[_0x7fce('0x2f')](function(_0x1fc0a9){logger[_0x7fce('0x15')](_0x7fce('0x5d'),_0x7fce('0x5e'),_0x1fc0a9[_0x7fce('0x1c')]);});}var processPromises=function(_0x257fe1){return BPromise['all'](promises)[_0x7fce('0x2c')](function(_0x5774b8){})['catch'](function(_0x4d0b60){logger['error'](_0x7fce('0x5f'),JSON['stringify'](_0x4d0b60));})[_0x7fce('0x60')](function(){socket[_0x7fce('0x61')](_0x7fce('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x257fe1){return _0x257fe1[_0x7fce('0x63')]();}});};var endCsv=function(){return BPromise[_0x7fce('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x7fce('0x2c')](function(){socket[_0x7fce('0x61')](_0x7fce('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7fce('0x65')](FILEPATH);}catch(_0x3c29fe){logger['error'](_0x7fce('0x66'),JSON[_0x7fce('0x31')](_0x3c29fe));}finally{process['exit'](0x0);}});};process['on'](_0x7fce('0x67'),function(){logger['info'](_0x7fce('0x68'));endCsv();});function main(){return BPromise[_0x7fce('0x64')]()[_0x7fce('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7fce('0x13')](',');return db[_0x7fce('0x2a')][_0x7fce('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7fce('0x2c')](function(_0x1d147c){var _0x2f05c3=fs[_0x7fce('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7fce('0x6a')](_0x2f05c3,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d6dc8,_0xc95dd1){total+=0x1;var _0x554f63=total;promises[_0x7fce('0x2d')](checkRow(_0x2d6dc8,_0x1d147c,_0x554f63)[_0x7fce('0x2c')](function(){success+=0x1;})[_0x7fce('0x2f')](function(_0x164a52){if(_0x164a52[_0x7fce('0x15')]){errors+=0x1;delete _0x164a52[_0x7fce('0x15')];}else if(_0x164a52['duplicate']){duplicates+=0x1;delete _0x164a52[_0x7fce('0x6b')];}rows['push'](_0x164a52);}));if(total%0xc8===0x0){_0xc95dd1[_0x7fce('0x6c')]();return processPromises(_0xc95dd1);}},'complete':function(){return processPromises()[_0x7fce('0x2c')](function(){logger[_0x7fce('0x6d')](_0x7fce('0x6e'));endCsv();});},'error':function(_0x115b3b,_0x57a6b6){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x115b3b));endCsv();}});})['catch'](function(_0x569738){logger[_0x7fce('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x7fce('0x31')](_0x569738));});}main();
\ No newline at end of file
+var _0xa80a=['dialCheckDuplicateType','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','catch','BlackLists','all','Campaign','CampaignId','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','squel','papaparse','ioredis','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','register','undefined','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','CmContact','keys','then','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','id\x20IN\x20?','str','VoiceQueue','findAll','outbound','CmList','Lists','get'];(function(_0x180fc6,_0x5f3c92){var _0x4dbf08=function(_0x995139){while(--_0x995139){_0x180fc6['push'](_0x180fc6['shift']());}};_0x4dbf08(++_0x5f3c92);}(_0xa80a,0x82));var _0xaa80=function(_0x19cf8b,_0x2edf53){_0x19cf8b=_0x19cf8b-0x0;var _0x14394c=_0xa80a[_0x19cf8b];return _0x14394c;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0xaa80('0x0'));var Papa=require(_0xaa80('0x1'));var Redis=require(_0xaa80('0x2'));var db=require('../../../mysqldb')['db'];var config=require(_0xaa80('0x3'));var logger=require('../../../config/logger')(_0xaa80('0x4'));config[_0xaa80('0x5')]=_[_0xaa80('0x6')](config[_0xaa80('0x5')],{'host':_0xaa80('0x7'),'port':0x18eb});var socket=require(_0xaa80('0x8'))(new Redis(config[_0xaa80('0x5')]));require('../../../api/cmContact/cmContact.socket')[_0xaa80('0x9')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x2]===_0xaa80('0xc')){throw new Error(_0xaa80('0xd'));}var FILEPATH=process[_0xaa80('0xb')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x3]==='null'||!process['argv'][0x4]||process[_0xaa80('0xb')][0x4]===_0xaa80('0xa')||process['argv'][0x4]===_0xaa80('0xc')){throw new Error(_0xaa80('0xe'));}var FIELDS=_[_0xaa80('0xf')](process[_0xaa80('0xb')][0x3]['split'](','),process[_0xaa80('0xb')][0x4][_0xaa80('0x10')](','));if(!process[_0xaa80('0xb')][0x5]||process[_0xaa80('0xb')][0x5]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x5]===_0xaa80('0xc')){throw new Error(_0xaa80('0x11'));}var LISTID=process[_0xaa80('0xb')][0x5];var COMPANYID=process[_0xaa80('0xb')][0x6]&&process[_0xaa80('0xb')][0x6]!=='undefined'&&process[_0xaa80('0xb')][0x6]!==_0xaa80('0xc')?process[_0xaa80('0xb')][0x6]:null;var DUPLICATES=process[_0xaa80('0xb')][0x7]&&process[_0xaa80('0xb')][0x7]!=='undefined'&&process[_0xaa80('0xb')][0x7]!==_0xaa80('0xc')?process[_0xaa80('0xb')][0x7]:null;if(!process[_0xaa80('0xb')][0x8]||process[_0xaa80('0xb')][0x8]===_0xaa80('0xa')||process[_0xaa80('0xb')][0x8]===_0xaa80('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xaa80('0xb')][0x8];}catch(_0xc28241){logger[_0xaa80('0x12')](_0xc28241);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(_0x5beeb5,_0x49b507,_0x567367,_0x4767c0){var _0x5ee3d4={'message':_0x49b507};_0x5ee3d4[_0x5beeb5]=!![];if(_0x567367){_0x5ee3d4[_0xaa80('0x13')]=_0x567367;}if(_0x4767c0){_0x5ee3d4['index']=_0x4767c0;}return _0x5ee3d4;}function isEmail(_0x2733fc){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))*$/[_0xaa80('0x14')](_0x2733fc);}function checkRow(_0xc8b139,_0x179057,_0xf00509){return new BPromise(function(_0x39317d,_0x118311){if(_[_0xaa80('0x15')](_0xc8b139)){return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0xaa80('0x16'),null,_0xf00509));}if(_0xc8b139['errors']&&_0xc8b139[_0xaa80('0x17')][_0xaa80('0x18')]){var _0x1d8a65=_[_0xaa80('0x19')](_0xc8b139[_0xaa80('0x17')],_0xaa80('0x1a'))[_0xaa80('0x1b')](';');return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0x1d8a65,null,_0xf00509));}var _0x4c258a={};for(var _0x1f5a79 in FIELDS){if(FIELDS[_0xaa80('0x1c')](_0x1f5a79)&&FIELDS[_0x1f5a79]){_0x4c258a[_0x1f5a79]=_0xc8b139[_0xaa80('0x1d')][0x0][FIELDS[_0x1f5a79]]||_0xc8b139[_0xaa80('0x1d')][0x0]['\ufeff'+FIELDS[_0x1f5a79]];}}if(!_0x4c258a['firstName']){return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0xaa80('0x1e'),null,_0xf00509));}if(!_0x4c258a['phone']){return _0x118311(handleCheckRowError(_0xaa80('0x12'),_0xaa80('0x1f'),null,_0xf00509));}if(_0x4c258a[_0xaa80('0x20')]){var _0xb078fa=moment(_0x4c258a['birthDate'],_0xaa80('0x21'));if(!_0xb078fa[_0xaa80('0x22')]()){return _0x118311(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0xf00509));}}if(_0x4c258a['email']){if(!isEmail(_0x4c258a['email'])){return _0x118311(handleCheckRowError('error',_0xaa80('0x23'),null,_0xf00509));}}_0x4c258a[_0xaa80('0x24')]=LISTID;_0x4c258a[_0xaa80('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xaa80('0x18')]&&_0x179057){var _0x13d0ff={};for(var _0x429a01=0x0,_0x72dd75=DUPLICATES[_0xaa80('0x18')];_0x429a01<_0x72dd75;_0x429a01+=0x1){_0x13d0ff[DUPLICATES[_0x429a01]]=_0x4c258a[DUPLICATES[_0x429a01]];}var _0x4fa078=_['find'](_0x179057,_0x13d0ff);if(_0x4fa078){return _0x118311(handleCheckRowError(_0xaa80('0x26'),'Duplicate\x20Contact',_0x4fa078,_0xf00509));}}return db[_0xaa80('0x27')]['create'](_0x4c258a,{'raw':!![],'hooks':![],'fields':_[_0xaa80('0x28')](_0x4c258a)})[_0xaa80('0x29')](function(_0x41e624){if(DUPLICATES&&DUPLICATES[_0xaa80('0x18')]&&_0x179057){_0x179057['push'](_['pick'](_0x4c258a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x41e624['id'];return _0x39317d();})['catch'](function(_0x2dbe98){return _0x118311(handleCheckRowError(_0xaa80('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x2dbe98[_0xaa80('0x1a')]||JSON[_0xaa80('0x2a')](_0x2dbe98)),null,_0xf00509));});});}function checkHopper(){function _0x7440f1(){return function(_0x926f7){logger[_0xaa80('0x12')](_0xaa80('0x2b'),_0xaa80('0x2c'),util['inspect'](_0x926f7,{'showHidden':![],'depth':null}));};}var _0x5008df=function(_0x3987a5,_0x592b32){var _0x5a2ad7=squel[_0xaa80('0x2d')]()[_0xaa80('0x2e')](_0xaa80('0x2f'))[_0xaa80('0x30')]([_0xaa80('0x31'),_0xaa80('0x32'),_0xaa80('0x33'),_0xaa80('0x24'),_0x592b32,_0xaa80('0x34'),_0xaa80('0x35')],squel['select']()[_0xaa80('0x36')](_0xaa80('0x31'),_0xaa80('0x31'))[_0xaa80('0x36')]('NOW()','scheduledAt')[_0xaa80('0x36')]('id','ContactId')[_0xaa80('0x36')](LISTID[_0xaa80('0x37')](),_0xaa80('0x24'))[_0xaa80('0x36')](_0x3987a5['id'][_0xaa80('0x37')](),_0x592b32)[_0xaa80('0x36')](_0xaa80('0x38'),'createdAt')[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x35'))[_0xaa80('0x39')](_0xaa80('0x3a'))[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')](_0xaa80('0x3d'),LISTID['toString']())[_0xaa80('0x3b')](_0xaa80('0x3e'))[_0xaa80('0x3b')](_0xaa80('0x3f'),squel[_0xaa80('0x40')]()[_0xaa80('0x36')](_0xaa80('0x31'))[_0xaa80('0x39')](_0xaa80('0x2f'))['where'](_0x592b32+_0xaa80('0x41'),_0x3987a5['id']['toString']())))[_0xaa80('0x37')]();return _0x5a2ad7;};var _0x3bf5d2=function(_0x1d6f1e,_0x279c30){var _0x427f18=squel[_0xaa80('0x2d')]()['into'](_0xaa80('0x2f'))[_0xaa80('0x30')]([_0xaa80('0x31'),'scheduledAt','ContactId',_0xaa80('0x24'),_0x279c30,_0xaa80('0x34'),_0xaa80('0x35')],squel[_0xaa80('0x40')]()[_0xaa80('0x36')](_0xaa80('0x31'),'phone')[_0xaa80('0x36')](_0xaa80('0x38'),'scheduledAt')[_0xaa80('0x36')]('id',_0xaa80('0x33'))[_0xaa80('0x36')](LISTID['toString'](),'ListId')[_0xaa80('0x36')](_0x1d6f1e['id'][_0xaa80('0x37')](),_0x279c30)[_0xaa80('0x36')](_0xaa80('0x38'),'createdAt')['field'](_0xaa80('0x38'),_0xaa80('0x35'))[_0xaa80('0x39')]('cm_contacts')[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')](_0xaa80('0x3d'),LISTID['toString']())['where'](_0xaa80('0x42'),squel[_0xaa80('0x43')](hopperContacts))[_0xaa80('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0xaa80('0x3b')](_0xaa80('0x3f'),squel['select']()[_0xaa80('0x36')]('calleridnum')[_0xaa80('0x39')]('cm_hopper_final')[_0xaa80('0x3b')](_0x279c30+_0xaa80('0x41'),_0x1d6f1e['id']['toString']()))['where'](_0xaa80('0x3f'),squel[_0xaa80('0x40')]()['field'](_0xaa80('0x31'))[_0xaa80('0x39')]('cm_hopper')['where'](_0x279c30+_0xaa80('0x41'),_0x1d6f1e['id'][_0xaa80('0x37')]())))['toString']();return _0x427f18;};function _0x305297(_0x169bfe,_0x3987ab){var _0x315315=squel[_0xaa80('0x2d')]()[_0xaa80('0x2e')](_0xaa80('0x2f'))[_0xaa80('0x30')](['phone',_0xaa80('0x32'),'ContactId',_0xaa80('0x24'),_0x3987ab,_0xaa80('0x34'),_0xaa80('0x35')],squel['select']()[_0xaa80('0x36')](_0xaa80('0x31'),'phone')[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x32'))['field']('id',_0xaa80('0x33'))['field'](LISTID[_0xaa80('0x37')](),_0xaa80('0x24'))['field'](_0x169bfe['id'][_0xaa80('0x37')](),_0x3987ab)[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x34'))['field'](_0xaa80('0x38'),_0xaa80('0x35'))[_0xaa80('0x39')](_0xaa80('0x3a'))[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')](_0xaa80('0x3d'),LISTID[_0xaa80('0x37')]())['where'](_0xaa80('0x42'),squel['str'](hopperContacts))[_0xaa80('0x3b')](_0xaa80('0x3e')))[_0xaa80('0x37')]();return _0x315315;}function _0x550fe2(_0x3650fc,_0x51807a){var _0x59474e=squel[_0xaa80('0x2d')]()['into']('cm_hopper_black')['fromQuery']([_0xaa80('0x31'),'ContactId',_0xaa80('0x24'),_0x51807a,_0xaa80('0x34'),_0xaa80('0x35')],squel[_0xaa80('0x40')]()['field'](_0xaa80('0x31'),'phone')['field']('id',_0xaa80('0x33'))[_0xaa80('0x36')](LISTID[_0xaa80('0x37')](),'ListId')[_0xaa80('0x36')](_0x3650fc['id']['toString'](),_0x51807a)[_0xaa80('0x36')](_0xaa80('0x38'),_0xaa80('0x34'))['field'](_0xaa80('0x38'),_0xaa80('0x35'))['from'](_0xaa80('0x3a'))[_0xaa80('0x3b')](_0xaa80('0x3c'))[_0xaa80('0x3b')]('ListId\x20=\x20?',LISTID[_0xaa80('0x37')]())['where'](_0xaa80('0x42'),squel[_0xaa80('0x43')](hopperContacts))[_0xaa80('0x3b')](_0xaa80('0x3e')))['toString']();return _0x59474e;}return db[_0xaa80('0x44')][_0xaa80('0x45')]({'where':{'type':_0xaa80('0x46')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x48'),'where':{'id':LISTID}}]})[_0xaa80('0x29')](function(_0x32e0d0){var _0x480f2b=[];if(_0x32e0d0){var _0x24e1c5;for(var _0x4fcaa2=0x0,_0x20d899;_0x4fcaa2<_0x32e0d0[_0xaa80('0x18')];_0x4fcaa2+=0x1){_0x20d899=_0x32e0d0[_0x4fcaa2][_0xaa80('0x49')]({'plain':!![]});switch(_0x20d899[_0xaa80('0x4a')]){case _0xaa80('0x4b'):_0x480f2b[_0xaa80('0x4c')](db['sequelize'][_0xaa80('0x4d')](_0x3bf5d2(_0x20d899,_0xaa80('0x4e')))['then'](function(){})['catch'](_0x7440f1()));break;case _0xaa80('0x4f'):_0x480f2b['push'](db[_0xaa80('0x50')][_0xaa80('0x4d')](_0x5008df(_0x20d899,_0xaa80('0x4e')))['then'](function(){})[_0xaa80('0x51')](_0x7440f1()));break;default:_0x480f2b[_0xaa80('0x4c')](db['sequelize'][_0xaa80('0x4d')](_0x305297(_0x20d899,_0xaa80('0x4e')))['then'](function(){})[_0xaa80('0x51')](_0x7440f1()));}}}return _0x480f2b;})['all']()[_0xaa80('0x29')](function(){return db['VoiceQueue'][_0xaa80('0x45')]({'where':{'type':_0xaa80('0x46')},'attributes':['id'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x3b6898){var _0x1678b5=[];if(_0x3b6898){var _0x26ff96;for(var _0x46b3bb=0x0,_0x354de5;_0x46b3bb<_0x3b6898[_0xaa80('0x18')];_0x46b3bb+=0x1){_0x354de5=_0x3b6898[_0x46b3bb][_0xaa80('0x49')]({'plain':!![]});_0x1678b5['push'](db['sequelize']['query'](_0x550fe2(_0x354de5,'VoiceQueueId'))[_0xaa80('0x29')](function(){})[_0xaa80('0x51')](_0x7440f1()));}}return _0x1678b5;})[_0xaa80('0x53')]();})[_0xaa80('0x29')](function(){return db[_0xaa80('0x54')][_0xaa80('0x45')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x48'),'where':{'id':LISTID}}]})[_0xaa80('0x29')](function(_0x3b858b){var _0x18201f=[];if(_0x3b858b){for(var _0x24782a=0x0,_0x37730a;_0x24782a<_0x3b858b[_0xaa80('0x18')];_0x24782a+=0x1){_0x37730a=_0x3b858b[_0x24782a][_0xaa80('0x49')]({'plain':!![]});switch(_0x37730a[_0xaa80('0x4a')]){case _0xaa80('0x4b'):_0x18201f[_0xaa80('0x4c')](db[_0xaa80('0x50')][_0xaa80('0x4d')](_0x3bf5d2(_0x37730a,_0xaa80('0x55')))[_0xaa80('0x29')](function(){})[_0xaa80('0x51')](_0x7440f1()));break;case _0xaa80('0x4f'):_0x18201f[_0xaa80('0x4c')](db['sequelize'][_0xaa80('0x4d')](_0x5008df(_0x37730a,_0xaa80('0x55')))['then'](function(){})[_0xaa80('0x51')](_0x7440f1()));break;default:_0x18201f['push'](db['sequelize']['query'](_0x305297(_0x37730a,_0xaa80('0x55')))[_0xaa80('0x29')](function(){})[_0xaa80('0x51')](_0x7440f1()));}}}return _0x18201f;})[_0xaa80('0x53')]();})[_0xaa80('0x29')](function(){return db[_0xaa80('0x54')][_0xaa80('0x45')]({'attributes':['id'],'include':[{'model':db[_0xaa80('0x47')],'as':_0xaa80('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x245111){var _0xfd4d4e=[];if(_0x245111){for(var _0x195cf6=0x0,_0xfe2561;_0x195cf6<_0x245111[_0xaa80('0x18')];_0x195cf6+=0x1){_0xfe2561=_0x245111[_0x195cf6]['get']({'plain':!![]});_0xfd4d4e[_0xaa80('0x4c')](db[_0xaa80('0x50')]['query'](_0x550fe2(_0xfe2561,_0xaa80('0x55')))[_0xaa80('0x29')](function(){})['catch'](_0x7440f1()));}}return _0xfd4d4e;})['all']();})[_0xaa80('0x51')](function(_0x246c08){logger['error']('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x246c08['message']);});}var processPromises=function(_0x159e78){return BPromise['all'](promises)[_0xaa80('0x29')](function(_0x210513){})[_0xaa80('0x51')](function(_0x3e0598){logger[_0xaa80('0x12')](_0xaa80('0x56'),JSON[_0xaa80('0x2a')](_0x3e0598));})[_0xaa80('0x57')](function(){socket[_0xaa80('0x58')](_0xaa80('0x59')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x159e78){return _0x159e78[_0xaa80('0x5a')]();}});};var endCsv=function(){return BPromise[_0xaa80('0x5b')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xaa80('0x29')](function(){socket[_0xaa80('0x58')](_0xaa80('0x59')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xaa80('0x5c')](FILEPATH);}catch(_0x3f11e3){logger['error'](_0xaa80('0x5d'),JSON[_0xaa80('0x2a')](_0x3f11e3));}finally{process[_0xaa80('0x5e')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xaa80('0x5f'));endCsv();});function main(){return BPromise['resolve']()[_0xaa80('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xaa80('0x10')](',');return db[_0xaa80('0x27')][_0xaa80('0x45')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xaa80('0x29')](function(_0x57e78a){var _0x397e86=fs[_0xaa80('0x60')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xaa80('0x61')](_0x397e86,{'header':!![],'skipEmptyLines':!![],'step':function(_0x43f4e2,_0x5c7727){total+=0x1;var _0x27064c=total;promises['push'](checkRow(_0x43f4e2,_0x57e78a,_0x27064c)[_0xaa80('0x29')](function(){success+=0x1;})[_0xaa80('0x51')](function(_0xdc3b10){if(_0xdc3b10['error']){errors+=0x1;delete _0xdc3b10[_0xaa80('0x12')];}else if(_0xdc3b10[_0xaa80('0x26')]){duplicates+=0x1;delete _0xdc3b10[_0xaa80('0x26')];}rows[_0xaa80('0x4c')](_0xdc3b10);}));if(total%0xc8===0x0){_0x5c7727['pause']();return processPromises(_0x5c7727);}},'complete':function(){return processPromises()[_0xaa80('0x29')](function(){logger['info'](_0xaa80('0x62'));endCsv();});},'error':function(_0x4d195e,_0x27702d){logger[_0xaa80('0x63')](_0xaa80('0x64'),JSON[_0xaa80('0x2a')](_0x4d195e));endCsv();}});})[_0xaa80('0x51')](function(_0xc257dd){logger[_0xaa80('0x12')](_0xaa80('0x65'),JSON[_0xaa80('0x2a')](_0xc257dd));});}main();
\ No newline at end of file
index 156ed8b..b346d87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b0=['\x22always\x22','.CmListId\x20=\x20?','from','cm_hopper_black','ListId\x20=\x20?','toString',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','message','exit','errors','push','sequelize','query','spread','catch','main','stringify','start','binding','root','server/files/tmp','.csv','keys','header','parse','createReadStream','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','rows','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','then','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22'];(function(_0x417a58,_0x103517){var _0x462bd1=function(_0x2e9286){while(--_0x2e9286){_0x417a58['push'](_0x417a58['shift']());}};_0x462bd1(++_0x103517);}(_0x76b0,0x1e9));var _0x076b=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x76b0[_0x2642cb];return _0xe6e41;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x076b('0x0'));var Papa=require('papaparse');var util=require(_0x076b('0x1'));var BPromise=require(_0x076b('0x2'));var moment=require(_0x076b('0x3'));var squel=require(_0x076b('0x4'));var Redis=require(_0x076b('0x5'));var db=require(_0x076b('0x6'))['db'];var config=require(_0x076b('0x7'));var logger=require(_0x076b('0x8'))(_0x076b('0x9'));config[_0x076b('0xa')]=_[_0x076b('0xb')](config[_0x076b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x076b('0xc'))(new Redis(config[_0x076b('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x076b('0xd'));function isEmail(_0x3a6525){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))*$/[_0x076b('0xe')](_0x3a6525);}function selectNotIn(_0x624442,_0x1ff485,_0x4eb2fd,_0x1639a8,_0x18a7dd){return squel[_0x076b('0xf')]()[_0x076b('0x10')](_0x076b('0x11'))['from'](_0x1639a8)[_0x076b('0x12')](_0x1ff485,null,_0x1ff485+'.id\x20=\x20'+_0x1639a8+'.'+_0x4eb2fd)[_0x076b('0x13')](_0x1639a8+'.'+_0x4eb2fd+_0x076b('0x14')+_0x624442+'.'+_0x4eb2fd)[_0x076b('0x13')](_0x1ff485+_0x076b('0x15')+_0x18a7dd[_0x076b('0x12')]()+')');}function insertCmHopper(_0x39d979,_0x282a43,_0x58f45d,_0x4c8f4e,_0x5963e7){var _0x39643f=[_0x076b('0x16'),'cm_contacts.scheduledat',_0x076b('0x17'),_0x076b('0x18'),_0x282a43+'.'+_0x4c8f4e,_0x076b('0x19'),_0x076b('0x1a'),'cm_contacts.priority',_0x076b('0x1b'),'\x22'+_0x5963e7+'\x22'];return squel[_0x076b('0x1c')]()[_0x076b('0x1d')](_0x076b('0x1e'))[_0x076b('0x1f')]([_0x076b('0x11'),_0x076b('0x20'),_0x076b('0x21'),_0x076b('0x22'),_0x4c8f4e,_0x076b('0x23'),_0x076b('0x24'),_0x076b('0x25'),_0x076b('0x26'),'recallme'],squel[_0x076b('0xf')]()[_0x076b('0x27')](_0x39643f)['from'](_0x282a43)[_0x076b('0x12')](_0x076b('0x28'),null,_0x076b('0x29')+_0x282a43+_0x076b('0x2a'))[_0x076b('0x12')](_0x58f45d,null,_0x58f45d+_0x076b('0x2b')+_0x282a43+'.'+_0x4c8f4e)[_0x076b('0x13')](_0x282a43+'.CmListId\x20=\x20?',_0x39d979)[_0x076b('0x13')](_0x076b('0x2c'),NOW)['where'](_0x076b('0x2d'),selectNotIn(_0x282a43,_0x58f45d,_0x4c8f4e,_0x076b('0x1e'),['\x22always\x22',_0x076b('0x2e')]))[_0x076b('0x13')](_0x076b('0x2d'),selectNotIn(_0x282a43,_0x58f45d,_0x4c8f4e,_0x076b('0x1e'),[_0x076b('0x2f')])))['toString']();}function insertCmHopperBlack(_0x397c0c,_0x1031e1,_0x397c0d,_0x510ab0){var _0x50fa8f=[_0x076b('0x16'),_0x076b('0x17'),_0x076b('0x18'),_0x1031e1+'.'+_0x510ab0,_0x076b('0x19'),_0x076b('0x1a')];return squel[_0x076b('0x1c')]()[_0x076b('0x1d')]('cm_hopper_black')[_0x076b('0x1f')]([_0x076b('0x11'),_0x076b('0x21'),'ListId',_0x510ab0,_0x076b('0x23'),'updatedAt'],squel['select']()[_0x076b('0x27')](_0x50fa8f)['from'](_0x1031e1)[_0x076b('0x12')]('cm_contacts',null,_0x076b('0x29')+_0x1031e1+_0x076b('0x2a'))[_0x076b('0x12')](_0x397c0d,null,_0x397c0d+_0x076b('0x2b')+_0x1031e1+'.'+_0x510ab0)[_0x076b('0x13')](_0x1031e1+_0x076b('0x30'),_0x397c0c)[_0x076b('0x13')](_0x076b('0x2c'),NOW)[_0x076b('0x13')](_0x076b('0x2d'),squel['select']()[_0x076b('0x10')](_0x076b('0x11'))[_0x076b('0x31')](_0x076b('0x32'))[_0x076b('0x13')](_0x076b('0x33'),_0x397c0c)[_0x076b('0x13')](_0x510ab0+'\x20=\x20?',_0x1031e1+'.'+_0x510ab0)))[_0x076b('0x34')]();}function insertCmContact(_0x310da8,_0x5d1771,_0x579c22,_0x3935b9){var _0xa699d3=_['concat'](_['keys'](_0x3935b9),[_0x076b('0x22'),'CompanyId',_0x076b('0x23'),_0x076b('0x24')]);return squel[_0x076b('0x1c')]()[_0x076b('0x1d')]('cm_contacts')[_0x076b('0x1f')](_0xa699d3,squel[_0x076b('0xf')]()[_0x076b('0x27')](_0xa699d3)[_0x076b('0x31')](_0x5d1771)[_0x076b('0x13')]('('+_0x579c22[_0x076b('0x12')](',')+_0x076b('0x35'),squel[_0x076b('0xf')]()['fields'](_0x579c22)[_0x076b('0x31')](_0x076b('0x28'))[_0x076b('0x13')](_0x076b('0x33'),_0x310da8)[_0x076b('0x13')](_0x076b('0x36')))[_0x076b('0x13')](_0x076b('0x37'),squel[_0x076b('0xf')]()['field'](_0x076b('0x38'),_0x076b('0x39'))[_0x076b('0x31')](_0x5d1771)['group'](_0x579c22['join'](','))))['toString']();}function handleStop(){logger[_0x076b('0x3a')](_0x076b('0x3b'));stopped=!![];}function handleUncaughtException(_0x23e1a5){logger[_0x076b('0x3c')](_0x23e1a5[_0x076b('0x3d')]);process[_0x076b('0x3e')](0x1);}function handleError(_0x23e0de,_0x27fff8){stats[_0x076b('0x3f')][_0x076b('0x40')]({'name':_0x27fff8['code'],'message':_0x27fff8[_0x076b('0x3d')],'row':_0x23e0de});}function handleQuery(_0x312b1e){logger[_0x076b('0x3a')](_0x312b1e);return db[_0x076b('0x41')][_0x076b('0x42')](_0x312b1e)[_0x076b('0x43')](function(_0x126f87){results['push'](_0x126f87);})[_0x076b('0x44')](function(_0x3a5c09){logger[_0x076b('0x3c')](_0x3a5c09[_0x076b('0x3d')]);});}function main(_0x50a727,_0x12a068,_0x2c0de8,_0x2a45d7){logger['info'](_0x076b('0x45'),_0x50a727,JSON[_0x076b('0x46')](_0x12a068));process['send'](_0x076b('0x47'));var _0x4dbd8b=_0x12a068[_0x076b('0x48')];var _0x51f87b=_0x12a068['socket_timestamp'];var _0x53ac33=path[_0x076b('0x12')](config[_0x076b('0x49')],_0x076b('0x4a'),_0x51f87b+_0x076b('0x4b'));var _0x4ee055=_[_0x076b('0x4c')](_0x4dbd8b)[_0x076b('0x12')]();logger[_0x076b('0x3a')](_0x076b('0x4d'),_0x4ee055);fs['writeFileSync'](_0x53ac33,_0x4ee055+'\x0a');Papa[_0x076b('0x4e')](fs[_0x076b('0x4f')](_0x50a727),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3bca32,_0xf64373){try{for(var _0x2a292e=0x0,_0x1c96dd=[];_0x2a292e<_0x3bca32[_0x076b('0x50')]['length'];_0x2a292e++){stats['rows']+=0x1;if(_0x3bca32[_0x076b('0x3f')][_0x2a292e]){handleError(_0x3bca32[_0x076b('0x50')][_0x2a292e],_0x3bca32['errors'][_0x2a292e]);}else{var _0x215083=[];for(var _0x384784 in _0x4dbd8b){if(_0x4dbd8b[_0x076b('0x51')](_0x384784)){if(_0x3bca32['data'][_0x2a292e][_0x4dbd8b[_0x384784]]){var _0x38f361=_[_0x076b('0x52')](_0x3bca32['data'][_0x2a292e][_0x4dbd8b[_0x384784]][_0x076b('0x53')](/"/g,'\x27'));switch(_0x384784){case _0x076b('0x20'):var _0x4f60d5=moment(_0x38f361,_0x076b('0xd'),!![]);if(_0x4f60d5[_0x076b('0x54')]()){_0x1c96dd['push']('\x22'+_0x38f361+'\x22');}else{_0x215083['push'](_0x076b('0x55'));}break;case _0x076b('0x25'):var _0xcda915=parseInt(_0x38f361);_0x38f361=_[_0x076b('0x56')](_0xcda915)||_0xcda915<0x0||_0xcda915>0x4?_0x2a45d7?0x3:0x2:_0xcda915;_0x1c96dd[_0x076b('0x40')]('\x22'+_0x38f361+'\x22');break;case _0x076b('0x26'):var _0x33d728=parseInt(_0x38f361);if(_[_0x076b('0x57')](_0x33d728)&&_[_0x076b('0x58')](_0x2c0de8,_0x33d728)){_0x1c96dd[_0x076b('0x40')]('\x22'+_0x33d728+'\x22');}else{_0x215083[_0x076b('0x40')](_0x076b('0x59'));}break;case _0x076b('0x5a'):if(isEmail(_0x38f361)){_0x1c96dd[_0x076b('0x40')]('\x22'+_0x38f361+'\x22');}else{_0x215083[_0x076b('0x40')]('email\x20wrong\x20format');}break;case _0x076b('0x5b'):var _0x53637e=moment(_0x38f361,_0x076b('0x5c'),!![]);if(_0x53637e['isValid']()){_0x1c96dd['push']('\x22'+_0x38f361+'\x22');}else{_0x215083[_0x076b('0x40')](_0x076b('0x5d'));}break;default:_0x1c96dd[_0x076b('0x40')]('\x22'+_0x38f361+'\x22');}}else{switch(_0x384784){case _0x076b('0x5e'):case _0x076b('0x11'):_0x215083[_0x076b('0x40')](_0x384784+_0x076b('0x5f'));break;default:_0x1c96dd[_0x076b('0x40')]('\x22\x22');}}}}if(_0x215083[_0x076b('0x60')]){handleError(_0x3bca32[_0x076b('0x50')][_0x2a292e],{'code':_0x076b('0x61'),'message':_0x215083['join']()});}else{fs['appendFileSync'](_0x53ac33,_0x1c96dd[_0x076b('0x12')]()+'\x0a');}_0x1c96dd=[];}if(!(stats[_0x076b('0x62')]%0xc8)){socket[_0x076b('0x63')](_0x076b('0x64')+_0x51f87b,stats);stats['errors']=[];}}if(stopped){logger[_0x076b('0x3a')](_0x076b('0x65'));_0xf64373['abort']();}}catch(_0x48aaf0){handleError(_0x3bca32['data'][_0x2a292e],{'code':'SystemError','message':_0x48aaf0[_0x076b('0x3d')]});logger['error'](_0x076b('0x66'),_0x48aaf0[_0x076b('0x3d')]);}},'complete':function(){try{var _0x4f42d0=[];var _0x2a607e=_0x076b('0x28');if(_0x12a068[_0x076b('0x67')]&&_0x12a068[_0x076b('0x67')][_0x076b('0x60')]){_0x2a607e=_0x076b('0x68')+_0x51f87b;_0x4f42d0[_0x076b('0x40')](_0x076b('0x69')+_0x2a607e+'\x20LIKE\x20cm_contacts;');}var _0x4799d0=util['format'](_0x076b('0x6a'),_0x53ac33,_0x2a607e,_0x4ee055,_0x12a068[_0x076b('0x22')],_0x12a068['CompanyId']||null,NOW,NOW);if(_[_0x076b('0x6b')](_0x4dbd8b[_0x076b('0x20')])){_0x4799d0+=_0x076b('0x6c');}_0x4f42d0[_0x076b('0x40')](_0x4799d0);if(_0x12a068[_0x076b('0x67')]&&_0x12a068['duplicates'][_0x076b('0x60')]){_0x4f42d0[_0x076b('0x40')](insertCmContact(_0x12a068[_0x076b('0x22')],_0x2a607e,_0x12a068[_0x076b('0x67')],_0x4dbd8b));_0x4f42d0[_0x076b('0x40')](_0x076b('0x6d')+_0x2a607e+';');}_0x4f42d0['push'](insertCmHopper(_0x12a068[_0x076b('0x22')],_0x076b('0x6e'),_0x076b('0x6f'),_0x076b('0x70'),_0x2a45d7));_0x4f42d0[_0x076b('0x40')](insertCmHopperBlack(_0x12a068[_0x076b('0x22')],_0x076b('0x71'),'voice_queues',_0x076b('0x70')));_0x4f42d0[_0x076b('0x40')](insertCmHopper(_0x12a068[_0x076b('0x22')],_0x076b('0x72'),_0x076b('0x73'),_0x076b('0x74'),_0x2a45d7));_0x4f42d0[_0x076b('0x40')](insertCmHopperBlack(_0x12a068[_0x076b('0x22')],_0x076b('0x75'),_0x076b('0x73'),_0x076b('0x74')));BPromise['each'](_0x4f42d0,handleQuery)[_0x076b('0x76')](function(_0x3d2888){stats[_0x076b('0x77')]=!![];stats['affectedRows']=_0x12a068[_0x076b('0x67')]&&_0x12a068[_0x076b('0x67')][_0x076b('0x60')]?results[0x2][_0x076b('0x78')]:results[0x0]['affectedRows'];socket[_0x076b('0x63')](_0x076b('0x64')+_0x51f87b,stats);fs[_0x076b('0x79')](_0x50a727);fs[_0x076b('0x79')](_0x53ac33);process[_0x076b('0x3e')](0x0);})['catch'](function(_0x57f642){logger[_0x076b('0x3c')](_0x57f642[_0x076b('0x3d')]);process[_0x076b('0x3e')](0x1);});}catch(_0x4abcf3){logger[_0x076b('0x3c')](_0x076b('0x7a'),_0x4abcf3['message']);process['exit'](0x1);}},'error':function(_0x19f1fb,_0x3823d4,_0x442d7c,_0x2a42f1){throw new Error(_0x2a42f1);}});}function validate(){if(process[_0x076b('0x7b')]&&process[_0x076b('0x7b')]['length']<0x4){throw new Error(_0x076b('0x7c'));}var _0x3c3b4e=path['join'](config[_0x076b('0x49')],_0x076b('0x4a'),process['argv'][0x2]);if(!fs['existsSync'](_0x3c3b4e)){throw new Error(_0x076b('0x7d'));}var _0x213c8d={};try{_0x213c8d=JSON[_0x076b('0x4e')](process[_0x076b('0x7b')][0x3]);if(!_0x213c8d[_0x076b('0x48')]){throw new Error(_0x076b('0x7e'));}if(!_0x213c8d[_0x076b('0x48')]['phone']){throw new Error(_0x076b('0x7f'));}if(!_0x213c8d[_0x076b('0x48')][_0x076b('0x5e')]){throw new Error(_0x076b('0x80'));}var _0x22da5f=0x0;if(_0x213c8d[_0x076b('0x48')][_0x076b('0x26')]){_0x22da5f=0x1;}if(!_0x213c8d[_0x076b('0x22')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x465b3c){throw new Error(_0x076b('0x81'));}var _0x1e31c0=[];try{_0x1e31c0=_[_0x076b('0x82')](JSON[_0x076b('0x4e')](process['argv'][0x4]),'id');}catch(_0x56f7ca){logger['info'](_0x076b('0x83'));}main(_0x3c3b4e,_0x213c8d,_0x1e31c0,_0x22da5f);}validate();process['on'](_0x076b('0x84'),handleStop);process['on'](_0x076b('0x85'),handleUncaughtException);
\ No newline at end of file
+var _0xf34e=['contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','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','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','squel','ioredis','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','.id\x20=\x20','where','\x20=\x20','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','into','cm_hopper_black','ListId','from','cm_contacts.ListId\x20=\x20','.CmListId','field','phone','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','spread','push','catch','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','length','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0xf34e,0x12c));var _0xef34=function(_0x14a7ba,_0x304cc9){_0x14a7ba=_0x14a7ba-0x0;var _0x59c936=_0xf34e[_0x14a7ba];return _0x59c936;};'use strict';var fs=require('fs');var path=require(_0xef34('0x0'));var _=require(_0xef34('0x1'));var Papa=require(_0xef34('0x2'));var util=require('util');var BPromise=require(_0xef34('0x3'));var moment=require('moment');var squel=require(_0xef34('0x4'));var Redis=require(_0xef34('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xef34('0x6'));var logger=require(_0xef34('0x7'))(_0xef34('0x8'));config['redis']=_[_0xef34('0x9')](config[_0xef34('0xa')],{'host':_0xef34('0xb'),'port':0x18eb});var socket=require(_0xef34('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xef34('0xd')](_0xef34('0xe'));function isEmail(_0x8989c6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x8989c6);}function selectNotIn(_0x588dff,_0x43e105,_0x5c94e6,_0x526c75,_0x48c439){return squel[_0xef34('0xf')]()['field']('phone')['from'](_0x526c75)['join'](_0x43e105,null,_0x43e105+_0xef34('0x10')+_0x526c75+'.'+_0x5c94e6)[_0xef34('0x11')](_0x526c75+'.'+_0x5c94e6+_0xef34('0x12')+_0x588dff+'.'+_0x5c94e6)[_0xef34('0x11')](_0x43e105+'.dialCheckDuplicateType\x20IN\x20('+_0x48c439[_0xef34('0x13')]()+')');}function insertCmHopper(_0x5dfe6c,_0x78ef9b,_0xeaad41,_0x150de2,_0x2cfa7d){var _0x233bcf=[_0xef34('0x14'),_0xef34('0x15'),_0xef34('0x16'),'cm_contacts.ListId',_0x78ef9b+'.'+_0x150de2,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xef34('0x17'),_0xef34('0x18'),'\x22'+_0x2cfa7d+'\x22'];return squel[_0xef34('0x19')]()['into'](_0xef34('0x1a'))[_0xef34('0x1b')](['phone',_0xef34('0x1c'),_0xef34('0x1d'),'ListId',_0x150de2,_0xef34('0x1e'),_0xef34('0x1f'),_0xef34('0x20'),_0xef34('0x21'),_0xef34('0x22')],squel['select']()[_0xef34('0x23')](_0x233bcf)['from'](_0x78ef9b)[_0xef34('0x13')](_0xef34('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x78ef9b+'.CmListId')[_0xef34('0x13')](_0xeaad41,null,_0xeaad41+_0xef34('0x10')+_0x78ef9b+'.'+_0x150de2)[_0xef34('0x11')](_0x78ef9b+_0xef34('0x25'),_0x5dfe6c)['where']('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xef34('0x26'),selectNotIn(_0x78ef9b,_0xeaad41,_0x150de2,_0xef34('0x1a'),[_0xef34('0x27'),_0xef34('0x28')]))[_0xef34('0x11')](_0xef34('0x26'),selectNotIn(_0x78ef9b,_0xeaad41,_0x150de2,_0xef34('0x1a'),['\x22always\x22'])))[_0xef34('0x29')]();}function insertCmHopperBlack(_0x1ab6c9,_0x1869ca,_0x5aa4cb,_0x35b970){var _0x16b2dc=[_0xef34('0x14'),_0xef34('0x16'),_0xef34('0x2a'),_0x1869ca+'.'+_0x35b970,_0xef34('0x2b'),_0xef34('0x2c')];return squel[_0xef34('0x19')]()[_0xef34('0x2d')](_0xef34('0x2e'))[_0xef34('0x1b')](['phone',_0xef34('0x1d'),_0xef34('0x2f'),_0x35b970,_0xef34('0x1e'),'updatedAt'],squel[_0xef34('0xf')]()[_0xef34('0x23')](_0x16b2dc)[_0xef34('0x30')](_0x1869ca)[_0xef34('0x13')]('cm_contacts',null,_0xef34('0x31')+_0x1869ca+_0xef34('0x32'))[_0xef34('0x13')](_0x5aa4cb,null,_0x5aa4cb+'.id\x20=\x20'+_0x1869ca+'.'+_0x35b970)[_0xef34('0x11')](_0x1869ca+_0xef34('0x25'),_0x1ab6c9)[_0xef34('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xef34('0x11')](_0xef34('0x26'),squel[_0xef34('0xf')]()[_0xef34('0x33')](_0xef34('0x34'))[_0xef34('0x30')](_0xef34('0x2e'))['where'](_0xef34('0x35'),_0x1ab6c9)[_0xef34('0x11')](_0x35b970+_0xef34('0x36'),_0x1869ca+'.'+_0x35b970)))[_0xef34('0x29')]();}function insertCmContact(_0x1b1da9,_0x118156,_0x5efc44,_0x540e7e){var _0x1a9a6f=_['concat'](_[_0xef34('0x37')](_0x540e7e),[_0xef34('0x2f'),_0xef34('0x38'),_0xef34('0x1e'),'updatedAt']);return squel['insert']()[_0xef34('0x2d')](_0xef34('0x24'))[_0xef34('0x1b')](_0x1a9a6f,squel[_0xef34('0xf')]()['fields'](_0x1a9a6f)['from'](_0x118156)['where']('('+_0x5efc44[_0xef34('0x13')](',')+_0xef34('0x39'),squel['select']()[_0xef34('0x23')](_0x5efc44)[_0xef34('0x30')](_0xef34('0x24'))[_0xef34('0x11')]('ListId\x20=\x20?',_0x1b1da9)[_0xef34('0x11')]('deletedAt\x20IS\x20NULL'))[_0xef34('0x11')](_0xef34('0x3a'),squel[_0xef34('0xf')]()['field'](_0xef34('0x3b'),_0xef34('0x3c'))['from'](_0x118156)[_0xef34('0x3d')](_0x5efc44[_0xef34('0x13')](','))))[_0xef34('0x29')]();}function handleStop(){logger[_0xef34('0x3e')](_0xef34('0x3f'));stopped=!![];}function handleUncaughtException(_0x349035){logger[_0xef34('0x40')](_0x349035[_0xef34('0x41')]);process[_0xef34('0x42')](0x1);}function handleError(_0x494e2b,_0x41d54d){stats[_0xef34('0x43')]['push']({'name':_0x41d54d['code'],'message':_0x41d54d[_0xef34('0x41')],'row':_0x494e2b});}function handleQuery(_0x71eb6f){logger[_0xef34('0x3e')](_0x71eb6f);return db[_0xef34('0x44')][_0xef34('0x45')](_0x71eb6f)[_0xef34('0x46')](function(_0x962431){results[_0xef34('0x47')](_0x962431);})[_0xef34('0x48')](function(_0x445bdc){logger[_0xef34('0x40')](_0x445bdc['message']);});}function main(_0x34c426,_0x31e6f9,_0x347fa2,_0x2fd44f){logger['info']('main',_0x34c426,JSON[_0xef34('0x49')](_0x31e6f9));process['send']('start');var _0x46489f=_0x31e6f9[_0xef34('0x4a')];var _0xbf0552=_0x31e6f9[_0xef34('0x4b')];var _0x565b46=path['join'](config[_0xef34('0x4c')],_0xef34('0x4d'),_0xbf0552+_0xef34('0x4e'));var _0x36cff2=_[_0xef34('0x37')](_0x46489f)['join']();logger[_0xef34('0x3e')](_0xef34('0x4f'),_0x36cff2);fs[_0xef34('0x50')](_0x565b46,_0x36cff2+'\x0a');Papa[_0xef34('0x51')](fs['createReadStream'](_0x34c426),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4793f6,_0x2399d1){try{for(var _0x13a4d9=0x0,_0xda920c=[];_0x13a4d9<_0x4793f6['data'][_0xef34('0x52')];_0x13a4d9++){stats['rows']+=0x1;if(_0x4793f6['errors'][_0x13a4d9]){handleError(_0x4793f6[_0xef34('0x53')][_0x13a4d9],_0x4793f6[_0xef34('0x43')][_0x13a4d9]);}else{var _0x4f441a=[];for(var _0x109f49 in _0x46489f){if(_0x46489f[_0xef34('0x54')](_0x109f49)){if(_0x4793f6['data'][_0x13a4d9][_0x46489f[_0x109f49]]){var _0x3b454b=_[_0xef34('0x55')](_0x4793f6[_0xef34('0x53')][_0x13a4d9][_0x46489f[_0x109f49]][_0xef34('0x56')](/"/g,'\x27'));switch(_0x109f49){case _0xef34('0x1c'):var _0xdad3c2=moment(_0x3b454b,_0xef34('0xe'),!![]);if(_0xdad3c2[_0xef34('0x57')]()){_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');}else{_0x4f441a[_0xef34('0x47')](_0xef34('0x58'));}break;case'priority':var _0x2b2593=parseInt(_0x3b454b);_0x3b454b=_[_0xef34('0x59')](_0x2b2593)||_0x2b2593<0x0||_0x2b2593>0x4?_0x2fd44f?0x3:0x2:_0x2b2593;_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');break;case'UserId':var _0x2b606b=parseInt(_0x3b454b);if(_['isNumber'](_0x2b606b)&&_[_0xef34('0x5a')](_0x347fa2,_0x2b606b)){_0xda920c[_0xef34('0x47')]('\x22'+_0x2b606b+'\x22');}else{_0x4f441a[_0xef34('0x47')]('agent\x20not\x20exists');}break;case _0xef34('0x5b'):if(isEmail(_0x3b454b)){_0xda920c['push']('\x22'+_0x3b454b+'\x22');}else{_0x4f441a['push'](_0xef34('0x5c'));}break;case _0xef34('0x5d'):var _0xd91a99=moment(_0x3b454b,_0xef34('0x5e'),!![]);if(_0xd91a99[_0xef34('0x57')]()){_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');}else{_0x4f441a['push'](_0xef34('0x5f'));}break;default:_0xda920c[_0xef34('0x47')]('\x22'+_0x3b454b+'\x22');}}else{switch(_0x109f49){case _0xef34('0x60'):case _0xef34('0x34'):_0x4f441a[_0xef34('0x47')](_0x109f49+_0xef34('0x61'));break;default:_0xda920c['push']('\x22\x22');}}}}if(_0x4f441a[_0xef34('0x52')]){handleError(_0x4793f6[_0xef34('0x53')][_0x13a4d9],{'code':_0xef34('0x62'),'message':_0x4f441a['join']()});}else{fs[_0xef34('0x63')](_0x565b46,_0xda920c[_0xef34('0x13')]()+'\x0a');}_0xda920c=[];}if(!(stats[_0xef34('0x64')]%0xc8)){socket[_0xef34('0x65')](_0xef34('0x66')+_0xbf0552,stats);stats[_0xef34('0x43')]=[];}}if(stopped){logger[_0xef34('0x3e')](_0xef34('0x67'));_0x2399d1[_0xef34('0x68')]();}}catch(_0x3462e4){handleError(_0x4793f6[_0xef34('0x53')][_0x13a4d9],{'code':_0xef34('0x69'),'message':_0x3462e4[_0xef34('0x41')]});logger[_0xef34('0x40')]('step',_0x3462e4[_0xef34('0x41')]);}},'complete':function(){try{var _0x204e60=[];var _0xa01d1f=_0xef34('0x24');if(_0x31e6f9[_0xef34('0x6a')]&&_0x31e6f9[_0xef34('0x6a')][_0xef34('0x52')]){_0xa01d1f=_0xef34('0x6b')+_0xbf0552;_0x204e60[_0xef34('0x47')]('CREATE\x20TABLE\x20'+_0xa01d1f+_0xef34('0x6c'));}var _0x4c9864=util[_0xef34('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x565b46,_0xa01d1f,_0x36cff2,_0x31e6f9[_0xef34('0x2f')],_0x31e6f9['CompanyId']||null,NOW,NOW);if(_[_0xef34('0x6d')](_0x46489f['scheduledat'])){_0x4c9864+=_0xef34('0x6e');}_0x204e60['push'](_0x4c9864);if(_0x31e6f9[_0xef34('0x6a')]&&_0x31e6f9['duplicates'][_0xef34('0x52')]){_0x204e60[_0xef34('0x47')](insertCmContact(_0x31e6f9[_0xef34('0x2f')],_0xa01d1f,_0x31e6f9['duplicates'],_0x46489f));_0x204e60['push'](_0xef34('0x6f')+_0xa01d1f+';');}_0x204e60[_0xef34('0x47')](insertCmHopper(_0x31e6f9['ListId'],_0xef34('0x70'),_0xef34('0x71'),_0xef34('0x72'),_0x2fd44f));_0x204e60[_0xef34('0x47')](insertCmHopperBlack(_0x31e6f9[_0xef34('0x2f')],_0xef34('0x73'),_0xef34('0x71'),'VoiceQueueId'));_0x204e60[_0xef34('0x47')](insertCmHopper(_0x31e6f9[_0xef34('0x2f')],_0xef34('0x74'),_0xef34('0x75'),_0xef34('0x76'),_0x2fd44f));_0x204e60[_0xef34('0x47')](insertCmHopperBlack(_0x31e6f9['ListId'],_0xef34('0x77'),_0xef34('0x75'),_0xef34('0x76')));BPromise[_0xef34('0x78')](_0x204e60,handleQuery)[_0xef34('0x79')](function(_0x7ec132){stats[_0xef34('0x7a')]=!![];stats[_0xef34('0x7b')]=_0x31e6f9[_0xef34('0x6a')]&&_0x31e6f9[_0xef34('0x6a')][_0xef34('0x52')]?results[0x2][_0xef34('0x7b')]:results[0x0][_0xef34('0x7b')];socket[_0xef34('0x65')]('contact:import:'+_0xbf0552,stats);fs[_0xef34('0x7c')](_0x34c426);fs[_0xef34('0x7c')](_0x565b46);process[_0xef34('0x42')](0x0);})[_0xef34('0x48')](function(_0x209d8e){logger[_0xef34('0x40')](_0x209d8e[_0xef34('0x41')]);process[_0xef34('0x42')](0x1);});}catch(_0x18ff2f){logger[_0xef34('0x40')]('complete',_0x18ff2f[_0xef34('0x41')]);process[_0xef34('0x42')](0x1);}},'error':function(_0x1245c6,_0x366aec,_0x3616de,_0x193b20){throw new Error(_0x193b20);}});}function validate(){if(process[_0xef34('0x7d')]&&process[_0xef34('0x7d')][_0xef34('0x52')]<0x4){throw new Error(_0xef34('0x7e'));}var _0x45e82a=path[_0xef34('0x13')](config[_0xef34('0x4c')],'server/files/tmp',process[_0xef34('0x7d')][0x2]);if(!fs[_0xef34('0x7f')](_0x45e82a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x276d69={};try{_0x276d69=JSON[_0xef34('0x51')](process['argv'][0x3]);if(!_0x276d69[_0xef34('0x4a')]){throw new Error(_0xef34('0x80'));}if(!_0x276d69[_0xef34('0x4a')]['phone']){throw new Error(_0xef34('0x81'));}if(!_0x276d69[_0xef34('0x4a')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x55fd68=0x0;if(_0x276d69[_0xef34('0x4a')]['UserId']){_0x55fd68=0x1;}if(!_0x276d69[_0xef34('0x2f')]){throw new Error(_0xef34('0x82'));}}catch(_0x28684b){throw new Error(_0xef34('0x83'));}var _0x2c0c1b=[];try{_0x2c0c1b=_[_0xef34('0x84')](JSON[_0xef34('0x51')](process[_0xef34('0x7d')][0x4]),'id');}catch(_0x15916f){logger[_0xef34('0x3e')]('No\x20agent\x20available');}main(_0x45e82a,_0x276d69,_0x2c0c1b,_0x55fd68);}validate();process['on'](_0xef34('0x85'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 71ee006..17ea58f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6adb=['Agent\x20Number','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Called\x20Number','uniqueid','Date','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','push','variable','outbound','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridnum','Caller\x20Name','destexten','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname'];(function(_0x287a55,_0xaca63d){var _0x37631d=function(_0x105346){while(--_0x105346){_0x287a55['push'](_0x287a55['shift']());}};_0x37631d(++_0xaca63d);}(_0x6adb,0x1ad));var _0xb6ad=function(_0x530d5c,_0x9ec15f){_0x530d5c=_0x530d5c-0x0;var _0x4f332b=_0x6adb[_0x530d5c];return _0x4f332b;};'use strict';exports[_0xb6ad('0x0')]=function(_0x23122f,_0x805d97){var _0x4e6c00=[{'type':_0xb6ad('0x1'),'content':_0xb6ad('0x2'),'variableName':null}];switch(_0x23122f['toLowerCase']()){case _0xb6ad('0x3'):switch(_0x805d97[_0xb6ad('0x4')]()){case'inbound':_0x4e6c00[_0xb6ad('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x4e6c00[_0xb6ad('0x5')]({'type':_0xb6ad('0x6'),'content':'','variableName':'calleridnum'});break;case _0xb6ad('0x7'):_0x4e6c00[_0xb6ad('0x5')]({'type':_0xb6ad('0x1'),'content':'Outbound\x20Call','variableName':null});_0x4e6c00[_0xb6ad('0x5')]({'type':'variable','content':'','variableName':_0xb6ad('0x8')});break;}}return _0x4e6c00;};exports[_0xb6ad('0x9')]=function(_0x1063aa,_0x3e1c61){var _0x3a0d37=[];switch(_0x1063aa[_0xb6ad('0x4')]()){case _0xb6ad('0x3'):switch(_0x3e1c61[_0xb6ad('0x4')]()){case _0xb6ad('0xa'):_0x3a0d37=[{'type':_0xb6ad('0x1'),'content':_0xb6ad('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0xd'),'keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0xe')},{'type':'keyValue','content':'','key':_0xb6ad('0xf'),'keyType':_0xb6ad('0x6'),'variableName':'calleridname'},{'type':_0xb6ad('0xc'),'content':'','key':'Call\x20To','keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0x10')},{'type':'keyValue','content':'','key':'Queue','keyType':_0xb6ad('0x6'),'variableName':'queue'},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x11'),'keyType':_0xb6ad('0x6'),'variableName':'uniqueid'},{'type':_0xb6ad('0xc'),'content':'','key':'Date','keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0x12')},{'type':_0xb6ad('0x1'),'content':_0xb6ad('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb6ad('0x14'),'keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0x15')},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x16'),'keyType':_0xb6ad('0x6'),'variableName':'destcalleridnum'},{'type':_0xb6ad('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb6ad('0x17'),'keyType':'variable','variableName':_0xb6ad('0x12')},{'type':_0xb6ad('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0x18')},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x19'),'keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0x1a')},{'type':_0xb6ad('0xc'),'content':'','key':'Hold\x20Time','keyType':_0xb6ad('0x6'),'variableName':_0xb6ad('0x1b')},{'type':_0xb6ad('0xc'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0xb6ad('0x1c')}];break;case'outbound':_0x3a0d37=[{'type':_0xb6ad('0x1'),'content':_0xb6ad('0xb'),'variableName':null},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x1d'),'keyType':_0xb6ad('0x6'),'keyContent':'','variableName':_0xb6ad('0x8')},{'type':_0xb6ad('0xc'),'content':'','key':'Member\x20Name','keyType':_0xb6ad('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x11'),'keyType':'variable','keyContent':'','variableName':_0xb6ad('0x1e')},{'type':'keyValue','content':'','key':_0xb6ad('0x1f'),'keyType':_0xb6ad('0x6'),'keyContent':'','variableName':_0xb6ad('0x20')},{'type':_0xb6ad('0x1'),'content':_0xb6ad('0x21')},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x22'),'keyType':_0xb6ad('0x6'),'keyContent':'','variableName':_0xb6ad('0x23')},{'type':'keyValue','content':'','key':_0xb6ad('0x24'),'keyType':_0xb6ad('0x6'),'keyContent':'','variableName':_0xb6ad('0x25')},{'type':'keyValue','content':'','key':_0xb6ad('0x26'),'keyType':_0xb6ad('0x6'),'keyContent':'','variableName':_0xb6ad('0x27')},{'type':_0xb6ad('0xc'),'content':'','key':_0xb6ad('0x28'),'keyType':_0xb6ad('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x3a0d37;};
\ No newline at end of file
+var _0x295b=['Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','agentconnectAt','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','calleridnum','outbound','push','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','queue','UniqueId','uniqueid','Date'];(function(_0x3815b2,_0xdeaa84){var _0x2ebd79=function(_0x4ed85a){while(--_0x4ed85a){_0x3815b2['push'](_0x3815b2['shift']());}};_0x2ebd79(++_0xdeaa84);}(_0x295b,0x64));var _0xb295=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x295b[_0x476bf4];return _0x788ffe;};'use strict';exports[_0xb295('0x0')]=function(_0x3acb7a,_0x69a02b){var _0x2fe5b8=[{'type':_0xb295('0x1'),'content':_0xb295('0x2'),'variableName':null}];switch(_0x3acb7a[_0xb295('0x3')]()){case _0xb295('0x4'):switch(_0x69a02b[_0xb295('0x3')]()){case _0xb295('0x5'):_0x2fe5b8['push']({'type':_0xb295('0x6'),'content':'','variableName':'queue'});_0x2fe5b8['push']({'type':'variable','content':'','variableName':_0xb295('0x7')});break;case _0xb295('0x8'):_0x2fe5b8[_0xb295('0x9')]({'type':_0xb295('0x1'),'content':_0xb295('0xa'),'variableName':null});_0x2fe5b8[_0xb295('0x9')]({'type':_0xb295('0x6'),'content':'','variableName':_0xb295('0xb')});break;}}return _0x2fe5b8;};exports[_0xb295('0xc')]=function(_0x502645,_0x2e1b12){var _0x106158=[];switch(_0x502645['toLowerCase']()){case _0xb295('0x4'):switch(_0x2e1b12[_0xb295('0x3')]()){case _0xb295('0x5'):_0x106158=[{'type':_0xb295('0x1'),'content':_0xb295('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xb295('0xe'),'content':'','key':'Caller\x20Number','keyType':'variable','variableName':_0xb295('0x7')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0xf'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x10')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x11'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x12')},{'type':_0xb295('0xe'),'content':'','key':'Queue','keyType':_0xb295('0x6'),'variableName':_0xb295('0x13')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x14'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x15')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x16'),'keyType':_0xb295('0x6'),'variableName':'agentcalledAt'},{'type':_0xb295('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x17'),'keyType':_0xb295('0x6'),'variableName':'destcalleridname'},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x18'),'keyType':_0xb295('0x6'),'variableName':'destcalleridnum'},{'type':_0xb295('0x1'),'content':_0xb295('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xb295('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1a')},{'type':_0xb295('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1b')},{'type':_0xb295('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1c')},{'type':_0xb295('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xb295('0x6'),'variableName':_0xb295('0x1d')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x1e'),'keyType':_0xb295('0x6'),'variableName':_0xb295('0x1f')}];break;case _0xb295('0x8'):_0x106158=[{'type':'string','content':_0xb295('0xd'),'variableName':null},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x20'),'keyType':'variable','keyContent':'','variableName':_0xb295('0xb')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x21'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':'membername'},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x14'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x15')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x16'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x22')},{'type':_0xb295('0x1'),'content':_0xb295('0x19')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x23'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0xb295('0x24'),'keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x25')},{'type':_0xb295('0xe'),'content':'','key':_0xb295('0x26'),'keyType':'variable','keyContent':'','variableName':_0xb295('0x27')},{'type':_0xb295('0xe'),'content':'','key':'Billable\x20Time','keyType':_0xb295('0x6'),'keyContent':'','variableName':_0xb295('0x28')}];break;}}return _0x106158;};
\ No newline at end of file
index b520da4..32018ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f4a=['clone','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','query'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x3f4a,0xb4));var _0xa3f4=function(_0x2bb905,_0x1f9087){_0x2bb905=_0x2bb905-0x0;var _0x5217dd=_0x3f4a[_0x2bb905];return _0x5217dd;};'use strict';var _=require(_0xa3f4('0x0'));var db=require(_0xa3f4('0x1'))['db'];var loggers={'openchannel':require(_0xa3f4('0x2'))(_0xa3f4('0x3')),'mail':require('../../config/logger')(_0xa3f4('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0xa3f4('0x2'))('sms-interactions'),'chat':require(_0xa3f4('0x2'))(_0xa3f4('0x5')),'whatsapp':require(_0xa3f4('0x2'))(_0xa3f4('0x6'))};function getInteractionId(_0x1491bd,_0x1dbe6c,_0x38f3d5){if(_0x1491bd&&_0x1491bd[_[_0xa3f4('0x7')](_0x38f3d5)+_0xa3f4('0x8')]){return _0x1491bd[_[_0xa3f4('0x7')](_0x38f3d5)+_0xa3f4('0x8')];}else if(_0x1491bd&&_0x1491bd['id']){return _0x1491bd['id'];}else if(_0x1dbe6c&&_0x1dbe6c['id']){return _0x1dbe6c['id'];}else{return'unknown';}}function log(_0x15df64,_0x4888be,_0x587ef3,_0x10931c,_0x5be978,_0x59a7c9){loggers[_0x5be978['toLowerCase']()][_0x15df64](_0xa3f4('0x9'),_0x59a7c9[_0xa3f4('0xa')](),_0x4888be?_0x4888be['id']:null,_0x4888be?_0x4888be['name']:null,_0x4888be?_0x4888be[_0xa3f4('0xb')]:null,getInteractionId(_0x587ef3,_0x10931c,_0x5be978),_0x587ef3?JSON[_0xa3f4('0xc')](_0x587ef3):_0xa3f4('0xd'));}function updateUser(_0x5690c8,_0x39f2ca,_0x5b88b5,_0x4a448a,_0x3c9a7f){db[_[_0xa3f4('0x7')](_0x4a448a)+_0xa3f4('0xe')][_0xa3f4('0xf')]({'where':{'id':getInteractionId(_0x39f2ca,_0x5b88b5,_0x4a448a)}})[_0xa3f4('0x10')](function(_0x3fe92e){if(_0x3fe92e){return _0x3fe92e[_0xa3f4('0x11')]({'UserId':_0x5690c8?_0x5690c8['id']:null});}})['then'](function(_0x20aee0){if(_0x20aee0){log(_0xa3f4('0x12'),_0x5690c8,_0x39f2ca,_0x5b88b5,_0x4a448a,_0x3c9a7f);}})[_0xa3f4('0x13')](function(){log(_0xa3f4('0x14'),_0x5690c8,_0x39f2ca,_0x5b88b5,_0x4a448a,_0x3c9a7f);});}exports[_0xa3f4('0x15')]=function(_0x36726d,_0x400b02){return function(_0x5cea8e,_0x1ffa15,_0x14e6f1){var _0x13d709=_0x5cea8e['user'];var _0x3c6bd9={};var _0x548ba4=_0x5cea8e[_0xa3f4('0x16')];if(_0x3c6bd9){_0x3c6bd9=_[_0xa3f4('0x17')](_0x5cea8e[_0xa3f4('0x18')]);_0x3c6bd9=_[_0xa3f4('0x19')](_0x3c6bd9,['body',_0xa3f4('0x1a'),_0xa3f4('0x1b'),'fax',_0xa3f4('0x1c')]);}updateUser(_0x13d709,_0x3c6bd9,_0x548ba4,_0x36726d,_0x400b02);_0x14e6f1(null);};};
\ No newline at end of file
+var _0x897d=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId'];(function(_0x5f138f,_0x2592e6){var _0x38b3f1=function(_0x7b43b8){while(--_0x7b43b8){_0x5f138f['push'](_0x5f138f['shift']());}};_0x38b3f1(++_0x2592e6);}(_0x897d,0x82));var _0xd897=function(_0x412a65,_0x33a276){_0x412a65=_0x412a65-0x0;var _0x5a03bf=_0x897d[_0x412a65];return _0x5a03bf;};'use strict';var _=require(_0xd897('0x0'));var db=require(_0xd897('0x1'))['db'];var loggers={'openchannel':require(_0xd897('0x2'))('openchannel-interactions'),'mail':require(_0xd897('0x2'))(_0xd897('0x3')),'fax':require('../../config/logger')(_0xd897('0x4')),'sms':require(_0xd897('0x2'))(_0xd897('0x5')),'chat':require(_0xd897('0x2'))(_0xd897('0x6')),'whatsapp':require('../../config/logger')(_0xd897('0x7'))};function getInteractionId(_0x54e66d,_0x1db548,_0x42b05a){if(_0x54e66d&&_0x54e66d[_[_0xd897('0x8')](_0x42b05a)+_0xd897('0x9')]){return _0x54e66d[_['upperFirst'](_0x42b05a)+_0xd897('0x9')];}else if(_0x54e66d&&_0x54e66d['id']){return _0x54e66d['id'];}else if(_0x1db548&&_0x1db548['id']){return _0x1db548['id'];}else{return _0xd897('0xa');}}function log(_0x296863,_0x50abb1,_0x447e55,_0x26bbe2,_0x59f622,_0x3deb8d){loggers[_0x59f622[_0xd897('0xb')]()][_0x296863](_0xd897('0xc'),_0x3deb8d[_0xd897('0xd')](),_0x50abb1?_0x50abb1['id']:null,_0x50abb1?_0x50abb1[_0xd897('0xe')]:null,_0x50abb1?_0x50abb1[_0xd897('0xf')]:null,getInteractionId(_0x447e55,_0x26bbe2,_0x59f622),_0x447e55?JSON[_0xd897('0x10')](_0x447e55):_0xd897('0x11'));}function updateUser(_0x2bed98,_0x543ff5,_0x5a91,_0x235c7b,_0x2f73b2){db[_[_0xd897('0x8')](_0x235c7b)+_0xd897('0x12')][_0xd897('0x13')]({'where':{'id':getInteractionId(_0x543ff5,_0x5a91,_0x235c7b)}})[_0xd897('0x14')](function(_0x5b8066){if(_0x5b8066){return _0x5b8066[_0xd897('0x15')]({'UserId':_0x2bed98?_0x2bed98['id']:null});}})[_0xd897('0x14')](function(_0x433191){if(_0x433191){log(_0xd897('0x16'),_0x2bed98,_0x543ff5,_0x5a91,_0x235c7b,_0x2f73b2);}})[_0xd897('0x17')](function(){log(_0xd897('0x18'),_0x2bed98,_0x543ff5,_0x5a91,_0x235c7b,_0x2f73b2);});}exports[_0xd897('0x19')]=function(_0x50a780,_0x530052){return function(_0x58646c,_0x29b61b,_0x38c3f5){var _0x3b0e3e=_0x58646c[_0xd897('0x1a')];var _0x15f308={};var _0xf8c12a=_0x58646c[_0xd897('0x1b')];if(_0x15f308){_0x15f308=_[_0xd897('0x1c')](_0x58646c[_0xd897('0x1d')]);_0x15f308=_[_0xd897('0x1e')](_0x15f308,['body',_0xd897('0x1f'),_0xd897('0x20'),_0xd897('0x21'),_0xd897('0x22')]);}updateUser(_0x3b0e3e,_0x15f308,_0xf8c12a,_0x50a780,_0x530052);_0x38c3f5(null);};};
\ No newline at end of file
index f4401f1..30993fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f56=['parse','use','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','crypto','util','composable-middleware','../../config/environment','license','createDecipher','format','%s:%s:%s','base64','utf8','final'];(function(_0x16b434,_0x526dbf){var _0x3b70f8=function(_0x3d699f){while(--_0x3d699f){_0x16b434['push'](_0x16b434['shift']());}};_0x3b70f8(++_0x526dbf);}(_0x8f56,0x6d));var _0x68f5=function(_0x51171a,_0x23058f){_0x51171a=_0x51171a-0x0;var _0x115fb4=_0x8f56[_0x51171a];return _0x115fb4;};'use strict';var crypto=require(_0x68f5('0x0'));var util=require(_0x68f5('0x1'));var compose=require(_0x68f5('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x68f5('0x3'));function getValueFromLicense(_0x476315,_0xa81767){if(_0x476315&&_0xa81767){if(_0xa81767['data1']&&_0xa81767[_0x68f5('0x4')]){var _0x353c0f=_0xa81767['data1'];var _0x1a65ff=_0xa81767[_0x68f5('0x4')];var _0x55403c=_0x353c0f['split']('-')[0x4];var _0x5263f3=_0x353c0f['split']('-')[0x0];var _0x18ec9e=crypto[_0x68f5('0x5')]('aes-256-ctr',util[_0x68f5('0x6')](_0x68f5('0x7'),_0x55403c,_0x353c0f,_0x5263f3));var _0x214def=_0x18ec9e['update'](_0x1a65ff,_0x68f5('0x8'),_0x68f5('0x9'));_0x214def+=_0x18ec9e[_0x68f5('0xa')](_0x68f5('0x9'));var _0x100d1=JSON[_0x68f5('0xb')](_0x214def);return _0x100d1['hasOwnProperty'](_0x476315)?_0x100d1[_0x476315]:null;}}return null;}function isLimit(_0x1aea0b,_0x5a0655,_0x3465db,_0x3d4693){var _0x323e10=_0x5a0655;return compose()[_0x68f5('0xc')](function(_0x56ed90,_0x4fa4f5,_0x5d339b){return db['License'][_0x68f5('0xd')]({'where':{'id':0x1},'raw':!![]})[_0x68f5('0xe')](function(_0x315754){var _0x1cb9a4=getValueFromLicense(_0x1aea0b,_0x315754);return _0x1cb9a4?_0x1cb9a4:_0x323e10;})['then'](function(_0x1663f4){_0x323e10=_0x1663f4;return _0x3465db['count'](_0x3d4693);})['then'](function(_0x5497d4){if(_0x5497d4>=_0x323e10){return _0x4fa4f5[_0x68f5('0xf')](0x193)['json']({'message':util[_0x68f5('0x6')](_0x68f5('0x10'),_0x1aea0b)});}_0x5d339b();})[_0x68f5('0x11')](function(_0x9e46e8){_0x5d339b(_0x9e46e8);});});}function isUserLimit(){return isLimit(_0x68f5('0x12'),0x1,db['User'],{'where':{'$or':[{'role':_0x68f5('0x13')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0x692e=['final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','admin','user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8'];(function(_0x16b51e,_0x30cb17){var _0x27b91a=function(_0x131411){while(--_0x131411){_0x16b51e['push'](_0x16b51e['shift']());}};_0x27b91a(++_0x30cb17);}(_0x692e,0x137));var _0xe692=function(_0x15f235,_0x4f45e9){_0x15f235=_0x15f235-0x0;var _0x1b3f64=_0x692e[_0x15f235];return _0x1b3f64;};'use strict';var crypto=require('crypto');var util=require(_0xe692('0x0'));var compose=require(_0xe692('0x1'));var db=require(_0xe692('0x2'))['db'];var config=require(_0xe692('0x3'));function getValueFromLicense(_0x251ab4,_0x27693d){if(_0x251ab4&&_0x27693d){if(_0x27693d[_0xe692('0x4')]&&_0x27693d[_0xe692('0x5')]){var _0x5d5405=_0x27693d[_0xe692('0x4')];var _0x234f57=_0x27693d[_0xe692('0x5')];var _0x447616=_0x5d5405[_0xe692('0x6')]('-')[0x4];var _0x1f1800=_0x5d5405[_0xe692('0x6')]('-')[0x0];var _0x195aba=crypto['createDecipher'](_0xe692('0x7'),util[_0xe692('0x8')](_0xe692('0x9'),_0x447616,_0x5d5405,_0x1f1800));var _0x12e7e7=_0x195aba[_0xe692('0xa')](_0x234f57,_0xe692('0xb'),_0xe692('0xc'));_0x12e7e7+=_0x195aba[_0xe692('0xd')]('utf8');var _0xf7052d=JSON[_0xe692('0xe')](_0x12e7e7);return _0xf7052d[_0xe692('0xf')](_0x251ab4)?_0xf7052d[_0x251ab4]:null;}}return null;}function isLimit(_0x2feb8b,_0xf9174e,_0x276b92,_0x1020b3){var _0x12f02a=_0xf9174e;return compose()[_0xe692('0x10')](function(_0x951a3,_0x59c177,_0x5cef2a){return db[_0xe692('0x11')][_0xe692('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xe692('0x13')](function(_0x53605c){var _0x423133=getValueFromLicense(_0x2feb8b,_0x53605c);return _0x423133?_0x423133:_0x12f02a;})[_0xe692('0x13')](function(_0x3ca203){_0x12f02a=_0x3ca203;return _0x276b92[_0xe692('0x14')](_0x1020b3);})[_0xe692('0x13')](function(_0x6aed12){if(_0x6aed12>=_0x12f02a){return _0x59c177[_0xe692('0x15')](0x193)[_0xe692('0x16')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2feb8b)});}_0x5cef2a();})[_0xe692('0x17')](function(_0x93a5d6){_0x5cef2a(_0x93a5d6);});});}function isUserLimit(){return isLimit(_0xe692('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xe692('0x19')},{'role':_0xe692('0x1a')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 1336c04..15677d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dec=['field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','start','$startsWith','pop','add','hours','minutes','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','indexOf','map','buildExpression','DATE','operator','$between','value','includes','$lte','days','format','castTo','text','CAST('];(function(_0x3d7e97,_0x17dc8d){var _0x26d356=function(_0x3c6d94){while(--_0x3c6d94){_0x3d7e97['push'](_0x3d7e97['shift']());}};_0x26d356(++_0x17dc8d);}(_0x6dec,0xb5));var _0xc6de=function(_0x1ce763,_0x5bdf15){_0x1ce763=_0x1ce763-0x0;var _0xbcbafc=_0x6dec[_0x1ce763];return _0xbcbafc;};'use strict';var _=require(_0xc6de('0x0'));var moment=require(_0xc6de('0x1'));exports[_0xc6de('0x2')]=function(_0x10659b){var _0xfea1bd={'conditions':[]};_0xfea1bd['sqlOperator']=_[_0xc6de('0x3')](_0x10659b,_0xc6de('0x4'))?'or':_0xc6de('0x5');var _0x2296ea=_0x10659b[_0xc6de('0x6')](_0xc6de('0x7'),'')[_0xc6de('0x6')](_0xc6de('0x4'),'')[_0xc6de('0x8')]('||');for(var _0x1d3225=0x0;_0x1d3225<_0x2296ea['length'];_0x1d3225++){var _0x3400ac=_0x2296ea[_0x1d3225][_0xc6de('0x8')](':=');var _0x1ffa07=_0x3400ac[0x0];var _0x8d6ab9=_0x3400ac[_0xc6de('0x9')](0x1);_0x8d6ab9[_0xc6de('0xa')](function(_0x387b6f){var _0x2731b9=_0x387b6f[_0xc6de('0x8')]('[')['shift']();var _0x5e9ff3=_0x387b6f[_0xc6de('0xb')](/\[(.*?)\]/g);_0x5e9ff3['forEach'](function(_0x3a0b0e){var _0x4654b6=_0x3a0b0e[_0xc6de('0x8')]('[')[_0xc6de('0xc')](function(_0x5999d6){return _0x5999d6[_0xc6de('0xd')](']')>-0x1;})[_0xc6de('0xe')](function(_0x16345b){return _0x16345b[_0xc6de('0x8')](']')[0x0];})[0x0];_0xfea1bd['conditions']['push']({'field':_0x1ffa07,'operator':_0x2731b9,'value':_0x4654b6});});});}return _0xfea1bd;};exports[_0xc6de('0xf')]=function(_0xf8d00d,_0x54675e,_0x3fd9de){var _0x47ad7c={};if(_0x54675e===_0xc6de('0x10')){if(_0x3fd9de['operator']==='$eq'){_0x3fd9de[_0xc6de('0x11')]=_0xc6de('0x12');_0x3fd9de[_0xc6de('0x13')]+=','+_0x3fd9de['value'];}else if(_[_0xc6de('0x14')](['$gt',_0xc6de('0x15')],_0x3fd9de[_0xc6de('0x11')])){_0x3fd9de[_0xc6de('0x13')]=moment(_0x3fd9de[_0xc6de('0x13')])['add'](0x1,_0xc6de('0x16'))[_0xc6de('0x17')]('YYYY-MM-DD');}}if(_0x3fd9de[_0xc6de('0x18')]){_0x54675e=_0x3fd9de['castTo'];_0x47ad7c[_0xc6de('0x19')]=_0xc6de('0x1a')+_0xf8d00d+'.'+_0x3fd9de[_0xc6de('0x1b')]+_0xc6de('0x1c')+_0x3fd9de[_0xc6de('0x18')]+')\x20'+parseOperator(_0x3fd9de[_0xc6de('0x11')]);}else{_0x47ad7c['text']=_0xf8d00d+'.'+_0x3fd9de[_0xc6de('0x1b')]+'\x20'+parseOperator(_0x3fd9de[_0xc6de('0x11')]);}if(_[_0xc6de('0x14')]([_0xc6de('0x1d'),_0xc6de('0x1e')],_0x3fd9de['operator']))_0x47ad7c['text']='('+_0x47ad7c[_0xc6de('0x19')]+_0xc6de('0x1f')+_0xf8d00d+'.'+_0x3fd9de[_0xc6de('0x1b')]+_0xc6de('0x20');_0x47ad7c['value']=parseValue(_0x54675e,_0x3fd9de[_0xc6de('0x11')],_0x3fd9de[_0xc6de('0x13')]);return _0x47ad7c;};function parseOperator(_0xe365c6){var _0x4b61bb;switch(_0xe365c6){case _0xc6de('0x21'):_0x4b61bb=_0xc6de('0x22');break;case _0xc6de('0x1e'):_0x4b61bb=_0xc6de('0x23');break;case'$eq':_0x4b61bb='=\x20?';break;case _0xc6de('0x1d'):_0x4b61bb=_0xc6de('0x24');break;case _0xc6de('0x25'):case'$startsWith':case _0xc6de('0x26'):_0x4b61bb=_0xc6de('0x27');break;case _0xc6de('0x28'):_0x4b61bb=_0xc6de('0x29');break;case'$gt':_0x4b61bb=_0xc6de('0x2a');break;case _0xc6de('0x15'):_0x4b61bb=_0xc6de('0x2b');break;case _0xc6de('0x2c'):_0x4b61bb=_0xc6de('0x2d');break;case _0xc6de('0x12'):_0x4b61bb='BETWEEN\x20?\x20AND\x20?';break;}return _0x4b61bb;}function parseValue(_0x57cc31,_0x1315b0,_0x190836){var _0x34f539={'start':undefined,'end':undefined};switch(_0x1315b0){case _0xc6de('0x21'):case _0xc6de('0x1e'):_0x34f539['start']=_0x190836['split'](',');break;case _0xc6de('0x25'):_0x34f539[_0xc6de('0x2e')]='%'+_0x190836+'%';break;case _0xc6de('0x2f'):_0x34f539['start']=_0x190836+'%';break;case _0xc6de('0x26'):_0x34f539[_0xc6de('0x2e')]='%'+_0x190836;break;case'$between':var _0x5a2381=_0x190836['split'](',');var _0x190836=_0x5a2381['shift']();var _0x273204=_0x5a2381[_0xc6de('0x30')]();if(_0x57cc31===_0xc6de('0x10')){_0x190836=moment(_0x190836)['utcOffset'](0x0,!![])[_0xc6de('0x17')]();_0x273204=moment(_0x273204)['utcOffset'](0x0,!![])[_0xc6de('0x31')](0x17,_0xc6de('0x32'))['add'](0x3b,_0xc6de('0x33'))[_0xc6de('0x31')](0x3b,'seconds')[_0xc6de('0x17')]();}_0x34f539={'start':_0x190836,'end':_0x273204};break;default:_0x34f539[_0xc6de('0x2e')]=_0x190836;break;}return _0x34f539;}
\ No newline at end of file
+var _0x67c4=['seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','castTo','CAST(','\x20AS\x20','$ne','text','\x20OR\x20','$in','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$startsWith','pop','hours','minutes'];(function(_0x36329c,_0x761dd7){var _0x3b0dd8=function(_0x1eafb5){while(--_0x1eafb5){_0x36329c['push'](_0x36329c['shift']());}};_0x3b0dd8(++_0x761dd7);}(_0x67c4,0x145));var _0x467c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x67c4[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x467c('0x0'));var moment=require(_0x467c('0x1'));exports[_0x467c('0x2')]=function(_0x12b7de){var _0x59b05d={'conditions':[]};_0x59b05d[_0x467c('0x3')]=_[_0x467c('0x4')](_0x12b7de,_0x467c('0x5'))?'or':_0x467c('0x6');var _0x43511b=_0x12b7de[_0x467c('0x7')](_0x467c('0x8'),'')[_0x467c('0x7')](_0x467c('0x5'),'')[_0x467c('0x9')]('||');for(var _0x5812fe=0x0;_0x5812fe<_0x43511b[_0x467c('0xa')];_0x5812fe++){var _0x210ab9=_0x43511b[_0x5812fe][_0x467c('0x9')](':=');var _0x101cc3=_0x210ab9[0x0];var _0x393370=_0x210ab9[_0x467c('0xb')](0x1);_0x393370[_0x467c('0xc')](function(_0x19ab54){var _0x44e72b=_0x19ab54[_0x467c('0x9')]('[')[_0x467c('0xd')]();var _0x4c7065=_0x19ab54[_0x467c('0xe')](/\[(.*?)\]/g);_0x4c7065[_0x467c('0xc')](function(_0x6c919d){var _0x355168=_0x6c919d['split']('[')[_0x467c('0xf')](function(_0x5280c2){return _0x5280c2[_0x467c('0x10')](']')>-0x1;})[_0x467c('0x11')](function(_0x551ad0){return _0x551ad0[_0x467c('0x9')](']')[0x0];})[0x0];_0x59b05d[_0x467c('0x12')][_0x467c('0x13')]({'field':_0x101cc3,'operator':_0x44e72b,'value':_0x355168});});});}return _0x59b05d;};exports['buildExpression']=function(_0x65030,_0x5edf90,_0x32dbfe){var _0x57478d={};if(_0x5edf90===_0x467c('0x14')){if(_0x32dbfe[_0x467c('0x15')]===_0x467c('0x16')){_0x32dbfe[_0x467c('0x15')]=_0x467c('0x17');_0x32dbfe[_0x467c('0x18')]+=','+_0x32dbfe[_0x467c('0x18')];}else if(_[_0x467c('0x19')]([_0x467c('0x1a'),_0x467c('0x1b')],_0x32dbfe[_0x467c('0x15')])){_0x32dbfe[_0x467c('0x18')]=moment(_0x32dbfe['value'])[_0x467c('0x1c')](0x1,'days')[_0x467c('0x1d')](_0x467c('0x1e'));}}if(_0x32dbfe[_0x467c('0x1f')]){_0x5edf90=_0x32dbfe['castTo'];_0x57478d['text']=_0x467c('0x20')+_0x65030+'.'+_0x32dbfe['field']+_0x467c('0x21')+_0x32dbfe[_0x467c('0x1f')]+')\x20'+parseOperator(_0x32dbfe[_0x467c('0x15')]);}else{_0x57478d['text']=_0x65030+'.'+_0x32dbfe['field']+'\x20'+parseOperator(_0x32dbfe[_0x467c('0x15')]);}if(_[_0x467c('0x19')]([_0x467c('0x22'),'$notIn'],_0x32dbfe['operator']))_0x57478d[_0x467c('0x23')]='('+_0x57478d['text']+_0x467c('0x24')+_0x65030+'.'+_0x32dbfe['field']+'\x20IS\x20NULL)';_0x57478d[_0x467c('0x18')]=parseValue(_0x5edf90,_0x32dbfe[_0x467c('0x15')],_0x32dbfe[_0x467c('0x18')]);return _0x57478d;};function parseOperator(_0x54e4bf){var _0x4fe6ad;switch(_0x54e4bf){case _0x467c('0x25'):_0x4fe6ad='IN\x20?';break;case'$notIn':_0x4fe6ad='NOT\x20IN\x20?';break;case _0x467c('0x16'):_0x4fe6ad='=\x20?';break;case'$ne':_0x4fe6ad=_0x467c('0x26');break;case _0x467c('0x27'):case'$startsWith':case _0x467c('0x28'):_0x4fe6ad=_0x467c('0x29');break;case'$lt':_0x4fe6ad=_0x467c('0x2a');break;case _0x467c('0x1a'):_0x4fe6ad=_0x467c('0x2b');break;case'$lte':_0x4fe6ad='<=\x20?';break;case _0x467c('0x2c'):_0x4fe6ad=_0x467c('0x2d');break;case _0x467c('0x17'):_0x4fe6ad=_0x467c('0x2e');break;}return _0x4fe6ad;}function parseValue(_0x415370,_0xc63d1f,_0x1ed806){var _0x159f32={'start':undefined,'end':undefined};switch(_0xc63d1f){case _0x467c('0x25'):case _0x467c('0x2f'):_0x159f32[_0x467c('0x30')]=_0x1ed806[_0x467c('0x9')](',');break;case _0x467c('0x27'):_0x159f32['start']='%'+_0x1ed806+'%';break;case _0x467c('0x31'):_0x159f32['start']=_0x1ed806+'%';break;case _0x467c('0x28'):_0x159f32[_0x467c('0x30')]='%'+_0x1ed806;break;case'$between':var _0x542834=_0x1ed806[_0x467c('0x9')](',');var _0x1ed806=_0x542834[_0x467c('0xd')]();var _0x4bc538=_0x542834[_0x467c('0x32')]();if(_0x415370===_0x467c('0x14')){_0x1ed806=moment(_0x1ed806)['utcOffset'](0x0,!![])['format']();_0x4bc538=moment(_0x4bc538)['utcOffset'](0x0,!![])[_0x467c('0x1c')](0x17,_0x467c('0x33'))[_0x467c('0x1c')](0x3b,_0x467c('0x34'))[_0x467c('0x1c')](0x3b,_0x467c('0x35'))[_0x467c('0x1d')]();}_0x159f32={'start':_0x1ed806,'end':_0x4bc538};break;default:_0x159f32['start']=_0x1ed806;break;}return _0x159f32;}
\ No newline at end of file
index dd63206..6cb0c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x872d=['sequelize','moment','split','filters','forOwn','find','type','DATE','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','offset','sort','map','cast','col','priority','substr','unsigned','ASC','isEmpty','length','omit','isObject','isString','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','includes','lodash'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x872d,0x179));var _0xd872=function(_0x3bda93,_0x396578){_0x3bda93=_0x3bda93-0x0;var _0x41eb67=_0x872d[_0x3bda93];return _0x41eb67;};'use strict';var _=require(_0xd872('0x0'));var sequelize=require(_0xd872('0x1'));var moment=require(_0xd872('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x3188b1){var _0x5838a4=null;if(_0x3188b1){_0x5838a4=_0x3188b1[_0xd872('0x3')](',');}return _0x5838a4;};exports[_0xd872('0x4')]=function(_0x2795cd,_0xc08ae7){var _0x5e3e8e={};if(!_['isEmpty'](_0x2795cd)){_[_0xd872('0x5')](_0x2795cd,function(_0x1cfea6,_0x492a36){try{if(_0xc08ae7){var _0x3c829a=_[_0xd872('0x6')](_0xc08ae7,{'name':_0x492a36})||{};if(_0x3c829a[_0xd872('0x7')]===_0xd872('0x8')&&_[_0xd872('0x9')](_0x1cfea6)){var _0x236bf6=JSON[_0xd872('0xa')](_0x1cfea6);var _0x5524f8={'$gte':moment(moment(_0x236bf6[_0xd872('0xb')])[_0xd872('0xc')](_0xd872('0xd')))[_0xd872('0xe')]()[_0xd872('0xc')](),'$lte':moment(moment(_0x236bf6['$lte'])[_0xd872('0xc')](_0xd872('0xd')))['utc']()[_0xd872('0xf')](0x1,'s')[_0xd872('0xc')]()};_0x5e3e8e[_0x492a36]=_0x5524f8;}else if(_0x3c829a[_0xd872('0x10')]===_0xd872('0x11')){_0x5e3e8e[_0x492a36]=_0x1cfea6;}else{_0x5e3e8e[_0x492a36]=_[_0xd872('0x12')](_0x1cfea6)?_0x1cfea6:JSON[_0xd872('0xa')](_0x1cfea6);}}else{_0x5e3e8e[_0x492a36]=_[_0xd872('0x12')](_0x1cfea6)?_0x1cfea6:JSON[_0xd872('0xa')](_0x1cfea6);}}catch(_0x469aae){_0x5e3e8e[_0x492a36]=_0x1cfea6['split'](',');}});}return _0x5e3e8e;};exports['limit']=function(_0x362116){_0x362116=parseInt(_0x362116,0xa);if(!_0x362116||_0x362116<0x0){_0x362116=LIMIT_VALUE;}return _0x362116;};exports[_0xd872('0x13')]=function(_0x5a6716){_0x5a6716=parseInt(_0x5a6716,0xa);if(!_0x5a6716||_0x5a6716<0x0){_0x5a6716=0x0;}return _0x5a6716;};exports[_0xd872('0x14')]=function(_0x1fb589){var _0x3149ca,_0x4c6df4=null;if(_0x1fb589){_0x3149ca=_0x1fb589[_0xd872('0x3')](',');_0x4c6df4=_[_0xd872('0x15')](_0x3149ca,function(_0x2f0f28){if(_0x2f0f28['indexOf']('-')===0x0){return[_0x2f0f28==='priority'?sequelize[_0xd872('0x16')](sequelize[_0xd872('0x17')](_0xd872('0x18')),'unsigned'):_0x2f0f28[_0xd872('0x19')](0x1),'DESC'];}else{return[_0x2f0f28===_0xd872('0x18')?sequelize[_0xd872('0x16')](sequelize[_0xd872('0x17')](_0xd872('0x18')),_0xd872('0x1a')):_0x2f0f28,_0xd872('0x1b')];}});}return _0x4c6df4;};exports['omit']=function(_0xe3232e,_0x527971){if(_[_0xd872('0x1c')](_0xe3232e)){return _0xe3232e;}if(_['isArray'](_0xe3232e)){for(var _0x3fa1df=0x0;_0x3fa1df<_0xe3232e[_0xd872('0x1d')];_0x3fa1df+=0x1){_0xe3232e[_0x3fa1df]=this[_0xd872('0x1e')](_0xe3232e[_0x3fa1df],_0x527971);}return _0xe3232e;}if(!_[_0xd872('0x1f')](_0xe3232e)){return _0xe3232e;}if(_[_0xd872('0x20')](_0x527971)){_0x527971=[_0x527971];}if(!_[_0xd872('0x12')](_0x527971)){return _0xe3232e;}for(var _0x4682b4=0x0;_0x4682b4<_0x527971['length'];_0x4682b4+=0x1){_[_0xd872('0x21')](_0xe3232e,_0x527971[_0x4682b4]);}for(var _0x590573 in _0xe3232e){if(_0xe3232e['hasOwnProperty'](_0x590573)){_0xe3232e[_0x590573]=this['omit'](_0xe3232e[_0x590573],_0x527971);}}return _0xe3232e;};exports[_0xd872('0x22')]=function(_0x223e45){return _0x223e45['match'](RegExp(_0xd872('0x23')))?!![]:![];};exports[_0xd872('0x24')]=function(_0x591e77){return _0x591e77[_0xd872('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xd872('0x26')]=function(_0xf7b22d){var _0x4c3b3a=[];_0xf7b22d['split'](/[ ,]+/)[_0xd872('0x27')](function(_0x2d8f25){_0x2d8f25=_0x2d8f25[_0xd872('0x28')](/([^:]")"+/g,'$1');_0x2d8f25='+'+_0x2d8f25+'*';if(_0x2d8f25[_0xd872('0x29')]('@'))_0x2d8f25='\x22'+_0x2d8f25+'\x22';_0x4c3b3a['push'](_0x2d8f25);});return _0x4c3b3a['join']('\x20');};
\ No newline at end of file
+var _0x1c12=['length','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','forEach','lodash','sequelize','moment','fields','split','filters','isEmpty','forOwn','type','DATE','parse','utc','format','$lte','YYYY-MM-DD','subtract','name','isArray','limit','sort','map','priority','cast','col','DESC','unsigned','omit'];(function(_0x551822,_0x2ef6ff){var _0x2c5e96=function(_0x56d282){while(--_0x56d282){_0x551822['push'](_0x551822['shift']());}};_0x2c5e96(++_0x2ef6ff);}(_0x1c12,0x195));var _0x21c1=function(_0x52561a,_0x3a3208){_0x52561a=_0x52561a-0x0;var _0x2a086a=_0x1c12[_0x52561a];return _0x2a086a;};'use strict';var _=require(_0x21c1('0x0'));var sequelize=require(_0x21c1('0x1'));var moment=require(_0x21c1('0x2'));var LIMIT_VALUE=0xfa;exports[_0x21c1('0x3')]=function(_0x5211e7){var _0x3cb135=null;if(_0x5211e7){_0x3cb135=_0x5211e7[_0x21c1('0x4')](',');}return _0x3cb135;};exports[_0x21c1('0x5')]=function(_0x452b3a,_0x1d718a){var _0x38690e={};if(!_[_0x21c1('0x6')](_0x452b3a)){_[_0x21c1('0x7')](_0x452b3a,function(_0x158629,_0x1d3290){try{if(_0x1d718a){var _0x5b9a02=_['find'](_0x1d718a,{'name':_0x1d3290})||{};if(_0x5b9a02[_0x21c1('0x8')]===_0x21c1('0x9')&&_['isPlainObject'](_0x158629)){var _0x40edf8=JSON[_0x21c1('0xa')](_0x158629);var _0x450741={'$gte':moment(moment(_0x40edf8['$gte'])['format']('YYYY-MM-DD'))[_0x21c1('0xb')]()[_0x21c1('0xc')](),'$lte':moment(moment(_0x40edf8[_0x21c1('0xd')])[_0x21c1('0xc')](_0x21c1('0xe')))[_0x21c1('0xb')]()[_0x21c1('0xf')](0x1,'s')[_0x21c1('0xc')]()};_0x38690e[_0x1d3290]=_0x450741;}else if(_0x5b9a02[_0x21c1('0x10')]==='uniqueid'){_0x38690e[_0x1d3290]=_0x158629;}else{_0x38690e[_0x1d3290]=_[_0x21c1('0x11')](_0x158629)?_0x158629:JSON['parse'](_0x158629);}}else{_0x38690e[_0x1d3290]=_[_0x21c1('0x11')](_0x158629)?_0x158629:JSON[_0x21c1('0xa')](_0x158629);}}catch(_0x1b11db){_0x38690e[_0x1d3290]=_0x158629['split'](',');}});}return _0x38690e;};exports[_0x21c1('0x12')]=function(_0x3bcddd){_0x3bcddd=parseInt(_0x3bcddd,0xa);if(!_0x3bcddd||_0x3bcddd<0x0){_0x3bcddd=LIMIT_VALUE;}return _0x3bcddd;};exports['offset']=function(_0x358dc3){_0x358dc3=parseInt(_0x358dc3,0xa);if(!_0x358dc3||_0x358dc3<0x0){_0x358dc3=0x0;}return _0x358dc3;};exports[_0x21c1('0x13')]=function(_0xa1e41d){var _0x50b97d,_0x37e882=null;if(_0xa1e41d){_0x50b97d=_0xa1e41d[_0x21c1('0x4')](',');_0x37e882=_[_0x21c1('0x14')](_0x50b97d,function(_0x32b857){if(_0x32b857['indexOf']('-')===0x0){return[_0x32b857===_0x21c1('0x15')?sequelize[_0x21c1('0x16')](sequelize[_0x21c1('0x17')](_0x21c1('0x15')),'unsigned'):_0x32b857['substr'](0x1),_0x21c1('0x18')];}else{return[_0x32b857===_0x21c1('0x15')?sequelize['cast'](sequelize['col']('priority'),_0x21c1('0x19')):_0x32b857,'ASC'];}});}return _0x37e882;};exports[_0x21c1('0x1a')]=function(_0x304f0f,_0x158a8f){if(_[_0x21c1('0x6')](_0x304f0f)){return _0x304f0f;}if(_[_0x21c1('0x11')](_0x304f0f)){for(var _0x17ecb4=0x0;_0x17ecb4<_0x304f0f[_0x21c1('0x1b')];_0x17ecb4+=0x1){_0x304f0f[_0x17ecb4]=this[_0x21c1('0x1a')](_0x304f0f[_0x17ecb4],_0x158a8f);}return _0x304f0f;}if(!_[_0x21c1('0x1c')](_0x304f0f)){return _0x304f0f;}if(_['isString'](_0x158a8f)){_0x158a8f=[_0x158a8f];}if(!_[_0x21c1('0x11')](_0x158a8f)){return _0x304f0f;}for(var _0x52803a=0x0;_0x52803a<_0x158a8f[_0x21c1('0x1b')];_0x52803a+=0x1){_[_0x21c1('0x1d')](_0x304f0f,_0x158a8f[_0x52803a]);}for(var _0x296cf6 in _0x304f0f){if(_0x304f0f[_0x21c1('0x1e')](_0x296cf6)){_0x304f0f[_0x296cf6]=this[_0x21c1('0x1a')](_0x304f0f[_0x296cf6],_0x158a8f);}}return _0x304f0f;};exports[_0x21c1('0x1f')]=function(_0x4e764a){return _0x4e764a['match'](RegExp(_0x21c1('0x20')))?!![]:![];};exports[_0x21c1('0x21')]=function(_0x26a3f6){return _0x26a3f6[_0x21c1('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x120e83){var _0x224f56=[];_0x120e83['split'](/[ ,]+/)[_0x21c1('0x23')](function(_0x57186a){_0x57186a=_0x57186a['replace'](/([^:]")"+/g,'$1');_0x57186a='+'+_0x57186a+'*';if(_0x57186a['includes']('@'))_0x57186a='\x22'+_0x57186a+'\x22';_0x224f56['push'](_0x57186a);});return _0x224f56['join']('\x20');};
\ No newline at end of file
index 9c6092f..5be0fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd77=['join','root','test','client','use','json\x20replacer','toISOString','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','express','serve-favicon','cookie-parser','errorhandler','path','passport','moment','./environment','default','get','production','set','appPath'];(function(_0x361026,_0x2375e2){var _0x37028e=function(_0x4f89e0){while(--_0x4f89e0){_0x361026['push'](_0x361026['shift']());}};_0x37028e(++_0x2375e2);}(_0xbd77,0xeb));var _0x7bd7=function(_0x105c25,_0x1908ca){_0x105c25=_0x105c25-0x0;var _0x328241=_0xbd77[_0x105c25];return _0x328241;};'use strict';var express=require(_0x7bd7('0x0'));var favicon=require(_0x7bd7('0x1'));var bodyParser=require('body-parser');var methodOverride=require('method-override');var cookieParser=require(_0x7bd7('0x2'));var errorHandler=require(_0x7bd7('0x3'));var path=require(_0x7bd7('0x4'));var passport=require(_0x7bd7('0x5'));var cors=require('cors');var moment=require(_0x7bd7('0x6'));var config=require(_0x7bd7('0x7'));var db=require('../mysqldb')['db'];exports[_0x7bd7('0x8')]=function(_0x59dbae){var _0x163b10=_0x59dbae[_0x7bd7('0x9')]('env');if(_0x163b10===_0x7bd7('0xa')){_0x59dbae[_0x7bd7('0xb')](_0x7bd7('0xc'),path[_0x7bd7('0xd')](config[_0x7bd7('0xe')],'public'));}if(_0x163b10==='development'||_0x163b10===_0x7bd7('0xf')){_0x59dbae[_0x7bd7('0xb')](_0x7bd7('0xc'),path[_0x7bd7('0xd')](config[_0x7bd7('0xe')],_0x7bd7('0x10')));_0x59dbae[_0x7bd7('0x11')](errorHandler());}_0x59dbae[_0x7bd7('0xb')](_0x7bd7('0x12'),function(_0x541b0c,_0x41ca62){if(this[_0x541b0c]instanceof Date){_0x41ca62=this[_0x541b0c][_0x7bd7('0x13')]()['split']('.')[0x0]+'Z';}return _0x41ca62;});_0x59dbae[_0x7bd7('0x11')](express[_0x7bd7('0x14')](_0x59dbae['get']('appPath')));_0x59dbae[_0x7bd7('0xb')](_0x7bd7('0x15'),config[_0x7bd7('0xe')]+_0x7bd7('0x16'));_0x59dbae[_0x7bd7('0x17')](_0x7bd7('0x18'),require(_0x7bd7('0x19'))[_0x7bd7('0x1a')]);_0x59dbae['set'](_0x7bd7('0x1b'),_0x7bd7('0x18'));_0x59dbae[_0x7bd7('0x11')](bodyParser[_0x7bd7('0x1c')]({'limit':_0x7bd7('0x1d'),'extended':!![]}));_0x59dbae[_0x7bd7('0x11')](bodyParser['json']({'limit':_0x7bd7('0x1d')}));_0x59dbae['use'](cors());_0x59dbae[_0x7bd7('0x11')](methodOverride());_0x59dbae[_0x7bd7('0x11')](cookieParser());_0x59dbae['use'](passport[_0x7bd7('0x1e')]());};
\ No newline at end of file
+var _0x25e7=['../mysqldb','default','production','appPath','join','root','public','development','set','client','json\x20replacer','split','static','get','views','html','ejs','use','urlencoded','50mb','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment'];(function(_0x585f3e,_0x39967d){var _0x4847db=function(_0x41a05b){while(--_0x41a05b){_0x585f3e['push'](_0x585f3e['shift']());}};_0x4847db(++_0x39967d);}(_0x25e7,0x72));var _0x725e=function(_0x35f3c9,_0x1aaafe){_0x35f3c9=_0x35f3c9-0x0;var _0x483f61=_0x25e7[_0x35f3c9];return _0x483f61;};'use strict';var express=require(_0x725e('0x0'));var favicon=require(_0x725e('0x1'));var bodyParser=require(_0x725e('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x725e('0x3'));var errorHandler=require(_0x725e('0x4'));var path=require(_0x725e('0x5'));var passport=require(_0x725e('0x6'));var cors=require(_0x725e('0x7'));var moment=require(_0x725e('0x8'));var config=require(_0x725e('0x9'));var db=require(_0x725e('0xa'))['db'];exports[_0x725e('0xb')]=function(_0x5e3717){var _0x153508=_0x5e3717['get']('env');if(_0x153508===_0x725e('0xc')){_0x5e3717['set'](_0x725e('0xd'),path[_0x725e('0xe')](config[_0x725e('0xf')],_0x725e('0x10')));}if(_0x153508===_0x725e('0x11')||_0x153508==='test'){_0x5e3717[_0x725e('0x12')](_0x725e('0xd'),path[_0x725e('0xe')](config['root'],_0x725e('0x13')));_0x5e3717['use'](errorHandler());}_0x5e3717[_0x725e('0x12')](_0x725e('0x14'),function(_0x131d82,_0x1b93ee){if(this[_0x131d82]instanceof Date){_0x1b93ee=this[_0x131d82]['toISOString']()[_0x725e('0x15')]('.')[0x0]+'Z';}return _0x1b93ee;});_0x5e3717['use'](express[_0x725e('0x16')](_0x5e3717[_0x725e('0x17')](_0x725e('0xd'))));_0x5e3717[_0x725e('0x12')](_0x725e('0x18'),config[_0x725e('0xf')]+'/server/views');_0x5e3717['engine'](_0x725e('0x19'),require(_0x725e('0x1a'))['renderFile']);_0x5e3717[_0x725e('0x12')]('view\x20engine','html');_0x5e3717[_0x725e('0x1b')](bodyParser[_0x725e('0x1c')]({'limit':_0x725e('0x1d'),'extended':!![]}));_0x5e3717[_0x725e('0x1b')](bodyParser['json']({'limit':'50mb'}));_0x5e3717[_0x725e('0x1b')](cors());_0x5e3717['use'](methodOverride());_0x5e3717['use'](cookieParser());_0x5e3717[_0x725e('0x1b')](passport[_0x725e('0x1e')]());};
\ No newline at end of file
index a44662c..3589572 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34a9=['createHash','md5','update','digest','hex','getUuid','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','crypto','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','IPv4','concat','mac','00:00:00:00:00:00','address','getFirstInterface','cpus','join'];(function(_0x225635,_0x54adc5){var _0x10f024=function(_0x2fab20){while(--_0x2fab20){_0x225635['push'](_0x225635['shift']());}};_0x10f024(++_0x54adc5);}(_0x34a9,0xef));var _0x934a=function(_0x471d88,_0x249179){_0x471d88=_0x471d88-0x0;var _0x31029a=_0x34a9[_0x471d88];return _0x31029a;};'use strict';var _=require(_0x934a('0x0'));var os=require('os');var crypto=require(_0x934a('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x934a('0x2'))[_0x934a('0x3')];var config=require('../environment');function getInterfaces(){var _0x180501=[];var _0x38077e=os[_0x934a('0x4')]();var _0x4f6658=_[_0x934a('0x5')](_[_0x934a('0x6')](_0x38077e));for(var _0x3b9be9=0x0;_0x3b9be9<_0x4f6658[_0x934a('0x7')];_0x3b9be9++){var _0x3cd348=_0x38077e[_0x4f6658[_0x3b9be9]][_0x934a('0x8')](function(_0x5b23aa){return _0x5b23aa['family']===_0x934a('0x9')&&_0x5b23aa['internal']===![];});_0x180501=_0x180501[_0x934a('0xa')](_0x3cd348);}return _0x180501;}function getFirstInterface(){var _0x5d2cdb=_['head'](getInterfaces());return{'macAddress':_0x5d2cdb&&_0x5d2cdb[_0x934a('0xb')]?_0x5d2cdb[_0x934a('0xb')]:_0x934a('0xc'),'ipAddress':_0x5d2cdb&&_0x5d2cdb[_0x934a('0xd')]?_0x5d2cdb[_0x934a('0xd')]:'127.0.0.1'};}exports[_0x934a('0xe')]=getFirstInterface;function getCPUhash(){var _0x2b158b=_[_0x934a('0x5')](os[_0x934a('0xf')]()['map'](function(_0x15e9d6){return _0x15e9d6['model'];}))[_0x934a('0x10')](':');return crypto[_0x934a('0x11')](_0x934a('0x12'))[_0x934a('0x13')](_0x2b158b)[_0x934a('0x14')](_0x934a('0x15'));}exports[_0x934a('0x16')]=function(){var _0xf41e0c=os['platform']();var _0x4ebb73=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x4ebb73[_0x934a('0x17')](config['licenseToken'])){return config[_0x934a('0x18')];}else if(_0xf41e0c===_0x934a('0x19')){return exec(_0x934a('0x1a'),{'encoding':_0x934a('0x1b')})['replace']('\x0d\x0a','');}else{var _0x18f83b=getFirstInterface();var _0x4bd71f=getCPUhash();var _0x57d998=_0x4bd71f+'|'+os[_0x934a('0x1c')]()+'|'+_0x18f83b[_0x934a('0x1d')]+'|'+_0x18f83b[_0x934a('0x1e')];var _0x59ac57=crypto[_0x934a('0x11')]('md5')['update'](_0x57d998)[_0x934a('0x14')](_0x934a('0x15'));return _0x59ac57['substring'](0x0,0x8)+'-'+_0x59ac57[_0x934a('0x1f')](0x8,0xc)+'-'+_0x59ac57[_0x934a('0x1f')](0xc,0x10)+'-'+_0x59ac57[_0x934a('0x1f')](0x10,0x14)+'-'+_0x59ac57[_0x934a('0x1f')](0x14);}};
\ No newline at end of file
+var _0x11ef=['win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','platform','licenseToken','test'];(function(_0x513f04,_0x979225){var _0x4498f2=function(_0x462429){while(--_0x462429){_0x513f04['push'](_0x513f04['shift']());}};_0x4498f2(++_0x979225);}(_0x11ef,0xda));var _0xf11e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x11ef[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0xf11e('0x0'));var os=require('os');var crypto=require(_0xf11e('0x1'));var machine=require(_0xf11e('0x2'));var exec=require(_0xf11e('0x3'))['execSync'];var config=require(_0xf11e('0x4'));function getInterfaces(){var _0x325d3e=[];var _0x1407e7=os[_0xf11e('0x5')]();var _0x171b40=_[_0xf11e('0x6')](_[_0xf11e('0x7')](_0x1407e7));for(var _0xdc4f0b=0x0;_0xdc4f0b<_0x171b40[_0xf11e('0x8')];_0xdc4f0b++){var _0x4814d9=_0x1407e7[_0x171b40[_0xdc4f0b]][_0xf11e('0x9')](function(_0x397ef4){return _0x397ef4['family']===_0xf11e('0xa')&&_0x397ef4[_0xf11e('0xb')]===![];});_0x325d3e=_0x325d3e[_0xf11e('0xc')](_0x4814d9);}return _0x325d3e;}function getFirstInterface(){var _0x1b6f6f=_[_0xf11e('0xd')](getInterfaces());return{'macAddress':_0x1b6f6f&&_0x1b6f6f[_0xf11e('0xe')]?_0x1b6f6f[_0xf11e('0xe')]:_0xf11e('0xf'),'ipAddress':_0x1b6f6f&&_0x1b6f6f[_0xf11e('0x10')]?_0x1b6f6f['address']:_0xf11e('0x11')};}exports[_0xf11e('0x12')]=getFirstInterface;function getCPUhash(){var _0x24ddd1=_[_0xf11e('0x6')](os['cpus']()['map'](function(_0x42692f){return _0x42692f[_0xf11e('0x13')];}))[_0xf11e('0x14')](':');return crypto[_0xf11e('0x15')](_0xf11e('0x16'))[_0xf11e('0x17')](_0x24ddd1)['digest']('hex');}exports['getUuid']=function(){var _0x5f30eb=os[_0xf11e('0x18')]();var _0x14fefc=/[0-9a-f-]{36}/;if(config[_0xf11e('0x19')]&&_0x14fefc[_0xf11e('0x1a')](config['licenseToken'])){return config[_0xf11e('0x19')];}else if(_0x5f30eb===_0xf11e('0x1b')){return exec(_0xf11e('0x1c'),{'encoding':_0xf11e('0x1d')})[_0xf11e('0x1e')]('\x0d\x0a','');}else{var _0x2ab96c=getFirstInterface();var _0x19e105=getCPUhash();var _0xef3007=_0x19e105+'|'+os[_0xf11e('0x1f')]()+'|'+_0x2ab96c[_0xf11e('0x20')]+'|'+_0x2ab96c['ipAddress'];var _0x44b6ef=crypto[_0xf11e('0x15')](_0xf11e('0x16'))['update'](_0xef3007)['digest'](_0xf11e('0x21'));return _0x44b6ef[_0xf11e('0x22')](0x0,0x8)+'-'+_0x44b6ef[_0xf11e('0x22')](0x8,0xc)+'-'+_0x44b6ef[_0xf11e('0x22')](0xc,0x10)+'-'+_0x44b6ef['substring'](0x10,0x14)+'-'+_0x44b6ef[_0xf11e('0x22')](0x14);}};
\ No newline at end of file
index a58995e..fd7118d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3f8=['https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','catch','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xc3f8,0x1a4));var _0x8c3f=function(_0x4b257a,_0x4934ae){_0x4b257a=_0x4b257a-0x0;var _0x1537a7=_0xc3f8[_0x4b257a];return _0x1537a7;};'use strict';var util=require(_0x8c3f('0x0'));var moment=require(_0x8c3f('0x1'));var rp=require('request-promise');var BPromise=require(_0x8c3f('0x2'));var pkginfo=require(_0x8c3f('0x3'))(module,_0x8c3f('0x4'));var db=require(_0x8c3f('0x5'))['db'];var encryptor=require(_0x8c3f('0x6'));var hardware=require(_0x8c3f('0x7'));var logger=require(_0x8c3f('0x8'))(_0x8c3f('0x9'));var HOST=_0x8c3f('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xb26ebd){return new BPromise(function(_0x1c2186,_0x268b19){var _0x2b6992=util['format'](_0x8c3f('0xb'),HOST,_0xb26ebd,module['exports'][_0x8c3f('0x4')]);if(oldToken){_0x2b6992=util[_0x8c3f('0xc')](_0x8c3f('0xd'),HOST,_0xb26ebd,module[_0x8c3f('0xe')][_0x8c3f('0x4')],oldToken);}var _0x36044e={'uri':_0x2b6992,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x36044e)[_0x8c3f('0xf')](function(_0x1bc3d5){_0x1c2186(_0x1bc3d5);})[_0x8c3f('0x10')](function(_0x265aa5){_0x268b19(_0x265aa5);});});}function manageLicense(_0x247661,_0x3e5363){var _0x449cf7=_0x3e5363['get']({'plain':!![]});if(!isOldTokenSent&&_0x449cf7['data1']!==_0x247661&&!_0x449cf7[_0x8c3f('0x11')]){oldToken=_0x449cf7[_0x8c3f('0x12')];}httpRequest(_0x247661)[_0x8c3f('0xf')](function(_0x3c6e03){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3c6e03[_0x8c3f('0x13')]){isOldTokenSent=![];if(!_0x449cf7[_0x8c3f('0x9')]&&_0x449cf7['license']!=_0x3c6e03[_0x8c3f('0x9')]||_0x449cf7[_0x8c3f('0x9')]&&_0x449cf7[_0x8c3f('0x11')]){logger[_0x8c3f('0x14')](_0x8c3f('0x15'));}if(_0x449cf7[_0x8c3f('0x9')]&&!_0x449cf7[_0x8c3f('0x11')]&&_0x449cf7[_0x8c3f('0x9')]!=_0x3c6e03['license']){logger[_0x8c3f('0x14')](_0x8c3f('0x16'));}if(_0x449cf7['license']&&!_0x449cf7[_0x8c3f('0x11')]&&_0x449cf7[_0x8c3f('0x9')]==_0x3c6e03[_0x8c3f('0x9')]){return _0x3e5363;}return _0x3e5363[_0x8c3f('0x17')]({'data1':_0x247661,'data2':null,'license':_0x3c6e03['license']});}else{if(_0x3c6e03['license']||_0x449cf7[_0x8c3f('0x9')]){if(!_0x449cf7[_0x8c3f('0x11')]){if(_0x449cf7['data1']==_0x247661){GRAY_PERIOD_REASON=_0x8c3f('0x18');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x8c3f('0x19');logger[_0x8c3f('0x14')](_0x8c3f('0x1a'),_0x449cf7[_0x8c3f('0x12')],_0x247661);}logger[_0x8c3f('0x14')](_0x8c3f('0x1b'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x8c3f('0x1c')));return _0x3e5363[_0x8c3f('0x17')]({'data2':encryptor[_0x8c3f('0x1d')](moment()[_0x8c3f('0xc')](_0x8c3f('0x1c')))});}else{if(moment()[_0x8c3f('0x1e')](encryptor[_0x8c3f('0x1f')](_0x449cf7[_0x8c3f('0x11')]),_0x8c3f('0x20'))>DAYS){logger[_0x8c3f('0x14')](_0x8c3f('0x21'),moment()['format'](_0x8c3f('0x1c')));isOldTokenSent=![];return _0x3e5363[_0x8c3f('0x17')]({'data1':_0x247661,'data2':null,'license':null});}}}else{if(_0x449cf7[_0x8c3f('0x12')]!=_0x247661){logger['info'](_0x8c3f('0x1a'),_0x449cf7['data1'],_0x247661);return _0x3e5363[_0x8c3f('0x17')]({'data1':_0x247661,'data2':null,'license':null});}}}return _0x3e5363;})[_0x8c3f('0xf')](function(_0x1281a4){_0x3e5363=_0x1281a4;})['catch'](function(_0x33dad6){logger[_0x8c3f('0x22')](_0x33dad6[_0x8c3f('0x23')]);})[_0x8c3f('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x8c3f('0x25')](),_0x3e5363);},TIME);});}function defaultLicense(){var _0x385afc=hardware[_0x8c3f('0x25')]();if(_0x385afc){return db[_0x8c3f('0x26')][_0x8c3f('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x385afc}})[_0x8c3f('0x28')](function(_0x207abe,_0xf6d4be){logger['info'](_0x8c3f('0x29'),_0x385afc);manageLicense(_0x385afc,_0x207abe);})['catch'](function(_0x2389aa){logger[_0x8c3f('0x22')](_0x2389aa['message']);});}}exports[_0x8c3f('0x2a')]=defaultLicense;
\ No newline at end of file
+var _0x7475=['util','request-promise','bluebird','pkginfo','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','version','exports','GET','catch','get','data2','data1','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default'];(function(_0x2ebacc,_0xdc5ab3){var _0x44e8ad=function(_0x300190){while(--_0x300190){_0x2ebacc['push'](_0x2ebacc['shift']());}};_0x44e8ad(++_0xdc5ab3);}(_0x7475,0x190));var _0x5747=function(_0x13f93d,_0xfda5c){_0x13f93d=_0x13f93d-0x0;var _0x1908cc=_0x7475[_0x13f93d];return _0x1908cc;};'use strict';var util=require(_0x5747('0x0'));var moment=require('moment');var rp=require(_0x5747('0x1'));var BPromise=require(_0x5747('0x2'));var pkginfo=require(_0x5747('0x3'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x5747('0x4'));var hardware=require(_0x5747('0x5'));var logger=require(_0x5747('0x6'))(_0x5747('0x7'));var HOST=_0x5747('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2d6cca){return new BPromise(function(_0x219b09,_0x126644){var _0x125fd9=util[_0x5747('0x9')](_0x5747('0xa'),HOST,_0x2d6cca,module['exports'][_0x5747('0xb')]);if(oldToken){_0x125fd9=util[_0x5747('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2d6cca,module[_0x5747('0xc')][_0x5747('0xb')],oldToken);}var _0x565d5f={'uri':_0x125fd9,'method':_0x5747('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x565d5f)['then'](function(_0x554e78){_0x219b09(_0x554e78);})[_0x5747('0xe')](function(_0x10401c){_0x126644(_0x10401c);});});}function manageLicense(_0x34993e,_0x290a0a){var _0x8b9db1=_0x290a0a[_0x5747('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x8b9db1['data1']!==_0x34993e&&!_0x8b9db1[_0x5747('0x10')]){oldToken=_0x8b9db1[_0x5747('0x11')];}httpRequest(_0x34993e)[_0x5747('0x12')](function(_0x431c5f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x431c5f[_0x5747('0x13')]){isOldTokenSent=![];if(!_0x8b9db1[_0x5747('0x7')]&&_0x8b9db1[_0x5747('0x7')]!=_0x431c5f[_0x5747('0x7')]||_0x8b9db1[_0x5747('0x7')]&&_0x8b9db1[_0x5747('0x10')]){logger['info'](_0x5747('0x14'));}if(_0x8b9db1[_0x5747('0x7')]&&!_0x8b9db1['data2']&&_0x8b9db1[_0x5747('0x7')]!=_0x431c5f[_0x5747('0x7')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x8b9db1['license']&&!_0x8b9db1[_0x5747('0x10')]&&_0x8b9db1['license']==_0x431c5f[_0x5747('0x7')]){return _0x290a0a;}return _0x290a0a[_0x5747('0x15')]({'data1':_0x34993e,'data2':null,'license':_0x431c5f[_0x5747('0x7')]});}else{if(_0x431c5f[_0x5747('0x7')]||_0x8b9db1['license']){if(!_0x8b9db1['data2']){if(_0x8b9db1[_0x5747('0x11')]==_0x34993e){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x5747('0x16');logger[_0x5747('0x17')](_0x5747('0x18'),_0x8b9db1[_0x5747('0x11')],_0x34993e);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x5747('0x19')](),moment()[_0x5747('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x290a0a[_0x5747('0x15')]({'data2':encryptor[_0x5747('0x1a')](moment()[_0x5747('0x9')](_0x5747('0x1b')))});}else{if(moment()[_0x5747('0x1c')](encryptor[_0x5747('0x1d')](_0x8b9db1[_0x5747('0x10')]),'days')>DAYS){logger[_0x5747('0x17')](_0x5747('0x1e'),moment()['format'](_0x5747('0x1b')));isOldTokenSent=![];return _0x290a0a[_0x5747('0x15')]({'data1':_0x34993e,'data2':null,'license':null});}}}else{if(_0x8b9db1[_0x5747('0x11')]!=_0x34993e){logger['info'](_0x5747('0x18'),_0x8b9db1[_0x5747('0x11')],_0x34993e);return _0x290a0a[_0x5747('0x15')]({'data1':_0x34993e,'data2':null,'license':null});}}}return _0x290a0a;})[_0x5747('0x12')](function(_0xbb2343){_0x290a0a=_0xbb2343;})[_0x5747('0xe')](function(_0xbfb30){logger[_0x5747('0x1f')](_0xbfb30['message']);})[_0x5747('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x5747('0x21')](),_0x290a0a);},TIME);});}function defaultLicense(){var _0x1529ea=hardware[_0x5747('0x21')]();if(_0x1529ea){return db[_0x5747('0x22')][_0x5747('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x1529ea}})[_0x5747('0x24')](function(_0x540a0c,_0x1d42aa){logger[_0x5747('0x17')](_0x5747('0x25'),_0x1529ea);manageLicense(_0x1529ea,_0x540a0c);})['catch'](function(_0x51e1a5){logger[_0x5747('0x1f')](_0x51e1a5[_0x5747('0x26')]);});}}exports[_0x5747('0x27')]=defaultLicense;
\ No newline at end of file
index 4386eb9..eb13f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67bc=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','License','find','then','catch','uuid','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','format','%s:%s:%s','demo','machineUuid','gray','deadline','days','grayReason','disabled','message','User','role','sequelize','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x67bc,0x1ba));var _0xc67b=function(_0x39db05,_0x3868d0){_0x39db05=_0x39db05-0x0;var _0x3f0e22=_0x67bc[_0x39db05];return _0x3f0e22;};'use strict';var util=require('util');var _=require(_0xc67b('0x0'));var moment=require(_0xc67b('0x1'));var BPromise=require(_0xc67b('0x2'));var hardware=require(_0xc67b('0x3'));var encryptor=require(_0xc67b('0x4'));var db=require(_0xc67b('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':_0xc67b('0x6'),'machineUuid':hardware[_0xc67b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc67b('0x8'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xc67b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x145c46){return new BPromise(function(_0x728ed8,_0x32f7b9){return db[_0xc67b('0x9')][_0xc67b('0xa')](_['defaults'](_0x145c46,{'raw':!![],'where':{'id':0x1}}))[_0xc67b('0xb')](function(_0x4a73cd){return checkLicense(_0x4a73cd,null);})[_0xc67b('0xb')](function(_0x34f58e){_0x728ed8(_0x34f58e);return;})[_0xc67b('0xc')](function(_0x44eac2){_0x32f7b9(_0x44eac2);});});}function checkLicense(_0x3f6bbd,_0x20c5cb){if(!_0x3f6bbd){demoLicense[_0xc67b('0xd')]=_0x3f6bbd['data1'];return demoLicense;}try{var _0x387cb1=_0x20c5cb||_0x3f6bbd['license'];if(_[_0xc67b('0xe')](_0x387cb1)){throw new Error(_0xc67b('0xf'));}var _0x5a2d05=_0x3f6bbd[_0xc67b('0x10')];var _0x5c3158=_0x3f6bbd[_0xc67b('0x11')];var _0x3c0615=_0x5a2d05[_0xc67b('0x12')]('-')[0x4];var _0x1fde67=_0x5a2d05[_0xc67b('0x12')]('-')[0x0];var _0x19b250=encryptor['decryptString'](_0x387cb1,util[_0xc67b('0x13')](_0xc67b('0x14'),_0x3c0615,_0x5a2d05,_0x1fde67));var _0x454664=JSON['parse'](_0x19b250);_0x454664[_0xc67b('0x15')]=![];_0x454664[_0xc67b('0xd')]=_0x5a2d05;_0x454664[_0xc67b('0x16')]=hardware['getUuid']();if(_0x5c3158){var _0x3ddf95=encryptor['decryptString'](_0x5c3158);_0x454664[_0xc67b('0x17')]=_0x3ddf95;_0x454664[_0xc67b('0x18')]=moment(_0x3ddf95)['add'](0x7,_0xc67b('0x19'))[_0xc67b('0x13')]();_0x454664[_0xc67b('0x1a')]=_0x454664[_0xc67b('0xd')]!=_0x454664[_0xc67b('0x16')]?'changed':_0xc67b('0x1b');}return _0x454664;}catch(_0x4e4216){breakingLicense[_0xc67b('0xd')]=_0x3f6bbd[_0xc67b('0x10')];breakingLicense[_0xc67b('0x1c')]=_0x4e4216['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xd7c170,_0x2acd4d){getLicense()[_0xc67b('0xb')](function(_0x2c09a1){return db[_0xc67b('0x1d')]['findAll']({'attributes':[_0xc67b('0x1e'),[db[_0xc67b('0x1f')]['fn']('COUNT',db[_0xc67b('0x1f')][_0xc67b('0x20')](_0xc67b('0x1e'))),_0xc67b('0x21')]],'group':_0xc67b('0x1e'),'where':{'role':{'$or':[_0xc67b('0x22'),_0xc67b('0x23'),_0xc67b('0x24')]}},'raw':!![]})[_0xc67b('0xb')](function(_0x1638ea){var _0x13336d={'user':_0x2c09a1[_0xc67b('0x25')]||0x0,'telephone':_0x2c09a1[_0xc67b('0x26')]||0x0};_0x1638ea[_0xc67b('0x27')](function(_0x1f30d8){var _0x486331=_0x1f30d8[_0xc67b('0x1e')]===_0xc67b('0x22')?'user':_0x1f30d8['role'];_0x13336d[_0x486331]-=_0x1f30d8[_0xc67b('0x21')];if(_0x13336d[_0x486331]<0x0)_0x13336d[_0x486331]=0x0;});_0xd7c170(_0x13336d);return;});})[_0xc67b('0xc')](function(_0x84364e){_0x2acd4d(_0x84364e);});});}function checkUserLimits(_0x11a666){return new BPromise(function(_0x3541b8,_0x51b625){getLimits()[_0xc67b('0xb')](function(_0x5e1dfc){var _0x4a185f=_[_0xc67b('0x28')](_[_0xc67b('0x29')](_0x11a666,'role'),[_0xc67b('0x22'),'user',_0xc67b('0x24')]);var _0x554fdb=(_0x4a185f[_0xc67b('0x22')]||0x0)+(_0x4a185f[_0xc67b('0x23')]||0x0);var _0x15e87a=_0x4a185f[_0xc67b('0x24')]||0x0;if(_0x554fdb>_0x5e1dfc['user'])return _0x51b625(_0xc67b('0x2a'));if(_0x15e87a>_0x5e1dfc[_0xc67b('0x24')])return _0x51b625(_0xc67b('0x2b'));return _0x3541b8();})['catch'](function(_0x41f9d1){_0x51b625(_0x41f9d1);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xdaf2=['count','admin','user','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','gray','deadline','add','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','col'];(function(_0x5575c1,_0x11b31a){var _0x50ea4e=function(_0x225d89){while(--_0x225d89){_0x5575c1['push'](_0x5575c1['shift']());}};_0x50ea4e(++_0x11b31a);}(_0xdaf2,0x122));var _0x2daf=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xdaf2[_0x10c51f];return _0x56a0cd;};'use strict';var util=require(_0x2daf('0x0'));var _=require(_0x2daf('0x1'));var moment=require(_0x2daf('0x2'));var BPromise=require('bluebird');var hardware=require(_0x2daf('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x2daf('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2daf('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2daf('0x6'),'machineUuid':hardware[_0x2daf('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2daf('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2daf('0x8'),'machineUuid':hardware[_0x2daf('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x25adbf){return new BPromise(function(_0xa4a2d8,_0xb55cf3){return db['License'][_0x2daf('0x9')](_[_0x2daf('0xa')](_0x25adbf,{'raw':!![],'where':{'id':0x1}}))[_0x2daf('0xb')](function(_0x4991cc){return checkLicense(_0x4991cc,null);})[_0x2daf('0xb')](function(_0x521b14){_0xa4a2d8(_0x521b14);return;})[_0x2daf('0xc')](function(_0x251685){_0xb55cf3(_0x251685);});});}function checkLicense(_0x3ef607,_0x4e0fa7){if(!_0x3ef607){demoLicense['uuid']=_0x3ef607[_0x2daf('0xd')];return demoLicense;}try{var _0x909560=_0x4e0fa7||_0x3ef607[_0x2daf('0xe')];if(_[_0x2daf('0xf')](_0x909560)){throw new Error(_0x2daf('0x10'));}var _0x44dde2=_0x3ef607['data1'];var _0x1747b5=_0x3ef607[_0x2daf('0x11')];var _0x30b4a5=_0x44dde2['split']('-')[0x4];var _0x270640=_0x44dde2[_0x2daf('0x12')]('-')[0x0];var _0x58d467=encryptor[_0x2daf('0x13')](_0x909560,util[_0x2daf('0x14')](_0x2daf('0x15'),_0x30b4a5,_0x44dde2,_0x270640));var _0x100a74=JSON[_0x2daf('0x16')](_0x58d467);_0x100a74[_0x2daf('0x17')]=![];_0x100a74[_0x2daf('0x18')]=_0x44dde2;_0x100a74[_0x2daf('0x19')]=hardware['getUuid']();if(_0x1747b5){var _0x34ecc6=encryptor[_0x2daf('0x13')](_0x1747b5);_0x100a74[_0x2daf('0x1a')]=_0x34ecc6;_0x100a74[_0x2daf('0x1b')]=moment(_0x34ecc6)[_0x2daf('0x1c')](0x7,'days')['format']();_0x100a74[_0x2daf('0x1d')]=_0x100a74[_0x2daf('0x18')]!=_0x100a74['machineUuid']?_0x2daf('0x1e'):_0x2daf('0x1f');}return _0x100a74;}catch(_0xe61f23){breakingLicense['uuid']=_0x3ef607['data1'];breakingLicense['message']=_0xe61f23[_0x2daf('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xd5a58d,_0x5b0101){getLicense()[_0x2daf('0xb')](function(_0x45d50b){return db[_0x2daf('0x21')][_0x2daf('0x22')]({'attributes':[_0x2daf('0x23'),[db[_0x2daf('0x24')]['fn'](_0x2daf('0x25'),db['sequelize'][_0x2daf('0x26')]('role')),_0x2daf('0x27')]],'group':'role','where':{'role':{'$or':[_0x2daf('0x28'),'user','telephone']}},'raw':!![]})[_0x2daf('0xb')](function(_0x4fa46c){var _0x5403d1={'user':_0x45d50b['users']||0x0,'telephone':_0x45d50b['telephones']||0x0};_0x4fa46c['forEach'](function(_0xcfed7e){var _0x253401=_0xcfed7e['role']==='admin'?_0x2daf('0x29'):_0xcfed7e['role'];_0x5403d1[_0x253401]-=_0xcfed7e[_0x2daf('0x27')];if(_0x5403d1[_0x253401]<0x0)_0x5403d1[_0x253401]=0x0;});_0xd5a58d(_0x5403d1);return;});})[_0x2daf('0xc')](function(_0x4a199a){_0x5b0101(_0x4a199a);});});}function checkUserLimits(_0x53999a){return new BPromise(function(_0x15c773,_0x183728){getLimits()[_0x2daf('0xb')](function(_0x567f98){var _0x4b224b=_[_0x2daf('0x2a')](_['countBy'](_0x53999a,_0x2daf('0x23')),['admin','user',_0x2daf('0x2b')]);var _0x3d091a=(_0x4b224b[_0x2daf('0x28')]||0x0)+(_0x4b224b['user']||0x0);var _0x24b689=_0x4b224b['telephone']||0x0;if(_0x3d091a>_0x567f98[_0x2daf('0x29')])return _0x183728(_0x2daf('0x2c'));if(_0x24b689>_0x567f98[_0x2daf('0x2b')])return _0x183728(_0x2daf('0x2d'));return _0x15c773();})[_0x2daf('0xc')](function(_0x5a2f65){_0x183728(_0x5a2f65);});});}module[_0x2daf('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index b51de08..c1c71ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x3d3247,_0x3aecb9){var _0xa5e8b7=function(_0x5a3622){while(--_0x5a3622){_0x3d3247['push'](_0x3d3247['shift']());}};_0xa5e8b7(++_0x3aecb9);}(_0xea28,0x13a));var _0x8ea2=function(_0x582b26,_0x52cd0e){_0x582b26=_0x582b26-0x0;var _0x2a09a6=_0xea28[_0x582b26];return _0x2a09a6;};'use strict';module[_0x8ea2('0x0')]={'DOMAIN':_0x8ea2('0x1'),'SESSION_SECRET':_0x8ea2('0x2'),'GOOGLE_ID':_0x8ea2('0x3'),'GOOGLE_SECRET':_0x8ea2('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0x3266=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x54e33f,_0x286c6d){var _0x56eba7=function(_0xb53535){while(--_0xb53535){_0x54e33f['push'](_0x54e33f['shift']());}};_0x56eba7(++_0x286c6d);}(_0x3266,0x6a));var _0x6326=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x3266[_0x1ab180];return _0xfb2c2d;};'use strict';module[_0x6326('0x0')]={'DOMAIN':_0x6326('0x1'),'SESSION_SECRET':_0x6326('0x2'),'GOOGLE_ID':_0x6326('0x3'),'GOOGLE_SECRET':_0x6326('0x4'),'DEBUG':''};
\ No newline at end of file
index 8e0d841..ad0f122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb69=['%s-%s.log','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','transports','error','File','%s-%s','info','env','debugLevel','moment','winston','util','path','join','/var','log','format'];(function(_0x43e3f3,_0x46e858){var _0x1450da=function(_0x5518bd){while(--_0x5518bd){_0x43e3f3['push'](_0x43e3f3['shift']());}};_0x1450da(++_0x46e858);}(_0xbb69,0x1a8));var _0x9bb6=function(_0x72f6cb,_0x2c0294){_0x72f6cb=_0x72f6cb-0x0;var _0x689e05=_0xbb69[_0x72f6cb];return _0x689e05;};'use strict';var moment=require(_0x9bb6('0x0'));var winston=require(_0x9bb6('0x1'));var util=require(_0x9bb6('0x2'));var path=require(_0x9bb6('0x3'));var debugLevel='INFO';function filename(_0x4ae797,_0x3fb1c7){return path[_0x9bb6('0x4')](_0x9bb6('0x5'),_0x9bb6('0x6'),'xcally',util[_0x9bb6('0x7')](_0x9bb6('0x8'),_0x4ae797,_0x3fb1c7));}function formatter(_0x47e03b,_0x36e3c3){_0x36e3c3['message']=_0x36e3c3['message'][_0x9bb6('0x9')](/@@{/g,_0x9bb6('0xa'))[_0x9bb6('0x9')](/}@@/g,'}}}')['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x9bb6('0x7')](_0x9bb6('0xb'),moment()[_0x9bb6('0x7')](_0x9bb6('0xc')),_0x36e3c3['level'][_0x9bb6('0xd')](),_0x47e03b,_0x36e3c3[_0x9bb6('0xe')]);}module[_0x9bb6('0xf')]=function(_0x5eb0ad){return new winston[(_0x9bb6('0x10'))]({'transports':[new winston[(_0x9bb6('0x11'))]['File']({'name':util['format']('%s-%s',_0x5eb0ad,_0x9bb6('0x12')),'filename':filename(_0x5eb0ad,_0x9bb6('0x12')),'level':_0x9bb6('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c5c49){return formatter(_0x5eb0ad,_0x4c5c49);}}),new winston[(_0x9bb6('0x11'))][(_0x9bb6('0x13'))]({'name':util['format'](_0x9bb6('0x14'),_0x5eb0ad,_0x9bb6('0x15')),'filename':filename(_0x5eb0ad,_0x9bb6('0x15')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2322f0){return formatter(_0x5eb0ad,_0x2322f0);}}),new winston['transports']['Console']({'level':process[_0x9bb6('0x16')][_0x9bb6('0x17')]||debugLevel,'json':![],'formatter':function(_0x31297a){return formatter(_0x5eb0ad,_0x31297a);}})]});};
\ No newline at end of file
+var _0xf760=['format','%s-%s.log','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','Logger','transports','%s-%s','error','File','info','env','debugLevel','moment','winston','util','INFO','join','/var','log'];(function(_0x4736ea,_0x9256c4){var _0x29ee17=function(_0x1e949b){while(--_0x1e949b){_0x4736ea['push'](_0x4736ea['shift']());}};_0x29ee17(++_0x9256c4);}(_0xf760,0x101));var _0x0f76=function(_0x389030,_0x1a931b){_0x389030=_0x389030-0x0;var _0x3597bb=_0xf760[_0x389030];return _0x3597bb;};'use strict';var moment=require(_0x0f76('0x0'));var winston=require(_0x0f76('0x1'));var util=require(_0x0f76('0x2'));var path=require('path');var debugLevel=_0x0f76('0x3');function filename(_0x8882de,_0x5444a0){return path[_0x0f76('0x4')](_0x0f76('0x5'),_0x0f76('0x6'),'xcally',util[_0x0f76('0x7')](_0x0f76('0x8'),_0x8882de,_0x5444a0));}function formatter(_0x5016fb,_0x3babd7){_0x3babd7[_0x0f76('0x9')]=_0x3babd7[_0x0f76('0x9')][_0x0f76('0xa')](/@@{/g,_0x0f76('0xb'))[_0x0f76('0xa')](/}@@/g,_0x0f76('0xc'))[_0x0f76('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x0f76('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x0f76('0x7')](_0x0f76('0xd')),_0x3babd7['level'][_0x0f76('0xe')](),_0x5016fb,_0x3babd7[_0x0f76('0x9')]);}module[_0x0f76('0xf')]=function(_0x1ee637){return new winston[(_0x0f76('0x10'))]({'transports':[new winston[(_0x0f76('0x11'))]['File']({'name':util[_0x0f76('0x7')](_0x0f76('0x12'),_0x1ee637,_0x0f76('0x13')),'filename':filename(_0x1ee637,_0x0f76('0x13')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x355343){return formatter(_0x1ee637,_0x355343);}}),new winston['transports'][(_0x0f76('0x14'))]({'name':util['format'](_0x0f76('0x12'),_0x1ee637,_0x0f76('0x15')),'filename':filename(_0x1ee637,_0x0f76('0x15')),'level':_0x0f76('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38c918){return formatter(_0x1ee637,_0x38c918);}}),new winston['transports']['Console']({'level':process[_0x0f76('0x16')][_0x0f76('0x17')]||debugLevel,'json':![],'formatter':function(_0x5945b1){return formatter(_0x1ee637,_0x5945b1);}})]});};
\ No newline at end of file
index 3ee4848..9248e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ef=['agi','../../services/agi/index.js','email','routing','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x42ef,0x1f2));var _0xf42e=function(_0x12b973,_0x218ab4){_0x12b973=_0x12b973-0x0;var _0xb30212=_0x42ef[_0x12b973];return _0xb30212;};'use strict';var path=require(_0xf42e('0x0'));var os=require('os');var config={'apps':[{'name':_0xf42e('0x1'),'script':path[_0xf42e('0x2')](__dirname,_0xf42e('0x3'))},{'name':_0xf42e('0x4'),'script':path[_0xf42e('0x2')](__dirname,_0xf42e('0x5'))},{'name':_0xf42e('0x6'),'script':path[_0xf42e('0x2')](__dirname,_0xf42e('0x7'))},{'name':_0xf42e('0x8'),'script':path[_0xf42e('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xf42e('0x9'),'script':path[_0xf42e('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0xf42e('0xa'))}]};module[_0xf42e('0xb')]=config;
\ No newline at end of file
+var _0xdf8f=['routing','../../services/routing/index.js','express','join','../../services/express/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js'];(function(_0x437e1c,_0x2795d6){var _0x2a48b4=function(_0x4ff34f){while(--_0x4ff34f){_0x437e1c['push'](_0x437e1c['shift']());}};_0x2a48b4(++_0x2795d6);}(_0xdf8f,0x1a0));var _0xfdf8=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xdf8f[_0x178e48];return _0x440d7e;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xfdf8('0x0'),'script':path[_0xfdf8('0x1')](__dirname,_0xfdf8('0x2'))},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0xfdf8('0x3'),'script':path['join'](__dirname,_0xfdf8('0x4'))},{'name':_0xfdf8('0x5'),'script':path['join'](__dirname,_0xfdf8('0x6'))},{'name':_0xfdf8('0x7'),'script':path[_0xfdf8('0x1')](__dirname,_0xfdf8('0x8'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module['exports']=config;
\ No newline at end of file
index 1071690..453c30b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbba9=['delete','dump','saved','pm2','bluebird','connected','start','disconnect','then','stop','restart','list','describe'];(function(_0x3e1021,_0x4b59c5){var _0x4488ef=function(_0x26bd33){while(--_0x26bd33){_0x3e1021['push'](_0x3e1021['shift']());}};_0x4488ef(++_0x4b59c5);}(_0xbba9,0x13b));var _0x9bba=function(_0x4ad9b0,_0x1055ee){_0x4ad9b0=_0x4ad9b0-0x0;var _0x57e458=_0xbba9[_0x4ad9b0];return _0x57e458;};'use strict';var pm2=require(_0x9bba('0x0'));var BPromise=require(_0x9bba('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x229b29,_0x3b78f2){return pm2['connect'](function(_0x427832){if(_0x427832){return _0x3b78f2(_0x427832);}return _0x229b29(_0x9bba('0x2'));});});};exports[_0x9bba('0x3')]=function(_0x5aa500){return connect()['then'](function(){return new BPromise(function(_0x3205d6,_0x14c46e){return pm2[_0x9bba('0x3')](_0x5aa500,function(_0x28548a,_0x386296){if(_0x28548a){return _0x14c46e(_0x28548a);}pm2[_0x9bba('0x4')]();return _0x3205d6(_0x386296);});});});};exports['stop']=function(_0x3f47a0){return connect()[_0x9bba('0x5')](function(){return new BPromise(function(_0x107106,_0x26efed){return pm2[_0x9bba('0x6')](_0x3f47a0,function(_0xf22968,_0x3f67c5){if(_0xf22968){return _0x26efed(_0xf22968);}pm2[_0x9bba('0x4')]();return _0x107106(_0x3f67c5);});});});};exports[_0x9bba('0x7')]=function(_0x20bd66){return connect()[_0x9bba('0x5')](function(){return new BPromise(function(_0x36bfba,_0x47112e){return pm2[_0x9bba('0x7')](_0x20bd66,function(_0x6960f2,_0x5a7449){if(_0x6960f2){return _0x47112e(_0x6960f2);}pm2['disconnect']();return _0x36bfba(_0x5a7449);});});});};exports[_0x9bba('0x8')]=function(){return connect()[_0x9bba('0x5')](function(){return new BPromise(function(_0x539d78,_0x58b242){return pm2[_0x9bba('0x8')](function(_0x197bef,_0x2a79c9){if(_0x197bef){return _0x58b242(_0x197bef);}pm2['disconnect']();return _0x539d78(_0x2a79c9);});});});};exports[_0x9bba('0x9')]=function(_0x938103){return connect()[_0x9bba('0x5')](function(){return new BPromise(function(_0x58c7bb,_0x307dd4){return pm2[_0x9bba('0x9')](_0x938103,function(_0x18ce0a,_0x49ad1d){if(_0x18ce0a){return _0x307dd4(_0x18ce0a);}pm2[_0x9bba('0x4')]();return _0x58c7bb(_0x49ad1d);});});});};exports['delete']=function(_0x4f4105){return connect()['then'](function(){return new BPromise(function(_0x2ea467,_0x1a2e18){return pm2[_0x9bba('0xa')](_0x4f4105,function(_0x4d5ee0,_0x502fe9){if(_0x4d5ee0){return _0x1a2e18(_0x4d5ee0);}pm2['disconnect']();return _0x2ea467(_0x502fe9);});});});};exports[_0x9bba('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0xff3cbf,_0x51c027){return pm2[_0x9bba('0xb')](function(_0x2f053a){if(_0x2f053a){return _0x51c027(_0x2f053a);}return _0xff3cbf(_0x9bba('0xc'));});});});};
\ No newline at end of file
+var _0xa068=['list','describe','delete','dump','pm2','bluebird','./config','connect','start','then','disconnect','restart'];(function(_0x428065,_0xf48298){var _0x3b8a85=function(_0x1f7329){while(--_0x1f7329){_0x428065['push'](_0x428065['shift']());}};_0x3b8a85(++_0xf48298);}(_0xa068,0x16c));var _0x8a06=function(_0x144419,_0xbc26ae){_0x144419=_0x144419-0x0;var _0x1b652c=_0xa068[_0x144419];return _0x1b652c;};'use strict';var pm2=require(_0x8a06('0x0'));var BPromise=require(_0x8a06('0x1'));var config=require(_0x8a06('0x2'));function connect(){return new BPromise(function(_0x3fdd0,_0x4e9317){return pm2[_0x8a06('0x3')](function(_0x579503){if(_0x579503){return _0x4e9317(_0x579503);}return _0x3fdd0('connected');});});};exports[_0x8a06('0x4')]=function(_0x61b9d1){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x464119,_0x58b42e){return pm2[_0x8a06('0x4')](_0x61b9d1,function(_0x1934dd,_0x44b637){if(_0x1934dd){return _0x58b42e(_0x1934dd);}pm2[_0x8a06('0x6')]();return _0x464119(_0x44b637);});});});};exports['stop']=function(_0x369763){return connect()['then'](function(){return new BPromise(function(_0x561e15,_0x32f42b){return pm2['stop'](_0x369763,function(_0x2aa966,_0x1fd1ca){if(_0x2aa966){return _0x32f42b(_0x2aa966);}pm2['disconnect']();return _0x561e15(_0x1fd1ca);});});});};exports[_0x8a06('0x7')]=function(_0x427971){return connect()['then'](function(){return new BPromise(function(_0x292fb6,_0x2be751){return pm2['restart'](_0x427971,function(_0x4e50f1,_0xf36e17){if(_0x4e50f1){return _0x2be751(_0x4e50f1);}pm2[_0x8a06('0x6')]();return _0x292fb6(_0xf36e17);});});});};exports[_0x8a06('0x8')]=function(){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x5bd114,_0x39e265){return pm2[_0x8a06('0x8')](function(_0x359a23,_0x3d3142){if(_0x359a23){return _0x39e265(_0x359a23);}pm2[_0x8a06('0x6')]();return _0x5bd114(_0x3d3142);});});});};exports[_0x8a06('0x9')]=function(_0x15873e){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x25dbfb,_0xe469bb){return pm2['describe'](_0x15873e,function(_0x3cc2ac,_0x47d699){if(_0x3cc2ac){return _0xe469bb(_0x3cc2ac);}pm2[_0x8a06('0x6')]();return _0x25dbfb(_0x47d699);});});});};exports[_0x8a06('0xa')]=function(_0x27e73e){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x2150c7,_0x1de61f){return pm2[_0x8a06('0xa')](_0x27e73e,function(_0x58b85c,_0x2ad72c){if(_0x58b85c){return _0x1de61f(_0x58b85c);}pm2[_0x8a06('0x6')]();return _0x2150c7(_0x2ad72c);});});});};exports[_0x8a06('0xb')]=function(){return connect()[_0x8a06('0x5')](function(){return new BPromise(function(_0x3cb237,_0x5ce5d2){return pm2['dump'](function(_0x5b868d){if(_0x5b868d){return _0x5ce5d2(_0x5b868d);}return _0x3cb237('saved');});});});};
\ No newline at end of file
index 0d38dc3..ecc91e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe914=['start','lodash','moment','ioredis','../../config/environment','../../mysqldb','schedule','redis','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','minutes','map','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x5602d4,_0x5a74f9){var _0x55e5ae=function(_0x184a4b){while(--_0x184a4b){_0x5602d4['push'](_0x5602d4['shift']());}};_0x55e5ae(++_0x5a74f9);}(_0xe914,0xfd));var _0x4e91=function(_0x69e89e,_0x1fb302){_0x69e89e=_0x69e89e-0x0;var _0x39b87d=_0xe914[_0x69e89e];return _0x39b87d;};'use strict';var _=require(_0x4e91('0x0'));var moment=require(_0x4e91('0x1'));var Redis=require(_0x4e91('0x2'));var util=require('util');var config=require(_0x4e91('0x3'));var db=require(_0x4e91('0x4'))['db'];var logger=require('../logger')(_0x4e91('0x5'));config[_0x4e91('0x6')]=_['defaults'](config[_0x4e91('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4e91('0x7'))(new Redis(config[_0x4e91('0x6')]));function closeInteractions(){var _0x39d5ff=0x0;var _0x44f70f=[];return db[_0x4e91('0x8')][_0x4e91('0x9')]({'raw':!![],'attributes':['id',_0x4e91('0xa')],'where':{'id':0x1}})[_0x4e91('0xb')](function(_0x200074){_0x39d5ff=_0x200074['chatTimeout'];if(_0x39d5ff){return db[_0x4e91('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x4e91('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x200074[_0x4e91('0xa')],_0x4e91('0xe'))}}});}else{return[];}})['then'](function(_0x2d502f){if(_0x2d502f&&_0x2d502f['length']){_0x44f70f=_[_0x4e91('0xf')](_0x2d502f||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x44f70f[_0x4e91('0x10')]());return db[_0x4e91('0xc')]['update']({'closeReason':'system','disposition':_0x4e91('0x11'),'closed':!![],'closedAt':moment()[_0x4e91('0x12')](_0x4e91('0x13'))},{'where':{'id':_0x44f70f}});}})[_0x4e91('0xb')](function(){if(_0x44f70f&&_0x44f70f[_0x4e91('0x14')]){logger[_0x4e91('0x15')](_0x4e91('0x16'),_0x44f70f[_0x4e91('0x10')]());for(var _0xd2887b=0x0;_0xd2887b<_0x44f70f[_0x4e91('0x14')];_0xd2887b++){io['emit']('chatInteraction:update',{'id':_0x44f70f[_0xd2887b],'closed':!![]});}}})[_0x4e91('0x17')](function(_0x38a15a){logger[_0x4e91('0x18')](_0x4e91('0x19'),_0x38a15a?util[_0x4e91('0x1a')](_0x38a15a,{'showHidden':![],'depth':null}):'');});}exports[_0x4e91('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x795f=['system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','length','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','map','[CHAT]\x20Interactions\x20to\x20close:','join','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x795f,0x1bd));var _0xf795=function(_0x96d8ca,_0x59b44c){_0x96d8ca=_0x96d8ca-0x0;var _0x44a49e=_0x795f[_0x96d8ca];return _0x44a49e;};'use strict';var _=require('lodash');var moment=require(_0xf795('0x0'));var Redis=require(_0xf795('0x1'));var util=require('util');var config=require(_0xf795('0x2'));var db=require(_0xf795('0x3'))['db'];var logger=require(_0xf795('0x4'))(_0xf795('0x5'));config[_0xf795('0x6')]=_[_0xf795('0x7')](config[_0xf795('0x6')],{'host':_0xf795('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf795('0x6')]));function closeInteractions(){var _0x5ce517=0x0;var _0x16d56f=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xf795('0x9')],'where':{'id':0x1}})[_0xf795('0xa')](function(_0x24894b){_0x5ce517=_0x24894b[_0xf795('0x9')];if(_0x5ce517){return db[_0xf795('0xb')][_0xf795('0xc')]({'raw':!![],'attributes':['id',_0xf795('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x24894b[_0xf795('0x9')],_0xf795('0xe'))}}});}else{return[];}})[_0xf795('0xa')](function(_0x1f7831){if(_0x1f7831&&_0x1f7831['length']){_0x16d56f=_[_0xf795('0xf')](_0x1f7831||[],'id');logger['info'](_0xf795('0x10'),_0x16d56f[_0xf795('0x11')]());return db['ChatInteraction'][_0xf795('0x12')]({'closeReason':_0xf795('0x13'),'disposition':_0xf795('0x14'),'closed':!![],'closedAt':moment()['format'](_0xf795('0x15'))},{'where':{'id':_0x16d56f}});}})['then'](function(){if(_0x16d56f&&_0x16d56f['length']){logger['info'](_0xf795('0x16'),_0x16d56f[_0xf795('0x11')]());for(var _0x2638df=0x0;_0x2638df<_0x16d56f[_0xf795('0x17')];_0x2638df++){io[_0xf795('0x18')]('chatInteraction:update',{'id':_0x16d56f[_0x2638df],'closed':!![]});}}})[_0xf795('0x19')](function(_0x4e823a){logger[_0xf795('0x1a')](_0xf795('0x1b'),_0x4e823a?util['inspect'](_0x4e823a,{'showHidden':![],'depth':null}):'');});}exports[_0xf795('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 8434250..2fc6519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10db=['bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','host','MailAccount','secure','user','pass','format','\x22%s\x22\x20<%s>','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','catch','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','difference','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','add','start','stop\x20cron','endAt','update','run','util','lodash','cron-job-manager','jayson/promise'];(function(_0x33e658,_0x5bebcc){var _0xd0e654=function(_0x2eed1f){while(--_0x2eed1f){_0x33e658['push'](_0x33e658['shift']());}};_0xd0e654(++_0x5bebcc);}(_0x10db,0x19b));var _0xb10d=function(_0x51f9d2,_0x112c9f){_0x51f9d2=_0x51f9d2-0x0;var _0x4b6f61=_0x10db[_0x51f9d2];return _0x4b6f61;};'use strict';var fs=require('fs');var util=require(_0xb10d('0x0'));var path=require('path');var _=require(_0xb10d('0x1'));var moment=require('moment');var CronJobManager=require(_0xb10d('0x2'));var jayson=require(_0xb10d('0x3'));var BPromise=require(_0xb10d('0x4'));var logger=require('../logger')(_0xb10d('0x5'));var db=require(_0xb10d('0x6'))['db'];var analyticCustomReportController=require(_0xb10d('0x7'));var analyticDefaultReportController=require(_0xb10d('0x8'));var client=jayson[_0xb10d('0x9')][_0xb10d('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x50281b,_0x93dff6){return function(){logger[_0xb10d('0xb')](_0xb10d('0xc'),_0x50281b[_0xb10d('0xd')]);var _0x171398=!![];var _0x4b5710={'tls':{'rejectUnauthorized':![]}};if(_0x50281b['MailAccount'][_0xb10d('0xe')]['service']){_0x4b5710[_0xb10d('0xf')]=_0x50281b['MailAccount'][_0xb10d('0xe')][_0xb10d('0xf')];}else{_0x4b5710[_0xb10d('0x10')]=_0x50281b[_0xb10d('0x11')]['Smtp'][_0xb10d('0x10')];_0x4b5710['port']=_0x50281b[_0xb10d('0x11')][_0xb10d('0xe')]['port'];_0x4b5710[_0xb10d('0x12')]=_0x50281b[_0xb10d('0x11')][_0xb10d('0xe')][_0xb10d('0x12')];}if(_0x50281b[_0xb10d('0x11')][_0xb10d('0xe')]['authentication']){_0x4b5710['auth']={'user':_0x50281b['MailAccount'][_0xb10d('0xe')][_0xb10d('0x13')],'pass':_0x50281b[_0xb10d('0x11')][_0xb10d('0xe')][_0xb10d('0x14')]};}var _0x59eee2={'account':_0x4b5710,'message':{'from':util[_0xb10d('0x15')](_0xb10d('0x16'),_0x50281b[_0xb10d('0x11')]['name'],_0x50281b[_0xb10d('0x11')][_0xb10d('0xd')]||_0x50281b['MailAccount'][_0xb10d('0xe')][_0xb10d('0x13')]),'to':_0x50281b[_0xb10d('0xd')],'cc':_0x50281b['cc'],'bcc':_0x50281b[_0xb10d('0x17')],'subject':util[_0xb10d('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x93dff6[_0xb10d('0x18')],_0x50281b[_0xb10d('0x19')],_0x50281b[_0xb10d('0x1a')])}};var _0x2fa831=path[_0xb10d('0x1b')](__dirname,_0xb10d('0x1c'));var _0x4de466=_0x93dff6[_0xb10d('0x1d')];var _0x151854=util[_0xb10d('0x15')](_0xb10d('0x1e'),path[_0xb10d('0x1f')](_0x93dff6[_0xb10d('0x1d')],path['extname'](_0x93dff6[_0xb10d('0x1d')])),_0xb10d('0x20'));var _0x311f4b=path[_0xb10d('0x1b')](_0x2fa831,_0x4de466);var _0x52e478=path['join'](_0x2fa831,_0x151854);if(fs[_0xb10d('0x21')](_0x311f4b)){_0x93dff6[_0xb10d('0x22')]=_0xb10d('0x23');_0x59eee2[_0xb10d('0x24')][_0xb10d('0x25')]=[{'filename':_0x4de466,'path':_0x311f4b}];_0x59eee2['message'][_0xb10d('0x26')]=util['format'](_0xb10d('0x27'),JSON[_0xb10d('0x28')](_0x93dff6,null,0x2));}else if(fs[_0xb10d('0x21')](_0x52e478)){_0x93dff6[_0xb10d('0x22')]=_0xb10d('0x23');_0x59eee2[_0xb10d('0x24')]['attachments']=[{'filename':_0x151854,'path':_0x52e478}];}else{_0x59eee2['message'][_0xb10d('0x26')]=_0xb10d('0x29');if(!_0x50281b['sendIfEmpty']){_0x171398=![];logger['info'](_0xb10d('0x2a'));}}if(_0x171398){return client[_0xb10d('0x2b')]('SendMail',_0x59eee2)[_0xb10d('0x2c')](function(_0x36d5aa){if(_0x36d5aa[_0xb10d('0x2d')]){return logger[_0xb10d('0x2d')](_0xb10d('0x2e'),JSON[_0xb10d('0x28')](_0x36d5aa));}return logger['info']('email\x20sent');})[_0xb10d('0x2f')](function(_0x1dc52c){return logger[_0xb10d('0x2d')](_0xb10d('0x2e'),JSON[_0xb10d('0x28')](_0x1dc52c));});}};}function handleError(){return function(_0x2d1fc2){return logger[_0xb10d('0x2d')](JSON[_0xb10d('0x28')](_0x2d1fc2));};}function handleResult(_0x1fce6e){return function(_0x3edc8c){logger['info']('data',JSON[_0xb10d('0x28')](_0x3edc8c));if(_0x1fce6e[_0xb10d('0x11')]&&_0x1fce6e[_0xb10d('0x11')]['Smtp']&&!_[_0xb10d('0x30')](_0x1fce6e['email'])){setTimeout(handleSendEmail(_0x1fce6e,_0x3edc8c),0x3c*0x3e8);}};}function handleJob(_0x4a09d7){return function(){try{if(_[_0xb10d('0x30')](_0x4a09d7[_0xb10d('0x19')])){return logger[_0xb10d('0xb')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xb10d('0x30')](_0x4a09d7[_0xb10d('0x1a')])){return logger[_0xb10d('0xb')](_0xb10d('0x31'));}var _0x475f10={'startDate':moment()[_0xb10d('0x32')](_0x4a09d7['subtractNumber'],_0x4a09d7[_0xb10d('0x1a')])['format'](_0xb10d('0x33')),'endDate':moment()['format'](_0xb10d('0x33')),'type':_0xb10d('0x34'),'output':_0x4a09d7['output'],'name':_0x4a09d7[_0xb10d('0x18')]};if(!_['isNil'](_0x4a09d7['DefaultReportId'])){logger[_0xb10d('0xb')](_0xb10d('0x35'),_0x4a09d7['DefaultReportId']);return analyticDefaultReportController[_0xb10d('0x36')]({'id':_0x4a09d7['DefaultReportId']},_0x475f10)[_0xb10d('0x2c')](handleResult(_0x4a09d7))[_0xb10d('0x2f')](handleError());}if(!_[_0xb10d('0x30')](_0x4a09d7['CustomReportId'])){logger[_0xb10d('0xb')]('exec\x20custom\x20report\x20id:%s',_0x4a09d7[_0xb10d('0x37')]);return analyticCustomReportController[_0xb10d('0x36')]({'id':_0x4a09d7[_0xb10d('0x37')]},_0x475f10)[_0xb10d('0x2c')](handleResult(_0x4a09d7))['catch'](handleError());}}catch(_0x54f8d0){logger[_0xb10d('0x2d')](JSON['stringify'](_0x54f8d0));}return logger[_0xb10d('0xb')](_0xb10d('0x38'));};}function getJobs(_0x425d31){var _0x33461c={};if(_0x425d31){_0x33461c['id']=_0x425d31;}return db[_0xb10d('0x39')][_0xb10d('0x3a')]({'where':_0x33461c,'include':[{'model':db['MailAccount'],'attributes':['id',_0xb10d('0x18'),_0xb10d('0xd')],'include':[{'model':db[_0xb10d('0x3b')],'as':_0xb10d('0xe')}]}]})[_0xb10d('0x2c')](function(_0x2d9bd4){var _0x1fc66e=_[_0xb10d('0x3c')](manager[_0xb10d('0x3d')]);var _0x3828df=_[_0xb10d('0x3e')](_0x2d9bd4,function(_0x568016){return _0x568016['id'][_0xb10d('0x3f')]();});var _0x5a5a89=_['keyBy'](_0x2d9bd4,function(_0x47dd00){return _0x47dd00['id'][_0xb10d('0x3f')]();});var _0xe0a555=_0x425d31?_0x3828df:_[_0xb10d('0x40')](_0x3828df,_0x1fc66e);var _0x4886fb=_['intersection'](_0x3828df,_0x1fc66e);var _0x4a46e7=_[_0xb10d('0x40')](_0x1fc66e,_0x3828df);var _0x342b54;var _0x202259;for(_0x342b54=0x0;_0x342b54<_0x4a46e7['length']&&!_0x425d31;_0x342b54+=0x1){_0x202259=_0x4a46e7[_0x342b54]['toString']();if(manager[_0xb10d('0x41')](_0x202259)){manager[_0xb10d('0x42')](_0x202259);manager[_0xb10d('0x43')](_0x202259);logger[_0xb10d('0xb')](_0xb10d('0x44'),_0x202259);}}logger[_0xb10d('0xb')](_0xb10d('0x45'),JSON[_0xb10d('0x28')](_0xe0a555));for(_0x342b54=0x0;_0x342b54<_0xe0a555['length'];_0x342b54+=0x1){_0x202259=_0xe0a555[_0x342b54]['toString']();logger[_0xb10d('0xb')](_0xb10d('0x46'),_0x202259);if(_0x425d31){logger['info'](_0xb10d('0x47'),_0x425d31);logger['info'](JSON[_0xb10d('0x28')](_0x5a5a89[_0x202259]));BPromise[_0xb10d('0x48')]()[_0xb10d('0x2c')](handleJob(_0x5a5a89[_0x202259]));logger[_0xb10d('0xb')]('run\x20job',_0x5a5a89[_0x202259]['name'],_0x5a5a89[_0x202259][_0xb10d('0x49')]);}else if(_0x5a5a89[_0x202259][_0xb10d('0x49')]&&_0x5a5a89[_0x202259][_0xb10d('0x4a')]&&moment()[_0xb10d('0x4b')](_0x5a5a89[_0x202259][_0xb10d('0x4c')],_0x5a5a89[_0x202259]['endAt'])){manager[_0xb10d('0x4d')](_0x202259,_0x5a5a89[_0x202259][_0xb10d('0x49')],handleJob(_0x5a5a89[_0x202259]));manager[_0xb10d('0x4e')](_0x202259);logger[_0xb10d('0xb')]('add\x20cron',_0x5a5a89[_0x202259][_0xb10d('0x18')],_0x5a5a89[_0x202259][_0xb10d('0x49')]);}else if(manager['exists'](_0x202259)){manager[_0xb10d('0x42')](_0x202259);manager['deleteJob'](_0x202259);logger[_0xb10d('0xb')](_0xb10d('0x4f'),_0x5a5a89[_0x202259][_0xb10d('0x18')],_0x5a5a89[_0x202259][_0xb10d('0x49')]);}}for(_0x342b54=0x0,_0x202259;_0x342b54<_0x4886fb['length']&&!_0x425d31;_0x342b54+=0x1){_0x202259=_0x4886fb[_0x342b54][_0xb10d('0x3f')]();if(manager['exists'](_0x202259)){if(_0x5a5a89[_0x202259]['cron']&&_0x5a5a89[_0x202259][_0xb10d('0x4a')]&&moment()[_0xb10d('0x4b')](_0x5a5a89[_0x202259][_0xb10d('0x4c')],_0x5a5a89[_0x202259][_0xb10d('0x50')])){manager[_0xb10d('0x51')](_0x202259,_0x5a5a89[_0x202259]['cron'],handleJob(_0x5a5a89[_0x202259]));logger[_0xb10d('0xb')]('update\x20cron',_0x5a5a89[_0x202259]['name'],_0x5a5a89[_0x202259]['cron']);}else{manager['stop'](_0x202259);manager[_0xb10d('0x43')](_0x202259);logger[_0xb10d('0xb')](_0xb10d('0x4f'),_0x5a5a89[_0x202259]['name'],_0x5a5a89[_0x202259][_0xb10d('0x49')]);}}}})[_0xb10d('0x2f')](function(_0x5991c4){logger[_0xb10d('0x2d')](JSON[_0xb10d('0x28')](_0x5991c4));});}exports[_0xb10d('0x52')]=function(_0x352067){return getJobs(_0x352067);};exports[_0xb10d('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xaacd=['run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','stop','stop\x20cron','active','update','update\x20cron','run','path','lodash','cron-job-manager','jayson/promise','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','secure','auth','user','\x22%s\x22\x20<%s>','name','bcc','format','subtractNumber','savename','%s.%s','extname','zip','join','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','error','error\x20mail','info','email\x20sent','catch','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','exec\x20custom\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','then','keys','map','keyBy','difference','intersection','toString','exists','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve'];(function(_0x1ea707,_0x1e0a43){var _0xe1b4e0=function(_0x18ebc3){while(--_0x18ebc3){_0x1ea707['push'](_0x1ea707['shift']());}};_0xe1b4e0(++_0x1e0a43);}(_0xaacd,0x119));var _0xdaac=function(_0x31a961,_0xe193c3){_0x31a961=_0x31a961-0x0;var _0xd09142=_0xaacd[_0x31a961];return _0xd09142;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xdaac('0x0'));var _=require(_0xdaac('0x1'));var moment=require('moment');var CronJobManager=require(_0xdaac('0x2'));var jayson=require(_0xdaac('0x3'));var BPromise=require('bluebird');var logger=require(_0xdaac('0x4'))(_0xdaac('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xdaac('0x6'));var client=jayson[_0xdaac('0x7')][_0xdaac('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x19a766,_0x367521){return function(){logger['info'](_0xdaac('0x9'),_0x19a766[_0xdaac('0xa')]);var _0x3d151b=!![];var _0x1f8d3d={'tls':{'rejectUnauthorized':![]}};if(_0x19a766[_0xdaac('0xb')]['Smtp'][_0xdaac('0xc')]){_0x1f8d3d[_0xdaac('0xc')]=_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')][_0xdaac('0xc')];}else{_0x1f8d3d[_0xdaac('0xe')]=_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')]['host'];_0x1f8d3d['port']=_0x19a766[_0xdaac('0xb')]['Smtp']['port'];_0x1f8d3d[_0xdaac('0xf')]=_0x19a766['MailAccount'][_0xdaac('0xd')][_0xdaac('0xf')];}if(_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')]['authentication']){_0x1f8d3d[_0xdaac('0x10')]={'user':_0x19a766['MailAccount'][_0xdaac('0xd')][_0xdaac('0x11')],'pass':_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')]['pass']};}var _0x467a4e={'account':_0x1f8d3d,'message':{'from':util['format'](_0xdaac('0x12'),_0x19a766['MailAccount'][_0xdaac('0x13')],_0x19a766[_0xdaac('0xb')]['email']||_0x19a766[_0xdaac('0xb')][_0xdaac('0xd')][_0xdaac('0x11')]),'to':_0x19a766[_0xdaac('0xa')],'cc':_0x19a766['cc'],'bcc':_0x19a766[_0xdaac('0x14')],'subject':util[_0xdaac('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x367521[_0xdaac('0x13')],_0x19a766[_0xdaac('0x16')],_0x19a766['subtractUnit'])}};var _0x29aea4=path['join'](__dirname,'../../files/reports');var _0x3897ff=_0x367521[_0xdaac('0x17')];var _0x23fb02=util[_0xdaac('0x15')](_0xdaac('0x18'),path['basename'](_0x367521[_0xdaac('0x17')],path[_0xdaac('0x19')](_0x367521[_0xdaac('0x17')])),_0xdaac('0x1a'));var _0xd425ec=path[_0xdaac('0x1b')](_0x29aea4,_0x3897ff);var _0x21de2c=path[_0xdaac('0x1b')](_0x29aea4,_0x23fb02);if(fs[_0xdaac('0x1c')](_0xd425ec)){_0x367521[_0xdaac('0x1d')]=_0xdaac('0x1e');_0x467a4e[_0xdaac('0x1f')]['attachments']=[{'filename':_0x3897ff,'path':_0xd425ec}];_0x467a4e[_0xdaac('0x1f')][_0xdaac('0x20')]=util[_0xdaac('0x15')](_0xdaac('0x21'),JSON[_0xdaac('0x22')](_0x367521,null,0x2));}else if(fs['existsSync'](_0x21de2c)){_0x367521[_0xdaac('0x1d')]=_0xdaac('0x1e');_0x467a4e[_0xdaac('0x1f')][_0xdaac('0x23')]=[{'filename':_0x23fb02,'path':_0x21de2c}];}else{_0x467a4e[_0xdaac('0x1f')]['text']=_0xdaac('0x24');if(!_0x19a766[_0xdaac('0x25')]){_0x3d151b=![];logger['info'](_0xdaac('0x26'));}}if(_0x3d151b){return client['request'](_0xdaac('0x27'),_0x467a4e)['then'](function(_0x5510cf){if(_0x5510cf[_0xdaac('0x28')]){return logger[_0xdaac('0x28')](_0xdaac('0x29'),JSON[_0xdaac('0x22')](_0x5510cf));}return logger[_0xdaac('0x2a')](_0xdaac('0x2b'));})[_0xdaac('0x2c')](function(_0xd44144){return logger[_0xdaac('0x28')](_0xdaac('0x29'),JSON[_0xdaac('0x22')](_0xd44144));});}};}function handleError(){return function(_0xa743f1){return logger[_0xdaac('0x28')](JSON[_0xdaac('0x22')](_0xa743f1));};}function handleResult(_0xcd9406){return function(_0x55c5ec){logger[_0xdaac('0x2a')]('data',JSON['stringify'](_0x55c5ec));if(_0xcd9406[_0xdaac('0xb')]&&_0xcd9406['MailAccount'][_0xdaac('0xd')]&&!_[_0xdaac('0x2d')](_0xcd9406[_0xdaac('0xa')])){setTimeout(handleSendEmail(_0xcd9406,_0x55c5ec),0x3c*0x3e8);}};}function handleJob(_0x517043){return function(){try{if(_[_0xdaac('0x2d')](_0x517043[_0xdaac('0x16')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xdaac('0x2d')](_0x517043['subtractUnit'])){return logger[_0xdaac('0x2a')](_0xdaac('0x2e'));}var _0x3c51f5={'startDate':moment()[_0xdaac('0x2f')](_0x517043['subtractNumber'],_0x517043['subtractUnit'])[_0xdaac('0x15')](_0xdaac('0x30')),'endDate':moment()[_0xdaac('0x15')](_0xdaac('0x30')),'type':_0xdaac('0x31'),'output':_0x517043[_0xdaac('0x32')],'name':_0x517043[_0xdaac('0x13')]};if(!_['isNil'](_0x517043[_0xdaac('0x33')])){logger[_0xdaac('0x2a')](_0xdaac('0x34'),_0x517043[_0xdaac('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x517043[_0xdaac('0x33')]},_0x3c51f5)['then'](handleResult(_0x517043))[_0xdaac('0x2c')](handleError());}if(!_[_0xdaac('0x2d')](_0x517043['CustomReportId'])){logger[_0xdaac('0x2a')](_0xdaac('0x35'),_0x517043[_0xdaac('0x36')]);return analyticCustomReportController[_0xdaac('0x37')]({'id':_0x517043[_0xdaac('0x36')]},_0x3c51f5)['then'](handleResult(_0x517043))[_0xdaac('0x2c')](handleError());}}catch(_0x414fac){logger[_0xdaac('0x28')](JSON['stringify'](_0x414fac));}return logger[_0xdaac('0x2a')](_0xdaac('0x38'));};}function getJobs(_0xd74c81){var _0x37173c={};if(_0xd74c81){_0x37173c['id']=_0xd74c81;}return db[_0xdaac('0x39')][_0xdaac('0x3a')]({'where':_0x37173c,'include':[{'model':db[_0xdaac('0xb')],'attributes':['id',_0xdaac('0x13'),_0xdaac('0xa')],'include':[{'model':db[_0xdaac('0x3b')],'as':_0xdaac('0xd')}]}]})[_0xdaac('0x3c')](function(_0x21423c){var _0x1378f6=_[_0xdaac('0x3d')](manager['jobs']);var _0x2c2374=_[_0xdaac('0x3e')](_0x21423c,function(_0x11a469){return _0x11a469['id']['toString']();});var _0x258056=_[_0xdaac('0x3f')](_0x21423c,function(_0x25211c){return _0x25211c['id']['toString']();});var _0x1132ce=_0xd74c81?_0x2c2374:_[_0xdaac('0x40')](_0x2c2374,_0x1378f6);var _0xdc5c2e=_[_0xdaac('0x41')](_0x2c2374,_0x1378f6);var _0x5138fc=_[_0xdaac('0x40')](_0x1378f6,_0x2c2374);var _0x35e588;var _0x4d0c7c;for(_0x35e588=0x0;_0x35e588<_0x5138fc['length']&&!_0xd74c81;_0x35e588+=0x1){_0x4d0c7c=_0x5138fc[_0x35e588][_0xdaac('0x42')]();if(manager[_0xdaac('0x43')](_0x4d0c7c)){manager['stop'](_0x4d0c7c);manager[_0xdaac('0x44')](_0x4d0c7c);logger[_0xdaac('0x2a')](_0xdaac('0x45'),_0x4d0c7c);}}logger[_0xdaac('0x2a')](_0xdaac('0x46'),JSON[_0xdaac('0x22')](_0x1132ce));for(_0x35e588=0x0;_0x35e588<_0x1132ce[_0xdaac('0x47')];_0x35e588+=0x1){_0x4d0c7c=_0x1132ce[_0x35e588][_0xdaac('0x42')]();logger[_0xdaac('0x2a')](_0xdaac('0x48'),_0x4d0c7c);if(_0xd74c81){logger[_0xdaac('0x2a')](_0xdaac('0x49'),_0xd74c81);logger[_0xdaac('0x2a')](JSON[_0xdaac('0x22')](_0x258056[_0x4d0c7c]));BPromise[_0xdaac('0x4a')]()[_0xdaac('0x3c')](handleJob(_0x258056[_0x4d0c7c]));logger[_0xdaac('0x2a')](_0xdaac('0x4b'),_0x258056[_0x4d0c7c]['name'],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}else if(_0x258056[_0x4d0c7c][_0xdaac('0x4c')]&&_0x258056[_0x4d0c7c]['active']&&moment()[_0xdaac('0x4d')](_0x258056[_0x4d0c7c][_0xdaac('0x4e')],_0x258056[_0x4d0c7c][_0xdaac('0x4f')])){manager[_0xdaac('0x50')](_0x4d0c7c,_0x258056[_0x4d0c7c][_0xdaac('0x4c')],handleJob(_0x258056[_0x4d0c7c]));manager[_0xdaac('0x51')](_0x4d0c7c);logger['info'](_0xdaac('0x52'),_0x258056[_0x4d0c7c]['name'],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}else if(manager[_0xdaac('0x43')](_0x4d0c7c)){manager[_0xdaac('0x53')](_0x4d0c7c);manager[_0xdaac('0x44')](_0x4d0c7c);logger[_0xdaac('0x2a')](_0xdaac('0x54'),_0x258056[_0x4d0c7c][_0xdaac('0x13')],_0x258056[_0x4d0c7c]['cron']);}}for(_0x35e588=0x0,_0x4d0c7c;_0x35e588<_0xdc5c2e[_0xdaac('0x47')]&&!_0xd74c81;_0x35e588+=0x1){_0x4d0c7c=_0xdc5c2e[_0x35e588]['toString']();if(manager[_0xdaac('0x43')](_0x4d0c7c)){if(_0x258056[_0x4d0c7c][_0xdaac('0x4c')]&&_0x258056[_0x4d0c7c][_0xdaac('0x55')]&&moment()[_0xdaac('0x4d')](_0x258056[_0x4d0c7c]['startAt'],_0x258056[_0x4d0c7c][_0xdaac('0x4f')])){manager[_0xdaac('0x56')](_0x4d0c7c,_0x258056[_0x4d0c7c]['cron'],handleJob(_0x258056[_0x4d0c7c]));logger[_0xdaac('0x2a')](_0xdaac('0x57'),_0x258056[_0x4d0c7c][_0xdaac('0x13')],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}else{manager['stop'](_0x4d0c7c);manager[_0xdaac('0x44')](_0x4d0c7c);logger['info'](_0xdaac('0x54'),_0x258056[_0x4d0c7c]['name'],_0x258056[_0x4d0c7c][_0xdaac('0x4c')]);}}}})[_0xdaac('0x2c')](function(_0x636d65){logger[_0xdaac('0x28')](JSON[_0xdaac('0x22')](_0x636d65));});}exports[_0xdaac('0x58')]=function(_0x4ce995){return getJobs(_0x4ce995);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 7c822ed..0ecb571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fad=['fileText','COMPLETED','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','Sequelize','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','Sentiment','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','SequelizeValidationError','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s'];(function(_0x3d71ba,_0x49a38b){var _0x5e0ed0=function(_0x4d0bfb){while(--_0x4d0bfb){_0x3d71ba['push'](_0x3d71ba['shift']());}};_0x5e0ed0(++_0x49a38b);}(_0x4fad,0xcb));var _0xd4fa=function(_0x1aaaa5,_0x527f59){_0x1aaaa5=_0x1aaaa5-0x0;var _0x564ff4=_0x4fad[_0x1aaaa5];return _0x564ff4;};var _=require(_0xd4fa('0x0'));var AWS=require(_0xd4fa('0x1'));var rp=require(_0xd4fa('0x2'));var util=require('util');var BPromise=require(_0xd4fa('0x3'));var db=require(_0xd4fa('0x4'))['db'];var logger=require(_0xd4fa('0x5'))(_0xd4fa('0x6'));function getTranscriptionJob(_0x419a9c,_0x3903a1,_0x138bcb,_0x2f65a2){return new Promise(function(_0x597fbe,_0x2d4e07){var _0x52b426=new AWS[(_0xd4fa('0x7'))]({'accessKeyId':_0x3903a1,'secretAccessKey':_0x419a9c,'region':_0x138bcb});_0x52b426[_0xd4fa('0x8')]({'TranscriptionJobName':_0x2f65a2},function(_0x155c09,_0x3fff99){if(_0x155c09){return _0x2d4e07(_0x155c09);}else{return _0x597fbe(_0x3fff99);}});});}function sentiment(_0x58d2cd,_0x48e997,_0x26a894,_0x417404,_0x4623ba){return new Promise(function(_0x5b5443,_0x2df3c5){var _0x612e9d=new AWS[(_0xd4fa('0x9'))]({'accessKeyId':_0x48e997,'secretAccessKey':_0x58d2cd,'region':_0x26a894});_0x612e9d[_0xd4fa('0xa')]({'Text':_0x417404,'LanguageCode':_0x4623ba['substring'](0x0,0x2)},function(_0x109893,_0x376ef0){if(_0x109893){return _0x2df3c5(_0x109893);}else{return _0x5b5443(_0x376ef0);}});});}function checkTranscribeJob(_0x279c32,_0x50f53d,_0x2b04b3){var _0x2fe7b7;return new BPromise(function(_0x31c3ba,_0xadc145){logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x279c32['id'],_0x279c32[_0xd4fa('0xd')]));return getTranscriptionJob(_0x2b04b3[_0xd4fa('0xe')],_0x2b04b3[_0xd4fa('0xf')],_0x50f53d[_0xd4fa('0x10')],_0x279c32[_0xd4fa('0xd')])[_0xd4fa('0x11')](function(_0xa8bb45){logger['info'](util[_0xd4fa('0xc')](_0xd4fa('0x12'),_0x279c32['id'],_0x279c32[_0xd4fa('0xd')],_0xa8bb45['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x279c32[_0xd4fa('0x13')]){switch(_0xa8bb45['TranscriptionJob']['TranscriptionJobStatus']){case _0xd4fa('0x14'):var _0x628bc7={'transcribeStatus':_0xa8bb45[_0xd4fa('0x15')][_0xd4fa('0x16')],'fileUri':_0xa8bb45['TranscriptionJob'][_0xd4fa('0x17')][_0xd4fa('0x18')]};logger['info'](util[_0xd4fa('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x279c32['id']));return rp({'uri':_0xa8bb45['TranscriptionJob'][_0xd4fa('0x17')][_0xd4fa('0x18')],'json':!![]})[_0xd4fa('0x11')](function(_0x396ac7){logger['info'](util[_0xd4fa('0xc')](_0xd4fa('0x19'),_0x279c32['id']));if(_0x396ac7&&_0x396ac7[_0xd4fa('0x1a')]&&_0x396ac7[_0xd4fa('0x1a')][_0xd4fa('0x1b')]&&_0x396ac7['results'][_0xd4fa('0x1b')][_0xd4fa('0x1c')]){_0x628bc7['fileText']='';for(var _0x162459=0x0;_0x162459<_0x396ac7[_0xd4fa('0x1a')][_0xd4fa('0x1b')][_0xd4fa('0x1c')];_0x162459++){_0x628bc7[_0xd4fa('0x13')]+=_0x396ac7[_0xd4fa('0x1a')][_0xd4fa('0x1b')][_0x162459][_0xd4fa('0x1d')]+'';}}return _0x279c32[_0xd4fa('0x1e')](_0x628bc7);})['then'](function(){logger[_0xd4fa('0xb')](util['format'](_0xd4fa('0x1f'),_0x279c32['id']));if(!_0x279c32[_0xd4fa('0x20')]){throw new db['Sequelize'][(_0xd4fa('0x21'))](_0xd4fa('0x22'));}if(!_0x50f53d[_0xd4fa('0x23')]||!_0x50f53d['sentimentAccountId']||!_0x50f53d[_0xd4fa('0x24')]||!_0x50f53d[_0xd4fa('0x25')]||!_0x50f53d['bucket']){throw new db[(_0xd4fa('0x26'))][(_0xd4fa('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x628bc7[_0xd4fa('0x13')]){throw new Error(_0xd4fa('0x27'));}if(_0x50f53d[_0xd4fa('0x28')]===_0x2b04b3['id']){return _0x2b04b3;}else{return db[_0xd4fa('0x29')][_0xd4fa('0x2a')]({'where':{'id':_settings[_0xd4fa('0x28')]}});}})[_0xd4fa('0x11')](function(_0x116c12){if(!_0x116c12){throw new db['Sequelize'][(_0xd4fa('0x21'))](_0xd4fa('0x2b'));}if(!_0x116c12[_0xd4fa('0xe')]||!_0x116c12[_0xd4fa('0xf')]){throw new db['Sequelize'][(_0xd4fa('0x21'))](_0xd4fa('0x2c'));}_0x2fe7b7=_0x116c12;logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x279c32['id']));return sentiment(_0x2fe7b7['data1'],_0x2fe7b7['data2'],_0x50f53d['sentimentRegion'],_0x628bc7[_0xd4fa('0x13')],_0x50f53d[_0xd4fa('0x25')]);})['then'](function(_0x563e88){logger['info'](util['format'](_0xd4fa('0x2d'),_0x279c32['id']));return _0x279c32[_0xd4fa('0x1e')]({'sentiment':_0x563e88['Sentiment'],'sPositive':_0x563e88[_0xd4fa('0x2e')][_0xd4fa('0x2f')],'sNegative':_0x563e88['SentimentScore'][_0xd4fa('0x30')],'sMixed':_0x563e88['SentimentScore'][_0xd4fa('0x31')],'sNeutral':_0x563e88['SentimentScore'][_0xd4fa('0x32')]});})[_0xd4fa('0x11')](function(){logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')](_0xd4fa('0x1f'),_0x279c32['id']));_0x31c3ba();});case'FAILED':return _0x279c32[_0xd4fa('0x1e')]({'transcribeStatus':_0xd4fa('0x33'),'failureReason':_0xa8bb45[_0xd4fa('0x15')][_0xd4fa('0x34')]})[_0xd4fa('0x11')](function(){logger[_0xd4fa('0xb')](util['format'](_0xd4fa('0x1f'),_0x279c32['id']));_0x31c3ba();});default:logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')](_0xd4fa('0x35'),_0x279c32['id']));break;}}else{return BPromise[_0xd4fa('0x36')]()['then'](function(){if(!_0x279c32[_0xd4fa('0x20')]){throw new db['Sequelize'][(_0xd4fa('0x21'))](_0xd4fa('0x22'));}if(!_0x50f53d['sentiment']||!_0x50f53d['sentimentAccountId']||!_0x50f53d['sentimentRegion']||!_0x50f53d[_0xd4fa('0x25')]||!_0x50f53d[_0xd4fa('0x37')]){throw new db[(_0xd4fa('0x26'))]['ValidationError'](_0xd4fa('0x38'));}if(!_0x279c32[_0xd4fa('0x13')]){throw new Error(_0xd4fa('0x27'));}if(_0x50f53d[_0xd4fa('0x28')]===_0x2b04b3['id']){return _0x2b04b3;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xd4fa('0x28')]}});}})[_0xd4fa('0x11')](function(_0x1623ba){if(!_0x1623ba){throw new db[(_0xd4fa('0x26'))][(_0xd4fa('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1623ba[_0xd4fa('0xe')]||!_0x1623ba[_0xd4fa('0xf')]){throw new db[(_0xd4fa('0x26'))][(_0xd4fa('0x21'))](_0xd4fa('0x2c'));}_0x2fe7b7=_0x1623ba;logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x279c32['id']));return sentiment(_0x2fe7b7[_0xd4fa('0xe')],_0x2fe7b7[_0xd4fa('0xf')],_0x50f53d[_0xd4fa('0x24')],_0x279c32[_0xd4fa('0x13')],_0x50f53d['language']);})[_0xd4fa('0x11')](function(_0x1d0470){logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')](_0xd4fa('0x2d'),_0x279c32['id']));return _0x279c32[_0xd4fa('0x1e')]({'sentiment':_0x1d0470[_0xd4fa('0x39')],'sPositive':_0x1d0470[_0xd4fa('0x2e')][_0xd4fa('0x2f')],'sNegative':_0x1d0470[_0xd4fa('0x2e')][_0xd4fa('0x30')],'sMixed':_0x1d0470[_0xd4fa('0x2e')][_0xd4fa('0x31')],'sNeutral':_0x1d0470[_0xd4fa('0x2e')][_0xd4fa('0x32')],'transcribeStatus':'COMPLETED'});})[_0xd4fa('0x11')](function(){logger[_0xd4fa('0xb')](util[_0xd4fa('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x279c32['id']));_0x31c3ba();});}})[_0xd4fa('0x3a')](function(_0x31d842){if(_0x31d842){if(!_0x31d842[_0xd4fa('0x3b')]||_0x31d842['name']!=='SequelizeValidationError'){logger[_0xd4fa('0x3c')](util['format'](_0xd4fa('0x3d'),_0x279c32['id']),util['inspect'](_0x31d842,{'showHidden':![],'depth':null}));}}_0x31c3ba();});});}function checkTranscribe(){var _0x105120;var _0x4c2fbc;var _0x345403;return db[_0xd4fa('0x3e')][_0xd4fa('0x3f')]({'where':{'transcribeStatus':_0xd4fa('0x40')}})[_0xd4fa('0x11')](function(_0x18f097){if(!_0x18f097||!_0x18f097['length']){throw new db['Sequelize'][(_0xd4fa('0x21'))](_0xd4fa('0x41'));}_0x105120=_0x18f097;return db[_0xd4fa('0x42')][_0xd4fa('0x2a')]({'where':{'id':0x1}});})[_0xd4fa('0x11')](function(_0x215ad9){if(!_0x215ad9){throw new db[(_0xd4fa('0x26'))][(_0xd4fa('0x21'))]('Settings\x20not\x20available');}_0x4c2fbc=_0x215ad9;if(!_0x4c2fbc[_0xd4fa('0x6')]||!_0x4c2fbc[_0xd4fa('0x43')]||!_0x4c2fbc[_0xd4fa('0x10')]||!_0x4c2fbc[_0xd4fa('0x25')]||!_0x4c2fbc[_0xd4fa('0x37')]){throw new db[(_0xd4fa('0x26'))][(_0xd4fa('0x21'))](_0xd4fa('0x44'));}return db[_0xd4fa('0x29')][_0xd4fa('0x2a')]({'where':{'id':_0x4c2fbc['transcribeAccountId']}});})['then'](function(_0x329505){if(!_0x329505){throw new db[(_0xd4fa('0x26'))]['ValidationError'](_0xd4fa('0x2b'));}if(!_0x329505[_0xd4fa('0xe')]||!_0x329505[_0xd4fa('0xf')]){throw new db['Sequelize']['ValidationError'](_0xd4fa('0x2c'));}_0x345403=_0x329505;var _0x3d17ba=[];_0x105120[_0xd4fa('0x45')](function(_0x36aaf7){_0x3d17ba[_0xd4fa('0x46')](checkTranscribeJob(_0x36aaf7,_0x4c2fbc,_0x345403));});return BPromise[_0xd4fa('0x47')](_0x3d17ba);})[_0xd4fa('0x3a')](function(_0x590f15){if(_0x590f15){if(!_0x590f15[_0xd4fa('0x3b')]||_0x590f15[_0xd4fa('0x3b')]!==_0xd4fa('0x48')){logger[_0xd4fa('0x3c')](util['inspect'](_0x590f15,{'showHidden':![],'depth':null}));}}});}exports[_0xd4fa('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x0abf=['Neutral','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','catch','name','SequelizeValidationError','lodash','request-promise','util','../../config/logger','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative'];(function(_0x2e8dd4,_0x1a9d97){var _0x564dec=function(_0xe2bd7c){while(--_0xe2bd7c){_0x2e8dd4['push'](_0x2e8dd4['shift']());}};_0x564dec(++_0x1a9d97);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};var _=require(_0xf0ab('0x0'));var AWS=require('aws-sdk');var rp=require(_0xf0ab('0x1'));var util=require(_0xf0ab('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xf0ab('0x3'))('transcribe');function getTranscriptionJob(_0x7ea4e0,_0x3be05e,_0x2efe43,_0xbb1f91){return new Promise(function(_0x2ab7d6,_0x4d2ea8){var _0x233afe=new AWS['TranscribeService']({'accessKeyId':_0x3be05e,'secretAccessKey':_0x7ea4e0,'region':_0x2efe43});_0x233afe[_0xf0ab('0x4')]({'TranscriptionJobName':_0xbb1f91},function(_0x3f7e2b,_0x3ca099){if(_0x3f7e2b){return _0x4d2ea8(_0x3f7e2b);}else{return _0x2ab7d6(_0x3ca099);}});});}function sentiment(_0x236b07,_0x480f49,_0x472508,_0x4688d8,_0x1e7887){return new Promise(function(_0x4ab8e7,_0x5d25a0){var _0x30042c=new AWS['Comprehend']({'accessKeyId':_0x480f49,'secretAccessKey':_0x236b07,'region':_0x472508});_0x30042c[_0xf0ab('0x5')]({'Text':_0x4688d8,'LanguageCode':_0x1e7887[_0xf0ab('0x6')](0x0,0x2)},function(_0xf34cc6,_0x410df5){if(_0xf34cc6){return _0x5d25a0(_0xf34cc6);}else{return _0x4ab8e7(_0x410df5);}});});}function checkTranscribeJob(_0x2dc4f8,_0x38ca67,_0x34ccdc){var _0x4fdd5f;return new BPromise(function(_0x39b4e7,_0x2cc002){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x9'),_0x2dc4f8['id'],_0x2dc4f8[_0xf0ab('0xa')]));return getTranscriptionJob(_0x34ccdc[_0xf0ab('0xb')],_0x34ccdc[_0xf0ab('0xc')],_0x38ca67[_0xf0ab('0xd')],_0x2dc4f8[_0xf0ab('0xa')])[_0xf0ab('0xe')](function(_0x221bac){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0xf'),_0x2dc4f8['id'],_0x2dc4f8['transcribeName'],_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')]));if(!_0x2dc4f8[_0xf0ab('0x12')]){switch(_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')]){case _0xf0ab('0x13'):var _0x3a0edf={'transcribeStatus':_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x11')],'fileUri':_0x221bac[_0xf0ab('0x10')][_0xf0ab('0x14')][_0xf0ab('0x15')]};logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x16'),_0x2dc4f8['id']));return rp({'uri':_0x221bac[_0xf0ab('0x10')]['Transcript'][_0xf0ab('0x15')],'json':!![]})[_0xf0ab('0xe')](function(_0x1e1483){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x17'),_0x2dc4f8['id']));if(_0x1e1483&&_0x1e1483[_0xf0ab('0x18')]&&_0x1e1483[_0xf0ab('0x18')][_0xf0ab('0x19')]&&_0x1e1483[_0xf0ab('0x18')][_0xf0ab('0x19')]['length']){_0x3a0edf['fileText']='';for(var _0x4eee21=0x0;_0x4eee21<_0x1e1483[_0xf0ab('0x18')]['transcripts'][_0xf0ab('0x1a')];_0x4eee21++){_0x3a0edf[_0xf0ab('0x12')]+=_0x1e1483['results'][_0xf0ab('0x19')][_0x4eee21][_0xf0ab('0x1b')]+'';}}return _0x2dc4f8[_0xf0ab('0x1c')](_0x3a0edf);})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util['format'](_0xf0ab('0x1d'),_0x2dc4f8['id']));if(!_0x2dc4f8['tempSentiment']){throw new db['Sequelize'][(_0xf0ab('0x1e'))](_0xf0ab('0x1f'));}if(!_0x38ca67[_0xf0ab('0x20')]||!_0x38ca67[_0xf0ab('0x21')]||!_0x38ca67[_0xf0ab('0x22')]||!_0x38ca67[_0xf0ab('0x23')]||!_0x38ca67[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x26'));}if(!_0x3a0edf[_0xf0ab('0x12')]){throw new Error(_0xf0ab('0x27'));}if(_0x38ca67['sentimentAccountId']===_0x34ccdc['id']){return _0x34ccdc;}else{return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1eff91){if(!_0x1eff91){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1eff91['data1']||!_0x1eff91[_0xf0ab('0xc')]){throw new db['Sequelize'][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x4fdd5f=_0x1eff91;logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2dc4f8['id']));return sentiment(_0x4fdd5f['data1'],_0x4fdd5f[_0xf0ab('0xc')],_0x38ca67[_0xf0ab('0x22')],_0x3a0edf[_0xf0ab('0x12')],_0x38ca67[_0xf0ab('0x23')]);})[_0xf0ab('0xe')](function(_0x36195d){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x2a'),_0x2dc4f8['id']));return _0x2dc4f8[_0xf0ab('0x1c')]({'sentiment':_0x36195d[_0xf0ab('0x2b')],'sPositive':_0x36195d[_0xf0ab('0x2c')][_0xf0ab('0x2d')],'sNegative':_0x36195d[_0xf0ab('0x2c')]['Negative'],'sMixed':_0x36195d[_0xf0ab('0x2c')][_0xf0ab('0x2e')],'sNeutral':_0x36195d[_0xf0ab('0x2c')]['Neutral']});})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dc4f8['id']));_0x39b4e7();});case _0xf0ab('0x2f'):return _0x2dc4f8['update']({'transcribeStatus':_0xf0ab('0x2f'),'failureReason':_0x221bac['TranscriptionJob'][_0xf0ab('0x30')]})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x1d'),_0x2dc4f8['id']));_0x39b4e7();});default:logger[_0xf0ab('0x7')](util['format'](_0xf0ab('0x31'),_0x2dc4f8['id']));break;}}else{return BPromise[_0xf0ab('0x32')]()['then'](function(){if(!_0x2dc4f8[_0xf0ab('0x33')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x1f'));}if(!_0x38ca67[_0xf0ab('0x20')]||!_0x38ca67[_0xf0ab('0x21')]||!_0x38ca67[_0xf0ab('0x22')]||!_0x38ca67['language']||!_0x38ca67[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x2dc4f8[_0xf0ab('0x12')]){throw new Error(_0xf0ab('0x27'));}if(_0x38ca67[_0xf0ab('0x21')]===_0x34ccdc['id']){return _0x34ccdc;}else{return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf0ab('0xe')](function(_0x39a212){if(!_0x39a212){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x34'));}if(!_0x39a212[_0xf0ab('0xb')]||!_0x39a212[_0xf0ab('0xc')]){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x35'));}_0x4fdd5f=_0x39a212;logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')](_0xf0ab('0x36'),_0x2dc4f8['id']));return sentiment(_0x4fdd5f['data1'],_0x4fdd5f['data2'],_0x38ca67[_0xf0ab('0x22')],_0x2dc4f8['fileText'],_0x38ca67[_0xf0ab('0x23')]);})[_0xf0ab('0xe')](function(_0x4bbdf6){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x2dc4f8['id']));return _0x2dc4f8[_0xf0ab('0x1c')]({'sentiment':_0x4bbdf6[_0xf0ab('0x2b')],'sPositive':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x2d')],'sNegative':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x37')],'sMixed':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x2e')],'sNeutral':_0x4bbdf6[_0xf0ab('0x2c')][_0xf0ab('0x38')],'transcribeStatus':_0xf0ab('0x13')});})[_0xf0ab('0xe')](function(){logger[_0xf0ab('0x7')](util[_0xf0ab('0x8')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2dc4f8['id']));_0x39b4e7();});}})['catch'](function(_0x3f173c){if(_0x3f173c){if(!_0x3f173c['name']||_0x3f173c['name']!=='SequelizeValidationError'){logger[_0xf0ab('0x39')](util[_0xf0ab('0x8')](_0xf0ab('0x3a'),_0x2dc4f8['id']),util[_0xf0ab('0x3b')](_0x3f173c,{'showHidden':![],'depth':null}));}}_0x39b4e7();});});}function checkTranscribe(){var _0x1a2ee9;var _0x132ada;var _0x472c1b;return db[_0xf0ab('0x3c')][_0xf0ab('0x3d')]({'where':{'transcribeStatus':_0xf0ab('0x3e')}})[_0xf0ab('0xe')](function(_0x157287){if(!_0x157287||!_0x157287['length']){throw new db[(_0xf0ab('0x25'))][(_0xf0ab('0x1e'))](_0xf0ab('0x3f'));}_0x1a2ee9=_0x157287;return db[_0xf0ab('0x40')][_0xf0ab('0x29')]({'where':{'id':0x1}});})[_0xf0ab('0xe')](function(_0x430921){if(!_0x430921){throw new db[(_0xf0ab('0x25'))]['ValidationError']('Settings\x20not\x20available');}_0x132ada=_0x430921;if(!_0x132ada['transcribe']||!_0x132ada[_0xf0ab('0x41')]||!_0x132ada[_0xf0ab('0xd')]||!_0x132ada['language']||!_0x132ada[_0xf0ab('0x24')]){throw new db[(_0xf0ab('0x25'))]['ValidationError'](_0xf0ab('0x42'));}return db[_0xf0ab('0x28')][_0xf0ab('0x29')]({'where':{'id':_0x132ada[_0xf0ab('0x41')]}});})[_0xf0ab('0xe')](function(_0x33112b){if(!_0x33112b){throw new db[(_0xf0ab('0x25'))]['ValidationError'](_0xf0ab('0x34'));}if(!_0x33112b['data1']||!_0x33112b[_0xf0ab('0xc')]){throw new db['Sequelize'][(_0xf0ab('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x472c1b=_0x33112b;var _0x535274=[];_0x1a2ee9[_0xf0ab('0x43')](function(_0x58ac39){_0x535274[_0xf0ab('0x44')](checkTranscribeJob(_0x58ac39,_0x132ada,_0x472c1b));});return BPromise['all'](_0x535274);})[_0xf0ab('0x45')](function(_0x488001){if(_0x488001){if(!_0x488001[_0xf0ab('0x46')]||_0x488001[_0xf0ab('0x46')]!==_0xf0ab('0x47')){logger['error'](util['inspect'](_0x488001,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index e1f9927..05d69bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7381=['info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x38dcff,_0x5f249d){var _0x6cb881=function(_0x3d2494){while(--_0x3d2494){_0x38dcff['push'](_0x38dcff['shift']());}};_0x6cb881(++_0x5f249d);}(_0x7381,0x18c));var _0x1738=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x7381[_0x43b06b];return _0x2c555b;};'use strict';var _=require(_0x1738('0x0'));var moment=require(_0x1738('0x1'));var Redis=require(_0x1738('0x2'));var util=require(_0x1738('0x3'));var config=require(_0x1738('0x4'));var db=require(_0x1738('0x5'))['db'];var logger=require(_0x1738('0x6'))(_0x1738('0x7'));config[_0x1738('0x8')]=_[_0x1738('0x9')](config[_0x1738('0x8')],{'host':_0x1738('0xa'),'port':0x18eb});var io=require(_0x1738('0xb'))(new Redis(config[_0x1738('0x8')]));function closeInteractions(){var _0xff9f27=[];return db['WhatsappInteraction'][_0x1738('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1738('0xd')](0x18,_0x1738('0xe'))}}})[_0x1738('0xf')](function(_0x5aee87){if(_0x5aee87&&_0x5aee87[_0x1738('0x10')]){_0xff9f27=_[_0x1738('0x11')](_0x5aee87||[],'id');logger['info'](_0x1738('0x12'),_0xff9f27[_0x1738('0x13')]());return db['WhatsappInteraction'][_0x1738('0x14')]({'closeReason':_0x1738('0x15'),'disposition':_0x1738('0x16'),'closed':!![],'closedAt':moment()['format'](_0x1738('0x17'))},{'where':{'id':_0xff9f27}});}})[_0x1738('0xf')](function(){if(_0xff9f27&&_0xff9f27[_0x1738('0x10')]){logger[_0x1738('0x18')](_0x1738('0x19'),_0xff9f27[_0x1738('0x13')]());for(var _0x33ca56=0x0;_0x33ca56<_0xff9f27[_0x1738('0x10')];_0x33ca56++){io[_0x1738('0x1a')]('whatsappInteraction:update',{'id':_0xff9f27[_0x33ca56],'closed':!![]});}}})[_0x1738('0x1b')](function(_0x349320){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x349320?util[_0x1738('0x1c')](_0x349320,{'showHidden':![],'depth':null}):'');});}exports[_0x1738('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x172c=['then','emit','whatsappInteraction:update','catch','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','findAll','lastMsgAt','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2923f9,_0x2b19c8){var _0x3df535=function(_0x8091de){while(--_0x8091de){_0x2923f9['push'](_0x2923f9['shift']());}};_0x3df535(++_0x2b19c8);}(_0x172c,0x95));var _0xc172=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x172c[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xc172('0x0'));var moment=require('moment');var Redis=require(_0xc172('0x1'));var util=require('util');var config=require(_0xc172('0x2'));var db=require(_0xc172('0x3'))['db'];var logger=require(_0xc172('0x4'))(_0xc172('0x5'));config[_0xc172('0x6')]=_[_0xc172('0x7')](config[_0xc172('0x6')],{'host':_0xc172('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x1634f6=[];return db['WhatsappInteraction'][_0xc172('0x9')]({'raw':!![],'attributes':['id',_0xc172('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0x5de4f2){if(_0x5de4f2&&_0x5de4f2[_0xc172('0xb')]){_0x1634f6=_[_0xc172('0xc')](_0x5de4f2||[],'id');logger['info'](_0xc172('0xd'),_0x1634f6[_0xc172('0xe')]());return db[_0xc172('0xf')][_0xc172('0x10')]({'closeReason':_0xc172('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xc172('0x12'))},{'where':{'id':_0x1634f6}});}})[_0xc172('0x13')](function(){if(_0x1634f6&&_0x1634f6['length']){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x1634f6[_0xc172('0xe')]());for(var _0x20d53c=0x0;_0x20d53c<_0x1634f6['length'];_0x20d53c++){io[_0xc172('0x14')](_0xc172('0x15'),{'id':_0x1634f6[_0x20d53c],'closed':!![]});}}})[_0xc172('0x16')](function(_0x193afd){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x193afd?util['inspect'](_0x193afd,{'showHidden':![],'depth':null}):'');});}exports[_0xc172('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index deaaf4d..7fcbc7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4ca=['then','log','CmHopper','finished\x20populating','hopper1','bulkCreate','hopper2','catch','util','../mysqldb','push','innocenzo.biondo','@xcally.com','now','Biondo','destroy'];(function(_0x38b5f6,_0x1ae94c){var _0x22584c=function(_0xc7130f){while(--_0xc7130f){_0x38b5f6['push'](_0x38b5f6['shift']());}};_0x22584c(++_0x1ae94c);}(_0xc4ca,0x128));var _0xac4c=function(_0x543b00,_0x4a5fc7){_0x543b00=_0x543b00-0x0;var _0x2678a1=_0xc4ca[_0x543b00];return _0x2678a1;};'use strict';var util=require(_0xac4c('0x0'));var db=require(_0xac4c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xac4c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xac4c('0x3')+i+_0xac4c('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xac4c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xac4c('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xac4c('0x5')](),'updatedAt':Date[_0xac4c('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xac4c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xac4c('0x6')+i,'phone':0xf879fb460+i,'email':_0xac4c('0x3')+i+_0xac4c('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xac4c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xac4c('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xac4c('0x5')](),'updatedAt':Date[_0xac4c('0x5')]()});}db['CmContact'][_0xac4c('0x7')]({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xac4c('0x8')](function(){console[_0xac4c('0x9')]('finished\x20populating','contacts1');return db[_0xac4c('0xa')][_0xac4c('0x7')]({'where':{}});})[_0xac4c('0x8')](function(){return db[_0xac4c('0xa')]['bulkCreate'](hopper);})['then'](function(){console[_0xac4c('0x9')](_0xac4c('0xb'),_0xac4c('0xc'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0xac4c('0x9')](_0xac4c('0xb'),'contacts2');return db['CmHopper'][_0xac4c('0xd')](hopper2);})[_0xac4c('0x8')](function(){console[_0xac4c('0x9')](_0xac4c('0xb'),_0xac4c('0xe'));})[_0xac4c('0xf')](function(_0xb755fd){console[_0xac4c('0x9')](_0xb755fd);});
\ No newline at end of file
+var _0x102b=['then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x102b,0x172));var _0xb102=function(_0xfbffea,_0xb5d80a){_0xfbffea=_0xfbffea-0x0;var _0xc99a5d=_0x102b[_0xfbffea];return _0xc99a5d;};'use strict';var util=require(_0xb102('0x0'));var db=require(_0xb102('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb102('0x2')]({'id':i,'firstName':_0xb102('0x3')+i,'lastName':_0xb102('0x4')+i,'phone':0xf879fb460+i,'email':_0xb102('0x5')+i+_0xb102('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb102('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb102('0x7')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xb102('0x3')+i,'lastName':_0xb102('0x4')+i,'phone':0xf879fb460+i,'email':_0xb102('0x5')+i+_0xb102('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb102('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb102('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb102('0x7')](),'updatedAt':Date[_0xb102('0x7')]()});}db[_0xb102('0x8')][_0xb102('0x9')]({'where':{}})[_0xb102('0xa')](function(){return db[_0xb102('0x8')]['bulkCreate'](contacts);})[_0xb102('0xa')](function(){console[_0xb102('0xb')](_0xb102('0xc'),_0xb102('0xd'));return db['CmHopper'][_0xb102('0x9')]({'where':{}});})[_0xb102('0xa')](function(){return db[_0xb102('0xe')][_0xb102('0xf')](hopper);})['then'](function(){console[_0xb102('0xb')]('finished\x20populating',_0xb102('0x10'));return db[_0xb102('0x8')][_0xb102('0xf')](contacts2);})[_0xb102('0xa')](function(){console[_0xb102('0xb')]('finished\x20populating',_0xb102('0x11'));return db[_0xb102('0xe')][_0xb102('0xf')](hopper2);})[_0xb102('0xa')](function(){console[_0xb102('0xb')](_0xb102('0xc'),_0xb102('0x12'));})[_0xb102('0x13')](function(_0x540be4){console[_0xb102('0xb')](_0x540be4);});
\ No newline at end of file
index bf2eefd..383ca3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9355=['push','format','%s%s','agent','password','udp','wss','all','ulaw','yes','actpass','\x22%s\x22\x20<%s>','then','log','add\x20user','catch','../mysqldb'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0x9355,0x65));var _0x5935=function(_0x31d974,_0x162d25){_0x31d974=_0x31d974-0x0;var _0x162ca1=_0x9355[_0x31d974];return _0x162ca1;};'use strict';var util=require('util');var db=require(_0x5935('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5935('0x1')]({'name':util[_0x5935('0x2')](_0x5935('0x3'),_0x5935('0x4'),i),'fullname':util[_0x5935('0x2')](_0x5935('0x3'),_0x5935('0x4'),i),'email':util[_0x5935('0x2')]('%s%s@xcally.com',_0x5935('0x4'),i),'role':'agent','password':_0x5935('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x5935('0x6'),'ws',_0x5935('0x7')],'disallow':[_0x5935('0x8')],'allow':[_0x5935('0x9')],'defaultuser':util[_0x5935('0x2')](_0x5935('0x3'),_0x5935('0x4'),i),'encryption':_0x5935('0xa'),'avpf':'yes','force_avp':'yes','icesupport':_0x5935('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x5935('0xb'),'callerid':util[_0x5935('0x2')](_0x5935('0xc'),util[_0x5935('0x2')](_0x5935('0x3'),_0x5935('0x4'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x5935('0xd')](function(){console[_0x5935('0xe')](_0x5935('0xf'));})[_0x5935('0x10')](function(_0x5e6aa3){console[_0x5935('0xe')](_0x5e6aa3);});
\ No newline at end of file
+var _0xb4a3=['add\x20user','catch','../mysqldb','format','%s%s','agent','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','then','log'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0xb4a3,0x112));var _0x3b4a=function(_0x5e6bec,_0x1eb54d){_0x5e6bec=_0x5e6bec-0x0;var _0x5dc5cf=_0xb4a3[_0x5e6bec];return _0x5dc5cf;};'use strict';var util=require('util');var db=require(_0x3b4a('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x3b4a('0x1')](_0x3b4a('0x2'),_0x3b4a('0x3'),i),'fullname':util[_0x3b4a('0x1')](_0x3b4a('0x2'),_0x3b4a('0x3'),i),'email':util[_0x3b4a('0x1')](_0x3b4a('0x4'),'agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x3b4a('0x5'),'transport':[_0x3b4a('0x6'),'ws','wss'],'disallow':[_0x3b4a('0x7')],'allow':[_0x3b4a('0x8')],'defaultuser':util['format'](_0x3b4a('0x2'),_0x3b4a('0x3'),i),'encryption':_0x3b4a('0x9'),'avpf':_0x3b4a('0x9'),'force_avp':_0x3b4a('0x9'),'icesupport':'yes','dtlsenable':_0x3b4a('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x3b4a('0xa'),'dtlssetup':'actpass','callerid':util[_0x3b4a('0x1')](_0x3b4a('0xb'),util[_0x3b4a('0x1')](_0x3b4a('0x2'),_0x3b4a('0x3'),i),0xfa0+i)});}db[_0x3b4a('0xc')]['bulkCreate'](users)[_0x3b4a('0xd')](function(){console[_0x3b4a('0xe')](_0x3b4a('0xf'));})[_0x3b4a('0x10')](function(_0xd2ac64){console[_0x3b4a('0xe')](_0xd2ac64);});
\ No newline at end of file
index dec5bcb..4c4eb18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ca3=['autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','User','where','role','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','voice:inbound','VoiceQueues','SmsQueue','Trunks','agent','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','WhatsappInteractions','catch','log','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','bluebird','../mysqldb','name','Agents','telephone','type','ivr','UserProfileSection','findOne','then'];(function(_0x4188d9,_0x2f6ab9){var _0x3e57ae=function(_0x43c4b3){while(--_0x43c4b3){_0x4188d9['push'](_0x4188d9['shift']());}};_0x3e57ae(++_0x2f6ab9);}(_0x6ca3,0xba));var _0x36ca=function(_0x1f2b0e,_0xc804dc){_0x1f2b0e=_0x1f2b0e-0x0;var _0x23b334=_0x6ca3[_0x1f2b0e];return _0x23b334;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x36ca('0x0'));var db=require(_0x36ca('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x36ca('0x2')],'include':[{'as':_0x36ca('0x3'),'model':db['User'],'attributes':['id',_0x36ca('0x2'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x36ca('0x2')],'where':{'role':_0x36ca('0x4')}};var queryTrunks={'raw':!![],'attributes':['id',_0x36ca('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x36ca('0x2')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x36ca('0x5')],'where':{'type':_0x36ca('0x6')}};function getAssociatedResources(_0x5f00d2,_0x4f34d3,_0x14e486){return db[_0x36ca('0x7')][_0x36ca('0x8')]({'where':{'name':_0x5f00d2,'userProfileId':_0x4f34d3},'raw':!![]})[_0x36ca('0x9')](function(_0x5d42d8){if(_0x5d42d8){if(_0x5d42d8[_0x36ca('0xa')]){switch(_0x5f00d2){case'VoiceQueues':case _0x36ca('0xb'):case _0x36ca('0xc'):case _0x36ca('0xd'):case _0x36ca('0xe'):case _0x36ca('0xf'):case'WhatsappQueues':return db[_0x14e486][_0x36ca('0x10')](queryQueues);case _0x36ca('0x11'):return db[_0x14e486][_0x36ca('0x10')](queryTelephones);case'Trunks':return db[_0x14e486][_0x36ca('0x10')](queryTrunks);case _0x36ca('0x12'):return db[_0x14e486][_0x36ca('0x10')](queryCampaigns);}}else{return db[_0x36ca('0x13')][_0x36ca('0x10')]({'attributes':[_0x36ca('0x14')],'where':{'sectionId':_0x5d42d8['id']},'raw':!![]})[_0x36ca('0x9')](function(_0x2b886e){if(_0x2b886e){var _0x104822={'where':{'id':_['map'](_0x2b886e,_0x36ca('0x14'))},'raw':!![]};switch(_0x14e486){case _0x36ca('0x15'):_0x104822[_0x36ca('0x16')][_0x36ca('0x17')]=_0x36ca('0x4');break;case'Campaign':_0x104822['where'][_0x36ca('0x5')]=_0x36ca('0x6');break;}return db[_0x14e486][_0x36ca('0x10')](_0x104822);}else{return[];}});}}else{return[];}})[_0x36ca('0x9')](function(_0xecb05b){return _0xecb05b;});}function joinOrLeaveQueues(_0x5a7096,_0x1726bf,_0x1d0d12,_0x379408){_0x5a7096[_0x1726bf](util[_0x36ca('0x18')](_0x36ca('0x19'),_0x1d0d12,_0x379408[_0x36ca('0x2')]));if(_0x379408[_0x36ca('0x3')]){for(var _0x1a50af=0x0;_0x1a50af<_0x379408['Agents'][_0x36ca('0x1a')];_0x1a50af+=0x1){_0x5a7096[_0x1726bf](util['format'](_0x36ca('0x1b'),_0x379408[_0x36ca('0x3')][_0x1a50af][_0x36ca('0x2')]));}}}function joinOrLeave(_0x106881,_0x48d3ea,_0x538ce5){var _0x136dd3;if(_0x106881[_0x36ca('0x1c')]['query']['id']){db[_0x36ca('0x15')][_0x36ca('0x1d')]({'attributes':['id',_0x36ca('0x2'),_0x36ca('0x17'),_0x36ca('0x1e')],'where':{'id':_0x106881['handshake'][_0x36ca('0x1f')]['id']},'include':[{'model':db[_0x36ca('0x20')],'as':_0x36ca('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x36ca('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x36ca('0x23')],'as':_0x36ca('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x36ca('0x25')],'as':_0x36ca('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x36ca('0x27')],'as':_0x36ca('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x36ca('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x36ca('0x9')](function(_0x46782f){if(_0x46782f){_0x136dd3=_0x46782f;_0x106881[_0x48d3ea](util[_0x36ca('0x18')](_0x36ca('0x1b'),_0x46782f[_0x36ca('0x2')]));var _0x4e70d0=[];switch(_0x46782f[_0x36ca('0x17')]){case _0x36ca('0x2a'):_0x106881[_0x48d3ea]('voice:inbound');_0x106881[_0x48d3ea](_0x36ca('0x2b'));if(queryQueues[_0x36ca('0x2c')](_0x36ca('0x2d'))){delete queryQueues[_0x36ca('0x2d')];}_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x2f')][_0x36ca('0x10')](queryQueues));_0x4e70d0['push'](db[_0x36ca('0x30')][_0x36ca('0x10')](queryQueues));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x31')]['findAll'](queryQueues));_0x4e70d0['push'](db['SmsQueue'][_0x36ca('0x10')](queryQueues));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x32')][_0x36ca('0x10')](queryQueues));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x33')][_0x36ca('0x10')](queryQueues));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x34')][_0x36ca('0x10')](queryQueues));_0x4e70d0['push'](db[_0x36ca('0x15')]['findAll'](queryTelephones));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x35')][_0x36ca('0x10')](queryTrunks));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x36')][_0x36ca('0x10')](queryCampaigns));_0x4e70d0[_0x36ca('0x2e')](db[_0x36ca('0x15')][_0x36ca('0x10')](queryAgents));break;case'user':_0x106881[_0x48d3ea](_0x36ca('0x37'));_0x106881[_0x48d3ea]('voice:outbound');_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0x38'),_0x46782f['userProfileId'],'VoiceQueue'));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources('ChatQueues',_0x46782f[_0x36ca('0x1e')],_0x36ca('0x30')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0xc'),_0x46782f[_0x36ca('0x1e')],_0x36ca('0x31')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0xd'),_0x46782f['userProfileId'],_0x36ca('0x39')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources('MailQueues',_0x46782f[_0x36ca('0x1e')],_0x36ca('0x32')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0xf'),_0x46782f['userProfileId'],_0x36ca('0x33')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources('WhatsappQueues',_0x46782f[_0x36ca('0x1e')],'WhatsappQueue'));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0x11'),_0x46782f[_0x36ca('0x1e')],_0x36ca('0x15')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0x3a'),_0x46782f['userProfileId'],_0x36ca('0x35')));_0x4e70d0[_0x36ca('0x2e')](getAssociatedResources(_0x36ca('0x12'),_0x46782f[_0x36ca('0x1e')],_0x36ca('0x36')));_0x4e70d0[_0x36ca('0x2e')](db['User'][_0x36ca('0x10')](queryAgents));break;case _0x36ca('0x3b'):_0x106881[_0x48d3ea](_0x36ca('0x37'));_0x106881[_0x48d3ea](_0x36ca('0x2b'));_0x4e70d0[_0x36ca('0x2e')](_0x46782f[_0x36ca('0x3c')]({'attributes':['id','name']}));_0x4e70d0[_0x36ca('0x2e')](_0x46782f[_0x36ca('0x3d')]({'attributes':['id','name']}));_0x4e70d0[_0x36ca('0x2e')](_0x46782f['getFaxQueues']({'attributes':['id',_0x36ca('0x2')]}));_0x4e70d0['push'](_0x46782f[_0x36ca('0x3e')]({'attributes':['id',_0x36ca('0x2')]}));_0x4e70d0[_0x36ca('0x2e')](_0x46782f[_0x36ca('0x3f')]({'attributes':['id','name']}));_0x4e70d0[_0x36ca('0x2e')](_0x46782f[_0x36ca('0x40')]({'attributes':['id','name']}));_0x4e70d0[_0x36ca('0x2e')](_0x46782f['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x36ca('0x41')](_0x4e70d0);}})[_0x36ca('0x9')](function(_0x449db9){if(_0x449db9&&_0x449db9[_0x36ca('0x1a')]){for(var _0x59745b=0x0;_0x59745b<_0x449db9[_0x36ca('0x1a')];_0x59745b+=0x1){for(var _0x26a06d=0x0;_0x26a06d<_0x449db9[_0x59745b]['length'];_0x26a06d+=0x1){switch(_0x59745b){case 0x0:joinOrLeaveQueues(_0x106881,_0x48d3ea,_0x36ca('0x42'),_0x449db9[_0x59745b][_0x26a06d]);break;case 0x1:joinOrLeaveQueues(_0x106881,_0x48d3ea,_0x36ca('0x43'),_0x449db9[_0x59745b][_0x26a06d]);break;case 0x2:joinOrLeaveQueues(_0x106881,_0x48d3ea,_0x36ca('0x44'),_0x449db9[_0x59745b][_0x26a06d]);break;case 0x3:joinOrLeaveQueues(_0x106881,_0x48d3ea,_0x36ca('0x45'),_0x449db9[_0x59745b][_0x26a06d]);break;case 0x4:joinOrLeaveQueues(_0x106881,_0x48d3ea,'mail',_0x449db9[_0x59745b][_0x26a06d]);break;case 0x5:joinOrLeaveQueues(_0x106881,_0x48d3ea,_0x36ca('0x46'),_0x449db9[_0x59745b][_0x26a06d]);break;case 0x6:joinOrLeaveQueues(_0x106881,_0x48d3ea,_0x36ca('0x47'),_0x449db9[_0x59745b][_0x26a06d]);break;case 0x7:if(_0x136dd3[_0x36ca('0x17')]!==_0x36ca('0x3b'))_0x106881[_0x48d3ea](util[_0x36ca('0x18')](_0x36ca('0x48'),_0x449db9[_0x59745b][_0x26a06d][_0x36ca('0x2')]));break;case 0x8:if(_0x136dd3[_0x36ca('0x17')]!==_0x36ca('0x3b'))_0x106881[_0x48d3ea](util[_0x36ca('0x18')](_0x36ca('0x49'),_0x449db9[_0x59745b][_0x26a06d][_0x36ca('0x2')]));break;case 0x9:if(_0x136dd3[_0x36ca('0x17')]!==_0x36ca('0x3b'))_0x106881[_0x48d3ea](util[_0x36ca('0x18')](_0x36ca('0x4a'),_0x449db9[_0x59745b][_0x26a06d][_0x36ca('0x5')],_0x449db9[_0x59745b][_0x26a06d][_0x36ca('0x2')]));break;case 0xa:_0x106881[_0x48d3ea](util['format'](_0x36ca('0x1b'),_0x449db9[_0x59745b][_0x26a06d]['name']));break;}}}}})['then'](function(){if(_0x48d3ea===_0x36ca('0x4b')){var _0xe72f5b=_[_0x36ca('0x4c')](_0x136dd3[_0x36ca('0x21')],'id');return _0x136dd3[_0x36ca('0x4d')](_0xe72f5b)[_0x36ca('0x9')](function(){for(var _0x2a28f9=0x0;_0x2a28f9<_0xe72f5b[_0x36ca('0x1a')];_0x2a28f9+=0x1){_0x538ce5[_0x36ca('0x4e')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xe72f5b[_0x2a28f9]),'UserId':Number(_0x136dd3['id'])});}});}})['then'](function(){if(_0x48d3ea==='leave'){var _0xdbed94=_[_0x36ca('0x4c')](_0x136dd3[_0x36ca('0x22')],'id');return _0x136dd3[_0x36ca('0x4f')](_0xdbed94)['then'](function(){for(var _0xbef05f=0x0;_0xbef05f<_0xdbed94['length'];_0xbef05f+=0x1){_0x538ce5[_0x36ca('0x4e')](_0x36ca('0x50'),{'MailInteractionId':Number(_0xdbed94[_0xbef05f]),'UserId':Number(_0x136dd3['id'])});}});}})[_0x36ca('0x9')](function(){if(_0x48d3ea==='leave'){var _0xeefe9c=_[_0x36ca('0x4c')](_0x136dd3[_0x36ca('0x24')],'id');return _0x136dd3[_0x36ca('0x51')](_0xeefe9c)[_0x36ca('0x9')](function(){for(var _0x4cecaf=0x0;_0x4cecaf<_0xeefe9c[_0x36ca('0x1a')];_0x4cecaf+=0x1){_0x538ce5[_0x36ca('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xeefe9c[_0x4cecaf]),'UserId':Number(_0x136dd3['id'])});}});}})[_0x36ca('0x9')](function(){if(_0x48d3ea===_0x36ca('0x4b')){var _0x31df78=_[_0x36ca('0x4c')](_0x136dd3[_0x36ca('0x26')],'id');return _0x136dd3[_0x36ca('0x52')](_0x31df78)[_0x36ca('0x9')](function(){for(var _0x123d5d=0x0;_0x123d5d<_0x31df78['length'];_0x123d5d+=0x1){_0x538ce5['emit'](_0x36ca('0x53'),{'SmsInteractionId':Number(_0x31df78[_0x123d5d]),'UserId':Number(_0x136dd3['id'])});}});}})['then'](function(){if(_0x48d3ea==='leave'){var _0x5140bb=_[_0x36ca('0x4c')](_0x136dd3[_0x36ca('0x28')],'id');return _0x136dd3[_0x36ca('0x54')](_0x5140bb)[_0x36ca('0x9')](function(){for(var _0x340202=0x0;_0x340202<_0x5140bb[_0x36ca('0x1a')];_0x340202+=0x1){_0x538ce5[_0x36ca('0x4e')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5140bb[_0x340202]),'UserId':Number(_0x136dd3['id'])});}});}})[_0x36ca('0x9')](function(){if(_0x48d3ea===_0x36ca('0x4b')){var _0x4e50fa=_[_0x36ca('0x4c')](_0x136dd3[_0x36ca('0x55')],'id');return _0x136dd3['removeWhatsappInteractions'](_0x4e50fa)[_0x36ca('0x9')](function(){for(var _0x49f170=0x0;_0x49f170<_0x4e50fa['length'];_0x49f170+=0x1){_0x538ce5[_0x36ca('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4e50fa[_0x49f170]),'UserId':Number(_0x136dd3['id'])});}});}})[_0x36ca('0x56')](function(_0x163421){_0x106881[_0x36ca('0x57')](_0x163421);});}}function onDisconnect(_0x1fd9fc,_0x33121f){joinOrLeave(_0x1fd9fc,_0x36ca('0x4b'),_0x33121f);}function onConnect(_0xd09182){joinOrLeave(_0xd09182,'join');}exports['default']=function(_0x321009){_0x321009['on'](_0x36ca('0x58'),function(_0x1154c6){_0x1154c6[_0x36ca('0x59')](0x0);_0x1154c6[_0x36ca('0x5a')]=_0x1154c6[_0x36ca('0x5b')][_0x36ca('0x58')]['remoteAddress']+':'+_0x1154c6[_0x36ca('0x5b')][_0x36ca('0x58')][_0x36ca('0x5c')];_0x1154c6[_0x36ca('0x5d')]=new Date();_0x1154c6[_0x36ca('0x57')]=function(_0x305e98){console[_0x36ca('0x57')](_0x36ca('0x5e')+_0x1154c6[_0x36ca('0x5f')][_0x36ca('0x2')]+'['+_0x1154c6['address']+']',_0x305e98);};_0x1154c6['on'](_0x36ca('0x60'),function(){onDisconnect(_0x1154c6,_0x321009);_0x1154c6['log']('DISCONNECTED');});onConnect(_0x1154c6);_0x1154c6[_0x36ca('0x57')](_0x36ca('0x61'));});};
\ No newline at end of file
+var _0xb89c=['nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','role','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','telephone','Campaign','format','%s:queue:%s','length','user:%s','handshake','User','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','FaxQueues','MailQueues','OpenchannelQueue','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','connectedAt','SocketIO\x20'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0xb89c,0x198));var _0xcb89=function(_0x30bdf2,_0x332d40){_0x30bdf2=_0x30bdf2-0x0;var _0xb0ab50=_0xb89c[_0x30bdf2];return _0xb0ab50;};'use strict';var _=require(_0xcb89('0x0'));var util=require(_0xcb89('0x1'));var BPromise=require(_0xcb89('0x2'));var db=require(_0xcb89('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xcb89('0x4')],'include':[{'as':_0xcb89('0x5'),'model':db['User'],'attributes':['id',_0xcb89('0x4'),_0xcb89('0x6')],'raw':!![],'where':{'role':_0xcb89('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xcb89('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xcb89('0x4')],'where':{'role':_0xcb89('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xcb89('0x8')],'where':{'type':_0xcb89('0x9')}};function getAssociatedResources(_0x5419ce,_0x4d7f50,_0x46aa90){return db['UserProfileSection'][_0xcb89('0xa')]({'where':{'name':_0x5419ce,'userProfileId':_0x4d7f50},'raw':!![]})[_0xcb89('0xb')](function(_0xbff62){if(_0xbff62){if(_0xbff62[_0xcb89('0xc')]){switch(_0x5419ce){case _0xcb89('0xd'):case _0xcb89('0xe'):case'FaxQueues':case _0xcb89('0xf'):case'MailQueues':case _0xcb89('0x10'):case _0xcb89('0x11'):return db[_0x46aa90][_0xcb89('0x12')](queryQueues);case _0xcb89('0x13'):return db[_0x46aa90][_0xcb89('0x12')](queryTelephones);case _0xcb89('0x14'):return db[_0x46aa90][_0xcb89('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x46aa90][_0xcb89('0x12')](queryCampaigns);}}else{return db[_0xcb89('0x15')]['findAll']({'attributes':[_0xcb89('0x16')],'where':{'sectionId':_0xbff62['id']},'raw':!![]})[_0xcb89('0xb')](function(_0x1805fa){if(_0x1805fa){var _0x50a395={'where':{'id':_[_0xcb89('0x17')](_0x1805fa,'resourceId')},'raw':!![]};switch(_0x46aa90){case'User':_0x50a395[_0xcb89('0x18')][_0xcb89('0x6')]=_0xcb89('0x19');break;case _0xcb89('0x1a'):_0x50a395[_0xcb89('0x18')][_0xcb89('0x8')]=_0xcb89('0x9');break;}return db[_0x46aa90][_0xcb89('0x12')](_0x50a395);}else{return[];}});}}else{return[];}})['then'](function(_0x122eae){return _0x122eae;});}function joinOrLeaveQueues(_0x2bcb0b,_0x5ec8a3,_0x4c3fb9,_0x4262ac){_0x2bcb0b[_0x5ec8a3](util[_0xcb89('0x1b')](_0xcb89('0x1c'),_0x4c3fb9,_0x4262ac[_0xcb89('0x4')]));if(_0x4262ac[_0xcb89('0x5')]){for(var _0x355994=0x0;_0x355994<_0x4262ac[_0xcb89('0x5')][_0xcb89('0x1d')];_0x355994+=0x1){_0x2bcb0b[_0x5ec8a3](util['format'](_0xcb89('0x1e'),_0x4262ac[_0xcb89('0x5')][_0x355994][_0xcb89('0x4')]));}}}function joinOrLeave(_0x25ed37,_0x5d164c,_0x136ecb){var _0x4e81e2;if(_0x25ed37[_0xcb89('0x1f')]['query']['id']){db[_0xcb89('0x20')][_0xcb89('0x21')]({'attributes':['id',_0xcb89('0x4'),'role',_0xcb89('0x22')],'where':{'id':_0x25ed37[_0xcb89('0x1f')][_0xcb89('0x23')]['id']},'include':[{'model':db[_0xcb89('0x24')],'as':_0xcb89('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xcb89('0x26')],'as':_0xcb89('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xcb89('0x28')],'as':_0xcb89('0x29'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xcb89('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xcb89('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xcb89('0xb')](function(_0x407daa){if(_0x407daa){_0x4e81e2=_0x407daa;_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x1e'),_0x407daa[_0xcb89('0x4')]));var _0x12ec9c=[];switch(_0x407daa[_0xcb89('0x6')]){case _0xcb89('0x2c'):_0x25ed37[_0x5d164c](_0xcb89('0x2d'));_0x25ed37[_0x5d164c](_0xcb89('0x2e'));if(queryQueues[_0xcb89('0x2f')]('include')){delete queryQueues['include'];}_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x31')]['findAll'](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x32')]['findAll'](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x33')][_0xcb89('0x12')](queryQueues));_0x12ec9c['push'](db[_0xcb89('0x34')]['findAll'](queryQueues));_0x12ec9c['push'](db[_0xcb89('0x35')][_0xcb89('0x12')](queryQueues));_0x12ec9c[_0xcb89('0x30')](db['OpenchannelQueue'][_0xcb89('0x12')](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x36')]['findAll'](queryQueues));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x20')][_0xcb89('0x12')](queryTelephones));_0x12ec9c[_0xcb89('0x30')](db[_0xcb89('0x37')][_0xcb89('0x12')](queryTrunks));_0x12ec9c['push'](db[_0xcb89('0x1a')][_0xcb89('0x12')](queryCampaigns));_0x12ec9c['push'](db[_0xcb89('0x20')][_0xcb89('0x12')](queryAgents));break;case _0xcb89('0x38'):_0x25ed37[_0x5d164c]('voice:inbound');_0x25ed37[_0x5d164c](_0xcb89('0x2e'));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0xd'),_0x407daa[_0xcb89('0x22')],_0xcb89('0x31')));_0x12ec9c['push'](getAssociatedResources('ChatQueues',_0x407daa[_0xcb89('0x22')],_0xcb89('0x32')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x39'),_0x407daa['userProfileId'],'FaxQueue'));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources('SmsQueues',_0x407daa[_0xcb89('0x22')],_0xcb89('0x34')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x3a'),_0x407daa['userProfileId'],_0xcb89('0x35')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x10'),_0x407daa[_0xcb89('0x22')],_0xcb89('0x3b')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x11'),_0x407daa['userProfileId'],_0xcb89('0x36')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources('Telephones',_0x407daa[_0xcb89('0x22')],'User'));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x14'),_0x407daa[_0xcb89('0x22')],_0xcb89('0x37')));_0x12ec9c[_0xcb89('0x30')](getAssociatedResources(_0xcb89('0x3c'),_0x407daa['userProfileId'],'Campaign'));_0x12ec9c['push'](db[_0xcb89('0x20')][_0xcb89('0x12')](queryAgents));break;case _0xcb89('0x7'):_0x25ed37[_0x5d164c](_0xcb89('0x2d'));_0x25ed37[_0x5d164c]('voice:outbound');_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x3d')]({'attributes':['id','name']}));_0x12ec9c['push'](_0x407daa[_0xcb89('0x3e')]({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x3f')]({'attributes':['id','name']}));_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x40')]({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c[_0xcb89('0x30')](_0x407daa['getMailQueues']({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c['push'](_0x407daa[_0xcb89('0x41')]({'attributes':['id',_0xcb89('0x4')]}));_0x12ec9c[_0xcb89('0x30')](_0x407daa[_0xcb89('0x42')]({'attributes':['id',_0xcb89('0x4')]}));break;}return BPromise['all'](_0x12ec9c);}})[_0xcb89('0xb')](function(_0x34f488){if(_0x34f488&&_0x34f488['length']){for(var _0x39ab55=0x0;_0x39ab55<_0x34f488[_0xcb89('0x1d')];_0x39ab55+=0x1){for(var _0x511841=0x0;_0x511841<_0x34f488[_0x39ab55]['length'];_0x511841+=0x1){switch(_0x39ab55){case 0x0:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x43'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x1:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x44'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x2:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x45'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x3:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x46'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x4:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x47'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x5:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x48'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x6:joinOrLeaveQueues(_0x25ed37,_0x5d164c,_0xcb89('0x49'),_0x34f488[_0x39ab55][_0x511841]);break;case 0x7:if(_0x4e81e2[_0xcb89('0x6')]!=='agent')_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x4a'),_0x34f488[_0x39ab55][_0x511841]['name']));break;case 0x8:if(_0x4e81e2[_0xcb89('0x6')]!=='agent')_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x4b'),_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x4')]));break;case 0x9:if(_0x4e81e2[_0xcb89('0x6')]!=='agent')_0x25ed37[_0x5d164c](util['format'](_0xcb89('0x4c'),_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x8')],_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x4')]));break;case 0xa:_0x25ed37[_0x5d164c](util[_0xcb89('0x1b')](_0xcb89('0x1e'),_0x34f488[_0x39ab55][_0x511841][_0xcb89('0x4')]));break;}}}}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x209157=_['map'](_0x4e81e2[_0xcb89('0x25')],'id');return _0x4e81e2[_0xcb89('0x4e')](_0x209157)[_0xcb89('0xb')](function(){for(var _0x5dd60f=0x0;_0x5dd60f<_0x209157[_0xcb89('0x1d')];_0x5dd60f+=0x1){_0x136ecb['emit'](_0xcb89('0x4f'),{'ChatInteractionId':Number(_0x209157[_0x5dd60f]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x14dd28=_[_0xcb89('0x17')](_0x4e81e2[_0xcb89('0x27')],'id');return _0x4e81e2[_0xcb89('0x50')](_0x14dd28)[_0xcb89('0xb')](function(){for(var _0x2759a5=0x0;_0x2759a5<_0x14dd28[_0xcb89('0x1d')];_0x2759a5+=0x1){_0x136ecb[_0xcb89('0x51')](_0xcb89('0x52'),{'MailInteractionId':Number(_0x14dd28[_0x2759a5]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x3c9494=_['map'](_0x4e81e2['FaxInteractions'],'id');return _0x4e81e2[_0xcb89('0x53')](_0x3c9494)[_0xcb89('0xb')](function(){for(var _0x50c87e=0x0;_0x50c87e<_0x3c9494['length'];_0x50c87e+=0x1){_0x136ecb[_0xcb89('0x51')](_0xcb89('0x54'),{'FaxInteractionId':Number(_0x3c9494[_0x50c87e]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x422e01=_[_0xcb89('0x17')](_0x4e81e2[_0xcb89('0x2a')],'id');return _0x4e81e2[_0xcb89('0x55')](_0x422e01)[_0xcb89('0xb')](function(){for(var _0x1c7de1=0x0;_0x1c7de1<_0x422e01[_0xcb89('0x1d')];_0x1c7de1+=0x1){_0x136ecb[_0xcb89('0x51')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x422e01[_0x1c7de1]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x596fdb=_[_0xcb89('0x17')](_0x4e81e2[_0xcb89('0x2b')],'id');return _0x4e81e2['removeOpenchannelInteractions'](_0x596fdb)[_0xcb89('0xb')](function(){for(var _0x3b3f16=0x0;_0x3b3f16<_0x596fdb[_0xcb89('0x1d')];_0x3b3f16+=0x1){_0x136ecb['emit'](_0xcb89('0x56'),{'OpenchannelInteractionId':Number(_0x596fdb[_0x3b3f16]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0xb')](function(){if(_0x5d164c===_0xcb89('0x4d')){var _0x252414=_[_0xcb89('0x17')](_0x4e81e2['WhatsappInteractions'],'id');return _0x4e81e2['removeWhatsappInteractions'](_0x252414)[_0xcb89('0xb')](function(){for(var _0x2e2456=0x0;_0x2e2456<_0x252414[_0xcb89('0x1d')];_0x2e2456+=0x1){_0x136ecb[_0xcb89('0x51')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x252414[_0x2e2456]),'UserId':Number(_0x4e81e2['id'])});}});}})[_0xcb89('0x57')](function(_0x204929){_0x25ed37[_0xcb89('0x58')](_0x204929);});}}function onDisconnect(_0x33a9ce,_0x57cd89){joinOrLeave(_0x33a9ce,_0xcb89('0x4d'),_0x57cd89);}function onConnect(_0x3294bc){joinOrLeave(_0x3294bc,_0xcb89('0x59'));}exports[_0xcb89('0x5a')]=function(_0x9eff03){_0x9eff03['on'](_0xcb89('0x5b'),function(_0x4aa066){_0x4aa066[_0xcb89('0x5c')](0x0);_0x4aa066['address']=_0x4aa066[_0xcb89('0x5d')][_0xcb89('0x5b')][_0xcb89('0x5e')]+':'+_0x4aa066['request'][_0xcb89('0x5b')]['remotePort'];_0x4aa066[_0xcb89('0x5f')]=new Date();_0x4aa066[_0xcb89('0x58')]=function(_0xb25ecf){console[_0xcb89('0x58')](_0xcb89('0x60')+_0x4aa066[_0xcb89('0x61')]['name']+'['+_0x4aa066['address']+']',_0xb25ecf);};_0x4aa066['on'](_0xcb89('0x62'),function(){onDisconnect(_0x4aa066,_0x9eff03);_0x4aa066['log'](_0xcb89('0x63'));});onConnect(_0x4aa066);_0x4aa066[_0xcb89('0x58')](_0xcb89('0x64'));});};
\ No newline at end of file
index 2e82cd9..c4291d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe43=['SmsInteraction','afterCreate','newmessage','Whatsapp','WhatsappInteraction','afterUpdate','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','catch','Trigger,\x20%s','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','find','UserId','name','fullname','email','internal','format','SIP/%s','agent','incomingmessage','outgoingmessage','opened','query','Sequelize','contact','changed','closed','interface','hasOwnProperty','callback','toLowerCase','condition','jayson/promise','../logger','triggers','client','newinteraction','Chat','closedinteraction','ChatMessage','Sms'];(function(_0x512aa0,_0x4134bb){var _0x490582=function(_0x13f1e5){while(--_0x13f1e5){_0x512aa0['push'](_0x512aa0['shift']());}};_0x490582(++_0x4134bb);}(_0xbe43,0xfb));var _0x3be4=function(_0x5b3716,_0x389169){_0x5b3716=_0x5b3716-0x0;var _0x55eef7=_0xbe43[_0x5b3716];return _0x55eef7;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0x3be4('0x0'));var logger=require(_0x3be4('0x1'))(_0x3be4('0x2'));var _=require('lodash');var client=jayson[_0x3be4('0x3')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':'afterCreate','condition':_0x3be4('0x4'),'callback':afterCreate},{'channel':_0x3be4('0x5'),'model':'ChatInteraction','event':'afterUpdate','condition':_0x3be4('0x6'),'callback':afterUpdate},{'channel':_0x3be4('0x5'),'model':_0x3be4('0x7'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x3be4('0x8'),'model':_0x3be4('0x9'),'event':_0x3be4('0xa'),'condition':_0x3be4('0x4'),'callback':afterCreate},{'channel':_0x3be4('0x8'),'model':_0x3be4('0x9'),'event':'afterUpdate','condition':_0x3be4('0x6'),'callback':afterUpdate},{'channel':_0x3be4('0x8'),'model':'SmsMessage','event':_0x3be4('0xa'),'condition':_0x3be4('0xb'),'callback':afterCreateMessage},{'channel':_0x3be4('0xc'),'model':_0x3be4('0xd'),'event':_0x3be4('0xa'),'condition':_0x3be4('0x4'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x3be4('0xd'),'event':_0x3be4('0xe'),'condition':_0x3be4('0x6'),'callback':afterUpdate},{'channel':_0x3be4('0xc'),'model':_0x3be4('0xf'),'event':_0x3be4('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x3be4('0x10'),'model':_0x3be4('0x11'),'event':_0x3be4('0xa'),'condition':_0x3be4('0x4'),'callback':afterCreate},{'channel':'Fax','model':'FaxInteraction','event':_0x3be4('0xe'),'condition':_0x3be4('0x6'),'callback':afterUpdate},{'channel':_0x3be4('0x10'),'model':_0x3be4('0x12'),'event':_0x3be4('0xa'),'condition':_0x3be4('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x3be4('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x3be4('0x13'),'model':_0x3be4('0x14'),'event':_0x3be4('0xe'),'condition':_0x3be4('0x6'),'callback':afterUpdate},{'channel':_0x3be4('0x13'),'model':_0x3be4('0x15'),'event':_0x3be4('0xa'),'condition':_0x3be4('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':'afterCreate','condition':_0x3be4('0x4'),'callback':afterCreate},{'channel':_0x3be4('0x16'),'model':_0x3be4('0x17'),'event':_0x3be4('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x3be4('0x16'),'model':_0x3be4('0x18'),'event':'afterCreate','condition':_0x3be4('0xb'),'callback':afterCreateMessage}];function request(_0x42929c){return client[_0x3be4('0x19')](_0x3be4('0x1a'),_0x42929c)[_0x3be4('0x1b')](function(_0x56919e){logger[_0x3be4('0x1c')]('Trigger,\x20%s',_0x3be4('0x1a'),_0x56919e);if(_0x56919e[_0x3be4('0x1d')]){if(_0x56919e['error'][_0x3be4('0x1e')]===0x1f4){logger[_0x3be4('0x1d')]('Trigger,\x20%s',_0x3be4('0x1a'),_0x56919e['error']);}}})[_0x3be4('0x1f')](function(_0x105bae){logger[_0x3be4('0x1d')](_0x3be4('0x20'),'EventManager',_0x105bae);});}function afterCreateMessage(_0x43907d,_0x44ea6e){return function(_0x33e6ae,_0x43b4ca){_0x33e6ae=_0x33e6ae[_0x3be4('0x21')]({'plain':!![]});_0x33e6ae[_0x3be4('0x22')]=_0x43907d;_0x33e6ae[_0x3be4('0x23')]=_0x33e6ae[_0x3be4('0x24')];var _0x3832f1=_0x3be4('0x25')+_0x33e6ae[_0x3be4('0x26')];return db[_0x3be4('0x27')]['query'](_0x3832f1,{'type':db['Sequelize'][_0x3be4('0x28')][_0x3be4('0x29')],'raw':!![]})[_0x3be4('0x1b')](function(_0x429f1d){return _0x429f1d;})[_0x3be4('0x1b')](function(_0xb62c46){if(_0xb62c46){_0x33e6ae['contact']=_0xb62c46[0x0];}if(_0x33e6ae['UserId']){return db[_0x3be4('0x2a')][_0x3be4('0x2b')]({'where':{'id':_0x33e6ae[_0x3be4('0x2c')]},'attributes':['id',_0x3be4('0x2d'),_0x3be4('0x2e'),_0x3be4('0x2f'),_0x3be4('0x30')],'raw':!![]})[_0x3be4('0x1b')](function(_0x5daf4a){_0x33e6ae['interface']=util[_0x3be4('0x31')](_0x3be4('0x32'),_0x5daf4a[_0x3be4('0x2d')]);_0x33e6ae[_0x3be4('0x22')]=_0x43907d;_0x33e6ae[_0x3be4('0x33')]=_0x5daf4a;return request({'event':_0x3be4('0x34'),'message':_0x33e6ae});})[_0x3be4('0x1f')](function(_0x575826){console[_0x3be4('0x1d')](_0x575826);});}else{return request({'event':_0x3be4('0x35'),'message':_0x33e6ae});}});};}function afterCreate(_0x366ac9,_0xe60827){return function(_0x2dc61d,_0x13d59e){_0x2dc61d=_0x2dc61d['get']({'plain':!![]});_0x2dc61d[_0x3be4('0x22')]=_0x366ac9;_0x2dc61d[_0x3be4('0x23')]=_0x3be4('0x36');var _0x3ffe09='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2dc61d[_0x3be4('0x26')];return db[_0x3be4('0x27')][_0x3be4('0x37')](_0x3ffe09,{'type':db[_0x3be4('0x38')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3be4('0x1b')](function(_0x1e4fe1){return _0x1e4fe1;})[_0x3be4('0x1b')](function(_0x4960b2){if(_0x4960b2){_0x2dc61d[_0x3be4('0x39')]=_0x4960b2[0x0];}return request({'event':_0xe60827,'message':_0x2dc61d});});};}function afterUpdate(_0x2d50a0,_0x513e5c){return function(_0x117870,_0x23d326){if(_0x117870[_0x3be4('0x3a')](_0x3be4('0x3b'))&&_0x117870['closed']){_0x117870=_0x117870['get']({'plain':!![]});_0x117870[_0x3be4('0x22')]=_0x2d50a0;_0x117870[_0x3be4('0x23')]=_0x3be4('0x3b');var _0x4aac4b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x117870[_0x3be4('0x26')];return db[_0x3be4('0x27')][_0x3be4('0x37')](_0x4aac4b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x3be4('0x1b')](function(_0x2055a9){return _0x2055a9;})[_0x3be4('0x1b')](function(_0x200f47){if(_0x200f47){_0x117870[_0x3be4('0x39')]=_0x200f47[0x0];}if(_0x117870[_0x3be4('0x2c')]){return db[_0x3be4('0x2a')]['find']({'where':{'id':_0x117870[_0x3be4('0x2c')]},'attributes':['id','name',_0x3be4('0x2e'),_0x3be4('0x2f'),'internal'],'raw':!![]})['then'](function(_0x49e315){_0x117870[_0x3be4('0x3c')]=util[_0x3be4('0x31')](_0x3be4('0x32'),_0x49e315['name']);_0x117870[_0x3be4('0x33')]=_0x49e315;return request({'event':_0x513e5c,'message':_0x117870});})[_0x3be4('0x1f')](function(_0x23a262){console[_0x3be4('0x1d')](_0x23a262);});}else{return request({'event':_0x513e5c,'message':_0x117870});}});}};}exports['default']=function(){for(var _0x2a05a1=0x0;_0x2a05a1<triggers['length'];_0x2a05a1+=0x1){if(db[_0x3be4('0x3d')](triggers[_0x2a05a1]['model'])){db[triggers[_0x2a05a1]['model']]['hook'](triggers[_0x2a05a1]['event'],triggers[_0x2a05a1][_0x3be4('0x3e')](triggers[_0x2a05a1][_0x3be4('0x22')][_0x3be4('0x3f')](),triggers[_0x2a05a1][_0x3be4('0x40')]));}}};
\ No newline at end of file
+var _0xd74b=['Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','Trigger,\x20%s','error','code','catch','channel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','QueryTypes','SELECT','contact','find','UserId','fullname','email','internal','interface','format','SIP/%s','agent','incomingmessage','outgoingmessage','get','opened','ContactId','changed','closed','sequelize','Sequelize','name','default','length','hasOwnProperty','model','callback','toLowerCase','jayson/promise','../logger','triggers','lodash','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage'];(function(_0xa530be,_0x50eae3){var _0x4ed49b=function(_0x3c41e1){while(--_0x3c41e1){_0xa530be['push'](_0xa530be['shift']());}};_0x4ed49b(++_0x50eae3);}(_0xd74b,0xf3));var _0xbd74=function(_0xb7d070,_0x47bf37){_0xb7d070=_0xb7d070-0x0;var _0x277860=_0xd74b[_0xb7d070];return _0x277860;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0xbd74('0x0'));var logger=require(_0xbd74('0x1'))(_0xbd74('0x2'));var _=require(_0xbd74('0x3'));var client=jayson['client'][_0xbd74('0x4')]({'port':0x232a});var triggers=[{'channel':_0xbd74('0x5'),'model':'ChatInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x5'),'model':_0xbd74('0x8'),'event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x5'),'model':_0xbd74('0xb'),'event':_0xbd74('0x6'),'condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0xd'),'model':_0xbd74('0xe'),'event':'afterCreate','condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0xd'),'model':_0xbd74('0xe'),'event':'afterUpdate','condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0xd'),'model':_0xbd74('0xf'),'event':_0xbd74('0x6'),'condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0x10'),'model':'WhatsappInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x10'),'model':_0xbd74('0x11'),'event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xbd74('0x12'),'model':'FaxInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x12'),'model':'FaxInteraction','event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x12'),'model':_0xbd74('0x13'),'event':_0xbd74('0x6'),'condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0x14'),'model':_0xbd74('0x15'),'event':'afterCreate','condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x14'),'model':_0xbd74('0x15'),'event':_0xbd74('0x9'),'condition':_0xbd74('0xa'),'callback':afterUpdate},{'channel':_0xbd74('0x14'),'model':_0xbd74('0x16'),'event':'afterCreate','condition':_0xbd74('0xc'),'callback':afterCreateMessage},{'channel':_0xbd74('0x17'),'model':'OpenchannelInteraction','event':_0xbd74('0x6'),'condition':_0xbd74('0x7'),'callback':afterCreate},{'channel':_0xbd74('0x17'),'model':_0xbd74('0x18'),'event':_0xbd74('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0xbd74('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x47d2c2){return client[_0xbd74('0x19')](_0xbd74('0x1a'),_0x47d2c2)[_0xbd74('0x1b')](function(_0x7adeb0){logger['info'](_0xbd74('0x1c'),_0xbd74('0x1a'),_0x7adeb0);if(_0x7adeb0[_0xbd74('0x1d')]){if(_0x7adeb0[_0xbd74('0x1d')][_0xbd74('0x1e')]===0x1f4){logger[_0xbd74('0x1d')](_0xbd74('0x1c'),_0xbd74('0x1a'),_0x7adeb0[_0xbd74('0x1d')]);}}})[_0xbd74('0x1f')](function(_0x3888a0){logger[_0xbd74('0x1d')](_0xbd74('0x1c'),_0xbd74('0x1a'),_0x3888a0);});}function afterCreateMessage(_0x1dbeeb,_0x27c384){return function(_0x4896b6,_0x1eaa29){_0x4896b6=_0x4896b6['get']({'plain':!![]});_0x4896b6[_0xbd74('0x20')]=_0x1dbeeb;_0x4896b6[_0xbd74('0x21')]=_0x4896b6['direction'];var _0x701030=_0xbd74('0x22')+_0x4896b6['ContactId'];return db['sequelize'][_0xbd74('0x23')](_0x701030,{'type':db['Sequelize'][_0xbd74('0x24')][_0xbd74('0x25')],'raw':!![]})[_0xbd74('0x1b')](function(_0x5e2301){return _0x5e2301;})[_0xbd74('0x1b')](function(_0x3cac0c){if(_0x3cac0c){_0x4896b6[_0xbd74('0x26')]=_0x3cac0c[0x0];}if(_0x4896b6['UserId']){return db['User'][_0xbd74('0x27')]({'where':{'id':_0x4896b6[_0xbd74('0x28')]},'attributes':['id','name',_0xbd74('0x29'),_0xbd74('0x2a'),_0xbd74('0x2b')],'raw':!![]})[_0xbd74('0x1b')](function(_0x5a6469){_0x4896b6[_0xbd74('0x2c')]=util[_0xbd74('0x2d')](_0xbd74('0x2e'),_0x5a6469['name']);_0x4896b6[_0xbd74('0x20')]=_0x1dbeeb;_0x4896b6[_0xbd74('0x2f')]=_0x5a6469;return request({'event':_0xbd74('0x30'),'message':_0x4896b6});})[_0xbd74('0x1f')](function(_0xa0cd06){console[_0xbd74('0x1d')](_0xa0cd06);});}else{return request({'event':_0xbd74('0x31'),'message':_0x4896b6});}});};}function afterCreate(_0x3a0d7e,_0x2e05b6){return function(_0x3e8b75,_0x832506){_0x3e8b75=_0x3e8b75[_0xbd74('0x32')]({'plain':!![]});_0x3e8b75[_0xbd74('0x20')]=_0x3a0d7e;_0x3e8b75[_0xbd74('0x21')]=_0xbd74('0x33');var _0x306da6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e8b75[_0xbd74('0x34')];return db['sequelize'][_0xbd74('0x23')](_0x306da6,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xbd74('0x1b')](function(_0xbb5d1b){return _0xbb5d1b;})[_0xbd74('0x1b')](function(_0x326cf8){if(_0x326cf8){_0x3e8b75['contact']=_0x326cf8[0x0];}return request({'event':_0x2e05b6,'message':_0x3e8b75});});};}function afterUpdate(_0x4a2122,_0x2fd4f8){return function(_0x2e61fc,_0x3e6488){if(_0x2e61fc[_0xbd74('0x35')]('closed')&&_0x2e61fc[_0xbd74('0x36')]){_0x2e61fc=_0x2e61fc[_0xbd74('0x32')]({'plain':!![]});_0x2e61fc[_0xbd74('0x20')]=_0x4a2122;_0x2e61fc[_0xbd74('0x21')]=_0xbd74('0x36');var _0x4b070a=_0xbd74('0x22')+_0x2e61fc[_0xbd74('0x34')];return db[_0xbd74('0x37')][_0xbd74('0x23')](_0x4b070a,{'type':db[_0xbd74('0x38')][_0xbd74('0x24')][_0xbd74('0x25')],'raw':!![]})['then'](function(_0x2a50d8){return _0x2a50d8;})[_0xbd74('0x1b')](function(_0x258449){if(_0x258449){_0x2e61fc[_0xbd74('0x26')]=_0x258449[0x0];}if(_0x2e61fc[_0xbd74('0x28')]){return db['User'][_0xbd74('0x27')]({'where':{'id':_0x2e61fc['UserId']},'attributes':['id',_0xbd74('0x39'),_0xbd74('0x29'),'email',_0xbd74('0x2b')],'raw':!![]})[_0xbd74('0x1b')](function(_0x24208d){_0x2e61fc[_0xbd74('0x2c')]=util[_0xbd74('0x2d')](_0xbd74('0x2e'),_0x24208d['name']);_0x2e61fc['agent']=_0x24208d;return request({'event':_0x2fd4f8,'message':_0x2e61fc});})[_0xbd74('0x1f')](function(_0x224a11){console[_0xbd74('0x1d')](_0x224a11);});}else{return request({'event':_0x2fd4f8,'message':_0x2e61fc});}});}};}exports[_0xbd74('0x3a')]=function(){for(var _0x423f57=0x0;_0x423f57<triggers[_0xbd74('0x3b')];_0x423f57+=0x1){if(db[_0xbd74('0x3c')](triggers[_0x423f57][_0xbd74('0x3d')])){db[triggers[_0x423f57]['model']]['hook'](triggers[_0x423f57][_0xbd74('0x21')],triggers[_0x423f57][_0xbd74('0x3e')](triggers[_0x423f57][_0xbd74('0x20')][_0xbd74('0x3f')](),triggers[_0x423f57]['condition']));}}};
\ No newline at end of file
index bd63436..dfbb7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8acd=['includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','agent','count','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','./license/util','voice','mail','fax','openchannel','getChannels','toLowerCase'];(function(_0x3e5efc,_0x3389e4){var _0x4d7e2a=function(_0x5f114f){while(--_0x5f114f){_0x3e5efc['push'](_0x3e5efc['shift']());}};_0x4d7e2a(++_0x3389e4);}(_0x8acd,0xf7));var _0xd8ac=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0x8acd[_0x5cbd7b];return _0x3fdfb8;};'use strict';var _=require(_0xd8ac('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xd8ac('0x1'));var channels=[_0xd8ac('0x2'),_0xd8ac('0x3'),'chat',_0xd8ac('0x4'),'sms','whatsapp',_0xd8ac('0x5')];exports[_0xd8ac('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x129332){_0x129332=_0x129332[_0xd8ac('0x7')]();return _[_0xd8ac('0x8')](channels,_0x129332);};exports[_0xd8ac('0x9')]=function(_0x44928d,_0x45808b,_0x142d75,_0x24123e){var _0x1ca14f={'loginAttempts':_0x45808b,'blocked':_0x142d75};if(!_[_0xd8ac('0xa')](_0x24123e)){_0x1ca14f[_0xd8ac('0xb')]=_0x24123e;}return _0x44928d[_0xd8ac('0xc')](_0x1ca14f);};exports['getLicense']=function(_0x4e8f66){return new BPromise(function(_0x1fea51,_0x225923){var _0x570c46=0x0;if(_0x4e8f66['role']!==_0xd8ac('0xd')){_0x1fea51(_0x4e8f66);}db['User'][_0xd8ac('0xe')]({'where':{'role':_0xd8ac('0xd'),'online':!![],'id':{'$ne':_0x4e8f66['id']}}})['then'](function(_0x134c4d){_0x570c46=_0x134c4d;return util['getLicense']();})['then'](function(_0x59a6ca){if(_0x59a6ca&&_0x59a6ca[_0xd8ac('0xf')]&&_0x570c46>=_0x59a6ca[_0xd8ac('0xf')]){throw Error(_0xd8ac('0x10'));}_0x1fea51(_0x4e8f66);})['catch'](function(_0x26a975){_0x225923(_0x26a975);});});};
\ No newline at end of file
+var _0xde60=['role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xde60,0xde));var _0x0de6=function(_0x593f03,_0x4af84a){_0x593f03=_0x593f03-0x0;var _0x178299=_0xde60[_0x593f03];return _0x178299;};'use strict';var _=require(_0x0de6('0x0'));var BPromise=require(_0x0de6('0x1'));var db=require(_0x0de6('0x2'))['db'];var util=require(_0x0de6('0x3'));var channels=[_0x0de6('0x4'),_0x0de6('0x5'),_0x0de6('0x6'),_0x0de6('0x7'),_0x0de6('0x8'),_0x0de6('0x9'),_0x0de6('0xa')];exports[_0x0de6('0xb')]=function(){return channels;};exports['isValidChannel']=function(_0x1ddd34){_0x1ddd34=_0x1ddd34['toLowerCase']();return _[_0x0de6('0xc')](channels,_0x1ddd34);};exports[_0x0de6('0xd')]=function(_0x47b8b9,_0xf80a30,_0x2ea68b,_0x5b3b2d){var _0x108d54={'loginAttempts':_0xf80a30,'blocked':_0x2ea68b};if(!_[_0x0de6('0xe')](_0x5b3b2d)){_0x108d54[_0x0de6('0xf')]=_0x5b3b2d;}return _0x47b8b9[_0x0de6('0x10')](_0x108d54);};exports[_0x0de6('0x11')]=function(_0x9a3f6a){return new BPromise(function(_0x3ccdfb,_0x371c51){var _0x1046fc=0x0;if(_0x9a3f6a[_0x0de6('0x12')]!==_0x0de6('0x13')){_0x3ccdfb(_0x9a3f6a);}db[_0x0de6('0x14')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x9a3f6a['id']}}})[_0x0de6('0x15')](function(_0x2a7758){_0x1046fc=_0x2a7758;return util[_0x0de6('0x11')]();})['then'](function(_0x4ae849){if(_0x4ae849&&_0x4ae849[_0x0de6('0x16')]&&_0x1046fc>=_0x4ae849[_0x0de6('0x16')]){throw Error(_0x0de6('0x17'));}_0x3ccdfb(_0x9a3f6a);})['catch'](function(_0x2ae5e8){_0x371c51(_0x2ae5e8);});});};
\ No newline at end of file
index 5c61441..04dfdab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a3f=['404','status','render','send','exports'];(function(_0x219cd8,_0x3d26e7){var _0x339d00=function(_0x188c51){while(--_0x188c51){_0x219cd8['push'](_0x219cd8['shift']());}};_0x339d00(++_0x3d26e7);}(_0x1a3f,0x68));var _0xf1a3=function(_0x262285,_0x470513){_0x262285=_0x262285-0x0;var _0x34d05f=_0x1a3f[_0x262285];return _0x34d05f;};'use strict';module[_0xf1a3('0x0')][0x194]=function pageNotFound(_0x4e91c3,_0x273001){var _0x6ce327=_0xf1a3('0x1');var _0x15706e=0x194;var _0x4bc173={'status':_0x15706e};_0x273001[_0xf1a3('0x2')](_0x4bc173[_0xf1a3('0x2')]);_0x273001[_0xf1a3('0x3')](_0x6ce327,{},function(_0x523755,_0x122c82){if(_0x523755){return _0x273001[_0xf1a3('0x2')](_0x4bc173[_0xf1a3('0x2')])['json'](_0x4bc173);}_0x273001[_0xf1a3('0x4')](_0x122c82);});};
\ No newline at end of file
+var _0x66e5=['json','exports','status','render'];(function(_0x3e07aa,_0x124658){var _0x502b74=function(_0x3c251c){while(--_0x3c251c){_0x3e07aa['push'](_0x3e07aa['shift']());}};_0x502b74(++_0x124658);}(_0x66e5,0x1a1));var _0x566e=function(_0x3ec0e8,_0x485a9d){_0x3ec0e8=_0x3ec0e8-0x0;var _0x26fd54=_0x66e5[_0x3ec0e8];return _0x26fd54;};'use strict';module[_0x566e('0x0')][0x194]=function pageNotFound(_0x5b934e,_0x5e02a4){var _0x10680e='404';var _0x473887=0x194;var _0x1bb931={'status':_0x473887};_0x5e02a4[_0x566e('0x1')](_0x1bb931[_0x566e('0x1')]);_0x5e02a4[_0x566e('0x2')](_0x10680e,{},function(_0x54866a,_0x36fb76){if(_0x54866a){return _0x5e02a4[_0x566e('0x1')](_0x1bb931[_0x566e('0x1')])[_0x566e('0x3')](_0x1bb931);}_0x5e02a4['send'](_0x36fb76);});};
\ No newline at end of file
index 8ec1b24..b3d2d0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c80=['AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','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','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueue','FaxQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sound','moh_has_sounds','VoiceQueueId','HopperHistories','ReportAgentPreview','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailbox','mailboxuser','uniqueid','AgentReports','MailAccountId','hasOne','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','ListId','mandatoryDispositionPause','Teams','MailInteractionId','Account','ContactId','Owner','Tags','ThroughTags','Users','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','UserFaxQueue','team_has_fax_queues','SmsAccountId','SmsApplication','SmsMessage','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','Agent','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','Hoppers','SmsInteractions','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','OneAny','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','mail_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','SalesforceAccount','Configurations','SubjectId','DescriptionId','Subject','Description','Field','FieldId','Variable','VariableId','Subjects','Descriptions','SugarcrmAccount','AccountId','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowField','Dynamics365Configuration','FromId','ToId','SessionId','ProjectId','user_has_square_projects','team_has_mail_queues','SmsQueues','team_has_whatsapp_queues','SquareProjectId','BlackLists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','sequelizeHistory','utf8mb4','utf8','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsInteraction','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model'];(function(_0x19b082,_0x4749a9){var _0x34bb24=function(_0x4405b5){while(--_0x4405b5){_0x19b082['push'](_0x19b082['shift']());}};_0x34bb24(++_0x4749a9);}(_0x6c80,0x151));var _0x06c8=function(_0x3d876d,_0x78c56b){_0x3d876d=_0x3d876d-0x0;var _0x507407=_0x6c80[_0x3d876d];return _0x507407;};'use strict';var path=require(_0x06c8('0x0'));var config=require('../config/environment');var Sequelize=require(_0x06c8('0x1'));var _=require(_0x06c8('0x2'));var jstz=require(_0x06c8('0x3'));var timezone=jstz['determine']();config[_0x06c8('0x1')]=_[_0x06c8('0x4')](config[_0x06c8('0x1')],{'database':_0x06c8('0x5'),'username':_0x06c8('0x6'),'password':_0x06c8('0x7'),'options':{'host':_0x06c8('0x8'),'port':0xcea,'dialect':_0x06c8('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x06c8('0xa')](),'define':{'charset':'utf8','collate':_0x06c8('0xb')}}});config[_0x06c8('0xc')]=_[_0x06c8('0x4')](config[_0x06c8('0xc')],{'database':_0x06c8('0x5'),'username':_0x06c8('0x6'),'password':_0x06c8('0x7'),'options':{'host':_0x06c8('0x8'),'port':0xcea,'dialect':_0x06c8('0x9'),'dialectOptions':{'charset':_0x06c8('0xd')},'logging':![],'timezone':timezone[_0x06c8('0xa')](),'define':{'charset':_0x06c8('0xe'),'collate':_0x06c8('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x06c8('0x1')][_0x06c8('0xf')],config[_0x06c8('0x1')]['username'],config[_0x06c8('0x1')][_0x06c8('0x10')],config[_0x06c8('0x1')][_0x06c8('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x06c8('0xc')][_0x06c8('0xf')],config[_0x06c8('0xc')][_0x06c8('0x12')],config[_0x06c8('0xc')][_0x06c8('0x10')],config[_0x06c8('0xc')][_0x06c8('0x11')])};db[_0x06c8('0x13')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x15'));db[_0x06c8('0x16')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x17'));db['VoiceContext']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x18'));db[_0x06c8('0x19')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x1a'));db[_0x06c8('0x1b')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x1c'));db[_0x06c8('0x1d')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x1e'));db['VoiceRecording']=db[_0x06c8('0x1')]['import'](_0x06c8('0x1f'));db['ScreenRecording']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x20'));db[_0x06c8('0x21')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x22'));db[_0x06c8('0x23')]=db['sequelize']['import'](_0x06c8('0x24'));db[_0x06c8('0x25')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x26'));db[_0x06c8('0x27')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0x06c8('0x28')]=db['sequelize'][_0x06c8('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x29'));db['MemberReport']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x2a'));db[_0x06c8('0x2b')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x2c'));db[_0x06c8('0x2d')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x2e'));db[_0x06c8('0x2f')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x30'));db[_0x06c8('0x31')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x32'));db[_0x06c8('0x33')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x34'));db[_0x06c8('0x35')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x36'));db['UserFaxQueue']=db['sequelize']['import'](_0x06c8('0x37'));db[_0x06c8('0x38')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x39'));db[_0x06c8('0x3a')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x06c8('0x3b')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x3c'));db[_0x06c8('0x3d')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x3e'));db[_0x06c8('0x3f')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x40'));db[_0x06c8('0x41')]=db['sequelize'][_0x06c8('0x14')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x42'));db[_0x06c8('0x43')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x44'));db[_0x06c8('0x45')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0x06c8('0x46')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/mailApplication/mailApplication.model');db[_0x06c8('0x47')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x48'));db[_0x06c8('0x49')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x4a'));db[_0x06c8('0x4b')]=db['sequelize']['import'](_0x06c8('0x4c'));db[_0x06c8('0x4d')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x4e'));db[_0x06c8('0x4f')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x50'));db[_0x06c8('0x51')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x52'));db[_0x06c8('0x53')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x54'));db['FaxQueue']=db['sequelize'][_0x06c8('0x14')]('../api/faxQueue/faxQueue.model');db[_0x06c8('0x55')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x56'));db['SmsAccount']=db[_0x06c8('0x1')]['import'](_0x06c8('0x57'));db['SmsApplication']=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/smsApplication/smsApplication.model');db[_0x06c8('0x58')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/smsMessage/smsMessage.model');db[_0x06c8('0x59')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x5a'));db[_0x06c8('0x5b')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x5c'));db[_0x06c8('0x5d')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x5e'));db[_0x06c8('0x5f')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x60'));db['OpenchannelMessage']=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/openchannelMessage/openchannelMessage.model');db[_0x06c8('0x61')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x62'));db['ChatWebsite']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x63'));db[_0x06c8('0x64')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x65'));db[_0x06c8('0x66')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x67'));db[_0x06c8('0x68')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db['sequelize']['import'](_0x06c8('0x69'));db[_0x06c8('0x6a')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x6b'));db[_0x06c8('0x6c')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x6d'));db[_0x06c8('0x6e')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x6f'));db[_0x06c8('0x70')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x71'));db[_0x06c8('0x72')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/cmCompany/cmCompany.model');db[_0x06c8('0x73')]=db['sequelize'][_0x06c8('0x14')]('../api/cmContact/cmContact.model');db[_0x06c8('0x74')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x75'));db['CmHopperBlack']=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x06c8('0x76')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x77'));db[_0x06c8('0x78')]=db[_0x06c8('0x1')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x79'));db[_0x06c8('0x7a')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x7b'));db[_0x06c8('0x7c')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x7d'));db[_0x06c8('0x7e')]=db['sequelize'][_0x06c8('0x14')]('../api/automation/automation.model');db[_0x06c8('0x7f')]=db['sequelize']['import'](_0x06c8('0x80'));db[_0x06c8('0x81')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x82'));db['Condition']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x83'));db[_0x06c8('0x84')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x85'));db[_0x06c8('0x86')]=db['sequelize']['import']('../api/pause/pause.model');db[_0x06c8('0x87')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x88'));db[_0x06c8('0x89')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x8a'));db[_0x06c8('0x8b')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x8c'));db['Sound']=db['sequelize']['import'](_0x06c8('0x8d'));db[_0x06c8('0x8e')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x8f'));db[_0x06c8('0x90')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x91'));db[_0x06c8('0x92')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x93'));db['Variable']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x94'));db[_0x06c8('0x95')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x96'));db['IntegrationReport']=db[_0x06c8('0x1')]['import'](_0x06c8('0x97'));db[_0x06c8('0x98')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x99'));db['AnalyticDefaultReport']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x9a'));db[_0x06c8('0x9b')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x9c'));db[_0x06c8('0x9d')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x9e'));db[_0x06c8('0x9f')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x06c8('0xa0')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xa1'));db['SalesforceAccount']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xa2'));db[_0x06c8('0xa3')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xa4'));db[_0x06c8('0xa5')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xa6'));db['SugarcrmAccount']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xa7'));db[_0x06c8('0xa8')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x06c8('0xa9')]=db['sequelize']['import'](_0x06c8('0xaa'));db[_0x06c8('0xab')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xac'));db[_0x06c8('0xad')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x06c8('0xae')]=db['sequelize'][_0x06c8('0x14')]('../api/intDeskField/intDeskField.model');db[_0x06c8('0xaf')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xb0'));db['ZohoConfiguration']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xb1'));db[_0x06c8('0xb2')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xb3'));db[_0x06c8('0xb4')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xb5'));db[_0x06c8('0xb6')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xb7'));db['ZendeskField']=db['sequelize']['import'](_0x06c8('0xb8'));db[_0x06c8('0xb9')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xba'));db[_0x06c8('0xbb')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x06c8('0xbc')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xbd'));db['VtigerAccount']=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xbe'));db[_0x06c8('0xbf')]=db['sequelize']['import'](_0x06c8('0xc0'));db['VtigerField']=db['sequelize'][_0x06c8('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x06c8('0xc1')]=db[_0x06c8('0x1')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x06c8('0xc2')]=db['sequelize'][_0x06c8('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xc3'));db[_0x06c8('0xc4')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xc5'));db['Dynamics365Configuration']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xc6'));db[_0x06c8('0xc7')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xc8'));db[_0x06c8('0xc9')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xca'));db[_0x06c8('0xcb')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xcc'));db[_0x06c8('0xcd')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xce'));db[_0x06c8('0x95')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0x96'));db[_0x06c8('0xcf')]=db['sequelize']['import']('../api/network/network.model');db[_0x06c8('0xd0')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xd1'));db[_0x06c8('0xd2')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xd3'));db[_0x06c8('0xd4')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xd5'));db[_0x06c8('0xd6')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xd7'));db[_0x06c8('0xd8')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xd9'));db[_0x06c8('0xda')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/smsQueueReport/smsQueueReport.model');db[_0x06c8('0xdb')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xdc'));db[_0x06c8('0xdd')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xde'));db[_0x06c8('0xdf')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xe0'));db['Setting']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xe1'));db['SquareOdbc']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xe2'));db['SquareProject']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xe3'));db[_0x06c8('0xe4')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/squareRecording/squareRecording.model');db[_0x06c8('0xe5')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xe6'));db['Team']=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/team/team.model');db[_0x06c8('0xe7')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xe8'));db['Campaign']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xe9'));db[_0x06c8('0xea')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/migration/migration.model');db[_0x06c8('0xeb')]=db['sequelize'][_0x06c8('0x14')]('../api/attachment/attachment.model');db[_0x06c8('0xec')]=db['sequelize'][_0x06c8('0x14')](_0x06c8('0xed'));db['MailTransferReport']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xee'));db[_0x06c8('0xef')]=db['sequelize']['import'](_0x06c8('0xf0'));db[_0x06c8('0xf1')]=db[_0x06c8('0x1')]['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x06c8('0xf2')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x06c8('0xf3')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xf4'));db[_0x06c8('0xf5')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xf6'));db[_0x06c8('0xf7')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xf8'));db[_0x06c8('0xf9')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/userProfile/userProfile.model');db[_0x06c8('0xfa')]=db[_0x06c8('0x1')]['import'](_0x06c8('0xfb'));db['UserProfileResource']=db['sequelize'][_0x06c8('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x06c8('0xfc')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0xfd'));db['WhatsappAccount']=db['sequelize']['import'](_0x06c8('0xfe'));db['WhatsappApplication']=db[_0x06c8('0x1')]['import'](_0x06c8('0xff'));db['WhatsappInteraction']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x100'));db['WhatsappMessage']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x101'));db[_0x06c8('0x102')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x103'));db['WhatsappTransferReport']=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x104'));db[_0x06c8('0x105')]=db[_0x06c8('0x1')][_0x06c8('0x14')](_0x06c8('0x106'));db[_0x06c8('0x107')]=db[_0x06c8('0x1')][_0x06c8('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0x06c8('0x108')]=db[_0x06c8('0x1')]['import'](_0x06c8('0x109'));db[_0x06c8('0x13')]['hasOne'](db['VoiceMail'],{'as':_0x06c8('0x21'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')][_0x06c8('0x10c')](db[_0x06c8('0x10d')],{'as':'Recordings','foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')][_0x06c8('0x10c')](db[_0x06c8('0x2f')],{'as':_0x06c8('0x10e'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')]['hasMany'](db[_0x06c8('0x19')],{'as':_0x06c8('0x10f'),'onDelete':'cascade','hooks':!![]});db[_0x06c8('0x13')]['hasMany'](db[_0x06c8('0x76')],{'as':_0x06c8('0x110'),'foreignKey':_0x06c8('0x10b')});db['User'][_0x06c8('0x10c')](db[_0x06c8('0x78')],{'as':_0x06c8('0x111'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')][_0x06c8('0x10c')](db[_0x06c8('0x5f')],{'as':_0x06c8('0x112'),'foreignKey':'UserId'});db[_0x06c8('0x13')][_0x06c8('0x10c')](db[_0x06c8('0x68')],{'as':_0x06c8('0x113'),'foreignKey':'UserId'});db[_0x06c8('0x13')][_0x06c8('0x10c')](db[_0x06c8('0x58')],{'as':'SmsInteractions','foreignKey':_0x06c8('0x10b')});db['User']['hasMany'](db[_0x06c8('0x51')],{'as':_0x06c8('0x114'),'foreignKey':'UserId'});db[_0x06c8('0x13')]['hasMany'](db['MailInteraction'],{'as':_0x06c8('0x115'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')]['hasMany'](db[_0x06c8('0x116')],{'as':_0x06c8('0x117'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x13')]['hasMany'](db[_0x06c8('0xfc')],{'as':'UserNotifications','foreignKey':_0x06c8('0x118')});db[_0x06c8('0x13')]['belongsTo'](db[_0x06c8('0xf9')],{'as':'UserProfile','foreignKey':_0x06c8('0x119')});db['User']['belongsToMany'](db[_0x06c8('0x6e')],{'as':_0x06c8('0x11a'),'through':_0x06c8('0x11b')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x11d'),'through':_0x06c8('0x11e')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db['CmList'],{'as':_0x06c8('0x11f'),'through':_0x06c8('0x120')});db['User']['belongsToMany'](db[_0x06c8('0x121')],{'through':_0x06c8('0x122')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x45')],{'as':_0x06c8('0x115'),'through':_0x06c8('0x123')});db[_0x06c8('0x13')]['belongsToMany'](db[_0x06c8('0x68')],{'as':'ChatInteractions','through':_0x06c8('0x124')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x51')],{'as':_0x06c8('0x114'),'through':_0x06c8('0x125')});db[_0x06c8('0x13')]['belongsToMany'](db[_0x06c8('0x58')],{'as':'SmsInteractions','through':_0x06c8('0x126')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x06c8('0x127')});db[_0x06c8('0x13')]['belongsToMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x06c8('0x128')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db['VoiceQueue'],{'as':_0x06c8('0x129'),'through':'UserVoiceQueue','required':![]});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x12a')],{'as':_0x06c8('0x12b'),'through':_0x06c8('0x35'),'required':![]});db['User'][_0x06c8('0x11c')](db['ChatQueue'],{'as':_0x06c8('0x12c'),'through':_0x06c8('0x33'),'required':![],'hooks':!![]});db[_0x06c8('0x13')]['belongsToMany'](db[_0x06c8('0x12d')],{'as':_0x06c8('0x12e'),'through':'UserFaxQueue','required':![]});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x59')],{'as':'SmsQueues','through':'UserSmsQueue','required':![]});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x61')],{'as':'OpenchannelQueues','through':_0x06c8('0x3a'),'required':![]});db[_0x06c8('0x13')]['belongsToMany'](db[_0x06c8('0x105')],{'as':_0x06c8('0x12f'),'through':_0x06c8('0x3b'),'required':![]});db[_0x06c8('0x13')][_0x06c8('0x11c')](db['CmList'],{'through':_0x06c8('0x120')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0xf7')],{'as':_0x06c8('0x130'),'through':_0x06c8('0x131'),'required':![]});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x132')],{'as':'ChatWebsites','through':_0x06c8('0x133')});db[_0x06c8('0x13')]['belongsToMany'](db[_0x06c8('0x4d')],{'as':_0x06c8('0x134'),'through':_0x06c8('0x135')});db['User']['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0x06c8('0x136')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db['OpenchannelAccount'],{'as':_0x06c8('0x137'),'through':_0x06c8('0x138')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x139')],{'as':_0x06c8('0x13a'),'through':_0x06c8('0x13b')});db[_0x06c8('0x13')][_0x06c8('0x11c')](db[_0x06c8('0x13c')],{'as':_0x06c8('0x13d'),'through':_0x06c8('0x13e')});db[_0x06c8('0x13')]['belongsToMany'](db[_0x06c8('0x13f')],{'as':_0x06c8('0x140'),'through':'user_has_square_projects'});db['VoiceChanSpy']['hasMany'](db['VoiceExtension'],{'as':_0x06c8('0x141'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x142')});db['VoiceContext'][_0x06c8('0x10c')](db['VoiceExtension'],{'onDelete':_0x06c8('0x10a')});db['VoiceExtension']['hasMany'](db[_0x06c8('0x19')],{'as':_0x06c8('0x143'),'onDelete':_0x06c8('0x10a')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x06c8('0x144')],{'as':'Sounds','through':_0x06c8('0x145')});db[_0x06c8('0x1d')][_0x06c8('0x10c')](db[_0x06c8('0x2f')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x06c8('0x1d')][_0x06c8('0x10c')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x06c8('0x146')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x06c8('0x146')});db[_0x06c8('0x1d')][_0x06c8('0x10c')](db[_0x06c8('0x78')],{'as':_0x06c8('0x147'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x06c8('0x10c')](db['ReportAgentPreview'],{'as':_0x06c8('0x148'),'foreignKey':'VoiceQueueId'});db[_0x06c8('0x1d')][_0x06c8('0x10c')](db[_0x06c8('0x149')],{'as':_0x06c8('0x14a'),'foreignKey':_0x06c8('0x146')});db[_0x06c8('0x1d')][_0x06c8('0x10c')](db[_0x06c8('0xd8')],{'as':_0x06c8('0x14b'),'foreignKey':_0x06c8('0x146')});db['VoiceQueue'][_0x06c8('0x14c')](db[_0x06c8('0x2b')],{'as':_0x06c8('0x2b'),'foreignKey':_0x06c8('0x14d')});db[_0x06c8('0x1d')][_0x06c8('0x14c')](db['Trunk'],{'as':_0x06c8('0x14e'),'foreignKey':_0x06c8('0x14f')});db[_0x06c8('0x1d')][_0x06c8('0x14c')](db[_0x06c8('0x84')],{'as':_0x06c8('0x84'),'foreignKey':_0x06c8('0x150')});db[_0x06c8('0x1d')][_0x06c8('0x14c')](db[_0x06c8('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0x06c8('0x151')});db[_0x06c8('0x1d')][_0x06c8('0x11c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x11f'),'through':_0x06c8('0x152')});db[_0x06c8('0x1d')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x06c8('0x11c')](db[_0x06c8('0x121')],{'as':'Teams','through':_0x06c8('0x108')});db[_0x06c8('0x1d')]['belongsToMany'](db[_0x06c8('0xf5')],{'as':'BlackLists','through':_0x06c8('0x154')});db[_0x06c8('0x10d')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x13'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x155')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x13'),'foreignKey':'UserId'});db[_0x06c8('0x21')][_0x06c8('0x10c')](db[_0x06c8('0x23')],{'as':_0x06c8('0x156'),'onDelete':_0x06c8('0x10a'),'foreignKey':'mailboxuser','sourceKey':_0x06c8('0x157')});db[_0x06c8('0x23')][_0x06c8('0x14c')](db['VoiceMail'],{'foreignKey':_0x06c8('0x158'),'targetKey':_0x06c8('0x157')});db[_0x06c8('0x25')][_0x06c8('0x10c')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x06c8('0x159'),'constraints':![]});db['VoiceCallReport'][_0x06c8('0x10c')](db['VoiceAgentReport'],{'as':_0x06c8('0x15a'),'foreignKey':_0x06c8('0x159'),'constraints':![]});db[_0x06c8('0x25')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x13'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x25')]['belongsTo'](db[_0x06c8('0x73')],{'as':'Contact','foreignKey':'ContactId'});db[_0x06c8('0x3d')][_0x06c8('0x14c')](db[_0x06c8('0x41')],{'as':'MailAccount','foreignKey':_0x06c8('0x15b')});db[_0x06c8('0x3f')]['belongsTo'](db['MailAccount'],{'as':_0x06c8('0x41'),'foreignKey':_0x06c8('0x15b')});db[_0x06c8('0x41')][_0x06c8('0x15c')](db[_0x06c8('0x3d')],{'as':_0x06c8('0x15d'),'onDelete':_0x06c8('0x10a')});db['MailAccount'][_0x06c8('0x15c')](db[_0x06c8('0x3f')],{'as':_0x06c8('0x15e'),'onDelete':'cascade'});db[_0x06c8('0x41')][_0x06c8('0x10c')](db[_0x06c8('0x81')],{'as':_0x06c8('0x15f'),'foreignKey':'MailAccountId'});db[_0x06c8('0x41')][_0x06c8('0x10c')](db[_0x06c8('0x7f')],{'as':_0x06c8('0x160'),'foreignKey':_0x06c8('0x15b')});db['MailAccount']['hasMany'](db[_0x06c8('0x46')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x06c8('0x41')][_0x06c8('0x10c')](db[_0x06c8('0x45')],{'as':_0x06c8('0x161')});db[_0x06c8('0x41')][_0x06c8('0x10c')](db[_0x06c8('0x162')],{'as':_0x06c8('0x143')});db[_0x06c8('0x41')][_0x06c8('0x14c')](db['CmList'],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0x41')][_0x06c8('0x14c')](db[_0x06c8('0x90')],{'as':'Template','foreignKey':'TemplateId'});db[_0x06c8('0x41')][_0x06c8('0x14c')](db[_0x06c8('0x86')],{'as':_0x06c8('0x165'),'foreignKey':_0x06c8('0x151')});db['MailAccount']['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':'user_has_mail_accounts'});db['MailQueue'][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':'UserMailQueue'});db['MailQueue'][_0x06c8('0x11c')](db['Team'],{'through':'team_has_mail_queues','as':_0x06c8('0x166')});db['MailInteraction'][_0x06c8('0x10c')](db[_0x06c8('0x46')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x06c8('0x167')});db[_0x06c8('0x45')][_0x06c8('0x14c')](db[_0x06c8('0x41')],{'as':_0x06c8('0x168'),'foreignKey':'MailAccountId'});db[_0x06c8('0x45')]['belongsTo'](db[_0x06c8('0x73')],{'as':'Contact','foreignKey':_0x06c8('0x169')});db['MailInteraction'][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16a'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x45')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':'mail_interaction_has_tags','as':_0x06c8('0x16b')});db[_0x06c8('0x45')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':'mail_interaction_has_tags','as':_0x06c8('0x16c')});db[_0x06c8('0x45')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':_0x06c8('0x123'),'foreignKey':_0x06c8('0x167')});db[_0x06c8('0x46')][_0x06c8('0x10c')](db[_0x06c8('0xeb')],{'as':'Attachments','onDelete':_0x06c8('0x10a')});db[_0x06c8('0x46')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x13')});db['MailMessage'][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x16e')});db[_0x06c8('0x46')][_0x06c8('0x14c')](db['MailInteraction'],{'as':_0x06c8('0x16f'),'foreignKey':_0x06c8('0x167')});db[_0x06c8('0x46')][_0x06c8('0x14c')](db[_0x06c8('0x41')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x15b')});db[_0x06c8('0x46')][_0x06c8('0x14c')](db[_0x06c8('0x132')],{'as':'ChatWebsite','foreignKey':_0x06c8('0x170')});db['MailMessage']['belongsTo'](db[_0x06c8('0x6a')],{'as':_0x06c8('0x6a'),'foreignKey':_0x06c8('0x171')});db[_0x06c8('0x162')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x172')});db[_0x06c8('0x162')]['belongsTo'](db[_0x06c8('0x12a')],{'onDelete':'restrict'});db[_0x06c8('0x162')]['belongsTo'](db['MailAccount'],{'onDelete':_0x06c8('0x172')});db['MailApplication'][_0x06c8('0x14c')](db[_0x06c8('0x84')],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x150')});db[_0x06c8('0x162')][_0x06c8('0x14c')](db[_0x06c8('0x8e')],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x173')});db[_0x06c8('0x47')][_0x06c8('0x14c')](db[_0x06c8('0x41')],{});db[_0x06c8('0x47')][_0x06c8('0x14c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db['MailQueueReport'][_0x06c8('0x14c')](db['CmContact'],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x47')]['belongsTo'](db['MailInteraction'],{});db[_0x06c8('0x47')][_0x06c8('0x14c')](db[_0x06c8('0x46')],{});db[_0x06c8('0x47')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{});db[_0x06c8('0x47')][_0x06c8('0x14c')](db['MailQueue'],{});db[_0x06c8('0x49')]['hasMany'](db[_0x06c8('0x4b')],{'as':'Items','onDelete':_0x06c8('0x10a')});db[_0x06c8('0x4d')][_0x06c8('0x10c')](db['Disposition'],{'as':_0x06c8('0x15f'),'foreignKey':_0x06c8('0x174')});db[_0x06c8('0x4d')][_0x06c8('0x10c')](db[_0x06c8('0x7f')],{'as':_0x06c8('0x160'),'foreignKey':_0x06c8('0x174')});db[_0x06c8('0x4d')][_0x06c8('0x10c')](db[_0x06c8('0x51')],{'as':'Interactions'});db[_0x06c8('0x4d')][_0x06c8('0x10c')](db[_0x06c8('0x4f')],{'as':'Applications'});db[_0x06c8('0x4d')]['hasMany'](db[_0x06c8('0x19')],{'as':'Exntensions','onDelete':'cascade'});db[_0x06c8('0x4d')][_0x06c8('0x10c')](db[_0x06c8('0x53')],{'as':_0x06c8('0x156')});db[_0x06c8('0x4d')][_0x06c8('0x14c')](db[_0x06c8('0x2b')],{'as':_0x06c8('0x2b')});db[_0x06c8('0x4d')]['belongsTo'](db[_0x06c8('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x06c8('0x4d')]['belongsTo'](db['Pause'],{'as':_0x06c8('0x165'),'foreignKey':_0x06c8('0x151')});db[_0x06c8('0x4d')][_0x06c8('0x11c')](db['User'],{'as':_0x06c8('0x153'),'through':_0x06c8('0x135')});db[_0x06c8('0x4f')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x172')});db[_0x06c8('0x4f')][_0x06c8('0x14c')](db['FaxQueue'],{'onDelete':'restrict'});db['FaxApplication'][_0x06c8('0x14c')](db[_0x06c8('0x4d')],{'onDelete':_0x06c8('0x172')});db['FaxApplication'][_0x06c8('0x14c')](db[_0x06c8('0x8e')],{'onDelete':'restrict','foreignKey':_0x06c8('0x173')});db['FaxInteraction'][_0x06c8('0x10c')](db['FaxMessage'],{'as':'Messages','onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x175')});db[_0x06c8('0x51')][_0x06c8('0x14c')](db[_0x06c8('0x4d')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x174')});db[_0x06c8('0x51')]['belongsTo'](db['CmContact'],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x51')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16a'),'foreignKey':_0x06c8('0x10b')});db['FaxInteraction'][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':'fax_interaction_has_tags','as':_0x06c8('0x16b')});db[_0x06c8('0x51')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x176'),'as':_0x06c8('0x16c')});db[_0x06c8('0x51')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':'user_has_fax_interactions','foreignKey':_0x06c8('0x175')});db[_0x06c8('0x53')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x13')});db['FaxMessage'][_0x06c8('0x14c')](db[_0x06c8('0x51')],{'as':_0x06c8('0x16f'),'foreignKey':'FaxInteractionId'});db[_0x06c8('0x53')]['belongsTo'](db[_0x06c8('0x73')],{'onDelete':_0x06c8('0x10a'),'as':'Contact'});db[_0x06c8('0x53')][_0x06c8('0x14c')](db[_0x06c8('0xeb')],{'as':_0x06c8('0xeb'),'foreignKey':'AttachmentId'});db[_0x06c8('0x53')][_0x06c8('0x14c')](db['FaxAccount'],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x174')});db[_0x06c8('0x12d')][_0x06c8('0x11c')](db['User'],{'as':_0x06c8('0x153'),'through':_0x06c8('0x177')});db['FaxQueue'][_0x06c8('0x11c')](db[_0x06c8('0x121')],{'through':_0x06c8('0x178'),'as':_0x06c8('0x166')});db[_0x06c8('0x55')][_0x06c8('0x14c')](db[_0x06c8('0x4d')],{});db[_0x06c8('0x55')][_0x06c8('0x14c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db['FaxQueueReport'][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db['FaxQueueReport']['belongsTo'](db[_0x06c8('0x51')],{});db['FaxQueueReport'][_0x06c8('0x14c')](db['FaxMessage'],{});db[_0x06c8('0x55')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{});db['FaxQueueReport'][_0x06c8('0x14c')](db[_0x06c8('0x12d')],{});db[_0x06c8('0x139')][_0x06c8('0x10c')](db['Disposition'],{'as':_0x06c8('0x15f'),'foreignKey':_0x06c8('0x179')});db[_0x06c8('0x139')]['hasMany'](db[_0x06c8('0x7f')],{'as':_0x06c8('0x160'),'foreignKey':_0x06c8('0x179')});db['SmsAccount'][_0x06c8('0x10c')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0x06c8('0x139')][_0x06c8('0x10c')](db['SmsInteraction'],{'as':_0x06c8('0x161')});db[_0x06c8('0x139')][_0x06c8('0x10c')](db[_0x06c8('0x17a')],{'as':_0x06c8('0x143')});db[_0x06c8('0x139')][_0x06c8('0x14c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0x139')]['belongsTo'](db[_0x06c8('0x86')],{'as':_0x06c8('0x165'),'foreignKey':_0x06c8('0x151')});db[_0x06c8('0x139')][_0x06c8('0x11c')](db['User'],{'as':_0x06c8('0x153'),'through':_0x06c8('0x13b')});db['SmsApplication'][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x172')});db['SmsApplication'][_0x06c8('0x14c')](db[_0x06c8('0x59')],{'onDelete':_0x06c8('0x172')});db[_0x06c8('0x17a')][_0x06c8('0x14c')](db[_0x06c8('0x139')],{'onDelete':'restrict'});db[_0x06c8('0x17a')][_0x06c8('0x14c')](db['Interval'],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x150')});db[_0x06c8('0x17a')][_0x06c8('0x14c')](db[_0x06c8('0x8e')],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x173')});db['SmsInteraction'][_0x06c8('0x10c')](db[_0x06c8('0x17b')],{'as':_0x06c8('0x156'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x17c')});db[_0x06c8('0x58')][_0x06c8('0x14c')](db[_0x06c8('0x139')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x179')});db['SmsInteraction'][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x58')][_0x06c8('0x14c')](db['User'],{'as':_0x06c8('0x16a'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x58')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':'sms_interaction_has_tags','as':_0x06c8('0x16b')});db[_0x06c8('0x58')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x17d'),'as':'ThroughTags'});db[_0x06c8('0x58')]['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':_0x06c8('0x126'),'foreignKey':_0x06c8('0x17c')});db[_0x06c8('0x17b')]['belongsTo'](db[_0x06c8('0x13')],{'as':_0x06c8('0x13')});db[_0x06c8('0x17b')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x16e')});db[_0x06c8('0x17b')][_0x06c8('0x14c')](db[_0x06c8('0x58')],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x16f'),'foreignKey':_0x06c8('0x17c')});db['SmsMessage'][_0x06c8('0x14c')](db['SmsAccount'],{'as':'Account','foreignKey':_0x06c8('0x179')});db[_0x06c8('0x59')]['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':_0x06c8('0x38'),'foreignKey':'SmsQueueId'});db[_0x06c8('0x59')]['belongsToMany'](db[_0x06c8('0x121')],{'through':_0x06c8('0x17e'),'as':'Teams'});db[_0x06c8('0x5b')][_0x06c8('0x10c')](db[_0x06c8('0x81')],{'as':'Dispositions','foreignKey':_0x06c8('0x17f')});db[_0x06c8('0x5b')][_0x06c8('0x10c')](db[_0x06c8('0x7f')],{'as':_0x06c8('0x160'),'foreignKey':_0x06c8('0x17f')});db['OpenchannelAccount'][_0x06c8('0x10c')](db[_0x06c8('0x5f')],{'as':_0x06c8('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0x06c8('0x5b')][_0x06c8('0x10c')](db[_0x06c8('0x180')],{'as':_0x06c8('0x156'),'foreignKey':_0x06c8('0x17f')});db[_0x06c8('0x5b')][_0x06c8('0x10c')](db['OpenchannelApplication'],{'as':_0x06c8('0x143'),'foreignKey':_0x06c8('0x17f')});db['OpenchannelAccount']['belongsTo'](db[_0x06c8('0xf5')],{'as':'List','foreignKey':_0x06c8('0x164')});db[_0x06c8('0x5b')]['belongsTo'](db[_0x06c8('0x86')],{'as':_0x06c8('0x165'),'foreignKey':_0x06c8('0x151')});db[_0x06c8('0x5b')]['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':_0x06c8('0x138')});db[_0x06c8('0x5d')][_0x06c8('0x14c')](db['User'],{'onDelete':_0x06c8('0x172')});db[_0x06c8('0x5d')][_0x06c8('0x14c')](db[_0x06c8('0x61')],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x181')});db[_0x06c8('0x5d')][_0x06c8('0x14c')](db[_0x06c8('0x5b')],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x17f')});db[_0x06c8('0x5d')][_0x06c8('0x14c')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x06c8('0x5d')][_0x06c8('0x14c')](db[_0x06c8('0x8e')],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x173')});db[_0x06c8('0x5f')][_0x06c8('0x10c')](db['OpenchannelMessage'],{'as':_0x06c8('0x156'),'onDelete':'cascade','foreignKey':_0x06c8('0x182')});db['OpenchannelInteraction'][_0x06c8('0x14c')](db['OpenchannelAccount'],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x17f')});db[_0x06c8('0x5f')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x5f')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':'Owner','foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x5f')][_0x06c8('0x11c')](db['Tag'],{'through':_0x06c8('0x183'),'as':'Tags'});db[_0x06c8('0x5f')][_0x06c8('0x11c')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x06c8('0x16c')});db[_0x06c8('0x5f')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':_0x06c8('0x127'),'foreignKey':_0x06c8('0x182')});db[_0x06c8('0x180')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x13')});db[_0x06c8('0x180')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'onDelete':_0x06c8('0x10a'),'as':'Contact'});db[_0x06c8('0x180')]['belongsTo'](db[_0x06c8('0x5f')],{'onDelete':_0x06c8('0x10a'),'as':'Interaction','foreignKey':_0x06c8('0x182')});db[_0x06c8('0x180')][_0x06c8('0x14c')](db['Attachment'],{'as':_0x06c8('0xeb'),'foreignKey':_0x06c8('0x184')});db[_0x06c8('0x180')]['belongsTo'](db[_0x06c8('0x5b')],{'as':'Account','foreignKey':_0x06c8('0x17f')});db[_0x06c8('0x61')][_0x06c8('0x11c')](db['User'],{'as':_0x06c8('0x153'),'through':_0x06c8('0x3a'),'foreignKey':_0x06c8('0x181')});db[_0x06c8('0x61')][_0x06c8('0x11c')](db[_0x06c8('0x121')],{'through':_0x06c8('0x185'),'as':_0x06c8('0x166')});db[_0x06c8('0x132')][_0x06c8('0x10c')](db[_0x06c8('0x81')],{'as':_0x06c8('0x15f'),'foreignKey':_0x06c8('0x170')});db['ChatWebsite'][_0x06c8('0x10c')](db[_0x06c8('0x7f')],{'as':_0x06c8('0x160'),'foreignKey':_0x06c8('0x170')});db[_0x06c8('0x132')][_0x06c8('0x10c')](db[_0x06c8('0x70')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x06c8('0x10c')](db[_0x06c8('0x68')],{'as':'Interactions'});db[_0x06c8('0x132')][_0x06c8('0x10c')](db[_0x06c8('0x66')],{'as':_0x06c8('0x143')});db[_0x06c8('0x132')][_0x06c8('0x10c')](db['ChatMessage'],{'as':'Messages'});db[_0x06c8('0x132')][_0x06c8('0x14c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db['ChatWebsite']['belongsTo'](db[_0x06c8('0x84')],{'as':_0x06c8('0x84'),'foreignKey':_0x06c8('0x150')});db[_0x06c8('0x132')][_0x06c8('0x14c')](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db['ChatWebsite'][_0x06c8('0x14c')](db[_0x06c8('0x86')],{'as':_0x06c8('0x165'),'foreignKey':_0x06c8('0x151')});db[_0x06c8('0x132')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':'Agents','through':'user_has_chat_websites'});db[_0x06c8('0x64')][_0x06c8('0x14c')](db[_0x06c8('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0x64')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x64')][_0x06c8('0x14c')](db[_0x06c8('0x5f')],{});db[_0x06c8('0x64')][_0x06c8('0x14c')](db[_0x06c8('0x180')],{});db['OpenchannelQueueReport']['belongsTo'](db['User'],{});db[_0x06c8('0x64')][_0x06c8('0x14c')](db[_0x06c8('0x61')],{});db[_0x06c8('0x66')][_0x06c8('0x14c')](db['User'],{'as':_0x06c8('0x186'),'foreignKey':_0x06c8('0x10b'),'onDelete':_0x06c8('0x172')});db[_0x06c8('0x66')][_0x06c8('0x14c')](db[_0x06c8('0x6c')],{'as':_0x06c8('0x187'),'foreignKey':_0x06c8('0x188'),'onDelete':'restrict'});db[_0x06c8('0x66')][_0x06c8('0x14c')](db[_0x06c8('0x132')],{'as':_0x06c8('0x189'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0x06c8('0x14c')](db['Tag'],{'onDelete':_0x06c8('0x172'),'foreignKey':_0x06c8('0x173')});db[_0x06c8('0x68')][_0x06c8('0x10c')](db[_0x06c8('0x18a')],{'as':_0x06c8('0x156'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x18b')});db[_0x06c8('0x68')][_0x06c8('0x14c')](db['ChatWebsite'],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x170')});db[_0x06c8('0x68')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x68')]['belongsTo'](db['User'],{'as':_0x06c8('0x16a'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x68')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x18c'),'as':'Tags'});db[_0x06c8('0x68')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x18c'),'as':_0x06c8('0x16c')});db[_0x06c8('0x68')][_0x06c8('0x11c')](db['User'],{'as':'Users','through':_0x06c8('0x124'),'foreignKey':_0x06c8('0x18b')});db['ChatMessage']['belongsTo'](db[_0x06c8('0x13')],{'onDelete':'cascade','as':_0x06c8('0x13')});db[_0x06c8('0x18a')][_0x06c8('0x14c')](db['CmContact'],{'onDelete':'cascade','as':_0x06c8('0x16e'),'foreignKey':'ContactId'});db[_0x06c8('0x18a')][_0x06c8('0x14c')](db['ChatInteraction'],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x16f'),'foreignKey':_0x06c8('0x18b')});db[_0x06c8('0x18a')][_0x06c8('0x14c')](db[_0x06c8('0xeb')],{'as':_0x06c8('0xeb'),'foreignKey':_0x06c8('0x184')});db['ChatMessage'][_0x06c8('0x14c')](db['ChatWebsite'],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x170')});db[_0x06c8('0x6a')][_0x06c8('0x10c')](db[_0x06c8('0xeb')],{'as':'Attachments','foreignKey':_0x06c8('0x171'),'onDelete':_0x06c8('0x10a'),'hooks':!![]});db[_0x06c8('0x6a')]['belongsTo'](db[_0x06c8('0x73')],{'onDelete':'cascade','as':_0x06c8('0x16e'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x06c8('0x14c')](db[_0x06c8('0x132')],{'as':_0x06c8('0x168'),'foreignKey':'ChatWebsiteId'});db['ChatQueue']['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':_0x06c8('0x33'),'hooks':!![]});db[_0x06c8('0x6c')][_0x06c8('0x11c')](db[_0x06c8('0x121')],{'through':_0x06c8('0x18d'),'as':_0x06c8('0x166')});db[_0x06c8('0x6e')][_0x06c8('0x10c')](db[_0x06c8('0xd2')],{'as':'Messages','foreignKey':_0x06c8('0x18e'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x6e')]['belongsToMany'](db[_0x06c8('0x13')],{'as':'Members','through':_0x06c8('0x11b')});db[_0x06c8('0x70')][_0x06c8('0x14c')](db['ChatWebsite'],{'as':_0x06c8('0x189'),'foreignKey':_0x06c8('0x170')});db[_0x06c8('0x72')][_0x06c8('0x10c')](db[_0x06c8('0x73')],{'as':'Contacts','foreignKey':_0x06c8('0x18f')});db[_0x06c8('0x73')][_0x06c8('0x10c')](db['CmHopper'],{'as':_0x06c8('0x190'),'foreignKey':_0x06c8('0x169')});db['CmContact']['hasMany'](db[_0x06c8('0x76')],{'as':_0x06c8('0x110'),'foreignKey':_0x06c8('0x169')});db['CmContact'][_0x06c8('0x10c')](db[_0x06c8('0x78')],{'as':'HopperHistories','foreignKey':_0x06c8('0x169')});db[_0x06c8('0x73')][_0x06c8('0x10c')](db['ReportAgentPreview'],{'as':_0x06c8('0x148'),'foreignKey':'ContactId'});db['CmContact'][_0x06c8('0x10c')](db[_0x06c8('0xd8')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x06c8('0x73')][_0x06c8('0x10c')](db[_0x06c8('0x5f')],{'as':'OpenchannelInteractions','foreignKey':_0x06c8('0x169'),'onDelete':_0x06c8('0x172')});db[_0x06c8('0x73')][_0x06c8('0x10c')](db[_0x06c8('0x68')],{'as':_0x06c8('0x113'),'foreignKey':_0x06c8('0x169'),'onDelete':_0x06c8('0x172')});db[_0x06c8('0x73')][_0x06c8('0x10c')](db['SmsInteraction'],{'as':_0x06c8('0x191'),'foreignKey':_0x06c8('0x169'),'onDelete':_0x06c8('0x172')});db[_0x06c8('0x73')][_0x06c8('0x10c')](db[_0x06c8('0x51')],{'as':'FaxInteractions','foreignKey':_0x06c8('0x169'),'onDelete':_0x06c8('0x172')});db[_0x06c8('0x73')][_0x06c8('0x10c')](db['MailInteraction'],{'as':_0x06c8('0x115'),'foreignKey':_0x06c8('0x169'),'onDelete':'restrict'});db['CmContact'][_0x06c8('0x14c')](db['CmCompany'],{'as':_0x06c8('0x192'),'foreignKey':_0x06c8('0x18f')});db[_0x06c8('0x73')]['belongsTo'](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x73')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':_0x06c8('0x11e')});db[_0x06c8('0x73')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'as':_0x06c8('0x16b'),'through':_0x06c8('0x193')});db[_0x06c8('0x73')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x193'),'as':_0x06c8('0x16c')});db[_0x06c8('0x74')][_0x06c8('0x14c')](db['CmContact'],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169'),'onDelete':'cascade'});db[_0x06c8('0x74')]['belongsTo'](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x74')][_0x06c8('0x14c')](db['User'],{'as':_0x06c8('0x186'),'foreignKey':_0x06c8('0x10b')});db['CmHopper'][_0x06c8('0x14c')](db[_0x06c8('0x1d')],{'as':_0x06c8('0x187'),'foreignKey':_0x06c8('0x146'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x74')]['belongsTo'](db['Campaign'],{'as':_0x06c8('0x194'),'foreignKey':_0x06c8('0x195'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x74')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16a'),'foreignKey':_0x06c8('0x196')});db[_0x06c8('0x149')][_0x06c8('0x14c')](db['CmContact'],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169'),'onDelete':'cascade'});db[_0x06c8('0x149')]['belongsTo'](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164'),'onDelete':'cascade'});db['CmHopperBlack'][_0x06c8('0x14c')](db[_0x06c8('0x1d')],{'as':_0x06c8('0x187'),'foreignKey':_0x06c8('0x146'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x149')][_0x06c8('0x14c')](db['Campaign'],{'as':_0x06c8('0x194'),'foreignKey':_0x06c8('0x195'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x7e')][_0x06c8('0x10c')](db[_0x06c8('0x197')],{'as':{'plural':_0x06c8('0x198'),'singular':_0x06c8('0x199')},'foreignKey':_0x06c8('0x19a'),'onDelete':_0x06c8('0x10a'),'hooks':!![]});db[_0x06c8('0x7e')][_0x06c8('0x10c')](db[_0x06c8('0x197')],{'as':{'plural':'Any','singular':_0x06c8('0x19b')},'foreignKey':'AutomationAnyId','onDelete':_0x06c8('0x10a'),'hooks':!![]});db[_0x06c8('0x7e')][_0x06c8('0x10c')](db['Action'],{'as':'Actions','foreignKey':_0x06c8('0x19c'),'onDelete':_0x06c8('0x10a'),'hooks':!![]});db[_0x06c8('0x81')][_0x06c8('0x10c')](db[_0x06c8('0x81')],{'as':_0x06c8('0x15f'),'foreignKey':_0x06c8('0x19d'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x84')][_0x06c8('0x10c')](db[_0x06c8('0x84')],{'as':_0x06c8('0x19e'),'foreignKey':_0x06c8('0x150'),'onDelete':_0x06c8('0x10a'),'hooks':!![],'required':![]});db[_0x06c8('0x84')]['hasMany'](db[_0x06c8('0x19')],{'as':_0x06c8('0x10f'),'foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0x06c8('0x10c')](db['MailApplication'],{'as':_0x06c8('0x19f'),'foreignKey':'IntervalId'});db[_0x06c8('0x84')][_0x06c8('0x10c')](db[_0x06c8('0x66')],{'as':_0x06c8('0x1a0'),'foreignKey':_0x06c8('0x150')});db[_0x06c8('0x84')][_0x06c8('0x10c')](db[_0x06c8('0x4f')],{'as':'FaxApplications','foreignKey':_0x06c8('0x150')});db['Interval'][_0x06c8('0x10c')](db[_0x06c8('0x17a')],{'as':_0x06c8('0x1a1'),'foreignKey':_0x06c8('0x150')});db[_0x06c8('0x8b')][_0x06c8('0x14c')](db[_0x06c8('0x41')],{});db[_0x06c8('0x8b')][_0x06c8('0x14c')](db[_0x06c8('0x1a2')],{'foreignKey':_0x06c8('0x1a3')});db[_0x06c8('0x8b')][_0x06c8('0x14c')](db[_0x06c8('0x98')],{'foreignKey':_0x06c8('0x1a4')});db[_0x06c8('0x144')][_0x06c8('0x11c')](db[_0x06c8('0x1b')],{'as':_0x06c8('0x1a5'),'through':_0x06c8('0x145'),'onDelete':_0x06c8('0x172')});db[_0x06c8('0x8e')][_0x06c8('0x11c')](db['CmContact'],{'through':_0x06c8('0x193')});db[_0x06c8('0x8e')][_0x06c8('0x11c')](db[_0x06c8('0x68')],{'through':_0x06c8('0x18c')});db[_0x06c8('0x8e')][_0x06c8('0x11c')](db[_0x06c8('0x45')],{'through':_0x06c8('0x1a6')});db[_0x06c8('0x8e')][_0x06c8('0x11c')](db[_0x06c8('0x58')],{'through':_0x06c8('0x17d')});db[_0x06c8('0x8e')][_0x06c8('0x11c')](db['FaxInteraction'],{'through':_0x06c8('0x176')});db[_0x06c8('0x8e')][_0x06c8('0x11c')](db[_0x06c8('0x5f')],{'through':_0x06c8('0x183')});db[_0x06c8('0x8e')]['belongsToMany'](db[_0x06c8('0x116')],{'through':_0x06c8('0x1a7')});db['Trigger'][_0x06c8('0x10c')](db[_0x06c8('0x197')],{'as':{'plural':_0x06c8('0x1a8'),'singular':_0x06c8('0x1a9')},'foreignKey':_0x06c8('0x1aa'),'onDelete':_0x06c8('0x10a'),'hooks':!![]});db[_0x06c8('0x92')]['hasMany'](db['Condition'],{'as':{'plural':_0x06c8('0x1ab'),'singular':_0x06c8('0x1ac')},'foreignKey':'TriggerAnyId','onDelete':_0x06c8('0x10a'),'hooks':!![]});db[_0x06c8('0x92')][_0x06c8('0x10c')](db[_0x06c8('0x7c')],{'as':'Actions','foreignKey':_0x06c8('0x1ad'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x06c8('0x10c')](db[_0x06c8('0x9f')],{'as':'Fields','onDelete':_0x06c8('0x10a'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x06c8('0x1a2')][_0x06c8('0x10c')](db[_0x06c8('0x9f')],{'as':'Fields','onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1a3')});db['AnalyticMetric'][_0x06c8('0x10c')](db['AnalyticFieldReport'],{'as':_0x06c8('0x1ae'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1af')});db[_0x06c8('0x9f')]['belongsTo'](db[_0x06c8('0x9d')],{'foreignKey':_0x06c8('0x1af')});db[_0x06c8('0x1b0')][_0x06c8('0x10c')](db[_0x06c8('0xa3')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':'AccountId'});db[_0x06c8('0xa3')][_0x06c8('0x10c')](db[_0x06c8('0xa5')],{'as':'Subjects','onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xa3')][_0x06c8('0x10c')](db[_0x06c8('0xa5')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0xa3')][_0x06c8('0x10c')](db[_0x06c8('0xa5')],{'as':_0x06c8('0x1ae'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x06c8('0xa3')]['belongsTo'](db[_0x06c8('0x1b0')],{'as':'Account','foreignKey':'AccountId'});db[_0x06c8('0xa5')][_0x06c8('0x10c')](db[_0x06c8('0xa5')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xa5')][_0x06c8('0x10c')](db[_0x06c8('0xa5')],{'as':_0x06c8('0x1b5'),'foreignKey':'DescriptionId'});db[_0x06c8('0xa5')][_0x06c8('0x10c')](db[_0x06c8('0xa5')],{'as':_0x06c8('0x1b6'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xa5')][_0x06c8('0x14c')](db[_0x06c8('0x1b8')],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db['SugarcrmAccount']['hasMany'](db[_0x06c8('0xa8')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0x06c8('0x10c')](db['SugarcrmField'],{'as':_0x06c8('0x1ba'),'onDelete':_0x06c8('0x10a'),'foreignKey':'SubjectId'});db[_0x06c8('0xa8')]['hasMany'](db[_0x06c8('0xa9')],{'as':_0x06c8('0x1bb'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0xa8')][_0x06c8('0x10c')](db[_0x06c8('0xa9')],{'as':_0x06c8('0x1ae'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xa8')]['belongsTo'](db[_0x06c8('0x1bc')],{'as':'Account','foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xa9')][_0x06c8('0x10c')](db[_0x06c8('0xa9')],{'as':'Subject','foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xa9')]['hasMany'](db[_0x06c8('0xa9')],{'as':_0x06c8('0x1b5'),'foreignKey':_0x06c8('0x1b3')});db['SugarcrmField']['hasMany'](db[_0x06c8('0xa9')],{'as':_0x06c8('0x1b6'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xa9')][_0x06c8('0x14c')](db['Variable'],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db['DeskAccount'][_0x06c8('0x10c')](db[_0x06c8('0xad')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xad')][_0x06c8('0x10c')](db['DeskField'],{'as':_0x06c8('0x1ba'),'onDelete':'cascade','foreignKey':_0x06c8('0x1b2')});db['DeskConfiguration'][_0x06c8('0x10c')](db[_0x06c8('0xae')],{'as':_0x06c8('0x1bb'),'onDelete':_0x06c8('0x10a'),'foreignKey':'DescriptionId'});db[_0x06c8('0xad')][_0x06c8('0x10c')](db['DeskField'],{'as':_0x06c8('0x1ae'),'onDelete':'cascade','foreignKey':_0x06c8('0x1b7')});db['DeskConfiguration']['belongsTo'](db[_0x06c8('0xab')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xad')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':'int_desk_configuration_has_tags'});db[_0x06c8('0xae')]['hasMany'](db[_0x06c8('0xae')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xae')]['hasMany'](db[_0x06c8('0xae')],{'as':_0x06c8('0x1b5'),'foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0xae')][_0x06c8('0x10c')](db['DeskField'],{'as':'Field','foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xae')][_0x06c8('0x14c')](db[_0x06c8('0x1b8')],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db[_0x06c8('0xaf')][_0x06c8('0x10c')](db[_0x06c8('0x1be')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':'AccountId'});db[_0x06c8('0x1be')][_0x06c8('0x10c')](db[_0x06c8('0xb2')],{'as':_0x06c8('0x1ba'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b2')});db['ZohoConfiguration'][_0x06c8('0x10c')](db[_0x06c8('0xb2')],{'as':_0x06c8('0x1bb'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0x1be')][_0x06c8('0x10c')](db[_0x06c8('0xb2')],{'as':_0x06c8('0x1ae'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0x1be')][_0x06c8('0x14c')](db[_0x06c8('0xaf')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xb2')][_0x06c8('0x10c')](db[_0x06c8('0xb2')],{'as':'Subject','foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xb2')][_0x06c8('0x10c')](db[_0x06c8('0xb2')],{'as':_0x06c8('0x1b5'),'foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0xb2')]['hasMany'](db[_0x06c8('0xb2')],{'as':_0x06c8('0x1b6'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xb2')][_0x06c8('0x14c')](db['Variable'],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db[_0x06c8('0xb4')]['hasMany'](db[_0x06c8('0xb6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xb6')]['hasMany'](db[_0x06c8('0x1bf')],{'as':'Subjects','foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xb6')][_0x06c8('0x10c')](db[_0x06c8('0x1bf')],{'as':_0x06c8('0x1bb'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x06c8('0x10c')](db[_0x06c8('0x1bf')],{'as':_0x06c8('0x1ae'),'foreignKey':'FieldId'});db[_0x06c8('0xb6')]['belongsTo'](db[_0x06c8('0xb4')],{'as':'Account','foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xb6')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x1c0')});db[_0x06c8('0x1bf')][_0x06c8('0x10c')](db[_0x06c8('0x1bf')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db['ZendeskField']['hasMany'](db[_0x06c8('0x1bf')],{'as':_0x06c8('0x1b5'),'foreignKey':_0x06c8('0x1b3')});db['ZendeskField'][_0x06c8('0x10c')](db[_0x06c8('0x1bf')],{'as':'Field','foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0x1bf')][_0x06c8('0x14c')](db[_0x06c8('0x1b8')],{'as':_0x06c8('0x1b8'),'foreignKey':'VariableId'});db[_0x06c8('0xb9')]['hasMany'](db[_0x06c8('0xbb')],{'as':'Configurations','onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xbb')][_0x06c8('0x10c')](db[_0x06c8('0xbc')],{'as':'Subjects','onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xbb')][_0x06c8('0x10c')](db[_0x06c8('0xbc')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x06c8('0xbb')][_0x06c8('0x10c')](db[_0x06c8('0xbc')],{'as':_0x06c8('0x1ae'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xbb')][_0x06c8('0x14c')](db[_0x06c8('0xb9')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xbb')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x1c1')});db[_0x06c8('0xbc')][_0x06c8('0x10c')](db[_0x06c8('0xbc')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xbc')][_0x06c8('0x10c')](db[_0x06c8('0xbc')],{'as':_0x06c8('0x1b5'),'foreignKey':'DescriptionId'});db[_0x06c8('0xbc')][_0x06c8('0x10c')](db[_0x06c8('0xbc')],{'as':_0x06c8('0x1b6'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xbc')][_0x06c8('0x14c')](db['Variable'],{'as':_0x06c8('0x1b8'),'foreignKey':'VariableId'});db[_0x06c8('0x1c2')][_0x06c8('0x10c')](db[_0x06c8('0xbf')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1bd')});db['VtigerConfiguration'][_0x06c8('0x10c')](db[_0x06c8('0x1c3')],{'as':_0x06c8('0x1ba'),'foreignKey':'SubjectId'});db[_0x06c8('0xbf')]['hasMany'](db[_0x06c8('0x1c3')],{'as':_0x06c8('0x1bb'),'foreignKey':_0x06c8('0x1b3')});db['VtigerConfiguration'][_0x06c8('0x10c')](db[_0x06c8('0x1c3')],{'as':'Fields','foreignKey':_0x06c8('0x1b7')});db['VtigerConfiguration'][_0x06c8('0x14c')](db[_0x06c8('0x1c2')],{'as':_0x06c8('0x168'),'foreignKey':'AccountId'});db['VtigerField'][_0x06c8('0x10c')](db[_0x06c8('0x1c3')],{'as':'Subject','foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0x1c3')][_0x06c8('0x10c')](db[_0x06c8('0x1c3')],{'as':'Description','foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0x1c3')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0x1c3')][_0x06c8('0x14c')](db['Variable'],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db[_0x06c8('0xc1')][_0x06c8('0x10c')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x06c8('0xc2')][_0x06c8('0x10c')](db[_0x06c8('0x1c4')],{'as':_0x06c8('0x1ba'),'foreignKey':'SubjectId'});db[_0x06c8('0xc2')][_0x06c8('0x10c')](db[_0x06c8('0x1c4')],{'as':'Descriptions','foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0xc2')][_0x06c8('0x10c')](db['ServicenowField'],{'as':'Fields','foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xc2')][_0x06c8('0x14c')](db[_0x06c8('0xc1')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x1bd')});db['ServicenowField'][_0x06c8('0x10c')](db[_0x06c8('0x1c4')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0x1c4')][_0x06c8('0x10c')](db[_0x06c8('0x1c4')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x06c8('0x1c4')][_0x06c8('0x10c')](db['ServicenowField'],{'as':_0x06c8('0x1b6'),'foreignKey':'FieldId'});db['ServicenowField'][_0x06c8('0x14c')](db[_0x06c8('0x1b8')],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db[_0x06c8('0xc4')][_0x06c8('0x10c')](db[_0x06c8('0x1c5')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0x06c8('0x10c')](db[_0x06c8('0xc7')],{'as':_0x06c8('0x1ba'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0x1c5')][_0x06c8('0x10c')](db[_0x06c8('0xc7')],{'as':_0x06c8('0x1bb'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0x1c5')][_0x06c8('0x10c')](db['Dynamics365Field'],{'as':_0x06c8('0x1ae'),'onDelete':'cascade','foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0x1c5')][_0x06c8('0x14c')](db[_0x06c8('0xc4')],{'as':'Account','foreignKey':_0x06c8('0x1bd')});db[_0x06c8('0xc7')]['hasMany'](db[_0x06c8('0xc7')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db['Dynamics365Field'][_0x06c8('0x10c')](db['Dynamics365Field'],{'as':_0x06c8('0x1b5'),'foreignKey':_0x06c8('0x1b3')});db[_0x06c8('0xc7')]['hasMany'](db['Dynamics365Field'],{'as':_0x06c8('0x1b6'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xc7')][_0x06c8('0x14c')](db[_0x06c8('0x1b8')],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db[_0x06c8('0xc9')][_0x06c8('0x10c')](db[_0x06c8('0xcb')],{'as':_0x06c8('0x1b1'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1bd')});db['FreshsalesConfiguration'][_0x06c8('0x10c')](db[_0x06c8('0xcd')],{'as':_0x06c8('0x1ba'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xcb')]['hasMany'](db[_0x06c8('0xcd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x06c8('0xcb')][_0x06c8('0x10c')](db[_0x06c8('0xcd')],{'as':_0x06c8('0x1ae'),'foreignKey':_0x06c8('0x1b7')});db['FreshsalesConfiguration'][_0x06c8('0x14c')](db[_0x06c8('0xc9')],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField'][_0x06c8('0x10c')](db[_0x06c8('0xcd')],{'as':_0x06c8('0x1b4'),'foreignKey':_0x06c8('0x1b2')});db[_0x06c8('0xcd')]['hasMany'](db[_0x06c8('0xcd')],{'as':_0x06c8('0x1b5'),'foreignKey':'DescriptionId'});db[_0x06c8('0xcd')][_0x06c8('0x10c')](db['FreshsalesField'],{'as':_0x06c8('0x1b6'),'foreignKey':_0x06c8('0x1b7')});db[_0x06c8('0xcd')]['belongsTo'](db['Variable'],{'as':_0x06c8('0x1b8'),'foreignKey':_0x06c8('0x1b9')});db[_0x06c8('0xd0')]['belongsTo'](db[_0x06c8('0x132')],{});db[_0x06c8('0xd0')][_0x06c8('0x14c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0xd0')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0xd0')][_0x06c8('0x14c')](db[_0x06c8('0x68')],{});db[_0x06c8('0xd0')]['belongsTo'](db[_0x06c8('0x18a')],{});db[_0x06c8('0xd0')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{});db[_0x06c8('0xd0')]['belongsTo'](db['ChatQueue'],{});db[_0x06c8('0xd2')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1c6')});db[_0x06c8('0xd2')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1c7')});db[_0x06c8('0xd8')][_0x06c8('0x10c')](db[_0x06c8('0xd6')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x06c8('0xd8')][_0x06c8('0x10c')](db[_0x06c8('0xd4')],{'foreignKey':_0x06c8('0x1c8'),'onDelete':_0x06c8('0x10a')});db['SmsQueueReport']['belongsTo'](db[_0x06c8('0x139')],{});db[_0x06c8('0xda')][_0x06c8('0x14c')](db[_0x06c8('0xf5')],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db['SmsQueueReport'][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':'ContactId'});db[_0x06c8('0xda')][_0x06c8('0x14c')](db[_0x06c8('0x58')],{});db[_0x06c8('0xda')][_0x06c8('0x14c')](db[_0x06c8('0x17b')],{});db[_0x06c8('0xda')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{});db[_0x06c8('0xda')][_0x06c8('0x14c')](db[_0x06c8('0x59')],{});db[_0x06c8('0xdf')][_0x06c8('0x10c')](db['JscriptySessionReport'],{'foreignKey':_0x06c8('0x1c9')});db['JscriptyProject']['hasMany'](db[_0x06c8('0xd6')],{'foreignKey':_0x06c8('0x1c9')});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x06c8('0x13f')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':_0x06c8('0x1ca')});db['Team'][_0x06c8('0x11c')](db['User'],{'as':_0x06c8('0x153'),'through':_0x06c8('0x122')});db[_0x06c8('0x121')][_0x06c8('0x11c')](db[_0x06c8('0x1d')],{'through':_0x06c8('0x108'),'as':_0x06c8('0x129')});db[_0x06c8('0x121')][_0x06c8('0x11c')](db[_0x06c8('0x12a')],{'through':_0x06c8('0x1cb'),'as':_0x06c8('0x12b')});db[_0x06c8('0x121')]['belongsToMany'](db[_0x06c8('0x6c')],{'through':_0x06c8('0x18d'),'as':_0x06c8('0x12c')});db[_0x06c8('0x121')][_0x06c8('0x11c')](db[_0x06c8('0x12d')],{'through':_0x06c8('0x178'),'as':_0x06c8('0x12e')});db['Team'][_0x06c8('0x11c')](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x06c8('0x1cc')});db[_0x06c8('0x121')][_0x06c8('0x11c')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x06c8('0x121')][_0x06c8('0x11c')](db['WhatsappQueue'],{'through':_0x06c8('0x1cd'),'as':'WhatsappQueues'});db[_0x06c8('0x194')][_0x06c8('0x10c')](db['CmHopper'],{'as':_0x06c8('0x190'),'foreignKey':_0x06c8('0x195')});db[_0x06c8('0x194')][_0x06c8('0x10c')](db[_0x06c8('0x76')],{'as':_0x06c8('0x110'),'foreignKey':_0x06c8('0x195')});db[_0x06c8('0x194')][_0x06c8('0x10c')](db[_0x06c8('0x78')],{'as':_0x06c8('0x147'),'foreignKey':_0x06c8('0x195')});db[_0x06c8('0x194')][_0x06c8('0x10c')](db[_0x06c8('0x149')],{'as':'HopperBlacks','foreignKey':_0x06c8('0x195')});db[_0x06c8('0x194')][_0x06c8('0x14c')](db[_0x06c8('0x2b')],{'as':'Trunk','foreignKey':_0x06c8('0x14d')});db['Campaign'][_0x06c8('0x14c')](db[_0x06c8('0x2b')],{'as':_0x06c8('0x14e'),'foreignKey':_0x06c8('0x14f')});db[_0x06c8('0x194')]['belongsTo'](db[_0x06c8('0x84')],{'as':'Interval','foreignKey':_0x06c8('0x150')});db[_0x06c8('0x194')][_0x06c8('0x14c')](db['SquareProject'],{'as':_0x06c8('0x13f'),'foreignKey':_0x06c8('0x1ce')});db[_0x06c8('0x194')]['belongsToMany'](db['CmList'],{'as':_0x06c8('0x11f'),'through':'campaigns_has_cm_lists'});db[_0x06c8('0x194')]['belongsToMany'](db[_0x06c8('0xf5')],{'as':_0x06c8('0x1cf'),'through':'campaigns_has_cm_blacklists'});db[_0x06c8('0xeb')][_0x06c8('0x14c')](db[_0x06c8('0x6a')],{'as':_0x06c8('0x6a'),'foreignKey':'ChatOfflineMessageId'});db[_0x06c8('0x1d0')]['belongsTo'](db[_0x06c8('0x46')],{});db[_0x06c8('0x1d0')]['belongsTo'](db['MailInteraction'],{});db['MailTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x41')],{'foreignKey':_0x06c8('0x1d1'),'as':_0x06c8('0x1d2')});db[_0x06c8('0x1d0')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d3'),'as':_0x06c8('0x1d4')});db[_0x06c8('0x1d0')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d5'),'as':_0x06c8('0x1d6')});db[_0x06c8('0x1d0')][_0x06c8('0x14c')](db[_0x06c8('0x12a')],{'foreignKey':'ToMailQueueId','as':_0x06c8('0x1d7')});db[_0x06c8('0x1d0')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x06c8('0x1d8')});db['ChatTransferReport']['belongsTo'](db[_0x06c8('0x18a')],{});db['ChatTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x68')],{});db[_0x06c8('0xef')][_0x06c8('0x14c')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x06c8('0x1d2')});db['ChatTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d3'),'as':_0x06c8('0x1d4')});db[_0x06c8('0xef')]['belongsTo'](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d5'),'as':_0x06c8('0x1d6')});db['ChatTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x6c')],{'foreignKey':'ToChatQueueId','as':_0x06c8('0x1d7')});db[_0x06c8('0xef')][_0x06c8('0x14c')](db[_0x06c8('0x132')],{'foreignKey':_0x06c8('0x1d9'),'as':_0x06c8('0x1d8')});db[_0x06c8('0xf1')]['belongsTo'](db[_0x06c8('0x53')],{});db[_0x06c8('0xf1')]['belongsTo'](db[_0x06c8('0x51')],{});db['FaxTransferReport']['belongsTo'](db[_0x06c8('0x4d')],{'foreignKey':_0x06c8('0x1da'),'as':_0x06c8('0x1d2')});db[_0x06c8('0xf1')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d3'),'as':_0x06c8('0x1d4')});db[_0x06c8('0xf1')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d5'),'as':_0x06c8('0x1d6')});db[_0x06c8('0xf1')][_0x06c8('0x14c')](db[_0x06c8('0x12d')],{'foreignKey':_0x06c8('0x1db'),'as':_0x06c8('0x1d7')});db[_0x06c8('0xf1')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x06c8('0x1dc'),'as':_0x06c8('0x1d8')});db[_0x06c8('0xf2')][_0x06c8('0x14c')](db[_0x06c8('0x180')],{});db[_0x06c8('0xf2')][_0x06c8('0x14c')](db['OpenchannelInteraction'],{});db[_0x06c8('0xf2')]['belongsTo'](db[_0x06c8('0x5b')],{'foreignKey':'FromOpenchannelAccountId','as':_0x06c8('0x1d2')});db[_0x06c8('0xf2')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d3'),'as':_0x06c8('0x1d4')});db[_0x06c8('0xf2')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d5'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x61')],{'foreignKey':_0x06c8('0x1dd'),'as':'ToQueue'});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x06c8('0x1de'),'as':_0x06c8('0x1d8')});db['SmsTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x17b')],{});db[_0x06c8('0xf3')][_0x06c8('0x14c')](db[_0x06c8('0x58')],{});db[_0x06c8('0xf3')][_0x06c8('0x14c')](db[_0x06c8('0x139')],{'foreignKey':_0x06c8('0x1df'),'as':'FromAccount'});db['SmsTransferReport'][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':'FromUserId','as':_0x06c8('0x1d4')});db[_0x06c8('0xf3')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'foreignKey':_0x06c8('0x1d5'),'as':'ToAgent'});db[_0x06c8('0xf3')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0x06c8('0x1e0'),'as':_0x06c8('0x1d7')});db[_0x06c8('0xf3')]['belongsTo'](db[_0x06c8('0x139')],{'foreignKey':'ToSmsAccountId','as':_0x06c8('0x1d8')});db['CmList']['hasMany'](db[_0x06c8('0x81')],{'as':_0x06c8('0x15f'),'foreignKey':'ListId'});db[_0x06c8('0xf5')][_0x06c8('0x10c')](db[_0x06c8('0x7a')],{'as':'CustomFields','foreignKey':_0x06c8('0x164')});db[_0x06c8('0xf5')]['hasMany'](db['CmContact'],{'as':_0x06c8('0x11d'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0xf5')][_0x06c8('0x10c')](db[_0x06c8('0x76')],{'as':_0x06c8('0x110'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0xf5')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x06c8('0x164')});db['CmList'][_0x06c8('0x10c')](db[_0x06c8('0x148')],{'as':_0x06c8('0x148'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0xf5')][_0x06c8('0x11c')](db[_0x06c8('0x1d')],{'as':_0x06c8('0x1e1'),'through':_0x06c8('0x152')});db[_0x06c8('0xf5')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':'Agents','through':'cm_user_has_lists'});db['VoicePrefix']['hasMany'](db[_0x06c8('0x19')],{'as':_0x06c8('0x10f'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0xf7')]['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':_0x06c8('0x131')});db[_0x06c8('0xf9')]['hasMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'foreignKey':_0x06c8('0x119')});db['UserProfile'][_0x06c8('0x10c')](db['UserProfileSection'],{'as':_0x06c8('0x1e2'),'foreignKey':_0x06c8('0x119'),'onDelete':_0x06c8('0x10a')});db['UserProfileSection']['hasMany'](db[_0x06c8('0x1e3')],{'as':_0x06c8('0x1e4'),'foreignKey':_0x06c8('0x1e5'),'onDelete':_0x06c8('0x10a')});db[_0x06c8('0x13c')][_0x06c8('0x10c')](db[_0x06c8('0x81')],{'as':_0x06c8('0x15f'),'foreignKey':_0x06c8('0x1e6')});db[_0x06c8('0x13c')][_0x06c8('0x10c')](db[_0x06c8('0x7f')],{'as':_0x06c8('0x160'),'foreignKey':_0x06c8('0x1e6')});db[_0x06c8('0x13c')][_0x06c8('0x10c')](db[_0x06c8('0x1e7')],{'as':'Messages','foreignKey':_0x06c8('0x1e6')});db[_0x06c8('0x13c')][_0x06c8('0x10c')](db[_0x06c8('0x116')],{'as':_0x06c8('0x161')});db[_0x06c8('0x13c')]['hasMany'](db['WhatsappApplication'],{'as':_0x06c8('0x143')});db['WhatsappAccount'][_0x06c8('0x14c')](db['CmList'],{'as':_0x06c8('0x163'),'foreignKey':_0x06c8('0x164')});db[_0x06c8('0x13c')][_0x06c8('0x14c')](db['Pause'],{'as':_0x06c8('0x165'),'foreignKey':_0x06c8('0x151')});db[_0x06c8('0x13c')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':_0x06c8('0x13e')});db['WhatsappApplication'][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'onDelete':_0x06c8('0x172')});db[_0x06c8('0x1e8')][_0x06c8('0x14c')](db[_0x06c8('0x105')],{'onDelete':_0x06c8('0x172')});db[_0x06c8('0x1e8')]['belongsTo'](db[_0x06c8('0x13c')],{'onDelete':_0x06c8('0x172')});db['WhatsappApplication'][_0x06c8('0x14c')](db[_0x06c8('0x84')],{'onDelete':'restrict','foreignKey':_0x06c8('0x150')});db[_0x06c8('0x1e8')]['belongsTo'](db[_0x06c8('0x8e')],{'onDelete':'restrict','foreignKey':_0x06c8('0x173')});db['WhatsappInteraction'][_0x06c8('0x10c')](db[_0x06c8('0x1e7')],{'as':_0x06c8('0x156'),'onDelete':_0x06c8('0x10a'),'foreignKey':_0x06c8('0x1e9')});db['WhatsappInteraction'][_0x06c8('0x14c')](db[_0x06c8('0x13c')],{'as':'Account','foreignKey':_0x06c8('0x1e6')});db[_0x06c8('0x116')][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db[_0x06c8('0x116')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x16a'),'foreignKey':_0x06c8('0x10b')});db[_0x06c8('0x116')][_0x06c8('0x11c')](db[_0x06c8('0x8e')],{'through':_0x06c8('0x1a7'),'as':_0x06c8('0x16b')});db[_0x06c8('0x116')]['belongsToMany'](db['Tag'],{'through':_0x06c8('0x1a7'),'as':_0x06c8('0x16c')});db[_0x06c8('0x116')]['belongsToMany'](db[_0x06c8('0x13')],{'as':_0x06c8('0x16d'),'through':_0x06c8('0x128'),'foreignKey':_0x06c8('0x1e9')});db[_0x06c8('0x1e7')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x13')});db[_0x06c8('0x1e7')][_0x06c8('0x14c')](db['CmContact'],{'onDelete':_0x06c8('0x10a'),'as':_0x06c8('0x16e')});db[_0x06c8('0x1e7')][_0x06c8('0x14c')](db[_0x06c8('0x116')],{'onDelete':'cascade','as':_0x06c8('0x16f'),'foreignKey':_0x06c8('0x1e9')});db['WhatsappMessage'][_0x06c8('0x14c')](db[_0x06c8('0x13c')],{'as':_0x06c8('0x168'),'foreignKey':_0x06c8('0x1e6')});db[_0x06c8('0x102')]['belongsTo'](db['WhatsappAccount'],{});db[_0x06c8('0x102')][_0x06c8('0x14c')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport'][_0x06c8('0x14c')](db[_0x06c8('0x73')],{'as':_0x06c8('0x16e'),'foreignKey':_0x06c8('0x169')});db['WhatsappQueueReport'][_0x06c8('0x14c')](db[_0x06c8('0x116')],{});db[_0x06c8('0x102')][_0x06c8('0x14c')](db[_0x06c8('0x105')],{});db['WhatsappQueueReport'][_0x06c8('0x14c')](db['WhatsappMessage'],{});db[_0x06c8('0x102')][_0x06c8('0x14c')](db[_0x06c8('0x13')],{});db[_0x06c8('0x1ea')]['belongsTo'](db[_0x06c8('0x1e7')],{});db[_0x06c8('0x1ea')][_0x06c8('0x14c')](db[_0x06c8('0x116')],{});db[_0x06c8('0x1ea')][_0x06c8('0x14c')](db['WhatsappAccount'],{'foreignKey':_0x06c8('0x1eb'),'as':_0x06c8('0x1d2')});db['WhatsappTransferReport']['belongsTo'](db[_0x06c8('0x13c')],{'foreignKey':_0x06c8('0x1ec'),'as':_0x06c8('0x1d8')});db[_0x06c8('0x1ea')][_0x06c8('0x14c')](db[_0x06c8('0x105')],{'foreignKey':_0x06c8('0x1ed'),'as':_0x06c8('0x1d7')});db[_0x06c8('0x1ea')]['belongsTo'](db['User'],{'foreignKey':_0x06c8('0x1d3'),'as':'FromAgent'});db['WhatsappTransferReport'][_0x06c8('0x14c')](db['User'],{'foreignKey':_0x06c8('0x1d5'),'as':'ToAgent'});db[_0x06c8('0x105')][_0x06c8('0x11c')](db[_0x06c8('0x13')],{'as':_0x06c8('0x153'),'through':_0x06c8('0x3b'),'foreignKey':_0x06c8('0x1ee')});db[_0x06c8('0x105')][_0x06c8('0x11c')](db[_0x06c8('0x121')],{'through':_0x06c8('0x1cd'),'as':_0x06c8('0x166')});module[_0x06c8('0x1ef')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x6f81=['../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../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','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','VoiceMail','cascade','UserId','VoiceQueuesRt','hasMany','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','JscriptySessionReport','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','MailAccountId','hasOne','Imap','Smtp','Dispositions','List','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatOfflineMessageId','restrict','TagId','Items','FaxAccountId','Answers','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Agent','ChatQueue','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','UserChatQueue','ChatGroupId','Members','Contacts','CompanyId','Hoppers','JscriptySessions','Company','cm_contact_has_tags','CampaignId','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Variable','VariableId','SugarcrmAccount','DeskAccount','int_desk_configuration_has_tags','Field','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ServicenowConfiguration','FromId','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','VoiceQueues','team_has_chat_queues','team_has_fax_queues','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','ToUserId','ToAgent','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromAccount','FromAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','ToAccount','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','CustomFields','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','UserWhatsappQueue','WhatsappQueueId','exports','path','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8','sequelizeHistory','127.0.0.1','name','database','username','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory'];(function(_0x46fcee,_0x472080){var _0x23fe99=function(_0x1c07f2){while(--_0x1c07f2){_0x46fcee['push'](_0x46fcee['shift']());}};_0x23fe99(++_0x472080);}(_0x6f81,0x17d));var _0x16f8=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x6f81[_0x4ea69d];return _0x5318e0;};'use strict';var path=require(_0x16f8('0x0'));var config=require(_0x16f8('0x1'));var Sequelize=require(_0x16f8('0x2'));var _=require('lodash');var jstz=require(_0x16f8('0x3'));var timezone=jstz[_0x16f8('0x4')]();config[_0x16f8('0x2')]=_[_0x16f8('0x5')](config[_0x16f8('0x2')],{'database':_0x16f8('0x6'),'username':_0x16f8('0x7'),'password':_0x16f8('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x16f8('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x16f8('0xa'),'collate':'utf8_general_ci'}}});config[_0x16f8('0xb')]=_[_0x16f8('0x5')](config[_0x16f8('0xb')],{'database':_0x16f8('0x6'),'username':_0x16f8('0x7'),'password':_0x16f8('0x8'),'options':{'host':_0x16f8('0xc'),'port':0xcea,'dialect':_0x16f8('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x16f8('0xd')](),'define':{'charset':_0x16f8('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x16f8('0xe')],config[_0x16f8('0x2')][_0x16f8('0xf')],config[_0x16f8('0x2')]['password'],config['sequelize'][_0x16f8('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x16f8('0xe')],config['sequelizeHistory'][_0x16f8('0xf')],config[_0x16f8('0xb')]['password'],config[_0x16f8('0xb')]['options'])};db[_0x16f8('0x11')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x13'));db[_0x16f8('0x14')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x15'));db['VoiceContext']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x16'));db[_0x16f8('0x17')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x18'));db[_0x16f8('0x19')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x1a'));db[_0x16f8('0x1b')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x1c'));db[_0x16f8('0x1d')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x1e'));db['ScreenRecording']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x1f'));db['VoiceMail']=db[_0x16f8('0x2')]['import'](_0x16f8('0x20'));db[_0x16f8('0x21')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x22'));db[_0x16f8('0x23')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x24'));db[_0x16f8('0x25')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0x16f8('0x26')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x27'));db['VoiceQueueReport']=db[_0x16f8('0x2')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x28'));db[_0x16f8('0x29')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x2a'));db[_0x16f8('0x2b')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x2c'));db[_0x16f8('0x2d')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x2e'));db[_0x16f8('0x2f')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x30'));db['UserChatQueue']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x16f8('0x31')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x32'));db[_0x16f8('0x33')]=db['sequelize'][_0x16f8('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0x16f8('0x34')]=db['sequelize'][_0x16f8('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0x16f8('0x35')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x36'));db['UserWhatsappQueue']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x37'));db['MailServerIn']=db[_0x16f8('0x2')]['import'](_0x16f8('0x38'));db[_0x16f8('0x39')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x3a'));db['MailAccount']=db[_0x16f8('0x2')]['import'](_0x16f8('0x3b'));db[_0x16f8('0x3c')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0x16f8('0x3d')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x3e'));db[_0x16f8('0x3f')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x40'));db[_0x16f8('0x41')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x42'));db[_0x16f8('0x43')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/mailApplication/mailApplication.model');db[_0x16f8('0x44')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x45'));db[_0x16f8('0x46')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x47'));db['DashboardItem']=db[_0x16f8('0x2')]['import'](_0x16f8('0x48'));db[_0x16f8('0x49')]=db[_0x16f8('0x2')]['import']('../api/faxAccount/faxAccount.model');db[_0x16f8('0x4a')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x4b'));db[_0x16f8('0x4c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x4d'));db[_0x16f8('0x4e')]=db['sequelize'][_0x16f8('0x12')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x16f8('0x12')]('../api/faxQueue/faxQueue.model');db[_0x16f8('0x4f')]=db['sequelize']['import'](_0x16f8('0x50'));db[_0x16f8('0x51')]=db['sequelize'][_0x16f8('0x12')]('../api/smsAccount/smsAccount.model');db[_0x16f8('0x52')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x53'));db[_0x16f8('0x54')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x55'));db[_0x16f8('0x56')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x57'));db[_0x16f8('0x58')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x59'));db[_0x16f8('0x5a')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x5b'));db[_0x16f8('0x5c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x5d'));db[_0x16f8('0x5e')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x5f'));db[_0x16f8('0x60')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/openchannelQueue/openchannelQueue.model');db[_0x16f8('0x61')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x62'));db[_0x16f8('0x63')]=db['sequelize']['import'](_0x16f8('0x64'));db[_0x16f8('0x65')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x66'));db[_0x16f8('0x67')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x68'));db[_0x16f8('0x69')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/chatMessage/chatMessage.model');db[_0x16f8('0x6a')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x6b'));db['ChatQueue']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x6c'));db['ChatGroup']=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x16f8('0x6d')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/cmCompany/cmCompany.model');db[_0x16f8('0x6e')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x6f'));db[_0x16f8('0x70')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x71'));db[_0x16f8('0x72')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x73'));db[_0x16f8('0x74')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x75'));db[_0x16f8('0x76')]=db['sequelize']['import'](_0x16f8('0x77'));db[_0x16f8('0x78')]=db['sequelize']['import'](_0x16f8('0x79'));db[_0x16f8('0x7a')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x7b'));db[_0x16f8('0x7c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x7d'));db[_0x16f8('0x7e')]=db['sequelize'][_0x16f8('0x12')]('../api/automation/automation.model');db[_0x16f8('0x7f')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x80'));db[_0x16f8('0x81')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x82'));db[_0x16f8('0x83')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x84'));db[_0x16f8('0x85')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x86'));db[_0x16f8('0x87')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x88'));db[_0x16f8('0x89')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8a'));db['VoiceQueuesLog']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8b'));db['Schedule']=db[_0x16f8('0x2')]['import']('../api/schedule/schedule.model');db[_0x16f8('0x8c')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8d'));db[_0x16f8('0x8e')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x8f'));db[_0x16f8('0x90')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x91'));db[_0x16f8('0x92')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/trigger/trigger.model');db['Variable']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x93'));db[_0x16f8('0x94')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x95'));db[_0x16f8('0x96')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x97'));db[_0x16f8('0x98')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x99'));db['AnalyticDefaultReport']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x16f8('0x9a')]=db['sequelize'][_0x16f8('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x16f8('0x9b')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x9c'));db[_0x16f8('0x9d')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x9e'));db[_0x16f8('0x9f')]=db[_0x16f8('0x2')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa0'));db[_0x16f8('0xa1')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa2'));db[_0x16f8('0xa3')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa4'));db['SugarcrmAccount']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa5'));db[_0x16f8('0xa6')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xa7'));db[_0x16f8('0xa8')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xa9'));db['DeskAccount']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xaa'));db[_0x16f8('0xab')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xac'));db[_0x16f8('0xad')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xae'));db[_0x16f8('0xaf')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xb0'));db[_0x16f8('0xb1')]=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intZohoField/intZohoField.model');db[_0x16f8('0xb2')]=db[_0x16f8('0x2')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x16f8('0xb3')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x16f8('0xb4')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xb5'));db[_0x16f8('0xb6')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xb7'));db[_0x16f8('0xb8')]=db['sequelize'][_0x16f8('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x16f8('0xb9')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xba'));db['VtigerAccount']=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xbb'));db[_0x16f8('0xbc')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x16f8('0xbd')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xbe'));db['ServicenowAccount']=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xbf'));db['ServicenowConfiguration']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc0'));db[_0x16f8('0xc1')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc2'));db[_0x16f8('0xc3')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x16f8('0xc4')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc5'));db[_0x16f8('0xc6')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc7'));db[_0x16f8('0xc8')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xc9'));db[_0x16f8('0xca')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xcb'));db[_0x16f8('0xcc')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xcd'));db['Integration']=db['sequelize'][_0x16f8('0x12')](_0x16f8('0x95'));db[_0x16f8('0xce')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xcf'));db[_0x16f8('0xd0')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xd1'));db[_0x16f8('0xd2')]=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x16f8('0xd3')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xd4'));db['JscriptyQuestionReport']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xd5'));db['JscriptySessionReport']=db[_0x16f8('0x2')]['import'](_0x16f8('0xd6'));db['SmsQueueReport']=db[_0x16f8('0x2')][_0x16f8('0x12')]('../api/smsQueueReport/smsQueueReport.model');db[_0x16f8('0xd7')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xd8'));db[_0x16f8('0xd9')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xda'));db[_0x16f8('0xdb')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xdc'));db[_0x16f8('0xdd')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xde'));db[_0x16f8('0xdf')]=db[_0x16f8('0x2')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x16f8('0xe0')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xe1'));db[_0x16f8('0xe2')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xe3'));db[_0x16f8('0xe4')]=db['sequelize'][_0x16f8('0x12')]('../api/squareMessage/squareMessage.model');db[_0x16f8('0xe5')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xe6'));db[_0x16f8('0xe7')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xe8'));db[_0x16f8('0xe9')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xea'));db[_0x16f8('0xeb')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xec'));db[_0x16f8('0xed')]=db['sequelize']['import'](_0x16f8('0xee'));db[_0x16f8('0xef')]=db[_0x16f8('0x2')]['import']('../api/plugin/plugin.model');db[_0x16f8('0xf0')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xf1'));db['ChatTransferReport']=db[_0x16f8('0x2')]['import'](_0x16f8('0xf2'));db['FaxTransferReport']=db[_0x16f8('0x2')]['import'](_0x16f8('0xf3'));db[_0x16f8('0xf4')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xf5'));db[_0x16f8('0xf6')]=db[_0x16f8('0x2')]['import'](_0x16f8('0xf7'));db[_0x16f8('0xf8')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xf9'));db['VoicePrefix']=db['sequelize'][_0x16f8('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0x16f8('0xfa')]=db['sequelize'][_0x16f8('0x12')](_0x16f8('0xfb'));db[_0x16f8('0xfc')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xfd'));db['UserProfileResource']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0xfe'));db[_0x16f8('0xff')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x100'));db[_0x16f8('0x101')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x102'));db['WhatsappApplication']=db[_0x16f8('0x2')]['import'](_0x16f8('0x103'));db[_0x16f8('0x104')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x105'));db[_0x16f8('0x106')]=db['sequelize'][_0x16f8('0x12')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x107'));db[_0x16f8('0x108')]=db[_0x16f8('0x2')][_0x16f8('0x12')](_0x16f8('0x109'));db[_0x16f8('0x10a')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x10b'));db[_0x16f8('0x10c')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x10d'));db[_0x16f8('0x10e')]=db[_0x16f8('0x2')]['import'](_0x16f8('0x10f'));db[_0x16f8('0x11')]['hasOne'](db['VoiceMail'],{'as':_0x16f8('0x110'),'onDelete':_0x16f8('0x111'),'foreignKey':'UserId'});db[_0x16f8('0x11')]['hasMany'](db[_0x16f8('0x1d')],{'as':'Recordings','foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')]['hasMany'](db[_0x16f8('0x2d')],{'as':_0x16f8('0x113'),'foreignKey':'UserId'});db[_0x16f8('0x11')][_0x16f8('0x114')](db[_0x16f8('0x17')],{'as':_0x16f8('0x115'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db['User'][_0x16f8('0x114')](db[_0x16f8('0x74')],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x117'),'foreignKey':'UserId'});db[_0x16f8('0x11')]['hasMany'](db['ReportAgentPreview'],{'as':_0x16f8('0x78'),'foreignKey':'UserId'});db['User'][_0x16f8('0x114')](db[_0x16f8('0x5c')],{'as':_0x16f8('0x118'),'foreignKey':'UserId'});db['User'][_0x16f8('0x114')](db[_0x16f8('0x67')],{'as':'ChatInteractions','foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')][_0x16f8('0x114')](db['SmsInteraction'],{'as':_0x16f8('0x119'),'foreignKey':'UserId'});db['User']['hasMany'](db['FaxInteraction'],{'as':_0x16f8('0x11a'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')]['hasMany'](db[_0x16f8('0x3f')],{'as':_0x16f8('0x11b'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x11')][_0x16f8('0x114')](db[_0x16f8('0x104')],{'as':_0x16f8('0x11c'),'foreignKey':'UserId'});db[_0x16f8('0x11')]['hasMany'](db['UserNotification'],{'as':_0x16f8('0x11d'),'foreignKey':_0x16f8('0x11e')});db[_0x16f8('0x11')][_0x16f8('0x11f')](db[_0x16f8('0xfa')],{'as':'UserProfile','foreignKey':_0x16f8('0x120')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x122')],{'as':_0x16f8('0x123'),'through':_0x16f8('0x124')});db[_0x16f8('0x11')][_0x16f8('0x121')](db['CmContact'],{'as':'Contacts','through':_0x16f8('0x125')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x126'),'through':_0x16f8('0x127')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':_0x16f8('0x128')});db['User'][_0x16f8('0x121')](db[_0x16f8('0x3f')],{'as':_0x16f8('0x11b'),'through':_0x16f8('0x129')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x67')],{'as':_0x16f8('0x12a'),'through':_0x16f8('0x12b')});db[_0x16f8('0x11')][_0x16f8('0x121')](db['FaxInteraction'],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x54')],{'as':'SmsInteractions','through':_0x16f8('0x12c')});db[_0x16f8('0x11')]['belongsToMany'](db[_0x16f8('0x5c')],{'as':'OpenchannelInteractions','through':_0x16f8('0x12d')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x104')],{'as':_0x16f8('0x11c'),'through':_0x16f8('0x12e')});db['User']['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x16f8('0x2f'),'required':![]});db[_0x16f8('0x11')]['belongsToMany'](db[_0x16f8('0x3c')],{'as':_0x16f8('0x12f'),'through':_0x16f8('0x31'),'required':![]});db['User'][_0x16f8('0x121')](db['ChatQueue'],{'as':_0x16f8('0x130'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0x131')],{'as':_0x16f8('0x132'),'through':_0x16f8('0x33'),'required':![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0x56')],{'as':_0x16f8('0x133'),'through':_0x16f8('0x34'),'required':![]});db[_0x16f8('0x11')][_0x16f8('0x121')](db['OpenchannelQueue'],{'as':_0x16f8('0x134'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0x10a')],{'as':_0x16f8('0x135'),'through':'UserWhatsappQueue','required':![]});db['User'][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'through':_0x16f8('0x127')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x136')],{'as':_0x16f8('0x137'),'through':_0x16f8('0x138'),'required':![]});db['User'][_0x16f8('0x121')](db['ChatWebsite'],{'as':'ChatWebsites','through':'user_has_chat_websites'});db['User'][_0x16f8('0x121')](db[_0x16f8('0x49')],{'as':_0x16f8('0x139'),'through':_0x16f8('0x13a')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x13c'),'through':_0x16f8('0x13d')});db['User']['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0x16f8('0x11')][_0x16f8('0x121')](db['SmsAccount'],{'as':_0x16f8('0x13e'),'through':_0x16f8('0x13f')});db[_0x16f8('0x11')][_0x16f8('0x121')](db[_0x16f8('0x101')],{'as':_0x16f8('0x140'),'through':_0x16f8('0x141')});db[_0x16f8('0x11')][_0x16f8('0x121')](db['SquareProject'],{'as':_0x16f8('0x142'),'through':_0x16f8('0x143')});db[_0x16f8('0x14')][_0x16f8('0x114')](db[_0x16f8('0x17')],{'as':'SpiedAgents','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x144')});db['VoiceContext'][_0x16f8('0x114')](db[_0x16f8('0x17')],{'onDelete':_0x16f8('0x111')});db['VoiceExtension'][_0x16f8('0x114')](db[_0x16f8('0x17')],{'as':_0x16f8('0x145'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x19')][_0x16f8('0x121')](db[_0x16f8('0x8c')],{'as':_0x16f8('0x146'),'through':_0x16f8('0x147')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')]['hasMany'](db[_0x16f8('0x74')],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x148')});db['VoiceQueue'][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x149'),'foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')]['hasMany'](db['ReportAgentPreview'],{'as':_0x16f8('0x78'),'foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db[_0x16f8('0x72')],{'as':'HopperBlacks','foreignKey':_0x16f8('0x148')});db[_0x16f8('0x1b')][_0x16f8('0x114')](db[_0x16f8('0x14a')],{'as':'JscriptySessions','foreignKey':_0x16f8('0x148')});db['VoiceQueue']['belongsTo'](db['Trunk'],{'as':_0x16f8('0x29'),'foreignKey':_0x16f8('0x14b')});db[_0x16f8('0x1b')][_0x16f8('0x11f')](db['Trunk'],{'as':_0x16f8('0x14c'),'foreignKey':_0x16f8('0x14d')});db[_0x16f8('0x1b')]['belongsTo'](db['Interval'],{'as':_0x16f8('0x85'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x1b')][_0x16f8('0x11f')](db['Pause'],{'as':_0x16f8('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x16f8('0x1b')][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'as':'Lists','through':_0x16f8('0x150')});db[_0x16f8('0x1b')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x2f')});db[_0x16f8('0x1b')]['belongsToMany'](db[_0x16f8('0xe5')],{'as':_0x16f8('0x152'),'through':_0x16f8('0x10e')});db[_0x16f8('0x1b')][_0x16f8('0x121')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x153'),'through':_0x16f8('0x154')});db[_0x16f8('0x1d')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x155')][_0x16f8('0x11f')](db['User'],{'as':_0x16f8('0x11'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x110')][_0x16f8('0x114')](db[_0x16f8('0x21')],{'as':_0x16f8('0x156'),'onDelete':'cascade','foreignKey':_0x16f8('0x157'),'sourceKey':'mailbox'});db[_0x16f8('0x21')][_0x16f8('0x11f')](db[_0x16f8('0x110')],{'foreignKey':_0x16f8('0x157'),'targetKey':_0x16f8('0x158')});db[_0x16f8('0x23')][_0x16f8('0x114')](db['VoiceQueueReport'],{'as':_0x16f8('0x159'),'foreignKey':_0x16f8('0x15a'),'constraints':![]});db[_0x16f8('0x23')][_0x16f8('0x114')](db[_0x16f8('0x26')],{'as':'AgentReports','foreignKey':_0x16f8('0x15a'),'constraints':![]});db[_0x16f8('0x23')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x23')]['belongsTo'](db['CmContact'],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db['MailServerIn'][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x13b'),'foreignKey':'MailAccountId'});db[_0x16f8('0x39')][_0x16f8('0x11f')](db['MailAccount'],{'as':_0x16f8('0x13b'),'foreignKey':_0x16f8('0x15c')});db[_0x16f8('0x13b')][_0x16f8('0x15d')](db['MailServerIn'],{'as':_0x16f8('0x15e'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x13b')]['hasOne'](db[_0x16f8('0x39')],{'as':_0x16f8('0x15f'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x13b')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':_0x16f8('0x160'),'foreignKey':_0x16f8('0x15c')});db[_0x16f8('0x13b')]['hasMany'](db[_0x16f8('0x7f')],{'as':'Answers','foreignKey':_0x16f8('0x15c')});db['MailAccount'][_0x16f8('0x114')](db[_0x16f8('0x41')],{'as':_0x16f8('0x156'),'foreignKey':'MailAccountId'});db[_0x16f8('0x13b')]['hasMany'](db[_0x16f8('0x3f')],{'as':'Interactions'});db[_0x16f8('0x13b')]['hasMany'](db[_0x16f8('0x43')],{'as':'Applications'});db['MailAccount'][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db['MailAccount'][_0x16f8('0x11f')](db['Template'],{'as':_0x16f8('0x90'),'foreignKey':_0x16f8('0x163')});db[_0x16f8('0x13b')]['belongsTo'](db['Pause'],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x13b')][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x151'),'through':_0x16f8('0x13d')});db['MailQueue']['belongsToMany'](db['User'],{'as':_0x16f8('0x151'),'through':'UserMailQueue'});db[_0x16f8('0x3c')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':_0x16f8('0x165'),'as':_0x16f8('0x152')});db[_0x16f8('0x3f')][_0x16f8('0x114')](db[_0x16f8('0x41')],{'as':_0x16f8('0x156'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x166')});db['MailInteraction'][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x167'),'foreignKey':'MailAccountId'});db[_0x16f8('0x3f')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x3f')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x3f')]['belongsToMany'](db['Tag'],{'through':_0x16f8('0x16a'),'as':_0x16f8('0x16b')});db[_0x16f8('0x3f')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x16a'),'as':_0x16f8('0x16c')});db['MailInteraction'][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x129'),'foreignKey':_0x16f8('0x166')});db[_0x16f8('0x41')][_0x16f8('0x114')](db[_0x16f8('0xed')],{'as':_0x16f8('0x16e'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11')});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':'Contact'});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x3f')],{'as':'Interaction','foreignKey':_0x16f8('0x166')});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x167'),'foreignKey':'MailAccountId'});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x61')],{'as':_0x16f8('0x61'),'foreignKey':'ChatWebsiteId'});db[_0x16f8('0x41')][_0x16f8('0x11f')](db[_0x16f8('0x6a')],{'as':'ChatOfflineMessage','foreignKey':_0x16f8('0x16f')});db[_0x16f8('0x43')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x43')][_0x16f8('0x11f')](db[_0x16f8('0x3c')],{'onDelete':_0x16f8('0x170')});db['MailApplication'][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'onDelete':'restrict'});db[_0x16f8('0x43')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x43')]['belongsTo'](db[_0x16f8('0x8e')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db[_0x16f8('0x44')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{});db[_0x16f8('0x44')]['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x44')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x44')][_0x16f8('0x11f')](db['MailInteraction'],{});db[_0x16f8('0x44')]['belongsTo'](db[_0x16f8('0x41')],{});db[_0x16f8('0x44')][_0x16f8('0x11f')](db['User'],{});db[_0x16f8('0x44')][_0x16f8('0x11f')](db[_0x16f8('0x3c')],{});db[_0x16f8('0x46')][_0x16f8('0x114')](db['DashboardItem'],{'as':_0x16f8('0x172'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x49')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':_0x16f8('0x173')});db['FaxAccount'][_0x16f8('0x114')](db[_0x16f8('0x7f')],{'as':_0x16f8('0x174'),'foreignKey':_0x16f8('0x173')});db[_0x16f8('0x49')][_0x16f8('0x114')](db[_0x16f8('0x4c')],{'as':_0x16f8('0x175')});db['FaxAccount']['hasMany'](db[_0x16f8('0x4a')],{'as':'Applications'});db[_0x16f8('0x49')]['hasMany'](db[_0x16f8('0x17')],{'as':_0x16f8('0x176'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x49')]['hasMany'](db['FaxMessage'],{'as':'Messages'});db[_0x16f8('0x49')][_0x16f8('0x11f')](db[_0x16f8('0x29')],{'as':_0x16f8('0x29')});db[_0x16f8('0x49')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x49')][_0x16f8('0x11f')](db[_0x16f8('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x16f8('0x164')});db['FaxAccount'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':'user_has_fax_accounts'});db[_0x16f8('0x4a')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':'restrict'});db[_0x16f8('0x4a')][_0x16f8('0x11f')](db['FaxQueue'],{'onDelete':'restrict'});db[_0x16f8('0x4a')][_0x16f8('0x11f')](db[_0x16f8('0x49')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x4a')][_0x16f8('0x11f')](db[_0x16f8('0x8e')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db['FaxInteraction'][_0x16f8('0x114')](db[_0x16f8('0x4e')],{'as':_0x16f8('0x156'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x177')});db[_0x16f8('0x4c')]['belongsTo'](db[_0x16f8('0x49')],{'as':_0x16f8('0x167'),'foreignKey':'FaxAccountId'});db[_0x16f8('0x4c')][_0x16f8('0x11f')](db['CmContact'],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x4c')]['belongsTo'](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x4c')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x178'),'as':_0x16f8('0x16b')});db[_0x16f8('0x4c')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x178'),'as':_0x16f8('0x16c')});db[_0x16f8('0x4c')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':'Users','through':_0x16f8('0x179'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x11')});db[_0x16f8('0x4e')][_0x16f8('0x11f')](db[_0x16f8('0x4c')],{'as':_0x16f8('0x17a'),'foreignKey':'FaxInteractionId'});db[_0x16f8('0x4e')][_0x16f8('0x11f')](db['CmContact'],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x15b')});db['FaxMessage'][_0x16f8('0x11f')](db[_0x16f8('0xed')],{'as':_0x16f8('0xed'),'foreignKey':_0x16f8('0x17b')});db['FaxMessage'][_0x16f8('0x11f')](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x16f8('0x131')]['belongsToMany'](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x33')});db[_0x16f8('0x131')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':'team_has_fax_queues','as':'Teams'});db['FaxQueueReport'][_0x16f8('0x11f')](db['FaxAccount'],{});db['FaxQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':'List','foreignKey':'ListId'});db[_0x16f8('0x4f')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0x16f8('0x4c')],{});db[_0x16f8('0x4f')]['belongsTo'](db[_0x16f8('0x4e')],{});db[_0x16f8('0x4f')]['belongsTo'](db[_0x16f8('0x11')],{});db[_0x16f8('0x4f')][_0x16f8('0x11f')](db[_0x16f8('0x131')],{});db[_0x16f8('0x51')][_0x16f8('0x114')](db['Disposition'],{'as':_0x16f8('0x160'),'foreignKey':_0x16f8('0x17c')});db[_0x16f8('0x51')][_0x16f8('0x114')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x16f8('0x17c')});db['SmsAccount'][_0x16f8('0x114')](db[_0x16f8('0x17d')],{'as':_0x16f8('0x156'),'foreignKey':'SmsAccountId'});db[_0x16f8('0x51')][_0x16f8('0x114')](db[_0x16f8('0x54')],{'as':_0x16f8('0x175')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':_0x16f8('0x145')});db[_0x16f8('0x51')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db['SmsAccount']['belongsTo'](db[_0x16f8('0x87')],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x51')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x13f')});db['SmsApplication']['belongsTo'](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x52')][_0x16f8('0x11f')](db['SmsQueue'],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x52')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x16f8('0x170')});db['SmsApplication'][_0x16f8('0x11f')](db['Interval'],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x52')][_0x16f8('0x11f')](db['Tag'],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db[_0x16f8('0x54')][_0x16f8('0x114')](db[_0x16f8('0x17d')],{'as':_0x16f8('0x156'),'onDelete':'cascade','foreignKey':_0x16f8('0x17e')});db[_0x16f8('0x54')][_0x16f8('0x11f')](db['SmsAccount'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x17c')});db[_0x16f8('0x54')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db[_0x16f8('0x54')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x54')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x17f'),'as':'Tags'});db[_0x16f8('0x54')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x17f'),'as':_0x16f8('0x16c')});db['SmsInteraction'][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12c'),'foreignKey':_0x16f8('0x17e')});db['SmsMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11')});db[_0x16f8('0x17d')][_0x16f8('0x11f')](db['CmContact'],{'onDelete':'cascade','as':_0x16f8('0x15b')});db[_0x16f8('0x17d')][_0x16f8('0x11f')](db[_0x16f8('0x54')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x17a'),'foreignKey':_0x16f8('0x17e')});db[_0x16f8('0x17d')][_0x16f8('0x11f')](db[_0x16f8('0x51')],{'as':'Account','foreignKey':_0x16f8('0x17c')});db[_0x16f8('0x56')][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x151'),'through':_0x16f8('0x34'),'foreignKey':'SmsQueueId'});db[_0x16f8('0x56')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x16f8('0x58')]['hasMany'](db['Disposition'],{'as':_0x16f8('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0x16f8('0x58')][_0x16f8('0x114')](db['CannedAnswer'],{'as':_0x16f8('0x174'),'foreignKey':'OpenchannelAccountId'});db[_0x16f8('0x58')]['hasMany'](db[_0x16f8('0x5c')],{'as':_0x16f8('0x175'),'foreignKey':_0x16f8('0x180')});db[_0x16f8('0x58')][_0x16f8('0x114')](db[_0x16f8('0x5e')],{'as':_0x16f8('0x156'),'foreignKey':_0x16f8('0x180')});db[_0x16f8('0x58')][_0x16f8('0x114')](db[_0x16f8('0x5a')],{'as':_0x16f8('0x145'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x58')][_0x16f8('0x11f')](db['Pause'],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x58')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x181')});db[_0x16f8('0x5a')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x5a')][_0x16f8('0x11f')](db[_0x16f8('0x60')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x182')});db['OpenchannelApplication'][_0x16f8('0x11f')](db[_0x16f8('0x58')],{'onDelete':'restrict','foreignKey':_0x16f8('0x180')});db[_0x16f8('0x5a')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db['OpenchannelApplication'][_0x16f8('0x11f')](db[_0x16f8('0x8e')],{'onDelete':_0x16f8('0x170'),'foreignKey':'TagId'});db[_0x16f8('0x5c')]['hasMany'](db[_0x16f8('0x5e')],{'as':'Messages','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x183')});db['OpenchannelInteraction'][_0x16f8('0x11f')](db[_0x16f8('0x58')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x180')});db[_0x16f8('0x5c')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x5c')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':'UserId'});db[_0x16f8('0x5c')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x184'),'as':_0x16f8('0x16b')});db[_0x16f8('0x5c')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x184'),'as':_0x16f8('0x16c')});db['OpenchannelInteraction'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12d'),'foreignKey':_0x16f8('0x183')});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x111'),'as':'User'});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db['CmContact'],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x15b')});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db[_0x16f8('0x5c')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x17a'),'foreignKey':_0x16f8('0x183')});db['OpenchannelMessage'][_0x16f8('0x11f')](db['Attachment'],{'as':_0x16f8('0xed'),'foreignKey':'AttachmentId'});db[_0x16f8('0x5e')][_0x16f8('0x11f')](db['OpenchannelAccount'],{'as':_0x16f8('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x16f8('0x60')]['belongsToMany'](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x35'),'foreignKey':_0x16f8('0x182')});db[_0x16f8('0x60')][_0x16f8('0x121')](db[_0x16f8('0xe5')],{'through':'team_has_openchannel_queues','as':_0x16f8('0x152')});db['ChatWebsite'][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':_0x16f8('0x160'),'foreignKey':_0x16f8('0x185')});db['ChatWebsite'][_0x16f8('0x114')](db[_0x16f8('0x7f')],{'as':_0x16f8('0x174'),'foreignKey':'ChatWebsiteId'});db[_0x16f8('0x61')]['hasMany'](db['ChatProactiveAction'],{'as':_0x16f8('0x186')});db['ChatWebsite'][_0x16f8('0x114')](db[_0x16f8('0x67')],{'as':'Interactions'});db['ChatWebsite'][_0x16f8('0x114')](db['ChatApplication'],{'as':_0x16f8('0x145')});db[_0x16f8('0x61')]['hasMany'](db[_0x16f8('0x69')],{'as':_0x16f8('0x156')});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':'List','foreignKey':_0x16f8('0x162')});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'as':_0x16f8('0x13b'),'foreignKey':_0x16f8('0x15c')});db[_0x16f8('0x61')][_0x16f8('0x11f')](db[_0x16f8('0x87')],{'as':_0x16f8('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x16f8('0x61')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':'Agents','through':'user_has_chat_websites'});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x58')],{});db[_0x16f8('0x63')]['belongsTo'](db['CmList'],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x5c')],{});db['OpenchannelQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x5e')],{});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{});db[_0x16f8('0x63')][_0x16f8('0x11f')](db[_0x16f8('0x60')],{});db[_0x16f8('0x65')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x187'),'foreignKey':_0x16f8('0x112'),'onDelete':'restrict'});db[_0x16f8('0x65')][_0x16f8('0x11f')](db[_0x16f8('0x188')],{'as':_0x16f8('0x189'),'foreignKey':_0x16f8('0x18a'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x65')][_0x16f8('0x11f')](db['ChatWebsite'],{'as':_0x16f8('0x18b'),'foreignKey':_0x16f8('0x185'),'onDelete':'restrict'});db[_0x16f8('0x65')][_0x16f8('0x11f')](db['Tag'],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x171')});db[_0x16f8('0x67')][_0x16f8('0x114')](db[_0x16f8('0x69')],{'as':_0x16f8('0x156'),'onDelete':_0x16f8('0x111'),'foreignKey':'ChatInteractionId'});db[_0x16f8('0x67')][_0x16f8('0x11f')](db['ChatWebsite'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x185')});db[_0x16f8('0x67')][_0x16f8('0x11f')](db['CmContact'],{'as':_0x16f8('0x15b'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x67')][_0x16f8('0x121')](db['Tag'],{'through':_0x16f8('0x18c'),'as':'Tags'});db[_0x16f8('0x67')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x18c'),'as':_0x16f8('0x16c')});db[_0x16f8('0x67')][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12b'),'foreignKey':_0x16f8('0x18d')});db[_0x16f8('0x69')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x11')});db[_0x16f8('0x69')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':'Contact','foreignKey':'ContactId'});db[_0x16f8('0x69')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x17a'),'foreignKey':_0x16f8('0x18d')});db[_0x16f8('0x69')][_0x16f8('0x11f')](db[_0x16f8('0xed')],{'as':_0x16f8('0xed'),'foreignKey':_0x16f8('0x17b')});db[_0x16f8('0x69')]['belongsTo'](db[_0x16f8('0x61')],{'as':_0x16f8('0x167'),'foreignKey':'ChatWebsiteId'});db[_0x16f8('0x6a')]['hasMany'](db[_0x16f8('0xed')],{'as':_0x16f8('0x16e'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x6a')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':'Contact','foreignKey':_0x16f8('0x168')});db['ChatOfflineMessage'][_0x16f8('0x11f')](db[_0x16f8('0x61')],{'as':_0x16f8('0x167'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x18e'),'hooks':!![]});db[_0x16f8('0x188')]['belongsToMany'](db[_0x16f8('0xe5')],{'through':'team_has_chat_queues','as':_0x16f8('0x152')});db[_0x16f8('0x122')][_0x16f8('0x114')](db[_0x16f8('0xd2')],{'as':_0x16f8('0x156'),'foreignKey':_0x16f8('0x18f'),'onDelete':_0x16f8('0x111')});db['ChatGroup'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x190'),'through':_0x16f8('0x124')});db['ChatProactiveAction']['belongsTo'](db[_0x16f8('0x61')],{'as':'Website','foreignKey':_0x16f8('0x185')});db[_0x16f8('0x6d')][_0x16f8('0x114')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x191'),'foreignKey':_0x16f8('0x192')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x70')],{'as':_0x16f8('0x193'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['CmHopperFinal'],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x149'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')]['hasMany'](db[_0x16f8('0x78')],{'as':_0x16f8('0x78'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x14a')],{'as':_0x16f8('0x194'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['OpenchannelInteraction'],{'as':_0x16f8('0x118'),'foreignKey':'ContactId','onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x67')],{'as':_0x16f8('0x12a'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['SmsInteraction'],{'as':_0x16f8('0x119'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')][_0x16f8('0x114')](db[_0x16f8('0x3f')],{'as':_0x16f8('0x11b'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x6e')]['belongsTo'](db[_0x16f8('0x6d')],{'as':_0x16f8('0x195'),'foreignKey':_0x16f8('0x192')});db[_0x16f8('0x6e')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x16f8('0x162'),'onDelete':'cascade'});db['CmContact'][_0x16f8('0x121')](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x125')});db[_0x16f8('0x6e')][_0x16f8('0x121')](db['Tag'],{'as':_0x16f8('0x16b'),'through':_0x16f8('0x196')});db[_0x16f8('0x6e')][_0x16f8('0x121')](db['Tag'],{'through':_0x16f8('0x196'),'as':'ThroughTags'});db[_0x16f8('0x70')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x70')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':'ListId','onDelete':_0x16f8('0x111')});db[_0x16f8('0x70')]['belongsTo'](db[_0x16f8('0x11')],{'as':'Agent','foreignKey':'UserId'});db['CmHopper'][_0x16f8('0x11f')](db[_0x16f8('0x1b')],{'as':_0x16f8('0x189'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x16f8('0x70')][_0x16f8('0x11f')](db['Campaign'],{'as':_0x16f8('0xe9'),'foreignKey':_0x16f8('0x197'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x70')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':'OwnerId'});db[_0x16f8('0x72')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168'),'onDelete':'cascade'});db[_0x16f8('0x72')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':'List','foreignKey':_0x16f8('0x162'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x72')][_0x16f8('0x11f')](db[_0x16f8('0x1b')],{'as':'Queue','foreignKey':_0x16f8('0x148'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0x72')]['belongsTo'](db[_0x16f8('0xe9')],{'as':_0x16f8('0xe9'),'foreignKey':'CampaignId','onDelete':_0x16f8('0x111')});db[_0x16f8('0x7e')][_0x16f8('0x114')](db[_0x16f8('0x83')],{'as':{'plural':_0x16f8('0x198'),'singular':'OneAll'},'foreignKey':_0x16f8('0x199'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db['Automation'][_0x16f8('0x114')](db['Condition'],{'as':{'plural':_0x16f8('0x19a'),'singular':_0x16f8('0x19b')},'foreignKey':_0x16f8('0x19c'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x7e')][_0x16f8('0x114')](db[_0x16f8('0x7c')],{'as':_0x16f8('0x19d'),'foreignKey':'AutomationId','onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x81')]['hasMany'](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':_0x16f8('0x19e'),'onDelete':'cascade'});db['Interval'][_0x16f8('0x114')](db[_0x16f8('0x85')],{'as':_0x16f8('0x19f'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x16f8('0x17')],{'as':_0x16f8('0x115'),'foreignKey':_0x16f8('0x14e'),'onDelete':_0x16f8('0x170')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x43')],{'as':_0x16f8('0x1a0'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x65')],{'as':_0x16f8('0x1a1'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x4a')],{'as':_0x16f8('0x1a2'),'foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x85')][_0x16f8('0x114')](db[_0x16f8('0x52')],{'as':'SmsApplications','foreignKey':_0x16f8('0x14e')});db[_0x16f8('0x1a3')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{});db['Schedule']['belongsTo'](db[_0x16f8('0x1a4')],{'foreignKey':_0x16f8('0x1a5')});db[_0x16f8('0x1a3')][_0x16f8('0x11f')](db[_0x16f8('0x98')],{'foreignKey':'CustomReportId'});db[_0x16f8('0x8c')][_0x16f8('0x121')](db[_0x16f8('0x19')],{'as':_0x16f8('0x1a6'),'through':_0x16f8('0x147'),'onDelete':'restrict'});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x6e')],{'through':_0x16f8('0x196')});db['Tag'][_0x16f8('0x121')](db['ChatInteraction'],{'through':_0x16f8('0x18c')});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x3f')],{'through':_0x16f8('0x16a')});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x54')],{'through':_0x16f8('0x17f')});db[_0x16f8('0x8e')]['belongsToMany'](db[_0x16f8('0x4c')],{'through':_0x16f8('0x178')});db[_0x16f8('0x8e')][_0x16f8('0x121')](db[_0x16f8('0x5c')],{'through':_0x16f8('0x184')});db['Tag'][_0x16f8('0x121')](db[_0x16f8('0x104')],{'through':_0x16f8('0x1a7')});db['Trigger'][_0x16f8('0x114')](db[_0x16f8('0x83')],{'as':{'plural':_0x16f8('0x1a8'),'singular':'AllCondition'},'foreignKey':_0x16f8('0x1a9'),'onDelete':'cascade','hooks':!![]});db[_0x16f8('0x92')][_0x16f8('0x114')](db['Condition'],{'as':{'plural':_0x16f8('0x1aa'),'singular':_0x16f8('0x1ab')},'foreignKey':_0x16f8('0x1ac'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db[_0x16f8('0x92')][_0x16f8('0x114')](db[_0x16f8('0x7c')],{'as':_0x16f8('0x19d'),'foreignKey':_0x16f8('0x1ad'),'onDelete':_0x16f8('0x111'),'hooks':!![]});db['AnalyticCustomReport'][_0x16f8('0x114')](db[_0x16f8('0x9d')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1af'),'hooks':!![]});db[_0x16f8('0x1a4')][_0x16f8('0x114')](db[_0x16f8('0x9d')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':'DefaultReportId'});db[_0x16f8('0x9b')]['hasMany'](db[_0x16f8('0x9d')],{'as':'Fields','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b0')});db[_0x16f8('0x9d')][_0x16f8('0x11f')](db[_0x16f8('0x9b')],{'foreignKey':_0x16f8('0x1b0')});db[_0x16f8('0x1b1')][_0x16f8('0x114')](db[_0x16f8('0xa1')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xa1')]['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1b4'),'onDelete':_0x16f8('0x111'),'foreignKey':'SubjectId'});db[_0x16f8('0xa1')]['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1b5'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xa1')]['hasMany'](db['SalesforceField'],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db['SalesforceConfiguration'][_0x16f8('0x11f')](db[_0x16f8('0x1b1')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xa3')]['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db['SalesforceField']['hasMany'](db[_0x16f8('0xa3')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xa3')]['hasMany'](db[_0x16f8('0xa3')],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0xa3')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0x1bd')][_0x16f8('0x114')](db['SugarcrmConfiguration'],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db['SugarcrmConfiguration'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1b4'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b9')});db['SugarcrmConfiguration'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1b5'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xa6')][_0x16f8('0x114')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xa6')][_0x16f8('0x11f')](db[_0x16f8('0x1bd')],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db['SugarcrmField'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1b8'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':_0x16f8('0x1ba'),'foreignKey':'DescriptionId'});db[_0x16f8('0xa8')][_0x16f8('0x114')](db[_0x16f8('0xa8')],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0xa8')][_0x16f8('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0x1be')][_0x16f8('0x114')](db['DeskConfiguration'],{'as':_0x16f8('0x1b2'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xab')]['hasMany'](db[_0x16f8('0xad')],{'as':'Subjects','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xab')][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1b5'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xab')][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xab')][_0x16f8('0x11f')](db['DeskAccount'],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db[_0x16f8('0xab')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x1bf')});db['DeskField'][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1b8'),'foreignKey':'SubjectId'});db[_0x16f8('0xad')][_0x16f8('0x114')](db[_0x16f8('0xad')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xad')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db['ZohoAccount'][_0x16f8('0x114')](db[_0x16f8('0xb1')],{'as':_0x16f8('0x1b2'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xb1')][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':_0x16f8('0x1b4'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b9')});db['ZohoConfiguration'][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':_0x16f8('0x1b5'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb1')][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':'Fields','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xb1')][_0x16f8('0x11f')](db[_0x16f8('0xaf')],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db['ZohoField'],{'as':'Subject','foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0x1c1')][_0x16f8('0x114')](db[_0x16f8('0x1c1')],{'as':_0x16f8('0x1ba'),'foreignKey':'DescriptionId'});db[_0x16f8('0x1c1')][_0x16f8('0x114')](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0x1c1')][_0x16f8('0x11f')](db['Variable'],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0xb2')][_0x16f8('0x114')](db[_0x16f8('0xb3')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db['ZendeskConfiguration'][_0x16f8('0x114')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xb3')][_0x16f8('0x114')](db['ZendeskField'],{'as':_0x16f8('0x1b5'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb3')]['hasMany'](db['ZendeskField'],{'as':_0x16f8('0x1ae'),'foreignKey':'FieldId'});db[_0x16f8('0xb3')][_0x16f8('0x11f')](db['ZendeskAccount'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xb3')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':_0x16f8('0x1c2')});db[_0x16f8('0xb4')][_0x16f8('0x114')](db['ZendeskField'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xb4')]['hasMany'](db[_0x16f8('0xb4')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb4')]['hasMany'](db[_0x16f8('0xb4')],{'as':'Field','foreignKey':'FieldId'});db[_0x16f8('0xb4')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':'VariableId'});db[_0x16f8('0xb6')][_0x16f8('0x114')](db[_0x16f8('0xb8')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x16f8('0x1b3')});db['FreshdeskConfiguration']['hasMany'](db[_0x16f8('0xb9')],{'as':_0x16f8('0x1b4'),'onDelete':_0x16f8('0x111'),'foreignKey':'SubjectId'});db[_0x16f8('0xb8')][_0x16f8('0x114')](db[_0x16f8('0xb9')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x16f8('0xb8')][_0x16f8('0x114')](db[_0x16f8('0xb9')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xb8')][_0x16f8('0x11f')](db['FreshdeskAccount'],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x16f8('0x121')](db['Tag'],{'through':_0x16f8('0x1c3')});db[_0x16f8('0xb9')][_0x16f8('0x114')](db['FreshdeskField'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xb9')][_0x16f8('0x114')](db['FreshdeskField'],{'as':'Description','foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xb9')][_0x16f8('0x114')](db[_0x16f8('0xb9')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db['FreshdeskField'][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':'VariableId'});db[_0x16f8('0x1c4')][_0x16f8('0x114')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xbc')][_0x16f8('0x114')](db[_0x16f8('0xbd')],{'as':_0x16f8('0x1b4'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xbc')][_0x16f8('0x114')](db[_0x16f8('0xbd')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x16f8('0xbc')]['hasMany'](db[_0x16f8('0xbd')],{'as':'Fields','foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xbc')][_0x16f8('0x11f')](db[_0x16f8('0x1c4')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xbd')][_0x16f8('0x114')](db['VtigerField'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db['VtigerField'][_0x16f8('0x114')](db[_0x16f8('0xbd')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xbd')]['hasMany'](db[_0x16f8('0xbd')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xbd')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0x1c5')][_0x16f8('0x114')](db['ServicenowConfiguration'],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':'AccountId'});db[_0x16f8('0x1c6')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1b4'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0x1c6')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1b5'),'foreignKey':'DescriptionId'});db[_0x16f8('0x1c6')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1ae'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0x1c6')][_0x16f8('0x11f')](db[_0x16f8('0x1c5')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xc1')]['hasMany'](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xc1')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xc1')][_0x16f8('0x114')](db[_0x16f8('0xc1')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xc1')][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0xc3')][_0x16f8('0x114')](db[_0x16f8('0xc4')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xc4')][_0x16f8('0x114')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xc4')][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':_0x16f8('0x1b5'),'onDelete':'cascade','foreignKey':_0x16f8('0x1b6')});db['Dynamics365Configuration'][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':_0x16f8('0x1ae'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xc4')][_0x16f8('0x11f')](db[_0x16f8('0xc3')],{'as':'Account','foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xc6')][_0x16f8('0x114')](db['Dynamics365Field'],{'as':_0x16f8('0x1b8'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xc6')][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':_0x16f8('0x1ba'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xc6')][_0x16f8('0x114')](db[_0x16f8('0xc6')],{'as':'Field','foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xc6')][_0x16f8('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0x16f8('0x1bc')});db['FreshsalesAccount']['hasMany'](db[_0x16f8('0xca')],{'as':_0x16f8('0x1b2'),'onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1b3')});db[_0x16f8('0xca')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1b4'),'foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xca')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1b5'),'foreignKey':_0x16f8('0x1b6')});db[_0x16f8('0xca')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1ae'),'foreignKey':_0x16f8('0x1b7')});db[_0x16f8('0xca')][_0x16f8('0x11f')](db[_0x16f8('0xc8')],{'as':_0x16f8('0x167'),'foreignKey':'AccountId'});db[_0x16f8('0xcc')]['hasMany'](db[_0x16f8('0xcc')],{'as':'Subject','foreignKey':_0x16f8('0x1b9')});db[_0x16f8('0xcc')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1ba'),'foreignKey':'DescriptionId'});db[_0x16f8('0xcc')][_0x16f8('0x114')](db[_0x16f8('0xcc')],{'as':_0x16f8('0x1c0'),'foreignKey':_0x16f8('0x1b7')});db['FreshsalesField'][_0x16f8('0x11f')](db[_0x16f8('0x1bb')],{'as':_0x16f8('0x1bb'),'foreignKey':_0x16f8('0x1bc')});db[_0x16f8('0xd0')][_0x16f8('0x11f')](db[_0x16f8('0x61')],{});db[_0x16f8('0xd0')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':'ListId'});db[_0x16f8('0xd0')]['belongsTo'](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db['ChatQueueReport']['belongsTo'](db[_0x16f8('0x67')],{});db[_0x16f8('0xd0')]['belongsTo'](db['ChatMessage'],{});db[_0x16f8('0xd0')][_0x16f8('0x11f')](db['User'],{});db['ChatQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x188')],{});db[_0x16f8('0xd2')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':'cascade','foreignKey':_0x16f8('0x1c7')});db['ChatInternalMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'onDelete':'cascade','foreignKey':_0x16f8('0x1c8')});db[_0x16f8('0x14a')][_0x16f8('0x114')](db[_0x16f8('0x1c9')],{'foreignKey':_0x16f8('0x1ca'),'onDelete':'cascade'});db[_0x16f8('0x14a')][_0x16f8('0x114')](db[_0x16f8('0xd3')],{'foreignKey':_0x16f8('0x1ca'),'onDelete':_0x16f8('0x111')});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x51')],{});db[_0x16f8('0x1cb')]['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x54')],{});db[_0x16f8('0x1cb')]['belongsTo'](db[_0x16f8('0x17d')],{});db[_0x16f8('0x1cb')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{});db['SmsQueueReport'][_0x16f8('0x11f')](db[_0x16f8('0x56')],{});db[_0x16f8('0xdb')][_0x16f8('0x114')](db[_0x16f8('0x14a')],{'foreignKey':_0x16f8('0x1cc')});db[_0x16f8('0xdb')][_0x16f8('0x114')](db[_0x16f8('0x1c9')],{'foreignKey':_0x16f8('0x1cc')});db[_0x16f8('0xdb')][_0x16f8('0x114')](db[_0x16f8('0xd3')],{'foreignKey':_0x16f8('0x1cc')});db[_0x16f8('0xe0')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x143')});db['Team']['belongsToMany'](db['User'],{'as':_0x16f8('0x151'),'through':_0x16f8('0x128')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db[_0x16f8('0x1b')],{'through':_0x16f8('0x10e'),'as':_0x16f8('0x1cd')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db[_0x16f8('0x3c')],{'through':'team_has_mail_queues','as':_0x16f8('0x12f')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db['ChatQueue'],{'through':_0x16f8('0x1ce'),'as':_0x16f8('0x130')});db[_0x16f8('0xe5')]['belongsToMany'](db[_0x16f8('0x131')],{'through':_0x16f8('0x1cf'),'as':'FaxQueues'});db[_0x16f8('0xe5')]['belongsToMany'](db['SmsQueue'],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0x16f8('0xe5')][_0x16f8('0x121')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x16f8('0x134')});db[_0x16f8('0xe5')][_0x16f8('0x121')](db[_0x16f8('0x10a')],{'through':_0x16f8('0x1d0'),'as':_0x16f8('0x135')});db['Campaign'][_0x16f8('0x114')](db[_0x16f8('0x70')],{'as':_0x16f8('0x193'),'foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x16f8('0x74')],{'as':_0x16f8('0x116'),'foreignKey':_0x16f8('0x197')});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x16f8('0x72')],{'as':_0x16f8('0x1d1'),'foreignKey':_0x16f8('0x197')});db[_0x16f8('0xe9')]['belongsTo'](db[_0x16f8('0x29')],{'as':_0x16f8('0x29'),'foreignKey':'TrunkId'});db[_0x16f8('0xe9')]['belongsTo'](db['Trunk'],{'as':_0x16f8('0x14c'),'foreignKey':_0x16f8('0x14d')});db[_0x16f8('0xe9')]['belongsTo'](db[_0x16f8('0x85')],{'as':'Interval','foreignKey':_0x16f8('0x14e')});db[_0x16f8('0xe9')]['belongsTo'](db[_0x16f8('0xe0')],{'as':_0x16f8('0xe0'),'foreignKey':_0x16f8('0x1d2')});db[_0x16f8('0xe9')][_0x16f8('0x121')](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x16f8('0xe9')]['belongsToMany'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x153'),'through':_0x16f8('0x1d3')});db[_0x16f8('0xed')][_0x16f8('0x11f')](db[_0x16f8('0x6a')],{'as':_0x16f8('0x6a'),'foreignKey':_0x16f8('0x16f')});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x41')],{});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db['MailInteraction'],{});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'foreignKey':_0x16f8('0x1d4'),'as':'FromAccount'});db[_0x16f8('0xf0')]['belongsTo'](db['User'],{'foreignKey':_0x16f8('0x1d5'),'as':'FromAgent'});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':_0x16f8('0x1d7')});db[_0x16f8('0xf0')]['belongsTo'](db[_0x16f8('0x3c')],{'foreignKey':'ToMailQueueId','as':'ToQueue'});db[_0x16f8('0xf0')][_0x16f8('0x11f')](db[_0x16f8('0x13b')],{'foreignKey':_0x16f8('0x1d8'),'as':'ToAccount'});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db['ChatMessage'],{});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db['ChatInteraction'],{});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db['ChatWebsite'],{'foreignKey':_0x16f8('0x1da'),'as':_0x16f8('0x1db')});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d5'),'as':_0x16f8('0x1dc')});db[_0x16f8('0x1d9')]['belongsTo'](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':_0x16f8('0x1d7')});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db[_0x16f8('0x188')],{'foreignKey':_0x16f8('0x1dd'),'as':_0x16f8('0x1de')});db[_0x16f8('0x1d9')][_0x16f8('0x11f')](db[_0x16f8('0x61')],{'foreignKey':_0x16f8('0x1df'),'as':_0x16f8('0x1e0')});db[_0x16f8('0x1e1')]['belongsTo'](db[_0x16f8('0x4e')],{});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x4c')],{});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db['FaxAccount'],{'foreignKey':_0x16f8('0x1e2'),'as':'FromAccount'});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d5'),'as':_0x16f8('0x1dc')});db[_0x16f8('0x1e1')]['belongsTo'](db[_0x16f8('0x11')],{'foreignKey':'ToUserId','as':_0x16f8('0x1d7')});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x131')],{'foreignKey':_0x16f8('0x1e3'),'as':_0x16f8('0x1de')});db[_0x16f8('0x1e1')][_0x16f8('0x11f')](db[_0x16f8('0x49')],{'foreignKey':_0x16f8('0x1e4'),'as':_0x16f8('0x1e0')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x16f8('0x58')],{'foreignKey':_0x16f8('0x1e5'),'as':_0x16f8('0x1db')});db['OpenchannelTransferReport'][_0x16f8('0x11f')](db['User'],{'foreignKey':'FromUserId','as':_0x16f8('0x1dc')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':_0x16f8('0x1d7')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db[_0x16f8('0x60')],{'foreignKey':_0x16f8('0x1e6'),'as':_0x16f8('0x1de')});db[_0x16f8('0xf4')][_0x16f8('0x11f')](db[_0x16f8('0x58')],{'foreignKey':_0x16f8('0x1e7'),'as':_0x16f8('0x1e0')});db[_0x16f8('0xf6')][_0x16f8('0x11f')](db[_0x16f8('0x17d')],{});db['SmsTransferReport']['belongsTo'](db[_0x16f8('0x54')],{});db[_0x16f8('0xf6')][_0x16f8('0x11f')](db[_0x16f8('0x51')],{'foreignKey':_0x16f8('0x1e8'),'as':_0x16f8('0x1db')});db['SmsTransferReport'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':'FromUserId','as':_0x16f8('0x1dc')});db[_0x16f8('0xf6')]['belongsTo'](db[_0x16f8('0x11')],{'foreignKey':'ToUserId','as':_0x16f8('0x1d7')});db[_0x16f8('0xf6')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x16f8('0x1de')});db[_0x16f8('0xf6')][_0x16f8('0x11f')](db[_0x16f8('0x51')],{'foreignKey':'ToSmsAccountId','as':_0x16f8('0x1e0')});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':_0x16f8('0x162')});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x7a')],{'as':_0x16f8('0x1e9'),'foreignKey':_0x16f8('0x162')});db['CmList']['hasMany'](db[_0x16f8('0x6e')],{'as':_0x16f8('0x191'),'onDelete':_0x16f8('0x111'),'foreignKey':'ListId'});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x74')],{'as':'HopperFinals','foreignKey':_0x16f8('0x162')});db[_0x16f8('0xf8')][_0x16f8('0x114')](db[_0x16f8('0x76')],{'as':_0x16f8('0x117'),'foreignKey':'ListId'});db[_0x16f8('0xf8')][_0x16f8('0x114')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x16f8('0x162')});db[_0x16f8('0xf8')]['belongsToMany'](db[_0x16f8('0x1b')],{'as':'Queues','through':_0x16f8('0x150')});db[_0x16f8('0xf8')]['belongsToMany'](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x127')});db[_0x16f8('0x136')][_0x16f8('0x114')](db['VoiceExtension'],{'as':_0x16f8('0x115'),'onDelete':_0x16f8('0x111')});db['VoicePrefix'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':'Agents','through':_0x16f8('0x138')});db['UserProfile'][_0x16f8('0x114')](db[_0x16f8('0x11')],{'as':_0x16f8('0x16d'),'foreignKey':'userProfileId'});db[_0x16f8('0xfa')][_0x16f8('0x114')](db[_0x16f8('0xfc')],{'as':'UserProfileSections','foreignKey':_0x16f8('0x120'),'onDelete':_0x16f8('0x111')});db[_0x16f8('0xfc')][_0x16f8('0x114')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x16f8('0x1ea'),'onDelete':'cascade'});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x81')],{'as':'Dispositions','foreignKey':'WhatsappAccountId'});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x7f')],{'as':_0x16f8('0x174'),'foreignKey':_0x16f8('0x1eb')});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x106')],{'as':_0x16f8('0x156'),'foreignKey':_0x16f8('0x1eb')});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x104')],{'as':_0x16f8('0x175')});db[_0x16f8('0x101')][_0x16f8('0x114')](db[_0x16f8('0x1ec')],{'as':'Applications'});db[_0x16f8('0x101')]['belongsTo'](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x101')][_0x16f8('0x11f')](db[_0x16f8('0x87')],{'as':_0x16f8('0x14f'),'foreignKey':_0x16f8('0x164')});db[_0x16f8('0x101')][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x141')});db[_0x16f8('0x1ec')]['belongsTo'](db[_0x16f8('0x11')],{'onDelete':_0x16f8('0x170')});db[_0x16f8('0x1ec')]['belongsTo'](db[_0x16f8('0x10a')],{'onDelete':'restrict'});db[_0x16f8('0x1ec')][_0x16f8('0x11f')](db[_0x16f8('0x101')],{'onDelete':'restrict'});db[_0x16f8('0x1ec')][_0x16f8('0x11f')](db[_0x16f8('0x85')],{'onDelete':_0x16f8('0x170'),'foreignKey':_0x16f8('0x14e')});db['WhatsappApplication'][_0x16f8('0x11f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x16f8('0x171')});db[_0x16f8('0x104')]['hasMany'](db[_0x16f8('0x106')],{'as':'Messages','onDelete':_0x16f8('0x111'),'foreignKey':_0x16f8('0x1ed')});db[_0x16f8('0x104')][_0x16f8('0x11f')](db['WhatsappAccount'],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1eb')});db['WhatsappInteraction']['belongsTo'](db[_0x16f8('0x6e')],{'as':'Contact','foreignKey':_0x16f8('0x168')});db[_0x16f8('0x104')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x169'),'foreignKey':_0x16f8('0x112')});db[_0x16f8('0x104')]['belongsToMany'](db[_0x16f8('0x8e')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db[_0x16f8('0x104')][_0x16f8('0x121')](db[_0x16f8('0x8e')],{'through':_0x16f8('0x1a7'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db['User'],{'as':_0x16f8('0x16d'),'through':_0x16f8('0x12e'),'foreignKey':_0x16f8('0x1ed')});db['WhatsappMessage'][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'as':_0x16f8('0x11')});db[_0x16f8('0x106')][_0x16f8('0x11f')](db[_0x16f8('0x6e')],{'onDelete':_0x16f8('0x111'),'as':_0x16f8('0x15b')});db['WhatsappMessage'][_0x16f8('0x11f')](db[_0x16f8('0x104')],{'onDelete':_0x16f8('0x111'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x16f8('0x106')][_0x16f8('0x11f')](db[_0x16f8('0x101')],{'as':_0x16f8('0x167'),'foreignKey':_0x16f8('0x1eb')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappAccount'],{});db[_0x16f8('0x1ee')][_0x16f8('0x11f')](db[_0x16f8('0xf8')],{'as':_0x16f8('0x161'),'foreignKey':_0x16f8('0x162')});db[_0x16f8('0x1ee')]['belongsTo'](db[_0x16f8('0x6e')],{'as':_0x16f8('0x15b'),'foreignKey':_0x16f8('0x168')});db[_0x16f8('0x1ee')][_0x16f8('0x11f')](db[_0x16f8('0x104')],{});db[_0x16f8('0x1ee')][_0x16f8('0x11f')](db[_0x16f8('0x10a')],{});db[_0x16f8('0x1ee')]['belongsTo'](db[_0x16f8('0x106')],{});db[_0x16f8('0x1ee')]['belongsTo'](db['User'],{});db[_0x16f8('0x108')]['belongsTo'](db[_0x16f8('0x106')],{});db[_0x16f8('0x108')][_0x16f8('0x11f')](db['WhatsappInteraction'],{});db[_0x16f8('0x108')][_0x16f8('0x11f')](db[_0x16f8('0x101')],{'foreignKey':_0x16f8('0x1ef'),'as':_0x16f8('0x1db')});db[_0x16f8('0x108')]['belongsTo'](db[_0x16f8('0x101')],{'foreignKey':'ToWhatsappAccountId','as':_0x16f8('0x1e0')});db[_0x16f8('0x108')]['belongsTo'](db[_0x16f8('0x10a')],{'foreignKey':_0x16f8('0x1f0'),'as':_0x16f8('0x1de')});db[_0x16f8('0x108')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':'FromUserId','as':_0x16f8('0x1dc')});db[_0x16f8('0x108')][_0x16f8('0x11f')](db[_0x16f8('0x11')],{'foreignKey':_0x16f8('0x1d6'),'as':'ToAgent'});db['WhatsappQueue'][_0x16f8('0x121')](db[_0x16f8('0x11')],{'as':_0x16f8('0x151'),'through':_0x16f8('0x1f1'),'foreignKey':_0x16f8('0x1f2')});db[_0x16f8('0x10a')]['belongsToMany'](db[_0x16f8('0xe5')],{'through':_0x16f8('0x1d0'),'as':'Teams'});module[_0x16f8('0x1f3')]={'db':db,'dbH':dbH};
\ No newline at end of file
index fe75e67..ae4f042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a0=['/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/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/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./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/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','replace','@@{','}@@','includes','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','statusCode','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/templates','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0xd3a0,0xaa));var _0x0d3a=function(_0xaca1b4,_0x28a02b){_0xaca1b4=_0xaca1b4-0x0;var _0x10af95=_0xd3a0[_0xaca1b4];return _0x10af95;};'use strict';var _=require(_0x0d3a('0x0'));var path=require(_0x0d3a('0x1'));var express=require(_0x0d3a('0x2'));var ewinston=require(_0x0d3a('0x3'));var util=require('util');var errors=require(_0x0d3a('0x4'));var config=require(_0x0d3a('0x5'));var logger=require(_0x0d3a('0x6'))(_0x0d3a('0x7'));var authLogger=require(_0x0d3a('0x6'))('auth');exports[_0x0d3a('0x8')]=function(_0x16f051){_0x16f051[_0x0d3a('0x9')](ewinston[_0x0d3a('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x46b328,_0x50d6bb){var _0x1a3cac=_0x0d3a('0xb');if(!_[_0x0d3a('0xc')](_0x46b328[_0x0d3a('0xd')])){_0x1a3cac+=_0x0d3a('0xe');var _0x263571=_0x46b328[_0x0d3a('0xd')];maskSensitiveData(_0x263571);}return util['format'](_0x1a3cac,_0x46b328[_0x0d3a('0xf')],_0x46b328[_0x0d3a('0x10')]['x-forwarded-for']?_0x46b328[_0x0d3a('0x10')][_0x0d3a('0x11')]:_0x46b328[_0x0d3a('0x12')][_0x0d3a('0x13')]||_0x46b328['ip'],_0x46b328['url'],_0x50d6bb['statusCode'],_0x50d6bb[_0x0d3a('0x14')],_0x46b328[_0x0d3a('0x15')]?_0x46b328[_0x0d3a('0x15')]['id']:null,_0x46b328[_0x0d3a('0x15')]?_0x46b328[_0x0d3a('0x15')][_0x0d3a('0x16')]:null,_0x46b328[_0x0d3a('0x15')]?_0x46b328[_0x0d3a('0x15')][_0x0d3a('0x17')]:null,_0x263571?util[_0x0d3a('0x18')](_0x263571,![],null):'');}}));_0x16f051[_0x0d3a('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x516451,_0x37c833){var _0xcefb86=_0x0d3a('0x19');if(_0x516451[_0x0d3a('0xd')]&&_0x516451[_0x0d3a('0xd')][_0x0d3a('0x1a')]&&_0x516451[_0x0d3a('0xd')][_0x0d3a('0x1b')]){_0xcefb86='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x0d3a('0x1c')](_0xcefb86,_0x516451['method'],_0x516451[_0x0d3a('0x10')][_0x0d3a('0x11')]?_0x516451[_0x0d3a('0x10')]['x-forwarded-for']:_0x516451[_0x0d3a('0x12')]['remoteAddress']||_0x516451['ip'],_0x516451['url'],_0x37c833[_0x0d3a('0x1d')],_0x37c833['responseTime'],_0x516451[_0x0d3a('0x15')]?_0x516451[_0x0d3a('0x15')]['id']:null,_0x516451[_0x0d3a('0x15')]?_0x516451[_0x0d3a('0x15')][_0x0d3a('0x16')]:null,_0x516451[_0x0d3a('0x15')]?_0x516451[_0x0d3a('0x15')][_0x0d3a('0x17')]:null,_0x516451[_0x0d3a('0xd')]&&_0x516451[_0x0d3a('0xd')]['device']?_0x516451['body'][_0x0d3a('0x1a')]:'other',_0x516451['body']&&_0x516451[_0x0d3a('0xd')][_0x0d3a('0x1b')]?_0x516451[_0x0d3a('0xd')][_0x0d3a('0x1b')]:'',_0x516451[_0x0d3a('0xd')]&&_0x516451[_0x0d3a('0xd')][_0x0d3a('0x1e')]?_0x516451[_0x0d3a('0xd')][_0x0d3a('0x1e')]:'');},'ignoreRoute':function(_0x507e82){var _0x203a37=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x203a37[_0x0d3a('0x1f')](_0x507e82['url']);}}));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x20'),require(_0x0d3a('0x21')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x22'),require('./api/voiceChanSpy'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x23'),require(_0x0d3a('0x24')));_0x16f051['use']('/api/voice/extensions',require(_0x0d3a('0x25')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x26'),require(_0x0d3a('0x27')));_0x16f051['use'](_0x0d3a('0x28'),require(_0x0d3a('0x29')));_0x16f051[_0x0d3a('0x9')]('/api/voice/recordings',require(_0x0d3a('0x2a')));_0x16f051[_0x0d3a('0x9')]('/api/screen/recordings',require(_0x0d3a('0x2b')));_0x16f051['use'](_0x0d3a('0x2c'),require(_0x0d3a('0x2d')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x2e'),require(_0x0d3a('0x2f')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x30'),require(_0x0d3a('0x31')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x32'),require(_0x0d3a('0x33')));_0x16f051['use'](_0x0d3a('0x34'),require(_0x0d3a('0x35')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x36'),require('./api/voiceQueueReport'));_0x16f051['use'](_0x0d3a('0x37'),require('./api/memberReport'));_0x16f051[_0x0d3a('0x9')]('/api/trunks',require(_0x0d3a('0x38')));_0x16f051[_0x0d3a('0x9')]('/api/voice/transfers/reports',require(_0x0d3a('0x39')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x3a'),require('./api/mailServerOut'));_0x16f051[_0x0d3a('0x9')]('/api/mail/accounts',require(_0x0d3a('0x3b')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x3c'),require(_0x0d3a('0x3d')));_0x16f051['use'](_0x0d3a('0x3e'),require(_0x0d3a('0x3f')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x40'),require(_0x0d3a('0x41')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x42'),require(_0x0d3a('0x43')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x44'),require(_0x0d3a('0x45')));_0x16f051['use'](_0x0d3a('0x46'),require(_0x0d3a('0x47')));_0x16f051[_0x0d3a('0x9')]('/api/dashboards',require(_0x0d3a('0x48')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x49'),require(_0x0d3a('0x4a')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x4b'),require(_0x0d3a('0x4c')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x4d'),require('./api/faxApplication'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x4e'),require(_0x0d3a('0x4f')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x50'),require('./api/faxMessage'));_0x16f051['use'](_0x0d3a('0x51'),require(_0x0d3a('0x52')));_0x16f051[_0x0d3a('0x9')]('/api/fax/reports/queue',require(_0x0d3a('0x53')));_0x16f051[_0x0d3a('0x9')]('/api/sms/accounts',require(_0x0d3a('0x54')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x55'),require('./api/smsApplication'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x56'),require(_0x0d3a('0x57')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x58'),require('./api/smsMessage'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x59'),require('./api/smsQueue'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x5a'),require('./api/openchannelAccount'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x5b'),require('./api/openchannelApplication'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x5c'),require('./api/openchannelInteraction'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x5d'),require(_0x0d3a('0x5e')));_0x16f051['use'](_0x0d3a('0x5f'),require('./api/openchannelQueue'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x60'),require(_0x0d3a('0x61')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x62'),require(_0x0d3a('0x63')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x64'),require(_0x0d3a('0x65')));_0x16f051['use'](_0x0d3a('0x66'),require(_0x0d3a('0x67')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x68'),require(_0x0d3a('0x69')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x6a'),require(_0x0d3a('0x6b')));_0x16f051['use'](_0x0d3a('0x6c'),require(_0x0d3a('0x6d')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x6e'),require(_0x0d3a('0x6f')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x70'),require(_0x0d3a('0x71')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x72'),require(_0x0d3a('0x73')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x74'),require('./api/cmContact'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x75'),require('./api/cmHopper'));_0x16f051['use'](_0x0d3a('0x76'),require(_0x0d3a('0x77')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x78'),require(_0x0d3a('0x79')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x7a'),require(_0x0d3a('0x7b')));_0x16f051['use'](_0x0d3a('0x7c'),require(_0x0d3a('0x7d')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x7e'),require(_0x0d3a('0x7f')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x80'),require(_0x0d3a('0x81')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x82'),require(_0x0d3a('0x83')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x84'),require(_0x0d3a('0x85')));_0x16f051['use']('/api/conditions',require(_0x0d3a('0x86')));_0x16f051['use'](_0x0d3a('0x87'),require(_0x0d3a('0x88')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x89'),require(_0x0d3a('0x8a')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x8b'),require(_0x0d3a('0x8c')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x8d'),require(_0x0d3a('0x8e')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x8f'),require(_0x0d3a('0x90')));_0x16f051['use'](_0x0d3a('0x91'),require('./api/sound'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x92'),require(_0x0d3a('0x93')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x94'),require('./api/template'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x95'),require('./api/trigger'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x96'),require(_0x0d3a('0x97')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x98'),require(_0x0d3a('0x99')));_0x16f051['use'](_0x0d3a('0x9a'),require('./api/integrationReport'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x9b'),require(_0x0d3a('0x9c')));_0x16f051['use'](_0x0d3a('0x9d'),require(_0x0d3a('0x9e')));_0x16f051['use'](_0x0d3a('0x9f'),require(_0x0d3a('0xa0')));_0x16f051[_0x0d3a('0x9')]('/api/analytics/metrics',require(_0x0d3a('0xa1')));_0x16f051['use'](_0x0d3a('0xa2'),require(_0x0d3a('0xa3')));_0x16f051['use'](_0x0d3a('0xa4'),require(_0x0d3a('0xa5')));_0x16f051[_0x0d3a('0x9')]('/api/integrations/salesforce/accounts',require(_0x0d3a('0xa6')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xa7'),require(_0x0d3a('0xa8')));_0x16f051['use']('/api/integrations/salesforce/fields',require(_0x0d3a('0xa9')));_0x16f051['use'](_0x0d3a('0xaa'),require(_0x0d3a('0xab')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xac'),require(_0x0d3a('0xad')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xae'),require('./api/intSugarcrmField'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xaf'),require('./api/intDeskAccount'));_0x16f051[_0x0d3a('0x9')]('/api/integrations/desk/configurations',require(_0x0d3a('0xb0')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xb1'),require('./api/intDeskField'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xb2'),require('./api/intZohoAccount'));_0x16f051[_0x0d3a('0x9')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x16f051['use'](_0x0d3a('0xb3'),require(_0x0d3a('0xb4')));_0x16f051['use']('/api/integrations/zendesk/accounts',require(_0x0d3a('0xb5')));_0x16f051[_0x0d3a('0x9')]('/api/integrations/zendesk/configurations',require(_0x0d3a('0xb6')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xb7'),require('./api/intZendeskField'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xb8'),require(_0x0d3a('0xb9')));_0x16f051['use'](_0x0d3a('0xba'),require(_0x0d3a('0xbb')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xbc'),require(_0x0d3a('0xbd')));_0x16f051['use'](_0x0d3a('0xbe'),require(_0x0d3a('0xbf')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xc0'),require(_0x0d3a('0xc1')));_0x16f051[_0x0d3a('0x9')]('/api/integrations/vtiger/fields',require(_0x0d3a('0xc2')));_0x16f051['use']('/api/integrations/servicenow/accounts',require(_0x0d3a('0xc3')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xc4'),require(_0x0d3a('0xc5')));_0x16f051['use'](_0x0d3a('0xc6'),require(_0x0d3a('0xc7')));_0x16f051[_0x0d3a('0x9')]('/api/integrations/dynamics365/accounts',require(_0x0d3a('0xc8')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xc9'),require(_0x0d3a('0xca')));_0x16f051['use'](_0x0d3a('0xcb'),require(_0x0d3a('0xcc')));_0x16f051['use'](_0x0d3a('0xcd'),require('./api/intFreshsalesAccount'));_0x16f051[_0x0d3a('0x9')]('/api/integrations/freshsales/configurations',require(_0x0d3a('0xce')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xcf'),require(_0x0d3a('0xd0')));_0x16f051['use'](_0x0d3a('0xd1'),require(_0x0d3a('0xd2')));_0x16f051['use'](_0x0d3a('0xd3'),require(_0x0d3a('0xd4')));_0x16f051['use'](_0x0d3a('0xd5'),require(_0x0d3a('0xd6')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xd7'),require(_0x0d3a('0xd8')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xd9'),require('./api/jscriptyQuestionReport'));_0x16f051['use'](_0x0d3a('0xda'),require(_0x0d3a('0xdb')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xdc'),require('./api/smsQueueReport'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xdd'),require(_0x0d3a('0xde')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xdf'),require(_0x0d3a('0xe0')));_0x16f051['use'](_0x0d3a('0xe1'),require(_0x0d3a('0xe2')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xe3'),require(_0x0d3a('0xe4')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xe5'),require(_0x0d3a('0xe6')));_0x16f051[_0x0d3a('0x9')]('/api/square/projects',require(_0x0d3a('0xe7')));_0x16f051['use']('/api/square/recordings',require(_0x0d3a('0xe8')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xe9'),require(_0x0d3a('0xea')));_0x16f051[_0x0d3a('0x9')]('/api/teams',require(_0x0d3a('0xeb')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xec'),require(_0x0d3a('0xed')));_0x16f051['use'](_0x0d3a('0xee'),require(_0x0d3a('0xef')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xf0'),require('./api/migration'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xf1'),require(_0x0d3a('0xf2')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xf3'),require(_0x0d3a('0xf4')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xf5'),require('./api/mailTransferReport'));_0x16f051['use'](_0x0d3a('0xf6'),require(_0x0d3a('0xf7')));_0x16f051['use'](_0x0d3a('0xf8'),require(_0x0d3a('0xf9')));_0x16f051['use'](_0x0d3a('0xfa'),require('./api/openchannelTransferReport'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xfb'),require(_0x0d3a('0xfc')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xfd'),require(_0x0d3a('0xfe')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0xff'),require('./api/voicePrefix'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x100'),require(_0x0d3a('0x101')));_0x16f051[_0x0d3a('0x9')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x16f051[_0x0d3a('0x9')]('/api/userProfile/resources',require(_0x0d3a('0x102')));_0x16f051['use'](_0x0d3a('0x103'),require(_0x0d3a('0x104')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x105'),require(_0x0d3a('0x106')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x107'),require(_0x0d3a('0x108')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x109'),require('./api/whatsappInteraction'));_0x16f051['use'](_0x0d3a('0x10a'),require(_0x0d3a('0x10b')));_0x16f051[_0x0d3a('0x9')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x16f051['use'](_0x0d3a('0x10c'),require(_0x0d3a('0x10d')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x10e'),require(_0x0d3a('0x10f')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x110'),require(_0x0d3a('0x111')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x112'),require(_0x0d3a('0x113')));_0x16f051[_0x0d3a('0x9')]('/api/auth/google',require('./api/authGoogle'));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x114'),require(_0x0d3a('0x115')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x116'),require(_0x0d3a('0x117')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x118'),require(_0x0d3a('0x119')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x11a'),require(_0x0d3a('0x11b')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x11c'),require('./api/pm2'));_0x16f051['use'](_0x0d3a('0x11d'),require(_0x0d3a('0x11e')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x11f'),express[_0x0d3a('0x120')](path[_0x0d3a('0x121')](config[_0x0d3a('0x122')],'/apidoc')));_0x16f051['use'](_0x0d3a('0x123'),express[_0x0d3a('0x120')](path[_0x0d3a('0x121')](config['root'],_0x0d3a('0x123'))));_0x16f051['use'](_0x0d3a('0x124'),express['static'](path[_0x0d3a('0x121')](config[_0x0d3a('0x122')],'/demo')));_0x16f051[_0x0d3a('0x9')](_0x0d3a('0x125'),express['static'](path[_0x0d3a('0x121')](config[_0x0d3a('0x122')],_0x0d3a('0x126'),_0x0d3a('0x127'))));_0x16f051[_0x0d3a('0x9')]('/plugins',express[_0x0d3a('0x120')](path['join'](config[_0x0d3a('0x122')],_0x0d3a('0x128'))));_0x16f051[_0x0d3a('0x129')](_0x0d3a('0x12a'))[_0x0d3a('0x12b')](errors[0x194]);_0x16f051['route']('/*')[_0x0d3a('0x12b')](function(_0x242237,_0x5877d8){_0x5877d8[_0x0d3a('0x12c')](path[_0x0d3a('0x12d')](_0x16f051['get']('appPath')+_0x0d3a('0x12e')));});};var sensitiveFields=['username',_0x0d3a('0x12f'),_0x0d3a('0x130'),_0x0d3a('0x131'),_0x0d3a('0x132'),_0x0d3a('0x133'),_0x0d3a('0x134'),_0x0d3a('0x135'),_0x0d3a('0x136'),_0x0d3a('0x137'),_0x0d3a('0x138'),_0x0d3a('0x139'),'clientSecret',_0x0d3a('0x13a'),_0x0d3a('0x13b'),_0x0d3a('0x13c'),_0x0d3a('0x13d'),'token',_0x0d3a('0x13e'),_0x0d3a('0x13f'),_0x0d3a('0x140'),_0x0d3a('0x141'),_0x0d3a('0x142'),_0x0d3a('0x143'),_0x0d3a('0x144'),'calleridname',_0x0d3a('0x145'),_0x0d3a('0x146'),'vidaooApiKey',_0x0d3a('0x147'),_0x0d3a('0x148'),_0x0d3a('0x149'),_0x0d3a('0x14a'),_0x0d3a('0x14b'),'user',_0x0d3a('0x14c'),_0x0d3a('0x14d'),'localstationid',_0x0d3a('0x14e'),_0x0d3a('0x14f'),_0x0d3a('0x150'),'oldPassword'];function maskSensitiveData(_0x58427e){var _0x378c0e=/(?!^)[\s\S](?!$)/g;if(!_[_0x0d3a('0x151')](_0x58427e))return;for(var _0x432e0e in _0x58427e){if(_[_0x0d3a('0x152')](_0x58427e[_0x432e0e])){for(var _0x58bede=0x0;_0x58bede<_0x58427e[_0x432e0e][_0x0d3a('0x153')];_0x58bede++){maskSensitiveData(_0x58427e[_0x432e0e][_0x58bede]);}}else if(_['isPlainObject'](_0x58427e[_0x432e0e])){maskSensitiveData(_0x58427e[_0x432e0e]);}else if(_['isString'](_0x58427e[_0x432e0e])){_0x58427e[_0x432e0e]=_0x58427e[_0x432e0e][_0x0d3a('0x154')](/{{{/g,_0x0d3a('0x155'))[_0x0d3a('0x154')](/}}}/g,_0x0d3a('0x156'))[_0x0d3a('0x154')](/{{/g,'@{')[_0x0d3a('0x154')](/}}/g,'}@');if(_[_0x0d3a('0x157')](sensitiveFields,_0x432e0e)){_0x58427e[_0x432e0e]=_0x58427e[_0x432e0e][_0x0d3a('0x154')](_0x378c0e,'*');}}}}
\ No newline at end of file
+var _0xb9a7=['/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperFinal','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/trigger','/api/variables','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','secret','registry','oldPassword','isArray','length','@@{','replace','}@@','includes','path','./errors','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','connection','remoteAddress','url','responseTime','user','role','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','x-forwarded-for','name','other','agent_name','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold'];(function(_0x5a7de2,_0x2c0c67){var _0x4c5a8e=function(_0x123d79){while(--_0x123d79){_0x5a7de2['push'](_0x5a7de2['shift']());}};_0x4c5a8e(++_0x2c0c67);}(_0xb9a7,0x112));var _0x7b9a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb9a7[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var path=require(_0x7b9a('0x0'));var express=require('express');var ewinston=require('express-winston');var util=require('util');var errors=require(_0x7b9a('0x1'));var config=require('./config/environment');var logger=require(_0x7b9a('0x2'))(_0x7b9a('0x3'));var authLogger=require(_0x7b9a('0x2'))(_0x7b9a('0x4'));exports[_0x7b9a('0x5')]=function(_0xf6dae2){_0xf6dae2[_0x7b9a('0x6')](ewinston[_0x7b9a('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x37ce81,_0x3e51f0){var _0x4d3f20=_0x7b9a('0x8');if(!_[_0x7b9a('0x9')](_0x37ce81['body'])){_0x4d3f20+='\x20body=%s';var _0x47e220=_0x37ce81[_0x7b9a('0xa')];maskSensitiveData(_0x47e220);}return util[_0x7b9a('0xb')](_0x4d3f20,_0x37ce81['method'],_0x37ce81[_0x7b9a('0xc')]['x-forwarded-for']?_0x37ce81[_0x7b9a('0xc')]['x-forwarded-for']:_0x37ce81[_0x7b9a('0xd')][_0x7b9a('0xe')]||_0x37ce81['ip'],_0x37ce81[_0x7b9a('0xf')],_0x3e51f0['statusCode'],_0x3e51f0[_0x7b9a('0x10')],_0x37ce81[_0x7b9a('0x11')]?_0x37ce81['user']['id']:null,_0x37ce81[_0x7b9a('0x11')]?_0x37ce81[_0x7b9a('0x11')]['name']:null,_0x37ce81[_0x7b9a('0x11')]?_0x37ce81[_0x7b9a('0x11')][_0x7b9a('0x12')]:null,_0x47e220?util[_0x7b9a('0x13')](_0x47e220,![],null):'');}}));_0xf6dae2[_0x7b9a('0x6')](ewinston[_0x7b9a('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x22a7e4,_0x35e602){var _0x2f1899='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x14')]&&_0x22a7e4[_0x7b9a('0xa')][_0x7b9a('0x15')]){_0x2f1899=_0x7b9a('0x16');}return util[_0x7b9a('0xb')](_0x2f1899,_0x22a7e4[_0x7b9a('0x17')],_0x22a7e4[_0x7b9a('0xc')][_0x7b9a('0x18')]?_0x22a7e4[_0x7b9a('0xc')][_0x7b9a('0x18')]:_0x22a7e4[_0x7b9a('0xd')][_0x7b9a('0xe')]||_0x22a7e4['ip'],_0x22a7e4[_0x7b9a('0xf')],_0x35e602['statusCode'],_0x35e602[_0x7b9a('0x10')],_0x22a7e4['user']?_0x22a7e4[_0x7b9a('0x11')]['id']:null,_0x22a7e4['user']?_0x22a7e4[_0x7b9a('0x11')][_0x7b9a('0x19')]:null,_0x22a7e4[_0x7b9a('0x11')]?_0x22a7e4['user'][_0x7b9a('0x12')]:null,_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x14')]?_0x22a7e4[_0x7b9a('0xa')][_0x7b9a('0x14')]:_0x7b9a('0x1a'),_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x15')]?_0x22a7e4[_0x7b9a('0xa')]['agent_id']:'',_0x22a7e4[_0x7b9a('0xa')]&&_0x22a7e4['body'][_0x7b9a('0x1b')]?_0x22a7e4[_0x7b9a('0xa')]['agent_name']:'');},'ignoreRoute':function(_0x55d01c){var _0x24d886=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x24d886['test'](_0x55d01c['url']);}}));_0xf6dae2[_0x7b9a('0x6')]('/api/users',require('./api/user'));_0xf6dae2[_0x7b9a('0x6')]('/api/voice/chanspy',require(_0x7b9a('0x1c')));_0xf6dae2[_0x7b9a('0x6')]('/api/voice/contexts',require(_0x7b9a('0x1d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x1e'),require('./api/voiceExtension'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x1f'),require(_0x7b9a('0x20')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x21'),require(_0x7b9a('0x22')));_0xf6dae2['use']('/api/voice/recordings',require(_0x7b9a('0x23')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x24'),require('./api/screenRecording'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x25'),require('./api/voiceMail'));_0xf6dae2['use'](_0x7b9a('0x26'),require(_0x7b9a('0x27')));_0xf6dae2['use'](_0x7b9a('0x28'),require(_0x7b9a('0x29')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x2a'),require(_0x7b9a('0x2b')));_0xf6dae2['use'](_0x7b9a('0x2c'),require(_0x7b9a('0x2d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x2e'),require(_0x7b9a('0x2f')));_0xf6dae2[_0x7b9a('0x6')]('/api/members/reports',require('./api/memberReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x30'),require('./api/trunk'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x31'),require(_0x7b9a('0x32')));_0xf6dae2['use'](_0x7b9a('0x33'),require(_0x7b9a('0x34')));_0xf6dae2['use']('/api/mail/accounts',require(_0x7b9a('0x35')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x36'),require(_0x7b9a('0x37')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x38'),require(_0x7b9a('0x39')));_0xf6dae2[_0x7b9a('0x6')]('/api/mail/interactions',require(_0x7b9a('0x3a')));_0xf6dae2['use'](_0x7b9a('0x3b'),require(_0x7b9a('0x3c')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x3d'),require(_0x7b9a('0x3e')));_0xf6dae2[_0x7b9a('0x6')]('/api/mail/reports/queue',require(_0x7b9a('0x3f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x40'),require(_0x7b9a('0x41')));_0xf6dae2['use'](_0x7b9a('0x42'),require(_0x7b9a('0x43')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x44'),require('./api/faxAccount'));_0xf6dae2[_0x7b9a('0x6')]('/api/fax/applications',require(_0x7b9a('0x45')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x46'),require(_0x7b9a('0x47')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x48'),require('./api/faxMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x49'),require(_0x7b9a('0x4a')));_0xf6dae2['use']('/api/fax/reports/queue',require(_0x7b9a('0x4b')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x4c'),require(_0x7b9a('0x4d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x4e'),require('./api/smsApplication'));_0xf6dae2['use']('/api/sms/interactions',require(_0x7b9a('0x4f')));_0xf6dae2[_0x7b9a('0x6')]('/api/sms/messages',require(_0x7b9a('0x50')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x51'),require('./api/smsQueue'));_0xf6dae2[_0x7b9a('0x6')]('/api/openchannel/accounts',require(_0x7b9a('0x52')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x53'),require(_0x7b9a('0x54')));_0xf6dae2[_0x7b9a('0x6')]('/api/openchannel/interactions',require(_0x7b9a('0x55')));_0xf6dae2['use'](_0x7b9a('0x56'),require('./api/openchannelMessage'));_0xf6dae2['use'](_0x7b9a('0x57'),require(_0x7b9a('0x58')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x59'),require(_0x7b9a('0x5a')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x5b'),require(_0x7b9a('0x5c')));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/applications',require(_0x7b9a('0x5d')));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/interactions',require('./api/chatInteraction'));_0xf6dae2['use'](_0x7b9a('0x5e'),require(_0x7b9a('0x5f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x60'),require('./api/chatOfflineMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x61'),require(_0x7b9a('0x62')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x63'),require('./api/chatGroup'));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/proactive_actions',require(_0x7b9a('0x64')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x65'),require(_0x7b9a('0x66')));_0xf6dae2['use'](_0x7b9a('0x67'),require(_0x7b9a('0x68')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x69'),require(_0x7b9a('0x6a')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x6b'),require('./api/cmHopperBlack'));_0xf6dae2['use']('/api/cm/hopper_final',require(_0x7b9a('0x6c')));_0xf6dae2[_0x7b9a('0x6')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0xf6dae2['use']('/api/cm/custom_fields',require(_0x7b9a('0x6d')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x6e'),require(_0x7b9a('0x6f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x70'),require(_0x7b9a('0x71')));_0xf6dae2[_0x7b9a('0x6')]('/api/canned_answers',require(_0x7b9a('0x72')));_0xf6dae2['use'](_0x7b9a('0x73'),require(_0x7b9a('0x74')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x75'),require(_0x7b9a('0x76')));_0xf6dae2['use'](_0x7b9a('0x77'),require('./api/interval'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x78'),require(_0x7b9a('0x79')));_0xf6dae2['use']('/api/cdr',require('./api/cdr'));_0xf6dae2['use'](_0x7b9a('0x7a'),require(_0x7b9a('0x7b')));_0xf6dae2[_0x7b9a('0x6')]('/api/schedules',require(_0x7b9a('0x7c')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x7d'),require(_0x7b9a('0x7e')));_0xf6dae2[_0x7b9a('0x6')]('/api/tags',require(_0x7b9a('0x7f')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x80'),require('./api/template'));_0xf6dae2['use']('/api/triggers',require(_0x7b9a('0x81')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x82'),require('./api/variable'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x83'),require('./api/integration'));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/reports',require(_0x7b9a('0x84')));_0xf6dae2['use'](_0x7b9a('0x85'),require(_0x7b9a('0x86')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x87'),require('./api/analyticDefaultReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x88'),require(_0x7b9a('0x89')));_0xf6dae2[_0x7b9a('0x6')]('/api/analytics/metrics',require(_0x7b9a('0x8a')));_0xf6dae2['use'](_0x7b9a('0x8b'),require('./api/analyticFieldReport'));_0xf6dae2[_0x7b9a('0x6')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0xf6dae2['use']('/api/integrations/salesforce/accounts',require(_0x7b9a('0x8c')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x8d'),require(_0x7b9a('0x8e')));_0xf6dae2['use'](_0x7b9a('0x8f'),require('./api/intSalesforceField'));_0xf6dae2['use'](_0x7b9a('0x90'),require('./api/intSugarcrmAccount'));_0xf6dae2['use'](_0x7b9a('0x91'),require(_0x7b9a('0x92')));_0xf6dae2['use'](_0x7b9a('0x93'),require('./api/intSugarcrmField'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x94'),require(_0x7b9a('0x95')));_0xf6dae2['use']('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0xf6dae2['use'](_0x7b9a('0x96'),require(_0x7b9a('0x97')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x98'),require(_0x7b9a('0x99')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x9a'),require('./api/intZohoConfiguration'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x9b'),require('./api/intZohoField'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x9c'),require(_0x7b9a('0x9d')));_0xf6dae2['use']('/api/integrations/zendesk/configurations',require(_0x7b9a('0x9e')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/zendesk/fields',require(_0x7b9a('0x9f')));_0xf6dae2['use'](_0x7b9a('0xa0'),require(_0x7b9a('0xa1')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/freshdesk/configurations',require(_0x7b9a('0xa2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa3'),require(_0x7b9a('0xa4')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa5'),require('./api/intVtigerConfiguration'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa6'),require(_0x7b9a('0xa7')));_0xf6dae2['use']('/api/integrations/servicenow/accounts',require(_0x7b9a('0xa8')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xa9'),require(_0x7b9a('0xaa')));_0xf6dae2['use'](_0x7b9a('0xab'),require(_0x7b9a('0xac')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xad'),require(_0x7b9a('0xae')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/dynamics365/fields',require(_0x7b9a('0xaf')));_0xf6dae2[_0x7b9a('0x6')]('/api/integrations/freshsales/accounts',require(_0x7b9a('0xb0')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb1'),require(_0x7b9a('0xb2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb3'),require(_0x7b9a('0xb4')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb5'),require(_0x7b9a('0xb6')));_0xf6dae2[_0x7b9a('0x6')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb7'),require('./api/chatInternalMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb8'),require('./api/jscriptyAnswerReport'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xb9'),require(_0x7b9a('0xba')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xbb'),require(_0x7b9a('0xbc')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xbd'),require(_0x7b9a('0xbe')));_0xf6dae2['use'](_0x7b9a('0xbf'),require(_0x7b9a('0xc0')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xc1'),require(_0x7b9a('0xc2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xc3'),require(_0x7b9a('0xc4')));_0xf6dae2['use'](_0x7b9a('0xc5'),require(_0x7b9a('0xc6')));_0xf6dae2[_0x7b9a('0x6')]('/api/square/odbc',require(_0x7b9a('0xc7')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xc8'),require(_0x7b9a('0xc9')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xca'),require(_0x7b9a('0xcb')));_0xf6dae2[_0x7b9a('0x6')]('/api/square/messages',require('./api/squareMessage'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xcc'),require(_0x7b9a('0xcd')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xce'),require(_0x7b9a('0xcf')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd0'),require(_0x7b9a('0xd1')));_0xf6dae2[_0x7b9a('0x6')]('/api/migrations',require(_0x7b9a('0xd2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd3'),require('./api/attachment'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd4'),require(_0x7b9a('0xd5')));_0xf6dae2[_0x7b9a('0x6')]('/api/mail/reports/transfer',require(_0x7b9a('0xd6')));_0xf6dae2['use']('/api/chat/reports/transfer',require(_0x7b9a('0xd7')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xd8'),require(_0x7b9a('0xd9')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xda'),require('./api/openchannelTransferReport'));_0xf6dae2['use'](_0x7b9a('0xdb'),require(_0x7b9a('0xdc')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xdd'),require('./api/cmList'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xde'),require(_0x7b9a('0xdf')));_0xf6dae2['use'](_0x7b9a('0xe0'),require(_0x7b9a('0xe1')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe2'),require(_0x7b9a('0xe3')));_0xf6dae2['use'](_0x7b9a('0xe4'),require(_0x7b9a('0xe5')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe6'),require(_0x7b9a('0xe7')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe8'),require('./api/whatsappAccount'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xe9'),require(_0x7b9a('0xea')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xeb'),require(_0x7b9a('0xec')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xed'),require('./api/whatsappMessage'));_0xf6dae2[_0x7b9a('0x6')]('/api/whatsapp/reports/queue',require(_0x7b9a('0xee')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xef'),require(_0x7b9a('0xf0')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf1'),require(_0x7b9a('0xf2')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf3'),require('./api/cloudProvider'));_0xf6dae2[_0x7b9a('0x6')]('/api/auth/local',require(_0x7b9a('0xf4')));_0xf6dae2['use'](_0x7b9a('0xf5'),require(_0x7b9a('0xf6')));_0xf6dae2[_0x7b9a('0x6')]('/api/jira',require('./api/jira'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf7'),require('./api/rpc'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xf8'),require(_0x7b9a('0xf9')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xfa'),require(_0x7b9a('0xfb')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xfc'),require(_0x7b9a('0xfd')));_0xf6dae2['use'](_0x7b9a('0xfe'),require('./api/webbar'));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0xff'),express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],'/apidoc')));_0xf6dae2[_0x7b9a('0x6')]('/www',express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],'/www')));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x103'),express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],_0x7b9a('0x103'))));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x104'),express[_0x7b9a('0x100')](path[_0x7b9a('0x101')](config[_0x7b9a('0x102')],_0x7b9a('0x105'),_0x7b9a('0x106'))));_0xf6dae2[_0x7b9a('0x6')](_0x7b9a('0x107'),express[_0x7b9a('0x100')](path['join'](config[_0x7b9a('0x102')],_0x7b9a('0x108'))));_0xf6dae2[_0x7b9a('0x109')](_0x7b9a('0x10a'))[_0x7b9a('0x10b')](errors[0x194]);_0xf6dae2[_0x7b9a('0x109')]('/*')[_0x7b9a('0x10b')](function(_0x2c3a1d,_0x145e1d){_0x145e1d['sendFile'](path[_0x7b9a('0x10c')](_0xf6dae2[_0x7b9a('0x10b')](_0x7b9a('0x10d'))+'/index.html'));});};var sensitiveFields=['username',_0x7b9a('0x10e'),_0x7b9a('0x10f'),_0x7b9a('0x110'),_0x7b9a('0x111'),_0x7b9a('0x112'),_0x7b9a('0x113'),_0x7b9a('0x114'),_0x7b9a('0x115'),'fax',_0x7b9a('0x116'),_0x7b9a('0x117'),_0x7b9a('0x118'),_0x7b9a('0x119'),_0x7b9a('0x11a'),_0x7b9a('0x11b'),_0x7b9a('0x11c'),_0x7b9a('0x11d'),'channelSecret',_0x7b9a('0x11e'),_0x7b9a('0x11f'),_0x7b9a('0x120'),_0x7b9a('0x121'),_0x7b9a('0x122'),_0x7b9a('0x123'),_0x7b9a('0x124'),'calleridnum',_0x7b9a('0x125'),'vidaooApiKey',_0x7b9a('0x126'),_0x7b9a('0x127'),_0x7b9a('0x128'),_0x7b9a('0x129'),'key',_0x7b9a('0x11'),'pass','accountSid','localstationid','dsn',_0x7b9a('0x12a'),_0x7b9a('0x12b'),_0x7b9a('0x12c')];function maskSensitiveData(_0x56ed34){var _0x19ac27=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x56ed34))return;for(var _0xc16a7a in _0x56ed34){if(_[_0x7b9a('0x12d')](_0x56ed34[_0xc16a7a])){for(var _0x419943=0x0;_0x419943<_0x56ed34[_0xc16a7a][_0x7b9a('0x12e')];_0x419943++){maskSensitiveData(_0x56ed34[_0xc16a7a][_0x419943]);}}else if(_['isPlainObject'](_0x56ed34[_0xc16a7a])){maskSensitiveData(_0x56ed34[_0xc16a7a]);}else if(_['isString'](_0x56ed34[_0xc16a7a])){_0x56ed34[_0xc16a7a]=_0x56ed34[_0xc16a7a]['replace'](/{{{/g,_0x7b9a('0x12f'))[_0x7b9a('0x130')](/}}}/g,_0x7b9a('0x131'))[_0x7b9a('0x130')](/{{/g,'@{')[_0x7b9a('0x130')](/}}/g,'}@');if(_[_0x7b9a('0x132')](sensitiveFields,_0xc16a7a)){_0x56ed34[_0xc16a7a]=_0x56ed34[_0xc16a7a][_0x7b9a('0x130')](_0x19ac27,'*');}}}}
\ No newline at end of file
index a121e1e..03b7b41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9e=['../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../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/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','localhost','error','listen','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc'];(function(_0x4cee2a,_0x219eee){var _0x32e6b4=function(_0x1ae865){while(--_0x1ae865){_0x4cee2a['push'](_0x4cee2a['shift']());}};_0x32e6b4(++_0x219eee);}(_0x1c9e,0xcf));var _0xe1c9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1c9e[_0x2641f9];return _0x585741;};'use strict';var jayson=require(_0xe1c9('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xe1c9('0x1'));exports['listen']=function(){return new BPromise(function(_0x4f17f3,_0x463e30){var _0x16b5df={};_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/user/user.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x3')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x4')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x5')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x6')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x7')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x8')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x9')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0xa')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/trunk/trunk.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0xb')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0xc')));_0x16b5df=_['merge'](_0x16b5df,require('../api/mailServerIn/mailServerIn.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0xd')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0xe')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0xf')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/mailMessage/mailMessage.rpc'));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x10')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x11')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/faxAccount/faxAccount.rpc'));_0x16b5df=_['merge'](_0x16b5df,require('../api/faxApplication/faxApplication.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/faxInteraction/faxInteraction.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/faxMessage/faxMessage.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x12')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x13')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x14')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x15')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/smsMessage/smsMessage.rpc'));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x16')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x17')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x18')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x19')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x1a')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x1b')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x1c')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x1d')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x1e')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x1f')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x20')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x21')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x22')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x23')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x24')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x25')));_0x16b5df=_['merge'](_0x16b5df,require('../api/pause/pause.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x26')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/template/template.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x27')));_0x16b5df=_['merge'](_0x16b5df,require('../api/variable/variable.rpc'));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x28')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x29')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x2a')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x2b')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x2c')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x2d')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x2e')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x2f')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x30')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x31')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x32')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x33')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x34')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x35')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x36')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/squareProject/squareProject.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x37')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x38')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x39')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x3a')));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x3b')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x3c')));_0x16b5df=_[_0xe1c9('0x2')](_0x16b5df,require(_0xe1c9('0x3d')));_0x16b5df=_['merge'](_0x16b5df,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x16b5df=_['merge'](_0x16b5df,require(_0xe1c9('0x3e')));var _0x25f5db=jayson['server'](_0x16b5df)['http']();var _0x1809f5=config[_0xe1c9('0x3f')][_0xe1c9('0x40')]||config[_0xe1c9('0x40')]+0x1;var _0x1ab94a=config[_0xe1c9('0x3f')]['ip']||_0xe1c9('0x41');_0x25f5db['on'](_0xe1c9('0x42'),function(_0x1b379f){return _0x463e30(_0x1b379f);});_0x25f5db[_0xe1c9('0x43')](_0x1809f5,_0x1ab94a,function(){console[_0xe1c9('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1ab94a,_0x1809f5);require(_0xe1c9('0x45'))[_0xe1c9('0x46')]();return _0x4f17f3(_0xe1c9('0x47')+_0x1ab94a+':'+_0x1809f5);});});};
\ No newline at end of file
+var _0xa624=['../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.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/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa624,0xb0));var _0x4a62=function(_0x487ab4,_0x1e24e8){_0x487ab4=_0x487ab4-0x0;var _0x3bef77=_0xa624[_0x487ab4];return _0x3bef77;};'use strict';var jayson=require(_0x4a62('0x0'));var BPromise=require(_0x4a62('0x1'));var _=require(_0x4a62('0x2'));var config=require(_0x4a62('0x3'));exports[_0x4a62('0x4')]=function(){return new BPromise(function(_0x518ef1,_0x29957d){var _0x5ef583={};_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x6')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x7')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x8')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/voiceRecording/voiceRecording.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x9')));_0x5ef583=_['merge'](_0x5ef583,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xa')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0xb')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xc')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xd')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xe')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0xf')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x10')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x11')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x12')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x13')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x14')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x15')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/faxAccount/faxAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x16')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/faxInteraction/faxInteraction.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x17')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x18')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x19')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x1a')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x1b')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x1c')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x1d')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x1e')));_0x5ef583=_['merge'](_0x5ef583,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x1f')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x20')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x21')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/chatMessage/chatMessage.rpc'));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x22')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x23')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x24')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x25')));_0x5ef583=_['merge'](_0x5ef583,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x26')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x27')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x28')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x29')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2a')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2b')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2c')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x2d')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x2e')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x2f')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5ef583=_['merge'](_0x5ef583,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x30')));_0x5ef583=_['merge'](_0x5ef583,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x31')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x32')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x33')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/squareReport/squareReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x34')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/setting/setting.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x35')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x36')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x37')));_0x5ef583=_['merge'](_0x5ef583,require(_0x4a62('0x38')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/campaign/campaign.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x39')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x3a')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x3b')));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require(_0x4a62('0x3c')));_0x5ef583=_['merge'](_0x5ef583,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x5ef583=_['merge'](_0x5ef583,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x5ef583=_[_0x4a62('0x5')](_0x5ef583,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x361ab8=jayson[_0x4a62('0x3d')](_0x5ef583)['http']();var _0xd36c16=config[_0x4a62('0x3e')][_0x4a62('0x3f')]||config[_0x4a62('0x3f')]+0x1;var _0x171dda=config[_0x4a62('0x3e')]['ip']||'localhost';_0x361ab8['on'](_0x4a62('0x40'),function(_0x350334){return _0x29957d(_0x350334);});_0x361ab8['listen'](_0xd36c16,_0x171dda,function(){console[_0x4a62('0x41')](_0x4a62('0x42'),_0x171dda,_0xd36c16);require(_0x4a62('0x43'))['default']();return _0x518ef1(_0x4a62('0x44')+_0x171dda+':'+_0xd36c16);});});};
\ No newline at end of file
index 7573e95..ab03328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf081=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','setTimeout','headers','emit','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s'];(function(_0x3c0084,_0x4fbb3d){var _0x43236e=function(_0x113973){while(--_0x113973){_0x3c0084['push'](_0x3c0084['shift']());}};_0x43236e(++_0x4fbb3d);}(_0xf081,0x130));var _0x1f08=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xf081[_0x3e44fa];return _0x2a0aba;};'use strict';var util=require(_0x1f08('0x0'));var _=require(_0x1f08('0x1'));var EventEmitter=require(_0x1f08('0x2'))[_0x1f08('0x3')];var AGIReply=require(_0x1f08('0x4'));var AGIError=require(_0x1f08('0x5'));function AGIChannel(_0xaf19a9){var _0x53ac09=this,_0x30908e=new AGIReply(),_0x19e3fc=![],_0x2a0b7b={};EventEmitter[_0x1f08('0x6')](_0x53ac09);_0xaf19a9[_0x1f08('0x7')]('utf8');_0xaf19a9[_0x1f08('0x8')](0x8*0x3c*0x3c*0x3e8);_0x30908e['setEncoding']('utf8');_0x30908e['on'](_0x1f08('0x9'),function(_0xa9b9ef){for(var _0x42fa6b in _0xa9b9ef){_0x53ac09[_0x42fa6b]=_0xa9b9ef[_0x42fa6b];}_0x53ac09[_0x1f08('0xa')]('ready');});_0x30908e['on'](_0x1f08('0xb'),function(_0x19ffe6){if(_0x19ffe6[_0x1f08('0xc')]()==_0x1f08('0xd')){_0x53ac09['emit']('hangup');return;}if(_0x19ffe6['substring'](0x0,0xb)==_0x1f08('0xe')){_0x19e3fc=!![];}if(_0x19e3fc){_0x2a0b7b['rx']+=_0x19ffe6+'\x0a';if(_0x19ffe6[_0x1f08('0xf')](_0x1f08('0x10'))!=-0x1){_0x19e3fc=![];}}else{_0x2a0b7b['rx']=_0x19ffe6;}if(_0x19e3fc){return;}if(typeof _0x2a0b7b['cb']==_0x1f08('0x11')){var _0x1cc96f=_0x2a0b7b['rx'][_0x1f08('0x12')](0x0,0x3),_0x8f031b=null,_0x5f166d=null;_0x1cc96f=parseInt(_0x1cc96f);if(isNaN(_0x1cc96f)){_0x2a0b7b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1f08('0x13')});return;}if(_0x1cc96f!=0xc8){_0x2a0b7b['cb'](null,{'code':_0x1cc96f,'result':-0x1,'extra':'KO'});return;}_0x8f031b=_0x2a0b7b['rx'][_0x1f08('0x12')](0x4)[_0x1f08('0x14')](_0x1f08('0x15'),'');if(_0x8f031b['indexOf']('\x20')!=-0x1){_0x8f031b=_0x8f031b['substr'](0x0,_0x8f031b[_0x1f08('0x16')]('\x20'));}if(_[_0x1f08('0x17')](_0x8f031b,'-1')){_0x8f031b=parseInt(_0x8f031b);}_0x5f166d=_0x2a0b7b['rx'][_0x1f08('0x18')]('\x20');if(_0x5f166d['length']==0x3){_0x5f166d=_0x5f166d[0x2][_0x1f08('0x12')](0x1,_0x5f166d[0x2][_0x1f08('0x19')]-0x1);}else if(_0x5f166d['length']>0x3){var _0x31733e=/\((.+)\)/;var _0x39695b=_0x2a0b7b['rx'][_0x1f08('0x1a')](_0x31733e);if(_0x39695b){_0x5f166d=_0x39695b[0x1];}else{_0x5f166d=null;}}else{_0x5f166d=null;}_0x2a0b7b['cb'](null,{'code':_0x1cc96f,'result':_0x8f031b,'extra':_0x5f166d});}});_0xaf19a9['on']('error',function(_0x5ed48b){_0x53ac09[_0x1f08('0xa')](_0x1f08('0x1b'),new AGIError(_0x1f08('0x1c'),_0x5ed48b[_0x1f08('0x1d')]));});_0xaf19a9['on'](_0x1f08('0x1e'),function(){_0x53ac09[_0x1f08('0xa')](_0x1f08('0x1e'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0xaf19a9['on'](_0x1f08('0x1f'),function(){_0x53ac09[_0x1f08('0xa')]('timeout',new AGIError(_0x1f08('0x20')));_0xaf19a9[_0x1f08('0x21')]();});_0xaf19a9[_0x1f08('0x22')](_0x30908e);this[_0x1f08('0x23')]=function(_0x83726e,_0xa7889d){var _0x83726e=_0x83726e||'',_0xa7889d=typeof _0xa7889d==_0x1f08('0x11')?_0xa7889d:new Function();_0x2a0b7b={'tx':_0x83726e,'rx':'','cb':_0xa7889d};_0xaf19a9[_0x1f08('0x24')](_0x83726e+'\x0a');},this['close']=function(){_0xaf19a9[_0x1f08('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1f08('0x25')]['sendRequest']=function(_0x190c98){return this['command'][_0x1f08('0x26')](this,_0x190c98);};AGIChannel[_0x1f08('0x25')][_0x1f08('0x27')]=function(){return this[_0x1f08('0x28')](_0x1f08('0x29'));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x2a')]=function(_0xa8f796,_0x9df199,_0x3e8998){_0xa8f796=_0xa8f796===undefined?_0x1f08('0x2b'):_0xa8f796;_0x9df199=_0x9df199===undefined?'5':_0x9df199;_0x3e8998=_0x3e8998===undefined?'1':_0x3e8998;return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x2d'),_0xa8f796,_0x9df199*0x3e8,_0x3e8998));};AGIChannel['prototype'][_0x1f08('0x2e')]=function(_0x423b1b){_0x423b1b=_0x423b1b||_0x1f08('0x2f');return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x30'),_0x423b1b));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x31')]=function(_0x4972ad,_0x2191da){if(_[_0x1f08('0x32')](_0x2191da)){return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x33'),_0x4972ad,_0x2191da[_0x1f08('0x34')](',')));}return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x33'),_0x4972ad,_0x2191da));};AGIChannel['prototype'][_0x1f08('0x35')]=function(_0x4d8bf9){return this['sendRequest'](util[_0x1f08('0x2c')](_0x1f08('0x36'),_0x4d8bf9));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x37')]=function(_0x278435){return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x38'),_0x278435));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x39')]=function(_0x409bd6){return this[_0x1f08('0x28')](util[_0x1f08('0x2c')]('SET\x20PRIORITY\x20%s',_0x409bd6));};AGIChannel['prototype'][_0x1f08('0xd')]=function(){return this[_0x1f08('0x28')](_0x1f08('0x3a'));};AGIChannel[_0x1f08('0x25')]['setVariable']=function(_0x5493cd,_0x38b8c8){var _0x503476=_['isBoolean'](_0x38b8c8)||_[_0x1f08('0x3b')](_0x38b8c8)?_0x38b8c8[_0x1f08('0x3c')]():_0x38b8c8;return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x3d'),_0x5493cd,_0x503476?_0x503476[_0x1f08('0x3c')]()[_0x1f08('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x3e')]=function(_0x57c273,_0x5432ca){return this[_0x1f08('0x28')](util[_0x1f08('0x2c')]('SAY\x20NUMBER\x20%s\x20%s',_0x57c273,_0x5432ca));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x3f')]=function(_0x54b9a1,_0x234d89){return this[_0x1f08('0x28')](util[_0x1f08('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x54b9a1,_0x234d89));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x40')]=function(_0x1a85af,_0x2f0b09){return this['sendRequest'](util[_0x1f08('0x2c')](_0x1f08('0x41'),_0x1a85af,_0x2f0b09));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x42')]=function(_0x3abe20,_0x50f66f,_0x3bded5){_0x50f66f=_0x50f66f||this['extension'];_0x3bded5=_0x3bded5||0x1;this[_0x1f08('0x35')](_0x3abe20);this[_0x1f08('0x37')](_0x50f66f);this[_0x1f08('0x39')](_0x3bded5);return this[_0x1f08('0x2e')](util['format'](_0x1f08('0x43'),_0x3abe20,_0x50f66f,_0x3bded5));};AGIChannel[_0x1f08('0x25')]['getVariable']=function(_0x4bf971){return this['sendRequest'](util[_0x1f08('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4bf971));};AGIChannel[_0x1f08('0x25')][_0x1f08('0x44')]=function(_0x27ba8d,_0x2ae6a2,_0x2e70a3,_0x389d74,_0x10ff75,_0x6caf6c){_0x2ae6a2=_0x2ae6a2||'wav';_0x2e70a3=_0x2e70a3||'';_0x389d74=_0x389d74===undefined?-0x1:_0x389d74==='-1'?-0x1:_0x389d74*0x3e8;_0x10ff75=_0x10ff75===undefined?'':'s='+_0x10ff75;_0x6caf6c=_0x6caf6c?_0x1f08('0x45'):'';return this[_0x1f08('0x28')](util['format'](_0x1f08('0x46'),_0x27ba8d,_0x2ae6a2,_0x2e70a3,_0x389d74,_0x6caf6c,_0x10ff75));};AGIChannel[_0x1f08('0x25')]['streamFile']=function(_0x467d6e,_0x3db8cb){_0x3db8cb=_0x3db8cb||'';return this[_0x1f08('0x28')](util[_0x1f08('0x2c')](_0x1f08('0x47'),_0x467d6e,_0x3db8cb));};AGIChannel[_0x1f08('0x25')]['agi']=function(_0x415ab2){return this['exec'](_0x1f08('0x48'),_0x415ab2);};AGIChannel[_0x1f08('0x25')][_0x1f08('0x49')]=function(_0x42f7aa){return this['exec']('WAIT',_0x42f7aa);};AGIChannel[_0x1f08('0x25')][_0x1f08('0x1b')]=function(_0x5b5554,_0x5b5357){this['noop'](util[_0x1f08('0x2c')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x5b5554['id'],_0x5b5554[_0x1f08('0x4a')],_0x5b5357));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0xe6e4=['search','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','isArray','join','EXEC\x20%s\x20%s','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\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xe6e4,0x139));var _0x4e6e=function(_0x2fc284,_0x5d271c){_0x2fc284=_0x2fc284-0x0;var _0x221234=_0xe6e4[_0x2fc284];return _0x221234;};'use strict';var util=require(_0x4e6e('0x0'));var _=require(_0x4e6e('0x1'));var EventEmitter=require('events')[_0x4e6e('0x2')];var AGIReply=require(_0x4e6e('0x3'));var AGIError=require(_0x4e6e('0x4'));function AGIChannel(_0x57de71){var _0x4346cc=this,_0x280be0=new AGIReply(),_0x44cd95=![],_0x28220a={};EventEmitter['call'](_0x4346cc);_0x57de71[_0x4e6e('0x5')](_0x4e6e('0x6'));_0x57de71[_0x4e6e('0x7')](0x8*0x3c*0x3c*0x3e8);_0x280be0[_0x4e6e('0x5')](_0x4e6e('0x6'));_0x280be0['on'](_0x4e6e('0x8'),function(_0xb81bc2){for(var _0x5debaf in _0xb81bc2){_0x4346cc[_0x5debaf]=_0xb81bc2[_0x5debaf];}_0x4346cc[_0x4e6e('0x9')](_0x4e6e('0xa'));});_0x280be0['on'](_0x4e6e('0xb'),function(_0x5e36ce){if(_0x5e36ce[_0x4e6e('0xc')]()=='hangup'){_0x4346cc[_0x4e6e('0x9')](_0x4e6e('0xd'));return;}if(_0x5e36ce[_0x4e6e('0xe')](0x0,0xb)=='520-Invalid'){_0x44cd95=!![];}if(_0x44cd95){_0x28220a['rx']+=_0x5e36ce+'\x0a';if(_0x5e36ce[_0x4e6e('0xf')](_0x4e6e('0x10'))!=-0x1){_0x44cd95=![];}}else{_0x28220a['rx']=_0x5e36ce;}if(_0x44cd95){return;}if(typeof _0x28220a['cb']==_0x4e6e('0x11')){var _0x2163e8=_0x28220a['rx'][_0x4e6e('0xe')](0x0,0x3),_0x2b1ef8=null,_0xef9381=null;_0x2163e8=parseInt(_0x2163e8);if(isNaN(_0x2163e8)){_0x28220a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2163e8!=0xc8){_0x28220a['cb'](null,{'code':_0x2163e8,'result':-0x1,'extra':'KO'});return;}_0x2b1ef8=_0x28220a['rx']['substring'](0x4)[_0x4e6e('0x12')](_0x4e6e('0x13'),'');if(_0x2b1ef8[_0x4e6e('0x14')]('\x20')!=-0x1){_0x2b1ef8=_0x2b1ef8[_0x4e6e('0x15')](0x0,_0x2b1ef8[_0x4e6e('0x14')]('\x20'));}if(_[_0x4e6e('0x16')](_0x2b1ef8,'-1')){_0x2b1ef8=parseInt(_0x2b1ef8);}_0xef9381=_0x28220a['rx'][_0x4e6e('0x17')]('\x20');if(_0xef9381[_0x4e6e('0x18')]==0x3){_0xef9381=_0xef9381[0x2][_0x4e6e('0xe')](0x1,_0xef9381[0x2][_0x4e6e('0x18')]-0x1);}else if(_0xef9381[_0x4e6e('0x18')]>0x3){var _0x1c6550=/\((.+)\)/;var _0x1c2eba=_0x28220a['rx'][_0x4e6e('0x19')](_0x1c6550);if(_0x1c2eba){_0xef9381=_0x1c2eba[0x1];}else{_0xef9381=null;}}else{_0xef9381=null;}_0x28220a['cb'](null,{'code':_0x2163e8,'result':_0x2b1ef8,'extra':_0xef9381});}});_0x57de71['on'](_0x4e6e('0x1a'),function(_0x4924e9){_0x4346cc['emit'](_0x4e6e('0x1a'),new AGIError(_0x4e6e('0x1b'),_0x4924e9['code']));});_0x57de71['on'](_0x4e6e('0x1c'),function(){_0x4346cc['emit'](_0x4e6e('0x1c'),new AGIError(_0x4e6e('0x1d')));});_0x57de71['on'](_0x4e6e('0x1e'),function(){_0x4346cc['emit']('timeout',new AGIError(_0x4e6e('0x1f')));_0x57de71[_0x4e6e('0x20')]();});_0x57de71[_0x4e6e('0x21')](_0x280be0);this[_0x4e6e('0x22')]=function(_0x8d3c32,_0x5860a2){var _0x8d3c32=_0x8d3c32||'',_0x5860a2=typeof _0x5860a2==_0x4e6e('0x11')?_0x5860a2:new Function();_0x28220a={'tx':_0x8d3c32,'rx':'','cb':_0x5860a2};_0x57de71[_0x4e6e('0x23')](_0x8d3c32+'\x0a');},this[_0x4e6e('0x1c')]=function(){_0x57de71[_0x4e6e('0x20')]();};}util[_0x4e6e('0x24')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x4e6e('0x25')]=function(_0x1ad7ca){return this[_0x4e6e('0x22')][_0x4e6e('0x26')](this,_0x1ad7ca);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x28')]=function(){return this[_0x4e6e('0x25')](_0x4e6e('0x29'));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x2a')]=function(_0x334bac,_0x1eab17,_0x949807){_0x334bac=_0x334bac===undefined?_0x4e6e('0x2b'):_0x334bac;_0x1eab17=_0x1eab17===undefined?'5':_0x1eab17;_0x949807=_0x949807===undefined?'1':_0x949807;return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x2d'),_0x334bac,_0x1eab17*0x3e8,_0x949807));};AGIChannel[_0x4e6e('0x27')]['noop']=function(_0x598bb6){_0x598bb6=_0x598bb6||_0x4e6e('0x2e');return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')]('VERBOSE\x20\x22%s\x22',_0x598bb6));};AGIChannel['prototype']['exec']=function(_0x2c2472,_0x25da20){if(_[_0x4e6e('0x2f')](_0x25da20)){return this['sendRequest'](util[_0x4e6e('0x2c')]('EXEC\x20%s\x20%s',_0x2c2472,_0x25da20[_0x4e6e('0x30')](',')));}return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x31'),_0x2c2472,_0x25da20));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x32')]=function(_0x4c4d91){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x33'),_0x4c4d91));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x34')]=function(_0x1ddf55){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x35'),_0x1ddf55));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x36')]=function(_0x233327){return this['sendRequest'](util[_0x4e6e('0x2c')](_0x4e6e('0x37'),_0x233327));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0xd')]=function(){return this[_0x4e6e('0x25')](_0x4e6e('0x38'));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x39')]=function(_0x27b4a9,_0x1418a3){var _0x5c51f4=_[_0x4e6e('0x3a')](_0x1418a3)||_[_0x4e6e('0x3b')](_0x1418a3)?_0x1418a3['toString']():_0x1418a3;return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x3c'),_0x27b4a9,_0x5c51f4?_0x5c51f4[_0x4e6e('0x3d')]()[_0x4e6e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x3e')]=function(_0x128668,_0x4a9409){return this[_0x4e6e('0x25')](util['format'](_0x4e6e('0x3f'),_0x128668,_0x4a9409));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x40')]=function(_0x46ce64,_0x2ba26c){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x46ce64,_0x2ba26c));};AGIChannel[_0x4e6e('0x27')]['sayPhonetic']=function(_0x19281a,_0x176480){return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x41'),_0x19281a,_0x176480));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x42')]=function(_0x365c15,_0x13742a,_0x3b94dc){_0x13742a=_0x13742a||this['extension'];_0x3b94dc=_0x3b94dc||0x1;this[_0x4e6e('0x32')](_0x365c15);this[_0x4e6e('0x34')](_0x13742a);this[_0x4e6e('0x36')](_0x3b94dc);return this[_0x4e6e('0x43')](util['format'](_0x4e6e('0x44'),_0x365c15,_0x13742a,_0x3b94dc));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x45')]=function(_0x37b306){return this[_0x4e6e('0x25')](util['format'](_0x4e6e('0x46'),_0x37b306));};AGIChannel[_0x4e6e('0x27')]['recordFile']=function(_0x34aa39,_0x2c44dd,_0x577e5c,_0x1132be,_0x37f045,_0x13f453){_0x2c44dd=_0x2c44dd||_0x4e6e('0x47');_0x577e5c=_0x577e5c||'';_0x1132be=_0x1132be===undefined?-0x1:_0x1132be==='-1'?-0x1:_0x1132be*0x3e8;_0x37f045=_0x37f045===undefined?'':'s='+_0x37f045;_0x13f453=_0x13f453?'BEEP':'';return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x48'),_0x34aa39,_0x2c44dd,_0x577e5c,_0x1132be,_0x13f453,_0x37f045));};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x49')]=function(_0x5d1582,_0x1ddd6e){_0x1ddd6e=_0x1ddd6e||'';return this[_0x4e6e('0x25')](util[_0x4e6e('0x2c')](_0x4e6e('0x4a'),_0x5d1582,_0x1ddd6e));};AGIChannel['prototype'][_0x4e6e('0x4b')]=function(_0x4f1442){return this['exec'](_0x4e6e('0x4c'),_0x4f1442);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x4d')]=function(_0x12c1b3){return this[_0x4e6e('0x4e')]('WAIT',_0x12c1b3);};AGIChannel[_0x4e6e('0x27')][_0x4e6e('0x1a')]=function(_0x43973b,_0x4379b7){this[_0x4e6e('0x43')](util['format'](_0x4e6e('0x4f'),_0x43973b['id'],_0x43973b[_0x4e6e('0x50')],_0x4379b7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4e6e('0x51')]=AGIChannel;
\ No newline at end of file
index 87723f9..4b29b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x226a=['name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','message'];(function(_0x37cecf,_0x2e09a7){var _0x4006e9=function(_0x3692ed){while(--_0x3692ed){_0x37cecf['push'](_0x37cecf['shift']());}};_0x4006e9(++_0x2e09a7);}(_0x226a,0x1f0));var _0xa226=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0x226a[_0xcf581b];return _0x4f454d;};'use strict';var util=require(_0xa226('0x0'));var error={'E_AGI_UNDEFINED':_0xa226('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xa226('0x2'),'E_AGI_SERVER_CLOSE':_0xa226('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa226('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa226('0x5'),'E_AGI_SOCKET_CLOSE':_0xa226('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xa226('0x7'),'E_AGI_COMMAND_EMPTY':_0xa226('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa226('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0xde5499){var _0xde5499=_0xde5499||null,_0x449930=_0x449930||[],_0x4cb5e8=0x1,_0x1b9974='';if(!error[_0xde5499]){_0xde5499=_0xa226('0xa');}_0x449930[_0xa226('0xb')](error[_0xde5499]);while(arguments[_0x4cb5e8]){_0x449930[_0xa226('0xb')](arguments[_0x4cb5e8]);_0x4cb5e8++;}_0x1b9974=util[_0xa226('0xc')]['apply'](util,_0x449930);this[_0xa226('0xd')]=_0x1b9974;this[_0xa226('0xe')]=_0xde5499;}module['exports']=AGIError;
\ No newline at end of file
+var _0x4f89=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply'];(function(_0x584717,_0x7ca91c){var _0x56543d=function(_0x597a82){while(--_0x597a82){_0x584717['push'](_0x584717['shift']());}};_0x56543d(++_0x7ca91c);}(_0x4f89,0x16a));var _0x94f8=function(_0xe3b7d9,_0x47565c){_0xe3b7d9=_0xe3b7d9-0x0;var _0x5c4510=_0x4f89[_0xe3b7d9];return _0x5c4510;};'use strict';var util=require(_0x94f8('0x0'));var error={'E_AGI_UNDEFINED':_0x94f8('0x1'),'E_AGI_ARGUMENT_PORT':_0x94f8('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x94f8('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x94f8('0x4'),'E_AGI_SOCKET_ERROR':_0x94f8('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x94f8('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x94f8('0x7'),'E_AGI_IVR_ENTRY':_0x94f8('0x8')};function AGIError(_0x4ce20a){var _0x4ce20a=_0x4ce20a||null,_0x4ab1ea=_0x4ab1ea||[],_0x3343c0=0x1,_0x2aceb9='';if(!error[_0x4ce20a]){_0x4ce20a=_0x94f8('0x9');}_0x4ab1ea['push'](error[_0x4ce20a]);while(arguments[_0x3343c0]){_0x4ab1ea[_0x94f8('0xa')](arguments[_0x3343c0]);_0x3343c0++;}_0x2aceb9=util[_0x94f8('0xb')][_0x94f8('0xc')](util,_0x4ab1ea);this['message']=_0x2aceb9;this[_0x94f8('0xd')]=_0x4ce20a;}module[_0x94f8('0xe')]=AGIError;
\ No newline at end of file
index a1e1e58..df7ab97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7903=['info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','default','target','invalid','vswitch','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','vertices','numberOfEdges','addVertex','edges','prototype','addEdge','size','relations','traverseBFS'];(function(_0x1dc054,_0x13bdbb){var _0x135f92=function(_0xb5bcac){while(--_0xb5bcac){_0x1dc054['push'](_0x1dc054['shift']());}};_0x135f92(++_0x13bdbb);}(_0x7903,0xbe));var _0x3790=function(_0x234211,_0x4cf411){_0x234211=_0x234211-0x0;var _0x7d24a8=_0x7903[_0x234211];return _0x7d24a8;};'use strict';var _=require(_0x3790('0x0'));var logger=require(_0x3790('0x1'))('agi');var verticesWithRetry=[_0x3790('0x2'),_0x3790('0x3'),'getsecretdigits'];var Graph=function(){this[_0x3790('0x4')]={};this['edges']={};this[_0x3790('0x5')]=0x0;};Graph['prototype'][_0x3790('0x6')]=function(_0x4dbda9){this[_0x3790('0x4')][_0x4dbda9['id']]=_0x4dbda9;this[_0x3790('0x7')][_0x4dbda9['id']]=[];};Graph[_0x3790('0x8')][_0x3790('0x9')]=function(_0x2823b3,_0x5ea48c,_0x1676f9){this[_0x3790('0x7')][_0x2823b3]['push']({'target':_0x5ea48c,'condition':_0x1676f9});this[_0x3790('0x5')]+=0x1;};Graph[_0x3790('0x8')][_0x3790('0xa')]=function(){return _[_0x3790('0xa')](this[_0x3790('0x4')]);};Graph[_0x3790('0x8')][_0x3790('0xb')]=function(){return this[_0x3790('0x5')];};Graph[_0x3790('0x8')]['getVertex']=function(_0xf6b2d3){return this[_0x3790('0x4')][_0xf6b2d3];};Graph[_0x3790('0x8')][_0x3790('0xc')]=function(_0x1abf2a,_0x4ff412){if(!this['vertices'][_0x1abf2a]){return logger[_0x3790('0xd')]('no\x20vertex\x20found');}var _0x5921cc=_0x4ff412(this[_0x3790('0x4')][_0x1abf2a]);if(!_0x5921cc){return logger[_0x3790('0xd')](_0x3790('0xe'));}if(this[_0x3790('0x7')][_0x1abf2a][_0x3790('0xf')]===0x0){return logger['info'](_0x3790('0x10'));}for(var _0x5bb202=0x0,_0x22af5f=[],_0x4f0a57=![];_0x5bb202<this[_0x3790('0x7')][_0x1abf2a][_0x3790('0xf')];_0x5bb202+=0x1){if(this[_0x3790('0x7')][_0x1abf2a][_0x5bb202]['condition']){_0x22af5f=this[_0x3790('0x7')][_0x1abf2a][_0x5bb202][_0x3790('0x11')][_0x3790('0x12')](',');for(var _0x556409=0x0;_0x556409<_0x22af5f[_0x3790('0xf')];_0x556409+=0x1){if(this[_0x3790('0x4')][_0x1abf2a][_0x3790('0x13')]==='vswitch'&&_0x22af5f[_0x556409]==='-'){_0x4f0a57=this[_0x3790('0x7')][_0x1abf2a][_0x5bb202]['target'];logger[_0x3790('0xd')](_0x3790('0x14'),_0x22af5f[_0x556409],this['edges'][_0x1abf2a][_0x5bb202]['target']);}else if(this['vertices'][_0x1abf2a][_0x3790('0x13')]===_0x3790('0x2')&&_0x22af5f[_0x556409]==='i'){_0x4f0a57=this[_0x3790('0x7')][_0x1abf2a][_0x5bb202][_0x3790('0x15')];logger['info'](_0x3790('0x16'),_0x22af5f[_0x556409],this[_0x3790('0x7')][_0x1abf2a][_0x5bb202][_0x3790('0x15')]);}if(_0x22af5f[_0x556409]===_0x5921cc){return this[_0x3790('0xc')](this[_0x3790('0x7')][_0x1abf2a][_0x5bb202][_0x3790('0x15')],_0x4ff412);}}}else{return this['traverseBFS'](this['edges'][_0x1abf2a][_0x5bb202]['target'],_0x4ff412);}}if(_0x22af5f[_0x3790('0xf')]){if(this[_0x3790('0x4')][_0x1abf2a]['agicommand']===_0x3790('0x17')){if(_0x4f0a57){return this[_0x3790('0xc')](_0x4f0a57,_0x4ff412);}return logger['info'](_0x3790('0x18'));}else if(_[_0x3790('0x19')](verticesWithRetry,this[_0x3790('0x4')][_0x1abf2a][_0x3790('0x13')])){if(_0x5921cc==='-'){return logger[_0x3790('0xd')](_0x3790('0x1a'));}if(_0x4f0a57&&_0x5921cc!=='t'){return this['traverseBFS'](_0x4f0a57,_0x4ff412);}return this['traverseBFS'](_0x1abf2a,_0x4ff412);}return logger[_0x3790('0xd')](_0x3790('0x1b'));}};module[_0x3790('0x1c')]=Graph;
\ No newline at end of file
+var _0x6049=['vertices','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','no\x20edge/s\x20available','length','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','../../../config/logger','agi','menu','getdigits','edges','numberOfEdges','prototype','addVertex'];(function(_0x3b92eb,_0x129861){var _0x3de885=function(_0x3f0bb2){while(--_0x3f0bb2){_0x3b92eb['push'](_0x3b92eb['shift']());}};_0x3de885(++_0x129861);}(_0x6049,0x180));var _0x9604=function(_0x17c0f3,_0x40323d){_0x17c0f3=_0x17c0f3-0x0;var _0x43078c=_0x6049[_0x17c0f3];return _0x43078c;};'use strict';var _=require('lodash');var logger=require(_0x9604('0x0'))(_0x9604('0x1'));var verticesWithRetry=[_0x9604('0x2'),_0x9604('0x3'),'getsecretdigits'];var Graph=function(){this['vertices']={};this[_0x9604('0x4')]={};this[_0x9604('0x5')]=0x0;};Graph[_0x9604('0x6')][_0x9604('0x7')]=function(_0x44ace6){this[_0x9604('0x8')][_0x44ace6['id']]=_0x44ace6;this[_0x9604('0x4')][_0x44ace6['id']]=[];};Graph[_0x9604('0x6')][_0x9604('0x9')]=function(_0x1f122d,_0x5a8a63,_0x48afae){this['edges'][_0x1f122d][_0x9604('0xa')]({'target':_0x5a8a63,'condition':_0x48afae});this[_0x9604('0x5')]+=0x1;};Graph[_0x9604('0x6')][_0x9604('0xb')]=function(){return _[_0x9604('0xb')](this[_0x9604('0x8')]);};Graph[_0x9604('0x6')][_0x9604('0xc')]=function(){return this['numberOfEdges'];};Graph[_0x9604('0x6')][_0x9604('0xd')]=function(_0x269d62){return this['vertices'][_0x269d62];};Graph['prototype'][_0x9604('0xe')]=function(_0x3a32a4,_0x196876){if(!this[_0x9604('0x8')][_0x3a32a4]){return logger['info'](_0x9604('0xf'));}var _0x4f2028=_0x196876(this['vertices'][_0x3a32a4]);if(!_0x4f2028){return logger[_0x9604('0x10')](_0x9604('0x11'));}if(this['edges'][_0x3a32a4]['length']===0x0){return logger[_0x9604('0x10')](_0x9604('0x12'));}for(var _0x5ad563=0x0,_0x26bfb0=[],_0x3c3a52=![];_0x5ad563<this[_0x9604('0x4')][_0x3a32a4][_0x9604('0x13')];_0x5ad563+=0x1){if(this[_0x9604('0x4')][_0x3a32a4][_0x5ad563]['condition']){_0x26bfb0=this[_0x9604('0x4')][_0x3a32a4][_0x5ad563]['condition'][_0x9604('0x14')](',');for(var _0x8ad7ad=0x0;_0x8ad7ad<_0x26bfb0[_0x9604('0x13')];_0x8ad7ad+=0x1){if(this[_0x9604('0x8')][_0x3a32a4][_0x9604('0x15')]===_0x9604('0x16')&&_0x26bfb0[_0x8ad7ad]==='-'){_0x3c3a52=this[_0x9604('0x4')][_0x3a32a4][_0x5ad563][_0x9604('0x17')];logger[_0x9604('0x10')]('default',_0x26bfb0[_0x8ad7ad],this[_0x9604('0x4')][_0x3a32a4][_0x5ad563][_0x9604('0x17')]);}else if(this[_0x9604('0x8')][_0x3a32a4]['agicommand']===_0x9604('0x2')&&_0x26bfb0[_0x8ad7ad]==='i'){_0x3c3a52=this[_0x9604('0x4')][_0x3a32a4][_0x5ad563][_0x9604('0x17')];logger[_0x9604('0x10')](_0x9604('0x18'),_0x26bfb0[_0x8ad7ad],this[_0x9604('0x4')][_0x3a32a4][_0x5ad563][_0x9604('0x17')]);}if(_0x26bfb0[_0x8ad7ad]===_0x4f2028){return this['traverseBFS'](this[_0x9604('0x4')][_0x3a32a4][_0x5ad563][_0x9604('0x17')],_0x196876);}}}else{return this[_0x9604('0xe')](this[_0x9604('0x4')][_0x3a32a4][_0x5ad563]['target'],_0x196876);}}if(_0x26bfb0[_0x9604('0x13')]){if(this[_0x9604('0x8')][_0x3a32a4][_0x9604('0x15')]===_0x9604('0x16')){if(_0x3c3a52){return this['traverseBFS'](_0x3c3a52,_0x196876);}return logger['info'](_0x9604('0x19'));}else if(_[_0x9604('0x1a')](verticesWithRetry,this[_0x9604('0x8')][_0x3a32a4][_0x9604('0x15')])){if(_0x4f2028==='-'){return logger['info']('max\x20retry\x20reach');}if(_0x3c3a52&&_0x4f2028!=='t'){return this[_0x9604('0xe')](_0x3c3a52,_0x196876);}return this[_0x9604('0xe')](_0x3a32a4,_0x196876);}return logger[_0x9604('0x10')](_0x9604('0x1b'));}};module['exports']=Graph;
\ No newline at end of file
index 38fe617..1e3ceaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1201=['hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','response','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','addEdge','target','getSquareProject','then','catch','createSquareReport','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x1201,0xd3));var _0x1120=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0x1201[_0x369a98];return _0x29565c;};'use strict';var parser=require(_0x1120('0x0'));var _=require('lodash');var syncho=require(_0x1120('0x1'));var util=require(_0x1120('0x2'));var moment=require(_0x1120('0x3'));var config=require(_0x1120('0x4'));var logger=require(_0x1120('0x5'))(_0x1120('0x6'));var utilLicense=require(_0x1120('0x7'));var rpc=require('./rpc');var mailRpc=require(_0x1120('0x8'));var Graph=require(_0x1120('0x9'));var Vertices=require(_0x1120('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x1120('0xb')](config[_0x1120('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x35b7fb){process[_0x1120('0xc')](function(){syncho(function(){try{setChannelVariables(_0x35b7fb);agiHandler(_0x35b7fb);}catch(_0x1b120e){logger[_0x1120('0xd')](_0x1b120e[_0x1120('0xe')]);}});});}function listeningHandler(){console[_0x1120('0xf')](_0x1120('0x10'),config[_0x1120('0x6')][_0x1120('0x11')]);logger[_0x1120('0x12')](util['format'](_0x1120('0x13'),config[_0x1120('0x6')]['ip'],config[_0x1120('0x6')][_0x1120('0x11')]));}function errorHandler(_0x27ade0){if(_0x27ade0&&_0x27ade0[_0x1120('0x14')]&&_0x27ade0[_0x1120('0x15')]){logger[_0x1120('0xd')](util[_0x1120('0x16')](_0x1120('0x17'),_0x27ade0[_0x1120('0x14')],_0x27ade0[_0x1120('0x15')]));}else{logger[_0x1120('0xd')](util[_0x1120('0x16')](_0x1120('0x18'),_0x27ade0[_0x1120('0xe')]));}}function closeHandler(){logger[_0x1120('0x12')](util[_0x1120('0x16')](_0x1120('0x19'),this[_0x1120('0x1a')],this[_0x1120('0x1b')],this[_0x1120('0x1c')],this['dnid'],this[_0x1120('0x1d')]));try{createSquareReport(this);}catch(_0x523889){logger[_0x1120('0xd')](_0x523889['stack']);}}function timeoutHandler(){logger[_0x1120('0x12')](util[_0x1120('0x16')](_0x1120('0x1e'),this[_0x1120('0x1a')],this[_0x1120('0x1b')],this[_0x1120('0x1c')],this[_0x1120('0x1f')],this['uniqueid']));}function hangupHandler(){logger[_0x1120('0x12')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1120('0x1a')],this[_0x1120('0x1b')],this['callerid'],this[_0x1120('0x1f')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x30689c){return parser[_0x1120('0x20')](_0x30689c,{'object':!![]})['mxGraphModel'][_0x1120('0x21')];}function addVertex(_0x436cdc,_0x2abb9e,_0x174eca){_0x2abb9e[_0x1120('0x22')]=_0x174eca;if(_0x2abb9e[_0x1120('0x23')](_0x1120('0x24'))){_0x2abb9e[_0x1120('0x25')]=parseInt(_0x2abb9e[_0x1120('0x24')],0xa);}_0x436cdc[_0x1120('0x26')](_[_0x1120('0x27')](_0x2abb9e,_0x1120('0x28')));}function initGraph(_0x37280a,_0x1b7a1d){var _0x5ce644=new Graph();for(var _0x47faf7 in _0x37280a){if(_0x37280a[_0x1120('0x23')](_0x47faf7)){if(_['isArray'](_0x37280a[_0x47faf7])){for(var _0x4084c5=0x0;_0x4084c5<_0x37280a[_0x47faf7][_0x1120('0x29')];_0x4084c5+=0x1){addVertex(_0x5ce644,_0x37280a[_0x47faf7][_0x4084c5],_0x47faf7);}}else{addVertex(_0x5ce644,_0x37280a[_0x47faf7],_0x47faf7);}}}for(var _0x198b39=0x0;_0x198b39<_0x1b7a1d[_0x1120('0x29')];_0x198b39+=0x1){if(_0x1b7a1d[_0x198b39]['source']&&_0x1b7a1d[_0x198b39]['target']){_0x5ce644[_0x1120('0x2a')](_0x1b7a1d[_0x198b39]['source'],_0x1b7a1d[_0x198b39][_0x1120('0x2b')],_0x1b7a1d[_0x198b39]['value']);}}return _0x5ce644;}function getSquareProject(_0x6fa09f,_0x3866bc){rpc[_0x1120('0x2c')](_0x6fa09f)[_0x1120('0x2d')](function(_0x55fbc1){_0x3866bc(null,_0x55fbc1);})[_0x1120('0x2e')](function(_0x375eb2){_0x3866bc(null,_0x375eb2);});}function createSquareReport(_0x6e482c,_0x434154){rpc[_0x1120('0x2f')](_0x6e482c)[_0x1120('0x2d')](function(_0x31ca1a){if(_0x434154){_0x434154(null,_0x31ca1a);}})['catch'](function(_0x1ea724){if(_0x434154){_0x434154(null,_0x1ea724);}});}function setChannelVariables(_0x1abb6f){for(var _0x42a322 in _0x1abb6f){if(_0x1abb6f['hasOwnProperty'](_0x42a322)){if(_0x42a322['indexOf'](_0x1120('0x30'))===0x0){_0x1abb6f[_0x42a322[_0x1120('0x31')](0x4)]=_0x1abb6f[_0x42a322];delete _0x1abb6f[_0x42a322];}}}}function getLogFromObject(_0x31846c){return util['inspect'](_0x31846c,{'showHidden':![],'depth':null});}function agiHandler(_0xb5e780){var _0x17dfe6,_0x2c2df2,_0x161bcf,_0x532480,_0x5b174b;logger[_0x1120('0x32')](_0x1120('0x33'),JSON[_0x1120('0x34')](_0xb5e780,null,0x2));logger[_0x1120('0x12')](util[_0x1120('0x16')](_0x1120('0x35'),_0xb5e780[_0x1120('0x1a')],_0xb5e780[_0x1120('0x1b')],_0xb5e780[_0x1120('0x1c')],_0xb5e780[_0x1120('0x1f')],_0xb5e780[_0x1120('0x1d')]));_0xb5e780['on']('error',errorHandler);_0xb5e780['on'](_0x1120('0x36'),closeHandler);_0xb5e780['on'](_0x1120('0x37'),timeoutHandler);_0xb5e780['evtHangup']=![];_0xb5e780['on'](_0x1120('0x38'),hangupHandler);var _0xad8d03=getSquareProject[_0x1120('0x39')](null,_0xb5e780['arg_1']);if(_0xad8d03){if(_0xad8d03[_0x1120('0x3a')]){_0x17dfe6=getRoot(_0xad8d03['production']);if(_0x17dfe6&&_0x17dfe6[_0x1120('0x3b')]){logger['debug'](_0x1120('0x21'),JSON[_0x1120('0x34')](_0x17dfe6,null,0x2));_0xb5e780['joinAt']=moment()[_0x1120('0x16')](_0x1120('0x3c'));_0x2c2df2=initGraph(_[_0x1120('0x27')](_0x17dfe6,_0x1120('0x28')),_0x17dfe6['mxCell']);_0x161bcf=new Vertices(_0xb5e780,rpc,mailRpc);logger[_0x1120('0x12')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xb5e780[_0x1120('0x1a')],_0xb5e780[_0x1120('0x1b')],_0xb5e780[_0x1120('0x1c')],_0xb5e780[_0x1120('0x1f')],_0xb5e780[_0x1120('0x1d')]));_0x2c2df2[_0x1120('0x3d')](_0x17dfe6[_0x1120('0x3b')]['id'],function(_0x50ced5){try{_0x50ced5=_0x161bcf[_0x1120('0x3e')](_0x50ced5);logger[_0x1120('0x32')](_0x1120('0x3f'),JSON[_0x1120('0x34')](_0x50ced5,null,0x2));if(_0x50ced5[_0x1120('0x22')]===_0x1120('0x40')){logger['info'](_0x1120('0x41'));_0xb5e780[_0x1120('0x42')]=_0x50ced5[_0x1120('0x42')]||_0xb5e780['context'];_0xb5e780[_0x1120('0x43')]=_0x50ced5[_0x1120('0x43')];_0xb5e780[_0x1120('0x44')]=_0x50ced5[_0x1120('0x44')]?_0x50ced5[_0x1120('0x44')]-0x1:0x1;return null;}else if(_0x50ced5&&_0x161bcf[_0x50ced5[_0x1120('0x22')]]){_0x5b174b=_0x161bcf[_0x50ced5['agicommand']](_0x50ced5);logger[_0x1120('0x12')]('response',JSON[_0x1120('0x34')](_0x5b174b,null,0x2));if(_0x5b174b&&_0x5b174b[_0x1120('0x45')]===AGI_CODE_SUCCESS&&_0x5b174b[_0x1120('0x46')]!==AGI_RESULT_ERROR&&!_0xb5e780[_0x1120('0x47')]){logger[_0x1120('0x32')](_0x1120('0x48'),getLogFromObject(_0x5b174b));return _[_0x1120('0x49')](_0x5b174b[_0x1120('0x46')])?null:_0x5b174b[_0x1120('0x46')][_0x1120('0x4a')]();}else{logger[_0x1120('0xd')](_0x1120('0x48'),getLogFromObject(_0x5b174b));return null;}}else{logger[_0x1120('0xd')](_0x1120('0x4b'));return null;}}catch(_0x3ec316){logger[_0x1120('0xd')](_0x3ec316[_0x1120('0xe')]);return null;}});if(_0x17dfe6[_0x1120('0x4c')]){logger['info'](util[_0x1120('0x16')](_0x1120('0x4d'),_0xb5e780[_0x1120('0x1a')],_0xb5e780['calleridname'],_0xb5e780[_0x1120('0x1c')],_0xb5e780[_0x1120('0x1f')],_0xb5e780['uniqueid']));_0x2c2df2[_0x1120('0x3d')](_0x17dfe6[_0x1120('0x4c')]['id'],function(_0x1db9de){try{_0x1db9de=_0x161bcf[_0x1120('0x3e')](_0x1db9de);logger[_0x1120('0x32')](_0x1120('0x3f'),JSON[_0x1120('0x34')](_0x1db9de,null,0x2));if(_0x1db9de&&_0x161bcf[_0x1db9de[_0x1120('0x22')]]){_0x5b174b=_0x161bcf[_0x1db9de[_0x1120('0x22')]](_0x1db9de);if(_0x5b174b){logger['debug'](_0x1120('0x48'),getLogFromObject(_0x5b174b));return _[_0x1120('0x49')](_0x5b174b[_0x1120('0x46')])?null:_0x5b174b[_0x1120('0x46')][_0x1120('0x4a')]();}else{logger[_0x1120('0xd')](_0x1120('0x48'),getLogFromObject(_0x5b174b));return null;}}else{logger[_0x1120('0xd')](_0x1120('0x4b'));return null;}}catch(_0x3a6266){logger[_0x1120('0xd')](_0x3a6266[_0x1120('0xe')]);return null;}});}logger[_0x1120('0x12')](util[_0x1120('0x16')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xb5e780[_0x1120('0x1a')],_0xb5e780[_0x1120('0x1b')],_0xb5e780['callerid'],_0xb5e780['dnid'],_0xb5e780['uniqueid']));logger[_0x1120('0x12')](util[_0x1120('0x16')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0xb5e780[_0x1120('0x42')],_0xb5e780[_0x1120('0x43')],parseInt(_0xb5e780[_0x1120('0x44')],0xa)+0x1));_0xb5e780[_0x1120('0x4e')](_0xb5e780[_0x1120('0x42')],_0xb5e780[_0x1120('0x43')],parseInt(_0xb5e780[_0x1120('0x44')],0xa)+0x1);_0xb5e780[_0x1120('0x36')]();}}else{logger['error'](util[_0x1120('0x16')](_0x1120('0x4f'),_0xb5e780[_0x1120('0x1a')]));_0xb5e780[_0x1120('0x4e')](_0xb5e780[_0x1120('0x42')],_0xb5e780[_0x1120('0x43')],parseInt(_0xb5e780[_0x1120('0x44')],0xa)+0x1);_0xb5e780[_0x1120('0x36')]();}}else{logger['error'](util[_0x1120('0x16')](_0x1120('0x50'),_0xb5e780[_0x1120('0x1a')]));_0xb5e780[_0x1120('0x4e')](_0xb5e780[_0x1120('0x42')],_0xb5e780[_0x1120('0x43')],parseInt(_0xb5e780[_0x1120('0x44')],0xa)+0x1);_0xb5e780[_0x1120('0x36')]();}}function main(){var _0x2cca14;return utilLicense[_0x1120('0x51')]()[_0x1120('0x2d')](function(_0x1d1430){if(_0x1d1430){if(_0x1d1430['voice']){if(_0x1d1430[_0x1120('0x52')]&&_0x1d1430[_0x1120('0x52')]>0x0){logger[_0x1120('0x12')](util[_0x1120('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x1d1430[_0x1120('0x52')]));_0x2cca14=_0x1d1430[_0x1120('0x52')];}else{logger[_0x1120('0x12')](_0x1120('0x53'));}}else{logger[_0x1120('0x12')](_0x1120('0x54'));_0x2cca14=-0x1;}}})[_0x1120('0x2e')](function(_0x11403e){logger[_0x1120('0xd')](_0x1120('0x55'),_0x11403e[_0x1120('0xe')]);})[_0x1120('0x4c')](function(){var _0x136385=require(_0x1120('0x56'))(config[_0x1120('0x6')][_0x1120('0x11')],config[_0x1120('0x6')]['ip'],_0x2cca14);_0x136385['on']('error',errorHandler);_0x136385['on'](_0x1120('0x57'),listeningHandler);_0x136385['on'](_0x1120('0x58'),connectionHandler);_0x136385['on'](_0x1120('0x36'),closeHandler);});}main();
\ No newline at end of file
+var _0x0fd1=['continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[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','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','isArray','length','source','target','value','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0fd1,0xbc));var _0x10fd=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0fd1[_0x5d4607];return _0x5e4a86;};'use strict';var parser=require(_0x10fd('0x0'));var _=require('lodash');var syncho=require(_0x10fd('0x1'));var util=require('util');var moment=require(_0x10fd('0x2'));var config=require(_0x10fd('0x3'));var logger=require('../../config/logger')(_0x10fd('0x4'));var utilLicense=require(_0x10fd('0x5'));var rpc=require(_0x10fd('0x6'));var mailRpc=require(_0x10fd('0x7'));var Graph=require(_0x10fd('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x10fd('0x4')]=_[_0x10fd('0x9')](config[_0x10fd('0x4')],{'ip':_0x10fd('0xa'),'port':0x11dd});function connectionHandler(_0x1d033e){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1d033e);agiHandler(_0x1d033e);}catch(_0xab8284){logger[_0x10fd('0xb')](_0xab8284[_0x10fd('0xc')]);}});});}function listeningHandler(){console[_0x10fd('0xd')](_0x10fd('0xe'),config['agi'][_0x10fd('0xf')]);logger[_0x10fd('0x10')](util[_0x10fd('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x10fd('0x4')]['port']));}function errorHandler(_0x48dedf){if(_0x48dedf&&_0x48dedf['name']&&_0x48dedf[_0x10fd('0x12')]){logger[_0x10fd('0xb')](util[_0x10fd('0x11')](_0x10fd('0x13'),_0x48dedf[_0x10fd('0x14')],_0x48dedf[_0x10fd('0x12')]));}else{logger['error'](util[_0x10fd('0x11')](_0x10fd('0x15'),_0x48dedf['stack']));}}function closeHandler(){logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x16'),this[_0x10fd('0x17')],this[_0x10fd('0x18')],this[_0x10fd('0x19')],this[_0x10fd('0x1a')],this[_0x10fd('0x1b')]));try{createSquareReport(this);}catch(_0x159474){logger[_0x10fd('0xb')](_0x159474['stack']);}}function timeoutHandler(){logger['info'](util['format'](_0x10fd('0x1c'),this[_0x10fd('0x17')],this[_0x10fd('0x18')],this[_0x10fd('0x19')],this[_0x10fd('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x1d'),this[_0x10fd('0x17')],this[_0x10fd('0x18')],this['callerid'],this[_0x10fd('0x1a')],this[_0x10fd('0x1b')]));this[_0x10fd('0x1e')]=!![];}function getRoot(_0x3ebb02){return parser[_0x10fd('0x1f')](_0x3ebb02,{'object':!![]})[_0x10fd('0x20')][_0x10fd('0x21')];}function addVertex(_0x266c87,_0x50cc4c,_0x4797d1){_0x50cc4c[_0x10fd('0x22')]=_0x4797d1;if(_0x50cc4c[_0x10fd('0x23')]('retry')){_0x50cc4c['maxRetry']=parseInt(_0x50cc4c[_0x10fd('0x24')],0xa);}_0x266c87[_0x10fd('0x25')](_[_0x10fd('0x26')](_0x50cc4c,'mxCell'));}function initGraph(_0xbaa1ae,_0x5a906d){var _0x48b96c=new Graph();for(var _0x3553ca in _0xbaa1ae){if(_0xbaa1ae[_0x10fd('0x23')](_0x3553ca)){if(_[_0x10fd('0x27')](_0xbaa1ae[_0x3553ca])){for(var _0x1751c4=0x0;_0x1751c4<_0xbaa1ae[_0x3553ca][_0x10fd('0x28')];_0x1751c4+=0x1){addVertex(_0x48b96c,_0xbaa1ae[_0x3553ca][_0x1751c4],_0x3553ca);}}else{addVertex(_0x48b96c,_0xbaa1ae[_0x3553ca],_0x3553ca);}}}for(var _0x29fc7e=0x0;_0x29fc7e<_0x5a906d[_0x10fd('0x28')];_0x29fc7e+=0x1){if(_0x5a906d[_0x29fc7e][_0x10fd('0x29')]&&_0x5a906d[_0x29fc7e][_0x10fd('0x2a')]){_0x48b96c['addEdge'](_0x5a906d[_0x29fc7e][_0x10fd('0x29')],_0x5a906d[_0x29fc7e][_0x10fd('0x2a')],_0x5a906d[_0x29fc7e][_0x10fd('0x2b')]);}}return _0x48b96c;}function getSquareProject(_0x26d220,_0x1382f3){rpc[_0x10fd('0x2c')](_0x26d220)['then'](function(_0x5ee3a1){_0x1382f3(null,_0x5ee3a1);})[_0x10fd('0x2d')](function(_0x2338ee){_0x1382f3(null,_0x2338ee);});}function createSquareReport(_0x4cd909,_0xb2c4df){rpc[_0x10fd('0x2e')](_0x4cd909)[_0x10fd('0x2f')](function(_0x491154){if(_0xb2c4df){_0xb2c4df(null,_0x491154);}})[_0x10fd('0x2d')](function(_0x479815){if(_0xb2c4df){_0xb2c4df(null,_0x479815);}});}function setChannelVariables(_0x4ad120){for(var _0xf4bede in _0x4ad120){if(_0x4ad120[_0x10fd('0x23')](_0xf4bede)){if(_0xf4bede[_0x10fd('0x30')](_0x10fd('0x31'))===0x0){_0x4ad120[_0xf4bede[_0x10fd('0x32')](0x4)]=_0x4ad120[_0xf4bede];delete _0x4ad120[_0xf4bede];}}}}function getLogFromObject(_0x46a889){return util['inspect'](_0x46a889,{'showHidden':![],'depth':null});}function agiHandler(_0x1ffac0){var _0x1a336f,_0x4224e5,_0x5a7e1d,_0x131990,_0x3c113d;logger[_0x10fd('0x33')]('variables',JSON[_0x10fd('0x34')](_0x1ffac0,null,0x2));logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x35'),_0x1ffac0['arg_1'],_0x1ffac0[_0x10fd('0x18')],_0x1ffac0[_0x10fd('0x19')],_0x1ffac0['dnid'],_0x1ffac0['uniqueid']));_0x1ffac0['on']('error',errorHandler);_0x1ffac0['on'](_0x10fd('0x36'),closeHandler);_0x1ffac0['on'](_0x10fd('0x37'),timeoutHandler);_0x1ffac0[_0x10fd('0x1e')]=![];_0x1ffac0['on'](_0x10fd('0x38'),hangupHandler);var _0x396730=getSquareProject[_0x10fd('0x39')](null,_0x1ffac0[_0x10fd('0x17')]);if(_0x396730){if(_0x396730[_0x10fd('0x3a')]){_0x1a336f=getRoot(_0x396730[_0x10fd('0x3a')]);if(_0x1a336f&&_0x1a336f[_0x10fd('0x3b')]){logger[_0x10fd('0x33')](_0x10fd('0x21'),JSON['stringify'](_0x1a336f,null,0x2));_0x1ffac0['joinAt']=moment()[_0x10fd('0x11')](_0x10fd('0x3c'));_0x4224e5=initGraph(_[_0x10fd('0x26')](_0x1a336f,_0x10fd('0x3d')),_0x1a336f[_0x10fd('0x3d')]);_0x5a7e1d=new Vertices(_0x1ffac0,rpc,mailRpc);logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x3e'),_0x1ffac0[_0x10fd('0x17')],_0x1ffac0[_0x10fd('0x18')],_0x1ffac0[_0x10fd('0x19')],_0x1ffac0[_0x10fd('0x1a')],_0x1ffac0[_0x10fd('0x1b')]));_0x4224e5['traverseBFS'](_0x1a336f[_0x10fd('0x3b')]['id'],function(_0x4a1a6a){try{_0x4a1a6a=_0x5a7e1d[_0x10fd('0x3f')](_0x4a1a6a);logger[_0x10fd('0x33')](_0x10fd('0x40'),JSON[_0x10fd('0x34')](_0x4a1a6a,null,0x2));if(_0x4a1a6a[_0x10fd('0x22')]==='gotoc'){logger[_0x10fd('0x10')](_0x10fd('0x41'));_0x1ffac0[_0x10fd('0x42')]=_0x4a1a6a[_0x10fd('0x42')]||_0x1ffac0[_0x10fd('0x42')];_0x1ffac0[_0x10fd('0x43')]=_0x4a1a6a[_0x10fd('0x43')];_0x1ffac0[_0x10fd('0x44')]=_0x4a1a6a[_0x10fd('0x44')]?_0x4a1a6a[_0x10fd('0x44')]-0x1:0x1;return null;}else if(_0x4a1a6a&&_0x5a7e1d[_0x4a1a6a['agicommand']]){_0x3c113d=_0x5a7e1d[_0x4a1a6a[_0x10fd('0x22')]](_0x4a1a6a);logger[_0x10fd('0x10')](_0x10fd('0x45'),JSON[_0x10fd('0x34')](_0x3c113d,null,0x2));if(_0x3c113d&&_0x3c113d['code']===AGI_CODE_SUCCESS&&_0x3c113d[_0x10fd('0x46')]!==AGI_RESULT_ERROR&&!_0x1ffac0[_0x10fd('0x1e')]){logger[_0x10fd('0x33')](_0x10fd('0x45'),getLogFromObject(_0x3c113d));return _['isUndefined'](_0x3c113d[_0x10fd('0x46')])?null:_0x3c113d[_0x10fd('0x46')][_0x10fd('0x47')]();}else{logger[_0x10fd('0xb')](_0x10fd('0x45'),getLogFromObject(_0x3c113d));return null;}}else{logger[_0x10fd('0xb')](_0x10fd('0x48'));return null;}}catch(_0x181367){logger[_0x10fd('0xb')](_0x181367['stack']);return null;}});if(_0x1a336f[_0x10fd('0x49')]){logger['info'](util[_0x10fd('0x11')](_0x10fd('0x4a'),_0x1ffac0[_0x10fd('0x17')],_0x1ffac0['calleridname'],_0x1ffac0[_0x10fd('0x19')],_0x1ffac0[_0x10fd('0x1a')],_0x1ffac0[_0x10fd('0x1b')]));_0x4224e5[_0x10fd('0x4b')](_0x1a336f[_0x10fd('0x49')]['id'],function(_0x66622){try{_0x66622=_0x5a7e1d['clear'](_0x66622);logger[_0x10fd('0x33')](_0x10fd('0x40'),JSON[_0x10fd('0x34')](_0x66622,null,0x2));if(_0x66622&&_0x5a7e1d[_0x66622[_0x10fd('0x22')]]){_0x3c113d=_0x5a7e1d[_0x66622['agicommand']](_0x66622);if(_0x3c113d){logger['debug']('response',getLogFromObject(_0x3c113d));return _['isUndefined'](_0x3c113d[_0x10fd('0x46')])?null:_0x3c113d[_0x10fd('0x46')][_0x10fd('0x47')]();}else{logger[_0x10fd('0xb')](_0x10fd('0x45'),getLogFromObject(_0x3c113d));return null;}}else{logger[_0x10fd('0xb')](_0x10fd('0x48'));return null;}}catch(_0x1f2869){logger[_0x10fd('0xb')](_0x1f2869[_0x10fd('0xc')]);return null;}});}logger[_0x10fd('0x10')](util[_0x10fd('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1ffac0[_0x10fd('0x17')],_0x1ffac0['calleridname'],_0x1ffac0['callerid'],_0x1ffac0[_0x10fd('0x1a')],_0x1ffac0['uniqueid']));logger[_0x10fd('0x10')](util[_0x10fd('0x11')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0[_0x10fd('0x44')],0xa)+0x1));_0x1ffac0[_0x10fd('0x4c')](_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0[_0x10fd('0x44')],0xa)+0x1);_0x1ffac0[_0x10fd('0x36')]();}}else{logger['error'](util[_0x10fd('0x11')](_0x10fd('0x4d'),_0x1ffac0[_0x10fd('0x17')]));_0x1ffac0[_0x10fd('0x4c')](_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0[_0x10fd('0x44')],0xa)+0x1);_0x1ffac0[_0x10fd('0x36')]();}}else{logger[_0x10fd('0xb')](util[_0x10fd('0x11')](_0x10fd('0x4e'),_0x1ffac0[_0x10fd('0x17')]));_0x1ffac0[_0x10fd('0x4c')](_0x1ffac0[_0x10fd('0x42')],_0x1ffac0[_0x10fd('0x43')],parseInt(_0x1ffac0['priority'],0xa)+0x1);_0x1ffac0[_0x10fd('0x36')]();}}function main(){var _0x2e158e;return utilLicense['getLicense']()[_0x10fd('0x2f')](function(_0x5c572f){if(_0x5c572f){if(_0x5c572f[_0x10fd('0x4f')]){if(_0x5c572f[_0x10fd('0x50')]&&_0x5c572f[_0x10fd('0x50')]>0x0){logger[_0x10fd('0x10')](util[_0x10fd('0x11')](_0x10fd('0x51'),_0x5c572f[_0x10fd('0x50')]));_0x2e158e=_0x5c572f[_0x10fd('0x50')];}else{logger[_0x10fd('0x10')](_0x10fd('0x52'));}}else{logger[_0x10fd('0x10')](_0x10fd('0x53'));_0x2e158e=-0x1;}}})['catch'](function(_0x12a255){logger[_0x10fd('0xb')](_0x10fd('0x54'),_0x12a255[_0x10fd('0xc')]);})['finally'](function(){var _0x42e084=require(_0x10fd('0x55'))(config['agi'][_0x10fd('0xf')],config[_0x10fd('0x4')]['ip'],_0x2e158e);_0x42e084['on'](_0x10fd('0xb'),errorHandler);_0x42e084['on'](_0x10fd('0x56'),listeningHandler);_0x42e084['on'](_0x10fd('0x57'),connectionHandler);_0x42e084['on']('close',closeHandler);});}main();
\ No newline at end of file
index b01d83c..9b8104a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d29=['error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','request'];(function(_0x361bd6,_0x3c03ee){var _0x56956f=function(_0xe37e03){while(--_0xe37e03){_0x361bd6['push'](_0x361bd6['shift']());}};_0x56956f(++_0x3c03ee);}(_0x6d29,0x193));var _0x96d2=function(_0x3e798a,_0x1c3f1f){_0x3e798a=_0x3e798a-0x0;var _0x34538f=_0x6d29[_0x3e798a];return _0x34538f;};'use strict';var BPromise=require(_0x96d2('0x0'));var jayson=require(_0x96d2('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x30ba55,_0x51de91){return new BPromise(function(_0x24570d,_0x229c0f){return client[_0x96d2('0x2')](_0x30ba55,_0x51de91)['then'](function(_0x4ad1ca){if(_0x4ad1ca[_0x96d2('0x3')]){return _0x229c0f(_0x4ad1ca[_0x96d2('0x3')]['message']);}else{return _0x24570d(_0x4ad1ca['result']);}})[_0x96d2('0x4')](function(_0x3bd966){return _0x229c0f(_0x3bd966);});});}exports[_0x96d2('0x5')]=function(_0x192c72,_0x3b9083){return request(_0x96d2('0x6'),{'account':_0x192c72,'message':_0x3b9083});};
\ No newline at end of file
+var _0x5ab9=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message','result','catch'];(function(_0xb6f01e,_0x62a8bf){var _0x43f407=function(_0x2d2bec){while(--_0x2d2bec){_0xb6f01e['push'](_0xb6f01e['shift']());}};_0x43f407(++_0x62a8bf);}(_0x5ab9,0xd3));var _0x95ab=function(_0x1e6bdf,_0x377d56){_0x1e6bdf=_0x1e6bdf-0x0;var _0xf1d42f=_0x5ab9[_0x1e6bdf];return _0xf1d42f;};'use strict';var BPromise=require(_0x95ab('0x0'));var jayson=require(_0x95ab('0x1'));var client=jayson[_0x95ab('0x2')][_0x95ab('0x3')]({'port':0x232b});function request(_0x475ab8,_0x57c7ff){return new BPromise(function(_0x29d56b,_0x1aaac3){return client[_0x95ab('0x4')](_0x475ab8,_0x57c7ff)['then'](function(_0x481c47){if(_0x481c47[_0x95ab('0x5')]){return _0x1aaac3(_0x481c47[_0x95ab('0x5')][_0x95ab('0x6')]);}else{return _0x29d56b(_0x481c47[_0x95ab('0x7')]);}})[_0x95ab('0x8')](function(_0x67ba43){return _0x1aaac3(_0x67ba43);});});}exports[_0x95ab('0x9')]=function(_0x5a10aa,_0x4449a7){return request(_0x95ab('0xa'),{'account':_0x5a10aa,'message':_0x4449a7});};
\ No newline at end of file
index a1e4b4d..b24e5c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb720=['line','exports','util','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','length','split','indexOf','slice','trim','emit','headers','substring'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0xb720,0x191));var _0x0b72=function(_0x3a89dc,_0x54bb1e){_0x3a89dc=_0x3a89dc-0x0;var _0x11c5c9=_0xb720[_0x3a89dc];return _0x11c5c9;};'use strict';var util=require(_0x0b72('0x0'));var Transform=require('stream')[_0x0b72('0x1')];function AGIReply(_0x29a705){Transform[_0x0b72('0x2')](this,_0x29a705);this[_0x0b72('0x3')]='';this[_0x0b72('0x4')]=![];}util[_0x0b72('0x5')](AGIReply,Transform);AGIReply[_0x0b72('0x6')][_0x0b72('0x7')]=function(_0x11fac5,_0x48687f,_0x1fbb71){var _0x51679c='\x0a',_0x2a365d=['\x0a\x0a',_0x0b72('0x8')],_0x39a86b=-0x1,_0x473736=-0x1,_0x303d11='',_0x3ddb81=0x0,_0x5ee6a2='',_0x2737c9='';this[_0x0b72('0x3')]+=_0x11fac5['toString']();_0x5ee6a2=this[_0x0b72('0x3')];if(!this[_0x0b72('0x4')]){_0x3ddb81=0x0;while(_0x2a365d[_0x3ddb81]){while((_0x473736=_0x5ee6a2['indexOf'](_0x2a365d[_0x3ddb81]))!=-0x1){_0x303d11=_0x2a365d[_0x3ddb81];_0x2737c9=_0x5ee6a2['substring'](0x0,_0x473736);_0x5ee6a2=_0x5ee6a2['substring'](_0x473736+_0x303d11[_0x0b72('0x9')]);var _0x58e2e6=_0x2737c9[_0x0b72('0xa')](_0x51679c),_0x58dba3=0x0,_0x5f4708={},_0x356034='',_0x1fa33c='',_0x2d4f3f=-0x1;while(_0x58e2e6[_0x58dba3]){_0x2d4f3f=_0x58e2e6[_0x58dba3][_0x0b72('0xb')](':');if(_0x2d4f3f!=-0x1){_0x356034=_0x58e2e6[_0x58dba3][_0x0b72('0xc')](0x0,_0x2d4f3f)[_0x0b72('0xd')]();_0x1fa33c=_0x58e2e6[_0x58dba3]['slice'](_0x2d4f3f+0x1)[_0x0b72('0xd')]();if(_0x356034['length']>0x0){_0x5f4708[_0x356034]=_0x1fa33c;}}else{}_0x58dba3++;}this[_0x0b72('0xe')](_0x0b72('0xf'),_0x5f4708);this[_0x0b72('0x4')]=!![];}_0x3ddb81++;}this[_0x0b72('0x3')]=_0x5ee6a2;}else{while((_0x39a86b=_0x5ee6a2[_0x0b72('0xb')](_0x51679c))!=-0x1){_0x2737c9=_0x5ee6a2[_0x0b72('0x10')](0x0,_0x39a86b);this['emit'](_0x0b72('0x11'),_0x2737c9);_0x5ee6a2=_0x5ee6a2[_0x0b72('0x10')](_0x39a86b+_0x51679c[_0x0b72('0x9')]);}this['_localBuffer']=_0x5ee6a2;}_0x1fbb71();};module[_0x0b72('0x12')]=AGIReply;
\ No newline at end of file
+var _0x18c3=['headers','util','stream','Transform','call','_localBuffer','_inBody','prototype','_transform','indexOf','substring','length','split','slice','trim','emit'];(function(_0x33e025,_0xebd362){var _0x26163a=function(_0x5bca97){while(--_0x5bca97){_0x33e025['push'](_0x33e025['shift']());}};_0x26163a(++_0xebd362);}(_0x18c3,0x1e1));var _0x318c=function(_0x15f654,_0x2b4dc5){_0x15f654=_0x15f654-0x0;var _0x231cab=_0x18c3[_0x15f654];return _0x231cab;};'use strict';var util=require(_0x318c('0x0'));var Transform=require(_0x318c('0x1'))[_0x318c('0x2')];function AGIReply(_0x45136b){Transform[_0x318c('0x3')](this,_0x45136b);this[_0x318c('0x4')]='';this[_0x318c('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x318c('0x6')][_0x318c('0x7')]=function(_0x1d3ddb,_0x173d19,_0x6f687c){var _0xf30f23='\x0a',_0x128e8c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5e812c=-0x1,_0xdd06b5=-0x1,_0x1e4a27='',_0x5507d0=0x0,_0x18327a='',_0x14e8af='';this['_localBuffer']+=_0x1d3ddb['toString']();_0x18327a=this[_0x318c('0x4')];if(!this[_0x318c('0x5')]){_0x5507d0=0x0;while(_0x128e8c[_0x5507d0]){while((_0xdd06b5=_0x18327a[_0x318c('0x8')](_0x128e8c[_0x5507d0]))!=-0x1){_0x1e4a27=_0x128e8c[_0x5507d0];_0x14e8af=_0x18327a[_0x318c('0x9')](0x0,_0xdd06b5);_0x18327a=_0x18327a[_0x318c('0x9')](_0xdd06b5+_0x1e4a27[_0x318c('0xa')]);var _0x4086fe=_0x14e8af[_0x318c('0xb')](_0xf30f23),_0x30974a=0x0,_0x59f8c4={},_0x2d0de3='',_0x231379='',_0x202f65=-0x1;while(_0x4086fe[_0x30974a]){_0x202f65=_0x4086fe[_0x30974a][_0x318c('0x8')](':');if(_0x202f65!=-0x1){_0x2d0de3=_0x4086fe[_0x30974a][_0x318c('0xc')](0x0,_0x202f65)['trim']();_0x231379=_0x4086fe[_0x30974a][_0x318c('0xc')](_0x202f65+0x1)[_0x318c('0xd')]();if(_0x2d0de3[_0x318c('0xa')]>0x0){_0x59f8c4[_0x2d0de3]=_0x231379;}}else{}_0x30974a++;}this[_0x318c('0xe')](_0x318c('0xf'),_0x59f8c4);this['_inBody']=!![];}_0x5507d0++;}this[_0x318c('0x4')]=_0x18327a;}else{while((_0x5e812c=_0x18327a[_0x318c('0x8')](_0xf30f23))!=-0x1){_0x14e8af=_0x18327a[_0x318c('0x9')](0x0,_0x5e812c);this['emit']('line',_0x14e8af);_0x18327a=_0x18327a[_0x318c('0x9')](_0x5e812c+_0xf30f23['length']);}this[_0x318c('0x4')]=_0x18327a;}_0x6f687c();};module['exports']=AGIReply;
\ No newline at end of file
index 3680785..b642746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58b8=['CreateSquareMessage','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','http','request','then','error','message','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage'];(function(_0x3c796f,_0x171a90){var _0x1491a3=function(_0x3d34cb){while(--_0x3d34cb){_0x3c796f['push'](_0x3c796f['shift']());}};_0x1491a3(++_0x171a90);}(_0x58b8,0x156));var _0x858b=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0x58b8[_0x500785];return _0x1f8bcc;};'use strict';var BPromise=require(_0x858b('0x0'));var moment=require(_0x858b('0x1'));var _=require('lodash');var util=require(_0x858b('0x2'));var jayson=require(_0x858b('0x3'));var client=jayson['client'][_0x858b('0x4')]({'port':0x2329});function request(_0x5a0058,_0x19465f){return new BPromise(function(_0x79c07,_0x52d299){return client[_0x858b('0x5')](_0x5a0058,_0x19465f)[_0x858b('0x6')](function(_0xc0875a){if(_0xc0875a[_0x858b('0x7')]){return _0x52d299(_0xc0875a[_0x858b('0x7')][_0x858b('0x8')]);}else{return _0x79c07(_0xc0875a['result']);}})[_0x858b('0x9')](function(_0x585814){return _0x52d299(_0x585814);});});}exports[_0x858b('0xa')]=function(_0xaedc1f){return request(_0x858b('0xb'),{'options':{'raw':![],'where':{'name':_0xaedc1f},'attributes':[_0x858b('0xc')]}});};exports[_0x858b('0xd')]=function(_0x50748c){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x50748c},'include':[{'model':_0x858b('0xe'),'as':'Smtp'}],'attributes':['id',_0x858b('0xf'),'email']}});};exports['getSquareProjectById']=function(_0x2e31b0){return request(_0x858b('0xb'),{'options':{'where':{'id':_0x2e31b0},'attributes':['name']}});};exports[_0x858b('0x10')]=function(_0x27e738){return request(_0x858b('0x11'),{'options':{'where':{'id':_0x27e738},'attributes':[_0x858b('0xf')]}});};exports[_0x858b('0x12')]=function(_0x4fa2ac){return request('ShowVariable',{'options':{'where':{'id':_0x4fa2ac},'attributes':[_0x858b('0xf')]}});};exports[_0x858b('0x13')]=function(_0x30be11){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x30be11},'attributes':[_0x858b('0x14')]}});};exports[_0x858b('0x15')]=function(_0x52acc3){return request(_0x858b('0x16'),{'options':{'where':{'id':_0x52acc3},'attributes':[_0x858b('0xf')]}});};exports[_0x858b('0x17')]=function(_0x4f82a5){return request(_0x858b('0x18'),{'options':{'where':{'id':_0x4f82a5},'attributes':[_0x858b('0xf')]}});};exports[_0x858b('0x19')]=function(_0x4f70f8){return request(_0x858b('0x1a'),{'options':{'where':{'id':_0x4f70f8},'attributes':[_0x858b('0x1b')]}});};exports[_0x858b('0x1c')]=function(_0x4acd65){return request(_0x858b('0x1d'),{'options':{'raw':![],'where':{'id':_0x4acd65},'include':[{'model':'Interval','as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x4f28d9){return request(_0x858b('0x1e'),{'options':{'where':{'id':_0x4f28d9},'attributes':['id',_0x858b('0xf')]}});};exports[_0x858b('0x1f')]=function(_0x427c4a){return request(_0x858b('0x20'),{'body':_0x427c4a});};exports[_0x858b('0x21')]=function(_0x11fccd){return request(_0x858b('0x22'),{'body':_0x11fccd});};exports[_0x858b('0x23')]=function(_0x23f6cd){return request(_0x858b('0x24'),{'body':_[_0x858b('0x25')](_0x23f6cd,{'project_name':_0x23f6cd[_0x858b('0x26')],'prev_project_name':_0x23f6cd[_0x858b('0x27')]||'','is_subproject':_0x23f6cd[_0x858b('0x27')]?!![]:![],'leaveAt':moment()['format'](_0x858b('0x28'))})});};exports['createSquareRecording']=function(_0x1d4be8){return request(_0x858b('0x29'),{'body':_0x1d4be8});};exports[_0x858b('0x2a')]=function(_0x280293){return request(_0x858b('0x2b'),{'body':_0x280293});};exports['createCmContact']=function(_0x8ab77d){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x8ab77d[_0x858b('0x2c')],'ListId':_0x8ab77d[_0x858b('0x2d')]}}})[_0x858b('0x6')](function(_0x447be8){if(_0x447be8){return _0x447be8;}return request(_0x858b('0x2e'),{'body':_0x8ab77d});});};exports[_0x858b('0x2f')]=function(_0x5d7be6){return request(_0x858b('0x30'),{'options':{'where':{'id':_0x5d7be6},'attributes':['name']}});};exports[_0x858b('0x31')]=function(_0x158fee,_0xd94558){return request('LoginUser',{'body':{'interface':_0xd94558},'options':{'where':_0x158fee}});};exports[_0x858b('0x32')]=function(_0x48c28c,_0x554c87,_0x3da451){return request(_0x858b('0x33'),{'body':{'type':_0x554c87,'uniqueid':_0x3da451},'options':{'where':_0x48c28c}});};exports['agentUnpause']=function(_0x335f4b){return request(_0x858b('0x34'),{'body':{},'options':{'where':_0x335f4b}});};exports[_0x858b('0x35')]=function(_0x54d280){return request(_0x858b('0x36'),{'body':{},'options':{'where':_0x54d280}});};
\ No newline at end of file
+var _0x40ae=['http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','ShowTrunk','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','bluebird','moment','lodash','client'];(function(_0x3583e3,_0x2e3c98){var _0x2ed345=function(_0x414443){while(--_0x414443){_0x3583e3['push'](_0x3583e3['shift']());}};_0x2ed345(++_0x2e3c98);}(_0x40ae,0x184));var _0xe40a=function(_0x4768b7,_0x2e793c){_0x4768b7=_0x4768b7-0x0;var _0x29215c=_0x40ae[_0x4768b7];return _0x29215c;};'use strict';var BPromise=require(_0xe40a('0x0'));var moment=require(_0xe40a('0x1'));var _=require(_0xe40a('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0xe40a('0x3')][_0xe40a('0x4')]({'port':0x2329});function request(_0x10f306,_0x40d185){return new BPromise(function(_0xbe5742,_0x57866c){return client[_0xe40a('0x5')](_0x10f306,_0x40d185)[_0xe40a('0x6')](function(_0xb54d5c){if(_0xb54d5c[_0xe40a('0x7')]){return _0x57866c(_0xb54d5c['error'][_0xe40a('0x8')]);}else{return _0xbe5742(_0xb54d5c[_0xe40a('0x9')]);}})['catch'](function(_0x10af5e){return _0x57866c(_0x10af5e);});});}exports[_0xe40a('0xa')]=function(_0x392572){return request(_0xe40a('0xb'),{'options':{'raw':![],'where':{'name':_0x392572},'attributes':[_0xe40a('0xc')]}});};exports[_0xe40a('0xd')]=function(_0x40fd50){return request(_0xe40a('0xe'),{'options':{'raw':![],'where':{'id':_0x40fd50},'include':[{'model':'MailServerOut','as':_0xe40a('0xf')}],'attributes':['id',_0xe40a('0x10'),_0xe40a('0x11')]}});};exports['getSquareProjectById']=function(_0x5b1a80){return request(_0xe40a('0xb'),{'options':{'where':{'id':_0x5b1a80},'attributes':['name']}});};exports[_0xe40a('0x12')]=function(_0x2a9430){return request(_0xe40a('0x13'),{'options':{'where':{'id':_0x2a9430},'attributes':[_0xe40a('0x10')]}});};exports[_0xe40a('0x14')]=function(_0x50bc17){return request(_0xe40a('0x15'),{'options':{'where':{'id':_0x50bc17},'attributes':['name']}});};exports[_0xe40a('0x16')]=function(_0x3e6468){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3e6468},'attributes':['dsn']}});};exports[_0xe40a('0x17')]=function(_0x3aac9d){return request('ShowUser',{'options':{'where':{'id':_0x3aac9d},'attributes':[_0xe40a('0x10')]}});};exports[_0xe40a('0x18')]=function(_0x36295f){return request(_0xe40a('0x19'),{'options':{'where':{'id':_0x36295f},'attributes':[_0xe40a('0x10')]}});};exports['getSoundById']=function(_0xc8ced3){return request('ShowSound',{'options':{'where':{'id':_0xc8ced3},'attributes':[_0xe40a('0x1a')]}});};exports['getIntervalById']=function(_0x436fc2){return request(_0xe40a('0x1b'),{'options':{'raw':![],'where':{'id':_0x436fc2},'include':[{'model':_0xe40a('0x1c'),'as':'Intervals'}]}});};exports[_0xe40a('0x1d')]=function(_0x4f8164){return request(_0xe40a('0x1e'),{'options':{'where':{'id':_0x4f8164},'attributes':['id',_0xe40a('0x10')]}});};exports[_0xe40a('0x1f')]=function(_0x1154d4){return request(_0xe40a('0x20'),{'body':_0x1154d4});};exports[_0xe40a('0x21')]=function(_0x27b120){return request(_0xe40a('0x22'),{'body':_0x27b120});};exports[_0xe40a('0x23')]=function(_0x22295c){return request(_0xe40a('0x24'),{'body':_['merge'](_0x22295c,{'project_name':_0x22295c[_0xe40a('0x25')],'prev_project_name':_0x22295c[_0xe40a('0x26')]||'','is_subproject':_0x22295c[_0xe40a('0x26')]?!![]:![],'leaveAt':moment()[_0xe40a('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x504b4f){return request(_0xe40a('0x28'),{'body':_0x504b4f});};exports['createSquareMessage']=function(_0x41517d){return request(_0xe40a('0x29'),{'body':_0x41517d});};exports[_0xe40a('0x2a')]=function(_0x4f1f34){return request(_0xe40a('0x2b'),{'options':{'raw':![],'where':{'phone':_0x4f1f34['phone'],'ListId':_0x4f1f34['ListId']}}})[_0xe40a('0x6')](function(_0x1d7a23){if(_0x1d7a23){return _0x1d7a23;}return request('CreateCmContact',{'body':_0x4f1f34});});};exports['getPauseById']=function(_0x4d8b09){return request('ShowPause',{'options':{'where':{'id':_0x4d8b09},'attributes':[_0xe40a('0x10')]}});};exports['agentLogin']=function(_0x2958b7,_0x571190){return request(_0xe40a('0x2c'),{'body':{'interface':_0x571190},'options':{'where':_0x2958b7}});};exports[_0xe40a('0x2d')]=function(_0x443c0b,_0xf625a6,_0x2a474f){return request(_0xe40a('0x2e'),{'body':{'type':_0xf625a6,'uniqueid':_0x2a474f},'options':{'where':_0x443c0b}});};exports[_0xe40a('0x2f')]=function(_0x4ae32a){return request('UnpauseUser',{'body':{},'options':{'where':_0x4ae32a}});};exports[_0xe40a('0x30')]=function(_0x1dbb25){return request('LogoutUser',{'body':{},'options':{'where':_0x1dbb25}});};
\ No newline at end of file
index 6430d20..a97fcd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fa=['./lex','exports','./polly'];(function(_0x4feb0c,_0x32e132){var _0x4d5d8a=function(_0xd57a33){while(--_0xd57a33){_0x4feb0c['push'](_0x4feb0c['shift']());}};_0x4d5d8a(++_0x32e132);}(_0xc1fa,0x83));var _0xac1f=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xc1fa[_0x4f3c9b];return _0x84e58a;};var polly=require(_0xac1f('0x0'));var lex=require(_0xac1f('0x1'));module[_0xac1f('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xc2d6=['exports','./lex'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xc2d6,0x171));var _0x6c2d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xc2d6[_0x102e37];return _0x35a07c;};var polly=require('./polly');var lex=require(_0x6c2d('0x0'));module[_0x6c2d('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 2428d98..39fa544 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['./lib/api','exports'];(function(_0x12deb1,_0x20192c){var _0x50c8cb=function(_0x27eb02){while(--_0x27eb02){_0x12deb1['push'](_0x12deb1['shift']());}};_0x50c8cb(++_0x20192c);}(_0x4ea3,0x70));var _0x34ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4ea3[_0x1facfa];return _0x9ec701;};'use strict';var lex=require(_0x34ea('0x0'));module[_0x34ea('0x1')]=function(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c){return lex(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c);};
\ No newline at end of file
+var _0x41bb=['exports','./lib/api'];(function(_0x36681c,_0x41981b){var _0x445cc6=function(_0x47fe46){while(--_0x47fe46){_0x36681c['push'](_0x36681c['shift']());}};_0x445cc6(++_0x41981b);}(_0x41bb,0xc5));var _0xb41b=function(_0x203ab9,_0x132be7){_0x203ab9=_0x203ab9-0x0;var _0x4ec0e7=_0x41bb[_0x203ab9];return _0x4ec0e7;};'use strict';var lex=require(_0xb41b('0x0'));module[_0xb41b('0x1')]=function(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333){return lex(_0x4ef2f1,_0x428431,_0x4d5578,_0x30ea75,_0x1c9d36,_0x148333);};
\ No newline at end of file
index 1a44e9a..72b2fb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x11b05b,_0x315435){var _0x26ac34=function(_0x6ac79b){while(--_0x6ac79b){_0x11b05b['push'](_0x11b05b['shift']());}};_0x26ac34(++_0x315435);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x3f355f,_0x5693a7){var _0x3dc257=function(_0x77a676){while(--_0x77a676){_0x3f355f['push'](_0x3f355f['shift']());}};_0x3dc257(++_0x5693a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 60bc70b..a771c67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0fa=['exports','./lib/api'];(function(_0x5bc0d1,_0x371633){var _0x521f52=function(_0xa86cc1){while(--_0xa86cc1){_0x5bc0d1['push'](_0x5bc0d1['shift']());}};_0x521f52(++_0x371633);}(_0xb0fa,0x101));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var polly=require(_0xab0f('0x0'));module[_0xab0f('0x1')]=function(_0x2c094a,_0x5920d8,_0x2bf8da,_0x342117,_0x2060f9,_0x628da5,_0x4bd7dc){return polly(_0x2c094a,_0x5920d8,_0x2bf8da,_0x342117,_0x2060f9,_0x628da5,_0x4bd7dc);};
\ No newline at end of file
+var _0x117f=['exports'];(function(_0x44cad9,_0x205bb5){var _0x570e1d=function(_0x436e51){while(--_0x436e51){_0x44cad9['push'](_0x44cad9['shift']());}};_0x570e1d(++_0x205bb5);}(_0x117f,0xfa));var _0xf117=function(_0x17f0b4,_0x260306){_0x17f0b4=_0x17f0b4-0x0;var _0xe3c5c1=_0x117f[_0x17f0b4];return _0xe3c5c1;};'use strict';var polly=require('./lib/api');module[_0xf117('0x0')]=function(_0x126b32,_0x2a0de1,_0x3fc324,_0x2a1198,_0xda90e6,_0x32c8cd,_0x201ee8){return polly(_0x126b32,_0x2a0de1,_0x3fc324,_0x2a1198,_0xda90e6,_0x32c8cd,_0x201ee8);};
\ No newline at end of file
index 0b63a5b..f57067d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x013c=['path','randomstring','aws-sdk','synthesizeSpeech','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x013c,0xaa));var _0xc013=function(_0x4147e6,_0x57174e){_0x4147e6=_0x4147e6-0x0;var _0x3305ba=_0x013c[_0x4147e6];return _0x3305ba;};'use strict';var fs=require('fs');var path=require(_0xc013('0x0'));var BPromise=require('bluebird');var rs=require(_0xc013('0x1'));var AWS=require(_0xc013('0x2'));function pollyResult(_0x434530,_0x4ea4d7,_0x52c172){return new BPromise(function(_0x4b810d,_0x2e36b0){_0x434530[_0xc013('0x3')](_0x4ea4d7,function(_0xf3a291,_0x1ccb63){if(_0xf3a291){_0x2e36b0(_0xf3a291);}else if(_0x1ccb63){if(_0x1ccb63['AudioStream']instanceof Buffer){fs['writeFile'](_0x52c172,_0x1ccb63['AudioStream'],function(_0x57905f){if(_0x57905f){_0x2e36b0(_0x57905f);}else{_0x4b810d();}});}else{_0x2e36b0(new Error(_0xc013('0x4')));}}else{_0x2e36b0(new Error(_0xc013('0x5')));}});});}module[_0xc013('0x6')]=function(_0x5749ad,_0x339c40,_0x4a062f,_0xc668ce,_0xa18bf2,_0x4f1421,_0x140b62){var _0xa657ec=new AWS[(_0xc013('0x7'))]({'accessKeyId':_0x5749ad,'secretAccessKey':_0x339c40,'region':_0x4a062f});var _0x1fecf5={'Text':_0xa18bf2,'TextType':_0x4f1421||_0xc013('0x8'),'OutputFormat':_0xc013('0x9'),'VoiceId':_0xc668ce};return pollyResult(_0xa657ec,_0x1fecf5,_0x140b62);};
\ No newline at end of file
+var _0xaecc=['text','bluebird','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x53d6e4,_0x3306db){var _0x52bb23=function(_0x478b61){while(--_0x478b61){_0x53d6e4['push'](_0x53d6e4['shift']());}};_0x52bb23(++_0x3306db);}(_0xaecc,0xe9));var _0xcaec=function(_0x273e0d,_0x57ced8){_0x273e0d=_0x273e0d-0x0;var _0x251355=_0xaecc[_0x273e0d];return _0x251355;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xcaec('0x0'));var rs=require(_0xcaec('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x1d36b7,_0x418f31,_0x5c88e1){return new BPromise(function(_0x4a6c0b,_0x484bb2){_0x1d36b7[_0xcaec('0x2')](_0x418f31,function(_0x28ae35,_0x31895f){if(_0x28ae35){_0x484bb2(_0x28ae35);}else if(_0x31895f){if(_0x31895f[_0xcaec('0x3')]instanceof Buffer){fs['writeFile'](_0x5c88e1,_0x31895f[_0xcaec('0x3')],function(_0x32a9ff){if(_0x32a9ff){_0x484bb2(_0x32a9ff);}else{_0x4a6c0b();}});}else{_0x484bb2(new Error(_0xcaec('0x4')));}}else{_0x484bb2(new Error(_0xcaec('0x5')));}});});}module[_0xcaec('0x6')]=function(_0x564a02,_0x24f599,_0x5ae70e,_0x1b83c5,_0x5ebd9e,_0x4e04da,_0x22dfb2){var _0x358b3a=new AWS['Polly']({'accessKeyId':_0x564a02,'secretAccessKey':_0x24f599,'region':_0x5ae70e});var _0x106056={'Text':_0x5ebd9e,'TextType':_0x4e04da||_0xcaec('0x7'),'OutputFormat':'mp3','VoiceId':_0x1b83c5};return pollyResult(_0x358b3a,_0x106056,_0x22dfb2);};
\ No newline at end of file
index 2b77aa8..2419d69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58ac=['./lib/api','exports'];(function(_0x140920,_0x5464db){var _0x436ed0=function(_0x56b784){while(--_0x56b784){_0x140920['push'](_0x140920['shift']());}};_0x436ed0(++_0x5464db);}(_0x58ac,0x72));var _0xc58a=function(_0xf23793,_0x2f75c0){_0xf23793=_0xf23793-0x0;var _0x1fe234=_0x58ac[_0xf23793];return _0x1fe234;};'use strict';var asr=require(_0xc58a('0x0'));module[_0xc58a('0x1')]=function(_0x363a20,_0x2ab520,_0x6906b1,_0x5b1edc){return asr(_0x363a20,_0x2ab520,_0x6906b1);};
\ No newline at end of file
+var _0x45ee=['./lib/api','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x45ee,0x110));var _0xe45e=function(_0x12a600,_0x4aa209){_0x12a600=_0x12a600-0x0;var _0x236c37=_0x45ee[_0x12a600];return _0x236c37;};'use strict';var asr=require(_0xe45e('0x0'));module[_0xe45e('0x1')]=function(_0x197a19,_0x30026f,_0xf69c9a,_0x4481ab){return asr(_0x197a19,_0x30026f,_0xf69c9a);};
\ No newline at end of file
index 09fb27e..387ac57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aea=['toString','base64','POST','/v1/speech:recognize?key=','8000','url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9aea,0xdd));var _0xa9ae=function(_0x310288,_0x109855){_0x310288=_0x310288-0x0;var _0x3af037=_0x9aea[_0x310288];return _0x3af037;};'use strict';var url=require(_0xa9ae('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa9ae('0x1');module['exports']=function(_0x2b5e0c,_0x13679e,_0x563a24){return new BPromise(function(_0x414638,_0x115593){var _0x41fb71;if(typeof _0x2b5e0c!==_0xa9ae('0x2')||_0x2b5e0c[_0xa9ae('0x3')]===0x0){return _0x115593('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x13679e!==_0xa9ae('0x2')||_0x13679e[_0xa9ae('0x3')]===0x0){return _0x115593(_0xa9ae('0x4'));}if(typeof _0x563a24!=='undefined'&&(typeof _0x563a24!==_0xa9ae('0x2')||_0x563a24[_0xa9ae('0x3')]===0x0)){return _0x115593(_0xa9ae('0x5'));}try{_0x41fb71=fs[_0xa9ae('0x6')](_0x2b5e0c)[_0xa9ae('0x7')](_0xa9ae('0x8'));}catch(_0x1816c2){return _0x115593(_0x1816c2);}return _0x414638({'method':_0xa9ae('0x9'),'uri':host+_0xa9ae('0xa')+_0x13679e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xa9ae('0xb'),'languageCode':_0x563a24},'audio':{'content':_0x41fb71}},'json':!![]});});};
\ No newline at end of file
+var _0xfaa4=['filepath\x20should\x20be\x20a\x20string','length','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x3e8fc3,_0x298789){var _0x39a2bf=function(_0x5b0e2c){while(--_0x5b0e2c){_0x3e8fc3['push'](_0x3e8fc3['shift']());}};_0x39a2bf(++_0x298789);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x591148,_0xcb1087){_0x591148=_0x591148-0x0;var _0x56316e=_0xfaa4[_0x591148];return _0x56316e;};'use strict';var url=require(_0x4faa('0x0'));var BPromise=require(_0x4faa('0x1'));var fs=require('fs');var host=_0x4faa('0x2');module[_0x4faa('0x3')]=function(_0x122c51,_0x1f79b7,_0x5141d1){return new BPromise(function(_0x1d9494,_0x819149){var _0x144600;if(typeof _0x122c51!==_0x4faa('0x4')||_0x122c51['length']===0x0){return _0x819149(_0x4faa('0x5'));}if(typeof _0x1f79b7!==_0x4faa('0x4')||_0x1f79b7[_0x4faa('0x6')]===0x0){return _0x819149('key\x20should\x20be\x20a\x20string');}if(typeof _0x5141d1!=='undefined'&&(typeof _0x5141d1!=='string'||_0x5141d1[_0x4faa('0x6')]===0x0)){return _0x819149(_0x4faa('0x7'));}try{_0x144600=fs[_0x4faa('0x8')](_0x122c51)['toString'](_0x4faa('0x9'));}catch(_0x383778){return _0x819149(_0x383778);}return _0x1d9494({'method':_0x4faa('0xa'),'uri':host+_0x4faa('0xb')+_0x1f79b7,'body':{'config':{'encoding':_0x4faa('0xc'),'sampleRateHertz':'8000','languageCode':_0x5141d1},'audio':{'content':_0x144600}},'json':!![]});});};
\ No newline at end of file
index f482f7c..af0ecb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c47=['exports','./asr'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x1c47,0x163));var _0x71c4=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x1c47[_0x166e96];return _0x553d73;};var asr=require(_0x71c4('0x0'));module[_0x71c4('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x9872=['exports'];(function(_0xb930e2,_0x291d08){var _0x3af9a4=function(_0x403e85){while(--_0x403e85){_0xb930e2['push'](_0xb930e2['shift']());}};_0x3af9a4(++_0x291d08);}(_0x9872,0x1a8));var _0x2987=function(_0x47f15a,_0x2dd8a4){_0x47f15a=_0x47f15a-0x0;var _0x4fcfa2=_0x9872[_0x47f15a];return _0x4fcfa2;};var asr=require('./asr');module[_0x2987('0x0')]={'asr':asr};
\ No newline at end of file
index 32730b9..b904779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7394=['from','audioContent','writeFile','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','fulfillmentText','intent','name','displayName','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechASR','format','freeform=3','parse','nda','channelData','CustomActionData','AudioFromTts','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','sox','google-tts-api','./aws','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','pipe','end','data','transcode','wav','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','.mp3'];(function(_0x5b79ff,_0x4a9090){var _0x429209=function(_0xe3ff47){while(--_0xe3ff47){_0x5b79ff['push'](_0x5b79ff['shift']());}};_0x429209(++_0x4a9090);}(_0x7394,0xc7));var _0x4739=function(_0x28e1c6,_0x398795){_0x28e1c6=_0x28e1c6-0x0;var _0x5425ba=_0x7394[_0x28e1c6];return _0x5425ba;};'use strict';var apiai=require(_0x4739('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x4739('0x1'));var fs=require('fs');var http=require(_0x4739('0x2'));var https=require(_0x4739('0x3'));var md5=require(_0x4739('0x4'));var path=require(_0x4739('0x5'));var querystring=require(_0x4739('0x6'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x4739('0x7'));var tts=require(_0x4739('0x8'));var urlParse=require('url')['parse'];var util=require('util');var aws=require(_0x4739('0x9'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x4739('0xa'));var logger=require(_0x4739('0xb'))(_0x4739('0xc'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x53c7a4,_0x3bc6eb){return new BPromise(function(_0x139323,_0x25e704){var _0x5e59da=urlParse(_0x53c7a4);var _0x5d8d05=_0x5e59da[_0x4739('0xd')]===_0x4739('0xe')?https:http;var _0x1552a9={'host':_0x5e59da[_0x4739('0xf')],'path':_0x5e59da[_0x4739('0x5')],'headers':{'user-agent':_0x4739('0x10')}};_0x5d8d05['get'](_0x1552a9,function(_0x277dc5){if(_0x277dc5[_0x4739('0x11')]!==0xc8){logger['error']('request\x20to\x20'+_0x53c7a4+_0x4739('0x12')+_0x277dc5['statusCode']+'\x20('+_0x277dc5[_0x4739('0x13')]+')');_0x25e704(new Error(_0x4739('0x14')+_0x53c7a4+_0x4739('0x12')+_0x277dc5[_0x4739('0x11')]+'\x20('+_0x277dc5[_0x4739('0x13')]+')'));return;}var _0x23170f=fs[_0x4739('0x15')](_0x3bc6eb);_0x23170f['on'](_0x4739('0x16'),function(){logger[_0x4739('0x17')](_0x4739('0x18'));_0x23170f[_0x4739('0x19')](_0x139323);});_0x23170f['on'](_0x4739('0x1a'),function(_0x389f4c){fs[_0x4739('0x1b')](_0x3bc6eb);logger['error']('download\x20error',_0x389f4c);_0x25e704(_0x389f4c);});_0x277dc5[_0x4739('0x1c')](_0x23170f);})['on']('error',function(_0x74ffe0){logger['error'](_0x74ffe0);_0x25e704(_0x74ffe0);})[_0x4739('0x1d')]();});}function uploadFile(_0x412e76){return new BPromise(function(_0x49cf08,_0x2468cf){var _0x1510c0=urlParse(_0x412e76);var _0x397c21=_0x1510c0['protocol']==='https:'?https:http;var _0x3f6aae={'host':_0x1510c0[_0x4739('0xf')],'path':_0x1510c0[_0x4739('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x397c21['get'](_0x3f6aae,function(_0x4dca14){if(_0x4dca14[_0x4739('0x11')]!==0xc8){_0x2468cf(new Error(_0x4739('0x14')+_0x412e76+_0x4739('0x12')+_0x4dca14[_0x4739('0x11')]+'\x20('+_0x4dca14['statusMessage']+')'));return;}var _0xf3a42e='';_0x4dca14['on'](_0x4739('0x1e'),function(_0x4915df){_0xf3a42e+=_0x4915df;});_0x4dca14['on'](_0x4739('0x1d'),function(){_0x49cf08(_0xf3a42e);});})['on'](_0x4739('0x1a'),function(_0x2bac23){_0x2468cf(_0x2bac23);})[_0x4739('0x1d')]();});}function convertFile(_0x4e1cf2,_0x5327cd){return new BPromise(function(_0x1131d9,_0x4425e3){var _0x52d60f=sox[_0x4739('0x1f')](_0x4e1cf2,_0x5327cd,{'sampleRate':0x1f40,'format':_0x4739('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x52d60f['on']('error',function(_0x5844cc){logger['error']('error\x20convert',_0x5844cc);_0x4425e3(_0x5844cc);});_0x52d60f['on'](_0x4739('0x1d'),function(){logger['info']('finish\x20to\x20convert');_0x1131d9();});_0x52d60f[_0x4739('0x21')]();});}function base64Decode(_0x41dce6,_0x4e722e){var _0x25e7ca=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+_0x4739('0x25'));fs[_0x4739('0x26')](_0x25e7ca,_0x41dce6,'base64');return convertFile(_0x25e7ca,_0x4e722e)[_0x4739('0x27')](function(){try{fs['unlink'](_0x25e7ca);fs[_0x4739('0x28')](_0x4e722e,_0x4739('0x29'));}catch(_0x115609){logger[_0x4739('0x1a')](_0x115609);}return _0x4e722e[_0x4739('0x2a')]('.')[0x0];});}function base64Encode(_0x4bb940){var _0x132037=fs[_0x4739('0x2b')](_0x4bb940);return new Buffer(_0x132037)[_0x4739('0x2c')](_0x4739('0x2d'));}exports[_0x4739('0x2e')]=function(_0x8ac2d7,_0x3d83b8,_0x16fcfc,_0x181718,_0x12ca27,_0x93bde3){var _0x5312c5,_0x5c4ce5;var _0x3d931e=_0x4739('0x2f');var _0x1b07c8=_0x4739('0x30')+_0x8ac2d7;var _0x4d8748={};if(_0x3d83b8===_0x4739('0x31')){_0x4d8748[_0x4739('0x32')]={'ssml':_0x16fcfc};}else{_0x4d8748['input']={'text':_0x16fcfc};};_0x4d8748[_0x4739('0x33')]={'languageCode':_0x181718,'ssmlGender':_0x12ca27};_0x4d8748['audioConfig']={'audioEncoding':_0x4739('0x34'),'sampleRateHertz':0x1f40};var _0x448398={'url':_0x3d931e+_0x4739('0x35')+_0x1b07c8,'method':'POST','json':!![],'body':_0x4d8748};return rp(_0x448398)[_0x4739('0x27')](function(_0x486a28){return new BPromise(function(_0x5b4e75,_0x5aa259){_0x5312c5=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+_0x4739('0x36'));var _0x401abd=Buffer[_0x4739('0x37')](_0x486a28[_0x4739('0x38')],_0x4739('0x2d'));return fs[_0x4739('0x39')](_0x5312c5,_0x401abd,function(_0x394625){_0x5aa259(_0x394625);},function(_0x2dbabb){fs[_0x4739('0x28')](_0x5312c5,'777');_0x5b4e75(_0x2dbabb);});});})[_0x4739('0x27')](function(_0x38fdd8){_0x5c4ce5=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+_0x4739('0x25'));return convertFile(_0x5312c5,_0x5c4ce5);})['then'](function(){try{fs[_0x4739('0x1b')](_0x5312c5);fs[_0x4739('0x28')](_0x5c4ce5,_0x4739('0x29'));}catch(_0x15502e){logger[_0x4739('0x1a')](_0x15502e);}logger[_0x4739('0x17')](_0x4739('0x3a'),_0x5c4ce5[_0x4739('0x2a')]('.')[0x0]);return _0x5c4ce5[_0x4739('0x2a')]('.')[0x0];});};exports['googleTTS']=function(_0x1b3d8f,_0x12487e){var _0x160f46=_0x4739('0x3b');var _0x1a8106,_0x51c9d3;var _0x3f3ac2;var _0x1037cb={'encoding':_0x4739('0x3c'),'method':_0x4739('0x3d'),'timeout':0x2710,'url':_0x160f46,'headers':{'Content-Type':_0x4739('0x3e')},'body':_0x4739('0x3f')+encodeURIComponent(JSON[_0x4739('0x40')]([[['jQ1olc',JSON['stringify']([_0x1b3d8f,_0x12487e||'en',![],_0x4739('0x41')]),null,_0x4739('0x42')]]]))};return rp(_0x1037cb)[_0x4739('0x27')](function(_0xe05d04){try{_0x3f3ac2=eval(_0xe05d04[_0x4739('0x43')](0x5))[0x0][0x2];}catch(_0x3136f7){throw new Error(_0x4739('0x44')+_0xe05d04[_0x4739('0x1e')]);}if(!_0x3f3ac2){if(_0x1b3d8f[_0x4739('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x12487e+_0x4739('0x46'));}}try{_0x3f3ac2=eval(_0x3f3ac2)[0x0];}catch(_0x2b033f){throw new Error(_0x4739('0x44')+res[_0x4739('0x1e')]);}const _0x1bfe75=_0x3f3ac2;_0x1a8106=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs['generate'](0x4)+_0x4739('0x36'));fs[_0x4739('0x26')](_0x1a8106,_0x3f3ac2,{'encoding':_0x4739('0x2d')});_0x51c9d3=path[_0x4739('0x22')](__dirname,'tmp',rs[_0x4739('0x24')](0x4)+_0x4739('0x25'));return convertFile(_0x1a8106,_0x51c9d3);})[_0x4739('0x27')](function(){try{fs['unlink'](_0x1a8106);fs[_0x4739('0x28')](_0x51c9d3,_0x4739('0x29'));}catch(_0x275d78){logger['error'](_0x275d78);}logger[_0x4739('0x17')](_0x4739('0x47'),_0x51c9d3[_0x4739('0x2a')]('.')[0x0]);return _0x51c9d3[_0x4739('0x2a')]('.')[0x0];});};exports[_0x4739('0x48')]=function(_0x127199,_0x55f9a6,_0x344429){return google[_0x4739('0x49')](_0x127199,_0x55f9a6,_0x344429)[_0x4739('0x27')](function(_0x3445c8){logger[_0x4739('0x17')](_0x3445c8[_0x4739('0x4a')]);return rp(_0x3445c8);})[_0x4739('0x27')](function(_0x3e6f87){var _0x40209a='';var _0x588336=0x0;try{fs['unlink'](_0x127199);}catch(_0x385eea){logger['error'](_0x385eea);}if(_0x3e6f87&&_0x3e6f87['results']){_0x40209a=_0x3e6f87[_0x4739('0x4b')][_0x4739('0x4c')](function(_0x1ae1e2){return _0x1ae1e2&&_0x1ae1e2[_0x4739('0x4d')][0x0]&&_0x1ae1e2['alternatives'][0x0]['transcript']?_0x1ae1e2[_0x4739('0x4d')][0x0][_0x4739('0x4e')]:'';})['join']('\x0a');_0x588336=_0x3e6f87[_0x4739('0x4b')][_0x4739('0x4c')](function(_0x282fb8){return _0x282fb8&&_0x282fb8[_0x4739('0x4d')][0x0]&&_0x282fb8[_0x4739('0x4d')][0x0][_0x4739('0x4f')]?_0x282fb8[_0x4739('0x4d')][0x0][_0x4739('0x4f')]:0x0;})['join']('\x0a');}logger[_0x4739('0x17')](_0x4739('0x50'),_0x40209a);logger[_0x4739('0x17')]('googleASR\x20confidence',_0x588336);return{'transcript':_0x40209a,'confidence':_0x588336};})[_0x4739('0x51')](function(_0x1d64b5){logger[_0x4739('0x1a')](_0x4739('0x52'),_0x1d64b5[_0x4739('0x11')],_0x1d64b5['name'],_0x1d64b5[_0x4739('0x53')]);});};exports[_0x4739('0x54')]=function(_0x7d10b8,_0x43107e,_0x20e848,_0x290c6f){var _0x40d96b=apiai(_0x43107e,{'language':_0x290c6f||'en'});return _0x40d96b[_0x4739('0x55')](_0x20e848,{'sessionId':md5(_0x7d10b8)})[_0x4739('0x27')](function(_0x34dc1b){logger[_0x4739('0x17')](JSON['stringify'](_0x34dc1b));return{'source':_0x34dc1b[_0x4739('0x56')][_0x4739('0x57')],'resolvedQuery':_0x34dc1b[_0x4739('0x56')]['resolvedQuery'],'action':_0x34dc1b[_0x4739('0x56')][_0x4739('0x58')],'actionIncomplete':_0x34dc1b[_0x4739('0x56')][_0x4739('0x59')],'speech':_0x34dc1b[_0x4739('0x56')][_0x4739('0x5a')][_0x4739('0x5b')],'score':_0x34dc1b['result'][_0x4739('0x5c')],'statusCode':_0x34dc1b[_0x4739('0x5d')][_0x4739('0x5e')],'endConversation':_0x34dc1b[_0x4739('0x56')]['metadata'][_0x4739('0x5f')]||![],'isFallbackIntent':_0x34dc1b['result'][_0x4739('0x60')]['isFallbackIntent']};});};exports[_0x4739('0x61')]=function(_0xc903f5,_0x29d653,_0x505cdb,_0x397c46,_0x236e0b,_0x490608){var _0x2c11fa=_0x397c46[_0x4739('0x62')](/\\n/g,'\x0a');var _0x50d6f6={'credentials':{'private_key':_0x2c11fa,'client_email':_0x505cdb}};var _0x54d8a5=new dialogflow[(_0x4739('0x63'))](_0x50d6f6);var _0x5861a2=_0x54d8a5[_0x4739('0x64')](_0x29d653,md5(_0xc903f5));var _0xd899cc={'session':_0x5861a2,'queryInput':{'text':{'text':_0x236e0b,'languageCode':_0x490608}}};return _0x54d8a5[_0x4739('0x65')](_0xd899cc)[_0x4739('0x27')](function(_0x9049e3){if(_0x9049e3&&_0x9049e3[_0x4739('0x45')]){logger[_0x4739('0x17')](_0x4739('0x66'),JSON[_0x4739('0x40')](_0x9049e3));var _0x40f946=_0x9049e3[0x0];if(_0x40f946){var _0x5a52ca={'action':_0x40f946[_0x4739('0x67')][_0x4739('0x58')],'allRequiredParamsPresent':_0x40f946[_0x4739('0x67')][_0x4739('0x68')],'endConversation':_0x40f946[_0x4739('0x67')][_0x4739('0x69')]&&_0x40f946[_0x4739('0x67')]['diagnosticInfo'][_0x4739('0x6a')]?_0x40f946[_0x4739('0x67')]['diagnosticInfo'][_0x4739('0x6a')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x40f946[_0x4739('0x67')][_0x4739('0x6b')],'intentName':_0x40f946[_0x4739('0x67')][_0x4739('0x6c')][_0x4739('0x6d')],'intentDisplayName':_0x40f946[_0x4739('0x67')][_0x4739('0x6c')][_0x4739('0x6e')],'isFallbackIntent':_0x40f946[_0x4739('0x67')][_0x4739('0x6c')]['isFallback'],'languageCode':_0x40f946[_0x4739('0x67')][_0x4739('0x6f')],'queryText':_0x40f946[_0x4739('0x67')]['queryText'],'responseId':_0x40f946[_0x4739('0x70')],'score':_0x40f946[_0x4739('0x67')][_0x4739('0x71')],'speech':_0x40f946['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x4739('0x40')](_0x9049e3)};return _0x5a52ca;}}});};exports['tildeASR']=function(_0x210f04,_0x18d654,_0x1bb53a,_0x35cddb){return tilde[_0x4739('0x49')](_0x210f04,_0x18d654,_0x1bb53a,_0x35cddb)[_0x4739('0x27')](function(_0x4e5eef){try{fs[_0x4739('0x1b')](_0x210f04);}catch(_0x199868){logger[_0x4739('0x1a')](_0x199868);}logger[_0x4739('0x17')](_0x4739('0x72'),_0x4e5eef[_0x4739('0x4e')]);logger['info'](_0x4739('0x73'),_0x4e5eef['confidence']);return _0x4e5eef;});};exports['awsPolly']=function(_0x598d4b,_0x237fe6,_0x178a9d,_0x4b3bab,_0x20e18d,_0x396cb7){var _0x401d8b=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+_0x4739('0x36'));var _0x2925ea;return aws[_0x4739('0x74')](_0x598d4b,_0x237fe6,_0x178a9d,_0x4b3bab,_0x20e18d,_0x396cb7,_0x401d8b)['then'](function(){_0x2925ea=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+_0x4739('0x25'));return convertFile(_0x401d8b,_0x2925ea);})['then'](function(){try{fs[_0x4739('0x1b')](_0x401d8b);fs[_0x4739('0x28')](_0x2925ea,_0x4739('0x29'));}catch(_0x1e4838){logger[_0x4739('0x1a')](_0x1e4838);}return _0x2925ea['split']('.')[0x0];});};exports['awsLex']=function(_0x351b48,_0x42a7f9,_0x5e5df5,_0x5e18a0,_0x5ec9ac,_0x331bee){return aws[_0x4739('0x75')](_0x351b48,_0x42a7f9,_0x5e5df5,_0x5e18a0,_0x5ec9ac,_0x331bee)[_0x4739('0x27')](function(_0x7e05fd){logger[_0x4739('0x17')](JSON['stringify'](_0x7e05fd));return _0x7e05fd;});};exports['ispeechTTS']=function(_0x3ed57d,_0x5492a7,_0x702d58,_0x3a3d30){var _0x2a0810=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x3ed57d,encodeURIComponent(_0x5492a7),_0x702d58,_0x3a3d30);var _0x1f11c2=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+'.mp3');var _0x1c3945;return downloadFile(_0x2a0810,_0x1f11c2)[_0x4739('0x27')](function(){_0x1c3945=path[_0x4739('0x22')](__dirname,_0x4739('0x23'),rs[_0x4739('0x24')](0x4)+_0x4739('0x25'));return convertFile(_0x1f11c2,_0x1c3945);})[_0x4739('0x27')](function(){try{fs['unlink'](_0x1f11c2);fs[_0x4739('0x28')](_0x1c3945,'777');}catch(_0x47a2dd){logger[_0x4739('0x1a')](_0x47a2dd);}return _0x1c3945[_0x4739('0x2a')]('.')[0x0];});};exports[_0x4739('0x76')]=function(_0x8decdf,_0xd108de,_0xa81235,_0x27d455){var _0x1dcd1f=util[_0x4739('0x77')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xd108de,_0xa81235,base64Encode(_0x8decdf),_0x27d455?util[_0x4739('0x77')]('model=%s',encodeURIComponent(_0x27d455)):_0x4739('0x78'));return uploadFile(_0x1dcd1f)['then'](function(_0x23df26){return querystring[_0x4739('0x79')](_0x23df26);});};exports['sestekNDA']=function(_0x37effc,_0x5cfbfe){return sestek[_0x4739('0x7a')](_0x37effc,_0x5cfbfe)['then'](function(_0x5ef07f){logger[_0x4739('0x17')](JSON[_0x4739('0x40')](_0x5ef07f));var _0x54b793={'speech':_0x5ef07f['text'],'action':_0x5ef07f[_0x4739('0x7b')]?_0x5ef07f['channelData']['CustomAction']:undefined,'actiondata':_0x5ef07f[_0x4739('0x7b')]?_0x5ef07f[_0x4739('0x7b')][_0x4739('0x7c')]:undefined};if(_0x5ef07f[_0x4739('0x7b')]&&_0x5ef07f[_0x4739('0x7b')][_0x4739('0x7d')]){return base64Decode(_0x5ef07f[_0x4739('0x7b')]['AudioFromTts']['Data'],path[_0x4739('0x22')](__dirname,'tmp',rs[_0x4739('0x24')](0x4)+_0x4739('0x25')))[_0x4739('0x27')](function(_0x1476b8){_0x54b793['audiofile']=_0x1476b8;return _0x54b793;});}return _0x54b793;});};exports[_0x4739('0x7e')]=function(){return __dirname;};
\ No newline at end of file
+var _0xd916=['text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','base64','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','then','.mp3','from','audioContent','writeFile','777','.wav','split','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','chmodSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','[%s]\x20%s:%s','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','name','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','parse','sestekNDA','nda'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xd916,0x87));var _0x6d91=function(_0x9bee87,_0x5db69e){_0x9bee87=_0x9bee87-0x0;var _0x3d8161=_0xd916[_0x9bee87];return _0x3d8161;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x6d91('0x0'));var fs=require('fs');var http=require(_0x6d91('0x1'));var https=require(_0x6d91('0x2'));var md5=require(_0x6d91('0x3'));var path=require(_0x6d91('0x4'));var querystring=require(_0x6d91('0x5'));var rp=require(_0x6d91('0x6'));var rs=require(_0x6d91('0x7'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x6d91('0x8'))['parse'];var util=require(_0x6d91('0x9'));var aws=require(_0x6d91('0xa'));var google=require(_0x6d91('0xb'));var sestek=require(_0x6d91('0xc'));var tilde=require(_0x6d91('0xd'));var logger=require(_0x6d91('0xe'))(_0x6d91('0xf'));var ISPEECH_API=_0x6d91('0x10');function downloadFile(_0x2b0b85,_0x520db0){return new BPromise(function(_0x28009e,_0x16f862){var _0x9c87fa=urlParse(_0x2b0b85);var _0x1bedb6=_0x9c87fa[_0x6d91('0x11')]===_0x6d91('0x12')?https:http;var _0x561527={'host':_0x9c87fa[_0x6d91('0x13')],'path':_0x9c87fa['path'],'headers':{'user-agent':_0x6d91('0x14')}};_0x1bedb6['get'](_0x561527,function(_0x260edf){if(_0x260edf[_0x6d91('0x15')]!==0xc8){logger[_0x6d91('0x16')](_0x6d91('0x17')+_0x2b0b85+_0x6d91('0x18')+_0x260edf[_0x6d91('0x15')]+'\x20('+_0x260edf[_0x6d91('0x19')]+')');_0x16f862(new Error(_0x6d91('0x17')+_0x2b0b85+_0x6d91('0x18')+_0x260edf[_0x6d91('0x15')]+'\x20('+_0x260edf['statusMessage']+')'));return;}var _0x666f0f=fs['createWriteStream'](_0x520db0);_0x666f0f['on'](_0x6d91('0x1a'),function(){logger[_0x6d91('0x1b')](_0x6d91('0x1c'));_0x666f0f[_0x6d91('0x1d')](_0x28009e);});_0x666f0f['on'](_0x6d91('0x16'),function(_0x4e6eaa){fs[_0x6d91('0x1e')](_0x520db0);logger['error'](_0x6d91('0x1f'),_0x4e6eaa);_0x16f862(_0x4e6eaa);});_0x260edf[_0x6d91('0x20')](_0x666f0f);})['on']('error',function(_0x5db7e3){logger[_0x6d91('0x16')](_0x5db7e3);_0x16f862(_0x5db7e3);})[_0x6d91('0x21')]();});}function uploadFile(_0x3439d1){return new BPromise(function(_0x4a8553,_0x301f7d){var _0x399fa0=urlParse(_0x3439d1);var _0x4190a0=_0x399fa0['protocol']===_0x6d91('0x12')?https:http;var _0x4e49d3={'host':_0x399fa0[_0x6d91('0x13')],'path':_0x399fa0[_0x6d91('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x4190a0['get'](_0x4e49d3,function(_0x5ab3c1){if(_0x5ab3c1[_0x6d91('0x15')]!==0xc8){_0x301f7d(new Error('request\x20to\x20'+_0x3439d1+_0x6d91('0x18')+_0x5ab3c1[_0x6d91('0x15')]+'\x20('+_0x5ab3c1[_0x6d91('0x19')]+')'));return;}var _0x52d5db='';_0x5ab3c1['on'](_0x6d91('0x22'),function(_0xd7db56){_0x52d5db+=_0xd7db56;});_0x5ab3c1['on'](_0x6d91('0x21'),function(){_0x4a8553(_0x52d5db);});})['on'](_0x6d91('0x16'),function(_0x5d8b67){_0x301f7d(_0x5d8b67);})[_0x6d91('0x21')]();});}function convertFile(_0x2d835b,_0x845361){return new BPromise(function(_0x319a0b,_0x3fc149){var _0x49e6eb=sox['transcode'](_0x2d835b,_0x845361,{'sampleRate':0x1f40,'format':_0x6d91('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x49e6eb['on'](_0x6d91('0x16'),function(_0x166a48){logger[_0x6d91('0x16')](_0x6d91('0x24'),_0x166a48);_0x3fc149(_0x166a48);});_0x49e6eb['on'](_0x6d91('0x21'),function(){logger['info'](_0x6d91('0x25'));_0x319a0b();});_0x49e6eb[_0x6d91('0x26')]();});}function base64Decode(_0xd8cfd5,_0x556f52){var _0x2573c3=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+'.wav');fs['writeFileSync'](_0x2573c3,_0xd8cfd5,_0x6d91('0x2a'));return convertFile(_0x2573c3,_0x556f52)['then'](function(){try{fs[_0x6d91('0x1e')](_0x2573c3);fs['chmodSync'](_0x556f52,'777');}catch(_0x2403af){logger['error'](_0x2403af);}return _0x556f52['split']('.')[0x0];});}function base64Encode(_0x2f0f85){var _0x536cfc=fs[_0x6d91('0x2b')](_0x2f0f85);return new Buffer(_0x536cfc)[_0x6d91('0x2c')]('base64');}exports[_0x6d91('0x2d')]=function(_0x54072b,_0x2905ca,_0x8b9042,_0x1dfc34,_0x51ae49,_0x4dbd52){var _0x1458a1,_0x4a036d;var _0x406a49=_0x6d91('0x2e');var _0x387573=_0x6d91('0x2f')+_0x54072b;var _0x29c576={};if(_0x2905ca===_0x6d91('0x30')){_0x29c576[_0x6d91('0x31')]={'ssml':_0x8b9042};}else{_0x29c576[_0x6d91('0x31')]={'text':_0x8b9042};};_0x29c576[_0x6d91('0x32')]={'languageCode':_0x1dfc34,'ssmlGender':_0x51ae49};_0x29c576[_0x6d91('0x33')]={'audioEncoding':_0x6d91('0x34'),'sampleRateHertz':0x1f40};var _0x257d34={'url':_0x406a49+'text:synthesize'+_0x387573,'method':_0x6d91('0x35'),'json':!![],'body':_0x29c576};return rp(_0x257d34)[_0x6d91('0x36')](function(_0x36cef0){return new BPromise(function(_0x26a28a,_0x359569){_0x1458a1=path['resolve'](__dirname,'tmp',rs[_0x6d91('0x29')](0x4)+_0x6d91('0x37'));var _0x31c3cd=Buffer[_0x6d91('0x38')](_0x36cef0[_0x6d91('0x39')],'base64');return fs[_0x6d91('0x3a')](_0x1458a1,_0x31c3cd,function(_0x4fc801){_0x359569(_0x4fc801);},function(_0x452f06){fs['chmodSync'](_0x1458a1,_0x6d91('0x3b'));_0x26a28a(_0x452f06);});});})[_0x6d91('0x36')](function(_0x5c3291){_0x4a036d=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x1458a1,_0x4a036d);})[_0x6d91('0x36')](function(){try{fs['unlink'](_0x1458a1);fs['chmodSync'](_0x4a036d,_0x6d91('0x3b'));}catch(_0x587a55){logger['error'](_0x587a55);}logger[_0x6d91('0x1b')]('googleCloudTTS\x20path',_0x4a036d[_0x6d91('0x3d')]('.')[0x0]);return _0x4a036d[_0x6d91('0x3d')]('.')[0x0];});};exports[_0x6d91('0x3e')]=function(_0x166aee,_0x72a403){var _0x340193='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x453865,_0x1d3639;var _0x3da2b5;var _0x1291bc={'encoding':'utf8','method':_0x6d91('0x35'),'timeout':0x2710,'url':_0x340193,'headers':{'Content-Type':_0x6d91('0x3f')},'body':_0x6d91('0x40')+encodeURIComponent(JSON[_0x6d91('0x41')]([[[_0x6d91('0x42'),JSON['stringify']([_0x166aee,_0x72a403||'en',![],_0x6d91('0x43')]),null,'generic']]]))};return rp(_0x1291bc)[_0x6d91('0x36')](function(_0x2b7a52){try{_0x3da2b5=eval(_0x2b7a52[_0x6d91('0x44')](0x5))[0x0][0x2];}catch(_0x477d3f){throw new Error('parse\x20response\x20failed:\x0a'+_0x2b7a52[_0x6d91('0x22')]);}if(!_0x3da2b5){if(_0x166aee[_0x6d91('0x45')]>0xc8){throw new Error(_0x6d91('0x46'));}else{throw new Error('lang\x20\x22'+_0x72a403+_0x6d91('0x47'));}}try{_0x3da2b5=eval(_0x3da2b5)[0x0];}catch(_0x501dd0){throw new Error(_0x6d91('0x48')+res['data']);}const _0x3e4757=_0x3da2b5;_0x453865=path['resolve'](__dirname,_0x6d91('0x28'),rs['generate'](0x4)+_0x6d91('0x37'));fs['writeFileSync'](_0x453865,_0x3da2b5,{'encoding':_0x6d91('0x2a')});_0x1d3639=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x453865,_0x1d3639);})[_0x6d91('0x36')](function(){try{fs['unlink'](_0x453865);fs[_0x6d91('0x49')](_0x1d3639,_0x6d91('0x3b'));}catch(_0x103a09){logger['error'](_0x103a09);}logger['info'](_0x6d91('0x4a'),_0x1d3639[_0x6d91('0x3d')]('.')[0x0]);return _0x1d3639[_0x6d91('0x3d')]('.')[0x0];});};exports[_0x6d91('0x4b')]=function(_0xc07905,_0x13b861,_0x5d8066){return google[_0x6d91('0x4c')](_0xc07905,_0x13b861,_0x5d8066)[_0x6d91('0x36')](function(_0xee5014){logger['info'](_0xee5014['uri']);return rp(_0xee5014);})[_0x6d91('0x36')](function(_0x3b960d){var _0x6eee2b='';var _0x896477=0x0;try{fs['unlink'](_0xc07905);}catch(_0x292dba){logger[_0x6d91('0x16')](_0x292dba);}if(_0x3b960d&&_0x3b960d[_0x6d91('0x4d')]){_0x6eee2b=_0x3b960d[_0x6d91('0x4d')][_0x6d91('0x4e')](function(_0x27171f){return _0x27171f&&_0x27171f[_0x6d91('0x4f')][0x0]&&_0x27171f[_0x6d91('0x4f')][0x0][_0x6d91('0x50')]?_0x27171f[_0x6d91('0x4f')][0x0][_0x6d91('0x50')]:'';})[_0x6d91('0x51')]('\x0a');_0x896477=_0x3b960d[_0x6d91('0x4d')][_0x6d91('0x4e')](function(_0xe88b50){return _0xe88b50&&_0xe88b50[_0x6d91('0x4f')][0x0]&&_0xe88b50['alternatives'][0x0][_0x6d91('0x52')]?_0xe88b50[_0x6d91('0x4f')][0x0][_0x6d91('0x52')]:0x0;})[_0x6d91('0x51')]('\x0a');}logger[_0x6d91('0x1b')](_0x6d91('0x53'),_0x6eee2b);logger['info']('googleASR\x20confidence',_0x896477);return{'transcript':_0x6eee2b,'confidence':_0x896477};})['catch'](function(_0x2394b4){logger[_0x6d91('0x16')](_0x6d91('0x54'),_0x2394b4[_0x6d91('0x15')],_0x2394b4['name'],_0x2394b4['message']);});};exports['googleDialogflow']=function(_0x2dfa92,_0x284533,_0x131341,_0x55b102){var _0x52aa47=apiai(_0x284533,{'language':_0x55b102||'en'});return _0x52aa47['textRequest'](_0x131341,{'sessionId':md5(_0x2dfa92)})[_0x6d91('0x36')](function(_0x5dc60f){logger['info'](JSON['stringify'](_0x5dc60f));return{'source':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x56')],'resolvedQuery':_0x5dc60f['result'][_0x6d91('0x57')],'action':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x58')],'actionIncomplete':_0x5dc60f['result'][_0x6d91('0x59')],'speech':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x5a')][_0x6d91('0x5b')],'score':_0x5dc60f[_0x6d91('0x55')][_0x6d91('0x5c')],'statusCode':_0x5dc60f[_0x6d91('0x5d')][_0x6d91('0x5e')],'endConversation':_0x5dc60f['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x5dc60f['result'][_0x6d91('0x5f')][_0x6d91('0x60')]};});};exports[_0x6d91('0x61')]=function(_0x33fe26,_0x4a61df,_0x5c8927,_0x1ae58c,_0x55378b,_0x26b088){var _0x2b2701=_0x1ae58c[_0x6d91('0x62')](/\\n/g,'\x0a');var _0x50d116={'credentials':{'private_key':_0x2b2701,'client_email':_0x5c8927}};var _0x1ea890=new dialogflow[(_0x6d91('0x63'))](_0x50d116);var _0x375143=_0x1ea890['sessionPath'](_0x4a61df,md5(_0x33fe26));var _0x91ca67={'session':_0x375143,'queryInput':{'text':{'text':_0x55378b,'languageCode':_0x26b088}}};return _0x1ea890[_0x6d91('0x64')](_0x91ca67)['then'](function(_0x1d4073){if(_0x1d4073&&_0x1d4073['length']){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x6d91('0x41')](_0x1d4073));var _0x458f9f=_0x1d4073[0x0];if(_0x458f9f){var _0x102199={'action':_0x458f9f[_0x6d91('0x65')]['action'],'allRequiredParamsPresent':_0x458f9f['queryResult'][_0x6d91('0x66')],'endConversation':_0x458f9f[_0x6d91('0x65')][_0x6d91('0x67')]&&_0x458f9f[_0x6d91('0x65')][_0x6d91('0x67')][_0x6d91('0x68')]?_0x458f9f[_0x6d91('0x65')][_0x6d91('0x67')][_0x6d91('0x68')]['end_conversation'][_0x6d91('0x69')]:![],'fulfillmentText':_0x458f9f['queryResult'][_0x6d91('0x6a')],'intentName':_0x458f9f[_0x6d91('0x65')]['intent'][_0x6d91('0x6b')],'intentDisplayName':_0x458f9f[_0x6d91('0x65')]['intent']['displayName'],'isFallbackIntent':_0x458f9f[_0x6d91('0x65')]['intent'][_0x6d91('0x6c')],'languageCode':_0x458f9f['queryResult'][_0x6d91('0x6d')],'queryText':_0x458f9f[_0x6d91('0x65')][_0x6d91('0x6e')],'responseId':_0x458f9f[_0x6d91('0x6f')],'score':_0x458f9f[_0x6d91('0x65')][_0x6d91('0x70')],'speech':_0x458f9f['queryResult'][_0x6d91('0x6a')],'providerResponse':JSON[_0x6d91('0x41')](_0x1d4073)};return _0x102199;}}});};exports[_0x6d91('0x71')]=function(_0x5eab5d,_0x422afb,_0x50c9d2,_0x7e6987){return tilde['asr'](_0x5eab5d,_0x422afb,_0x50c9d2,_0x7e6987)[_0x6d91('0x36')](function(_0x4f1c6f){try{fs['unlink'](_0x5eab5d);}catch(_0x32e95d){logger['error'](_0x32e95d);}logger['info']('Tilde\x20ASR\x20transcription',_0x4f1c6f[_0x6d91('0x50')]);logger[_0x6d91('0x1b')](_0x6d91('0x72'),_0x4f1c6f['confidence']);return _0x4f1c6f;});};exports[_0x6d91('0x73')]=function(_0x509b1d,_0xa4632f,_0x48ee38,_0xbe2170,_0x102e99,_0x5786b8){var _0x350200=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs['generate'](0x4)+_0x6d91('0x37'));var _0x4f001d;return aws[_0x6d91('0x74')](_0x509b1d,_0xa4632f,_0x48ee38,_0xbe2170,_0x102e99,_0x5786b8,_0x350200)[_0x6d91('0x36')](function(){_0x4f001d=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x350200,_0x4f001d);})[_0x6d91('0x36')](function(){try{fs[_0x6d91('0x1e')](_0x350200);fs['chmodSync'](_0x4f001d,_0x6d91('0x3b'));}catch(_0x5f38e9){logger[_0x6d91('0x16')](_0x5f38e9);}return _0x4f001d[_0x6d91('0x3d')]('.')[0x0];});};exports['awsLex']=function(_0xe6b2de,_0x5e6a6c,_0xc75a1a,_0x23a6ed,_0x29146f,_0x5a414c){return aws['lex'](_0xe6b2de,_0x5e6a6c,_0xc75a1a,_0x23a6ed,_0x29146f,_0x5a414c)[_0x6d91('0x36')](function(_0x1efb9d){logger['info'](JSON[_0x6d91('0x41')](_0x1efb9d));return _0x1efb9d;});};exports['ispeechTTS']=function(_0x2683ca,_0x3e9859,_0x2e330f,_0x2e9a8c){var _0x4e4670=util['format'](_0x6d91('0x75'),ISPEECH_API,_0x2683ca,encodeURIComponent(_0x3e9859),_0x2e330f,_0x2e9a8c);var _0x3fd692=path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x37'));var _0x50c9fd;return downloadFile(_0x4e4670,_0x3fd692)[_0x6d91('0x36')](function(){_0x50c9fd=path['resolve'](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+_0x6d91('0x3c'));return convertFile(_0x3fd692,_0x50c9fd);})[_0x6d91('0x36')](function(){try{fs[_0x6d91('0x1e')](_0x3fd692);fs[_0x6d91('0x49')](_0x50c9fd,_0x6d91('0x3b'));}catch(_0x58252f){logger[_0x6d91('0x16')](_0x58252f);}return _0x50c9fd['split']('.')[0x0];});};exports['ispeechASR']=function(_0x15eaa1,_0x5d7730,_0x9036,_0xcf2c43){var _0x47b02a=util['format'](_0x6d91('0x76'),ISPEECH_API,_0x5d7730,_0x9036,base64Encode(_0x15eaa1),_0xcf2c43?util[_0x6d91('0x77')]('model=%s',encodeURIComponent(_0xcf2c43)):'freeform=3');return uploadFile(_0x47b02a)[_0x6d91('0x36')](function(_0x2880d0){return querystring[_0x6d91('0x78')](_0x2880d0);});};exports[_0x6d91('0x79')]=function(_0x171395,_0x264eff){return sestek[_0x6d91('0x7a')](_0x171395,_0x264eff)[_0x6d91('0x36')](function(_0x2f7cda){logger[_0x6d91('0x1b')](JSON[_0x6d91('0x41')](_0x2f7cda));var _0xa904e2={'speech':_0x2f7cda[_0x6d91('0x7b')],'action':_0x2f7cda['channelData']?_0x2f7cda[_0x6d91('0x7c')]['CustomAction']:undefined,'actiondata':_0x2f7cda[_0x6d91('0x7c')]?_0x2f7cda[_0x6d91('0x7c')][_0x6d91('0x7d')]:undefined};if(_0x2f7cda[_0x6d91('0x7c')]&&_0x2f7cda['channelData'][_0x6d91('0x7e')]){return base64Decode(_0x2f7cda[_0x6d91('0x7c')][_0x6d91('0x7e')][_0x6d91('0x7f')],path[_0x6d91('0x27')](__dirname,_0x6d91('0x28'),rs[_0x6d91('0x29')](0x4)+'.wav'))[_0x6d91('0x36')](function(_0x2a2aa0){_0xa904e2[_0x6d91('0x80')]=_0x2a2aa0;return _0xa904e2;});}return _0xa904e2;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index a572ceb..296f137 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b71=['./nda'];(function(_0x22f82a,_0x36ea1d){var _0x3abd49=function(_0x37d935){while(--_0x37d935){_0x22f82a['push'](_0x22f82a['shift']());}};_0x3abd49(++_0x36ea1d);}(_0x1b71,0x103));var _0x11b7=function(_0x515e9e,_0x49f16b){_0x515e9e=_0x515e9e-0x0;var _0x33ed42=_0x1b71[_0x515e9e];return _0x33ed42;};var nda=require(_0x11b7('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
+var _0x6d34=['./nda'];(function(_0x44d3f3,_0x9d29eb){var _0x33c0a1=function(_0x14e5ee){while(--_0x14e5ee){_0x44d3f3['push'](_0x44d3f3['shift']());}};_0x33c0a1(++_0x9d29eb);}(_0x6d34,0x151));var _0x46d3=function(_0x5caeb8,_0x2b70ce){_0x5caeb8=_0x5caeb8-0x0;var _0x2c99ef=_0x6d34[_0x5caeb8];return _0x2c99ef;};var nda=require(_0x46d3('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index 42585ca..75309eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c50=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','text','access_token','project','body','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','channelData','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username'];(function(_0x4fb6c1,_0x1fcc9a){var _0x5f413b=function(_0x1e83c2){while(--_0x1e83c2){_0x4fb6c1['push'](_0x4fb6c1['shift']());}};_0x5f413b(++_0x1fcc9a);}(_0x6c50,0xa4));var _0x06c5=function(_0x25fd9f,_0x171c78){_0x25fd9f=_0x25fd9f-0x0;var _0x425e8c=_0x6c50[_0x25fd9f];return _0x425e8c;};'use strict';var rp=require(_0x06c5('0x0'));var url=require(_0x06c5('0x1'));var logger=require(_0x06c5('0x2'))(_0x06c5('0x3'));module['exports']=function(_0xd66539,_0x494494){var _0x4271d1={'method':_0x06c5('0x4'),'uri':url[_0x06c5('0x5')](_0x494494[_0x06c5('0x6')],_0x06c5('0x7')),'form':{'grant_type':_0x06c5('0x8'),'username':_0x494494[_0x06c5('0x9')],'password':_0x494494[_0x06c5('0x8')]},'json':!![]};return rp(_0x4271d1)[_0x06c5('0xa')](function(_0x17c636){var _0x154b0a={'method':'POST','uri':url[_0x06c5('0x5')](_0x494494[_0x06c5('0xb')],_0x06c5('0xc')),'body':{'type':_0x494494[_0x06c5('0xd')]||'message','channelId':'Nda','conversation':{'id':_0xd66539['uniqueid']},'from':{'id':_0xd66539[_0x06c5('0xe')],'name':_0xd66539['calleridname']},'recipient':{'id':_0xd66539['dnid'],'name':_0xd66539['extension']},'text':_0x494494[_0x06c5('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x17c636[_0x06c5('0x10')]},'json':!![]};if(_0x494494[_0x06c5('0x11')]){_0x154b0a[_0x06c5('0x12')]['channelData'][_0x06c5('0x13')]=_0x494494[_0x06c5('0x11')];}if(_0x494494[_0x06c5('0x14')]=='1'){_0x154b0a[_0x06c5('0x12')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x06c5('0x15')};}if(_0x494494[_0x06c5('0x16')]){_0x154b0a[_0x06c5('0x12')]['channelData'][_0x06c5('0x17')]=_0x494494[_0x06c5('0x16')];if(_0x494494['custom_action_data']){_0x154b0a[_0x06c5('0x12')][_0x06c5('0x18')][_0x06c5('0x19')]=_0x494494[_0x06c5('0x1a')];}}logger[_0x06c5('0x1b')](JSON[_0x06c5('0x1c')](_0x154b0a));return rp(_0x154b0a);});};
\ No newline at end of file
+var _0xcd60=['info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData'];(function(_0x583ed9,_0x1edd2b){var _0x4f9bd2=function(_0x4d7a62){while(--_0x4d7a62){_0x583ed9['push'](_0x583ed9['shift']());}};_0x4f9bd2(++_0x1edd2b);}(_0xcd60,0xf0));var _0x0cd6=function(_0x280c72,_0x3c5e34){_0x280c72=_0x280c72-0x0;var _0x1d265e=_0xcd60[_0x280c72];return _0x1d265e;};'use strict';var rp=require(_0x0cd6('0x0'));var url=require(_0x0cd6('0x1'));var logger=require(_0x0cd6('0x2'))(_0x0cd6('0x3'));module[_0x0cd6('0x4')]=function(_0x455593,_0x155444){var _0x498fbe={'method':_0x0cd6('0x5'),'uri':url[_0x0cd6('0x6')](_0x155444[_0x0cd6('0x7')],_0x0cd6('0x8')),'form':{'grant_type':_0x0cd6('0x9'),'username':_0x155444['username'],'password':_0x155444[_0x0cd6('0x9')]},'json':!![]};return rp(_0x498fbe)[_0x0cd6('0xa')](function(_0x47c8b2){var _0x4714bf={'method':'POST','uri':url[_0x0cd6('0x6')](_0x155444[_0x0cd6('0xb')],_0x0cd6('0xc')),'body':{'type':_0x155444[_0x0cd6('0xd')]||_0x0cd6('0xe'),'channelId':'Nda','conversation':{'id':_0x455593[_0x0cd6('0xf')]},'from':{'id':_0x455593[_0x0cd6('0x10')],'name':_0x455593[_0x0cd6('0x11')]},'recipient':{'id':_0x455593[_0x0cd6('0x12')],'name':_0x455593[_0x0cd6('0x13')]},'text':_0x155444['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x47c8b2[_0x0cd6('0x14')]},'json':!![]};if(_0x155444[_0x0cd6('0x15')]){_0x4714bf[_0x0cd6('0x16')]['channelData'][_0x0cd6('0x17')]=_0x155444['project'];}if(_0x155444[_0x0cd6('0x18')]=='1'){_0x4714bf[_0x0cd6('0x16')][_0x0cd6('0x19')][_0x0cd6('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0cd6('0x1b')};}if(_0x155444[_0x0cd6('0x1c')]){_0x4714bf[_0x0cd6('0x16')][_0x0cd6('0x19')][_0x0cd6('0x1d')]=_0x155444[_0x0cd6('0x1c')];if(_0x155444[_0x0cd6('0x1e')]){_0x4714bf[_0x0cd6('0x16')][_0x0cd6('0x19')][_0x0cd6('0x1f')]=_0x155444['custom_action_data'];}}logger[_0x0cd6('0x20')](JSON[_0x0cd6('0x21')](_0x4714bf));return rp(_0x4714bf);});};
\ No newline at end of file
index 2e18a31..6af7a63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe26f=['./lib/api','exports'];(function(_0x231e58,_0x4fda70){var _0x3549b7=function(_0x3fd24b){while(--_0x3fd24b){_0x231e58['push'](_0x231e58['shift']());}};_0x3549b7(++_0x4fda70);}(_0xe26f,0x13c));var _0xfe26=function(_0x25af7a,_0x42e51e){_0x25af7a=_0x25af7a-0x0;var _0x411661=_0xe26f[_0x25af7a];return _0x411661;};'use strict';var asr=require(_0xfe26('0x0'));module[_0xfe26('0x1')]=function(_0x209f26,_0x20ac94,_0x56390c,_0xd9c94e){return asr(_0x209f26,_0x20ac94,_0x56390c,_0xd9c94e);};
\ No newline at end of file
+'use strict';var asr=require('./lib/api');module['exports']=function(_0x2e0d7a,_0x58ec52,_0xee5183,_0x50499d){return asr(_0x2e0d7a,_0x58ec52,_0xee5183,_0x50499d);};
\ No newline at end of file
index 286c3aa..ae23b74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82bc=['status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse'];(function(_0x4bb722,_0x1db86e){var _0x407977=function(_0xe856ab){while(--_0xe856ab){_0x4bb722['push'](_0x4bb722['shift']());}};_0x407977(++_0x1db86e);}(_0x82bc,0x181));var _0xc82b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x82bc[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc82b('0x0'));var crypto=require(_0xc82b('0x1'));var logger=require(_0xc82b('0x2'))(_0xc82b('0x3'));module[_0xc82b('0x4')]=function(_0x19033e,_0x3767ba,_0x5c7022,_0x547ac1){return new BPromise(function(_0x61dae3,_0x58ffdb){logger[_0xc82b('0x5')](_0xc82b('0x6'),_0x547ac1||_0xc82b('0x7'));var _0x2be40f=new WebSocket(_0x547ac1||_0xc82b('0x7'),{'perMessageDeflate':![]});var _0x2aa7e4='';var _0x4821ef='0';var _0x556712='1';var _0x4ae766=_0xc82b('0x8');function _0x11b16f(_0x203590){var _0x30205d=crypto[_0xc82b('0x9')](_0xc82b('0xa'));_0x30205d[_0xc82b('0xb')](_0x203590);return _0x30205d[_0xc82b('0xc')](_0xc82b('0xd'));}function _0x418afa(){try{logger[_0xc82b('0x5')](_0xc82b('0xe'));var _0x3dc17f=moment()[_0xc82b('0xf')]();var _0x1d2d87=_0x11b16f(_0x3dc17f+_0x3767ba+_0x5c7022);_0x2be40f[_0xc82b('0x10')](JSON[_0xc82b('0x11')]({'appID':_0x3767ba,'timestamp':_0x3dc17f,'appKey':_0x1d2d87}));var _0x26826f=fs[_0xc82b('0x12')](_0x19033e);_0x26826f['on'](_0xc82b('0x13'),function(_0x20f545){_0x2be40f[_0xc82b('0x10')](_0x20f545);});_0x26826f['on']('close',function(){_0x2be40f[_0xc82b('0x10')](_0xc82b('0x14'));});}catch(_0x33110b){logger[_0xc82b('0x15')](_0xc82b('0x16'),JSON[_0xc82b('0x11')](_0x33110b));_0x2be40f[_0xc82b('0x17')]();}}function _0x568e6b(_0x4e4f0f){try{if(_0x4e4f0f){var _0x4a3bb2=JSON[_0xc82b('0x18')](_0x4e4f0f);switch(_0x4a3bb2[_0xc82b('0x19')]){case 0x0:if(_0x4a3bb2[_0xc82b('0x1a')]){if(_0x4a3bb2[_0xc82b('0x1a')][_0xc82b('0x1b')]){logger['info'](_0xc82b('0x1c'),JSON[_0xc82b('0x11')](_0x4a3bb2[_0xc82b('0x1a')][_0xc82b('0x1d')]));_0x2aa7e4=_0x4a3bb2[_0xc82b('0x1a')][_0xc82b('0x1d')][0x0][_0xc82b('0x1e')];_0x4821ef=_0x4a3bb2[_0xc82b('0x1a')][_0xc82b('0x1d')][0x0][_0xc82b('0x1f')];_0x556712='0';_0x4ae766='Success.';_0x2be40f[_0xc82b('0x17')]();}}break;case 0x1:logger[_0xc82b('0x5')](_0xc82b('0x8'));_0x556712='1';_0x4ae766=_0xc82b('0x8');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x556712='2';_0x4ae766=_0xc82b('0x20');break;case 0x9:logger[_0xc82b('0x5')](_0xc82b('0x21'));_0x556712='9';_0x4ae766=_0xc82b('0x21');break;case 0xa:logger[_0xc82b('0x5')]('Authentication\x20failed.');_0x556712='10';_0x4ae766=_0xc82b('0x22');break;case 0xb:logger[_0xc82b('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x556712='11';_0x4ae766='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x78aeea){logger[_0xc82b('0x15')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xc82b('0x11')](_0x78aeea));_0x2be40f[_0xc82b('0x17')]();}}function _0x132002(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x61dae3({'transcript':_0x2aa7e4,'confidence':_0x4821ef,'status':_0x556712,'status_message':_0x4ae766});}function _0x72fbbe(_0x482c9f){logger[_0xc82b('0x15')](_0xc82b('0x23'));if(!_[_0xc82b('0x24')](_0x482c9f)){logger[_0xc82b('0x15')](_[_0xc82b('0x25')](_0x482c9f)?JSON['stringify'](_0x482c9f):_0x482c9f);}}_0x2be40f['on'](_0xc82b('0x26'),_0x418afa);_0x2be40f['on'](_0xc82b('0x27'),_0x568e6b);_0x2be40f['on'](_0xc82b('0x28'),_0x132002);_0x2be40f['on'](_0xc82b('0x15'),_0x72fbbe);});};
\ No newline at end of file
+var _0x6b38=['unix','send','stringify','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','result','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','message','bluebird','lodash','moment','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket'];(function(_0x1e7fcb,_0x15562b){var _0xed577e=function(_0x2db6d7){while(--_0x2db6d7){_0x1e7fcb['push'](_0x1e7fcb['shift']());}};_0xed577e(++_0x15562b);}(_0x6b38,0x8f));var _0x86b3=function(_0xa6ae78,_0x3aad08){_0xa6ae78=_0xa6ae78-0x0;var _0x371a58=_0x6b38[_0xa6ae78];return _0x371a58;};'use strict';var BPromise=require(_0x86b3('0x0'));var _=require(_0x86b3('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x86b3('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x86b3('0x3'));module[_0x86b3('0x4')]=function(_0x3b6786,_0xf80a9c,_0x1c947f,_0x3abd8f){return new BPromise(function(_0x1cb140,_0x23a3fb){logger[_0x86b3('0x5')](_0x86b3('0x6'),_0x3abd8f||_0x86b3('0x7'));var _0x29ee56=new WebSocket(_0x3abd8f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x172f1f='';var _0x4d17d7='0';var _0x1b3907='1';var _0x2d6e30=_0x86b3('0x8');function _0x49ea0d(_0x22b32e){var _0xa35f48=crypto['createHash'](_0x86b3('0x9'));_0xa35f48[_0x86b3('0xa')](_0x22b32e);return _0xa35f48[_0x86b3('0xb')]('hex');}function _0x30d82e(){try{logger['info'](_0x86b3('0xc'));var _0x1bb9a2=moment()[_0x86b3('0xd')]();var _0xf7f053=_0x49ea0d(_0x1bb9a2+_0xf80a9c+_0x1c947f);_0x29ee56[_0x86b3('0xe')](JSON[_0x86b3('0xf')]({'appID':_0xf80a9c,'timestamp':_0x1bb9a2,'appKey':_0xf7f053}));var _0x3c1f14=fs[_0x86b3('0x10')](_0x3b6786);_0x3c1f14['on'](_0x86b3('0x11'),function(_0x5c13fe){_0x29ee56[_0x86b3('0xe')](_0x5c13fe);});_0x3c1f14['on'](_0x86b3('0x12'),function(){_0x29ee56['send']('EOS');});}catch(_0x215f8d){logger[_0x86b3('0x13')](_0x86b3('0x14'),JSON[_0x86b3('0xf')](_0x215f8d));_0x29ee56[_0x86b3('0x15')]();}}function _0x16fc1a(_0x44773d){try{if(_0x44773d){var _0x52a1bd=JSON[_0x86b3('0x16')](_0x44773d);switch(_0x52a1bd[_0x86b3('0x17')]){case 0x0:if(_0x52a1bd['result']){if(_0x52a1bd['result'][_0x86b3('0x18')]){logger['info'](_0x86b3('0x19'),JSON[_0x86b3('0xf')](_0x52a1bd['result'][_0x86b3('0x1a')]));_0x172f1f=_0x52a1bd['result']['hypotheses'][0x0][_0x86b3('0x1b')];_0x4d17d7=_0x52a1bd[_0x86b3('0x1c')][_0x86b3('0x1a')][0x0][_0x86b3('0x1d')];_0x1b3907='0';_0x2d6e30=_0x86b3('0x1e');_0x29ee56[_0x86b3('0x15')]();}}break;case 0x1:logger[_0x86b3('0x5')](_0x86b3('0x8'));_0x1b3907='1';_0x2d6e30=_0x86b3('0x8');break;case 0x2:logger[_0x86b3('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x1b3907='2';_0x2d6e30=_0x86b3('0x1f');break;case 0x9:logger[_0x86b3('0x5')](_0x86b3('0x20'));_0x1b3907='9';_0x2d6e30=_0x86b3('0x20');break;case 0xa:logger[_0x86b3('0x5')](_0x86b3('0x21'));_0x1b3907='10';_0x2d6e30=_0x86b3('0x21');break;case 0xb:logger[_0x86b3('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1b3907='11';_0x2d6e30=_0x86b3('0x22');}}}catch(_0x4594a1){logger[_0x86b3('0x13')](_0x86b3('0x23'),JSON['stringify'](_0x4594a1));_0x29ee56['terminate']();}}function _0xb68f19(){logger[_0x86b3('0x5')](_0x86b3('0x24'));_0x1cb140({'transcript':_0x172f1f,'confidence':_0x4d17d7,'status':_0x1b3907,'status_message':_0x2d6e30});}function _0x38ae08(_0x316859){logger[_0x86b3('0x13')](_0x86b3('0x25'));if(!_['isNil'](_0x316859)){logger[_0x86b3('0x13')](_['isObject'](_0x316859)?JSON[_0x86b3('0xf')](_0x316859):_0x316859);}}_0x29ee56['on']('open',_0x30d82e);_0x29ee56['on'](_0x86b3('0x26'),_0x16fc1a);_0x29ee56['on'](_0x86b3('0x12'),_0xb68f19);_0x29ee56['on'](_0x86b3('0x13'),_0x38ae08);});};
\ No newline at end of file
index 684e887..1183f96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e22=['exports','./asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e22,0x151));var _0x23e2=function(_0x362ce4,_0x5cfa56){_0x362ce4=_0x362ce4-0x0;var _0x18dcb0=_0x3e22[_0x362ce4];return _0x18dcb0;};var asr=require(_0x23e2('0x0'));module[_0x23e2('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x5adf=['./asr'];(function(_0x1a29b5,_0x2cc4c9){var _0xc8b6d2=function(_0x17d574){while(--_0x17d574){_0x1a29b5['push'](_0x1a29b5['shift']());}};_0xc8b6d2(++_0x2cc4c9);}(_0x5adf,0x146));var _0xf5ad=function(_0x28a2bd,_0x23dd76){_0x28a2bd=_0x28a2bd-0x0;var _0x4f3a8e=_0x5adf[_0x28a2bd];return _0x4f3a8e;};var asr=require(_0xf5ad('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 1807005..9d7a1e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac38=['E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','call','emit','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','error'];(function(_0x14c121,_0x11894d){var _0x4724b0=function(_0x3663bb){while(--_0x3663bb){_0x14c121['push'](_0x14c121['shift']());}};_0x4724b0(++_0x11894d);}(_0xac38,0x1be));var _0x8ac3=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0xac38[_0x2125f0];return _0x12d6eb;};'use strict';var util=require(_0x8ac3('0x0'));var net=require(_0x8ac3('0x1'));var EventEmitter=require(_0x8ac3('0x2'))[_0x8ac3('0x3')];var AGIError=require(_0x8ac3('0x4'));var AGIChannel=require(_0x8ac3('0x5'));var AGIServer=function(_0x2eb547,_0x50e469,_0x578ae5){var _0x595fbf=this,_0x2eb547=_0x2eb547||0x11dd,_0x50e469=_0x50e469||'127.0.0.1',_0x405b8c=null,_0xca728f=0x0;EventEmitter[_0x8ac3('0x6')](_0x595fbf);function _0x3d9a12(){if(!_0x2eb547){_0x595fbf[_0x8ac3('0x7')]('error',new AGIError(_0x8ac3('0x8')));return![];}_0x405b8c=net['createServer']();_0x405b8c[_0x8ac3('0x9')](_0x2eb547,_0x50e469);_0x405b8c['on']('listening',function(){_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0xa'));});_0x405b8c['on'](_0x8ac3('0xb'),function(_0x400f80){_0x405b8c[_0x8ac3('0xc')](function(_0x54444d,_0x1685f6){if(_0x54444d){_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0xd'),new AGIError(_0x8ac3('0xe'),_0x54444d));}else if(_0x578ae5&&_0x578ae5<0x0){_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x400f80[_0x8ac3('0xf')]();}else if(_0x578ae5&&_0x578ae5>0x0&&_0x578ae5<_0x1685f6){_0xca728f+=0x1;_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0xd'),new AGIError(_0x8ac3('0x10'),_0xca728f));_0x400f80[_0x8ac3('0xf')]();}else{var _0x123850=new AGIChannel(_0x400f80);_0x123850['on']('ready',function(){_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0xb'),_0x123850);});}});});_0x405b8c['on']('error',function(_0x40fe92){_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0xd'),new AGIError(_0x8ac3('0xe'),_0x40fe92[_0x8ac3('0x11')]));});_0x405b8c['on'](_0x8ac3('0x12'),function(){_0x595fbf[_0x8ac3('0x7')](_0x8ac3('0x12'),new AGIError(_0x8ac3('0x13')));});}process[_0x8ac3('0x14')](function(){_0x3d9a12();});};util[_0x8ac3('0x15')](AGIServer,EventEmitter);module[_0x8ac3('0x16')]=function(_0x511693,_0x56abc2,_0x458f81){return new AGIServer(_0x511693,_0x56abc2,_0x458f81);};
\ No newline at end of file
+var _0x3c68=['error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_MAXCONNECTION','destroy','ready','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','events','EventEmitter','./channel','call','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3c68,0x1c1));var _0x83c6=function(_0x5b0ac7,_0x261372){_0x5b0ac7=_0x5b0ac7-0x0;var _0x377c33=_0x3c68[_0x5b0ac7];return _0x377c33;};'use strict';var util=require(_0x83c6('0x0'));var net=require(_0x83c6('0x1'));var EventEmitter=require(_0x83c6('0x2'))[_0x83c6('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x83c6('0x4'));var AGIServer=function(_0x3f9d08,_0x4f8c01,_0x4ead42){var _0x5e9a2d=this,_0x3f9d08=_0x3f9d08||0x11dd,_0x4f8c01=_0x4f8c01||'127.0.0.1',_0x8290d5=null,_0x180967=0x0;EventEmitter[_0x83c6('0x5')](_0x5e9a2d);function _0x548fc7(){if(!_0x3f9d08){_0x5e9a2d[_0x83c6('0x6')](_0x83c6('0x7'),new AGIError(_0x83c6('0x8')));return![];}_0x8290d5=net[_0x83c6('0x9')]();_0x8290d5['listen'](_0x3f9d08,_0x4f8c01);_0x8290d5['on']('listening',function(){_0x5e9a2d[_0x83c6('0x6')](_0x83c6('0xa'));});_0x8290d5['on'](_0x83c6('0xb'),function(_0x1b7a6f){_0x8290d5[_0x83c6('0xc')](function(_0x2ff448,_0x1cb2b1){if(_0x2ff448){_0x5e9a2d[_0x83c6('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x2ff448));}else if(_0x4ead42&&_0x4ead42<0x0){_0x5e9a2d[_0x83c6('0x6')](_0x83c6('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1b7a6f['destroy']();}else if(_0x4ead42&&_0x4ead42>0x0&&_0x4ead42<_0x1cb2b1){_0x180967+=0x1;_0x5e9a2d['emit'](_0x83c6('0x7'),new AGIError(_0x83c6('0xd'),_0x180967));_0x1b7a6f[_0x83c6('0xe')]();}else{var _0x31ed9f=new AGIChannel(_0x1b7a6f);_0x31ed9f['on'](_0x83c6('0xf'),function(){_0x5e9a2d['emit'](_0x83c6('0xb'),_0x31ed9f);});}});});_0x8290d5['on'](_0x83c6('0x7'),function(_0x14d1d8){_0x5e9a2d['emit'](_0x83c6('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x14d1d8['code']));});_0x8290d5['on']('close',function(){_0x5e9a2d[_0x83c6('0x6')]('close',new AGIError(_0x83c6('0x10')));});}process[_0x83c6('0x11')](function(){_0x548fc7();});};util[_0x83c6('0x12')](AGIServer,EventEmitter);module['exports']=function(_0x46129a,_0xb61a3b,_0xf46e40){return new AGIServer(_0x46129a,_0xb61a3b,_0xf46e40);};
\ No newline at end of file
index 464dd85..e06c250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd64=['rpc','mailRpc','prototype','getVariable','getVariableById','then','getVoiceQueue','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','trim','googleCloudTTS','apiKey','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','timeout','includes','POST','PUT','method','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','isString','saveRestApiResult','%s.%s','length','setVariable','stringify','replaceAllVariables','split','replaceAll','extra','maxRetry','retry','mrcpsynth','isConfigured','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','grammar','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','toUpperCase','out','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','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','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20variable\x20selected\x20for\x20the\x20result','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','no\x20appsecret\x20configured','wav','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','no\x20condition\x20configured','condition','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','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','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','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','replace','saynumber','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','lodash','shelljs','odbc','mustache','request-promise','../../config/logger','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','channel'];(function(_0x5765bb,_0x45998c){var _0x452a60=function(_0x23d107){while(--_0x23d107){_0x5765bb['push'](_0x5765bb['shift']());}};_0x452a60(++_0x45998c);}(_0xbd64,0x1cf));var _0x4bd6=function(_0x2294ab,_0x25fe1d){_0x2294ab=_0x2294ab-0x0;var _0x3b93a3=_0xbd64[_0x2294ab];return _0x3b93a3;};'use strict';var fs=require('fs');var path=require(_0x4bd6('0x0'));var util=require('util');var _=require(_0x4bd6('0x1'));var sh=require(_0x4bd6('0x2'));var odbc=require(_0x4bd6('0x3'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0x4bd6('0x4'));var rp=require(_0x4bd6('0x5'));var logger=require(_0x4bd6('0x6'))('agi');var config=require(_0x4bd6('0x7'));var scripts=require(_0x4bd6('0x8'));var FILES_PATH=_0x4bd6('0x9');var recursiveMapAttributes=[_0x4bd6('0xa'),_0x4bd6('0xb')];var verticesWithRetry=[_0x4bd6('0xc'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x3885d2,_0x711c8b,_0x591b94){this[_0x4bd6('0xd')]=_0x3885d2;this[_0x4bd6('0xe')]=_0x711c8b;this[_0x4bd6('0xf')]=_0x591b94;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x11')]=function(_0x5596ae,_0x330f90){this[_0x4bd6('0xe')][_0x4bd6('0x12')](_0x5596ae)[_0x4bd6('0x13')](function(_0x50c2c6){_0x330f90(null,_0x50c2c6?_0x50c2c6['name']:![]);})['catch'](function(_0x5e110a){_0x330f90(_0x5e110a);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x14')]=function(_0x29d403,_0x2e9279){this['rpc']['getVoiceQueueById'](_0x29d403)[_0x4bd6('0x13')](function(_0x44c73a){_0x2e9279(null,_0x44c73a?_0x44c73a[_0x4bd6('0x15')]:![]);})[_0x4bd6('0x16')](function(_0x55f9fc){_0x2e9279(_0x55f9fc);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x17')]=function(_0x2158fc,_0x2d64a2){this[_0x4bd6('0xe')][_0x4bd6('0x18')](_0x2158fc)[_0x4bd6('0x13')](function(_0x429e7f){_0x2d64a2(null,_0x429e7f?_0x429e7f[_0x4bd6('0x15')]:![]);})['catch'](function(_0x2a5d6b){_0x2d64a2(_0x2a5d6b);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x19')]=function(_0x45ea6d,_0x27feba){this['rpc'][_0x4bd6('0x1a')](_0x45ea6d)[_0x4bd6('0x13')](function(_0x59dce8){_0x27feba(null,_0x59dce8?_0x59dce8[_0x4bd6('0x1b')]:![]);})[_0x4bd6('0x16')](function(_0x1e89e0){_0x27feba(_0x1e89e0);});};AGIVertices['prototype'][_0x4bd6('0x1c')]=function(_0x4debaf,_0x465fa0){this[_0x4bd6('0xe')]['getUserById'](_0x4debaf)[_0x4bd6('0x13')](function(_0x437473){_0x465fa0(null,_0x437473?_0x437473['name']:![]);})[_0x4bd6('0x16')](function(_0x5416a0){_0x465fa0(_0x5416a0);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1d')]=function(_0x1183ab,_0x5b7334){this[_0x4bd6('0xe')][_0x4bd6('0x1e')](_0x1183ab)[_0x4bd6('0x13')](function(_0x2a05d9){_0x5b7334(null,_0x2a05d9?_0x2a05d9[_0x4bd6('0x15')]:![]);})['catch'](function(_0x2a6347){_0x5b7334(_0x2a6347);});};AGIVertices[_0x4bd6('0x10')]['getSound']=function(_0x52fc07,_0x364def){var _0x31df3d=this;this[_0x4bd6('0xe')][_0x4bd6('0x1f')](_0x52fc07)[_0x4bd6('0x13')](function(_0x92edec){_0x364def(null,_0x92edec?_0x31df3d[_0x4bd6('0x20')](_0x92edec[_0x4bd6('0x21')]):![]);})[_0x4bd6('0x16')](function(_0x227eb7){_0x364def(_0x227eb7);});};AGIVertices['prototype'][_0x4bd6('0x22')]=function(_0x435151,_0x2a7b6b){this[_0x4bd6('0xe')][_0x4bd6('0x23')](_0x435151)['then'](function(_0x2e9c90){_0x2a7b6b(null,_0x2e9c90?_0x2e9c90:![]);})[_0x4bd6('0x16')](function(_0xa8da64){_0x2a7b6b(_0xa8da64);});};AGIVertices['prototype'][_0x4bd6('0x24')]=function(_0xc43ba7,_0x4e1328,_0x4d9f32){this['mailRpc'][_0x4bd6('0x24')](_0xc43ba7,_0x4e1328)['then'](function(){_0x4d9f32(null);})['catch'](function(_0x4943c8){_0x4d9f32(_0x4943c8);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x25')]=function(_0x32dd66,_0x30e31c){this['rpc'][_0x4bd6('0x26')](_0x32dd66)['then'](function(_0x200f98){if(_0x200f98){if(_0x200f98['IntervalId']){_0x30e31c(null,[_0x200f98[_0x4bd6('0x27')]]);}else{_0x30e31c(null,_[_0x4bd6('0x28')](_0x200f98[_0x4bd6('0x29')],_0x4bd6('0x27')));}}else{_0x30e31c(null,![]);}})[_0x4bd6('0x16')](function(_0x549cca){_0x30e31c(_0x549cca);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x20')]=function(_0x3a1f2f){return util['format'](_0x4bd6('0x2a'),FILES_PATH,_0x3a1f2f);};AGIVertices['prototype'][_0x4bd6('0x2b')]=function(_0x23dff1,_0x10a2b3,_0x30a4fc){odbc[_0x4bd6('0x2c')](_0x23dff1,function(_0x51941a){if(_0x51941a){logger[_0x4bd6('0x2d')](_0x4bd6('0x2e'),_0x51941a);_0x30a4fc(_0x51941a);}else{logger[_0x4bd6('0x2f')](_0x4bd6('0x30'));odbc[_0x4bd6('0x31')](_0x10a2b3,function(_0x5cde1e,_0xad12d3){if(_0x5cde1e){logger[_0x4bd6('0x2f')]('Error\x20executing\x20query\x20%s',_0x10a2b3);_0x30a4fc(_0x5cde1e);}else{logger['info'](_0x4bd6('0x32'),_0x10a2b3);odbc[_0x4bd6('0x33')](function(_0x231f3e){if(_0x231f3e){logger[_0x4bd6('0x2d')](_0x4bd6('0x34'),_0x231f3e);}_0x30a4fc(null,_0xad12d3);});}});}});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x35')]=function(_0x4d7734,_0x58e56b){this[_0x4bd6('0xe')][_0x4bd6('0x36')](_0x4d7734)[_0x4bd6('0x13')](function(_0x3b9cd7){_0x58e56b(null,_0x3b9cd7?_0x3b9cd7:![]);})['catch'](function(_0x1b4b8e){_0x58e56b(_0x1b4b8e);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x37')]=function(_0x151714,_0x3803e6){this[_0x4bd6('0xe')][_0x4bd6('0x37')](_0x151714)['then'](function(_0x1012ba){_0x3803e6(null,_0x1012ba);})[_0x4bd6('0x16')](function(_0x229885){_0x3803e6(_0x229885);});};AGIVertices['prototype'][_0x4bd6('0x38')]=function(_0x1ce57f,_0x3610ba,_0x329585){this[_0x4bd6('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x4bd6('0xd')][_0x4bd6('0x39')],'node':_0x1ce57f[_0x4bd6('0x3a')],'application':_0x1ce57f[_0x4bd6('0x3b')],'data':_0x3610ba||null,'project_name':this[_0x4bd6('0xd')][_0x4bd6('0x3c')],'callerid':this['channel'][_0x4bd6('0x3d')]})['then'](function(_0xee1a58){if(_0x329585){_0x329585(null,_0xee1a58);}})[_0x4bd6('0x16')](function(_0x33fe80){if(_0x329585){_0x329585(_0x33fe80);}});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x3e')]=function(_0x433dd9,_0x41e15c,_0x2bf7e8,_0x4c29f5){this[_0x4bd6('0xe')][_0x4bd6('0x3e')]({'uniqueid':this[_0x4bd6('0xd')]['uniqueid'],'callerid':this['channel'][_0x4bd6('0x3d')],'calleridname':this[_0x4bd6('0xd')][_0x4bd6('0x3f')],'context':this[_0x4bd6('0xd')][_0x4bd6('0x40')],'extension':this['channel']['extension'],'priority':this['channel'][_0x4bd6('0x41')],'accountcode':this[_0x4bd6('0xd')][_0x4bd6('0x42')],'dnid':this[_0x4bd6('0xd')][_0x4bd6('0x43')],'projectName':this[_0x4bd6('0xd')]['arg_1'],'saveName':_0x41e15c,'filename':_0x433dd9[_0x4bd6('0x44')]||_0x41e15c,'savePath':_0x2bf7e8})[_0x4bd6('0x13')](function(_0x2a0fa3){_0x4c29f5(null,_0x2a0fa3);})[_0x4bd6('0x16')](function(_0x245f16){_0x4c29f5(_0x245f16);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x45')]=function(_0x963211,_0x56208e,_0x562a45,_0x2ff762,_0x1aaa90){this[_0x4bd6('0xe')][_0x4bd6('0x45')]({'uniqueid':this[_0x4bd6('0xd')][_0x4bd6('0x39')],'body':_0x963211,'direction':_0x56208e,'providerName':_0x562a45,'providerResponse':_0x2ff762})[_0x4bd6('0x13')](function(_0x564ad9){if(_0x1aaa90){_0x1aaa90(null,_0x564ad9);}})[_0x4bd6('0x16')](function(_0x49a2a8){if(_0x1aaa90){_0x1aaa90(_0x49a2a8);}});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x46')]=function(_0x344186,_0x4b57fd){this[_0x4bd6('0xe')][_0x4bd6('0x46')]({'firstName':_['isEmpty'](_0x344186[_0x4bd6('0x15')])||_[_0x4bd6('0x47')](_0x344186['name'])?_0x4bd6('0x48')+Math[_0x4bd6('0x49')]():_0x344186[_0x4bd6('0x15')],'lastName':_[_0x4bd6('0x4a')](_0x344186[_0x4bd6('0x4b')])||_['isNil'](_0x344186[_0x4bd6('0x4b')])?null:_0x344186['lastName'],'phone':_0x344186['phone'],'ListId':_0x344186[_0x4bd6('0x4c')],'scheduledat':_0x344186[_0x4bd6('0x4d')],'callbackUniqueid':this[_0x4bd6('0xd')][_0x4bd6('0x39')],'tags':_0x4bd6('0x4e'),'description':_0x4bd6('0x4f')+_0x344186[_0x4bd6('0x4d')][_0x4bd6('0x50')](),'priority':_0x344186[_0x4bd6('0x51')]})['then'](function(_0x3e26ee){_0x4b57fd(null,_0x3e26ee);})[_0x4bd6('0x16')](function(_0x2c93b2){_0x4b57fd(_0x2c93b2);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x52')]=function(_0x4fdab9,_0x46fb35){this[_0x4bd6('0xe')][_0x4bd6('0x53')](_0x4fdab9)[_0x4bd6('0x13')](function(_0x26fa85){_0x46fb35(null,_0x26fa85?_0x26fa85[_0x4bd6('0x15')]:![]);})[_0x4bd6('0x16')](function(_0x25cecb){_0x46fb35(_0x25cecb);});};AGIVertices[_0x4bd6('0x10')]['agentPause']=function(_0x35f7c3,_0x3b8443,_0x3bb312){var _0x3e4207={'role':_0x4bd6('0x54')};_0x3e4207[_0x35f7c3]=this[_0x4bd6('0xd')][_0x4bd6('0x3d')];this[_0x4bd6('0xe')][_0x4bd6('0x55')](_0x3e4207,_0x3b8443,this[_0x4bd6('0xd')][_0x4bd6('0x39')])['then'](function(_0x12df8f){_0x3bb312(null,_[_0x4bd6('0x47')](_0x12df8f)?![]:!![]);})['catch'](function(_0x4f6381){logger[_0x4bd6('0x2d')](_0x4f6381);_0x3bb312(null,![]);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x56')]=function(_0x12bd1a,_0xb37118){var _0x4ba469={'role':_0x4bd6('0x54')};_0x4ba469[_0x12bd1a]=this[_0x4bd6('0xd')]['callerid'];this[_0x4bd6('0xe')]['agentUnpause'](_0x4ba469)[_0x4bd6('0x13')](function(_0x3892ca){_0xb37118(null,_[_0x4bd6('0x47')](_0x3892ca)?![]:!![]);})[_0x4bd6('0x16')](function(_0x3a97ce){logger[_0x4bd6('0x2d')](_0x3a97ce);_0xb37118(null,![]);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x57')]=function(_0x3971e3,_0x3483c0){var _0x188360={'role':_0x4bd6('0x54')};_0x188360[_0x3971e3]=this[_0x4bd6('0xd')][_0x4bd6('0x3d')];this[_0x4bd6('0xe')][_0x4bd6('0x57')](_0x188360)[_0x4bd6('0x13')](function(_0x3bcc25){_0x3483c0(null,_['isNil'](_0x3bcc25)?![]:!![]);})['catch'](function(_0x23d62a){logger[_0x4bd6('0x2d')](_0x23d62a);_0x3483c0(null,![]);});};AGIVertices['prototype'][_0x4bd6('0x58')]=function(_0x38edf1,_0x25fe8f){var _0x2f82e3={'role':'agent'};_0x2f82e3[_0x38edf1]=this[_0x4bd6('0xd')][_0x4bd6('0x3d')];var _0x188c8c=_0x38edf1!=_0x4bd6('0x59')?util[_0x4bd6('0x5a')](_0x4bd6('0x5b'),_0x4bd6('0x5c'),this[_0x4bd6('0xd')]['callerid']):undefined;this['rpc'][_0x4bd6('0x58')](_0x2f82e3,_0x188c8c)['then'](function(_0x4c8d06){_0x25fe8f(null,_[_0x4bd6('0x47')](_0x4c8d06)?![]:!![]);})[_0x4bd6('0x16')](function(_0x55d977){logger[_0x4bd6('0x2d')](_0x55d977);_0x25fe8f(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0xab7c65,_0x3bd516){sh[_0x4bd6('0x5d')](_[_0x4bd6('0x5e')](_0xab7c65),function(_0x346589,_0x4af734){var _0x1b3133=_0x4af734['replace'](/(\r\n|\n|\r)/gm,'');_0x3bd516(null,_0x1b3133);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x5f')]=function(_0x4069b0,_0x305ab1){scripts[_0x4bd6('0x5f')](_0x4069b0[_0x4bd6('0x60')],_0x4069b0['google_cloud_tts_text_type']||_0x4bd6('0x61'),_0x4069b0['text'],_0x4069b0[_0x4bd6('0x62')]||'en-US',_0x4069b0[_0x4bd6('0x63')]||_0x4bd6('0x64'),_0x4069b0[_0x4bd6('0x65')]||_0x4bd6('0x66'))['then'](function(_0x225a17){_0x305ab1(null,_0x225a17);})[_0x4bd6('0x16')](function(_0x5527ee){_0x305ab1(_0x5527ee);});};AGIVertices['prototype'][_0x4bd6('0x67')]=function(_0x5cfd4c,_0x171336){scripts[_0x4bd6('0x67')](_0x5cfd4c[_0x4bd6('0x61')],_0x5cfd4c[_0x4bd6('0x68')]||'en',0x1)['then'](function(_0x20475a){_0x171336(null,_0x20475a);})[_0x4bd6('0x16')](function(_0x5d3d87){_0x171336(_0x5d3d87);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x69')]=function(_0x4334c6,_0x4edf17){var _0x106061={'uri':_0x4334c6['url'],'method':_0x4334c6['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4334c6[_0x4bd6('0x6a')])==='number'&&parseInt(_0x4334c6[_0x4bd6('0x6a')])>=0x1?parseInt(_0x4334c6['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x4bd6('0x6b')]([_0x4bd6('0x6c'),_0x4bd6('0x6d')],_0x106061[_0x4bd6('0x6e')]['toUpperCase']())){try{_0x106061[_0x4bd6('0x6f')]=_0x4334c6[_0x4bd6('0xb')]?JSON[_0x4bd6('0x70')](_0x4334c6['rawBody']):{};}catch(_0x3b10ab){logger['error'](_0x4bd6('0x71'),_0x3b10ab);}}try{_0x106061[_0x4bd6('0x72')]=_0x4334c6[_0x4bd6('0xa')]?JSON[_0x4bd6('0x70')](_0x4334c6[_0x4bd6('0xa')]):{};}catch(_0x2fb095){logger[_0x4bd6('0x2d')](_0x4bd6('0x73'),_0x2fb095);}if(_0x4334c6[_0x4bd6('0x74')]){try{var _0x47c3e8=require(_0x4334c6['computedVariables'])[_0x4bd6('0x75')](this,_0x106061);_0x106061[_0x4bd6('0x76')]=Mustache[_0x4bd6('0x77')](_0x4334c6[_0x4bd6('0x78')],_0x47c3e8,{},['$$','$$']);if(_0x106061['headers']){_0x106061[_0x4bd6('0x72')]=JSON[_0x4bd6('0x70')](Mustache[_0x4bd6('0x77')](JSON['stringify'](_0x106061[_0x4bd6('0x72')]),_0x47c3e8,{},['$$','$$']));}if(_0x106061[_0x4bd6('0x6f')]){_0x106061[_0x4bd6('0x6f')]=JSON[_0x4bd6('0x70')](Mustache[_0x4bd6('0x77')](JSON['stringify'](_0x106061[_0x4bd6('0x6f')]),_0x47c3e8,{},['$$','$$']));}}catch(_0x312d81){logger[_0x4bd6('0x2d')](_0x4bd6('0x79'),_0x312d81);}}rp(_0x106061)[_0x4bd6('0x13')](function(_0x580755){var _0x436320={'statusCode':_0x580755[_0x4bd6('0x7a')]||0xc8,'statusMessage':_0x580755[_0x4bd6('0x7b')]||'OK','headers':_0x580755['headers']||{},'body':_0x580755[_0x4bd6('0x6f')]||{}};_0x4edf17(null,_0x436320);})[_0x4bd6('0x16')](function(_0x4f13c5){var _0x17c46a={'statusCode':_0x4f13c5['statusCode']||0x1f4,'statusMessage':_0x4f13c5[_0x4bd6('0x7c')]||_0x4bd6('0x7d'),'headers':_0x4f13c5[_0x4bd6('0x7e')][_0x4bd6('0x72')]||{},'body':_0x4f13c5[_0x4bd6('0x7e')]['body']||{}};_0x4edf17(null,_0x17c46a);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x7f')]=function(_0x2d4cfe,_0x534f76){scripts[_0x4bd6('0x7f')](this['channel'][_0x4bd6('0x39')],_0x2d4cfe[_0x4bd6('0x80')],_0x2d4cfe[_0x4bd6('0x61')],_0x2d4cfe['dialogflow_language']||'en')[_0x4bd6('0x13')](function(_0x1cec7c){_0x534f76(null,_0x1cec7c);})[_0x4bd6('0x16')](function(_0x255660){_0x534f76(_0x255660);});};AGIVertices[_0x4bd6('0x10')]['googleDialogflowV2']=function(_0x102bb6,_0xd22fac){scripts[_0x4bd6('0x81')](this[_0x4bd6('0xd')]['uniqueid'],_0x102bb6[_0x4bd6('0x82')],_0x102bb6[_0x4bd6('0x83')],_0x102bb6[_0x4bd6('0x84')],_0x102bb6[_0x4bd6('0x61')],_0x102bb6[_0x4bd6('0x85')]||'en')[_0x4bd6('0x13')](function(_0x380392){_0xd22fac(null,_0x380392);})['catch'](function(_0x3281fc){_0xd22fac(_0x3281fc);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x86')]=function(_0x1ae3df,_0x5d7f3d){scripts[_0x4bd6('0x86')](this[_0x4bd6('0xd')],_0x1ae3df)[_0x4bd6('0x13')](function(_0xde054){_0x5d7f3d(null,_0xde054);})[_0x4bd6('0x16')](function(_0x3a576e){_0x5d7f3d(_0x3a576e);});};AGIVertices[_0x4bd6('0x10')]['ispeechTTS']=function(_0x585614,_0x5629ff){scripts[_0x4bd6('0x87')](_0x585614[_0x4bd6('0x80')],_0x585614[_0x4bd6('0x61')],_0x585614[_0x4bd6('0x88')]||_0x4bd6('0x89'),_0x585614[_0x4bd6('0x8a')])[_0x4bd6('0x13')](function(_0x20c81d){_0x5629ff(null,_0x20c81d);})[_0x4bd6('0x16')](function(_0x48920e){_0x5629ff(_0x48920e);});};AGIVertices['prototype'][_0x4bd6('0x8b')]=function(_0x21fa94,_0xa63b38,_0x159d64){scripts['ispeechASR'](_0xa63b38,_0x21fa94[_0x4bd6('0x80')],_0x21fa94[_0x4bd6('0x8c')]||'en-US',this['isConfigured'](_0x21fa94[_0x4bd6('0x8d')])?_0x21fa94[_0x4bd6('0x8d')]:undefined)[_0x4bd6('0x13')](function(_0x14475e){_0x159d64(null,_0x14475e);})[_0x4bd6('0x16')](function(_0x47b250){_0x159d64(_0x47b250);});};AGIVertices['prototype'][_0x4bd6('0x8e')]=function(_0x2b9f15,_0x2521d9){scripts[_0x4bd6('0x8e')](_0x2b9f15[_0x4bd6('0x8f')],_0x2b9f15[_0x4bd6('0x90')],_0x2b9f15[_0x4bd6('0x91')],_0x2b9f15[_0x4bd6('0x92')]||_0x4bd6('0x93'),_0x2b9f15[_0x4bd6('0x61')],_0x2b9f15[_0x4bd6('0x94')]||_0x4bd6('0x61'))[_0x4bd6('0x13')](function(_0x169e30){_0x2521d9(null,_0x169e30);})[_0x4bd6('0x16')](function(_0x2f93ce){_0x2521d9(_0x2f93ce);});};AGIVertices['prototype'][_0x4bd6('0x95')]=function(_0x49780e,_0x12180f){scripts['awsLex'](this[_0x4bd6('0xd')]['uniqueid'],_0x49780e['aws_access_key_id'],_0x49780e['aws_secret_access_key'],_0x49780e[_0x4bd6('0x96')],_0x49780e[_0x4bd6('0x61')],_0x49780e[_0x4bd6('0x97')])[_0x4bd6('0x13')](function(_0x5f0dec){_0x12180f(null,_0x5f0dec);})['catch'](function(_0x513325){_0x12180f(_0x513325);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x98')]=function(_0x5474de,_0xca2b92,_0x4dfc62){scripts['googleASR'](_0xca2b92,_0x5474de[_0x4bd6('0x80')],_0x5474de[_0x4bd6('0x99')]||_0x4bd6('0x89'))[_0x4bd6('0x13')](function(_0x565f95){_0x4dfc62(null,_0x565f95);})['catch'](function(_0x5a1351){_0x4dfc62(_0x5a1351);});};AGIVertices['prototype'][_0x4bd6('0x9a')]=function(_0x1f2a5c,_0x5b34e9,_0x4e7685){scripts[_0x4bd6('0x9a')](_0x5b34e9,_0x1f2a5c[_0x4bd6('0x9b')],_0x1f2a5c['appsecret'],_0x1f2a5c['uri'])[_0x4bd6('0x13')](function(_0x54fe27){_0x4e7685(null,_0x54fe27);})[_0x4bd6('0x16')](function(_0x2054bf){_0x4e7685(_0x2054bf);});};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x9c')]=function(_0x284b0f){var _0x4bd13f=_[_0x4bd6('0x6b')](verticesWithRetry,_0x284b0f[_0x4bd6('0x3b')])?_0x284b0f:_[_0x4bd6('0x9d')](_0x284b0f);for(var _0x5f33c9 in _0x4bd13f){if(_0x4bd13f[_0x4bd6('0x9e')](_0x5f33c9)){if(_0x4bd13f[_0x5f33c9]&&_['isString'](_0x4bd13f[_0x5f33c9])){if(_[_0x4bd6('0x6b')](recursiveMapAttributes,_0x5f33c9)){_0x4bd13f[_0x5f33c9]=this[_0x4bd6('0x9f')](_0x4bd13f[_0x5f33c9]);}else{_0x4bd13f[_0x5f33c9]=this['replaceAllVariables'](_0x4bd13f[_0x5f33c9]);}}}}return _0x4bd13f;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xa0')]=function(_0x19ad42){for(var _0x468522 in _0x19ad42){if(_0x19ad42[_0x4bd6('0x9e')](_0x468522)){if(_[_0x4bd6('0xa1')](_0x19ad42[_0x468522])){this['recursiveNodeIndex'](_0x19ad42[_0x468522]);}else if(_[_0x4bd6('0xa2')](_0x19ad42[_0x468522])){for(var _0x5cc3b8=0x0;_0x5cc3b8<_0x19ad42[_0x468522]['length'];_0x5cc3b8++){this[_0x4bd6('0xa0')](_0x19ad42[_0x468522][_0x5cc3b8]);}}else if(_[_0x4bd6('0xa3')](_0x19ad42[_0x468522])){_0x19ad42[_0x468522]=this['replaceAllVariables'](_0x19ad42[_0x468522]);}}}};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xa4')]=function(_0x3e2742,_0x1d13cf){for(var _0x17de9d in _0x3e2742){if(_0x3e2742[_0x4bd6('0x9e')](_0x17de9d)){if(_['isPlainObject'](_0x3e2742[_0x17de9d])){if(!_[_0x4bd6('0x4a')](_0x3e2742[_0x17de9d])){this[_0x4bd6('0xa4')](_0x3e2742[_0x17de9d],util[_0x4bd6('0x5a')](_0x4bd6('0xa5'),_0x1d13cf,_0x17de9d));}}else if(_[_0x4bd6('0xa2')](_0x3e2742[_0x17de9d])){for(var _0x51b3d9=0x0;_0x51b3d9<_0x3e2742[_0x17de9d][_0x4bd6('0xa6')];_0x51b3d9++){this['saveRestApiResult'](_0x3e2742[_0x17de9d][_0x51b3d9],util[_0x4bd6('0x5a')]('%s.%s',_0x1d13cf,_0x17de9d+'['+_0x51b3d9+']'));}}else{if(!_[_0x4bd6('0x47')](_0x3e2742[_0x17de9d])){this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util['format'](_0x4bd6('0xa5'),_0x1d13cf,_0x17de9d),_0x3e2742[_0x17de9d]);}}}}};AGIVertices[_0x4bd6('0x10')]['replaceObjectAllVariables']=function(_0x50e6bf){try{var _0x4d1829=JSON[_0x4bd6('0x70')](_0x50e6bf);this['recursiveNodeIndex'](_0x4d1829);return JSON[_0x4bd6('0xa8')](_0x4d1829);}catch(_0x133bec){return this[_0x4bd6('0xa9')](_0x50e6bf);}};AGIVertices['prototype'][_0x4bd6('0xa9')]=function(_0x1b6778){var _0x5d4cea=_0x1b6778['split']('{');for(var _0x29194f=0x1;_0x29194f<_0x5d4cea[_0x4bd6('0xa6')];_0x29194f+=0x1){var _0x4f036b=_0x5d4cea[_0x29194f][_0x4bd6('0xaa')]('}');if(_0x4f036b['length']>0x1){_0x1b6778=_0x1b6778[_0x4bd6('0xab')]('{'+_0x4f036b[0x0]+'}',this[_0x4bd6('0xd')]['getVariable'](_0x4f036b[0x0])['extra']||_0x4f036b[0x0]);}}if(_0x5d4cea['length']===0x1){return _0x1b6778[_0x4bd6('0x50')]();}return this[_0x4bd6('0xa9')](_0x1b6778);};AGIVertices['prototype']['getAndSetVariable']=function(_0x4309a9,_0x176b4c){var _0x53343d=this[_0x4bd6('0xd')][_0x4bd6('0x11')](_0x4309a9);if(_0x53343d['result']===-0x1){return _0x53343d;}logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x176b4c,_0x53343d[_0x4bd6('0xac')]));return this[_0x4bd6('0xd')][_0x4bd6('0xa7')](_0x176b4c,_0x53343d[_0x4bd6('0xac')]);};AGIVertices['prototype']['isConfigured']=function(_0x528d9a){return _0x528d9a&&_0x528d9a!=='0'&&_0x528d9a!=='-1'&&_0x528d9a!=='';};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xad')]=function(_0x43a3ce){this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x43a3ce,'-');_0x43a3ce[_0x4bd6('0xae')]=_0x43a3ce['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xaf')]=function(_0x5a4553){logger[_0x4bd6('0x2f')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x5a4553[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x5a4553[_0x4bd6('0x61')])){return this['channel'][_0x4bd6('0xb1')](_0x4bd6('0xb2'));}var _0x4784d6='\x22'+_0x5a4553[_0x4bd6('0x61')]+'\x22';if(this[_0x4bd6('0xb0')](_0x5a4553['options'])){_0x4784d6+=','+_0x5a4553[_0x4bd6('0x7e')];}var _0xf2f718=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0xb3'),_0x4784d6);if(_0xf2f718[_0x4bd6('0xb4')]===-0x1){return _0xf2f718;}return this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4784d6));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xb5')]=function(_0x981f79){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x981f79[_0x4bd6('0x3a')]));if(!this['isConfigured'](_0x981f79['grammar'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xb6'));}var _0x515367=_0x981f79['grammar'];if(this[_0x4bd6('0xb0')](_0x981f79[_0x4bd6('0x7e')])){_0x515367+=','+_0x981f79[_0x4bd6('0x7e')];}var _0x177521=this[_0x4bd6('0xd')]['exec'](_0x4bd6('0xb7'),_0x515367);if(_0x177521['result']===-0x1){return _0x177521;}var _0x289475=this[_0x4bd6('0xb8')](_0x4bd6('0xb9'),_0x4bd6('0xba'));if(_0x289475['result']===-0x1){return _0x289475;}var _0x3af485=this[_0x4bd6('0xb8')](_0x4bd6('0xbb'),_0x4bd6('0xbc'));if(_0x3af485[_0x4bd6('0xb4')]===-0x1){return _0x3af485;}var _0x721ffb=this[_0x4bd6('0xb8')]('RECOG_INSTANCE()',_0x4bd6('0xbd'));if(_0x721ffb['result']===-0x1){return _0x721ffb;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x515367));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xbe')]=function(_0x1bdf5a){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0xbf'),_0x1bdf5a[_0x4bd6('0x3a')]));return this['channel'][_0x4bd6('0xbe')]([_0x1bdf5a[_0x4bd6('0xc0')],_0x1bdf5a[_0x4bd6('0xc1')]]);};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xc2')]=function(_0x3ce3ea){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0xc3'),_0x3ce3ea['label']));if(this[_0x4bd6('0xb0')](_0x3ce3ea['timeout'])){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x3ce3ea[_0x4bd6('0x6a')]));var _0x4cc118=this[_0x4bd6('0xd')]['wait'](_0x3ce3ea['timeout']);if(_0x4cc118[_0x4bd6('0xb4')]===-0x1){return _0x4cc118;}}return this[_0x4bd6('0xd')][_0x4bd6('0xc2')]();};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x4e')]=function(_0x497cb1){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0xc4'),_0x497cb1[_0x4bd6('0x3a')]));if(!this['isConfigured'](_0x497cb1[_0x4bd6('0x4c')])){return this['channel']['error'](_0x497cb1,_0x4bd6('0xc5'));}_0x497cb1[_0x4bd6('0x4d')]=moment();if(this[_0x4bd6('0xb0')](_0x497cb1[_0x4bd6('0xc6')])){_0x497cb1[_0x4bd6('0x4d')]=moment()[_0x4bd6('0xc7')](_0x497cb1[_0x4bd6('0xc6')],'minutes');}if(!this[_0x4bd6('0xb0')](_0x497cb1[_0x4bd6('0x51')])){_0x497cb1[_0x4bd6('0x51')]=0x2;}this[_0x4bd6('0x46')][_0x4bd6('0x75')](this,_0x497cb1);return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xc8'),_0x497cb1[_0x4bd6('0xc9')],_0x497cb1['list_id'],_0x497cb1['scheduledAt']));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xca')]=function(_0x3fc7f4){logger[_0x4bd6('0x2f')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x3fc7f4['label']));var _0x5c14c4=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x3fc7f4['application'],_0x3fc7f4['options']);if(_0x5c14c4[_0x4bd6('0xb4')]===-0x1){return _0x5c14c4;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xcb'),_0x3fc7f4[_0x4bd6('0xcc')],_0x3fc7f4[_0x4bd6('0x7e')]));};AGIVertices['prototype'][_0x4bd6('0xcd')]=function(_0x56de15){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0xce'),_0x56de15[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x56de15[_0x4bd6('0x61')])){return this[_0x4bd6('0xd')]['noop']('no\x20text\x20configured');}var _0x24f2e2='\x22'+_0x56de15[_0x4bd6('0x61')]+'\x22';if(this['isConfigured'](_0x56de15[_0x4bd6('0x7e')])){_0x24f2e2+=','+_0x56de15['options'];}var _0x3f3177=this[_0x4bd6('0xd')]['exec']('MRCPSynth',_0x24f2e2);if(_0x3f3177[_0x4bd6('0xb4')]===-0x1){return _0x3f3177;}return this['channel'][_0x4bd6('0xb1')](util['format'](_0x4bd6('0xcf'),_0x24f2e2));};AGIVertices[_0x4bd6('0x10')]['sestektts']=function(_0x1f7884){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0xd0'),_0x1f7884[_0x4bd6('0x3a')]));if(!this['isConfigured'](_0x1f7884['text'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('no\x20text\x20configured');}var _0xb6ed15='\x22'+_0x1f7884['text']+'\x22';if(this[_0x4bd6('0xb0')](_0x1f7884[_0x4bd6('0x7e')])){_0xb6ed15+=','+_0x1f7884['options'];}var _0x39ec8c=this[_0x4bd6('0xd')]['exec']('MRCPSynth',_0xb6ed15);if(_0x39ec8c['result']===-0x1){return _0x39ec8c;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xcf'),_0xb6ed15));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xd1')]=function(_0xe917f8){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xe917f8[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0xe917f8['grammar'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xb6'));}var _0xa310b=_0xe917f8[_0x4bd6('0xd2')];if(this[_0x4bd6('0xb0')](_0xe917f8[_0x4bd6('0x7e')])){_0xa310b+=','+_0xe917f8[_0x4bd6('0x7e')];}var _0x58c52d=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0xb7'),_0xa310b);if(_0x58c52d[_0x4bd6('0xb4')]===-0x1){return _0x58c52d;}var _0x1967a=this[_0x4bd6('0xb8')](_0x4bd6('0xb9'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1967a[_0x4bd6('0xb4')]===-0x1){return _0x1967a;}var _0x10dd59=this[_0x4bd6('0xb8')](_0x4bd6('0xbb'),_0x4bd6('0xd3'));if(_0x10dd59[_0x4bd6('0xb4')]===-0x1){return _0x10dd59;}var _0x59bd1a=this[_0x4bd6('0xb8')](_0x4bd6('0xd4'),'LUMENVOX_ASR_INSTANCE');if(_0x59bd1a[_0x4bd6('0xb4')]===-0x1){return _0x59bd1a;}return this[_0x4bd6('0xd')]['noop'](util[_0x4bd6('0x5a')](_0x4bd6('0xd5'),_0xa310b));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xd6')]=function(_0x43b5e3){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0xd7'),_0x43b5e3[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x43b5e3[_0x4bd6('0xd2')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xb6'));}var _0x424858=_0x43b5e3[_0x4bd6('0xd2')];if(this['isConfigured'](_0x43b5e3[_0x4bd6('0x7e')])){_0x424858+=','+_0x43b5e3[_0x4bd6('0x7e')];}var _0x355c9e=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0xb7'),_0x424858);if(_0x355c9e['result']===-0x1){return _0x355c9e;}var _0x1efadc=this['getAndSetVariable'](_0x4bd6('0xb9'),_0x4bd6('0xd8'));if(_0x1efadc['result']===-0x1){return _0x1efadc;}var _0x407721=this[_0x4bd6('0xb8')](_0x4bd6('0xbb'),_0x4bd6('0xd9'));if(_0x407721[_0x4bd6('0xb4')]===-0x1){return _0x407721;}var _0x300c8a=this[_0x4bd6('0xb8')]('RECOG_INSTANCE()',_0x4bd6('0xda'));if(_0x300c8a[_0x4bd6('0xb4')]===-0x1){return _0x300c8a;}return this[_0x4bd6('0xd')]['noop'](util['format'](_0x4bd6('0xd5'),_0x424858));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xdb')]=function(_0x6b1748){logger['info'](util['format'](_0x4bd6('0xdc'),_0x6b1748[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x6b1748[_0x4bd6('0xdd')])){return this[_0x4bd6('0xd')]['error'](_0x6b1748,_0x4bd6('0xde'));}var _0x207c51=this[_0x4bd6('0x19')][_0x4bd6('0x75')](this,_0x6b1748[_0x4bd6('0xdd')]);if(!_0x207c51){return this[_0x4bd6('0xd')]['error'](_0x6b1748,_0x4bd6('0xdf'));}if(!this['isConfigured'](_0x6b1748[_0x4bd6('0x31')])){return this['channel']['error'](_0x6b1748,'no\x20query\x20configured');}var _0x3b1ff9=_0x6b1748['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util['format']('query:\x20%s',_0x3b1ff9));var _0x384231=this[_0x4bd6('0x2b')]['sync'](this,_0x207c51,_0x3b1ff9);this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x6b1748,_0x3b1ff9);if(!this[_0x4bd6('0xb0')](_0x6b1748[_0x4bd6('0xe0')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5a8db8=this['getVariable'][_0x4bd6('0x75')](this,_0x6b1748['variable_id']);if(!_0x5a8db8){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x6b1748,_0x4bd6('0xe1'));}var _0x368e2f=this;_0x384231['forEach'](function(_0x1e3943,_0x2c0ae2){Object[_0x4bd6('0xe2')](_0x1e3943)[_0x4bd6('0xe3')](function(_0x1eb42a){_0x368e2f[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0xe4'),_0x5a8db8,_0x2c0ae2,_0x1eb42a),_0x1e3943[_0x1eb42a]);});});this['channel'][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')]('%s_ROWS_COUNT',_0x5a8db8),_0x384231[_0x4bd6('0xa6')]);return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('variable\x20%s\x20set',_0x5a8db8));};AGIVertices['prototype'][_0x4bd6('0xe5')]=function(_0x97ef60){logger[_0x4bd6('0xe6')](util[_0x4bd6('0x5a')](_0x4bd6('0xe7'),_0x97ef60[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x97ef60[_0x4bd6('0xe8')])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x97ef60,'no\x20user\x20selected');}var _0x48e37c=this[_0x4bd6('0x1c')][_0x4bd6('0x75')](this,_0x97ef60[_0x4bd6('0xe8')]);if(!_0x48e37c){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x97ef60,'no\x20user\x20found');}var _0x530cbc=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0xe9'),[util[_0x4bd6('0x5a')](_0x4bd6('0xea'),_0x48e37c),_0x97ef60['timeout'],_0x97ef60[_0x4bd6('0xeb')],_0x97ef60['url']]);if(_0x530cbc[_0x4bd6('0xb4')]===-0x1){return _0x530cbc;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Executed\x20command\x20%s',_0x4bd6('0xe9')));};AGIVertices['prototype'][_0x4bd6('0xec')]=function(_0x588e4f){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0xed'),_0x588e4f[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x588e4f[_0x4bd6('0x80')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xee'));}if(!this['isConfigured'](_0x588e4f['text'])){return this['channel'][_0x4bd6('0xb1')](_0x4bd6('0xb2'));}this[_0x4bd6('0xd')][_0x4bd6('0xef')]=!![];this['createSquareDetailsReport'](_0x588e4f);this[_0x4bd6('0x45')](_0x588e4f[_0x4bd6('0x61')],'in','','');this[_0x4bd6('0xd')]['noop'](util['format']('Trying\x20Dialogflow:\x20%s',_0x588e4f[_0x4bd6('0x61')]));var _0x45d19a=this['googleDialogflow'][_0x4bd6('0x75')](this,_0x588e4f);if(_0x45d19a){for(var _0x4641c0 in _0x45d19a){if(_0x45d19a[_0x4bd6('0x9e')](_0x4641c0)){this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')]('DIALOGFLOW_%s',_0x4641c0[_0x4bd6('0xf0')]()),_0x45d19a[_0x4641c0]);}}this[_0x4bd6('0x45')](_0x45d19a['speech'],_0x4bd6('0xf1'),'dialogflow','');return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Dialogflow\x20Result\x20%s',_0x45d19a[_0x4bd6('0xf2')]));}return this['channel'][_0x4bd6('0x2d')](_0x588e4f,_0x4bd6('0xf3'));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xf4')]=function(_0x5e034e){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x5e034e[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x5e034e['dialogflowV2_project_id'])){return this['channel']['noop'](_0x4bd6('0xf5'));}if(!this[_0x4bd6('0xb0')](_0x5e034e[_0x4bd6('0x83')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xf6'));}if(!this[_0x4bd6('0xb0')](_0x5e034e[_0x4bd6('0x84')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xf7'));}if(!this[_0x4bd6('0xb0')](_0x5e034e['dialogflowV2_language'])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0xf8'));}if(!this[_0x4bd6('0xb0')](_0x5e034e[_0x4bd6('0x61')])){return this['channel'][_0x4bd6('0xb1')](_0x4bd6('0xb2'));}this[_0x4bd6('0xd')][_0x4bd6('0xef')]=!![];this[_0x4bd6('0x38')](_0x5e034e);this[_0x4bd6('0x45')](_0x5e034e[_0x4bd6('0x61')],'in','','');this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xf9'),_0x5e034e[_0x4bd6('0x61')]));var _0x2144e2=this[_0x4bd6('0x81')][_0x4bd6('0x75')](this,_0x5e034e);if(_0x2144e2){for(var _0x3fdc7a in _0x2144e2){if(_0x2144e2[_0x4bd6('0x9e')](_0x3fdc7a)){if(_0x3fdc7a!==_0x4bd6('0xfa')){this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0xfb'),_0x3fdc7a['toUpperCase']()),_0x2144e2[_0x3fdc7a]);}}}this['createSquareMessage'](_0x2144e2['speech'],'out',_0x4bd6('0xf4'),_0x2144e2['providerResponse']);return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xfc'),_0x2144e2[_0x4bd6('0xf2')]));}return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x5e034e,_0x4bd6('0xfd'));};AGIVertices[_0x4bd6('0x10')]['sesteknda']=function(_0x11bcab){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0xfe'),_0x11bcab[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x11bcab[_0x4bd6('0xff')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x100'));}if(!this['isConfigured'](_0x11bcab[_0x4bd6('0x101')])){return this['channel']['noop'](_0x4bd6('0x102'));}if(!this[_0x4bd6('0xb0')](_0x11bcab['password'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x103'));}if(!this['isConfigured'](_0x11bcab[_0x4bd6('0x104')])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0xb2'));}this[_0x4bd6('0xd')]['bot']=!![];this[_0x4bd6('0x38')](_0x11bcab);this[_0x4bd6('0x45')](_0x11bcab[_0x4bd6('0x61')],'in','','');this[_0x4bd6('0xd')]['noop'](util['format'](_0x4bd6('0x105'),_0x11bcab[_0x4bd6('0x61')]));var _0xe1df8=this[_0x4bd6('0x86')][_0x4bd6('0x75')](this,_0x11bcab);if(_0xe1df8){for(var _0x2ef4ff in _0xe1df8){if(_0xe1df8[_0x4bd6('0x9e')](_0x2ef4ff)){this[_0x4bd6('0xd')]['setVariable'](util['format'](_0x4bd6('0x106'),_0x2ef4ff[_0x4bd6('0xf0')]()),_0xe1df8[_0x2ef4ff]);}}this['createSquareMessage'](_0xe1df8[_0x4bd6('0xf2')],_0x4bd6('0xf1'),_0x4bd6('0x107'),'');if(_0xe1df8[_0x4bd6('0x108')]){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x109'),_0xe1df8[_0x4bd6('0x108')]));var _0xaa88=this[_0x4bd6('0xd')][_0x4bd6('0x10a')](_0xe1df8[_0x4bd6('0x108')]);try{fs[_0x4bd6('0x10b')](_0xe1df8[_0x4bd6('0x108')]+_0x4bd6('0x10c'));}catch(_0x5cb1c6){logger[_0x4bd6('0x2d')](_0x5cb1c6);}return _0xaa88;}else{return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x10d'),_0xe1df8[_0x4bd6('0xf2')]));}}return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x11bcab,_0x4bd6('0x10e'));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x10f')]=function(_0x1df040){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x110'),_0x1df040[_0x4bd6('0x3a')]));return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x10f'));};AGIVertices['prototype'][_0x4bd6('0x111')]=function(_0x4a7617){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x112'),_0x4a7617[_0x4bd6('0x3a')]));var _0x2b3844='';if(_0x4a7617['trunk_id']){if(!this[_0x4bd6('0xb0')](_0x4a7617[_0x4bd6('0x113')])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x4a7617,_0x4bd6('0x114'));}else{var _0x59ab79=parseInt(_0x4a7617[_0x4bd6('0x113')],0xa);if(isNaN(_0x59ab79)){_0x2b3844=_0x4a7617[_0x4bd6('0x113')];}else{_0x2b3844=this[_0x4bd6('0x1d')][_0x4bd6('0x75')](this,_0x4a7617['trunk_id']);if(!_0x2b3844){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x4a7617,_0x4bd6('0x115'));}}}}else if(_0x4a7617[_0x4bd6('0x116')]){_0x2b3844=_0x4a7617[_0x4bd6('0x116')];}else{return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x4a7617,_0x4bd6('0x114'));}var _0x392523=this['channel'][_0x4bd6('0x5d')]('DIAL',[util[_0x4bd6('0x5a')]('SIP/%s/%s',_0x2b3844,_0x4a7617[_0x4bd6('0xc9')]),_0x4a7617[_0x4bd6('0x6a')],_0x4a7617[_0x4bd6('0xeb')],_0x4a7617[_0x4bd6('0x78')]]);if(_0x392523[_0x4bd6('0xb4')]===-0x1){return _0x392523;}return this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x117'),_0x4bd6('0xe9')));};AGIVertices['prototype'][_0x4bd6('0x118')]=function(_0x37602e){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x119'),_0x37602e['label']));return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x118'));};AGIVertices['prototype'][_0x4bd6('0x11a')]=function(_0x5790c7){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x11b'),_0x5790c7[_0x4bd6('0x3a')]));if(_0x5790c7[_0x4bd6('0xae')]===0x0){return this['maxRetry'](_0x5790c7);}_0x5790c7[_0x4bd6('0xae')]-=0x1;if(!this['isConfigured'](_0x5790c7['file_id'])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x5790c7,_0x4bd6('0x11c'));}var _0x48aa2e=this[_0x4bd6('0x11d')][_0x4bd6('0x75')](this,_0x5790c7[_0x4bd6('0x11e')]);if(!_0x48aa2e){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x5790c7,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x5790c7['variable_id'])){return this[_0x4bd6('0xd')]['error'](_0x4bd6('0x11f'));}var _0x3ab9bd=this[_0x4bd6('0xd')][_0x4bd6('0x120')](_0x48aa2e,_0x5790c7['response'],_0x5790c7[_0x4bd6('0x121')]);var _0x490628=_0x3ab9bd[_0x4bd6('0xb4')]?_0x3ab9bd['result'][_0x4bd6('0x50')]():'';logger['info'](_0x4bd6('0x122'),JSON[_0x4bd6('0xa8')](_0x3ab9bd));if(_0x3ab9bd[_0x4bd6('0xb4')]===-0x1){this[_0x4bd6('0x38')]['sync'](this,_0x5790c7,_0x490628);return _0x3ab9bd;}else if(_0x3ab9bd['extra']===_0x4bd6('0x6a')){_0x3ab9bd[_0x4bd6('0xb4')]=_0x490628[_0x4bd6('0xa6')]>=parseInt(_0x5790c7[_0x4bd6('0x123')])?'x':'i';}else{_0x3ab9bd[_0x4bd6('0xb4')]=_0x490628[_0x4bd6('0xa6')]>=parseInt(_0x5790c7['mindigit'])&&_0x490628[_0x4bd6('0xa6')]<=parseInt(_0x5790c7['maxdigit'])?'x':'i';}var _0x1eafed=this[_0x4bd6('0x11')][_0x4bd6('0x75')](this,_0x5790c7[_0x4bd6('0xe0')]);if(!_0x1eafed){return this[_0x4bd6('0xd')]['error'](_0x5790c7,_0x4bd6('0xe1'));}this[_0x4bd6('0xd')][_0x4bd6('0xa7')](_0x1eafed,_0x490628);if(this[_0x4bd6('0xb0')](_0x5790c7[_0x4bd6('0x124')])){var _0x3ea8e6=parseInt(_0x5790c7['hiddendigitsnum'],0xa);var _0x2694df=rs[_0x4bd6('0x125')]({'charset':'*','length':_0x3ea8e6});var _0x4e2ee4=_0x490628['length'];if(_0x4e2ee4>0x0){if(_0x4e2ee4>_0x3ea8e6){this['createSquareDetailsReport'][_0x4bd6('0x75')](this,_0x5790c7,_0x5790c7[_0x4bd6('0x126')]==='first'?_0x2694df+_0x490628[_0x4bd6('0x127')](_0x3ea8e6):_0x490628[_0x4bd6('0x127')](0x0,_0x4e2ee4-_0x3ea8e6)+_0x2694df);}else{this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x5790c7,rs[_0x4bd6('0x125')]({'charset':'*','length':_0x4e2ee4}));}}else{this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x5790c7,'');}}else{this[_0x4bd6('0x38')]['sync'](this,_0x5790c7,_0x490628);}return _0x3ab9bd;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x128')]=function(_0x5a666a){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x129'),_0x5a666a['label']));return this['getdigits'](_0x5a666a);};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x12a')]=function(_0x3aa34b){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x12b'),_0x3aa34b['label']));this[_0x4bd6('0x38')]['sync'](this,_0x3aa34b,_0x3aa34b[_0x4bd6('0x12c')]);return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('GOAL\x20%s',_0x3aa34b[_0x4bd6('0x12c')]));};AGIVertices['prototype'][_0x4bd6('0x12d')]=function(_0x467322){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x12e'),_0x467322[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x467322[_0x4bd6('0x8f')])||!this[_0x4bd6('0xb0')](_0x467322['aws_secret_access_key'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x467322[_0x4bd6('0x61')])){return this['channel'][_0x4bd6('0xb1')]('no\x20text\x20configured');}this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x12f'),_0x467322[_0x4bd6('0x61')]));var _0x27b9cc=this[_0x4bd6('0x8e')][_0x4bd6('0x75')](this,_0x467322);if(_0x27b9cc){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x130'),_0x27b9cc));var _0x547193=this[_0x4bd6('0xd')][_0x4bd6('0x10a')](_0x27b9cc);try{fs[_0x4bd6('0x10b')](_0x27b9cc+_0x4bd6('0x10c'));}catch(_0x354f6e){logger[_0x4bd6('0x2d')](_0x354f6e);}return _0x547193;}return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x467322,_0x4bd6('0x131'));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x132')]=function(_0x5df8d8){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x133'),_0x5df8d8[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x5df8d8[_0x4bd6('0x8f')])||!this[_0x4bd6('0xb0')](_0x5df8d8[_0x4bd6('0x90')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4bd6('0xb0')](_0x5df8d8[_0x4bd6('0x97')])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0x134'));}if(!this[_0x4bd6('0xb0')](_0x5df8d8[_0x4bd6('0x61')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xb2'));}this['channel'][_0x4bd6('0xef')]=!![];this['createSquareDetailsReport'](_0x5df8d8);this[_0x4bd6('0x45')](_0x5df8d8[_0x4bd6('0x61')],'in','','');this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x135'),_0x5df8d8['text']));var _0x4025b8=this[_0x4bd6('0x95')][_0x4bd6('0x75')](this,_0x5df8d8);if(_0x4025b8){for(var _0x19b149 in _0x4025b8){if(_0x4025b8[_0x4bd6('0x9e')](_0x19b149)&&_[_0x4bd6('0xa3')](_0x4025b8[_0x19b149])){this[_0x4bd6('0xd')]['setVariable'](util['format'](_0x4bd6('0x136'),_0x19b149[_0x4bd6('0xf0')]()),_0x4025b8[_0x19b149]);}}if(_[_0x4bd6('0x47')](_0x4025b8[_0x4bd6('0x7c')])){return this['channel'][_0x4bd6('0xb1')](_0x4bd6('0x137'));}else{this[_0x4bd6('0x45')](_0x4025b8['message'],_0x4bd6('0xf1'),'amazonlex','');return this['channel'][_0x4bd6('0xb1')](util['format'](_0x4bd6('0x138'),_0x4025b8[_0x4bd6('0x7c')]));}}return this[_0x4bd6('0xd')]['error'](_0x5df8d8,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x4bd6('0x10')]['googleasr']=function(_0x146bb0){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x139'),_0x146bb0[_0x4bd6('0x3a')],_0x146bb0[_0x4bd6('0x6a')]));if(!this['isConfigured'](_0x146bb0[_0x4bd6('0x80')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xee'));}var _0x5a4c0b='wav';var _0x5b4caa=util[_0x4bd6('0x5a')](_0x4bd6('0x13a'),FILES_PATH,rs['generate'](0x4));var _0x4df046=util[_0x4bd6('0x5a')]('%s.%s',_0x5b4caa,_0x5a4c0b);var _0x195051=!![];if(_0x146bb0[_0x4bd6('0x13b')]===_0x4bd6('0x13c')){_0x195051=![];}var _0x259b75=this[_0x4bd6('0xd')][_0x4bd6('0x13d')](_0x5b4caa,_0x5a4c0b,_0x146bb0[_0x4bd6('0x13e')],_0x146bb0[_0x4bd6('0x6a')],undefined,_0x195051);if(_0x259b75[_0x4bd6('0xb4')]!==-0x1){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('google\x20%s\x20file\x20created',_0x4df046));var _0x536f17=this[_0x4bd6('0x98')][_0x4bd6('0x75')](this,_0x146bb0,_0x4df046);if(_0x536f17){for(var _0x398a92 in _0x536f17){if(_0x536f17[_0x4bd6('0x9e')](_0x398a92)){this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0x13f'),_0x398a92['toUpperCase']()),_0x536f17[_0x398a92]);}}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x140'),JSON[_0x4bd6('0xa8')](_0x536f17)));}}return _0x259b75;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x141')]=function(_0x3a4ad3){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x142'),_0x3a4ad3[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x3a4ad3['appid'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('no\x20appid\x20configured');}if(!this[_0x4bd6('0xb0')](_0x3a4ad3[_0x4bd6('0x143')])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0x144'));}var _0x4aa237=_0x4bd6('0x145');var _0x4fb88e=util['format'](_0x4bd6('0x13a'),FILES_PATH,rs['generate'](0x4));var _0x49a51b=util[_0x4bd6('0x5a')]('%s.%s',_0x4fb88e,_0x4aa237);var _0x14a916=!![];if(_0x3a4ad3[_0x4bd6('0x13b')]===_0x4bd6('0x13c')){_0x14a916=![];}var _0x126ec5=this[_0x4bd6('0xd')]['recordFile'](_0x4fb88e,_0x4aa237,_0x3a4ad3[_0x4bd6('0x13e')],_0x3a4ad3[_0x4bd6('0x6a')],undefined,_0x14a916);if(_0x126ec5[_0x4bd6('0xb4')]!==-0x1){this[_0x4bd6('0xd')]['noop'](util[_0x4bd6('0x5a')]('tilde\x20%s\x20file\x20created',_0x49a51b));var _0x32def5=this[_0x4bd6('0x9a')][_0x4bd6('0x75')](this,_0x3a4ad3,_0x49a51b);if(_0x32def5){for(var _0x9593e7 in _0x32def5){if(_0x32def5[_0x4bd6('0x9e')](_0x9593e7)){this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0x146'),_0x9593e7[_0x4bd6('0xf0')]()),_0x32def5[_0x9593e7]);}}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('TildeASR\x20Result\x20%s',JSON[_0x4bd6('0xa8')](_0x32def5)));}}return _0x126ec5;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x147')]=function(_0x4969f9){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x148'),_0x4969f9[_0x4bd6('0x3a')]));return this['channel'][_0x4bd6('0x149')](_0x4969f9[_0x4bd6('0x40')],_0x4969f9[_0x4bd6('0x14a')],_0x4969f9[_0x4bd6('0x41')]);};AGIVertices[_0x4bd6('0x10')]['gotoif']=function(_0x5aa447){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x5aa447[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x5aa447['condition'])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x5aa447,_0x4bd6('0x14b'));}try{var _0x1e3121=eval(_0x5aa447[_0x4bd6('0x14c')])?'true':'false';this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x14d'),_0x5aa447[_0x4bd6('0x14c')],_0x1e3121));return{'code':0xc8,'result':_0x1e3121};}catch(_0xa589c7){return{'code':0xc8,'result':_0x4bd6('0x14e')};}};AGIVertices[_0x4bd6('0x10')]['gotoiftime']=function(_0x3006fd){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x14f'),_0x3006fd[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x3006fd[_0x4bd6('0x150')])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x3006fd,_0x4bd6('0x151'));}var _0x2436f9=this[_0x4bd6('0x25')][_0x4bd6('0x75')](this,_0x3006fd[_0x4bd6('0x150')]);if(!_0x2436f9){return this['channel'][_0x4bd6('0x2d')](_0x3006fd,_0x4bd6('0x152'));}for(var _0x54af0e=0x0;_0x54af0e<_0x2436f9[_0x4bd6('0xa6')];_0x54af0e+=0x1){var _0x3d515f=this[_0x4bd6('0xd')][_0x4bd6('0x11')](util[_0x4bd6('0x5a')](_0x4bd6('0x153'),_0x2436f9[_0x54af0e]));if(_0x3d515f[_0x4bd6('0xb4')]===-0x1){return _0x3d515f;}logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x154'),_0x2436f9[_0x54af0e],_0x3d515f[_0x4bd6('0xac')]));if(_0x3d515f[_0x4bd6('0xac')]===_0x4bd6('0x155')){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x154'),_0x2436f9[_0x54af0e],_0x4bd6('0x155')));this[_0x4bd6('0xd')]['noop'](util[_0x4bd6('0x5a')]('IFTIME\x20%s\x20%s',_0x2436f9[_0x54af0e],'true'));return{'code':0xc8,'result':_0x4bd6('0x155')};}else{logger[_0x4bd6('0x2f')](util['format']('IFTIME\x20%s\x20%s',_0x2436f9[_0x54af0e],'false'));this[_0x4bd6('0xd')]['noop'](util['format'](_0x4bd6('0x154'),_0x2436f9[_0x54af0e],_0x4bd6('0x14e')));}}return{'code':0xc8,'result':_0x4bd6('0x14e')};};AGIVertices['prototype'][_0x4bd6('0x156')]=function(_0x50d6ef){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x157'),_0x50d6ef[_0x4bd6('0x3a')]));return this['channel'][_0x4bd6('0x156')]();};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x158')]=function(_0x4fdc6d){logger['info'](util['format'](_0x4bd6('0x159'),_0x4fdc6d[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x4fdc6d[_0x4bd6('0x80')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xee'));}var _0x5a138d=_0x4bd6('0x145');var _0x28fdfd=util['format'](_0x4bd6('0x13a'),FILES_PATH,rs[_0x4bd6('0x125')](0x4));var _0x3bc635=util['format'](_0x4bd6('0xa5'),_0x28fdfd,_0x5a138d);var _0x4ce44b=!![];if(_0x4fdc6d[_0x4bd6('0x13b')]===_0x4bd6('0x13c')){_0x4ce44b=![];}var _0x213fe3=this[_0x4bd6('0xd')][_0x4bd6('0x13d')](_0x28fdfd,_0x5a138d,_0x4fdc6d['intKey'],_0x4fdc6d[_0x4bd6('0x6a')],undefined,_0x4ce44b);if(_0x213fe3['result']!==-0x1){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x15a'),_0x3bc635));var _0x2836d7=this['ispeechASR'][_0x4bd6('0x75')](this,_0x4fdc6d,_0x3bc635);if(_0x2836d7){for(var _0x4bc4d6 in _0x2836d7){if(_0x2836d7[_0x4bd6('0x9e')](_0x4bc4d6)){this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0x15b'),_0x4bc4d6[_0x4bd6('0xf0')]()),_0x2836d7[_0x4bc4d6]);}}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util['format'](_0x4bd6('0x15c'),JSON['stringify'](_0x2836d7)));}}return _0x213fe3;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x15d')]=function(_0x2df207){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x15e'),_0x2df207[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x2df207[_0x4bd6('0x80')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xee'));}if(!this[_0x4bd6('0xb0')](_0x2df207[_0x4bd6('0x61')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xb2'));}this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util['format'](_0x4bd6('0x15f'),_0x2df207[_0x4bd6('0x61')]));var _0x1726e8=this[_0x4bd6('0x87')][_0x4bd6('0x75')](this,_0x2df207);if(_0x1726e8){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x15a'),_0x1726e8));var _0x53c8f8=this[_0x4bd6('0xd')][_0x4bd6('0x10a')](_0x1726e8,_0x2df207[_0x4bd6('0x13e')]);try{fs[_0x4bd6('0x10b')](_0x1726e8+'.wav');}catch(_0x2dded1){logger[_0x4bd6('0x2d')](_0x2dded1);}return _0x53c8f8;}return this['channel'][_0x4bd6('0x2d')](_0x2df207,_0x4bd6('0x160'));};AGIVertices[_0x4bd6('0x10')]['login']=function(_0x11a2fd){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x161'),_0x11a2fd[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x11a2fd[_0x4bd6('0x162')])){return this[_0x4bd6('0xd')]['error'](_0x11a2fd,_0x4bd6('0x163'));}logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x164'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x11a2fd['findBy']));var _0x215668=this[_0x4bd6('0x58')][_0x4bd6('0x75')](this,_0x11a2fd[_0x4bd6('0x162')]);if(_0x215668){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x165'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x11a2fd['findBy']));this[_0x4bd6('0xd')]['noop'](util[_0x4bd6('0x5a')](_0x4bd6('0x165'),this['channel'][_0x4bd6('0x3d')],_0x11a2fd[_0x4bd6('0x162')]));return{'code':0xc8,'result':_0x4bd6('0x166')};}else{logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x167'),this[_0x4bd6('0xd')]['callerid'],_0x11a2fd['findBy']));this['channel']['noop'](util['format'](_0x4bd6('0x167'),this['channel']['callerid'],_0x11a2fd[_0x4bd6('0x162')]));return{'code':0xc8,'result':_0x4bd6('0x168')};}};AGIVertices['prototype'][_0x4bd6('0x169')]=function(_0x2b561a){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x16a'),_0x2b561a[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x2b561a[_0x4bd6('0x162')])){return this[_0x4bd6('0xd')]['error'](_0x2b561a,_0x4bd6('0x163'));}logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x164'),this['channel'][_0x4bd6('0x3d')],_0x2b561a['findBy']));var _0x5c6c46=this[_0x4bd6('0x57')][_0x4bd6('0x75')](this,_0x2b561a[_0x4bd6('0x162')]);if(_0x5c6c46){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x165'),this['channel'][_0x4bd6('0x3d')],_0x2b561a[_0x4bd6('0x162')]));this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x165'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x2b561a['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x167'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x2b561a[_0x4bd6('0x162')]));this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x167'),this['channel'][_0x4bd6('0x3d')],_0x2b561a[_0x4bd6('0x162')]));return{'code':0xc8,'result':_0x4bd6('0x168')};}};AGIVertices['prototype'][_0x4bd6('0x16b')]=function(_0x144fa9){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x16c'),_0x144fa9[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x144fa9['operation'])){return this[_0x4bd6('0xd')]['error'](_0x144fa9,_0x4bd6('0x16d'));}this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x16e'),_0x144fa9[_0x4bd6('0x16f')]));var _0xb5bc1d=eval(_0x144fa9['operation']);if(!this[_0x4bd6('0xb0')](_0x144fa9['variable_id'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x11f'));}var _0x52d139=this[_0x4bd6('0x11')][_0x4bd6('0x75')](this,_0x144fa9[_0x4bd6('0xe0')]);if(!_0x52d139){return this['channel']['error'](_0x144fa9,_0x4bd6('0xe1'));}if(_[_0x4bd6('0xa2')](_0xb5bc1d)){var _0x2f2e84=this;_0xb5bc1d[_0x4bd6('0xe3')](function(_0x5ecec5,_0x5aad9c){_0x2f2e84[_0x4bd6('0xd')]['setVariable'](util['format'](_0x4bd6('0x170'),_0x52d139,_0x5aad9c),_0x5ecec5);});return this[_0x4bd6('0xd')]['noop'](util[_0x4bd6('0x5a')]('variable\x20%s[key]\x20set',_0x52d139));}else{return this[_0x4bd6('0xd')][_0x4bd6('0xa7')](_0x52d139,_0xb5bc1d);}};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xc')]=function(_0x50500f){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x171'),_0x50500f[_0x4bd6('0x3a')]));if(_0x50500f['retry']===0x0){return this['maxRetry'](_0x50500f);}_0x50500f['retry']-=0x1;if(!this[_0x4bd6('0xb0')](_0x50500f[_0x4bd6('0x11e')])){return this['channel'][_0x4bd6('0x2d')](_0x50500f,'no\x20file\x20audio\x20selected');}var _0x40351e=this[_0x4bd6('0x11d')][_0x4bd6('0x75')](this,_0x50500f[_0x4bd6('0x11e')]);if(!_0x40351e){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x50500f,_0x4bd6('0x172'));}var _0x7e4b31=this[_0x4bd6('0xd')][_0x4bd6('0x120')](_0x40351e,_0x50500f['response'],_0x50500f[_0x4bd6('0x173')]);var _0x485970=_0x7e4b31['result'];if(_0x7e4b31['result']===-0x1){this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x50500f,'-1');return _0x7e4b31;}else if(_0x7e4b31[_0x4bd6('0xac')]===_0x4bd6('0x6a')){_0x7e4b31[_0x4bd6('0xb4')]=_0x7e4b31[_0x4bd6('0xb4')][_0x4bd6('0xa6')]>0x0?_0x7e4b31['result']:'t';}else if(_[_0x4bd6('0x4a')](_0x7e4b31[_0x4bd6('0xb4')])){_0x7e4b31[_0x4bd6('0xb4')]='#';_0x485970='#';}if(!this['isConfigured'](_0x50500f['variable_id'])){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x11f'));}else{var _0x46557d=this[_0x4bd6('0x11')][_0x4bd6('0x75')](this,_0x50500f['variable_id']);if(!_0x46557d){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x50500f,_0x4bd6('0xe1'));}this[_0x4bd6('0xd')][_0x4bd6('0xa7')](_0x46557d,_0x485970);}this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x50500f,_0x485970);return _0x7e4b31;};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0xb1')]=function(_0x323c23){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x174'),_0x323c23[_0x4bd6('0x3a')]));return this[_0x4bd6('0xd')]['noop'](_0x323c23[_0x4bd6('0x175')]||_0x323c23['label']);};AGIVertices['prototype'][_0x4bd6('0x176')]=function(_0x1ea4e3){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x177'),_0x1ea4e3[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x1ea4e3[_0x4bd6('0x162')])){return this['channel'][_0x4bd6('0x2d')](_0x1ea4e3,_0x4bd6('0x163'));}logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x164'),this[_0x4bd6('0xd')]['callerid'],_0x1ea4e3[_0x4bd6('0x162')]));var _0x43970b=this['getPause'][_0x4bd6('0x75')](this,_0x1ea4e3['pause_id']);var _0x697045=this[_0x4bd6('0x55')][_0x4bd6('0x75')](this,_0x1ea4e3[_0x4bd6('0x162')],_0x43970b);if(_0x697045){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x165'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x1ea4e3[_0x4bd6('0x162')]));this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x1ea4e3[_0x4bd6('0x162')]));return{'code':0xc8,'result':_0x4bd6('0x166')};}else{logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x167'),this[_0x4bd6('0xd')]['callerid'],_0x1ea4e3['findBy']));this['channel'][_0x4bd6('0xb1')](util['format'](_0x4bd6('0x165'),this['channel']['callerid'],_0x1ea4e3[_0x4bd6('0x162')]));return{'code':0xc8,'result':_0x4bd6('0x168')};}};AGIVertices['prototype'][_0x4bd6('0x178')]=function(_0x422039){logger['info'](util[_0x4bd6('0x5a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x422039[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x422039['file_id'])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x422039,'no\x20file\x20audio\x20selected');}var _0x47e9fd=this[_0x4bd6('0x11d')][_0x4bd6('0x75')](this,_0x422039['file_id']);if(!_0x47e9fd){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x422039,'no\x20file\x20audio\x20found');}var _0x582b87=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0x179'),[_0x47e9fd,_0x422039['opts']]);if(_0x582b87[_0x4bd6('0xb4')]===-0x1){return _0x582b87;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Executed\x20command\x20%s\x20%s',_0x4bd6('0x179'),_0x47e9fd));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x17a')]=function(_0x4f7d13){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x17b'),_0x4f7d13[_0x4bd6('0x3a')]));if(!this['isConfigured'](_0x4f7d13['queue_id'])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x4f7d13,_0x4bd6('0x17c'));}var _0x5c0808='';var _0x3f94f4=parseInt(_0x4f7d13[_0x4bd6('0x17d')],0xa);if(isNaN(_0x3f94f4)){_0x5c0808=_0x4f7d13['queue_id'];}else{_0x5c0808=this[_0x4bd6('0x14')][_0x4bd6('0x75')](this,_0x4f7d13[_0x4bd6('0x17d')]);if(!_0x5c0808){return this[_0x4bd6('0xd')]['error'](_0x4f7d13,_0x4bd6('0x17e'));}}var _0x2c4ed5='';if(this['isConfigured'](_0x4f7d13['file_id'])){var _0x3a3d13=this[_0x4bd6('0x11d')]['sync'](this,_0x4f7d13[_0x4bd6('0x11e')]);if(_0x3a3d13){_0x2c4ed5=_0x3a3d13;}}this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x4f7d13,_0x5c0808);if(_0x4f7d13[_0x4bd6('0xeb')][_0x4bd6('0x17f')]('x')<0x0){_0x4f7d13[_0x4bd6('0xeb')]+='x';}if(_0x4f7d13['opts'][_0x4bd6('0x17f')]('X')<0x0){_0x4f7d13[_0x4bd6('0xeb')]+='X';}this[_0x4bd6('0xd')][_0x4bd6('0xa7')](_0x4bd6('0x180'),_0x5c0808?_0x5c0808[_0x4bd6('0x181')]():'');var _0x28733e=this['channel'][_0x4bd6('0x5d')](_0x4bd6('0x182'),[_0x5c0808,_0x4f7d13['opts'],_0x4f7d13[_0x4bd6('0x78')],_0x2c4ed5,_0x4f7d13[_0x4bd6('0x6a')],_0x4f7d13[_0x4bd6('0xbe')],_0x4f7d13[_0x4bd6('0x183')],_0x4f7d13[_0x4bd6('0x184')],'',_0x4f7d13['position']]);if(_0x28733e['result']===-0x1){return _0x28733e;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xcb'),_0x4bd6('0x182'),_0x5c0808));};AGIVertices[_0x4bd6('0x10')]['record']=function(_0xc5aa35){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x185'),_0xc5aa35[_0x4bd6('0x3a')]));var _0x4e042c=_0xc5aa35[_0x4bd6('0x186')]||'wav';var _0x3baaeb=util[_0x4bd6('0x5a')](_0x4bd6('0x187'),this['channel']['uniqueid'],rs['generate'](0x5));var _0x30df03=util[_0x4bd6('0x5a')](_0x4bd6('0x188'),FILES_PATH,_0x3baaeb,_0x4e042c);var _0x301bac=util[_0x4bd6('0x5a')](_0x4bd6('0x13a'),FILES_PATH,_0x3baaeb);this[_0x4bd6('0x3e')][_0x4bd6('0x75')](this,_0xc5aa35,_0x3baaeb,_0x30df03);this['channel'][_0x4bd6('0xa7')]('RECORDING_SAVENAME',_0x3baaeb);logger[_0x4bd6('0x2f')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x301bac,_0x4e042c,_0xc5aa35[_0x4bd6('0x189')],_0xc5aa35['timeout']);return this['channel'][_0x4bd6('0x13d')](_0x301bac,_0x4e042c,_0xc5aa35[_0x4bd6('0x189')],_0xc5aa35[_0x4bd6('0x6a')],undefined,!![]);};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x18a')]=function(_0x2f4985){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x18b'),_0x2f4985[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x2f4985['url'])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0x18c'));}var _0x74b67a=this[_0x4bd6('0x69')][_0x4bd6('0x75')](this,_0x2f4985);logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x18d'),util[_0x4bd6('0x18e')](_0x74b67a,{'showHidden':![],'depth':null})));if(!this[_0x4bd6('0xb0')](_0x2f4985[_0x4bd6('0xe0')])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0x18f'));}var _0x1293e0=this[_0x4bd6('0x11')]['sync'](this,_0x2f4985[_0x4bd6('0xe0')]);if(!_0x1293e0){return this['channel'][_0x4bd6('0x2d')](_0x2f4985,'no\x20variable\x20found');}this[_0x4bd6('0xd')][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0x190'),_0x1293e0),_0x74b67a[_0x4bd6('0x7a')]?_0x74b67a[_0x4bd6('0x7a')]:_0x4bd6('0x191'));this['channel'][_0x4bd6('0xa7')](util[_0x4bd6('0x5a')](_0x4bd6('0x192'),_0x1293e0),_0x74b67a[_0x4bd6('0x7b')]?_0x74b67a[_0x4bd6('0x7b')]:'OK');if(_0x74b67a[_0x4bd6('0x6f')]){try{this[_0x4bd6('0xa4')](_0x74b67a[_0x4bd6('0x6f')],_0x1293e0);}catch(_0x51712d){logger[_0x4bd6('0x2d')](util[_0x4bd6('0x5a')](_0x4bd6('0x193'),_0x1293e0));}}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x194'),_0x1293e0));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x195')]=function(_0x28871c){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x196'),_0x28871c['label']));return this['channel']['sayDigits'](_0x28871c[_0x4bd6('0x197')][_0x4bd6('0x198')](/\s+/g,''),_0x28871c['escape_digits']);};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x199')]=function(_0x3ee7d7){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3ee7d7[_0x4bd6('0x3a')]));return this['channel'][_0x4bd6('0x19a')](_0x3ee7d7[_0x4bd6('0x19b')][_0x4bd6('0x198')](/\s+/g,''),_0x3ee7d7['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x581442){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x19c'),_0x581442[_0x4bd6('0x3a')]));return this[_0x4bd6('0xd')][_0x4bd6('0x19d')](_0x581442[_0x4bd6('0x61')],_0x581442[_0x4bd6('0x189')]);};AGIVertices[_0x4bd6('0x10')]['sendMail']=function(_0x38db8e){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x19e'),_0x38db8e['label']));if(!this['isConfigured'](_0x38db8e['account_id'])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x19f'));}var _0x350d9a=this['getMailAccount'][_0x4bd6('0x75')](this,_0x38db8e[_0x4bd6('0x1a0')]);if(!_0x350d9a||!_0x350d9a[_0x4bd6('0x1a1')]){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x38db8e,'no\x20mail\x20account\x20found');}var _0xe22f4e={'from':util[_0x4bd6('0x5a')](_0x4bd6('0x1a2'),_0x350d9a[_0x4bd6('0x15')],_0x350d9a[_0x4bd6('0x1a3')]||_0x350d9a[_0x4bd6('0x1a1')][_0x4bd6('0x1a4')]),'to':_0x38db8e['to']||'','cc':_0x38db8e['cc']||'','bcc':_0x38db8e[_0x4bd6('0x1a5')]||'','subject':_0x38db8e[_0x4bd6('0x1a6')],'html':_0x38db8e[_0x4bd6('0x61')],'text':_0x38db8e['text']};var _0x36d97d={'tls':{'rejectUnauthorized':![]}};if(_0x350d9a['Smtp'][_0x4bd6('0x1a7')]){_0x36d97d[_0x4bd6('0x1a7')]=_0x350d9a[_0x4bd6('0x1a1')]['service'];}else{_0x36d97d[_0x4bd6('0x1a8')]=_0x350d9a['Smtp'][_0x4bd6('0x1a8')];_0x36d97d[_0x4bd6('0x1a9')]=_0x350d9a[_0x4bd6('0x1a1')]['port'];_0x36d97d['secure']=_0x350d9a['Smtp'][_0x4bd6('0x1aa')];}if(_0x350d9a[_0x4bd6('0x1a1')][_0x4bd6('0x1ab')]){_0x36d97d[_0x4bd6('0x1ac')]={'user':_0x350d9a['Smtp']['user'],'pass':_0x350d9a['Smtp'][_0x4bd6('0x1ad')]};}if(this['isConfigured'](_0x38db8e['template_id'])){}logger[_0x4bd6('0xe6')](_0x4bd6('0x1ae'),JSON[_0x4bd6('0xa8')](_0xe22f4e));this[_0x4bd6('0x38')][_0x4bd6('0x75')](this,_0x38db8e,_0x38db8e[_0x4bd6('0x1a0')]);this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x350d9a[_0x4bd6('0x15')]));this['sendMailMessage'][_0x4bd6('0x75')](this,_0x36d97d,_0xe22f4e);return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0x1af'));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1b0')]=function(_0x4fd541){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x1b1'),_0x4fd541[_0x4bd6('0x3a')]));return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1b2')]=function(_0x398e7e){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x1b3'),_0x398e7e[_0x4bd6('0x3a')]));if(!this['isConfigured'](_0x398e7e[_0x4bd6('0x1b4')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('no\x20sms\x20account\x20configured');}var _0x1073f4=this['getSmsAccount'][_0x4bd6('0x75')](this,_0x398e7e[_0x4bd6('0x1b4')]);if(!_0x1073f4){return this['channel'][_0x4bd6('0x2d')](_0x398e7e,_0x4bd6('0x1b5'));}var _0x1e5d0b={'body':_0x398e7e[_0x4bd6('0x1b6')],'phone':_0x398e7e['to']||'','SmsAccountId':_0x1073f4['id']};logger['debug'](_0x4bd6('0x1b7'),JSON[_0x4bd6('0xa8')](_0x1e5d0b));this[_0x4bd6('0x38')]['sync'](this,_0x398e7e,_0x398e7e[_0x4bd6('0x1b4')]);this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x1073f4[_0x4bd6('0x15')]));this[_0x4bd6('0x37')][_0x4bd6('0x75')](this,_0x1e5d0b);return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4bd6('0x10')]['set']=function(_0x5b6a8c){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x5b6a8c[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x5b6a8c[_0x4bd6('0xe0')])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x5b6a8c,_0x4bd6('0x1b8'));}var _0x3deea0=this[_0x4bd6('0x11')][_0x4bd6('0x75')](this,_0x5b6a8c[_0x4bd6('0xe0')]);if(!_0x3deea0){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x5b6a8c,_0x4bd6('0xe1'));}return this['channel'][_0x4bd6('0xa7')](_0x3deea0,_0x5b6a8c[_0x4bd6('0x1b9')]);};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1ba')]=function(_0x2a3b37){logger['info'](util[_0x4bd6('0x5a')](_0x4bd6('0x1bb'),_0x2a3b37[_0x4bd6('0x3a')]));this['channel']['noop'](_0x4bd6('0x1bc'));if(_0x2a3b37[_0x4bd6('0xc2')]===_0x4bd6('0x1bd')){this['channel'][_0x4bd6('0xb1')](_0x4bd6('0x1be'));return this[_0x4bd6('0xd')][_0x4bd6('0xc2')]();}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')]('Skipped\x20Answer');};AGIVertices['prototype'][_0x4bd6('0x1bf')]=function(_0x3b80b8){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3b80b8[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x3b80b8['project_id'])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x3b80b8,_0x4bd6('0x1c0'));}var _0x4f4368=this['getSquareProject'][_0x4bd6('0x75')](this,_0x3b80b8['project_id']);if(!this[_0x4bd6('0xb0')](_0x4f4368)){return this[_0x4bd6('0xd')]['error'](_0x3b80b8,util[_0x4bd6('0x5a')](_0x4bd6('0x1c1'),_0x3b80b8[_0x4bd6('0x1c2')]));}if(_0x4f4368===this[_0x4bd6('0xd')][_0x4bd6('0x3c')]){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x3b80b8,_0x4bd6('0x1c3'));}this[_0x4bd6('0x38')]['sync'](this,_0x3b80b8,_0x4f4368);var _0x1119b1=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0x1c4'),util[_0x4bd6('0x5a')](_0x4bd6('0x1c5'),config[_0x4bd6('0xbe')][_0x4bd6('0x1a8')]||_0x4bd6('0x1c6'),_0x4f4368,this['channel'][_0x4bd6('0x3c')]));if(_0x1119b1['result']===-0x1){return _0x1119b1;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util['format'](_0x4bd6('0xcb'),_0x4bd6('0x1c4'),_0x4f4368));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1c7')]=function(_0x2f80eb){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2f80eb[_0x4bd6('0x3a')]));var _0x22778c=this[_0x4bd6('0x1c8')]['sync'](this,_0x2f80eb[_0x4bd6('0xc0')]);this[_0x4bd6('0x38')]['sync'](this,_0x2f80eb,_0x2f80eb['command']);if(this[_0x4bd6('0xb0')](_0x2f80eb[_0x4bd6('0xe0')])){var _0x3cb9b6=this['getVariable'][_0x4bd6('0x75')](this,_0x2f80eb[_0x4bd6('0xe0')]);if(_0x3cb9b6){this[_0x4bd6('0xd')]['setVariable'](_0x3cb9b6,_0x22778c);return this[_0x4bd6('0xd')]['noop'](util['format'](_0x4bd6('0x1c9'),_0x2f80eb[_0x4bd6('0xc0')],_0x3cb9b6));}}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x1ca'),_0x2f80eb[_0x4bd6('0xc0')]));};AGIVertices['prototype'][_0x4bd6('0x1cb')]=function(_0x965f17){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x1cc'),_0x965f17[_0x4bd6('0x3a')]));_0x965f17[_0x4bd6('0x61')]=_0x965f17[_0x4bd6('0x61')][_0x4bd6('0x198')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4bd6('0xb0')](_0x965f17[_0x4bd6('0x60')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0x1cd'));}if(!this[_0x4bd6('0xb0')](_0x965f17[_0x4bd6('0x61')])){return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](_0x4bd6('0xb2'));}this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x1ce'),_0x965f17[_0x4bd6('0x61')]));var _0x13d0ab=this[_0x4bd6('0x5f')][_0x4bd6('0x75')](this,_0x965f17);if(_0x13d0ab){this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x13d0ab));var _0x10e315=this['channel'][_0x4bd6('0x10a')](_0x13d0ab);try{fs[_0x4bd6('0x10b')](_0x13d0ab+'.wav');}catch(_0xaf64f9){logger['error'](_0xaf64f9);}return _0x10e315;}return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x965f17,_0x4bd6('0x1cf'));};AGIVertices['prototype'][_0x4bd6('0x1d0')]=function(_0x2f5320){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2f5320['label']));_0x2f5320['text']=_0x2f5320['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4bd6('0xb0')](_0x2f5320[_0x4bd6('0x61')])){return this[_0x4bd6('0xd')]['noop'](_0x4bd6('0xb2'));}this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x1d1'),_0x2f5320[_0x4bd6('0x61')]));var _0x1e7a96=this[_0x4bd6('0x67')][_0x4bd6('0x75')](this,_0x2f5320);if(_0x1e7a96){this['channel'][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')]('Google\x20TTS\x20%s\x20file\x20created',_0x1e7a96));var _0x3c6ba0=this[_0x4bd6('0xd')][_0x4bd6('0x10a')](_0x1e7a96);try{fs[_0x4bd6('0x10b')](_0x1e7a96+_0x4bd6('0x10c'));}catch(_0x55b511){logger[_0x4bd6('0x2d')](_0x55b511);}return _0x3c6ba0;}return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x2f5320,_0x4bd6('0x1d2'));};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1d3')]=function(_0x4f671d){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x1d4'),_0x4f671d[_0x4bd6('0x3a')]));if(!this[_0x4bd6('0xb0')](_0x4f671d[_0x4bd6('0x162')])){return this['channel'][_0x4bd6('0x2d')](_0x4f671d,_0x4bd6('0x163'));}logger['info'](util['format'](_0x4bd6('0x164'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x4f671d['findBy']));var _0xd1647e=this[_0x4bd6('0x56')][_0x4bd6('0x75')](this,_0x4f671d[_0x4bd6('0x162')]);if(_0xd1647e){logger[_0x4bd6('0x2f')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x4bd6('0x3d')],_0x4f671d['findBy']));this[_0x4bd6('0xd')]['noop'](util[_0x4bd6('0x5a')](_0x4bd6('0x165'),this[_0x4bd6('0xd')]['callerid'],_0x4f671d['findBy']));return{'code':0xc8,'result':_0x4bd6('0x166')};}else{logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x167'),this[_0x4bd6('0xd')][_0x4bd6('0x3d')],_0x4f671d[_0x4bd6('0x162')]));this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0x167'),this['channel'][_0x4bd6('0x3d')],_0x4f671d[_0x4bd6('0x162')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4bd6('0x10')][_0x4bd6('0x1d5')]=function(_0xe49b1e){logger[_0x4bd6('0x2f')](util['format'](_0x4bd6('0x1d6'),_0xe49b1e[_0x4bd6('0x3a')]));var _0x4dafcb=this[_0x4bd6('0xd')][_0x4bd6('0x5d')](_0x4bd6('0x1d7'),[_0xe49b1e[_0x4bd6('0x1d8')],_0xe49b1e['options']]);if(_0x4dafcb[_0x4bd6('0xb4')]===-0x1){return _0x4dafcb;}return this[_0x4bd6('0xd')][_0x4bd6('0xb1')](util[_0x4bd6('0x5a')](_0x4bd6('0xcb'),_0x4bd6('0x1d7'),_0xe49b1e[_0x4bd6('0x1d8')]));};AGIVertices['prototype'][_0x4bd6('0x1d9')]=function(_0x4a075c){logger[_0x4bd6('0x2f')](util[_0x4bd6('0x5a')](_0x4bd6('0x1da'),_0x4a075c[_0x4bd6('0x3a')]));if(!this['isConfigured'](_0x4a075c[_0x4bd6('0xe0')])){return this[_0x4bd6('0xd')][_0x4bd6('0x2d')](_0x4a075c,_0x4bd6('0x1b8'));}var _0x32535e=this[_0x4bd6('0x11')][_0x4bd6('0x75')](this,_0x4a075c[_0x4bd6('0xe0')]);if(!_0x32535e){return this['channel'][_0x4bd6('0x2d')](_0x4a075c,_0x4bd6('0xe1'));}var _0x297ee6=this[_0x4bd6('0xd')][_0x4bd6('0x11')](_0x32535e);return{'code':0xc8,'result':_0x297ee6['extra']?_0x297ee6[_0x4bd6('0xac')]:'-'};};String[_0x4bd6('0x10')][_0x4bd6('0xab')]=function(_0x5dcd87,_0x10d8a3){return this['split'](_0x5dcd87)[_0x4bd6('0x1db')](_0x10d8a3);};module[_0x4bd6('0x1dc')]=AGIVertices;
\ No newline at end of file
+var _0x0f6c=['Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','lodash','odbc','randomstring','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','menu','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','Intervals','interval','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','isNil','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','number','timeout','includes','POST','PUT','method','body','headers','computedVariables','sync','render','url','parse','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','isArray','length','replaceObjectAllVariables','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','setVariable','%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','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','providerResponse','out','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','maxRetry','retry','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','NOBEEP','TILDE_ASR_%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','no\x20find\x20by\x20configured','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','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','host','port','secure','authentication','auth','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','arg_1','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Executed\x20command\x20%s\x20%s','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','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','vswitch'];(function(_0x3f2658,_0xbaea6f){var _0x39ef4b=function(_0x5850d3){while(--_0x5850d3){_0x3f2658['push'](_0x3f2658['shift']());}};_0x39ef4b(++_0xbaea6f);}(_0x0f6c,0x1d4));var _0xc0f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0f6c[_0x4cf98e];return _0x1623ac;};'use strict';var fs=require('fs');var path=require(_0xc0f6('0x0'));var util=require('util');var _=require(_0xc0f6('0x1'));var sh=require('shelljs');var odbc=require(_0xc0f6('0x2'))();var rs=require(_0xc0f6('0x3'));var moment=require('moment');var Mustache=require(_0xc0f6('0x4'));var rp=require('request-promise');var logger=require(_0xc0f6('0x5'))(_0xc0f6('0x6'));var config=require(_0xc0f6('0x7'));var scripts=require('./scripts');var FILES_PATH=_0xc0f6('0x8');var recursiveMapAttributes=[_0xc0f6('0x9'),'rawBody'];var verticesWithRetry=[_0xc0f6('0xa'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x2cf839,_0x10d79a,_0x4b9aa8){this[_0xc0f6('0xb')]=_0x2cf839;this[_0xc0f6('0xc')]=_0x10d79a;this[_0xc0f6('0xd')]=_0x4b9aa8;};AGIVertices[_0xc0f6('0xe')]['getVariable']=function(_0x5d2569,_0x4b6c05){this['rpc'][_0xc0f6('0xf')](_0x5d2569)['then'](function(_0xdf14b9){_0x4b6c05(null,_0xdf14b9?_0xdf14b9[_0xc0f6('0x10')]:![]);})[_0xc0f6('0x11')](function(_0x1ff540){_0x4b6c05(_0x1ff540);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x12')]=function(_0x2139be,_0x281145){this[_0xc0f6('0xc')][_0xc0f6('0x13')](_0x2139be)[_0xc0f6('0x14')](function(_0x2c22c6){_0x281145(null,_0x2c22c6?_0x2c22c6['name']:![]);})['catch'](function(_0x1bd7ce){_0x281145(_0x1bd7ce);});};AGIVertices[_0xc0f6('0xe')]['getSquareProject']=function(_0xacfe72,_0x37d08e){this[_0xc0f6('0xc')][_0xc0f6('0x15')](_0xacfe72)[_0xc0f6('0x14')](function(_0x217ec3){_0x37d08e(null,_0x217ec3?_0x217ec3[_0xc0f6('0x10')]:![]);})['catch'](function(_0x389ccd){_0x37d08e(_0x389ccd);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x16')]=function(_0x4953ed,_0x1bb08a){this[_0xc0f6('0xc')]['getSquareOdbcById'](_0x4953ed)['then'](function(_0x3a2315){_0x1bb08a(null,_0x3a2315?_0x3a2315[_0xc0f6('0x17')]:![]);})[_0xc0f6('0x11')](function(_0x16f6f7){_0x1bb08a(_0x16f6f7);});};AGIVertices[_0xc0f6('0xe')]['getUser']=function(_0x136871,_0x25342d){this['rpc'][_0xc0f6('0x18')](_0x136871)[_0xc0f6('0x14')](function(_0x54cc3b){_0x25342d(null,_0x54cc3b?_0x54cc3b[_0xc0f6('0x10')]:![]);})[_0xc0f6('0x11')](function(_0x5ee087){_0x25342d(_0x5ee087);});};AGIVertices['prototype'][_0xc0f6('0x19')]=function(_0x5804c9,_0x3e7d3c){this[_0xc0f6('0xc')][_0xc0f6('0x1a')](_0x5804c9)[_0xc0f6('0x14')](function(_0x318223){_0x3e7d3c(null,_0x318223?_0x318223['name']:![]);})['catch'](function(_0x14b674){_0x3e7d3c(_0x14b674);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1b')]=function(_0x545d3e,_0x4cb1d7){var _0x1e0bf1=this;this[_0xc0f6('0xc')][_0xc0f6('0x1c')](_0x545d3e)[_0xc0f6('0x14')](function(_0x4ba885){_0x4cb1d7(null,_0x4ba885?_0x1e0bf1[_0xc0f6('0x1d')](_0x4ba885[_0xc0f6('0x1e')]):![]);})[_0xc0f6('0x11')](function(_0x416a8b){_0x4cb1d7(_0x416a8b);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1f')]=function(_0x1128bb,_0x45bee9){this['rpc']['getMailAccountById'](_0x1128bb)[_0xc0f6('0x14')](function(_0x4f847c){_0x45bee9(null,_0x4f847c?_0x4f847c:![]);})[_0xc0f6('0x11')](function(_0x5a94d0){_0x45bee9(_0x5a94d0);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x20')]=function(_0x55ef20,_0x2e44e0,_0x165753){this[_0xc0f6('0xd')][_0xc0f6('0x20')](_0x55ef20,_0x2e44e0)[_0xc0f6('0x14')](function(){_0x165753(null);})[_0xc0f6('0x11')](function(_0x24fbe1){_0x165753(_0x24fbe1);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x21')]=function(_0x99f8a2,_0x50367f){this[_0xc0f6('0xc')]['getIntervalById'](_0x99f8a2)[_0xc0f6('0x14')](function(_0x557ad4){if(_0x557ad4){if(_0x557ad4[_0xc0f6('0x22')]){_0x50367f(null,[_0x557ad4['interval']]);}else{_0x50367f(null,_['map'](_0x557ad4[_0xc0f6('0x23')],_0xc0f6('0x24')));}}else{_0x50367f(null,![]);}})[_0xc0f6('0x11')](function(_0x44c91b){_0x50367f(_0x44c91b);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1d')]=function(_0x259090){return util['format'](_0xc0f6('0x25'),FILES_PATH,_0x259090);};AGIVertices['prototype'][_0xc0f6('0x26')]=function(_0xaa8189,_0x3e3f08,_0x308fe8){odbc['open'](_0xaa8189,function(_0x4e739b){if(_0x4e739b){logger[_0xc0f6('0x27')](_0xc0f6('0x28'),_0x4e739b);_0x308fe8(_0x4e739b);}else{logger[_0xc0f6('0x29')](_0xc0f6('0x2a'));odbc[_0xc0f6('0x2b')](_0x3e3f08,function(_0x1cefb2,_0x210c2d){if(_0x1cefb2){logger[_0xc0f6('0x29')]('Error\x20executing\x20query\x20%s',_0x3e3f08);_0x308fe8(_0x1cefb2);}else{logger['info'](_0xc0f6('0x2c'),_0x3e3f08);odbc[_0xc0f6('0x2d')](function(_0x1429d1){if(_0x1429d1){logger[_0xc0f6('0x27')](_0xc0f6('0x2e'),_0x1429d1);}_0x308fe8(null,_0x210c2d);});}});}});};AGIVertices[_0xc0f6('0xe')]['getSmsAccount']=function(_0x422921,_0x41e1d6){this['rpc'][_0xc0f6('0x2f')](_0x422921)[_0xc0f6('0x14')](function(_0x5911dd){_0x41e1d6(null,_0x5911dd?_0x5911dd:![]);})[_0xc0f6('0x11')](function(_0x2db558){_0x41e1d6(_0x2db558);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x30')]=function(_0x459efc,_0x51e693){this[_0xc0f6('0xc')][_0xc0f6('0x30')](_0x459efc)[_0xc0f6('0x14')](function(_0x551e69){_0x51e693(null,_0x551e69);})[_0xc0f6('0x11')](function(_0x25960c){_0x51e693(_0x25960c);});};AGIVertices['prototype'][_0xc0f6('0x31')]=function(_0x399cbd,_0x192f3d,_0x349896){this[_0xc0f6('0xc')][_0xc0f6('0x31')]({'uniqueid':this[_0xc0f6('0xb')][_0xc0f6('0x32')],'node':_0x399cbd[_0xc0f6('0x33')],'application':_0x399cbd[_0xc0f6('0x34')],'data':_0x192f3d||null,'project_name':this[_0xc0f6('0xb')]['arg_1'],'callerid':this['channel']['callerid']})[_0xc0f6('0x14')](function(_0x5c8fe4){if(_0x349896){_0x349896(null,_0x5c8fe4);}})[_0xc0f6('0x11')](function(_0x19305f){if(_0x349896){_0x349896(_0x19305f);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x448fce,_0x5d7c37,_0x2c0d52,_0x7d1bae){this[_0xc0f6('0xc')]['createSquareRecording']({'uniqueid':this['channel'][_0xc0f6('0x32')],'callerid':this['channel'][_0xc0f6('0x35')],'calleridname':this[_0xc0f6('0xb')]['calleridname'],'context':this['channel']['context'],'extension':this['channel'][_0xc0f6('0x36')],'priority':this[_0xc0f6('0xb')]['priority'],'accountcode':this['channel'][_0xc0f6('0x37')],'dnid':this['channel'][_0xc0f6('0x38')],'projectName':this[_0xc0f6('0xb')]['arg_1'],'saveName':_0x5d7c37,'filename':_0x448fce[_0xc0f6('0x39')]||_0x5d7c37,'savePath':_0x2c0d52})['then'](function(_0x2e3738){_0x7d1bae(null,_0x2e3738);})[_0xc0f6('0x11')](function(_0x4813b5){_0x7d1bae(_0x4813b5);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x3a')]=function(_0x732ef9,_0x1b1b17,_0x296406,_0x34489f,_0x4452d5){this[_0xc0f6('0xc')][_0xc0f6('0x3a')]({'uniqueid':this[_0xc0f6('0xb')][_0xc0f6('0x32')],'body':_0x732ef9,'direction':_0x1b1b17,'providerName':_0x296406,'providerResponse':_0x34489f})[_0xc0f6('0x14')](function(_0x555174){if(_0x4452d5){_0x4452d5(null,_0x555174);}})[_0xc0f6('0x11')](function(_0x27938d){if(_0x4452d5){_0x4452d5(_0x27938d);}});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x3b')]=function(_0x2dd45d,_0x8ab1b9){this[_0xc0f6('0xc')][_0xc0f6('0x3b')]({'firstName':_[_0xc0f6('0x3c')](_0x2dd45d[_0xc0f6('0x10')])||_['isNil'](_0x2dd45d['name'])?_0xc0f6('0x3d')+Math[_0xc0f6('0x3e')]():_0x2dd45d['name'],'lastName':_['isEmpty'](_0x2dd45d[_0xc0f6('0x3f')])||_['isNil'](_0x2dd45d[_0xc0f6('0x3f')])?null:_0x2dd45d[_0xc0f6('0x3f')],'phone':_0x2dd45d[_0xc0f6('0x40')],'ListId':_0x2dd45d[_0xc0f6('0x41')],'scheduledat':_0x2dd45d[_0xc0f6('0x42')],'callbackUniqueid':this[_0xc0f6('0xb')][_0xc0f6('0x32')],'tags':_0xc0f6('0x43'),'description':_0xc0f6('0x44')+_0x2dd45d[_0xc0f6('0x42')][_0xc0f6('0x45')](),'priority':_0x2dd45d[_0xc0f6('0x46')]})[_0xc0f6('0x14')](function(_0x4e39be){_0x8ab1b9(null,_0x4e39be);})[_0xc0f6('0x11')](function(_0x2ad4bc){_0x8ab1b9(_0x2ad4bc);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x47')]=function(_0x492761,_0x15680f){this[_0xc0f6('0xc')][_0xc0f6('0x48')](_0x492761)['then'](function(_0x389867){_0x15680f(null,_0x389867?_0x389867['name']:![]);})['catch'](function(_0x322e63){_0x15680f(_0x322e63);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x49')]=function(_0x36cb85,_0x138353,_0x2cedb7){var _0x5f4dde={'role':'agent'};_0x5f4dde[_0x36cb85]=this[_0xc0f6('0xb')][_0xc0f6('0x35')];this['rpc'][_0xc0f6('0x49')](_0x5f4dde,_0x138353,this[_0xc0f6('0xb')][_0xc0f6('0x32')])[_0xc0f6('0x14')](function(_0x220651){_0x2cedb7(null,_[_0xc0f6('0x4a')](_0x220651)?![]:!![]);})['catch'](function(_0x3667fe){logger['error'](_0x3667fe);_0x2cedb7(null,![]);});};AGIVertices[_0xc0f6('0xe')]['agentUnpause']=function(_0x2e8474,_0x419143){var _0x134a57={'role':_0xc0f6('0x4b')};_0x134a57[_0x2e8474]=this[_0xc0f6('0xb')]['callerid'];this['rpc'][_0xc0f6('0x4c')](_0x134a57)[_0xc0f6('0x14')](function(_0x18ef07){_0x419143(null,_[_0xc0f6('0x4a')](_0x18ef07)?![]:!![]);})[_0xc0f6('0x11')](function(_0xa14f4){logger['error'](_0xa14f4);_0x419143(null,![]);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x4d')]=function(_0x4de5f4,_0x2a5947){var _0x3c462f={'role':_0xc0f6('0x4b')};_0x3c462f[_0x4de5f4]=this[_0xc0f6('0xb')][_0xc0f6('0x35')];this['rpc'][_0xc0f6('0x4d')](_0x3c462f)['then'](function(_0x14c347){_0x2a5947(null,_[_0xc0f6('0x4a')](_0x14c347)?![]:!![]);})['catch'](function(_0x435d94){logger[_0xc0f6('0x27')](_0x435d94);_0x2a5947(null,![]);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x4e')]=function(_0x53db25,_0x3cbed2){var _0x2a0581={'role':_0xc0f6('0x4b')};_0x2a0581[_0x53db25]=this['channel'][_0xc0f6('0x35')];var _0x541269=_0x53db25!=_0xc0f6('0x4f')?util[_0xc0f6('0x50')](_0xc0f6('0x51'),_0xc0f6('0x52'),this[_0xc0f6('0xb')][_0xc0f6('0x35')]):undefined;this[_0xc0f6('0xc')][_0xc0f6('0x4e')](_0x2a0581,_0x541269)['then'](function(_0x108f5c){_0x3cbed2(null,_['isNil'](_0x108f5c)?![]:!![]);})[_0xc0f6('0x11')](function(_0x3a8acd){logger[_0xc0f6('0x27')](_0x3a8acd);_0x3cbed2(null,![]);});};AGIVertices['prototype'][_0xc0f6('0x53')]=function(_0x56d251,_0x17d775){sh['exec'](_[_0xc0f6('0x54')](_0x56d251),function(_0x3b2f72,_0xadb7e2){var _0x2bd784=_0xadb7e2[_0xc0f6('0x55')](/(\r\n|\n|\r)/gm,'');_0x17d775(null,_0x2bd784);});};AGIVertices[_0xc0f6('0xe')]['googleCloudTTS']=function(_0x395b3e,_0x45e649){scripts[_0xc0f6('0x56')](_0x395b3e[_0xc0f6('0x57')],_0x395b3e[_0xc0f6('0x58')]||_0xc0f6('0x59'),_0x395b3e[_0xc0f6('0x59')],_0x395b3e[_0xc0f6('0x5a')]||_0xc0f6('0x5b'),_0x395b3e[_0xc0f6('0x5c')]||_0xc0f6('0x5d'),_0x395b3e[_0xc0f6('0x5e')]||_0xc0f6('0x5f'))[_0xc0f6('0x14')](function(_0x183442){_0x45e649(null,_0x183442);})[_0xc0f6('0x11')](function(_0x3c6774){_0x45e649(_0x3c6774);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x60')]=function(_0x36630a,_0x1045fc){scripts[_0xc0f6('0x60')](_0x36630a[_0xc0f6('0x59')],_0x36630a['google_tts_language']||'en',0x1)[_0xc0f6('0x14')](function(_0x27dffc){_0x1045fc(null,_0x27dffc);})[_0xc0f6('0x11')](function(_0x99b1c7){_0x1045fc(_0x99b1c7);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x61')]=function(_0x93a0a7,_0xa1c8bc){var _0x1053b9={'uri':_0x93a0a7['url'],'method':_0x93a0a7['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x93a0a7['timeout'])===_0xc0f6('0x62')&&parseInt(_0x93a0a7[_0xc0f6('0x63')])>=0x1?parseInt(_0x93a0a7[_0xc0f6('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xc0f6('0x64')]([_0xc0f6('0x65'),_0xc0f6('0x66')],_0x1053b9[_0xc0f6('0x67')]['toUpperCase']())){try{_0x1053b9[_0xc0f6('0x68')]=_0x93a0a7['rawBody']?JSON['parse'](_0x93a0a7['rawBody']):{};}catch(_0x53c797){logger[_0xc0f6('0x27')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x53c797);}}try{_0x1053b9[_0xc0f6('0x69')]=_0x93a0a7['rawHeaders']?JSON['parse'](_0x93a0a7[_0xc0f6('0x9')]):{};}catch(_0x5ac92f){logger[_0xc0f6('0x27')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5ac92f);}if(_0x93a0a7[_0xc0f6('0x6a')]){try{var _0x4ad349=require(_0x93a0a7['computedVariables'])[_0xc0f6('0x6b')](this,_0x1053b9);_0x1053b9['uri']=Mustache[_0xc0f6('0x6c')](_0x93a0a7[_0xc0f6('0x6d')],_0x4ad349,{},['$$','$$']);if(_0x1053b9['headers']){_0x1053b9['headers']=JSON[_0xc0f6('0x6e')](Mustache[_0xc0f6('0x6c')](JSON[_0xc0f6('0x6f')](_0x1053b9[_0xc0f6('0x69')]),_0x4ad349,{},['$$','$$']));}if(_0x1053b9[_0xc0f6('0x68')]){_0x1053b9[_0xc0f6('0x68')]=JSON[_0xc0f6('0x6e')](Mustache[_0xc0f6('0x6c')](JSON[_0xc0f6('0x6f')](_0x1053b9[_0xc0f6('0x68')]),_0x4ad349,{},['$$','$$']));}}catch(_0x5cfd00){logger[_0xc0f6('0x27')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5cfd00);}}rp(_0x1053b9)['then'](function(_0x90951b){var _0x370970={'statusCode':_0x90951b['statusCode']||0xc8,'statusMessage':_0x90951b['statusMessage']||'OK','headers':_0x90951b[_0xc0f6('0x69')]||{},'body':_0x90951b[_0xc0f6('0x68')]||{}};_0xa1c8bc(null,_0x370970);})[_0xc0f6('0x11')](function(_0x5a6c97){var _0x33674f={'statusCode':_0x5a6c97[_0xc0f6('0x70')]||0x1f4,'statusMessage':_0x5a6c97[_0xc0f6('0x71')]||_0xc0f6('0x72'),'headers':_0x5a6c97[_0xc0f6('0x73')][_0xc0f6('0x69')]||{},'body':_0x5a6c97[_0xc0f6('0x73')][_0xc0f6('0x68')]||{}};_0xa1c8bc(null,_0x33674f);});};AGIVertices['prototype']['googleDialogflow']=function(_0x4233c0,_0x4331f1){scripts[_0xc0f6('0x74')](this[_0xc0f6('0xb')][_0xc0f6('0x32')],_0x4233c0['key'],_0x4233c0[_0xc0f6('0x59')],_0x4233c0[_0xc0f6('0x75')]||'en')[_0xc0f6('0x14')](function(_0xc31bb3){_0x4331f1(null,_0xc31bb3);})['catch'](function(_0x562c3a){_0x4331f1(_0x562c3a);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x76')]=function(_0x1310cc,_0x1e577b){scripts[_0xc0f6('0x76')](this['channel'][_0xc0f6('0x32')],_0x1310cc[_0xc0f6('0x77')],_0x1310cc['client_email'],_0x1310cc[_0xc0f6('0x78')],_0x1310cc['text'],_0x1310cc[_0xc0f6('0x79')]||'en')['then'](function(_0x4b7bec){_0x1e577b(null,_0x4b7bec);})[_0xc0f6('0x11')](function(_0xbbba0d){_0x1e577b(_0xbbba0d);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x7a')]=function(_0x2cd2b8,_0x420092){scripts[_0xc0f6('0x7a')](this[_0xc0f6('0xb')],_0x2cd2b8)[_0xc0f6('0x14')](function(_0x558f95){_0x420092(null,_0x558f95);})[_0xc0f6('0x11')](function(_0x1cd0f3){_0x420092(_0x1cd0f3);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x7b')]=function(_0x5a58dd,_0x3c83dc){scripts[_0xc0f6('0x7b')](_0x5a58dd[_0xc0f6('0x7c')],_0x5a58dd[_0xc0f6('0x59')],_0x5a58dd['ispeech_tts_language']||_0xc0f6('0x5b'),_0x5a58dd[_0xc0f6('0x7d')])[_0xc0f6('0x14')](function(_0x5104d1){_0x3c83dc(null,_0x5104d1);})[_0xc0f6('0x11')](function(_0x5bd27e){_0x3c83dc(_0x5bd27e);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x7e')]=function(_0x4be172,_0x405660,_0x4f52ab){scripts[_0xc0f6('0x7e')](_0x405660,_0x4be172[_0xc0f6('0x7c')],_0x4be172[_0xc0f6('0x7f')]||_0xc0f6('0x5b'),this[_0xc0f6('0x80')](_0x4be172[_0xc0f6('0x81')])?_0x4be172[_0xc0f6('0x81')]:undefined)[_0xc0f6('0x14')](function(_0x1da996){_0x4f52ab(null,_0x1da996);})[_0xc0f6('0x11')](function(_0x46bca3){_0x4f52ab(_0x46bca3);});};AGIVertices['prototype']['awsPolly']=function(_0x4175c8,_0x1d9a3b){scripts[_0xc0f6('0x82')](_0x4175c8[_0xc0f6('0x83')],_0x4175c8[_0xc0f6('0x84')],_0x4175c8['aws_polly_region'],_0x4175c8['aws_polly_voice']||_0xc0f6('0x85'),_0x4175c8[_0xc0f6('0x59')],_0x4175c8[_0xc0f6('0x86')]||'text')[_0xc0f6('0x14')](function(_0x1a2327){_0x1d9a3b(null,_0x1a2327);})[_0xc0f6('0x11')](function(_0x52b678){_0x1d9a3b(_0x52b678);});};AGIVertices['prototype']['awsLex']=function(_0x28cb84,_0x591973){scripts[_0xc0f6('0x87')](this['channel'][_0xc0f6('0x32')],_0x28cb84[_0xc0f6('0x83')],_0x28cb84[_0xc0f6('0x84')],_0x28cb84[_0xc0f6('0x88')],_0x28cb84['text'],_0x28cb84['aws_bot_name'])[_0xc0f6('0x14')](function(_0x578ec4){_0x591973(null,_0x578ec4);})['catch'](function(_0x23bb9e){_0x591973(_0x23bb9e);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x89')]=function(_0x53a96c,_0x1a0964,_0x32f0ac){scripts[_0xc0f6('0x89')](_0x1a0964,_0x53a96c['key'],_0x53a96c['google_asr_language']||_0xc0f6('0x5b'))[_0xc0f6('0x14')](function(_0x33257f){_0x32f0ac(null,_0x33257f);})[_0xc0f6('0x11')](function(_0x27da34){_0x32f0ac(_0x27da34);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x8a')]=function(_0x2fed7f,_0x35670e,_0x21469d){scripts['tildeASR'](_0x35670e,_0x2fed7f['appid'],_0x2fed7f[_0xc0f6('0x8b')],_0x2fed7f[_0xc0f6('0x8c')])[_0xc0f6('0x14')](function(_0x2da205){_0x21469d(null,_0x2da205);})[_0xc0f6('0x11')](function(_0x53727d){_0x21469d(_0x53727d);});};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x8d')]=function(_0xe8ff47){var _0x39ba8d=_[_0xc0f6('0x64')](verticesWithRetry,_0xe8ff47[_0xc0f6('0x34')])?_0xe8ff47:_[_0xc0f6('0x8e')](_0xe8ff47);for(var _0x2a2ad1 in _0x39ba8d){if(_0x39ba8d[_0xc0f6('0x8f')](_0x2a2ad1)){if(_0x39ba8d[_0x2a2ad1]&&_[_0xc0f6('0x90')](_0x39ba8d[_0x2a2ad1])){if(_[_0xc0f6('0x64')](recursiveMapAttributes,_0x2a2ad1)){_0x39ba8d[_0x2a2ad1]=this['replaceObjectAllVariables'](_0x39ba8d[_0x2a2ad1]);}else{_0x39ba8d[_0x2a2ad1]=this[_0xc0f6('0x91')](_0x39ba8d[_0x2a2ad1]);}}}}return _0x39ba8d;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x92')]=function(_0x36f755){for(var _0x49065c in _0x36f755){if(_0x36f755[_0xc0f6('0x8f')](_0x49065c)){if(_[_0xc0f6('0x93')](_0x36f755[_0x49065c])){this[_0xc0f6('0x92')](_0x36f755[_0x49065c]);}else if(_['isArray'](_0x36f755[_0x49065c])){for(var _0x1a00d9=0x0;_0x1a00d9<_0x36f755[_0x49065c]['length'];_0x1a00d9++){this['recursiveNodeIndex'](_0x36f755[_0x49065c][_0x1a00d9]);}}else if(_[_0xc0f6('0x90')](_0x36f755[_0x49065c])){_0x36f755[_0x49065c]=this[_0xc0f6('0x91')](_0x36f755[_0x49065c]);}}}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x94')]=function(_0x222916,_0x150f22){for(var _0xfaef5a in _0x222916){if(_0x222916['hasOwnProperty'](_0xfaef5a)){if(_['isPlainObject'](_0x222916[_0xfaef5a])){if(!_[_0xc0f6('0x3c')](_0x222916[_0xfaef5a])){this[_0xc0f6('0x94')](_0x222916[_0xfaef5a],util['format'](_0xc0f6('0x95'),_0x150f22,_0xfaef5a));}}else if(_[_0xc0f6('0x96')](_0x222916[_0xfaef5a])){for(var _0x493e90=0x0;_0x493e90<_0x222916[_0xfaef5a][_0xc0f6('0x97')];_0x493e90++){this[_0xc0f6('0x94')](_0x222916[_0xfaef5a][_0x493e90],util[_0xc0f6('0x50')](_0xc0f6('0x95'),_0x150f22,_0xfaef5a+'['+_0x493e90+']'));}}else{if(!_[_0xc0f6('0x4a')](_0x222916[_0xfaef5a])){this[_0xc0f6('0xb')]['setVariable'](util[_0xc0f6('0x50')](_0xc0f6('0x95'),_0x150f22,_0xfaef5a),_0x222916[_0xfaef5a]);}}}}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x98')]=function(_0x13f7c1){try{var _0x23cfcb=JSON[_0xc0f6('0x6e')](_0x13f7c1);this['recursiveNodeIndex'](_0x23cfcb);return JSON['stringify'](_0x23cfcb);}catch(_0x49b320){return this[_0xc0f6('0x91')](_0x13f7c1);}};AGIVertices['prototype'][_0xc0f6('0x91')]=function(_0x2abce5){var _0x409249=_0x2abce5[_0xc0f6('0x99')]('{');for(var _0x3a38e4=0x1;_0x3a38e4<_0x409249[_0xc0f6('0x97')];_0x3a38e4+=0x1){var _0x1f4b14=_0x409249[_0x3a38e4]['split']('}');if(_0x1f4b14[_0xc0f6('0x97')]>0x1){_0x2abce5=_0x2abce5[_0xc0f6('0x9a')]('{'+_0x1f4b14[0x0]+'}',this['channel'][_0xc0f6('0x9b')](_0x1f4b14[0x0])[_0xc0f6('0x9c')]||_0x1f4b14[0x0]);}}if(_0x409249['length']===0x1){return _0x2abce5[_0xc0f6('0x45')]();}return this[_0xc0f6('0x91')](_0x2abce5);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x9d')]=function(_0xb273f,_0x14e894){var _0x14b212=this[_0xc0f6('0xb')][_0xc0f6('0x9b')](_0xb273f);if(_0x14b212['result']===-0x1){return _0x14b212;}logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x9e'),_0x14e894,_0x14b212[_0xc0f6('0x9c')]));return this['channel']['setVariable'](_0x14e894,_0x14b212[_0xc0f6('0x9c')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x80')]=function(_0xa06eb8){return _0xa06eb8&&_0xa06eb8!=='0'&&_0xa06eb8!=='-1'&&_0xa06eb8!=='';};AGIVertices[_0xc0f6('0xe')]['maxRetry']=function(_0x36c485){this['createSquareDetailsReport'][_0xc0f6('0x6b')](this,_0x36c485,'-');_0x36c485['retry']=_0x36c485['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc0f6('0xe')]['mrcpsynth']=function(_0x1b5ea8){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x9f'),_0x1b5ea8[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x1b5ea8[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20text\x20configured');}var _0x289b0e='\x22'+_0x1b5ea8[_0xc0f6('0x59')]+'\x22';if(this[_0xc0f6('0x80')](_0x1b5ea8[_0xc0f6('0x73')])){_0x289b0e+=','+_0x1b5ea8[_0xc0f6('0x73')];}var _0x3f60eb=this['channel']['exec'](_0xc0f6('0xa1'),_0x289b0e);if(_0x3f60eb[_0xc0f6('0xa2')]===-0x1){return _0x3f60eb;}return this['channel'][_0xc0f6('0xa0')](util['format'](_0xc0f6('0xa3'),_0x289b0e));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xa4')]=function(_0x1d8f2e){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0xa5'),_0x1d8f2e[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x1d8f2e['grammar'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20grammar\x20configured');}var _0x36b202=_0x1d8f2e[_0xc0f6('0xa6')];if(this[_0xc0f6('0x80')](_0x1d8f2e['options'])){_0x36b202+=','+_0x1d8f2e[_0xc0f6('0x73')];}var _0x2ea619=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0xa8'),_0x36b202);if(_0x2ea619[_0xc0f6('0xa2')]===-0x1){return _0x2ea619;}var _0x9f2392=this[_0xc0f6('0x9d')](_0xc0f6('0xa9'),_0xc0f6('0xaa'));if(_0x9f2392['result']===-0x1){return _0x9f2392;}var _0x40fe54=this[_0xc0f6('0x9d')](_0xc0f6('0xab'),'MRCP_RECOG_TRANSCRIPT');if(_0x40fe54[_0xc0f6('0xa2')]===-0x1){return _0x40fe54;}var _0x51604d=this[_0xc0f6('0x9d')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x51604d['result']===-0x1){return _0x51604d;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xac'),_0x36b202));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x6')]=function(_0x486e0c){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0xad'),_0x486e0c['label']));return this['channel']['agi']([_0x486e0c[_0xc0f6('0xae')],_0x486e0c['args']]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xaf')]=function(_0x21dae0){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xb0'),_0x21dae0[_0xc0f6('0x33')]));if(this[_0xc0f6('0x80')](_0x21dae0['timeout'])){logger[_0xc0f6('0x29')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x21dae0[_0xc0f6('0x63')]));var _0x308d20=this[_0xc0f6('0xb')][_0xc0f6('0xb1')](_0x21dae0[_0xc0f6('0x63')]);if(_0x308d20['result']===-0x1){return _0x308d20;}}return this[_0xc0f6('0xb')][_0xc0f6('0xaf')]();};AGIVertices['prototype'][_0xc0f6('0x43')]=function(_0x4926c2){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0xb2'),_0x4926c2[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x4926c2['list_id'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4926c2,_0xc0f6('0xb3'));}_0x4926c2[_0xc0f6('0x42')]=moment();if(this[_0xc0f6('0x80')](_0x4926c2['delay'])){_0x4926c2[_0xc0f6('0x42')]=moment()[_0xc0f6('0xb4')](_0x4926c2['delay'],'minutes');}if(!this['isConfigured'](_0x4926c2[_0xc0f6('0x46')])){_0x4926c2[_0xc0f6('0x46')]=0x2;}this[_0xc0f6('0x3b')][_0xc0f6('0x6b')](this,_0x4926c2);return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xb5'),_0x4926c2[_0xc0f6('0x40')],_0x4926c2[_0xc0f6('0x41')],_0x4926c2[_0xc0f6('0x42')]));};AGIVertices['prototype'][_0xc0f6('0xb6')]=function(_0x2ac697){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2ac697[_0xc0f6('0x33')]));var _0x4bcbb3=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0x2ac697['application'],_0x2ac697[_0xc0f6('0x73')]);if(_0x4bcbb3['result']===-0x1){return _0x4bcbb3;}return this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s\x20%s',_0x2ac697[_0xc0f6('0xb7')],_0x2ac697['options']));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xb8')]=function(_0x376bb2){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xb9'),_0x376bb2[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x376bb2[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0xba'));}var _0x542e6d='\x22'+_0x376bb2[_0xc0f6('0x59')]+'\x22';if(this['isConfigured'](_0x376bb2[_0xc0f6('0x73')])){_0x542e6d+=','+_0x376bb2[_0xc0f6('0x73')];}var _0x3524f2=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xa1'),_0x542e6d);if(_0x3524f2[_0xc0f6('0xa2')]===-0x1){return _0x3524f2;}return this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xa3'),_0x542e6d));};AGIVertices[_0xc0f6('0xe')]['sestektts']=function(_0x59aaaa){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xbb'),_0x59aaaa[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x59aaaa[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0xba'));}var _0x4b61d5='\x22'+_0x59aaaa[_0xc0f6('0x59')]+'\x22';if(this[_0xc0f6('0x80')](_0x59aaaa[_0xc0f6('0x73')])){_0x4b61d5+=','+_0x59aaaa[_0xc0f6('0x73')];}var _0x578752=this['channel']['exec'](_0xc0f6('0xa1'),_0x4b61d5);if(_0x578752[_0xc0f6('0xa2')]===-0x1){return _0x578752;}return this[_0xc0f6('0xb')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4b61d5));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xbc')]=function(_0x25e573){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x25e573[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x25e573['grammar'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xbd'));}var _0x13f9e2=_0x25e573[_0xc0f6('0xa6')];if(this[_0xc0f6('0x80')](_0x25e573[_0xc0f6('0x73')])){_0x13f9e2+=','+_0x25e573[_0xc0f6('0x73')];}var _0x38c828=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0xa8'),_0x13f9e2);if(_0x38c828[_0xc0f6('0xa2')]===-0x1){return _0x38c828;}var _0xf3db58=this[_0xc0f6('0x9d')](_0xc0f6('0xa9'),_0xc0f6('0xbe'));if(_0xf3db58[_0xc0f6('0xa2')]===-0x1){return _0xf3db58;}var _0x199690=this[_0xc0f6('0x9d')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x199690['result']===-0x1){return _0x199690;}var _0x6712a8=this[_0xc0f6('0x9d')](_0xc0f6('0xbf'),_0xc0f6('0xc0'));if(_0x6712a8[_0xc0f6('0xa2')]===-0x1){return _0x6712a8;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20MRCPRecog\x20%s',_0x13f9e2));};AGIVertices['prototype'][_0xc0f6('0xc1')]=function(_0x310d07){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0xc2'),_0x310d07['label']));if(!this['isConfigured'](_0x310d07['grammar'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xbd'));}var _0x317e16=_0x310d07[_0xc0f6('0xa6')];if(this[_0xc0f6('0x80')](_0x310d07[_0xc0f6('0x73')])){_0x317e16+=','+_0x310d07[_0xc0f6('0x73')];}var _0xbefbd6=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xa8'),_0x317e16);if(_0xbefbd6[_0xc0f6('0xa2')]===-0x1){return _0xbefbd6;}var _0xea7ab3=this[_0xc0f6('0x9d')]('RECOG_CONFIDENCE()',_0xc0f6('0xc3'));if(_0xea7ab3['result']===-0x1){return _0xea7ab3;}var _0x5b0d4c=this[_0xc0f6('0x9d')]('RECOG_INPUT()',_0xc0f6('0xc4'));if(_0x5b0d4c['result']===-0x1){return _0x5b0d4c;}var _0x1ac0c6=this[_0xc0f6('0x9d')]('RECOG_INSTANCE()',_0xc0f6('0xc5'));if(_0x1ac0c6['result']===-0x1){return _0x1ac0c6;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x317e16));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xc6')]=function(_0x4fb9c3){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0xc7'),_0x4fb9c3['label']));if(!this['isConfigured'](_0x4fb9c3['odbc_id'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4fb9c3,_0xc0f6('0xc8'));}var _0x46bdbe=this['getSquareOdbc']['sync'](this,_0x4fb9c3[_0xc0f6('0xc9')]);if(!_0x46bdbe){return this['channel'][_0xc0f6('0x27')](_0x4fb9c3,_0xc0f6('0xca'));}if(!this[_0xc0f6('0x80')](_0x4fb9c3[_0xc0f6('0x2b')])){return this[_0xc0f6('0xb')]['error'](_0x4fb9c3,_0xc0f6('0xcb'));}var _0x40c757=_0x4fb9c3[_0xc0f6('0x2b')][_0xc0f6('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0xcc'),_0x40c757));var _0x480d50=this[_0xc0f6('0x26')][_0xc0f6('0x6b')](this,_0x46bdbe,_0x40c757);this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x4fb9c3,_0x40c757);if(!this[_0xc0f6('0x80')](_0x4fb9c3[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x46edcf=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x4fb9c3[_0xc0f6('0xcd')]);if(!_0x46edcf){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4fb9c3,_0xc0f6('0xce'));}var _0x4af774=this;_0x480d50[_0xc0f6('0xcf')](function(_0x365d5d,_0x3b0255){Object[_0xc0f6('0xd0')](_0x365d5d)[_0xc0f6('0xcf')](function(_0x1780a8){_0x4af774[_0xc0f6('0xb')][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xd2'),_0x46edcf,_0x3b0255,_0x1780a8),_0x365d5d[_0x1780a8]);});});this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xd3'),_0x46edcf),_0x480d50[_0xc0f6('0x97')]);return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0xd4'),_0x46edcf));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xd5')]=function(_0x244384){logger[_0xc0f6('0xd6')](util[_0xc0f6('0x50')](_0xc0f6('0xd7'),_0x244384[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x244384[_0xc0f6('0xd8')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x244384,_0xc0f6('0xd9'));}var _0x190fa5=this[_0xc0f6('0xda')][_0xc0f6('0x6b')](this,_0x244384[_0xc0f6('0xd8')]);if(!_0x190fa5){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x244384,_0xc0f6('0xdb'));}var _0x44ea6b=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xdc'),[util[_0xc0f6('0x50')](_0xc0f6('0xdd'),_0x190fa5),_0x244384[_0xc0f6('0x63')],_0x244384[_0xc0f6('0xde')],_0x244384[_0xc0f6('0x6d')]]);if(_0x44ea6b[_0xc0f6('0xa2')]===-0x1){return _0x44ea6b;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s',_0xc0f6('0xdc')));};AGIVertices['prototype'][_0xc0f6('0xdf')]=function(_0x2009ce){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0xe0'),_0x2009ce['label']));if(!this[_0xc0f6('0x80')](_0x2009ce[_0xc0f6('0x7c')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x2009ce['text'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this['channel'][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x2009ce);this['createSquareMessage'](_0x2009ce[_0xc0f6('0x59')],'in','','');this['channel'][_0xc0f6('0xa0')](util['format'](_0xc0f6('0xe2'),_0x2009ce[_0xc0f6('0x59')]));var _0x4da855=this[_0xc0f6('0x74')][_0xc0f6('0x6b')](this,_0x2009ce);if(_0x4da855){for(var _0x4f21a4 in _0x4da855){if(_0x4da855['hasOwnProperty'](_0x4f21a4)){this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0xe3'),_0x4f21a4[_0xc0f6('0xe4')]()),_0x4da855[_0x4f21a4]);}}this[_0xc0f6('0x3a')](_0x4da855[_0xc0f6('0xe5')],'out',_0xc0f6('0xdf'),'');return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xe6'),_0x4da855[_0xc0f6('0xe5')]));}return this['channel'][_0xc0f6('0x27')](_0x2009ce,_0xc0f6('0xe7'));};AGIVertices['prototype'][_0xc0f6('0xe8')]=function(_0x3ede86){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3ede86[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x3ede86[_0xc0f6('0x77')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20project_id\x20configured');}if(!this[_0xc0f6('0x80')](_0x3ede86['client_email'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xe9'));}if(!this[_0xc0f6('0x80')](_0x3ede86[_0xc0f6('0x78')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20private_key\x20configured');}if(!this[_0xc0f6('0x80')](_0x3ede86[_0xc0f6('0x79')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20anguage\x20configured');}if(!this[_0xc0f6('0x80')](_0x3ede86[_0xc0f6('0x59')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x3ede86);this[_0xc0f6('0x3a')](_0x3ede86[_0xc0f6('0x59')],'in','','');this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Trying\x20DialogflowV2:\x20%s',_0x3ede86[_0xc0f6('0x59')]));var _0x52e89c=this[_0xc0f6('0x76')][_0xc0f6('0x6b')](this,_0x3ede86);if(_0x52e89c){for(var _0xfb504b in _0x52e89c){if(_0x52e89c[_0xc0f6('0x8f')](_0xfb504b)){if(_0xfb504b!==_0xc0f6('0xea')){this['channel'][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xe3'),_0xfb504b['toUpperCase']()),_0x52e89c[_0xfb504b]);}}}this[_0xc0f6('0x3a')](_0x52e89c[_0xc0f6('0xe5')],_0xc0f6('0xeb'),_0xc0f6('0xe8'),_0x52e89c[_0xc0f6('0xea')]);return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('DialogflowV2\x20Result\x20%s',_0x52e89c[_0xc0f6('0xe5')]));}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x3ede86,_0xc0f6('0xec'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xed')]=function(_0x3c0dfd){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0xee'),_0x3c0dfd['label']));if(!this[_0xc0f6('0x80')](_0x3c0dfd[_0xc0f6('0xef')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xc0f6('0x80')](_0x3c0dfd[_0xc0f6('0xf0')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0xf1'));}if(!this[_0xc0f6('0x80')](_0x3c0dfd[_0xc0f6('0xf2')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xf3'));}if(!this[_0xc0f6('0x80')](_0x3c0dfd['ndassistant_url'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xc0f6('0xb')][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x3c0dfd);this[_0xc0f6('0x3a')](_0x3c0dfd[_0xc0f6('0x59')],'in','','');this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xf4'),_0x3c0dfd[_0xc0f6('0x59')]));var _0x9e431b=this[_0xc0f6('0x7a')][_0xc0f6('0x6b')](this,_0x3c0dfd);if(_0x9e431b){for(var _0x4c3af1 in _0x9e431b){if(_0x9e431b[_0xc0f6('0x8f')](_0x4c3af1)){this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0xf5'),_0x4c3af1[_0xc0f6('0xe4')]()),_0x9e431b[_0x4c3af1]);}}this[_0xc0f6('0x3a')](_0x9e431b[_0xc0f6('0xe5')],_0xc0f6('0xeb'),_0xc0f6('0xed'),'');if(_0x9e431b[_0xc0f6('0xf6')]){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0xf7'),_0x9e431b['audiofile']));var _0x30ec0a=this[_0xc0f6('0xb')][_0xc0f6('0xf8')](_0x9e431b[_0xc0f6('0xf6')]);try{fs[_0xc0f6('0xf9')](_0x9e431b['audiofile']+_0xc0f6('0xfa'));}catch(_0x3d1279){logger[_0xc0f6('0x27')](_0x3d1279);}return _0x30ec0a;}else{return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0xfb'),_0x9e431b[_0xc0f6('0xe5')]));}}return this['channel'][_0xc0f6('0x27')](_0x3c0dfd,_0xc0f6('0xfc'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xfd')]=function(_0xfdc2c9){logger[_0xc0f6('0x29')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0xfdc2c9[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xfd'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xfe')]=function(_0x4abcd5){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4abcd5['label']));var _0x41a4f3='';if(_0x4abcd5['trunk_id']){if(!this['isConfigured'](_0x4abcd5['trunk_id'])){return this[_0xc0f6('0xb')]['error'](_0x4abcd5,_0xc0f6('0xff'));}else{var _0x5950fe=parseInt(_0x4abcd5[_0xc0f6('0x100')],0xa);if(isNaN(_0x5950fe)){_0x41a4f3=_0x4abcd5[_0xc0f6('0x100')];}else{_0x41a4f3=this['getTrunk'][_0xc0f6('0x6b')](this,_0x4abcd5[_0xc0f6('0x100')]);if(!_0x41a4f3){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4abcd5,_0xc0f6('0x101'));}}}}else if(_0x4abcd5['trunk_name']){_0x41a4f3=_0x4abcd5[_0xc0f6('0x102')];}else{return this['channel'][_0xc0f6('0x27')](_0x4abcd5,_0xc0f6('0xff'));}var _0x5499b8=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0xdc'),[util[_0xc0f6('0x50')](_0xc0f6('0x103'),_0x41a4f3,_0x4abcd5[_0xc0f6('0x40')]),_0x4abcd5[_0xc0f6('0x63')],_0x4abcd5[_0xc0f6('0xde')],_0x4abcd5[_0xc0f6('0x6d')]]);if(_0x5499b8[_0xc0f6('0xa2')]===-0x1){return _0x5499b8;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s',_0xc0f6('0xdc')));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x104')]=function(_0x3a059b){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x105'),_0x3a059b[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x104'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x106')]=function(_0x40d812){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x40d812[_0xc0f6('0x33')]));if(_0x40d812['retry']===0x0){return this[_0xc0f6('0x107')](_0x40d812);}_0x40d812[_0xc0f6('0x108')]-=0x1;if(!this[_0xc0f6('0x80')](_0x40d812[_0xc0f6('0x109')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x40d812,'no\x20file\x20audio\x20selected');}var _0x38a1ac=this[_0xc0f6('0x1b')][_0xc0f6('0x6b')](this,_0x40d812[_0xc0f6('0x109')]);if(!_0x38a1ac){return this['channel'][_0xc0f6('0x27')](_0x40d812,_0xc0f6('0x10a'));}if(!this[_0xc0f6('0x80')](_0x40d812[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xc0f6('0x10b'));}var _0x58f1f5=this['channel']['getData'](_0x38a1ac,_0x40d812[_0xc0f6('0x10c')],_0x40d812['maxdigit']);var _0x296339=_0x58f1f5[_0xc0f6('0xa2')]?_0x58f1f5['result'][_0xc0f6('0x45')]():'';logger[_0xc0f6('0x29')](_0xc0f6('0x10d'),JSON[_0xc0f6('0x6f')](_0x58f1f5));if(_0x58f1f5[_0xc0f6('0xa2')]===-0x1){this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x40d812,_0x296339);return _0x58f1f5;}else if(_0x58f1f5[_0xc0f6('0x9c')]==='timeout'){_0x58f1f5[_0xc0f6('0xa2')]=_0x296339[_0xc0f6('0x97')]>=parseInt(_0x40d812[_0xc0f6('0x10e')])?'x':'i';}else{_0x58f1f5['result']=_0x296339[_0xc0f6('0x97')]>=parseInt(_0x40d812[_0xc0f6('0x10e')])&&_0x296339[_0xc0f6('0x97')]<=parseInt(_0x40d812[_0xc0f6('0x10f')])?'x':'i';}var _0x4270e0=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x40d812[_0xc0f6('0xcd')]);if(!_0x4270e0){return this[_0xc0f6('0xb')]['error'](_0x40d812,'no\x20variable\x20found');}this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0x4270e0,_0x296339);if(this[_0xc0f6('0x80')](_0x40d812[_0xc0f6('0x110')])){var _0x2165ff=parseInt(_0x40d812[_0xc0f6('0x110')],0xa);var _0x3f5764=rs[_0xc0f6('0x111')]({'charset':'*','length':_0x2165ff});var _0x754d65=_0x296339[_0xc0f6('0x97')];if(_0x754d65>0x0){if(_0x754d65>_0x2165ff){this[_0xc0f6('0x31')]['sync'](this,_0x40d812,_0x40d812[_0xc0f6('0x112')]===_0xc0f6('0x113')?_0x3f5764+_0x296339[_0xc0f6('0x114')](_0x2165ff):_0x296339[_0xc0f6('0x114')](0x0,_0x754d65-_0x2165ff)+_0x3f5764);}else{this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x40d812,rs['generate']({'charset':'*','length':_0x754d65}));}}else{this[_0xc0f6('0x31')]['sync'](this,_0x40d812,'');}}else{this['createSquareDetailsReport'][_0xc0f6('0x6b')](this,_0x40d812,_0x296339);}return _0x58f1f5;};AGIVertices['prototype'][_0xc0f6('0x115')]=function(_0x5a2c89){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x116'),_0x5a2c89[_0xc0f6('0x33')]));return this[_0xc0f6('0x106')](_0x5a2c89);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x117')]=function(_0x4570a0){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4570a0[_0xc0f6('0x33')]));this['createSquareDetailsReport'][_0xc0f6('0x6b')](this,_0x4570a0,_0x4570a0[_0xc0f6('0x118')]);return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x119'),_0x4570a0[_0xc0f6('0x118')]));};AGIVertices['prototype'][_0xc0f6('0x11a')]=function(_0x59e2b9){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x11b'),_0x59e2b9[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x59e2b9[_0xc0f6('0x83')])||!this[_0xc0f6('0x80')](_0x59e2b9[_0xc0f6('0x84')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0x11c'));}if(!this[_0xc0f6('0x80')](_0x59e2b9[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x11d'),_0x59e2b9['text']));var _0x35a3df=this['awsPolly'][_0xc0f6('0x6b')](this,_0x59e2b9);if(_0x35a3df){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x11e'),_0x35a3df));var _0x26ae60=this[_0xc0f6('0xb')][_0xc0f6('0xf8')](_0x35a3df);try{fs[_0xc0f6('0xf9')](_0x35a3df+_0xc0f6('0xfa'));}catch(_0x48367f){logger[_0xc0f6('0x27')](_0x48367f);}return _0x26ae60;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x59e2b9,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x11f')]=function(_0x3d1790){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x120'),_0x3d1790[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x3d1790[_0xc0f6('0x83')])||!this[_0xc0f6('0x80')](_0x3d1790[_0xc0f6('0x84')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x11c'));}if(!this[_0xc0f6('0x80')](_0x3d1790[_0xc0f6('0x121')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x122'));}if(!this[_0xc0f6('0x80')](_0x3d1790['text'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xe1')]=!![];this[_0xc0f6('0x31')](_0x3d1790);this[_0xc0f6('0x3a')](_0x3d1790[_0xc0f6('0x59')],'in','','');this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x123'),_0x3d1790['text']));var _0x1c6b21=this[_0xc0f6('0x87')][_0xc0f6('0x6b')](this,_0x3d1790);if(_0x1c6b21){for(var _0x5957b6 in _0x1c6b21){if(_0x1c6b21[_0xc0f6('0x8f')](_0x5957b6)&&_['isString'](_0x1c6b21[_0x5957b6])){this[_0xc0f6('0xb')]['setVariable'](util[_0xc0f6('0x50')](_0xc0f6('0x124'),_0x5957b6[_0xc0f6('0xe4')]()),_0x1c6b21[_0x5957b6]);}}if(_[_0xc0f6('0x4a')](_0x1c6b21[_0xc0f6('0x71')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xc0f6('0x3a')](_0x1c6b21[_0xc0f6('0x71')],_0xc0f6('0xeb'),_0xc0f6('0x125'),'');return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x126'),_0x1c6b21['message']));}}return this['channel'][_0xc0f6('0x27')](_0x3d1790,_0xc0f6('0x127'));};AGIVertices['prototype'][_0xc0f6('0x128')]=function(_0x4e8bb9){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x129'),_0x4e8bb9[_0xc0f6('0x33')],_0x4e8bb9[_0xc0f6('0x63')]));if(!this[_0xc0f6('0x80')](_0x4e8bb9[_0xc0f6('0x7c')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x12a'));}var _0x37076c=_0xc0f6('0x12b');var _0x1c88a0=util[_0xc0f6('0x50')](_0xc0f6('0x12c'),FILES_PATH,rs[_0xc0f6('0x111')](0x4));var _0x28f918=util['format'](_0xc0f6('0x95'),_0x1c88a0,_0x37076c);var _0x3c8bc0=!![];if(_0x4e8bb9['beep']==='NOBEEP'){_0x3c8bc0=![];}var _0x32d9bc=this[_0xc0f6('0xb')][_0xc0f6('0x12d')](_0x1c88a0,_0x37076c,_0x4e8bb9[_0xc0f6('0x12e')],_0x4e8bb9[_0xc0f6('0x63')],undefined,_0x3c8bc0);if(_0x32d9bc['result']!==-0x1){this['channel'][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x12f'),_0x28f918));var _0x21e37a=this[_0xc0f6('0x89')]['sync'](this,_0x4e8bb9,_0x28f918);if(_0x21e37a){for(var _0x245bca in _0x21e37a){if(_0x21e37a[_0xc0f6('0x8f')](_0x245bca)){this['channel'][_0xc0f6('0xd1')](util['format']('GOOGLE_ASR_%s',_0x245bca[_0xc0f6('0xe4')]()),_0x21e37a[_0x245bca]);}}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x130'),JSON['stringify'](_0x21e37a)));}}return _0x32d9bc;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x131')]=function(_0x1c13f4){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x132'),_0x1c13f4['label']));if(!this[_0xc0f6('0x80')](_0x1c13f4[_0xc0f6('0x133')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x134'));}if(!this[_0xc0f6('0x80')](_0x1c13f4[_0xc0f6('0x8b')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x135'));}var _0x45a2d7='wav';var _0x3d2e1b=util[_0xc0f6('0x50')](_0xc0f6('0x12c'),FILES_PATH,rs[_0xc0f6('0x111')](0x4));var _0x5810b9=util[_0xc0f6('0x50')](_0xc0f6('0x95'),_0x3d2e1b,_0x45a2d7);var _0x2c8557=!![];if(_0x1c13f4[_0xc0f6('0x136')]===_0xc0f6('0x137')){_0x2c8557=![];}var _0x2164b3=this[_0xc0f6('0xb')][_0xc0f6('0x12d')](_0x3d2e1b,_0x45a2d7,_0x1c13f4[_0xc0f6('0x12e')],_0x1c13f4[_0xc0f6('0x63')],undefined,_0x2c8557);if(_0x2164b3[_0xc0f6('0xa2')]!==-0x1){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('tilde\x20%s\x20file\x20created',_0x5810b9));var _0x26a4d6=this[_0xc0f6('0x8a')][_0xc0f6('0x6b')](this,_0x1c13f4,_0x5810b9);if(_0x26a4d6){for(var _0x4017f1 in _0x26a4d6){if(_0x26a4d6[_0xc0f6('0x8f')](_0x4017f1)){this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0x138'),_0x4017f1[_0xc0f6('0xe4')]()),_0x26a4d6[_0x4017f1]);}}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('TildeASR\x20Result\x20%s',JSON[_0xc0f6('0x6f')](_0x26a4d6)));}}return _0x2164b3;};AGIVertices[_0xc0f6('0xe')]['gotoc']=function(_0x25e998){logger['info'](util['format'](_0xc0f6('0x139'),_0x25e998[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0x13a')](_0x25e998[_0xc0f6('0x13b')],_0x25e998[_0xc0f6('0x36')],_0x25e998[_0xc0f6('0x13c')]);};AGIVertices['prototype'][_0xc0f6('0x13d')]=function(_0x599965){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x13e'),_0x599965[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x599965['condition'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x599965,_0xc0f6('0x13f'));}try{var _0x49c7fa=eval(_0x599965[_0xc0f6('0x140')])?_0xc0f6('0x141'):_0xc0f6('0x142');this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x143'),_0x599965['condition'],_0x49c7fa));return{'code':0xc8,'result':_0x49c7fa};}catch(_0x1ebcb8){return{'code':0xc8,'result':_0xc0f6('0x142')};}};AGIVertices[_0xc0f6('0xe')]['gotoiftime']=function(_0x486647){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x144'),_0x486647[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x486647['interval_id'])){return this[_0xc0f6('0xb')]['error'](_0x486647,_0xc0f6('0x145'));}var _0x3bf021=this[_0xc0f6('0x21')][_0xc0f6('0x6b')](this,_0x486647[_0xc0f6('0x146')]);if(!_0x3bf021){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x486647,'no\x20intervals\x20found');}for(var _0x464abd=0x0;_0x464abd<_0x3bf021[_0xc0f6('0x97')];_0x464abd+=0x1){var _0x3a7627=this['channel'][_0xc0f6('0x9b')](util['format'](_0xc0f6('0x147'),_0x3bf021[_0x464abd]));if(_0x3a7627[_0xc0f6('0xa2')]===-0x1){return _0x3a7627;}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0x3a7627[_0xc0f6('0x9c')]));if(_0x3a7627[_0xc0f6('0x9c')]===_0xc0f6('0x141')){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x141')));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x141')));return{'code':0xc8,'result':_0xc0f6('0x141')};}else{logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x142')));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x148'),_0x3bf021[_0x464abd],_0xc0f6('0x142')));}}return{'code':0xc8,'result':_0xc0f6('0x142')};};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x149')]=function(_0x380bbd){logger['info'](util[_0xc0f6('0x50')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x380bbd[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0x149')]();};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x14a')]=function(_0x5d35b1){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x14b'),_0x5d35b1[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x5d35b1[_0xc0f6('0x7c')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x12a'));}var _0x2baae2=_0xc0f6('0x12b');var _0x51dd5b=util['format'](_0xc0f6('0x12c'),FILES_PATH,rs['generate'](0x4));var _0x47d21f=util['format'](_0xc0f6('0x95'),_0x51dd5b,_0x2baae2);var _0x543354=!![];if(_0x5d35b1[_0xc0f6('0x136')]===_0xc0f6('0x137')){_0x543354=![];}var _0x4f8156=this['channel'][_0xc0f6('0x12d')](_0x51dd5b,_0x2baae2,_0x5d35b1[_0xc0f6('0x12e')],_0x5d35b1['timeout'],undefined,_0x543354);if(_0x4f8156['result']!==-0x1){this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')]('ispeech\x20%s\x20file\x20created',_0x47d21f));var _0x4e6f3c=this[_0xc0f6('0x7e')][_0xc0f6('0x6b')](this,_0x5d35b1,_0x47d21f);if(_0x4e6f3c){for(var _0x2f46b2 in _0x4e6f3c){if(_0x4e6f3c['hasOwnProperty'](_0x2f46b2)){this['channel'][_0xc0f6('0xd1')](util[_0xc0f6('0x50')](_0xc0f6('0x14c'),_0x2f46b2[_0xc0f6('0xe4')]()),_0x4e6f3c[_0x2f46b2]);}}return this['channel'][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x14d'),JSON[_0xc0f6('0x6f')](_0x4e6f3c)));}}return _0x4f8156;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x14e')]=function(_0x28fc95){logger['info'](util[_0xc0f6('0x50')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x28fc95['label']));if(!this['isConfigured'](_0x28fc95[_0xc0f6('0x7c')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20key\x20configured');}if(!this[_0xc0f6('0x80')](_0x28fc95[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x14f'),_0x28fc95[_0xc0f6('0x59')]));var _0x3c37b0=this[_0xc0f6('0x7b')][_0xc0f6('0x6b')](this,_0x28fc95);if(_0x3c37b0){this['channel']['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x150'),_0x3c37b0));var _0xddf469=this['channel'][_0xc0f6('0xf8')](_0x3c37b0,_0x28fc95[_0xc0f6('0x12e')]);try{fs['unlink'](_0x3c37b0+_0xc0f6('0xfa'));}catch(_0x4d5c2c){logger[_0xc0f6('0x27')](_0x4d5c2c);}return _0xddf469;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x28fc95,_0xc0f6('0x151'));};AGIVertices['prototype'][_0xc0f6('0x152')]=function(_0xb23002){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x153'),_0xb23002[_0xc0f6('0x33')]));if(!this['isConfigured'](_0xb23002['findBy'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb23002,'no\x20find\x20by\x20configured');}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x154'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));var _0x6b2851=this['agentLogin'][_0xc0f6('0x6b')](this,_0xb23002[_0xc0f6('0x155')]);if(_0x6b2851){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002['findBy']));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger[_0xc0f6('0x29')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0xb23002[_0xc0f6('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x14520b){logger['info'](util[_0xc0f6('0x50')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x14520b[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x14520b[_0xc0f6('0x155')])){return this[_0xc0f6('0xb')]['error'](_0x14520b,_0xc0f6('0x159'));}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x154'),this['channel'][_0xc0f6('0x35')],_0x14520b[_0xc0f6('0x155')]));var _0x2ebba9=this['agentLogout']['sync'](this,_0x14520b[_0xc0f6('0x155')]);if(_0x2ebba9){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x14520b[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x14520b['findBy']));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this['channel']['callerid'],_0x14520b[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x14520b['findBy']));return{'code':0xc8,'result':_0xc0f6('0x15a')};}};AGIVertices['prototype'][_0xc0f6('0x15b')]=function(_0x2e97bc){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x15c'),_0x2e97bc[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x2e97bc[_0xc0f6('0x15d')])){return this['channel'][_0xc0f6('0x27')](_0x2e97bc,_0xc0f6('0x15e'));}this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x15f'),_0x2e97bc[_0xc0f6('0x15d')]));var _0x3f7f80=eval(_0x2e97bc[_0xc0f6('0x15d')]);if(!this[_0xc0f6('0x80')](_0x2e97bc[_0xc0f6('0xcd')])){return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x10b'));}var _0x3c8540=this[_0xc0f6('0x9b')]['sync'](this,_0x2e97bc[_0xc0f6('0xcd')]);if(!_0x3c8540){return this['channel']['error'](_0x2e97bc,_0xc0f6('0xce'));}if(_[_0xc0f6('0x96')](_0x3f7f80)){var _0x179ccf=this;_0x3f7f80[_0xc0f6('0xcf')](function(_0x2dc1ca,_0x547932){_0x179ccf['channel']['setVariable'](util['format'](_0xc0f6('0x160'),_0x3c8540,_0x547932),_0x2dc1ca);});return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x161'),_0x3c8540));}else{return this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0x3c8540,_0x3f7f80);}};AGIVertices[_0xc0f6('0xe')]['menu']=function(_0x318192){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x162'),_0x318192[_0xc0f6('0x33')]));if(_0x318192[_0xc0f6('0x108')]===0x0){return this['maxRetry'](_0x318192);}_0x318192[_0xc0f6('0x108')]-=0x1;if(!this[_0xc0f6('0x80')](_0x318192[_0xc0f6('0x109')])){return this[_0xc0f6('0xb')]['error'](_0x318192,_0xc0f6('0x163'));}var _0x1fb16d=this['getSound'][_0xc0f6('0x6b')](this,_0x318192[_0xc0f6('0x109')]);if(!_0x1fb16d){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x318192,_0xc0f6('0x10a'));}var _0x5f15ed=this[_0xc0f6('0xb')][_0xc0f6('0x164')](_0x1fb16d,_0x318192[_0xc0f6('0x10c')],_0x318192[_0xc0f6('0x165')]);var _0x3fe0fb=_0x5f15ed['result'];if(_0x5f15ed[_0xc0f6('0xa2')]===-0x1){this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x318192,'-1');return _0x5f15ed;}else if(_0x5f15ed[_0xc0f6('0x9c')]==='timeout'){_0x5f15ed[_0xc0f6('0xa2')]=_0x5f15ed[_0xc0f6('0xa2')]['length']>0x0?_0x5f15ed[_0xc0f6('0xa2')]:'t';}else if(_[_0xc0f6('0x3c')](_0x5f15ed['result'])){_0x5f15ed[_0xc0f6('0xa2')]='#';_0x3fe0fb='#';}if(!this[_0xc0f6('0x80')](_0x318192[_0xc0f6('0xcd')])){this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x10b'));}else{var _0xa36533=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x318192['variable_id']);if(!_0xa36533){return this['channel'][_0xc0f6('0x27')](_0x318192,_0xc0f6('0xce'));}this[_0xc0f6('0xb')]['setVariable'](_0xa36533,_0x3fe0fb);}this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x318192,_0x3fe0fb);return _0x5f15ed;};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0xa0')]=function(_0x4edf9){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x166'),_0x4edf9['label']));return this[_0xc0f6('0xb')]['noop'](_0x4edf9[_0xc0f6('0x167')]||_0x4edf9[_0xc0f6('0x33')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x168')]=function(_0x7629db){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x169'),_0x7629db[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x7629db['findBy'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x7629db,_0xc0f6('0x159'));}logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x154'),this[_0xc0f6('0xb')]['callerid'],_0x7629db[_0xc0f6('0x155')]));var _0xc7e16c=this[_0xc0f6('0x47')]['sync'](this,_0x7629db[_0xc0f6('0x16a')]);var _0x54ceec=this[_0xc0f6('0x49')][_0xc0f6('0x6b')](this,_0x7629db[_0xc0f6('0x155')],_0xc7e16c);if(_0x54ceec){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this['channel'][_0xc0f6('0x35')],_0x7629db[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this['channel'][_0xc0f6('0x35')],_0x7629db[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this['channel']['callerid'],_0x7629db[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x156'),this[_0xc0f6('0xb')]['callerid'],_0x7629db['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x16b')]=function(_0x4b9afa){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x16c'),_0x4b9afa[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x4b9afa[_0xc0f6('0x109')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4b9afa,_0xc0f6('0x163'));}var _0x5dddd6=this['getSound'][_0xc0f6('0x6b')](this,_0x4b9afa[_0xc0f6('0x109')]);if(!_0x5dddd6){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x4b9afa,_0xc0f6('0x10a'));}var _0xd14311=this[_0xc0f6('0xb')]['exec'](_0xc0f6('0x16d'),[_0x5dddd6,_0x4b9afa[_0xc0f6('0xde')]]);if(_0xd14311[_0xc0f6('0xa2')]===-0x1){return _0xd14311;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format']('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x5dddd6));};AGIVertices['prototype'][_0xc0f6('0x16e')]=function(_0xb87817){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x16f'),_0xb87817['label']));if(!this['isConfigured'](_0xb87817[_0xc0f6('0x170')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb87817,_0xc0f6('0x171'));}var _0x36cd5b='';var _0x2c0658=parseInt(_0xb87817['queue_id'],0xa);if(isNaN(_0x2c0658)){_0x36cd5b=_0xb87817[_0xc0f6('0x170')];}else{_0x36cd5b=this['getVoiceQueue'][_0xc0f6('0x6b')](this,_0xb87817[_0xc0f6('0x170')]);if(!_0x36cd5b){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb87817,_0xc0f6('0x172'));}}var _0xf79dda='';if(this[_0xc0f6('0x80')](_0xb87817['file_id'])){var _0x200a91=this[_0xc0f6('0x1b')][_0xc0f6('0x6b')](this,_0xb87817[_0xc0f6('0x109')]);if(_0x200a91){_0xf79dda=_0x200a91;}}this[_0xc0f6('0x31')]['sync'](this,_0xb87817,_0x36cd5b);if(_0xb87817[_0xc0f6('0xde')]['indexOf']('x')<0x0){_0xb87817[_0xc0f6('0xde')]+='x';}if(_0xb87817[_0xc0f6('0xde')][_0xc0f6('0x173')]('X')<0x0){_0xb87817['opts']+='X';}this['channel'][_0xc0f6('0xd1')](_0xc0f6('0x174'),_0x36cd5b?_0x36cd5b[_0xc0f6('0x175')]():'');var _0x31ed2b=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0x176'),[_0x36cd5b,_0xb87817[_0xc0f6('0xde')],_0xb87817[_0xc0f6('0x6d')],_0xf79dda,_0xb87817[_0xc0f6('0x63')],_0xb87817[_0xc0f6('0x6')],_0xb87817[_0xc0f6('0x177')],_0xb87817[_0xc0f6('0x178')],'',_0xb87817[_0xc0f6('0x179')]]);if(_0x31ed2b[_0xc0f6('0xa2')]===-0x1){return _0x31ed2b;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x36cd5b));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x17a')]=function(_0x1569b8){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x17b'),_0x1569b8[_0xc0f6('0x33')]));var _0x24ba2c=_0x1569b8[_0xc0f6('0x17c')]||'wav';var _0x869a14=util['format'](_0xc0f6('0x17d'),this[_0xc0f6('0xb')]['uniqueid'],rs[_0xc0f6('0x111')](0x5));var _0x231cc3=util[_0xc0f6('0x50')](_0xc0f6('0x17e'),FILES_PATH,_0x869a14,_0x24ba2c);var _0x2dc90d=util[_0xc0f6('0x50')](_0xc0f6('0x12c'),FILES_PATH,_0x869a14);this[_0xc0f6('0x17f')][_0xc0f6('0x6b')](this,_0x1569b8,_0x869a14,_0x231cc3);this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0xc0f6('0x180'),_0x869a14);logger[_0xc0f6('0x29')](_0xc0f6('0x181'),_0x2dc90d,_0x24ba2c,_0x1569b8['escape_digits'],_0x1569b8[_0xc0f6('0x63')]);return this[_0xc0f6('0xb')][_0xc0f6('0x12d')](_0x2dc90d,_0x24ba2c,_0x1569b8[_0xc0f6('0x182')],_0x1569b8['timeout'],undefined,!![]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x183')]=function(_0x2e758d){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x184'),_0x2e758d[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x2e758d[_0xc0f6('0x6d')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')]('no\x20url\x20configured');}var _0x36d496=this[_0xc0f6('0x61')][_0xc0f6('0x6b')](this,_0x2e758d);logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Response:',util['inspect'](_0x36d496,{'showHidden':![],'depth':null})));if(!this[_0xc0f6('0x80')](_0x2e758d[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x185'));}var _0x56943c=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x2e758d['variable_id']);if(!_0x56943c){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x2e758d,'no\x20variable\x20found');}this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0x186'),_0x56943c),_0x36d496[_0xc0f6('0x70')]?_0x36d496[_0xc0f6('0x70')]:_0xc0f6('0x187'));this[_0xc0f6('0xb')][_0xc0f6('0xd1')](util['format'](_0xc0f6('0x188'),_0x56943c),_0x36d496[_0xc0f6('0x189')]?_0x36d496[_0xc0f6('0x189')]:'OK');if(_0x36d496[_0xc0f6('0x68')]){try{this[_0xc0f6('0x94')](_0x36d496[_0xc0f6('0x68')],_0x56943c);}catch(_0x51d8f9){logger[_0xc0f6('0x27')](util[_0xc0f6('0x50')](_0xc0f6('0x18a'),_0x56943c));}}return this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0xd4'),_0x56943c));};AGIVertices[_0xc0f6('0xe')]['saydigits']=function(_0x38f3b2){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x18b'),_0x38f3b2[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')]['sayDigits'](_0x38f3b2[_0xc0f6('0x18c')]['replace'](/\s+/g,''),_0x38f3b2[_0xc0f6('0x182')]);};AGIVertices[_0xc0f6('0xe')]['saynumber']=function(_0x566a98){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x18d'),_0x566a98['label']));return this[_0xc0f6('0xb')]['sayNumber'](_0x566a98[_0xc0f6('0x62')][_0xc0f6('0x55')](/\s+/g,''),_0x566a98[_0xc0f6('0x182')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x18e')]=function(_0x559750){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x18f'),_0x559750['label']));return this['channel']['sayPhonetic'](_0x559750[_0xc0f6('0x59')],_0x559750['escape_digits']);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x190')]=function(_0x132181){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x191'),_0x132181[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x132181[_0xc0f6('0x192')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0x193'));}var _0x33d766=this[_0xc0f6('0x1f')]['sync'](this,_0x132181[_0xc0f6('0x192')]);if(!_0x33d766||!_0x33d766['Smtp']){return this[_0xc0f6('0xb')]['error'](_0x132181,_0xc0f6('0x194'));}var _0x5e8269={'from':util[_0xc0f6('0x50')](_0xc0f6('0x195'),_0x33d766[_0xc0f6('0x10')],_0x33d766[_0xc0f6('0x196')]||_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x198')]),'to':_0x132181['to']||'','cc':_0x132181['cc']||'','bcc':_0x132181['bcc']||'','subject':_0x132181[_0xc0f6('0x199')],'html':_0x132181['text'],'text':_0x132181['text']};var _0x4d999b={'tls':{'rejectUnauthorized':![]}};if(_0x33d766['Smtp'][_0xc0f6('0x19a')]){_0x4d999b[_0xc0f6('0x19a')]=_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x19a')];}else{_0x4d999b['host']=_0x33d766['Smtp'][_0xc0f6('0x19b')];_0x4d999b[_0xc0f6('0x19c')]=_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x19c')];_0x4d999b[_0xc0f6('0x19d')]=_0x33d766['Smtp'][_0xc0f6('0x19d')];}if(_0x33d766[_0xc0f6('0x197')][_0xc0f6('0x19e')]){_0x4d999b[_0xc0f6('0x19f')]={'user':_0x33d766['Smtp'][_0xc0f6('0x198')],'pass':_0x33d766['Smtp'][_0xc0f6('0x1a0')]};}if(this[_0xc0f6('0x80')](_0x132181[_0xc0f6('0x1a1')])){}logger[_0xc0f6('0xd6')]('sendMail\x20message',JSON[_0xc0f6('0x6f')](_0x5e8269));this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0x132181,_0x132181[_0xc0f6('0x192')]);this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1a2'),_0x33d766[_0xc0f6('0x10')]));this[_0xc0f6('0x20')][_0xc0f6('0x6b')](this,_0x4d999b,_0x5e8269);return this['channel'][_0xc0f6('0xa0')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1a3')]=function(_0xfb8ec){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x1a4'),_0xfb8ec[_0xc0f6('0x33')]));return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x1a5'));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1a6')]=function(_0x3ac735){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x1a7'),_0x3ac735[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x3ac735[_0xc0f6('0x1a8')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0x1a9'));}var _0x46d634=this['getSmsAccount'][_0xc0f6('0x6b')](this,_0x3ac735['sms_account_id']);if(!_0x46d634){return this['channel'][_0xc0f6('0x27')](_0x3ac735,_0xc0f6('0x1aa'));}var _0x4c2ab1={'body':_0x3ac735[_0xc0f6('0x1ab')],'phone':_0x3ac735['to']||'','SmsAccountId':_0x46d634['id']};logger[_0xc0f6('0xd6')]('sendSMS\x20message',JSON[_0xc0f6('0x6f')](_0x4c2ab1));this[_0xc0f6('0x31')]['sync'](this,_0x3ac735,_0x3ac735[_0xc0f6('0x1a8')]);this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1ac'),_0x46d634[_0xc0f6('0x10')]));this[_0xc0f6('0x30')][_0xc0f6('0x6b')](this,_0x4c2ab1);return this['channel'][_0xc0f6('0xa0')](_0xc0f6('0x1ad'));};AGIVertices['prototype'][_0xc0f6('0x1ae')]=function(_0x38848b){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x1af'),_0x38848b[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0x38848b[_0xc0f6('0xcd')])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x38848b,_0xc0f6('0x1b0'));}var _0x2f9080=this['getVariable'][_0xc0f6('0x6b')](this,_0x38848b[_0xc0f6('0xcd')]);if(!_0x2f9080){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x38848b,_0xc0f6('0xce'));}return this[_0xc0f6('0xb')][_0xc0f6('0xd1')](_0x2f9080,_0x38848b[_0xc0f6('0x1b1')]);};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1b2')]=function(_0x40086a){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x1b3'),_0x40086a[_0xc0f6('0x33')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x1b4'));if(_0x40086a[_0xc0f6('0xaf')]==='yes'){this['channel'][_0xc0f6('0xa0')]('Answer');return this[_0xc0f6('0xb')][_0xc0f6('0xaf')]();}return this[_0xc0f6('0xb')]['noop']('Skipped\x20Answer');};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1b5')]=function(_0xb2470a){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x1b6'),_0xb2470a[_0xc0f6('0x33')]));if(!this[_0xc0f6('0x80')](_0xb2470a['project_id'])){return this[_0xc0f6('0xb')]['error'](_0xb2470a,_0xc0f6('0x1b7'));}var _0x3f732c=this[_0xc0f6('0x1b8')][_0xc0f6('0x6b')](this,_0xb2470a[_0xc0f6('0x1b9')]);if(!this[_0xc0f6('0x80')](_0x3f732c)){return this['channel']['error'](_0xb2470a,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0xb2470a[_0xc0f6('0x1b9')]));}if(_0x3f732c===this[_0xc0f6('0xb')][_0xc0f6('0x1ba')]){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0xb2470a,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xc0f6('0x31')][_0xc0f6('0x6b')](this,_0xb2470a,_0x3f732c);var _0x4b4e31=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0x1bb'),util[_0xc0f6('0x50')](_0xc0f6('0x1bc'),config[_0xc0f6('0x6')][_0xc0f6('0x19b')]||_0xc0f6('0x1bd'),_0x3f732c,this['channel'][_0xc0f6('0x1ba')]));if(_0x4b4e31[_0xc0f6('0xa2')]===-0x1){return _0x4b4e31;}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1be'),_0xc0f6('0x1bb'),_0x3f732c));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1bf')]=function(_0x561581){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x1c0'),_0x561581[_0xc0f6('0x33')]));var _0x542a72=this[_0xc0f6('0x53')]['sync'](this,_0x561581['command']);this[_0xc0f6('0x31')]['sync'](this,_0x561581,_0x561581[_0xc0f6('0xae')]);if(this['isConfigured'](_0x561581[_0xc0f6('0xcd')])){var _0x150277=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x561581['variable_id']);if(_0x150277){this['channel'][_0xc0f6('0xd1')](_0x150277,_0x542a72);return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x561581[_0xc0f6('0xae')],_0x150277));}}return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1c1'),_0x561581[_0xc0f6('0xae')]));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1c2')]=function(_0x5947df){logger['info'](util[_0xc0f6('0x50')](_0xc0f6('0x1c3'),_0x5947df[_0xc0f6('0x33')]));_0x5947df[_0xc0f6('0x59')]=_0x5947df['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5947df[_0xc0f6('0x57')])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0x1c4'));}if(!this[_0xc0f6('0x80')](_0x5947df[_0xc0f6('0x59')])){return this[_0xc0f6('0xb')]['noop'](_0xc0f6('0xba'));}this[_0xc0f6('0xb')]['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x1c5'),_0x5947df[_0xc0f6('0x59')]));var _0x1ce23b=this[_0xc0f6('0x56')][_0xc0f6('0x6b')](this,_0x5947df);if(_0x1ce23b){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x1ce23b));var _0x38df5b=this['channel'][_0xc0f6('0xf8')](_0x1ce23b);try{fs[_0xc0f6('0xf9')](_0x1ce23b+_0xc0f6('0xfa'));}catch(_0x1679ca){logger[_0xc0f6('0x27')](_0x1679ca);}return _0x38df5b;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x5947df,_0xc0f6('0x1c6'));};AGIVertices[_0xc0f6('0xe')]['tts']=function(_0x196998){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x196998[_0xc0f6('0x33')]));_0x196998[_0xc0f6('0x59')]=_0x196998[_0xc0f6('0x59')][_0xc0f6('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc0f6('0x80')](_0x196998['text'])){return this[_0xc0f6('0xb')][_0xc0f6('0xa0')](_0xc0f6('0xba'));}this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util['format'](_0xc0f6('0x1c7'),_0x196998[_0xc0f6('0x59')]));var _0x43ec95=this[_0xc0f6('0x60')]['sync'](this,_0x196998);if(_0x43ec95){this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x1c8'),_0x43ec95));var _0x452e68=this[_0xc0f6('0xb')][_0xc0f6('0xf8')](_0x43ec95);try{fs[_0xc0f6('0xf9')](_0x43ec95+_0xc0f6('0xfa'));}catch(_0x127ed1){logger[_0xc0f6('0x27')](_0x127ed1);}return _0x452e68;}return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x196998,_0xc0f6('0x1c9'));};AGIVertices[_0xc0f6('0xe')]['unpause']=function(_0x2d4a5e){logger[_0xc0f6('0x29')](util['format'](_0xc0f6('0x1ca'),_0x2d4a5e['label']));if(!this['isConfigured'](_0x2d4a5e['findBy'])){return this['channel'][_0xc0f6('0x27')](_0x2d4a5e,_0xc0f6('0x159'));}logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xc0f6('0x35')],_0x2d4a5e['findBy']));var _0x1dd3a6=this[_0xc0f6('0x4c')][_0xc0f6('0x6b')](this,_0x2d4a5e['findBy']);if(_0x1dd3a6){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x156'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x157')};}else{logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));this[_0xc0f6('0xb')][_0xc0f6('0xa0')](util[_0xc0f6('0x50')](_0xc0f6('0x158'),this[_0xc0f6('0xb')][_0xc0f6('0x35')],_0x2d4a5e[_0xc0f6('0x155')]));return{'code':0xc8,'result':_0xc0f6('0x15a')};}};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1cb')]=function(_0x22e5a0){logger[_0xc0f6('0x29')](util[_0xc0f6('0x50')](_0xc0f6('0x1cc'),_0x22e5a0['label']));var _0xa910ac=this[_0xc0f6('0xb')][_0xc0f6('0xa7')](_0xc0f6('0x1cd'),[_0x22e5a0[_0xc0f6('0x1ce')],_0x22e5a0['options']]);if(_0xa910ac['result']===-0x1){return _0xa910ac;}return this['channel']['noop'](util[_0xc0f6('0x50')](_0xc0f6('0x1be'),_0xc0f6('0x1cd'),_0x22e5a0[_0xc0f6('0x1ce')]));};AGIVertices[_0xc0f6('0xe')][_0xc0f6('0x1cf')]=function(_0x5959cf){logger['info'](util['format'](_0xc0f6('0x1d0'),_0x5959cf[_0xc0f6('0x33')]));if(!this['isConfigured'](_0x5959cf['variable_id'])){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x5959cf,_0xc0f6('0x1b0'));}var _0x396932=this[_0xc0f6('0x9b')][_0xc0f6('0x6b')](this,_0x5959cf[_0xc0f6('0xcd')]);if(!_0x396932){return this[_0xc0f6('0xb')][_0xc0f6('0x27')](_0x5959cf,'no\x20variable\x20found');}var _0x9915e0=this[_0xc0f6('0xb')][_0xc0f6('0x9b')](_0x396932);return{'code':0xc8,'result':_0x9915e0['extra']?_0x9915e0[_0xc0f6('0x9c')]:'-'};};String['prototype'][_0xc0f6('0x9a')]=function(_0x150344,_0x16b9b7){return this['split'](_0x150344)['join'](_0x16b9b7);};module[_0xc0f6('0x1d1')]=AGIVertices;
\ No newline at end of file
index 7650abd..6c38a40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa81c=['transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','timer','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid'];(function(_0x334d52,_0x40d32b){var _0x32aacf=function(_0x2a904e){while(--_0x2a904e){_0x334d52['push'](_0x334d52['shift']());}};_0x32aacf(++_0x40d32b);}(_0xa81c,0x16a));var _0xca81=function(_0x469ed4,_0x2f2d55){_0x469ed4=_0x469ed4-0x0;var _0x147713=_0xa81c[_0x469ed4];return _0x147713;};'use strict';var util=require(_0xca81('0x0'));var _=require('lodash');var moment=require(_0xca81('0x1'));var ami=require(_0xca81('0x2'));var logger=require(_0xca81('0x3'))(_0xca81('0x4'));var RpcUser=require(_0xca81('0x5'));var RpcVoiceAgentReport=require(_0xca81('0x6'));function Acw(_0x5363ec){this[_0xca81('0x7')]=_0x5363ec[_0xca81('0x7')];this[_0xca81('0x8')]=_0x5363ec['agents'];this['timers']=_0x5363ec[_0xca81('0x9')];this[_0xca81('0xa')]={};ami['on']('agentconnect',this[_0xca81('0xb')][_0xca81('0xc')](this));ami['on'](_0xca81('0xd'),this[_0xca81('0xe')][_0xca81('0xc')](this));ami['on'](_0xca81('0xf'),this[_0xca81('0x10')][_0xca81('0xc')](this));ami['on'](_0xca81('0x11'),this[_0xca81('0x12')][_0xca81('0xc')](this));ami['on'](_0xca81('0x13'),this[_0xca81('0x14')][_0xca81('0xc')](this));ami['on'](_0xca81('0x15'),this[_0xca81('0x16')][_0xca81('0xc')](this));ami['on'](_0xca81('0x17'),this[_0xca81('0x18')][_0xca81('0xc')](this));}function getDiff(_0x70fae7){var _0x1e122c=moment()[_0xca81('0x19')](0x0);var _0x5d52af=moment(_0x70fae7)[_0xca81('0x19')](0x0);return _0x1e122c[_0xca81('0x1a')](_0x5d52af,_0xca81('0x1b'));}Acw[_0xca81('0x1c')]['startAcw']=function(_0x5c32d7){try{var _0x3d379c=this;var _0x1c42c6=this[_0xca81('0xa')][_0x5c32d7][_0xca81('0x1d')];var _0xdd0f96=this[_0xca81('0xa')][_0x5c32d7]['queue'];var _0x1bb276=this[_0xca81('0x7')][_0xdd0f96];var _0x3cc3b6=![];var _0x31227e=_0xca81('0x1e');if(_0x1bb276[_0xca81('0x1f')]){if(_0x1bb276['mandatoryDispositionPause'][_0xca81('0x20')]){_0x3cc3b6=!![];_0x31227e=_0x1bb276[_0xca81('0x21')]['name'];}}ami[_0xca81('0x22')]({'action':_0xca81('0x23'),'interface':_0x1c42c6,'paused':!![],'reason':_0x31227e})[_0xca81('0x24')](function(_0x3209b6){if(_0x3d379c[_0xca81('0x8')][_0x1c42c6]){return RpcUser[_0xca81('0x25')](_0x3d379c[_0xca81('0x8')][_0x1c42c6]['id'])['then'](function(_0x2e3938){if(_0x2e3938&&!_0x2e3938['voicePause']){logger[_0xca81('0x26')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x5c32d7,_0x1c42c6,_0xdd0f96);var _0x3357e0=_0x3d379c['channels'][_0x5c32d7][_0xca81('0x27')]&&_0x3d379c[_0xca81('0xa')][_0x5c32d7]['destlinkedid']?_0x3d379c[_0xca81('0xa')][_0x5c32d7][_0xca81('0x28')]:_0x5c32d7;return RpcUser['savePause'](_0x3d379c[_0xca81('0x8')][_0x1c42c6],_0x31227e,_0x3357e0)['then'](function(_0x2cd644){if(!_0x3cc3b6){_0x3d379c['timers'][_0x1c42c6]={};logger['info'](_0xca81('0x29'),_0x5c32d7,_0x3d379c[_0xca81('0x7')][_0xdd0f96][_0xca81('0x2a')],_0x1c42c6,_0xdd0f96);_0x3d379c[_0xca81('0x9')][_0x1c42c6]['timer']=setTimeout(_0x3d379c[_0xca81('0x2b')]['bind'](_0x3d379c,_0x1c42c6),_0x3d379c[_0xca81('0x7')][_0xdd0f96][_0xca81('0x2a')]*0x3e8);_0x3d379c[_0xca81('0x9')][_0x1c42c6][_0xca81('0x2c')]=moment()[_0xca81('0x2d')](_0xca81('0x2e'));_0x3d379c[_0xca81('0x9')][_0x1c42c6][_0xca81('0x2f')]=_0x5c32d7;_0x3d379c[_0xca81('0x9')][_0x1c42c6][_0xca81('0x30')]=_0xdd0f96;_0x3d379c[_0xca81('0x9')][_0x1c42c6]['updateAcw']=function(){var _0x534807=getDiff(_0x3d379c['timers'][_0x1c42c6][_0xca81('0x2c')]);clearTimeout(_0x3d379c['timers'][_0x1c42c6]['timer']);_0x3d379c['timers'][_0x1c42c6]['timer']=![];RpcVoiceAgentReport[_0xca81('0x31')]({'acwtime':_0x534807},_0x3d379c[_0xca81('0x9')][_0x1c42c6][_0xca81('0x2f')],_0x1c42c6)[_0xca81('0x24')](function(_0x229ae5){logger[_0xca81('0x26')](_0xca81('0x32'),_0x5c32d7,_0x534807,_0x229ae5);})[_0xca81('0x33')](function(_0x2a6a83){logger['error'](_0xca81('0x34'),_0x5c32d7,_0x2a6a83);});delete _0x3d379c[_0xca81('0x9')][_0x1c42c6];};}});}else{logger[_0xca81('0x26')](_0xca81('0x35'),_0x5c32d7,_0x1c42c6,_0xdd0f96);}});}})[_0xca81('0x33')](function(_0x3368ae){logger[_0xca81('0x36')](_0xca81('0x29'),_0x5c32d7,_0x3d379c[_0xca81('0x7')][_0xdd0f96]['acwTimeout'],_0x1c42c6,_0xdd0f96);})[_0xca81('0x37')](function(){delete _0x3d379c[_0xca81('0xa')][_0x5c32d7];});}catch(_0x5b3f38){logger[_0xca81('0x36')](_0xca81('0x38'),_0x5b3f38[_0xca81('0x39')]);}};Acw[_0xca81('0x1c')][_0xca81('0x2b')]=function(_0x2820ea){try{var _0x17def2=this;if(_0x17def2['timers'][_0x2820ea]){_0x17def2[_0xca81('0x9')][_0x2820ea][_0xca81('0x3a')]=![];var _0x307e68=_0x17def2['timers'][_0x2820ea][_0xca81('0x2f')];var _0x46b381=_0x17def2[_0xca81('0x9')][_0x2820ea][_0xca81('0x30')];var _0x17a1cd=_0x17def2[_0xca81('0x7')][_0x46b381][_0xca81('0x2a')];logger[_0xca81('0x26')](_0xca81('0x3b'),_0x307e68,_0x2820ea);RpcUser['saveUnpause'](this[_0xca81('0x8')][_0x2820ea]);RpcVoiceAgentReport[_0xca81('0x31')]({'acwtime':_0x17a1cd,'agentacw':!![]},_0x307e68,_0x2820ea)[_0xca81('0x24')](function(_0x366864){logger[_0xca81('0x26')](_0xca81('0x32'),_0x307e68,_0x17a1cd,_0x366864);})[_0xca81('0x33')](function(_0x4dd539){logger[_0xca81('0x36')](_0xca81('0x34'),_0x307e68,_0x4dd539);});}else{logger['error'](_0xca81('0x3c'),_0x2820ea);if(_0x17def2['timers']){logger[_0xca81('0x26')](_0xca81('0x3d'),JSON[_0xca81('0x3e')](_0x17def2['timers']));}}}catch(_0x56a54e){logger[_0xca81('0x36')](_0xca81('0x3f'),_0x56a54e['message']);}};Acw[_0xca81('0x1c')][_0xca81('0xb')]=function(_0x3174f2){try{if(this['voiceQueues'][_0x3174f2['queue']]&&(this[_0xca81('0x7')][_0x3174f2['queue']][_0xca81('0x4')]||this[_0xca81('0x7')][_0x3174f2[_0xca81('0x30')]]['mandatoryDisposition'])){if(this['agents'][_0x3174f2[_0xca81('0x1d')]]){this['channels'][_0x3174f2[_0xca81('0x2f')]]={'queue':_0x3174f2[_0xca81('0x30')],'interface':_0x3174f2[_0xca81('0x1d')],'destlinkedid':_0x3174f2[_0xca81('0x28')]};}}}catch(_0x38132a){logger[_0xca81('0x36')](_0xca81('0x40'),_0x38132a[_0xca81('0x39')]);}};Acw[_0xca81('0x1c')][_0xca81('0x18')]=function(_0x46caf8){try{if(this['voiceQueues'][_0x46caf8['queue']]&&(this['voiceQueues'][_0x46caf8[_0xca81('0x30')]][_0xca81('0x4')]||this[_0xca81('0x7')][_0x46caf8['queue']][_0xca81('0x1f')])){if(this[_0xca81('0x8')][_0x46caf8[_0xca81('0x1d')]]){this[_0xca81('0xa')][_0x46caf8[_0xca81('0x2f')]]={'queue':_0x46caf8[_0xca81('0x30')],'interface':_0x46caf8['interface']};}}}catch(_0x2f4696){logger[_0xca81('0x36')](_0xca81('0x41'),_0x2f4696['message']);}};Acw['prototype'][_0xca81('0xe')]=function(_0x492b65){try{if(this['channels'][_0x492b65[_0xca81('0x2f')]]&&_[_0xca81('0x42')](this[_0xca81('0xa')][_0x492b65[_0xca81('0x2f')]][_0xca81('0x27')])){logger[_0xca81('0x26')](_0xca81('0x43'),_0x492b65['uniqueid']);this[_0xca81('0x44')](_0x492b65['uniqueid']);}else if(this['channels'][_0x492b65[_0xca81('0x45')]]&&_['isUndefined'](this[_0xca81('0xa')][_0x492b65[_0xca81('0x45')]][_0xca81('0x27')])){logger['info'](_0xca81('0x46'),_0x492b65[_0xca81('0x45')]);this[_0xca81('0x44')](_0x492b65[_0xca81('0x45')]);}}catch(_0x12d7ef){logger[_0xca81('0x36')](_0xca81('0x47'),_0x12d7ef[_0xca81('0x39')]);}};Acw[_0xca81('0x1c')][_0xca81('0x10')]=function(_0x1d8609){try{if(this[_0xca81('0xa')][_0x1d8609[_0xca81('0x2f')]]&&this['channels'][_0x1d8609[_0xca81('0x2f')]]['attended']){logger[_0xca81('0x26')](_0xca81('0x48'),_0x1d8609[_0xca81('0x2f')]);this[_0xca81('0x44')](_0x1d8609[_0xca81('0x2f')]);}else if(this[_0xca81('0xa')][_0x1d8609[_0xca81('0x45')]]&&this[_0xca81('0xa')][_0x1d8609[_0xca81('0x45')]][_0xca81('0x27')]){logger[_0xca81('0x26')](_0xca81('0x49'),_0x1d8609['linkedid']);this[_0xca81('0x44')](_0x1d8609['linkedid']);}}catch(_0x1cdcd8){logger['error'](_0xca81('0x4a'),_0x1cdcd8[_0xca81('0x39')]);}};Acw[_0xca81('0x1c')][_0xca81('0x14')]=function(_0xf1b84c){try{if(!_[_0xca81('0x4b')](this[_0xca81('0xa')][_0xf1b84c['transfereeuniqueid']])){this['startAcw'](_0xf1b84c[_0xca81('0x4c')]);if(this[_0xca81('0xa')][_0xf1b84c['secondtransfereruniqueid']]){this[_0xca81('0xa')][_0xf1b84c['secondtransfereruniqueid']]['attended']=!![];this[_0xca81('0xa')][_0xf1b84c['transfertargetuniqueid']]=this['channels'][_0xf1b84c[_0xca81('0x4d')]];delete this[_0xca81('0xa')][_0xf1b84c[_0xca81('0x4d')]];}}else if(!_['isNil'](this[_0xca81('0xa')][_0xf1b84c[_0xca81('0x4e')]])){this[_0xca81('0x44')](_0xf1b84c[_0xca81('0x4e')]);if(this['channels'][_0xf1b84c[_0xca81('0x4f')]]){this[_0xca81('0xa')][_0xf1b84c[_0xca81('0x4f')]][_0xca81('0x27')]=!![];this[_0xca81('0xa')][_0xf1b84c[_0xca81('0x4c')]]=this[_0xca81('0xa')][_0xf1b84c[_0xca81('0x4f')]];delete this[_0xca81('0xa')][_0xf1b84c['origtransfereruniqueid']];}}}catch(_0x408c49){logger[_0xca81('0x36')]('[ACW][syncAttendedTransfer]\x20%s',_0x408c49['message']);}};Acw['prototype']['syncBlindTransfer']=function(_0x1f71ca){try{if(this[_0xca81('0xa')][_0x1f71ca[_0xca81('0x50')]]){logger[_0xca81('0x26')](_0xca81('0x51'),JSON[_0xca81('0x3e')](_0x1f71ca[_0xca81('0x50')]));this[_0xca81('0x44')](_0x1f71ca[_0xca81('0x50')]);}else if(this[_0xca81('0xa')][_0x1f71ca[_0xca81('0x52')]]){logger[_0xca81('0x26')](_0xca81('0x53'),JSON['stringify'](_0x1f71ca[_0xca81('0x52')]));this[_0xca81('0x44')](_0x1f71ca[_0xca81('0x52')]);}}catch(_0x5ae9e9){logger[_0xca81('0x36')]('[ACW][syncBlindTransfer]\x20%s',_0x5ae9e9[_0xca81('0x39')]);}};Acw[_0xca81('0x1c')][_0xca81('0x12')]=function(_0x306028){try{if(this[_0xca81('0x7')][_0x306028[_0xca81('0x30')]]&&this[_0xca81('0x7')][_0x306028['queue']][_0xca81('0x54')]==='all'){if(this[_0xca81('0x8')][_0x306028[_0xca81('0x1d')]]){logger[_0xca81('0x26')](_0xca81('0x55'),_0x306028[_0xca81('0x2f')],_0x306028[_0xca81('0x1d')],_0x306028['queue']);return RpcUser['savePause'](this['agents'][_0x306028[_0xca81('0x1d')]],_0xca81('0x56'),_0x306028['uniqueid']);}}}catch(_0x1357d9){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1357d9[_0xca81('0x39')]);}};module[_0xca81('0x57')]=Acw;
\ No newline at end of file
+var _0x661a=['savePause','timers','acwTimeout','timer','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','prototype','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','syncAgentConnectPreview','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','agentconnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','startAcw','interface','mandatoryDisposition','mandatoryDispositionPause','name','Action','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid'];(function(_0x468581,_0x372887){var _0x653976=function(_0x112dde){while(--_0x112dde){_0x468581['push'](_0x468581['shift']());}};_0x653976(++_0x372887);}(_0x661a,0x85));var _0xa661=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x661a[_0x40220a];return _0x3903cc;};'use strict';var util=require(_0xa661('0x0'));var _=require(_0xa661('0x1'));var moment=require(_0xa661('0x2'));var ami=require(_0xa661('0x3'));var logger=require(_0xa661('0x4'))(_0xa661('0x5'));var RpcUser=require(_0xa661('0x6'));var RpcVoiceAgentReport=require(_0xa661('0x7'));function Acw(_0x28b74b){this[_0xa661('0x8')]=_0x28b74b[_0xa661('0x8')];this[_0xa661('0x9')]=_0x28b74b[_0xa661('0x9')];this['timers']=_0x28b74b['timers'];this[_0xa661('0xa')]={};ami['on'](_0xa661('0xb'),this['syncAgentConnect']['bind'](this));ami['on'](_0xa661('0xc'),this[_0xa661('0xd')][_0xa661('0xe')](this));ami['on'](_0xa661('0xf'),this[_0xa661('0x10')]['bind'](this));ami['on'](_0xa661('0x11'),this[_0xa661('0x12')][_0xa661('0xe')](this));ami['on'](_0xa661('0x13'),this[_0xa661('0x14')][_0xa661('0xe')](this));ami['on'](_0xa661('0x15'),this['syncBlindTransfer'][_0xa661('0xe')](this));ami['on'](_0xa661('0x16'),this['syncAgentConnectPreview'][_0xa661('0xe')](this));}function getDiff(_0x258bc4){var _0x4d3d56=moment()[_0xa661('0x17')](0x0);var _0x428ee2=moment(_0x258bc4)[_0xa661('0x17')](0x0);return _0x4d3d56[_0xa661('0x18')](_0x428ee2,'seconds');}Acw['prototype'][_0xa661('0x19')]=function(_0x522d56){try{var _0x5c4538=this;var _0x353b4d=this['channels'][_0x522d56][_0xa661('0x1a')];var _0x1df5f5=this[_0xa661('0xa')][_0x522d56]['queue'];var _0x27eb47=this[_0xa661('0x8')][_0x1df5f5];var _0x5db7b2=![];var _0x5df3f0='ACW';if(_0x27eb47[_0xa661('0x1b')]){if(_0x27eb47[_0xa661('0x1c')][_0xa661('0x1d')]){_0x5db7b2=!![];_0x5df3f0=_0x27eb47[_0xa661('0x1c')]['name'];}}ami[_0xa661('0x1e')]({'action':'QueuePause','interface':_0x353b4d,'paused':!![],'reason':_0x5df3f0})['then'](function(_0xb418d0){if(_0x5c4538[_0xa661('0x9')][_0x353b4d]){return RpcUser[_0xa661('0x1f')](_0x5c4538[_0xa661('0x9')][_0x353b4d]['id'])[_0xa661('0x20')](function(_0x12c2eb){if(_0x12c2eb&&!_0x12c2eb['voicePause']){logger[_0xa661('0x21')](_0xa661('0x22'),_0x522d56,_0x353b4d,_0x1df5f5);var _0x349e0e=_0x5c4538[_0xa661('0xa')][_0x522d56][_0xa661('0x23')]&&_0x5c4538['channels'][_0x522d56][_0xa661('0x24')]?_0x5c4538[_0xa661('0xa')][_0x522d56][_0xa661('0x24')]:_0x522d56;return RpcUser[_0xa661('0x25')](_0x5c4538[_0xa661('0x9')][_0x353b4d],_0x5df3f0,_0x349e0e)[_0xa661('0x20')](function(_0xac220e){if(!_0x5db7b2){_0x5c4538[_0xa661('0x26')][_0x353b4d]={};logger[_0xa661('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x522d56,_0x5c4538[_0xa661('0x8')][_0x1df5f5][_0xa661('0x27')],_0x353b4d,_0x1df5f5);_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x28')]=setTimeout(_0x5c4538['stopAcw'][_0xa661('0xe')](_0x5c4538,_0x353b4d),_0x5c4538['voiceQueues'][_0x1df5f5][_0xa661('0x27')]*0x3e8);_0x5c4538[_0xa661('0x26')][_0x353b4d]['lastPauseAt']=moment()[_0xa661('0x29')](_0xa661('0x2a'));_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2b')]=_0x522d56;_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2c')]=_0x1df5f5;_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2d')]=function(){var _0x2c6413=getDiff(_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2e')]);clearTimeout(_0x5c4538[_0xa661('0x26')][_0x353b4d]['timer']);_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x2c6413},_0x5c4538[_0xa661('0x26')][_0x353b4d][_0xa661('0x2b')],_0x353b4d)['then'](function(_0x4889d7){logger[_0xa661('0x21')](_0xa661('0x2f'),_0x522d56,_0x2c6413,_0x4889d7);})[_0xa661('0x30')](function(_0x586914){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x522d56,_0x586914);});delete _0x5c4538[_0xa661('0x26')][_0x353b4d];};}});}else{logger[_0xa661('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x522d56,_0x353b4d,_0x1df5f5);}});}})[_0xa661('0x30')](function(_0x2cba8a){logger[_0xa661('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x522d56,_0x5c4538[_0xa661('0x8')][_0x1df5f5][_0xa661('0x27')],_0x353b4d,_0x1df5f5);})[_0xa661('0x32')](function(){delete _0x5c4538[_0xa661('0xa')][_0x522d56];});}catch(_0x17f017){logger[_0xa661('0x31')](_0xa661('0x33'),_0x17f017[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0x36')]=function(_0x241026){try{var _0x50e9db=this;if(_0x50e9db[_0xa661('0x26')][_0x241026]){_0x50e9db[_0xa661('0x26')][_0x241026][_0xa661('0x28')]=![];var _0x3656fd=_0x50e9db[_0xa661('0x26')][_0x241026][_0xa661('0x2b')];var _0x2707bb=_0x50e9db['timers'][_0x241026][_0xa661('0x2c')];var _0xd5733=_0x50e9db[_0xa661('0x8')][_0x2707bb][_0xa661('0x27')];logger[_0xa661('0x21')](_0xa661('0x37'),_0x3656fd,_0x241026);RpcUser[_0xa661('0x38')](this['agents'][_0x241026]);RpcVoiceAgentReport[_0xa661('0x39')]({'acwtime':_0xd5733,'agentacw':!![]},_0x3656fd,_0x241026)[_0xa661('0x20')](function(_0x2d0cf8){logger[_0xa661('0x21')](_0xa661('0x2f'),_0x3656fd,_0xd5733,_0x2d0cf8);})['catch'](function(_0x2adabb){logger[_0xa661('0x31')](_0xa661('0x3a'),_0x3656fd,_0x2adabb);});}else{logger[_0xa661('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x241026);if(_0x50e9db['timers']){logger[_0xa661('0x21')](_0xa661('0x3b'),JSON[_0xa661('0x3c')](_0x50e9db[_0xa661('0x26')]));}}}catch(_0x275841){logger[_0xa661('0x31')](_0xa661('0x3d'),_0x275841[_0xa661('0x34')]);}};Acw['prototype'][_0xa661('0x3e')]=function(_0x27d2a4){try{if(this['voiceQueues'][_0x27d2a4[_0xa661('0x2c')]]&&(this[_0xa661('0x8')][_0x27d2a4[_0xa661('0x2c')]][_0xa661('0x5')]||this[_0xa661('0x8')][_0x27d2a4[_0xa661('0x2c')]]['mandatoryDisposition'])){if(this[_0xa661('0x9')][_0x27d2a4[_0xa661('0x1a')]]){this[_0xa661('0xa')][_0x27d2a4[_0xa661('0x2b')]]={'queue':_0x27d2a4[_0xa661('0x2c')],'interface':_0x27d2a4['interface'],'destlinkedid':_0x27d2a4[_0xa661('0x24')]};}}}catch(_0x140bea){logger[_0xa661('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x140bea[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0x3f')]=function(_0x4b64f3){try{if(this[_0xa661('0x8')][_0x4b64f3[_0xa661('0x2c')]]&&(this[_0xa661('0x8')][_0x4b64f3[_0xa661('0x2c')]]['acw']||this[_0xa661('0x8')][_0x4b64f3[_0xa661('0x2c')]][_0xa661('0x1b')])){if(this[_0xa661('0x9')][_0x4b64f3[_0xa661('0x1a')]]){this[_0xa661('0xa')][_0x4b64f3[_0xa661('0x2b')]]={'queue':_0x4b64f3['queue'],'interface':_0x4b64f3['interface']};}}}catch(_0x2b8fd1){logger[_0xa661('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2b8fd1[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0xd')]=function(_0x456b74){try{if(this['channels'][_0x456b74[_0xa661('0x2b')]]&&_['isUndefined'](this[_0xa661('0xa')][_0x456b74[_0xa661('0x2b')]][_0xa661('0x23')])){logger[_0xa661('0x21')](_0xa661('0x40'),_0x456b74[_0xa661('0x2b')]);this[_0xa661('0x19')](_0x456b74[_0xa661('0x2b')]);}else if(this[_0xa661('0xa')][_0x456b74[_0xa661('0x41')]]&&_['isUndefined'](this[_0xa661('0xa')][_0x456b74[_0xa661('0x41')]][_0xa661('0x23')])){logger[_0xa661('0x21')](_0xa661('0x42'),_0x456b74[_0xa661('0x41')]);this[_0xa661('0x19')](_0x456b74[_0xa661('0x41')]);}}catch(_0x89f130){logger[_0xa661('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x89f130[_0xa661('0x34')]);}};Acw[_0xa661('0x35')]['syncHangup']=function(_0x3caa73){try{if(this[_0xa661('0xa')][_0x3caa73['uniqueid']]&&this[_0xa661('0xa')][_0x3caa73[_0xa661('0x2b')]]['attended']){logger[_0xa661('0x21')](_0xa661('0x43'),_0x3caa73['uniqueid']);this[_0xa661('0x19')](_0x3caa73[_0xa661('0x2b')]);}else if(this[_0xa661('0xa')][_0x3caa73['linkedid']]&&this[_0xa661('0xa')][_0x3caa73[_0xa661('0x41')]][_0xa661('0x23')]){logger[_0xa661('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3caa73[_0xa661('0x41')]);this[_0xa661('0x19')](_0x3caa73[_0xa661('0x41')]);}}catch(_0x47e868){logger[_0xa661('0x31')]('[ACW][syncHangup]\x20%s',_0x47e868[_0xa661('0x34')]);}};Acw['prototype'][_0xa661('0x14')]=function(_0x3b18eb){try{if(!_['isNil'](this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x44')]])){this['startAcw'](_0x3b18eb[_0xa661('0x44')]);if(this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x45')]]){this[_0xa661('0xa')][_0x3b18eb['secondtransfereruniqueid']][_0xa661('0x23')]=!![];this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x46')]]=this[_0xa661('0xa')][_0x3b18eb['secondtransfereruniqueid']];delete this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x45')]];}}else if(!_[_0xa661('0x47')](this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x46')]])){this['startAcw'](_0x3b18eb[_0xa661('0x46')]);if(this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x48')]]){this['channels'][_0x3b18eb[_0xa661('0x48')]][_0xa661('0x23')]=!![];this['channels'][_0x3b18eb[_0xa661('0x44')]]=this['channels'][_0x3b18eb[_0xa661('0x48')]];delete this[_0xa661('0xa')][_0x3b18eb[_0xa661('0x48')]];}}}catch(_0x4a891a){logger[_0xa661('0x31')](_0xa661('0x49'),_0x4a891a[_0xa661('0x34')]);}};Acw[_0xa661('0x35')][_0xa661('0x4a')]=function(_0x4b15a7){try{if(this[_0xa661('0xa')][_0x4b15a7[_0xa661('0x4b')]]){logger[_0xa661('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xa661('0x3c')](_0x4b15a7[_0xa661('0x4b')]));this[_0xa661('0x19')](_0x4b15a7[_0xa661('0x4b')]);}else if(this[_0xa661('0xa')][_0x4b15a7[_0xa661('0x4c')]]){logger[_0xa661('0x21')](_0xa661('0x4d'),JSON[_0xa661('0x3c')](_0x4b15a7[_0xa661('0x4c')]));this[_0xa661('0x19')](_0x4b15a7[_0xa661('0x4c')]);}}catch(_0x40b0a6){logger['error'](_0xa661('0x4e'),_0x40b0a6[_0xa661('0x34')]);}};Acw[_0xa661('0x35')]['syncAgentRingNoAnswer']=function(_0x363fe6){try{if(this[_0xa661('0x8')][_0x363fe6['queue']]&&this[_0xa661('0x8')][_0x363fe6[_0xa661('0x2c')]][_0xa661('0x4f')]===_0xa661('0x50')){if(this[_0xa661('0x9')][_0x363fe6[_0xa661('0x1a')]]){logger[_0xa661('0x21')](_0xa661('0x51'),_0x363fe6[_0xa661('0x2b')],_0x363fe6[_0xa661('0x1a')],_0x363fe6['queue']);return RpcUser['savePause'](this['agents'][_0x363fe6[_0xa661('0x1a')]],_0xa661('0x52'),_0x363fe6[_0xa661('0x2b')]);}}}catch(_0x52e72a){logger['error'](_0xa661('0x53'),_0x52e72a[_0xa661('0x34')]);}};module[_0xa661('0x54')]=Acw;
\ No newline at end of file
index 1f8e34e..b299118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6fa=['bluebird','moment','lodash','../../config/logger','ami','asterisk','username','password','keepConnected','Action','promisify','action','error','format','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionDeviceStateList','devicestatelist','sippeerstatus','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionSipPeerStatus','actionCoreShowChannels','catch','log','exports','asterisk-manager'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb6fa,0xc2));var _0xab6f=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xb6fa[_0x358806];return _0x19fdcb;};'use strict';var Manager=require(_0xab6f('0x0'));var BPromise=require(_0xab6f('0x1'));var moment=require(_0xab6f('0x2'));var util=require('util');var _=require(_0xab6f('0x3'));var logger=require(_0xab6f('0x4'))(_0xab6f('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0xab6f('0x6')]['port'],config[_0xab6f('0x6')]['ip'],config['asterisk'][_0xab6f('0x7')],config['asterisk'][_0xab6f('0x8')],!![]);ami[_0xab6f('0x9')]();ami[_0xab6f('0xa')]=BPromise[_0xab6f('0xb')](ami[_0xab6f('0xc')]);function error(_0x574ab8){logger[_0xab6f('0xd')](util[_0xab6f('0xe')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xab6f('0x6')][_0xab6f('0x7')],config[_0xab6f('0x6')]['ip'],config[_0xab6f('0x6')][_0xab6f('0xf')],util[_0xab6f('0x10')](_0x574ab8,![],null)));}function close(){logger['error'](util[_0xab6f('0xe')](_0xab6f('0x11'),config[_0xab6f('0x6')]['username'],config[_0xab6f('0x6')]['ip'],config[_0xab6f('0x6')][_0xab6f('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xab6f('0xa')]({'action':'sipshowregistry'});};};ami[_0xab6f('0x12')]=function(){return function(){return ami[_0xab6f('0xa')]({'action':_0xab6f('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xab6f('0xa')]({'action':_0xab6f('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xab6f('0xa')]({'action':_0xab6f('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0xab6f('0x16')});};};function connect(_0x37dd83){logger[_0xab6f('0x17')](util[_0xab6f('0xe')](_0xab6f('0x18'),config[_0xab6f('0x6')][_0xab6f('0x7')],config[_0xab6f('0x6')]['ip'],config[_0xab6f('0x6')][_0xab6f('0xf')]));ami[_0xab6f('0x19')](_0xab6f('0xd'),error);ami[_0xab6f('0x19')](_0xab6f('0x1a'),close);}ami['on'](_0xab6f('0x1b'),connect);ami['on'](_0xab6f('0x1c'),function(_0x11e5d1){logger[_0xab6f('0x17')](util[_0xab6f('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0xab6f('0x7')],config[_0xab6f('0x6')]['ip'],config['asterisk'][_0xab6f('0xf')],util[_0xab6f('0x10')](_0x11e5d1,![],null)));});ami['on'](_0xab6f('0x1d'),function(_0x10006c){logger[_0xab6f('0x17')](util['format'](_0xab6f('0x1e'),config['asterisk'][_0xab6f('0x7')],config[_0xab6f('0x6')]['ip'],config[_0xab6f('0x6')][_0xab6f('0xf')]));return BPromise[_0xab6f('0x1f')]()[_0xab6f('0x20')](ami[_0xab6f('0x21')]())[_0xab6f('0x20')](ami[_0xab6f('0x12')]())['then'](ami[_0xab6f('0x22')]())['then'](ami['actionQueueSummary']())[_0xab6f('0x20')](ami[_0xab6f('0x23')]())[_0xab6f('0x24')](function(_0xd22157){console[_0xab6f('0x25')](_0xd22157);});});ami[_0xab6f('0x19')]('error',error);ami[_0xab6f('0x19')](_0xab6f('0x1a'),close);module[_0xab6f('0x26')]=ami;
\ No newline at end of file
+var _0x7e05=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','fullybooted','resolve','then','log','once','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x7e05,0x129));var _0x57e0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7e05[_0x501510];return _0x1e6ee5;};'use strict';var Manager=require(_0x57e0('0x0'));var BPromise=require(_0x57e0('0x1'));var moment=require(_0x57e0('0x2'));var util=require(_0x57e0('0x3'));var _=require(_0x57e0('0x4'));var logger=require(_0x57e0('0x5'))('ami');var config=require(_0x57e0('0x6'));var ami=new Manager(config[_0x57e0('0x7')][_0x57e0('0x8')],config[_0x57e0('0x7')]['ip'],config['asterisk'][_0x57e0('0x9')],config[_0x57e0('0x7')][_0x57e0('0xa')],!![]);ami['keepConnected']();ami[_0x57e0('0xb')]=BPromise[_0x57e0('0xc')](ami[_0x57e0('0xd')]);function error(_0x428a7d){logger[_0x57e0('0xe')](util[_0x57e0('0xf')](_0x57e0('0x10'),config[_0x57e0('0x7')][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config[_0x57e0('0x7')]['port'],util[_0x57e0('0x11')](_0x428a7d,![],null)));}function close(){logger[_0x57e0('0xe')](util[_0x57e0('0xf')](_0x57e0('0x12'),config['asterisk'][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config['asterisk'][_0x57e0('0x8')]));}ami[_0x57e0('0x13')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':'sipshowregistry'});};};ami[_0x57e0('0x14')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':_0x57e0('0x15')});};};ami[_0x57e0('0x16')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':'sippeerstatus'});};};ami[_0x57e0('0x17')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x57e0('0x18')]=function(){return function(){return ami[_0x57e0('0xb')]({'action':_0x57e0('0x19')});};};function connect(_0x21e9bc){logger[_0x57e0('0x1a')](util[_0x57e0('0xf')](_0x57e0('0x1b'),config[_0x57e0('0x7')][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config[_0x57e0('0x7')]['port']));ami['once'](_0x57e0('0xe'),error);ami['once']('close',close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x3c45af){logger['info'](util[_0x57e0('0xf')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x57e0('0x7')]['username'],config['asterisk']['ip'],config[_0x57e0('0x7')][_0x57e0('0x8')],util['inspect'](_0x3c45af,![],null)));});ami['on'](_0x57e0('0x1c'),function(_0x4a78e3){logger['info'](util[_0x57e0('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x57e0('0x7')][_0x57e0('0x9')],config[_0x57e0('0x7')]['ip'],config[_0x57e0('0x7')]['port']));return BPromise[_0x57e0('0x1d')]()[_0x57e0('0x1e')](ami[_0x57e0('0x13')]())[_0x57e0('0x1e')](ami['actionDeviceStateList']())[_0x57e0('0x1e')](ami[_0x57e0('0x16')]())['then'](ami['actionQueueSummary']())['then'](ami[_0x57e0('0x18')]())['catch'](function(_0x548dd1){console[_0x57e0('0x1f')](_0x548dd1);});});ami[_0x57e0('0x20')](_0x57e0('0xe'),error);ami[_0x57e0('0x20')](_0x57e0('0x21'),close);module[_0x57e0('0x22')]=ami;
\ No newline at end of file
index 10d3c00..e6eef41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xcb91[_0xcfc44];return _0x307a25;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client;
\ No newline at end of file
+var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xe706,0xa3));var _0x6e70=function(_0x48051b,_0x368d0b){_0x48051b=_0x48051b-0x0;var _0x5669e1=_0xe706[_0x48051b];return _0x5669e1;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client;
\ No newline at end of file
index d4d6962..b387c2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0511=['recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','substring','prototype','getQueue','exports','util','lodash','isNil','string','uniqueid','phone','Contact','firstName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat'];(function(_0x24132a,_0x56aaf2){var _0x32eee9=function(_0x21eaee){while(--_0x21eaee){_0x24132a['push'](_0x24132a['shift']());}};_0x32eee9(++_0x56aaf2);}(_0x0511,0x11f));var _0x1051=function(_0x23ec89,_0x11c956){_0x23ec89=_0x23ec89-0x0;var _0x51aea2=_0x0511[_0x23ec89];return _0x51aea2;};'use strict';var util=require(_0x1051('0x0'));var _=require(_0x1051('0x1'));var moment=require('moment');function checkNameSurname(_0x3c606c,_0x538dc9,_0x3c1e6a){var _0x294c03='';if(!_[_0x1051('0x2')](_0x538dc9)&&_0x1051('0x3')===typeof _0x538dc9){_0x294c03+=_0x538dc9;}if(!_[_0x1051('0x2')](_0x3c1e6a)&&'string'===typeof _0x3c1e6a){_0x294c03+='\x20'+_0x3c1e6a;}if(_0x294c03!==''){return _0x294c03;}return _0x3c606c;}function Action(_0x350228,_0x3b6a4c,_0x4f6e93){this['voiceQueue']=_0x350228;this[_0x1051('0x4')]=_0x4f6e93||undefined;this['name']=checkNameSurname(_0x3b6a4c['Contact'][_0x1051('0x5')],_0x3b6a4c[_0x1051('0x6')][_0x1051('0x7')],_0x3b6a4c['Contact']['lastName']);this['number']=_0x3b6a4c[_0x1051('0x6')][_0x1051('0x5')];this[_0x1051('0x8')]=_0x350228[_0x1051('0x9')];this[_0x1051('0xa')]=_0x3b6a4c[_0x1051('0xa')]||![];this[_0x1051('0xb')]=_0x350228['type'];this[_0x1051('0xc')]=_0x350228[_0x1051('0xc')]||0x3;this[_0x1051('0xd')]=_0x3b6a4c[_0x1051('0xd')];this['countbusyretry']=_0x3b6a4c[_0x1051('0xe')];this[_0x1051('0xf')]=_0x3b6a4c[_0x1051('0xf')];this[_0x1051('0x10')]=_0x3b6a4c[_0x1051('0x10')];this['countnosuchnumberretry']=_0x3b6a4c[_0x1051('0x11')];this[_0x1051('0x12')]=_0x3b6a4c[_0x1051('0x12')];this[_0x1051('0x13')]=_0x3b6a4c[_0x1051('0x13')];this['countmachineretry']=_0x3b6a4c[_0x1051('0x14')];this[_0x1051('0x15')]=_0x3b6a4c[_0x1051('0x15')];this['ContactId']=_0x3b6a4c[_0x1051('0x16')];this[_0x1051('0x17')]=_0x3b6a4c[_0x1051('0x17')];this['UserId']=_0x3b6a4c[_0x1051('0x18')];this[_0x1051('0x19')]=_0x3b6a4c['VoiceQueueId'];this[_0x1051('0x1a')]=_0x3b6a4c[_0x1051('0x1a')];this[_0x1051('0x1b')]=_0x3b6a4c['id'];this[_0x1051('0x1c')]=_0x3b6a4c[_0x1051('0x6')][_0x1051('0x7')]||'';this[_0x1051('0x1d')]=moment()[_0x1051('0x1e')](_0x1051('0x1f'));this[_0x1051('0x20')]=_0x3b6a4c[_0x1051('0x20')];this[_0x1051('0x21')]=_0x3b6a4c[_0x1051('0x21')];this[_0x1051('0x22')]=_0x3b6a4c['callbackat'];this[_0x1051('0x23')]=_0x3b6a4c[_0x1051('0x23')];this[_0x1051('0x24')]='';this[_0x1051('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0x1051('0x1e')](_0x1051('0x26'),this[_0x1051('0x9')],this[_0x1051('0x27')][_0x1051('0x28')]>0x0?this[_0x1051('0x29')][_0x1051('0x2a')](this[_0x1051('0x27')][_0x1051('0x28')]):this['number']);};Action[_0x1051('0x2b')][_0x1051('0x2c')]=function(){return this['queue'];};module[_0x1051('0x2d')]=Action;
\ No newline at end of file
+var _0x84f3=['util','lodash','moment','isNil','string','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','voiceQueue'];(function(_0x1b3666,_0x3a1ad1){var _0x45da37=function(_0x78d51a){while(--_0x78d51a){_0x1b3666['push'](_0x1b3666['shift']());}};_0x45da37(++_0x3a1ad1);}(_0x84f3,0x148));var _0x384f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x84f3[_0x8c43de];return _0xa6591b;};'use strict';var util=require(_0x384f('0x0'));var _=require(_0x384f('0x1'));var moment=require(_0x384f('0x2'));function checkNameSurname(_0x153484,_0x4e82ab,_0x3dc562){var _0x23019d='';if(!_['isNil'](_0x4e82ab)&&'string'===typeof _0x4e82ab){_0x23019d+=_0x4e82ab;}if(!_[_0x384f('0x3')](_0x3dc562)&&_0x384f('0x4')===typeof _0x3dc562){_0x23019d+='\x20'+_0x3dc562;}if(_0x23019d!==''){return _0x23019d;}return _0x153484;}function Action(_0x3551b8,_0x528e61,_0x27d658){this['voiceQueue']=_0x3551b8;this['uniqueid']=_0x27d658||undefined;this[_0x384f('0x5')]=checkNameSurname(_0x528e61[_0x384f('0x6')][_0x384f('0x7')],_0x528e61[_0x384f('0x6')][_0x384f('0x8')],_0x528e61[_0x384f('0x6')][_0x384f('0x9')]);this[_0x384f('0xa')]=_0x528e61[_0x384f('0x6')][_0x384f('0x7')];this[_0x384f('0xb')]=_0x3551b8[_0x384f('0x5')];this['active']=_0x528e61[_0x384f('0xc')]||![];this['type']=_0x3551b8[_0x384f('0xd')];this[_0x384f('0xe')]=_0x3551b8['dialQueueTimeout']||0x3;this['scheduledat']=_0x528e61[_0x384f('0xf')];this['countbusyretry']=_0x528e61[_0x384f('0x10')];this[_0x384f('0x11')]=_0x528e61[_0x384f('0x11')];this[_0x384f('0x12')]=_0x528e61['countnoanswerretry'];this[_0x384f('0x13')]=_0x528e61[_0x384f('0x13')];this[_0x384f('0x14')]=_0x528e61['countdropretry'];this[_0x384f('0x15')]=_0x528e61[_0x384f('0x15')];this['countmachineretry']=_0x528e61[_0x384f('0x16')];this[_0x384f('0x17')]=_0x528e61[_0x384f('0x17')];this[_0x384f('0x18')]=_0x528e61['ContactId'];this[_0x384f('0x19')]=_0x528e61['ListId'];this[_0x384f('0x1a')]=_0x528e61['UserId'];this[_0x384f('0x1b')]=_0x528e61['VoiceQueueId'];this[_0x384f('0x1c')]=_0x528e61[_0x384f('0x1c')];this['idHopper']=_0x528e61['id'];this[_0x384f('0x1d')]=_0x528e61['Contact']['firstName']||'';this[_0x384f('0x1e')]=moment()[_0x384f('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x384f('0x20')]=_0x528e61[_0x384f('0x20')];this[_0x384f('0x21')]=_0x528e61[_0x384f('0x21')];this[_0x384f('0x22')]=_0x528e61[_0x384f('0x22')];this['recallme']=_0x528e61['recallme'];this[_0x384f('0x23')]='';this['originatecalleridname']='';}Action[_0x384f('0x24')][_0x384f('0x25')]=function(){return util[_0x384f('0x1f')](_0x384f('0x26'),this[_0x384f('0x5')],this['voiceQueue'][_0x384f('0x27')]>0x0?this[_0x384f('0xa')]['substring'](this[_0x384f('0x28')][_0x384f('0x27')]):this[_0x384f('0xa')]);};Action[_0x384f('0x24')]['getQueue']=function(){return this['queue'];};module['exports']=Action;
\ No newline at end of file
index 949d9a5..b343527 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc542=['calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname'];(function(_0x452e88,_0xa26af0){var _0x4eb5b6=function(_0x7cc716){while(--_0x7cc716){_0x452e88['push'](_0x452e88['shift']());}};_0x4eb5b6(++_0xa26af0);}(_0xc542,0xd1));var _0x2c54=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xc542[_0x50007c];return _0x5c1ec7;};'use strict';var util=require(_0x2c54('0x0'));var _=require(_0x2c54('0x1'));var moment=require(_0x2c54('0x2'));function getSeconds(_0x3891ff,_0x262114){var _0x14c6f8=moment(_0x3891ff)['milliseconds'](0x0);var _0x4e0983=moment(_0x262114)['milliseconds'](0x0);return _0x14c6f8[_0x2c54('0x3')](_0x4e0983,_0x2c54('0x4'));}function AgentComplete(_0x5a4645,_0x5eb94f){this['state']=0x4;this[_0x2c54('0x5')]=_0x2c54('0x6');this[_0x2c54('0x7')]=_0x5a4645[_0x2c54('0x7')];this['type']=_0x5a4645[_0x2c54('0x8')];this[_0x2c54('0x9')]=_0x5a4645[_0x2c54('0x8')]===_0x2c54('0xa')?'queue':_0x5a4645[_0x2c54('0x8')];this['countbusyretry']=_0x5a4645[_0x2c54('0xb')];this['countcongestionretry']=_0x5a4645[_0x2c54('0xc')];this[_0x2c54('0xd')]=_0x5a4645[_0x2c54('0xd')];this['countglobal']=_0x5a4645[_0x2c54('0xb')]+_0x5a4645[_0x2c54('0xc')]+_0x5a4645[_0x2c54('0xd')]+_0x5a4645[_0x2c54('0xe')]+_0x5a4645[_0x2c54('0xf')]+_0x5a4645[_0x2c54('0x10')]+_0x5a4645[_0x2c54('0x11')]+_0x5a4645[_0x2c54('0x12')];this[_0x2c54('0xe')]=_0x5a4645[_0x2c54('0xe')];this[_0x2c54('0xf')]=_0x5a4645[_0x2c54('0xf')];this[_0x2c54('0x10')]=_0x5a4645['countabandonedretry'];this[_0x2c54('0x11')]=_0x5a4645[_0x2c54('0x11')];this[_0x2c54('0x12')]=_0x5a4645[_0x2c54('0x12')];this['uniqueid']=_0x5eb94f[_0x2c54('0x13')];this[_0x2c54('0x14')]=_0x5a4645['name'];this[_0x2c54('0x15')]=_0x5a4645[_0x2c54('0x16')];this['starttime']=_0x5a4645[_0x2c54('0x17')];this[_0x2c54('0x18')]=_0x5a4645[_0x2c54('0x18')];this[_0x2c54('0x19')]=_0x5a4645[_0x2c54('0x19')];this[_0x2c54('0x1a')]=moment()['format'](_0x2c54('0x1b'));this[_0x2c54('0x1c')]=getSeconds(_0x5a4645['responsetime'],_0x5a4645[_0x2c54('0x17')]);this[_0x2c54('0x1d')]=getSeconds(_0x5a4645[_0x2c54('0x19')],_0x5a4645[_0x2c54('0x18')]);this[_0x2c54('0x1e')]=getSeconds(this['endtime'],_0x5a4645[_0x2c54('0x19')]);this[_0x2c54('0x1f')]=_0x5eb94f[_0x2c54('0x1f')];this['membername']=_0x5eb94f[_0x2c54('0x20')];this[_0x2c54('0x21')]=_0x5eb94f[_0x2c54('0x21')];this['callback']=_0x5a4645[_0x2c54('0x22')];this[_0x2c54('0x23')]=_0x5a4645['callbackuniqueid'];this['callbackat']=_0x5a4645[_0x2c54('0x24')];this[_0x2c54('0x25')]=_0x5a4645[_0x2c54('0x25')];this[_0x2c54('0x26')]=_0x5a4645[_0x2c54('0x26')];this[_0x2c54('0x27')]=_0x5a4645['ListId'];this[_0x2c54('0x28')]=_0x5a4645[_0x2c54('0x28')];this[_0x2c54('0x29')]=_0x5a4645['VoiceQueueId'];this['CampaignId']=_0x5a4645[_0x2c54('0x2a')];this[_0x2c54('0x2b')]=_0x5a4645[_0x2c54('0x2b')]||'';this[_0x2c54('0x2c')]=_0x5a4645[_0x2c54('0x2c')]||'';}module[_0x2c54('0x2d')]=AgentComplete;
\ No newline at end of file
+var _0x4ab6=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer'];(function(_0x5946df,_0x3ac359){var _0x481992=function(_0xbe6ab4){while(--_0xbe6ab4){_0x5946df['push'](_0x5946df['shift']());}};_0x481992(++_0x3ac359);}(_0x4ab6,0x19f));var _0x64ab=function(_0x149a41,_0x3cbb44){_0x149a41=_0x149a41-0x0;var _0x10132c=_0x4ab6[_0x149a41];return _0x10132c;};'use strict';var util=require('util');var _=require(_0x64ab('0x0'));var moment=require(_0x64ab('0x1'));function getSeconds(_0x3e8c84,_0x2eb6a9){var _0x3b70ad=moment(_0x3e8c84)[_0x64ab('0x2')](0x0);var _0x30c54a=moment(_0x2eb6a9)[_0x64ab('0x2')](0x0);return _0x3b70ad[_0x64ab('0x3')](_0x30c54a,_0x64ab('0x4'));}function AgentComplete(_0x46037d,_0xc66191){this[_0x64ab('0x5')]=0x4;this[_0x64ab('0x6')]=_0x64ab('0x7');this[_0x64ab('0x8')]=_0x46037d['scheduledat'];this[_0x64ab('0x9')]=_0x46037d[_0x64ab('0x9')];this[_0x64ab('0xa')]=_0x46037d[_0x64ab('0x9')]===_0x64ab('0xb')?'queue':_0x46037d['type'];this[_0x64ab('0xc')]=_0x46037d[_0x64ab('0xc')];this[_0x64ab('0xd')]=_0x46037d[_0x64ab('0xd')];this[_0x64ab('0xe')]=_0x46037d[_0x64ab('0xe')];this[_0x64ab('0xf')]=_0x46037d[_0x64ab('0xc')]+_0x46037d[_0x64ab('0xd')]+_0x46037d[_0x64ab('0xe')]+_0x46037d[_0x64ab('0x10')]+_0x46037d['countdropretry']+_0x46037d[_0x64ab('0x11')]+_0x46037d['countmachineretry']+_0x46037d[_0x64ab('0x12')];this['countnosuchnumberretry']=_0x46037d['countnosuchnumberretry'];this['countdropretry']=_0x46037d[_0x64ab('0x13')];this['countabandonedretry']=_0x46037d[_0x64ab('0x11')];this[_0x64ab('0x14')]=_0x46037d[_0x64ab('0x14')];this[_0x64ab('0x12')]=_0x46037d['countagentrejectretry'];this[_0x64ab('0x15')]=_0xc66191[_0x64ab('0x15')];this['calleridname']=_0x46037d[_0x64ab('0x16')];this[_0x64ab('0x17')]=_0x46037d[_0x64ab('0x18')];this[_0x64ab('0x19')]=_0x46037d[_0x64ab('0x19')];this[_0x64ab('0x1a')]=_0x46037d[_0x64ab('0x1a')];this['answertime']=_0x46037d[_0x64ab('0x1b')];this[_0x64ab('0x1c')]=moment()[_0x64ab('0x1d')](_0x64ab('0x1e'));this[_0x64ab('0x1f')]=getSeconds(_0x46037d[_0x64ab('0x1a')],_0x46037d['starttime']);this[_0x64ab('0x20')]=getSeconds(_0x46037d[_0x64ab('0x1b')],_0x46037d[_0x64ab('0x1a')]);this['talktime']=getSeconds(this[_0x64ab('0x1c')],_0x46037d[_0x64ab('0x1b')]);this['queue']=_0xc66191['queue'];this['membername']=_0xc66191[_0x64ab('0x21')];this['reason']=_0xc66191[_0x64ab('0x22')];this[_0x64ab('0x23')]=_0x46037d['callback'];this[_0x64ab('0x24')]=_0x46037d['callbackuniqueid'];this[_0x64ab('0x25')]=_0x46037d['callbackat'];this[_0x64ab('0x26')]=_0x46037d['recallme'];this['ContactId']=_0x46037d[_0x64ab('0x27')];this['ListId']=_0x46037d[_0x64ab('0x28')];this['UserId']=_0x46037d[_0x64ab('0x29')];this[_0x64ab('0x2a')]=_0x46037d[_0x64ab('0x2a')];this['CampaignId']=_0x46037d[_0x64ab('0x2b')];this['originatecalleridnum']=_0x46037d[_0x64ab('0x2c')]||'';this[_0x64ab('0x2d')]=_0x46037d[_0x64ab('0x2d')]||'';}module[_0x64ab('0x2e')]=AgentComplete;
\ No newline at end of file
index 9997e13..753f379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b78=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x3f3d9c,_0xe7a271){var _0x58d8c9=function(_0x570cf4){while(--_0x570cf4){_0x3f3d9c['push'](_0x3f3d9c['shift']());}};_0x58d8c9(++_0xe7a271);}(_0x0b78,0x1ad));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x80b7('0x0'));var _=require(_0x80b7('0x1'));var moment=require('moment');function getSeconds(_0x10e644,_0x4f55ab){var _0x4bffac=moment(_0x10e644)[_0x80b7('0x2')](0x0);var _0x4ee9b4=moment(_0x4f55ab)[_0x80b7('0x2')](0x0);return _0x4bffac[_0x80b7('0x3')](_0x4ee9b4,_0x80b7('0x4'));}function Final(_0x5d4a96){this['uniqueid']=_0x5d4a96[_0x80b7('0x5')];this['scheduledat']=_0x5d4a96[_0x80b7('0x6')];this[_0x80b7('0x7')]=_0x5d4a96[_0x80b7('0x7')];this[_0x80b7('0x8')]=_0x5d4a96['type']===_0x80b7('0x9')?_0x80b7('0xa'):_0x5d4a96[_0x80b7('0x7')];this['countbusyretry']=_0x5d4a96[_0x80b7('0xb')];this['countcongestionretry']=_0x5d4a96[_0x80b7('0xc')];this[_0x80b7('0xd')]=_0x5d4a96[_0x80b7('0xd')];this[_0x80b7('0xe')]=_0x5d4a96[_0x80b7('0xb')]+_0x5d4a96[_0x80b7('0xc')]+_0x5d4a96[_0x80b7('0xd')]+_0x5d4a96[_0x80b7('0xf')]+_0x5d4a96[_0x80b7('0x10')]+_0x5d4a96[_0x80b7('0x11')]+_0x5d4a96[_0x80b7('0x12')]+_0x5d4a96['countagentrejectretry'];this[_0x80b7('0xf')]=_0x5d4a96[_0x80b7('0xf')];this['countdropretry']=_0x5d4a96[_0x80b7('0x10')];this[_0x80b7('0x11')]=_0x5d4a96['countabandonedretry'];this[_0x80b7('0x12')]=_0x5d4a96[_0x80b7('0x12')];this[_0x80b7('0x13')]=_0x5d4a96[_0x80b7('0x13')];this[_0x80b7('0xa')]=_0x5d4a96[_0x80b7('0xa')];this[_0x80b7('0x14')]=_0x5d4a96[_0x80b7('0x14')];this[_0x80b7('0x15')]=_0x5d4a96[_0x80b7('0x15')];this['starttime']=_0x5d4a96[_0x80b7('0x16')];this[_0x80b7('0x17')]=_0x5d4a96[_0x80b7('0x17')];this[_0x80b7('0x18')]=_0x5d4a96['responsetime'];this['ringtime']=_0x5d4a96[_0x80b7('0x19')]||0x0;this[_0x80b7('0x1a')]=_0x5d4a96[_0x80b7('0x1a')]||0x0;this[_0x80b7('0x1b')]=_0x5d4a96['talktime']||0x0;this['callback']=_0x5d4a96[_0x80b7('0x1c')];this[_0x80b7('0x1d')]=_0x5d4a96[_0x80b7('0x1d')];this[_0x80b7('0x1e')]=_0x5d4a96['callbackat'];this[_0x80b7('0x1f')]=_0x5d4a96['recallme'];this['ContactId']=_0x5d4a96[_0x80b7('0x20')];this[_0x80b7('0x21')]=_0x5d4a96[_0x80b7('0x21')];this[_0x80b7('0x22')]=_0x5d4a96[_0x80b7('0x22')];this[_0x80b7('0x23')]=_0x5d4a96[_0x80b7('0x23')];this[_0x80b7('0x24')]=_0x5d4a96[_0x80b7('0x24')];this[_0x80b7('0x25')]=_0x5d4a96[_0x80b7('0x25')]||'';this[_0x80b7('0x26')]=_0x5d4a96[_0x80b7('0x26')]||'';}module[_0x80b7('0x27')]=Final;
\ No newline at end of file
+var _0x8ce1=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x403d9e,_0x27e15a){var _0x86beac=function(_0xfffe25){while(--_0xfffe25){_0x403d9e['push'](_0x403d9e['shift']());}};_0x86beac(++_0x27e15a);}(_0x8ce1,0x183));var _0x18ce=function(_0x47f717,_0x2ee238){_0x47f717=_0x47f717-0x0;var _0x4ab2d3=_0x8ce1[_0x47f717];return _0x4ab2d3;};'use strict';var util=require(_0x18ce('0x0'));var _=require(_0x18ce('0x1'));var moment=require(_0x18ce('0x2'));function getSeconds(_0x1ba15f,_0x202f93){var _0x22b196=moment(_0x1ba15f)[_0x18ce('0x3')](0x0);var _0xfc68a8=moment(_0x202f93)[_0x18ce('0x3')](0x0);return _0x22b196[_0x18ce('0x4')](_0xfc68a8,_0x18ce('0x5'));}function Final(_0x280142){this[_0x18ce('0x6')]=_0x280142[_0x18ce('0x6')];this[_0x18ce('0x7')]=_0x280142[_0x18ce('0x7')];this['type']=_0x280142[_0x18ce('0x8')];this[_0x18ce('0x9')]=_0x280142[_0x18ce('0x8')]===_0x18ce('0xa')?'queue':_0x280142[_0x18ce('0x8')];this[_0x18ce('0xb')]=_0x280142[_0x18ce('0xb')];this[_0x18ce('0xc')]=_0x280142['countcongestionretry'];this['countnoanswerretry']=_0x280142[_0x18ce('0xd')];this[_0x18ce('0xe')]=_0x280142[_0x18ce('0xb')]+_0x280142[_0x18ce('0xc')]+_0x280142[_0x18ce('0xd')]+_0x280142['countnosuchnumberretry']+_0x280142[_0x18ce('0xf')]+_0x280142[_0x18ce('0x10')]+_0x280142[_0x18ce('0x11')]+_0x280142[_0x18ce('0x12')];this[_0x18ce('0x13')]=_0x280142['countnosuchnumberretry'];this[_0x18ce('0xf')]=_0x280142[_0x18ce('0xf')];this[_0x18ce('0x10')]=_0x280142[_0x18ce('0x10')];this[_0x18ce('0x11')]=_0x280142[_0x18ce('0x11')];this[_0x18ce('0x12')]=_0x280142['countagentrejectretry'];this[_0x18ce('0x14')]=_0x280142[_0x18ce('0x14')];this[_0x18ce('0x15')]=_0x280142[_0x18ce('0x15')];this[_0x18ce('0x16')]=_0x280142[_0x18ce('0x16')];this['starttime']=_0x280142[_0x18ce('0x17')];this[_0x18ce('0x18')]=_0x280142[_0x18ce('0x18')];this['endtime']=_0x280142[_0x18ce('0x18')];this[_0x18ce('0x19')]=_0x280142[_0x18ce('0x19')]||0x0;this['holdtime']=_0x280142[_0x18ce('0x1a')]||0x0;this[_0x18ce('0x1b')]=_0x280142['talktime']||0x0;this[_0x18ce('0x1c')]=_0x280142[_0x18ce('0x1c')];this[_0x18ce('0x1d')]=_0x280142[_0x18ce('0x1d')];this[_0x18ce('0x1e')]=_0x280142[_0x18ce('0x1e')];this[_0x18ce('0x1f')]=_0x280142[_0x18ce('0x1f')];this[_0x18ce('0x20')]=_0x280142['ContactId'];this['ListId']=_0x280142['ListId'];this[_0x18ce('0x21')]=_0x280142['UserId'];this[_0x18ce('0x22')]=_0x280142[_0x18ce('0x22')];this[_0x18ce('0x23')]=_0x280142['CampaignId'];this['originatecalleridnum']=_0x280142['originatecalleridnum']||'';this[_0x18ce('0x24')]=_0x280142[_0x18ce('0x24')]||'';}module[_0x18ce('0x25')]=Final;
\ No newline at end of file
index 3f58b5a..27c96b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf860=['util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x4e67e3,_0x1f87fa){var _0x28f0df=function(_0x86312b){while(--_0x86312b){_0x4e67e3['push'](_0x4e67e3['shift']());}};_0x28f0df(++_0x1f87fa);}(_0xf860,0x150));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x0f86('0x0'));var _=require(_0x0f86('0x1'));var moment=require(_0x0f86('0x2'));function getSeconds(_0x57b667,_0x1ec491){var _0x4da6e6=moment(_0x57b667)[_0x0f86('0x3')](0x0);var _0x472980=moment(_0x1ec491)[_0x0f86('0x3')](0x0);return _0x4da6e6['diff'](_0x472980,_0x0f86('0x4'));}function Hangup(_0x2f0dc9,_0x14900e){this['state']=0x4;this['statedesc']='Answer';this['scheduledat']=_0x2f0dc9[_0x0f86('0x5')];this['type']=_0x2f0dc9[_0x0f86('0x6')];this[_0x0f86('0x7')]=_0x2f0dc9[_0x0f86('0x6')]===_0x0f86('0x8')?_0x0f86('0x9'):_0x2f0dc9[_0x0f86('0x6')];this[_0x0f86('0xa')]=_0x2f0dc9['countbusyretry'];this[_0x0f86('0xb')]=_0x2f0dc9[_0x0f86('0xb')];this[_0x0f86('0xc')]=_0x2f0dc9[_0x0f86('0xc')];this['countglobal']=_0x2f0dc9['countbusyretry']+_0x2f0dc9['countcongestionretry']+_0x2f0dc9[_0x0f86('0xc')]+_0x2f0dc9['countnosuchnumberretry']+_0x2f0dc9[_0x0f86('0xd')]+_0x2f0dc9[_0x0f86('0xe')]+_0x2f0dc9[_0x0f86('0xf')]+_0x2f0dc9[_0x0f86('0x10')];this[_0x0f86('0x11')]=_0x2f0dc9['countnosuchnumberretry'];this[_0x0f86('0xd')]=_0x2f0dc9[_0x0f86('0xd')];this[_0x0f86('0xe')]=_0x2f0dc9[_0x0f86('0xe')];this[_0x0f86('0xf')]=_0x2f0dc9['countmachineretry'];this[_0x0f86('0x10')]=_0x2f0dc9[_0x0f86('0x10')];this[_0x0f86('0x12')]=_0x14900e[_0x0f86('0x12')];this['calleridname']=_0x2f0dc9[_0x0f86('0x13')];this[_0x0f86('0x14')]=_0x2f0dc9[_0x0f86('0x15')];this[_0x0f86('0x16')]=_0x2f0dc9[_0x0f86('0x16')];this['responsetime']=_0x2f0dc9['responsetime'];this[_0x0f86('0x17')]=moment()['format'](_0x0f86('0x18'));this[_0x0f86('0x19')]=getSeconds(_0x2f0dc9[_0x0f86('0x1a')],_0x2f0dc9[_0x0f86('0x16')]);this[_0x0f86('0x1b')]=0x0;this[_0x0f86('0x1c')]=getSeconds(this['endtime'],_0x2f0dc9[_0x0f86('0x1a')]);this['queue']=_0x2f0dc9[_0x0f86('0x9')];this['membername']=_0x0f86('0x1d');this[_0x0f86('0x1e')]=_0x14900e[_0x0f86('0x1f')];this[_0x0f86('0x20')]=_0x2f0dc9[_0x0f86('0x20')];this[_0x0f86('0x21')]=_0x2f0dc9[_0x0f86('0x21')];this[_0x0f86('0x22')]=_0x2f0dc9[_0x0f86('0x22')];this[_0x0f86('0x23')]=_0x2f0dc9[_0x0f86('0x23')];this[_0x0f86('0x24')]=_0x2f0dc9[_0x0f86('0x24')];this['ListId']=_0x2f0dc9[_0x0f86('0x25')];this[_0x0f86('0x26')]=_0x2f0dc9[_0x0f86('0x26')];this[_0x0f86('0x27')]=_0x2f0dc9[_0x0f86('0x27')];this[_0x0f86('0x28')]=_0x2f0dc9['CampaignId'];}module[_0x0f86('0x29')]=Hangup;
\ No newline at end of file
+var _0x729b=['countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','endtime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x729b,0xa0));var _0xb729=function(_0x2db0a7,_0x2662aa){_0x2db0a7=_0x2db0a7-0x0;var _0x3f4e27=_0x729b[_0x2db0a7];return _0x3f4e27;};'use strict';var util=require(_0xb729('0x0'));var _=require(_0xb729('0x1'));var moment=require(_0xb729('0x2'));function getSeconds(_0x34ba6e,_0x4f8f5f){var _0x101659=moment(_0x34ba6e)['milliseconds'](0x0);var _0x28b690=moment(_0x4f8f5f)[_0xb729('0x3')](0x0);return _0x101659[_0xb729('0x4')](_0x28b690,_0xb729('0x5'));}function Hangup(_0x18fd5c,_0x1fcfd8){this[_0xb729('0x6')]=0x4;this[_0xb729('0x7')]=_0xb729('0x8');this[_0xb729('0x9')]=_0x18fd5c['scheduledat'];this['type']=_0x18fd5c[_0xb729('0xa')];this[_0xb729('0xb')]=_0x18fd5c['type']===_0xb729('0xc')?'queue':_0x18fd5c[_0xb729('0xa')];this[_0xb729('0xd')]=_0x18fd5c[_0xb729('0xd')];this['countcongestionretry']=_0x18fd5c[_0xb729('0xe')];this[_0xb729('0xf')]=_0x18fd5c['countnoanswerretry'];this['countglobal']=_0x18fd5c[_0xb729('0xd')]+_0x18fd5c[_0xb729('0xe')]+_0x18fd5c[_0xb729('0xf')]+_0x18fd5c[_0xb729('0x10')]+_0x18fd5c[_0xb729('0x11')]+_0x18fd5c['countabandonedretry']+_0x18fd5c[_0xb729('0x12')]+_0x18fd5c[_0xb729('0x13')];this[_0xb729('0x10')]=_0x18fd5c[_0xb729('0x10')];this[_0xb729('0x11')]=_0x18fd5c[_0xb729('0x11')];this[_0xb729('0x14')]=_0x18fd5c[_0xb729('0x14')];this[_0xb729('0x12')]=_0x18fd5c['countmachineretry'];this[_0xb729('0x13')]=_0x18fd5c[_0xb729('0x13')];this[_0xb729('0x15')]=_0x1fcfd8['uniqueid'];this[_0xb729('0x16')]=_0x18fd5c[_0xb729('0x17')];this[_0xb729('0x18')]=_0x18fd5c[_0xb729('0x19')];this[_0xb729('0x1a')]=_0x18fd5c[_0xb729('0x1a')];this['responsetime']=_0x18fd5c['responsetime'];this['endtime']=moment()[_0xb729('0x1b')](_0xb729('0x1c'));this[_0xb729('0x1d')]=getSeconds(_0x18fd5c[_0xb729('0x1e')],_0x18fd5c['starttime']);this['holdtime']=0x0;this['talktime']=getSeconds(this[_0xb729('0x1f')],_0x18fd5c[_0xb729('0x1e')]);this[_0xb729('0x20')]=_0x18fd5c[_0xb729('0x20')];this[_0xb729('0x21')]='IVR';this[_0xb729('0x22')]=_0x1fcfd8[_0xb729('0x23')];this[_0xb729('0x24')]=_0x18fd5c[_0xb729('0x24')];this[_0xb729('0x25')]=_0x18fd5c['callbackuniqueid'];this[_0xb729('0x26')]=_0x18fd5c['callbackat'];this[_0xb729('0x27')]=_0x18fd5c[_0xb729('0x27')];this[_0xb729('0x28')]=_0x18fd5c[_0xb729('0x28')];this['ListId']=_0x18fd5c['ListId'];this[_0xb729('0x29')]=_0x18fd5c[_0xb729('0x29')];this[_0xb729('0x2a')]=_0x18fd5c[_0xb729('0x2a')];this[_0xb729('0x2b')]=_0x18fd5c[_0xb729('0x2b')];}module[_0xb729('0x2c')]=Hangup;
\ No newline at end of file
index 1c4f550..b50b1c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e45=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x41c2d7,_0xc4f9a2){var _0x292611=function(_0x32d84e){while(--_0x32d84e){_0x41c2d7['push'](_0x41c2d7['shift']());}};_0x292611(++_0xc4f9a2);}(_0x9e45,0x1ee));var _0x59e4=function(_0x46759d,_0x13e994){_0x46759d=_0x46759d-0x0;var _0x3e7fe0=_0x9e45[_0x46759d];return _0x3e7fe0;};'use strict';var util=require(_0x59e4('0x0'));var _=require(_0x59e4('0x1'));var moment=require(_0x59e4('0x2'));function getSeconds(_0x5c27d0,_0x2978db){var _0x2718ce=moment(_0x5c27d0)[_0x59e4('0x3')](0x0);var _0x65335=moment(_0x2978db)[_0x59e4('0x3')](0x0);return _0x2718ce[_0x59e4('0x4')](_0x65335,_0x59e4('0x5'));}function History(_0x335f00){this['uniqueid']=_0x335f00['uniqueid'];this[_0x59e4('0x6')]=_0x335f00[_0x59e4('0x6')]||undefined;this[_0x59e4('0x7')]=_0x335f00['type'];this[_0x59e4('0x8')]=_0x335f00[_0x59e4('0x7')]==='outbound'?'queue':_0x335f00[_0x59e4('0x7')];this[_0x59e4('0x9')]=_0x335f00[_0x59e4('0x9')];this[_0x59e4('0xa')]=_0x335f00[_0x59e4('0xa')];this[_0x59e4('0xb')]=_0x335f00[_0x59e4('0xb')];this[_0x59e4('0xc')]=_0x335f00['countbusyretry']+_0x335f00[_0x59e4('0xa')]+_0x335f00['countnoanswerretry']+_0x335f00[_0x59e4('0xd')]+_0x335f00[_0x59e4('0xe')]+_0x335f00[_0x59e4('0xf')]+_0x335f00[_0x59e4('0x10')]+_0x335f00[_0x59e4('0x11')];this[_0x59e4('0xd')]=_0x335f00[_0x59e4('0xd')];this[_0x59e4('0xe')]=_0x335f00['countdropretry'];this[_0x59e4('0xf')]=_0x335f00['countabandonedretry'];this[_0x59e4('0x10')]=_0x335f00[_0x59e4('0x10')];this[_0x59e4('0x11')]=_0x335f00[_0x59e4('0x11')];this[_0x59e4('0x12')]=_0x335f00[_0x59e4('0x12')];this[_0x59e4('0x13')]=_0x335f00[_0x59e4('0x14')];this[_0x59e4('0x15')]=_0x335f00[_0x59e4('0x16')];this[_0x59e4('0x17')]=_0x335f00[_0x59e4('0x17')];this[_0x59e4('0x18')]=_0x335f00['responsetime'];this[_0x59e4('0x19')]=_0x335f00[_0x59e4('0x18')];this[_0x59e4('0x1a')]=getSeconds(_0x335f00['responsetime'],_0x335f00[_0x59e4('0x17')]);this['holdtime']=0x0;this[_0x59e4('0x1b')]=0x0;this[_0x59e4('0x1c')]=_0x335f00[_0x59e4('0x1c')];this[_0x59e4('0x1d')]=_0x335f00['callbackuniqueid'];this['callbackat']=_0x335f00[_0x59e4('0x1e')];this[_0x59e4('0x1f')]=_0x335f00[_0x59e4('0x1f')];this[_0x59e4('0x20')]=_0x335f00[_0x59e4('0x20')];this[_0x59e4('0x21')]=_0x335f00[_0x59e4('0x21')];this[_0x59e4('0x22')]=_0x335f00['UserId'];this[_0x59e4('0x23')]=_0x335f00[_0x59e4('0x23')];this[_0x59e4('0x24')]=_0x335f00[_0x59e4('0x24')];this[_0x59e4('0x25')]=_0x335f00[_0x59e4('0x25')]||'';this[_0x59e4('0x26')]=_0x335f00[_0x59e4('0x26')]||'';}module['exports']=History;
\ No newline at end of file
+var _0xab91=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash'];(function(_0x59df08,_0x5de18e){var _0x3128d5=function(_0x255087){while(--_0x255087){_0x59df08['push'](_0x59df08['shift']());}};_0x3128d5(++_0x5de18e);}(_0xab91,0x14b));var _0x1ab9=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0xab91[_0x414297];return _0x51ea47;};'use strict';var util=require(_0x1ab9('0x0'));var _=require(_0x1ab9('0x1'));var moment=require(_0x1ab9('0x2'));function getSeconds(_0x5b5f0b,_0x2a0aff){var _0x409d66=moment(_0x5b5f0b)['milliseconds'](0x0);var _0x1caf0d=moment(_0x2a0aff)[_0x1ab9('0x3')](0x0);return _0x409d66[_0x1ab9('0x4')](_0x1caf0d,_0x1ab9('0x5'));}function History(_0x3f00da){this[_0x1ab9('0x6')]=_0x3f00da['uniqueid'];this['scheduledat']=_0x3f00da[_0x1ab9('0x7')]||undefined;this['type']=_0x3f00da[_0x1ab9('0x8')];this['campaigntype']=_0x3f00da[_0x1ab9('0x8')]===_0x1ab9('0x9')?_0x1ab9('0xa'):_0x3f00da[_0x1ab9('0x8')];this[_0x1ab9('0xb')]=_0x3f00da[_0x1ab9('0xb')];this[_0x1ab9('0xc')]=_0x3f00da[_0x1ab9('0xc')];this[_0x1ab9('0xd')]=_0x3f00da[_0x1ab9('0xd')];this['countglobal']=_0x3f00da[_0x1ab9('0xb')]+_0x3f00da[_0x1ab9('0xc')]+_0x3f00da[_0x1ab9('0xd')]+_0x3f00da[_0x1ab9('0xe')]+_0x3f00da[_0x1ab9('0xf')]+_0x3f00da[_0x1ab9('0x10')]+_0x3f00da[_0x1ab9('0x11')]+_0x3f00da['countagentrejectretry'];this[_0x1ab9('0xe')]=_0x3f00da['countnosuchnumberretry'];this[_0x1ab9('0xf')]=_0x3f00da['countdropretry'];this['countabandonedretry']=_0x3f00da[_0x1ab9('0x10')];this['countmachineretry']=_0x3f00da['countmachineretry'];this[_0x1ab9('0x12')]=_0x3f00da['countagentrejectretry'];this['queue']=_0x3f00da[_0x1ab9('0xa')];this[_0x1ab9('0x13')]=_0x3f00da['name'];this[_0x1ab9('0x14')]=_0x3f00da['number'];this[_0x1ab9('0x15')]=_0x3f00da[_0x1ab9('0x15')];this[_0x1ab9('0x16')]=_0x3f00da['responsetime'];this[_0x1ab9('0x17')]=_0x3f00da[_0x1ab9('0x16')];this[_0x1ab9('0x18')]=getSeconds(_0x3f00da[_0x1ab9('0x16')],_0x3f00da[_0x1ab9('0x15')]);this[_0x1ab9('0x19')]=0x0;this[_0x1ab9('0x1a')]=0x0;this['callback']=_0x3f00da[_0x1ab9('0x1b')];this[_0x1ab9('0x1c')]=_0x3f00da[_0x1ab9('0x1c')];this[_0x1ab9('0x1d')]=_0x3f00da['callbackat'];this[_0x1ab9('0x1e')]=_0x3f00da[_0x1ab9('0x1e')];this[_0x1ab9('0x1f')]=_0x3f00da['ContactId'];this[_0x1ab9('0x20')]=_0x3f00da[_0x1ab9('0x20')];this['UserId']=_0x3f00da[_0x1ab9('0x21')];this[_0x1ab9('0x22')]=_0x3f00da[_0x1ab9('0x22')];this[_0x1ab9('0x23')]=_0x3f00da[_0x1ab9('0x23')];this[_0x1ab9('0x24')]=_0x3f00da[_0x1ab9('0x24')]||'';this['originatecalleridname']=_0x3f00da['originatecalleridname']||'';}module['exports']=History;
\ No newline at end of file
index 50a6197..5556b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44a3=['predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice_queue:save','ivr','format','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\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','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','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','prototype','loopClearZombieChannels','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','then','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','notFound','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','saveInDb','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','custom:amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','dialMachineMaxRetry','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','agent','agiafterat','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','true','content','indexOf','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','reason','[syncAgentComplete][createHistory][?]','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','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\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','dialPredictiveOptimizationPercentage','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','checkContactBlack','[getContactCampaign2]','dialLimitQueue','ACTIVE','RUNNING','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./history','./final','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls'];(function(_0x74ed8c,_0x4e0b72){var _0x218e32=function(_0x586181){while(--_0x586181){_0x74ed8c['push'](_0x74ed8c['shift']());}};_0x218e32(++_0x4e0b72);}(_0x44a3,0x1a9));var _0x344a=function(_0x176e9e,_0x3dfe11){_0x176e9e=_0x176e9e-0x0;var _0x1b675f=_0x44a3[_0x176e9e];return _0x1b675f;};'use strict';var util=require(_0x344a('0x0'));var _=require(_0x344a('0x1'));var BPromise=require(_0x344a('0x2'));var uuid=require(_0x344a('0x3'));var moment=require(_0x344a('0x4'));var rr=require('rr');var md5=require(_0x344a('0x5'));var Redis=require(_0x344a('0x6'));var ut=require(_0x344a('0x7'));var config=require('../../../config/environment/');var logger=require(_0x344a('0x8'))(_0x344a('0x9'));var loggerBooked=require(_0x344a('0x8'))(_0x344a('0xa'));var loggerPredictive=require(_0x344a('0x8'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x344a('0xb'));var ami=require(_0x344a('0xc'));config[_0x344a('0xd')]=_[_0x344a('0xe')](config[_0x344a('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x344a('0xf'))(new Redis(config[_0x344a('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x344a('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x344a('0x11'));var Action=require('./action');var History=require(_0x344a('0x12'));var Final=require(_0x344a('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x344a('0x14'));var ipAgi=process[_0x344a('0x15')][_0x344a('0x16')]||_0x344a('0x17');var strategy={'rrmemory':_0x344a('0x18'),'roundrobin':_0x344a('0x19')};var Sequence=function(){};Sequence['prototype'][_0x344a('0x1a')]=function(_0x2360e9){this[_0x344a('0x1b')]=this[_0x344a('0x1b')]?this['tail']['finally'](_0x2360e9):_0x2360e9();};function Dialer(_0x3609ce,_0x1aad46){this[_0x344a('0x1c')]=new Sequence();this[_0x344a('0x1d')]=_0x1aad46;this['voiceQueues']=_0x3609ce[_0x344a('0x1e')];this[_0x344a('0x1f')]=_0x3609ce['campaigns'];this[_0x344a('0x20')]=_0x3609ce[_0x344a('0x20')];this[_0x344a('0x21')]=_0x3609ce[_0x344a('0x21')];this[_0x344a('0x22')]=config[_0x344a('0x22')]||0x2;this[_0x344a('0x23')]={};this[_0x344a('0x24')]={};this[_0x344a('0x25')]={};this[_0x344a('0x26')]={};this['optionPredictive']={};this[_0x344a('0x27')]={};this[_0x344a('0x28')]={};this[_0x344a('0x29')]={};this[_0x344a('0x2a')]={};this[_0x344a('0x2b')]={};ami['on'](_0x344a('0x2c'),this[_0x344a('0x2d')][_0x344a('0x2e')](this));ami['on'](_0x344a('0x2f'),this[_0x344a('0x30')][_0x344a('0x2e')](this));ami['on'](_0x344a('0x31'),this[_0x344a('0x32')][_0x344a('0x2e')](this));ami['on']('agentcomplete',this[_0x344a('0x33')]['bind'](this));ami['on'](_0x344a('0x34'),this['syncQueueSummary'][_0x344a('0x2e')](this));ami['on'](_0x344a('0x35'),this[_0x344a('0x36')][_0x344a('0x2e')](this));ami['on'](_0x344a('0x37'),this[_0x344a('0x38')][_0x344a('0x2e')](this));ami['on'](_0x344a('0x39'),this['syncVarSet'][_0x344a('0x2e')](this));ami['on'](_0x344a('0x3a'),this[_0x344a('0x3b')][_0x344a('0x2e')](this));ami['on'](_0x344a('0x3c'),this[_0x344a('0x3d')]['bind'](this));this[_0x344a('0x3e')]();this['loopClearZombieChannels']();}function isNotNull(_0x593cf6){return _0x593cf6!==null&&!_[_0x344a('0x3f')](_0x593cf6);}function checkIsLoggedIn(_0x14fa86,_0x5a36bb){return function(){if(_0x5a36bb<=0x0){_0x14fa86['message']='AGENTS_NOT_LOGGED';throw _0x14fa86['name']+_0x344a('0x40');}};}function isActive(_0x23c484){return _0x23c484;}function checkIsActive(_0xf9bb6d,_0x58d90b){return function(){if(!isActive(_0x58d90b)){_0xf9bb6d[_0x344a('0x41')]=_0x344a('0x42');throw _0xf9bb6d[_0x344a('0x43')]+_0x344a('0x44');}};}function checkInterval(_0x20e5c6){return function(){if(!isNotNull(_0x20e5c6[_0x344a('0x45')])){_0x20e5c6[_0x344a('0x41')]='INTERVAL_IS_NULL';throw _0x20e5c6[_0x344a('0x43')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x20e5c6['Interval']['Intervals'])){_0x20e5c6[_0x344a('0x41')]=_0x344a('0x46');throw _0x20e5c6[_0x344a('0x43')]+_0x344a('0x47');}if(!isNotNull(_[_0x344a('0x48')](_0x20e5c6[_0x344a('0x45')]['Intervals']))){_0x20e5c6[_0x344a('0x41')]=_0x344a('0x46');throw _0x20e5c6[_0x344a('0x43')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3698eb,_0x183787,_0x5054ca){return{'action':_0x3698eb,'response':_0x183787,'message':_0x5054ca,'stack':_0x5054ca};}function myreject(_0x487a9b){return function(_0x1b7c8c){return _0x487a9b(msgResponse('[ifTime][Action]',_0x344a('0x49'),JSON[_0x344a('0x4a')](_0x1b7c8c)));};}function getSeconds(_0x150662,_0xf9597b){var _0x475a9f=moment(_0x150662)['milliseconds'](0x0);var _0x123a9c=moment(_0xf9597b)[_0x344a('0x4b')](0x0);return _0x475a9f[_0x344a('0x4c')](_0x123a9c,_0x344a('0x4d'));}function emit(_0x204f22,_0x5a24c4,_0x13c9ca){io['to'](_0x204f22)[_0x344a('0x4e')](_0x5a24c4,_0x13c9ca);}function emitVoiceQueueSummary(_0x1f52dc){if(_0x1f52dc[_0x344a('0x4f')]===_0x344a('0x50')){var _0x27d2d5={'id':_0x1f52dc['id'],'name':_0x1f52dc[_0x344a('0x43')],'strategy':_0x1f52dc[_0x344a('0x51')],'answered':_0x1f52dc['answered'],'available':_0x1f52dc[_0x344a('0x52')],'loggedIn':_0x1f52dc[_0x344a('0x53')],'pTalking':_0x1f52dc[_0x344a('0x54')],'sumBillable':_0x1f52dc[_0x344a('0x55')],'sumDuration':_0x1f52dc[_0x344a('0x56')],'sumHoldTime':_0x1f52dc['sumHoldTime']||0x0,'talking':_0x1f52dc[_0x344a('0x57')],'total':_0x1f52dc[_0x344a('0x58')],'type':_0x1f52dc[_0x344a('0x4f')],'unmanaged':_0x1f52dc[_0x344a('0x59')],'abandoned':_0x1f52dc[_0x344a('0x5a')],'waiting':_0x1f52dc[_0x344a('0x5b')],'loggedInDb':_0x1f52dc[_0x344a('0x5c')],'dialActive':_0x1f52dc[_0x344a('0x5d')],'dialMethod':_0x1f52dc[_0x344a('0x5e')],'dialOriginateCallerIdName':_0x1f52dc['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1f52dc[_0x344a('0x5f')],'dialOriginateTimeout':_0x1f52dc[_0x344a('0x60')],'dialPrefix':_0x1f52dc[_0x344a('0x61')],'outboundAnswerAgiCallsDay':_0x1f52dc[_0x344a('0x62')],'outboundAnswerCallsDay':_0x1f52dc['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1f52dc[_0x344a('0x63')],'outboundBusyCallsDay':_0x1f52dc[_0x344a('0x64')],'outboundCongestionCallsDay':_0x1f52dc[_0x344a('0x65')],'outboundDropCallsDayACS':_0x1f52dc[_0x344a('0x66')],'outboundDropCallsDayCallersExit':_0x1f52dc[_0x344a('0x67')],'outboundDropCallsDayTimeout':_0x1f52dc[_0x344a('0x68')],'outboundNoAnswerCallsDay':_0x1f52dc[_0x344a('0x69')],'outboundNoSuchCallsDay':_0x1f52dc[_0x344a('0x6a')],'outboundOriginateFailureCallsDay':_0x1f52dc[_0x344a('0x6b')],'outboundReCallsDay':_0x1f52dc[_0x344a('0x6c')],'outboundRejectCallsDay':_0x1f52dc[_0x344a('0x6d')],'outboundUnknownCallsDay':_0x1f52dc['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1f52dc[_0x344a('0x6e')],'predictiveIntervalAvgHoldtime':_0x1f52dc[_0x344a('0x6f')],'predictiveIntervalAvgTalktime':_0x1f52dc['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1f52dc[_0x344a('0x70')],'predictiveIntervalDroppedCallsTimeout':_0x1f52dc[_0x344a('0x71')],'predictiveIntervalErlangCalls':_0x1f52dc['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1f52dc[_0x344a('0x72')],'predictiveIntervalHitRate':_0x1f52dc[_0x344a('0x73')],'predictiveIntervalMultiplicativeFactor':_0x1f52dc['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1f52dc[_0x344a('0x74')],'predictiveIntervalAvailable':_0x1f52dc[_0x344a('0x75')],'predictiveIntervalTotalCalls':_0x1f52dc[_0x344a('0x76')],'message':_0x1f52dc['message'],'originated':_0x1f52dc[_0x344a('0x77')],'erlangCalls':_0x1f52dc['erlangCalls'],'erlangCallToSecond':_0x1f52dc[_0x344a('0x78')],'erlangAbandonmentRate':_0x1f52dc[_0x344a('0x79')],'erlangBusyFactor':_0x1f52dc[_0x344a('0x7a')],'startPredictive':_0x1f52dc[_0x344a('0x27')],'startProgressive':_0x1f52dc['startProgressive']};if(_0x1f52dc['Trunk']){_0x27d2d5[_0x344a('0x7b')]={'id':_0x1f52dc[_0x344a('0x7b')]['id'],'name':_0x1f52dc[_0x344a('0x7b')][_0x344a('0x43')],'active':_0x1f52dc[_0x344a('0x7b')][_0x344a('0x7c')],'callerid':_0x1f52dc[_0x344a('0x7b')][_0x344a('0x7d')]};}if(_0x1f52dc[_0x344a('0x45')]){_0x27d2d5[_0x344a('0x45')]={'id':_0x1f52dc['Interval']['id'],'name':_0x1f52dc[_0x344a('0x45')][_0x344a('0x43')]};}var _0x6fad37=md5(JSON[_0x344a('0x4a')](_0x27d2d5));if(_0x1f52dc['md5']!==_0x6fad37){_0x1f52dc[_0x344a('0x5')]=_0x6fad37;emit(util['format']('voice:queue:%s',_0x27d2d5[_0x344a('0x43')]),_0x344a('0x7e'),_0x27d2d5);}}}function emitCampaignSummary(_0x5917cc){if(_0x5917cc[_0x344a('0x4f')]===_0x344a('0x7f')){emit(util[_0x344a('0x80')](_0x344a('0x81'),_0x5917cc['name']),_0x344a('0x82'),_0x5917cc);}}function checkGetDataPredictive(_0xbcdcac){if(isNotNull(_0xbcdcac)&&!_[_0x344a('0x48')](_0xbcdcac)){loggerPredictive[_0x344a('0x83')](_0x344a('0x84'));loggerPredictive[_0x344a('0x83')](_0x344a('0x85'),_0xbcdcac[_0x344a('0x76')]);loggerPredictive[_0x344a('0x83')](_0x344a('0x86'),_0xbcdcac['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x344a('0x83')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xbcdcac[_0x344a('0x71')]);loggerPredictive[_0x344a('0x83')](_0x344a('0x87'),_0xbcdcac['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x344a('0x83')](_0x344a('0x88'),_0xbcdcac[_0x344a('0x6f')]);loggerPredictive[_0x344a('0x83')](_0x344a('0x89'),_0xbcdcac[_0x344a('0x8a')]);loggerPredictive[_0x344a('0x83')](_0x344a('0x8b'));if(_0xbcdcac[_0x344a('0x76')]>0x0){if(!_['isUndefined'](_0xbcdcac[_0x344a('0x8a')])&&_0xbcdcac[_0x344a('0x8a')]>0x0){return!![];}loggerPredictive[_0x344a('0x83')](_0x344a('0x8c'));if(!_[_0x344a('0x3f')](_0xbcdcac['predictiveIntervalAvgHoldtime'])&&_0xbcdcac[_0x344a('0x6f')]>0x0){return!![];}loggerPredictive[_0x344a('0x83')](_0x344a('0x8d'));}else{loggerPredictive[_0x344a('0x83')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x344a('0x83')](_0x344a('0x8e'));}return![];}function mergeDataErlangB(_0x4c2fe7){return function(_0x22b844){loggerPredictive[_0x344a('0x83')](_0x344a('0x8f'));loggerPredictive[_0x344a('0x83')](_0x344a('0x90'),_0x22b844[_0x344a('0x91')]);loggerPredictive[_0x344a('0x83')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22b844['erlangCallToSecond']);loggerPredictive['info'](_0x344a('0x92'),_0x22b844[_0x344a('0x79')]);loggerPredictive[_0x344a('0x83')](_0x344a('0x93'),_0x22b844['erlangBusyFactor']);loggerPredictive[_0x344a('0x83')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22b844['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0x344a('0x94')](_0x4c2fe7,_0x22b844);};}function getDiff(_0x3e252f){var _0x20665a=moment()[_0x344a('0x4b')](0x0);var _0x5158dc=moment(_0x3e252f)['milliseconds'](0x0);return _0x20665a['diff'](_0x5158dc,_0x344a('0x4d'));}function ifInterval(_0x9bc11f,_0x16c145){if(_[_0x344a('0x3f')](_0x16c145)){return![];}return getDiff(_0x16c145)<_0x9bc11f*0x3c;}function freeVariablesPredictive(_0xb88c75){if(isNotNull(_0xb88c75)){if(!_['isUndefined'](_0xb88c75[_0x344a('0x28')])){_0xb88c75[_0x344a('0x28')]=undefined;loggerPredictive[_0x344a('0x83')](_0xb88c75['name'],_0x344a('0x95'));}if(!_['isUndefined'](_0xb88c75['startPredictive'])){_0xb88c75[_0x344a('0x27')]=undefined;loggerPredictive['info'](_0xb88c75['name'],_0x344a('0x96'));}if(!_[_0x344a('0x3f')](_0xb88c75['handlePredictive'])){clearInterval(_0xb88c75[_0x344a('0x97')]);_0xb88c75['handlePredictive']=undefined;loggerPredictive[_0x344a('0x83')](_0xb88c75[_0x344a('0x43')],_0x344a('0x98'));}}}function erlangb(_0x52928e,_0x5decfa){if(_0x5decfa===0x0){return 0x0;}var _0x4f79da=0x1;for(var _0x2e1342=0x1;_0x2e1342<=_0x5decfa;_0x2e1342+=0x1){_0x4f79da=0x1+_0x4f79da*_0x2e1342/_0x52928e;}return 0x1/_0x4f79da;}function isVoiceQueueOutbound(_0xb4ddd7){return _0xb4ddd7===_0x344a('0x50');}function isNotPreview(_0x5e300f){return _0x5e300f!=='preview';}function isCampaignIvr(_0x24bd35){return _0x24bd35===_0x344a('0x7f');}function getCallerId(_0x1c1eaf,_0x4f5119,_0x827f2e){if(!_[_0x344a('0x3f')](_0x827f2e)&&typeof _0x827f2e==='string'&&!_[_0x344a('0x48')](_0x827f2e)){if(!_['isUndefined'](_0x4f5119)&&typeof _0x4f5119===_0x344a('0x99')&&!_['isEmpty'](_0x4f5119)){return util['format']('\x22%s\x22\x20<%s>',_0x4f5119,_0x827f2e);}return util[_0x344a('0x80')](_0x344a('0x9a'),_0x827f2e,_0x827f2e);}if(!_[_0x344a('0x3f')](_0x1c1eaf)&&typeof _0x1c1eaf===_0x344a('0x99')&&!_[_0x344a('0x48')](_0x1c1eaf)){return _0x1c1eaf;}return _0x344a('0x9b');}function loggerCatchQueueSummary(_0x513eb9,_0x2b5409){return function(_0x319f1f){freeVariablesPredictive(_0x2b5409);emitVoiceQueueSummary(_0x2b5409);emitCampaignSummary(_0x2b5409);loggerSyncQueueSummary[_0x344a('0x9c')](_0x513eb9,util[_0x344a('0x9d')](_0x319f1f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x26688e,_0x523774){return function(_0x23a761){loggerPredictive[_0x344a('0x9c')](_0x523774['name'],_0x26688e);loggerPredictive[_0x344a('0x9c')](_0x23a761[_0x344a('0x9e')]);freeVariablesPredictive(_0x523774);};}function loggerCatch(_0x12dcb0){return function(_0x3a71f3){logger['error'](_0x12dcb0,util[_0x344a('0x9d')](_0x3a71f3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1f23a0){return _0x1f23a0&&!_[_0x344a('0x3f')](_0x1f23a0)&&_0x1f23a0[_0x344a('0x9f')]>0x0;}function decremetOriginate(_0x1c3f24){if(!_[_0x344a('0x3f')](_0x1c3f24)&&_0x1c3f24!==null){if(typeof _0x1c3f24[_0x344a('0x77')]!==_0x344a('0xa0')){if(_0x1c3f24['originated']>0x0){_0x1c3f24[_0x344a('0x77')]-=0x1;}else{logger[_0x344a('0x9c')](_0x344a('0xa1'));}}}else{logger[_0x344a('0x9c')](_0x344a('0xa2'));}}function checkContactLowerLimitOriginate(_0x1247bb,_0x212b08,_0x435dd8){if(_0x212b08>_0x435dd8){for(var _0x4f4bea=0x0;_0x4f4bea<_0x212b08-_0x435dd8;_0x4f4bea+=0x1){decremetOriginate(_0x1247bb);}}}function loggerGetContactDialer(_0x10a2ec,_0x425647,_0x15eb7d){return function(_0x36e695){checkContactLowerLimitOriginate(_0x425647,_0x15eb7d,0x0);logger['error'](_0x10a2ec,util[_0x344a('0x9d')](_0x36e695,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x57306b){return function(_0x3d87a9){if(isNotNull(_0x3d87a9)&&isNotNull(_0x3d87a9[0x0])){if(_0x3d87a9[0x0][_0x344a('0xa3')]>0x0){_0x57306b[_0x344a('0x41')]=_0x344a('0xa4');logger[_0x344a('0x83')](_0x344a('0xa5')+_0x57306b['name'],_0x3d87a9[0x0][_0x344a('0xa3')],_0x344a('0xa6'));}else{_0x57306b[_0x344a('0x41')]=_0x344a('0xa7');logger['info'](_0x344a('0xa8')+_0x57306b[_0x344a('0x43')]);}}};}function notSendMessagesQueue(_0x1d0025){if(_0x1d0025[_0x344a('0xa9')]){freeVariablesPredictive(_0x1d0025);if(_0x1d0025[_0x344a('0x77')]===0x0&&_0x1d0025[_0x344a('0x57')]===0x0&&_0x1d0025['waiting']===0x0&&(_0x1d0025[_0x344a('0x54')]||0x0)===0x0){_0x1d0025[_0x344a('0xa9')]=![];_0x1d0025[_0x344a('0x52')]=0x0;_0x1d0025['message']=_0x344a('0x42');loggerSyncQueueSummary[_0x344a('0x9c')](_0x344a('0xaa'),_0x1d0025[_0x344a('0x43')],_0x344a('0xab'));}else{_0x1d0025['message']=_0x344a('0xac');loggerSyncQueueSummary[_0x344a('0x9c')](_0x344a('0xaa'),_0x1d0025['name'],_0x344a('0xad'));}emitVoiceQueueSummary(_0x1d0025);}}function notSendMessagesCampaign(_0x5928ca){if(_0x5928ca['sendMessageOneNotActive']){if(_0x5928ca[_0x344a('0x77')]===0x0){_0x5928ca[_0x344a('0xa9')]=![];_0x5928ca[_0x344a('0x41')]=_0x344a('0x42');loggerSyncQueueSummary[_0x344a('0x9c')](_0x344a('0xae'),_0x5928ca[_0x344a('0x43')],_0x344a('0xab'));}else{_0x5928ca['message']=_0x344a('0xac');loggerSyncQueueSummary[_0x344a('0x9c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5928ca['name'],_0x344a('0xad'));}emitCampaignSummary(_0x5928ca);}}function createObjHistory(_0x10a1b7,_0xf056c9,_0x2933e7,_0x4a28df,_0x21d972){_0x10a1b7[_0x344a('0x41')]=_0x2933e7;var _0x200b2a=new Action(_0x10a1b7,_0xf056c9);var _0x5e5908=new History(_0x200b2a);_0x5e5908[_0x344a('0xaf')]=_0x4a28df;_0x5e5908[_0x344a('0xb0')]=_0x21d972;_0x5e5908[_0x344a('0xb1')]=_0x200b2a['starttime'];return _0x5e5908;}Dialer[_0x344a('0xb2')][_0x344a('0xb3')]=function(){var _0x2b8cdc=this;setInterval(function(){_0x2b8cdc[_0x344a('0xb4')](_0x2b8cdc[_0x344a('0x26')],_0x344a('0xb5'));_0x2b8cdc[_0x344a('0xb4')](_0x2b8cdc[_0x344a('0x24')],'[actions]');},0x32c8);};Dialer[_0x344a('0xb2')][_0x344a('0xb4')]=function(_0x5cee04,_0x2991b8){var _0x145f8e=this;for(var _0x3c0a19 in _0x5cee04){if(typeof _0x5cee04[_0x3c0a19]!==_0x344a('0xa0')){this[_0x344a('0x1c')]['enqueue'](function(){if(!_[_0x344a('0xb6')](_0x5cee04[_0x3c0a19])){return ami[_0x344a('0xb7')]({'action':_0x344a('0xb8'),'channel':_0x5cee04[_0x3c0a19][_0x344a('0xb9')]})[_0x344a('0xba')](function(_0x252d2e){if(_0x252d2e[_0x344a('0x41')]===_0x344a('0xbb')){setTimeout(function(){if(_0x5cee04[_0x3c0a19]&&_0x5cee04[_0x3c0a19][_0x344a('0x4f')]!=='ivr'){_0x145f8e[_0x344a('0xbc')](_0x145f8e[_0x344a('0x1e')][_0x5cee04[_0x3c0a19][_0x344a('0xbd')]]);logger['error'](_0x344a('0xbe'),_0x2991b8,_0x3c0a19,_0x5cee04[_0x3c0a19][_0x344a('0xbd')]);delete _0x5cee04[_0x3c0a19];}if(_0x5cee04[_0x3c0a19]&&_0x5cee04[_0x3c0a19][_0x344a('0x4f')]===_0x344a('0x7f')){_0x145f8e[_0x344a('0xbc')](_0x145f8e[_0x344a('0x1f')][_0x5cee04[_0x3c0a19][_0x344a('0xbd')]]);logger[_0x344a('0x9c')]('[Dialer][checkChannel][ivr]',_0x2991b8,_0x3c0a19,_0x5cee04[_0x3c0a19]['queue']);delete _0x5cee04[_0x3c0a19];}},0x2328);}});}});}}};Dialer['prototype'][_0x344a('0xbf')]=function(_0x353879){return BPromise['resolve']()[_0x344a('0xc0')](cmHopper[_0x344a('0xbf')](_0x353879))[_0x344a('0xba')](loggerCatch(_0x344a('0xc1')));};Dialer['prototype']['checkIsBlackList']=function(_0x126b53){return BPromise[_0x344a('0xc2')]()[_0x344a('0xc0')](cmHopperBlack[_0x344a('0xc3')](_0x126b53))[_0x344a('0xba')](loggerCatch(_0x344a('0xc4')));};Dialer[_0x344a('0xb2')]['checkIsBlackListIvr']=function(_0x3a9b0c){return BPromise['resolve']()[_0x344a('0xc0')](cmHopperBlack['checkIsBlackListIvr'](_0x3a9b0c))[_0x344a('0xba')](loggerCatch(_0x344a('0xc5')));};Dialer[_0x344a('0xb2')][_0x344a('0xc6')]=function(_0x5c6f4f){return BPromise[_0x344a('0xc2')]()[_0x344a('0xc0')](cmHopperHistory['avgHandleTime'](_0x5c6f4f))[_0x344a('0xba')](loggerCatch(_0x344a('0xc7')));};Dialer[_0x344a('0xb2')][_0x344a('0xc8')]=function(_0x57c598){return BPromise['resolve']()[_0x344a('0xc0')](cmHopper[_0x344a('0xc8')](_0x57c598))[_0x344a('0xba')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x24ff67,_0x3bc850,_0x26ad3b){return BPromise['resolve']()['then'](cmHopper[_0x344a('0xc9')](_0x24ff67,_0x3bc850,_0x26ad3b))[_0x344a('0xba')](loggerCatch(_0x344a('0xca')));};Dialer[_0x344a('0xb2')][_0x344a('0xcb')]=function(_0x2be635,_0x4d75a2,_0x21615d,_0x43d566,_0x439644){return BPromise['resolve']()[_0x344a('0xc0')](cmHopper[_0x344a('0xcb')](_0x2be635,_0x4d75a2,_0x21615d,_0x43d566))[_0x344a('0xba')](function(_0x4a1033){_0x439644[_0x344a('0xcc')]-=_0x21615d;_0x439644[_0x344a('0xcc')]=_0x439644[_0x344a('0xcc')]>0x0?_0x439644[_0x344a('0xcc')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x4a1033);});};Dialer[_0x344a('0xb2')]['getContactDialerIvr']=function(_0x5696c6,_0x13176c,_0x583507,_0x493d46){return BPromise[_0x344a('0xc2')]()['then'](cmHopper[_0x344a('0xcd')](_0x5696c6,_0x13176c,_0x583507))[_0x344a('0xba')](function(_0x5b0a24){_0x493d46[_0x344a('0xcc')]-=_0x13176c;_0x493d46[_0x344a('0xcc')]=_0x493d46[_0x344a('0xcc')]>0x0?_0x493d46[_0x344a('0xcc')]:0x0;loggerCatch(_0x344a('0xce'))(_0x5b0a24);});};Dialer[_0x344a('0xb2')][_0x344a('0xcf')]=function(_0x3161b5){return BPromise[_0x344a('0xc2')]()[_0x344a('0xc0')](voiceQueueRt[_0x344a('0xcf')](_0x3161b5))[_0x344a('0xba')](loggerCatch(_0x344a('0xd0')));};Dialer[_0x344a('0xb2')]['moveContactManagedDialer']=function(_0x57dc73){return BPromise[_0x344a('0xc2')]()['then'](cmHopper[_0x344a('0xd1')](_0x57dc73))[_0x344a('0xba')](loggerCatch(_0x344a('0xd2')));};Dialer[_0x344a('0xb2')][_0x344a('0xd3')]=function(_0xb32156){return BPromise['resolve']()['then'](cmHopperHistory[_0x344a('0xd3')](_0xb32156))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0x344a('0xb2')][_0x344a('0xbc')]=function(_0x15f392){if(!_[_0x344a('0x3f')](_0x15f392)&&_0x15f392!==null){if(typeof _0x15f392[_0x344a('0x77')]!=='undefined'){if(_0x15f392[_0x344a('0x77')]>0x0){_0x15f392[_0x344a('0x77')]-=0x1;}else{logger[_0x344a('0x9c')](_0x344a('0xd4'));}}}else{logger[_0x344a('0x9c')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x344a('0xd5')]=function(_0x1e2235,_0x5e2908){var _0x4fff54=this;return function(_0x450a3a){_0x4fff54[_0x344a('0xbc')](_0x5e2908);logger[_0x344a('0x9c')](_0x1e2235,util['inspect'](_0x450a3a,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x239088,_0x1ed1a5,_0x1c8312){var _0xc25695={'state':0x19,'statedesc':_0x344a('0xd6')};this[_0x344a('0xbc')](_0x1ed1a5);this['saveInDb'](_['merge'](_0xc25695,_[_0x344a('0xd7')](_0x1c8312,[_0x344a('0xd8'),'ListId',_0x344a('0xd9'),_0x344a('0xda'),_0x344a('0xdb')])),'[emptyContact][createHistory]',_0x344a('0xdc'));logger[_0x344a('0x9c')](_0x239088);};Dialer[_0x344a('0xb2')][_0x344a('0xdd')]=function(_0xf0891c){return _0xf0891c==='Success';};Dialer[_0x344a('0xb2')][_0x344a('0xde')]=function(_0xb1d164){return!_[_0x344a('0x3f')](_0xb1d164)&&_0xb1d164&&!_[_0x344a('0x3f')](_0xb1d164['name'])&&!_[_0x344a('0x3f')](_0xb1d164[_0x344a('0x7c')])&&_0xb1d164['active']&&(this[_0x344a('0x21')][util[_0x344a('0x80')](_0x344a('0xdf'),_0xb1d164[_0x344a('0x43')])]['status']===_0x344a('0xe0')||this[_0x344a('0x21')][util['format'](_0x344a('0xdf'),_0xb1d164[_0x344a('0x43')])][_0x344a('0xb8')]===_0x344a('0xe1'));};Dialer[_0x344a('0xb2')][_0x344a('0xe2')]=function(_0x396c98,_0x25a617,_0x286793){this['createHistory'](_0x396c98)['catch'](loggerCatch(_0x25a617));this[_0x344a('0xd1')](_0x396c98)[_0x344a('0xba')](loggerCatch(_0x286793));};Dialer[_0x344a('0xb2')][_0x344a('0xe3')]=function(_0x6f749d){var _0xc1ed4a=this[_0x344a('0x26')][_0x6f749d[_0x344a('0xe4')]];var _0x100603;if(!_[_0x344a('0xb6')](_0x6f749d)&&!_[_0x344a('0xb6')](_0x6f749d[_0x344a('0xe5')])&&!_[_0x344a('0xb6')](_0x6f749d[_0x344a('0xe5')][_0x344a('0xe6')])&&_0x6f749d[_0x344a('0xe7')]===_0x344a('0xe8')&&_0xc1ed4a){if(_0xc1ed4a[_0x344a('0x4f')]!==_0x344a('0x7f')&&this[_0x344a('0x1e')][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0xe9')]&&_0x6f749d[_0x344a('0xea')]===_0x344a('0xeb')){delete this[_0x344a('0x26')][_0x6f749d[_0x344a('0xe4')]];this['updateOriginated'](this['voiceQueues'][_0xc1ed4a['queue']]);this['voiceQueues'][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0xec')]+=0x1;this[_0x344a('0x1e')][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0x62')]+=0x1;_0x100603=new Hangup(_0xc1ed4a,_0x6f749d);_0x100603[_0x344a('0xaf')]=0x12;_0x100603['statedesc']=_0x344a('0xed');_0x100603[_0x344a('0xee')]=_0x344a('0xef');ami[_0x344a('0x4e')]('custom:amd',ut[_0x344a('0xf0')](_0x100603,_0x344a('0xf1')));this[_0x344a('0xe2')](_0x100603,'[syncHangupInAMD][createHistory]',_0x344a('0xf2'));}if(_0xc1ed4a[_0x344a('0x4f')]!=='ivr'&&this[_0x344a('0x1e')][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0xe9')]&&_0x6f749d[_0x344a('0xea')]===_0x344a('0xf3')){var _0x2192e3=this;return new BPromise(function(_0x44f565,_0x5e1779){delete _0x2192e3[_0x344a('0x26')][_0x6f749d[_0x344a('0xe4')]];_0x2192e3['updateOriginated'](_0x2192e3['voiceQueues'][_0xc1ed4a[_0x344a('0xbd')]]);_0x2192e3['voiceQueues'][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0xec')]+=0x1;_0x2192e3[_0x344a('0x1e')][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0x62')]+=0x1;var _0xa75372=_0x2192e3['voiceQueues'][_0xc1ed4a[_0x344a('0xbd')]];var _0x19e6fb=new Hangup(_0xc1ed4a,_0x6f749d);_0x19e6fb[_0x344a('0xaf')]=0x13;_0x19e6fb[_0x344a('0xb0')]=_0x344a('0xf4');_0x19e6fb[_0x344a('0xee')]=_0x344a('0xef');_0x19e6fb[_0x344a('0xf5')]+=0x1;_0x19e6fb[_0x344a('0xf6')]+=0x1;_0x19e6fb[_0x344a('0xf1')]=!![];ami[_0x344a('0x4e')](_0x344a('0xf7'),ut[_0x344a('0xf0')](_0x19e6fb,'amd'));_0x2192e3[_0x344a('0xd3')](_0x19e6fb)['catch'](loggerCatch(_0x344a('0xf8')));if(_0x19e6fb[_0x344a('0xf9')]+_0x19e6fb[_0x344a('0xfa')]+_0x19e6fb[_0x344a('0xfb')]+_0x19e6fb['countnosuchnumberretry']+_0x19e6fb[_0x344a('0xfc')]+_0x19e6fb[_0x344a('0xfd')]+_0x19e6fb[_0x344a('0xf5')]+_0x19e6fb[_0x344a('0xfe')]>=_0xa75372[_0x344a('0xff')]){_0x2192e3[_0x344a('0x100')](_0x19e6fb,_0x44f565,_0x5e1779,_0x344a('0x101'));}else{if(_0x19e6fb[_0x344a('0xf5')]>=_0xa75372['dialMachineMaxRetry']){_0x2192e3['createStateFinal'](_0x19e6fb,_0x44f565,_0x5e1779,'reason\x2019\x20machine....');}else{_0x2192e3[_0x344a('0xc8')]({'active':![],'countmachineretry':_0x19e6fb['countmachineretry'],'scheduledat':moment()[_0x344a('0x102')](_0xa75372[_0x344a('0x103')],_0x344a('0x104'))['format'](_0x344a('0x105')),'ContactId':_0x19e6fb['ContactId'],'ListId':_0x19e6fb[_0x344a('0x106')],'VoiceQueueId':_0x19e6fb[_0x344a('0xda')]||undefined,'CampaignId':_0x19e6fb[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x107')));_0x44f565({'reschedule':0x1});}}});}if(_0xc1ed4a[_0x344a('0x4f')]===_0x344a('0x7f')&&this[_0x344a('0x1f')][_0xc1ed4a['queue']][_0x344a('0xe9')]&&_0x6f749d[_0x344a('0xea')]===_0x344a('0xeb')){delete this[_0x344a('0x26')][_0x6f749d[_0x344a('0xe4')]];this[_0x344a('0xbc')](this['campaigns'][_0xc1ed4a[_0x344a('0xbd')]]);_0x100603=new Hangup(_0xc1ed4a,_0x6f749d);_0x100603[_0x344a('0xaf')]=0x12;_0x100603[_0x344a('0xb0')]=_0x344a('0xed');_0x100603['membername']='AMD';ami['emit'](_0x344a('0xf7'),ut[_0x344a('0xf0')](_0x100603,'amd'));this[_0x344a('0xe2')](_0x100603,_0x344a('0x108'),_0x344a('0x109'));}if(_0xc1ed4a['type']===_0x344a('0x7f')&&this['campaigns'][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0xe9')]&&_0x6f749d[_0x344a('0xea')]===_0x344a('0xf3')){var _0x2192e3=this;return new BPromise(function(_0xe209a3,_0x446f0e){delete _0x2192e3[_0x344a('0x26')][_0x6f749d[_0x344a('0xe4')]];_0x2192e3[_0x344a('0xbc')](_0x2192e3[_0x344a('0x1f')][_0xc1ed4a[_0x344a('0xbd')]]);_0x2192e3['campaigns'][_0xc1ed4a[_0x344a('0xbd')]]['outboundAnswerCallsDay']+=0x1;_0x2192e3['campaigns'][_0xc1ed4a[_0x344a('0xbd')]][_0x344a('0x62')]+=0x1;var _0xec18=_0x2192e3['campaigns'][_0xc1ed4a[_0x344a('0xbd')]];var _0x1adf21=new Hangup(_0xc1ed4a,_0x6f749d);_0x1adf21[_0x344a('0xaf')]=0x13;_0x1adf21[_0x344a('0xb0')]=_0x344a('0xf4');_0x1adf21[_0x344a('0xee')]=_0x344a('0xef');_0x1adf21[_0x344a('0xf5')]+=0x1;_0x1adf21[_0x344a('0xf6')]+=0x1;_0x1adf21[_0x344a('0xf1')]=!![];ami[_0x344a('0x4e')](_0x344a('0xf7'),ut[_0x344a('0xf0')](_0x1adf21,'amd'));_0x2192e3[_0x344a('0xd3')](_0x1adf21)[_0x344a('0xba')](loggerCatch(_0x344a('0xf8')));if(_0x1adf21[_0x344a('0xf9')]+_0x1adf21[_0x344a('0xfa')]+_0x1adf21[_0x344a('0xfb')]+_0x1adf21[_0x344a('0x10a')]+_0x1adf21[_0x344a('0xfc')]+_0x1adf21['countabandonedretry']+_0x1adf21[_0x344a('0xf5')]+_0x1adf21[_0x344a('0xfe')]>=_0xec18[_0x344a('0xff')]){_0x2192e3[_0x344a('0x100')](_0x1adf21,_0xe209a3,_0x446f0e,_0x344a('0x101'));}else{if(_0x1adf21[_0x344a('0xf5')]>=_0xec18[_0x344a('0x10b')]){_0x2192e3[_0x344a('0x10c')](_0x1adf21,_0xe209a3,_0x446f0e,'reason\x2019\x20machine....');}else{_0x2192e3[_0x344a('0xc8')]({'active':![],'countmachineretry':_0x1adf21['countmachineretry'],'scheduledat':moment()[_0x344a('0x102')](_0xec18[_0x344a('0x103')],_0x344a('0x104'))['format'](_0x344a('0x105')),'ContactId':_0x1adf21[_0x344a('0xd8')],'ListId':_0x1adf21[_0x344a('0x106')],'VoiceQueueId':_0x1adf21[_0x344a('0xda')]||undefined,'CampaignId':_0x1adf21[_0x344a('0xdb')]||undefined})['catch'](loggerCatch(_0x344a('0x107')));_0xe209a3({'reschedule':0x1});}}});}}};Dialer[_0x344a('0xb2')][_0x344a('0x36')]=function(_0x1403c1){var _0x1defb2=this[_0x344a('0x26')][_0x1403c1[_0x344a('0xe4')]];var _0x3a7b5d=this;var _0x27e82e;if(_0x1defb2&&_0x1defb2[_0x344a('0x4f')]===_0x344a('0x7f')){delete this[_0x344a('0x26')][_0x1403c1['uniqueid']];this[_0x344a('0xbc')](this[_0x344a('0x1f')][_0x1defb2[_0x344a('0xbd')]]);this[_0x344a('0x1f')][_0x1defb2[_0x344a('0xbd')]][_0x344a('0x10d')]+=0x1;_0x27e82e=new Hangup(_0x1defb2,_0x1403c1);this[_0x344a('0xd3')](_0x27e82e)[_0x344a('0xba')](loggerCatch(_0x344a('0x10e')));this['moveContactManagedDialer'](_0x27e82e)[_0x344a('0xba')](loggerCatch(_0x344a('0x10f')));}if(_0x1defb2&&_0x1defb2['type']!=='ivr'&&isNotNull(this[_0x344a('0x1e')][_0x1defb2[_0x344a('0xbd')]][_0x344a('0x110')])){delete this[_0x344a('0x26')][_0x1403c1[_0x344a('0xe4')]];this['updateOriginated'](this[_0x344a('0x1e')][_0x1defb2[_0x344a('0xbd')]]);this['voiceQueues'][_0x1defb2[_0x344a('0xbd')]]['outboundAnswerCallsDay']+=0x1;this[_0x344a('0x1e')][_0x1defb2[_0x344a('0xbd')]][_0x344a('0x62')]+=0x1;_0x27e82e=new Hangup(_0x1defb2,_0x1403c1);_0x27e82e[_0x344a('0xaf')]=0x10;_0x27e82e[_0x344a('0xb0')]=_0x344a('0x111');_0x27e82e['membername']=_0x344a('0x112');this[_0x344a('0xd3')](_0x27e82e)[_0x344a('0xba')](loggerCatch(_0x344a('0x10e')));this[_0x344a('0xd1')](_0x27e82e)[_0x344a('0xba')](loggerCatch(_0x344a('0x10f')));}if(_0x1defb2&&_0x1defb2[_0x344a('0x4f')]!==_0x344a('0x7f')&&!isNotNull(this[_0x344a('0x1e')][_0x1defb2['queue']][_0x344a('0x110')])){delete this[_0x344a('0x26')][_0x1403c1[_0x344a('0xe4')]];this[_0x344a('0xbc')](this[_0x344a('0x1e')][_0x1defb2['queue']]);this[_0x344a('0x1e')][_0x1defb2[_0x344a('0xbd')]][_0x344a('0x113')]+=0x1;_0x27e82e=new Hangup(_0x1defb2,_0x1403c1);_0x27e82e[_0x344a('0xaf')]=0xc;_0x27e82e[_0x344a('0xb0')]=_0x1403c1[_0x344a('0x114')];_0x27e82e[_0x344a('0xee')]=_0x344a('0x115');this[_0x344a('0xd3')](_0x27e82e)[_0x344a('0xba')](loggerCatch(_0x344a('0x10e')));this[_0x344a('0xd1')](_0x27e82e)[_0x344a('0xba')](loggerCatch(_0x344a('0x10f')));}};Dialer[_0x344a('0xb2')][_0x344a('0x33')]=function(_0xb168a9){var _0x5db646=this['uniqueId'][_0xb168a9[_0x344a('0xe4')]];var _0x28defe=this;if(this['voiceQueues'][_0xb168a9[_0x344a('0xbd')]]){if(_0x5db646&&_0x5db646[_0x344a('0x4f')]!=='ivr'){delete this[_0x344a('0x26')][_0xb168a9[_0x344a('0xe4')]];this['voiceQueues'][_0xb168a9[_0x344a('0xbd')]][_0x344a('0xec')]+=0x1;var _0x4bed3a=new AgentComplete(_0x5db646,_0xb168a9);if(_0xb168a9['reason']===_0x344a('0x116')){_0x4bed3a[_0x344a('0x117')]=this['voiceQueues'][_0xb168a9['queue']]['dialQueueProject2']&&this[_0x344a('0x1e')][_0xb168a9[_0x344a('0xbd')]]['dialAgiAfterHangupAgent']?moment()[_0x344a('0x80')](_0x344a('0x105')):undefined;}this[_0x344a('0xd3')](_0x4bed3a)[_0x344a('0xba')](loggerCatch(_0x344a('0x118')));this[_0x344a('0xd1')](_0x4bed3a)['catch'](loggerCatch(_0x344a('0x119')));}}};Dialer[_0x344a('0xb2')][_0x344a('0x2d')]=function(_0x868ed8){if(this['voiceQueues'][_0x868ed8[_0x344a('0xbd')]]){if(this[_0x344a('0x26')][_0x868ed8['uniqueid']]&&this[_0x344a('0x26')][_0x868ed8[_0x344a('0xe4')]][_0x344a('0x4f')]!==_0x344a('0x7f')){this[_0x344a('0xbc')](this[_0x344a('0x1e')][_0x868ed8['queue']]);this[_0x344a('0x26')][_0x868ed8[_0x344a('0xe4')]][_0x344a('0x11a')]=moment()[_0x344a('0x80')](_0x344a('0x105'));}}};Dialer['prototype'][_0x344a('0x11b')]=function(_0x597047){this[_0x344a('0xd3')](_0x597047)[_0x344a('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x344a('0xd1')](_0x597047)[_0x344a('0xba')](loggerCatch(_0x344a('0x11c')));};Dialer[_0x344a('0xb2')]['syncQueueCallerAbandon']=function(_0x582195){var _0x2fd1e1=this[_0x344a('0x26')][_0x582195[_0x344a('0xe4')]];var _0x189c06=this;if(this[_0x344a('0x1e')][_0x582195[_0x344a('0xbd')]]){if(_0x2fd1e1&&_0x2fd1e1[_0x344a('0x4f')]!=='ivr'){delete this[_0x344a('0x26')][_0x582195['uniqueid']];this[_0x344a('0xbc')](this[_0x344a('0x1e')][_0x582195[_0x344a('0xbd')]]);_0x2fd1e1['droptime']=moment()[_0x344a('0x80')](_0x344a('0x105'));var _0x289615=new QueueCallerAbandon(_0x2fd1e1,_0x582195);if(getSeconds(_0x2fd1e1[_0x344a('0x11d')],_0x2fd1e1[_0x344a('0x11e')])>=_0x2fd1e1[_0x344a('0x11f')]){this['voiceQueues'][_0x582195[_0x344a('0xbd')]][_0x344a('0x71')]+=0x1;this['voiceQueues'][_0x582195[_0x344a('0xbd')]][_0x344a('0x68')]+=0x1;this['voiceQueues'][_0x582195[_0x344a('0xbd')]][_0x344a('0x72')]+=0x1;_0x289615[_0x344a('0xaf')]=0xa;_0x289615['statedesc']=_0x344a('0x120');_0x289615[_0x344a('0x121')]=_0x344a('0x122');_0x289615[_0x344a('0x117')]=this[_0x344a('0x1e')][_0x582195[_0x344a('0xbd')]][_0x344a('0x123')]?moment()[_0x344a('0x80')](_0x344a('0x105')):undefined;_0x289615[_0x344a('0xfc')]+=0x1;_0x289615[_0x344a('0xf6')]+=0x1;if(_0x289615[_0x344a('0xfc')]>=this[_0x344a('0x1e')][_0x582195['queue']][_0x344a('0x124')]){this['queueCallerAbandonCreateState'](_0x289615);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x289615[_0x344a('0xfc')],'scheduledat':moment()[_0x344a('0x102')](this[_0x344a('0x1e')][_0x582195[_0x344a('0xbd')]][_0x344a('0x125')],_0x344a('0x104'))['format'](_0x344a('0x105')),'ContactId':_0x2fd1e1[_0x344a('0xd8')],'ListId':_0x2fd1e1['ListId'],'VoiceQueueId':_0x2fd1e1[_0x344a('0xda')]||undefined,'CampaignId':_0x2fd1e1[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x126')));var _0xe50e70=new History(_0x289615);_0xe50e70[_0x344a('0xaf')]=0xa;_0xe50e70[_0x344a('0xb0')]='Drop';_0xe50e70[_0x344a('0x127')]=moment()[_0x344a('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0xe50e70[_0x344a('0xb1')]=_0xe50e70[_0x344a('0x127')];_0xe50e70[_0x344a('0x128')]=_0x289615[_0x344a('0x128')];_0xe50e70[_0x344a('0x129')]=_0x289615[_0x344a('0x129')];this[_0x344a('0xd3')](_0xe50e70)['catch'](loggerCatch(_0x344a('0x12a')));}}else{this[_0x344a('0x1e')][_0x582195[_0x344a('0xbd')]][_0x344a('0x70')]+=0x1;this[_0x344a('0x1e')][_0x582195[_0x344a('0xbd')]][_0x344a('0x67')]+=0x1;_0x289615[_0x344a('0xaf')]=0xb;_0x289615[_0x344a('0xb0')]='Abandoned';_0x289615[_0x344a('0x121')]=_0x344a('0x12b');_0x289615[_0x344a('0xfd')]+=0x1;_0x289615[_0x344a('0xf6')]+=0x1;if(_0x289615[_0x344a('0xfd')]>=this['voiceQueues'][_0x582195[_0x344a('0xbd')]]['dialAbandonedMaxRetry']){this[_0x344a('0x11b')](_0x289615);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x289615[_0x344a('0xfd')],'scheduledat':moment()[_0x344a('0x102')](this[_0x344a('0x1e')][_0x582195['queue']]['dialAbandonedRetryFrequency'],_0x344a('0x104'))[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x2fd1e1[_0x344a('0xd8')],'ListId':_0x2fd1e1[_0x344a('0x106')],'VoiceQueueId':_0x2fd1e1[_0x344a('0xda')]||undefined,'CampaignId':_0x2fd1e1['CampaignId']||undefined})[_0x344a('0xba')](loggerCatch('[rescheduleContact][Abandoned]'));var _0xe50e70=new History(_0x289615);_0xe50e70['state']=0xb;_0xe50e70[_0x344a('0xb0')]=_0x344a('0x12c');_0xe50e70[_0x344a('0x127')]=moment()[_0x344a('0x80')](_0x344a('0x105'));_0xe50e70[_0x344a('0xb1')]=_0xe50e70['starttime'];_0xe50e70['calleridname']=_0x289615[_0x344a('0x128')];_0xe50e70[_0x344a('0x129')]=_0x289615[_0x344a('0x129')];this[_0x344a('0xd3')](_0xe50e70)['catch'](loggerCatch(_0x344a('0x12d')));}}}}};Dialer[_0x344a('0xb2')][_0x344a('0x38')]=function(_0x3dcc7b){if(this[_0x344a('0x24')][_0x3dcc7b['uniqueid']]){this[_0x344a('0x24')][_0x3dcc7b[_0x344a('0xe4')]][_0x344a('0xb9')]=_0x3dcc7b[_0x344a('0xb9')];}if(this[_0x344a('0x26')][_0x3dcc7b[_0x344a('0xe4')]]){this[_0x344a('0x26')][_0x3dcc7b['uniqueid']][_0x344a('0xb9')]=_0x3dcc7b[_0x344a('0xb9')];}};Dialer[_0x344a('0xb2')][_0x344a('0x3b')]=function(_0x5340d2){if(strategy[this[_0x344a('0x1e')][this[_0x344a('0x24')][_0x5340d2['actionid']]['queue']]['strategy']]===_0x344a('0x19')){if(this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]]&&_['isNil'](this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]][_0x344a('0x12f')])&&_0x5340d2[_0x344a('0xb8')]==='1'&&_0x5340d2[_0x344a('0x130')]==='0'){if(this[_0x344a('0x20')][_0x5340d2[_0x344a('0x131')]]){if(!this[_0x344a('0x20')][_0x5340d2[_0x344a('0x131')]][_0x344a('0x12f')]){this[_0x344a('0x20')][_0x5340d2[_0x344a('0x131')]][_0x344a('0x12f')]=!![];this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]][_0x344a('0x12f')]=!![];this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]][_0x344a('0x131')]=_0x5340d2['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]]['queue']][_0x344a('0x51')]]||_0x344a('0x18'))==='rrmemory'){if(this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]]){if(this[_0x344a('0x20')][_0x5340d2[_0x344a('0x131')]]){this['actions'][_0x5340d2[_0x344a('0x12e')]][_0x344a('0x131')]=_0x5340d2[_0x344a('0x131')];if(_[_0x344a('0xb6')](this[_0x344a('0x2a')][this['actions'][_0x5340d2[_0x344a('0x12e')]][_0x344a('0xbd')]])){this[_0x344a('0x2a')][this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]][_0x344a('0xbd')]]=[];}this['queueBooked'][this[_0x344a('0x24')][_0x5340d2[_0x344a('0x12e')]]['queue']][_0x344a('0x132')](_[_0x344a('0x94')](_[_0x344a('0xd7')](this['actions'][_0x5340d2[_0x344a('0x12e')]],[_0x344a('0x133'),_0x344a('0x131')]),{'status':_0x5340d2[_0x344a('0xb8')],'paused':_0x5340d2[_0x344a('0x130')]}));}}}};function unlockQueueStatus(_0x455638,_0x4acae5){setTimeout(function(){if(_['isUndefined'](_0x455638[_0x344a('0x134')])){loggerBooked[_0x344a('0x9c')](_0x344a('0x135'),_0x4acae5);}_0x455638['queueStatusComplete']=!![];loggerBooked[_0x344a('0x83')](_0x344a('0x136'),_0x4acae5,JSON[_0x344a('0x4a')](_[_0x344a('0xd7')](_0x455638,[_0x344a('0x43'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x344a('0xb2')][_0x344a('0x3d')]=function(_0x52ce44){var _0x581bc5=this;var _0x1beb7f=_0x581bc5['voiceQueues'][_0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['queue']];if(strategy[this[_0x344a('0x1e')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]][_0x344a('0x51')]]===_0x344a('0x19')){if(this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]&&this[_0x344a('0x24')][_0x52ce44['actionid']]['stateinterface']){this[_0x344a('0x1d')][_0x344a('0x137')](this[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0x133')],this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0x131')])[_0x344a('0xba')](function(_0x329e10){logger[_0x344a('0x9c')](_0x344a('0x138'),util['inspect'](_0x329e10,{'showHidden':![],'depth':null}));})[_0x344a('0x139')](function(){_0x581bc5[_0x344a('0xbc')](_0x581bc5[_0x344a('0x1e')][_0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]);_0x581bc5[_0x344a('0x20')][_0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0x131')]]['locked']=![];delete _0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]];unlockQueueStatus(_0x1beb7f);});}else{this[_0x344a('0xbc')](this[_0x344a('0x1e')][this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]);this[_0x344a('0xc8')]({'active':![],'ContactId':this[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0xd8')],'ListId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0x106')],'VoiceQueueId':this[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0xda')]||undefined,'CampaignId':this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x13a')));delete this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]];unlockQueueStatus(_0x1beb7f);}}else if((strategy[this['voiceQueues'][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]['strategy']]||_0x344a('0x18'))==='rrmemory'){var _0x1ff647;if(this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]&&!_[_0x344a('0x48')](this[_0x344a('0x2a')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['queue']])){if(this[_0x344a('0x2b')][_0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]){this[_0x344a('0x2b')][_0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]=this[_0x344a('0x2b')][this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]?this[_0x344a('0x2b')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]:this[_0x344a('0x2a')][this['actions'][_0x52ce44['actionid']][_0x344a('0xbd')]]?this['queueBooked'][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]][_0x344a('0x13b')]||0x0:0x0;}this[_0x344a('0x2a')][this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]][_0x344a('0x13b')]=this['queueBookedRR'][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]];for(var _0x2ee967=0x0;_0x2ee967<this[_0x344a('0x2a')][this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]][_0x344a('0x9f')];_0x2ee967+=0x1){_0x1ff647=rr(this[_0x344a('0x2a')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['queue']]);this[_0x344a('0x2b')][_0x581bc5[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0xbd')]]=this[_0x344a('0x2a')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]][_0x344a('0x13b')];if(_0x1ff647[_0x344a('0xb8')]==='1'&&_0x1ff647[_0x344a('0x130')]==='0'){break;}}if(!_[_0x344a('0xb6')](_0x1ff647)){this['agents'][_0x1ff647[_0x344a('0x131')]][_0x344a('0x13c')]=_[_0x344a('0x3f')](this[_0x344a('0x20')][_0x1ff647[_0x344a('0x131')]][_0x344a('0x13c')])?!![]:this[_0x344a('0x20')][_0x1ff647['stateinterface']]['unlockRR'];}loggerBooked['info'](_0x344a('0x13d'),_0x52ce44[_0x344a('0x12e')],_0x344a('0x13e'),JSON[_0x344a('0x4a')](_[_0x344a('0xd7')](this[_0x344a('0x20')][_0x1ff647['stateinterface']],['name',_0x344a('0x13c')])),_0x344a('0x13f'),JSON[_0x344a('0x4a')](_0x1ff647[_0x344a('0x133')]));if(!_['isNil'](_0x1ff647)&&_0x1ff647[_0x344a('0xb8')]==='1'&&_0x1ff647[_0x344a('0x130')]==='0'&&this[_0x344a('0x20')][_0x1ff647[_0x344a('0x131')]][_0x344a('0x13c')]){this['agents'][_0x1ff647[_0x344a('0x131')]][_0x344a('0x13c')]=![];this[_0x344a('0x2a')][_0x581bc5[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]=[];this['preview'][_0x344a('0x137')](_0x1ff647[_0x344a('0x133')],_0x1ff647[_0x344a('0x131')])['catch'](function(_0x549a42){logger[_0x344a('0x9c')](_0x344a('0x138'),util['inspect'](_0x549a42,{'showHidden':![],'depth':null}));})['finally'](function(){_0x581bc5[_0x344a('0xbc')](_0x581bc5[_0x344a('0x1e')][_0x581bc5[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0xbd')]]);setTimeout(function(){_0x581bc5[_0x344a('0x20')][_0x1ff647[_0x344a('0x131')]][_0x344a('0x13c')]=!![];loggerBooked['info'](_0x344a('0x140'),_0x52ce44['actionid'],_0x344a('0x13e'),JSON[_0x344a('0x4a')](_['pick'](_0x581bc5[_0x344a('0x20')][_0x1ff647[_0x344a('0x131')]],[_0x344a('0x43'),'unlockRR'])),_0x344a('0x13f'),JSON[_0x344a('0x4a')](_0x1ff647['idHopper']));},0xc7);delete _0x581bc5['actions'][_0x52ce44[_0x344a('0x12e')]];unlockQueueStatus(_0x1beb7f,_0x52ce44[_0x344a('0x12e')]);});}else{loggerBooked[_0x344a('0x83')](_0x344a('0x141'));this[_0x344a('0xbc')](this[_0x344a('0x1e')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['queue']]);this[_0x344a('0xc8')]({'active':![],'ContactId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xd8')],'ListId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['ListId'],'VoiceQueueId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xda')]||undefined,'CampaignId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x344a('0x13a')));delete this[_0x344a('0x24')][_0x52ce44['actionid']];unlockQueueStatus(_0x1beb7f);}}else{loggerBooked[_0x344a('0x83')](_0x344a('0x142'));this[_0x344a('0xbc')](this[_0x344a('0x1e')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['queue']]);this[_0x344a('0xc8')]({'active':![],'ContactId':this['actions'][_0x52ce44['actionid']][_0x344a('0xd8')],'ListId':this['actions'][_0x52ce44[_0x344a('0x12e')]]['ListId'],'VoiceQueueId':this[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0xda')]||undefined,'CampaignId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]]['CampaignId']||undefined})[_0x344a('0xba')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x344a('0x24')][_0x52ce44['actionid']];unlockQueueStatus(_0x1beb7f);}}else{loggerBooked[_0x344a('0x83')]('[booked][unlock3]');this[_0x344a('0xbc')](this[_0x344a('0x1e')][this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xbd')]]);this[_0x344a('0xc8')]({'active':![],'ContactId':this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xd8')],'ListId':this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0x106')],'VoiceQueueId':this[_0x344a('0x24')][_0x52ce44['actionid']][_0x344a('0xda')]||undefined,'CampaignId':this['actions'][_0x52ce44[_0x344a('0x12e')]][_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x344a('0x24')][_0x52ce44[_0x344a('0x12e')]];unlockQueueStatus(_0x1beb7f);}};Dialer[_0x344a('0xb2')][_0x344a('0x3e')]=function(){var _0x5ed099=this;setInterval(function(){_0x5ed099[_0x344a('0x143')]();},0x3e8);};Dialer[_0x344a('0xb2')][_0x344a('0x144')]=function(_0x2b1b8c){var _0x30fc1f=this;return function(){if(!_0x30fc1f[_0x344a('0xde')](_0x2b1b8c[_0x344a('0x7b')])){if(!_0x30fc1f[_0x344a('0xde')](_0x2b1b8c['TrunkBackup'])){_0x2b1b8c[_0x344a('0x41')]=_0x344a('0x145');throw _0x2b1b8c[_0x344a('0x43')]+_0x344a('0x146');}}};};Dialer[_0x344a('0xb2')][_0x344a('0x147')]=function(_0x2a10b7,_0x552a52,_0x26320a,_0x2d719a){var _0x47f02d=this;return function(){var _0x553da0=!![];return _0x47f02d['ifTime'](_0x2a10b7,_0x552a52,_0x26320a,_0x2d719a,_0x553da0);};};Dialer[_0x344a('0xb2')][_0x344a('0x148')]=function(_0x2459c7,_0x31b7e0,_0x5decd9,_0x1bfe59){var _0x5a846c=this;return function(){var _0x36e30a=![];return _0x5a846c['ifTime'](_0x2459c7[_0x344a('0x149')],_0x31b7e0,_0x5decd9,_0x1bfe59,_0x36e30a);};};Dialer['prototype'][_0x344a('0x14a')]=function(_0x1b4fd3,_0x53c182,_0x2fa2a3,_0x47747c,_0x7b7c5){var _0x285d41=[];return new BPromise(function(_0x592906,_0x197941){if(!isNotNull(_0x1b4fd3)){_0x47747c[_0x344a('0x41')]=_0x344a('0x46');return _0x197941(msgResponse(_0x344a('0x14a'),_0x344a('0x14b'),_0x2fa2a3+_0x344a('0x14c')));}if(_[_0x344a('0x48')](_0x1b4fd3)){_0x47747c[_0x344a('0x41')]=_0x344a('0x14d');return _0x197941(msgResponse(_0x344a('0x14a'),'Failure',_0x2fa2a3+_0x344a('0x14e')));}if(_0x53c182&&_[_0x344a('0x3f')](config[_0x344a('0x14f')][_0x53c182])){_0x47747c['message']=_0x344a('0x150');return _0x197941(msgResponse(_0x344a('0x14a'),_0x344a('0x14b'),_0x2fa2a3+_0x344a('0x151')+_0x53c182));}if(_[_0x344a('0x152')](_0x1b4fd3)){for(var _0x2e4a77=0x0;_0x2e4a77<_0x1b4fd3[_0x344a('0x9f')];_0x2e4a77+=0x1){_0x285d41[_0x344a('0x132')](ami[_0x344a('0xb7')]({'action':_0x344a('0x153'),'command':util[_0x344a('0x80')](_0x344a('0x154'),_0x1b4fd3[_0x2e4a77][_0x344a('0x155')],!_[_0x344a('0x3f')](config[_0x344a('0x14f')][_0x53c182])?_0x53c182:'')})[_0x344a('0xc0')](function(_0x206035){return _0x206035['content']['indexOf'](_0x344a('0x156'))>=0x0;})[_0x344a('0xba')](myreject(_0x197941)));}}else{_0x285d41[_0x344a('0x132')](ami[_0x344a('0xb7')]({'action':_0x344a('0x153'),'command':util[_0x344a('0x80')]('iftime\x20%s,%s',_0x1b4fd3,!_[_0x344a('0x3f')](config[_0x344a('0x14f')][_0x53c182])?_0x53c182:'')})[_0x344a('0xc0')](function(_0x50be52){return _0x50be52[_0x344a('0x157')][_0x344a('0x158')]('true')>=0x0;})[_0x344a('0xba')](myreject(_0x197941)));}BPromise['all'](_0x285d41)[_0x344a('0xc0')](function(_0x11e826){var _0x1735a7=_[_0x344a('0x159')](_0x11e826);if(_0x1735a7){return _0x592906(_0x1735a7);}else{_0x47747c[_0x344a('0x41')]=_0x7b7c5?'GLOBAL_INTERVAL_IS_OVERTIME':_0x344a('0x15a');return _0x197941(msgResponse(_0x344a('0x15b'),'Failure',_0x344a('0x15c')+_0x7b7c5+'\x20'+_0x2fa2a3+_0x344a('0x15d')+util[_0x344a('0x9d')](_0x1b4fd3,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x53c182));}})[_0x344a('0xba')](function(_0xbe4551){return _0x197941(msgResponse(_0x344a('0x14a'),'Failure',JSON['stringify'](_0xbe4551)));});});};Dialer[_0x344a('0xb2')][_0x344a('0x15e')]=function(_0x4bb68a){var _0x27d0fe=this;return function(){switch(_0x4bb68a['dialMethod']){case'progressive':freeVariablesPredictive(_0x4bb68a);_0x27d0fe[_0x344a('0x15f')](_0x4bb68a,0x1);break;case'power':freeVariablesPredictive(_0x4bb68a);_0x27d0fe['handlePower'](_0x4bb68a,_0x4bb68a[_0x344a('0x160')]);break;case'predictive':_0x27d0fe[_0x344a('0x161')](_0x4bb68a);break;case'booked':freeVariablesPredictive(_0x4bb68a);_0x27d0fe[_0x344a('0x15f')](_0x4bb68a,0x1);break;default:freeVariablesPredictive(_0x4bb68a);logger[_0x344a('0x9c')](_0x344a('0x162'),_0x4bb68a[_0x344a('0x43')],_0x344a('0x163'));}};};Dialer[_0x344a('0xb2')][_0x344a('0x164')]=function(_0xaf51f){var _0x2719e3=this;return function(){_0x2719e3[_0x344a('0x165')](_0xaf51f);};};Dialer[_0x344a('0xb2')]['syncQueueSummary']=function(_0x5795ba){var _0x4ef121=this;if(isNotPreview(_0x5795ba[_0x344a('0x5e')])){if(isVoiceQueueOutbound(_0x5795ba[_0x344a('0x4f')])&&isActive(_0x5795ba[_0x344a('0x5d')])){_0x5795ba[_0x344a('0xa9')]=!![];BPromise['resolve']()[_0x344a('0xc0')](checkIsLoggedIn(_0x5795ba,_0x5795ba[_0x344a('0x53')]))[_0x344a('0xc0')](checkIsActive(_0x5795ba,_0x5795ba[_0x344a('0x5d')]))[_0x344a('0xc0')](checkInterval(_0x5795ba))[_0x344a('0xc0')](_0x4ef121['checkIsTrunkReachable'](_0x5795ba))[_0x344a('0xc0')](_0x4ef121[_0x344a('0x147')](_0x5795ba[_0x344a('0x166')],_0x5795ba[_0x344a('0x167')],_0x5795ba['name'],_0x5795ba))[_0x344a('0xc0')](_0x4ef121[_0x344a('0x148')](_0x5795ba[_0x344a('0x45')],_0x5795ba[_0x344a('0x167')],_0x5795ba[_0x344a('0x43')],_0x5795ba))[_0x344a('0xc0')](_0x4ef121[_0x344a('0x15e')](_0x5795ba))[_0x344a('0xba')](loggerCatchQueueSummary(_0x344a('0x168'),_0x5795ba));}else{notSendMessagesQueue(_0x5795ba);}}else{freeVariablesPredictive(_0x5795ba);}};Dialer[_0x344a('0xb2')][_0x344a('0x143')]=function(){var _0x30dc07=this;var _0x470ed8;for(var _0x1d4a84 in this[_0x344a('0x1f')]){if(typeof this['campaigns'][_0x1d4a84]!==_0x344a('0xa0')){_0x470ed8=this[_0x344a('0x1f')][_0x1d4a84];if(isCampaignIvr(_0x470ed8[_0x344a('0x4f')])&&isActive(_0x470ed8['active'])){_0x470ed8['sendMessageOneNotActive']=!![];BPromise[_0x344a('0xc2')]()['then'](checkIsActive(_0x470ed8,_0x470ed8[_0x344a('0x7c')]))['then'](checkInterval(_0x470ed8))[_0x344a('0xc0')](_0x30dc07[_0x344a('0x144')](_0x470ed8))[_0x344a('0xc0')](_0x30dc07[_0x344a('0x147')](_0x470ed8['dialGlobalInterval'],_0x470ed8[_0x344a('0x167')],_0x470ed8[_0x344a('0x43')],_0x470ed8))[_0x344a('0xc0')](_0x30dc07[_0x344a('0x148')](_0x470ed8[_0x344a('0x45')],_0x470ed8[_0x344a('0x167')],_0x470ed8[_0x344a('0x43')],_0x470ed8))[_0x344a('0xc0')](_0x30dc07[_0x344a('0x164')](_0x470ed8))[_0x344a('0xba')](loggerCatchQueueSummary('[syncCampaigns]',_0x470ed8));}else{notSendMessagesCampaign(_0x470ed8);}}}};function getCallerIdRandom(_0x261397,_0x9cb282){var _0x342eaa;var _0x4c4e82;var _0x483da7;if(_0x9cb282<=0x0){_0x9cb282=0x1;}_0x342eaa=new RegExp('\x5cw{0,'+_0x9cb282+'}$');_0x4c4e82=Math[_0x344a('0x169')](0xa,_0x9cb282-0x1);_0x483da7=Math[_0x344a('0x169')](0xa,_0x9cb282)-0x1;return util[_0x344a('0x80')]('%s',_[_0x344a('0x16a')](_0x261397,_0x342eaa,_['random'](_0x4c4e82,_0x483da7)));}function extractCalleridName(_0x1da7b2){var _0x12433f=_0x1da7b2[_0x344a('0x16b')](/"(.*?)"/);return _0x12433f?_0x12433f[0x1]:_0x1da7b2;}function extractCalleridNumber(_0x3f01d8){var _0x4bf8a3=_0x3f01d8[_0x344a('0x16b')](/<(.*?)>/);return _0x4bf8a3?_0x4bf8a3[0x1]:_0x3f01d8;}Dialer['prototype'][_0x344a('0x16c')]=function(_0x3dc3db,_0xeaff69){var _0x48491b=this;var _0x2fcd94=uuid['v4']();this[_0x344a('0x24')][_0x2fcd94]=new Action(_0x3dc3db,_0xeaff69,_0x2fcd94);return new BPromise(function(_0x43e1e1,_0x1a6cd5){if(_[_0x344a('0x3f')](_0x3dc3db)&&typeof _0x3dc3db!==_0x344a('0x16d')){return _0x1a6cd5(msgResponse(_0x344a('0x16e'),_0x344a('0x14b'),_0x344a('0x16f')));}if(_['isUndefined'](_0xeaff69[_0x344a('0x170')][_0x344a('0x171')])||_0xeaff69['Contact'][_0x344a('0x171')]===null){return _0x1a6cd5(msgResponse(_0x344a('0x16e'),_0x344a('0x14b'),_0x344a('0x172')));}var _0x24635f={'XMD-CALLERID':_0x48491b[_0x344a('0x24')][_0x2fcd94][_0x344a('0x173')](),'XMD-AGI':_0x3dc3db[_0x344a('0x110')]?util[_0x344a('0x80')](_0x344a('0x174'),ipAgi,_0x3dc3db[_0x344a('0x110')]):_0x344a('0x175'),'XMD-AGIAFTER':_0x3dc3db[_0x344a('0x123')]?util[_0x344a('0x80')](_0x344a('0x174'),ipAgi,_0x3dc3db[_0x344a('0x123')]):_0x344a('0x175'),'XMD-QUEUE':_0x3dc3db[_0x344a('0x4f')]===_0x344a('0x50')?util[_0x344a('0x80')]('\x22%s,%s%s,,,%s\x22',_0x3dc3db['name'],_0x3dc3db[_0x344a('0x176')]||'',_0x3dc3db['dialAgiAfterHangupAgent']?'c':'',_0x3dc3db['dialQueueTimeout']||0x3):_0x344a('0x175'),'XMD-CONTACTID':_0xeaff69[_0x344a('0xd8')],'XMD-CDRTYPE':_0x344a('0x9'),'CALLERID(all)':_0x48491b[_0x344a('0x24')][_0x2fcd94][_0x344a('0x173')](),'XMD-AMD':_0x3dc3db[_0x344a('0xe9')]?'ACTIVE':'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3dc3db[_0x344a('0xe9')]){_0x24635f[_0x344a('0x177')]=_0x3dc3db[_0x344a('0x178')]||0x9c4;_0x24635f[_0x344a('0x179')]=_0x3dc3db[_0x344a('0x17a')]||0x5dc;_0x24635f['XMD-AMDAFTERGREETINGSILENCE']=_0x3dc3db['dialAMDAfterGreetingSilence']||0x320;_0x24635f['XMD-AMDTOTALANALYSISTIME']=_0x3dc3db[_0x344a('0x17b')]||0x1388;_0x24635f[_0x344a('0x17c')]=_0x3dc3db[_0x344a('0x17d')]||0x64;_0x24635f[_0x344a('0x17e')]=_0x3dc3db['dialAMDBetweenWordsSilence']||0x32;_0x24635f[_0x344a('0x17f')]=_0x3dc3db[_0x344a('0x180')]||0x3;_0x24635f[_0x344a('0x181')]=_0x3dc3db[_0x344a('0x182')]||0x100;_0x24635f['XMD-AMDMAXIMUMWORDLENGTH']=_0x3dc3db[_0x344a('0x183')]||0x1388;}if(_0x3dc3db[_0x344a('0x4f')]===_0x344a('0x50')){_0x24635f[_0x344a('0x184')]=_0xeaff69['VoiceQueueId'];}else{_0x24635f[_0x344a('0x185')]=_0xeaff69[_0x344a('0xdb')];}for(var _0x2b731b in _0xeaff69[_0x344a('0x170')]){if(typeof _0xeaff69[_0x344a('0x170')][_0x2b731b]!==_0x344a('0xa0')){if(isNotNull(_0xeaff69[_0x344a('0x170')][_0x2b731b])&&_0x2b731b!=='id'&&_0x2b731b!==_0x344a('0x186')&&_0x2b731b!==_0x344a('0x187')&&_0x2b731b!==_0x344a('0x188')){_0x24635f[util[_0x344a('0x80')]('%s%s',_0x344a('0x189'),_[_0x344a('0x18a')](_0x2b731b))]=_0xeaff69[_0x344a('0x170')][_0x2b731b];}}}var _0xcdc96f=_0x48491b['isTrunkReachable'](_0x3dc3db[_0x344a('0x7b')])?getCallerId(_0x3dc3db[_0x344a('0x7b')][_0x344a('0x7d')],_0x3dc3db[_0x344a('0x18b')],_0x3dc3db[_0x344a('0x18c')]>0x0?getCallerIdRandom(_0x3dc3db['dialOriginateCallerIdNumber'],_0x3dc3db['dialRandomLastDigitCallerIdNumber']):_0x3dc3db[_0x344a('0x5f')]):getCallerId(_[_0x344a('0xb6')](_0x3dc3db['TrunkBackup'])?_0x3dc3db[_0x344a('0x7b')]['callerid']:_0x3dc3db[_0x344a('0x18d')][_0x344a('0x7d')],_0x3dc3db[_0x344a('0x18b')],_0x3dc3db['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3dc3db[_0x344a('0x5f')],_0x3dc3db['dialRandomLastDigitCallerIdNumber']):_0x3dc3db[_0x344a('0x5f')]);if(_0xcdc96f){_0x24635f[_0x344a('0x18e')]=_0x48491b[_0x344a('0x24')][_0x2fcd94][_0x344a('0x18f')]=extractCalleridName(_0xcdc96f);_0x24635f[_0x344a('0x190')]=_0x48491b['actions'][_0x2fcd94][_0x344a('0x191')]=extractCalleridNumber(_0xcdc96f);}return ami[_0x344a('0xb7')]({'actionid':_0x2fcd94,'action':_0x344a('0x16e'),'channel':_0x48491b[_0x344a('0xde')](_0x3dc3db[_0x344a('0x7b')])?util[_0x344a('0x80')](_0x344a('0x192'),_0x3dc3db[_0x344a('0x7b')]['name'],isNotNull(_0x3dc3db['dialPrefix'])?_0x3dc3db[_0x344a('0x61')]['trim']()||'':'',_0x3dc3db[_0x344a('0x193')]>0x0?_0xeaff69['Contact'][_0x344a('0x171')][_0x344a('0x194')](_0x3dc3db[_0x344a('0x193')]):_0xeaff69['Contact']['phone']):util['format']('SIP/%s/%s%s',_[_0x344a('0xb6')](_0x3dc3db['TrunkBackup'])?_0x3dc3db[_0x344a('0x7b')]['name']:_0x3dc3db[_0x344a('0x18d')][_0x344a('0x43')],isNotNull(_0x3dc3db[_0x344a('0x61')])?_0x3dc3db['dialPrefix']['trim']()||'':'',_0x3dc3db[_0x344a('0x193')]>0x0?_0xeaff69[_0x344a('0x170')]['phone'][_0x344a('0x194')](_0x3dc3db[_0x344a('0x193')]):_0xeaff69['Contact'][_0x344a('0x171')]),'callerid':_0xcdc96f,'Exten':_0x344a('0xe8'),'Context':_0x344a('0x195'),'Priority':'1','variable':_0x24635f,'timeout':(_0x3dc3db[_0x344a('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2fcd94})[_0x344a('0xc0')](function(_0x25edf4){return _0x43e1e1(_0x25edf4);})['catch'](function(_0x310490){_0x3dc3db[_0x344a('0x6b')]+=0x1;var _0x53481f=new History(_0x48491b[_0x344a('0x24')][_0x2fcd94]);logger[_0x344a('0x9c')](util[_0x344a('0x80')](_0x344a('0x196'),JSON[_0x344a('0x4a')](_0x310490)));_0x53481f['state']=0xe;_0x53481f[_0x344a('0xb0')]=_0x344a('0x197');_0x53481f[_0x344a('0x127')]=moment()[_0x344a('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x53481f[_0x344a('0xb1')]=_0x53481f['starttime'];_0x48491b[_0x344a('0xd3')](_0x53481f)['catch'](loggerCatch(_0x344a('0x198')));_0x48491b[_0x344a('0xd1')](_0x53481f)['catch'](loggerCatch('[originate][error]'))['finally'](function(){delete _0x48491b['actions'][_0x2fcd94];return _0x1a6cd5(msgResponse(_0x344a('0x16e'),_0x344a('0x49'),_0x344a('0x199')));});});});};Dialer['prototype'][_0x344a('0x32')]=function(_0x393932){var _0x50d1ff=this[_0x344a('0x24')][_0x393932['actionid']];if(_0x50d1ff){delete this['actions'][_0x393932[_0x344a('0x12e')]];_0x50d1ff[_0x344a('0x11e')]=moment()['format'](_0x344a('0x105'));var _0x54ee1a=_0x50d1ff['type']==='ivr'?this[_0x344a('0x1f')][_0x50d1ff[_0x344a('0xbd')]]:this[_0x344a('0x1e')][_0x50d1ff[_0x344a('0x19a')]()];if(!this[_0x344a('0xdd')](_0x393932[_0x344a('0x19b')])){this[_0x344a('0xbc')](_0x54ee1a);return this[_0x344a('0x19c')](_0x50d1ff,_0x54ee1a,_0x393932)[_0x344a('0xba')](loggerCatch(_0x344a('0x19d')));}this[_0x344a('0x26')][_0x393932['uniqueid']]=_0x50d1ff;}};Dialer[_0x344a('0xb2')][_0x344a('0x19e')]=function(_0x2a0f1c,_0x474561,_0xa74330){var _0x5b591c=new History(_0x474561);if(_0x5b591c[_0x344a('0xf9')]+_0x5b591c[_0x344a('0xfa')]+_0x5b591c[_0x344a('0xfb')]+_0x5b591c[_0x344a('0x10a')]+_0x5b591c[_0x344a('0xfc')]+_0x5b591c['countabandonedretry']+_0x5b591c['countmachineretry']+_0x5b591c[_0x344a('0xfe')]>=_0xa74330[_0x344a('0xff')]-0x1){return!![];}switch(_0x2a0f1c){case 0x3:if(_0x5b591c['countnoanswerretry']>=_0xa74330[_0x344a('0x19f')]-0x1){return!![];}this[_0x344a('0xc8')]({'active':![],'countnoanswerretry':_0x5b591c[_0x344a('0xfb')]+=0x1,'scheduledat':moment()[_0x344a('0x102')](_0xa74330['dialNoAnswerRetryFrequency'],_0x344a('0x104'))[_0x344a('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c[_0x344a('0x106')],'VoiceQueueId':_0x5b591c['VoiceQueueId']||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x5b591c[_0x344a('0xf9')]>=_0xa74330['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x5b591c[_0x344a('0xf9')]+=0x1,'scheduledat':moment()[_0x344a('0x102')](_0xa74330[_0x344a('0x1a0')],_0x344a('0x104'))[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c['ListId'],'VoiceQueueId':_0x5b591c[_0x344a('0xda')]||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x1a1')));break;case 0x8:if(_0x5b591c[_0x344a('0xfa')]>=_0xa74330[_0x344a('0x1a2')]-0x1){return!![];}this[_0x344a('0xc8')]({'active':![],'countcongestionretry':_0x5b591c[_0x344a('0xfa')]+=0x1,'scheduledat':moment()['add'](_0xa74330['dialCongestionRetryFrequency'],_0x344a('0x104'))[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c[_0x344a('0x106')],'VoiceQueueId':_0x5b591c['VoiceQueueId']||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x1a3')));break;case 0x0:if(_0x5b591c['countnosuchnumberretry']>=_0xa74330['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x344a('0xc8')]({'active':![],'countnosuchnumberretry':_0x5b591c[_0x344a('0x10a')]+=0x1,'scheduledat':moment()[_0x344a('0x102')](_0xa74330['dialNoSuchNumberRetryFrequency'],_0x344a('0x104'))[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c['ListId'],'VoiceQueueId':_0x5b591c[_0x344a('0xda')]||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x1a4')));}break;case 0xa:if(_0x5b591c[_0x344a('0xfc')]>=_0xa74330[_0x344a('0x124')]-0x1){return!![];}this[_0x344a('0xc8')]({'active':![],'countdropretry':_0x5b591c[_0x344a('0xfc')]+=0x1,'scheduledat':moment()['add'](_0xa74330[_0x344a('0x125')],'minutes')['format'](_0x344a('0x105')),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c[_0x344a('0x106')],'VoiceQueueId':_0x5b591c[_0x344a('0xda')]||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})['catch'](loggerCatch(_0x344a('0x126')));break;case 0xb:if(_0x5b591c['countabandonedretry']>=_0xa74330[_0x344a('0x1a5')]-0x1){return!![];}this[_0x344a('0xc8')]({'active':![],'countabandonedretry':_0x5b591c[_0x344a('0xfd')]+=0x1,'scheduledat':moment()[_0x344a('0x102')](_0xa74330['dialAbandonedRetryFrequency'],_0x344a('0x104'))[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c[_0x344a('0x106')],'VoiceQueueId':_0x5b591c[_0x344a('0xda')]||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})['catch'](loggerCatch(_0x344a('0x1a6')));break;case 0x13:if(_0x5b591c['countmachineretry']>=_0xa74330['dialMachineMaxRetry']-0x1){return!![];}this[_0x344a('0xc8')]({'active':![],'countmachineretry':_0x5b591c[_0x344a('0xf5')]+=0x1,'scheduledat':moment()[_0x344a('0x102')](_0xa74330[_0x344a('0x103')],'minutes')[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x5b591c[_0x344a('0xd8')],'ListId':_0x5b591c[_0x344a('0x106')],'VoiceQueueId':_0x5b591c['VoiceQueueId']||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5b591c[_0x344a('0xfe')]>=_0xa74330['dialAgentRejectMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x5b591c[_0x344a('0xfe')]+=0x1,'scheduledat':moment()['add'](_0xa74330[_0x344a('0x1a7')],_0x344a('0x104'))[_0x344a('0x80')](_0x344a('0x105')),'ContactId':_0x5b591c['ContactId'],'ListId':_0x5b591c[_0x344a('0x106')],'VoiceQueueId':_0x5b591c[_0x344a('0xda')]||undefined,'CampaignId':_0x5b591c[_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x1a8')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x4f38da,_0x258e9b,_0x1198a9){var _0x18b825=this;var _0x5af0ed=new History(_0x4f38da);return new BPromise(function(_0x579bae,_0x463d26){if(_[_0x344a('0x3f')](_0x258e9b)&&typeof _0x258e9b!==_0x344a('0x16d')){return _0x463d26(msgResponse(_0x344a('0x1a9'),_0x344a('0x14b'),_0x344a('0x1aa')));}if(_[_0x344a('0x3f')](_0x1198a9)&&typeof _0x1198a9!==_0x344a('0x16d')){return _0x463d26(msgResponse('[callProgressDetecting]',_0x344a('0x14b'),_0x344a('0x1ab')));}switch(_0x1198a9['reason']){case'0':_0x258e9b['outboundNoSuchCallsDay']+=0x1;_0x5af0ed[_0x344a('0xaf')]=0x0;_0x5af0ed[_0x344a('0xb0')]=_0x344a('0x1ac');_0x5af0ed[_0x344a('0x10a')]+=0x1;_0x5af0ed[_0x344a('0xf6')]+=0x1;ami[_0x344a('0x4e')](_0x344a('0x1ad'),ut[_0x344a('0xf0')](_0x4f38da,_0x344a('0x1ae')));_0x18b825['createHistory'](_0x5af0ed)[_0x344a('0xba')](loggerCatch(_0x344a('0xf8')));if(_0x18b825['checkRetriveMax'](0x0,_0x4f38da,_0x258e9b)){if(_0x5af0ed[_0x344a('0x10a')]>=_0x258e9b[_0x344a('0x1af')]){_0x18b825['createStateFinal'](_0x5af0ed,_0x579bae,_0x463d26,'reason\x200\x20no\x20such\x20number....');}else{_0x18b825['stateGlobal'](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1b0'));}}break;case'3':_0x258e9b[_0x344a('0x69')]+=0x1;_0x5af0ed[_0x344a('0xaf')]=0x3;_0x5af0ed['statedesc']='NoAnswer';_0x5af0ed[_0x344a('0xfb')]+=0x1;_0x5af0ed[_0x344a('0xf6')]+=0x1;ami['emit'](_0x344a('0x1b1'),ut[_0x344a('0xf0')](_0x4f38da,_0x344a('0x1b2')));_0x18b825['createHistory'](_0x5af0ed)[_0x344a('0xba')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x18b825['checkRetriveMax'](0x3,_0x4f38da,_0x258e9b)){if(_0x5af0ed['countnoanswerretry']>=_0x258e9b[_0x344a('0x19f')]){_0x18b825['createStateFinal'](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1b3'));}else{_0x18b825[_0x344a('0x100')](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1b3'));}}break;case'5':_0x258e9b['outboundBusyCallsDay']+=0x1;_0x5af0ed[_0x344a('0xaf')]=0x5;_0x5af0ed[_0x344a('0xb0')]='Busy';_0x5af0ed[_0x344a('0xf9')]+=0x1;_0x5af0ed['countglobal']+=0x1;ami[_0x344a('0x4e')](_0x344a('0x1b4'),ut[_0x344a('0xf0')](_0x4f38da,_0x344a('0x1b5')));_0x18b825[_0x344a('0xd3')](_0x5af0ed)[_0x344a('0xba')](loggerCatch(_0x344a('0x1b6')));if(_0x18b825[_0x344a('0x19e')](0x5,_0x4f38da,_0x258e9b)){if(_0x5af0ed['countbusyretry']>=_0x258e9b['dialBusyMaxRetry']){_0x18b825[_0x344a('0x10c')](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1b7'));}else{_0x18b825['stateGlobal'](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1b7'));}}break;case'8':_0x258e9b[_0x344a('0x65')]+=0x1;_0x5af0ed[_0x344a('0xaf')]=0x8;_0x5af0ed['statedesc']='Congestion';_0x5af0ed[_0x344a('0xfa')]+=0x1;_0x5af0ed[_0x344a('0xf6')]+=0x1;ami[_0x344a('0x4e')]('custom:agentcongestion',ut[_0x344a('0xf0')](_0x4f38da,_0x344a('0x1b8')));_0x18b825['createHistory'](_0x5af0ed)['catch'](loggerCatch(_0x344a('0x1b9')));if(_0x18b825[_0x344a('0x19e')](0x8,_0x4f38da,_0x258e9b)){if(_0x5af0ed[_0x344a('0xfa')]>=_0x258e9b[_0x344a('0x1a2')]){_0x18b825[_0x344a('0x10c')](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1ba'));}else{_0x18b825[_0x344a('0x100')](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1ba'));}}break;case'11':_0x258e9b[_0x344a('0x1bb')]+=0x1;_0x5af0ed[_0x344a('0xaf')]=0xb;_0x5af0ed[_0x344a('0xb0')]=_0x344a('0x12c');_0x5af0ed['countabandonedretry']+=0x1;_0x5af0ed[_0x344a('0xf6')]+=0x1;_0x18b825[_0x344a('0xd3')](_0x5af0ed)[_0x344a('0xba')](loggerCatch(_0x344a('0x12d')));if(_0x18b825['checkRetriveMax'](0xb,_0x4f38da,_0x258e9b)){if(_0x5af0ed['countabandonedretry']>=_0x258e9b[_0x344a('0x1a5')]){_0x18b825[_0x344a('0x10c')](_0x5af0ed,_0x579bae,_0x463d26,'reason\x2011\x20abandoned');}else{_0x18b825['stateGlobal'](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1bc'));}}break;case'20':_0x258e9b[_0x344a('0x6d')]+=0x1;_0x5af0ed[_0x344a('0xaf')]=0x14;_0x5af0ed['statedesc']=_0x344a('0x1bd');_0x5af0ed[_0x344a('0xfe')]+=0x1;_0x5af0ed[_0x344a('0xf6')]+=0x1;ami[_0x344a('0x4e')](_0x344a('0x1be'),ut[_0x344a('0xf0')](_0x4f38da,'agentreject'));_0x18b825[_0x344a('0xd3')](_0x5af0ed)[_0x344a('0xba')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x18b825[_0x344a('0x19e')](0x14,_0x4f38da,_0x258e9b)){if(_0x5af0ed['countagentrejectretry']>=_0x258e9b[_0x344a('0x1bf')]){_0x18b825[_0x344a('0x10c')](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1c0'));}else{_0x18b825[_0x344a('0x100')](_0x5af0ed,_0x579bae,_0x463d26,_0x344a('0x1c0'));}}break;default:_0x258e9b[_0x344a('0x113')]+=0x1;_0x5af0ed[_0x344a('0xaf')]=0xc;_0x5af0ed['statedesc']=_0x1198a9[_0x344a('0x1c1')];_0x18b825[_0x344a('0xd3')](_0x5af0ed)[_0x344a('0xba')](loggerCatch(_0x344a('0x1c2')));if(_0x18b825[_0x344a('0x19e')](_0x1198a9[_0x344a('0x1c1')],_0x4f38da,_0x258e9b)){if(_0x5af0ed[_0x344a('0xf9')]+_0x5af0ed[_0x344a('0xfa')]+_0x5af0ed[_0x344a('0xfb')]+_0x5af0ed['countnosuchnumberretry']+_0x5af0ed[_0x344a('0xfc')]+_0x5af0ed[_0x344a('0xfd')]+_0x5af0ed[_0x344a('0xf5')]+_0x5af0ed[_0x344a('0xfe')]>=_0x258e9b[_0x344a('0xff')]){_0x18b825['stateGlobal'](_0x5af0ed,_0x579bae,_0x463d26,_0x1198a9[_0x344a('0x1c1')]);}else{_0x18b825[_0x344a('0x10c')](_0x5af0ed,_0x579bae,_0x463d26,_0x1198a9['reason']);}}}});};Dialer[_0x344a('0xb2')][_0x344a('0x100')]=function(_0x199786,_0x4185d9,_0x11cd7b,_0x2ce045){var _0x5e98db=new Final(_0x199786);_0x5e98db[_0x344a('0xaf')]=0xf;_0x5e98db[_0x344a('0xb0')]='Global';this[_0x344a('0x10c')](_0x5e98db,_0x4185d9,_0x11cd7b,_0x2ce045);};Dialer['prototype'][_0x344a('0x10c')]=function(_0x28a5c0,_0x2801a5,_0x559569,_0x3877ef){this['moveContactManagedDialer'](_0x28a5c0)[_0x344a('0xc0')](function(){return _0x2801a5(msgResponse(_0x344a('0x1a9'),'Success',_0x3877ef));})[_0x344a('0xba')](function(){return _0x559569(msgResponse('[moveContactManagedDialer][0]',_0x344a('0x14b'),'contact\x20not\x20moved'));});};Dialer[_0x344a('0xb2')]['predictive']=function(_0x572bf8){var _0x3d5fce=_0x572bf8['dialPredictiveOptimizationPercentage']/0x64;var _0x16f446=_0x572bf8[_0x344a('0x68')]/(_0x572bf8['outboundDropCallsDayTimeout']+_0x572bf8['outboundAnswerCallsDay']);var _0x5a3556=Math[_0x344a('0x1c3')](_0x572bf8[_0x344a('0x75')]*(_0x572bf8['predictiveIntervalMaxThreshold']/0x64));var _0x5b4afc=Math['round'](_0x572bf8[_0x344a('0x75')]*(_0x572bf8[_0x344a('0x1c4')]/0x64));var _0x11197d=_0x572bf8[_0x344a('0x52')]+_0x572bf8[_0x344a('0x57')];var _0x125cff=Math[_0x344a('0x1c5')](_0x572bf8[_0x344a('0x91')]*_0x572bf8[_0x344a('0x79')]*_0x572bf8[_0x344a('0x73')]*_0x572bf8[_0x344a('0x1c6')]);if(_[_0x344a('0x3f')](_0x572bf8['startProgressive'])){if(!_[_0x344a('0x3f')](_0x572bf8[_0x344a('0x27')])){_0x572bf8[_0x344a('0x27')]=undefined;loggerPredictive[_0x344a('0x9c')]('[startMethodPredictive][StartProgressive]',_0x344a('0x1c7'));}if(!_[_0x344a('0x3f')](_0x572bf8[_0x344a('0x97')])){loggerPredictive[_0x344a('0x9c')](_0x344a('0x1c8'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x572bf8[_0x344a('0x97')]);_0x572bf8['handlePredictive']=undefined;}_0x572bf8[_0x344a('0x28')]=moment()[_0x344a('0x80')](_0x344a('0x105'));loggerPredictive[_0x344a('0x83')](_0x572bf8[_0x344a('0x43')],'collection\x20data\x20in\x20progressive\x20at',_0x572bf8[_0x344a('0x28')]);this[_0x344a('0x15f')](_0x572bf8,0x1);}else if(ifInterval(_0x572bf8[_0x344a('0x1c9')],_0x572bf8['startProgressive'])){this['handlePower'](_0x572bf8,0x1);loggerPredictiveCalls[_0x344a('0x83')](_0x344a('0x1ca'),_0x572bf8['startProgressive'],_0x572bf8[_0x344a('0x43')]);_0x572bf8['erlangCalls']=0x0;_0x572bf8[_0x344a('0x72')]=0x0;}else if(_0x3d5fce<_0x16f446&&_0x572bf8['dialPredictiveOptimization']===_0x344a('0x1cb')){freeVariablesPredictive(_0x572bf8);loggerPredictive[_0x344a('0x83')](_0x344a('0x1cc'),_0x344a('0x1cd'),_0x16f446,'startProgressive',_0x572bf8[_0x344a('0x43')]);}else if(_0x125cff<_0x572bf8[_0x344a('0x72')]&&_0x572bf8[_0x344a('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x572bf8);loggerPredictive[_0x344a('0x83')](_0x344a('0x1cf'),'Max\x20Drop\x20',_0x125cff,_0x344a('0x1d0'),_0x572bf8[_0x344a('0x72')],_0x344a('0x28'),_0x572bf8[_0x344a('0x43')]);}else if(!ifInterval(_0x572bf8['dialPredictiveInterval'],_0x572bf8['startProgressive'])&&_[_0x344a('0x3f')](_0x572bf8[_0x344a('0x27')])&&!_['isUndefined'](_0x572bf8['startProgressive'])){_0x572bf8[_0x344a('0x27')]=moment()[_0x344a('0x80')](_0x344a('0x105'));loggerPredictive[_0x344a('0x83')](_0x572bf8['name'],_0x344a('0x1d1'),_0x572bf8['startPredictive']);this[_0x344a('0xc6')](_0x572bf8[_0x344a('0x1c9')])['then'](this[_0x344a('0x1d2')](_0x572bf8))[_0x344a('0xc0')](mergeDataErlangB(_0x572bf8))[_0x344a('0xc0')](this[_0x344a('0x1d3')](_0x572bf8))[_0x344a('0xba')](loggerCatchPredictive(_0x344a('0x1d4'),_0x572bf8));}else if(!ifInterval(_0x572bf8[_0x344a('0x1c9')],_0x572bf8['startPredictive'])){_0x572bf8[_0x344a('0x72')]=0x0;_0x572bf8[_0x344a('0x27')]=moment()[_0x344a('0x80')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x572bf8[_0x344a('0x43')],_0x344a('0x1d5'),_0x572bf8[_0x344a('0x27')]);clearInterval(_0x572bf8[_0x344a('0x97')]);_0x572bf8[_0x344a('0x97')]=undefined;this[_0x344a('0xc6')](_0x572bf8[_0x344a('0x1c9')])['then'](this[_0x344a('0x1d2')](_0x572bf8))['then'](mergeDataErlangB(_0x572bf8))[_0x344a('0xc0')](this['startMethodPredictive'](_0x572bf8))[_0x344a('0xba')](loggerCatchPredictive(_0x344a('0x1d6'),_0x572bf8));}else if(_0x572bf8['predictiveIntervalAvailable']&&_0x11197d<_0x572bf8['predictiveIntervalAvailable']-_0x5b4afc){freeVariablesPredictive(_0x572bf8);loggerPredictive['info'](_0x572bf8[_0x344a('0x43')],_0x344a('0x1d7'),_0x11197d,_0x344a('0x1d8'),_0x572bf8[_0x344a('0x75')],'-',_0x5b4afc,'=',_0x572bf8[_0x344a('0x75')]-_0x5b4afc,')');}else if(_0x572bf8[_0x344a('0x75')]&&_0x11197d>_0x572bf8[_0x344a('0x75')]+_0x5a3556){freeVariablesPredictive(_0x572bf8);loggerPredictive['info'](_0x572bf8[_0x344a('0x43')],_0x344a('0x1d7'),_0x11197d,_0x344a('0x1d9'),_0x572bf8[_0x344a('0x75')],'+',_0x5a3556,'=',_0x572bf8[_0x344a('0x75')]+_0x5a3556,')');}};Dialer['prototype'][_0x344a('0x1d2')]=function(_0x1f4ca8){var _0x2bd033=this;return function(_0x21a130){return new BPromise(function(_0x3f06cf,_0x2488dc){_[_0x344a('0x94')](_0x1f4ca8,_0x21a130[0x0]);if(checkGetDataPredictive(_0x21a130[0x0])){var _0x212c03=_0x1f4ca8[_0x344a('0x75')]=_0x1f4ca8[_0x344a('0x57')]+_0x1f4ca8[_0x344a('0x52')];var _0x39900b=_0x1f4ca8[_0x344a('0x1c9')]*0x3c;var _0x21b5b3=_0x21a130[0x0][_0x344a('0x8a')]+_0x21a130[0x0][_0x344a('0x6f')];var _0x1bf450=(_0x21a130[0x0]['predictiveIntervalAnsweredCalls']+_0x21a130[0x0][_0x344a('0x71')]+_0x21a130[0x0][_0x344a('0x70')])/_0x21a130[0x0][_0x344a('0x76')];_0x1f4ca8[_0x344a('0x73')]=_0x1bf450>0x0?_0x1bf450:0x1;switch(_0x1f4ca8['dialPredictiveOptimization']){case _0x344a('0x1cb'):var _0xb9cc5a=_0x1f4ca8['dialPredictiveOptimizationPercentage']/0x64;return _0x2bd033[_0x344a('0x1da')](_0x212c03,_0x39900b,_0x21b5b3,_0x1bf450,_0xb9cc5a)[_0x344a('0xc0')](function(_0x4e3052){return _0x3f06cf(_0x4e3052);});case'agentBusyFactor':var _0x85052a=_0x1f4ca8[_0x344a('0x1db')]/0x64;return _0x2bd033[_0x344a('0x1dc')](_0x212c03,_0x39900b,_0x21b5b3,_0x1bf450,_0x85052a)[_0x344a('0xc0')](function(_0x4b094a){return _0x3f06cf(_0x4b094a);});default:return _0x2488dc(msgResponse(_0x344a('0x1dd'),_0x344a('0x14b'),'Unknown\x20Predictive'));}}else{return _0x2488dc(msgResponse(_0x344a('0x1dd'),_0x344a('0x14b'),_0x344a('0x1de')));}});};};Dialer[_0x344a('0xb2')][_0x344a('0x1df')]=function(_0x53fd6c){var _0x270c3f=this;return function(_0x45e3d9){return new BPromise(function(_0x3bc95d,_0x5e5642){_['merge'](_0x53fd6c,_0x45e3d9[0x0]);if(checkGetDataPredictive(_0x45e3d9[0x0])){loggerPredictive['info'](JSON[_0x344a('0x4a')](_0x45e3d9[0x0]));if(_0x53fd6c[_0x344a('0x1ce')]===_0x344a('0x1cb')){return _0x270c3f[_0x344a('0xcf')](_0x53fd6c['id'])[_0x344a('0xc0')](function(_0x531300){var _0x5bf811=_0x53fd6c[_0x344a('0x53')]-_0x531300[0x0][_0x344a('0x1e0')];var _0x2bbec7=_0x53fd6c[_0x344a('0x1c9')]*0x3c;var _0x199d0a=_0x45e3d9[0x0]['predictiveIntervalAvgTalktime']+_0x45e3d9[0x0]['predictiveIntervalAvgHoldtime'];var _0x336349=(_0x45e3d9[0x0][_0x344a('0x6e')]+_0x45e3d9[0x0][_0x344a('0x71')]+_0x45e3d9[0x0][_0x344a('0x70')])/_0x45e3d9[0x0][_0x344a('0x76')];var _0x18a78a=_0x53fd6c[_0x344a('0x1db')]/0x64;_0x53fd6c[_0x344a('0x74')]=_0x531300[0x0]['outboundQueuePauses']||0x0;_0x53fd6c['predictiveIntervalHitRate']=_0x336349>0x0?_0x336349:0x1;return _0x270c3f[_0x344a('0x1da')](_0x5bf811,_0x2bbec7,_0x199d0a,_0x336349,_0x18a78a);})[_0x344a('0xc0')](function(_0x1a4d6d){return _0x3bc95d(_0x1a4d6d);})[_0x344a('0xba')](function(_0x128695){return _0x5e5642(msgResponse(_0x344a('0x1e1'),_0x344a('0x14b'),JSON[_0x344a('0x4a')](_0x128695)));});}if(_0x53fd6c['dialPredictiveOptimization']===_0x344a('0x1e2')){return _0x270c3f['getVoiceQueueRtPauses'](_0x53fd6c['id'])[_0x344a('0xc0')](function(_0x48ab01){var _0x3448df=_0x53fd6c[_0x344a('0x53')]-_0x48ab01[0x0][_0x344a('0x1e0')];var _0x312e7e=_0x53fd6c['dialPredictiveInterval']*0x3c;var _0xff9c9b=_0x45e3d9[0x0][_0x344a('0x8a')]+_0x45e3d9[0x0]['predictiveIntervalAvgHoldtime'];var _0xbfc8e6=(_0x45e3d9[0x0][_0x344a('0x6e')]+_0x45e3d9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x45e3d9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x45e3d9[0x0][_0x344a('0x76')];var _0x188812=_0x53fd6c[_0x344a('0x1db')]/0x64;_0x53fd6c['predictiveIntervalPauses']=_0x48ab01[0x0][_0x344a('0x1e0')]||0x0;_0x53fd6c[_0x344a('0x73')]=_0xbfc8e6>0x0?_0xbfc8e6:0x1;return _0x270c3f[_0x344a('0x1dc')](_0x3448df,_0x312e7e,_0xff9c9b,_0xbfc8e6,_0x188812);})['then'](function(_0x186bfb){return _0x3bc95d(_0x186bfb);})[_0x344a('0xba')](function(_0xa974fa){return _0x5e5642(msgResponse('[CatchErlangB]',_0x344a('0x14b'),JSON['stringify'](_0xa974fa)));});}}else{return _0x5e5642(msgResponse(_0x344a('0x1dd'),'Failure',_0x344a('0x1de')));}});};};Dialer[_0x344a('0xb2')][_0x344a('0x1d3')]=function(_0x346029){var _0x12b159=this;return function(){var _0x3ce531=0x0;var _0x35ee51=Math[_0x344a('0x1c5')](_0x346029['erlangCallToSecond']*0x3e8);if(_0x35ee51>0x0){_0x35ee51=_0x35ee51<0x64?0x64:_0x35ee51;loggerPredictive['info'](_0x346029[_0x344a('0x43')],_0x344a('0x1e3'),_0x35ee51,_0x344a('0x4b'));_0x346029[_0x344a('0x97')]=setInterval(function(){_0x12b159[_0x344a('0x97')](_0x346029);loggerPredictiveCalls['info'](_0x344a('0x1e4'),_0x3ce531+=0x1);},_0x35ee51);}else{loggerPredictive['info'](_0x346029[_0x344a('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x344a('0xb2')]['checkContactBlack']=function(_0xa84fc8,_0x2e051f){var _0x2804a6=this;return function(_0x2a0873){if(_[_0x344a('0x48')](_0x2a0873)){if(_['isNil'](_0x2e051f[_0x344a('0xd9')])||!_0x2e051f[_0x344a('0x1e5')]){if(_0xa84fc8[_0x344a('0x5e')]==='booked'){_0xa84fc8['queueStatusComplete']=_[_0x344a('0x3f')](_0xa84fc8[_0x344a('0x134')])?!![]:_0xa84fc8[_0x344a('0x134')];var _0x43c73d=uuid['v4']();_0x2804a6[_0x344a('0x24')][_0x43c73d]=new Action(_0xa84fc8,_0x2e051f,_0x43c73d);loggerBooked[_0x344a('0x83')](_0x344a('0x1e6'),_0x43c73d,_0x344a('0x1e7'),JSON[_0x344a('0x4a')](_0xa84fc8[_0x344a('0x134')]),_0x344a('0x1e8'),_0xa84fc8[_0x344a('0x43')]);if(_0xa84fc8[_0x344a('0x134')]){_0xa84fc8[_0x344a('0x134')]=![];_0x2804a6[_0x344a('0x2a')][_0x2804a6['actions'][_0x43c73d]['queue']]=[];ami['Action']({'actionid':_0x43c73d,'action':_0x344a('0x1e9'),'queue':_0xa84fc8[_0x344a('0x43')]})[_0x344a('0xba')](function(){_0x2804a6[_0x344a('0xbc')](_0xa84fc8);_0x2804a6[_0x344a('0xc8')]({'active':![],'ContactId':_0x2804a6[_0x344a('0x24')][_0x43c73d]['ContactId'],'ListId':_0x2804a6['actions'][_0x43c73d][_0x344a('0x106')],'VoiceQueueId':_0x2804a6[_0x344a('0x24')][_0x43c73d][_0x344a('0xda')]||undefined,'CampaignId':_0x2804a6[_0x344a('0x24')][_0x43c73d][_0x344a('0xdb')]||undefined})[_0x344a('0xba')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2804a6[_0x344a('0x24')][_0x43c73d];});}else{loggerBooked[_0x344a('0x83')](_0x344a('0x1ea'),JSON[_0x344a('0x4a')](_0xa84fc8[_0x344a('0x134')]),_0x344a('0x1e8'),_0xa84fc8[_0x344a('0x43')]);_0x2804a6[_0x344a('0xbc')](_0xa84fc8);_0x2804a6[_0x344a('0xc8')]({'active':![],'ContactId':_0x2804a6['actions'][_0x43c73d]['ContactId'],'ListId':_0x2804a6[_0x344a('0x24')][_0x43c73d][_0x344a('0x106')],'VoiceQueueId':_0x2804a6[_0x344a('0x24')][_0x43c73d]['VoiceQueueId']||undefined,'CampaignId':_0x2804a6[_0x344a('0x24')][_0x43c73d][_0x344a('0xdb')]||undefined})['catch'](loggerCatch(_0x344a('0x1eb')));delete _0x2804a6['actions'][_0x43c73d];}}else{return _0x2804a6[_0x344a('0x16c')](_0xa84fc8,_0x2e051f);}}else{if(getDiff(_0x2e051f['scheduledat'])<_0xa84fc8[_0x344a('0x1ec')]*0x3c){if(_0x2e051f[_0x344a('0x1ed')]&&!_0x2e051f['Agent'][_0x344a('0x1ee')]){_0x2804a6['preview'][_0x344a('0x137')](_0x2e051f['id'])[_0x344a('0x139')](function(){_0x2804a6[_0x344a('0xbc')](_0xa84fc8);});}else{_0x2804a6[_0x344a('0xc9')]({'active':![]},_0x2e051f['id'],0x1)[_0x344a('0x139')](function(){_0x2804a6[_0x344a('0xbc')](_0xa84fc8);});}}else{_0xa84fc8[_0x344a('0x6c')]+=0x1;_0x2804a6[_0x344a('0xbc')](_0xa84fc8);if(_0xa84fc8[_0x344a('0x1ef')]){_0x2804a6[_0x344a('0xc8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2e051f[_0x344a('0xd8')],'ListId':_0x2e051f[_0x344a('0x106')],'VoiceQueueId':_0x2e051f[_0x344a('0xda')]||undefined,'CampaignId':_0x2e051f['CampaignId']||undefined})[_0x344a('0xba')](loggerCatch(_0x344a('0x1f0')));_0x2804a6[_0x344a('0xd3')](createObjHistory(_0xa84fc8,_0x2e051f,_0x344a('0x1f1'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x344a('0x1f2')));}else{_0x2804a6[_0x344a('0xe2')](createObjHistory(_0xa84fc8,_0x2e051f,_0x344a('0x1f3'),0x16,_0x344a('0x1f4')),_0x344a('0x1f5'),_0x344a('0x1f6'));}}}}else{_0xa84fc8[_0x344a('0x63')]+=0x1;_0x2804a6[_0x344a('0xe2')](createObjHistory(_0xa84fc8,_0x2e051f,_0x344a('0x1f7'),0xd,_0x344a('0x1f8')),'[Originate][historyBlacklist]',_0x344a('0x1f9'));throw _0x344a('0x1fa');}};};Dialer['prototype'][_0x344a('0x165')]=function(_0x5d78fd){var _0x29e194=this;var _0x1b1af3=_0x5d78fd[_0x344a('0x1fb')]-_0x5d78fd[_0x344a('0x77')]-_0x5d78fd[_0x344a('0xcc')];emitCampaignSummary(_0x5d78fd);if(_0x1b1af3>0x0){if(_0x1b1af3>this['maxNumberOriginate']){_0x1b1af3=this['maxNumberOriginate'];}_0x5d78fd['temp']+=_0x1b1af3;this[_0x344a('0xcd')](_0x5d78fd['id'],_0x1b1af3,_0x5d78fd[_0x344a('0x1fc')],_0x5d78fd)['then'](function(_0x396c85){_0x5d78fd['temp']-=_0x1b1af3;_0x5d78fd[_0x344a('0xcc')]=_0x5d78fd['temp']>0x0?_0x5d78fd[_0x344a('0xcc')]:0x0;if(!checkContactEmpty(_0x396c85)){_0x5d78fd[_0x344a('0x41')]=_0x344a('0xa7');logger['info'](_0x344a('0x1fd')+_0x5d78fd[_0x344a('0x43')]);}else{_0x5d78fd[_0x344a('0x77')]+=_0x396c85[_0x344a('0x9f')];_0x5d78fd['message']='RUNNING';for(var _0x4d7dde=0x0;_0x4d7dde<_0x396c85[_0x344a('0x9f')];_0x4d7dde+=0x1){_0x5d78fd[_0x344a('0x1fe')]+=0x1;if(_[_0x344a('0xb6')](_0x396c85[_0x4d7dde])||_[_0x344a('0xb6')](_0x396c85[_0x4d7dde][_0x344a('0x170')])||_[_0x344a('0xb6')](_0x396c85[_0x4d7dde]['Contact'][_0x344a('0x171')])){_0x29e194[_0x344a('0x1ff')](_0x344a('0x200'),_0x5d78fd,_0x396c85[_0x4d7dde]);}else{_0x29e194[_0x344a('0x201')](_['pick'](_0x396c85[_0x4d7dde],['CampaignId',_0x344a('0x202')]))[_0x344a('0xc0')](_0x29e194[_0x344a('0x203')](_0x5d78fd,_0x396c85[_0x4d7dde]))[_0x344a('0xba')](_0x29e194['loggerHandler']('[actionOriginateIvr]\x20',_0x5d78fd));}}}})[_0x344a('0xba')](loggerGetContactDialer(_0x344a('0x204'),_0x5d78fd,_0x1b1af3));}};Dialer['prototype'][_0x344a('0x15f')]=function(_0x5a29c8,_0x5f2e7f){var _0x232c9f=this;var _0x3ebb32=[];var _0x45601b=_0x5f2e7f>=0x1?_0x5f2e7f:0x1;if(_0x5a29c8[_0x344a('0x5e')]===_0x344a('0xa')){_0x45601b=0x1;}var _0x5ca262=Math['floor'](_0x5a29c8[_0x344a('0x52')]*_0x45601b)-_0x5a29c8[_0x344a('0x77')]-_0x5a29c8['temp'];emitVoiceQueueSummary(_0x5a29c8);if(_0x5a29c8[_0x344a('0x205')]>0x0){var _0x433877=_0x5a29c8[_0x344a('0x205')]-_0x5a29c8['originated']-_0x5a29c8[_0x344a('0x57')]-_0x5a29c8['temp']-_0x5a29c8[_0x344a('0x54')];if(_0x5ca262>_0x433877){_0x5ca262=_0x433877;}}if(_0x5ca262>0x0){if(_0x5a29c8[_0x344a('0x5e')]===_0x344a('0xa')){_0x5ca262=0x1;}if(_0x5ca262>this[_0x344a('0x22')]){_0x5ca262=this['maxNumberOriginate'];}_0x5a29c8['temp']+=_0x5ca262;for(var _0x2d9e01 in this[_0x344a('0x20')]){if(typeof this['agents'][_0x2d9e01]!==_0x344a('0xa0')){if(this[_0x344a('0x20')][_0x2d9e01][_0x344a('0xaf')]==='not_inuse'&&this[_0x344a('0x20')][_0x2d9e01]['status']==='reachable'){_0x3ebb32[_0x344a('0x132')](this[_0x344a('0x20')][_0x2d9e01]['id']);}}}this[_0x344a('0xcb')](_0x5a29c8['id'],_0x3ebb32,_0x5ca262,_0x5a29c8[_0x344a('0x1fc')],_0x5a29c8)['then'](function(_0x33cc59){_0x5a29c8['temp']-=_0x5ca262;_0x5a29c8[_0x344a('0xcc')]=_0x5a29c8[_0x344a('0xcc')]>0x0?_0x5a29c8['temp']:0x0;if(!checkContactEmpty(_0x33cc59)){_0x232c9f[_0x344a('0xbf')](_0x5a29c8)[_0x344a('0xc0')](sendMessageReschedule(_0x5a29c8))[_0x344a('0xba')](loggerCatch(_0x344a('0xc1')));}else{_0x5a29c8[_0x344a('0x77')]+=_0x33cc59['length'];_0x5a29c8[_0x344a('0x41')]=_0x5a29c8[_0x344a('0x5e')]===_0x344a('0xa')?_0x344a('0x206'):_0x344a('0x207');for(var _0x5ac6ca=0x0;_0x5ac6ca<_0x33cc59['length'];_0x5ac6ca+=0x1){if(_[_0x344a('0xb6')](_0x33cc59[_0x5ac6ca])||_[_0x344a('0xb6')](_0x33cc59[_0x5ac6ca][_0x344a('0x170')])||_[_0x344a('0xb6')](_0x33cc59[_0x5ac6ca][_0x344a('0x170')][_0x344a('0x171')])){_0x232c9f[_0x344a('0x1ff')](_0x344a('0x200'),_0x5a29c8,_0x33cc59[_0x5ac6ca]);}else{_0x232c9f[_0x344a('0xc3')](_[_0x344a('0xd7')](_0x33cc59[_0x5ac6ca],[_0x344a('0xda'),_0x344a('0x202')]))[_0x344a('0xc0')](_0x232c9f[_0x344a('0x203')](_0x5a29c8,_0x33cc59[_0x5ac6ca]))[_0x344a('0xba')](_0x232c9f['loggerHandler']('[actionOriginate]\x20',_0x5a29c8));}}}})[_0x344a('0xba')](loggerGetContactDialer(_0x344a('0x208'),_0x5a29c8,_0x5ca262));}};Dialer[_0x344a('0xb2')][_0x344a('0x97')]=function(_0x27c8ba){if(_0x27c8ba[_0x344a('0x205')]>0x0){var _0x29251d=_0x27c8ba['dialLimitQueue']-_0x27c8ba[_0x344a('0x77')]-_0x27c8ba[_0x344a('0x57')];if(_0x29251d>0x0){this[_0x344a('0x209')](_0x27c8ba);}else{loggerPredictiveCalls[_0x344a('0x83')]('[handlePredictive][limitChannel]');}}else{this[_0x344a('0x209')](_0x27c8ba);}};Dialer[_0x344a('0xb2')][_0x344a('0x209')]=function(_0x4af2fa){var _0x5b26dd=this;var _0x3139b2=[];_0x4af2fa[_0x344a('0x77')]+=0x1;for(var _0x3ff27f in this['agents']){if(typeof this[_0x344a('0x20')][_0x3ff27f]!==_0x344a('0xa0')){if(this[_0x344a('0x20')][_0x3ff27f][_0x344a('0xaf')]===_0x344a('0x20a')&&this[_0x344a('0x20')][_0x3ff27f][_0x344a('0xb8')]===_0x344a('0xe0')){_0x3139b2[_0x344a('0x132')](this[_0x344a('0x20')][_0x3ff27f]['id']);}}}this[_0x344a('0xcb')](_0x4af2fa['id'],_0x3139b2,0x1,_0x4af2fa['dialOrderByScheduledAt'],_0x4af2fa)['then'](function(_0x5a7cda){if(!checkContactEmpty(_0x5a7cda)){checkContactLowerLimitOriginate(_0x4af2fa,0x1,0x0);_0x5b26dd[_0x344a('0xbf')](_0x4af2fa)[_0x344a('0xc0')](sendMessageReschedule(_0x4af2fa))['catch'](loggerCatch(_0x344a('0xc1')));}else{_0x4af2fa[_0x344a('0x41')]=_0x344a('0x207');if(_['isNil'](_0x5a7cda[0x0])||_[_0x344a('0xb6')](_0x5a7cda[0x0][_0x344a('0x170')])||_[_0x344a('0xb6')](_0x5a7cda[0x0]['Contact'][_0x344a('0x171')])){_0x5b26dd['emptyContact'](_0x344a('0x200'),_0x4af2fa,_0x5a7cda[0x0]);}else{_0x5b26dd['checkIsBlackList'](_[_0x344a('0xd7')](_0x5a7cda[0x0],[_0x344a('0xda'),_0x344a('0x202')]))['then'](_0x5b26dd[_0x344a('0x203')](_0x4af2fa,_0x5a7cda[0x0]))[_0x344a('0xba')](_0x5b26dd[_0x344a('0xd5')](_0x344a('0x20b'),_0x4af2fa));}}})[_0x344a('0xba')](loggerGetContactDialer('[getContactDialerPredictive]',_0x4af2fa,0x1));emitVoiceQueueSummary(_0x4af2fa);};Dialer['prototype'][_0x344a('0x1da')]=function(_0xcfec46,_0x2e4542,_0x3dc7c3,_0x56d744,_0xc6fa87,_0x1fedbc){loggerPredictive[_0x344a('0x83')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x344a('0x20c'),_0xcfec46);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e4542);loggerPredictive[_0x344a('0x83')](_0x344a('0x20d'),_0x3dc7c3);loggerPredictive[_0x344a('0x83')](_0x344a('0x20e'),_0x56d744);loggerPredictive['info'](_0x344a('0x20f'),_0xc6fa87);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x4d4362,_0x16e4a7){if(_0xcfec46<=0x0||isNaN(_0xcfec46)){return _0x16e4a7(msgResponse('[abandonmentRate]',_0x344a('0x49'),_0x344a('0x210')+_0xcfec46));}if(_0x3dc7c3<=0x0||isNaN(_0x3dc7c3)){return _0x16e4a7(msgResponse(_0x344a('0x211'),'Error',_0x344a('0x212')+_0x3dc7c3));}if(_0x56d744<=0x0||isNaN(_0x56d744)){return _0x16e4a7(msgResponse('[abandonmentRate]',_0x344a('0x49'),'p\x20=\x20'+_0x56d744));}if(_0x2e4542<=0x0||isNaN(_0x2e4542)){return _0x16e4a7(msgResponse(_0x344a('0x211'),_0x344a('0x49'),_0x344a('0x213')+_0x2e4542));}if(_0xc6fa87<=0x0||isNaN(_0xc6fa87)){return _0x16e4a7(msgResponse('[abandonmentRate]',_0x344a('0x49'),'Amax\x20=\x20'+_0xc6fa87));}_0x1fedbc=_0x1fedbc||0x0;var _0x622693=0x1/_0x3dc7c3;var _0x46d353=0x0;var _0x105ed6=0x0;var _0x309c50=0x0;var _0x1ba834=0x0;for(var _0x43e95d=0x0;_0x309c50<_0xc6fa87;_0x43e95d+=0x1){_0x105ed6=_0x43e95d/_0x2e4542;_0x46d353=(_0x56d744*_0x105ed6+_0x1fedbc)/_0x622693;_0x309c50=erlangb(_0x46d353,_0xcfec46);_0x1ba834=_0x46d353/_0xcfec46*(0x1-erlangb(_0x46d353,_0xcfec46));}return _0x4d4362({'erlangCalls':_0x43e95d,'erlangCallToSecond':_0x2e4542/_0x43e95d,'erlangAbandonmentRate':_0x309c50,'erlangBusyFactor':_0x1ba834});});};Dialer[_0x344a('0xb2')][_0x344a('0x1dc')]=function(_0x1bdefc,_0x39cbcc,_0x52e6c7,_0x27bea3,_0x411c26,_0x28088b){loggerPredictive[_0x344a('0x83')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x344a('0x83')](_0x344a('0x20c'),_0x1bdefc);loggerPredictive[_0x344a('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39cbcc);loggerPredictive[_0x344a('0x83')](_0x344a('0x20d'),_0x52e6c7);loggerPredictive[_0x344a('0x83')](_0x344a('0x20e'),_0x27bea3);loggerPredictive['info'](_0x344a('0x214'),_0x411c26);loggerPredictive[_0x344a('0x83')]('---------------------------');return new BPromise(function(_0x56d382,_0xa2dbee){if(_0x1bdefc<=0x0||isNaN(_0x1bdefc)){return _0xa2dbee(msgResponse(_0x344a('0x215'),_0x344a('0x49'),_0x344a('0x210')+_0x1bdefc));}if(_0x52e6c7<=0x0||isNaN(_0x52e6c7)){return _0xa2dbee(msgResponse(_0x344a('0x215'),_0x344a('0x49'),_0x344a('0x212')+_0x52e6c7));}if(_0x27bea3<=0x0||isNaN(_0x27bea3)){return _0xa2dbee(msgResponse(_0x344a('0x215'),_0x344a('0x49'),_0x344a('0x216')+_0x27bea3));}if(_0x39cbcc<=0x0||isNaN(_0x39cbcc)){return _0xa2dbee(msgResponse('[busyFactor]',_0x344a('0x49'),_0x344a('0x213')+_0x39cbcc));}if(_0x411c26<=0x0||isNaN(_0x411c26)){return _0xa2dbee(msgResponse('[busyFactor]','Error','Umin\x20=\x20'+_0x411c26));}_0x28088b=_0x28088b||0x0;var _0x1fd28f=0x1/_0x52e6c7;var _0x16f224=0x0;var _0x5f48cb=0x0;var _0x22c586=0x0;var _0x4396a3=0x0;for(var _0x273f8e=0x0;_0x4396a3<_0x411c26;_0x273f8e+=0x1){_0x5f48cb=_0x273f8e/_0x39cbcc;_0x16f224=(_0x27bea3*_0x5f48cb+_0x28088b)/_0x1fd28f;_0x22c586=erlangb(_0x16f224,_0x1bdefc);_0x4396a3=_0x16f224/_0x1bdefc*(0x1-erlangb(_0x16f224,_0x1bdefc));}return _0x56d382({'erlangCalls':_0x273f8e,'erlangCallToSecond':_0x39cbcc/_0x273f8e,'erlangAbandonmentRate':_0x22c586,'erlangBusyFactor':_0x4396a3});});};module[_0x344a('0x217')]=Dialer;
\ No newline at end of file
+var _0x149c=['statedesc','HangupInAMD','membername','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','AMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','state','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','reason19\x20machine....','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','minutes','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','syncNewExten','roundrobin','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','launchHandleIvr','\x5cw{0,','pow','replace','random','match','actionOriginate','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','outbound','\x22%s,%s%s,,,%s\x22','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','callerid','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','entity\x20is\x20undefine','object','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','getContactDialer','ACTIVE','checkContactBlack','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','env','127.0.0.1','rrmemory','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','originateresponse','bind','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','inspect','error','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','countReScheduled','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','moveContactManagedDialer','uniqueId','uniqueid','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP'];(function(_0x1d08cf,_0x39cbd3){var _0x409854=function(_0x6e816c){while(--_0x6e816c){_0x1d08cf['push'](_0x1d08cf['shift']());}};_0x409854(++_0x39cbd3);}(_0x149c,0x143));var _0xc149=function(_0x1961dc,_0x2f5130){_0x1961dc=_0x1961dc-0x0;var _0x1a83f1=_0x149c[_0x1961dc];return _0x1a83f1;};'use strict';var util=require(_0xc149('0x0'));var _=require('lodash');var BPromise=require(_0xc149('0x1'));var uuid=require(_0xc149('0x2'));var moment=require(_0xc149('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xc149('0x4'));var ut=require(_0xc149('0x5'));var config=require(_0xc149('0x6'));var logger=require(_0xc149('0x7'))(_0xc149('0x8'));var loggerBooked=require(_0xc149('0x7'))(_0xc149('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0xc149('0x7'))(_0xc149('0xa'));var loggerSyncQueueSummary=require(_0xc149('0x7'))(_0xc149('0xb'));var ami=require(_0xc149('0xc'));config[_0xc149('0xd')]=_[_0xc149('0xe')](config[_0xc149('0xd')],{'host':_0xc149('0xf'),'port':0x18eb});var io=require(_0xc149('0x10'))(new Redis(config[_0xc149('0xd')]));var cmHopper=require(_0xc149('0x11'));var cmHopperHistory=require(_0xc149('0x12'));var cmHopperBlack=require(_0xc149('0x13'));var voiceQueueRt=require(_0xc149('0x14'));var Action=require(_0xc149('0x15'));var History=require(_0xc149('0x16'));var Final=require(_0xc149('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xc149('0x18'));var Hangup=require('./hangup');var ipAgi=process[_0xc149('0x19')]['XCALLY_IP_AGI']||_0xc149('0x1a');var strategy={'rrmemory':_0xc149('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0xc149('0x1c')]=function(_0xd4bc13){this[_0xc149('0x1d')]=this[_0xc149('0x1d')]?this[_0xc149('0x1d')][_0xc149('0x1e')](_0xd4bc13):_0xd4bc13();};function Dialer(_0x4f8562,_0x43269e){this[_0xc149('0x1f')]=new Sequence();this[_0xc149('0x20')]=_0x43269e;this[_0xc149('0x21')]=_0x4f8562[_0xc149('0x21')];this['campaigns']=_0x4f8562[_0xc149('0x22')];this[_0xc149('0x23')]=_0x4f8562[_0xc149('0x23')];this[_0xc149('0x24')]=_0x4f8562[_0xc149('0x24')];this[_0xc149('0x25')]=config['maxNumberOriginate']||0x2;this[_0xc149('0x26')]={};this[_0xc149('0x27')]={};this['contactsId']={};this['uniqueId']={};this[_0xc149('0x28')]={};this[_0xc149('0x29')]={};this[_0xc149('0x2a')]={};this[_0xc149('0x2b')]={};this[_0xc149('0x2c')]={};this[_0xc149('0x2d')]={};ami['on'](_0xc149('0x2e'),this['syncAgentConnect']['bind'](this));ami['on'](_0xc149('0x2f'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xc149('0x30'),this['syncOriginateResponse'][_0xc149('0x31')](this));ami['on']('agentcomplete',this[_0xc149('0x32')][_0xc149('0x31')](this));ami['on'](_0xc149('0x33'),this[_0xc149('0xb')][_0xc149('0x31')](this));ami['on'](_0xc149('0x34'),this[_0xc149('0x35')]['bind'](this));ami['on'](_0xc149('0x36'),this['syncNewExten'][_0xc149('0x31')](this));ami['on'](_0xc149('0x37'),this[_0xc149('0x38')][_0xc149('0x31')](this));ami['on'](_0xc149('0x39'),this[_0xc149('0x3a')][_0xc149('0x31')](this));ami['on'](_0xc149('0x3b'),this[_0xc149('0x3c')][_0xc149('0x31')](this));this[_0xc149('0x3d')]();this['loopClearZombieChannels']();}function isNotNull(_0x7b9227){return _0x7b9227!==null&&!_[_0xc149('0x3e')](_0x7b9227);}function checkIsLoggedIn(_0x576629,_0x1c8fd5){return function(){if(_0x1c8fd5<=0x0){_0x576629['message']=_0xc149('0x3f');throw _0x576629[_0xc149('0x40')]+_0xc149('0x41');}};}function isActive(_0x19f130){return _0x19f130;}function checkIsActive(_0x217e18,_0x3d9e80){return function(){if(!isActive(_0x3d9e80)){_0x217e18[_0xc149('0x42')]=_0xc149('0x43');throw _0x217e18[_0xc149('0x40')]+'\x20NOT\x20Active';}};}function checkInterval(_0x4440be){return function(){if(!isNotNull(_0x4440be[_0xc149('0x44')])){_0x4440be['message']=_0xc149('0x45');throw _0x4440be[_0xc149('0x40')]+_0xc149('0x46');}if(!isNotNull(_0x4440be['Interval'][_0xc149('0x47')])){_0x4440be[_0xc149('0x42')]=_0xc149('0x45');throw _0x4440be[_0xc149('0x40')]+_0xc149('0x46');}if(!isNotNull(_['isEmpty'](_0x4440be['Interval'][_0xc149('0x47')]))){_0x4440be['message']=_0xc149('0x45');throw _0x4440be[_0xc149('0x40')]+_0xc149('0x46');}};}function msgResponse(_0x2b53aa,_0x26081,_0x28541e){return{'action':_0x2b53aa,'response':_0x26081,'message':_0x28541e,'stack':_0x28541e};}function myreject(_0xceccf9){return function(_0x26151c){return _0xceccf9(msgResponse(_0xc149('0x48'),_0xc149('0x49'),JSON['stringify'](_0x26151c)));};}function getSeconds(_0x1b361e,_0x2c396d){var _0x345ad7=moment(_0x1b361e)[_0xc149('0x4a')](0x0);var _0x24d5f3=moment(_0x2c396d)[_0xc149('0x4a')](0x0);return _0x345ad7[_0xc149('0x4b')](_0x24d5f3,_0xc149('0x4c'));}function emit(_0x2e15e0,_0x420645,_0x4e34e4){io['to'](_0x2e15e0)[_0xc149('0x4d')](_0x420645,_0x4e34e4);}function emitVoiceQueueSummary(_0x507596){if(_0x507596['type']==='outbound'){var _0x5390db={'id':_0x507596['id'],'name':_0x507596[_0xc149('0x40')],'strategy':_0x507596[_0xc149('0x4e')],'answered':_0x507596[_0xc149('0x4f')],'available':_0x507596[_0xc149('0x50')],'loggedIn':_0x507596[_0xc149('0x51')],'pTalking':_0x507596[_0xc149('0x52')],'sumBillable':_0x507596[_0xc149('0x53')],'sumDuration':_0x507596[_0xc149('0x54')],'sumHoldTime':_0x507596['sumHoldTime']||0x0,'talking':_0x507596[_0xc149('0x55')],'total':_0x507596[_0xc149('0x56')],'type':_0x507596[_0xc149('0x57')],'unmanaged':_0x507596['unmanaged'],'abandoned':_0x507596[_0xc149('0x58')],'waiting':_0x507596[_0xc149('0x59')],'loggedInDb':_0x507596[_0xc149('0x5a')],'dialActive':_0x507596[_0xc149('0x5b')],'dialMethod':_0x507596['dialMethod'],'dialOriginateCallerIdName':_0x507596[_0xc149('0x5c')],'dialOriginateCallerIdNumber':_0x507596[_0xc149('0x5d')],'dialOriginateTimeout':_0x507596[_0xc149('0x5e')],'dialPrefix':_0x507596[_0xc149('0x5f')],'outboundAnswerAgiCallsDay':_0x507596[_0xc149('0x60')],'outboundAnswerCallsDay':_0x507596['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x507596[_0xc149('0x61')],'outboundBusyCallsDay':_0x507596[_0xc149('0x62')],'outboundCongestionCallsDay':_0x507596[_0xc149('0x63')],'outboundDropCallsDayACS':_0x507596[_0xc149('0x64')],'outboundDropCallsDayCallersExit':_0x507596[_0xc149('0x65')],'outboundDropCallsDayTimeout':_0x507596['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x507596[_0xc149('0x66')],'outboundNoSuchCallsDay':_0x507596[_0xc149('0x67')],'outboundOriginateFailureCallsDay':_0x507596[_0xc149('0x68')],'outboundReCallsDay':_0x507596[_0xc149('0x69')],'outboundRejectCallsDay':_0x507596[_0xc149('0x6a')],'outboundUnknownCallsDay':_0x507596[_0xc149('0x6b')],'predictiveIntervalAnsweredCalls':_0x507596[_0xc149('0x6c')],'predictiveIntervalAvgHoldtime':_0x507596[_0xc149('0x6d')],'predictiveIntervalAvgTalktime':_0x507596['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x507596[_0xc149('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x507596[_0xc149('0x6f')],'predictiveIntervalErlangCalls':_0x507596['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x507596['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x507596[_0xc149('0x70')],'predictiveIntervalMultiplicativeFactor':_0x507596[_0xc149('0x71')],'predictiveIntervalPauses':_0x507596['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x507596[_0xc149('0x72')],'predictiveIntervalTotalCalls':_0x507596[_0xc149('0x73')],'message':_0x507596[_0xc149('0x42')],'originated':_0x507596[_0xc149('0x74')],'erlangCalls':_0x507596['erlangCalls'],'erlangCallToSecond':_0x507596[_0xc149('0x75')],'erlangAbandonmentRate':_0x507596[_0xc149('0x76')],'erlangBusyFactor':_0x507596[_0xc149('0x77')],'startPredictive':_0x507596[_0xc149('0x29')],'startProgressive':_0x507596[_0xc149('0x2a')]};if(_0x507596['Trunk']){_0x5390db[_0xc149('0x78')]={'id':_0x507596[_0xc149('0x78')]['id'],'name':_0x507596[_0xc149('0x78')][_0xc149('0x40')],'active':_0x507596[_0xc149('0x78')][_0xc149('0x79')],'callerid':_0x507596[_0xc149('0x78')]['callerid']};}if(_0x507596[_0xc149('0x44')]){_0x5390db[_0xc149('0x44')]={'id':_0x507596[_0xc149('0x44')]['id'],'name':_0x507596[_0xc149('0x44')][_0xc149('0x40')]};}var _0x5c2f59=md5(JSON[_0xc149('0x7a')](_0x5390db));if(_0x507596[_0xc149('0x7b')]!==_0x5c2f59){_0x507596['md5']=_0x5c2f59;emit(util[_0xc149('0x7c')](_0xc149('0x7d'),_0x5390db[_0xc149('0x40')]),_0xc149('0x7e'),_0x5390db);}}}function emitCampaignSummary(_0x1fb432){if(_0x1fb432[_0xc149('0x57')]===_0xc149('0x7f')){emit(util[_0xc149('0x7c')](_0xc149('0x80'),_0x1fb432[_0xc149('0x40')]),_0xc149('0x81'),_0x1fb432);}}function checkGetDataPredictive(_0x2c88e6){if(isNotNull(_0x2c88e6)&&!_[_0xc149('0x82')](_0x2c88e6)){loggerPredictive[_0xc149('0x83')](_0xc149('0x84'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c88e6['predictiveIntervalTotalCalls']);loggerPredictive[_0xc149('0x83')](_0xc149('0x85'),_0x2c88e6[_0xc149('0x6c')]);loggerPredictive['info'](_0xc149('0x86'),_0x2c88e6[_0xc149('0x6f')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x87'),_0x2c88e6[_0xc149('0x6e')]);loggerPredictive['info'](_0xc149('0x88'),_0x2c88e6['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0xc149('0x89'),_0x2c88e6[_0xc149('0x8a')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x8b'));if(_0x2c88e6[_0xc149('0x73')]>0x0){if(!_[_0xc149('0x3e')](_0x2c88e6['predictiveIntervalAvgTalktime'])&&_0x2c88e6[_0xc149('0x8a')]>0x0){return!![];}loggerPredictive[_0xc149('0x83')](_0xc149('0x8c'));if(!_['isUndefined'](_0x2c88e6[_0xc149('0x6d')])&&_0x2c88e6[_0xc149('0x6d')]>0x0){return!![];}loggerPredictive[_0xc149('0x83')](_0xc149('0x8d'));}else{loggerPredictive[_0xc149('0x83')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc149('0x83')](_0xc149('0x8e'));}return![];}function mergeDataErlangB(_0xe4e626){return function(_0x52ef1c){loggerPredictive[_0xc149('0x83')](_0xc149('0x8f'));loggerPredictive[_0xc149('0x83')](_0xc149('0x90'),_0x52ef1c[_0xc149('0x91')]);loggerPredictive['info'](_0xc149('0x92'),_0x52ef1c[_0xc149('0x75')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x93'),_0x52ef1c[_0xc149('0x76')]);loggerPredictive[_0xc149('0x83')](_0xc149('0x94'),_0x52ef1c[_0xc149('0x77')]);loggerPredictive['info'](_0xc149('0x93'),_0x52ef1c['erlangAbandonmentRate']);loggerPredictive['info'](_0xc149('0x8b'));_[_0xc149('0x95')](_0xe4e626,_0x52ef1c);};}function getDiff(_0x410ced){var _0x2573af=moment()['milliseconds'](0x0);var _0x42a604=moment(_0x410ced)[_0xc149('0x4a')](0x0);return _0x2573af[_0xc149('0x4b')](_0x42a604,_0xc149('0x4c'));}function ifInterval(_0x1d6233,_0x31ce7b){if(_[_0xc149('0x3e')](_0x31ce7b)){return![];}return getDiff(_0x31ce7b)<_0x1d6233*0x3c;}function freeVariablesPredictive(_0x21d1a2){if(isNotNull(_0x21d1a2)){if(!_['isUndefined'](_0x21d1a2[_0xc149('0x2a')])){_0x21d1a2[_0xc149('0x2a')]=undefined;loggerPredictive[_0xc149('0x83')](_0x21d1a2['name'],_0xc149('0x96'));}if(!_['isUndefined'](_0x21d1a2[_0xc149('0x29')])){_0x21d1a2[_0xc149('0x29')]=undefined;loggerPredictive[_0xc149('0x83')](_0x21d1a2['name'],_0xc149('0x97'));}if(!_[_0xc149('0x3e')](_0x21d1a2['handlePredictive'])){clearInterval(_0x21d1a2[_0xc149('0x98')]);_0x21d1a2['handlePredictive']=undefined;loggerPredictive['info'](_0x21d1a2[_0xc149('0x40')],_0xc149('0x99'));}}}function erlangb(_0x3f2cd7,_0x531a2c){if(_0x531a2c===0x0){return 0x0;}var _0x28958a=0x1;for(var _0x2feeff=0x1;_0x2feeff<=_0x531a2c;_0x2feeff+=0x1){_0x28958a=0x1+_0x28958a*_0x2feeff/_0x3f2cd7;}return 0x1/_0x28958a;}function isVoiceQueueOutbound(_0x19ed54){return _0x19ed54==='outbound';}function isNotPreview(_0x4b3225){return _0x4b3225!==_0xc149('0x20');}function isCampaignIvr(_0xbe4c5){return _0xbe4c5==='ivr';}function getCallerId(_0x16990d,_0x181b42,_0x419045){if(!_[_0xc149('0x3e')](_0x419045)&&typeof _0x419045==='string'&&!_[_0xc149('0x82')](_0x419045)){if(!_[_0xc149('0x3e')](_0x181b42)&&typeof _0x181b42===_0xc149('0x9a')&&!_[_0xc149('0x82')](_0x181b42)){return util[_0xc149('0x7c')](_0xc149('0x9b'),_0x181b42,_0x419045);}return util[_0xc149('0x7c')](_0xc149('0x9b'),_0x419045,_0x419045);}if(!_[_0xc149('0x3e')](_0x16990d)&&typeof _0x16990d===_0xc149('0x9a')&&!_[_0xc149('0x82')](_0x16990d)){return _0x16990d;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x546d1b,_0x5ab75e){return function(_0x39535c){freeVariablesPredictive(_0x5ab75e);emitVoiceQueueSummary(_0x5ab75e);emitCampaignSummary(_0x5ab75e);loggerSyncQueueSummary['error'](_0x546d1b,util[_0xc149('0x9c')](_0x39535c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x27ca68,_0x1a9afe){return function(_0x3d80c7){loggerPredictive[_0xc149('0x9d')](_0x1a9afe[_0xc149('0x40')],_0x27ca68);loggerPredictive[_0xc149('0x9d')](_0x3d80c7[_0xc149('0x9e')]);freeVariablesPredictive(_0x1a9afe);};}function loggerCatch(_0x4ad74c){return function(_0x55e378){logger['error'](_0x4ad74c,util['inspect'](_0x55e378,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x296494){return _0x296494&&!_[_0xc149('0x3e')](_0x296494)&&_0x296494[_0xc149('0x9f')]>0x0;}function decremetOriginate(_0xaed35a){if(!_[_0xc149('0x3e')](_0xaed35a)&&_0xaed35a!==null){if(typeof _0xaed35a[_0xc149('0x74')]!==_0xc149('0xa0')){if(_0xaed35a[_0xc149('0x74')]>0x0){_0xaed35a['originated']-=0x1;}else{logger[_0xc149('0x9d')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xc149('0xa1'));}}function checkContactLowerLimitOriginate(_0x570f49,_0x408369,_0x42f65d){if(_0x408369>_0x42f65d){for(var _0x3bf5b6=0x0;_0x3bf5b6<_0x408369-_0x42f65d;_0x3bf5b6+=0x1){decremetOriginate(_0x570f49);}}}function loggerGetContactDialer(_0x5c15be,_0x234cee,_0x4005d2){return function(_0x3dd56f){checkContactLowerLimitOriginate(_0x234cee,_0x4005d2,0x0);logger[_0xc149('0x9d')](_0x5c15be,util[_0xc149('0x9c')](_0x3dd56f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x55841c){return function(_0x2d02d0){if(isNotNull(_0x2d02d0)&&isNotNull(_0x2d02d0[0x0])){if(_0x2d02d0[0x0][_0xc149('0xa2')]>0x0){_0x55841c[_0xc149('0x42')]=_0xc149('0xa3');logger['info'](_0xc149('0xa4')+_0x55841c[_0xc149('0x40')],_0x2d02d0[0x0][_0xc149('0xa2')],_0xc149('0xa5'));}else{_0x55841c[_0xc149('0x42')]=_0xc149('0xa6');logger[_0xc149('0x83')](_0xc149('0xa7')+_0x55841c[_0xc149('0x40')]);}}};}function notSendMessagesQueue(_0x59f59b){if(_0x59f59b['sendMessageOneNotActive']){freeVariablesPredictive(_0x59f59b);if(_0x59f59b[_0xc149('0x74')]===0x0&&_0x59f59b['talking']===0x0&&_0x59f59b[_0xc149('0x59')]===0x0&&(_0x59f59b[_0xc149('0x52')]||0x0)===0x0){_0x59f59b[_0xc149('0xa8')]=![];_0x59f59b[_0xc149('0x50')]=0x0;_0x59f59b[_0xc149('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xc149('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x59f59b[_0xc149('0x40')],'is\x20not\x20active');}else{_0x59f59b['message']='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xc149('0xa9'),_0x59f59b[_0xc149('0x40')],_0xc149('0xaa'));}emitVoiceQueueSummary(_0x59f59b);}}function notSendMessagesCampaign(_0x53fb2b){if(_0x53fb2b['sendMessageOneNotActive']){if(_0x53fb2b['originated']===0x0){_0x53fb2b[_0xc149('0xa8')]=![];_0x53fb2b[_0xc149('0x42')]=_0xc149('0x43');loggerSyncQueueSummary[_0xc149('0x9d')](_0xc149('0xab'),_0x53fb2b['name'],_0xc149('0xac'));}else{_0x53fb2b[_0xc149('0x42')]=_0xc149('0xad');loggerSyncQueueSummary[_0xc149('0x9d')](_0xc149('0xab'),_0x53fb2b['name'],_0xc149('0xaa'));}emitCampaignSummary(_0x53fb2b);}}function createObjHistory(_0x1325e5,_0x1ebe82,_0x3a6f6e,_0x57c452,_0x5479ed){_0x1325e5[_0xc149('0x42')]=_0x3a6f6e;var _0x31c5d8=new Action(_0x1325e5,_0x1ebe82);var _0x5f4f07=new History(_0x31c5d8);_0x5f4f07['state']=_0x57c452;_0x5f4f07['statedesc']=_0x5479ed;_0x5f4f07[_0xc149('0xae')]=_0x31c5d8[_0xc149('0xaf')];return _0x5f4f07;}Dialer[_0xc149('0xb0')]['loopClearZombieChannels']=function(){var _0x513f31=this;setInterval(function(){_0x513f31[_0xc149('0xb1')](_0x513f31['uniqueId'],_0xc149('0xb2'));_0x513f31[_0xc149('0xb1')](_0x513f31[_0xc149('0x27')],'[actions]');},0x32c8);};Dialer[_0xc149('0xb0')][_0xc149('0xb1')]=function(_0x2a6cb1,_0x32555f){var _0x1106e6=this;for(var _0x2442bd in _0x2a6cb1){if(typeof _0x2a6cb1[_0x2442bd]!==_0xc149('0xa0')){this[_0xc149('0x1f')][_0xc149('0x1c')](function(){if(!_[_0xc149('0xb3')](_0x2a6cb1[_0x2442bd])){return ami['Action']({'action':_0xc149('0xb4'),'channel':_0x2a6cb1[_0x2442bd][_0xc149('0xb5')]})[_0xc149('0xb6')](function(_0x2e01b6){if(_0x2e01b6[_0xc149('0x42')]===_0xc149('0xb7')){setTimeout(function(){if(_0x2a6cb1[_0x2442bd]&&_0x2a6cb1[_0x2442bd][_0xc149('0x57')]!=='ivr'){_0x1106e6[_0xc149('0xb8')](_0x1106e6[_0xc149('0x21')][_0x2a6cb1[_0x2442bd][_0xc149('0xb9')]]);logger[_0xc149('0x9d')](_0xc149('0xba'),_0x32555f,_0x2442bd,_0x2a6cb1[_0x2442bd][_0xc149('0xb9')]);delete _0x2a6cb1[_0x2442bd];}if(_0x2a6cb1[_0x2442bd]&&_0x2a6cb1[_0x2442bd][_0xc149('0x57')]===_0xc149('0x7f')){_0x1106e6[_0xc149('0xb8')](_0x1106e6[_0xc149('0x22')][_0x2a6cb1[_0x2442bd]['queue']]);logger[_0xc149('0x9d')](_0xc149('0xbb'),_0x32555f,_0x2442bd,_0x2a6cb1[_0x2442bd][_0xc149('0xb9')]);delete _0x2a6cb1[_0x2442bd];}},0x2328);}});}});}}};Dialer[_0xc149('0xb0')]['countReScheduled']=function(_0x51a2d6){return BPromise[_0xc149('0xbc')]()['then'](cmHopper[_0xc149('0xbd')](_0x51a2d6))[_0xc149('0xb6')](loggerCatch(_0xc149('0xbe')));};Dialer[_0xc149('0xb0')]['checkIsBlackList']=function(_0x2e369f){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopperBlack[_0xc149('0xc0')](_0x2e369f))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc1')));};Dialer[_0xc149('0xb0')][_0xc149('0xc2')]=function(_0x1ed557){return BPromise['resolve']()[_0xc149('0xbf')](cmHopperBlack[_0xc149('0xc2')](_0x1ed557))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc3')));};Dialer[_0xc149('0xb0')]['averageHandleTime']=function(_0x40e599){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopperHistory[_0xc149('0xc4')](_0x40e599))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc5')));};Dialer[_0xc149('0xb0')][_0xc149('0xc6')]=function(_0x3167e5){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopper[_0xc149('0xc6')](_0x3167e5))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc7')));};Dialer[_0xc149('0xb0')][_0xc149('0xc8')]=function(_0x1bf064,_0x312748,_0xb28e9c){return BPromise['resolve']()[_0xc149('0xbf')](cmHopper[_0xc149('0xc8')](_0x1bf064,_0x312748,_0xb28e9c))[_0xc149('0xb6')](loggerCatch(_0xc149('0xc9')));};Dialer[_0xc149('0xb0')]['getContactDialer']=function(_0x1834f9,_0x256840,_0x5c6b7a,_0x544c59,_0x262945){return BPromise[_0xc149('0xbc')]()['then'](cmHopper['getContactDialer'](_0x1834f9,_0x256840,_0x5c6b7a,_0x544c59))[_0xc149('0xb6')](function(_0x3bf7d3){_0x262945['temp']-=_0x5c6b7a;_0x262945[_0xc149('0xca')]=_0x262945[_0xc149('0xca')]>0x0?_0x262945[_0xc149('0xca')]:0x0;loggerCatch(_0xc149('0xcb'))(_0x3bf7d3);});};Dialer[_0xc149('0xb0')][_0xc149('0xcc')]=function(_0x574224,_0x4aa974,_0x42d5fb,_0x51f4f1){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopper['getContactDialerIvr'](_0x574224,_0x4aa974,_0x42d5fb))['catch'](function(_0x3cd65a){_0x51f4f1[_0xc149('0xca')]-=_0x4aa974;_0x51f4f1[_0xc149('0xca')]=_0x51f4f1[_0xc149('0xca')]>0x0?_0x51f4f1[_0xc149('0xca')]:0x0;loggerCatch(_0xc149('0xcd'))(_0x3cd65a);});};Dialer[_0xc149('0xb0')]['getVoiceQueueRtPauses']=function(_0xd7252f){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](voiceQueueRt[_0xc149('0xce')](_0xd7252f))[_0xc149('0xb6')](loggerCatch(_0xc149('0xcf')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x1d1895){return BPromise['resolve']()[_0xc149('0xbf')](cmHopper['moveContactManagedDialer'](_0x1d1895))[_0xc149('0xb6')](loggerCatch(_0xc149('0xd0')));};Dialer['prototype']['createHistory']=function(_0x1ee47f){return BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](cmHopperHistory[_0xc149('0xd1')](_0x1ee47f))[_0xc149('0xb6')](loggerCatch('[createHistory]\x20'));};Dialer['prototype'][_0xc149('0xb8')]=function(_0xa076d9){if(!_[_0xc149('0x3e')](_0xa076d9)&&_0xa076d9!==null){if(typeof _0xa076d9[_0xc149('0x74')]!==_0xc149('0xa0')){if(_0xa076d9['originated']>0x0){_0xa076d9['originated']-=0x1;}else{logger[_0xc149('0x9d')](_0xc149('0xd2'));}}}else{logger[_0xc149('0x9d')](_0xc149('0xd3'));}};Dialer[_0xc149('0xb0')][_0xc149('0xd4')]=function(_0xae543b,_0xe1076b){var _0x3e558c=this;return function(_0x382f7b){_0x3e558c[_0xc149('0xb8')](_0xe1076b);logger[_0xc149('0x9d')](_0xae543b,util[_0xc149('0x9c')](_0x382f7b,{'showHidden':![],'depth':null}));};};Dialer[_0xc149('0xb0')][_0xc149('0xd5')]=function(_0x43165b,_0x39db02,_0x59849b){var _0x47fcf9={'state':0x19,'statedesc':_0xc149('0xd6')};this['updateOriginated'](_0x39db02);this['saveInDb'](_[_0xc149('0x95')](_0x47fcf9,_[_0xc149('0xd7')](_0x59849b,[_0xc149('0xd8'),_0xc149('0xd9'),_0xc149('0xda'),'VoiceQueueId',_0xc149('0xdb')])),_0xc149('0xdc'),_0xc149('0xdd'));logger[_0xc149('0x9d')](_0x43165b);};Dialer['prototype'][_0xc149('0xde')]=function(_0x381ce7){return _0x381ce7==='Success';};Dialer[_0xc149('0xb0')][_0xc149('0xdf')]=function(_0x10ce5a){return!_['isUndefined'](_0x10ce5a)&&_0x10ce5a&&!_[_0xc149('0x3e')](_0x10ce5a[_0xc149('0x40')])&&!_[_0xc149('0x3e')](_0x10ce5a[_0xc149('0x79')])&&_0x10ce5a[_0xc149('0x79')]&&(this[_0xc149('0x24')][util['format'](_0xc149('0xe0'),_0x10ce5a[_0xc149('0x40')])]['status']==='reachable'||this[_0xc149('0x24')][util['format'](_0xc149('0xe0'),_0x10ce5a['name'])][_0xc149('0xb4')]==='unmonitored');};Dialer[_0xc149('0xb0')]['saveInDb']=function(_0x40623b,_0x1226b5,_0xb0290d){this[_0xc149('0xd1')](_0x40623b)[_0xc149('0xb6')](loggerCatch(_0x1226b5));this[_0xc149('0xe1')](_0x40623b)['catch'](loggerCatch(_0xb0290d));};Dialer['prototype'][_0xc149('0x38')]=function(_0x1e6063){var _0x5176f8=this[_0xc149('0xe2')][_0x1e6063[_0xc149('0xe3')]];var _0x5c7288;if(!_[_0xc149('0xb3')](_0x1e6063)&&!_[_0xc149('0xb3')](_0x1e6063[_0xc149('0xe4')])&&!_[_0xc149('0xb3')](_0x1e6063['variable']['amdstatus'])&&_0x1e6063['exten']===_0xc149('0xe5')&&_0x5176f8){if(_0x5176f8[_0xc149('0x57')]!==_0xc149('0x7f')&&this[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063[_0xc149('0xe7')]===_0xc149('0xe8')){delete this['uniqueId'][_0x1e6063['uniqueid']];this[_0xc149('0xb8')](this['voiceQueues'][_0x5176f8[_0xc149('0xb9')]]);this[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0xc149('0x21')][_0x5176f8['queue']][_0xc149('0x60')]+=0x1;_0x5c7288=new Hangup(_0x5176f8,_0x1e6063);_0x5c7288['state']=0x12;_0x5c7288[_0xc149('0xe9')]=_0xc149('0xea');_0x5c7288[_0xc149('0xeb')]='AMD';ami[_0xc149('0x4d')](_0xc149('0xec'),ut[_0xc149('0xed')](_0x5c7288,'amd'));this[_0xc149('0xee')](_0x5c7288,_0xc149('0xef'),_0xc149('0xf0'));}if(_0x5176f8[_0xc149('0x57')]!=='ivr'&&this[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063['value']===_0xc149('0xf1')){var _0x2df90d=this;return new BPromise(function(_0x20c61f,_0x410f8f){delete _0x2df90d[_0xc149('0xe2')][_0x1e6063[_0xc149('0xe3')]];_0x2df90d['updateOriginated'](_0x2df90d['voiceQueues'][_0x5176f8['queue']]);_0x2df90d[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x2df90d['voiceQueues'][_0x5176f8[_0xc149('0xb9')]][_0xc149('0x60')]+=0x1;var _0x4bc140=_0x2df90d[_0xc149('0x21')][_0x5176f8[_0xc149('0xb9')]];var _0xf3896=new Hangup(_0x5176f8,_0x1e6063);_0xf3896['state']=0x13;_0xf3896['statedesc']=_0xc149('0xf2');_0xf3896[_0xc149('0xeb')]='AMD';_0xf3896['countmachineretry']+=0x1;_0xf3896[_0xc149('0xf3')]+=0x1;_0xf3896[_0xc149('0xf4')]=!![];ami[_0xc149('0x4d')](_0xc149('0xec'),ut[_0xc149('0xed')](_0xf3896,_0xc149('0xf4')));_0x2df90d[_0xc149('0xd1')](_0xf3896)[_0xc149('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xf3896[_0xc149('0xf5')]+_0xf3896[_0xc149('0xf6')]+_0xf3896[_0xc149('0xf7')]+_0xf3896[_0xc149('0xf8')]+_0xf3896[_0xc149('0xf9')]+_0xf3896[_0xc149('0xfa')]+_0xf3896['countmachineretry']+_0xf3896[_0xc149('0xfb')]>=_0x4bc140['dialGlobalMaxRetry']){_0x2df90d[_0xc149('0xfc')](_0xf3896,_0x20c61f,_0x410f8f,'reason19\x20machine....');}else{if(_0xf3896[_0xc149('0xfd')]>=_0x4bc140[_0xc149('0xfe')]){_0x2df90d[_0xc149('0xff')](_0xf3896,_0x20c61f,_0x410f8f,_0xc149('0x100'));}else{_0x2df90d['rescheduleContact']({'active':![],'countmachineretry':_0xf3896[_0xc149('0xfd')],'scheduledat':moment()[_0xc149('0x101')](_0x4bc140['dialMachineRetryFrequency'],'minutes')[_0xc149('0x7c')](_0xc149('0x102')),'ContactId':_0xf3896['ContactId'],'ListId':_0xf3896[_0xc149('0xd9')],'VoiceQueueId':_0xf3896[_0xc149('0x103')]||undefined,'CampaignId':_0xf3896[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x104')));_0x20c61f({'reschedule':0x1});}}});}if(_0x5176f8[_0xc149('0x57')]===_0xc149('0x7f')&&this[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063[_0xc149('0xe7')]===_0xc149('0xe8')){delete this['uniqueId'][_0x1e6063[_0xc149('0xe3')]];this[_0xc149('0xb8')](this['campaigns'][_0x5176f8[_0xc149('0xb9')]]);_0x5c7288=new Hangup(_0x5176f8,_0x1e6063);_0x5c7288['state']=0x12;_0x5c7288[_0xc149('0xe9')]=_0xc149('0xea');_0x5c7288[_0xc149('0xeb')]=_0xc149('0x105');ami[_0xc149('0x4d')](_0xc149('0xec'),ut[_0xc149('0xed')](_0x5c7288,_0xc149('0xf4')));this[_0xc149('0xee')](_0x5c7288,_0xc149('0x106'),_0xc149('0x107'));}if(_0x5176f8[_0xc149('0x57')]==='ivr'&&this[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0xe6')]&&_0x1e6063[_0xc149('0xe7')]===_0xc149('0xf1')){var _0x2df90d=this;return new BPromise(function(_0xafff07,_0x2c59f9){delete _0x2df90d[_0xc149('0xe2')][_0x1e6063['uniqueid']];_0x2df90d[_0xc149('0xb8')](_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]]);_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]][_0xc149('0x60')]+=0x1;var _0x33232c=_0x2df90d[_0xc149('0x22')][_0x5176f8[_0xc149('0xb9')]];var _0x426883=new Hangup(_0x5176f8,_0x1e6063);_0x426883[_0xc149('0x108')]=0x13;_0x426883['statedesc']=_0xc149('0xf2');_0x426883[_0xc149('0xeb')]=_0xc149('0x105');_0x426883[_0xc149('0xfd')]+=0x1;_0x426883[_0xc149('0xf3')]+=0x1;_0x426883[_0xc149('0xf4')]=!![];ami[_0xc149('0x4d')](_0xc149('0xec'),ut['buildObj'](_0x426883,'amd'));_0x2df90d['createHistory'](_0x426883)[_0xc149('0xb6')](loggerCatch(_0xc149('0x109')));if(_0x426883['countbusyretry']+_0x426883['countcongestionretry']+_0x426883[_0xc149('0xf7')]+_0x426883[_0xc149('0xf8')]+_0x426883['countdropretry']+_0x426883[_0xc149('0xfa')]+_0x426883[_0xc149('0xfd')]+_0x426883['countagentrejectretry']>=_0x33232c[_0xc149('0x10a')]){_0x2df90d[_0xc149('0xfc')](_0x426883,_0xafff07,_0x2c59f9,_0xc149('0x10b'));}else{if(_0x426883[_0xc149('0xfd')]>=_0x33232c[_0xc149('0xfe')]){_0x2df90d['createStateFinal'](_0x426883,_0xafff07,_0x2c59f9,_0xc149('0x100'));}else{_0x2df90d[_0xc149('0xc6')]({'active':![],'countmachineretry':_0x426883[_0xc149('0xfd')],'scheduledat':moment()[_0xc149('0x101')](_0x33232c[_0xc149('0x10c')],'minutes')['format'](_0xc149('0x102')),'ContactId':_0x426883[_0xc149('0xd8')],'ListId':_0x426883['ListId'],'VoiceQueueId':_0x426883[_0xc149('0x103')]||undefined,'CampaignId':_0x426883[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][Machine]'));_0xafff07({'reschedule':0x1});}}});}}};Dialer[_0xc149('0xb0')][_0xc149('0x35')]=function(_0x811d6b){var _0x104be0=this[_0xc149('0xe2')][_0x811d6b[_0xc149('0xe3')]];var _0x535f1c=this;var _0x45db63;if(_0x104be0&&_0x104be0[_0xc149('0x57')]===_0xc149('0x7f')){delete this['uniqueId'][_0x811d6b[_0xc149('0xe3')]];this[_0xc149('0xb8')](this[_0xc149('0x22')][_0x104be0['queue']]);this[_0xc149('0x22')][_0x104be0[_0xc149('0xb9')]][_0xc149('0x10d')]+=0x1;_0x45db63=new Hangup(_0x104be0,_0x811d6b);this['createHistory'](_0x45db63)[_0xc149('0xb6')](loggerCatch(_0xc149('0x10e')));this[_0xc149('0xe1')](_0x45db63)[_0xc149('0xb6')](loggerCatch(_0xc149('0x10f')));}if(_0x104be0&&_0x104be0[_0xc149('0x57')]!==_0xc149('0x7f')&&isNotNull(this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]]['dialQueueProject'])){delete this['uniqueId'][_0x811d6b['uniqueid']];this[_0xc149('0xb8')](this['voiceQueues'][_0x104be0['queue']]);this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x104be0[_0xc149('0xb9')]][_0xc149('0x60')]+=0x1;_0x45db63=new Hangup(_0x104be0,_0x811d6b);_0x45db63[_0xc149('0x108')]=0x10;_0x45db63[_0xc149('0xe9')]=_0xc149('0x110');_0x45db63['membername']=_0xc149('0x111');this['createHistory'](_0x45db63)['catch'](loggerCatch(_0xc149('0x10e')));this['moveContactManagedDialer'](_0x45db63)[_0xc149('0xb6')](loggerCatch(_0xc149('0x10f')));}if(_0x104be0&&_0x104be0[_0xc149('0x57')]!==_0xc149('0x7f')&&!isNotNull(this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]][_0xc149('0x112')])){delete this[_0xc149('0xe2')][_0x811d6b[_0xc149('0xe3')]];this[_0xc149('0xb8')](this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]]);this[_0xc149('0x21')][_0x104be0[_0xc149('0xb9')]][_0xc149('0x6b')]+=0x1;_0x45db63=new Hangup(_0x104be0,_0x811d6b);_0x45db63[_0xc149('0x108')]=0xc;_0x45db63[_0xc149('0xe9')]=_0x811d6b[_0xc149('0x113')];_0x45db63[_0xc149('0xeb')]=_0xc149('0x114');this[_0xc149('0xd1')](_0x45db63)[_0xc149('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc149('0xe1')](_0x45db63)[_0xc149('0xb6')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc149('0xb0')]['syncAgentComplete']=function(_0xa9123d){var _0x302fcc=this[_0xc149('0xe2')][_0xa9123d[_0xc149('0xe3')]];var _0x1ead91=this;if(this['voiceQueues'][_0xa9123d[_0xc149('0xb9')]]){if(_0x302fcc&&_0x302fcc[_0xc149('0x57')]!==_0xc149('0x7f')){delete this['uniqueId'][_0xa9123d[_0xc149('0xe3')]];this['voiceQueues'][_0xa9123d['queue']][_0xc149('0x115')]+=0x1;var _0x42ac94=new AgentComplete(_0x302fcc,_0xa9123d);if(_0xa9123d['reason']===_0xc149('0x116')){_0x42ac94[_0xc149('0x117')]=this[_0xc149('0x21')][_0xa9123d[_0xc149('0xb9')]][_0xc149('0x118')]&&this[_0xc149('0x21')][_0xa9123d[_0xc149('0xb9')]][_0xc149('0x119')]?moment()[_0xc149('0x7c')](_0xc149('0x102')):undefined;}this[_0xc149('0xd1')](_0x42ac94)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11a')));this[_0xc149('0xe1')](_0x42ac94)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11b')));}}};Dialer[_0xc149('0xb0')]['syncAgentConnect']=function(_0x56b090){if(this[_0xc149('0x21')][_0x56b090[_0xc149('0xb9')]]){if(this['uniqueId'][_0x56b090[_0xc149('0xe3')]]&&this[_0xc149('0xe2')][_0x56b090['uniqueid']]['type']!=='ivr'){this[_0xc149('0xb8')](this[_0xc149('0x21')][_0x56b090['queue']]);this['uniqueId'][_0x56b090[_0xc149('0xe3')]][_0xc149('0x11c')]=moment()[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xc149('0x11d')]=function(_0x2b14ae){this['createHistory'](_0x2b14ae)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11a')));this[_0xc149('0xe1')](_0x2b14ae)[_0xc149('0xb6')](loggerCatch(_0xc149('0x11e')));};Dialer[_0xc149('0xb0')][_0xc149('0x11f')]=function(_0x2652d2){var _0x1f8113=this['uniqueId'][_0x2652d2['uniqueid']];var _0x2aa18f=this;if(this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]]){if(_0x1f8113&&_0x1f8113[_0xc149('0x57')]!==_0xc149('0x7f')){delete this[_0xc149('0xe2')][_0x2652d2[_0xc149('0xe3')]];this['updateOriginated'](this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]]);_0x1f8113[_0xc149('0x120')]=moment()[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4f8d61=new QueueCallerAbandon(_0x1f8113,_0x2652d2);if(getSeconds(_0x1f8113[_0xc149('0x120')],_0x1f8113[_0xc149('0x121')])>=_0x1f8113['dialQueueTimeout']){this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x6f')]+=0x1;this[_0xc149('0x21')][_0x2652d2['queue']][_0xc149('0x122')]+=0x1;this['voiceQueues'][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x123')]+=0x1;_0x4f8d61['state']=0xa;_0x4f8d61[_0xc149('0xe9')]=_0xc149('0x124');_0x4f8d61[_0xc149('0x125')]=_0xc149('0x126');_0x4f8d61[_0xc149('0x117')]=this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x118')]?moment()['format'](_0xc149('0x102')):undefined;_0x4f8d61[_0xc149('0xf9')]+=0x1;_0x4f8d61['countglobal']+=0x1;if(_0x4f8d61[_0xc149('0xf9')]>=this['voiceQueues'][_0x2652d2[_0xc149('0xb9')]]['dialDropMaxRetry']){this[_0xc149('0x11d')](_0x4f8d61);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4f8d61['countdropretry'],'scheduledat':moment()[_0xc149('0x101')](this[_0xc149('0x21')][_0x2652d2['queue']][_0xc149('0x127')],_0xc149('0x128'))[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1f8113[_0xc149('0xd8')],'ListId':_0x1f8113[_0xc149('0xd9')],'VoiceQueueId':_0x1f8113[_0xc149('0x103')]||undefined,'CampaignId':_0x1f8113[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x129')));var _0x364637=new History(_0x4f8d61);_0x364637[_0xc149('0x108')]=0xa;_0x364637[_0xc149('0xe9')]=_0xc149('0x124');_0x364637[_0xc149('0xaf')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));_0x364637[_0xc149('0xae')]=_0x364637[_0xc149('0xaf')];_0x364637[_0xc149('0x12a')]=_0x4f8d61[_0xc149('0x12a')];_0x364637['calleridnum']=_0x4f8d61[_0xc149('0x12b')];this[_0xc149('0xd1')](_0x364637)[_0xc149('0xb6')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x6e')]+=0x1;this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x65')]+=0x1;_0x4f8d61[_0xc149('0x108')]=0xb;_0x4f8d61[_0xc149('0xe9')]=_0xc149('0x12c');_0x4f8d61[_0xc149('0x125')]=_0xc149('0x12d');_0x4f8d61[_0xc149('0xfa')]+=0x1;_0x4f8d61[_0xc149('0xf3')]+=0x1;if(_0x4f8d61['countabandonedretry']>=this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x12e')]){this[_0xc149('0x11d')](_0x4f8d61);}else{this[_0xc149('0xc6')]({'active':![],'countabandonedretry':_0x4f8d61['countabandonedretry'],'scheduledat':moment()[_0xc149('0x101')](this[_0xc149('0x21')][_0x2652d2[_0xc149('0xb9')]][_0xc149('0x12f')],_0xc149('0x128'))[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1f8113[_0xc149('0xd8')],'ListId':_0x1f8113[_0xc149('0xd9')],'VoiceQueueId':_0x1f8113[_0xc149('0x103')]||undefined,'CampaignId':_0x1f8113['CampaignId']||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x364637=new History(_0x4f8d61);_0x364637['state']=0xb;_0x364637[_0xc149('0xe9')]=_0xc149('0x12c');_0x364637['starttime']=moment()[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x364637[_0xc149('0xae')]=_0x364637[_0xc149('0xaf')];_0x364637[_0xc149('0x12a')]=_0x4f8d61[_0xc149('0x12a')];_0x364637[_0xc149('0x12b')]=_0x4f8d61[_0xc149('0x12b')];this[_0xc149('0xd1')](_0x364637)[_0xc149('0xb6')](loggerCatch(_0xc149('0x130')));}}}}};Dialer['prototype'][_0xc149('0x131')]=function(_0x4fc5c8){if(this['actions'][_0x4fc5c8[_0xc149('0xe3')]]){this[_0xc149('0x27')][_0x4fc5c8[_0xc149('0xe3')]][_0xc149('0xb5')]=_0x4fc5c8['channel'];}if(this[_0xc149('0xe2')][_0x4fc5c8[_0xc149('0xe3')]]){this[_0xc149('0xe2')][_0x4fc5c8[_0xc149('0xe3')]][_0xc149('0xb5')]=_0x4fc5c8['channel'];}};Dialer[_0xc149('0xb0')]['syncQueueMember']=function(_0x3b487e){if(strategy[this[_0xc149('0x21')][this['actions'][_0x3b487e['actionid']][_0xc149('0xb9')]][_0xc149('0x4e')]]===_0xc149('0x132')){if(this['actions'][_0x3b487e[_0xc149('0x133')]]&&_[_0xc149('0xb3')](this[_0xc149('0x27')][_0x3b487e['actionid']][_0xc149('0x134')])&&_0x3b487e['status']==='1'&&_0x3b487e[_0xc149('0x135')]==='0'){if(this[_0xc149('0x23')][_0x3b487e[_0xc149('0x136')]]){if(!this[_0xc149('0x23')][_0x3b487e['stateinterface']]['locked']){this[_0xc149('0x23')][_0x3b487e['stateinterface']]['locked']=!![];this[_0xc149('0x27')][_0x3b487e['actionid']][_0xc149('0x134')]=!![];this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]][_0xc149('0x136')]=_0x3b487e['stateinterface'];}}}}else if((strategy[this[_0xc149('0x21')][this[_0xc149('0x27')][_0x3b487e['actionid']][_0xc149('0xb9')]][_0xc149('0x4e')]]||_0xc149('0x1b'))==='rrmemory'){if(this[_0xc149('0x27')][_0x3b487e['actionid']]){if(this[_0xc149('0x23')][_0x3b487e['stateinterface']]){this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]]['stateinterface']=_0x3b487e[_0xc149('0x136')];if(_[_0xc149('0xb3')](this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]][_0xc149('0xb9')]])){this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x3b487e[_0xc149('0x133')]][_0xc149('0xb9')]]=[];}this['queueBooked'][this['actions'][_0x3b487e[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x137')](_[_0xc149('0x95')](_[_0xc149('0xd7')](this['actions'][_0x3b487e[_0xc149('0x133')]],[_0xc149('0x138'),'stateinterface']),{'status':_0x3b487e[_0xc149('0xb4')],'paused':_0x3b487e[_0xc149('0x135')]}));}}}};function unlockQueueStatus(_0x872a33,_0x24772d){setTimeout(function(){if(_[_0xc149('0x3e')](_0x872a33[_0xc149('0x139')])){loggerBooked['error'](_0xc149('0x13a'),_0x24772d);}_0x872a33[_0xc149('0x139')]=!![];loggerBooked[_0xc149('0x83')](_0xc149('0x13b'),_0x24772d,JSON['stringify'](_[_0xc149('0xd7')](_0x872a33,[_0xc149('0x40'),_0xc149('0x139')])));},0x1f3);}Dialer[_0xc149('0xb0')]['syncQueueStatusComplete']=function(_0x5355f1){var _0x165148=this;var _0x38ba64=_0x165148[_0xc149('0x21')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]];if(strategy[this[_0xc149('0x21')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']][_0xc149('0x4e')]]===_0xc149('0x132')){if(this['actions'][_0x5355f1[_0xc149('0x133')]]&&this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0x136')]){this[_0xc149('0x20')]['run'](this['actions'][_0x5355f1[_0xc149('0x133')]]['idHopper'],this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['stateinterface'])[_0xc149('0xb6')](function(_0x4649ce){logger[_0xc149('0x9d')](_0xc149('0x13c'),util[_0xc149('0x9c')](_0x4649ce,{'showHidden':![],'depth':null}));})[_0xc149('0x1e')](function(){_0x165148['updateOriginated'](_0x165148[_0xc149('0x21')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]);_0x165148[_0xc149('0x23')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0x136')]]['locked']=![];delete _0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);});}else{this[_0xc149('0xb8')](this[_0xc149('0x21')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]);this[_0xc149('0xc6')]({'active':![],'ContactId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['ContactId'],'ListId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['ListId'],'VoiceQueueId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0x103')]||undefined,'CampaignId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x13d')));delete this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);}}else if((strategy[this[_0xc149('0x21')][this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x4e')]]||_0xc149('0x1b'))===_0xc149('0x1b')){var _0x1005d9;if(this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]&&!_[_0xc149('0x82')](this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']])){if(this['queueBookedRR'][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]){this[_0xc149('0x2d')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]=this[_0xc149('0x2d')][this[_0xc149('0x27')][_0x5355f1['actionid']][_0xc149('0xb9')]]?this['queueBookedRR'][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]:this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]?this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]['_rr']||0x0:0x0;}this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x13e')]=this[_0xc149('0x2d')][this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]];for(var _0x160e6a=0x0;_0x160e6a<this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]][_0xc149('0x9f')];_0x160e6a+=0x1){_0x1005d9=rr(this[_0xc149('0x2c')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['queue']]);this[_0xc149('0x2d')][_0x165148[_0xc149('0x27')][_0x5355f1['actionid']][_0xc149('0xb9')]]=this[_0xc149('0x2c')][this['actions'][_0x5355f1[_0xc149('0x133')]]['queue']]['_rr'];if(_0x1005d9[_0xc149('0xb4')]==='1'&&_0x1005d9[_0xc149('0x135')]==='0'){break;}}if(!_[_0xc149('0xb3')](_0x1005d9)){this[_0xc149('0x23')][_0x1005d9[_0xc149('0x136')]][_0xc149('0x13f')]=_['isUndefined'](this[_0xc149('0x23')][_0x1005d9[_0xc149('0x136')]][_0xc149('0x13f')])?!![]:this[_0xc149('0x23')][_0x1005d9[_0xc149('0x136')]][_0xc149('0x13f')];}loggerBooked[_0xc149('0x83')](_0xc149('0x140'),_0x5355f1[_0xc149('0x133')],_0xc149('0x141'),JSON[_0xc149('0x7a')](_[_0xc149('0xd7')](this[_0xc149('0x23')][_0x1005d9[_0xc149('0x136')]],['name',_0xc149('0x13f')])),_0xc149('0x142'),JSON[_0xc149('0x7a')](_0x1005d9[_0xc149('0x138')]));if(!_[_0xc149('0xb3')](_0x1005d9)&&_0x1005d9[_0xc149('0xb4')]==='1'&&_0x1005d9[_0xc149('0x135')]==='0'&&this['agents'][_0x1005d9[_0xc149('0x136')]]['unlockRR']){this[_0xc149('0x23')][_0x1005d9[_0xc149('0x136')]][_0xc149('0x13f')]=![];this['queueBooked'][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]=[];this[_0xc149('0x20')][_0xc149('0x143')](_0x1005d9[_0xc149('0x138')],_0x1005d9[_0xc149('0x136')])['catch'](function(_0x4b4d2a){logger[_0xc149('0x9d')](_0xc149('0x13c'),util[_0xc149('0x9c')](_0x4b4d2a,{'showHidden':![],'depth':null}));})['finally'](function(){_0x165148[_0xc149('0xb8')](_0x165148[_0xc149('0x21')][_0x165148[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]);setTimeout(function(){_0x165148[_0xc149('0x23')][_0x1005d9['stateinterface']][_0xc149('0x13f')]=!![];loggerBooked[_0xc149('0x83')](_0xc149('0x144'),_0x5355f1[_0xc149('0x133')],'Agent:\x20',JSON['stringify'](_['pick'](_0x165148[_0xc149('0x23')][_0x1005d9[_0xc149('0x136')]],['name',_0xc149('0x13f')])),_0xc149('0x142'),JSON[_0xc149('0x7a')](_0x1005d9[_0xc149('0x138')]));},0xc7);delete _0x165148['actions'][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64,_0x5355f1[_0xc149('0x133')]);});}else{loggerBooked['info'](_0xc149('0x145'));this['updateOriginated'](this[_0xc149('0x21')][this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]);this[_0xc149('0xc6')]({'active':![],'ContactId':this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xd8')],'ListId':this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xd9')],'VoiceQueueId':this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0x103')]||undefined,'CampaignId':this[_0xc149('0x27')][_0x5355f1['actionid']][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x13d')));delete this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);}}else{loggerBooked[_0xc149('0x83')](_0xc149('0x146'));this[_0xc149('0xb8')](this[_0xc149('0x21')][this[_0xc149('0x27')][_0x5355f1['actionid']]['queue']]);this[_0xc149('0xc6')]({'active':![],'ContactId':this[_0xc149('0x27')][_0x5355f1['actionid']][_0xc149('0xd8')],'ListId':this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xd9')],'VoiceQueueId':this['actions'][_0x5355f1['actionid']][_0xc149('0x103')]||undefined,'CampaignId':this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);}}else{loggerBooked['info'](_0xc149('0x147'));this[_0xc149('0xb8')](this[_0xc149('0x21')][this['actions'][_0x5355f1[_0xc149('0x133')]][_0xc149('0xb9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xd8')],'ListId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xd9')],'VoiceQueueId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]][_0xc149('0xdb')]||undefined})['catch'](loggerCatch(_0xc149('0x148')));delete this[_0xc149('0x27')][_0x5355f1[_0xc149('0x133')]];unlockQueueStatus(_0x38ba64);}};Dialer['prototype'][_0xc149('0x3d')]=function(){var _0x5ae871=this;setInterval(function(){_0x5ae871[_0xc149('0x149')]();},0x3e8);};Dialer['prototype'][_0xc149('0x14a')]=function(_0x29a41){var _0x2974cf=this;return function(){if(!_0x2974cf[_0xc149('0xdf')](_0x29a41['Trunk'])){if(!_0x2974cf['isTrunkReachable'](_0x29a41['TrunkBackup'])){_0x29a41[_0xc149('0x42')]=_0xc149('0x14b');throw _0x29a41[_0xc149('0x40')]+_0xc149('0x14c');}}};};Dialer[_0xc149('0xb0')][_0xc149('0x14d')]=function(_0x401bf3,_0x37c928,_0x52858c,_0x9eead3){var _0x5ebace=this;return function(){var _0xb0c568=!![];return _0x5ebace[_0xc149('0x14e')](_0x401bf3,_0x37c928,_0x52858c,_0x9eead3,_0xb0c568);};};Dialer[_0xc149('0xb0')][_0xc149('0x14f')]=function(_0x277f89,_0x5c5c8c,_0x27281f,_0x92ee7d){var _0x1ca8ca=this;return function(){var _0x5c39f3=![];return _0x1ca8ca[_0xc149('0x14e')](_0x277f89['Intervals'],_0x5c5c8c,_0x27281f,_0x92ee7d,_0x5c39f3);};};Dialer[_0xc149('0xb0')][_0xc149('0x14e')]=function(_0x126793,_0x5c478c,_0x330c69,_0xbf81c5,_0x403a38){var _0x48063c=[];return new BPromise(function(_0x4aa6c2,_0x40ae61){if(!isNotNull(_0x126793)){_0xbf81c5[_0xc149('0x42')]=_0xc149('0x45');return _0x40ae61(msgResponse(_0xc149('0x14e'),_0xc149('0x150'),_0x330c69+_0xc149('0x151')));}if(_[_0xc149('0x82')](_0x126793)){_0xbf81c5[_0xc149('0x42')]='INTERVAL_IS_EMPTY';return _0x40ae61(msgResponse(_0xc149('0x14e'),'Failure',_0x330c69+_0xc149('0x152')));}if(_0x5c478c&&_['isUndefined'](config[_0xc149('0x153')][_0x5c478c])){_0xbf81c5['message']=_0xc149('0x154');return _0x40ae61(msgResponse(_0xc149('0x14e'),'Failure',_0x330c69+'\x20Timezone\x20unknow\x20'+_0x5c478c));}if(_[_0xc149('0x155')](_0x126793)){for(var _0x3f2af1=0x0;_0x3f2af1<_0x126793[_0xc149('0x9f')];_0x3f2af1+=0x1){_0x48063c[_0xc149('0x137')](ami[_0xc149('0x156')]({'action':_0xc149('0x157'),'command':util[_0xc149('0x7c')](_0xc149('0x158'),_0x126793[_0x3f2af1]['interval'],!_[_0xc149('0x3e')](config[_0xc149('0x153')][_0x5c478c])?_0x5c478c:'')})[_0xc149('0xbf')](function(_0x2b43fd){return _0x2b43fd[_0xc149('0x159')][_0xc149('0x15a')](_0xc149('0x15b'))>=0x0;})[_0xc149('0xb6')](myreject(_0x40ae61)));}}else{_0x48063c['push'](ami[_0xc149('0x156')]({'action':_0xc149('0x157'),'command':util[_0xc149('0x7c')]('iftime\x20%s,%s',_0x126793,!_[_0xc149('0x3e')](config[_0xc149('0x153')][_0x5c478c])?_0x5c478c:'')})['then'](function(_0x3184dd){return _0x3184dd[_0xc149('0x159')][_0xc149('0x15a')](_0xc149('0x15b'))>=0x0;})[_0xc149('0xb6')](myreject(_0x40ae61)));}BPromise[_0xc149('0x15c')](_0x48063c)[_0xc149('0xbf')](function(_0x58774b){var _0x3c5932=_[_0xc149('0x15d')](_0x58774b);if(_0x3c5932){return _0x4aa6c2(_0x3c5932);}else{_0xbf81c5[_0xc149('0x42')]=_0x403a38?_0xc149('0x15e'):_0xc149('0x15f');return _0x40ae61(msgResponse('[ifTime][promiseAll]',_0xc149('0x150'),_0xc149('0x160')+_0x403a38+'\x20'+_0x330c69+_0xc149('0x161')+util[_0xc149('0x9c')](_0x126793,{'showHidden':![],'depth':null})+_0xc149('0x162')+_0x5c478c));}})[_0xc149('0xb6')](function(_0x571b0f){return _0x40ae61(msgResponse('ifTime','Failure',JSON[_0xc149('0x7a')](_0x571b0f)));});});};Dialer[_0xc149('0xb0')][_0xc149('0x163')]=function(_0x315c89){var _0x5aa373=this;return function(){switch(_0x315c89[_0xc149('0x164')]){case _0xc149('0x165'):freeVariablesPredictive(_0x315c89);_0x5aa373[_0xc149('0x166')](_0x315c89,0x1);break;case'power':freeVariablesPredictive(_0x315c89);_0x5aa373[_0xc149('0x166')](_0x315c89,_0x315c89[_0xc149('0x167')]);break;case _0xc149('0x168'):_0x5aa373[_0xc149('0x168')](_0x315c89);break;case'booked':freeVariablesPredictive(_0x315c89);_0x5aa373[_0xc149('0x166')](_0x315c89,0x1);break;default:freeVariablesPredictive(_0x315c89);logger[_0xc149('0x9d')](_0xc149('0x169'),_0x315c89[_0xc149('0x40')],_0xc149('0x16a'));}};};Dialer[_0xc149('0xb0')]['launchHandleIvr']=function(_0x82612c){var _0x403144=this;return function(){_0x403144[_0xc149('0x16b')](_0x82612c);};};Dialer[_0xc149('0xb0')][_0xc149('0xb')]=function(_0x3c3002){var _0x4fde28=this;if(isNotPreview(_0x3c3002[_0xc149('0x164')])){if(isVoiceQueueOutbound(_0x3c3002[_0xc149('0x57')])&&isActive(_0x3c3002['dialActive'])){_0x3c3002[_0xc149('0xa8')]=!![];BPromise[_0xc149('0xbc')]()[_0xc149('0xbf')](checkIsLoggedIn(_0x3c3002,_0x3c3002[_0xc149('0x51')]))[_0xc149('0xbf')](checkIsActive(_0x3c3002,_0x3c3002[_0xc149('0x5b')]))['then'](checkInterval(_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x14a')](_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x14d')](_0x3c3002[_0xc149('0x16c')],_0x3c3002['dialTimezone'],_0x3c3002[_0xc149('0x40')],_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x14f')](_0x3c3002[_0xc149('0x44')],_0x3c3002[_0xc149('0x16d')],_0x3c3002[_0xc149('0x40')],_0x3c3002))[_0xc149('0xbf')](_0x4fde28[_0xc149('0x163')](_0x3c3002))[_0xc149('0xb6')](loggerCatchQueueSummary('[syncQueueSummary]',_0x3c3002));}else{notSendMessagesQueue(_0x3c3002);}}else{freeVariablesPredictive(_0x3c3002);}};Dialer[_0xc149('0xb0')]['syncCampaigns']=function(){var _0x17bbe0=this;var _0x4a7efc;for(var _0xeadd8d in this[_0xc149('0x22')]){if(typeof this[_0xc149('0x22')][_0xeadd8d]!==_0xc149('0xa0')){_0x4a7efc=this['campaigns'][_0xeadd8d];if(isCampaignIvr(_0x4a7efc[_0xc149('0x57')])&&isActive(_0x4a7efc['active'])){_0x4a7efc[_0xc149('0xa8')]=!![];BPromise[_0xc149('0xbc')]()['then'](checkIsActive(_0x4a7efc,_0x4a7efc[_0xc149('0x79')]))[_0xc149('0xbf')](checkInterval(_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0[_0xc149('0x14a')](_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0['checkIfTime'](_0x4a7efc[_0xc149('0x16c')],_0x4a7efc[_0xc149('0x16d')],_0x4a7efc[_0xc149('0x40')],_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0[_0xc149('0x14f')](_0x4a7efc[_0xc149('0x44')],_0x4a7efc[_0xc149('0x16d')],_0x4a7efc[_0xc149('0x40')],_0x4a7efc))[_0xc149('0xbf')](_0x17bbe0[_0xc149('0x16e')](_0x4a7efc))[_0xc149('0xb6')](loggerCatchQueueSummary('[syncCampaigns]',_0x4a7efc));}else{notSendMessagesCampaign(_0x4a7efc);}}}};function getCallerIdRandom(_0x2a3cdd,_0x1cbfb6){var _0x5282f7;var _0xbd8a3f;var _0x12e8f2;if(_0x1cbfb6<=0x0){_0x1cbfb6=0x1;}_0x5282f7=new RegExp(_0xc149('0x16f')+_0x1cbfb6+'}$');_0xbd8a3f=Math[_0xc149('0x170')](0xa,_0x1cbfb6-0x1);_0x12e8f2=Math['pow'](0xa,_0x1cbfb6)-0x1;return util[_0xc149('0x7c')]('%s',_[_0xc149('0x171')](_0x2a3cdd,_0x5282f7,_[_0xc149('0x172')](_0xbd8a3f,_0x12e8f2)));}function extractCalleridName(_0xe6ccf3){var _0x4ff64b=_0xe6ccf3['match'](/"(.*?)"/);return _0x4ff64b?_0x4ff64b[0x1]:_0xe6ccf3;}function extractCalleridNumber(_0x341d7a){var _0x21959b=_0x341d7a[_0xc149('0x173')](/<(.*?)>/);return _0x21959b?_0x21959b[0x1]:_0x341d7a;}Dialer[_0xc149('0xb0')][_0xc149('0x174')]=function(_0x5b9280,_0x52aee4){var _0x91e06=this;var _0x229040=uuid['v4']();this[_0xc149('0x27')][_0x229040]=new Action(_0x5b9280,_0x52aee4,_0x229040);return new BPromise(function(_0x212592,_0x2671f3){if(_[_0xc149('0x3e')](_0x5b9280)&&typeof _0x5b9280!=='object'){return _0x2671f3(msgResponse('originate',_0xc149('0x150'),_0xc149('0x175')));}if(_[_0xc149('0x3e')](_0x52aee4[_0xc149('0x176')][_0xc149('0x177')])||_0x52aee4[_0xc149('0x176')][_0xc149('0x177')]===null){return _0x2671f3(msgResponse(_0xc149('0x178'),'Failure',_0xc149('0x179')));}var _0x47b699={'XMD-CALLERID':_0x91e06['actions'][_0x229040][_0xc149('0x17a')](),'XMD-AGI':_0x5b9280[_0xc149('0x112')]?util[_0xc149('0x7c')](_0xc149('0x17b'),ipAgi,_0x5b9280['dialQueueProject']):_0xc149('0x17c'),'XMD-AGIAFTER':_0x5b9280[_0xc149('0x118')]?util[_0xc149('0x7c')](_0xc149('0x17b'),ipAgi,_0x5b9280[_0xc149('0x118')]):_0xc149('0x17c'),'XMD-QUEUE':_0x5b9280[_0xc149('0x57')]===_0xc149('0x17d')?util['format'](_0xc149('0x17e'),_0x5b9280[_0xc149('0x40')],_0x5b9280['dialQueueOptions']||'',_0x5b9280[_0xc149('0x119')]?'c':'',_0x5b9280['dialQueueTimeout']||0x3):_0xc149('0x17c'),'XMD-CONTACTID':_0x52aee4['ContactId'],'XMD-CDRTYPE':_0xc149('0x8'),'CALLERID(all)':_0x91e06[_0xc149('0x27')][_0x229040][_0xc149('0x17a')](),'XMD-AMD':_0x5b9280[_0xc149('0xe6')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xc149('0xe5')};if(_0x5b9280['dialAMDActive']){_0x47b699[_0xc149('0x17f')]=_0x5b9280[_0xc149('0x180')]||0x9c4;_0x47b699[_0xc149('0x181')]=_0x5b9280[_0xc149('0x182')]||0x5dc;_0x47b699[_0xc149('0x183')]=_0x5b9280[_0xc149('0x184')]||0x320;_0x47b699[_0xc149('0x185')]=_0x5b9280[_0xc149('0x186')]||0x1388;_0x47b699['XMD-AMDMINWORDLENGTH']=_0x5b9280[_0xc149('0x187')]||0x64;_0x47b699[_0xc149('0x188')]=_0x5b9280[_0xc149('0x189')]||0x32;_0x47b699[_0xc149('0x18a')]=_0x5b9280[_0xc149('0x18b')]||0x3;_0x47b699[_0xc149('0x18c')]=_0x5b9280['dialAMDSilenceThreshold']||0x100;_0x47b699[_0xc149('0x18d')]=_0x5b9280[_0xc149('0x18e')]||0x1388;}if(_0x5b9280[_0xc149('0x57')]==='outbound'){_0x47b699[_0xc149('0x18f')]=_0x52aee4['VoiceQueueId'];}else{_0x47b699[_0xc149('0x190')]=_0x52aee4['CampaignId'];}for(var _0x2dbf58 in _0x52aee4[_0xc149('0x176')]){if(typeof _0x52aee4['Contact'][_0x2dbf58]!==_0xc149('0xa0')){if(isNotNull(_0x52aee4[_0xc149('0x176')][_0x2dbf58])&&_0x2dbf58!=='id'&&_0x2dbf58!=='tags'&&_0x2dbf58!==_0xc149('0x191')&&_0x2dbf58!==_0xc149('0x192')){_0x47b699[util[_0xc149('0x7c')](_0xc149('0x193'),'XMD-',_[_0xc149('0x194')](_0x2dbf58))]=_0x52aee4[_0xc149('0x176')][_0x2dbf58];}}}var _0x780508=_0x91e06[_0xc149('0xdf')](_0x5b9280['Trunk'])?getCallerId(_0x5b9280[_0xc149('0x78')]['callerid'],_0x5b9280[_0xc149('0x5c')],_0x5b9280[_0xc149('0x195')]>0x0?getCallerIdRandom(_0x5b9280['dialOriginateCallerIdNumber'],_0x5b9280[_0xc149('0x195')]):_0x5b9280['dialOriginateCallerIdNumber']):getCallerId(_[_0xc149('0xb3')](_0x5b9280[_0xc149('0x196')])?_0x5b9280[_0xc149('0x78')][_0xc149('0x197')]:_0x5b9280[_0xc149('0x196')][_0xc149('0x197')],_0x5b9280['dialOriginateCallerIdName'],_0x5b9280[_0xc149('0x195')]>0x0?getCallerIdRandom(_0x5b9280[_0xc149('0x5d')],_0x5b9280['dialRandomLastDigitCallerIdNumber']):_0x5b9280[_0xc149('0x5d')]);if(_0x780508){_0x47b699[_0xc149('0x198')]=_0x91e06[_0xc149('0x27')][_0x229040]['originatecalleridname']=extractCalleridName(_0x780508);_0x47b699[_0xc149('0x199')]=_0x91e06[_0xc149('0x27')][_0x229040]['originatecalleridnum']=extractCalleridNumber(_0x780508);}return ami[_0xc149('0x156')]({'actionid':_0x229040,'action':'originate','channel':_0x91e06[_0xc149('0xdf')](_0x5b9280[_0xc149('0x78')])?util[_0xc149('0x7c')](_0xc149('0x19a'),_0x5b9280[_0xc149('0x78')][_0xc149('0x40')],isNotNull(_0x5b9280[_0xc149('0x5f')])?_0x5b9280[_0xc149('0x5f')]['trim']()||'':'',_0x5b9280[_0xc149('0x19b')]>0x0?_0x52aee4[_0xc149('0x176')][_0xc149('0x177')][_0xc149('0x19c')](_0x5b9280[_0xc149('0x19b')]):_0x52aee4[_0xc149('0x176')]['phone']):util[_0xc149('0x7c')](_0xc149('0x19a'),_[_0xc149('0xb3')](_0x5b9280['TrunkBackup'])?_0x5b9280[_0xc149('0x78')]['name']:_0x5b9280[_0xc149('0x196')][_0xc149('0x40')],isNotNull(_0x5b9280[_0xc149('0x5f')])?_0x5b9280['dialPrefix'][_0xc149('0x19d')]()||'':'',_0x5b9280[_0xc149('0x19b')]>0x0?_0x52aee4['Contact'][_0xc149('0x177')]['substring'](_0x5b9280['dialCutDigit']):_0x52aee4[_0xc149('0x176')][_0xc149('0x177')]),'callerid':_0x780508,'Exten':'xcally-motion-dialer','Context':_0xc149('0x19e'),'Priority':'1','variable':_0x47b699,'timeout':(_0x5b9280[_0xc149('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x229040})['then'](function(_0x280669){return _0x212592(_0x280669);})['catch'](function(_0x471fe2){_0x5b9280[_0xc149('0x68')]+=0x1;var _0x40fa2=new History(_0x91e06[_0xc149('0x27')][_0x229040]);logger[_0xc149('0x9d')](util['format'](_0xc149('0x19f'),JSON[_0xc149('0x7a')](_0x471fe2)));_0x40fa2['state']=0xe;_0x40fa2[_0xc149('0xe9')]=_0xc149('0x1a0');_0x40fa2[_0xc149('0xaf')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));_0x40fa2[_0xc149('0xae')]=_0x40fa2[_0xc149('0xaf')];_0x91e06[_0xc149('0xd1')](_0x40fa2)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1a1')));_0x91e06[_0xc149('0xe1')](_0x40fa2)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1a1')))['finally'](function(){delete _0x91e06[_0xc149('0x27')][_0x229040];return _0x2671f3(msgResponse(_0xc149('0x178'),_0xc149('0x49'),_0xc149('0x1a2')));});});});};Dialer[_0xc149('0xb0')][_0xc149('0x1a3')]=function(_0x417479){var _0x4e0591=this[_0xc149('0x27')][_0x417479[_0xc149('0x133')]];if(_0x4e0591){delete this[_0xc149('0x27')][_0x417479[_0xc149('0x133')]];_0x4e0591[_0xc149('0x121')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));var _0x3f6631=_0x4e0591['type']==='ivr'?this['campaigns'][_0x4e0591[_0xc149('0xb9')]]:this['voiceQueues'][_0x4e0591[_0xc149('0x1a4')]()];if(!this[_0xc149('0xde')](_0x417479['response'])){this[_0xc149('0xb8')](_0x3f6631);return this['callProgressDetecting'](_0x4e0591,_0x3f6631,_0x417479)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1a5')));}this[_0xc149('0xe2')][_0x417479[_0xc149('0xe3')]]=_0x4e0591;}};Dialer[_0xc149('0xb0')][_0xc149('0x1a6')]=function(_0x124d24,_0x388816,_0x5ee6e8){var _0x654836=new History(_0x388816);if(_0x654836[_0xc149('0xf5')]+_0x654836[_0xc149('0xf6')]+_0x654836[_0xc149('0xf7')]+_0x654836['countnosuchnumberretry']+_0x654836['countdropretry']+_0x654836[_0xc149('0xfa')]+_0x654836[_0xc149('0xfd')]+_0x654836[_0xc149('0xfb')]>=_0x5ee6e8[_0xc149('0x10a')]-0x1){return!![];}switch(_0x124d24){case 0x3:if(_0x654836['countnoanswerretry']>=_0x5ee6e8[_0xc149('0x1a7')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countnoanswerretry':_0x654836[_0xc149('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x5ee6e8[_0xc149('0x1a8')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x654836[_0xc149('0xf5')]>=_0x5ee6e8[_0xc149('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x654836['countbusyretry']+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x1aa')],_0xc149('0x128'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1ab')));break;case 0x8:if(_0x654836[_0xc149('0xf6')]>=_0x5ee6e8['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x654836[_0xc149('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x5ee6e8[_0xc149('0x1ac')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836[_0xc149('0xd8')],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836['VoiceQueueId']||undefined,'CampaignId':_0x654836['CampaignId']||undefined})['catch'](loggerCatch(_0xc149('0x1ad')));break;case 0x0:if(_0x654836[_0xc149('0xf8')]>=_0x5ee6e8['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xc149('0xc6')]({'active':![],'countnosuchnumberretry':_0x654836[_0xc149('0xf8')]+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x1ae')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836[_0xc149('0xd8')],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x654836[_0xc149('0xf9')]>=_0x5ee6e8['dialDropMaxRetry']-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countdropretry':_0x654836[_0xc149('0xf9')]+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x127')],'minutes')[_0xc149('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x129')));break;case 0xb:if(_0x654836[_0xc149('0xfa')]>=_0x5ee6e8[_0xc149('0x12e')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countabandonedretry':_0x654836['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x12f')],_0xc149('0x128'))[_0xc149('0x7c')](_0xc149('0x102')),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836['VoiceQueueId']||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1af')));break;case 0x13:if(_0x654836[_0xc149('0xfd')]>=_0x5ee6e8[_0xc149('0xfe')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countmachineretry':_0x654836[_0xc149('0xfd')]+=0x1,'scheduledat':moment()[_0xc149('0x101')](_0x5ee6e8[_0xc149('0x10c')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836[_0xc149('0xd8')],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836[_0xc149('0x103')]||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x654836[_0xc149('0xfb')]>=_0x5ee6e8[_0xc149('0x1b0')]-0x1){return!![];}this[_0xc149('0xc6')]({'active':![],'countagentrejectretry':_0x654836[_0xc149('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x5ee6e8[_0xc149('0x1b1')],_0xc149('0x128'))['format'](_0xc149('0x102')),'ContactId':_0x654836['ContactId'],'ListId':_0x654836[_0xc149('0xd9')],'VoiceQueueId':_0x654836['VoiceQueueId']||undefined,'CampaignId':_0x654836[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1b2')));break;default:return!![];}};Dialer[_0xc149('0xb0')][_0xc149('0x1b3')]=function(_0x13e27d,_0x36aa25,_0x23c79f){var _0x3352fa=this;var _0x2612bf=new History(_0x13e27d);return new BPromise(function(_0x13c33e,_0x41c8c6){if(_[_0xc149('0x3e')](_0x36aa25)&&typeof _0x36aa25!=='object'){return _0x41c8c6(msgResponse('[callProgressDetecting]','Failure',_0xc149('0x1b4')));}if(_['isUndefined'](_0x23c79f)&&typeof _0x23c79f!==_0xc149('0x1b5')){return _0x41c8c6(msgResponse(_0xc149('0x1b6'),_0xc149('0x150'),_0xc149('0x1b7')));}switch(_0x23c79f['reason']){case'0':_0x36aa25['outboundNoSuchCallsDay']+=0x1;_0x2612bf[_0xc149('0x108')]=0x0;_0x2612bf[_0xc149('0xe9')]='NoSuchNumber';_0x2612bf['countnosuchnumberretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')](_0xc149('0x1b8'),ut[_0xc149('0xed')](_0x13e27d,_0xc149('0x1b9')));_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch(_0xc149('0x109')));if(_0x3352fa[_0xc149('0x1a6')](0x0,_0x13e27d,_0x36aa25)){if(_0x2612bf['countnosuchnumberretry']>=_0x36aa25[_0xc149('0x1ba')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1bb'));}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1bb'));}}break;case'3':_0x36aa25[_0xc149('0x66')]+=0x1;_0x2612bf['state']=0x3;_0x2612bf['statedesc']='NoAnswer';_0x2612bf['countnoanswerretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')](_0xc149('0x1bc'),ut['buildObj'](_0x13e27d,'noanswer'));_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch(_0xc149('0x1bd')));if(_0x3352fa['checkRetriveMax'](0x3,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf7')]>=_0x36aa25[_0xc149('0x1a7')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x203\x20ringing\x20no\x20answer');}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1be'));}}break;case'5':_0x36aa25['outboundBusyCallsDay']+=0x1;_0x2612bf[_0xc149('0x108')]=0x5;_0x2612bf[_0xc149('0xe9')]='Busy';_0x2612bf[_0xc149('0xf5')]+=0x1;_0x2612bf['countglobal']+=0x1;ami['emit'](_0xc149('0x1bf'),ut[_0xc149('0xed')](_0x13e27d,_0xc149('0x1c0')));_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch(_0xc149('0x1c1')));if(_0x3352fa['checkRetriveMax'](0x5,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf5')]>=_0x36aa25[_0xc149('0x1a9')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x205\x20busy');}else{_0x3352fa['stateGlobal'](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x205\x20busy');}}break;case'8':_0x36aa25[_0xc149('0x63')]+=0x1;_0x2612bf['state']=0x8;_0x2612bf[_0xc149('0xe9')]=_0xc149('0x1c2');_0x2612bf['countcongestionretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')](_0xc149('0x1c3'),ut['buildObj'](_0x13e27d,_0xc149('0x1c4')));_0x3352fa['createHistory'](_0x2612bf)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1c5')));if(_0x3352fa[_0xc149('0x1a6')](0x8,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf6')]>=_0x36aa25[_0xc149('0x1c6')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x208\x20congestion');}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1c7'));}}break;case'11':_0x36aa25[_0xc149('0x1c8')]+=0x1;_0x2612bf[_0xc149('0x108')]=0xb;_0x2612bf[_0xc149('0xe9')]='Abandoned';_0x2612bf['countabandonedretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;_0x3352fa[_0xc149('0xd1')](_0x2612bf)[_0xc149('0xb6')](loggerCatch(_0xc149('0x130')));if(_0x3352fa['checkRetriveMax'](0xb,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xfa')]>=_0x36aa25[_0xc149('0x12e')]){_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1c9'));}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1c9'));}}break;case'20':_0x36aa25[_0xc149('0x6a')]+=0x1;_0x2612bf[_0xc149('0x108')]=0x14;_0x2612bf[_0xc149('0xe9')]=_0xc149('0x1ca');_0x2612bf['countagentrejectretry']+=0x1;_0x2612bf[_0xc149('0xf3')]+=0x1;ami[_0xc149('0x4d')]('custom:agentreject',ut['buildObj'](_0x13e27d,_0xc149('0x1cb')));_0x3352fa['createHistory'](_0x2612bf)[_0xc149('0xb6')](loggerCatch(_0xc149('0x1cc')));if(_0x3352fa['checkRetriveMax'](0x14,_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xfb')]>=_0x36aa25[_0xc149('0x1b0')]){_0x3352fa['createStateFinal'](_0x2612bf,_0x13c33e,_0x41c8c6,'reason\x2020\x20agentreject');}else{_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0xc149('0x1cd'));}}break;default:_0x36aa25[_0xc149('0x6b')]+=0x1;_0x2612bf['state']=0xc;_0x2612bf[_0xc149('0xe9')]=_0x23c79f['reason'];_0x3352fa[_0xc149('0xd1')](_0x2612bf)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3352fa[_0xc149('0x1a6')](_0x23c79f[_0xc149('0x1ce')],_0x13e27d,_0x36aa25)){if(_0x2612bf[_0xc149('0xf5')]+_0x2612bf[_0xc149('0xf6')]+_0x2612bf[_0xc149('0xf7')]+_0x2612bf[_0xc149('0xf8')]+_0x2612bf[_0xc149('0xf9')]+_0x2612bf['countabandonedretry']+_0x2612bf[_0xc149('0xfd')]+_0x2612bf[_0xc149('0xfb')]>=_0x36aa25[_0xc149('0x10a')]){_0x3352fa[_0xc149('0xfc')](_0x2612bf,_0x13c33e,_0x41c8c6,_0x23c79f['reason']);}else{_0x3352fa[_0xc149('0xff')](_0x2612bf,_0x13c33e,_0x41c8c6,_0x23c79f[_0xc149('0x1ce')]);}}}});};Dialer[_0xc149('0xb0')][_0xc149('0xfc')]=function(_0x21eb46,_0x4d44e2,_0x2985ba,_0x3b83b4){var _0x1fff27=new Final(_0x21eb46);_0x1fff27[_0xc149('0x108')]=0xf;_0x1fff27['statedesc']=_0xc149('0x1cf');this[_0xc149('0xff')](_0x1fff27,_0x4d44e2,_0x2985ba,_0x3b83b4);};Dialer[_0xc149('0xb0')][_0xc149('0xff')]=function(_0x58a403,_0x9f52ec,_0x430ce1,_0x3023cf){this[_0xc149('0xe1')](_0x58a403)[_0xc149('0xbf')](function(){return _0x9f52ec(msgResponse(_0xc149('0x1b6'),'Success',_0x3023cf));})[_0xc149('0xb6')](function(){return _0x430ce1(msgResponse(_0xc149('0x1d0'),'Failure',_0xc149('0x1d1')));});};Dialer[_0xc149('0xb0')]['predictive']=function(_0x2bb2e2){var _0x485acd=_0x2bb2e2[_0xc149('0x1d2')]/0x64;var _0x11095f=_0x2bb2e2[_0xc149('0x122')]/(_0x2bb2e2['outboundDropCallsDayTimeout']+_0x2bb2e2[_0xc149('0x115')]);var _0x5799bb=Math[_0xc149('0x1d3')](_0x2bb2e2[_0xc149('0x72')]*(_0x2bb2e2[_0xc149('0x1d4')]/0x64));var _0x1f1e36=Math[_0xc149('0x1d3')](_0x2bb2e2[_0xc149('0x72')]*(_0x2bb2e2['predictiveIntervalMinThreshold']/0x64));var _0x110415=_0x2bb2e2[_0xc149('0x50')]+_0x2bb2e2[_0xc149('0x55')];var _0x29d28c=Math[_0xc149('0x1d5')](_0x2bb2e2['erlangCalls']*_0x2bb2e2[_0xc149('0x76')]*_0x2bb2e2[_0xc149('0x70')]*_0x2bb2e2[_0xc149('0x71')]);if(_[_0xc149('0x3e')](_0x2bb2e2[_0xc149('0x2a')])){if(!_[_0xc149('0x3e')](_0x2bb2e2[_0xc149('0x29')])){_0x2bb2e2[_0xc149('0x29')]=undefined;loggerPredictive[_0xc149('0x9d')](_0xc149('0x1d6'),_0xc149('0x1d7'));}if(!_['isUndefined'](_0x2bb2e2[_0xc149('0x98')])){loggerPredictive[_0xc149('0x9d')](_0xc149('0x1d6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2bb2e2[_0xc149('0x98')]);_0x2bb2e2[_0xc149('0x98')]=undefined;}_0x2bb2e2[_0xc149('0x2a')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));loggerPredictive[_0xc149('0x83')](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1d8'),_0x2bb2e2[_0xc149('0x2a')]);this[_0xc149('0x166')](_0x2bb2e2,0x1);}else if(ifInterval(_0x2bb2e2[_0xc149('0x1d9')],_0x2bb2e2[_0xc149('0x2a')])){this[_0xc149('0x166')](_0x2bb2e2,0x1);loggerPredictiveCalls['info'](_0xc149('0x1da'),_0x2bb2e2[_0xc149('0x2a')],_0x2bb2e2[_0xc149('0x40')]);_0x2bb2e2[_0xc149('0x91')]=0x0;_0x2bb2e2[_0xc149('0x123')]=0x0;}else if(_0x485acd<_0x11095f&&_0x2bb2e2[_0xc149('0x1db')]===_0xc149('0x1dc')){freeVariablesPredictive(_0x2bb2e2);loggerPredictive[_0xc149('0x83')](_0xc149('0x1dd'),_0xc149('0x1de'),_0x11095f,_0xc149('0x2a'),_0x2bb2e2['name']);}else if(_0x29d28c<_0x2bb2e2[_0xc149('0x123')]&&_0x2bb2e2['dialPredictiveOptimization']===_0xc149('0x1dc')){freeVariablesPredictive(_0x2bb2e2);loggerPredictive[_0xc149('0x83')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xc149('0x1df'),_0x29d28c,_0xc149('0x1e0'),_0x2bb2e2[_0xc149('0x123')],_0xc149('0x2a'),_0x2bb2e2['name']);}else if(!ifInterval(_0x2bb2e2[_0xc149('0x1d9')],_0x2bb2e2['startProgressive'])&&_[_0xc149('0x3e')](_0x2bb2e2['startPredictive'])&&!_['isUndefined'](_0x2bb2e2['startProgressive'])){_0x2bb2e2[_0xc149('0x29')]=moment()['format'](_0xc149('0x102'));loggerPredictive['info'](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1e1'),_0x2bb2e2[_0xc149('0x29')]);this[_0xc149('0x1e2')](_0x2bb2e2[_0xc149('0x1d9')])[_0xc149('0xbf')](this[_0xc149('0x1e3')](_0x2bb2e2))[_0xc149('0xbf')](mergeDataErlangB(_0x2bb2e2))[_0xc149('0xbf')](this['startMethodPredictive'](_0x2bb2e2))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2bb2e2));}else if(!ifInterval(_0x2bb2e2[_0xc149('0x1d9')],_0x2bb2e2[_0xc149('0x29')])){_0x2bb2e2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2bb2e2[_0xc149('0x29')]=moment()[_0xc149('0x7c')](_0xc149('0x102'));loggerPredictive['info'](_0x2bb2e2['name'],_0xc149('0x1e4'),_0x2bb2e2[_0xc149('0x29')]);clearInterval(_0x2bb2e2[_0xc149('0x98')]);_0x2bb2e2['handlePredictive']=undefined;this[_0xc149('0x1e2')](_0x2bb2e2['dialPredictiveInterval'])[_0xc149('0xbf')](this[_0xc149('0x1e3')](_0x2bb2e2))[_0xc149('0xbf')](mergeDataErlangB(_0x2bb2e2))['then'](this[_0xc149('0x1e5')](_0x2bb2e2))[_0xc149('0xb6')](loggerCatchPredictive(_0xc149('0x1e6'),_0x2bb2e2));}else if(_0x2bb2e2['predictiveIntervalAvailable']&&_0x110415<_0x2bb2e2[_0xc149('0x72')]-_0x1f1e36){freeVariablesPredictive(_0x2bb2e2);loggerPredictive[_0xc149('0x83')](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1e7'),_0x110415,_0xc149('0x1e8'),_0x2bb2e2['predictiveIntervalAvailable'],'-',_0x1f1e36,'=',_0x2bb2e2[_0xc149('0x72')]-_0x1f1e36,')');}else if(_0x2bb2e2['predictiveIntervalAvailable']&&_0x110415>_0x2bb2e2[_0xc149('0x72')]+_0x5799bb){freeVariablesPredictive(_0x2bb2e2);loggerPredictive['info'](_0x2bb2e2[_0xc149('0x40')],_0xc149('0x1e7'),_0x110415,_0xc149('0x1e9'),_0x2bb2e2['predictiveIntervalAvailable'],'+',_0x5799bb,'=',_0x2bb2e2[_0xc149('0x72')]+_0x5799bb,')');}};Dialer[_0xc149('0xb0')][_0xc149('0x1e3')]=function(_0x249049){var _0x51e2fd=this;return function(_0x39ccd2){return new BPromise(function(_0x4fcfcc,_0x468402){_[_0xc149('0x95')](_0x249049,_0x39ccd2[0x0]);if(checkGetDataPredictive(_0x39ccd2[0x0])){var _0x4202fb=_0x249049['predictiveIntervalAvailable']=_0x249049[_0xc149('0x55')]+_0x249049[_0xc149('0x50')];var _0xdf5c8d=_0x249049[_0xc149('0x1d9')]*0x3c;var _0x50907d=_0x39ccd2[0x0][_0xc149('0x8a')]+_0x39ccd2[0x0][_0xc149('0x6d')];var _0x20f1f1=(_0x39ccd2[0x0][_0xc149('0x6c')]+_0x39ccd2[0x0][_0xc149('0x6f')]+_0x39ccd2[0x0][_0xc149('0x6e')])/_0x39ccd2[0x0][_0xc149('0x73')];_0x249049['predictiveIntervalHitRate']=_0x20f1f1>0x0?_0x20f1f1:0x1;switch(_0x249049[_0xc149('0x1db')]){case _0xc149('0x1dc'):var _0x2bcbd7=_0x249049[_0xc149('0x1d2')]/0x64;return _0x51e2fd[_0xc149('0x1ea')](_0x4202fb,_0xdf5c8d,_0x50907d,_0x20f1f1,_0x2bcbd7)[_0xc149('0xbf')](function(_0x292da8){return _0x4fcfcc(_0x292da8);});case _0xc149('0x1eb'):var _0x4e5e46=_0x249049[_0xc149('0x1d2')]/0x64;return _0x51e2fd[_0xc149('0x1ec')](_0x4202fb,_0xdf5c8d,_0x50907d,_0x20f1f1,_0x4e5e46)[_0xc149('0xbf')](function(_0x21b51b){return _0x4fcfcc(_0x21b51b);});default:return _0x468402(msgResponse('[getDataPredictive]',_0xc149('0x150'),_0xc149('0x1ed')));}}else{return _0x468402(msgResponse(_0xc149('0x1ee'),_0xc149('0x150'),_0xc149('0x1ef')));}});};};Dialer[_0xc149('0xb0')][_0xc149('0x1f0')]=function(_0x5f5226){var _0x5664ca=this;return function(_0x4b445a){return new BPromise(function(_0x17a14c,_0x459634){_[_0xc149('0x95')](_0x5f5226,_0x4b445a[0x0]);if(checkGetDataPredictive(_0x4b445a[0x0])){loggerPredictive[_0xc149('0x83')](JSON[_0xc149('0x7a')](_0x4b445a[0x0]));if(_0x5f5226[_0xc149('0x1db')]===_0xc149('0x1dc')){return _0x5664ca['getVoiceQueueRtPauses'](_0x5f5226['id'])['then'](function(_0x3d5c87){var _0x210b0b=_0x5f5226[_0xc149('0x51')]-_0x3d5c87[0x0][_0xc149('0x1f1')];var _0x1794e7=_0x5f5226[_0xc149('0x1d9')]*0x3c;var _0x15a4a2=_0x4b445a[0x0][_0xc149('0x8a')]+_0x4b445a[0x0][_0xc149('0x6d')];var _0x4888ad=(_0x4b445a[0x0][_0xc149('0x6c')]+_0x4b445a[0x0][_0xc149('0x6f')]+_0x4b445a[0x0][_0xc149('0x6e')])/_0x4b445a[0x0][_0xc149('0x73')];var _0x5d8c7c=_0x5f5226[_0xc149('0x1d2')]/0x64;_0x5f5226[_0xc149('0x1f2')]=_0x3d5c87[0x0][_0xc149('0x1f1')]||0x0;_0x5f5226[_0xc149('0x70')]=_0x4888ad>0x0?_0x4888ad:0x1;return _0x5664ca['abandonmentRate'](_0x210b0b,_0x1794e7,_0x15a4a2,_0x4888ad,_0x5d8c7c);})[_0xc149('0xbf')](function(_0x66d205){return _0x17a14c(_0x66d205);})[_0xc149('0xb6')](function(_0x4c4f0d){return _0x459634(msgResponse('[CatchErlangB]',_0xc149('0x150'),JSON[_0xc149('0x7a')](_0x4c4f0d)));});}if(_0x5f5226[_0xc149('0x1db')]===_0xc149('0x1eb')){return _0x5664ca[_0xc149('0xce')](_0x5f5226['id'])[_0xc149('0xbf')](function(_0x4d2ced){var _0x1ae677=_0x5f5226[_0xc149('0x51')]-_0x4d2ced[0x0][_0xc149('0x1f1')];var _0x504db4=_0x5f5226[_0xc149('0x1d9')]*0x3c;var _0x253c5e=_0x4b445a[0x0][_0xc149('0x8a')]+_0x4b445a[0x0][_0xc149('0x6d')];var _0x8d3a7f=(_0x4b445a[0x0]['predictiveIntervalAnsweredCalls']+_0x4b445a[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b445a[0x0][_0xc149('0x6e')])/_0x4b445a[0x0][_0xc149('0x73')];var _0x28dff4=_0x5f5226['dialPredictiveOptimizationPercentage']/0x64;_0x5f5226[_0xc149('0x1f2')]=_0x4d2ced[0x0][_0xc149('0x1f1')]||0x0;_0x5f5226[_0xc149('0x70')]=_0x8d3a7f>0x0?_0x8d3a7f:0x1;return _0x5664ca[_0xc149('0x1ec')](_0x1ae677,_0x504db4,_0x253c5e,_0x8d3a7f,_0x28dff4);})[_0xc149('0xbf')](function(_0x3d2bee){return _0x17a14c(_0x3d2bee);})[_0xc149('0xb6')](function(_0x274bb4){return _0x459634(msgResponse('[CatchErlangB]',_0xc149('0x150'),JSON['stringify'](_0x274bb4)));});}}else{return _0x459634(msgResponse('[getDataPredictive]',_0xc149('0x150'),'check\x20failure'));}});};};Dialer['prototype'][_0xc149('0x1e5')]=function(_0x17c72e){var _0x224261=this;return function(){var _0x3dbb3f=0x0;var _0x468027=Math[_0xc149('0x1d5')](_0x17c72e[_0xc149('0x75')]*0x3e8);if(_0x468027>0x0){_0x468027=_0x468027<0x64?0x64:_0x468027;loggerPredictive[_0xc149('0x83')](_0x17c72e[_0xc149('0x40')],_0xc149('0x1f3'),_0x468027,'milliseconds');_0x17c72e['handlePredictive']=setInterval(function(){_0x224261[_0xc149('0x98')](_0x17c72e);loggerPredictiveCalls[_0xc149('0x83')](_0xc149('0x1f4'),_0x3dbb3f+=0x1);},_0x468027);}else{loggerPredictive['info'](_0x17c72e['name'],_0xc149('0x1f5'));}};};Dialer['prototype']['checkContactBlack']=function(_0x16396d,_0x3e3c20){var _0x2f4bb5=this;return function(_0x2fd400){if(_['isEmpty'](_0x2fd400)){if(_[_0xc149('0xb3')](_0x3e3c20[_0xc149('0xda')])||!_0x3e3c20[_0xc149('0x1f6')]){if(_0x16396d[_0xc149('0x164')]===_0xc149('0x9')){_0x16396d['queueStatusComplete']=_['isUndefined'](_0x16396d[_0xc149('0x139')])?!![]:_0x16396d[_0xc149('0x139')];var _0x306914=uuid['v4']();_0x2f4bb5[_0xc149('0x27')][_0x306914]=new Action(_0x16396d,_0x3e3c20,_0x306914);loggerBooked[_0xc149('0x83')]('[booked][checkContactBlack]',_0x306914,_0xc149('0x1f7'),JSON[_0xc149('0x7a')](_0x16396d[_0xc149('0x139')]),_0xc149('0x1f8'),_0x16396d[_0xc149('0x40')]);if(_0x16396d[_0xc149('0x139')]){_0x16396d[_0xc149('0x139')]=![];_0x2f4bb5[_0xc149('0x2c')][_0x2f4bb5[_0xc149('0x27')][_0x306914]['queue']]=[];ami[_0xc149('0x156')]({'actionid':_0x306914,'action':_0xc149('0x1f9'),'queue':_0x16396d[_0xc149('0x40')]})[_0xc149('0xb6')](function(){_0x2f4bb5[_0xc149('0xb8')](_0x16396d);_0x2f4bb5['rescheduleContact']({'active':![],'ContactId':_0x2f4bb5['actions'][_0x306914][_0xc149('0xd8')],'ListId':_0x2f4bb5[_0xc149('0x27')][_0x306914]['ListId'],'VoiceQueueId':_0x2f4bb5['actions'][_0x306914][_0xc149('0x103')]||undefined,'CampaignId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f4bb5[_0xc149('0x27')][_0x306914];});}else{loggerBooked['info'](_0xc149('0x1fa'),JSON[_0xc149('0x7a')](_0x16396d[_0xc149('0x139')]),_0xc149('0x1f8'),_0x16396d[_0xc149('0x40')]);_0x2f4bb5[_0xc149('0xb8')](_0x16396d);_0x2f4bb5['rescheduleContact']({'active':![],'ContactId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0xd8')],'ListId':_0x2f4bb5['actions'][_0x306914][_0xc149('0xd9')],'VoiceQueueId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0x103')]||undefined,'CampaignId':_0x2f4bb5[_0xc149('0x27')][_0x306914][_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f4bb5[_0xc149('0x27')][_0x306914];}}else{return _0x2f4bb5[_0xc149('0x174')](_0x16396d,_0x3e3c20);}}else{if(getDiff(_0x3e3c20['scheduledat'])<_0x16396d[_0xc149('0x1fb')]*0x3c){if(_0x3e3c20[_0xc149('0x1fc')]&&!_0x3e3c20[_0xc149('0x1fc')]['voicePause']){_0x2f4bb5[_0xc149('0x20')][_0xc149('0x143')](_0x3e3c20['id'])[_0xc149('0x1e')](function(){_0x2f4bb5[_0xc149('0xb8')](_0x16396d);});}else{_0x2f4bb5['unlockContact']({'active':![]},_0x3e3c20['id'],0x1)['finally'](function(){_0x2f4bb5[_0xc149('0xb8')](_0x16396d);});}}else{_0x16396d[_0xc149('0x69')]+=0x1;_0x2f4bb5[_0xc149('0xb8')](_0x16396d);if(_0x16396d['dialRecallInQueue']){_0x2f4bb5[_0xc149('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3e3c20['ContactId'],'ListId':_0x3e3c20[_0xc149('0xd9')],'VoiceQueueId':_0x3e3c20[_0xc149('0x103')]||undefined,'CampaignId':_0x3e3c20[_0xc149('0xdb')]||undefined})[_0xc149('0xb6')](loggerCatch(_0xc149('0x1fd')));_0x2f4bb5[_0xc149('0xd1')](createObjHistory(_0x16396d,_0x3e3c20,_0xc149('0x1fe'),0x17,_0xc149('0x1ff')))['catch'](loggerCatch(_0xc149('0x200')));}else{_0x2f4bb5['saveInDb'](createObjHistory(_0x16396d,_0x3e3c20,_0xc149('0x201'),0x16,_0xc149('0x202')),_0xc149('0x203'),_0xc149('0x204'));}}}}else{_0x16396d[_0xc149('0x61')]+=0x1;_0x2f4bb5[_0xc149('0xee')](createObjHistory(_0x16396d,_0x3e3c20,'BLACKLIST',0xd,_0xc149('0x205')),_0xc149('0x206'),_0xc149('0x207'));throw _0xc149('0x208');}};};Dialer[_0xc149('0xb0')][_0xc149('0x16b')]=function(_0x11ca54){var _0x4398b0=this;var _0x42044a=_0x11ca54[_0xc149('0x209')]-_0x11ca54[_0xc149('0x74')]-_0x11ca54[_0xc149('0xca')];emitCampaignSummary(_0x11ca54);if(_0x42044a>0x0){if(_0x42044a>this['maxNumberOriginate']){_0x42044a=this[_0xc149('0x25')];}_0x11ca54['temp']+=_0x42044a;this[_0xc149('0xcc')](_0x11ca54['id'],_0x42044a,_0x11ca54[_0xc149('0x20a')],_0x11ca54)[_0xc149('0xbf')](function(_0x3582eb){_0x11ca54['temp']-=_0x42044a;_0x11ca54[_0xc149('0xca')]=_0x11ca54['temp']>0x0?_0x11ca54[_0xc149('0xca')]:0x0;if(!checkContactEmpty(_0x3582eb)){_0x11ca54[_0xc149('0x42')]=_0xc149('0xa6');logger[_0xc149('0x83')](_0xc149('0x20b')+_0x11ca54[_0xc149('0x40')]);}else{_0x11ca54['originated']+=_0x3582eb['length'];_0x11ca54[_0xc149('0x42')]=_0xc149('0x20c');for(var _0x49f184=0x0;_0x49f184<_0x3582eb[_0xc149('0x9f')];_0x49f184+=0x1){_0x11ca54[_0xc149('0x20d')]+=0x1;if(_[_0xc149('0xb3')](_0x3582eb[_0x49f184])||_[_0xc149('0xb3')](_0x3582eb[_0x49f184]['Contact'])||_['isNil'](_0x3582eb[_0x49f184][_0xc149('0x176')][_0xc149('0x177')])){_0x4398b0[_0xc149('0xd5')](_0xc149('0x20e'),_0x11ca54,_0x3582eb[_0x49f184]);}else{_0x4398b0[_0xc149('0xc2')](_[_0xc149('0xd7')](_0x3582eb[_0x49f184],[_0xc149('0xdb'),_0xc149('0x20f')]))[_0xc149('0xbf')](_0x4398b0['checkContactBlack'](_0x11ca54,_0x3582eb[_0x49f184]))[_0xc149('0xb6')](_0x4398b0[_0xc149('0xd4')](_0xc149('0x210'),_0x11ca54));}}}})[_0xc149('0xb6')](loggerGetContactDialer(_0xc149('0x211'),_0x11ca54,_0x42044a));}};Dialer['prototype'][_0xc149('0x166')]=function(_0x72165,_0x49020f){var _0x47c067=this;var _0xafdb00=[];var _0x30b876=_0x49020f>=0x1?_0x49020f:0x1;if(_0x72165['dialMethod']===_0xc149('0x9')){_0x30b876=0x1;}var _0x2eb74a=Math[_0xc149('0x1d5')](_0x72165[_0xc149('0x50')]*_0x30b876)-_0x72165[_0xc149('0x74')]-_0x72165['temp'];emitVoiceQueueSummary(_0x72165);if(_0x72165[_0xc149('0x212')]>0x0){var _0x1d268e=_0x72165[_0xc149('0x212')]-_0x72165[_0xc149('0x74')]-_0x72165[_0xc149('0x55')]-_0x72165['temp']-_0x72165[_0xc149('0x52')];if(_0x2eb74a>_0x1d268e){_0x2eb74a=_0x1d268e;}}if(_0x2eb74a>0x0){if(_0x72165[_0xc149('0x164')]===_0xc149('0x9')){_0x2eb74a=0x1;}if(_0x2eb74a>this[_0xc149('0x25')]){_0x2eb74a=this[_0xc149('0x25')];}_0x72165[_0xc149('0xca')]+=_0x2eb74a;for(var _0x198d7a in this[_0xc149('0x23')]){if(typeof this[_0xc149('0x23')][_0x198d7a]!==_0xc149('0xa0')){if(this[_0xc149('0x23')][_0x198d7a]['state']===_0xc149('0x213')&&this[_0xc149('0x23')][_0x198d7a][_0xc149('0xb4')]===_0xc149('0x214')){_0xafdb00[_0xc149('0x137')](this[_0xc149('0x23')][_0x198d7a]['id']);}}}this[_0xc149('0x215')](_0x72165['id'],_0xafdb00,_0x2eb74a,_0x72165[_0xc149('0x20a')],_0x72165)[_0xc149('0xbf')](function(_0x11b405){_0x72165[_0xc149('0xca')]-=_0x2eb74a;_0x72165[_0xc149('0xca')]=_0x72165['temp']>0x0?_0x72165[_0xc149('0xca')]:0x0;if(!checkContactEmpty(_0x11b405)){_0x47c067['countReScheduled'](_0x72165)[_0xc149('0xbf')](sendMessageReschedule(_0x72165))[_0xc149('0xb6')](loggerCatch(_0xc149('0xbe')));}else{_0x72165[_0xc149('0x74')]+=_0x11b405[_0xc149('0x9f')];_0x72165[_0xc149('0x42')]=_0x72165[_0xc149('0x164')]===_0xc149('0x9')?_0xc149('0x216'):_0xc149('0x20c');for(var _0xa42061=0x0;_0xa42061<_0x11b405[_0xc149('0x9f')];_0xa42061+=0x1){if(_['isNil'](_0x11b405[_0xa42061])||_[_0xc149('0xb3')](_0x11b405[_0xa42061][_0xc149('0x176')])||_[_0xc149('0xb3')](_0x11b405[_0xa42061]['Contact'][_0xc149('0x177')])){_0x47c067[_0xc149('0xd5')]('[actionOriginate]\x20',_0x72165,_0x11b405[_0xa42061]);}else{_0x47c067[_0xc149('0xc0')](_[_0xc149('0xd7')](_0x11b405[_0xa42061],[_0xc149('0x103'),_0xc149('0x20f')]))[_0xc149('0xbf')](_0x47c067[_0xc149('0x217')](_0x72165,_0x11b405[_0xa42061]))[_0xc149('0xb6')](_0x47c067[_0xc149('0xd4')](_0xc149('0x20e'),_0x72165));}}}})[_0xc149('0xb6')](loggerGetContactDialer(_0xc149('0x218'),_0x72165,_0x2eb74a));}};Dialer[_0xc149('0xb0')][_0xc149('0x98')]=function(_0x526942){if(_0x526942[_0xc149('0x212')]>0x0){var _0x2c7675=_0x526942[_0xc149('0x212')]-_0x526942[_0xc149('0x74')]-_0x526942[_0xc149('0x55')];if(_0x2c7675>0x0){this[_0xc149('0x219')](_0x526942);}else{loggerPredictiveCalls[_0xc149('0x83')](_0xc149('0x21a'));}}else{this[_0xc149('0x219')](_0x526942);}};Dialer['prototype'][_0xc149('0x219')]=function(_0x4d588d){var _0x465620=this;var _0x1c6d05=[];_0x4d588d['originated']+=0x1;for(var _0x5be900 in this['agents']){if(typeof this['agents'][_0x5be900]!==_0xc149('0xa0')){if(this[_0xc149('0x23')][_0x5be900][_0xc149('0x108')]==='not_inuse'&&this[_0xc149('0x23')][_0x5be900][_0xc149('0xb4')]===_0xc149('0x214')){_0x1c6d05[_0xc149('0x137')](this['agents'][_0x5be900]['id']);}}}this[_0xc149('0x215')](_0x4d588d['id'],_0x1c6d05,0x1,_0x4d588d['dialOrderByScheduledAt'],_0x4d588d)[_0xc149('0xbf')](function(_0x7eddd9){if(!checkContactEmpty(_0x7eddd9)){checkContactLowerLimitOriginate(_0x4d588d,0x1,0x0);_0x465620[_0xc149('0xbd')](_0x4d588d)[_0xc149('0xbf')](sendMessageReschedule(_0x4d588d))['catch'](loggerCatch(_0xc149('0xbe')));}else{_0x4d588d[_0xc149('0x42')]=_0xc149('0x20c');if(_['isNil'](_0x7eddd9[0x0])||_['isNil'](_0x7eddd9[0x0][_0xc149('0x176')])||_[_0xc149('0xb3')](_0x7eddd9[0x0][_0xc149('0x176')][_0xc149('0x177')])){_0x465620[_0xc149('0xd5')](_0xc149('0x20e'),_0x4d588d,_0x7eddd9[0x0]);}else{_0x465620[_0xc149('0xc0')](_[_0xc149('0xd7')](_0x7eddd9[0x0],[_0xc149('0x103'),_0xc149('0x20f')]))[_0xc149('0xbf')](_0x465620['checkContactBlack'](_0x4d588d,_0x7eddd9[0x0]))[_0xc149('0xb6')](_0x465620[_0xc149('0xd4')](_0xc149('0x21b'),_0x4d588d));}}})['catch'](loggerGetContactDialer(_0xc149('0x21c'),_0x4d588d,0x1));emitVoiceQueueSummary(_0x4d588d);};Dialer[_0xc149('0xb0')][_0xc149('0x1ea')]=function(_0x3fd904,_0x243bca,_0x137174,_0x28d058,_0x4b5575,_0x57db62){loggerPredictive[_0xc149('0x83')](_0xc149('0x21d'));loggerPredictive[_0xc149('0x83')](_0xc149('0x21e'),_0x3fd904);loggerPredictive[_0xc149('0x83')](_0xc149('0x21f'),_0x243bca);loggerPredictive[_0xc149('0x83')]('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',_0x137174);loggerPredictive[_0xc149('0x83')](_0xc149('0x220'),_0x28d058);loggerPredictive['info'](_0xc149('0x221'),_0x4b5575);loggerPredictive[_0xc149('0x83')](_0xc149('0x8b'));return new BPromise(function(_0x4c51d4,_0x4d98d0){if(_0x3fd904<=0x0||isNaN(_0x3fd904)){return _0x4d98d0(msgResponse('[abandonmentRate]',_0xc149('0x49'),'m\x20=\x20'+_0x3fd904));}if(_0x137174<=0x0||isNaN(_0x137174)){return _0x4d98d0(msgResponse('[abandonmentRate]',_0xc149('0x49'),_0xc149('0x222')+_0x137174));}if(_0x28d058<=0x0||isNaN(_0x28d058)){return _0x4d98d0(msgResponse(_0xc149('0x223'),_0xc149('0x49'),_0xc149('0x224')+_0x28d058));}if(_0x243bca<=0x0||isNaN(_0x243bca)){return _0x4d98d0(msgResponse(_0xc149('0x223'),_0xc149('0x49'),_0xc149('0x225')+_0x243bca));}if(_0x4b5575<=0x0||isNaN(_0x4b5575)){return _0x4d98d0(msgResponse(_0xc149('0x223'),_0xc149('0x49'),_0xc149('0x226')+_0x4b5575));}_0x57db62=_0x57db62||0x0;var _0x721f1e=0x1/_0x137174;var _0x5415ee=0x0;var _0x3743cf=0x0;var _0xf0ea5d=0x0;var _0x4b73fd=0x0;for(var _0x2d6cd0=0x0;_0xf0ea5d<_0x4b5575;_0x2d6cd0+=0x1){_0x3743cf=_0x2d6cd0/_0x243bca;_0x5415ee=(_0x28d058*_0x3743cf+_0x57db62)/_0x721f1e;_0xf0ea5d=erlangb(_0x5415ee,_0x3fd904);_0x4b73fd=_0x5415ee/_0x3fd904*(0x1-erlangb(_0x5415ee,_0x3fd904));}return _0x4c51d4({'erlangCalls':_0x2d6cd0,'erlangCallToSecond':_0x243bca/_0x2d6cd0,'erlangAbandonmentRate':_0xf0ea5d,'erlangBusyFactor':_0x4b73fd});});};Dialer['prototype'][_0xc149('0x1ec')]=function(_0x275bae,_0x1616d0,_0x14d55c,_0x297909,_0x182a5b,_0x52ab1d){loggerPredictive[_0xc149('0x83')](_0xc149('0x227'));loggerPredictive[_0xc149('0x83')]('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',_0x275bae);loggerPredictive[_0xc149('0x83')](_0xc149('0x21f'),_0x1616d0);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14d55c);loggerPredictive[_0xc149('0x83')](_0xc149('0x220'),_0x297909);loggerPredictive[_0xc149('0x83')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x182a5b);loggerPredictive[_0xc149('0x83')]('---------------------------');return new BPromise(function(_0x51129a,_0x49f4cd){if(_0x275bae<=0x0||isNaN(_0x275bae)){return _0x49f4cd(msgResponse(_0xc149('0x228'),_0xc149('0x49'),_0xc149('0x229')+_0x275bae));}if(_0x14d55c<=0x0||isNaN(_0x14d55c)){return _0x49f4cd(msgResponse(_0xc149('0x228'),_0xc149('0x49'),_0xc149('0x222')+_0x14d55c));}if(_0x297909<=0x0||isNaN(_0x297909)){return _0x49f4cd(msgResponse('[busyFactor]',_0xc149('0x49'),_0xc149('0x224')+_0x297909));}if(_0x1616d0<=0x0||isNaN(_0x1616d0)){return _0x49f4cd(msgResponse(_0xc149('0x228'),_0xc149('0x49'),_0xc149('0x225')+_0x1616d0));}if(_0x182a5b<=0x0||isNaN(_0x182a5b)){return _0x49f4cd(msgResponse(_0xc149('0x228'),'Error',_0xc149('0x22a')+_0x182a5b));}_0x52ab1d=_0x52ab1d||0x0;var _0x33a911=0x1/_0x14d55c;var _0x3c5e15=0x0;var _0x57816a=0x0;var _0x1d2184=0x0;var _0x3c2392=0x0;for(var _0x466181=0x0;_0x3c2392<_0x182a5b;_0x466181+=0x1){_0x57816a=_0x466181/_0x1616d0;_0x3c5e15=(_0x297909*_0x57816a+_0x52ab1d)/_0x33a911;_0x1d2184=erlangb(_0x3c5e15,_0x275bae);_0x3c2392=_0x3c5e15/_0x275bae*(0x1-erlangb(_0x3c5e15,_0x275bae));}return _0x51129a({'erlangCalls':_0x466181,'erlangCallToSecond':_0x1616d0/_0x466181,'erlangAbandonmentRate':_0x1d2184,'erlangBusyFactor':_0x3c2392});});};module[_0xc149('0x22b')]=Dialer;
\ No newline at end of file
index c33c0f5..5275e91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ed=['countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x02ed,0x152));var _0xd02e=function(_0xa5373c,_0x14c01f){_0xa5373c=_0xa5373c-0x0;var _0x551705=_0x02ed[_0xa5373c];return _0x551705;};'use strict';var util=require(_0xd02e('0x0'));var _=require(_0xd02e('0x1'));var moment=require(_0xd02e('0x2'));function getSeconds(_0x6c265f,_0x2c699f){var _0x37bd44=moment(_0x6c265f)['milliseconds'](0x0);var _0x322a30=moment(_0x2c699f)[_0xd02e('0x3')](0x0);return _0x37bd44[_0xd02e('0x4')](_0x322a30,_0xd02e('0x5'));}function QueueCallerAbandon(_0x30fa3d,_0x4d54fe){this['scheduledat']=_0x30fa3d['scheduledat'];this[_0xd02e('0x6')]=_0x30fa3d['type'];this[_0xd02e('0x7')]=_0x30fa3d['type']===_0xd02e('0x8')?'queue':_0x30fa3d[_0xd02e('0x6')];this[_0xd02e('0x9')]=_0x30fa3d[_0xd02e('0x9')];this[_0xd02e('0xa')]=_0x30fa3d[_0xd02e('0xa')];this[_0xd02e('0xb')]=_0x30fa3d[_0xd02e('0xb')];this[_0xd02e('0xc')]=_0x30fa3d['countbusyretry']+_0x30fa3d[_0xd02e('0xa')]+_0x30fa3d[_0xd02e('0xb')]+_0x30fa3d[_0xd02e('0xd')]+_0x30fa3d['countdropretry']+_0x30fa3d[_0xd02e('0xe')]+_0x30fa3d['countmachineretry']+_0x30fa3d[_0xd02e('0xf')];this['countnosuchnumberretry']=_0x30fa3d[_0xd02e('0xd')];this[_0xd02e('0x10')]=_0x30fa3d[_0xd02e('0x10')];this[_0xd02e('0xe')]=_0x30fa3d[_0xd02e('0xe')];this['countmachineretry']=_0x30fa3d[_0xd02e('0x11')];this[_0xd02e('0xf')]=_0x30fa3d[_0xd02e('0xf')];this[_0xd02e('0x12')]=_0x4d54fe[_0xd02e('0x12')];this[_0xd02e('0x13')]=_0x30fa3d[_0xd02e('0x14')];this['calleridnum']=_0x30fa3d[_0xd02e('0x15')];this[_0xd02e('0x16')]=_0x30fa3d[_0xd02e('0x16')];this['responsetime']=_0x30fa3d[_0xd02e('0x17')];this['droptime']=_0x30fa3d[_0xd02e('0x18')];this[_0xd02e('0x19')]=this[_0xd02e('0x18')];this[_0xd02e('0x1a')]=getSeconds(_0x30fa3d[_0xd02e('0x17')],_0x30fa3d['starttime']);this['holdtime']=getSeconds(this[_0xd02e('0x18')],_0x30fa3d[_0xd02e('0x17')]);this[_0xd02e('0x1b')]=0x0;this[_0xd02e('0x1c')]=_0x4d54fe[_0xd02e('0x1c')];this[_0xd02e('0x1d')]=_0x4d54fe[_0xd02e('0x1e')];this[_0xd02e('0x1f')]=_0x4d54fe[_0xd02e('0x1f')];this[_0xd02e('0x20')]=_0x30fa3d[_0xd02e('0x20')];this['callbackuniqueid']=_0x30fa3d[_0xd02e('0x21')];this[_0xd02e('0x22')]=_0x30fa3d['callbackat'];this[_0xd02e('0x23')]=_0x30fa3d[_0xd02e('0x23')];this[_0xd02e('0x24')]=_0x30fa3d[_0xd02e('0x24')];this['ListId']=_0x30fa3d[_0xd02e('0x25')];this[_0xd02e('0x26')]=_0x30fa3d[_0xd02e('0x26')];this['VoiceQueueId']=_0x30fa3d[_0xd02e('0x27')];this[_0xd02e('0x28')]=_0x30fa3d[_0xd02e('0x28')];this[_0xd02e('0x29')]=_0x30fa3d[_0xd02e('0x29')]||'';this[_0xd02e('0x2a')]=_0x30fa3d[_0xd02e('0x2a')]||'';}module[_0xd02e('0x2b')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x758d=['countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x526376,_0x51dd16){var _0x1668f9=function(_0x169750){while(--_0x169750){_0x526376['push'](_0x526376['shift']());}};_0x1668f9(++_0x51dd16);}(_0x758d,0xc0));var _0xd758=function(_0x1290d0,_0xce7d14){_0x1290d0=_0x1290d0-0x0;var _0x1da1b7=_0x758d[_0x1290d0];return _0x1da1b7;};'use strict';var util=require(_0xd758('0x0'));var _=require(_0xd758('0x1'));var moment=require('moment');function getSeconds(_0x554c19,_0x52d3cc){var _0x5d6e2e=moment(_0x554c19)['milliseconds'](0x0);var _0x2bb2c9=moment(_0x52d3cc)[_0xd758('0x2')](0x0);return _0x5d6e2e[_0xd758('0x3')](_0x2bb2c9,_0xd758('0x4'));}function QueueCallerAbandon(_0x52c3c2,_0x519d27){this['scheduledat']=_0x52c3c2[_0xd758('0x5')];this[_0xd758('0x6')]=_0x52c3c2[_0xd758('0x6')];this[_0xd758('0x7')]=_0x52c3c2[_0xd758('0x6')]===_0xd758('0x8')?_0xd758('0x9'):_0x52c3c2[_0xd758('0x6')];this['countbusyretry']=_0x52c3c2[_0xd758('0xa')];this[_0xd758('0xb')]=_0x52c3c2['countcongestionretry'];this[_0xd758('0xc')]=_0x52c3c2[_0xd758('0xc')];this[_0xd758('0xd')]=_0x52c3c2[_0xd758('0xa')]+_0x52c3c2[_0xd758('0xb')]+_0x52c3c2['countnoanswerretry']+_0x52c3c2[_0xd758('0xe')]+_0x52c3c2[_0xd758('0xf')]+_0x52c3c2[_0xd758('0x10')]+_0x52c3c2[_0xd758('0x11')]+_0x52c3c2[_0xd758('0x12')];this[_0xd758('0xe')]=_0x52c3c2[_0xd758('0xe')];this['countdropretry']=_0x52c3c2[_0xd758('0xf')];this[_0xd758('0x10')]=_0x52c3c2[_0xd758('0x10')];this['countmachineretry']=_0x52c3c2[_0xd758('0x11')];this[_0xd758('0x12')]=_0x52c3c2[_0xd758('0x12')];this['uniqueid']=_0x519d27[_0xd758('0x13')];this[_0xd758('0x14')]=_0x52c3c2[_0xd758('0x15')];this[_0xd758('0x16')]=_0x52c3c2[_0xd758('0x17')];this[_0xd758('0x18')]=_0x52c3c2['starttime'];this[_0xd758('0x19')]=_0x52c3c2['responsetime'];this[_0xd758('0x1a')]=_0x52c3c2['droptime'];this[_0xd758('0x1b')]=this[_0xd758('0x1a')];this[_0xd758('0x1c')]=getSeconds(_0x52c3c2[_0xd758('0x19')],_0x52c3c2['starttime']);this['holdtime']=getSeconds(this[_0xd758('0x1a')],_0x52c3c2[_0xd758('0x19')]);this[_0xd758('0x1d')]=0x0;this['queue']=_0x519d27[_0xd758('0x9')];this['membername']=_0x519d27['connectedlinename'];this[_0xd758('0x1e')]=_0x519d27[_0xd758('0x1e')];this[_0xd758('0x1f')]=_0x52c3c2['callback'];this[_0xd758('0x20')]=_0x52c3c2['callbackuniqueid'];this[_0xd758('0x21')]=_0x52c3c2[_0xd758('0x21')];this[_0xd758('0x22')]=_0x52c3c2[_0xd758('0x22')];this['ContactId']=_0x52c3c2[_0xd758('0x23')];this['ListId']=_0x52c3c2['ListId'];this['UserId']=_0x52c3c2[_0xd758('0x24')];this[_0xd758('0x25')]=_0x52c3c2[_0xd758('0x25')];this['CampaignId']=_0x52c3c2[_0xd758('0x26')];this[_0xd758('0x27')]=_0x52c3c2[_0xd758('0x27')]||'';this[_0xd758('0x28')]=_0x52c3c2[_0xd758('0x28')]||'';}module[_0xd758('0x29')]=QueueCallerAbandon;
\ No newline at end of file
index 23a519d..961fce0 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(_0x21d222,_0x194457){var _0x154157=function(_0x3eaa4a){while(--_0x3eaa4a){_0x21d222['push'](_0x21d222['shift']());}};_0x154157(++_0x194457);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x34cbe3,_0x1f0a75){var _0x27f327=function(_0x3905b3){while(--_0x3905b3){_0x34cbe3['push'](_0x34cbe3['shift']());}};_0x27f327(++_0x1f0a75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 29f7b15..f91def6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d2=['unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','tiff2pdf','../../../config/logger','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','context','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','hasOwnProperty','value','prototype','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','.pdf','application/pdf','notify','fax','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','Fax\x20failed','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x09d2,0x16f));var _0x209d=function(_0x56aa9c,_0x4801b6){_0x56aa9c=_0x56aa9c-0x0;var _0x266880=_0x09d2[_0x56aa9c];return _0x266880;};'use strict';var util=require(_0x209d('0x0'));var _=require(_0x209d('0x1'));var BPromise=require(_0x209d('0x2'));var uuid=require('uuid');var moment=require(_0x209d('0x3'));var path=require('path');var tiff2pdf=require(_0x209d('0x4'));var gs=require('./util/gs');var logger=require(_0x209d('0x5'))('fax');var ami=require(_0x209d('0x6'));var rpcDb=require(_0x209d('0x7'));var Channel=require(_0x209d('0x8'));var ut=require(_0x209d('0x9'));var Action=require('./action');var faxAccount=require(_0x209d('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x209d('0xb'));function Fax(_0x5e3e6c){this[_0x209d('0xc')]={};this[_0x209d('0xd')]=_0x5e3e6c[_0x209d('0xd')];this[_0x209d('0xe')]=_0x5e3e6c[_0x209d('0xe')];this[_0x209d('0xf')]={};ami['on'](_0x209d('0x10'),this[_0x209d('0x11')][_0x209d('0x12')](this));ami['on'](_0x209d('0x13'),this[_0x209d('0x14')]['bind'](this));ami['on'](_0x209d('0x15'),this[_0x209d('0x16')][_0x209d('0x12')](this));ami['on']('newexten',this[_0x209d('0x17')][_0x209d('0x12')](this));ami['on'](_0x209d('0x18'),this[_0x209d('0x19')][_0x209d('0x12')](this));ami['on'](_0x209d('0x1a'),this['syncReceiveFax']['bind'](this));ami['on'](_0x209d('0x1b'),this[_0x209d('0x1c')][_0x209d('0x12')](this));ami['on'](_0x209d('0x1d'),this['syncOriginateResponse'][_0x209d('0x12')](this));}Fax['prototype'][_0x209d('0x11')]=function(_0x5064f8){if(_0x5064f8[_0x209d('0x1e')]==='from-voip-provider'){for(var _0x59d39d in this[_0x209d('0xd')]){if(this['faxAccounts']['hasOwnProperty'](_0x59d39d)){if(_0x5064f8[_0x209d('0x1f')]===this[_0x209d('0xd')][_0x59d39d][_0x209d('0x20')]){this[_0x209d('0xc')][_0x5064f8[_0x209d('0x21')]]={};this[_0x209d('0xc')][_0x5064f8[_0x209d('0x21')]][_0x209d('0x22')]=_0x5064f8['channel'];this[_0x209d('0xc')][_0x5064f8[_0x209d('0x21')]]['id']=this[_0x209d('0xd')][_0x59d39d]['id'];this['channels'][_0x5064f8[_0x209d('0x21')]][_0x209d('0x23')]=this[_0x209d('0xd')][_0x59d39d][_0x209d('0x23')];logger['info'](_0x5064f8[_0x209d('0x21')],_0x209d('0x24'));}}}}if(this['actions'][_0x5064f8[_0x209d('0x21')]]){this[_0x209d('0xc')][_0x5064f8['uniqueid']]={};this[_0x209d('0xc')][_0x5064f8[_0x209d('0x21')]][_0x209d('0x22')]=_0x5064f8[_0x209d('0x22')];logger[_0x209d('0x25')](_0x5064f8['uniqueid'],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x364e12){if(this[_0x209d('0xc')][_0x364e12[_0x209d('0x21')]]){for(var _0x514dd3 in _0x364e12['variable']){if(_0x364e12[_0x209d('0x26')][_0x209d('0x27')](_0x514dd3)){this['channels'][_0x364e12['uniqueid']][_0x514dd3]=_0x364e12[_0x209d('0x28')];}}}};Fax[_0x209d('0x29')][_0x209d('0x16')]=function(_0x37d9fe){if(this[_0x209d('0xc')][_0x37d9fe[_0x209d('0x21')]]){this[_0x209d('0xc')][_0x37d9fe[_0x209d('0x21')]][_0x209d('0x2a')]=_0x37d9fe[_0x209d('0x2a')];this[_0x209d('0xc')][_0x37d9fe[_0x209d('0x21')]][_0x209d('0x2b')]=_0x37d9fe[_0x209d('0x2b')];}};Fax['prototype'][_0x209d('0x17')]=function(_0x2b76d2){if(this[_0x209d('0xc')][_0x2b76d2[_0x209d('0x21')]]){for(var _0x2d868d in _0x2b76d2[_0x209d('0x26')]){if(_0x2b76d2[_0x209d('0x26')]['hasOwnProperty'](_0x2d868d)){this[_0x209d('0xc')][_0x2b76d2['uniqueid']][_0x2d868d]=_0x2b76d2['value'];}}}};Fax[_0x209d('0x29')][_0x209d('0x19')]=function(_0x2d64a3){if(this[_0x209d('0xc')][_0x2d64a3['uniqueid']]){this['channels'][_0x2d64a3[_0x209d('0x21')]]['operation']=_0x2d64a3[_0x209d('0x2c')];this[_0x209d('0xc')][_0x2d64a3[_0x209d('0x21')]][_0x209d('0x2d')]=_0x2d64a3[_0x209d('0x2d')];this[_0x209d('0xc')][_0x2d64a3[_0x209d('0x21')]][_0x209d('0x20')]=_0x2d64a3[_0x209d('0x20')];this[_0x209d('0xc')][_0x2d64a3['uniqueid']][_0x209d('0x2e')]=_0x2d64a3['filename'];logger['info'](_0x2d64a3[_0x209d('0x21')],_0x209d('0x2f'));}};Fax[_0x209d('0x29')]['syncReceiveFax']=function(_0x41df14){var _0x58a977=this;if(this[_0x209d('0xc')][_0x41df14[_0x209d('0x21')]]){var _0x4a1016=this[_0x209d('0xc')][_0x41df14[_0x209d('0x21')]]['id'];this[_0x209d('0xc')][_0x41df14[_0x209d('0x21')]][_0x209d('0x30')]=_0x41df14[_0x209d('0x30')];this[_0x209d('0xc')][_0x41df14[_0x209d('0x21')]][_0x209d('0x31')]=_0x41df14['pagestransferred'];this['channels'][_0x41df14[_0x209d('0x21')]][_0x209d('0x20')]=_0x41df14[_0x209d('0x20')];this[_0x209d('0xc')][_0x41df14['uniqueid']][_0x209d('0x32')]=_0x41df14[_0x209d('0x32')];this['channels'][_0x41df14['uniqueid']][_0x209d('0x33')]=_0x41df14[_0x209d('0x33')];this['channels'][_0x41df14[_0x209d('0x21')]][_0x209d('0x2e')]=_0x41df14[_0x209d('0x2e')];this['channels'][_0x41df14[_0x209d('0x21')]][_0x209d('0x34')]=_0x41df14[_0x209d('0x34')];if(this[_0x209d('0xc')][_0x41df14[_0x209d('0x21')]][_0x209d('0x31')]>0x0){tiff2pdf(_0x41df14[_0x209d('0x2e')],_0x209d('0x35'),function(_0x324795){logger[_0x209d('0x25')](_0x41df14[_0x209d('0x21')],'\x20result\x20conversion\x20file\x20',_0x324795[_0x209d('0x36')]);attachment[_0x209d('0x37')]({'name':path['parse'](_0x41df14[_0x209d('0x2e')])[_0x209d('0x23')],'basename':path['parse'](_0x41df14['filename'])[_0x209d('0x23')]+_0x209d('0x38'),'type':_0x209d('0x39')})['then'](function(_0x3d4954){faxAccount[_0x209d('0x3a')](_0x4a1016,{'from':_0x41df14['calleridnum'],'mapKey':_0x209d('0x3b'),'body':path[_0x209d('0x3c')](_0x41df14[_0x209d('0x2e')])[_0x209d('0x23')]+_0x209d('0x38'),'AttachmentId':_0x3d4954['id']})[_0x209d('0x3d')](function(_0x57a5c2){logger[_0x209d('0x3e')](_0x41df14[_0x209d('0x21')],_0x209d('0x3f'),JSON['stringify'](_0x57a5c2));});})[_0x209d('0x3d')](function(_0x414b67){logger[_0x209d('0x3e')](_0x41df14[_0x209d('0x21')],'\x20receiveFax\x20',JSON[_0x209d('0x40')](_0x414b67));});});}logger['info'](_0x41df14[_0x209d('0x21')],_0x209d('0x41'));}};Fax[_0x209d('0x29')][_0x209d('0x42')]=function(_0x55653f){if(this['actions'][_0x55653f[_0x209d('0x21')]]){_[_0x209d('0x43')](this[_0x209d('0xc')][_0x55653f['uniqueid']],_[_0x209d('0x44')](_0x55653f,['response','reason']));}};function updateStatus(_0x58f3b6){if(_0x58f3b6['AttachmentId']){faxMessage[_0x209d('0x45')](_0x58f3b6['AttachmentId'],{'failMessage':_0x209d('0x46')})[_0x209d('0x47')](function(_0xf9c3a4){ut[_0x209d('0x48')](_0x209d('0x49'),_0xf9c3a4);})[_0x209d('0x3d')](function(_0x4b0c70){ut['logger'](_0x209d('0x4a'),_0x4b0c70);});}else{ut[_0x209d('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x209d('0x4b')]=function(_0x1b860a,_0x439462,_0x2d89c1){var _0x401c35=this;var _0x5e595f={};if(_0x439462){_0x5e595f={'read':_0x439462};}else{_0x5e595f={'failMessage':_0x2d89c1};}if(this[_0x209d('0xf')][_0x1b860a]['AttachmentId']){faxMessage[_0x209d('0x45')](this[_0x209d('0xf')][_0x1b860a][_0x209d('0x4c')],_0x5e595f)[_0x209d('0x47')](function(_0x366544){ut[_0x209d('0x48')](_0x209d('0x4d'),_0x366544);})['catch'](function(_0x234304){ut[_0x209d('0x48')](_0x209d('0x4e'),_0x234304);})[_0x209d('0x4f')](function(){delete _0x401c35[_0x209d('0xc')][_0x1b860a];delete _0x401c35['actions'][_0x1b860a];});}else{ut[_0x209d('0x48')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x1b860a];delete this[_0x209d('0xf')][_0x1b860a];}};Fax[_0x209d('0x29')][_0x209d('0x1c')]=function(_0x20f870){var _0x24b497=this;if(this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]]){if(this[_0x209d('0xf')][_0x20f870[_0x209d('0x21')]]){this['channels'][_0x20f870[_0x209d('0x21')]]['id']=this[_0x209d('0xf')][_0x20f870['uniqueid']]['id'];this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]]['name']=this[_0x209d('0xf')][_0x20f870[_0x209d('0x21')]][_0x209d('0x23')];}logger[_0x209d('0x25')](_0x20f870['uniqueid'],this[_0x209d('0xf')][_0x20f870[_0x209d('0x21')]]?_0x209d('0x50'):_0x209d('0x51'),JSON[_0x209d('0x40')](this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]]));if(this[_0x209d('0xf')][_0x20f870[_0x209d('0x21')]]){if(this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]][_0x209d('0x52')]>0x0&&this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]]['faxstatus']===_0x209d('0x53')){this[_0x209d('0x4b')](_0x20f870[_0x209d('0x21')],!![]);}else{this[_0x209d('0x4b')](_0x20f870[_0x209d('0x21')],![],this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]][_0x209d('0x54')]?'SENDING\x20FAILED:\x20'+this[_0x209d('0xc')][_0x20f870[_0x209d('0x21')]][_0x209d('0x54')]:_0x209d('0x55'));}}}};Fax[_0x209d('0x29')][_0x209d('0x56')]=function(_0x8fdecd){var _0x337f84=this;return new BPromise(function(_0x5d4f0d,_0x34ed57){_0x337f84[_0x209d('0x57')](_0x8fdecd,_0x337f84[_0x209d('0xd')][_0x8fdecd[_0x209d('0x58')]])[_0x209d('0x47')](function(_0xa67be6){ut['logger']('[Fax][execOriginate][success]',_0xa67be6);_0x5d4f0d(ut[_0x209d('0x36')](_0x209d('0x59')));})[_0x209d('0x3d')](function(_0x64c5c7){ut[_0x209d('0x48')]('[Fax][execOriginate][failure]',_0x64c5c7);updateStatus(_0x8fdecd);_0x34ed57(ut[_0x209d('0x36')](_0x209d('0x5a')));});});};Fax[_0x209d('0x29')]['checkAfterSend']=function(_0x24c98b){var _0x43d924=this;return new BPromise(function(_0x4fa399,_0xc9dad5){var _0x3bf39e=_0x43d924[_0x209d('0x5b')](_0x43d924['faxAccounts'][_0x24c98b[_0x209d('0x58')]][_0x209d('0x5c')],_0x24c98b);if(_0x3bf39e['isValid']){_0x4fa399(ut[_0x209d('0x36')](_0x209d('0x5d')));}else{_0xc9dad5(ut[_0x209d('0x36')](_0x3bf39e[_0x209d('0x36')]));}});};function originate(_0x37caee,_0xefe490,_0x3368b0){return new BPromise(function(_0x4a179a,_0x114491){if(_0x3368b0){var _0x40ab15=util[_0x209d('0x5e')](_0x209d('0x5f'),path[_0x209d('0x3c')](_0x37caee[_0x209d('0x60')])[_0x209d('0x23')],_0x37caee[_0x209d('0x60')]);gs[_0x209d('0x61')](_0x40ab15)[_0x209d('0x47')](function(){_0x37caee[_0x209d('0x60')]=util['format'](_0x209d('0x62'),path[_0x209d('0x3c')](_0x37caee[_0x209d('0x60')])[_0x209d('0x63')],path['parse'](_0x37caee[_0x209d('0x60')])['name']);_0xefe490[_0x209d('0x64')]=_0x37caee[_0x209d('0x60')];ut[_0x209d('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x209d('0x65')](ut[_0x209d('0x66')](_0x37caee,_0xefe490))[_0x209d('0x47')](function(_0x3d6f4a){_0x4a179a(_0x3d6f4a);})[_0x209d('0x3d')](function(_0x41135b){_0x114491(_0x41135b);});})[_0x209d('0x3d')](function(_0x3ec304){_0x114491(_0x3ec304);});}else{ami['Action'](ut[_0x209d('0x66')](_0x37caee,_0xefe490))[_0x209d('0x47')](function(_0x1b783f){_0x4a179a(_0x1b783f);})['catch'](function(_0x28df7c){_0x114491(_0x28df7c);});}});}Fax[_0x209d('0x29')]['execOriginate']=function(_0x307987,_0x5a3b2e){var _0x4760c2=this;return new BPromise(function(_0x1dbfa0,_0x657d52){var _0x28f87f=uuid['v4']();var _0x4d6067=ut['addVariables'](_0x307987,_0x5a3b2e);_0x4760c2[_0x209d('0xf')][_0x28f87f]=new Action(_0x28f87f,_0x5a3b2e,_0x307987);var _0x28ba8d=_0x4760c2['actions'][_0x28f87f];if(path[_0x209d('0x3c')](_0x307987[_0x209d('0x60')])[_0x209d('0x67')]===_0x209d('0x38')){originate(_0x28ba8d,_0x4d6067,!![])[_0x209d('0x47')](function(_0x1fb0b2){_0x1dbfa0(_0x1fb0b2);})[_0x209d('0x3d')](function(_0x53e18e){_0x657d52(_0x53e18e);});}else{originate(_0x28ba8d,_0x4d6067,![])['then'](function(_0x109473){_0x1dbfa0(_0x109473);})[_0x209d('0x3d')](function(_0x2f6b07){_0x657d52(_0x2f6b07);});}});};Fax[_0x209d('0x29')][_0x209d('0x68')]=function(_0x134be5){return!_[_0x209d('0x69')](_0x134be5)&&!_[_0x209d('0x69')](_0x134be5[_0x209d('0x23')])&&!_[_0x209d('0x69')](_0x134be5[_0x209d('0x6a')])&&_0x134be5[_0x209d('0x6a')]&&!_[_0x209d('0x69')](this['trunks'][util[_0x209d('0x5e')](_0x209d('0x6b'),_0x134be5[_0x209d('0x23')])])&&!_[_0x209d('0x69')](this['trunks'][util[_0x209d('0x5e')]('SIP/%s',_0x134be5[_0x209d('0x23')])][_0x209d('0x2d')])&&(this[_0x209d('0xe')][util[_0x209d('0x5e')](_0x209d('0x6b'),_0x134be5[_0x209d('0x23')])]['status']===_0x209d('0x6c')||this[_0x209d('0xe')][util[_0x209d('0x5e')](_0x209d('0x6b'),_0x134be5[_0x209d('0x23')])][_0x209d('0x2d')]===_0x209d('0x6d'));};Fax['prototype'][_0x209d('0x5b')]=function(_0x57b7d8,_0x3be20d){if(!this['isTrunkReachable'](_0x57b7d8)){ut[_0x209d('0x48')](_0x209d('0x6e'),_[_0x209d('0x69')](_0x57b7d8)?'':_0x57b7d8['name']+_0x209d('0x6f'));return{'isValid':![],'message':_0x209d('0x70')};}if(_[_0x209d('0x69')](_0x3be20d[_0x209d('0x3b')])){ut[_0x209d('0x48')](_0x209d('0x71'),JSON['stringify'](_0x3be20d));return{'isValid':![],'message':_0x209d('0x72')};}if(_[_0x209d('0x69')](_0x3be20d[_0x209d('0x60')])){ut[_0x209d('0x48')](_0x209d('0x73'),JSON[_0x209d('0x40')](_0x3be20d));return{'isValid':![],'message':_0x209d('0x74')};}return{'isValid':!![],'message':_0x209d('0x75')};};module[_0x209d('0x76')]=Fax;
\ No newline at end of file
+var _0xca9f=['./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','varset','syncVarSet','newstate','syncNewState','syncNewExten','bind','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','logger','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami'];(function(_0x4a2860,_0x1ac3f0){var _0xc4d1cf=function(_0xe315dd){while(--_0xe315dd){_0x4a2860['push'](_0x4a2860['shift']());}};_0xc4d1cf(++_0x1ac3f0);}(_0xca9f,0x15e));var _0xfca9=function(_0x3cba1d,_0x2825ae){_0x3cba1d=_0x3cba1d-0x0;var _0x5f192b=_0xca9f[_0x3cba1d];return _0x5f192b;};'use strict';var util=require(_0xfca9('0x0'));var _=require(_0xfca9('0x1'));var BPromise=require(_0xfca9('0x2'));var uuid=require(_0xfca9('0x3'));var moment=require(_0xfca9('0x4'));var path=require(_0xfca9('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xfca9('0x6'));var logger=require(_0xfca9('0x7'))(_0xfca9('0x8'));var ami=require(_0xfca9('0x9'));var rpcDb=require(_0xfca9('0xa'));var Channel=require(_0xfca9('0xb'));var ut=require('./util/util');var Action=require(_0xfca9('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xfca9('0xd'));var faxMessage=require(_0xfca9('0xe'));function Fax(_0x2f41ce){this[_0xfca9('0xf')]={};this[_0xfca9('0x10')]=_0x2f41ce[_0xfca9('0x10')];this['trunks']=_0x2f41ce[_0xfca9('0x11')];this['actions']={};ami['on']('newchannel',this['syncNewchannel']['bind'](this));ami['on'](_0xfca9('0x12'),this[_0xfca9('0x13')]['bind'](this));ami['on'](_0xfca9('0x14'),this[_0xfca9('0x15')]['bind'](this));ami['on']('newexten',this[_0xfca9('0x16')][_0xfca9('0x17')](this));ami['on']('faxstatus',this['syncFaxStatus'][_0xfca9('0x17')](this));ami['on']('receivefax',this['syncReceiveFax'][_0xfca9('0x17')](this));ami['on'](_0xfca9('0x18'),this[_0xfca9('0x19')][_0xfca9('0x17')](this));ami['on'](_0xfca9('0x1a'),this[_0xfca9('0x1b')][_0xfca9('0x17')](this));}Fax[_0xfca9('0x1c')][_0xfca9('0x1d')]=function(_0x18d0e9){if(_0x18d0e9[_0xfca9('0x1e')]===_0xfca9('0x1f')){for(var _0x560597 in this[_0xfca9('0x10')]){if(this[_0xfca9('0x10')][_0xfca9('0x20')](_0x560597)){if(_0x18d0e9[_0xfca9('0x21')]===this[_0xfca9('0x10')][_0x560597][_0xfca9('0x22')]){this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]]={};this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]][_0xfca9('0x24')]=_0x18d0e9[_0xfca9('0x24')];this['channels'][_0x18d0e9[_0xfca9('0x23')]]['id']=this[_0xfca9('0x10')][_0x560597]['id'];this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]][_0xfca9('0x25')]=this[_0xfca9('0x10')][_0x560597][_0xfca9('0x25')];logger[_0xfca9('0x26')](_0x18d0e9[_0xfca9('0x23')],_0xfca9('0x27'));}}}}if(this[_0xfca9('0x28')][_0x18d0e9[_0xfca9('0x23')]]){this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]]={};this[_0xfca9('0xf')][_0x18d0e9[_0xfca9('0x23')]][_0xfca9('0x24')]=_0x18d0e9[_0xfca9('0x24')];logger[_0xfca9('0x26')](_0x18d0e9['uniqueid'],_0xfca9('0x27'));}};Fax[_0xfca9('0x1c')][_0xfca9('0x13')]=function(_0x306168){if(this[_0xfca9('0xf')][_0x306168[_0xfca9('0x23')]]){for(var _0xe4f7ef in _0x306168['variable']){if(_0x306168['variable'][_0xfca9('0x20')](_0xe4f7ef)){this[_0xfca9('0xf')][_0x306168[_0xfca9('0x23')]][_0xe4f7ef]=_0x306168[_0xfca9('0x29')];}}}};Fax['prototype']['syncNewState']=function(_0x5ce63c){if(this[_0xfca9('0xf')][_0x5ce63c[_0xfca9('0x23')]]){this[_0xfca9('0xf')][_0x5ce63c[_0xfca9('0x23')]][_0xfca9('0x2a')]=_0x5ce63c[_0xfca9('0x2a')];this[_0xfca9('0xf')][_0x5ce63c[_0xfca9('0x23')]][_0xfca9('0x2b')]=_0x5ce63c[_0xfca9('0x2b')];}};Fax[_0xfca9('0x1c')][_0xfca9('0x16')]=function(_0xa92a56){if(this[_0xfca9('0xf')][_0xa92a56['uniqueid']]){for(var _0x4b6b11 in _0xa92a56['variable']){if(_0xa92a56['variable'][_0xfca9('0x20')](_0x4b6b11)){this[_0xfca9('0xf')][_0xa92a56[_0xfca9('0x23')]][_0x4b6b11]=_0xa92a56[_0xfca9('0x29')];}}}};Fax['prototype'][_0xfca9('0x2c')]=function(_0x1de581){if(this[_0xfca9('0xf')][_0x1de581[_0xfca9('0x23')]]){this['channels'][_0x1de581[_0xfca9('0x23')]][_0xfca9('0x2d')]=_0x1de581['operation'];this[_0xfca9('0xf')][_0x1de581[_0xfca9('0x23')]][_0xfca9('0x2e')]=_0x1de581[_0xfca9('0x2e')];this['channels'][_0x1de581[_0xfca9('0x23')]][_0xfca9('0x22')]=_0x1de581['localstationid'];this[_0xfca9('0xf')][_0x1de581['uniqueid']][_0xfca9('0x2f')]=_0x1de581['filename'];logger[_0xfca9('0x26')](_0x1de581[_0xfca9('0x23')],_0xfca9('0x30'));}};Fax['prototype'][_0xfca9('0x31')]=function(_0xcbfd7f){var _0x3acbfc=this;if(this[_0xfca9('0xf')][_0xcbfd7f['uniqueid']]){var _0x3993a9=this['channels'][_0xcbfd7f[_0xfca9('0x23')]]['id'];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x32')]=_0xcbfd7f[_0xfca9('0x32')];this[_0xfca9('0xf')][_0xcbfd7f['uniqueid']][_0xfca9('0x33')]=_0xcbfd7f[_0xfca9('0x33')];this['channels'][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x22')]=_0xcbfd7f['localstationid'];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]]['resolution']=_0xcbfd7f[_0xfca9('0x34')];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x35')]=_0xcbfd7f[_0xfca9('0x35')];this['channels'][_0xcbfd7f[_0xfca9('0x23')]][_0xfca9('0x2f')]=_0xcbfd7f['filename'];this[_0xfca9('0xf')][_0xcbfd7f[_0xfca9('0x23')]]['calleridnum']=_0xcbfd7f[_0xfca9('0x36')];if(this[_0xfca9('0xf')][_0xcbfd7f['uniqueid']][_0xfca9('0x33')]>0x0){tiff2pdf(_0xcbfd7f[_0xfca9('0x2f')],_0xfca9('0x37'),function(_0x58db3a){logger[_0xfca9('0x26')](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x38'),_0x58db3a[_0xfca9('0x39')]);attachment[_0xfca9('0x3a')]({'name':path[_0xfca9('0x3b')](_0xcbfd7f['filename'])['name'],'basename':path['parse'](_0xcbfd7f[_0xfca9('0x2f')])[_0xfca9('0x25')]+_0xfca9('0x3c'),'type':_0xfca9('0x3d')})['then'](function(_0x572f40){faxAccount[_0xfca9('0x3e')](_0x3993a9,{'from':_0xcbfd7f[_0xfca9('0x36')],'mapKey':'fax','body':path['parse'](_0xcbfd7f['filename'])[_0xfca9('0x25')]+'.pdf','AttachmentId':_0x572f40['id']})[_0xfca9('0x3f')](function(_0x4c5c70){logger['error'](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x40'),JSON[_0xfca9('0x41')](_0x4c5c70));});})[_0xfca9('0x3f')](function(_0x23780a){logger[_0xfca9('0x42')](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x43'),JSON[_0xfca9('0x41')](_0x23780a));});});}logger[_0xfca9('0x26')](_0xcbfd7f[_0xfca9('0x23')],_0xfca9('0x43'));}};Fax[_0xfca9('0x1c')][_0xfca9('0x1b')]=function(_0x3eb61e){if(this[_0xfca9('0x28')][_0x3eb61e[_0xfca9('0x23')]]){_[_0xfca9('0x44')](this[_0xfca9('0xf')][_0x3eb61e['uniqueid']],_['pick'](_0x3eb61e,[_0xfca9('0x45'),_0xfca9('0x46')]));}};function updateStatus(_0x355033){if(_0x355033[_0xfca9('0x47')]){faxMessage[_0xfca9('0x48')](_0x355033[_0xfca9('0x47')],{'failMessage':_0xfca9('0x49')})['then'](function(_0x2f4932){ut['logger'](_0xfca9('0x4a'),_0x2f4932);})[_0xfca9('0x3f')](function(_0x1b7236){ut['logger'](_0xfca9('0x4b'),_0x1b7236);});}else{ut['logger'](_0xfca9('0x4c'));}}Fax['prototype'][_0xfca9('0x4d')]=function(_0x12f3d4,_0x158ec9,_0x5adc5e){var _0x232852=this;var _0x59e0cf={};if(_0x158ec9){_0x59e0cf={'read':_0x158ec9};}else{_0x59e0cf={'failMessage':_0x5adc5e};}if(this[_0xfca9('0x28')][_0x12f3d4][_0xfca9('0x47')]){faxMessage[_0xfca9('0x48')](this[_0xfca9('0x28')][_0x12f3d4][_0xfca9('0x47')],_0x59e0cf)[_0xfca9('0x4e')](function(_0xa0243e){ut[_0xfca9('0x4f')]('[Fax][Message][Updated]',_0xa0243e);})[_0xfca9('0x3f')](function(_0x41d82c){ut[_0xfca9('0x4f')](_0xfca9('0x50'),_0x41d82c);})[_0xfca9('0x51')](function(){delete _0x232852[_0xfca9('0xf')][_0x12f3d4];delete _0x232852[_0xfca9('0x28')][_0x12f3d4];});}else{ut[_0xfca9('0x4f')](_0xfca9('0x52'));delete this[_0xfca9('0xf')][_0x12f3d4];delete this['actions'][_0x12f3d4];}};Fax[_0xfca9('0x1c')][_0xfca9('0x19')]=function(_0xb2fd7c){var _0x1c1a7a=this;if(this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]]){if(this[_0xfca9('0x28')][_0xb2fd7c[_0xfca9('0x23')]]){this['channels'][_0xb2fd7c['uniqueid']]['id']=this[_0xfca9('0x28')][_0xb2fd7c[_0xfca9('0x23')]]['id'];this[_0xfca9('0xf')][_0xb2fd7c['uniqueid']]['name']=this['actions'][_0xb2fd7c['uniqueid']]['name'];}logger['info'](_0xb2fd7c[_0xfca9('0x23')],this['actions'][_0xb2fd7c[_0xfca9('0x23')]]?_0xfca9('0x53'):_0xfca9('0x54'),JSON[_0xfca9('0x41')](this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]]));if(this[_0xfca9('0x28')][_0xb2fd7c[_0xfca9('0x23')]]){if(this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]][_0xfca9('0x55')]>0x0&&this[_0xfca9('0xf')][_0xb2fd7c['uniqueid']][_0xfca9('0x56')]===_0xfca9('0x57')){this[_0xfca9('0x4d')](_0xb2fd7c[_0xfca9('0x23')],!![]);}else{this[_0xfca9('0x4d')](_0xb2fd7c['uniqueid'],![],this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0xfca9('0xf')][_0xb2fd7c[_0xfca9('0x23')]][_0xfca9('0x58')]:_0xfca9('0x59'));}}}};Fax[_0xfca9('0x1c')][_0xfca9('0x5a')]=function(_0x9a02ac){var _0x2d98ba=this;return new BPromise(function(_0x34632e,_0x3cd4a1){_0x2d98ba[_0xfca9('0x5b')](_0x9a02ac,_0x2d98ba[_0xfca9('0x10')][_0x9a02ac[_0xfca9('0x5c')]])[_0xfca9('0x4e')](function(_0x30b3b6){ut[_0xfca9('0x4f')]('[Fax][execOriginate][success]',_0x30b3b6);_0x34632e(ut['message'](_0xfca9('0x5d')));})['catch'](function(_0x3870eb){ut[_0xfca9('0x4f')](_0xfca9('0x5e'),_0x3870eb);updateStatus(_0x9a02ac);_0x3cd4a1(ut['message'](_0xfca9('0x5f')));});});};Fax[_0xfca9('0x1c')][_0xfca9('0x60')]=function(_0x2fb3e0){var _0x29d9fe=this;return new BPromise(function(_0x43c1f2,_0x52b3e1){var _0xb1eeb=_0x29d9fe[_0xfca9('0x61')](_0x29d9fe['faxAccounts'][_0x2fb3e0['FaxAccountId']]['Trunk'],_0x2fb3e0);if(_0xb1eeb[_0xfca9('0x62')]){_0x43c1f2(ut[_0xfca9('0x39')](_0xfca9('0x63')));}else{_0x52b3e1(ut[_0xfca9('0x39')](_0xb1eeb['message']));}});};function originate(_0x19ed9c,_0x287add,_0xc7f750){return new BPromise(function(_0x345396,_0x14dceb){if(_0xc7f750){var _0x20b236=util[_0xfca9('0x64')](_0xfca9('0x65'),path[_0xfca9('0x3b')](_0x19ed9c[_0xfca9('0x5')])['name'],_0x19ed9c[_0xfca9('0x5')]);gs[_0xfca9('0x66')](_0x20b236)[_0xfca9('0x4e')](function(){_0x19ed9c[_0xfca9('0x5')]=util[_0xfca9('0x64')](_0xfca9('0x67'),path[_0xfca9('0x3b')](_0x19ed9c[_0xfca9('0x5')])['dir'],path[_0xfca9('0x3b')](_0x19ed9c[_0xfca9('0x5')])['name']);_0x287add[_0xfca9('0x68')]=_0x19ed9c[_0xfca9('0x5')];ut['logger'](_0xfca9('0x69'),'');ami['Action'](ut[_0xfca9('0x6a')](_0x19ed9c,_0x287add))['then'](function(_0x504344){_0x345396(_0x504344);})[_0xfca9('0x3f')](function(_0x43caa1){_0x14dceb(_0x43caa1);});})[_0xfca9('0x3f')](function(_0x58e7a2){_0x14dceb(_0x58e7a2);});}else{ami['Action'](ut[_0xfca9('0x6a')](_0x19ed9c,_0x287add))[_0xfca9('0x4e')](function(_0x30dcf3){_0x345396(_0x30dcf3);})[_0xfca9('0x3f')](function(_0x357726){_0x14dceb(_0x357726);});}});}Fax[_0xfca9('0x1c')][_0xfca9('0x5b')]=function(_0x2cb3cf,_0x5d2f2b){var _0x49ff4f=this;return new BPromise(function(_0x4f0e10,_0x8318c){var _0x53f723=uuid['v4']();var _0x11ffe1=ut[_0xfca9('0x6b')](_0x2cb3cf,_0x5d2f2b);_0x49ff4f[_0xfca9('0x28')][_0x53f723]=new Action(_0x53f723,_0x5d2f2b,_0x2cb3cf);var _0x5dd584=_0x49ff4f[_0xfca9('0x28')][_0x53f723];if(path['parse'](_0x2cb3cf[_0xfca9('0x5')])[_0xfca9('0x6c')]===_0xfca9('0x3c')){originate(_0x5dd584,_0x11ffe1,!![])[_0xfca9('0x4e')](function(_0x1a5264){_0x4f0e10(_0x1a5264);})[_0xfca9('0x3f')](function(_0x3a9fa1){_0x8318c(_0x3a9fa1);});}else{originate(_0x5dd584,_0x11ffe1,![])[_0xfca9('0x4e')](function(_0x575c11){_0x4f0e10(_0x575c11);})[_0xfca9('0x3f')](function(_0x21ecbc){_0x8318c(_0x21ecbc);});}});};Fax[_0xfca9('0x1c')][_0xfca9('0x6d')]=function(_0x213f6d){return!_[_0xfca9('0x6e')](_0x213f6d)&&!_[_0xfca9('0x6e')](_0x213f6d[_0xfca9('0x25')])&&!_[_0xfca9('0x6e')](_0x213f6d[_0xfca9('0x6f')])&&_0x213f6d[_0xfca9('0x6f')]&&!_['isNil'](this[_0xfca9('0x11')][util[_0xfca9('0x64')](_0xfca9('0x70'),_0x213f6d[_0xfca9('0x25')])])&&!_[_0xfca9('0x6e')](this[_0xfca9('0x11')][util[_0xfca9('0x64')](_0xfca9('0x70'),_0x213f6d['name'])][_0xfca9('0x2e')])&&(this['trunks'][util[_0xfca9('0x64')]('SIP/%s',_0x213f6d[_0xfca9('0x25')])][_0xfca9('0x2e')]===_0xfca9('0x71')||this[_0xfca9('0x11')][util[_0xfca9('0x64')]('SIP/%s',_0x213f6d[_0xfca9('0x25')])][_0xfca9('0x2e')]===_0xfca9('0x72'));};Fax[_0xfca9('0x1c')][_0xfca9('0x61')]=function(_0x452268,_0x474174){if(!this[_0xfca9('0x6d')](_0x452268)){ut[_0xfca9('0x4f')](_0xfca9('0x73'),_[_0xfca9('0x6e')](_0x452268)?'':_0x452268[_0xfca9('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xfca9('0x74')};}if(_['isNil'](_0x474174[_0xfca9('0x8')])){ut['logger'](_0xfca9('0x75'),JSON[_0xfca9('0x41')](_0x474174));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xfca9('0x6e')](_0x474174['path'])){ut[_0xfca9('0x4f')](_0xfca9('0x76'),JSON[_0xfca9('0x41')](_0x474174));return{'isValid':![],'message':_0xfca9('0x77')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
index 1b285df..cf3a1b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ad=['preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x5d3276,_0xd38063){var _0x3562f5=function(_0x5c5594){while(--_0x5c5594){_0x5d3276['push'](_0x5d3276['shift']());}};_0x3562f5(++_0xd38063);}(_0x04ad,0xf4));var _0xd04a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x04ad[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xd04a('0x0'));var BPromise=require(_0xd04a('0x1'));var logger=require(_0xd04a('0x2'))(_0xd04a('0x3'));var _=require(_0xd04a('0x4'));var faxAccount=require(_0xd04a('0x5'));function loggerCatch(_0x6f4b55){return function(_0x366166){logger[_0xd04a('0x6')](_0x6f4b55,util[_0xd04a('0x7')](_0x366166,{'showHidden':![],'depth':null}));};}exports[_0xd04a('0x8')]=function(_0x190fe9,_0x17b4bf){return BPromise[_0xd04a('0x9')]()[_0xd04a('0xa')](faxAccount[_0xd04a('0x8')](_0x190fe9,_0x17b4bf))[_0xd04a('0xb')](loggerCatch(_0xd04a('0xc')));};
\ No newline at end of file
+var _0xd4e9=['../../../config/logger','preview','lodash','error','notify','then','util','bluebird'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xd4e9,0x1be));var _0x9d4e=function(_0xba5a8a,_0xb328f3){_0xba5a8a=_0xba5a8a-0x0;var _0x5219b6=_0xd4e9[_0xba5a8a];return _0x5219b6;};'use strict';var util=require(_0x9d4e('0x0'));var BPromise=require(_0x9d4e('0x1'));var logger=require(_0x9d4e('0x2'))(_0x9d4e('0x3'));var _=require(_0x9d4e('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x12bc2b){return function(_0xa67571){logger[_0x9d4e('0x5')](_0x12bc2b,util['inspect'](_0xa67571,{'showHidden':![],'depth':null}));};}exports[_0x9d4e('0x6')]=function(_0xe8a7db,_0x330e5f){return BPromise['resolve']()[_0x9d4e('0x7')](faxAccount['notify'](_0xe8a7db,_0x330e5f))['catch'](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index d023cb6..c737b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x834a=['util','../../../../config/logger','fax','execute','info','Exec\x20gs'];(function(_0x1bb62e,_0x18a925){var _0x937e82=function(_0x51cec9){while(--_0x51cec9){_0x1bb62e['push'](_0x1bb62e['shift']());}};_0x937e82(++_0x18a925);}(_0x834a,0x72));var _0xa834=function(_0x6c1cfd,_0x3bb9e0){_0x6c1cfd=_0x6c1cfd-0x0;var _0x16f5bc=_0x834a[_0x6c1cfd];return _0x16f5bc;};'use strict';var util=require(_0xa834('0x0'));var logger=require(_0xa834('0x1'))(_0xa834('0x2'));var BPromise=require('bluebird');var exec=require('child_process')['exec'];exports[_0xa834('0x3')]=function(_0x8835f6){return new BPromise(function(_0x5fb195,_0x4469a4){exec(_0x8835f6,function(_0xe4528c,_0xd31cf3,_0x41ee95){logger[_0xa834('0x4')](_0xa834('0x5'),_0xd31cf3);if(_0xe4528c){logger['info'](_0xa834('0x5'),'\x20Error\x20:',util['inspect'](_0xe4528c,{'showHidden':![],'depth':null}),_0xd31cf3,_0x41ee95);_0x4469a4(_0xe4528c);}_0x5fb195(_0xd31cf3);});});};
\ No newline at end of file
+var _0x4c22=['util','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x4046b6,_0x238c36){var _0x1443be=function(_0x2e6c5d){while(--_0x2e6c5d){_0x4046b6['push'](_0x4046b6['shift']());}};_0x1443be(++_0x238c36);}(_0x4c22,0x17a));var _0x24c2=function(_0x22068c,_0x3f1c49){_0x22068c=_0x22068c-0x0;var _0x277169=_0x4c22[_0x22068c];return _0x277169;};'use strict';var util=require(_0x24c2('0x0'));var logger=require('../../../../config/logger')(_0x24c2('0x1'));var BPromise=require(_0x24c2('0x2'));var exec=require(_0x24c2('0x3'))['exec'];exports[_0x24c2('0x4')]=function(_0x141d4b){return new BPromise(function(_0x2210a3,_0x2d3c7a){exec(_0x141d4b,function(_0x252ab9,_0x3e1220,_0x29e3cd){logger[_0x24c2('0x5')]('Exec\x20gs',_0x3e1220);if(_0x252ab9){logger[_0x24c2('0x5')](_0x24c2('0x6'),_0x24c2('0x7'),util[_0x24c2('0x8')](_0x252ab9,{'showHidden':![],'depth':null}),_0x3e1220,_0x29e3cd);_0x2d3c7a(_0x252ab9);}_0x2210a3(_0x3e1220);});});};
\ No newline at end of file
index f8f1630..8a51360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8128=['headerinfo','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','util','../../../../config/logger','fax','logger','inspect','addVariables','ecm'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8128,0x1b1));var _0x8812=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x8128[_0x2e4aa2];return _0x5e6092;};'use strict';var util=require(_0x8812('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x8812('0x1'))(_0x8812('0x2'));exports['message']=function(_0x5dbf05){return{'message':_0x5dbf05};};exports[_0x8812('0x3')]=function(_0x2aeddc,_0x21b1d5){logger['info'](_0x2aeddc,util[_0x8812('0x4')](_0x21b1d5,{'showHidden':![],'depth':null}));};exports[_0x8812('0x5')]=function(_0x2b43c6,_0x16bafa){var _0x480d1f={'XMF-ECM':_0x16bafa[_0x8812('0x6')],'XMF-HEADERINFO':_0x16bafa[_0x8812('0x7')],'XMF-MINRATE':_0x16bafa['minrate'],'XMF-MAXRATE':_0x16bafa['maxrate'],'XMF-MODEM':util['format'](_0x8812('0x8'),_0x16bafa[_0x8812('0x9')]),'XMF-GATEWAY':_0x16bafa[_0x8812('0xa')],'XMF-FAXDETECT':_0x16bafa[_0x8812('0xb')],'XMF-T38TIMEOUT':_0x16bafa[_0x8812('0xc')],'XMF-LOCALSTATIONID':_0x16bafa[_0x8812('0xd')],'XMF-PATH':_0x2b43c6[_0x8812('0xe')]};return _0x480d1f;};exports[_0x8812('0xf')]=function(_0xfed062,_0x54d7cb){return{'actionid':_0xfed062[_0x8812('0x10')],'action':_0x8812('0x11'),'channel':_0xfed062[_0x8812('0x12')],'Exten':_0x8812('0x13'),'Context':_0x8812('0x14'),'Priority':'1','callerid':util[_0x8812('0x15')]('\x22%s\x22\x20<%s>',_0xfed062[_0x8812('0x7')]?_0xfed062[_0x8812('0x7')]:'',_0xfed062[_0x8812('0xd')]),'variable':_0x54d7cb,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xfed062['uniqueid']};};
\ No newline at end of file
+var _0x33aa=['format','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','util','lodash','../../../../config/logger','fax','message','logger','info','inspect','addVariables','minrate','maxrate'];(function(_0x1f2379,_0x19ec5f){var _0xad633c=function(_0x5fc8f0){while(--_0x5fc8f0){_0x1f2379['push'](_0x1f2379['shift']());}};_0xad633c(++_0x19ec5f);}(_0x33aa,0x18d));var _0xa33a=function(_0x1e4d03,_0x4e18){_0x1e4d03=_0x1e4d03-0x0;var _0xacb601=_0x33aa[_0x1e4d03];return _0xacb601;};'use strict';var util=require(_0xa33a('0x0'));var _=require(_0xa33a('0x1'));var moment=require('moment');var logger=require(_0xa33a('0x2'))(_0xa33a('0x3'));exports[_0xa33a('0x4')]=function(_0x51ca49){return{'message':_0x51ca49};};exports[_0xa33a('0x5')]=function(_0x3f94c2,_0x9162d9){logger[_0xa33a('0x6')](_0x3f94c2,util[_0xa33a('0x7')](_0x9162d9,{'showHidden':![],'depth':null}));};exports[_0xa33a('0x8')]=function(_0x593fe2,_0x21e8e6){var _0x34e2ff={'XMF-ECM':_0x21e8e6['ecm'],'XMF-HEADERINFO':_0x21e8e6['headerinfo'],'XMF-MINRATE':_0x21e8e6[_0xa33a('0x9')],'XMF-MAXRATE':_0x21e8e6[_0xa33a('0xa')],'XMF-MODEM':util[_0xa33a('0xb')](_0xa33a('0xc'),_0x21e8e6['modem']),'XMF-GATEWAY':_0x21e8e6['gateway'],'XMF-FAXDETECT':_0x21e8e6[_0xa33a('0xd')],'XMF-T38TIMEOUT':_0x21e8e6[_0xa33a('0xe')],'XMF-LOCALSTATIONID':_0x21e8e6[_0xa33a('0xf')],'XMF-PATH':_0x593fe2[_0xa33a('0x10')]};return _0x34e2ff;};exports[_0xa33a('0x11')]=function(_0x4714c4,_0x38101d){return{'actionid':_0x4714c4[_0xa33a('0x12')],'action':_0xa33a('0x13'),'channel':_0x4714c4[_0xa33a('0x14')],'Exten':'xcally-motion-fax','Context':_0xa33a('0x15'),'Priority':'1','callerid':util[_0xa33a('0xb')](_0xa33a('0x16'),_0x4714c4[_0xa33a('0x17')]?_0x4714c4[_0xa33a('0x17')]:'',_0x4714c4['localstationid']),'variable':_0x38101d,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4714c4[_0xa33a('0x12')]};};
\ No newline at end of file
index d7cd989..aa423a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7427=['./rpc/integrations/sugarcrm','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','get','resolve','then','initAgents','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','sync','log','bluebird','util','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce'];(function(_0x70e0e0,_0x432298){var _0x50a9f1=function(_0x5e319a){while(--_0x5e319a){_0x70e0e0['push'](_0x70e0e0['shift']());}};_0x50a9f1(++_0x432298);}(_0x7427,0xf5));var _0x7742=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x7427[_0x37cc52];return _0x2b4a90;};'use strict';var BPromise=require(_0x7742('0x0'));var util=require(_0x7742('0x1'));var moment=require('moment');var server=require(_0x7742('0x2'));var Realtime=require(_0x7742('0x3'));var Report=require(_0x7742('0x4'));var Acw=require('./acw');var Trigger=require(_0x7742('0x5'));var Dialer=require(_0x7742('0x6'));var Preview=require(_0x7742('0x7'));var Fax=require(_0x7742('0x8'));var user=require(_0x7742('0x9'));var voiceQueue=require(_0x7742('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x7742('0xb'));var trunk=require(_0x7742('0xc'));var trigger=require(_0x7742('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0x7742('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x7742('0xf'));var faxAccount=require(_0x7742('0x10'));var zendesk=require(_0x7742('0x11'));var salesforce=require(_0x7742('0x12'));var sugarcrm=require(_0x7742('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x7742('0x14'));var freshsales=require(_0x7742('0x15'));var servicenow=require(_0x7742('0x16'));var dynamics365=require(_0x7742('0x17'));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'](_0x7742('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7742('0x19')](_0x7742('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7742('0x1a')]()[_0x7742('0x1b')](user['getAgents']())[_0x7742('0x1b')](realtime[_0x7742('0x1c')]())['then'](user['getTelephones']())[_0x7742('0x1b')](realtime['initTelephones']())[_0x7742('0x1b')](trunk[_0x7742('0x1d')]())[_0x7742('0x1b')](realtime[_0x7742('0x1e')]())[_0x7742('0x1b')](voiceQueue[_0x7742('0x1f')]())[_0x7742('0x1b')](realtime[_0x7742('0x20')]())['then'](trigger['getTriggers']())['then'](realtime['initTriggers']())[_0x7742('0x1b')](template[_0x7742('0x21')]())[_0x7742('0x1b')](realtime[_0x7742('0x22')]())[_0x7742('0x1b')](zendesk['getZendeskAccounts']())[_0x7742('0x1b')](realtime[_0x7742('0x23')]())[_0x7742('0x1b')](salesforce[_0x7742('0x24')]())[_0x7742('0x1b')](realtime[_0x7742('0x25')]())[_0x7742('0x1b')](sugarcrm[_0x7742('0x26')]())[_0x7742('0x1b')](realtime[_0x7742('0x27')]())[_0x7742('0x1b')](freshdesk['getFreshdeskAccounts']())[_0x7742('0x1b')](realtime[_0x7742('0x28')]())[_0x7742('0x1b')](desk[_0x7742('0x29')]())['then'](realtime[_0x7742('0x2a')]())[_0x7742('0x1b')](zoho[_0x7742('0x2b')]())[_0x7742('0x1b')](realtime[_0x7742('0x2c')]())[_0x7742('0x1b')](vtiger[_0x7742('0x2d')]())[_0x7742('0x1b')](realtime[_0x7742('0x2e')]())[_0x7742('0x1b')](freshsales[_0x7742('0x2f')]())[_0x7742('0x1b')](realtime[_0x7742('0x30')]())[_0x7742('0x1b')](servicenow[_0x7742('0x31')]())[_0x7742('0x1b')](realtime['initServicenowAccounts']())[_0x7742('0x1b')](dynamics365[_0x7742('0x32')]())[_0x7742('0x1b')](realtime[_0x7742('0x33')]())[_0x7742('0x1b')](campaign[_0x7742('0x34')]())['then'](realtime[_0x7742('0x35')]())[_0x7742('0x1b')](voiceExtension['getVoiceExtensions']())[_0x7742('0x1b')](realtime[_0x7742('0x36')]())[_0x7742('0x1b')](faxAccount[_0x7742('0x37')]())[_0x7742('0x1b')](realtime[_0x7742('0x38')]())[_0x7742('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x7742('0x1b')](voiceQueueReport[_0x7742('0x39')]())[_0x7742('0x1b')](realtime['initVoiceQueueReports']())[_0x7742('0x1b')](cmHopperHistory[_0x7742('0x3a')]())[_0x7742('0x1b')](realtime[_0x7742('0x3b')]())[_0x7742('0x1b')](cmHopperHistory[_0x7742('0x3c')]())[_0x7742('0x1b')](realtime[_0x7742('0x3d')]())[_0x7742('0x1b')](voiceCallReport[_0x7742('0x3e')]())['then'](realtime['initVoiceCallReports']())['then'](function(_0x579a34){})[_0x7742('0x3f')](function(_0x29cc88){console['log'](_0x29cc88);});}function main(){return server['listen'](realtime,preview,fax)[_0x7742('0x1b')](function(_0x37385e){return initRealtime();})[_0x7742('0x1b')](function(){return initParams();})[_0x7742('0x1b')](function(){report[_0x7742('0x40')]();setInterval(initRealtime,0x1388);})[_0x7742('0x3f')](function(_0xed585d){console[_0x7742('0x41')](_0xed585d);});}main();
\ No newline at end of file
+var _0xc63a=['./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xc63a,0x1ee));var _0xac63=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xc63a[_0x318840];return _0x223da4;};'use strict';var BPromise=require(_0xac63('0x0'));var util=require(_0xac63('0x1'));var moment=require(_0xac63('0x2'));var server=require(_0xac63('0x3'));var Realtime=require(_0xac63('0x4'));var Report=require('./report');var Acw=require(_0xac63('0x5'));var Trigger=require(_0xac63('0x6'));var Dialer=require(_0xac63('0x7'));var Preview=require(_0xac63('0x8'));var Fax=require(_0xac63('0x9'));var user=require(_0xac63('0xa'));var voiceQueue=require(_0xac63('0xb'));var voiceQueueReport=require(_0xac63('0xc'));var voiceCallReport=require(_0xac63('0xd'));var trunk=require(_0xac63('0xe'));var trigger=require(_0xac63('0xf'));var template=require(_0xac63('0x10'));var cmHopperHistory=require(_0xac63('0x11'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xac63('0x12'));var faxAccount=require(_0xac63('0x13'));var zendesk=require(_0xac63('0x14'));var salesforce=require(_0xac63('0x15'));var sugarcrm=require(_0xac63('0x16'));var freshdesk=require(_0xac63('0x17'));var desk=require(_0xac63('0x18'));var zoho=require(_0xac63('0x19'));var vtiger=require(_0xac63('0x1a'));var freshsales=require(_0xac63('0x1b'));var servicenow=require(_0xac63('0x1c'));var dynamics365=require(_0xac63('0x1d'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xac63('0x1e')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xac63('0x1e')](_0xac63('0x1f'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xac63('0x20')](user[_0xac63('0x21')]())['then'](realtime[_0xac63('0x22')]())[_0xac63('0x20')](user[_0xac63('0x23')]())[_0xac63('0x20')](realtime[_0xac63('0x24')]())[_0xac63('0x20')](trunk[_0xac63('0x25')]())[_0xac63('0x20')](realtime['initTrunks']())[_0xac63('0x20')](voiceQueue[_0xac63('0x26')]())[_0xac63('0x20')](realtime[_0xac63('0x27')]())[_0xac63('0x20')](trigger[_0xac63('0x28')]())[_0xac63('0x20')](realtime['initTriggers']())[_0xac63('0x20')](template['getTemplates']())[_0xac63('0x20')](realtime['initTemplates']())[_0xac63('0x20')](zendesk[_0xac63('0x29')]())[_0xac63('0x20')](realtime[_0xac63('0x2a')]())[_0xac63('0x20')](salesforce[_0xac63('0x2b')]())[_0xac63('0x20')](realtime['initSalesforceAccounts']())[_0xac63('0x20')](sugarcrm[_0xac63('0x2c')]())['then'](realtime['initSugarcrmAccounts']())[_0xac63('0x20')](freshdesk['getFreshdeskAccounts']())[_0xac63('0x20')](realtime['initFreshdeskAccounts']())['then'](desk[_0xac63('0x2d')]())[_0xac63('0x20')](realtime[_0xac63('0x2e')]())[_0xac63('0x20')](zoho[_0xac63('0x2f')]())[_0xac63('0x20')](realtime[_0xac63('0x30')]())[_0xac63('0x20')](vtiger['getVtigerAccounts']())[_0xac63('0x20')](realtime[_0xac63('0x31')]())[_0xac63('0x20')](freshsales[_0xac63('0x32')]())[_0xac63('0x20')](realtime[_0xac63('0x33')]())[_0xac63('0x20')](servicenow[_0xac63('0x34')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0xac63('0x35')]())['then'](realtime[_0xac63('0x36')]())[_0xac63('0x20')](campaign['getCampaigns']())[_0xac63('0x20')](realtime[_0xac63('0x37')]())[_0xac63('0x20')](voiceExtension[_0xac63('0x38')]())['then'](realtime[_0xac63('0x39')]())[_0xac63('0x20')](faxAccount[_0xac63('0x3a')]())[_0xac63('0x20')](realtime[_0xac63('0x3b')]())[_0xac63('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0xac63('0x3c')]()['then'](voiceQueueReport[_0xac63('0x3d')]())[_0xac63('0x20')](realtime['initVoiceQueueReports']())[_0xac63('0x20')](cmHopperHistory[_0xac63('0x3e')]())[_0xac63('0x20')](realtime[_0xac63('0x3f')]())[_0xac63('0x20')](cmHopperHistory[_0xac63('0x40')]())[_0xac63('0x20')](realtime[_0xac63('0x41')]())[_0xac63('0x20')](voiceCallReport[_0xac63('0x42')]())['then'](realtime[_0xac63('0x43')]())[_0xac63('0x20')](function(_0xe2c04d){})[_0xac63('0x44')](function(_0x18c5ff){console['log'](_0x18c5ff);});}function main(){return server[_0xac63('0x45')](realtime,preview,fax)[_0xac63('0x20')](function(_0x384fe7){return initRealtime();})['then'](function(){return initParams();})[_0xac63('0x20')](function(){report[_0xac63('0x46')]();setInterval(initRealtime,0x1388);})[_0xac63('0x44')](function(_0x4e3ab2){console[_0xac63('0x47')](_0x4e3ab2);});}main();
\ No newline at end of file
index 3b7f474..19cf40a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ad6bc,_0x52025a){_0x4ad6bc=_0x4ad6bc-0x0;var _0x318739=_0xedd9[_0x4ad6bc];return _0x318739;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent;
\ No newline at end of file
+var _0x34e8=['interface','online','voiceStatusTime','voiceStatusQueue','onhold','local','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','voiceStatus','toNumber','format','voiceStatusCallerIdNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile'];(function(_0x3cfd3d,_0x5c9e2f){var _0x11a438=function(_0x19718b){while(--_0x19718b){_0x3cfd3d['push'](_0x3cfd3d['shift']());}};_0x11a438(++_0x5c9e2f);}(_0x34e8,0x12c));var _0x834e=function(_0x64553f,_0x11ebdb){_0x64553f=_0x64553f-0x0;var _0x1cdd46=_0x34e8[_0x64553f];return _0x1cdd46;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));config[_0x834e('0x5')]=_[_0x834e('0x6')](config[_0x834e('0x5')],{'host':_0x834e('0x7'),'port':0x18eb});var io=require(_0x834e('0x8'))(new Redis(config[_0x834e('0x5')]));function Agent(_0x4a2018){this['id']=_0x4a2018['id']||0x0;this[_0x834e('0x9')]=_0x4a2018['name']||'';this[_0x834e('0xa')]=_0x4a2018[_0x834e('0xa')]||'';this[_0x834e('0xb')]=_0x4a2018[_0x834e('0xb')]||'';this[_0x834e('0xc')]=_0x4a2018[_0x834e('0xc')]||'';this[_0x834e('0xd')]=_0x834e('0xe');this[_0x834e('0xf')]=0x0;this[_0x834e('0x10')]=_0x834e('0xe');this[_0x834e('0x11')]='';this[_0x834e('0x12')]='';this[_0x834e('0x13')]='';this[_0x834e('0x14')]='';this[_0x834e('0x15')]=_0x4a2018[_0x834e('0x15')]||![];this['voiceStatus']=_0x834e('0xe');this[_0x834e('0x16')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x834e('0x17')]='';this[_0x834e('0x18')]=![];this[_0x834e('0x19')]=![];this[_0x834e('0x3')]='';}Agent['prototype'][_0x834e('0x1a')]=function(_0x302cbd){var _0x57274a;if(_0x302cbd&&_0x302cbd[_0x834e('0xd')]){_0x57274a=_0x302cbd['state'][_0x834e('0x1b')]();switch(_0x57274a){case _0x834e('0x1c'):_0x57274a='idle';break;case _0x834e('0x1d'):_0x57274a=_0x834e('0x1e');break;}}if(_0x57274a&&this[_0x834e('0x1f')]!==_0x57274a||_0x302cbd['statePause']){this[_0x834e('0x16')]=_[_0x834e('0x20')](moment()[_0x834e('0x21')]('x'));}if(_0x57274a){this[_0x834e('0x1f')]=_0x57274a;}var _0x237947={'id':this['id'],'name':this[_0x834e('0x9')],'email':this[_0x834e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x834e('0xc')],'state':this[_0x834e('0xd')],'stateTime':this[_0x834e('0xf')],'status':this[_0x834e('0x10')],'address':this['address'],'online':this[_0x834e('0x15')],'voiceStatus':this[_0x834e('0x1f')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x834e('0x22')],'voiceStatusQueue':this[_0x834e('0x17')],'interface':this[_0x834e('0x14')],'onhold':this['onhold']};var _0x4e3f48=md5(JSON[_0x834e('0x23')](_0x237947));if(this[_0x834e('0x3')]!==_0x4e3f48){this['md5']=_0x4e3f48;io['to'](util[_0x834e('0x21')](_0x834e('0x24'),_0x237947['name']))[_0x834e('0x25')](_0x834e('0x26'),_0x237947);io[_0x834e('0x25')]('user:presence',_0x237947);}};module[_0x834e('0x27')]=Agent;
\ No newline at end of file
index fe8ba18..d7ff5bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf94b=['dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0xcaeded,_0x1b5eac){var _0x4aa1b7=function(_0x319cb5){while(--_0x319cb5){_0xcaeded['push'](_0xcaeded['shift']());}};_0x4aa1b7(++_0x1b5eac);}(_0xf94b,0xa3));var _0xbf94=function(_0x4f87ac,_0x2cbcf4){_0x4f87ac=_0x4f87ac-0x0;var _0x5d624f=_0xf94b[_0x4f87ac];return _0x5d624f;};'use strict';function Campaign(_0x40a5c6){this['id']=_0x40a5c6['id']||0x0;this[_0xbf94('0x0')]=_0x40a5c6[_0xbf94('0x0')]||'';this[_0xbf94('0x1')]=_0x40a5c6[_0xbf94('0x1')]||_0xbf94('0x2');this[_0xbf94('0x3')]=0x0;this['temp']=0x0;this[_0xbf94('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xbf94('0x5')]='';this[_0xbf94('0x6')]=!![];this[_0xbf94('0x7')]=_0x40a5c6[_0xbf94('0x7')];this[_0xbf94('0x8')]=_0x40a5c6['limitCalls'];this[_0xbf94('0x9')]=_0x40a5c6['dialTimezone']||null;this[_0xbf94('0xa')]=_0x40a5c6[_0xbf94('0xa')]?_0x40a5c6['dialGlobalInterval']:null;this[_0xbf94('0xb')]=_0x40a5c6['dialOriginateCallerIdName'];this[_0xbf94('0xc')]=_0x40a5c6[_0xbf94('0xc')];this[_0xbf94('0xd')]=_0x40a5c6[_0xbf94('0xd')]||0x1e;this[_0xbf94('0xe')]=_0x40a5c6['dialCongestionMaxRetry'];this['dialCongestionRetryFrequency']=_0x40a5c6[_0xbf94('0xf')];this[_0xbf94('0x10')]=_0x40a5c6[_0xbf94('0x10')];this[_0xbf94('0x11')]=_0x40a5c6[_0xbf94('0x11')];this['dialNoAnswerMaxRetry']=_0x40a5c6[_0xbf94('0x12')];this[_0xbf94('0x13')]=_0x40a5c6[_0xbf94('0x13')];this[_0xbf94('0x14')]=_0x40a5c6['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x40a5c6['dialNoSuchNumberMaxRetry']||0x3;this[_0xbf94('0x15')]=_0x40a5c6[_0xbf94('0x15')]||0x96;this['dialDropMaxRetry']=_0x40a5c6[_0xbf94('0x16')]||0x3;this[_0xbf94('0x17')]=_0x40a5c6[_0xbf94('0x17')]||0x96;this[_0xbf94('0x18')]=_0x40a5c6[_0xbf94('0x18')]||0x3;this[_0xbf94('0x19')]=_0x40a5c6[_0xbf94('0x19')]||0x96;this[_0xbf94('0x1a')]=_0x40a5c6['dialMachineMaxRetry']||0x3;this[_0xbf94('0x1b')]=_0x40a5c6[_0xbf94('0x1b')]||0x96;this[_0xbf94('0x1c')]=_0x40a5c6[_0xbf94('0x1c')]||0x3;this[_0xbf94('0x1d')]=_0x40a5c6['dialAgentRejectRetryFrequency']||0x96;this[_0xbf94('0x1e')]=_0x40a5c6[_0xbf94('0x1e')]||'DESC';this[_0xbf94('0x1f')]=_0x40a5c6[_0xbf94('0x1f')]||undefined;this[_0xbf94('0x20')]=_0x40a5c6['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xbf94('0x21')]=_0x40a5c6[_0xbf94('0x21')]||undefined;this[_0xbf94('0x22')]=_0x40a5c6[_0xbf94('0x22')]?_0x40a5c6[_0xbf94('0x22')]:undefined;this[_0xbf94('0x23')]=_0x40a5c6[_0xbf94('0x23')]?_0x40a5c6[_0xbf94('0x23')]:undefined;this[_0xbf94('0x24')]=_0x40a5c6[_0xbf94('0x24')]?_0x40a5c6[_0xbf94('0x24')]:undefined;this[_0xbf94('0x25')]=_0x40a5c6['SquareProject']?_0x40a5c6['SquareProject']:undefined;this['dialQueueProject']=_0x40a5c6[_0xbf94('0x25')]?_0x40a5c6[_0xbf94('0x25')]['name']:undefined;this['dialAMDActive']=_0x40a5c6[_0xbf94('0x26')]||![];this[_0xbf94('0x27')]=_0x40a5c6[_0xbf94('0x27')];this['dialAMDGreeting']=_0x40a5c6[_0xbf94('0x28')];this[_0xbf94('0x29')]=_0x40a5c6['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x40a5c6[_0xbf94('0x2a')];this[_0xbf94('0x2b')]=_0x40a5c6['dialAMDMinWordLength'];this[_0xbf94('0x2c')]=_0x40a5c6[_0xbf94('0x2c')];this[_0xbf94('0x2d')]=_0x40a5c6[_0xbf94('0x2d')];this[_0xbf94('0x2e')]=_0x40a5c6[_0xbf94('0x2e')];this[_0xbf94('0x2f')]=_0x40a5c6[_0xbf94('0x2f')];}module['exports']=Campaign;
\ No newline at end of file
+var _0xac26=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','active'];(function(_0x31447a,_0x2204ea){var _0x23928e=function(_0x3a1b71){while(--_0x3a1b71){_0x31447a['push'](_0x31447a['shift']());}};_0x23928e(++_0x2204ea);}(_0xac26,0xc0));var _0x6ac2=function(_0x40c608,_0x9b7ad5){_0x40c608=_0x40c608-0x0;var _0x317471=_0xac26[_0x40c608];return _0x317471;};'use strict';function Campaign(_0x4f3149){this['id']=_0x4f3149['id']||0x0;this[_0x6ac2('0x0')]=_0x4f3149['name']||'';this[_0x6ac2('0x1')]=_0x4f3149[_0x6ac2('0x1')]||_0x6ac2('0x2');this[_0x6ac2('0x3')]=0x0;this[_0x6ac2('0x4')]=0x0;this[_0x6ac2('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x6ac2('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x6ac2('0x7')]=_0x4f3149['active'];this[_0x6ac2('0x8')]=_0x4f3149[_0x6ac2('0x8')];this['dialTimezone']=_0x4f3149[_0x6ac2('0x9')]||null;this[_0x6ac2('0xa')]=_0x4f3149['dialGlobalInterval']?_0x4f3149['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x4f3149[_0x6ac2('0xb')];this[_0x6ac2('0xc')]=_0x4f3149['dialOriginateCallerIdNumber'];this[_0x6ac2('0xd')]=_0x4f3149[_0x6ac2('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x4f3149[_0x6ac2('0xe')];this[_0x6ac2('0xf')]=_0x4f3149[_0x6ac2('0xf')];this[_0x6ac2('0x10')]=_0x4f3149[_0x6ac2('0x10')];this[_0x6ac2('0x11')]=_0x4f3149[_0x6ac2('0x11')];this[_0x6ac2('0x12')]=_0x4f3149[_0x6ac2('0x12')];this['dialNoAnswerRetryFrequency']=_0x4f3149[_0x6ac2('0x13')];this[_0x6ac2('0x14')]=_0x4f3149['dialGlobalMaxRetry'];this[_0x6ac2('0x15')]=_0x4f3149[_0x6ac2('0x15')]||0x3;this[_0x6ac2('0x16')]=_0x4f3149['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x4f3149[_0x6ac2('0x17')]||0x3;this[_0x6ac2('0x18')]=_0x4f3149[_0x6ac2('0x18')]||0x96;this[_0x6ac2('0x19')]=_0x4f3149[_0x6ac2('0x19')]||0x3;this[_0x6ac2('0x1a')]=_0x4f3149[_0x6ac2('0x1a')]||0x96;this[_0x6ac2('0x1b')]=_0x4f3149['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x4f3149[_0x6ac2('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x4f3149[_0x6ac2('0x1d')]||0x3;this[_0x6ac2('0x1e')]=_0x4f3149[_0x6ac2('0x1e')]||0x96;this[_0x6ac2('0x1f')]=_0x4f3149[_0x6ac2('0x1f')]||_0x6ac2('0x20');this[_0x6ac2('0x21')]=_0x4f3149[_0x6ac2('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x4f3149['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x6ac2('0x22')]=_0x4f3149[_0x6ac2('0x22')]||undefined;this[_0x6ac2('0x23')]=_0x4f3149['TrunkBackup']?_0x4f3149[_0x6ac2('0x23')]:undefined;this[_0x6ac2('0x24')]=_0x4f3149['Trunk']?_0x4f3149[_0x6ac2('0x24')]:undefined;this[_0x6ac2('0x25')]=_0x4f3149[_0x6ac2('0x25')]?_0x4f3149[_0x6ac2('0x25')]:undefined;this[_0x6ac2('0x26')]=_0x4f3149['SquareProject']?_0x4f3149[_0x6ac2('0x26')]:undefined;this[_0x6ac2('0x27')]=_0x4f3149[_0x6ac2('0x26')]?_0x4f3149[_0x6ac2('0x26')]['name']:undefined;this['dialAMDActive']=_0x4f3149[_0x6ac2('0x28')]||![];this[_0x6ac2('0x29')]=_0x4f3149[_0x6ac2('0x29')];this[_0x6ac2('0x2a')]=_0x4f3149[_0x6ac2('0x2a')];this[_0x6ac2('0x2b')]=_0x4f3149[_0x6ac2('0x2b')];this[_0x6ac2('0x2c')]=_0x4f3149[_0x6ac2('0x2c')];this[_0x6ac2('0x2d')]=_0x4f3149[_0x6ac2('0x2d')];this[_0x6ac2('0x2e')]=_0x4f3149[_0x6ac2('0x2e')];this['dialAMDMaximumNumberOfWords']=_0x4f3149[_0x6ac2('0x2f')];this[_0x6ac2('0x30')]=_0x4f3149['dialAMDSilenceThreshold'];this[_0x6ac2('0x31')]=_0x4f3149[_0x6ac2('0x31')];}module['exports']=Campaign;
\ No newline at end of file
index f78b33d..f496bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e9f=['mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x3e9f,0x98));var _0xf3e9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3e9f[_0x4b369d];return _0x571a98;};'use strict';function Channel(){this[_0xf3e9('0x0')]=null;this[_0xf3e9('0x1')]='';this[_0xf3e9('0x2')]='';this[_0xf3e9('0x3')]=0x0;this['calleridname']='';this[_0xf3e9('0x4')]=undefined;this[_0xf3e9('0x5')]=undefined;this[_0xf3e9('0x6')]=0x0;this[_0xf3e9('0x7')]='';this[_0xf3e9('0x8')]=0x0;this[_0xf3e9('0x9')]=0x0;this[_0xf3e9('0xa')]=0x0;this[_0xf3e9('0xb')]=![];this[_0xf3e9('0xc')]=null;this[_0xf3e9('0xd')]=null;this[_0xf3e9('0xe')]=![];this[_0xf3e9('0xf')]=![];this[_0xf3e9('0x10')]='';this[_0xf3e9('0x11')]='';this[_0xf3e9('0x12')]=0x0;this[_0xf3e9('0x13')]=0x0;this[_0xf3e9('0x14')]=0x0;this[_0xf3e9('0x15')]=null;this['tag']=null;this[_0xf3e9('0x16')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0xf3e9('0x17')]=null;this[_0xf3e9('0x18')]=[];this[_0xf3e9('0x19')]=undefined;this[_0xf3e9('0x1a')]=undefined;this[_0xf3e9('0x1b')]=undefined;this[_0xf3e9('0x1c')]=0x0;}module[_0xf3e9('0x1d')]=Channel;
\ No newline at end of file
+var _0xa486=['transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa486,0x17d));var _0x6a48=function(_0x3b240c,_0x214414){_0x3b240c=_0x3b240c-0x0;var _0x3ce8e3=_0xa486[_0x3b240c];return _0x3ce8e3;};'use strict';function Channel(){this[_0x6a48('0x0')]=null;this['channel']='';this[_0x6a48('0x1')]='';this['calleridnum']=0x0;this[_0x6a48('0x2')]='';this['connectedlinenum']=undefined;this[_0x6a48('0x3')]=undefined;this[_0x6a48('0x4')]=0x0;this[_0x6a48('0x5')]='';this[_0x6a48('0x6')]=0x0;this[_0x6a48('0x7')]=0x0;this[_0x6a48('0x8')]=0x0;this[_0x6a48('0x9')]=![];this[_0x6a48('0xa')]=null;this[_0x6a48('0xb')]=null;this[_0x6a48('0xc')]=![];this[_0x6a48('0xd')]=![];this[_0x6a48('0xe')]='';this[_0x6a48('0xf')]='';this[_0x6a48('0x10')]=0x0;this[_0x6a48('0x11')]=0x0;this[_0x6a48('0x12')]=0x0;this['type']=null;this[_0x6a48('0x13')]=null;this['disposition']=null;this[_0x6a48('0x14')]=![];this[_0x6a48('0x15')]=null;this[_0x6a48('0x16')]=null;this[_0x6a48('0x17')]=[];this[_0x6a48('0x18')]=undefined;this[_0x6a48('0x19')]=undefined;this[_0x6a48('0x1a')]=undefined;this[_0x6a48('0x1b')]=0x0;}module[_0x6a48('0x1c')]=Channel;
\ No newline at end of file
index f77f2d6..906c909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd573=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password'];(function(_0x262a21,_0x29cc61){var _0x536923=function(_0x17024a){while(--_0x17024a){_0x262a21['push'](_0x262a21['shift']());}};_0x536923(++_0x29cc61);}(_0xd573,0x1b8));var _0x3d57=function(_0xfbf78a,_0x7cc4d){_0xfbf78a=_0xfbf78a-0x0;var _0x106ebf=_0xd573[_0xfbf78a];return _0x106ebf;};'use strict';function DeskAccount(_0x41fb62){this['id']=_0x41fb62['id']||0x0;this['name']=_0x41fb62['name']||'';this['username']=_0x41fb62[_0x3d57('0x0')]||'';this[_0x3d57('0x1')]=_0x41fb62['remoteUri']||'';this[_0x3d57('0x2')]=_0x41fb62['authType']||'';this[_0x3d57('0x3')]=_0x41fb62[_0x3d57('0x3')]||'';this[_0x3d57('0x4')]=_0x41fb62[_0x3d57('0x4')]||'';this[_0x3d57('0x5')]=_0x41fb62[_0x3d57('0x5')]||'';this[_0x3d57('0x6')]=_0x41fb62[_0x3d57('0x6')]||'';this[_0x3d57('0x7')]=_0x41fb62[_0x3d57('0x7')]||'';this[_0x3d57('0x8')]=_0x41fb62['type']||'';this[_0x3d57('0x9')]=_0x41fb62['serverUrl']||'';this['Configurations']=_0x41fb62[_0x3d57('0xa')]||{};}module[_0x3d57('0xb')]=DeskAccount;
\ No newline at end of file
+var _0xbd23=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0xbd23,0x134));var _0x3bd2=function(_0x41cb9f,_0x34f6e0){_0x41cb9f=_0x41cb9f-0x0;var _0x426494=_0xbd23[_0x41cb9f];return _0x426494;};'use strict';function DeskAccount(_0x14d149){this['id']=_0x14d149['id']||0x0;this[_0x3bd2('0x0')]=_0x14d149[_0x3bd2('0x0')]||'';this[_0x3bd2('0x1')]=_0x14d149['username']||'';this[_0x3bd2('0x2')]=_0x14d149[_0x3bd2('0x2')]||'';this['authType']=_0x14d149['authType']||'';this['password']=_0x14d149[_0x3bd2('0x3')]||'';this[_0x3bd2('0x4')]=_0x14d149['consumerKey']||'';this[_0x3bd2('0x5')]=_0x14d149[_0x3bd2('0x5')]||'';this[_0x3bd2('0x6')]=_0x14d149[_0x3bd2('0x6')]||'';this[_0x3bd2('0x7')]=_0x14d149[_0x3bd2('0x7')]||'';this[_0x3bd2('0x8')]=_0x14d149[_0x3bd2('0x8')]||'';this[_0x3bd2('0x9')]=_0x14d149[_0x3bd2('0x9')]||'';this[_0x3bd2('0xa')]=_0x14d149[_0x3bd2('0xa')]||{};}module[_0x3bd2('0xb')]=DeskAccount;
\ No newline at end of file
index 19d7576..544b321 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x702d=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x5e690a,_0x4e8e15){var _0x3f44eb=function(_0x5f348c){while(--_0x5f348c){_0x5e690a['push'](_0x5e690a['shift']());}};_0x3f44eb(++_0x4e8e15);}(_0x702d,0x147));var _0xd702=function(_0x4c13ba,_0x987a43){_0x4c13ba=_0x4c13ba-0x0;var _0x29a4ad=_0x702d[_0x4c13ba];return _0x29a4ad;};'use strict';function Dynamics365Account(_0x14de3f){this['id']=_0x14de3f['id']||0x0;this[_0xd702('0x0')]=_0x14de3f[_0xd702('0x0')]||'';this[_0xd702('0x1')]=_0x14de3f[_0xd702('0x1')]||'';this['password']=_0x14de3f[_0xd702('0x2')]||'';this[_0xd702('0x3')]=_0x14de3f[_0xd702('0x3')]||'';this[_0xd702('0x4')]=_0x14de3f['tenantId']||'';this[_0xd702('0x5')]=_0x14de3f['clientId']||'';this[_0xd702('0x6')]=_0x14de3f[_0xd702('0x6')]||{};this[_0xd702('0x7')]=_0x14de3f['serverUrl']||'';this[_0xd702('0x8')]=_0x14de3f['Configurations']||{};}module[_0xd702('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0x2547=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x2547,0x1cd));var _0x7254=function(_0x1c8d04,_0x21119c){_0x1c8d04=_0x1c8d04-0x0;var _0x2216e4=_0x2547[_0x1c8d04];return _0x2216e4;};'use strict';function Dynamics365Account(_0x4cc9c6){this['id']=_0x4cc9c6['id']||0x0;this[_0x7254('0x0')]=_0x4cc9c6[_0x7254('0x0')]||'';this[_0x7254('0x1')]=_0x4cc9c6[_0x7254('0x1')]||'';this[_0x7254('0x2')]=_0x4cc9c6[_0x7254('0x2')]||'';this[_0x7254('0x3')]=_0x4cc9c6[_0x7254('0x3')]||'';this['tenantId']=_0x4cc9c6[_0x7254('0x4')]||'';this[_0x7254('0x5')]=_0x4cc9c6[_0x7254('0x5')]||'';this[_0x7254('0x6')]=_0x4cc9c6['clientSecret']||{};this[_0x7254('0x7')]=_0x4cc9c6[_0x7254('0x7')]||'';this[_0x7254('0x8')]=_0x4cc9c6['Configurations']||{};}module[_0x7254('0x9')]=Dynamics365Account;
\ No newline at end of file
index 464e01e..889006d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b03=['modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x2a4692,_0x5db910){var _0x370e6b=function(_0x5b4e23){while(--_0x5b4e23){_0x2a4692['push'](_0x2a4692['shift']());}};_0x370e6b(++_0x5db910);}(_0x6b03,0x99));var _0x36b0=function(_0x285d1b,_0xce9c72){_0x285d1b=_0x285d1b-0x0;var _0xcce89e=_0x6b03[_0x285d1b];return _0xcce89e;};'use strict';function FaxAccount(_0x31349c){this['id']=_0x31349c['id']||0x0;this[_0x36b0('0x0')]=_0x31349c[_0x36b0('0x0')]||'';this[_0x36b0('0x1')]=_0x31349c[_0x36b0('0x1')];this['ecm']=_0x31349c[_0x36b0('0x2')];this[_0x36b0('0x3')]=_0x31349c[_0x36b0('0x3')];this['localstationid']=_0x31349c[_0x36b0('0x4')];this[_0x36b0('0x5')]=_0x31349c[_0x36b0('0x5')]||0x960;this[_0x36b0('0x6')]=_0x31349c[_0x36b0('0x6')]||0x3840;this[_0x36b0('0x7')]=_0x31349c[_0x36b0('0x7')]||'v17,v27,v29';this[_0x36b0('0x8')]=_0x31349c[_0x36b0('0x8')]||'no';this['faxdetect']=_0x31349c[_0x36b0('0x9')]||'no';this[_0x36b0('0xa')]=_0x31349c[_0x36b0('0xa')]||0x1388;this[_0x36b0('0xb')]=_0x31349c['tech']||_0x36b0('0xc');this[_0x36b0('0xd')]=_0x31349c[_0x36b0('0xd')]?_0x31349c[_0x36b0('0xd')]:undefined;this['ListId']=_0x31349c[_0x36b0('0xe')];this[_0x36b0('0xf')]=_0x31349c['key'];}module['exports']=FaxAccount;
\ No newline at end of file
+var _0xb66c=['localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x279304,_0x5e717d){var _0x55f7a7=function(_0x3f1d4a){while(--_0x3f1d4a){_0x279304['push'](_0x279304['shift']());}};_0x55f7a7(++_0x5e717d);}(_0xb66c,0x12a));var _0xcb66=function(_0xb246b8,_0x47e683){_0xb246b8=_0xb246b8-0x0;var _0x456a7b=_0xb66c[_0xb246b8];return _0x456a7b;};'use strict';function FaxAccount(_0x244066){this['id']=_0x244066['id']||0x0;this[_0xcb66('0x0')]=_0x244066[_0xcb66('0x0')]||'';this['description']=_0x244066[_0xcb66('0x1')];this['ecm']=_0x244066['ecm'];this['headerinfo']=_0x244066['headerinfo'];this[_0xcb66('0x2')]=_0x244066[_0xcb66('0x2')];this[_0xcb66('0x3')]=_0x244066['minrate']||0x960;this[_0xcb66('0x4')]=_0x244066[_0xcb66('0x4')]||0x3840;this['modem']=_0x244066['modem']||_0xcb66('0x5');this[_0xcb66('0x6')]=_0x244066[_0xcb66('0x6')]||'no';this[_0xcb66('0x7')]=_0x244066[_0xcb66('0x7')]||'no';this[_0xcb66('0x8')]=_0x244066[_0xcb66('0x8')]||0x1388;this[_0xcb66('0x9')]=_0x244066[_0xcb66('0x9')]||_0xcb66('0xa');this['Trunk']=_0x244066[_0xcb66('0xb')]?_0x244066['Trunk']:undefined;this[_0xcb66('0xc')]=_0x244066[_0xcb66('0xc')];this[_0xcb66('0xd')]=_0x244066[_0xcb66('0xd')];}module[_0xcb66('0xe')]=FaxAccount;
\ No newline at end of file
index d38651d..d80599a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6d=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x30d644,_0x419d33){var _0x1688a5=function(_0x5a92ad){while(--_0x5a92ad){_0x30d644['push'](_0x30d644['shift']());}};_0x1688a5(++_0x419d33);}(_0x6e6d,0x7c));var _0xd6e6=function(_0x5c3c1c,_0x40556b){_0x5c3c1c=_0x5c3c1c-0x0;var _0x211a3c=_0x6e6d[_0x5c3c1c];return _0x211a3c;};'use strict';function FreshdeskAccount(_0x3a315b){this['id']=_0x3a315b['id']||0x0;this[_0xd6e6('0x0')]=_0x3a315b['name']||'';this[_0xd6e6('0x1')]=_0x3a315b[_0xd6e6('0x1')]||'';this['apiKey']=_0x3a315b[_0xd6e6('0x2')]||'';this[_0xd6e6('0x3')]=_0x3a315b['remoteUri']||'';this[_0xd6e6('0x4')]=_0x3a315b[_0xd6e6('0x4')]||'';this['Configurations']=_0x3a315b[_0xd6e6('0x5')]||{};}module[_0xd6e6('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x599c=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x5fdf6c,_0x118b9a){var _0x5c07be=function(_0x316454){while(--_0x316454){_0x5fdf6c['push'](_0x5fdf6c['shift']());}};_0x5c07be(++_0x118b9a);}(_0x599c,0x1e9));var _0xc599=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x599c[_0x3dd15e];return _0x231fd0;};'use strict';function FreshdeskAccount(_0x3b8c18){this['id']=_0x3b8c18['id']||0x0;this[_0xc599('0x0')]=_0x3b8c18[_0xc599('0x0')]||'';this[_0xc599('0x1')]=_0x3b8c18[_0xc599('0x1')]||'';this[_0xc599('0x2')]=_0x3b8c18[_0xc599('0x3')]||'';this[_0xc599('0x4')]=_0x3b8c18[_0xc599('0x4')]||'';this[_0xc599('0x5')]=_0x3b8c18[_0xc599('0x5')]||'';this['Configurations']=_0x3b8c18[_0xc599('0x6')]||{};}module[_0xc599('0x7')]=FreshdeskAccount;
\ No newline at end of file
index c80d17b..e1ec1d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d19=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x6d19,0x160));var _0x96d1=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x6d19[_0x3ba924];return _0x4cc1df;};'use strict';function FreshsalesAccount(_0x92d742){this['id']=_0x92d742['id']||0x0;this[_0x96d1('0x0')]=_0x92d742[_0x96d1('0x0')]||'';this[_0x96d1('0x1')]=_0x92d742[_0x96d1('0x1')]||'';this[_0x96d1('0x2')]=_0x92d742[_0x96d1('0x3')]||'';this['remoteUri']=_0x92d742[_0x96d1('0x4')]||'';this[_0x96d1('0x5')]=_0x92d742[_0x96d1('0x5')]||'';this[_0x96d1('0x6')]=_0x92d742['Configurations']||{};}module[_0x96d1('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0xa23f=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0xde8299,_0x274581){var _0x5cbb28=function(_0x342845){while(--_0x342845){_0xde8299['push'](_0xde8299['shift']());}};_0x5cbb28(++_0x274581);}(_0xa23f,0x7c));var _0xfa23=function(_0x5aa1eb,_0x57d866){_0x5aa1eb=_0x5aa1eb-0x0;var _0x489b0d=_0xa23f[_0x5aa1eb];return _0x489b0d;};'use strict';function FreshsalesAccount(_0x3212d1){this['id']=_0x3212d1['id']||0x0;this[_0xfa23('0x0')]=_0x3212d1['name']||'';this['username']=_0x3212d1[_0xfa23('0x1')]||'';this[_0xfa23('0x2')]=_0x3212d1[_0xfa23('0x3')]||'';this[_0xfa23('0x4')]=_0x3212d1['remoteUri']||'';this[_0xfa23('0x5')]=_0x3212d1['serverUrl']||'';this[_0xfa23('0x6')]=_0x3212d1[_0xfa23('0x6')]||{};}module[_0xfa23('0x7')]=FreshsalesAccount;
\ No newline at end of file
index 9857298..029909c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb7b=['queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','mohtime','variables','exports','inbound','uniqueid','calleridname','count','queuecallercomplete'];(function(_0x2ba071,_0x2cb068){var _0x4b637f=function(_0x168e4f){while(--_0x168e4f){_0x2ba071['push'](_0x2ba071['shift']());}};_0x4b637f(++_0x2cb068);}(_0xeb7b,0x72));var _0xbeb7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeb7b[_0xa464c9];return _0x3d73c4;};'use strict';function QueueReport(){this['type']=_0xbeb7('0x0');this[_0xbeb7('0x1')]='';this['calleridnum']='';this[_0xbeb7('0x2')]='';this['queue']='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0xbeb7('0x3')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0xbeb7('0x4')]=![];this['queuecallercompleteAt']=null;this['queuecallerexit']=![];this[_0xbeb7('0x5')]=null;this[_0xbeb7('0x6')]=0x1;this[_0xbeb7('0x7')]='';this[_0xbeb7('0x8')]='';this[_0xbeb7('0x9')]='';this[_0xbeb7('0xa')]='';this[_0xbeb7('0xb')]='';this[_0xbeb7('0xc')]='';this[_0xbeb7('0xd')]='';this['holdtime']=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xbeb7('0xe')]=0x0;this[_0xbeb7('0xf')]={};}module[_0xbeb7('0x10')]=QueueReport;
\ No newline at end of file
+var _0x62be=['queuecallerexit','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt'];(function(_0x4eff33,_0x48430f){var _0x4cdbd1=function(_0x22ee37){while(--_0x22ee37){_0x4eff33['push'](_0x4eff33['shift']());}};_0x4cdbd1(++_0x48430f);}(_0x62be,0xc3));var _0xe62b=function(_0x387221,_0x48a791){_0x387221=_0x387221-0x0;var _0x12b373=_0x62be[_0x387221];return _0x12b373;};'use strict';function QueueReport(){this[_0xe62b('0x0')]=_0xe62b('0x1');this[_0xe62b('0x2')]='';this[_0xe62b('0x3')]='';this[_0xe62b('0x4')]='';this[_0xe62b('0x5')]='';this['queuecallerjoinAt']=null;this[_0xe62b('0x6')]=null;this[_0xe62b('0x7')]=0x1;this[_0xe62b('0x8')]=0x1;this[_0xe62b('0x9')]=![];this['queuecallerabandonAt']=null;this[_0xe62b('0xa')]=![];this[_0xe62b('0xb')]=null;this[_0xe62b('0xc')]=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xe62b('0xd')]='';this[_0xe62b('0xe')]='';this[_0xe62b('0xf')]='';this[_0xe62b('0x10')]='';this['context']='';this[_0xe62b('0x11')]='';this[_0xe62b('0x12')]='';this[_0xe62b('0x13')]=0x0;this[_0xe62b('0x14')]=![];this['lastAssignedTo']='';this['mohtime']=0x0;this[_0xe62b('0x15')]={};}module[_0xe62b('0x16')]=QueueReport;
\ No newline at end of file
index 431a79a..4aa2b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1573=['serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x54aa9f,_0x2894df){var _0xd579c5=function(_0x561d12){while(--_0x561d12){_0x54aa9f['push'](_0x54aa9f['shift']());}};_0xd579c5(++_0x2894df);}(_0x1573,0x193));var _0x3157=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0x1573[_0x631a3c];return _0x2bdfa3;};'use strict';function SalesforceAccount(_0x2e1e98){this['id']=_0x2e1e98['id']||0x0;this['name']=_0x2e1e98['name']||'';this[_0x3157('0x0')]=_0x2e1e98[_0x3157('0x0')]||'';this[_0x3157('0x1')]=_0x2e1e98[_0x3157('0x1')]||'';this[_0x3157('0x2')]=_0x2e1e98[_0x3157('0x2')]||'';this[_0x3157('0x3')]=_0x2e1e98[_0x3157('0x3')]||'';this[_0x3157('0x4')]=_0x2e1e98['clientSecret']||'';this['securityToken']=_0x2e1e98[_0x3157('0x5')]||'';this['type']=_0x2e1e98[_0x3157('0x6')]||'integrationTab';this[_0x3157('0x7')]=_0x2e1e98[_0x3157('0x7')]||'';this[_0x3157('0x8')]=_0x2e1e98[_0x3157('0x8')]||{};}module[_0x3157('0x9')]=SalesforceAccount;
\ No newline at end of file
+var _0xd470=['type','integrationTab','serverUrl','Configurations','name','username','remoteUri','clientId','clientSecret','securityToken'];(function(_0x797fab,_0x46b333){var _0x2ececa=function(_0x244c60){while(--_0x244c60){_0x797fab['push'](_0x797fab['shift']());}};_0x2ececa(++_0x46b333);}(_0xd470,0x1bc));var _0x0d47=function(_0x5ccfbb,_0x2a1e32){_0x5ccfbb=_0x5ccfbb-0x0;var _0x25a849=_0xd470[_0x5ccfbb];return _0x25a849;};'use strict';function SalesforceAccount(_0x401e79){this['id']=_0x401e79['id']||0x0;this[_0x0d47('0x0')]=_0x401e79[_0x0d47('0x0')]||'';this[_0x0d47('0x1')]=_0x401e79[_0x0d47('0x1')]||'';this[_0x0d47('0x2')]=_0x401e79[_0x0d47('0x2')]||'';this['password']=_0x401e79['password']||'';this[_0x0d47('0x3')]=_0x401e79['clientId']||'';this[_0x0d47('0x4')]=_0x401e79[_0x0d47('0x4')]||'';this[_0x0d47('0x5')]=_0x401e79['securityToken']||'';this[_0x0d47('0x6')]=_0x401e79[_0x0d47('0x6')]||_0x0d47('0x7');this[_0x0d47('0x8')]=_0x401e79[_0x0d47('0x8')]||'';this[_0x0d47('0x9')]=_0x401e79[_0x0d47('0x9')]||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
index 7499f5a..4839e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25f5=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xd62bcc,_0x252ba3){var _0x216c1b=function(_0x1e2c25){while(--_0x1e2c25){_0xd62bcc['push'](_0xd62bcc['shift']());}};_0x216c1b(++_0x252ba3);}(_0x25f5,0x152));var _0x525f=function(_0x4c23a1,_0x5e630c){_0x4c23a1=_0x4c23a1-0x0;var _0x524a39=_0x25f5[_0x4c23a1];return _0x524a39;};'use strict';function ServicenowAccount(_0x1045a9){this['id']=_0x1045a9['id']||0x0;this[_0x525f('0x0')]=_0x1045a9[_0x525f('0x0')]||'';this[_0x525f('0x1')]=_0x1045a9[_0x525f('0x1')]||'';this[_0x525f('0x2')]=_0x1045a9[_0x525f('0x2')]||'';this[_0x525f('0x3')]=_0x1045a9[_0x525f('0x3')]||'';this[_0x525f('0x4')]=_0x1045a9[_0x525f('0x4')]||'';this['Configurations']=_0x1045a9[_0x525f('0x5')]||{};}module[_0x525f('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x839a=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x58cf03,_0x54462c){var _0x4415c7=function(_0x62305e){while(--_0x62305e){_0x58cf03['push'](_0x58cf03['shift']());}};_0x4415c7(++_0x54462c);}(_0x839a,0xe2));var _0xa839=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x839a[_0xa464c9];return _0x3d73c4;};'use strict';function ServicenowAccount(_0x52b02e){this['id']=_0x52b02e['id']||0x0;this[_0xa839('0x0')]=_0x52b02e[_0xa839('0x0')]||'';this[_0xa839('0x1')]=_0x52b02e['username']||'';this[_0xa839('0x2')]=_0x52b02e[_0xa839('0x2')]||'';this[_0xa839('0x3')]=_0x52b02e[_0xa839('0x3')]||'';this['serverUrl']=_0x52b02e[_0xa839('0x4')]||'';this[_0xa839('0x5')]=_0x52b02e[_0xa839('0x5')]||{};}module[_0xa839('0x6')]=ServicenowAccount;
\ No newline at end of file
index e52dec1..011215a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d4d=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4df7a5,_0x40250e){var _0x395639=function(_0x8ff90c){while(--_0x8ff90c){_0x4df7a5['push'](_0x4df7a5['shift']());}};_0x395639(++_0x40250e);}(_0x3d4d,0x1f1));var _0xd3d4=function(_0x5c7752,_0x42c547){_0x5c7752=_0x5c7752-0x0;var _0x4f3de0=_0x3d4d[_0x5c7752];return _0x4f3de0;};'use strict';function SugarcrmAccount(_0xbe0b7f){this['id']=_0xbe0b7f['id']||0x0;this[_0xd3d4('0x0')]=_0xbe0b7f[_0xd3d4('0x0')]||'';this[_0xd3d4('0x1')]=_0xbe0b7f[_0xd3d4('0x1')]||'';this[_0xd3d4('0x2')]=_0xbe0b7f[_0xd3d4('0x2')]||'';this['remoteUri']=_0xbe0b7f[_0xd3d4('0x3')]||'';this['serverUrl']=_0xbe0b7f[_0xd3d4('0x4')]||'';this[_0xd3d4('0x5')]=_0xbe0b7f[_0xd3d4('0x5')]||{};}module[_0xd3d4('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xc02c=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc02c,0xf8));var _0xcc02=function(_0x3e1585,_0x2483e3){_0x3e1585=_0x3e1585-0x0;var _0x309721=_0xc02c[_0x3e1585];return _0x309721;};'use strict';function SugarcrmAccount(_0x2e454d){this['id']=_0x2e454d['id']||0x0;this['name']=_0x2e454d[_0xcc02('0x0')]||'';this['username']=_0x2e454d[_0xcc02('0x1')]||'';this[_0xcc02('0x2')]=_0x2e454d[_0xcc02('0x2')]||'';this['remoteUri']=_0x2e454d[_0xcc02('0x3')]||'';this['serverUrl']=_0x2e454d[_0xcc02('0x4')]||'';this['Configurations']=_0x2e454d[_0xcc02('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 34f9aeb..4d367ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c2=['stateTime','status','address','exports','name','accountcode','state','unknown'];(function(_0x1ffd4c,_0x511081){var _0x2ba129=function(_0x32b7db){while(--_0x32b7db){_0x1ffd4c['push'](_0x1ffd4c['shift']());}};_0x2ba129(++_0x511081);}(_0xb4c2,0x19c));var _0x2b4c=function(_0xa13303,_0x40790e){_0xa13303=_0xa13303-0x0;var _0x47ce18=_0xb4c2[_0xa13303];return _0x47ce18;};'use strict';function Telephone(_0x52d764){this['id']=_0x52d764['id']||0x0;this[_0x2b4c('0x0')]=_0x52d764[_0x2b4c('0x0')]||'';this[_0x2b4c('0x1')]=_0x52d764[_0x2b4c('0x1')]||'';this[_0x2b4c('0x2')]=_0x2b4c('0x3');this[_0x2b4c('0x4')]=0x0;this[_0x2b4c('0x5')]=_0x2b4c('0x3');this[_0x2b4c('0x6')]='';}module[_0x2b4c('0x7')]=Telephone;
\ No newline at end of file
+var _0x6b00=['unknown','status','exports','name','accountcode','state'];(function(_0x517601,_0x173b35){var _0x1d470a=function(_0x324bae){while(--_0x324bae){_0x517601['push'](_0x517601['shift']());}};_0x1d470a(++_0x173b35);}(_0x6b00,0x1ad));var _0x06b0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6b00[_0x3947c9];return _0x2e7871;};'use strict';function Telephone(_0x37bdfe){this['id']=_0x37bdfe['id']||0x0;this[_0x06b0('0x0')]=_0x37bdfe[_0x06b0('0x0')]||'';this[_0x06b0('0x1')]=_0x37bdfe[_0x06b0('0x1')]||'';this[_0x06b0('0x2')]=_0x06b0('0x3');this['stateTime']=0x0;this[_0x06b0('0x4')]=_0x06b0('0x3');this['address']='';}module[_0x06b0('0x5')]=Telephone;
\ No newline at end of file
index 0715058..70cb93f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x507d71,_0x3a2516){var _0xd892b3=function(_0x2c092b){while(--_0x2c092b){_0x507d71['push'](_0x507d71['shift']());}};_0xd892b3(++_0x3a2516);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x1aa50a,_0x167983){var _0x392a85=function(_0x42637b){while(--_0x42637b){_0x1aa50a['push'](_0x1aa50a['shift']());}};_0x392a85(++_0x167983);}(_0xb10b,0x12a));var _0xbb10=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0xb10b[_0x27c068];return _0xe5a67f;};'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 388c335..e491eb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger;
\ No newline at end of file
+var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x282afb,_0x361258){var _0x1e2181=function(_0x1a889f){while(--_0x1a889f){_0x282afb['push'](_0x282afb['shift']());}};_0x1e2181(++_0x361258);}(_0xda2d,0x102));var _0xdda2=function(_0x148a0d,_0x4703d9){_0x148a0d=_0x148a0d-0x0;var _0x4fe3e0=_0xda2d[_0x148a0d];return _0x4fe3e0;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger;
\ No newline at end of file
index 61192b1..e3390df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x033b=['unknown','registry','indexOf','split','host','port','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0x033b,0xec));var _0xb033=function(_0x57511b,_0x3e2f5d){_0x57511b=_0x57511b-0x0;var _0x387e6d=_0x033b[_0x57511b];return _0x387e6d;};'use strict';function Trunk(_0x177996){this['id']=_0x177996['id']||0x0;this[_0xb033('0x0')]=_0x177996['active']||![];this[_0xb033('0x1')]=_0x177996['name']||'';this['state']=_0xb033('0x2');this['stateTime']=0x0;this['status']=_0xb033('0x2');this[_0xb033('0x3')]=_0x177996['registry']&&_0x177996[_0xb033('0x3')][_0xb033('0x4')](':')?_0x177996[_0xb033('0x3')][_0xb033('0x5')](':')[0x0]:'';this[_0xb033('0x6')]='';this[_0xb033('0x7')]='';this['domain']='';this['domainport']='';this[_0xb033('0x8')]='';this[_0xb033('0x9')]=_0xb033('0x2');this[_0xb033('0xa')]='';this[_0xb033('0xb')]='';this['defaultuser']=_0x177996[_0xb033('0xc')]||'';}module[_0xb033('0xd')]=Trunk;
\ No newline at end of file
+var _0x4b5b=['split','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry'];(function(_0x3cbcfa,_0x3af16b){var _0x546d83=function(_0x4359bf){while(--_0x4359bf){_0x3cbcfa['push'](_0x3cbcfa['shift']());}};_0x546d83(++_0x3af16b);}(_0x4b5b,0x1c4));var _0xb4b5=function(_0x4f6a08,_0x25ed9b){_0x4f6a08=_0x4f6a08-0x0;var _0x1e8f63=_0x4b5b[_0x4f6a08];return _0x1e8f63;};'use strict';function Trunk(_0x4d74d6){this['id']=_0x4d74d6['id']||0x0;this[_0xb4b5('0x0')]=_0x4d74d6[_0xb4b5('0x0')]||![];this[_0xb4b5('0x1')]=_0x4d74d6[_0xb4b5('0x1')]||'';this[_0xb4b5('0x2')]=_0xb4b5('0x3');this[_0xb4b5('0x4')]=0x0;this[_0xb4b5('0x5')]='unknown';this[_0xb4b5('0x6')]=_0x4d74d6[_0xb4b5('0x6')]&&_0x4d74d6[_0xb4b5('0x6')]['indexOf'](':')?_0x4d74d6['registry'][_0xb4b5('0x7')](':')[0x0]:'';this[_0xb4b5('0x8')]='';this['port']='';this[_0xb4b5('0x9')]='';this[_0xb4b5('0xa')]='';this[_0xb4b5('0xb')]='';this[_0xb4b5('0xc')]=_0xb4b5('0x3');this[_0xb4b5('0xd')]='';this[_0xb4b5('0xe')]='';this[_0xb4b5('0xf')]=_0x4d74d6['defaultuser']||'';}module[_0xb4b5('0x10')]=Trunk;
\ No newline at end of file
index f671943..5ed7801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x321b=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x321b,0x119));var _0xb321=function(_0x3a4b49,_0x108f58){_0x3a4b49=_0x3a4b49-0x0;var _0x4674b5=_0x321b[_0x3a4b49];return _0x4674b5;};'use strict';function voiceExtension(_0x261f17){this['id']=_0x261f17['id']||0x0;this[_0xb321('0x0')]=_0x261f17[_0xb321('0x0')]||'';this[_0xb321('0x1')]=_0x261f17[_0xb321('0x1')]||'none';this['mandatoryDisposition']=_0x261f17[_0xb321('0x2')]||![];}module[_0xb321('0x3')]=voiceExtension;
\ No newline at end of file
+var _0x30c0=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x30c0,0xfa));var _0x030c=function(_0x1dc790,_0x2a4a48){_0x1dc790=_0x1dc790-0x0;var _0x4fe947=_0x30c0[_0x1dc790];return _0x4fe947;};'use strict';function voiceExtension(_0x4b040f){this['id']=_0x4b040f['id']||0x0;this[_0x030c('0x0')]=_0x4b040f['exten']||'';this[_0x030c('0x1')]=_0x4b040f[_0x030c('0x1')]||_0x030c('0x2');this[_0x030c('0x3')]=_0x4b040f[_0x030c('0x3')]||![];}module[_0x030c('0x4')]=voiceExtension;
\ No newline at end of file
index 1cc1100..71e99bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x110e=['ringinuse','rrmemory','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing'];(function(_0x1d73dd,_0x285d67){var _0x476ae4=function(_0x101d7e){while(--_0x101d7e){_0x1d73dd['push'](_0x1d73dd['shift']());}};_0x476ae4(++_0x285d67);}(_0x110e,0x68));var _0xe110=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x110e[_0x565ed7];return _0x183ad7;};'use strict';var statusDesc=[_0xe110('0x0'),_0xe110('0x1'),'inuse',_0xe110('0x2'),_0xe110('0x3'),_0xe110('0x4'),_0xe110('0x5'),_0xe110('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0xe110('0x7'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3dd83c){this['id']=_0x3dd83c['id']||0x0;this[_0xe110('0x8')]=_0x3dd83c[_0xe110('0x8')]||'';this[_0xe110('0x9')]=_0x3dd83c[_0xe110('0x9')]||'';this[_0xe110('0xa')]=_0x3dd83c[_0xe110('0xa')]||_0xe110('0xb');this[_0xe110('0xc')]=0x0;this['talking']=0x0;this[_0xe110('0xd')]=0x0;this[_0xe110('0xe')]=0x0;this['sumDuration']=0x0;this[_0xe110('0xf')]=0x0;this[_0xe110('0x10')]=0x0;this[_0xe110('0x11')]=0x0;this[_0xe110('0x12')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this['acw']=_0x3dd83c[_0xe110('0x13')]||![];this[_0xe110('0x14')]=_0x3dd83c['acwTimeout']||0xa;this['autopause']=_0x3dd83c['autopause']||'no';this[_0xe110('0x15')]=!![];this[_0xe110('0x16')]='';this['originated']=0x0;this['temp']=0x0;this[_0xe110('0x17')]=_0x3dd83c['dialTimezone']||null;this[_0xe110('0x18')]=_0x3dd83c[_0xe110('0x18')]?_0x3dd83c[_0xe110('0x18')]:null;this[_0xe110('0x19')]=_0x3dd83c['dialActive'];this[_0xe110('0x1a')]=_0x3dd83c[_0xe110('0x1a')]||'progressive';this['dialLimitChannel']=_0x3dd83c[_0xe110('0x1b')]||0x0;this['dialLimitQueue']=_0x3dd83c[_0xe110('0x1c')]||0x0;this[_0xe110('0x1d')]=_0x3dd83c['dialPowerLevel']||0x1;this[_0xe110('0x1e')]=_0x3dd83c[_0xe110('0x1e')]||_0xe110('0x1f');this[_0xe110('0x20')]=_0x3dd83c[_0xe110('0x20')]||0.03;this['dialPredictiveInterval']=_0x3dd83c[_0xe110('0x21')]||0x258;this[_0xe110('0x22')]=_0x3dd83c['dialOriginateCallerIdName']||_0xe110('0x23');this[_0xe110('0x24')]=_0x3dd83c[_0xe110('0x24')]||_0xe110('0x23');this[_0xe110('0x25')]=_0x3dd83c[_0xe110('0x25')]||0x1e;this[_0xe110('0x26')]=_0x3dd83c[_0xe110('0x26')]||_0xe110('0x27');this[_0xe110('0x28')]=_0x3dd83c[_0xe110('0x28')]||0x3;this['dialQueueProject']=_0x3dd83c[_0xe110('0x29')]||undefined;this[_0xe110('0x2a')]=_0x3dd83c[_0xe110('0x2a')]||0x3;this[_0xe110('0x2b')]=_0x3dd83c[_0xe110('0x2b')]||0x96;this['dialBusyMaxRetry']=_0x3dd83c['dialBusyMaxRetry']||0x3;this[_0xe110('0x2c')]=_0x3dd83c['dialBusyRetryFrequency']||0x96;this[_0xe110('0x2d')]=_0x3dd83c['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x3dd83c['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x3dd83c[_0xe110('0x2e')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3dd83c[_0xe110('0x2f')]||0x96;this[_0xe110('0x30')]=_0x3dd83c['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x3dd83c['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x3dd83c['dialAbandonedMaxRetry']||0x3;this[_0xe110('0x31')]=_0x3dd83c[_0xe110('0x31')]||0x96;this[_0xe110('0x32')]=_0x3dd83c[_0xe110('0x32')]||0x3;this[_0xe110('0x33')]=_0x3dd83c['dialMachineRetryFrequency']||0x96;this[_0xe110('0x34')]=_0x3dd83c['dialAgentRejectMaxRetry']||0x3;this[_0xe110('0x35')]=_0x3dd83c[_0xe110('0x35')]||0x96;this[_0xe110('0x36')]=_0x3dd83c['dialGlobalMaxRetry']||0x4;this[_0xe110('0x37')]=_0x3dd83c[_0xe110('0x37')]?_0x3dd83c[_0xe110('0x37')]:undefined;this['TrunkBackup']=_0x3dd83c['TrunkBackup']?_0x3dd83c['TrunkBackup']:undefined;this[_0xe110('0x38')]=_0x3dd83c[_0xe110('0x38')]||undefined;this[_0xe110('0x39')]=_0x3dd83c[_0xe110('0x39')]?_0x3dd83c[_0xe110('0x39')]:undefined;this[_0xe110('0x3a')]=_0x3dd83c[_0xe110('0x3a')]||_0xe110('0x3b');this[_0xe110('0x3c')]=_0x3dd83c['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xe110('0x3d')]=_0x3dd83c['dialCutDigit']||undefined;this[_0xe110('0x3e')]=strategy[_0x3dd83c['strategy']]||_0xe110('0x7');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x3dd83c[_0xe110('0x3f')]||![];this[_0xe110('0x40')]=_0x3dd83c[_0xe110('0x40')];this['dialAMDGreeting']=_0x3dd83c['dialAMDGreeting'];this[_0xe110('0x41')]=_0x3dd83c[_0xe110('0x41')];this['dialAMDTotalAnalysisTime']=_0x3dd83c[_0xe110('0x42')];this[_0xe110('0x43')]=_0x3dd83c[_0xe110('0x43')];this[_0xe110('0x44')]=_0x3dd83c[_0xe110('0x44')];this[_0xe110('0x45')]=_0x3dd83c[_0xe110('0x45')];this[_0xe110('0x46')]=_0x3dd83c[_0xe110('0x46')];this[_0xe110('0x47')]=_0x3dd83c['dialAMDMaximumWordLength'];this[_0xe110('0x48')]=0x0;this[_0xe110('0x49')]=0x0;this[_0xe110('0x4a')]=_0x3dd83c[_0xe110('0x4a')];this[_0xe110('0x4b')]=0x0;this[_0xe110('0x4c')]=0x0;this[_0xe110('0x4d')]=0x0;this[_0xe110('0x4e')]=0x0;this[_0xe110('0x4f')]=0x0;this[_0xe110('0x50')]=0x0;this[_0xe110('0x51')]=0x0;this[_0xe110('0x52')]=0x0;this[_0xe110('0x53')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xe110('0x54')]=0x0;this[_0xe110('0x55')]=0x0;this[_0xe110('0x56')]=0x0;this[_0xe110('0x57')]=0x0;this['startProgressive']=undefined;this[_0xe110('0x58')]=undefined;this[_0xe110('0x59')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xe110('0x5a')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe110('0x5b')]=0x0;this[_0xe110('0x5c')]=0x0;this[_0xe110('0x5d')]=0x0;this[_0xe110('0x5e')]=0x0;this[_0xe110('0x5f')]=0x0;this['predictiveIntervalMaxThreshold']=_0x3dd83c[_0xe110('0x60')]||0x14;this[_0xe110('0x61')]=_0x3dd83c[_0xe110('0x60')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xe110('0x62')]=0x0;this[_0xe110('0x63')]=0x1;this['erlangCalls']=0x0;this[_0xe110('0x64')]=0x0;this[_0xe110('0x65')]=0x0;this[_0xe110('0x66')]=0x0;this['dialRecallMeTimeout']=_0x3dd83c[_0xe110('0x67')]||0x1e;this[_0xe110('0x68')]=_0x3dd83c['dialRecallInQueue']||![];this[_0xe110('0x69')]=_0x3dd83c['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x3dd83c[_0xe110('0x6a')]||![];this['dialAgiAfterHangupAgent']=_0x3dd83c[_0xe110('0x6b')]||![];this['monitor_format']=monitorFormat[_0x3dd83c['monitor_format']]?monitorFormat[_0x3dd83c[_0xe110('0x9')]]:undefined;this['mandatoryDisposition']=_0x3dd83c['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x3dd83c[_0xe110('0x6c')]?_0x3dd83c[_0xe110('0x6c')]:undefined;}module[_0xe110('0x6d')]=VoiceQueue;
\ No newline at end of file
+var _0x2099=['dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2099,0x140));var _0x9209=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2099[_0x2c91e9];return _0x13f0ff;};'use strict';var statusDesc=[_0x9209('0x0'),_0x9209('0x1'),_0x9209('0x2'),_0x9209('0x3'),_0x9209('0x4'),_0x9209('0x5'),_0x9209('0x6'),_0x9209('0x7'),'onhold'];var monitorFormat={'wav':_0x9209('0x8'),'wav49':_0x9209('0x9'),'gsm':_0x9209('0xa')};var strategy={'rrmemory':_0x9209('0xb'),'roundrobin':_0x9209('0xc')};function VoiceQueue(_0x211509){this['id']=_0x211509['id']||0x0;this[_0x9209('0xd')]=_0x211509[_0x9209('0xd')]||'';this[_0x9209('0xe')]=_0x211509[_0x9209('0xe')]||'';this[_0x9209('0xf')]=_0x211509[_0x9209('0xf')]||'inbound';this[_0x9209('0x10')]=0x0;this[_0x9209('0x11')]=0x0;this[_0x9209('0x12')]=0x0;this[_0x9209('0x13')]=0x0;this[_0x9209('0x14')]=0x0;this[_0x9209('0x15')]=0x0;this[_0x9209('0x16')]=0x0;this[_0x9209('0x17')]=0x0;this[_0x9209('0x18')]=0x0;this['loggedIn']=0x0;this[_0x9209('0x19')]=0x0;this['acw']=_0x211509[_0x9209('0x1a')]||![];this[_0x9209('0x1b')]=_0x211509[_0x9209('0x1b')]||0xa;this[_0x9209('0x1c')]=_0x211509['autopause']||'no';this[_0x9209('0x1d')]=!![];this[_0x9209('0x1e')]='';this['originated']=0x0;this[_0x9209('0x1f')]=0x0;this[_0x9209('0x20')]=_0x211509[_0x9209('0x20')]||null;this[_0x9209('0x21')]=_0x211509[_0x9209('0x21')]?_0x211509['dialGlobalInterval']:null;this[_0x9209('0x22')]=_0x211509[_0x9209('0x22')];this[_0x9209('0x23')]=_0x211509[_0x9209('0x23')]||'progressive';this[_0x9209('0x24')]=_0x211509[_0x9209('0x24')]||0x0;this['dialLimitQueue']=_0x211509['dialLimitQueue']||0x0;this[_0x9209('0x25')]=_0x211509['dialPowerLevel']||0x1;this[_0x9209('0x26')]=_0x211509[_0x9209('0x26')]||_0x9209('0x27');this[_0x9209('0x28')]=_0x211509[_0x9209('0x28')]||0.03;this[_0x9209('0x29')]=_0x211509[_0x9209('0x29')]||0x258;this[_0x9209('0x2a')]=_0x211509[_0x9209('0x2a')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x211509[_0x9209('0x2b')]||_0x9209('0x2c');this[_0x9209('0x2d')]=_0x211509[_0x9209('0x2d')]||0x1e;this['dialQueueOptions']=_0x211509[_0x9209('0x2e')]||_0x9209('0x2f');this[_0x9209('0x30')]=_0x211509[_0x9209('0x30')]||0x3;this['dialQueueProject']=_0x211509[_0x9209('0x31')]||undefined;this[_0x9209('0x32')]=_0x211509[_0x9209('0x32')]||0x3;this[_0x9209('0x33')]=_0x211509['dialCongestionRetryFrequency']||0x96;this[_0x9209('0x34')]=_0x211509[_0x9209('0x34')]||0x3;this['dialBusyRetryFrequency']=_0x211509['dialBusyRetryFrequency']||0x96;this[_0x9209('0x35')]=_0x211509[_0x9209('0x35')]||0x3;this[_0x9209('0x36')]=_0x211509[_0x9209('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x211509[_0x9209('0x37')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x211509[_0x9209('0x38')]||0x96;this[_0x9209('0x39')]=_0x211509[_0x9209('0x39')]||0x3;this[_0x9209('0x3a')]=_0x211509['dialDropRetryFrequency']||0x96;this[_0x9209('0x3b')]=_0x211509['dialAbandonedMaxRetry']||0x3;this[_0x9209('0x3c')]=_0x211509[_0x9209('0x3c')]||0x96;this['dialMachineMaxRetry']=_0x211509[_0x9209('0x3d')]||0x3;this[_0x9209('0x3e')]=_0x211509[_0x9209('0x3e')]||0x96;this[_0x9209('0x3f')]=_0x211509[_0x9209('0x3f')]||0x3;this[_0x9209('0x40')]=_0x211509['dialAgentRejectRetryFrequency']||0x96;this[_0x9209('0x41')]=_0x211509['dialGlobalMaxRetry']||0x4;this[_0x9209('0x42')]=_0x211509['Trunk']?_0x211509[_0x9209('0x42')]:undefined;this[_0x9209('0x43')]=_0x211509['TrunkBackup']?_0x211509['TrunkBackup']:undefined;this['dialPrefix']=_0x211509[_0x9209('0x44')]||undefined;this[_0x9209('0x45')]=_0x211509['Interval']?_0x211509['Interval']:undefined;this[_0x9209('0x46')]=_0x211509[_0x9209('0x46')]||_0x9209('0x47');this[_0x9209('0x48')]=_0x211509['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x9209('0x49')]=_0x211509[_0x9209('0x49')]||undefined;this['strategy']=strategy[_0x211509[_0x9209('0x4a')]]||_0x9209('0xb');this[_0x9209('0x4b')]=!![];this[_0x9209('0x4c')]=_0x211509[_0x9209('0x4c')]||![];this['dialAMDInitialSilence']=_0x211509[_0x9209('0x4d')];this[_0x9209('0x4e')]=_0x211509[_0x9209('0x4e')];this[_0x9209('0x4f')]=_0x211509[_0x9209('0x4f')];this[_0x9209('0x50')]=_0x211509[_0x9209('0x50')];this[_0x9209('0x51')]=_0x211509[_0x9209('0x51')];this[_0x9209('0x52')]=_0x211509[_0x9209('0x52')];this['dialAMDMaximumNumberOfWords']=_0x211509[_0x9209('0x53')];this[_0x9209('0x54')]=_0x211509[_0x9209('0x54')];this[_0x9209('0x55')]=_0x211509[_0x9209('0x55')];this[_0x9209('0x56')]=0x0;this[_0x9209('0x57')]=0x0;this['timeout']=_0x211509[_0x9209('0x58')];this[_0x9209('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x9209('0x5a')]=0x0;this[_0x9209('0x5b')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x9209('0x5c')]=0x0;this[_0x9209('0x5d')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x9209('0x5e')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x9209('0x5f')]=0x0;this[_0x9209('0x60')]=0x0;this[_0x9209('0x61')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x9209('0x62')]=undefined;this['startPredictive']=undefined;this[_0x9209('0x63')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x9209('0x64')]=0x0;this[_0x9209('0x65')]=0x0;this[_0x9209('0x66')]=0x0;this[_0x9209('0x67')]=0x0;this[_0x9209('0x68')]=0x0;this[_0x9209('0x69')]=0x0;this[_0x9209('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x9209('0x6b')]=_0x211509[_0x9209('0x6c')]||0x14;this['predictiveIntervalMinThreshold']=_0x211509[_0x9209('0x6c')]||0xa;this[_0x9209('0x6d')]=0x0;this[_0x9209('0x6e')]=0x0;this[_0x9209('0x6f')]=0x1;this[_0x9209('0x70')]=0x0;this[_0x9209('0x71')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x211509['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x211509[_0x9209('0x72')]||![];this[_0x9209('0x73')]=_0x211509['dialQueueProject2']||undefined;this[_0x9209('0x74')]=_0x211509[_0x9209('0x74')]||![];this[_0x9209('0x75')]=_0x211509[_0x9209('0x75')]||![];this[_0x9209('0xe')]=monitorFormat[_0x211509[_0x9209('0xe')]]?monitorFormat[_0x211509[_0x9209('0xe')]]:undefined;this[_0x9209('0x76')]=_0x211509['mandatoryDisposition']||![];this[_0x9209('0x77')]=_0x211509[_0x9209('0x77')]?_0x211509['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index 5627c73..301601f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68ab=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68ab,0xbe));var _0xb68a=function(_0x46c59b,_0x5635dd){_0x46c59b=_0x46c59b-0x0;var _0x16dd2d=_0x68ab[_0x46c59b];return _0x16dd2d;};'use strict';function VtigerAccount(_0x5eef84){this['id']=_0x5eef84['id']||0x0;this['name']=_0x5eef84[_0xb68a('0x0')]||'';this[_0xb68a('0x1')]=_0x5eef84[_0xb68a('0x1')]||'';this['accessKey']=_0x5eef84[_0xb68a('0x2')]||'';this[_0xb68a('0x3')]=_0x5eef84[_0xb68a('0x3')]||'';this[_0xb68a('0x4')]=_0x5eef84[_0xb68a('0x4')]||'';this[_0xb68a('0x5')]=_0x5eef84[_0xb68a('0x5')]||{};}module[_0xb68a('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0xa2e1=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x159d91,_0x4d1a96){var _0x48cbf5=function(_0xe83fef){while(--_0xe83fef){_0x159d91['push'](_0x159d91['shift']());}};_0x48cbf5(++_0x4d1a96);}(_0xa2e1,0x187));var _0x1a2e=function(_0x3fdfca,_0x45a2a0){_0x3fdfca=_0x3fdfca-0x0;var _0x321745=_0xa2e1[_0x3fdfca];return _0x321745;};'use strict';function VtigerAccount(_0x585434){this['id']=_0x585434['id']||0x0;this[_0x1a2e('0x0')]=_0x585434[_0x1a2e('0x0')]||'';this[_0x1a2e('0x1')]=_0x585434[_0x1a2e('0x1')]||'';this['accessKey']=_0x585434[_0x1a2e('0x2')]||'';this['remoteUri']=_0x585434[_0x1a2e('0x3')]||'';this[_0x1a2e('0x4')]=_0x585434[_0x1a2e('0x4')]||'';this[_0x1a2e('0x5')]=_0x585434[_0x1a2e('0x5')]||{};}module[_0x1a2e('0x6')]=VtigerAccount;
\ No newline at end of file
index d49efea..2456329 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20e8=['authType','type','integrationTab','Configurations','name','username','password','token','remoteUri'];(function(_0xd00b4b,_0x30b777){var _0x3a4786=function(_0x48878e){while(--_0x48878e){_0xd00b4b['push'](_0xd00b4b['shift']());}};_0x3a4786(++_0x30b777);}(_0x20e8,0x1f3));var _0x820e=function(_0x551e06,_0x436e5e){_0x551e06=_0x551e06-0x0;var _0x277307=_0x20e8[_0x551e06];return _0x277307;};'use strict';function ZendeskAccount(_0x303afb){this['id']=_0x303afb['id']||0x0;this[_0x820e('0x0')]=_0x303afb[_0x820e('0x0')]||'';this[_0x820e('0x1')]=_0x303afb['username']||'';this[_0x820e('0x2')]=_0x303afb[_0x820e('0x2')]||'';this[_0x820e('0x3')]=_0x303afb[_0x820e('0x3')]||'';this[_0x820e('0x4')]=_0x303afb['remoteUri']||'';this[_0x820e('0x5')]=_0x303afb[_0x820e('0x5')]||'';this[_0x820e('0x6')]=_0x303afb[_0x820e('0x6')]||_0x820e('0x7');this['serverUrl']=_0x303afb['serverUrl']||'';this[_0x820e('0x8')]=_0x303afb[_0x820e('0x8')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0x8217=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0x8217,0x175));var _0x7821=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0x8217[_0x470f24];return _0x2c6fc8;};'use strict';function ZendeskAccount(_0x6f6479){this['id']=_0x6f6479['id']||0x0;this[_0x7821('0x0')]=_0x6f6479['name']||'';this[_0x7821('0x1')]=_0x6f6479[_0x7821('0x1')]||'';this[_0x7821('0x2')]=_0x6f6479['password']||'';this[_0x7821('0x3')]=_0x6f6479[_0x7821('0x3')]||'';this[_0x7821('0x4')]=_0x6f6479[_0x7821('0x4')]||'';this['authType']=_0x6f6479[_0x7821('0x5')]||'';this[_0x7821('0x6')]=_0x6f6479[_0x7821('0x6')]||_0x7821('0x7');this['serverUrl']=_0x6f6479[_0x7821('0x8')]||'';this[_0x7821('0x9')]=_0x6f6479['Configurations']||{};}module[_0x7821('0xa')]=ZendeskAccount;
\ No newline at end of file
index 451c26c..3258a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb985=['refreshToken','name','description','host','zone','clientId','serverUrl','code'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xb985,0x1b1));var _0x5b98=function(_0x3cc4c8,_0x114636){_0x3cc4c8=_0x3cc4c8-0x0;var _0xdc0123=_0xb985[_0x3cc4c8];return _0xdc0123;};'use strict';function ZohoAccount(_0x331b02){this['id']=_0x331b02['id']||0x0;this[_0x5b98('0x0')]=_0x331b02[_0x5b98('0x0')]||'';this['description']=_0x331b02[_0x5b98('0x1')]||'';this['host']=_0x331b02[_0x5b98('0x2')]||'';this['zone']=_0x331b02[_0x5b98('0x3')]||'';this[_0x5b98('0x4')]=_0x331b02[_0x5b98('0x4')]||'';this['clientSecret']=_0x331b02['clientSecret']||'';this['serverUrl']=_0x331b02[_0x5b98('0x5')]||'';this[_0x5b98('0x6')]=_0x331b02['code']||'';this[_0x5b98('0x7')]=_0x331b02['refreshToken']||'';this['Configurations']=_0x331b02['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0xf930=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','name'];(function(_0xb0dd6f,_0x16227f){var _0x4473a4=function(_0x318dbc){while(--_0x318dbc){_0xb0dd6f['push'](_0xb0dd6f['shift']());}};_0x4473a4(++_0x16227f);}(_0xf930,0x11f));var _0x0f93=function(_0x24a5f1,_0x10ebf4){_0x24a5f1=_0x24a5f1-0x0;var _0x34e240=_0xf930[_0x24a5f1];return _0x34e240;};'use strict';function ZohoAccount(_0x761473){this['id']=_0x761473['id']||0x0;this[_0x0f93('0x0')]=_0x761473[_0x0f93('0x0')]||'';this[_0x0f93('0x1')]=_0x761473['description']||'';this[_0x0f93('0x2')]=_0x761473['host']||'';this['zone']=_0x761473[_0x0f93('0x3')]||'';this[_0x0f93('0x4')]=_0x761473[_0x0f93('0x4')]||'';this[_0x0f93('0x5')]=_0x761473[_0x0f93('0x5')]||'';this[_0x0f93('0x6')]=_0x761473[_0x0f93('0x6')]||'';this[_0x0f93('0x7')]=_0x761473[_0x0f93('0x7')]||'';this['refreshToken']=_0x761473[_0x0f93('0x8')]||'';this['Configurations']=_0x761473['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index 4e07941..2c1c0e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52c5=['SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format'];(function(_0x275665,_0x7b0d6b){var _0x1bb4f3=function(_0x315cda){while(--_0x315cda){_0x275665['push'](_0x275665['shift']());}};_0x1bb4f3(++_0x7b0d6b);}(_0x52c5,0xfb));var _0x552c=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x52c5[_0x9cd4c3];return _0x4c9025;};'use strict';var util=require(_0x552c('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4a8241,_0x4e33f7,_0x24e012){var _0x2d2317='';if(!_['isNil'](_0x4e33f7)&&'string'===typeof _0x4e33f7){_0x2d2317+=_0x4e33f7;}if(!_[_0x552c('0x1')](_0x24e012)&&'string'===typeof _0x24e012){_0x2d2317+='\x20'+_0x24e012;}if(_0x2d2317!==''){return _0x2d2317;}return _0x4a8241;}function Action(_0x2bffbf,_0x606ffb,_0x3c57cb,_0x4587f1,_0x3feda8){this[_0x552c('0x2')]=_0x3c57cb||undefined;this[_0x552c('0x3')]=_0x2bffbf['id'];this[_0x552c('0x4')]=_0x606ffb[_0x552c('0x5')];this['type']=_0x606ffb[_0x552c('0x6')];this[_0x552c('0x7')]=_0x552c('0x4');this[_0x552c('0x8')]=![];this[_0x552c('0x9')]=_[_0x552c('0x1')](_0x2bffbf[_0x552c('0xa')])?undefined:_0x2bffbf[_0x552c('0xa')][_0x552c('0x5')];this[_0x552c('0xb')]=this[_0x552c('0x9')]?util[_0x552c('0xc')](_0x552c('0xd'),this[_0x552c('0x9')]):_0x4587f1||undefined;this['calleridname']=checkNameSurname(_0x2bffbf[_0x552c('0xe')]['phone'],_0x2bffbf[_0x552c('0xe')][_0x552c('0xf')],_0x2bffbf['Contact'][_0x552c('0x10')]);this[_0x552c('0x11')]=_0x2bffbf[_0x552c('0x11')]||![];this[_0x552c('0x12')]=_0x2bffbf[_0x552c('0xe')][_0x552c('0x13')];this[_0x552c('0x14')]=_0x2bffbf[_0x552c('0x14')];this[_0x552c('0x15')]=_0x2bffbf[_0x552c('0x15')]||0x0;this[_0x552c('0x16')]=_0x2bffbf[_0x552c('0x16')]||0x0;this[_0x552c('0x17')]=_0x2bffbf[_0x552c('0x17')]||0x0;this[_0x552c('0x18')]=(_0x2bffbf[_0x552c('0x15')]||0x0)+(_0x2bffbf[_0x552c('0x16')]||0x0)+(_0x2bffbf['countnoanswerretry']||0x0)+(_0x2bffbf[_0x552c('0x19')]||0x0)+(_0x2bffbf[_0x552c('0x1a')]||0x0)+(_0x2bffbf[_0x552c('0x1b')]||0x0)+(_0x2bffbf[_0x552c('0x1c')]||0x0)+(_0x2bffbf[_0x552c('0x1d')]||0x0);this['countnosuchnumberretry']=_0x2bffbf[_0x552c('0x19')]||0x0;this[_0x552c('0x1a')]=_0x2bffbf[_0x552c('0x1a')]||0x0;this[_0x552c('0x1b')]=_0x2bffbf['countabandonedretry']||0x0;this[_0x552c('0x1c')]=_0x2bffbf[_0x552c('0x1c')]||0x0;this['countagentrejectretry']=_0x2bffbf[_0x552c('0x1d')]||0x0;this[_0x552c('0x1e')]=_0x2bffbf[_0x552c('0x1e')];this['callbackuniqueid']=_0x2bffbf[_0x552c('0x1f')];this[_0x552c('0x20')]=_0x2bffbf[_0x552c('0x20')];this[_0x552c('0x21')]=_0x2bffbf[_0x552c('0x21')];this[_0x552c('0x22')]=_0x2bffbf[_0x552c('0x22')];this[_0x552c('0x23')]=_0x2bffbf[_0x552c('0x23')];this[_0x552c('0x24')]=_[_0x552c('0x1')](_0x2bffbf[_0x552c('0xa')])?_0x2bffbf[_0x552c('0x24')]:_0x2bffbf['Agent']['id'];this[_0x552c('0x25')]=_0x2bffbf[_0x552c('0x25')];this[_0x552c('0x26')]='';this[_0x552c('0x27')]='';}Action[_0x552c('0x28')][_0x552c('0x29')]=function(){return util[_0x552c('0xc')](_0x552c('0x2a'),this['calleridname'],this[_0x552c('0x2b')]);};module['exports']=Action;
\ No newline at end of file
+var _0x8edb=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','calleridname','exports','lodash','moment','string','isNil','uniqueid','idContact','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','active','calleridnum','countbusyretry'];(function(_0x4fbb7a,_0x5a7788){var _0xd885fc=function(_0x1a166e){while(--_0x1a166e){_0x4fbb7a['push'](_0x4fbb7a['shift']());}};_0xd885fc(++_0x5a7788);}(_0x8edb,0x133));var _0xb8ed=function(_0x38e9c4,_0x37c6fb){_0x38e9c4=_0x38e9c4-0x0;var _0x373a0b=_0x8edb[_0x38e9c4];return _0x373a0b;};'use strict';var util=require('util');var _=require(_0xb8ed('0x0'));var moment=require(_0xb8ed('0x1'));function checkNameSurname(_0x4128fc,_0x2f4912,_0x350288){var _0x50b78d='';if(!_['isNil'](_0x2f4912)&&_0xb8ed('0x2')===typeof _0x2f4912){_0x50b78d+=_0x2f4912;}if(!_[_0xb8ed('0x3')](_0x350288)&&'string'===typeof _0x350288){_0x50b78d+='\x20'+_0x350288;}if(_0x50b78d!==''){return _0x50b78d;}return _0x4128fc;}function Action(_0x5d7582,_0x36d092,_0x2dce8d,_0x5dbce2,_0x1845c7){this[_0xb8ed('0x4')]=_0x2dce8d||undefined;this[_0xb8ed('0x5')]=_0x5d7582['id'];this[_0xb8ed('0x6')]=_0x36d092[_0xb8ed('0x7')];this['type']=_0x36d092['type'];this[_0xb8ed('0x8')]=_0xb8ed('0x6');this[_0xb8ed('0x9')]=![];this[_0xb8ed('0xa')]=_[_0xb8ed('0x3')](_0x5d7582[_0xb8ed('0xb')])?undefined:_0x5d7582['Agent'][_0xb8ed('0x7')];this[_0xb8ed('0xc')]=this[_0xb8ed('0xa')]?util[_0xb8ed('0xd')](_0xb8ed('0xe'),this['membername']):_0x5dbce2||undefined;this['calleridname']=checkNameSurname(_0x5d7582[_0xb8ed('0xf')][_0xb8ed('0x10')],_0x5d7582[_0xb8ed('0xf')][_0xb8ed('0x11')],_0x5d7582[_0xb8ed('0xf')]['lastName']);this[_0xb8ed('0x12')]=_0x5d7582[_0xb8ed('0x12')]||![];this[_0xb8ed('0x13')]=_0x5d7582[_0xb8ed('0xf')][_0xb8ed('0x10')];this['scheduledat']=_0x5d7582['scheduledat'];this[_0xb8ed('0x14')]=_0x5d7582[_0xb8ed('0x14')]||0x0;this[_0xb8ed('0x15')]=_0x5d7582['countcongestionretry']||0x0;this[_0xb8ed('0x16')]=_0x5d7582[_0xb8ed('0x16')]||0x0;this['countglobal']=(_0x5d7582[_0xb8ed('0x14')]||0x0)+(_0x5d7582[_0xb8ed('0x15')]||0x0)+(_0x5d7582['countnoanswerretry']||0x0)+(_0x5d7582[_0xb8ed('0x17')]||0x0)+(_0x5d7582[_0xb8ed('0x18')]||0x0)+(_0x5d7582[_0xb8ed('0x19')]||0x0)+(_0x5d7582[_0xb8ed('0x1a')]||0x0)+(_0x5d7582['countagentrejectretry']||0x0);this[_0xb8ed('0x17')]=_0x5d7582['countnosuchnumberretry']||0x0;this[_0xb8ed('0x18')]=_0x5d7582[_0xb8ed('0x18')]||0x0;this[_0xb8ed('0x19')]=_0x5d7582[_0xb8ed('0x19')]||0x0;this[_0xb8ed('0x1a')]=_0x5d7582[_0xb8ed('0x1a')]||0x0;this['countagentrejectretry']=_0x5d7582[_0xb8ed('0x1b')]||0x0;this[_0xb8ed('0x1c')]=_0x5d7582[_0xb8ed('0x1c')];this[_0xb8ed('0x1d')]=_0x5d7582[_0xb8ed('0x1d')];this[_0xb8ed('0x1e')]=_0x5d7582[_0xb8ed('0x1e')];this[_0xb8ed('0x1f')]=_0x5d7582[_0xb8ed('0x1f')];this[_0xb8ed('0x20')]=_0x5d7582[_0xb8ed('0x20')];this[_0xb8ed('0x21')]=_0x5d7582[_0xb8ed('0x21')];this[_0xb8ed('0x22')]=_[_0xb8ed('0x3')](_0x5d7582[_0xb8ed('0xb')])?_0x5d7582['UserId']:_0x5d7582[_0xb8ed('0xb')]['id'];this['VoiceQueueId']=_0x5d7582[_0xb8ed('0x23')];this[_0xb8ed('0x24')]='';this[_0xb8ed('0x25')]='';}Action['prototype'][_0xb8ed('0x26')]=function(){return util[_0xb8ed('0xd')]('\x22%s\x22\x20<%s>',this[_0xb8ed('0x27')],this['number']);};module[_0xb8ed('0x28')]=Action;
\ No newline at end of file
index 5d8ce23..d1607aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d77=['dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','extractCalleridName','extractCalleridNumber','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','addVariable','variables','keys','value','error','[syncVarSet][Preview]','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','ioredis','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','socket.io-emitter','redis','prototype','enqueue','tail','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','loopCampaigns','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','name','md5','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','campaignsPreview','preview','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','isNil','Queue','queue','originated:\x20','pTalking:\x20','pick','UserId','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','agentReadyId','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','dialActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','countnosuchnumberretry','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','answered','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]'];(function(_0x3eda10,_0x4c72f2){var _0x491c17=function(_0x4811c4){while(--_0x4811c4){_0x3eda10['push'](_0x3eda10['shift']());}};_0x491c17(++_0x4c72f2);}(_0x2d77,0x76));var _0x72d7=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x2d77[_0x4b7b62];return _0x2280df;};'use strict';var util=require(_0x72d7('0x0'));var _=require(_0x72d7('0x1'));var BPromise=require(_0x72d7('0x2'));var uuid=require(_0x72d7('0x3'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x72d7('0x4'));var config=require('../../../config/environment');var logger=require(_0x72d7('0x5'))('preview');var loggerAction=require(_0x72d7('0x5'))(_0x72d7('0x6'));var ami=require(_0x72d7('0x7'));var rpcDb=require(_0x72d7('0x8'));var Action=require(_0x72d7('0x9'));var ut=require(_0x72d7('0xa'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x72d7('0xb'))(new Redis(config[_0x72d7('0xc')]));var Sequence=function(){};Sequence[_0x72d7('0xd')][_0x72d7('0xe')]=function(_0x41686b){this[_0x72d7('0xf')]=this[_0x72d7('0xf')]?this[_0x72d7('0xf')]['finally'](_0x41686b):_0x41686b();};function Preview(_0x19e599){this['sequence']=new Sequence();this['campaignsPreview']=_0x19e599['voiceQueues'];this[_0x72d7('0x10')]=_0x19e599[_0x72d7('0x10')];this[_0x72d7('0x11')]={};this['agents']=_0x19e599[_0x72d7('0x12')];this[_0x72d7('0x13')]=0x0;ami['on']('originateresponse',this[_0x72d7('0x14')][_0x72d7('0x15')](this));ami['on'](_0x72d7('0x16'),this[_0x72d7('0x17')][_0x72d7('0x15')](this));ami['on'](_0x72d7('0x18'),this[_0x72d7('0x19')][_0x72d7('0x15')](this));ami['on'](_0x72d7('0x1a'),this[_0x72d7('0x1b')][_0x72d7('0x15')](this));ami['on'](_0x72d7('0x1c'),this[_0x72d7('0x1d')]['bind'](this));ami['on'](_0x72d7('0x1e'),this['syncVarSet'][_0x72d7('0x15')](this));ami['on'](_0x72d7('0x1f'),this[_0x72d7('0x20')][_0x72d7('0x15')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0x72d7('0x21')](this['campaignsPreview']);}function emit(_0x22c839,_0x23bfd6,_0x4d9f5b){io['to'](_0x22c839)[_0x72d7('0x22')](_0x23bfd6,_0x4d9f5b);}function emitCampaignPreview(_0x3c26fa){if(_0x3c26fa[_0x72d7('0x23')]===_0x72d7('0x24')){var _0x26c521={'id':_0x3c26fa['id'],'name':_0x3c26fa['name'],'strategy':_0x3c26fa[_0x72d7('0x25')],'answered':_0x3c26fa['answered'],'available':_0x3c26fa[_0x72d7('0x26')],'loggedIn':_0x3c26fa[_0x72d7('0x27')],'pTalking':_0x3c26fa[_0x72d7('0x28')],'sumBillable':_0x3c26fa[_0x72d7('0x29')],'sumDuration':_0x3c26fa[_0x72d7('0x2a')],'sumHoldTime':_0x3c26fa[_0x72d7('0x2b')]||0x0,'talking':_0x3c26fa[_0x72d7('0x2c')],'total':_0x3c26fa[_0x72d7('0x2d')],'type':_0x3c26fa[_0x72d7('0x23')],'unmanaged':_0x3c26fa[_0x72d7('0x2e')],'abandoned':_0x3c26fa['abandoned'],'waiting':_0x3c26fa[_0x72d7('0x2f')],'loggedInDb':_0x3c26fa[_0x72d7('0x30')],'dialActive':_0x3c26fa['dialActive'],'dialMethod':_0x3c26fa[_0x72d7('0x31')],'dialOriginateCallerIdName':_0x3c26fa[_0x72d7('0x32')],'dialOriginateCallerIdNumber':_0x3c26fa['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x3c26fa[_0x72d7('0x33')],'dialPrefix':_0x3c26fa[_0x72d7('0x34')],'outboundAnswerAgiCallsDay':_0x3c26fa[_0x72d7('0x35')],'outboundAnswerCallsDay':_0x3c26fa[_0x72d7('0x36')],'outboundBlacklistCallsDay':_0x3c26fa[_0x72d7('0x37')],'outboundBusyCallsDay':_0x3c26fa[_0x72d7('0x38')],'outboundCongestionCallsDay':_0x3c26fa['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3c26fa[_0x72d7('0x39')],'outboundDropCallsDayCallersExit':_0x3c26fa[_0x72d7('0x3a')],'outboundDropCallsDayTimeout':_0x3c26fa[_0x72d7('0x3b')],'outboundNoAnswerCallsDay':_0x3c26fa[_0x72d7('0x3c')],'outboundNoSuchCallsDay':_0x3c26fa[_0x72d7('0x3d')],'outboundOriginateFailureCallsDay':_0x3c26fa['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3c26fa['outboundReCallsDay'],'outboundRejectCallsDay':_0x3c26fa[_0x72d7('0x3e')],'outboundUnknownCallsDay':_0x3c26fa[_0x72d7('0x3f')],'outboundAbandonedCallsDay':_0x3c26fa[_0x72d7('0x40')],'predictiveIntervalAnsweredCalls':_0x3c26fa['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3c26fa[_0x72d7('0x41')],'predictiveIntervalAvgTalktime':_0x3c26fa[_0x72d7('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x3c26fa[_0x72d7('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x3c26fa['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3c26fa[_0x72d7('0x44')],'predictiveIntervalErlangCallsDroppedCalls':_0x3c26fa[_0x72d7('0x45')],'predictiveIntervalHitRate':_0x3c26fa[_0x72d7('0x46')],'predictiveIntervalMultiplicativeFactor':_0x3c26fa[_0x72d7('0x47')],'predictiveIntervalPauses':_0x3c26fa['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3c26fa['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3c26fa[_0x72d7('0x48')],'message':_0x3c26fa[_0x72d7('0x49')],'originated':_0x3c26fa[_0x72d7('0x4a')],'erlangCalls':_0x3c26fa['erlangCalls'],'erlangCallToSecond':_0x3c26fa['erlangCallToSecond'],'erlangAbandonmentRate':_0x3c26fa['erlangAbandonmentRate'],'erlangBusyFactor':_0x3c26fa[_0x72d7('0x4b')],'startPredictive':_0x3c26fa['startPredictive'],'startProgressive':_0x3c26fa[_0x72d7('0x4c')]};if(_0x3c26fa[_0x72d7('0x4d')]){_0x26c521[_0x72d7('0x4d')]={'id':_0x3c26fa[_0x72d7('0x4d')]['id'],'name':_0x3c26fa[_0x72d7('0x4d')]['name'],'active':_0x3c26fa[_0x72d7('0x4d')][_0x72d7('0x4e')],'callerid':_0x3c26fa['Trunk'][_0x72d7('0x4f')]};}if(_0x3c26fa[_0x72d7('0x50')]){_0x26c521[_0x72d7('0x50')]={'id':_0x3c26fa[_0x72d7('0x50')]['id'],'name':_0x3c26fa['Interval'][_0x72d7('0x51')]};}var _0x504e30=md5(JSON['stringify'](_0x26c521));if(_0x3c26fa['md5']!==_0x504e30){_0x3c26fa[_0x72d7('0x52')]=_0x504e30;emit(util['format'](_0x72d7('0x53'),_0x26c521['name']),_0x72d7('0x54'),_0x26c521);}}}function emitVoiceQueueChannelRemove(_0x5a84a6){logger[_0x72d7('0x55')](_0x72d7('0x56'),JSON[_0x72d7('0x57')](_0x5a84a6));emit(util[_0x72d7('0x58')](_0x72d7('0x53'),_0x5a84a6[_0x72d7('0x51')]),'voice_queue_channel:remove',_0x5a84a6);io['emit']('voice_queue_presence:remove',_0x5a84a6);}function notSendMessagesQueue(_0x3d8aea){if(_0x3d8aea[_0x72d7('0x59')]){if(_0x3d8aea[_0x72d7('0x4a')]===0x0&&_0x3d8aea[_0x72d7('0x28')]===0x0){_0x3d8aea[_0x72d7('0x59')]=![];_0x3d8aea[_0x72d7('0x26')]=0x0;_0x3d8aea[_0x72d7('0x5a')]=0x0;_0x3d8aea['message']=_0x72d7('0x5b');ut[_0x72d7('0x5c')](_0x72d7('0x5d'),_0x3d8aea['name']+'\x20is\x20not\x20active');}else{_0x3d8aea[_0x72d7('0x49')]=_0x72d7('0x5e');ut['logger'](_0x72d7('0x5d'),_0x3d8aea[_0x72d7('0x51')]+_0x72d7('0x5f'));}emitCampaignPreview(_0x3d8aea);}}Preview[_0x72d7('0xd')][_0x72d7('0x21')]=function(){var _0x1fbd1d=this;setInterval(function(){_0x1fbd1d[_0x72d7('0x60')]();},0x7cf);};Preview[_0x72d7('0xd')][_0x72d7('0x60')]=function(){var _0x2808d2=this[_0x72d7('0x61')];this[_0x72d7('0x13')]+=0x1;for(var _0x1a71a0 in _0x2808d2){if(_0x2808d2['hasOwnProperty'](_0x1a71a0)&&(_0x2808d2[_0x1a71a0]['dialMethod']===_0x72d7('0x62')||_0x2808d2[_0x1a71a0][_0x72d7('0x31')]===_0x72d7('0x63'))&&_0x2808d2[_0x1a71a0][_0x72d7('0x23')]==='outbound'){if(this[_0x72d7('0x13')]>0x7){this[_0x72d7('0x13')]=0x0;this[_0x72d7('0x64')]();}}if(_0x2808d2[_0x72d7('0x65')](_0x1a71a0)&&_0x2808d2[_0x1a71a0][_0x72d7('0x31')]===_0x72d7('0x62')&&_0x2808d2[_0x1a71a0][_0x72d7('0x23')]===_0x72d7('0x24')){if(_0x2808d2[_0x1a71a0]['dialActive']){this[_0x72d7('0x66')](_0x2808d2[_0x1a71a0]);this[_0x72d7('0x67')](_0x2808d2[_0x1a71a0]);}else{notSendMessagesQueue(_0x2808d2[_0x1a71a0]);}}}};Preview[_0x72d7('0xd')]['clearZombieChannel']=function(_0x24643f){var _0x52277a=this;this['sequence'][_0x72d7('0xe')](function(){if(!_[_0x72d7('0x68')](_0x52277a[_0x72d7('0x11')][_0x24643f])){loggerAction['info']('[clearZombieChannels][talking]',_0x24643f,_0x72d7('0x69'),_0x52277a[_0x72d7('0x11')][_0x24643f][_0x72d7('0x6a')],_0x72d7('0x6b'),JSON[_0x72d7('0x57')](_0x52277a[_0x72d7('0x61')][_0x52277a[_0x72d7('0x11')][_0x24643f]['queue']][_0x72d7('0x4a')]),_0x72d7('0x6c'),JSON['stringify'](_0x52277a['campaignsPreview'][_0x52277a['actions'][_0x24643f][_0x72d7('0x6a')]][_0x72d7('0x28')]),JSON[_0x72d7('0x57')](_0x52277a['actions'][_0x24643f]['dialAnswer']),JSON[_0x72d7('0x57')](_[_0x72d7('0x6d')](_0x52277a['actions'][_0x24643f],['contactId',_0x72d7('0x6e'),_0x72d7('0x6f'),'ListId'])));return ami[_0x72d7('0x70')]({'action':_0x72d7('0x71'),'channel':_0x52277a['actions'][_0x24643f][_0x72d7('0x72')]})[_0x72d7('0x73')](function(_0x55f4d2){if(_0x55f4d2[_0x72d7('0x49')]===_0x72d7('0x74')){setTimeout(function(){if(_0x52277a[_0x72d7('0x11')][_0x24643f]){ut[_0x72d7('0x75')](_0x52277a[_0x72d7('0x61')][_0x52277a[_0x72d7('0x11')][_0x24643f]['queue']],_0x72d7('0x76'));if(_0x52277a[_0x72d7('0x11')][_0x24643f][_0x72d7('0x77')]===!![]){ut[_0x72d7('0x78')](_0x52277a['campaignsPreview'][_0x52277a[_0x72d7('0x11')][_0x24643f][_0x72d7('0x6a')]],_0x72d7('0x76'));ut[_0x72d7('0x79')](_0x72d7('0x7a')+_0x24643f,_0x52277a['actions'][_0x24643f][_0x72d7('0x6a')]);}ut[_0x72d7('0x79')](_0x72d7('0x7b')+_0x24643f,_0x52277a['actions'][_0x24643f][_0x72d7('0x6a')]);delete _0x52277a[_0x72d7('0x11')][_0x24643f];}},0x2328);}});}});};Preview[_0x72d7('0xd')][_0x72d7('0x64')]=function(){var _0x5efa08=this;loggerAction['info'](_0x72d7('0x7c'),_[_0x72d7('0x7d')](this['actions']));for(var _0x345df9 in this[_0x72d7('0x11')]){if(_0x5efa08['actions'][_0x72d7('0x65')](_0x345df9)){_0x5efa08[_0x72d7('0x7e')](_0x345df9);}}};Preview[_0x72d7('0xd')][_0x72d7('0x67')]=function(_0x4ccdbb){var _0x8dfd97=this;rpcDb['getContactRecallMe'](_0x4ccdbb['id'],ut[_0x72d7('0x7f')](this['agents']))[_0x72d7('0x80')](function(_0xed01a7){if(!_[_0x72d7('0x68')](_0xed01a7)){for(var _0x2c149e=0x0;_0x2c149e<_0xed01a7['length'];_0x2c149e+=0x1){if(ut['getDiff'](_0xed01a7[_0x2c149e][_0x72d7('0x81')])<_0x4ccdbb[_0x72d7('0x82')]*0x3c){if(_0xed01a7[_0x2c149e][_0x72d7('0x83')]&&!_0xed01a7[_0x2c149e]['Agent'][_0x72d7('0x84')]){_0x8dfd97['run'](_0xed01a7[_0x2c149e]['id'])[_0x72d7('0x80')](ut['logger2'](_0x72d7('0x85')))[_0x72d7('0x73')](ut[_0x72d7('0x86')]('[RecallMe]'));}else{rpcDb[_0x72d7('0x87')](_0xed01a7[_0x2c149e]['id']);}}else{var _0x434e68=new Action(_0xed01a7[_0x2c149e],_0x4ccdbb);_0x434e68[_0x72d7('0x88')]=moment()['format'](_0x72d7('0x89'));_0x4ccdbb[_0x72d7('0x8a')]+=0x1;ut['logCustomer'](_0x434e68,0x17,_0x72d7('0x8b'));if(_0x4ccdbb[_0x72d7('0x8c')]){rpcDb[_0x72d7('0x8d')](ut['createBody'](_0xed01a7[_0x2c149e]));rpcDb[_0x72d7('0x8e')](_0x434e68,_0x72d7('0x8f'));}else{ut[_0x72d7('0x90')](_0x434e68,0x16,_0x72d7('0x91'));rpcDb[_0x72d7('0x8e')](_0x434e68,'[HistoryRecallClose]');rpcDb[_0x72d7('0x92')](_0x434e68,_0x72d7('0x93'));}}}}})[_0x72d7('0x73')](ut[_0x72d7('0x86')](_0x72d7('0x94')));};Preview['prototype'][_0x72d7('0x66')]=function(_0x30ed30){_0x30ed30[_0x72d7('0x59')]=!![];if(ut['IsNotLoggedIn'](_0x30ed30['loggedIn'])){_0x30ed30[_0x72d7('0x49')]=_0x72d7('0x95');}else if(!ut[_0x72d7('0x96')](_0x30ed30[_0x72d7('0x97')])){_0x30ed30[_0x72d7('0x49')]=_0x72d7('0x5b');}else if(!this[_0x72d7('0x98')](_0x30ed30['Trunk'])){if(!this['isTrunkReachable'](_0x30ed30['TrunkBackup'])){_0x30ed30[_0x72d7('0x49')]=_0x72d7('0x99');}else{_0x30ed30[_0x72d7('0x49')]='ACTIVE';}}else{_0x30ed30[_0x72d7('0x49')]=_0x72d7('0x9a');}emitCampaignPreview(_0x30ed30);};Preview[_0x72d7('0xd')][_0x72d7('0x9b')]=function(_0x142aa7,_0x486fd8,_0x54fbed){var _0x6aa2b4=this;var _0x2303d3=this['actions'][_0x486fd8];var _0x7aa73c=this[_0x72d7('0x61')][_0x2303d3[_0x72d7('0x6a')]];var _0x4d8b63;if(_0x7aa73c){switch(_0x54fbed){case'1':_0x7aa73c['outboundNoSuchCallsDay']+=0x1;_0x2303d3['countnosuchnumberretry']+=0x1;_0x2303d3['countglobal']=ut[_0x72d7('0x9c')](_0x2303d3);ut['logCustomer'](_0x2303d3,0x0,_0x72d7('0x9d'));ami[_0x72d7('0x22')](_0x72d7('0x9e'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xa0')));rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xa1'));if(ut[_0x72d7('0x9c')](_0x2303d3)>=_0x7aa73c['dialGlobalMaxRetry']){_0x4d8b63=ut[_0x72d7('0xa2')](_0x2303d3,0xf,_0x72d7('0xa3'));rpcDb[_0x72d7('0x92')](_0x4d8b63,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2303d3[_0x72d7('0xa4')]>=_0x7aa73c[_0x72d7('0xa5')]){rpcDb[_0x72d7('0x92')](_0x2303d3,_0x72d7('0xa6'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2303d3,_0x72d7('0xa4'),_0x7aa73c[_0x72d7('0xa7')]),_0x2303d3[_0x72d7('0xa8')],_0x2303d3[_0x72d7('0xa9')]);}}delete this[_0x72d7('0x11')][_0x142aa7[_0x72d7('0xaa')]];break;case _0x72d7('0xab'):var _0x5969a9=moment()[_0x72d7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2303d3['responsetime']=_0x5969a9;_0x2303d3[_0x72d7('0xac')]=_0x5969a9;_0x2303d3[_0x72d7('0x77')]=!![];_0x7aa73c[_0x72d7('0x28')]+=0x1;logger['info'](_0x72d7('0xad'),_0x2303d3[_0x72d7('0xae')],'\x20Queue',_0x7aa73c[_0x72d7('0x51')],_0x72d7('0x6c'),_0x7aa73c[_0x72d7('0x28')]);ami['emit'](_0x72d7('0xaf'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xb0'),this['campaignsPreview'][_0x2303d3['queue']]));if(_0x7aa73c[_0x72d7('0xb1')]){ami[_0x72d7('0x22')](_0x72d7('0xb2'),ut[_0x72d7('0xb3')](_0x2303d3));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xb4'),this[_0x72d7('0x61')][_0x2303d3[_0x72d7('0x6a')]]));emitVoiceQueueChannelRemove(ut[_0x72d7('0x9f')](_0x2303d3,'complete'));_0x7aa73c[_0x72d7('0x36')]+=0x1;_0x7aa73c['total']+=0x1;_0x7aa73c[_0x72d7('0xb5')]+=0x1;ut[_0x72d7('0x78')](_0x7aa73c,'[16]');_0x2303d3[_0x72d7('0xb6')]=ut['totalGlobal'](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0x4,'Answer');rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xb7'));rpcDb['createCustomerFinal'](_0x2303d3,_0x72d7('0xb8'));rpcDb[_0x72d7('0xb9')](_0x2303d3);_0x7aa73c[_0x72d7('0x2a')]+=_0x2303d3[_0x72d7('0xba')];_0x7aa73c[_0x72d7('0x29')]+=_0x2303d3['talktime'];logger[_0x72d7('0x55')](_0x72d7('0xbb'),_0x2303d3[_0x72d7('0xae')],_0x72d7('0xbc'),_0x7aa73c[_0x72d7('0x51')],'pTalking:\x20',_0x7aa73c[_0x72d7('0x28')]);delete this[_0x72d7('0x11')][_0x142aa7[_0x72d7('0xaa')]];break;case _0x72d7('0xbd'):_0x7aa73c[_0x72d7('0x38')]+=0x1;_0x2303d3[_0x72d7('0xbe')]+=0x1;_0x2303d3[_0x72d7('0xb6')]=ut['totalGlobal'](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0x5,_0x72d7('0xbf'));ami[_0x72d7('0x22')](_0x72d7('0xc0'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xc1')));rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xc2'));if(ut['totalGlobal'](_0x2303d3)>=_0x7aa73c[_0x72d7('0xc3')]){_0x4d8b63=ut['cloneAction'](_0x2303d3,0xf,_0x72d7('0xa3'));rpcDb[_0x72d7('0x92')](_0x4d8b63,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2303d3[_0x72d7('0xbe')]>=_0x7aa73c[_0x72d7('0xc4')]){rpcDb['createCustomerFinal'](_0x2303d3,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x72d7('0xc5')](ut[_0x72d7('0xc6')](_0x2303d3,_0x72d7('0xbe'),_0x7aa73c[_0x72d7('0xc7')]),_0x2303d3[_0x72d7('0xa8')],_0x2303d3[_0x72d7('0xa9')]);}}break;case _0x72d7('0xc8'):_0x7aa73c[_0x72d7('0x3c')]+=0x1;_0x2303d3['countnoanswerretry']+=0x1;_0x2303d3[_0x72d7('0xb6')]=ut[_0x72d7('0x9c')](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0x3,_0x72d7('0xc9'));ami[_0x72d7('0x22')](_0x72d7('0xca'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xcb')));rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xcc'));if(ut['totalGlobal'](_0x2303d3)>=_0x7aa73c['dialGlobalMaxRetry']){_0x4d8b63=ut['cloneAction'](_0x2303d3,0xf,'Global');rpcDb[_0x72d7('0x92')](_0x4d8b63,_0x72d7('0xcd'));}else{if(_0x2303d3[_0x72d7('0xce')]>=_0x7aa73c[_0x72d7('0xcf')]){rpcDb[_0x72d7('0x92')](_0x2303d3,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2303d3,_0x72d7('0xce'),_0x7aa73c[_0x72d7('0xd0')]),_0x2303d3['unlockAgent'],_0x2303d3[_0x72d7('0xa9')]);}}break;case'CONGESTION':_0x7aa73c[_0x72d7('0xd1')]+=0x1;_0x2303d3[_0x72d7('0xd2')]+=0x1;_0x2303d3[_0x72d7('0xb6')]=ut[_0x72d7('0x9c')](_0x2303d3);ut['logCustomer'](_0x2303d3,0x8,_0x72d7('0xd3'));ami[_0x72d7('0x22')](_0x72d7('0xd4'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xd5')));rpcDb[_0x72d7('0x8e')](_0x2303d3,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x72d7('0x9c')](_0x2303d3)>=_0x7aa73c['dialGlobalMaxRetry']){_0x4d8b63=ut[_0x72d7('0xa2')](_0x2303d3,0xf,_0x72d7('0xa3'));rpcDb[_0x72d7('0x92')](_0x4d8b63,_0x72d7('0xd6'));}else{if(_0x2303d3['countcongestionretry']>=_0x7aa73c[_0x72d7('0xd7')]){rpcDb[_0x72d7('0x92')](_0x2303d3,_0x72d7('0xd8'));}else{rpcDb[_0x72d7('0xc5')](ut[_0x72d7('0xc6')](_0x2303d3,_0x72d7('0xd2'),_0x7aa73c[_0x72d7('0xc7')]),_0x2303d3[_0x72d7('0xa8')],_0x2303d3['activeContact']);}}break;case'CANCEL':_0x7aa73c[_0x72d7('0x3e')]+=0x1;_0x2303d3[_0x72d7('0xd9')]+=0x1;_0x2303d3[_0x72d7('0xb6')]=ut[_0x72d7('0x9c')](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0x14,_0x72d7('0xda'));ami[_0x72d7('0x22')](_0x72d7('0xdb'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xdc')));rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xdd'));if(ut[_0x72d7('0x9c')](_0x2303d3)>=_0x7aa73c['dialGlobalMaxRetry']){_0x4d8b63=ut['cloneAction'](_0x2303d3,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x4d8b63,_0x72d7('0xde'));}else{if(_0x2303d3[_0x72d7('0xd9')]>=_0x7aa73c[_0x72d7('0xdf')]){rpcDb[_0x72d7('0x92')](_0x2303d3,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x72d7('0xc5')](ut[_0x72d7('0xc6')](_0x2303d3,_0x72d7('0xd9'),_0x7aa73c[_0x72d7('0xe0')]),_0x2303d3[_0x72d7('0xa8')],_0x2303d3[_0x72d7('0xa9')]);}}break;case _0x72d7('0xe1'):_0x7aa73c[_0x72d7('0x40')]+=0x1;_0x2303d3[_0x72d7('0xe2')]+=0x1;_0x2303d3[_0x72d7('0xb6')]=ut['totalGlobal'](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0xb,'Abandoned');rpcDb[_0x72d7('0x8e')](_0x2303d3,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x2303d3)>=_0x7aa73c[_0x72d7('0xc3')]){_0x4d8b63=ut['cloneAction'](_0x2303d3,0xf,_0x72d7('0xa3'));rpcDb[_0x72d7('0x92')](_0x4d8b63,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2303d3[_0x72d7('0xe3')]>=_0x7aa73c[_0x72d7('0xe4')]){rpcDb['createCustomerFinal'](_0x2303d3,_0x72d7('0xe5'));}else{rpcDb['rescheduleContact'](ut[_0x72d7('0xc6')](_0x2303d3,'countabandonedretry',_0x7aa73c[_0x72d7('0xe6')]),_0x2303d3[_0x72d7('0xa8')],_0x2303d3[_0x72d7('0xa9')]);}}break;case'18':_0x7aa73c[_0x72d7('0x3f')]+=0x1;_0x2303d3[_0x72d7('0xe7')]+=0x1;_0x2303d3['countglobal']=ut[_0x72d7('0x9c')](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0x12,_0x142aa7[_0x72d7('0xe8')]||_0x142aa7[_0x72d7('0xe9')]);ami['emit'](_0x72d7('0xea'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xeb')));rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xec'));if(ut[_0x72d7('0x9c')](_0x2303d3)>=_0x7aa73c[_0x72d7('0xc3')]){_0x4d8b63=ut[_0x72d7('0xa2')](_0x2303d3,0xf,_0x72d7('0xa3'));rpcDb['createCustomerFinal'](_0x4d8b63,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x72d7('0x92')](_0x2303d3,_0x72d7('0xec'));}delete this[_0x72d7('0x11')][_0x142aa7[_0x72d7('0xaa')]];break;case'19':_0x7aa73c[_0x72d7('0x3f')]+=0x1;_0x2303d3['countglobal']=ut[_0x72d7('0x9c')](_0x2303d3);ut[_0x72d7('0x90')](_0x2303d3,0x13,_0x142aa7[_0x72d7('0xe8')]||_0x142aa7['dialstatus']);ami[_0x72d7('0x22')](_0x72d7('0xea'),ut[_0x72d7('0x9f')](_0x2303d3,_0x72d7('0xeb')));rpcDb[_0x72d7('0x8e')](_0x2303d3,_0x72d7('0xed'));if(ut[_0x72d7('0x9c')](_0x2303d3)>=_0x7aa73c[_0x72d7('0xc3')]){_0x4d8b63=ut[_0x72d7('0xa2')](_0x2303d3,0xf,'Global');rpcDb['createCustomerFinal'](_0x4d8b63,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x72d7('0x92')](_0x2303d3,_0x72d7('0xed'));}delete this[_0x72d7('0x11')][_0x142aa7[_0x72d7('0xaa')]];break;default:if(_0x2303d3[_0x72d7('0x77')]){ut[_0x72d7('0x78')](_0x7aa73c,_0x72d7('0xee'));ut['loggerError'](_0x72d7('0xef')+_0x7aa73c['name'],_0x142aa7);}_0x7aa73c[_0x72d7('0x3f')]+=0x1;_0x2303d3[_0x72d7('0xb6')]=ut[_0x72d7('0x9c')](_0x2303d3);ut['logCustomer'](_0x2303d3,0xc,_0x142aa7[_0x72d7('0xe8')]||_0x142aa7['dialstatus']);rpcDb[_0x72d7('0x8e')](_0x2303d3,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x72d7('0x9c')](_0x2303d3)>=_0x7aa73c['dialGlobalMaxRetry']){_0x4d8b63=ut[_0x72d7('0xa2')](_0x2303d3,0xf,_0x72d7('0xa3'));rpcDb['createCustomerFinal'](_0x4d8b63,_0x72d7('0xf0'));}else{rpcDb[_0x72d7('0x92')](_0x2303d3,_0x72d7('0xf0'));}delete this['actions'][_0x142aa7['linkedid']];}if(!(_0x2303d3['dialAnswer']&&_0x54fbed==='16')){ut[_0x72d7('0x75')](_0x7aa73c,_0x72d7('0xf1'));logger[_0x72d7('0x55')]('[originated][decrement][callProgressDetectingCustomer]',_0x2303d3[_0x72d7('0xae')],_0x72d7('0xbc'),_0x7aa73c[_0x72d7('0x51')],'originated:\x20',_0x7aa73c[_0x72d7('0x4a')]);}if(_0x54fbed!==_0x72d7('0xab')){delete this['actions'][_0x142aa7[_0x72d7('0xaa')]];delete this[_0x72d7('0x11')][_0x142aa7[_0x72d7('0xf2')]];}}};Preview['prototype'][_0x72d7('0xf3')]=function(_0x14aaea,_0x365765,_0x5ecca7){if(_[_0x72d7('0xf4')](_0x365765)&&_0x72d7('0xf5')!==typeof _0x365765){return;}if(_['isUndefined'](_0x5ecca7)&&'object'!==typeof _0x5ecca7){return;}switch(_0x5ecca7[_0x72d7('0xf6')]){case'0':ut[_0x72d7('0xf7')](_0x14aaea,0x0,_0x72d7('0x9d'));rpcDb[_0x72d7('0xf8')](_0x14aaea,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x14aaea,0x3,_0x72d7('0xc9'));rpcDb[_0x72d7('0xf8')](_0x14aaea,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x14aaea,0x5,_0x72d7('0xbf'));rpcDb[_0x72d7('0xf8')](_0x14aaea,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x14aaea,0x8,_0x72d7('0xd3'));rpcDb[_0x72d7('0xf8')](_0x14aaea,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x72d7('0xf7')](_0x14aaea,0x16,_0x72d7('0xf9'));rpcDb['createAgentHistory'](_0x14aaea,_0x72d7('0xfa'));break;default:ut['logAgent'](_0x14aaea,0xc,_0x5ecca7['reason']);rpcDb['createAgentHistory'](_0x14aaea,'[callProgressDetectingAgent][logCongestion]');}ut[_0x72d7('0x75')](_0x365765,_0x72d7('0xfb'));logger[_0x72d7('0x55')](_0x72d7('0xfc'),_0x14aaea[_0x72d7('0xae')],'\x20Queue',_0x365765['name'],_0x72d7('0x6b'),_0x365765[_0x72d7('0x4a')]);delete this['actions'][_0x14aaea[_0x72d7('0xae')]];};Preview['prototype'][_0x72d7('0xfd')]=function(_0x1b0fee,_0x3646f7,_0x4711c8,_0x11b7ee,_0x25fa05){var _0x198285=this;return new BPromise(function(_0x5c73b5,_0x1cb9a4){if(_[_0x72d7('0x68')](_0x3646f7)||_[_0x72d7('0x68')](_0x3646f7[_0x72d7('0xfe')])||_[_0x72d7('0x68')](_0x3646f7[_0x72d7('0xfe')][_0x72d7('0xff')])||_['isNil'](_0x3646f7['VoiceQueueId'])){_0x1cb9a4(ut['message'](_0x72d7('0x100'),_0x11b7ee,_0x25fa05));return;}var _0x346833=uuid['v4']();var _0x33939e=_0x198285[_0x72d7('0x61')][_0x3646f7[_0x72d7('0x69')][_0x72d7('0x51')]];var _0x222ad8=_0x4711c8?_0x198285['agents'][_0x4711c8]['id']:undefined;_0x198285[_0x72d7('0x11')][_0x346833]=new Action(_0x3646f7,_0x33939e,_0x346833,_0x4711c8,_0x222ad8);var _0x3bc07f=_0x198285[_0x72d7('0x11')][_0x346833];_0x3bc07f[_0x72d7('0xa8')]=_0x11b7ee;_0x3bc07f[_0x72d7('0xa9')]=_0x25fa05;_0x3bc07f[_0x72d7('0x101')]=_0x4711c8;if(_['isEmpty'](_0x1b0fee)){_0x198285[_0x72d7('0x102')](_0x3bc07f,_0x33939e,_0x3646f7,_0x4711c8)[_0x72d7('0x80')](function(_0x5a70a2){logger[_0x72d7('0x55')](_0x72d7('0x103'),'Queue:\x20'+_0x3bc07f[_0x72d7('0x6a')]+_0x72d7('0x104')+_0x3bc07f[_0x72d7('0x105')],JSON[_0x72d7('0x57')](_0x5a70a2));ami[_0x72d7('0x22')](_0x72d7('0x106'),ut['buildObj'](_0x3bc07f,_0x72d7('0x107'),_0x198285[_0x72d7('0x61')][_0x3bc07f['queue']]));_0x5c73b5(ut[_0x72d7('0x49')]('Calling'));})[_0x72d7('0x73')](function(_0x5a5f5f){ut[_0x72d7('0x5c')](_0x72d7('0x108'),_0x5a5f5f);_0x1cb9a4(ut[_0x72d7('0x49')](_0x72d7('0x109'),_0x11b7ee,_0x25fa05));});}else{_0x33939e[_0x72d7('0x37')]+=0x1;ut['logBlacklist'](_0x3bc07f);rpcDb['createHistory'](_0x3bc07f,'[Blacklist][error]');delete _0x198285[_0x72d7('0x11')][_0x346833];_0x1cb9a4(ut[_0x72d7('0x49')](_0x72d7('0x10a'),_0x11b7ee,_0x25fa05));}});};Preview[_0x72d7('0xd')][_0x72d7('0x98')]=function(_0x2d533c){return!_[_0x72d7('0x68')](_0x2d533c)&&!_[_0x72d7('0x68')](_0x2d533c[_0x72d7('0x51')])&&!_['isNil'](_0x2d533c['active'])&&_0x2d533c[_0x72d7('0x4e')]&&!_['isNil'](this['trunks'][util['format'](_0x72d7('0x10b'),_0x2d533c[_0x72d7('0x51')])])&&!_[_0x72d7('0x68')](this[_0x72d7('0x10')][util['format'](_0x72d7('0x10b'),_0x2d533c[_0x72d7('0x51')])][_0x72d7('0x71')])&&(this['trunks'][util[_0x72d7('0x58')](_0x72d7('0x10b'),_0x2d533c[_0x72d7('0x51')])]['status']==='reachable'||this[_0x72d7('0x10')][util['format'](_0x72d7('0x10b'),_0x2d533c[_0x72d7('0x51')])][_0x72d7('0x71')]===_0x72d7('0x10c'));};Preview[_0x72d7('0xd')]['run']=function(_0x395f04,_0x281f5b){var _0x356dfc=this;return new BPromise(function(_0x2d16e2,_0x4f3bed){_0x356dfc[_0x72d7('0x10d')](_0x395f04,_0x281f5b)[_0x72d7('0x80')](function(_0x47f7c9){_0x2d16e2(_[_0x72d7('0x6d')](_0x47f7c9,[_0x72d7('0x49')]));})[_0x72d7('0x73')](function(_0x4bc5ae){if(_0x4bc5ae[_0x72d7('0x10e')]){rpcDb[_0x72d7('0x10f')](_0x395f04);}if(_0x4bc5ae[_0x72d7('0x4e')]){rpcDb[_0x72d7('0x87')](_0x395f04);}_0x4f3bed(_['pick'](_0x4bc5ae,[_0x72d7('0x49')]));});});};Preview[_0x72d7('0xd')][_0x72d7('0x10d')]=function(_0xd9b9cf,_0x50974a){var _0x40f7b5=this;return new BPromise(function(_0x2bfe9f,_0x738ca5){var _0x4d9ea0,_0x20d246;rpcDb[_0x72d7('0x110')](_0xd9b9cf)[_0x72d7('0x80')](function(_0x306892){if(!_[_0x72d7('0x68')](_0x306892[0x0])){_0x20d246=_0x306892[0x0][_0x72d7('0x111')]?![]:!![];_0x4d9ea0=_0x306892[0x0][_0x72d7('0x111')]?!![]:![];_0x4d9ea0=_0x50974a?!![]:_0x4d9ea0;}var _0x4322ac=_0x40f7b5[_0x72d7('0x112')](_0x306892);if(_0x4322ac['isValid']){rpcDb[_0x72d7('0x113')](_['pick'](_0x306892[0x0],[_0x72d7('0x6f'),_0x72d7('0x114')]))['then'](function(_0x2c75a1){_0x40f7b5[_0x72d7('0xfd')](_0x2c75a1,_0x306892[0x0],_0x50974a,_0x20d246,_0x4d9ea0)[_0x72d7('0x80')](function(_0x1b9e50){_0x2bfe9f(_0x1b9e50);})[_0x72d7('0x73')](function(_0x512e2c){_0x738ca5(_0x512e2c);});})[_0x72d7('0x73')](function(_0x101c97){ut[_0x72d7('0x5c')](_0x72d7('0x115'),_0x101c97);_0x738ca5(ut[_0x72d7('0x49')](_0x72d7('0x116'),_0x20d246,_0x4d9ea0));});}else{_0x738ca5(ut[_0x72d7('0x49')](_0x4322ac[_0x72d7('0x49')],_0x20d246,_0x4d9ea0));}})[_0x72d7('0x73')](function(_0xca5895){ut[_0x72d7('0x5c')](_0x72d7('0x117'),_0xca5895);_0x738ca5(ut['message'](_0x72d7('0x116'),![],!![]));});});};Preview['prototype'][_0x72d7('0x112')]=function(_0x538ebb){if(_[_0x72d7('0x68')](_0x538ebb)||_[_0x72d7('0x118')](_0x538ebb)||!_['isNil'](_0x538ebb[0x0][_0x72d7('0x83')])&&_[_0x72d7('0x68')](_0x538ebb[0x0][_0x72d7('0x83')][_0x72d7('0x51')])){ut[_0x72d7('0x5c')]('[Preview][validateContact][Empty\x20Contact]',_0x538ebb);return{'isValid':![],'message':_0x72d7('0x119')};}var _0x4f1213=this[_0x72d7('0x61')][_0x538ebb[0x0][_0x72d7('0x69')][_0x72d7('0x51')]];_0x4f1213['message']=_0x72d7('0x9a');if(_[_0x72d7('0x68')](_0x4f1213)){ut['logger'](_0x72d7('0x11a'),_0x4f1213);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x72d7('0x98')](_0x4f1213[_0x72d7('0x4d')])){ut[_0x72d7('0x5c')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x72d7('0x11b')+_0x4f1213[_0x72d7('0x51')]+_0x72d7('0x11c'));if(!this[_0x72d7('0x98')](_0x4f1213[_0x72d7('0x11d')])){ut[_0x72d7('0x5c')](_0x72d7('0x11e'),_0x4f1213[_0x72d7('0x51')]+_0x72d7('0x11f'));return{'isValid':![],'message':_0x72d7('0x120')};}}if(!ut[_0x72d7('0x96')](_0x4f1213['dialActive'])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x4f1213[_0x72d7('0x51')]+_0x72d7('0x121'));return{'isValid':![],'message':_0x72d7('0x11b')+_0x4f1213[_0x72d7('0x51')]+_0x72d7('0x121')};}return{'isValid':!![],'message':_0x72d7('0x122')};};Preview[_0x72d7('0xd')][_0x72d7('0x102')]=function(_0x4764f0,_0xce7136,_0x370659,_0x26478e){var _0x50eb11=this;return new BPromise(function(_0x23a612,_0xc1dac0){var _0x5b41e0=_0x4764f0[_0x72d7('0xae')];var _0x292b08=_0x50eb11[_0x72d7('0x98')](_0xce7136[_0x72d7('0x4d')])?util['format'](_0x72d7('0x123'),_0xce7136[_0x72d7('0x4d')][_0x72d7('0x51')],_[_0x72d7('0x68')](_0xce7136[_0x72d7('0x34')])?'':_0xce7136['dialPrefix'][_0x72d7('0x124')]()||'',_0xce7136[_0x72d7('0x125')]>0x0?_0x370659[_0x72d7('0xfe')][_0x72d7('0xff')][_0x72d7('0x126')](_0xce7136[_0x72d7('0x125')]):_0x370659[_0x72d7('0xfe')][_0x72d7('0xff')]):util[_0x72d7('0x58')](_0x72d7('0x123'),_[_0x72d7('0x68')](_0xce7136['TrunkBackup'])?_0xce7136['Trunk'][_0x72d7('0x51')]:_0xce7136[_0x72d7('0x11d')][_0x72d7('0x51')],_[_0x72d7('0x68')](_0xce7136[_0x72d7('0x34')])?'':_0xce7136[_0x72d7('0x34')][_0x72d7('0x124')]()||'',_0xce7136[_0x72d7('0x125')]>0x0?_0x370659[_0x72d7('0xfe')][_0x72d7('0xff')][_0x72d7('0x126')](_0xce7136[_0x72d7('0x125')]):_0x370659[_0x72d7('0xfe')][_0x72d7('0xff')]);var _0x857ef6=_0x50eb11[_0x72d7('0x98')](_0xce7136[_0x72d7('0x4d')])?ut[_0x72d7('0x127')](_0xce7136[_0x72d7('0x4d')][_0x72d7('0x4f')],_0xce7136[_0x72d7('0x32')],_0xce7136['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x72d7('0x128')](_0xce7136[_0x72d7('0x129')],_0xce7136[_0x72d7('0x12a')]):_0xce7136[_0x72d7('0x129')]):ut[_0x72d7('0x127')](_[_0x72d7('0x68')](_0xce7136[_0x72d7('0x11d')])?_0xce7136[_0x72d7('0x4d')][_0x72d7('0x4f')]:_0xce7136[_0x72d7('0x11d')]['callerid'],_0xce7136[_0x72d7('0x32')],_0xce7136[_0x72d7('0x12a')]>0x0?ut[_0x72d7('0x128')](_0xce7136['dialOriginateCallerIdNumber'],_0xce7136[_0x72d7('0x12a')]):_0xce7136[_0x72d7('0x129')]);if(_0x857ef6){_0x4764f0['originatecalleridname']=ut[_0x72d7('0x12b')](_0x857ef6);_0x4764f0['originatecalleridnum']=ut[_0x72d7('0x12c')](_0x857ef6);}var _0xd7cbe1=ut['addVariables'](_0xce7136,_0x370659,_0x292b08,_0x857ef6,_0x5b41e0,_0x4764f0);_['merge'](_0x4764f0,ut[_0x72d7('0x12d')](_0xd7cbe1));_0x4764f0[_0x72d7('0x88')]=moment()[_0x72d7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x72d7('0x70')](ut[_0x72d7('0x12e')](_0x4764f0,_0xce7136,_0xd7cbe1,_0x4764f0[_0x72d7('0xa9')],_0x26478e))[_0x72d7('0x80')](function(_0x5d5542){_0xce7136[_0x72d7('0x4a')]+=0x1;logger[_0x72d7('0x55')](_0x72d7('0x12f'),_0x5b41e0,'\x20Queue',_0xce7136[_0x72d7('0x51')],_0x72d7('0x6b'),_0xce7136['originated']);_0x23a612(_0x5d5542);})[_0x72d7('0x73')](function(_0x1690ae){ut['logAgent'](_0x4764f0,0xe,_0x72d7('0x130'));rpcDb[_0x72d7('0xf8')](_0x4764f0,_0x72d7('0x131'));_0xc1dac0(_0x1690ae);});});};Preview[_0x72d7('0xd')][_0x72d7('0x1d')]=function(_0x1e9244){if(this[_0x72d7('0x11')][_0x1e9244['linkedid']]){this[_0x72d7('0x11')][_0x1e9244[_0x72d7('0xaa')]][_0x72d7('0x72')]=_0x1e9244[_0x72d7('0x72')];}};Preview['prototype']['syncOriginateResponse']=function(_0x33398a){var _0x4f12cd=this;var _0x22f7c9=this['actions'][_0x33398a[_0x72d7('0x132')]];if(_0x22f7c9){if(_0x22f7c9[_0x72d7('0x101')]&&this[_0x72d7('0x12')][_0x22f7c9[_0x72d7('0x101')]]){ut[_0x72d7('0x133')](_0x22f7c9,this['agents'][_0x22f7c9[_0x72d7('0x101')]]['name'],this['agents'][_0x22f7c9[_0x72d7('0x101')]]['id']);}var _0x2c8c01=_[_0x72d7('0x134')](_0x22f7c9);_0x2c8c01[_0x72d7('0x135')]=moment()[_0x72d7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');var _0xa0afe5=_0x4f12cd['campaignsPreview'][_0x22f7c9[_0x72d7('0x6a')]];if(ut[_0x72d7('0x136')](_0x33398a[_0x72d7('0x137')])){if(_0x22f7c9[_0x72d7('0xa8')]){rpcDb[_0x72d7('0x10f')](_0x22f7c9[_0x72d7('0x105')]);}if(_0x22f7c9['activeContact']){rpcDb[_0x72d7('0x87')](_0x22f7c9['idContact']);}ami[_0x72d7('0x22')](_0x72d7('0x138'),ut[_0x72d7('0x9f')](_0x22f7c9,'rejected',this[_0x72d7('0x61')][_0x22f7c9[_0x72d7('0x6a')]]));this[_0x72d7('0xf3')](_0x2c8c01,_0xa0afe5,_0x33398a);}else{_0x22f7c9[_0x72d7('0x88')]=moment()['format'](_0x72d7('0x89'));ut[_0x72d7('0xf7')](_0x2c8c01,0x4,_0x72d7('0x139'));rpcDb['createAgentHistory'](_0x2c8c01,_0x72d7('0x13a'));}}};Preview[_0x72d7('0xd')]['syncHangup']=function(_0x446da8){var _0x1d9aec=this;var _0x26b994=this[_0x72d7('0x11')][_0x446da8['linkedid']];var _0x197547;if(_0x26b994){_0x197547=this[_0x72d7('0x61')][_0x26b994[_0x72d7('0x6a')]];logger['info'](_0x72d7('0x13b'),_0x446da8[_0x72d7('0xaa')],_0x72d7('0xbc'),_0x197547['name'],_0x72d7('0x6c'),_0x197547[_0x72d7('0x28')]);}if(this[_0x72d7('0x11')][_0x446da8[_0x72d7('0xaa')]]&&_0x446da8[_0x72d7('0xaa')]!==_0x446da8['uniqueid']){if(_0x446da8['cause']==='16'&&this[_0x72d7('0x11')][_0x446da8[_0x72d7('0xaa')]][_0x72d7('0x77')]){this[_0x72d7('0x9b')](_0x446da8,_0x446da8['linkedid'],_0x446da8['cause']);}else if(this[_0x72d7('0x11')][_0x446da8['linkedid']]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x446da8['linkedid'],_0x446da8[_0x72d7('0x13c')],'\x20Queue',_0x197547[_0x72d7('0x51')],_0x72d7('0x6c'),_0x197547[_0x72d7('0x28')]);this[_0x72d7('0x9b')](_0x446da8,_0x446da8['linkedid'],_0x446da8[_0x72d7('0x13c')]);}}else if(_0x26b994&&_[_0x72d7('0x68')](_0x26b994[_0x72d7('0x13d')])&&_0x197547[_0x72d7('0x13e')]&&_0x446da8['linkedid']===_0x446da8[_0x72d7('0xae')]&&_[_0x72d7('0x68')](_0x446da8[_0x72d7('0xf6')])&&_0x446da8[_0x72d7('0x13c')]==='16'&&_0x446da8[_0x72d7('0x13f')]==='6'&&_[_0x72d7('0xf4')](_0x26b994['transfer'])){if(_0x26b994[_0x72d7('0xa8')]){rpcDb[_0x72d7('0x10f')](_0x26b994['idContact']);}if(_0x26b994[_0x72d7('0xa9')]){rpcDb['disableContact'](_0x26b994['idContact']);}_0x446da8['reason']='22';this[_0x72d7('0xf3')](_0x26b994,_0x197547,_0x446da8);}else if(_0x26b994&&_0x26b994[_0x72d7('0x140')]){if(_0x446da8['cause']==='16'&&this[_0x72d7('0x11')][_0x446da8['linkedid']][_0x72d7('0x77')]){logger['info'](_0x72d7('0x141'),_0x446da8['linkedid'],_0x446da8[_0x72d7('0x13c')],_0x72d7('0xbc'),_0x197547[_0x72d7('0x51')],_0x72d7('0x6c'),_0x197547[_0x72d7('0x28')]);this[_0x72d7('0x9b')](_0x446da8,_0x446da8[_0x72d7('0xaa')],_0x446da8[_0x72d7('0x13c')]);}else if(this[_0x72d7('0x11')][_0x446da8[_0x72d7('0xaa')]]['dialAnswer']){logger[_0x72d7('0x55')](_0x72d7('0x142'),_0x446da8[_0x72d7('0xaa')],_0x446da8[_0x72d7('0x13c')],'\x20Queue',_0x197547[_0x72d7('0x51')],'pTalking:\x20',_0x197547[_0x72d7('0x28')]);this['callProgressDetectingCustomer'](_0x446da8,_0x446da8[_0x72d7('0xaa')],_0x446da8['cause']);}}};Preview[_0x72d7('0xd')][_0x72d7('0x1b')]=function(_0x122a31){if(this[_0x72d7('0x11')][_0x122a31[_0x72d7('0xf2')]]&&_0x122a31[_0x72d7('0xf2')]!==_0x122a31[_0x72d7('0x143')]){this[_0x72d7('0x9b')](_0x122a31,_0x122a31[_0x72d7('0xf2')],_0x122a31[_0x72d7('0xe9')]);}};Preview[_0x72d7('0xd')][_0x72d7('0x19')]=function(_0x84e0e3){if(this['actions'][_0x84e0e3[_0x72d7('0xaa')]]&&_0x84e0e3['linkedid']!==_0x84e0e3['uniqueid']&&!this[_0x72d7('0x11')][_0x84e0e3[_0x72d7('0xaa')]]['dialAnswer']){if(_0x84e0e3['cause']==='1'){this[_0x72d7('0x9b')](_0x84e0e3,_0x84e0e3[_0x72d7('0xaa')],_0x84e0e3[_0x72d7('0x13c')]);}}};Preview[_0x72d7('0xd')][_0x72d7('0x144')]=function(_0x32d193,_0x3e7906,_0x2f7aef){if(this[_0x72d7('0x11')][_0x32d193]){if(_[_0x72d7('0x68')](this['actions'][_0x32d193][_0x72d7('0x145')])){this[_0x72d7('0x11')][_0x32d193][_0x72d7('0x145')]={};}this[_0x72d7('0x11')][_0x32d193][_0x72d7('0x145')][_0x3e7906]=_0x2f7aef;}};Preview[_0x72d7('0xd')]['syncVarSet']=function(_0x3e561b){try{if(!_[_0x72d7('0x68')](_0x3e561b)){if(ut['filterKey'](_['keys'](_0x3e561b['variable'])[0x0])){this[_0x72d7('0x144')](_0x3e561b[_0x72d7('0xae')],_[_0x72d7('0x146')](_0x3e561b['variable'])[0x0],_0x3e561b[_0x72d7('0x147')]);}}}catch(_0x4ea43b){logger[_0x72d7('0x148')](_0x72d7('0x149'),util['inspect'](_0x4ea43b,{'showHidden':![],'depth':null}));}};Preview[_0x72d7('0xd')]['syncAttendedTransfer']=function(_0x31295f){if(_0x31295f){if(this[_0x72d7('0x11')][_0x31295f['transfertargetlinkedid']]){this[_0x72d7('0x11')][_0x31295f['transfertargetlinkedid']][_0x72d7('0x140')]=!![];}}};Preview[_0x72d7('0xd')][_0x72d7('0x14a')]=function(_0x4ed8fe){if(_0x4ed8fe){if(this[_0x72d7('0x11')][_0x4ed8fe[_0x72d7('0x14b')]]){this['actions'][_0x4ed8fe[_0x72d7('0x14b')]][_0x72d7('0x140')]=!![];}}};module[_0x72d7('0x14c')]=Preview;
\ No newline at end of file
+var _0x6e15=['[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','ANSWER','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','actionid','lookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','catch','logger2','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','responsetime','answertime'];(function(_0x24124d,_0x26ae83){var _0x56df41=function(_0x1f1ae5){while(--_0x1f1ae5){_0x24124d['push'](_0x24124d['shift']());}};_0x56df41(++_0x26ae83);}(_0x6e15,0x1f0));var _0x56e1=function(_0x5ce6b2,_0x15f5b3){_0x5ce6b2=_0x5ce6b2-0x0;var _0x323e82=_0x6e15[_0x5ce6b2];return _0x323e82;};'use strict';var util=require(_0x56e1('0x0'));var _=require(_0x56e1('0x1'));var BPromise=require(_0x56e1('0x2'));var uuid=require(_0x56e1('0x3'));var moment=require('moment');var md5=require(_0x56e1('0x4'));var Redis=require('ioredis');var config=require(_0x56e1('0x5'));var logger=require(_0x56e1('0x6'))(_0x56e1('0x7'));var loggerAction=require(_0x56e1('0x6'))(_0x56e1('0x8'));var ami=require(_0x56e1('0x9'));var rpcDb=require(_0x56e1('0xa'));var Action=require(_0x56e1('0xb'));var ut=require(_0x56e1('0xc'));config[_0x56e1('0xd')]=_[_0x56e1('0xe')](config[_0x56e1('0xd')],{'host':_0x56e1('0xf'),'port':0x18eb});var io=require(_0x56e1('0x10'))(new Redis(config[_0x56e1('0xd')]));var Sequence=function(){};Sequence[_0x56e1('0x11')][_0x56e1('0x12')]=function(_0x5750bd){this[_0x56e1('0x13')]=this[_0x56e1('0x13')]?this[_0x56e1('0x13')][_0x56e1('0x14')](_0x5750bd):_0x5750bd();};function Preview(_0x264022){this['sequence']=new Sequence();this[_0x56e1('0x15')]=_0x264022['voiceQueues'];this[_0x56e1('0x16')]=_0x264022[_0x56e1('0x16')];this[_0x56e1('0x17')]={};this['agents']=_0x264022[_0x56e1('0x18')];this[_0x56e1('0x19')]=0x0;ami['on']('originateresponse',this[_0x56e1('0x1a')][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x1c'),this[_0x56e1('0x1d')]['bind'](this));ami['on']('hanguprequest',this[_0x56e1('0x1e')][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x1f'),this['syncDialEnd'][_0x56e1('0x1b')](this));ami['on']('newexten',this[_0x56e1('0x20')][_0x56e1('0x1b')](this));ami['on']('varset',this[_0x56e1('0x21')][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x22'),this['syncAttendedTransfer'][_0x56e1('0x1b')](this));ami['on'](_0x56e1('0x23'),this[_0x56e1('0x24')][_0x56e1('0x1b')](this));this[_0x56e1('0x25')](this[_0x56e1('0x15')]);}function emit(_0x18f14e,_0xf1af01,_0x4db36e){io['to'](_0x18f14e)[_0x56e1('0x26')](_0xf1af01,_0x4db36e);}function emitCampaignPreview(_0x43402e){if(_0x43402e['type']===_0x56e1('0x27')){var _0x111c76={'id':_0x43402e['id'],'name':_0x43402e[_0x56e1('0x28')],'strategy':_0x43402e[_0x56e1('0x29')],'answered':_0x43402e['answered'],'available':_0x43402e[_0x56e1('0x2a')],'loggedIn':_0x43402e[_0x56e1('0x2b')],'pTalking':_0x43402e[_0x56e1('0x2c')],'sumBillable':_0x43402e[_0x56e1('0x2d')],'sumDuration':_0x43402e[_0x56e1('0x2e')],'sumHoldTime':_0x43402e['sumHoldTime']||0x0,'talking':_0x43402e[_0x56e1('0x2f')],'total':_0x43402e[_0x56e1('0x30')],'type':_0x43402e[_0x56e1('0x31')],'unmanaged':_0x43402e[_0x56e1('0x32')],'abandoned':_0x43402e[_0x56e1('0x33')],'waiting':_0x43402e[_0x56e1('0x34')],'loggedInDb':_0x43402e[_0x56e1('0x35')],'dialActive':_0x43402e[_0x56e1('0x36')],'dialMethod':_0x43402e[_0x56e1('0x37')],'dialOriginateCallerIdName':_0x43402e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x43402e[_0x56e1('0x38')],'dialOriginateTimeout':_0x43402e[_0x56e1('0x39')],'dialPrefix':_0x43402e[_0x56e1('0x3a')],'outboundAnswerAgiCallsDay':_0x43402e[_0x56e1('0x3b')],'outboundAnswerCallsDay':_0x43402e[_0x56e1('0x3c')],'outboundBlacklistCallsDay':_0x43402e[_0x56e1('0x3d')],'outboundBusyCallsDay':_0x43402e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x43402e['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x43402e[_0x56e1('0x3e')],'outboundDropCallsDayCallersExit':_0x43402e[_0x56e1('0x3f')],'outboundDropCallsDayTimeout':_0x43402e[_0x56e1('0x40')],'outboundNoAnswerCallsDay':_0x43402e[_0x56e1('0x41')],'outboundNoSuchCallsDay':_0x43402e[_0x56e1('0x42')],'outboundOriginateFailureCallsDay':_0x43402e[_0x56e1('0x43')],'outboundReCallsDay':_0x43402e[_0x56e1('0x44')],'outboundRejectCallsDay':_0x43402e[_0x56e1('0x45')],'outboundUnknownCallsDay':_0x43402e[_0x56e1('0x46')],'outboundAbandonedCallsDay':_0x43402e[_0x56e1('0x47')],'predictiveIntervalAnsweredCalls':_0x43402e['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x43402e[_0x56e1('0x48')],'predictiveIntervalAvgTalktime':_0x43402e['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x43402e[_0x56e1('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x43402e[_0x56e1('0x4a')],'predictiveIntervalErlangCalls':_0x43402e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x43402e[_0x56e1('0x4b')],'predictiveIntervalHitRate':_0x43402e[_0x56e1('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x43402e[_0x56e1('0x4d')],'predictiveIntervalPauses':_0x43402e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x43402e[_0x56e1('0x4e')],'predictiveIntervalTotalCalls':_0x43402e['predictiveIntervalTotalCalls'],'message':_0x43402e[_0x56e1('0x4f')],'originated':_0x43402e[_0x56e1('0x50')],'erlangCalls':_0x43402e[_0x56e1('0x51')],'erlangCallToSecond':_0x43402e['erlangCallToSecond'],'erlangAbandonmentRate':_0x43402e[_0x56e1('0x52')],'erlangBusyFactor':_0x43402e[_0x56e1('0x53')],'startPredictive':_0x43402e[_0x56e1('0x54')],'startProgressive':_0x43402e['startProgressive']};if(_0x43402e[_0x56e1('0x55')]){_0x111c76[_0x56e1('0x55')]={'id':_0x43402e[_0x56e1('0x55')]['id'],'name':_0x43402e[_0x56e1('0x55')][_0x56e1('0x28')],'active':_0x43402e[_0x56e1('0x55')][_0x56e1('0x56')],'callerid':_0x43402e[_0x56e1('0x55')]['callerid']};}if(_0x43402e[_0x56e1('0x57')]){_0x111c76['Interval']={'id':_0x43402e[_0x56e1('0x57')]['id'],'name':_0x43402e[_0x56e1('0x57')][_0x56e1('0x28')]};}var _0x3fa855=md5(JSON[_0x56e1('0x58')](_0x111c76));if(_0x43402e[_0x56e1('0x4')]!==_0x3fa855){_0x43402e[_0x56e1('0x4')]=_0x3fa855;emit(util[_0x56e1('0x59')]('voice:queue:%s',_0x111c76[_0x56e1('0x28')]),_0x56e1('0x5a'),_0x111c76);}}}function emitVoiceQueueChannelRemove(_0x280040){logger[_0x56e1('0x5b')](_0x56e1('0x5c'),JSON[_0x56e1('0x58')](_0x280040));emit(util[_0x56e1('0x59')](_0x56e1('0x5d'),_0x280040[_0x56e1('0x28')]),_0x56e1('0x5e'),_0x280040);io[_0x56e1('0x26')](_0x56e1('0x5f'),_0x280040);}function notSendMessagesQueue(_0x37f0ce){if(_0x37f0ce['sendMessageOneNotActive']){if(_0x37f0ce[_0x56e1('0x50')]===0x0&&_0x37f0ce[_0x56e1('0x2c')]===0x0){_0x37f0ce['sendMessageOneNotActive']=![];_0x37f0ce[_0x56e1('0x2a')]=0x0;_0x37f0ce[_0x56e1('0x60')]=0x0;_0x37f0ce[_0x56e1('0x4f')]='NOT_ACTIVE';ut[_0x56e1('0x61')](_0x56e1('0x62'),_0x37f0ce['name']+_0x56e1('0x63'));}else{_0x37f0ce[_0x56e1('0x4f')]=_0x56e1('0x64');ut[_0x56e1('0x61')](_0x56e1('0x62'),_0x37f0ce['name']+_0x56e1('0x65'));}emitCampaignPreview(_0x37f0ce);}}Preview[_0x56e1('0x11')][_0x56e1('0x25')]=function(){var _0x7f5a83=this;setInterval(function(){_0x7f5a83[_0x56e1('0x66')]();},0x7cf);};Preview[_0x56e1('0x11')][_0x56e1('0x66')]=function(){var _0x32a688=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x260339 in _0x32a688){if(_0x32a688[_0x56e1('0x67')](_0x260339)&&(_0x32a688[_0x260339][_0x56e1('0x37')]===_0x56e1('0x7')||_0x32a688[_0x260339][_0x56e1('0x37')]===_0x56e1('0x68'))&&_0x32a688[_0x260339]['type']==='outbound'){if(this[_0x56e1('0x19')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x56e1('0x69')]();}}if(_0x32a688[_0x56e1('0x67')](_0x260339)&&_0x32a688[_0x260339]['dialMethod']===_0x56e1('0x7')&&_0x32a688[_0x260339][_0x56e1('0x31')]==='outbound'){if(_0x32a688[_0x260339][_0x56e1('0x36')]){this[_0x56e1('0x6a')](_0x32a688[_0x260339]);this[_0x56e1('0x6b')](_0x32a688[_0x260339]);}else{notSendMessagesQueue(_0x32a688[_0x260339]);}}}};Preview[_0x56e1('0x11')][_0x56e1('0x6c')]=function(_0x19bc93){var _0x259151=this;this['sequence'][_0x56e1('0x12')](function(){if(!_[_0x56e1('0x6d')](_0x259151[_0x56e1('0x17')][_0x19bc93])){loggerAction[_0x56e1('0x5b')](_0x56e1('0x6e'),_0x19bc93,_0x56e1('0x6f'),_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x70')],'originated:\x20',JSON[_0x56e1('0x58')](_0x259151['campaignsPreview'][_0x259151['actions'][_0x19bc93]['queue']]['originated']),_0x56e1('0x71'),JSON[_0x56e1('0x58')](_0x259151[_0x56e1('0x15')][_0x259151['actions'][_0x19bc93][_0x56e1('0x70')]][_0x56e1('0x2c')]),JSON[_0x56e1('0x58')](_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x72')]),JSON['stringify'](_[_0x56e1('0x73')](_0x259151[_0x56e1('0x17')][_0x19bc93],['contactId',_0x56e1('0x74'),_0x56e1('0x75'),_0x56e1('0x76')])));return ami[_0x56e1('0x77')]({'action':_0x56e1('0x78'),'channel':_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x79')]})['catch'](function(_0x399252){if(_0x399252['message']===_0x56e1('0x7a')){setTimeout(function(){if(_0x259151['actions'][_0x19bc93]){ut[_0x56e1('0x7b')](_0x259151[_0x56e1('0x15')][_0x259151['actions'][_0x19bc93][_0x56e1('0x70')]],_0x56e1('0x7c'));if(_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x72')]===!![]){ut[_0x56e1('0x7d')](_0x259151[_0x56e1('0x15')][_0x259151[_0x56e1('0x17')][_0x19bc93][_0x56e1('0x70')]],_0x56e1('0x7c'));ut['loggerError'](_0x56e1('0x7e')+_0x19bc93,_0x259151['actions'][_0x19bc93][_0x56e1('0x70')]);}ut[_0x56e1('0x7f')](_0x56e1('0x80')+_0x19bc93,_0x259151[_0x56e1('0x17')][_0x19bc93]['queue']);delete _0x259151[_0x56e1('0x17')][_0x19bc93];}},0x2328);}});}});};Preview[_0x56e1('0x11')][_0x56e1('0x69')]=function(){var _0x37212f=this;loggerAction[_0x56e1('0x5b')](_0x56e1('0x81'),_[_0x56e1('0x82')](this[_0x56e1('0x17')]));for(var _0x1766a8 in this[_0x56e1('0x17')]){if(_0x37212f[_0x56e1('0x17')]['hasOwnProperty'](_0x1766a8)){_0x37212f[_0x56e1('0x6c')](_0x1766a8);}}};Preview[_0x56e1('0x11')][_0x56e1('0x6b')]=function(_0x24a4ca){var _0x4b6908=this;rpcDb['getContactRecallMe'](_0x24a4ca['id'],ut[_0x56e1('0x83')](this['agents']))[_0x56e1('0x84')](function(_0x18dde1){if(!_[_0x56e1('0x6d')](_0x18dde1)){for(var _0x4994b2=0x0;_0x4994b2<_0x18dde1[_0x56e1('0x85')];_0x4994b2+=0x1){if(ut[_0x56e1('0x86')](_0x18dde1[_0x4994b2]['scheduledat'])<_0x24a4ca[_0x56e1('0x87')]*0x3c){if(_0x18dde1[_0x4994b2]['Agent']&&!_0x18dde1[_0x4994b2][_0x56e1('0x88')][_0x56e1('0x89')]){_0x4b6908[_0x56e1('0x8a')](_0x18dde1[_0x4994b2]['id'])[_0x56e1('0x84')](ut['logger2'](_0x56e1('0x8b')))[_0x56e1('0x8c')](ut[_0x56e1('0x8d')](_0x56e1('0x8b')));}else{rpcDb['disableContact'](_0x18dde1[_0x4994b2]['id']);}}else{var _0x32513b=new Action(_0x18dde1[_0x4994b2],_0x24a4ca);_0x32513b['starttime']=moment()['format'](_0x56e1('0x8e'));_0x24a4ca[_0x56e1('0x44')]+=0x1;ut[_0x56e1('0x8f')](_0x32513b,0x17,_0x56e1('0x90'));if(_0x24a4ca[_0x56e1('0x91')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x18dde1[_0x4994b2]));rpcDb[_0x56e1('0x92')](_0x32513b,_0x56e1('0x93'));}else{ut[_0x56e1('0x8f')](_0x32513b,0x16,_0x56e1('0x94'));rpcDb[_0x56e1('0x92')](_0x32513b,_0x56e1('0x95'));rpcDb[_0x56e1('0x96')](_0x32513b,_0x56e1('0x95'));}}}}})[_0x56e1('0x8c')](ut['logger2'](_0x56e1('0x97')));};Preview[_0x56e1('0x11')][_0x56e1('0x6a')]=function(_0xacaf91){_0xacaf91['sendMessageOneNotActive']=!![];if(ut[_0x56e1('0x98')](_0xacaf91[_0x56e1('0x2b')])){_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x99');}else if(!ut[_0x56e1('0x9a')](_0xacaf91['dialActive'])){_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9b');}else if(!this[_0x56e1('0x9c')](_0xacaf91[_0x56e1('0x55')])){if(!this['isTrunkReachable'](_0xacaf91[_0x56e1('0x9d')])){_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9e');}else{_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9f');}}else{_0xacaf91[_0x56e1('0x4f')]=_0x56e1('0x9f');}emitCampaignPreview(_0xacaf91);};Preview[_0x56e1('0x11')][_0x56e1('0xa0')]=function(_0x4092f4,_0x212ea6,_0x1e845d){var _0x490137=this;var _0x58b38f=this[_0x56e1('0x17')][_0x212ea6];var _0x2783a7=this['campaignsPreview'][_0x58b38f[_0x56e1('0x70')]];var _0x4db76d;if(_0x2783a7){switch(_0x1e845d){case'1':_0x2783a7[_0x56e1('0x42')]+=0x1;_0x58b38f[_0x56e1('0xa1')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut[_0x56e1('0xa3')](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x0,_0x56e1('0xa4'));ami['emit']('custom:agentnosuchnumber',ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xa6')));rpcDb['createCustomerHistory'](_0x58b38f,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x58b38f[_0x56e1('0xa1')]>=_0x2783a7[_0x56e1('0xa8')]){rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xa9'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xa1'),_0x2783a7[_0x56e1('0xac')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f[_0x56e1('0xae')]);}}delete this['actions'][_0x4092f4[_0x56e1('0xaf')]];break;case'ANSWER':var _0x10d9f5=moment()['format'](_0x56e1('0x8e'));_0x58b38f[_0x56e1('0xb0')]=_0x10d9f5;_0x58b38f[_0x56e1('0xb1')]=_0x10d9f5;_0x58b38f[_0x56e1('0x72')]=!![];_0x2783a7['pTalking']+=0x1;logger[_0x56e1('0x5b')](_0x56e1('0xb2'),_0x58b38f[_0x56e1('0xb3')],_0x56e1('0xb4'),_0x2783a7[_0x56e1('0x28')],_0x56e1('0x71'),_0x2783a7['pTalking']);ami[_0x56e1('0x26')](_0x56e1('0xb5'),ut['buildObj'](_0x58b38f,_0x56e1('0xb6'),this[_0x56e1('0x15')][_0x58b38f['queue']]));if(_0x2783a7['acw']){ami[_0x56e1('0x26')](_0x56e1('0xb7'),ut[_0x56e1('0xb8')](_0x58b38f));}break;case'16':ami[_0x56e1('0x26')](_0x56e1('0xb9'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xba'),this[_0x56e1('0x15')][_0x58b38f[_0x56e1('0x70')]]));emitVoiceQueueChannelRemove(ut[_0x56e1('0xa5')](_0x58b38f,'complete'));_0x2783a7['outboundAnswerCallsDay']+=0x1;_0x2783a7[_0x56e1('0x30')]+=0x1;_0x2783a7[_0x56e1('0xbb')]+=0x1;ut['decrementTalkink'](_0x2783a7,'[16]');_0x58b38f['countglobal']=ut[_0x56e1('0xa3')](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x4,_0x56e1('0xbc'));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xbd'));rpcDb[_0x56e1('0x96')](_0x58b38f,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x58b38f);_0x2783a7[_0x56e1('0x2e')]+=_0x58b38f[_0x56e1('0xbe')];_0x2783a7[_0x56e1('0x2d')]+=_0x58b38f[_0x56e1('0xbe')];logger['info']('[syncHangup][talking][decrement]',_0x58b38f[_0x56e1('0xb3')],_0x56e1('0xb4'),_0x2783a7[_0x56e1('0x28')],'pTalking:\x20',_0x2783a7[_0x56e1('0x2c')]);delete this[_0x56e1('0x17')][_0x4092f4[_0x56e1('0xaf')]];break;case'BUSY':_0x2783a7[_0x56e1('0xbf')]+=0x1;_0x58b38f[_0x56e1('0xc0')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut[_0x56e1('0xa3')](_0x58b38f);ut['logCustomer'](_0x58b38f,0x5,_0x56e1('0xc1'));ami[_0x56e1('0x26')](_0x56e1('0xc2'),ut[_0x56e1('0xa5')](_0x58b38f,'busy'));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xc3'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,'Global');rpcDb['createCustomerFinal'](_0x4db76d,_0x56e1('0xc5'));}else{if(_0x58b38f['countbusyretry']>=_0x2783a7[_0x56e1('0xc6')]){rpcDb[_0x56e1('0x96')](_0x58b38f,_0x56e1('0xc3'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xc0'),_0x2783a7['dialBusyRetryFrequency']),_0x58b38f[_0x56e1('0xad')],_0x58b38f[_0x56e1('0xae')]);}}break;case'NOANSWER':_0x2783a7[_0x56e1('0x41')]+=0x1;_0x58b38f[_0x56e1('0xc7')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut['logCustomer'](_0x58b38f,0x3,_0x56e1('0xc8'));ami[_0x56e1('0x26')](_0x56e1('0xc9'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xca')));rpcDb['createCustomerHistory'](_0x58b38f,_0x56e1('0xcb'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb['createCustomerFinal'](_0x4db76d,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x58b38f[_0x56e1('0xc7')]>=_0x2783a7[_0x56e1('0xcd')]){rpcDb[_0x56e1('0x96')](_0x58b38f,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xc7'),_0x2783a7[_0x56e1('0xce')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f[_0x56e1('0xae')]);}}break;case _0x56e1('0xcf'):_0x2783a7[_0x56e1('0xd0')]+=0x1;_0x58b38f[_0x56e1('0xd1')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x8,_0x56e1('0xd2'));ami['emit'](_0x56e1('0xd3'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xd4')));rpcDb['createCustomerHistory'](_0x58b38f,_0x56e1('0xd5'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb['createCustomerFinal'](_0x4db76d,_0x56e1('0xd6'));}else{if(_0x58b38f[_0x56e1('0xd1')]>=_0x2783a7[_0x56e1('0xd7')]){rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xd5'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xd1'),_0x2783a7[_0x56e1('0xd8')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f['activeContact']);}}break;case'CANCEL':_0x2783a7[_0x56e1('0x45')]+=0x1;_0x58b38f[_0x56e1('0xd9')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x14,_0x56e1('0xda'));ami[_0x56e1('0x26')](_0x56e1('0xdb'),ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xdc')));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xdd'));if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut['cloneAction'](_0x58b38f,0x14,_0x56e1('0xda'));rpcDb['createCustomerFinal'](_0x4db76d,_0x56e1('0xde'));}else{if(_0x58b38f[_0x56e1('0xd9')]>=_0x2783a7[_0x56e1('0xdf')]){rpcDb[_0x56e1('0x96')](_0x58b38f,_0x56e1('0xde'));}else{rpcDb['rescheduleContact'](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xd9'),_0x2783a7[_0x56e1('0xe0')]),_0x58b38f[_0x56e1('0xad')],_0x58b38f['activeContact']);}}break;case _0x56e1('0xe1'):_0x2783a7['outboundAbandonedCallsDay']+=0x1;_0x58b38f[_0x56e1('0xe2')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut[_0x56e1('0xa3')](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0xb,_0x56e1('0xe3'));rpcDb[_0x56e1('0x92')](_0x58b38f,_0x56e1('0xe4'));if(ut['totalGlobal'](_0x58b38f)>=_0x2783a7[_0x56e1('0xc4')]){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,'Global');rpcDb['createCustomerFinal'](_0x4db76d,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x58b38f[_0x56e1('0xe5')]>=_0x2783a7['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xe4'));}else{rpcDb[_0x56e1('0xaa')](ut[_0x56e1('0xab')](_0x58b38f,_0x56e1('0xe2'),_0x2783a7[_0x56e1('0xe6')]),_0x58b38f['unlockAgent'],_0x58b38f[_0x56e1('0xae')]);}}break;case'18':_0x2783a7[_0x56e1('0x46')]+=0x1;_0x58b38f[_0x56e1('0xe7')]+=0x1;_0x58b38f['countglobal']=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0x12,_0x4092f4[_0x56e1('0xe8')]||_0x4092f4[_0x56e1('0xe9')]);ami[_0x56e1('0x26')](_0x56e1('0xea'),ut['buildObj'](_0x58b38f,_0x56e1('0xeb')));rpcDb['createCustomerHistory'](_0x58b38f,_0x56e1('0xec'));if(ut['totalGlobal'](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut['cloneAction'](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,_0x56e1('0xec'));}else{rpcDb[_0x56e1('0x96')](_0x58b38f,_0x56e1('0xec'));}delete this[_0x56e1('0x17')][_0x4092f4['linkedid']];break;case'19':_0x2783a7['outboundUnknownCallsDay']+=0x1;_0x58b38f['countglobal']=ut['totalGlobal'](_0x58b38f);ut['logCustomer'](_0x58b38f,0x13,_0x4092f4['cause-txt']||_0x4092f4[_0x56e1('0xe9')]);ami[_0x56e1('0x26')]('custom:amd',ut[_0x56e1('0xa5')](_0x58b38f,_0x56e1('0xeb')));rpcDb[_0x56e1('0x92')](_0x58b38f,'[callProgressDetectingCustomer][machine]');if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,_0x56e1('0xed'));}else{rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xed'));}delete this[_0x56e1('0x17')][_0x4092f4[_0x56e1('0xaf')]];break;default:if(_0x58b38f[_0x56e1('0x72')]){ut[_0x56e1('0x7d')](_0x2783a7,_0x56e1('0xee'));ut[_0x56e1('0x7f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x2783a7['name'],_0x4092f4);}_0x2783a7[_0x56e1('0x46')]+=0x1;_0x58b38f[_0x56e1('0xa2')]=ut['totalGlobal'](_0x58b38f);ut[_0x56e1('0x8f')](_0x58b38f,0xc,_0x4092f4[_0x56e1('0xe8')]||_0x4092f4[_0x56e1('0xe9')]);rpcDb[_0x56e1('0x92')](_0x58b38f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x56e1('0xa3')](_0x58b38f)>=_0x2783a7['dialGlobalMaxRetry']){_0x4db76d=ut[_0x56e1('0xcc')](_0x58b38f,0xf,_0x56e1('0xa7'));rpcDb[_0x56e1('0x96')](_0x4db76d,_0x56e1('0xef'));}else{rpcDb['createCustomerFinal'](_0x58b38f,_0x56e1('0xef'));}delete this[_0x56e1('0x17')][_0x4092f4['linkedid']];}if(!(_0x58b38f['dialAnswer']&&_0x1e845d==='16')){ut[_0x56e1('0x7b')](_0x2783a7,'[callProgressDetectingCustomer]');logger[_0x56e1('0x5b')](_0x56e1('0xf0'),_0x58b38f['uniqueid'],_0x56e1('0xb4'),_0x2783a7['name'],_0x56e1('0xf1'),_0x2783a7[_0x56e1('0x50')]);}if(_0x1e845d!==_0x56e1('0xf2')){delete this['actions'][_0x4092f4[_0x56e1('0xaf')]];delete this[_0x56e1('0x17')][_0x4092f4[_0x56e1('0xf3')]];}}};Preview['prototype'][_0x56e1('0xf4')]=function(_0x3f8293,_0x580f6b,_0x1b7e75){if(_['isUndefined'](_0x580f6b)&&_0x56e1('0xf5')!==typeof _0x580f6b){return;}if(_[_0x56e1('0xf6')](_0x1b7e75)&&_0x56e1('0xf5')!==typeof _0x1b7e75){return;}switch(_0x1b7e75[_0x56e1('0xf7')]){case'0':ut[_0x56e1('0xf8')](_0x3f8293,0x0,_0x56e1('0xa4'));rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfa'));break;case'3':ut[_0x56e1('0xf8')](_0x3f8293,0x3,_0x56e1('0xc8'));rpcDb['createAgentHistory'](_0x3f8293,_0x56e1('0xfb'));break;case'5':ut['logAgent'](_0x3f8293,0x5,_0x56e1('0xc1'));rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfc'));break;case'8':ut[_0x56e1('0xf8')](_0x3f8293,0x8,_0x56e1('0xd2'));rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfd'));break;case'22':ut[_0x56e1('0xf8')](_0x3f8293,0x16,'AnswerAGI');rpcDb[_0x56e1('0xf9')](_0x3f8293,_0x56e1('0xfe'));break;default:ut[_0x56e1('0xf8')](_0x3f8293,0xc,_0x1b7e75[_0x56e1('0xf7')]);rpcDb['createAgentHistory'](_0x3f8293,'[callProgressDetectingAgent][logCongestion]');}ut[_0x56e1('0x7b')](_0x580f6b,_0x56e1('0xff'));logger[_0x56e1('0x5b')](_0x56e1('0x100'),_0x3f8293[_0x56e1('0xb3')],_0x56e1('0xb4'),_0x580f6b['name'],_0x56e1('0xf1'),_0x580f6b[_0x56e1('0x50')]);delete this[_0x56e1('0x17')][_0x3f8293[_0x56e1('0xb3')]];};Preview[_0x56e1('0x11')][_0x56e1('0x101')]=function(_0x647b28,_0x232a84,_0x8e7c0a,_0x4484f9,_0x40c526){var _0x2f56b5=this;return new BPromise(function(_0x451530,_0x816d19){if(_[_0x56e1('0x6d')](_0x232a84)||_[_0x56e1('0x6d')](_0x232a84[_0x56e1('0x102')])||_[_0x56e1('0x6d')](_0x232a84[_0x56e1('0x102')][_0x56e1('0x103')])||_[_0x56e1('0x6d')](_0x232a84[_0x56e1('0x75')])){_0x816d19(ut['message'](_0x56e1('0x104'),_0x4484f9,_0x40c526));return;}var _0x34426b=uuid['v4']();var _0x2725d4=_0x2f56b5['campaignsPreview'][_0x232a84['Queue'][_0x56e1('0x28')]];var _0x2ee612=_0x8e7c0a?_0x2f56b5[_0x56e1('0x18')][_0x8e7c0a]['id']:undefined;_0x2f56b5[_0x56e1('0x17')][_0x34426b]=new Action(_0x232a84,_0x2725d4,_0x34426b,_0x8e7c0a,_0x2ee612);var _0x33dc9e=_0x2f56b5[_0x56e1('0x17')][_0x34426b];_0x33dc9e['unlockAgent']=_0x4484f9;_0x33dc9e[_0x56e1('0xae')]=_0x40c526;_0x33dc9e['lookAgent']=_0x8e7c0a;if(_[_0x56e1('0x105')](_0x647b28)){_0x2f56b5[_0x56e1('0x106')](_0x33dc9e,_0x2725d4,_0x232a84,_0x8e7c0a)[_0x56e1('0x84')](function(_0x142274){logger[_0x56e1('0x5b')](_0x56e1('0x107'),'Queue:\x20'+_0x33dc9e[_0x56e1('0x70')]+_0x56e1('0x108')+_0x33dc9e[_0x56e1('0x109')],JSON[_0x56e1('0x58')](_0x142274));ami[_0x56e1('0x26')](_0x56e1('0x10a'),ut[_0x56e1('0xa5')](_0x33dc9e,'called',_0x2f56b5[_0x56e1('0x15')][_0x33dc9e[_0x56e1('0x70')]]));_0x451530(ut['message'](_0x56e1('0x10b')));})[_0x56e1('0x8c')](function(_0x325fb7){ut['logger'](_0x56e1('0x10c'),_0x325fb7);_0x816d19(ut[_0x56e1('0x4f')]('Call\x20failed',_0x4484f9,_0x40c526));});}else{_0x2725d4[_0x56e1('0x3d')]+=0x1;ut[_0x56e1('0x10d')](_0x33dc9e);rpcDb[_0x56e1('0x10e')](_0x33dc9e,_0x56e1('0x10f'));delete _0x2f56b5[_0x56e1('0x17')][_0x34426b];_0x816d19(ut[_0x56e1('0x4f')]('Contact\x20in\x20black\x20List',_0x4484f9,_0x40c526));}});};Preview[_0x56e1('0x11')][_0x56e1('0x9c')]=function(_0x2e87ff){return!_['isNil'](_0x2e87ff)&&!_['isNil'](_0x2e87ff[_0x56e1('0x28')])&&!_[_0x56e1('0x6d')](_0x2e87ff['active'])&&_0x2e87ff[_0x56e1('0x56')]&&!_[_0x56e1('0x6d')](this[_0x56e1('0x16')][util[_0x56e1('0x59')]('SIP/%s',_0x2e87ff[_0x56e1('0x28')])])&&!_[_0x56e1('0x6d')](this[_0x56e1('0x16')][util['format'](_0x56e1('0x110'),_0x2e87ff[_0x56e1('0x28')])][_0x56e1('0x78')])&&(this[_0x56e1('0x16')][util[_0x56e1('0x59')](_0x56e1('0x110'),_0x2e87ff[_0x56e1('0x28')])][_0x56e1('0x78')]===_0x56e1('0x111')||this[_0x56e1('0x16')][util[_0x56e1('0x59')]('SIP/%s',_0x2e87ff[_0x56e1('0x28')])]['status']===_0x56e1('0x112'));};Preview[_0x56e1('0x11')]['run']=function(_0x57f22a,_0x2ab82e){var _0x535c86=this;return new BPromise(function(_0x35bab6,_0x11e8fb){_0x535c86[_0x56e1('0x113')](_0x57f22a,_0x2ab82e)[_0x56e1('0x84')](function(_0x5aa15e){_0x35bab6(_[_0x56e1('0x73')](_0x5aa15e,[_0x56e1('0x4f')]));})[_0x56e1('0x8c')](function(_0x399e3c){if(_0x399e3c[_0x56e1('0x114')]){rpcDb['unlockContact'](_0x57f22a);}if(_0x399e3c['active']){rpcDb[_0x56e1('0x115')](_0x57f22a);}_0x11e8fb(_[_0x56e1('0x73')](_0x399e3c,[_0x56e1('0x4f')]));});});};Preview[_0x56e1('0x11')][_0x56e1('0x113')]=function(_0x3997a8,_0x33302f){var _0x301412=this;return new BPromise(function(_0x201bd4,_0x5c847d){var _0x399b21,_0x5d2b7c;rpcDb[_0x56e1('0x116')](_0x3997a8)['then'](function(_0x2dfd1c){if(!_[_0x56e1('0x6d')](_0x2dfd1c[0x0])){_0x5d2b7c=_0x2dfd1c[0x0][_0x56e1('0x117')]?![]:!![];_0x399b21=_0x2dfd1c[0x0][_0x56e1('0x117')]?!![]:![];_0x399b21=_0x33302f?!![]:_0x399b21;}var _0x2e898a=_0x301412[_0x56e1('0x118')](_0x2dfd1c);if(_0x2e898a[_0x56e1('0x119')]){rpcDb[_0x56e1('0x11a')](_[_0x56e1('0x73')](_0x2dfd1c[0x0],[_0x56e1('0x75'),_0x56e1('0x11b')]))[_0x56e1('0x84')](function(_0xd344a1){_0x301412[_0x56e1('0x101')](_0xd344a1,_0x2dfd1c[0x0],_0x33302f,_0x5d2b7c,_0x399b21)['then'](function(_0x5b94ff){_0x201bd4(_0x5b94ff);})[_0x56e1('0x8c')](function(_0x522189){_0x5c847d(_0x522189);});})[_0x56e1('0x8c')](function(_0xb9dce1){ut[_0x56e1('0x61')](_0x56e1('0x11c'),_0xb9dce1);_0x5c847d(ut[_0x56e1('0x4f')](_0x56e1('0x11d'),_0x5d2b7c,_0x399b21));});}else{_0x5c847d(ut['message'](_0x2e898a[_0x56e1('0x4f')],_0x5d2b7c,_0x399b21));}})[_0x56e1('0x8c')](function(_0x4b8323){ut[_0x56e1('0x61')]('[Preview][getContactPreview]',_0x4b8323);_0x5c847d(ut[_0x56e1('0x4f')](_0x56e1('0x11d'),![],!![]));});});};Preview[_0x56e1('0x11')][_0x56e1('0x118')]=function(_0xab2148){if(_[_0x56e1('0x6d')](_0xab2148)||_[_0x56e1('0x105')](_0xab2148)||!_[_0x56e1('0x6d')](_0xab2148[0x0][_0x56e1('0x88')])&&_[_0x56e1('0x6d')](_0xab2148[0x0][_0x56e1('0x88')][_0x56e1('0x28')])){ut['logger'](_0x56e1('0x11e'),_0xab2148);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x2ddf9b=this[_0x56e1('0x15')][_0xab2148[0x0]['Queue'][_0x56e1('0x28')]];_0x2ddf9b[_0x56e1('0x4f')]=_0x56e1('0x9f');if(_[_0x56e1('0x6d')](_0x2ddf9b)){ut[_0x56e1('0x61')](_0x56e1('0x11f'),_0x2ddf9b);return{'isValid':![],'message':_0x56e1('0x120')};}if(!this[_0x56e1('0x9c')](_0x2ddf9b[_0x56e1('0x55')])){ut[_0x56e1('0x61')](_0x56e1('0x121'),_0x56e1('0x122')+_0x2ddf9b[_0x56e1('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x2ddf9b[_0x56e1('0x9d')])){ut['logger'](_0x56e1('0x121'),_0x2ddf9b[_0x56e1('0x28')]+_0x56e1('0x123'));return{'isValid':![],'message':_0x56e1('0x124')};}}if(!ut[_0x56e1('0x9a')](_0x2ddf9b[_0x56e1('0x36')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x2ddf9b[_0x56e1('0x28')]+_0x56e1('0x125'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2ddf9b[_0x56e1('0x28')]+_0x56e1('0x125')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x56e1('0x11')][_0x56e1('0x106')]=function(_0x4584ba,_0x1b0867,_0x54fe5b,_0x69edcc){var _0x188dc5=this;return new BPromise(function(_0x781df1,_0x24a1b){var _0x4217d6=_0x4584ba['uniqueid'];var _0x1565d8=_0x188dc5['isTrunkReachable'](_0x1b0867['Trunk'])?util[_0x56e1('0x59')](_0x56e1('0x126'),_0x1b0867[_0x56e1('0x55')]['name'],_[_0x56e1('0x6d')](_0x1b0867['dialPrefix'])?'':_0x1b0867[_0x56e1('0x3a')]['trim']()||'',_0x1b0867[_0x56e1('0x127')]>0x0?_0x54fe5b[_0x56e1('0x102')][_0x56e1('0x103')][_0x56e1('0x128')](_0x1b0867[_0x56e1('0x127')]):_0x54fe5b[_0x56e1('0x102')][_0x56e1('0x103')]):util['format']('SIP/%s/%s%s',_[_0x56e1('0x6d')](_0x1b0867[_0x56e1('0x9d')])?_0x1b0867[_0x56e1('0x55')][_0x56e1('0x28')]:_0x1b0867[_0x56e1('0x9d')]['name'],_[_0x56e1('0x6d')](_0x1b0867['dialPrefix'])?'':_0x1b0867[_0x56e1('0x3a')]['trim']()||'',_0x1b0867[_0x56e1('0x127')]>0x0?_0x54fe5b[_0x56e1('0x102')][_0x56e1('0x103')][_0x56e1('0x128')](_0x1b0867[_0x56e1('0x127')]):_0x54fe5b['Contact'][_0x56e1('0x103')]);var _0xb815b7=_0x188dc5[_0x56e1('0x9c')](_0x1b0867[_0x56e1('0x55')])?ut[_0x56e1('0x129')](_0x1b0867[_0x56e1('0x55')]['callerid'],_0x1b0867[_0x56e1('0x12a')],_0x1b0867[_0x56e1('0x12b')]>0x0?ut[_0x56e1('0x12c')](_0x1b0867[_0x56e1('0x38')],_0x1b0867[_0x56e1('0x12b')]):_0x1b0867['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x56e1('0x6d')](_0x1b0867[_0x56e1('0x9d')])?_0x1b0867[_0x56e1('0x55')]['callerid']:_0x1b0867[_0x56e1('0x9d')]['callerid'],_0x1b0867[_0x56e1('0x12a')],_0x1b0867[_0x56e1('0x12b')]>0x0?ut[_0x56e1('0x12c')](_0x1b0867[_0x56e1('0x38')],_0x1b0867['dialRandomLastDigitCallerIdNumber']):_0x1b0867['dialOriginateCallerIdNumber']);if(_0xb815b7){_0x4584ba['originatecalleridname']=ut['extractCalleridName'](_0xb815b7);_0x4584ba['originatecalleridnum']=ut[_0x56e1('0x12d')](_0xb815b7);}var _0x3c3ceb=ut[_0x56e1('0x12e')](_0x1b0867,_0x54fe5b,_0x1565d8,_0xb815b7,_0x4217d6,_0x4584ba);_[_0x56e1('0x12f')](_0x4584ba,ut[_0x56e1('0x130')](_0x3c3ceb));_0x4584ba[_0x56e1('0x131')]=moment()[_0x56e1('0x59')](_0x56e1('0x8e'));ami['Action'](ut[_0x56e1('0x132')](_0x4584ba,_0x1b0867,_0x3c3ceb,_0x4584ba[_0x56e1('0xae')],_0x69edcc))[_0x56e1('0x84')](function(_0x2d2a92){_0x1b0867[_0x56e1('0x50')]+=0x1;logger['info'](_0x56e1('0x133'),_0x4217d6,_0x56e1('0xb4'),_0x1b0867[_0x56e1('0x28')],_0x56e1('0xf1'),_0x1b0867[_0x56e1('0x50')]);_0x781df1(_0x2d2a92);})[_0x56e1('0x8c')](function(_0x3ad7bb){ut[_0x56e1('0xf8')](_0x4584ba,0xe,_0x56e1('0x134'));rpcDb[_0x56e1('0xf9')](_0x4584ba,'[originateFailure][logOriginateFailure]');_0x24a1b(_0x3ad7bb);});});};Preview['prototype'][_0x56e1('0x20')]=function(_0x58fe06){if(this[_0x56e1('0x17')][_0x58fe06[_0x56e1('0xaf')]]){this[_0x56e1('0x17')][_0x58fe06['linkedid']]['channel']=_0x58fe06['channel'];}};Preview[_0x56e1('0x11')]['syncOriginateResponse']=function(_0x2a8abe){var _0x3e7736=this;var _0x1c2708=this['actions'][_0x2a8abe[_0x56e1('0x135')]];if(_0x1c2708){if(_0x1c2708[_0x56e1('0x136')]&&this[_0x56e1('0x18')][_0x1c2708[_0x56e1('0x136')]]){ut['logLookAgent'](_0x1c2708,this[_0x56e1('0x18')][_0x1c2708['lookAgent']][_0x56e1('0x28')],this[_0x56e1('0x18')][_0x1c2708[_0x56e1('0x136')]]['id']);}var _0x3d7765=_[_0x56e1('0x137')](_0x1c2708);_0x3d7765[_0x56e1('0xb0')]=moment()['format'](_0x56e1('0x8e'));var _0x1f3326=_0x3e7736[_0x56e1('0x15')][_0x1c2708[_0x56e1('0x70')]];if(ut[_0x56e1('0x138')](_0x2a8abe[_0x56e1('0x139')])){if(_0x1c2708[_0x56e1('0xad')]){rpcDb['unlockContact'](_0x1c2708['idContact']);}if(_0x1c2708['activeContact']){rpcDb['disableContact'](_0x1c2708[_0x56e1('0x109')]);}ami[_0x56e1('0x26')](_0x56e1('0x13a'),ut[_0x56e1('0xa5')](_0x1c2708,_0x56e1('0x13b'),this[_0x56e1('0x15')][_0x1c2708['queue']]));this[_0x56e1('0xf4')](_0x3d7765,_0x1f3326,_0x2a8abe);}else{_0x1c2708[_0x56e1('0x131')]=moment()[_0x56e1('0x59')](_0x56e1('0x8e'));ut[_0x56e1('0xf8')](_0x3d7765,0x4,'Answer');rpcDb[_0x56e1('0xf9')](_0x3d7765,_0x56e1('0x13c'));}}};Preview[_0x56e1('0x11')][_0x56e1('0x1d')]=function(_0x215e81){var _0x4ae6f4=this;var _0x1e0846=this[_0x56e1('0x17')][_0x215e81['linkedid']];var _0x24c377;if(_0x1e0846){_0x24c377=this['campaignsPreview'][_0x1e0846[_0x56e1('0x70')]];logger[_0x56e1('0x5b')]('[syncHangup][talking]',_0x215e81[_0x56e1('0xaf')],_0x56e1('0xb4'),_0x24c377[_0x56e1('0x28')],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);}if(this[_0x56e1('0x17')][_0x215e81[_0x56e1('0xaf')]]&&_0x215e81[_0x56e1('0xaf')]!==_0x215e81['uniqueid']){if(_0x215e81[_0x56e1('0x13d')]==='16'&&this['actions'][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){this[_0x56e1('0xa0')](_0x215e81,_0x215e81['linkedid'],_0x215e81[_0x56e1('0x13d')]);}else if(this[_0x56e1('0x17')][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){logger[_0x56e1('0x5b')](_0x56e1('0x13e'),_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')],'\x20Queue',_0x24c377[_0x56e1('0x28')],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);this[_0x56e1('0xa0')](_0x215e81,_0x215e81[_0x56e1('0xaf')],_0x215e81['cause']);}}else if(_0x1e0846&&_['isNil'](_0x1e0846[_0x56e1('0x13f')])&&_0x24c377[_0x56e1('0x140')]&&_0x215e81['linkedid']===_0x215e81[_0x56e1('0xb3')]&&_[_0x56e1('0x6d')](_0x215e81[_0x56e1('0xf7')])&&_0x215e81[_0x56e1('0x13d')]==='16'&&_0x215e81[_0x56e1('0x141')]==='6'&&_[_0x56e1('0xf6')](_0x1e0846[_0x56e1('0x142')])){if(_0x1e0846['unlockAgent']){rpcDb['unlockContact'](_0x1e0846[_0x56e1('0x109')]);}if(_0x1e0846[_0x56e1('0xae')]){rpcDb[_0x56e1('0x115')](_0x1e0846[_0x56e1('0x109')]);}_0x215e81['reason']='22';this[_0x56e1('0xf4')](_0x1e0846,_0x24c377,_0x215e81);}else if(_0x1e0846&&_0x1e0846[_0x56e1('0x142')]){if(_0x215e81[_0x56e1('0x13d')]==='16'&&this['actions'][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){logger[_0x56e1('0x5b')](_0x56e1('0x143'),_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')],_0x56e1('0xb4'),_0x24c377[_0x56e1('0x28')],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);this[_0x56e1('0xa0')](_0x215e81,_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')]);}else if(this[_0x56e1('0x17')][_0x215e81[_0x56e1('0xaf')]][_0x56e1('0x72')]){logger[_0x56e1('0x5b')](_0x56e1('0x13e'),_0x215e81[_0x56e1('0xaf')],_0x215e81['cause'],_0x56e1('0xb4'),_0x24c377['name'],_0x56e1('0x71'),_0x24c377[_0x56e1('0x2c')]);this[_0x56e1('0xa0')](_0x215e81,_0x215e81[_0x56e1('0xaf')],_0x215e81[_0x56e1('0x13d')]);}}};Preview[_0x56e1('0x11')][_0x56e1('0x144')]=function(_0x77facf){if(this[_0x56e1('0x17')][_0x77facf['destlinkedid']]&&_0x77facf[_0x56e1('0xf3')]!==_0x77facf[_0x56e1('0x145')]){this['callProgressDetectingCustomer'](_0x77facf,_0x77facf[_0x56e1('0xf3')],_0x77facf[_0x56e1('0xe9')]);}};Preview[_0x56e1('0x11')]['syncHangupRequest']=function(_0x137f0a){if(this['actions'][_0x137f0a[_0x56e1('0xaf')]]&&_0x137f0a[_0x56e1('0xaf')]!==_0x137f0a['uniqueid']&&!this['actions'][_0x137f0a[_0x56e1('0xaf')]][_0x56e1('0x72')]){if(_0x137f0a[_0x56e1('0x13d')]==='1'){this[_0x56e1('0xa0')](_0x137f0a,_0x137f0a[_0x56e1('0xaf')],_0x137f0a[_0x56e1('0x13d')]);}}};Preview[_0x56e1('0x11')][_0x56e1('0x146')]=function(_0x2e0b54,_0x1617ae,_0x1b842f){if(this[_0x56e1('0x17')][_0x2e0b54]){if(_[_0x56e1('0x6d')](this[_0x56e1('0x17')][_0x2e0b54][_0x56e1('0x147')])){this[_0x56e1('0x17')][_0x2e0b54][_0x56e1('0x147')]={};}this[_0x56e1('0x17')][_0x2e0b54][_0x56e1('0x147')][_0x1617ae]=_0x1b842f;}};Preview['prototype'][_0x56e1('0x21')]=function(_0x174607){try{if(!_[_0x56e1('0x6d')](_0x174607)){if(ut[_0x56e1('0x148')](_['keys'](_0x174607[_0x56e1('0x149')])[0x0])){this['addVariable'](_0x174607['uniqueid'],_[_0x56e1('0x14a')](_0x174607[_0x56e1('0x149')])[0x0],_0x174607[_0x56e1('0x14b')]);}}}catch(_0x3eaf72){logger['error'](_0x56e1('0x14c'),util[_0x56e1('0x14d')](_0x3eaf72,{'showHidden':![],'depth':null}));}};Preview[_0x56e1('0x11')][_0x56e1('0x14e')]=function(_0x25eaa2){if(_0x25eaa2){if(this[_0x56e1('0x17')][_0x25eaa2['transfertargetlinkedid']]){this[_0x56e1('0x17')][_0x25eaa2[_0x56e1('0x14f')]][_0x56e1('0x142')]=!![];}}};Preview[_0x56e1('0x11')][_0x56e1('0x24')]=function(_0x893f80){if(_0x893f80){if(this[_0x56e1('0x17')][_0x893f80[_0x56e1('0x150')]]){this['actions'][_0x893f80[_0x56e1('0x150')]][_0x56e1('0x142')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 36c5089..d72eae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd66=['getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContact','[rescheduleContactInQueue]\x20','bluebird','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20'];(function(_0x46b72f,_0x1810b5){var _0x2bdcb6=function(_0x13ffa9){while(--_0x13ffa9){_0x46b72f['push'](_0x46b72f['shift']());}};_0x2bdcb6(++_0x1810b5);}(_0xbd66,0x154));var _0x6bd6=function(_0x307f83,_0x45c72c){_0x307f83=_0x307f83-0x0;var _0x4c5cb3=_0xbd66[_0x307f83];return _0x4c5cb3;};'use strict';var util=require('util');var BPromise=require(_0x6bd6('0x0'));var logger=require('../../../config/logger')('preview');var _=require(_0x6bd6('0x1'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x6bd6('0x2'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x6bd6('0x3'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x6bd6('0x4'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x1eb1f2){return function(_0x196099){logger[_0x6bd6('0x5')](_0x1eb1f2,util[_0x6bd6('0x6')](_0x196099,{'showHidden':![],'depth':null}));};}function create(_0x53122e){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](cmHopperHistory[_0x6bd6('0x9')](_0x53122e))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0xb')));}function createAgent(_0x500cd5){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](agentReportPreview[_0x6bd6('0x9')](_0x500cd5))[_0x6bd6('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x34c1f6){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](cmHopper[_0x6bd6('0xc')](_0x34c1f6,!![]))[_0x6bd6('0xa')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x6bd6('0xd')]=function(_0x55b134){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](cmHopperBlack['checkIsBlackList'](_0x55b134))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0xe')));};exports[_0x6bd6('0xf')]=function(_0x5ea5ce){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](cmHopper['getContactPreview'](_0x5ea5ce))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0x10')));};exports[_0x6bd6('0x9')]=function(_0x2607b9,_0x3055d7){create(_0x2607b9)[_0x6bd6('0xa')](loggerCatch(_0x3055d7));moveContact(_0x2607b9)[_0x6bd6('0xa')](loggerCatch(_0x3055d7));};exports['createAgentHistory']=function(_0x576fe6,_0x29877f){createAgent(_0x576fe6)['catch'](loggerCatch(_0x29877f));};exports[_0x6bd6('0x11')]=function(_0x5ea010,_0x3758af){create(_0x5ea010)['catch'](loggerCatch(_0x3758af));};exports[_0x6bd6('0x12')]=function(_0x18caa9,_0x47ee22){moveContact(_0x18caa9)['catch'](loggerCatch(_0x47ee22));};exports['rescheduleContact']=function(_0x1dd14c,_0x44c50d,_0x20a0a6){if(_0x44c50d){_0x1dd14c[_0x6bd6('0x13')]=null;}if(_0x20a0a6){_0x1dd14c['active']=![];}return BPromise['resolve']()[_0x6bd6('0x8')](cmHopper['rescheduleContact'](_0x1dd14c))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0x14')));};exports[_0x6bd6('0x15')]=function(_0x1e53d6){return BPromise[_0x6bd6('0x7')]()['then'](cmHopper[_0x6bd6('0x15')](_0x1e53d6))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0x16')));};exports[_0x6bd6('0x17')]=function(_0x4bcfcd){return BPromise['resolve']()[_0x6bd6('0x8')](cmHopper[_0x6bd6('0x17')]({'UserId':null},_0x4bcfcd,0x1))[_0x6bd6('0xa')](loggerCatch('[unlockContact]\x20'));};exports[_0x6bd6('0x18')]=function(_0x5b6acf){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](cmHopper[_0x6bd6('0x17')]({'active':![]},_0x5b6acf,0x1))['catch'](loggerCatch(_0x6bd6('0x19')));};exports[_0x6bd6('0x1a')]=function(_0x3b9154){var _0x3cacc0={};_0x3cacc0[_0x6bd6('0x1b')]=_0x3b9154['type'];_0x3cacc0['uniqueid']=_0x3b9154[_0x6bd6('0x1c')];_0x3cacc0['calleridnum']=_0x3b9154['calleridnum'];_0x3cacc0['calleridname']=_0x3b9154['calleridname'];_0x3cacc0[_0x6bd6('0x1d')]=_0x3b9154[_0x6bd6('0x1d')];_0x3cacc0[_0x6bd6('0x1e')]=_0x3b9154[_0x6bd6('0x1f')];_0x3cacc0[_0x6bd6('0x20')]=_0x3b9154[_0x6bd6('0x1f')];_0x3cacc0['queuecallercomplete']=0x1;_0x3cacc0['queuecallercompleteAt']=_0x3b9154[_0x6bd6('0x21')];_0x3cacc0['connectedlinename']=_0x3b9154[_0x6bd6('0x22')];_0x3cacc0[_0x6bd6('0x23')]=_0x6bd6('0x24');_0x3cacc0[_0x6bd6('0x25')]='xcally-motion-preview';_0x3cacc0['holdtime']=0x0;_0x3cacc0[_0x6bd6('0x26')]=0x1;_0x3cacc0[_0x6bd6('0x27')]=_0x3b9154['membername'];_0x3cacc0[_0x6bd6('0x28')]=_0x6bd6('0x29');return BPromise['resolve']()[_0x6bd6('0x8')](voiceQueueReport[_0x6bd6('0x2a')](_0x3cacc0))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0x2b')));};exports[_0x6bd6('0x2c')]=function(_0x49f50b,_0x183fa7){return BPromise[_0x6bd6('0x7')]()[_0x6bd6('0x8')](cmHopper[_0x6bd6('0x2c')](_0x49f50b,_0x183fa7))['catch'](loggerCatch(_0x6bd6('0x2d')));};exports['rescheduleContactInQueue']=function(_0x2629a9){return BPromise[_0x6bd6('0x7')]()['then'](cmHopper[_0x6bd6('0x2e')](_0x2629a9,!![],!![]))[_0x6bd6('0xa')](loggerCatch(_0x6bd6('0x2f')));};
\ No newline at end of file
+var _0x6487=['assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','from-sip','exten','xcally-motion-preview','holdtime'];(function(_0x37940c,_0x10ccc5){var _0x58fe29=function(_0x20c2d1){while(--_0x20c2d1){_0x37940c['push'](_0x37940c['shift']());}};_0x58fe29(++_0x10ccc5);}(_0x6487,0x191));var _0x7648=function(_0x415364,_0x3281db){_0x415364=_0x415364-0x0;var _0x42e147=_0x6487[_0x415364];return _0x42e147;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x7648('0x0'))(_0x7648('0x1'));var _=require(_0x7648('0x2'));var cmHopper=require(_0x7648('0x3'));var cmHopperFinal=require(_0x7648('0x4'));var cmHopperHistory=require(_0x7648('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7648('0x6'));var agentReportPreview=require(_0x7648('0x7'));var voiceQueueReport=require(_0x7648('0x8'));function loggerCatch(_0x2ed423){return function(_0x1628df){logger[_0x7648('0x9')](_0x2ed423,util['inspect'](_0x1628df,{'showHidden':![],'depth':null}));};}function create(_0x4ba1cd){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopperHistory['createHistory'](_0x4ba1cd))[_0x7648('0xc')](loggerCatch(_0x7648('0xd')));}function createAgent(_0x52a08e){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](agentReportPreview['createHistory'](_0x52a08e))[_0x7648('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x570e5a){return BPromise[_0x7648('0xa')]()['then'](cmHopper[_0x7648('0xe')](_0x570e5a,!![]))['catch'](loggerCatch(_0x7648('0xf')));}exports[_0x7648('0x10')]=function(_0x2470c4){return BPromise['resolve']()[_0x7648('0xb')](cmHopperBlack[_0x7648('0x10')](_0x2470c4))['catch'](loggerCatch(_0x7648('0x11')));};exports['getContactPreview']=function(_0xd60a47){return BPromise[_0x7648('0xa')]()['then'](cmHopper[_0x7648('0x12')](_0xd60a47))[_0x7648('0xc')](loggerCatch(_0x7648('0x13')));};exports[_0x7648('0x14')]=function(_0x3cfc8d,_0x400cea){create(_0x3cfc8d)['catch'](loggerCatch(_0x400cea));moveContact(_0x3cfc8d)[_0x7648('0xc')](loggerCatch(_0x400cea));};exports['createAgentHistory']=function(_0x2d08c9,_0x67f468){createAgent(_0x2d08c9)[_0x7648('0xc')](loggerCatch(_0x67f468));};exports['createCustomerHistory']=function(_0x119e84,_0x256e40){create(_0x119e84)[_0x7648('0xc')](loggerCatch(_0x256e40));};exports[_0x7648('0x15')]=function(_0x148897,_0x184353){moveContact(_0x148897)[_0x7648('0xc')](loggerCatch(_0x184353));};exports[_0x7648('0x16')]=function(_0xf39cf6,_0xf5974b,_0x1d69e9){if(_0xf5974b){_0xf39cf6[_0x7648('0x17')]=null;}if(_0x1d69e9){_0xf39cf6[_0x7648('0x18')]=![];}return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper[_0x7648('0x16')](_0xf39cf6))[_0x7648('0xc')](loggerCatch(_0x7648('0x19')));};exports[_0x7648('0x1a')]=function(_0x9c0bc2){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper['countReScheduled'](_0x9c0bc2))['catch'](loggerCatch(_0x7648('0x1b')));};exports[_0x7648('0x1c')]=function(_0x3104fc){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper[_0x7648('0x1c')]({'UserId':null},_0x3104fc,0x1))[_0x7648('0xc')](loggerCatch(_0x7648('0x1d')));};exports[_0x7648('0x1e')]=function(_0x24bfc3){return BPromise['resolve']()[_0x7648('0xb')](cmHopper['unlockContact']({'active':![]},_0x24bfc3,0x1))['catch'](loggerCatch(_0x7648('0x1f')));};exports['crateCustomerReportQueue']=function(_0x2014bf){var _0x3ebf25={};_0x3ebf25[_0x7648('0x20')]=_0x2014bf['type'];_0x3ebf25[_0x7648('0x21')]=_0x2014bf[_0x7648('0x21')];_0x3ebf25[_0x7648('0x22')]=_0x2014bf['calleridnum'];_0x3ebf25['calleridname']=_0x2014bf[_0x7648('0x23')];_0x3ebf25[_0x7648('0x24')]=_0x2014bf[_0x7648('0x24')];_0x3ebf25[_0x7648('0x25')]=_0x2014bf[_0x7648('0x26')];_0x3ebf25['queuecallerleaveAt']=_0x2014bf[_0x7648('0x26')];_0x3ebf25[_0x7648('0x27')]=0x1;_0x3ebf25[_0x7648('0x28')]=_0x2014bf[_0x7648('0x29')];_0x3ebf25[_0x7648('0x2a')]=_0x2014bf['membername'];_0x3ebf25['context']=_0x7648('0x2b');_0x3ebf25[_0x7648('0x2c')]=_0x7648('0x2d');_0x3ebf25[_0x7648('0x2e')]=0x0;_0x3ebf25[_0x7648('0x2f')]=0x1;_0x3ebf25[_0x7648('0x30')]=_0x2014bf[_0x7648('0x31')];_0x3ebf25[_0x7648('0x32')]=_0x7648('0x33');return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](voiceQueueReport[_0x7648('0x34')](_0x3ebf25))[_0x7648('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x7648('0x35')]=function(_0x33b514,_0x568124){return BPromise['resolve']()[_0x7648('0xb')](cmHopper[_0x7648('0x35')](_0x33b514,_0x568124))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x7648('0x36')]=function(_0x2400e1){return BPromise[_0x7648('0xa')]()[_0x7648('0xb')](cmHopper[_0x7648('0x16')](_0x2400e1,!![],!![]))[_0x7648('0xc')](loggerCatch(_0x7648('0x37')));};
\ No newline at end of file
index a247c8a..7ceec1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71aa=['Contact','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','BOOKED','originate','channelAgent','calleridnum','from-sip','timeout','uniqueid','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','logger2','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x71aa,0xf1));var _0xa71a=function(_0x3394a6,_0x7b1ede){_0x3394a6=_0x3394a6-0x0;var _0x4a7909=_0x71aa[_0x3394a6];return _0x4a7909;};'use strict';var util=require('util');var _=require(_0xa71a('0x0'));var moment=require(_0xa71a('0x1'));var logger=require(_0xa71a('0x2'))(_0xa71a('0x3'));var ipAgi=process[_0xa71a('0x4')][_0xa71a('0x5')]||_0xa71a('0x6');function getSeconds(_0x3c83b7,_0x5b9ba1){var _0x24b751=moment(_0x3c83b7)[_0xa71a('0x7')](0x0);var _0x25c1ed=moment(_0x5b9ba1)['milliseconds'](0x0);return _0x24b751[_0xa71a('0x8')](_0x25c1ed,_0xa71a('0x9'));}exports[_0xa71a('0xa')]=function(_0x152299){return function(_0x1d08c5){logger[_0xa71a('0xb')](_0x152299,util[_0xa71a('0xc')](_0x1d08c5,{'showHidden':![],'depth':null}));};};exports[_0xa71a('0xd')]=function(_0x44b98e,_0x521179){logger[_0xa71a('0xe')](_0x44b98e,util[_0xa71a('0xc')](_0x521179,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3447ee,_0x16b646){logger[_0xa71a('0xb')](_0x3447ee,util[_0xa71a('0xc')](_0x16b646,{'showHidden':![],'depth':null}));};exports[_0xa71a('0xf')]=function(_0x4ebf48){return function(_0x174bcb){logger[_0xa71a('0xe')](_0x4ebf48,util[_0xa71a('0xc')](_0x174bcb,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2d0609,_0x42496a,_0x575139){return{'message':_0x2d0609,'unlock':_0x42496a,'active':_0x575139};};exports['getCallerId']=function(_0x56bbd9,_0x2eb2e5,_0x2df3eb){if(!_[_0xa71a('0x10')](_0x2df3eb)&&_0xa71a('0x11')===typeof _0x2df3eb&&!_[_0xa71a('0x12')](_0x2df3eb)){if(!_['isUndefined'](_0x2eb2e5)&&'string'===typeof _0x2eb2e5&&!_[_0xa71a('0x12')](_0x2eb2e5)){return util['format']('\x22%s\x22\x20<%s>',_0x2eb2e5,_0x2df3eb);}return util[_0xa71a('0x13')](_0xa71a('0x14'),_0x2df3eb,_0x2df3eb);}if(!_[_0xa71a('0x10')](_0x56bbd9)&&_0xa71a('0x11')===typeof _0x56bbd9&&!_['isEmpty'](_0x56bbd9)){return _0x56bbd9;}return _0xa71a('0x15');};exports['isActive']=function(_0x393d63){if(_[_0xa71a('0x16')](_0x393d63)){return![];}return _0x393d63;};exports[_0xa71a('0x17')]=function(_0x4166e6,_0x195f16,_0x3a3a7c,_0x5e8701,_0x41ee05,_0xe15b32){var _0x1a27a7={'XMD-QUEUE':_0x195f16[_0xa71a('0x18')]?_0x195f16['Queue']['name']:'','XMD-CALLERID':_0x5e8701,'XMD-CALLERID-PREVIEW':_0xe15b32?util[_0xa71a('0x13')]('\x22%s\x22\x20<%s>',_0xe15b32[_0xa71a('0x19')],_0xe15b32['calleridnum']):_0x5e8701,'XMD-DIALID':_0x41ee05,'XMD-CONTACTID':_0x195f16[_0xa71a('0x1a')],'XMD-CDRTYPE':_0xa71a('0x1b'),'CALLERID(all)':_0x5e8701,'XMD-VOICEQUEUEID':_0x195f16[_0xa71a('0x1c')],'XMD-DIALCHANNEL':_0x3a3a7c,'XMD-DIALTIMEOUT':_0x4166e6['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xa71a('0x13')](_0xa71a('0x1d'),_0x4166e6[_0xa71a('0x1e')]?'g':'',_[_0xa71a('0x12')](_0x4166e6['monitor_format'])?'':_0xa71a('0x1f')),'XMD-DIALURL':_0x4166e6[_0xa71a('0x20')]||'','XMD-AGI':_0x4166e6[_0xa71a('0x21')]?util[_0xa71a('0x13')](_0xa71a('0x22'),ipAgi,_0x4166e6[_0xa71a('0x21')]):_0xa71a('0x23'),'XMD-AGIAFTER':_0x4166e6[_0xa71a('0x1e')]?util[_0xa71a('0x13')](_0xa71a('0x22'),ipAgi,_0x4166e6['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0xe15b32?_0xe15b32[_0xa71a('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0xe15b32?_0xe15b32[_0xa71a('0x25')]:'','XMD-DESTINATION':_0xa71a('0x26')};if(!_[_0xa71a('0x12')](_0x4166e6[_0xa71a('0x27')])){_0x1a27a7[util['format']('%s',_0xa71a('0x28'))]=_0x4166e6[_0xa71a('0x27')];_0x1a27a7[util[_0xa71a('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x41ee05;}if(_0x195f16&&_0x195f16[_0xa71a('0x29')]){for(var _0x1b4100 in _0x195f16[_0xa71a('0x29')]){if(_0x195f16[_0xa71a('0x29')]['hasOwnProperty'](_0x1b4100)){if(!_[_0xa71a('0x16')](_0x195f16[_0xa71a('0x29')][_0x1b4100])&&_0x1b4100!=='id'&&_0x1b4100!==_0xa71a('0x2a')&&_0x1b4100!==_0xa71a('0x2b')&&_0x1b4100!==_0xa71a('0x2c')){_0x1a27a7[util['format'](_0xa71a('0x2d'),'XMD-',_[_0xa71a('0x2e')](_0x1b4100))]=_0x195f16[_0xa71a('0x29')][_0x1b4100];}}}}return _0x1a27a7;};exports[_0xa71a('0x2f')]=function(_0x2307de){var _0x38a42={};for(var _0x13fd81 in _0x2307de){if(_0x2307de[_0xa71a('0x30')](_0x13fd81)){_0x38a42[util[_0xa71a('0x13')]('%s',_['toLower'](_0x13fd81))]=_0x2307de[_0x13fd81];}}return{'variables':_0x38a42};};exports[_0xa71a('0x31')]=function(_0x430406,_0x71b0d8){if(!_[_0xa71a('0x16')](_0x430406)){if(_0x430406['hasOwnProperty'](_0xa71a('0x32'))){if(_0x430406['originated']>0x0){_0x430406[_0xa71a('0x32')]-=0x1;}else{logger[_0xa71a('0xb')](_0xa71a('0x33'),_0x71b0d8);}}}else{logger[_0xa71a('0xb')](_0xa71a('0x34'),_0x71b0d8);}};exports[_0xa71a('0x35')]=function(_0x16012){var _0x160c6e=moment()[_0xa71a('0x13')](_0xa71a('0x36'));_0x16012[_0xa71a('0x37')]=0xd;_0x16012[_0xa71a('0x38')]='Blacklist';_0x16012[_0xa71a('0x39')]=_0x160c6e;_0x16012[_0xa71a('0x3a')]=_0x160c6e;_0x16012[_0xa71a('0x3b')]=_0x160c6e;};exports[_0xa71a('0x3c')]=function(_0x4e87e9,_0x2e1d60,_0x464402){var _0x1036c6=moment()[_0xa71a('0x13')](_0xa71a('0x36'));_0x4e87e9[_0xa71a('0x37')]=_0x2e1d60;_0x4e87e9['statedesc']=_0x464402;_0x4e87e9[_0xa71a('0x3a')]=_0x1036c6;_0x4e87e9[_0xa71a('0x3d')]=getSeconds(_0x4e87e9['responsetime'],_0x4e87e9[_0xa71a('0x39')]);};exports[_0xa71a('0x3e')]=function(_0x2bed3f,_0x5599cb,_0x15940f){_0x2bed3f[_0xa71a('0x3f')]=_0x5599cb;_0x2bed3f[_0xa71a('0x40')]=_0x15940f;};exports['logCustomer']=function(_0x2b08e1,_0x25b917,_0x45b4e6){var _0x1a3239=moment()[_0xa71a('0x13')](_0xa71a('0x36'));_0x2b08e1['state']=_0x25b917;_0x2b08e1[_0xa71a('0x38')]=_0x45b4e6;_0x2b08e1[_0xa71a('0x3a')]=_0x2b08e1[_0xa71a('0x3a')]?_0x2b08e1[_0xa71a('0x3a')]:_0x1a3239;_0x2b08e1['endtime']=_0x2b08e1[_0xa71a('0x3b')]?_0x2b08e1[_0xa71a('0x3b')]:_0x1a3239;_0x2b08e1[_0xa71a('0x3d')]=getSeconds(_0x2b08e1['responsetime']||0x0,_0x2b08e1['starttime']||0x0);_0x2b08e1[_0xa71a('0x41')]=_0x2b08e1[_0xa71a('0x42')]?getSeconds(_0x2b08e1['endtime'],_0x2b08e1[_0xa71a('0x42')]):0x0;};exports[_0xa71a('0x43')]=function(_0x12b97f){return _0x12b97f===_0xa71a('0x44');};exports['variablesAction']=function(_0x2da880,_0x1f1cef,_0x10c01b,_0x10e6c5,_0x4745e7){var _0x40cd84=_0x10e6c5?'RECALL':_0x2da880[_0xa71a('0x19')];_0x40cd84=_0x4745e7?_0xa71a('0x45'):_0x40cd84;return{'actionid':_0x2da880['uniqueid'],'action':_0xa71a('0x46'),'channel':_0x2da880[_0xa71a('0x47')],'callerid':util['format'](_0xa71a('0x14'),_0x40cd84,_0x2da880[_0xa71a('0x48')]),'Exten':'xcally-motion-preview','Context':_0xa71a('0x49'),'Priority':'1','variable':_0x10c01b,'timeout':(_0x1f1cef[_0xa71a('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2da880[_0xa71a('0x4b')]};};exports[_0xa71a('0x4c')]=function(_0x7c5ea2){return _0x7c5ea2['countbusyretry']+_0x7c5ea2['countcongestionretry']+_0x7c5ea2[_0xa71a('0x4d')]+_0x7c5ea2[_0xa71a('0x4e')]+_0x7c5ea2[_0xa71a('0x4f')];};exports['cloneAction']=function(_0x5ef36d){var _0x4bc6fd=_[_0xa71a('0x50')](_0x5ef36d);_0x4bc6fd[_0xa71a('0x37')]=0xf;_0x4bc6fd[_0xa71a('0x38')]=_0xa71a('0x51');return _0x4bc6fd;};exports[_0xa71a('0x52')]=function(_0x3bdf4d,_0x298108,_0x2e20c7){var _0x6d4cf0={};_0x6d4cf0[_0x298108]=_0x3bdf4d[_0x298108];_0x6d4cf0[_0xa71a('0x53')]=![];_0x6d4cf0['scheduledat']=moment()[_0xa71a('0x54')](_0x2e20c7,_0xa71a('0x55'))[_0xa71a('0x13')](_0xa71a('0x36'));_0x6d4cf0[_0xa71a('0x1a')]=_0x3bdf4d['ContactId'];_0x6d4cf0[_0xa71a('0x56')]=_0x3bdf4d['ListId'];_0x6d4cf0[_0xa71a('0x1c')]=_0x3bdf4d['VoiceQueueId']||undefined;return _0x6d4cf0;};exports[_0xa71a('0x57')]=function(_0xf83c98,_0x55ffee){if(!_['isNil'](_0xf83c98)){if(_0xf83c98['pTalking']>0x0){_0xf83c98[_0xa71a('0x58')]-=0x1;}else{logger[_0xa71a('0xb')](_0x55ffee,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xa71a('0xb')](_0x55ffee,_0xa71a('0x59'));}};exports[_0xa71a('0x5a')]=function(_0x3b7e62){if(_0x3b7e62<=0x0){return!![];}return![];};exports[_0xa71a('0x5b')]=function(_0x57c8e5,_0x795d29,_0x1d8c4a){_0x57c8e5[_0xa71a('0x5c')]=_0x795d29;_0x57c8e5[_0xa71a('0x5d')]=_0x57c8e5[_0xa71a('0x5e')];_0x57c8e5[_0xa71a('0x5f')]=_0x57c8e5[_0xa71a('0x47')];if(_0x1d8c4a){_0x57c8e5[_0xa71a('0x60')]=_0x1d8c4a['mandatoryDisposition'];}return _0x57c8e5;};exports['buildAcw']=function(_0x15b9b0){var _0x37505b={};_0x37505b[_0xa71a('0x5e')]=_0x15b9b0[_0xa71a('0x5e')];_0x37505b[_0xa71a('0x5f')]=_0x15b9b0[_0xa71a('0x47')];_0x37505b['uniqueid']=_0x15b9b0[_0xa71a('0x4b')];return _0x37505b;};exports[_0xa71a('0x61')]=function(_0x32be14){var _0x50c825=[];for(var _0x1f63fd in _0x32be14){if(_0x32be14[_0xa71a('0x30')](_0x1f63fd)){if(!_[_0xa71a('0x16')](_0x32be14[_0x1f63fd])&&_0x32be14[_0x1f63fd][_0xa71a('0x37')]===_0xa71a('0x62')&&_0x32be14[_0x1f63fd][_0xa71a('0x63')]==='reachable'){_0x50c825[_0xa71a('0x64')](_0x32be14[_0x1f63fd]['id']);}}}return _0x50c825;};exports[_0xa71a('0x65')]=function(_0x3cdf8c){var _0xcd8382=moment()[_0xa71a('0x7')](0x0);var _0x2dd07a=moment(_0x3cdf8c)[_0xa71a('0x7')](0x0);return _0xcd8382['diff'](_0x2dd07a,_0xa71a('0x9'));};exports[_0xa71a('0x66')]=function(_0x679aa9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x679aa9[_0xa71a('0x1a')],'ListId':_0x679aa9[_0xa71a('0x56')],'VoiceQueueId':_0x679aa9[_0xa71a('0x1c')]||undefined,'CampaignId':_0x679aa9[_0xa71a('0x67')]||undefined};};exports[_0xa71a('0x68')]=function(_0x430d84){if(_0x430d84===_0xa71a('0x4b')||_0x430d84===_0xa71a('0x69')||_0x430d84==='queue'||_0x430d84===_0xa71a('0x6a')||_0x430d84===_0xa71a('0x6b')||_0x430d84==='dialAnswer'||_0x430d84==='membername'||_0x430d84===_0xa71a('0x47')||_0x430d84===_0xa71a('0x19')||_0x430d84===_0xa71a('0x53')||_0x430d84===_0xa71a('0x48')||_0x430d84==='scheduledat'||_0x430d84==='countbusyretry'||_0x430d84===_0xa71a('0x6c')||_0x430d84===_0xa71a('0x4d')||_0x430d84===_0xa71a('0x6d')||_0x430d84===_0xa71a('0x6e')||_0x430d84===_0xa71a('0x6f')||_0x430d84===_0xa71a('0x70')||_0x430d84===_0xa71a('0x71')||_0x430d84==='ContactId'||_0x430d84===_0xa71a('0x56')||_0x430d84===_0xa71a('0x40')||_0x430d84===_0xa71a('0x1c')||_0x430d84===_0xa71a('0x72')||_0x430d84==='xmd-voicequeueid'||_0x430d84==='xmd-queue'||_0x430d84===_0xa71a('0x73')||_0x430d84===_0xa71a('0x74')||_0x430d84===_0xa71a('0x75')||_0x430d84===_0xa71a('0x76')||_0x430d84===_0xa71a('0x77')||_0x430d84==='xmd-dialid'||_0x430d84===_0xa71a('0x78')||_0x430d84===_0xa71a('0x79')||_0x430d84===_0xa71a('0x7a')||_0x430d84==='xmd-callerid'||_0x430d84==='xmd-agiafter'||_0x430d84===_0xa71a('0x7b')||_0x430d84===_0xa71a('0x7c')||_0x430d84==='rtpaudioqosbridged'||_0x430d84===_0xa71a('0x7d')||_0x430d84===_0xa71a('0x7e')||_0x430d84===_0xa71a('0x7f')||_0x430d84==='rtpaudioqoslossbridged'||_0x430d84===_0xa71a('0x80')||_0x430d84==='rtpaudioqosrttbridged'||_0x430d84===_0xa71a('0x7c')||_0x430d84===_0xa71a('0x81')||_0x430d84===_0xa71a('0x7d')||_0x430d84===_0xa71a('0x7e')||_0x430d84===_0xa71a('0x7f')||_0x430d84==='rtpaudioqoslossbridged'||_0x430d84===_0xa71a('0x80')||_0x430d84===_0xa71a('0x82')||_0x430d84===_0xa71a('0x83')||_0x430d84===_0xa71a('0x84')||_0x430d84==='state'||_0x430d84===_0xa71a('0x38')){return![];}return!![];};exports[_0xa71a('0x85')]=function(_0x3a0cea,_0x2ed962){var _0x5cc31e,_0x5318ef,_0x35e866;if(_0x2ed962<=0x0){_0x2ed962=0x1;}_0x5cc31e=new RegExp(_0xa71a('0x86')+_0x2ed962+'}$');_0x5318ef=Math[_0xa71a('0x87')](0xa,_0x2ed962-0x1);_0x35e866=Math[_0xa71a('0x87')](0xa,_0x2ed962)-0x1;return util[_0xa71a('0x13')]('%s',_[_0xa71a('0x88')](_0x3a0cea,_0x5cc31e,_[_0xa71a('0x89')](_0x5318ef,_0x35e866)));};exports[_0xa71a('0x8a')]=function(_0xf6427c){var _0x5eb9aa=_0xf6427c[_0xa71a('0x8b')](/"(.*?)"/);return _0x5eb9aa?_0x5eb9aa[0x1]:_0xf6427c;};exports[_0xa71a('0x8c')]=function(_0x52d00c){var _0x5dbee9=_0x52d00c['match'](/<(.*?)>/);return _0x5dbee9?_0x5dbee9[0x1]:_0x52d00c;};
\ No newline at end of file
+var _0x6601=['active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','interface','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','createBody','idContact','type','campaigntype','dialAnswer','callback','recallme','UserId','xmd-voicequeueid','xmd-queue','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','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','diff','seconds','loggerCatch','error','inspect','logger','info','message','isUndefined','string','isEmpty','format','isActive','isNil','Queue','name','\x22%s\x22\x20<%s>','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','starttime','responsetime','endtime','logAgent','state','statedesc','ringtime','logLookAgent','membername','logCustomer','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','clone','scheduledAt'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6601,0x158));var _0x1660=function(_0x71a7e6,_0x5f5cef){_0x71a7e6=_0x71a7e6-0x0;var _0x39cf2d=_0x6601[_0x71a7e6];return _0x39cf2d;};'use strict';var util=require(_0x1660('0x0'));var _=require(_0x1660('0x1'));var moment=require(_0x1660('0x2'));var logger=require(_0x1660('0x3'))(_0x1660('0x4'));var ipAgi=process[_0x1660('0x5')][_0x1660('0x6')]||'127.0.0.1';function getSeconds(_0x2881bd,_0x4ab274){var _0x59a58c=moment(_0x2881bd)['milliseconds'](0x0);var _0x4a679b=moment(_0x4ab274)['milliseconds'](0x0);return _0x59a58c[_0x1660('0x7')](_0x4a679b,_0x1660('0x8'));}exports[_0x1660('0x9')]=function(_0x478171){return function(_0x840ae8){logger[_0x1660('0xa')](_0x478171,util[_0x1660('0xb')](_0x840ae8,{'showHidden':![],'depth':null}));};};exports[_0x1660('0xc')]=function(_0x224ae2,_0x224646){logger[_0x1660('0xd')](_0x224ae2,util[_0x1660('0xb')](_0x224646,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0xd62264,_0xbdbecd){logger[_0x1660('0xa')](_0xd62264,util[_0x1660('0xb')](_0xbdbecd,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3a0c6e){return function(_0x563828){logger['info'](_0x3a0c6e,util[_0x1660('0xb')](_0x563828,{'showHidden':![],'depth':null}));};};exports[_0x1660('0xe')]=function(_0x4e3809,_0x17ac69,_0xd23eb0){return{'message':_0x4e3809,'unlock':_0x17ac69,'active':_0xd23eb0};};exports['getCallerId']=function(_0x41b439,_0x503366,_0x421b1f){if(!_[_0x1660('0xf')](_0x421b1f)&&_0x1660('0x10')===typeof _0x421b1f&&!_[_0x1660('0x11')](_0x421b1f)){if(!_[_0x1660('0xf')](_0x503366)&&'string'===typeof _0x503366&&!_['isEmpty'](_0x503366)){return util[_0x1660('0x12')]('\x22%s\x22\x20<%s>',_0x503366,_0x421b1f);}return util['format']('\x22%s\x22\x20<%s>',_0x421b1f,_0x421b1f);}if(!_[_0x1660('0xf')](_0x41b439)&&_0x1660('0x10')===typeof _0x41b439&&!_[_0x1660('0x11')](_0x41b439)){return _0x41b439;}return'\x22\x22\x20<>';};exports[_0x1660('0x13')]=function(_0x187868){if(_[_0x1660('0x14')](_0x187868)){return![];}return _0x187868;};exports['addVariables']=function(_0x5691f1,_0x2f4dae,_0x35ba37,_0x416e91,_0x3e5e4a,_0x2915b3){var _0x451f63={'XMD-QUEUE':_0x2f4dae[_0x1660('0x15')]?_0x2f4dae[_0x1660('0x15')][_0x1660('0x16')]:'','XMD-CALLERID':_0x416e91,'XMD-CALLERID-PREVIEW':_0x2915b3?util[_0x1660('0x12')](_0x1660('0x17'),_0x2915b3['calleridname'],_0x2915b3[_0x1660('0x18')]):_0x416e91,'XMD-DIALID':_0x3e5e4a,'XMD-CONTACTID':_0x2f4dae['ContactId'],'XMD-CDRTYPE':_0x1660('0x19'),'CALLERID(all)':_0x416e91,'XMD-VOICEQUEUEID':_0x2f4dae[_0x1660('0x1a')],'XMD-DIALCHANNEL':_0x35ba37,'XMD-DIALTIMEOUT':_0x5691f1[_0x1660('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x1660('0x12')](_0x1660('0x1c'),_0x5691f1[_0x1660('0x1d')]?'g':'',_[_0x1660('0x11')](_0x5691f1[_0x1660('0x1e')])?'':_0x1660('0x1f')),'XMD-DIALURL':_0x5691f1[_0x1660('0x20')]||'','XMD-AGI':_0x5691f1['dialQueueProject']?util[_0x1660('0x12')](_0x1660('0x21'),ipAgi,_0x5691f1[_0x1660('0x22')]):_0x1660('0x23'),'XMD-AGIAFTER':_0x5691f1['dialQueueProject2']?util[_0x1660('0x12')](_0x1660('0x21'),ipAgi,_0x5691f1[_0x1660('0x1d')]):_0x1660('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x2915b3?_0x2915b3[_0x1660('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x2915b3?_0x2915b3[_0x1660('0x25')]:'','XMD-DESTINATION':_0x1660('0x26')};if(!_['isEmpty'](_0x5691f1[_0x1660('0x1e')])){_0x451f63[util[_0x1660('0x12')]('%s',_0x1660('0x27'))]=_0x5691f1[_0x1660('0x1e')];_0x451f63[util[_0x1660('0x12')]('%s',_0x1660('0x28'))]=_0x3e5e4a;}if(_0x2f4dae&&_0x2f4dae[_0x1660('0x29')]){for(var _0xf2b6ac in _0x2f4dae[_0x1660('0x29')]){if(_0x2f4dae['Contact'][_0x1660('0x2a')](_0xf2b6ac)){if(!_[_0x1660('0x14')](_0x2f4dae[_0x1660('0x29')][_0xf2b6ac])&&_0xf2b6ac!=='id'&&_0xf2b6ac!==_0x1660('0x2b')&&_0xf2b6ac!==_0x1660('0x2c')&&_0xf2b6ac!==_0x1660('0x2d')){_0x451f63[util[_0x1660('0x12')](_0x1660('0x2e'),'XMD-',_[_0x1660('0x2f')](_0xf2b6ac))]=_0x2f4dae[_0x1660('0x29')][_0xf2b6ac];}}}}return _0x451f63;};exports[_0x1660('0x30')]=function(_0x58f560){var _0x10921b={};for(var _0x402dd4 in _0x58f560){if(_0x58f560['hasOwnProperty'](_0x402dd4)){_0x10921b[util[_0x1660('0x12')]('%s',_[_0x1660('0x31')](_0x402dd4))]=_0x58f560[_0x402dd4];}}return{'variables':_0x10921b};};exports['updateOriginated']=function(_0x797953,_0x372744){if(!_[_0x1660('0x14')](_0x797953)){if(_0x797953[_0x1660('0x2a')]('originated')){if(_0x797953[_0x1660('0x32')]>0x0){_0x797953[_0x1660('0x32')]-=0x1;}else{logger[_0x1660('0xa')](_0x1660('0x33'),_0x372744);}}}else{logger[_0x1660('0xa')](_0x1660('0x34'),_0x372744);}};exports[_0x1660('0x35')]=function(_0x21cca0){var _0x310dbe=moment()[_0x1660('0x12')](_0x1660('0x36'));_0x21cca0['state']=0xd;_0x21cca0['statedesc']='Blacklist';_0x21cca0[_0x1660('0x37')]=_0x310dbe;_0x21cca0[_0x1660('0x38')]=_0x310dbe;_0x21cca0[_0x1660('0x39')]=_0x310dbe;};exports[_0x1660('0x3a')]=function(_0x282903,_0x5cceca,_0x5e8467){var _0x44d1b2=moment()[_0x1660('0x12')](_0x1660('0x36'));_0x282903[_0x1660('0x3b')]=_0x5cceca;_0x282903[_0x1660('0x3c')]=_0x5e8467;_0x282903[_0x1660('0x38')]=_0x44d1b2;_0x282903[_0x1660('0x3d')]=getSeconds(_0x282903[_0x1660('0x38')],_0x282903[_0x1660('0x37')]);};exports[_0x1660('0x3e')]=function(_0x5885f0,_0x4fd8ad,_0x5c1aa2){_0x5885f0[_0x1660('0x3f')]=_0x4fd8ad;_0x5885f0['UserId']=_0x5c1aa2;};exports[_0x1660('0x40')]=function(_0x3854fd,_0x18e4f9,_0x2a889d){var _0x434d2f=moment()['format'](_0x1660('0x36'));_0x3854fd[_0x1660('0x3b')]=_0x18e4f9;_0x3854fd[_0x1660('0x3c')]=_0x2a889d;_0x3854fd['responsetime']=_0x3854fd['responsetime']?_0x3854fd['responsetime']:_0x434d2f;_0x3854fd['endtime']=_0x3854fd[_0x1660('0x39')]?_0x3854fd[_0x1660('0x39')]:_0x434d2f;_0x3854fd[_0x1660('0x3d')]=getSeconds(_0x3854fd[_0x1660('0x38')]||0x0,_0x3854fd[_0x1660('0x37')]||0x0);_0x3854fd['talktime']=_0x3854fd[_0x1660('0x41')]?getSeconds(_0x3854fd[_0x1660('0x39')],_0x3854fd[_0x1660('0x41')]):0x0;};exports[_0x1660('0x42')]=function(_0x1af075){return _0x1af075===_0x1660('0x43');};exports[_0x1660('0x44')]=function(_0x155d35,_0x1f1c9f,_0x1156ac,_0x23d46a,_0x688067){var _0x413c1c=_0x23d46a?'RECALL':_0x155d35[_0x1660('0x45')];_0x413c1c=_0x688067?_0x1660('0x46'):_0x413c1c;return{'actionid':_0x155d35[_0x1660('0x47')],'action':_0x1660('0x48'),'channel':_0x155d35[_0x1660('0x49')],'callerid':util[_0x1660('0x12')]('\x22%s\x22\x20<%s>',_0x413c1c,_0x155d35[_0x1660('0x18')]),'Exten':'xcally-motion-preview','Context':_0x1660('0x4a'),'Priority':'1','variable':_0x1156ac,'timeout':(_0x1f1c9f[_0x1660('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x155d35[_0x1660('0x47')]};};exports[_0x1660('0x4c')]=function(_0x1706bd){return _0x1706bd['countbusyretry']+_0x1706bd[_0x1660('0x4d')]+_0x1706bd[_0x1660('0x4e')]+_0x1706bd['countagentrejectretry']+_0x1706bd['countnosuchnumberretry'];};exports[_0x1660('0x4f')]=function(_0x3bcef7){var _0x343420=_[_0x1660('0x50')](_0x3bcef7);_0x343420[_0x1660('0x3b')]=0xf;_0x343420[_0x1660('0x3c')]='Global';return _0x343420;};exports[_0x1660('0x51')]=function(_0x5b9c7f,_0x27010a,_0x84ac0b){var _0x403f9f={};_0x403f9f[_0x27010a]=_0x5b9c7f[_0x27010a];_0x403f9f[_0x1660('0x52')]=![];_0x403f9f[_0x1660('0x53')]=moment()[_0x1660('0x54')](_0x84ac0b,_0x1660('0x55'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x403f9f[_0x1660('0x56')]=_0x5b9c7f[_0x1660('0x56')];_0x403f9f[_0x1660('0x57')]=_0x5b9c7f['ListId'];_0x403f9f['VoiceQueueId']=_0x5b9c7f[_0x1660('0x1a')]||undefined;return _0x403f9f;};exports[_0x1660('0x58')]=function(_0x2b3cc3,_0x571105){if(!_[_0x1660('0x14')](_0x2b3cc3)){if(_0x2b3cc3[_0x1660('0x59')]>0x0){_0x2b3cc3[_0x1660('0x59')]-=0x1;}else{logger[_0x1660('0xa')](_0x571105,_0x1660('0x5a'));}}else{logger[_0x1660('0xa')](_0x571105,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x1660('0x5b')]=function(_0x1a47ae){if(_0x1a47ae<=0x0){return!![];}return![];};exports[_0x1660('0x5c')]=function(_0x584a42,_0x2f1e56,_0x56c8cb){_0x584a42[_0x1660('0x5d')]=_0x2f1e56;_0x584a42[_0x1660('0x16')]=_0x584a42['queue'];_0x584a42[_0x1660('0x5e')]=_0x584a42[_0x1660('0x49')];if(_0x56c8cb){_0x584a42[_0x1660('0x5f')]=_0x56c8cb[_0x1660('0x5f')];}return _0x584a42;};exports[_0x1660('0x60')]=function(_0xfcddd6){var _0x50c77a={};_0x50c77a[_0x1660('0x61')]=_0xfcddd6[_0x1660('0x61')];_0x50c77a['interface']=_0xfcddd6['channelAgent'];_0x50c77a['uniqueid']=_0xfcddd6[_0x1660('0x47')];return _0x50c77a;};exports[_0x1660('0x62')]=function(_0x2510cb){var _0x8ec588=[];for(var _0x484d0c in _0x2510cb){if(_0x2510cb[_0x1660('0x2a')](_0x484d0c)){if(!_[_0x1660('0x14')](_0x2510cb[_0x484d0c])&&_0x2510cb[_0x484d0c][_0x1660('0x3b')]===_0x1660('0x63')&&_0x2510cb[_0x484d0c]['status']===_0x1660('0x64')){_0x8ec588[_0x1660('0x65')](_0x2510cb[_0x484d0c]['id']);}}}return _0x8ec588;};exports[_0x1660('0x66')]=function(_0x53504d){var _0x549c8f=moment()[_0x1660('0x67')](0x0);var _0x2bfd29=moment(_0x53504d)[_0x1660('0x67')](0x0);return _0x549c8f['diff'](_0x2bfd29,_0x1660('0x8'));};exports[_0x1660('0x68')]=function(_0x3eed5a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3eed5a['ContactId'],'ListId':_0x3eed5a[_0x1660('0x57')],'VoiceQueueId':_0x3eed5a[_0x1660('0x1a')]||undefined,'CampaignId':_0x3eed5a['CampaignId']||undefined};};exports['filterKey']=function(_0x6c9f4){if(_0x6c9f4===_0x1660('0x47')||_0x6c9f4===_0x1660('0x69')||_0x6c9f4===_0x1660('0x61')||_0x6c9f4===_0x1660('0x6a')||_0x6c9f4===_0x1660('0x6b')||_0x6c9f4===_0x1660('0x6c')||_0x6c9f4==='membername'||_0x6c9f4==='channelAgent'||_0x6c9f4===_0x1660('0x45')||_0x6c9f4===_0x1660('0x52')||_0x6c9f4===_0x1660('0x18')||_0x6c9f4==='scheduledat'||_0x6c9f4==='countbusyretry'||_0x6c9f4==='countcongestionretry'||_0x6c9f4===_0x1660('0x4e')||_0x6c9f4==='countglobal'||_0x6c9f4===_0x1660('0x6d')||_0x6c9f4==='callbackuniqueid'||_0x6c9f4==='callbackat'||_0x6c9f4===_0x1660('0x6e')||_0x6c9f4===_0x1660('0x56')||_0x6c9f4==='ListId'||_0x6c9f4===_0x1660('0x6f')||_0x6c9f4===_0x1660('0x1a')||_0x6c9f4==='sipcallid'||_0x6c9f4===_0x1660('0x70')||_0x6c9f4===_0x1660('0x71')||_0x6c9f4===_0x1660('0x72')||_0x6c9f4===_0x1660('0x73')||_0x6c9f4===_0x1660('0x74')||_0x6c9f4===_0x1660('0x75')||_0x6c9f4===_0x1660('0x76')||_0x6c9f4===_0x1660('0x77')||_0x6c9f4===_0x1660('0x78')||_0x6c9f4===_0x1660('0x79')||_0x6c9f4===_0x1660('0x7a')||_0x6c9f4===_0x1660('0x7b')||_0x6c9f4===_0x1660('0x7c')||_0x6c9f4===_0x1660('0x7d')||_0x6c9f4==='rtpaudioqos'||_0x6c9f4===_0x1660('0x7e')||_0x6c9f4===_0x1660('0x7f')||_0x6c9f4==='rtpaudioqosjitterbridged'||_0x6c9f4===_0x1660('0x80')||_0x6c9f4===_0x1660('0x81')||_0x6c9f4===_0x1660('0x82')||_0x6c9f4===_0x1660('0x83')||_0x6c9f4===_0x1660('0x84')||_0x6c9f4===_0x1660('0x7e')||_0x6c9f4===_0x1660('0x7f')||_0x6c9f4===_0x1660('0x85')||_0x6c9f4==='rtpaudioqosloss'||_0x6c9f4===_0x1660('0x81')||_0x6c9f4===_0x1660('0x82')||_0x6c9f4===_0x1660('0x83')||_0x6c9f4==='bridgepeer'||_0x6c9f4===_0x1660('0x86')||_0x6c9f4===_0x1660('0x3b')||_0x6c9f4===_0x1660('0x3c')){return![];}return!![];};exports[_0x1660('0x87')]=function(_0xd3c68c,_0x25c755){var _0x35734a,_0x5e0ceb,_0x5c4c8c;if(_0x25c755<=0x0){_0x25c755=0x1;}_0x35734a=new RegExp(_0x1660('0x88')+_0x25c755+'}$');_0x5e0ceb=Math[_0x1660('0x89')](0xa,_0x25c755-0x1);_0x5c4c8c=Math[_0x1660('0x89')](0xa,_0x25c755)-0x1;return util[_0x1660('0x12')]('%s',_[_0x1660('0x8a')](_0xd3c68c,_0x35734a,_['random'](_0x5e0ceb,_0x5c4c8c)));};exports[_0x1660('0x8b')]=function(_0x447881){var _0x37ef8e=_0x447881[_0x1660('0x8c')](/"(.*?)"/);return _0x37ef8e?_0x37ef8e[0x1]:_0x447881;};exports[_0x1660('0x8d')]=function(_0x3454fa){var _0x425411=_0x3454fa[_0x1660('0x8c')](/<(.*?)>/);return _0x425411?_0x425411[0x1]:_0x3454fa;};
\ No newline at end of file
index e0ad6c8..be87c54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae5c=['number','boolean','queuepause','reload','voicequeuechannel','voicechannel','queueadd','string'];(function(_0x2de39f,_0x3e5696){var _0x55b81b=function(_0x50b827){while(--_0x50b827){_0x2de39f['push'](_0x2de39f['shift']());}};_0x55b81b(++_0x3e5696);}(_0xae5c,0xce));var _0xcae5=function(_0x332307,_0xbf76f5){_0x332307=_0x332307-0x0;var _0x587079=_0xae5c[_0x332307];return _0x587079;};'use strict';exports[_0xcae5('0x0')]={'queue':{'type':_0xcae5('0x1'),'required':!![]},'interface':{'type':_0xcae5('0x1'),'required':!![]},'membername':{'type':_0xcae5('0x1'),'required':!![]},'penalty':{'type':_0xcae5('0x2'),'required':![]},'paused':{'type':_0xcae5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xcae5('0x1'),'required':!![]},'interface':{'type':_0xcae5('0x1'),'required':!![]}};exports[_0xcae5('0x4')]={'interface':{'type':_0xcae5('0x1'),'required':!![]},'paused':{'type':_0xcae5('0x3')},'reason':{'type':_0xcae5('0x1'),'required':![]}};exports[_0xcae5('0x5')]={'module':{'type':_0xcae5('0x1'),'required':![]}};exports[_0xcae5('0x6')]={'uniqueid':{'type':_0xcae5('0x1'),'required':!![]}};exports[_0xcae5('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xcae5('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xcae5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xcae5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xcae5('0x1')}};
\ No newline at end of file
+var _0xa4a0=['voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','voicequeuechannelhangup'];(function(_0x274f0a,_0x4b0ed2){var _0x388cf4=function(_0x4e09c0){while(--_0x4e09c0){_0x274f0a['push'](_0x274f0a['shift']());}};_0x388cf4(++_0x4b0ed2);}(_0xa4a0,0x12e));var _0x0a4a=function(_0x4c7c8f,_0x26d5a7){_0x4c7c8f=_0x4c7c8f-0x0;var _0x47ded1=_0xa4a0[_0x4c7c8f];return _0x47ded1;};'use strict';exports[_0x0a4a('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x0a4a('0x1'),'required':!![]},'membername':{'type':_0x0a4a('0x1'),'required':!![]},'penalty':{'type':_0x0a4a('0x2'),'required':![]},'paused':{'type':_0x0a4a('0x3'),'required':![]}};exports[_0x0a4a('0x4')]={'queue':{'type':_0x0a4a('0x1'),'required':!![]},'interface':{'type':_0x0a4a('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x0a4a('0x1'),'required':!![]},'paused':{'type':_0x0a4a('0x3')},'reason':{'type':_0x0a4a('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x0a4a('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x0a4a('0x1'),'required':!![]},'filename':{'type':_0x0a4a('0x1')},'format':{'type':_0x0a4a('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x0a4a('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x0a4a('0x6')]={'uniqueid':{'type':_0x0a4a('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 2838fe9..d129a16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3573=['queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','initTelephones','isUndefined','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queue','queuecallerexit'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x3573,0xeb));var _0x3357=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3573[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0x3357('0x0'));var _=require('lodash');var moment=require(_0x3357('0x1'));var Agent=require(_0x3357('0x2'));var Telephone=require(_0x3357('0x3'));var Trunk=require(_0x3357('0x4'));var VoiceQueue=require(_0x3357('0x5'));var Trigger=require(_0x3357('0x6'));var Template=require(_0x3357('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x3357('0x8'));var ZendeskAccount=require(_0x3357('0x9'));var SalesforceAccount=require(_0x3357('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x3357('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x3357('0xc'));var VtigerAccount=require(_0x3357('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x3357('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x3357('0xf'));var Realtime=function(){this[_0x3357('0x10')]={};this[_0x3357('0x11')]={};this[_0x3357('0x12')]={};this[_0x3357('0x13')]={};this[_0x3357('0x14')]={};this[_0x3357('0x15')]={};this['templates']={};this[_0x3357('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3357('0x17')]={};this['channels']={};this[_0x3357('0x18')]={};this[_0x3357('0x19')]={};this[_0x3357('0x1a')]={};this[_0x3357('0x1b')]={};this[_0x3357('0x1c')]={};this[_0x3357('0x1d')]={};this[_0x3357('0x1e')]={};this[_0x3357('0x1f')]={};this[_0x3357('0x20')]={};this[_0x3357('0x21')]={};this[_0x3357('0x22')]={};this[_0x3357('0x23')]={};this[_0x3357('0x24')]={};this[_0x3357('0x25')]={};this[_0x3357('0x26')]={};};function freeIsNotKey(_0x24126e,_0x4ffe51,_0x34e157){var _0x16adca=_[_0x3357('0x27')](_0x24126e,function(_0x40b4c7,_0x1fbf28){return _0x40b4c7[_0x34e157];});for(var _0x38c4fb in _0x4ffe51){if(_0x4ffe51['hasOwnProperty'](_0x38c4fb)){if(!_0x16adca[_0x38c4fb]){delete _0x4ffe51[_0x38c4fb];}}}}function freeIsNotKeySip(_0x303806,_0x1ba3c4){var _0x171518=_[_0x3357('0x27')](_0x303806,function(_0x10fe6a,_0x2f4540){return util[_0x3357('0x28')](_0x3357('0x29'),_0x10fe6a[_0x3357('0x2a')]);});for(var _0x851cd3 in _0x1ba3c4){if(_0x1ba3c4[_0x3357('0x2b')](_0x851cd3)){if(!_0x171518[_0x851cd3]){delete _0x1ba3c4[_0x851cd3];}}}}function freeIsNotKeyAgent(_0x494fce,_0x26ba90){var _0x10896c=_[_0x3357('0x27')](_0x494fce,function(_0x2bca3c,_0x6b2792){var _0x267cee=_[_0x3357('0x2c')](_0x2bca3c[_0x3357('0x2d')])?util[_0x3357('0x28')](_0x3357('0x29'),_0x2bca3c['name']):_0x2bca3c['interface'];return _0x267cee;});for(var _0x1db774 in _0x26ba90){if(_0x26ba90[_0x3357('0x2b')](_0x1db774)){if(!_0x10896c[_0x1db774]){delete _0x26ba90[_0x1db774];}}}}function clearVoiceCallReports(_0x32b6d5){_0x32b6d5[_0x3357('0x2e')]=0x0;_0x32b6d5[_0x3357('0x2f')]=0x0;_0x32b6d5[_0x3357('0x30')]=0x0;_0x32b6d5['sumDuration']=0x0;_0x32b6d5[_0x3357('0x31')]=0x0;}function clearCampaigns(_0x59edfd){if(!_['isEmpty'](_0x59edfd)){for(var _0x4d7c9a in _0x59edfd){if(_0x59edfd[_0x3357('0x2b')](_0x4d7c9a)){_0x59edfd[_0x4d7c9a][_0x3357('0x32')]=0x0;_0x59edfd[_0x4d7c9a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1860a0){if(!_[_0x3357('0x33')](_0x1860a0)){for(var _0x20cb3e in _0x1860a0){if(_0x1860a0[_0x3357('0x2b')](_0x20cb3e)){_0x1860a0[_0x20cb3e][_0x3357('0x2e')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x2f')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x34')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x35')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x30')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x36')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x31')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x37')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x38')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x39')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x3a')]=0x0;_0x1860a0[_0x20cb3e]['outboundNoSuchCallsDay']=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x3b')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x3c')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x3d')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x3e')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x3f')]=0x0;_0x1860a0[_0x20cb3e]['outboundRejectCallsDay']=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x40')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x37')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x41')]=0x0;_0x1860a0[_0x20cb3e][_0x3357('0x42')]=!![];}}}}Realtime[_0x3357('0x43')][_0x3357('0x44')]=function(_0x3a9796,_0x21f132){for(var _0x19ba0d in _0x21f132){if(_0x3a9796[_0x3357('0x2b')](_0x19ba0d)){_0x3a9796[_0x19ba0d]=_0x21f132[_0x19ba0d];}}};Realtime['prototype'][_0x3357('0x45')]=function(){var _0x379230=this;return function(_0x2dd0f2){if(_0x2dd0f2){freeIsNotKeyAgent(_0x2dd0f2,_0x379230[_0x3357('0x10')]);for(var _0x4aef9e=0x0,_0x469a04={},_0x3efa88={};_0x4aef9e<_0x2dd0f2[_0x3357('0x46')];_0x4aef9e+=0x1){_0x469a04=_0x2dd0f2[_0x4aef9e];var _0x1e7c53=_['isNil'](_0x469a04['interface'])?util['format']('SIP/%s',_0x469a04[_0x3357('0x2a')]):_0x469a04['interface'];if(_['isUndefined'](_0x379230[_0x3357('0x10')][_0x1e7c53])){_0x379230[_0x3357('0x10')][_0x1e7c53]=new Agent(_0x469a04);}else{_0x379230[_0x3357('0x44')](_0x379230['agents'][_0x1e7c53],_0x469a04);}}}return _0x379230[_0x3357('0x10')];};};Realtime[_0x3357('0x43')][_0x3357('0x47')]=function(){var _0x50a5bf=this;return function(_0x1f4c31){if(_0x1f4c31){freeIsNotKeySip(_0x1f4c31,_0x50a5bf[_0x3357('0x11')]);for(var _0x2992a6=0x0,_0x4561bd={},_0xccde9a={};_0x2992a6<_0x1f4c31['length'];_0x2992a6+=0x1){_0x4561bd=_0x1f4c31[_0x2992a6];if(_[_0x3357('0x48')](_0x50a5bf[_0x3357('0x11')][util[_0x3357('0x28')](_0x3357('0x29'),_0x4561bd[_0x3357('0x2a')])])){_0x50a5bf[_0x3357('0x11')][util[_0x3357('0x28')](_0x3357('0x29'),_0x4561bd[_0x3357('0x2a')])]=new Telephone(_0x4561bd);}else{_0x50a5bf[_0x3357('0x44')](_0x50a5bf[_0x3357('0x11')][util['format'](_0x3357('0x29'),_0x4561bd[_0x3357('0x2a')])],_0x4561bd);}}}return _0x50a5bf[_0x3357('0x11')];};};Realtime[_0x3357('0x43')]['initTrunks']=function(){var _0x1a1141=this;return function(_0xca468c){if(_0xca468c){freeIsNotKeySip(_0xca468c,_0x1a1141[_0x3357('0x12')]);for(var _0x421016=0x0,_0x42b66d={},_0x541856={};_0x421016<_0xca468c['length'];_0x421016+=0x1){_0x42b66d=_0xca468c[_0x421016];if(_[_0x3357('0x48')](_0x1a1141[_0x3357('0x12')][util['format'](_0x3357('0x29'),_0x42b66d[_0x3357('0x2a')])])){_0x1a1141[_0x3357('0x12')][util[_0x3357('0x28')](_0x3357('0x29'),_0x42b66d[_0x3357('0x2a')])]=new Trunk(_0x42b66d);}else{_0x1a1141[_0x3357('0x44')](_0x1a1141[_0x3357('0x12')][util[_0x3357('0x28')](_0x3357('0x29'),_0x42b66d[_0x3357('0x2a')])],_0x42b66d);}}}return _0x1a1141[_0x3357('0x12')];};};Realtime['prototype'][_0x3357('0x49')]=function(){var _0x3e2f1b=this;return function(_0x296c8f){if(_0x296c8f){freeIsNotKey(_0x296c8f,_0x3e2f1b['voiceQueues'],_0x3357('0x2a'));for(var _0xfe87b7=0x0,_0x3370c3={},_0x26d79b={};_0xfe87b7<_0x296c8f[_0x3357('0x46')];_0xfe87b7+=0x1){_0x3370c3=_0x296c8f[_0xfe87b7];if(_[_0x3357('0x48')](_0x3e2f1b[_0x3357('0x13')][_0x3370c3['name']])){_0x3e2f1b['voiceQueues'][_0x3370c3[_0x3357('0x2a')]]=new VoiceQueue(_0x3370c3);}else{_0x3e2f1b[_0x3357('0x44')](_0x3e2f1b[_0x3357('0x13')][_0x3370c3['name']],_0x3370c3);}}}return _0x3e2f1b['voiceQueues'];};};Realtime[_0x3357('0x43')][_0x3357('0x4a')]=function(){var _0x2666f1=this;return function(_0x349a69){if(_0x349a69){freeIsNotKey(_0x349a69,_0x2666f1[_0x3357('0x14')],'id');for(var _0x1d24f4=0x0,_0x51f1fe={},_0xf87b75={};_0x1d24f4<_0x349a69[_0x3357('0x46')];_0x1d24f4+=0x1){_0x51f1fe=_0x349a69[_0x1d24f4];if(_[_0x3357('0x48')](_0x2666f1[_0x3357('0x14')][_0x51f1fe['id']])){_0x2666f1[_0x3357('0x14')][_0x51f1fe['id']]=new Trigger(_0x51f1fe);}else{_0x2666f1['mergeFromDatabase'](_0x2666f1[_0x3357('0x14')][_0x51f1fe['id']],_0x51f1fe);}}}return _0x2666f1[_0x3357('0x14')];};};Realtime[_0x3357('0x43')][_0x3357('0x4b')]=function(){var _0x1a66dc=this;return function(_0x322f7a){if(_0x322f7a){freeIsNotKey(_0x322f7a,_0x1a66dc[_0x3357('0x4c')],'id');for(var _0x2de9d6=0x0,_0x257df0={},_0x4fb0ab={};_0x2de9d6<_0x322f7a['length'];_0x2de9d6+=0x1){_0x257df0=_0x322f7a[_0x2de9d6];if(_[_0x3357('0x48')](_0x1a66dc[_0x3357('0x4c')][_0x257df0['id']])){_0x1a66dc[_0x3357('0x4c')][_0x257df0['id']]=new Template(_0x257df0);}else{_0x1a66dc['mergeFromDatabase'](_0x1a66dc[_0x3357('0x4c')][_0x257df0['id']],_0x257df0);}}}return _0x1a66dc[_0x3357('0x4c')];};};Realtime[_0x3357('0x43')][_0x3357('0x4d')]=function(){var _0xa46d29=this;return function(_0x3d486d){if(_0x3d486d){freeIsNotKey(_0x3d486d,_0xa46d29[_0x3357('0x1c')],'id');for(var _0x366c38=0x0,_0x3c9836={},_0xb2116={};_0x366c38<_0x3d486d['length'];_0x366c38+=0x1){_0x3c9836=_0x3d486d[_0x366c38];if(_['isUndefined'](_0xa46d29[_0x3357('0x1c')][_0x3c9836['id']])){_0xa46d29[_0x3357('0x1c')][_0x3c9836['id']]=new ZendeskAccount(_0x3c9836);}else{_0xa46d29[_0x3357('0x44')](_0xa46d29[_0x3357('0x1c')][_0x3c9836['id']],_0x3c9836);}}}return _0xa46d29['zendeskAccounts'];};};Realtime[_0x3357('0x43')][_0x3357('0x4e')]=function(){var _0x358869=this;return function(_0x4444b0){if(_0x4444b0){freeIsNotKey(_0x4444b0,_0x358869[_0x3357('0x1d')],'id');for(var _0x5237ce=0x0,_0x21b490={},_0x2a145b={};_0x5237ce<_0x4444b0['length'];_0x5237ce+=0x1){_0x21b490=_0x4444b0[_0x5237ce];if(_['isUndefined'](_0x358869[_0x3357('0x1d')][_0x21b490['id']])){_0x358869['salesforceAccounts'][_0x21b490['id']]=new SalesforceAccount(_0x21b490);}else{_0x358869[_0x3357('0x44')](_0x358869[_0x3357('0x1d')][_0x21b490['id']],_0x21b490);}}}return _0x358869[_0x3357('0x1d')];};};Realtime[_0x3357('0x43')][_0x3357('0x4f')]=function(){var _0x49b9c2=this;return function(_0x383b25){if(_0x383b25){freeIsNotKey(_0x383b25,_0x49b9c2[_0x3357('0x1f')],'id');for(var _0x2a6e06=0x0,_0x5a6ad3={},_0x546a84={};_0x2a6e06<_0x383b25['length'];_0x2a6e06+=0x1){_0x5a6ad3=_0x383b25[_0x2a6e06];if(_[_0x3357('0x48')](_0x49b9c2[_0x3357('0x1f')][_0x5a6ad3['id']])){_0x49b9c2[_0x3357('0x1f')][_0x5a6ad3['id']]=new FreshdeskAccount(_0x5a6ad3);}else{_0x49b9c2['mergeFromDatabase'](_0x49b9c2[_0x3357('0x1f')][_0x5a6ad3['id']],_0x5a6ad3);}}}return _0x49b9c2[_0x3357('0x1f')];};};Realtime[_0x3357('0x43')][_0x3357('0x50')]=function(){var _0x554f3e=this;return function(_0xa98a83){if(_0xa98a83){freeIsNotKey(_0xa98a83,_0x554f3e[_0x3357('0x20')],'id');for(var _0x49c323=0x0,_0x187fbd={},_0xdf862c={};_0x49c323<_0xa98a83['length'];_0x49c323+=0x1){_0x187fbd=_0xa98a83[_0x49c323];if(_[_0x3357('0x48')](_0x554f3e[_0x3357('0x20')][_0x187fbd['id']])){_0x554f3e[_0x3357('0x20')][_0x187fbd['id']]=new ZohoAccount(_0x187fbd);}else{_0x554f3e[_0x3357('0x44')](_0x554f3e['zohoAccounts'][_0x187fbd['id']],_0x187fbd);}}}return _0x554f3e[_0x3357('0x20')];};};Realtime[_0x3357('0x43')][_0x3357('0x51')]=function(){var _0x4a44a2=this;return function(_0x446188){if(_0x446188){freeIsNotKey(_0x446188,_0x4a44a2['deskAccounts'],'id');for(var _0x5db370=0x0,_0x45fec1={},_0x5e0745={};_0x5db370<_0x446188['length'];_0x5db370+=0x1){_0x45fec1=_0x446188[_0x5db370];if(_[_0x3357('0x48')](_0x4a44a2[_0x3357('0x21')][_0x45fec1['id']])){_0x4a44a2[_0x3357('0x21')][_0x45fec1['id']]=new DeskAccount(_0x45fec1);}else{_0x4a44a2[_0x3357('0x44')](_0x4a44a2[_0x3357('0x21')][_0x45fec1['id']],_0x45fec1);}}}return _0x4a44a2['deskAccounts'];};};Realtime[_0x3357('0x43')][_0x3357('0x52')]=function(){var _0x59a3d1=this;return function(_0x497213){if(_0x497213){freeIsNotKey(_0x497213,_0x59a3d1[_0x3357('0x1e')],'id');for(var _0x3dbb7a=0x0,_0x51ccd1={},_0x12ac12={};_0x3dbb7a<_0x497213[_0x3357('0x46')];_0x3dbb7a+=0x1){_0x51ccd1=_0x497213[_0x3dbb7a];if(_[_0x3357('0x48')](_0x59a3d1[_0x3357('0x1e')][_0x51ccd1['id']])){_0x59a3d1[_0x3357('0x1e')][_0x51ccd1['id']]=new SugarcrmAccount(_0x51ccd1);}else{_0x59a3d1[_0x3357('0x44')](_0x59a3d1[_0x3357('0x1e')][_0x51ccd1['id']],_0x51ccd1);}}}return _0x59a3d1[_0x3357('0x1e')];};};Realtime[_0x3357('0x43')][_0x3357('0x53')]=function(){var _0x304520=this;return function(_0x2479d3){if(_0x2479d3){freeIsNotKey(_0x2479d3,_0x304520[_0x3357('0x22')],'id');for(var _0x31c451=0x0,_0x543d88={},_0x2ccb4d={};_0x31c451<_0x2479d3[_0x3357('0x46')];_0x31c451+=0x1){_0x543d88=_0x2479d3[_0x31c451];if(_[_0x3357('0x48')](_0x304520[_0x3357('0x22')][_0x543d88['id']])){_0x304520[_0x3357('0x22')][_0x543d88['id']]=new VtigerAccount(_0x543d88);}else{_0x304520[_0x3357('0x44')](_0x304520[_0x3357('0x22')][_0x543d88['id']],_0x543d88);}}}return _0x304520[_0x3357('0x22')];};};Realtime['prototype'][_0x3357('0x54')]=function(){var _0x3e30cc=this;return function(_0x4639b3){if(_0x4639b3){freeIsNotKey(_0x4639b3,_0x3e30cc[_0x3357('0x23')],'id');for(var _0x27c2e7=0x0,_0x38442b={},_0x4dd323={};_0x27c2e7<_0x4639b3['length'];_0x27c2e7+=0x1){_0x38442b=_0x4639b3[_0x27c2e7];if(_['isUndefined'](_0x3e30cc[_0x3357('0x23')][_0x38442b['id']])){_0x3e30cc[_0x3357('0x23')][_0x38442b['id']]=new ServicenowAccount(_0x38442b);}else{_0x3e30cc[_0x3357('0x44')](_0x3e30cc[_0x3357('0x23')][_0x38442b['id']],_0x38442b);}}}return _0x3e30cc['servicenowAccounts'];};};Realtime[_0x3357('0x43')][_0x3357('0x55')]=function(){var _0x4121f4=this;return function(_0x641e0a){if(_0x641e0a){freeIsNotKey(_0x641e0a,_0x4121f4[_0x3357('0x24')],'id');for(var _0x3a8237=0x0,_0x538520={},_0x523d05={};_0x3a8237<_0x641e0a[_0x3357('0x46')];_0x3a8237+=0x1){_0x538520=_0x641e0a[_0x3a8237];if(_[_0x3357('0x48')](_0x4121f4['dynamics365Accounts'][_0x538520['id']])){_0x4121f4[_0x3357('0x24')][_0x538520['id']]=new Dynamics365Account(_0x538520);}else{_0x4121f4[_0x3357('0x44')](_0x4121f4[_0x3357('0x24')][_0x538520['id']],_0x538520);}}}return _0x4121f4[_0x3357('0x24')];};};Realtime[_0x3357('0x43')][_0x3357('0x56')]=function(){var _0x44003d=this;return function(_0x2ce4c1){if(_0x2ce4c1){freeIsNotKey(_0x2ce4c1,_0x44003d[_0x3357('0x25')],'id');for(var _0x18a1c1=0x0,_0x89baed={},_0x27f37f={};_0x18a1c1<_0x2ce4c1[_0x3357('0x46')];_0x18a1c1+=0x1){_0x89baed=_0x2ce4c1[_0x18a1c1];if(_['isUndefined'](_0x44003d[_0x3357('0x25')][_0x89baed['id']])){_0x44003d[_0x3357('0x25')][_0x89baed['id']]=new FreshsalesAccount(_0x89baed);}else{_0x44003d[_0x3357('0x44')](_0x44003d['freshsalesAccounts'][_0x89baed['id']],_0x89baed);}}}return _0x44003d[_0x3357('0x25')];};};Realtime[_0x3357('0x43')][_0x3357('0x57')]=function(){var _0x5154bb=this;return function(_0x1b19c2){for(var _0x4c2427=0x0;_0x4c2427<_0x1b19c2[_0x3357('0x46')];_0x4c2427+=0x1){_[_0x3357('0x58')](_0x5154bb[_0x3357('0x13')][_0x1b19c2[_0x4c2427][_0x3357('0x2a')]],_0x1b19c2[_0x4c2427]);}return _0x5154bb[_0x3357('0x13')];};};Realtime[_0x3357('0x43')]['initVoiceQueueReports']=function(){var _0x43cf58=this;return function(_0x19ba41){clearVoiceQueues(_0x43cf58[_0x3357('0x13')]);if(_0x19ba41){_0x19ba41=_['groupBy'](_0x19ba41,_0x3357('0x59'));for(var _0x33d215 in _0x19ba41){if(_0x19ba41[_0x3357('0x2b')](_0x33d215)){var _0x48f9f2={};for(var _0x466402=0x0;_0x466402<_0x19ba41[_0x33d215]['length'];_0x466402+=0x1){var _0x3e811c=_0x19ba41[_0x33d215][_0x466402][_0x3357('0x5a')];if(_0x43cf58[_0x3357('0x13')][_0x3e811c]){if(_0x19ba41[_0x33d215][_0x466402][_0x3357('0x5b')]){_0x43cf58[_0x3357('0x13')][_0x3e811c]['unmanaged']+=0x1;}if(_0x19ba41[_0x33d215][_0x466402][_0x3357('0x5c')]){_0x43cf58[_0x3357('0x13')][_0x3e811c][_0x3357('0x35')]+=0x1;}_0x43cf58[_0x3357('0x13')][_0x3e811c][_0x3357('0x30')]+=moment(_0x19ba41[_0x33d215][_0x466402][_0x3357('0x5d')])[_0x3357('0x5e')](moment(_0x19ba41[_0x33d215][_0x466402]['queuecallerjoinAt']),_0x3357('0x5f'))||0x0;if(_0x466402===_0x19ba41[_0x33d215]['length']-0x1){_0x43cf58[_0x3357('0x13')][_0x3e811c][_0x3357('0x36')]+=moment(_0x19ba41[_0x33d215][_0x466402][_0x3357('0x60')]||_0x19ba41[_0x33d215][_0x466402]['queuecallerabandonAt']||_0x19ba41[_0x33d215][_0x466402][_0x3357('0x61')])[_0x3357('0x5e')](moment(_0x19ba41[_0x33d215][_0x466402]['queuecallerjoinAt']),_0x3357('0x5f'))||0x0;_0x43cf58[_0x3357('0x13')][_0x3e811c]['total']+=0x1;if(_0x19ba41[_0x33d215][_0x466402]['queuecallercomplete']){_0x43cf58[_0x3357('0x13')][_0x3e811c][_0x3357('0x2f')]+=0x1;_0x43cf58[_0x3357('0x13')][_0x3e811c]['sumBillable']+=moment(_0x19ba41[_0x33d215][_0x466402][_0x3357('0x60')])['diff'](moment(_0x19ba41[_0x33d215][_0x466402]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x43cf58[_0x3357('0x13')][_0x3e811c][_0x3357('0x36')]+=_0x43cf58[_0x3357('0x13')][_0x3e811c][_0x3357('0x30')]||0x0;}}}}}}return _0x43cf58['voiceQueues'];};};Realtime[_0x3357('0x43')][_0x3357('0x62')]=function(){var _0x1fb965=this;return function(_0x2e447e){clearVoiceCallReports(_0x1fb965['outbound']);if(_0x2e447e){for(var _0x393a8e=0x0;_0x393a8e<_0x2e447e[_0x3357('0x46')];_0x393a8e+=0x1){_0x1fb965[_0x3357('0x16')]['total']+=0x1;_0x1fb965['outbound'][_0x3357('0x36')]+=_0x2e447e[_0x393a8e][_0x3357('0x63')];if(_0x2e447e[_0x393a8e][_0x3357('0x64')]===_0x3357('0x65')){_0x1fb965[_0x3357('0x16')][_0x3357('0x2f')]+=0x1;_0x1fb965['outbound'][_0x3357('0x30')]+=_0x2e447e[_0x393a8e][_0x3357('0x63')]-_0x2e447e[_0x393a8e][_0x3357('0x66')]||0x0;_0x1fb965[_0x3357('0x16')][_0x3357('0x31')]+=_0x2e447e[_0x393a8e][_0x3357('0x66')];}}}return _0x1fb965[_0x3357('0x16')];};};Realtime[_0x3357('0x43')][_0x3357('0x67')]=function(){var _0x13cc12=this;return function(_0x4664fc){if(_0x4664fc){freeIsNotKey(_0x4664fc,_0x13cc12[_0x3357('0x15')],_0x3357('0x2a'));for(var _0x21d9bd=0x0,_0x494cd6={};_0x21d9bd<_0x4664fc[_0x3357('0x46')];_0x21d9bd+=0x1){_0x494cd6=_0x4664fc[_0x21d9bd];if(_[_0x3357('0x48')](_0x13cc12[_0x3357('0x15')][_0x494cd6[_0x3357('0x2a')]])){_0x13cc12[_0x3357('0x15')][_0x494cd6[_0x3357('0x2a')]]=new Campaign(_0x494cd6);}else{_0x13cc12[_0x3357('0x44')](_0x13cc12[_0x3357('0x15')][_0x494cd6[_0x3357('0x2a')]],_0x494cd6);_0x13cc12['campaigns'][_0x494cd6[_0x3357('0x2a')]][_0x3357('0x68')]=_0x494cd6['SquareProject']?_0x494cd6[_0x3357('0x69')][_0x3357('0x2a')]:undefined;}}}return _0x13cc12[_0x3357('0x15')];};};Realtime[_0x3357('0x43')][_0x3357('0x6a')]=function(){var _0x48793e=this;return function(_0x4d345d){if(_0x4d345d){freeIsNotKey(_0x4d345d,_0x48793e['voiceExtensions'],'id');for(var _0x257723=0x0,_0x4eacdb={};_0x257723<_0x4d345d[_0x3357('0x46')];_0x257723+=0x1){_0x4eacdb=_0x4d345d[_0x257723];if(_['isUndefined'](_0x48793e[_0x3357('0x17')][_0x4eacdb['id']])){_0x48793e[_0x3357('0x17')][_0x4eacdb['id']]=new VoiceExtension(_0x4eacdb);}else{_0x48793e[_0x3357('0x44')](_0x48793e['voiceExtensions'][_0x4eacdb['id']],_0x4eacdb);}}}return _0x48793e['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x5eff1c=this;return function(_0x52eed7){clearCampaigns(_0x5eff1c[_0x3357('0x15')]);for(var _0x5d69b9=0x0;_0x5d69b9<_0x52eed7[_0x3357('0x46')];_0x5d69b9+=0x1){_[_0x3357('0x58')](_0x5eff1c['campaigns'][_0x52eed7[_0x5d69b9]['name']],_0x52eed7[_0x5d69b9]);}return _0x5eff1c[_0x3357('0x15')];};};Realtime[_0x3357('0x43')][_0x3357('0x6b')]=function(){var _0x4f0039=this;return function(_0x20ecc8){if(_0x20ecc8){freeIsNotKey(_0x20ecc8,_0x4f0039[_0x3357('0x26')],'id');for(var _0x3e295c=0x0,_0x5c328e={},_0x165a68={};_0x3e295c<_0x20ecc8[_0x3357('0x46')];_0x3e295c+=0x1){_0x5c328e=_0x20ecc8[_0x3e295c];if(_[_0x3357('0x48')](_0x4f0039[_0x3357('0x26')][_0x5c328e['id']])){_0x4f0039['faxAccounts'][_0x5c328e['id']]=new FaxAccount(_0x5c328e);}else{_0x4f0039[_0x3357('0x44')](_0x4f0039[_0x3357('0x26')][_0x5c328e['id']],_0x5c328e);}}}return _0x4f0039[_0x3357('0x26')];};};module[_0x3357('0x6c')]=Realtime;
\ No newline at end of file
+var _0xad62=['initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','isUndefined','prototype','initTelephones','initTrunks','initVoiceQueues','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','answered','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xad62,0x142));var _0x2ad6=function(_0x2af009,_0x5432ee){_0x2af009=_0x2af009-0x0;var _0x46d15f=_0xad62[_0x2af009];return _0x46d15f;};'use strict';var BPromise=require('bluebird');var util=require(_0x2ad6('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x2ad6('0x1'));var Telephone=require('../model/telephone');var Trunk=require(_0x2ad6('0x2'));var VoiceQueue=require(_0x2ad6('0x3'));var Trigger=require(_0x2ad6('0x4'));var Template=require(_0x2ad6('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x2ad6('0x6'));var SalesforceAccount=require(_0x2ad6('0x7'));var FreshdeskAccount=require(_0x2ad6('0x8'));var SugarcrmAccount=require(_0x2ad6('0x9'));var ZohoAccount=require(_0x2ad6('0xa'));var DeskAccount=require(_0x2ad6('0xb'));var VtigerAccount=require(_0x2ad6('0xc'));var ServicenowAccount=require(_0x2ad6('0xd'));var Dynamics365Account=require(_0x2ad6('0xe'));var FreshsalesAccount=require(_0x2ad6('0xf'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x2ad6('0x10')]={};this[_0x2ad6('0x11')]={};this[_0x2ad6('0x12')]={};this[_0x2ad6('0x13')]={};this[_0x2ad6('0x14')]={};this[_0x2ad6('0x15')]={};this[_0x2ad6('0x16')]={};this[_0x2ad6('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2ad6('0x18')]={};this[_0x2ad6('0x19')]={};this['queueChannels']={};this[_0x2ad6('0x1a')]={};this[_0x2ad6('0x1b')]={};this[_0x2ad6('0x1c')]={};this[_0x2ad6('0x1d')]={};this[_0x2ad6('0x1e')]={};this[_0x2ad6('0x1f')]={};this['freshdeskAccounts']={};this[_0x2ad6('0x20')]={};this['deskAccounts']={};this[_0x2ad6('0x21')]={};this[_0x2ad6('0x22')]={};this[_0x2ad6('0x23')]={};this[_0x2ad6('0x24')]={};this[_0x2ad6('0x25')]={};};function freeIsNotKey(_0x1246db,_0x454b9d,_0x52768a){var _0x21ec39=_[_0x2ad6('0x26')](_0x1246db,function(_0x273a58,_0x46a46e){return _0x273a58[_0x52768a];});for(var _0x536b3a in _0x454b9d){if(_0x454b9d[_0x2ad6('0x27')](_0x536b3a)){if(!_0x21ec39[_0x536b3a]){delete _0x454b9d[_0x536b3a];}}}}function freeIsNotKeySip(_0x3192c6,_0x1049a7){var _0xa5bbf=_[_0x2ad6('0x26')](_0x3192c6,function(_0x144131,_0x4a6acf){return util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x144131[_0x2ad6('0x2a')]);});for(var _0x219a02 in _0x1049a7){if(_0x1049a7['hasOwnProperty'](_0x219a02)){if(!_0xa5bbf[_0x219a02]){delete _0x1049a7[_0x219a02];}}}}function freeIsNotKeyAgent(_0x5b0163,_0xcc8310){var _0x536e89=_['mapKeys'](_0x5b0163,function(_0x363150,_0xa6ccaf){var _0x468348=_['isNil'](_0x363150[_0x2ad6('0x2b')])?util['format']('SIP/%s',_0x363150[_0x2ad6('0x2a')]):_0x363150[_0x2ad6('0x2b')];return _0x468348;});for(var _0x55acaf in _0xcc8310){if(_0xcc8310['hasOwnProperty'](_0x55acaf)){if(!_0x536e89[_0x55acaf]){delete _0xcc8310[_0x55acaf];}}}}function clearVoiceCallReports(_0x644137){_0x644137[_0x2ad6('0x2c')]=0x0;_0x644137['answered']=0x0;_0x644137[_0x2ad6('0x2d')]=0x0;_0x644137[_0x2ad6('0x2e')]=0x0;_0x644137[_0x2ad6('0x2f')]=0x0;}function clearCampaigns(_0x3053f2){if(!_[_0x2ad6('0x30')](_0x3053f2)){for(var _0x4fce3f in _0x3053f2){if(_0x3053f2[_0x2ad6('0x27')](_0x4fce3f)){_0x3053f2[_0x4fce3f]['ivrTotalCallsDays']=0x0;_0x3053f2[_0x4fce3f][_0x2ad6('0x31')]=0x0;}}}}function clearVoiceQueues(_0x144e45){if(!_[_0x2ad6('0x30')](_0x144e45)){for(var _0x116518 in _0x144e45){if(_0x144e45[_0x2ad6('0x27')](_0x116518)){_0x144e45[_0x116518][_0x2ad6('0x2c')]=0x0;_0x144e45[_0x116518]['answered']=0x0;_0x144e45[_0x116518][_0x2ad6('0x32')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x33')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x2d')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x2e')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x2f')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x34')]=0x0;_0x144e45[_0x116518]['outboundNoAnswerCallsDay']=0x0;_0x144e45[_0x116518]['outboundBusyCallsDay']=0x0;_0x144e45[_0x116518][_0x2ad6('0x35')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x36')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x37')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x38')]=0x0;_0x144e45[_0x116518]['outboundDropCallsDayCallersExit']=0x0;_0x144e45[_0x116518][_0x2ad6('0x39')]=0x0;_0x144e45[_0x116518]['outboundOriginateFailureCallsDay']=0x0;_0x144e45[_0x116518]['outboundRejectCallsDay']=0x0;_0x144e45[_0x116518][_0x2ad6('0x3a')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x34')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x3b')]=0x0;_0x144e45[_0x116518][_0x2ad6('0x3c')]=!![];}}}}Realtime['prototype'][_0x2ad6('0x3d')]=function(_0x5c1ed3,_0x157b04){for(var _0x2ea198 in _0x157b04){if(_0x5c1ed3[_0x2ad6('0x27')](_0x2ea198)){_0x5c1ed3[_0x2ea198]=_0x157b04[_0x2ea198];}}};Realtime['prototype'][_0x2ad6('0x3e')]=function(){var _0x32a551=this;return function(_0x294eab){if(_0x294eab){freeIsNotKeyAgent(_0x294eab,_0x32a551[_0x2ad6('0x10')]);for(var _0x2ef003=0x0,_0xf49ae7={},_0x2b762c={};_0x2ef003<_0x294eab[_0x2ad6('0x3f')];_0x2ef003+=0x1){_0xf49ae7=_0x294eab[_0x2ef003];var _0x1b85a8=_[_0x2ad6('0x40')](_0xf49ae7['interface'])?util['format'](_0x2ad6('0x29'),_0xf49ae7['name']):_0xf49ae7[_0x2ad6('0x2b')];if(_[_0x2ad6('0x41')](_0x32a551['agents'][_0x1b85a8])){_0x32a551['agents'][_0x1b85a8]=new Agent(_0xf49ae7);}else{_0x32a551[_0x2ad6('0x3d')](_0x32a551[_0x2ad6('0x10')][_0x1b85a8],_0xf49ae7);}}}return _0x32a551[_0x2ad6('0x10')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x43')]=function(){var _0x42191b=this;return function(_0x46f92c){if(_0x46f92c){freeIsNotKeySip(_0x46f92c,_0x42191b[_0x2ad6('0x11')]);for(var _0x125307=0x0,_0x8d95d7={},_0x3d1b15={};_0x125307<_0x46f92c[_0x2ad6('0x3f')];_0x125307+=0x1){_0x8d95d7=_0x46f92c[_0x125307];if(_[_0x2ad6('0x41')](_0x42191b[_0x2ad6('0x11')][util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x8d95d7[_0x2ad6('0x2a')])])){_0x42191b[_0x2ad6('0x11')][util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x8d95d7['name'])]=new Telephone(_0x8d95d7);}else{_0x42191b[_0x2ad6('0x3d')](_0x42191b[_0x2ad6('0x11')][util['format'](_0x2ad6('0x29'),_0x8d95d7[_0x2ad6('0x2a')])],_0x8d95d7);}}}return _0x42191b[_0x2ad6('0x11')];};};Realtime['prototype'][_0x2ad6('0x44')]=function(){var _0x51fd42=this;return function(_0x20c358){if(_0x20c358){freeIsNotKeySip(_0x20c358,_0x51fd42['trunks']);for(var _0xcb1d4=0x0,_0x5f583e={},_0x40402d={};_0xcb1d4<_0x20c358['length'];_0xcb1d4+=0x1){_0x5f583e=_0x20c358[_0xcb1d4];if(_[_0x2ad6('0x41')](_0x51fd42[_0x2ad6('0x12')][util[_0x2ad6('0x28')]('SIP/%s',_0x5f583e['name'])])){_0x51fd42['trunks'][util['format'](_0x2ad6('0x29'),_0x5f583e['name'])]=new Trunk(_0x5f583e);}else{_0x51fd42[_0x2ad6('0x3d')](_0x51fd42[_0x2ad6('0x12')][util[_0x2ad6('0x28')](_0x2ad6('0x29'),_0x5f583e[_0x2ad6('0x2a')])],_0x5f583e);}}}return _0x51fd42[_0x2ad6('0x12')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x45')]=function(){var _0x4729d6=this;return function(_0x1354dd){if(_0x1354dd){freeIsNotKey(_0x1354dd,_0x4729d6[_0x2ad6('0x13')],_0x2ad6('0x2a'));for(var _0x202f7b=0x0,_0x483bca={},_0x487ef4={};_0x202f7b<_0x1354dd[_0x2ad6('0x3f')];_0x202f7b+=0x1){_0x483bca=_0x1354dd[_0x202f7b];if(_[_0x2ad6('0x41')](_0x4729d6[_0x2ad6('0x13')][_0x483bca[_0x2ad6('0x2a')]])){_0x4729d6[_0x2ad6('0x13')][_0x483bca[_0x2ad6('0x2a')]]=new VoiceQueue(_0x483bca);}else{_0x4729d6[_0x2ad6('0x3d')](_0x4729d6[_0x2ad6('0x13')][_0x483bca[_0x2ad6('0x2a')]],_0x483bca);}}}return _0x4729d6['voiceQueues'];};};Realtime[_0x2ad6('0x42')]['initTriggers']=function(){var _0xbe8131=this;return function(_0x5b95cf){if(_0x5b95cf){freeIsNotKey(_0x5b95cf,_0xbe8131[_0x2ad6('0x14')],'id');for(var _0x46185e=0x0,_0x351f14={},_0x3b03f8={};_0x46185e<_0x5b95cf[_0x2ad6('0x3f')];_0x46185e+=0x1){_0x351f14=_0x5b95cf[_0x46185e];if(_[_0x2ad6('0x41')](_0xbe8131[_0x2ad6('0x14')][_0x351f14['id']])){_0xbe8131[_0x2ad6('0x14')][_0x351f14['id']]=new Trigger(_0x351f14);}else{_0xbe8131[_0x2ad6('0x3d')](_0xbe8131[_0x2ad6('0x14')][_0x351f14['id']],_0x351f14);}}}return _0xbe8131[_0x2ad6('0x14')];};};Realtime[_0x2ad6('0x42')]['initTemplates']=function(){var _0x1856ed=this;return function(_0x2b75ab){if(_0x2b75ab){freeIsNotKey(_0x2b75ab,_0x1856ed[_0x2ad6('0x16')],'id');for(var _0x30c00e=0x0,_0x40a2ec={},_0x1c5e6c={};_0x30c00e<_0x2b75ab[_0x2ad6('0x3f')];_0x30c00e+=0x1){_0x40a2ec=_0x2b75ab[_0x30c00e];if(_[_0x2ad6('0x41')](_0x1856ed[_0x2ad6('0x16')][_0x40a2ec['id']])){_0x1856ed[_0x2ad6('0x16')][_0x40a2ec['id']]=new Template(_0x40a2ec);}else{_0x1856ed[_0x2ad6('0x3d')](_0x1856ed['templates'][_0x40a2ec['id']],_0x40a2ec);}}}return _0x1856ed[_0x2ad6('0x16')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x46')]=function(){var _0x5001b6=this;return function(_0x43305d){if(_0x43305d){freeIsNotKey(_0x43305d,_0x5001b6[_0x2ad6('0x1d')],'id');for(var _0x20963d=0x0,_0x1dfd09={},_0xa6349c={};_0x20963d<_0x43305d[_0x2ad6('0x3f')];_0x20963d+=0x1){_0x1dfd09=_0x43305d[_0x20963d];if(_[_0x2ad6('0x41')](_0x5001b6[_0x2ad6('0x1d')][_0x1dfd09['id']])){_0x5001b6[_0x2ad6('0x1d')][_0x1dfd09['id']]=new ZendeskAccount(_0x1dfd09);}else{_0x5001b6[_0x2ad6('0x3d')](_0x5001b6['zendeskAccounts'][_0x1dfd09['id']],_0x1dfd09);}}}return _0x5001b6['zendeskAccounts'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x47')]=function(){var _0xd8dfb6=this;return function(_0x52d742){if(_0x52d742){freeIsNotKey(_0x52d742,_0xd8dfb6[_0x2ad6('0x1e')],'id');for(var _0x3555cf=0x0,_0x785cff={},_0x401b9e={};_0x3555cf<_0x52d742['length'];_0x3555cf+=0x1){_0x785cff=_0x52d742[_0x3555cf];if(_[_0x2ad6('0x41')](_0xd8dfb6[_0x2ad6('0x1e')][_0x785cff['id']])){_0xd8dfb6[_0x2ad6('0x1e')][_0x785cff['id']]=new SalesforceAccount(_0x785cff);}else{_0xd8dfb6['mergeFromDatabase'](_0xd8dfb6[_0x2ad6('0x1e')][_0x785cff['id']],_0x785cff);}}}return _0xd8dfb6['salesforceAccounts'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x48')]=function(){var _0x297c8a=this;return function(_0x50fb92){if(_0x50fb92){freeIsNotKey(_0x50fb92,_0x297c8a['freshdeskAccounts'],'id');for(var _0x6599d1=0x0,_0x4052d4={},_0x54c1b5={};_0x6599d1<_0x50fb92[_0x2ad6('0x3f')];_0x6599d1+=0x1){_0x4052d4=_0x50fb92[_0x6599d1];if(_[_0x2ad6('0x41')](_0x297c8a[_0x2ad6('0x49')][_0x4052d4['id']])){_0x297c8a[_0x2ad6('0x49')][_0x4052d4['id']]=new FreshdeskAccount(_0x4052d4);}else{_0x297c8a[_0x2ad6('0x3d')](_0x297c8a[_0x2ad6('0x49')][_0x4052d4['id']],_0x4052d4);}}}return _0x297c8a[_0x2ad6('0x49')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4a')]=function(){var _0x4d0f43=this;return function(_0xbd25c7){if(_0xbd25c7){freeIsNotKey(_0xbd25c7,_0x4d0f43[_0x2ad6('0x20')],'id');for(var _0x4a658c=0x0,_0x34bb4b={},_0x46b57c={};_0x4a658c<_0xbd25c7[_0x2ad6('0x3f')];_0x4a658c+=0x1){_0x34bb4b=_0xbd25c7[_0x4a658c];if(_[_0x2ad6('0x41')](_0x4d0f43['zohoAccounts'][_0x34bb4b['id']])){_0x4d0f43[_0x2ad6('0x20')][_0x34bb4b['id']]=new ZohoAccount(_0x34bb4b);}else{_0x4d0f43[_0x2ad6('0x3d')](_0x4d0f43[_0x2ad6('0x20')][_0x34bb4b['id']],_0x34bb4b);}}}return _0x4d0f43[_0x2ad6('0x20')];};};Realtime[_0x2ad6('0x42')]['initDeskAccounts']=function(){var _0x129074=this;return function(_0x51f4b0){if(_0x51f4b0){freeIsNotKey(_0x51f4b0,_0x129074[_0x2ad6('0x4b')],'id');for(var _0x5e671e=0x0,_0x23e709={},_0x2196be={};_0x5e671e<_0x51f4b0['length'];_0x5e671e+=0x1){_0x23e709=_0x51f4b0[_0x5e671e];if(_[_0x2ad6('0x41')](_0x129074[_0x2ad6('0x4b')][_0x23e709['id']])){_0x129074['deskAccounts'][_0x23e709['id']]=new DeskAccount(_0x23e709);}else{_0x129074[_0x2ad6('0x3d')](_0x129074[_0x2ad6('0x4b')][_0x23e709['id']],_0x23e709);}}}return _0x129074[_0x2ad6('0x4b')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4c')]=function(){var _0x25144b=this;return function(_0x51316b){if(_0x51316b){freeIsNotKey(_0x51316b,_0x25144b[_0x2ad6('0x1f')],'id');for(var _0xd85bf5=0x0,_0x5b26b2={},_0x12e47e={};_0xd85bf5<_0x51316b['length'];_0xd85bf5+=0x1){_0x5b26b2=_0x51316b[_0xd85bf5];if(_['isUndefined'](_0x25144b['sugarcrmAccounts'][_0x5b26b2['id']])){_0x25144b[_0x2ad6('0x1f')][_0x5b26b2['id']]=new SugarcrmAccount(_0x5b26b2);}else{_0x25144b[_0x2ad6('0x3d')](_0x25144b[_0x2ad6('0x1f')][_0x5b26b2['id']],_0x5b26b2);}}}return _0x25144b['sugarcrmAccounts'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4d')]=function(){var _0x4c5d78=this;return function(_0x51c404){if(_0x51c404){freeIsNotKey(_0x51c404,_0x4c5d78[_0x2ad6('0x21')],'id');for(var _0x64635e=0x0,_0x1acb74={},_0x7b2315={};_0x64635e<_0x51c404[_0x2ad6('0x3f')];_0x64635e+=0x1){_0x1acb74=_0x51c404[_0x64635e];if(_['isUndefined'](_0x4c5d78[_0x2ad6('0x21')][_0x1acb74['id']])){_0x4c5d78['vtigerAccounts'][_0x1acb74['id']]=new VtigerAccount(_0x1acb74);}else{_0x4c5d78[_0x2ad6('0x3d')](_0x4c5d78[_0x2ad6('0x21')][_0x1acb74['id']],_0x1acb74);}}}return _0x4c5d78[_0x2ad6('0x21')];};};Realtime[_0x2ad6('0x42')]['initServicenowAccounts']=function(){var _0x526577=this;return function(_0x1130d9){if(_0x1130d9){freeIsNotKey(_0x1130d9,_0x526577[_0x2ad6('0x22')],'id');for(var _0x12d66e=0x0,_0x3d7955={},_0x30cb3a={};_0x12d66e<_0x1130d9[_0x2ad6('0x3f')];_0x12d66e+=0x1){_0x3d7955=_0x1130d9[_0x12d66e];if(_['isUndefined'](_0x526577['servicenowAccounts'][_0x3d7955['id']])){_0x526577[_0x2ad6('0x22')][_0x3d7955['id']]=new ServicenowAccount(_0x3d7955);}else{_0x526577['mergeFromDatabase'](_0x526577[_0x2ad6('0x22')][_0x3d7955['id']],_0x3d7955);}}}return _0x526577[_0x2ad6('0x22')];};};Realtime['prototype'][_0x2ad6('0x4e')]=function(){var _0x190056=this;return function(_0xbae205){if(_0xbae205){freeIsNotKey(_0xbae205,_0x190056[_0x2ad6('0x23')],'id');for(var _0xfeed5e=0x0,_0x58a8b3={},_0x323e71={};_0xfeed5e<_0xbae205['length'];_0xfeed5e+=0x1){_0x58a8b3=_0xbae205[_0xfeed5e];if(_[_0x2ad6('0x41')](_0x190056[_0x2ad6('0x23')][_0x58a8b3['id']])){_0x190056[_0x2ad6('0x23')][_0x58a8b3['id']]=new Dynamics365Account(_0x58a8b3);}else{_0x190056['mergeFromDatabase'](_0x190056[_0x2ad6('0x23')][_0x58a8b3['id']],_0x58a8b3);}}}return _0x190056[_0x2ad6('0x23')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x4f')]=function(){var _0x5764f3=this;return function(_0x863e5d){if(_0x863e5d){freeIsNotKey(_0x863e5d,_0x5764f3[_0x2ad6('0x24')],'id');for(var _0x456afb=0x0,_0x38ef78={},_0x3ba89d={};_0x456afb<_0x863e5d['length'];_0x456afb+=0x1){_0x38ef78=_0x863e5d[_0x456afb];if(_[_0x2ad6('0x41')](_0x5764f3[_0x2ad6('0x24')][_0x38ef78['id']])){_0x5764f3[_0x2ad6('0x24')][_0x38ef78['id']]=new FreshsalesAccount(_0x38ef78);}else{_0x5764f3[_0x2ad6('0x3d')](_0x5764f3[_0x2ad6('0x24')][_0x38ef78['id']],_0x38ef78);}}}return _0x5764f3['freshsalesAccounts'];};};Realtime[_0x2ad6('0x42')]['initVoiceQueueHopperHistory']=function(){var _0x1dbdaa=this;return function(_0x255db9){for(var _0x27694c=0x0;_0x27694c<_0x255db9['length'];_0x27694c+=0x1){_[_0x2ad6('0x50')](_0x1dbdaa[_0x2ad6('0x13')][_0x255db9[_0x27694c]['name']],_0x255db9[_0x27694c]);}return _0x1dbdaa['voiceQueues'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x51')]=function(){var _0x1cff97=this;return function(_0x115e4e){clearVoiceQueues(_0x1cff97['voiceQueues']);if(_0x115e4e){_0x115e4e=_[_0x2ad6('0x52')](_0x115e4e,_0x2ad6('0x53'));for(var _0x7bc7f4 in _0x115e4e){if(_0x115e4e[_0x2ad6('0x27')](_0x7bc7f4)){var _0xebe6c7={};for(var _0x32c5fb=0x0;_0x32c5fb<_0x115e4e[_0x7bc7f4][_0x2ad6('0x3f')];_0x32c5fb+=0x1){var _0x562142=_0x115e4e[_0x7bc7f4][_0x32c5fb]['queue'];if(_0x1cff97[_0x2ad6('0x13')][_0x562142]){if(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x54')]){_0x1cff97['voiceQueues'][_0x562142][_0x2ad6('0x32')]+=0x1;}if(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x55')]){_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x33')]+=0x1;}_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x2d')]+=moment(_0x115e4e[_0x7bc7f4][_0x32c5fb]['queuecallerleaveAt'])[_0x2ad6('0x56')](moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x57')]),_0x2ad6('0x58'))||0x0;if(_0x32c5fb===_0x115e4e[_0x7bc7f4][_0x2ad6('0x3f')]-0x1){_0x1cff97[_0x2ad6('0x13')][_0x562142]['sumDuration']+=moment(_0x115e4e[_0x7bc7f4][_0x32c5fb]['queuecallercompleteAt']||_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x59')]||_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5a')])[_0x2ad6('0x56')](moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x57')]),_0x2ad6('0x58'))||0x0;_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x2c')]+=0x1;if(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5b')]){_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x5c')]+=0x1;_0x1cff97[_0x2ad6('0x13')][_0x562142][_0x2ad6('0x2f')]+=moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5d')])[_0x2ad6('0x56')](moment(_0x115e4e[_0x7bc7f4][_0x32c5fb][_0x2ad6('0x5e')]),_0x2ad6('0x58'))||0x0;}}else{_0x1cff97[_0x2ad6('0x13')][_0x562142]['sumDuration']+=_0x1cff97['voiceQueues'][_0x562142][_0x2ad6('0x2d')]||0x0;}}}}}}return _0x1cff97[_0x2ad6('0x13')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x5f')]=function(){var _0x26d08c=this;return function(_0x50e490){clearVoiceCallReports(_0x26d08c['outbound']);if(_0x50e490){for(var _0x2015a2=0x0;_0x2015a2<_0x50e490[_0x2ad6('0x3f')];_0x2015a2+=0x1){_0x26d08c[_0x2ad6('0x17')][_0x2ad6('0x2c')]+=0x1;_0x26d08c['outbound'][_0x2ad6('0x2e')]+=_0x50e490[_0x2015a2][_0x2ad6('0x60')];if(_0x50e490[_0x2015a2][_0x2ad6('0x61')]==='ANSWERED'){_0x26d08c[_0x2ad6('0x17')][_0x2ad6('0x5c')]+=0x1;_0x26d08c[_0x2ad6('0x17')]['sumHoldTime']+=_0x50e490[_0x2015a2][_0x2ad6('0x60')]-_0x50e490[_0x2015a2][_0x2ad6('0x62')]||0x0;_0x26d08c['outbound'][_0x2ad6('0x2f')]+=_0x50e490[_0x2015a2][_0x2ad6('0x62')];}}}return _0x26d08c[_0x2ad6('0x17')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x63')]=function(){var _0x18b8fd=this;return function(_0x249a17){if(_0x249a17){freeIsNotKey(_0x249a17,_0x18b8fd['campaigns'],_0x2ad6('0x2a'));for(var _0x299ac3=0x0,_0x12b5e9={};_0x299ac3<_0x249a17['length'];_0x299ac3+=0x1){_0x12b5e9=_0x249a17[_0x299ac3];if(_['isUndefined'](_0x18b8fd[_0x2ad6('0x15')][_0x12b5e9[_0x2ad6('0x2a')]])){_0x18b8fd['campaigns'][_0x12b5e9['name']]=new Campaign(_0x12b5e9);}else{_0x18b8fd[_0x2ad6('0x3d')](_0x18b8fd[_0x2ad6('0x15')][_0x12b5e9['name']],_0x12b5e9);_0x18b8fd[_0x2ad6('0x15')][_0x12b5e9[_0x2ad6('0x2a')]][_0x2ad6('0x64')]=_0x12b5e9[_0x2ad6('0x65')]?_0x12b5e9['SquareProject'][_0x2ad6('0x2a')]:undefined;}}}return _0x18b8fd[_0x2ad6('0x15')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x66')]=function(){var _0x5ac591=this;return function(_0x521c39){if(_0x521c39){freeIsNotKey(_0x521c39,_0x5ac591[_0x2ad6('0x18')],'id');for(var _0x64d9f7=0x0,_0x57c9d7={};_0x64d9f7<_0x521c39[_0x2ad6('0x3f')];_0x64d9f7+=0x1){_0x57c9d7=_0x521c39[_0x64d9f7];if(_[_0x2ad6('0x41')](_0x5ac591['voiceExtensions'][_0x57c9d7['id']])){_0x5ac591[_0x2ad6('0x18')][_0x57c9d7['id']]=new VoiceExtension(_0x57c9d7);}else{_0x5ac591[_0x2ad6('0x3d')](_0x5ac591[_0x2ad6('0x18')][_0x57c9d7['id']],_0x57c9d7);}}}return _0x5ac591[_0x2ad6('0x18')];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x67')]=function(){var _0x4438c5=this;return function(_0x1db44e){clearCampaigns(_0x4438c5[_0x2ad6('0x15')]);for(var _0x5f3f33=0x0;_0x5f3f33<_0x1db44e['length'];_0x5f3f33+=0x1){_[_0x2ad6('0x50')](_0x4438c5[_0x2ad6('0x15')][_0x1db44e[_0x5f3f33][_0x2ad6('0x2a')]],_0x1db44e[_0x5f3f33]);}return _0x4438c5['campaigns'];};};Realtime[_0x2ad6('0x42')][_0x2ad6('0x68')]=function(){var _0x1ef93e=this;return function(_0x5d87b8){if(_0x5d87b8){freeIsNotKey(_0x5d87b8,_0x1ef93e[_0x2ad6('0x25')],'id');for(var _0x55409f=0x0,_0x11c61d={},_0x56685a={};_0x55409f<_0x5d87b8['length'];_0x55409f+=0x1){_0x11c61d=_0x5d87b8[_0x55409f];if(_[_0x2ad6('0x41')](_0x1ef93e[_0x2ad6('0x25')][_0x11c61d['id']])){_0x1ef93e[_0x2ad6('0x25')][_0x11c61d['id']]=new FaxAccount(_0x11c61d);}else{_0x1ef93e[_0x2ad6('0x3d')](_0x1ef93e['faxAccounts'][_0x11c61d['id']],_0x11c61d);}}}return _0x1ef93e[_0x2ad6('0x25')];};};module[_0x2ad6('0x69')]=Realtime;
\ No newline at end of file
index bc86204..7bdcbf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf58d=['indexOf','mobile','phone','SIP/%s','transfererlinkedid','exports','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedTransfer','findAgent','find','accountcode','name','connectedlinenum','assigned','lastAssignedTo','isNil','format','interface','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','exten','type','dialer','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','length','monitorFilename','monitors','filename','createdAt','connectedlinename','membername','isArray','forEach','startsWith','Local'];(function(_0x445169,_0x3359c5){var _0xe5431f=function(_0x1873fb){while(--_0x1873fb){_0x445169['push'](_0x445169['shift']());}};_0xe5431f(++_0x3359c5);}(_0xf58d,0xff));var _0xdf58=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0xf58d[_0x25701b];return _0x3a8a2c;};'use strict';var _=require('lodash');var moment=require(_0xdf58('0x0'));var util=require(_0xdf58('0x1'));var config=require(_0xdf58('0x2'));var ami=require(_0xdf58('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xdf58('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xdf58('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xdf58('0x6'));var VoiceQueueReport=require(_0xdf58('0x7'));var VoiceCallReport=require(_0xdf58('0x8'));var VoiceAgentReport=require(_0xdf58('0x9'));var VoiceDialReport=require(_0xdf58('0xa'));var UserReport=require(_0xdf58('0xb'));function Report(_0x5b2b11){this['realtime']=_0x5b2b11;this[_0xdf58('0xc')]=_0x5b2b11[_0xdf58('0xc')];this[_0xdf58('0xd')]=_0x5b2b11[_0xdf58('0xd')];}Report[_0xdf58('0xe')][_0xdf58('0xf')]=function(_0x5cff66){var _0x22114c=new VoiceQueueReport(this[_0xdf58('0x10')]);var _0x3fdb7f=new VoiceAgentReport(this['realtime']);var _0x1c9c5e=new VoiceDialReport(this[_0xdf58('0x10')]);var _0xde5a9a=new VoiceCallReport(this[_0xdf58('0x10')]);var _0x2d8e72=new UserReport(this['realtime']);if(config[_0xdf58('0x11')]&&config[_0xdf58('0x11')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0xdf58('0x12')][_0xdf58('0x13')](this));ami['on'](_0xdf58('0x14'),this[_0xdf58('0x15')][_0xdf58('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0xdf58('0x16')][_0xdf58('0x13')](this));ami['on'](_0xdf58('0x17'),this[_0xdf58('0x18')]['bind'](this));ami['on'](_0xdf58('0x19'),this['blindTransfer'][_0xdf58('0x13')](this));ami['on']('attendedtransfer',this[_0xdf58('0x1a')][_0xdf58('0x13')](this));}};Report[_0xdf58('0xe')][_0xdf58('0x1b')]=function(_0x2f0923){var _0x4c1dd5;_0x4c1dd5=_[_0xdf58('0x1c')](this[_0xdf58('0xc')],function(_0xdcfa74){return _0xdcfa74[_0xdf58('0x1d')]==_0x2f0923||_0xdcfa74[_0xdf58('0x1e')]==_0x2f0923;});if(_['isNil'](_0x4c1dd5)){var _0x538938=_[_0xdf58('0x1c')](this[_0xdf58('0xd')],function(_0x143cc4){return _0x143cc4[_0xdf58('0x1d')]==_0x2f0923||_0x143cc4['name']==_0x2f0923;});if(_0x538938){_0x4c1dd5=_['find'](this[_0xdf58('0xc')],function(_0x30eef9){return _0x30eef9['interface']==util['format']('SIP/%s',_0x538938[_0xdf58('0x1e')]);});}}return _0x4c1dd5;};Report[_0xdf58('0xe')]['voiceQueueReport']=function(_0x4fe21a){for(var _0x102d7f=0x0;_0x102d7f<_0x4fe21a['length'];_0x102d7f+=0x1){var _0x21dae2=this[_0xdf58('0x1b')](_0x4fe21a[_0x102d7f][_0xdf58('0x1f')]);if(_0x21dae2){_0x4fe21a[_0x102d7f][_0xdf58('0x1d')]=_0x21dae2['accountcode'];_0x4fe21a[_0x102d7f][_0xdf58('0x20')]=!![];_0x4fe21a[_0x102d7f][_0xdf58('0x21')]=_0x21dae2[_0xdf58('0x1e')];_0x4fe21a[_0x102d7f]['interface']=_[_0xdf58('0x22')](_0x21dae2['interface'])?util[_0xdf58('0x23')]('SIP/%s',_0x21dae2[_0xdf58('0x1e')]):_0x21dae2[_0xdf58('0x24')];if(_0x4fe21a[_0x102d7f][_0xdf58('0x25')]){_0x4fe21a[_0x102d7f]['queuecallercompleteAt']=moment()[_0xdf58('0x23')](_0xdf58('0x26'));}if(_0x4fe21a[_0x102d7f][_0xdf58('0x27')]){_0x4fe21a[_0x102d7f]['queuecallerexitAt']=moment()['format'](_0xdf58('0x26'));}RpcMemberReport['voiceQueueReport'](_0x4fe21a[_0x102d7f]);}RpcVoiceQueueReport[_0xdf58('0x28')](_0x4fe21a[_0x102d7f]);}};function extractCalleridNumber(_0x415a50){var _0x541a6e=_0x415a50[_0xdf58('0x29')](/<(.*?)>/);return _0x541a6e?_0x541a6e[0x1]:_0x415a50;}Report['prototype']['voiceCallReport']=function(_0x486279){_0x486279[_0xdf58('0x2a')]=_0x486279[_0xdf58('0x2a')]||_0x486279[_0xdf58('0x2b')];if(_0x486279[_0xdf58('0x2c')]==_0xdf58('0x2d')){_0x486279['lastapplication']=_0xdf58('0x2e');_0x486279[_0xdf58('0x2f')]=_0x486279[_0xdf58('0x2e')];if(_0x486279[_0xdf58('0x30')]==_0xdf58('0x31')){_0x486279[_0xdf58('0x1d')]='';_0x486279[_0xdf58('0x2a')]=extractCalleridNumber(_0x486279[_0xdf58('0x32')]);}else if(_0x486279['context']==_0xdf58('0x33')){if(_0x486279[_0xdf58('0x2a')]==_0xdf58('0x34')){_0x486279['destination']=extractCalleridNumber(_0x486279[_0xdf58('0x35')]);_0x486279['calleridnum']=_0x486279[_0xdf58('0x36')];_0x486279[_0xdf58('0x37')]=[_0x486279['channel'],_0x486279[_0xdf58('0x38')]=_0x486279[_0xdf58('0x37')]][0x0];_0x486279[_0xdf58('0x32')]=_0x486279[_0xdf58('0x35')];}else{_0x486279[_0xdf58('0x2a')]=_0x486279['calleridnum'];_0x486279[_0xdf58('0x39')]=_0x486279[_0xdf58('0x36')];if(_0x486279[_0xdf58('0x3a')]==_0xdf58('0x3b')){_0x486279[_0xdf58('0x1d')]=_0x486279[_0xdf58('0x1f')];}else{_0x486279[_0xdf58('0x1d')]='';}}}}else{_0x486279[_0xdf58('0x32')]=util[_0xdf58('0x23')]('\x22%s\x22\x20<%s>',_0x486279[_0xdf58('0x3c')],_0x486279[_0xdf58('0x39')]);}if(RpcVoiceTransferReport['transfers'][_0x486279[_0xdf58('0x3d')]]){var _0x393cb0=RpcVoiceTransferReport[_0xdf58('0x3e')][_0x486279['linkedid']];_0x393cb0[_0xdf58('0x3f')]=_0x486279[_0xdf58('0x40')];RpcVoiceTransferReport[_0xdf58('0x41')](_0x393cb0);delete RpcVoiceTransferReport[_0xdf58('0x3e')][_0x486279[_0xdf58('0x3d')]];}RpcVoiceCallReport[_0xdf58('0x28')](_0x486279);if(_0x486279['monitor']){for(var _0x53f426=0x0;_0x53f426<_0x486279['monitors'][_0xdf58('0x42')];_0x53f426+=0x1){_0x486279[_0xdf58('0x43')]=_0x486279[_0xdf58('0x44')][_0x53f426][_0xdf58('0x45')];_0x486279[_0xdf58('0x46')]=_0x486279[_0xdf58('0x44')][_0x53f426][_0xdf58('0x46')];if(_0x486279[_0xdf58('0x2b')]=='xcally-motion-preview'){_0x486279[_0xdf58('0x39')]=_0x486279['connectedlinenum'];_0x486279[_0xdf58('0x3c')]=_0x486279[_0xdf58('0x47')];_0x486279[_0xdf58('0x1f')]=_0x486279[_0xdf58('0x1d')];_0x486279['connectedlinename']=_0x486279[_0xdf58('0x48')];_0x486279[_0xdf58('0x2b')]=_0x486279[_0xdf58('0x36')];}else if(_0x486279[_0xdf58('0x2b')]=='xcally-motion-dialer'){_0x486279[_0xdf58('0x39')]=_0x486279[_0xdf58('0x2a')];_0x486279[_0xdf58('0x2b')]=_0x486279[_0xdf58('0x36')];}RpcVoiceRecording[_0xdf58('0x28')](_0x486279);}}};Report[_0xdf58('0xe')][_0xdf58('0x16')]=function(_0xc97d56){if(_[_0xdf58('0x49')](_0xc97d56)){_0xc97d56[_0xdf58('0x4a')](function(_0x4d05aa){RpcVoiceAgentReport[_0xdf58('0x28')](_0x4d05aa);});}else{RpcVoiceAgentReport[_0xdf58('0x28')](_0xc97d56);}};Report[_0xdf58('0xe')][_0xdf58('0x18')]=function(_0x2d7606){RpcVoiceDialReport[_0xdf58('0x28')](_0x2d7606);var _0x5ced2e;var _0x5bc6fc;var _0x141f79=_0x2d7606[_0xdf58('0x38')];if(_[_0xdf58('0x4b')](_0x141f79,_0xdf58('0x4c'))){_0x5bc6fc=_0x141f79['substring'](_0x141f79[_0xdf58('0x4d')]('/')+0x1,_0x141f79[_0xdf58('0x4d')]('@'));_0x5ced2e=_['find'](this[_0xdf58('0xc')],function(_0x2a5937){return _0x2a5937[_0xdf58('0x4e')]==_0x5bc6fc||_0x2a5937[_0xdf58('0x4f')]==_0x5bc6fc||_0x2a5937['accountcode']==_0x5bc6fc;});}else{_0x5bc6fc=_0x141f79['substring'](_0x141f79['indexOf']('/')+0x1,_0x141f79['lastIndexOf']('-'));_0x5ced2e=this[_0xdf58('0x1b')](_0x5bc6fc);}if(_0x5ced2e){_0x2d7606['interface']=_[_0xdf58('0x22')](_0x5ced2e[_0xdf58('0x24')])?util[_0xdf58('0x23')](_0xdf58('0x50'),_0x5ced2e[_0xdf58('0x1e')]):_0x5ced2e['interface'];_0x2d7606[_0xdf58('0x48')]=_0x5ced2e[_0xdf58('0x1e')];_0x2d7606[_0xdf58('0x1d')]=_0x5ced2e['accountcode'];RpcMemberReport[_0xdf58('0x18')](_0x2d7606);}};Report['prototype'][_0xdf58('0x41')]=function(_0x12cab1){RpcVoiceTransferReport['transfers'][_0x12cab1[_0xdf58('0x51')]]=_0x12cab1;};Report[_0xdf58('0xe')][_0xdf58('0x1a')]=function(_0x3f61fc){RpcVoiceTransferReport[_0xdf58('0x1a')](_0x3f61fc);};module[_0xdf58('0x52')]=Report;
\ No newline at end of file
+var _0xab55=['destination','exten','type','dialer','lastapplication','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','create','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','isNil','name','interface','format','SIP/%s','length','accountcode','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xab55,0x137));var _0x5ab5=function(_0x683092,_0x4e32dc){_0x683092=_0x683092-0x0;var _0xba9778=_0xab55[_0x683092];return _0xba9778;};'use strict';var _=require(_0x5ab5('0x0'));var moment=require('moment');var util=require(_0x5ab5('0x1'));var config=require(_0x5ab5('0x2'));var ami=require(_0x5ab5('0x3'));var RpcVoiceAgentReport=require(_0x5ab5('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x5ab5('0x5'));var RpcMemberReport=require(_0x5ab5('0x6'));var RpcVoiceQueueReport=require(_0x5ab5('0x7'));var RpcVoiceRecording=require(_0x5ab5('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x5ab5('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x5ab5('0xa'));var VoiceDialReport=require(_0x5ab5('0xb'));var UserReport=require(_0x5ab5('0xc'));function Report(_0x18e6e3){this['realtime']=_0x18e6e3;this[_0x5ab5('0xd')]=_0x18e6e3[_0x5ab5('0xd')];this[_0x5ab5('0xe')]=_0x18e6e3[_0x5ab5('0xe')];}Report[_0x5ab5('0xf')]['sync']=function(_0x335432){var _0x33713e=new VoiceQueueReport(this[_0x5ab5('0x10')]);var _0x5d1d9e=new VoiceAgentReport(this[_0x5ab5('0x10')]);var _0x4e7510=new VoiceDialReport(this[_0x5ab5('0x10')]);var _0x2525ea=new VoiceCallReport(this['realtime']);var _0x5592ee=new UserReport(this[_0x5ab5('0x10')]);if(config[_0x5ab5('0x11')]&&config['xdr']['disabled']){ami['on'](_0x5ab5('0x12'),this[_0x5ab5('0x13')][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x15'),this[_0x5ab5('0x16')][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x17'),this['voiceAgentReport'][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x18'),this[_0x5ab5('0x19')][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x1a'),this['blindTransfer'][_0x5ab5('0x14')](this));ami['on'](_0x5ab5('0x1b'),this[_0x5ab5('0x1c')][_0x5ab5('0x14')](this));}};Report[_0x5ab5('0xf')][_0x5ab5('0x1d')]=function(_0x144042){var _0x354a75;_0x354a75=_[_0x5ab5('0x1e')](this[_0x5ab5('0xd')],function(_0x188eb8){return _0x188eb8['accountcode']==_0x144042||_0x188eb8['name']==_0x144042;});if(_[_0x5ab5('0x1f')](_0x354a75)){var _0x502542=_['find'](this['telephones'],function(_0x957c21){return _0x957c21['accountcode']==_0x144042||_0x957c21[_0x5ab5('0x20')]==_0x144042;});if(_0x502542){_0x354a75=_[_0x5ab5('0x1e')](this['agents'],function(_0x50ec77){return _0x50ec77[_0x5ab5('0x21')]==util[_0x5ab5('0x22')](_0x5ab5('0x23'),_0x502542[_0x5ab5('0x20')]);});}}return _0x354a75;};Report[_0x5ab5('0xf')]['voiceQueueReport']=function(_0x648bdf){for(var _0x2a8e82=0x0;_0x2a8e82<_0x648bdf[_0x5ab5('0x24')];_0x2a8e82+=0x1){var _0x28dc52=this[_0x5ab5('0x1d')](_0x648bdf[_0x2a8e82]['connectedlinenum']);if(_0x28dc52){_0x648bdf[_0x2a8e82][_0x5ab5('0x25')]=_0x28dc52['accountcode'];_0x648bdf[_0x2a8e82][_0x5ab5('0x26')]=!![];_0x648bdf[_0x2a8e82][_0x5ab5('0x27')]=_0x28dc52[_0x5ab5('0x20')];_0x648bdf[_0x2a8e82][_0x5ab5('0x21')]=_['isNil'](_0x28dc52[_0x5ab5('0x21')])?util[_0x5ab5('0x22')]('SIP/%s',_0x28dc52[_0x5ab5('0x20')]):_0x28dc52['interface'];if(_0x648bdf[_0x2a8e82][_0x5ab5('0x28')]){_0x648bdf[_0x2a8e82][_0x5ab5('0x29')]=moment()[_0x5ab5('0x22')](_0x5ab5('0x2a'));}if(_0x648bdf[_0x2a8e82][_0x5ab5('0x2b')]){_0x648bdf[_0x2a8e82][_0x5ab5('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x5ab5('0x13')](_0x648bdf[_0x2a8e82]);}RpcVoiceQueueReport['create'](_0x648bdf[_0x2a8e82]);}};function extractCalleridNumber(_0x3433e1){var _0x52def4=_0x3433e1['match'](/<(.*?)>/);return _0x52def4?_0x52def4[0x1]:_0x3433e1;}Report[_0x5ab5('0xf')][_0x5ab5('0x16')]=function(_0xf0451a){_0xf0451a[_0x5ab5('0x2d')]=_0xf0451a[_0x5ab5('0x2d')]||_0xf0451a[_0x5ab5('0x2e')];if(_0xf0451a[_0x5ab5('0x2f')]==_0x5ab5('0x30')){_0xf0451a[_0x5ab5('0x31')]='queue';_0xf0451a[_0x5ab5('0x32')]=_0xf0451a['queue'];if(_0xf0451a[_0x5ab5('0x33')]==_0x5ab5('0x34')){_0xf0451a[_0x5ab5('0x25')]='';_0xf0451a[_0x5ab5('0x2d')]=extractCalleridNumber(_0xf0451a[_0x5ab5('0x35')]);}else if(_0xf0451a['context']==_0x5ab5('0x36')){if(_0xf0451a['destination']==_0x5ab5('0x37')){_0xf0451a[_0x5ab5('0x2d')]=extractCalleridNumber(_0xf0451a[_0x5ab5('0x38')]);_0xf0451a[_0x5ab5('0x39')]=_0xf0451a[_0x5ab5('0x3a')];_0xf0451a[_0x5ab5('0x3b')]=[_0xf0451a[_0x5ab5('0x3c')],_0xf0451a[_0x5ab5('0x3c')]=_0xf0451a['destinationchannel']][0x0];_0xf0451a['callerid']=_0xf0451a[_0x5ab5('0x38')];}else{_0xf0451a[_0x5ab5('0x2d')]=_0xf0451a[_0x5ab5('0x39')];_0xf0451a[_0x5ab5('0x39')]=_0xf0451a[_0x5ab5('0x3a')];if(_0xf0451a[_0x5ab5('0x3d')]==_0x5ab5('0x3e')){_0xf0451a['accountcode']=_0xf0451a[_0x5ab5('0x3f')];}else{_0xf0451a['accountcode']='';}}}}else{_0xf0451a[_0x5ab5('0x35')]=util['format'](_0x5ab5('0x40'),_0xf0451a[_0x5ab5('0x41')],_0xf0451a[_0x5ab5('0x39')]);}if(RpcVoiceTransferReport[_0x5ab5('0x42')][_0xf0451a[_0x5ab5('0x43')]]){var _0x466343=RpcVoiceTransferReport[_0x5ab5('0x42')][_0xf0451a[_0x5ab5('0x43')]];_0x466343[_0x5ab5('0x44')]=_0xf0451a['uniqueid'];RpcVoiceTransferReport[_0x5ab5('0x45')](_0x466343);delete RpcVoiceTransferReport['transfers'][_0xf0451a[_0x5ab5('0x43')]];}RpcVoiceCallReport[_0x5ab5('0x46')](_0xf0451a);if(_0xf0451a[_0x5ab5('0x47')]){for(var _0x2bedb8=0x0;_0x2bedb8<_0xf0451a[_0x5ab5('0x48')]['length'];_0x2bedb8+=0x1){_0xf0451a[_0x5ab5('0x49')]=_0xf0451a[_0x5ab5('0x48')][_0x2bedb8]['filename'];_0xf0451a[_0x5ab5('0x4a')]=_0xf0451a[_0x5ab5('0x48')][_0x2bedb8]['createdAt'];if(_0xf0451a[_0x5ab5('0x2e')]==_0x5ab5('0x37')){_0xf0451a['calleridnum']=_0xf0451a['connectedlinenum'];_0xf0451a['calleridname']=_0xf0451a[_0x5ab5('0x4b')];_0xf0451a[_0x5ab5('0x3f')]=_0xf0451a[_0x5ab5('0x25')];_0xf0451a['connectedlinename']=_0xf0451a[_0x5ab5('0x4c')];_0xf0451a[_0x5ab5('0x2e')]=_0xf0451a[_0x5ab5('0x3a')];}else if(_0xf0451a[_0x5ab5('0x2e')]=='xcally-motion-dialer'){_0xf0451a[_0x5ab5('0x39')]=_0xf0451a['destination'];_0xf0451a[_0x5ab5('0x2e')]=_0xf0451a[_0x5ab5('0x3a')];}RpcVoiceRecording['create'](_0xf0451a);}}};Report[_0x5ab5('0xf')][_0x5ab5('0x4d')]=function(_0x4496a0){if(_[_0x5ab5('0x4e')](_0x4496a0)){_0x4496a0[_0x5ab5('0x4f')](function(_0x5e98dc){RpcVoiceAgentReport[_0x5ab5('0x46')](_0x5e98dc);});}else{RpcVoiceAgentReport[_0x5ab5('0x46')](_0x4496a0);}};Report[_0x5ab5('0xf')][_0x5ab5('0x19')]=function(_0x6d1ca6){RpcVoiceDialReport[_0x5ab5('0x46')](_0x6d1ca6);var _0x5d5702;var _0xe8ff83;var _0x340cfd=_0x6d1ca6[_0x5ab5('0x3c')];if(_[_0x5ab5('0x50')](_0x340cfd,_0x5ab5('0x51'))){_0xe8ff83=_0x340cfd[_0x5ab5('0x52')](_0x340cfd[_0x5ab5('0x53')]('/')+0x1,_0x340cfd[_0x5ab5('0x53')]('@'));_0x5d5702=_[_0x5ab5('0x1e')](this['agents'],function(_0x5d3fbb){return _0x5d3fbb[_0x5ab5('0x54')]==_0xe8ff83||_0x5d3fbb[_0x5ab5('0x55')]==_0xe8ff83||_0x5d3fbb[_0x5ab5('0x25')]==_0xe8ff83;});}else{_0xe8ff83=_0x340cfd[_0x5ab5('0x52')](_0x340cfd[_0x5ab5('0x53')]('/')+0x1,_0x340cfd[_0x5ab5('0x56')]('-'));_0x5d5702=this[_0x5ab5('0x1d')](_0xe8ff83);}if(_0x5d5702){_0x6d1ca6[_0x5ab5('0x21')]=_[_0x5ab5('0x1f')](_0x5d5702[_0x5ab5('0x21')])?util['format'](_0x5ab5('0x23'),_0x5d5702['name']):_0x5d5702[_0x5ab5('0x21')];_0x6d1ca6[_0x5ab5('0x4c')]=_0x5d5702[_0x5ab5('0x20')];_0x6d1ca6[_0x5ab5('0x25')]=_0x5d5702[_0x5ab5('0x25')];RpcMemberReport[_0x5ab5('0x19')](_0x6d1ca6);}};Report['prototype'][_0x5ab5('0x45')]=function(_0x3f10e0){RpcVoiceTransferReport[_0x5ab5('0x42')][_0x3f10e0[_0x5ab5('0x57')]]=_0x3f10e0;};Report['prototype'][_0x5ab5('0x1c')]=function(_0x34fb82){RpcVoiceTransferReport['attendedTransfer'](_0x34fb82);};module[_0x5ab5('0x58')]=Report;
\ No newline at end of file
index a45bac4..fd93dc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb98=['telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','status','peer','updateStatusRealtime','[userReport][peerstatus]','exports','lodash','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','[userReport][sipshowregistry]','actionDeviceStateList','error','inspect','actionSipPeerStatus','catch','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','format','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb98,0x1d7));var _0x8cb9=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0xcb98[_0x5caf7e];return _0x5c3435;};'use strict';var _=require(_0x8cb9('0x0'));var moment=require('moment');var util=require(_0x8cb9('0x1'));var Redis=require(_0x8cb9('0x2'));var BPromise=require(_0x8cb9('0x3'));var config=require(_0x8cb9('0x4'));var logger=require(_0x8cb9('0x5'))('ami');var ami=require(_0x8cb9('0x6'));config['redis']=_[_0x8cb9('0x7')](config[_0x8cb9('0x8')],{'host':_0x8cb9('0x9'),'port':0x18eb});var io=require(_0x8cb9('0xa'))(new Redis(config[_0x8cb9('0x8')]));function UserReport(_0x184cca){this[_0x8cb9('0xb')]=_0x184cca['trunks'];this['agents']=_0x184cca[_0x8cb9('0xc')];this['telephones']=_0x184cca[_0x8cb9('0xd')];ami['on'](_0x8cb9('0xe'),this[_0x8cb9('0xf')][_0x8cb9('0x10')](this));ami['on']('registry',this[_0x8cb9('0xf')][_0x8cb9('0x10')](this));ami['on'](_0x8cb9('0x11'),this[_0x8cb9('0x12')]['bind'](this));ami['on'](_0x8cb9('0x13'),this[_0x8cb9('0x14')][_0x8cb9('0x10')](this));return this[_0x8cb9('0x15')]();}function showSipRegistrations(){Promise[_0x8cb9('0x16')]()[_0x8cb9('0x17')](ami[_0x8cb9('0x18')]())['catch'](function(_0x5ef5ca){logger['error'](_0x8cb9('0x19'),util['inspect'](_0x5ef5ca,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x8cb9('0x16')]()[_0x8cb9('0x17')](ami[_0x8cb9('0x1a')]())['catch'](function(_0x131518){logger[_0x8cb9('0x1b')]('[userReport][devicestatelist]',util[_0x8cb9('0x1c')](_0x131518,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x8cb9('0x16')]()[_0x8cb9('0x17')](ami[_0x8cb9('0x1d')]())[_0x8cb9('0x1e')](function(_0x3f50e0){logger[_0x8cb9('0x1b')](_0x8cb9('0x1f'),util[_0x8cb9('0x1c')](_0x3f50e0,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x8cb9('0x15')]=function(){setInterval(function(){BPromise[_0x8cb9('0x16')]()[_0x8cb9('0x17')](showSipRegistrations())[_0x8cb9('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x8cb9('0x20')][_0x8cb9('0x21')]=function(_0x4d7cc3){return _0x4d7cc3!==null&&!_[_0x8cb9('0x22')](_0x4d7cc3);};UserReport[_0x8cb9('0x20')][_0x8cb9('0x23')]=function(_0x272593,_0x18f141,_0x5dfd90){io['to'](_0x272593)[_0x8cb9('0x23')](_0x18f141,_0x5dfd90);};UserReport[_0x8cb9('0x20')]['syncRegistry']=function(_0x5a5d3e){try{if(this[_0x8cb9('0x21')](_0x5a5d3e)){logger[_0x8cb9('0x24')](_0x8cb9('0x25'),_0x5a5d3e[_0x8cb9('0x26')],_0x5a5d3e[_0x8cb9('0x27')]);logger[_0x8cb9('0x28')]('[userReport][registry]',util[_0x8cb9('0x1c')](_0x5a5d3e,{'showHidden':![],'depth':null}));var _0x3afb39=_[_0x8cb9('0x29')](this['trunks'],{'defaultuser':_0x5a5d3e[_0x8cb9('0x26')]});if(_0x3afb39){_0x5a5d3e['stateRegistry']=_0x5a5d3e[_0x8cb9('0x27')];_[_0x8cb9('0x2a')](_0x3afb39,_[_0x8cb9('0x2b')](_0x5a5d3e,[_0x8cb9('0x2c'),'actionid','username',_0x8cb9('0x27')]));logger[_0x8cb9('0x28')](_0x8cb9('0x2d'),util[_0x8cb9('0x1c')](_0x3afb39,{'showHidden':![],'depth':null}));this[_0x8cb9('0x23')](util['format'](_0x8cb9('0x2e'),_0x3afb39[_0x8cb9('0x2f')]),_0x8cb9('0x30'),_0x3afb39);}}}catch(_0x48a6d8){logger[_0x8cb9('0x1b')](_0x8cb9('0x31'),util[_0x8cb9('0x1c')](_0x48a6d8,{'showHidden':![],'depth':null}));}};UserReport[_0x8cb9('0x20')]['syncDeviceState']=function(_0x55a7e6){try{if(this[_0x8cb9('0x21')](_0x55a7e6)){logger[_0x8cb9('0x24')](_0x8cb9('0x32'),_0x55a7e6[_0x8cb9('0x33')],_0x55a7e6['state']);logger[_0x8cb9('0x28')](_0x8cb9('0x34'),util[_0x8cb9('0x1c')](_0x55a7e6,{'showHidden':![],'depth':null}));if(this['agents'][_0x55a7e6['device']]){if(!this['agents'][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x35')]||_0x55a7e6[_0x8cb9('0x27')]['toLowerCase']()==_0x8cb9('0x36')){this[_0x8cb9('0xc')][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x35')]=![];if(this[_0x8cb9('0xc')][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x27')]!==_0x55a7e6[_0x8cb9('0x27')][_0x8cb9('0x37')]()){this['agents'][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x38')]=_[_0x8cb9('0x39')](moment()[_0x8cb9('0x3a')]('x'));}this['agents'][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x27')]=_0x55a7e6[_0x8cb9('0x27')][_0x8cb9('0x37')]();this[_0x8cb9('0xc')][_0x55a7e6[_0x8cb9('0x33')]]['updateStatusRealtime'](_0x55a7e6);}}else if(this[_0x8cb9('0xd')][_0x55a7e6[_0x8cb9('0x33')]]){if(this[_0x8cb9('0xd')][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x27')]!==_0x55a7e6['state'][_0x8cb9('0x37')]()){this[_0x8cb9('0xd')][_0x55a7e6[_0x8cb9('0x33')]]['stateTime']=_['toNumber'](moment()[_0x8cb9('0x3a')]('x'));}this['telephones'][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x27')]=_0x55a7e6[_0x8cb9('0x27')][_0x8cb9('0x37')]();logger[_0x8cb9('0x28')](_0x8cb9('0x3b'),util['inspect'](this[_0x8cb9('0xd')][_0x55a7e6[_0x8cb9('0x33')]],{'showHidden':![],'depth':null}));this[_0x8cb9('0x23')](util[_0x8cb9('0x3a')](_0x8cb9('0x3c'),this['telephones'][_0x55a7e6[_0x8cb9('0x33')]]['name']),_0x8cb9('0x3d'),this[_0x8cb9('0xd')][_0x55a7e6[_0x8cb9('0x33')]]);}else if(this[_0x8cb9('0xb')][_0x55a7e6['device']]){if(this[_0x8cb9('0xb')][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x27')]!==_0x55a7e6[_0x8cb9('0x27')][_0x8cb9('0x37')]()){this[_0x8cb9('0xb')][_0x55a7e6[_0x8cb9('0x33')]]['stateTime']=_[_0x8cb9('0x39')](moment()[_0x8cb9('0x3a')]('x'));}this[_0x8cb9('0xb')][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x27')]=_0x55a7e6[_0x8cb9('0x27')][_0x8cb9('0x37')]();logger[_0x8cb9('0x28')](_0x8cb9('0x3e'),util[_0x8cb9('0x1c')](this['trunks'][_0x55a7e6['device']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x8cb9('0x2e'),this[_0x8cb9('0xb')][_0x55a7e6[_0x8cb9('0x33')]][_0x8cb9('0x2f')]),'trunk:save',this[_0x8cb9('0xb')][_0x55a7e6[_0x8cb9('0x33')]]);}else if(_[_0x8cb9('0x3f')](_0x55a7e6[_0x8cb9('0x33')],_0x8cb9('0x40'))){var _0x1dfcae=_0x55a7e6[_0x8cb9('0x33')];var _0x330780=_0x1dfcae[_0x8cb9('0x41')](_0x1dfcae[_0x8cb9('0x42')]('/')+0x1,_0x1dfcae['indexOf']('@'));var _0x1495ac=_['find'](this[_0x8cb9('0xc')],function(_0x9b99c8){return _0x9b99c8['mobile']==_0x330780||_0x9b99c8[_0x8cb9('0x43')]==_0x330780||_0x9b99c8[_0x8cb9('0x44')]==_0x330780;});if(_0x1495ac){if(_0x1495ac[_0x8cb9('0x27')]!==_0x55a7e6[_0x8cb9('0x27')][_0x8cb9('0x37')]()){_0x1495ac[_0x8cb9('0x38')]=_[_0x8cb9('0x39')](moment()['format']('x'));}_0x1495ac['state']=_0x55a7e6['state']['toLowerCase']();_0x1495ac['local']=!![];_0x1495ac['updateStatusRealtime'](_0x55a7e6);}}}}catch(_0x43a243){logger[_0x8cb9('0x1b')](_0x8cb9('0x34'),util['inspect'](_0x43a243,{'showHidden':![],'depth':null}));}};UserReport[_0x8cb9('0x20')]['syncPeerStatus']=function(_0x39e743){try{if(this[_0x8cb9('0x21')](_0x39e743)&&this[_0x8cb9('0x21')](_0x39e743[_0x8cb9('0x13')])){logger[_0x8cb9('0x24')](_0x8cb9('0x45'),_0x39e743['peer'],_0x39e743[_0x8cb9('0x46')],_0x39e743['peerstatus']);logger['debug']('[userReport][peerstatus]',util['inspect'](_0x39e743,{'showHidden':![],'depth':null}));if(this[_0x8cb9('0xc')][_0x39e743['peer']]){if(!this['agents'][_0x39e743['peer']][_0x8cb9('0x35')]||_0x39e743[_0x8cb9('0x13')][_0x8cb9('0x37')]()=='registered'){this[_0x8cb9('0xc')][_0x39e743['peer']][_0x8cb9('0x35')]=![];this[_0x8cb9('0xc')][_0x39e743['peer']][_0x8cb9('0x47')]=_0x39e743[_0x8cb9('0x13')][_0x8cb9('0x37')]();this['agents'][_0x39e743[_0x8cb9('0x48')]][_0x8cb9('0x46')]=_0x39e743['address'];this[_0x8cb9('0xc')][_0x39e743[_0x8cb9('0x48')]][_0x8cb9('0x49')](_0x39e743);}}else if(this[_0x8cb9('0xd')][_0x39e743[_0x8cb9('0x48')]]){this[_0x8cb9('0xd')][_0x39e743[_0x8cb9('0x48')]][_0x8cb9('0x47')]=_0x39e743['peerstatus'][_0x8cb9('0x37')]();this[_0x8cb9('0xd')][_0x39e743[_0x8cb9('0x48')]][_0x8cb9('0x46')]=_0x39e743[_0x8cb9('0x46')];logger[_0x8cb9('0x28')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x8cb9('0x1c')](this['telephones'][_0x39e743[_0x8cb9('0x48')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x8cb9('0x3c'),this[_0x8cb9('0xd')][_0x39e743['peer']]['name']),'telephone:save',this['telephones'][_0x39e743[_0x8cb9('0x48')]]);}else if(this['trunks'][_0x39e743['peer']]){this['trunks'][_0x39e743['peer']][_0x8cb9('0x47')]=_0x39e743['peerstatus']['toLowerCase']();this[_0x8cb9('0xb')][_0x39e743[_0x8cb9('0x48')]]['address']=_0x39e743[_0x8cb9('0x46')];logger[_0x8cb9('0x28')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x8cb9('0x1c')](this[_0x8cb9('0xb')][_0x39e743[_0x8cb9('0x48')]],{'showHidden':![],'depth':null}));this[_0x8cb9('0x23')](util[_0x8cb9('0x3a')](_0x8cb9('0x2e'),this[_0x8cb9('0xb')][_0x39e743[_0x8cb9('0x48')]][_0x8cb9('0x2f')]),_0x8cb9('0x30'),this[_0x8cb9('0xb')][_0x39e743[_0x8cb9('0x48')]]);}}}catch(_0x320522){logger['error'](_0x8cb9('0x4a'),util[_0x8cb9('0x1c')](_0x320522,{'showHidden':![],'depth':null}));}};module[_0x8cb9('0x4b')]=UserReport;
\ No newline at end of file
+var _0xfe86=['telephone:save','substring','indexOf','mobile','phone','updateStatusRealtime','syncPeerStatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','ioredis','../../../config/environment','../../../config/logger','ami','defaults','redis','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','inuse','toLowerCase','stateTime','toNumber','telephone:%s'];(function(_0x2aac51,_0x2dbc51){var _0x4ba79b=function(_0x507343){while(--_0x507343){_0x2aac51['push'](_0x2aac51['shift']());}};_0x4ba79b(++_0x2dbc51);}(_0xfe86,0x16d));var _0x6fe8=function(_0x483d8b,_0x526c52){_0x483d8b=_0x483d8b-0x0;var _0x6500f1=_0xfe86[_0x483d8b];return _0x6500f1;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0x6fe8('0x0'));var BPromise=require('bluebird');var config=require(_0x6fe8('0x1'));var logger=require(_0x6fe8('0x2'))(_0x6fe8('0x3'));var ami=require('../ami');config['redis']=_[_0x6fe8('0x4')](config[_0x6fe8('0x5')],{'host':_0x6fe8('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function UserReport(_0x423b4c){this['trunks']=_0x423b4c[_0x6fe8('0x7')];this[_0x6fe8('0x8')]=_0x423b4c['agents'];this[_0x6fe8('0x9')]=_0x423b4c[_0x6fe8('0x9')];ami['on'](_0x6fe8('0xa'),this[_0x6fe8('0xb')]['bind'](this));ami['on'](_0x6fe8('0xc'),this['syncRegistry'][_0x6fe8('0xd')](this));ami['on'](_0x6fe8('0xe'),this[_0x6fe8('0xf')]['bind'](this));ami['on'](_0x6fe8('0x10'),this['syncPeerStatus'][_0x6fe8('0xd')](this));return this[_0x6fe8('0x11')]();}function showSipRegistrations(){Promise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](ami['actionSipShowRegistry']())[_0x6fe8('0x14')](function(_0x2824e2){logger['error'](_0x6fe8('0x15'),util[_0x6fe8('0x16')](_0x2824e2,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](ami[_0x6fe8('0x17')]())[_0x6fe8('0x14')](function(_0x2cc42b){logger[_0x6fe8('0x18')](_0x6fe8('0x19'),util[_0x6fe8('0x16')](_0x2cc42b,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](ami[_0x6fe8('0x1a')]())[_0x6fe8('0x14')](function(_0x48ce2a){logger[_0x6fe8('0x18')](_0x6fe8('0x1b'),util[_0x6fe8('0x16')](_0x48ce2a,{'showHidden':![],'depth':null}));});}UserReport[_0x6fe8('0x1c')][_0x6fe8('0x11')]=function(){setInterval(function(){BPromise[_0x6fe8('0x12')]()[_0x6fe8('0x13')](showSipRegistrations())[_0x6fe8('0x13')](listDeviceStates())[_0x6fe8('0x13')](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x6fe8('0x1d')]=function(_0x2ee671){return _0x2ee671!==null&&!_['isUndefined'](_0x2ee671);};UserReport[_0x6fe8('0x1c')]['emit']=function(_0xc508cd,_0x462187,_0x3cb673){io['to'](_0xc508cd)['emit'](_0x462187,_0x3cb673);};UserReport[_0x6fe8('0x1c')]['syncRegistry']=function(_0x1779ec){try{if(this['isNotNull'](_0x1779ec)){logger[_0x6fe8('0x1e')](_0x6fe8('0x1f'),_0x1779ec[_0x6fe8('0x20')],_0x1779ec[_0x6fe8('0x21')]);logger[_0x6fe8('0x22')]('[userReport][registry]',util[_0x6fe8('0x16')](_0x1779ec,{'showHidden':![],'depth':null}));var _0x41e1b5=_[_0x6fe8('0x23')](this[_0x6fe8('0x7')],{'defaultuser':_0x1779ec['username']});if(_0x41e1b5){_0x1779ec[_0x6fe8('0x24')]=_0x1779ec[_0x6fe8('0x21')];_['merge'](_0x41e1b5,_[_0x6fe8('0x25')](_0x1779ec,[_0x6fe8('0x26'),_0x6fe8('0x27'),_0x6fe8('0x20'),_0x6fe8('0x21')]));logger[_0x6fe8('0x22')](_0x6fe8('0x28'),util[_0x6fe8('0x16')](_0x41e1b5,{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util[_0x6fe8('0x2a')](_0x6fe8('0x2b'),_0x41e1b5[_0x6fe8('0x2c')]),_0x6fe8('0x2d'),_0x41e1b5);}}}catch(_0x1c9b13){logger[_0x6fe8('0x18')]('[userReport][registry]',util[_0x6fe8('0x16')](_0x1c9b13,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x51878b){try{if(this['isNotNull'](_0x51878b)){logger[_0x6fe8('0x1e')](_0x6fe8('0x2e'),_0x51878b[_0x6fe8('0x2f')],_0x51878b[_0x6fe8('0x21')]);logger[_0x6fe8('0x22')](_0x6fe8('0x30'),util['inspect'](_0x51878b,{'showHidden':![],'depth':null}));if(this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]]){if(!this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x31')]||_0x51878b[_0x6fe8('0x21')]['toLowerCase']()==_0x6fe8('0x32')){this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]]['local']=![];if(this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]]['state']!==_0x51878b['state'][_0x6fe8('0x33')]()){this[_0x6fe8('0x8')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x34')]=_[_0x6fe8('0x35')](moment()[_0x6fe8('0x2a')]('x'));}this['agents'][_0x51878b['device']]['state']=_0x51878b[_0x6fe8('0x21')]['toLowerCase']();this['agents'][_0x51878b[_0x6fe8('0x2f')]]['updateStatusRealtime'](_0x51878b);}}else if(this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]]){if(this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x21')]!==_0x51878b['state'][_0x6fe8('0x33')]()){this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x34')]=_['toNumber'](moment()['format']('x'));}this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]]['state']=_0x51878b[_0x6fe8('0x21')][_0x6fe8('0x33')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]],{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util['format'](_0x6fe8('0x36'),this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x2c')]),_0x6fe8('0x37'),this[_0x6fe8('0x9')][_0x51878b[_0x6fe8('0x2f')]]);}else if(this[_0x6fe8('0x7')][_0x51878b[_0x6fe8('0x2f')]]){if(this[_0x6fe8('0x7')][_0x51878b['device']][_0x6fe8('0x21')]!==_0x51878b[_0x6fe8('0x21')][_0x6fe8('0x33')]()){this[_0x6fe8('0x7')][_0x51878b['device']][_0x6fe8('0x34')]=_[_0x6fe8('0x35')](moment()[_0x6fe8('0x2a')]('x'));}this[_0x6fe8('0x7')][_0x51878b[_0x6fe8('0x2f')]][_0x6fe8('0x21')]=_0x51878b[_0x6fe8('0x21')]['toLowerCase']();logger[_0x6fe8('0x22')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0x6fe8('0x7')][_0x51878b[_0x6fe8('0x2f')]],{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util[_0x6fe8('0x2a')]('trunk:%s',this['trunks'][_0x51878b['device']][_0x6fe8('0x2c')]),'trunk:save',this[_0x6fe8('0x7')][_0x51878b['device']]);}else if(_['startsWith'](_0x51878b[_0x6fe8('0x2f')],'Local')){var _0x35cf49=_0x51878b['device'];var _0xcaedb3=_0x35cf49[_0x6fe8('0x38')](_0x35cf49[_0x6fe8('0x39')]('/')+0x1,_0x35cf49['indexOf']('@'));var _0x16fbf1=_[_0x6fe8('0x23')](this[_0x6fe8('0x8')],function(_0x15e7d3){return _0x15e7d3[_0x6fe8('0x3a')]==_0xcaedb3||_0x15e7d3[_0x6fe8('0x3b')]==_0xcaedb3||_0x15e7d3['accountcode']==_0xcaedb3;});if(_0x16fbf1){if(_0x16fbf1[_0x6fe8('0x21')]!==_0x51878b['state']['toLowerCase']()){_0x16fbf1[_0x6fe8('0x34')]=_['toNumber'](moment()[_0x6fe8('0x2a')]('x'));}_0x16fbf1[_0x6fe8('0x21')]=_0x51878b['state'][_0x6fe8('0x33')]();_0x16fbf1[_0x6fe8('0x31')]=!![];_0x16fbf1[_0x6fe8('0x3c')](_0x51878b);}}}}catch(_0x480d99){logger[_0x6fe8('0x18')]('[userReport][devicestatechange]',util['inspect'](_0x480d99,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6fe8('0x3d')]=function(_0x1cd85a){try{if(this['isNotNull'](_0x1cd85a)&&this[_0x6fe8('0x1d')](_0x1cd85a['peerstatus'])){logger[_0x6fe8('0x1e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x1cd85a[_0x6fe8('0x3e')],_0x1cd85a[_0x6fe8('0x3f')],_0x1cd85a[_0x6fe8('0x10')]);logger['debug'](_0x6fe8('0x40'),util['inspect'](_0x1cd85a,{'showHidden':![],'depth':null}));if(this['agents'][_0x1cd85a[_0x6fe8('0x3e')]]){if(!this[_0x6fe8('0x8')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x31')]||_0x1cd85a[_0x6fe8('0x10')][_0x6fe8('0x33')]()==_0x6fe8('0x41')){this[_0x6fe8('0x8')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x31')]=![];this[_0x6fe8('0x8')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x42')]=_0x1cd85a['peerstatus'][_0x6fe8('0x33')]();this['agents'][_0x1cd85a['peer']][_0x6fe8('0x3f')]=_0x1cd85a['address'];this[_0x6fe8('0x8')][_0x1cd85a['peer']][_0x6fe8('0x3c')](_0x1cd85a);}}else if(this['telephones'][_0x1cd85a[_0x6fe8('0x3e')]]){this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x42')]=_0x1cd85a[_0x6fe8('0x10')][_0x6fe8('0x33')]();this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x3f')]=_0x1cd85a[_0x6fe8('0x3f')];logger[_0x6fe8('0x22')](_0x6fe8('0x43'),util['inspect'](this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x2c')]),_0x6fe8('0x37'),this[_0x6fe8('0x9')][_0x1cd85a[_0x6fe8('0x3e')]]);}else if(this[_0x6fe8('0x7')][_0x1cd85a[_0x6fe8('0x3e')]]){this[_0x6fe8('0x7')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x42')]=_0x1cd85a[_0x6fe8('0x10')][_0x6fe8('0x33')]();this['trunks'][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x3f')]=_0x1cd85a['address'];logger[_0x6fe8('0x22')](_0x6fe8('0x44'),util['inspect'](this['trunks'][_0x1cd85a[_0x6fe8('0x3e')]],{'showHidden':![],'depth':null}));this[_0x6fe8('0x29')](util['format'](_0x6fe8('0x2b'),this[_0x6fe8('0x7')][_0x1cd85a[_0x6fe8('0x3e')]][_0x6fe8('0x2c')]),_0x6fe8('0x2d'),this['trunks'][_0x1cd85a[_0x6fe8('0x3e')]]);}}}catch(_0x386696){logger[_0x6fe8('0x18')](_0x6fe8('0x40'),util[_0x6fe8('0x16')](_0x386696,{'showHidden':![],'depth':null}));}};module[_0x6fe8('0x45')]=UserReport;
\ No newline at end of file
index fa6e0ef..768249a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01af=['agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','info','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','merge','event','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','interface','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','hasOwnProperty','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','omit','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberlastcall','memberpenalty','memberrealtime','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','exports','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','channels','voiceQueues'];(function(_0x3358ca,_0x1348e4){var _0x4fd425=function(_0x29883d){while(--_0x29883d){_0x3358ca['push'](_0x3358ca['shift']());}};_0x4fd425(++_0x1348e4);}(_0x01af,0x1a6));var _0xf01a=function(_0x173911,_0x36152e){_0x173911=_0x173911-0x0;var _0xc73fcd=_0x01af[_0x173911];return _0xc73fcd;};'use strict';var _=require(_0xf01a('0x0'));var moment=require('moment');var util=require(_0xf01a('0x1'));var Redis=require('ioredis');var config=require(_0xf01a('0x2'));var logger=require(_0xf01a('0x3'))(_0xf01a('0x4'));var ami=require(_0xf01a('0x5'));config[_0xf01a('0x6')]=_['defaults'](config[_0xf01a('0x6')],{'host':_0xf01a('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf01a('0x6')]));function VoiceAgentReport(_0xa76f69){this[_0xf01a('0x8')]={};this[_0xf01a('0x9')]=_0xa76f69[_0xf01a('0x9')];this[_0xf01a('0xa')]=_0xa76f69[_0xf01a('0xa')];this[_0xf01a('0xb')]={};ami['on'](_0xf01a('0xc'),this[_0xf01a('0xd')]['bind'](this));ami['on'](_0xf01a('0xe'),this[_0xf01a('0xf')][_0xf01a('0x10')](this));ami['on']('agentringnoanswer',this[_0xf01a('0x11')][_0xf01a('0x10')](this));ami['on'](_0xf01a('0x12'),this[_0xf01a('0x13')][_0xf01a('0x10')](this));ami['on'](_0xf01a('0x14'),this[_0xf01a('0x15')]['bind'](this));ami['on'](_0xf01a('0x16'),this['syncVarSet'][_0xf01a('0x10')](this));ami['on'](_0xf01a('0x17'),this[_0xf01a('0x18')][_0xf01a('0x10')](this));ami['on']('musiconholdstart',this[_0xf01a('0x19')][_0xf01a('0x10')](this));ami['on'](_0xf01a('0x1a'),this[_0xf01a('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0xf01a('0x1c')][_0xf01a('0x10')](this));ami['on'](_0xf01a('0x1d'),this[_0xf01a('0x1e')]['bind'](this));}VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0x20')]=function(_0x5bd8d8,_0x5594c3,_0x2aa8c0){io['to'](_0x5bd8d8)[_0xf01a('0x20')](_0x5594c3,_0x2aa8c0);};VoiceAgentReport[_0xf01a('0x1f')]['isNotNull']=function(_0x10e71b){return _0x10e71b!==null&&!_['isUndefined'](_0x10e71b);};VoiceAgentReport['prototype'][_0xf01a('0xd')]=function(_0x231ed7){try{if(this['isNotNull'](_0x231ed7)){logger[_0xf01a('0x21')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x231ed7[_0xf01a('0x22')],_0x231ed7[_0xf01a('0x23')],_0x231ed7[_0xf01a('0x24')]);logger[_0xf01a('0x25')](_0xf01a('0x26'),_0x231ed7['uniqueid'],util[_0xf01a('0x27')](_0x231ed7,{'showHidden':![],'depth':null}));if(_[_0xf01a('0x28')](this[_0xf01a('0x8')][_0x231ed7['uniqueid']])){this[_0xf01a('0x8')][_0x231ed7[_0xf01a('0x22')]]={};}if(_[_0xf01a('0x28')](this[_0xf01a('0x8')][_0x231ed7[_0xf01a('0x22')]][_0x231ed7[_0xf01a('0x24')]])){this['channels'][_0x231ed7[_0xf01a('0x22')]][_0x231ed7[_0xf01a('0x24')]]={'agentcalledAt':moment()['format'](_0xf01a('0x29')),'lastevent':_0xf01a('0x2a'),'mandatoryDisposition':this['voiceQueues'][_0x231ed7[_0xf01a('0x2b')]]?this[_0xf01a('0x9')][_0x231ed7[_0xf01a('0x2b')]][_0xf01a('0x2c')]||![]:![],'type':this['voiceQueues'][_0x231ed7[_0xf01a('0x2b')]]?this['voiceQueues'][_0x231ed7[_0xf01a('0x2b')]][_0xf01a('0x2d')]||_0xf01a('0x2e'):_0xf01a('0x2e'),'variables':this[_0xf01a('0xb')][_0x231ed7[_0xf01a('0x22')]]};}_[_0xf01a('0x2f')](this['channels'][_0x231ed7['uniqueid']][_0x231ed7[_0xf01a('0x24')]],_['omit'](_0x231ed7,[_0xf01a('0x30'),'privilege']));logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x231ed7['uniqueid'],util[_0xf01a('0x27')](this['channels'][_0x231ed7[_0xf01a('0x22')]][_0x231ed7[_0xf01a('0x24')]],{'showHidden':![],'depth':null}));ami['emit'](_0xf01a('0x31'),this[_0xf01a('0x8')][_0x231ed7[_0xf01a('0x22')]][_0x231ed7[_0xf01a('0x24')]]);logger['debug'](_0xf01a('0x32'),_0x231ed7[_0xf01a('0x22')],util[_0xf01a('0x27')](this[_0xf01a('0x8')][_0x231ed7[_0xf01a('0x22')]][_0x231ed7[_0xf01a('0x24')]],{'showHidden':![],'depth':null}));this[_0xf01a('0x20')](util[_0xf01a('0x33')](_0xf01a('0x34'),_0x231ed7[_0xf01a('0x23')]),_0xf01a('0x35'),this['channels'][_0x231ed7[_0xf01a('0x22')]][_0x231ed7[_0xf01a('0x24')]]);}}catch(_0xab64f0){logger[_0xf01a('0x36')]('[%s][voiceAgentReport][agentcalled]',_0x231ed7['uniqueid'],util[_0xf01a('0x27')](_0xab64f0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0xf')]=function(_0x2066e6){try{if(this[_0xf01a('0x37')](_0x2066e6)){if(this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]]){logger[_0xf01a('0x25')](_0xf01a('0x38'),_0x2066e6[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x2066e6,{'showHidden':![],'depth':null}));for(var _0x226234 in this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]]){if(this[_0xf01a('0x8')][_0x2066e6['uniqueid']]['hasOwnProperty'](_0x226234)){if(_0x2066e6[_0xf01a('0x24')]===_0x226234){logger[_0xf01a('0x21')](_0xf01a('0x39'),_0x2066e6['uniqueid'],_0x2066e6[_0xf01a('0x23')],_0x2066e6[_0xf01a('0x24')]);this[_0xf01a('0x8')][_0x2066e6['uniqueid']][_0x226234][_0xf01a('0x3a')]=moment()[_0xf01a('0x33')](_0xf01a('0x29'));this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x3b')]=_0x2066e6[_0xf01a('0x3b')];this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x3c')]=_0x2066e6[_0xf01a('0x3c')];this[_0xf01a('0x8')][_0x2066e6['uniqueid']][_0x226234]['destchannelstate']=_0x2066e6[_0xf01a('0x3d')];this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x3e')]=_0x2066e6['destchannelstatedesc'];this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x3f')]=_0x2066e6[_0xf01a('0x3f')];this['channels'][_0x2066e6['uniqueid']][_0x226234][_0xf01a('0x40')]=_0xf01a('0x41');_[_0xf01a('0x2f')](this[_0xf01a('0xa')][_0x2066e6[_0xf01a('0x42')]],_['pick'](_0x2066e6,[_0xf01a('0x2b'),'destconnectedlinenum']));logger[_0xf01a('0x25')](_0xf01a('0x43'),_0x2066e6[_0xf01a('0x22')],util[_0xf01a('0x27')](this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x2066e6[_0xf01a('0x24')]],{'showHidden':![],'depth':null}));ami['emit'](_0xf01a('0x44'),this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x2066e6[_0xf01a('0x24')]]);logger[_0xf01a('0x25')](_0xf01a('0x45'),_0x2066e6[_0xf01a('0x22')],util['inspect'](this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x2066e6[_0xf01a('0x24')]],{'showHidden':![],'depth':null}));this[_0xf01a('0x20')](util[_0xf01a('0x33')]('user:%s',_0x2066e6['membername']),'user:agentconnect',this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x2066e6[_0xf01a('0x24')]]);}else if(!this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x46')]&&!this[_0xf01a('0x8')][_0x2066e6['uniqueid']][_0x226234][_0xf01a('0x14')]){logger['info'](_0xf01a('0x47'),_0x2066e6[_0xf01a('0x22')],this['channels'][_0x2066e6['uniqueid']][_0x226234][_0xf01a('0x23')],_0x226234);this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x46')]=!![];this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x48')]=moment()[_0xf01a('0x33')](_0xf01a('0x29'));this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x49')]=_0x2066e6[_0xf01a('0x24')];this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x4a')]=_0x2066e6[_0xf01a('0x23')];this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234][_0xf01a('0x40')]=_0xf01a('0x4b');this['channels'][_0x2066e6[_0xf01a('0x22')]][_0x226234]['reason']=_0xf01a('0x4b');logger[_0xf01a('0x25')](_0xf01a('0x4c'),_0x2066e6[_0xf01a('0x22')],util[_0xf01a('0x27')](this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234],{'showHidden':![],'depth':null}));ami[_0xf01a('0x20')](_0xf01a('0x4d'),this[_0xf01a('0x8')][_0x2066e6[_0xf01a('0x22')]][_0x226234]);}}}}}}catch(_0x2ef3fe){logger[_0xf01a('0x36')](_0xf01a('0x4e'),_0x2066e6['uniqueid'],util[_0xf01a('0x27')](_0x2ef3fe,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf01a('0x11')]=function(_0x15a691){try{if(this[_0xf01a('0x37')](_0x15a691)){logger[_0xf01a('0x25')](_0xf01a('0x4f'),_0x15a691[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x15a691,{'showHidden':![],'depth':null}));if(this[_0xf01a('0x8')][_0x15a691['uniqueid']]&&this['channels'][_0x15a691['uniqueid']][_0x15a691[_0xf01a('0x24')]]){logger['info'](_0xf01a('0x50'),_0x15a691[_0xf01a('0x22')],_0x15a691[_0xf01a('0x23')],_0x15a691[_0xf01a('0x24')]);this['channels'][_0x15a691[_0xf01a('0x22')]][_0x15a691['destuniqueid']]['agentringnoanswer']=!![];this[_0xf01a('0x8')][_0x15a691[_0xf01a('0x22')]][_0x15a691[_0xf01a('0x24')]]['agentringnoanswerAt']=moment()[_0xf01a('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x15a691['uniqueid']][_0x15a691[_0xf01a('0x24')]][_0xf01a('0x40')]=_0xf01a('0x51');this[_0xf01a('0x8')][_0x15a691['uniqueid']][_0x15a691[_0xf01a('0x24')]][_0xf01a('0x52')]=_0xf01a('0x51');logger[_0xf01a('0x25')](_0xf01a('0x53'),_0x15a691['uniqueid'],util[_0xf01a('0x27')](this[_0xf01a('0x8')][_0x15a691[_0xf01a('0x22')]][_0x15a691['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xf01a('0x20')]('custom:agentringnoanswer',this['channels'][_0x15a691[_0xf01a('0x22')]][_0x15a691[_0xf01a('0x24')]]);}}}catch(_0x5f0aa6){logger[_0xf01a('0x36')](_0xf01a('0x54'),_0x15a691[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x5f0aa6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0x13')]=function(_0x2b2c72){try{if(this[_0xf01a('0x37')](_0x2b2c72)){logger[_0xf01a('0x25')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x2b2c72[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x2b2c72,{'showHidden':![],'depth':null}));if(this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]]){for(var _0x8763eb in this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]]){if(this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]]['hasOwnProperty'](_0x8763eb)&&!this[_0xf01a('0x8')][_0x2b2c72['uniqueid']][_0x8763eb][_0xf01a('0x46')]&&!this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]][_0x8763eb][_0xf01a('0x14')]){logger[_0xf01a('0x21')](_0xf01a('0x55'),_0x2b2c72['uniqueid'],this[_0xf01a('0x8')][_0x2b2c72['uniqueid']][_0x8763eb][_0xf01a('0x23')],_0x8763eb);this[_0xf01a('0x8')][_0x2b2c72['uniqueid']][_0x8763eb][_0xf01a('0x46')]=!![];this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]][_0x8763eb][_0xf01a('0x48')]=moment()['format'](_0xf01a('0x29'));this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]][_0x8763eb]['lastevent']=_0xf01a('0x56');this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]][_0x8763eb]['reason']='abandoned';logger['debug'](_0xf01a('0x57'),_0x2b2c72[_0xf01a('0x22')],util[_0xf01a('0x27')](this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]][_0x8763eb],{'showHidden':![],'depth':null}));ami[_0xf01a('0x20')](_0xf01a('0x58'),this[_0xf01a('0x8')][_0x2b2c72[_0xf01a('0x22')]][_0x8763eb]);}}}}}catch(_0x460927){logger['error'](_0xf01a('0x59'),_0x2b2c72[_0xf01a('0x22')],util['inspect'](_0x460927,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0x15')]=function(_0x4915fa){try{if(this[_0xf01a('0x37')](_0x4915fa)){logger[_0xf01a('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x4915fa[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x4915fa,{'showHidden':![],'depth':null}));if(this[_0xf01a('0x8')][_0x4915fa['uniqueid']]){for(var _0x2aa004 in this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]]){if(this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0xf01a('0x5a')](_0x2aa004)){if(this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004][_0xf01a('0x3a')]&&!this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004]['agentcomplete']){logger[_0xf01a('0x21')](_0xf01a('0x5b'),_0x4915fa[_0xf01a('0x22')],this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004][_0xf01a('0x23')],_0x2aa004);this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004][_0xf01a('0x14')]=!![];this[_0xf01a('0x8')][_0x4915fa['uniqueid']][_0x2aa004][_0xf01a('0x5c')]=moment()[_0xf01a('0x33')](_0xf01a('0x29'));this[_0xf01a('0x8')][_0x4915fa['uniqueid']][_0x2aa004][_0xf01a('0x40')]=_0xf01a('0x5d');this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004]['reason']=_0x4915fa[_0xf01a('0x52')]==_0xf01a('0x5e')?_0xf01a('0x5f'):_0x4915fa[_0xf01a('0x52')];this[_0xf01a('0x8')][_0x4915fa['uniqueid']][_0x2aa004][_0xf01a('0x60')]=_0x4915fa[_0xf01a('0x60')];if(this[_0xf01a('0x9')][_0x4915fa['queue']]&&this['voiceQueues'][_0x4915fa['queue']][_0xf01a('0x61')]){this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004][_0xf01a('0x62')]=this['voiceQueues'][_0x4915fa['queue']][_0xf01a('0x63')];this['channels'][_0x4915fa['uniqueid']][_0x2aa004]['agentacw']=!![];}this['agents'][_0x4915fa[_0xf01a('0x42')]]=_[_0xf01a('0x64')](this[_0xf01a('0xa')][_0x4915fa[_0xf01a('0x42')]],[_0xf01a('0x2b'),'destconnectedlinenum']);logger[_0xf01a('0x25')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x4915fa['uniqueid'],util[_0xf01a('0x27')](this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004],{'showHidden':![],'depth':null}));ami[_0xf01a('0x20')](_0xf01a('0x65'),this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004]);logger[_0xf01a('0x25')](_0xf01a('0x66'),_0x4915fa[_0xf01a('0x22')],util[_0xf01a('0x27')](this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004],{'showHidden':![],'depth':null}));this[_0xf01a('0x20')](util[_0xf01a('0x33')]('user:%s',_0x4915fa['membername']),'user:agentcomplete',this[_0xf01a('0x8')][_0x4915fa[_0xf01a('0x22')]][_0x2aa004]);}}}}}}catch(_0xd10ecf){logger[_0xf01a('0x36')]('[%s][voiceAgentReport][agentcomplete]',_0x4915fa[_0xf01a('0x22')],util[_0xf01a('0x27')](_0xd10ecf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0x67')]=function(_0x4792b5){try{if(this['isNotNull'](_0x4792b5)){logger[_0xf01a('0x25')](_0xf01a('0x68'),_0x4792b5[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x4792b5,{'showHidden':![],'depth':null}));this['addVariable'](_0x4792b5[_0xf01a('0x22')],_[_0xf01a('0x69')](_0x4792b5[_0xf01a('0x6a')])[0x0],_0x4792b5['value']);if(this[_0xf01a('0x8')][_0x4792b5[_0xf01a('0x22')]]){for(var _0x192c50 in this['channels'][_0x4792b5[_0xf01a('0x22')]]){if(this[_0xf01a('0x8')][_0x4792b5[_0xf01a('0x22')]][_0xf01a('0x5a')](_0x192c50)){logger[_0xf01a('0x21')](_0xf01a('0x6b'),_0x4792b5[_0xf01a('0x22')],_0x192c50,_[_0xf01a('0x69')](_0x4792b5[_0xf01a('0x6a')])[0x0],_0x4792b5[_0xf01a('0x6c')]);if(_[_0xf01a('0x28')](this['channels'][_0x4792b5[_0xf01a('0x22')]][_0x192c50]['variables'])){this[_0xf01a('0x8')][_0x4792b5[_0xf01a('0x22')]][_0x192c50][_0xf01a('0xb')]={};}this[_0xf01a('0x8')][_0x4792b5[_0xf01a('0x22')]][_0x192c50][_0xf01a('0xb')]=this['variables'][_0x4792b5[_0xf01a('0x22')]];}}}}}catch(_0x31c03c){logger[_0xf01a('0x36')](_0xf01a('0x6d'),_0x4792b5[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x31c03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')]['addVariable']=function(_0x48bf26,_0x4d40de,_0x1b81c5){var _0x657d9b=['rtpaudioqos',_0xf01a('0x6e'),_0xf01a('0x6f'),_0xf01a('0x70'),_0xf01a('0x71'),_0xf01a('0x72'),'rtpaudioqosrtt',_0xf01a('0x73'),'sipcallid',_0xf01a('0x74'),_0xf01a('0x75'),_0xf01a('0x76'),'membercalls','memberdynamic','memberinterface',_0xf01a('0x77'),_0xf01a('0x23'),_0xf01a('0x78'),_0xf01a('0x79')];if(!_['isNil'](_0x4d40de)&&!_['includes'](_0x657d9b,_0x4d40de)){if(_[_0xf01a('0x28')](this[_0xf01a('0xb')][_0x48bf26])){this[_0xf01a('0xb')][_0x48bf26]={};}this[_0xf01a('0xb')][_0x48bf26][_0x4d40de]=_0x1b81c5;}};VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0x18')]=function(_0x1b75cc){try{if(this['isNotNull'](_0x1b75cc)){logger[_0xf01a('0x25')]('[%s][voiceAgentReport][hangup]\x20event:',_0x1b75cc[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x1b75cc,{'showHidden':![],'depth':null}));if(this[_0xf01a('0x8')][_0x1b75cc[_0xf01a('0x22')]]){for(var _0x351ceb in this[_0xf01a('0x8')][_0x1b75cc[_0xf01a('0x22')]]){if(this[_0xf01a('0x8')][_0x1b75cc['uniqueid']][_0xf01a('0x5a')](_0x351ceb)){if(this[_0xf01a('0x8')][_0x1b75cc[_0xf01a('0x22')]][_0x351ceb][_0xf01a('0x52')]==_0xf01a('0x5e')&&this[_0xf01a('0x8')][_0x1b75cc[_0xf01a('0x22')]][_0x351ceb][_0xf01a('0x14')]){logger[_0xf01a('0x21')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x1b75cc['uniqueid'],_0x351ceb);this[_0xf01a('0x8')][_0x1b75cc[_0xf01a('0x22')]][_0x351ceb][_0xf01a('0x5c')]=moment()['format'](_0xf01a('0x29'));}}}logger[_0xf01a('0x25')](_0xf01a('0x7a'),_0x1b75cc['uniqueid'],util[_0xf01a('0x27')](_[_0xf01a('0x7b')](this[_0xf01a('0x8')][_0x1b75cc[_0xf01a('0x22')]]),{'showHidden':![],'depth':null}));ami[_0xf01a('0x20')](_0xf01a('0x7c'),_['values'](this['channels'][_0x1b75cc['uniqueid']]));delete this[_0xf01a('0x8')][_0x1b75cc['uniqueid']];}if(this[_0xf01a('0xb')][_0x1b75cc[_0xf01a('0x22')]]){delete this[_0xf01a('0xb')][_0x1b75cc[_0xf01a('0x22')]];}}}catch(_0x911f26){logger[_0xf01a('0x36')](_0xf01a('0x7d'),_0x1b75cc[_0xf01a('0x22')],util['inspect'](_0x911f26,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')][_0xf01a('0x1c')]=function(_0x2ea55b){try{if(this[_0xf01a('0x37')](_0x2ea55b)){logger[_0xf01a('0x25')](_0xf01a('0x7e'),_0x2ea55b[_0xf01a('0x22')],util['inspect'](_0x2ea55b,{'showHidden':![],'depth':null}));if(this['channels'][_0x2ea55b[_0xf01a('0x7f')]]){for(var _0x2203d0 in this[_0xf01a('0x8')][_0x2ea55b[_0xf01a('0x7f')]]){if(this[_0xf01a('0x8')][_0x2ea55b['transfereeuniqueid']][_0xf01a('0x5a')](_0x2203d0)){if(_0x2ea55b['origtransfereruniqueid']===_0x2203d0){logger[_0xf01a('0x21')](_0xf01a('0x80'),_0x2ea55b['uniqueid'],this['channels'][_0x2ea55b[_0xf01a('0x7f')]][_0x2203d0][_0xf01a('0x23')],_0x2203d0);var _0x5c6874=moment();this['channels'][_0x2ea55b[_0xf01a('0x7f')]][_0x2203d0][_0xf01a('0x14')]=!![];this[_0xf01a('0x8')][_0x2ea55b[_0xf01a('0x7f')]][_0x2203d0][_0xf01a('0x5c')]=moment()[_0xf01a('0x33')](_0xf01a('0x29'));this[_0xf01a('0x8')][_0x2ea55b['transfereeuniqueid']][_0x2203d0][_0xf01a('0x40')]=_0xf01a('0x5d');this['channels'][_0x2ea55b[_0xf01a('0x7f')]][_0x2203d0][_0xf01a('0x52')]=_0xf01a('0x5e');this[_0xf01a('0x8')][_0x2ea55b[_0xf01a('0x7f')]][_0x2203d0][_0xf01a('0x60')]=_0x5c6874[_0xf01a('0x81')](this[_0xf01a('0x8')][_0x2ea55b[_0xf01a('0x7f')]][_0x2203d0][_0xf01a('0x3a')],_0xf01a('0x82'));}}}}if(this[_0xf01a('0x8')][_0x2ea55b['secondtransfereruniqueid']]){var _0x96584b=this[_0xf01a('0x8')][_0x2ea55b[_0xf01a('0x83')]];this['channels'][_0x2ea55b['secondtransfereruniqueid']]=this[_0xf01a('0x8')][_0x2ea55b['transfereeuniqueid']];this[_0xf01a('0x8')][_0x2ea55b[_0xf01a('0x7f')]]=_0x96584b;}}}catch(_0x569037){logger[_0xf01a('0x36')](_0xf01a('0x84'),_0x2ea55b[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x569037,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf01a('0x1f')]['syncBlindTransfer']=function(_0x692894){try{if(this[_0xf01a('0x37')](_0x692894)){logger[_0xf01a('0x25')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x692894['uniqueid'],util[_0xf01a('0x27')](_0x692894,{'showHidden':![],'depth':null}));if(this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]]){for(var _0x224c0b in this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]]){if(this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0xf01a('0x5a')](_0x224c0b)){if(_0x692894[_0xf01a('0x85')]===_0x224c0b){logger['info'](_0xf01a('0x86'),_0x692894[_0xf01a('0x22')],this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b][_0xf01a('0x23')],_0x224c0b);var _0x596ff1=moment();this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b]['agentcomplete']=!![];this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b][_0xf01a('0x5c')]=_0x596ff1;this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b][_0xf01a('0x40')]='complete';this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b][_0xf01a('0x52')]=_0xf01a('0x5e');this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b][_0xf01a('0x60')]=_0x596ff1[_0xf01a('0x81')](this[_0xf01a('0x8')][_0x692894[_0xf01a('0x7f')]][_0x224c0b][_0xf01a('0x3a')],'seconds');}}}}}}catch(_0x15aefa){logger[_0xf01a('0x36')](_0xf01a('0x87'),_0x692894[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x15aefa,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf01a('0x19')]=function(_0x53e44d){var _0x36fa3a='';try{if(this[_0xf01a('0x37')](_0x53e44d)){logger[_0xf01a('0x25')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x53e44d[_0xf01a('0x22')],util['inspect'](_0x53e44d,{'showHidden':![],'depth':null}));if(_0x53e44d['channel']){_0x36fa3a=_0x53e44d[_0xf01a('0x88')][_0xf01a('0x89')](0x0,_0x53e44d[_0xf01a('0x88')][_0xf01a('0x8a')]('-'));if(this[_0xf01a('0xa')][_0x36fa3a]){logger[_0xf01a('0x21')](_0xf01a('0x8b'),_0x53e44d[_0xf01a('0x22')],_0x36fa3a);this[_0xf01a('0xa')][_0x36fa3a][_0xf01a('0x8c')]=!![];}}}}catch(_0x2b5f28){logger[_0xf01a('0x36')]('[%s][voiceAgentReport][musiconholdstart]',_0x53e44d[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x2b5f28,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf01a('0x1b')]=function(_0x2825e6){var _0x2bc462='';try{if(this[_0xf01a('0x37')](_0x2825e6)){logger['debug'](_0xf01a('0x8d'),_0x2825e6[_0xf01a('0x22')],util['inspect'](_0x2825e6,{'showHidden':![],'depth':null}));if(_0x2825e6[_0xf01a('0x88')]){_0x2bc462=_0x2825e6[_0xf01a('0x88')][_0xf01a('0x89')](0x0,_0x2825e6[_0xf01a('0x88')][_0xf01a('0x8a')]('-'));if(this['agents'][_0x2bc462]){logger[_0xf01a('0x21')](_0xf01a('0x8e'),_0x2825e6[_0xf01a('0x22')],_0x2bc462);this['agents'][_0x2bc462][_0xf01a('0x8c')]=![];}}}}catch(_0x460185){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x2825e6[_0xf01a('0x22')],util[_0xf01a('0x27')](_0x460185,{'showHidden':![],'depth':null}));}};module[_0xf01a('0x8f')]=VoiceAgentReport;
\ No newline at end of file
+var _0x539c=['moment','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','inspect','channels','format','queue','mandatoryDisposition','type','inbound','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','merge','interface','pick','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','lastevent','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','isNotNull','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','reason','transfer','agent','talktime','acwtime','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','value','variable','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','syncHangup','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x539c,0x1c8));var _0xc539=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x539c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0xc539('0x0'));var util=require(_0xc539('0x1'));var Redis=require(_0xc539('0x2'));var config=require(_0xc539('0x3'));var logger=require('../../../config/logger')('ami');var ami=require(_0xc539('0x4'));config[_0xc539('0x5')]=_[_0xc539('0x6')](config[_0xc539('0x5')],{'host':_0xc539('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc539('0x5')]));function VoiceAgentReport(_0x378fcd){this['channels']={};this['voiceQueues']=_0x378fcd[_0xc539('0x8')];this['agents']=_0x378fcd[_0xc539('0x9')];this[_0xc539('0xa')]={};ami['on'](_0xc539('0xb'),this[_0xc539('0xc')][_0xc539('0xd')](this));ami['on']('agentconnect',this[_0xc539('0xe')][_0xc539('0xd')](this));ami['on']('agentringnoanswer',this[_0xc539('0xf')][_0xc539('0xd')](this));ami['on'](_0xc539('0x10'),this[_0xc539('0x11')]['bind'](this));ami['on'](_0xc539('0x12'),this['syncAgentComplete'][_0xc539('0xd')](this));ami['on'](_0xc539('0x13'),this['syncVarSet'][_0xc539('0xd')](this));ami['on'](_0xc539('0x14'),this['syncHangup']['bind'](this));ami['on'](_0xc539('0x15'),this[_0xc539('0x16')][_0xc539('0xd')](this));ami['on'](_0xc539('0x17'),this['syncMusicOnHoldStop'][_0xc539('0xd')](this));ami['on'](_0xc539('0x18'),this[_0xc539('0x19')][_0xc539('0xd')](this));ami['on'](_0xc539('0x1a'),this[_0xc539('0x1b')][_0xc539('0xd')](this));}VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x1d')]=function(_0x4aa1ae,_0x3ec186,_0x4ddc46){io['to'](_0x4aa1ae)[_0xc539('0x1d')](_0x3ec186,_0x4ddc46);};VoiceAgentReport['prototype']['isNotNull']=function(_0x2bc609){return _0x2bc609!==null&&!_[_0xc539('0x1e')](_0x2bc609);};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0xc')]=function(_0x261174){try{if(this['isNotNull'](_0x261174)){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x261174['uniqueid'],_0x261174[_0xc539('0x20')],_0x261174[_0xc539('0x21')]);logger[_0xc539('0x22')](_0xc539('0x23'),_0x261174[_0xc539('0x24')],util[_0xc539('0x25')](_0x261174,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xc539('0x26')][_0x261174['uniqueid']])){this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]]={};}if(_['isUndefined'](this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]])){this['channels'][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]]={'agentcalledAt':moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':this[_0xc539('0x8')][_0x261174[_0xc539('0x28')]]?this[_0xc539('0x8')][_0x261174[_0xc539('0x28')]][_0xc539('0x29')]||![]:![],'type':this['voiceQueues'][_0x261174[_0xc539('0x28')]]?this[_0xc539('0x8')][_0x261174[_0xc539('0x28')]][_0xc539('0x2a')]||_0xc539('0x2b'):'inbound','variables':this[_0xc539('0xa')][_0x261174[_0xc539('0x24')]]};}_['merge'](this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174['destuniqueid']],_[_0xc539('0x2c')](_0x261174,['event',_0xc539('0x2d')]));logger[_0xc539('0x22')](_0xc539('0x2e'),_0x261174['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]]);logger[_0xc539('0x22')](_0xc539('0x2f'),_0x261174['uniqueid'],util[_0xc539('0x25')](this['channels'][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]],{'showHidden':![],'depth':null}));this[_0xc539('0x1d')](util[_0xc539('0x27')](_0xc539('0x30'),_0x261174['membername']),_0xc539('0x31'),this[_0xc539('0x26')][_0x261174[_0xc539('0x24')]][_0x261174[_0xc539('0x21')]]);}}catch(_0xbcbb19){logger[_0xc539('0x32')](_0xc539('0x33'),_0x261174['uniqueid'],util[_0xc539('0x25')](_0xbcbb19,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc539('0xe')]=function(_0x5e48e7){try{if(this['isNotNull'](_0x5e48e7)){if(this['channels'][_0x5e48e7[_0xc539('0x24')]]){logger['debug'](_0xc539('0x34'),_0x5e48e7['uniqueid'],util[_0xc539('0x25')](_0x5e48e7,{'showHidden':![],'depth':null}));for(var _0x28177b in this[_0xc539('0x26')][_0x5e48e7['uniqueid']]){if(this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0xc539('0x35')](_0x28177b)){if(_0x5e48e7[_0xc539('0x21')]===_0x28177b){logger[_0xc539('0x1f')](_0xc539('0x36'),_0x5e48e7[_0xc539('0x24')],_0x5e48e7[_0xc539('0x20')],_0x5e48e7['destuniqueid']);this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x37')]=moment()[_0xc539('0x27')](_0xc539('0x38'));this['channels'][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x39')]=_0x5e48e7[_0xc539('0x39')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x3a')]=_0x5e48e7[_0xc539('0x3a')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x3b')]=_0x5e48e7[_0xc539('0x3b')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b]['destchannelstatedesc']=_0x5e48e7[_0xc539('0x3c')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x3d')]=_0x5e48e7[_0xc539('0x3d')];this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b]['lastevent']=_0xc539('0x3e');_[_0xc539('0x3f')](this[_0xc539('0x9')][_0x5e48e7[_0xc539('0x40')]],_[_0xc539('0x41')](_0x5e48e7,[_0xc539('0x28'),'destconnectedlinenum']));logger[_0xc539('0x22')](_0xc539('0x42'),_0x5e48e7[_0xc539('0x24')],util['inspect'](this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x5e48e7[_0xc539('0x21')]],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x43'),this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x5e48e7['destuniqueid']]);logger[_0xc539('0x22')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x5e48e7[_0xc539('0x24')],util['inspect'](this['channels'][_0x5e48e7[_0xc539('0x24')]][_0x5e48e7['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xc539('0x1d')](util[_0xc539('0x27')]('user:%s',_0x5e48e7[_0xc539('0x20')]),_0xc539('0x44'),this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x5e48e7['destuniqueid']]);}else if(!this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x45')]&&!this['channels'][_0x5e48e7['uniqueid']][_0x28177b]['agentcomplete']){logger[_0xc539('0x1f')](_0xc539('0x46'),_0x5e48e7[_0xc539('0x24')],this['channels'][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x20')],_0x28177b);this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x45')]=!![];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x47')]=moment()[_0xc539('0x27')](_0xc539('0x38'));this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b][_0xc539('0x48')]=_0x5e48e7[_0xc539('0x21')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b]['answeredelsewheremembername']=_0x5e48e7[_0xc539('0x20')];this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b][_0xc539('0x49')]='answered_elsewhere';this[_0xc539('0x26')][_0x5e48e7[_0xc539('0x24')]][_0x28177b]['reason']=_0xc539('0x4a');logger[_0xc539('0x22')](_0xc539('0x4b'),_0x5e48e7['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x4c'),this[_0xc539('0x26')][_0x5e48e7['uniqueid']][_0x28177b]);}}}}}}catch(_0x4838db){logger[_0xc539('0x32')](_0xc539('0x4d'),_0x5e48e7[_0xc539('0x24')],util['inspect'](_0x4838db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0xf')]=function(_0x332f8b){try{if(this[_0xc539('0x4e')](_0x332f8b)){logger[_0xc539('0x22')](_0xc539('0x4f'),_0x332f8b[_0xc539('0x24')],util['inspect'](_0x332f8b,{'showHidden':![],'depth':null}));if(this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]]&&this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b[_0xc539('0x21')]]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x332f8b['uniqueid'],_0x332f8b[_0xc539('0x20')],_0x332f8b['destuniqueid']);this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']][_0xc539('0x45')]=!![];this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']][_0xc539('0x47')]=moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x332f8b[_0xc539('0x24')]][_0x332f8b[_0xc539('0x21')]][_0xc539('0x49')]=_0xc539('0x50');this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b[_0xc539('0x21')]]['reason']=_0xc539('0x50');logger['debug'](_0xc539('0x51'),_0x332f8b['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x52'),this[_0xc539('0x26')][_0x332f8b[_0xc539('0x24')]][_0x332f8b['destuniqueid']]);}}}catch(_0x587684){logger[_0xc539('0x32')](_0xc539('0x53'),_0x332f8b[_0xc539('0x24')],util[_0xc539('0x25')](_0x587684,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x11')]=function(_0x2cccfd){try{if(this[_0xc539('0x4e')](_0x2cccfd)){logger[_0xc539('0x22')](_0xc539('0x54'),_0x2cccfd[_0xc539('0x24')],util[_0xc539('0x25')](_0x2cccfd,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cccfd[_0xc539('0x24')]]){for(var _0xf1caa1 in this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xc539('0x35')](_0xf1caa1)&&!this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1][_0xc539('0x45')]&&!this['channels'][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1][_0xc539('0x12')]){logger['info']('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2cccfd['uniqueid'],this['channels'][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]['membername'],_0xf1caa1);this['channels'][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1][_0xc539('0x45')]=!![];this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]['agentringnoanswerAt']=moment()['format'](_0xc539('0x38'));this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]['lastevent']=_0xc539('0x55');this['channels'][_0x2cccfd['uniqueid']][_0xf1caa1]['reason']='abandoned';logger[_0xc539('0x22')](_0xc539('0x56'),_0x2cccfd['uniqueid'],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x2cccfd['uniqueid']][_0xf1caa1],{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x57'),this[_0xc539('0x26')][_0x2cccfd[_0xc539('0x24')]][_0xf1caa1]);}}}}}catch(_0x4bc9c9){logger['error'](_0xc539('0x58'),_0x2cccfd[_0xc539('0x24')],util[_0xc539('0x25')](_0x4bc9c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x59')]=function(_0x3816cd){try{if(this[_0xc539('0x4e')](_0x3816cd)){logger[_0xc539('0x22')](_0xc539('0x5a'),_0x3816cd[_0xc539('0x24')],util[_0xc539('0x25')](_0x3816cd,{'showHidden':![],'depth':null}));if(this['channels'][_0x3816cd[_0xc539('0x24')]]){for(var _0x41673b in this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0xc539('0x35')](_0x41673b)){if(this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x37')]&&!this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x12')]){logger[_0xc539('0x1f')](_0xc539('0x5b'),_0x3816cd[_0xc539('0x24')],this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x20')],_0x41673b);this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x12')]=!![];this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x5c')]=moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3816cd['uniqueid']][_0x41673b][_0xc539('0x49')]=_0xc539('0x5d');this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x5e')]=_0x3816cd[_0xc539('0x5e')]==_0xc539('0x5f')?_0xc539('0x60'):_0x3816cd[_0xc539('0x5e')];this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x61')]=_0x3816cd[_0xc539('0x61')];if(this[_0xc539('0x8')][_0x3816cd[_0xc539('0x28')]]&&this[_0xc539('0x8')][_0x3816cd['queue']]['acw']){this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x62')]=this[_0xc539('0x8')][_0x3816cd[_0xc539('0x28')]][_0xc539('0x63')];this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b][_0xc539('0x64')]=!![];}this[_0xc539('0x9')][_0x3816cd[_0xc539('0x40')]]=_[_0xc539('0x2c')](this['agents'][_0x3816cd['interface']],[_0xc539('0x28'),_0xc539('0x65')]);logger['debug'](_0xc539('0x66'),_0x3816cd[_0xc539('0x24')],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x3816cd['uniqueid']][_0x41673b],{'showHidden':![],'depth':null}));ami['emit'](_0xc539('0x67'),this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b]);logger[_0xc539('0x22')](_0xc539('0x68'),_0x3816cd[_0xc539('0x24')],util[_0xc539('0x25')](this[_0xc539('0x26')][_0x3816cd[_0xc539('0x24')]][_0x41673b],{'showHidden':![],'depth':null}));this[_0xc539('0x1d')](util[_0xc539('0x27')](_0xc539('0x30'),_0x3816cd['membername']),_0xc539('0x69'),this[_0xc539('0x26')][_0x3816cd['uniqueid']][_0x41673b]);}}}}}}catch(_0x4e402e){logger[_0xc539('0x32')]('[%s][voiceAgentReport][agentcomplete]',_0x3816cd['uniqueid'],util[_0xc539('0x25')](_0x4e402e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x6a')]=function(_0x10302e){try{if(this[_0xc539('0x4e')](_0x10302e)){logger[_0xc539('0x22')](_0xc539('0x6b'),_0x10302e[_0xc539('0x24')],util[_0xc539('0x25')](_0x10302e,{'showHidden':![],'depth':null}));this[_0xc539('0x6c')](_0x10302e['uniqueid'],_[_0xc539('0x6d')](_0x10302e['variable'])[0x0],_0x10302e[_0xc539('0x6e')]);if(this[_0xc539('0x26')][_0x10302e[_0xc539('0x24')]]){for(var _0x3f508a in this[_0xc539('0x26')][_0x10302e[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x10302e['uniqueid']]['hasOwnProperty'](_0x3f508a)){logger['info']('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x10302e[_0xc539('0x24')],_0x3f508a,_[_0xc539('0x6d')](_0x10302e[_0xc539('0x6f')])[0x0],_0x10302e[_0xc539('0x6e')]);if(_[_0xc539('0x1e')](this['channels'][_0x10302e[_0xc539('0x24')]][_0x3f508a][_0xc539('0xa')])){this[_0xc539('0x26')][_0x10302e[_0xc539('0x24')]][_0x3f508a][_0xc539('0xa')]={};}this[_0xc539('0x26')][_0x10302e['uniqueid']][_0x3f508a]['variables']=this['variables'][_0x10302e[_0xc539('0x24')]];}}}}}catch(_0x48dc57){logger[_0xc539('0x32')](_0xc539('0x70'),_0x10302e[_0xc539('0x24')],util[_0xc539('0x25')](_0x48dc57,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x6c')]=function(_0x32f4ba,_0x1b15ba,_0x199dba){var _0x4b60a7=[_0xc539('0x71'),_0xc539('0x72'),_0xc539('0x73'),'rtpaudioqosjitterbridged',_0xc539('0x74'),_0xc539('0x75'),_0xc539('0x76'),'rtpaudioqosrttbridged',_0xc539('0x77'),'sipuri',_0xc539('0x78'),_0xc539('0x79'),'membercalls',_0xc539('0x7a'),_0xc539('0x7b'),'memberlastcall',_0xc539('0x20'),_0xc539('0x7c'),_0xc539('0x7d')];if(!_[_0xc539('0x7e')](_0x1b15ba)&&!_['includes'](_0x4b60a7,_0x1b15ba)){if(_['isUndefined'](this[_0xc539('0xa')][_0x32f4ba])){this[_0xc539('0xa')][_0x32f4ba]={};}this['variables'][_0x32f4ba][_0x1b15ba]=_0x199dba;}};VoiceAgentReport['prototype'][_0xc539('0x7f')]=function(_0x26d225){try{if(this[_0xc539('0x4e')](_0x26d225)){logger[_0xc539('0x22')](_0xc539('0x80'),_0x26d225[_0xc539('0x24')],util['inspect'](_0x26d225,{'showHidden':![],'depth':null}));if(this[_0xc539('0x26')][_0x26d225['uniqueid']]){for(var _0x2c649e in this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]]){if(this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]][_0xc539('0x35')](_0x2c649e)){if(this[_0xc539('0x26')][_0x26d225['uniqueid']][_0x2c649e][_0xc539('0x5e')]==_0xc539('0x5f')&&this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]][_0x2c649e][_0xc539('0x12')]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x26d225[_0xc539('0x24')],_0x2c649e);this['channels'][_0x26d225[_0xc539('0x24')]][_0x2c649e][_0xc539('0x5c')]=moment()[_0xc539('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0xc539('0x81'),_0x26d225[_0xc539('0x24')],util[_0xc539('0x25')](_[_0xc539('0x82')](this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]]),{'showHidden':![],'depth':null}));ami[_0xc539('0x1d')](_0xc539('0x83'),_['values'](this[_0xc539('0x26')][_0x26d225[_0xc539('0x24')]]));delete this['channels'][_0x26d225[_0xc539('0x24')]];}if(this[_0xc539('0xa')][_0x26d225[_0xc539('0x24')]]){delete this[_0xc539('0xa')][_0x26d225[_0xc539('0x24')]];}}}catch(_0x5eaa91){logger[_0xc539('0x32')](_0xc539('0x84'),_0x26d225['uniqueid'],util['inspect'](_0x5eaa91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc539('0x19')]=function(_0xacc7ce){try{if(this[_0xc539('0x4e')](_0xacc7ce)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xacc7ce['uniqueid'],util[_0xc539('0x25')](_0xacc7ce,{'showHidden':![],'depth':null}));if(this['channels'][_0xacc7ce[_0xc539('0x85')]]){for(var _0x13ec7d in this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]]){if(this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0xc539('0x35')](_0x13ec7d)){if(_0xacc7ce[_0xc539('0x86')]===_0x13ec7d){logger['info'](_0xc539('0x87'),_0xacc7ce[_0xc539('0x24')],this[_0xc539('0x26')][_0xacc7ce['transfereeuniqueid']][_0x13ec7d][_0xc539('0x20')],_0x13ec7d);var _0x4ec6e2=moment();this['channels'][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d]['agentcomplete']=!![];this[_0xc539('0x26')][_0xacc7ce['transfereeuniqueid']][_0x13ec7d][_0xc539('0x5c')]=moment()['format'](_0xc539('0x38'));this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d][_0xc539('0x49')]='complete';this[_0xc539('0x26')][_0xacc7ce['transfereeuniqueid']][_0x13ec7d][_0xc539('0x5e')]=_0xc539('0x5f');this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d][_0xc539('0x61')]=_0x4ec6e2[_0xc539('0x88')](this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x85')]][_0x13ec7d][_0xc539('0x37')],'seconds');}}}}if(this['channels'][_0xacc7ce[_0xc539('0x89')]]){var _0x5e1881=this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x89')]];this[_0xc539('0x26')][_0xacc7ce[_0xc539('0x89')]]=this['channels'][_0xacc7ce[_0xc539('0x85')]];this['channels'][_0xacc7ce['transfereeuniqueid']]=_0x5e1881;}}}catch(_0x4730c0){logger['error'](_0xc539('0x8a'),_0xacc7ce[_0xc539('0x24')],util['inspect'](_0x4730c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x1b')]=function(_0x3300b6){try{if(this['isNotNull'](_0x3300b6)){logger[_0xc539('0x22')](_0xc539('0x8b'),_0x3300b6[_0xc539('0x24')],util[_0xc539('0x25')](_0x3300b6,{'showHidden':![],'depth':null}));if(this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]]){for(var _0x27ffc5 in this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]]){if(this['channels'][_0x3300b6[_0xc539('0x85')]][_0xc539('0x35')](_0x27ffc5)){if(_0x3300b6[_0xc539('0x8c')]===_0x27ffc5){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3300b6[_0xc539('0x24')],this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x20')],_0x27ffc5);var _0x7f4c98=moment();this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x12')]=!![];this['channels'][_0x3300b6['transfereeuniqueid']][_0x27ffc5][_0xc539('0x5c')]=_0x7f4c98;this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5]['lastevent']='complete';this['channels'][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x5e')]=_0xc539('0x5f');this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5][_0xc539('0x61')]=_0x7f4c98[_0xc539('0x88')](this[_0xc539('0x26')][_0x3300b6[_0xc539('0x85')]][_0x27ffc5]['agentconnectAt'],'seconds');}}}}}}catch(_0x549e54){logger[_0xc539('0x32')](_0xc539('0x8d'),_0x3300b6[_0xc539('0x24')],util[_0xc539('0x25')](_0x549e54,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x16')]=function(_0x2ee58b){var _0x4a9e51='';try{if(this[_0xc539('0x4e')](_0x2ee58b)){logger[_0xc539('0x22')](_0xc539('0x8e'),_0x2ee58b[_0xc539('0x24')],util[_0xc539('0x25')](_0x2ee58b,{'showHidden':![],'depth':null}));if(_0x2ee58b[_0xc539('0x8f')]){_0x4a9e51=_0x2ee58b[_0xc539('0x8f')]['substring'](0x0,_0x2ee58b['channel'][_0xc539('0x90')]('-'));if(this[_0xc539('0x9')][_0x4a9e51]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x2ee58b['uniqueid'],_0x4a9e51);this[_0xc539('0x9')][_0x4a9e51][_0xc539('0x91')]=!![];}}}}catch(_0x45a329){logger[_0xc539('0x32')](_0xc539('0x92'),_0x2ee58b[_0xc539('0x24')],util[_0xc539('0x25')](_0x45a329,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc539('0x1c')][_0xc539('0x93')]=function(_0x470162){var _0x41e836='';try{if(this[_0xc539('0x4e')](_0x470162)){logger[_0xc539('0x22')](_0xc539('0x94'),_0x470162[_0xc539('0x24')],util[_0xc539('0x25')](_0x470162,{'showHidden':![],'depth':null}));if(_0x470162[_0xc539('0x8f')]){_0x41e836=_0x470162[_0xc539('0x8f')][_0xc539('0x95')](0x0,_0x470162[_0xc539('0x8f')][_0xc539('0x90')]('-'));if(this[_0xc539('0x9')][_0x41e836]){logger[_0xc539('0x1f')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x470162[_0xc539('0x24')],_0x41e836);this[_0xc539('0x9')][_0x41e836][_0xc539('0x91')]=![];}}}}catch(_0x8cdaae){logger['error'](_0xc539('0x96'),_0x470162[_0xc539('0x24')],util[_0xc539('0x25')](_0x8cdaae,{'showHidden':![],'depth':null}));}};module[_0xc539('0x97')]=VoiceAgentReport;
\ No newline at end of file
index 77ddc1d..6bf7f31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['[%s][voiceCallReport][attendedtransfer]','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%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','invalid','ringing','set','queue','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','agents','blindTransfers','coreshowchannel','syncNewExten','newchannel','syncNewChannel','newstate','bind','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','error','[voiceCallReport][coreshowchannels]','inspect','prototype','syncNewCallerId','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','channels','merge','pick','[%s][voiceCallReport][newcallerid]','debug','channel','OutgoingSpoolFailed','context','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','keys','from-sip','split','exten','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','emit','user:%s','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','starttime','duration','subtract','seconds','lastdata','startsWith','cdr(','match','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','answered','answertime','format','holdtime','diff','calleridnum','connectedlinenum','destinationchannel','UserId','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','cause-txt','omit','destconnectedlinenum','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED'];(function(_0x1c1509,_0x2dfa81){var _0xf11b7=function(_0x17949e){while(--_0x17949e){_0x1c1509['push'](_0x1c1509['shift']());}};_0xf11b7(++_0x2dfa81);}(_0x008c,0x188));var _0xc008=function(_0x1a1ec7,_0x2c9cc1){_0x1a1ec7=_0x1a1ec7-0x0;var _0x55650a=_0x008c[_0x1a1ec7];return _0x55650a;};'use strict';var BPromise=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var util=require(_0xc008('0x3'));var path=require(_0xc008('0x4'));var Redis=require('ioredis');var config=require(_0xc008('0x5'));var logger=require(_0xc008('0x6'))(_0xc008('0x7'));var ami=require(_0xc008('0x8'));var Channel=require(_0xc008('0x9'));var RpcSetting=require(_0xc008('0xa'));var statusDesc=[_0xc008('0xb'),_0xc008('0xc'),_0xc008('0xd'),'busy',_0xc008('0xe'),'unavailable',_0xc008('0xf'),'ringinuse','onhold'];var applications=[_0xc008('0x10'),_0xc008('0x11'),'agi','dial','playback',_0xc008('0x12')];var dispositions=[_0xc008('0x13'),'FAILED',_0xc008('0x14'),_0xc008('0x13'),_0xc008('0x13'),_0xc008('0x13'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x14'),'FAILED','FAILED'];var actions={};config[_0xc008('0x17')]=_['defaults'](config[_0xc008('0x17')],{'host':_0xc008('0x18'),'port':0x18eb});var io=require(_0xc008('0x19'))(new Redis(config[_0xc008('0x17')]));function VoiceCallReport(_0x3f0ecf){this['channels']=_0x3f0ecf['channels'];this['agents']=_0x3f0ecf[_0xc008('0x1a')];this[_0xc008('0x1b')]={};ami['on'](_0xc008('0x1c'),this[_0xc008('0x1d')]['bind'](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0xc008('0x1e'),this[_0xc008('0x1f')]['bind'](this));ami['on'](_0xc008('0x20'),this['syncNewState']['bind'](this));ami['on']('varset',this['syncVarSet'][_0xc008('0x21')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('newcallerid',this['syncNewCallerId'][_0xc008('0x21')](this));ami['on'](_0xc008('0x22'),this[_0xc008('0x23')][_0xc008('0x21')](this));ami['on'](_0xc008('0x24'),this[_0xc008('0x25')]['bind'](this));ami['on'](_0xc008('0x26'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xc008('0x27'),this[_0xc008('0x28')][_0xc008('0x21')](this));try{logger[_0xc008('0x29')]('[voiceCallReport][coreshowchannels]\x20started');ami['actionCoreShowChannels']();}catch(_0x5de1e9){logger[_0xc008('0x2a')](_0xc008('0x2b'),util[_0xc008('0x2c')](_0x5de1e9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc008('0x2d')]['isNotNull']=function(_0x5e2aca){return _0x5e2aca!==null&&!_['isUndefined'](_0x5e2aca);};VoiceCallReport['prototype']['emit']=function(_0x3865c0,_0x29ba43,_0x25eae4){io['to'](_0x3865c0)['emit'](_0x29ba43,_0x25eae4);};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x2e')]=function(_0x209591){try{if(this[_0xc008('0x2f')](_0x209591)){logger['info'](_0xc008('0x30'),_0x209591[_0xc008('0x31')],_0x209591['calleridname'],_0x209591['calleridnum']);logger['debug'](_0xc008('0x32'),_0x209591[_0xc008('0x31')],util[_0xc008('0x2c')](_0x209591,{'showHidden':![],'depth':null}));if(_0x209591[_0xc008('0x31')]===_0x209591[_0xc008('0x33')]){if(!_[_0xc008('0x34')](this[_0xc008('0x35')][_0x209591[_0xc008('0x31')]])){_[_0xc008('0x36')](this[_0xc008('0x35')][_0x209591[_0xc008('0x31')]],_[_0xc008('0x37')](_0x209591,_['keys'](this[_0xc008('0x35')][_0x209591[_0xc008('0x31')]])));}}}}catch(_0x499754){logger[_0xc008('0x2a')](_0xc008('0x38'),_0x209591[_0xc008('0x31')],util[_0xc008('0x2c')](_0x499754,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x1f')]=function(_0x7cfbc5){try{if(this[_0xc008('0x2f')](_0x7cfbc5)){logger[_0xc008('0x39')]('[%s][voiceCallReport][newchannel]\x20event:',_0x7cfbc5[_0xc008('0x31')],util[_0xc008('0x2c')](_0x7cfbc5,{'showHidden':![],'depth':null}));if(_0x7cfbc5[_0xc008('0x31')]===_0x7cfbc5[_0xc008('0x33')]&&_0x7cfbc5[_0xc008('0x3a')]!=_0xc008('0x3b')){if(_[_0xc008('0x34')](this['channels'][_0x7cfbc5[_0xc008('0x31')]])){logger[_0xc008('0x29')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x7cfbc5[_0xc008('0x31')],_0x7cfbc5[_0xc008('0x3c')],_0x7cfbc5['exten']);this[_0xc008('0x35')][_0x7cfbc5[_0xc008('0x31')]]=new Channel();this[_0xc008('0x35')][_0x7cfbc5['uniqueid']]['starttime']=moment()['format'](_0xc008('0x3d'));this['channels'][_0x7cfbc5[_0xc008('0x31')]][_0xc008('0x3e')]=dispositions[_[_0xc008('0x3f')](_0x7cfbc5[_0xc008('0x40')])];_[_0xc008('0x36')](this[_0xc008('0x35')][_0x7cfbc5[_0xc008('0x31')]],_[_0xc008('0x37')](_0x7cfbc5,_[_0xc008('0x41')](this[_0xc008('0x35')][_0x7cfbc5[_0xc008('0x31')]])));if(_0x7cfbc5[_0xc008('0x3c')]===_0xc008('0x42')){if(this[_0xc008('0x1a')][_0x7cfbc5['channel'][_0xc008('0x43')]('-')[0x0]]){this[_0xc008('0x1a')][_0x7cfbc5[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x7cfbc5[_0xc008('0x44')];logger[_0xc008('0x39')](_0xc008('0x45'),_0x7cfbc5[_0xc008('0x31')],util[_0xc008('0x2c')]({'destaccountcode':this['agents'][_0x7cfbc5[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]][_0xc008('0x46')],'destconnectedlinenum':_0x7cfbc5[_0xc008('0x44')]},{'showHidden':![],'depth':null}));this[_0xc008('0x47')](util['format'](_0xc008('0x48'),this[_0xc008('0x1a')][_0x7cfbc5[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]]['name']),_0xc008('0x49'),{'destaccountcode':this[_0xc008('0x1a')][_0x7cfbc5[_0xc008('0x3a')]['split']('-')[0x0]][_0xc008('0x46')],'destconnectedlinenum':_0x7cfbc5['exten']});}}}}}}catch(_0x3dd097){logger['error'](_0xc008('0x4a'),_0x7cfbc5[_0xc008('0x31')],util['inspect'](_0x3dd097,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x1d')]=function(_0x6d6d4c){try{if(this['isNotNull'](_0x6d6d4c)){logger[_0xc008('0x39')](_0xc008('0x4b'),_0x6d6d4c[_0xc008('0x31')],util[_0xc008('0x2c')](_0x6d6d4c,{'showHidden':![],'depth':null}));if(_0x6d6d4c[_0xc008('0x31')]===_0x6d6d4c[_0xc008('0x33')]&&_0x6d6d4c['exten']!='h'&&_0x6d6d4c['channel']!='OutgoingSpoolFailed'){_0x6d6d4c[_0xc008('0x4c')]=_0x6d6d4c[_0xc008('0x4c')][_0xc008('0x4d')]();_0x6d6d4c[_0xc008('0x4e')]=(_0x6d6d4c[_0xc008('0x4f')]||_0x6d6d4c[_0xc008('0x4e')])[_0xc008('0x4d')]();logger[_0xc008('0x29')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x6d6d4c['uniqueid'],_0x6d6d4c['application'],_0x6d6d4c[_0xc008('0x4e')]);if(_[_0xc008('0x34')](this[_0xc008('0x35')][_0x6d6d4c['uniqueid']])){this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]]=new Channel();this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]][_0xc008('0x50')]=_0x6d6d4c[_0xc008('0x51')]?moment()[_0xc008('0x52')](moment[_0xc008('0x51')](_0x6d6d4c[_0xc008('0x51')])[_0xc008('0x53')](),'seconds')['format'](_0xc008('0x3d')):moment()['format'](_0xc008('0x3d'));this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]]['disposition']=_0xc008('0x13');}_[_0xc008('0x36')](this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]],_[_0xc008('0x37')](_0x6d6d4c,_['keys'](this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]])));if(_['includes'](applications,_0x6d6d4c[_0xc008('0x4c')])){this[_0xc008('0x35')][_0x6d6d4c['uniqueid']]['lastapplication']=_0x6d6d4c[_0xc008('0x4c')];this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]][_0xc008('0x54')]=_0x6d6d4c[_0xc008('0x4e')];if(_0x6d6d4c['application']==='set'&&_[_0xc008('0x55')](_0x6d6d4c['applicationdata'],_0xc008('0x56'))){var _0x25d351=_0x6d6d4c[_0xc008('0x4e')][_0xc008('0x43')]('=');var _0x44f42d=_0x25d351[0x0][_0xc008('0x57')](/cdr\((.*)\)/);if(_0x44f42d){this['channels'][_0x6d6d4c[_0xc008('0x31')]][_0x44f42d[0x1]]=_0x25d351[0x1];}}else if(_0x6d6d4c[_0xc008('0x4c')]===_0xc008('0x11')){this[_0xc008('0x35')][_0x6d6d4c[_0xc008('0x31')]]['queue']=_0x6d6d4c[_0xc008('0x4e')]['split'](',')[0x0];}}}}}catch(_0x535e6e){logger['error'](_0xc008('0x58'),_0x6d6d4c[_0xc008('0x31')],util[_0xc008('0x2c')](_0x535e6e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc008('0x59')]=function(_0x2d8361){try{if(this[_0xc008('0x2f')](_0x2d8361)){logger['info'](_0xc008('0x5a'),_0x2d8361[_0xc008('0x31')],_0x2d8361[_0xc008('0x33')],_0x2d8361[_0xc008('0x5b')],_0x2d8361['calleridnum']);logger[_0xc008('0x39')]('[%s][voiceCallReport][newstate]\x20event:',_0x2d8361[_0xc008('0x31')],util[_0xc008('0x2c')](_0x2d8361,{'showHidden':![],'depth':null}));if(_0x2d8361[_0xc008('0x31')]!==_0x2d8361[_0xc008('0x33')]){if(this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]]){if(_0x2d8361['channelstate']==='6'){if(!this[_0xc008('0x35')][_0x2d8361['linkedid']]['answered']){var _0x37ce5e=moment();this[_0xc008('0x35')][_0x2d8361['linkedid']][_0xc008('0x5c')]=!![];this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x5d')]=_0x37ce5e[_0xc008('0x5e')](_0xc008('0x3d'));if(this[_0xc008('0x35')][_0x2d8361['linkedid']][_0xc008('0x50')]){this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x5f')]=_0x37ce5e[_0xc008('0x60')](this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x50')],_0xc008('0x53'));}}this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x33')]=_0x2d8361[_0xc008('0x31')];if(_0x2d8361[_0xc008('0x61')]!=='xcally-motion-preview'){this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x62')]=_0x2d8361['calleridnum'];}this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]]['connectedlinename']=_0x2d8361['calleridname'];this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x63')]=_0x2d8361[_0xc008('0x3a')];this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x3e')]=dispositions[_[_0xc008('0x3f')](_0x2d8361[_0xc008('0x40')])];if(this[_0xc008('0x1a')][_0x2d8361[_0xc008('0x3a')]['split']('-')[0x0]]){this[_0xc008('0x35')][_0x2d8361[_0xc008('0x33')]][_0xc008('0x64')]=this[_0xc008('0x1a')][_0x2d8361['channel'][_0xc008('0x43')]('-')[0x0]]['id'];this['channels'][_0x2d8361[_0xc008('0x33')]][_0xc008('0x65')]=this[_0xc008('0x1a')][_0x2d8361['channel'][_0xc008('0x43')]('-')[0x0]][_0xc008('0x66')];}}}}else{if(this[_0xc008('0x35')][_0x2d8361['uniqueid']]){if(_0x2d8361[_0xc008('0x40')]==='6'){if(this['agents'][_0x2d8361[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]]){this[_0xc008('0x35')][_0x2d8361[_0xc008('0x31')]][_0xc008('0x64')]=this['agents'][_0x2d8361[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]]['id'];this['channels'][_0x2d8361[_0xc008('0x31')]]['membername']=this[_0xc008('0x1a')][_0x2d8361['channel'][_0xc008('0x43')]('-')[0x0]]['name'];}}}}}}catch(_0x217791){logger[_0xc008('0x2a')](_0xc008('0x67'),_0x2d8361[_0xc008('0x31')],util['inspect'](_0x217791,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x68')]=function(_0xb24eec,_0x1d49db){try{if(this[_0xc008('0x35')][_0xb24eec]){logger[_0xc008('0x29')](_0xc008('0x69'),_0xb24eec,_0x1d49db);this[_0xc008('0x35')][_0xb24eec]['monitor']=!![];if(_[_0xc008('0x6a')](_0x1d49db,'.wav49')){_0x1d49db=_0x1d49db['replace']('.wav49',_0xc008('0x6b'));}this[_0xc008('0x35')][_0xb24eec][_0xc008('0x6c')]=_0x1d49db;var _0x233a85=_[_0xc008('0x6d')](this[_0xc008('0x35')][_0xb24eec][_0xc008('0x6e')],{'filename':_0x1d49db});if(_[_0xc008('0x6f')](_0x233a85)){this[_0xc008('0x35')][_0xb24eec]['monitors'][_0xc008('0x70')]({'filename':_0x1d49db,'createdAt':moment()[_0xc008('0x5e')](_0xc008('0x3d')),'mixmonitorid':'','status':_0xc008('0x71')});}}}catch(_0xc9f3f4){logger[_0xc008('0x2a')](_0xc008('0x72'),_0xb24eec,util[_0xc008('0x2c')](_0xc9f3f4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x73')]=function(_0x334ed8){try{if(this[_0xc008('0x2f')](_0x334ed8)){logger['debug']('[%s][voiceCallReport][varset]\x20event:',_0x334ed8[_0xc008('0x31')],util[_0xc008('0x2c')](_0x334ed8,{'showHidden':![],'depth':null}));if(this[_0xc008('0x35')][_0x334ed8['uniqueid']]&&_0x334ed8[_0xc008('0x3a')]!=_0xc008('0x3b')){if(this['isNotNull'](_0x334ed8['variable'])){if(this['isNotNull'](_0x334ed8[_0xc008('0x74')][_0xc008('0x75')])){logger[_0xc008('0x29')](_0xc008('0x76'),_0x334ed8[_0xc008('0x31')],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x68')](_0x334ed8[_0xc008('0x31')],_0x334ed8[_0xc008('0x77')]);}else if(this[_0xc008('0x2f')](_0x334ed8['variable']['xmd-phone'])){logger[_0xc008('0x29')](_0xc008('0x78'),_0x334ed8[_0xc008('0x31')],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x35')][_0x334ed8[_0xc008('0x31')]]['calleridnum']=_0x334ed8['value'];}else if(this[_0xc008('0x2f')](_0x334ed8[_0xc008('0x74')][_0xc008('0x79')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x334ed8['uniqueid'],_0x334ed8['value']);this['channels'][_0x334ed8['uniqueid']][_0xc008('0x7a')]=_0x334ed8['value'];}else if(this[_0xc008('0x2f')](_0x334ed8['variable'][_0xc008('0x7b')])){logger[_0xc008('0x29')](_0xc008('0x7c'),_0x334ed8['uniqueid'],_0x334ed8['value']);this[_0xc008('0x35')][_0x334ed8['uniqueid']][_0xc008('0x7d')]=_0x334ed8[_0xc008('0x77')];}else if(this['isNotNull'](_0x334ed8[_0xc008('0x74')]['xmd-queue'])){logger['info'](_0xc008('0x7e'),_0x334ed8[_0xc008('0x31')],_0x334ed8['value'][_0xc008('0x43')](',')[0x0]);this[_0xc008('0x35')][_0x334ed8[_0xc008('0x31')]]['queue']=_0x334ed8[_0xc008('0x77')][_0xc008('0x43')](',')[0x0];}else if(this[_0xc008('0x2f')](_0x334ed8[_0xc008('0x74')][_0xc008('0x7f')])){logger[_0xc008('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x334ed8[_0xc008('0x31')],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x35')][_0x334ed8['uniqueid']][_0xc008('0x80')]=_0x334ed8[_0xc008('0x77')];}else if(this[_0xc008('0x2f')](_0x334ed8['variable']['xmd-destination'])){logger['info'](_0xc008('0x81'),_0x334ed8[_0xc008('0x31')],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x35')][_0x334ed8[_0xc008('0x31')]][_0xc008('0x82')]=_0x334ed8[_0xc008('0x77')];}else if(this[_0xc008('0x2f')](_0x334ed8['variable'][_0xc008('0x83')])){logger[_0xc008('0x29')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x334ed8['uniqueid'],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x35')][_0x334ed8[_0xc008('0x31')]][_0xc008('0x84')]=_0x334ed8[_0xc008('0x77')];}else if(this['isNotNull'](_0x334ed8[_0xc008('0x74')][_0xc008('0x85')])){logger['info'](_0xc008('0x86'),_0x334ed8[_0xc008('0x31')],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x35')][_0x334ed8['uniqueid']][_0xc008('0x11')]=_0x334ed8[_0xc008('0x77')];}else if(this[_0xc008('0x2f')](_0x334ed8[_0xc008('0x74')]['sipcallid'])){logger[_0xc008('0x29')](_0xc008('0x87'),_0x334ed8['uniqueid'],_0x334ed8['value']);this[_0xc008('0x35')][_0x334ed8['uniqueid']][_0xc008('0x88')]=_0x334ed8[_0xc008('0x77')];}}}else if(this['isNotNull'](_0x334ed8[_0xc008('0x74')][_0xc008('0x75')])){if(_0x334ed8[_0xc008('0x77')]){var _0xbe42a2=path[_0xc008('0x89')](_0x334ed8[_0xc008('0x77')])[_0xc008('0x66')];logger[_0xc008('0x29')](_0xc008('0x76'),_0xbe42a2,_0x334ed8[_0xc008('0x77')]);this['syncMixMonitorFilename'](_0xbe42a2,_0x334ed8['value']);}}else if(this[_0xc008('0x35')][_0x334ed8[_0xc008('0x33')]]){if(this['isNotNull'](_0x334ed8[_0xc008('0x74')])){if(this[_0xc008('0x2f')](_0x334ed8[_0xc008('0x74')]['sipcallid'])){logger[_0xc008('0x29')](_0xc008('0x87'),_0x334ed8[_0xc008('0x33')],_0x334ed8[_0xc008('0x77')]);this[_0xc008('0x35')][_0x334ed8[_0xc008('0x33')]][_0xc008('0x8a')]=_0x334ed8['value'];}}}}}catch(_0x1530d6){logger['error'](_0xc008('0x8b'),_0x334ed8[_0xc008('0x31')],util[_0xc008('0x2c')](_0x1530d6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc008('0x8c')]=function(_0x158d9f){try{if(this[_0xc008('0x2f')](_0x158d9f)){logger[_0xc008('0x39')](_0xc008('0x8d'),_0x158d9f[_0xc008('0x31')],util[_0xc008('0x2c')](_0x158d9f,{'showHidden':![],'depth':null}));if(this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]){logger[_0xc008('0x29')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x158d9f[_0xc008('0x31')],_0x158d9f[_0xc008('0x8e')]);var _0x15dca4=moment();this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]['endtime']=_0x15dca4[_0xc008('0x5e')](_0xc008('0x3d'));this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]][_0xc008('0x51')]=_0x15dca4[_0xc008('0x60')](this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]][_0xc008('0x50')],_0xc008('0x53'));if(this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]][_0xc008('0x5c')]){this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]['billableseconds']=_0x15dca4['diff'](this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]][_0xc008('0x5d')],_0xc008('0x53'));this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]][_0xc008('0x5f')]=this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]['duration']-this[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]['billableseconds'];}if(_0x158d9f[_0xc008('0x3c')]===_0xc008('0x42')){if(this[_0xc008('0x1a')][_0x158d9f[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]]){this[_0xc008('0x1a')][_0x158d9f['channel'][_0xc008('0x43')]('-')[0x0]]=_[_0xc008('0x8f')](this[_0xc008('0x1a')][_0x158d9f[_0xc008('0x3a')]['split']('-')[0x0]],[_0xc008('0x90')]);logger['debug'](_0xc008('0x91'),_0x158d9f[_0xc008('0x31')],util['inspect']({'destaccountcode':this[_0xc008('0x1a')][_0x158d9f['channel'][_0xc008('0x43')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xc008('0x48'),this[_0xc008('0x1a')][_0x158d9f['channel'][_0xc008('0x43')]('-')[0x0]][_0xc008('0x66')]),'user:agentcomplete',{'destaccountcode':this[_0xc008('0x1a')][_0x158d9f[_0xc008('0x3a')][_0xc008('0x43')]('-')[0x0]]['accountcode']});}}var _0x33cad3=this;Promise[_0xc008('0x92')]()[_0xc008('0x93')](function(){var _0x10b34d=_0x33cad3[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]];if(typeof _0x10b34d[_0xc008('0x94')]===_0xc008('0x95'))return;if(_[_0xc008('0x96')](_0x10b34d[_0xc008('0x6e')]))return;return RpcSetting[_0xc008('0x97')]()['then'](function(_0x35c753){if(!_0x35c753[_0xc008('0x98')])return;return Promise[_0xc008('0x92')]()['then'](function(){return ami[_0xc008('0x99')]({'action':_0xc008('0x9a'),'channel':_0x10b34d[_0xc008('0x3a')]})['catch'](function(){});})[_0xc008('0x93')](function(){return ami['Action']({'action':_0xc008('0x9a'),'channel':_0x10b34d[_0xc008('0x63')]})[_0xc008('0x9b')](function(){})['finally'](function(){var _0x18c12=_0x33cad3[_0xc008('0x1a')][_0x10b34d[_0xc008('0x63')][_0xc008('0x43')]('-')[0x0]];if(!_0x18c12)return;io[_0xc008('0x47')](_0xc008('0x9c'),{'agentId':_0x18c12['id'],'uniqueid':_0x10b34d[_0xc008('0x31')]});});});});})['then'](function(){if(_0x158d9f[_0xc008('0x9d')]===_0xc008('0x9e')){_0x33cad3[_0xc008('0x1b')][_0x158d9f[_0xc008('0x31')]]=_0x33cad3['channels'][_0x158d9f[_0xc008('0x31')]];}else{if(_0x33cad3['channels'][_0x158d9f[_0xc008('0x31')]][_0xc008('0x7d')]===_0xc008('0x9f')&&_0x33cad3[_0xc008('0x1b')][_0x158d9f[_0xc008('0x31')]]){_0x33cad3[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]['uniqueid']=[_0x33cad3[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]][_0xc008('0x33')],_0x33cad3[_0xc008('0x35')][_0x158d9f['uniqueid']][_0xc008('0x33')]=_0x33cad3['channels'][_0x158d9f[_0xc008('0x31')]][_0xc008('0x31')]][0x0];delete _0x33cad3[_0xc008('0x1b')][_0x158d9f['uniqueid']];}}logger['debug'](_0xc008('0xa0'),_0x158d9f['uniqueid'],util[_0xc008('0x2c')](_0x33cad3[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]],{'showHidden':![],'depth':null}));ami[_0xc008('0x47')]('custom:voiceCallReport',_0x33cad3[_0xc008('0x35')][_0x158d9f[_0xc008('0x31')]]);delete _0x33cad3['channels'][_0x158d9f['uniqueid']];});}}}catch(_0xb79457){logger[_0xc008('0x2a')]('[%s][voiceCallReport][hangup]',_0x158d9f[_0xc008('0x31')],util[_0xc008('0x2c')](_0xb79457,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x23')]=function(_0x47a463){try{if(this[_0xc008('0x2f')](_0x47a463)){logger[_0xc008('0x29')](_0xc008('0xa1'),_0x47a463[_0xc008('0x31')],_0x47a463[_0xc008('0xa2')],_0x47a463[_0xc008('0xa3')]);logger[_0xc008('0x39')](_0xc008('0xa4'),_0x47a463[_0xc008('0x31')],util[_0xc008('0x2c')](_0x47a463,{'showHidden':![],'depth':null}));if(this[_0xc008('0x35')][_0x47a463[_0xc008('0xa5')]]){this[_0xc008('0x35')][_0x47a463['transfereeuniqueid']]['transfercalleridnum']=_0x47a463[_0xc008('0xa2')];this[_0xc008('0x35')][_0x47a463[_0xc008('0xa5')]][_0xc008('0xa6')]=_0x47a463[_0xc008('0xa3')];if(this[_0xc008('0x35')][_0x47a463[_0xc008('0xa7')]]){var _0x4b18d0=this['channels'][_0x47a463[_0xc008('0xa7')]];this[_0xc008('0x35')][_0x47a463[_0xc008('0xa7')]]=this['channels'][_0x47a463[_0xc008('0xa5')]];this[_0xc008('0x35')][_0x47a463[_0xc008('0xa5')]]=_0x4b18d0;}}else if(this[_0xc008('0x35')][_0x47a463[_0xc008('0xa8')]]){this[_0xc008('0x35')][_0x47a463[_0xc008('0xa8')]][_0xc008('0xa9')]=_0x47a463[_0xc008('0xa2')];this[_0xc008('0x35')][_0x47a463[_0xc008('0xa8')]][_0xc008('0xa6')]=_0x47a463['transfertargetcalleridnum'];if(this['channels'][_0x47a463[_0xc008('0xaa')]]){var _0x4b18d0=this['channels'][_0x47a463[_0xc008('0xaa')]];this[_0xc008('0x35')][_0x47a463[_0xc008('0xaa')]]=this[_0xc008('0x35')][_0x47a463[_0xc008('0xa8')]];this[_0xc008('0x35')][_0x47a463[_0xc008('0xa8')]]=_0x4b18d0;}}if((this[_0xc008('0x35')][_0x47a463[_0xc008('0xaa')]]||this['channels'][_0x47a463['origtransfererlinkedid']])&&this['channels'][_0x47a463[_0xc008('0xa7')]]){var _0x4ea787=_[_0xc008('0xab')]([this[_0xc008('0x35')][_0x47a463[_0xc008('0xaa')]],this[_0xc008('0x35')][_0x47a463[_0xc008('0xac')]],this[_0xc008('0x35')][_0x47a463[_0xc008('0xa7')]]],function(_0x37636e){return _0x37636e&&_0x37636e[_0xc008('0x7d')]===_0xc008('0x9f')&&_0x37636e[_0xc008('0xad')];});if(_0x4ea787){if(this[_0xc008('0x35')][_0x47a463[_0xc008('0xaa')]])this[_0xc008('0x35')][_0x47a463[_0xc008('0xaa')]][_0xc008('0x94')]=_0xc008('0xae');if(this['channels'][_0x47a463[_0xc008('0xac')]])this['channels'][_0x47a463[_0xc008('0xac')]][_0xc008('0x94')]=_0xc008('0xae');this['channels'][_0x47a463[_0xc008('0xa7')]][_0xc008('0x94')]=_0xc008('0xae');}}}}catch(_0x2f9cc){logger[_0xc008('0x2a')](_0xc008('0xaf'),_0x47a463[_0xc008('0x31')],util['inspect'](_0x2f9cc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x25')]=function(_0x10d579){try{if(this[_0xc008('0x2f')](_0x10d579)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x10d579['uniqueid'],_0x10d579['transfereecalleridnum'],_0x10d579[_0xc008('0xb0')]);logger[_0xc008('0x39')](_0xc008('0xb1'),_0x10d579[_0xc008('0x31')],util['inspect'](_0x10d579,{'showHidden':![],'depth':null}));if(this[_0xc008('0x35')][_0x10d579[_0xc008('0xa5')]]){this[_0xc008('0x35')][_0x10d579['transfereeuniqueid']][_0xc008('0xa9')]=_0x10d579['transfereecalleridnum'];this[_0xc008('0x35')][_0x10d579['transfereeuniqueid']][_0xc008('0xa6')]=_0x10d579[_0xc008('0xb0')];this[_0xc008('0x35')][_0x10d579[_0xc008('0xa5')]]['transferType']=_0xc008('0xb2');this[_0xc008('0x8c')]({'event':_0xc008('0x9e'),'uniqueid':_0x10d579[_0xc008('0xa5')],'context':_0x10d579[_0xc008('0x3c')],'channel':_0x10d579[_0xc008('0xb3')]});}else{this[_0xc008('0x35')][_0x10d579['transfereruniqueid']][_0xc008('0x94')]=_0xc008('0xb2');}}}catch(_0x322587){logger['error']('[%s][voiceCallReport][blindtransfer]',_0x10d579[_0xc008('0x31')],util[_0xc008('0x2c')](_0x322587,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0xb4')]=function(_0x590541){try{if(this[_0xc008('0x2f')](_0x590541)){logger[_0xc008('0x39')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x590541['uniqueid'],util['inspect'](_0x590541,{'showHidden':![],'depth':null}));if(this[_0xc008('0x35')][_0x590541['uniqueid']]){if(!_[_0xc008('0x6f')](this['channels'][_0x590541[_0xc008('0x31')]][_0xc008('0x5d')])){this[_0xc008('0x35')][_0x590541[_0xc008('0x31')]]['mohstarttime']=moment()['format'](_0xc008('0x3d'));logger[_0xc008('0x29')](_0xc008('0xb5'),_0x590541['uniqueid'],this[_0xc008('0x35')][_0x590541[_0xc008('0x31')]][_0xc008('0xb6')]);}}}}catch(_0x272d98){logger[_0xc008('0x2a')](_0xc008('0xb7'),_0x590541[_0xc008('0x31')],util[_0xc008('0x2c')](_0x272d98,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc008('0x2d')][_0xc008('0x28')]=function(_0xc7cb80){try{if(this['isNotNull'](_0xc7cb80)){logger['debug'](_0xc008('0xb8'),_0xc7cb80['uniqueid'],util[_0xc008('0x2c')](_0xc7cb80,{'showHidden':![],'depth':null}));if(this[_0xc008('0x35')][_0xc7cb80['uniqueid']]){if(!_['isNil'](this[_0xc008('0x35')][_0xc7cb80[_0xc008('0x31')]][_0xc008('0xb6')])){this[_0xc008('0x35')][_0xc7cb80[_0xc008('0x31')]][_0xc008('0xb9')]+=moment()['milliseconds'](0x0)[_0xc008('0x60')](this[_0xc008('0x35')][_0xc7cb80[_0xc008('0x31')]]['mohstarttime'],_0xc008('0x53'));logger[_0xc008('0x29')](_0xc008('0xba'),_0xc7cb80[_0xc008('0x31')],this['channels'][_0xc7cb80['uniqueid']][_0xc008('0xb9')]);delete this['channels'][_0xc7cb80[_0xc008('0x31')]][_0xc008('0xb6')];}}}}catch(_0x222a5d){logger[_0xc008('0x2a')](_0xc008('0xbb'),_0xc7cb80['uniqueid'],util['inspect'](_0x222a5d,{'showHidden':![],'depth':null}));}};module[_0xc008('0xbc')]=VoiceCallReport;
\ No newline at end of file
+var _0x5fc3=['bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','uniqueid','linkedid','merge','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','pick','from-sip','split','exten','accountcode','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','format','keys','includes','lastapplication','lastdata','startsWith','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','holdtime','diff','xcally-motion-preview','connectedlinenum','destinationchannel','membername','name','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','answertime','omit','destconnectedlinenum','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:%s','transferType','getSettings','then','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereeuniqueid','transferconnectedlinenum','transfertargetcalleridnum','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','inuse','invalid','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','NO\x20ANSWER','FAILED','BUSY','redis','defaults','channels','agents','blindTransfers','coreshowchannel'];(function(_0x3029ad,_0x4a48e1){var _0x221c99=function(_0xbb9186){while(--_0xbb9186){_0x3029ad['push'](_0x3029ad['shift']());}};_0x221c99(++_0x4a48e1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0x5fc3[_0x53b594];return _0x1e616f;};'use strict';var BPromise=require(_0x35fc('0x0'));var _=require(_0x35fc('0x1'));var moment=require('moment');var util=require(_0x35fc('0x2'));var path=require(_0x35fc('0x3'));var Redis=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('ami');var ami=require(_0x35fc('0x7'));var Channel=require(_0x35fc('0x8'));var RpcSetting=require(_0x35fc('0x9'));var statusDesc=['unknown','not_inuse',_0x35fc('0xa'),'busy',_0x35fc('0xb'),_0x35fc('0xc'),_0x35fc('0xd'),_0x35fc('0xe'),_0x35fc('0xf')];var applications=[_0x35fc('0x10'),_0x35fc('0x11'),'agi',_0x35fc('0x12'),_0x35fc('0x13'),'voicemail'];var dispositions=[_0x35fc('0x14'),_0x35fc('0x15'),'FAILED',_0x35fc('0x14'),_0x35fc('0x14'),'NO\x20ANSWER','ANSWERED',_0x35fc('0x16'),'FAILED',_0x35fc('0x15'),_0x35fc('0x15')];var actions={};config[_0x35fc('0x17')]=_[_0x35fc('0x18')](config[_0x35fc('0x17')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x558364){this[_0x35fc('0x19')]=_0x558364[_0x35fc('0x19')];this[_0x35fc('0x1a')]=_0x558364[_0x35fc('0x1a')];this[_0x35fc('0x1b')]={};ami['on'](_0x35fc('0x1c'),this['syncNewExten'][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x1e'),this['syncNewExten'][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x1f'),this[_0x35fc('0x20')]['bind'](this));ami['on'](_0x35fc('0x21'),this[_0x35fc('0x22')][_0x35fc('0x1d')](this));ami['on']('varset',this[_0x35fc('0x23')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x24'),this[_0x35fc('0x25')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x26'),this[_0x35fc('0x27')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x28'),this[_0x35fc('0x29')]['bind'](this));ami['on'](_0x35fc('0x2a'),this[_0x35fc('0x2b')][_0x35fc('0x1d')](this));ami['on'](_0x35fc('0x2c'),this[_0x35fc('0x2d')]['bind'](this));ami['on'](_0x35fc('0x2e'),this[_0x35fc('0x2f')]['bind'](this));try{logger[_0x35fc('0x30')](_0x35fc('0x31'));ami[_0x35fc('0x32')]();}catch(_0x51cfec){logger[_0x35fc('0x33')]('[voiceCallReport][coreshowchannels]',util[_0x35fc('0x34')](_0x51cfec,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x35fc('0x35')]['isNotNull']=function(_0x519264){return _0x519264!==null&&!_[_0x35fc('0x36')](_0x519264);};VoiceCallReport['prototype'][_0x35fc('0x37')]=function(_0x1a5d92,_0x57001c,_0x26b7cb){io['to'](_0x1a5d92)[_0x35fc('0x37')](_0x57001c,_0x26b7cb);};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x27')]=function(_0x3735da){try{if(this[_0x35fc('0x38')](_0x3735da)){logger[_0x35fc('0x30')](_0x35fc('0x39'),_0x3735da['uniqueid'],_0x3735da[_0x35fc('0x3a')],_0x3735da[_0x35fc('0x3b')]);logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x3735da[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x3735da,{'showHidden':![],'depth':null}));if(_0x3735da[_0x35fc('0x3d')]===_0x3735da[_0x35fc('0x3e')]){if(!_[_0x35fc('0x36')](this[_0x35fc('0x19')][_0x3735da[_0x35fc('0x3d')]])){_[_0x35fc('0x3f')](this[_0x35fc('0x19')][_0x3735da[_0x35fc('0x3d')]],_['pick'](_0x3735da,_['keys'](this[_0x35fc('0x19')][_0x3735da['uniqueid']])));}}}}catch(_0x37b394){logger[_0x35fc('0x33')](_0x35fc('0x40'),_0x3735da[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x37b394,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncNewChannel']=function(_0x3fe193){try{if(this[_0x35fc('0x38')](_0x3fe193)){logger[_0x35fc('0x3c')](_0x35fc('0x41'),_0x3fe193[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x3fe193,{'showHidden':![],'depth':null}));if(_0x3fe193['uniqueid']===_0x3fe193[_0x35fc('0x3e')]&&_0x3fe193[_0x35fc('0x42')]!=_0x35fc('0x43')){if(_['isUndefined'](this[_0x35fc('0x19')][_0x3fe193['uniqueid']])){logger[_0x35fc('0x30')](_0x35fc('0x44'),_0x3fe193[_0x35fc('0x3d')],_0x3fe193[_0x35fc('0x45')],_0x3fe193['exten']);this['channels'][_0x3fe193['uniqueid']]=new Channel();this[_0x35fc('0x19')][_0x3fe193['uniqueid']][_0x35fc('0x46')]=moment()['format'](_0x35fc('0x47'));this[_0x35fc('0x19')][_0x3fe193[_0x35fc('0x3d')]][_0x35fc('0x48')]=dispositions[_[_0x35fc('0x49')](_0x3fe193[_0x35fc('0x4a')])];_[_0x35fc('0x3f')](this['channels'][_0x3fe193[_0x35fc('0x3d')]],_[_0x35fc('0x4b')](_0x3fe193,_['keys'](this[_0x35fc('0x19')][_0x3fe193[_0x35fc('0x3d')]])));if(_0x3fe193[_0x35fc('0x45')]===_0x35fc('0x4c')){if(this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]]){this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['destconnectedlinenum']=_0x3fe193[_0x35fc('0x4e')];logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3fe193[_0x35fc('0x3d')],util[_0x35fc('0x34')]({'destaccountcode':this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x4f')],'destconnectedlinenum':_0x3fe193[_0x35fc('0x4e')]},{'showHidden':![],'depth':null}));this[_0x35fc('0x37')](util['format']('user:%s',this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x35fc('0x1a')][_0x3fe193[_0x35fc('0x42')]['split']('-')[0x0]][_0x35fc('0x4f')],'destconnectedlinenum':_0x3fe193[_0x35fc('0x4e')]});}}}}}}catch(_0x1fb0a6){logger[_0x35fc('0x33')]('[%s][voiceCallReport][newchannel]',_0x3fe193['uniqueid'],util['inspect'](_0x1fb0a6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0xb26e3f){try{if(this[_0x35fc('0x38')](_0xb26e3f)){logger['debug'](_0x35fc('0x50'),_0xb26e3f['uniqueid'],util[_0x35fc('0x34')](_0xb26e3f,{'showHidden':![],'depth':null}));if(_0xb26e3f[_0x35fc('0x3d')]===_0xb26e3f[_0x35fc('0x3e')]&&_0xb26e3f[_0x35fc('0x4e')]!='h'&&_0xb26e3f[_0x35fc('0x42')]!='OutgoingSpoolFailed'){_0xb26e3f[_0x35fc('0x51')]=_0xb26e3f[_0x35fc('0x51')]['toLowerCase']();_0xb26e3f[_0x35fc('0x52')]=(_0xb26e3f[_0x35fc('0x53')]||_0xb26e3f[_0x35fc('0x52')])[_0x35fc('0x54')]();logger['info'](_0x35fc('0x55'),_0xb26e3f['uniqueid'],_0xb26e3f['application'],_0xb26e3f[_0x35fc('0x52')]);if(_[_0x35fc('0x36')](this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]])){this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]]=new Channel();this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]]['starttime']=_0xb26e3f[_0x35fc('0x56')]?moment()[_0x35fc('0x57')](moment[_0x35fc('0x56')](_0xb26e3f[_0x35fc('0x56')])[_0x35fc('0x58')](),_0x35fc('0x58'))[_0x35fc('0x59')](_0x35fc('0x47')):moment()[_0x35fc('0x59')](_0x35fc('0x47'));this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x48')]=_0x35fc('0x14');}_['merge'](this['channels'][_0xb26e3f[_0x35fc('0x3d')]],_[_0x35fc('0x4b')](_0xb26e3f,_[_0x35fc('0x5a')](this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]])));if(_[_0x35fc('0x5b')](applications,_0xb26e3f['application'])){this['channels'][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x5c')]=_0xb26e3f[_0x35fc('0x51')];this[_0x35fc('0x19')][_0xb26e3f['uniqueid']][_0x35fc('0x5d')]=_0xb26e3f[_0x35fc('0x52')];if(_0xb26e3f['application']===_0x35fc('0x10')&&_[_0x35fc('0x5e')](_0xb26e3f['applicationdata'],_0x35fc('0x5f'))){var _0x1ab472=_0xb26e3f[_0x35fc('0x52')][_0x35fc('0x4d')]('=');var _0x5e4018=_0x1ab472[0x0]['match'](/cdr\((.*)\)/);if(_0x5e4018){this['channels'][_0xb26e3f[_0x35fc('0x3d')]][_0x5e4018[0x1]]=_0x1ab472[0x1];}}else if(_0xb26e3f[_0x35fc('0x51')]==='queue'){this[_0x35fc('0x19')][_0xb26e3f[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0xb26e3f[_0x35fc('0x52')][_0x35fc('0x4d')](',')[0x0];}}}}}catch(_0x538be0){logger[_0x35fc('0x33')](_0x35fc('0x60'),_0xb26e3f[_0x35fc('0x3d')],util['inspect'](_0x538be0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x22')]=function(_0x47fb1a){try{if(this[_0x35fc('0x38')](_0x47fb1a)){logger[_0x35fc('0x30')](_0x35fc('0x61'),_0x47fb1a[_0x35fc('0x3d')],_0x47fb1a[_0x35fc('0x3e')],_0x47fb1a[_0x35fc('0x3a')],_0x47fb1a[_0x35fc('0x3b')]);logger[_0x35fc('0x3c')]('[%s][voiceCallReport][newstate]\x20event:',_0x47fb1a[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x47fb1a,{'showHidden':![],'depth':null}));if(_0x47fb1a[_0x35fc('0x3d')]!==_0x47fb1a['linkedid']){if(this[_0x35fc('0x19')][_0x47fb1a['linkedid']]){if(_0x47fb1a['channelstate']==='6'){if(!this['channels'][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x62')]){var _0x39a1ee=moment();this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['answered']=!![];this['channels'][_0x47fb1a['linkedid']]['answertime']=_0x39a1ee['format'](_0x35fc('0x47'));if(this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x46')]){this['channels'][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x63')]=_0x39a1ee[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x46')],_0x35fc('0x58'));}}this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['linkedid']=_0x47fb1a[_0x35fc('0x3d')];if(_0x47fb1a['calleridnum']!==_0x35fc('0x65')){this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x66')]=_0x47fb1a['calleridnum'];}this[_0x35fc('0x19')][_0x47fb1a['linkedid']]['connectedlinename']=_0x47fb1a['calleridname'];this[_0x35fc('0x19')][_0x47fb1a['linkedid']][_0x35fc('0x67')]=_0x47fb1a['channel'];this[_0x35fc('0x19')][_0x47fb1a['linkedid']][_0x35fc('0x48')]=dispositions[_[_0x35fc('0x49')](_0x47fb1a[_0x35fc('0x4a')])];if(this[_0x35fc('0x1a')][_0x47fb1a['channel'][_0x35fc('0x4d')]('-')[0x0]]){this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]]['UserId']=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['id'];this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3e')]][_0x35fc('0x68')]=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')]['split']('-')[0x0]][_0x35fc('0x69')];}}}}else{if(this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3d')]]){if(_0x47fb1a['channelstate']==='6'){if(this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')]['split']('-')[0x0]]){this['channels'][_0x47fb1a[_0x35fc('0x3d')]]['UserId']=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['id'];this[_0x35fc('0x19')][_0x47fb1a[_0x35fc('0x3d')]][_0x35fc('0x68')]=this[_0x35fc('0x1a')][_0x47fb1a[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x69')];}}}}}}catch(_0x65ee1b){logger[_0x35fc('0x33')](_0x35fc('0x6a'),_0x47fb1a[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x65ee1b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x6b')]=function(_0x2d7b16,_0x3b2160){try{if(this[_0x35fc('0x19')][_0x2d7b16]){logger['info'](_0x35fc('0x6c'),_0x2d7b16,_0x3b2160);this['channels'][_0x2d7b16][_0x35fc('0x6d')]=!![];if(_[_0x35fc('0x6e')](_0x3b2160,_0x35fc('0x6f'))){_0x3b2160=_0x3b2160[_0x35fc('0x70')](_0x35fc('0x6f'),_0x35fc('0x71'));}this[_0x35fc('0x19')][_0x2d7b16][_0x35fc('0x72')]=_0x3b2160;var _0x2fed7b=_[_0x35fc('0x73')](this[_0x35fc('0x19')][_0x2d7b16]['monitors'],{'filename':_0x3b2160});if(_[_0x35fc('0x74')](_0x2fed7b)){this[_0x35fc('0x19')][_0x2d7b16][_0x35fc('0x75')][_0x35fc('0x76')]({'filename':_0x3b2160,'createdAt':moment()[_0x35fc('0x59')](_0x35fc('0x47')),'mixmonitorid':'','status':'rec'});}}}catch(_0x43ef1f){logger[_0x35fc('0x33')](_0x35fc('0x77'),_0x2d7b16,util[_0x35fc('0x34')](_0x43ef1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x23')]=function(_0x2d1cbf){try{if(this[_0x35fc('0x38')](_0x2d1cbf)){logger[_0x35fc('0x3c')]('[%s][voiceCallReport][varset]\x20event:',_0x2d1cbf[_0x35fc('0x3d')],util['inspect'](_0x2d1cbf,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]]&&_0x2d1cbf['channel']!=_0x35fc('0x43')){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')])){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x79')])){logger[_0x35fc('0x30')](_0x35fc('0x7a'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value']);this['syncMixMonitorFilename'](_0x2d1cbf['uniqueid'],_0x2d1cbf['value']);}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x7b')])){logger[_0x35fc('0x30')](_0x35fc('0x7c'),_0x2d1cbf['uniqueid'],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x3b')]=_0x2d1cbf['value'];}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x7e')])){logger['info'](_0x35fc('0x7f'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x80')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x81')])){logger[_0x35fc('0x30')](_0x35fc('0x82'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x83')]=_0x2d1cbf['value'];}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')]['xmd-queue'])){logger[_0x35fc('0x30')](_0x35fc('0x84'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value'][_0x35fc('0x4d')](',')[0x0]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0x2d1cbf[_0x35fc('0x7d')]['split'](',')[0x0];}else if(this['isNotNull'](_0x2d1cbf['variable'][_0x35fc('0x85')])){logger['info'](_0x35fc('0x86'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x87')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x88')])){logger[_0x35fc('0x30')](_0x35fc('0x89'),_0x2d1cbf['uniqueid'],_0x2d1cbf['value']);this['channels'][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x8a')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this[_0x35fc('0x38')](_0x2d1cbf['variable'][_0x35fc('0x8b')])){logger[_0x35fc('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x2d1cbf['uniqueid'],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]]['calleridpreview']=_0x2d1cbf['value'];}else if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')]['xmcs-queue'])){logger[_0x35fc('0x30')](_0x35fc('0x8c'),_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf['value']);this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3d')]][_0x35fc('0x11')]=_0x2d1cbf[_0x35fc('0x7d')];}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x8d')])){logger[_0x35fc('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2d1cbf[_0x35fc('0x3d')],_0x2d1cbf[_0x35fc('0x7d')]);this[_0x35fc('0x19')][_0x2d1cbf['uniqueid']][_0x35fc('0x8e')]=_0x2d1cbf[_0x35fc('0x7d')];}}}else if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x79')])){if(_0x2d1cbf[_0x35fc('0x7d')]){var _0x45eaae=path[_0x35fc('0x8f')](_0x2d1cbf[_0x35fc('0x7d')])[_0x35fc('0x69')];logger[_0x35fc('0x30')](_0x35fc('0x7a'),_0x45eaae,_0x2d1cbf['value']);this[_0x35fc('0x6b')](_0x45eaae,_0x2d1cbf[_0x35fc('0x7d')]);}}else if(this[_0x35fc('0x19')][_0x2d1cbf[_0x35fc('0x3e')]]){if(this['isNotNull'](_0x2d1cbf[_0x35fc('0x78')])){if(this[_0x35fc('0x38')](_0x2d1cbf[_0x35fc('0x78')][_0x35fc('0x8d')])){logger[_0x35fc('0x30')](_0x35fc('0x90'),_0x2d1cbf[_0x35fc('0x3e')],_0x2d1cbf[_0x35fc('0x7d')]);this['channels'][_0x2d1cbf['linkedid']][_0x35fc('0x91')]=_0x2d1cbf[_0x35fc('0x7d')];}}}}}catch(_0x961ee9){logger['error'](_0x35fc('0x92'),_0x2d1cbf[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x961ee9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncHangup']=function(_0x5874db){try{if(this[_0x35fc('0x38')](_0x5874db)){logger['debug'](_0x35fc('0x93'),_0x5874db[_0x35fc('0x3d')],util['inspect'](_0x5874db,{'showHidden':![],'depth':null}));if(this['channels'][_0x5874db[_0x35fc('0x3d')]]){logger[_0x35fc('0x30')](_0x35fc('0x94'),_0x5874db['uniqueid'],_0x5874db[_0x35fc('0x95')]);var _0x177088=moment();this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x96')]=_0x177088[_0x35fc('0x59')](_0x35fc('0x47'));this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x56')]=_0x177088[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x46')],_0x35fc('0x58'));if(this['channels'][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x62')]){this['channels'][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x97')]=_0x177088['diff'](this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x98')],_0x35fc('0x58'));this[_0x35fc('0x19')][_0x5874db['uniqueid']][_0x35fc('0x63')]=this[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]]['duration']-this[_0x35fc('0x19')][_0x5874db['uniqueid']]['billableseconds'];}if(_0x5874db[_0x35fc('0x45')]===_0x35fc('0x4c')){if(this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]){this['agents'][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]=_[_0x35fc('0x99')](this['agents'][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]],[_0x35fc('0x9a')]);logger[_0x35fc('0x3c')](_0x35fc('0x9b'),_0x5874db['uniqueid'],util[_0x35fc('0x34')]({'destaccountcode':this[_0x35fc('0x1a')][_0x5874db['channel']['split']('-')[0x0]][_0x35fc('0x4f')]},{'showHidden':![],'depth':null}));this[_0x35fc('0x37')](util[_0x35fc('0x59')](_0x35fc('0x9c'),this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]]['name']),'user:agentcomplete',{'destaccountcode':this[_0x35fc('0x1a')][_0x5874db[_0x35fc('0x42')][_0x35fc('0x4d')]('-')[0x0]][_0x35fc('0x4f')]});}}var _0x1c3630=this;Promise['resolve']()['then'](function(){var _0x2c213d=_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]];if(typeof _0x2c213d[_0x35fc('0x9d')]==='undefined')return;if(_['isEmpty'](_0x2c213d[_0x35fc('0x75')]))return;return RpcSetting[_0x35fc('0x9e')]()[_0x35fc('0x9f')](function(_0xd46d64){if(!_0xd46d64['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x35fc('0x9f')](function(){return ami[_0x35fc('0xa0')]({'action':'StopMixMonitor','channel':_0x2c213d[_0x35fc('0x42')]})[_0x35fc('0xa1')](function(){});})[_0x35fc('0x9f')](function(){return ami[_0x35fc('0xa0')]({'action':_0x35fc('0xa2'),'channel':_0x2c213d[_0x35fc('0x67')]})[_0x35fc('0xa1')](function(){})[_0x35fc('0xa3')](function(){var _0x42836b=_0x1c3630[_0x35fc('0x1a')][_0x2c213d[_0x35fc('0x67')][_0x35fc('0x4d')]('-')[0x0]];if(!_0x42836b)return;io[_0x35fc('0x37')](_0x35fc('0xa4'),{'agentId':_0x42836b['id'],'uniqueid':_0x2c213d[_0x35fc('0x3d')]});});});});})[_0x35fc('0x9f')](function(){if(_0x5874db['event']===_0x35fc('0xa5')){_0x1c3630['blindTransfers'][_0x5874db[_0x35fc('0x3d')]]=_0x1c3630['channels'][_0x5874db['uniqueid']];}else{if(_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x83')]==='outbound'&&_0x1c3630[_0x35fc('0x1b')][_0x5874db[_0x35fc('0x3d')]]){_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]][_0x35fc('0x3d')]=[_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['linkedid'],_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['linkedid']=_0x1c3630[_0x35fc('0x19')][_0x5874db['uniqueid']]['uniqueid']][0x0];delete _0x1c3630['blindTransfers'][_0x5874db[_0x35fc('0x3d')]];}}logger['debug'](_0x35fc('0xa6'),_0x5874db[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x1c3630[_0x35fc('0x19')][_0x5874db[_0x35fc('0x3d')]],{'showHidden':![],'depth':null}));ami[_0x35fc('0x37')]('custom:voiceCallReport',_0x1c3630['channels'][_0x5874db[_0x35fc('0x3d')]]);delete _0x1c3630['channels'][_0x5874db[_0x35fc('0x3d')]];});}}}catch(_0x39d9ec){logger['error']('[%s][voiceCallReport][hangup]',_0x5874db['uniqueid'],util[_0x35fc('0x34')](_0x39d9ec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x29')]=function(_0x135e18){try{if(this[_0x35fc('0x38')](_0x135e18)){logger[_0x35fc('0x30')](_0x35fc('0xa7'),_0x135e18[_0x35fc('0x3d')],_0x135e18['origtransferercalleridnum'],_0x135e18['transfertargetcalleridnum']);logger['debug']('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x135e18[_0x35fc('0x3d')],util['inspect'](_0x135e18,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x135e18['transfereeuniqueid']]){this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]]['transfercalleridnum']=_0x135e18['origtransferercalleridnum'];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]][_0x35fc('0xa9')]=_0x135e18[_0x35fc('0xaa')];if(this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]){var _0x57bbed=this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']];this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]=this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xa8')]]=_0x57bbed;}}else if(this['channels'][_0x135e18[_0x35fc('0xab')]]){this['channels'][_0x135e18[_0x35fc('0xab')]]['transfercalleridnum']=_0x135e18['origtransferercalleridnum'];this[_0x35fc('0x19')][_0x135e18['transfertargetuniqueid']][_0x35fc('0xa9')]=_0x135e18[_0x35fc('0xaa')];if(this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]){var _0x57bbed=this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]=this['channels'][_0x135e18[_0x35fc('0xab')]];this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xab')]]=_0x57bbed;}}if((this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]]||this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]])&&this[_0x35fc('0x19')][_0x135e18['secondtransfereruniqueid']]){var _0x59c81a=_['some']([this['channels'][_0x135e18['origtransfereruniqueid']],this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]],this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xae')]]],function(_0x243e0d){return _0x243e0d&&_0x243e0d['type']===_0x35fc('0xaf')&&_0x243e0d[_0x35fc('0xb0')];});if(_0x59c81a){if(this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xac')]])this[_0x35fc('0x19')][_0x135e18['origtransfereruniqueid']][_0x35fc('0x9d')]=_0x35fc('0xb1');if(this[_0x35fc('0x19')][_0x135e18['origtransfererlinkedid']])this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xad')]][_0x35fc('0x9d')]=_0x35fc('0xb1');this[_0x35fc('0x19')][_0x135e18[_0x35fc('0xae')]][_0x35fc('0x9d')]=_0x35fc('0xb1');}}}}catch(_0x1eaab6){logger[_0x35fc('0x33')](_0x35fc('0xb2'),_0x135e18[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x1eaab6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')][_0x35fc('0x2b')]=function(_0x47a52d){try{if(this['isNotNull'](_0x47a52d)){logger[_0x35fc('0x30')](_0x35fc('0xb3'),_0x47a52d[_0x35fc('0x3d')],_0x47a52d[_0x35fc('0xb4')],_0x47a52d[_0x35fc('0xb5')]);logger[_0x35fc('0x3c')](_0x35fc('0xb6'),_0x47a52d[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x47a52d,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]]){this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0xb7')]=_0x47a52d[_0x35fc('0xb4')];this['channels'][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0xa9')]=_0x47a52d[_0x35fc('0xb5')];this[_0x35fc('0x19')][_0x47a52d[_0x35fc('0xa8')]][_0x35fc('0x9d')]=_0x35fc('0xb8');this[_0x35fc('0x25')]({'event':'BlindTransfer','uniqueid':_0x47a52d['transfereeuniqueid'],'context':_0x47a52d[_0x35fc('0x45')],'channel':_0x47a52d[_0x35fc('0xb9')]});}else{this['channels'][_0x47a52d[_0x35fc('0xba')]][_0x35fc('0x9d')]=_0x35fc('0xb8');}}}catch(_0x287555){logger['error'](_0x35fc('0xbb'),_0x47a52d[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x287555,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x35fc('0x35')]['syncMusicOnHoldStart']=function(_0x49ed6b){try{if(this[_0x35fc('0x38')](_0x49ed6b)){logger['debug'](_0x35fc('0xbc'),_0x49ed6b[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x49ed6b,{'showHidden':![],'depth':null}));if(this['channels'][_0x49ed6b[_0x35fc('0x3d')]]){if(!_['isNil'](this[_0x35fc('0x19')][_0x49ed6b[_0x35fc('0x3d')]]['answertime'])){this[_0x35fc('0x19')][_0x49ed6b[_0x35fc('0x3d')]][_0x35fc('0xbd')]=moment()[_0x35fc('0x59')](_0x35fc('0x47'));logger[_0x35fc('0x30')](_0x35fc('0xbe'),_0x49ed6b['uniqueid'],this['channels'][_0x49ed6b[_0x35fc('0x3d')]][_0x35fc('0xbd')]);}}}}catch(_0x2463dd){logger[_0x35fc('0x33')](_0x35fc('0xbf'),_0x49ed6b[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x2463dd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x35fc('0x2f')]=function(_0x4110e7){try{if(this[_0x35fc('0x38')](_0x4110e7)){logger['debug'](_0x35fc('0xc0'),_0x4110e7[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x4110e7,{'showHidden':![],'depth':null}));if(this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]]){if(!_[_0x35fc('0x74')](this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')])){this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xc1')]+=moment()[_0x35fc('0xc2')](0x0)[_0x35fc('0x64')](this[_0x35fc('0x19')][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')],_0x35fc('0x58'));logger[_0x35fc('0x30')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x4110e7[_0x35fc('0x3d')],this['channels'][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xc1')]);delete this['channels'][_0x4110e7[_0x35fc('0x3d')]][_0x35fc('0xbd')];}}}}catch(_0x462c30){logger[_0x35fc('0x33')](_0x35fc('0xc3'),_0x4110e7[_0x35fc('0x3d')],util[_0x35fc('0x34')](_0x462c30,{'showHidden':![],'depth':null}));}};module[_0x35fc('0xc4')]=VoiceCallReport;
\ No newline at end of file
index ee4cf58..7676883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a00=['rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','diff','seconds','answered','holdtime','starttime','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','moment','util','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','prototype','isNotNull','isUndefined','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','[%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','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinename','answertime','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','error','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','value','info','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x8a00,0xf0));var _0x08a0=function(_0x46e4c8,_0x273685){_0x46e4c8=_0x46e4c8-0x0;var _0x5224ec=_0x8a00[_0x46e4c8];return _0x5224ec;};'use strict';var _=require('lodash');var moment=require(_0x08a0('0x0'));var util=require(_0x08a0('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x08a0('0x2'));var ami=require(_0x08a0('0x3'));config['redis']=_['defaults'](config[_0x08a0('0x4')],{'host':_0x08a0('0x5'),'port':0x18eb});var io=require(_0x08a0('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x4bf68c){this[_0x08a0('0x7')]=_0x4bf68c[_0x08a0('0x8')];this[_0x08a0('0x9')]=_0x4bf68c[_0x08a0('0x9')];this[_0x08a0('0xa')]={};ami['on']('dialbegin',this['syncDialBegin'][_0x08a0('0xb')](this));ami['on'](_0x08a0('0xc'),this[_0x08a0('0xd')][_0x08a0('0xb')](this));ami['on'](_0x08a0('0xe'),this[_0x08a0('0xf')][_0x08a0('0xb')](this));ami['on'](_0x08a0('0x10'),this['syncHangup'][_0x08a0('0xb')](this));}VoiceDialReport[_0x08a0('0x11')][_0x08a0('0x12')]=function(_0x3cc25f){return _0x3cc25f!==null&&!_[_0x08a0('0x13')](_0x3cc25f);};VoiceDialReport['prototype'][_0x08a0('0x14')]=function(_0x330ad2,_0x1695ee,_0x5351e4){io['to'](_0x330ad2)['emit'](_0x1695ee,_0x5351e4);};VoiceDialReport[_0x08a0('0x11')][_0x08a0('0x15')]=function(_0x19dd01){try{if(this[_0x08a0('0x12')](_0x19dd01)){logger[_0x08a0('0x16')](_0x08a0('0x17'),_0x19dd01[_0x08a0('0x18')],util[_0x08a0('0x19')](_0x19dd01,{'showHidden':![],'depth':null}));if(this[_0x08a0('0x7')][_0x19dd01[_0x08a0('0x18')]]){_[_0x08a0('0x1a')](this[_0x08a0('0x7')][_0x19dd01['uniqueid']],{'starttime':moment()[_0x08a0('0x1b')](_0x08a0('0x1c')),'lastevent':'called','interface':_0x19dd01[_0x08a0('0x1d')][_0x08a0('0x1e')](0x0,_0x19dd01[_0x08a0('0x1d')][_0x08a0('0x1f')]('-')),'membername':_0x19dd01[_0x08a0('0x1d')]['substring'](_0x19dd01[_0x08a0('0x1d')][_0x08a0('0x1f')]('/')+0x1,_0x19dd01[_0x08a0('0x1d')][_0x08a0('0x1f')]('-'))},_[_0x08a0('0x20')](_0x19dd01,['event',_0x08a0('0x21')]));logger['info'](_0x08a0('0x22'),_0x19dd01[_0x08a0('0x18')],this[_0x08a0('0x7')][_0x19dd01[_0x08a0('0x18')]][_0x08a0('0x23')],this[_0x08a0('0x7')][_0x19dd01[_0x08a0('0x18')]][_0x08a0('0x24')]);logger['debug'](_0x08a0('0x25'),_0x19dd01[_0x08a0('0x18')],util['inspect'](this[_0x08a0('0x7')][_0x19dd01['uniqueid']],{'showHidden':![],'depth':null}));this[_0x08a0('0x14')](_0x08a0('0x26'),_0x08a0('0x27'),this[_0x08a0('0x7')][_0x19dd01['uniqueid']]);logger[_0x08a0('0x16')](_0x08a0('0x28'),_0x19dd01[_0x08a0('0x18')],util[_0x08a0('0x19')](this[_0x08a0('0x7')][_0x19dd01[_0x08a0('0x18')]],{'showHidden':![],'depth':null}));ami[_0x08a0('0x14')](_0x08a0('0x29'),this[_0x08a0('0x7')][_0x19dd01['uniqueid']]);}}}catch(_0x511e73){logger['error'](_0x08a0('0x2a'),_0x19dd01['uniqueid'],util[_0x08a0('0x19')](_0x511e73,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x08a0('0x11')][_0x08a0('0xd')]=function(_0x4e3a9c){try{if(this[_0x08a0('0x12')](_0x4e3a9c)){logger[_0x08a0('0x16')](_0x08a0('0x2b'),_0x4e3a9c['uniqueid'],util[_0x08a0('0x19')](_0x4e3a9c,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e3a9c[_0x08a0('0x18')]]){this[_0x08a0('0x7')][_0x4e3a9c['uniqueid']]['dialstatus']=_0x4e3a9c[_0x08a0('0x2c')];if(_0x4e3a9c[_0x08a0('0x2c')]===_0x08a0('0x2d')){this[_0x08a0('0x7')][_0x4e3a9c['uniqueid']]['connectedlinenum']=_0x4e3a9c['connectedlinenum'];this[_0x08a0('0x7')][_0x4e3a9c[_0x08a0('0x18')]][_0x08a0('0x2e')]=_0x4e3a9c[_0x08a0('0x2e')];this[_0x08a0('0x7')][_0x4e3a9c['uniqueid']][_0x08a0('0x2f')]=moment()[_0x08a0('0x1b')](_0x08a0('0x1c'));this[_0x08a0('0x7')][_0x4e3a9c[_0x08a0('0x18')]][_0x08a0('0x30')]='connect';logger['info'](_0x08a0('0x31'),_0x4e3a9c[_0x08a0('0x18')],_0x4e3a9c[_0x08a0('0x1d')][_0x08a0('0x1e')](_0x4e3a9c[_0x08a0('0x1d')][_0x08a0('0x1f')]('/')+0x1,_0x4e3a9c[_0x08a0('0x1d')][_0x08a0('0x1f')]('-')));logger[_0x08a0('0x16')](_0x08a0('0x32'),_0x4e3a9c[_0x08a0('0x18')],util[_0x08a0('0x19')](this[_0x08a0('0x7')][_0x4e3a9c[_0x08a0('0x18')]],{'showHidden':![],'depth':null}));ami[_0x08a0('0x14')](_0x08a0('0x33'),this[_0x08a0('0x7')][_0x4e3a9c[_0x08a0('0x18')]]);}logger[_0x08a0('0x16')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4e3a9c[_0x08a0('0x18')],util[_0x08a0('0x19')](this['channels'][_0x4e3a9c[_0x08a0('0x18')]],{'showHidden':![],'depth':null}));this['emit'](_0x08a0('0x26'),_0x08a0('0x27'),this['channels'][_0x4e3a9c[_0x08a0('0x18')]]);}}}catch(_0x4da341){logger[_0x08a0('0x34')]('[%s][voiceDialReport][dialend]',_0x4e3a9c['uniqueid'],util[_0x08a0('0x19')](_0x4da341,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x08a0('0x11')][_0x08a0('0xf')]=function(_0x29eeb7){try{if(this[_0x08a0('0x12')](_0x29eeb7)){logger[_0x08a0('0x16')](_0x08a0('0x35'),_0x29eeb7[_0x08a0('0x18')],util[_0x08a0('0x19')](_0x29eeb7,{'showHidden':![],'depth':null}));this[_0x08a0('0x36')](_0x29eeb7[_0x08a0('0x18')],_['keys'](_0x29eeb7[_0x08a0('0x37')])[0x0],_0x29eeb7[_0x08a0('0x38')]);if(this[_0x08a0('0x12')](_0x29eeb7[_0x08a0('0x37')])&&this[_0x08a0('0x12')](_0x29eeb7[_0x08a0('0x37')]['outboundrouteid'])){if(_['isUndefined'](this['channels'][_0x29eeb7[_0x08a0('0x18')]])){this[_0x08a0('0x7')][_0x29eeb7[_0x08a0('0x18')]]={'routeId':_0x29eeb7['value'],'variables':this['variables'][_0x29eeb7[_0x08a0('0x18')]]};logger[_0x08a0('0x39')](_0x08a0('0x3a'),_0x29eeb7[_0x08a0('0x18')],_0x29eeb7[_0x08a0('0x37')][_0x08a0('0x3b')],_['keys'](_0x29eeb7[_0x08a0('0x37')])[0x0],_0x29eeb7[_0x08a0('0x38')]);logger[_0x08a0('0x16')](_0x08a0('0x3c'),_0x29eeb7[_0x08a0('0x18')],util[_0x08a0('0x19')](this['channels'][_0x29eeb7['uniqueid']],{'showHidden':![],'depth':null}));this[_0x08a0('0x14')]('voice:outbound',_0x08a0('0x27'),this[_0x08a0('0x7')][_0x29eeb7[_0x08a0('0x18')]]);}}}}catch(_0x51aab2){logger[_0x08a0('0x34')](_0x08a0('0x3d'),_0x29eeb7[_0x08a0('0x18')],util['inspect'](_0x51aab2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x08a0('0x11')][_0x08a0('0x36')]=function(_0x423d09,_0x10dafb,_0x4f3092){var _0x3e47e0=[_0x08a0('0x3e'),_0x08a0('0x3f'),_0x08a0('0x40'),_0x08a0('0x41'),_0x08a0('0x42'),_0x08a0('0x43'),_0x08a0('0x44'),'rtpaudioqosrttbridged',_0x08a0('0x45'),'sipuri',_0x08a0('0x46'),_0x08a0('0x47'),_0x08a0('0x48'),_0x08a0('0x49'),_0x08a0('0x4a'),'memberlastcall','membername','memberpenalty',_0x08a0('0x4b')];if(!_[_0x08a0('0x4c')](_0x10dafb)&&!_[_0x08a0('0x4d')](_0x3e47e0,_0x10dafb)){if(_[_0x08a0('0x13')](this['variables'][_0x423d09])){this[_0x08a0('0xa')][_0x423d09]={};}this[_0x08a0('0xa')][_0x423d09][_0x10dafb]=_0x4f3092;}};VoiceDialReport[_0x08a0('0x11')][_0x08a0('0x4e')]=function(_0x52b433){try{if(this[_0x08a0('0x12')](_0x52b433)){logger[_0x08a0('0x16')](_0x08a0('0x4f'),_0x52b433[_0x08a0('0x18')],util[_0x08a0('0x19')](_0x52b433,{'showHidden':![],'depth':null}));if(this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]]){logger[_0x08a0('0x39')](_0x08a0('0x50'),_0x52b433['uniqueid'],_0x52b433['cause-txt']);this[_0x08a0('0x7')][_0x52b433['uniqueid']][_0x08a0('0x51')]=moment()['format'](_0x08a0('0x1c'));this[_0x08a0('0x7')][_0x52b433['uniqueid']][_0x08a0('0x52')]=moment(this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]]['endtime'])[_0x08a0('0x53')](this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]]['starttime'],_0x08a0('0x54'));this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]]['lastevent']='complete';this[_0x08a0('0x9')]['total']+=0x1;if(this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]][_0x08a0('0x2f')]){this[_0x08a0('0x9')][_0x08a0('0x55')]+=0x1;this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]][_0x08a0('0x56')]=moment(this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]]['answertime'])[_0x08a0('0x53')](this['channels'][_0x52b433[_0x08a0('0x18')]][_0x08a0('0x57')],'seconds');this[_0x08a0('0x7')][_0x52b433['uniqueid']][_0x08a0('0x58')]=moment(this['channels'][_0x52b433['uniqueid']][_0x08a0('0x51')])[_0x08a0('0x53')](this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]][_0x08a0('0x2f')],_0x08a0('0x54'));this[_0x08a0('0x9')]['sumHoldTime']+=this['channels'][_0x52b433[_0x08a0('0x18')]]['holdtime']||0x0;this['outbound']['sumBillable']+=this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]][_0x08a0('0x58')];}this[_0x08a0('0x9')][_0x08a0('0x59')]+=this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]][_0x08a0('0x52')];logger[_0x08a0('0x16')](_0x08a0('0x5a'),_0x52b433[_0x08a0('0x18')],util[_0x08a0('0x19')](this['channels'][_0x52b433['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x08a0('0x5b'),this[_0x08a0('0x7')][_0x52b433['uniqueid']]);logger[_0x08a0('0x16')](_0x08a0('0x5c'),_0x52b433['uniqueid'],util[_0x08a0('0x19')](this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]],{'showHidden':![],'depth':null}));ami['emit'](_0x08a0('0x5d'),this['channels'][_0x52b433[_0x08a0('0x18')]]);logger[_0x08a0('0x16')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x52b433['uniqueid'],util[_0x08a0('0x19')](this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]],{'showHidden':![],'depth':null}));this[_0x08a0('0x14')](_0x08a0('0x26'),_0x08a0('0x5e'),this[_0x08a0('0x9')]);logger[_0x08a0('0x39')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x08a0('0x5f')](this['channels'][_0x52b433[_0x08a0('0x18')]]));logger['debug'](_0x08a0('0x60'),_0x52b433[_0x08a0('0x18')],util[_0x08a0('0x19')](this['channels'][_0x52b433[_0x08a0('0x18')]],{'showHidden':![],'depth':null}));this[_0x08a0('0x14')]('voice:outbound',_0x08a0('0x61'),this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x18')]]);delete this['channels'][_0x52b433['uniqueid']];}else if(this['channels'][_0x52b433['linkedid']]){this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x62')]][_0x08a0('0x18')]=this[_0x08a0('0x7')][_0x52b433[_0x08a0('0x62')]][_0x08a0('0x63')];}if(this['variables'][_0x52b433[_0x08a0('0x18')]]){delete this[_0x08a0('0xa')][_0x52b433['uniqueid']];}}}catch(_0x2c422a){logger[_0x08a0('0x34')](_0x08a0('0x64'),_0x52b433['uniqueid'],util['inspect'](_0x2c422a,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x2040=['localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','privilege','info','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','dialstatus','ANSWER','connectedlinenum','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','YYYY-MM-DD\x20HH:mm:ss','duration','diff','starttime','seconds','total','answered','holdtime','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','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','lodash','moment','util','ioredis','ami','../ami','redis'];(function(_0x15fb5c,_0x2126b2){var _0x2e866a=function(_0x4c7aff){while(--_0x4c7aff){_0x15fb5c['push'](_0x15fb5c['shift']());}};_0x2e866a(++_0x2126b2);}(_0x2040,0xd3));var _0x0204=function(_0x17237a,_0x2164e8){_0x17237a=_0x17237a-0x0;var _0x5d1e40=_0x2040[_0x17237a];return _0x5d1e40;};'use strict';var _=require(_0x0204('0x0'));var moment=require(_0x0204('0x1'));var util=require(_0x0204('0x2'));var Redis=require(_0x0204('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0204('0x4'));var ami=require(_0x0204('0x5'));config[_0x0204('0x6')]=_['defaults'](config[_0x0204('0x6')],{'host':_0x0204('0x7'),'port':0x18eb});var io=require(_0x0204('0x8'))(new Redis(config[_0x0204('0x6')]));function VoiceDialReport(_0x1309cb){this[_0x0204('0x9')]=_0x1309cb[_0x0204('0xa')];this[_0x0204('0xb')]=_0x1309cb[_0x0204('0xb')];this[_0x0204('0xc')]={};ami['on']('dialbegin',this[_0x0204('0xd')]['bind'](this));ami['on'](_0x0204('0xe'),this[_0x0204('0xf')][_0x0204('0x10')](this));ami['on'](_0x0204('0x11'),this[_0x0204('0x12')][_0x0204('0x10')](this));ami['on'](_0x0204('0x13'),this[_0x0204('0x14')][_0x0204('0x10')](this));}VoiceDialReport['prototype'][_0x0204('0x15')]=function(_0x20d6a6){return _0x20d6a6!==null&&!_[_0x0204('0x16')](_0x20d6a6);};VoiceDialReport[_0x0204('0x17')]['emit']=function(_0x195ce5,_0xfe2d25,_0x3c281a){io['to'](_0x195ce5)[_0x0204('0x18')](_0xfe2d25,_0x3c281a);};VoiceDialReport[_0x0204('0x17')][_0x0204('0xd')]=function(_0x2cf53a){try{if(this[_0x0204('0x15')](_0x2cf53a)){logger[_0x0204('0x19')](_0x0204('0x1a'),_0x2cf53a[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x2cf53a,{'showHidden':![],'depth':null}));if(this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]]){_[_0x0204('0x1d')](this['channels'][_0x2cf53a['uniqueid']],{'starttime':moment()[_0x0204('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x0204('0x1f'),'interface':_0x2cf53a[_0x0204('0x20')][_0x0204('0x21')](0x0,_0x2cf53a['channel'][_0x0204('0x22')]('-')),'membername':_0x2cf53a[_0x0204('0x20')][_0x0204('0x21')](_0x2cf53a['channel'][_0x0204('0x22')]('/')+0x1,_0x2cf53a[_0x0204('0x20')][_0x0204('0x22')]('-'))},_[_0x0204('0x23')](_0x2cf53a,['event',_0x0204('0x24')]));logger[_0x0204('0x25')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x2cf53a[_0x0204('0x1b')],this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]]['membername'],this[_0x0204('0x9')][_0x2cf53a['uniqueid']][_0x0204('0x26')]);logger[_0x0204('0x19')](_0x0204('0x27'),_0x2cf53a[_0x0204('0x1b')],util['inspect'](this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this[_0x0204('0x18')](_0x0204('0x28'),'voice_outbound_channel:save',this[_0x0204('0x9')][_0x2cf53a[_0x0204('0x1b')]]);logger[_0x0204('0x19')](_0x0204('0x29'),_0x2cf53a[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x2cf53a['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x2a'),this['channels'][_0x2cf53a[_0x0204('0x1b')]]);}}}catch(_0x48b021){logger['error']('[%s][voiceDialReport][dialbegin]',_0x2cf53a[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x48b021,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0204('0x17')][_0x0204('0xf')]=function(_0x4a026e){try{if(this[_0x0204('0x15')](_0x4a026e)){logger[_0x0204('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x4a026e,{'showHidden':![],'depth':null}));if(this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]]){this['channels'][_0x4a026e['uniqueid']][_0x0204('0x2b')]=_0x4a026e[_0x0204('0x2b')];if(_0x4a026e[_0x0204('0x2b')]===_0x0204('0x2c')){this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]][_0x0204('0x2d')]=_0x4a026e[_0x0204('0x2d')];this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]]['connectedlinename']=_0x4a026e['connectedlinename'];this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]][_0x0204('0x2e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]][_0x0204('0x2f')]=_0x0204('0x30');logger[_0x0204('0x25')](_0x0204('0x31'),_0x4a026e['uniqueid'],_0x4a026e['channel']['substring'](_0x4a026e['channel'][_0x0204('0x22')]('/')+0x1,_0x4a026e[_0x0204('0x20')][_0x0204('0x22')]('-')));logger[_0x0204('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x32'),this['channels'][_0x4a026e['uniqueid']]);}logger['debug'](_0x0204('0x33'),_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](this['channels'][_0x4a026e['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x0204('0x34'),this[_0x0204('0x9')][_0x4a026e[_0x0204('0x1b')]]);}}}catch(_0x14d731){logger[_0x0204('0x35')](_0x0204('0x36'),_0x4a026e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x14d731,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0204('0x17')][_0x0204('0x12')]=function(_0x5d074e){try{if(this[_0x0204('0x15')](_0x5d074e)){logger[_0x0204('0x19')](_0x0204('0x37'),_0x5d074e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x5d074e,{'showHidden':![],'depth':null}));this[_0x0204('0x38')](_0x5d074e[_0x0204('0x1b')],_[_0x0204('0x39')](_0x5d074e[_0x0204('0x3a')])[0x0],_0x5d074e[_0x0204('0x3b')]);if(this[_0x0204('0x15')](_0x5d074e[_0x0204('0x3a')])&&this['isNotNull'](_0x5d074e['variable']['outboundrouteid'])){if(_[_0x0204('0x16')](this['channels'][_0x5d074e['uniqueid']])){this['channels'][_0x5d074e['uniqueid']]={'routeId':_0x5d074e[_0x0204('0x3b')],'variables':this['variables'][_0x5d074e[_0x0204('0x1b')]]};logger[_0x0204('0x25')](_0x0204('0x3c'),_0x5d074e[_0x0204('0x1b')],_0x5d074e[_0x0204('0x3a')][_0x0204('0x3d')],_['keys'](_0x5d074e[_0x0204('0x3a')])[0x0],_0x5d074e[_0x0204('0x3b')]);logger['debug'](_0x0204('0x3e'),_0x5d074e[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x5d074e[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this[_0x0204('0x18')](_0x0204('0x28'),_0x0204('0x34'),this[_0x0204('0x9')][_0x5d074e[_0x0204('0x1b')]]);}}}}catch(_0x4f5873){logger[_0x0204('0x35')](_0x0204('0x3f'),_0x5d074e[_0x0204('0x1b')],util[_0x0204('0x1c')](_0x4f5873,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0204('0x17')][_0x0204('0x38')]=function(_0xaf5161,_0x54c195,_0x28fefa){var _0x5a283c=[_0x0204('0x40'),_0x0204('0x41'),_0x0204('0x42'),_0x0204('0x43'),_0x0204('0x44'),_0x0204('0x45'),_0x0204('0x46'),_0x0204('0x47'),'sipcallid',_0x0204('0x48'),_0x0204('0x49'),_0x0204('0x4a'),'membercalls',_0x0204('0x4b'),_0x0204('0x4c'),_0x0204('0x4d'),'membername',_0x0204('0x4e'),_0x0204('0x4f')];if(!_[_0x0204('0x50')](_0x54c195)&&!_[_0x0204('0x51')](_0x5a283c,_0x54c195)){if(_[_0x0204('0x16')](this[_0x0204('0xc')][_0xaf5161])){this[_0x0204('0xc')][_0xaf5161]={};}this[_0x0204('0xc')][_0xaf5161][_0x54c195]=_0x28fefa;}};VoiceDialReport['prototype']['syncHangup']=function(_0x1c370c){try{if(this[_0x0204('0x15')](_0x1c370c)){logger[_0x0204('0x19')](_0x0204('0x52'),_0x1c370c['uniqueid'],util['inspect'](_0x1c370c,{'showHidden':![],'depth':null}));if(this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]){logger[_0x0204('0x25')](_0x0204('0x53'),_0x1c370c['uniqueid'],_0x1c370c[_0x0204('0x54')]);this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x55')]=moment()[_0x0204('0x1e')](_0x0204('0x56'));this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x57')]=moment(this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x55')])[_0x0204('0x58')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x59')],_0x0204('0x5a'));this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x2f')]='complete';this[_0x0204('0xb')][_0x0204('0x5b')]+=0x1;if(this[_0x0204('0x9')][_0x1c370c['uniqueid']][_0x0204('0x2e')]){this[_0x0204('0xb')][_0x0204('0x5c')]+=0x1;this['channels'][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x5d')]=moment(this[_0x0204('0x9')][_0x1c370c['uniqueid']]['answertime'])['diff'](this['channels'][_0x1c370c[_0x0204('0x1b')]]['starttime'],_0x0204('0x5a'));this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]['billableseconds']=moment(this[_0x0204('0x9')][_0x1c370c['uniqueid']][_0x0204('0x55')])[_0x0204('0x58')](this['channels'][_0x1c370c[_0x0204('0x1b')]][_0x0204('0x2e')],_0x0204('0x5a'));this[_0x0204('0xb')][_0x0204('0x5e')]+=this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]['holdtime']||0x0;this[_0x0204('0xb')][_0x0204('0x5f')]+=this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]['billableseconds'];}this[_0x0204('0xb')][_0x0204('0x60')]+=this[_0x0204('0x9')][_0x1c370c['uniqueid']][_0x0204('0x57')];logger[_0x0204('0x19')](_0x0204('0x61'),_0x1c370c[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x62'),this['channels'][_0x1c370c['uniqueid']]);logger[_0x0204('0x19')](_0x0204('0x63'),_0x1c370c['uniqueid'],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x0204('0x18')](_0x0204('0x64'),this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]);logger[_0x0204('0x19')](_0x0204('0x65'),_0x1c370c[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x0204('0x28'),_0x0204('0x66'),this[_0x0204('0xb')]);logger[_0x0204('0x25')](_0x0204('0x67'),JSON[_0x0204('0x68')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]]));logger[_0x0204('0x19')](_0x0204('0x69'),_0x1c370c[_0x0204('0x1b')],util[_0x0204('0x1c')](this[_0x0204('0x9')][_0x1c370c[_0x0204('0x1b')]],{'showHidden':![],'depth':null}));this[_0x0204('0x18')](_0x0204('0x28'),_0x0204('0x6a'),this['channels'][_0x1c370c[_0x0204('0x1b')]]);delete this['channels'][_0x1c370c[_0x0204('0x1b')]];}else if(this[_0x0204('0x9')][_0x1c370c[_0x0204('0x6b')]]){this[_0x0204('0x9')][_0x1c370c[_0x0204('0x6b')]][_0x0204('0x1b')]=this[_0x0204('0x9')][_0x1c370c['linkedid']][_0x0204('0x6c')];}if(this[_0x0204('0xc')][_0x1c370c[_0x0204('0x1b')]]){delete this[_0x0204('0xc')][_0x1c370c[_0x0204('0x1b')]];}}}catch(_0x47ad8c){logger[_0x0204('0x35')]('[%s][voiceDialReport][hangup]',_0x1c370c['uniqueid'],util[_0x0204('0x1c')](_0x47ad8c,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
index 4858ecd..50ad996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2475=['strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','total','Trunk','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','loopQueueShow','clearZombieChannels','queues','catch','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','type','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','info','pick','keys','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandon','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','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','CONTINUE','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','variables','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','length','abandoned','diff','milliseconds','lastevent','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][hangup]','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','lodash','moment','util','md5','../../../config/logger','../ami','../model/queueReport','redis','defaults','localhost','prototype','enqueue','tail','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','switch','sequence','isNil','Action','status','channel','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','name','voice_queue_channel:save','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','inbound'];(function(_0x22083b,_0x429171){var _0x183da1=function(_0x1d97bf){while(--_0x1d97bf){_0x22083b['push'](_0x22083b['shift']());}};_0x183da1(++_0x429171);}(_0x2475,0x95));var _0x5247=function(_0x92dc92,_0x54f7e6){_0x92dc92=_0x92dc92-0x0;var _0x273f36=_0x2475[_0x92dc92];return _0x273f36;};'use strict';var _=require(_0x5247('0x0'));var moment=require(_0x5247('0x1'));var util=require(_0x5247('0x2'));var md5=require(_0x5247('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x5247('0x4'))('ami');var ami=require(_0x5247('0x5'));var QueueReport=require(_0x5247('0x6'));config[_0x5247('0x7')]=_[_0x5247('0x8')](config[_0x5247('0x7')],{'host':_0x5247('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5247('0x7')]));var Sequence=function(){};Sequence[_0x5247('0xa')][_0x5247('0xb')]=function(_0x555426){this[_0x5247('0xc')]=this[_0x5247('0xc')]?this[_0x5247('0xc')]['finally'](_0x555426):_0x555426();};function VoiceQueueReport(_0x34d837){this['sequence']=new Sequence();this[_0x5247('0xd')]={};this[_0x5247('0xe')]=_0x34d837['agents'];this[_0x5247('0xf')]=_0x34d837[_0x5247('0x10')];this[_0x5247('0x11')]=_0x34d837[_0x5247('0x11')];this[_0x5247('0x12')]=!![];this[_0x5247('0x13')]=_0x34d837[_0x5247('0x13')];this['variables']={};ami['on'](_0x5247('0x14'),this[_0x5247('0x15')][_0x5247('0x16')](this));ami['on'](_0x5247('0x17'),this[_0x5247('0x18')][_0x5247('0x16')](this));ami['on'](_0x5247('0x19'),this[_0x5247('0x1a')][_0x5247('0x16')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x5247('0x16')](this));ami['on'](_0x5247('0x1b'),this[_0x5247('0x1c')][_0x5247('0x16')](this));ami['on'](_0x5247('0x1d'),this['syncAgentComplete'][_0x5247('0x16')](this));ami['on'](_0x5247('0x1e'),this[_0x5247('0x1f')]['bind'](this));ami['on'](_0x5247('0x20'),this[_0x5247('0x21')]['bind'](this));ami['on']('hangup',this[_0x5247('0x22')][_0x5247('0x16')](this));ami['on'](_0x5247('0x23'),this[_0x5247('0x24')]['bind'](this));ami['on'](_0x5247('0x25'),this[_0x5247('0x26')]['bind'](this));ami['on'](_0x5247('0x27'),this[_0x5247('0x28')][_0x5247('0x16')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0x5247('0x29')]();this['loopQueueShow']();}function clearChannels(_0x2cc668){if(!_[_0x5247('0x2a')](_0x2cc668)){for(var _0x3db0ad in _0x2cc668){if(_0x2cc668[_0x5247('0x2b')](_0x3db0ad)){delete _0x2cc668[_0x3db0ad];}}}}function clearCampaigns(_0x2ac138){if(!_['isEmpty'](_0x2ac138)){for(var _0x5d96f0 in _0x2ac138){if(_0x2ac138['hasOwnProperty'](_0x5d96f0)){_0x2ac138[_0x5d96f0][_0x5247('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x461035){if(!_[_0x5247('0x2a')](_0x461035)){for(var _0x385d7f in _0x461035){if(_0x461035[_0x5247('0x2b')](_0x385d7f)){_0x461035[_0x385d7f]['originated']=0x0;_0x461035[_0x385d7f][_0x5247('0x2d')]=0x0;_0x461035[_0x385d7f]['pTalking']=0x0;_0x461035[_0x385d7f][_0x5247('0x2e')]=0x0;_0x461035[_0x385d7f][_0x5247('0x2f')]=!![];}}}}function clearAgentBooked(_0x38cd14){if(!_[_0x5247('0x2a')](_0x38cd14)){for(var _0x554524 in _0x38cd14){if(_0x38cd14['hasOwnProperty'](_0x554524)){_0x38cd14[_0x554524][_0x5247('0x30')]=!![];}}}}VoiceQueueReport[_0x5247('0xa')]['clearZombieChannels']=function(){var _0x5ceb30=this;for(var _0x4f24fb in this[_0x5247('0xf')]){if(this[_0x5247('0xf')][_0x5247('0x2b')](_0x4f24fb)&&!this['channels'][_0x4f24fb][_0x5247('0x31')]){this[_0x5247('0x32')][_0x5247('0xb')](function(){if(!_[_0x5247('0x33')](_0x5ceb30[_0x5247('0xf')][_0x4f24fb])){return ami[_0x5247('0x34')]({'action':_0x5247('0x35'),'channel':_0x5ceb30[_0x5247('0xf')][_0x4f24fb][_0x5247('0x36')]})['catch'](function(_0x58795d){if(_0x58795d[_0x5247('0x37')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5ceb30[_0x5247('0xf')][_0x4f24fb]){delete _0x5ceb30[_0x5247('0xf')][_0x4f24fb];logger[_0x5247('0x38')](_0x5247('0x39'),_0x4f24fb,util[_0x5247('0x3a')](_0x58795d,{'showHidden':![],'depth':null}));}if(_0x5ceb30['queueReports'][_0x4f24fb]){delete _0x5ceb30['queueReports'][_0x4f24fb];logger[_0x5247('0x38')](_0x5247('0x3b'),_0x4f24fb,util[_0x5247('0x3a')](_0x58795d,{'showHidden':![],'depth':null}));}if(_0x5ceb30['variables'][_0x4f24fb]){delete _0x5ceb30['variables'][_0x4f24fb];logger[_0x5247('0x38')](_0x5247('0x3c'),_0x4f24fb,util[_0x5247('0x3a')](_0x58795d,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0x5247('0x38')](_0x5247('0x3d'));clearChannels(this['channels']);this[_0x5247('0x3e')](this[_0x5247('0xd')]);clearAgentBooked(this[_0x5247('0xe')]);clearVoiceQueues(this[_0x5247('0x11')]);clearCampaigns(this[_0x5247('0x13')]);};VoiceQueueReport['prototype'][_0x5247('0x3e')]=function(_0x4640e5){var _0x47ae1f=this;if(!_[_0x5247('0x2a')](_0x4640e5)){for(var _0x448383 in _0x4640e5){if(_0x4640e5[_0x5247('0x2b')](_0x448383)){_0x47ae1f[_0x5247('0x3f')](_0x4640e5[_0x448383],_0x5247('0x40'));delete _0x4640e5[_0x448383];}}}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x41')]=function(_0x1c19ff,_0x25340c,_0x76defb){io['to'](_0x1c19ff)[_0x5247('0x41')](_0x25340c,_0x76defb);};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x42')]=function(_0x476f6f,_0x1ff904){logger[_0x5247('0x43')]('[%s][voiceQueueReport]['+_0x1ff904+_0x5247('0x44'),_0x476f6f[_0x5247('0x45')],util[_0x5247('0x3a')](_0x476f6f,{'showHidden':![],'depth':null}));this['emit'](util[_0x5247('0x46')]('voice:queue:%s',_0x476f6f[_0x5247('0x47')]),_0x5247('0x48'),_0x476f6f);io[_0x5247('0x41')](_0x5247('0x49'),_0x476f6f);};VoiceQueueReport['prototype'][_0x5247('0x3f')]=function(_0x123d2b,_0x131b99){logger[_0x5247('0x43')](_0x5247('0x4a')+_0x131b99+_0x5247('0x4b'),_0x123d2b[_0x5247('0x45')],util[_0x5247('0x3a')](_0x123d2b,{'showHidden':![],'depth':null}));this['emit'](util[_0x5247('0x46')](_0x5247('0x4c'),_0x123d2b['name']),_0x5247('0x4d'),_0x123d2b);io['emit'](_0x5247('0x4e'),_0x123d2b);};VoiceQueueReport[_0x5247('0xa')]['emitVoiceQueueSummary']=function(_0x2759fc,_0x9acca1){if(_0x2759fc['type']===_0x5247('0x4f')){var _0x561ec3={'id':_0x2759fc['id'],'name':_0x2759fc[_0x5247('0x47')],'strategy':_0x2759fc[_0x5247('0x50')],'answered':_0x2759fc[_0x5247('0x51')],'available':_0x2759fc[_0x5247('0x52')],'loggedIn':_0x2759fc['loggedIn'],'pTalking':_0x2759fc[_0x5247('0x53')],'sumBillable':_0x2759fc[_0x5247('0x54')],'sumDuration':_0x2759fc[_0x5247('0x55')],'sumHoldTime':_0x2759fc[_0x5247('0x56')]||0x0,'talking':_0x2759fc[_0x5247('0x2d')],'total':_0x2759fc[_0x5247('0x57')],'type':_0x2759fc['type'],'unmanaged':_0x2759fc['unmanaged'],'abandoned':_0x2759fc['abandoned'],'waiting':_0x2759fc[_0x5247('0x2e')]};if(_0x2759fc['Trunk']){_0x561ec3[_0x5247('0x58')]={'id':_0x2759fc[_0x5247('0x58')]['id'],'name':_0x2759fc[_0x5247('0x58')][_0x5247('0x47')],'active':_0x2759fc[_0x5247('0x58')]['active'],'callerid':_0x2759fc[_0x5247('0x58')][_0x5247('0x59')]};}if(_0x2759fc['Interval']){_0x561ec3[_0x5247('0x5a')]={'id':_0x2759fc[_0x5247('0x5a')]['id'],'name':_0x2759fc['Interval'][_0x5247('0x47')]};}var _0x262c00=md5(JSON[_0x5247('0x5b')](_0x561ec3));if(_0x2759fc[_0x5247('0x3')]!==_0x262c00){_0x2759fc[_0x5247('0x3')]=_0x262c00;logger['debug'](_0x5247('0x5c')+_0x9acca1+_0x5247('0x5d'),util[_0x5247('0x3a')](_0x561ec3,{'showHidden':![],'depth':null}));this[_0x5247('0x41')](util[_0x5247('0x46')]('voice:queue:%s',_0x561ec3[_0x5247('0x47')]),_0x5247('0x5e'),_0x561ec3);}}};VoiceQueueReport['prototype']['isNotNull']=function(_0x598e46){return _0x598e46!==null&&!_[_0x5247('0x5f')](_0x598e46);};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x60')]=function(){var _0x3650bf=this;setInterval(function(){_0x3650bf[_0x5247('0x61')]();ami['Action']({'action':_0x5247('0x62')})[_0x5247('0x63')](function(_0x10e5dd){logger[_0x5247('0x38')](_0x5247('0x64'),util[_0x5247('0x3a')](_0x10e5dd,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x29')]=function(){var _0x1fbdf0=this;setInterval(function(){if(_0x1fbdf0[_0x5247('0x12')]){return ami[_0x5247('0x34')]({'action':'queuesummary'})[_0x5247('0x65')](function(_0x3012cc){_0x1fbdf0['flagQueueSummary']=![];})[_0x5247('0x63')](function(_0x16a06d){logger[_0x5247('0x38')](_0x5247('0x66'),util[_0x5247('0x3a')](_0x16a06d,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x15')]=function(_0x8a6bc5){try{if(this[_0x5247('0x67')](_0x8a6bc5)&&this[_0x5247('0x67')](_0x8a6bc5[_0x5247('0x68')])){logger['debug'](_0x5247('0x69'),util['inspect'](_0x8a6bc5,{'showHidden':![],'depth':null}));if(this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]]){logger['info'](_0x5247('0x6a'),_0x8a6bc5[_0x5247('0x68')]);var _0xf82407=_['countBy'](this['channels'],'queue')[_0x8a6bc5[_0x5247('0x68')]]||0x0;var _0x2596a9=_0xf82407-_0x8a6bc5[_0x5247('0x6b')];if(this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x2e')]!==_[_0x5247('0x6c')](_0x8a6bc5['callers'])||this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]]['loggedIn']!==_[_0x5247('0x6c')](_0x8a6bc5[_0x5247('0x6d')])||this['voiceQueues'][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x52')]!==_[_0x5247('0x6c')](_0x8a6bc5[_0x5247('0x52')])||this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x2d')]!==_0x2596a9){this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]]['waiting']=_['toNumber'](_0x8a6bc5[_0x5247('0x6b')]);this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]]['loggedIn']=_[_0x5247('0x6c')](_0x8a6bc5[_0x5247('0x6d')]);this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x52')]=_['toNumber'](_0x8a6bc5[_0x5247('0x52')]);this['voiceQueues'][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x2d')]=_0x2596a9>0x0?_0x2596a9:0x0;this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x2d')]=this['voiceQueues'][_0x8a6bc5[_0x5247('0x68')]][_0x5247('0x2d')]>_[_0x5247('0x6c')](_0x8a6bc5['loggedin'])?_[_0x5247('0x6c')](_0x8a6bc5[_0x5247('0x6d')]):this[_0x5247('0x11')][_0x8a6bc5['queue']][_0x5247('0x2d')];this['emitVoiceQueueSummary'](this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]],_0x5247('0x14'));}logger[_0x5247('0x43')](_0x5247('0x6e'),util[_0x5247('0x3a')](this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]],{'showHidden':![],'depth':null}));ami[_0x5247('0x41')]('custom:queuesummary',this[_0x5247('0x11')][_0x8a6bc5[_0x5247('0x68')]]);}}}catch(_0x1f34c4){logger[_0x5247('0x38')](_0x5247('0x66'),util['inspect'](_0x1f34c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x18')]=function(_0x10c4c2){logger[_0x5247('0x43')](_0x5247('0x6f'),util['inspect'](_0x10c4c2,{'showHidden':![],'depth':null}));this[_0x5247('0x12')]=!![];};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x1a')]=function(_0x21d55f){try{if(this[_0x5247('0x67')](_0x21d55f)){logger[_0x5247('0x43')]('[%s][voiceQueueReport][queuecallerjoin]',_0x21d55f[_0x5247('0x45')],util[_0x5247('0x3a')](_0x21d55f,{'showHidden':![],'depth':null}));if(_[_0x5247('0x5f')](this[_0x5247('0xd')][_0x21d55f[_0x5247('0x45')]])){this['queueReports'][_0x21d55f[_0x5247('0x45')]]=[];this[_0x5247('0xf')][_0x21d55f['uniqueid']]={};}var _0x555937=new QueueReport();_0x555937[_0x5247('0x47')]=_0x21d55f[_0x5247('0x68')];_0x555937[_0x5247('0x70')]=this['voiceQueues'][_0x555937[_0x5247('0x47')]]&&this[_0x5247('0x11')][_0x555937[_0x5247('0x47')]][_0x5247('0x70')]?this['voiceQueues'][_0x555937[_0x5247('0x47')]][_0x5247('0x70')]||_0x5247('0x4f'):_0x5247('0x4f');_0x555937[_0x5247('0x68')]=_0x21d55f['queue'];_0x555937[_0x5247('0x71')]=moment()[_0x5247('0x46')](_0x5247('0x72'));_0x555937[_0x5247('0x73')]=_0x21d55f[_0x5247('0x73')];_0x555937[_0x5247('0x74')]=_0x21d55f[_0x5247('0x74')];_0x555937[_0x5247('0x45')]=_0x21d55f[_0x5247('0x45')];logger[_0x5247('0x75')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x555937[_0x5247('0x47')],_0x555937[_0x5247('0x70')]);_['merge'](_0x555937,_[_0x5247('0x76')](_0x21d55f,_[_0x5247('0x77')](_0x555937)));this[_0x5247('0xd')][_0x21d55f[_0x5247('0x45')]]['push'](_0x555937);this['channels'][_0x21d55f[_0x5247('0x45')]]=_0x555937;this[_0x5247('0x42')](_0x555937,_0x5247('0x19'));}}catch(_0x437534){logger[_0x5247('0x38')](_0x5247('0x78'),_0x21d55f[_0x5247('0x45')],util[_0x5247('0x3a')](_0x437534,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x458bcb){try{if(this[_0x5247('0x67')](_0x458bcb)){logger['debug'](_0x5247('0x79'),_0x458bcb[_0x5247('0x45')],util[_0x5247('0x3a')](_0x458bcb,{'showHidden':![],'depth':null}));if(this[_0x5247('0xd')][_0x458bcb[_0x5247('0x45')]]){var _0x3552a0=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x458bcb[_0x5247('0x45')]]);_0x3552a0['queuecallercomplete']=![];_0x3552a0[_0x5247('0x7b')]=null;_0x3552a0[_0x5247('0x7c')]=_0x458bcb[_0x5247('0x7c')];_0x3552a0['originalposition']=_0x458bcb[_0x5247('0x7d')];_0x3552a0['queuecallerabandon']=!![];_0x3552a0[_0x5247('0x7e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3552a0[_0x5247('0x7f')]=_0x5247('0x80');_0x3552a0[_0x5247('0x81')]=null;logger[_0x5247('0x75')](_0x5247('0x82'),_0x3552a0[_0x5247('0x47')],_0x3552a0[_0x5247('0x70')]);this[_0x5247('0xf')][_0x458bcb[_0x5247('0x45')]]=_0x3552a0;this[_0x5247('0x3f')](_0x3552a0,'queuecallerabandon');}}}catch(_0x290c11){logger[_0x5247('0x38')](_0x5247('0x79'),_0x458bcb[_0x5247('0x45')],util[_0x5247('0x3a')](_0x290c11,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x1c')]=function(_0x16a02e){try{if(this[_0x5247('0x67')](_0x16a02e)){logger[_0x5247('0x43')]('[%s][voiceQueueReport][queuecallerleave]',_0x16a02e[_0x5247('0x45')],util[_0x5247('0x3a')](_0x16a02e,{'showHidden':![],'depth':null}));if(this[_0x5247('0xd')][_0x16a02e[_0x5247('0x45')]]){var _0x518177=_['last'](this[_0x5247('0xd')][_0x16a02e[_0x5247('0x45')]]);_0x518177[_0x5247('0x83')]=moment()[_0x5247('0x46')](_0x5247('0x72'));_0x518177[_0x5247('0x84')]=_0x16a02e[_0x5247('0x84')];_0x518177[_0x5247('0x85')]=_0x16a02e[_0x5247('0x85')];logger[_0x5247('0x75')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x518177['name'],_0x518177[_0x5247('0x70')],_0x16a02e[_0x5247('0x84')],_0x16a02e[_0x5247('0x85')]);this[_0x5247('0xf')][_0x16a02e[_0x5247('0x45')]]=_0x518177;this[_0x5247('0x42')](_0x518177,_0x5247('0x1b'));}}}catch(_0x3cecd0){logger[_0x5247('0x38')](_0x5247('0x86'),_0x16a02e[_0x5247('0x45')],util[_0x5247('0x3a')](_0x3cecd0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')]['syncAgentConnect']=function(_0x48cba5){try{if(this[_0x5247('0x67')](_0x48cba5)){logger[_0x5247('0x43')](_0x5247('0x87'),_0x48cba5[_0x5247('0x45')],util[_0x5247('0x3a')](_0x48cba5,{'showHidden':![],'depth':null}));if(this[_0x5247('0xd')][_0x48cba5[_0x5247('0x45')]]){var _0x2109f5=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x48cba5[_0x5247('0x45')]]);_0x2109f5['queuecallercomplete']=!![];_0x2109f5[_0x5247('0x7f')]=_0x5247('0x88');logger[_0x5247('0x75')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x2109f5[_0x5247('0x47')],_0x2109f5[_0x5247('0x70')]);}}}catch(_0xe40786){logger['error'](_0x5247('0x87'),_0x48cba5[_0x5247('0x45')],util[_0x5247('0x3a')](_0xe40786,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')]['syncAgentComplete']=function(_0x1d4edd){try{if(this['isNotNull'](_0x1d4edd)){logger['debug'](_0x5247('0x89'),_0x1d4edd[_0x5247('0x45')],util[_0x5247('0x3a')](_0x1d4edd,{'showHidden':![],'depth':null}));if(this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x45')]]){var _0x589d3b=_['last'](this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x45')]]);_0x589d3b[_0x5247('0x8a')]=![];_0x589d3b['queuecallerabandonAt']=null;_0x589d3b[_0x5247('0x8b')]=!![];_0x589d3b[_0x5247('0x81')]=_0x1d4edd[_0x5247('0x8c')];_0x589d3b[_0x5247('0x7c')]=_0x1d4edd[_0x5247('0x7c')];_0x589d3b[_0x5247('0x8d')]=!![];_0x589d3b[_0x5247('0x8e')]=![];_0x589d3b[_0x5247('0x8f')]=null;if(!_0x589d3b[_0x5247('0x90')]){if(_0x1d4edd[_0x5247('0x91')]==_0x5247('0x90')){_0x589d3b[_0x5247('0x7f')]=_0x5247('0x92');logger[_0x5247('0x75')](_0x5247('0x93'),_0x589d3b[_0x5247('0x47')],_0x589d3b[_0x5247('0x70')]);}else{if(_[_0x5247('0x94')](_0x1d4edd[_0x5247('0x36')][_0x5247('0x95')](),_0x5247('0x96'))){if(this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x97')]]){var _0x4c456c=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x97')]]);_0x4c456c[_0x5247('0x8d')]=![];_0x4c456c[_0x5247('0x8e')]=!![];_0x4c456c['queuecallerexitAt']=moment(_0x589d3b[_0x5247('0x71')])[_0x5247('0x98')](_0x1d4edd['holdtime'],_0x5247('0x99'))[_0x5247('0x46')](_0x5247('0x72'));_0x4c456c['queuecallerexitreason']=_0x5247('0x9a');_0x4c456c[_0x5247('0x90')]=!![];_0x4c456c[_0x5247('0x9b')]=_0x5247('0x9c');_0x4c456c[_0x5247('0x9d')]=_0x1d4edd[_0x5247('0x9e')];_0x4c456c['transferuniqueid']=_0x1d4edd[_0x5247('0x45')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4c456c['name'],_0x4c456c[_0x5247('0x70')]);var _0x475193=this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x97')]];this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x97')]]=this[_0x5247('0xd')][_0x1d4edd[_0x5247('0x45')]];this[_0x5247('0xd')][_0x1d4edd['uniqueid']]=_0x475193;}}else{_0x589d3b['queuecallerexitreason']='COMPLETEDBY'+_0x1d4edd[_0x5247('0x91')][_0x5247('0x9f')]();logger['info'](_0x5247('0xa0'),_0x589d3b['name'],_0x589d3b[_0x5247('0x70')],_0x589d3b[_0x5247('0x7f')]);}}}this[_0x5247('0xf')][_0x1d4edd[_0x5247('0x45')]]=_0x589d3b;this[_0x5247('0x3f')](_0x589d3b,_0x5247('0x1d'));}}}catch(_0xdf8d53){logger['error'](_0x5247('0x89'),_0x1d4edd[_0x5247('0x45')],util[_0x5247('0x3a')](_0xdf8d53,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5247('0x21')]=function(_0x18598a){try{if(this['isNotNull'](_0x18598a)){logger['debug'](_0x5247('0xa1'),_0x18598a[_0x5247('0x45')],util['inspect'](_0x18598a,{'showHidden':![],'depth':null}));this[_0x5247('0xa2')](_0x18598a[_0x5247('0x45')],_[_0x5247('0x77')](_0x18598a['variable'])[0x0],_0x18598a[_0x5247('0xa3')]);if(this[_0x5247('0xd')][_0x18598a[_0x5247('0x45')]]){var _0x269c3a=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x18598a[_0x5247('0x45')]]);if(_0x269c3a){if(this[_0x5247('0x67')](_0x18598a['variable'])&&this[_0x5247('0x67')](_0x18598a[_0x5247('0xa4')][_0x5247('0xa5')])){switch(_0x18598a[_0x5247('0xa3')]){case _0x5247('0xa6'):_0x269c3a[_0x5247('0x8e')]=![];_0x269c3a['queuecallerexitAt']=null;break;case'TIMEOUT':_0x269c3a['lastevent']=_0x5247('0xa7');_0x269c3a[_0x5247('0x8e')]=!![];_0x269c3a[_0x5247('0x8f')]=moment()[_0x5247('0x46')](_0x5247('0x72'));_0x269c3a['queuecallerleaveAt']=moment()['format'](_0x5247('0x72'));logger[_0x5247('0x43')](_0x5247('0xa8'),_0x18598a[_0x5247('0x45')],util[_0x5247('0x3a')](_0x269c3a,{'showHidden':![],'depth':null}));ami[_0x5247('0x41')](_0x5247('0xa9'),_0x269c3a);break;default:_0x269c3a[_0x5247('0x8e')]=!![];_0x269c3a['queuecallerexitAt']=moment()[_0x5247('0x46')](_0x5247('0x72'));_0x269c3a[_0x5247('0x83')]=moment()[_0x5247('0x46')](_0x5247('0x72'));}_0x269c3a[_0x5247('0x8a')]=![];_0x269c3a[_0x5247('0x7e')]=null;_0x269c3a[_0x5247('0x7f')]=_0x18598a[_0x5247('0xa3')];this['channels'][_0x18598a['uniqueid']]=_0x269c3a;this[_0x5247('0x3f')](_0x269c3a,_0x5247('0x20'));}else if(this[_0x5247('0x67')](_0x18598a[_0x5247('0xa4')])&&this['isNotNull'](_0x18598a[_0x5247('0xa4')][_0x5247('0xaa')])){if(!_0x269c3a[_0x5247('0x8a')]){_0x269c3a[_0x5247('0x8e')]=!![];_0x269c3a[_0x5247('0x8f')]=moment()[_0x5247('0x46')](_0x5247('0x72'));_0x269c3a[_0x5247('0x7f')]='EXITWITHKEY';_0x269c3a[_0x5247('0x83')]=moment()['format'](_0x5247('0x72'));this[_0x5247('0xf')][_0x18598a[_0x5247('0x45')]]=_0x269c3a;}}logger['info'](_0x5247('0xab'),_0x18598a[_0x5247('0x45')],_0x269c3a[_0x5247('0x47')],_0x269c3a['type'],_[_0x5247('0x77')](_0x18598a['variable'])[0x0],_0x18598a[_0x5247('0xa3')]);_0x269c3a[_0x5247('0xac')]=this['variables'][_0x18598a[_0x5247('0x45')]];}}}}catch(_0x20eaf0){logger[_0x5247('0x38')](_0x5247('0xa1'),_0x18598a[_0x5247('0x45')],util[_0x5247('0x3a')](_0x20eaf0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0xa2')]=function(_0x20c32b,_0x383410,_0x1c719d){var _0x38403d=[_0x5247('0xad'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x5247('0xae'),_0x5247('0xaf'),_0x5247('0xb0'),_0x5247('0xb1'),_0x5247('0xb2'),_0x5247('0xb3'),_0x5247('0xb4'),_0x5247('0xb5'),_0x5247('0xb6'),_0x5247('0xb7'),_0x5247('0xb8'),_0x5247('0xb9'),_0x5247('0xba'),_0x5247('0x8c'),'memberpenalty',_0x5247('0xbb')];if(!_[_0x5247('0x33')](_0x383410)&&!_[_0x5247('0xbc')](_0x38403d,_0x383410)){if(_[_0x5247('0x5f')](this[_0x5247('0xac')][_0x20c32b])){this[_0x5247('0xac')][_0x20c32b]={};}this[_0x5247('0xac')][_0x20c32b][_0x383410]=_0x1c719d;}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x22')]=function(_0x17afae){try{if(this[_0x5247('0x67')](_0x17afae)){logger[_0x5247('0x43')]('[%s][voiceQueueReport][hangup]',_0x17afae[_0x5247('0x45')],util[_0x5247('0x3a')](_0x17afae,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x17afae[_0x5247('0x45')]]){for(var _0x4a6cea=0x0,_0x11dc10={};_0x4a6cea<this[_0x5247('0xd')][_0x17afae[_0x5247('0x45')]][_0x5247('0xbd')];_0x4a6cea+=0x1){_0x11dc10=this[_0x5247('0xd')][_0x17afae[_0x5247('0x45')]][_0x4a6cea];if(this[_0x5247('0x11')][_0x11dc10['queue']]){if(_0x11dc10['queuecallerexit']&&_0x11dc10[_0x5247('0x90')]!=!![]){this['voiceQueues'][_0x11dc10[_0x5247('0x68')]]['unmanaged']+=0x1;}if(_0x11dc10['queuecallerabandon']){this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]][_0x5247('0xbe')]+=0x1;}this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]][_0x5247('0x56')]+=moment(_0x11dc10[_0x5247('0x83')])[_0x5247('0xbf')](_0x11dc10['queuecallerjoinAt'],'seconds')||0x0;if(_0x4a6cea===this[_0x5247('0xd')][_0x17afae[_0x5247('0x45')]][_0x5247('0xbd')]-0x1){this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]][_0x5247('0x55')]+=moment()[_0x5247('0xc0')](0x0)[_0x5247('0xbf')](_0x11dc10[_0x5247('0x71')],_0x5247('0x99'));this[_0x5247('0x11')][_0x11dc10['queue']]['total']+=0x1;if(_0x11dc10[_0x5247('0x8d')]){this['voiceQueues'][_0x11dc10['queue']]['answered']+=0x1;this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]][_0x5247('0x54')]+=moment()[_0x5247('0xc0')](0x0)[_0x5247('0xbf')](_0x11dc10['queuecallerleaveAt'],_0x5247('0x99'));_0x11dc10[_0x5247('0x7b')]=moment()[_0x5247('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x11dc10[_0x5247('0x8e')]=![];_0x11dc10[_0x5247('0x8f')]=null;}if(_0x11dc10[_0x5247('0x8e')]&&_0x11dc10[_0x5247('0x90')]!=!![]){_0x11dc10[_0x5247('0xc1')]=_0x5247('0xc2');logger[_0x5247('0x43')](_0x5247('0xc3'),_0x17afae[_0x5247('0x45')],util[_0x5247('0x3a')](_0x11dc10,{'showHidden':![],'depth':null}));ami['emit'](_0x5247('0xc4'),_0x11dc10);}if(_0x11dc10[_0x5247('0x8a')]){_0x11dc10['lastevent']=_0x5247('0xbe');logger[_0x5247('0x43')](_0x5247('0xc5'),_0x17afae[_0x5247('0x45')],util[_0x5247('0x3a')](_0x11dc10,{'showHidden':![],'depth':null}));ami[_0x5247('0x41')](_0x5247('0xc6'),_0x11dc10);}}else{this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]][_0x5247('0x55')]+=this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]][_0x5247('0x56')];}logger[_0x5247('0x75')](_0x5247('0xc7'),_0x17afae[_0x5247('0x45')],_0x11dc10[_0x5247('0x47')],_0x11dc10['type'],_0x17afae[_0x5247('0xc8')]);this[_0x5247('0xf')][_0x17afae[_0x5247('0x45')]]=_0x11dc10;this[_0x5247('0x3f')](_0x11dc10,'hangup');this['emitVoiceQueueSummary'](this[_0x5247('0x11')][_0x11dc10[_0x5247('0x68')]],_0x5247('0xc9'));}}logger['debug'](_0x5247('0xca'),_0x17afae[_0x5247('0x45')],util[_0x5247('0x3a')](this[_0x5247('0xd')][_0x17afae[_0x5247('0x45')]],{'showHidden':![],'depth':null}));ami[_0x5247('0x41')]('custom:voiceQueueReport',this[_0x5247('0xd')][_0x17afae['uniqueid']]);delete this['queueReports'][_0x17afae[_0x5247('0x45')]];delete this[_0x5247('0xf')][_0x17afae[_0x5247('0x45')]];}if(this['variables'][_0x17afae[_0x5247('0x45')]]){delete this[_0x5247('0xac')][_0x17afae['uniqueid']];}}}catch(_0x28a168){logger[_0x5247('0x38')](_0x5247('0xcb'),_0x17afae['uniqueid'],util[_0x5247('0x3a')](_0x28a168,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0xcc')]=function(_0x33ef99){try{if(this[_0x5247('0x67')](_0x33ef99)){logger[_0x5247('0x43')](_0x5247('0xcd'),_0x33ef99[_0x5247('0x45')],util[_0x5247('0x3a')](_0x33ef99,{'showHidden':![],'depth':null}));var _0x3bcf2b;if(this['queueReports'][_0x33ef99[_0x5247('0xce')]]){_0x3bcf2b=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x33ef99[_0x5247('0xce')]]);_0x3bcf2b[_0x5247('0x9d')]=_0x33ef99[_0x5247('0xcf')];_0x3bcf2b[_0x5247('0xd0')]=_0x33ef99[_0x5247('0xd1')];_0x3bcf2b['queuecallerexitreason']=_0x5247('0xd2');_0x3bcf2b[_0x5247('0x90')]=!![];_0x3bcf2b[_0x5247('0x9b')]=_0x5247('0xd3');if(this[_0x5247('0xd')][_0x33ef99[_0x5247('0xd1')]]){var _0x34cbf7=this['queueReports'][_0x33ef99[_0x5247('0xd1')]];this[_0x5247('0xd')][_0x33ef99[_0x5247('0xd1')]]=this[_0x5247('0xd')][_0x33ef99[_0x5247('0xce')]];this[_0x5247('0xd')][_0x33ef99[_0x5247('0xce')]]=_0x34cbf7;var _0x4f1548=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x33ef99['transfereeuniqueid']]);_0x4f1548[_0x5247('0x31')]=!![];}logger['info'](_0x5247('0xd4'),_0x33ef99['uniqueid'],_0x3bcf2b[_0x5247('0x47')],_0x3bcf2b[_0x5247('0x70')],_0x3bcf2b['transferexten'],_0x3bcf2b[_0x5247('0xd0')]);}else if(this[_0x5247('0xd')][_0x33ef99['transfertargetuniqueid']]){_0x3bcf2b=_['last'](this[_0x5247('0xd')][_0x33ef99[_0x5247('0xd5')]]);_0x3bcf2b['transferexten']=_0x33ef99[_0x5247('0xd6')];_0x3bcf2b['transferuniqueid']=_0x33ef99[_0x5247('0xd7')];_0x3bcf2b['queuecallerexitreason']=_0x5247('0xd2');_0x3bcf2b[_0x5247('0x90')]=!![];_0x3bcf2b[_0x5247('0x9b')]=_0x5247('0xd3');if(this[_0x5247('0xd')][_0x33ef99[_0x5247('0xd7')]]){var _0x34cbf7=this['queueReports'][_0x33ef99['origtransfereruniqueid']];this[_0x5247('0xd')][_0x33ef99[_0x5247('0xd7')]]=this['queueReports'][_0x33ef99[_0x5247('0xd5')]];this['queueReports'][_0x33ef99['transfertargetuniqueid']]=_0x34cbf7;var _0x4f1548=_[_0x5247('0x7a')](this['queueReports'][_0x33ef99[_0x5247('0xd5')]]);_0x4f1548[_0x5247('0x31')]=!![];}logger[_0x5247('0x75')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x33ef99[_0x5247('0x45')],_0x3bcf2b['name'],_0x3bcf2b['type'],_0x3bcf2b[_0x5247('0x9d')],_0x3bcf2b[_0x5247('0xd0')]);}}}catch(_0x2befab){logger[_0x5247('0x38')](_0x5247('0xcd'),_0x33ef99[_0x5247('0x45')],util['inspect'](_0x2befab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0xd8')]=function(_0x34beb4){try{if(this[_0x5247('0x67')](_0x34beb4)){logger[_0x5247('0x43')](_0x5247('0xd9'),_0x34beb4[_0x5247('0x45')],util['inspect'](_0x34beb4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x34beb4[_0x5247('0xce')]]){var _0x39d2ff=_[_0x5247('0x7a')](this[_0x5247('0xd')][_0x34beb4[_0x5247('0xce')]]);_0x39d2ff[_0x5247('0x7f')]=_0x5247('0xda');_0x39d2ff['transfer']=!![];_0x39d2ff['transfertype']='BLIND';_0x39d2ff[_0x5247('0x9d')]=_0x34beb4[_0x5247('0xdb')];_0x39d2ff[_0x5247('0xd0')]=_0x34beb4[_0x5247('0xce')];logger[_0x5247('0x75')](_0x5247('0xdc'),_0x34beb4[_0x5247('0x45')],_0x39d2ff[_0x5247('0x47')],_0x39d2ff[_0x5247('0x70')],_0x39d2ff['transferexten'],_0x39d2ff[_0x5247('0xd0')]);this[_0x5247('0x22')]({'event':'BlindTransfer','uniqueid':_0x34beb4[_0x5247('0xce')],'context':_0x34beb4[_0x5247('0xdd')],'channel':_0x34beb4[_0x5247('0xde')]});}}}catch(_0x484836){logger[_0x5247('0x38')](_0x5247('0xd9'),_0x34beb4[_0x5247('0x45')],util[_0x5247('0x3a')](_0x484836,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5247('0xa')][_0x5247('0x26')]=function(_0x1ea5cc){try{if(this[_0x5247('0x67')](_0x1ea5cc)){logger[_0x5247('0x43')]('[%s][voiceQueueReport][musiconholdstart]',_0x1ea5cc[_0x5247('0x45')],util['inspect'](_0x1ea5cc,{'showHidden':![],'depth':null}));if(this[_0x5247('0xd')][_0x1ea5cc[_0x5247('0x45')]]){var _0x5e6543=_[_0x5247('0x7a')](this['queueReports'][_0x1ea5cc['uniqueid']]);if(!_['isNil'](_0x5e6543[_0x5247('0x83')])){_0x5e6543[_0x5247('0xdf')]=moment()[_0x5247('0x46')](_0x5247('0x72'));logger[_0x5247('0x75')](_0x5247('0xe0'),_0x1ea5cc[_0x5247('0x45')],_0x5e6543['mohstarttime']);}}}}catch(_0x2fc405){logger[_0x5247('0x38')](_0x5247('0xe1'),_0x1ea5cc['uniqueid'],util['inspect'](_0x2fc405,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5247('0x28')]=function(_0x37f9c0){try{if(this[_0x5247('0x67')](_0x37f9c0)){logger[_0x5247('0x43')]('[%s][voiceQueueReport][musiconholdstop]',_0x37f9c0['uniqueid'],util['inspect'](_0x37f9c0,{'showHidden':![],'depth':null}));if(this[_0x5247('0xd')][_0x37f9c0[_0x5247('0x45')]]){var _0x287039=_['last'](this[_0x5247('0xd')][_0x37f9c0[_0x5247('0x45')]]);if(!_[_0x5247('0x33')](_0x287039[_0x5247('0xdf')])){_0x287039[_0x5247('0xe2')]+=moment()[_0x5247('0xc0')](0x0)[_0x5247('0xbf')](_0x287039[_0x5247('0xdf')],_0x5247('0x99'));logger['info'](_0x5247('0xe3'),_0x37f9c0[_0x5247('0x45')],_0x287039['mohtime']);delete _0x287039['mohstarttime'];}}}}catch(_0x1e57b6){logger[_0x5247('0x38')](_0x5247('0xe4'),_0x37f9c0[_0x5247('0x45')],util[_0x5247('0x3a')](_0x1e57b6,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x09c9=['sequence','isNil','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug','[%s][voiceQueueReport][','voice_queue_channel:remove','voice_queue_presence:remove','type','strategy','answered','sumDuration','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','toNumber','callers','loggedIn','loggedin','available','emitVoiceQueueSummary','custom:queuesummary','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','queuecallerabandonAt','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','membername','transfer','reason','COMPLETED','startsWith','toLowerCase','linkedid','queuecallerexitAt','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','queuecallerexit','TIMEOUT','queuecallerleaveAt','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','seconds','sumBillable','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','queueReports','agents','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch'];(function(_0x2a7210,_0x2f3d23){var _0x460766=function(_0xd575dd){while(--_0xd575dd){_0x2a7210['push'](_0x2a7210['shift']());}};_0x460766(++_0x2f3d23);}(_0x09c9,0xa3));var _0x909c=function(_0x30ca19,_0x2a12db){_0x30ca19=_0x30ca19-0x0;var _0x17da76=_0x09c9[_0x30ca19];return _0x17da76;};'use strict';var _=require(_0x909c('0x0'));var moment=require(_0x909c('0x1'));var util=require(_0x909c('0x2'));var md5=require(_0x909c('0x3'));var Redis=require(_0x909c('0x4'));var config=require(_0x909c('0x5'));var logger=require(_0x909c('0x6'))(_0x909c('0x7'));var ami=require('../ami');var QueueReport=require(_0x909c('0x8'));config[_0x909c('0x9')]=_[_0x909c('0xa')](config[_0x909c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x909c('0xb'))(new Redis(config[_0x909c('0x9')]));var Sequence=function(){};Sequence[_0x909c('0xc')][_0x909c('0xd')]=function(_0x120306){this['tail']=this['tail']?this['tail']['finally'](_0x120306):_0x120306();};function VoiceQueueReport(_0x598a48){this['sequence']=new Sequence();this[_0x909c('0xe')]={};this[_0x909c('0xf')]=_0x598a48[_0x909c('0xf')];this[_0x909c('0x10')]=_0x598a48['queueChannels'];this[_0x909c('0x11')]=_0x598a48['voiceQueues'];this['flagQueueSummary']=!![];this[_0x909c('0x12')]=_0x598a48[_0x909c('0x12')];this[_0x909c('0x13')]={};ami['on'](_0x909c('0x14'),this[_0x909c('0x15')]['bind'](this));ami['on'](_0x909c('0x16'),this[_0x909c('0x17')][_0x909c('0x18')](this));ami['on'](_0x909c('0x19'),this[_0x909c('0x1a')][_0x909c('0x18')](this));ami['on'](_0x909c('0x1b'),this[_0x909c('0x1c')][_0x909c('0x18')](this));ami['on'](_0x909c('0x1d'),this[_0x909c('0x1e')][_0x909c('0x18')](this));ami['on'](_0x909c('0x1f'),this[_0x909c('0x20')]['bind'](this));ami['on'](_0x909c('0x21'),this[_0x909c('0x22')][_0x909c('0x18')](this));ami['on'](_0x909c('0x23'),this['syncVarSet'][_0x909c('0x18')](this));ami['on'](_0x909c('0x24'),this[_0x909c('0x25')][_0x909c('0x18')](this));ami['on'](_0x909c('0x26'),this[_0x909c('0x27')][_0x909c('0x18')](this));ami['on'](_0x909c('0x28'),this[_0x909c('0x29')][_0x909c('0x18')](this));ami['on'](_0x909c('0x2a'),this['syncMusicOnHoldStop'][_0x909c('0x18')](this));ami['on'](_0x909c('0x2b'),this[_0x909c('0x2c')][_0x909c('0x18')](this));ami['on']('blindtransfer',this[_0x909c('0x2d')][_0x909c('0x18')](this));this[_0x909c('0x2e')]();this[_0x909c('0x2f')]();}function clearChannels(_0x188a61){if(!_['isEmpty'](_0x188a61)){for(var _0x242503 in _0x188a61){if(_0x188a61[_0x909c('0x30')](_0x242503)){delete _0x188a61[_0x242503];}}}}function clearCampaigns(_0x30382a){if(!_[_0x909c('0x31')](_0x30382a)){for(var _0x5b026a in _0x30382a){if(_0x30382a[_0x909c('0x30')](_0x5b026a)){_0x30382a[_0x5b026a][_0x909c('0x32')]=0x0;}}}}function clearVoiceQueues(_0x4b66cc){if(!_['isEmpty'](_0x4b66cc)){for(var _0x5a7331 in _0x4b66cc){if(_0x4b66cc[_0x909c('0x30')](_0x5a7331)){_0x4b66cc[_0x5a7331][_0x909c('0x32')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x33')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x34')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x35')]=0x0;_0x4b66cc[_0x5a7331][_0x909c('0x36')]=!![];}}}}function clearAgentBooked(_0x2e710b){if(!_[_0x909c('0x31')](_0x2e710b)){for(var _0x2462d0 in _0x2e710b){if(_0x2e710b[_0x909c('0x30')](_0x2462d0)){_0x2e710b[_0x2462d0][_0x909c('0x37')]=!![];}}}}VoiceQueueReport[_0x909c('0xc')][_0x909c('0x38')]=function(){var _0x1f3525=this;for(var _0x5c99bc in this['channels']){if(this[_0x909c('0x10')]['hasOwnProperty'](_0x5c99bc)&&!this[_0x909c('0x10')][_0x5c99bc][_0x909c('0x39')]){this[_0x909c('0x3a')][_0x909c('0xd')](function(){if(!_[_0x909c('0x3b')](_0x1f3525[_0x909c('0x10')][_0x5c99bc])){return ami['Action']({'action':'status','channel':_0x1f3525[_0x909c('0x10')][_0x5c99bc][_0x909c('0x3c')]})[_0x909c('0x3d')](function(_0x573924){if(_0x573924['message']===_0x909c('0x3e')){setTimeout(function(){if(_0x1f3525['channels'][_0x5c99bc]){delete _0x1f3525[_0x909c('0x10')][_0x5c99bc];logger[_0x909c('0x3f')](_0x909c('0x40'),_0x5c99bc,util[_0x909c('0x41')](_0x573924,{'showHidden':![],'depth':null}));}if(_0x1f3525['queueReports'][_0x5c99bc]){delete _0x1f3525[_0x909c('0xe')][_0x5c99bc];logger['error'](_0x909c('0x42'),_0x5c99bc,util['inspect'](_0x573924,{'showHidden':![],'depth':null}));}if(_0x1f3525[_0x909c('0x13')][_0x5c99bc]){delete _0x1f3525[_0x909c('0x13')][_0x5c99bc];logger[_0x909c('0x3f')](_0x909c('0x43'),_0x5c99bc,util[_0x909c('0x41')](_0x573924,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x909c('0xc')]['syncFullyBooted']=function(){logger[_0x909c('0x3f')](_0x909c('0x44'));clearChannels(this[_0x909c('0x10')]);this[_0x909c('0x45')](this[_0x909c('0xe')]);clearAgentBooked(this[_0x909c('0xf')]);clearVoiceQueues(this[_0x909c('0x11')]);clearCampaigns(this[_0x909c('0x12')]);};VoiceQueueReport[_0x909c('0xc')]['clearQueueReport']=function(_0x6b6759){var _0x3e05fb=this;if(!_[_0x909c('0x31')](_0x6b6759)){for(var _0x208b26 in _0x6b6759){if(_0x6b6759[_0x909c('0x30')](_0x208b26)){_0x3e05fb['emitVoiceQueueChannelRemove'](_0x6b6759[_0x208b26],_0x909c('0x46'));delete _0x6b6759[_0x208b26];}}}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x47')]=function(_0x1f118d,_0x12bb1a,_0x46f571){io['to'](_0x1f118d)[_0x909c('0x47')](_0x12bb1a,_0x46f571);};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x48')]=function(_0x494848,_0x58459a){logger['debug']('[%s][voiceQueueReport]['+_0x58459a+_0x909c('0x49'),_0x494848[_0x909c('0x4a')],util['inspect'](_0x494848,{'showHidden':![],'depth':null}));this[_0x909c('0x47')](util[_0x909c('0x4b')](_0x909c('0x4c'),_0x494848[_0x909c('0x4d')]),_0x909c('0x4e'),_0x494848);io[_0x909c('0x47')](_0x909c('0x4f'),_0x494848);};VoiceQueueReport[_0x909c('0xc')]['emitVoiceQueueChannelRemove']=function(_0x26fba6,_0x52a093){logger[_0x909c('0x50')](_0x909c('0x51')+_0x52a093+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x26fba6[_0x909c('0x4a')],util[_0x909c('0x41')](_0x26fba6,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x26fba6[_0x909c('0x4d')]),_0x909c('0x52'),_0x26fba6);io[_0x909c('0x47')](_0x909c('0x53'),_0x26fba6);};VoiceQueueReport[_0x909c('0xc')]['emitVoiceQueueSummary']=function(_0x25935e,_0x4fda9f){if(_0x25935e[_0x909c('0x54')]==='inbound'){var _0xaac92f={'id':_0x25935e['id'],'name':_0x25935e[_0x909c('0x4d')],'strategy':_0x25935e[_0x909c('0x55')],'answered':_0x25935e[_0x909c('0x56')],'available':_0x25935e['available'],'loggedIn':_0x25935e['loggedIn'],'pTalking':_0x25935e[_0x909c('0x34')],'sumBillable':_0x25935e['sumBillable'],'sumDuration':_0x25935e[_0x909c('0x57')],'sumHoldTime':_0x25935e['sumHoldTime']||0x0,'talking':_0x25935e[_0x909c('0x33')],'total':_0x25935e[_0x909c('0x58')],'type':_0x25935e[_0x909c('0x54')],'unmanaged':_0x25935e[_0x909c('0x59')],'abandoned':_0x25935e[_0x909c('0x5a')],'waiting':_0x25935e['waiting']};if(_0x25935e[_0x909c('0x5b')]){_0xaac92f[_0x909c('0x5b')]={'id':_0x25935e[_0x909c('0x5b')]['id'],'name':_0x25935e['Trunk']['name'],'active':_0x25935e[_0x909c('0x5b')][_0x909c('0x5c')],'callerid':_0x25935e[_0x909c('0x5b')][_0x909c('0x5d')]};}if(_0x25935e['Interval']){_0xaac92f[_0x909c('0x5e')]={'id':_0x25935e[_0x909c('0x5e')]['id'],'name':_0x25935e[_0x909c('0x5e')][_0x909c('0x4d')]};}var _0x300957=md5(JSON[_0x909c('0x5f')](_0xaac92f));if(_0x25935e[_0x909c('0x3')]!==_0x300957){_0x25935e['md5']=_0x300957;logger[_0x909c('0x50')](_0x909c('0x60')+_0x4fda9f+_0x909c('0x61'),util[_0x909c('0x41')](_0xaac92f,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x909c('0x4c'),_0xaac92f['name']),_0x909c('0x62'),_0xaac92f);}}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x63')]=function(_0x13e703){return _0x13e703!==null&&!_['isUndefined'](_0x13e703);};VoiceQueueReport[_0x909c('0xc')]['loopQueueShow']=function(){var _0x1904eb=this;setInterval(function(){_0x1904eb[_0x909c('0x38')]();ami['Action']({'action':_0x909c('0x64')})[_0x909c('0x3d')](function(_0x16b699){logger[_0x909c('0x3f')](_0x909c('0x65'),util['inspect'](_0x16b699,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x909c('0x2e')]=function(){var _0x4595c3=this;setInterval(function(){if(_0x4595c3[_0x909c('0x66')]){return ami['Action']({'action':'queuesummary'})[_0x909c('0x67')](function(_0x5df82b){_0x4595c3[_0x909c('0x66')]=![];})[_0x909c('0x3d')](function(_0x553450){logger['error'](_0x909c('0x68'),util['inspect'](_0x553450,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x909c('0xc')]['syncQueueSummary']=function(_0xbf0ed0){try{if(this[_0x909c('0x63')](_0xbf0ed0)&&this[_0x909c('0x63')](_0xbf0ed0[_0x909c('0x69')])){logger['debug'](_0x909c('0x6a'),util[_0x909c('0x41')](_0xbf0ed0,{'showHidden':![],'depth':null}));if(this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]]){logger[_0x909c('0x6b')]('[voiceQueueReport][queuesummary]\x20name:%s',_0xbf0ed0[_0x909c('0x69')]);var _0x4c7df1=_[_0x909c('0x6c')](this[_0x909c('0x10')],'queue')[_0xbf0ed0[_0x909c('0x69')]]||0x0;var _0x18bfd0=_0x4c7df1-_0xbf0ed0['callers'];if(this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x35')]!==_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x6e')])||this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x6f')]!==_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x70')])||this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x71')]!==_[_0x909c('0x6d')](_0xbf0ed0['available'])||this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x33')]!==_0x18bfd0){this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x35')]=_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x6e')]);this['voiceQueues'][_0xbf0ed0['queue']]['loggedIn']=_[_0x909c('0x6d')](_0xbf0ed0['loggedin']);this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x71')]=_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x71')]);this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x33')]=_0x18bfd0>0x0?_0x18bfd0:0x0;this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]][_0x909c('0x33')]=this[_0x909c('0x11')][_0xbf0ed0['queue']][_0x909c('0x33')]>_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x70')])?_[_0x909c('0x6d')](_0xbf0ed0[_0x909c('0x70')]):this[_0x909c('0x11')][_0xbf0ed0['queue']][_0x909c('0x33')];this[_0x909c('0x72')](this['voiceQueues'][_0xbf0ed0[_0x909c('0x69')]],_0x909c('0x14'));}logger[_0x909c('0x50')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x909c('0x41')](this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]],{'showHidden':![],'depth':null}));ami[_0x909c('0x47')](_0x909c('0x73'),this[_0x909c('0x11')][_0xbf0ed0[_0x909c('0x69')]]);}}}catch(_0x5bcee4){logger[_0x909c('0x3f')]('[voiceQueueReport][queuesummary]',util[_0x909c('0x41')](_0x5bcee4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x17')]=function(_0x2cbe1b){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x909c('0x41')](_0x2cbe1b,{'showHidden':![],'depth':null}));this[_0x909c('0x66')]=!![];};VoiceQueueReport[_0x909c('0xc')]['syncQueueCallerJoin']=function(_0x2bf00a){try{if(this[_0x909c('0x63')](_0x2bf00a)){logger[_0x909c('0x50')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2bf00a[_0x909c('0x4a')],util['inspect'](_0x2bf00a,{'showHidden':![],'depth':null}));if(_[_0x909c('0x74')](this[_0x909c('0xe')][_0x2bf00a[_0x909c('0x4a')]])){this[_0x909c('0xe')][_0x2bf00a[_0x909c('0x4a')]]=[];this[_0x909c('0x10')][_0x2bf00a[_0x909c('0x4a')]]={};}var _0x14f10b=new QueueReport();_0x14f10b[_0x909c('0x4d')]=_0x2bf00a[_0x909c('0x69')];_0x14f10b[_0x909c('0x54')]=this[_0x909c('0x11')][_0x14f10b[_0x909c('0x4d')]]&&this[_0x909c('0x11')][_0x14f10b[_0x909c('0x4d')]][_0x909c('0x54')]?this[_0x909c('0x11')][_0x14f10b[_0x909c('0x4d')]][_0x909c('0x54')]||_0x909c('0x75'):_0x909c('0x75');_0x14f10b[_0x909c('0x69')]=_0x2bf00a[_0x909c('0x69')];_0x14f10b[_0x909c('0x76')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));_0x14f10b[_0x909c('0x78')]=_0x2bf00a[_0x909c('0x78')];_0x14f10b[_0x909c('0x79')]=_0x2bf00a[_0x909c('0x79')];_0x14f10b[_0x909c('0x4a')]=_0x2bf00a[_0x909c('0x4a')];logger[_0x909c('0x6b')](_0x909c('0x7a'),_0x14f10b[_0x909c('0x4d')],_0x14f10b['type']);_['merge'](_0x14f10b,_[_0x909c('0x7b')](_0x2bf00a,_[_0x909c('0x7c')](_0x14f10b)));this[_0x909c('0xe')][_0x2bf00a[_0x909c('0x4a')]][_0x909c('0x7d')](_0x14f10b);this[_0x909c('0x10')][_0x2bf00a['uniqueid']]=_0x14f10b;this[_0x909c('0x48')](_0x14f10b,_0x909c('0x19'));}}catch(_0x3ae43f){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x2bf00a[_0x909c('0x4a')],util[_0x909c('0x41')](_0x3ae43f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')]['syncQueueCallerAbandon']=function(_0x15e373){try{if(this['isNotNull'](_0x15e373)){logger[_0x909c('0x50')](_0x909c('0x7e'),_0x15e373[_0x909c('0x4a')],util[_0x909c('0x41')](_0x15e373,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x15e373[_0x909c('0x4a')]]){var _0x1e95c4=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x15e373['uniqueid']]);_0x1e95c4[_0x909c('0x80')]=![];_0x1e95c4[_0x909c('0x81')]=null;_0x1e95c4[_0x909c('0x82')]=_0x15e373[_0x909c('0x82')];_0x1e95c4['originalposition']=_0x15e373['originalposition'];_0x1e95c4[_0x909c('0x1b')]=!![];_0x1e95c4[_0x909c('0x83')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));_0x1e95c4['queuecallerexitreason']='ABANDONED';_0x1e95c4[_0x909c('0x84')]=null;logger[_0x909c('0x6b')](_0x909c('0x85'),_0x1e95c4[_0x909c('0x4d')],_0x1e95c4[_0x909c('0x54')]);this['channels'][_0x15e373[_0x909c('0x4a')]]=_0x1e95c4;this[_0x909c('0x86')](_0x1e95c4,'queuecallerabandon');}}}catch(_0x5ebb7e){logger[_0x909c('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x15e373[_0x909c('0x4a')],util[_0x909c('0x41')](_0x5ebb7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')]['syncQueueCallerLeave']=function(_0x5b6892){try{if(this[_0x909c('0x63')](_0x5b6892)){logger[_0x909c('0x50')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b6892[_0x909c('0x4a')],util[_0x909c('0x41')](_0x5b6892,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x5b6892[_0x909c('0x4a')]]){var _0x25ed8c=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x5b6892[_0x909c('0x4a')]]);_0x25ed8c['queuecallerleaveAt']=moment()[_0x909c('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x25ed8c[_0x909c('0x87')]=_0x5b6892[_0x909c('0x87')];_0x25ed8c[_0x909c('0x88')]=_0x5b6892[_0x909c('0x88')];logger[_0x909c('0x6b')](_0x909c('0x89'),_0x25ed8c[_0x909c('0x4d')],_0x25ed8c['type'],_0x5b6892[_0x909c('0x87')],_0x5b6892[_0x909c('0x88')]);this[_0x909c('0x10')][_0x5b6892[_0x909c('0x4a')]]=_0x25ed8c;this[_0x909c('0x48')](_0x25ed8c,_0x909c('0x1d'));}}}catch(_0x42cde5){logger[_0x909c('0x3f')](_0x909c('0x8a'),_0x5b6892[_0x909c('0x4a')],util['inspect'](_0x42cde5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')]['syncAgentConnect']=function(_0x3f30d8){try{if(this[_0x909c('0x63')](_0x3f30d8)){logger[_0x909c('0x50')](_0x909c('0x8b'),_0x3f30d8[_0x909c('0x4a')],util['inspect'](_0x3f30d8,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x3f30d8[_0x909c('0x4a')]]){var _0x4ababc=_['last'](this[_0x909c('0xe')][_0x3f30d8[_0x909c('0x4a')]]);_0x4ababc[_0x909c('0x80')]=!![];_0x4ababc[_0x909c('0x8c')]='COMPLETEDBYAGENT';logger[_0x909c('0x6b')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4ababc['name'],_0x4ababc[_0x909c('0x54')]);}}}catch(_0x254a5f){logger[_0x909c('0x3f')](_0x909c('0x8b'),_0x3f30d8[_0x909c('0x4a')],util['inspect'](_0x254a5f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x20')]=function(_0x49e220){try{if(this[_0x909c('0x63')](_0x49e220)){logger[_0x909c('0x50')]('[%s][voiceQueueReport][agentcomplete]',_0x49e220['uniqueid'],util[_0x909c('0x41')](_0x49e220,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x49e220[_0x909c('0x4a')]]){var _0x344d60=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x49e220[_0x909c('0x4a')]]);_0x344d60[_0x909c('0x1b')]=![];_0x344d60[_0x909c('0x83')]=null;_0x344d60['assigned']=!![];_0x344d60[_0x909c('0x84')]=_0x49e220[_0x909c('0x8d')];_0x344d60[_0x909c('0x82')]=_0x49e220['holdtime'];_0x344d60[_0x909c('0x80')]=!![];_0x344d60['queuecallerexit']=![];_0x344d60['queuecallerexitAt']=null;if(!_0x344d60[_0x909c('0x8e')]){if(_0x49e220[_0x909c('0x8f')]==_0x909c('0x8e')){_0x344d60[_0x909c('0x8c')]=_0x909c('0x90');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x344d60['name'],_0x344d60['type']);}else{if(_[_0x909c('0x91')](_0x49e220[_0x909c('0x3c')][_0x909c('0x92')](),'local/')){if(this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]]){var _0x521ff2=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]]);_0x521ff2['queuecallercomplete']=![];_0x521ff2['queuecallerexit']=!![];_0x521ff2[_0x909c('0x94')]=moment(_0x344d60[_0x909c('0x76')])[_0x909c('0x95')](_0x49e220['holdtime'],'seconds')[_0x909c('0x4b')](_0x909c('0x77'));_0x521ff2[_0x909c('0x8c')]=_0x909c('0x96');_0x521ff2['transfer']=!![];_0x521ff2[_0x909c('0x97')]=_0x909c('0x98');_0x521ff2[_0x909c('0x99')]=_0x49e220[_0x909c('0x9a')];_0x521ff2[_0x909c('0x9b')]=_0x49e220[_0x909c('0x4a')];logger[_0x909c('0x6b')](_0x909c('0x9c'),_0x521ff2[_0x909c('0x4d')],_0x521ff2[_0x909c('0x54')]);var _0x26642e=this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]];this[_0x909c('0xe')][_0x49e220[_0x909c('0x93')]]=this['queueReports'][_0x49e220[_0x909c('0x4a')]];this[_0x909c('0xe')][_0x49e220['uniqueid']]=_0x26642e;}}else{_0x344d60[_0x909c('0x8c')]=_0x909c('0x9d')+_0x49e220['reason']['toUpperCase']();logger[_0x909c('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x344d60[_0x909c('0x4d')],_0x344d60[_0x909c('0x54')],_0x344d60[_0x909c('0x8c')]);}}}this[_0x909c('0x10')][_0x49e220[_0x909c('0x4a')]]=_0x344d60;this[_0x909c('0x86')](_0x344d60,_0x909c('0x1f'));}}}catch(_0xbe936d){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x49e220[_0x909c('0x4a')],util[_0x909c('0x41')](_0xbe936d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x9e')]=function(_0x4adc51){try{if(this[_0x909c('0x63')](_0x4adc51)){logger['debug'](_0x909c('0x9f'),_0x4adc51[_0x909c('0x4a')],util[_0x909c('0x41')](_0x4adc51,{'showHidden':![],'depth':null}));this[_0x909c('0xa0')](_0x4adc51[_0x909c('0x4a')],_['keys'](_0x4adc51[_0x909c('0xa1')])[0x0],_0x4adc51[_0x909c('0xa2')]);if(this[_0x909c('0xe')][_0x4adc51[_0x909c('0x4a')]]){var _0x464a14=_['last'](this[_0x909c('0xe')][_0x4adc51[_0x909c('0x4a')]]);if(_0x464a14){if(this[_0x909c('0x63')](_0x4adc51[_0x909c('0xa1')])&&this['isNotNull'](_0x4adc51['variable'][_0x909c('0xa3')])){switch(_0x4adc51[_0x909c('0xa2')]){case'CONTINUE':_0x464a14[_0x909c('0xa4')]=![];_0x464a14[_0x909c('0x94')]=null;break;case _0x909c('0xa5'):_0x464a14['lastevent']='timeout';_0x464a14[_0x909c('0xa4')]=!![];_0x464a14[_0x909c('0x94')]=moment()['format'](_0x909c('0x77'));_0x464a14[_0x909c('0xa6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));logger[_0x909c('0x50')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4adc51[_0x909c('0x4a')],util[_0x909c('0x41')](_0x464a14,{'showHidden':![],'depth':null}));ami[_0x909c('0x47')](_0x909c('0xa7'),_0x464a14);break;default:_0x464a14[_0x909c('0xa4')]=!![];_0x464a14['queuecallerexitAt']=moment()[_0x909c('0x4b')](_0x909c('0x77'));_0x464a14[_0x909c('0xa6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));}_0x464a14['queuecallerabandon']=![];_0x464a14[_0x909c('0x83')]=null;_0x464a14[_0x909c('0x8c')]=_0x4adc51[_0x909c('0xa2')];this['channels'][_0x4adc51[_0x909c('0x4a')]]=_0x464a14;this[_0x909c('0x86')](_0x464a14,_0x909c('0x23'));}else if(this[_0x909c('0x63')](_0x4adc51[_0x909c('0xa1')])&&this[_0x909c('0x63')](_0x4adc51[_0x909c('0xa1')][_0x909c('0xa8')])){if(!_0x464a14[_0x909c('0x1b')]){_0x464a14[_0x909c('0xa4')]=!![];_0x464a14['queuecallerexitAt']=moment()['format'](_0x909c('0x77'));_0x464a14[_0x909c('0x8c')]=_0x909c('0xa9');_0x464a14[_0x909c('0xa6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));this[_0x909c('0x10')][_0x4adc51[_0x909c('0x4a')]]=_0x464a14;}}logger['info'](_0x909c('0xaa'),_0x4adc51[_0x909c('0x4a')],_0x464a14[_0x909c('0x4d')],_0x464a14[_0x909c('0x54')],_[_0x909c('0x7c')](_0x4adc51[_0x909c('0xa1')])[0x0],_0x4adc51[_0x909c('0xa2')]);_0x464a14['variables']=this[_0x909c('0x13')][_0x4adc51[_0x909c('0x4a')]];}}}}catch(_0x22d2e1){logger[_0x909c('0x3f')](_0x909c('0x9f'),_0x4adc51[_0x909c('0x4a')],util[_0x909c('0x41')](_0x22d2e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0xa0')]=function(_0x55a8e1,_0x51427f,_0x224df3){var _0x2fcfdf=[_0x909c('0xab'),'rtpaudioqosbridged',_0x909c('0xac'),_0x909c('0xad'),_0x909c('0xae'),_0x909c('0xaf'),_0x909c('0xb0'),_0x909c('0xb1'),_0x909c('0xb2'),_0x909c('0xb3'),_0x909c('0xb4'),_0x909c('0xb5'),_0x909c('0xb6'),'memberdynamic',_0x909c('0xb7'),'memberlastcall',_0x909c('0x8d'),_0x909c('0xb8'),_0x909c('0xb9')];if(!_[_0x909c('0x3b')](_0x51427f)&&!_[_0x909c('0xba')](_0x2fcfdf,_0x51427f)){if(_[_0x909c('0x74')](this['variables'][_0x55a8e1])){this['variables'][_0x55a8e1]={};}this[_0x909c('0x13')][_0x55a8e1][_0x51427f]=_0x224df3;}};VoiceQueueReport[_0x909c('0xc')]['syncHangup']=function(_0x1b23b9){try{if(this[_0x909c('0x63')](_0x1b23b9)){logger['debug'](_0x909c('0xbb'),_0x1b23b9[_0x909c('0x4a')],util[_0x909c('0x41')](_0x1b23b9,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b23b9['uniqueid']]){for(var _0x4ecbe9=0x0,_0x7afada={};_0x4ecbe9<this[_0x909c('0xe')][_0x1b23b9[_0x909c('0x4a')]][_0x909c('0xbc')];_0x4ecbe9+=0x1){_0x7afada=this[_0x909c('0xe')][_0x1b23b9[_0x909c('0x4a')]][_0x4ecbe9];if(this['voiceQueues'][_0x7afada[_0x909c('0x69')]]){if(_0x7afada['queuecallerexit']&&_0x7afada[_0x909c('0x8e')]!=!![]){this[_0x909c('0x11')][_0x7afada[_0x909c('0x69')]][_0x909c('0x59')]+=0x1;}if(_0x7afada['queuecallerabandon']){this[_0x909c('0x11')][_0x7afada[_0x909c('0x69')]]['abandoned']+=0x1;}this[_0x909c('0x11')][_0x7afada['queue']]['sumHoldTime']+=moment(_0x7afada['queuecallerleaveAt'])[_0x909c('0xbd')](_0x7afada[_0x909c('0x76')],_0x909c('0xbe'))||0x0;if(_0x4ecbe9===this[_0x909c('0xe')][_0x1b23b9[_0x909c('0x4a')]][_0x909c('0xbc')]-0x1){this[_0x909c('0x11')][_0x7afada[_0x909c('0x69')]]['sumDuration']+=moment()['milliseconds'](0x0)[_0x909c('0xbd')](_0x7afada['queuecallerjoinAt'],_0x909c('0xbe'));this['voiceQueues'][_0x7afada[_0x909c('0x69')]][_0x909c('0x58')]+=0x1;if(_0x7afada[_0x909c('0x80')]){this['voiceQueues'][_0x7afada['queue']][_0x909c('0x56')]+=0x1;this[_0x909c('0x11')][_0x7afada['queue']][_0x909c('0xbf')]+=moment()[_0x909c('0xc0')](0x0)[_0x909c('0xbd')](_0x7afada[_0x909c('0xa6')],_0x909c('0xbe'));_0x7afada[_0x909c('0x81')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x7afada[_0x909c('0xa4')]=![];_0x7afada[_0x909c('0x94')]=null;}if(_0x7afada[_0x909c('0xa4')]&&_0x7afada[_0x909c('0x8e')]!=!![]){_0x7afada['lastevent']=_0x909c('0x59');logger[_0x909c('0x50')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x1b23b9[_0x909c('0x4a')],util[_0x909c('0x41')](_0x7afada,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x7afada);}if(_0x7afada[_0x909c('0x1b')]){_0x7afada['lastevent']=_0x909c('0x5a');logger['debug'](_0x909c('0xc1'),_0x1b23b9[_0x909c('0x4a')],util['inspect'](_0x7afada,{'showHidden':![],'depth':null}));ami[_0x909c('0x47')](_0x909c('0xc2'),_0x7afada);}}else{this[_0x909c('0x11')][_0x7afada[_0x909c('0x69')]][_0x909c('0x57')]+=this[_0x909c('0x11')][_0x7afada[_0x909c('0x69')]]['sumHoldTime'];}logger[_0x909c('0x6b')](_0x909c('0xc3'),_0x1b23b9[_0x909c('0x4a')],_0x7afada[_0x909c('0x4d')],_0x7afada['type'],_0x1b23b9[_0x909c('0xc4')]);this[_0x909c('0x10')][_0x1b23b9['uniqueid']]=_0x7afada;this[_0x909c('0x86')](_0x7afada,_0x909c('0x24'));this[_0x909c('0x72')](this[_0x909c('0x11')][_0x7afada[_0x909c('0x69')]],'hangup');}}logger[_0x909c('0x50')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x1b23b9[_0x909c('0x4a')],util[_0x909c('0x41')](this[_0x909c('0xe')][_0x1b23b9[_0x909c('0x4a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x909c('0xc5'),this[_0x909c('0xe')][_0x1b23b9[_0x909c('0x4a')]]);delete this['queueReports'][_0x1b23b9[_0x909c('0x4a')]];delete this[_0x909c('0x10')][_0x1b23b9[_0x909c('0x4a')]];}if(this[_0x909c('0x13')][_0x1b23b9[_0x909c('0x4a')]]){delete this[_0x909c('0x13')][_0x1b23b9[_0x909c('0x4a')]];}}}catch(_0x5065d7){logger[_0x909c('0x3f')]('[%s][voiceQueueReport][hangup]',_0x1b23b9['uniqueid'],util[_0x909c('0x41')](_0x5065d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x2c')]=function(_0xe86c4c){try{if(this[_0x909c('0x63')](_0xe86c4c)){logger['debug']('[%s][voiceQueueReport][attendedtransfer]',_0xe86c4c[_0x909c('0x4a')],util[_0x909c('0x41')](_0xe86c4c,{'showHidden':![],'depth':null}));var _0x849f7b;if(this['queueReports'][_0xe86c4c[_0x909c('0xc6')]]){_0x849f7b=_['last'](this['queueReports'][_0xe86c4c['transfereeuniqueid']]);_0x849f7b[_0x909c('0x99')]=_0xe86c4c[_0x909c('0xc7')];_0x849f7b[_0x909c('0x9b')]=_0xe86c4c[_0x909c('0xc8')];_0x849f7b[_0x909c('0x8c')]=_0x909c('0xc9');_0x849f7b['transfer']=!![];_0x849f7b[_0x909c('0x97')]=_0x909c('0xca');if(this['queueReports'][_0xe86c4c['secondtransfereruniqueid']]){var _0x4e6a26=this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xc8')]];this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xc8')]]=this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xc6')]];this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xc6')]]=_0x4e6a26;var _0x2861d0=_[_0x909c('0x7f')](this['queueReports'][_0xe86c4c[_0x909c('0xc6')]]);_0x2861d0['switch']=!![];}logger[_0x909c('0x6b')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xe86c4c[_0x909c('0x4a')],_0x849f7b[_0x909c('0x4d')],_0x849f7b['type'],_0x849f7b[_0x909c('0x99')],_0x849f7b[_0x909c('0x9b')]);}else if(this[_0x909c('0xe')][_0xe86c4c['transfertargetuniqueid']]){_0x849f7b=_[_0x909c('0x7f')](this['queueReports'][_0xe86c4c[_0x909c('0xcb')]]);_0x849f7b[_0x909c('0x99')]=_0xe86c4c['origtransfererexten'];_0x849f7b[_0x909c('0x9b')]=_0xe86c4c[_0x909c('0xcc')];_0x849f7b['queuecallerexitreason']='ATTENDEDTRANSFER';_0x849f7b['transfer']=!![];_0x849f7b[_0x909c('0x97')]=_0x909c('0xca');if(this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xcc')]]){var _0x4e6a26=this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xcc')]];this[_0x909c('0xe')][_0xe86c4c['origtransfereruniqueid']]=this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xcb')]];this[_0x909c('0xe')][_0xe86c4c[_0x909c('0xcb')]]=_0x4e6a26;var _0x2861d0=_[_0x909c('0x7f')](this['queueReports'][_0xe86c4c[_0x909c('0xcb')]]);_0x2861d0[_0x909c('0x39')]=!![];}logger[_0x909c('0x6b')](_0x909c('0xcd'),_0xe86c4c[_0x909c('0x4a')],_0x849f7b['name'],_0x849f7b['type'],_0x849f7b['transferexten'],_0x849f7b[_0x909c('0x9b')]);}}}catch(_0xc678ed){logger[_0x909c('0x3f')](_0x909c('0xce'),_0xe86c4c[_0x909c('0x4a')],util['inspect'](_0xc678ed,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x2d')]=function(_0xc8532e){try{if(this['isNotNull'](_0xc8532e)){logger[_0x909c('0x50')](_0x909c('0xcf'),_0xc8532e[_0x909c('0x4a')],util[_0x909c('0x41')](_0xc8532e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc8532e['transfereeuniqueid']]){var _0xd160df=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0xc8532e[_0x909c('0xc6')]]);_0xd160df[_0x909c('0x8c')]=_0x909c('0xd0');_0xd160df[_0x909c('0x8e')]=!![];_0xd160df['transfertype']=_0x909c('0xd1');_0xd160df[_0x909c('0x99')]=_0xc8532e['extension'];_0xd160df[_0x909c('0x9b')]=_0xc8532e[_0x909c('0xc6')];logger[_0x909c('0x6b')](_0x909c('0xd2'),_0xc8532e[_0x909c('0x4a')],_0xd160df[_0x909c('0x4d')],_0xd160df['type'],_0xd160df[_0x909c('0x99')],_0xd160df['transferuniqueid']);this[_0x909c('0x25')]({'event':_0x909c('0xd3'),'uniqueid':_0xc8532e[_0x909c('0xc6')],'context':_0xc8532e['context'],'channel':_0xc8532e[_0x909c('0xd4')]});}}}catch(_0x298faa){logger[_0x909c('0x3f')](_0x909c('0xcf'),_0xc8532e['uniqueid'],util[_0x909c('0x41')](_0x298faa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0x29')]=function(_0x3f266a){try{if(this[_0x909c('0x63')](_0x3f266a)){logger[_0x909c('0x50')](_0x909c('0xd5'),_0x3f266a['uniqueid'],util[_0x909c('0x41')](_0x3f266a,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x3f266a[_0x909c('0x4a')]]){var _0x4686d8=_[_0x909c('0x7f')](this[_0x909c('0xe')][_0x3f266a[_0x909c('0x4a')]]);if(!_[_0x909c('0x3b')](_0x4686d8['queuecallerleaveAt'])){_0x4686d8[_0x909c('0xd6')]=moment()[_0x909c('0x4b')](_0x909c('0x77'));logger[_0x909c('0x6b')](_0x909c('0xd7'),_0x3f266a['uniqueid'],_0x4686d8[_0x909c('0xd6')]);}}}}catch(_0x3e9a68){logger[_0x909c('0x3f')](_0x909c('0xd5'),_0x3f266a[_0x909c('0x4a')],util['inspect'](_0x3e9a68,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x909c('0xc')][_0x909c('0xd8')]=function(_0x7c9e74){try{if(this[_0x909c('0x63')](_0x7c9e74)){logger[_0x909c('0x50')](_0x909c('0xd9'),_0x7c9e74[_0x909c('0x4a')],util[_0x909c('0x41')](_0x7c9e74,{'showHidden':![],'depth':null}));if(this[_0x909c('0xe')][_0x7c9e74[_0x909c('0x4a')]]){var _0x41870e=_['last'](this['queueReports'][_0x7c9e74[_0x909c('0x4a')]]);if(!_[_0x909c('0x3b')](_0x41870e[_0x909c('0xd6')])){_0x41870e[_0x909c('0xda')]+=moment()['milliseconds'](0x0)['diff'](_0x41870e[_0x909c('0xd6')],_0x909c('0xbe'));logger[_0x909c('0x6b')](_0x909c('0xdb'),_0x7c9e74[_0x909c('0x4a')],_0x41870e[_0x909c('0xda')]);delete _0x41870e[_0x909c('0xd6')];}}}}catch(_0x326cf2){logger[_0x909c('0x3f')](_0x909c('0xd9'),_0x7c9e74[_0x909c('0x4a')],util['inspect'](_0x326cf2,{'showHidden':![],'depth':null}));}};module[_0x909c('0xdc')]=VoiceQueueReport;
\ No newline at end of file
index b949997..d9d7122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ed=['createHistory','campaign','queue','Request','CreateReportAgentPreview'];(function(_0x30b3ac,_0x6549c4){var _0x40a95a=function(_0x35703b){while(--_0x35703b){_0x30b3ac['push'](_0x30b3ac['shift']());}};_0x40a95a(++_0x6549c4);}(_0xf4ed,0x87));var _0xdf4e=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xf4ed[_0x2211ed];return _0x4d78cc;};'use strict';var client=require('../client');exports[_0xdf4e('0x0')]=function(_0x4d8491){return function(){_0x4d8491[_0xdf4e('0x1')]=_0x4d8491[_0xdf4e('0x2')];return client[_0xdf4e('0x3')](_0xdf4e('0x4'),{'body':_0x4d8491,'log':_0xdf4e('0x4')});};};
\ No newline at end of file
+var _0x8f6c=['CreateReportAgentPreview','../client','campaign','queue','Request'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8f6c,0xe7));var _0xc8f6=function(_0x113621,_0x1f06f7){_0x113621=_0x113621-0x0;var _0x77fe2d=_0x8f6c[_0x113621];return _0x77fe2d;};'use strict';var client=require(_0xc8f6('0x0'));exports['createHistory']=function(_0x563599){return function(){_0x563599[_0xc8f6('0x1')]=_0x563599[_0xc8f6('0x2')];return client[_0xc8f6('0x3')](_0xc8f6('0x4'),{'body':_0x563599,'log':_0xc8f6('0x4')});};};
\ No newline at end of file
index 452b49a..25e6c52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b7f=['../client','create','Request','CreateAttachment'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x7b7f,0x118));var _0xf7b7=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7b7f[_0x311c35];return _0x5cc50c;};'use strict';var client=require(_0xf7b7('0x0'));exports[_0xf7b7('0x1')]=function(_0x2c7b71){return client[_0xf7b7('0x2')](_0xf7b7('0x3'),{'body':_0x2c7b71,'log':_0xf7b7('0x3')});};
\ No newline at end of file
+var _0x26c8=['CreateAttachment','../client','create','Request'];(function(_0x2591a6,_0x49ef03){var _0x5b9895=function(_0x426a02){while(--_0x426a02){_0x2591a6['push'](_0x2591a6['shift']());}};_0x5b9895(++_0x49ef03);}(_0x26c8,0xc9));var _0x826c=function(_0x2d8515,_0x5824b3){_0x2d8515=_0x2d8515-0x0;var _0x491cc8=_0x26c8[_0x2d8515];return _0x491cc8;};'use strict';var client=require(_0x826c('0x0'));exports[_0x826c('0x1')]=function(_0x13db4f){return client[_0x826c('0x2')](_0x826c('0x3'),{'body':_0x13db4f,'log':_0x826c('0x3')});};
\ No newline at end of file
index 1de3690..4b1ef60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x2ef3,0xba));var _0x32ef=function(_0x39f4a4,_0x473e72){_0x39f4a4=_0x39f4a4-0x0;var _0x54ab00=_0x2ef3[_0x39f4a4];return _0x54ab00;};'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
+var _0xadb5=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialCutDigit','Trunk','callerid','active','TrunkBackup','Interval','SquareProject','getCampaign','getCampaigns','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength'];(function(_0x4657a4,_0x5d3366){var _0x1cd863=function(_0x4e9b0c){while(--_0x4e9b0c){_0x4657a4['push'](_0x4657a4['shift']());}};_0x1cd863(++_0x5d3366);}(_0xadb5,0xad));var _0x5adb=function(_0x1c9bc0,_0x2b3210){_0x1c9bc0=_0x1c9bc0-0x0;var _0x401bfe=_0xadb5[_0x1c9bc0];return _0x401bfe;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'active',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'dialOriginateTimeout',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'dialAMDActive',_0x5adb('0x18'),'dialAMDGreeting',_0x5adb('0x19'),'dialAMDTotalAnalysisTime',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'dialAMDSilenceThreshold',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'dialRandomLastDigitCallerIdNumber',_0x5adb('0x20')],'include':[{'model':'Trunk','as':_0x5adb('0x21'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':_0x5adb('0x21'),'as':_0x5adb('0x24'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':'Interval','as':_0x5adb('0x25'),'attributes':['id','name'],'include':[{'model':_0x5adb('0x25'),'as':'Intervals','attributes':['id',_0x5adb('0x2'),'interval']}]},{'model':'SquareProject','as':_0x5adb('0x26'),'attributes':['id',_0x5adb('0x2')]}]},'log':_0x5adb('0x27')});};};
\ No newline at end of file
index 223c49f..b21e994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6bc=['CreateCmContact','getContacts','GetCmContact','../client','createContact','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe6bc,0xcf));var _0xce6b=function(_0x345052,_0x446b04){_0x345052=_0x345052-0x0;var _0x4a173a=_0xe6bc[_0x345052];return _0x4a173a;};'use strict';var client=require(_0xce6b('0x0'));exports[_0xce6b('0x1')]=function(_0x56b56a){return function(){return client[_0xce6b('0x2')]('CreateCmContact',{'body':_0x56b56a,'log':_0xce6b('0x3')});};};exports[_0xce6b('0x4')]=function(_0x359317){return function(){return client['Request'](_0xce6b('0x5'),{'options':_0x359317,'log':_0xce6b('0x5')});};};
\ No newline at end of file
+var _0x5130=['CreateCmContact','getContacts','Request','../client'];(function(_0x5377d7,_0x4983fc){var _0x53a928=function(_0x5f432c){while(--_0x5f432c){_0x5377d7['push'](_0x5377d7['shift']());}};_0x53a928(++_0x4983fc);}(_0x5130,0xa7));var _0x0513=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x5130[_0x2d2ca2];return _0x48489d;};'use strict';var client=require(_0x0513('0x0'));exports['createContact']=function(_0x59564b){return function(){return client['Request']('CreateCmContact',{'body':_0x59564b,'log':_0x0513('0x1')});};};exports[_0x0513('0x2')]=function(_0xbe578c){return function(){return client[_0x0513('0x3')]('GetCmContact',{'options':_0xbe578c,'log':'GetCmContact'});};};
\ No newline at end of file
index 454716b..c79a890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bd3=['format','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','MoveContactManagedDialer','countReScheduled','getContactPreview','GetCmHopperPreview','Contact','Agent','VoiceQueue','Queue','unlockContact','GetContactRecallMe','User','name','voicePause','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','getCmHopper','updateContacts','UpdateCmHopper'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6bd3,0x115));var _0x36bd=function(_0x249c31,_0x22fa0b){_0x249c31=_0x249c31-0x0;var _0x352568=_0x6bd3[_0x249c31];return _0x352568;};'use strict';var client=require(_0x36bd('0x0'));var moment=require(_0x36bd('0x1'));var _=require(_0x36bd('0x2'));exports[_0x36bd('0x3')]=function(_0x422fc4,_0x2d05f1){return function(){return client[_0x36bd('0x4')](_0x36bd('0x5'),{'options':{'where':{'VoiceQueueId':_0x422fc4},'include':[{'model':_0x36bd('0x6'),'as':'Contact'}],'limit':_0x2d05f1,'raw':![]},'log':_0x36bd('0x7')});};};exports[_0x36bd('0x8')]=function(_0x58f90f,_0x2a7a9d,_0x35da2d){return function(){return client[_0x36bd('0x4')](_0x36bd('0x9'),{'body':_0x58f90f,'options':{'where':{'VoiceQueueId':_0x2a7a9d,'scheduledat':{'$lte':moment()[_0x36bd('0xa')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x35da2d},'log':_0x36bd('0x9')});};};exports[_0x36bd('0xb')]=function(_0x46d82d){return function(){return client[_0x36bd('0x4')](_0x36bd('0x9'),{'body':_0x46d82d,'options':{'where':{'ContactId':_0x46d82d[_0x36bd('0xc')],'ListId':_0x46d82d[_0x36bd('0xd')],'VoiceQueueId':_0x46d82d[_0x36bd('0xe')],'CampaignId':_0x46d82d[_0x36bd('0xf')]}},'log':_0x36bd('0xb')});};};exports['destroyContact']=function(_0x2dd801,_0x33cc23,_0xd09c84){return function(){return client[_0x36bd('0x4')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x2dd801,'ListId':_0x33cc23,'ContactId':_0xd09c84}},'log':_0x36bd('0x10')});};};exports[_0x36bd('0x11')]=function(_0x26c707,_0x35dead,_0x99c6ab,_0x5b9f9c){return function(){return client[_0x36bd('0x4')](_0x36bd('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x26c707,'active':![],'scheduledat':{'$lte':moment()[_0x36bd('0xa')](_0x36bd('0x13'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x35dead}}]},'order':[[_0x36bd('0x14'),_0x36bd('0x15')],[_0x36bd('0x16'),_0x5b9f9c],['id',_0x36bd('0x17')]],'raw':!![],'limit':_0x99c6ab},'log':_0x36bd('0x12')});};};exports[_0x36bd('0x18')]=function(_0x164c6a,_0x1a551a,_0x3c5442){return function(){return client[_0x36bd('0x4')](_0x36bd('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x164c6a,'active':![],'scheduledat':{'$lte':moment()[_0x36bd('0xa')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x36bd('0x6'),'as':'Contact'}],'order':[['priority',_0x36bd('0x15')],[_0x36bd('0x16'),_0x3c5442],['id',_0x36bd('0x17')]],'raw':!![],'limit':_0x1a551a},'log':_0x36bd('0x19')});};};exports[_0x36bd('0x1a')]=function(_0x173e1e,_0x4d3018){return function(){_0x173e1e['campaign']=_0x173e1e['queue'];return client['Request'](_0x36bd('0x1b'),{'body':_0x173e1e,'options':{'where':{'ContactId':_0x173e1e['ContactId'],'ListId':_0x173e1e[_0x36bd('0xd')],'VoiceQueueId':_0x173e1e[_0x36bd('0xe')],'CampaignId':_0x173e1e[_0x36bd('0xf')],'active':_0x4d3018?undefined:!![]}},'log':_0x36bd('0x1b')});};};exports[_0x36bd('0x1c')]=function(_0x234990){return function(){return client[_0x36bd('0x4')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x234990['id']?_0x234990['id']||null:null}},'log':_0x36bd('0x1c')});};};exports[_0x36bd('0x1d')]=function(_0x2b2dc5){return function(){return client[_0x36bd('0x4')](_0x36bd('0x1e'),{'options':{'where':{'id':_0x2b2dc5},'include':[{'model':_0x36bd('0x6'),'as':_0x36bd('0x1f')},{'model':'User','as':_0x36bd('0x20'),'attributes':['id','name']},{'model':_0x36bd('0x21'),'as':_0x36bd('0x22'),'attributes':['id','name']}],'raw':!![]},'log':_0x36bd('0x7')});};};exports[_0x36bd('0x23')]=function(_0xeb2df4,_0x54c13c,_0x323821){return function(){return client[_0x36bd('0x4')](_0x36bd('0x9'),{'body':_0xeb2df4,'options':{'where':{'id':_0x54c13c},'limit':_0x323821},'log':_0x36bd('0x9')});};};exports['getContactRecallMe']=function(_0x12ad3d,_0x37b5dd){return function(){return client[_0x36bd('0x4')](_0x36bd('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x12ad3d,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x36bd('0x13'))},'UserId':{'$in':_0x37b5dd}},'order':[[_0x36bd('0x14'),_0x36bd('0x15')],[_0x36bd('0x16'),_0x36bd('0x15')],['id','ASC']],'include':[{'model':_0x36bd('0x6'),'as':_0x36bd('0x1f')},{'model':_0x36bd('0x25'),'as':_0x36bd('0x20'),'attributes':['id',_0x36bd('0x26'),_0x36bd('0x27')]}],'group':_0x36bd('0x28'),'raw':!![]},'log':'GetContactDialer'});};};
\ No newline at end of file
+var _0x7f67=['ListId','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','CmContact','Agent','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','User','name','voicePause','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ContactId','VoiceQueueId','rescheduleContact','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue'];(function(_0x33ef0b,_0x8b7f37){var _0x52be16=function(_0x526bfc){while(--_0x526bfc){_0x33ef0b['push'](_0x33ef0b['shift']());}};_0x52be16(++_0x8b7f37);}(_0x7f67,0x1c9));var _0x77f6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7f67[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x77f6('0x0'));var moment=require(_0x77f6('0x1'));var _=require(_0x77f6('0x2'));exports[_0x77f6('0x3')]=function(_0x2f7043,_0x1d0367){return function(){return client[_0x77f6('0x4')](_0x77f6('0x5'),{'options':{'where':{'VoiceQueueId':_0x2f7043},'include':[{'model':'CmContact','as':_0x77f6('0x6')}],'limit':_0x1d0367,'raw':![]},'log':_0x77f6('0x7')});};};exports[_0x77f6('0x8')]=function(_0x3b2b39,_0xc76cbd,_0x4d1fdf){return function(){return client['Request'](_0x77f6('0x9'),{'body':_0x3b2b39,'options':{'where':{'VoiceQueueId':_0xc76cbd,'scheduledat':{'$lte':moment()[_0x77f6('0xa')](_0x77f6('0xb'))}},'limit':_0x4d1fdf},'log':_0x77f6('0x9')});};};exports['rescheduleContact']=function(_0x450c70){return function(){return client[_0x77f6('0x4')]('UpdateCmHopper',{'body':_0x450c70,'options':{'where':{'ContactId':_0x450c70[_0x77f6('0xc')],'ListId':_0x450c70['ListId'],'VoiceQueueId':_0x450c70[_0x77f6('0xd')],'CampaignId':_0x450c70['CampaignId']}},'log':_0x77f6('0xe')});};};exports[_0x77f6('0xf')]=function(_0x3ff6b8,_0x3f4530,_0x358817){return function(){return client[_0x77f6('0x4')](_0x77f6('0x10'),{'options':{'where':{'VoiceQueueId':_0x3ff6b8,'ListId':_0x3f4530,'ContactId':_0x358817}},'log':_0x77f6('0x10')});};};exports[_0x77f6('0x11')]=function(_0x17dcac,_0x100534,_0x57503b,_0x4bd9d1){return function(){return client[_0x77f6('0x4')](_0x77f6('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x17dcac,'active':![],'scheduledat':{'$lte':moment()['format'](_0x77f6('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x100534}}]},'order':[[_0x77f6('0x13'),_0x77f6('0x14')],[_0x77f6('0x15'),_0x4bd9d1],['id',_0x77f6('0x16')]],'raw':!![],'limit':_0x57503b},'log':_0x77f6('0x12')});};};exports['getContactDialerIvr']=function(_0x5472b1,_0x54ba6c,_0x3c849b){return function(){return client[_0x77f6('0x4')](_0x77f6('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x5472b1,'active':![],'scheduledat':{'$lte':moment()[_0x77f6('0xa')](_0x77f6('0xb'))}},'include':[{'model':'CmContact','as':_0x77f6('0x6')}],'order':[['priority','DESC'],['scheduledat',_0x3c849b],['id','ASC']],'raw':!![],'limit':_0x54ba6c},'log':_0x77f6('0x17')});};};exports[_0x77f6('0x18')]=function(_0x241851,_0x32c60d){return function(){_0x241851[_0x77f6('0x19')]=_0x241851[_0x77f6('0x1a')];return client[_0x77f6('0x4')]('MoveContactManagedDialer',{'body':_0x241851,'options':{'where':{'ContactId':_0x241851[_0x77f6('0xc')],'ListId':_0x241851[_0x77f6('0x1b')],'VoiceQueueId':_0x241851['VoiceQueueId'],'CampaignId':_0x241851['CampaignId'],'active':_0x32c60d?undefined:!![]}},'log':_0x77f6('0x1c')});};};exports[_0x77f6('0x1d')]=function(_0xbd9ecf){return function(){return client[_0x77f6('0x4')](_0x77f6('0x1e'),{'options':{'where':{'VoiceQueueId':_0xbd9ecf['id']?_0xbd9ecf['id']||null:null}},'log':'countReScheduled'});};};exports[_0x77f6('0x1f')]=function(_0x244ae2){return function(){return client['Request'](_0x77f6('0x20'),{'options':{'where':{'id':_0x244ae2},'include':[{'model':_0x77f6('0x21'),'as':'Contact'},{'model':'User','as':_0x77f6('0x22'),'attributes':['id','name']},{'model':_0x77f6('0x23'),'as':_0x77f6('0x24'),'attributes':['id','name']}],'raw':!![]},'log':_0x77f6('0x7')});};};exports[_0x77f6('0x25')]=function(_0x4ed387,_0x5de9bd,_0x5a36f2){return function(){return client[_0x77f6('0x4')](_0x77f6('0x9'),{'body':_0x4ed387,'options':{'where':{'id':_0x5de9bd},'limit':_0x5a36f2},'log':_0x77f6('0x9')});};};exports[_0x77f6('0x26')]=function(_0x53a8b5,_0x5b34cd){return function(){return client[_0x77f6('0x4')](_0x77f6('0x27'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x53a8b5,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x77f6('0xa')](_0x77f6('0xb'))},'UserId':{'$in':_0x5b34cd}},'order':[['priority',_0x77f6('0x14')],[_0x77f6('0x15'),_0x77f6('0x14')],['id','ASC']],'include':[{'model':_0x77f6('0x21'),'as':_0x77f6('0x6')},{'model':_0x77f6('0x28'),'as':_0x77f6('0x22'),'attributes':['id',_0x77f6('0x29'),_0x77f6('0x2a')]}],'group':_0x77f6('0x2b'),'raw':!![]},'log':_0x77f6('0x12')});};};
\ No newline at end of file
index 5cbc95a..9fc9a5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84a0=['phone','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','VoiceQueueId','Contact','checkIsBlackListIvr','GetCmHopperBlack','CampaignId'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x84a0,0x66));var _0x084a=function(_0x5f4cbc,_0x28fad7){_0x5f4cbc=_0x5f4cbc-0x0;var _0x3c7140=_0x84a0[_0x5f4cbc];return _0x3c7140;};'use strict';var client=require(_0x084a('0x0'));exports[_0x084a('0x1')]=function(_0x209635){return function(){return client[_0x084a('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x209635[_0x084a('0x3')],'phone':_0x209635[_0x084a('0x4')]['phone']},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x084a('0x5')]=function(_0x1c0292){return function(){return client['Request'](_0x084a('0x6'),{'options':{'where':{'CampaignId':_0x1c0292[_0x084a('0x7')],'phone':_0x1c0292[_0x084a('0x4')][_0x084a('0x8')]},'raw':![]},'log':_0x084a('0x9')});};};
\ No newline at end of file
+var _0x97c1=['Request','Contact','phone','GetCmHopperBlack','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList'];(function(_0x476028,_0x101fd4){var _0x553c73=function(_0x368e7b){while(--_0x368e7b){_0x476028['push'](_0x476028['shift']());}};_0x553c73(++_0x101fd4);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x197c('0x0'));exports[_0x197c('0x1')]=function(_0x55b95a){return function(){return client[_0x197c('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x55b95a['VoiceQueueId'],'phone':_0x55b95a[_0x197c('0x3')][_0x197c('0x4')]},'raw':![]},'log':_0x197c('0x5')});};};exports[_0x197c('0x6')]=function(_0x40863c){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x40863c[_0x197c('0x7')],'phone':_0x40863c[_0x197c('0x3')][_0x197c('0x4')]},'raw':![]},'log':_0x197c('0x8')});};};
\ No newline at end of file
index e88483b..bca85e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1c8=['createContact','campaign','queue','Request','CreateCmHopperFinal','../client'];(function(_0x16b326,_0x42d329){var _0x18617b=function(_0xe49b9e){while(--_0xe49b9e){_0x16b326['push'](_0x16b326['shift']());}};_0x18617b(++_0x42d329);}(_0xd1c8,0xb9));var _0x8d1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1c8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8d1c('0x0'));exports[_0x8d1c('0x1')]=function(_0x1b5114){return function(){_0x1b5114[_0x8d1c('0x2')]=_0x1b5114[_0x8d1c('0x3')];return client[_0x8d1c('0x4')](_0x8d1c('0x5'),{'body':_0x1b5114,'log':_0x8d1c('0x5')});};};
\ No newline at end of file
+var _0xfc7a=['queue','Request','CreateCmHopperFinal','../client','createContact','campaign'];(function(_0x57836b,_0x5767da){var _0x509dc8=function(_0x7a30d4){while(--_0x7a30d4){_0x57836b['push'](_0x57836b['shift']());}};_0x509dc8(++_0x5767da);}(_0xfc7a,0x87));var _0xafc7=function(_0x3b9703,_0x4ec964){_0x3b9703=_0x3b9703-0x0;var _0x1bb1cb=_0xfc7a[_0x3b9703];return _0x1bb1cb;};'use strict';var client=require(_0xafc7('0x0'));exports[_0xafc7('0x1')]=function(_0x4b9f8a){return function(){_0x4b9f8a[_0xafc7('0x2')]=_0x4b9f8a[_0xafc7('0x3')];return client[_0xafc7('0x4')](_0xafc7('0x5'),{'body':_0x4b9f8a,'log':_0xafc7('0x5')});};};
\ No newline at end of file
index 11040ee..4ea05d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e3f=['AvgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','GetCampaignHopperHistory','createHistory','campaign','queue','Request','CreateCmHopperHistory'];(function(_0x4aca4d,_0x4b1370){var _0x5ccddc=function(_0x539896){while(--_0x539896){_0x4aca4d['push'](_0x4aca4d['shift']());}};_0x5ccddc(++_0x4b1370);}(_0x6e3f,0x6b));var _0xf6e3=function(_0x12c086,_0x48f220){_0x12c086=_0x12c086-0x0;var _0x1948b6=_0x6e3f[_0x12c086];return _0x1948b6;};'use strict';var client=require('../client');var moment=require('moment');exports[_0xf6e3('0x0')]=function(_0x5740c4){return function(){_0x5740c4[_0xf6e3('0x1')]=_0x5740c4[_0xf6e3('0x2')];return client[_0xf6e3('0x3')]('CreateCmHopperHistory',{'body':_0x5740c4,'log':_0xf6e3('0x4')});};};exports['avgHandleTime']=function(_0x37b796){return function(){return client[_0xf6e3('0x3')](_0xf6e3('0x5'),{'options':{'where':{'endtime':{'$between':[moment()[_0xf6e3('0x6')](_0x37b796,'minutes')[_0xf6e3('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0xf6e3('0x8'))]}},'raw':![]},'log':_0xf6e3('0x9')});};};exports[_0xf6e3('0xa')]=function(_0x18fb95){return function(){return client[_0xf6e3('0x3')](_0xf6e3('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xf6e3('0xc')](_0xf6e3('0xd'))[_0xf6e3('0x7')](_0xf6e3('0x8')),moment()[_0xf6e3('0xe')](_0xf6e3('0xd'))[_0xf6e3('0x7')](_0xf6e3('0x8'))]},'campaigntype':_0xf6e3('0x2')},'raw':![]},'log':_0xf6e3('0xb')});};};exports['getCampaignHopperHistory']=function(_0x1dd036){return function(){return client[_0xf6e3('0x3')](_0xf6e3('0xf'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xf6e3('0x7')](_0xf6e3('0x8')),moment()[_0xf6e3('0xe')](_0xf6e3('0xd'))[_0xf6e3('0x7')](_0xf6e3('0x8'))]},'campaigntype':'ivr'},'raw':![]},'log':_0xf6e3('0xf')});};};
\ No newline at end of file
+var _0x7818=['YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','ivr','../client','moment','createHistory','campaign','Request','avgHandleTime','AvgHandleTime','subtract','format'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x7818,0xe1));var _0x8781=function(_0x2cb898,_0x2c1871){_0x2cb898=_0x2cb898-0x0;var _0x2f1132=_0x7818[_0x2cb898];return _0x2f1132;};'use strict';var client=require(_0x8781('0x0'));var moment=require(_0x8781('0x1'));exports[_0x8781('0x2')]=function(_0x187747){return function(){_0x187747[_0x8781('0x3')]=_0x187747['queue'];return client[_0x8781('0x4')]('CreateCmHopperHistory',{'body':_0x187747,'log':'CreateCmHopperHistory'});};};exports[_0x8781('0x5')]=function(_0x356b3c){return function(){return client[_0x8781('0x4')](_0x8781('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0x8781('0x7')](_0x356b3c,'minutes')[_0x8781('0x8')](_0x8781('0x9')),moment()['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0x8781('0xa')});};};exports[_0x8781('0xb')]=function(_0x408aba){return function(){return client['Request'](_0x8781('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x8781('0xd')](_0x8781('0xe'))[_0x8781('0x8')](_0x8781('0x9')),moment()[_0x8781('0xf')](_0x8781('0xe'))[_0x8781('0x8')](_0x8781('0x9'))]},'campaigntype':'queue'},'raw':![]},'log':_0x8781('0xc')});};};exports[_0x8781('0x10')]=function(_0x58f75c){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x8781('0xd')](_0x8781('0xe'))[_0x8781('0x8')](_0x8781('0x9')),moment()[_0x8781('0xf')]('day')[_0x8781('0x8')](_0x8781('0x9'))]},'campaigntype':_0x8781('0x11')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 5314557..3c39878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf19c=['getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','name','description','headerinfo','localstationid','minrate','maxrate','modem','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','callerid','active'];(function(_0x16274f,_0x41c3a0){var _0x31fa71=function(_0x13f816){while(--_0x13f816){_0x16274f['push'](_0x16274f['shift']());}};_0x31fa71(++_0x41c3a0);}(_0xf19c,0x10b));var _0xcf19=function(_0x495fd8,_0x49b55d){_0x495fd8=_0x495fd8-0x0;var _0x511a23=_0xf19c[_0x495fd8];return _0x511a23;};'use strict';var client=require(_0xcf19('0x0'));exports[_0xcf19('0x1')]=function(){return function(){return client[_0xcf19('0x2')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0xcf19('0x3'),_0xcf19('0x4'),'ecm',_0xcf19('0x5'),_0xcf19('0x6'),_0xcf19('0x7'),_0xcf19('0x8'),_0xcf19('0x9'),'gateway',_0xcf19('0xa'),_0xcf19('0xb'),_0xcf19('0xc'),_0xcf19('0xd'),_0xcf19('0xe'),_0xcf19('0xf')],'include':[{'model':'Trunk','as':_0xcf19('0x10'),'attributes':['id',_0xcf19('0x3'),_0xcf19('0x11'),_0xcf19('0x12')]}]},'log':_0xcf19('0x13')});};};exports[_0xcf19('0x14')]=function(_0x3c9355,_0x123ff4){return client[_0xcf19('0x2')]('NotifyFaxAccount',{'account':{'id':_0x3c9355},'body':_0x123ff4,'log':_0xcf19('0x15')});};
\ No newline at end of file
+var _0xf777=['description','ecm','headerinfo','localstationid','maxrate','modem','faxdetect','tech','ListId','key','Trunk','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xf777,0x1e9));var _0x7f77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf777[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x7f77('0x0'));exports[_0x7f77('0x1')]=function(){return function(){return client[_0x7f77('0x2')](_0x7f77('0x3'),{'options':{'raw':![],'attributes':['id',_0x7f77('0x4'),_0x7f77('0x5'),_0x7f77('0x6'),_0x7f77('0x7'),_0x7f77('0x8'),'minrate',_0x7f77('0x9'),_0x7f77('0xa'),'gateway',_0x7f77('0xb'),'t38timeout',_0x7f77('0xc'),'TrunkId',_0x7f77('0xd'),_0x7f77('0xe')],'include':[{'model':_0x7f77('0xf'),'as':_0x7f77('0xf'),'attributes':['id',_0x7f77('0x4'),'callerid','active']}]},'log':_0x7f77('0x10')});};};exports[_0x7f77('0x11')]=function(_0x284329,_0x110aaa){return client[_0x7f77('0x2')]('NotifyFaxAccount',{'account':{'id':_0x284329},'body':_0x110aaa,'log':_0x7f77('0x12')});};
\ No newline at end of file
index 777293f..6eff180 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a5e=['UpdateFaxMessage','../client','update'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x6a5e,0xee));var _0xe6a5=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x6a5e[_0x9aada2];return _0x196dff;};'use strict';var client=require(_0xe6a5('0x0'));exports[_0xe6a5('0x1')]=function(_0x259e96,_0x5d35e3){return client['Request'](_0xe6a5('0x2'),{'body':_0x5d35e3,'options':{'where':{'AttachmentId':_0x259e96}},'log':_0xe6a5('0x2')});};
\ No newline at end of file
+var _0xc942=['UpdateFaxMessage','update','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc942,0x1d5));var _0x2c94=function(_0x551de2,_0x323d87){_0x551de2=_0x551de2-0x0;var _0x2d6e56=_0xc942[_0x551de2];return _0x2d6e56;};'use strict';var client=require('../client');exports[_0x2c94('0x0')]=function(_0x2664ec,_0x520a3e){return client[_0x2c94('0x1')](_0x2c94('0x2'),{'body':_0x520a3e,'options':{'where':{'AttachmentId':_0x2664ec}},'log':_0x2c94('0x2')});};
\ No newline at end of file
index 3d46e05..7e5a195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b4c=['password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','Subjects','content','variableName','Variable','Descriptions','keyType','DeskField','Fields','idField','nameField','customField','Tags','Request','GetDeskAccount','name','description'];(function(_0x181c47,_0x2276ff){var _0x1989d8=function(_0x4816cc){while(--_0x4816cc){_0x181c47['push'](_0x181c47['shift']());}};_0x1989d8(++_0x2276ff);}(_0x0b4c,0x86));var _0xc0b4=function(_0x1f79fe,_0x1f52c5){_0x1f79fe=_0x1f79fe-0x0;var _0x10cc48=_0x0b4c[_0x1f79fe];return _0x10cc48;};'use strict';var client=require('../../client');exports['getDeskAccounts']=function(){return function(_0x46eb9b){return client[_0xc0b4('0x0')](_0xc0b4('0x1'),{'options':{'raw':![],'attributes':['id',_0xc0b4('0x2'),_0xc0b4('0x3'),'username',_0xc0b4('0x4'),_0xc0b4('0x5'),_0xc0b4('0x6'),_0xc0b4('0x7'),_0xc0b4('0x8')],'include':[{'model':_0xc0b4('0x9'),'as':_0xc0b4('0xa'),'attributes':['id',_0xc0b4('0x2')],'include':[{'model':'DeskField','as':_0xc0b4('0xb'),'attributes':['id','type',_0xc0b4('0xc'),_0xc0b4('0xd')],'include':[{'model':_0xc0b4('0xe'),'as':_0xc0b4('0xe'),'attributes':['id','name']}]},{'model':'DeskField','as':_0xc0b4('0xf'),'attributes':['id',_0xc0b4('0x7'),'content','key',_0xc0b4('0x10'),'keyContent',_0xc0b4('0xd')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xc0b4('0x2')]}]},{'model':_0xc0b4('0x11'),'as':_0xc0b4('0x12'),'attributes':['id',_0xc0b4('0x7'),_0xc0b4('0xc'),_0xc0b4('0x13'),_0xc0b4('0x14'),_0xc0b4('0x15'),_0xc0b4('0xd')],'include':[{'model':_0xc0b4('0xe'),'as':_0xc0b4('0xe'),'attributes':['id',_0xc0b4('0x2')]}]},{'model':'Tag','as':_0xc0b4('0x16'),'attributes':['id','name']}]}]},'log':_0xc0b4('0x1')});};};
\ No newline at end of file
+var _0x6f60=['Variable','Descriptions','content','key','keyType','keyContent','variableName','Fields','Tags','getDeskAccounts','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects'];(function(_0x30b7e2,_0xcc9cbc){var _0x127551=function(_0x40461c){while(--_0x40461c){_0x30b7e2['push'](_0x30b7e2['shift']());}};_0x127551(++_0xcc9cbc);}(_0x6f60,0x1d5));var _0x06f6=function(_0x354a22,_0x18c53a){_0x354a22=_0x354a22-0x0;var _0x533fbc=_0x6f60[_0x354a22];return _0x533fbc;};'use strict';var client=require('../../client');exports[_0x06f6('0x0')]=function(){return function(_0x7bb93){return client['Request'](_0x06f6('0x1'),{'options':{'raw':![],'attributes':['id',_0x06f6('0x2'),_0x06f6('0x3'),_0x06f6('0x4'),_0x06f6('0x5'),_0x06f6('0x6'),_0x06f6('0x7'),_0x06f6('0x8'),_0x06f6('0x9')],'include':[{'model':_0x06f6('0xa'),'as':_0x06f6('0xb'),'attributes':['id',_0x06f6('0x2')],'include':[{'model':_0x06f6('0xc'),'as':_0x06f6('0xd'),'attributes':['id',_0x06f6('0x8'),'content','variableName'],'include':[{'model':_0x06f6('0xe'),'as':'Variable','attributes':['id',_0x06f6('0x2')]}]},{'model':'DeskField','as':_0x06f6('0xf'),'attributes':['id',_0x06f6('0x8'),_0x06f6('0x10'),_0x06f6('0x11'),_0x06f6('0x12'),_0x06f6('0x13'),_0x06f6('0x14')],'include':[{'model':_0x06f6('0xe'),'as':_0x06f6('0xe'),'attributes':['id',_0x06f6('0x2')]}]},{'model':'DeskField','as':_0x06f6('0x15'),'attributes':['id',_0x06f6('0x8'),_0x06f6('0x10'),'idField','nameField','customField',_0x06f6('0x14')],'include':[{'model':_0x06f6('0xe'),'as':_0x06f6('0xe'),'attributes':['id',_0x06f6('0x2')]}]},{'model':'Tag','as':_0x06f6('0x16'),'attributes':['id',_0x06f6('0x2')]}]}]},'log':_0x06f6('0x1')});};};
\ No newline at end of file
index ad92e1b..2fb8124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cae=['name','username','password','remoteUri','tenantId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field','Subjects','content','variableName','Variable','type','key','keyType','keyContent','idField','nameField','customField','GetDynamics365Account'];(function(_0x1febe5,_0x673d63){var _0x4e7d42=function(_0x317200){while(--_0x317200){_0x1febe5['push'](_0x1febe5['shift']());}};_0x4e7d42(++_0x673d63);}(_0x1cae,0x17f));var _0xe1ca=function(_0x5de1d4,_0x214c1c){_0x5de1d4=_0x5de1d4-0x0;var _0x3426a0=_0x1cae[_0x5de1d4];return _0x3426a0;};'use strict';var client=require('../../client');exports['getDynamics365Accounts']=function(){return function(_0x3f8099){return client['Request'](_0xe1ca('0x0'),{'options':{'raw':![],'attributes':['id',_0xe1ca('0x1'),_0xe1ca('0x2'),_0xe1ca('0x3'),_0xe1ca('0x4'),_0xe1ca('0x5'),'clientId',_0xe1ca('0x6'),_0xe1ca('0x7'),_0xe1ca('0x8')],'include':[{'model':_0xe1ca('0x9'),'as':_0xe1ca('0xa'),'attributes':['id',_0xe1ca('0x1'),_0xe1ca('0xb')],'include':[{'model':_0xe1ca('0xc'),'as':_0xe1ca('0xd'),'attributes':['id','type',_0xe1ca('0xe'),_0xe1ca('0xf')],'include':[{'model':'Variable','as':_0xe1ca('0x10'),'attributes':['id',_0xe1ca('0x1')]}]},{'model':_0xe1ca('0xc'),'as':'Descriptions','attributes':['id',_0xe1ca('0x11'),'content',_0xe1ca('0x12'),_0xe1ca('0x13'),_0xe1ca('0x14'),'variableName'],'include':[{'model':_0xe1ca('0x10'),'as':_0xe1ca('0x10'),'attributes':['id',_0xe1ca('0x1')]}]},{'model':_0xe1ca('0xc'),'as':'Fields','attributes':['id',_0xe1ca('0x11'),_0xe1ca('0xe'),_0xe1ca('0x15'),_0xe1ca('0x16'),_0xe1ca('0x17'),_0xe1ca('0xf')],'include':[{'model':_0xe1ca('0x10'),'as':_0xe1ca('0x10'),'attributes':['id','name']}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0xa82a=['Dynamics365Field','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','idField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','remoteUri','clientId','description','Configurations','ticketType'];(function(_0x107241,_0x2069eb){var _0x582fdb=function(_0x20cff7){while(--_0x20cff7){_0x107241['push'](_0x107241['shift']());}};_0x582fdb(++_0x2069eb);}(_0xa82a,0x17b));var _0xaa82=function(_0x1f862e,_0x58b9c3){_0x1f862e=_0x1f862e-0x0;var _0x208297=_0xa82a[_0x1f862e];return _0x208297;};'use strict';var client=require(_0xaa82('0x0'));exports[_0xaa82('0x1')]=function(){return function(_0x5b86b2){return client[_0xaa82('0x2')](_0xaa82('0x3'),{'options':{'raw':![],'attributes':['id',_0xaa82('0x4'),_0xaa82('0x5'),_0xaa82('0x6'),_0xaa82('0x7'),'tenantId',_0xaa82('0x8'),'clientSecret','serverUrl',_0xaa82('0x9')],'include':[{'model':'Dynamics365Configuration','as':_0xaa82('0xa'),'attributes':['id',_0xaa82('0x4'),_0xaa82('0xb')],'include':[{'model':_0xaa82('0xc'),'as':_0xaa82('0xd'),'attributes':['id',_0xaa82('0xe'),_0xaa82('0xf'),_0xaa82('0x10')],'include':[{'model':_0xaa82('0x11'),'as':_0xaa82('0x11'),'attributes':['id',_0xaa82('0x4')]}]},{'model':'Dynamics365Field','as':_0xaa82('0x12'),'attributes':['id',_0xaa82('0xe'),_0xaa82('0xf'),_0xaa82('0x13'),_0xaa82('0x14'),_0xaa82('0x15'),_0xaa82('0x10')],'include':[{'model':_0xaa82('0x11'),'as':'Variable','attributes':['id',_0xaa82('0x4')]}]},{'model':_0xaa82('0xc'),'as':'Fields','attributes':['id',_0xaa82('0xe'),_0xaa82('0xf'),_0xaa82('0x16'),'nameField','customField','variableName'],'include':[{'model':_0xaa82('0x11'),'as':_0xaa82('0x11'),'attributes':['id',_0xaa82('0x4')]}]}]}]},'log':_0xaa82('0x3')});};};
\ No newline at end of file
index d6c0d06..738eedf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f19=['Configurations','name','Tag','FreshdeskField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField','customField','../../client','GetFreshdeskAccount','username','apiKey','remoteUri','serverUrl'];(function(_0x147244,_0x47ab93){var _0x3376da=function(_0x534c92){while(--_0x534c92){_0x147244['push'](_0x147244['shift']());}};_0x3376da(++_0x47ab93);}(_0x3f19,0xc0));var _0x93f1=function(_0x37db9f,_0x4c93ed){_0x37db9f=_0x37db9f-0x0;var _0x48fb29=_0x3f19[_0x37db9f];return _0x48fb29;};'use strict';var client=require(_0x93f1('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x5430d0){return client['Request'](_0x93f1('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x93f1('0x2'),_0x93f1('0x3'),_0x93f1('0x4'),_0x93f1('0x5')],'include':[{'model':'FreshdeskConfiguration','as':_0x93f1('0x6'),'attributes':['id',_0x93f1('0x7')],'include':[{'model':_0x93f1('0x8'),'attributes':['id',_0x93f1('0x7')]},{'model':_0x93f1('0x9'),'as':_0x93f1('0xa'),'attributes':['id','type',_0x93f1('0xb'),_0x93f1('0xc')],'include':[{'model':_0x93f1('0xd'),'as':_0x93f1('0xd'),'attributes':['id',_0x93f1('0x7')]}]},{'model':'FreshdeskField','as':_0x93f1('0xe'),'attributes':['id',_0x93f1('0xf'),_0x93f1('0xb'),_0x93f1('0x10'),_0x93f1('0x11'),_0x93f1('0x12'),_0x93f1('0xc')],'include':[{'model':_0x93f1('0xd'),'as':_0x93f1('0xd'),'attributes':['id',_0x93f1('0x7')]}]},{'model':'FreshdeskField','as':_0x93f1('0x13'),'attributes':['id',_0x93f1('0xf'),_0x93f1('0xb'),_0x93f1('0x14'),'nameField',_0x93f1('0x15'),_0x93f1('0xc')],'include':[{'model':_0x93f1('0xd'),'as':_0x93f1('0xd'),'attributes':['id',_0x93f1('0x7')]}]}]}]},'log':_0x93f1('0x1')});};};
\ No newline at end of file
+var _0xcae2=['variableName','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','Descriptions','content','key','keyContent','Variable','Fields','idField','customField'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x2cae('0x0'));exports[_0x2cae('0x1')]=function(){return function(_0x207474){return client[_0x2cae('0x2')](_0x2cae('0x3'),{'options':{'raw':![],'attributes':['id',_0x2cae('0x4'),_0x2cae('0x5'),'apiKey',_0x2cae('0x6'),_0x2cae('0x7')],'include':[{'model':_0x2cae('0x8'),'as':_0x2cae('0x9'),'attributes':['id','name'],'include':[{'model':_0x2cae('0xa'),'attributes':['id',_0x2cae('0x4')]},{'model':_0x2cae('0xb'),'as':_0x2cae('0xc'),'attributes':['id',_0x2cae('0xd'),'content','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x2cae('0x4')]}]},{'model':_0x2cae('0xb'),'as':_0x2cae('0xe'),'attributes':['id',_0x2cae('0xd'),_0x2cae('0xf'),_0x2cae('0x10'),'keyType',_0x2cae('0x11'),'variableName'],'include':[{'model':_0x2cae('0x12'),'as':_0x2cae('0x12'),'attributes':['id',_0x2cae('0x4')]}]},{'model':_0x2cae('0xb'),'as':_0x2cae('0x13'),'attributes':['id',_0x2cae('0xd'),'content',_0x2cae('0x14'),'nameField',_0x2cae('0x15'),_0x2cae('0x16')],'include':[{'model':'Variable','as':_0x2cae('0x12'),'attributes':['id',_0x2cae('0x4')]}]}]}]},'log':_0x2cae('0x3')});};};
\ No newline at end of file
index f176dbb..af300c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['name','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x13f5,0xc3));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x513f('0x0'));exports[_0x513f('0x1')]=function(){return function(_0x207876){return client[_0x513f('0x2')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x513f('0x3'),'username','apiKey',_0x513f('0x4'),_0x513f('0x5')],'include':[{'model':_0x513f('0x6'),'as':_0x513f('0x7'),'attributes':['id',_0x513f('0x3')],'include':[{'model':_0x513f('0x8'),'as':_0x513f('0x9'),'attributes':['id',_0x513f('0xa'),_0x513f('0xb'),_0x513f('0xc')],'include':[{'model':_0x513f('0xd'),'as':_0x513f('0xd'),'attributes':['id','name']}]},{'model':_0x513f('0x8'),'as':_0x513f('0xe'),'attributes':['id',_0x513f('0xa'),_0x513f('0xb'),_0x513f('0xf'),'keyType',_0x513f('0x10'),_0x513f('0xc')],'include':[{'model':'Variable','as':_0x513f('0xd'),'attributes':['id',_0x513f('0x3')]}]}]}]},'log':_0x513f('0x11')});};};
\ No newline at end of file
+var _0x1224=['type','content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','apiKey','remoteUri','serverUrl','Configurations','FreshsalesField','Subjects'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x1224,0x10d));var _0x4122=function(_0x204c82,_0x5bd73e){_0x204c82=_0x204c82-0x0;var _0x2c7553=_0x1224[_0x204c82];return _0x2c7553;};'use strict';var client=require(_0x4122('0x0'));exports[_0x4122('0x1')]=function(){return function(_0x23c391){return client[_0x4122('0x2')](_0x4122('0x3'),{'options':{'raw':![],'attributes':['id',_0x4122('0x4'),'username',_0x4122('0x5'),_0x4122('0x6'),_0x4122('0x7')],'include':[{'model':'FreshsalesConfiguration','as':_0x4122('0x8'),'attributes':['id',_0x4122('0x4')],'include':[{'model':_0x4122('0x9'),'as':_0x4122('0xa'),'attributes':['id',_0x4122('0xb'),_0x4122('0xc'),_0x4122('0xd')],'include':[{'model':_0x4122('0xe'),'as':_0x4122('0xe'),'attributes':['id',_0x4122('0x4')]}]},{'model':_0x4122('0x9'),'as':_0x4122('0xf'),'attributes':['id',_0x4122('0xb'),_0x4122('0xc'),_0x4122('0x10'),_0x4122('0x11'),_0x4122('0x12'),_0x4122('0xd')],'include':[{'model':_0x4122('0xe'),'as':_0x4122('0xe'),'attributes':['id',_0x4122('0x4')]}]}]}]},'log':_0x4122('0x13')});};};
\ No newline at end of file
index 8236825..e701f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3b2=['GetSalesforceAccount','name','username','clientId','clientSecret','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchLead','Variable','Descriptions','Fields','../../client','Request'];(function(_0x1f3890,_0x2f9aad){var _0x4af351=function(_0xd4cdfa){while(--_0xd4cdfa){_0x1f3890['push'](_0x1f3890['shift']());}};_0x4af351(++_0x2f9aad);}(_0xf3b2,0x152));var _0x2f3b=function(_0x129216,_0x5c208d){_0x129216=_0x129216-0x0;var _0x2a0306=_0xf3b2[_0x129216];return _0x2a0306;};'use strict';var client=require(_0x2f3b('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x440fa5){return client[_0x2f3b('0x1')](_0x2f3b('0x2'),{'options':{'raw':![],'attributes':['id',_0x2f3b('0x3'),_0x2f3b('0x4'),'password','remoteUri',_0x2f3b('0x5'),_0x2f3b('0x6'),'securityToken',_0x2f3b('0x7'),_0x2f3b('0x8')],'include':[{'model':_0x2f3b('0x9'),'as':_0x2f3b('0xa'),'attributes':['id',_0x2f3b('0x3'),_0x2f3b('0xb'),_0x2f3b('0xc'),_0x2f3b('0xd'),_0x2f3b('0xe'),_0x2f3b('0xf'),'additionalSearchContact',_0x2f3b('0x10')],'include':[{'model':'SalesforceField','as':'Subjects','include':[{'model':_0x2f3b('0x11'),'as':_0x2f3b('0x11'),'attributes':['id',_0x2f3b('0x3')]}]},{'model':'SalesforceField','as':_0x2f3b('0x12'),'include':[{'model':'Variable','as':_0x2f3b('0x11'),'attributes':['id','name']}]},{'model':'SalesforceField','as':_0x2f3b('0x13'),'include':[{'model':_0x2f3b('0x11'),'as':'Variable','attributes':['id',_0x2f3b('0x3')]}]}]}]},'log':_0x2f3b('0x2')});};};
\ No newline at end of file
+var _0x6478=['additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','password','remoteUri','clientId','clientSecret','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount'];(function(_0x8ef835,_0x2e5b80){var _0x57d9d8=function(_0x4ed311){while(--_0x4ed311){_0x8ef835['push'](_0x8ef835['shift']());}};_0x57d9d8(++_0x2e5b80);}(_0x6478,0x1e7));var _0x8647=function(_0x49155d,_0x2bb881){_0x49155d=_0x49155d-0x0;var _0x4c5f0f=_0x6478[_0x49155d];return _0x4c5f0f;};'use strict';var client=require(_0x8647('0x0'));exports[_0x8647('0x1')]=function(){return function(_0x17555a){return client[_0x8647('0x2')](_0x8647('0x3'),{'options':{'raw':![],'attributes':['id',_0x8647('0x4'),'username',_0x8647('0x5'),_0x8647('0x6'),_0x8647('0x7'),_0x8647('0x8'),'securityToken','serverUrl',_0x8647('0x9')],'include':[{'model':_0x8647('0xa'),'as':_0x8647('0xb'),'attributes':['id',_0x8647('0x4'),_0x8647('0xc'),_0x8647('0xd'),_0x8647('0xe'),_0x8647('0xf'),_0x8647('0x10'),_0x8647('0x11'),_0x8647('0x12')],'include':[{'model':_0x8647('0x13'),'as':_0x8647('0x14'),'include':[{'model':_0x8647('0x15'),'as':_0x8647('0x15'),'attributes':['id',_0x8647('0x4')]}]},{'model':_0x8647('0x13'),'as':_0x8647('0x16'),'include':[{'model':_0x8647('0x15'),'as':'Variable','attributes':['id',_0x8647('0x4')]}]},{'model':'SalesforceField','as':_0x8647('0x17'),'include':[{'model':_0x8647('0x15'),'as':_0x8647('0x15'),'attributes':['id',_0x8647('0x4')]}]}]}]},'log':_0x8647('0x3')});};};
\ No newline at end of file
index a614682..ce3fc2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['description','username','password','email','remoteUri','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','variableName','Variable','content','key','keyType','keyContent','Fields','idField','nameField','customField','GetServicenowkAccount','getServicenowAccounts','Request','GetServicenowAccount','name'];(function(_0xb11cbd,_0x4be27b){var _0x1e1894=function(_0x2fce79){while(--_0x2fce79){_0xb11cbd['push'](_0xb11cbd['shift']());}};_0x1e1894(++_0x4be27b);}(_0x1967,0x173));var _0x7196=function(_0x50d4a7,_0x1a7a2e){_0x50d4a7=_0x50d4a7-0x0;var _0x54f2d0=_0x1967[_0x50d4a7];return _0x54f2d0;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),'serverUrl'],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0xb'),'as':_0x7196('0xc'),'attributes':['id',_0x7196('0xd'),'content',_0x7196('0xe')],'include':[{'model':_0x7196('0xf'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0xb'),'as':'Descriptions','attributes':['id','type',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0xe')],'include':[{'model':_0x7196('0xf'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0xb'),'as':_0x7196('0x14'),'attributes':['id',_0x7196('0xd'),'content',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0xe')],'include':[{'model':'Variable','as':_0x7196('0xf'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x18')});};};
\ No newline at end of file
+var _0x53ec=['customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','username','email','remoteUri','ServicenowConfiguration','ServicenowField','type','content','variableName','Variable','Descriptions','keyType','idField','nameField'];(function(_0x5a402a,_0x3836a3){var _0x59a91d=function(_0x321d5a){while(--_0x321d5a){_0x5a402a['push'](_0x5a402a['shift']());}};_0x59a91d(++_0x3836a3);}(_0x53ec,0x192));var _0xc53e=function(_0x4c11fb,_0x32dbc0){_0x4c11fb=_0x4c11fb-0x0;var _0x4caf73=_0x53ec[_0x4c11fb];return _0x4caf73;};'use strict';var client=require(_0xc53e('0x0'));exports[_0xc53e('0x1')]=function(){return function(_0x2d5f51){return client[_0xc53e('0x2')](_0xc53e('0x3'),{'options':{'raw':![],'attributes':['id',_0xc53e('0x4'),'description',_0xc53e('0x5'),'password',_0xc53e('0x6'),_0xc53e('0x7'),'serverUrl'],'include':[{'model':_0xc53e('0x8'),'as':'Configurations','attributes':['id',_0xc53e('0x4')],'include':[{'model':_0xc53e('0x9'),'as':'Subjects','attributes':['id',_0xc53e('0xa'),_0xc53e('0xb'),_0xc53e('0xc')],'include':[{'model':_0xc53e('0xd'),'as':_0xc53e('0xd'),'attributes':['id',_0xc53e('0x4')]}]},{'model':_0xc53e('0x9'),'as':_0xc53e('0xe'),'attributes':['id',_0xc53e('0xa'),'content','key',_0xc53e('0xf'),'keyContent','variableName'],'include':[{'model':_0xc53e('0xd'),'as':_0xc53e('0xd'),'attributes':['id',_0xc53e('0x4')]}]},{'model':_0xc53e('0x9'),'as':'Fields','attributes':['id','type',_0xc53e('0xb'),_0xc53e('0x10'),_0xc53e('0x11'),_0xc53e('0x12'),_0xc53e('0xc')],'include':[{'model':_0xc53e('0xd'),'as':_0xc53e('0xd'),'attributes':['id',_0xc53e('0x4')]}]}]}]},'log':_0xc53e('0x13')});};};
\ No newline at end of file
index 7e9bb79..d7857f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0xda2d,0x102));var _0xdda2=function(_0x11ff43,_0x3234a3){_0x11ff43=_0x11ff43-0x0;var _0x535919=_0xda2d[_0x11ff43];return _0x535919;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0x1a85=['serverUrl','Configurations','SugarcrmField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','name','Fields','idField','nameField','Request','GetSugarcrmAccount','password','remoteUri'];(function(_0x17deaf,_0x344c86){var _0x1ae9e2=function(_0x34847c){while(--_0x34847c){_0x17deaf['push'](_0x17deaf['shift']());}};_0x1ae9e2(++_0x344c86);}(_0x1a85,0x178));var _0x51a8=function(_0x326c47,_0x8dca2){_0x326c47=_0x326c47-0x0;var _0x564786=_0x1a85[_0x326c47];return _0x564786;};'use strict';var client=require('../../client');exports['getSugarcrmAccounts']=function(){return function(_0x305f18){return client[_0x51a8('0x0')](_0x51a8('0x1'),{'options':{'raw':![],'attributes':['id','name','username',_0x51a8('0x2'),_0x51a8('0x3'),_0x51a8('0x4')],'include':[{'model':'SugarcrmConfiguration','as':_0x51a8('0x5'),'attributes':['id','name'],'include':[{'model':_0x51a8('0x6'),'as':'Subjects','attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),'variableName'],'include':[{'model':_0x51a8('0x9'),'as':'Variable','attributes':['id','name']}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0xa'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id',_0x51a8('0xf')]}]},{'model':_0x51a8('0x6'),'as':_0x51a8('0x10'),'attributes':['id',_0x51a8('0x7'),_0x51a8('0x8'),_0x51a8('0x11'),_0x51a8('0x12'),'customField',_0x51a8('0xe')],'include':[{'model':_0x51a8('0x9'),'as':_0x51a8('0x9'),'attributes':['id','name']}]}]}]},'log':_0x51a8('0x1')});};};
\ No newline at end of file
index 545361b..6833047 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aa0=['Fields','idField','nameField','customField','GetVtigerAccount','../../client','getVtigerAccounts','Request','name','description','username','accessKey','remoteUri','Configurations','VtigerField','type','Variable','Descriptions','content','key','keyContent','variableName'];(function(_0x4139b8,_0x554564){var _0x40c6d6=function(_0x4a743b){while(--_0x4a743b){_0x4139b8['push'](_0x4139b8['shift']());}};_0x40c6d6(++_0x554564);}(_0x4aa0,0x1a7));var _0x04aa=function(_0x406765,_0x25629c){_0x406765=_0x406765-0x0;var _0x1c5d14=_0x4aa0[_0x406765];return _0x1c5d14;};'use strict';var client=require(_0x04aa('0x0'));exports[_0x04aa('0x1')]=function(){return function(_0x4c580e){return client[_0x04aa('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x04aa('0x3'),_0x04aa('0x4'),_0x04aa('0x5'),_0x04aa('0x6'),_0x04aa('0x7'),'serverUrl'],'include':[{'model':'VtigerConfiguration','as':_0x04aa('0x8'),'attributes':['id',_0x04aa('0x3')],'include':[{'model':_0x04aa('0x9'),'as':'Subjects','attributes':['id',_0x04aa('0xa'),'content','variableName'],'include':[{'model':_0x04aa('0xb'),'as':_0x04aa('0xb'),'attributes':['id',_0x04aa('0x3')]}]},{'model':_0x04aa('0x9'),'as':_0x04aa('0xc'),'attributes':['id',_0x04aa('0xa'),_0x04aa('0xd'),_0x04aa('0xe'),'keyType',_0x04aa('0xf'),_0x04aa('0x10')],'include':[{'model':_0x04aa('0xb'),'as':'Variable','attributes':['id',_0x04aa('0x3')]}]},{'model':'VtigerField','as':_0x04aa('0x11'),'attributes':['id',_0x04aa('0xa'),'content',_0x04aa('0x12'),_0x04aa('0x13'),_0x04aa('0x14'),_0x04aa('0x10')],'include':[{'model':_0x04aa('0xb'),'as':_0x04aa('0xb'),'attributes':['id',_0x04aa('0x3')]}]}]}]},'log':_0x04aa('0x15')});};};
\ No newline at end of file
+var _0xd4ec=['idField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','remoteUri','serverUrl','VtigerConfiguration','VtigerField','type','Variable','Descriptions','key','keyType','variableName','Fields','content'];(function(_0x4c9024,_0x32d1c4){var _0x378664=function(_0x56dfa9){while(--_0x56dfa9){_0x4c9024['push'](_0x4c9024['shift']());}};_0x378664(++_0x32d1c4);}(_0xd4ec,0x1c9));var _0xcd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ec[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xcd4e('0x0'));exports[_0xcd4e('0x1')]=function(){return function(_0x364ec3){return client[_0xcd4e('0x2')](_0xcd4e('0x3'),{'options':{'raw':![],'attributes':['id',_0xcd4e('0x4'),_0xcd4e('0x5'),'username','accessKey',_0xcd4e('0x6'),_0xcd4e('0x7')],'include':[{'model':_0xcd4e('0x8'),'as':'Configurations','attributes':['id',_0xcd4e('0x4')],'include':[{'model':_0xcd4e('0x9'),'as':'Subjects','attributes':['id',_0xcd4e('0xa'),'content','variableName'],'include':[{'model':_0xcd4e('0xb'),'as':_0xcd4e('0xb'),'attributes':['id','name']}]},{'model':'VtigerField','as':_0xcd4e('0xc'),'attributes':['id','type','content',_0xcd4e('0xd'),_0xcd4e('0xe'),'keyContent',_0xcd4e('0xf')],'include':[{'model':_0xcd4e('0xb'),'as':_0xcd4e('0xb'),'attributes':['id','name']}]},{'model':'VtigerField','as':_0xcd4e('0x10'),'attributes':['id','type',_0xcd4e('0x11'),_0xcd4e('0x12'),'nameField','customField',_0xcd4e('0xf')],'include':[{'model':_0xcd4e('0xb'),'as':_0xcd4e('0xb'),'attributes':['id',_0xcd4e('0x4')]}]}]}]},'log':_0xcd4e('0x3')});};};
\ No newline at end of file
index b456c11..273ca78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x975c=['idField','customField','Request','GetZendeskAccount','remoteUri','authType','ZendeskConfiguration','Configurations','name','Tag','Subjects','content','variableName','Variable','ZendeskField','Descriptions','key','keyType','keyContent','Fields'];(function(_0x1e8d20,_0x30e1d1){var _0x26f69f=function(_0x22458e){while(--_0x22458e){_0x1e8d20['push'](_0x1e8d20['shift']());}};_0x26f69f(++_0x30e1d1);}(_0x975c,0x12e));var _0xc975=function(_0x1e267a,_0x3ab894){_0x1e267a=_0x1e267a-0x0;var _0x4f8c89=_0x975c[_0x1e267a];return _0x4f8c89;};'use strict';var client=require('../../client');exports['getZendeskAccounts']=function(){return function(_0x4e45da){return client[_0xc975('0x0')](_0xc975('0x1'),{'options':{'raw':![],'attributes':['id','name','username','password','token',_0xc975('0x2'),_0xc975('0x3'),'serverUrl','type'],'include':[{'model':_0xc975('0x4'),'as':_0xc975('0x5'),'attributes':['id',_0xc975('0x6')],'include':[{'model':_0xc975('0x7'),'attributes':['id',_0xc975('0x6')]},{'model':'ZendeskField','as':_0xc975('0x8'),'attributes':['id','type',_0xc975('0x9'),_0xc975('0xa')],'include':[{'model':_0xc975('0xb'),'as':_0xc975('0xb'),'attributes':['id',_0xc975('0x6')]}]},{'model':_0xc975('0xc'),'as':_0xc975('0xd'),'attributes':['id','type',_0xc975('0x9'),_0xc975('0xe'),_0xc975('0xf'),_0xc975('0x10'),_0xc975('0xa')],'include':[{'model':_0xc975('0xb'),'as':_0xc975('0xb'),'attributes':['id',_0xc975('0x6')]}]},{'model':_0xc975('0xc'),'as':_0xc975('0x11'),'attributes':['id','type','content',_0xc975('0x12'),'nameField',_0xc975('0x13'),'variableName'],'include':[{'model':'Variable','as':_0xc975('0xb'),'attributes':['id',_0xc975('0x6')]}]}]}]},'log':_0xc975('0x1')});};};
\ No newline at end of file
+var _0xf564=['../../client','name','username','password','token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','content','Variable','Descriptions','keyType','keyContent','variableName','Fields','nameField','customField','GetZendeskAccount'];(function(_0x2425c5,_0x345996){var _0x1d8122=function(_0x25da47){while(--_0x25da47){_0x2425c5['push'](_0x2425c5['shift']());}};_0x1d8122(++_0x345996);}(_0xf564,0x187));var _0x4f56=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xf564[_0x4b7b62];return _0x2280df;};'use strict';var client=require(_0x4f56('0x0'));exports['getZendeskAccounts']=function(){return function(_0x24bc4e){return client['Request']('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x4f56('0x1'),_0x4f56('0x2'),_0x4f56('0x3'),_0x4f56('0x4'),_0x4f56('0x5'),_0x4f56('0x6'),_0x4f56('0x7'),_0x4f56('0x8')],'include':[{'model':_0x4f56('0x9'),'as':_0x4f56('0xa'),'attributes':['id',_0x4f56('0x1')],'include':[{'model':_0x4f56('0xb'),'attributes':['id',_0x4f56('0x1')]},{'model':_0x4f56('0xc'),'as':'Subjects','attributes':['id',_0x4f56('0x8'),_0x4f56('0xd'),'variableName'],'include':[{'model':_0x4f56('0xe'),'as':_0x4f56('0xe'),'attributes':['id',_0x4f56('0x1')]}]},{'model':_0x4f56('0xc'),'as':_0x4f56('0xf'),'attributes':['id',_0x4f56('0x8'),_0x4f56('0xd'),'key',_0x4f56('0x10'),_0x4f56('0x11'),_0x4f56('0x12')],'include':[{'model':_0x4f56('0xe'),'as':_0x4f56('0xe'),'attributes':['id',_0x4f56('0x1')]}]},{'model':'ZendeskField','as':_0x4f56('0x13'),'attributes':['id','type',_0x4f56('0xd'),'idField',_0x4f56('0x14'),_0x4f56('0x15'),_0x4f56('0x12')],'include':[{'model':_0x4f56('0xe'),'as':_0x4f56('0xe'),'attributes':['id',_0x4f56('0x1')]}]}]}]},'log':_0x4f56('0x16')});};};
\ No newline at end of file
index 7461715..da64ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0413=['../../client','Request','GetZohoAccount','name','description','host','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','ZohoField','type','content','variableName','Variable','Descriptions','key','Fields','nameField'];(function(_0x592824,_0xe38dc5){var _0x23ff08=function(_0x5c90a8){while(--_0x5c90a8){_0x592824['push'](_0x592824['shift']());}};_0x23ff08(++_0xe38dc5);}(_0x0413,0x90));var _0x3041=function(_0x253512,_0x349982){_0x253512=_0x253512-0x0;var _0x52783c=_0x0413[_0x253512];return _0x52783c;};'use strict';var client=require(_0x3041('0x0'));exports['getZohoAccounts']=function(){return function(_0x1a88da){return client[_0x3041('0x1')](_0x3041('0x2'),{'options':{'raw':![],'attributes':['id',_0x3041('0x3'),_0x3041('0x4'),_0x3041('0x5'),'zone',_0x3041('0x6'),_0x3041('0x7'),_0x3041('0x8'),_0x3041('0x9'),_0x3041('0xa')],'include':[{'model':_0x3041('0xb'),'as':_0x3041('0xc'),'attributes':['id',_0x3041('0x3'),_0x3041('0xd'),_0x3041('0xe'),_0x3041('0x4')],'include':[{'model':_0x3041('0xf'),'as':'Subjects','attributes':['id',_0x3041('0x10'),_0x3041('0x11'),_0x3041('0x12')],'include':[{'model':'Variable','as':_0x3041('0x13'),'attributes':['id',_0x3041('0x3')]}]},{'model':_0x3041('0xf'),'as':_0x3041('0x14'),'attributes':['id','type','content',_0x3041('0x15'),'keyType','keyContent','variableName'],'include':[{'model':_0x3041('0x13'),'as':_0x3041('0x13'),'attributes':['id',_0x3041('0x3')]}]},{'model':'ZohoField','as':_0x3041('0x16'),'attributes':['id',_0x3041('0x10'),_0x3041('0x11'),'idField',_0x3041('0x17'),'customField',_0x3041('0x12')],'include':[{'model':_0x3041('0x13'),'as':'Variable','attributes':['id',_0x3041('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
+var _0xa553=['getZohoAccounts','GetZohoAccount','name','description','host','clientId','code','refreshToken','Configurations','moduleCreate','moduleSearch','ZohoField','type','variableName','Variable','Descriptions','content','key','keyType','keyContent','Fields','idField','nameField','customField'];(function(_0x296b77,_0x586068){var _0x2b3615=function(_0x3dea3e){while(--_0x3dea3e){_0x296b77['push'](_0x296b77['shift']());}};_0x2b3615(++_0x586068);}(_0xa553,0x90));var _0x3a55=function(_0x3af0f3,_0x5bb926){_0x3af0f3=_0x3af0f3-0x0;var _0x414174=_0xa553[_0x3af0f3];return _0x414174;};'use strict';var client=require('../../client');exports[_0x3a55('0x0')]=function(){return function(_0x44de3e){return client['Request'](_0x3a55('0x1'),{'options':{'raw':![],'attributes':['id',_0x3a55('0x2'),_0x3a55('0x3'),_0x3a55('0x4'),'zone',_0x3a55('0x5'),'clientSecret','serverUrl',_0x3a55('0x6'),_0x3a55('0x7')],'include':[{'model':'ZohoConfiguration','as':_0x3a55('0x8'),'attributes':['id',_0x3a55('0x2'),_0x3a55('0x9'),_0x3a55('0xa'),_0x3a55('0x3')],'include':[{'model':_0x3a55('0xb'),'as':'Subjects','attributes':['id',_0x3a55('0xc'),'content',_0x3a55('0xd')],'include':[{'model':_0x3a55('0xe'),'as':_0x3a55('0xe'),'attributes':['id',_0x3a55('0x2')]}]},{'model':_0x3a55('0xb'),'as':_0x3a55('0xf'),'attributes':['id',_0x3a55('0xc'),_0x3a55('0x10'),_0x3a55('0x11'),_0x3a55('0x12'),_0x3a55('0x13'),_0x3a55('0xd')],'include':[{'model':_0x3a55('0xe'),'as':_0x3a55('0xe'),'attributes':['id',_0x3a55('0x2')]}]},{'model':_0x3a55('0xb'),'as':_0x3a55('0x14'),'attributes':['id','type',_0x3a55('0x10'),_0x3a55('0x15'),_0x3a55('0x16'),_0x3a55('0x17'),_0x3a55('0xd')],'include':[{'model':_0x3a55('0xe'),'as':_0x3a55('0xe'),'attributes':['id','name']}]}]}]},'log':_0x3a55('0x1')});};};
\ No newline at end of file
index ad3dba9..bce83dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ff=['CreateMemberReport','voice','isNil','format','SIP/%s','lastAssignedTo','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','voiceDialReport','membername','endtime','starttime','outbound','dialstring','toNumber','uniqueid','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x61ff,0x90));var _0xf61f=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x61ff[_0x27bd2c];return _0x3784ea;};'use strict';var moment=require('moment');var _=require(_0xf61f('0x0'));var util=require('util');var client=require(_0xf61f('0x1'));exports[_0xf61f('0x2')]=function(_0x3823cd){var _0x9ade5e=_0x3823cd[_0xf61f('0x3')]||_0x3823cd[_0xf61f('0x4')];return client[_0xf61f('0x5')](_0xf61f('0x6'),{'body':{'channel':_0xf61f('0x7'),'membername':_0x3823cd['lastAssignedTo'],'interface':_[_0xf61f('0x8')](_0x3823cd['interface'])?util[_0xf61f('0x9')](_0xf61f('0xa'),_0x3823cd[_0xf61f('0xb')]):_0x3823cd[_0xf61f('0xc')],'type':_0xf61f('0xd'),'enterAt':_0x3823cd[_0xf61f('0xe')],'exitAt':_0x9ade5e,'duration':moment(_0x9ade5e)[_0xf61f('0xf')](_0x3823cd[_0xf61f('0xe')],_0xf61f('0x10')),'data1':_0xf61f('0x11'),'data2':_0x3823cd[_0xf61f('0x12')],'data3':_0x3823cd[_0xf61f('0x13')],'data4':null,'data5':_0x3823cd['queue'],'role':_0xf61f('0x14'),'internal':_0x3823cd[_0xf61f('0x15')]?_['toNumber'](_0x3823cd[_0xf61f('0x15')]):undefined,'uniqueid':_0x3823cd['uniqueid']},'log':_0xf61f('0x6')});};exports[_0xf61f('0x16')]=function(_0xd7142d){return client['Request'](_0xf61f('0x6'),{'body':{'channel':_0xf61f('0x7'),'membername':_0xd7142d[_0xf61f('0x17')],'interface':_0xd7142d[_0xf61f('0xc')],'type':_0xf61f('0xd'),'enterAt':_0xd7142d['starttime'],'exitAt':_0xd7142d[_0xf61f('0x18')],'duration':moment(_0xd7142d['endtime'])['diff'](_0xd7142d[_0xf61f('0x19')],_0xf61f('0x10'))>=0x0?moment(_0xd7142d['endtime'])[_0xf61f('0xf')](_0xd7142d['starttime'],_0xf61f('0x10')):null,'data1':_0xf61f('0x1a'),'data2':_0xd7142d[_0xf61f('0x15')],'data3':_0xd7142d[_0xf61f('0x13')],'data4':_0xd7142d[_0xf61f('0x1b')]||null,'role':_0xf61f('0x14'),'internal':_0xd7142d[_0xf61f('0x15')]?_[_0xf61f('0x1c')](_0xd7142d[_0xf61f('0x15')]):undefined,'uniqueid':_0xd7142d[_0xf61f('0x1d')]},'log':_0xf61f('0x6')});};
\ No newline at end of file
+var _0x4283=['voiceDialReport','voice','starttime','endtime','outbound','uniqueid','moment','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','isNil','interface','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','inbound','calleridnum','exten','agent','toNumber','accountcode'];(function(_0x4b9617,_0x1bdf76){var _0x5f04ab=function(_0x5c0dee){while(--_0x5c0dee){_0x4b9617['push'](_0x4b9617['shift']());}};_0x5f04ab(++_0x1bdf76);}(_0x4283,0x119));var _0x3428=function(_0x242544,_0x8c734c){_0x242544=_0x242544-0x0;var _0x1924e0=_0x4283[_0x242544];return _0x1924e0;};'use strict';var moment=require(_0x3428('0x0'));var _=require('lodash');var util=require('util');var client=require(_0x3428('0x1'));exports[_0x3428('0x2')]=function(_0x5907f7){var _0x117545=_0x5907f7[_0x3428('0x3')]||_0x5907f7[_0x3428('0x4')];return client['Request'](_0x3428('0x5'),{'body':{'channel':'voice','membername':_0x5907f7['lastAssignedTo'],'interface':_[_0x3428('0x6')](_0x5907f7[_0x3428('0x7')])?util['format'](_0x3428('0x8'),_0x5907f7[_0x3428('0x9')]):_0x5907f7['interface'],'type':_0x3428('0xa'),'enterAt':_0x5907f7['queuecallerleaveAt'],'exitAt':_0x117545,'duration':moment(_0x117545)[_0x3428('0xb')](_0x5907f7[_0x3428('0xc')],'seconds'),'data1':_0x3428('0xd'),'data2':_0x5907f7[_0x3428('0xe')],'data3':_0x5907f7[_0x3428('0xf')],'data4':null,'data5':_0x5907f7['queue'],'role':_0x3428('0x10'),'internal':_0x5907f7['accountcode']?_[_0x3428('0x11')](_0x5907f7[_0x3428('0x12')]):undefined,'uniqueid':_0x5907f7['uniqueid']},'log':'CreateMemberReport'});};exports[_0x3428('0x13')]=function(_0x419b53){return client['Request'](_0x3428('0x5'),{'body':{'channel':_0x3428('0x14'),'membername':_0x419b53['membername'],'interface':_0x419b53[_0x3428('0x7')],'type':_0x3428('0xa'),'enterAt':_0x419b53[_0x3428('0x15')],'exitAt':_0x419b53[_0x3428('0x16')],'duration':moment(_0x419b53[_0x3428('0x16')])['diff'](_0x419b53[_0x3428('0x15')],'seconds')>=0x0?moment(_0x419b53['endtime'])[_0x3428('0xb')](_0x419b53[_0x3428('0x15')],'seconds'):null,'data1':_0x3428('0x17'),'data2':_0x419b53[_0x3428('0x12')],'data3':_0x419b53[_0x3428('0xf')],'data4':_0x419b53['dialstring']||null,'role':_0x3428('0x10'),'internal':_0x419b53[_0x3428('0x12')]?_[_0x3428('0x11')](_0x419b53[_0x3428('0x12')]):undefined,'uniqueid':_0x419b53[_0x3428('0x18')]},'log':_0x3428('0x5')});};
\ No newline at end of file
index 05e03af..f1d901d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cbd=['getSettings','ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x26a771,_0x202a99){var _0x22114c=function(_0x50dd70){while(--_0x50dd70){_0x26a771['push'](_0x26a771['shift']());}};_0x22114c(++_0x202a99);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0x2cbd[_0x400322];return _0xfdd597;};'use strict';var client=require(_0xd2cb('0x0'));exports[_0xd2cb('0x1')]=function(){return client['Request'](_0xd2cb('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd2cb('0x3')]},'log':_0xd2cb('0x4')});};
\ No newline at end of file
+var _0x6345=['../client','Request','stopRecordingOnTransfer','GetSettings'];(function(_0x34ea22,_0x1270b3){var _0x1ca470=function(_0xf63cf4){while(--_0xf63cf4){_0x34ea22['push'](_0x34ea22['shift']());}};_0x1ca470(++_0x1270b3);}(_0x6345,0xa4));var _0x5634=function(_0x504ff8,_0x1c0b37){_0x504ff8=_0x504ff8-0x0;var _0x5ca963=_0x6345[_0x504ff8];return _0x5ca963;};'use strict';var client=require(_0x5634('0x0'));exports['getSettings']=function(){return client[_0x5634('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x5634('0x2')]},'log':_0x5634('0x3')});};
\ No newline at end of file
index 3622ab9..d3c5d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3176=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x3db00e,_0x56fa45){var _0x2be910=function(_0x4a85fd){while(--_0x4a85fd){_0x3db00e['push'](_0x3db00e['shift']());}};_0x2be910(++_0x56fa45);}(_0x3176,0x1d8));var _0x6317=function(_0x3ffa46,_0x2a90ee){_0x3ffa46=_0x3ffa46-0x0;var _0x5431a4=_0x3176[_0x3ffa46];return _0x5431a4;};'use strict';var client=require(_0x6317('0x0'));exports[_0x6317('0x1')]=function(_0x3fa186){return function(_0x131b0a){return client[_0x6317('0x2')](_0x6317('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6317('0x4'),_0x6317('0x5')]},'log':_0x6317('0x3')});};};
\ No newline at end of file
+var _0xe2c5=['name','html','GetTemplate','getTemplates'];(function(_0x29f110,_0x277744){var _0x5e4390=function(_0x24d5bd){while(--_0x24d5bd){_0x29f110['push'](_0x29f110['shift']());}};_0x5e4390(++_0x277744);}(_0xe2c5,0xd3));var _0x5e2c=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0xe2c5[_0x42bb6d];return _0x1db89b;};'use strict';var client=require('../client');exports[_0x5e2c('0x0')]=function(_0x10edd3){return function(_0x58e70a){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x5e2c('0x1'),_0x5e2c('0x2')]},'log':_0x5e2c('0x3')});};};
\ No newline at end of file
index 2573cd9..d7964ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x382e=['../client','Request','GetTrigger','name','channel','status','field','operator','AnyConditions','value','Action','Actions','data3','data5','data6'];(function(_0x421fc5,_0x41cc5f){var _0x38bb32=function(_0x307d8d){while(--_0x307d8d){_0x421fc5['push'](_0x421fc5['shift']());}};_0x38bb32(++_0x41cc5f);}(_0x382e,0x13b));var _0xe382=function(_0x5ebcd0,_0x1df912){_0x5ebcd0=_0x5ebcd0-0x0;var _0x58b366=_0x382e[_0x5ebcd0];return _0x58b366;};'use strict';var client=require(_0xe382('0x0'));exports['getTriggers']=function(_0x14245d){return function(_0x576a65){return client[_0xe382('0x1')](_0xe382('0x2'),{'options':{'raw':![],'attributes':['id',_0xe382('0x3'),_0xe382('0x4'),_0xe382('0x5')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xe382('0x6'),_0xe382('0x7'),'value']},{'model':'Condition','as':_0xe382('0x8'),'attributes':['id',_0xe382('0x6'),'operator',_0xe382('0x9')]},{'model':_0xe382('0xa'),'as':_0xe382('0xb'),'attributes':['id','action','data1','data2',_0xe382('0xc'),'data4',_0xe382('0xd'),_0xe382('0xe'),'data7']}]},'log':_0xe382('0x2')});};};
\ No newline at end of file
+var _0x95be=['operator','value','AnyConditions','Action','Actions','action','data1','data2','data4','data6','../client','getTriggers','Request','GetTrigger','name','channel','Condition','field'];(function(_0x259384,_0xf2a61e){var _0x243d3b=function(_0x5dbb57){while(--_0x5dbb57){_0x259384['push'](_0x259384['shift']());}};_0x243d3b(++_0xf2a61e);}(_0x95be,0xd0));var _0xe95b=function(_0x40ec5d,_0x305425){_0x40ec5d=_0x40ec5d-0x0;var _0x3c712d=_0x95be[_0x40ec5d];return _0x3c712d;};'use strict';var client=require(_0xe95b('0x0'));exports[_0xe95b('0x1')]=function(_0x2ae2b5){return function(_0x1ede12){return client[_0xe95b('0x2')](_0xe95b('0x3'),{'options':{'raw':![],'attributes':['id',_0xe95b('0x4'),_0xe95b('0x5'),'status'],'include':[{'model':_0xe95b('0x6'),'as':'AllConditions','attributes':['id',_0xe95b('0x7'),_0xe95b('0x8'),_0xe95b('0x9')]},{'model':_0xe95b('0x6'),'as':_0xe95b('0xa'),'attributes':['id',_0xe95b('0x7'),'operator',_0xe95b('0x9')]},{'model':_0xe95b('0xb'),'as':_0xe95b('0xc'),'attributes':['id',_0xe95b('0xd'),_0xe95b('0xe'),_0xe95b('0xf'),'data3',_0xe95b('0x10'),'data5',_0xe95b('0x11'),'data7']}]},'log':'GetTrigger'});};};
\ No newline at end of file
index b3940de..ca0e19d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8323=['Request','name','registry','defaultuser','GetTrunk','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8323,0x8f));var _0x3832=function(_0x10cd6a,_0x5771e4){_0x10cd6a=_0x10cd6a-0x0;var _0x5ee286=_0x8323[_0x10cd6a];return _0x5ee286;};'use strict';var client=require(_0x3832('0x0'));exports['getTrunks']=function(_0x4a5a1b){return function(_0x5336f7){return client[_0x3832('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3832('0x2'),_0x3832('0x3'),_0x3832('0x4')]},'log':_0x3832('0x5')});};};
\ No newline at end of file
+var _0x5e37=['GetTrunk','../client','getTrunks','Request','name','registry','defaultuser'];(function(_0x139d2c,_0x24e6d8){var _0x4611c6=function(_0x3bcc0d){while(--_0x3bcc0d){_0x139d2c['push'](_0x139d2c['shift']());}};_0x4611c6(++_0x24e6d8);}(_0x5e37,0xcc));var _0x75e3=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x5e37[_0x2ff4bd];return _0x28edc6;};'use strict';var client=require(_0x75e3('0x0'));exports[_0x75e3('0x1')]=function(_0x19ac70){return function(_0x3e6508){return client[_0x75e3('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x75e3('0x3'),_0x75e3('0x4'),_0x75e3('0x5')]},'log':_0x75e3('0x6')});};};
\ No newline at end of file
index 6adcc1f..44c6d14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x1eec3c,_0x4732e2){var _0x35ed38=function(_0x4caef0){while(--_0x4caef0){_0x1eec3c['push'](_0x1eec3c['shift']());}};_0x35ed38(++_0x4732e2);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'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 95ffd2d..7fda43e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dd4=['CreateVoiceAgentReport','update','create','Request'];(function(_0x3072da,_0x659372){var _0xeaf3c1=function(_0x147b49){while(--_0x147b49){_0x3072da['push'](_0x3072da['shift']());}};_0xeaf3c1(++_0x659372);}(_0x8dd4,0x8a));var _0x48dd=function(_0x5db2c0,_0x34026b){_0x5db2c0=_0x5db2c0-0x0;var _0x1c9f1a=_0x8dd4[_0x5db2c0];return _0x1c9f1a;};'use strict';var client=require('../client');exports[_0x48dd('0x0')]=function(_0x3ee628){return client[_0x48dd('0x1')]('CreateVoiceAgentReport',{'body':_0x3ee628,'log':_0x48dd('0x2')});};exports[_0x48dd('0x3')]=function(_0x3252bb,_0x527899,_0x2d7b0d){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3252bb,'options':{'where':{'uniqueid':_0x527899,'interface':_0x2d7b0d,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x7d65=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x7d65,0x127));var _0x57d6=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7d65[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x57d6('0x0'));exports['create']=function(_0x3e200c){return client[_0x57d6('0x1')]('CreateVoiceAgentReport',{'body':_0x3e200c,'log':_0x57d6('0x2')});};exports[_0x57d6('0x3')]=function(_0x401462,_0x49489f,_0x5eafa9){return client[_0x57d6('0x1')]('UpdateVoiceAgentReport',{'body':_0x401462,'options':{'where':{'uniqueid':_0x49489f,'interface':_0x5eafa9,'agentcomplete':!![]}},'log':_0x57d6('0x4')});};
\ No newline at end of file
index b31a850..1037eda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4782=['startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','billableseconds','GetVoiceCallReports','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','outbound'];(function(_0x9908ba,_0x1fe19e){var _0x5396ed=function(_0x264187){while(--_0x264187){_0x9908ba['push'](_0x9908ba['shift']());}};_0x5396ed(++_0x1fe19e);}(_0x4782,0xab));var _0x2478=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x4782[_0x412342];return _0x3e62cb;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x2478('0x0'));var client=require(_0x2478('0x1'));exports[_0x2478('0x2')]=function(_0x36aba7){return client[_0x2478('0x3')](_0x2478('0x4'),{'body':_[_0x2478('0x5')](_0x36aba7,{'source':_0x36aba7[_0x2478('0x6')],'destinationcontext':_0x36aba7[_0x2478('0x7')],'callerid':_0x36aba7['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x2478('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x2478('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x2478('0x8')],'createdAt':{'$between':[moment()[_0x2478('0x9')]('day')[_0x2478('0xa')](_0x2478('0xb')),moment()[_0x2478('0xc')](_0x2478('0xd'))[_0x2478('0xa')](_0x2478('0xb'))]}},'attributes':[_0x2478('0xe'),_0x2478('0xf'),'duration',_0x2478('0x10')]},'log':_0x2478('0x11')});};};
\ No newline at end of file
+var _0x5306=['context','callerid','DOCUMENTATION','Request','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','merge'];(function(_0x22b756,_0x33afc5){var _0x42e6fd=function(_0x39ce6a){while(--_0x39ce6a){_0x22b756['push'](_0x22b756['shift']());}};_0x42e6fd(++_0x33afc5);}(_0x5306,0x150));var _0x6530=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5306[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x6530('0x0'));var util=require(_0x6530('0x1'));var _=require(_0x6530('0x2'));var client=require('../client');exports[_0x6530('0x3')]=function(_0xfaefcc){return client['Request'](_0x6530('0x4'),{'body':_[_0x6530('0x5')](_0xfaefcc,{'source':_0xfaefcc['calleridnum'],'destinationcontext':_0xfaefcc[_0x6530('0x6')],'callerid':_0xfaefcc[_0x6530('0x7')],'amaflags':_0x6530('0x8')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x6530('0x9')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x6530('0xa')](_0x6530('0xb'))[_0x6530('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x6530('0xd')]('day')[_0x6530('0xc')](_0x6530('0xe'))]}},'attributes':['type',_0x6530('0xf'),_0x6530('0x10'),_0x6530('0x11')]},'log':_0x6530('0x12')});};};
\ No newline at end of file
index 90c4673..fdd0895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb364=['CreateVoiceDialReport','../client','create','Request'];(function(_0x543c4f,_0x33bd62){var _0x5af296=function(_0x50bf4b){while(--_0x50bf4b){_0x543c4f['push'](_0x543c4f['shift']());}};_0x5af296(++_0x33bd62);}(_0xb364,0x125));var _0x4b36=function(_0x3d00ef,_0x13b9f2){_0x3d00ef=_0x3d00ef-0x0;var _0x42403c=_0xb364[_0x3d00ef];return _0x42403c;};'use strict';var client=require(_0x4b36('0x0'));exports[_0x4b36('0x1')]=function(_0x2b9fd1){return client[_0x4b36('0x2')](_0x4b36('0x3'),{'body':_0x2b9fd1,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0x6f4b=['CreateVoiceDialReport','../client','create','Request'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x6f4b,0x175));var _0xb6f4=function(_0x4de9a7,_0x3732cf){_0x4de9a7=_0x4de9a7-0x0;var _0x6a84af=_0x6f4b[_0x4de9a7];return _0x6a84af;};'use strict';var client=require(_0xb6f4('0x0'));exports[_0xb6f4('0x1')]=function(_0x58227e){return client[_0xb6f4('0x2')](_0xb6f4('0x3'),{'body':_0x58227e,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index a272d47..fbb3423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76dc=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0x1b29b2,_0x3b6b11){var _0x560b68=function(_0x50a4ea){while(--_0x50a4ea){_0x1b29b2['push'](_0x1b29b2['shift']());}};_0x560b68(++_0x3b6b11);}(_0x76dc,0x1f2));var _0xc76d=function(_0xbb8e5c,_0x2829d6){_0xbb8e5c=_0xbb8e5c-0x0;var _0x14658c=_0x76dc[_0xbb8e5c];return _0x14658c;};'use strict';var client=require(_0xc76d('0x0'));exports[_0xc76d('0x1')]=function(){return function(){return client[_0xc76d('0x2')](_0xc76d('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xc76d('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xc76d('0x1')});};};
\ No newline at end of file
+var _0xa588=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x15318c,_0x2e50e4){var _0x10d3ce=function(_0x2fecdd){while(--_0x2fecdd){_0x15318c['push'](_0x15318c['shift']());}};_0x10d3ce(++_0x2e50e4);}(_0xa588,0xe1));var _0x8a58=function(_0x38d657,_0x3522a1){_0x38d657=_0x38d657-0x0;var _0x1de063=_0xa588[_0x38d657];return _0x1de063;};'use strict';var client=require('../client');exports[_0x8a58('0x0')]=function(){return function(){return client[_0x8a58('0x1')](_0x8a58('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8a58('0x3'),_0x8a58('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x8a58('0x0')});};};
\ No newline at end of file
index 8623a4d..220cbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc71a=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','active','callerid','Interval','Intervals','interval','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x317551,_0x1d2e46){var _0x323ecc=function(_0x1aafff){while(--_0x1aafff){_0x317551['push'](_0x317551['shift']());}};_0x323ecc(++_0x1d2e46);}(_0xc71a,0x16f));var _0xac71=function(_0x57d96f,_0x537666){_0x57d96f=_0x57d96f-0x0;var _0x2eb5bc=_0xc71a[_0x57d96f];return _0x2eb5bc;};'use strict';var client=require('../client');exports[_0xac71('0x0')]=function(){return function(){return client[_0xac71('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xac71('0x2'),_0xac71('0x3'),_0xac71('0x4'),_0xac71('0x5'),_0xac71('0x6'),_0xac71('0x7'),_0xac71('0x8'),_0xac71('0x9'),_0xac71('0xa'),_0xac71('0xb'),'dialPowerLevel',_0xac71('0xc'),'dialPredictiveOptimizationPercentage',_0xac71('0xd'),'dialOriginateCallerIdName',_0xac71('0xe'),_0xac71('0xf'),'dialQueueOptions',_0xac71('0x10'),_0xac71('0x11'),'dialCongestionMaxRetry',_0xac71('0x12'),_0xac71('0x13'),_0xac71('0x14'),_0xac71('0x15'),_0xac71('0x16'),'dialGlobalMaxRetry',_0xac71('0x17'),_0xac71('0x18'),'dialPrefix',_0xac71('0x19'),_0xac71('0x1a'),_0xac71('0x1b'),_0xac71('0x1c'),_0xac71('0x1d'),_0xac71('0x1e'),_0xac71('0x1f'),_0xac71('0x20'),_0xac71('0x21'),'dialAMDSilenceThreshold',_0xac71('0x22'),_0xac71('0x23'),_0xac71('0x24'),_0xac71('0x25'),_0xac71('0x26'),_0xac71('0x27'),_0xac71('0x28'),_0xac71('0x29'),_0xac71('0x6'),'strategy','dialRandomLastDigitCallerIdNumber',_0xac71('0x2a'),'dialNoSuchNumberMaxRetry',_0xac71('0x2b'),_0xac71('0x2c'),_0xac71('0x2d'),'dialAbandonedMaxRetry',_0xac71('0x2e'),_0xac71('0x2f'),'dialMachineRetryFrequency',_0xac71('0x30'),_0xac71('0x31'),_0xac71('0x32'),_0xac71('0x33'),_0xac71('0x34')],'include':[{'model':_0xac71('0x35'),'as':_0xac71('0x35'),'attributes':['id',_0xac71('0x2'),'callerid',_0xac71('0x36')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0xac71('0x35'),'as':'TrunkBackup','attributes':['id',_0xac71('0x2'),_0xac71('0x37'),_0xac71('0x36')]},{'model':'Interval','as':_0xac71('0x38'),'attributes':['id',_0xac71('0x2')],'include':[{'model':_0xac71('0x38'),'as':_0xac71('0x39'),'attributes':['id',_0xac71('0x2'),_0xac71('0x3a')]}]}]},'log':_0xac71('0x0')});};};
\ No newline at end of file
+var _0x5f84=['dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x5f84,0x6e));var _0x45f8=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5f84[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0x45f8('0x0'));exports[_0x45f8('0x1')]=function(){return function(){return client[_0x45f8('0x2')](_0x45f8('0x3'),{'options':{'raw':![],'attributes':['id',_0x45f8('0x4'),_0x45f8('0x5'),_0x45f8('0x6'),'autopause',_0x45f8('0x7'),_0x45f8('0x8'),_0x45f8('0x9'),_0x45f8('0xa'),_0x45f8('0xb'),_0x45f8('0xc'),_0x45f8('0xd'),_0x45f8('0xe'),_0x45f8('0xf'),_0x45f8('0x10'),_0x45f8('0x11'),_0x45f8('0x12'),_0x45f8('0x13'),_0x45f8('0x14'),'dialQueueTimeout',_0x45f8('0x15'),_0x45f8('0x16'),_0x45f8('0x17'),_0x45f8('0x18'),'dialBusyRetryFrequency','dialNoAnswerMaxRetry',_0x45f8('0x19'),'dialGlobalMaxRetry','dialTimezone',_0x45f8('0x1a'),_0x45f8('0x1b'),_0x45f8('0x1c'),_0x45f8('0x1d'),'dialAMDInitialSilence',_0x45f8('0x1e'),_0x45f8('0x1f'),_0x45f8('0x20'),'dialAMDMinWordLength',_0x45f8('0x21'),_0x45f8('0x22'),_0x45f8('0x23'),_0x45f8('0x24'),_0x45f8('0x25'),_0x45f8('0x26'),_0x45f8('0x27'),_0x45f8('0x28'),_0x45f8('0x29'),'dialAgiAfterHangupClient',_0x45f8('0x2a'),_0x45f8('0x7'),_0x45f8('0x2b'),_0x45f8('0x2c'),_0x45f8('0x2d'),_0x45f8('0x2e'),'dialNoSuchNumberRetryFrequency',_0x45f8('0x2f'),_0x45f8('0x30'),_0x45f8('0x31'),_0x45f8('0x32'),_0x45f8('0x33'),_0x45f8('0x34'),_0x45f8('0x35'),_0x45f8('0x36'),'mandatoryDisposition',_0x45f8('0x37'),_0x45f8('0x38')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x45f8('0x4'),'callerid',_0x45f8('0x39')]},{'model':_0x45f8('0x3a'),'as':_0x45f8('0x3b'),'attributes':['id','name']},{'model':_0x45f8('0x3c'),'as':_0x45f8('0x3d'),'attributes':['id',_0x45f8('0x4'),_0x45f8('0x3e'),'active']},{'model':_0x45f8('0x3f'),'as':_0x45f8('0x3f'),'attributes':['id','name'],'include':[{'model':_0x45f8('0x3f'),'as':'Intervals','attributes':['id','name',_0x45f8('0x40')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index 658e9b9..2154e1e 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(_0x322e16,_0x1bc91d){var _0x5ef306=function(_0x3bd1c3){while(--_0x3bd1c3){_0x322e16['push'](_0x322e16['shift']());}};_0x5ef306(++_0x1bc91d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x579801,_0x439eb3){var _0x1260d3=function(_0x88ee2e){while(--_0x88ee2e){_0x579801['push'](_0x579801['shift']());}};_0x1260d3(++_0x439eb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 43c755f..b8cc1a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5c3=['getVoiceQueueRtPauses','Request','../client'];(function(_0x33709f,_0x1fe2df){var _0x32a6e1=function(_0x270cde){while(--_0x270cde){_0x33709f['push'](_0x33709f['shift']());}};_0x32a6e1(++_0x1fe2df);}(_0xb5c3,0xec));var _0x3b5c=function(_0xe380ec,_0xa73290){_0xe380ec=_0xe380ec-0x0;var _0x5964c5=_0xb5c3[_0xe380ec];return _0x5964c5;};'use strict';var client=require(_0x3b5c('0x0'));exports[_0x3b5c('0x1')]=function(_0x21b0f8){return function(){return client[_0x3b5c('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x21b0f8,'paused':!![]},'raw':!![]},'log':_0x3b5c('0x1')});};};
\ No newline at end of file
+var _0x754a=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x510ab0,_0x5f4ea6){var _0x238e3b=function(_0x408825){while(--_0x408825){_0x510ab0['push'](_0x510ab0['shift']());}};_0x238e3b(++_0x5f4ea6);}(_0x754a,0x74));var _0xa754=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x754a[_0x4bfac3];return _0x15f0f2;};'use strict';var client=require(_0xa754('0x0'));exports[_0xa754('0x1')]=function(_0x3f8c9b){return function(){return client['Request'](_0xa754('0x2'),{'options':{'where':{'VoiceQueueId':_0x3f8c9b,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 236821e..41f86a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5975a8,_0xa4208c){var _0x3df359=function(_0x21645f){while(--_0x21645f){_0x5975a8['push'](_0x5975a8['shift']());}};_0x3df359(++_0xa4208c);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0xd17cde,_0x577243){var _0x1d3692=function(_0x4f1d32){while(--_0x4f1d32){_0xd17cde['push'](_0xd17cde['shift']());}};_0x1d3692(++_0x577243);}(_0x7a54,0x106));var _0x47a5=function(_0x1ed3a4,_0x34413c){_0x1ed3a4=_0x1ed3a4-0x0;var _0xd8ff1a=_0x7a54[_0x1ed3a4];return _0xd8ff1a;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 985e125..66a1b58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa96d=['transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','Request','result','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridnum'];(function(_0x5cc071,_0x5785df){var _0x28a03c=function(_0x302ff2){while(--_0x302ff2){_0x5cc071['push'](_0x5cc071['shift']());}};_0x28a03c(++_0x5785df);}(_0xa96d,0x181));var _0xda96=function(_0x595c4e,_0x444249){_0x595c4e=_0x595c4e-0x0;var _0x1e224c=_0xa96d[_0x595c4e];return _0x1e224c;};'use strict';var client=require(_0xda96('0x0'));exports[_0xda96('0x1')]={};exports['blindTransfer']=function(_0x95b48f){return client[_0xda96('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x95b48f[_0xda96('0x3')],'transfererchannel':_0x95b48f[_0xda96('0x4')],'transferercalleridnum':_0x95b48f[_0xda96('0x5')],'transferercalleridname':_0x95b48f['transferercalleridname'],'transfererconnectedlinenum':_0x95b48f['transfererconnectedlinenum'],'transfererconnectedlinename':_0x95b48f[_0xda96('0x6')],'transfereraccountcode':_0x95b48f[_0xda96('0x7')],'transferercontext':_0x95b48f[_0xda96('0x8')],'transfererexten':_0x95b48f['transfererexten'],'transfererlinkedid':_0x95b48f['transfererlinkedid'],'transfereechannel':_0x95b48f[_0xda96('0x9')],'transfereecalleridnum':_0x95b48f[_0xda96('0xa')],'transfereecalleridname':_0x95b48f[_0xda96('0xb')],'transfereeconnectedlinenum':_0x95b48f[_0xda96('0xc')],'transfereeconnectedlinename':_0x95b48f[_0xda96('0xd')],'transfereeaccountcode':_0x95b48f['transfereeaccountcode'],'transfereecontext':_0x95b48f[_0xda96('0xe')],'transfereeexten':_0x95b48f[_0xda96('0xf')],'transfereelinkedid':_0x95b48f['transfereelinkedid'],'isexternal':_0x95b48f[_0xda96('0x10')],'context':_0x95b48f[_0xda96('0x11')],'extension':_0x95b48f['extension'],'type':'blind'},'log':_0xda96('0x12')});};exports[_0xda96('0x13')]=function(_0x5ccf49){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x5ccf49[_0xda96('0x3')],'transfererchannel':_0x5ccf49[_0xda96('0x14')],'transferercalleridnum':_0x5ccf49[_0xda96('0x15')],'transferercalleridname':_0x5ccf49['origtransferercalleridname'],'transfererconnectedlinenum':_0x5ccf49['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5ccf49[_0xda96('0x16')],'transfereraccountcode':_0x5ccf49[_0xda96('0x17')],'transferercontext':_0x5ccf49[_0xda96('0x18')],'transfererexten':_0x5ccf49[_0xda96('0x19')],'transfererlinkedid':_0x5ccf49['origtransfererlinkedid'],'transfereechannel':_0x5ccf49[_0xda96('0x1a')],'transfereecalleridnum':_0x5ccf49[_0xda96('0x1b')],'transfereecalleridname':_0x5ccf49[_0xda96('0x1c')],'transfereeconnectedlinenum':_0x5ccf49[_0xda96('0x1d')],'transfereeconnectedlinename':_0x5ccf49[_0xda96('0x1e')],'transfereeaccountcode':_0x5ccf49['transfertargetaccountcode'],'transfereecontext':_0x5ccf49[_0xda96('0x1f')],'transfereeexten':_0x5ccf49[_0xda96('0x20')],'transfereelinkedid':_0x5ccf49[_0xda96('0x21')],'isexternal':_0x5ccf49[_0xda96('0x10')],'context':_0x5ccf49['origtransferercontext'],'extension':_0x5ccf49[_0xda96('0x22')],'type':_0xda96('0x23')},'log':_0xda96('0x12')});};
\ No newline at end of file
+var _0x72cd=['context','extension','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','origtransferercontext','attended','transfers','Request','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x72cd,0x118));var _0xd72c=function(_0x3957e6,_0x146981){_0x3957e6=_0x3957e6-0x0;var _0x375a34=_0x72cd[_0x3957e6];return _0x375a34;};'use strict';var client=require('../client');exports[_0xd72c('0x0')]={};exports['blindTransfer']=function(_0x2263f7){return client[_0xd72c('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x2263f7['result'],'transfererchannel':_0x2263f7['transfererchannel'],'transferercalleridnum':_0x2263f7[_0xd72c('0x2')],'transferercalleridname':_0x2263f7['transferercalleridname'],'transfererconnectedlinenum':_0x2263f7[_0xd72c('0x3')],'transfererconnectedlinename':_0x2263f7[_0xd72c('0x4')],'transfereraccountcode':_0x2263f7[_0xd72c('0x5')],'transferercontext':_0x2263f7[_0xd72c('0x6')],'transfererexten':_0x2263f7[_0xd72c('0x7')],'transfererlinkedid':_0x2263f7[_0xd72c('0x8')],'transfereechannel':_0x2263f7[_0xd72c('0x9')],'transfereecalleridnum':_0x2263f7[_0xd72c('0xa')],'transfereecalleridname':_0x2263f7[_0xd72c('0xb')],'transfereeconnectedlinenum':_0x2263f7[_0xd72c('0xc')],'transfereeconnectedlinename':_0x2263f7[_0xd72c('0xd')],'transfereeaccountcode':_0x2263f7['transfereeaccountcode'],'transfereecontext':_0x2263f7[_0xd72c('0xe')],'transfereeexten':_0x2263f7[_0xd72c('0xf')],'transfereelinkedid':_0x2263f7['transfereelinkedid'],'isexternal':_0x2263f7[_0xd72c('0x10')],'context':_0x2263f7[_0xd72c('0x11')],'extension':_0x2263f7[_0xd72c('0x12')],'type':'blind'},'log':_0xd72c('0x13')});};exports[_0xd72c('0x14')]=function(_0xfe4940){return client[_0xd72c('0x1')](_0xd72c('0x13'),{'body':{'result':_0xfe4940['result'],'transfererchannel':_0xfe4940['origtransfererchannel'],'transferercalleridnum':_0xfe4940[_0xd72c('0x15')],'transferercalleridname':_0xfe4940[_0xd72c('0x16')],'transfererconnectedlinenum':_0xfe4940[_0xd72c('0x17')],'transfererconnectedlinename':_0xfe4940[_0xd72c('0x18')],'transfereraccountcode':_0xfe4940[_0xd72c('0x19')],'transferercontext':_0xfe4940['secondtransferercontext'],'transfererexten':_0xfe4940[_0xd72c('0x1a')],'transfererlinkedid':_0xfe4940[_0xd72c('0x1b')],'transfereechannel':_0xfe4940['transfertargetchannel'],'transfereecalleridnum':_0xfe4940[_0xd72c('0x1c')],'transfereecalleridname':_0xfe4940[_0xd72c('0x1d')],'transfereeconnectedlinenum':_0xfe4940[_0xd72c('0x1e')],'transfereeconnectedlinename':_0xfe4940['transfertargetconnectedlinename'],'transfereeaccountcode':_0xfe4940['transfertargetaccountcode'],'transfereecontext':_0xfe4940['transfertargetcontext'],'transfereeexten':_0xfe4940['transfertargetexten'],'transfereelinkedid':_0xfe4940['transfertargetlinkedid'],'isexternal':_0xfe4940['isexternal'],'context':_0xfe4940[_0xd72c('0x1f')],'extension':_0xfe4940['origtransfererexten'],'type':_0xd72c('0x20')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index f162b54..02aed6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','../ami','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','command','Action','content','voiceQueues','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','length','find','omit','undefined','values','channels','voicechannel','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','voicequeuechannel','map','queueChannels','voicequeuechannelhangup','Hangup','Redirect','context','telephones','trunks','outboundChannels','outbound','run','event'];(function(_0x1e9927,_0x41d9f5){var _0x4d4ade=function(_0x59c46b){while(--_0x59c46b){_0x1e9927['push'](_0x1e9927['shift']());}};_0x4d4ade(++_0x41d9f5);}(_0xba34,0x119));var _0x4ba3=function(_0x5df047,_0x4188fb){_0x5df047=_0x5df047-0x0;var _0xd14c13=_0xba34[_0x5df047];return _0xd14c13;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var jayson=require(_0x4ba3('0x2'));var schema=require(_0x4ba3('0x3'));var BPromise=require(_0x4ba3('0x4'));var moment=require('moment');var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x4ba3('0x5'));exports[_0x4ba3('0x6')]=function(_0x278101,_0x1011ec,_0x3590a1){return new BPromise(function(_0xb88621,_0xe5f99a){var _0x585f2d={'QueuePause':function(_0x6254fb){return new Promise(function(_0x368eee,_0x2df7f3){var _0x18e332=util[_0x4ba3('0x7')](_0x4ba3('0x8'),_0x4ba3('0x9'),_0x6254fb[_0x4ba3('0xa')]);if(_0x278101[_0x4ba3('0xb')]&&_0x278101[_0x4ba3('0xb')][_0x18e332]&&_0x278101[_0x4ba3('0xb')][_0x18e332]['timer']){_0x278101[_0x4ba3('0xb')][_0x18e332][_0x4ba3('0xc')]();}if(_0x278101['agents'][_0x18e332]){_0x278101[_0x4ba3('0xd')][_0x18e332]['updateStatusRealtime']({'statePause':_0x6254fb[_0x4ba3('0xe')]?!![]:![]});}_0x368eee({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x256f02){var _0x4419b4=this;return new Promise(function(_0x29e498,_0x3515e9){if(ami[_0x4ba3('0xf')]()==![]){return _0x3515e9(_0x4419b4[_0x4ba3('0x10')](0x1f4,[config[_0x4ba3('0x11')]['ip'],config[_0x4ba3('0x11')][_0x4ba3('0x12')],_0x4ba3('0x13')][_0x4ba3('0x14')]('\x20')));}_0x256f02=_[_0x4ba3('0x15')](_0x256f02,_[_0x4ba3('0x16')](properties[_0x4ba3('0x17')]));_0x256f02[_0x4ba3('0x18')]=_0x4ba3('0x19');return ami['Action'](_0x256f02)[_0x4ba3('0x1a')](function(_0x788277){_0x29e498({'code':0xc8,'message':_0x788277[_0x4ba3('0x1b')]});})[_0x4ba3('0x1c')](function(_0x556290){_0x3515e9(_0x4419b4[_0x4ba3('0x10')](0x1f5,_0x556290[_0x4ba3('0x1b')]));});});},'Command':function(_0x70c677){var _0x1e2ce5=this;return new Promise(function(_0x184332,_0x125944){if(ami['isConnected']()==![]){return _0x125944(_0x1e2ce5['error'](0x1f4,[config[_0x4ba3('0x11')]['ip'],config['asterisk'][_0x4ba3('0x12')],_0x4ba3('0x13')][_0x4ba3('0x14')]('\x20')));}_0x70c677=_[_0x4ba3('0x15')](_0x70c677,_0x4ba3('0x1d'));_0x70c677[_0x4ba3('0x18')]='Command';return ami[_0x4ba3('0x1e')](_0x70c677)[_0x4ba3('0x1a')](function(_0x5c28f9){_0x184332({'code':0xc8,'message':_0x5c28f9[_0x4ba3('0x1f')]});})['catch'](function(_0x1ae4de){_0x125944(_0x1e2ce5[_0x4ba3('0x10')](0x1f5,_0x1ae4de[_0x4ba3('0x1b')]));});});},'VoiceQueues':function(_0x37e6f3){return new Promise(function(_0x152e41,_0xe29a49){var _0x159596=[];for(var _0xe1f7d2 in _0x278101[_0x4ba3('0x20')]){if(_0x278101[_0x4ba3('0x20')]['hasOwnProperty'](_0xe1f7d2)){var _0x252f37=_0x278101[_0x4ba3('0x20')][_0xe1f7d2];var _0x2311ed={'id':_0x252f37['id'],'name':_0x252f37['name'],'strategy':_0x252f37[_0x4ba3('0x21')],'answered':_0x252f37[_0x4ba3('0x22')],'available':_0x252f37[_0x4ba3('0x23')],'loggedIn':_0x252f37['loggedIn'],'pTalking':_0x252f37[_0x4ba3('0x24')],'sumBillable':_0x252f37[_0x4ba3('0x25')],'sumDuration':_0x252f37[_0x4ba3('0x26')],'sumHoldTime':_0x252f37[_0x4ba3('0x27')]||0x0,'talking':_0x252f37['talking'],'total':_0x252f37['total'],'type':_0x252f37[_0x4ba3('0x28')],'unmanaged':_0x252f37[_0x4ba3('0x29')],'abandoned':_0x252f37[_0x4ba3('0x2a')],'waiting':_0x252f37[_0x4ba3('0x2b')],'loggedInDb':_0x252f37[_0x4ba3('0x2c')]};if(_0x252f37[_0x4ba3('0x28')]==='outbound'){_0x2311ed[_0x4ba3('0x2d')]=_0x252f37[_0x4ba3('0x2d')];_0x2311ed[_0x4ba3('0x2e')]=_0x252f37[_0x4ba3('0x2e')];_0x2311ed[_0x4ba3('0x2f')]=_0x252f37[_0x4ba3('0x2f')];_0x2311ed[_0x4ba3('0x30')]=_0x252f37[_0x4ba3('0x30')];_0x2311ed[_0x4ba3('0x31')]=_0x252f37[_0x4ba3('0x31')];_0x2311ed['dialPrefix']=_0x252f37['dialPrefix'];_0x2311ed['temp']=_0x252f37[_0x4ba3('0x32')];_0x2311ed[_0x4ba3('0x33')]=_0x252f37[_0x4ba3('0x33')];_0x2311ed[_0x4ba3('0x34')]=_0x252f37[_0x4ba3('0x34')];_0x2311ed[_0x4ba3('0x35')]=_0x252f37[_0x4ba3('0x35')];_0x2311ed[_0x4ba3('0x36')]=_0x252f37[_0x4ba3('0x36')];_0x2311ed[_0x4ba3('0x37')]=_0x252f37[_0x4ba3('0x37')];_0x2311ed[_0x4ba3('0x38')]=_0x252f37['outboundDropCallsDayACS'];_0x2311ed[_0x4ba3('0x39')]=_0x252f37[_0x4ba3('0x39')];_0x2311ed[_0x4ba3('0x3a')]=_0x252f37['outboundDropCallsDayTimeout'];_0x2311ed[_0x4ba3('0x3b')]=_0x252f37['outboundNoAnswerCallsDay'];_0x2311ed[_0x4ba3('0x3c')]=_0x252f37[_0x4ba3('0x3c')];_0x2311ed[_0x4ba3('0x3d')]=_0x252f37[_0x4ba3('0x3d')];_0x2311ed[_0x4ba3('0x3e')]=_0x252f37[_0x4ba3('0x3e')];_0x2311ed['outboundRejectCallsDay']=_0x252f37[_0x4ba3('0x3f')];_0x2311ed[_0x4ba3('0x40')]=_0x252f37[_0x4ba3('0x40')];_0x2311ed['predictiveIntervalAnsweredCalls']=_0x252f37[_0x4ba3('0x41')];_0x2311ed[_0x4ba3('0x42')]=_0x252f37['predictiveIntervalAvgHoldtime'];_0x2311ed[_0x4ba3('0x43')]=_0x252f37['predictiveIntervalAvgTalktime'];_0x2311ed['predictiveIntervalDroppedCallsCallersExit']=_0x252f37[_0x4ba3('0x44')];_0x2311ed[_0x4ba3('0x45')]=_0x252f37[_0x4ba3('0x45')];_0x2311ed[_0x4ba3('0x46')]=_0x252f37[_0x4ba3('0x46')];_0x2311ed['predictiveIntervalErlangCallsDroppedCalls']=_0x252f37[_0x4ba3('0x47')];_0x2311ed[_0x4ba3('0x48')]=_0x252f37[_0x4ba3('0x48')];_0x2311ed[_0x4ba3('0x49')]=_0x252f37[_0x4ba3('0x49')];_0x2311ed[_0x4ba3('0x4a')]=_0x252f37[_0x4ba3('0x4a')];_0x2311ed[_0x4ba3('0x4b')]=_0x252f37['predictiveIntervalAvailable'];_0x2311ed[_0x4ba3('0x4c')]=_0x252f37[_0x4ba3('0x4c')];_0x2311ed[_0x4ba3('0x1b')]=_0x252f37[_0x4ba3('0x1b')];_0x2311ed[_0x4ba3('0x4d')]=_0x252f37[_0x4ba3('0x4d')];_0x2311ed[_0x4ba3('0x4e')]=_0x252f37[_0x4ba3('0x4e')];_0x2311ed[_0x4ba3('0x4f')]=_0x252f37[_0x4ba3('0x4f')];_0x2311ed[_0x4ba3('0x50')]=_0x252f37[_0x4ba3('0x50')];_0x2311ed[_0x4ba3('0x51')]=_0x252f37[_0x4ba3('0x51')];_0x2311ed['startPredictive']=_0x252f37['startPredictive'];_0x2311ed['startProgressive']=_0x252f37['startProgressive'];}if(_0x252f37['Trunk']){_0x2311ed[_0x4ba3('0x52')]={'id':_0x252f37['Trunk']['id'],'name':_0x252f37[_0x4ba3('0x52')]['name'],'active':_0x252f37[_0x4ba3('0x52')][_0x4ba3('0x53')],'callerid':_0x252f37[_0x4ba3('0x52')][_0x4ba3('0x54')]};}if(_0x252f37[_0x4ba3('0x55')]){_0x2311ed['Interval']={'id':_0x252f37[_0x4ba3('0x55')]['id'],'name':_0x252f37['Interval'][_0x4ba3('0xa')]};}_0x159596['push'](_0x2311ed);}}_0x152e41({'count':_0x159596[_0x4ba3('0x56')],'rows':_0x159596});});},'UpdateVoiceQueue':function(_0x1665eb){return new Promise(function(_0x3392a4,_0x261a5e){var _0xc23afe=_[_0x4ba3('0x57')](_0x278101[_0x4ba3('0x20')],{'id':parseInt(_0x1665eb['id'])});var _0x5d5714=_[_0x4ba3('0x58')](_0x1665eb,['id']);if(_0xc23afe){for(var _0x13cc06 in _0x5d5714){if(typeof _0x5d5714[_0x13cc06]!==_0x4ba3('0x59')&&typeof _0xc23afe[_0x13cc06]!==_0x4ba3('0x59')){_0xc23afe[_0x13cc06]=_0x5d5714[_0x13cc06];}}_0x3392a4(_0xc23afe);}else{_0x261a5e();}});},'VoiceChannels':function(_0x24986a){return new Promise(function(_0x480668,_0x56b55d){var _0xa4bbb2=_[_0x4ba3('0x5a')](_0x278101[_0x4ba3('0x5b')]);_0x480668({'count':_0xa4bbb2['length'],'rows':_0xa4bbb2});});},'VoiceChannelMixMonitor':function(_0xd466f6){var _0xfd30a0=this;return new Promise(function(_0x1220f4,_0x58648d){if(ami['isConnected']()==![]){return _0x58648d(_0xfd30a0[_0x4ba3('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x4ba3('0x11')][_0x4ba3('0x12')],_0x4ba3('0x13')][_0x4ba3('0x14')]('\x20')));}var _0x3d7b9d=schema(properties[_0x4ba3('0x5c')])['validate'](_0xd466f6);if(_0x3d7b9d[_0x4ba3('0x56')]>0x0){return _0x58648d(_0xfd30a0[_0x4ba3('0x10')](0x1f4,_['map'](_0x3d7b9d,_0x4ba3('0x1b'))[_0x4ba3('0x14')](',\x20')));}var _0x156c2d=_[_0x4ba3('0x57')](_0x278101[_0x4ba3('0x5b')],{'uniqueid':_0xd466f6['uniqueid']});if(_0x156c2d&&_0x156c2d[_0x4ba3('0x5d')]){var _0x38de05=util['format'](_0x4ba3('0x5e'),_0xd466f6[_0x4ba3('0x5f')]||_0xd466f6[_0x4ba3('0x60')],_0xd466f6[_0x4ba3('0x7')]||_0x4ba3('0x61'));return ami[_0x4ba3('0x1e')]({'action':_0x4ba3('0x62'),'channel':_0x156c2d[_0x4ba3('0x5d')],'file':_0x38de05,'options':_0x4ba3('0x63')})[_0x4ba3('0x1a')](function(_0x6ad6aa){var _0x29161b=_[_0x4ba3('0x57')](_0x156c2d[_0x4ba3('0x64')],{'filename':_0x4ba3('0x65')+_0x38de05['toLowerCase']()});if(_['isNil'](_0x29161b)){_0x156c2d['monitors'][_0x4ba3('0x66')]({'filename':_0x4ba3('0x65')+_0x38de05[_0x4ba3('0x67')](),'createdAt':moment()[_0x4ba3('0x7')](_0x4ba3('0x68')),'mixmonitorid':_0x6ad6aa['mixmonitorid'],'status':_0x4ba3('0x69')});}else{_0x29161b[_0x4ba3('0x6a')]=_0x6ad6aa[_0x4ba3('0x6a')];_0x29161b[_0x4ba3('0x6b')]=_0x4ba3('0x69');}_0x1220f4({'code':0xc8,'message':[_0xd466f6[_0x4ba3('0x60')],_0x4ba3('0x6c'),_0x6ad6aa[_0x4ba3('0x6a')]][_0x4ba3('0x14')]('\x20'),'mixmonitorid':_0x6ad6aa[_0x4ba3('0x6a')]});})[_0x4ba3('0x1c')](function(_0x43056b){_0x58648d(_0xfd30a0[_0x4ba3('0x10')](0x1f5,[_0xd466f6[_0x4ba3('0x60')],_0x43056b['message'][_0x4ba3('0x67')]()][_0x4ba3('0x14')]('\x20')));});}else{return _0x58648d(_0xfd30a0[_0x4ba3('0x10')](0x1f5,_0x4ba3('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x22d5ca){var _0x3d3313=this;return new Promise(function(_0x40827a,_0x3f6174){if(ami['isConnected']()==![]){return _0x3f6174(_0x3d3313[_0x4ba3('0x10')](0x1f4,[config[_0x4ba3('0x11')]['ip'],config[_0x4ba3('0x11')]['username'],_0x4ba3('0x13')]['join']('\x20')));}var _0x1b7c4e=schema(properties[_0x4ba3('0x5c')])[_0x4ba3('0x3')](_0x22d5ca);if(_0x1b7c4e[_0x4ba3('0x56')]>0x0){return _0x3f6174(_0x3d3313[_0x4ba3('0x10')](0x1f4,_['map'](_0x1b7c4e,_0x4ba3('0x1b'))[_0x4ba3('0x14')](',\x20')));}var _0x2a48fe=_[_0x4ba3('0x57')](_0x278101[_0x4ba3('0x5b')],{'uniqueid':_0x22d5ca['uniqueid']});if(_0x2a48fe){return BPromise[_0x4ba3('0x6e')]()[_0x4ba3('0x1a')](function(){if(_0x2a48fe[_0x4ba3('0x5d')]){return ami[_0x4ba3('0x1e')]({'action':_0x4ba3('0x6f'),'channel':_0x2a48fe[_0x4ba3('0x5d')],'mixmonitorid':_0x22d5ca[_0x4ba3('0x6a')]})[_0x4ba3('0x1c')](function(_0x39ddf3){});}})[_0x4ba3('0x1a')](function(){if(_0x2a48fe[_0x4ba3('0x70')]){return ami['Action']({'action':_0x4ba3('0x6f'),'channel':_0x2a48fe[_0x4ba3('0x70')],'mixmonitorid':_0x22d5ca['mixmonitorid']})['catch'](function(_0x3a6386){});}})[_0x4ba3('0x1a')](function(_0x5c7c2f){var _0x220c83=_[_0x4ba3('0x57')](_0x2a48fe[_0x4ba3('0x64')],{'mixmonitorid':_0x22d5ca['mixmonitorid']});if(_0x220c83){_0x220c83[_0x4ba3('0x6b')]=_0x4ba3('0x71');}})[_0x4ba3('0x1a')](function(){var _0x11209b=util[_0x4ba3('0x7')](_0x4ba3('0x5e'),_0x22d5ca['filename']||_0x22d5ca[_0x4ba3('0x60')],_0x22d5ca[_0x4ba3('0x7')]||_0x4ba3('0x61'));var _0x4e5bd7=_[_0x4ba3('0x57')](_0x2a48fe[_0x4ba3('0x64')],{'filename':_0x4ba3('0x65')+_0x11209b[_0x4ba3('0x67')]()});if(_0x4e5bd7){_0x4e5bd7[_0x4ba3('0x6b')]=_0x4ba3('0x71');}})[_0x4ba3('0x1a')](function(){_0x40827a({'code':0xc8,'message':[_0x22d5ca[_0x4ba3('0x60')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x4ba3('0x1c')](function(_0x5d8e46){_0x3f6174(_0x3d3313[_0x4ba3('0x10')](0x1f5,[_0x22d5ca[_0x4ba3('0x60')],_0x5d8e46[_0x4ba3('0x1b')]['toLowerCase']()][_0x4ba3('0x14')]('\x20')));});}else{return _0x3f6174(_0x3d3313[_0x4ba3('0x10')](0x1f5,_0x4ba3('0x6d')));}});},'VoiceQueuesChannels':function(_0x5baf26){return new Promise(function(_0x36dca0,_0x55b660){var _0xd6ad8e=_[_0x4ba3('0x5a')](_0x278101['queueChannels']);_0x36dca0({'count':_0xd6ad8e[_0x4ba3('0x56')],'rows':_0xd6ad8e});});},'VoiceQueuesChannel':function(_0x2ed729){var _0x3e566d=this;return new Promise(function(_0x1f4d92,_0x2feb68){var _0xa9a35d=schema(properties[_0x4ba3('0x72')])[_0x4ba3('0x3')](_0x2ed729);if(_0xa9a35d[_0x4ba3('0x56')]>0x0){return _0x2feb68(_0x3e566d['error'](0x1f4,_[_0x4ba3('0x73')](_0xa9a35d,_0x4ba3('0x1b'))[_0x4ba3('0x14')](',\x20')));}var _0x4378cc=_[_0x4ba3('0x57')](_0x278101[_0x4ba3('0x74')],{'uniqueid':_0x2ed729[_0x4ba3('0x60')]});if(_0x4378cc){_0x1f4d92(_0x4378cc);}else{return _0x2feb68(_0x3e566d[_0x4ba3('0x10')](0x1f5,_0x4ba3('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x1a3180){var _0x468219=this;return new Promise(function(_0x3ab4bd,_0x4e46af){if(ami[_0x4ba3('0xf')]()==![]){return _0x4e46af(_0x468219[_0x4ba3('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x4ba3('0x11')][_0x4ba3('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x4ce27=schema(properties[_0x4ba3('0x75')])[_0x4ba3('0x3')](_0x1a3180);if(_0x4ce27[_0x4ba3('0x56')]>0x0){return _0x4e46af(_0x468219[_0x4ba3('0x10')](0x1f4,_[_0x4ba3('0x73')](_0x4ce27,_0x4ba3('0x1b'))[_0x4ba3('0x14')](',\x20')));}var _0x516c41=_[_0x4ba3('0x57')](_0x278101['queueChannels'],{'uniqueid':_0x1a3180[_0x4ba3('0x60')]});if(_0x516c41&&_0x516c41[_0x4ba3('0x5d')]){return ami[_0x4ba3('0x1e')]({'action':_0x4ba3('0x76'),'channel':_0x516c41[_0x4ba3('0x5d')]})[_0x4ba3('0x1a')](function(_0x157b32){_0x3ab4bd({'code':0xc8,'message':[_0x1a3180[_0x4ba3('0x60')],_0x157b32['message'][_0x4ba3('0x67')]()][_0x4ba3('0x14')]('\x20')});})[_0x4ba3('0x1c')](function(_0x5a1872){_0x4e46af(_0x468219[_0x4ba3('0x10')](0x1f5,[_0x1a3180[_0x4ba3('0x60')],_0x5a1872[_0x4ba3('0x1b')][_0x4ba3('0x67')]()][_0x4ba3('0x14')]('\x20')));});}else{return _0x4e46af(_0x468219[_0x4ba3('0x10')](0x1f5,_0x4ba3('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x5c70b9){var _0x498437=this;return new Promise(function(_0x42ce25,_0x5106a8){if(ami[_0x4ba3('0xf')]()==![]){return _0x5106a8(_0x498437[_0x4ba3('0x10')](0x1f4,[config[_0x4ba3('0x11')]['ip'],config[_0x4ba3('0x11')]['username'],'ami\x20disconnected'][_0x4ba3('0x14')]('\x20')));}var _0x2b2132=schema(properties['voicequeuechannelredirect'])[_0x4ba3('0x3')](_0x5c70b9);if(_0x2b2132[_0x4ba3('0x56')]>0x0){return _0x5106a8(_0x498437[_0x4ba3('0x10')](0x1f4,_[_0x4ba3('0x73')](_0x2b2132,_0x4ba3('0x1b'))[_0x4ba3('0x14')](',\x20')));}var _0x3e99e3=_['find'](_0x278101[_0x4ba3('0x74')],{'uniqueid':_0x5c70b9[_0x4ba3('0x60')]});if(_0x3e99e3&&_0x3e99e3[_0x4ba3('0x5d')]){return ami['Action']({'action':_0x4ba3('0x77'),'channel':_0x3e99e3[_0x4ba3('0x5d')],'exten':_0x5c70b9['exten'],'context':_0x5c70b9[_0x4ba3('0x78')]||_0x3e99e3[_0x4ba3('0x78')],'priority':0x1})['then'](function(_0x4f5dee){_0x42ce25({'code':0xc8,'message':[_0x5c70b9['uniqueid'],_0x4f5dee['message'][_0x4ba3('0x67')]()][_0x4ba3('0x14')]('\x20')});})[_0x4ba3('0x1c')](function(_0x219aa4){_0x5106a8(_0x498437[_0x4ba3('0x10')](0x1f5,[_0x5c70b9[_0x4ba3('0x60')],_0x219aa4[_0x4ba3('0x1b')]['toLowerCase']()][_0x4ba3('0x14')]('\x20')));});}else{return _0x5106a8(_0x498437['error'](0x1f5,_0x4ba3('0x6d')));}});},'Agents':function(_0x5180f1){return new Promise(function(_0x27298f,_0x1a37f7){var _0x88b6a2=_[_0x4ba3('0x5a')](_0x278101[_0x4ba3('0xd')]);_0x27298f({'count':_0x88b6a2['length'],'rows':_0x88b6a2});});},'Telephones':function(_0x536313){return new Promise(function(_0x377b4c,_0x3d1f35){var _0x2cf661=_[_0x4ba3('0x5a')](_0x278101[_0x4ba3('0x79')]);_0x377b4c({'count':_0x2cf661[_0x4ba3('0x56')],'rows':_0x2cf661});});},'Trunks':function(_0x7ec030){return new Promise(function(_0x3d8606,_0x2d00e3){var _0x35441e=_[_0x4ba3('0x5a')](_0x278101[_0x4ba3('0x7a')]);_0x3d8606({'count':_0x35441e['length'],'rows':_0x35441e});});},'OutboundChannels':function(_0x375c61){return new Promise(function(_0x4cdc16,_0x3f5309){var _0x44568e=_[_0x4ba3('0x5a')](_0x278101[_0x4ba3('0x7b')]);_0x4cdc16({'count':_0x44568e['length'],'rows':_0x44568e});});},'Outbound':function(_0x2a2dc2){return new Promise(function(_0x31d66d,_0x2c304e){_0x31d66d(_0x278101[_0x4ba3('0x7c')]);});},'Campaigns':function(_0x5450f1){return new Promise(function(_0x530cfe,_0x139ddf){var _0xf95a3e=_[_0x4ba3('0x5a')](_0x278101['campaigns']);_0x530cfe({'count':_0xf95a3e[_0x4ba3('0x56')],'rows':_0xf95a3e});});},'VoiceQueuesPreview':function(_0x1194a5){var _0x22a9fb=this;return new Promise(function(_0x473229,_0x3f8444){_0x1011ec[_0x4ba3('0x7d')](_0x1194a5['id'])['then'](function(_0x3b805d){_0x473229({'code':0xc8,'message':_0x3b805d['message']});})[_0x4ba3('0x1c')](function(_0xa3e849){_0x3f8444(_0x22a9fb[_0x4ba3('0x10')](0x1f4,_0xa3e849[_0x4ba3('0x1b')]));});});},'EventManager':function(_0x48cb1a){var _0x11be49=this;return new Promise(function(_0x3bbcfb,_0x4b3cc0){if(!_0x48cb1a[_0x4ba3('0x7e')]){return _0x4b3cc0(_0x11be49['error'](0x1f4,_0x4ba3('0x7f')));}ami[_0x4ba3('0x80')](_0x4ba3('0x81')+_0x48cb1a[_0x4ba3('0x7e')],_0x48cb1a[_0x4ba3('0x1b')]);_0x3bbcfb({'code':0xc8,'message':_0x48cb1a});});},'FaxAccounts':function(_0x5c6180){return new Promise(function(_0x4a8dd4,_0x16e96c){var _0x3fa969=_[_0x4ba3('0x5a')](_0x278101['faxAccounts']);_0x4a8dd4({'count':_0x3fa969[_0x4ba3('0x56')],'rows':_0x3fa969});});},'SendFax':function(_0x38a7a8){var _0x5553eb=this;return new Promise(function(_0x402ab1,_0x236603){_0x3590a1[_0x4ba3('0x82')](_0x38a7a8)[_0x4ba3('0x1a')](function(_0x67cc0c){_0x402ab1({'code':0xc8,'message':_0x67cc0c[_0x4ba3('0x1b')]});})[_0x4ba3('0x1c')](function(_0xaabf96){_0x236603(_0x5553eb['error'](0x1f4,_0xaabf96[_0x4ba3('0x1b')]));});});},'CheckAfterSend':function(_0x4654e9){var _0xfb16a6=this;return new Promise(function(_0x1fe247,_0x162c1c){_0x3590a1[_0x4ba3('0x83')](_0x4654e9)[_0x4ba3('0x1a')](function(_0x44043c){_0x1fe247({'code':0xc8,'message':_0x44043c[_0x4ba3('0x1b')]});})[_0x4ba3('0x1c')](function(_0x285a5d){_0x162c1c(_0xfb16a6[_0x4ba3('0x10')](0x1f4,_0x285a5d[_0x4ba3('0x1b')]));});});}};var _0x4e5235=jayson['server'](_0x585f2d)[_0x4ba3('0x84')]();_0x4e5235['on'](_0x4ba3('0x10'),function(_0x25fa2a){return _0xe5f99a(_0x25fa2a);});_0x4e5235[_0x4ba3('0x6')](0x232a,_0x4ba3('0x85'),function(){console[_0x4ba3('0x86')](_0x4ba3('0x87'),0x232a);return _0xb88621('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0x3fa4=['name','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','validate','find','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','filename','toLowerCase','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','context','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','server','127.0.0.1','lodash','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','timers','timer','agents','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','keys','module','action','Reload','Action','then','catch','error','message','isConnected','username','command','Command','content','voiceQueues'];(function(_0x2fe4b5,_0x439480){var _0x2b9c0b=function(_0x5bfca9){while(--_0x5bfca9){_0x2fe4b5['push'](_0x2fe4b5['shift']());}};_0x2b9c0b(++_0x439480);}(_0x3fa4,0xf0));var _0x43fa=function(_0x46e7aa,_0x5cfe0a){_0x46e7aa=_0x46e7aa-0x0;var _0x2befe6=_0x3fa4[_0x46e7aa];return _0x2befe6;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var config=require(_0x43fa('0x3'));var properties=require(_0x43fa('0x4'));var ami=require(_0x43fa('0x5'));exports[_0x43fa('0x6')]=function(_0x41ded6,_0x4cd7ec,_0x2c7789){return new BPromise(function(_0x1e53b3,_0x6df71c){var _0x584209={'QueuePause':function(_0x3dc891){return new Promise(function(_0x46adc7,_0x1dc401){var _0x5a3921=util[_0x43fa('0x7')](_0x43fa('0x8'),'SIP',_0x3dc891['name']);if(_0x41ded6[_0x43fa('0x9')]&&_0x41ded6[_0x43fa('0x9')][_0x5a3921]&&_0x41ded6[_0x43fa('0x9')][_0x5a3921][_0x43fa('0xa')]){_0x41ded6[_0x43fa('0x9')][_0x5a3921]['updateAcw']();}if(_0x41ded6[_0x43fa('0xb')][_0x5a3921]){_0x41ded6[_0x43fa('0xb')][_0x5a3921][_0x43fa('0xc')]({'statePause':_0x3dc891['pause']?!![]:![]});}_0x46adc7({'code':0xc8,'message':_0x43fa('0xd')});});},'Reload':function(_0x4353c1){var _0x4665c1=this;return new Promise(function(_0x529c85,_0x24fb1e){if(ami['isConnected']()==![]){return _0x24fb1e(_0x4665c1['error'](0x1f4,[config['asterisk']['ip'],config[_0x43fa('0xe')]['username'],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}_0x4353c1=_['pick'](_0x4353c1,_[_0x43fa('0x11')](properties[_0x43fa('0x12')]));_0x4353c1[_0x43fa('0x13')]=_0x43fa('0x14');return ami[_0x43fa('0x15')](_0x4353c1)[_0x43fa('0x16')](function(_0x5d12ac){_0x529c85({'code':0xc8,'message':_0x5d12ac['message']});})[_0x43fa('0x17')](function(_0x29b8aa){_0x24fb1e(_0x4665c1[_0x43fa('0x18')](0x1f5,_0x29b8aa[_0x43fa('0x19')]));});});},'Command':function(_0x660f61){var _0x15e594=this;return new Promise(function(_0xdf68a6,_0x2d8594){if(ami[_0x43fa('0x1a')]()==![]){return _0x2d8594(_0x15e594['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')][_0x43fa('0x1b')],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}_0x660f61=_['pick'](_0x660f61,_0x43fa('0x1c'));_0x660f61[_0x43fa('0x13')]=_0x43fa('0x1d');return ami[_0x43fa('0x15')](_0x660f61)[_0x43fa('0x16')](function(_0x1d3328){_0xdf68a6({'code':0xc8,'message':_0x1d3328[_0x43fa('0x1e')]});})[_0x43fa('0x17')](function(_0x427426){_0x2d8594(_0x15e594['error'](0x1f5,_0x427426['message']));});});},'VoiceQueues':function(_0xdb62ec){return new Promise(function(_0x197eac,_0x28f695){var _0x78f105=[];for(var _0x40969a in _0x41ded6[_0x43fa('0x1f')]){if(_0x41ded6['voiceQueues']['hasOwnProperty'](_0x40969a)){var _0x1fa077=_0x41ded6[_0x43fa('0x1f')][_0x40969a];var _0x3d6365={'id':_0x1fa077['id'],'name':_0x1fa077[_0x43fa('0x20')],'strategy':_0x1fa077['strategy'],'answered':_0x1fa077[_0x43fa('0x21')],'available':_0x1fa077[_0x43fa('0x22')],'loggedIn':_0x1fa077[_0x43fa('0x23')],'pTalking':_0x1fa077[_0x43fa('0x24')],'sumBillable':_0x1fa077['sumBillable'],'sumDuration':_0x1fa077[_0x43fa('0x25')],'sumHoldTime':_0x1fa077[_0x43fa('0x26')]||0x0,'talking':_0x1fa077[_0x43fa('0x27')],'total':_0x1fa077[_0x43fa('0x28')],'type':_0x1fa077[_0x43fa('0x29')],'unmanaged':_0x1fa077[_0x43fa('0x2a')],'abandoned':_0x1fa077[_0x43fa('0x2b')],'waiting':_0x1fa077[_0x43fa('0x2c')],'loggedInDb':_0x1fa077[_0x43fa('0x2d')]};if(_0x1fa077[_0x43fa('0x29')]===_0x43fa('0x2e')){_0x3d6365[_0x43fa('0x2f')]=_0x1fa077['dialActive'];_0x3d6365['dialMethod']=_0x1fa077[_0x43fa('0x30')];_0x3d6365[_0x43fa('0x31')]=_0x1fa077[_0x43fa('0x31')];_0x3d6365[_0x43fa('0x32')]=_0x1fa077['dialOriginateCallerIdNumber'];_0x3d6365[_0x43fa('0x33')]=_0x1fa077[_0x43fa('0x33')];_0x3d6365[_0x43fa('0x34')]=_0x1fa077['dialPrefix'];_0x3d6365[_0x43fa('0x35')]=_0x1fa077[_0x43fa('0x35')];_0x3d6365[_0x43fa('0x36')]=_0x1fa077[_0x43fa('0x36')];_0x3d6365['outboundAnswerCallsDay']=_0x1fa077[_0x43fa('0x37')];_0x3d6365['outboundBlacklistCallsDay']=_0x1fa077[_0x43fa('0x38')];_0x3d6365[_0x43fa('0x39')]=_0x1fa077[_0x43fa('0x39')];_0x3d6365['outboundCongestionCallsDay']=_0x1fa077[_0x43fa('0x3a')];_0x3d6365['outboundDropCallsDayACS']=_0x1fa077['outboundDropCallsDayACS'];_0x3d6365[_0x43fa('0x3b')]=_0x1fa077[_0x43fa('0x3b')];_0x3d6365[_0x43fa('0x3c')]=_0x1fa077['outboundDropCallsDayTimeout'];_0x3d6365[_0x43fa('0x3d')]=_0x1fa077[_0x43fa('0x3d')];_0x3d6365[_0x43fa('0x3e')]=_0x1fa077[_0x43fa('0x3e')];_0x3d6365[_0x43fa('0x3f')]=_0x1fa077['outboundOriginateFailureCallsDay'];_0x3d6365[_0x43fa('0x40')]=_0x1fa077[_0x43fa('0x40')];_0x3d6365[_0x43fa('0x41')]=_0x1fa077[_0x43fa('0x41')];_0x3d6365['outboundUnknownCallsDay']=_0x1fa077['outboundUnknownCallsDay'];_0x3d6365[_0x43fa('0x42')]=_0x1fa077[_0x43fa('0x42')];_0x3d6365[_0x43fa('0x43')]=_0x1fa077[_0x43fa('0x43')];_0x3d6365[_0x43fa('0x44')]=_0x1fa077['predictiveIntervalAvgTalktime'];_0x3d6365[_0x43fa('0x45')]=_0x1fa077['predictiveIntervalDroppedCallsCallersExit'];_0x3d6365['predictiveIntervalDroppedCallsTimeout']=_0x1fa077[_0x43fa('0x46')];_0x3d6365['predictiveIntervalErlangCalls']=_0x1fa077[_0x43fa('0x47')];_0x3d6365[_0x43fa('0x48')]=_0x1fa077[_0x43fa('0x48')];_0x3d6365[_0x43fa('0x49')]=_0x1fa077['predictiveIntervalHitRate'];_0x3d6365['predictiveIntervalMultiplicativeFactor']=_0x1fa077['predictiveIntervalMultiplicativeFactor'];_0x3d6365[_0x43fa('0x4a')]=_0x1fa077[_0x43fa('0x4a')];_0x3d6365['predictiveIntervalAvailable']=_0x1fa077[_0x43fa('0x4b')];_0x3d6365[_0x43fa('0x4c')]=_0x1fa077[_0x43fa('0x4c')];_0x3d6365[_0x43fa('0x19')]=_0x1fa077['message'];_0x3d6365[_0x43fa('0x4d')]=_0x1fa077[_0x43fa('0x4d')];_0x3d6365['erlangCalls']=_0x1fa077['erlangCalls'];_0x3d6365[_0x43fa('0x4e')]=_0x1fa077['erlangCallToSecond'];_0x3d6365[_0x43fa('0x4f')]=_0x1fa077[_0x43fa('0x4f')];_0x3d6365['erlangBusyFactor']=_0x1fa077[_0x43fa('0x50')];_0x3d6365['startPredictive']=_0x1fa077[_0x43fa('0x51')];_0x3d6365[_0x43fa('0x52')]=_0x1fa077[_0x43fa('0x52')];}if(_0x1fa077['Trunk']){_0x3d6365[_0x43fa('0x53')]={'id':_0x1fa077[_0x43fa('0x53')]['id'],'name':_0x1fa077[_0x43fa('0x53')][_0x43fa('0x20')],'active':_0x1fa077[_0x43fa('0x53')][_0x43fa('0x54')],'callerid':_0x1fa077['Trunk'][_0x43fa('0x55')]};}if(_0x1fa077['Interval']){_0x3d6365[_0x43fa('0x56')]={'id':_0x1fa077['Interval']['id'],'name':_0x1fa077[_0x43fa('0x56')][_0x43fa('0x20')]};}_0x78f105[_0x43fa('0x57')](_0x3d6365);}}_0x197eac({'count':_0x78f105[_0x43fa('0x58')],'rows':_0x78f105});});},'UpdateVoiceQueue':function(_0x1b8851){return new Promise(function(_0x5575a7,_0x2fffef){var _0x5c96e1=_['find'](_0x41ded6['voiceQueues'],{'id':parseInt(_0x1b8851['id'])});var _0x436da4=_[_0x43fa('0x59')](_0x1b8851,['id']);if(_0x5c96e1){for(var _0x2c246e in _0x436da4){if(typeof _0x436da4[_0x2c246e]!==_0x43fa('0x5a')&&typeof _0x5c96e1[_0x2c246e]!==_0x43fa('0x5a')){_0x5c96e1[_0x2c246e]=_0x436da4[_0x2c246e];}}_0x5575a7(_0x5c96e1);}else{_0x2fffef();}});},'VoiceChannels':function(_0x4d3522){return new Promise(function(_0x42bf1c,_0x1662d5){var _0x305e90=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x5c')]);_0x42bf1c({'count':_0x305e90[_0x43fa('0x58')],'rows':_0x305e90});});},'VoiceChannelMixMonitor':function(_0x1e2acd){var _0x33f828=this;return new Promise(function(_0x345c65,_0x458e11){if(ami[_0x43fa('0x1a')]()==![]){return _0x458e11(_0x33f828['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')]['username'],_0x43fa('0xf')]['join']('\x20')));}var _0x193a0b=schema(properties[_0x43fa('0x5d')])[_0x43fa('0x5e')](_0x1e2acd);if(_0x193a0b[_0x43fa('0x58')]>0x0){return _0x458e11(_0x33f828[_0x43fa('0x18')](0x1f4,_['map'](_0x193a0b,_0x43fa('0x19'))['join'](',\x20')));}var _0x12ac3f=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x5c')],{'uniqueid':_0x1e2acd['uniqueid']});if(_0x12ac3f&&_0x12ac3f['channel']){var _0xc3f7aa=util['format'](_0x43fa('0x60'),_0x1e2acd['filename']||_0x1e2acd['uniqueid'],_0x1e2acd[_0x43fa('0x7')]||_0x43fa('0x61'));return ami['Action']({'action':_0x43fa('0x62'),'channel':_0x12ac3f[_0x43fa('0x63')],'file':_0xc3f7aa,'options':_0x43fa('0x64')})[_0x43fa('0x16')](function(_0x51d224){var _0xb03adb=_[_0x43fa('0x5f')](_0x12ac3f[_0x43fa('0x65')],{'filename':_0x43fa('0x66')+_0xc3f7aa['toLowerCase']()});if(_['isNil'](_0xb03adb)){_0x12ac3f[_0x43fa('0x65')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0xc3f7aa['toLowerCase'](),'createdAt':moment()[_0x43fa('0x7')](_0x43fa('0x67')),'mixmonitorid':_0x51d224[_0x43fa('0x68')],'status':_0x43fa('0x69')});}else{_0xb03adb[_0x43fa('0x68')]=_0x51d224[_0x43fa('0x68')];_0xb03adb[_0x43fa('0x6a')]='rec';}_0x345c65({'code':0xc8,'message':[_0x1e2acd[_0x43fa('0x6b')],_0x43fa('0x6c'),_0x51d224['mixmonitorid']][_0x43fa('0x10')]('\x20'),'mixmonitorid':_0x51d224['mixmonitorid']});})[_0x43fa('0x17')](function(_0x18cea7){_0x458e11(_0x33f828[_0x43fa('0x18')](0x1f5,[_0x1e2acd[_0x43fa('0x6b')],_0x18cea7['message']['toLowerCase']()][_0x43fa('0x10')]('\x20')));});}else{return _0x458e11(_0x33f828[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x3ba2e0){var _0x5aa7af=this;return new Promise(function(_0x4cfc61,_0x4045d1){if(ami['isConnected']()==![]){return _0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f4,[config[_0x43fa('0xe')]['ip'],config[_0x43fa('0xe')][_0x43fa('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x220e2a=schema(properties['voicechannel'])[_0x43fa('0x5e')](_0x3ba2e0);if(_0x220e2a[_0x43fa('0x58')]>0x0){return _0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f4,_[_0x43fa('0x6e')](_0x220e2a,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x3f89f4=_['find'](_0x41ded6[_0x43fa('0x5c')],{'uniqueid':_0x3ba2e0[_0x43fa('0x6b')]});if(_0x3f89f4){return BPromise[_0x43fa('0x6f')]()[_0x43fa('0x16')](function(){if(_0x3f89f4[_0x43fa('0x63')]){return ami['Action']({'action':_0x43fa('0x70'),'channel':_0x3f89f4[_0x43fa('0x63')],'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]})[_0x43fa('0x17')](function(_0x78f0a9){});}})[_0x43fa('0x16')](function(){if(_0x3f89f4[_0x43fa('0x71')]){return ami[_0x43fa('0x15')]({'action':_0x43fa('0x70'),'channel':_0x3f89f4['destinationchannel'],'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]})[_0x43fa('0x17')](function(_0x2d8a01){});}})[_0x43fa('0x16')](function(_0x31fdeb){var _0x4e9f30=_['find'](_0x3f89f4[_0x43fa('0x65')],{'mixmonitorid':_0x3ba2e0[_0x43fa('0x68')]});if(_0x4e9f30){_0x4e9f30[_0x43fa('0x6a')]=_0x43fa('0x72');}})[_0x43fa('0x16')](function(){var _0x2bae57=util[_0x43fa('0x7')](_0x43fa('0x60'),_0x3ba2e0[_0x43fa('0x73')]||_0x3ba2e0[_0x43fa('0x6b')],_0x3ba2e0[_0x43fa('0x7')]||_0x43fa('0x61'));var _0xa96468=_[_0x43fa('0x5f')](_0x3f89f4[_0x43fa('0x65')],{'filename':_0x43fa('0x66')+_0x2bae57[_0x43fa('0x74')]()});if(_0xa96468){_0xa96468[_0x43fa('0x6a')]=_0x43fa('0x72');}})[_0x43fa('0x16')](function(){_0x4cfc61({'code':0xc8,'message':[_0x3ba2e0[_0x43fa('0x6b')],_0x43fa('0x75')]['join']('\x20')});})['catch'](function(_0x2840d9){_0x4045d1(_0x5aa7af[_0x43fa('0x18')](0x1f5,[_0x3ba2e0['uniqueid'],_0x2840d9[_0x43fa('0x19')]['toLowerCase']()][_0x43fa('0x10')]('\x20')));});}else{return _0x4045d1(_0x5aa7af['error'](0x1f5,_0x43fa('0x6d')));}});},'VoiceQueuesChannels':function(_0x6679e0){return new Promise(function(_0x1b79b3,_0x149093){var _0x61aef=_['values'](_0x41ded6[_0x43fa('0x76')]);_0x1b79b3({'count':_0x61aef['length'],'rows':_0x61aef});});},'VoiceQueuesChannel':function(_0x1ea3a0){var _0x310232=this;return new Promise(function(_0x2ed970,_0x1619ae){var _0x195c8b=schema(properties['voicequeuechannel'])[_0x43fa('0x5e')](_0x1ea3a0);if(_0x195c8b[_0x43fa('0x58')]>0x0){return _0x1619ae(_0x310232['error'](0x1f4,_[_0x43fa('0x6e')](_0x195c8b,'message')[_0x43fa('0x10')](',\x20')));}var _0x3c138c=_['find'](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x1ea3a0[_0x43fa('0x6b')]});if(_0x3c138c){_0x2ed970(_0x3c138c);}else{return _0x1619ae(_0x310232[_0x43fa('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x5c2538){var _0x43088a=this;return new Promise(function(_0x334642,_0x161e93){if(ami[_0x43fa('0x1a')]()==![]){return _0x161e93(_0x43088a['error'](0x1f4,[config[_0x43fa('0xe')]['ip'],config['asterisk']['username'],_0x43fa('0xf')][_0x43fa('0x10')]('\x20')));}var _0xb7596=schema(properties[_0x43fa('0x77')])[_0x43fa('0x5e')](_0x5c2538);if(_0xb7596[_0x43fa('0x58')]>0x0){return _0x161e93(_0x43088a['error'](0x1f4,_[_0x43fa('0x6e')](_0xb7596,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x5779d1=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x5c2538[_0x43fa('0x6b')]});if(_0x5779d1&&_0x5779d1['channel']){return ami[_0x43fa('0x15')]({'action':_0x43fa('0x78'),'channel':_0x5779d1['channel']})['then'](function(_0xa71bb){_0x334642({'code':0xc8,'message':[_0x5c2538[_0x43fa('0x6b')],_0xa71bb[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')});})[_0x43fa('0x17')](function(_0x241200){_0x161e93(_0x43088a[_0x43fa('0x18')](0x1f5,[_0x5c2538[_0x43fa('0x6b')],_0x241200[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')));});}else{return _0x161e93(_0x43088a[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x41ea25){var _0x33b067=this;return new Promise(function(_0x5d3d43,_0x2c3333){if(ami[_0x43fa('0x1a')]()==![]){return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f4,[config[_0x43fa('0xe')]['ip'],config['asterisk'][_0x43fa('0x1b')],'ami\x20disconnected']['join']('\x20')));}var _0x4931dd=schema(properties[_0x43fa('0x79')])['validate'](_0x41ea25);if(_0x4931dd[_0x43fa('0x58')]>0x0){return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f4,_[_0x43fa('0x6e')](_0x4931dd,_0x43fa('0x19'))[_0x43fa('0x10')](',\x20')));}var _0x521d7a=_[_0x43fa('0x5f')](_0x41ded6[_0x43fa('0x76')],{'uniqueid':_0x41ea25[_0x43fa('0x6b')]});if(_0x521d7a&&_0x521d7a[_0x43fa('0x63')]){return ami['Action']({'action':'Redirect','channel':_0x521d7a['channel'],'exten':_0x41ea25['exten'],'context':_0x41ea25[_0x43fa('0x7a')]||_0x521d7a[_0x43fa('0x7a')],'priority':0x1})[_0x43fa('0x16')](function(_0x583deb){_0x5d3d43({'code':0xc8,'message':[_0x41ea25[_0x43fa('0x6b')],_0x583deb[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')});})['catch'](function(_0x170e69){_0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f5,[_0x41ea25[_0x43fa('0x6b')],_0x170e69[_0x43fa('0x19')][_0x43fa('0x74')]()][_0x43fa('0x10')]('\x20')));});}else{return _0x2c3333(_0x33b067[_0x43fa('0x18')](0x1f5,_0x43fa('0x6d')));}});},'Agents':function(_0x5c98df){return new Promise(function(_0x4b31b2,_0x278242){var _0xe218b0=_[_0x43fa('0x5b')](_0x41ded6['agents']);_0x4b31b2({'count':_0xe218b0[_0x43fa('0x58')],'rows':_0xe218b0});});},'Telephones':function(_0x3f4839){return new Promise(function(_0x268cb2,_0x563487){var _0x3a3771=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7b')]);_0x268cb2({'count':_0x3a3771['length'],'rows':_0x3a3771});});},'Trunks':function(_0x10123f){return new Promise(function(_0x457006,_0x461abd){var _0x5272eb=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7c')]);_0x457006({'count':_0x5272eb['length'],'rows':_0x5272eb});});},'OutboundChannels':function(_0x733caf){return new Promise(function(_0x941b71,_0xb7fb97){var _0x50a4a9=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7d')]);_0x941b71({'count':_0x50a4a9[_0x43fa('0x58')],'rows':_0x50a4a9});});},'Outbound':function(_0x1d033b){return new Promise(function(_0x2ee768,_0xb7474f){_0x2ee768(_0x41ded6['outbound']);});},'Campaigns':function(_0x179678){return new Promise(function(_0x1e2e8e,_0x302f7c){var _0x1f7593=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x7e')]);_0x1e2e8e({'count':_0x1f7593[_0x43fa('0x58')],'rows':_0x1f7593});});},'VoiceQueuesPreview':function(_0x2a56a9){var _0x59cda3=this;return new Promise(function(_0x5a615c,_0x1c881d){_0x4cd7ec[_0x43fa('0x7f')](_0x2a56a9['id'])[_0x43fa('0x16')](function(_0x1f1dd0){_0x5a615c({'code':0xc8,'message':_0x1f1dd0['message']});})[_0x43fa('0x17')](function(_0x374039){_0x1c881d(_0x59cda3['error'](0x1f4,_0x374039[_0x43fa('0x19')]));});});},'EventManager':function(_0x1f240a){var _0x3c2c3c=this;return new Promise(function(_0x1f5df6,_0x187b74){if(!_0x1f240a['event']){return _0x187b74(_0x3c2c3c[_0x43fa('0x18')](0x1f4,_0x43fa('0x80')));}ami[_0x43fa('0x81')](_0x43fa('0x82')+_0x1f240a[_0x43fa('0x83')],_0x1f240a[_0x43fa('0x19')]);_0x1f5df6({'code':0xc8,'message':_0x1f240a});});},'FaxAccounts':function(_0x303923){return new Promise(function(_0xac5e4f,_0x121f31){var _0x5af6e3=_[_0x43fa('0x5b')](_0x41ded6[_0x43fa('0x84')]);_0xac5e4f({'count':_0x5af6e3[_0x43fa('0x58')],'rows':_0x5af6e3});});},'SendFax':function(_0x3ef055){var _0x15230c=this;return new Promise(function(_0x3480c6,_0x1d4217){_0x2c7789['send'](_0x3ef055)[_0x43fa('0x16')](function(_0x5250b4){_0x3480c6({'code':0xc8,'message':_0x5250b4[_0x43fa('0x19')]});})[_0x43fa('0x17')](function(_0x484c73){_0x1d4217(_0x15230c['error'](0x1f4,_0x484c73[_0x43fa('0x19')]));});});},'CheckAfterSend':function(_0x12a889){var _0x30a504=this;return new Promise(function(_0x262aee,_0x131afb){_0x2c7789[_0x43fa('0x85')](_0x12a889)[_0x43fa('0x16')](function(_0xdec4bc){_0x262aee({'code':0xc8,'message':_0xdec4bc['message']});})[_0x43fa('0x17')](function(_0x1c41a1){_0x131afb(_0x30a504[_0x43fa('0x18')](0x1f4,_0x1c41a1[_0x43fa('0x19')]));});});}};var _0x377a73=jayson[_0x43fa('0x86')](_0x584209)['http']();_0x377a73['on']('error',function(_0x5c75b0){return _0x6df71c(_0x5c75b0);});_0x377a73[_0x43fa('0x6')](0x232a,_0x43fa('0x87'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1e53b3('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index abb1e89..dc2a499 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf62e=['data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','isNil','firstName','calleridname','<unknown>','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','format','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/environment','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data1','xmd-contactid','ListId'];(function(_0x3af6d2,_0xeeee2){var _0x453b5e=function(_0x23761f){while(--_0x23761f){_0x3af6d2['push'](_0x3af6d2['shift']());}};_0x453b5e(++_0xeeee2);}(_0xf62e,0x163));var _0xef62=function(_0x2ca6d0,_0x5093e2){_0x2ca6d0=_0x2ca6d0-0x0;var _0x48952a=_0xf62e[_0x2ca6d0];return _0x48952a;};'use strict';var _=require(_0xef62('0x0'));var BPromise=require(_0xef62('0x1'));var Redis=require(_0xef62('0x2'));var util=require('util');var config=require(_0xef62('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0xef62('0x4'));config[_0xef62('0x5')]=_[_0xef62('0x6')](config['redis'],{'host':_0xef62('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xef62('0x5')]));function emit(_0x3d1d8f,_0x135f68,_0x3274b7,_0x2cba77,_0x33b2ea){logger[_0xef62('0x8')](_0xef62('0x9'),_0x3d1d8f,_0x135f68['id'],_0x3274b7,_0x2cba77,JSON[_0xef62('0xa')](_0x33b2ea));io['to'](_0x3274b7)[_0xef62('0xb')](_0x2cba77,_0x33b2ea);}exports[_0xef62('0xc')]=function(_0x1d71fb,_0x33c4e3,_0x525519,_0x1ef0dd){var _0x5c0a5a,_0x1c313c;var _0x11e2e7={};var _0x38a906=Number(_0x525519[_0xef62('0xd')]);var _0x5008f1=_0x525519['data2']?Boolean(Number(_0x525519['data2'])):![];var _0x4e17ad;if(_0x1ef0dd[_0xef62('0xe')]){_0x11e2e7['id']=_0x1ef0dd[_0xef62('0xe')];}if(!_0x11e2e7['id']){_0x11e2e7[_0xef62('0xf')]=_0x38a906;_0x4e17ad=_0x525519[_0xef62('0x10')]&&_0x525519[_0xef62('0x10')]!=='0'?_0x525519[_0xef62('0x10')][_0xef62('0x11')](','):[_0xef62('0x12')];_0x11e2e7[_0xef62('0x13')]=_[_0xef62('0x14')](_0x4e17ad,function(_0x5b7b2c){var _0x1f7918={};_0x1f7918[_0x5b7b2c]=_0x1ef0dd[_0xef62('0x15')]?_0x1ef0dd[_0xef62('0x16')]:_0x1ef0dd[_0xef62('0x17')];return _0x1f7918;});}var _0x46a33a=['id','firstName','lastName',_0xef62('0x12'),_0xef62('0x18'),_0xef62('0x19'),_0xef62('0xf'),_0xef62('0x1a'),_0xef62('0x1b'),_0xef62('0x1c')];var _0x51116b=_[_0xef62('0x1d')](_0x46a33a,_0x4e17ad);BPromise[_0xef62('0x1e')]()[_0xef62('0x1f')](cmContactRpc['getContacts']({'attributes':_0x51116b,'where':_0x11e2e7}))['then'](function(_0x30c987){_0x1c313c=_0x30c987;if(!_[_0xef62('0x20')](_0x1c313c)){if(_0x1c313c[_0xef62('0x21')]===0x1){_0x5c0a5a=_0x1c313c[0x0];logger['info'](_0xef62('0x22'),_0x1ef0dd[_0xef62('0x23')],_0x33c4e3['id'],_0x5c0a5a['id']);}else{logger[_0xef62('0x8')](_0xef62('0x24'),_0x1ef0dd[_0xef62('0x23')],_0x33c4e3['id'],_[_0xef62('0x14')](_0x1c313c,'id')[_0xef62('0x25')](','));}return;}else{logger[_0xef62('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x1ef0dd[_0xef62('0x23')],_0x33c4e3['id']);var _0x40ad1a={'ListId':_0x38a906};var _0x2f05d2=_0x525519[_0xef62('0x26')]&&_0x525519['data4']!=='0'?_0x525519[_0xef62('0x26')]:_0xef62('0x12');if(_0x5008f1){logger[_0xef62('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1ef0dd['uniqueid'],_0x33c4e3['id']);_0x40ad1a[_0x2f05d2]=_[_0xef62('0x27')](_0x1ef0dd['routeId'])?_0x1ef0dd[_0xef62('0x17')]:_0x1ef0dd[_0xef62('0x16')];if(_[_0xef62('0x27')](_0x1ef0dd[_0xef62('0x15')])){_0x40ad1a[_0xef62('0x28')]=_0x1ef0dd[_0xef62('0x29')]&&_0x1ef0dd[_0xef62('0x29')]!==_0xef62('0x2a')?_0x1ef0dd[_0xef62('0x29')]:_0xef62('0x2b');}else{_0x40ad1a[_0xef62('0x28')]=_0x1ef0dd[_0xef62('0x2c')]&&_0x1ef0dd[_0xef62('0x2c')]!==_0xef62('0x2a')?_0x1ef0dd[_0xef62('0x2c')]:_0xef62('0x2b');}return BPromise[_0xef62('0x1e')]()[_0xef62('0x1f')](cmContactRpc[_0xef62('0x2d')](_0x40ad1a))[_0xef62('0x1f')](function(_0x3b2ed5){_0x5c0a5a=_0x3b2ed5;_0x1c313c['push'](_0x3b2ed5);if(_0x5c0a5a){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x1ef0dd['uniqueid'],_0x33c4e3['id'],_0x5c0a5a['id']);}return;});}else{logger[_0xef62('0x8')](_0xef62('0x2e'),_0x1ef0dd[_0xef62('0x23')],_0x33c4e3['id']);_0x40ad1a[_0x2f05d2]=_[_0xef62('0x27')](_0x1ef0dd['routeId'])?_0x1ef0dd[_0xef62('0x17')]:_0x1ef0dd[_0xef62('0x16')];if(_[_0xef62('0x27')](_0x1ef0dd[_0xef62('0x15')])){_0x40ad1a[_0xef62('0x28')]=_0x1ef0dd['calleridname']&&_0x1ef0dd[_0xef62('0x29')]!==_0xef62('0x2a')?_0x1ef0dd[_0xef62('0x29')]:_0xef62('0x2b');}else{_0x40ad1a[_0xef62('0x28')]=_0x1ef0dd[_0xef62('0x2c')]&&_0x1ef0dd['destcalleridname']!==_0xef62('0x2a')?_0x1ef0dd[_0xef62('0x2c')]:'Unknown';}_0x5c0a5a=_0x40ad1a;_0x1c313c[_0xef62('0x2f')](_0x40ad1a);return;}}})[_0xef62('0x1f')](function(){if(_0x1d71fb){emit(_0x1ef0dd[_0xef62('0x23')],_0x33c4e3,util['format'](_0xef62('0x30'),_0x1d71fb['name']),util[_0xef62('0x31')]('trigger:%s',_0x525519[_0xef62('0x32')][_0xef62('0x33')]()),{'evt':_[_0xef62('0x34')](_0x1ef0dd,{'autoCreate':_0x5008f1}),'contact':_0x5c0a5a===undefined?{}:_0x5c0a5a,'contacts':_0x1c313c[_0xef62('0x21')]===0x0?undefined:_0x1c313c});}});};
\ No newline at end of file
+var _0x3d86=['../../../../config/logger','trigger','../../rpc/cmContact','redis','info','[CM][%s][%s]','stringify','data1','data2','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','<unknown>','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','format','trigger:%s','action','merge','bluebird','ioredis','util','../../../../config/environment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x3d86,0x16f));var _0x63d8=function(_0x53f0ac,_0x564425){_0x53f0ac=_0x53f0ac-0x0;var _0x1a8b12=_0x3d86[_0x53f0ac];return _0x1a8b12;};'use strict';var _=require('lodash');var BPromise=require(_0x63d8('0x0'));var Redis=require(_0x63d8('0x1'));var util=require(_0x63d8('0x2'));var config=require(_0x63d8('0x3'));var logger=require(_0x63d8('0x4'))(_0x63d8('0x5'));var cmContactRpc=require(_0x63d8('0x6'));config[_0x63d8('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x35371a,_0x2e8cdf,_0x31c479,_0x24fd12,_0x4d06ad){logger[_0x63d8('0x8')](_0x63d8('0x9'),_0x35371a,_0x2e8cdf['id'],_0x31c479,_0x24fd12,JSON[_0x63d8('0xa')](_0x4d06ad));io['to'](_0x31c479)['emit'](_0x24fd12,_0x4d06ad);}exports['exec']=function(_0x273c15,_0x2cf164,_0xf321a5,_0x4a8ada){var _0x14316a,_0x4d9b03;var _0x30cf03={};var _0x2c8964=Number(_0xf321a5[_0x63d8('0xb')]);var _0x116db1=_0xf321a5[_0x63d8('0xc')]?Boolean(Number(_0xf321a5['data2'])):![];var _0x461aa3;if(_0x4a8ada[_0x63d8('0xd')]){_0x30cf03['id']=_0x4a8ada[_0x63d8('0xd')];}if(!_0x30cf03['id']){_0x30cf03[_0x63d8('0xe')]=_0x2c8964;_0x461aa3=_0xf321a5[_0x63d8('0xf')]&&_0xf321a5[_0x63d8('0xf')]!=='0'?_0xf321a5[_0x63d8('0xf')][_0x63d8('0x10')](','):['phone'];_0x30cf03[_0x63d8('0x11')]=_[_0x63d8('0x12')](_0x461aa3,function(_0x5d46d1){var _0x5a9ba0={};_0x5a9ba0[_0x5d46d1]=_0x4a8ada[_0x63d8('0x13')]?_0x4a8ada[_0x63d8('0x14')]:_0x4a8ada[_0x63d8('0x15')];return _0x5a9ba0;});}var _0x353779=['id',_0x63d8('0x16'),_0x63d8('0x17'),_0x63d8('0x18'),'mobile',_0x63d8('0x19'),_0x63d8('0xe'),'createdAt',_0x63d8('0x1a'),_0x63d8('0x1b')];var _0x22083e=_[_0x63d8('0x1c')](_0x353779,_0x461aa3);BPromise['resolve']()[_0x63d8('0x1d')](cmContactRpc[_0x63d8('0x1e')]({'attributes':_0x22083e,'where':_0x30cf03}))[_0x63d8('0x1d')](function(_0x29d581){_0x4d9b03=_0x29d581;if(!_[_0x63d8('0x1f')](_0x4d9b03)){if(_0x4d9b03[_0x63d8('0x20')]===0x1){_0x14316a=_0x4d9b03[0x0];logger[_0x63d8('0x8')](_0x63d8('0x21'),_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id'],_0x14316a['id']);}else{logger[_0x63d8('0x8')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id'],_[_0x63d8('0x12')](_0x4d9b03,'id')[_0x63d8('0x23')](','));}return;}else{logger[_0x63d8('0x8')](_0x63d8('0x24'),_0x4a8ada['uniqueid'],_0x2cf164['id']);var _0x263122={'ListId':_0x2c8964};var _0xd3da65=_0xf321a5[_0x63d8('0x25')]&&_0xf321a5[_0x63d8('0x25')]!=='0'?_0xf321a5[_0x63d8('0x25')]:_0x63d8('0x18');if(_0x116db1){logger[_0x63d8('0x8')](_0x63d8('0x26'),_0x4a8ada['uniqueid'],_0x2cf164['id']);_0x263122[_0xd3da65]=_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])?_0x4a8ada[_0x63d8('0x15')]:_0x4a8ada['destcalleridnum'];if(_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])){_0x263122[_0x63d8('0x16')]=_0x4a8ada[_0x63d8('0x28')]&&_0x4a8ada[_0x63d8('0x28')]!=='<unknown>'?_0x4a8ada[_0x63d8('0x28')]:_0x63d8('0x29');}else{_0x263122[_0x63d8('0x16')]=_0x4a8ada[_0x63d8('0x2a')]&&_0x4a8ada['destcalleridname']!==_0x63d8('0x2b')?_0x4a8ada[_0x63d8('0x2a')]:'Unknown';}return BPromise['resolve']()[_0x63d8('0x1d')](cmContactRpc[_0x63d8('0x2c')](_0x263122))[_0x63d8('0x1d')](function(_0x3068b3){_0x14316a=_0x3068b3;_0x4d9b03['push'](_0x3068b3);if(_0x14316a){logger[_0x63d8('0x8')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id'],_0x14316a['id']);}return;});}else{logger[_0x63d8('0x8')](_0x63d8('0x2d'),_0x4a8ada[_0x63d8('0x22')],_0x2cf164['id']);_0x263122[_0xd3da65]=_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])?_0x4a8ada[_0x63d8('0x15')]:_0x4a8ada[_0x63d8('0x14')];if(_[_0x63d8('0x27')](_0x4a8ada[_0x63d8('0x13')])){_0x263122[_0x63d8('0x16')]=_0x4a8ada['calleridname']&&_0x4a8ada[_0x63d8('0x28')]!==_0x63d8('0x2b')?_0x4a8ada[_0x63d8('0x28')]:_0x63d8('0x29');}else{_0x263122[_0x63d8('0x16')]=_0x4a8ada['destcalleridname']&&_0x4a8ada[_0x63d8('0x2a')]!==_0x63d8('0x2b')?_0x4a8ada[_0x63d8('0x2a')]:_0x63d8('0x29');}_0x14316a=_0x263122;_0x4d9b03[_0x63d8('0x2e')](_0x263122);return;}}})['then'](function(){if(_0x273c15){emit(_0x4a8ada[_0x63d8('0x22')],_0x2cf164,util['format'](_0x63d8('0x2f'),_0x273c15[_0x63d8('0x30')]),util[_0x63d8('0x31')](_0x63d8('0x32'),_0xf321a5[_0x63d8('0x33')]['toLowerCase']()),{'evt':_[_0x63d8('0x34')](_0x4a8ada,{'autoCreate':_0x116db1}),'contact':_0x14316a===undefined?{}:_0x14316a,'contacts':_0x4d9b03[_0x63d8('0x20')]===0x0?undefined:_0x4d9b03});}});};
\ No newline at end of file
index 6fd940f..62a86b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca89=['exec','accounts','queue','urlforward','query','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','agent','membername','lastevent','routeId','url','mustache','./urlforward','./integration','./script','../../../config/environment','../ami','redis','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','prototype','checkTriggers','interface','hasOwnProperty','status','checkTrigger','variables','length','Actions','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','name','merge','jscripty','trigger:%s','user:%s','action'];(function(_0x22e2e1,_0x486ab3){var _0x365461=function(_0x1f9594){while(--_0x1f9594){_0x22e2e1['push'](_0x22e2e1['shift']());}};_0x365461(++_0x486ab3);}(_0xca89,0x1e2));var _0x9ca8=function(_0x544f61,_0x94f22c){_0x544f61=_0x544f61-0x0;var _0x26027c=_0xca89[_0x544f61];return _0x26027c;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0x9ca8('0x0'));var Mustache=require(_0x9ca8('0x1'));var Redis=require('ioredis');var urlforward=require(_0x9ca8('0x2'));var integration=require(_0x9ca8('0x3'));var cmContact=require('./cmContact');var script=require(_0x9ca8('0x4'));var config=require(_0x9ca8('0x5'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x9ca8('0x6'));config[_0x9ca8('0x7')]=_['defaults'](config[_0x9ca8('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9ca8('0x8'))(new Redis(config[_0x9ca8('0x7')]));var operators={'equals':function(_0x14c570,_0x5f52c0){return _0x14c570==_0x5f52c0;},'not_equals':function(_0x23ae29,_0x1d0abf){return _0x23ae29!=_0x1d0abf;}};var barAndWebActions=[_0x9ca8('0x9'),_0x9ca8('0x0'),_0x9ca8('0xa')];function Trigger(_0x3615ab){this[_0x9ca8('0xb')]=_0x3615ab[_0x9ca8('0xb')];this['agents']=_0x3615ab[_0x9ca8('0xc')];this[_0x9ca8('0xd')]=_0x3615ab['voiceQueues'];this[_0x9ca8('0xe')]=_0x3615ab[_0x9ca8('0xe')];this[_0x9ca8('0xf')]=_0x3615ab[_0x9ca8('0xf')];this['zendeskAccounts']=_0x3615ab[_0x9ca8('0x10')];this[_0x9ca8('0x11')]=_0x3615ab[_0x9ca8('0x11')];this[_0x9ca8('0x12')]=_0x3615ab[_0x9ca8('0x12')];this[_0x9ca8('0x13')]=_0x3615ab[_0x9ca8('0x13')];this[_0x9ca8('0x14')]=_0x3615ab['zohoAccounts'];this[_0x9ca8('0x15')]=_0x3615ab[_0x9ca8('0x15')];this[_0x9ca8('0x16')]=_0x3615ab[_0x9ca8('0x16')];this[_0x9ca8('0x17')]=_0x3615ab['servicenowAccounts'];this[_0x9ca8('0x18')]=_0x3615ab[_0x9ca8('0x18')];this[_0x9ca8('0x19')]=_0x3615ab[_0x9ca8('0x19')];this['accounts']={'zendesk':this[_0x9ca8('0x10')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x9ca8('0x11')],'sugarcrm':this[_0x9ca8('0x13')],'zoho':this[_0x9ca8('0x14')],'desk':this[_0x9ca8('0x15')],'vtiger':this[_0x9ca8('0x16')],'dynamics365':this[_0x9ca8('0x18')],'freshsales':this[_0x9ca8('0x19')],'servicenow':this[_0x9ca8('0x17')]};ami['on'](_0x9ca8('0x1a'),this['syncCustomEvent'][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x1c'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x1e'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x1f'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x20'),this[_0x9ca8('0x1d')]['bind'](this));ami['on'](_0x9ca8('0x21'),this[_0x9ca8('0x1d')]['bind'](this));ami['on']('custom:agentcongestion',this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x22'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x23'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x9ca8('0x1b')](this));ami['on']('custom:timeout',this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x24'),this[_0x9ca8('0x25')]['bind'](this));ami['on'](_0x9ca8('0x26'),this[_0x9ca8('0x25')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x27'),this[_0x9ca8('0x25')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x28'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x29'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x2a'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x2b'),this[_0x9ca8('0x1d')][_0x9ca8('0x1b')](this));ami['on'](_0x9ca8('0x2c'),this['syncCustomEvent'][_0x9ca8('0x1b')](this));}Trigger['prototype'][_0x9ca8('0x2d')]=function(_0x5e07b3,_0x5a9b0c,_0x1eb8fd){logger[_0x9ca8('0x2e')](_0x5e07b3,_0x5a9b0c,JSON[_0x9ca8('0x2f')](_0x1eb8fd));io['to'](_0x5e07b3)[_0x9ca8('0x2d')](_0x5a9b0c,_0x1eb8fd);};Trigger[_0x9ca8('0x30')][_0x9ca8('0x1d')]=function(_0x249203){var _0x5d2772=_['clone'](_0x249203);this[_0x9ca8('0x31')](_0x5d2772);};Trigger[_0x9ca8('0x30')]['syncAgentDial']=function(_0x2ef76f){if(this[_0x9ca8('0xc')][_0x2ef76f[_0x9ca8('0x32')]]){this[_0x9ca8('0x1d')](_0x2ef76f);}};Trigger['prototype'][_0x9ca8('0x31')]=function(_0x59c8ef){var _0x34fc6f;for(var _0x45b71e in this[_0x9ca8('0xb')]){if(this['triggers'][_0x9ca8('0x33')](_0x45b71e)){if(this[_0x9ca8('0xb')][_0x45b71e][_0x9ca8('0x34')]){_0x34fc6f=this[_0x9ca8('0x35')](this['triggers'][_0x45b71e],_0x59c8ef);if(_0x34fc6f){_['merge'](_0x59c8ef,_0x59c8ef[_0x9ca8('0x36')]);for(var _0x30429e=0x0,_0x420be9,_0xebb21d,_0x3e3ad3;_0x30429e<this[_0x9ca8('0xb')][_0x45b71e]['Actions'][_0x9ca8('0x37')];_0x30429e+=0x1){_0x420be9=this[_0x9ca8('0xb')][_0x45b71e][_0x9ca8('0x38')][_0x30429e];if(this[_0x9ca8('0xc')][_0x59c8ef[_0x9ca8('0x32')]]){switch(_0x420be9['action'][_0x9ca8('0x39')]()){case _0x9ca8('0x3a'):break;case _0x9ca8('0x3b'):case _0x9ca8('0x3c'):var _0x380c27={};switch(barAndWebActions[_0x420be9[_0x9ca8('0x3d')]]){case _0x9ca8('0x9'):_0x380c27[_0x9ca8('0x3e')]=_0x420be9['data2'];_0x380c27[_0x9ca8('0x3f')]=this[_0x9ca8('0xe')][_0x420be9[_0x9ca8('0x40')]]?Mustache[_0x9ca8('0x41')](this[_0x9ca8('0xe')][_0x420be9[_0x9ca8('0x40')]][_0x9ca8('0x3f')],_0x59c8ef):_0x9ca8('0x42');break;case _0x9ca8('0x0'):_0x380c27[_0x9ca8('0x43')]=this[_0x9ca8('0x44')](_0x420be9['data2'],_0x59c8ef,_[_0x9ca8('0x45')](_0x420be9[_0x9ca8('0x46')])?!![]:parseInt(_0x420be9[_0x9ca8('0x46')],0xa));if(_[_0x9ca8('0x45')](_0x420be9['data4'])){_0x380c27[_0x9ca8('0x47')]='0';}else{_0x380c27['uriLocation']=_0x420be9[_0x9ca8('0x48')];_0x380c27[_0x9ca8('0x49')]=_[_0x9ca8('0x45')](_0x420be9[_0x9ca8('0x4a')])?_0x9ca8('0x4b'):_0x420be9[_0x9ca8('0x4a')];_0x380c27[_0x9ca8('0x4c')]=_[_0x9ca8('0x45')](_0x420be9[_0x9ca8('0x4d')])?_0x9ca8('0x4e'):_0x420be9[_0x9ca8('0x4d')];}break;case _0x9ca8('0xa'):_0x380c27[_0x9ca8('0x4f')]=_0x420be9['data2']?Mustache[_0x9ca8('0x41')](_0x420be9[_0x9ca8('0x40')],_0x59c8ef):'';_0x380c27[_0x9ca8('0x50')]=_0x420be9[_0x9ca8('0x46')]?Mustache['render'](_0x420be9[_0x9ca8('0x46')],_0x59c8ef):'';break;}this[_0x9ca8('0x2d')](util[_0x9ca8('0x51')]('user:%s',this['agents'][_0x59c8ef['interface']][_0x9ca8('0x52')]),util[_0x9ca8('0x51')]('trigger:%s:%s',_0x420be9['action'][_0x9ca8('0x39')](),barAndWebActions[_0x420be9[_0x9ca8('0x3d')]]),_[_0x9ca8('0x53')](_0x380c27,_0x59c8ef));break;case _0x9ca8('0x54'):this[_0x9ca8('0x2d')](util[_0x9ca8('0x51')]('user:%s',this['agents'][_0x59c8ef['interface']]['name']),util[_0x9ca8('0x51')](_0x9ca8('0x55'),_0x420be9['action'][_0x9ca8('0x39')]()),_[_0x9ca8('0x53')]({'ProjectId':parseInt(_0x420be9[_0x9ca8('0x3d')],0xa)},_0x59c8ef));break;default:this['emit'](util['format'](_0x9ca8('0x56'),this[_0x9ca8('0xc')][_0x59c8ef[_0x9ca8('0x32')]][_0x9ca8('0x52')]),util['format'](_0x9ca8('0x55'),_0x420be9[_0x9ca8('0x57')][_0x9ca8('0x39')]()),_[_0x9ca8('0x53')]({},_0x420be9,_0x59c8ef));}}switch(_0x420be9[_0x9ca8('0x57')][_0x9ca8('0x39')]()){case _0x9ca8('0x3a'):cmContact['exec'](this['agents'][_0x59c8ef[_0x9ca8('0x32')]],this[_0x9ca8('0xb')][_0x45b71e],_0x420be9,_0x59c8ef);break;case'integration':integration[_0x9ca8('0x58')](_0x420be9,_0x59c8ef,this[_0x9ca8('0x59')],this['agents'][_0x59c8ef[_0x9ca8('0x32')]],this[_0x9ca8('0xd')][_0x59c8ef[_0x9ca8('0x5a')]],this['voiceExtensions'][_0x59c8ef['routeId']]);break;case _0x9ca8('0x5b'):urlforward[_0x9ca8('0x58')](_0x420be9,_0x59c8ef);break;case'script':script[_0x9ca8('0x58')](_0x420be9,_0x59c8ef);break;}}}}}}};Trigger[_0x9ca8('0x30')]['buildUri']=function(_0x4a00cd,_0x57b5f0,_0x1c80ed){var _0x5c335a=url['parse'](Mustache['render'](_0x4a00cd,_0x57b5f0),!![]);if(_0x1c80ed){_[_0x9ca8('0x53')](_0x5c335a[_0x9ca8('0x5c')],_0x57b5f0);}delete _0x5c335a['search'];var _0x334213=url['format'](_0x5c335a);_0x334213=_0x334213[_0x9ca8('0x5d')](/\/\?/g,'?');return _0x334213;};Trigger[_0x9ca8('0x30')]['checkTrigger']=function(_0x2d3eb5,_0x4a7e0f){var _0xac7cd3=!![],_0x13a32f=!![];if(_0x2d3eb5[_0x9ca8('0x5e')][_0x9ca8('0x37')]){_0xac7cd3=_[_0x9ca8('0x5f')](_0x2d3eb5['AllConditions'],this[_0x9ca8('0x60')](_0x4a7e0f,_0x2d3eb5[_0x9ca8('0x61')]));}if(_0x2d3eb5[_0x9ca8('0x62')][_0x9ca8('0x37')]){_0x13a32f=_[_0x9ca8('0x63')](_0x2d3eb5[_0x9ca8('0x62')],this[_0x9ca8('0x60')](_0x4a7e0f,_0x2d3eb5[_0x9ca8('0x61')]));}return _0xac7cd3&&_0x13a32f;};Trigger[_0x9ca8('0x30')]['checkConditions']=function(_0x37fd81,_0x922918){return function(_0x1487db){switch(_0x1487db[_0x9ca8('0x64')]){case _0x9ca8('0x65'):if(_0x37fd81[_0x9ca8('0x61')]===_0x922918){if(_0x922918===_0x9ca8('0x66')){return _0x37fd81[_0x9ca8('0x67')]?operators[_0x1487db[_0x9ca8('0x68')]](Number(_0x1487db[_0x9ca8('0x69')]),_0x37fd81['ChatWebsiteId']):![];}else{return _0x37fd81[_[_0x9ca8('0x6a')](_0x922918)+_0x9ca8('0x6b')]?operators[_0x1487db[_0x9ca8('0x68')]](Number(_0x1487db[_0x9ca8('0x69')]),_0x37fd81[_[_0x9ca8('0x6a')](_0x922918)+_0x9ca8('0x6b')]):![];}}break;case _0x9ca8('0x6c'):case'message':if(_0x37fd81['channel']===_0x922918){return _0x37fd81[_0x9ca8('0x6d')]?operators[_0x1487db[_0x9ca8('0x68')]](_0x1487db[_0x9ca8('0x69')],_0x37fd81[_0x9ca8('0x6d')]):![];}break;case _0x9ca8('0x5a'):return _0x37fd81[_0x9ca8('0x5a')]?operators[_0x1487db['operator']](_0x1487db[_0x9ca8('0x69')],_0x37fd81['queue']):![];case _0x9ca8('0x6e'):return _0x37fd81['membername']?operators[_0x1487db[_0x9ca8('0x68')]](_0x1487db['value'],_0x37fd81[_0x9ca8('0x6f')]):![];case'lastevent':return _0x37fd81[_0x9ca8('0x70')]?operators[_0x1487db[_0x9ca8('0x68')]](_0x1487db[_0x9ca8('0x69')],_0x37fd81[_0x9ca8('0x70')]):![];case _0x9ca8('0x71'):return _0x37fd81[_0x9ca8('0x71')]?operators[_0x1487db[_0x9ca8('0x68')]](_0x1487db['value'],_0x37fd81[_0x9ca8('0x71')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x6c37=['freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','data3','isNil','data4','location','windowWidth','data5','800','windowHeight','data6','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','toLowerCase','jscripty','trigger:%s','exec','integration','queue','urlforward','parse','query','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','upperFirst','AccountId','value','interaction','message','event','operator','membername','lastevent','routeId','util','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../ami','defaults','localhost','socket.io-emitter','redis','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts'];(function(_0x3403bd,_0x2231f2){var _0x5941f8=function(_0x4140c0){while(--_0x4140c0){_0x3403bd['push'](_0x3403bd['shift']());}};_0x5941f8(++_0x2231f2);}(_0x6c37,0x1c9));var _0x76c3=function(_0x573895,_0x5cbeec){_0x573895=_0x573895-0x0;var _0x4f67cb=_0x6c37[_0x573895];return _0x4f67cb;};'use strict';var util=require(_0x76c3('0x0'));var _=require(_0x76c3('0x1'));var url=require(_0x76c3('0x2'));var Mustache=require('mustache');var Redis=require(_0x76c3('0x3'));var urlforward=require(_0x76c3('0x4'));var integration=require('./integration');var cmContact=require(_0x76c3('0x5'));var script=require(_0x76c3('0x6'));var config=require(_0x76c3('0x7'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x76c3('0x8'));config['redis']=_[_0x76c3('0x9')](config['redis'],{'host':_0x76c3('0xa'),'port':0x18eb});var io=require(_0x76c3('0xb'))(new Redis(config[_0x76c3('0xc')]));var operators={'equals':function(_0x7fd1a9,_0x54fd23){return _0x7fd1a9==_0x54fd23;},'not_equals':function(_0x31611b,_0x4d3159){return _0x31611b!=_0x4d3159;}};var barAndWebActions=['popup',_0x76c3('0x2'),'winapp'];function Trigger(_0x2674ab){this[_0x76c3('0xd')]=_0x2674ab[_0x76c3('0xd')];this[_0x76c3('0xe')]=_0x2674ab[_0x76c3('0xe')];this[_0x76c3('0xf')]=_0x2674ab['voiceQueues'];this['templates']=_0x2674ab[_0x76c3('0x10')];this[_0x76c3('0x11')]=_0x2674ab[_0x76c3('0x11')];this[_0x76c3('0x12')]=_0x2674ab['zendeskAccounts'];this['freshdeskAccounts']=_0x2674ab[_0x76c3('0x13')];this[_0x76c3('0x14')]=_0x2674ab[_0x76c3('0x14')];this[_0x76c3('0x15')]=_0x2674ab[_0x76c3('0x15')];this['zohoAccounts']=_0x2674ab['zohoAccounts'];this['deskAccounts']=_0x2674ab[_0x76c3('0x16')];this[_0x76c3('0x17')]=_0x2674ab['vtigerAccounts'];this[_0x76c3('0x18')]=_0x2674ab[_0x76c3('0x18')];this[_0x76c3('0x19')]=_0x2674ab[_0x76c3('0x19')];this['freshsalesAccounts']=_0x2674ab[_0x76c3('0x1a')];this[_0x76c3('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x76c3('0x14')],'freshdesk':this[_0x76c3('0x13')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x76c3('0x1c')],'desk':this[_0x76c3('0x16')],'vtiger':this[_0x76c3('0x17')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x76c3('0x1a')],'servicenow':this[_0x76c3('0x18')]};ami['on'](_0x76c3('0x1d'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x76c3('0x21'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x22'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x23'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x24'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent']['bind'](this));ami['on'](_0x76c3('0x25'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x26'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x27'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on']('custom:timeout',this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x28'),this[_0x76c3('0x29')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2a'),this[_0x76c3('0x29')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2b'),this[_0x76c3('0x29')]['bind'](this));ami['on'](_0x76c3('0x2c'),this['syncCustomEvent'][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2d'),this[_0x76c3('0x1e')][_0x76c3('0x1f')](this));ami['on'](_0x76c3('0x2e'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x2f'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x30'),this[_0x76c3('0x1e')]['bind'](this));ami['on'](_0x76c3('0x31'),this['syncCustomEvent'][_0x76c3('0x1f')](this));}Trigger[_0x76c3('0x32')][_0x76c3('0x33')]=function(_0x552c28,_0x3c91b0,_0x2c96ae){logger['info'](_0x552c28,_0x3c91b0,JSON[_0x76c3('0x34')](_0x2c96ae));io['to'](_0x552c28)[_0x76c3('0x33')](_0x3c91b0,_0x2c96ae);};Trigger['prototype'][_0x76c3('0x1e')]=function(_0x34bbbb){var _0x3108f2=_[_0x76c3('0x35')](_0x34bbbb);this[_0x76c3('0x36')](_0x3108f2);};Trigger[_0x76c3('0x32')][_0x76c3('0x29')]=function(_0x319ee3){if(this[_0x76c3('0xe')][_0x319ee3[_0x76c3('0x37')]]){this[_0x76c3('0x1e')](_0x319ee3);}};Trigger[_0x76c3('0x32')][_0x76c3('0x36')]=function(_0x32bb40){var _0x23f7dd;for(var _0x3c6a89 in this[_0x76c3('0xd')]){if(this[_0x76c3('0xd')][_0x76c3('0x38')](_0x3c6a89)){if(this['triggers'][_0x3c6a89]['status']){_0x23f7dd=this[_0x76c3('0x39')](this[_0x76c3('0xd')][_0x3c6a89],_0x32bb40);if(_0x23f7dd){_[_0x76c3('0x3a')](_0x32bb40,_0x32bb40[_0x76c3('0x3b')]);for(var _0x44ad62=0x0,_0x35e4bf,_0x514580,_0xfba2f6;_0x44ad62<this[_0x76c3('0xd')][_0x3c6a89][_0x76c3('0x3c')][_0x76c3('0x3d')];_0x44ad62+=0x1){_0x35e4bf=this[_0x76c3('0xd')][_0x3c6a89][_0x76c3('0x3c')][_0x44ad62];if(this[_0x76c3('0xe')][_0x32bb40[_0x76c3('0x37')]]){switch(_0x35e4bf['action']['toLowerCase']()){case _0x76c3('0x3e'):break;case _0x76c3('0x3f'):case _0x76c3('0x40'):var _0x4d8bad={};switch(barAndWebActions[_0x35e4bf[_0x76c3('0x41')]]){case'popup':_0x4d8bad[_0x76c3('0x42')]=_0x35e4bf['data2'];_0x4d8bad[_0x76c3('0x43')]=this[_0x76c3('0x10')][_0x35e4bf[_0x76c3('0x44')]]?Mustache[_0x76c3('0x45')](this['templates'][_0x35e4bf[_0x76c3('0x44')]]['html'],_0x32bb40):_0x76c3('0x46');break;case _0x76c3('0x2'):_0x4d8bad[_0x76c3('0x47')]=this[_0x76c3('0x48')](_0x35e4bf['data2'],_0x32bb40,_['isNil'](_0x35e4bf[_0x76c3('0x49')])?!![]:parseInt(_0x35e4bf['data3'],0xa));if(_[_0x76c3('0x4a')](_0x35e4bf[_0x76c3('0x4b')])){_0x4d8bad[_0x76c3('0x4c')]='0';}else{_0x4d8bad['uriLocation']=_0x35e4bf['data4'];_0x4d8bad[_0x76c3('0x4d')]=_['isNil'](_0x35e4bf[_0x76c3('0x4e')])?_0x76c3('0x4f'):_0x35e4bf[_0x76c3('0x4e')];_0x4d8bad[_0x76c3('0x50')]=_[_0x76c3('0x4a')](_0x35e4bf[_0x76c3('0x51')])?'600':_0x35e4bf['data6'];}break;case _0x76c3('0x52'):_0x4d8bad[_0x76c3('0x53')]=_0x35e4bf[_0x76c3('0x44')]?Mustache['render'](_0x35e4bf['data2'],_0x32bb40):'';_0x4d8bad[_0x76c3('0x54')]=_0x35e4bf[_0x76c3('0x49')]?Mustache[_0x76c3('0x45')](_0x35e4bf[_0x76c3('0x49')],_0x32bb40):'';break;}this['emit'](util[_0x76c3('0x55')](_0x76c3('0x56'),this[_0x76c3('0xe')][_0x32bb40[_0x76c3('0x37')]][_0x76c3('0x57')]),util[_0x76c3('0x55')](_0x76c3('0x58'),_0x35e4bf[_0x76c3('0x59')][_0x76c3('0x5a')](),barAndWebActions[_0x35e4bf[_0x76c3('0x41')]]),_['merge'](_0x4d8bad,_0x32bb40));break;case _0x76c3('0x5b'):this[_0x76c3('0x33')](util[_0x76c3('0x55')]('user:%s',this[_0x76c3('0xe')][_0x32bb40[_0x76c3('0x37')]][_0x76c3('0x57')]),util['format'](_0x76c3('0x5c'),_0x35e4bf[_0x76c3('0x59')][_0x76c3('0x5a')]()),_[_0x76c3('0x3a')]({'ProjectId':parseInt(_0x35e4bf[_0x76c3('0x41')],0xa)},_0x32bb40));break;default:this[_0x76c3('0x33')](util[_0x76c3('0x55')](_0x76c3('0x56'),this[_0x76c3('0xe')][_0x32bb40[_0x76c3('0x37')]][_0x76c3('0x57')]),util[_0x76c3('0x55')](_0x76c3('0x5c'),_0x35e4bf[_0x76c3('0x59')][_0x76c3('0x5a')]()),_[_0x76c3('0x3a')]({},_0x35e4bf,_0x32bb40));}}switch(_0x35e4bf[_0x76c3('0x59')][_0x76c3('0x5a')]()){case'contactmanager':cmContact[_0x76c3('0x5d')](this['agents'][_0x32bb40[_0x76c3('0x37')]],this['triggers'][_0x3c6a89],_0x35e4bf,_0x32bb40);break;case _0x76c3('0x5e'):integration[_0x76c3('0x5d')](_0x35e4bf,_0x32bb40,this[_0x76c3('0x1b')],this[_0x76c3('0xe')][_0x32bb40['interface']],this[_0x76c3('0xf')][_0x32bb40[_0x76c3('0x5f')]],this[_0x76c3('0x11')][_0x32bb40['routeId']]);break;case _0x76c3('0x60'):urlforward['exec'](_0x35e4bf,_0x32bb40);break;case'script':script[_0x76c3('0x5d')](_0x35e4bf,_0x32bb40);break;}}}}}}};Trigger[_0x76c3('0x32')][_0x76c3('0x48')]=function(_0x2514ab,_0x3265a2,_0x3302b6){var _0x1da1b0=url[_0x76c3('0x61')](Mustache[_0x76c3('0x45')](_0x2514ab,_0x3265a2),!![]);if(_0x3302b6){_['merge'](_0x1da1b0[_0x76c3('0x62')],_0x3265a2);}delete _0x1da1b0['search'];var _0xbf5882=url[_0x76c3('0x55')](_0x1da1b0);_0xbf5882=_0xbf5882[_0x76c3('0x63')](/\/\?/g,'?');return _0xbf5882;};Trigger[_0x76c3('0x32')][_0x76c3('0x39')]=function(_0x583c82,_0x52976a){var _0x2a0941=!![],_0x1a852a=!![];if(_0x583c82[_0x76c3('0x64')][_0x76c3('0x3d')]){_0x2a0941=_[_0x76c3('0x65')](_0x583c82['AllConditions'],this[_0x76c3('0x66')](_0x52976a,_0x583c82[_0x76c3('0x67')]));}if(_0x583c82[_0x76c3('0x68')]['length']){_0x1a852a=_[_0x76c3('0x69')](_0x583c82[_0x76c3('0x68')],this[_0x76c3('0x66')](_0x52976a,_0x583c82[_0x76c3('0x67')]));}return _0x2a0941&&_0x1a852a;};Trigger[_0x76c3('0x32')]['checkConditions']=function(_0x21206f,_0x22d1e3){return function(_0x2b959d){switch(_0x2b959d[_0x76c3('0x6a')]){case _0x76c3('0x6b'):if(_0x21206f[_0x76c3('0x67')]===_0x22d1e3){if(_0x22d1e3==='chat'){return _0x21206f['ChatWebsiteId']?operators[_0x2b959d['operator']](Number(_0x2b959d['value']),_0x21206f[_0x76c3('0x6c')]):![];}else{return _0x21206f[_[_0x76c3('0x6d')](_0x22d1e3)+_0x76c3('0x6e')]?operators[_0x2b959d['operator']](Number(_0x2b959d[_0x76c3('0x6f')]),_0x21206f[_['upperFirst'](_0x22d1e3)+_0x76c3('0x6e')]):![];}}break;case _0x76c3('0x70'):case _0x76c3('0x71'):if(_0x21206f[_0x76c3('0x67')]===_0x22d1e3){return _0x21206f[_0x76c3('0x72')]?operators[_0x2b959d[_0x76c3('0x73')]](_0x2b959d['value'],_0x21206f[_0x76c3('0x72')]):![];}break;case'queue':return _0x21206f['queue']?operators[_0x2b959d[_0x76c3('0x73')]](_0x2b959d[_0x76c3('0x6f')],_0x21206f[_0x76c3('0x5f')]):![];case'agent':return _0x21206f[_0x76c3('0x74')]?operators[_0x2b959d[_0x76c3('0x73')]](_0x2b959d[_0x76c3('0x6f')],_0x21206f[_0x76c3('0x74')]):![];case _0x76c3('0x75'):return _0x21206f[_0x76c3('0x75')]?operators[_0x2b959d[_0x76c3('0x73')]](_0x2b959d[_0x76c3('0x6f')],_0x21206f[_0x76c3('0x75')]):![];case _0x76c3('0x76'):return _0x21206f['routeId']?operators[_0x2b959d[_0x76c3('0x73')]](_0x2b959d[_0x76c3('0x6f')],_0x21206f[_0x76c3('0x76')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 822d096..8d5316a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x334d58,_0x20550e){var _0x423f3b=function(_0x25829a){while(--_0x25829a){_0x334d58['push'](_0x334d58['shift']());}};_0x423f3b(++_0x20550e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
+var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x5fc3[_0x191154];return _0x3dcd73;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});};
\ No newline at end of file
index a3aa4e9..22f73d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb544=['stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20Call\x20direction:\x20%s','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','socket.io-emitter','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','GET','Bearer\x20','value','isNil','validateEmail','email','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','outbound','destcalleridnum','calleridnum','POST','4.0','odata-entityid','lastIndexOf','enduserId','message','contacts?$select=telephone1','telephone1','contactid',']\x20Enduser\x20created!','length','forEach','includes','picklist','type','nameField','customField','idField','indexOf','substring','content','ticketType','incident','incidents','assign','getString','Descriptions','/systemusers(','Fields','phonecall','phonecalls','Subjects','/contacts(','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url'];(function(_0x5ccf1,_0x28a9ed){var _0x2d6b4d=function(_0x5b2f9d){while(--_0x5b2f9d){_0x5ccf1['push'](_0x5ccf1['shift']());}};_0x2d6b4d(++_0x28a9ed);}(_0xb544,0xd0));var _0x4b54=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb544[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x4b54('0x0'));var util=require(_0x4b54('0x1'));var intUtil=require(_0x4b54('0x2'));var md5=require(_0x4b54('0x3'));var Redis=require(_0x4b54('0x4'));var logger=require(_0x4b54('0x5'))(_0x4b54('0x6'));var config=require(_0x4b54('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4b54('0x8'))(new Redis(config['redis']));function getAuthToken(_0x2bf592,_0x512bff,_0x1a5800){var _0x3452e1={'method':'POST','uri':_0x512bff,'form':{'client_id':_0x2bf592[_0x4b54('0x9')],'resource':_0x2bf592[_0x4b54('0xa')],'username':_0x2bf592[_0x4b54('0xb')],'password':_0x2bf592[_0x4b54('0xc')],'grant_type':_0x4b54('0xc'),'client_secret':_0x2bf592[_0x4b54('0xd')]},'json':!![]};return rp(_0x3452e1)[_0x4b54('0xe')](function(_0x5d1846){return _0x5d1846[_0x4b54('0xf')];})[_0x4b54('0x10')](function(_0x281469){logger['error']('['+[_0x1a5800[_0x4b54('0x11')]()]+_0x4b54('0x12'));return _0x281469['message'];});}function getUser(_0x133ca5,_0x45f590,_0x568af7,_0x169d4e,_0x240a17,_0x4c0911){return new BPromise(function(_0x5e500f,_0x1361b6){return getAuthToken(_0x45f590,_0x169d4e,_0x4c0911)['then'](function(_0x100d85){var _0x56955f={'method':_0x4b54('0x13'),'uri':_0x240a17+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x4b54('0x14')+_0x100d85,'OData-Version':'4.0'},'json':!![]};return rp(_0x56955f);})['then'](function(_0x189b57){var _0x59a93a=_0x189b57[_0x4b54('0x15')];var _0x26aa1b=![];var _0x3b7702=null;if(!_[_0x4b54('0x16')](_0x568af7)){if(intUtil[_0x4b54('0x17')](_0x568af7[_0x4b54('0x18')])){_0x133ca5['userEmail']=_0x568af7['email'];for(_0x3b7702=0x0;_0x3b7702<_0x59a93a['length'];_0x3b7702++){if(_0x59a93a[_0x3b7702][_0x4b54('0x19')]===_0x568af7[_0x4b54('0x18')]&&!_0x59a93a[_0x3b7702]['isdisabled']){_0x26aa1b=!![];logger[_0x4b54('0x1a')]('['+[_0x4c0911[_0x4b54('0x11')]()]+_0x4b54('0x1b')+_0x59a93a[_0x3b7702][_0x4b54('0x1c')]+'!');_0x133ca5[_0x4b54('0x1d')]=_0x59a93a[_0x3b7702][_0x4b54('0x1c')];}}}}if(!_0x26aa1b){logger[_0x4b54('0x1a')]('['+[_0x4c0911[_0x4b54('0x11')]()]+_0x4b54('0x1e'));_0x133ca5[_0x4b54('0x1f')]=_0x45f590[_0x4b54('0xb')];for(_0x3b7702=0x0;_0x3b7702<_0x59a93a['length'];_0x3b7702++){if(_0x59a93a[_0x3b7702][_0x4b54('0x19')]===_0x45f590['username']){_0x133ca5[_0x4b54('0x1d')]=_0x59a93a[_0x3b7702][_0x4b54('0x1c')];}}}_0x5e500f(_0x133ca5);})[_0x4b54('0x10')](function(_0x35e1ba){_0x1361b6(_0x35e1ba['message']);});});}function createEndUser(_0x40ffd9,_0x18bb65,_0xc221d5,_0xbdb7f5,_0x1f9a79,_0x5e4750){return new BPromise(function(_0x11f5eb,_0x37b678){return getAuthToken(_0x18bb65,_0xc221d5,_0x5e4750)[_0x4b54('0xe')](function(_0x3c184b){var _0x36ea53=_0x5e4750[_0x4b54('0x20')]()===_0x4b54('0x21')?_0x1f9a79[_0x4b54('0x22')]:_0x1f9a79[_0x4b54('0x23')];var _0x19b661={'method':_0x4b54('0x24'),'uri':_0xbdb7f5+'contacts','body':{'telephone1':_0x36ea53,'fullname':_0x36ea53,'firstname':_0x36ea53,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x40ffd9[_0x4b54('0x1d')]+')'},'headers':{'Authorization':_0x4b54('0x14')+_0x3c184b,'OData-Version':_0x4b54('0x25')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x19b661);})['then'](function(_0x24f4df){var _0x5cd087=_0x24f4df['headers'][_0x4b54('0x26')];var _0x4e1001=_0x5cd087['substring'](_0x5cd087[_0x4b54('0x27')]('(')+0x1,_0x5cd087[_0x4b54('0x27')](')'));_0x40ffd9[_0x4b54('0x28')]=_0x4e1001;_0x11f5eb(_0x40ffd9);})[_0x4b54('0x10')](function(_0x1c349e){_0x37b678(_0x1c349e[_0x4b54('0x29')]);});});}function getEndUser(_0x42608e,_0x587c01,_0x2087af,_0x5c5c3b,_0x3b8b7b,_0x307f91){return new BPromise(function(_0x139970,_0x1211bd){return getAuthToken(_0x587c01,_0x2087af,_0x307f91)[_0x4b54('0xe')](function(_0x487d28){var _0x2f5e8f={'method':_0x4b54('0x13'),'uri':_0x5c5c3b+_0x4b54('0x2a'),'headers':{'Authorization':_0x4b54('0x14')+_0x487d28,'If-None-Match':null,'OData-Version':_0x4b54('0x25')},'json':!![]};return rp(_0x2f5e8f);})[_0x4b54('0xe')](function(_0x546682){var _0xd93343=null;if(_0x546682){var _0xb52468=_0x546682['value'];var _0x185a85=![];for(_0xd93343=0x0;_0xd93343<_0xb52468['length'];_0xd93343++){var _0x2bc3ed=_0x307f91[_0x4b54('0x20')]()==='outbound'?_0x3b8b7b['destcalleridnum']:_0x3b8b7b[_0x4b54('0x23')];if(_0xb52468[_0xd93343][_0x4b54('0x2b')]===_0x2bc3ed){_0x185a85=!![];_0x42608e[_0x4b54('0x28')]=_0xb52468[_0xd93343][_0x4b54('0x2c')];}}if(_0x185a85){_0x139970(_0x42608e);}else{return createEndUser(_0x42608e,_0x587c01,_0x2087af,_0x5c5c3b,_0x3b8b7b,_0x307f91)[_0x4b54('0xe')](function(_0x5cbe2e){logger[_0x4b54('0x1a')]('['+[_0x307f91[_0x4b54('0x11')]()]+_0x4b54('0x2d'),_0x5cbe2e[_0x4b54('0x28')]);_0x139970(_0x5cbe2e);});}}else{return createEndUser(_0x42608e,_0x587c01,_0x2087af,_0x5c5c3b,_0x3b8b7b,_0x307f91)['then'](function(_0x1b0a37){logger[_0x4b54('0x1a')]('['+[_0x307f91['toUpperCase']()]+']\x20Enduser\x20Created!',_0x1b0a37[_0x4b54('0x28')]);_0x139970(_0x1b0a37);});}});});}function getCustomFields(_0x660e20,_0x5da431,_0x3f8bf9){var _0x1b418d={};if(_0x660e20[_0x4b54('0x2e')]>0x0){_[_0x4b54('0x2f')](_0x660e20,function(_0x434a8c){if(_[_0x4b54('0x30')](['string',_0x4b54('0x31')],_0x434a8c[_0x4b54('0x32')])&&_0x434a8c[_0x4b54('0x33')]&&!_0x434a8c[_0x4b54('0x34')]){var _0x4b999e=_0x434a8c[_0x4b54('0x35')][_0x4b54('0x20')]();var _0x1070c5=_0x4b999e['substring'](0x0,_0x4b999e[_0x4b54('0x36')]('_'));var _0x1f3e7d=_0x4b999e[_0x4b54('0x37')](_0x4b999e['indexOf']('_')+0x1);if(_0x1070c5===_0x3f8bf9){_0x1b418d[_0x1f3e7d]=_0x434a8c[_0x4b54('0x38')];}}});}return _0x1b418d;}function getTicket(_0x55c5bc,_0x57fbad,_0x1789fd,_0x886d18,_0xecf0d4,_0x5e821b,_0x15a0af){return new BPromise(function(_0x19addc,_0x46f212){var _0x1494c6;return getAuthToken(_0x57fbad,_0x1789fd,_0x15a0af)[_0x4b54('0xe')](function(_0x567b4a){if(_0x5e821b[_0x4b54('0x39')]===_0x4b54('0x3a')){_0x1494c6={'method':_0x4b54('0x24'),'uri':_0x886d18+_0x4b54('0x3b'),'body':Object[_0x4b54('0x3c')]({},{'title':intUtil[_0x4b54('0x3d')](_0x5e821b['Subjects'],_0xecf0d4,'\x20'),'description':intUtil['getString'](_0x5e821b[_0x4b54('0x3e')],_0xecf0d4,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x55c5bc[_0x4b54('0x28')]+')','ownerid@odata.bind':_0x4b54('0x3f')+_0x55c5bc['userId']+')','caseorigincode':'1'},getCustomFields(_0x5e821b[_0x4b54('0x40')],_0xecf0d4,_0x5e821b[_0x4b54('0x39')])),'headers':{'Authorization':_0x4b54('0x14')+_0x567b4a,'OData-Version':_0x4b54('0x25')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5e821b['ticketType']===_0x4b54('0x41')){_0x1494c6={'method':_0x4b54('0x24'),'uri':_0x886d18+_0x4b54('0x42'),'body':Object[_0x4b54('0x3c')]({},{'subject':intUtil[_0x4b54('0x3d')](_0x5e821b[_0x4b54('0x43')],_0xecf0d4,'\x20'),'phonenumber':String(_0xecf0d4[_0x4b54('0x23')]),'description':intUtil['getString'](_0x5e821b['Descriptions'],_0xecf0d4,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4b54('0x44')+_0x55c5bc[_0x4b54('0x28')]+')','ownerid@odata.bind':'/systemusers('+_0x55c5bc[_0x4b54('0x1d')]+')','directioncode':_0x55c5bc[_0x4b54('0x45')]===_0x4b54('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x55c5bc['userId']+')','participationtypemask':_0x55c5bc[_0x4b54('0x45')]===_0x4b54('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0x4b54('0x44')+_0x55c5bc['enduserId']+')','participationtypemask':_0x55c5bc[_0x4b54('0x45')]===_0x4b54('0x46')?0x1:0x2}]},getCustomFields(_0x5e821b[_0x4b54('0x40')],_0xecf0d4,_0x5e821b[_0x4b54('0x39')])),'headers':{'Authorization':_0x4b54('0x14')+_0x567b4a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1494c6);})[_0x4b54('0xe')](function(_0x525e8d){var _0x28652a=_0x525e8d['headers']['odata-entityid'];var _0x55f03d=_0x28652a[_0x4b54('0x37')](_0x28652a[_0x4b54('0x27')]('(')+0x1,_0x28652a[_0x4b54('0x27')](')'));_0x55c5bc[_0x4b54('0x47')]=_0x55f03d;_0x19addc(_0x55c5bc);})[_0x4b54('0x10')](function(_0x4bb189){_0x46f212(_0x4bb189[_0x4b54('0x29')]);});});}function emit(_0xcd140,_0x5aac2a,_0x16407f,_0x4c80d2){var _0x38bc70={'uri':util[_0x4b54('0x48')](_0x4b54('0x49'),_0xcd140,_0x16407f,_0x4c80d2)};io['to'](util[_0x4b54('0x48')](_0x4b54('0x4a'),_0x5aac2a))[_0x4b54('0x4b')](_0x4b54('0x4c'),_0x38bc70);}exports['cs']=function(_0x4183ce,_0x266c8d,_0xe6c0f5,_0x1a8f0d,_0xc7f9a8,_0x5e0100,_0x584dd4,_0x28c240){var _0x2f3226={};_0x5e0100['remoteUri']=intUtil[_0x4b54('0x4d')](_0x5e0100['remoteUri']);_0x5e0100[_0x4b54('0x4e')]=intUtil[_0x4b54('0x4d')](_0x5e0100[_0x4b54('0x4e')]);_0x2f3226['callDirection']=_0x28c240===_0x4b54('0x46')||_0x28c240==='unmanaged'?_0x4b54('0x46'):'outbound';var _0x34a692=util[_0x4b54('0x48')](_0x4b54('0x4f'),_0x5e0100[_0x4b54('0xa')]);var _0x59d7ba=util[_0x4b54('0x48')](_0x4b54('0x50'),_0x5e0100['tenantId']);var _0x2e6ebe=util[_0x4b54('0x48')](_0x4b54('0x51'),_0x5e0100[_0x4b54('0x4e')],_0x266c8d['uniqueid'],md5(_0x266c8d['uniqueid']));if(_0xc7f9a8&&_0xc7f9a8[_0x4b54('0x52')]){logger[_0x4b54('0x1a')](_0x4b54('0x53'),_0x4b54('0x54'));_0x266c8d[_0x4b54('0x55')]=_0x2e6ebe;}else if(_0x584dd4&&_0x584dd4['recordingFormat']&&_0x584dd4[_0x4b54('0x56')]!==_0x4b54('0x57')){logger['info'](_0x4b54('0x58'),_0x4b54('0x54'));_0x266c8d[_0x4b54('0x55')]=_0x2e6ebe;}else{_0x266c8d['recordingURL']='';}return getUser(_0x2f3226,_0x5e0100,_0x1a8f0d,_0x59d7ba,_0x34a692,_0x28c240)['then'](function(_0x2404fd){logger[_0x4b54('0x1a')]('['+_0x28c240[_0x4b54('0x11')]()+']\x20The\x20User\x20ID\x20is:',_0x2404fd[_0x4b54('0x1d')]);logger[_0x4b54('0x1a')]('['+_0x28c240[_0x4b54('0x11')]()+_0x4b54('0x59'),_0x2404fd[_0x4b54('0x1f')]);return getEndUser(_0x2404fd,_0x5e0100,_0x59d7ba,_0x34a692,_0x266c8d,_0x28c240);})[_0x4b54('0xe')](function(_0xd0ed26){logger['info']('['+_0x28c240[_0x4b54('0x11')]()+']\x20The\x20Enduser\x20ID\x20is:',_0xd0ed26[_0x4b54('0x28')]);logger['info']('['+_0x28c240[_0x4b54('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x266c8d[_0x4b54('0x23')]);return getTicket(_0xd0ed26,_0x5e0100,_0x59d7ba,_0x34a692,_0x266c8d,_0xe6c0f5,_0x28c240);})[_0x4b54('0xe')](function(_0x5175b6){logger[_0x4b54('0x1a')](util[_0x4b54('0x48')]('['+_0x28c240[_0x4b54('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xe6c0f5['ticketType'],_0x5175b6[_0x4b54('0x47')]));logger[_0x4b54('0x1a')](util[_0x4b54('0x48')]('['+_0x28c240['toUpperCase']()+_0x4b54('0x5a'),_0x28c240));if(_0x28c240!=='unmanaged'){logger['info']('['+_0x28c240['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5e0100[_0x4b54('0xa')],_0x1a8f0d[_0x4b54('0x5b')],_0xe6c0f5[_0x4b54('0x39')],_0x5175b6['ticketId']);}})['catch'](function(_0x1151d5){logger[_0x4b54('0x5c')]('['+_0x28c240[_0x4b54('0x11')]()+_0x4b54('0x5d'),util[_0x4b54('0x5e')](_0x1151d5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xf9b2=['systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','username','userId','catch','message','toLowerCase','outbound','destcalleridnum','calleridnum','Bearer\x20','headers','odata-entityid','substring','enduserId','contacts?$select=telephone1','value','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/systemusers(','Fields','/contacts(','callDirection','queue','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','md5','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','password','clientSecret','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','GET','4.0','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20'];(function(_0x3f9531,_0x860bae){var _0x529e01=function(_0x5c0385){while(--_0x5c0385){_0x3f9531['push'](_0x3f9531['shift']());}};_0x529e01(++_0x860bae);}(_0xf9b2,0x9a));var _0x2f9b=function(_0x1fc770,_0x3e4a33){_0x1fc770=_0x1fc770-0x0;var _0x2942ec=_0xf9b2[_0x1fc770];return _0x2942ec;};'use strict';var _=require(_0x2f9b('0x0'));var BPromise=require(_0x2f9b('0x1'));var rp=require(_0x2f9b('0x2'));var util=require(_0x2f9b('0x3'));var intUtil=require('./util');var md5=require(_0x2f9b('0x4'));var Redis=require('ioredis');var logger=require(_0x2f9b('0x5'))('dynamics365');var config=require('../../../../config/environment');config[_0x2f9b('0x6')]=_[_0x2f9b('0x7')](config[_0x2f9b('0x6')],{'host':_0x2f9b('0x8'),'port':0x18eb});var io=require(_0x2f9b('0x9'))(new Redis(config[_0x2f9b('0x6')]));function getAuthToken(_0xcf6aea,_0x4bf726,_0x21a47e){var _0x42be8c={'method':_0x2f9b('0xa'),'uri':_0x4bf726,'form':{'client_id':_0xcf6aea['clientId'],'resource':_0xcf6aea[_0x2f9b('0xb')],'username':_0xcf6aea['username'],'password':_0xcf6aea[_0x2f9b('0xc')],'grant_type':_0x2f9b('0xc'),'client_secret':_0xcf6aea[_0x2f9b('0xd')]},'json':!![]};return rp(_0x42be8c)[_0x2f9b('0xe')](function(_0x1d2e47){return _0x1d2e47[_0x2f9b('0xf')];})['catch'](function(_0x125517){logger[_0x2f9b('0x10')]('['+[_0x21a47e[_0x2f9b('0x11')]()]+_0x2f9b('0x12'));return _0x125517['message'];});}function getUser(_0x5873ad,_0x23cf2b,_0x47a95c,_0x195cd2,_0x398170,_0x542505){return new BPromise(function(_0x4a95d4,_0xab80f9){return getAuthToken(_0x23cf2b,_0x195cd2,_0x542505)[_0x2f9b('0xe')](function(_0xa1008d){var _0x40b1f7={'method':_0x2f9b('0x13'),'uri':_0x398170+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0xa1008d,'OData-Version':_0x2f9b('0x14')},'json':!![]};return rp(_0x40b1f7);})[_0x2f9b('0xe')](function(_0x48ebbe){var _0x2f141c=_0x48ebbe['value'];var _0x2c6b16=![];var _0x147ce4=null;if(!_['isNil'](_0x47a95c)){if(intUtil[_0x2f9b('0x15')](_0x47a95c[_0x2f9b('0x16')])){_0x5873ad[_0x2f9b('0x17')]=_0x47a95c[_0x2f9b('0x16')];for(_0x147ce4=0x0;_0x147ce4<_0x2f141c['length'];_0x147ce4++){if(_0x2f141c[_0x147ce4][_0x2f9b('0x18')]===_0x47a95c[_0x2f9b('0x16')]&&!_0x2f141c[_0x147ce4][_0x2f9b('0x19')]){_0x2c6b16=!![];logger[_0x2f9b('0x1a')]('['+[_0x542505['toUpperCase']()]+_0x2f9b('0x1b')+_0x2f141c[_0x147ce4][_0x2f9b('0x1c')]+'!');_0x5873ad['userId']=_0x2f141c[_0x147ce4][_0x2f9b('0x1c')];}}}}if(!_0x2c6b16){logger[_0x2f9b('0x1a')]('['+[_0x542505[_0x2f9b('0x11')]()]+_0x2f9b('0x1d'));_0x5873ad['userEmail']=_0x23cf2b['username'];for(_0x147ce4=0x0;_0x147ce4<_0x2f141c[_0x2f9b('0x1e')];_0x147ce4++){if(_0x2f141c[_0x147ce4][_0x2f9b('0x18')]===_0x23cf2b[_0x2f9b('0x1f')]){_0x5873ad[_0x2f9b('0x20')]=_0x2f141c[_0x147ce4][_0x2f9b('0x1c')];}}}_0x4a95d4(_0x5873ad);})[_0x2f9b('0x21')](function(_0x44f47b){_0xab80f9(_0x44f47b[_0x2f9b('0x22')]);});});}function createEndUser(_0x9613db,_0x416bc6,_0x1430be,_0x4d8daf,_0x280787,_0x4e4aaf){return new BPromise(function(_0x337df7,_0x48e933){return getAuthToken(_0x416bc6,_0x1430be,_0x4e4aaf)[_0x2f9b('0xe')](function(_0x138c5f){var _0x45dbde=_0x4e4aaf[_0x2f9b('0x23')]()===_0x2f9b('0x24')?_0x280787[_0x2f9b('0x25')]:_0x280787[_0x2f9b('0x26')];var _0xf43880={'method':'POST','uri':_0x4d8daf+'contacts','body':{'telephone1':_0x45dbde,'fullname':_0x45dbde,'firstname':_0x45dbde,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x9613db['userId']+')'},'headers':{'Authorization':_0x2f9b('0x27')+_0x138c5f,'OData-Version':_0x2f9b('0x14')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xf43880);})[_0x2f9b('0xe')](function(_0x178403){var _0x4da6c1=_0x178403[_0x2f9b('0x28')][_0x2f9b('0x29')];var _0x941524=_0x4da6c1[_0x2f9b('0x2a')](_0x4da6c1['lastIndexOf']('(')+0x1,_0x4da6c1['lastIndexOf'](')'));_0x9613db[_0x2f9b('0x2b')]=_0x941524;_0x337df7(_0x9613db);})[_0x2f9b('0x21')](function(_0x3c4c9a){_0x48e933(_0x3c4c9a[_0x2f9b('0x22')]);});});}function getEndUser(_0x3acfed,_0x27fefd,_0x5cb9ca,_0x9a5948,_0x22d1ca,_0x338a8d){return new BPromise(function(_0x5346e3,_0x68708c){return getAuthToken(_0x27fefd,_0x5cb9ca,_0x338a8d)[_0x2f9b('0xe')](function(_0x1bad52){var _0x887eb4={'method':'GET','uri':_0x9a5948+_0x2f9b('0x2c'),'headers':{'Authorization':_0x2f9b('0x27')+_0x1bad52,'If-None-Match':null,'OData-Version':_0x2f9b('0x14')},'json':!![]};return rp(_0x887eb4);})[_0x2f9b('0xe')](function(_0x19657e){var _0x1f1081=null;if(_0x19657e){var _0x50d131=_0x19657e[_0x2f9b('0x2d')];var _0x4c4ef4=![];for(_0x1f1081=0x0;_0x1f1081<_0x50d131[_0x2f9b('0x1e')];_0x1f1081++){var _0x38636e=_0x338a8d[_0x2f9b('0x23')]()===_0x2f9b('0x24')?_0x22d1ca[_0x2f9b('0x25')]:_0x22d1ca[_0x2f9b('0x26')];if(_0x50d131[_0x1f1081][_0x2f9b('0x2e')]===_0x38636e){_0x4c4ef4=!![];_0x3acfed[_0x2f9b('0x2b')]=_0x50d131[_0x1f1081]['contactid'];}}if(_0x4c4ef4){_0x5346e3(_0x3acfed);}else{return createEndUser(_0x3acfed,_0x27fefd,_0x5cb9ca,_0x9a5948,_0x22d1ca,_0x338a8d)['then'](function(_0x5e036d){logger[_0x2f9b('0x1a')]('['+[_0x338a8d[_0x2f9b('0x11')]()]+_0x2f9b('0x2f'),_0x5e036d[_0x2f9b('0x2b')]);_0x5346e3(_0x5e036d);});}}else{return createEndUser(_0x3acfed,_0x27fefd,_0x5cb9ca,_0x9a5948,_0x22d1ca,_0x338a8d)[_0x2f9b('0xe')](function(_0x9cfc86){logger['info']('['+[_0x338a8d[_0x2f9b('0x11')]()]+_0x2f9b('0x30'),_0x9cfc86[_0x2f9b('0x2b')]);_0x5346e3(_0x9cfc86);});}});});}function getCustomFields(_0x4fcd23,_0x408cdf,_0x4a7fe1){var _0x10a2b1={};if(_0x4fcd23['length']>0x0){_[_0x2f9b('0x31')](_0x4fcd23,function(_0x42f7d5){if(_[_0x2f9b('0x32')]([_0x2f9b('0x33'),_0x2f9b('0x34')],_0x42f7d5[_0x2f9b('0x35')])&&_0x42f7d5[_0x2f9b('0x36')]&&!_0x42f7d5[_0x2f9b('0x37')]){var _0x116ac2=_0x42f7d5['idField']['toLowerCase']();var _0x27a73e=_0x116ac2[_0x2f9b('0x2a')](0x0,_0x116ac2[_0x2f9b('0x38')]('_'));var _0x5c3d1b=_0x116ac2[_0x2f9b('0x2a')](_0x116ac2[_0x2f9b('0x38')]('_')+0x1);if(_0x27a73e===_0x4a7fe1){_0x10a2b1[_0x5c3d1b]=_0x42f7d5[_0x2f9b('0x39')];}}});}return _0x10a2b1;}function getTicket(_0x36c2ac,_0x313e3a,_0x559a73,_0x8d4dee,_0x61fc21,_0x32e705,_0x3a8c76){return new BPromise(function(_0x273322,_0x238414){var _0x3e32cc;return getAuthToken(_0x313e3a,_0x559a73,_0x3a8c76)[_0x2f9b('0xe')](function(_0x4c987b){if(_0x32e705[_0x2f9b('0x3a')]==='incident'){_0x3e32cc={'method':_0x2f9b('0xa'),'uri':_0x8d4dee+_0x2f9b('0x3b'),'body':Object[_0x2f9b('0x3c')]({},{'title':intUtil[_0x2f9b('0x3d')](_0x32e705[_0x2f9b('0x3e')],_0x61fc21,'\x20'),'description':intUtil[_0x2f9b('0x3d')](_0x32e705[_0x2f9b('0x3f')],_0x61fc21,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x36c2ac['enduserId']+')','ownerid@odata.bind':_0x2f9b('0x40')+_0x36c2ac[_0x2f9b('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x32e705[_0x2f9b('0x41')],_0x61fc21,_0x32e705[_0x2f9b('0x3a')])),'headers':{'Authorization':'Bearer\x20'+_0x4c987b,'OData-Version':_0x2f9b('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x32e705[_0x2f9b('0x3a')]==='phonecall'){_0x3e32cc={'method':_0x2f9b('0xa'),'uri':_0x8d4dee+'phonecalls','body':Object[_0x2f9b('0x3c')]({},{'subject':intUtil['getString'](_0x32e705[_0x2f9b('0x3e')],_0x61fc21,'\x20'),'phonenumber':String(_0x61fc21[_0x2f9b('0x26')]),'description':intUtil[_0x2f9b('0x3d')](_0x32e705[_0x2f9b('0x3f')],_0x61fc21,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2f9b('0x42')+_0x36c2ac[_0x2f9b('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x36c2ac['userId']+')','directioncode':_0x36c2ac[_0x2f9b('0x43')]===_0x2f9b('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2f9b('0x40')+_0x36c2ac['userId']+')','participationtypemask':_0x36c2ac['callDirection']===_0x2f9b('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x2f9b('0x42')+_0x36c2ac[_0x2f9b('0x2b')]+')','participationtypemask':_0x36c2ac[_0x2f9b('0x43')]===_0x2f9b('0x44')?0x1:0x2}]},getCustomFields(_0x32e705[_0x2f9b('0x41')],_0x61fc21,_0x32e705['ticketType'])),'headers':{'Authorization':_0x2f9b('0x27')+_0x4c987b,'OData-Version':_0x2f9b('0x14')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e32cc);})['then'](function(_0x709e5c){var _0x38b998=_0x709e5c[_0x2f9b('0x28')][_0x2f9b('0x29')];var _0x1a21ad=_0x38b998[_0x2f9b('0x2a')](_0x38b998[_0x2f9b('0x45')]('(')+0x1,_0x38b998[_0x2f9b('0x45')](')'));_0x36c2ac[_0x2f9b('0x46')]=_0x1a21ad;_0x273322(_0x36c2ac);})[_0x2f9b('0x21')](function(_0x442d35){_0x238414(_0x442d35[_0x2f9b('0x22')]);});});}function emit(_0x2f345e,_0x3ca010,_0x4b5165,_0x2f8099){var _0x497e18={'uri':util[_0x2f9b('0x47')](_0x2f9b('0x48'),_0x2f345e,_0x4b5165,_0x2f8099)};io['to'](util['format'](_0x2f9b('0x49'),_0x3ca010))['emit']('trigger:browser:url',_0x497e18);}exports['cs']=function(_0x1f89c3,_0x2e90e5,_0x38847d,_0x436711,_0x185678,_0x3f0355,_0x4e68b1,_0x5890e2){var _0x20c8c8={};_0x3f0355[_0x2f9b('0xb')]=intUtil['stripTrailingSlash'](_0x3f0355[_0x2f9b('0xb')]);_0x3f0355[_0x2f9b('0x4a')]=intUtil[_0x2f9b('0x4b')](_0x3f0355['serverUrl']);_0x20c8c8[_0x2f9b('0x43')]=_0x5890e2===_0x2f9b('0x44')||_0x5890e2===_0x2f9b('0x4c')?_0x2f9b('0x44'):'outbound';var _0x3283c9=util[_0x2f9b('0x47')](_0x2f9b('0x4d'),_0x3f0355[_0x2f9b('0xb')]);var _0x10fd05=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x3f0355['tenantId']);var _0x26eb44=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f0355[_0x2f9b('0x4a')],_0x2e90e5['uniqueid'],md5(_0x2e90e5['uniqueid']));if(_0x185678&&_0x185678[_0x2f9b('0x4e')]){logger['info'](_0x2f9b('0x4f'),'Recording\x20is\x20enabled!');_0x2e90e5[_0x2f9b('0x50')]=_0x26eb44;}else if(_0x4e68b1&&_0x4e68b1[_0x2f9b('0x51')]&&_0x4e68b1[_0x2f9b('0x51')]!==_0x2f9b('0x52')){logger[_0x2f9b('0x1a')]('[OUTBOUND]',_0x2f9b('0x53'));_0x2e90e5['recordingURL']=_0x26eb44;}else{_0x2e90e5[_0x2f9b('0x50')]='';}return getUser(_0x20c8c8,_0x3f0355,_0x436711,_0x10fd05,_0x3283c9,_0x5890e2)['then'](function(_0x96736f){logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x54'),_0x96736f[_0x2f9b('0x20')]);logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x55'),_0x96736f[_0x2f9b('0x17')]);return getEndUser(_0x96736f,_0x3f0355,_0x10fd05,_0x3283c9,_0x2e90e5,_0x5890e2);})[_0x2f9b('0xe')](function(_0x34d40f){logger[_0x2f9b('0x1a')]('['+_0x5890e2['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x34d40f[_0x2f9b('0x2b')]);logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x56'),_0x2e90e5[_0x2f9b('0x26')]);return getTicket(_0x34d40f,_0x3f0355,_0x10fd05,_0x3283c9,_0x2e90e5,_0x38847d,_0x5890e2);})['then'](function(_0x56d6ff){logger[_0x2f9b('0x1a')](util[_0x2f9b('0x47')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x57'),_0x38847d[_0x2f9b('0x3a')],_0x56d6ff[_0x2f9b('0x46')]));logger['info'](util[_0x2f9b('0x47')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x58'),_0x5890e2));if(_0x5890e2!=='unmanaged'){logger[_0x2f9b('0x1a')]('['+_0x5890e2[_0x2f9b('0x11')]()+']',_0x2f9b('0x59'));emit(_0x3f0355[_0x2f9b('0xb')],_0x436711['name'],_0x38847d[_0x2f9b('0x3a')],_0x56d6ff[_0x2f9b('0x46')]);}})[_0x2f9b('0x21')](function(_0x462f5e){logger[_0x2f9b('0x10')]('['+_0x5890e2[_0x2f9b('0x11')]()+_0x2f9b('0x5a'),util['inspect'](_0x462f5e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 7a54d31..d988e4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde04=['[OUTBOUND]','user:%s','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','calleridnum','request-promise','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','string','customField','nameField','content','includes','picklist','type','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','uniqueid','recordingURL','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','Recording\x20is\x20enabled!','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:'];(function(_0x75a141,_0x5e5f53){var _0x30a520=function(_0xc6eb55){while(--_0xc6eb55){_0x75a141['push'](_0x75a141['shift']());}};_0x30a520(++_0x5e5f53);}(_0xde04,0x17c));var _0x4de0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde04[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var rp=require(_0x4de0('0x0'));var md5=require('md5');var util=require(_0x4de0('0x1'));var Redis=require(_0x4de0('0x2'));var intUtil=require(_0x4de0('0x3'));var config=require('../../../../config/environment');var logger=require(_0x4de0('0x4'))(_0x4de0('0x5'));config[_0x4de0('0x6')]=_[_0x4de0('0x7')](config[_0x4de0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4de0('0x8'))(new Redis(config[_0x4de0('0x6')]));var headers={'Content-Type':'application/json','Accept':_0x4de0('0x9')};function emit(_0x18f7b9,_0x486d3a,_0x19d7f7){io['to'](_0x18f7b9)[_0x4de0('0xa')](_0x486d3a,_0x19d7f7);}function getTicket(_0x3952d7,_0x244efe,_0x309b5b,_0x4b02d3,_0xccb56e){logger[_0x4de0('0xb')](_0x4de0('0xc'));var _0x8b6462=_[_0x4de0('0xd')]({'responder_id':_0x244efe['id'],'requester_id':_0x309b5b['id'],'name':util[_0x4de0('0xe')](_0x4de0('0xf'),_0xccb56e[_0x4de0('0x10')]),'phone':_0xccb56e['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4de0('0x11')](_0x4b02d3['Subjects'],_0xccb56e,'\x20'),'description':intUtil[_0x4de0('0x11')](_0x4b02d3['Descriptions'],_0xccb56e,'<br>'),'tags':getTags(_0x4b02d3[_0x4de0('0x12')],_0x4de0('0x13'))},getCustomFields(_0x4b02d3[_0x4de0('0x14')],_0xccb56e));_0x8b6462[_0x4de0('0x15')]=_[_0x4de0('0x16')](_[_0x4de0('0x17')](_0x8b6462[_0x4de0('0x15')],'id'),_0x4de0('0x18'));return request({'uri':util[_0x4de0('0xe')](_0x4de0('0x19'),_0x3952d7[_0x4de0('0x1a')]),'method':_0x4de0('0x1b'),'body':_0x8b6462})[_0x4de0('0x1c')](function(_0x5f0d78){logger[_0x4de0('0xb')](_0x4de0('0x1d'));return _0x5f0d78;});}function getUser(_0x3ec847,_0x2795a2){if(intUtil[_0x4de0('0x1e')](_0x2795a2)){return request({'uri':util['format']('%s/api/v2/agents',_0x3ec847[_0x4de0('0x1a')]),'qs':{'email':_0x2795a2}})[_0x4de0('0x1c')](function(_0x544c6b){if(_0x544c6b['length']){logger[_0x4de0('0xb')](_0x4de0('0x1f'));return _[_0x4de0('0x20')](_0x544c6b,function(_0x18deeb){return _0x18deeb[_0x4de0('0x21')][_0x4de0('0x22')]===_0x2795a2;});}else{logger['info'](_0x4de0('0x23'));return request({'uri':util[_0x4de0('0xe')](_0x4de0('0x24'),_0x3ec847['remoteUri'])})[_0x4de0('0x1c')](function(_0x31e7e4){logger[_0x4de0('0xb')](_0x4de0('0x25'));return _0x31e7e4;});}});}else{logger[_0x4de0('0xb')](_0x4de0('0x26'));return request({'uri':util[_0x4de0('0xe')](_0x4de0('0x24'),_0x3ec847[_0x4de0('0x1a')])})[_0x4de0('0x1c')](function(_0x514c80){logger[_0x4de0('0xb')](_0x4de0('0x25'));return _0x514c80;});}}function getEndUser(_0x3882c8,_0x3b09fe,_0x28db6c){logger[_0x4de0('0xb')](_0x4de0('0x27'),_0x28db6c);return request({'uri':util['format'](_0x4de0('0x28'),_0x3882c8[_0x4de0('0x1a')]),'qs':{'phone':_0x28db6c}})['then'](function(_0x128396){if(_0x128396[_0x4de0('0x29')]){logger[_0x4de0('0xb')](_0x4de0('0x2a'));return _[_0x4de0('0x20')](_0x128396,{'phone':_0x28db6c});}else{logger[_0x4de0('0xb')](_0x4de0('0x2b'));return request({'uri':util[_0x4de0('0xe')](_0x4de0('0x28'),_0x3882c8['remoteUri']),'method':_0x4de0('0x1b'),'body':{'name':_0x3b09fe,'phone':_0x28db6c}})[_0x4de0('0x1c')](function(_0x201b46){logger[_0x4de0('0xb')](_0x4de0('0x2c'));return _0x201b46;});}});}function getAuth(_0x1aae07){return util[_0x4de0('0xe')](_0x4de0('0x2d'),new Buffer(_0x1aae07[_0x4de0('0x2e')]+':X')[_0x4de0('0x2f')](_0x4de0('0x30')));}function request(_0x4df52f){logger[_0x4de0('0x31')](_0x4de0('0x32'),JSON[_0x4de0('0x33')](_0x4df52f));return rp(_[_0x4de0('0x7')](_0x4df52f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3be286,_0x223100){var _0x1b6169=[];if(_0x3be286&&_0x3be286['length']>0x0){_0x1b6169=_['map'](_0x3be286,_0x223100);}return _0x1b6169;}function getCustomFields(_0x3c288e,_0x52f2cc){var _0x3b764e=[];var _0x5dadd7={'custom_fields':[]};if(_0x3c288e[_0x4de0('0x29')]>0x0){_['forEach'](_0x3c288e,function(_0x25ff4c){if(_['includes']([_0x4de0('0x34'),'picklist'],_0x25ff4c['type'])&&_0x25ff4c['nameField']&&!_0x25ff4c[_0x4de0('0x35')]){_0x5dadd7[_0x25ff4c[_0x4de0('0x36')]['toLowerCase']()]=_0x25ff4c[_0x4de0('0x37')]['toString']();}else if(_[_0x4de0('0x38')]([_0x4de0('0x34'),_0x4de0('0x39')],_0x25ff4c[_0x4de0('0x3a')])&&_0x25ff4c[_0x4de0('0x3b')]&&_0x25ff4c[_0x4de0('0x35')]){_0x5dadd7[_0x4de0('0x15')][_0x4de0('0x3c')]({'id':_0x25ff4c[_0x4de0('0x3b')],'value':_0x25ff4c[_0x4de0('0x37')]['toString']()});}else if(_0x25ff4c['type']===_0x4de0('0x3d')&&_0x25ff4c['variableName']&&_0x25ff4c[_0x4de0('0x3b')]&&_0x25ff4c[_0x4de0('0x35')]){_0x52f2cc[_0x25ff4c[_0x4de0('0x3e')]]&&_0x5dadd7[_0x4de0('0x15')][_0x4de0('0x3c')]({'id':_0x25ff4c[_0x4de0('0x3b')],'value':_0x52f2cc[_0x25ff4c['variableName']][_0x4de0('0x2f')]()});}else if(_0x25ff4c[_0x4de0('0x3a')]===_0x4de0('0x3f')&&_0x25ff4c[_0x4de0('0x40')]&&_0x25ff4c[_0x4de0('0x40')][_0x4de0('0x13')]&&_0x25ff4c[_0x4de0('0x3b')]&&_0x25ff4c[_0x4de0('0x35')]){_0x52f2cc[_0x25ff4c[_0x4de0('0x40')][_0x4de0('0x13')][_0x4de0('0x41')]()]&&_0x5dadd7[_0x4de0('0x15')][_0x4de0('0x3c')]({'id':_0x25ff4c[_0x4de0('0x3b')],'value':_0x52f2cc[_0x25ff4c[_0x4de0('0x40')][_0x4de0('0x13')][_0x4de0('0x41')]()][_0x4de0('0x2f')]()});}});}return _0x5dadd7;}exports[_0x4de0('0x42')]=function(_0x14c6bb,_0x33dfbb,_0x3fba75,_0x298769,_0x23e44b,_0x38549d){var _0x2e2c73,_0x2b537c;_0x38549d[_0x4de0('0x1a')]=intUtil[_0x4de0('0x43')](_0x38549d['remoteUri']);_0x38549d['serverUrl']=intUtil['stripTrailingSlash'](_0x38549d[_0x4de0('0x44')]);if(_0x23e44b&&_0x23e44b[_0x4de0('0x45')]){logger[_0x4de0('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x33dfbb['recordingURL']=util[_0x4de0('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x38549d['serverUrl'],_0x33dfbb[_0x4de0('0x46')],md5(_0x33dfbb[_0x4de0('0x46')]));}else{_0x33dfbb[_0x4de0('0x47')]='';}headers['Authorization']=getAuth(_0x38549d);return getUser(_0x38549d,_0x298769['email'])[_0x4de0('0x1c')](function(_0xdfdfd){_0x2e2c73=_0xdfdfd;logger[_0x4de0('0xb')]('The\x20User\x20ID\x20is:',_0x2e2c73['id']);return getEndUser(_0x38549d,_0x33dfbb[_0x4de0('0x10')],_0x33dfbb['calleridnum']);})[_0x4de0('0x1c')](function(_0x251a75){_0x2b537c=_0x251a75;logger[_0x4de0('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2b537c['id']);return getTicket(_0x38549d,_0x2e2c73,_0x2b537c,_0x3fba75,_0x33dfbb);})['then'](function(_0x276642){if(_0x276642&&_0x276642['id']){logger[_0x4de0('0xb')](_0x4de0('0x1d'));logger[_0x4de0('0xb')]('The\x20Ticket\x20ID\x20is:',_0x276642['id']);logger[_0x4de0('0xb')](_0x4de0('0x48'),_0x4de0('0x49'));emit(util[_0x4de0('0xe')]('user:%s',_0x298769['name']),'trigger:browser:url',{'uri':util[_0x4de0('0xe')](_0x4de0('0x4a'),_0x38549d['remoteUri'],_0x276642['id'])});}})['catch'](function(_0x2272fb){logger[_0x4de0('0x4b')](_0x4de0('0x48'),JSON[_0x4de0('0x33')](_0x2272fb));});};exports[_0x4de0('0x4c')]=function(_0xbfeebe,_0x1c13fe,_0x4a9afd,_0x161484,_0x2f1164,_0x440cca,_0x52d76e){var _0xcd0998,_0x32196b;_0x440cca['remoteUri']=intUtil[_0x4de0('0x43')](_0x440cca[_0x4de0('0x1a')]);_0x440cca[_0x4de0('0x44')]=intUtil[_0x4de0('0x43')](_0x440cca[_0x4de0('0x44')]);if(_0x52d76e&&_0x52d76e[_0x4de0('0x4d')]&&_0x52d76e[_0x4de0('0x4d')]!=='none'){logger['info']('[OUTBOUND]',_0x4de0('0x4e'));_0x1c13fe['recordingURL']=util[_0x4de0('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x440cca[_0x4de0('0x44')],_0x1c13fe[_0x4de0('0x46')],md5(_0x1c13fe[_0x4de0('0x46')]));}headers[_0x4de0('0x4f')]=getAuth(_0x440cca);return getUser(_0x440cca,_0x161484['email'])['then'](function(_0xe6005d){_0xcd0998=_0xe6005d;logger[_0x4de0('0xb')](_0x4de0('0x50'),_0xcd0998['id']);return getEndUser(_0x440cca,_0x1c13fe[_0x4de0('0x51')],_0x1c13fe[_0x4de0('0x52')]);})[_0x4de0('0x1c')](function(_0x58a7b7){_0x32196b=_0x58a7b7;logger[_0x4de0('0xb')](_0x4de0('0x53'),_0x32196b['id']);return getTicket(_0x440cca,_0xcd0998,_0x32196b,_0x4a9afd,_0x1c13fe);})['then'](function(_0x2558de){if(_0x2558de&&_0x2558de['id']){logger['info']('Ticket\x20created!');logger[_0x4de0('0xb')](_0x4de0('0x54'),_0x2558de['id']);logger[_0x4de0('0xb')](_0x4de0('0x55'),_0x4de0('0x49'));emit(util[_0x4de0('0xe')](_0x4de0('0x56'),_0x161484[_0x4de0('0x13')]),_0x4de0('0x57'),{'uri':util[_0x4de0('0xe')](_0x4de0('0x4a'),_0x440cca[_0x4de0('0x1a')],_0x2558de['id'])});}})[_0x4de0('0x58')](function(_0x1c32b1){logger[_0x4de0('0x4b')](_0x4de0('0x55'),JSON[_0x4de0('0x33')](_0x1c32b1));});};exports[_0x4de0('0x59')]=function(_0x1c77e8,_0x3e7a17,_0x1c75af,_0x37b31a,_0x4c3a89,_0x3bdee2){var _0x3424e3,_0x1bad72;_0x3bdee2[_0x4de0('0x1a')]=intUtil[_0x4de0('0x43')](_0x3bdee2[_0x4de0('0x1a')]);_0x3bdee2[_0x4de0('0x44')]=intUtil[_0x4de0('0x43')](_0x3bdee2[_0x4de0('0x44')]);if(_0x4c3a89&&_0x4c3a89[_0x4de0('0x45')]){logger[_0x4de0('0xb')]('['+_0x3e7a17[_0x4de0('0x5a')][_0x4de0('0x5b')]()+']',_0x4de0('0x4e'));_0x3e7a17[_0x4de0('0x47')]=util[_0x4de0('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3bdee2['serverUrl'],_0x3e7a17[_0x4de0('0x46')],md5(_0x3e7a17[_0x4de0('0x46')]));}else{_0x3e7a17[_0x4de0('0x47')]='';}headers[_0x4de0('0x4f')]=getAuth(_0x3bdee2);return getUser(_0x3bdee2,'')['then'](function(_0x3179a2){_0x3424e3=_0x3179a2;logger[_0x4de0('0xb')]('The\x20User\x20ID\x20is:',_0x3424e3['id']);return getEndUser(_0x3bdee2,_0x3e7a17['calleridname'],_0x3e7a17[_0x4de0('0x5c')]);})[_0x4de0('0x1c')](function(_0x43a450){_0x1bad72=_0x43a450;logger[_0x4de0('0xb')](_0x4de0('0x53'),_0x1bad72['id']);return getTicket(_0x3bdee2,_0x3424e3,_0x1bad72,_0x1c75af,_0x3e7a17);})[_0x4de0('0x1c')](function(_0x205ee3){if(_0x205ee3){logger[_0x4de0('0xb')]('Ticket\x20created!');logger[_0x4de0('0xb')]('The\x20Ticket\x20ID\x20is:',_0x205ee3['id']);}})[_0x4de0('0x58')](function(_0x152e7e){logger[_0x4de0('0x4b')]('['+_0x3e7a17['lastevent']['toUpperCase']()+']',JSON[_0x4de0('0x33')](_0x152e7e));});};
\ No newline at end of file
+var _0x186a=['Caller\x20-\x20%s','calleridname','getString','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','keyBy','value','format','remoteUri','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','content','string','idField','push','variable','variableName','customField','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','%s/helpdesk/tickets/%d','unmanaged','toUpperCase','lastevent','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge'];(function(_0xc5009e,_0x1e92e8){var _0x513c9b=function(_0x294031){while(--_0x294031){_0xc5009e['push'](_0xc5009e['shift']());}};_0x513c9b(++_0x1e92e8);}(_0x186a,0x1d5));var _0xa186=function(_0x5a4408,_0x5892bc){_0x5a4408=_0x5a4408-0x0;var _0x4a998c=_0x186a[_0x5a4408];return _0x4a998c;};'use strict';var _=require(_0xa186('0x0'));var rp=require(_0xa186('0x1'));var md5=require(_0xa186('0x2'));var util=require('util');var Redis=require(_0xa186('0x3'));var intUtil=require(_0xa186('0x4'));var config=require(_0xa186('0x5'));var logger=require(_0xa186('0x6'))(_0xa186('0x7'));config[_0xa186('0x8')]=_[_0xa186('0x9')](config['redis'],{'host':_0xa186('0xa'),'port':0x18eb});var io=require(_0xa186('0xb'))(new Redis(config[_0xa186('0x8')]));var headers={'Content-Type':_0xa186('0xc'),'Accept':_0xa186('0xc')};function emit(_0x39ca55,_0x3977ac,_0x33d3af){io['to'](_0x39ca55)['emit'](_0x3977ac,_0x33d3af);}function getTicket(_0xe515f2,_0x3b597d,_0x5ce593,_0x14378d,_0x5251d9){logger[_0xa186('0xd')](_0xa186('0xe'));var _0x28cb00=_[_0xa186('0xf')]({'responder_id':_0x3b597d['id'],'requester_id':_0x5ce593['id'],'name':util['format'](_0xa186('0x10'),_0x5251d9[_0xa186('0x11')]),'phone':_0x5251d9['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa186('0x12')](_0x14378d['Subjects'],_0x5251d9,'\x20'),'description':intUtil[_0xa186('0x12')](_0x14378d[_0xa186('0x13')],_0x5251d9,_0xa186('0x14')),'tags':getTags(_0x14378d[_0xa186('0x15')],'name')},getCustomFields(_0x14378d[_0xa186('0x16')],_0x5251d9));_0x28cb00[_0xa186('0x17')]=_[_0xa186('0x18')](_[_0xa186('0x19')](_0x28cb00[_0xa186('0x17')],'id'),_0xa186('0x1a'));return request({'uri':util[_0xa186('0x1b')]('%s/api/v2/tickets',_0xe515f2[_0xa186('0x1c')]),'method':'POST','body':_0x28cb00})[_0xa186('0x1d')](function(_0x1082b6){logger[_0xa186('0xd')](_0xa186('0x1e'));return _0x1082b6;});}function getUser(_0x194f74,_0x33242f){if(intUtil[_0xa186('0x1f')](_0x33242f)){return request({'uri':util[_0xa186('0x1b')]('%s/api/v2/agents',_0x194f74[_0xa186('0x1c')]),'qs':{'email':_0x33242f}})[_0xa186('0x1d')](function(_0x358898){if(_0x358898['length']){logger['info'](_0xa186('0x20'));return _[_0xa186('0x21')](_0x358898,function(_0x47fbb2){return _0x47fbb2[_0xa186('0x22')][_0xa186('0x23')]===_0x33242f;});}else{logger[_0xa186('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa186('0x1b')](_0xa186('0x24'),_0x194f74[_0xa186('0x1c')])})['then'](function(_0x49e598){logger[_0xa186('0xd')](_0xa186('0x25'));return _0x49e598;});}});}else{logger['info'](_0xa186('0x26'));return request({'uri':util[_0xa186('0x1b')](_0xa186('0x24'),_0x194f74[_0xa186('0x1c')])})[_0xa186('0x1d')](function(_0x1792d6){logger['info'](_0xa186('0x25'));return _0x1792d6;});}}function getEndUser(_0x4cd894,_0x88c728,_0x148568){logger[_0xa186('0xd')](_0xa186('0x27'),_0x148568);return request({'uri':util[_0xa186('0x1b')](_0xa186('0x28'),_0x4cd894[_0xa186('0x1c')]),'qs':{'phone':_0x148568}})['then'](function(_0x55fd7a){if(_0x55fd7a[_0xa186('0x29')]){logger[_0xa186('0xd')](_0xa186('0x2a'));return _['find'](_0x55fd7a,{'phone':_0x148568});}else{logger['info'](_0xa186('0x2b'));return request({'uri':util[_0xa186('0x1b')](_0xa186('0x28'),_0x4cd894[_0xa186('0x1c')]),'method':_0xa186('0x2c'),'body':{'name':_0x88c728,'phone':_0x148568}})['then'](function(_0x733c0a){logger[_0xa186('0xd')](_0xa186('0x2d'));return _0x733c0a;});}});}function getAuth(_0x38765b){return util[_0xa186('0x1b')](_0xa186('0x2e'),new Buffer(_0x38765b[_0xa186('0x2f')]+':X')[_0xa186('0x30')](_0xa186('0x31')));}function request(_0x3ea86f){logger[_0xa186('0x32')](_0xa186('0x33'),JSON[_0xa186('0x34')](_0x3ea86f));return rp(_[_0xa186('0x9')](_0x3ea86f,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x71a9fd,_0x33ae3e){var _0x5072a3=[];if(_0x71a9fd&&_0x71a9fd['length']>0x0){_0x5072a3=_[_0xa186('0x35')](_0x71a9fd,_0x33ae3e);}return _0x5072a3;}function getCustomFields(_0x1d4a33,_0x17e6ff){var _0x39f8ee=[];var _0x5d3a08={'custom_fields':[]};if(_0x1d4a33[_0xa186('0x29')]>0x0){_[_0xa186('0x36')](_0x1d4a33,function(_0xb2fb7d){if(_[_0xa186('0x37')](['string',_0xa186('0x38')],_0xb2fb7d[_0xa186('0x39')])&&_0xb2fb7d[_0xa186('0x3a')]&&!_0xb2fb7d['customField']){_0x5d3a08[_0xb2fb7d[_0xa186('0x3a')]['toLowerCase']()]=_0xb2fb7d[_0xa186('0x3b')][_0xa186('0x30')]();}else if(_[_0xa186('0x37')]([_0xa186('0x3c'),_0xa186('0x38')],_0xb2fb7d[_0xa186('0x39')])&&_0xb2fb7d[_0xa186('0x3d')]&&_0xb2fb7d['customField']){_0x5d3a08[_0xa186('0x17')][_0xa186('0x3e')]({'id':_0xb2fb7d[_0xa186('0x3d')],'value':_0xb2fb7d[_0xa186('0x3b')][_0xa186('0x30')]()});}else if(_0xb2fb7d[_0xa186('0x39')]===_0xa186('0x3f')&&_0xb2fb7d[_0xa186('0x40')]&&_0xb2fb7d[_0xa186('0x3d')]&&_0xb2fb7d[_0xa186('0x41')]){_0x17e6ff[_0xb2fb7d[_0xa186('0x40')]]&&_0x5d3a08[_0xa186('0x17')][_0xa186('0x3e')]({'id':_0xb2fb7d[_0xa186('0x3d')],'value':_0x17e6ff[_0xb2fb7d[_0xa186('0x40')]][_0xa186('0x30')]()});}else if(_0xb2fb7d[_0xa186('0x39')]===_0xa186('0x42')&&_0xb2fb7d[_0xa186('0x43')]&&_0xb2fb7d[_0xa186('0x43')][_0xa186('0x44')]&&_0xb2fb7d['idField']&&_0xb2fb7d[_0xa186('0x41')]){_0x17e6ff[_0xb2fb7d[_0xa186('0x43')][_0xa186('0x44')][_0xa186('0x45')]()]&&_0x5d3a08['custom_fields']['push']({'id':_0xb2fb7d[_0xa186('0x3d')],'value':_0x17e6ff[_0xb2fb7d['Variable'][_0xa186('0x44')][_0xa186('0x45')]()]['toString']()});}});}return _0x5d3a08;}exports[_0xa186('0x46')]=function(_0x3f72c2,_0x10b12b,_0x35ea90,_0x8397da,_0x1b13dd,_0x6e1f4e){var _0x3831da,_0xf196ab;_0x6e1f4e[_0xa186('0x1c')]=intUtil['stripTrailingSlash'](_0x6e1f4e[_0xa186('0x1c')]);_0x6e1f4e[_0xa186('0x47')]=intUtil[_0xa186('0x48')](_0x6e1f4e['serverUrl']);if(_0x1b13dd&&_0x1b13dd[_0xa186('0x49')]){logger[_0xa186('0xd')](_0xa186('0x4a'),'Recording\x20is\x20enabled!');_0x10b12b[_0xa186('0x4b')]=util[_0xa186('0x1b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x6e1f4e[_0xa186('0x47')],_0x10b12b[_0xa186('0x4c')],md5(_0x10b12b['uniqueid']));}else{_0x10b12b[_0xa186('0x4b')]='';}headers['Authorization']=getAuth(_0x6e1f4e);return getUser(_0x6e1f4e,_0x8397da[_0xa186('0x23')])[_0xa186('0x1d')](function(_0x4b3184){_0x3831da=_0x4b3184;logger[_0xa186('0xd')](_0xa186('0x4d'),_0x3831da['id']);return getEndUser(_0x6e1f4e,_0x10b12b[_0xa186('0x11')],_0x10b12b[_0xa186('0x4e')]);})[_0xa186('0x1d')](function(_0x1f4cac){_0xf196ab=_0x1f4cac;logger[_0xa186('0xd')](_0xa186('0x4f'),_0xf196ab['id']);return getTicket(_0x6e1f4e,_0x3831da,_0xf196ab,_0x35ea90,_0x10b12b);})[_0xa186('0x1d')](function(_0x2ae8e4){if(_0x2ae8e4&&_0x2ae8e4['id']){logger[_0xa186('0xd')](_0xa186('0x1e'));logger[_0xa186('0xd')](_0xa186('0x50'),_0x2ae8e4['id']);logger['info'](_0xa186('0x4a'),_0xa186('0x51'));emit(util[_0xa186('0x1b')](_0xa186('0x52'),_0x8397da[_0xa186('0x44')]),_0xa186('0x53'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x6e1f4e['remoteUri'],_0x2ae8e4['id'])});}})[_0xa186('0x54')](function(_0x498998){logger[_0xa186('0x55')]('[QUEUE]',JSON[_0xa186('0x34')](_0x498998));});};exports[_0xa186('0x56')]=function(_0x160ae7,_0x321b8f,_0x5c8e0b,_0x3bc358,_0x16d85b,_0x1d7905,_0x2ce7e2){var _0x2a484a,_0x4c2687;_0x1d7905['remoteUri']=intUtil[_0xa186('0x48')](_0x1d7905['remoteUri']);_0x1d7905['serverUrl']=intUtil[_0xa186('0x48')](_0x1d7905[_0xa186('0x47')]);if(_0x2ce7e2&&_0x2ce7e2[_0xa186('0x57')]&&_0x2ce7e2['recordingFormat']!==_0xa186('0x58')){logger['info']('[OUTBOUND]',_0xa186('0x59'));_0x321b8f[_0xa186('0x4b')]=util[_0xa186('0x1b')](_0xa186('0x5a'),_0x1d7905['serverUrl'],_0x321b8f[_0xa186('0x4c')],md5(_0x321b8f[_0xa186('0x4c')]));}headers[_0xa186('0x5b')]=getAuth(_0x1d7905);return getUser(_0x1d7905,_0x3bc358[_0xa186('0x23')])[_0xa186('0x1d')](function(_0x5256ae){_0x2a484a=_0x5256ae;logger[_0xa186('0xd')](_0xa186('0x4d'),_0x2a484a['id']);return getEndUser(_0x1d7905,_0x321b8f[_0xa186('0x5c')],_0x321b8f['destcalleridnum']);})[_0xa186('0x1d')](function(_0x1c354f){_0x4c2687=_0x1c354f;logger['info'](_0xa186('0x4f'),_0x4c2687['id']);return getTicket(_0x1d7905,_0x2a484a,_0x4c2687,_0x5c8e0b,_0x321b8f);})[_0xa186('0x1d')](function(_0x152040){if(_0x152040&&_0x152040['id']){logger[_0xa186('0xd')](_0xa186('0x1e'));logger[_0xa186('0xd')](_0xa186('0x50'),_0x152040['id']);logger[_0xa186('0xd')]('[OUTBOUND]',_0xa186('0x51'));emit(util['format']('user:%s',_0x3bc358[_0xa186('0x44')]),_0xa186('0x53'),{'uri':util[_0xa186('0x1b')](_0xa186('0x5d'),_0x1d7905['remoteUri'],_0x152040['id'])});}})['catch'](function(_0x4b2217){logger[_0xa186('0x55')]('[OUTBOUND]',JSON[_0xa186('0x34')](_0x4b2217));});};exports[_0xa186('0x5e')]=function(_0x560c40,_0x37e395,_0x45cac5,_0x3a8513,_0x2e2bf2,_0x2797af){var _0x4471e7,_0x24146b;_0x2797af[_0xa186('0x1c')]=intUtil[_0xa186('0x48')](_0x2797af[_0xa186('0x1c')]);_0x2797af[_0xa186('0x47')]=intUtil[_0xa186('0x48')](_0x2797af[_0xa186('0x47')]);if(_0x2e2bf2&&_0x2e2bf2[_0xa186('0x49')]){logger[_0xa186('0xd')]('['+_0x37e395['lastevent'][_0xa186('0x5f')]()+']',_0xa186('0x59'));_0x37e395[_0xa186('0x4b')]=util[_0xa186('0x1b')](_0xa186('0x5a'),_0x2797af[_0xa186('0x47')],_0x37e395[_0xa186('0x4c')],md5(_0x37e395[_0xa186('0x4c')]));}else{_0x37e395['recordingURL']='';}headers[_0xa186('0x5b')]=getAuth(_0x2797af);return getUser(_0x2797af,'')[_0xa186('0x1d')](function(_0x3616f2){_0x4471e7=_0x3616f2;logger[_0xa186('0xd')](_0xa186('0x4d'),_0x4471e7['id']);return getEndUser(_0x2797af,_0x37e395[_0xa186('0x11')],_0x37e395[_0xa186('0x4e')]);})[_0xa186('0x1d')](function(_0x4c7dcd){_0x24146b=_0x4c7dcd;logger['info']('The\x20Enduser\x20ID\x20is:',_0x24146b['id']);return getTicket(_0x2797af,_0x4471e7,_0x24146b,_0x45cac5,_0x37e395);})['then'](function(_0x2b609a){if(_0x2b609a){logger['info'](_0xa186('0x1e'));logger['info'](_0xa186('0x50'),_0x2b609a['id']);}})[_0xa186('0x54')](function(_0x5279c0){logger['error']('['+_0x37e395[_0xa186('0x60')][_0xa186('0x5f')]()+']',JSON[_0xa186('0x34')](_0x5279c0));});};
\ No newline at end of file
index 1d6f232..d275e9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x745b=['endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','contactNumber','YYYY-MM-DDTHH:mm:ss','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','add','ticketId','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL','name','inspect','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','socket.io-emitter','GET','info','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','catch','message','/api/lookup?q=','&f=','&entities=contact','then','find','contacts','format'];(function(_0x56e945,_0x3353e4){var _0x2e124e=function(_0x19800){while(--_0x19800){_0x56e945['push'](_0x56e945['shift']());}};_0x2e124e(++_0x3353e4);}(_0x745b,0xc4));var _0xb745=function(_0x411565,_0xb6409d){_0x411565=_0x411565-0x0;var _0x46cdfe=_0x745b[_0x411565];return _0x46cdfe;};'use strict';var _=require('lodash');var rp=require(_0xb745('0x0'));var md5=require('md5');var util=require(_0xb745('0x1'));var moment=require(_0xb745('0x2'));var Promise=require(_0xb745('0x3'));var Redis=require(_0xb745('0x4'));var intUtil=require(_0xb745('0x5'));var config=require(_0xb745('0x6'));var logger=require(_0xb745('0x7'))(_0xb745('0x8'));config[_0xb745('0x9')]=_['defaults'](config[_0xb745('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb745('0xa'))(new Redis(config[_0xb745('0x9')]));function getAdminId(_0x1e5938,_0x2a8713,_0x3b022a,_0x548f16){return new Promise(function(_0x163e70,_0x3d4c5c){var _0x3b746f=![];var _0x1b50a7={'method':_0xb745('0xb'),'uri':_0x548f16+'/api/selector/owners','json':!![]};_0x1b50a7['headers']=_0x3b022a;logger[_0xb745('0xc')](_0xb745('0xd'));return rp(_0x1b50a7)['then'](function(_0x36eb1c){if(_0x36eb1c){var _0x4241b0=_0x36eb1c[_0xb745('0xe')];var _0x5048e8=null;for(_0x5048e8=0x0;_0x5048e8<_0x4241b0[_0xb745('0xf')];_0x5048e8++){if(_0x4241b0[_0x5048e8][_0xb745('0x10')]===_0x1e5938[_0xb745('0x11')]){_0x1e5938['adminId']=_0x4241b0[_0x5048e8]['id'];_0x3b746f=!![];}}if(_0x3b746f){logger['info']('Admin\x20found:',_0x1e5938[_0xb745('0x12')]);_0x163e70(_0x1e5938);}else{_0x3d4c5c({'statusCode':0x194,'message':_0xb745('0x13')});}}else{_0x3d4c5c({'statusCode':0x194,'message':_0xb745('0x13')});}})['catch'](function(_0x1760e9){logger[_0xb745('0x14')]('['+[_0x2a8713[_0xb745('0x15')]()]+']',_0x1760e9['message']);_0x3d4c5c(_0x1760e9);});});}function getUser(_0x48dcf0,_0x22d249,_0x38429f){return function(_0x260039){return new Promise(function(_0x5e9f19,_0x17db47){var _0x1b22c6={'method':_0xb745('0xb'),'uri':_0x38429f+_0xb745('0x16'),'json':!![]};_0x1b22c6['headers']=_0x22d249;logger[_0xb745('0xc')](_0xb745('0x17'));return rp(_0x1b22c6)['then'](function(_0x370ffb){if(_0x370ffb){var _0x3d974a=_0x370ffb[_0xb745('0xe')];var _0x11aae3=![];var _0x5a2204=null;if(_0x260039[_0xb745('0x18')]!==null){logger[_0xb745('0xc')](_0xb745('0x19'),_0x260039[_0xb745('0x18')]);_0x260039[_0xb745('0x1a')]=_0x260039[_0xb745('0x18')];for(_0x5a2204=0x0;_0x5a2204<_0x3d974a[_0xb745('0xf')];_0x5a2204++){if(_0x3d974a[_0x5a2204]['email']===_0x260039[_0xb745('0x18')]){_0x11aae3=!![];_0x260039[_0xb745('0x1b')]=_0x3d974a[_0x5a2204]['id'];logger[_0xb745('0xc')]('User\x20found:',_0x260039[_0xb745('0x1b')]);}}}if(!_0x11aae3){logger[_0xb745('0xc')](_0xb745('0x1c'));_0x260039['userEmail']=_0x260039['adminEmail'];_0x260039[_0xb745('0x1b')]=_0x260039[_0xb745('0x12')];_0x11aae3=!![];}if(_0x11aae3){_0x5e9f19(_0x260039);}else{_0x17db47({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x17db47({'statusCode':0x194,'message':_0xb745('0x13')});}})[_0xb745('0x1d')](function(_0x4b30e8){logger[_0xb745('0x14')]('['+[_0x48dcf0[_0xb745('0x15')]()]+']',_0x4b30e8[_0xb745('0x1e')]);_0x17db47(_0x4b30e8);});});};}function searchContact(_0x5a534d,_0x2b5f27,_0x66e2cb,_0x408d12){return new Promise(function(_0x19bac,_0x223ea8){var _0xf488b1={'method':_0xb745('0xb'),'headers':_0x2b5f27,'uri':_0x5a534d+_0xb745('0x1f')+_0x408d12+_0xb745('0x20')+_0x66e2cb+_0xb745('0x21'),'json':!![]};rp(_0xf488b1)[_0xb745('0x22')](function(_0x53d605){var _0x1df28b=_[_0xb745('0x23')](_0x53d605[_0xb745('0x24')][_0xb745('0x24')],[_0x66e2cb,_0x408d12]);_0x19bac(_0x1df28b);})[_0xb745('0x1d')](function(_0x266894){_0x223ea8(_0x266894);});});}function getEndUser(_0x13ccf0,_0x5cc7f5,_0x196321){return function(_0x2a0ed2){return new Promise(function(_0x3194d4,_0x56efce){logger[_0xb745('0xc')](util[_0xb745('0x25')]('Searching\x20contact\x20with\x20phone\x20%s',_0x2a0ed2['contactNumber']));searchContact(_0x196321,_0x5cc7f5,'mobile_number',_0x2a0ed2['contactNumber'])[_0xb745('0x22')](function(_0xc136a9){if(_0xc136a9){_0x2a0ed2[_0xb745('0x26')]=_0xc136a9['id'];logger[_0xb745('0xc')](_0xb745('0x27'),_0x2a0ed2[_0xb745('0x26')]);return _0x3194d4(_0x2a0ed2);}searchContact(_0x196321,_0x5cc7f5,_0xb745('0x28'),_0x2a0ed2['contactNumber'])[_0xb745('0x22')](function(_0x3c8924){if(_0x3c8924){_0x2a0ed2[_0xb745('0x26')]=_0x3c8924['id'];logger[_0xb745('0xc')]('Contact\x20found\x20work_number:',_0x2a0ed2['endUserId']);return _0x3194d4(_0x2a0ed2);}createEndUser(_0x2a0ed2,_0x13ccf0,_0x5cc7f5,_0x196321)[_0xb745('0x22')](function(_0x38ff87){logger['info'](_0xb745('0x29'),_0x38ff87[_0xb745('0x26')]);return _0x3194d4(_0x38ff87);});});})[_0xb745('0x1d')](function(_0x45c865){_0x56efce(_0x45c865);});});};}function createEndUser(_0xf3fc48,_0x2d0995,_0x277111,_0x445fa5){return new Promise(function(_0xd86165,_0x16fa89){var _0xb4b9c4=moment();var _0x4ff361={'method':_0xb745('0x2a'),'uri':_0x445fa5+_0xb745('0x2b'),'body':{'contact':{'last_name':_0xf3fc48['contactNumber'],'work_number':_0xf3fc48[_0xb745('0x2c')],'mobile_number':_0xf3fc48['contactNumber'],'owner_id':_0xf3fc48[_0xb745('0x1b')],'created_at':_0xb4b9c4['format'](_0xb745('0x2d'))}},'json':!![]};_0x4ff361[_0xb745('0x2e')]=_0x277111;logger['info'](_0xb745('0x2f'));return rp(_0x4ff361)['then'](function(_0x254b4f){_0xf3fc48[_0xb745('0x26')]=_0x254b4f[_0xb745('0x30')]['id'];_0xd86165(_0xf3fc48);})[_0xb745('0x1d')](function(_0x5c62de){logger['error']('['+[_0x2d0995['toUpperCase']()]+']',_0x5c62de[_0xb745('0x1e')]);_0x16fa89(_0x5c62de[_0xb745('0x1e')]);});});}function getTicket(_0x5f0923,_0x4da050,_0x38be4c,_0x5480bf,_0x28a1ef){return function(_0x2d2908){logger[_0xb745('0xc')]('Creating\x20new\x20task');return new Promise(function(_0x4a8f07,_0x42f516){var _0x50fbb8=moment();var _0x720d30={'method':'POST','uri':_0x38be4c+_0xb745('0x31'),'body':{'title':intUtil[_0xb745('0x32')](_0x5480bf['Subjects'],_0x28a1ef,'\x20'),'description':intUtil['getString'](_0x5480bf['Descriptions'],_0x28a1ef,'\x0a'),'owner_id':_0x2d2908[_0xb745('0x1b')],'creater_id':_0x2d2908[_0xb745('0x12')],'targetable_id':_0x2d2908['endUserId'],'targetable_type':'Contact','created_at':_0x50fbb8[_0xb745('0x25')](_0xb745('0x2d')),'due_date':_0x50fbb8[_0xb745('0x33')](0x1e,'m')['format'](_0xb745('0x2d'))},'json':!![]};_0x720d30['headers']=_0x4da050;return rp(_0x720d30)[_0xb745('0x22')](function(_0x4eea2d){_0x2d2908[_0xb745('0x34')]=_0x4eea2d['task']['id'];logger[_0xb745('0xc')]('Task\x20created:',_0x2d2908[_0xb745('0x34')]);_0x4a8f07(_0x2d2908);})[_0xb745('0x1d')](function(_0x2e1045){logger[_0xb745('0x14')]('['+[_0x5f0923[_0xb745('0x15')]()]+']',_0x2e1045[_0xb745('0x1e')]);_0x42f516(_0x2e1045[_0xb745('0x1e')]);});});};}function emit(_0x3d12a6,_0x5bbb65,_0x2e02da){var _0x2c3c76={'uri':_0x3d12a6+_0xb745('0x35')+_0x2e02da};io['to'](util[_0xb745('0x25')](_0xb745('0x36'),_0x5bbb65))[_0xb745('0x37')]('trigger:browser:url',_0x2c3c76);}exports['cs']=function(_0x44d110,_0x384092,_0x3be3d4,_0x398ac3,_0x4be219,_0x2b56ca,_0x42651f,_0x42eec0){var _0x5bcbf5={};var _0x2b4143={'Authorization':_0xb745('0x38')+_0x2b56ca[_0xb745('0x39')]};_0x2b56ca[_0xb745('0x3a')]=intUtil[_0xb745('0x3b')](_0x2b56ca[_0xb745('0x3a')]);_0x2b56ca['serverUrl']=intUtil[_0xb745('0x3b')](_0x2b56ca['serverUrl']);var _0x4b9199=_0x2b56ca[_0xb745('0x3a')];_0x5bcbf5[_0xb745('0x11')]=_0x2b56ca[_0xb745('0x3c')];_0x5bcbf5['contactNumber']=_0x42eec0[_0xb745('0x3d')]()==='outbound'?_0x384092[_0xb745('0x3e')]:_0x384092[_0xb745('0x3f')];_0x5bcbf5[_0xb745('0x40')]=_0x42eec0===_0xb745('0x41')||_0x42eec0===_0xb745('0x42')?'queue':_0xb745('0x43');if(_0x398ac3){_0x5bcbf5['agentEmail']=_0x398ac3[_0xb745('0x10')];}var _0x3282de=util[_0xb745('0x25')](_0xb745('0x44'),_0x2b56ca['serverUrl'],_0x384092[_0xb745('0x45')],md5(_0x384092[_0xb745('0x45')]));if(_0x4be219&&_0x4be219[_0xb745('0x46')]){logger[_0xb745('0xc')](_0xb745('0x47'),_0xb745('0x48'));_0x384092['recordingURL']=_0x3282de;}else if(_0x42651f&&_0x42651f['recordingFormat']&&_0x42651f['recordingFormat']!==_0xb745('0x49')){logger[_0xb745('0xc')](_0xb745('0x4a'),_0xb745('0x48'));_0x384092[_0xb745('0x4b')]=_0x3282de;}else{_0x384092[_0xb745('0x4b')]='';}return getAdminId(_0x5bcbf5,_0x42eec0,_0x2b4143,_0x4b9199)[_0xb745('0x22')](getUser(_0x42eec0,_0x2b4143,_0x4b9199))[_0xb745('0x22')](getEndUser(_0x42eec0,_0x2b4143,_0x4b9199))[_0xb745('0x22')](getTicket(_0x42eec0,_0x2b4143,_0x4b9199,_0x3be3d4,_0x384092))[_0xb745('0x22')](function(_0x593fbd){logger[_0xb745('0xc')](util[_0xb745('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0x593fbd[_0xb745('0x34')]));if(_0x42eec0!==_0xb745('0x42')){logger[_0xb745('0xc')]('['+[_0x42eec0[_0xb745('0x15')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4b9199,_0x398ac3[_0xb745('0x4c')],_0x593fbd[_0xb745('0x26')]);}})[_0xb745('0x1d')](function(_0x26c9ce){logger['error']('['+[_0x42eec0[_0xb745('0x15')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xb745('0x4d')](_0x26c9ce,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xda05=['ticketId','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','userEmail','toUpperCase','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_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','Contact','add'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0xda05,0x105));var _0x5da0=function(_0x4c158d,_0x1f815e){_0x4c158d=_0x4c158d-0x0;var _0x3623c2=_0xda05[_0x4c158d];return _0x3623c2;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0x5da0('0x0'));var moment=require(_0x5da0('0x1'));var Promise=require('bluebird');var Redis=require(_0x5da0('0x2'));var intUtil=require('./util');var config=require(_0x5da0('0x3'));var logger=require(_0x5da0('0x4'))('freshsales');config['redis']=_['defaults'](config[_0x5da0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5da0('0x6'))(new Redis(config[_0x5da0('0x5')]));function getAdminId(_0x2ccbf8,_0x41e992,_0x4daa84,_0x38b18d){return new Promise(function(_0x16b5f5,_0x4333b4){var _0x5acc7c=![];var _0x42e11c={'method':_0x5da0('0x7'),'uri':_0x38b18d+_0x5da0('0x8'),'json':!![]};_0x42e11c[_0x5da0('0x9')]=_0x4daa84;logger[_0x5da0('0xa')](_0x5da0('0xb'));return rp(_0x42e11c)['then'](function(_0x5b51af){if(_0x5b51af){var _0x142e57=_0x5b51af[_0x5da0('0xc')];var _0x491cfc=null;for(_0x491cfc=0x0;_0x491cfc<_0x142e57['length'];_0x491cfc++){if(_0x142e57[_0x491cfc][_0x5da0('0xd')]===_0x2ccbf8[_0x5da0('0xe')]){_0x2ccbf8['adminId']=_0x142e57[_0x491cfc]['id'];_0x5acc7c=!![];}}if(_0x5acc7c){logger['info'](_0x5da0('0xf'),_0x2ccbf8[_0x5da0('0x10')]);_0x16b5f5(_0x2ccbf8);}else{_0x4333b4({'statusCode':0x194,'message':_0x5da0('0x11')});}}else{_0x4333b4({'statusCode':0x194,'message':_0x5da0('0x11')});}})[_0x5da0('0x12')](function(_0x3e043d){logger[_0x5da0('0x13')]('['+[_0x41e992['toUpperCase']()]+']',_0x3e043d[_0x5da0('0x14')]);_0x4333b4(_0x3e043d);});});}function getUser(_0x289116,_0x44b7fa,_0x2628de){return function(_0x3e50da){return new Promise(function(_0x1a3e20,_0x5e2be9){var _0x4cde3c={'method':_0x5da0('0x7'),'uri':_0x2628de+_0x5da0('0x8'),'json':!![]};_0x4cde3c['headers']=_0x44b7fa;logger[_0x5da0('0xa')](_0x5da0('0x15'));return rp(_0x4cde3c)[_0x5da0('0x16')](function(_0x1ecdc7){if(_0x1ecdc7){var _0x21c6c5=_0x1ecdc7[_0x5da0('0xc')];var _0x1dca59=![];var _0x2033eb=null;if(_0x3e50da[_0x5da0('0x17')]!==null){logger[_0x5da0('0xa')](_0x5da0('0x18'),_0x3e50da[_0x5da0('0x17')]);_0x3e50da['userEmail']=_0x3e50da[_0x5da0('0x17')];for(_0x2033eb=0x0;_0x2033eb<_0x21c6c5[_0x5da0('0x19')];_0x2033eb++){if(_0x21c6c5[_0x2033eb][_0x5da0('0xd')]===_0x3e50da['agentEmail']){_0x1dca59=!![];_0x3e50da[_0x5da0('0x1a')]=_0x21c6c5[_0x2033eb]['id'];logger['info'](_0x5da0('0x1b'),_0x3e50da[_0x5da0('0x1a')]);}}}if(!_0x1dca59){logger[_0x5da0('0xa')]('Admin\x20selected');_0x3e50da[_0x5da0('0x1c')]=_0x3e50da[_0x5da0('0xe')];_0x3e50da[_0x5da0('0x1a')]=_0x3e50da['adminId'];_0x1dca59=!![];}if(_0x1dca59){_0x1a3e20(_0x3e50da);}else{_0x5e2be9({'statusCode':0x194,'message':_0x5da0('0x11')});}}else{_0x5e2be9({'statusCode':0x194,'message':_0x5da0('0x11')});}})['catch'](function(_0x4d3170){logger['error']('['+[_0x289116[_0x5da0('0x1d')]()]+']',_0x4d3170[_0x5da0('0x14')]);_0x5e2be9(_0x4d3170);});});};}function searchContact(_0x1a0cbd,_0x2f658a,_0x13cab7,_0x80fffd){return new Promise(function(_0x5109bd,_0x4ef609){var _0x5285de={'method':_0x5da0('0x7'),'headers':_0x2f658a,'uri':_0x1a0cbd+'/api/lookup?q='+_0x80fffd+'&f='+_0x13cab7+_0x5da0('0x1e'),'json':!![]};rp(_0x5285de)[_0x5da0('0x16')](function(_0x1e4155){var _0x3d5350=_['find'](_0x1e4155[_0x5da0('0x1f')][_0x5da0('0x1f')],[_0x13cab7,_0x80fffd]);_0x5109bd(_0x3d5350);})[_0x5da0('0x12')](function(_0x3ccddc){_0x4ef609(_0x3ccddc);});});}function getEndUser(_0x2c0782,_0x56fec2,_0x1cb197){return function(_0x4cc442){return new Promise(function(_0x241f87,_0x106250){logger['info'](util[_0x5da0('0x20')](_0x5da0('0x21'),_0x4cc442[_0x5da0('0x22')]));searchContact(_0x1cb197,_0x56fec2,'mobile_number',_0x4cc442[_0x5da0('0x22')])[_0x5da0('0x16')](function(_0x29ec3c){if(_0x29ec3c){_0x4cc442[_0x5da0('0x23')]=_0x29ec3c['id'];logger[_0x5da0('0xa')](_0x5da0('0x24'),_0x4cc442['endUserId']);return _0x241f87(_0x4cc442);}searchContact(_0x1cb197,_0x56fec2,_0x5da0('0x25'),_0x4cc442[_0x5da0('0x22')])['then'](function(_0x358689){if(_0x358689){_0x4cc442[_0x5da0('0x23')]=_0x358689['id'];logger[_0x5da0('0xa')](_0x5da0('0x26'),_0x4cc442[_0x5da0('0x23')]);return _0x241f87(_0x4cc442);}createEndUser(_0x4cc442,_0x2c0782,_0x56fec2,_0x1cb197)[_0x5da0('0x16')](function(_0x44aade){logger[_0x5da0('0xa')](_0x5da0('0x27'),_0x44aade[_0x5da0('0x23')]);return _0x241f87(_0x44aade);});});})[_0x5da0('0x12')](function(_0x1399bc){_0x106250(_0x1399bc);});});};}function createEndUser(_0x4ab3f9,_0x30d086,_0x3e7847,_0x2ae226){return new Promise(function(_0x38365c,_0x4b4385){var _0x38c6d6=moment();var _0x12fe3d={'method':_0x5da0('0x28'),'uri':_0x2ae226+_0x5da0('0x29'),'body':{'contact':{'last_name':_0x4ab3f9['contactNumber'],'work_number':_0x4ab3f9[_0x5da0('0x22')],'mobile_number':_0x4ab3f9['contactNumber'],'owner_id':_0x4ab3f9[_0x5da0('0x1a')],'created_at':_0x38c6d6[_0x5da0('0x20')](_0x5da0('0x2a'))}},'json':!![]};_0x12fe3d['headers']=_0x3e7847;logger['info'](_0x5da0('0x2b'));return rp(_0x12fe3d)[_0x5da0('0x16')](function(_0xc57ad){_0x4ab3f9[_0x5da0('0x23')]=_0xc57ad[_0x5da0('0x2c')]['id'];_0x38365c(_0x4ab3f9);})[_0x5da0('0x12')](function(_0x4512f0){logger[_0x5da0('0x13')]('['+[_0x30d086[_0x5da0('0x1d')]()]+']',_0x4512f0[_0x5da0('0x14')]);_0x4b4385(_0x4512f0[_0x5da0('0x14')]);});});}function getTicket(_0x4f85a6,_0x27b57c,_0x5a1538,_0x129b8e,_0xfcb42b){return function(_0x16eeb3){logger[_0x5da0('0xa')](_0x5da0('0x2d'));return new Promise(function(_0xf5478a,_0x177332){var _0x483508=moment();var _0x565b29={'method':'POST','uri':_0x5a1538+_0x5da0('0x2e'),'body':{'title':intUtil[_0x5da0('0x2f')](_0x129b8e[_0x5da0('0x30')],_0xfcb42b,'\x20'),'description':intUtil[_0x5da0('0x2f')](_0x129b8e['Descriptions'],_0xfcb42b,'\x0a'),'owner_id':_0x16eeb3[_0x5da0('0x1a')],'creater_id':_0x16eeb3[_0x5da0('0x10')],'targetable_id':_0x16eeb3[_0x5da0('0x23')],'targetable_type':_0x5da0('0x31'),'created_at':_0x483508[_0x5da0('0x20')](_0x5da0('0x2a')),'due_date':_0x483508[_0x5da0('0x32')](0x1e,'m')[_0x5da0('0x20')](_0x5da0('0x2a'))},'json':!![]};_0x565b29[_0x5da0('0x9')]=_0x27b57c;return rp(_0x565b29)[_0x5da0('0x16')](function(_0x1a9359){_0x16eeb3[_0x5da0('0x33')]=_0x1a9359['task']['id'];logger[_0x5da0('0xa')](_0x5da0('0x34'),_0x16eeb3[_0x5da0('0x33')]);_0xf5478a(_0x16eeb3);})['catch'](function(_0x320186){logger[_0x5da0('0x13')]('['+[_0x4f85a6[_0x5da0('0x1d')]()]+']',_0x320186[_0x5da0('0x14')]);_0x177332(_0x320186['message']);});});};}function emit(_0x1e6131,_0x4fb514,_0xd05e5c){var _0x14de2d={'uri':_0x1e6131+_0x5da0('0x35')+_0xd05e5c};io['to'](util['format'](_0x5da0('0x36'),_0x4fb514))[_0x5da0('0x37')]('trigger:browser:url',_0x14de2d);}exports['cs']=function(_0x540fd6,_0x2b287b,_0x521201,_0x5e8f83,_0x1a1036,_0x5d75f6,_0x123789,_0x155106){var _0x17f719={};var _0x4aa862={'Authorization':_0x5da0('0x38')+_0x5d75f6[_0x5da0('0x39')]};_0x5d75f6[_0x5da0('0x3a')]=intUtil['stripTrailingSlash'](_0x5d75f6['remoteUri']);_0x5d75f6[_0x5da0('0x3b')]=intUtil[_0x5da0('0x3c')](_0x5d75f6[_0x5da0('0x3b')]);var _0x17c3c4=_0x5d75f6[_0x5da0('0x3a')];_0x17f719['adminEmail']=_0x5d75f6[_0x5da0('0x3d')];_0x17f719[_0x5da0('0x22')]=_0x155106[_0x5da0('0x3e')]()===_0x5da0('0x3f')?_0x2b287b[_0x5da0('0x40')]:_0x2b287b[_0x5da0('0x41')];_0x17f719['callDirection']=_0x155106==='queue'||_0x155106==='unmanaged'?_0x5da0('0x42'):_0x5da0('0x3f');if(_0x5e8f83){_0x17f719[_0x5da0('0x17')]=_0x5e8f83[_0x5da0('0xd')];}var _0x2008f9=util[_0x5da0('0x20')](_0x5da0('0x43'),_0x5d75f6[_0x5da0('0x3b')],_0x2b287b[_0x5da0('0x44')],md5(_0x2b287b[_0x5da0('0x44')]));if(_0x1a1036&&_0x1a1036[_0x5da0('0x45')]){logger['info']('[QUEUE]',_0x5da0('0x46'));_0x2b287b['recordingURL']=_0x2008f9;}else if(_0x123789&&_0x123789[_0x5da0('0x47')]&&_0x123789[_0x5da0('0x47')]!=='none'){logger[_0x5da0('0xa')](_0x5da0('0x48'),_0x5da0('0x46'));_0x2b287b[_0x5da0('0x49')]=_0x2008f9;}else{_0x2b287b[_0x5da0('0x49')]='';}return getAdminId(_0x17f719,_0x155106,_0x4aa862,_0x17c3c4)[_0x5da0('0x16')](getUser(_0x155106,_0x4aa862,_0x17c3c4))['then'](getEndUser(_0x155106,_0x4aa862,_0x17c3c4))[_0x5da0('0x16')](getTicket(_0x155106,_0x4aa862,_0x17c3c4,_0x521201,_0x2b287b))[_0x5da0('0x16')](function(_0x381abd){logger[_0x5da0('0xa')](util[_0x5da0('0x20')](_0x5da0('0x4a'),_0x381abd['ticketId']));if(_0x155106!=='unmanaged'){logger[_0x5da0('0xa')]('['+[_0x155106[_0x5da0('0x1d')]()]+']',_0x5da0('0x4b'));emit(_0x17c3c4,_0x5e8f83[_0x5da0('0x4c')],_0x381abd['endUserId']);}})[_0x5da0('0x12')](function(_0x310c86){logger['error']('['+[_0x155106[_0x5da0('0x1d')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x5da0('0x4d')](_0x310c86,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 125c5a5..e0b3e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98ef=['dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','desk','vtiger','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho'];(function(_0xdb3ac6,_0x410f86){var _0x3a5bff=function(_0x86511d){while(--_0x86511d){_0xdb3ac6['push'](_0xdb3ac6['shift']());}};_0x3a5bff(++_0x410f86);}(_0x98ef,0x178));var _0xf98e=function(_0x342202,_0x40d7bd){_0x342202=_0x342202-0x0;var _0x29518e=_0x98ef[_0x342202];return _0x29518e;};'use strict';var _=require(_0xf98e('0x0'));var util=require(_0xf98e('0x1'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0xf98e('0x2'));var freshdesk=require(_0xf98e('0x3'));var zoho=require(_0xf98e('0x4'));var desk=require('./desk');var vtiger=require(_0xf98e('0x5'));var servicenow=require(_0xf98e('0x6'));var dynamics365=require(_0xf98e('0x7'));var freshsales=require(_0xf98e('0x8'));var integrations=[_0xf98e('0x9'),_0xf98e('0xa'),_0xf98e('0xb'),_0xf98e('0xc'),_0xf98e('0xd'),'desk','vtiger',_0xf98e('0xe'),_0xf98e('0xf'),_0xf98e('0x10')];exports[_0xf98e('0x11')]=function(_0x49a386,_0x2adb05,_0x4ed2f1,_0x534162,_0x288371,_0x1fe67b){if(_0x4ed2f1){if(_[_0xf98e('0x12')](integrations,_0x49a386[_0xf98e('0x13')]['toLowerCase']())){try{var _0x5c936f=null;var _0x2f48e0='';var _0x52c6f9=_0x4ed2f1[_0x49a386[_0xf98e('0x13')][_0xf98e('0x14')]()];if(_0x52c6f9){var _0x18d831=_0x52c6f9[_0x49a386[_0xf98e('0x15')]];if(_0x18d831){var _0x319d67=_[_0xf98e('0x16')](_0x18d831[_0xf98e('0x17')],{'id':parseInt(_0x49a386[_0xf98e('0x18')],0xa)});if(_0x319d67){if(_0x534162){if(_0x288371&&_0x2adb05[_0xf98e('0x19')]){_0x2f48e0=_0xf98e('0x19');}else if(_0x2adb05[_0xf98e('0x1a')]){_0x2f48e0=_0xf98e('0x1b');}else{console[_0xf98e('0x1c')](_0xf98e('0x1d'),_0x2adb05);}}else{_0x2f48e0='unmanaged';}switch(_0x49a386[_0xf98e('0x13')][_0xf98e('0x14')]()){case _0xf98e('0x9'):zendesk[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case'salesforce':salesforce[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case _0xf98e('0xb'):sugarcrm[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case _0xf98e('0xc'):freshdesk[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case _0xf98e('0xd'):zoho[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case _0xf98e('0x1e'):desk[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case _0xf98e('0x1f'):vtiger[_0x2f48e0](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b);break;case _0xf98e('0xf'):freshsales['cs'](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b,_0x2f48e0);break;case _0xf98e('0x10'):servicenow['cs'](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b,_0x2f48e0);break;case _0xf98e('0xe'):dynamics365['cs'](_0x49a386,_0x2adb05,_0x319d67,_0x534162,_0x288371,_0x18d831,_0x1fe67b,_0x2f48e0);break;default:console[_0xf98e('0x1c')](_0xf98e('0x20'));}}else{_0x5c936f=require(_0xf98e('0x21'))(_0x49a386[_0xf98e('0x13')][_0xf98e('0x14')]());_0x5c936f[_0xf98e('0x22')]('[EXEC]',util[_0xf98e('0x23')](_0xf98e('0x24'),_0x49a386[_0xf98e('0x13')][_0xf98e('0x14')](),_0x49a386[_0xf98e('0x18')]));}}else{_0x5c936f=require(_0xf98e('0x21'))(_0x49a386['data1'][_0xf98e('0x14')]());_0x5c936f[_0xf98e('0x22')](_0xf98e('0x25'),util[_0xf98e('0x23')](_0xf98e('0x26'),_0x49a386['data1']['toLowerCase'](),_0x49a386[_0xf98e('0x15')]));}}else{}}catch(_0x3d374b){console[_0xf98e('0x22')](_0x3d374b);}}}};
\ No newline at end of file
+var _0x5895=['dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','freshdesk','zoho','desk'];(function(_0x3e32d6,_0x37c0bb){var _0x52af90=function(_0x185bc1){while(--_0x185bc1){_0x3e32d6['push'](_0x3e32d6['shift']());}};_0x52af90(++_0x37c0bb);}(_0x5895,0xcf));var _0x5589=function(_0x595d9d,_0x4c0c69){_0x595d9d=_0x595d9d-0x0;var _0x4175f2=_0x5895[_0x595d9d];return _0x4175f2;};'use strict';var _=require(_0x5589('0x0'));var util=require('util');var zendesk=require(_0x5589('0x1'));var salesforce=require(_0x5589('0x2'));var sugarcrm=require(_0x5589('0x3'));var freshdesk=require(_0x5589('0x4'));var zoho=require(_0x5589('0x5'));var desk=require(_0x5589('0x6'));var vtiger=require(_0x5589('0x7'));var servicenow=require(_0x5589('0x8'));var dynamics365=require(_0x5589('0x9'));var freshsales=require(_0x5589('0xa'));var integrations=['zendesk',_0x5589('0xb'),'sugarcrm',_0x5589('0xc'),_0x5589('0xd'),_0x5589('0xe'),'vtiger',_0x5589('0xf'),_0x5589('0x10'),_0x5589('0x11')];exports[_0x5589('0x12')]=function(_0x49b05d,_0x97d09a,_0x2c5c09,_0x587d27,_0x2a9d12,_0x107b2c){if(_0x2c5c09){if(_['includes'](integrations,_0x49b05d[_0x5589('0x13')]['toLowerCase']())){try{var _0x588e30=null;var _0x4a09b0='';var _0x5f00bd=_0x2c5c09[_0x49b05d[_0x5589('0x13')][_0x5589('0x14')]()];if(_0x5f00bd){var _0x9d4459=_0x5f00bd[_0x49b05d[_0x5589('0x15')]];if(_0x9d4459){var _0x506de5=_['find'](_0x9d4459['Configurations'],{'id':parseInt(_0x49b05d[_0x5589('0x16')],0xa)});if(_0x506de5){if(_0x587d27){if(_0x2a9d12&&_0x97d09a[_0x5589('0x17')]){_0x4a09b0=_0x5589('0x17');}else if(_0x97d09a[_0x5589('0x18')]){_0x4a09b0=_0x5589('0x19');}else{console[_0x5589('0x1a')](_0x5589('0x1b'),_0x97d09a);}}else{_0x4a09b0=_0x5589('0x1c');}switch(_0x49b05d['data1']['toLowerCase']()){case'zendesk':zendesk[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xb'):salesforce[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0x1d'):sugarcrm[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xc'):freshdesk[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xd'):zoho[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0xe'):desk[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case'vtiger':vtiger[_0x4a09b0](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c);break;case _0x5589('0x10'):freshsales['cs'](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c,_0x4a09b0);break;case _0x5589('0x11'):servicenow['cs'](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c,_0x4a09b0);break;case'dynamics365':dynamics365['cs'](_0x49b05d,_0x97d09a,_0x506de5,_0x587d27,_0x2a9d12,_0x9d4459,_0x107b2c,_0x4a09b0);break;default:console['log'](_0x5589('0x1e'));}}else{_0x588e30=require(_0x5589('0x1f'))(_0x49b05d['data1'][_0x5589('0x14')]());_0x588e30[_0x5589('0x20')]('[EXEC]',util[_0x5589('0x21')](_0x5589('0x22'),_0x49b05d[_0x5589('0x13')]['toLowerCase'](),_0x49b05d[_0x5589('0x16')]));}}else{_0x588e30=require(_0x5589('0x1f'))(_0x49b05d[_0x5589('0x13')][_0x5589('0x14')]());_0x588e30['error'](_0x5589('0x23'),util[_0x5589('0x21')](_0x5589('0x24'),_0x49b05d[_0x5589('0x13')][_0x5589('0x14')](),_0x49b05d[_0x5589('0x15')]));}}else{}}catch(_0x2abcf6){console['error'](_0x2abcf6);}}}};
\ No newline at end of file
index 30ea518..32ee3c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f0a=['login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Fields','trigger:salesforce:display','trigger:browser:url','catch','unmanaged','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','jsforce','util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','User','find','then','length','Email','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','resolve','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','$or','Contact','execute','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','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','No\x20Company','upperFirst','create','forEach','includes','string','picklist','idField','variable','variableName','toString','customVariable','Variable','name','password','securityToken','Connection','remoteUri','clientId','clientSecret'];(function(_0x41b4df,_0x15b067){var _0x55d4dc=function(_0x43e391){while(--_0x43e391){_0x41b4df['push'](_0x41b4df['shift']());}};_0x55d4dc(++_0x15b067);}(_0x7f0a,0x196));var _0xa7f0=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7f0a[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var rp=require(_0xa7f0('0x0'));var moment=require(_0xa7f0('0x1'));var BPromise=require(_0xa7f0('0x2'));var md5=require('md5');var jsforce=require(_0xa7f0('0x3'));var util=require(_0xa7f0('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xa7f0('0x5'));var logger=require(_0xa7f0('0x6'))('salesforce');config[_0xa7f0('0x7')]=_[_0xa7f0('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa7f0('0x9'))(new Redis(config['redis']));function emit(_0x48b9ca,_0x5695c4,_0x630d31){io['to'](_0x48b9ca)[_0xa7f0('0xa')](_0x5695c4,_0x630d31);}function getTicket(_0x3ff05f,_0x14c9bd,_0x5a3d04,_0x5b6aa2,_0x2aa130,_0x5147e5,_0x1a9771,_0x5c9871){var _0x59dfc1=Object[_0xa7f0('0xb')]({},{'OwnerId':_0x14c9bd['id'],'Subject':intUtil[_0xa7f0('0xc')](_0x5b6aa2['Subjects'],_0x2aa130,'\x20'),'Description':intUtil[_0xa7f0('0xc')](_0x5b6aa2[_0xa7f0('0xd')],_0x2aa130,'\x0a')},getCustomFields(_0x5147e5,_0x2aa130));if(_0x5a3d04){if(_0x5b6aa2[_0xa7f0('0xe')]==='Task'){_0x59dfc1['ActivityDate']=moment['utc']();_0x59dfc1[_0xa7f0('0xf')]=![];_0x59dfc1[_0xa7f0('0x10')]=![];if(_0x5a3d04[_0xa7f0('0x11')]===_0xa7f0('0x12')||_0x5a3d04[_0xa7f0('0x11')]==='lead'){_0x59dfc1[_0xa7f0('0x13')]=_0x5a3d04['id'];}else if(_0x5a3d04[_0xa7f0('0x11')]===_0xa7f0('0x14')){_0x59dfc1['WhatId']=_0x5a3d04['id'];}}else if(_0x5b6aa2[_0xa7f0('0xe')]==='Case'){if(_0x5a3d04[_0xa7f0('0x11')]===_0xa7f0('0x12')){_0x59dfc1[_0xa7f0('0x15')]=_0x5a3d04['id'];}else if(_0x5a3d04[_0xa7f0('0x11')]==='account'){_0x59dfc1['AccountId']=_0x5a3d04['id'];}else if(_0x5a3d04[_0xa7f0('0x11')]===_0xa7f0('0x16')&&_0x5b6aa2[_0xa7f0('0x17')]){_0x59dfc1[_0x5b6aa2[_0xa7f0('0x17')]]=_0x5a3d04['id'];}else{logger[_0xa7f0('0x18')](_0xa7f0('0x19'));}}}return _0x1a9771['sobject'](_0x5b6aa2[_0xa7f0('0xe')])['create'](_0x59dfc1);}function getUser(_0x40494a,_0x56259b,_0x234115){if(!_[_0xa7f0('0x1a')](_0x56259b)&&intUtil[_0xa7f0('0x1b')](_0x56259b)){var _0x23265e={'Email':_0x56259b};var _0x40a2e9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x234115[_0xa7f0('0x1c')](_0xa7f0('0x1d'))[_0xa7f0('0x1e')](_0x23265e,_0x40a2e9)['execute']()[_0xa7f0('0x1f')](function(_0x14f5c5){if(_0x14f5c5[_0xa7f0('0x20')]){var _0x3e8d22=_['find'](_0x14f5c5,function(_0x1620ec){return _0x1620ec[_0xa7f0('0x21')]===_0x56259b;});if(_0x3e8d22){logger['info']('Agent\x20%s\x20found.',_0x56259b);return BPromise['resolve']({'id':_0x3e8d22['Id'],'name':_0x3e8d22[_0xa7f0('0x22')]});}}else{logger[_0xa7f0('0x18')](_0xa7f0('0x23'),_0x56259b);return _0x234115[_0xa7f0('0x24')]()[_0xa7f0('0x1f')](function(_0x4b4a8c){return BPromise['resolve']({'id':_0x4b4a8c[_0xa7f0('0x25')],'name':_0x4b4a8c['display_name']});});}});}else{logger[_0xa7f0('0x18')](_0xa7f0('0x23'),_0x56259b);return _0x234115[_0xa7f0('0x24')]()[_0xa7f0('0x1f')](function(_0x33a172){return BPromise[_0xa7f0('0x26')]({'id':_0x33a172['user_id'],'name':_0x33a172[_0xa7f0('0x27')]});});}}function getEndUser(_0x20021c,_0x5cefb6,_0x15dc63,_0x5157b8,_0x2f7faf){var _0x115a04={'$or':{'Phone':_0x5157b8}};var _0x2dc783={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa7f0('0x26')]()['then'](function(){logger[_0xa7f0('0x18')](_0xa7f0('0x28'),_0x5157b8,_0x5cefb6[_0xa7f0('0x29')]);switch(_0x5cefb6['moduleSearch']){case'contact_lead':var _0x40cb92=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6[_0xa7f0('0x2b')]){var _0x3d9dc5={};_0x3d9dc5[_0x5cefb6['additionalSearchContact']]=_0x5157b8;_['merge'](_0x40cb92[_0xa7f0('0x2c')],_0x3d9dc5);}return _0x2f7faf[_0xa7f0('0x1c')](_0xa7f0('0x2d'))['find'](_0x40cb92,_0x2dc783)[_0xa7f0('0x2e')]()[_0xa7f0('0x1f')](function(_0x519ca0){if(_0x519ca0&&_0x519ca0[_0xa7f0('0x20')]){return _0x519ca0;}else{var _0x3145f2=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6[_0xa7f0('0x2f')]){var _0x2b959c={};_0x2b959c[_0x5cefb6[_0xa7f0('0x2f')]]=_0x5157b8;_[_0xa7f0('0x30')](_0x3145f2['$or'],_0x2b959c);}return _0x2f7faf[_0xa7f0('0x1c')](_0xa7f0('0x31'))[_0xa7f0('0x1e')](_0x3145f2,_0x2dc783);}});case _0xa7f0('0x32'):var _0x2d5cf7=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6[_0xa7f0('0x33')]){var _0x3d9dc5={};_0x3d9dc5[_0x5cefb6[_0xa7f0('0x33')]]=_0x5157b8;_[_0xa7f0('0x30')](_0x2d5cf7[_0xa7f0('0x2c')],_0x3d9dc5);}return _0x2f7faf['sobject'](_0xa7f0('0x34'))[_0xa7f0('0x1e')](_0x2d5cf7,_0x2dc783)[_0xa7f0('0x2e')]()['then'](function(_0x58a8dc){if(_0x58a8dc&&_0x58a8dc[_0xa7f0('0x20')]){return _0x58a8dc;}else{var _0x414b92=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6['additionalSearchContact']){var _0x5d83d2={};_0x5d83d2[_0x5cefb6[_0xa7f0('0x2b')]]=_0x5157b8;_[_0xa7f0('0x30')](_0x414b92['$or'],_0x5d83d2);}return _0x2f7faf[_0xa7f0('0x1c')](_0xa7f0('0x2d'))[_0xa7f0('0x1e')](_0x414b92,_0x2dc783)[_0xa7f0('0x1f')](function(_0x20e106){if(_0x20e106&&_0x20e106['length']){return _0x20e106;}else{var _0x2bf4f8=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6[_0xa7f0('0x2f')]){var _0x33f48e={};_0x33f48e[_0x5cefb6['additionalSearchLead']]=_0x5157b8;_[_0xa7f0('0x30')](_0x2bf4f8[_0xa7f0('0x2c')],_0x33f48e);}return _0x2f7faf['sobject'](_0xa7f0('0x31'))[_0xa7f0('0x1e')](_0x2bf4f8,_0x2dc783);}});}});case _0xa7f0('0x12'):var _0x40cb92=_['cloneDeep'](_0x115a04);if(_0x5cefb6[_0xa7f0('0x2b')]){var _0x3d9dc5={};_0x3d9dc5[_0x5cefb6[_0xa7f0('0x2b')]]=_0x5157b8;_[_0xa7f0('0x30')](_0x40cb92['$or'],_0x3d9dc5);}return _0x2f7faf[_0xa7f0('0x1c')](_0xa7f0('0x2d'))[_0xa7f0('0x1e')](_0x40cb92,_0x2dc783)[_0xa7f0('0x2e')]();case _0xa7f0('0x16'):var _0x48484d=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6[_0xa7f0('0x2f')]){var _0x3d9dc5={};_0x3d9dc5[_0x5cefb6[_0xa7f0('0x2f')]]=_0x5157b8;_['merge'](_0x48484d[_0xa7f0('0x2c')],_0x3d9dc5);}return _0x2f7faf[_0xa7f0('0x1c')](_0xa7f0('0x31'))['find'](_0x48484d,_0x2dc783);case _0xa7f0('0x14'):var _0x2d5cf7=_[_0xa7f0('0x2a')](_0x115a04);if(_0x5cefb6[_0xa7f0('0x33')]){var _0x3d9dc5={};_0x3d9dc5[_0x5cefb6['additionalSearchAccount']]=_0x5157b8;_[_0xa7f0('0x30')](_0x2d5cf7[_0xa7f0('0x2c')],_0x3d9dc5);}return _0x2f7faf['sobject'](_0xa7f0('0x34'))['find'](_0x2d5cf7,_0x2dc783);default:return null;}})['then'](function(_0x33bacb){if(_0x33bacb&&_0x33bacb[_0xa7f0('0x20')]){var _0x3e42f2=_[_0xa7f0('0x35')](_0x33bacb);if(_0x3e42f2){return BPromise['resolve']({'id':_0x3e42f2['Id'],'name':_0x3e42f2[_0xa7f0('0x22')],'phone':_0x3e42f2[_0xa7f0('0x36')],'endUserType':_0x3e42f2[_0xa7f0('0x37')][_0xa7f0('0x38')][_0xa7f0('0x39')]()});}}})[_0xa7f0('0x1f')](function(_0x1091da){if(_0x1091da){logger[_0xa7f0('0x18')](_0xa7f0('0x3a'),_0x1091da[_0xa7f0('0x11')],_0x5157b8);return BPromise[_0xa7f0('0x26')](_0x1091da);}else{logger[_0xa7f0('0x18')](_0xa7f0('0x3b'),_0x5157b8);var _0x50befe={'Phone':_0x5157b8};if(_0x5cefb6[_0xa7f0('0x3c')]){if(_0x5cefb6['moduleCreate']===_0xa7f0('0x12')){logger[_0xa7f0('0x18')](_0xa7f0('0x3d'),_0x5157b8,_0x5cefb6[_0xa7f0('0x3c')]);_0x50befe[_0xa7f0('0x3e')]=_0x15dc63!==_0xa7f0('0x3f')?_0x15dc63:util[_0xa7f0('0x40')]('Caller\x20-\x20%s',_0x5157b8);}else if(_0x5cefb6[_0xa7f0('0x3c')]===_0xa7f0('0x16')){logger[_0xa7f0('0x18')](_0xa7f0('0x3d'),_0x5157b8,_0x5cefb6[_0xa7f0('0x3c')]);_0x50befe['LastName']=_0x15dc63!=='<unknown>'?_0x15dc63:util['format'](_0xa7f0('0x41'),_0x5157b8);_0x50befe['Company']=_0xa7f0('0x42');}else if(_0x5cefb6[_0xa7f0('0x3c')]===_0xa7f0('0x14')){logger[_0xa7f0('0x18')](_0xa7f0('0x3d'),_0x5157b8,_0x5cefb6[_0xa7f0('0x3c')]);_0x50befe[_0xa7f0('0x22')]=_0x15dc63!==_0xa7f0('0x3f')?_0x15dc63:util[_0xa7f0('0x40')](_0xa7f0('0x41'),_0x5157b8);}else{return null;}}return _0x2f7faf[_0xa7f0('0x1c')](_[_0xa7f0('0x43')](_0x5cefb6[_0xa7f0('0x3c')]))[_0xa7f0('0x44')](_0x50befe)[_0xa7f0('0x1f')](function(_0x1bd09e){return BPromise['resolve']({'id':_0x1bd09e['id'],'endUserType':_0x5cefb6[_0xa7f0('0x3c')]});});}});}function getCustomFields(_0xce5ef0,_0x31c962){var _0x376607={};if(_0xce5ef0[_0xa7f0('0x20')]>0x0){_[_0xa7f0('0x45')](_0xce5ef0,function(_0x1b70f2){if(_[_0xa7f0('0x46')]([_0xa7f0('0x47'),_0xa7f0('0x48')],_0x1b70f2[_0xa7f0('0x38')])&&_0x1b70f2['idField']){_0x376607[_0x1b70f2[_0xa7f0('0x49')]]=_0x1b70f2['content']['toString']();}else if(_0x1b70f2['type']===_0xa7f0('0x4a')&&_0x1b70f2['variableName']&&_0x1b70f2[_0xa7f0('0x49')]){_0x31c962[_0x1b70f2[_0xa7f0('0x4b')]]&&(_0x376607[_0x1b70f2['idField']]=_0x31c962[_0x1b70f2[_0xa7f0('0x4b')]][_0xa7f0('0x4c')]());}else if(_0x1b70f2[_0xa7f0('0x38')]===_0xa7f0('0x4d')&&_0x1b70f2[_0xa7f0('0x4e')]&&_0x1b70f2[_0xa7f0('0x4e')]['name']&&_0x1b70f2[_0xa7f0('0x49')]){_0x31c962[_0x1b70f2[_0xa7f0('0x4e')][_0xa7f0('0x4f')][_0xa7f0('0x39')]()]&&(_0x376607[_0x1b70f2[_0xa7f0('0x49')]]=_0x31c962[_0x1b70f2[_0xa7f0('0x4e')][_0xa7f0('0x4f')][_0xa7f0('0x39')]()][_0xa7f0('0x4c')]());}});}return _0x376607;}function getConnection(_0xd576b5){var _0x77812a=_0xd576b5[_0xa7f0('0x50')]['concat'](_0xd576b5[_0xa7f0('0x51')]);var _0x221155=new jsforce[(_0xa7f0('0x52'))]({'oauth2':{'loginUrl':_0xd576b5[_0xa7f0('0x53')]||'https://login.salesforce.com','clientId':_0xd576b5[_0xa7f0('0x54')],'clientSecret':_0xd576b5[_0xa7f0('0x55')]}});return _0x221155[_0xa7f0('0x56')](_0xd576b5[_0xa7f0('0x57')],_0x77812a)['then'](function(){logger['info'](_0xa7f0('0x58'));return _0x221155;});}exports[_0xa7f0('0x59')]=function(_0x29973a,_0x46d535,_0x5f4fb6,_0x297717,_0x28289e,_0x46439f){var _0x3dbe12,_0x3931b5,_0x140f1b,_0x5464e9;_0x46439f[_0xa7f0('0x5a')]=intUtil['stripTrailingSlash'](_0x46439f[_0xa7f0('0x5a')]);_0x46439f[_0xa7f0('0x53')]=intUtil[_0xa7f0('0x5b')](_0x46439f[_0xa7f0('0x53')]);if(_0x28289e&&_0x28289e[_0xa7f0('0x5c')]){logger[_0xa7f0('0x18')](_0xa7f0('0x5d'),'Recording\x20is\x20enabled!');_0x46d535['recordingURL']=util[_0xa7f0('0x40')](_0xa7f0('0x5e'),_0x46439f[_0xa7f0('0x5a')],_0x46d535[_0xa7f0('0x5f')],md5(_0x46d535[_0xa7f0('0x5f')]));}else{_0x46d535[_0xa7f0('0x60')]='';}return getConnection(_0x46439f)['then'](function(_0xb72c6d){_0x5464e9=_0xb72c6d;return getUser(_0x46439f,_0x297717[_0xa7f0('0x61')],_0x5464e9);})['then'](function(_0xfcdf5){_0x3dbe12=_0xfcdf5;return getEndUser(_0x46439f,_0x5f4fb6,_0x46d535['calleridname'],_0x46d535[_0xa7f0('0x62')],_0x5464e9);})[_0xa7f0('0x1f')](function(_0x4c731b){_0x3931b5=_0x4c731b;return getTicket(_0x46439f,_0x3dbe12,_0x3931b5,_0x5f4fb6,_0x46d535,_0x5f4fb6['Fields'],_0x5464e9,_0xa7f0('0x59'));})[_0xa7f0('0x1f')](function(_0xabfa39){_0x140f1b=_0xabfa39;logger[_0xa7f0('0x18')](_0xa7f0('0x63'),_0x140f1b['id']);logger[_0xa7f0('0x18')](_0xa7f0('0x64'),_0x140f1b['id'],_0x297717[_0xa7f0('0x4f')],_0x46439f[_0xa7f0('0x38')]);switch(_0x46439f['type']){case'integrationTab':emit(util['format'](_0xa7f0('0x65'),_0x297717['name']),'trigger:salesforce:display',{'recordId':_0x140f1b['id']});break;case _0xa7f0('0x66'):emit(util[_0xa7f0('0x40')]('user:%s',_0x297717[_0xa7f0('0x4f')]),'trigger:browser:url',{'uri':util[_0xa7f0('0x40')](_0xa7f0('0x67'),_0x5464e9[_0xa7f0('0x68')],_0x140f1b['id'])});break;default:logger[_0xa7f0('0x69')](_0xa7f0('0x6a'));}})['catch'](function(_0x2e5329){logger[_0xa7f0('0x69')](_0xa7f0('0x5d'),_0x2e5329);});};exports[_0xa7f0('0x6b')]=function(_0x463501,_0x1ee9d0,_0x414241,_0x80c6c4,_0x3ca17f,_0x15ad8d,_0x4879a5){var _0x50c92b,_0x2233b3,_0x417963,_0x5e30a1;_0x15ad8d[_0xa7f0('0x5a')]=intUtil[_0xa7f0('0x5b')](_0x15ad8d['serverUrl']);_0x15ad8d['remoteUri']=intUtil[_0xa7f0('0x5b')](_0x15ad8d[_0xa7f0('0x53')]);if(_0x4879a5&&_0x4879a5[_0xa7f0('0x6c')]&&_0x4879a5[_0xa7f0('0x6c')]!==_0xa7f0('0x6d')){logger[_0xa7f0('0x18')](_0xa7f0('0x6e'),_0xa7f0('0x6f'));_0x1ee9d0[_0xa7f0('0x60')]=util['format'](_0xa7f0('0x5e'),_0x15ad8d[_0xa7f0('0x5a')],_0x1ee9d0[_0xa7f0('0x5f')],md5(_0x1ee9d0['uniqueid']));}return getConnection(_0x15ad8d)[_0xa7f0('0x1f')](function(_0x307002){_0x5e30a1=_0x307002;return getUser(_0x15ad8d,_0x80c6c4[_0xa7f0('0x61')],_0x5e30a1);})[_0xa7f0('0x1f')](function(_0x48a282){_0x50c92b=_0x48a282;return getEndUser(_0x15ad8d,_0x414241,_0x1ee9d0[_0xa7f0('0x70')],_0x1ee9d0['destcalleridnum'],_0x5e30a1);})[_0xa7f0('0x1f')](function(_0xd4c893){_0x2233b3=_0xd4c893;return getTicket(_0x15ad8d,_0x50c92b,_0x2233b3,_0x414241,_0x1ee9d0,_0x414241[_0xa7f0('0x71')],_0x5e30a1,_0xa7f0('0x6b'));})['then'](function(_0x21f3f3){_0x417963=_0x21f3f3;logger[_0xa7f0('0x18')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x417963['id']);logger[_0xa7f0('0x18')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x417963['id'],_0x80c6c4[_0xa7f0('0x4f')],_0x15ad8d[_0xa7f0('0x38')]);switch(_0x15ad8d['type']){case'integrationTab':emit(util['format'](_0xa7f0('0x65'),_0x80c6c4['name']),_0xa7f0('0x72'),{'recordId':_0x417963['id']});break;case _0xa7f0('0x66'):emit(util[_0xa7f0('0x40')]('user:%s',_0x80c6c4[_0xa7f0('0x4f')]),_0xa7f0('0x73'),{'uri':util[_0xa7f0('0x40')](_0xa7f0('0x67'),_0x5e30a1[_0xa7f0('0x68')],_0x417963['id'])});break;default:logger[_0xa7f0('0x69')](_0xa7f0('0x6e'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xa7f0('0x74')](function(_0xeec96a){logger[_0xa7f0('0x69')](_0xa7f0('0x6e'),_0xeec96a);});};exports[_0xa7f0('0x75')]=function(_0x40aa82,_0x3becfa,_0x411038,_0x5eb614,_0x970ea5,_0x499517){var _0xc13a99,_0x2f3eed,_0x28fceb,_0x2210c0;_0x499517['serverUrl']=intUtil[_0xa7f0('0x5b')](_0x499517[_0xa7f0('0x5a')]);_0x499517['remoteUri']=intUtil[_0xa7f0('0x5b')](_0x499517[_0xa7f0('0x53')]);if(_0x970ea5&&_0x970ea5['monitor_format']){logger[_0xa7f0('0x18')]('['+_0x3becfa[_0xa7f0('0x76')][_0xa7f0('0x77')]()+']',_0xa7f0('0x6f'));_0x3becfa[_0xa7f0('0x60')]=util[_0xa7f0('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x499517['serverUrl'],_0x3becfa[_0xa7f0('0x5f')],md5(_0x3becfa[_0xa7f0('0x5f')]));}else{_0x3becfa[_0xa7f0('0x60')]='';}return getConnection(_0x499517)[_0xa7f0('0x1f')](function(_0x39f0c5){_0x2210c0=_0x39f0c5;if(!_[_0xa7f0('0x1a')](_0x5eb614)){return getUser(_0x499517,_0x5eb614[_0xa7f0('0x4f')],_0x2210c0);}else{return getUser(_0x499517,null,_0x2210c0);}})[_0xa7f0('0x1f')](function(_0x34ef8e){_0xc13a99=_0x34ef8e;return getEndUser(_0x499517,_0x411038,_0x3becfa[_0xa7f0('0x78')],_0x3becfa[_0xa7f0('0x62')],_0x2210c0);})[_0xa7f0('0x1f')](function(_0x149bdc){_0x2f3eed=_0x149bdc;return getTicket(_0x499517,_0xc13a99,_0x2f3eed,_0x411038,_0x3becfa,_0x411038[_0xa7f0('0x71')],_0x2210c0);})[_0xa7f0('0x1f')](function(_0x31fe45){_0x28fceb=_0x31fe45;logger[_0xa7f0('0x18')]('['+_0x3becfa[_0xa7f0('0x76')][_0xa7f0('0x77')]()+_0xa7f0('0x79'),_0x28fceb['id']);logger[_0xa7f0('0x18')]('['+_0x3becfa[_0xa7f0('0x76')][_0xa7f0('0x77')]()+_0xa7f0('0x7a'),_0x499517[_0xa7f0('0x38')]);})[_0xa7f0('0x74')](function(_0x3a7057){logger[_0xa7f0('0x69')]('['+_0x3becfa[_0xa7f0('0x76')]['toUpperCase']()+']',_0x3a7057);});};
\ No newline at end of file
+var _0xed7f=['display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','$or','Account','execute','first','Name','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','<unknown>','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','create','forEach','idField','content','toString','variable','customVariable','Variable','name','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','Subjects','getString','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','then','length','find','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xed7f,0x13c));var _0xfed7=function(_0x401a04,_0x27cd04){_0x401a04=_0x401a04-0x0;var _0x469676=_0xed7f[_0x401a04];return _0x469676;};'use strict';var _=require(_0xfed7('0x0'));var rp=require(_0xfed7('0x1'));var moment=require(_0xfed7('0x2'));var BPromise=require(_0xfed7('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require('util');var Redis=require(_0xfed7('0x4'));var intUtil=require(_0xfed7('0x5'));var config=require('../../../../config/environment');var logger=require(_0xfed7('0x6'))(_0xfed7('0x7'));config[_0xfed7('0x8')]=_['defaults'](config[_0xfed7('0x8')],{'host':_0xfed7('0x9'),'port':0x18eb});var io=require(_0xfed7('0xa'))(new Redis(config[_0xfed7('0x8')]));function emit(_0x4f70ad,_0x594e49,_0x202a3a){io['to'](_0x4f70ad)[_0xfed7('0xb')](_0x594e49,_0x202a3a);}function getTicket(_0x27e4c5,_0x2badb8,_0x909bbc,_0xbc3685,_0x2a3573,_0x5c2b45,_0x4774d1,_0x184c47){var _0x3e80f6=Object[_0xfed7('0xc')]({},{'OwnerId':_0x2badb8['id'],'Subject':intUtil['getString'](_0xbc3685[_0xfed7('0xd')],_0x2a3573,'\x20'),'Description':intUtil[_0xfed7('0xe')](_0xbc3685['Descriptions'],_0x2a3573,'\x0a')},getCustomFields(_0x5c2b45,_0x2a3573));if(_0x909bbc){if(_0xbc3685[_0xfed7('0xf')]==='Task'){_0x3e80f6[_0xfed7('0x10')]=moment[_0xfed7('0x11')]();_0x3e80f6[_0xfed7('0x12')]=![];_0x3e80f6[_0xfed7('0x13')]=![];if(_0x909bbc[_0xfed7('0x14')]===_0xfed7('0x15')||_0x909bbc[_0xfed7('0x14')]===_0xfed7('0x16')){_0x3e80f6[_0xfed7('0x17')]=_0x909bbc['id'];}else if(_0x909bbc['endUserType']===_0xfed7('0x18')){_0x3e80f6[_0xfed7('0x19')]=_0x909bbc['id'];}}else if(_0xbc3685[_0xfed7('0xf')]==='Case'){if(_0x909bbc['endUserType']===_0xfed7('0x15')){_0x3e80f6[_0xfed7('0x1a')]=_0x909bbc['id'];}else if(_0x909bbc[_0xfed7('0x14')]===_0xfed7('0x18')){_0x3e80f6['AccountId']=_0x909bbc['id'];}else if(_0x909bbc['endUserType']==='lead'&&_0xbc3685[_0xfed7('0x1b')]){_0x3e80f6[_0xbc3685[_0xfed7('0x1b')]]=_0x909bbc['id'];}else{logger[_0xfed7('0x1c')](_0xfed7('0x1d'));}}}return _0x4774d1[_0xfed7('0x1e')](_0xbc3685[_0xfed7('0xf')])['create'](_0x3e80f6);}function getUser(_0x5dd434,_0x1d629c,_0x54329f){if(!_['isNil'](_0x1d629c)&&intUtil[_0xfed7('0x1f')](_0x1d629c)){var _0x51f5cb={'Email':_0x1d629c};var _0x4bd2c6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x54329f[_0xfed7('0x1e')]('User')['find'](_0x51f5cb,_0x4bd2c6)['execute']()[_0xfed7('0x20')](function(_0x278cde){if(_0x278cde[_0xfed7('0x21')]){var _0x44197d=_[_0xfed7('0x22')](_0x278cde,function(_0x58a3a3){return _0x58a3a3[_0xfed7('0x23')]===_0x1d629c;});if(_0x44197d){logger['info'](_0xfed7('0x24'),_0x1d629c);return BPromise[_0xfed7('0x25')]({'id':_0x44197d['Id'],'name':_0x44197d['Name']});}}else{logger['info'](_0xfed7('0x26'),_0x1d629c);return _0x54329f[_0xfed7('0x27')]()[_0xfed7('0x20')](function(_0x529b3d){return BPromise[_0xfed7('0x25')]({'id':_0x529b3d[_0xfed7('0x28')],'name':_0x529b3d[_0xfed7('0x29')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1d629c);return _0x54329f[_0xfed7('0x27')]()[_0xfed7('0x20')](function(_0x164a6d){return BPromise['resolve']({'id':_0x164a6d[_0xfed7('0x28')],'name':_0x164a6d['display_name']});});}}function getEndUser(_0x361221,_0x38af04,_0x166f01,_0x4c6994,_0x3af541){var _0x9d9a60={'$or':{'Phone':_0x4c6994}};var _0x27b173={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xfed7('0x20')](function(){logger[_0xfed7('0x1c')](_0xfed7('0x2a'),_0x4c6994,_0x38af04['moduleSearch']);switch(_0x38af04[_0xfed7('0x2b')]){case _0xfed7('0x2c'):var _0x181882=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x2e')]){var _0x5026cd={};_0x5026cd[_0x38af04['additionalSearchContact']]=_0x4c6994;_[_0xfed7('0x2f')](_0x181882['$or'],_0x5026cd);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x30'))[_0xfed7('0x22')](_0x181882,_0x27b173)['execute']()['then'](function(_0x526a72){if(_0x526a72&&_0x526a72['length']){return _0x526a72;}else{var _0x4b4cba=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x31')]){var _0x482ab6={};_0x482ab6[_0x38af04[_0xfed7('0x31')]]=_0x4c6994;_['merge'](_0x4b4cba['$or'],_0x482ab6);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x32'))['find'](_0x4b4cba,_0x27b173);}});case _0xfed7('0x33'):var _0x7b295b=_['cloneDeep'](_0x9d9a60);if(_0x38af04[_0xfed7('0x34')]){var _0x5026cd={};_0x5026cd[_0x38af04[_0xfed7('0x34')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x7b295b[_0xfed7('0x35')],_0x5026cd);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x36'))[_0xfed7('0x22')](_0x7b295b,_0x27b173)[_0xfed7('0x37')]()[_0xfed7('0x20')](function(_0x344383){if(_0x344383&&_0x344383['length']){return _0x344383;}else{var _0x33eeb1=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x2e')]){var _0x27df9e={};_0x27df9e[_0x38af04[_0xfed7('0x2e')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x33eeb1[_0xfed7('0x35')],_0x27df9e);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x30'))[_0xfed7('0x22')](_0x33eeb1,_0x27b173)[_0xfed7('0x20')](function(_0x38c833){if(_0x38c833&&_0x38c833[_0xfed7('0x21')]){return _0x38c833;}else{var _0x254452=_['cloneDeep'](_0x9d9a60);if(_0x38af04['additionalSearchLead']){var _0xc26349={};_0xc26349[_0x38af04[_0xfed7('0x31')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x254452[_0xfed7('0x35')],_0xc26349);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x32'))[_0xfed7('0x22')](_0x254452,_0x27b173);}});}});case _0xfed7('0x15'):var _0x181882=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x2e')]){var _0x5026cd={};_0x5026cd[_0x38af04[_0xfed7('0x2e')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x181882[_0xfed7('0x35')],_0x5026cd);}return _0x3af541[_0xfed7('0x1e')](_0xfed7('0x30'))[_0xfed7('0x22')](_0x181882,_0x27b173)[_0xfed7('0x37')]();case _0xfed7('0x16'):var _0x106153=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04['additionalSearchLead']){var _0x5026cd={};_0x5026cd[_0x38af04[_0xfed7('0x31')]]=_0x4c6994;_[_0xfed7('0x2f')](_0x106153[_0xfed7('0x35')],_0x5026cd);}return _0x3af541['sobject']('Lead')['find'](_0x106153,_0x27b173);case _0xfed7('0x18'):var _0x7b295b=_[_0xfed7('0x2d')](_0x9d9a60);if(_0x38af04[_0xfed7('0x34')]){var _0x5026cd={};_0x5026cd[_0x38af04['additionalSearchAccount']]=_0x4c6994;_['merge'](_0x7b295b[_0xfed7('0x35')],_0x5026cd);}return _0x3af541['sobject']('Account')[_0xfed7('0x22')](_0x7b295b,_0x27b173);default:return null;}})[_0xfed7('0x20')](function(_0x51a0b8){if(_0x51a0b8&&_0x51a0b8[_0xfed7('0x21')]){var _0x546c21=_[_0xfed7('0x38')](_0x51a0b8);if(_0x546c21){return BPromise[_0xfed7('0x25')]({'id':_0x546c21['Id'],'name':_0x546c21[_0xfed7('0x39')],'phone':_0x546c21['Phone'],'endUserType':_0x546c21[_0xfed7('0x3a')][_0xfed7('0x3b')]['toLowerCase']()});}}})[_0xfed7('0x20')](function(_0x184552){if(_0x184552){logger[_0xfed7('0x1c')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x184552['endUserType'],_0x4c6994);return BPromise['resolve'](_0x184552);}else{logger[_0xfed7('0x1c')](_0xfed7('0x3c'),_0x4c6994);var _0x1233d5={'Phone':_0x4c6994};if(_0x38af04[_0xfed7('0x3d')]){if(_0x38af04[_0xfed7('0x3d')]===_0xfed7('0x15')){logger[_0xfed7('0x1c')](_0xfed7('0x3e'),_0x4c6994,_0x38af04[_0xfed7('0x3d')]);_0x1233d5['LastName']=_0x166f01!==_0xfed7('0x3f')?_0x166f01:util[_0xfed7('0x40')](_0xfed7('0x41'),_0x4c6994);}else if(_0x38af04[_0xfed7('0x3d')]===_0xfed7('0x16')){logger[_0xfed7('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4c6994,_0x38af04[_0xfed7('0x3d')]);_0x1233d5[_0xfed7('0x42')]=_0x166f01!==_0xfed7('0x3f')?_0x166f01:util[_0xfed7('0x40')](_0xfed7('0x41'),_0x4c6994);_0x1233d5[_0xfed7('0x43')]=_0xfed7('0x44');}else if(_0x38af04[_0xfed7('0x3d')]===_0xfed7('0x18')){logger['info'](_0xfed7('0x3e'),_0x4c6994,_0x38af04[_0xfed7('0x3d')]);_0x1233d5['Name']=_0x166f01!==_0xfed7('0x3f')?_0x166f01:util[_0xfed7('0x40')](_0xfed7('0x41'),_0x4c6994);}else{return null;}}return _0x3af541[_0xfed7('0x1e')](_['upperFirst'](_0x38af04['moduleCreate']))[_0xfed7('0x45')](_0x1233d5)[_0xfed7('0x20')](function(_0x2ddf53){return BPromise['resolve']({'id':_0x2ddf53['id'],'endUserType':_0x38af04['moduleCreate']});});}});}function getCustomFields(_0x4e3a2c,_0x3289cd){var _0x30f566={};if(_0x4e3a2c[_0xfed7('0x21')]>0x0){_[_0xfed7('0x46')](_0x4e3a2c,function(_0x134b67){if(_['includes'](['string','picklist'],_0x134b67[_0xfed7('0x3b')])&&_0x134b67[_0xfed7('0x47')]){_0x30f566[_0x134b67['idField']]=_0x134b67[_0xfed7('0x48')][_0xfed7('0x49')]();}else if(_0x134b67[_0xfed7('0x3b')]===_0xfed7('0x4a')&&_0x134b67['variableName']&&_0x134b67[_0xfed7('0x47')]){_0x3289cd[_0x134b67['variableName']]&&(_0x30f566[_0x134b67[_0xfed7('0x47')]]=_0x3289cd[_0x134b67['variableName']][_0xfed7('0x49')]());}else if(_0x134b67[_0xfed7('0x3b')]===_0xfed7('0x4b')&&_0x134b67[_0xfed7('0x4c')]&&_0x134b67['Variable']['name']&&_0x134b67['idField']){_0x3289cd[_0x134b67[_0xfed7('0x4c')][_0xfed7('0x4d')]['toLowerCase']()]&&(_0x30f566[_0x134b67[_0xfed7('0x47')]]=_0x3289cd[_0x134b67[_0xfed7('0x4c')][_0xfed7('0x4d')]['toLowerCase']()][_0xfed7('0x49')]());}});}return _0x30f566;}function getConnection(_0x1c88b2){var _0x2ed828=_0x1c88b2['password'][_0xfed7('0x4e')](_0x1c88b2['securityToken']);var _0x393e54=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1c88b2[_0xfed7('0x4f')]||_0xfed7('0x50'),'clientId':_0x1c88b2[_0xfed7('0x51')],'clientSecret':_0x1c88b2[_0xfed7('0x52')]}});return _0x393e54[_0xfed7('0x53')](_0x1c88b2[_0xfed7('0x54')],_0x2ed828)[_0xfed7('0x20')](function(){logger[_0xfed7('0x1c')](_0xfed7('0x55'));return _0x393e54;});}exports['queue']=function(_0x55c77e,_0x40eaa2,_0x3aaf16,_0x2fe9de,_0x2ce76b,_0x134522){var _0x1ef70e,_0xe5cea5,_0xbb04fc,_0x209600;_0x134522[_0xfed7('0x56')]=intUtil[_0xfed7('0x57')](_0x134522[_0xfed7('0x56')]);_0x134522[_0xfed7('0x4f')]=intUtil[_0xfed7('0x57')](_0x134522[_0xfed7('0x4f')]);if(_0x2ce76b&&_0x2ce76b['monitor_format']){logger[_0xfed7('0x1c')](_0xfed7('0x58'),_0xfed7('0x59'));_0x40eaa2[_0xfed7('0x5a')]=util[_0xfed7('0x40')](_0xfed7('0x5b'),_0x134522['serverUrl'],_0x40eaa2[_0xfed7('0x5c')],md5(_0x40eaa2['uniqueid']));}else{_0x40eaa2[_0xfed7('0x5a')]='';}return getConnection(_0x134522)[_0xfed7('0x20')](function(_0x88f3d8){_0x209600=_0x88f3d8;return getUser(_0x134522,_0x2fe9de[_0xfed7('0x5d')],_0x209600);})[_0xfed7('0x20')](function(_0x387205){_0x1ef70e=_0x387205;return getEndUser(_0x134522,_0x3aaf16,_0x40eaa2[_0xfed7('0x5e')],_0x40eaa2['calleridnum'],_0x209600);})[_0xfed7('0x20')](function(_0x22095a){_0xe5cea5=_0x22095a;return getTicket(_0x134522,_0x1ef70e,_0xe5cea5,_0x3aaf16,_0x40eaa2,_0x3aaf16[_0xfed7('0x5f')],_0x209600,_0xfed7('0x60'));})[_0xfed7('0x20')](function(_0x39db7b){_0xbb04fc=_0x39db7b;logger[_0xfed7('0x1c')](_0xfed7('0x61'),_0xbb04fc['id']);logger[_0xfed7('0x1c')](_0xfed7('0x62'),_0xbb04fc['id'],_0x2fe9de['name'],_0x134522[_0xfed7('0x3b')]);switch(_0x134522[_0xfed7('0x3b')]){case _0xfed7('0x63'):emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x2fe9de[_0xfed7('0x4d')]),'trigger:salesforce:display',{'recordId':_0xbb04fc['id']});break;case'newTab':emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x2fe9de[_0xfed7('0x4d')]),_0xfed7('0x65'),{'uri':util[_0xfed7('0x40')](_0xfed7('0x66'),_0x209600[_0xfed7('0x67')],_0xbb04fc['id'])});break;default:logger[_0xfed7('0x68')](_0xfed7('0x69'));}})[_0xfed7('0x6a')](function(_0x1b726e){logger[_0xfed7('0x68')](_0xfed7('0x58'),_0x1b726e);});};exports[_0xfed7('0x6b')]=function(_0x32212a,_0xc1a130,_0x3a2c2e,_0x115f23,_0x11f66c,_0x4d7acb,_0x3d35ea){var _0x1eaf5d,_0x59ca36,_0xe0634d,_0x239a6f;_0x4d7acb[_0xfed7('0x56')]=intUtil[_0xfed7('0x57')](_0x4d7acb[_0xfed7('0x56')]);_0x4d7acb[_0xfed7('0x4f')]=intUtil[_0xfed7('0x57')](_0x4d7acb[_0xfed7('0x4f')]);if(_0x3d35ea&&_0x3d35ea['recordingFormat']&&_0x3d35ea['recordingFormat']!=='none'){logger[_0xfed7('0x1c')]('[OUTBOUND]',_0xfed7('0x59'));_0xc1a130[_0xfed7('0x5a')]=util[_0xfed7('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d7acb[_0xfed7('0x56')],_0xc1a130[_0xfed7('0x5c')],md5(_0xc1a130[_0xfed7('0x5c')]));}return getConnection(_0x4d7acb)[_0xfed7('0x20')](function(_0x17f9fd){_0x239a6f=_0x17f9fd;return getUser(_0x4d7acb,_0x115f23['email'],_0x239a6f);})['then'](function(_0x40f0b2){_0x1eaf5d=_0x40f0b2;return getEndUser(_0x4d7acb,_0x3a2c2e,_0xc1a130['destcalleridname'],_0xc1a130['destcalleridnum'],_0x239a6f);})[_0xfed7('0x20')](function(_0xa69fd1){_0x59ca36=_0xa69fd1;return getTicket(_0x4d7acb,_0x1eaf5d,_0x59ca36,_0x3a2c2e,_0xc1a130,_0x3a2c2e[_0xfed7('0x5f')],_0x239a6f,_0xfed7('0x6b'));})['then'](function(_0x333b16){_0xe0634d=_0x333b16;logger['info'](_0xfed7('0x6c'),_0xe0634d['id']);logger[_0xfed7('0x1c')](_0xfed7('0x6d'),_0xe0634d['id'],_0x115f23[_0xfed7('0x4d')],_0x4d7acb[_0xfed7('0x3b')]);switch(_0x4d7acb[_0xfed7('0x3b')]){case'integrationTab':emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x115f23[_0xfed7('0x4d')]),'trigger:salesforce:display',{'recordId':_0xe0634d['id']});break;case _0xfed7('0x6e'):emit(util[_0xfed7('0x40')](_0xfed7('0x64'),_0x115f23[_0xfed7('0x4d')]),_0xfed7('0x65'),{'uri':util[_0xfed7('0x40')](_0xfed7('0x66'),_0x239a6f[_0xfed7('0x67')],_0xe0634d['id'])});break;default:logger[_0xfed7('0x68')](_0xfed7('0x6f'),_0xfed7('0x70'));}})[_0xfed7('0x6a')](function(_0x2a1e7f){logger[_0xfed7('0x68')](_0xfed7('0x6f'),_0x2a1e7f);});};exports[_0xfed7('0x71')]=function(_0x242242,_0x202f11,_0x545f6d,_0x3e2aeb,_0x373d62,_0x2fddf2){var _0x36ac2a,_0x11a69d,_0x113c66,_0x196d82;_0x2fddf2[_0xfed7('0x56')]=intUtil[_0xfed7('0x57')](_0x2fddf2[_0xfed7('0x56')]);_0x2fddf2[_0xfed7('0x4f')]=intUtil['stripTrailingSlash'](_0x2fddf2[_0xfed7('0x4f')]);if(_0x373d62&&_0x373d62[_0xfed7('0x72')]){logger['info']('['+_0x202f11[_0xfed7('0x73')][_0xfed7('0x74')]()+']',_0xfed7('0x59'));_0x202f11[_0xfed7('0x5a')]=util['format'](_0xfed7('0x5b'),_0x2fddf2[_0xfed7('0x56')],_0x202f11[_0xfed7('0x5c')],md5(_0x202f11['uniqueid']));}else{_0x202f11[_0xfed7('0x5a')]='';}return getConnection(_0x2fddf2)[_0xfed7('0x20')](function(_0x5ef448){_0x196d82=_0x5ef448;if(!_[_0xfed7('0x75')](_0x3e2aeb)){return getUser(_0x2fddf2,_0x3e2aeb[_0xfed7('0x4d')],_0x196d82);}else{return getUser(_0x2fddf2,null,_0x196d82);}})['then'](function(_0x17cbf0){_0x36ac2a=_0x17cbf0;return getEndUser(_0x2fddf2,_0x545f6d,_0x202f11[_0xfed7('0x5e')],_0x202f11['calleridnum'],_0x196d82);})[_0xfed7('0x20')](function(_0x1ddb92){_0x11a69d=_0x1ddb92;return getTicket(_0x2fddf2,_0x36ac2a,_0x11a69d,_0x545f6d,_0x202f11,_0x545f6d[_0xfed7('0x5f')],_0x196d82);})[_0xfed7('0x20')](function(_0x22634d){_0x113c66=_0x22634d;logger[_0xfed7('0x1c')]('['+_0x202f11[_0xfed7('0x73')]['toUpperCase']()+_0xfed7('0x76'),_0x113c66['id']);logger[_0xfed7('0x1c')]('['+_0x202f11[_0xfed7('0x73')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x2fddf2[_0xfed7('0x3b')]);})[_0xfed7('0x6a')](function(_0x36a1b1){logger[_0xfed7('0x68')]('['+_0x202f11[_0xfed7('0x73')][_0xfed7('0x74')]()+']',_0x36a1b1);});};
\ No newline at end of file
index dc6f730..e87d366 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37f5=['sysparm_display_value=true','remoteUri','serverUrl','format','isNil','email','calleridnum','callDirection','queue','unmanaged','uniqueid','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','ioredis','./util','../../../../config/environment','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','error',']\x20using\x20admin\x20profile','adminId','POST','sys_user?','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_limit=1'];(function(_0x188b45,_0x519284){var _0x1a813a=function(_0x3fb126){while(--_0x3fb126){_0x188b45['push'](_0x188b45['shift']());}};_0x1a813a(++_0x519284);}(_0x37f5,0x7b));var _0x537f=function(_0xf22f27,_0x50b31a){_0xf22f27=_0xf22f27-0x0;var _0x15d688=_0x37f5[_0xf22f27];return _0x15d688;};'use strict';var _=require('lodash');var Promise=require(_0x537f('0x0'));var rp=require('request-promise');var util=require(_0x537f('0x1'));var md5=require(_0x537f('0x2'));var Redis=require(_0x537f('0x3'));var intUtil=require(_0x537f('0x4'));var config=require(_0x537f('0x5'));var logger=require('../../../../config/logger')('servicenow');config[_0x537f('0x6')]=_[_0x537f('0x7')](config[_0x537f('0x6')],{'host':_0x537f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x537f('0x6')]));function getAdminUser(_0x15b286,_0x488e23,_0x316093,_0x21a606,_0xdf2d42,_0x4a587c){return new Promise(function(_0x17ca0e,_0x58c9f0){var _0x4515c6={'method':_0x537f('0x9'),'uri':_0x21a606+_0x537f('0xa')+'&'+_0xdf2d42+'&'+_0x4a587c,'auth':_0x488e23,'json':!![]};return rp(_0x4515c6)[_0x537f('0xb')](function(_0x176b2d){if(_0x176b2d[_0x537f('0xc')][_0x537f('0xd')]>0x0){_0x316093['adminId']=_0x176b2d[_0x537f('0xc')][0x0][_0x537f('0xe')];}logger[_0x537f('0xf')]('['+[_0x15b286[_0x537f('0x10')]()]+_0x537f('0x11'),_0x316093);_0x17ca0e(_0x316093);})[_0x537f('0x12')](function(_0x43a0d1){logger['error']('['+[_0x15b286[_0x537f('0x10')]()]+']',_0x43a0d1[_0x537f('0x13')]);_0x58c9f0(_0x43a0d1[_0x537f('0x13')]);});});}function getUser(_0x284846,_0x241841,_0x19a6ed,_0x546bf7,_0x50c946){return function(_0x484f1e){logger['info']('['+[_0x284846[_0x537f('0x10')]()]+_0x537f('0x14'),_0x484f1e);return new Promise(function(_0x3166b8,_0x58b963){if(intUtil[_0x537f('0x15')](_0x484f1e[_0x537f('0x16')])){var _0x2c47f0={'method':_0x537f('0x9'),'uri':_0x19a6ed+'sys_user?sysparm_query=email%3D'+_0x484f1e[_0x537f('0x16')]+'&'+_0x546bf7+'&'+_0x50c946,'auth':_0x241841,'json':!![]};logger['info']('['+[_0x284846[_0x537f('0x10')]()]+_0x537f('0x17'),_0x2c47f0);return rp(_0x2c47f0)['then'](function(_0x5a8b28){logger[_0x537f('0xf')]('['+[_0x284846[_0x537f('0x10')]()]+'],\x20getUser\x20entity',_0x5a8b28);if(_0x5a8b28[_0x537f('0xc')]['length']>0x0&&String(_0x5a8b28[_0x537f('0xc')][0x0][_0x537f('0x18')])===_0x537f('0x19')){_0x484f1e[_0x537f('0x1a')]=_0x5a8b28[_0x537f('0xc')][0x0][_0x537f('0xe')];}else{_0x484f1e[_0x537f('0x1a')]=_0x484f1e['adminId'];_0x484f1e[_0x537f('0x16')]=_0x484f1e[_0x537f('0x1b')];}logger[_0x537f('0xf')]('['+[_0x284846[_0x537f('0x10')]()]+'],\x20getUser\x20crm',_0x484f1e);_0x3166b8(_0x484f1e);})[_0x537f('0x12')](function(_0x2c89d7){logger[_0x537f('0x1c')]('['+[_0x284846[_0x537f('0x10')]()]+']',_0x2c89d7[_0x537f('0x13')]);_0x58b963(_0x2c89d7['message']);});}else{logger[_0x537f('0xf')]('['+[_0x284846[_0x537f('0x10')]()]+_0x537f('0x1d'));_0x484f1e[_0x537f('0x1a')]=_0x484f1e[_0x537f('0x1e')];_0x484f1e[_0x537f('0x16')]=_0x484f1e['adminEmail'];_0x3166b8(_0x484f1e);}});};}function createEndUser(_0x5aa0e1,_0x496a82,_0x4645c6,_0xf948ad,_0xce848d){logger['info']('['+[_0x5aa0e1[_0x537f('0x10')]()]+'],\x20createEndUser\x20input\x20crm',_0x4645c6);return new Promise(function(_0x2eff79,_0x9834a2){var _0x4a4b3e={'method':_0x537f('0x1f'),'uri':_0xf948ad+_0x537f('0x20')+_0xce848d,'body':{'user_name':_0x4645c6[_0x537f('0x21')],'roles':'user','first_name':_0x4645c6[_0x537f('0x21')],'active':'true','date_format':_0x537f('0x22'),'phone':_0x4645c6['endUserNumber']},'auth':_0x496a82,'json':!![]};return rp(_0x4a4b3e)[_0x537f('0xb')](function(_0x52ddfc){logger[_0x537f('0xf')]('['+[_0x5aa0e1[_0x537f('0x10')]()]+'],\x20EndUser\x20schema',_0x52ddfc[_0x537f('0xc')]);_0x4645c6[_0x537f('0x23')]=_0x52ddfc[_0x537f('0xc')][_0x537f('0xe')];_0x2eff79(_0x4645c6);})['catch'](function(_0x3fe97d){logger['error']('['+[_0x5aa0e1['toUpperCase']()]+']',_0x3fe97d[_0x537f('0x13')]);_0x9834a2(_0x3fe97d[_0x537f('0x13')]);});});}function getEndUser(_0x1fb661,_0x3e62d2,_0x43d693,_0x9aa46d,_0x4d925f){return function(_0xcc5409){logger[_0x537f('0xf')]('['+[_0x1fb661[_0x537f('0x10')]()]+_0x537f('0x24'),_0xcc5409);return new Promise(function(_0x898d12,_0x2a83c0){var _0x4bd62a={'method':_0x537f('0x9'),'uri':_0x43d693+_0x537f('0x25')+_0xcc5409[_0x537f('0x21')]+'&'+_0x9aa46d+'&'+_0x4d925f,'auth':_0x3e62d2,'json':!![]};return rp(_0x4bd62a)[_0x537f('0xb')](function(_0xeb6245){if(_0xeb6245[_0x537f('0xc')][_0x537f('0xd')]>0x0){_0xcc5409[_0x537f('0x23')]=_0xeb6245[_0x537f('0xc')][0x0][_0x537f('0xe')];logger[_0x537f('0xf')]('['+[_0x1fb661[_0x537f('0x10')]()]+_0x537f('0x26'),_0xcc5409);_0x898d12(_0xcc5409);}else{return createEndUser(_0x1fb661,_0x3e62d2,_0xcc5409,_0x43d693,_0x9aa46d)[_0x537f('0xb')](function(_0xbe7793){logger[_0x537f('0xf')]('['+[_0x1fb661[_0x537f('0x10')]()]+_0x537f('0x27'),_0xbe7793);_0x898d12(_0xbe7793);});}})[_0x537f('0x12')](function(_0x37148c){logger[_0x537f('0x1c')]('['+[_0x1fb661[_0x537f('0x10')]()]+']',_0x37148c[_0x537f('0x13')]);_0x2a83c0(_0x37148c[_0x537f('0x13')]);});});};}function getCustomFields(_0x4c6096,_0x577721){var _0x50ba7c={};if(_0x4c6096[_0x537f('0xd')]>0x0){_[_0x537f('0x28')](_0x4c6096,function(_0x40ecb4){if(_[_0x537f('0x29')]([_0x537f('0x2a'),_0x537f('0x2b')],_0x40ecb4[_0x537f('0x2c')])&&_0x40ecb4[_0x537f('0x2d')]&&!_0x40ecb4['customField']){_0x50ba7c[_0x40ecb4['nameField'][_0x537f('0x2e')]()]=_0x40ecb4[_0x537f('0x2f')][_0x537f('0x30')]();}else if(_[_0x537f('0x29')](['string','picklist'],_0x40ecb4[_0x537f('0x2c')])&&_0x40ecb4[_0x537f('0x31')]&&_0x40ecb4[_0x537f('0x32')]){_0x50ba7c[_0x40ecb4['idField']['toLowerCase']()]=_0x40ecb4['content'][_0x537f('0x30')]();}else if(_0x40ecb4[_0x537f('0x2c')]===_0x537f('0x33')&&_0x40ecb4['variableName']&&_0x40ecb4[_0x537f('0x31')]&&_0x40ecb4[_0x537f('0x32')]){_0x50ba7c[_0x40ecb4[_0x537f('0x31')][_0x537f('0x2e')]()]=_0x577721[_0x40ecb4[_0x537f('0x34')]]['toString']();}else if(_0x40ecb4[_0x537f('0x2c')]===_0x537f('0x35')&&_0x40ecb4[_0x537f('0x36')]&&_0x40ecb4[_0x537f('0x36')]['name']&&_0x40ecb4['idField']&&_0x40ecb4['customField']){_0x50ba7c[_0x40ecb4[_0x537f('0x31')][_0x537f('0x2e')]()]=_0x577721[_0x40ecb4['Variable'][_0x537f('0x37')][_0x537f('0x2e')]()]['toString']();}});}return _0x50ba7c;}function getTicket(_0x483923,_0x496831,_0x2195a5,_0x3cf686,_0x33706e,_0x3bf6f1){return function(_0x1497ed){logger[_0x537f('0xf')]('['+[_0x483923['toUpperCase']()]+_0x537f('0x38'),_0x1497ed);return new Promise(function(_0x206dc8,_0x545fbe){var _0x480bd1=_0x483923[_0x537f('0x2e')]()===_0x537f('0x39')?_0x1497ed[_0x537f('0x1a')]:_0x1497ed[_0x537f('0x23')];var _0x17e2ae={'method':_0x537f('0x1f'),'uri':_0x2195a5+_0x537f('0x3a')+'?'+_0x3bf6f1,'body':Object[_0x537f('0x3b')]({},{'active':_0x537f('0x19'),'caller_id':_0x480bd1,'assigned_to':_0x1497ed[_0x537f('0x1a')],'short_description':intUtil[_0x537f('0x3c')](_0x3cf686[_0x537f('0x3d')],_0x33706e,'\x20'),'description':intUtil[_0x537f('0x3c')](_0x3cf686[_0x537f('0x3e')],_0x33706e,'\x0a')},getCustomFields(_0x3cf686['Fields'],_0x33706e)),'auth':_0x496831,'json':!![]};return rp(_0x17e2ae)[_0x537f('0xb')](function(_0x18128f){logger[_0x537f('0xf')]('['+[_0x483923[_0x537f('0x10')]()]+_0x537f('0x3f'),_0x18128f[_0x537f('0xc')]);_0x1497ed[_0x537f('0x40')]=_0x18128f[_0x537f('0xc')][_0x537f('0xe')];_0x1497ed[_0x537f('0x41')]=_0x18128f['result'][_0x537f('0x42')];logger[_0x537f('0xf')]('['+[_0x483923[_0x537f('0x10')]()]+_0x537f('0x43'),_0x1497ed);_0x206dc8(_0x1497ed);})[_0x537f('0x12')](function(_0x1cea01){logger[_0x537f('0x1c')]('['+[_0x483923['toUpperCase']()]+']',_0x1cea01['message']);_0x545fbe(_0x1cea01[_0x537f('0x13')]);});});};}function createRemoteTag(_0x4205b5,_0x3ceb73,_0x2f2f51,_0x5a9358){return new Promise(function(_0x49abcc,_0x546505){var _0xb1c890={'method':_0x537f('0x1f'),'uri':_0x2f2f51+'label'+'?'+_0x5a9358,'body':{'short_description':_0x4205b5,'global':!![],'active':!![],'name':_0x4205b5},'auth':_0x3ceb73,'json':!![]};return rp(_0xb1c890)['then'](function(_0x31adf5){var _0xaa8b5a=_0x31adf5[_0x537f('0xc')][_0x537f('0xe')];_0x49abcc(_0xaa8b5a);});});}function getRemoteTag(_0x51a468,_0x5ab714,_0x3d45be,_0x334eb6,_0x28d26a){return new Promise(function(_0x69a1a3,_0x4babc9){var _0x419f8b={'method':_0x537f('0x9'),'uri':_0x3d45be+_0x537f('0x44')+_0x537f('0x45')+_0x51a468+'&'+_0x334eb6,'auth':_0x5ab714,'json':!![]};return rp(_0x419f8b)[_0x537f('0xb')](function(_0x39ad51){if(_0x39ad51['result'][_0x537f('0xd')]>0x0){var _0x5a3317=_0x39ad51[_0x537f('0xc')][0x0][_0x537f('0xe')];_0x69a1a3(_0x5a3317);}else{return createRemoteTag(_0x51a468,_0x5ab714,_0x3d45be,_0x334eb6)[_0x537f('0xb')](function(_0x163946){_0x69a1a3(_0x163946);});}});});}function assignTagToIncident(_0x2d57b0,_0x2782d2,_0x29ce7f,_0x2850ec,_0x4d058c){return new Promise(function(_0x1a1f2f,_0x22c787){var _0x3f7642={'method':_0x537f('0x1f'),'uri':_0x29ce7f+_0x537f('0x46')+'?'+_0x4d058c,'body':{'label':_0x2d57b0,'table':_0x537f('0x3a'),'id_type':'Incident','table_key':_0x2850ec[_0x537f('0x40')],'title':_0x537f('0x47')+_0x2850ec[_0x537f('0x41')],'id_display':_0x2850ec[_0x537f('0x41')]},'auth':_0x2782d2,'json':!![]};return rp(_0x3f7642)[_0x537f('0xb')](function(_0x5c9195){_0x1a1f2f();})['catch'](function(){_0x1a1f2f();});});}function manageTags(_0x142470,_0x3dd785,_0x3e6c7d,_0x18c0b5,_0x44a4f4,_0x56ebb4,_0x20caac){return new Promise(function(_0x42f7a2,_0x1ef08d){var _0x4a6ed0=[];_0x3dd785[_0x537f('0x28')](function(_0x35fdf2){_0x4a6ed0[_0x537f('0x48')](getRemoteTag(_0x35fdf2,_0x3e6c7d,_0x18c0b5,_0x56ebb4,_0x20caac));});return Promise[_0x537f('0x49')](_0x4a6ed0)['then'](function(_0x571413){if(_0x571413[_0x537f('0xd')]){logger[_0x537f('0xf')]('['+[_0x142470[_0x537f('0x10')]()]+_0x537f('0x4a'),_0x571413);var _0x115902=[];_0x571413[_0x537f('0x28')](function(_0x1e596e){_0x115902[_0x537f('0x48')](assignTagToIncident(_0x1e596e,_0x3e6c7d,_0x18c0b5,_0x44a4f4,_0x56ebb4));});return Promise['all'](_0x115902)[_0x537f('0xb')](function(){_0x42f7a2();})[_0x537f('0x12')](function(){_0x42f7a2();});}else{_0x42f7a2();}});});}function getTags(_0x49a2c4,_0x731a50,_0x4e35df,_0x392073,_0x46fead,_0x28dbd8){return function(_0x5751af){return new Promise(function(_0x4d1b60,_0x50c04c){var _0x3ba24e=[];var _0x4d5a28=_0x392073[_0x537f('0x4b')];if(_0x4d5a28&&_0x4d5a28['length']>0x0){_0x3ba24e=_[_0x537f('0x4c')](_0x4d5a28,'name');}if(_0x3ba24e['length']>0x0){return manageTags(_0x49a2c4,_0x3ba24e,_0x731a50,_0x4e35df,_0x5751af,_0x46fead,_0x28dbd8)['then'](function(){_0x4d1b60(_0x5751af);});}else{_0x4d1b60(_0x5751af);}});};}function emit(_0x3db057,_0x15ab3f,_0x5eda71){var _0x5a1c36=_0x537f('0x4d')+_0x537f('0x4e')+_0x537f('0x4f')+_0x537f('0x50');var _0x327f7c={'uri':_0x3db057+_0x537f('0x51')+_0x5eda71+_0x5a1c36};io['to'](util['format'](_0x537f('0x52'),_0x15ab3f))[_0x537f('0x53')]('trigger:browser:url',_0x327f7c);}exports['cs']=function(_0x1269b7,_0x2622bb,_0x224a48,_0x35a6f1,_0x3167f9,_0x279f2b,_0x373fe2,_0xc25d9e){var _0x27f94d={};var _0x3fb0ad={'user':_0x279f2b[_0x537f('0x54')],'pass':_0x279f2b[_0x537f('0x55')]};var _0x5bb336=_0x537f('0x56');var _0x190775=_0x537f('0x57');_0x279f2b['remoteUri']=intUtil['stripTrailingSlash'](_0x279f2b[_0x537f('0x58')]);_0x279f2b[_0x537f('0x59')]=intUtil['stripTrailingSlash'](_0x279f2b['serverUrl']);var _0x3a2001=util[_0x537f('0x5a')]('%s/api/now/table/',_0x279f2b[_0x537f('0x58')]);_0x27f94d['userEmail']=!_[_0x537f('0x5b')](_0x35a6f1)?_0x35a6f1[_0x537f('0x5c')]:null;_0x27f94d['adminEmail']=_0x279f2b['email'];_0x27f94d[_0x537f('0x21')]=_0xc25d9e[_0x537f('0x2e')]()===_0x537f('0x39')?_0x2622bb['destcalleridnum']:_0x2622bb[_0x537f('0x5d')];_0x27f94d[_0x537f('0x5e')]=_0xc25d9e===_0x537f('0x5f')||_0xc25d9e===_0x537f('0x60')?'queue':_0x537f('0x39');var _0x256abf=util[_0x537f('0x5a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x279f2b[_0x537f('0x59')],_0x2622bb[_0x537f('0x61')],md5(_0x2622bb[_0x537f('0x61')]));if(_0x3167f9&&_0x3167f9['monitor_format']){logger[_0x537f('0xf')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2622bb[_0x537f('0x62')]=_0x256abf;}else if(_0x373fe2&&_0x373fe2['recordingFormat']&&_0x373fe2[_0x537f('0x63')]!==_0x537f('0x64')){logger[_0x537f('0xf')]('[OUTBOUND]',_0x537f('0x65'));_0x2622bb[_0x537f('0x62')]=_0x256abf;}else{_0x2622bb['recordingURL']='';}return getAdminUser(_0xc25d9e,_0x3fb0ad,_0x27f94d,_0x3a2001,_0x190775,_0x5bb336)['then'](getUser(_0xc25d9e,_0x3fb0ad,_0x3a2001,_0x190775,_0x5bb336))[_0x537f('0xb')](getEndUser(_0xc25d9e,_0x3fb0ad,_0x3a2001,_0x190775,_0x5bb336))[_0x537f('0xb')](getTicket(_0xc25d9e,_0x3fb0ad,_0x3a2001,_0x224a48,_0x2622bb,_0x190775))[_0x537f('0xb')](function(_0x346bc5){logger[_0x537f('0xf')](util[_0x537f('0x5a')]('The\x20ticket\x20ID\x20is:\x20%s',_0x346bc5[_0x537f('0x40')]));logger[_0x537f('0xf')](util['format']('call\x20direction:\x20%s',_0xc25d9e));if(_0xc25d9e!==_0x537f('0x60')){logger[_0x537f('0xf')]('['+[_0xc25d9e['toUpperCase']()]+']',_0x537f('0x66'));emit(_0x279f2b[_0x537f('0x58')],_0x35a6f1['name'],_0x346bc5['ticketId']);}})[_0x537f('0x12')](function(_0x548663){logger[_0x537f('0x1c')]('['+[_0xc25d9e[_0x537f('0x10')]()]+_0x537f('0x67'),util[_0x537f('0x68')](_0x548663,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xa792=['true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','length','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','idField','customField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active'];(function(_0x58632b,_0x59d68b){var _0x4a08cd=function(_0x2ba3a4){while(--_0x2ba3a4){_0x58632b['push'](_0x58632b['shift']());}};_0x4a08cd(++_0x59d68b);}(_0xa792,0x13f));var _0x2a79=function(_0x389c96,_0x2eb57c){_0x389c96=_0x389c96-0x0;var _0x169844=_0xa792[_0x389c96];return _0x169844;};'use strict';var _=require(_0x2a79('0x0'));var Promise=require(_0x2a79('0x1'));var rp=require(_0x2a79('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x2a79('0x3'));var intUtil=require(_0x2a79('0x4'));var config=require(_0x2a79('0x5'));var logger=require('../../../../config/logger')(_0x2a79('0x6'));config[_0x2a79('0x7')]=_[_0x2a79('0x8')](config[_0x2a79('0x7')],{'host':_0x2a79('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x5afb55,_0x34f92a,_0xed4820,_0x429cf1,_0x356205,_0x1fa8a1){return new Promise(function(_0x472e58,_0x48b890){var _0x2d443e={'method':_0x2a79('0xa'),'uri':_0x429cf1+_0x2a79('0xb')+'&'+_0x356205+'&'+_0x1fa8a1,'auth':_0x34f92a,'json':!![]};return rp(_0x2d443e)[_0x2a79('0xc')](function(_0x7a691f){if(_0x7a691f[_0x2a79('0xd')]['length']>0x0){_0xed4820['adminId']=_0x7a691f[_0x2a79('0xd')][0x0][_0x2a79('0xe')];}logger[_0x2a79('0xf')]('['+[_0x5afb55[_0x2a79('0x10')]()]+_0x2a79('0x11'),_0xed4820);_0x472e58(_0xed4820);})[_0x2a79('0x12')](function(_0x50de7d){logger[_0x2a79('0x13')]('['+[_0x5afb55[_0x2a79('0x10')]()]+']',_0x50de7d[_0x2a79('0x14')]);_0x48b890(_0x50de7d[_0x2a79('0x14')]);});});}function getUser(_0x1964b2,_0x21fc8b,_0xcb2000,_0x576883,_0x4c1b28){return function(_0x2ba52d){logger['info']('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x15'),_0x2ba52d);return new Promise(function(_0x5140d9,_0x3723d5){if(intUtil['validateEmail'](_0x2ba52d['userEmail'])){var _0x26cfac={'method':_0x2a79('0xa'),'uri':_0xcb2000+'sys_user?sysparm_query=email%3D'+_0x2ba52d[_0x2a79('0x16')]+'&'+_0x576883+'&'+_0x4c1b28,'auth':_0x21fc8b,'json':!![]};logger[_0x2a79('0xf')]('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x17'),_0x26cfac);return rp(_0x26cfac)[_0x2a79('0xc')](function(_0x33919f){logger[_0x2a79('0xf')]('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x18'),_0x33919f);if(_0x33919f[_0x2a79('0xd')]['length']>0x0&&String(_0x33919f['result'][0x0][_0x2a79('0x19')])===_0x2a79('0x1a')){_0x2ba52d[_0x2a79('0x1b')]=_0x33919f['result'][0x0][_0x2a79('0xe')];}else{_0x2ba52d[_0x2a79('0x1b')]=_0x2ba52d[_0x2a79('0x1c')];_0x2ba52d[_0x2a79('0x16')]=_0x2ba52d[_0x2a79('0x1d')];}logger['info']('['+[_0x1964b2['toUpperCase']()]+_0x2a79('0x1e'),_0x2ba52d);_0x5140d9(_0x2ba52d);})['catch'](function(_0x117e5a){logger[_0x2a79('0x13')]('['+[_0x1964b2['toUpperCase']()]+']',_0x117e5a[_0x2a79('0x14')]);_0x3723d5(_0x117e5a[_0x2a79('0x14')]);});}else{logger[_0x2a79('0xf')]('['+[_0x1964b2[_0x2a79('0x10')]()]+_0x2a79('0x1f'));_0x2ba52d['userId']=_0x2ba52d[_0x2a79('0x1c')];_0x2ba52d['userEmail']=_0x2ba52d[_0x2a79('0x1d')];_0x5140d9(_0x2ba52d);}});};}function createEndUser(_0x3785c4,_0x530710,_0x1ae4ff,_0x8a4b43,_0x34121e){logger[_0x2a79('0xf')]('['+[_0x3785c4['toUpperCase']()]+_0x2a79('0x20'),_0x1ae4ff);return new Promise(function(_0xd066ac,_0x1cb6dc){var _0x384905={'method':_0x2a79('0x21'),'uri':_0x8a4b43+_0x2a79('0x22')+_0x34121e,'body':{'user_name':_0x1ae4ff[_0x2a79('0x23')],'roles':_0x2a79('0x24'),'first_name':_0x1ae4ff[_0x2a79('0x23')],'active':'true','date_format':_0x2a79('0x25'),'phone':_0x1ae4ff[_0x2a79('0x23')]},'auth':_0x530710,'json':!![]};return rp(_0x384905)[_0x2a79('0xc')](function(_0x1223fe){logger['info']('['+[_0x3785c4[_0x2a79('0x10')]()]+_0x2a79('0x26'),_0x1223fe[_0x2a79('0xd')]);_0x1ae4ff['endUserId']=_0x1223fe['result'][_0x2a79('0xe')];_0xd066ac(_0x1ae4ff);})['catch'](function(_0x3fdc2a){logger[_0x2a79('0x13')]('['+[_0x3785c4['toUpperCase']()]+']',_0x3fdc2a['message']);_0x1cb6dc(_0x3fdc2a[_0x2a79('0x14')]);});});}function getEndUser(_0x446bfe,_0xc1debe,_0xa4f227,_0x4f5e0e,_0x3361ec){return function(_0x57e09e){logger[_0x2a79('0xf')]('['+[_0x446bfe[_0x2a79('0x10')]()]+_0x2a79('0x27'),_0x57e09e);return new Promise(function(_0x58ed70,_0x5d006a){var _0x4cf7a7={'method':_0x2a79('0xa'),'uri':_0xa4f227+_0x2a79('0x28')+_0x57e09e[_0x2a79('0x23')]+'&'+_0x4f5e0e+'&'+_0x3361ec,'auth':_0xc1debe,'json':!![]};return rp(_0x4cf7a7)[_0x2a79('0xc')](function(_0x32da07){if(_0x32da07[_0x2a79('0xd')][_0x2a79('0x29')]>0x0){_0x57e09e[_0x2a79('0x2a')]=_0x32da07['result'][0x0][_0x2a79('0xe')];logger['info']('['+[_0x446bfe['toUpperCase']()]+_0x2a79('0x2b'),_0x57e09e);_0x58ed70(_0x57e09e);}else{return createEndUser(_0x446bfe,_0xc1debe,_0x57e09e,_0xa4f227,_0x4f5e0e)[_0x2a79('0xc')](function(_0x5720f4){logger[_0x2a79('0xf')]('['+[_0x446bfe['toUpperCase']()]+_0x2a79('0x2c'),_0x5720f4);_0x58ed70(_0x5720f4);});}})[_0x2a79('0x12')](function(_0x16da20){logger[_0x2a79('0x13')]('['+[_0x446bfe[_0x2a79('0x10')]()]+']',_0x16da20[_0x2a79('0x14')]);_0x5d006a(_0x16da20['message']);});});};}function getCustomFields(_0x23141b,_0x132fa9){var _0x3180f7={};if(_0x23141b[_0x2a79('0x29')]>0x0){_[_0x2a79('0x2d')](_0x23141b,function(_0x9a0412){if(_['includes']([_0x2a79('0x2e'),_0x2a79('0x2f')],_0x9a0412[_0x2a79('0x30')])&&_0x9a0412[_0x2a79('0x31')]&&!_0x9a0412['customField']){_0x3180f7[_0x9a0412[_0x2a79('0x31')][_0x2a79('0x32')]()]=_0x9a0412[_0x2a79('0x33')]['toString']();}else if(_['includes']([_0x2a79('0x2e'),'picklist'],_0x9a0412[_0x2a79('0x30')])&&_0x9a0412[_0x2a79('0x34')]&&_0x9a0412[_0x2a79('0x35')]){_0x3180f7[_0x9a0412[_0x2a79('0x34')]['toLowerCase']()]=_0x9a0412['content'][_0x2a79('0x36')]();}else if(_0x9a0412[_0x2a79('0x30')]===_0x2a79('0x37')&&_0x9a0412['variableName']&&_0x9a0412['idField']&&_0x9a0412[_0x2a79('0x35')]){_0x3180f7[_0x9a0412['idField'][_0x2a79('0x32')]()]=_0x132fa9[_0x9a0412[_0x2a79('0x38')]][_0x2a79('0x36')]();}else if(_0x9a0412[_0x2a79('0x30')]===_0x2a79('0x39')&&_0x9a0412['Variable']&&_0x9a0412[_0x2a79('0x3a')][_0x2a79('0x3b')]&&_0x9a0412['idField']&&_0x9a0412[_0x2a79('0x35')]){_0x3180f7[_0x9a0412['idField'][_0x2a79('0x32')]()]=_0x132fa9[_0x9a0412['Variable'][_0x2a79('0x3b')][_0x2a79('0x32')]()]['toString']();}});}return _0x3180f7;}function getTicket(_0x164a32,_0x51456e,_0x6b5321,_0x3b2d07,_0x32210c,_0x5ec305){return function(_0x5ee4b8){logger[_0x2a79('0xf')]('['+[_0x164a32[_0x2a79('0x10')]()]+_0x2a79('0x3c'),_0x5ee4b8);return new Promise(function(_0x5d761c,_0x87a653){var _0x29dfcd=_0x164a32[_0x2a79('0x32')]()==='outbound'?_0x5ee4b8[_0x2a79('0x1b')]:_0x5ee4b8['endUserId'];var _0x2a979e={'method':_0x2a79('0x21'),'uri':_0x6b5321+'incident'+'?'+_0x5ec305,'body':Object[_0x2a79('0x3d')]({},{'active':_0x2a79('0x1a'),'caller_id':_0x29dfcd,'assigned_to':_0x5ee4b8['userId'],'short_description':intUtil[_0x2a79('0x3e')](_0x3b2d07[_0x2a79('0x3f')],_0x32210c,'\x20'),'description':intUtil[_0x2a79('0x3e')](_0x3b2d07[_0x2a79('0x40')],_0x32210c,'\x0a')},getCustomFields(_0x3b2d07[_0x2a79('0x41')],_0x32210c)),'auth':_0x51456e,'json':!![]};return rp(_0x2a979e)[_0x2a79('0xc')](function(_0x2c8a79){logger[_0x2a79('0xf')]('['+[_0x164a32['toUpperCase']()]+_0x2a79('0x42'),_0x2c8a79[_0x2a79('0xd')]);_0x5ee4b8[_0x2a79('0x43')]=_0x2c8a79[_0x2a79('0xd')]['sys_id'];_0x5ee4b8[_0x2a79('0x44')]=_0x2c8a79[_0x2a79('0xd')][_0x2a79('0x45')];logger[_0x2a79('0xf')]('['+[_0x164a32['toUpperCase']()]+']\x20getTicket\x20crm',_0x5ee4b8);_0x5d761c(_0x5ee4b8);})[_0x2a79('0x12')](function(_0x25e510){logger[_0x2a79('0x13')]('['+[_0x164a32[_0x2a79('0x10')]()]+']',_0x25e510['message']);_0x87a653(_0x25e510[_0x2a79('0x14')]);});});};}function createRemoteTag(_0x4738df,_0x3d661b,_0x22dea3,_0x3a1af6){return new Promise(function(_0x3708c4,_0x1e7c09){var _0x13245a={'method':_0x2a79('0x21'),'uri':_0x22dea3+_0x2a79('0x46')+'?'+_0x3a1af6,'body':{'short_description':_0x4738df,'global':!![],'active':!![],'name':_0x4738df},'auth':_0x3d661b,'json':!![]};return rp(_0x13245a)['then'](function(_0x48d0eb){var _0x1aedbe=_0x48d0eb[_0x2a79('0xd')][_0x2a79('0xe')];_0x3708c4(_0x1aedbe);});});}function getRemoteTag(_0x4a0d3a,_0xa667d,_0x48cd8b,_0x5a27da,_0x144e76){return new Promise(function(_0x5ecb18,_0x26d5c1){var _0x4c064e={'method':_0x2a79('0xa'),'uri':_0x48cd8b+'label'+'?sysparm_query=name%3D'+_0x4a0d3a+'&'+_0x5a27da,'auth':_0xa667d,'json':!![]};return rp(_0x4c064e)[_0x2a79('0xc')](function(_0x2f97d6){if(_0x2f97d6['result'][_0x2a79('0x29')]>0x0){var _0x47fb74=_0x2f97d6[_0x2a79('0xd')][0x0][_0x2a79('0xe')];_0x5ecb18(_0x47fb74);}else{return createRemoteTag(_0x4a0d3a,_0xa667d,_0x48cd8b,_0x5a27da)['then'](function(_0x6c77f8){_0x5ecb18(_0x6c77f8);});}});});}function assignTagToIncident(_0x493bd2,_0x2c9aa7,_0x430cd3,_0x5ac37b,_0x3b7fec){return new Promise(function(_0x370cd1,_0x205fd1){var _0x517dfc={'method':_0x2a79('0x21'),'uri':_0x430cd3+_0x2a79('0x47')+'?'+_0x3b7fec,'body':{'label':_0x493bd2,'table':_0x2a79('0x48'),'id_type':_0x2a79('0x49'),'table_key':_0x5ac37b[_0x2a79('0x43')],'title':_0x2a79('0x4a')+_0x5ac37b[_0x2a79('0x44')],'id_display':_0x5ac37b[_0x2a79('0x44')]},'auth':_0x2c9aa7,'json':!![]};return rp(_0x517dfc)[_0x2a79('0xc')](function(_0x579e0a){_0x370cd1();})[_0x2a79('0x12')](function(){_0x370cd1();});});}function manageTags(_0x66b0cc,_0x327992,_0x179d6d,_0x29000f,_0x50557b,_0x204cbc,_0x507c9f){return new Promise(function(_0x3613f9,_0x1574d2){var _0x2ef24a=[];_0x327992[_0x2a79('0x2d')](function(_0x4a8fb7){_0x2ef24a[_0x2a79('0x4b')](getRemoteTag(_0x4a8fb7,_0x179d6d,_0x29000f,_0x204cbc,_0x507c9f));});return Promise[_0x2a79('0x4c')](_0x2ef24a)['then'](function(_0x54cdc4){if(_0x54cdc4[_0x2a79('0x29')]){logger[_0x2a79('0xf')]('['+[_0x66b0cc[_0x2a79('0x10')]()]+_0x2a79('0x4d'),_0x54cdc4);var _0x189c76=[];_0x54cdc4['forEach'](function(_0x2f2225){_0x189c76[_0x2a79('0x4b')](assignTagToIncident(_0x2f2225,_0x179d6d,_0x29000f,_0x50557b,_0x204cbc));});return Promise['all'](_0x189c76)[_0x2a79('0xc')](function(){_0x3613f9();})[_0x2a79('0x12')](function(){_0x3613f9();});}else{_0x3613f9();}});});}function getTags(_0x2193ab,_0x515da7,_0x7009a,_0x5247eb,_0x20ecbe,_0x2de9a4){return function(_0xbace00){return new Promise(function(_0x238384,_0x1c927d){var _0x4134cd=[];var _0x32405d=_0x5247eb['Tags'];if(_0x32405d&&_0x32405d[_0x2a79('0x29')]>0x0){_0x4134cd=_[_0x2a79('0x4e')](_0x32405d,_0x2a79('0x3b'));}if(_0x4134cd['length']>0x0){return manageTags(_0x2193ab,_0x4134cd,_0x515da7,_0x7009a,_0xbace00,_0x20ecbe,_0x2de9a4)[_0x2a79('0xc')](function(){_0x238384(_0xbace00);});}else{_0x238384(_0xbace00);}});};}function emit(_0x5d8070,_0x15198b,_0x48e20f){var _0x3cc44c=_0x2a79('0x4f')+_0x2a79('0x50')+_0x2a79('0x51')+_0x2a79('0x52');var _0x33184c={'uri':_0x5d8070+_0x2a79('0x53')+_0x48e20f+_0x3cc44c};io['to'](util[_0x2a79('0x54')](_0x2a79('0x55'),_0x15198b))[_0x2a79('0x56')](_0x2a79('0x57'),_0x33184c);}exports['cs']=function(_0x11c9a5,_0x205e21,_0x5a2d63,_0x414a09,_0x59489a,_0x4772ac,_0xb5fdff,_0x5b170e){var _0x749408={};var _0x4fada4={'user':_0x4772ac[_0x2a79('0x58')],'pass':_0x4772ac[_0x2a79('0x59')]};var _0x20b149=_0x2a79('0x5a');var _0x412aa6='sysparm_display_value=true';_0x4772ac['remoteUri']=intUtil[_0x2a79('0x5b')](_0x4772ac[_0x2a79('0x5c')]);_0x4772ac['serverUrl']=intUtil['stripTrailingSlash'](_0x4772ac[_0x2a79('0x5d')]);var _0x51bd11=util[_0x2a79('0x54')](_0x2a79('0x5e'),_0x4772ac['remoteUri']);_0x749408[_0x2a79('0x16')]=!_[_0x2a79('0x5f')](_0x414a09)?_0x414a09[_0x2a79('0x60')]:null;_0x749408[_0x2a79('0x1d')]=_0x4772ac[_0x2a79('0x60')];_0x749408[_0x2a79('0x23')]=_0x5b170e['toLowerCase']()===_0x2a79('0x61')?_0x205e21[_0x2a79('0x62')]:_0x205e21['calleridnum'];_0x749408[_0x2a79('0x63')]=_0x5b170e==='queue'||_0x5b170e===_0x2a79('0x64')?_0x2a79('0x65'):_0x2a79('0x61');var _0x2b2d80=util[_0x2a79('0x54')](_0x2a79('0x66'),_0x4772ac['serverUrl'],_0x205e21[_0x2a79('0x67')],md5(_0x205e21[_0x2a79('0x67')]));if(_0x59489a&&_0x59489a[_0x2a79('0x68')]){logger['info'](_0x2a79('0x69'),_0x2a79('0x6a'));_0x205e21[_0x2a79('0x6b')]=_0x2b2d80;}else if(_0xb5fdff&&_0xb5fdff[_0x2a79('0x6c')]&&_0xb5fdff[_0x2a79('0x6c')]!==_0x2a79('0x6d')){logger[_0x2a79('0xf')]('[OUTBOUND]',_0x2a79('0x6a'));_0x205e21[_0x2a79('0x6b')]=_0x2b2d80;}else{_0x205e21[_0x2a79('0x6b')]='';}return getAdminUser(_0x5b170e,_0x4fada4,_0x749408,_0x51bd11,_0x412aa6,_0x20b149)[_0x2a79('0xc')](getUser(_0x5b170e,_0x4fada4,_0x51bd11,_0x412aa6,_0x20b149))[_0x2a79('0xc')](getEndUser(_0x5b170e,_0x4fada4,_0x51bd11,_0x412aa6,_0x20b149))['then'](getTicket(_0x5b170e,_0x4fada4,_0x51bd11,_0x5a2d63,_0x205e21,_0x412aa6))[_0x2a79('0xc')](function(_0x47e6f8){logger[_0x2a79('0xf')](util[_0x2a79('0x54')](_0x2a79('0x6e'),_0x47e6f8[_0x2a79('0x43')]));logger[_0x2a79('0xf')](util[_0x2a79('0x54')](_0x2a79('0x6f'),_0x5b170e));if(_0x5b170e!==_0x2a79('0x64')){logger['info']('['+[_0x5b170e['toUpperCase']()]+']',_0x2a79('0x70'));emit(_0x4772ac[_0x2a79('0x5c')],_0x414a09[_0x2a79('0x3b')],_0x47e6f8[_0x2a79('0x43')]);}})[_0x2a79('0x12')](function(_0x2dad71){logger[_0x2a79('0x13')]('['+[_0x5b170e[_0x2a79('0x10')]()]+_0x2a79('0x71'),util[_0x2a79('0x72')](_0x2dad71,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 6dfe720..27367a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x140e=['Contacts','parent_name','direction','length','variableName','idField','set_entry','JSON','format','apiKey','toString','base64','get_server_info','stringify','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','Agent\x20found!','resolve','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','then','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','toLowerCase','content','custom_fields','push','Variable','login','username','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','catch','outbound','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Fields','Outbound','The\x20Ticket\x20ID\x20is:','contacts','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','unmanaged','lastevent','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','socket.io-emitter','redis','POST','emit','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','toISOString','duration_minutes','parent_type'];(function(_0x2fe5fa,_0x528194){var _0x47a039=function(_0x30241a){while(--_0x30241a){_0x2fe5fa['push'](_0x2fe5fa['shift']());}};_0x47a039(++_0x528194);}(_0x140e,0xd1));var _0xe140=function(_0x3fe203,_0x255557){_0x3fe203=_0x3fe203-0x0;var _0x27fa5e=_0x140e[_0x3fe203];return _0x27fa5e;};'use strict';var _=require(_0xe140('0x0'));var rp=require(_0xe140('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xe140('0x2'));var Redis=require(_0xe140('0x3'));var intUtil=require(_0xe140('0x4'));var config=require(_0xe140('0x5'));var logger=require(_0xe140('0x6'))(_0xe140('0x7'));config['redis']=_[_0xe140('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe140('0x9'))(new Redis(config[_0xe140('0xa')]));var def={'method':_0xe140('0xb'),'json':!![]};function emit(_0x4d84a2,_0x2d4ba8,_0x596e99){io['to'](_0x4d84a2)[_0xe140('0xc')](_0x2d4ba8,_0x596e99);}function getTicket(_0x3728d6,_0x4bfe77,_0x3f9e19,_0x28ef55,_0x40f7f0,_0x5c1b06,_0x377596,_0x802e5){logger['info'](_0xe140('0xd'));var _0x529c76=new Date();var _0xd0a9d5=[{'name':_0xe140('0xe'),'value':intUtil['getString'](_0x28ef55[_0xe140('0xf')],_0x40f7f0,'\x20')},{'name':_0xe140('0x10'),'value':_0x4bfe77['id']},{'name':_0xe140('0x11'),'value':_0x4bfe77['id']},{'name':_0xe140('0x12'),'value':intUtil[_0xe140('0x13')](_0x28ef55['Descriptions'],_0x40f7f0,'\x0a')},{'name':'date_start','value':_0x529c76[_0xe140('0x14')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe140('0x15'),'value':'15'},{'name':'parent_id','value':_0x3f9e19['id']},{'name':_0xe140('0x16'),'value':_0xe140('0x17')},{'name':_0xe140('0x18'),'value':_0x3f9e19[_0xe140('0xe')]},{'name':_0xe140('0x19'),'value':_0x802e5}];if(_0x5c1b06[_0xe140('0x1a')]){_['forEach'](_0x5c1b06,function(_0x590e6e){if(_0x40f7f0[_0x590e6e[_0xe140('0x1b')]]){_0xd0a9d5['push']({'name':_0x590e6e[_0xe140('0x1c')],'value':_0x40f7f0[_0x590e6e[_0xe140('0x1b')]]});}});}return request({'form':{'method':_0xe140('0x1d'),'input_type':_0xe140('0x1e'),'response_type':_0xe140('0x1e'),'rest_data':JSON['stringify']({'session':_0x377596['id'],'module_name':'Calls','name_value_list':_0xd0a9d5})}});}function getAuth(_0x25bca3){return util[_0xe140('0x1f')]('Basic\x20%s',new Buffer(_0x25bca3[_0xe140('0x20')]+':X')[_0xe140('0x21')](_0xe140('0x22')));}function getServerInfo(_0x537523){return request({'form':{'method':_0xe140('0x23'),'input_type':_0xe140('0x1e'),'response_type':_0xe140('0x1e'),'rest_data':JSON[_0xe140('0x24')]({'session':_0x537523['id']})}});}function getUser(_0x2d2751,_0x5bc1f1,_0x3ee81c){if(!_[_0xe140('0x25')](_0x5bc1f1)){logger[_0xe140('0x26')](_0xe140('0x27'),_0x5bc1f1);return request({'form':{'method':_0xe140('0x28'),'input_type':_0xe140('0x1e'),'response_type':_0xe140('0x1e'),'rest_data':JSON[_0xe140('0x24')]({'session':_0x3ee81c['id'],'module_name':_0xe140('0x29'),'query':util[_0xe140('0x1f')](_0xe140('0x2a'),_0x5bc1f1),'order_by':'','offset':'0','select_fields':['id',_0xe140('0xe'),_0xe140('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1eb53d){if(_0x1eb53d[_0xe140('0x2c')][_0xe140('0x1a')]){var _0x5aed7f=_[_0xe140('0x2d')](_0x1eb53d[_0xe140('0x2c')],function(_0x58e610){return _0x58e610['name_value_list'][_0xe140('0x2b')][_0xe140('0x2e')]===_0x5bc1f1;});if(_0x5aed7f){logger[_0xe140('0x26')](_0xe140('0x2f'));return BPromise[_0xe140('0x30')]({'id':_0x5aed7f[_0xe140('0x31')]['id'][_0xe140('0x2e')],'name':_0x5aed7f[_0xe140('0x31')][_0xe140('0xe')][_0xe140('0x2e')]});}}logger[_0xe140('0x26')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe140('0x30')]({'id':_0x3ee81c[_0xe140('0x31')][_0xe140('0x32')][_0xe140('0x2e')],'name':_0x3ee81c[_0xe140('0x31')][_0xe140('0x2b')]['value']});});}else{logger[_0xe140('0x26')](_0xe140('0x33'));return BPromise['resolve']({'id':_0x3ee81c[_0xe140('0x31')][_0xe140('0x32')][_0xe140('0x2e')],'name':_0x3ee81c[_0xe140('0x31')][_0xe140('0x2b')]['value']});}}function getEndUser(_0x1d03f8,_0x25ddc2,_0x1e0a66,_0x161e90){logger[_0xe140('0x26')]('Searching\x20enduser\x20with\x20phone',_0x1e0a66);return request({'form':{'method':_0xe140('0x28'),'input_type':_0xe140('0x1e'),'response_type':_0xe140('0x1e'),'rest_data':JSON[_0xe140('0x24')]({'session':_0x161e90['id'],'module_name':'Contacts','query':util[_0xe140('0x1f')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x1e0a66),'order_by':'','offset':'0','select_fields':['id',_0xe140('0xe'),_0xe140('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4eeaf9){if(_0x4eeaf9['entry_list']['length']){var _0x1d6bdd=_[_0xe140('0x2d')](_0x4eeaf9['entry_list'],function(_0x487a20){return _0x487a20[_0xe140('0x31')][_0xe140('0x34')][_0xe140('0x2e')]===_0x1e0a66;});if(_0x1d6bdd){logger[_0xe140('0x26')](_0xe140('0x35'));return BPromise[_0xe140('0x30')]({'id':_0x1d6bdd[_0xe140('0x31')]['id'][_0xe140('0x2e')],'name':_0x1d6bdd[_0xe140('0x31')]['name'][_0xe140('0x2e')],'phone':_0x1d6bdd[_0xe140('0x31')][_0xe140('0x34')]['value']});}}else{logger[_0xe140('0x26')](_0xe140('0x36'));return request({'form':{'method':_0xe140('0x1d'),'input_type':_0xe140('0x1e'),'response_type':_0xe140('0x1e'),'rest_data':JSON[_0xe140('0x24')]({'session':_0x161e90['id'],'module_name':_0xe140('0x17'),'name_value_list':[{'name':_0xe140('0x37'),'value':_0x25ddc2!==_0xe140('0x38')?_0x25ddc2:util[_0xe140('0x1f')](_0xe140('0x39'),_0x1e0a66)},{'name':_0xe140('0x34'),'value':_0x1e0a66}]})}})[_0xe140('0x3a')](function(_0x311ab5){logger[_0xe140('0x26')](_0xe140('0x3b'));return BPromise['resolve']({'id':_0x311ab5['id'],'name':_0x311ab5[_0xe140('0x2c')]['first_name'][_0xe140('0x2e')],'phone':_0x311ab5['entry_list'][_0xe140('0x34')][_0xe140('0x2e')]});});}});}function request(_0x3be9aa){logger[_0xe140('0x3c')](_0xe140('0x3d'),JSON[_0xe140('0x24')](_0x3be9aa));return rp(_[_0xe140('0x3e')](def,_0x3be9aa));}function getTags(_0x559c05,_0x240b74){var _0x359ed3=[];if(_0x559c05&&_0x559c05[_0xe140('0x1a')]>0x0){_0x359ed3=_[_0xe140('0x3f')](_0x559c05,_0x240b74);}return _0x359ed3;}function getCustomFields(_0x5914b1,_0x25af11){var _0x4b0789=[];var _0x954480={'custom_fields':[]};if(_0x5914b1[_0xe140('0x1a')]>0x0){_['forEach'](_0x5914b1,function(_0x2ff224){if(_0x2ff224[_0xe140('0x40')]===_0xe140('0x41')&&_0x2ff224['nameField']&&!_0x2ff224[_0xe140('0x42')]){_0x954480[_0x2ff224['nameField'][_0xe140('0x43')]()]=_0x2ff224[_0xe140('0x44')]['toString']();}else if(_0x2ff224[_0xe140('0x40')]==='string'&&_0x2ff224['idField']&&_0x2ff224[_0xe140('0x42')]){_0x954480[_0xe140('0x45')][_0xe140('0x46')]({'id':_0x2ff224[_0xe140('0x1c')],'value':_0x2ff224[_0xe140('0x44')][_0xe140('0x21')]()});}else if(_0x2ff224[_0xe140('0x40')]==='variable'&&_0x2ff224[_0xe140('0x1b')]&&_0x2ff224[_0xe140('0x1c')]&&_0x2ff224[_0xe140('0x42')]){_0x25af11[_0x2ff224[_0xe140('0x1b')]]&&_0x954480['custom_fields'][_0xe140('0x46')]({'id':_0x2ff224['idField'],'value':_0x25af11[_0x2ff224[_0xe140('0x1b')]][_0xe140('0x21')]()});}else if(_0x2ff224[_0xe140('0x40')]==='customVariable'&&_0x2ff224[_0xe140('0x47')]&&_0x2ff224[_0xe140('0x47')][_0xe140('0xe')]&&_0x2ff224[_0xe140('0x1c')]&&_0x2ff224[_0xe140('0x42')]){_0x25af11[_0x2ff224['Variable'][_0xe140('0xe')]['toLowerCase']()]&&_0x954480[_0xe140('0x45')][_0xe140('0x46')]({'id':_0x2ff224[_0xe140('0x1c')],'value':_0x25af11[_0x2ff224[_0xe140('0x47')]['name'][_0xe140('0x43')]()]['toString']()});}});}return _0x954480;}function getConnection(_0x286201){return request({'method':_0xe140('0xb'),'form':{'method':_0xe140('0x48'),'input_type':'JSON','response_type':_0xe140('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x286201[_0xe140('0x49')],'password':_0x286201['password'],'encryption':'PLAIN'},'application':_0xe140('0x4a')})}})['then'](function(_0x4ae2a8){var _0x3b7319=_0x4ae2a8;if(_0x3b7319['id']){def[_0xe140('0x4b')]=_0x3b7319['id'];return BPromise['resolve'](_0x3b7319);}else{throw new Error(util['format'](_0xe140('0x4c'),_0x286201['id']));}});}function setRelationship(_0x3a0c8d,_0x4bb0e5,_0x2351ba,_0x86ce5f){return request({'form':{'method':_0xe140('0x4d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe140('0x24')]({'session':_0x3a0c8d['id'],'module_name':'Calls','module_id':_0x2351ba['id'],'link_field_name':_0x86ce5f,'related_ids':[_0x4bb0e5['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x35c836,_0x5a6dcd,_0x41d1aa,_0xc9368e,_0xa765e3,_0x172455){var _0x108633,_0x239430,_0x573ba2,_0x36fbc2;_0x172455[_0xe140('0x4e')]=intUtil[_0xe140('0x4f')](_0x172455[_0xe140('0x4e')]);_0x172455[_0xe140('0x50')]=intUtil[_0xe140('0x4f')](_0x172455[_0xe140('0x50')]);def['uri']=util[_0xe140('0x1f')](_0xe140('0x51'),_0x172455['remoteUri']);if(_0xa765e3&&_0xa765e3[_0xe140('0x52')]){logger[_0xe140('0x26')](_0xe140('0x53'),'Recording\x20is\x20enabled!');_0x5a6dcd[_0xe140('0x54')]=util[_0xe140('0x1f')](_0xe140('0x55'),_0x172455[_0xe140('0x50')],_0x5a6dcd[_0xe140('0x56')],md5(_0x5a6dcd['uniqueid']));}else{_0x5a6dcd[_0xe140('0x54')]='';}return getConnection(_0x172455)['then'](function(_0x3181c1){_0x36fbc2=_0x3181c1;return getUser(_0x172455,_0xc9368e['name'],_0x36fbc2);})[_0xe140('0x3a')](function(_0x55b1df){_0x108633=_0x55b1df;logger[_0xe140('0x26')](_0xe140('0x57'),_0x108633['id']);return getEndUser(_0x172455,_0x5a6dcd['calleridname'],_0x5a6dcd[_0xe140('0x58')],_0x36fbc2);})[_0xe140('0x3a')](function(_0x22f8d8){_0x239430=_0x22f8d8;logger[_0xe140('0x26')]('The\x20Enduser\x20ID\x20is:',_0x239430['id']);return getTicket(_0x172455,_0x108633,_0x239430,_0x41d1aa,_0x5a6dcd,_0x41d1aa['Fields'],_0x36fbc2,'Inbound');})[_0xe140('0x3a')](function(_0x1b9423){_0x573ba2=_0x1b9423;logger['info'](_0xe140('0x59'));logger[_0xe140('0x26')]('The\x20Ticket\x20ID\x20is:',_0x573ba2['id']);return setRelationship(_0x36fbc2,_0x108633,_0x573ba2,_0xe140('0x5a'));})[_0xe140('0x3a')](function(){return setRelationship(_0x36fbc2,_0x239430,_0x573ba2,'contacts');})['then'](function(){return getServerInfo(_0x36fbc2);})[_0xe140('0x3a')](function(_0x4b31a5){var _0x4efc97=parseInt(_0x4b31a5[_0xe140('0x5b')][_0xe140('0x5c')](0x0));var _0x51d67a=util[_0xe140('0x1f')](_0xe140('0x5d'),_0x172455[_0xe140('0x4e')],_0x573ba2['id']);if(_0x4efc97>0x6){_0x51d67a=util[_0xe140('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x172455[_0xe140('0x4e')],_0x573ba2['id']);}logger[_0xe140('0x26')](_0xe140('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe140('0x1f')](_0xe140('0x5e'),_0xc9368e[_0xe140('0xe')]),'trigger:browser:url',{'uri':_0x51d67a});})[_0xe140('0x5f')](function(_0xee7189){logger['error']('[QUEUE]',JSON[_0xe140('0x24')](_0xee7189));});};exports[_0xe140('0x60')]=function(_0xaa7a6,_0x3e331e,_0x2cc161,_0x2d0d0b,_0x14b1ee,_0x147c84,_0x588a17){var _0x583004,_0x3f64fc,_0x2dd3a6,_0x2dae90;_0x147c84[_0xe140('0x4e')]=intUtil[_0xe140('0x4f')](_0x147c84[_0xe140('0x4e')]);_0x147c84['serverUrl']=intUtil[_0xe140('0x4f')](_0x147c84[_0xe140('0x50')]);def[_0xe140('0x61')]=util[_0xe140('0x1f')](_0xe140('0x51'),_0x147c84[_0xe140('0x4e')]);if(_0x588a17&&_0x588a17[_0xe140('0x62')]&&_0x588a17[_0xe140('0x62')]!==_0xe140('0x63')){logger['info'](_0xe140('0x64'),_0xe140('0x65'));_0x3e331e['recordingURL']=util[_0xe140('0x1f')](_0xe140('0x55'),_0x147c84[_0xe140('0x50')],_0x3e331e['uniqueid'],md5(_0x3e331e['uniqueid']));}return getConnection(_0x147c84)[_0xe140('0x3a')](function(_0x4d54e2){_0x2dae90=_0x4d54e2;return getUser(_0x147c84,_0x2d0d0b['name'],_0x2dae90);})[_0xe140('0x3a')](function(_0x3655c1){_0x583004=_0x3655c1;logger[_0xe140('0x26')]('The\x20User\x20ID\x20is:',_0x583004['id']);return getEndUser(_0x147c84,_0x3e331e[_0xe140('0x66')],_0x3e331e['destcalleridnum'],_0x2dae90);})[_0xe140('0x3a')](function(_0xd7712){_0x3f64fc=_0xd7712;logger[_0xe140('0x26')]('The\x20Enduser\x20ID\x20is:',_0x3f64fc['id']);return getTicket(_0x147c84,_0x583004,_0x3f64fc,_0x2cc161,_0x3e331e,_0x2cc161[_0xe140('0x67')],_0x2dae90,_0xe140('0x68'));})['then'](function(_0x3935d9){_0x2dd3a6=_0x3935d9;logger[_0xe140('0x26')](_0xe140('0x59'));logger[_0xe140('0x26')](_0xe140('0x69'),_0x2dd3a6['id']);return setRelationship(_0x2dae90,_0x583004,_0x2dd3a6,_0xe140('0x5a'));})['then'](function(){return setRelationship(_0x2dae90,_0x3f64fc,_0x2dd3a6,_0xe140('0x6a'));})[_0xe140('0x3a')](function(){return getServerInfo(_0x2dae90);})[_0xe140('0x3a')](function(_0x1c4653){var _0x34cf91=parseInt(_0x1c4653[_0xe140('0x5b')][_0xe140('0x5c')](0x0));var _0x4b6fb5=util[_0xe140('0x1f')](_0xe140('0x5d'),_0x147c84[_0xe140('0x4e')],_0x2dd3a6['id']);if(_0x34cf91>0x6){_0x4b6fb5=util[_0xe140('0x1f')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x147c84['remoteUri'],_0x2dd3a6['id']);}logger[_0xe140('0x26')](_0xe140('0x64'),_0xe140('0x6b'));emit(util[_0xe140('0x1f')](_0xe140('0x5e'),_0x2d0d0b[_0xe140('0xe')]),_0xe140('0x6c'),{'uri':_0x4b6fb5});})['catch'](function(_0x37f58f){logger[_0xe140('0x6d')](_0xe140('0x64'),JSON[_0xe140('0x24')](_0x37f58f));});};exports[_0xe140('0x6e')]=function(_0x3d7279,_0x25ee96,_0x1d9048,_0x4223da,_0x221590,_0x5241ff){var _0x38d5d2,_0x12595b,_0x2d5283,_0x2028fd;_0x5241ff[_0xe140('0x4e')]=intUtil[_0xe140('0x4f')](_0x5241ff[_0xe140('0x4e')]);_0x5241ff[_0xe140('0x50')]=intUtil[_0xe140('0x4f')](_0x5241ff['serverUrl']);def['uri']=util[_0xe140('0x1f')](_0xe140('0x51'),_0x5241ff[_0xe140('0x4e')]);if(_0x221590&&_0x221590[_0xe140('0x52')]){logger[_0xe140('0x26')]('['+_0x25ee96[_0xe140('0x6f')]['toUpperCase']()+']',_0xe140('0x65'));_0x25ee96['recordingURL']=util[_0xe140('0x1f')](_0xe140('0x55'),_0x5241ff[_0xe140('0x50')],_0x25ee96['uniqueid'],md5(_0x25ee96[_0xe140('0x56')]));}else{_0x25ee96['recordingURL']='';}return getConnection(_0x5241ff)[_0xe140('0x3a')](function(_0x4436c2){_0x2028fd=_0x4436c2;if(!_[_0xe140('0x25')](_0x4223da)){return getUser(_0x5241ff,_0x4223da[_0xe140('0xe')],_0x2028fd);}else{return getUser(_0x5241ff,null,_0x2028fd);}})['then'](function(_0x114738){_0x38d5d2=_0x114738;logger[_0xe140('0x26')](_0xe140('0x57'),_0x38d5d2['id']);return getEndUser(_0x5241ff,_0x25ee96[_0xe140('0x70')],_0x25ee96['calleridnum'],_0x2028fd);})[_0xe140('0x3a')](function(_0x399a46){_0x12595b=_0x399a46;logger[_0xe140('0x26')](_0xe140('0x71'),_0x12595b['id']);return getTicket(_0x5241ff,_0x38d5d2,_0x12595b,_0x1d9048,_0x25ee96,_0x1d9048[_0xe140('0x67')],_0x2028fd,_0xe140('0x72'));})[_0xe140('0x3a')](function(_0x4ed982){_0x2d5283=_0x4ed982;logger[_0xe140('0x26')](_0xe140('0x59'));logger[_0xe140('0x26')](_0xe140('0x69'),_0x2d5283['id']);return setRelationship(_0x2028fd,_0x38d5d2,_0x2d5283,'users');})[_0xe140('0x3a')](function(){return setRelationship(_0x2028fd,_0x12595b,_0x2d5283,_0xe140('0x6a'));})['then'](function(){return getServerInfo(_0x2028fd);})['catch'](function(_0x537355){logger[_0xe140('0x6d')]('['+_0x25ee96[_0xe140('0x6f')][_0xe140('0x73')]()+']',JSON[_0xe140('0x24')](_0x537355));});};
\ No newline at end of file
+var _0x40ec=['unmanaged','lastevent','toUpperCase','calleridname','Fields','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','created_by','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','direction','length','variableName','JSON','stringify','format','apiKey','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','toString','customVariable','Variable','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','serverUrl','stripTrailingSlash','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','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','uri','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','[OUTBOUND]','error'];(function(_0x338391,_0x4d5e84){var _0x363e1c=function(_0x15f7f6){while(--_0x15f7f6){_0x338391['push'](_0x338391['shift']());}};_0x363e1c(++_0x4d5e84);}(_0x40ec,0x1f1));var _0xc40e=function(_0x454e78,_0x599695){_0x454e78=_0x454e78-0x0;var _0x54f35e=_0x40ec[_0x454e78];return _0x54f35e;};'use strict';var _=require('lodash');var rp=require(_0xc40e('0x0'));var BPromise=require(_0xc40e('0x1'));var md5=require(_0xc40e('0x2'));var util=require('util');var Redis=require(_0xc40e('0x3'));var intUtil=require(_0xc40e('0x4'));var config=require(_0xc40e('0x5'));var logger=require(_0xc40e('0x6'))(_0xc40e('0x7'));config[_0xc40e('0x8')]=_[_0xc40e('0x9')](config[_0xc40e('0x8')],{'host':_0xc40e('0xa'),'port':0x18eb});var io=require(_0xc40e('0xb'))(new Redis(config[_0xc40e('0x8')]));var def={'method':_0xc40e('0xc'),'json':!![]};function emit(_0x475e3a,_0x12bb14,_0x40746d){io['to'](_0x475e3a)[_0xc40e('0xd')](_0x12bb14,_0x40746d);}function getTicket(_0xc81e82,_0xe79ea2,_0x1afce3,_0x4c94a7,_0x575783,_0x3e10a1,_0x322c78,_0x13f668){logger['info'](_0xc40e('0xe'));var _0x29f37d=new Date();var _0x483467=[{'name':_0xc40e('0xf'),'value':intUtil[_0xc40e('0x10')](_0x4c94a7['Subjects'],_0x575783,'\x20')},{'name':'assigned_user_id','value':_0xe79ea2['id']},{'name':_0xc40e('0x11'),'value':_0xe79ea2['id']},{'name':'description','value':intUtil['getString'](_0x4c94a7[_0xc40e('0x12')],_0x575783,'\x0a')},{'name':_0xc40e('0x13'),'value':_0x29f37d[_0xc40e('0x14')]()[_0xc40e('0x15')](0x0,0x13)[_0xc40e('0x16')]('T','\x20')},{'name':_0xc40e('0x17'),'value':'0'},{'name':_0xc40e('0x18'),'value':'15'},{'name':_0xc40e('0x19'),'value':_0x1afce3['id']},{'name':'parent_type','value':_0xc40e('0x1a')},{'name':'parent_name','value':_0x1afce3[_0xc40e('0xf')]},{'name':_0xc40e('0x1b'),'value':_0x13f668}];if(_0x3e10a1[_0xc40e('0x1c')]){_['forEach'](_0x3e10a1,function(_0x2afc28){if(_0x575783[_0x2afc28[_0xc40e('0x1d')]]){_0x483467['push']({'name':_0x2afc28['idField'],'value':_0x575783[_0x2afc28[_0xc40e('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x322c78['id'],'module_name':'Calls','name_value_list':_0x483467})}});}function getAuth(_0x2e5dc4){return util[_0xc40e('0x20')]('Basic\x20%s',new Buffer(_0x2e5dc4[_0xc40e('0x21')]+':X')['toString'](_0xc40e('0x22')));}function getServerInfo(_0x5e9ad4){return request({'form':{'method':'get_server_info','input_type':_0xc40e('0x1e'),'response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x5e9ad4['id']})}});}function getUser(_0x29104e,_0x41bf01,_0x4d0697){if(!_[_0xc40e('0x23')](_0x41bf01)){logger[_0xc40e('0x24')](_0xc40e('0x25'),_0x41bf01);return request({'form':{'method':_0xc40e('0x26'),'input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON['stringify']({'session':_0x4d0697['id'],'module_name':_0xc40e('0x27'),'query':util[_0xc40e('0x20')](_0xc40e('0x28'),_0x41bf01),'order_by':'','offset':'0','select_fields':['id',_0xc40e('0xf'),_0xc40e('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc40e('0x2a')](function(_0x2b0227){if(_0x2b0227[_0xc40e('0x2b')][_0xc40e('0x1c')]){var _0xeda089=_[_0xc40e('0x2c')](_0x2b0227[_0xc40e('0x2b')],function(_0x59146d){return _0x59146d[_0xc40e('0x2d')][_0xc40e('0x29')][_0xc40e('0x2e')]===_0x41bf01;});if(_0xeda089){logger[_0xc40e('0x24')](_0xc40e('0x2f'));return BPromise[_0xc40e('0x30')]({'id':_0xeda089['name_value_list']['id'][_0xc40e('0x2e')],'name':_0xeda089[_0xc40e('0x2d')][_0xc40e('0xf')]['value']});}}logger[_0xc40e('0x24')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xc40e('0x30')]({'id':_0x4d0697[_0xc40e('0x2d')][_0xc40e('0x31')]['value'],'name':_0x4d0697[_0xc40e('0x2d')][_0xc40e('0x29')][_0xc40e('0x2e')]});});}else{logger['info'](_0xc40e('0x32'));return BPromise[_0xc40e('0x30')]({'id':_0x4d0697[_0xc40e('0x2d')][_0xc40e('0x31')][_0xc40e('0x2e')],'name':_0x4d0697['name_value_list'][_0xc40e('0x29')][_0xc40e('0x2e')]});}}function getEndUser(_0x3850af,_0x5c6a1c,_0x3a522e,_0x1552a5){logger[_0xc40e('0x24')]('Searching\x20enduser\x20with\x20phone',_0x3a522e);return request({'form':{'method':_0xc40e('0x26'),'input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x1552a5['id'],'module_name':_0xc40e('0x1a'),'query':util[_0xc40e('0x20')](_0xc40e('0x33'),_0x3a522e),'order_by':'','offset':'0','select_fields':['id',_0xc40e('0xf'),_0xc40e('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc40e('0x2a')](function(_0x1b0186){if(_0x1b0186[_0xc40e('0x2b')][_0xc40e('0x1c')]){var _0x5a124c=_[_0xc40e('0x2c')](_0x1b0186[_0xc40e('0x2b')],function(_0x38f5b0){return _0x38f5b0[_0xc40e('0x2d')][_0xc40e('0x34')][_0xc40e('0x2e')]===_0x3a522e;});if(_0x5a124c){logger['info'](_0xc40e('0x35'));return BPromise[_0xc40e('0x30')]({'id':_0x5a124c[_0xc40e('0x2d')]['id'][_0xc40e('0x2e')],'name':_0x5a124c[_0xc40e('0x2d')][_0xc40e('0xf')][_0xc40e('0x2e')],'phone':_0x5a124c[_0xc40e('0x2d')][_0xc40e('0x34')][_0xc40e('0x2e')]});}}else{logger[_0xc40e('0x24')](_0xc40e('0x36'));return request({'form':{'method':_0xc40e('0x37'),'input_type':'JSON','response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x1552a5['id'],'module_name':'Contacts','name_value_list':[{'name':_0xc40e('0x38'),'value':_0x5c6a1c!==_0xc40e('0x39')?_0x5c6a1c:util[_0xc40e('0x20')](_0xc40e('0x3a'),_0x3a522e)},{'name':_0xc40e('0x34'),'value':_0x3a522e}]})}})[_0xc40e('0x2a')](function(_0x42c8dd){logger[_0xc40e('0x24')](_0xc40e('0x3b'));return BPromise[_0xc40e('0x30')]({'id':_0x42c8dd['id'],'name':_0x42c8dd['entry_list'][_0xc40e('0x38')][_0xc40e('0x2e')],'phone':_0x42c8dd[_0xc40e('0x2b')]['phone_home'][_0xc40e('0x2e')]});});}});}function request(_0x54c8f7){logger[_0xc40e('0x3c')](_0xc40e('0x3d'),JSON[_0xc40e('0x1f')](_0x54c8f7));return rp(_[_0xc40e('0x3e')](def,_0x54c8f7));}function getTags(_0x139f46,_0xbde9a9){var _0x5b1e8e=[];if(_0x139f46&&_0x139f46[_0xc40e('0x1c')]>0x0){_0x5b1e8e=_[_0xc40e('0x3f')](_0x139f46,_0xbde9a9);}return _0x5b1e8e;}function getCustomFields(_0x5d6fb4,_0x209fab){var _0xe7c5b0=[];var _0xf8f8bf={'custom_fields':[]};if(_0x5d6fb4[_0xc40e('0x1c')]>0x0){_[_0xc40e('0x40')](_0x5d6fb4,function(_0x52ea1f){if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x42')&&_0x52ea1f[_0xc40e('0x43')]&&!_0x52ea1f[_0xc40e('0x44')]){_0xf8f8bf[_0x52ea1f['nameField'][_0xc40e('0x45')]()]=_0x52ea1f[_0xc40e('0x46')]['toString']();}else if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x42')&&_0x52ea1f['idField']&&_0x52ea1f[_0xc40e('0x44')]){_0xf8f8bf[_0xc40e('0x47')][_0xc40e('0x48')]({'id':_0x52ea1f[_0xc40e('0x49')],'value':_0x52ea1f[_0xc40e('0x46')]['toString']()});}else if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x4a')&&_0x52ea1f[_0xc40e('0x1d')]&&_0x52ea1f[_0xc40e('0x49')]&&_0x52ea1f['customField']){_0x209fab[_0x52ea1f[_0xc40e('0x1d')]]&&_0xf8f8bf[_0xc40e('0x47')][_0xc40e('0x48')]({'id':_0x52ea1f[_0xc40e('0x49')],'value':_0x209fab[_0x52ea1f[_0xc40e('0x1d')]][_0xc40e('0x4b')]()});}else if(_0x52ea1f[_0xc40e('0x41')]===_0xc40e('0x4c')&&_0x52ea1f[_0xc40e('0x4d')]&&_0x52ea1f[_0xc40e('0x4d')]['name']&&_0x52ea1f['idField']&&_0x52ea1f['customField']){_0x209fab[_0x52ea1f[_0xc40e('0x4d')][_0xc40e('0xf')][_0xc40e('0x45')]()]&&_0xf8f8bf[_0xc40e('0x47')][_0xc40e('0x48')]({'id':_0x52ea1f['idField'],'value':_0x209fab[_0x52ea1f[_0xc40e('0x4d')][_0xc40e('0xf')][_0xc40e('0x45')]()][_0xc40e('0x4b')]()});}});}return _0xf8f8bf;}function getConnection(_0x1b6473){return request({'method':_0xc40e('0xc'),'form':{'method':'login','input_type':_0xc40e('0x1e'),'response_type':'JSON','rest_data':JSON[_0xc40e('0x1f')]({'user_auth':{'user_name':_0x1b6473['username'],'password':_0x1b6473[_0xc40e('0x4e')],'encryption':'PLAIN'},'application':_0xc40e('0x4f')})}})[_0xc40e('0x2a')](function(_0x41225c){var _0x191221=_0x41225c;if(_0x191221['id']){def[_0xc40e('0x50')]=_0x191221['id'];return BPromise['resolve'](_0x191221);}else{throw new Error(util[_0xc40e('0x20')](_0xc40e('0x51'),_0x1b6473['id']));}});}function setRelationship(_0x39503b,_0x14cb50,_0xc30aae,_0x3ec60d){return request({'form':{'method':_0xc40e('0x52'),'input_type':_0xc40e('0x1e'),'response_type':_0xc40e('0x1e'),'rest_data':JSON[_0xc40e('0x1f')]({'session':_0x39503b['id'],'module_name':'Calls','module_id':_0xc30aae['id'],'link_field_name':_0x3ec60d,'related_ids':[_0x14cb50['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xc40e('0x53')]=function(_0xeab57,_0x55a796,_0x119730,_0x136d39,_0x119365,_0x54effd){var _0x48f266,_0x5d5432,_0x48040c,_0x1c9fc4;_0x54effd['remoteUri']=intUtil['stripTrailingSlash'](_0x54effd['remoteUri']);_0x54effd[_0xc40e('0x54')]=intUtil[_0xc40e('0x55')](_0x54effd[_0xc40e('0x54')]);def['uri']=util[_0xc40e('0x20')](_0xc40e('0x56'),_0x54effd[_0xc40e('0x57')]);if(_0x119365&&_0x119365[_0xc40e('0x58')]){logger[_0xc40e('0x24')](_0xc40e('0x59'),_0xc40e('0x5a'));_0x55a796[_0xc40e('0x5b')]=util[_0xc40e('0x20')](_0xc40e('0x5c'),_0x54effd[_0xc40e('0x54')],_0x55a796['uniqueid'],md5(_0x55a796[_0xc40e('0x5d')]));}else{_0x55a796['recordingURL']='';}return getConnection(_0x54effd)[_0xc40e('0x2a')](function(_0x17620d){_0x1c9fc4=_0x17620d;return getUser(_0x54effd,_0x136d39[_0xc40e('0xf')],_0x1c9fc4);})[_0xc40e('0x2a')](function(_0x2c8fcf){_0x48f266=_0x2c8fcf;logger[_0xc40e('0x24')]('The\x20User\x20ID\x20is:',_0x48f266['id']);return getEndUser(_0x54effd,_0x55a796['calleridname'],_0x55a796[_0xc40e('0x5e')],_0x1c9fc4);})[_0xc40e('0x2a')](function(_0x5f1703){_0x5d5432=_0x5f1703;logger[_0xc40e('0x24')]('The\x20Enduser\x20ID\x20is:',_0x5d5432['id']);return getTicket(_0x54effd,_0x48f266,_0x5d5432,_0x119730,_0x55a796,_0x119730['Fields'],_0x1c9fc4,_0xc40e('0x5f'));})[_0xc40e('0x2a')](function(_0x5bfe4){_0x48040c=_0x5bfe4;logger[_0xc40e('0x24')](_0xc40e('0x60'));logger['info'](_0xc40e('0x61'),_0x48040c['id']);return setRelationship(_0x1c9fc4,_0x48f266,_0x48040c,_0xc40e('0x62'));})['then'](function(){return setRelationship(_0x1c9fc4,_0x5d5432,_0x48040c,_0xc40e('0x63'));})['then'](function(){return getServerInfo(_0x1c9fc4);})[_0xc40e('0x2a')](function(_0x2a8405){var _0x3a3a9a=parseInt(_0x2a8405[_0xc40e('0x64')][_0xc40e('0x65')](0x0));var _0xa272b5=util[_0xc40e('0x20')](_0xc40e('0x66'),_0x54effd[_0xc40e('0x57')],_0x48040c['id']);if(_0x3a3a9a>0x6){_0xa272b5=util['format'](_0xc40e('0x67'),_0x54effd['remoteUri'],_0x48040c['id']);}logger[_0xc40e('0x24')](_0xc40e('0x59'),_0xc40e('0x68'));emit(util[_0xc40e('0x20')](_0xc40e('0x69'),_0x136d39[_0xc40e('0xf')]),_0xc40e('0x6a'),{'uri':_0xa272b5});})[_0xc40e('0x6b')](function(_0x5174ec){logger['error'](_0xc40e('0x59'),JSON['stringify'](_0x5174ec));});};exports['outbound']=function(_0x1a8739,_0x1871e0,_0x44aea4,_0x31cfb,_0x190fc6,_0x58808b,_0x4b556e){var _0x4a00de,_0x459978,_0x3653f9,_0x437ccc;_0x58808b['remoteUri']=intUtil['stripTrailingSlash'](_0x58808b['remoteUri']);_0x58808b[_0xc40e('0x54')]=intUtil['stripTrailingSlash'](_0x58808b[_0xc40e('0x54')]);def[_0xc40e('0x6c')]=util['format']('%s/service/v4_1/rest.php',_0x58808b[_0xc40e('0x57')]);if(_0x4b556e&&_0x4b556e['recordingFormat']&&_0x4b556e[_0xc40e('0x6d')]!==_0xc40e('0x6e')){logger[_0xc40e('0x24')]('[OUTBOUND]',_0xc40e('0x5a'));_0x1871e0[_0xc40e('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58808b[_0xc40e('0x54')],_0x1871e0[_0xc40e('0x5d')],md5(_0x1871e0['uniqueid']));}return getConnection(_0x58808b)[_0xc40e('0x2a')](function(_0x571da0){_0x437ccc=_0x571da0;return getUser(_0x58808b,_0x31cfb[_0xc40e('0xf')],_0x437ccc);})[_0xc40e('0x2a')](function(_0x12f52d){_0x4a00de=_0x12f52d;logger['info'](_0xc40e('0x6f'),_0x4a00de['id']);return getEndUser(_0x58808b,_0x1871e0[_0xc40e('0x70')],_0x1871e0[_0xc40e('0x71')],_0x437ccc);})[_0xc40e('0x2a')](function(_0x5af4b6){_0x459978=_0x5af4b6;logger[_0xc40e('0x24')](_0xc40e('0x72'),_0x459978['id']);return getTicket(_0x58808b,_0x4a00de,_0x459978,_0x44aea4,_0x1871e0,_0x44aea4['Fields'],_0x437ccc,_0xc40e('0x73'));})[_0xc40e('0x2a')](function(_0x4a54bd){_0x3653f9=_0x4a54bd;logger[_0xc40e('0x24')](_0xc40e('0x60'));logger['info'](_0xc40e('0x61'),_0x3653f9['id']);return setRelationship(_0x437ccc,_0x4a00de,_0x3653f9,'users');})[_0xc40e('0x2a')](function(){return setRelationship(_0x437ccc,_0x459978,_0x3653f9,_0xc40e('0x63'));})['then'](function(){return getServerInfo(_0x437ccc);})[_0xc40e('0x2a')](function(_0x26a364){var _0x234e11=parseInt(_0x26a364[_0xc40e('0x64')][_0xc40e('0x65')](0x0));var _0xcf5ade=util[_0xc40e('0x20')](_0xc40e('0x66'),_0x58808b['remoteUri'],_0x3653f9['id']);if(_0x234e11>0x6){_0xcf5ade=util['format'](_0xc40e('0x67'),_0x58808b[_0xc40e('0x57')],_0x3653f9['id']);}logger['info'](_0xc40e('0x74'),_0xc40e('0x68'));emit(util['format'](_0xc40e('0x69'),_0x31cfb[_0xc40e('0xf')]),_0xc40e('0x6a'),{'uri':_0xcf5ade});})[_0xc40e('0x6b')](function(_0x203354){logger[_0xc40e('0x75')](_0xc40e('0x74'),JSON['stringify'](_0x203354));});};exports[_0xc40e('0x76')]=function(_0x1aab56,_0x3bba95,_0x32d99a,_0x419aa5,_0x57bd2b,_0x56a64a){var _0x3f76b4,_0x3b5aef,_0xec9f05,_0x16b263;_0x56a64a[_0xc40e('0x57')]=intUtil[_0xc40e('0x55')](_0x56a64a[_0xc40e('0x57')]);_0x56a64a['serverUrl']=intUtil[_0xc40e('0x55')](_0x56a64a['serverUrl']);def[_0xc40e('0x6c')]=util[_0xc40e('0x20')](_0xc40e('0x56'),_0x56a64a['remoteUri']);if(_0x57bd2b&&_0x57bd2b[_0xc40e('0x58')]){logger[_0xc40e('0x24')]('['+_0x3bba95[_0xc40e('0x77')][_0xc40e('0x78')]()+']',_0xc40e('0x5a'));_0x3bba95[_0xc40e('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56a64a[_0xc40e('0x54')],_0x3bba95[_0xc40e('0x5d')],md5(_0x3bba95['uniqueid']));}else{_0x3bba95[_0xc40e('0x5b')]='';}return getConnection(_0x56a64a)[_0xc40e('0x2a')](function(_0x3111d6){_0x16b263=_0x3111d6;if(!_['isNil'](_0x419aa5)){return getUser(_0x56a64a,_0x419aa5[_0xc40e('0xf')],_0x16b263);}else{return getUser(_0x56a64a,null,_0x16b263);}})[_0xc40e('0x2a')](function(_0x1cd185){_0x3f76b4=_0x1cd185;logger[_0xc40e('0x24')]('The\x20User\x20ID\x20is:',_0x3f76b4['id']);return getEndUser(_0x56a64a,_0x3bba95[_0xc40e('0x79')],_0x3bba95[_0xc40e('0x5e')],_0x16b263);})[_0xc40e('0x2a')](function(_0x512512){_0x3b5aef=_0x512512;logger[_0xc40e('0x24')](_0xc40e('0x72'),_0x3b5aef['id']);return getTicket(_0x56a64a,_0x3f76b4,_0x3b5aef,_0x32d99a,_0x3bba95,_0x32d99a[_0xc40e('0x7a')],_0x16b263,'Inbound');})[_0xc40e('0x2a')](function(_0x5e26f7){_0xec9f05=_0x5e26f7;logger[_0xc40e('0x24')](_0xc40e('0x60'));logger[_0xc40e('0x24')](_0xc40e('0x61'),_0xec9f05['id']);return setRelationship(_0x16b263,_0x3f76b4,_0xec9f05,'users');})[_0xc40e('0x2a')](function(){return setRelationship(_0x16b263,_0x3b5aef,_0xec9f05,_0xc40e('0x63'));})[_0xc40e('0x2a')](function(){return getServerInfo(_0x16b263);})[_0xc40e('0x6b')](function(_0x4cbb58){logger[_0xc40e('0x75')]('['+_0x3bba95[_0xc40e('0x77')][_0xc40e('0x78')]()+']',JSON[_0xc40e('0x1f')](_0x4cbb58));});};
\ No newline at end of file
index d9a9348..392b986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18bb=['toString','customVariable','Variable','name','toLowerCase','keyType','string','%s:\x20%s','key','keyContent','format','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','push','content','variable','variableName'];(function(_0x460b20,_0x567382){var _0x42817b=function(_0x5efe76){while(--_0x5efe76){_0x460b20['push'](_0x460b20['shift']());}};_0x42817b(++_0x567382);}(_0x18bb,0xba));var _0xb18b=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x18bb[_0x3f8282];return _0x50f918;};'use strict';var _=require(_0xb18b('0x0'));var util=require(_0xb18b('0x1'));exports[_0xb18b('0x2')]=function(_0x2f8b0f,_0x5bf76d,_0x169eb4){var _0x3b1182=[];if(_0x2f8b0f[_0xb18b('0x3')]>0x0){var _0x334882=_[_0xb18b('0x4')](_0x2f8b0f,['id']);for(var _0x1a0d78=0x0;_0x1a0d78<_0x334882['length'];_0x1a0d78++){var _0x5d66b1=_0x334882[_0x1a0d78];if(_0x5d66b1[_0xb18b('0x5')]==='string'){_0x3b1182[_0xb18b('0x6')](_0x5d66b1[_0xb18b('0x7')]);}else if(_0x5d66b1['type']===_0xb18b('0x8')&&_0x5d66b1[_0xb18b('0x9')]){_0x5bf76d[_0x5d66b1[_0xb18b('0x9')]]&&_0x3b1182[_0xb18b('0x6')](_0x5bf76d[_0x5d66b1[_0xb18b('0x9')]][_0xb18b('0xa')]());}else if(_0x5d66b1[_0xb18b('0x5')]===_0xb18b('0xb')&&_0x5d66b1[_0xb18b('0xc')]&&_0x5d66b1[_0xb18b('0xc')][_0xb18b('0xd')]){_0x5bf76d[_0x5d66b1[_0xb18b('0xc')]['name'][_0xb18b('0xe')]()]&&_0x3b1182[_0xb18b('0x6')](_0x5bf76d[_0x5d66b1[_0xb18b('0xc')][_0xb18b('0xd')][_0xb18b('0xe')]()][_0xb18b('0xa')]());}else if(_0x5d66b1[_0xb18b('0x5')]==='keyValue'){if(_0x5d66b1[_0xb18b('0xf')]===_0xb18b('0x10')&&_0x5d66b1['key']){_0x3b1182['push'](util['format'](_0xb18b('0x11'),_0x5d66b1[_0xb18b('0x12')],_0x5d66b1[_0xb18b('0x13')]));}else if(_0x5d66b1[_0xb18b('0xf')]===_0xb18b('0x8')&&_0x5d66b1['variableName']&&_0x5d66b1[_0xb18b('0x12')]){_0x5bf76d[_0x5d66b1[_0xb18b('0x9')]]&&_0x3b1182[_0xb18b('0x6')](util[_0xb18b('0x14')](_0xb18b('0x11'),_0x5d66b1[_0xb18b('0x12')],_0x5bf76d[_0x5d66b1[_0xb18b('0x9')]]));}else if(_0x5d66b1['keyType']===_0xb18b('0xb')&&_0x5d66b1['Variable']&&_0x5d66b1['Variable']['name']&&_0x5d66b1[_0xb18b('0x12')]){_0x5bf76d[_0x5d66b1['Variable'][_0xb18b('0xd')][_0xb18b('0xe')]()]&&_0x3b1182['push'](util[_0xb18b('0x14')](_0xb18b('0x11'),_0x5d66b1[_0xb18b('0x12')],_0x5bf76d[_0x5d66b1[_0xb18b('0xc')][_0xb18b('0xd')]['toLowerCase']()]));}}}}return _0x3b1182[_0xb18b('0x15')](_0x169eb4);};exports['stripTrailingSlash']=function(_0x37602f){var _0x9c61fb=_0x37602f[_0xb18b('0x16')](-0x1);if(_0x9c61fb==='/'){_0x37602f=_0x37602f[_0xb18b('0x17')](0x0,_0x37602f[_0xb18b('0x18')](_0x9c61fb));}return _0x37602f;};exports[_0xb18b('0x19')]=function(_0x3c373c){if(!_[_0xb18b('0x1a')](_0x3c373c)&&_0x3c373c!==''){var _0x17076e=/^(([^<>()\[\]\\.,;:\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 _0x17076e[_0xb18b('0x1b')](String(_0x3c373c)[_0xb18b('0xe')]());}else{return![];}};
\ No newline at end of file
+var _0xae29=['Variable','toLowerCase','toString','keyValue','key','%s:\x20%s','keyContent','keyType','format','customVariable','join','stripTrailingSlash','slice','substring','isNil','test','lodash','util','getString','length','sortBy','string','push','content','variable','variableName','type','name'];(function(_0x132d9e,_0x1475d7){var _0x4337a4=function(_0x33cf87){while(--_0x33cf87){_0x132d9e['push'](_0x132d9e['shift']());}};_0x4337a4(++_0x1475d7);}(_0xae29,0xd4));var _0x9ae2=function(_0x5f46ee,_0x550dbb){_0x5f46ee=_0x5f46ee-0x0;var _0x5f3804=_0xae29[_0x5f46ee];return _0x5f3804;};'use strict';var _=require(_0x9ae2('0x0'));var util=require(_0x9ae2('0x1'));exports[_0x9ae2('0x2')]=function(_0x19a696,_0x5a827b,_0x2e363d){var _0x3073db=[];if(_0x19a696[_0x9ae2('0x3')]>0x0){var _0xdbff=_[_0x9ae2('0x4')](_0x19a696,['id']);for(var _0x24a05e=0x0;_0x24a05e<_0xdbff[_0x9ae2('0x3')];_0x24a05e++){var _0x43b228=_0xdbff[_0x24a05e];if(_0x43b228['type']===_0x9ae2('0x5')){_0x3073db[_0x9ae2('0x6')](_0x43b228[_0x9ae2('0x7')]);}else if(_0x43b228['type']===_0x9ae2('0x8')&&_0x43b228[_0x9ae2('0x9')]){_0x5a827b[_0x43b228[_0x9ae2('0x9')]]&&_0x3073db[_0x9ae2('0x6')](_0x5a827b[_0x43b228['variableName']]['toString']());}else if(_0x43b228[_0x9ae2('0xa')]==='customVariable'&&_0x43b228['Variable']&&_0x43b228['Variable'][_0x9ae2('0xb')]){_0x5a827b[_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')][_0x9ae2('0xd')]()]&&_0x3073db['push'](_0x5a827b[_0x43b228[_0x9ae2('0xc')]['name'][_0x9ae2('0xd')]()][_0x9ae2('0xe')]());}else if(_0x43b228[_0x9ae2('0xa')]===_0x9ae2('0xf')){if(_0x43b228['keyType']===_0x9ae2('0x5')&&_0x43b228[_0x9ae2('0x10')]){_0x3073db[_0x9ae2('0x6')](util['format'](_0x9ae2('0x11'),_0x43b228['key'],_0x43b228[_0x9ae2('0x12')]));}else if(_0x43b228[_0x9ae2('0x13')]===_0x9ae2('0x8')&&_0x43b228['variableName']&&_0x43b228[_0x9ae2('0x10')]){_0x5a827b[_0x43b228[_0x9ae2('0x9')]]&&_0x3073db[_0x9ae2('0x6')](util[_0x9ae2('0x14')]('%s:\x20%s',_0x43b228[_0x9ae2('0x10')],_0x5a827b[_0x43b228[_0x9ae2('0x9')]]));}else if(_0x43b228[_0x9ae2('0x13')]===_0x9ae2('0x15')&&_0x43b228['Variable']&&_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')]&&_0x43b228[_0x9ae2('0x10')]){_0x5a827b[_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')]['toLowerCase']()]&&_0x3073db['push'](util[_0x9ae2('0x14')](_0x9ae2('0x11'),_0x43b228[_0x9ae2('0x10')],_0x5a827b[_0x43b228[_0x9ae2('0xc')][_0x9ae2('0xb')][_0x9ae2('0xd')]()]));}}}}return _0x3073db[_0x9ae2('0x16')](_0x2e363d);};exports[_0x9ae2('0x17')]=function(_0xdea9ee){var _0x5cf106=_0xdea9ee[_0x9ae2('0x18')](-0x1);if(_0x5cf106==='/'){_0xdea9ee=_0xdea9ee[_0x9ae2('0x19')](0x0,_0xdea9ee['lastIndexOf'](_0x5cf106));}return _0xdea9ee;};exports['validateEmail']=function(_0xc3b1c5){if(!_[_0x9ae2('0x1a')](_0xc3b1c5)&&_0xc3b1c5!==''){var _0x3eab08=/^(([^<>()\[\]\\.,;:\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 _0x3eab08[_0x9ae2('0x1b')](String(_0xc3b1c5)[_0x9ae2('0xd')]());}else{return![];}};
\ No newline at end of file
index d0530a0..ee4f11f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x4e584a,_0x55ff19){var _0x4b010d=function(_0x210a97){while(--_0x210a97){_0x4e584a['push'](_0x4e584a['shift']());}};_0x4b010d(++_0x55ff19);}(_0x9c44,0x178));var _0x49c4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9c44[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index 3f68cac..c93463d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7ce=['uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','integrationTab','newTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','emit','application/json','%s/tickets.json','remoteUri','POST','Tags','name','getString','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','picklist','nameField','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','type','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xe7ce,0xf8));var _0xee7c=function(_0x448adc,_0x335fd8){_0x448adc=_0x448adc-0x0;var _0x16811a=_0xe7ce[_0x448adc];return _0x16811a;};'use strict';var _=require(_0xee7c('0x0'));var rp=require(_0xee7c('0x1'));var md5=require('md5');var util=require(_0xee7c('0x2'));var Redis=require('ioredis');var intUtil=require(_0xee7c('0x3'));var config=require(_0xee7c('0x4'));var logger=require(_0xee7c('0x5'))(_0xee7c('0x6'));config['redis']=_[_0xee7c('0x7')](config[_0xee7c('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xee7c('0x9'))(new Redis(config['redis']));function emit(_0x4b92d5,_0x5efd5b,_0x191c42){io['to'](_0x4b92d5)[_0xee7c('0xa')](_0x5efd5b,_0x191c42);}var headers={'Content-Type':_0xee7c('0xb'),'Accept':_0xee7c('0xb')};function getTicket(_0xa313c9,_0x3dcbcf,_0x4f0cf3,_0x12c596,_0x22dd7b){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xee7c('0xc'),_0xa313c9[_0xee7c('0xd')]),'method':_0xee7c('0xe'),'body':{'ticket':_['merge']({'requester_id':_0x4f0cf3['id'],'submitter_id':_0x3dcbcf?_0x3dcbcf['id']:undefined,'assignee_id':_0x3dcbcf?_0x3dcbcf['id']:undefined,'tags':getTags(_0x12c596[_0xee7c('0xf')],_0xee7c('0x10')),'subject':intUtil[_0xee7c('0x11')](_0x12c596['Subjects'],_0x22dd7b,'\x20'),'description':intUtil[_0xee7c('0x11')](_0x12c596[_0xee7c('0x12')],_0x22dd7b,'\x0a'),'comment':{'public':![],'body':intUtil[_0xee7c('0x11')](_0x12c596[_0xee7c('0x12')],_0x22dd7b,'\x0a')}},getCustomFields(_0x12c596[_0xee7c('0x13')],_0x22dd7b))}})[_0xee7c('0x14')](function(_0x100885){logger[_0xee7c('0x15')](_0xee7c('0x16'));return _0x100885[_0xee7c('0x17')];});}function getUser(_0xa5a8f9,_0x532387){if(intUtil[_0xee7c('0x18')](_0x532387)){logger[_0xee7c('0x15')](_0xee7c('0x19'),_0x532387);return request({'uri':util['format'](_0xee7c('0x1a'),_0xa5a8f9[_0xee7c('0xd')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x532387)}})[_0xee7c('0x14')](function(_0x12dc44){if(_0x12dc44[_0xee7c('0x1b')]){logger['info']('Agent\x20found!');return _['find'](_0x12dc44[_0xee7c('0x1c')],{'email':_0x532387,'role':'agent'});}else{logger[_0xee7c('0x15')](_0xee7c('0x1d'));return request({'uri':util[_0xee7c('0x1e')](_0xee7c('0x1f'),_0xa5a8f9[_0xee7c('0xd')])})[_0xee7c('0x14')](function(_0x504926){logger[_0xee7c('0x15')](_0xee7c('0x20'));return _0x504926[_0xee7c('0x21')];});}});}else{logger['info'](_0xee7c('0x1d'));return request({'uri':util['format']('%s/users/me.json',_0xa5a8f9[_0xee7c('0xd')])})['then'](function(_0x3b1e60){logger['info'](_0xee7c('0x20'));return _0x3b1e60[_0xee7c('0x21')];});}}function getEndUser(_0x537298,_0x5e732c,_0x5a960c){logger[_0xee7c('0x15')]('Searching\x20enduser\x20with\x20phone',_0x5a960c);return request({'uri':util[_0xee7c('0x1e')](_0xee7c('0x1a'),_0x537298[_0xee7c('0xd')]),'qs':{'query':util[_0xee7c('0x1e')](_0xee7c('0x22'),_0x5a960c)}})['then'](function(_0x40f3cd){var _0x26046c;if(_0x40f3cd[_0xee7c('0x1c')][_0xee7c('0x23')]){_0x40f3cd['results']=_['filter'](_0x40f3cd[_0xee7c('0x1c')],{'suspended':![],'role':'end-user'});if(_0x40f3cd['results'][_0xee7c('0x23')]){_0x26046c=_[_0xee7c('0x24')](_0x40f3cd['results']);}}if(_0x26046c){logger[_0xee7c('0x15')](_0xee7c('0x25'));return _0x26046c;}else{logger[_0xee7c('0x15')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xee7c('0x1e')](_0xee7c('0x26'),_0x537298[_0xee7c('0xd')]),'method':_0xee7c('0xe'),'body':{'user':{'role':'end-user','name':util[_0xee7c('0x1e')](_0xee7c('0x27'),_0x5e732c||_0x5a960c),'phone':_0x5a960c}}})[_0xee7c('0x14')](function(_0x4c7489){logger[_0xee7c('0x15')]('Enduser\x20created.');return _0x4c7489[_0xee7c('0x21')];});}});}function getAuth(_0x490e2a){var _0x410f9d;if(_0x490e2a[_0xee7c('0x28')]===_0xee7c('0x29')){_0x410f9d=util[_0xee7c('0x1e')](_0xee7c('0x2a'),_0x490e2a['username'],_0x490e2a[_0xee7c('0x29')]);}else if(_0x490e2a[_0xee7c('0x28')]===_0xee7c('0x2b')){_0x410f9d=util[_0xee7c('0x1e')](_0xee7c('0x2c'),_0x490e2a[_0xee7c('0x2d')],_0x490e2a[_0xee7c('0x2b')]);}return util['format'](_0xee7c('0x2e'),new Buffer(_0x410f9d)[_0xee7c('0x2f')](_0xee7c('0x30')));}function request(_0x1ccd5b){logger[_0xee7c('0x31')](_0xee7c('0x32'),JSON[_0xee7c('0x33')](_0x1ccd5b));return rp(_['defaults'](_0x1ccd5b,{'method':_0xee7c('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x311f49,_0x58a7f3){var _0x26cf9f=[];if(_0x311f49&&_0x311f49[_0xee7c('0x23')]>0x0){_0x26cf9f=_['map'](_0x311f49,_0x58a7f3);}return _0x26cf9f;}function getCustomFields(_0x440d26,_0x6b6d3e){var _0x979d4f=[];var _0x17951={'custom_fields':[]};if(_0x440d26['length']>0x0){_[_0xee7c('0x35')](_0x440d26,function(_0x12e80b){if(_[_0xee7c('0x36')](['string',_0xee7c('0x37')],_0x12e80b['type'])&&_0x12e80b[_0xee7c('0x38')]&&!_0x12e80b[_0xee7c('0x39')]){_0x17951[_0x12e80b[_0xee7c('0x38')][_0xee7c('0x3a')]()]=_0x12e80b[_0xee7c('0x3b')][_0xee7c('0x2f')]();}else if(_[_0xee7c('0x36')]([_0xee7c('0x3c'),_0xee7c('0x37')],_0x12e80b['type'])&&_0x12e80b[_0xee7c('0x3d')]&&_0x12e80b[_0xee7c('0x39')]){_0x17951[_0xee7c('0x3e')][_0xee7c('0x3f')]({'id':_0x12e80b[_0xee7c('0x3d')],'value':_0x12e80b['content']['toString']()});}else if(_0x12e80b['type']===_0xee7c('0x40')&&_0x12e80b[_0xee7c('0x41')]&&_0x12e80b['idField']&&_0x12e80b['customField']){_0x6b6d3e[_0x12e80b[_0xee7c('0x41')]]&&_0x17951[_0xee7c('0x3e')][_0xee7c('0x3f')]({'id':_0x12e80b[_0xee7c('0x3d')],'value':_0x6b6d3e[_0x12e80b[_0xee7c('0x41')]][_0xee7c('0x2f')]()});}else if(_0x12e80b[_0xee7c('0x42')]===_0xee7c('0x43')&&_0x12e80b[_0xee7c('0x44')]&&_0x12e80b[_0xee7c('0x44')][_0xee7c('0x10')]&&_0x12e80b[_0xee7c('0x3d')]&&_0x12e80b['customField']){_0x6b6d3e[_0x12e80b[_0xee7c('0x44')][_0xee7c('0x10')][_0xee7c('0x3a')]()]&&_0x17951[_0xee7c('0x3e')][_0xee7c('0x3f')]({'id':_0x12e80b[_0xee7c('0x3d')],'value':_0x6b6d3e[_0x12e80b[_0xee7c('0x44')][_0xee7c('0x10')][_0xee7c('0x3a')]()][_0xee7c('0x2f')]()});}});}return _0x17951;}exports[_0xee7c('0x45')]=function(_0x4b3072,_0x1ced94,_0x2caa8e,_0x19b652,_0x355ddb,_0x2c445d){var _0x345e11,_0x5f0264;_0x2c445d[_0xee7c('0xd')]=intUtil[_0xee7c('0x46')](_0x2c445d[_0xee7c('0xd')]);_0x2c445d[_0xee7c('0x47')]=intUtil[_0xee7c('0x46')](_0x2c445d[_0xee7c('0x47')]);if(_0x355ddb&&_0x355ddb['monitor_format']){logger[_0xee7c('0x15')](_0xee7c('0x48'),_0xee7c('0x49'));_0x1ced94[_0xee7c('0x4a')]=util['format'](_0xee7c('0x4b'),_0x2c445d[_0xee7c('0x47')],_0x1ced94[_0xee7c('0x4c')],md5(_0x1ced94[_0xee7c('0x4c')]));}else{_0x1ced94[_0xee7c('0x4a')]='';}headers[_0xee7c('0x4d')]=getAuth(_0x2c445d);return getUser(_0x2c445d,_0x19b652['email'])[_0xee7c('0x14')](function(_0x4f27a1){_0x345e11=_0x4f27a1;logger['info'](_0xee7c('0x4e'),_0x345e11['id']);return getEndUser(_0x2c445d,_0x1ced94[_0xee7c('0x4f')],_0x1ced94[_0xee7c('0x50')]);})[_0xee7c('0x14')](function(_0x3c61d){_0x5f0264=_0x3c61d;logger[_0xee7c('0x15')](_0xee7c('0x51'),_0x5f0264['id']);return getTicket(_0x2c445d,_0x345e11,_0x5f0264,_0x2caa8e,_0x1ced94);})['then'](function(_0x4b6fc1){if(_0x4b6fc1){logger[_0xee7c('0x15')](_0xee7c('0x52'),_0x4b6fc1['id']);switch(_0x2c445d['type']){case'integrationTab':logger[_0xee7c('0x15')](_0xee7c('0x48'),_0xee7c('0x53'));return request({'uri':util[_0xee7c('0x1e')](_0xee7c('0x54'),_0x2c445d[_0xee7c('0xd')],_0x345e11['id'],_0x4b6fc1['id']),'method':_0xee7c('0xe')});case'newTab':logger['info']('[QUEUE]',_0xee7c('0x55'));emit(util['format'](_0xee7c('0x56'),_0x19b652['name']),_0xee7c('0x57'),{'uri':util['format']('%s/agent/tickets/%s',_0x2c445d['remoteUri'][_0xee7c('0x58')](_0xee7c('0x59'),''),_0x4b6fc1['id'])});break;default:logger[_0xee7c('0x5a')](_0xee7c('0x48'),_0xee7c('0x5b'));}}})[_0xee7c('0x5c')](function(_0x42fd87){logger[_0xee7c('0x5a')](_0xee7c('0x5d'),util[_0xee7c('0x5e')](_0x42fd87,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x49ff02,_0x58732f,_0x1c41c5,_0x442890,_0x1073af,_0x50a8b3,_0x1e6713){var _0x4f48ad,_0x1eaba1;_0x50a8b3['remoteUri']=intUtil['stripTrailingSlash'](_0x50a8b3[_0xee7c('0xd')]);_0x50a8b3['serverUrl']=intUtil[_0xee7c('0x46')](_0x50a8b3['serverUrl']);if(_0x1e6713&&_0x1e6713['recordingFormat']&&_0x1e6713[_0xee7c('0x5f')]!=='none'){logger['info'](_0xee7c('0x60'),_0xee7c('0x49'));_0x58732f['recordingURL']=util['format'](_0xee7c('0x4b'),_0x50a8b3[_0xee7c('0x47')],_0x58732f[_0xee7c('0x4c')],md5(_0x58732f[_0xee7c('0x4c')]));}headers[_0xee7c('0x4d')]=getAuth(_0x50a8b3);return getUser(_0x50a8b3,_0x442890[_0xee7c('0x61')])[_0xee7c('0x14')](function(_0x3ff344){_0x4f48ad=_0x3ff344;logger[_0xee7c('0x15')](_0xee7c('0x4e'),_0x4f48ad['id']);return getEndUser(_0x50a8b3,_0x58732f[_0xee7c('0x62')],_0x58732f[_0xee7c('0x63')]);})[_0xee7c('0x14')](function(_0x320749){_0x1eaba1=_0x320749;logger[_0xee7c('0x15')](_0xee7c('0x51'),_0x1eaba1['id']);return getTicket(_0x50a8b3,_0x4f48ad,_0x1eaba1,_0x1c41c5,_0x58732f);})['then'](function(_0x4b8cf2){if(_0x4b8cf2){logger[_0xee7c('0x15')](_0xee7c('0x52'),_0x4b8cf2['id']);switch(_0x50a8b3[_0xee7c('0x42')]){case _0xee7c('0x64'):logger[_0xee7c('0x15')](_0xee7c('0x60'),_0xee7c('0x53'));return request({'uri':util[_0xee7c('0x1e')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x50a8b3[_0xee7c('0xd')],_0x4f48ad['id'],_0x4b8cf2['id']),'method':_0xee7c('0xe')});case _0xee7c('0x65'):logger[_0xee7c('0x15')]('[OUTBOUND]',_0xee7c('0x55'));emit(util['format'](_0xee7c('0x56'),_0x442890[_0xee7c('0x10')]),_0xee7c('0x57'),{'uri':util['format']('%s/agent/tickets/%s',_0x50a8b3[_0xee7c('0xd')][_0xee7c('0x58')](_0xee7c('0x59'),''),_0x4b8cf2['id'])});break;default:logger[_0xee7c('0x5a')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xee7c('0x5c')](function(_0x1afb1a){logger[_0xee7c('0x5a')](_0xee7c('0x66'),util[_0xee7c('0x5e')](_0x1afb1a,{'showHidden':!![],'depth':null}));});};exports[_0xee7c('0x67')]=function(_0x4d0170,_0x1eae8f,_0x5d7387,_0x133b19,_0x256e6b,_0x95ec56){var _0x221a37,_0x47210b;_0x95ec56[_0xee7c('0xd')]=intUtil[_0xee7c('0x46')](_0x95ec56[_0xee7c('0xd')]);_0x95ec56[_0xee7c('0x47')]=intUtil[_0xee7c('0x46')](_0x95ec56[_0xee7c('0x47')]);if(_0x256e6b&&_0x256e6b[_0xee7c('0x68')]){logger[_0xee7c('0x15')]('['+_0x1eae8f[_0xee7c('0x69')][_0xee7c('0x6a')]()+']',_0xee7c('0x49'));_0x1eae8f['recordingURL']=util[_0xee7c('0x1e')](_0xee7c('0x4b'),_0x95ec56[_0xee7c('0x47')],_0x1eae8f[_0xee7c('0x4c')],md5(_0x1eae8f[_0xee7c('0x4c')]));}else{_0x1eae8f[_0xee7c('0x4a')]='';}headers['Authorization']=getAuth(_0x95ec56);return getUser(_0x95ec56)[_0xee7c('0x14')](function(_0x162d66){_0x221a37=_0x162d66;logger['info'](_0xee7c('0x4e'),_0x221a37['id']);return getEndUser(_0x95ec56,_0x1eae8f[_0xee7c('0x4f')],_0x1eae8f[_0xee7c('0x50')]);})[_0xee7c('0x14')](function(_0x4ae9d1){_0x47210b=_0x4ae9d1;logger[_0xee7c('0x15')](_0xee7c('0x51'),_0x47210b['id']);return getTicket(_0x95ec56,_0x221a37,_0x47210b,_0x5d7387,_0x1eae8f);})[_0xee7c('0x14')](function(_0x29b985){if(_0x29b985){logger['info'](_0xee7c('0x52'),_0x29b985['id']);}})[_0xee7c('0x5c')](function(_0x554cd0){logger['error']('['+_0x1eae8f[_0xee7c('0x69')][_0xee7c('0x6a')]()+']'+_0xee7c('0x6b'),util['inspect'](_0x554cd0,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xe9bc=['The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Displaying\x20ticket\x20to\x20agent...','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','[HTTP]','stringify','defaults','includes','nameField','customField','content','toString','string','picklist','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','Authorization','email'];(function(_0x2bb08c,_0x227735){var _0x208e44=function(_0x4dc3e9){while(--_0x4dc3e9){_0x2bb08c['push'](_0x2bb08c['shift']());}};_0x208e44(++_0x227735);}(_0xe9bc,0x169));var _0xce9b=function(_0x1057ca,_0x316455){_0x1057ca=_0x1057ca-0x0;var _0x279fdd=_0xe9bc[_0x1057ca];return _0x279fdd;};'use strict';var _=require(_0xce9b('0x0'));var rp=require(_0xce9b('0x1'));var md5=require(_0xce9b('0x2'));var util=require('util');var Redis=require(_0xce9b('0x3'));var intUtil=require(_0xce9b('0x4'));var config=require('../../../../config/environment');var logger=require(_0xce9b('0x5'))(_0xce9b('0x6'));config[_0xce9b('0x7')]=_['defaults'](config['redis'],{'host':_0xce9b('0x8'),'port':0x18eb});var io=require(_0xce9b('0x9'))(new Redis(config['redis']));function emit(_0x473b7e,_0x5e0de5,_0x5904a2){io['to'](_0x473b7e)[_0xce9b('0xa')](_0x5e0de5,_0x5904a2);}var headers={'Content-Type':_0xce9b('0xb'),'Accept':_0xce9b('0xb')};function getTicket(_0x105b36,_0x3d52ea,_0x473037,_0x24d9d4,_0x138390){logger[_0xce9b('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xce9b('0xd'),_0x105b36['remoteUri']),'method':_0xce9b('0xe'),'body':{'ticket':_[_0xce9b('0xf')]({'requester_id':_0x473037['id'],'submitter_id':_0x3d52ea?_0x3d52ea['id']:undefined,'assignee_id':_0x3d52ea?_0x3d52ea['id']:undefined,'tags':getTags(_0x24d9d4[_0xce9b('0x10')],_0xce9b('0x11')),'subject':intUtil[_0xce9b('0x12')](_0x24d9d4[_0xce9b('0x13')],_0x138390,'\x20'),'description':intUtil[_0xce9b('0x12')](_0x24d9d4[_0xce9b('0x14')],_0x138390,'\x0a'),'comment':{'public':![],'body':intUtil[_0xce9b('0x12')](_0x24d9d4['Descriptions'],_0x138390,'\x0a')}},getCustomFields(_0x24d9d4['Fields'],_0x138390))}})['then'](function(_0x4c2ef4){logger[_0xce9b('0xc')](_0xce9b('0x15'));return _0x4c2ef4[_0xce9b('0x16')];});}function getUser(_0x3e5fd7,_0x25d283){if(intUtil[_0xce9b('0x17')](_0x25d283)){logger['info'](_0xce9b('0x18'),_0x25d283);return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x1a'),_0x3e5fd7['remoteUri']),'qs':{'query':util[_0xce9b('0x19')](_0xce9b('0x1b'),_0x25d283)}})[_0xce9b('0x1c')](function(_0x260f3a){if(_0x260f3a['count']){logger[_0xce9b('0xc')](_0xce9b('0x1d'));return _[_0xce9b('0x1e')](_0x260f3a[_0xce9b('0x1f')],{'email':_0x25d283,'role':'agent'});}else{logger[_0xce9b('0xc')](_0xce9b('0x20'));return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x21'),_0x3e5fd7[_0xce9b('0x22')])})['then'](function(_0xee6ed3){logger[_0xce9b('0xc')](_0xce9b('0x23'));return _0xee6ed3[_0xce9b('0x24')];});}});}else{logger[_0xce9b('0xc')](_0xce9b('0x20'));return request({'uri':util[_0xce9b('0x19')]('%s/users/me.json',_0x3e5fd7[_0xce9b('0x22')])})['then'](function(_0x96b4d8){logger['info'](_0xce9b('0x23'));return _0x96b4d8[_0xce9b('0x24')];});}}function getEndUser(_0x1ca7e6,_0x46eb1f,_0x192f5a){logger[_0xce9b('0xc')]('Searching\x20enduser\x20with\x20phone',_0x192f5a);return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x1a'),_0x1ca7e6[_0xce9b('0x22')]),'qs':{'query':util['format'](_0xce9b('0x25'),_0x192f5a)}})['then'](function(_0x55a040){var _0x32daf2;if(_0x55a040[_0xce9b('0x1f')][_0xce9b('0x26')]){_0x55a040['results']=_[_0xce9b('0x27')](_0x55a040[_0xce9b('0x1f')],{'suspended':![],'role':'end-user'});if(_0x55a040[_0xce9b('0x1f')][_0xce9b('0x26')]){_0x32daf2=_[_0xce9b('0x28')](_0x55a040['results']);}}if(_0x32daf2){logger[_0xce9b('0xc')]('Enduser\x20found!');return _0x32daf2;}else{logger[_0xce9b('0xc')](_0xce9b('0x29'));return request({'uri':util[_0xce9b('0x19')]('%s/users.json',_0x1ca7e6['remoteUri']),'method':_0xce9b('0xe'),'body':{'user':{'role':_0xce9b('0x2a'),'name':util[_0xce9b('0x19')]('Caller\x20-\x20%s',_0x46eb1f||_0x192f5a),'phone':_0x192f5a}}})[_0xce9b('0x1c')](function(_0xfa00d3){logger[_0xce9b('0xc')](_0xce9b('0x2b'));return _0xfa00d3['user'];});}});}function getAuth(_0x18656f){var _0x522860;if(_0x18656f[_0xce9b('0x2c')]===_0xce9b('0x2d')){_0x522860=util[_0xce9b('0x19')](_0xce9b('0x2e'),_0x18656f[_0xce9b('0x2f')],_0x18656f['password']);}else if(_0x18656f['authType']===_0xce9b('0x30')){_0x522860=util['format'](_0xce9b('0x31'),_0x18656f[_0xce9b('0x2f')],_0x18656f['token']);}return util[_0xce9b('0x19')](_0xce9b('0x32'),new Buffer(_0x522860)['toString']('base64'));}function request(_0x770d1a){logger['debug'](_0xce9b('0x33'),JSON[_0xce9b('0x34')](_0x770d1a));return rp(_[_0xce9b('0x35')](_0x770d1a,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x14683b,_0x4878a2){var _0x1738a8=[];if(_0x14683b&&_0x14683b[_0xce9b('0x26')]>0x0){_0x1738a8=_['map'](_0x14683b,_0x4878a2);}return _0x1738a8;}function getCustomFields(_0x528daf,_0x46d152){var _0x274f24=[];var _0x1b50d3={'custom_fields':[]};if(_0x528daf[_0xce9b('0x26')]>0x0){_['forEach'](_0x528daf,function(_0x48eeed){if(_[_0xce9b('0x36')](['string','picklist'],_0x48eeed['type'])&&_0x48eeed[_0xce9b('0x37')]&&!_0x48eeed[_0xce9b('0x38')]){_0x1b50d3[_0x48eeed['nameField']['toLowerCase']()]=_0x48eeed[_0xce9b('0x39')][_0xce9b('0x3a')]();}else if(_[_0xce9b('0x36')]([_0xce9b('0x3b'),_0xce9b('0x3c')],_0x48eeed[_0xce9b('0x3d')])&&_0x48eeed[_0xce9b('0x3e')]&&_0x48eeed[_0xce9b('0x38')]){_0x1b50d3[_0xce9b('0x3f')][_0xce9b('0x40')]({'id':_0x48eeed[_0xce9b('0x3e')],'value':_0x48eeed['content'][_0xce9b('0x3a')]()});}else if(_0x48eeed[_0xce9b('0x3d')]===_0xce9b('0x41')&&_0x48eeed[_0xce9b('0x42')]&&_0x48eeed[_0xce9b('0x3e')]&&_0x48eeed[_0xce9b('0x38')]){_0x46d152[_0x48eeed['variableName']]&&_0x1b50d3[_0xce9b('0x3f')][_0xce9b('0x40')]({'id':_0x48eeed[_0xce9b('0x3e')],'value':_0x46d152[_0x48eeed['variableName']][_0xce9b('0x3a')]()});}else if(_0x48eeed[_0xce9b('0x3d')]===_0xce9b('0x43')&&_0x48eeed['Variable']&&_0x48eeed[_0xce9b('0x44')][_0xce9b('0x11')]&&_0x48eeed[_0xce9b('0x3e')]&&_0x48eeed['customField']){_0x46d152[_0x48eeed[_0xce9b('0x44')][_0xce9b('0x11')][_0xce9b('0x45')]()]&&_0x1b50d3['custom_fields'][_0xce9b('0x40')]({'id':_0x48eeed[_0xce9b('0x3e')],'value':_0x46d152[_0x48eeed[_0xce9b('0x44')][_0xce9b('0x11')][_0xce9b('0x45')]()]['toString']()});}});}return _0x1b50d3;}exports[_0xce9b('0x46')]=function(_0x3d4576,_0x2e29ba,_0x3a82e5,_0xcd77f4,_0x2fa873,_0x2e307c){var _0x59ebe3,_0x283692;_0x2e307c[_0xce9b('0x22')]=intUtil['stripTrailingSlash'](_0x2e307c[_0xce9b('0x22')]);_0x2e307c[_0xce9b('0x47')]=intUtil[_0xce9b('0x48')](_0x2e307c['serverUrl']);if(_0x2fa873&&_0x2fa873[_0xce9b('0x49')]){logger[_0xce9b('0xc')](_0xce9b('0x4a'),_0xce9b('0x4b'));_0x2e29ba['recordingURL']=util[_0xce9b('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e307c[_0xce9b('0x47')],_0x2e29ba[_0xce9b('0x4c')],md5(_0x2e29ba[_0xce9b('0x4c')]));}else{_0x2e29ba['recordingURL']='';}headers[_0xce9b('0x4d')]=getAuth(_0x2e307c);return getUser(_0x2e307c,_0xcd77f4[_0xce9b('0x4e')])['then'](function(_0xb1b4d8){_0x59ebe3=_0xb1b4d8;logger[_0xce9b('0xc')](_0xce9b('0x4f'),_0x59ebe3['id']);return getEndUser(_0x2e307c,_0x2e29ba[_0xce9b('0x50')],_0x2e29ba[_0xce9b('0x51')]);})[_0xce9b('0x1c')](function(_0x2fad47){_0x283692=_0x2fad47;logger[_0xce9b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x283692['id']);return getTicket(_0x2e307c,_0x59ebe3,_0x283692,_0x3a82e5,_0x2e29ba);})['then'](function(_0x388930){if(_0x388930){logger[_0xce9b('0xc')](_0xce9b('0x52'),_0x388930['id']);switch(_0x2e307c[_0xce9b('0x3d')]){case _0xce9b('0x53'):logger['info'](_0xce9b('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xce9b('0x19')](_0xce9b('0x54'),_0x2e307c[_0xce9b('0x22')],_0x59ebe3['id'],_0x388930['id']),'method':_0xce9b('0xe')});case _0xce9b('0x55'):logger['info']('[QUEUE]',_0xce9b('0x56'));emit(util['format'](_0xce9b('0x57'),_0xcd77f4['name']),_0xce9b('0x58'),{'uri':util[_0xce9b('0x19')](_0xce9b('0x59'),_0x2e307c[_0xce9b('0x22')]['replace'](_0xce9b('0x5a'),''),_0x388930['id'])});break;default:logger[_0xce9b('0x5b')](_0xce9b('0x4a'),_0xce9b('0x5c'));}}})[_0xce9b('0x5d')](function(_0x5dfc11){logger[_0xce9b('0x5b')](_0xce9b('0x5e'),util['inspect'](_0x5dfc11,{'showHidden':!![],'depth':null}));});};exports[_0xce9b('0x5f')]=function(_0x2368d9,_0x5bb9f8,_0x551e3d,_0xa75e8,_0x286255,_0x226a89,_0x3c2057){var _0x1e0314,_0x41d7ff;_0x226a89[_0xce9b('0x22')]=intUtil[_0xce9b('0x48')](_0x226a89[_0xce9b('0x22')]);_0x226a89['serverUrl']=intUtil[_0xce9b('0x48')](_0x226a89['serverUrl']);if(_0x3c2057&&_0x3c2057[_0xce9b('0x60')]&&_0x3c2057[_0xce9b('0x60')]!==_0xce9b('0x61')){logger[_0xce9b('0xc')](_0xce9b('0x62'),_0xce9b('0x4b'));_0x5bb9f8[_0xce9b('0x63')]=util['format'](_0xce9b('0x64'),_0x226a89[_0xce9b('0x47')],_0x5bb9f8[_0xce9b('0x4c')],md5(_0x5bb9f8['uniqueid']));}headers[_0xce9b('0x4d')]=getAuth(_0x226a89);return getUser(_0x226a89,_0xa75e8[_0xce9b('0x4e')])[_0xce9b('0x1c')](function(_0x370e28){_0x1e0314=_0x370e28;logger['info'](_0xce9b('0x4f'),_0x1e0314['id']);return getEndUser(_0x226a89,_0x5bb9f8[_0xce9b('0x65')],_0x5bb9f8['destcalleridnum']);})['then'](function(_0x51fb7a){_0x41d7ff=_0x51fb7a;logger[_0xce9b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x41d7ff['id']);return getTicket(_0x226a89,_0x1e0314,_0x41d7ff,_0x551e3d,_0x5bb9f8);})[_0xce9b('0x1c')](function(_0x2bcd70){if(_0x2bcd70){logger['info'](_0xce9b('0x52'),_0x2bcd70['id']);switch(_0x226a89[_0xce9b('0x3d')]){case'integrationTab':logger[_0xce9b('0xc')](_0xce9b('0x62'),_0xce9b('0x66'));return request({'uri':util[_0xce9b('0x19')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x226a89['remoteUri'],_0x1e0314['id'],_0x2bcd70['id']),'method':_0xce9b('0xe')});case _0xce9b('0x55'):logger[_0xce9b('0xc')](_0xce9b('0x62'),_0xce9b('0x56'));emit(util[_0xce9b('0x19')](_0xce9b('0x57'),_0xa75e8['name']),_0xce9b('0x58'),{'uri':util['format'](_0xce9b('0x59'),_0x226a89[_0xce9b('0x22')][_0xce9b('0x67')]('/api/v2',''),_0x2bcd70['id'])});break;default:logger[_0xce9b('0x5b')](_0xce9b('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xce9b('0x5d')](function(_0x2ad7f8){logger['error'](_0xce9b('0x68'),util[_0xce9b('0x69')](_0x2ad7f8,{'showHidden':!![],'depth':null}));});};exports[_0xce9b('0x6a')]=function(_0x5e6a68,_0x2636d2,_0x264593,_0x61141e,_0x1bc343,_0x4dc945){var _0x3a5681,_0x27a70b;_0x4dc945['remoteUri']=intUtil['stripTrailingSlash'](_0x4dc945['remoteUri']);_0x4dc945[_0xce9b('0x47')]=intUtil[_0xce9b('0x48')](_0x4dc945[_0xce9b('0x47')]);if(_0x1bc343&&_0x1bc343[_0xce9b('0x49')]){logger[_0xce9b('0xc')]('['+_0x2636d2[_0xce9b('0x6b')]['toUpperCase']()+']',_0xce9b('0x4b'));_0x2636d2[_0xce9b('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dc945[_0xce9b('0x47')],_0x2636d2[_0xce9b('0x4c')],md5(_0x2636d2[_0xce9b('0x4c')]));}else{_0x2636d2[_0xce9b('0x63')]='';}headers['Authorization']=getAuth(_0x4dc945);return getUser(_0x4dc945)[_0xce9b('0x1c')](function(_0x4a7d7f){_0x3a5681=_0x4a7d7f;logger[_0xce9b('0xc')](_0xce9b('0x4f'),_0x3a5681['id']);return getEndUser(_0x4dc945,_0x2636d2[_0xce9b('0x50')],_0x2636d2['calleridnum']);})[_0xce9b('0x1c')](function(_0x5d02b7){_0x27a70b=_0x5d02b7;logger[_0xce9b('0xc')]('The\x20Enduser\x20ID\x20is:',_0x27a70b['id']);return getTicket(_0x4dc945,_0x3a5681,_0x27a70b,_0x264593,_0x2636d2);})['then'](function(_0xcbd75c){if(_0xcbd75c){logger['info'](_0xce9b('0x52'),_0xcbd75c['id']);}})[_0xce9b('0x5d')](function(_0x26a3e3){logger['error']('['+_0x2636d2[_0xce9b('0x6b')][_0xce9b('0x6c')]()+']'+_0xce9b('0x6d'),util[_0xce9b('0x69')](_0x26a3e3,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index f80b971..fcc9a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e14=['md5','util','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','catch','error','Failing\x20creating\x20the\x20access_token','stack','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','isArrayLikeObject','users','email','info','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Owner','administrator','first_name','Subject','Description','getString','Who_Id','First_Name','Last_Name','What_Id','Full_Name','$se_module','talktime','Call_Duration','utc','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','merge','Fields','Call\x20created!','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','[OUTBOUND]','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','unmanaged','toUpperCase','lodash','request-promise'];(function(_0x24225d,_0x355681){var _0x364b83=function(_0x2c5bfe){while(--_0x2c5bfe){_0x24225d['push'](_0x24225d['shift']());}};_0x364b83(++_0x355681);}(_0x7e14,0x99));var _0x47e1=function(_0x24109e,_0x316b37){_0x24109e=_0x24109e-0x0;var _0x36543f=_0x7e14[_0x24109e];return _0x36543f;};'use strict';var _=require(_0x47e1('0x0'));var rp=require(_0x47e1('0x1'));var md5=require(_0x47e1('0x2'));var util=require(_0x47e1('0x3'));var intUtil=require(_0x47e1('0x4'));var moment=require(_0x47e1('0x5'));var Redis=require('ioredis');var BPromise=require(_0x47e1('0x6'));var config=require(_0x47e1('0x7'));var logger=require(_0x47e1('0x8'))(_0x47e1('0x9'));config[_0x47e1('0xa')]=_[_0x47e1('0xb')](config[_0x47e1('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x47e1('0xc'))(new Redis(config['redis']));function emit(_0x573026,_0x3ce26e,_0x2f0e5f){io['to'](_0x573026)[_0x47e1('0xd')](_0x3ce26e,_0x2f0e5f);}function request(_0x483231){logger[_0x47e1('0xe')](_0x47e1('0xf'),JSON[_0x47e1('0x10')](_0x483231));return rp(_0x483231);}function getCustomFields(_0x32ac55,_0x4a4421){var _0x12517a={};if(_0x32ac55[_0x47e1('0x11')]>0x0){_[_0x47e1('0x12')](_0x32ac55,function(_0x36d50e){if(_[_0x47e1('0x13')]([_0x47e1('0x14'),'picklist'],_0x36d50e[_0x47e1('0x15')])&&_0x36d50e[_0x47e1('0x16')]){_0x12517a[_0x36d50e['idField']]=_0x36d50e[_0x47e1('0x17')][_0x47e1('0x18')]();}else if(_0x36d50e['type']===_0x47e1('0x19')&&_0x36d50e['variableName']&&_0x36d50e[_0x47e1('0x16')]&&_0x4a4421[_0x36d50e['variableName']]){_0x12517a[_0x36d50e['idField']]=_0x4a4421[_0x36d50e[_0x47e1('0x1a')]]['toString']();}else if(_0x36d50e[_0x47e1('0x15')]==='customVariable'&&_0x36d50e['Variable']&&_0x36d50e[_0x47e1('0x1b')][_0x47e1('0x1c')]&&_0x36d50e['idField']&&_0x4a4421[_0x36d50e[_0x47e1('0x1b')][_0x47e1('0x1c')][_0x47e1('0x1d')]()]){_0x12517a[_0x36d50e['idField']]=_0x4a4421[_0x36d50e[_0x47e1('0x1b')][_0x47e1('0x1c')][_0x47e1('0x1d')]()][_0x47e1('0x18')]();}});}return _0x12517a;}function getName(_0x8fd40){if(_0x8fd40[_0x47e1('0x1e')]('\x20')>0x0){var _0xcba24=_0x8fd40[_0x47e1('0x1f')](/ (.+)/);if(_0xcba24[0x1]){return _0xcba24;}}return[_0x8fd40,_0x8fd40];}var accountsTokens={};function getAccessToken(_0x220bfa){return new Promise(function(_0x11ba5b,_0x30c082){if(!_['isNil'](accountsTokens[_0x220bfa['id']])&&!_[_0x47e1('0x20')](accountsTokens[_0x220bfa['id']][_0x47e1('0x21')])){if(moment()[_0x47e1('0x22')](accountsTokens[_0x220bfa['id']][_0x47e1('0x23')])){_0x11ba5b(accountsTokens[_0x220bfa['id']][_0x47e1('0x21')]);}}var _0x5cb6ee;switch(_0x220bfa['zone']){case'US':_0x5cb6ee=_0x47e1('0x24');break;case'AU':_0x5cb6ee=_0x47e1('0x25');break;case'EU':_0x5cb6ee=_0x47e1('0x26');break;case'IN':_0x5cb6ee='https://accounts.zoho.in';break;case'CN':_0x5cb6ee='https://accounts.zoho.com.cn';break;default:_0x5cb6ee=_0x47e1('0x26');break;}var _0x5e45bd={'method':_0x47e1('0x27'),'uri':_0x5cb6ee+_0x47e1('0x28'),'qs':{'refresh_token':_0x220bfa[_0x47e1('0x29')],'client_id':_0x220bfa[_0x47e1('0x2a')],'client_secret':_0x220bfa[_0x47e1('0x2b')],'grant_type':_0x47e1('0x2c')},'json':!![]};return rp(_0x5e45bd)[_0x47e1('0x2d')](function(_0x238d7e){accountsTokens[_0x220bfa['id']]={'access_token':_0x238d7e['access_token'],'expires_in':moment()['add'](_0x238d7e['expires_in'],'seconds')};_0x11ba5b(_0x238d7e[_0x47e1('0x21')]);})[_0x47e1('0x2e')](function(_0x4d3f81){logger[_0x47e1('0x2f')](_0x47e1('0x30'),_0x4d3f81[_0x47e1('0x31')]);_0x30c082(_0x4d3f81);});});}function getUser(_0x21698d,_0x92b95,_0x9ff3a4,_0x3a79eb){logger['info']('Search\x20user');return request({'method':'GET','uri':util['format'](_0x47e1('0x32'),_0x92b95),'qs':{'type':_0x47e1('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x21698d},'json':!![]})[_0x47e1('0x2d')](function(_0x1b1418){if(_0x1b1418['users']){var _0x1ffd1b=-0x1;if(_[_0x47e1('0x34')](_0x1b1418[_0x47e1('0x35')])){if(!_[_0x47e1('0x20')](_0x3a79eb)){_0x1ffd1b=_['findIndex'](_0x1b1418[_0x47e1('0x35')],function(_0x26d1f7){return _0x26d1f7[_0x47e1('0x36')]===_0x3a79eb;});}if(_0x1ffd1b>=0x0){logger[_0x47e1('0x37')]('Agent\x20found!');}else{logger[_0x47e1('0x37')](_0x47e1('0x38'));_0x1ffd1b=_[_0x47e1('0x39')](_0x1b1418['users'],function(_0x112e9f){return _0x112e9f[_0x47e1('0x3a')]['name']===_0x47e1('0x3b');});}return _0x1b1418[_0x47e1('0x35')][_0x1ffd1b];}else{if(_0x1b1418['user'][_0x47e1('0x3a')]['name']===_0x47e1('0x3b')){logger[_0x47e1('0x37')](_0x47e1('0x38'));user=_0x1b1418[_0x47e1('0x3c')];return user;}else{logger[_0x47e1('0x2f')]('The\x20failing\x20result\x20is',JSON[_0x47e1('0x10')](_0x1b1418));throw new Error(_0x47e1('0x3d')+JSON[_0x47e1('0x10')](_0x1b1418));}}}else{logger[_0x47e1('0x2f')](_0x47e1('0x3e'),JSON[_0x47e1('0x10')](_0x1b1418));throw new Error(_0x47e1('0x3d')+JSON[_0x47e1('0x10')](_0x1b1418));}})[_0x47e1('0x2e')](function(_0x533d4f){console[_0x47e1('0x2f')](_0x533d4f);});}function getZohoUser(_0x335af2,_0x2a5d85){return new BPromise(function(_0x1aa6f9,_0x2c6d22){request(_0x335af2)[_0x47e1('0x2d')](function(_0x43d967){var _0x412b13=null;if(_0x43d967){_0x412b13=_0x43d967[_0x47e1('0x3f')][0x0];_0x412b13[_0x47e1('0x40')]=_0x2a5d85;}_0x1aa6f9(_0x412b13);})[_0x47e1('0x2e')](function(_0x36b0bb){_0x2c6d22(_0x36b0bb);});});}function createEndUser(_0x1eb0e3,_0x3bd5b5,_0x1e507f,_0x4ddd51,_0x49240d,_0x20ab08){var _0x1e507f=getName(_0x1e507f);return request({'method':'POST','uri':_0x47e1('0x41')+_0x3bd5b5+_0x47e1('0x42')+_[_0x47e1('0x43')](_0x20ab08['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1e507f[0x1],'First_Name':_0x1e507f[0x0],'Phone':_0x4ddd51,'Owner':{'name':!_[_0x47e1('0x20')](_0x49240d[_0x47e1('0x44')][_0x47e1('0x1c')])?_0x49240d[_0x47e1('0x44')][_0x47e1('0x1c')]:!_['isNil'](_0x49240d['first_name'])?_0x49240d['first_name']+'\x20'+_0x49240d['last_name']:_0x49240d[_0x47e1('0x45')],'id':_0x49240d['id']}}]},'headers':{'Authorization':_0x47e1('0x46')+_0x1eb0e3},'json':!![]})[_0x47e1('0x2d')](function(_0x1de651){if(_0x1de651&&_0x1de651['data'][0x0][_0x47e1('0x47')]===_0x47e1('0x48')){var _0x33f796=_0x1de651[_0x47e1('0x3f')][0x0][_0x47e1('0x49')];_0x33f796['enduserType']=_[_0x47e1('0x43')](_0x20ab08[_0x47e1('0x4a')])+'s';return _0x33f796;}logger[_0x47e1('0x2f')](_0x47e1('0x3e'),JSON[_0x47e1('0x10')](data));throw new Error(_0x47e1('0x4b')+JSON['stringify'](data));})[_0x47e1('0x2e')](function(_0x2e91d8){console[_0x47e1('0x4c')](_0x47e1('0x4d'),_0x2e91d8);});}function getEndUser(_0x516894,_0x1a6bed,_0x299e49,_0x1bb9e3,_0x4c9575,_0x5c4dfd,_0x5c8f94){var _0x44fa25={'method':'GET','uri':'','headers':{'Authorization':_0x47e1('0x46')+_0x516894},'json':!![]};switch(_0x5c8f94[_0x47e1('0x4e')]){case _0x47e1('0x4f'):_0x44fa25[_0x47e1('0x50')]=_0x47e1('0x41')+_0x1a6bed+_0x47e1('0x51')+_0x4c9575+'))';return getZohoUser(_0x44fa25,_0x47e1('0x52'))[_0x47e1('0x2d')](function(_0x2e19d9){if(_0x2e19d9)return _0x2e19d9;_0x44fa25[_0x47e1('0x50')]=_0x47e1('0x41')+_0x1a6bed+_0x47e1('0x53')+_0x4c9575+'))';return getZohoUser(_0x44fa25,_0x47e1('0x54'))['then'](function(_0x5dc786){if(_0x5dc786)return _0x5dc786;if(_0x5c8f94['moduleCreate']!=_0x47e1('0x55')){return createEndUser(_0x516894,_0x1a6bed,_0x1bb9e3,_0x4c9575,_0x5c4dfd,_0x5c8f94);}else{return{};}});});break;case _0x47e1('0x56'):_0x44fa25[_0x47e1('0x50')]=_0x47e1('0x41')+_0x1a6bed+_0x47e1('0x51')+_0x4c9575+'))';return getZohoUser(_0x44fa25,_0x47e1('0x52'))[_0x47e1('0x2d')](function(_0x4de78b){if(_0x4de78b)return _0x4de78b;if(_0x5c8f94[_0x47e1('0x4a')]!=_0x47e1('0x55')){return createEndUser(_0x516894,_0x1a6bed,_0x1bb9e3,_0x4c9575,_0x5c4dfd,_0x5c8f94);}else{return{};}});break;case'lead':_0x44fa25[_0x47e1('0x50')]=_0x47e1('0x41')+_0x1a6bed+_0x47e1('0x53')+_0x4c9575+'))';return getZohoUser(_0x44fa25,_0x47e1('0x54'))['then'](function(_0x53cd96){if(_0x53cd96)return _0x53cd96;if(_0x5c8f94['moduleCreate']!='nothing'){return createEndUser(_0x516894,_0x1a6bed,_0x1bb9e3,_0x4c9575,_0x5c4dfd,_0x5c8f94);}else{return{};}});break;}}function getCall(_0x4613a8,_0x53429f,_0x13c136,_0x5be60c,_0x34c13d,_0x36aa9a,_0x5c0c87,_0x3c7e9e){logger['info']('Creating\x20new\x20call...');var _0x48832d={};_0x48832d[_0x47e1('0x57')]={'name':!_['isNil'](_0x5be60c[_0x47e1('0x44')][_0x47e1('0x1c')])&&!_[_0x47e1('0x20')](_0x5be60c['profile'][_0x47e1('0x1c')])&&_0x5be60c['profile']['name']===_0x47e1('0x58')?_0x5be60c[_0x47e1('0x44')][_0x47e1('0x1c')]:!_[_0x47e1('0x20')](_0x5be60c[_0x47e1('0x59')])?_0x5be60c[_0x47e1('0x59')]+'\x20'+_0x5be60c[_0x47e1('0x45')]:_0x5be60c[_0x47e1('0x45')],'id':_0x5be60c['id']};_0x48832d[_0x47e1('0x5a')]=intUtil['getString'](_0x36aa9a['Subjects'],_0x5c0c87,'\x20');_0x48832d[_0x47e1('0x5b')]=intUtil[_0x47e1('0x5c')](_0x36aa9a['Descriptions'],_0x5c0c87,'\x0a');if(_0x34c13d[_0x47e1('0x40')]===_0x47e1('0x52')){_0x48832d[_0x47e1('0x5d')]={'name':!_[_0x47e1('0x20')](_0x34c13d['Full_Name'])?_0x34c13d['Full_Name']:!_[_0x47e1('0x20')](_0x34c13d[_0x47e1('0x5e')])?_0x34c13d[_0x47e1('0x5e')]+'\x20'+_0x34c13d['Last_Name']:_0x34c13d[_0x47e1('0x5f')],'id':_0x34c13d['id']};}if(_0x34c13d['enduserType']===_0x47e1('0x54')){_0x48832d[_0x47e1('0x60')]={'name':!_[_0x47e1('0x20')](_0x34c13d[_0x47e1('0x61')])?_0x34c13d['Full_Name']:!_[_0x47e1('0x20')](_0x34c13d[_0x47e1('0x5e')])?_0x34c13d['First_Name']+'\x20'+_0x34c13d[_0x47e1('0x5f')]:_0x34c13d[_0x47e1('0x5f')],'id':_0x34c13d['id']};_0x48832d[_0x47e1('0x62')]=_[_0x47e1('0x43')](_0x34c13d[_0x47e1('0x40')]);}if(_0x5c0c87[_0x47e1('0x63')]){_0x48832d[_0x47e1('0x64')]=moment[_0x47e1('0x65')](parseInt(_0x5c0c87[_0x47e1('0x63')])*0x3e8)[_0x47e1('0x66')](_0x47e1('0x67'));}else if(_0x5c0c87[_0x47e1('0x68')]&&_0x5c0c87[_0x47e1('0x69')]){_0x48832d['Call_Duration']=moment[_0x47e1('0x65')](moment(_0x5c0c87[_0x47e1('0x69')],_0x47e1('0x6a'))['diff'](moment(_0x5c0c87[_0x47e1('0x6b')],'YYYY-MM-DDTHH:mm:ss')))[_0x47e1('0x66')](_0x47e1('0x67'));}switch(_0x5c0c87[_0x47e1('0x6c')]){case _0x47e1('0x6d'):_0x48832d[_0x47e1('0x6e')]='Called';break;case'complete':case _0x47e1('0x6f'):_0x48832d['Call_Result']=_0x47e1('0x70');break;case _0x47e1('0x71'):_0x48832d['Call_Result']=_0x47e1('0x72');break;case _0x47e1('0x73'):_0x48832d['Call_Result']=_0x47e1('0x74');break;case _0x47e1('0x75'):_0x48832d[_0x47e1('0x6e')]=_0x47e1('0x76');default:}_0x48832d['Call_Start_Time']=(_0x3c7e9e===_0x47e1('0x77')?moment(_0x5c0c87[_0x47e1('0x6b')])['format'](_0x47e1('0x6a')):moment(_0x5c0c87[_0x47e1('0x78')])[_0x47e1('0x66')](_0x47e1('0x6a')))||moment()[_0x47e1('0x66')]('YYYY-MM-DDTHH:mm:ss');_0x48832d['Call_Type']=_0x3c7e9e||'Inbound';_0x48832d=_[_0x47e1('0x79')](_0x48832d,getCustomFields(_0x36aa9a[_0x47e1('0x7a')],_0x5c0c87));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x53429f+'/crm/v2/Calls','headers':{'Authorization':_0x47e1('0x46')+_0x4613a8},'body':{'data':[_0x48832d]},'json':!![]})[_0x47e1('0x2d')](function(_0x1813bf){if(_0x1813bf&&_0x1813bf[_0x47e1('0x3f')][0x0][_0x47e1('0x47')]==='SUCCESS'){logger[_0x47e1('0x37')](_0x47e1('0x7b'));return{'id':_0x1813bf[_0x47e1('0x3f')][0x0][_0x47e1('0x49')]['id']};}})[_0x47e1('0x2e')](function(_0x222c0d){logger[_0x47e1('0x37')](_0x47e1('0x7c'),_0x222c0d[_0x47e1('0x31')]);console['log'](_0x47e1('0x7c'),_0x222c0d);});}exports[_0x47e1('0x7d')]=function(_0x26ea6d,_0x23bb70,_0x20e6dc,_0x193511,_0x1d3922,_0x1f0caf){var _0x4862c1,_0x570ab2,_0x520d42;_0x1f0caf['host']=intUtil[_0x47e1('0x7e')](_0x1f0caf[_0x47e1('0x7f')]);_0x1f0caf[_0x47e1('0x80')]=intUtil[_0x47e1('0x7e')](_0x1f0caf[_0x47e1('0x80')]);if(_0x1d3922&&_0x1d3922[_0x47e1('0x81')]){logger[_0x47e1('0x37')]('[QUEUE]',_0x47e1('0x82'));_0x23bb70[_0x47e1('0x83')]=_0x1f0caf[_0x47e1('0x80')]+'/api/voice/recordings/'+_0x23bb70[_0x47e1('0x84')]+_0x47e1('0x85')+md5(_0x23bb70[_0x47e1('0x84')]);}else{_0x23bb70['recordingURL']='';}var _0x11a626=_0x1f0caf['host']===_0x47e1('0x86')?'eu':_0x47e1('0x87');return getAccessToken(_0x1f0caf)[_0x47e1('0x2d')](function(_0x30ed09){_0x520d42=_0x30ed09;return getUser(_0x520d42,_0x11a626,_0x1f0caf,_0x193511[_0x47e1('0x36')]);})['then'](function(_0x35b3a2){_0x4862c1=_0x35b3a2;logger[_0x47e1('0x37')](_0x47e1('0x88'),_0x4862c1['id']);return getEndUser(_0x520d42,_0x11a626,_0x1f0caf,_0x23bb70[_0x47e1('0x89')],_0x23bb70[_0x47e1('0x8a')],_0x4862c1,_0x20e6dc);})[_0x47e1('0x2d')](function(_0x55e2d4){_0x570ab2=_0x55e2d4;return getCall(_0x520d42,_0x11a626,_0x1f0caf,_0x4862c1,_0x570ab2,_0x20e6dc,_0x23bb70,_0x47e1('0x8b'));})['then'](function(_0x52b5ed){if(_0x52b5ed){logger[_0x47e1('0x37')](_0x47e1('0x8c'),_0x52b5ed['id']);logger[_0x47e1('0x37')]('[QUEUE]',_0x47e1('0x8d'));emit(util[_0x47e1('0x66')](_0x47e1('0x8e'),_0x193511['name']),_0x47e1('0x8f'),{'uri':_0x47e1('0x90')+_0x1f0caf[_0x47e1('0x7f')]+_0x47e1('0x91')+_0x52b5ed['id']});}})[_0x47e1('0x2e')](function(_0x298716){logger[_0x47e1('0x2f')](_0x47e1('0x92'),JSON[_0x47e1('0x10')](_0x298716));});};exports[_0x47e1('0x77')]=function(_0x543325,_0x147ab8,_0x1e28f9,_0x226661,_0x3bc162,_0x2692f0,_0x13104c){var _0x60b8bf,_0x33fa7d,_0x58a218;_0x2692f0[_0x47e1('0x7f')]=intUtil['stripTrailingSlash'](_0x2692f0[_0x47e1('0x7f')]);_0x2692f0[_0x47e1('0x80')]=intUtil[_0x47e1('0x7e')](_0x2692f0[_0x47e1('0x80')]);if(_0x13104c&&_0x13104c[_0x47e1('0x93')]&&_0x13104c['recordingFormat']!=='none'){logger[_0x47e1('0x37')](_0x47e1('0x94'),'Recording\x20is\x20enabled!');_0x147ab8[_0x47e1('0x83')]=_0x2692f0[_0x47e1('0x80')]+_0x47e1('0x95')+_0x147ab8[_0x47e1('0x84')]+_0x47e1('0x85')+md5(_0x147ab8[_0x47e1('0x84')]);}var _0x42e7c7=_0x2692f0[_0x47e1('0x7f')]===_0x47e1('0x86')?'eu':'com';return getAccessToken(_0x2692f0)[_0x47e1('0x2d')](function(_0x26ec50){_0x58a218=_0x26ec50;return getUser(_0x58a218,_0x42e7c7,_0x2692f0,_0x226661[_0x47e1('0x36')]);})[_0x47e1('0x2d')](function(_0x3e6095){_0x60b8bf=_0x3e6095;logger[_0x47e1('0x37')]('The\x20User\x20ID\x20is:',_0x60b8bf['id']);return getEndUser(_0x58a218,_0x42e7c7,_0x2692f0,_0x147ab8[_0x47e1('0x96')],_0x147ab8[_0x47e1('0x97')],_0x60b8bf,_0x1e28f9);})[_0x47e1('0x2d')](function(_0x487828){_0x33fa7d=_0x487828;return getCall(_0x58a218,_0x42e7c7,_0x2692f0,_0x60b8bf,_0x33fa7d,_0x1e28f9,_0x147ab8,_0x47e1('0x98'));})['then'](function(_0x2365c9){if(_0x2365c9){logger['info'](_0x47e1('0x8c'),_0x2365c9['id']);logger[_0x47e1('0x37')](_0x47e1('0x94'),_0x47e1('0x8d'));emit(util[_0x47e1('0x66')](_0x47e1('0x8e'),_0x226661[_0x47e1('0x1c')]),_0x47e1('0x8f'),{'uri':_0x47e1('0x90')+_0x2692f0['host']+_0x47e1('0x91')+_0x2365c9['id']});}})['catch'](function(_0xe24369){logger[_0x47e1('0x2f')]('[OUTBOUND]',JSON[_0x47e1('0x10')](_0xe24369));});};exports[_0x47e1('0x99')]=function(_0x48ca1f,_0x38c8c4,_0x4b4442,_0xd4635f,_0x1be956,_0x295b58){var _0x3aac47,_0x5f3a40,_0x47eb46;_0x295b58[_0x47e1('0x7f')]=intUtil[_0x47e1('0x7e')](_0x295b58[_0x47e1('0x7f')]);_0x295b58[_0x47e1('0x80')]=intUtil[_0x47e1('0x7e')](_0x295b58[_0x47e1('0x80')]);if(_0x1be956&&_0x1be956[_0x47e1('0x81')]){logger[_0x47e1('0x37')]('['+_0x38c8c4['lastevent'][_0x47e1('0x9a')]()+']',_0x47e1('0x82'));_0x38c8c4[_0x47e1('0x83')]=_0x295b58[_0x47e1('0x80')]+'/api/voice/recordings/'+_0x38c8c4[_0x47e1('0x84')]+_0x47e1('0x85')+md5(_0x38c8c4[_0x47e1('0x84')]);}else{_0x38c8c4[_0x47e1('0x83')]='';}var _0x5da222=_0x295b58[_0x47e1('0x7f')]===_0x47e1('0x86')?'eu':_0x47e1('0x87');return getAccessToken(_0x295b58)[_0x47e1('0x2d')](function(_0x5c74d6){_0x47eb46=_0x5c74d6;return getUser(_0x47eb46,_0x5da222,_0x295b58);})[_0x47e1('0x2d')](function(_0x5e9e31){_0x3aac47=_0x5e9e31;logger[_0x47e1('0x37')]('The\x20User\x20ID\x20is:',_0x3aac47['id']);return getEndUser(_0x47eb46,_0x5da222,_0x295b58,_0x38c8c4['calleridname'],_0x38c8c4[_0x47e1('0x8a')],_0x3aac47,_0x4b4442);})[_0x47e1('0x2d')](function(_0x2c7c51){_0x5f3a40=_0x2c7c51;return getCall(_0x47eb46,_0x5da222,_0x295b58,_0x3aac47,_0x5f3a40,_0x4b4442,_0x38c8c4,_0x47e1('0x8b'));})[_0x47e1('0x2d')](function(_0x182c7a){if(_0x182c7a){logger[_0x47e1('0x37')](_0x47e1('0x8c'),_0x182c7a['id']);}})[_0x47e1('0x2e')](function(_0x24ebad){logger[_0x47e1('0x2f')]('['+_0x38c8c4[_0x47e1('0x6c')]['toUpperCase']()+']',JSON[_0x47e1('0x10')](_0x24ebad));});};
\ No newline at end of file
+var _0x8e2b=['Failing\x20creating\x20the\x20access_token','stack','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','POST','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','data','details','enduserType','Error:\x20','catch','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','code','SUCCESS','Call\x20created!','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[OUTBOUND]','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','error'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x8e2b,0x19a));var _0xb8e2=function(_0x2976de,_0x4c546d){_0x2976de=_0x2976de-0x0;var _0xecbf51=_0x8e2b[_0x2976de];return _0xecbf51;};'use strict';var _=require(_0xb8e2('0x0'));var rp=require(_0xb8e2('0x1'));var md5=require('md5');var util=require(_0xb8e2('0x2'));var intUtil=require(_0xb8e2('0x3'));var moment=require(_0xb8e2('0x4'));var Redis=require(_0xb8e2('0x5'));var BPromise=require('bluebird');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zoho');config[_0xb8e2('0x6')]=_['defaults'](config[_0xb8e2('0x6')],{'host':_0xb8e2('0x7'),'port':0x18eb});var io=require(_0xb8e2('0x8'))(new Redis(config[_0xb8e2('0x6')]));function emit(_0x4d059b,_0x314d51,_0x485ac5){io['to'](_0x4d059b)[_0xb8e2('0x9')](_0x314d51,_0x485ac5);}function request(_0x2f3ca0){logger[_0xb8e2('0xa')](_0xb8e2('0xb'),JSON[_0xb8e2('0xc')](_0x2f3ca0));return rp(_0x2f3ca0);}function getCustomFields(_0x360093,_0x48913e){var _0x37ccbc={};if(_0x360093['length']>0x0){_[_0xb8e2('0xd')](_0x360093,function(_0x43b3d8){if(_[_0xb8e2('0xe')]([_0xb8e2('0xf'),_0xb8e2('0x10')],_0x43b3d8[_0xb8e2('0x11')])&&_0x43b3d8[_0xb8e2('0x12')]){_0x37ccbc[_0x43b3d8[_0xb8e2('0x12')]]=_0x43b3d8['content']['toString']();}else if(_0x43b3d8[_0xb8e2('0x11')]===_0xb8e2('0x13')&&_0x43b3d8['variableName']&&_0x43b3d8[_0xb8e2('0x12')]&&_0x48913e[_0x43b3d8[_0xb8e2('0x14')]]){_0x37ccbc[_0x43b3d8[_0xb8e2('0x12')]]=_0x48913e[_0x43b3d8[_0xb8e2('0x14')]][_0xb8e2('0x15')]();}else if(_0x43b3d8[_0xb8e2('0x11')]===_0xb8e2('0x16')&&_0x43b3d8[_0xb8e2('0x17')]&&_0x43b3d8[_0xb8e2('0x17')][_0xb8e2('0x18')]&&_0x43b3d8[_0xb8e2('0x12')]&&_0x48913e[_0x43b3d8['Variable'][_0xb8e2('0x18')][_0xb8e2('0x19')]()]){_0x37ccbc[_0x43b3d8['idField']]=_0x48913e[_0x43b3d8[_0xb8e2('0x17')][_0xb8e2('0x18')][_0xb8e2('0x19')]()][_0xb8e2('0x15')]();}});}return _0x37ccbc;}function getName(_0x5e0973){if(_0x5e0973[_0xb8e2('0x1a')]('\x20')>0x0){var _0x39d18d=_0x5e0973[_0xb8e2('0x1b')](/ (.+)/);if(_0x39d18d[0x1]){return _0x39d18d;}}return[_0x5e0973,_0x5e0973];}var accountsTokens={};function getAccessToken(_0x3927af){return new Promise(function(_0x5d066a,_0x4c5bad){if(!_[_0xb8e2('0x1c')](accountsTokens[_0x3927af['id']])&&!_[_0xb8e2('0x1c')](accountsTokens[_0x3927af['id']][_0xb8e2('0x1d')])){if(moment()[_0xb8e2('0x1e')](accountsTokens[_0x3927af['id']][_0xb8e2('0x1f')])){_0x5d066a(accountsTokens[_0x3927af['id']][_0xb8e2('0x1d')]);}}var _0x555ffd;switch(_0x3927af[_0xb8e2('0x20')]){case'US':_0x555ffd='https://accounts.zoho.com';break;case'AU':_0x555ffd=_0xb8e2('0x21');break;case'EU':_0x555ffd=_0xb8e2('0x22');break;case'IN':_0x555ffd=_0xb8e2('0x23');break;case'CN':_0x555ffd='https://accounts.zoho.com.cn';break;default:_0x555ffd=_0xb8e2('0x22');break;}var _0x453405={'method':'POST','uri':_0x555ffd+_0xb8e2('0x24'),'qs':{'refresh_token':_0x3927af['refreshToken'],'client_id':_0x3927af[_0xb8e2('0x25')],'client_secret':_0x3927af[_0xb8e2('0x26')],'grant_type':_0xb8e2('0x27')},'json':!![]};return rp(_0x453405)[_0xb8e2('0x28')](function(_0x55d6ce){accountsTokens[_0x3927af['id']]={'access_token':_0x55d6ce[_0xb8e2('0x1d')],'expires_in':moment()['add'](_0x55d6ce[_0xb8e2('0x1f')],_0xb8e2('0x29'))};_0x5d066a(_0x55d6ce[_0xb8e2('0x1d')]);})['catch'](function(_0x524100){logger[_0xb8e2('0x2a')](_0xb8e2('0x2b'),_0x524100[_0xb8e2('0x2c')]);_0x4c5bad(_0x524100);});});}function getUser(_0x52955a,_0x1c5137,_0x487f5d,_0x30758a){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0xb8e2('0x2d')]('https://www.zohoapis.%s/crm/v2/users',_0x1c5137),'qs':{'type':_0xb8e2('0x2e')},'headers':{'Authorization':_0xb8e2('0x2f')+_0x52955a},'json':!![]})['then'](function(_0x9e9556){if(_0x9e9556[_0xb8e2('0x30')]){var _0x1d20d7=-0x1;if(_['isArrayLikeObject'](_0x9e9556[_0xb8e2('0x30')])){if(!_['isNil'](_0x30758a)){_0x1d20d7=_[_0xb8e2('0x31')](_0x9e9556['users'],function(_0x4fa6ac){return _0x4fa6ac[_0xb8e2('0x32')]===_0x30758a;});}if(_0x1d20d7>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xb8e2('0x33')](_0xb8e2('0x34'));_0x1d20d7=_[_0xb8e2('0x31')](_0x9e9556[_0xb8e2('0x30')],function(_0x23086f){return _0x23086f['profile']['name']===_0xb8e2('0x35');});}return _0x9e9556['users'][_0x1d20d7];}else{if(_0x9e9556[_0xb8e2('0x36')][_0xb8e2('0x37')]['name']==='Administrator'){logger[_0xb8e2('0x33')](_0xb8e2('0x34'));user=_0x9e9556['user'];return user;}else{logger[_0xb8e2('0x2a')](_0xb8e2('0x38'),JSON[_0xb8e2('0xc')](_0x9e9556));throw new Error(_0xb8e2('0x39')+JSON['stringify'](_0x9e9556));}}}else{logger[_0xb8e2('0x2a')](_0xb8e2('0x38'),JSON['stringify'](_0x9e9556));throw new Error(_0xb8e2('0x39')+JSON[_0xb8e2('0xc')](_0x9e9556));}})['catch'](function(_0x2a5903){console['error'](_0x2a5903);});}function getZohoUser(_0x44be19,_0x4749c0){return new BPromise(function(_0x12ef23,_0x554164){request(_0x44be19)['then'](function(_0x4888fc){var _0xe3172e=null;if(_0x4888fc){_0xe3172e=_0x4888fc['data'][0x0];_0xe3172e['enduserType']=_0x4749c0;}_0x12ef23(_0xe3172e);})['catch'](function(_0x591548){_0x554164(_0x591548);});});}function createEndUser(_0x30a0f9,_0x5f34f0,_0x19e114,_0x12bbd3,_0x17b393,_0x178969){var _0x19e114=getName(_0x19e114);return request({'method':_0xb8e2('0x3a'),'uri':_0xb8e2('0x3b')+_0x5f34f0+'/crm/v2/'+_[_0xb8e2('0x3c')](_0x178969[_0xb8e2('0x3d')])+'s','body':{'data':[{'Last_Name':_0x19e114[0x1],'First_Name':_0x19e114[0x0],'Phone':_0x12bbd3,'Owner':{'name':!_[_0xb8e2('0x1c')](_0x17b393[_0xb8e2('0x3e')][_0xb8e2('0x18')])?_0x17b393[_0xb8e2('0x3e')][_0xb8e2('0x18')]:!_[_0xb8e2('0x1c')](_0x17b393[_0xb8e2('0x3f')])?_0x17b393[_0xb8e2('0x3f')]+'\x20'+_0x17b393[_0xb8e2('0x40')]:_0x17b393['last_name'],'id':_0x17b393['id']}}]},'headers':{'Authorization':_0xb8e2('0x2f')+_0x30a0f9},'json':!![]})[_0xb8e2('0x28')](function(_0x1cb3b5){if(_0x1cb3b5&&_0x1cb3b5[_0xb8e2('0x41')][0x0]['code']==='SUCCESS'){var _0x142190=_0x1cb3b5[_0xb8e2('0x41')][0x0][_0xb8e2('0x42')];_0x142190[_0xb8e2('0x43')]=_[_0xb8e2('0x3c')](_0x178969[_0xb8e2('0x3d')])+'s';return _0x142190;}logger[_0xb8e2('0x2a')]('The\x20failing\x20result\x20is',JSON[_0xb8e2('0xc')](data));throw new Error(_0xb8e2('0x44')+JSON[_0xb8e2('0xc')](data));})[_0xb8e2('0x45')](function(_0x1781d3){console['log'](_0xb8e2('0x46'),_0x1781d3);});}function getEndUser(_0xf95bc3,_0x233f4f,_0x1b65f6,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0){var _0x5bd127={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xf95bc3},'json':!![]};switch(_0x16d6a0[_0xb8e2('0x47')]){case _0xb8e2('0x48'):_0x5bd127[_0xb8e2('0x49')]=_0xb8e2('0x3b')+_0x233f4f+_0xb8e2('0x4a')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4b'))[_0xb8e2('0x28')](function(_0x125878){if(_0x125878)return _0x125878;_0x5bd127[_0xb8e2('0x49')]='https://www.zohoapis.'+_0x233f4f+_0xb8e2('0x4c')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4d'))[_0xb8e2('0x28')](function(_0x50c68c){if(_0x50c68c)return _0x50c68c;if(_0x16d6a0[_0xb8e2('0x3d')]!=_0xb8e2('0x4e')){return createEndUser(_0xf95bc3,_0x233f4f,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0);}else{return{};}});});break;case _0xb8e2('0x4f'):_0x5bd127['uri']=_0xb8e2('0x3b')+_0x233f4f+_0xb8e2('0x4a')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4b'))[_0xb8e2('0x28')](function(_0x4465b9){if(_0x4465b9)return _0x4465b9;if(_0x16d6a0['moduleCreate']!=_0xb8e2('0x4e')){return createEndUser(_0xf95bc3,_0x233f4f,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0);}else{return{};}});break;case _0xb8e2('0x50'):_0x5bd127['uri']=_0xb8e2('0x3b')+_0x233f4f+_0xb8e2('0x4c')+_0xda226e+'))';return getZohoUser(_0x5bd127,_0xb8e2('0x4d'))[_0xb8e2('0x28')](function(_0x4b1a62){if(_0x4b1a62)return _0x4b1a62;if(_0x16d6a0[_0xb8e2('0x3d')]!=_0xb8e2('0x4e')){return createEndUser(_0xf95bc3,_0x233f4f,_0x4bde0e,_0xda226e,_0x274c28,_0x16d6a0);}else{return{};}});break;}}function getCall(_0x17fb73,_0x1aa8af,_0x215ff3,_0x512b85,_0x3bbda4,_0x4f538a,_0x1a958e,_0x4b4cdb){logger[_0xb8e2('0x33')](_0xb8e2('0x51'));var _0x50de9a={};_0x50de9a[_0xb8e2('0x52')]={'name':!_[_0xb8e2('0x1c')](_0x512b85[_0xb8e2('0x3e')][_0xb8e2('0x18')])&&!_['isNil'](_0x512b85['profile'][_0xb8e2('0x18')])&&_0x512b85[_0xb8e2('0x37')][_0xb8e2('0x18')]===_0xb8e2('0x53')?_0x512b85[_0xb8e2('0x3e')]['name']:!_['isNil'](_0x512b85['first_name'])?_0x512b85['first_name']+'\x20'+_0x512b85[_0xb8e2('0x40')]:_0x512b85[_0xb8e2('0x40')],'id':_0x512b85['id']};_0x50de9a[_0xb8e2('0x54')]=intUtil[_0xb8e2('0x55')](_0x4f538a['Subjects'],_0x1a958e,'\x20');_0x50de9a['Description']=intUtil[_0xb8e2('0x55')](_0x4f538a[_0xb8e2('0x56')],_0x1a958e,'\x0a');if(_0x3bbda4[_0xb8e2('0x43')]===_0xb8e2('0x4b')){_0x50de9a[_0xb8e2('0x57')]={'name':!_['isNil'](_0x3bbda4[_0xb8e2('0x58')])?_0x3bbda4[_0xb8e2('0x58')]:!_[_0xb8e2('0x1c')](_0x3bbda4[_0xb8e2('0x59')])?_0x3bbda4[_0xb8e2('0x59')]+'\x20'+_0x3bbda4[_0xb8e2('0x5a')]:_0x3bbda4[_0xb8e2('0x5a')],'id':_0x3bbda4['id']};}if(_0x3bbda4['enduserType']===_0xb8e2('0x4d')){_0x50de9a['What_Id']={'name':!_[_0xb8e2('0x1c')](_0x3bbda4[_0xb8e2('0x58')])?_0x3bbda4[_0xb8e2('0x58')]:!_[_0xb8e2('0x1c')](_0x3bbda4[_0xb8e2('0x59')])?_0x3bbda4[_0xb8e2('0x59')]+'\x20'+_0x3bbda4[_0xb8e2('0x5a')]:_0x3bbda4[_0xb8e2('0x5a')],'id':_0x3bbda4['id']};_0x50de9a[_0xb8e2('0x5b')]=_[_0xb8e2('0x3c')](_0x3bbda4[_0xb8e2('0x43')]);}if(_0x1a958e[_0xb8e2('0x5c')]){_0x50de9a[_0xb8e2('0x5d')]=moment[_0xb8e2('0x5e')](parseInt(_0x1a958e[_0xb8e2('0x5c')])*0x3e8)[_0xb8e2('0x2d')](_0xb8e2('0x5f'));}else if(_0x1a958e[_0xb8e2('0x60')]&&_0x1a958e[_0xb8e2('0x61')]){_0x50de9a[_0xb8e2('0x5d')]=moment[_0xb8e2('0x5e')](moment(_0x1a958e['endtime'],_0xb8e2('0x62'))[_0xb8e2('0x63')](moment(_0x1a958e[_0xb8e2('0x64')],'YYYY-MM-DDTHH:mm:ss')))[_0xb8e2('0x2d')](_0xb8e2('0x5f'));}switch(_0x1a958e[_0xb8e2('0x65')]){case _0xb8e2('0x66'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x68');break;case'complete':case _0xb8e2('0x69'):_0x50de9a['Call_Result']=_0xb8e2('0x6a');break;case _0xb8e2('0x6b'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x6c');break;case _0xb8e2('0x6d'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x6e');break;case _0xb8e2('0x6f'):_0x50de9a[_0xb8e2('0x67')]=_0xb8e2('0x70');default:}_0x50de9a[_0xb8e2('0x71')]=(_0x4b4cdb===_0xb8e2('0x72')?moment(_0x1a958e['starttime'])['format'](_0xb8e2('0x62')):moment(_0x1a958e[_0xb8e2('0x73')])[_0xb8e2('0x2d')](_0xb8e2('0x62')))||moment()[_0xb8e2('0x2d')](_0xb8e2('0x62'));_0x50de9a['Call_Type']=_0x4b4cdb||_0xb8e2('0x74');_0x50de9a=_[_0xb8e2('0x75')](_0x50de9a,getCustomFields(_0x4f538a['Fields'],_0x1a958e));return request({'method':'POST','uri':_0xb8e2('0x3b')+_0x1aa8af+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x17fb73},'body':{'data':[_0x50de9a]},'json':!![]})[_0xb8e2('0x28')](function(_0x4b3df8){if(_0x4b3df8&&_0x4b3df8['data'][0x0][_0xb8e2('0x76')]===_0xb8e2('0x77')){logger[_0xb8e2('0x33')](_0xb8e2('0x78'));return{'id':_0x4b3df8[_0xb8e2('0x41')][0x0][_0xb8e2('0x42')]['id']};}})[_0xb8e2('0x45')](function(_0x398769){logger[_0xb8e2('0x33')]('err',_0x398769[_0xb8e2('0x2c')]);console[_0xb8e2('0x79')](_0xb8e2('0x7a'),_0x398769);});}exports[_0xb8e2('0x7b')]=function(_0x169400,_0x29ae6a,_0x3a58dd,_0x112fab,_0x1478e8,_0x2f8f6b){var _0x286c8c,_0x1782a6,_0x27b8b3;_0x2f8f6b[_0xb8e2('0x7c')]=intUtil[_0xb8e2('0x7d')](_0x2f8f6b[_0xb8e2('0x7c')]);_0x2f8f6b[_0xb8e2('0x7e')]=intUtil[_0xb8e2('0x7d')](_0x2f8f6b[_0xb8e2('0x7e')]);if(_0x1478e8&&_0x1478e8[_0xb8e2('0x7f')]){logger[_0xb8e2('0x33')](_0xb8e2('0x80'),_0xb8e2('0x81'));_0x29ae6a[_0xb8e2('0x82')]=_0x2f8f6b[_0xb8e2('0x7e')]+_0xb8e2('0x83')+_0x29ae6a[_0xb8e2('0x84')]+_0xb8e2('0x85')+md5(_0x29ae6a[_0xb8e2('0x84')]);}else{_0x29ae6a[_0xb8e2('0x82')]='';}var _0x169b1e=_0x2f8f6b[_0xb8e2('0x7c')]===_0xb8e2('0x86')?'eu':_0xb8e2('0x87');return getAccessToken(_0x2f8f6b)[_0xb8e2('0x28')](function(_0x4236c1){_0x27b8b3=_0x4236c1;return getUser(_0x27b8b3,_0x169b1e,_0x2f8f6b,_0x112fab[_0xb8e2('0x32')]);})['then'](function(_0x3a7b26){_0x286c8c=_0x3a7b26;logger[_0xb8e2('0x33')](_0xb8e2('0x88'),_0x286c8c['id']);return getEndUser(_0x27b8b3,_0x169b1e,_0x2f8f6b,_0x29ae6a[_0xb8e2('0x89')],_0x29ae6a[_0xb8e2('0x8a')],_0x286c8c,_0x3a58dd);})['then'](function(_0x44b885){_0x1782a6=_0x44b885;return getCall(_0x27b8b3,_0x169b1e,_0x2f8f6b,_0x286c8c,_0x1782a6,_0x3a58dd,_0x29ae6a,_0xb8e2('0x74'));})[_0xb8e2('0x28')](function(_0x161a2c){if(_0x161a2c){logger['info']('The\x20Call\x20ID\x20is:',_0x161a2c['id']);logger[_0xb8e2('0x33')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb8e2('0x2d')](_0xb8e2('0x8b'),_0x112fab[_0xb8e2('0x18')]),_0xb8e2('0x8c'),{'uri':_0xb8e2('0x8d')+_0x2f8f6b[_0xb8e2('0x7c')]+_0xb8e2('0x8e')+_0x161a2c['id']});}})[_0xb8e2('0x45')](function(_0x5452d2){logger['error'](_0xb8e2('0x80'),JSON[_0xb8e2('0xc')](_0x5452d2));});};exports[_0xb8e2('0x72')]=function(_0x43fa53,_0x43e788,_0xd93d27,_0x127ce4,_0x35e1c9,_0x27c324,_0x555b20){var _0x1cb2e4,_0x1bbaa8,_0x178118;_0x27c324[_0xb8e2('0x7c')]=intUtil[_0xb8e2('0x7d')](_0x27c324[_0xb8e2('0x7c')]);_0x27c324[_0xb8e2('0x7e')]=intUtil[_0xb8e2('0x7d')](_0x27c324['serverUrl']);if(_0x555b20&&_0x555b20[_0xb8e2('0x8f')]&&_0x555b20[_0xb8e2('0x8f')]!==_0xb8e2('0x90')){logger[_0xb8e2('0x33')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x43e788[_0xb8e2('0x82')]=_0x27c324[_0xb8e2('0x7e')]+_0xb8e2('0x83')+_0x43e788['uniqueid']+_0xb8e2('0x85')+md5(_0x43e788['uniqueid']);}var _0xdb3f7c=_0x27c324[_0xb8e2('0x7c')]===_0xb8e2('0x86')?'eu':_0xb8e2('0x87');return getAccessToken(_0x27c324)[_0xb8e2('0x28')](function(_0x548537){_0x178118=_0x548537;return getUser(_0x178118,_0xdb3f7c,_0x27c324,_0x127ce4['email']);})['then'](function(_0x4cb5d1){_0x1cb2e4=_0x4cb5d1;logger[_0xb8e2('0x33')]('The\x20User\x20ID\x20is:',_0x1cb2e4['id']);return getEndUser(_0x178118,_0xdb3f7c,_0x27c324,_0x43e788[_0xb8e2('0x91')],_0x43e788[_0xb8e2('0x92')],_0x1cb2e4,_0xd93d27);})['then'](function(_0x43f445){_0x1bbaa8=_0x43f445;return getCall(_0x178118,_0xdb3f7c,_0x27c324,_0x1cb2e4,_0x1bbaa8,_0xd93d27,_0x43e788,_0xb8e2('0x93'));})['then'](function(_0x42d377){if(_0x42d377){logger[_0xb8e2('0x33')](_0xb8e2('0x94'),_0x42d377['id']);logger[_0xb8e2('0x33')](_0xb8e2('0x95'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb8e2('0x8b'),_0x127ce4[_0xb8e2('0x18')]),_0xb8e2('0x8c'),{'uri':_0xb8e2('0x8d')+_0x27c324[_0xb8e2('0x7c')]+_0xb8e2('0x8e')+_0x42d377['id']});}})[_0xb8e2('0x45')](function(_0x3b5b5d){logger[_0xb8e2('0x2a')]('[OUTBOUND]',JSON[_0xb8e2('0xc')](_0x3b5b5d));});};exports['unmanaged']=function(_0x1ee263,_0x386ec9,_0x14fbd3,_0x2d4539,_0x58e1d0,_0x4afad8){var _0xf63960,_0x5ca64f,_0x37bf27;_0x4afad8[_0xb8e2('0x7c')]=intUtil[_0xb8e2('0x7d')](_0x4afad8[_0xb8e2('0x7c')]);_0x4afad8[_0xb8e2('0x7e')]=intUtil['stripTrailingSlash'](_0x4afad8[_0xb8e2('0x7e')]);if(_0x58e1d0&&_0x58e1d0[_0xb8e2('0x7f')]){logger[_0xb8e2('0x33')]('['+_0x386ec9[_0xb8e2('0x65')][_0xb8e2('0x96')]()+']',_0xb8e2('0x81'));_0x386ec9[_0xb8e2('0x82')]=_0x4afad8[_0xb8e2('0x7e')]+_0xb8e2('0x83')+_0x386ec9['uniqueid']+_0xb8e2('0x85')+md5(_0x386ec9[_0xb8e2('0x84')]);}else{_0x386ec9['recordingURL']='';}var _0x19dbe=_0x4afad8['host']==='zoho.eu'?'eu':_0xb8e2('0x87');return getAccessToken(_0x4afad8)[_0xb8e2('0x28')](function(_0x1a6720){_0x37bf27=_0x1a6720;return getUser(_0x37bf27,_0x19dbe,_0x4afad8);})[_0xb8e2('0x28')](function(_0x5c3341){_0xf63960=_0x5c3341;logger[_0xb8e2('0x33')](_0xb8e2('0x88'),_0xf63960['id']);return getEndUser(_0x37bf27,_0x19dbe,_0x4afad8,_0x386ec9['calleridname'],_0x386ec9[_0xb8e2('0x8a')],_0xf63960,_0x14fbd3);})[_0xb8e2('0x28')](function(_0x4b5ece){_0x5ca64f=_0x4b5ece;return getCall(_0x37bf27,_0x19dbe,_0x4afad8,_0xf63960,_0x5ca64f,_0x14fbd3,_0x386ec9,_0xb8e2('0x74'));})[_0xb8e2('0x28')](function(_0x31438d){if(_0x31438d){logger[_0xb8e2('0x33')]('The\x20Call\x20ID\x20is:',_0x31438d['id']);}})[_0xb8e2('0x45')](function(_0x4e3857){logger['error']('['+_0x386ec9[_0xb8e2('0x65')][_0xb8e2('0x96')]()+']',JSON['stringify'](_0x4e3857));});};
\ No newline at end of file
index 2f2a7cd..4482bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb06d=['format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','util','mustache','trigger','exec','data2','Script','data3','error'];(function(_0x4f31e0,_0x1b7a10){var _0x3581ff=function(_0x417e7d){while(--_0x417e7d){_0x4f31e0['push'](_0x4f31e0['shift']());}};_0x3581ff(++_0x1b7a10);}(_0xb06d,0x138));var _0xdb06=function(_0x92a9c1,_0x1a3cbb){_0x92a9c1=_0x92a9c1-0x0;var _0x533469=_0xb06d[_0x92a9c1];return _0x533469;};'use strict';var util=require(_0xdb06('0x0'));var sh=require('shelljs');var Mustache=require(_0xdb06('0x1'));var logger=require('../../../../config/logger')(_0xdb06('0x2'));exports[_0xdb06('0x3')]=function(_0x6ae048,_0x4ee6c6){var _0x253b86=_0x6ae048['data2']?_0x6ae048[_0xdb06('0x4')]:_0xdb06('0x5');var _0x1b8b71=_0x6ae048[_0xdb06('0x6')]?Mustache['render'](_0x6ae048[_0xdb06('0x6')],_0x4ee6c6):_0x4ee6c6;sh[_0xdb06('0x3')](_0x1b8b71,function(_0x3d506d,_0x24854f,_0xd9538d){if(_0x3d506d!==0x0){logger[_0xdb06('0x7')](util[_0xdb06('0x8')](_0xdb06('0x9'),_0x253b86,_0x1b8b71,_0x3d506d,_0xd9538d));}else{logger['info'](util[_0xdb06('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x253b86,_0x1b8b71,_0x24854f));}});};
\ No newline at end of file
+var _0x489c=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','exec','data2','render','data3','error'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0x489c,0x12d));var _0xc489=function(_0x2bf2f7,_0x3797ff){_0x2bf2f7=_0x2bf2f7-0x0;var _0x7c9d1c=_0x489c[_0x2bf2f7];return _0x7c9d1c;};'use strict';var util=require(_0xc489('0x0'));var sh=require(_0xc489('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0xc489('0x2')]=function(_0x29f11a,_0x4cba9c){var _0x33bca5=_0x29f11a[_0xc489('0x3')]?_0x29f11a[_0xc489('0x3')]:'Script';var _0x54bb52=_0x29f11a['data3']?Mustache[_0xc489('0x4')](_0x29f11a[_0xc489('0x5')],_0x4cba9c):_0x4cba9c;sh[_0xc489('0x2')](_0x54bb52,function(_0x109e21,_0x2036b6,_0xefe519){if(_0x109e21!==0x0){logger[_0xc489('0x6')](util['format'](_0xc489('0x7'),_0x33bca5,_0x54bb52,_0x109e21,_0xefe519));}else{logger[_0xc489('0x8')](util[_0xc489('0x9')](_0xc489('0xa'),_0x33bca5,_0x54bb52,_0x2036b6));}});};
\ No newline at end of file
index 0517933..0fd04af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6389=['util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','error','stack','GET','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','name','request-promise'];(function(_0x6ff984,_0x52fbd1){var _0x1b8400=function(_0x15ce8c){while(--_0x15ce8c){_0x6ff984['push'](_0x6ff984['shift']());}};_0x1b8400(++_0x52fbd1);}(_0x6389,0x9f));var _0x9638=function(_0x5a41c0,_0x2aaf8c){_0x5a41c0=_0x5a41c0-0x0;var _0x50011b=_0x6389[_0x5a41c0];return _0x50011b;};'use strict';var rp=require(_0x9638('0x0'));var util=require(_0x9638('0x1'));var _=require(_0x9638('0x2'));var Mustache=require(_0x9638('0x3'));var logger=require(_0x9638('0x4'))(_0x9638('0x5'));exports[_0x9638('0x6')]=function(_0xed8184,_0x2866e7){var _0x8ab383,_0xfa76fa;var _0x3319a4={'method':_0xed8184[_0x9638('0x7')][_0x9638('0x8')](),'uri':Mustache[_0x9638('0x9')](_0xed8184[_0x9638('0xa')],_0x2866e7),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xed8184['data5'])===_0x9638('0xb')&&parseInt(_0xed8184[_0x9638('0xc')])>=0x1&&parseInt(_0xed8184[_0x9638('0xc')])<=0xa?parseInt(_0xed8184[_0x9638('0xc')])*0x3e8:0x5*0x3e8};try{_0x3319a4[_0x9638('0xd')]=_0xed8184[_0x9638('0xe')]?JSON[_0x9638('0xf')](Mustache[_0x9638('0x9')](_0xed8184[_0x9638('0xe')],_0x2866e7)):{};}catch(_0x2ee473){logger[_0x9638('0x10')](_0x2ee473[_0x9638('0x11')]);}switch(_0xed8184[_0x9638('0x7')][_0x9638('0x8')]()){case _0x9638('0x12'):case'DELETE':_0x8ab383=null;_0x3319a4['qs']=_0x2866e7;break;case _0x9638('0x13'):case _0x9638('0x14'):if(_0xed8184[_0x9638('0x15')]){try{_0x8ab383=JSON[_0x9638('0xf')](Mustache[_0x9638('0x9')](_0xed8184[_0x9638('0x15')],_0x2866e7));_0x3319a4['body']=_0x8ab383;}catch(_0x4b3a0d){logger[_0x9638('0x10')](_0x4b3a0d[_0x9638('0x11')]);logger[_0x9638('0x10')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x8ab383=_0x2866e7;_0x3319a4[_0x9638('0x16')]=_0x8ab383;}break;}logger[_0x9638('0x17')](util[_0x9638('0x18')](_0x9638('0x19'),_0xed8184[_0x9638('0x7')],_0xed8184[_0x9638('0xa')],JSON[_0x9638('0x1a')](_0x3319a4)));rp(_0x3319a4)[_0x9638('0x1b')](function(_0x188c13){_0x8ab383=!_['isNil'](_0x8ab383)?_0x9638('0x1c')+_0x8ab383:'';_0xfa76fa=typeof _0x188c13[_0x9638('0x16')]==='object'?JSON[_0x9638('0x1a')](_0x188c13[_0x9638('0x16')]):_0x188c13[_0x9638('0x16')];logger['info'](util['format'](_0x9638('0x1d'),_0xed8184[_0x9638('0x7')],_0xed8184['data2'],_0x188c13['statusCode'],_0xfa76fa));})[_0x9638('0x1e')](function(_0x313c9b){logger[_0x9638('0x10')](util[_0x9638('0x18')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0xed8184[_0x9638('0x7')],_0xed8184[_0x9638('0xa')],_0x313c9b['statusCode'],_0x313c9b[_0x9638('0x1f')],_0x313c9b['message']));});};
\ No newline at end of file
+var _0x1166=['name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','number','data5','headers','data6','parse','error','stack','GET','DELETE','POST','PUT','data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','stringify','isNil','format','data2','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x3abdb3,_0x11f72c){var _0x736bfe=function(_0xe3652c){while(--_0xe3652c){_0x3abdb3['push'](_0x3abdb3['shift']());}};_0x736bfe(++_0x11f72c);}(_0x1166,0x86));var _0x6116=function(_0x41049b,_0x15ffb7){_0x41049b=_0x41049b-0x0;var _0x4055a5=_0x1166[_0x41049b];return _0x4055a5;};'use strict';var rp=require(_0x6116('0x0'));var util=require('util');var _=require(_0x6116('0x1'));var Mustache=require(_0x6116('0x2'));var logger=require(_0x6116('0x3'))(_0x6116('0x4'));exports[_0x6116('0x5')]=function(_0x56e5bd,_0x16b908){var _0x16a440,_0x45a181;var _0x3bd2bb={'method':_0x56e5bd[_0x6116('0x6')][_0x6116('0x7')](),'uri':Mustache['render'](_0x56e5bd['data2'],_0x16b908),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x56e5bd['data5'])===_0x6116('0x8')&&parseInt(_0x56e5bd[_0x6116('0x9')])>=0x1&&parseInt(_0x56e5bd[_0x6116('0x9')])<=0xa?parseInt(_0x56e5bd['data5'])*0x3e8:0x5*0x3e8};try{_0x3bd2bb[_0x6116('0xa')]=_0x56e5bd[_0x6116('0xb')]?JSON[_0x6116('0xc')](Mustache['render'](_0x56e5bd[_0x6116('0xb')],_0x16b908)):{};}catch(_0x3746f1){logger[_0x6116('0xd')](_0x3746f1[_0x6116('0xe')]);}switch(_0x56e5bd[_0x6116('0x6')][_0x6116('0x7')]()){case _0x6116('0xf'):case _0x6116('0x10'):_0x16a440=null;_0x3bd2bb['qs']=_0x16b908;break;case _0x6116('0x11'):case _0x6116('0x12'):if(_0x56e5bd[_0x6116('0x13')]){try{_0x16a440=JSON[_0x6116('0xc')](Mustache[_0x6116('0x14')](_0x56e5bd[_0x6116('0x13')],_0x16b908));_0x3bd2bb[_0x6116('0x15')]=_0x16a440;}catch(_0x5b70ec){logger[_0x6116('0xd')](_0x5b70ec[_0x6116('0xe')]);logger[_0x6116('0xd')](_0x6116('0x16'));}}else{_0x16a440=_0x16b908;_0x3bd2bb[_0x6116('0x15')]=_0x16a440;}break;}logger[_0x6116('0x17')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x56e5bd[_0x6116('0x6')],_0x56e5bd['data2'],JSON[_0x6116('0x18')](_0x3bd2bb)));rp(_0x3bd2bb)['then'](function(_0x12198c){_0x16a440=!_[_0x6116('0x19')](_0x16a440)?',\x20request\x20body:\x20'+_0x16a440:'';_0x45a181=typeof _0x12198c[_0x6116('0x15')]==='object'?JSON[_0x6116('0x18')](_0x12198c['body']):_0x12198c[_0x6116('0x15')];logger[_0x6116('0x17')](util[_0x6116('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x56e5bd['data1'],_0x56e5bd[_0x6116('0x1b')],_0x12198c[_0x6116('0x1c')],_0x45a181));})[_0x6116('0x1d')](function(_0x36f840){logger[_0x6116('0xd')](util[_0x6116('0x1a')](_0x6116('0x1e'),_0x56e5bd[_0x6116('0x6')],_0x56e5bd[_0x6116('0x1b')],_0x36f840[_0x6116('0x1c')],_0x36f840[_0x6116('0x1f')],_0x36f840[_0x6116('0x20')]));});};
\ No newline at end of file
index 750f841..07dca76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5715=['then','debug','rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','http','Request','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5715,0x1f2));var _0x5571=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x5715[_0x5948dd];return _0xb1f8be;};'use strict';var jayson=require(_0x5571('0x0'));var BPromise=require('bluebird');var logger=require(_0x5571('0x1'))(_0x5571('0x2'));var client=jayson['client'][_0x5571('0x3')]({'port':0x2329});client[_0x5571('0x4')]=function(_0x1c4d34,_0x40ff3a){return new BPromise(function(_0x15763c,_0x11e724){return client[_0x5571('0x5')](_0x1c4d34,_0x40ff3a)[_0x5571('0x6')](function(_0x198ae4){logger[_0x5571('0x7')](_0x5571('0x8'),_0x5571('0x2'),_0x1c4d34,_0x40ff3a,_0x198ae4);if(_0x198ae4[_0x5571('0x9')]){logger[_0x5571('0x9')]('rpc',_0x5571('0x2'),_0x1c4d34,_0x198ae4[_0x5571('0x9')]['message'],_0x40ff3a);return _0x11e724(_0x198ae4[_0x5571('0x9')][_0x5571('0xa')]);}else{return _0x15763c(_0x198ae4[_0x5571('0xb')]);}})[_0x5571('0xc')](function(_0x39d93d){logger[_0x5571('0x9')]('rpc','routing',_0x1c4d34,_0x39d93d,_0x40ff3a);return _0x11e724(_0x39d93d);});});};module[_0x5571('0xd')]=client;
\ No newline at end of file
+var _0x94bd=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message','result','catch'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x94bd,0x10f));var _0xd94b=function(_0x2eacef,_0x34a7d2){_0x2eacef=_0x2eacef-0x0;var _0x376017=_0x94bd[_0x2eacef];return _0x376017;};'use strict';var jayson=require(_0xd94b('0x0'));var BPromise=require(_0xd94b('0x1'));var logger=require(_0xd94b('0x2'))(_0xd94b('0x3'));var client=jayson[_0xd94b('0x4')][_0xd94b('0x5')]({'port':0x2329});client[_0xd94b('0x6')]=function(_0x400462,_0x34e626){return new BPromise(function(_0x14a395,_0x1f886f){return client['request'](_0x400462,_0x34e626)[_0xd94b('0x7')](function(_0x2f1440){logger[_0xd94b('0x8')](_0xd94b('0x9'),_0xd94b('0x3'),_0x400462,_0x34e626,_0x2f1440);if(_0x2f1440[_0xd94b('0xa')]){logger[_0xd94b('0xa')]('rpc',_0xd94b('0x3'),_0x400462,_0x2f1440[_0xd94b('0xa')][_0xd94b('0xb')],_0x34e626);return _0x1f886f(_0x2f1440[_0xd94b('0xa')][_0xd94b('0xb')]);}else{return _0x14a395(_0x2f1440[_0xd94b('0xc')]);}})[_0xd94b('0xd')](function(_0x1643a3){logger['error'](_0xd94b('0x9'),_0xd94b('0x3'),_0x400462,_0x1643a3,_0x34e626);return _0x1f886f(_0x1643a3);});});};module[_0xd94b('0xe')]=client;
\ No newline at end of file
index 9dd188d..9a336f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20e0=['loginMailFrequency','catch','log','./server','./realtime','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings'];(function(_0x505b3b,_0x4bc220){var _0xd328a8=function(_0x42bf6c){while(--_0x42bf6c){_0x505b3b['push'](_0x505b3b['shift']());}};_0xd328a8(++_0x4bc220);}(_0x20e0,0xc6));var _0x020e=function(_0x525f0f,_0x16a1b5){_0x525f0f=_0x525f0f-0x0;var _0x874cf8=_0x20e0[_0x525f0f];return _0x874cf8;};'use strict';var BPromise=require('bluebird');var server=require(_0x020e('0x0'));var Realtime=require(_0x020e('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x020e('0x2'));var setting=require(_0x020e('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x020e('0x4')]()[_0x020e('0x5')](mailAccount[_0x020e('0x6')]())[_0x020e('0x5')](realtime[_0x020e('0x7')]())[_0x020e('0x5')](function(){email[_0x020e('0x8')](realtime[_0x020e('0x9')]);return realtime;});}function main(){return server[_0x020e('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x020e('0x5')](function(){return setting[_0x020e('0xb')]();})['then'](function(_0xd33bd4){return setInterval(initRealtime,_0xd33bd4[_0x020e('0xc')]*0x3e8);})[_0x020e('0xd')](function(_0x1614b1){console[_0x020e('0xe')](_0x1614b1);});}main();
\ No newline at end of file
+var _0xa0df=['listen','getSettings','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','mailAccounts'];(function(_0x38b60f,_0x1f4bac){var _0x1f164c=function(_0x7baade){while(--_0x7baade){_0x38b60f['push'](_0x38b60f['shift']());}};_0x1f164c(++_0x1f4bac);}(_0xa0df,0x11d));var _0xfa0d=function(_0x3e0c86,_0x1b7b6d){_0x3e0c86=_0x3e0c86-0x0;var _0x4a61b3=_0xa0df[_0x3e0c86];return _0x4a61b3;};'use strict';var BPromise=require(_0xfa0d('0x0'));var server=require(_0xfa0d('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xfa0d('0x2'));var mailAccount=require(_0xfa0d('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xfa0d('0x4')]()[_0xfa0d('0x5')](mailAccount[_0xfa0d('0x6')]())[_0xfa0d('0x5')](realtime[_0xfa0d('0x7')]())[_0xfa0d('0x5')](function(){email['refresh'](realtime[_0xfa0d('0x8')]);return realtime;});}function main(){return server[_0xfa0d('0x9')](realtime,email)['then'](function(){return initRealtime();})[_0xfa0d('0x5')](function(){return setting[_0xfa0d('0xa')]();})[_0xfa0d('0x5')](function(_0x571820){return setInterval(initRealtime,_0x571820[_0xfa0d('0xb')]*0x3e8);})[_0xfa0d('0xc')](function(_0x547bce){console[_0xfa0d('0xd')](_0x547bce);});}main();
\ No newline at end of file
index c71f48f..2ac25d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0837=['name','key','active','Imap','status','messageStatus','total','isNil','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','bind','handleImapEmail','error','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','stringify','lastSync','handleImapError','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','../../../config/logger','redis','socket.io-emitter','./imap','./smtp','info','mailAccounts','smtp','prototype','emit'];(function(_0x5e1f48,_0x176f48){var _0x159dfb=function(_0x1e9d86){while(--_0x1e9d86){_0x5e1f48['push'](_0x5e1f48['shift']());}};_0x159dfb(++_0x176f48);}(_0x0837,0x172));var _0x7083=function(_0x1199c4,_0x97eb63){_0x1199c4=_0x1199c4-0x0;var _0x3e79ed=_0x0837[_0x1199c4];return _0x3e79ed;};'use strict';var _=require(_0x7083('0x0'));var moment=require(_0x7083('0x1'));var BPromise=require(_0x7083('0x2'));var md5=require(_0x7083('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x7083('0x4'))('email');config[_0x7083('0x5')]=_['defaults'](config[_0x7083('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7083('0x6'))(new Redis(config[_0x7083('0x5')]));var EmailImap=require(_0x7083('0x7'));var EmailSmtp=require(_0x7083('0x8'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3bc63e){logger[_0x7083('0x9')]('start\x20email\x20channel');this[_0x7083('0xa')]=_0x3bc63e['mailAccounts'];this['imapAccounts']={};this[_0x7083('0xb')]=new EmailSmtp();}EmailChannel[_0x7083('0xc')][_0x7083('0xd')]=function(_0xbd0a6b){var _0x41a56b=this[_0x7083('0xa')][_0xbd0a6b];var _0xe4664c={'id':_0x41a56b['id'],'name':_0x41a56b[_0x7083('0xe')],'key':_0x41a56b[_0x7083('0xf')],'active':_0x41a56b[_0x7083('0x10')],'Imap':{'status':_0x41a56b[_0x7083('0x11')][_0x7083('0x12')],'messageStatus':_0x41a56b['Imap'][_0x7083('0x13')],'total':_0x41a56b[_0x7083('0x11')][_0x7083('0x14')]}};if(_[_0x7083('0x15')](md5Accounts[_0xbd0a6b])){md5Accounts[_0xbd0a6b]={};}var _0xbadb9=md5(JSON['stringify'](_0xe4664c));if(md5Accounts[_0xbd0a6b][_0x7083('0x3')]!==_0xbadb9){md5Accounts[_0xbd0a6b][_0x7083('0x3')]=_0xbadb9;io[_0x7083('0xd')]('mailAccount:update',_0xe4664c);}};EmailChannel[_0x7083('0xc')][_0x7083('0x16')]=function(_0xf42690){for(var _0x2ba182 in _0xf42690){if(_0xf42690[_0x7083('0x17')](_0x2ba182)){if(_0xf42690[_0x2ba182][_0x7083('0x11')]&&_0xf42690[_0x2ba182]['active']){var _0x25d760=_0xf42690[_0x2ba182][_0x7083('0x11')];if(!this[_0x7083('0x18')][_0x7083('0x17')](_0x25d760['id'])){this[_0x7083('0x18')][_0x25d760['id']]=new EmailImap(_0x25d760,_0xf42690[_0x2ba182]['email']);this[_0x7083('0x18')][_0x25d760['id']]['on'](_0x7083('0x19'),this[_0x7083('0x1a')][_0x7083('0x1b')](this,_0x2ba182));this[_0x7083('0x18')][_0x25d760['id']]['on']('email',this[_0x7083('0x1c')]['bind'](this,_0x2ba182));this[_0x7083('0x18')][_0x25d760['id']]['on']('end',this['handleImapEnd'][_0x7083('0x1b')](this,_0x2ba182));this[_0x7083('0x18')][_0x25d760['id']]['on'](_0x7083('0x1d'),this['handleImapError'][_0x7083('0x1b')](this,_0x2ba182));}}else{if(_[_0x7083('0x15')](this[_0x7083('0xa')][_0x2ba182][_0x7083('0x11')])){this[_0x7083('0xa')][_0x2ba182][_0x7083('0x11')]={};}this[_0x7083('0xa')][_0x2ba182]['Imap'][_0x7083('0x12')]=_0x7083('0x1e');this[_0x7083('0xa')][_0x2ba182][_0x7083('0x11')]['messageStatus']='';this['emit'](_0x2ba182);}}}};EmailChannel[_0x7083('0xc')][_0x7083('0x1a')]=function(_0x27a1e3,_0x508b1d){if(this[_0x7083('0xa')][_0x27a1e3]){this[_0x7083('0xa')][_0x27a1e3][_0x7083('0x11')]['status']=_0x7083('0x1f');this['mailAccounts'][_0x27a1e3]['Imap']['messageStatus']=_0x508b1d['name'];if(_0x508b1d[_0x7083('0x20')]){this[_0x7083('0xa')][_0x27a1e3]['Imap']['total']=_0x508b1d['messages'][_0x7083('0x14')];}return this[_0x7083('0xd')](_0x27a1e3);}};EmailChannel['prototype']['handleImapEmail']=function(_0x165cbc,_0x2cc9e3){logger[_0x7083('0x9')](_0x7083('0x21'),_0x2cc9e3[_0x7083('0x22')],_0x2cc9e3[_0x7083('0x23')],_0x2cc9e3['from'],_0x165cbc);if(this[_0x7083('0xa')][_0x165cbc]){return mailAccount[_0x7083('0x24')](_0x165cbc,_0x2cc9e3)[_0x7083('0x25')](function(_0x461e9f){if(_0x461e9f){logger['info'](_0x7083('0x26'));}})[_0x7083('0x27')](function(_0x596573){logger[_0x7083('0x1d')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x7083('0x28')](_0x596573));});}};EmailChannel[_0x7083('0xc')]['handleImapEnd']=function(_0x4d1fd4){if(this[_0x7083('0xa')][_0x4d1fd4]&&this[_0x7083('0xa')][_0x4d1fd4]['Imap']){if(this['imapAccounts'][this['mailAccounts'][_0x4d1fd4][_0x7083('0x11')]['id']]){delete this[_0x7083('0x18')][this['mailAccounts'][_0x4d1fd4][_0x7083('0x11')]['id']];}this[_0x7083('0xa')][_0x4d1fd4][_0x7083('0x11')][_0x7083('0x29')]=moment();this[_0x7083('0xd')](_0x4d1fd4);}};EmailChannel[_0x7083('0xc')][_0x7083('0x2a')]=function(_0x334bc4,_0x3de1cb){if(this[_0x7083('0xa')][_0x334bc4]){this[_0x7083('0xa')][_0x334bc4][_0x7083('0x11')][_0x7083('0x12')]=_0x7083('0x1d');this[_0x7083('0xa')][_0x334bc4][_0x7083('0x11')][_0x7083('0x13')]=_0x3de1cb;return this[_0x7083('0xd')](_0x334bc4);}};EmailChannel[_0x7083('0xc')]['sendMail']=function(_0x3ecb74,_0x3adfec){return this[_0x7083('0xb')][_0x7083('0x2b')](_0x3ecb74,_0x3adfec);};EmailChannel['prototype'][_0x7083('0x2c')]=function(_0x825eb0){var _0x20938b=this;if(this[_0x7083('0xa')][_0x825eb0['id']]){if(_[_0x7083('0x15')](this['mailAccounts'][_0x825eb0['id']][_0x7083('0x2d')])){this[_0x7083('0xa')][_0x825eb0['id']][_0x7083('0x2d')]={};}this[_0x7083('0xa')][_0x825eb0['id']][_0x7083('0x2d')][_0x7083('0x29')]=moment();return new BPromise(function(_0x2090d4,_0x3b3e99){return _0x20938b[_0x7083('0xb')]['verify'](_0x825eb0)['then'](function(_0x20e38c){_0x20938b[_0x7083('0xa')][_0x825eb0['id']][_0x7083('0x2d')][_0x7083('0x12')]='verified';_0x20938b[_0x7083('0xa')][_0x825eb0['id']][_0x7083('0x2d')][_0x7083('0x13')]='';_0x20938b[_0x7083('0xd')](_0x825eb0['id']);_0x2090d4(_0x20e38c);})['catch'](function(_0x5c28e0){_0x20938b[_0x7083('0xa')][_0x825eb0['id']][_0x7083('0x2d')]['status']=_0x7083('0x1d');_0x20938b[_0x7083('0xa')][_0x825eb0['id']][_0x7083('0x2d')][_0x7083('0x13')]=_0x5c28e0;_0x20938b[_0x7083('0xd')](_0x825eb0['id']);_0x3b3e99(_0x5c28e0);});});}return this['smtp'][_0x7083('0x2e')](_0x825eb0);};module[_0x7083('0x2f')]=EmailChannel;
\ No newline at end of file
+var _0x6caa=['send','Smtp','verified','catch','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','smtp','prototype','emit','mailAccounts','key','active','Imap','messageStatus','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','handleImapBox','bind','handleImapEmail','handleImapEnd','error','isNil','status','disabled','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail'];(function(_0x371c79,_0x41bdf2){var _0x54fe8e=function(_0x19c501){while(--_0x19c501){_0x371c79['push'](_0x371c79['shift']());}};_0x54fe8e(++_0x41bdf2);}(_0x6caa,0x19c));var _0xa6ca=function(_0x2ff114,_0x4ff268){_0x2ff114=_0x2ff114-0x0;var _0x2fad22=_0x6caa[_0x2ff114];return _0x2fad22;};'use strict';var _=require('lodash');var moment=require(_0xa6ca('0x0'));var BPromise=require(_0xa6ca('0x1'));var md5=require(_0xa6ca('0x2'));var Redis=require(_0xa6ca('0x3'));var config=require(_0xa6ca('0x4'));var logger=require(_0xa6ca('0x5'))(_0xa6ca('0x6'));config[_0xa6ca('0x7')]=_[_0xa6ca('0x8')](config[_0xa6ca('0x7')],{'host':_0xa6ca('0x9'),'port':0x18eb});var io=require(_0xa6ca('0xa'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xa6ca('0xb'));var md5Accounts={};function EmailChannel(_0x1e5d05){logger[_0xa6ca('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x1e5d05['mailAccounts'];this['imapAccounts']={};this[_0xa6ca('0xd')]=new EmailSmtp();}EmailChannel[_0xa6ca('0xe')][_0xa6ca('0xf')]=function(_0x72cf9f){var _0xee552f=this[_0xa6ca('0x10')][_0x72cf9f];var _0x3e6604={'id':_0xee552f['id'],'name':_0xee552f['name'],'key':_0xee552f[_0xa6ca('0x11')],'active':_0xee552f[_0xa6ca('0x12')],'Imap':{'status':_0xee552f[_0xa6ca('0x13')]['status'],'messageStatus':_0xee552f[_0xa6ca('0x13')][_0xa6ca('0x14')],'total':_0xee552f[_0xa6ca('0x13')]['total']}};if(_['isNil'](md5Accounts[_0x72cf9f])){md5Accounts[_0x72cf9f]={};}var _0x54a572=md5(JSON[_0xa6ca('0x15')](_0x3e6604));if(md5Accounts[_0x72cf9f]['md5']!==_0x54a572){md5Accounts[_0x72cf9f][_0xa6ca('0x2')]=_0x54a572;io['emit'](_0xa6ca('0x16'),_0x3e6604);}};EmailChannel[_0xa6ca('0xe')][_0xa6ca('0x17')]=function(_0x52af97){for(var _0x426f96 in _0x52af97){if(_0x52af97[_0xa6ca('0x18')](_0x426f96)){if(_0x52af97[_0x426f96][_0xa6ca('0x13')]&&_0x52af97[_0x426f96][_0xa6ca('0x12')]){var _0x1558a6=_0x52af97[_0x426f96][_0xa6ca('0x13')];if(!this[_0xa6ca('0x19')][_0xa6ca('0x18')](_0x1558a6['id'])){this[_0xa6ca('0x19')][_0x1558a6['id']]=new EmailImap(_0x1558a6,_0x52af97[_0x426f96][_0xa6ca('0x6')]);this[_0xa6ca('0x19')][_0x1558a6['id']]['on']('box',this[_0xa6ca('0x1a')][_0xa6ca('0x1b')](this,_0x426f96));this[_0xa6ca('0x19')][_0x1558a6['id']]['on']('email',this[_0xa6ca('0x1c')][_0xa6ca('0x1b')](this,_0x426f96));this[_0xa6ca('0x19')][_0x1558a6['id']]['on']('end',this[_0xa6ca('0x1d')]['bind'](this,_0x426f96));this[_0xa6ca('0x19')][_0x1558a6['id']]['on'](_0xa6ca('0x1e'),this['handleImapError'][_0xa6ca('0x1b')](this,_0x426f96));}}else{if(_[_0xa6ca('0x1f')](this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')])){this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')]={};}this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')][_0xa6ca('0x20')]=_0xa6ca('0x21');this[_0xa6ca('0x10')][_0x426f96][_0xa6ca('0x13')]['messageStatus']='';this['emit'](_0x426f96);}}}};EmailChannel['prototype'][_0xa6ca('0x1a')]=function(_0x50c0a3,_0x5932af){if(this['mailAccounts'][_0x50c0a3]){this[_0xa6ca('0x10')][_0x50c0a3]['Imap']['status']=_0xa6ca('0x22');this[_0xa6ca('0x10')][_0x50c0a3][_0xa6ca('0x13')][_0xa6ca('0x14')]=_0x5932af['name'];if(_0x5932af['messages']){this['mailAccounts'][_0x50c0a3][_0xa6ca('0x13')]['total']=_0x5932af[_0xa6ca('0x23')][_0xa6ca('0x24')];}return this[_0xa6ca('0xf')](_0x50c0a3);}};EmailChannel[_0xa6ca('0xe')][_0xa6ca('0x1c')]=function(_0x3e16ef,_0x5eb196){logger['info'](_0xa6ca('0x25'),_0x5eb196[_0xa6ca('0x26')],_0x5eb196[_0xa6ca('0x27')],_0x5eb196[_0xa6ca('0x28')],_0x3e16ef);if(this[_0xa6ca('0x10')][_0x3e16ef]){return mailAccount['notify'](_0x3e16ef,_0x5eb196)[_0xa6ca('0x29')](function(_0x5d5493){if(_0x5d5493){logger[_0xa6ca('0xc')](_0xa6ca('0x2a'));}})['catch'](function(_0x2c8957){logger[_0xa6ca('0x1e')](_0xa6ca('0x2b'),JSON[_0xa6ca('0x15')](_0x2c8957));});}};EmailChannel['prototype'][_0xa6ca('0x1d')]=function(_0x307b9f){if(this['mailAccounts'][_0x307b9f]&&this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')]){if(this[_0xa6ca('0x19')][this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')]['id']]){delete this[_0xa6ca('0x19')][this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')]['id']];}this[_0xa6ca('0x10')][_0x307b9f][_0xa6ca('0x13')][_0xa6ca('0x2c')]=moment();this[_0xa6ca('0xf')](_0x307b9f);}};EmailChannel['prototype'][_0xa6ca('0x2d')]=function(_0x3271e5,_0x3ebf5c){if(this[_0xa6ca('0x10')][_0x3271e5]){this['mailAccounts'][_0x3271e5][_0xa6ca('0x13')][_0xa6ca('0x20')]=_0xa6ca('0x1e');this[_0xa6ca('0x10')][_0x3271e5][_0xa6ca('0x13')]['messageStatus']=_0x3ebf5c;return this['emit'](_0x3271e5);}};EmailChannel[_0xa6ca('0xe')][_0xa6ca('0x2e')]=function(_0x56a293,_0x373247){return this[_0xa6ca('0xd')][_0xa6ca('0x2f')](_0x56a293,_0x373247);};EmailChannel['prototype']['verifySmtp']=function(_0x459046){var _0x223aef=this;if(this['mailAccounts'][_0x459046['id']]){if(_['isNil'](this['mailAccounts'][_0x459046['id']][_0xa6ca('0x30')])){this['mailAccounts'][_0x459046['id']]['Smtp']={};}this[_0xa6ca('0x10')][_0x459046['id']][_0xa6ca('0x30')][_0xa6ca('0x2c')]=moment();return new BPromise(function(_0x9215ea,_0x525271){return _0x223aef[_0xa6ca('0xd')]['verify'](_0x459046)['then'](function(_0x14013d){_0x223aef['mailAccounts'][_0x459046['id']]['Smtp']['status']=_0xa6ca('0x31');_0x223aef[_0xa6ca('0x10')][_0x459046['id']][_0xa6ca('0x30')]['messageStatus']='';_0x223aef[_0xa6ca('0xf')](_0x459046['id']);_0x9215ea(_0x14013d);})[_0xa6ca('0x32')](function(_0x4b00d3){_0x223aef[_0xa6ca('0x10')][_0x459046['id']][_0xa6ca('0x30')][_0xa6ca('0x20')]='error';_0x223aef[_0xa6ca('0x10')][_0x459046['id']]['Smtp'][_0xa6ca('0x14')]=_0x4b00d3;_0x223aef[_0xa6ca('0xf')](_0x459046['id']);_0x525271(_0x4b00d3);});});}return this[_0xa6ca('0xd')]['verify'](_0x459046);};module['exports']=EmailChannel;
\ No newline at end of file
index 11f0c01..64623cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb205=['path','util','imap','lodash','randomstring','iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','prototype','getAccount','connTimeout','isNil','authentication','user','password','host','port','tls','autotls','getHost','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageEnd','handleMessageAttributes','parser','stringify','textCode','hasOwnProperty','upperFirst','exports'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb205,0xf0));var _0x5b20=function(_0xe3d47b,_0x3c6916){_0xe3d47b=_0xe3d47b-0x0;var _0x4b97d8=_0xb205[_0xe3d47b];return _0x4b97d8;};'use strict';var fs=require('fs');var path=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var Imap=require(_0x5b20('0x2'));var _=require(_0x5b20('0x3'));var rs=require(_0x5b20('0x4'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x5b20('0x5'))['Iconv'];var EventEmitter=require(_0x5b20('0x6'))[_0x5b20('0x7')];var utils=require('./utils');var logger=require(_0x5b20('0x8'))(_0x5b20('0x9'));function EmailImap(_0x364e48,_0x5c1ff9){this[_0x5b20('0xa')]=_0x5b20('0xb');this['account']=this['getAccount'](_0x364e48,_0x5c1ff9);this[_0x5b20('0x2')]=new Imap(this[_0x5b20('0xc')]);this[_0x5b20('0x2')][_0x5b20('0xd')](_0x5b20('0xe'),this[_0x5b20('0xf')][_0x5b20('0x10')](this));this['imap'][_0x5b20('0xd')](_0x5b20('0x11'),this[_0x5b20('0x12')]['bind'](this));this['imap']['on'](_0x5b20('0x13'),this[_0x5b20('0x14')][_0x5b20('0x10')](this));this[_0x5b20('0x2')][_0x5b20('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x5b20('0x16')][_0x5b20('0x17')]=function(_0x180185,_0x20d7b6){var _0x519f9f={'connTimeout':_0x180185['connTimeout']?_0x180185[_0x5b20('0x18')]*0x3e8:0x2710,'authTimeout':_0x180185['authTimeout']?_0x180185['authTimeout']*0x3e8:0x1388};if(_[_0x5b20('0x19')](_0x180185['service'])){if(_0x180185[_0x5b20('0x1a')]){_0x519f9f[_0x5b20('0x1b')]=_0x180185[_0x5b20('0x1b')];_0x519f9f['password']=_0x180185[_0x5b20('0x1c')];}_0x519f9f[_0x5b20('0x1d')]=_0x180185[_0x5b20('0x1d')];_0x519f9f[_0x5b20('0x1e')]=_0x180185['port']||0x3e1;if(_0x180185[_0x5b20('0x1f')]){_0x519f9f['tls']=!![];}else{_0x519f9f[_0x5b20('0x1f')]=![];_0x519f9f[_0x5b20('0x20')]='required';}}else{_0x519f9f[_0x5b20('0x1b')]=_0x180185[_0x5b20('0x1b')];_0x519f9f[_0x5b20('0x1c')]=_0x180185['password'];_0x519f9f[_0x5b20('0x1d')]=utils[_0x5b20('0x21')](_0x180185['service']);_0x519f9f[_0x5b20('0x1e')]=0x3e1;_0x519f9f['tls']=!![];}_0x519f9f['email']=_0x20d7b6||_0x180185[_0x5b20('0x1b')]||'anonymous@xcally.com';return _0x519f9f;};EmailImap['prototype'][_0x5b20('0xf')]=function(){this[_0x5b20('0x2')][_0x5b20('0x22')](this[_0x5b20('0xa')],![],this[_0x5b20('0x23')][_0x5b20('0x10')](this));};EmailImap[_0x5b20('0x16')][_0x5b20('0x23')]=function(_0x56aa6a,_0x285249){if(_0x56aa6a){this[_0x5b20('0x14')](_0x56aa6a,!![]);}else{this[_0x5b20('0x24')](_0x5b20('0x25'),_0x285249);this[_0x5b20('0x26')]();}};EmailImap[_0x5b20('0x16')]['handleCloseBox']=function(_0x16ff2d){if(_0x16ff2d){this['handleError'](_0x16ff2d,!![]);}else{this[_0x5b20('0x2')][_0x5b20('0x11')]();}};EmailImap[_0x5b20('0x16')]['readUnseen']=function(){this['imap'][_0x5b20('0x27')]([_0x5b20('0x28')],this['handleReadUnseen']['bind'](this));};EmailImap[_0x5b20('0x16')]['handleReadUnseen']=function(_0x3aee17,_0x13d302){if(_0x3aee17){this[_0x5b20('0x14')](_0x3aee17,!![]);}else{if(_0x13d302[_0x5b20('0x29')]){try{var _0x5549a3=this[_0x5b20('0x2')][_0x5b20('0x2a')](_0x13d302,{'bodies':'','markSeen':!![]});_0x5549a3['on'](_0x5b20('0x2b'),this[_0x5b20('0x2c')]['bind'](this));_0x5549a3[_0x5b20('0xd')](_0x5b20('0x13'),this[_0x5b20('0x2d')][_0x5b20('0x10')](this));_0x5549a3[_0x5b20('0xd')](_0x5b20('0x11'),this[_0x5b20('0x2e')][_0x5b20('0x10')](this));}catch(_0x33b98a){logger[_0x5b20('0x13')](_0x33b98a);}}else{this[_0x5b20('0x2')][_0x5b20('0x2f')](!![],this[_0x5b20('0x30')][_0x5b20('0x10')](this));}}};EmailImap[_0x5b20('0x16')]['handleFetchMessage']=function(_0x4ad57f,_0x54e244){_0x4ad57f['on'](_0x5b20('0x31'),this[_0x5b20('0x32')][_0x5b20('0x10')](this));_0x4ad57f[_0x5b20('0xd')](_0x5b20('0x33'),this['handleMessageAttributes'][_0x5b20('0x10')](this));_0x4ad57f[_0x5b20('0xd')](_0x5b20('0x11'),this[_0x5b20('0x34')][_0x5b20('0x10')](this));};EmailImap[_0x5b20('0x16')][_0x5b20('0x32')]=function(_0x4f117d,_0x5b29b0){simpleParser(_0x4f117d,{'Iconv':Iconv},this['handleSimpleParser'][_0x5b20('0x10')](this));};EmailImap[_0x5b20('0x16')][_0x5b20('0x35')]=function(_0x180c65){};EmailImap[_0x5b20('0x16')][_0x5b20('0x34')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x1c3b28,_0x317554){if(_0x1c3b28){logger['error'](_0x1c3b28);}else{var _0x44fd6c=this;utils[_0x5b20('0x36')](this[_0x5b20('0xc')],_0x317554,function(_0x45457c){_0x44fd6c[_0x5b20('0x24')](_0x5b20('0x9'),_0x45457c);});}};EmailImap[_0x5b20('0x16')][_0x5b20('0x2e')]=function(){this[_0x5b20('0x2')][_0x5b20('0x2f')](!![],this[_0x5b20('0x30')][_0x5b20('0x10')](this));};EmailImap['prototype'][_0x5b20('0x2d')]=function(_0x14a9a0){this[_0x5b20('0x14')](_0x14a9a0);this[_0x5b20('0x2')][_0x5b20('0x2f')](!![],this[_0x5b20('0x30')][_0x5b20('0x10')](this));};EmailImap[_0x5b20('0x16')][_0x5b20('0x12')]=function(){this[_0x5b20('0x24')](_0x5b20('0x11'));};EmailImap[_0x5b20('0x16')][_0x5b20('0x14')]=function(_0x2ea494,_0x831edd){logger[_0x5b20('0x13')](_0x5b20('0x14'),this[_0x5b20('0xc')][_0x5b20('0x9')],JSON[_0x5b20('0x37')](_0x2ea494));var _0x3c90e2='';if(_0x2ea494){if(_0x2ea494[_0x5b20('0x38')]){_0x3c90e2=_0x2ea494[_0x5b20('0x38')];}else{for(var _0xd46ae3 in _0x2ea494){if(_0x2ea494[_0x5b20('0x39')](_0xd46ae3)){_0x3c90e2+=_[_0x5b20('0x3a')](_0xd46ae3)+':\x20'+_0x2ea494[_0xd46ae3]+'\x0a';}}}}if(_0x831edd){this[_0x5b20('0x2')]['end']();}else{this[_0x5b20('0x24')](_0x5b20('0x13'),_0x3c90e2);this[_0x5b20('0x24')](_0x5b20('0x11'));}};module[_0x5b20('0x3b')]=EmailImap;
\ No newline at end of file
+var _0x4c4e=['getHost','anonymous@xcally.com','prototype','handleOpenBox','box','readUnseen','UNSEEN','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','error','closeBox','handleCloseBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','stringify','textCode','hasOwnProperty','exports','path','imap','lodash','randomstring','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls'];(function(_0x3df822,_0x299495){var _0x4e457d=function(_0x68a45f){while(--_0x68a45f){_0x3df822['push'](_0x3df822['shift']());}};_0x4e457d(++_0x299495);}(_0x4c4e,0x152));var _0xe4c4=function(_0x49e77f,_0x52024a){_0x49e77f=_0x49e77f-0x0;var _0x22b693=_0x4c4e[_0x49e77f];return _0x22b693;};'use strict';var fs=require('fs');var path=require(_0xe4c4('0x0'));var util=require('util');var Imap=require(_0xe4c4('0x1'));var _=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var simpleParser=require('mailparser')[_0xe4c4('0x4')];var Iconv=require(_0xe4c4('0x5'))[_0xe4c4('0x6')];var EventEmitter=require('events')[_0xe4c4('0x7')];var utils=require('./utils');var logger=require(_0xe4c4('0x8'))(_0xe4c4('0x9'));function EmailImap(_0x262b64,_0xad105){this[_0xe4c4('0xa')]=_0xe4c4('0xb');this[_0xe4c4('0xc')]=this[_0xe4c4('0xd')](_0x262b64,_0xad105);this['imap']=new Imap(this['account']);this[_0xe4c4('0x1')][_0xe4c4('0xe')](_0xe4c4('0xf'),this[_0xe4c4('0x10')][_0xe4c4('0x11')](this));this[_0xe4c4('0x1')]['once'](_0xe4c4('0x12'),this[_0xe4c4('0x13')][_0xe4c4('0x11')](this));this[_0xe4c4('0x1')]['on']('error',this[_0xe4c4('0x14')][_0xe4c4('0x11')](this));this['imap'][_0xe4c4('0x15')]();}util[_0xe4c4('0x16')](EmailImap,EventEmitter);EmailImap['prototype'][_0xe4c4('0xd')]=function(_0x29766a,_0x5e263c){var _0x307aa8={'connTimeout':_0x29766a[_0xe4c4('0x17')]?_0x29766a[_0xe4c4('0x17')]*0x3e8:0x2710,'authTimeout':_0x29766a[_0xe4c4('0x18')]?_0x29766a[_0xe4c4('0x18')]*0x3e8:0x1388};if(_[_0xe4c4('0x19')](_0x29766a[_0xe4c4('0x1a')])){if(_0x29766a[_0xe4c4('0x1b')]){_0x307aa8[_0xe4c4('0x1c')]=_0x29766a[_0xe4c4('0x1c')];_0x307aa8[_0xe4c4('0x1d')]=_0x29766a[_0xe4c4('0x1d')];}_0x307aa8[_0xe4c4('0x1e')]=_0x29766a[_0xe4c4('0x1e')];_0x307aa8[_0xe4c4('0x1f')]=_0x29766a['port']||0x3e1;if(_0x29766a[_0xe4c4('0x20')]){_0x307aa8[_0xe4c4('0x20')]=!![];}else{_0x307aa8[_0xe4c4('0x20')]=![];_0x307aa8[_0xe4c4('0x21')]='required';}}else{_0x307aa8[_0xe4c4('0x1c')]=_0x29766a[_0xe4c4('0x1c')];_0x307aa8[_0xe4c4('0x1d')]=_0x29766a[_0xe4c4('0x1d')];_0x307aa8[_0xe4c4('0x1e')]=utils[_0xe4c4('0x22')](_0x29766a[_0xe4c4('0x1a')]);_0x307aa8[_0xe4c4('0x1f')]=0x3e1;_0x307aa8[_0xe4c4('0x20')]=!![];}_0x307aa8[_0xe4c4('0x9')]=_0x5e263c||_0x29766a[_0xe4c4('0x1c')]||_0xe4c4('0x23');return _0x307aa8;};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x10')]=function(){this[_0xe4c4('0x1')]['openBox'](this['mailbox'],![],this[_0xe4c4('0x25')]['bind'](this));};EmailImap[_0xe4c4('0x24')]['handleOpenBox']=function(_0x3adfcb,_0x5efc4c){if(_0x3adfcb){this[_0xe4c4('0x14')](_0x3adfcb,!![]);}else{this['emit'](_0xe4c4('0x26'),_0x5efc4c);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x5d66ab){if(_0x5d66ab){this[_0xe4c4('0x14')](_0x5d66ab,!![]);}else{this['imap']['end']();}};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x27')]=function(){this['imap']['search']([_0xe4c4('0x28')],this[_0xe4c4('0x29')]['bind'](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x29')]=function(_0x3f60fc,_0x48060e){if(_0x3f60fc){this['handleError'](_0x3f60fc,!![]);}else{if(_0x48060e[_0xe4c4('0x2a')]){try{var _0x2c5652=this[_0xe4c4('0x1')][_0xe4c4('0x2b')](_0x48060e,{'bodies':'','markSeen':!![]});_0x2c5652['on']('message',this['handleFetchMessage'][_0xe4c4('0x11')](this));_0x2c5652[_0xe4c4('0xe')]('error',this[_0xe4c4('0x2c')][_0xe4c4('0x11')](this));_0x2c5652[_0xe4c4('0xe')]('end',this[_0xe4c4('0x2d')]['bind'](this));}catch(_0x45fc76){logger[_0xe4c4('0x2e')](_0x45fc76);}}else{this[_0xe4c4('0x1')][_0xe4c4('0x2f')](!![],this[_0xe4c4('0x30')][_0xe4c4('0x11')](this));}}};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x31')]=function(_0x2213c9,_0x18b2a8){_0x2213c9['on'](_0xe4c4('0x32'),this[_0xe4c4('0x33')]['bind'](this));_0x2213c9[_0xe4c4('0xe')](_0xe4c4('0x34'),this[_0xe4c4('0x35')]['bind'](this));_0x2213c9[_0xe4c4('0xe')](_0xe4c4('0x12'),this[_0xe4c4('0x36')]['bind'](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x33')]=function(_0x4a3644,_0x1de955){simpleParser(_0x4a3644,{'Iconv':Iconv},this[_0xe4c4('0x37')][_0xe4c4('0x11')](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x35')]=function(_0x3d5ecb){};EmailImap[_0xe4c4('0x24')]['handleMessageEnd']=function(){};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x37')]=function(_0x1156d0,_0x3c16a5){if(_0x1156d0){logger['error'](_0x1156d0);}else{var _0x2362d6=this;utils[_0xe4c4('0x38')](this['account'],_0x3c16a5,function(_0xa5534c){_0x2362d6[_0xe4c4('0x39')]('email',_0xa5534c);});}};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x2d')]=function(){this[_0xe4c4('0x1')][_0xe4c4('0x2f')](!![],this[_0xe4c4('0x30')][_0xe4c4('0x11')](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x2c')]=function(_0x1e457c){this[_0xe4c4('0x14')](_0x1e457c);this[_0xe4c4('0x1')][_0xe4c4('0x2f')](!![],this['handleCloseBox'][_0xe4c4('0x11')](this));};EmailImap[_0xe4c4('0x24')][_0xe4c4('0x13')]=function(){this[_0xe4c4('0x39')](_0xe4c4('0x12'));};EmailImap[_0xe4c4('0x24')]['handleError']=function(_0x312a49,_0x526bef){logger[_0xe4c4('0x2e')](_0xe4c4('0x14'),this[_0xe4c4('0xc')][_0xe4c4('0x9')],JSON[_0xe4c4('0x3a')](_0x312a49));var _0x566eb7='';if(_0x312a49){if(_0x312a49['textCode']){_0x566eb7=_0x312a49[_0xe4c4('0x3b')];}else{for(var _0x41bd7a in _0x312a49){if(_0x312a49[_0xe4c4('0x3c')](_0x41bd7a)){_0x566eb7+=_['upperFirst'](_0x41bd7a)+':\x20'+_0x312a49[_0x41bd7a]+'\x0a';}}}}if(_0x526bef){this[_0xe4c4('0x1')][_0xe4c4('0x12')]();}else{this[_0xe4c4('0x39')](_0xe4c4('0x2e'),_0x566eb7);this['emit'](_0xe4c4('0x12'));}};module[_0xe4c4('0x3d')]=EmailImap;
\ No newline at end of file
index 111c431..6ef831c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x509b=['prototype','send','createTransport','compile','sendMail','verify','toString','Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64'];(function(_0x24e0c9,_0x284109){var _0x4448f0=function(_0x576980){while(--_0x576980){_0x24e0c9['push'](_0x24e0c9['shift']());}};_0x4448f0(++_0x284109);}(_0x509b,0xda));var _0xb509=function(_0x34c3be,_0x4098dd){_0x34c3be=_0x34c3be-0x0;var _0x134868=_0x509b[_0x34c3be];return _0x134868;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xb509('0x0'));var inlineBase64=require(_0xb509('0x1'));function EmailSmtp(){}EmailSmtp[_0xb509('0x2')][_0xb509('0x3')]=function(_0x5f2423,_0x3fcd5a){return new BPromise(function(_0x37d40e,_0x583c6d){var _0x3264e4=nodemailer[_0xb509('0x4')](_0x5f2423);_0x3264e4['use'](_0xb509('0x5'),inlineBase64());_0x3264e4[_0xb509('0x6')](_0x3fcd5a,function(_0x528cb6,_0x478929){if(_0x528cb6){_0x583c6d(_0x528cb6['toString']());}else{_0x37d40e(_0x478929);}});});};EmailSmtp[_0xb509('0x2')][_0xb509('0x7')]=function(_0x1b8ef3){return new BPromise(function(_0x1db526,_0x10955e){var _0x5ed310=nodemailer[_0xb509('0x4')](_0x1b8ef3);_0x5ed310[_0xb509('0x7')](function(_0x3e6230,_0x141ce7){if(_0x3e6230){_0x10955e(_0x3e6230[_0xb509('0x8')]());}else{if(_0x141ce7){_0x1db526(_0x141ce7);}else{_0x10955e(_0xb509('0x9'));}}});});};module[_0xb509('0xa')]=EmailSmtp;
\ No newline at end of file
+var _0x94a0=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x553837,_0x161714){var _0x124212=function(_0x41bfde){while(--_0x41bfde){_0x553837['push'](_0x553837['shift']());}};_0x124212(++_0x161714);}(_0x94a0,0x85));var _0x094a=function(_0x1ae06f,_0x5b7a6c){_0x1ae06f=_0x1ae06f-0x0;var _0x429688=_0x94a0[_0x1ae06f];return _0x429688;};'use strict';var nodemailer=require(_0x094a('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x094a('0x1'));function EmailSmtp(){}EmailSmtp[_0x094a('0x2')]['send']=function(_0x52a7d8,_0x486484){return new BPromise(function(_0x5c631d,_0x13bfae){var _0x478435=nodemailer[_0x094a('0x3')](_0x52a7d8);_0x478435[_0x094a('0x4')](_0x094a('0x5'),inlineBase64());_0x478435[_0x094a('0x6')](_0x486484,function(_0x1a9464,_0x1a4a4b){if(_0x1a9464){_0x13bfae(_0x1a9464[_0x094a('0x7')]());}else{_0x5c631d(_0x1a4a4b);}});});};EmailSmtp['prototype'][_0x094a('0x8')]=function(_0xab6411){return new BPromise(function(_0x56c9f5,_0x5300eb){var _0x4db481=nodemailer['createTransport'](_0xab6411);_0x4db481['verify'](function(_0x419f51,_0x31efc7){if(_0x419f51){_0x5300eb(_0x419f51['toString']());}else{if(_0x31efc7){_0x56c9f5(_0x31efc7);}else{_0x5300eb(_0x094a('0x9'));}}});});};module[_0x094a('0xa')]=EmailSmtp;
\ No newline at end of file
index 53e7a6a..30adc6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['originTo','originCc','bcc','attach','type','attachment-','%s-%s','now','root','server/files/attachments/','writeFileSync','contentType','parser','from','subject','messageId','inReplyTo','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','@xcally.com','name','split','join','length','pop','isEmpty','generate','test','html','replace','includes','<img','attachments','forEach','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message'];(function(_0x45692e,_0x5a1180){var _0x183215=function(_0x28a96c){while(--_0x28a96c){_0x45692e['push'](_0x45692e['shift']());}};_0x183215(++_0x5a1180);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa4aaf4,_0x394844){_0xa4aaf4=_0xa4aaf4-0x0;var _0xf2770f=_0x5f2f[_0xa4aaf4];return _0xf2770f;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var random=require(_0xf5f2('0x2'));var fs=require('fs');var path=require(_0xf5f2('0x3'));var util=require(_0xf5f2('0x4'));var tnef=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../../config/environment');function getAddress(_0x4854b6){var _0x1665c7=_[_0xf5f2('0x8')](_0x4854b6[_0xf5f2('0x9')]);return _0x1665c7&&_0x1665c7[_0xf5f2('0xa')]?_0x1665c7[_0xf5f2('0xa')]:_0xf5f2('0xb')+random['generate'](0x6)+_0xf5f2('0xc');}function getFirstName(_0x46cd9c){var _0x2ec345=_['head'](_0x46cd9c[_0xf5f2('0x9')]);if(_0x2ec345&&_0x2ec345[_0xf5f2('0xd')]){var _0x218ae3=_0x2ec345['name'][_0xf5f2('0xe')](/\s+/);return _0x218ae3['length']?_0x218ae3['slice'](0x0,-0x1)[_0xf5f2('0xf')]('\x20'):_0x2ec345[_0xf5f2('0xd')];}return'Anonymous';}function getLastName(_0x336f6b){var _0x14b51f=_[_0xf5f2('0x8')](_0x336f6b[_0xf5f2('0x9')]);if(_0x14b51f&&_0x14b51f[_0xf5f2('0xd')]){var _0x3e5956=_0x14b51f['name'][_0xf5f2('0xe')](/\s+/);return _0x3e5956[_0xf5f2('0x10')]>0x1?_0x3e5956[_0xf5f2('0x11')]():'';}return'';}function getMails(_0x1c1a5c,_0x422b55){var _0x4d97fc='';for(var _0xafe430=0x0;_0xafe430<_0x422b55[_0xf5f2('0x9')][_0xf5f2('0x10')];_0xafe430+=0x1){if(_0x422b55[_0xf5f2('0x9')][_0xafe430][_0xf5f2('0xa')]!==_0x1c1a5c){if(!_[_0xf5f2('0x12')](_0x4d97fc)){_0x4d97fc+=',';}_0x4d97fc+=_0x422b55[_0xf5f2('0x9')][_0xafe430][_0xf5f2('0xd')]||_0x422b55[_0xf5f2('0x9')][_0xafe430][_0xf5f2('0xa')]||'';_0x4d97fc+='\x20<';_0x4d97fc+=_0x422b55[_0xf5f2('0x9')][_0xafe430][_0xf5f2('0xa')]?_0x422b55[_0xf5f2('0x9')][_0xafe430][_0xf5f2('0xa')]:_0xf5f2('0xb')+random[_0xf5f2('0x13')](0x6)+_0xf5f2('0xc');_0x4d97fc+='>';}}return _0x4d97fc;}function parseEmail(_0x56acc5,_0x34706d,_0x47101e){if(_0x34706d['html']){var _0x47acfc=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x47acfc[_0xf5f2('0x14')](_0x34706d[_0xf5f2('0x15')])){_0x34706d['html']=_0x34706d[_0xf5f2('0x15')][_0xf5f2('0x16')](_0x47acfc,'');}if(_0x34706d[_0xf5f2('0x15')][_0xf5f2('0x17')](_0xf5f2('0x18'))){var _0x4c691a=[];_0x34706d[_0xf5f2('0x19')][_0xf5f2('0x1a')](_0x4e8bda=>{_0x4c691a[_0xf5f2('0x1b')](_0x4e8bda[_0xf5f2('0x1c')]);});var _0x5bdf4a=/<img.*? _SRC(.*?)[^\>]+>/g;var _0x529f07=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x5f1124=_0x34706d[_0xf5f2('0x15')][_0xf5f2('0x16')](_0x529f07,_0xf5f2('0x1d'));var _0xf6c58d=_0x5f1124[_0xf5f2('0x16')](_0x5bdf4a,_0xf5f2('0x1e'));for(let _0x281ec8=0x0;_0x281ec8<_0x4c691a[_0xf5f2('0x10')];_0x281ec8++){var _0x4ab014=_0xf6c58d[_0xf5f2('0x16')](_0xf5f2('0x1e'),_0xf5f2('0x1f')+_0x4c691a[_0x281ec8]+_0xf5f2('0x20'));_0xf6c58d=_0x4ab014;}_0x34706d[_0xf5f2('0x15')]=_0xf6c58d;}_0x47101e[_0xf5f2('0x21')]=_0x34706d['html'];}else{_0x47101e['body']=_0x34706d[_0xf5f2('0x22')];}if(_0x47101e[_0xf5f2('0x21')]){_0x47101e[_0xf5f2('0x21')]=_0x47101e['body']['replace'](/<a\s+/gi,_0xf5f2('0x23'));}if(_0x34706d['to']){_0x47101e[_0xf5f2('0x24')][_0xf5f2('0x25')]=getMails(null,_0x34706d['to']);var _0x153924=getMails(_0x56acc5[_0xf5f2('0x7')],_0x34706d['to']);if(!_['isEmpty'](_0x153924)){_0x47101e['message']['cc']+=_0x153924;}}if(_0x34706d['cc']){_0x47101e[_0xf5f2('0x24')]['originCc']=getMails(null,_0x34706d['cc']);var _0xb744b9=getMails(_0x56acc5['email'],_0x34706d['cc']);if(!_[_0xf5f2('0x12')](_0xb744b9)){if(!_[_0xf5f2('0x12')](_0x47101e[_0xf5f2('0x24')]['cc'])){_0x47101e[_0xf5f2('0x24')]['cc']+=',';}_0x47101e[_0xf5f2('0x24')]['cc']+=_0xb744b9;}}if(!_[_0xf5f2('0x17')](_0x47101e[_0xf5f2('0x24')][_0xf5f2('0x25')],_0x56acc5['email'])&&!_[_0xf5f2('0x17')](_0x47101e[_0xf5f2('0x24')][_0xf5f2('0x26')],_0x56acc5[_0xf5f2('0x7')])){_0x47101e[_0xf5f2('0x24')][_0xf5f2('0x27')]=_0x56acc5[_0xf5f2('0x7')];}if(_0x34706d['attachments']&&_0x34706d[_0xf5f2('0x19')][_0xf5f2('0x10')]){_0x47101e['message'][_0xf5f2('0x28')]=_0x34706d['attachments'][_0xf5f2('0x10')];for(var _0x3930fb=0x0,_0x2a2c31,_0x2e3cca,_0x59a6dd;_0x3930fb<_0x34706d['attachments'][_0xf5f2('0x10')];_0x3930fb+=0x1){if(_0x34706d[_0xf5f2('0x19')][_0x3930fb][_0xf5f2('0x29')]==='attachment'){_0x59a6dd=_0x34706d[_0xf5f2('0x19')][_0x3930fb]['filename']||_0xf5f2('0x2a')+_0x3930fb;_0x2a2c31=util['format'](_0xf5f2('0x2b'),Date[_0xf5f2('0x2c')](),_0x59a6dd);_0x2e3cca=path['join'](config[_0xf5f2('0x2d')],_0xf5f2('0x2e'),_0x2a2c31);fs[_0xf5f2('0x2f')](_0x2e3cca,_0x34706d[_0xf5f2('0x19')][_0x3930fb]['content']);_0x47101e['message'][_0xf5f2('0x19')][_0xf5f2('0x1b')]({'name':_0x59a6dd,'basename':_0x2a2c31,'type':_0x34706d[_0xf5f2('0x19')][_0x3930fb][_0xf5f2('0x30')],'filepath':_0x2e3cca});}}}return _0x47101e;}exports[_0xf5f2('0x31')]=function(_0xe62b57,_0x2bc20e,_0x4c0ac7){var _0x110fe5={'from':getAddress(_0x2bc20e[_0xf5f2('0x32')]),'firstName':getFirstName(_0x2bc20e['from']),'lastName':getLastName(_0x2bc20e[_0xf5f2('0x32')]),'mapKey':_0xf5f2('0x7'),'message':{'from':getMails(_0xe62b57[_0xf5f2('0x7')],_0x2bc20e[_0xf5f2('0x32')]),'to':_0xe62b57[_0xf5f2('0x7')],'cc':'','subject':_0x2bc20e[_0xf5f2('0x33')]||'','messageId':_0x2bc20e[_0xf5f2('0x34')],'inReplyTo':_0x2bc20e[_0xf5f2('0x35')],'sentAt':moment(_0x2bc20e['date'])[_0xf5f2('0x36')](_0xf5f2('0x37')),'attach':![],'attachments':[]}};if(!_0x2bc20e[_0xf5f2('0x15')]&&!_0x2bc20e['textAsHtml']){var _0x509dbc=_['filter'](_0x2bc20e[_0xf5f2('0x19')],{'contentType':_0xf5f2('0x38')});if(_0x509dbc['length']){logger[_0xf5f2('0x39')](util[_0xf5f2('0x36')](_0xf5f2('0x3a'),_0x2bc20e[_0xf5f2('0x34')]));tnef[_0xf5f2('0x3b')](_[_0xf5f2('0x3c')](_0x509dbc)[_0xf5f2('0x3d')],function(_0x212e90,_0x40c322){if(_0x40c322){_0x2bc20e[_0xf5f2('0x15')]=_0x40c322[_0xf5f2('0x3e')]||_0xf5f2('0x3f');if(_0x40c322[_0xf5f2('0x40')]){for(var _0x2fb67e=0x0;_0x2fb67e<_0x40c322['Attachments'][_0xf5f2('0x10')];_0x2fb67e++){var _0x578c93=_0x40c322[_0xf5f2('0x40')][_0x2fb67e];_0x110fe5[_0xf5f2('0x24')][_0xf5f2('0x19')][_0xf5f2('0x1b')]({'filename':_0x578c93[_0xf5f2('0x41')],'content':new Buffer(_0x578c93[_0xf5f2('0x42')])});}}}_0x4c0ac7(parseEmail(_0xe62b57,_0x2bc20e,_0x110fe5));});}else{_0x2bc20e['html']=_0xf5f2('0x3f');_0x4c0ac7(parseEmail(_0xe62b57,_0x2bc20e,_0x110fe5));}}else{_0x4c0ac7(parseEmail(_0xe62b57,_0x2bc20e,_0x110fe5));}};exports[_0xf5f2('0x43')]=function(_0x1c1497){switch(_0x1c1497){case _0xf5f2('0x44'):return _0xf5f2('0x45');case _0xf5f2('0x46'):return _0xf5f2('0x47');case _0xf5f2('0x48'):return'imap-mail.outlook.com';case _0xf5f2('0x49'):return _0xf5f2('0x4a');}return _0xf5f2('0x4b');};
\ No newline at end of file
+var _0x896e=['split','slice','join','name','length','pop','isEmpty','html','test','replace','includes','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','body','textAsHtml','message','originTo','originCc','bcc','attachments','attach','type','attachment-','%s-%s','root','server/files/attachments/','writeFileSync','contentType','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','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','Data','getHost','gmail','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0x896e,0x1e9));var _0xe896=function(_0x551888,_0x258872){_0x551888=_0x551888-0x0;var _0x253d4f=_0x896e[_0x551888];return _0x253d4f;};'use strict';var _=require(_0xe896('0x0'));var moment=require(_0xe896('0x1'));var random=require(_0xe896('0x2'));var fs=require('fs');var path=require(_0xe896('0x3'));var util=require(_0xe896('0x4'));var tnef=require(_0xe896('0x5'));var logger=require(_0xe896('0x6'))(_0xe896('0x7'));var config=require(_0xe896('0x8'));function getAddress(_0x2d3521){var _0x244f68=_[_0xe896('0x9')](_0x2d3521['value']);return _0x244f68&&_0x244f68[_0xe896('0xa')]?_0x244f68[_0xe896('0xa')]:_0xe896('0xb')+random[_0xe896('0xc')](0x6)+_0xe896('0xd');}function getFirstName(_0x5a1909){var _0x274062=_[_0xe896('0x9')](_0x5a1909[_0xe896('0xe')]);if(_0x274062&&_0x274062['name']){var _0x305616=_0x274062['name'][_0xe896('0xf')](/\s+/);return _0x305616['length']?_0x305616[_0xe896('0x10')](0x0,-0x1)[_0xe896('0x11')]('\x20'):_0x274062[_0xe896('0x12')];}return'Anonymous';}function getLastName(_0x3c531e){var _0x4452cd=_[_0xe896('0x9')](_0x3c531e['value']);if(_0x4452cd&&_0x4452cd[_0xe896('0x12')]){var _0x2f1c3e=_0x4452cd[_0xe896('0x12')]['split'](/\s+/);return _0x2f1c3e[_0xe896('0x13')]>0x1?_0x2f1c3e[_0xe896('0x14')]():'';}return'';}function getMails(_0x1e7ef8,_0x564758){var _0x5a7957='';for(var _0x446ce2=0x0;_0x446ce2<_0x564758[_0xe896('0xe')]['length'];_0x446ce2+=0x1){if(_0x564758['value'][_0x446ce2][_0xe896('0xa')]!==_0x1e7ef8){if(!_[_0xe896('0x15')](_0x5a7957)){_0x5a7957+=',';}_0x5a7957+=_0x564758['value'][_0x446ce2][_0xe896('0x12')]||_0x564758['value'][_0x446ce2][_0xe896('0xa')]||'';_0x5a7957+='\x20<';_0x5a7957+=_0x564758[_0xe896('0xe')][_0x446ce2][_0xe896('0xa')]?_0x564758['value'][_0x446ce2][_0xe896('0xa')]:_0xe896('0xb')+random[_0xe896('0xc')](0x6)+_0xe896('0xd');_0x5a7957+='>';}}return _0x5a7957;}function parseEmail(_0x2693d6,_0x3ac8b8,_0x388c2e){if(_0x3ac8b8[_0xe896('0x16')]){var _0x49547b=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x49547b[_0xe896('0x17')](_0x3ac8b8['html'])){_0x3ac8b8['html']=_0x3ac8b8[_0xe896('0x16')][_0xe896('0x18')](_0x49547b,'');}if(_0x3ac8b8[_0xe896('0x16')][_0xe896('0x19')]('<img')){var _0x468479=[];_0x3ac8b8['attachments']['forEach'](_0x45dd49=>{_0x468479[_0xe896('0x1a')](_0x45dd49[_0xe896('0x1b')]);});var _0x2e2c10=/<img.*? _SRC(.*?)[^\>]+>/g;var _0x20e295=/src=\"data:image\/([a-zA-Z]*);base64,([^\"]*)\"/g;var _0x4d9f03=_0x3ac8b8[_0xe896('0x16')]['replace'](_0x20e295,_0xe896('0x1c'));var _0x163a75=_0x4d9f03[_0xe896('0x18')](_0x2e2c10,'_IMG');for(let _0x26635e=0x0;_0x26635e<_0x468479[_0xe896('0x13')];_0x26635e++){var _0x2bc11d=_0x163a75[_0xe896('0x18')](_0xe896('0x1d'),_0xe896('0x1e')+_0x468479[_0x26635e]+'\x20]</span>');_0x163a75=_0x2bc11d;}_0x3ac8b8[_0xe896('0x16')]=_0x163a75;}_0x388c2e[_0xe896('0x1f')]=_0x3ac8b8[_0xe896('0x16')];}else{_0x388c2e[_0xe896('0x1f')]=_0x3ac8b8[_0xe896('0x20')];}if(_0x388c2e['body']){_0x388c2e['body']=_0x388c2e['body']['replace'](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x3ac8b8['to']){_0x388c2e[_0xe896('0x21')][_0xe896('0x22')]=getMails(null,_0x3ac8b8['to']);var _0x10fd26=getMails(_0x2693d6[_0xe896('0x7')],_0x3ac8b8['to']);if(!_[_0xe896('0x15')](_0x10fd26)){_0x388c2e[_0xe896('0x21')]['cc']+=_0x10fd26;}}if(_0x3ac8b8['cc']){_0x388c2e[_0xe896('0x21')][_0xe896('0x23')]=getMails(null,_0x3ac8b8['cc']);var _0x4ab96b=getMails(_0x2693d6['email'],_0x3ac8b8['cc']);if(!_[_0xe896('0x15')](_0x4ab96b)){if(!_[_0xe896('0x15')](_0x388c2e[_0xe896('0x21')]['cc'])){_0x388c2e[_0xe896('0x21')]['cc']+=',';}_0x388c2e['message']['cc']+=_0x4ab96b;}}if(!_[_0xe896('0x19')](_0x388c2e['message']['originTo'],_0x2693d6[_0xe896('0x7')])&&!_[_0xe896('0x19')](_0x388c2e[_0xe896('0x21')]['originCc'],_0x2693d6['email'])){_0x388c2e['message'][_0xe896('0x24')]=_0x2693d6[_0xe896('0x7')];}if(_0x3ac8b8[_0xe896('0x25')]&&_0x3ac8b8[_0xe896('0x25')][_0xe896('0x13')]){_0x388c2e['message'][_0xe896('0x26')]=_0x3ac8b8[_0xe896('0x25')][_0xe896('0x13')];for(var _0x28e09c=0x0,_0x1366d0,_0x2cce09,_0x3aeccc;_0x28e09c<_0x3ac8b8[_0xe896('0x25')]['length'];_0x28e09c+=0x1){if(_0x3ac8b8[_0xe896('0x25')][_0x28e09c][_0xe896('0x27')]==='attachment'){_0x3aeccc=_0x3ac8b8[_0xe896('0x25')][_0x28e09c]['filename']||_0xe896('0x28')+_0x28e09c;_0x1366d0=util['format'](_0xe896('0x29'),Date['now'](),_0x3aeccc);_0x2cce09=path[_0xe896('0x11')](config[_0xe896('0x2a')],_0xe896('0x2b'),_0x1366d0);fs[_0xe896('0x2c')](_0x2cce09,_0x3ac8b8[_0xe896('0x25')][_0x28e09c]['content']);_0x388c2e['message'][_0xe896('0x25')][_0xe896('0x1a')]({'name':_0x3aeccc,'basename':_0x1366d0,'type':_0x3ac8b8[_0xe896('0x25')][_0x28e09c][_0xe896('0x2d')],'filepath':_0x2cce09});}}}return _0x388c2e;}exports[_0xe896('0x2e')]=function(_0x4c0ef0,_0x5b8131,_0x127a6f){var _0x29d1ee={'from':getAddress(_0x5b8131['from']),'firstName':getFirstName(_0x5b8131['from']),'lastName':getLastName(_0x5b8131[_0xe896('0x2f')]),'mapKey':_0xe896('0x7'),'message':{'from':getMails(_0x4c0ef0[_0xe896('0x7')],_0x5b8131[_0xe896('0x2f')]),'to':_0x4c0ef0[_0xe896('0x7')],'cc':'','subject':_0x5b8131[_0xe896('0x30')]||'','messageId':_0x5b8131[_0xe896('0x31')],'inReplyTo':_0x5b8131[_0xe896('0x32')],'sentAt':moment(_0x5b8131[_0xe896('0x33')])[_0xe896('0x34')](_0xe896('0x35')),'attach':![],'attachments':[]}};if(!_0x5b8131[_0xe896('0x16')]&&!_0x5b8131['textAsHtml']){var _0x1e5434=_[_0xe896('0x36')](_0x5b8131['attachments'],{'contentType':'application/ms-tnef'});if(_0x1e5434['length']){logger[_0xe896('0x37')](util[_0xe896('0x34')](_0xe896('0x38'),_0x5b8131['messageId']));tnef[_0xe896('0x39')](_[_0xe896('0x3a')](_0x1e5434)['content'],function(_0x4c05ce,_0x489254){if(_0x489254){_0x5b8131[_0xe896('0x16')]=_0x489254[_0xe896('0x3b')]||_0xe896('0x3c');if(_0x489254[_0xe896('0x3d')]){for(var _0x4452aa=0x0;_0x4452aa<_0x489254[_0xe896('0x3d')]['length'];_0x4452aa++){var _0x125fbc=_0x489254[_0xe896('0x3d')][_0x4452aa];_0x29d1ee['message'][_0xe896('0x25')][_0xe896('0x1a')]({'filename':_0x125fbc[_0xe896('0x3e')],'content':new Buffer(_0x125fbc[_0xe896('0x3f')])});}}}_0x127a6f(parseEmail(_0x4c0ef0,_0x5b8131,_0x29d1ee));});}else{_0x5b8131['html']=_0xe896('0x3c');_0x127a6f(parseEmail(_0x4c0ef0,_0x5b8131,_0x29d1ee));}}else{_0x127a6f(parseEmail(_0x4c0ef0,_0x5b8131,_0x29d1ee));}};exports[_0xe896('0x40')]=function(_0x31ac25){switch(_0x31ac25){case _0xe896('0x41'):return _0xe896('0x42');case _0xe896('0x43'):return'imap.mail.yahoo.com';case _0xe896('0x44'):return'imap-mail.outlook.com';case _0xe896('0x45'):return _0xe896('0x46');}return _0xe896('0x47');};
\ No newline at end of file
index 3201cf3..31b2aa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61c1=['SERV','active','Imap','Smtp','exports','lodash','name','Service','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61c1,0x164));var _0x161c=function(_0x3fbf9d,_0x105b7){_0x3fbf9d=_0x3fbf9d-0x0;var _0x4a9a74=_0x61c1[_0x3fbf9d];return _0x4a9a74;};'use strict';var _=require(_0x161c('0x0'));function MailAccount(_0x28e5ea){this['id']=_0x28e5ea['id']||0x0;this['name']=_0x28e5ea[_0x161c('0x1')]||_0x161c('0x2');this[_0x161c('0x3')]=_0x28e5ea[_0x161c('0x3')]||_0x161c('0x4');this[_0x161c('0x5')]=_0x28e5ea[_0x161c('0x5')]||![];this['Imap']=_0x28e5ea[_0x161c('0x6')]||[];this['Smtp']=_0x28e5ea[_0x161c('0x7')]||[];}module[_0x161c('0x8')]=MailAccount;
\ No newline at end of file
+var _0xb134=['Smtp','exports','lodash','name','key','active','Imap'];(function(_0x91cc04,_0x48e6a6){var _0x26b085=function(_0x2720bf){while(--_0x2720bf){_0x91cc04['push'](_0x91cc04['shift']());}};_0x26b085(++_0x48e6a6);}(_0xb134,0x159));var _0x4b13=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0xb134[_0x628eee];return _0x447718;};'use strict';var _=require(_0x4b13('0x0'));function MailAccount(_0x32ed7f){this['id']=_0x32ed7f['id']||0x0;this['name']=_0x32ed7f[_0x4b13('0x1')]||'Service';this[_0x4b13('0x2')]=_0x32ed7f[_0x4b13('0x2')]||'SERV';this[_0x4b13('0x3')]=_0x32ed7f[_0x4b13('0x3')]||![];this[_0x4b13('0x4')]=_0x32ed7f[_0x4b13('0x4')]||[];this[_0x4b13('0x5')]=_0x32ed7f[_0x4b13('0x5')]||[];}module[_0x4b13('0x6')]=MailAccount;
\ No newline at end of file
index 16a0e8d..eda6fd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8046=['prototype','mergeFromDatabase','mailAccounts','length','isUndefined','merge','../model/mailAccount','hasOwnProperty'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x8046,0x116));var _0x6804=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x8046[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require('lodash');var MailAccount=require(_0x6804('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x3d2fc9,_0xeef2e4,_0x51f14d){var _0x3aba5e=_['mapKeys'](_0x3d2fc9,function(_0x233da5,_0xfb84dc){return _0x233da5[_0x51f14d];});for(var _0x1909fc in _0xeef2e4){if(_0xeef2e4[_0x6804('0x1')](_0x1909fc)){if(!_0x3aba5e[_0x1909fc]){delete _0xeef2e4[_0x1909fc];}}}}Realtime[_0x6804('0x2')][_0x6804('0x3')]=function(_0x241517,_0x2f3420){for(var _0x761773 in _0x2f3420){if(_0x241517[_0x6804('0x1')](_0x761773)){_0x241517[_0x761773]=_0x2f3420[_0x761773];}}};Realtime[_0x6804('0x2')]['initMailAccounts']=function(){var _0xf84b46=this;return function(_0x246d84){if(_0x246d84){freeIsNotKey(_0x246d84,_0xf84b46[_0x6804('0x4')],'id');for(var _0x450389=0x0,_0xe98fda={},_0x28e682={};_0x450389<_0x246d84[_0x6804('0x5')];_0x450389+=0x1){_0xe98fda=_0x246d84[_0x450389];if(_[_0x6804('0x6')](_0xf84b46['mailAccounts'][_0xe98fda['id']])){_0xf84b46['mailAccounts'][_0xe98fda['id']]=new MailAccount(_0xe98fda);}else{_[_0x6804('0x7')](_0xf84b46[_0x6804('0x4')][_0xe98fda['id']],_0xe98fda);}}}return _0xf84b46[_0x6804('0x4')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xf54f=['mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initMailAccounts','length','isUndefined','merge','exports','mailAccounts'];(function(_0x28d00e,_0x20ed20){var _0x273bcf=function(_0x465d83){while(--_0x465d83){_0x28d00e['push'](_0x28d00e['shift']());}};_0x273bcf(++_0x20ed20);}(_0xf54f,0xc7));var _0xff54=function(_0x1c60ce,_0x2a05c3){_0x1c60ce=_0x1c60ce-0x0;var _0x7e0897=_0xf54f[_0x1c60ce];return _0x7e0897;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xff54('0x0')]={};};function freeIsNotKey(_0x2b1ec4,_0xe7d0cc,_0x2a7126){var _0x5f2056=_[_0xff54('0x1')](_0x2b1ec4,function(_0x108764,_0x53fe56){return _0x108764[_0x2a7126];});for(var _0x386d0c in _0xe7d0cc){if(_0xe7d0cc['hasOwnProperty'](_0x386d0c)){if(!_0x5f2056[_0x386d0c]){delete _0xe7d0cc[_0x386d0c];}}}}Realtime[_0xff54('0x2')][_0xff54('0x3')]=function(_0xd8e8a8,_0x536f8b){for(var _0x101d58 in _0x536f8b){if(_0xd8e8a8[_0xff54('0x4')](_0x101d58)){_0xd8e8a8[_0x101d58]=_0x536f8b[_0x101d58];}}};Realtime[_0xff54('0x2')][_0xff54('0x5')]=function(){var _0x46d97e=this;return function(_0x1d2c0f){if(_0x1d2c0f){freeIsNotKey(_0x1d2c0f,_0x46d97e[_0xff54('0x0')],'id');for(var _0x2dc30e=0x0,_0x23d5a1={},_0x1e0f18={};_0x2dc30e<_0x1d2c0f[_0xff54('0x6')];_0x2dc30e+=0x1){_0x23d5a1=_0x1d2c0f[_0x2dc30e];if(_[_0xff54('0x7')](_0x46d97e['mailAccounts'][_0x23d5a1['id']])){_0x46d97e[_0xff54('0x0')][_0x23d5a1['id']]=new MailAccount(_0x23d5a1);}else{_[_0xff54('0x8')](_0x46d97e['mailAccounts'][_0x23d5a1['id']],_0x23d5a1);}}}return _0x46d97e[_0xff54('0x0')];};};module[_0xff54('0x9')]=Realtime;
\ No newline at end of file
index 8895d5c..050f3ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9134=['MailServerIn','Imap','Smtp','getMailAccount','notify','getMailAccounts','Request','GetMailAccount','name','active','key','ListId','TemplateId'];(function(_0x4dc775,_0x10b681){var _0x3486e1=function(_0x6b560a){while(--_0x6b560a){_0x4dc775['push'](_0x4dc775['shift']());}};_0x3486e1(++_0x10b681);}(_0x9134,0x87));var _0x4913=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9134[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0x4913('0x0')]=function(){return function(){return client[_0x4913('0x1')](_0x4913('0x2'),{'options':{'attributes':['id',_0x4913('0x3'),'service','email',_0x4913('0x4'),_0x4913('0x5'),_0x4913('0x6'),_0x4913('0x7')],'raw':![],'include':[{'model':_0x4913('0x8'),'as':_0x4913('0x9')},{'model':'MailServerOut','as':_0x4913('0xa')}]},'log':_0x4913('0xb')});};};exports[_0x4913('0xc')]=function(_0x5b3acd,_0x2bc829){return client[_0x4913('0x1')]('NotifyMailAccount',{'account':{'id':_0x5b3acd},'body':_0x2bc829,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0x3c36=['name','email','active','key','TemplateId','MailServerIn','getMailAccount','NotifyMailAccount','Request','GetMailAccount'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x3c36,0x10c));var _0x63c3=function(_0x38367c,_0x1e094c){_0x38367c=_0x38367c-0x0;var _0x2e90bf=_0x3c36[_0x38367c];return _0x2e90bf;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client[_0x63c3('0x0')](_0x63c3('0x1'),{'options':{'attributes':['id',_0x63c3('0x2'),'service',_0x63c3('0x3'),_0x63c3('0x4'),_0x63c3('0x5'),'ListId',_0x63c3('0x6')],'raw':![],'include':[{'model':_0x63c3('0x7'),'as':'Imap'},{'model':'MailServerOut','as':'Smtp'}]},'log':_0x63c3('0x8')});};};exports['notify']=function(_0x1e3cf4,_0x5ea273){return client[_0x63c3('0x0')](_0x63c3('0x9'),{'account':{'id':_0x1e3cf4},'body':_0x5ea273,'log':_0x63c3('0x9')});};
\ No newline at end of file
index 21b500f..f8dbabf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x939c=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x1ddf84,_0x33ed4b){var _0x43cbcf=function(_0x179f51){while(--_0x179f51){_0x1ddf84['push'](_0x1ddf84['shift']());}};_0x43cbcf(++_0x33ed4b);}(_0x939c,0x1ea));var _0xc939=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x939c[_0x100e36];return _0x1df0c9;};'use strict';var client=require(_0xc939('0x0'));exports[_0xc939('0x1')]=function(){return client[_0xc939('0x2')](_0xc939('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc939('0x4')]},'log':_0xc939('0x5')});};
\ No newline at end of file
+var _0xa75f=['loginMailFrequency','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2ad920,_0x413f71){var _0x3b9606=function(_0x15db7d){while(--_0x15db7d){_0x2ad920['push'](_0x2ad920['shift']());}};_0x3b9606(++_0x413f71);}(_0xa75f,0x10a));var _0xfa75=function(_0x1b4100,_0x109f83){_0x1b4100=_0x1b4100-0x0;var _0x3e6105=_0xa75f[_0x1b4100];return _0x3e6105;};'use strict';var client=require(_0xfa75('0x0'));exports[_0xfa75('0x1')]=function(){return client[_0xfa75('0x2')](_0xfa75('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfa75('0x4')]},'log':_0xfa75('0x5')});};
\ No newline at end of file
index 87314db..161cf8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 1d0a662..2628556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7fd=['redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','../../config/environment','timeout','listen','port','socket.io','websocket','polling','localhost','socket.io-redis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa7fd,0x1c3));var _0xda7f=function(_0x1bf18d,_0x67c828){_0x1bf18d=_0x1bf18d-0x0;var _0x61eac0=_0xa7fd[_0x1bf18d];return _0x61eac0;};'use strict';var _=require('lodash');var http=require(_0xda7f('0x0'));var express=require(_0xda7f('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xda7f('0x2'));var app=express();var server=http['createServer'](app);server[_0xda7f('0x3')]=0xdbba0;if(sticky[_0xda7f('0x4')](server,config[_0xda7f('0x5')])){var socketio=require(_0xda7f('0x6'))(server,{'transports':[_0xda7f('0x7'),_0xda7f('0x8')]});config['redis']=_['defaults'](config['redis'],{'host':_0xda7f('0x9'),'port':0x18eb});socketio['adapter'](require(_0xda7f('0xa'))({'pubClient':new Redis(config[_0xda7f('0xb')]),'subClient':new Redis(config[_0xda7f('0xb')])}));require('../../config/triggers')[_0xda7f('0xc')]();require(_0xda7f('0xd'))[_0xda7f('0xc')](socketio);require(_0xda7f('0xe'))[_0xda7f('0xc')](app);require(_0xda7f('0xf'))['default'](app);}else{server[_0xda7f('0x10')](_0xda7f('0x11'),function(){console[_0xda7f('0x12')](_0xda7f('0x13'),config[_0xda7f('0x5')]);});}exports=module[_0xda7f('0x14')]=app;
\ No newline at end of file
+var _0xdbd3=['express','sticky-session','ioredis','../../config/environment','createServer','timeout','websocket','redis','defaults','localhost','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbd3,0x71));var _0x3dbd=function(_0x375efe,_0x27df2d){_0x375efe=_0x375efe-0x0;var _0x1d5db6=_0xdbd3[_0x375efe];return _0x1d5db6;};'use strict';var _=require('lodash');var http=require(_0x3dbd('0x0'));var express=require(_0x3dbd('0x1'));var sticky=require(_0x3dbd('0x2'));var Redis=require(_0x3dbd('0x3'));var config=require(_0x3dbd('0x4'));var app=express();var server=http[_0x3dbd('0x5')](app);server[_0x3dbd('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require('socket.io')(server,{'transports':[_0x3dbd('0x7'),'polling']});config[_0x3dbd('0x8')]=_[_0x3dbd('0x9')](config[_0x3dbd('0x8')],{'host':_0x3dbd('0xa'),'port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0x3dbd('0x8')]),'subClient':new Redis(config[_0x3dbd('0x8')])}));require('../../config/triggers')['default']();require(_0x3dbd('0xb'))[_0x3dbd('0xc')](socketio);require(_0x3dbd('0xd'))[_0x3dbd('0xc')](app);require(_0x3dbd('0xe'))[_0x3dbd('0xc')](app);}else{server[_0x3dbd('0xf')]('listening',function(){console[_0x3dbd('0x10')](_0x3dbd('0x11'),config['port']);});}exports=module[_0x3dbd('0x12')]=app;
\ No newline at end of file
index be60935..96633af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe29e=['exports','../../config/logger','client','http','Request','request','then','debug','rpc','routing','error','message'];(function(_0xcb00c,_0x468594){var _0x46ac6d=function(_0xfdb983){while(--_0xfdb983){_0xcb00c['push'](_0xcb00c['shift']());}};_0x46ac6d(++_0x468594);}(_0xe29e,0x79));var _0xee29=function(_0x260bae,_0x71dafb){_0x260bae=_0x260bae-0x0;var _0x3bc972=_0xe29e[_0x260bae];return _0x3bc972;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xee29('0x0'))('routing');var client=jayson[_0xee29('0x1')][_0xee29('0x2')]({'port':0x2329});client[_0xee29('0x3')]=function(_0x584a98,_0x105161){return new BPromise(function(_0x5c64f8,_0x691b90){return client[_0xee29('0x4')](_0x584a98,_0x105161)[_0xee29('0x5')](function(_0x5baf43){logger[_0xee29('0x6')](_0xee29('0x7'),_0xee29('0x8'),_0x584a98,_0x105161,_0x5baf43);if(_0x5baf43[_0xee29('0x9')]){logger[_0xee29('0x9')](_0xee29('0x7'),'routing',_0x584a98,_0x5baf43['error']['message'],_0x105161);return _0x691b90(_0x5baf43[_0xee29('0x9')][_0xee29('0xa')]);}else{return _0x5c64f8(_0x5baf43['result']);}})['catch'](function(_0x729eac){logger[_0xee29('0x9')](_0xee29('0x7'),_0xee29('0x8'),_0x584a98,_0x729eac,_0x105161);return _0x691b90(_0x729eac);});});};module[_0xee29('0xb')]=client;
\ No newline at end of file
+var _0xa340=['bluebird','routing','client','http','Request','request','then','debug','rpc','error','exports','jayson/promise'];(function(_0x2d357c,_0x58bd29){var _0x1a3480=function(_0x4d8264){while(--_0x4d8264){_0x2d357c['push'](_0x2d357c['shift']());}};_0x1a3480(++_0x58bd29);}(_0xa340,0x14f));var _0x0a34=function(_0x14f5ed,_0x3fd34d){_0x14f5ed=_0x14f5ed-0x0;var _0x49f682=_0xa340[_0x14f5ed];return _0x49f682;};'use strict';var jayson=require(_0x0a34('0x0'));var BPromise=require(_0x0a34('0x1'));var logger=require('../../config/logger')(_0x0a34('0x2'));var client=jayson[_0x0a34('0x3')][_0x0a34('0x4')]({'port':0x2329});client[_0x0a34('0x5')]=function(_0x2f6404,_0x5683be){return new BPromise(function(_0x17853d,_0x68a65f){return client[_0x0a34('0x6')](_0x2f6404,_0x5683be)[_0x0a34('0x7')](function(_0x4cbd46){logger[_0x0a34('0x8')](_0x0a34('0x9'),_0x0a34('0x2'),_0x2f6404,_0x5683be,_0x4cbd46);if(_0x4cbd46[_0x0a34('0xa')]){logger[_0x0a34('0xa')]('rpc','routing',_0x2f6404,_0x4cbd46[_0x0a34('0xa')]['message'],_0x5683be);return _0x68a65f(_0x4cbd46[_0x0a34('0xa')]['message']);}else{return _0x17853d(_0x4cbd46['result']);}})['catch'](function(_0x77a80b){logger['error'](_0x0a34('0x9'),_0x0a34('0x2'),_0x2f6404,_0x77a80b,_0x5683be);return _0x68a65f(_0x77a80b);});});};module[_0x0a34('0xb')]=client;
\ No newline at end of file
index d4cabda..36be8c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f91=['./rpc/faxQueue','./rpc/whatsappQueue','then','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7f91,0x101));var _0x17f9=function(_0xf48efb,_0x307c7f){_0xf48efb=_0xf48efb-0x0;var _0x179636=_0x7f91[_0xf48efb];return _0x179636;};'use strict';var BPromise=require('bluebird');var server=require(_0x17f9('0x0'));var Realtime=require(_0x17f9('0x1'));var user=require(_0x17f9('0x2'));var interval=require(_0x17f9('0x3'));var openchannelQueue=require(_0x17f9('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x17f9('0x5'));var mailQueue=require(_0x17f9('0x6'));var faxQueue=require(_0x17f9('0x7'));var whatsappQueue=require(_0x17f9('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user['getAgents']())['then'](realtime['initAgents']())['then'](interval['getIntervals']())[_0x17f9('0x9')](realtime['initIntervals']())[_0x17f9('0x9')](openchannelQueue[_0x17f9('0xa')]())[_0x17f9('0x9')](realtime[_0x17f9('0xb')]())[_0x17f9('0x9')](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())['then'](smsQueue[_0x17f9('0xc')]())[_0x17f9('0x9')](realtime[_0x17f9('0xd')]())[_0x17f9('0x9')](mailQueue[_0x17f9('0xe')]())['then'](realtime[_0x17f9('0xf')]())[_0x17f9('0x9')](faxQueue[_0x17f9('0x10')]())['then'](realtime['initFaxQueues']())[_0x17f9('0x9')](whatsappQueue[_0x17f9('0x11')]())['then'](realtime[_0x17f9('0x12')]())['then'](function(){return realtime;});}function main(){return server[_0x17f9('0x13')](realtime)[_0x17f9('0x9')](function(_0x798ac4){return initRealtime();})[_0x17f9('0x9')](function(_0x3c96a4){return setInterval(initRealtime,0x1388);})[_0x17f9('0x14')](function(_0x487e84){console[_0x17f9('0x15')](_0x487e84);});}main();
\ No newline at end of file
+var _0x3d94=['then','initAgents','getIntervals','initIntervals','initOpenchannelQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x1f194a,_0x2e89c6){var _0x397a20=function(_0x25598f){while(--_0x25598f){_0x1f194a['push'](_0x1f194a['shift']());}};_0x397a20(++_0x2e89c6);}(_0x3d94,0x1c6));var _0x43d9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3d94[_0x2641f9];return _0x585741;};'use strict';var BPromise=require('bluebird');var server=require(_0x43d9('0x0'));var Realtime=require(_0x43d9('0x1'));var user=require(_0x43d9('0x2'));var interval=require(_0x43d9('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x43d9('0x4'));var faxQueue=require(_0x43d9('0x5'));var whatsappQueue=require(_0x43d9('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x43d9('0x7')]()[_0x43d9('0x8')](user['getAgents']())[_0x43d9('0x8')](realtime[_0x43d9('0x9')]())['then'](interval[_0x43d9('0xa')]())[_0x43d9('0x8')](realtime[_0x43d9('0xb')]())[_0x43d9('0x8')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0x43d9('0xc')]())[_0x43d9('0x8')](chatQueue['getChatQueues']())[_0x43d9('0x8')](realtime[_0x43d9('0xd')]())[_0x43d9('0x8')](smsQueue[_0x43d9('0xe')]())[_0x43d9('0x8')](realtime['initSmsQueues']())[_0x43d9('0x8')](mailQueue['getMailQueues']())[_0x43d9('0x8')](realtime[_0x43d9('0xf')]())['then'](faxQueue[_0x43d9('0x10')]())[_0x43d9('0x8')](realtime['initFaxQueues']())[_0x43d9('0x8')](whatsappQueue[_0x43d9('0x11')]())['then'](realtime[_0x43d9('0x12')]())[_0x43d9('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x43d9('0x8')](function(_0x76d8d){return initRealtime();})[_0x43d9('0x8')](function(_0x11a4ab){return setInterval(initRealtime,0x1388);})[_0x43d9('0x13')](function(_0x15463e){console[_0x43d9('0x14')](_0x15463e);});}main();
\ No newline at end of file
index aa4f543..20383d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x1373b9,_0x582cc5){var _0x55a7a3=function(_0x4f3e47){while(--_0x4f3e47){_0x1373b9['push'](_0x1373b9['shift']());}};_0x55a7a3(++_0x582cc5);}(_0x7a54,0x106));var _0x47a5=function(_0x5158cf,_0x2a14cb){_0x5158cf=_0x5158cf-0x0;var _0x356a48=_0x7a54[_0x5158cf];return _0x356a48;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine;
\ No newline at end of file
+var _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(_0x17a8e9,_0x586cec){var _0x13277c=function(_0xd9af08){while(--_0xd9af08){_0x17a8e9['push'](_0x17a8e9['shift']());}};_0x13277c(++_0x586cec);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'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
index 76894f2..bb07826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x962d=['sendMailMessage','SendMail','bluebird','jayson/promise','http','request','then','error','message','catch'];(function(_0x272a5c,_0x520f99){var _0x1eea06=function(_0x2222ff){while(--_0x2222ff){_0x272a5c['push'](_0x272a5c['shift']());}};_0x1eea06(++_0x520f99);}(_0x962d,0x1d8));var _0xd962=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0x962d[_0xfc0976];return _0x23579f;};'use strict';var BPromise=require(_0xd962('0x0'));var jayson=require(_0xd962('0x1'));var client=jayson['client'][_0xd962('0x2')]({'port':0x232b});function request(_0x1ffc70,_0xacd9f9){return new BPromise(function(_0x5f45d4,_0x2090c0){return client[_0xd962('0x3')](_0x1ffc70,_0xacd9f9)[_0xd962('0x4')](function(_0xf1a3fe){if(_0xf1a3fe[_0xd962('0x5')]){return _0x2090c0(_0xf1a3fe['error'][_0xd962('0x6')]);}else{return _0x5f45d4(_0xf1a3fe['result']);}})[_0xd962('0x7')](function(_0x39cede){return _0x2090c0(_0x39cede);});});}exports[_0xd962('0x8')]=function(_0x4bc8a2,_0x3df3ca){return request(_0xd962('0x9'),{'account':_0x4bc8a2,'message':_0x3df3ca});};
\ No newline at end of file
+var _0xf5e7=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','result'];(function(_0x45aca3,_0x2dc880){var _0x540d06=function(_0x1ca425){while(--_0x1ca425){_0x45aca3['push'](_0x45aca3['shift']());}};_0x540d06(++_0x2dc880);}(_0xf5e7,0x11b));var _0x7f5e=function(_0x5038e3,_0x29855b){_0x5038e3=_0x5038e3-0x0;var _0x593c8d=_0xf5e7[_0x5038e3];return _0x593c8d;};'use strict';var BPromise=require(_0x7f5e('0x0'));var jayson=require(_0x7f5e('0x1'));var client=jayson[_0x7f5e('0x2')][_0x7f5e('0x3')]({'port':0x232b});function request(_0x67961c,_0x35c1a5){return new BPromise(function(_0x313ad8,_0x38a055){return client[_0x7f5e('0x4')](_0x67961c,_0x35c1a5)['then'](function(_0x51a66b){if(_0x51a66b[_0x7f5e('0x5')]){return _0x38a055(_0x51a66b[_0x7f5e('0x5')]['message']);}else{return _0x313ad8(_0x51a66b[_0x7f5e('0x6')]);}})[_0x7f5e('0x7')](function(_0x13cd37){return _0x38a055(_0x13cd37);});});}exports[_0x7f5e('0x8')]=function(_0x1282f4,_0x363eb6){return request(_0x7f5e('0x9'),{'account':_0x1282f4,'message':_0x363eb6});};
\ No newline at end of file
index 05ca0c1..21fd569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfecc=['openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','faxPause','chatStatusTime','mailStatus','faxStatus','whatsappStatus','whatsappStatusTime','whatsappCapacity','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','name','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','unknown','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','updateRealtime','mail'];(function(_0x143df9,_0x3c87ef){var _0x2d7103=function(_0x76b43b){while(--_0x76b43b){_0x143df9['push'](_0x143df9['shift']());}};_0x2d7103(++_0x3c87ef);}(_0xfecc,0x107));var _0xcfec=function(_0x42bb1b,_0x1a5189){_0x42bb1b=_0x42bb1b-0x0;var _0x15d901=_0xfecc[_0x42bb1b];return _0x15d901;};'use strict';var _=require(_0xcfec('0x0'));var moment=require(_0xcfec('0x1'));var md5=require(_0xcfec('0x2'));var Redis=require(_0xcfec('0x3'));var config=require(_0xcfec('0x4'));config[_0xcfec('0x5')]=_[_0xcfec('0x6')](config[_0xcfec('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcfec('0x5')]));function Agent(_0x1510d6){this['id']=_0x1510d6['id']||0x0;this[_0xcfec('0x7')]=_0x1510d6[_0xcfec('0x7')]||'';this['online']=_0x1510d6['online']||!![];this[_0xcfec('0x8')]=_0x1510d6[_0xcfec('0x8')]||![];this[_0xcfec('0x9')]=_0x1510d6[_0xcfec('0x9')]||![];this['mailPause']=_0x1510d6[_0xcfec('0xa')]||![];this['faxPause']=_0x1510d6['faxPause']||![];this[_0xcfec('0xb')]=_0x1510d6[_0xcfec('0xb')]||![];this[_0xcfec('0xc')]=_0x1510d6[_0xcfec('0xc')]||![];this[_0xcfec('0xd')]='unknown';this['chatStatusTime']=0x0;this[_0xcfec('0xe')]=_0x1510d6[_0xcfec('0xe')]||0x0;this[_0xcfec('0xf')]=0x0;this['mailStatus']='unknown';this[_0xcfec('0x10')]=0x0;this[_0xcfec('0x11')]=_0x1510d6[_0xcfec('0x11')]||0x0;this[_0xcfec('0x12')]=0x0;this['faxStatus']=_0xcfec('0x13');this[_0xcfec('0x14')]=0x0;this['faxCapacity']=_0x1510d6[_0xcfec('0x15')]||0x0;this[_0xcfec('0x16')]=0x0;this[_0xcfec('0x17')]=_0xcfec('0x13');this[_0xcfec('0x18')]=0x0;this[_0xcfec('0x19')]=_0x1510d6['smsCapacity']||0x0;this[_0xcfec('0x1a')]=0x0;this['whatsappStatus']=_0xcfec('0x13');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x1510d6['whatsappCapacity']||0x0;this[_0xcfec('0x1b')]=0x0;this['openchannelStatus']='unknown';this[_0xcfec('0x1c')]=0x0;this[_0xcfec('0x1d')]=_0x1510d6[_0xcfec('0x1d')]||0x0;this[_0xcfec('0x1e')]=0x0;this[_0xcfec('0x1f')]=![];this[_0xcfec('0x20')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0xcfec('0x21')][_0xcfec('0x22')]=function(_0x9688bd){if(this[_0x9688bd+_0xcfec('0x23')]>0x0){if(this[_0x9688bd+_0xcfec('0x24')]>0x0&&this[_0x9688bd+_0xcfec('0x23')]>=this[_0x9688bd+'Capacity']){return _0xcfec('0x25');}else{return _0xcfec('0x26');}}else{return _0xcfec('0x27');}};Agent[_0xcfec('0x21')][_0xcfec('0x28')]=function(){var _0x354fdd=[_0xcfec('0x29'),'chat',_0xcfec('0x2a'),_0xcfec('0x2b'),_0xcfec('0x2c'),_0xcfec('0x2d')];for(var _0x2d805d=0x0;_0x2d805d<_0x354fdd[_0xcfec('0x2e')];_0x2d805d+=0x1){var _0x54352b=this[_0xcfec('0x22')](_0x354fdd[_0x2d805d]);if(this[_0x354fdd[_0x2d805d]+_0xcfec('0x2f')]!==_0x54352b){this[_0x354fdd[_0x2d805d]+_0xcfec('0x30')]=_[_0xcfec('0x31')](moment()[_0xcfec('0x32')]('x'));}this[_0x354fdd[_0x2d805d]+'Status']=_0x54352b;}var _0x1950cc={'id':this['id'],'name':this[_0xcfec('0x7')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0xcfec('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0xcfec('0xb')],'faxPause':this[_0xcfec('0x33')],'openchannelPause':this[_0xcfec('0xc')],'chatStatus':this[_0xcfec('0xd')],'chatStatusTime':this[_0xcfec('0x34')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xcfec('0xf')],'mailStatus':this[_0xcfec('0x35')],'mailStatusTime':this[_0xcfec('0x10')],'mailCapacity':this[_0xcfec('0x11')],'mailCurrentCapacity':this[_0xcfec('0x12')],'faxStatus':this[_0xcfec('0x36')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xcfec('0x17')],'smsStatusTime':this[_0xcfec('0x18')],'smsCapacity':this[_0xcfec('0x19')],'smsCurrentCapacity':this[_0xcfec('0x1a')],'whatsappStatus':this[_0xcfec('0x37')],'whatsappStatusTime':this[_0xcfec('0x38')],'whatsappCapacity':this[_0xcfec('0x39')],'whatsappCurrentCapacity':this[_0xcfec('0x1b')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xcfec('0x1c')],'openchannelCapacity':this[_0xcfec('0x1d')],'openchannelCurrentCapacity':this[_0xcfec('0x1e')],'busy':this[_0xcfec('0x1f')],'busyQueue':this[_0xcfec('0x20')]};var _0x158bff=md5(JSON[_0xcfec('0x3a')](_0x1950cc));if(this[_0xcfec('0x2')]!==_0x158bff){this[_0xcfec('0x2')]=_0x158bff;io[_0xcfec('0x3b')](_0xcfec('0x3c'),_0x1950cc);}};module['exports']=Agent;
\ No newline at end of file
+var _0x348e=['mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','openchannelStatus','openchannelCapacity','busy','busyQueue','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','prototype','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatus','mailCurrentCapacity','whatsappStatusTime','whatsappCurrentCapacity','openchannelStatusTime','openchannelCurrentCapacity','stringify','emit','exports','lodash','ioredis','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus'];(function(_0x1aab27,_0x51aaf9){var _0x231b98=function(_0x3199b9){while(--_0x3199b9){_0x1aab27['push'](_0x1aab27['shift']());}};_0x231b98(++_0x51aaf9);}(_0x348e,0x9f));var _0xe348=function(_0x42c5c1,_0x42ba9d){_0x42c5c1=_0x42c5c1-0x0;var _0x15c220=_0x348e[_0x42c5c1];return _0x15c220;};'use strict';var _=require(_0xe348('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xe348('0x1'));var config=require('../../../config/environment');config['redis']=_[_0xe348('0x2')](config[_0xe348('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xe348('0x4'))(new Redis(config[_0xe348('0x3')]));function Agent(_0x12be17){this['id']=_0x12be17['id']||0x0;this[_0xe348('0x5')]=_0x12be17[_0xe348('0x5')]||'';this[_0xe348('0x6')]=_0x12be17[_0xe348('0x6')]||!![];this['voicePause']=_0x12be17[_0xe348('0x7')]||![];this[_0xe348('0x8')]=_0x12be17[_0xe348('0x8')]||![];this[_0xe348('0x9')]=_0x12be17[_0xe348('0x9')]||![];this[_0xe348('0xa')]=_0x12be17[_0xe348('0xa')]||![];this[_0xe348('0xb')]=_0x12be17[_0xe348('0xb')]||![];this[_0xe348('0xc')]=_0x12be17[_0xe348('0xc')]||![];this['chatStatus']=_0xe348('0xd');this[_0xe348('0xe')]=0x0;this[_0xe348('0xf')]=_0x12be17['chatCapacity']||0x0;this[_0xe348('0x10')]=0x0;this[_0xe348('0x11')]=_0xe348('0xd');this[_0xe348('0x12')]=0x0;this[_0xe348('0x13')]=_0x12be17[_0xe348('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xe348('0x14')]=_0xe348('0xd');this[_0xe348('0x15')]=0x0;this[_0xe348('0x16')]=_0x12be17[_0xe348('0x16')]||0x0;this[_0xe348('0x17')]=0x0;this[_0xe348('0x18')]=_0xe348('0xd');this[_0xe348('0x19')]=0x0;this[_0xe348('0x1a')]=_0x12be17[_0xe348('0x1a')]||0x0;this['smsCurrentCapacity']=0x0;this[_0xe348('0x1b')]=_0xe348('0xd');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x12be17[_0xe348('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xe348('0x1d')]='unknown';this['openchannelStatusTime']=0x0;this[_0xe348('0x1e')]=_0x12be17['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xe348('0x1f')]=![];this[_0xe348('0x20')]=undefined;this[_0xe348('0x21')]='';this[_0xe348('0x22')]();}Agent['prototype'][_0xe348('0x23')]=function(_0x3363ad){if(this[_0x3363ad+_0xe348('0x24')]>0x0){if(this[_0x3363ad+_0xe348('0x25')]>0x0&&this[_0x3363ad+_0xe348('0x24')]>=this[_0x3363ad+_0xe348('0x25')]){return _0xe348('0x26');}else{return'working';}}else{return _0xe348('0x27');}};Agent[_0xe348('0x28')][_0xe348('0x22')]=function(){var _0x196b3c=['mail','chat',_0xe348('0x29'),_0xe348('0x2a'),_0xe348('0x2b'),_0xe348('0x2c')];for(var _0x53bdb1=0x0;_0x53bdb1<_0x196b3c[_0xe348('0x2d')];_0x53bdb1+=0x1){var _0x31045e=this[_0xe348('0x23')](_0x196b3c[_0x53bdb1]);if(this[_0x196b3c[_0x53bdb1]+_0xe348('0x2e')]!==_0x31045e){this[_0x196b3c[_0x53bdb1]+_0xe348('0x2f')]=_[_0xe348('0x30')](moment()[_0xe348('0x31')]('x'));}this[_0x196b3c[_0x53bdb1]+_0xe348('0x2e')]=_0x31045e;}var _0x3f17c7={'id':this['id'],'name':this[_0xe348('0x5')],'online':this['online'],'voicePause':this[_0xe348('0x7')],'chatPause':this[_0xe348('0x8')],'mailPause':this[_0xe348('0x9')],'smsPause':this[_0xe348('0xb')],'faxPause':this[_0xe348('0xa')],'openchannelPause':this[_0xe348('0xc')],'chatStatus':this[_0xe348('0x32')],'chatStatusTime':this[_0xe348('0xe')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xe348('0x10')],'mailStatus':this[_0xe348('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xe348('0x33')],'faxStatus':this[_0xe348('0x14')],'faxStatusTime':this[_0xe348('0x15')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xe348('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xe348('0x19')],'smsCapacity':this[_0xe348('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xe348('0x1b')],'whatsappStatusTime':this[_0xe348('0x34')],'whatsappCapacity':this[_0xe348('0x1c')],'whatsappCurrentCapacity':this[_0xe348('0x35')],'openchannelStatus':this[_0xe348('0x1d')],'openchannelStatusTime':this[_0xe348('0x36')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xe348('0x37')],'busy':this[_0xe348('0x1f')],'busyQueue':this[_0xe348('0x20')]};var _0x20bc96=md5(JSON[_0xe348('0x38')](_0x3f17c7));if(this[_0xe348('0x21')]!==_0x20bc96){this[_0xe348('0x21')]=_0x20bc96;io[_0xe348('0x39')]('user:save',_0x3f17c7);}};module[_0xe348('0x3a')]=Agent;
\ No newline at end of file
index 07e3fc0..e3b14c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3e7=['_rr','map','loggedIn','length','chatPause','available','paused','chat:queue:%s','chat_queue:save','exports','lodash','util','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0xc3e7,0xda));var _0x7c3e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc3e7[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7c3e('0x0'));var md5=require('md5');var util=require(_0x7c3e('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x7c3e('0x2')](config[_0x7c3e('0x3')],{'host':_0x7c3e('0x4'),'port':0x18eb});var io=require(_0x7c3e('0x5'))(new Redis(config['redis']));function ChatQueue(_0x5e3099){this['id']=_0x5e3099['id']||0x0;this[_0x7c3e('0x6')]=_0x5e3099[_0x7c3e('0x6')]||'';this['timeout']=_0x5e3099[_0x7c3e('0x7')]||0xa;this[_0x7c3e('0x8')]=_0x5e3099[_0x7c3e('0x8')]||'beepall';this['Agents']=_0x5e3099[_0x7c3e('0x9')];this[_0x7c3e('0xa')]={};this[_0x7c3e('0xb')]=0x0;this[_0x7c3e('0xc')]='';this[_0x7c3e('0xd')]();this[_0x7c3e('0xe')]();}ChatQueue[_0x7c3e('0xf')][_0x7c3e('0xd')]=function(){var _0xdd3155=this[_0x7c3e('0xa')][_0x7c3e('0x10')];this['mapAgentsId']=_[_0x7c3e('0x11')](this[_0x7c3e('0x9')],'id');this[_0x7c3e('0xa')][_0x7c3e('0x10')]=_0xdd3155;};ChatQueue[_0x7c3e('0xf')][_0x7c3e('0xe')]=function(){this[_0x7c3e('0x12')]=0x0;this['paused']=0x0;for(var _0x562df4=0x0;_0x562df4<this[_0x7c3e('0x9')][_0x7c3e('0x13')];_0x562df4+=0x1){if(this[_0x7c3e('0x9')][_0x562df4]['online']){this[_0x7c3e('0x12')]+=0x1;}if(this['Agents'][_0x562df4][_0x7c3e('0x14')]){this['paused']+=0x1;}}this[_0x7c3e('0x15')]=this[_0x7c3e('0x12')]-this[_0x7c3e('0x16')];this[_0x7c3e('0x15')]=this['available']>=0x0?this['available']:0x0;var _0x352d6d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7c3e('0x12')],'name':this['name'],'paused':this[_0x7c3e('0x16')],'waiting':this[_0x7c3e('0xb')]};var _0x3cffe0=md5(JSON['stringify'](_0x352d6d));if(this[_0x7c3e('0xc')]!==_0x3cffe0){this[_0x7c3e('0xc')]=_0x3cffe0;io['to'](util['format'](_0x7c3e('0x17'),_0x352d6d['name']))['emit'](_0x7c3e('0x18'),_0x352d6d);}};module[_0x7c3e('0x19')]=ChatQueue;
\ No newline at end of file
+var _0x5302=['lodash','md5','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','length','online','loggedIn','chatPause','paused','available','stringify','format','chat:queue:%s'];(function(_0x45cd48,_0x5821bd){var _0x5aae54=function(_0x437067){while(--_0x437067){_0x45cd48['push'](_0x45cd48['shift']());}};_0x5aae54(++_0x5821bd);}(_0x5302,0xe1));var _0x2530=function(_0x1e5a0c,_0x3a16fc){_0x1e5a0c=_0x1e5a0c-0x0;var _0x5cc15b=_0x5302[_0x1e5a0c];return _0x5cc15b;};'use strict';var _=require(_0x2530('0x0'));var md5=require(_0x2530('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x2530('0x2')](config[_0x2530('0x3')],{'host':_0x2530('0x4'),'port':0x18eb});var io=require(_0x2530('0x5'))(new Redis(config[_0x2530('0x3')]));function ChatQueue(_0x295d2a){this['id']=_0x295d2a['id']||0x0;this[_0x2530('0x6')]=_0x295d2a[_0x2530('0x6')]||'';this['timeout']=_0x295d2a[_0x2530('0x7')]||0xa;this[_0x2530('0x8')]=_0x295d2a['strategy']||_0x2530('0x9');this['Agents']=_0x295d2a[_0x2530('0xa')];this[_0x2530('0xb')]={};this[_0x2530('0xc')]=0x0;this[_0x2530('0x1')]='';this[_0x2530('0xd')]();this['updateRealtime']();}ChatQueue[_0x2530('0xe')][_0x2530('0xd')]=function(){var _0x3d423d=this[_0x2530('0xb')]['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0x2530('0xb')][_0x2530('0xf')]=_0x3d423d;};ChatQueue[_0x2530('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x423dc1=0x0;_0x423dc1<this['Agents'][_0x2530('0x10')];_0x423dc1+=0x1){if(this[_0x2530('0xa')][_0x423dc1][_0x2530('0x11')]){this[_0x2530('0x12')]+=0x1;}if(this[_0x2530('0xa')][_0x423dc1][_0x2530('0x13')]){this[_0x2530('0x14')]+=0x1;}}this['available']=this[_0x2530('0x12')]-this['paused'];this[_0x2530('0x15')]=this[_0x2530('0x15')]>=0x0?this[_0x2530('0x15')]:0x0;var _0x4d17e5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2530('0x12')],'name':this[_0x2530('0x6')],'paused':this[_0x2530('0x14')],'waiting':this[_0x2530('0xc')]};var _0xa2d0dd=md5(JSON[_0x2530('0x16')](_0x4d17e5));if(this[_0x2530('0x1')]!==_0xa2d0dd){this[_0x2530('0x1')]=_0xa2d0dd;io['to'](util[_0x2530('0x17')](_0x2530('0x18'),_0x4d17e5[_0x2530('0x6')]))['emit']('chat_queue:save',_0x4d17e5);}};module['exports']=ChatQueue;
\ No newline at end of file
index 3487b8b..436b03a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d5=['available','waiting','fax:queue:%s','emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','paused'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d5,0x113));var _0x585d=function(_0x3d0653,_0x211f3e){_0x3d0653=_0x3d0653-0x0;var _0x204af5=_0x85d5[_0x3d0653];return _0x204af5;};'use strict';var _=require(_0x585d('0x0'));var md5=require(_0x585d('0x1'));var util=require(_0x585d('0x2'));var Redis=require(_0x585d('0x3'));var config=require(_0x585d('0x4'));config['redis']=_[_0x585d('0x5')](config[_0x585d('0x6')],{'host':_0x585d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x585d('0x6')]));function FaxQueue(_0x5df918){this['id']=_0x5df918['id']||0x0;this[_0x585d('0x8')]=_0x5df918[_0x585d('0x8')]||'';this['timeout']=_0x5df918[_0x585d('0x9')]||0xa;this[_0x585d('0xa')]=_0x5df918[_0x585d('0xa')]||_0x585d('0xb');this[_0x585d('0xc')]=_0x5df918[_0x585d('0xc')];this[_0x585d('0xd')]={};this['waiting']=0x0;this[_0x585d('0x1')]='';this[_0x585d('0xe')]();this[_0x585d('0xf')]();}FaxQueue[_0x585d('0x10')][_0x585d('0xe')]=function(){var _0x1d3a64=this[_0x585d('0xd')][_0x585d('0x11')];this['mapAgentsId']=_[_0x585d('0x12')](this[_0x585d('0xc')],'id');this[_0x585d('0xd')]['_rr']=_0x1d3a64;};FaxQueue[_0x585d('0x10')][_0x585d('0xf')]=function(){this[_0x585d('0x13')]=0x0;this['paused']=0x0;for(var _0xa596a7=0x0;_0xa596a7<this[_0x585d('0xc')][_0x585d('0x14')];_0xa596a7+=0x1){if(this[_0x585d('0xc')][_0xa596a7]['online']){this['loggedIn']+=0x1;}if(this[_0x585d('0xc')][_0xa596a7]['faxPause']){this[_0x585d('0x15')]+=0x1;}}this['available']=this[_0x585d('0x13')]-this['paused'];this[_0x585d('0x16')]=this[_0x585d('0x16')]>=0x0?this[_0x585d('0x16')]:0x0;var _0x34be50={'id':this['id'],'available':this[_0x585d('0x16')],'loggedIn':this[_0x585d('0x13')],'name':this[_0x585d('0x8')],'paused':this[_0x585d('0x15')],'waiting':this[_0x585d('0x17')]};var _0x245fd4=md5(JSON['stringify'](_0x34be50));if(this[_0x585d('0x1')]!==_0x245fd4){this[_0x585d('0x1')]=_0x245fd4;io['to'](util['format'](_0x585d('0x18'),_0x34be50[_0x585d('0x8')]))[_0x585d('0x19')](_0x585d('0x1a'),_0x34be50);}};module['exports']=FaxQueue;
\ No newline at end of file
+var _0x7282=['available','stringify','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','Agents','online','loggedIn'];(function(_0x452630,_0x1c0fc4){var _0x31ebec=function(_0x18cb48){while(--_0x18cb48){_0x452630['push'](_0x452630['shift']());}};_0x31ebec(++_0x1c0fc4);}(_0x7282,0x19a));var _0x2728=function(_0x3db2e8,_0x49c09b){_0x3db2e8=_0x3db2e8-0x0;var _0xf05958=_0x7282[_0x3db2e8];return _0xf05958;};'use strict';var _=require(_0x2728('0x0'));var md5=require(_0x2728('0x1'));var util=require(_0x2728('0x2'));var Redis=require(_0x2728('0x3'));var config=require(_0x2728('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x2728('0x5'),'port':0x18eb});var io=require(_0x2728('0x6'))(new Redis(config['redis']));function FaxQueue(_0x4e9219){this['id']=_0x4e9219['id']||0x0;this[_0x2728('0x7')]=_0x4e9219[_0x2728('0x7')]||'';this[_0x2728('0x8')]=_0x4e9219[_0x2728('0x8')]||0xa;this[_0x2728('0x9')]=_0x4e9219[_0x2728('0x9')]||_0x2728('0xa');this['Agents']=_0x4e9219['Agents'];this[_0x2728('0xb')]={};this[_0x2728('0xc')]=0x0;this[_0x2728('0x1')]='';this['updateRouting']();this[_0x2728('0xd')]();}FaxQueue[_0x2728('0xe')][_0x2728('0xf')]=function(){var _0x15e9de=this[_0x2728('0xb')][_0x2728('0x10')];this[_0x2728('0xb')]=_[_0x2728('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x2728('0x10')]=_0x15e9de;};FaxQueue[_0x2728('0xe')][_0x2728('0xd')]=function(){this['loggedIn']=0x0;this[_0x2728('0x12')]=0x0;for(var _0x1b9826=0x0;_0x1b9826<this[_0x2728('0x13')]['length'];_0x1b9826+=0x1){if(this[_0x2728('0x13')][_0x1b9826][_0x2728('0x14')]){this[_0x2728('0x15')]+=0x1;}if(this[_0x2728('0x13')][_0x1b9826]['faxPause']){this[_0x2728('0x12')]+=0x1;}}this[_0x2728('0x16')]=this[_0x2728('0x15')]-this[_0x2728('0x12')];this[_0x2728('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x2adfc1={'id':this['id'],'available':this[_0x2728('0x16')],'loggedIn':this[_0x2728('0x15')],'name':this[_0x2728('0x7')],'paused':this[_0x2728('0x12')],'waiting':this['waiting']};var _0x2909ec=md5(JSON[_0x2728('0x17')](_0x2adfc1));if(this['md5']!==_0x2909ec){this[_0x2728('0x1')]=_0x2909ec;io['to'](util['format']('fax:queue:%s',_0x2adfc1[_0x2728('0x7')]))[_0x2728('0x18')](_0x2728('0x19'),_0x2adfc1);}};module[_0x2728('0x1a')]=FaxQueue;
\ No newline at end of file
index fb5c53c..9389f1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47a8=['name','Intervals'];(function(_0x446970,_0x2e8abc){var _0xccb49a=function(_0x49d1f1){while(--_0x49d1f1){_0x446970['push'](_0x446970['shift']());}};_0xccb49a(++_0x2e8abc);}(_0x47a8,0x76));var _0x847a=function(_0x262872,_0x61c963){_0x262872=_0x262872-0x0;var _0x4ea887=_0x47a8[_0x262872];return _0x4ea887;};'use strict';function Interval(_0x3c4e8d){this['id']=_0x3c4e8d['id']||0x0;this[_0x847a('0x0')]=_0x3c4e8d['name']||'';this[_0x847a('0x1')]=_0x3c4e8d['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xd342=['name'];(function(_0x5b2568,_0x186e15){var _0xa533a9=function(_0x432814){while(--_0x432814){_0x5b2568['push'](_0x5b2568['shift']());}};_0xa533a9(++_0x186e15);}(_0xd342,0x1a3));var _0x2d34=function(_0x476efe,_0xf0f9dc){_0x476efe=_0x476efe-0x0;var _0x23c193=_0xd342[_0x476efe];return _0x23c193;};'use strict';function Interval(_0x3fc37b){this['id']=_0x3fc37b['id']||0x0;this[_0x2d34('0x0')]=_0x3fc37b[_0x2d34('0x0')]||'';this['Intervals']=_0x3fc37b['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
index 7a6fd6d..adfc13e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131c=['mailPause','available','stringify','format','mail_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','loggedIn'];(function(_0x4aff60,_0x2f4e0b){var _0x36465e=function(_0x57762f){while(--_0x57762f){_0x4aff60['push'](_0x4aff60['shift']());}};_0x36465e(++_0x2f4e0b);}(_0x131c,0x1d6));var _0xc131=function(_0x3d0123,_0xcf2395){_0x3d0123=_0x3d0123-0x0;var _0x3ead32=_0x131c[_0x3d0123];return _0x3ead32;};'use strict';var _=require(_0xc131('0x0'));var md5=require('md5');var util=require(_0xc131('0x1'));var Redis=require('ioredis');var config=require(_0xc131('0x2'));config[_0xc131('0x3')]=_[_0xc131('0x4')](config[_0xc131('0x3')],{'host':_0xc131('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc131('0x3')]));function MailQueue(_0x1493ae){this['id']=_0x1493ae['id']||0x0;this[_0xc131('0x6')]=_0x1493ae['name']||'';this[_0xc131('0x7')]=_0x1493ae[_0xc131('0x7')]||0xa;this[_0xc131('0x8')]=_0x1493ae['strategy']||_0xc131('0x9');this[_0xc131('0xa')]=_0x1493ae[_0xc131('0xa')];this[_0xc131('0xb')]={};this[_0xc131('0xc')]=0x0;this[_0xc131('0xd')]='';this[_0xc131('0xe')]();this[_0xc131('0xf')]();}MailQueue[_0xc131('0x10')]['updateRouting']=function(){var _0x551c6d=this['mapAgentsId'][_0xc131('0x11')];this[_0xc131('0xb')]=_[_0xc131('0x12')](this[_0xc131('0xa')],'id');this['mapAgentsId'][_0xc131('0x11')]=_0x551c6d;};MailQueue[_0xc131('0x10')][_0xc131('0xf')]=function(){this['loggedIn']=0x0;this[_0xc131('0x13')]=0x0;for(var _0x1ab1f0=0x0;_0x1ab1f0<this[_0xc131('0xa')][_0xc131('0x14')];_0x1ab1f0+=0x1){if(this['Agents'][_0x1ab1f0][_0xc131('0x15')]){this[_0xc131('0x16')]+=0x1;}if(this['Agents'][_0x1ab1f0][_0xc131('0x17')]){this[_0xc131('0x13')]+=0x1;}}this[_0xc131('0x18')]=this[_0xc131('0x16')]-this[_0xc131('0x13')];this[_0xc131('0x18')]=this[_0xc131('0x18')]>=0x0?this[_0xc131('0x18')]:0x0;var _0x45ac62={'id':this['id'],'available':this[_0xc131('0x18')],'loggedIn':this[_0xc131('0x16')],'name':this[_0xc131('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x567bbc=md5(JSON[_0xc131('0x19')](_0x45ac62));if(this[_0xc131('0xd')]!==_0x567bbc){this[_0xc131('0xd')]=_0x567bbc;io['to'](util[_0xc131('0x1a')]('mail:queue:%s',_0x45ac62[_0xc131('0x6')]))['emit'](_0xc131('0x1b'),_0x45ac62);}};module[_0xc131('0x1c')]=MailQueue;
\ No newline at end of file
+var _0x8853=['timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','name'];(function(_0x58c47c,_0x3485e2){var _0x1182d8=function(_0x22a03c){while(--_0x22a03c){_0x58c47c['push'](_0x58c47c['shift']());}};_0x1182d8(++_0x3485e2);}(_0x8853,0x1cd));var _0x3885=function(_0x14691c,_0xe1c878){_0x14691c=_0x14691c-0x0;var _0xbec98=_0x8853[_0x14691c];return _0xbec98;};'use strict';var _=require('lodash');var md5=require(_0x3885('0x0'));var util=require(_0x3885('0x1'));var Redis=require(_0x3885('0x2'));var config=require('../../../config/environment');config[_0x3885('0x3')]=_['defaults'](config[_0x3885('0x3')],{'host':_0x3885('0x4'),'port':0x18eb});var io=require(_0x3885('0x5'))(new Redis(config['redis']));function MailQueue(_0x24473e){this['id']=_0x24473e['id']||0x0;this['name']=_0x24473e[_0x3885('0x6')]||'';this[_0x3885('0x7')]=_0x24473e[_0x3885('0x7')]||0xa;this[_0x3885('0x8')]=_0x24473e[_0x3885('0x8')]||_0x3885('0x9');this['Agents']=_0x24473e[_0x3885('0xa')];this['mapAgentsId']={};this[_0x3885('0xb')]=0x0;this[_0x3885('0x0')]='';this['updateRouting']();this[_0x3885('0xc')]();}MailQueue[_0x3885('0xd')]['updateRouting']=function(){var _0x29f8f6=this[_0x3885('0xe')]['_rr'];this['mapAgentsId']=_[_0x3885('0xf')](this[_0x3885('0xa')],'id');this[_0x3885('0xe')][_0x3885('0x10')]=_0x29f8f6;};MailQueue[_0x3885('0xd')]['updateRealtime']=function(){this[_0x3885('0x11')]=0x0;this[_0x3885('0x12')]=0x0;for(var _0x4d945e=0x0;_0x4d945e<this[_0x3885('0xa')]['length'];_0x4d945e+=0x1){if(this[_0x3885('0xa')][_0x4d945e]['online']){this['loggedIn']+=0x1;}if(this[_0x3885('0xa')][_0x4d945e]['mailPause']){this[_0x3885('0x12')]+=0x1;}}this[_0x3885('0x13')]=this[_0x3885('0x11')]-this[_0x3885('0x12')];this[_0x3885('0x13')]=this[_0x3885('0x13')]>=0x0?this[_0x3885('0x13')]:0x0;var _0xcb84bf={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3885('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0xd14f55=md5(JSON[_0x3885('0x14')](_0xcb84bf));if(this['md5']!==_0xd14f55){this[_0x3885('0x0')]=_0xd14f55;io['to'](util[_0x3885('0x15')](_0x3885('0x16'),_0xcb84bf[_0x3885('0x6')]))[_0x3885('0x17')](_0x3885('0x18'),_0xcb84bf);}};module[_0x3885('0x19')]=MailQueue;
\ No newline at end of file
index da4c2a5..b403004 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x5954d2,_0x15db93){var _0x316928=function(_0x278bd3){while(--_0x278bd3){_0x5954d2['push'](_0x5954d2['shift']());}};_0x316928(++_0x15db93);}(_0xadb5,0xad));var _0x5adb=function(_0x1f9422,_0x3f8c26){_0x1f9422=_0x1f9422-0x0;var _0x302422=_0xadb5[_0x1f9422];return _0x302422;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c<this[_0x5adb('0xa')]['length'];_0x34af2c+=0x1){if(this[_0x5adb('0xa')][_0x34af2c]['online']){this[_0x5adb('0x12')]+=0x1;}if(this[_0x5adb('0xa')][_0x34af2c][_0x5adb('0x13')]){this[_0x5adb('0x11')]+=0x1;}}this[_0x5adb('0x14')]=this[_0x5adb('0x12')]-this[_0x5adb('0x11')];this[_0x5adb('0x14')]=this[_0x5adb('0x14')]>=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
+var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e9231,_0x2563fe){_0x1e9231=_0x1e9231-0x0;var _0x2f4b96=_0x2ef3[_0x1e9231];return _0x2f4b96;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009<this[_0x32ef('0xa')][_0x32ef('0x11')];_0x4d8009+=0x1){if(this[_0x32ef('0xa')][_0x4d8009][_0x32ef('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4d8009]['openchannelPause']){this[_0x32ef('0x10')]+=0x1;}}this[_0x32ef('0x13')]=this[_0x32ef('0x14')]-this['paused'];this['available']=this[_0x32ef('0x13')]>=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue;
\ No newline at end of file
index 732348c..c16b548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c38=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','waiting','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment'];(function(_0x216c53,_0x135d35){var _0x3b95d1=function(_0x2d7b01){while(--_0x2d7b01){_0x216c53['push'](_0x216c53['shift']());}};_0x3b95d1(++_0x135d35);}(_0x8c38,0x83));var _0x88c3=function(_0x3c2526,_0x157dc3){_0x3c2526=_0x3c2526-0x0;var _0x5ef80f=_0x8c38[_0x3c2526];return _0x5ef80f;};'use strict';var _=require(_0x88c3('0x0'));var md5=require(_0x88c3('0x1'));var util=require('util');var Redis=require(_0x88c3('0x2'));var config=require(_0x88c3('0x3'));config[_0x88c3('0x4')]=_[_0x88c3('0x5')](config['redis'],{'host':_0x88c3('0x6'),'port':0x18eb});var io=require(_0x88c3('0x7'))(new Redis(config[_0x88c3('0x4')]));function SmsQueue(_0xd38738){this['id']=_0xd38738['id']||0x0;this[_0x88c3('0x8')]=_0xd38738[_0x88c3('0x8')]||'';this[_0x88c3('0x9')]=_0xd38738[_0x88c3('0x9')]||0xa;this['strategy']=_0xd38738[_0x88c3('0xa')]||'beepall';this[_0x88c3('0xb')]=_0xd38738['Agents'];this[_0x88c3('0xc')]={};this['waiting']=0x0;this[_0x88c3('0x1')]='';this[_0x88c3('0xd')]();this[_0x88c3('0xe')]();}SmsQueue[_0x88c3('0xf')]['updateRouting']=function(){var _0x40532a=this[_0x88c3('0xc')][_0x88c3('0x10')];this['mapAgentsId']=_[_0x88c3('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x88c3('0x10')]=_0x40532a;};SmsQueue[_0x88c3('0xf')][_0x88c3('0xe')]=function(){this[_0x88c3('0x12')]=0x0;this[_0x88c3('0x13')]=0x0;for(var _0x524f2a=0x0;_0x524f2a<this[_0x88c3('0xb')][_0x88c3('0x14')];_0x524f2a+=0x1){if(this[_0x88c3('0xb')][_0x524f2a][_0x88c3('0x15')]){this['loggedIn']+=0x1;}if(this[_0x88c3('0xb')][_0x524f2a]['smsPause']){this[_0x88c3('0x13')]+=0x1;}}this[_0x88c3('0x16')]=this[_0x88c3('0x12')]-this[_0x88c3('0x13')];this['available']=this['available']>=0x0?this[_0x88c3('0x16')]:0x0;var _0x16ee57={'id':this['id'],'available':this[_0x88c3('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x88c3('0x8')],'paused':this[_0x88c3('0x13')],'waiting':this[_0x88c3('0x17')]};var _0x3a1284=md5(JSON['stringify'](_0x16ee57));if(this['md5']!==_0x3a1284){this[_0x88c3('0x1')]=_0x3a1284;io['to'](util['format']('sms:queue:%s',_0x16ee57[_0x88c3('0x8')]))[_0x88c3('0x18')](_0x88c3('0x19'),_0x16ee57);}};module[_0x88c3('0x1a')]=SmsQueue;
\ No newline at end of file
+var _0xa631=['sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','available','name','stringify','format'];(function(_0x32f8ed,_0x4d3a84){var _0x16a050=function(_0x317461){while(--_0x317461){_0x32f8ed['push'](_0x32f8ed['shift']());}};_0x16a050(++_0x4d3a84);}(_0xa631,0xe4));var _0x1a63=function(_0x488226,_0x55c790){_0x488226=_0x488226-0x0;var _0x1f9928=_0xa631[_0x488226];return _0x1f9928;};'use strict';var _=require('lodash');var md5=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var Redis=require(_0x1a63('0x2'));var config=require('../../../config/environment');config[_0x1a63('0x3')]=_['defaults'](config['redis'],{'host':_0x1a63('0x4'),'port':0x18eb});var io=require(_0x1a63('0x5'))(new Redis(config[_0x1a63('0x3')]));function SmsQueue(_0x4eed61){this['id']=_0x4eed61['id']||0x0;this['name']=_0x4eed61['name']||'';this['timeout']=_0x4eed61[_0x1a63('0x6')]||0xa;this[_0x1a63('0x7')]=_0x4eed61[_0x1a63('0x7')]||'beepall';this['Agents']=_0x4eed61[_0x1a63('0x8')];this[_0x1a63('0x9')]={};this[_0x1a63('0xa')]=0x0;this[_0x1a63('0x0')]='';this[_0x1a63('0xb')]();this['updateRealtime']();}SmsQueue[_0x1a63('0xc')][_0x1a63('0xb')]=function(){var _0x1899b9=this[_0x1a63('0x9')]['_rr'];this[_0x1a63('0x9')]=_[_0x1a63('0xd')](this[_0x1a63('0x8')],'id');this['mapAgentsId'][_0x1a63('0xe')]=_0x1899b9;};SmsQueue['prototype'][_0x1a63('0xf')]=function(){this[_0x1a63('0x10')]=0x0;this[_0x1a63('0x11')]=0x0;for(var _0x5301b6=0x0;_0x5301b6<this['Agents'][_0x1a63('0x12')];_0x5301b6+=0x1){if(this[_0x1a63('0x8')][_0x5301b6][_0x1a63('0x13')]){this[_0x1a63('0x10')]+=0x1;}if(this[_0x1a63('0x8')][_0x5301b6]['smsPause']){this[_0x1a63('0x11')]+=0x1;}}this['available']=this[_0x1a63('0x10')]-this[_0x1a63('0x11')];this[_0x1a63('0x14')]=this[_0x1a63('0x14')]>=0x0?this[_0x1a63('0x14')]:0x0;var _0x24996e={'id':this['id'],'available':this[_0x1a63('0x14')],'loggedIn':this[_0x1a63('0x10')],'name':this[_0x1a63('0x15')],'paused':this[_0x1a63('0x11')],'waiting':this['waiting']};var _0x34ad77=md5(JSON[_0x1a63('0x16')](_0x24996e));if(this['md5']!==_0x34ad77){this[_0x1a63('0x0')]=_0x34ad77;io['to'](util[_0x1a63('0x17')](_0x1a63('0x18'),_0x24996e[_0x1a63('0x15')]))[_0x1a63('0x19')](_0x1a63('0x1a'),_0x24996e);}};module[_0x1a63('0x1b')]=SmsQueue;
\ No newline at end of file
index 0f7635d..27ff828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdba0=['mapAgentsId','loggedIn','paused','online','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','_rr'];(function(_0x2a00e1,_0x918a69){var _0x59eb27=function(_0x145fee){while(--_0x145fee){_0x2a00e1['push'](_0x2a00e1['shift']());}};_0x59eb27(++_0x918a69);}(_0xdba0,0x10e));var _0x0dba=function(_0x2f3d29,_0x150e7b){_0x2f3d29=_0x2f3d29-0x0;var _0x53d69d=_0xdba0[_0x2f3d29];return _0x53d69d;};'use strict';var _=require(_0x0dba('0x0'));var md5=require('md5');var util=require(_0x0dba('0x1'));var Redis=require('ioredis');var config=require(_0x0dba('0x2'));config[_0x0dba('0x3')]=_[_0x0dba('0x4')](config[_0x0dba('0x3')],{'host':_0x0dba('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0dba('0x3')]));function WhatsappQueue(_0x118bb8){this['id']=_0x118bb8['id']||0x0;this[_0x0dba('0x6')]=_0x118bb8[_0x0dba('0x6')]||'';this['timeout']=_0x118bb8[_0x0dba('0x7')]||0xa;this[_0x0dba('0x8')]=_0x118bb8[_0x0dba('0x8')]||'beepall';this[_0x0dba('0x9')]=_0x118bb8[_0x0dba('0x9')];this['mapAgentsId']={};this[_0x0dba('0xa')]=0x0;this[_0x0dba('0xb')]='';this[_0x0dba('0xc')]();this[_0x0dba('0xd')]();}WhatsappQueue[_0x0dba('0xe')][_0x0dba('0xc')]=function(){var _0x5385fe=this['mapAgentsId'][_0x0dba('0xf')];this[_0x0dba('0x10')]=_['map'](this['Agents'],'id');this[_0x0dba('0x10')]['_rr']=_0x5385fe;};WhatsappQueue['prototype'][_0x0dba('0xd')]=function(){this[_0x0dba('0x11')]=0x0;this[_0x0dba('0x12')]=0x0;for(var _0x197a75=0x0;_0x197a75<this['Agents']['length'];_0x197a75+=0x1){if(this['Agents'][_0x197a75][_0x0dba('0x13')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x197a75][_0x0dba('0x14')]){this['paused']+=0x1;}}this['available']=this[_0x0dba('0x11')]-this[_0x0dba('0x12')];this['available']=this['available']>=0x0?this['available']:0x0;var _0x1a9757={'id':this['id'],'available':this[_0x0dba('0x15')],'loggedIn':this[_0x0dba('0x11')],'name':this[_0x0dba('0x6')],'paused':this[_0x0dba('0x12')],'waiting':this[_0x0dba('0xa')]};var _0x5e474b=md5(JSON[_0x0dba('0x16')](_0x1a9757));if(this[_0x0dba('0xb')]!==_0x5e474b){this[_0x0dba('0xb')]=_0x5e474b;io['to'](util['format'](_0x0dba('0x17'),_0x1a9757[_0x0dba('0x6')]))[_0x0dba('0x18')](_0x0dba('0x19'),_0x1a9757);}};module['exports']=WhatsappQueue;
\ No newline at end of file
+var _0x5729=['paused','length','available','stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn'];(function(_0x3ed6a6,_0x4d80c8){var _0x34501b=function(_0x4cf5c3){while(--_0x4cf5c3){_0x3ed6a6['push'](_0x3ed6a6['shift']());}};_0x34501b(++_0x4d80c8);}(_0x5729,0xbe));var _0x9572=function(_0xccd9b7,_0x2ea6bd){_0xccd9b7=_0xccd9b7-0x0;var _0x26301d=_0x5729[_0xccd9b7];return _0x26301d;};'use strict';var _=require(_0x9572('0x0'));var md5=require(_0x9572('0x1'));var util=require(_0x9572('0x2'));var Redis=require('ioredis');var config=require(_0x9572('0x3'));config[_0x9572('0x4')]=_[_0x9572('0x5')](config[_0x9572('0x4')],{'host':_0x9572('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9572('0x4')]));function WhatsappQueue(_0x1eb541){this['id']=_0x1eb541['id']||0x0;this['name']=_0x1eb541[_0x9572('0x7')]||'';this[_0x9572('0x8')]=_0x1eb541[_0x9572('0x8')]||0xa;this['strategy']=_0x1eb541[_0x9572('0x9')]||'beepall';this[_0x9572('0xa')]=_0x1eb541[_0x9572('0xa')];this[_0x9572('0xb')]={};this[_0x9572('0xc')]=0x0;this[_0x9572('0x1')]='';this[_0x9572('0xd')]();this[_0x9572('0xe')]();}WhatsappQueue['prototype'][_0x9572('0xd')]=function(){var _0x5da9fb=this[_0x9572('0xb')][_0x9572('0xf')];this['mapAgentsId']=_[_0x9572('0x10')](this[_0x9572('0xa')],'id');this[_0x9572('0xb')][_0x9572('0xf')]=_0x5da9fb;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x9572('0x11')]=0x0;this[_0x9572('0x12')]=0x0;for(var _0x194884=0x0;_0x194884<this[_0x9572('0xa')][_0x9572('0x13')];_0x194884+=0x1){if(this[_0x9572('0xa')][_0x194884]['online']){this[_0x9572('0x11')]+=0x1;}if(this[_0x9572('0xa')][_0x194884]['whatsappPause']){this[_0x9572('0x12')]+=0x1;}}this[_0x9572('0x14')]=this[_0x9572('0x11')]-this[_0x9572('0x12')];this[_0x9572('0x14')]=this[_0x9572('0x14')]>=0x0?this[_0x9572('0x14')]:0x0;var _0x3e5cf6={'id':this['id'],'available':this[_0x9572('0x14')],'loggedIn':this[_0x9572('0x11')],'name':this[_0x9572('0x7')],'paused':this['paused'],'waiting':this[_0x9572('0xc')]};var _0x3b41e9=md5(JSON[_0x9572('0x15')](_0x3e5cf6));if(this['md5']!==_0x3b41e9){this[_0x9572('0x1')]=_0x3b41e9;io['to'](util[_0x9572('0x16')]('whatsapp:queue:%s',_0x3e5cf6['name']))[_0x9572('0x17')](_0x9572('0x18'),_0x3e5cf6);}};module[_0x9572('0x19')]=WhatsappQueue;
\ No newline at end of file
index a45840f..c31e66c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x1f205f,_0x210c51){var _0xafdf55=function(_0x4a7096){while(--_0x4a7096){_0x1f205f['push'](_0x1f205f['shift']());}};_0xafdf55(++_0x210c51);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0xb10b[_0x2d61ac];return _0x3f7d3c;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x394266,_0x2e46ae){var _0x553071=function(_0x48676c){while(--_0x48676c){_0x394266['push'](_0x394266['shift']());}};_0x553071(++_0x2e46ae);}(_0xb10b,0x12a));var _0xbb10=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0xb10b[_0x547456];return _0xc1fd7b;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index e4abd1a..f7b2b2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74ef=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x9ac72e,_0x27bd29){var _0x5398ae=function(_0x187226){while(--_0x187226){_0x9ac72e['push'](_0x9ac72e['shift']());}};_0x5398ae(++_0x27bd29);}(_0x74ef,0x1b2));var _0xf74e=function(_0x6513bc,_0x117567){_0x6513bc=_0x6513bc-0x0;var _0x5649f8=_0x74ef[_0x6513bc];return _0x5649f8;};'use strict';var client=require('../client');exports[_0xf74e('0x0')]=function(_0x1d0473,_0x2736f2){return client[_0xf74e('0x1')](_0xf74e('0x2'),{'body':_0x2736f2,'options':{'where':{'id':_0x1d0473}},'log':_0xf74e('0x3')});};exports[_0xf74e('0x4')]=function(_0x3466e5,_0x35570a){return client[_0xf74e('0x1')](_0xf74e('0x5'),{'body':_0x35570a,'options':{'where':{'id':_0x3466e5}},'log':_0xf74e('0x6')});};
\ No newline at end of file
+var _0x7878=['../client','update','updateChatInteraction','Request','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x49baaf,_0x4ff783){var _0x9c0dfc=function(_0x5eeffb){while(--_0x5eeffb){_0x49baaf['push'](_0x49baaf['shift']());}};_0x9c0dfc(++_0x4ff783);}(_0x7878,0x96));var _0x8787=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7878[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x8787('0x0'));exports[_0x8787('0x1')]=function(_0xddb915,_0x3421bc){return client['Request']('UpdateChatInteraction',{'body':_0x3421bc,'options':{'where':{'id':_0xddb915}},'log':_0x8787('0x2')});};exports['addTags']=function(_0x1c3e44,_0x419a1e){return client[_0x8787('0x3')](_0x8787('0x4'),{'body':_0x419a1e,'options':{'where':{'id':_0x1c3e44}},'log':_0x8787('0x5')});};
\ No newline at end of file
index a29dc12..c44060b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe016=['Request','createChatMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe016,0x120));var _0x6e01=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xe016[_0x255d5b];return _0x3e141a;};'use strict';var client=require('../client');exports['create']=function(_0x58942a){return client[_0x6e01('0x0')]('CreateChatMessage',{'body':_0x58942a,'log':_0x6e01('0x1')});};
\ No newline at end of file
+var _0x3570=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0xb1e29c,_0x580161){var _0x1491f0=function(_0x3075f9){while(--_0x3075f9){_0xb1e29c['push'](_0xb1e29c['shift']());}};_0x1491f0(++_0x580161);}(_0x3570,0xa8));var _0x0357=function(_0x5c9a2f,_0x83c464){_0x5c9a2f=_0x5c9a2f-0x0;var _0x4a21fa=_0x3570[_0x5c9a2f];return _0x4a21fa;};'use strict';var client=require(_0x0357('0x0'));exports[_0x0357('0x1')]=function(_0x3ef8da){return client[_0x0357('0x2')](_0x0357('0x3'),{'body':_0x3ef8da,'log':_0x0357('0x4')});};
\ No newline at end of file
index bb351a7..0ffa9c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d2=['../client','getChatQueues','GetChatQueue','name','strategy','Agents','online'];(function(_0xd243f3,_0x2dcbee){var _0x168823=function(_0x4bb6dc){while(--_0x4bb6dc){_0xd243f3['push'](_0xd243f3['shift']());}};_0x168823(++_0x2dcbee);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x2d7f60,_0x4675a9){_0x2d7f60=_0x2d7f60-0x0;var _0x20c252=_0xd6d2[_0x2d7f60];return _0x20c252;};'use strict';var client=require(_0x2d6d('0x0'));exports[_0x2d6d('0x1')]=function(){return function(){return client['Request'](_0x2d6d('0x2'),{'options':{'raw':![],'attributes':['id',_0x2d6d('0x3'),'timeout',_0x2d6d('0x4')],'include':[{'model':'User','as':_0x2d6d('0x5'),'attributes':['id',_0x2d6d('0x3'),_0x2d6d('0x6'),'chatPause']}]},'log':_0x2d6d('0x1')});};};
\ No newline at end of file
+var _0x9ca0=['name','timeout','User','Agents','online','../client','getChatQueues','Request'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x9ca0,0x65));var _0x09ca=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x9ca0[_0x278e3c];return _0x3e2d9b;};'use strict';var client=require(_0x09ca('0x0'));exports[_0x09ca('0x1')]=function(){return function(){return client[_0x09ca('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x09ca('0x3'),_0x09ca('0x4'),'strategy'],'include':[{'model':_0x09ca('0x5'),'as':_0x09ca('0x6'),'attributes':['id','name',_0x09ca('0x7'),'chatPause']}]},'log':'getChatQueues'});};};
\ No newline at end of file
index 873c42d..27cf2d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce3=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','create','Request'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x8ce3,0xc3));var _0x38ce=function(_0x492f45,_0x4bbf55){_0x492f45=_0x492f45-0x0;var _0x297b67=_0x8ce3[_0x492f45];return _0x297b67;};'use strict';var client=require(_0x38ce('0x0'));exports[_0x38ce('0x1')]=function(_0x48fa0e){return client[_0x38ce('0x2')](_0x38ce('0x3'),{'body':_0x48fa0e,'log':_0x38ce('0x3')});};exports[_0x38ce('0x4')]=function(_0x1b4dd4,_0x17b96d){return client[_0x38ce('0x2')](_0x38ce('0x5'),{'body':_0x17b96d,'options':{'where':{'uniqueid':_0x1b4dd4},'order':[['id','DESC']],'limit':0x1},'log':_0x38ce('0x5')});};
\ No newline at end of file
+var _0x826a=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x396d92,_0x2c581d){var _0x1e9cd4=function(_0x52e672){while(--_0x52e672){_0x396d92['push'](_0x396d92['shift']());}};_0x1e9cd4(++_0x2c581d);}(_0x826a,0x1aa));var _0xa826=function(_0x403d12,_0x4fbf84){_0x403d12=_0x403d12-0x0;var _0x43508a=_0x826a[_0x403d12];return _0x43508a;};'use strict';var client=require('../client');exports[_0xa826('0x0')]=function(_0x5bb1d7){return client[_0xa826('0x1')]('CreateChatQueueReport',{'body':_0x5bb1d7,'log':_0xa826('0x2')});};exports[_0xa826('0x3')]=function(_0x2212a4,_0x34e1ad){return client['Request'](_0xa826('0x4'),{'body':_0x34e1ad,'options':{'where':{'uniqueid':_0x2212a4},'order':[['id',_0xa826('0x5')]],'limit':0x1},'log':_0xa826('0x4')});};
\ No newline at end of file
index e986831..47f7b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x7a54,0x106));var _0x47a5=function(_0x3e32f8,_0x4f2113){_0x3e32f8=_0x3e32f8-0x0;var _0x8ae7fe=_0x7a54[_0x3e32f8];return _0x8ae7fe;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x44f9ae,_0x27f80a){var _0x7fcd7=function(_0x41cfe6){while(--_0x41cfe6){_0x44f9ae['push'](_0x44f9ae['shift']());}};_0x7fcd7(++_0x27f80a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 898973a..68401e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a13=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x2c072b,_0x6c4449){var _0x167ee3=function(_0x33ef93){while(--_0x33ef93){_0x2c072b['push'](_0x2c072b['shift']());}};_0x167ee3(++_0x6c4449);}(_0x6a13,0x1d6));var _0x36a1=function(_0x1db7e9,_0x36c4f2){_0x1db7e9=_0x1db7e9-0x0;var _0x48bf39=_0x6a13[_0x1db7e9];return _0x48bf39;};'use strict';var client=require(_0x36a1('0x0'));exports[_0x36a1('0x1')]=function(_0x129356){return client[_0x36a1('0x2')](_0x36a1('0x3'),{'body':_0x129356,'log':_0x36a1('0x4')});};
\ No newline at end of file
+var _0x45e9=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x4ef77b,_0x6a3df){var _0x58d1a6=function(_0x3b7e29){while(--_0x3b7e29){_0x4ef77b['push'](_0x4ef77b['shift']());}};_0x58d1a6(++_0x6a3df);}(_0x45e9,0xaf));var _0x945e=function(_0x52ce83,_0x5a9a84){_0x52ce83=_0x52ce83-0x0;var _0x2d752a=_0x45e9[_0x52ce83];return _0x2d752a;};'use strict';var client=require(_0x945e('0x0'));exports[_0x945e('0x1')]=function(_0xa4d6a9){return client[_0x945e('0x2')](_0x945e('0x3'),{'body':_0xa4d6a9,'log':_0x945e('0x4')});};
\ No newline at end of file
index 099e01c..30c766f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x810b=['../client','getFaxQueues','Request','GetFaxQueue','strategy','User','Agents','name'];(function(_0xe864bb,_0x5db5d3){var _0x48b8f0=function(_0xc3a32d){while(--_0xc3a32d){_0xe864bb['push'](_0xe864bb['shift']());}};_0x48b8f0(++_0x5db5d3);}(_0x810b,0x90));var _0xb810=function(_0x2e35bc,_0x2b9df9){_0x2e35bc=_0x2e35bc-0x0;var _0x3430c7=_0x810b[_0x2e35bc];return _0x3430c7;};'use strict';var client=require(_0xb810('0x0'));exports[_0xb810('0x1')]=function(){return function(){return client[_0xb810('0x2')](_0xb810('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xb810('0x4')],'include':[{'model':_0xb810('0x5'),'as':_0xb810('0x6'),'attributes':['id',_0xb810('0x7'),'online','faxPause']}]},'log':_0xb810('0x1')});};};
\ No newline at end of file
+var _0x8f5f=['faxPause','../client','getFaxQueues','GetFaxQueue','name','strategy','User','Agents','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f5f,0x14e));var _0xf8f5=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x8f5f[_0x4067ac];return _0x53d74d;};'use strict';var client=require(_0xf8f5('0x0'));exports[_0xf8f5('0x1')]=function(){return function(){return client['Request'](_0xf8f5('0x2'),{'options':{'raw':![],'attributes':['id',_0xf8f5('0x3'),'timeout',_0xf8f5('0x4')],'include':[{'model':_0xf8f5('0x5'),'as':_0xf8f5('0x6'),'attributes':['id','name',_0xf8f5('0x7'),_0xf8f5('0x8')]}]},'log':_0xf8f5('0x1')});};};
\ No newline at end of file
index 865b5e5..31c4023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ced=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x303ffc,_0xac48e4){var _0x515eb5=function(_0x32f771){while(--_0x32f771){_0x303ffc['push'](_0x303ffc['shift']());}};_0x515eb5(++_0xac48e4);}(_0x7ced,0x126));var _0xd7ce=function(_0x32a8a8,_0x340cd5){_0x32a8a8=_0x32a8a8-0x0;var _0x25837c=_0x7ced[_0x32a8a8];return _0x25837c;};'use strict';var client=require(_0xd7ce('0x0'));exports[_0xd7ce('0x1')]=function(_0x3f0a21){return client[_0xd7ce('0x2')](_0xd7ce('0x3'),{'body':_0x3f0a21,'log':_0xd7ce('0x3')});};exports[_0xd7ce('0x4')]=function(_0x5964d2,_0x2d302d){return client['Request']('UpdateFaxQueueReport',{'body':_0x2d302d,'options':{'where':{'uniqueid':_0x5964d2},'order':[['id','DESC']],'limit':0x1},'log':_0xd7ce('0x5')});};
\ No newline at end of file
+var _0xce1b=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x4f2b7b,_0x85198){var _0x4db151=function(_0x1634c3){while(--_0x1634c3){_0x4f2b7b['push'](_0x4f2b7b['shift']());}};_0x4db151(++_0x85198);}(_0xce1b,0x6b));var _0xbce1=function(_0x4512fa,_0x4d6b86){_0x4512fa=_0x4512fa-0x0;var _0x537546=_0xce1b[_0x4512fa];return _0x537546;};'use strict';var client=require(_0xbce1('0x0'));exports[_0xbce1('0x1')]=function(_0x41cac5){return client[_0xbce1('0x2')]('CreateFaxQueueReport',{'body':_0x41cac5,'log':_0xbce1('0x3')});};exports[_0xbce1('0x4')]=function(_0x321525,_0x17541a){return client[_0xbce1('0x2')](_0xbce1('0x5'),{'body':_0x17541a,'options':{'where':{'uniqueid':_0x321525},'order':[['id','DESC']],'limit':0x1},'log':_0xbce1('0x5')});};
\ No newline at end of file
index 849ca40..eb488bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb749=['Interval','Intervals','interval','getIntervals','Request','GetInterval'];(function(_0x3e3c73,_0x2c8583){var _0x5d4cb4=function(_0x1e3443){while(--_0x1e3443){_0x3e3c73['push'](_0x3e3c73['shift']());}};_0x5d4cb4(++_0x2c8583);}(_0xb749,0x1dd));var _0x9b74=function(_0x4a77ee,_0x86ef86){_0x4a77ee=_0x4a77ee-0x0;var _0x5cbd5f=_0xb749[_0x4a77ee];return _0x5cbd5f;};'use strict';var client=require('../client');exports[_0x9b74('0x0')]=function(){return function(){return client[_0x9b74('0x1')](_0x9b74('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x9b74('0x3'),'as':_0x9b74('0x4'),'attributes':['id','name',_0x9b74('0x5')]}]},'log':_0x9b74('0x0')});};};
\ No newline at end of file
+var _0x8e16=['Intervals','interval','../client','Request','GetInterval','name'];(function(_0x3495e7,_0x2f6a1f){var _0x5cbb6f=function(_0x247f30){while(--_0x247f30){_0x3495e7['push'](_0x3495e7['shift']());}};_0x5cbb6f(++_0x2f6a1f);}(_0x8e16,0x13a));var _0x68e1=function(_0xddb604,_0x3cd27f){_0xddb604=_0xddb604-0x0;var _0x177a5f=_0x8e16[_0xddb604];return _0x177a5f;};'use strict';var client=require(_0x68e1('0x0'));exports['getIntervals']=function(){return function(){return client[_0x68e1('0x1')](_0x68e1('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x68e1('0x3')],'include':[{'model':'Interval','as':_0x68e1('0x4'),'attributes':['id','name',_0x68e1('0x5')]}]},'log':'getIntervals'});};};
\ No newline at end of file
index f0e62ad..7e41038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['updateMailInteraction','Request','addTagsToChatInteraction','update'];(function(_0x403c8d,_0x5e3825){var _0x4ca60d=function(_0x9326c1){while(--_0x9326c1){_0x403c8d['push'](_0x403c8d['shift']());}};_0x4ca60d(++_0x5e3825);}(_0x6d38,0x1ef));var _0x86d3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6d38[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require('../client');exports[_0x86d3('0x0')]=function(_0x4c9c06,_0x3db243){return client['Request']('UpdateMailInteraction',{'body':_0x3db243,'options':{'where':{'id':_0x4c9c06}},'log':_0x86d3('0x1')});};exports['addTags']=function(_0xe9198a,_0x455b9d){return client[_0x86d3('0x2')]('AddTagsToMailInteraction',{'body':_0x455b9d,'options':{'where':{'id':_0xe9198a}},'log':_0x86d3('0x3')});};
\ No newline at end of file
+var _0x896e=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x896e,0x1e9));var _0xe896=function(_0x2aab36,_0x4c49dc){_0x2aab36=_0x2aab36-0x0;var _0x4bfb20=_0x896e[_0x2aab36];return _0x4bfb20;};'use strict';var client=require(_0xe896('0x0'));exports[_0xe896('0x1')]=function(_0x3feebe,_0x229b59){return client[_0xe896('0x2')](_0xe896('0x3'),{'body':_0x229b59,'options':{'where':{'id':_0x3feebe}},'log':_0xe896('0x4')});};exports[_0xe896('0x5')]=function(_0x3f85e5,_0x2d3521){return client[_0xe896('0x2')](_0xe896('0x6'),{'body':_0x2d3521,'options':{'where':{'id':_0x3f85e5}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 3a5152b..a4ed9fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23f0=['createMailMessage','create','Request','CreateMailMessage'];(function(_0x38190c,_0xda85ce){var _0x31e29a=function(_0x46cb79){while(--_0x46cb79){_0x38190c['push'](_0x38190c['shift']());}};_0x31e29a(++_0xda85ce);}(_0x23f0,0x141));var _0x023f=function(_0x2d7d19,_0x594267){_0x2d7d19=_0x2d7d19-0x0;var _0x2ff12b=_0x23f0[_0x2d7d19];return _0x2ff12b;};'use strict';var client=require('../client');exports[_0x023f('0x0')]=function(_0x518e28){return client[_0x023f('0x1')](_0x023f('0x2'),{'body':_0x518e28,'log':_0x023f('0x3')});};
\ No newline at end of file
+var _0x9cb0=['createMailMessage','create','Request','CreateMailMessage'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9cb0,0xe1));var _0x09cb=function(_0x39cf70,_0x3ec55b){_0x39cf70=_0x39cf70-0x0;var _0x580424=_0x9cb0[_0x39cf70];return _0x580424;};'use strict';var client=require('../client');exports[_0x09cb('0x0')]=function(_0x3c77ae){return client[_0x09cb('0x1')](_0x09cb('0x2'),{'body':_0x3c77ae,'log':_0x09cb('0x3')});};
\ No newline at end of file
index 5b6995d..4855d1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28cb=['online','mailPause','../client','getMailQueues','GetMailQueue','timeout','strategy','User','Agents','name'];(function(_0x3856f0,_0x24c781){var _0x3c0987=function(_0x371fce){while(--_0x371fce){_0x3856f0['push'](_0x3856f0['shift']());}};_0x3c0987(++_0x24c781);}(_0x28cb,0x19c));var _0xb28c=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x28cb[_0x2d2c16];return _0x53f2fb;};'use strict';var client=require(_0xb28c('0x0'));exports[_0xb28c('0x1')]=function(){return function(){return client['Request'](_0xb28c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xb28c('0x3'),_0xb28c('0x4')],'include':[{'model':_0xb28c('0x5'),'as':_0xb28c('0x6'),'attributes':['id',_0xb28c('0x7'),_0xb28c('0x8'),_0xb28c('0x9')]}]},'log':_0xb28c('0x1')});};};
\ No newline at end of file
+var _0x4039=['getMailQueues','Request','GetMailQueue','timeout','strategy','Agents','name','online','../client'];(function(_0x1465a5,_0x43c4ac){var _0x4b6bbc=function(_0x5e2076){while(--_0x5e2076){_0x1465a5['push'](_0x1465a5['shift']());}};_0x4b6bbc(++_0x43c4ac);}(_0x4039,0x143));var _0x9403=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x4039[_0xc67528];return _0x38e26d;};'use strict';var client=require(_0x9403('0x0'));exports[_0x9403('0x1')]=function(){return function(){return client[_0x9403('0x2')](_0x9403('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9403('0x4'),_0x9403('0x5')],'include':[{'model':'User','as':_0x9403('0x6'),'attributes':['id',_0x9403('0x7'),_0x9403('0x8'),'mailPause']}]},'log':'getMailQueues'});};};
\ No newline at end of file
index 02610fd..3a60770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8671=['CreateMailQueueReport','update','DESC','../client','Request'];(function(_0x423a82,_0x5e6c40){var _0x5a7a2c=function(_0x475803){while(--_0x475803){_0x423a82['push'](_0x423a82['shift']());}};_0x5a7a2c(++_0x5e6c40);}(_0x8671,0x1ed));var _0x1867=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8671[_0x5c351c];return _0x26f3b3;};'use strict';var client=require(_0x1867('0x0'));exports['create']=function(_0x36bbd5){return client[_0x1867('0x1')](_0x1867('0x2'),{'body':_0x36bbd5,'log':'CreateMailQueueReport'});};exports[_0x1867('0x3')]=function(_0x297aa6,_0x4873cb){return client[_0x1867('0x1')]('UpdateMailQueueReport',{'body':_0x4873cb,'options':{'where':{'uniqueid':_0x297aa6},'order':[['id',_0x1867('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x8018=['CreateMailQueueReport','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x8018,0xa5));var _0x8801=function(_0x26e826,_0x4e4958){_0x26e826=_0x26e826-0x0;var _0x94901a=_0x8018[_0x26e826];return _0x94901a;};'use strict';var client=require(_0x8801('0x0'));exports[_0x8801('0x1')]=function(_0x548edf){return client[_0x8801('0x2')]('CreateMailQueueReport',{'body':_0x548edf,'log':_0x8801('0x3')});};exports['update']=function(_0x5d9e1c,_0x40607a){return client[_0x8801('0x2')]('UpdateMailQueueReport',{'body':_0x40607a,'options':{'where':{'uniqueid':_0x5d9e1c},'order':[['id',_0x8801('0x4')]],'limit':0x1},'log':_0x8801('0x5')});};
\ No newline at end of file
index 5670293..3e2c7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ecf=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request','UpdateOpenchannelInteraction'];(function(_0x1c7655,_0x5852b2){var _0x4b7533=function(_0x1dfc83){while(--_0x1dfc83){_0x1c7655['push'](_0x1c7655['shift']());}};_0x4b7533(++_0x5852b2);}(_0x8ecf,0xfa));var _0xf8ec=function(_0x1961ea,_0x124708){_0x1961ea=_0x1961ea-0x0;var _0x331762=_0x8ecf[_0x1961ea];return _0x331762;};'use strict';var client=require('../client');exports['update']=function(_0x5ce285,_0x82b6cb){return client[_0xf8ec('0x0')](_0xf8ec('0x1'),{'body':_0x82b6cb,'options':{'where':{'id':_0x5ce285}},'log':_0xf8ec('0x2')});};exports[_0xf8ec('0x3')]=function(_0x25ccf1,_0x3efd71){return client['Request'](_0xf8ec('0x4'),{'body':_0x3efd71,'options':{'where':{'id':_0x25ccf1}},'log':_0xf8ec('0x5')});};
\ No newline at end of file
+var _0xdd98=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd98,0x1e0));var _0x8dd9=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0xdd98[_0x10e983];return _0x324138;};'use strict';var client=require('../client');exports['update']=function(_0xb47c6,_0x1bcbc2){return client[_0x8dd9('0x0')](_0x8dd9('0x1'),{'body':_0x1bcbc2,'options':{'where':{'id':_0xb47c6}},'log':_0x8dd9('0x2')});};exports[_0x8dd9('0x3')]=function(_0x4b657e,_0xa3ed71){return client[_0x8dd9('0x0')](_0x8dd9('0x4'),{'body':_0xa3ed71,'options':{'where':{'id':_0x4b657e}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 1d8d094..80d2301 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8072=['Request','create'];(function(_0x5af506,_0x4030c5){var _0x57fde9=function(_0x4e4220){while(--_0x4e4220){_0x5af506['push'](_0x5af506['shift']());}};_0x57fde9(++_0x4030c5);}(_0x8072,0x121));var _0x2807=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x8072[_0x5e3b04];return _0x1fc44d;};'use strict';var client=require('../client');exports[_0x2807('0x0')]=function(_0xa3377d){return client[_0x2807('0x1')]('CreateOpenchannelMessage',{'body':_0xa3377d,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x021a=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0xc5d9de,_0x151b03){var _0x49b41d=function(_0x41a80c){while(--_0x41a80c){_0xc5d9de['push'](_0xc5d9de['shift']());}};_0x49b41d(++_0x151b03);}(_0x021a,0x130));var _0xa021=function(_0x3a62d3,_0x4fd275){_0x3a62d3=_0x3a62d3-0x0;var _0x138eae=_0x021a[_0x3a62d3];return _0x138eae;};'use strict';var client=require(_0xa021('0x0'));exports[_0xa021('0x1')]=function(_0x8778d1){return client[_0xa021('0x2')](_0xa021('0x3'),{'body':_0x8778d1,'log':_0xa021('0x4')});};
\ No newline at end of file
index 89f8594..e53c79f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3f2=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy','User','Agents','openchannelPause'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xc3f2,0x75));var _0x2c3f=function(_0x5d96be,_0x61660a){_0x5d96be=_0x5d96be-0x0;var _0x550aa4=_0xc3f2[_0x5d96be];return _0x550aa4;};'use strict';var client=require(_0x2c3f('0x0'));exports[_0x2c3f('0x1')]=function(){return function(){return client[_0x2c3f('0x2')](_0x2c3f('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2c3f('0x4'),_0x2c3f('0x5')],'include':[{'model':_0x2c3f('0x6'),'as':_0x2c3f('0x7'),'attributes':['id','name','online',_0x2c3f('0x8')]}]},'log':_0x2c3f('0x1')});};};
\ No newline at end of file
+var _0xce03=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x65a6b6,_0x4f724e){var _0x4060bd=function(_0x38201f){while(--_0x38201f){_0x65a6b6['push'](_0x65a6b6['shift']());}};_0x4060bd(++_0x4f724e);}(_0xce03,0x114));var _0x3ce0=function(_0x3c3749,_0x1726fb){_0x3c3749=_0x3c3749-0x0;var _0x575f7e=_0xce03[_0x3c3749];return _0x575f7e;};'use strict';var client=require(_0x3ce0('0x0'));exports[_0x3ce0('0x1')]=function(){return function(){return client[_0x3ce0('0x2')](_0x3ce0('0x3'),{'options':{'raw':![],'attributes':['id',_0x3ce0('0x4'),_0x3ce0('0x5'),_0x3ce0('0x6')],'include':[{'model':_0x3ce0('0x7'),'as':_0x3ce0('0x8'),'attributes':['id',_0x3ce0('0x4'),_0x3ce0('0x9'),_0x3ce0('0xa')]}]},'log':_0x3ce0('0x1')});};};
\ No newline at end of file
index aa45a02..8c43cef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e60=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x139b8f,_0x3a2bba){var _0x5db18b=function(_0x45106b){while(--_0x45106b){_0x139b8f['push'](_0x139b8f['shift']());}};_0x5db18b(++_0x3a2bba);}(_0x4e60,0x1ea));var _0x04e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e60[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x04e6('0x0'));exports[_0x04e6('0x1')]=function(_0x1e7d3b){return client[_0x04e6('0x2')](_0x04e6('0x3'),{'body':_0x1e7d3b,'log':'CreateOpenchannelQueueReport'});};exports[_0x04e6('0x4')]=function(_0x1beaf5,_0x5cf1e2){return client[_0x04e6('0x2')](_0x04e6('0x5'),{'body':_0x5cf1e2,'options':{'where':{'uniqueid':_0x1beaf5},'order':[['id',_0x04e6('0x6')]],'limit':0x1},'log':_0x04e6('0x5')});};
\ No newline at end of file
+var _0xaf1b=['UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport','DESC'];(function(_0x300a7b,_0xe163ac){var _0x260455=function(_0x6fcf65){while(--_0x6fcf65){_0x300a7b['push'](_0x300a7b['shift']());}};_0x260455(++_0xe163ac);}(_0xaf1b,0x182));var _0xbaf1=function(_0x5e5bf8,_0x5844ba){_0x5e5bf8=_0x5e5bf8-0x0;var _0x3f5e3d=_0xaf1b[_0x5e5bf8];return _0x3f5e3d;};'use strict';var client=require(_0xbaf1('0x0'));exports['create']=function(_0x282c70){return client[_0xbaf1('0x1')](_0xbaf1('0x2'),{'body':_0x282c70,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x4be8ed,_0xf8c4d8){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0xf8c4d8,'options':{'where':{'uniqueid':_0x4be8ed},'order':[['id',_0xbaf1('0x3')]],'limit':0x1},'log':_0xbaf1('0x4')});};
\ No newline at end of file
index 3979738..09896ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a88=['addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6a88,0xa9));var _0x86a8=function(_0x3dffb5,_0x1964ac){_0x3dffb5=_0x3dffb5-0x0;var _0x252404=_0x6a88[_0x3dffb5];return _0x252404;};'use strict';var client=require(_0x86a8('0x0'));exports[_0x86a8('0x1')]=function(_0x4346ff,_0x3c2a38){return client[_0x86a8('0x2')](_0x86a8('0x3'),{'body':_0x3c2a38,'options':{'where':{'id':_0x4346ff}},'log':_0x86a8('0x4')});};exports['addTags']=function(_0x21afeb,_0x5aa681){return client['Request'](_0x86a8('0x5'),{'body':_0x5aa681,'options':{'where':{'id':_0x21afeb}},'log':_0x86a8('0x6')});};
\ No newline at end of file
+var _0xec39=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x5d201e,_0x216b92){var _0x33ec76=function(_0x12a86c){while(--_0x12a86c){_0x5d201e['push'](_0x5d201e['shift']());}};_0x33ec76(++_0x216b92);}(_0xec39,0x19f));var _0x9ec3=function(_0x23b8dc,_0x1b7b9d){_0x23b8dc=_0x23b8dc-0x0;var _0xe76082=_0xec39[_0x23b8dc];return _0xe76082;};'use strict';var client=require(_0x9ec3('0x0'));exports[_0x9ec3('0x1')]=function(_0xc365e8,_0x3ea667){return client[_0x9ec3('0x2')](_0x9ec3('0x3'),{'body':_0x3ea667,'options':{'where':{'id':_0xc365e8}},'log':_0x9ec3('0x4')});};exports['addTags']=function(_0x1f43fb,_0x1c944d){return client[_0x9ec3('0x2')]('AddTagsToSmsInteraction',{'body':_0x1c944d,'options':{'where':{'id':_0x1f43fb}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
index 2b3cf34..774bd04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3316=['../client','create','Request'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x3316,0x105));var _0x6331=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x3316[_0x2d89ce];return _0x3fad10;};'use strict';var client=require(_0x6331('0x0'));exports[_0x6331('0x1')]=function(_0x57a05f){return client[_0x6331('0x2')]('CreateSmsMessage',{'body':_0x57a05f,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x7bf8=['CreateSmsMessage','createSmsMessage','Request'];(function(_0x6f5598,_0xabeb74){var _0x1e1325=function(_0x1da246){while(--_0x1da246){_0x6f5598['push'](_0x6f5598['shift']());}};_0x1e1325(++_0xabeb74);}(_0x7bf8,0x11c));var _0x87bf=function(_0x2e5671,_0x24a3e5){_0x2e5671=_0x2e5671-0x0;var _0x3348b7=_0x7bf8[_0x2e5671];return _0x3348b7;};'use strict';var client=require('../client');exports['create']=function(_0x1cfaab){return client[_0x87bf('0x0')](_0x87bf('0x1'),{'body':_0x1cfaab,'log':_0x87bf('0x2')});};
\ No newline at end of file
index 0419a85..d810fd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x56451c,_0x1b7816){var _0x242b93=function(_0x56b132){while(--_0x56b132){_0x56451c['push'](_0x56451c['shift']());}};_0x242b93(++_0x1b7816);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xcb91[_0xd578cb];return _0x775533;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x30d4c8,_0x5143bb){var _0x42063d=function(_0x5afc7c){while(--_0x5afc7c){_0x30d4c8['push'](_0x30d4c8['shift']());}};_0x42063d(++_0x5143bb);}(_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 9a45ef2..5a5babd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x407d57,_0xc7e784){var _0x16a22b=function(_0xe77910){while(--_0xe77910){_0x407d57['push'](_0x407d57['shift']());}};_0x16a22b(++_0xc7e784);}(_0x008c,0x188));var _0xc008=function(_0x1b7dfc,_0x50210c){_0x1b7dfc=_0x1b7dfc-0x0;var _0x134c30=_0x008c[_0x1b7dfc];return _0x134c30;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});};
\ No newline at end of file
+var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x527d5d,_0x11704d){var _0x46dd84=function(_0x5790f4){while(--_0x5790f4){_0x527d5d['push'](_0x527d5d['shift']());}};_0x46dd84(++_0x11704d);}(_0x34e8,0x12c));var _0x834e=function(_0x28863b,_0x458dce){_0x28863b=_0x28863b-0x0;var _0x46507b=_0x34e8[_0x28863b];return _0x46507b;};'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 a730297..47c57b3 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(_0x36d3fc,_0x1c9b1f){var _0x4d29a4=function(_0x521fa1){while(--_0x521fa1){_0x36d3fc['push'](_0x36d3fc['shift']());}};_0x4d29a4(++_0x1c9b1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x13179f,_0xfdfa7e){var _0x2533a2=function(_0x465fdb){while(--_0x465fdb){_0x13179f['push'](_0x13179f['shift']());}};_0x2533a2(++_0xfdfa7e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 da569d4..1bfa399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3914=['AddTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction','addTags'];(function(_0x46b0c9,_0x254ba7){var _0x33ef2e=function(_0x170bef){while(--_0x170bef){_0x46b0c9['push'](_0x46b0c9['shift']());}};_0x33ef2e(++_0x254ba7);}(_0x3914,0xeb));var _0x4391=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x3914[_0x715d76];return _0x48fe88;};'use strict';var client=require(_0x4391('0x0'));exports[_0x4391('0x1')]=function(_0x56867b,_0x234052){return client[_0x4391('0x2')]('UpdateWhatsappInteraction',{'body':_0x234052,'options':{'where':{'id':_0x56867b}},'log':_0x4391('0x3')});};exports[_0x4391('0x4')]=function(_0x175dbc,_0x5b5acb){return client[_0x4391('0x2')](_0x4391('0x5'),{'body':_0x5b5acb,'options':{'where':{'id':_0x175dbc}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x4d68=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x4d68,0x1c3));var _0x84d6=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x4d68[_0x55c1f0];return _0x1530fa;};'use strict';var client=require(_0x84d6('0x0'));exports[_0x84d6('0x1')]=function(_0x2e2636,_0xc5c972){return client[_0x84d6('0x2')](_0x84d6('0x3'),{'body':_0xc5c972,'options':{'where':{'id':_0x2e2636}},'log':'updateWhatsappInteraction'});};exports[_0x84d6('0x4')]=function(_0x5ee114,_0x3a2f0b){return client['Request'](_0x84d6('0x5'),{'body':_0x3a2f0b,'options':{'where':{'id':_0x5ee114}},'log':_0x84d6('0x6')});};
\ No newline at end of file
index 85fff04..a3ee5e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4488=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x2ca67e,_0x539ddb){var _0x27af91=function(_0x50b23b){while(--_0x50b23b){_0x2ca67e['push'](_0x2ca67e['shift']());}};_0x27af91(++_0x539ddb);}(_0x4488,0x181));var _0x8448=function(_0x10455c,_0xe56594){_0x10455c=_0x10455c-0x0;var _0x5dd142=_0x4488[_0x10455c];return _0x5dd142;};'use strict';var client=require(_0x8448('0x0'));exports[_0x8448('0x1')]=function(_0x45c8d7){return client[_0x8448('0x2')](_0x8448('0x3'),{'body':_0x45c8d7,'log':_0x8448('0x4')});};
\ No newline at end of file
+var _0x9843=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x40b1de,_0x4d385f){var _0x2198bf=function(_0x3481ea){while(--_0x3481ea){_0x40b1de['push'](_0x40b1de['shift']());}};_0x2198bf(++_0x4d385f);}(_0x9843,0x160));var _0x3984=function(_0x4fa665,_0x1ae12a){_0x4fa665=_0x4fa665-0x0;var _0x62ccff=_0x9843[_0x4fa665];return _0x62ccff;};'use strict';var client=require(_0x3984('0x0'));exports[_0x3984('0x1')]=function(_0xa3b0db){return client[_0x3984('0x2')](_0x3984('0x3'),{'body':_0xa3b0db,'log':_0x3984('0x4')});};
\ No newline at end of file
index ed8f289..b07015d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b99=['Agents','online','../client','getWhatsappQueues','Request','name','strategy','User'];(function(_0x2c6dd4,_0x5b15b8){var _0x2a6346=function(_0x5be010){while(--_0x5be010){_0x2c6dd4['push'](_0x2c6dd4['shift']());}};_0x2a6346(++_0x5b15b8);}(_0x7b99,0x92));var _0x97b9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7b99[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x97b9('0x0'));exports[_0x97b9('0x1')]=function(){return function(){return client[_0x97b9('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x97b9('0x3'),'timeout',_0x97b9('0x4')],'include':[{'model':_0x97b9('0x5'),'as':_0x97b9('0x6'),'attributes':['id','name',_0x97b9('0x7'),'whatsappPause']}]},'log':_0x97b9('0x1')});};};
\ No newline at end of file
+var _0x0883=['name','timeout','strategy','User','Agents','whatsappPause','getWhatsappQueues','GetWhatsappQueue'];(function(_0x5cd054,_0x2d3b5d){var _0x5a9331=function(_0x2b2a0b){while(--_0x2b2a0b){_0x5cd054['push'](_0x5cd054['shift']());}};_0x5a9331(++_0x2d3b5d);}(_0x0883,0x17e));var _0x3088=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x0883[_0x1573ea];return _0x51c0e2;};'use strict';var client=require('../client');exports[_0x3088('0x0')]=function(){return function(){return client['Request'](_0x3088('0x1'),{'options':{'raw':![],'attributes':['id',_0x3088('0x2'),_0x3088('0x3'),_0x3088('0x4')],'include':[{'model':_0x3088('0x5'),'as':_0x3088('0x6'),'attributes':['id',_0x3088('0x2'),'online',_0x3088('0x7')]}]},'log':_0x3088('0x0')});};};
\ No newline at end of file
index b08b02d..88065db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a48=['../client','create','CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport'];(function(_0x196a75,_0x243799){var _0x42c4ca=function(_0xa9794d){while(--_0xa9794d){_0x196a75['push'](_0x196a75['shift']());}};_0x42c4ca(++_0x243799);}(_0x9a48,0x13e));var _0x89a4=function(_0x20d9f0,_0x453415){_0x20d9f0=_0x20d9f0-0x0;var _0x195dda=_0x9a48[_0x20d9f0];return _0x195dda;};'use strict';var client=require(_0x89a4('0x0'));exports[_0x89a4('0x1')]=function(_0x4b5496){return client['Request'](_0x89a4('0x2'),{'body':_0x4b5496,'log':_0x89a4('0x2')});};exports[_0x89a4('0x3')]=function(_0x528903,_0x1b7059){return client[_0x89a4('0x4')](_0x89a4('0x5'),{'body':_0x1b7059,'options':{'where':{'uniqueid':_0x528903},'order':[['id','DESC']],'limit':0x1},'log':_0x89a4('0x5')});};
\ No newline at end of file
+var _0x5342=['DESC','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x295cc9,_0x56f389){var _0x2a1858=function(_0x5816eb){while(--_0x5816eb){_0x295cc9['push'](_0x295cc9['shift']());}};_0x2a1858(++_0x56f389);}(_0x5342,0xaf));var _0x2534=function(_0xd04611,_0x6f7365){_0xd04611=_0xd04611-0x0;var _0x72e2db=_0x5342[_0xd04611];return _0x72e2db;};'use strict';var client=require('../client');exports[_0x2534('0x0')]=function(_0x556c22){return client[_0x2534('0x1')](_0x2534('0x2'),{'body':_0x556c22,'log':'CreateWhatsappQueueReport'});};exports[_0x2534('0x3')]=function(_0x4a4052,_0x4e11e7){return client[_0x2534('0x1')](_0x2534('0x4'),{'body':_0x4e11e7,'options':{'where':{'uniqueid':_0x4a4052},'order':[['id',_0x2534('0x5')]],'limit':0x1},'log':_0x2534('0x4')});};
\ No newline at end of file
index ea1f10d..091fe16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x441f=['rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','find','agents','timeout','createQueue','atimeout','channel','START:%s'];(function(_0x4fda0b,_0x28084e){var _0x38ff51=function(_0x2752f2){while(--_0x2752f2){_0x4fda0b['push'](_0x4fda0b['shift']());}};_0x38ff51(++_0x28084e);}(_0x441f,0x16a));var _0xf441=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x441f[_0x4bd67a];return _0x2be5fb;};'use strict';var schema=require(_0xf441('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xf441('0x1'))(_0xf441('0x2'));var strategy=require(_0xf441('0x3'));var queue=schema({'name':{'type':_0xf441('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf441('0x5'),'message':_0xf441('0x6')}});function writeLog(_0x5db91c,_0x55c374,_0x1a6178){return logger['info'](util[_0xf441('0x7')](_0xf441('0x8'),_0x5db91c,_0x55c374[_0xf441('0x9')],_0x1a6178));}function handleFindAgent(_0x5a2565){return function(_0x1151a8){return _0x1151a8[_0xf441('0x9')]['toLowerCase']()===_0x5a2565[_0xf441('0xa')]();};}exports['consequence']=function(_0x2461b2,_0x5ec0f0,_0x3feab2,_0x2cd17d){return function(_0x316607){try{var _0x5ba124={'name':_0x5ec0f0[0x0],'timeout':_0x5ec0f0[0x1]};var _0x2b18a5=queue['validate'](_0x5ba124,{'typecast':!![]});if(_0x2b18a5[_0xf441('0xb')]){logger[_0xf441('0xc')](_0xf441('0xd'),_0x2461b2,_[_0xf441('0xe')](_0x2b18a5,_0xf441('0xf'))['join'](',\x20'));_0x316607['stop']();}else{var _0x58cc64=_[_0xf441('0x10')](_0x3feab2[_0xf441('0x11')],handleFindAgent(_0x5ba124[_0xf441('0x9')]));if(_0x58cc64){var _0x4fc8ab=(_0x5ba124[_0xf441('0x12')]||0xa)*0x3e8;var _0x159734,_0x554f52;var _0xd8611b=seqqueue[_0xf441('0x13')](_0x4fc8ab);_0xd8611b['id']=_0x2461b2;_0xd8611b[_0xf441('0x14')]=_0x4fc8ab;_0xd8611b[_0xf441('0x15')]=_0x2cd17d[_0xf441('0x15')];writeLog(_0x2461b2,_0x58cc64,util[_0xf441('0x7')](_0xf441('0x16'),_0x4fc8ab));_0x3feab2[_0xf441('0x17')][_0x2461b2]['on'](_0xf441('0x18'),function(){logger['info'](_0xf441('0x19'),_0x2461b2);clearTimeout(_0x554f52);_0x554f52=undefined;_0xd8611b['close']();if(_0x3feab2[_0xf441('0x17')][_0x2461b2]){delete _0x3feab2[_0xf441('0x17')][_0x2461b2];}_0x316607[_0xf441('0x1a')]();});_0x3feab2['rules'][_0x2461b2]['on'](_0xf441('0x1b'),function(){if(_0x3feab2[_0xf441('0x17')][_0x2461b2]){delete _0x3feab2[_0xf441('0x17')][_0x2461b2];}});_0x554f52=setTimeout(function(){logger['info'](_0xf441('0x1c'),_0x2461b2);clearTimeout(_0x554f52);_0xd8611b[_0xf441('0x1d')]();_0x316607[_0xf441('0x1e')]();},_0x4fc8ab);strategy[_0xf441('0x1f')](_0xd8611b,_0x58cc64,_0x3feab2,_0x2cd17d);}else{logger[_0xf441('0xc')](_0xf441('0x20'),_0x2461b2,_0x5ba124[_0xf441('0x9')]);_0x316607['stop']();}}}catch(_0x250bb8){console['log'](_0x250bb8);logger['error'](_0xf441('0x21'),_0x2461b2,_0x250bb8[_0xf441('0x22')]);_0x316607[_0xf441('0x1a')]();}};};
\ No newline at end of file
+var _0x7b3a=['info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','map','join','stop','timeout','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%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'];(function(_0x3f84aa,_0x14c188){var _0x411c06=function(_0x558f2f){while(--_0x558f2f){_0x3f84aa['push'](_0x3f84aa['shift']());}};_0x411c06(++_0x14c188);}(_0x7b3a,0xaa));var _0xa7b3=function(_0x326c94,_0x3b4ad){_0x326c94=_0x326c94-0x0;var _0x480d71=_0x7b3a[_0x326c94];return _0x480d71;};'use strict';var schema=require(_0xa7b3('0x0'));var _=require('lodash');var util=require(_0xa7b3('0x1'));var seqqueue=require(_0xa7b3('0x2'));var logger=require(_0xa7b3('0x3'))(_0xa7b3('0x4'));var strategy=require(_0xa7b3('0x5'));var queue=schema({'name':{'type':_0xa7b3('0x6'),'required':!![],'message':_0xa7b3('0x7')},'timeout':{'type':_0xa7b3('0x8'),'message':_0xa7b3('0x9')}});function writeLog(_0x326b33,_0x453953,_0x411723){return logger[_0xa7b3('0xa')](util[_0xa7b3('0xb')](_0xa7b3('0xc'),_0x326b33,_0x453953['name'],_0x411723));}function handleFindAgent(_0x3eff28){return function(_0x52deea){return _0x52deea[_0xa7b3('0xd')][_0xa7b3('0xe')]()===_0x3eff28[_0xa7b3('0xe')]();};}exports[_0xa7b3('0xf')]=function(_0x1e1237,_0x19714b,_0x3d0d09,_0x3d10a9){return function(_0x4f69c2){try{var _0x36b8a6={'name':_0x19714b[0x0],'timeout':_0x19714b[0x1]};var _0x364436=queue[_0xa7b3('0x0')](_0x36b8a6,{'typecast':!![]});if(_0x364436[_0xa7b3('0x10')]){logger[_0xa7b3('0x11')]('[%s][AGENT]\x20%s',_0x1e1237,_[_0xa7b3('0x12')](_0x364436,'message')[_0xa7b3('0x13')](',\x20'));_0x4f69c2[_0xa7b3('0x14')]();}else{var _0x4ffb46=_['find'](_0x3d0d09['agents'],handleFindAgent(_0x36b8a6['name']));if(_0x4ffb46){var _0x32d353=(_0x36b8a6[_0xa7b3('0x15')]||0xa)*0x3e8;var _0x351fa6,_0x27f63d;var _0x155529=seqqueue[_0xa7b3('0x16')](_0x32d353);_0x155529['id']=_0x1e1237;_0x155529[_0xa7b3('0x17')]=_0x32d353;_0x155529[_0xa7b3('0x18')]=_0x3d10a9['channel'];writeLog(_0x1e1237,_0x4ffb46,util[_0xa7b3('0xb')]('START:%s',_0x32d353));_0x3d0d09[_0xa7b3('0x19')][_0x1e1237]['on'](_0xa7b3('0x1a'),function(){logger['info'](_0xa7b3('0x1b'),_0x1e1237);clearTimeout(_0x27f63d);_0x27f63d=undefined;_0x155529['close']();if(_0x3d0d09['rules'][_0x1e1237]){delete _0x3d0d09[_0xa7b3('0x19')][_0x1e1237];}_0x4f69c2[_0xa7b3('0x14')]();});_0x3d0d09[_0xa7b3('0x19')][_0x1e1237]['on'](_0xa7b3('0x1c'),function(){if(_0x3d0d09['rules'][_0x1e1237]){delete _0x3d0d09['rules'][_0x1e1237];}});_0x27f63d=setTimeout(function(){logger['info'](_0xa7b3('0x1d'),_0x1e1237);clearTimeout(_0x27f63d);_0x155529['close']();_0x4f69c2[_0xa7b3('0x1e')]();},_0x32d353);strategy[_0xa7b3('0x1f')](_0x155529,_0x4ffb46,_0x3d0d09,_0x3d10a9);}else{logger[_0xa7b3('0x11')](_0xa7b3('0x20'),_0x1e1237,_0x36b8a6['name']);_0x4f69c2[_0xa7b3('0x14')]();}}}catch(_0x2f3b35){console[_0xa7b3('0x21')](_0x2f3b35);logger['error'](_0xa7b3('0x22'),_0x1e1237,_0x2f3b35[_0xa7b3('0x23')]);_0x4f69c2[_0xa7b3('0x14')]();}};};
\ No newline at end of file
index 38be46d..b800fa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x091f=['next','amazonlex','providerResponse','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/faxMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','toString'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x091f,0x19b));var _0xf091=function(_0x40822a,_0x582b60){_0x40822a=_0x40822a-0x0;var _0x357420=_0x091f[_0x40822a];return _0x357420;};'use strict';var _=require(_0xf091('0x0'));var moment=require(_0xf091('0x1'));var AWS=require(_0xf091('0x2'));var utils=require(_0xf091('0x3'));var logger=require(_0xf091('0x4'))(_0xf091('0x5'));var rpc={'chatMessage':require(_0xf091('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf091('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xf091('0x8')]=function(_0x1e4130,_0x4e515f){return function(_0x41657){try{if(!_['isNil'](this[_0xf091('0x9')][_0xf091('0xa')])){logger[_0xf091('0xb')](_0xf091('0xc'),_0x1e4130,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x41657['next']();}var _0x2add02={'ContactId':this[_0xf091('0xd')]['id'],'sentAt':moment()['format'](_0xf091('0xe')),'direction':_0xf091('0xf')};if(this['channel']==='sms'||this[_0xf091('0x10')]===_0xf091('0x11')){_0x2add02[_0xf091('0x12')]=this[_0xf091('0x9')]['phone'];}var _0x10e715=this[_0xf091('0x10')];if(_0x10e715===_0xf091('0x13')){_0x2add02['ChatWebsiteId']=this[_0xf091('0x14')]['id'];}else{_0x2add02[_[_0xf091('0x15')](_0x10e715)+_0xf091('0x16')]=this['account']['id'];}_0x2add02[_[_0xf091('0x15')](_0x10e715)+_0xf091('0x17')]=this[_0xf091('0x9')]['id'];if(this[_0xf091('0x9')][_0xf091('0x18')]){var _0x1bb5b3=_0x4e515f[0x4];if(!_['isEmpty'](_0x1bb5b3)){_0x2add02[_0xf091('0x19')]=utils[_0xf091('0x1a')](_0x1bb5b3,this);return rpc[_0x10e715+_0xf091('0x1b')][_0xf091('0x1c')](_0x2add02)['then'](function(_0x537a0a){logger['info'](_0xf091('0xc'),_0x1e4130,_0x2add02[_0xf091('0x19')]);})[_0xf091('0x1d')](function(_0x27fe33){logger[_0xf091('0x1e')](_0xf091('0xc'),_0x1e4130,JSON[_0xf091('0x1f')](_0x27fe33));})[_0xf091('0x20')](function(){logger['info'](_0xf091('0x21'),_0x1e4130);_0x41657[_0xf091('0x22')]();});}else{logger['info'](_0xf091('0x23'),_0x1e4130);_0x41657['stop']();}}else{var _0x4ac0cc=this;var _0x12f517=new AWS[(_0xf091('0x24'))]({'accessKeyId':_0x4e515f[0x0],'secretAccessKey':_0x4e515f[0x1],'region':_0x4e515f[0x2]});var _0x253bd4={'botAlias':'$LATEST','botName':_0x4e515f[0x3],'inputText':this[_0xf091('0x25')][_0xf091('0x19')],'userId':this['channel']+':'+this[_0xf091('0x9')]['id'][_0xf091('0x26')]()};_0x12f517['postText'](_0x253bd4,function(_0x1baed3,_0x4a1a45){if(_0x1baed3){logger[_0xf091('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x1e4130,_0x1baed3[_0xf091('0x25')]);_0x41657[_0xf091('0x27')]();}else if(_0x4a1a45&&_0x4a1a45[_0xf091('0x25')]){_0x4ac0cc['body']['amazonlex']=_0x4a1a45;_0x2add02[_0xf091('0x19')]=_0x4a1a45[_0xf091('0x25')];_0x2add02['providerName']=_0xf091('0x28');_0x2add02[_0xf091('0x29')]=JSON[_0xf091('0x1f')](_0x4a1a45);return rpc[_0x10e715+'Message'][_0xf091('0x1c')](_0x2add02)[_0xf091('0x2a')](function(_0x587b5c){logger[_0xf091('0xb')]('[%s][AMAZONLEX]\x20%s',_0x1e4130,_0x2add02[_0xf091('0x19')]);if(_0x4a1a45[_0xf091('0x2b')]==_0xf091('0x2c')){_0x41657[_0xf091('0x27')]();}else{_0x41657['stop']();}})[_0xf091('0x1d')](function(_0x168d91){logger[_0xf091('0x1e')](_0xf091('0xc'),_0x1e4130,JSON[_0xf091('0x1f')](_0x168d91));_0x41657[_0xf091('0x27')]();});}else{_0x41657[_0xf091('0x27')]();}});}}catch(_0x3acff8){logger[_0xf091('0x1e')]('[%s][AMAZONLEX]\x20%s',_0x1e4130,JSON['stringify'](_0x3acff8));_0x41657[_0xf091('0x22')]();}};};
\ No newline at end of file
+var _0x1eb0=['stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText','error','amazonlex','providerName','providerResponse','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','then','info'];(function(_0x5cf793,_0xb09bc1){var _0x4e5066=function(_0x384ac7){while(--_0x384ac7){_0x5cf793['push'](_0x5cf793['shift']());}};_0x4e5066(++_0xb09bc1);}(_0x1eb0,0x1c7));var _0x01eb=function(_0x4c0926,_0x178dc2){_0x4c0926=_0x4c0926-0x0;var _0x5b76f5=_0x1eb0[_0x4c0926];return _0x5b76f5;};'use strict';var _=require(_0x01eb('0x0'));var moment=require(_0x01eb('0x1'));var AWS=require(_0x01eb('0x2'));var utils=require(_0x01eb('0x3'));var logger=require(_0x01eb('0x4'))('routing');var rpc={'chatMessage':require(_0x01eb('0x5')),'openchannelMessage':require(_0x01eb('0x6')),'mailMessage':require(_0x01eb('0x7')),'smsMessage':require(_0x01eb('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x01eb('0x9'))};exports[_0x01eb('0xa')]=function(_0x29e1ba,_0x520354){return function(_0x12386a){try{if(!_[_0x01eb('0xb')](this['interaction'][_0x01eb('0xc')])){logger['info'](_0x01eb('0xd'),_0x29e1ba,_0x01eb('0xe'));return _0x12386a[_0x01eb('0xf')]();}var _0x2f4647={'ContactId':this[_0x01eb('0x10')]['id'],'sentAt':moment()[_0x01eb('0x11')](_0x01eb('0x12')),'direction':'out'};if(this[_0x01eb('0x13')]===_0x01eb('0x14')||this['channel']===_0x01eb('0x15')){_0x2f4647['phone']=this[_0x01eb('0x16')][_0x01eb('0x17')];}var _0x2f3e15=this[_0x01eb('0x13')];if(_0x2f3e15===_0x01eb('0x18')){_0x2f4647[_0x01eb('0x19')]=this[_0x01eb('0x1a')]['id'];}else{_0x2f4647[_[_0x01eb('0x1b')](_0x2f3e15)+_0x01eb('0x1c')]=this[_0x01eb('0x1a')]['id'];}_0x2f4647[_[_0x01eb('0x1b')](_0x2f3e15)+'InteractionId']=this[_0x01eb('0x16')]['id'];if(this[_0x01eb('0x16')][_0x01eb('0x1d')]){var _0x116b61=_0x520354[0x4];if(!_['isEmpty'](_0x116b61)){_0x2f4647[_0x01eb('0x1e')]=utils[_0x01eb('0x1f')](_0x116b61,this);return rpc[_0x2f3e15+_0x01eb('0x20')]['create'](_0x2f4647)[_0x01eb('0x21')](function(_0x11ce1b){logger[_0x01eb('0x22')]('[%s][AMAZONLEX]\x20%s',_0x29e1ba,_0x2f4647['body']);})['catch'](function(_0x1e89dd){logger['error'](_0x01eb('0xd'),_0x29e1ba,JSON[_0x01eb('0x23')](_0x1e89dd));})[_0x01eb('0x24')](function(){logger[_0x01eb('0x22')](_0x01eb('0x25'),_0x29e1ba);_0x12386a[_0x01eb('0x26')]();});}else{logger[_0x01eb('0x22')](_0x01eb('0x27'),_0x29e1ba);_0x12386a[_0x01eb('0x26')]();}}else{var _0x538596=this;var _0x58b778=new AWS[(_0x01eb('0x28'))]({'accessKeyId':_0x520354[0x0],'secretAccessKey':_0x520354[0x1],'region':_0x520354[0x2]});var _0x5dbfcf={'botAlias':'$LATEST','botName':_0x520354[0x3],'inputText':this[_0x01eb('0x29')][_0x01eb('0x1e')],'userId':this[_0x01eb('0x13')]+':'+this['interaction']['id']['toString']()};_0x58b778[_0x01eb('0x2a')](_0x5dbfcf,function(_0x3bc096,_0x4b7711){if(_0x3bc096){logger[_0x01eb('0x2b')](_0x01eb('0xd'),_0x29e1ba,_0x3bc096[_0x01eb('0x29')]);_0x12386a[_0x01eb('0xf')]();}else if(_0x4b7711&&_0x4b7711[_0x01eb('0x29')]){_0x538596[_0x01eb('0x1e')][_0x01eb('0x2c')]=_0x4b7711;_0x2f4647[_0x01eb('0x1e')]=_0x4b7711[_0x01eb('0x29')];_0x2f4647[_0x01eb('0x2d')]=_0x01eb('0x2c');_0x2f4647[_0x01eb('0x2e')]=JSON['stringify'](_0x4b7711);return rpc[_0x2f3e15+_0x01eb('0x20')]['create'](_0x2f4647)[_0x01eb('0x21')](function(_0x486178){logger[_0x01eb('0x22')](_0x01eb('0xd'),_0x29e1ba,_0x2f4647['body']);if(_0x4b7711['dialogState']==_0x01eb('0x2f')){_0x12386a['next']();}else{_0x12386a['stop']();}})[_0x01eb('0x30')](function(_0x150d7e){logger['error']('[%s][AMAZONLEX]\x20%s',_0x29e1ba,JSON[_0x01eb('0x23')](_0x150d7e));_0x12386a[_0x01eb('0xf')]();});}else{_0x12386a[_0x01eb('0xf')]();}});}}catch(_0x19a6ef){logger[_0x01eb('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x29e1ba,JSON['stringify'](_0x19a6ef));_0x12386a[_0x01eb('0x26')]();}};};
\ No newline at end of file
index 12f9b04..b6ff93e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17eb=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','messageId','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','interaction','created','info','[%s][AUTOREPLY]\x20%s','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','channel','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20'];(function(_0xc1975c,_0x41a115){var _0x4eb016=function(_0x49a252){while(--_0x49a252){_0xc1975c['push'](_0xc1975c['shift']());}};_0x4eb016(++_0x41a115);}(_0x17eb,0x146));var _0xb17e=function(_0x5a1906,_0x42d724){_0x5a1906=_0x5a1906-0x0;var _0x2218fb=_0x17eb[_0x5a1906];return _0x2218fb;};'use strict';var _=require(_0xb17e('0x0'));var moment=require(_0xb17e('0x1'));var utils=require(_0xb17e('0x2'));var logger=require(_0xb17e('0x3'))(_0xb17e('0x4'));var rpc={'chatMessage':require(_0xb17e('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb17e('0x6')),'smsMessage':require(_0xb17e('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb17e('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xb17e('0x9')),'mailInteraction':require(_0xb17e('0xa')),'smsInteraction':require(_0xb17e('0xb')),'faxInteraction':require(_0xb17e('0xc')),'whatsappInteraction':require(_0xb17e('0xd'))};var mailRpc=require(_0xb17e('0xe'));exports[_0xb17e('0xf')]=function(_0x51b355,_0x1d8071){return function(_0x261bc3){try{if(_0x1d8071[0x0]==='1'&&(_['isNil'](this[_0xb17e('0x10')][_0xb17e('0x11')])||!this[_0xb17e('0x10')][_0xb17e('0x11')])){logger[_0xb17e('0x12')](_0xb17e('0x13'),_0x51b355,'Autoreply\x20already\x20sent');return _0x261bc3[_0xb17e('0x14')]();}if(_0x1d8071[0x0]==='2'&&this[_0xb17e('0x10')][_0xb17e('0x15')]){logger[_0xb17e('0x12')](_0xb17e('0x16'),_0x51b355,'One\x20Time\x20already\x20sent');return _0x261bc3[_0xb17e('0x14')]();}var _0x1f0c10=this[_0xb17e('0x17')];var _0xc36b58={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb17e('0x18')};if(this[_0xb17e('0x17')]==='mail'){_0xc36b58[_0xb17e('0x19')]=utils[_0xb17e('0x1a')](_0x1d8071[0x2],this);}else{_0xc36b58[_0xb17e('0x19')]=utils[_0xb17e('0x1a')](_0x1d8071[0x1],this);}if(this[_0xb17e('0x1b')]){_0xc36b58['to']=this[_0xb17e('0x1b')][_0xb17e('0x1c')]||'';if(this[_0xb17e('0x17')]==='mail'&&_0x1d8071[0x1]==='1'){_0xc36b58['cc']=this[_0xb17e('0x1b')]['cc']||'';}_0xc36b58[_0xb17e('0x1c')]=this[_0xb17e('0x1b')]['to']||'';_0xc36b58['phone']=this[_0xb17e('0x1b')][_0xb17e('0x1d')]||'';_0xc36b58[_0xb17e('0x1e')]=!![];if(this['message'][_0xb17e('0x1f')]){_0xc36b58[_0xb17e('0x1f')]='';_0xc36b58['subject']+=_[_0xb17e('0x20')](this[_0xb17e('0x1b')]['subject'],'Re:')?'':_0xb17e('0x21');_0xc36b58['subject']+=this[_0xb17e('0x1b')][_0xb17e('0x1f')];}}if(this[_0xb17e('0x17')]==='chat'){_0xc36b58[_0xb17e('0x22')]=this[_0xb17e('0x23')]['id'];}else{_0xc36b58[_[_0xb17e('0x24')](this['channel'])+_0xb17e('0x25')]=this[_0xb17e('0x23')]['id'];}_0xc36b58[_[_0xb17e('0x24')](this[_0xb17e('0x17')])+_0xb17e('0x26')]=this[_0xb17e('0x10')]['id'];var _0xfce42a=this[_0xb17e('0x10')];if(rpc[this['channel']+_0xb17e('0x27')]){if(this[_0xb17e('0x17')]==='mail'){var _0xe4a294={'tls':{'rejectUnauthorized':![]}};if(this[_0xb17e('0x23')][_0xb17e('0x28')]['service']){_0xe4a294[_0xb17e('0x29')]=this[_0xb17e('0x23')][_0xb17e('0x28')]['service'];}else{_0xe4a294[_0xb17e('0x2a')]=this[_0xb17e('0x23')][_0xb17e('0x28')]['host'];_0xe4a294[_0xb17e('0x2b')]=this[_0xb17e('0x23')][_0xb17e('0x28')][_0xb17e('0x2b')];_0xe4a294[_0xb17e('0x2c')]=this[_0xb17e('0x23')][_0xb17e('0x28')][_0xb17e('0x2c')];}if(this['account'][_0xb17e('0x28')]['authentication']){_0xe4a294[_0xb17e('0x2d')]={'user':this['account']['Smtp'][_0xb17e('0x2e')],'pass':this[_0xb17e('0x23')][_0xb17e('0x28')][_0xb17e('0x2f')]};}_0xc36b58[_0xb17e('0x30')]=this[_0xb17e('0x1b')]['messageId'];_0xc36b58[_0xb17e('0x31')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0xb17e('0x32')](_0xc36b58[_0xb17e('0x19')],_0xb17e('0x33'),_0xb17e('0x34'))+_0xb17e('0x35');_0xc36b58[_0xb17e('0x36')]={'Auto-Submitted':_0xb17e('0x37'),'X-Auto-Response-Suppress':_0xb17e('0x38'),'Precedence':_0xb17e('0x39')};return mailRpc[_0xb17e('0x3a')](_0xe4a294,_0xc36b58)[_0xb17e('0x3b')](function(_0x20ab3c){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x51b355);_0xc36b58[_0xb17e('0x3c')]=_0x20ab3c[_0xb17e('0x1b')]['messageId'];return rpc[_0x1f0c10+_0xb17e('0x27')][_0xb17e('0x3d')](_0xc36b58);})[_0xb17e('0x3b')](function(_0x5cf5d5){logger['info']('[%s][AUTOREPLY]\x20%s',_0x51b355,JSON['stringify'](_0x5cf5d5));})[_0xb17e('0x3e')](function(_0x2d7f5e){logger[_0xb17e('0x3f')](_0xb17e('0x40'),_0x51b355,JSON[_0xb17e('0x41')](_0x2d7f5e));})[_0xb17e('0x42')](function(){Promise[_0xb17e('0x43')]()[_0xb17e('0x3b')](function(){if(_0x1d8071[0x0]!=='2'||_0xfce42a['autoreplyExecuted'])return;return rpc[_0x1f0c10+_0xb17e('0x44')][_0xb17e('0x45')](_0xfce42a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2e0c2d){logger[_0xb17e('0x12')](_0xb17e('0x16'),_0x51b355,JSON[_0xb17e('0x41')](_0x2e0c2d));})[_0xb17e('0x3e')](function(_0x3126b2){logger['error'](_0xb17e('0x46'),_0x51b355,JSON[_0xb17e('0x41')](_0x3126b2));});})[_0xb17e('0x3b')](function(){_0x261bc3[_0xb17e('0x14')]();});});}else{return rpc[this[_0xb17e('0x17')]+_0xb17e('0x27')][_0xb17e('0x3d')](_0xc36b58)[_0xb17e('0x3b')](function(_0x223b7f){logger['info'](_0xb17e('0x13'),_0x51b355,_0xc36b58[_0xb17e('0x19')]);})[_0xb17e('0x3e')](function(_0x1baea8){logger[_0xb17e('0x3f')](_0xb17e('0x13'),_0x51b355,JSON['stringify'](_0x1baea8));})[_0xb17e('0x42')](function(){Promise[_0xb17e('0x43')]()[_0xb17e('0x3b')](function(){if(_0x1d8071[0x0]!=='2'||_0xfce42a[_0xb17e('0x15')])return;return rpc[_0x1f0c10+'Interaction'][_0xb17e('0x45')](_0xfce42a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4b067a){logger[_0xb17e('0x12')](_0xb17e('0x16'),_0x51b355,JSON[_0xb17e('0x41')](_0x4b067a));})['catch'](function(_0x20a253){logger[_0xb17e('0x3f')](_0xb17e('0x46'),_0x51b355,JSON[_0xb17e('0x41')](_0x20a253));});})[_0xb17e('0x3b')](function(){_0x261bc3[_0xb17e('0x14')]();});});}}}catch(_0x5b7b24){logger[_0xb17e('0x3f')](_0xb17e('0x13'),_0x51b355,JSON[_0xb17e('0x41')](_0x5b7b24));_0x261bc3[_0xb17e('0x47')]();}};};
\ No newline at end of file
+var _0xa0c0=['format','out','channel','body','getMustacheRender','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','AccountId','upperFirst','InteractionId','Message','mail','service','Smtp','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto_reply','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','[%s][AUTOREPLY]\x20%s','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','update','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','interaction','created','info','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent'];(function(_0x3aa87f,_0x244c7d){var _0x45bfe8=function(_0x1388c0){while(--_0x1388c0){_0x3aa87f['push'](_0x3aa87f['shift']());}};_0x45bfe8(++_0x244c7d);}(_0xa0c0,0x1ef));var _0x0a0c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa0c0[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var moment=require(_0x0a0c('0x0'));var utils=require(_0x0a0c('0x1'));var logger=require(_0x0a0c('0x2'))(_0x0a0c('0x3'));var rpc={'chatMessage':require(_0x0a0c('0x4')),'openchannelMessage':require(_0x0a0c('0x5')),'mailMessage':require(_0x0a0c('0x6')),'smsMessage':require(_0x0a0c('0x7')),'faxMessage':require(_0x0a0c('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x0a0c('0x9')),'openchannelInteraction':require(_0x0a0c('0xa')),'mailInteraction':require(_0x0a0c('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x0a0c('0xc')),'whatsappInteraction':require(_0x0a0c('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x0a0c('0xe')]=function(_0x343c5b,_0x4f94a1){return function(_0x33306c){try{if(_0x4f94a1[0x0]==='1'&&(_['isNil'](this[_0x0a0c('0xf')][_0x0a0c('0x10')])||!this['interaction'][_0x0a0c('0x10')])){logger[_0x0a0c('0x11')]('[%s][AUTOREPLY]\x20%s',_0x343c5b,_0x0a0c('0x12'));return _0x33306c[_0x0a0c('0x13')]();}if(_0x4f94a1[0x0]==='2'&&this[_0x0a0c('0xf')][_0x0a0c('0x14')]){logger[_0x0a0c('0x11')](_0x0a0c('0x15'),_0x343c5b,_0x0a0c('0x16'));return _0x33306c['next']();}var _0x2476b8=this['channel'];var _0x38fec9={'ContactId':this['contact']['id'],'sentAt':moment()[_0x0a0c('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0a0c('0x18')};if(this[_0x0a0c('0x19')]==='mail'){_0x38fec9[_0x0a0c('0x1a')]=utils[_0x0a0c('0x1b')](_0x4f94a1[0x2],this);}else{_0x38fec9['body']=utils[_0x0a0c('0x1b')](_0x4f94a1[0x1],this);}if(this[_0x0a0c('0x1c')]){_0x38fec9['to']=this[_0x0a0c('0x1c')]['from']||'';if(this[_0x0a0c('0x19')]==='mail'&&_0x4f94a1[0x1]==='1'){_0x38fec9['cc']=this[_0x0a0c('0x1c')]['cc']||'';}_0x38fec9['from']=this[_0x0a0c('0x1c')]['to']||'';_0x38fec9[_0x0a0c('0x1d')]=this[_0x0a0c('0x1c')]['phone']||'';_0x38fec9[_0x0a0c('0x1e')]=!![];if(this[_0x0a0c('0x1c')][_0x0a0c('0x1f')]){_0x38fec9['subject']='';_0x38fec9[_0x0a0c('0x1f')]+=_[_0x0a0c('0x20')](this[_0x0a0c('0x1c')]['subject'],_0x0a0c('0x21'))?'':_0x0a0c('0x22');_0x38fec9['subject']+=this['message'][_0x0a0c('0x1f')];}}if(this[_0x0a0c('0x19')]===_0x0a0c('0x23')){_0x38fec9['ChatWebsiteId']=this[_0x0a0c('0x24')]['id'];}else{_0x38fec9[_['upperFirst'](this['channel'])+_0x0a0c('0x25')]=this['account']['id'];}_0x38fec9[_[_0x0a0c('0x26')](this[_0x0a0c('0x19')])+_0x0a0c('0x27')]=this[_0x0a0c('0xf')]['id'];var _0x5bd99e=this[_0x0a0c('0xf')];if(rpc[this[_0x0a0c('0x19')]+_0x0a0c('0x28')]){if(this[_0x0a0c('0x19')]===_0x0a0c('0x29')){var _0x4410e2={'tls':{'rejectUnauthorized':![]}};if(this[_0x0a0c('0x24')]['Smtp'][_0x0a0c('0x2a')]){_0x4410e2['service']=this['account'][_0x0a0c('0x2b')][_0x0a0c('0x2a')];}else{_0x4410e2[_0x0a0c('0x2c')]=this[_0x0a0c('0x24')][_0x0a0c('0x2b')][_0x0a0c('0x2c')];_0x4410e2[_0x0a0c('0x2d')]=this[_0x0a0c('0x24')]['Smtp']['port'];_0x4410e2['secure']=this['account'][_0x0a0c('0x2b')][_0x0a0c('0x2e')];}if(this[_0x0a0c('0x24')][_0x0a0c('0x2b')][_0x0a0c('0x2f')]){_0x4410e2[_0x0a0c('0x30')]={'user':this['account']['Smtp'][_0x0a0c('0x31')],'pass':this[_0x0a0c('0x24')][_0x0a0c('0x2b')][_0x0a0c('0x32')]};}_0x38fec9[_0x0a0c('0x33')]=this[_0x0a0c('0x1c')][_0x0a0c('0x34')];_0x38fec9[_0x0a0c('0x35')]=_0x0a0c('0x36')+_['replace'](_0x38fec9['body'],_0x0a0c('0x37'),_0x0a0c('0x38'))+_0x0a0c('0x39');_0x38fec9[_0x0a0c('0x3a')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x0a0c('0x3b')};return mailRpc['sendMailMessage'](_0x4410e2,_0x38fec9)['then'](function(_0x156076){logger[_0x0a0c('0x11')](_0x0a0c('0x3c'),_0x343c5b);_0x38fec9['messageId']=_0x156076[_0x0a0c('0x1c')][_0x0a0c('0x34')];return rpc[_0x2476b8+_0x0a0c('0x28')][_0x0a0c('0x3d')](_0x38fec9);})[_0x0a0c('0x3e')](function(_0x27b240){logger[_0x0a0c('0x11')](_0x0a0c('0x3f'),_0x343c5b,JSON['stringify'](_0x27b240));})[_0x0a0c('0x40')](function(_0x22b605){logger[_0x0a0c('0x41')](_0x0a0c('0x42'),_0x343c5b,JSON[_0x0a0c('0x43')](_0x22b605));})[_0x0a0c('0x44')](function(){Promise[_0x0a0c('0x45')]()[_0x0a0c('0x3e')](function(){if(_0x4f94a1[0x0]!=='2'||_0x5bd99e[_0x0a0c('0x14')])return;return rpc[_0x2476b8+'Interaction'][_0x0a0c('0x46')](_0x5bd99e['id'],{'autoreplyExecuted':!![]})[_0x0a0c('0x3e')](function(_0x408999){logger[_0x0a0c('0x11')](_0x0a0c('0x15'),_0x343c5b,JSON['stringify'](_0x408999));})[_0x0a0c('0x40')](function(_0x33a714){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x343c5b,JSON['stringify'](_0x33a714));});})['then'](function(){_0x33306c[_0x0a0c('0x13')]();});});}else{return rpc[this[_0x0a0c('0x19')]+_0x0a0c('0x28')][_0x0a0c('0x3d')](_0x38fec9)[_0x0a0c('0x3e')](function(_0xa2891f){logger[_0x0a0c('0x11')]('[%s][AUTOREPLY]\x20%s',_0x343c5b,_0x38fec9[_0x0a0c('0x1a')]);})[_0x0a0c('0x40')](function(_0x2d69da){logger[_0x0a0c('0x41')](_0x0a0c('0x3f'),_0x343c5b,JSON[_0x0a0c('0x43')](_0x2d69da));})[_0x0a0c('0x44')](function(){Promise['resolve']()[_0x0a0c('0x3e')](function(){if(_0x4f94a1[0x0]!=='2'||_0x5bd99e[_0x0a0c('0x14')])return;return rpc[_0x2476b8+_0x0a0c('0x47')][_0x0a0c('0x46')](_0x5bd99e['id'],{'autoreplyExecuted':!![]})[_0x0a0c('0x3e')](function(_0x3e4c08){logger[_0x0a0c('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x343c5b,JSON[_0x0a0c('0x43')](_0x3e4c08));})[_0x0a0c('0x40')](function(_0x2b71eb){logger['error'](_0x0a0c('0x48'),_0x343c5b,JSON['stringify'](_0x2b71eb));});})[_0x0a0c('0x3e')](function(){_0x33306c['next']();});});}}}catch(_0x2ab11c){logger['error'](_0x0a0c('0x3f'),_0x343c5b,JSON[_0x0a0c('0x43')](_0x2ab11c));_0x33306c[_0x0a0c('0x49')]();}};};
\ No newline at end of file
index 374cb37..89954f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a3=['then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x98a3,0x133));var _0x398a=function(_0xcf82b2,_0x49ab9a){_0xcf82b2=_0xcf82b2-0x0;var _0x4275e9=_0x98a3[_0xcf82b2];return _0x4275e9;};'use strict';var moment=require('moment');var logger=require(_0x398a('0x0'))(_0x398a('0x1'));var rpc={'chatInteraction':require(_0x398a('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x398a('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x398a('0x4')),'whatsappInteraction':require(_0x398a('0x5'))};exports['consequence']=function(_0x17fa1b,_0x403ed9,_0xa95bf,_0x311b78){return function(_0x6d37e5){try{logger[_0x398a('0x6')](_0x398a('0x7'),_0x17fa1b,_0x403ed9[0x0]);var _0x4c2559={'closed':0x1,'closedAt':moment()[_0x398a('0x8')](_0x398a('0x9')),'closeReason':_0x398a('0xa'),'disposition':_0x403ed9[0x0]};if(rpc[_0x311b78[_0x398a('0xb')]+_0x398a('0xc')]){rpc[_0x311b78[_0x398a('0xb')]+'Interaction'][_0x398a('0xd')](_0x311b78[_0x398a('0xe')]['id'],_0x4c2559)[_0x398a('0xf')](function(_0x1ae71a){logger[_0x398a('0x6')](_0x398a('0x10'),_0x17fa1b,_0x311b78[_0x398a('0xe')]['id']);})[_0x398a('0x11')](function(_0xef7069){logger[_0x398a('0x12')](_0x398a('0x13'),_0x17fa1b,JSON[_0x398a('0x14')](_0xef7069));})[_0x398a('0x15')](function(){_0x6d37e5[_0x398a('0x16')]();});}}catch(_0xb45f67){logger['error'](_0x398a('0x13'),_0x17fa1b,JSON[_0x398a('0x14')](_0xb45f67));_0x6d37e5['stop']();}};};
\ No newline at end of file
+var _0xdc0d=['../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info','format','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger'];(function(_0x4a8bfd,_0x2849a8){var _0x562bd9=function(_0x1c21c5){while(--_0x1c21c5){_0x4a8bfd['push'](_0x4a8bfd['shift']());}};_0x562bd9(++_0x2849a8);}(_0xdc0d,0x1e1));var _0xddc0=function(_0x250b9e,_0x26614d){_0x250b9e=_0x250b9e-0x0;var _0x36c5a3=_0xdc0d[_0x250b9e];return _0x36c5a3;};'use strict';var moment=require(_0xddc0('0x0'));var logger=require(_0xddc0('0x1'))('routing');var rpc={'chatInteraction':require(_0xddc0('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xddc0('0x3')),'mailInteraction':require(_0xddc0('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xddc0('0x5'))};exports['consequence']=function(_0x1a18a9,_0xed599,_0x520391,_0x1cd157){return function(_0x12d358){try{logger[_0xddc0('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x1a18a9,_0xed599[0x0]);var _0x5e6899={'closed':0x1,'closedAt':moment()[_0xddc0('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xddc0('0x8'),'disposition':_0xed599[0x0]};if(rpc[_0x1cd157[_0xddc0('0x9')]+'Interaction']){rpc[_0x1cd157[_0xddc0('0x9')]+_0xddc0('0xa')][_0xddc0('0xb')](_0x1cd157[_0xddc0('0xc')]['id'],_0x5e6899)[_0xddc0('0xd')](function(_0x16c054){logger[_0xddc0('0x6')](_0xddc0('0xe'),_0x1a18a9,_0x1cd157[_0xddc0('0xc')]['id']);})[_0xddc0('0xf')](function(_0x4155d8){logger[_0xddc0('0x10')](_0xddc0('0x11'),_0x1a18a9,JSON['stringify'](_0x4155d8));})[_0xddc0('0x12')](function(){_0x12d358[_0xddc0('0x13')]();});}}catch(_0x123020){logger[_0xddc0('0x10')](_0xddc0('0x11'),_0x1a18a9,JSON[_0xddc0('0x14')](_0x123020));_0x12d358[_0xddc0('0x13')]();}};};
\ No newline at end of file
index 473f7b5..1320b14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9206=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','speech','providerName','providerResponse','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','isNil','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9206,0x176));var _0x6920=function(_0x1174b6,_0x3f17e7){_0x1174b6=_0x1174b6-0x0;var _0x28edce=_0x9206[_0x1174b6];return _0x28edce;};'use strict';var _=require(_0x6920('0x0'));var moment=require(_0x6920('0x1'));var apiai=require(_0x6920('0x2'));var md5=require(_0x6920('0x3'));var utils=require(_0x6920('0x4'));var logger=require(_0x6920('0x5'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6920('0x6')),'mailMessage':require(_0x6920('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x6920('0x8'))};exports['consequence']=function(_0x21fb21,_0x31966d){return function(_0x2aad51){try{if(!_[_0x6920('0x9')](this['interaction']['UserId'])){logger[_0x6920('0xa')](_0x6920('0xb'),_0x21fb21,_0x6920('0xc'));return _0x2aad51[_0x6920('0xd')]();}var _0x188e0c={'ContactId':this[_0x6920('0xe')]['id'],'sentAt':moment()[_0x6920('0xf')](_0x6920('0x10')),'direction':_0x6920('0x11')};if(this[_0x6920('0x12')]===_0x6920('0x13')||this[_0x6920('0x12')]===_0x6920('0x14')){_0x188e0c['phone']=this['interaction'][_0x6920('0x15')];}var _0x3484fb=this['channel'];if(_0x3484fb===_0x6920('0x16')){_0x188e0c[_0x6920('0x17')]=this[_0x6920('0x18')]['id'];}else{_0x188e0c[_[_0x6920('0x19')](_0x3484fb)+_0x6920('0x1a')]=this['account']['id'];}_0x188e0c[_[_0x6920('0x19')](_0x3484fb)+_0x6920('0x1b')]=this[_0x6920('0x1c')]['id'];if(this[_0x6920('0x1c')][_0x6920('0x1d')]){var _0x3e94ee=_0x31966d[0x2];if(!_[_0x6920('0x1e')](_0x3e94ee)){_0x188e0c[_0x6920('0x1f')]=utils[_0x6920('0x20')](_0x3e94ee,this);return rpc[_0x3484fb+_0x6920('0x21')][_0x6920('0x22')](_0x188e0c)[_0x6920('0x23')](function(_0xc6e86b){logger[_0x6920('0xa')](_0x6920('0xb'),_0x21fb21,_0x188e0c['body']);})[_0x6920('0x24')](function(_0x1f8af0){logger[_0x6920('0x25')](_0x6920('0xb'),_0x21fb21,JSON[_0x6920('0x26')](_0x1f8af0));})[_0x6920('0x27')](function(){logger[_0x6920('0xa')](_0x6920('0x28'),_0x21fb21);_0x2aad51[_0x6920('0x29')]();});}else{logger[_0x6920('0xa')](_0x6920('0x2a'),_0x21fb21);_0x2aad51[_0x6920('0x29')]();}}else{var _0x1df372=this;var _0x2dd788=apiai(_0x31966d[0x0],{'language':_0x31966d[0x1]||'en'});return _0x2dd788[_0x6920('0x2b')](this[_0x6920('0x2c')][_0x6920('0x1f')],{'sessionId':md5(this[_0x6920('0x1c')]['id'])})[_0x6920('0x23')](function(_0x258986){_0x1df372['body'][_0x6920('0x2d')]=_0x258986;_0x188e0c['body']=_0x258986[_0x6920('0x2e')]['fulfillment'][_0x6920('0x2f')];_0x188e0c[_0x6920('0x30')]=_0x6920('0x2d');_0x188e0c[_0x6920('0x31')]=JSON['stringify'](_0x258986);return rpc[_0x3484fb+_0x6920('0x21')][_0x6920('0x22')](_0x188e0c)[_0x6920('0x23')](function(_0x1ae78f){logger[_0x6920('0xa')](_0x6920('0xb'),_0x21fb21,_0x188e0c[_0x6920('0x1f')]);if(_0x258986[_0x6920('0x2e')][_0x6920('0x32')][_0x6920('0x33')]){_0x2aad51[_0x6920('0xd')]();}else{_0x2aad51[_0x6920('0x29')]();}})['catch'](function(_0x182f1b){logger['error'](_0x6920('0xb'),_0x21fb21,JSON['stringify'](_0x182f1b));_0x2aad51[_0x6920('0xd')]();});})[_0x6920('0x24')](function(_0x595dfe){logger[_0x6920('0x25')](_0x6920('0xb'),_0x21fb21,_0x595dfe[_0x6920('0x2c')]);_0x2aad51['next']();});}}catch(_0x4a57b0){logger[_0x6920('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x21fb21,JSON['stringify'](_0x4a57b0));_0x2aad51[_0x6920('0x29')]();}};};
\ No newline at end of file
+var _0x2aa3=['created','isEmpty','body','getMustacheRender','then','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','Message','create','endConversation','next','lodash','moment','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId'];(function(_0x4f2894,_0xea7920){var _0x18f54f=function(_0x4970e8){while(--_0x4970e8){_0x4f2894['push'](_0x4f2894['shift']());}};_0x18f54f(++_0xea7920);}(_0x2aa3,0x83));var _0x32aa=function(_0x461f55,_0x23a3f8){_0x461f55=_0x461f55-0x0;var _0x2bd9fa=_0x2aa3[_0x461f55];return _0x2bd9fa;};'use strict';var _=require(_0x32aa('0x0'));var moment=require(_0x32aa('0x1'));var apiai=require(_0x32aa('0x2'));var md5=require(_0x32aa('0x3'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x32aa('0x4'));var rpc={'chatMessage':require(_0x32aa('0x5')),'openchannelMessage':require(_0x32aa('0x6')),'mailMessage':require(_0x32aa('0x7')),'smsMessage':require(_0x32aa('0x8')),'faxMessage':require(_0x32aa('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x32aa('0xa')]=function(_0x112396,_0x3ee18a){return function(_0x20efbe){try{if(!_[_0x32aa('0xb')](this[_0x32aa('0xc')][_0x32aa('0xd')])){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x32aa('0xf'));return _0x20efbe['next']();}var _0x3d61ee={'ContactId':this[_0x32aa('0x10')]['id'],'sentAt':moment()[_0x32aa('0x11')](_0x32aa('0x12')),'direction':'out'};if(this[_0x32aa('0x13')]===_0x32aa('0x14')||this[_0x32aa('0x13')]==='whatsapp'){_0x3d61ee[_0x32aa('0x15')]=this[_0x32aa('0xc')][_0x32aa('0x15')];}var _0x22c07a=this[_0x32aa('0x13')];if(_0x22c07a===_0x32aa('0x16')){_0x3d61ee[_0x32aa('0x17')]=this[_0x32aa('0x18')]['id'];}else{_0x3d61ee[_['upperFirst'](_0x22c07a)+_0x32aa('0x19')]=this[_0x32aa('0x18')]['id'];}_0x3d61ee[_[_0x32aa('0x1a')](_0x22c07a)+_0x32aa('0x1b')]=this[_0x32aa('0xc')]['id'];if(this['interaction'][_0x32aa('0x1c')]){var _0x251fa4=_0x3ee18a[0x2];if(!_[_0x32aa('0x1d')](_0x251fa4)){_0x3d61ee[_0x32aa('0x1e')]=utils[_0x32aa('0x1f')](_0x251fa4,this);return rpc[_0x22c07a+'Message']['create'](_0x3d61ee)[_0x32aa('0x20')](function(_0x34dcaf){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x3d61ee['body']);})[_0x32aa('0x21')](function(_0x148255){logger[_0x32aa('0x22')](_0x32aa('0x23'),_0x112396,JSON[_0x32aa('0x24')](_0x148255));})[_0x32aa('0x25')](function(){logger['info'](_0x32aa('0x26'),_0x112396);_0x20efbe[_0x32aa('0x27')]();});}else{logger[_0x32aa('0xe')](_0x32aa('0x28'),_0x112396);_0x20efbe[_0x32aa('0x27')]();}}else{var _0x90d165=this;var _0x1ce405=apiai(_0x3ee18a[0x0],{'language':_0x3ee18a[0x1]||'en'});return _0x1ce405[_0x32aa('0x29')](this[_0x32aa('0x2a')]['body'],{'sessionId':md5(this[_0x32aa('0xc')]['id'])})['then'](function(_0x6766da){_0x90d165[_0x32aa('0x1e')]['dialogflow']=_0x6766da;_0x3d61ee['body']=_0x6766da[_0x32aa('0x2b')][_0x32aa('0x2c')][_0x32aa('0x2d')];_0x3d61ee[_0x32aa('0x2e')]=_0x32aa('0x2f');_0x3d61ee[_0x32aa('0x30')]=JSON[_0x32aa('0x24')](_0x6766da);return rpc[_0x22c07a+_0x32aa('0x31')][_0x32aa('0x32')](_0x3d61ee)['then'](function(_0x128774){logger[_0x32aa('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x3d61ee[_0x32aa('0x1e')]);if(_0x6766da['result']['metadata'][_0x32aa('0x33')]){_0x20efbe[_0x32aa('0x34')]();}else{_0x20efbe[_0x32aa('0x27')]();}})[_0x32aa('0x21')](function(_0x5903b8){logger[_0x32aa('0x22')](_0x32aa('0x23'),_0x112396,JSON[_0x32aa('0x24')](_0x5903b8));_0x20efbe[_0x32aa('0x34')]();});})[_0x32aa('0x21')](function(_0x44887c){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x112396,_0x44887c[_0x32aa('0x2a')]);_0x20efbe[_0x32aa('0x34')]();});}}catch(_0x136893){logger[_0x32aa('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x112396,JSON['stringify'](_0x136893));_0x20efbe[_0x32aa('0x27')]();}};};
\ No newline at end of file
index 257a3ce..634e026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb695=['routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','create','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','detectIntent','length','dialogflowV2','diagnosticInfo','fields','queryResult','end_conversation','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','providerName','providerResponse','fulfillmentText','push','message','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb695,0x1d6));var _0x5b69=function(_0x2a86cc,_0xc1e7aa){_0x2a86cc=_0x2a86cc-0x0;var _0x583bcc=_0xb695[_0x2a86cc];return _0x583bcc;};'use strict';var _=require(_0x5b69('0x0'));var dialogflow=require(_0x5b69('0x1'));var md5=require(_0x5b69('0x2'));var moment=require(_0x5b69('0x3'));var Promise=require(_0x5b69('0x4'));var logger=require(_0x5b69('0x5'))(_0x5b69('0x6'));var utils=require(_0x5b69('0x7'));var rpc={'chatMessage':require(_0x5b69('0x8')),'openchannelMessage':require(_0x5b69('0x9')),'mailMessage':require(_0x5b69('0xa')),'smsMessage':require(_0x5b69('0xb')),'faxMessage':require(_0x5b69('0xc')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x4d0272,_0x231879,_0x4da47c,_0x4a96b6){return new Promise(function(_0x43f504,_0xac3ad7){var _0x123781=_[_0x5b69('0xd')](_0x4da47c);_0x123781[_0x5b69('0xe')]=_0x4a96b6;return rpc[_0x231879+'Message']['create'](_0x123781)[_0x5b69('0xf')](function(){logger[_0x5b69('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x4d0272,_0x123781[_0x5b69('0xe')]);_0x43f504();})[_0x5b69('0x11')](function(_0x3abfd5){logger['error'](_0x5b69('0x12'),_0x4d0272,JSON[_0x5b69('0x13')](_0x3abfd5));_0xac3ad7(_0x3abfd5);});});}exports[_0x5b69('0x14')]=function(_0x412b33,_0x2d7f39){return function(_0x4b4d0c){try{if(!_[_0x5b69('0x15')](this[_0x5b69('0x16')][_0x5b69('0x17')])){logger[_0x5b69('0x10')](_0x5b69('0x12'),_0x412b33,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4b4d0c[_0x5b69('0x18')]();}var _0x2c04e2={'ContactId':this[_0x5b69('0x19')]['id'],'sentAt':moment()[_0x5b69('0x1a')](_0x5b69('0x1b')),'direction':'out'};if(this[_0x5b69('0x1c')]===_0x5b69('0x1d')||this['channel']==='whatsapp'){_0x2c04e2[_0x5b69('0x1e')]=this[_0x5b69('0x16')]['phone'];}var _0x66e272=this['channel'];if(_0x66e272==='chat'){_0x2c04e2[_0x5b69('0x1f')]=this[_0x5b69('0x20')]['id'];}else{_0x2c04e2[_[_0x5b69('0x21')](_0x66e272)+_0x5b69('0x22')]=this[_0x5b69('0x20')]['id'];}_0x2c04e2[_['upperFirst'](_0x66e272)+_0x5b69('0x23')]=this[_0x5b69('0x16')]['id'];if(this['interaction'][_0x5b69('0x24')]){var _0x4180a2=_0x2d7f39[0x4];if(!_[_0x5b69('0x25')](_0x4180a2)){_0x2c04e2[_0x5b69('0xe')]=utils['getMustacheRender'](_0x4180a2,this);return rpc[_0x66e272+_0x5b69('0x26')][_0x5b69('0x27')](_0x2c04e2)['then'](function(_0x1dd483){logger['info'](_0x5b69('0x12'),_0x412b33,_0x2c04e2['body']);})[_0x5b69('0x11')](function(_0x314853){logger[_0x5b69('0x28')]('[%s][DIALOGFLOWV2]\x20%s',_0x412b33,JSON['stringify'](_0x314853));})[_0x5b69('0x29')](function(){logger['info'](_0x5b69('0x2a'),_0x412b33);_0x4b4d0c['stop']();});}else{logger[_0x5b69('0x10')](_0x5b69('0x2b'),_0x412b33);_0x4b4d0c[_0x5b69('0x2c')]();}}else{var _0x1e9e5c=this;var _0x19dafa=_0x2d7f39[0x2][_0x5b69('0x2d')](/\\n/g,'\x0a');var _0x3f686d={'credentials':{'private_key':_0x19dafa,'client_email':_0x2d7f39[0x1]}};var _0x44b477=new dialogflow[(_0x5b69('0x2e'))](_0x3f686d);var _0x1cc5a4=_0x44b477['sessionPath'](_0x2d7f39[0x0],md5(_0x1e9e5c[_0x5b69('0x16')]['id']));var _0x2fa998={'session':_0x1cc5a4,'queryInput':{'text':{'text':_0x1e9e5c['message'][_0x5b69('0xe')],'languageCode':_0x2d7f39[0x3]||'en'}}};return _0x44b477[_0x5b69('0x2f')](_0x2fa998)[_0x5b69('0xf')](function(_0x411534){if(_0x411534&&_0x411534[_0x5b69('0x30')]){_0x1e9e5c[_0x5b69('0xe')][_0x5b69('0x31')]=_0x411534;var _0x1d592f=_0x411534[0x0];var _0x28207c=_0x1d592f['queryResult'][_0x5b69('0x32')]&&_0x1d592f['queryResult'][_0x5b69('0x32')][_0x5b69('0x33')]?_0x1d592f[_0x5b69('0x34')][_0x5b69('0x32')][_0x5b69('0x33')][_0x5b69('0x35')]['boolValue']:![];_0x1e9e5c['body']['DIALOGFLOWV2_ACTION']=_0x1d592f[_0x5b69('0x34')][_0x5b69('0x36')];_0x1e9e5c[_0x5b69('0xe')][_0x5b69('0x37')]=_0x1d592f[_0x5b69('0x34')]['allRequiredParamsPresent'];_0x1e9e5c['body'][_0x5b69('0x38')]=_0x1d592f['queryResult'][_0x5b69('0x32')]&&_0x1d592f[_0x5b69('0x34')][_0x5b69('0x32')]['fields']?_0x1d592f[_0x5b69('0x34')][_0x5b69('0x32')][_0x5b69('0x33')][_0x5b69('0x35')][_0x5b69('0x39')]:![];_0x1e9e5c[_0x5b69('0xe')][_0x5b69('0x3a')]=_0x1d592f[_0x5b69('0x34')][_0x5b69('0x3b')]['name'];_0x1e9e5c[_0x5b69('0xe')][_0x5b69('0x3c')]=_0x1d592f['queryResult']['intent'][_0x5b69('0x3d')];_0x1e9e5c[_0x5b69('0xe')][_0x5b69('0x3e')]=_0x1d592f[_0x5b69('0x34')]['intent']['isFallback'];_0x1e9e5c[_0x5b69('0xe')]['DIALOGFLOWV2_LANGUAGECODE']=_0x1d592f[_0x5b69('0x34')]['languageCode'];_0x1e9e5c[_0x5b69('0xe')]['DIALOGFLOWV2_QUERYTEXT']=_0x1d592f[_0x5b69('0x34')]['queryText'];_0x1e9e5c[_0x5b69('0xe')]['DIALOGFLOWV2_SCORE']=_0x1d592f[_0x5b69('0x34')]['intentDetectionConfidence'];_0x2c04e2[_0x5b69('0x3f')]=_0x5b69('0x31');_0x2c04e2[_0x5b69('0x40')]=JSON[_0x5b69('0x13')](_0x411534);var _0x3b4a5d=[];for(var _0x42cc54=0x0;_0x42cc54<_0x411534['length'];_0x42cc54++){var _0x44b7a7=_0x411534[_0x42cc54];if(_0x44b7a7&&_0x44b7a7[_0x5b69('0x34')]&&_0x44b7a7[_0x5b69('0x34')][_0x5b69('0x41')]){_0x3b4a5d[_0x5b69('0x42')](createMessage(_0x412b33,_0x66e272,_0x2c04e2,_0x44b7a7[_0x5b69('0x34')][_0x5b69('0x41')]));}}return Promise['all'](_0x3b4a5d)[_0x5b69('0xf')](function(){if(_0x28207c){_0x4b4d0c[_0x5b69('0x18')]();}else{_0x4b4d0c[_0x5b69('0x2c')]();}})[_0x5b69('0x11')](function(_0x1bb453){logger[_0x5b69('0x28')](_0x5b69('0x12'),_0x412b33,JSON[_0x5b69('0x13')](_0x1bb453));_0x4b4d0c[_0x5b69('0x18')]();});}})['catch'](function(_0x33601d){logger['error'](_0x5b69('0x12'),_0x412b33,_0x33601d[_0x5b69('0x43')]);_0x4b4d0c[_0x5b69('0x18')]();});}}catch(_0x4e04b1){logger['error'](_0x5b69('0x12'),_0x412b33,JSON[_0x5b69('0x13')](_0x4e04b1));_0x4b4d0c[_0x5b69('0x2c')]();}};};
\ No newline at end of file
+var _0x53a2=['../../rpc/smsMessage','body','Message','create','catch','error','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','then','info','stringify','finally','stop','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x489070,_0x276d54){var _0x388c8f=function(_0x46fe5c){while(--_0x46fe5c){_0x489070['push'](_0x489070['shift']());}};_0x388c8f(++_0x276d54);}(_0x53a2,0x1a7));var _0x253a=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x53a2[_0x4d07cc];return _0x42de3b;};'use strict';var _=require('lodash');var dialogflow=require(_0x253a('0x0'));var md5=require(_0x253a('0x1'));var moment=require('moment');var Promise=require(_0x253a('0x2'));var logger=require(_0x253a('0x3'))(_0x253a('0x4'));var utils=require(_0x253a('0x5'));var rpc={'chatMessage':require(_0x253a('0x6')),'openchannelMessage':require(_0x253a('0x7')),'mailMessage':require(_0x253a('0x8')),'smsMessage':require(_0x253a('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x694f76,_0x42a9f6,_0x23cd36,_0x4f5fc0){return new Promise(function(_0x4a9991,_0x8ca664){var _0x49cfad=_['clone'](_0x23cd36);_0x49cfad[_0x253a('0xa')]=_0x4f5fc0;return rpc[_0x42a9f6+_0x253a('0xb')][_0x253a('0xc')](_0x49cfad)['then'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x694f76,_0x49cfad[_0x253a('0xa')]);_0x4a9991();})[_0x253a('0xd')](function(_0x2f67da){logger[_0x253a('0xe')](_0x253a('0xf'),_0x694f76,JSON['stringify'](_0x2f67da));_0x8ca664(_0x2f67da);});});}exports[_0x253a('0x10')]=function(_0x44043f,_0x21bac5){return function(_0x492e43){try{if(!_[_0x253a('0x11')](this[_0x253a('0x12')][_0x253a('0x13')])){logger['info'](_0x253a('0xf'),_0x44043f,_0x253a('0x14'));return _0x492e43[_0x253a('0x15')]();}var _0x5f30c1={'ContactId':this[_0x253a('0x16')]['id'],'sentAt':moment()[_0x253a('0x17')](_0x253a('0x18')),'direction':_0x253a('0x19')};if(this[_0x253a('0x1a')]===_0x253a('0x1b')||this[_0x253a('0x1a')]===_0x253a('0x1c')){_0x5f30c1[_0x253a('0x1d')]=this[_0x253a('0x12')]['phone'];}var _0x2e9995=this[_0x253a('0x1a')];if(_0x2e9995===_0x253a('0x1e')){_0x5f30c1[_0x253a('0x1f')]=this[_0x253a('0x20')]['id'];}else{_0x5f30c1[_['upperFirst'](_0x2e9995)+'AccountId']=this[_0x253a('0x20')]['id'];}_0x5f30c1[_[_0x253a('0x21')](_0x2e9995)+_0x253a('0x22')]=this[_0x253a('0x12')]['id'];if(this[_0x253a('0x12')][_0x253a('0x23')]){var _0x4c4729=_0x21bac5[0x4];if(!_[_0x253a('0x24')](_0x4c4729)){_0x5f30c1['body']=utils[_0x253a('0x25')](_0x4c4729,this);return rpc[_0x2e9995+'Message'][_0x253a('0xc')](_0x5f30c1)[_0x253a('0x26')](function(_0x5bc011){logger[_0x253a('0x27')](_0x253a('0xf'),_0x44043f,_0x5f30c1[_0x253a('0xa')]);})[_0x253a('0xd')](function(_0x2a74f4){logger[_0x253a('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x44043f,JSON[_0x253a('0x28')](_0x2a74f4));})[_0x253a('0x29')](function(){logger[_0x253a('0x27')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x44043f);_0x492e43[_0x253a('0x2a')]();});}else{logger[_0x253a('0x27')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x44043f);_0x492e43[_0x253a('0x2a')]();}}else{var _0x2fb6bb=this;var _0x119e72=_0x21bac5[0x2]['replace'](/\\n/g,'\x0a');var _0x46a9e2={'credentials':{'private_key':_0x119e72,'client_email':_0x21bac5[0x1]}};var _0x344e78=new dialogflow[(_0x253a('0x2b'))](_0x46a9e2);var _0x52d3cf=_0x344e78[_0x253a('0x2c')](_0x21bac5[0x0],md5(_0x2fb6bb['interaction']['id']));var _0x573730={'session':_0x52d3cf,'queryInput':{'text':{'text':_0x2fb6bb[_0x253a('0x2d')][_0x253a('0xa')],'languageCode':_0x21bac5[0x3]||'en'}}};return _0x344e78[_0x253a('0x2e')](_0x573730)[_0x253a('0x26')](function(_0x1d146d){if(_0x1d146d&&_0x1d146d['length']){_0x2fb6bb[_0x253a('0xa')][_0x253a('0x2f')]=_0x1d146d;var _0x400de8=_0x1d146d[0x0];var _0x4a9284=_0x400de8[_0x253a('0x30')]['diagnosticInfo']&&_0x400de8[_0x253a('0x30')][_0x253a('0x31')][_0x253a('0x32')]?_0x400de8[_0x253a('0x30')][_0x253a('0x31')][_0x253a('0x32')][_0x253a('0x33')][_0x253a('0x34')]:![];_0x2fb6bb['body']['DIALOGFLOWV2_ACTION']=_0x400de8['queryResult'][_0x253a('0x35')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x36')]=_0x400de8[_0x253a('0x30')][_0x253a('0x37')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x38')]=_0x400de8['queryResult'][_0x253a('0x31')]&&_0x400de8[_0x253a('0x30')]['diagnosticInfo'][_0x253a('0x32')]?_0x400de8[_0x253a('0x30')]['diagnosticInfo']['fields'][_0x253a('0x33')][_0x253a('0x34')]:![];_0x2fb6bb['body']['DIALOGFLOWV2_INTENTNAME']=_0x400de8[_0x253a('0x30')]['intent'][_0x253a('0x39')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x3a')]=_0x400de8[_0x253a('0x30')][_0x253a('0x3b')][_0x253a('0x3c')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x3d')]=_0x400de8[_0x253a('0x30')][_0x253a('0x3b')]['isFallback'];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x3e')]=_0x400de8[_0x253a('0x30')][_0x253a('0x3f')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x40')]=_0x400de8[_0x253a('0x30')][_0x253a('0x41')];_0x2fb6bb[_0x253a('0xa')][_0x253a('0x42')]=_0x400de8[_0x253a('0x30')][_0x253a('0x43')];_0x5f30c1[_0x253a('0x44')]=_0x253a('0x2f');_0x5f30c1[_0x253a('0x45')]=JSON[_0x253a('0x28')](_0x1d146d);var _0x2dc11a=[];for(var _0x52d95f=0x0;_0x52d95f<_0x1d146d[_0x253a('0x46')];_0x52d95f++){var _0x4cf422=_0x1d146d[_0x52d95f];if(_0x4cf422&&_0x4cf422[_0x253a('0x30')]&&_0x4cf422[_0x253a('0x30')][_0x253a('0x47')]){_0x2dc11a['push'](createMessage(_0x44043f,_0x2e9995,_0x5f30c1,_0x4cf422['queryResult']['fulfillmentText']));}}return Promise['all'](_0x2dc11a)[_0x253a('0x26')](function(){if(_0x4a9284){_0x492e43['next']();}else{_0x492e43[_0x253a('0x2a')]();}})[_0x253a('0xd')](function(_0x3c978b){logger[_0x253a('0xe')](_0x253a('0xf'),_0x44043f,JSON[_0x253a('0x28')](_0x3c978b));_0x492e43[_0x253a('0x15')]();});}})[_0x253a('0xd')](function(_0x1bcc6b){logger[_0x253a('0xe')](_0x253a('0xf'),_0x44043f,_0x1bcc6b[_0x253a('0x2d')]);_0x492e43[_0x253a('0x15')]();});}}catch(_0xd8d092){logger[_0x253a('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0x44043f,JSON['stringify'](_0xd8d092));_0x492e43[_0x253a('0x2a')]();}};};
\ No newline at end of file
index aae90b2..25943e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f80=['html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','error','map','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','validate','lodash'];(function(_0x29a947,_0x1a7474){var _0x416a01=function(_0x461a1b){while(--_0x461a1b){_0x29a947['push'](_0x29a947['shift']());}};_0x416a01(++_0x1a7474);}(_0x3f80,0x132));var _0x03f8=function(_0x349d6e,_0x398f26){_0x349d6e=_0x349d6e-0x0;var _0x1dace5=_0x3f80[_0x349d6e];return _0x1dace5;};'use strict';var schema=require(_0x03f8('0x0'));var _=require(_0x03f8('0x1'));var htmlToText=require(_0x03f8('0x2'));var utils=require(_0x03f8('0x3'));var logger=require('../../../../config/logger')(_0x03f8('0x4'));var gotoif=schema({'condition':{'type':_0x03f8('0x5'),'required':!![],'message':_0x03f8('0x6')},'priorityTrue':{'type':'number','message':_0x03f8('0x7')},'priorityFalse':{'type':_0x03f8('0x8'),'message':_0x03f8('0x9')}});exports['consequence']=function(_0x5d0d77,_0x3aba32){return function(_0x3cd488){try{var _0xd1bf07={'condition':htmlToText[_0x03f8('0xa')](utils[_0x03f8('0xb')](_0x3aba32[0x0],this),{'wordwrap':![]})[_0x03f8('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3aba32[0x1],'priorityFalse':_0x3aba32[0x2]};var _0x42efc8=gotoif[_0x03f8('0x0')](_0xd1bf07,{'typecast':!![]});if(_0x42efc8[_0x03f8('0xd')]){logger[_0x03f8('0xe')]('[%s][GOTOIF]\x20%s',_0x5d0d77,_[_0x03f8('0xf')](_0x42efc8,'message')['join'](',\x20'));_0x3cd488['stop']();}else{try{var _0x243c76=eval('('+_0xd1bf07[_0x03f8('0x10')]+')');var _0x7cbbba=_0x243c76?_0xd1bf07[_0x03f8('0x11')]:_0xd1bf07[_0x03f8('0x12')];logger[_0x03f8('0x13')](_0x03f8('0x14'),_0x5d0d77,_0xd1bf07['condition'],_0x243c76,_0x7cbbba||'next');if(_0x7cbbba){var _0x24b970=_[_0x03f8('0x15')](_0x3cd488[_0x03f8('0x16')](),{'p':_0x7cbbba});if(_0x24b970>=0x0){logger[_0x03f8('0x13')](_0x03f8('0x17'),_0x5d0d77,_0x7cbbba||_0x03f8('0x18'),_0x24b970);_0x3cd488[_0x03f8('0x18')](_0x24b970);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5d0d77,_0x7cbbba||_0x03f8('0x18'));_0x3cd488[_0x03f8('0x19')]();}}else{_0x3cd488['next']();}}catch(_0x5a9bd6){logger['error'](_0x03f8('0x1a'),_0x5d0d77,_0x5a9bd6['message']);_0x3cd488[_0x03f8('0x19')]();}}}catch(_0x47bd7e){logger['error'](_0x03f8('0x1b'),_0x5d0d77,JSON['stringify'](_0x47bd7e));_0x3cd488['stop']();}};};
\ No newline at end of file
+var _0x9313=['[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityFalse','info','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','error'];(function(_0x4ed080,_0x54974a){var _0x21d57f=function(_0x36aa7c){while(--_0x36aa7c){_0x4ed080['push'](_0x4ed080['shift']());}};_0x21d57f(++_0x54974a);}(_0x9313,0x143));var _0x3931=function(_0x98fb40,_0x37f8d0){_0x98fb40=_0x98fb40-0x0;var _0x15b43a=_0x9313[_0x98fb40];return _0x15b43a;};'use strict';var schema=require(_0x3931('0x0'));var _=require(_0x3931('0x1'));var htmlToText=require(_0x3931('0x2'));var utils=require(_0x3931('0x3'));var logger=require(_0x3931('0x4'))(_0x3931('0x5'));var gotoif=schema({'condition':{'type':_0x3931('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x3931('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x3931('0x8')}});exports[_0x3931('0x9')]=function(_0x460021,_0x5b92d9){return function(_0x4dfd92){try{var _0x2d27f5={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x5b92d9[0x0],this),{'wordwrap':![]})[_0x3931('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5b92d9[0x1],'priorityFalse':_0x5b92d9[0x2]};var _0xc8a8a3=gotoif['validate'](_0x2d27f5,{'typecast':!![]});if(_0xc8a8a3[_0x3931('0xb')]){logger[_0x3931('0xc')](_0x3931('0xd'),_0x460021,_[_0x3931('0xe')](_0xc8a8a3,_0x3931('0xf'))[_0x3931('0x10')](',\x20'));_0x4dfd92[_0x3931('0x11')]();}else{try{var _0x18fc22=eval('('+_0x2d27f5[_0x3931('0x12')]+')');var _0x2e504d=_0x18fc22?_0x2d27f5['priorityTrue']:_0x2d27f5[_0x3931('0x13')];logger[_0x3931('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x460021,_0x2d27f5[_0x3931('0x12')],_0x18fc22,_0x2e504d||'next');if(_0x2e504d){var _0x34c72b=_[_0x3931('0x15')](_0x4dfd92[_0x3931('0x16')](),{'p':_0x2e504d});if(_0x34c72b>=0x0){logger[_0x3931('0x14')](_0x3931('0x17'),_0x460021,_0x2e504d||_0x3931('0x18'),_0x34c72b);_0x4dfd92['next'](_0x34c72b);}else{logger['info'](_0x3931('0x19'),_0x460021,_0x2e504d||'next');_0x4dfd92[_0x3931('0x11')]();}}else{_0x4dfd92[_0x3931('0x18')]();}}catch(_0x56094f){logger[_0x3931('0xc')](_0x3931('0x1a'),_0x460021,_0x56094f[_0x3931('0xf')]);_0x4dfd92[_0x3931('0x11')]();}}}catch(_0x52a161){logger[_0x3931('0xc')]('[%s][GOTOIF]\x20%s',_0x460021,JSON[_0x3931('0x1b')](_0x52a161));_0x4dfd92['stop']();}};};
\ No newline at end of file
index 7d6f52e..d61f344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a13=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x275e9d,_0x521516){var _0x1dcd60=function(_0x13bce6){while(--_0x13bce6){_0x275e9d['push'](_0x275e9d['shift']());}};_0x1dcd60(++_0x521516);}(_0x9a13,0xf5));var _0x39a1=function(_0x8ce468,_0x2b3ddc){_0x8ce468=_0x8ce468-0x0;var _0x24f515=_0x9a13[_0x8ce468];return _0x24f515;};'use strict';var schema=require('validate');var _=require(_0x39a1('0x0'));var logger=require(_0x39a1('0x1'))(_0x39a1('0x2'));var gotop=schema({'priority':{'type':_0x39a1('0x3'),'required':!![],'message':_0x39a1('0x4')}});exports[_0x39a1('0x5')]=function(_0x117903,_0x486b09){return function(_0x5dba93){try{var _0x335353={'priority':_0x486b09[0x0]};var _0x449d50=gotop[_0x39a1('0x6')](_0x335353,{'typecast':!![]});if(_0x449d50[_0x39a1('0x7')]){logger[_0x39a1('0x8')](_0x39a1('0x9'),_0x117903,_[_0x39a1('0xa')](_0x449d50,_0x39a1('0xb'))[_0x39a1('0xc')](',\x20'));_0x5dba93[_0x39a1('0xd')]();}else{logger[_0x39a1('0xe')](_0x39a1('0xf'),_0x117903,_0x335353[_0x39a1('0x10')]);if(_0x335353[_0x39a1('0x10')]){var _0x4079f6=_['findIndex'](_0x5dba93[_0x39a1('0x11')](),{'p':_0x335353[_0x39a1('0x10')]});if(_0x4079f6>=0x0){logger[_0x39a1('0xe')](_0x39a1('0x12'),_0x117903,_0x335353['priority']||_0x39a1('0x13'),_0x4079f6);_0x5dba93['next'](_0x4079f6);}else{logger[_0x39a1('0xe')](_0x39a1('0x14'),_0x117903,_0x335353[_0x39a1('0x10')]||_0x39a1('0x13'));_0x5dba93[_0x39a1('0xd')]();}}else{_0x5dba93[_0x39a1('0x13')]();}}}catch(_0x303d0d){logger[_0x39a1('0x8')](_0x39a1('0x9'),_0x117903,JSON[_0x39a1('0x15')](_0x303d0d));_0x5dba93[_0x39a1('0xd')]();}};};
\ No newline at end of file
+var _0x4856=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','error','[%s][GOTOP]\x20%s','message'];(function(_0x2ec0ea,_0x27ebc8){var _0x27f94e=function(_0x15db14){while(--_0x15db14){_0x2ec0ea['push'](_0x2ec0ea['shift']());}};_0x27f94e(++_0x27ebc8);}(_0x4856,0x1a2));var _0x6485=function(_0x2ed502,_0x3b7fab){_0x2ed502=_0x2ed502-0x0;var _0x191886=_0x4856[_0x2ed502];return _0x191886;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x6485('0x0'))(_0x6485('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x6485('0x2')}});exports['consequence']=function(_0x43af18,_0x36ac0e){return function(_0x1d7570){try{var _0x1737d9={'priority':_0x36ac0e[0x0]};var _0x21c8f4=gotop[_0x6485('0x3')](_0x1737d9,{'typecast':!![]});if(_0x21c8f4['length']){logger[_0x6485('0x4')](_0x6485('0x5'),_0x43af18,_['map'](_0x21c8f4,_0x6485('0x6'))['join'](',\x20'));_0x1d7570[_0x6485('0x7')]();}else{logger[_0x6485('0x8')](_0x6485('0x9'),_0x43af18,_0x1737d9[_0x6485('0xa')]);if(_0x1737d9['priority']){var _0x2c3271=_[_0x6485('0xb')](_0x1d7570[_0x6485('0xc')](),{'p':_0x1737d9[_0x6485('0xa')]});if(_0x2c3271>=0x0){logger['info'](_0x6485('0xd'),_0x43af18,_0x1737d9[_0x6485('0xa')]||_0x6485('0xe'),_0x2c3271);_0x1d7570[_0x6485('0xe')](_0x2c3271);}else{logger[_0x6485('0x8')](_0x6485('0xf'),_0x43af18,_0x1737d9['priority']||'next');_0x1d7570['stop']();}}else{_0x1d7570[_0x6485('0xe')]();}}}catch(_0x15686b){logger[_0x6485('0x4')]('[%s][GOTOP]\x20%s',_0x43af18,JSON[_0x6485('0x10')](_0x15686b));_0x1d7570['stop']();}};};
\ No newline at end of file
index a0e657d..b1259c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x279e=['upperFirst','AccountId','InteractionId','Message','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','chat','ChatWebsiteId','account'];(function(_0x11d9a6,_0x353ada){var _0x2b861a=function(_0x4a68ca){while(--_0x4a68ca){_0x11d9a6['push'](_0x11d9a6['shift']());}};_0x2b861a(++_0x353ada);}(_0x279e,0xdc));var _0xe279=function(_0x4136fc,_0xfa82d0){_0x4136fc=_0x4136fc-0x0;var _0x2c8655=_0x279e[_0x4136fc];return _0x2c8655;};'use strict';var _=require(_0xe279('0x0'));var utils=require(_0xe279('0x1'));var logger=require(_0xe279('0x2'))(_0xe279('0x3'));var rpc={'chatMessage':require(_0xe279('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe279('0x5')),'smsMessage':require(_0xe279('0x6')),'faxMessage':require(_0xe279('0x7')),'whatsappMessage':require(_0xe279('0x8'))};exports['consequence']=function(_0x33b7cf,_0x3d1aff){return function(_0x41e535){try{var _0x4ed2e0={'body':utils['getMustacheRender'](_0x3d1aff[0x0],this),'ContactId':this[_0xe279('0x9')]['id']};if(this[_0xe279('0xa')]===_0xe279('0xb')){_0x4ed2e0[_0xe279('0xc')]=this[_0xe279('0xd')]['id'];}else{_0x4ed2e0[_[_0xe279('0xe')](this[_0xe279('0xa')])+_0xe279('0xf')]=this[_0xe279('0xd')]['id'];}_0x4ed2e0[_[_0xe279('0xe')](this[_0xe279('0xa')])+_0xe279('0x10')]=this['interaction']['id'];if(rpc[this[_0xe279('0xa')]+'Message']){return rpc[this[_0xe279('0xa')]+_0xe279('0x11')]['create'](_0x4ed2e0)[_0xe279('0x12')](function(_0x1523b7){logger[_0xe279('0x13')](_0xe279('0x14'),_0x33b7cf,_0x4ed2e0[_0xe279('0x15')]);_0x41e535[_0xe279('0x16')]();})['catch'](function(_0x351142){logger[_0xe279('0x17')](_0xe279('0x14'),_0x33b7cf,JSON['stringify'](_0x351142));_0x41e535['stop']();});}}catch(_0x512ac5){logger['error']('[%s][MESSAGE]\x20%s',_0x33b7cf,JSON[_0xe279('0x18')](_0x512ac5));_0x41e535[_0xe279('0x19')]();}};};
\ No newline at end of file
+var _0x3abf=['account','upperFirst','AccountId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat'];(function(_0x4e75c5,_0x5eeb93){var _0x872171=function(_0x137973){while(--_0x137973){_0x4e75c5['push'](_0x4e75c5['shift']());}};_0x872171(++_0x5eeb93);}(_0x3abf,0x16c));var _0xf3ab=function(_0xe121a8,_0x4b015a){_0xe121a8=_0xe121a8-0x0;var _0x45aa58=_0x3abf[_0xe121a8];return _0x45aa58;};'use strict';var _=require(_0xf3ab('0x0'));var utils=require(_0xf3ab('0x1'));var logger=require(_0xf3ab('0x2'))(_0xf3ab('0x3'));var rpc={'chatMessage':require(_0xf3ab('0x4')),'openchannelMessage':require(_0xf3ab('0x5')),'mailMessage':require(_0xf3ab('0x6')),'smsMessage':require(_0xf3ab('0x7')),'faxMessage':require(_0xf3ab('0x8')),'whatsappMessage':require(_0xf3ab('0x9'))};exports[_0xf3ab('0xa')]=function(_0x16f687,_0x87f297){return function(_0x25088c){try{var _0x261a28={'body':utils['getMustacheRender'](_0x87f297[0x0],this),'ContactId':this[_0xf3ab('0xb')]['id']};if(this[_0xf3ab('0xc')]===_0xf3ab('0xd')){_0x261a28['ChatWebsiteId']=this[_0xf3ab('0xe')]['id'];}else{_0x261a28[_[_0xf3ab('0xf')](this[_0xf3ab('0xc')])+_0xf3ab('0x10')]=this[_0xf3ab('0xe')]['id'];}_0x261a28[_[_0xf3ab('0xf')](this[_0xf3ab('0xc')])+'InteractionId']=this[_0xf3ab('0x11')]['id'];if(rpc[this['channel']+_0xf3ab('0x12')]){return rpc[this[_0xf3ab('0xc')]+'Message'][_0xf3ab('0x13')](_0x261a28)[_0xf3ab('0x14')](function(_0x223c47){logger[_0xf3ab('0x15')](_0xf3ab('0x16'),_0x16f687,_0x261a28['body']);_0x25088c[_0xf3ab('0x17')]();})['catch'](function(_0x2d28d5){logger[_0xf3ab('0x18')]('[%s][MESSAGE]\x20%s',_0x16f687,JSON['stringify'](_0x2d28d5));_0x25088c[_0xf3ab('0x19')]();});}}catch(_0x3ecf23){logger[_0xf3ab('0x18')](_0xf3ab('0x16'),_0x16f687,JSON[_0xf3ab('0x1a')](_0x3ecf23));_0x25088c['stop']();}};};
\ No newline at end of file
index 29ae9d0..64f8f52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7408=['stop','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stringify'];(function(_0x2351cd,_0x2ca8bd){var _0x55e445=function(_0x10beb8){while(--_0x10beb8){_0x2351cd['push'](_0x2351cd['shift']());}};_0x55e445(++_0x2ca8bd);}(_0x7408,0x158));var _0x8740=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x7408[_0x545bed];return _0x16c79c;};'use strict';var utils=require('./utils');var logger=require(_0x8740('0x0'))('routing');exports[_0x8740('0x1')]=function(_0xf8111b,_0x2ba4d7){return function(_0x372f51){try{logger[_0x8740('0x2')](_0x8740('0x3'),_0xf8111b,utils[_0x8740('0x4')](_0x2ba4d7[0x0],this));_0x372f51['next']();}catch(_0x2fbd54){logger['error']('[%s][NOOP]\x20%s',_0xf8111b,JSON[_0x8740('0x5')](_0x2fbd54));_0x372f51[_0x8740('0x6')]();}};};
\ No newline at end of file
+var _0x737d=['next','error','stop','../../../../config/logger','routing','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x1e4624,_0x58e8d6){var _0x372983=function(_0x1aa5c0){while(--_0x1aa5c0){_0x1e4624['push'](_0x1e4624['shift']());}};_0x372983(++_0x58e8d6);}(_0x737d,0xea));var _0xd737=function(_0x2b03cd,_0x12cb04){_0x2b03cd=_0x2b03cd-0x0;var _0x3d3a8e=_0x737d[_0x2b03cd];return _0x3d3a8e;};'use strict';var utils=require('./utils');var logger=require(_0xd737('0x0'))(_0xd737('0x1'));exports['consequence']=function(_0x346c18,_0x1556b0){return function(_0x531c95){try{logger['info'](_0xd737('0x2'),_0x346c18,utils[_0xd737('0x3')](_0x1556b0[0x0],this));_0x531c95[_0xd737('0x4')]();}catch(_0x201e9b){logger[_0xd737('0x5')](_0xd737('0x2'),_0x346c18,JSON['stringify'](_0x201e9b));_0x531c95[_0xd737('0x6')]();}};};
\ No newline at end of file
index ebbc2bd..d7c5edd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ad=['createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','emit','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','WebsiteId','name','QueueReport','create','catch','error','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','info','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','Queues'];(function(_0x3152bd,_0x2852e6){var _0x11e4f5=function(_0x150547){while(--_0x150547){_0x3152bd['push'](_0x3152bd['shift']());}};_0x11e4f5(++_0x2852e6);}(_0x69ad,0xed));var _0xd69a=function(_0x232898,_0xb8a157){_0x232898=_0x232898-0x0;var _0x2d49bf=_0x69ad[_0x232898];return _0x2d49bf;};'use strict';var schema=require(_0xd69a('0x0'));var _=require('lodash');var util=require(_0xd69a('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xd69a('0x2'));var Redis=require(_0xd69a('0x3'));var config=require(_0xd69a('0x4'));var logger=require(_0xd69a('0x5'))(_0xd69a('0x6'));var strategy=require(_0xd69a('0x7'));config[_0xd69a('0x8')]=_[_0xd69a('0x9')](config[_0xd69a('0x8')],{'host':_0xd69a('0xa'),'port':0x18eb});var io=require(_0xd69a('0xb'))(new Redis(config[_0xd69a('0x8')]));var attributes=['id',_0xd69a('0xc'),_0xd69a('0xd'),_0xd69a('0xe'),'from',_0xd69a('0xf')];function emit(_0x4d7b94,_0x462793,_0x5844ef){io['to'](_0x4d7b94)[_0xd69a('0x10')](_0x462793,_0x5844ef);}function emitChannelQueueInteraction(_0x5ac649,_0x28e786,_0x87c281,_0xfe59e3,_0x367972,_0x5ec31c,_0x4dbc26,_0x3d3b98){var _0x19110e=_['clone'](_0x87c281);_0x19110e['queue_id']=_0x3d3b98;_0x19110e[_0xd69a('0xe')]=_0x28e786;_0x19110e[_0xd69a('0xd')]=_0xfe59e3;_0x19110e['id']=_0x367972;if(_0x5ec31c){_0x4dbc26[util[_0xd69a('0x11')](_0xd69a('0x12'),_0x5ac649)][_0x367972]=_[_0xd69a('0x13')](_0x19110e,attributes);}else{delete _0x4dbc26[util[_0xd69a('0x11')](_0xd69a('0x12'),_0x5ac649)][_0x367972];}emit(util[_0xd69a('0x11')](_0xd69a('0x14'),_0x5ac649,_0x28e786),util[_0xd69a('0x11')]('%s_queue_waiting_interaction:%s',_0x5ac649,_0x5ec31c?_0xd69a('0x15'):'remove'),_[_0xd69a('0x13')](_0x19110e,attributes));}var rpc={'openchannelQueueReport':require(_0xd69a('0x16')),'mailQueueReport':require(_0xd69a('0x17')),'chatQueueReport':require(_0xd69a('0x18')),'smsQueueReport':require(_0xd69a('0x19')),'faxQueueReport':require(_0xd69a('0x1a')),'whatsappQueueReport':require(_0xd69a('0x1b'))};var queue=schema({'name':{'type':_0xd69a('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xd69a('0x1d')}});function startRouting(_0x6c2aa4,_0x552100,_0xfc0e73,_0x114119){if(_0x6c2aa4&&_0x552100&&_0xfc0e73){_0x552100[_0xd69a('0x1e')]+=0x1;var _0xdd9652={'uniqueid':_0x6c2aa4,'from':_0xfc0e73['body']?_0xfc0e73[_0xd69a('0x1f')][_0xd69a('0x20')]:'','joinAt':moment()['format'](_0xd69a('0x21')),'ContactId':_0xfc0e73[_0xd69a('0x22')]?_0xfc0e73[_0xd69a('0x22')]['id']:null,'ListId':_0xfc0e73[_0xd69a('0x23')]?_0xfc0e73[_0xd69a('0x23')]['id']:null};_0xdd9652[_[_0xd69a('0x24')](_0xfc0e73[_0xd69a('0x25')])+_0xd69a('0x26')]=_0x552100['id']||null;_0xdd9652[_['upperFirst'](_0xfc0e73['channel'])+'InteractionId']=_0xfc0e73[_0xd69a('0x27')]?_0xfc0e73['interaction']['id']:null;_0xdd9652[_[_0xd69a('0x24')](_0xfc0e73[_0xd69a('0x25')])+_0xd69a('0x28')]=_0xfc0e73[_0xd69a('0x29')]?_0xfc0e73['message']['id']:null;_0xdd9652[_['upperFirst'](_0xfc0e73[_0xd69a('0x25')])+(_0xfc0e73[_0xd69a('0x25')]!==_0xd69a('0x2a')?'AccountId':_0xd69a('0x2b'))]=_0xfc0e73['account']?_0xfc0e73[_0xd69a('0xd')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x6c2aa4,_0x552100[_0xd69a('0x2c')]));emitChannelQueueInteraction(_0xfc0e73[_0xd69a('0x25')],_0x552100[_0xd69a('0x2c')],_0xdd9652,_0xfc0e73['account'][_0xd69a('0x2c')],_0xfc0e73[_0xd69a('0x29')]['id'],!![],_0x114119,_0x552100['id']);if(rpc[_0xfc0e73[_0xd69a('0x25')]+_0xd69a('0x2d')]){return rpc[_0xfc0e73[_0xd69a('0x25')]+'QueueReport'][_0xd69a('0x2e')](_0xdd9652)[_0xd69a('0x2f')](function(_0x3c2dcf){logger[_0xd69a('0x30')](_0xd69a('0x31'));});}}}function stopRouting(_0x5f4704,_0x57846f,_0x5498be,_0x21a7af){if(_0x5f4704&&_0x57846f){_0x57846f[_0xd69a('0x1e')]-=0x1;var _0x5eb099={'leaveAt':moment()[_0xd69a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xd69a('0x11')](_0xd69a('0x21')),'reason':'accepted'};logger['info'](util[_0xd69a('0x11')](_0xd69a('0x32'),_0x5f4704,_0x57846f[_0xd69a('0x2c')]));emitChannelQueueInteraction(_0x5498be[_0xd69a('0x25')],_0x57846f['name'],_0x5498be[_0xd69a('0x1f')],_0x5498be[_0xd69a('0xd')][_0xd69a('0x2c')],_0x5498be[_0xd69a('0x29')]['id'],![],_0x21a7af,_0x57846f['id']);if(rpc[_0x5498be[_0xd69a('0x25')]+_0xd69a('0x2d')]){return rpc[_0x5498be[_0xd69a('0x25')]+_0xd69a('0x2d')][_0xd69a('0x33')](_0x5f4704,_0x5eb099)['catch'](function(_0x307501){logger[_0xd69a('0x30')](_0xd69a('0x34'));});}}}function endRouting(_0x396622,_0x282f64,_0x5ed833,_0x41b643){if(_0x396622&&_0x282f64){_0x282f64[_0xd69a('0x1e')]-=0x1;var _0xf907c5={'leaveAt':moment()[_0xd69a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xd69a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xd69a('0x35')};logger[_0xd69a('0x36')](util[_0xd69a('0x11')](_0xd69a('0x37'),_0x396622,_0x282f64[_0xd69a('0x2c')]));emitChannelQueueInteraction(_0x5ed833[_0xd69a('0x25')],_0x282f64[_0xd69a('0x2c')],_0x5ed833['body'],_0x5ed833[_0xd69a('0xd')][_0xd69a('0x2c')],_0x5ed833['message']['id'],![],_0x41b643);if(rpc[_0x5ed833['channel']+_0xd69a('0x2d')]){return rpc[_0x5ed833[_0xd69a('0x25')]+'QueueReport'][_0xd69a('0x33')](_0x396622,_0xf907c5)['catch'](function(_0xa42a4a){logger['error'](_0xd69a('0x34'));});}}}function handleFindQueue(_0x169caf){return function(_0x448dfd){return _0x448dfd[_0xd69a('0x2c')][_0xd69a('0x38')]()===_0x169caf[_0xd69a('0x38')]();};}exports['consequence']=function(_0x34902f,_0x1f2c7b,_0x3a4b50,_0x31e6de){return function(_0x3dc5ea){try{var _0x1280eb={'name':_0x1f2c7b[0x0],'timeout':_0x1f2c7b[0x1]};var _0x278b07=queue[_0xd69a('0x0')](_0x1280eb,{'typecast':!![]});if(_0x278b07[_0xd69a('0x39')]){logger[_0xd69a('0x30')](_0xd69a('0x3a'),_0x34902f,_[_0xd69a('0x3b')](_0x278b07,_0xd69a('0x29'))[_0xd69a('0x3c')](',\x20'));_0x3dc5ea[_0xd69a('0x3d')]();}else{var _0x2291a3=_['find'](_0x3a4b50[_0x31e6de[_0xd69a('0x25')]+_0xd69a('0x3e')],handleFindQueue(_0x1280eb[_0xd69a('0x2c')]));if(_0x2291a3){startRouting(_0x34902f,_0x2291a3,_0x31e6de,_0x3a4b50);var _0x57218c=(_0x2291a3[_0xd69a('0x35')]||0xa)*0x3e8;var _0x3315f8=(_0x1280eb[_0xd69a('0x35')]||0x14)*0x3e8;var _0x3b458e,_0x521357;if(_0x57218c>_0x3315f8){_0x3315f8=_0x57218c;}var _0x4092dc=seqqueue[_0xd69a('0x3f')](_0x57218c);_0x4092dc['id']=_0x34902f;_0x4092dc[_0xd69a('0x40')]=_0x57218c;_0x4092dc['qtimeout']=_0x3315f8;_0x4092dc['channel']=_0x31e6de[_0xd69a('0x25')];_0x3a4b50['rules'][_0x34902f]['on'](_0xd69a('0x41'),function(){logger[_0xd69a('0x36')](_0xd69a('0x42'),_0x34902f);stopRouting(_0x34902f,_0x2291a3,_0x31e6de,_0x3a4b50);clearTimeout(_0x3b458e);_0x3b458e=undefined;_0x4092dc['close'](!![]);if(_0x3a4b50[_0xd69a('0x43')][_0x34902f]){delete _0x3a4b50[_0xd69a('0x43')][_0x34902f];}_0x3dc5ea[_0xd69a('0x3d')]();});_0x3a4b50['rules'][_0x34902f]['on'](_0xd69a('0x44'),function(){if(_0x3a4b50['rules'][_0x34902f]){delete _0x3a4b50[_0xd69a('0x43')][_0x34902f];}});_0x3b458e=setTimeout(function(){logger[_0xd69a('0x36')](_0xd69a('0x45'),_0x34902f);endRouting(_0x34902f,_0x2291a3,_0x31e6de,_0x3a4b50);clearTimeout(_0x3b458e);_0x4092dc['close'](!![]);_0x3dc5ea['next']();},_0x3315f8);switch(_0x2291a3[_0xd69a('0x46')]){case'rrmemory':strategy[_0xd69a('0x47')](_0x4092dc,_0x2291a3,_0x3a4b50,_0x31e6de);break;default:strategy[_0xd69a('0x48')](_0x4092dc,_0x2291a3,_0x3a4b50,_0x31e6de);}}else{logger[_0xd69a('0x30')](_0xd69a('0x49'),_0x34902f,_0x1280eb[_0xd69a('0x2c')]);_0x3dc5ea[_0xd69a('0x3d')]();}}}catch(_0x2a85d8){console['log'](_0x2a85d8);logger['error'](_0xd69a('0x3a'),_0x34902f,_0x2a85d8[_0xd69a('0x4a')]);_0x3dc5ea[_0xd69a('0x3d')]();}};};
\ No newline at end of file
+var _0xecac=['waiting','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','timeout','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','update','update\x20queue\x20report'];(function(_0x3a7a77,_0x51995e){var _0x569e5a=function(_0x426305){while(--_0x426305){_0x3a7a77['push'](_0x3a7a77['shift']());}};_0x569e5a(++_0x51995e);}(_0xecac,0x100));var _0xceca=function(_0x5f92a5,_0x35a37e){_0x5f92a5=_0x5f92a5-0x0;var _0x3bdc69=_0xecac[_0x5f92a5];return _0x3bdc69;};'use strict';var schema=require(_0xceca('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xceca('0x1'));var Redis=require(_0xceca('0x2'));var config=require('../../../../config/environment');var logger=require(_0xceca('0x3'))(_0xceca('0x4'));var strategy=require(_0xceca('0x5'));config['redis']=_['defaults'](config[_0xceca('0x6')],{'host':_0xceca('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xceca('0x8'),_0xceca('0x9'),_0xceca('0xa'),_0xceca('0xb'),_0xceca('0xc')];function emit(_0x5b4c73,_0x1ea536,_0x2bf5ea){io['to'](_0x5b4c73)[_0xceca('0xd')](_0x1ea536,_0x2bf5ea);}function emitChannelQueueInteraction(_0x1429fd,_0x5b5132,_0x6edf03,_0x5b6247,_0xbc5085,_0x4bf0e7,_0x452a7c,_0x5b5513){var _0x2ec4e4=_[_0xceca('0xe')](_0x6edf03);_0x2ec4e4[_0xceca('0x8')]=_0x5b5513;_0x2ec4e4[_0xceca('0xa')]=_0x5b5132;_0x2ec4e4['account']=_0x5b6247;_0x2ec4e4['id']=_0xbc5085;if(_0x4bf0e7){_0x452a7c[util[_0xceca('0xf')]('%sQueuesWaitingInteractions',_0x1429fd)][_0xbc5085]=_['pick'](_0x2ec4e4,attributes);}else{delete _0x452a7c[util[_0xceca('0xf')](_0xceca('0x10'),_0x1429fd)][_0xbc5085];}emit(util['format'](_0xceca('0x11'),_0x1429fd,_0x5b5132),util['format'](_0xceca('0x12'),_0x1429fd,_0x4bf0e7?_0xceca('0x13'):'remove'),_[_0xceca('0x14')](_0x2ec4e4,attributes));}var rpc={'openchannelQueueReport':require(_0xceca('0x15')),'mailQueueReport':require(_0xceca('0x16')),'chatQueueReport':require(_0xceca('0x17')),'smsQueueReport':require(_0xceca('0x18')),'faxQueueReport':require(_0xceca('0x19')),'whatsappQueueReport':require(_0xceca('0x1a'))};var queue=schema({'name':{'type':_0xceca('0x1b'),'required':!![],'message':_0xceca('0x1c')},'timeout':{'type':_0xceca('0x1d'),'message':_0xceca('0x1e')}});function startRouting(_0x41e1b1,_0x41aa4e,_0x4c6cf7,_0x25d010){if(_0x41e1b1&&_0x41aa4e&&_0x4c6cf7){_0x41aa4e['waiting']+=0x1;var _0x3a5e2e={'uniqueid':_0x41e1b1,'from':_0x4c6cf7['body']?_0x4c6cf7[_0xceca('0x1f')][_0xceca('0xb')]:'','joinAt':moment()[_0xceca('0xf')](_0xceca('0x20')),'ContactId':_0x4c6cf7['contact']?_0x4c6cf7[_0xceca('0x21')]['id']:null,'ListId':_0x4c6cf7['list']?_0x4c6cf7[_0xceca('0x22')]['id']:null};_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7['channel'])+'QueueId']=_0x41aa4e['id']||null;_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7[_0xceca('0x24')])+'InteractionId']=_0x4c6cf7[_0xceca('0x25')]?_0x4c6cf7[_0xceca('0x25')]['id']:null;_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7[_0xceca('0x24')])+_0xceca('0x26')]=_0x4c6cf7[_0xceca('0x27')]?_0x4c6cf7['message']['id']:null;_0x3a5e2e[_[_0xceca('0x23')](_0x4c6cf7[_0xceca('0x24')])+(_0x4c6cf7['channel']!=='chat'?_0xceca('0x28'):_0xceca('0x29'))]=_0x4c6cf7[_0xceca('0x9')]?_0x4c6cf7[_0xceca('0x9')]['id']:null;logger[_0xceca('0x2a')](util[_0xceca('0xf')](_0xceca('0x2b'),_0x41e1b1,_0x41aa4e[_0xceca('0x2c')]));emitChannelQueueInteraction(_0x4c6cf7[_0xceca('0x24')],_0x41aa4e[_0xceca('0x2c')],_0x3a5e2e,_0x4c6cf7[_0xceca('0x9')][_0xceca('0x2c')],_0x4c6cf7[_0xceca('0x27')]['id'],!![],_0x25d010,_0x41aa4e['id']);if(rpc[_0x4c6cf7['channel']+_0xceca('0x2d')]){return rpc[_0x4c6cf7[_0xceca('0x24')]+_0xceca('0x2d')][_0xceca('0x2e')](_0x3a5e2e)[_0xceca('0x2f')](function(_0x14e094){logger[_0xceca('0x30')](_0xceca('0x31'));});}}}function stopRouting(_0x3b6b26,_0x3879de,_0x4c53ed,_0x5e0a2b){if(_0x3b6b26&&_0x3879de){_0x3879de['waiting']-=0x1;var _0x218a42={'leaveAt':moment()[_0xceca('0xf')](_0xceca('0x20')),'acceptAt':moment()[_0xceca('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0xceca('0x2a')](util[_0xceca('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x3b6b26,_0x3879de['name']));emitChannelQueueInteraction(_0x4c53ed['channel'],_0x3879de[_0xceca('0x2c')],_0x4c53ed[_0xceca('0x1f')],_0x4c53ed[_0xceca('0x9')][_0xceca('0x2c')],_0x4c53ed[_0xceca('0x27')]['id'],![],_0x5e0a2b,_0x3879de['id']);if(rpc[_0x4c53ed['channel']+'QueueReport']){return rpc[_0x4c53ed[_0xceca('0x24')]+_0xceca('0x2d')][_0xceca('0x32')](_0x3b6b26,_0x218a42)[_0xceca('0x2f')](function(_0x359683){logger[_0xceca('0x30')](_0xceca('0x33'));});}}}function endRouting(_0x4baad3,_0x291b16,_0x2956db,_0x355772){if(_0x4baad3&&_0x291b16){_0x291b16[_0xceca('0x34')]-=0x1;var _0x200a98={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xceca('0xf')](_0xceca('0x20')),'reason':'timeout'};logger[_0xceca('0x2a')](util[_0xceca('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x4baad3,_0x291b16[_0xceca('0x2c')]));emitChannelQueueInteraction(_0x2956db[_0xceca('0x24')],_0x291b16[_0xceca('0x2c')],_0x2956db['body'],_0x2956db[_0xceca('0x9')][_0xceca('0x2c')],_0x2956db[_0xceca('0x27')]['id'],![],_0x355772);if(rpc[_0x2956db['channel']+_0xceca('0x2d')]){return rpc[_0x2956db[_0xceca('0x24')]+'QueueReport']['update'](_0x4baad3,_0x200a98)[_0xceca('0x2f')](function(_0x53ba10){logger[_0xceca('0x30')](_0xceca('0x33'));});}}}function handleFindQueue(_0x42ba89){return function(_0x3e709e){return _0x3e709e[_0xceca('0x2c')][_0xceca('0x35')]()===_0x42ba89[_0xceca('0x35')]();};}exports[_0xceca('0x36')]=function(_0x1785d2,_0x47c65b,_0x987391,_0x205adf){return function(_0x1100b6){try{var _0x42ab3d={'name':_0x47c65b[0x0],'timeout':_0x47c65b[0x1]};var _0x25e37d=queue[_0xceca('0x0')](_0x42ab3d,{'typecast':!![]});if(_0x25e37d[_0xceca('0x37')]){logger[_0xceca('0x30')](_0xceca('0x38'),_0x1785d2,_[_0xceca('0x39')](_0x25e37d,'message')[_0xceca('0x3a')](',\x20'));_0x1100b6[_0xceca('0x3b')]();}else{var _0x59f78f=_[_0xceca('0x3c')](_0x987391[_0x205adf[_0xceca('0x24')]+_0xceca('0x3d')],handleFindQueue(_0x42ab3d['name']));if(_0x59f78f){startRouting(_0x1785d2,_0x59f78f,_0x205adf,_0x987391);var _0x38adc4=(_0x59f78f[_0xceca('0x3e')]||0xa)*0x3e8;var _0x5d348e=(_0x42ab3d[_0xceca('0x3e')]||0x14)*0x3e8;var _0x18410f,_0x34546d;if(_0x38adc4>_0x5d348e){_0x5d348e=_0x38adc4;}var _0x13dc25=seqqueue['createQueue'](_0x38adc4);_0x13dc25['id']=_0x1785d2;_0x13dc25[_0xceca('0x3f')]=_0x38adc4;_0x13dc25[_0xceca('0x40')]=_0x5d348e;_0x13dc25['channel']=_0x205adf[_0xceca('0x24')];_0x987391[_0xceca('0x41')][_0x1785d2]['on'](_0xceca('0x42'),function(){logger[_0xceca('0x2a')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1785d2);stopRouting(_0x1785d2,_0x59f78f,_0x205adf,_0x987391);clearTimeout(_0x18410f);_0x18410f=undefined;_0x13dc25[_0xceca('0x43')](!![]);if(_0x987391[_0xceca('0x41')][_0x1785d2]){delete _0x987391[_0xceca('0x41')][_0x1785d2];}_0x1100b6[_0xceca('0x3b')]();});_0x987391[_0xceca('0x41')][_0x1785d2]['on'](_0xceca('0x44'),function(){if(_0x987391[_0xceca('0x41')][_0x1785d2]){delete _0x987391[_0xceca('0x41')][_0x1785d2];}});_0x18410f=setTimeout(function(){logger['info'](_0xceca('0x45'),_0x1785d2);endRouting(_0x1785d2,_0x59f78f,_0x205adf,_0x987391);clearTimeout(_0x18410f);_0x13dc25[_0xceca('0x43')](!![]);_0x1100b6[_0xceca('0x46')]();},_0x5d348e);switch(_0x59f78f[_0xceca('0x47')]){case _0xceca('0x48'):strategy[_0xceca('0x48')](_0x13dc25,_0x59f78f,_0x987391,_0x205adf);break;default:strategy[_0xceca('0x49')](_0x13dc25,_0x59f78f,_0x987391,_0x205adf);}}else{logger[_0xceca('0x30')](_0xceca('0x4a'),_0x1785d2,_0x42ab3d[_0xceca('0x2c')]);_0x1100b6[_0xceca('0x3b')]();}}}catch(_0x4cba4e){console[_0xceca('0x4b')](_0x4cba4e);logger[_0xceca('0x30')](_0xceca('0x38'),_0x1785d2,_0x4cba4e[_0xceca('0x4c')]);_0x1100b6['stop']();}};};
\ No newline at end of file
index 5d9a4be..f78e048 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x104b=['uuid','./util','../../../../../config/logger','notificationId','squeue','agent','routing','push','handleRun','bind','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','handleTimeout','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','lodash'];(function(_0x15ba97,_0x5598fa){var _0x30743c=function(_0x1eda47){while(--_0x1eda47){_0x15ba97['push'](_0x15ba97['shift']());}};_0x30743c(++_0x5598fa);}(_0x104b,0x167));var _0xb104=function(_0x1a996e,_0x262c3c){_0x1a996e=_0x1a996e-0x0;var _0x4a16aa=_0x104b[_0x1a996e];return _0x4a16aa;};'use strict';var _=require(_0xb104('0x0'));var uuid=require(_0xb104('0x1'));var util=require(_0xb104('0x2'));var logger=require(_0xb104('0x3'))('routing');var Agent=function(_0x257eb4,_0x5a8907,_0x1217f5,_0x25df06){this[_0xb104('0x4')]=uuid['v4']();this[_0xb104('0x5')]=_0x257eb4;this[_0xb104('0x6')]=_0x5a8907;this['realtime']=_0x1217f5;this[_0xb104('0x7')]=_0x25df06;this[_0xb104('0x5')][_0xb104('0x8')](this[_0xb104('0x9')][_0xb104('0xa')](this),this['handleTimeout'][_0xb104('0xa')](this));this[_0xb104('0x5')]['on'](_0xb104('0xb'),this['handleTimeout'][_0xb104('0xa')](this));this[_0xb104('0x5')]['on'](_0xb104('0xc'),this[_0xb104('0xd')][_0xb104('0xa')](this));};Agent[_0xb104('0xe')][_0xb104('0x8')]=function(){this[_0xb104('0x5')][_0xb104('0x8')](this[_0xb104('0x9')][_0xb104('0xa')](this),this['handleTimeout'][_0xb104('0xa')](this));};Agent[_0xb104('0xe')][_0xb104('0xd')]=function(){this['handleTimeout'](!![]);};Agent[_0xb104('0xe')][_0xb104('0x9')]=function(_0x9b2536){logger[_0xb104('0xf')](_0xb104('0x10'),this[_0xb104('0x5')]['id'],this[_0xb104('0x6')]['id']);if(_[_0xb104('0x11')](this[_0xb104('0x12')][_0xb104('0x13')][this['agent']['id']])){logger[_0xb104('0xf')](_0xb104('0x14'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xb104('0xa')](this),0x3e8);}else{if(this[_0xb104('0x7')][_0xb104('0x15')]||util[_0xb104('0x16')](this[_0xb104('0x5')]['id'],this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']],this[_0xb104('0x5')][_0xb104('0x17')],![])){this[_0xb104('0x12')]['agents'][this['agent']['id']][_0xb104('0x18')]=!![];this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']][_0xb104('0x19')]=undefined;util[_0xb104('0x1a')](this[_0xb104('0x4')],this['squeue']['id'],this[_0xb104('0x12')]['agents'][this['agent']['id']],null,this[_0xb104('0x7')]);util['writeLog'](this[_0xb104('0x5')]['id'],this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']],_0xb104('0x1b')+(this[_0xb104('0x7')][_0xb104('0x15')]?_0xb104('0x1c'):''));}else{logger[_0xb104('0xf')](_0xb104('0x1d'),this[_0xb104('0x5')]['id'],this[_0xb104('0x6')]['id']);setTimeout(this['push'][_0xb104('0xa')](this),0x3e8);}}};Agent[_0xb104('0xe')][_0xb104('0x1e')]=function(_0xeba11a){if(_['isNil'](this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']])){return logger[_0xb104('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb104('0x5')]['id'],this[_0xb104('0x6')]['id']);}else{logger[_0xb104('0xf')](_0xb104('0x1f'),this[_0xb104('0x5')]['id'],this[_0xb104('0x6')]['id']);util['hideNotification'](this[_0xb104('0x4')],this[_0xb104('0x5')]['id'],this[_0xb104('0x12')][_0xb104('0x13')][this['agent']['id']],null,this[_0xb104('0x7')]);this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']]['busy']=![];this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']][_0xb104('0x19')]=undefined;util[_0xb104('0x20')](this['squeue']['id'],this[_0xb104('0x12')][_0xb104('0x13')][this[_0xb104('0x6')]['id']],_0xeba11a?_0xb104('0x21'):_0xb104('0x22'));}if(!_0xeba11a){setTimeout(this[_0xb104('0x8')][_0xb104('0xa')](this),0x3e8);}};function agent(_0x179426,_0x25032f,_0x58d6df,_0x3fd9f9){return new Agent(_0x179426,_0x25032f,_0x58d6df,_0x3fd9f9);}module[_0xb104('0x23')]=agent;
\ No newline at end of file
+var _0x166d=['prototype','info','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained'];(function(_0x3cb1c2,_0x9f9605){var _0x4da983=function(_0x4958f6){while(--_0x4958f6){_0x3cb1c2['push'](_0x3cb1c2['shift']());}};_0x4da983(++_0x9f9605);}(_0x166d,0x148));var _0xd166=function(_0x595986,_0x2754f1){_0x595986=_0x595986-0x0;var _0x19925c=_0x166d[_0x595986];return _0x19925c;};'use strict';var _=require('lodash');var uuid=require(_0xd166('0x0'));var util=require(_0xd166('0x1'));var logger=require(_0xd166('0x2'))(_0xd166('0x3'));var Agent=function(_0x399a1c,_0x29ed1f,_0x557c3b,_0x27f6ef){this[_0xd166('0x4')]=uuid['v4']();this[_0xd166('0x5')]=_0x399a1c;this['agent']=_0x29ed1f;this[_0xd166('0x6')]=_0x557c3b;this[_0xd166('0x3')]=_0x27f6ef;this['squeue'][_0xd166('0x7')](this[_0xd166('0x8')][_0xd166('0x9')](this),this[_0xd166('0xa')][_0xd166('0x9')](this));this[_0xd166('0x5')]['on'](_0xd166('0xb'),this[_0xd166('0xa')]['bind'](this));this['squeue']['on'](_0xd166('0xc'),this['handleDrained'][_0xd166('0x9')](this));};Agent[_0xd166('0xd')][_0xd166('0x7')]=function(){this['squeue']['push'](this[_0xd166('0x8')][_0xd166('0x9')](this),this[_0xd166('0xa')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0xd166('0xa')](!![]);};Agent[_0xd166('0xd')][_0xd166('0x8')]=function(_0x110652){logger[_0xd166('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xd166('0x5')]['id'],this[_0xd166('0xf')]['id']);if(_[_0xd166('0x10')](this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']])){logger['info'](_0xd166('0x12'),this[_0xd166('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xd166('0x7')]['bind'](this),0x3e8);}else{if(this[_0xd166('0x3')][_0xd166('0x13')]||util[_0xd166('0x14')](this['squeue']['id'],this[_0xd166('0x6')]['agents'][this[_0xd166('0xf')]['id']],this[_0xd166('0x5')][_0xd166('0x15')],![])){this[_0xd166('0x6')][_0xd166('0x11')][this['agent']['id']][_0xd166('0x16')]=!![];this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']]['busyQueue']=undefined;util[_0xd166('0x17')](this[_0xd166('0x4')],this[_0xd166('0x5')]['id'],this[_0xd166('0x6')]['agents'][this[_0xd166('0xf')]['id']],null,this[_0xd166('0x3')]);util[_0xd166('0x18')](this['squeue']['id'],this[_0xd166('0x6')][_0xd166('0x11')][this['agent']['id']],_0xd166('0x19')+(this['routing'][_0xd166('0x13')]?_0xd166('0x1a'):''));}else{logger[_0xd166('0xe')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this[_0xd166('0xf')]['id']);setTimeout(this[_0xd166('0x7')][_0xd166('0x9')](this),0x3e8);}}};Agent[_0xd166('0xd')]['handleTimeout']=function(_0x2001c2){if(_[_0xd166('0x10')](this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']])){return logger[_0xd166('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd166('0x5')]['id'],this[_0xd166('0xf')]['id']);}else{logger[_0xd166('0xe')](_0xd166('0x1b'),this[_0xd166('0x5')]['id'],this[_0xd166('0xf')]['id']);util[_0xd166('0x1c')](this['notificationId'],this[_0xd166('0x5')]['id'],this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']],null,this[_0xd166('0x3')]);this[_0xd166('0x6')][_0xd166('0x11')][this['agent']['id']][_0xd166('0x16')]=![];this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']][_0xd166('0x1d')]=undefined;util[_0xd166('0x18')](this[_0xd166('0x5')]['id'],this[_0xd166('0x6')][_0xd166('0x11')][this[_0xd166('0xf')]['id']],_0x2001c2?_0xd166('0x1e'):'TIMEOUT');}if(!_0x2001c2){setTimeout(this['push'][_0xd166('0x9')](this),0x3e8);}};function agent(_0x56db14,_0x2d6a4e,_0xde6200,_0x1de7d6){return new Agent(_0x56db14,_0x2d6a4e,_0xde6200,_0x1de7d6);}module['exports']=agent;
\ No newline at end of file
index c5398e8..de5bc26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9589=['writeLog','agents','RINGING','busy','busyQueue','name','showNotification','notificationId','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','length','Agents','info','isAgentAvailable','channel'];(function(_0xcafa4b,_0x572040){var _0x4e3260=function(_0xfa5aba){while(--_0xfa5aba){_0xcafa4b['push'](_0xcafa4b['shift']());}};_0x4e3260(++_0x572040);}(_0x9589,0xbc));var _0x9958=function(_0x2faf15,_0x597ce3){_0x2faf15=_0x2faf15-0x0;var _0x47c96d=_0x9589[_0x2faf15];return _0x47c96d;};'use strict';var _=require(_0x9958('0x0'));var uuid=require(_0x9958('0x1'));var util=require(_0x9958('0x2'));var logger=require(_0x9958('0x3'))(_0x9958('0x4'));var Beepall=function(_0x5f379e,_0x3eec38,_0x153116,_0xe7c0e){this['notificationId']=uuid['v4']();this[_0x9958('0x5')]=_0x5f379e;this[_0x9958('0x6')]=_0x3eec38;this[_0x9958('0x7')]=_0x153116;this[_0x9958('0x4')]=_0xe7c0e;this[_0x9958('0x5')][_0x9958('0x8')](this['handleRun'][_0x9958('0x9')](this),this[_0x9958('0xa')][_0x9958('0x9')](this));this[_0x9958('0x5')]['on'](_0x9958('0xb'),this[_0x9958('0xa')][_0x9958('0x9')](this));this[_0x9958('0x5')]['on'](_0x9958('0xc'),this[_0x9958('0xd')][_0x9958('0x9')](this));};Beepall[_0x9958('0xe')][_0x9958('0x8')]=function(){this[_0x9958('0x5')][_0x9958('0x8')](this[_0x9958('0xf')][_0x9958('0x9')](this),this[_0x9958('0xa')]['bind'](this));};Beepall[_0x9958('0xe')]['handleDrained']=function(_0x1d6513){this['handleTimeout'](!![]);};Beepall[_0x9958('0xe')][_0x9958('0xf')]=function(_0x331078){var _0x31e5d0=!![];if(!_['isNil'](this[_0x9958('0x6')])&&!_[_0x9958('0x10')](this['queue']['Agents'])&&this[_0x9958('0x6')]['Agents'][_0x9958('0x11')]>0x0){for(var _0x124929=0x0,_0x3c0b8b;_0x124929<this[_0x9958('0x6')][_0x9958('0x12')][_0x9958('0x11')];_0x124929+=0x1){_0x3c0b8b=this['queue']['Agents'][_0x124929]['id'];if(_[_0x9958('0x10')](this['realtime']['agents'][_0x3c0b8b])){logger[_0x9958('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],_0x3c0b8b);}else{if(util[_0x9958('0x14')](this[_0x9958('0x5')]['id'],this[_0x9958('0x7')]['agents'][_0x3c0b8b],this[_0x9958('0x5')][_0x9958('0x15')],!![])){_0x31e5d0=![];util[_0x9958('0x16')](this[_0x9958('0x5')]['id'],this[_0x9958('0x7')][_0x9958('0x17')][_0x3c0b8b],_0x9958('0x18'));this[_0x9958('0x7')][_0x9958('0x17')][_0x3c0b8b][_0x9958('0x19')]=!![];this[_0x9958('0x7')][_0x9958('0x17')][_0x3c0b8b][_0x9958('0x1a')]=this['queue'][_0x9958('0x1b')];util[_0x9958('0x1c')](this[_0x9958('0x1d')],this['squeue']['id'],this[_0x9958('0x7')][_0x9958('0x17')][_0x3c0b8b],this[_0x9958('0x6')],this[_0x9958('0x4')]);}}}if(_0x31e5d0){logger[_0x9958('0x13')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x9958('0x5')]['id']);setTimeout(this[_0x9958('0x8')][_0x9958('0x9')](this),0x3e8);}}else{logger['info'](_0x9958('0x1e'),this[_0x9958('0x5')]['id']);setTimeout(this[_0x9958('0x8')][_0x9958('0x9')](this),0x3e8);}};Beepall[_0x9958('0xe')]['handleTimeout']=function(_0x1171bb){if(!_[_0x9958('0x10')](this[_0x9958('0x6')])&&!_[_0x9958('0x10')](this[_0x9958('0x6')]['Agents'])){for(var _0x22762e=0x0,_0x551abf;_0x22762e<this[_0x9958('0x6')][_0x9958('0x12')]['length'];_0x22762e+=0x1){_0x551abf=this[_0x9958('0x6')][_0x9958('0x12')][_0x22762e]['id'];if(_[_0x9958('0x10')](this[_0x9958('0x7')][_0x9958('0x17')][_0x551abf])){logger[_0x9958('0x13')](_0x9958('0x1f'),this[_0x9958('0x5')]['id'],_0x551abf);}else{util[_0x9958('0x20')](this['notificationId'],this[_0x9958('0x5')]['id'],this['realtime'][_0x9958('0x17')][_0x551abf],this[_0x9958('0x6')],this[_0x9958('0x4')]);util['writeLog'](this[_0x9958('0x5')]['id'],this[_0x9958('0x7')]['agents'][_0x551abf],_0x1171bb?'STOP':_0x9958('0x21'));this[_0x9958('0x7')]['agents'][_0x551abf][_0x9958('0x19')]=![];this[_0x9958('0x7')][_0x9958('0x17')][_0x551abf][_0x9958('0x1a')]=undefined;}}}if(!_0x1171bb){setTimeout(this[_0x9958('0x8')][_0x9958('0x9')](this),0x3e8);}};function beepall(_0x4bc37d,_0x239270,_0xcd392,_0x4376c6){return new Beepall(_0x4bc37d,_0x239270,_0xcd392,_0x4376c6);}module[_0x9958('0x22')]=beepall;
\ No newline at end of file
+var _0x77f7=['handleRun','bind','handleTimeout','drained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','name','showNotification','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','queue','realtime','squeue','push'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x77f7,0xbd));var _0x777f=function(_0x49149e,_0x5d9fec){_0x49149e=_0x49149e-0x0;var _0x18c58f=_0x77f7[_0x49149e];return _0x18c58f;};'use strict';var _=require(_0x777f('0x0'));var uuid=require(_0x777f('0x1'));var util=require(_0x777f('0x2'));var logger=require(_0x777f('0x3'))(_0x777f('0x4'));var Beepall=function(_0xcd0b99,_0x1f15bf,_0xe31aeb,_0x1f783b){this['notificationId']=uuid['v4']();this['squeue']=_0xcd0b99;this[_0x777f('0x5')]=_0x1f15bf;this[_0x777f('0x6')]=_0xe31aeb;this[_0x777f('0x4')]=_0x1f783b;this[_0x777f('0x7')][_0x777f('0x8')](this[_0x777f('0x9')][_0x777f('0xa')](this),this[_0x777f('0xb')][_0x777f('0xa')](this));this[_0x777f('0x7')]['on']('timeout',this[_0x777f('0xb')]['bind'](this));this[_0x777f('0x7')]['on'](_0x777f('0xc'),this['handleDrained'][_0x777f('0xa')](this));};Beepall[_0x777f('0xd')][_0x777f('0x8')]=function(){this['squeue'][_0x777f('0x8')](this[_0x777f('0x9')][_0x777f('0xa')](this),this[_0x777f('0xb')][_0x777f('0xa')](this));};Beepall[_0x777f('0xd')]['handleDrained']=function(_0x33c907){this[_0x777f('0xb')](!![]);};Beepall['prototype'][_0x777f('0x9')]=function(_0x187bcb){var _0x198805=!![];if(!_[_0x777f('0xe')](this[_0x777f('0x5')])&&!_[_0x777f('0xe')](this[_0x777f('0x5')]['Agents'])&&this[_0x777f('0x5')][_0x777f('0xf')][_0x777f('0x10')]>0x0){for(var _0x1ef1c5=0x0,_0x361759;_0x1ef1c5<this[_0x777f('0x5')][_0x777f('0xf')]['length'];_0x1ef1c5+=0x1){_0x361759=this['queue'][_0x777f('0xf')][_0x1ef1c5]['id'];if(_[_0x777f('0xe')](this[_0x777f('0x6')][_0x777f('0x11')][_0x361759])){logger[_0x777f('0x12')](_0x777f('0x13'),this[_0x777f('0x7')]['id'],_0x361759);}else{if(util[_0x777f('0x14')](this['squeue']['id'],this[_0x777f('0x6')]['agents'][_0x361759],this[_0x777f('0x7')][_0x777f('0x15')],!![])){_0x198805=![];util[_0x777f('0x16')](this[_0x777f('0x7')]['id'],this[_0x777f('0x6')][_0x777f('0x11')][_0x361759],_0x777f('0x17'));this['realtime'][_0x777f('0x11')][_0x361759][_0x777f('0x18')]=!![];this['realtime'][_0x777f('0x11')][_0x361759]['busyQueue']=this[_0x777f('0x5')][_0x777f('0x19')];util[_0x777f('0x1a')](this[_0x777f('0x1b')],this[_0x777f('0x7')]['id'],this[_0x777f('0x6')][_0x777f('0x11')][_0x361759],this[_0x777f('0x5')],this[_0x777f('0x4')]);}}}if(_0x198805){logger['info']('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x777f('0x7')]['id']);setTimeout(this[_0x777f('0x8')][_0x777f('0xa')](this),0x3e8);}}else{logger[_0x777f('0x12')](_0x777f('0x1c'),this[_0x777f('0x7')]['id']);setTimeout(this[_0x777f('0x8')]['bind'](this),0x3e8);}};Beepall[_0x777f('0xd')][_0x777f('0xb')]=function(_0x5b78b8){if(!_[_0x777f('0xe')](this[_0x777f('0x5')])&&!_['isNil'](this['queue'][_0x777f('0xf')])){for(var _0x10e02e=0x0,_0x164792;_0x10e02e<this[_0x777f('0x5')][_0x777f('0xf')][_0x777f('0x10')];_0x10e02e+=0x1){_0x164792=this[_0x777f('0x5')][_0x777f('0xf')][_0x10e02e]['id'];if(_[_0x777f('0xe')](this[_0x777f('0x6')]['agents'][_0x164792])){logger[_0x777f('0x12')](_0x777f('0x13'),this[_0x777f('0x7')]['id'],_0x164792);}else{util[_0x777f('0x1d')](this[_0x777f('0x1b')],this[_0x777f('0x7')]['id'],this['realtime'][_0x777f('0x11')][_0x164792],this[_0x777f('0x5')],this['routing']);util[_0x777f('0x16')](this['squeue']['id'],this['realtime'][_0x777f('0x11')][_0x164792],_0x5b78b8?_0x777f('0x1e'):_0x777f('0x1f'));this[_0x777f('0x6')][_0x777f('0x11')][_0x164792][_0x777f('0x18')]=![];this[_0x777f('0x6')][_0x777f('0x11')][_0x164792]['busyQueue']=undefined;}}}if(!_0x5b78b8){setTimeout(this['push'][_0x777f('0xa')](this),0x3e8);}};function beepall(_0x422bb9,_0x1978bd,_0x23d1e5,_0x1860d6){return new Beepall(_0x422bb9,_0x1978bd,_0x23d1e5,_0x1860d6);}module[_0x777f('0x20')]=beepall;
\ No newline at end of file
index 67818fc..0889ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ed3=['./rrmemory','./beepall','./agent'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6ed3,0x11d));var _0x36ed=function(_0xcd939f,_0x33117d){_0xcd939f=_0xcd939f-0x0;var _0xe23e6f=_0x6ed3[_0xcd939f];return _0xe23e6f;};'use strict';module['exports']={'rrmemory':require(_0x36ed('0x0')),'beepall':require(_0x36ed('0x1')),'agent':require(_0x36ed('0x2'))};
\ No newline at end of file
+var _0x4ee1=['./beepall','./agent','exports'];(function(_0x583ecb,_0x69efa){var _0x46be9b=function(_0x1a8338){while(--_0x1a8338){_0x583ecb['push'](_0x583ecb['shift']());}};_0x46be9b(++_0x69efa);}(_0x4ee1,0x167));var _0x14ee=function(_0x2fbd1e,_0x3764f4){_0x2fbd1e=_0x2fbd1e-0x0;var _0x43dc9d=_0x4ee1[_0x2fbd1e];return _0x43dc9d;};'use strict';module[_0x14ee('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x14ee('0x1')),'agent':require(_0x14ee('0x2'))};
\ No newline at end of file
index 553b438..dc4211d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30f1=['busy','name','showNotification','notificationId','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','busyQueue','exports','lodash','uuid','../../../../../config/logger','squeue','queue','realtime','routing','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','intervals','done'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x30f1,0x16b));var _0x130f=function(_0x446c1a,_0x571642){_0x446c1a=_0x446c1a-0x0;var _0x140581=_0x30f1[_0x446c1a];return _0x140581;};'use strict';var rr=require('rr');var _=require(_0x130f('0x0'));var uuid=require(_0x130f('0x1'));var util=require('./util');var logger=require(_0x130f('0x2'))('routing');var RRMemory=function(_0x5de798,_0x11d14b,_0x11c56a,_0x5b93f0){this['notificationId']=uuid['v4']();this[_0x130f('0x3')]=_0x5de798;this[_0x130f('0x4')]=_0x11d14b;this[_0x130f('0x5')]=_0x11c56a;this[_0x130f('0x6')]=_0x5b93f0;this['intervals']={};this['squeue'][_0x130f('0x7')](this[_0x130f('0x8')]['bind'](this),this[_0x130f('0x9')][_0x130f('0xa')](this),this['module']);this[_0x130f('0x3')]['on']('timeout',this[_0x130f('0x9')]['bind'](this));this[_0x130f('0x3')]['on'](_0x130f('0xb'),this[_0x130f('0xc')][_0x130f('0xa')](this));};RRMemory[_0x130f('0xd')][_0x130f('0x7')]=function(){this['squeue'][_0x130f('0x7')](this[_0x130f('0x8')][_0x130f('0xa')](this),this[_0x130f('0x9')][_0x130f('0xa')](this));};RRMemory[_0x130f('0xd')][_0x130f('0xc')]=function(_0x3d6229){this[_0x130f('0x9')](!![]);};RRMemory[_0x130f('0xd')][_0x130f('0xe')]=function(_0x1fa29a){if(util[_0x130f('0xf')](this[_0x130f('0x3')]['id'],this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]],this['squeue'][_0x130f('0x12')],!![])){logger[_0x130f('0x13')]('[%s][QUEUE]\x20available\x20again\x20%s',this['squeue']['id'],this[_0x130f('0x11')]);clearInterval(this[_0x130f('0x14')][this[_0x130f('0x11')]]);_0x1fa29a[_0x130f('0x15')]();setTimeout(this[_0x130f('0x7')][_0x130f('0xa')](this),0x3e8);}};RRMemory['prototype'][_0x130f('0x8')]=function(_0xa6360c){this[_0x130f('0x11')]=rr(this[_0x130f('0x4')]['mapAgentsId']);logger['info']('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x130f('0x3')]['id'],this[_0x130f('0x11')]);if(_['isNil'](this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]])){logger[_0x130f('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agentId']);_0xa6360c['done']();setTimeout(this['push'][_0x130f('0xa')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x130f('0x3')]['id'],this[_0x130f('0x5')][_0x130f('0x10')][this['agentId']],this['squeue']['channel'],!![])){this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]][_0x130f('0x16')]=!![];this[_0x130f('0x5')][_0x130f('0x10')][this['agentId']]['busyQueue']=this['queue'][_0x130f('0x17')];util[_0x130f('0x18')](this[_0x130f('0x19')],this[_0x130f('0x3')]['id'],this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]],this[_0x130f('0x4')],this['routing']);util[_0x130f('0x1a')](this[_0x130f('0x3')]['id'],this[_0x130f('0x5')][_0x130f('0x10')][this['agentId']],_0x130f('0x1b'));this[_0x130f('0x14')][this['agentId']]=setInterval(this['handleCheckReject'][_0x130f('0xa')](this,_0xa6360c),0x3e8);}else{logger[_0x130f('0x13')](_0x130f('0x1c'),this['squeue']['id'],this['agentId']);_0xa6360c[_0x130f('0x15')]();setTimeout(this[_0x130f('0x7')]['bind'](this),0x3e8);}}};RRMemory['prototype'][_0x130f('0x9')]=function(_0x1e1c19){logger[_0x130f('0x13')](_0x130f('0x1d'),this[_0x130f('0x3')]['id'],this['agentId']);if(_['isNil'](this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]])){logger[_0x130f('0x13')](_0x130f('0x1e'),this[_0x130f('0x3')]['id'],this[_0x130f('0x11')]);}else{clearInterval(this[_0x130f('0x14')][this[_0x130f('0x11')]]);util[_0x130f('0x1f')](this[_0x130f('0x19')],this['squeue']['id'],this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]],this[_0x130f('0x4')],this[_0x130f('0x6')]);util[_0x130f('0x1a')](this[_0x130f('0x3')]['id'],this['realtime'][_0x130f('0x10')][this['agentId']],_0x130f('0x20'));this[_0x130f('0x5')][_0x130f('0x10')][this[_0x130f('0x11')]][_0x130f('0x16')]=![];this[_0x130f('0x5')][_0x130f('0x10')][this['agentId']][_0x130f('0x21')]=undefined;}if(!_0x1e1c19){setTimeout(this['push'][_0x130f('0xa')](this),0x3e8);}};function rrmemory(_0x4a60ae,_0x10f06e,_0x191d24,_0x397eae){return new RRMemory(_0x4a60ae,_0x10f06e,_0x191d24,_0x397eae);}module[_0x130f('0x22')]=rrmemory;
\ No newline at end of file
+var _0x39d5=['routing','intervals','push','handleRun','bind','handleTimeout','module','timeout','drained','handleDrained','prototype','handleCheckReject','agents','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','info','[%s][QUEUE]\x20try\x20with\x20%s','isNil','busyQueue','name','showNotification','writeLog','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','uuid','./util','../../../../../config/logger','notificationId','squeue','queue','realtime'];(function(_0x37bab4,_0x40dadf){var _0xe2212b=function(_0x48d7fa){while(--_0x48d7fa){_0x37bab4['push'](_0x37bab4['shift']());}};_0xe2212b(++_0x40dadf);}(_0x39d5,0xf5));var _0x539d=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x39d5[_0x1b349a];return _0x5d1f7c;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x539d('0x0'));var util=require(_0x539d('0x1'));var logger=require(_0x539d('0x2'))('routing');var RRMemory=function(_0x36e5da,_0x52d046,_0x3e04ae,_0x14422f){this[_0x539d('0x3')]=uuid['v4']();this[_0x539d('0x4')]=_0x36e5da;this[_0x539d('0x5')]=_0x52d046;this[_0x539d('0x6')]=_0x3e04ae;this[_0x539d('0x7')]=_0x14422f;this[_0x539d('0x8')]={};this[_0x539d('0x4')][_0x539d('0x9')](this[_0x539d('0xa')][_0x539d('0xb')](this),this[_0x539d('0xc')][_0x539d('0xb')](this),this[_0x539d('0xd')]);this[_0x539d('0x4')]['on'](_0x539d('0xe'),this[_0x539d('0xc')][_0x539d('0xb')](this));this[_0x539d('0x4')]['on'](_0x539d('0xf'),this[_0x539d('0x10')][_0x539d('0xb')](this));};RRMemory[_0x539d('0x11')][_0x539d('0x9')]=function(){this[_0x539d('0x4')][_0x539d('0x9')](this[_0x539d('0xa')][_0x539d('0xb')](this),this[_0x539d('0xc')]['bind'](this));};RRMemory[_0x539d('0x11')][_0x539d('0x10')]=function(_0x311719){this[_0x539d('0xc')](!![]);};RRMemory['prototype'][_0x539d('0x12')]=function(_0x15f656){if(util['isAgentAvailable'](this[_0x539d('0x4')]['id'],this['realtime'][_0x539d('0x13')][this['agentId']],this[_0x539d('0x4')]['channel'],!![])){logger['info'](_0x539d('0x14'),this[_0x539d('0x4')]['id'],this[_0x539d('0x15')]);clearInterval(this[_0x539d('0x8')][this[_0x539d('0x15')]]);_0x15f656[_0x539d('0x16')]();setTimeout(this[_0x539d('0x9')][_0x539d('0xb')](this),0x3e8);}};RRMemory[_0x539d('0x11')][_0x539d('0xa')]=function(_0x4fefe1){this[_0x539d('0x15')]=rr(this[_0x539d('0x5')][_0x539d('0x17')]);logger[_0x539d('0x18')](_0x539d('0x19'),this[_0x539d('0x4')]['id'],this[_0x539d('0x15')]);if(_[_0x539d('0x1a')](this[_0x539d('0x6')][_0x539d('0x13')][this[_0x539d('0x15')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x539d('0x4')]['id'],this[_0x539d('0x15')]);_0x4fefe1[_0x539d('0x16')]();setTimeout(this['push']['bind'](this),0x3e8);}else{if(util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0x539d('0x13')][this[_0x539d('0x15')]],this['squeue']['channel'],!![])){this[_0x539d('0x6')]['agents'][this[_0x539d('0x15')]]['busy']=!![];this[_0x539d('0x6')][_0x539d('0x13')][this[_0x539d('0x15')]][_0x539d('0x1b')]=this[_0x539d('0x5')][_0x539d('0x1c')];util[_0x539d('0x1d')](this[_0x539d('0x3')],this[_0x539d('0x4')]['id'],this[_0x539d('0x6')][_0x539d('0x13')][this[_0x539d('0x15')]],this[_0x539d('0x5')],this[_0x539d('0x7')]);util[_0x539d('0x1e')](this[_0x539d('0x4')]['id'],this[_0x539d('0x6')][_0x539d('0x13')][this['agentId']],'RINGING');this[_0x539d('0x8')][this[_0x539d('0x15')]]=setInterval(this[_0x539d('0x12')]['bind'](this,_0x4fefe1),0x3e8);}else{logger[_0x539d('0x18')](_0x539d('0x1f'),this['squeue']['id'],this[_0x539d('0x15')]);_0x4fefe1[_0x539d('0x16')]();setTimeout(this[_0x539d('0x9')]['bind'](this),0x3e8);}}};RRMemory[_0x539d('0x11')]['handleTimeout']=function(_0x6b81b2){logger['info'](_0x539d('0x20'),this[_0x539d('0x4')]['id'],this[_0x539d('0x15')]);if(_[_0x539d('0x1a')](this[_0x539d('0x6')]['agents'][this[_0x539d('0x15')]])){logger[_0x539d('0x18')](_0x539d('0x21'),this['squeue']['id'],this[_0x539d('0x15')]);}else{clearInterval(this[_0x539d('0x8')][this[_0x539d('0x15')]]);util[_0x539d('0x22')](this[_0x539d('0x3')],this[_0x539d('0x4')]['id'],this['realtime'][_0x539d('0x13')][this[_0x539d('0x15')]],this[_0x539d('0x5')],this[_0x539d('0x7')]);util[_0x539d('0x1e')](this[_0x539d('0x4')]['id'],this[_0x539d('0x6')][_0x539d('0x13')][this[_0x539d('0x15')]],'TIMEOUT');this[_0x539d('0x6')][_0x539d('0x13')][this[_0x539d('0x15')]][_0x539d('0x23')]=![];this['realtime'][_0x539d('0x13')][this[_0x539d('0x15')]][_0x539d('0x1b')]=undefined;}if(!_0x6b81b2){setTimeout(this[_0x539d('0x9')][_0x539d('0xb')](this),0x3e8);}};function rrmemory(_0x88cdf,_0x4ee640,_0x21b9b8,_0x1de11e){return new RRMemory(_0x88cdf,_0x4ee640,_0x21b9b8,_0x1de11e);}module['exports']=rrmemory;
\ No newline at end of file
index 26fe3e1..cb26725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fd4=['toUpperCase','\x20MAXCAPACITY','showNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','OFFLINE','Pause','hasOwnProperty','CurrentCapacity','Capacity'];(function(_0x4c68ce,_0x42ad78){var _0x224d31=function(_0x516c62){while(--_0x516c62){_0x4c68ce['push'](_0x4c68ce['shift']());}};_0x224d31(++_0x42ad78);}(_0x9fd4,0x16c));var _0x49fd=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0x9fd4[_0x4cd4e4];return _0x18cf3b;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var utils=require(_0x49fd('0x2'));var Mustache=require(_0x49fd('0x3'));var Redis=require(_0x49fd('0x4'));var config=require(_0x49fd('0x5'));var logger=require(_0x49fd('0x6'))(_0x49fd('0x7'));config[_0x49fd('0x8')]=_['defaults'](config['redis'],{'host':_0x49fd('0x9'),'port':0x18eb});var io=require(_0x49fd('0xa'))(new Redis(config[_0x49fd('0x8')]));function emit(_0x9353cd,_0x48b999,_0x14bb94){io['to'](_0x9353cd)[_0x49fd('0xb')](_0x48b999,_0x14bb94);}function sendNotification(_0x36f605,_0x3bf3fd,_0x190807,_0x4a1c47,_0x35034c,_0x130c9b){io['to'](util[_0x49fd('0xc')](_0x49fd('0xd'),_0x4a1c47[_0x49fd('0xe')]))[_0x49fd('0xb')](_0x49fd('0xf'),_0x4a1c47);var _0x53a44e=_0x130c9b||{};var _0x70933e=_0x190807[_0x49fd('0x10')]('.');var _0x426109={'uniqueid':_0x3bf3fd,'channel':_0x70933e[0x0],'id':_0x70933e[0x1],'title':_0x70933e[0x0]+_0x49fd('0x11'),'interactionId':_0x70933e[0x2],'queue':_0x35034c?_0x35034c[_0x49fd('0xe')]:null,'sound':_0x53a44e[_0x49fd('0x12')][_0x49fd('0x13')],'shake':_0x53a44e[_0x49fd('0x12')][_0x49fd('0x14')]};try{if(!_0x53a44e[_0x49fd('0x15')]){_0x53a44e[_0x49fd('0x15')]={};}if(_0x35034c){_0x53a44e[_0x49fd('0x15')][_0x49fd('0x16')]=_0x35034c;}else if(_0x53a44e[_0x49fd('0x15')][_0x49fd('0x16')]){delete _0x53a44e[_0x49fd('0x15')][_0x49fd('0x16')];}_0x426109[_0x49fd('0x17')]=utils[_0x49fd('0x18')](_0x53a44e[_0x49fd('0x12')][_0x49fd('0x19')],_0x53a44e);}catch(_0x23d5ff){_0x426109[_0x49fd('0x17')]=_0x49fd('0x1a');logger[_0x49fd('0x1b')](util[_0x49fd('0xc')]('[%s][QUEUE]\x20%s',_0x3bf3fd,_0x23d5ff[_0x49fd('0x1c')]));}io['to'](util[_0x49fd('0xc')]('user:%s',_0x4a1c47['name']))[_0x49fd('0xb')](util['format'](_0x49fd('0x1d'),_0x36f605?_0x49fd('0x1e'):'remove'),_0x426109);}function writeLog(_0xf7efcf,_0x83ab70,_0x5ae3bc){return logger[_0x49fd('0x1f')](util[_0x49fd('0xc')](_0x49fd('0x20'),_0xf7efcf,_0x83ab70[_0x49fd('0xe')],_0x5ae3bc));}exports[_0x49fd('0x21')]=function(_0x156221,_0x5dc839,_0x46019d,_0xd43815){if(_0x5dc839[_0x49fd('0x22')]){writeLog(_0x156221,_0x5dc839,'BUSY');return![];}if(!_0x5dc839[_0x49fd('0x23')]){writeLog(_0x156221,_0x5dc839,_0x49fd('0x24'));return![];}if(_0x5dc839[_0x46019d+_0x49fd('0x25')]){writeLog(_0x156221,_0x5dc839,'PAUSE');return![];}if(_0xd43815&&_0x5dc839['hasOwnProperty'](_0x46019d+'Capacity')&&_0x5dc839[_0x49fd('0x26')](_0x46019d+_0x49fd('0x27'))){if(_0x5dc839[_0x46019d+_0x49fd('0x28')]>0x0&&_0x5dc839[_0x46019d+_0x49fd('0x27')]>=_0x5dc839[_0x46019d+_0x49fd('0x28')]){writeLog(_0x156221,_0x5dc839,_0x46019d[_0x49fd('0x29')]()+_0x49fd('0x2a'));return![];}}return!![];};exports[_0x49fd('0x2b')]=function(_0x54c8bb,_0x2b2710,_0x52b35d,_0x32fc19,_0x89badc){return sendNotification(!![],_0x54c8bb,_0x2b2710,_0x52b35d,_0x32fc19,_0x89badc);};exports['hideNotification']=function(_0x203038,_0x2c8568,_0x23374c,_0x43826f,_0x404bc1){return sendNotification(![],_0x203038,_0x2c8568,_0x23374c,_0x43826f,_0x404bc1);};exports[_0x49fd('0x2c')]=writeLog;
\ No newline at end of file
+var _0x7b84=['split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7b84,0x17c));var _0x47b8=function(_0x776fdf,_0xabefe5){_0x776fdf=_0x776fdf-0x0;var _0x414e8c=_0x7b84[_0x776fdf];return _0x414e8c;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var utils=require(_0x47b8('0x2'));var Mustache=require(_0x47b8('0x3'));var Redis=require(_0x47b8('0x4'));var config=require(_0x47b8('0x5'));var logger=require(_0x47b8('0x6'))('routing');config[_0x47b8('0x7')]=_[_0x47b8('0x8')](config[_0x47b8('0x7')],{'host':_0x47b8('0x9'),'port':0x18eb});var io=require(_0x47b8('0xa'))(new Redis(config[_0x47b8('0x7')]));function emit(_0x53e656,_0x3867ca,_0x3ce846){io['to'](_0x53e656)[_0x47b8('0xb')](_0x3867ca,_0x3ce846);}function sendNotification(_0xb845c9,_0x2289d5,_0x1af17f,_0x24d240,_0x4570d4,_0x9414c2){io['to'](util[_0x47b8('0xc')](_0x47b8('0xd'),_0x24d240[_0x47b8('0xe')]))[_0x47b8('0xb')](_0x47b8('0xf'),_0x24d240);var _0x3e255e=_0x9414c2||{};var _0x2a1af3=_0x1af17f[_0x47b8('0x10')]('.');var _0x2a10d2={'uniqueid':_0x2289d5,'channel':_0x2a1af3[0x0],'id':_0x2a1af3[0x1],'title':_0x2a1af3[0x0]+_0x47b8('0x11'),'interactionId':_0x2a1af3[0x2],'queue':_0x4570d4?_0x4570d4[_0x47b8('0xe')]:null,'sound':_0x3e255e[_0x47b8('0x12')][_0x47b8('0x13')],'shake':_0x3e255e[_0x47b8('0x12')][_0x47b8('0x14')]};try{if(!_0x3e255e[_0x47b8('0x15')]){_0x3e255e[_0x47b8('0x15')]={};}if(_0x4570d4){_0x3e255e[_0x47b8('0x15')]['queue']=_0x4570d4;}else if(_0x3e255e[_0x47b8('0x15')][_0x47b8('0x16')]){delete _0x3e255e[_0x47b8('0x15')][_0x47b8('0x16')];}_0x2a10d2[_0x47b8('0x17')]=utils[_0x47b8('0x18')](_0x3e255e[_0x47b8('0x12')]['notificationTemplate'],_0x3e255e);}catch(_0x3cc9d9){_0x2a10d2['msg']='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x47b8('0xc')](_0x47b8('0x19'),_0x2289d5,_0x3cc9d9[_0x47b8('0x1a')]));}io['to'](util['format']('user:%s',_0x24d240['name']))[_0x47b8('0xb')](util['format'](_0x47b8('0x1b'),_0xb845c9?_0x47b8('0x1c'):_0x47b8('0x1d')),_0x2a10d2);}function writeLog(_0xfccf56,_0x4eba33,_0xc20df1){return logger[_0x47b8('0x1e')](util[_0x47b8('0xc')](_0x47b8('0x1f'),_0xfccf56,_0x4eba33[_0x47b8('0xe')],_0xc20df1));}exports[_0x47b8('0x20')]=function(_0x54f6bc,_0x31555d,_0x2a22e3,_0x5301f8){if(_0x31555d[_0x47b8('0x21')]){writeLog(_0x54f6bc,_0x31555d,_0x47b8('0x22'));return![];}if(!_0x31555d[_0x47b8('0x23')]){writeLog(_0x54f6bc,_0x31555d,_0x47b8('0x24'));return![];}if(_0x31555d[_0x2a22e3+'Pause']){writeLog(_0x54f6bc,_0x31555d,_0x47b8('0x25'));return![];}if(_0x5301f8&&_0x31555d[_0x47b8('0x26')](_0x2a22e3+_0x47b8('0x27'))&&_0x31555d[_0x47b8('0x26')](_0x2a22e3+_0x47b8('0x28'))){if(_0x31555d[_0x2a22e3+_0x47b8('0x27')]>0x0&&_0x31555d[_0x2a22e3+_0x47b8('0x28')]>=_0x31555d[_0x2a22e3+'Capacity']){writeLog(_0x54f6bc,_0x31555d,_0x2a22e3[_0x47b8('0x29')]()+_0x47b8('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0){return sendNotification(!![],_0x195a66,_0x6d517a,_0x147878,_0x3dcf1a,_0x4da0e0);};exports[_0x47b8('0x2b')]=function(_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d){return sendNotification(![],_0x5c347f,_0x2c89fc,_0x2255ab,_0x33e653,_0x2e540d);};exports['writeLog']=writeLog;
\ No newline at end of file
index 45e8871..a72c447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8c4=['body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x4ed4ec,_0xe2c2d1){var _0x472596=function(_0x3dbef6){while(--_0x3dbef6){_0x4ed4ec['push'](_0x4ed4ec['shift']());}};_0x472596(++_0xe2c2d1);}(_0xd8c4,0x1a2));var _0x4d8c=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd8c4[_0x199572];return _0x13cfa3;};'use strict';var schema=require(_0x4d8c('0x0'));var sh=require(_0x4d8c('0x1'));var _=require('lodash');var utils=require(_0x4d8c('0x2'));var logger=require('../../../../config/logger')(_0x4d8c('0x3'));var system=schema({'command':{'type':_0x4d8c('0x4'),'required':!![],'message':_0x4d8c('0x5')}});exports['consequence']=function(_0x384671,_0x256d7a){return function(_0x49085a){try{var _0x2dacbf={'command':_0x256d7a[0x0]};var _0x2fe530=system[_0x4d8c('0x0')](_0x2dacbf,{'typecast':!![]});if(_0x2fe530[_0x4d8c('0x6')]){logger[_0x4d8c('0x7')](_0x4d8c('0x8'),_0x384671,_['map'](_0x2fe530,_0x4d8c('0x9'))[_0x4d8c('0xa')](',\x20'));logger[_0x4d8c('0xb')](_0x4d8c('0xc'),_0x384671);_0x49085a[_0x4d8c('0xd')]();}else{var _0x58976c=this;var _0x24f128=utils['getMustacheRender'](_0x256d7a[0x0],this);logger[_0x4d8c('0xb')](_0x4d8c('0xe'),_0x384671,_0x24f128);sh[_0x4d8c('0xf')](_['trim'](_0x24f128),function(_0x40e455,_0x3e3b10){logger[_0x4d8c('0xb')](_0x4d8c('0x10'),_0x384671,_0x40e455);if(_0x40e455==0x0){var _0xd19649=_0x3e3b10[_0x4d8c('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x4d8c('0x12')](_0x256d7a[0x1])||_['isEmpty'](_0x256d7a[0x1])){logger[_0x4d8c('0xb')]('[%s][SYSTEM]\x20no\x20variable',_0x384671);_0x58976c[_0x4d8c('0x13')][_0x256d7a[0x1]]=_0xd19649;}else{logger[_0x4d8c('0xb')](_0x4d8c('0x14'),_0x384671,_0x256d7a[0x1],_0xd19649);_0x58976c[_0x4d8c('0x13')][_0x256d7a[0x1]]=_0xd19649;}}_0x49085a[_0x4d8c('0xd')]();});}}catch(_0x558c1c){logger['error'](_0x4d8c('0x8'),_0x384671,_[_0x4d8c('0x15')](_0x558c1c)?JSON[_0x4d8c('0x16')](_0x558c1c):_0x558c1c);logger[_0x4d8c('0xb')](_0x4d8c('0xc'),_0x384671);_0x49085a[_0x4d8c('0xd')]();}};};
\ No newline at end of file
+var _0xe3cb=['./utils','../../../../config/logger','routing','string','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','body','next','isObject','stringify','validate','shelljs','lodash'];(function(_0x366c24,_0x717d6c){var _0x1d32c1=function(_0x2c04fa){while(--_0x2c04fa){_0x366c24['push'](_0x366c24['shift']());}};_0x1d32c1(++_0x717d6c);}(_0xe3cb,0xd5));var _0xbe3c=function(_0x4e54db,_0x1ca2f8){_0x4e54db=_0x4e54db-0x0;var _0x80db36=_0xe3cb[_0x4e54db];return _0x80db36;};'use strict';var schema=require(_0xbe3c('0x0'));var sh=require(_0xbe3c('0x1'));var _=require(_0xbe3c('0x2'));var utils=require(_0xbe3c('0x3'));var logger=require(_0xbe3c('0x4'))(_0xbe3c('0x5'));var system=schema({'command':{'type':_0xbe3c('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x56262d,_0x2eddf6){return function(_0x4413c9){try{var _0x1ee23e={'command':_0x2eddf6[0x0]};var _0x9ffc9b=system['validate'](_0x1ee23e,{'typecast':!![]});if(_0x9ffc9b[_0xbe3c('0x7')]){logger[_0xbe3c('0x8')](_0xbe3c('0x9'),_0x56262d,_[_0xbe3c('0xa')](_0x9ffc9b,_0xbe3c('0xb'))[_0xbe3c('0xc')](',\x20'));logger[_0xbe3c('0xd')](_0xbe3c('0xe'),_0x56262d);_0x4413c9['next']();}else{var _0x16bab0=this;var _0x45a039=utils['getMustacheRender'](_0x2eddf6[0x0],this);logger[_0xbe3c('0xd')](_0xbe3c('0xf'),_0x56262d,_0x45a039);sh['exec'](_[_0xbe3c('0x10')](_0x45a039),function(_0x22a413,_0x439efc){logger[_0xbe3c('0xd')](_0xbe3c('0x11'),_0x56262d,_0x22a413);if(_0x22a413==0x0){var _0x532c24=_0x439efc[_0xbe3c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xbe3c('0x13')](_0x2eddf6[0x1])||_['isEmpty'](_0x2eddf6[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x56262d);_0x16bab0[_0xbe3c('0x14')][_0x2eddf6[0x1]]=_0x532c24;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x56262d,_0x2eddf6[0x1],_0x532c24);_0x16bab0[_0xbe3c('0x14')][_0x2eddf6[0x1]]=_0x532c24;}}_0x4413c9[_0xbe3c('0x15')]();});}}catch(_0x3ced77){logger[_0xbe3c('0x8')](_0xbe3c('0x9'),_0x56262d,_[_0xbe3c('0x16')](_0x3ced77)?JSON[_0xbe3c('0x17')](_0x3ced77):_0x3ced77);logger[_0xbe3c('0xd')](_0xbe3c('0xe'),_0x56262d);_0x4413c9[_0xbe3c('0x15')]();}};};
\ No newline at end of file
index e87037e..6b08d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef56=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','finally','isObject','stringify','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x5da3ba,_0x298c06){var _0x5bc63b=function(_0x3defcf){while(--_0x3defcf){_0x5da3ba['push'](_0x5da3ba['shift']());}};_0x5bc63b(++_0x298c06);}(_0xef56,0x74));var _0x6ef5=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xef56[_0x1793de];return _0x4f0309;};'use strict';var schema=require(_0x6ef5('0x0'));var _=require(_0x6ef5('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6ef5('0x2')),'smsInteraction':require(_0x6ef5('0x3')),'mailInteraction':require(_0x6ef5('0x4')),'faxInteraction':require(_0x6ef5('0x5')),'whatsappInteraction':require(_0x6ef5('0x6'))};var logger=require(_0x6ef5('0x7'))(_0x6ef5('0x8'));var tag=schema({'tag':{'type':_0x6ef5('0x9'),'required':!![],'message':_0x6ef5('0xa')}});exports[_0x6ef5('0xb')]=function(_0x163a3f,_0x32c779,_0x4ba562,_0x1d08e7){return function(_0x6ee940){try{var _0x3ddbef={'tag':_0x32c779[0x0]};var _0x172418=tag[_0x6ef5('0x0')](_0x3ddbef,{'typecast':!![]});if(_0x172418['length']){logger[_0x6ef5('0xc')]('[%s][TAG]\x20%s',_0x163a3f,_[_0x6ef5('0xd')](_0x172418,_0x6ef5('0xe'))[_0x6ef5('0xf')](',\x20'));logger[_0x6ef5('0x10')](_0x6ef5('0x11'),_0x163a3f);_0x6ee940[_0x6ef5('0x12')]();}else{var _0x5b7fff={'ids':[_0x32c779[0x0]]};if(rpc[_0x1d08e7[_0x6ef5('0x13')]+_0x6ef5('0x14')]){rpc[_0x1d08e7[_0x6ef5('0x13')]+_0x6ef5('0x14')][_0x6ef5('0x15')](_0x1d08e7[_0x6ef5('0x16')]['id'],_0x5b7fff)[_0x6ef5('0x17')](function(_0x650693){logger[_0x6ef5('0x10')](_0x6ef5('0x18'),_0x163a3f,_0x32c779[0x1],_0x1d08e7['channel'],_0x1d08e7['interaction']['id']);})[_0x6ef5('0x19')](function(_0x40442b){logger[_0x6ef5('0xc')](_0x6ef5('0x1a'),_0x163a3f,JSON['stringify'](_0x40442b));logger[_0x6ef5('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x163a3f);})[_0x6ef5('0x1b')](function(){_0x6ee940['next']();});}}}catch(_0x123dd2){logger[_0x6ef5('0xc')](_0x6ef5('0x1a'),_0x163a3f,_[_0x6ef5('0x1c')](_0x123dd2)?JSON[_0x6ef5('0x1d')](_0x123dd2):_0x123dd2);logger['info'](_0x6ef5('0x11'),_0x163a3f);_0x6ee940['next']();}};};
\ No newline at end of file
+var _0xd76b=['../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x386600,_0x18dd88){var _0x537eed=function(_0x5688fd){while(--_0x5688fd){_0x386600['push'](_0x386600['shift']());}};_0x537eed(++_0x18dd88);}(_0xd76b,0xa4));var _0xbd76=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xd76b[_0x565c49];return _0x20ca34;};'use strict';var schema=require(_0xbd76('0x0'));var _=require(_0xbd76('0x1'));var rpc={'chatInteraction':require(_0xbd76('0x2')),'openchannelInteraction':require(_0xbd76('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xbd76('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xbd76('0x5'))};var logger=require(_0xbd76('0x6'))(_0xbd76('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0xbd76('0x8')}});exports[_0xbd76('0x9')]=function(_0x214188,_0x1060e6,_0x507709,_0x5ba419){return function(_0x313ba4){try{var _0x380999={'tag':_0x1060e6[0x0]};var _0x4d7d41=tag[_0xbd76('0x0')](_0x380999,{'typecast':!![]});if(_0x4d7d41[_0xbd76('0xa')]){logger[_0xbd76('0xb')](_0xbd76('0xc'),_0x214188,_['map'](_0x4d7d41,'message')['join'](',\x20'));logger[_0xbd76('0xd')](_0xbd76('0xe'),_0x214188);_0x313ba4[_0xbd76('0xf')]();}else{var _0x6965b5={'ids':[_0x1060e6[0x0]]};if(rpc[_0x5ba419[_0xbd76('0x10')]+_0xbd76('0x11')]){rpc[_0x5ba419['channel']+_0xbd76('0x11')][_0xbd76('0x12')](_0x5ba419[_0xbd76('0x13')]['id'],_0x6965b5)[_0xbd76('0x14')](function(_0x926b17){logger[_0xbd76('0xd')](_0xbd76('0x15'),_0x214188,_0x1060e6[0x1],_0x5ba419[_0xbd76('0x10')],_0x5ba419['interaction']['id']);})['catch'](function(_0x5a2967){logger[_0xbd76('0xb')]('[%s][TAG]\x20%s',_0x214188,JSON[_0xbd76('0x16')](_0x5a2967));logger[_0xbd76('0xd')](_0xbd76('0xe'),_0x214188);})[_0xbd76('0x17')](function(){_0x313ba4[_0xbd76('0xf')]();});}}}catch(_0x2eeef9){logger[_0xbd76('0xb')](_0xbd76('0xc'),_0x214188,_['isObject'](_0x2eeef9)?JSON['stringify'](_0x2eeef9):_0x2eeef9);logger[_0xbd76('0xd')](_0xbd76('0xe'),_0x214188);_0x313ba4['next']();}};};
\ No newline at end of file
index 5791276..4561566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x34b429,_0x388475){var _0x3611b3=function(_0x168c24){while(--_0x168c24){_0x34b429['push'](_0x34b429['shift']());}};_0x3611b3(++_0x388475);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
+var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x32af8e,_0x44b7ce){var _0x48bb84=function(_0x4af7b9){while(--_0x4af7b9){_0x32af8e['push'](_0x32af8e['shift']());}};_0x48bb84(++_0x44b7ce);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}};
\ No newline at end of file
index 920135f..728f284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68c1=['amazonlex','%s:%s:%s','app','condition','intervals','./applications/','priority','Push\x20new\x20rule','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','error','stack','agent','agents','busy','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','chatQueues','available','paused','waiting','mailQueues','name','openchannelQueues','smsQueues','loggedIn','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','.js','toLowerCase','autoreply','split','mail','push','slice','dialogflow','dialogflowv2','appdata'];(function(_0x3cb7e8,_0xb8f77){var _0x72798f=function(_0x114662){while(--_0x114662){_0x3cb7e8['push'](_0x3cb7e8['shift']());}};_0x72798f(++_0xb8f77);}(_0x68c1,0x19d));var _0x168c=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0x68c1[_0x9bca53];return _0x3894bc;};'use strict';var _=require(_0x168c('0x0'));var util=require('util');var path=require(_0x168c('0x1'));var fs=require('fs');var jayson=require(_0x168c('0x2'));var BPromise=require(_0x168c('0x3'));var uuid=require('uuid');var config=require(_0x168c('0x4'));var logger=require(_0x168c('0x5'))(_0x168c('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x168c('0x7')),'chatQueueReport':require(_0x168c('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x168c('0x9')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x168c('0xa'));function getId(_0x38a40b,_0x577263,_0x368b62){return util[_0x168c('0xb')](_0x168c('0xc'),_0x38a40b,_0x577263||0x0,_0x368b62||0x0);}function getIntervals(_0x598d35,_0x2ad297){var _0x4243d4=[];if(!_[_0x168c('0xd')](_0x2ad297['IntervalId'])&&!_['isNil'](_0x598d35[_0x2ad297[_0x168c('0xe')]])&&!_[_0x168c('0xd')](_0x598d35[_0x2ad297[_0x168c('0xe')]][_0x168c('0xf')])){_0x4243d4=_[_0x168c('0x10')](_0x598d35[_0x2ad297[_0x168c('0xe')]][_0x168c('0xf')],'interval');}else if(!_[_0x168c('0xd')](_0x2ad297[_0x168c('0x11')])){_0x4243d4=[_0x2ad297[_0x168c('0x11')]];}return _0x4243d4;}exports[_0x168c('0x12')]=function(_0x24e6e1){_0x24e6e1[_0x168c('0x13')]={};return new BPromise(function(_0x57c575,_0x579f77){var _0x540dd1={'Start':function(_0x38085d){var _0x16fd25=this;return new Promise(function(_0xdf64d5,_0x435110){if(_0x38085d){try{var _0x542a10=[];var _0x26151d=getId(_0x38085d[_0x168c('0x14')],_0x38085d['message']?_0x38085d[_0x168c('0x15')]['id']:0x0,_0x38085d[_0x168c('0x16')]?_0x38085d['interaction']['id']:0x0);if(_0x38085d[_0x168c('0x17')]&&_['isArray'](_0x38085d[_0x168c('0x17')])&&_0x38085d[_0x168c('0x17')][_0x168c('0x18')]){for(var _0x2318c5=0x0;_0x2318c5<_0x38085d[_0x168c('0x17')]['length'];_0x2318c5+=0x1){var _0x2e3a21=_0x38085d['applications'][_0x2318c5];if(fs[_0x168c('0x19')](path[_0x168c('0x1a')](__dirname,_0x168c('0x17'),_0x2e3a21['app']+_0x168c('0x1b')))){var _0x433918=[];switch(_0x2e3a21['app'][_0x168c('0x1c')]()){case _0x168c('0x1d'):var _0xf110a7=_0x2e3a21['appdata'][_0x168c('0x1e')](',');if(_0x38085d[_0x168c('0x14')]===_0x168c('0x1f')){_0x433918['push'](_0xf110a7[0x0]);_0x433918[_0x168c('0x20')](_0xf110a7[0x1]);_0x433918[_0x168c('0x20')](_0xf110a7[_0x168c('0x21')](0x2,_0xf110a7[_0x168c('0x18')])['join'](','));}else{_0x433918[_0x168c('0x20')](_0xf110a7[0x0]);_0x433918[_0x168c('0x20')](_0xf110a7[_0x168c('0x21')](0x1,_0xf110a7['length'])[_0x168c('0x1a')](','));}break;case _0x168c('0x22'):var _0x33f4fe=_0x2e3a21['appdata'][_0x168c('0x1e')](',');_0x433918[_0x168c('0x20')](_0x33f4fe[0x0]);_0x433918[_0x168c('0x20')](_0x33f4fe[0x1]);_0x433918[_0x168c('0x20')](_0x33f4fe[_0x168c('0x21')](0x2,_0x33f4fe[_0x168c('0x18')])[_0x168c('0x1a')](','));break;case _0x168c('0x23'):var _0x142fd2=_0x2e3a21[_0x168c('0x24')]['split'](',');_0x433918[_0x168c('0x20')](_0x142fd2[0x0]);_0x433918[_0x168c('0x20')](_0x142fd2[0x1]);_0x433918[_0x168c('0x20')](_0x142fd2[0x2]);_0x433918[_0x168c('0x20')](_0x142fd2[0x3]);_0x433918[_0x168c('0x20')](_0x142fd2[_0x168c('0x21')](0x4,_0x142fd2[_0x168c('0x18')])[_0x168c('0x1a')](','));break;case _0x168c('0x25'):var _0x1e4638=_0x2e3a21['appdata'][_0x168c('0x1e')](',');_0x433918[_0x168c('0x20')](_0x1e4638[0x0]);_0x433918[_0x168c('0x20')](_0x1e4638[0x1]);_0x433918[_0x168c('0x20')](_0x1e4638[0x2]);_0x433918[_0x168c('0x20')](_0x1e4638[0x3]);_0x433918['push'](_0x1e4638[_0x168c('0x21')](0x4,_0x1e4638[_0x168c('0x18')])[_0x168c('0x1a')](','));break;case'message':_0x433918[_0x168c('0x20')](_0x2e3a21[_0x168c('0x24')]);break;case'tag':_0x433918[_0x168c('0x20')](_0x2e3a21['TagId']);_0x433918[_0x168c('0x20')](_0x2e3a21[_0x168c('0x24')]);break;default:_0x433918=_['isNil'](_0x2e3a21[_0x168c('0x24')])?[]:_0x2e3a21['appdata'][_0x168c('0x1e')](',');}var _0x3fc05e={'id':util['format'](_0x168c('0x26'),_0x26151d,_0x2e3a21['id'],_0x2e3a21[_0x168c('0x27')]),'condition':require('./interval')[_0x168c('0x28')](_0x26151d,getIntervals(_0x24e6e1[_0x168c('0x29')],_0x2e3a21),_0x24e6e1),'consequence':require(_0x168c('0x2a')+_0x2e3a21[_0x168c('0x27')])['consequence'](_0x26151d,_0x433918,_0x24e6e1,_0x38085d),'p':_0x2e3a21[_0x168c('0x2b')]||0x0};logger['info'](_0x168c('0x2c'),_0x3fc05e['id'],'on\x20interval',getIntervals(_0x24e6e1[_0x168c('0x29')],_0x2e3a21)['join']('\x20|\x20'));_0x542a10[_0x168c('0x20')](_0x3fc05e);}else{logger['error'](_0x168c('0x2d'),path[_0x168c('0x1a')](__dirname,_0x168c('0x17'),_0x2e3a21[_0x168c('0x27')]+'.js'));}}_0x24e6e1['rules'][_0x26151d]=new RuleEngine(_0x542a10);_0x24e6e1['rules'][_0x26151d][_0x168c('0x2e')](_0x38085d,function(_0x50c18a){logger[_0x168c('0x2f')](_0x168c('0x30'),JSON[_0x168c('0x31')](_0x50c18a[_0x168c('0x32')]));if(_0x24e6e1[_0x168c('0x13')][_0x26151d]){_0x24e6e1[_0x168c('0x13')][_0x26151d]['emit'](_0x168c('0x33'));}});return _0xdf64d5({'code':0xc8,'message':_0x38085d});}else{logger[_0x168c('0x2f')](_0x168c('0x34'));return _0xdf64d5({'code':0xc8,'message':_0x38085d});}}catch(_0x1cf769){logger[_0x168c('0x35')](_0x1cf769[_0x168c('0x36')]);return _0x435110(_0x16fd25['error'](0x1f4,_0x1cf769));}}return _0x435110('routing\x20is\x20empty');});},'AcceptMessage':function(_0xfbc08){var _0x5c7a4a=this;return new Promise(function(_0x5a9e40,_0x5e7ea2){if(_0xfbc08[_0x168c('0x37')]&&_0xfbc08[_0x168c('0x37')]['id']){if(_0x24e6e1['agents'][_0xfbc08['agent']['id']]){_0x24e6e1[_0x168c('0x38')][_0xfbc08['agent']['id']][_0x168c('0x39')]=![];_0x24e6e1['agents'][_0xfbc08['agent']['id']]['busyQueue']=undefined;}}if(_0xfbc08[_0x168c('0x15')]&&_0xfbc08['message']['id']){try{var _0x4ba3f6=getId(_0xfbc08[_0x168c('0x14')],_0xfbc08[_0x168c('0x15')]?_0xfbc08['message']['id']:0x0,_0xfbc08[_0x168c('0x16')]?_0xfbc08['interaction']['id']:0x0);if(_0x24e6e1['rules'][_0x4ba3f6]){_0x24e6e1['rules'][_0x4ba3f6][_0x168c('0x3a')](_0x168c('0x3b'));if(rpc[_0xfbc08[_0x168c('0x14')]+_0x168c('0x3c')]){rpc[_0xfbc08['channel']+'QueueReport'][_0x168c('0x3d')](_0x4ba3f6,{'UserId':_0xfbc08[_0x168c('0x15')][_0x168c('0x3e')]})[_0x168c('0x3f')](function(_0x4154a1){logger[_0x168c('0x35')](_0x168c('0x40'));});}}return _0x5a9e40({'code':0xc8,'message':_0xfbc08});}catch(_0x601fae){logger[_0x168c('0x35')](_0x601fae[_0x168c('0x36')]);return _0x5e7ea2(_0x5c7a4a[_0x168c('0x35')](0x1f4,_0x601fae));}}logger[_0x168c('0x35')](_0x168c('0x41'));return _0x5e7ea2(_0x5c7a4a[_0x168c('0x35')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2ee8c7){var _0xf72cec=this;return new Promise(function(_0x2f96d3,_0x27e992){if(_0x2ee8c7[_0x168c('0x37')]&&_0x2ee8c7[_0x168c('0x37')]['id']){try{if(_0x24e6e1[_0x168c('0x38')][_0x2ee8c7[_0x168c('0x37')]['id']]){_0x24e6e1[_0x168c('0x38')][_0x2ee8c7[_0x168c('0x37')]['id']][_0x168c('0x39')]=![];_0x24e6e1[_0x168c('0x38')][_0x2ee8c7['agent']['id']]['busyQueue']=undefined;}return _0x2f96d3({'code':0xc8,'message':_0x2ee8c7});}catch(_0x2ae441){logger[_0x168c('0x35')](_0x2ae441[_0x168c('0x36')]);return _0x27e992(_0xf72cec[_0x168c('0x35')](0x1f4,_0x2ae441));}}logger[_0x168c('0x35')]('message\x20is\x20empty');return _0x27e992(_0xf72cec['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x32a09a){var _0x5c099a=this;return new Promise(function(_0x4cd0ad,_0x1dbb7c){if(_0x32a09a['channel']&&_0x32a09a[_0x168c('0x16')]&&_0x32a09a[_0x168c('0x16')]['id']){try{var _0x196921=getId(_0x32a09a[_0x168c('0x14')],_0x32a09a[_0x168c('0x15')]?_0x32a09a[_0x168c('0x15')]['id']:0x0,_0x32a09a[_0x168c('0x16')]?_0x32a09a[_0x168c('0x16')]['id']:0x0);if(_0x24e6e1[_0x168c('0x13')][_0x196921]){_0x24e6e1[_0x168c('0x13')][_0x196921][_0x168c('0x3a')](_0x168c('0x3b'));}return _0x4cd0ad({'code':0xc8,'message':_0x32a09a});}catch(_0x542c05){logger['error'](_0x542c05[_0x168c('0x36')]);return _0x1dbb7c(_0x5c099a[_0x168c('0x35')](0x1f4,_0x542c05));}}logger[_0x168c('0x35')](_0x168c('0x41'));return _0x1dbb7c(_0x5c099a[_0x168c('0x35')](0x1f4,_0x168c('0x41')));});},'AgentCapacity':function(_0x33c919){var _0x34f1dc=this;return new Promise(function(_0x5e2549,_0x14507c){if(_0x24e6e1[_0x168c('0x38')][_0x168c('0x42')](_0x33c919['id'])){for(var _0xe878ca in _0x33c919[_0x168c('0x43')]){if(_0x33c919[_0x168c('0x43')][_0x168c('0x42')](_0xe878ca)){if(_0x24e6e1[_0x168c('0x38')][_0x33c919['id']]['hasOwnProperty'](_0xe878ca+_0x168c('0x44'))){_0x24e6e1[_0x168c('0x38')][_0x33c919['id']][_0xe878ca+_0x168c('0x44')]=parseInt(_0x33c919[_0x168c('0x43')][_0xe878ca],0xa);}}}_0x24e6e1['agents'][_0x33c919['id']]['updateRealtime']();return _0x5e2549({'code':0xc8,'message':_0x24e6e1[_0x168c('0x38')][_0x33c919['id']]});}else{return _0x14507c(_0x34f1dc['error'](0x1f4,_0x168c('0x45')));}});},'Agents':function(_0x44950b){return new Promise(function(_0x3d9629,_0x266a7b){var _0x16e819=_['values'](_0x24e6e1[_0x168c('0x38')]);_0x3d9629({'count':_0x16e819[_0x168c('0x18')],'rows':_0x16e819});});},'ChatQueues':function(_0x503741){return new Promise(function(_0x5dd089,_0x33b3e6){var _0x2ee060=[];for(var _0x5a63d7 in _0x24e6e1[_0x168c('0x46')]){if(_0x24e6e1[_0x168c('0x46')][_0x168c('0x42')](_0x5a63d7)){var _0x28c79c=_0x24e6e1[_0x168c('0x46')][_0x5a63d7];var _0xeacf74={'id':_0x28c79c['id'],'available':_0x28c79c[_0x168c('0x47')],'loggedIn':_0x28c79c['loggedIn'],'name':_0x28c79c['name'],'paused':_0x28c79c[_0x168c('0x48')],'waiting':_0x28c79c[_0x168c('0x49')]};_0x2ee060[_0x168c('0x20')](_0xeacf74);}}_0x5dd089({'count':_0x2ee060['length'],'rows':_0x2ee060});});},'MailQueues':function(_0x5a3bb1){return new Promise(function(_0x1fa7e0,_0x11085b){var _0x3fd4f3=[];for(var _0x5865fc in _0x24e6e1['mailQueues']){if(_0x24e6e1[_0x168c('0x4a')]['hasOwnProperty'](_0x5865fc)){var _0x45a7f0=_0x24e6e1[_0x168c('0x4a')][_0x5865fc];var _0x269413={'id':_0x45a7f0['id'],'available':_0x45a7f0['available'],'loggedIn':_0x45a7f0['loggedIn'],'name':_0x45a7f0[_0x168c('0x4b')],'paused':_0x45a7f0['paused'],'waiting':_0x45a7f0[_0x168c('0x49')]};_0x3fd4f3['push'](_0x269413);}}_0x1fa7e0({'count':_0x3fd4f3['length'],'rows':_0x3fd4f3});});},'OpenchannelQueues':function(_0x28c7f3){return new Promise(function(_0x1ab7d2,_0x334aaa){var _0x301b55=[];for(var _0x541bc in _0x24e6e1['openchannelQueues']){if(_0x24e6e1[_0x168c('0x4c')][_0x168c('0x42')](_0x541bc)){var _0x149a03=_0x24e6e1[_0x168c('0x4c')][_0x541bc];var _0x1b0e2c={'id':_0x149a03['id'],'available':_0x149a03[_0x168c('0x47')],'loggedIn':_0x149a03['loggedIn'],'name':_0x149a03[_0x168c('0x4b')],'paused':_0x149a03[_0x168c('0x48')],'waiting':_0x149a03['waiting']};_0x301b55[_0x168c('0x20')](_0x1b0e2c);}}_0x1ab7d2({'count':_0x301b55['length'],'rows':_0x301b55});});},'SmsQueues':function(_0x1f39f1){return new Promise(function(_0x15a227,_0x346bfa){var _0x280945=[];for(var _0x2699bf in _0x24e6e1[_0x168c('0x4d')]){if(_0x24e6e1['smsQueues']['hasOwnProperty'](_0x2699bf)){var _0x321c9d=_0x24e6e1[_0x168c('0x4d')][_0x2699bf];var _0x3d36cc={'id':_0x321c9d['id'],'available':_0x321c9d[_0x168c('0x47')],'loggedIn':_0x321c9d[_0x168c('0x4e')],'name':_0x321c9d[_0x168c('0x4b')],'paused':_0x321c9d[_0x168c('0x48')],'waiting':_0x321c9d[_0x168c('0x49')]};_0x280945[_0x168c('0x20')](_0x3d36cc);}}_0x15a227({'count':_0x280945[_0x168c('0x18')],'rows':_0x280945});});},'FaxQueues':function(_0x19e4af){return new Promise(function(_0x19b2c2,_0x67e057){var _0x2815f1=[];for(var _0x2240ee in _0x24e6e1[_0x168c('0x4f')]){if(_0x24e6e1['faxQueues'][_0x168c('0x42')](_0x2240ee)){var _0xbab289=_0x24e6e1[_0x168c('0x4f')][_0x2240ee];var _0x4292fd={'id':_0xbab289['id'],'available':_0xbab289[_0x168c('0x47')],'loggedIn':_0xbab289['loggedIn'],'name':_0xbab289[_0x168c('0x4b')],'paused':_0xbab289[_0x168c('0x48')],'waiting':_0xbab289[_0x168c('0x49')]};_0x2815f1[_0x168c('0x20')](_0x4292fd);}}_0x19b2c2({'count':_0x2815f1[_0x168c('0x18')],'rows':_0x2815f1});});},'WhatsappQueues':function(_0xacd354){return new Promise(function(_0x5292e8,_0x27449a){var _0x2ca93d=[];for(var _0x9401ec in _0x24e6e1['whatsappQueues']){if(_0x24e6e1[_0x168c('0x50')][_0x168c('0x42')](_0x9401ec)){var _0x5c7059=_0x24e6e1[_0x168c('0x50')][_0x9401ec];var _0x128e32={'id':_0x5c7059['id'],'available':_0x5c7059['available'],'loggedIn':_0x5c7059[_0x168c('0x4e')],'name':_0x5c7059[_0x168c('0x4b')],'paused':_0x5c7059[_0x168c('0x48')],'waiting':_0x5c7059[_0x168c('0x49')]};_0x2ca93d[_0x168c('0x20')](_0x128e32);}}_0x5292e8({'count':_0x2ca93d[_0x168c('0x18')],'rows':_0x2ca93d});});},'ChatQueuesWaitingInteractions':function(_0x55f87b){return new Promise(function(_0x4b2b4d,_0x2b3f9d){var _0x57cbd5=_[_0x168c('0x51')](_0x24e6e1[_0x168c('0x52')]);_0x4b2b4d({'count':_0x57cbd5[_0x168c('0x18')],'rows':_0x57cbd5});});},'MailQueuesWaitingInteractions':function(_0x4cfda1){return new Promise(function(_0x4f9594,_0x12c1bd){var _0x3a9861=_[_0x168c('0x51')](_0x24e6e1['mailQueuesWaitingInteractions']);_0x4f9594({'count':_0x3a9861[_0x168c('0x18')],'rows':_0x3a9861});});},'OpenchannelQueuesWaitingInteractions':function(_0x414f81){return new Promise(function(_0x191f56,_0x4b1f6e){var _0xce1731=_[_0x168c('0x51')](_0x24e6e1[_0x168c('0x53')]);_0x191f56({'count':_0xce1731[_0x168c('0x18')],'rows':_0xce1731});});},'SmsQueuesWaitingInteractions':function(_0x413993){return new Promise(function(_0x3b60bd,_0x556cb1){var _0x124635=_['values'](_0x24e6e1['smsQueuesWaitingInteractions']);_0x3b60bd({'count':_0x124635['length'],'rows':_0x124635});});},'FaxQueuesWaitingInteractions':function(_0x312563){return new Promise(function(_0x5449af,_0x3c96a9){var _0x4ba5e6=_[_0x168c('0x51')](_0x24e6e1[_0x168c('0x54')]);_0x5449af({'count':_0x4ba5e6[_0x168c('0x18')],'rows':_0x4ba5e6});});},'WhatsappQueuesWaitingInteractions':function(_0xd8768f){return new Promise(function(_0x2771e3,_0x4658fa){var _0x1276f8=_['values'](_0x24e6e1['whatsappQueuesWaitingInteractions']);_0x2771e3({'count':_0x1276f8[_0x168c('0x18')],'rows':_0x1276f8});});}};var _0x260bf3=jayson[_0x168c('0x55')](_0x540dd1)[_0x168c('0x56')]();_0x260bf3['on']('error',function(_0x351ab8){logger[_0x168c('0x35')](JSON[_0x168c('0x31')](_0x351ab8));return _0x579f77(_0x351ab8);});_0x260bf3['listen'](0x232c,_0x168c('0x57'),function(){console[_0x168c('0x58')](_0x168c('0x59'),0x232c);return _0x57c575('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0x4b55=['available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','message','tag','TagId','./interval','condition','intervals','./applications/','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues'];(function(_0x393f59,_0x27faa4){var _0x55eca2=function(_0x261e69){while(--_0x261e69){_0x393f59['push'](_0x393f59['shift']());}};_0x55eca2(++_0x27faa4);}(_0x4b55,0xcc));var _0x54b5=function(_0x1d344b,_0x3a2a0a){_0x1d344b=_0x1d344b-0x0;var _0x4f3b20=_0x4b55[_0x1d344b];return _0x4f3b20;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x54b5('0x0'));var fs=require('fs');var jayson=require(_0x54b5('0x1'));var BPromise=require(_0x54b5('0x2'));var uuid=require(_0x54b5('0x3'));var config=require(_0x54b5('0x4'));var logger=require(_0x54b5('0x5'))(_0x54b5('0x6'));var rpc={'openchannelQueueReport':require(_0x54b5('0x7')),'mailQueueReport':require(_0x54b5('0x8')),'chatQueueReport':require(_0x54b5('0x9')),'smsQueueReport':require(_0x54b5('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x54b5('0xb'))};var RuleEngine=require(_0x54b5('0xc'));function getId(_0x492cd2,_0x1b2491,_0x127e59){return util[_0x54b5('0xd')](_0x54b5('0xe'),_0x492cd2,_0x1b2491||0x0,_0x127e59||0x0);}function getIntervals(_0x2ea9ee,_0x46bbd3){var _0x354294=[];if(!_[_0x54b5('0xf')](_0x46bbd3[_0x54b5('0x10')])&&!_[_0x54b5('0xf')](_0x2ea9ee[_0x46bbd3[_0x54b5('0x10')]])&&!_[_0x54b5('0xf')](_0x2ea9ee[_0x46bbd3[_0x54b5('0x10')]][_0x54b5('0x11')])){_0x354294=_[_0x54b5('0x12')](_0x2ea9ee[_0x46bbd3[_0x54b5('0x10')]][_0x54b5('0x11')],_0x54b5('0x13'));}else if(!_[_0x54b5('0xf')](_0x46bbd3[_0x54b5('0x13')])){_0x354294=[_0x46bbd3[_0x54b5('0x13')]];}return _0x354294;}exports[_0x54b5('0x14')]=function(_0x2880a5){_0x2880a5[_0x54b5('0x15')]={};return new BPromise(function(_0x561d14,_0x194815){var _0x523f92={'Start':function(_0x594727){var _0x10fa4c=this;return new Promise(function(_0x3549b0,_0x134afa){if(_0x594727){try{var _0x283691=[];var _0x22ca81=getId(_0x594727[_0x54b5('0x16')],_0x594727['message']?_0x594727['message']['id']:0x0,_0x594727[_0x54b5('0x17')]?_0x594727['interaction']['id']:0x0);if(_0x594727[_0x54b5('0x18')]&&_['isArray'](_0x594727[_0x54b5('0x18')])&&_0x594727[_0x54b5('0x18')][_0x54b5('0x19')]){for(var _0xc2a709=0x0;_0xc2a709<_0x594727[_0x54b5('0x18')][_0x54b5('0x19')];_0xc2a709+=0x1){var _0xf9bebc=_0x594727[_0x54b5('0x18')][_0xc2a709];if(fs[_0x54b5('0x1a')](path[_0x54b5('0x1b')](__dirname,_0x54b5('0x18'),_0xf9bebc[_0x54b5('0x1c')]+_0x54b5('0x1d')))){var _0x44af4c=[];switch(_0xf9bebc[_0x54b5('0x1c')][_0x54b5('0x1e')]()){case _0x54b5('0x1f'):var _0x591fb9=_0xf9bebc[_0x54b5('0x20')][_0x54b5('0x21')](',');if(_0x594727['channel']===_0x54b5('0x22')){_0x44af4c[_0x54b5('0x23')](_0x591fb9[0x0]);_0x44af4c[_0x54b5('0x23')](_0x591fb9[0x1]);_0x44af4c['push'](_0x591fb9[_0x54b5('0x24')](0x2,_0x591fb9['length'])['join'](','));}else{_0x44af4c['push'](_0x591fb9[0x0]);_0x44af4c[_0x54b5('0x23')](_0x591fb9['slice'](0x1,_0x591fb9[_0x54b5('0x19')])['join'](','));}break;case'dialogflow':var _0xcea20c=_0xf9bebc[_0x54b5('0x20')][_0x54b5('0x21')](',');_0x44af4c[_0x54b5('0x23')](_0xcea20c[0x0]);_0x44af4c[_0x54b5('0x23')](_0xcea20c[0x1]);_0x44af4c[_0x54b5('0x23')](_0xcea20c['slice'](0x2,_0xcea20c[_0x54b5('0x19')])['join'](','));break;case _0x54b5('0x25'):var _0x217bb3=_0xf9bebc[_0x54b5('0x20')]['split'](',');_0x44af4c[_0x54b5('0x23')](_0x217bb3[0x0]);_0x44af4c['push'](_0x217bb3[0x1]);_0x44af4c['push'](_0x217bb3[0x2]);_0x44af4c[_0x54b5('0x23')](_0x217bb3[0x3]);_0x44af4c['push'](_0x217bb3[_0x54b5('0x24')](0x4,_0x217bb3[_0x54b5('0x19')])[_0x54b5('0x1b')](','));break;case _0x54b5('0x26'):var _0x1a50e9=_0xf9bebc[_0x54b5('0x20')]['split'](',');_0x44af4c['push'](_0x1a50e9[0x0]);_0x44af4c['push'](_0x1a50e9[0x1]);_0x44af4c[_0x54b5('0x23')](_0x1a50e9[0x2]);_0x44af4c[_0x54b5('0x23')](_0x1a50e9[0x3]);_0x44af4c[_0x54b5('0x23')](_0x1a50e9[_0x54b5('0x24')](0x4,_0x1a50e9[_0x54b5('0x19')])['join'](','));break;case _0x54b5('0x27'):_0x44af4c[_0x54b5('0x23')](_0xf9bebc[_0x54b5('0x20')]);break;case _0x54b5('0x28'):_0x44af4c['push'](_0xf9bebc[_0x54b5('0x29')]);_0x44af4c[_0x54b5('0x23')](_0xf9bebc[_0x54b5('0x20')]);break;default:_0x44af4c=_[_0x54b5('0xf')](_0xf9bebc[_0x54b5('0x20')])?[]:_0xf9bebc[_0x54b5('0x20')][_0x54b5('0x21')](',');}var _0x32bfcf={'id':util[_0x54b5('0xd')]('%s:%s:%s',_0x22ca81,_0xf9bebc['id'],_0xf9bebc['app']),'condition':require(_0x54b5('0x2a'))[_0x54b5('0x2b')](_0x22ca81,getIntervals(_0x2880a5[_0x54b5('0x2c')],_0xf9bebc),_0x2880a5),'consequence':require(_0x54b5('0x2d')+_0xf9bebc[_0x54b5('0x1c')])['consequence'](_0x22ca81,_0x44af4c,_0x2880a5,_0x594727),'p':_0xf9bebc['priority']||0x0};logger[_0x54b5('0x2e')](_0x54b5('0x2f'),_0x32bfcf['id'],_0x54b5('0x30'),getIntervals(_0x2880a5[_0x54b5('0x2c')],_0xf9bebc)[_0x54b5('0x1b')](_0x54b5('0x31')));_0x283691[_0x54b5('0x23')](_0x32bfcf);}else{logger[_0x54b5('0x32')](_0x54b5('0x33'),path[_0x54b5('0x1b')](__dirname,_0x54b5('0x18'),_0xf9bebc[_0x54b5('0x1c')]+_0x54b5('0x1d')));}}_0x2880a5[_0x54b5('0x15')][_0x22ca81]=new RuleEngine(_0x283691);_0x2880a5[_0x54b5('0x15')][_0x22ca81][_0x54b5('0x34')](_0x594727,function(_0x404168){logger['info'](_0x54b5('0x35'),JSON[_0x54b5('0x36')](_0x404168['matchPath']));if(_0x2880a5[_0x54b5('0x15')][_0x22ca81]){_0x2880a5['rules'][_0x22ca81][_0x54b5('0x37')](_0x54b5('0x38'));}});return _0x3549b0({'code':0xc8,'message':_0x594727});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x3549b0({'code':0xc8,'message':_0x594727});}}catch(_0x455ed6){logger['error'](_0x455ed6[_0x54b5('0x39')]);return _0x134afa(_0x10fa4c['error'](0x1f4,_0x455ed6));}}return _0x134afa(_0x54b5('0x3a'));});},'AcceptMessage':function(_0x3585f6){var _0x4fb2d5=this;return new Promise(function(_0x3f48dd,_0x54e297){if(_0x3585f6['agent']&&_0x3585f6[_0x54b5('0x3b')]['id']){if(_0x2880a5['agents'][_0x3585f6[_0x54b5('0x3b')]['id']]){_0x2880a5[_0x54b5('0x3c')][_0x3585f6[_0x54b5('0x3b')]['id']][_0x54b5('0x3d')]=![];_0x2880a5[_0x54b5('0x3c')][_0x3585f6[_0x54b5('0x3b')]['id']][_0x54b5('0x3e')]=undefined;}}if(_0x3585f6[_0x54b5('0x27')]&&_0x3585f6[_0x54b5('0x27')]['id']){try{var _0x4fc366=getId(_0x3585f6[_0x54b5('0x16')],_0x3585f6[_0x54b5('0x27')]?_0x3585f6[_0x54b5('0x27')]['id']:0x0,_0x3585f6['interaction']?_0x3585f6[_0x54b5('0x17')]['id']:0x0);if(_0x2880a5[_0x54b5('0x15')][_0x4fc366]){_0x2880a5[_0x54b5('0x15')][_0x4fc366][_0x54b5('0x37')](_0x54b5('0x3f'));if(rpc[_0x3585f6[_0x54b5('0x16')]+_0x54b5('0x40')]){rpc[_0x3585f6[_0x54b5('0x16')]+'QueueReport'][_0x54b5('0x41')](_0x4fc366,{'UserId':_0x3585f6[_0x54b5('0x27')][_0x54b5('0x42')]})['catch'](function(_0xab568c){logger[_0x54b5('0x32')](_0x54b5('0x43'));});}}return _0x3f48dd({'code':0xc8,'message':_0x3585f6});}catch(_0x58e6a1){logger['error'](_0x58e6a1[_0x54b5('0x39')]);return _0x54e297(_0x4fb2d5[_0x54b5('0x32')](0x1f4,_0x58e6a1));}}logger[_0x54b5('0x32')](_0x54b5('0x44'));return _0x54e297(_0x4fb2d5[_0x54b5('0x32')](0x1f4,_0x54b5('0x44')));});},'RejectMessage':function(_0x57a81f){var _0x3d3450=this;return new Promise(function(_0x1fe0a1,_0xbe5611){if(_0x57a81f[_0x54b5('0x3b')]&&_0x57a81f[_0x54b5('0x3b')]['id']){try{if(_0x2880a5['agents'][_0x57a81f[_0x54b5('0x3b')]['id']]){_0x2880a5['agents'][_0x57a81f['agent']['id']][_0x54b5('0x3d')]=![];_0x2880a5['agents'][_0x57a81f['agent']['id']][_0x54b5('0x3e')]=undefined;}return _0x1fe0a1({'code':0xc8,'message':_0x57a81f});}catch(_0x121d2d){logger[_0x54b5('0x32')](_0x121d2d[_0x54b5('0x39')]);return _0xbe5611(_0x3d3450[_0x54b5('0x32')](0x1f4,_0x121d2d));}}logger[_0x54b5('0x32')](_0x54b5('0x44'));return _0xbe5611(_0x3d3450[_0x54b5('0x32')](0x1f4,_0x54b5('0x44')));});},'AbandonInteraction':function(_0x5b84c5){var _0x2b13d1=this;return new Promise(function(_0x4d3284,_0x12b2d7){if(_0x5b84c5['channel']&&_0x5b84c5[_0x54b5('0x17')]&&_0x5b84c5[_0x54b5('0x17')]['id']){try{var _0x59fa3b=getId(_0x5b84c5['channel'],_0x5b84c5['message']?_0x5b84c5[_0x54b5('0x27')]['id']:0x0,_0x5b84c5['interaction']?_0x5b84c5[_0x54b5('0x17')]['id']:0x0);if(_0x2880a5[_0x54b5('0x15')][_0x59fa3b]){_0x2880a5[_0x54b5('0x15')][_0x59fa3b][_0x54b5('0x37')](_0x54b5('0x3f'));}return _0x4d3284({'code':0xc8,'message':_0x5b84c5});}catch(_0x5a4eb3){logger['error'](_0x5a4eb3['stack']);return _0x12b2d7(_0x2b13d1[_0x54b5('0x32')](0x1f4,_0x5a4eb3));}}logger[_0x54b5('0x32')](_0x54b5('0x44'));return _0x12b2d7(_0x2b13d1[_0x54b5('0x32')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5f79cf){var _0x1592d6=this;return new Promise(function(_0x52f145,_0x41ddaf){if(_0x2880a5[_0x54b5('0x3c')][_0x54b5('0x45')](_0x5f79cf['id'])){for(var _0x2aeb84 in _0x5f79cf[_0x54b5('0x46')]){if(_0x5f79cf[_0x54b5('0x46')]['hasOwnProperty'](_0x2aeb84)){if(_0x2880a5[_0x54b5('0x3c')][_0x5f79cf['id']]['hasOwnProperty'](_0x2aeb84+_0x54b5('0x47'))){_0x2880a5[_0x54b5('0x3c')][_0x5f79cf['id']][_0x2aeb84+_0x54b5('0x47')]=parseInt(_0x5f79cf['capacity'][_0x2aeb84],0xa);}}}_0x2880a5[_0x54b5('0x3c')][_0x5f79cf['id']][_0x54b5('0x48')]();return _0x52f145({'code':0xc8,'message':_0x2880a5['agents'][_0x5f79cf['id']]});}else{return _0x41ddaf(_0x1592d6[_0x54b5('0x32')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2b7162){return new Promise(function(_0x4cb39a,_0x3502f7){var _0x23f593=_[_0x54b5('0x49')](_0x2880a5['agents']);_0x4cb39a({'count':_0x23f593[_0x54b5('0x19')],'rows':_0x23f593});});},'ChatQueues':function(_0x12c53e){return new Promise(function(_0x11fc9e,_0x12e7fa){var _0x24b559=[];for(var _0x25252c in _0x2880a5[_0x54b5('0x4a')]){if(_0x2880a5['chatQueues'][_0x54b5('0x45')](_0x25252c)){var _0x2f69d1=_0x2880a5['chatQueues'][_0x25252c];var _0x30a1c3={'id':_0x2f69d1['id'],'available':_0x2f69d1[_0x54b5('0x4b')],'loggedIn':_0x2f69d1[_0x54b5('0x4c')],'name':_0x2f69d1[_0x54b5('0x4d')],'paused':_0x2f69d1['paused'],'waiting':_0x2f69d1[_0x54b5('0x4e')]};_0x24b559['push'](_0x30a1c3);}}_0x11fc9e({'count':_0x24b559[_0x54b5('0x19')],'rows':_0x24b559});});},'MailQueues':function(_0x57807d){return new Promise(function(_0x250ff0,_0x5bd949){var _0x4d57b9=[];for(var _0xe4342b in _0x2880a5[_0x54b5('0x4f')]){if(_0x2880a5[_0x54b5('0x4f')][_0x54b5('0x45')](_0xe4342b)){var _0x28c290=_0x2880a5[_0x54b5('0x4f')][_0xe4342b];var _0x3c4cb3={'id':_0x28c290['id'],'available':_0x28c290['available'],'loggedIn':_0x28c290[_0x54b5('0x4c')],'name':_0x28c290[_0x54b5('0x4d')],'paused':_0x28c290[_0x54b5('0x50')],'waiting':_0x28c290[_0x54b5('0x4e')]};_0x4d57b9[_0x54b5('0x23')](_0x3c4cb3);}}_0x250ff0({'count':_0x4d57b9['length'],'rows':_0x4d57b9});});},'OpenchannelQueues':function(_0x4bca0e){return new Promise(function(_0xfdb87a,_0x47ab6a){var _0x37644c=[];for(var _0x4ea91e in _0x2880a5[_0x54b5('0x51')]){if(_0x2880a5[_0x54b5('0x51')][_0x54b5('0x45')](_0x4ea91e)){var _0x505fb8=_0x2880a5['openchannelQueues'][_0x4ea91e];var _0x5e4992={'id':_0x505fb8['id'],'available':_0x505fb8[_0x54b5('0x4b')],'loggedIn':_0x505fb8['loggedIn'],'name':_0x505fb8['name'],'paused':_0x505fb8[_0x54b5('0x50')],'waiting':_0x505fb8[_0x54b5('0x4e')]};_0x37644c['push'](_0x5e4992);}}_0xfdb87a({'count':_0x37644c[_0x54b5('0x19')],'rows':_0x37644c});});},'SmsQueues':function(_0x17bdd3){return new Promise(function(_0x5ea088,_0x201677){var _0x24166e=[];for(var _0x47932f in _0x2880a5[_0x54b5('0x52')]){if(_0x2880a5['smsQueues']['hasOwnProperty'](_0x47932f)){var _0x41a184=_0x2880a5[_0x54b5('0x52')][_0x47932f];var _0x5bfcdf={'id':_0x41a184['id'],'available':_0x41a184['available'],'loggedIn':_0x41a184[_0x54b5('0x4c')],'name':_0x41a184['name'],'paused':_0x41a184[_0x54b5('0x50')],'waiting':_0x41a184[_0x54b5('0x4e')]};_0x24166e['push'](_0x5bfcdf);}}_0x5ea088({'count':_0x24166e[_0x54b5('0x19')],'rows':_0x24166e});});},'FaxQueues':function(_0x2487b6){return new Promise(function(_0x4299ad,_0x5ed1ff){var _0x1d4be8=[];for(var _0x1209e5 in _0x2880a5[_0x54b5('0x53')]){if(_0x2880a5[_0x54b5('0x53')]['hasOwnProperty'](_0x1209e5)){var _0x4f373b=_0x2880a5[_0x54b5('0x53')][_0x1209e5];var _0x5e79a2={'id':_0x4f373b['id'],'available':_0x4f373b['available'],'loggedIn':_0x4f373b[_0x54b5('0x4c')],'name':_0x4f373b[_0x54b5('0x4d')],'paused':_0x4f373b[_0x54b5('0x50')],'waiting':_0x4f373b['waiting']};_0x1d4be8['push'](_0x5e79a2);}}_0x4299ad({'count':_0x1d4be8[_0x54b5('0x19')],'rows':_0x1d4be8});});},'WhatsappQueues':function(_0x555db4){return new Promise(function(_0x580bb6,_0x7a8606){var _0x5c4041=[];for(var _0x25830b in _0x2880a5['whatsappQueues']){if(_0x2880a5[_0x54b5('0x54')][_0x54b5('0x45')](_0x25830b)){var _0x1eb589=_0x2880a5[_0x54b5('0x54')][_0x25830b];var _0x1eba7b={'id':_0x1eb589['id'],'available':_0x1eb589[_0x54b5('0x4b')],'loggedIn':_0x1eb589[_0x54b5('0x4c')],'name':_0x1eb589[_0x54b5('0x4d')],'paused':_0x1eb589[_0x54b5('0x50')],'waiting':_0x1eb589['waiting']};_0x5c4041[_0x54b5('0x23')](_0x1eba7b);}}_0x580bb6({'count':_0x5c4041['length'],'rows':_0x5c4041});});},'ChatQueuesWaitingInteractions':function(_0x1d4a1f){return new Promise(function(_0x5a9d7b,_0x7daa76){var _0x1703e6=_[_0x54b5('0x49')](_0x2880a5['chatQueuesWaitingInteractions']);_0x5a9d7b({'count':_0x1703e6[_0x54b5('0x19')],'rows':_0x1703e6});});},'MailQueuesWaitingInteractions':function(_0x297234){return new Promise(function(_0x3c940c,_0x254ff4){var _0x1b52c9=_[_0x54b5('0x49')](_0x2880a5[_0x54b5('0x55')]);_0x3c940c({'count':_0x1b52c9[_0x54b5('0x19')],'rows':_0x1b52c9});});},'OpenchannelQueuesWaitingInteractions':function(_0x4c87eb){return new Promise(function(_0x2f8bd9,_0x560842){var _0x2350a4=_['values'](_0x2880a5[_0x54b5('0x56')]);_0x2f8bd9({'count':_0x2350a4[_0x54b5('0x19')],'rows':_0x2350a4});});},'SmsQueuesWaitingInteractions':function(_0x27c4c4){return new Promise(function(_0x45502b,_0x4020f7){var _0x19a40b=_['values'](_0x2880a5[_0x54b5('0x57')]);_0x45502b({'count':_0x19a40b[_0x54b5('0x19')],'rows':_0x19a40b});});},'FaxQueuesWaitingInteractions':function(_0x3b1c59){return new Promise(function(_0x423eb5,_0x334213){var _0x55e195=_[_0x54b5('0x49')](_0x2880a5['faxQueuesWaitingInteractions']);_0x423eb5({'count':_0x55e195[_0x54b5('0x19')],'rows':_0x55e195});});},'WhatsappQueuesWaitingInteractions':function(_0x3c9ada){return new Promise(function(_0x10d625,_0x38ca8a){var _0x5c4c4d=_[_0x54b5('0x49')](_0x2880a5[_0x54b5('0x58')]);_0x10d625({'count':_0x5c4c4d[_0x54b5('0x19')],'rows':_0x5c4c4d});});}};var _0x51019c=jayson[_0x54b5('0x59')](_0x523f92)[_0x54b5('0x5a')]();_0x51019c['on'](_0x54b5('0x32'),function(_0x59ac7a){logger[_0x54b5('0x32')](JSON[_0x54b5('0x36')](_0x59ac7a));return _0x194815(_0x59ac7a);});_0x51019c['listen'](0x232c,'127.0.0.1',function(){console[_0x54b5('0x5b')](_0x54b5('0x5c'),0x232c);return _0x561d14('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
index a61cbec..c140c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f17=['condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','all','some','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','join','stack','util','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message','result','catch'];(function(_0x41b427,_0x4ab542){var _0x1c1e58=function(_0x421e81){while(--_0x421e81){_0x41b427['push'](_0x41b427['shift']());}};_0x1c1e58(++_0x4ab542);}(_0x3f17,0x1d4));var _0x73f1=function(_0x4b95eb,_0x52ab27){_0x4b95eb=_0x4b95eb-0x0;var _0xd78953=_0x3f17[_0x4b95eb];return _0xd78953;};'use strict';var util=require(_0x73f1('0x0'));var BPromise=require('bluebird');var jayson=require(_0x73f1('0x1'));var _=require(_0x73f1('0x2'));var logger=require(_0x73f1('0x3'))('routing');var client=jayson[_0x73f1('0x4')][_0x73f1('0x5')]({'port':0x232a});function request(_0xf3880d,_0x1a1cd6){return new BPromise(function(_0x5c29e3,_0x176234){return client[_0x73f1('0x6')](_0xf3880d,_0x1a1cd6)[_0x73f1('0x7')](function(_0x2b756f){if(_0x2b756f[_0x73f1('0x8')]){return _0x176234(_0x2b756f['error'][_0x73f1('0x9')]);}else{return _0x5c29e3(_0x2b756f[_0x73f1('0xa')]);}})[_0x73f1('0xb')](function(_0x3f8991){return _0x176234(_0x3f8991);});});}exports[_0x73f1('0xc')]=function(_0x3be97b,_0x148392,_0x569dc5){return function(_0x3f90f0){if(_0x569dc5[_0x73f1('0xd')]&&!_0x569dc5[_0x73f1('0xd')][_0x3be97b]){logger[_0x73f1('0xe')](_0x73f1('0xf'),_0x3be97b);return _0x3f90f0[_0x73f1('0x10')]();}var _0x1077f3=[];for(var _0x36fba7=0x0;_0x36fba7<_0x148392[_0x73f1('0x11')];_0x36fba7+=0x1){_0x1077f3[_0x73f1('0x12')](request(_0x73f1('0x13'),{'command':util[_0x73f1('0x14')](_0x73f1('0x15'),_0x148392[_0x36fba7])})['then'](function(_0x59aa46){return _0x59aa46&&_0x59aa46[_0x73f1('0x9')]&&_0x59aa46[_0x73f1('0x9')][_0x73f1('0x16')](_0x73f1('0x17'))>=0x0?!![]:![];})[_0x73f1('0xb')](function(_0x14e897){logger[_0x73f1('0x8')]('[%s][INTERVAL]\x20%s',_0x3be97b,_0x148392[_0x36fba7]);}));}BPromise[_0x73f1('0x18')](_0x1077f3)['then'](function(_0x2354d4){var _0x7f3c9e=_[_0x73f1('0x19')](_0x2354d4);logger[_0x73f1('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x3be97b,_0x148392['join'](_0x73f1('0x1a')),_0x7f3c9e);_0x3f90f0[_0x73f1('0x1b')](_0x7f3c9e);})[_0x73f1('0xb')](function(_0x56cb0e){console[_0x73f1('0x1c')](_0x56cb0e);logger[_0x73f1('0x8')](_0x73f1('0x1d'),_0x3be97b,_0x148392[_0x73f1('0x1e')](_0x73f1('0x1a')),_0x56cb0e[_0x73f1('0x1f')]);_0x3f90f0[_0x73f1('0x10')]();});};};
\ No newline at end of file
+var _0x8036=['log','stack','util','jayson/promise','lodash','client','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when'];(function(_0x36b771,_0x57e8d0){var _0x58dc31=function(_0xf1467e){while(--_0xf1467e){_0x36b771['push'](_0x36b771['shift']());}};_0x58dc31(++_0x57e8d0);}(_0x8036,0x89));var _0x6803=function(_0x4a34a9,_0xe439ad){_0x4a34a9=_0x4a34a9-0x0;var _0x50b73f=_0x8036[_0x4a34a9];return _0x50b73f;};'use strict';var util=require(_0x6803('0x0'));var BPromise=require('bluebird');var jayson=require(_0x6803('0x1'));var _=require(_0x6803('0x2'));var logger=require('../../../config/logger')('routing');var client=jayson[_0x6803('0x3')]['http']({'port':0x232a});function request(_0x40fc2b,_0x2c1b21){return new BPromise(function(_0x42ec48,_0x3f4776){return client['request'](_0x40fc2b,_0x2c1b21)['then'](function(_0x1ff1e1){if(_0x1ff1e1[_0x6803('0x4')]){return _0x3f4776(_0x1ff1e1[_0x6803('0x4')][_0x6803('0x5')]);}else{return _0x42ec48(_0x1ff1e1[_0x6803('0x6')]);}})[_0x6803('0x7')](function(_0x5c0e59){return _0x3f4776(_0x5c0e59);});});}exports[_0x6803('0x8')]=function(_0x2307e4,_0x5449f8,_0x272196){return function(_0x3d976e){if(_0x272196[_0x6803('0x9')]&&!_0x272196[_0x6803('0x9')][_0x2307e4]){logger[_0x6803('0xa')](_0x6803('0xb'),_0x2307e4);return _0x3d976e[_0x6803('0xc')]();}var _0x155466=[];for(var _0x1bcc08=0x0;_0x1bcc08<_0x5449f8['length'];_0x1bcc08+=0x1){_0x155466[_0x6803('0xd')](request(_0x6803('0xe'),{'command':util['format'](_0x6803('0xf'),_0x5449f8[_0x1bcc08])})[_0x6803('0x10')](function(_0x2eb025){return _0x2eb025&&_0x2eb025['message']&&_0x2eb025[_0x6803('0x5')][_0x6803('0x11')](_0x6803('0x12'))>=0x0?!![]:![];})[_0x6803('0x7')](function(_0x231159){logger[_0x6803('0x4')](_0x6803('0x13'),_0x2307e4,_0x5449f8[_0x1bcc08]);}));}BPromise[_0x6803('0x14')](_0x155466)[_0x6803('0x10')](function(_0x2080bd){var _0x475ab2=_[_0x6803('0x15')](_0x2080bd);logger[_0x6803('0xa')]('[%s][INTERVAL]\x20%s\x20%s',_0x2307e4,_0x5449f8[_0x6803('0x16')](_0x6803('0x17')),_0x475ab2);_0x3d976e[_0x6803('0x18')](_0x475ab2);})['catch'](function(_0x3e01cb){console[_0x6803('0x19')](_0x3e01cb);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x2307e4,_0x5449f8[_0x6803('0x16')](_0x6803('0x17')),_0x3e01cb[_0x6803('0x1a')]);_0x3d976e[_0x6803('0xc')]();});};};
\ No newline at end of file
index 075758b..7d2446d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['complete','[%s][agents][agentcomplete]','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var utils=require(_0x0a9e('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5dd881,_0x550fbc){utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x4'),_0x5dd881[_0x0a9e('0x5')],_0x5dd881[_0x0a9e('0x6')],_0x5dd881[_0x0a9e('0x7')],_0x5dd881[_0x0a9e('0x8')],_0x5dd881['interface'],_0x5dd881[_0x0a9e('0x9')],_0x5dd881[_0x0a9e('0xa')],_0x5dd881[_0x0a9e('0xb')]));if(_0x5dd881['queue']){utils['getVoiceQueueByName'](_0x5dd881[_0x0a9e('0x7')])['then'](function(_0x52cace){if(_0x52cace){_0x5dd881[_0x0a9e('0xc')]=_0x52cace[_0x0a9e('0xc')];_0x5dd881[_0x0a9e('0xd')]=_0x5dd881[_0x0a9e('0xe')]?_0x52cace[_0x0a9e('0xf')]:![];_0x5dd881[_0x0a9e('0x10')]=_0x5dd881['agentacw']?_0x52cace['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x5dd881);});}else{utils[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x5dd881);}if(_0x550fbc){delete transfers[_0x5dd881[_0x0a9e('0x5')]];}else{delete agents[_0x5dd881[_0x0a9e('0x13')]];}}exports[_0x0a9e('0x14')]=function(_0x69aeb7){try{utils['debug'](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x69aeb7);agents[_0x69aeb7[_0x0a9e('0x13')]]=_0x69aeb7;agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x17')]=utils['now']();agents[_0x69aeb7[_0x0a9e('0x13')]]['lastevent']=_0x0a9e('0x18');agents[_0x69aeb7['destuniqueid']][_0x0a9e('0xa')]=null;agents[_0x69aeb7[_0x0a9e('0x13')]]['connectedlinename']=null;utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x19'),_0x69aeb7[_0x0a9e('0x5')],agents[_0x69aeb7[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x69aeb7[_0x0a9e('0x13')]));}catch(_0x2eb11f){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x16'),_0x69aeb7[_0x0a9e('0x5')]),_0x2eb11f);}};exports[_0x0a9e('0x1b')]=function(_0x105080){try{if(!_['isNil'](agents[_0x105080[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format'](_0x0a9e('0x1d'),_0x105080['uniqueid']),_0x105080);utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x1e'),_0x105080[_0x0a9e('0x5')],agents[_0x105080[_0x0a9e('0x13')]]['membername'],_0x105080[_0x0a9e('0x13')]));agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1b')]=!![];agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();agents[_0x105080[_0x0a9e('0x13')]]['lastevent']='timeout';agents[_0x105080[_0x0a9e('0x13')]][_0x0a9e('0x21')]=_0x0a9e('0x22');agents[_0x105080[_0x0a9e('0x13')]]['holdtime']=_0x105080[_0x0a9e('0x23')]?parseInt(_0x105080['ringtime'])/0x3e8:0x0;agents[_0x105080[_0x0a9e('0x13')]]['talktime']=0x0;unanswered[_0x0a9e('0x24')](_0x105080[_0x0a9e('0x13')]);}}catch(_0x25fba9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x1d'),_0x105080[_0x0a9e('0x5')]),_0x25fba9);}};exports[_0x0a9e('0x25')]=function(_0x5a101a){try{_[_0x0a9e('0x26')](agents,function(_0x468813,_0x2b1f27){if(_0x468813[_0x0a9e('0x5')]==_0x5a101a['uniqueid']&&!_[_0x0a9e('0x27')](unanswered,_0x468813[_0x0a9e('0x13')])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a[_0x0a9e('0x5')]),_0x5a101a);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x29'),_0x5a101a['uniqueid'],_0x468813[_0x0a9e('0x8')],_0x468813['destuniqueid']));_0x468813[_0x0a9e('0x1b')]=!![];_0x468813[_0x0a9e('0x1f')]=utils[_0x0a9e('0x20')]();_0x468813[_0x0a9e('0xb')]=_0x0a9e('0x2a');_0x468813['reason']=_0x0a9e('0x2a');_0x468813[_0x0a9e('0x2b')]=_0x5a101a[_0x0a9e('0x2b')];_0x468813[_0x0a9e('0x2c')]=0x0;writeDB(_0x468813);}});}catch(_0x2b45ea){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x28'),_0x5a101a['uniqueid']),_0x2b45ea);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(agents[_0x5e7238[_0x0a9e('0x13')]]){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238['uniqueid']),_0x5e7238);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x2f'),_0x5e7238[_0x0a9e('0x5')],agents[_0x5e7238['destuniqueid']]['membername'],_0x5e7238[_0x0a9e('0x13')]));agents[_0x5e7238['destuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0xa')]=_0x5e7238['connectedlinenum'];agents[_0x5e7238[_0x0a9e('0x13')]][_0x0a9e('0x31')]=_0x5e7238[_0x0a9e('0x31')];agents[_0x5e7238['destuniqueid']][_0x0a9e('0x2b')]=_0x5e7238[_0x0a9e('0x23')];agents[_0x5e7238[_0x0a9e('0x13')]]['lastevent']='connect';_[_0x0a9e('0x26')](agents,function(_0x40d766,_0x5adda1){if(_0x40d766[_0x0a9e('0x13')]!=_0x5e7238[_0x0a9e('0x13')]&&_0x40d766[_0x0a9e('0x5')]==_0x5e7238[_0x0a9e('0x5')]){_0x40d766['talktime']=0x0;_0x40d766['holdtime']=_0x5e7238[_0x0a9e('0x23')];_0x40d766[_0x0a9e('0x1b')]=!![];_0x40d766['agentringnoanswerAt']=utils[_0x0a9e('0x20')]();_0x40d766[_0x0a9e('0xb')]=_0x0a9e('0x32');_0x40d766['reason']=_0x0a9e('0x32');_0x40d766[_0x0a9e('0x33')]=_0x5e7238[_0x0a9e('0x13')];_0x40d766[_0x0a9e('0x34')]=_0x5e7238[_0x0a9e('0x8')];writeDB(_0x40d766);}});}}catch(_0xeaa5e5){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x2e'),_0x5e7238[_0x0a9e('0x5')]),_0xeaa5e5);}};exports[_0x0a9e('0xe')]=function(_0x148007){try{if(!_[_0x0a9e('0x35')](agents[_0x148007[_0x0a9e('0x13')]])){utils[_0x0a9e('0x1c')](util['format']('[%s][agents][agentcomplete]',_0x148007[_0x0a9e('0x5')]),_0x148007);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x36'),_0x148007[_0x0a9e('0x5')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x8')],_0x148007[_0x0a9e('0x13')]));agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0xe')]=!![];agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')]=utils['now']();agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x37')],agents[_0x148007[_0x0a9e('0x13')]][_0x0a9e('0x30')]);agents[_0x148007[_0x0a9e('0x13')]]['reason']=_0x148007[_0x0a9e('0x21')];agents[_0x148007['destuniqueid']][_0x0a9e('0xb')]=_0x0a9e('0x39');writeDB(agents[_0x148007[_0x0a9e('0x13')]]);}}catch(_0x562fb4){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x3a'),_0x148007[_0x0a9e('0x5')]),_0x562fb4);}};exports[_0x0a9e('0x3b')]=function(_0x37be73){try{if(!_[_0x0a9e('0x35')](agents[_0x37be73['transfereruniqueid']])){utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x37be73);utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x3d'),_0x37be73[_0x0a9e('0x5')],agents[_0x37be73[_0x0a9e('0x3e')]]['membername'],agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x5')]));agents[_0x37be73['transfereruniqueid']]['transfer']=!![];agents[_0x37be73['transfereruniqueid']][_0x0a9e('0x3f')]=_0x0a9e('0x40');agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x41')]=_0x37be73[_0x0a9e('0x42')];agents[_0x37be73[_0x0a9e('0x3e')]][_0x0a9e('0x43')]=agents[_0x37be73[_0x0a9e('0x3e')]]['uniqueid'];}}catch(_0x4b1b9f){utils['error'](util[_0x0a9e('0x15')](_0x0a9e('0x3c'),_0x37be73[_0x0a9e('0x5')]),_0x4b1b9f);}};exports['attendedtransfer']=function(_0x2b69d9){try{utils[_0x0a9e('0x1c')](util['format']('[%s][agents][attendedtransfer]',_0x2b69d9[_0x0a9e('0x44')]),_0x2b69d9);if(_0x2b69d9['origtransfereruniqueid']==_0x2b69d9[_0x0a9e('0x45')]){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x46')]])){utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x46')]]['membername']));agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x47')]=!![];agents[_0x2b69d9[_0x0a9e('0x46')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9['secondtransfereruniqueid']][_0x0a9e('0x41')]=_0x2b69d9['origtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x46')]]['transferuniqueid']=_0x2b69d9['origtransfereruniqueid'];}if(_0x2b69d9['transfereeuniqueid']&&agents[_0x2b69d9[_0x0a9e('0x49')]]){agents[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9[_0x0a9e('0x49')]]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x49')]]);transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x9')];transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x46')]][_0x0a9e('0x4c')];transfers[_0x2b69d9[_0x0a9e('0x49')]][_0x0a9e('0x17')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9['transfereeuniqueid']][_0x0a9e('0x4a')]=0x2;}}else if(_0x2b69d9['secondtransfereruniqueid']==_0x2b69d9['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x2b69d9[_0x0a9e('0x44')]])){utils['info'](util[_0x0a9e('0x15')](_0x0a9e('0x4d'),_0x2b69d9[_0x0a9e('0x44')],agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x8')]));agents[_0x2b69d9[_0x0a9e('0x44')]]['transfer']=!![];agents[_0x2b69d9[_0x0a9e('0x44')]]['transfertype']=_0x0a9e('0x48');agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x41')]=_0x2b69d9['secondtransfererexten'];agents[_0x2b69d9[_0x0a9e('0x44')]][_0x0a9e('0x43')]=_0x2b69d9[_0x0a9e('0x46')];}if(_0x2b69d9[_0x0a9e('0x4e')]&&agents[_0x2b69d9['transfertargetuniqueid']]){agents[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x1;transfers[_0x2b69d9['transfertargetuniqueid']]=_[_0x0a9e('0x4b')](agents[_0x2b69d9[_0x0a9e('0x4e')]]);transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x9')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridnum'];transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4c')]=agents[_0x2b69d9[_0x0a9e('0x44')]]['calleridname'];transfers[_0x2b69d9[_0x0a9e('0x4e')]]['agentcalledAt']=utils['now']();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x30')]=utils[_0x0a9e('0x20')]();transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x2b')]=0x0;transfers[_0x2b69d9[_0x0a9e('0x4e')]][_0x0a9e('0x4a')]=0x2;}}}catch(_0x54a37d){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')](_0x0a9e('0x4f'),_0x2b69d9[_0x0a9e('0x44')]),_0x54a37d);}};exports[_0x0a9e('0x50')]=function(_0x2b8192){try{utils[_0x0a9e('0x1c')](util[_0x0a9e('0x15')](_0x0a9e('0x51'),_0x2b8192[_0x0a9e('0x5')]),_0x2b8192);if(agents[_0x2b8192['uniqueid']]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]===_0x0a9e('0x22')){if(_0x2b8192['cause']==='21'){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]='rejected';agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]=_0x0a9e('0x52');}utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2b8192['uniqueid'],agents[_0x2b8192['uniqueid']][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);var _0xeef20=unanswered[_0x0a9e('0x53')](_0x2b8192['uniqueid']);if(_0xeef20>-0x1){unanswered[_0x0a9e('0x54')](_0xeef20,0x1);}}if(transfers[_0x2b8192[_0x0a9e('0x5')]]){transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcomplete']=!![];transfers[_0x2b8192[_0x0a9e('0x5')]]['agentcompleteAt']=utils[_0x0a9e('0x20')]();transfers[_0x2b8192[_0x0a9e('0x5')]]['talktime']=utils[_0x0a9e('0x38')](transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')],transfers[_0x2b8192[_0x0a9e('0x5')]]['agentconnectAt']);transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')]=_0x0a9e('0x55');transfers[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util[_0x0a9e('0x15')](_0x0a9e('0x56'),_0x2b8192['uniqueid'],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],transfers[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xb')]));writeDB(transfers[_0x2b8192[_0x0a9e('0x5')]],!![]);}if(agents[_0x2b8192[_0x0a9e('0x5')]]&&agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]){agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0xe')]=!![];agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x37')]=utils['now']();agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x2c')]=utils[_0x0a9e('0x38')](agents[_0x2b8192['uniqueid']][_0x0a9e('0x37')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x30')]);agents[_0x2b8192[_0x0a9e('0x5')]]['reason']=agents[_0x2b8192['uniqueid']][_0x0a9e('0x47')]?_0x0a9e('0x47'):'agent';agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']=_0x0a9e('0x39');utils[_0x0a9e('0x3')](util['format'](_0x0a9e('0x56'),_0x2b8192[_0x0a9e('0x5')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x8')],agents[_0x2b8192[_0x0a9e('0x5')]][_0x0a9e('0x21')],agents[_0x2b8192[_0x0a9e('0x5')]]['lastevent']));writeDB(agents[_0x2b8192[_0x0a9e('0x5')]]);}}catch(_0x3ca9b9){utils[_0x0a9e('0x1a')](util[_0x0a9e('0x15')]('[%s][agents][hangup]',_0x2b8192[_0x0a9e('0x5')]),_0x3ca9b9);}};
\ No newline at end of file
+var _0x593e=['answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','agentconnectAt','complete','isNil','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','acw','acwtime','agentacw','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','[%s][agents][agentconnect]','connect','answered_elsewhere'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x593e,0xcb));var _0xe593=function(_0x568365,_0x58699e){_0x568365=_0x568365-0x0;var _0x442a0d=_0x593e[_0x568365];return _0x442a0d;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var utils=require(_0xe593('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x28f28c,_0x43dabb){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x5'),_0x28f28c['uniqueid'],_0x28f28c[_0xe593('0x6')],_0x28f28c[_0xe593('0x7')],_0x28f28c[_0xe593('0x8')],_0x28f28c[_0xe593('0x9')],_0x28f28c[_0xe593('0xa')],_0x28f28c[_0xe593('0xb')],_0x28f28c[_0xe593('0xc')]));if(_0x28f28c[_0xe593('0x7')]){utils[_0xe593('0xd')](_0x28f28c[_0xe593('0x7')])['then'](function(_0x38c470){if(_0x38c470){_0x28f28c[_0xe593('0xe')]=_0x38c470[_0xe593('0xe')];_0x28f28c['agentacw']=_0x28f28c['agentcomplete']?_0x38c470[_0xe593('0xf')]:![];_0x28f28c[_0xe593('0x10')]=_0x28f28c[_0xe593('0x11')]?_0x38c470['acwTimeout']:0x0;}utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);});}else{utils[_0xe593('0x12')](_0xe593('0x13'),_0x28f28c);}if(_0x43dabb){delete transfers[_0x28f28c[_0xe593('0x14')]];}else{delete agents[_0x28f28c[_0xe593('0x15')]];}}exports[_0xe593('0x16')]=function(_0xa4d5e9){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcalled]',_0xa4d5e9[_0xe593('0x14')]),_0xa4d5e9);agents[_0xa4d5e9[_0xe593('0x15')]]=_0xa4d5e9;agents[_0xa4d5e9['destuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();agents[_0xa4d5e9['destuniqueid']][_0xe593('0xc')]=_0xe593('0x1a');agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0xb')]=null;agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x1b')]=null;utils['info'](util[_0xe593('0x4')](_0xe593('0x1c'),_0xa4d5e9['uniqueid'],agents[_0xa4d5e9[_0xe593('0x15')]][_0xe593('0x8')],_0xa4d5e9['destuniqueid']));}catch(_0x1c94aa){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x1e'),_0xa4d5e9[_0xe593('0x14')]),_0x1c94aa);}};exports[_0xe593('0x1f')]=function(_0x3d2a51){try{if(!_['isNil'](agents[_0x3d2a51['destuniqueid']])){utils[_0xe593('0x17')](util['format']('[%s][agents][agentringnoanswer]',_0x3d2a51[_0xe593('0x14')]),_0x3d2a51);utils[_0xe593('0x3')](util['format'](_0xe593('0x20'),_0x3d2a51['uniqueid'],agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x8')],_0x3d2a51[_0xe593('0x15')]));agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x1f')]=!![];agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x21')]=utils[_0xe593('0x19')]();agents[_0x3d2a51['destuniqueid']][_0xe593('0xc')]=_0xe593('0x22');agents[_0x3d2a51['destuniqueid']]['reason']=_0xe593('0x22');agents[_0x3d2a51[_0xe593('0x15')]][_0xe593('0x23')]=_0x3d2a51[_0xe593('0x24')]?parseInt(_0x3d2a51[_0xe593('0x24')])/0x3e8:0x0;agents[_0x3d2a51[_0xe593('0x15')]]['talktime']=0x0;unanswered[_0xe593('0x25')](_0x3d2a51['destuniqueid']);}}catch(_0x1dacf6){utils[_0xe593('0x1d')](util['format'](_0xe593('0x26'),_0x3d2a51['uniqueid']),_0x1dacf6);}};exports[_0xe593('0x27')]=function(_0x1c147b){try{_[_0xe593('0x28')](agents,function(_0x501e54,_0x1ae8d9){if(_0x501e54[_0xe593('0x14')]==_0x1c147b[_0xe593('0x14')]&&!_[_0xe593('0x29')](unanswered,_0x501e54[_0xe593('0x15')])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x1c147b);utils[_0xe593('0x3')](util['format'](_0xe593('0x2a'),_0x1c147b['uniqueid'],_0x501e54[_0xe593('0x8')],_0x501e54[_0xe593('0x15')]));_0x501e54[_0xe593('0x1f')]=!![];_0x501e54[_0xe593('0x21')]=utils[_0xe593('0x19')]();_0x501e54[_0xe593('0xc')]=_0xe593('0x2b');_0x501e54[_0xe593('0x2c')]=_0xe593('0x2b');_0x501e54[_0xe593('0x23')]=_0x1c147b['holdtime'];_0x501e54[_0xe593('0x2d')]=0x0;writeDB(_0x501e54);}});}catch(_0x2c0a30){utils[_0xe593('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x1c147b[_0xe593('0x14')]),_0x2c0a30);}};exports['agentconnect']=function(_0x232bf1){try{if(agents[_0x232bf1[_0xe593('0x15')]]){utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x232bf1);utils[_0xe593('0x3')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x232bf1[_0xe593('0x14')],agents[_0x232bf1['destuniqueid']][_0xe593('0x8')],_0x232bf1['destuniqueid']));agents[_0x232bf1[_0xe593('0x15')]]['agentconnectAt']=utils['now']();agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xb')]=_0x232bf1[_0xe593('0xb')];agents[_0x232bf1['destuniqueid']]['connectedlinename']=_0x232bf1['connectedlinename'];agents[_0x232bf1[_0xe593('0x15')]]['holdtime']=_0x232bf1[_0xe593('0x24')];agents[_0x232bf1[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x2f');_['forIn'](agents,function(_0x196325,_0x53ed3c){if(_0x196325[_0xe593('0x15')]!=_0x232bf1['destuniqueid']&&_0x196325['uniqueid']==_0x232bf1['uniqueid']){_0x196325[_0xe593('0x2d')]=0x0;_0x196325['holdtime']=_0x232bf1[_0xe593('0x24')];_0x196325[_0xe593('0x1f')]=!![];_0x196325[_0xe593('0x21')]=utils['now']();_0x196325[_0xe593('0xc')]=_0xe593('0x30');_0x196325[_0xe593('0x2c')]=_0xe593('0x30');_0x196325[_0xe593('0x31')]=_0x232bf1[_0xe593('0x15')];_0x196325[_0xe593('0x32')]=_0x232bf1[_0xe593('0x8')];writeDB(_0x196325);}});}}catch(_0x4b36e1){utils[_0xe593('0x1d')](util[_0xe593('0x4')](_0xe593('0x2e'),_0x232bf1[_0xe593('0x14')]),_0x4b36e1);}};exports[_0xe593('0x33')]=function(_0x4d3018){try{if(!_['isNil'](agents[_0x4d3018[_0xe593('0x15')]])){utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x4d3018);utils[_0xe593('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4d3018[_0xe593('0x14')],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x8')],_0x4d3018['destuniqueid']));agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x33')]=!![];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x34')]=utils['now']();agents[_0x4d3018['destuniqueid']]['talktime']=utils['diffTime'](agents[_0x4d3018[_0xe593('0x15')]]['agentcompleteAt'],agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x35')]);agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0x2c')]=_0x4d3018[_0xe593('0x2c')];agents[_0x4d3018[_0xe593('0x15')]][_0xe593('0xc')]=_0xe593('0x36');writeDB(agents[_0x4d3018['destuniqueid']]);}}catch(_0x3dbb46){utils[_0xe593('0x1d')](util[_0xe593('0x4')]('[%s][agents][agentcomplete]',_0x4d3018[_0xe593('0x14')]),_0x3dbb46);}};exports['blindtransfer']=function(_0x39ec9e){try{if(!_[_0xe593('0x37')](agents[_0x39ec9e[_0xe593('0x38')]])){utils['debug'](util['format'](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x39ec9e);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x39ec9e['uniqueid'],agents[_0x39ec9e['transfereruniqueid']][_0xe593('0x8')],agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')]));agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3a')]=!![];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3b')]=_0xe593('0x3c');agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3d')]=_0x39ec9e[_0xe593('0x3e')];agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x3f')]=agents[_0x39ec9e[_0xe593('0x38')]][_0xe593('0x14')];}}catch(_0x46544d){utils['error'](util[_0xe593('0x4')](_0xe593('0x39'),_0x39ec9e[_0xe593('0x14')]),_0x46544d);}};exports[_0xe593('0x40')]=function(_0x1204d8){try{utils[_0xe593('0x17')](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x1204d8);if(_0x1204d8[_0xe593('0x42')]==_0x1204d8[_0xe593('0x43')]){if(!_[_0xe593('0x37')](agents[_0x1204d8[_0xe593('0x44')]])){utils[_0xe593('0x3')](util[_0xe593('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x8')]));agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3a')]=!![];agents[_0x1204d8['secondtransfereruniqueid']]['transfertype']=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x46')];agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x42')];}if(_0x1204d8['transfereeuniqueid']&&agents[_0x1204d8['transfereeuniqueid']]){agents[_0x1204d8[_0xe593('0x47')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8['transfereeuniqueid']]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x47')]]);transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0xa')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x4a')]=agents[_0x1204d8[_0xe593('0x44')]][_0xe593('0x4a')];transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8[_0xe593('0x47')]][_0xe593('0x23')]=0x0;transfers[_0x1204d8['transfereeuniqueid']][_0xe593('0x48')]=0x2;}}else if(_0x1204d8[_0xe593('0x44')]==_0x1204d8[_0xe593('0x4b')]){if(!_[_0xe593('0x37')](agents[_0x1204d8['origtransfereruniqueid']])){utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x4c'),_0x1204d8[_0xe593('0x42')],agents[_0x1204d8[_0xe593('0x42')]]['membername']));agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3a')]=!![];agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3b')]=_0xe593('0x45');agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x3d')]=_0x1204d8[_0xe593('0x4d')];agents[_0x1204d8['origtransfereruniqueid']][_0xe593('0x3f')]=_0x1204d8[_0xe593('0x44')];}if(_0x1204d8[_0xe593('0x4e')]&&agents[_0x1204d8[_0xe593('0x4e')]]){agents[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x1;transfers[_0x1204d8[_0xe593('0x4e')]]=_[_0xe593('0x49')](agents[_0x1204d8[_0xe593('0x4e')]]);transfers[_0x1204d8[_0xe593('0x4e')]]['calleridnum']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0xa')];transfers[_0x1204d8[_0xe593('0x4e')]]['calleridname']=agents[_0x1204d8[_0xe593('0x42')]][_0xe593('0x4a')];transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x18')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x35')]=utils[_0xe593('0x19')]();transfers[_0x1204d8['transfertargetuniqueid']][_0xe593('0x23')]=0x0;transfers[_0x1204d8[_0xe593('0x4e')]][_0xe593('0x48')]=0x2;}}}catch(_0x3486b3){utils['error'](util[_0xe593('0x4')](_0xe593('0x41'),_0x1204d8[_0xe593('0x42')]),_0x3486b3);}};exports['hangup']=function(_0x43dcb0){try{utils[_0xe593('0x17')](util[_0xe593('0x4')]('[%s][agents][hangup]',_0x43dcb0[_0xe593('0x14')]),_0x43dcb0);if(agents[_0x43dcb0[_0xe593('0x14')]]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]===_0xe593('0x22')){if(_0x43dcb0['cause']==='21'){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=_0xe593('0x4f');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x4f');}utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')],agents[_0x43dcb0['uniqueid']][_0xe593('0xc')]));writeDB(agents[_0x43dcb0[_0xe593('0x14')]]);var _0x9427d6=unanswered[_0xe593('0x51')](_0x43dcb0[_0xe593('0x14')]);if(_0x9427d6>-0x1){unanswered[_0xe593('0x52')](_0x9427d6,0x1);}}if(transfers[_0x43dcb0[_0xe593('0x14')]]){transfers[_0x43dcb0[_0xe593('0x14')]]['agentcomplete']=!![];transfers[_0x43dcb0['uniqueid']]['agentcompleteAt']=utils[_0xe593('0x19')]();transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2d')]=utils['diffTime'](transfers[_0x43dcb0['uniqueid']][_0xe593('0x34')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x35')]);transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]='agent';transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils[_0xe593('0x3')](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],transfers[_0x43dcb0['uniqueid']][_0xe593('0x8')],transfers[_0x43dcb0[_0xe593('0x14')]]['reason'],transfers[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(transfers[_0x43dcb0[_0xe593('0x14')]],!![]);}if(agents[_0x43dcb0['uniqueid']]&&agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]){agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x33')]=!![];agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x34')]=utils['now']();agents[_0x43dcb0['uniqueid']][_0xe593('0x2d')]=utils['diffTime'](agents[_0x43dcb0['uniqueid']]['agentcompleteAt'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x35')]);agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0x2c')]=agents[_0x43dcb0[_0xe593('0x14')]]['transfer']?'transfer':_0xe593('0x53');agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]=_0xe593('0x36');utils['info'](util[_0xe593('0x4')](_0xe593('0x50'),_0x43dcb0[_0xe593('0x14')],agents[_0x43dcb0['uniqueid']][_0xe593('0x8')],agents[_0x43dcb0[_0xe593('0x14')]]['reason'],agents[_0x43dcb0[_0xe593('0x14')]][_0xe593('0xc')]));writeDB(agents[_0x43dcb0['uniqueid']]);}}catch(_0x5bb9e2){utils['error'](util['format']('[%s][agents][hangup]',_0x43dcb0['uniqueid']),_0x5bb9e2);}};
\ No newline at end of file
index a4ba030..d053c1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd4e=['\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','appdata','startsWith','toLowerCase','split','substring','lastIndexOf','includes','noop','execif','set','application','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','newstate','debug','[%s][calls][newstate]','isNil','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination'];(function(_0x5982cd,_0x52091b){var _0x107a28=function(_0x535e9b){while(--_0x535e9b){_0x5982cd['push'](_0x5982cd['shift']());}};_0x107a28(++_0x52091b);}(_0xbd4e,0x1bd));var _0xebd4=function(_0x3e30ab,_0x301311){_0x3e30ab=_0x3e30ab-0x0;var _0x120c37=_0xbd4e[_0x3e30ab];return _0x120c37;};'use strict';var _=require(_0xebd4('0x0'));var util=require(_0xebd4('0x1'));var utils=require(_0xebd4('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xebd4('0x3'),_0xebd4('0x4'),_0xebd4('0x4'),'NO\x20ANSWER',_0xebd4('0x3'),_0xebd4('0x3'),_0xebd4('0x5'),'BUSY',_0xebd4('0x4'),_0xebd4('0x4'),_0xebd4('0x4')];var channels={};function writeDB(_0x12c51c){var _0x2efb96;if(transfers[_0xebd4('0x6')][_0x12c51c[_0xebd4('0x7')]]){_0x2efb96=_0x12c51c[_0xebd4('0x7')];_0x12c51c[_0xebd4('0x7')]=transfers[_0xebd4('0x6')][_0x12c51c[_0xebd4('0x7')]][_0xebd4('0x8')];}utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0xb'),_0x12c51c[_0xebd4('0x7')],_0x12c51c[_0xebd4('0xc')],_0x12c51c[_0xebd4('0xd')],_0x12c51c[_0xebd4('0xe')],_0x12c51c[_0xebd4('0xf')],_0x12c51c[_0xebd4('0x10')],_0x12c51c[_0xebd4('0x11')],_0x12c51c[_0xebd4('0x12')]));if(_0x12c51c[_0xebd4('0x13')]){utils['getUserByInternal'](_0x12c51c[_0xebd4('0x13')])[_0xebd4('0x14')](function(_0x34a550){if(_0x34a550){_0x12c51c[_0xebd4('0x15')]=_0x34a550['id'];}utils[_0xebd4('0x16')](_0xebd4('0x17'),_0x12c51c);});}else{utils[_0xebd4('0x16')](_0xebd4('0x17'),_0x12c51c);}if(channels[_0x12c51c[_0xebd4('0x7')]]){delete channels[_0x12c51c[_0xebd4('0x7')]];}else if(_0x2efb96&&channels[_0x2efb96]){delete transfers[_0xebd4('0x6')][_0x2efb96];delete channels[_0x2efb96];}}exports[_0xebd4('0x18')]=function(_0x204b9c){try{utils['debug'](util['format'](_0xebd4('0x19'),_0x204b9c[_0xebd4('0x7')]),_0x204b9c);if(_0x204b9c[_0xebd4('0x7')]==_0x204b9c[_0xebd4('0x1a')]&&_0x204b9c[_0xebd4('0xc')]!='OutgoingSpoolFailed'){utils['info'](util[_0xebd4('0xa')](_0xebd4('0x1b'),_0x204b9c[_0xebd4('0x7')],_0x204b9c['context'],_0x204b9c['exten']));channels[_0x204b9c[_0xebd4('0x7')]]={'uniqueid':_0x204b9c[_0xebd4('0x7')],'accountcode':_0x204b9c[_0xebd4('0x13')],'source':_0x204b9c[_0xebd4('0x10')],'destination':_0x204b9c['exten'],'destinationcontext':_0x204b9c[_0xebd4('0x1c')],'channel':_0x204b9c['channel'],'starttime':utils[_0xebd4('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x28e5b9){utils['error'](util[_0xebd4('0xa')](_0xebd4('0x19'),_0x204b9c[_0xebd4('0x7')]),_0x28e5b9);}};exports[_0xebd4('0x1e')]=function(_0xa53269){try{utils[_0xebd4('0x1f')](util[_0xebd4('0xa')](_0xebd4('0x20'),_0xa53269[_0xebd4('0x7')]),_0xa53269);if(!_[_0xebd4('0x21')](channels[_0xa53269[_0xebd4('0x7')]])&&_0xa53269['channelstate']==0x6){utils[_0xebd4('0x9')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0xa53269[_0xebd4('0x7')],_0xa53269[_0xebd4('0x1c')],_0xa53269[_0xebd4('0xc')]));if(_[_0xebd4('0x21')](channels[_0xa53269[_0xebd4('0x7')]]['systemanswertime'])){channels[_0xa53269[_0xebd4('0x7')]][_0xebd4('0x22')]=utils[_0xebd4('0x1d')]();}}else if(!_[_0xebd4('0x21')](channels[_0xa53269[_0xebd4('0x1a')]])&&_0xa53269[_0xebd4('0x23')]==0x6&&_0xa53269['context']!='transfer'){utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0x24'),_0xa53269[_0xebd4('0x7')],_0xa53269[_0xebd4('0x1a')],_0xa53269[_0xebd4('0x1c')],_0xa53269[_0xebd4('0xc')]));channels[_0xa53269['linkedid']][_0xebd4('0x13')]=_0xa53269[_0xebd4('0x13')];channels[_0xa53269[_0xebd4('0x1a')]][_0xebd4('0x25')]=_0xa53269['channel'];if(_['isNil'](channels[_0xa53269['linkedid']][_0xebd4('0x26')])){channels[_0xa53269['linkedid']][_0xebd4('0x26')]=utils[_0xebd4('0x1d')]();}channels[_0xa53269['linkedid']][_0xebd4('0x27')]=dispositions[_[_0xebd4('0x28')](_0xa53269[_0xebd4('0x23')])]||_0xebd4('0x5');}}catch(_0x2aff01){utils[_0xebd4('0x29')](util['format'](_0xebd4('0x20'),_0xa53269['uniqueid']),_0x2aff01);}};exports[_0xebd4('0x2a')]=function(_0x35482d){try{if(!_[_0xebd4('0x21')](channels[_0x35482d[_0xebd4('0x7')]])){utils[_0xebd4('0x1f')](util[_0xebd4('0xa')](_0xebd4('0x2b'),_0x35482d['uniqueid']),_0x35482d);if(_[_0xebd4('0x21')](channels[_0x35482d['uniqueid']][_0xebd4('0x2c')])){channels[_0x35482d['uniqueid']][_0xebd4('0x2c')]=_0x35482d['calleridname']+'\x20<'+_0x35482d[_0xebd4('0x10')]+'>';}utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0x2d'),_0x35482d['uniqueid'],channels[_0x35482d['uniqueid']]['callerid'],_0x35482d['cause-txt']));channels[_0x35482d[_0xebd4('0x7')]][_0xebd4('0x2e')]=utils[_0xebd4('0x1d')]();channels[_0x35482d[_0xebd4('0x7')]][_0xebd4('0x2f')]=utils[_0xebd4('0x30')](channels[_0x35482d['uniqueid']][_0xebd4('0x2e')],channels[_0x35482d[_0xebd4('0x7')]][_0xebd4('0x31')]);channels[_0x35482d[_0xebd4('0x7')]][_0xebd4('0x32')]=channels[_0x35482d[_0xebd4('0x7')]]['answertime']?utils[_0xebd4('0x30')](channels[_0x35482d['uniqueid']][_0xebd4('0x2e')],channels[_0x35482d[_0xebd4('0x7')]][_0xebd4('0x26')]):0x0;writeDB(channels[_0x35482d[_0xebd4('0x7')]]);}}catch(_0x4e21b3){utils['error'](util[_0xebd4('0xa')](_0xebd4('0x2b'),_0x35482d[_0xebd4('0x7')]),_0x4e21b3);}};exports['attendedtransfer']=function(_0x405459){try{if(!_['isNil'](channels[_0x405459[_0xebd4('0x33')]])){utils[_0xebd4('0x1f')](util[_0xebd4('0xa')](_0xebd4('0x34'),_0x405459['origtransfereruniqueid']),_0x405459);if(channels[_0x405459[_0xebd4('0x33')]][_0xebd4('0xc')]==_0x405459[_0xebd4('0x35')]){utils['info'](util[_0xebd4('0xa')](_0xebd4('0x36'),_0x405459[_0xebd4('0x37')],_0x405459['localtwolinkedid'],_0x405459[_0xebd4('0x38')]));channels[_0x405459[_0xebd4('0x33')]][_0xebd4('0x25')]=_0x405459[_0xebd4('0x38')];channels[_0x405459[_0xebd4('0x33')]][_0xebd4('0x39')]=_0xebd4('0x3a');}else if(channels[_0x405459[_0xebd4('0x33')]]['channel']=_0x405459[_0xebd4('0x3b')]){utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0x36'),_0x405459[_0xebd4('0x37')],_0x405459[_0xebd4('0x33')],_0x405459['origtransfererchannel']));channels[_0x405459[_0xebd4('0x33')]][_0xebd4('0x25')]=_0x405459[_0xebd4('0x3c')];channels[_0x405459[_0xebd4('0x33')]]['userfield']=_0xebd4('0x3a');}}}catch(_0x3578a0){utils[_0xebd4('0x29')](util[_0xebd4('0xa')](_0xebd4('0x34'),_0x405459[_0xebd4('0x37')]),_0x3578a0);}};exports['musiconholdstart']=function(_0x36fe02){try{if(!_[_0xebd4('0x21')](channels[_0x36fe02[_0xebd4('0x7')]])){utils['debug'](util[_0xebd4('0xa')](_0xebd4('0x3d'),_0x36fe02[_0xebd4('0x7')]),_0x36fe02);channels[_0x36fe02['uniqueid']][_0xebd4('0x3e')]=utils[_0xebd4('0x1d')]();utils[_0xebd4('0x9')](util['format'](_0xebd4('0x3f'),_0x36fe02[_0xebd4('0x7')],channels[_0x36fe02['uniqueid']]['musiconholdstartAt']));}}catch(_0x12f083){utils[_0xebd4('0x29')](util[_0xebd4('0xa')]('[%s][calls][musiconholdstart]',_0x36fe02[_0xebd4('0x7')]),_0x12f083);}};exports['musiconholdstop']=function(_0x172281){try{if(!_[_0xebd4('0x21')](channels[_0x172281[_0xebd4('0x7')]])){utils[_0xebd4('0x1f')](util[_0xebd4('0xa')]('[%s][calls][musiconholdstop]',_0x172281[_0xebd4('0x7')]),_0x172281);if(!_[_0xebd4('0x21')](channels[_0x172281[_0xebd4('0x7')]][_0xebd4('0x3e')])){channels[_0x172281[_0xebd4('0x7')]][_0xebd4('0x40')]+=utils['diffTime'](utils[_0xebd4('0x1d')](),channels[_0x172281[_0xebd4('0x7')]][_0xebd4('0x3e')]);utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0x41'),_0x172281[_0xebd4('0x7')],channels[_0x172281[_0xebd4('0x7')]][_0xebd4('0x40')]));delete channels[_0x172281['uniqueid']]['musiconholdstartAt'];}}}catch(_0x3f1e47){utils['error'](util[_0xebd4('0xa')](_0xebd4('0x42'),_0x172281[_0xebd4('0x7')]),_0x3f1e47);}};exports[_0xebd4('0x43')]=function(_0x4b86a4){try{if(!_[_0xebd4('0x21')](channels[_0x4b86a4['uniqueid']])){utils[_0xebd4('0x1f')](util[_0xebd4('0xa')](_0xebd4('0x44'),_0x4b86a4[_0xebd4('0x7')]),_0x4b86a4);if(!_[_0xebd4('0x21')](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x46')])){utils['info'](util[_0xebd4('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x4b86a4[_0xebd4('0x7')],_0x4b86a4[_0xebd4('0x47')]));channels[_0x4b86a4['uniqueid']]['source']=_0x4b86a4[_0xebd4('0x47')];}if(!_[_0xebd4('0x21')](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x48')])){utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0x49'),_0x4b86a4[_0xebd4('0x7')],_0x4b86a4[_0xebd4('0x47')]));channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x4a')]=_0x4b86a4[_0xebd4('0x47')];channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x2c')]='\x22'+_0x4b86a4[_0xebd4('0x47')]+_0xebd4('0x4b')+_0x4b86a4[_0xebd4('0x47')]+'>';}if(!_['isNil'](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x4c')])||!_['isNil'](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x4d')])){utils[_0xebd4('0x9')](util[_0xebd4('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4b86a4[_0xebd4('0x7')],!_['isNil'](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x4c')])?_0xebd4('0x4c'):'xmd-callerid',_0x4b86a4['value']));channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x2c')]=_0x4b86a4[_0xebd4('0x47')];}if(!_['isNil'](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x4e')])||!_[_0xebd4('0x21')](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x4f')])){utils['info'](util[_0xebd4('0xa')](_0xebd4('0x50'),_0x4b86a4['uniqueid'],!_[_0xebd4('0x21')](_0x4b86a4[_0xebd4('0x45')]['xmd-queue'])?_0xebd4('0x4e'):'xmcs-queue',_0x4b86a4[_0xebd4('0x47')]));channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x51')]=_0xebd4('0x52');channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x53')]=_0x4b86a4['value'];channels[_0x4b86a4['uniqueid']][_0xebd4('0xd')]=!![];}if(!_['isNil'](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x54')])){utils[_0xebd4('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4b86a4[_0xebd4('0x7')],_0x4b86a4[_0xebd4('0x47')]));channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x55')]=_0x4b86a4[_0xebd4('0x47')];}if(!_['isNil'](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x56')])){utils[_0xebd4('0x9')](util[_0xebd4('0xa')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4b86a4[_0xebd4('0x7')],_0x4b86a4['value']));channels[_0x4b86a4[_0xebd4('0x7')]]['type']=_0x4b86a4[_0xebd4('0x47')];}if(!_[_0xebd4('0x21')](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x57')])){utils['info'](util['format'](_0xebd4('0x58'),_0x4b86a4['uniqueid'],_0x4b86a4[_0xebd4('0x47')]));channels[_0x4b86a4['uniqueid']][_0xebd4('0x59')]=_0x4b86a4['value'];}if(!_[_0xebd4('0x21')](_0x4b86a4[_0xebd4('0x45')][_0xebd4('0x5a')])){utils[_0xebd4('0x9')](util[_0xebd4('0xa')](_0xebd4('0x5b'),_0x4b86a4['uniqueid'],_0x4b86a4[_0xebd4('0x47')]));channels[_0x4b86a4[_0xebd4('0x7')]][_0xebd4('0x5a')]=_0x4b86a4[_0xebd4('0x47')];}}}catch(_0xb7c977){utils[_0xebd4('0x29')](util[_0xebd4('0xa')](_0xebd4('0x44'),_0x4b86a4[_0xebd4('0x7')]),_0xb7c977);}};exports['newexten']=function(_0x129636){try{if(!_[_0xebd4('0x21')](channels[_0x129636['uniqueid']])){utils[_0xebd4('0x1f')](util['format'](_0xebd4('0x5c'),_0x129636[_0xebd4('0x7')]),_0x129636);utils['info'](util[_0xebd4('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x129636[_0xebd4('0x7')],_0x129636['application'],_0x129636[_0xebd4('0x5d')]));if(_0x129636['application']['toLowerCase']()=='set'&&_[_0xebd4('0x5e')](_0x129636[_0xebd4('0x5d')][_0xebd4('0x5f')](),'cdr')){var _0x21fa38=_0x129636[_0xebd4('0x5d')][_0xebd4('0x60')]('=');var _0x2a89f0=_0x21fa38[0x0][_0xebd4('0x61')](_0x21fa38[0x0][_0xebd4('0x62')]('(')+0x1,_0x21fa38[0x0][_0xebd4('0x62')](')'));var _0x5c4ef2=_0x21fa38[0x1];channels[_0x129636[_0xebd4('0x7')]][_0x2a89f0]=_0x5c4ef2;}if(!_[_0xebd4('0x63')](['hangup',_0xebd4('0x64'),_0xebd4('0x65'),_0xebd4('0x66'),'gotoif'],_0x129636[_0xebd4('0x67')][_0xebd4('0x5f')]())){channels[_0x129636[_0xebd4('0x7')]]['lastapplication']=_0x129636[_0xebd4('0x67')];channels[_0x129636[_0xebd4('0x7')]]['lastdata']=_0x129636[_0xebd4('0x5d')];}}}catch(_0x2b64d5){utils[_0xebd4('0x29')](util[_0xebd4('0xa')](_0xebd4('0x5c'),_0x129636[_0xebd4('0x7')]),_0x2b64d5);}};
\ No newline at end of file
+var _0x21b1=['lastIndexOf','includes','noop','gotoif','toLowerCase','lastapplication','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','channel','membername','calleridnum','lastevent','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','isNil','systemanswertime','channelstate','transfer','answertime','toNumber','ANSWERED','[%s][calls][newstate]','hangup','callerid','calleridname','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set'];(function(_0x1b16e7,_0x3a270f){var _0x15338c=function(_0x398840){while(--_0x398840){_0x1b16e7['push'](_0x1b16e7['shift']());}};_0x15338c(++_0x3a270f);}(_0x21b1,0xdc));var _0x121b=function(_0x5de00b,_0x15885c){_0x5de00b=_0x5de00b-0x0;var _0x3f9d96=_0x21b1[_0x5de00b];return _0x3f9d96;};'use strict';var _=require('lodash');var util=require(_0x121b('0x0'));var utils=require(_0x121b('0x1'));var transfers=require(_0x121b('0x2'));var dispositions=[_0x121b('0x3'),_0x121b('0x4'),_0x121b('0x4'),'NO\x20ANSWER','NO\x20ANSWER',_0x121b('0x3'),'ANSWERED',_0x121b('0x5'),'FAILED','FAILED',_0x121b('0x4')];var channels={};function writeDB(_0x23edfc){var _0x22120b;if(transfers[_0x121b('0x6')][_0x23edfc[_0x121b('0x7')]]){_0x22120b=_0x23edfc['uniqueid'];_0x23edfc[_0x121b('0x7')]=transfers[_0x121b('0x6')][_0x23edfc['uniqueid']][_0x121b('0x8')];}utils[_0x121b('0x9')](util[_0x121b('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x23edfc['uniqueid'],_0x23edfc[_0x121b('0xb')],_0x23edfc['queue'],_0x23edfc[_0x121b('0xc')],_0x23edfc['interface'],_0x23edfc[_0x121b('0xd')],_0x23edfc['connectedlinenum'],_0x23edfc[_0x121b('0xe')]));if(_0x23edfc[_0x121b('0xf')]){utils['getUserByInternal'](_0x23edfc[_0x121b('0xf')])[_0x121b('0x10')](function(_0x557d48){if(_0x557d48){_0x23edfc['UserId']=_0x557d48['id'];}utils[_0x121b('0x11')](_0x121b('0x12'),_0x23edfc);});}else{utils['request']('CreateVoiceCallReport',_0x23edfc);}if(channels[_0x23edfc[_0x121b('0x7')]]){delete channels[_0x23edfc[_0x121b('0x7')]];}else if(_0x22120b&&channels[_0x22120b]){delete transfers['blinds'][_0x22120b];delete channels[_0x22120b];}}exports[_0x121b('0x13')]=function(_0x437553){try{utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x15'),_0x437553[_0x121b('0x7')]),_0x437553);if(_0x437553[_0x121b('0x7')]==_0x437553[_0x121b('0x16')]&&_0x437553['channel']!=_0x121b('0x17')){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x18'),_0x437553['uniqueid'],_0x437553[_0x121b('0x19')],_0x437553[_0x121b('0x1a')]));channels[_0x437553[_0x121b('0x7')]]={'uniqueid':_0x437553[_0x121b('0x7')],'accountcode':_0x437553[_0x121b('0xf')],'source':_0x437553[_0x121b('0xd')],'destination':_0x437553[_0x121b('0x1a')],'destinationcontext':_0x437553[_0x121b('0x19')],'channel':_0x437553[_0x121b('0xb')],'starttime':utils[_0x121b('0x1b')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x121b('0x3'),'amaflags':_0x121b('0x1c')};}}catch(_0x453dce){utils[_0x121b('0x1d')](util[_0x121b('0xa')](_0x121b('0x15'),_0x437553[_0x121b('0x7')]),_0x453dce);}};exports[_0x121b('0x1e')]=function(_0x41d72e){try{utils['debug'](util['format']('[%s][calls][newstate]',_0x41d72e[_0x121b('0x7')]),_0x41d72e);if(!_['isNil'](channels[_0x41d72e[_0x121b('0x7')]])&&_0x41d72e['channelstate']==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x41d72e['uniqueid'],_0x41d72e['context'],_0x41d72e[_0x121b('0xb')]));if(_[_0x121b('0x1f')](channels[_0x41d72e['uniqueid']]['systemanswertime'])){channels[_0x41d72e[_0x121b('0x7')]][_0x121b('0x20')]=utils[_0x121b('0x1b')]();}}else if(!_[_0x121b('0x1f')](channels[_0x41d72e['linkedid']])&&_0x41d72e[_0x121b('0x21')]==0x6&&_0x41d72e[_0x121b('0x19')]!=_0x121b('0x22')){utils['info'](util[_0x121b('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x41d72e['uniqueid'],_0x41d72e[_0x121b('0x16')],_0x41d72e[_0x121b('0x19')],_0x41d72e[_0x121b('0xb')]));channels[_0x41d72e[_0x121b('0x16')]][_0x121b('0xf')]=_0x41d72e[_0x121b('0xf')];channels[_0x41d72e[_0x121b('0x16')]]['destinationchannel']=_0x41d72e[_0x121b('0xb')];if(_['isNil'](channels[_0x41d72e['linkedid']][_0x121b('0x23')])){channels[_0x41d72e['linkedid']][_0x121b('0x23')]=utils[_0x121b('0x1b')]();}channels[_0x41d72e['linkedid']]['disposition']=dispositions[_[_0x121b('0x24')](_0x41d72e[_0x121b('0x21')])]||_0x121b('0x25');}}catch(_0x46049d){utils['error'](util['format'](_0x121b('0x26'),_0x41d72e[_0x121b('0x7')]),_0x46049d);}};exports[_0x121b('0x27')]=function(_0x3b09cb){try{if(!_[_0x121b('0x1f')](channels[_0x3b09cb[_0x121b('0x7')]])){utils[_0x121b('0x14')](util[_0x121b('0xa')]('[%s][calls][hangup]',_0x3b09cb[_0x121b('0x7')]),_0x3b09cb);if(_[_0x121b('0x1f')](channels[_0x3b09cb['uniqueid']][_0x121b('0x28')])){channels[_0x3b09cb['uniqueid']][_0x121b('0x28')]=_0x3b09cb[_0x121b('0x29')]+'\x20<'+_0x3b09cb['calleridnum']+'>';}utils['info'](util[_0x121b('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x3b09cb[_0x121b('0x7')],channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x28')],_0x3b09cb[_0x121b('0x2a')]));channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2b')]=utils['now']();channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2c')]=utils[_0x121b('0x2d')](channels[_0x3b09cb['uniqueid']][_0x121b('0x2b')],channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2e')]);channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2f')]=channels[_0x3b09cb[_0x121b('0x7')]]['answertime']?utils[_0x121b('0x2d')](channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x2b')],channels[_0x3b09cb[_0x121b('0x7')]][_0x121b('0x23')]):0x0;writeDB(channels[_0x3b09cb[_0x121b('0x7')]]);}}catch(_0x1c5cdb){utils['error'](util[_0x121b('0xa')](_0x121b('0x30'),_0x3b09cb[_0x121b('0x7')]),_0x1c5cdb);}};exports[_0x121b('0x31')]=function(_0x43279e){try{if(!_[_0x121b('0x1f')](channels[_0x43279e['localtwolinkedid']])){utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x32'),_0x43279e[_0x121b('0x33')]),_0x43279e);if(channels[_0x43279e[_0x121b('0x34')]]['channel']==_0x43279e['transfereechannel']){utils['info'](util[_0x121b('0xa')](_0x121b('0x35'),_0x43279e['origtransfereruniqueid'],_0x43279e['localtwolinkedid'],_0x43279e['secondtransfererchannel']));channels[_0x43279e[_0x121b('0x34')]][_0x121b('0x36')]=_0x43279e[_0x121b('0x37')];channels[_0x43279e[_0x121b('0x34')]]['userfield']=_0x121b('0x38');}else if(channels[_0x43279e['localtwolinkedid']][_0x121b('0xb')]=_0x43279e[_0x121b('0x39')]){utils['info'](util['format'](_0x121b('0x35'),_0x43279e[_0x121b('0x33')],_0x43279e[_0x121b('0x34')],_0x43279e['origtransfererchannel']));channels[_0x43279e['localtwolinkedid']][_0x121b('0x36')]=_0x43279e[_0x121b('0x3a')];channels[_0x43279e['localtwolinkedid']][_0x121b('0x3b')]='_attended';}}}catch(_0x3bd3a1){utils[_0x121b('0x1d')](util[_0x121b('0xa')](_0x121b('0x32'),_0x43279e[_0x121b('0x33')]),_0x3bd3a1);}};exports[_0x121b('0x3c')]=function(_0x1ec3e4){try{if(!_['isNil'](channels[_0x1ec3e4[_0x121b('0x7')]])){utils['debug'](util['format'](_0x121b('0x3d'),_0x1ec3e4[_0x121b('0x7')]),_0x1ec3e4);channels[_0x1ec3e4['uniqueid']][_0x121b('0x3e')]=utils['now']();utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x3f'),_0x1ec3e4[_0x121b('0x7')],channels[_0x1ec3e4[_0x121b('0x7')]][_0x121b('0x3e')]));}}catch(_0x5c4552){utils['error'](util[_0x121b('0xa')](_0x121b('0x3d'),_0x1ec3e4['uniqueid']),_0x5c4552);}};exports[_0x121b('0x40')]=function(_0x61689){try{if(!_['isNil'](channels[_0x61689['uniqueid']])){utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x41'),_0x61689[_0x121b('0x7')]),_0x61689);if(!_[_0x121b('0x1f')](channels[_0x61689[_0x121b('0x7')]]['musiconholdstartAt'])){channels[_0x61689[_0x121b('0x7')]][_0x121b('0x42')]+=utils[_0x121b('0x2d')](utils[_0x121b('0x1b')](),channels[_0x61689[_0x121b('0x7')]][_0x121b('0x3e')]);utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x43'),_0x61689['uniqueid'],channels[_0x61689[_0x121b('0x7')]][_0x121b('0x42')]));delete channels[_0x61689['uniqueid']]['musiconholdstartAt'];}}}catch(_0x5104e0){utils[_0x121b('0x1d')](util[_0x121b('0xa')](_0x121b('0x41'),_0x61689[_0x121b('0x7')]),_0x5104e0);}};exports[_0x121b('0x44')]=function(_0x5b0d4f){try{if(!_[_0x121b('0x1f')](channels[_0x5b0d4f[_0x121b('0x7')]])){utils[_0x121b('0x14')](util[_0x121b('0xa')](_0x121b('0x45'),_0x5b0d4f[_0x121b('0x7')]),_0x5b0d4f);if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x47')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x48'),_0x5b0d4f[_0x121b('0x7')],_0x5b0d4f['value']));channels[_0x5b0d4f['uniqueid']][_0x121b('0x49')]=_0x5b0d4f[_0x121b('0x4a')];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4b')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x4c'),_0x5b0d4f['uniqueid'],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]]['destination']=_0x5b0d4f[_0x121b('0x4a')];channels[_0x5b0d4f['uniqueid']][_0x121b('0x28')]='\x22'+_0x5b0d4f['value']+_0x121b('0x4d')+_0x5b0d4f[_0x121b('0x4a')]+'>';}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4e')])||!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4f')])){utils[_0x121b('0x9')](util['format'](_0x121b('0x50'),_0x5b0d4f[_0x121b('0x7')],!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x4e')])?_0x121b('0x4e'):'xmd-callerid',_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x28')]=_0x5b0d4f[_0x121b('0x4a')];}if(!_['isNil'](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x51')])||!_[_0x121b('0x1f')](_0x5b0d4f['variable'][_0x121b('0x52')])){utils[_0x121b('0x9')](util[_0x121b('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5b0d4f[_0x121b('0x7')],!_[_0x121b('0x1f')](_0x5b0d4f['variable'][_0x121b('0x51')])?_0x121b('0x51'):'xmcs-queue',_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]]['lastapplication']=_0x121b('0x53');channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x54')]=_0x5b0d4f[_0x121b('0x4a')];channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x55')]=!![];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x56')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x57'),_0x5b0d4f[_0x121b('0x7')],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]]['ContactId']=_0x5b0d4f['value'];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x58')])){utils['info'](util[_0x121b('0xa')](_0x121b('0x59'),_0x5b0d4f['uniqueid'],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x5a')]=_0x5b0d4f[_0x121b('0x4a')];}if(!_[_0x121b('0x1f')](_0x5b0d4f[_0x121b('0x46')][_0x121b('0x5b')])){utils[_0x121b('0x9')](util[_0x121b('0xa')](_0x121b('0x5c'),_0x5b0d4f['uniqueid'],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x5d')]=_0x5b0d4f['value'];}if(!_[_0x121b('0x1f')](_0x5b0d4f['variable']['sipcallid'])){utils[_0x121b('0x9')](util[_0x121b('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x5b0d4f[_0x121b('0x7')],_0x5b0d4f[_0x121b('0x4a')]));channels[_0x5b0d4f[_0x121b('0x7')]][_0x121b('0x5e')]=_0x5b0d4f[_0x121b('0x4a')];}}}catch(_0x71cc0e){utils['error'](util['format'](_0x121b('0x45'),_0x5b0d4f['uniqueid']),_0x71cc0e);}};exports[_0x121b('0x5f')]=function(_0x37f874){try{if(!_[_0x121b('0x1f')](channels[_0x37f874[_0x121b('0x7')]])){utils['debug'](util['format'](_0x121b('0x60'),_0x37f874[_0x121b('0x7')]),_0x37f874);utils[_0x121b('0x9')](util['format'](_0x121b('0x61'),_0x37f874[_0x121b('0x7')],_0x37f874[_0x121b('0x62')],_0x37f874[_0x121b('0x63')]));if(_0x37f874[_0x121b('0x62')]['toLowerCase']()==_0x121b('0x64')&&_['startsWith'](_0x37f874[_0x121b('0x63')]['toLowerCase'](),'cdr')){var _0xce62fc=_0x37f874['appdata']['split']('=');var _0x322b4e=_0xce62fc[0x0]['substring'](_0xce62fc[0x0]['lastIndexOf']('(')+0x1,_0xce62fc[0x0][_0x121b('0x65')](')'));var _0x19b278=_0xce62fc[0x1];channels[_0x37f874[_0x121b('0x7')]][_0x322b4e]=_0x19b278;}if(!_[_0x121b('0x66')]([_0x121b('0x27'),_0x121b('0x67'),'execif','set',_0x121b('0x68')],_0x37f874[_0x121b('0x62')][_0x121b('0x69')]())){channels[_0x37f874[_0x121b('0x7')]][_0x121b('0x6a')]=_0x37f874[_0x121b('0x62')];channels[_0x37f874['uniqueid']][_0x121b('0x54')]=_0x37f874[_0x121b('0x63')];}}}catch(_0x889776){utils['error'](util[_0x121b('0xa')](_0x121b('0x60'),_0x37f874['uniqueid']),_0x889776);}};
\ No newline at end of file
index a4b38d7..790229c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aaf=['connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','managerevent','./utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8aaf,0xc5));var _0xf8aa=function(_0x5ea03a,_0x365e95){_0x5ea03a=_0x5ea03a-0x0;var _0x50a174=_0x8aaf[_0x5ea03a];return _0x50a174;};'use strict';var utils=require(_0xf8aa('0x0'));exports[_0xf8aa('0x1')]=function(){utils[_0xf8aa('0x2')](_0xf8aa('0x3'));};exports[_0xf8aa('0x4')]=function(){utils[_0xf8aa('0x2')](_0xf8aa('0x5'));};exports[_0xf8aa('0x6')]=function(){utils[_0xf8aa('0x2')](_0xf8aa('0x7'));};exports[_0xf8aa('0x8')]=function(_0x180899){utils['error']('[core]\x20error',_0x180899);};exports[_0xf8aa('0x9')]=function(){utils['info']('[core]\x20close');};exports[_0xf8aa('0xa')]=function(_0x51852b){};
\ No newline at end of file
+var _0xa566=['connect','info','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','close','[core]\x20close','./utils'];(function(_0x1df07e,_0x475218){var _0x4b860e=function(_0x367657){while(--_0x367657){_0x1df07e['push'](_0x1df07e['shift']());}};_0x4b860e(++_0x475218);}(_0xa566,0x1c1));var _0x6a56=function(_0x8d4195,_0x609026){_0x8d4195=_0x8d4195-0x0;var _0x16cedb=_0xa566[_0x8d4195];return _0x16cedb;};'use strict';var utils=require(_0x6a56('0x0'));exports[_0x6a56('0x1')]=function(){utils[_0x6a56('0x2')]('[core]\x20connected');};exports[_0x6a56('0x3')]=function(){utils[_0x6a56('0x2')](_0x6a56('0x4'));};exports[_0x6a56('0x5')]=function(){utils['info'](_0x6a56('0x6'));};exports['error']=function(_0x4dc546){utils['error']('[core]\x20error',_0x4dc546);};exports[_0x6a56('0x7')]=function(){utils['info'](_0x6a56('0x8'));};exports['managerevent']=function(_0x33240c){};
\ No newline at end of file
index 47374f7..5296477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26d5=['starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','holdtime','diffTime','endtime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','toLowerCase','cdr(routeid)','varset','[%s][dials][varset]','isNil','value','error','dialbegin','assign'];(function(_0x13f58e,_0x265b14){var _0x47f915=function(_0x9676da){while(--_0x9676da){_0x13f58e['push'](_0x13f58e['shift']());}};_0x47f915(++_0x265b14);}(_0x26d5,0x10b));var _0x526d=function(_0x125be3,_0x156956){_0x125be3=_0x125be3-0x0;var _0x5901a6=_0x26d5[_0x125be3];return _0x5901a6;};'use strict';var _=require(_0x526d('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x54ded5){utils[_0x526d('0x1')](util[_0x526d('0x2')](_0x526d('0x3'),_0x54ded5[_0x526d('0x4')],_0x54ded5[_0x526d('0x5')],_0x54ded5[_0x526d('0x6')],_0x54ded5[_0x526d('0x7')],_0x54ded5[_0x526d('0x8')],_0x54ded5['dialstatus']));utils['request'](_0x526d('0x9'),_0x54ded5);delete dials[_0x54ded5['uniqueid']];}exports[_0x526d('0xa')]=function(_0x1cf61f){try{utils[_0x526d('0xb')](util[_0x526d('0x2')](_0x526d('0xc'),_0x1cf61f[_0x526d('0x4')]),_0x1cf61f);utils[_0x526d('0x1')](util[_0x526d('0x2')](_0x526d('0xd'),_0x1cf61f['uniqueid'],_0x1cf61f['application'],_0x1cf61f[_0x526d('0xe')]));if(_0x1cf61f[_0x526d('0xf')]['toLowerCase']()==_0x526d('0x10')&&_[_0x526d('0x11')](_0x1cf61f[_0x526d('0xe')][_0x526d('0x12')](),_0x526d('0x13'))){var _0x281f58=_0x1cf61f[_0x526d('0xe')]['split']('=');dials[_0x1cf61f[_0x526d('0x4')]]={'routeId':_0x281f58[0x1]};}}catch(_0x4020c3){utils['error'](util['format']('[%s][dials][newexten]',_0x1cf61f['uniqueid']),_0x4020c3);}};exports[_0x526d('0x14')]=function(_0x2de75a){try{utils['debug'](util[_0x526d('0x2')](_0x526d('0x15'),_0x2de75a[_0x526d('0x4')]),_0x2de75a);if(!_[_0x526d('0x16')](_0x2de75a['variable']['outboundrouteid'])){utils['info'](util[_0x526d('0x2')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2de75a['uniqueid'],_0x2de75a[_0x526d('0x17')]));dials[_0x2de75a[_0x526d('0x4')]]={'routeId':_0x2de75a[_0x526d('0x17')]};}}catch(_0x2f8ac8){utils[_0x526d('0x18')](util['format'](_0x526d('0x15'),_0x2de75a[_0x526d('0x4')]),_0x2f8ac8);}};exports[_0x526d('0x19')]=function(_0xcae350){try{if(!_['isNil'](dials[_0xcae350[_0x526d('0x4')]])){utils[_0x526d('0xb')](util[_0x526d('0x2')]('[%s][dials][dialbegin]',_0xcae350[_0x526d('0x4')]),_0xcae350);dials[_0xcae350[_0x526d('0x4')]]=_[_0x526d('0x1a')](dials[_0xcae350[_0x526d('0x4')]],_0xcae350);dials[_0xcae350[_0x526d('0x4')]][_0x526d('0x1b')]=utils[_0x526d('0x1c')]();dials[_0xcae350[_0x526d('0x4')]][_0x526d('0x1d')]='called';utils[_0x526d('0x1')](util['format'](_0x526d('0x1e'),_0xcae350[_0x526d('0x4')],dials[_0xcae350['uniqueid']][_0x526d('0x1b')]));}}catch(_0x187005){utils['error'](util[_0x526d('0x2')]('[%s][dials][dialbegin]',_0xcae350['uniqueid']),_0x187005);}};exports[_0x526d('0x1f')]=function(_0x2a9d82){try{if(!_[_0x526d('0x16')](dials[_0x2a9d82['uniqueid']])){utils[_0x526d('0xb')](util[_0x526d('0x2')](_0x526d('0x20'),_0x2a9d82[_0x526d('0x4')]),_0x2a9d82);dials[_0x2a9d82[_0x526d('0x4')]]['dialstatus']=_0x2a9d82[_0x526d('0x21')];if(_0x2a9d82['dialstatus']==_0x526d('0x22')){dials[_0x2a9d82[_0x526d('0x4')]]=_[_0x526d('0x1a')](dials[_0x2a9d82[_0x526d('0x4')]],_0x2a9d82);dials[_0x2a9d82['uniqueid']][_0x526d('0x23')]=utils[_0x526d('0x1c')]();dials[_0x2a9d82[_0x526d('0x4')]][_0x526d('0x1d')]=_0x526d('0x24');utils[_0x526d('0x1')](util[_0x526d('0x2')](_0x526d('0x25'),_0x2a9d82['uniqueid'],_0x2a9d82[_0x526d('0x21')],dials[_0x2a9d82[_0x526d('0x4')]]['answertime']));}else{utils[_0x526d('0x1')](util[_0x526d('0x2')](_0x526d('0x26'),_0x2a9d82[_0x526d('0x4')],_0x2a9d82['dialstatus']));}}}catch(_0x4421b6){utils[_0x526d('0x18')](util[_0x526d('0x2')](_0x526d('0x20'),_0x2a9d82['uniqueid']),_0x4421b6);}};exports['hangup']=function(_0x3ba4aa){try{if(!_[_0x526d('0x16')](dials[_0x3ba4aa[_0x526d('0x4')]])){utils['debug'](util[_0x526d('0x2')](_0x526d('0x27'),_0x3ba4aa['uniqueid']),_0x3ba4aa);utils[_0x526d('0x1')](util[_0x526d('0x2')](_0x526d('0x28'),_0x3ba4aa['uniqueid'],_0x3ba4aa['calleridnum'],_0x3ba4aa[_0x526d('0x29')],_0x3ba4aa[_0x526d('0x2a')]));dials[_0x3ba4aa[_0x526d('0x4')]]=_['assign'](dials[_0x3ba4aa[_0x526d('0x4')]],{'endtime':utils['now'](),'lastevent':_0x526d('0x2b')});dials[_0x3ba4aa[_0x526d('0x4')]][_0x526d('0x2c')]=utils['diffTime'](dials[_0x3ba4aa['uniqueid']]['endtime'],dials[_0x3ba4aa['uniqueid']][_0x526d('0x1b')]);dials[_0x3ba4aa[_0x526d('0x4')]][_0x526d('0x2d')]=utils[_0x526d('0x2e')](dials[_0x3ba4aa[_0x526d('0x4')]]['answertime']||dials[_0x3ba4aa['uniqueid']][_0x526d('0x2f')],dials[_0x3ba4aa[_0x526d('0x4')]]['starttime']);dials[_0x3ba4aa[_0x526d('0x4')]][_0x526d('0x30')]=dials[_0x3ba4aa['uniqueid']][_0x526d('0x23')]?utils[_0x526d('0x2e')](dials[_0x3ba4aa[_0x526d('0x4')]][_0x526d('0x2f')],dials[_0x3ba4aa['uniqueid']]['answertime']):0x0;writeDB(dials[_0x3ba4aa[_0x526d('0x4')]]);}}catch(_0x238bbb){utils['error'](util[_0x526d('0x2')](_0x526d('0x27'),_0x3ba4aa[_0x526d('0x4')]),_0x238bbb);}};
\ No newline at end of file
+var _0x953f=['value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','error','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x1911ac,_0x1ae4c1){var _0x4cba25=function(_0x43b349){while(--_0x43b349){_0x1911ac['push'](_0x1911ac['shift']());}};_0x4cba25(++_0x1ae4c1);}(_0x953f,0xea));var _0xf953=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x953f[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xf953('0x0'));var util=require(_0xf953('0x1'));var utils=require(_0xf953('0x2'));var dials={};function writeDB(_0x5d7db6){utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x5'),_0x5d7db6['uniqueid'],_0x5d7db6[_0xf953('0x6')],_0x5d7db6[_0xf953('0x7')],_0x5d7db6[_0xf953('0x8')],_0x5d7db6[_0xf953('0x9')],_0x5d7db6[_0xf953('0xa')]));utils['request'](_0xf953('0xb'),_0x5d7db6);delete dials[_0x5d7db6[_0xf953('0xc')]];}exports[_0xf953('0xd')]=function(_0x4347ea){try{utils[_0xf953('0xe')](util['format'](_0xf953('0xf'),_0x4347ea[_0xf953('0xc')]),_0x4347ea);utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x10'),_0x4347ea[_0xf953('0xc')],_0x4347ea[_0xf953('0x11')],_0x4347ea[_0xf953('0x12')]));if(_0x4347ea[_0xf953('0x11')][_0xf953('0x13')]()=='set'&&_[_0xf953('0x14')](_0x4347ea[_0xf953('0x12')][_0xf953('0x13')](),'cdr(routeid)')){var _0x5a5850=_0x4347ea[_0xf953('0x12')][_0xf953('0x15')]('=');dials[_0x4347ea[_0xf953('0xc')]]={'routeId':_0x5a5850[0x1]};}}catch(_0x5dfe45){utils['error'](util['format']('[%s][dials][newexten]',_0x4347ea[_0xf953('0xc')]),_0x5dfe45);}};exports['varset']=function(_0x110f9a){try{utils['debug'](util[_0xf953('0x4')](_0xf953('0x16'),_0x110f9a[_0xf953('0xc')]),_0x110f9a);if(!_[_0xf953('0x17')](_0x110f9a['variable'][_0xf953('0x18')])){utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x19'),_0x110f9a['uniqueid'],_0x110f9a['value']));dials[_0x110f9a['uniqueid']]={'routeId':_0x110f9a[_0xf953('0x1a')]};}}catch(_0x5d8e99){utils['error'](util[_0xf953('0x4')]('[%s][dials][varset]',_0x110f9a[_0xf953('0xc')]),_0x5d8e99);}};exports[_0xf953('0x1b')]=function(_0x617070){try{if(!_[_0xf953('0x17')](dials[_0x617070[_0xf953('0xc')]])){utils[_0xf953('0xe')](util['format'](_0xf953('0x1c'),_0x617070[_0xf953('0xc')]),_0x617070);dials[_0x617070[_0xf953('0xc')]]=_[_0xf953('0x1d')](dials[_0x617070[_0xf953('0xc')]],_0x617070);dials[_0x617070[_0xf953('0xc')]][_0xf953('0x1e')]=utils[_0xf953('0x1f')]();dials[_0x617070[_0xf953('0xc')]][_0xf953('0x20')]='called';utils[_0xf953('0x3')](util[_0xf953('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x617070['uniqueid'],dials[_0x617070[_0xf953('0xc')]][_0xf953('0x1e')]));}}catch(_0x4c32fd){utils['error'](util[_0xf953('0x4')](_0xf953('0x1c'),_0x617070[_0xf953('0xc')]),_0x4c32fd);}};exports[_0xf953('0x21')]=function(_0x15be6c){try{if(!_[_0xf953('0x17')](dials[_0x15be6c['uniqueid']])){utils[_0xf953('0xe')](util[_0xf953('0x4')](_0xf953('0x22'),_0x15be6c[_0xf953('0xc')]),_0x15be6c);dials[_0x15be6c[_0xf953('0xc')]][_0xf953('0xa')]=_0x15be6c[_0xf953('0xa')];if(_0x15be6c[_0xf953('0xa')]==_0xf953('0x23')){dials[_0x15be6c[_0xf953('0xc')]]=_[_0xf953('0x1d')](dials[_0x15be6c[_0xf953('0xc')]],_0x15be6c);dials[_0x15be6c[_0xf953('0xc')]][_0xf953('0x24')]=utils[_0xf953('0x1f')]();dials[_0x15be6c[_0xf953('0xc')]]['lastevent']=_0xf953('0x25');utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x26'),_0x15be6c[_0xf953('0xc')],_0x15be6c['dialstatus'],dials[_0x15be6c['uniqueid']][_0xf953('0x24')]));}else{utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x27'),_0x15be6c[_0xf953('0xc')],_0x15be6c[_0xf953('0xa')]));}}}catch(_0x16622d){utils[_0xf953('0x28')](util[_0xf953('0x4')]('[%s][dials][dialend]',_0x15be6c['uniqueid']),_0x16622d);}};exports[_0xf953('0x29')]=function(_0x567a1e){try{if(!_[_0xf953('0x17')](dials[_0x567a1e[_0xf953('0xc')]])){utils[_0xf953('0xe')](util[_0xf953('0x4')](_0xf953('0x2a'),_0x567a1e[_0xf953('0xc')]),_0x567a1e);utils[_0xf953('0x3')](util[_0xf953('0x4')](_0xf953('0x2b'),_0x567a1e[_0xf953('0xc')],_0x567a1e['calleridnum'],_0x567a1e[_0xf953('0x2c')],_0x567a1e[_0xf953('0x2d')]));dials[_0x567a1e[_0xf953('0xc')]]=_[_0xf953('0x1d')](dials[_0x567a1e[_0xf953('0xc')]],{'endtime':utils['now'](),'lastevent':_0xf953('0x2e')});dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x2f')]=utils[_0xf953('0x30')](dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x31')],dials[_0x567a1e[_0xf953('0xc')]]['starttime']);dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x32')]=utils['diffTime'](dials[_0x567a1e['uniqueid']]['answertime']||dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x31')],dials[_0x567a1e[_0xf953('0xc')]]['starttime']);dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x33')]=dials[_0x567a1e['uniqueid']][_0xf953('0x24')]?utils[_0xf953('0x30')](dials[_0x567a1e[_0xf953('0xc')]][_0xf953('0x31')],dials[_0x567a1e['uniqueid']]['answertime']):0x0;writeDB(dials[_0x567a1e['uniqueid']]);}}catch(_0x59f440){utils[_0xf953('0x28')](util[_0xf953('0x4')](_0xf953('0x2a'),_0x567a1e[_0xf953('0xc')]),_0x59f440);}};
\ No newline at end of file
index ad2a6a2..b04c57d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2744=['managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','error','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','close'];(function(_0x36ee05,_0x23afad){var _0x1d98f6=function(_0x371551){while(--_0x371551){_0x36ee05['push'](_0x36ee05['shift']());}};_0x1d98f6(++_0x23afad);}(_0x2744,0x6b));var _0x4274=function(_0x40c2de,_0x32c66e){_0x40c2de=_0x40c2de-0x0;var _0x11634f=_0x2744[_0x40c2de];return _0x11634f;};var AsteriskManager=require('asterisk-manager');var config=require(_0x4274('0x0'));var utils=require(_0x4274('0x1'));var util=require(_0x4274('0x2'));var ami=new AsteriskManager(config[_0x4274('0x3')]['port'],config[_0x4274('0x3')]['ip'],config[_0x4274('0x3')]['username'],config[_0x4274('0x3')][_0x4274('0x4')],!![]);ami[_0x4274('0x5')]();if(config[_0x4274('0x6')]&&config[_0x4274('0x6')][_0x4274('0x7')]){utils[_0x4274('0x8')](_0x4274('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0x4274('0xa'));var queues=require('./queues.controller');var recordings=require(_0x4274('0xb'));var members=require(_0x4274('0xc'));var dials=require(_0x4274('0xd'));var transfers=require('./transfers.controller');var core=require(_0x4274('0xe'));ami['on'](_0x4274('0xf'),core[_0x4274('0xf')]);ami['on'](_0x4274('0x10'),core[_0x4274('0x10')]);ami['on']('fullybooted',core[_0x4274('0x11')]);ami['on']('error',core['error']);ami['on'](_0x4274('0x12'),core[_0x4274('0x12')]);ami['on'](_0x4274('0x13'),core[_0x4274('0x13')]);ami['on'](_0x4274('0x14'),function(_0x146bfe){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x17'),_0x146bfe[_0x4274('0x18')]),_0x146bfe);members[_0x4274('0x14')](_0x146bfe);}catch(_0x2d1b65){utils[_0x4274('0x19')](util['format']('[%s][index][devicestatechange]',_0x146bfe['device']),_0x2d1b65);}});ami['on']('agentcalled',function(_0x29feb0){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x1a'),_0x29feb0['uniqueid']),_0x29feb0);agents['agentcalled'](_0x29feb0);}catch(_0x4d3ca1){utils[_0x4274('0x19')](util[_0x4274('0x16')]('[%s][index][agentcalled]',_0x29feb0['uniqueid']),_0x4d3ca1);}});ami['on'](_0x4274('0x1b'),function(_0x145ce6){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x1c'),_0x145ce6[_0x4274('0x1d')]),_0x145ce6);agents[_0x4274('0x1b')](_0x145ce6);}catch(_0x194fab){utils[_0x4274('0x19')](util[_0x4274('0x16')]('[%s][index][agentringnoanswer]',_0x145ce6[_0x4274('0x1d')]),_0x194fab);}});ami['on'](_0x4274('0x1e'),function(_0x41070b){try{utils[_0x4274('0x15')](util[_0x4274('0x16')]('[%s][index][agentconnect]',_0x41070b[_0x4274('0x1d')]),_0x41070b);agents['agentconnect'](_0x41070b);queues[_0x4274('0x1e')](_0x41070b);}catch(_0x2ad8bd){utils[_0x4274('0x19')](util['format'](_0x4274('0x1f'),_0x41070b['uniqueid']),_0x2ad8bd);}});ami['on'](_0x4274('0x20'),function(_0x31ad4d){try{utils[_0x4274('0x15')](util['format']('[%s][index][agentcomplete]',_0x31ad4d['uniqueid']),_0x31ad4d);agents[_0x4274('0x20')](_0x31ad4d);queues[_0x4274('0x20')](_0x31ad4d);members[_0x4274('0x20')](_0x31ad4d);}catch(_0x5c491c){utils['error'](util[_0x4274('0x16')](_0x4274('0x21'),_0x31ad4d[_0x4274('0x1d')]),_0x5c491c);}});ami['on'](_0x4274('0x22'),function(_0x94417a){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x23'),_0x94417a[_0x4274('0x1d')]),_0x94417a);agents[_0x4274('0x22')](_0x94417a);queues[_0x4274('0x22')](_0x94417a);}catch(_0x5ababf){utils[_0x4274('0x19')](util[_0x4274('0x16')]('[%s][index][queuecallerabandon]',_0x94417a[_0x4274('0x1d')]),_0x5ababf);}});ami['on'](_0x4274('0x24'),function(_0x319d56){try{utils['debug'](util[_0x4274('0x16')](_0x4274('0x25'),_0x319d56[_0x4274('0x1d')]),_0x319d56);queues[_0x4274('0x24')](_0x319d56);recordings[_0x4274('0x24')](_0x319d56);}catch(_0x7ef747){utils[_0x4274('0x19')](util['format'](_0x4274('0x25'),_0x319d56[_0x4274('0x1d')]),_0x7ef747);}});ami['on'](_0x4274('0x26'),function(_0x10bdc3){try{utils['debug'](util[_0x4274('0x16')](_0x4274('0x27'),_0x10bdc3[_0x4274('0x1d')]),_0x10bdc3);queues['queuecallerleave'](_0x10bdc3);}catch(_0x14be4a){utils['error'](util['format'](_0x4274('0x27'),_0x10bdc3[_0x4274('0x1d')]),_0x14be4a);}});ami['on'](_0x4274('0x28'),function(_0x5008f3){try{utils[_0x4274('0x15')](util[_0x4274('0x16')]('[%s][index][musiconholdstart]',_0x5008f3[_0x4274('0x1d')]),_0x5008f3);queues[_0x4274('0x28')](_0x5008f3);calls['musiconholdstart'](_0x5008f3);}catch(_0xd5599e){utils[_0x4274('0x19')](util[_0x4274('0x16')](_0x4274('0x29'),_0x5008f3[_0x4274('0x1d')]),_0xd5599e);}});ami['on'](_0x4274('0x2a'),function(_0xc3dd60){try{utils[_0x4274('0x15')](util['format'](_0x4274('0x2b'),_0xc3dd60[_0x4274('0x1d')]),_0xc3dd60);queues['musiconholdstop'](_0xc3dd60);calls[_0x4274('0x2a')](_0xc3dd60);}catch(_0x322fe3){utils[_0x4274('0x19')](util[_0x4274('0x16')]('[%s][index][musiconholdstop]',_0xc3dd60[_0x4274('0x1d')]),_0x322fe3);}});ami['on']('newstate',function(_0x2d17e7){try{utils['debug'](util[_0x4274('0x16')]('[%s][index][newstate]',_0x2d17e7[_0x4274('0x1d')]),_0x2d17e7);calls[_0x4274('0x2c')](_0x2d17e7);recordings[_0x4274('0x2c')](_0x2d17e7);}catch(_0xe4eebc){utils[_0x4274('0x19')](util[_0x4274('0x16')](_0x4274('0x2d'),_0x2d17e7[_0x4274('0x1d')]),_0xe4eebc);}});ami['on'](_0x4274('0x2e'),function(_0xa3e290){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x2f'),_0xa3e290[_0x4274('0x1d')]),_0xa3e290);calls[_0x4274('0x2e')](_0xa3e290);recordings[_0x4274('0x2e')](_0xa3e290);dials[_0x4274('0x2e')](_0xa3e290);agents[_0x4274('0x2e')](_0xa3e290);queues['hangup'](_0xa3e290);}catch(_0x323eb5){utils[_0x4274('0x19')](util[_0x4274('0x16')](_0x4274('0x2f'),_0xa3e290[_0x4274('0x1d')]),_0x323eb5);}});ami['on']('cdr',function(_0x449cd3){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x30'),_0x449cd3['uniqueid']),_0x449cd3);members[_0x4274('0x31')](_0x449cd3);}catch(_0x391535){utils['error'](util[_0x4274('0x16')](_0x4274('0x30'),_0x449cd3[_0x4274('0x1d')]),_0x391535);}});ami['on']('blindtransfer',function(_0x1b685b){try{utils[_0x4274('0x15')](util['format']('[%s][index][blindtransfer]',_0x1b685b[_0x4274('0x1d')]),_0x1b685b);queues[_0x4274('0x32')](_0x1b685b);agents['blindtransfer'](_0x1b685b);transfers[_0x4274('0x32')](_0x1b685b);}catch(_0x208a5b){utils[_0x4274('0x19')](util[_0x4274('0x16')]('[%s][index][blindtransfer]',_0x1b685b['uniqueid']),_0x208a5b);}});ami['on'](_0x4274('0x33'),function(_0x2f0366){try{utils['debug'](util[_0x4274('0x16')]('[%s][index][attendedtransfer]',_0x2f0366[_0x4274('0x34')]),_0x2f0366);queues[_0x4274('0x33')](_0x2f0366);transfers[_0x4274('0x33')](_0x2f0366);agents[_0x4274('0x33')](_0x2f0366);calls[_0x4274('0x33')](_0x2f0366);}catch(_0x5aee31){utils[_0x4274('0x19')](util[_0x4274('0x16')](_0x4274('0x35'),_0x2f0366[_0x4274('0x34')]),_0x5aee31);}});ami['on'](_0x4274('0x36'),function(_0x9a18bc){try{utils['debug'](util[_0x4274('0x16')](_0x4274('0x37'),_0x9a18bc[_0x4274('0x1d')]),_0x9a18bc);queues[_0x4274('0x36')](_0x9a18bc);recordings[_0x4274('0x36')](_0x9a18bc);calls[_0x4274('0x36')](_0x9a18bc);dials[_0x4274('0x36')](_0x9a18bc);}catch(_0x530a88){utils[_0x4274('0x19')](util[_0x4274('0x16')]('[%s][index][varset]',_0x9a18bc['uniqueid']),_0x530a88);}});ami['on'](_0x4274('0x38'),function(_0x2992cd){try{utils['debug'](util[_0x4274('0x16')]('[%s][index][newexten]',_0x2992cd[_0x4274('0x1d')]),_0x2992cd);calls[_0x4274('0x38')](_0x2992cd);recordings[_0x4274('0x38')](_0x2992cd);dials[_0x4274('0x38')](_0x2992cd);}catch(_0x17079b){utils['error'](util['format']('[%s][index][newexten]',_0x2992cd['uniqueid']),_0x17079b);}});ami['on'](_0x4274('0x39'),function(_0x4d30f1){try{utils[_0x4274('0x15')](util[_0x4274('0x16')](_0x4274('0x3a'),_0x4d30f1['uniqueid']),_0x4d30f1);calls[_0x4274('0x39')](_0x4d30f1);recordings[_0x4274('0x39')](_0x4d30f1);}catch(_0xe4d451){utils[_0x4274('0x19')](util[_0x4274('0x16')](_0x4274('0x3a'),_0x4d30f1[_0x4274('0x1d')]),_0xe4d451);}});ami['on'](_0x4274('0x3b'),function(_0x19fe72){try{utils['debug'](util['format']('[%s][index][dialbegin]',_0x19fe72[_0x4274('0x1d')]),_0x19fe72);dials[_0x4274('0x3b')](_0x19fe72);}catch(_0x3bf652){utils[_0x4274('0x19')](util['format'](_0x4274('0x3c'),_0x19fe72[_0x4274('0x1d')]),_0x3bf652);}});ami['on'](_0x4274('0x3d'),function(_0x159412){try{utils[_0x4274('0x15')](util['format'](_0x4274('0x3e'),_0x159412[_0x4274('0x1d')]),_0x159412);dials[_0x4274('0x3d')](_0x159412);}catch(_0x3de699){utils['error'](util[_0x4274('0x16')](_0x4274('0x3e'),_0x159412[_0x4274('0x1d')]),_0x3de699);}});}
\ No newline at end of file
+var _0x26a2=['./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%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]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','util','asterisk','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x11df8c,_0x4eb038){var _0x4d16b1=function(_0x11e663){while(--_0x11e663){_0x11df8c['push'](_0x11df8c['shift']());}};_0x4d16b1(++_0x4eb038);}(_0x26a2,0x1ae));var _0x226a=function(_0xf1d4e0,_0x53f8da){_0xf1d4e0=_0xf1d4e0-0x0;var _0x669a1b=_0x26a2[_0xf1d4e0];return _0x669a1b;};var AsteriskManager=require(_0x226a('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0x226a('0x1'));var ami=new AsteriskManager(config[_0x226a('0x2')]['port'],config[_0x226a('0x2')]['ip'],config[_0x226a('0x2')]['username'],config[_0x226a('0x2')]['password'],!![]);ami['keepConnected']();if(config[_0x226a('0x3')]&&config[_0x226a('0x3')][_0x226a('0x4')]){utils[_0x226a('0x5')](_0x226a('0x6'));}else{var agents=require(_0x226a('0x7'));var calls=require('./calls.controller');var queues=require(_0x226a('0x8'));var recordings=require(_0x226a('0x9'));var members=require(_0x226a('0xa'));var dials=require('./dials.controller');var transfers=require(_0x226a('0xb'));var core=require(_0x226a('0xc'));ami['on'](_0x226a('0xd'),core[_0x226a('0xd')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0x226a('0xe'),core['fullybooted']);ami['on'](_0x226a('0xf'),core['error']);ami['on'](_0x226a('0x10'),core[_0x226a('0x10')]);ami['on'](_0x226a('0x11'),core[_0x226a('0x11')]);ami['on'](_0x226a('0x12'),function(_0x206916){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x14'),_0x206916[_0x226a('0x15')]),_0x206916);members['devicestatechange'](_0x206916);}catch(_0x1022f1){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x14'),_0x206916[_0x226a('0x15')]),_0x1022f1);}});ami['on'](_0x226a('0x16'),function(_0x5a144c){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x18'),_0x5a144c[_0x226a('0x19')]),_0x5a144c);agents[_0x226a('0x16')](_0x5a144c);}catch(_0x258a0f){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x18'),_0x5a144c[_0x226a('0x19')]),_0x258a0f);}});ami['on'](_0x226a('0x1a'),function(_0x8619c){try{utils['debug'](util[_0x226a('0x13')]('[%s][index][agentringnoanswer]',_0x8619c[_0x226a('0x19')]),_0x8619c);agents[_0x226a('0x1a')](_0x8619c);}catch(_0x1fd243){utils[_0x226a('0xf')](util['format'](_0x226a('0x1b'),_0x8619c[_0x226a('0x19')]),_0x1fd243);}});ami['on']('agentconnect',function(_0x49724f){try{utils['debug'](util['format'](_0x226a('0x1c'),_0x49724f[_0x226a('0x19')]),_0x49724f);agents[_0x226a('0x1d')](_0x49724f);queues[_0x226a('0x1d')](_0x49724f);}catch(_0xbc921b){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x1c'),_0x49724f[_0x226a('0x19')]),_0xbc921b);}});ami['on']('agentcomplete',function(_0x59466f){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x1e'),_0x59466f[_0x226a('0x19')]),_0x59466f);agents[_0x226a('0x1f')](_0x59466f);queues['agentcomplete'](_0x59466f);members[_0x226a('0x1f')](_0x59466f);}catch(_0x1b4d04){utils['error'](util[_0x226a('0x13')](_0x226a('0x1e'),_0x59466f['uniqueid']),_0x1b4d04);}});ami['on'](_0x226a('0x20'),function(_0x26173a){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x21'),_0x26173a['uniqueid']),_0x26173a);agents[_0x226a('0x20')](_0x26173a);queues[_0x226a('0x20')](_0x26173a);}catch(_0x1fed2c){utils[_0x226a('0xf')](util[_0x226a('0x13')]('[%s][index][queuecallerabandon]',_0x26173a[_0x226a('0x19')]),_0x1fed2c);}});ami['on'](_0x226a('0x22'),function(_0x43f584){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x23'),_0x43f584[_0x226a('0x19')]),_0x43f584);queues[_0x226a('0x22')](_0x43f584);recordings['queuecallerjoin'](_0x43f584);}catch(_0x271ddf){utils[_0x226a('0xf')](util['format']('[%s][index][queuecallerjoin]',_0x43f584[_0x226a('0x19')]),_0x271ddf);}});ami['on']('queuecallerleave',function(_0x480081){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x24'),_0x480081[_0x226a('0x19')]),_0x480081);queues['queuecallerleave'](_0x480081);}catch(_0x21a9d2){utils[_0x226a('0xf')](util[_0x226a('0x13')]('[%s][index][queuecallerleave]',_0x480081[_0x226a('0x19')]),_0x21a9d2);}});ami['on'](_0x226a('0x25'),function(_0x1e768d){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x26'),_0x1e768d['uniqueid']),_0x1e768d);queues[_0x226a('0x25')](_0x1e768d);calls[_0x226a('0x25')](_0x1e768d);}catch(_0x3892d2){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x26'),_0x1e768d[_0x226a('0x19')]),_0x3892d2);}});ami['on'](_0x226a('0x27'),function(_0x104c2c){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x28'),_0x104c2c[_0x226a('0x19')]),_0x104c2c);queues[_0x226a('0x27')](_0x104c2c);calls['musiconholdstop'](_0x104c2c);}catch(_0x13ffde){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x28'),_0x104c2c[_0x226a('0x19')]),_0x13ffde);}});ami['on'](_0x226a('0x29'),function(_0x1e32eb){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x2a'),_0x1e32eb[_0x226a('0x19')]),_0x1e32eb);calls['newstate'](_0x1e32eb);recordings['newstate'](_0x1e32eb);}catch(_0x1dc065){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x2a'),_0x1e32eb[_0x226a('0x19')]),_0x1dc065);}});ami['on']('hangup',function(_0x494d9c){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x2b'),_0x494d9c[_0x226a('0x19')]),_0x494d9c);calls['hangup'](_0x494d9c);recordings[_0x226a('0x2c')](_0x494d9c);dials[_0x226a('0x2c')](_0x494d9c);agents[_0x226a('0x2c')](_0x494d9c);queues['hangup'](_0x494d9c);}catch(_0x41eeed){utils[_0x226a('0xf')](util['format'](_0x226a('0x2b'),_0x494d9c[_0x226a('0x19')]),_0x41eeed);}});ami['on'](_0x226a('0x2d'),function(_0x206f4f){try{utils[_0x226a('0x17')](util['format']('[%s][index][cdr]',_0x206f4f[_0x226a('0x19')]),_0x206f4f);members[_0x226a('0x2d')](_0x206f4f);}catch(_0x233f28){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x2e'),_0x206f4f[_0x226a('0x19')]),_0x233f28);}});ami['on'](_0x226a('0x2f'),function(_0x5cb192){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x30'),_0x5cb192[_0x226a('0x19')]),_0x5cb192);queues[_0x226a('0x2f')](_0x5cb192);agents[_0x226a('0x2f')](_0x5cb192);transfers[_0x226a('0x2f')](_0x5cb192);}catch(_0x24badb){utils['error'](util[_0x226a('0x13')](_0x226a('0x30'),_0x5cb192[_0x226a('0x19')]),_0x24badb);}});ami['on'](_0x226a('0x31'),function(_0x58fb7e){try{utils['debug'](util[_0x226a('0x13')](_0x226a('0x32'),_0x58fb7e[_0x226a('0x33')]),_0x58fb7e);queues[_0x226a('0x31')](_0x58fb7e);transfers['attendedtransfer'](_0x58fb7e);agents['attendedtransfer'](_0x58fb7e);calls[_0x226a('0x31')](_0x58fb7e);}catch(_0x20b86b){utils[_0x226a('0xf')](util['format'](_0x226a('0x32'),_0x58fb7e[_0x226a('0x33')]),_0x20b86b);}});ami['on'](_0x226a('0x34'),function(_0x4f028c){try{utils['debug'](util['format'](_0x226a('0x35'),_0x4f028c[_0x226a('0x19')]),_0x4f028c);queues['varset'](_0x4f028c);recordings[_0x226a('0x34')](_0x4f028c);calls[_0x226a('0x34')](_0x4f028c);dials[_0x226a('0x34')](_0x4f028c);}catch(_0x5ca4b2){utils[_0x226a('0xf')](util['format'](_0x226a('0x35'),_0x4f028c[_0x226a('0x19')]),_0x5ca4b2);}});ami['on']('newexten',function(_0x422ed3){try{utils[_0x226a('0x17')](util[_0x226a('0x13')](_0x226a('0x36'),_0x422ed3[_0x226a('0x19')]),_0x422ed3);calls[_0x226a('0x37')](_0x422ed3);recordings[_0x226a('0x37')](_0x422ed3);dials[_0x226a('0x37')](_0x422ed3);}catch(_0x5a60c3){utils[_0x226a('0xf')](util['format']('[%s][index][newexten]',_0x422ed3[_0x226a('0x19')]),_0x5a60c3);}});ami['on'](_0x226a('0x38'),function(_0x14253c){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x39'),_0x14253c['uniqueid']),_0x14253c);calls['newchannel'](_0x14253c);recordings[_0x226a('0x38')](_0x14253c);}catch(_0x545ccc){utils[_0x226a('0xf')](util[_0x226a('0x13')](_0x226a('0x39'),_0x14253c[_0x226a('0x19')]),_0x545ccc);}});ami['on'](_0x226a('0x3a'),function(_0x4fa196){try{utils[_0x226a('0x17')](util['format'](_0x226a('0x3b'),_0x4fa196['uniqueid']),_0x4fa196);dials['dialbegin'](_0x4fa196);}catch(_0xa30746){utils[_0x226a('0xf')](util['format'](_0x226a('0x3c'),_0x4fa196['uniqueid']),_0xa30746);}});ami['on'](_0x226a('0x3d'),function(_0x2d803c){try{utils['debug'](util['format']('[%s][index][dialend]',_0x2d803c[_0x226a('0x19')]),_0x2d803c);dials[_0x226a('0x3d')](_0x2d803c);}catch(_0x32dbed){utils[_0x226a('0xf')](util['format'](_0x226a('0x3e'),_0x2d803c[_0x226a('0x19')]),_0x32dbed);}});}
\ No newline at end of file
index 4b7307b..4ab4248 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0834=['getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','[%s][members][writeDB]','some','devicestatechange','debug','uniqueid','device','INUSE','BUSY','now','agent','duration','diffTime','exitAt','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','info','queue','assign','[%s][members][cdr]','data1','type','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data2','destinationchannel','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername'];(function(_0x382602,_0x5e9d2d){var _0x14dda6=function(_0xf65c39){while(--_0xf65c39){_0x382602['push'](_0x382602['shift']());}};_0x14dda6(++_0x5e9d2d);}(_0x0834,0x18e));var _0x4083=function(_0x1a175f,_0x4c2f6c){_0x1a175f=_0x1a175f-0x0;var _0x370aef=_0x0834[_0x1a175f];return _0x370aef;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4083('0x0'));var members={};var exclude=[_0x4083('0x1'),'Queue:'];function writeDB(_0x491147){utils['info'](util[_0x4083('0x2')](_0x4083('0x3'),_0x491147['uniqueid'],_0x491147[_0x4083('0x4')],_0x491147[_0x4083('0x5')],_0x491147['data2'],_0x491147[_0x4083('0x6')],_0x491147['type']));if(_0x491147[_0x4083('0x4')]){utils[_0x4083('0x7')](_0x491147[_0x4083('0x4')])[_0x4083('0x8')](function(_0x129337){if(_0x129337){_0x491147[_0x4083('0x6')]=_0x129337[_0x4083('0x9')];_0x491147[_0x4083('0xa')]=_0x129337[_0x4083('0xa')];utils[_0x4083('0xb')](_0x4083('0xc'),_0x491147);}else{utils[_0x4083('0xd')](_0x491147[_0x4083('0x4')][_0x4083('0xe')]('/')[0x1])[_0x4083('0x8')](function(_0x51b4b8){if(_0x51b4b8){_0x491147['membername']=_0x51b4b8[_0x4083('0x9')];_0x491147[_0x4083('0xa')]=_0x51b4b8['internal'];utils[_0x4083('0xb')](_0x4083('0xc'),_0x491147);}});}})[_0x4083('0xf')](function(_0x590a81){utils['error'](util[_0x4083('0x2')](_0x4083('0x10'),_0x491147['uniqueid']),_0x590a81);});}delete members[_0x491147[_0x4083('0x4')]];}function startsWith(_0x316e54,_0xc7c267){return _[_0x4083('0x11')](_0x316e54,function(_0x38757d){return _['startsWith'](_0xc7c267,_0x38757d);});}exports[_0x4083('0x12')]=function(_0x10cadd){try{utils[_0x4083('0x13')](util[_0x4083('0x2')]('[%s][members][devicestatechange]',members[_0x10cadd['device']]?members[_0x10cadd['device']][_0x4083('0x14')]:_0x10cadd[_0x4083('0x15')]),_0x10cadd);utils['info'](util[_0x4083('0x2')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x10cadd[_0x4083('0x15')]]?members[_0x10cadd[_0x4083('0x15')]][_0x4083('0x14')]:_0x10cadd[_0x4083('0x15')],_0x10cadd['state'],_0x10cadd[_0x4083('0x15')]));switch(_0x10cadd['state']){case _0x4083('0x16'):case _0x4083('0x17'):if(!startsWith(exclude,_0x10cadd[_0x4083('0x15')])){members[_0x10cadd[_0x4083('0x15')]]={'channel':'voice','interface':_0x10cadd[_0x4083('0x15')],'type':'TALKING','enterAt':utils[_0x4083('0x18')](),'role':_0x4083('0x19')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x10cadd[_0x4083('0x15')]])){members[_0x10cadd['device']]['exitAt']=utils['now']();members[_0x10cadd[_0x4083('0x15')]][_0x4083('0x1a')]=utils[_0x4083('0x1b')](members[_0x10cadd['device']][_0x4083('0x1c')],members[_0x10cadd[_0x4083('0x15')]][_0x4083('0x1d')]);if(members[_0x10cadd['device']][_0x4083('0x14')]){writeDB(members[_0x10cadd[_0x4083('0x15')]]);}}break;default:break;}}catch(_0x5f5679){utils[_0x4083('0x1e')](util[_0x4083('0x2')](_0x4083('0x1f'),members[_0x10cadd[_0x4083('0x15')]]?members[_0x10cadd[_0x4083('0x15')]][_0x4083('0x14')]:_0x10cadd[_0x4083('0x15')]),_0x5f5679);}};exports[_0x4083('0x20')]=function(_0x2a56b5){try{if(!_['isNil'](members[_0x2a56b5['interface']])){utils[_0x4083('0x13')](util[_0x4083('0x2')](_0x4083('0x21'),_0x2a56b5[_0x4083('0x14')]),_0x2a56b5);utils[_0x4083('0x22')](util[_0x4083('0x2')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x2a56b5[_0x4083('0x14')],_0x2a56b5[_0x4083('0x4')],_0x2a56b5[_0x4083('0x23')]));members[_0x2a56b5[_0x4083('0x4')]]=_[_0x4083('0x24')](members[_0x2a56b5[_0x4083('0x4')]],{'data4':_0x2a56b5['queue'],'uniqueid':_0x2a56b5[_0x4083('0x14')]});}}catch(_0x1f3ef1){utils[_0x4083('0x1e')](util[_0x4083('0x2')](_0x4083('0x21'),_0x2a56b5[_0x4083('0x14')]),_0x1f3ef1);}};exports['cdr']=function(_0x33850c){try{utils['debug'](util[_0x4083('0x2')](_0x4083('0x25'),_0x33850c['uniqueid']),_0x33850c);if(_0x33850c[_0x4083('0x5')]){var _0xaeff25=_0x33850c[_0x4083('0x5')][_0x4083('0xe')]('-')[0x0];if(!_['isNil'](members[_0xaeff25])){members[_0xaeff25]=_['assign'](members[_0xaeff25],{'data1':members[_0xaeff25][_0x4083('0x26')]||_0x33850c[_0x4083('0x27')],'data2':members[_0xaeff25]['data2']||_0x33850c[_0x4083('0x28')],'data3':members[_0xaeff25]['data3']||_0x33850c[_0x4083('0x29')],'uniqueid':members[_0xaeff25]['uniqueid']||_0x33850c['uniqueid']});utils['info'](util[_0x4083('0x2')](_0x4083('0x2a'),_0x33850c[_0x4083('0x14')],members[_0xaeff25][_0x4083('0x26')],members[_0xaeff25][_0x4083('0x2b')],members[_0xaeff25]['data3']));if(members[_0xaeff25]['exitAt']){writeDB(members[_0xaeff25]);}}}if(_0x33850c[_0x4083('0x2c')]){var _0x457a6b=_0x33850c['destinationchannel'][_0x4083('0xe')]('-')[0x0];if(!_['isNil'](members[_0x457a6b])){members[_0x457a6b]=_['assign'](members[_0x457a6b],{'data1':members[_0x457a6b]['data1']||_0x33850c[_0x4083('0x27')],'data2':members[_0x457a6b][_0x4083('0x2b')]||_0x33850c[_0x4083('0x28')],'data3':members[_0x457a6b]['data3']||_0x33850c['destination'],'uniqueid':members[_0x457a6b][_0x4083('0x14')]||_0x33850c['uniqueid']});utils[_0x4083('0x22')](util[_0x4083('0x2')](_0x4083('0x2a'),_0x33850c[_0x4083('0x14')],members[_0x457a6b][_0x4083('0x26')],members[_0x457a6b][_0x4083('0x2b')],members[_0x457a6b]['data3']));if(members[_0x457a6b][_0x4083('0x1c')]){writeDB(members[_0x457a6b]);}}}}catch(_0x1ad1f1){utils['error'](util['format'](_0x4083('0x25'),_0x33850c['uniqueid']),_0x1ad1f1);}};
\ No newline at end of file
+var _0x3fec=['device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','lodash','Local/_attended@transfer','Queue:','info','uniqueid','channel','data2','membername','type','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','format','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xc3fe('0x1'),_0xc3fe('0x2')];function writeDB(_0x5adb4c){utils[_0xc3fe('0x3')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5adb4c[_0xc3fe('0x4')],_0x5adb4c['interface'],_0x5adb4c[_0xc3fe('0x5')],_0x5adb4c[_0xc3fe('0x6')],_0x5adb4c[_0xc3fe('0x7')],_0x5adb4c[_0xc3fe('0x8')]));if(_0x5adb4c[_0xc3fe('0x9')]){utils[_0xc3fe('0xa')](_0x5adb4c[_0xc3fe('0x9')])[_0xc3fe('0xb')](function(_0x25b1eb){if(_0x25b1eb){_0x5adb4c[_0xc3fe('0x7')]=_0x25b1eb[_0xc3fe('0xc')];_0x5adb4c[_0xc3fe('0xd')]=_0x25b1eb[_0xc3fe('0xd')];utils[_0xc3fe('0xe')](_0xc3fe('0xf'),_0x5adb4c);}else{utils[_0xc3fe('0x10')](_0x5adb4c['interface'][_0xc3fe('0x11')]('/')[0x1])[_0xc3fe('0xb')](function(_0x4ff4c2){if(_0x4ff4c2){_0x5adb4c[_0xc3fe('0x7')]=_0x4ff4c2[_0xc3fe('0xc')];_0x5adb4c[_0xc3fe('0xd')]=_0x4ff4c2[_0xc3fe('0xd')];utils[_0xc3fe('0xe')](_0xc3fe('0xf'),_0x5adb4c);}});}})[_0xc3fe('0x12')](function(_0x7d5e67){utils[_0xc3fe('0x13')](util[_0xc3fe('0x14')]('[%s][members][writeDB]',_0x5adb4c[_0xc3fe('0x4')]),_0x7d5e67);});}delete members[_0x5adb4c['interface']];}function startsWith(_0x10091c,_0x18e5ed){return _[_0xc3fe('0x15')](_0x10091c,function(_0x25ce78){return _[_0xc3fe('0x16')](_0x18e5ed,_0x25ce78);});}exports[_0xc3fe('0x17')]=function(_0x1e291f){try{utils[_0xc3fe('0x18')](util[_0xc3fe('0x14')](_0xc3fe('0x19'),members[_0x1e291f[_0xc3fe('0x1a')]]?members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x4')]:_0x1e291f[_0xc3fe('0x1a')]),_0x1e291f);utils[_0xc3fe('0x3')](util['format'](_0xc3fe('0x1b'),members[_0x1e291f[_0xc3fe('0x1a')]]?members[_0x1e291f[_0xc3fe('0x1a')]]['uniqueid']:_0x1e291f[_0xc3fe('0x1a')],_0x1e291f[_0xc3fe('0x1c')],_0x1e291f['device']));switch(_0x1e291f['state']){case _0xc3fe('0x1d'):case _0xc3fe('0x1e'):if(!startsWith(exclude,_0x1e291f[_0xc3fe('0x1a')])){members[_0x1e291f['device']]={'channel':_0xc3fe('0x1f'),'interface':_0x1e291f[_0xc3fe('0x1a')],'type':_0xc3fe('0x20'),'enterAt':utils[_0xc3fe('0x21')](),'role':_0xc3fe('0x22')};}break;case _0xc3fe('0x23'):if(!_[_0xc3fe('0x24')](members[_0x1e291f[_0xc3fe('0x1a')]])){members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x25')]=utils[_0xc3fe('0x21')]();members[_0x1e291f[_0xc3fe('0x1a')]]['duration']=utils[_0xc3fe('0x26')](members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x25')],members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x27')]);if(members[_0x1e291f['device']][_0xc3fe('0x4')]){writeDB(members[_0x1e291f[_0xc3fe('0x1a')]]);}}break;default:break;}}catch(_0x2bfaa0){utils[_0xc3fe('0x13')](util[_0xc3fe('0x14')](_0xc3fe('0x19'),members[_0x1e291f[_0xc3fe('0x1a')]]?members[_0x1e291f[_0xc3fe('0x1a')]][_0xc3fe('0x4')]:_0x1e291f[_0xc3fe('0x1a')]),_0x2bfaa0);}};exports[_0xc3fe('0x28')]=function(_0x17fe31){try{if(!_[_0xc3fe('0x24')](members[_0x17fe31[_0xc3fe('0x9')]])){utils[_0xc3fe('0x18')](util[_0xc3fe('0x14')](_0xc3fe('0x29'),_0x17fe31[_0xc3fe('0x4')]),_0x17fe31);utils['info'](util[_0xc3fe('0x14')](_0xc3fe('0x2a'),_0x17fe31[_0xc3fe('0x4')],_0x17fe31[_0xc3fe('0x9')],_0x17fe31[_0xc3fe('0x2b')]));members[_0x17fe31[_0xc3fe('0x9')]]=_[_0xc3fe('0x2c')](members[_0x17fe31[_0xc3fe('0x9')]],{'data4':_0x17fe31[_0xc3fe('0x2b')],'uniqueid':_0x17fe31[_0xc3fe('0x4')]});}}catch(_0x7b42b9){utils['error'](util['format']('[%s][members][agentcomplete]',_0x17fe31[_0xc3fe('0x4')]),_0x7b42b9);}};exports[_0xc3fe('0x2d')]=function(_0x56ad4f){try{utils[_0xc3fe('0x18')](util[_0xc3fe('0x14')]('[%s][members][cdr]',_0x56ad4f['uniqueid']),_0x56ad4f);if(_0x56ad4f[_0xc3fe('0x5')]){var _0x237680=_0x56ad4f[_0xc3fe('0x5')][_0xc3fe('0x11')]('-')[0x0];if(!_['isNil'](members[_0x237680])){members[_0x237680]=_['assign'](members[_0x237680],{'data1':members[_0x237680][_0xc3fe('0x2e')]||_0x56ad4f[_0xc3fe('0x8')],'data2':members[_0x237680][_0xc3fe('0x6')]||_0x56ad4f[_0xc3fe('0x2f')],'data3':members[_0x237680]['data3']||_0x56ad4f[_0xc3fe('0x30')],'uniqueid':members[_0x237680]['uniqueid']||_0x56ad4f[_0xc3fe('0x4')]});utils['info'](util[_0xc3fe('0x14')](_0xc3fe('0x31'),_0x56ad4f['uniqueid'],members[_0x237680][_0xc3fe('0x2e')],members[_0x237680][_0xc3fe('0x6')],members[_0x237680]['data3']));if(members[_0x237680][_0xc3fe('0x25')]){writeDB(members[_0x237680]);}}}if(_0x56ad4f['destinationchannel']){var _0x217f17=_0x56ad4f[_0xc3fe('0x32')][_0xc3fe('0x11')]('-')[0x0];if(!_[_0xc3fe('0x24')](members[_0x217f17])){members[_0x217f17]=_[_0xc3fe('0x2c')](members[_0x217f17],{'data1':members[_0x217f17]['data1']||_0x56ad4f[_0xc3fe('0x8')],'data2':members[_0x217f17][_0xc3fe('0x6')]||_0x56ad4f[_0xc3fe('0x2f')],'data3':members[_0x217f17][_0xc3fe('0x33')]||_0x56ad4f[_0xc3fe('0x30')],'uniqueid':members[_0x217f17][_0xc3fe('0x4')]||_0x56ad4f[_0xc3fe('0x4')]});utils['info'](util[_0xc3fe('0x14')](_0xc3fe('0x31'),_0x56ad4f[_0xc3fe('0x4')],members[_0x217f17][_0xc3fe('0x2e')],members[_0x217f17][_0xc3fe('0x6')],members[_0x217f17][_0xc3fe('0x33')]));if(members[_0x217f17][_0xc3fe('0x25')]){writeDB(members[_0x217f17]);}}}}catch(_0x5d4bfc){utils['error'](util[_0xc3fe('0x14')]('[%s][members][cdr]',_0x56ad4f['uniqueid']),_0x5d4bfc);}};
\ No newline at end of file
index 76ca631..e9cddac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35c0=['transfertargetlinkedid','transfertargetuniqueid','queuecallerjoinAt','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','position','now','error','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%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','queuecallerleaveAt','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','accountcode','agentcomplete','assigned','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','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'];(function(_0x5976f8,_0x1265b7){var _0x179715=function(_0x2b2c4b){while(--_0x2b2c4b){_0x5976f8['push'](_0x5976f8['shift']());}};_0x179715(++_0x1265b7);}(_0x35c0,0x6d));var _0x035c=function(_0x1de357,_0x10512b){_0x1de357=_0x1de357-0x0;var _0x56cd22=_0x35c0[_0x1de357];return _0x56cd22;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x035c('0x0'));var queues={};function writeDB(_0x1bb3e8){utils['info'](util[_0x035c('0x1')](_0x035c('0x2'),_0x1bb3e8[_0x035c('0x3')],_0x1bb3e8['channel'],_0x1bb3e8[_0x035c('0x4')],_0x1bb3e8[_0x035c('0x5')],_0x1bb3e8[_0x035c('0x6')],_0x1bb3e8['accountcode'],_0x1bb3e8[_0x035c('0x7')]));if(_0x1bb3e8[_0x035c('0x4')]){utils[_0x035c('0x8')](_0x1bb3e8[_0x035c('0x4')])[_0x035c('0x9')](function(_0x6c5aa8){if(_0x6c5aa8){_0x1bb3e8[_0x035c('0xa')]=_0x6c5aa8['type'];}utils[_0x035c('0xb')](_0x035c('0xc'),_0x1bb3e8);});}else{utils[_0x035c('0xb')](_0x035c('0xc'),_0x1bb3e8);}if(_0x1bb3e8[_0x035c('0xd')]){delete queues[_0x1bb3e8[_0x035c('0xd')]];}else{delete queues[_0x1bb3e8[_0x035c('0x3')]];}}exports[_0x035c('0xe')]=function(_0x3eb946){try{utils[_0x035c('0xf')](util[_0x035c('0x1')](_0x035c('0x10'),_0x3eb946['uniqueid']),_0x3eb946);utils[_0x035c('0x11')](util[_0x035c('0x1')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x3eb946[_0x035c('0x3')],_0x3eb946[_0x035c('0x4')],_0x3eb946[_0x035c('0x12')]));queues[_0x3eb946[_0x035c('0x3')]]=_['assign'](_0x3eb946,{'originalposition':_0x3eb946[_0x035c('0x12')],'queuecallerjoinAt':utils[_0x035c('0x13')](),'mohtime':0x0});}catch(_0xf61c55){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x10'),_0x3eb946[_0x035c('0x3')]),_0xf61c55);}};exports[_0x035c('0x15')]=function(_0xff55d){try{if(!_[_0x035c('0x16')](queues[_0xff55d[_0x035c('0x3')]])){utils[_0x035c('0xf')](util[_0x035c('0x1')]('[%s][queues][hangup]',_0xff55d[_0x035c('0x3')]),_0xff55d);if(queues[_0xff55d['uniqueid']]['queuecallerleaveAt']){if(!queues[_0xff55d['uniqueid']][_0x035c('0x17')]&&!queues[_0xff55d['uniqueid']][_0x035c('0x18')]){queues[_0xff55d[_0x035c('0x3')]][_0x035c('0x19')]=!![];queues[_0xff55d['uniqueid']][_0x035c('0x1a')]=utils['now']();queues[_0xff55d[_0x035c('0x3')]]['queuecallerexitreason']=_0x035c('0x1b');}utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x1c'),_0xff55d[_0x035c('0x3')],queues[_0xff55d[_0x035c('0x3')]]['name'],queues[_0xff55d[_0x035c('0x3')]]['queuecallerexitreason']));writeDB(queues[_0xff55d['uniqueid']]);}else if(queues[_0xff55d[_0x035c('0x3')]]['transfereduniqueid']){utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x1d'),_0xff55d['uniqueid'],queues[_0xff55d[_0x035c('0x3')]][_0x035c('0x1e')],queues[_0xff55d[_0x035c('0x3')]][_0x035c('0xd')]));queues[queues[_0xff55d['uniqueid']][_0x035c('0xd')]]=queues[_0xff55d[_0x035c('0x3')]];queues[queues[_0xff55d[_0x035c('0x3')]][_0x035c('0xd')]][_0x035c('0x1f')]=0x2;delete queues[_0xff55d[_0x035c('0x3')]];}}}catch(_0x151fed){utils[_0x035c('0x14')](util['format'](_0x035c('0x20'),_0xff55d[_0x035c('0x3')]),_0x151fed);}};exports[_0x035c('0x21')]=function(_0xfaed74){try{utils[_0x035c('0xf')](util['format'](_0x035c('0x22'),_0xfaed74[_0x035c('0x3')]),_0xfaed74);if(!_[_0x035c('0x16')](_0xfaed74[_0x035c('0x23')]['queuestatus'])&&_0xfaed74[_0x035c('0x24')]['toUpperCase']()!==_0x035c('0x25')){if(!_[_0x035c('0x16')](queues[_0xfaed74['uniqueid']])){queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x17')]=![];queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x26')]=null;queues[_0xfaed74['uniqueid']][_0x035c('0x18')]=!![];queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x27')]=utils[_0x035c('0x13')]();queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x7')]=_0xfaed74['value'][_0x035c('0x28')]();utils[_0x035c('0x11')](util[_0x035c('0x1')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xfaed74[_0x035c('0x3')],queues[_0xfaed74[_0x035c('0x3')]]['name'],_0xfaed74[_0x035c('0x24')],queues[_0xfaed74['uniqueid']][_0x035c('0x7')]));writeDB(queues[_0xfaed74[_0x035c('0x3')]]);}}else if(!_[_0x035c('0x16')](_0xfaed74[_0x035c('0x23')]['queueposition'])){if(!_[_0x035c('0x16')](queues[_0xfaed74[_0x035c('0x3')]])&&!queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x17')]){queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x17')]=![];queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x26')]=null;queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x18')]=!![];queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x27')]=utils[_0x035c('0x13')]();queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x7')]='EXITWITHKEY';utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x29'),_0xfaed74[_0x035c('0x3')],queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x1e')],_0xfaed74[_0x035c('0x24')],queues[_0xfaed74[_0x035c('0x3')]][_0x035c('0x7')]));}}}catch(_0xdfaf6a){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x22'),_0xfaed74[_0x035c('0x3')]),_0xdfaf6a);}};exports[_0x035c('0x17')]=function(_0x1eb717){try{if(!_['isNil'](queues[_0x1eb717[_0x035c('0x3')]])){utils[_0x035c('0xf')](util[_0x035c('0x1')](_0x035c('0x2a'),_0x1eb717[_0x035c('0x3')]),_0x1eb717);queues[_0x1eb717[_0x035c('0x3')]][_0x035c('0x18')]=![];queues[_0x1eb717[_0x035c('0x3')]][_0x035c('0x27')]=null;queues[_0x1eb717[_0x035c('0x3')]][_0x035c('0x17')]=!![];queues[_0x1eb717['uniqueid']][_0x035c('0x26')]=utils[_0x035c('0x13')]();queues[_0x1eb717[_0x035c('0x3')]][_0x035c('0x7')]=_0x035c('0x2b');utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x2c'),_0x1eb717[_0x035c('0x3')],queues[_0x1eb717[_0x035c('0x3')]][_0x035c('0x1e')],queues[_0x1eb717[_0x035c('0x3')]][_0x035c('0x7')]));}}catch(_0x3d6c04){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x2a'),_0x1eb717[_0x035c('0x3')]),_0x3d6c04);}};exports[_0x035c('0x2d')]=function(_0x106a2d){try{if(!_[_0x035c('0x16')](queues[_0x106a2d[_0x035c('0x3')]])){utils[_0x035c('0xf')](util[_0x035c('0x1')](_0x035c('0x2e'),_0x106a2d['uniqueid']),_0x106a2d);utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x2f'),_0x106a2d[_0x035c('0x3')],queues[_0x106a2d['uniqueid']][_0x035c('0x1e')],_0x106a2d['connectedlinenum'],_0x106a2d['connectedlinename']));queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x2d')]=!![];queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x30')]=utils['now']();queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x31')]=utils[_0x035c('0x32')](queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x30')],queues[_0x106a2d['uniqueid']]['queuecallerjoinAt']);queues[_0x106a2d[_0x035c('0x3')]]['position']=_0x106a2d[_0x035c('0x12')];queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x33')]=_0x106a2d[_0x035c('0x33')];queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x34')]=_0x106a2d[_0x035c('0x34')];queues[_0x106a2d[_0x035c('0x3')]][_0x035c('0x35')]=_0x106a2d[_0x035c('0x35')];}}catch(_0x251296){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x2e'),_0x106a2d['uniqueid']),_0x251296);}};exports[_0x035c('0x36')]=function(_0x551121){try{if(!_[_0x035c('0x16')](queues[_0x551121['uniqueid']])){utils['debug'](util['format'](_0x035c('0x37'),_0x551121[_0x035c('0x3')]),_0x551121);utils['info'](util[_0x035c('0x1')](_0x035c('0x38'),_0x551121[_0x035c('0x3')],queues[_0x551121[_0x035c('0x3')]][_0x035c('0x1e')],_0x551121[_0x035c('0x39')],_0x551121[_0x035c('0x3a')]));queues[_0x551121[_0x035c('0x3')]][_0x035c('0x17')]=![];queues[_0x551121['uniqueid']][_0x035c('0x17')]=![];queues[_0x551121[_0x035c('0x3')]][_0x035c('0x26')]=null;queues[_0x551121['uniqueid']][_0x035c('0x18')]=![];queues[_0x551121[_0x035c('0x3')]][_0x035c('0x7')]=null;queues[_0x551121['uniqueid']][_0x035c('0x27')]=null;queues[_0x551121['uniqueid']]['assigned']=!![];queues[_0x551121[_0x035c('0x3')]][_0x035c('0x3b')]=_0x551121[_0x035c('0x3a')];queues[_0x551121[_0x035c('0x3')]]['lastAssignedTo']=_0x551121[_0x035c('0x39')];}}catch(_0x4c480c){utils[_0x035c('0x14')](util['format']('[%s][queues][agentconnect]',_0x551121[_0x035c('0x3')]),_0x4c480c);}};exports[_0x035c('0x3c')]=function(_0x59e2b1){try{if(!_['isNil'](queues[_0x59e2b1[_0x035c('0x3')]])){if(queues[_0x59e2b1['uniqueid']][_0x035c('0x30')]){utils[_0x035c('0xf')](util['format']('[%s][queues][agentcomplete]',_0x59e2b1[_0x035c('0x3')]),_0x59e2b1);queues[_0x59e2b1['uniqueid']][_0x035c('0x17')]=![];queues[_0x59e2b1[_0x035c('0x3')]]['queuecallerabandon']=![];queues[_0x59e2b1[_0x035c('0x3')]]['queuecallerabandonAt']=null;queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x18')]=![];queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x27')]=null;queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x3d')]=!![];queues[_0x59e2b1['uniqueid']][_0x035c('0x5')]=_0x59e2b1[_0x035c('0x39')];queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x19')]=!![];queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x1a')]=utils[_0x035c('0x13')]();if(_0x59e2b1[_0x035c('0x3e')]==_0x035c('0x3f')){if(!queues[_0x59e2b1[_0x035c('0x3')]]['transfer']){queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x7')]=_0x035c('0x40');}}else{queues[_0x59e2b1['uniqueid']][_0x035c('0x7')]=_0x035c('0x41')+_0x59e2b1[_0x035c('0x3e')][_0x035c('0x28')]();}utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x42'),_0x59e2b1[_0x035c('0x3')],queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x1e')],_0x59e2b1[_0x035c('0x39')],queues[_0x59e2b1[_0x035c('0x3')]][_0x035c('0x7')]));writeDB(queues[_0x59e2b1['uniqueid']]);}}}catch(_0x278a9f){utils['error'](util['format'](_0x035c('0x43'),_0x59e2b1['uniqueid']),_0x278a9f);}};exports['blindtransfer']=function(_0x5a7297){try{if(!_[_0x035c('0x16')](queues[_0x5a7297[_0x035c('0x44')]])){utils[_0x035c('0xf')](util['format'](_0x035c('0x45'),_0x5a7297[_0x035c('0x3')]),_0x5a7297);queues[_0x5a7297[_0x035c('0x44')]][_0x035c('0x3f')]=!![];queues[_0x5a7297[_0x035c('0x44')]][_0x035c('0x46')]='BLIND';queues[_0x5a7297[_0x035c('0x44')]][_0x035c('0x47')]=_0x5a7297[_0x035c('0x48')];queues[_0x5a7297[_0x035c('0x44')]][_0x035c('0x49')]=_0x5a7297[_0x035c('0x44')];queues[_0x5a7297['transfereeuniqueid']][_0x035c('0x7')]=_0x035c('0x4a');utils[_0x035c('0x11')](util[_0x035c('0x1')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x5a7297[_0x035c('0x3')],queues[_0x5a7297[_0x035c('0x44')]][_0x035c('0x1e')],_0x5a7297[_0x035c('0x44')],_0x5a7297[_0x035c('0x48')]));}}catch(_0x1e31f4){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x45'),_0x5a7297['uniqueid']),_0x1e31f4);}};exports[_0x035c('0x4b')]=function(_0x31f49a){try{utils['debug'](util[_0x035c('0x1')](_0x035c('0x4c'),_0x31f49a[_0x035c('0x4d')]),_0x31f49a);if(_0x31f49a['origtransfereruniqueid']==_0x31f49a[_0x035c('0x4e')]){if(!_[_0x035c('0x16')](queues[_0x31f49a[_0x035c('0x4f')]])){utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x50'),_0x31f49a[_0x035c('0x4d')],queues[_0x31f49a['secondtransfererlinkedid']][_0x035c('0x1e')],_0x31f49a[_0x035c('0x51')]));queues[_0x31f49a[_0x035c('0x4f')]]['transfer']=!![];queues[_0x31f49a[_0x035c('0x4f')]][_0x035c('0x46')]=_0x035c('0x52');queues[_0x31f49a[_0x035c('0x4f')]]['transferexten']=_0x31f49a[_0x035c('0x51')];queues[_0x31f49a[_0x035c('0x4f')]][_0x035c('0x49')]=_0x31f49a['origtransfereruniqueid'];queues[_0x31f49a[_0x035c('0x4f')]][_0x035c('0x7')]=_0x035c('0x53');}if(!_[_0x035c('0x16')](queues[_0x31f49a['origtransfererlinkedid']])){if(_0x31f49a['transfereelinkedid']&&queues[_0x31f49a[_0x035c('0x54')]]){queues[_0x31f49a['transfereelinkedid']][_0x035c('0x1f')]=0x1;queues[_0x31f49a[_0x035c('0x44')]]=_[_0x035c('0x55')](queues[_0x31f49a[_0x035c('0x54')]]);queues[_0x31f49a['transfereeuniqueid']][_0x035c('0xd')]=_0x31f49a['transfertargetuniqueid'];queues[_0x31f49a['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x31f49a[_0x035c('0x44')]]['calleridnum']=queues[_0x31f49a['secondtransfererlinkedid']][_0x035c('0x6')];queues[_0x31f49a[_0x035c('0x44')]][_0x035c('0x56')]=queues[_0x31f49a['secondtransfererlinkedid']][_0x035c('0x56')];queues[_0x31f49a[_0x035c('0x44')]]['queuecallerjoinAt']=utils[_0x035c('0x13')]();queues[_0x31f49a[_0x035c('0x44')]]['queuecallerleaveAt']=utils['now']();queues[_0x31f49a[_0x035c('0x44')]][_0x035c('0x31')]=0x0;queues[_0x31f49a[_0x035c('0x44')]][_0x035c('0x57')]=0x0;utils['info'](util[_0x035c('0x1')](_0x035c('0x58'),_0x31f49a[_0x035c('0x4d')],queues[_0x31f49a['transfereeuniqueid']]['name'],queues[_0x31f49a[_0x035c('0x44')]][_0x035c('0x6')],queues[_0x31f49a[_0x035c('0x44')]]['calleridname']));}else{utils[_0x035c('0x11')](util['format'](_0x035c('0x59'),_0x31f49a[_0x035c('0x4d')],queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0x1e')],_0x31f49a[_0x035c('0x4f')]));queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0xd')]=_0x31f49a[_0x035c('0x4f')];}}}else if(_0x31f49a[_0x035c('0x5a')]==_0x31f49a[_0x035c('0x4f')]){if(!_[_0x035c('0x16')](queues[_0x31f49a[_0x035c('0x4e')]])){utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x5b'),_0x31f49a[_0x035c('0x4d')],queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0x1e')],_0x31f49a['secondtransfereruniqueid'],_0x31f49a[_0x035c('0x5c')]));queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0x3f')]=!![];queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0x46')]=_0x035c('0x52');queues[_0x31f49a['origtransfererlinkedid']]['transferexten']=_0x31f49a[_0x035c('0x5c')];queues[_0x31f49a[_0x035c('0x4e')]]['transferuniqueid']=_0x31f49a[_0x035c('0x5a')];queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0x7')]=_0x035c('0x53');}if(!_[_0x035c('0x16')](queues[_0x31f49a[_0x035c('0x4f')]])){if(_0x31f49a[_0x035c('0x5d')]&&queues[_0x31f49a[_0x035c('0x5d')]]){queues[_0x31f49a['transfertargetlinkedid']][_0x035c('0x1f')]=0x1;queues[_0x31f49a[_0x035c('0x5e')]]=_['clone'](queues[_0x31f49a[_0x035c('0x5d')]]);queues[_0x31f49a['transfertargetuniqueid']][_0x035c('0xd')]=_0x31f49a['transfertargetuniqueid'];queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x1f')]=0x2;queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x6')]=queues[_0x31f49a[_0x035c('0x4e')]][_0x035c('0x6')];queues[_0x31f49a[_0x035c('0x5e')]]['calleridname']=queues[_0x31f49a['origtransfererlinkedid']][_0x035c('0x56')];queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x5f')]=utils[_0x035c('0x13')]();queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x30')]=utils[_0x035c('0x13')]();queues[_0x31f49a['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x57')]=0x0;utils[_0x035c('0x11')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x31f49a['origtransfereruniqueid'],queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x1e')],queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0xd')],queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x6')],queues[_0x31f49a[_0x035c('0x5e')]][_0x035c('0x56')]));}else{utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x59'),_0x31f49a[_0x035c('0x4d')],queues[_0x31f49a[_0x035c('0x4f')]]['name'],_0x31f49a[_0x035c('0x4e')]));queues[_0x31f49a['secondtransfererlinkedid']][_0x035c('0xd')]=_0x31f49a['origtransfererlinkedid'];}}}}catch(_0x5b627d){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x4c'),_0x31f49a['origtransfereruniqueid']),_0x5b627d);}};exports['musiconholdstart']=function(_0x547b1d){try{if(!_[_0x035c('0x16')](queues[_0x547b1d['uniqueid']])){utils[_0x035c('0xf')](util[_0x035c('0x1')](_0x035c('0x60'),_0x547b1d[_0x035c('0x3')]),_0x547b1d);queues[_0x547b1d[_0x035c('0x3')]][_0x035c('0x61')]=utils[_0x035c('0x13')]();utils[_0x035c('0x11')](util[_0x035c('0x1')](_0x035c('0x62'),_0x547b1d['uniqueid'],queues[_0x547b1d[_0x035c('0x3')]]['name'],queues[_0x547b1d[_0x035c('0x3')]][_0x035c('0x61')]));}}catch(_0x31eedb){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x60'),_0x547b1d[_0x035c('0x3')]),_0x31eedb);}};exports[_0x035c('0x63')]=function(_0x559c01){try{if(!_['isNil'](queues[_0x559c01['uniqueid']])){if(!_[_0x035c('0x16')](queues[_0x559c01['uniqueid']][_0x035c('0x61')])){utils[_0x035c('0xf')](util[_0x035c('0x1')](_0x035c('0x64'),_0x559c01[_0x035c('0x3')]),_0x559c01);queues[_0x559c01[_0x035c('0x3')]]['mohtime']+=utils[_0x035c('0x32')](utils[_0x035c('0x13')](),queues[_0x559c01[_0x035c('0x3')]][_0x035c('0x61')]);utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x559c01[_0x035c('0x3')],queues[_0x559c01[_0x035c('0x3')]][_0x035c('0x1e')],queues[_0x559c01[_0x035c('0x3')]]['mohtime']));delete queues[_0x559c01[_0x035c('0x3')]]['musiconholdstartAt'];}}}catch(_0x40bf88){utils[_0x035c('0x14')](util[_0x035c('0x1')](_0x035c('0x64'),_0x559c01[_0x035c('0x3')]),_0x40bf88);}};
\ No newline at end of file
+var _0xc764=['queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','queueposition','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]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','calleridnum','accountcode','then','type','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','uniqueid','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','hangup','debug','[%s][queues][hangup]'];(function(_0xbcea1,_0x469f9f){var _0x17fb47=function(_0x48f5e7){while(--_0x48f5e7){_0xbcea1['push'](_0xbcea1['shift']());}};_0x17fb47(++_0x469f9f);}(_0xc764,0x11a));var _0x4c76=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0xc764[_0x3caeb5];return _0x5eca7e;};'use strict';var _=require(_0x4c76('0x0'));var util=require(_0x4c76('0x1'));var utils=require(_0x4c76('0x2'));var queues={};function writeDB(_0x3a2341){utils['info'](util[_0x4c76('0x3')](_0x4c76('0x4'),_0x3a2341['uniqueid'],_0x3a2341[_0x4c76('0x5')],_0x3a2341[_0x4c76('0x6')],_0x3a2341['lastAssignedTo'],_0x3a2341[_0x4c76('0x7')],_0x3a2341[_0x4c76('0x8')],_0x3a2341['queuecallerexitreason']));if(_0x3a2341[_0x4c76('0x6')]){utils['getVoiceQueueByName'](_0x3a2341[_0x4c76('0x6')])[_0x4c76('0x9')](function(_0x501d28){if(_0x501d28){_0x3a2341['type']=_0x501d28[_0x4c76('0xa')];}utils['request']('CreateVoiceQueueReport',_0x3a2341);});}else{utils['request'](_0x4c76('0xb'),_0x3a2341);}if(_0x3a2341[_0x4c76('0xc')]){delete queues[_0x3a2341[_0x4c76('0xc')]];}else{delete queues[_0x3a2341['uniqueid']];}}exports[_0x4c76('0xd')]=function(_0x1f2a2e){try{utils['debug'](util[_0x4c76('0x3')](_0x4c76('0xe'),_0x1f2a2e[_0x4c76('0xf')]),_0x1f2a2e);utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x11'),_0x1f2a2e['uniqueid'],_0x1f2a2e[_0x4c76('0x6')],_0x1f2a2e[_0x4c76('0x12')]));queues[_0x1f2a2e[_0x4c76('0xf')]]=_['assign'](_0x1f2a2e,{'originalposition':_0x1f2a2e[_0x4c76('0x12')],'queuecallerjoinAt':utils[_0x4c76('0x13')](),'mohtime':0x0});}catch(_0x300fb4){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0xe'),_0x1f2a2e[_0x4c76('0xf')]),_0x300fb4);}};exports[_0x4c76('0x15')]=function(_0x466aa7){try{if(!_['isNil'](queues[_0x466aa7[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util['format'](_0x4c76('0x17'),_0x466aa7[_0x4c76('0xf')]),_0x466aa7);if(queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x18')]){if(!queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x19')]&&!queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1a')]){queues[_0x466aa7['uniqueid']][_0x4c76('0x1b')]=!![];queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1c')]=utils['now']();queues[_0x466aa7['uniqueid']][_0x4c76('0x1d')]='COMPLETEDBYAGENT';}utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x1e'),_0x466aa7['uniqueid'],queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1f')],queues[_0x466aa7['uniqueid']][_0x4c76('0x1d')]));writeDB(queues[_0x466aa7[_0x4c76('0xf')]]);}else if(queues[_0x466aa7[_0x4c76('0xf')]]['transfereduniqueid']){utils[_0x4c76('0x10')](util[_0x4c76('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x466aa7[_0x4c76('0xf')],queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0x1f')],queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0xc')]));queues[queues[_0x466aa7[_0x4c76('0xf')]]['transfereduniqueid']]=queues[_0x466aa7[_0x4c76('0xf')]];queues[queues[_0x466aa7[_0x4c76('0xf')]][_0x4c76('0xc')]][_0x4c76('0x20')]=0x2;delete queues[_0x466aa7['uniqueid']];}}}catch(_0x21ac38){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x17'),_0x466aa7['uniqueid']),_0x21ac38);}};exports[_0x4c76('0x21')]=function(_0x33d5a9){try{utils['debug'](util[_0x4c76('0x3')](_0x4c76('0x22'),_0x33d5a9[_0x4c76('0xf')]),_0x33d5a9);if(!_[_0x4c76('0x23')](_0x33d5a9[_0x4c76('0x24')]['queuestatus'])&&_0x33d5a9[_0x4c76('0x25')][_0x4c76('0x26')]()!==_0x4c76('0x27')){if(!_[_0x4c76('0x23')](queues[_0x33d5a9[_0x4c76('0xf')]])){queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x28')]=null;queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1a')]=!![];queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x29')]=utils[_0x4c76('0x13')]();queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1d')]=_0x33d5a9[_0x4c76('0x25')][_0x4c76('0x26')]();utils[_0x4c76('0x10')](util[_0x4c76('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x33d5a9['uniqueid'],queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x33d5a9['value'],queues[_0x33d5a9[_0x4c76('0xf')]]['queuecallerexitreason']));writeDB(queues[_0x33d5a9['uniqueid']]);}}else if(!_[_0x4c76('0x23')](_0x33d5a9['variable'][_0x4c76('0x2a')])){if(!_['isNil'](queues[_0x33d5a9['uniqueid']])&&!queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x19')]){queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x33d5a9[_0x4c76('0xf')]]['queuecallerabandonAt']=null;queues[_0x33d5a9[_0x4c76('0xf')]]['queuecallerexit']=!![];queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x29')]=utils['now']();queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1d')]=_0x4c76('0x2b');utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x2c'),_0x33d5a9['uniqueid'],queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x33d5a9[_0x4c76('0x25')],queues[_0x33d5a9[_0x4c76('0xf')]][_0x4c76('0x1d')]));}}}catch(_0x1d9470){utils['error'](util[_0x4c76('0x3')]('[%s][queues][varset]',_0x33d5a9['uniqueid']),_0x1d9470);}};exports['queuecallerabandon']=function(_0x4e8ded){try{if(!_[_0x4c76('0x23')](queues[_0x4e8ded[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util[_0x4c76('0x3')](_0x4c76('0x2d'),_0x4e8ded[_0x4c76('0xf')]),_0x4e8ded);queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1a')]=![];queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x29')]=null;queues[_0x4e8ded[_0x4c76('0xf')]]['queuecallerabandon']=!![];queues[_0x4e8ded['uniqueid']][_0x4c76('0x28')]=utils[_0x4c76('0x13')]();queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1d')]=_0x4c76('0x2e');utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x2f'),_0x4e8ded['uniqueid'],queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1f')],queues[_0x4e8ded[_0x4c76('0xf')]][_0x4c76('0x1d')]));}}catch(_0x29caa0){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x2d'),_0x4e8ded['uniqueid']),_0x29caa0);}};exports[_0x4c76('0x30')]=function(_0x1da478){try{if(!_[_0x4c76('0x23')](queues[_0x1da478[_0x4c76('0xf')]])){utils['debug'](util[_0x4c76('0x3')]('[%s][queues][queuecallerleave]',_0x1da478['uniqueid']),_0x1da478);utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x31'),_0x1da478[_0x4c76('0xf')],queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x1da478['connectedlinenum'],_0x1da478['connectedlinename']));queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x30')]=!![];queues[_0x1da478['uniqueid']]['queuecallerleaveAt']=utils[_0x4c76('0x13')]();queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x32')]=utils[_0x4c76('0x33')](queues[_0x1da478[_0x4c76('0xf')]]['queuecallerleaveAt'],queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x34')]);queues[_0x1da478[_0x4c76('0xf')]][_0x4c76('0x12')]=_0x1da478[_0x4c76('0x12')];queues[_0x1da478['uniqueid']][_0x4c76('0x35')]=_0x1da478[_0x4c76('0x35')];queues[_0x1da478['uniqueid']][_0x4c76('0x36')]=_0x1da478[_0x4c76('0x36')];queues[_0x1da478['uniqueid']][_0x4c76('0x37')]=_0x1da478[_0x4c76('0x37')];}}catch(_0x24f5d8){utils['error'](util[_0x4c76('0x3')]('[%s][queues][queuecallerleave]',_0x1da478[_0x4c76('0xf')]),_0x24f5d8);}};exports[_0x4c76('0x38')]=function(_0x258bbc){try{if(!_[_0x4c76('0x23')](queues[_0x258bbc[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util[_0x4c76('0x3')]('[%s][queues][agentconnect]',_0x258bbc[_0x4c76('0xf')]),_0x258bbc);utils[_0x4c76('0x10')](util['format'](_0x4c76('0x39'),_0x258bbc[_0x4c76('0xf')],queues[_0x258bbc[_0x4c76('0xf')]]['name'],_0x258bbc[_0x4c76('0x3a')],_0x258bbc[_0x4c76('0x3b')]));queues[_0x258bbc[_0x4c76('0xf')]]['queuecallerabandon']=![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x28')]=null;queues[_0x258bbc[_0x4c76('0xf')]]['queuecallerexit']=![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x1d')]=null;queues[_0x258bbc[_0x4c76('0xf')]]['queuecallerexitAt']=null;queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x3c')]=!![];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x8')]=_0x258bbc[_0x4c76('0x3b')];queues[_0x258bbc[_0x4c76('0xf')]][_0x4c76('0x3d')]=_0x258bbc['membername'];}}catch(_0x1daf0d){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x3e'),_0x258bbc[_0x4c76('0xf')]),_0x1daf0d);}};exports[_0x4c76('0x3f')]=function(_0x1dcf1f){try{if(!_[_0x4c76('0x23')](queues[_0x1dcf1f[_0x4c76('0xf')]])){if(queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x18')]){utils[_0x4c76('0x16')](util[_0x4c76('0x3')](_0x4c76('0x40'),_0x1dcf1f['uniqueid']),_0x1dcf1f);queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x19')]=![];queues[_0x1dcf1f[_0x4c76('0xf')]]['queuecallerabandon']=![];queues[_0x1dcf1f[_0x4c76('0xf')]]['queuecallerabandonAt']=null;queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1a')]=![];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x29')]=null;queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x3c')]=!![];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x3d')]=_0x1dcf1f[_0x4c76('0x3a')];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1b')]=!![];queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1c')]=utils[_0x4c76('0x13')]();if(_0x1dcf1f['reason']==_0x4c76('0x41')){if(!queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x41')]){queues[_0x1dcf1f['uniqueid']][_0x4c76('0x1d')]=_0x4c76('0x42');}}else{queues[_0x1dcf1f['uniqueid']]['queuecallerexitreason']=_0x4c76('0x43')+_0x1dcf1f['reason']['toUpperCase']();}utils[_0x4c76('0x10')](util['format'](_0x4c76('0x44'),_0x1dcf1f[_0x4c76('0xf')],queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1f')],_0x1dcf1f['membername'],queues[_0x1dcf1f[_0x4c76('0xf')]][_0x4c76('0x1d')]));writeDB(queues[_0x1dcf1f[_0x4c76('0xf')]]);}}}catch(_0x4929ab){utils['error'](util[_0x4c76('0x3')](_0x4c76('0x40'),_0x1dcf1f[_0x4c76('0xf')]),_0x4929ab);}};exports['blindtransfer']=function(_0x5974b1){try{if(!_['isNil'](queues[_0x5974b1[_0x4c76('0x45')]])){utils['debug'](util[_0x4c76('0x3')]('[%s][queues][blindtransfer]',_0x5974b1['uniqueid']),_0x5974b1);queues[_0x5974b1['transfereeuniqueid']][_0x4c76('0x41')]=!![];queues[_0x5974b1[_0x4c76('0x45')]][_0x4c76('0x46')]=_0x4c76('0x47');queues[_0x5974b1['transfereeuniqueid']][_0x4c76('0x48')]=_0x5974b1['extension'];queues[_0x5974b1[_0x4c76('0x45')]][_0x4c76('0x49')]=_0x5974b1[_0x4c76('0x45')];queues[_0x5974b1[_0x4c76('0x45')]]['queuecallerexitreason']=_0x4c76('0x4a');utils['info'](util[_0x4c76('0x3')](_0x4c76('0x4b'),_0x5974b1[_0x4c76('0xf')],queues[_0x5974b1['transfereeuniqueid']][_0x4c76('0x1f')],_0x5974b1[_0x4c76('0x45')],_0x5974b1[_0x4c76('0x4c')]));}}catch(_0x1b202e){utils['error'](util[_0x4c76('0x3')](_0x4c76('0x4d'),_0x5974b1[_0x4c76('0xf')]),_0x1b202e);}};exports[_0x4c76('0x4e')]=function(_0x15fad7){try{utils['debug'](util[_0x4c76('0x3')](_0x4c76('0x4f'),_0x15fad7[_0x4c76('0x50')]),_0x15fad7);if(_0x15fad7['origtransfereruniqueid']==_0x15fad7[_0x4c76('0x51')]){if(!_[_0x4c76('0x23')](queues[_0x15fad7['secondtransfererlinkedid']])){utils[_0x4c76('0x10')](util[_0x4c76('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0x1f')],_0x15fad7['origtransfererexten']));queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0x41')]=!![];queues[_0x15fad7['secondtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x15fad7['secondtransfererlinkedid']][_0x4c76('0x48')]=_0x15fad7[_0x4c76('0x53')];queues[_0x15fad7['secondtransfererlinkedid']][_0x4c76('0x49')]=_0x15fad7['origtransfereruniqueid'];queues[_0x15fad7[_0x4c76('0x52')]]['queuecallerexitreason']=_0x4c76('0x54');}if(!_['isNil'](queues[_0x15fad7[_0x4c76('0x51')]])){if(_0x15fad7['transfereelinkedid']&&queues[_0x15fad7[_0x4c76('0x55')]]){queues[_0x15fad7[_0x4c76('0x55')]]['queuecallerenterreason']=0x1;queues[_0x15fad7[_0x4c76('0x45')]]=_[_0x4c76('0x56')](queues[_0x15fad7[_0x4c76('0x55')]]);queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0xc')]=_0x15fad7[_0x4c76('0x57')];queues[_0x15fad7[_0x4c76('0x45')]]['queuecallerenterreason']=0x2;queues[_0x15fad7['transfereeuniqueid']][_0x4c76('0x7')]=queues[_0x15fad7[_0x4c76('0x52')]]['calleridnum'];queues[_0x15fad7[_0x4c76('0x45')]]['calleridname']=queues[_0x15fad7[_0x4c76('0x52')]]['calleridname'];queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0x34')]=utils[_0x4c76('0x13')]();queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0x18')]=utils['now']();queues[_0x15fad7['transfereeuniqueid']][_0x4c76('0x32')]=0x0;queues[_0x15fad7['transfereeuniqueid']][_0x4c76('0x58')]=0x0;utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x59'),_0x15fad7['origtransfereruniqueid'],queues[_0x15fad7['transfereeuniqueid']]['name'],queues[_0x15fad7[_0x4c76('0x45')]]['calleridnum'],queues[_0x15fad7[_0x4c76('0x45')]][_0x4c76('0x5a')]));}else{utils['info'](util[_0x4c76('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x51')]]['name'],_0x15fad7[_0x4c76('0x52')]));queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0xc')]=_0x15fad7[_0x4c76('0x52')];}}}else if(_0x15fad7['secondtransfereruniqueid']==_0x15fad7[_0x4c76('0x52')]){if(!_[_0x4c76('0x23')](queues[_0x15fad7[_0x4c76('0x51')]])){utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x5b'),_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x51')]]['name'],_0x15fad7[_0x4c76('0x5c')],_0x15fad7[_0x4c76('0x5d')]));queues[_0x15fad7['origtransfererlinkedid']][_0x4c76('0x41')]=!![];queues[_0x15fad7[_0x4c76('0x51')]]['transfertype']='ATTENDED';queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x48')]=_0x15fad7[_0x4c76('0x5d')];queues[_0x15fad7[_0x4c76('0x51')]]['transferuniqueid']=_0x15fad7['secondtransfereruniqueid'];queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x1d')]='ATTENDEDTRANSFER';}if(!_[_0x4c76('0x23')](queues[_0x15fad7[_0x4c76('0x52')]])){if(_0x15fad7[_0x4c76('0x5e')]&&queues[_0x15fad7[_0x4c76('0x5e')]]){queues[_0x15fad7[_0x4c76('0x5e')]][_0x4c76('0x20')]=0x1;queues[_0x15fad7['transfertargetuniqueid']]=_[_0x4c76('0x56')](queues[_0x15fad7[_0x4c76('0x5e')]]);queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0xc')]=_0x15fad7['transfertargetuniqueid'];queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x20')]=0x2;queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x7')]=queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x7')];queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x5a')]=queues[_0x15fad7[_0x4c76('0x51')]][_0x4c76('0x5a')];queues[_0x15fad7['transfertargetuniqueid']][_0x4c76('0x34')]=utils['now']();queues[_0x15fad7[_0x4c76('0x57')]]['queuecallerleaveAt']=utils[_0x4c76('0x13')]();queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x32')]=0x0;queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x58')]=0x0;utils[_0x4c76('0x10')](util['format'](_0x4c76('0x5f'),_0x15fad7[_0x4c76('0x50')],queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x1f')],queues[_0x15fad7[_0x4c76('0x57')]]['transfereduniqueid'],queues[_0x15fad7[_0x4c76('0x57')]][_0x4c76('0x7')],queues[_0x15fad7['transfertargetuniqueid']][_0x4c76('0x5a')]));}else{utils['info'](util[_0x4c76('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x15fad7['origtransfereruniqueid'],queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0x1f')],_0x15fad7[_0x4c76('0x51')]));queues[_0x15fad7[_0x4c76('0x52')]][_0x4c76('0xc')]=_0x15fad7[_0x4c76('0x51')];}}}}catch(_0x3230e2){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x4f'),_0x15fad7[_0x4c76('0x50')]),_0x3230e2);}};exports[_0x4c76('0x60')]=function(_0x44008e){try{if(!_[_0x4c76('0x23')](queues[_0x44008e[_0x4c76('0xf')]])){utils[_0x4c76('0x16')](util['format'](_0x4c76('0x61'),_0x44008e['uniqueid']),_0x44008e);queues[_0x44008e[_0x4c76('0xf')]][_0x4c76('0x62')]=utils[_0x4c76('0x13')]();utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x63'),_0x44008e['uniqueid'],queues[_0x44008e[_0x4c76('0xf')]]['name'],queues[_0x44008e[_0x4c76('0xf')]][_0x4c76('0x62')]));}}catch(_0x5e087b){utils[_0x4c76('0x14')](util[_0x4c76('0x3')](_0x4c76('0x61'),_0x44008e['uniqueid']),_0x5e087b);}};exports['musiconholdstop']=function(_0x253e61){try{if(!_[_0x4c76('0x23')](queues[_0x253e61[_0x4c76('0xf')]])){if(!_['isNil'](queues[_0x253e61['uniqueid']][_0x4c76('0x62')])){utils[_0x4c76('0x16')](util['format'](_0x4c76('0x64'),_0x253e61[_0x4c76('0xf')]),_0x253e61);queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x58')]+=utils[_0x4c76('0x33')](utils['now'](),queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x62')]);utils[_0x4c76('0x10')](util[_0x4c76('0x3')](_0x4c76('0x65'),_0x253e61['uniqueid'],queues[_0x253e61[_0x4c76('0xf')]]['name'],queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x58')]));delete queues[_0x253e61[_0x4c76('0xf')]][_0x4c76('0x62')];}}}catch(_0x48c96f){utils['error'](util[_0x4c76('0x3')](_0x4c76('0x64'),_0x253e61[_0x4c76('0xf')]),_0x48c96f);}};
\ No newline at end of file
index 3689bbc..7205d82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f6b=['.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][newexten]','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','format','[%s][recordings][writeDB]','uniqueid','accountcode','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','context','exten','channel','error','newstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith'];(function(_0x3e78f4,_0x5d4c9a){var _0x5ca5eb=function(_0x1161b6){while(--_0x1161b6){_0x3e78f4['push'](_0x3e78f4['shift']());}};_0x5ca5eb(++_0x5d4c9a);}(_0x8f6b,0x10e));var _0xb8f6=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x8f6b[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x4d738a){utils['info'](util[_0xb8f6('0x2')](_0xb8f6('0x3'),_0x4d738a[_0xb8f6('0x4')]));if(_0x4d738a[_0xb8f6('0x5')]){utils['getUserByInternal'](_0x4d738a['accountcode'])['then'](function(_0x1482e0){if(_0x1482e0){_0x4d738a['membername']=_0x1482e0[_0xb8f6('0x6')];_0x4d738a[_0xb8f6('0x7')]=_0x1482e0['id'];}utils['request'](_0xb8f6('0x8'),_0x4d738a);});}else{utils[_0xb8f6('0x9')]('CreateVoiceRecording',_0x4d738a);}}exports[_0xb8f6('0xa')]=function(_0x3103cc){try{utils[_0xb8f6('0xb')](util[_0xb8f6('0x2')](_0xb8f6('0xc'),_0x3103cc[_0xb8f6('0x4')]),_0x3103cc);if(_0x3103cc['uniqueid']==_0x3103cc[_0xb8f6('0xd')]){utils[_0xb8f6('0xe')](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3103cc['uniqueid'],_0x3103cc[_0xb8f6('0xf')],_0x3103cc[_0xb8f6('0x10')]));recordings[_0x3103cc[_0xb8f6('0x4')]]={'uniqueid':_0x3103cc[_0xb8f6('0x4')],'accountcode':_0x3103cc[_0xb8f6('0x5')],'exten':_0x3103cc[_0xb8f6('0x10')],'context':_0x3103cc[_0xb8f6('0xf')],'channel':_0x3103cc[_0xb8f6('0x11')],'monitors':[]};}}catch(_0x121469){utils[_0xb8f6('0x12')](util[_0xb8f6('0x2')](_0xb8f6('0xc'),_0x3103cc[_0xb8f6('0x4')]),_0x121469);}};exports[_0xb8f6('0x13')]=function(_0x359915){try{utils[_0xb8f6('0xb')](util[_0xb8f6('0x2')]('[%s][recordings][newstate]',_0x359915[_0xb8f6('0x4')]),_0x359915);if(!_['isNil'](recordings[_0x359915['uniqueid']])&&_0x359915['channelstate']==0x6){utils['info'](util[_0xb8f6('0x2')](_0xb8f6('0x14'),_0x359915[_0xb8f6('0x4')],_0x359915[_0xb8f6('0xf')],_0x359915['channel']));}else if(!_[_0xb8f6('0x15')](recordings[_0x359915[_0xb8f6('0xd')]])&&_0x359915['channelstate']==0x6&&_0x359915[_0xb8f6('0xf')]!=_0xb8f6('0x16')){utils[_0xb8f6('0xe')](util['format'](_0xb8f6('0x17'),_0x359915[_0xb8f6('0x4')],_0x359915[_0xb8f6('0xd')],_0x359915[_0xb8f6('0xf')],_0x359915['channel']));recordings[_0x359915[_0xb8f6('0xd')]][_0xb8f6('0x5')]=_0x359915[_0xb8f6('0x5')];}}catch(_0x3a6847){utils[_0xb8f6('0x12')](util[_0xb8f6('0x2')](_0xb8f6('0x18'),_0x359915['uniqueid']),_0x3a6847);}};exports['varset']=function(_0xf44f23){try{if(!_[_0xb8f6('0x15')](_0xf44f23[_0xb8f6('0x19')])&&!_[_0xb8f6('0x15')](_0xf44f23['variable'][_0xb8f6('0x1a')])){utils[_0xb8f6('0xb')](util[_0xb8f6('0x2')]('[%s][recordings][varset]',_0xf44f23[_0xb8f6('0x4')]),_0xf44f23);utils[_0xb8f6('0xe')](util[_0xb8f6('0x2')](_0xb8f6('0x1b'),_0xf44f23[_0xb8f6('0x4')],_0xf44f23[_0xb8f6('0x19')],_0xf44f23[_0xb8f6('0x1c')]));if(_[_0xb8f6('0x1d')](_0xf44f23[_0xb8f6('0x1c')],_0xb8f6('0x1e'))){_0xf44f23[_0xb8f6('0x1c')]=_0xf44f23[_0xb8f6('0x1c')][_0xb8f6('0x1f')](_0xb8f6('0x1e'),_0xb8f6('0x20'));}if(recordings[_0xf44f23[_0xb8f6('0xd')]]){var _0x486e3a=_[_0xb8f6('0x21')](recordings[_0xf44f23['linkedid']]['monitors'],{'value':_0xf44f23[_0xb8f6('0x1c')]});if(_[_0xb8f6('0x15')](_0x486e3a)){recordings[_0xf44f23['linkedid']][_0xb8f6('0x22')][_0xb8f6('0x23')]({'value':_0xf44f23[_0xb8f6('0x1c')]});}}}}catch(_0x30737d){utils['error'](util[_0xb8f6('0x2')](_0xb8f6('0x24'),_0xf44f23[_0xb8f6('0x4')]),_0x30737d);}};exports[_0xb8f6('0x25')]=function(_0x153817){try{if(!_['isNil'](recordings[_0x153817[_0xb8f6('0x4')]])){utils[_0xb8f6('0xb')](util[_0xb8f6('0x2')](_0xb8f6('0x26'),_0x153817[_0xb8f6('0x4')]),_0x153817);utils[_0xb8f6('0xe')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x153817[_0xb8f6('0x4')],_0x153817[_0xb8f6('0x27')],_0x153817[_0xb8f6('0x28')],_0x153817[_0xb8f6('0x29')]));recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x27')]=_0x153817[_0xb8f6('0x27')];recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x28')]=_0x153817[_0xb8f6('0x28')];recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x2a')]=_0x153817[_0xb8f6('0x2a')];recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x2b')]=_0x153817[_0xb8f6('0x2b')];if(recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x2c')]==_0xb8f6('0x2d')&&recordings[_0x153817['uniqueid']][_0xb8f6('0x5')]){recordings[_0x153817[_0xb8f6('0x4')]]['connectedlinenum']=recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x5')];recordings[_0x153817[_0xb8f6('0x4')]][_0xb8f6('0x2b')]='';}recordings[_0x153817['uniqueid']][_0xb8f6('0x22')][_0xb8f6('0x2e')](function(_0x262a5a){var _0x102f55=_['clone'](recordings[_0x153817[_0xb8f6('0x4')]]);_0x102f55[_0xb8f6('0x1c')]=_0x262a5a[_0xb8f6('0x1c')];writeDB(_0x102f55);});delete recordings[_0x153817[_0xb8f6('0x4')]];}}catch(_0x1ca656){utils[_0xb8f6('0x12')](util[_0xb8f6('0x2')](_0xb8f6('0x26'),_0x153817['uniqueid']),_0x1ca656);}};exports['newexten']=function(_0x1cc144){try{if(!_['isNil'](recordings[_0x1cc144['uniqueid']])){utils[_0xb8f6('0xb')](util['format'](_0xb8f6('0x2f'),_0x1cc144[_0xb8f6('0x4')]),_0x1cc144);utils[_0xb8f6('0xe')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x1cc144[_0xb8f6('0x4')],_0x1cc144[_0xb8f6('0x30')],_0x1cc144['appdata']));if(_0x1cc144['application']['toLowerCase']()==_0xb8f6('0x31')&&_[_0xb8f6('0x32')](_0x1cc144[_0xb8f6('0x33')]['toLowerCase'](),_0xb8f6('0x34'))){var _0x36cce6=_0x1cc144['appdata'][_0xb8f6('0x35')]('=');var _0x454e9d=_0x36cce6[0x0][_0xb8f6('0x36')](_0x36cce6[0x0][_0xb8f6('0x37')]('(')+0x1,_0x36cce6[0x0]['lastIndexOf'](')'));var _0xeeaee5=_0x36cce6[0x1];recordings[_0x1cc144[_0xb8f6('0x4')]][_0x454e9d]=_0xeeaee5;}}}catch(_0x3b415d){utils['error'](util[_0xb8f6('0x2')](_0xb8f6('0x2f'),_0x1cc144[_0xb8f6('0x4')]),_0x3b415d);}};exports[_0xb8f6('0x38')]=function(_0x3325d5){try{if(!_[_0xb8f6('0x15')](recordings[_0x3325d5[_0xb8f6('0x4')]])){utils[_0xb8f6('0xb')](util['format'](_0xb8f6('0x39'),_0x3325d5[_0xb8f6('0x4')]),_0x3325d5);utils['info'](util[_0xb8f6('0x2')](_0xb8f6('0x3a'),_0x3325d5[_0xb8f6('0x4')],_0x3325d5['queue']));recordings[_0x3325d5['uniqueid']][_0xb8f6('0x3b')]=_0x3325d5['queue'];}}catch(_0x1d87c9){utils[_0xb8f6('0x12')](util[_0xb8f6('0x2')](_0xb8f6('0x39'),_0x3325d5[_0xb8f6('0x4')]),_0x1d87c9);}};
\ No newline at end of file
+var _0x4a43=['monitors','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','util','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','debug','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find'];(function(_0x492c8f,_0x3c657a){var _0x47dabf=function(_0x52a6b9){while(--_0x52a6b9){_0x492c8f['push'](_0x492c8f['shift']());}};_0x47dabf(++_0x3c657a);}(_0x4a43,0x11e));var _0x34a4=function(_0x472ae8,_0x2a0fc7){_0x472ae8=_0x472ae8-0x0;var _0x48240f=_0x4a43[_0x472ae8];return _0x48240f;};'use strict';var _=require('lodash');var util=require(_0x34a4('0x0'));var utils=require('./utils');var recordings={};function writeDB(_0x45f7f4){utils['info'](util[_0x34a4('0x1')](_0x34a4('0x2'),_0x45f7f4[_0x34a4('0x3')]));if(_0x45f7f4['accountcode']){utils[_0x34a4('0x4')](_0x45f7f4[_0x34a4('0x5')])[_0x34a4('0x6')](function(_0x195fbb){if(_0x195fbb){_0x45f7f4[_0x34a4('0x7')]=_0x195fbb[_0x34a4('0x8')];_0x45f7f4[_0x34a4('0x9')]=_0x195fbb['id'];}utils[_0x34a4('0xa')](_0x34a4('0xb'),_0x45f7f4);});}else{utils[_0x34a4('0xa')]('CreateVoiceRecording',_0x45f7f4);}}exports[_0x34a4('0xc')]=function(_0x58cb84){try{utils['debug'](util[_0x34a4('0x1')](_0x34a4('0xd'),_0x58cb84['uniqueid']),_0x58cb84);if(_0x58cb84[_0x34a4('0x3')]==_0x58cb84[_0x34a4('0xe')]){utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x10'),_0x58cb84[_0x34a4('0x3')],_0x58cb84[_0x34a4('0x11')],_0x58cb84[_0x34a4('0x12')]));recordings[_0x58cb84[_0x34a4('0x3')]]={'uniqueid':_0x58cb84[_0x34a4('0x3')],'accountcode':_0x58cb84[_0x34a4('0x5')],'exten':_0x58cb84[_0x34a4('0x12')],'context':_0x58cb84['context'],'channel':_0x58cb84[_0x34a4('0x13')],'monitors':[]};}}catch(_0x1d136a){utils[_0x34a4('0x14')](util['format'](_0x34a4('0xd'),_0x58cb84['uniqueid']),_0x1d136a);}};exports[_0x34a4('0x15')]=function(_0x2bf4af){try{utils['debug'](util['format'](_0x34a4('0x16'),_0x2bf4af[_0x34a4('0x3')]),_0x2bf4af);if(!_['isNil'](recordings[_0x2bf4af[_0x34a4('0x3')]])&&_0x2bf4af['channelstate']==0x6){utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x17'),_0x2bf4af[_0x34a4('0x3')],_0x2bf4af[_0x34a4('0x11')],_0x2bf4af['channel']));}else if(!_[_0x34a4('0x18')](recordings[_0x2bf4af['linkedid']])&&_0x2bf4af[_0x34a4('0x19')]==0x6&&_0x2bf4af[_0x34a4('0x11')]!=_0x34a4('0x1a')){utils['info'](util[_0x34a4('0x1')](_0x34a4('0x1b'),_0x2bf4af['uniqueid'],_0x2bf4af[_0x34a4('0xe')],_0x2bf4af['context'],_0x2bf4af[_0x34a4('0x13')]));recordings[_0x2bf4af[_0x34a4('0xe')]]['accountcode']=_0x2bf4af[_0x34a4('0x5')];}}catch(_0x27b5dc){utils[_0x34a4('0x14')](util[_0x34a4('0x1')](_0x34a4('0x16'),_0x2bf4af[_0x34a4('0x3')]),_0x27b5dc);}};exports[_0x34a4('0x1c')]=function(_0x947182){try{if(!_[_0x34a4('0x18')](_0x947182[_0x34a4('0x1d')])&&!_[_0x34a4('0x18')](_0x947182[_0x34a4('0x1d')][_0x34a4('0x1e')])){utils[_0x34a4('0x1f')](util['format']('[%s][recordings][varset]',_0x947182[_0x34a4('0x3')]),_0x947182);utils['info'](util['format'](_0x34a4('0x20'),_0x947182['uniqueid'],_0x947182[_0x34a4('0x1d')],_0x947182[_0x34a4('0x21')]));if(_[_0x34a4('0x22')](_0x947182['value'],_0x34a4('0x23'))){_0x947182[_0x34a4('0x21')]=_0x947182[_0x34a4('0x21')][_0x34a4('0x24')](_0x34a4('0x23'),_0x34a4('0x25'));}if(recordings[_0x947182[_0x34a4('0xe')]]){var _0x7444fe=_[_0x34a4('0x26')](recordings[_0x947182[_0x34a4('0xe')]][_0x34a4('0x27')],{'value':_0x947182[_0x34a4('0x21')]});if(_[_0x34a4('0x18')](_0x7444fe)){recordings[_0x947182[_0x34a4('0xe')]][_0x34a4('0x27')]['push']({'value':_0x947182[_0x34a4('0x21')]});}}}}catch(_0x186858){utils[_0x34a4('0x14')](util['format'](_0x34a4('0x28'),_0x947182['uniqueid']),_0x186858);}};exports[_0x34a4('0x29')]=function(_0x2dc1bc){try{if(!_['isNil'](recordings[_0x2dc1bc[_0x34a4('0x3')]])){utils[_0x34a4('0x1f')](util[_0x34a4('0x1')]('[%s][recordings][hangup]',_0x2dc1bc[_0x34a4('0x3')]),_0x2dc1bc);utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x2a'),_0x2dc1bc['uniqueid'],_0x2dc1bc[_0x34a4('0x2b')],_0x2dc1bc[_0x34a4('0x2c')],_0x2dc1bc[_0x34a4('0x2d')]));recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2b')]=_0x2dc1bc[_0x34a4('0x2b')];recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2c')]=_0x2dc1bc[_0x34a4('0x2c')];recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2e')]=_0x2dc1bc[_0x34a4('0x2e')];recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2f')]=_0x2dc1bc[_0x34a4('0x2f')];if(recordings[_0x2dc1bc[_0x34a4('0x3')]]['type']==_0x34a4('0x30')&&recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x5')]){recordings[_0x2dc1bc[_0x34a4('0x3')]][_0x34a4('0x2e')]=recordings[_0x2dc1bc['uniqueid']]['accountcode'];recordings[_0x2dc1bc['uniqueid']][_0x34a4('0x2f')]='';}recordings[_0x2dc1bc[_0x34a4('0x3')]]['monitors'][_0x34a4('0x31')](function(_0x27741a){var _0x3f0c64=_[_0x34a4('0x32')](recordings[_0x2dc1bc[_0x34a4('0x3')]]);_0x3f0c64[_0x34a4('0x21')]=_0x27741a[_0x34a4('0x21')];writeDB(_0x3f0c64);});delete recordings[_0x2dc1bc[_0x34a4('0x3')]];}}catch(_0x5912d7){utils['error'](util['format'](_0x34a4('0x33'),_0x2dc1bc[_0x34a4('0x3')]),_0x5912d7);}};exports[_0x34a4('0x34')]=function(_0x3caa3a){try{if(!_[_0x34a4('0x18')](recordings[_0x3caa3a[_0x34a4('0x3')]])){utils['debug'](util[_0x34a4('0x1')](_0x34a4('0x35'),_0x3caa3a[_0x34a4('0x3')]),_0x3caa3a);utils[_0x34a4('0xf')](util[_0x34a4('0x1')](_0x34a4('0x36'),_0x3caa3a[_0x34a4('0x3')],_0x3caa3a[_0x34a4('0x37')],_0x3caa3a[_0x34a4('0x38')]));if(_0x3caa3a[_0x34a4('0x37')]['toLowerCase']()=='set'&&_[_0x34a4('0x39')](_0x3caa3a[_0x34a4('0x38')][_0x34a4('0x3a')](),_0x34a4('0x3b'))){var _0x24c544=_0x3caa3a[_0x34a4('0x38')]['split']('=');var _0x2b1679=_0x24c544[0x0][_0x34a4('0x3c')](_0x24c544[0x0]['lastIndexOf']('(')+0x1,_0x24c544[0x0][_0x34a4('0x3d')](')'));var _0x2e14f0=_0x24c544[0x1];recordings[_0x3caa3a[_0x34a4('0x3')]][_0x2b1679]=_0x2e14f0;}}}catch(_0x3d70eb){utils[_0x34a4('0x14')](util[_0x34a4('0x1')]('[%s][recordings][newexten]',_0x3caa3a[_0x34a4('0x3')]),_0x3d70eb);}};exports[_0x34a4('0x3e')]=function(_0x5a16ba){try{if(!_[_0x34a4('0x18')](recordings[_0x5a16ba[_0x34a4('0x3')]])){utils[_0x34a4('0x1f')](util[_0x34a4('0x1')](_0x34a4('0x3f'),_0x5a16ba[_0x34a4('0x3')]),_0x5a16ba);utils['info'](util[_0x34a4('0x1')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x5a16ba[_0x34a4('0x3')],_0x5a16ba[_0x34a4('0x40')]));recordings[_0x5a16ba[_0x34a4('0x3')]][_0x34a4('0x40')]=_0x5a16ba[_0x34a4('0x40')];}}catch(_0x291f5c){utils[_0x34a4('0x14')](util[_0x34a4('0x1')](_0x34a4('0x3f'),_0x5a16ba[_0x34a4('0x3')]),_0x291f5c);}};
\ No newline at end of file
index 400377b..d53bdb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07f3=['./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','type','request','CreateVoiceTransferReport','blindtransfer','debug','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','blinds','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x07f3,0x124));var _0x307f=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x07f3[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x307f('0x0'));var util=require(_0x307f('0x1'));var utils=require(_0x307f('0x2'));function writeDB(_0x4169d0){utils[_0x307f('0x3')](util[_0x307f('0x4')](_0x307f('0x5'),_0x4169d0['type']===_0x307f('0x6')?_0x4169d0['origtransfereruniqueid']:_0x4169d0['uniqueid'],_0x4169d0[_0x307f('0x7')]));utils[_0x307f('0x8')](_0x307f('0x9'),_0x4169d0);}exports['blinds']={};exports[_0x307f('0xa')]=function(_0x55ebb2){try{utils[_0x307f('0xb')](util['format']('[%s][transfers][blindtransfer]',_0x55ebb2[_0x307f('0xc')]),_0x55ebb2);utils[_0x307f('0x3')](util['format'](_0x307f('0xd'),_0x55ebb2[_0x307f('0xc')],_0x55ebb2['transferercalleridnum'],_0x55ebb2[_0x307f('0xe')],_0x55ebb2['transfereecalleridnum'],_0x55ebb2[_0x307f('0xf')]));_0x55ebb2[_0x307f('0x7')]='blind';exports[_0x307f('0x10')][_0x55ebb2[_0x307f('0x11')]]=_0x55ebb2;writeDB(_0x55ebb2);}catch(_0x23e788){utils[_0x307f('0x12')](util[_0x307f('0x4')](_0x307f('0x13'),_0x55ebb2[_0x307f('0xc')]),_0x23e788);}};exports[_0x307f('0x14')]=function(_0x10d8d7){try{utils[_0x307f('0xb')](util['format']('[%s][transfers][attendedtransfer]',_0x10d8d7['origtransfereruniqueid']),_0x10d8d7);utils[_0x307f('0x3')](util['format'](_0x307f('0x15'),_0x10d8d7[_0x307f('0x16')],_0x10d8d7[_0x307f('0x17')],_0x10d8d7[_0x307f('0x18')],_0x10d8d7['transfertargetcalleridnum'],_0x10d8d7[_0x307f('0x19')]));_0x10d8d7=_['assign'](_0x10d8d7,{'transfererchannel':_0x10d8d7[_0x307f('0x1a')],'transferercalleridnum':_0x10d8d7[_0x307f('0x17')],'transferercalleridname':_0x10d8d7['origtransferercalleridname'],'transfererconnectedlinenum':_0x10d8d7['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x10d8d7[_0x307f('0x1b')],'transfereraccountcode':_0x10d8d7['origtransfereraccountcode'],'transferercontext':_0x10d8d7[_0x307f('0x1c')],'transfererexten':_0x10d8d7['secondtransfererexten'],'transfererlinkedid':_0x10d8d7[_0x307f('0x1d')],'context':_0x10d8d7[_0x307f('0x1e')],'extension':_0x10d8d7['origtransfererexten'],'type':_0x307f('0x6')});if(_[_0x307f('0x1f')](_0x10d8d7[_0x307f('0x20')])){_0x10d8d7=_[_0x307f('0x21')](_0x10d8d7,{'transfereechannel':_0x10d8d7[_0x307f('0x22')],'transfereecalleridnum':_0x10d8d7['transfertargetcalleridnum'],'transfereecalleridname':_0x10d8d7[_0x307f('0x19')],'transfereeconnectedlinenum':_0x10d8d7[_0x307f('0x23')],'transfereeconnectedlinename':_0x10d8d7[_0x307f('0x24')],'transfereeaccountcode':_0x10d8d7[_0x307f('0x25')],'transfereecontext':_0x10d8d7[_0x307f('0x26')],'transfereeexten':_0x10d8d7[_0x307f('0x27')],'transfereelinkedid':_0x10d8d7[_0x307f('0x28')]});}writeDB(_0x10d8d7);}catch(_0x4d08b7){utils['error'](util[_0x307f('0x4')](_0x307f('0x29'),_0x10d8d7['origtransfereruniqueid']),_0x4d08b7);}};
\ No newline at end of file
+var _0x8bc1=['attended','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','error','[%s][transfers][attendedtransfer]','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten'];(function(_0x5342f2,_0x5df717){var _0xa1f29c=function(_0x18b4e6){while(--_0x18b4e6){_0x5342f2['push'](_0x5342f2['shift']());}};_0xa1f29c(++_0x5df717);}(_0x8bc1,0x11a));var _0x18bc=function(_0x364103,_0x1afd7a){_0x364103=_0x364103-0x0;var _0x3017b3=_0x8bc1[_0x364103];return _0x3017b3;};'use strict';var _=require(_0x18bc('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x5c8a0a){utils[_0x18bc('0x1')](util[_0x18bc('0x2')](_0x18bc('0x3'),_0x5c8a0a[_0x18bc('0x4')]==='attended'?_0x5c8a0a[_0x18bc('0x5')]:_0x5c8a0a[_0x18bc('0x6')],_0x5c8a0a[_0x18bc('0x4')]));utils[_0x18bc('0x7')](_0x18bc('0x8'),_0x5c8a0a);}exports[_0x18bc('0x9')]={};exports[_0x18bc('0xa')]=function(_0x2132ce){try{utils[_0x18bc('0xb')](util['format'](_0x18bc('0xc'),_0x2132ce['uniqueid']),_0x2132ce);utils['info'](util[_0x18bc('0x2')](_0x18bc('0xd'),_0x2132ce[_0x18bc('0x6')],_0x2132ce[_0x18bc('0xe')],_0x2132ce[_0x18bc('0xf')],_0x2132ce['transfereecalleridnum'],_0x2132ce[_0x18bc('0x10')]));_0x2132ce[_0x18bc('0x4')]=_0x18bc('0x11');exports[_0x18bc('0x9')][_0x2132ce['transfereruniqueid']]=_0x2132ce;writeDB(_0x2132ce);}catch(_0x69c71f){utils[_0x18bc('0x12')](util[_0x18bc('0x2')](_0x18bc('0xc'),_0x2132ce[_0x18bc('0x6')]),_0x69c71f);}};exports['attendedtransfer']=function(_0x98892){try{utils['debug'](util['format'](_0x18bc('0x13'),_0x98892[_0x18bc('0x5')]),_0x98892);utils[_0x18bc('0x1')](util[_0x18bc('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x98892[_0x18bc('0x5')],_0x98892['origtransferercalleridnum'],_0x98892[_0x18bc('0x14')],_0x98892[_0x18bc('0x15')],_0x98892[_0x18bc('0x16')]));_0x98892=_[_0x18bc('0x17')](_0x98892,{'transfererchannel':_0x98892['origtransfererchannel'],'transferercalleridnum':_0x98892[_0x18bc('0x18')],'transferercalleridname':_0x98892[_0x18bc('0x14')],'transfererconnectedlinenum':_0x98892[_0x18bc('0x19')],'transfererconnectedlinename':_0x98892['secondtransfererconnectedlinename'],'transfereraccountcode':_0x98892['origtransfereraccountcode'],'transferercontext':_0x98892[_0x18bc('0x1a')],'transfererexten':_0x98892['secondtransfererexten'],'transfererlinkedid':_0x98892[_0x18bc('0x1b')],'context':_0x98892[_0x18bc('0x1c')],'extension':_0x98892[_0x18bc('0x1d')],'type':_0x18bc('0x1e')});if(_['isNil'](_0x98892[_0x18bc('0x1f')])){_0x98892=_['assign'](_0x98892,{'transfereechannel':_0x98892[_0x18bc('0x20')],'transfereecalleridnum':_0x98892[_0x18bc('0x15')],'transfereecalleridname':_0x98892['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x98892[_0x18bc('0x21')],'transfereeconnectedlinename':_0x98892[_0x18bc('0x22')],'transfereeaccountcode':_0x98892[_0x18bc('0x23')],'transfereecontext':_0x98892[_0x18bc('0x24')],'transfereeexten':_0x98892[_0x18bc('0x25')],'transfereelinkedid':_0x98892[_0x18bc('0x26')]});}writeDB(_0x98892);}catch(_0x6b06b4){utils[_0x18bc('0x12')](util[_0x18bc('0x2')](_0x18bc('0x13'),_0x98892['origtransfereruniqueid']),_0x6b06b4);}};
\ No newline at end of file
index b04f898..e168355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0d8=['[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','util','client','http','../../config/logger','xdr','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','internal','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0xd0d8,0xa7));var _0x8d0d=function(_0x13eec2,_0xe78b42){_0x13eec2=_0x13eec2-0x0;var _0x46c367=_0xd0d8[_0x13eec2];return _0x46c367;};'use strict';var BPromise=require(_0x8d0d('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x8d0d('0x1'));var client=jayson[_0x8d0d('0x2')][_0x8d0d('0x3')]({'port':0x2329});var logger=require(_0x8d0d('0x4'))(_0x8d0d('0x5'));exports['info']=function(_0x511951,_0x1c396c){logger['info'](_0x511951,_0x1c396c?util[_0x8d0d('0x6')](_0x1c396c,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x49d4e7,_0x572398){logger[_0x8d0d('0x7')](_0x49d4e7,_0x572398?util[_0x8d0d('0x6')](_0x572398,{'showHidden':![],'depth':null}):'');};exports[_0x8d0d('0x8')]=function(_0x267c17,_0xb10505){logger['error'](_0x267c17,_0xb10505?util[_0x8d0d('0x6')](_0xb10505,{'showHidden':![],'depth':null}):'');};exports[_0x8d0d('0x9')]=function(_0x440958,_0x3beff3){return client[_0x8d0d('0x9')](_0x440958,{'body':_0x3beff3})['then'](function(_0x477351){logger['debug'](_0x8d0d('0xa'),_0x440958,_0x477351?util[_0x8d0d('0x6')](_0x477351,{'showHidden':![],'depth':null}):'');})[_0x8d0d('0xb')](function(_0x3d4b26){logger[_0x8d0d('0x8')](_0x8d0d('0xa'),_0x440958,_0x3d4b26?util['inspect'](_0x3d4b26,{'showHidden':![],'depth':null}):'');});};function getUser(_0x354d26){return client[_0x8d0d('0x9')](_0x8d0d('0xc'),{'options':{'raw':!![],'attributes':['id',_0x8d0d('0xd'),'name',_0x8d0d('0xe')],'where':_0x354d26,'limit':0x1}})[_0x8d0d('0xf')](function(_0x3a5ac4){logger[_0x8d0d('0x7')](_0x8d0d('0x10'),JSON[_0x8d0d('0x11')](_0x354d26),_0x3a5ac4?util['inspect'](_0x3a5ac4,{'showHidden':![],'depth':null}):'');return _0x3a5ac4[_0x8d0d('0x12')][_0x8d0d('0x13')]?_0x3a5ac4[_0x8d0d('0x12')][0x0]:null;});}exports[_0x8d0d('0x14')]=function(_0x4f93bb){return new BPromise(function(_0x149a6e,_0x51c7b1){if(_0x4f93bb){return getUser({'internal':_0x4f93bb})[_0x8d0d('0xf')](function(_0x242498){logger[_0x8d0d('0x15')](_0x8d0d('0x16'),_0x4f93bb,_0x242498?_0x8d0d('0x17'):'notfound');return _0x149a6e(_0x242498);})[_0x8d0d('0xb')](function(_0x28bef3){logger[_0x8d0d('0x8')]('[utils][getUserByInternal]',_0x28bef3?util['inspect'](_0x28bef3,{'showHidden':![],'depth':null}):'');return _0x149a6e(null);});}return _0x149a6e(null);});};exports[_0x8d0d('0x18')]=function(_0x45e4bb){return new BPromise(function(_0x1a3af7,_0x4d8810){if(_0x45e4bb){return getUser({'interface':_0x45e4bb})[_0x8d0d('0xf')](function(_0x37aa2c){logger['info'](_0x8d0d('0x19'),_0x45e4bb,_0x37aa2c?_0x8d0d('0x17'):_0x8d0d('0x1a'));return _0x1a3af7(_0x37aa2c);})['catch'](function(_0x44082c){logger[_0x8d0d('0x8')](_0x8d0d('0x1b'),_0x44082c?util['inspect'](_0x44082c,{'showHidden':![],'depth':null}):'');return _0x1a3af7(null);});}return _0x1a3af7(null);});};exports[_0x8d0d('0x1c')]=function(_0x57876f){return new BPromise(function(_0x177509,_0x1394fb){if(_0x57876f){return getUser({'name':_0x57876f})[_0x8d0d('0xf')](function(_0x165e25){logger[_0x8d0d('0x15')](_0x8d0d('0x1d'),_0x57876f,_0x165e25?_0x8d0d('0x17'):_0x8d0d('0x1a'));return _0x177509(_0x165e25);})[_0x8d0d('0xb')](function(_0x2ab08e){logger[_0x8d0d('0x8')](_0x8d0d('0x1e'),_0x2ab08e?util[_0x8d0d('0x6')](_0x2ab08e,{'showHidden':![],'depth':null}):'');return _0x177509(null);});}return _0x177509(null);});};exports[_0x8d0d('0x1f')]=function(_0x3570fd){return new BPromise(function(_0x2705ce,_0x4ff383){if(_0x3570fd){return client[_0x8d0d('0x9')](_0x8d0d('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0x8d0d('0x21'),'acw',_0x8d0d('0x22')],'where':{'name':_0x3570fd},'limit':0x1}})[_0x8d0d('0xf')](function(_0x341574){logger['debug'](_0x8d0d('0x23'),_0x3570fd,_0x341574?util[_0x8d0d('0x6')](_0x341574,{'showHidden':![],'depth':null}):'');logger[_0x8d0d('0x15')](_0x8d0d('0x24'),_0x3570fd,_0x341574?_0x8d0d('0x17'):_0x8d0d('0x1a'));return _0x2705ce(_0x341574[_0x8d0d('0x12')]['length']?_0x341574[_0x8d0d('0x12')][0x0]:null);})['catch'](function(_0x37969d){logger[_0x8d0d('0x8')](_0x8d0d('0x25'),_0x37969d?util['inspect'](_0x37969d,{'showHidden':![],'depth':null}):'');return _0x2705ce(null);});}return _0x2705ce(null);});};exports[_0x8d0d('0x26')]=function(_0x3e29f0,_0x48b114){return moment(_0x3e29f0)[_0x8d0d('0x27')](_0x48b114,_0x8d0d('0x28'))[_0x8d0d('0x29')](_0x8d0d('0x2a'));};exports[_0x8d0d('0x2b')]=function(_0x41f1dc,_0x10944c){return moment(_0x41f1dc)[_0x8d0d('0x2c')](_0x10944c,'seconds')['format'](_0x8d0d('0x2a'));};exports[_0x8d0d('0x2d')]=function(_0x4ed140,_0x2389e7){return moment(_0x4ed140)[_0x8d0d('0x2e')](moment(_0x2389e7),_0x8d0d('0x28'));};exports[_0x8d0d('0x2f')]=function(_0xb6ea8b,_0x477c9e){return parseInt(_0xb6ea8b,0xa)+parseInt(_0x477c9e,0xa);};exports[_0x8d0d('0x30')]=function(){return moment()[_0x8d0d('0x29')](_0x8d0d('0x2a'));};exports['isAfter']=function(_0x58f3d9,_0x212461){if(_0x212461){return moment(_0x58f3d9)[_0x8d0d('0x31')](_0x212461);}return!![];};exports[_0x8d0d('0x32')]=function(_0x49e0e5,_0x1d988b){if(_0x1d988b){return moment(_0x49e0e5)[_0x8d0d('0x32')](_0x1d988b);}else if(_0x49e0e5){return!![];}return![];};
\ No newline at end of file
+var _0xbc6b=['sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByInterface]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','length','add','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diffTime'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xbc6b,0x14b));var _0xbbc6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbc6b[_0x126558];return _0x1f6d14;};'use strict';var BPromise=require(_0xbbc6('0x0'));var jayson=require(_0xbbc6('0x1'));var moment=require(_0xbbc6('0x2'));var util=require('util');var client=jayson[_0xbbc6('0x3')][_0xbbc6('0x4')]({'port':0x2329});var logger=require(_0xbbc6('0x5'))(_0xbbc6('0x6'));exports['info']=function(_0x2815c4,_0x3c385a){logger[_0xbbc6('0x7')](_0x2815c4,_0x3c385a?util[_0xbbc6('0x8')](_0x3c385a,{'showHidden':![],'depth':null}):'');};exports[_0xbbc6('0x9')]=function(_0x5bf6ef,_0x5b915c){logger[_0xbbc6('0x9')](_0x5bf6ef,_0x5b915c?util[_0xbbc6('0x8')](_0x5b915c,{'showHidden':![],'depth':null}):'');};exports[_0xbbc6('0xa')]=function(_0x295ce0,_0x2de381){logger['error'](_0x295ce0,_0x2de381?util['inspect'](_0x2de381,{'showHidden':![],'depth':null}):'');};exports[_0xbbc6('0xb')]=function(_0x287f19,_0x42704e){return client['request'](_0x287f19,{'body':_0x42704e})[_0xbbc6('0xc')](function(_0x2cde3e){logger[_0xbbc6('0x9')](_0xbbc6('0xd'),_0x287f19,_0x2cde3e?util[_0xbbc6('0x8')](_0x2cde3e,{'showHidden':![],'depth':null}):'');})[_0xbbc6('0xe')](function(_0x33435b){logger[_0xbbc6('0xa')](_0xbbc6('0xd'),_0x287f19,_0x33435b?util[_0xbbc6('0x8')](_0x33435b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2c90e8){return client[_0xbbc6('0xb')](_0xbbc6('0xf'),{'options':{'raw':!![],'attributes':['id',_0xbbc6('0x10'),_0xbbc6('0x11'),_0xbbc6('0x12')],'where':_0x2c90e8,'limit':0x1}})[_0xbbc6('0xc')](function(_0x4be420){logger[_0xbbc6('0x9')](_0xbbc6('0x13'),JSON['stringify'](_0x2c90e8),_0x4be420?util[_0xbbc6('0x8')](_0x4be420,{'showHidden':![],'depth':null}):'');return _0x4be420[_0xbbc6('0x14')]['length']?_0x4be420[_0xbbc6('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0xd1f3ff){return new BPromise(function(_0x3c5c65,_0x27e668){if(_0xd1f3ff){return getUser({'internal':_0xd1f3ff})[_0xbbc6('0xc')](function(_0x4c311d){logger[_0xbbc6('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xd1f3ff,_0x4c311d?'found':_0xbbc6('0x15'));return _0x3c5c65(_0x4c311d);})[_0xbbc6('0xe')](function(_0x2abf23){logger['error']('[utils][getUserByInternal]',_0x2abf23?util[_0xbbc6('0x8')](_0x2abf23,{'showHidden':![],'depth':null}):'');return _0x3c5c65(null);});}return _0x3c5c65(null);});};exports[_0xbbc6('0x16')]=function(_0x4d0d12){return new BPromise(function(_0x5835a0,_0x235e64){if(_0x4d0d12){return getUser({'interface':_0x4d0d12})[_0xbbc6('0xc')](function(_0x587be5){logger[_0xbbc6('0x7')](_0xbbc6('0x17'),_0x4d0d12,_0x587be5?_0xbbc6('0x18'):_0xbbc6('0x15'));return _0x5835a0(_0x587be5);})['catch'](function(_0x246f95){logger['error'](_0xbbc6('0x19'),_0x246f95?util[_0xbbc6('0x8')](_0x246f95,{'showHidden':![],'depth':null}):'');return _0x5835a0(null);});}return _0x5835a0(null);});};exports['getUserByName']=function(_0x224009){return new BPromise(function(_0x570159,_0x2664f8){if(_0x224009){return getUser({'name':_0x224009})[_0xbbc6('0xc')](function(_0x231900){logger[_0xbbc6('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x224009,_0x231900?_0xbbc6('0x18'):'notfound');return _0x570159(_0x231900);})[_0xbbc6('0xe')](function(_0x8c33ab){logger[_0xbbc6('0xa')]('[utils][getUserByName]',_0x8c33ab?util[_0xbbc6('0x8')](_0x8c33ab,{'showHidden':![],'depth':null}):'');return _0x570159(null);});}return _0x570159(null);});};exports[_0xbbc6('0x1a')]=function(_0x3ac34d){return new BPromise(function(_0x343f92,_0x14d7d5){if(_0x3ac34d){return client[_0xbbc6('0xb')](_0xbbc6('0x1b'),{'options':{'raw':!![],'attributes':['id','name',_0xbbc6('0x1c'),_0xbbc6('0x1d'),_0xbbc6('0x1e')],'where':{'name':_0x3ac34d},'limit':0x1}})[_0xbbc6('0xc')](function(_0x5cae47){logger['debug'](_0xbbc6('0x1f'),_0x3ac34d,_0x5cae47?util[_0xbbc6('0x8')](_0x5cae47,{'showHidden':![],'depth':null}):'');logger[_0xbbc6('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x3ac34d,_0x5cae47?'found':_0xbbc6('0x15'));return _0x343f92(_0x5cae47[_0xbbc6('0x14')][_0xbbc6('0x20')]?_0x5cae47[_0xbbc6('0x14')][0x0]:null);})[_0xbbc6('0xe')](function(_0x24d2c1){logger[_0xbbc6('0xa')]('[utils][getVoiceQueueByName]',_0x24d2c1?util[_0xbbc6('0x8')](_0x24d2c1,{'showHidden':![],'depth':null}):'');return _0x343f92(null);});}return _0x343f92(null);});};exports['addTime']=function(_0x3530e7,_0x525ef0){return moment(_0x3530e7)[_0xbbc6('0x21')](_0x525ef0,'seconds')['format'](_0xbbc6('0x22'));};exports['subtractTime']=function(_0x8acff5,_0x57f888){return moment(_0x8acff5)[_0xbbc6('0x23')](_0x57f888,'seconds')[_0xbbc6('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xbbc6('0x25')]=function(_0x4a0b76,_0x57c89c){return moment(_0x4a0b76)['diff'](moment(_0x57c89c),'seconds');};exports[_0xbbc6('0x26')]=function(_0xb21bc9,_0x1bb104){return parseInt(_0xb21bc9,0xa)+parseInt(_0x1bb104,0xa);};exports['now']=function(){return moment()[_0xbbc6('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x3e43f9,_0x46ac49){if(_0x46ac49){return moment(_0x3e43f9)[_0xbbc6('0x27')](_0x46ac49);}return!![];};exports[_0xbbc6('0x28')]=function(_0x1a71ff,_0xf9fb74){if(_0xf9fb74){return moment(_0x1a71ff)[_0xbbc6('0x28')](_0xf9fb74);}else if(_0x1a71ff){return!![];}return![];};
\ No newline at end of file